From 758d8061a2044185391e0d7333b4d82324d05cb0 Mon Sep 17 00:00:00 2001 From: zhangshuxun <17773439684@163.com> Date: Wed, 25 Jun 2025 17:18:43 +0800 Subject: [PATCH 1/2] bsp: Separate nuvoton drivers --- bsp/nuvoton/README.md | 2 +- .../m031/CMSIS/Include/arm_common_tables.h | 136 - .../m031/CMSIS/Include/arm_const_structs.h | 79 - .../libraries/m031/CMSIS/Include/arm_math.h | 7154 ------------ .../m031/CMSIS/Include/cmsis_armcc.h | 734 -- .../m031/CMSIS/Include/cmsis_armcc_V6.h | 1804 ---- .../libraries/m031/CMSIS/Include/cmsis_gcc.h | 1373 --- .../libraries/m031/CMSIS/Include/core_cm0.h | 798 -- .../m031/CMSIS/Include/core_cm0plus.h | 914 -- .../libraries/m031/CMSIS/Include/core_cm3.h | 1763 --- .../libraries/m031/CMSIS/Include/core_cm4.h | 1937 ---- .../libraries/m031/CMSIS/Include/core_cm7.h | 2512 ----- .../m031/CMSIS/Include/core_cmFunc.h | 87 - .../m031/CMSIS/Include/core_cmInstr.h | 87 - .../m031/CMSIS/Include/core_cmSimd.h | 96 - .../libraries/m031/CMSIS/Include/core_sc000.h | 926 -- .../libraries/m031/CMSIS/Include/core_sc300.h | 1745 --- bsp/nuvoton/libraries/m031/CMSIS/SConscript | 16 - .../Device/Nuvoton/M031/Include/M031Series.h | 590 - .../Device/Nuvoton/M031/Include/NuMicro.h | 17 - .../Device/Nuvoton/M031/Include/acmp_reg.h | 255 - .../Device/Nuvoton/M031/Include/adc_reg.h | 400 - .../Device/Nuvoton/M031/Include/bpwm_reg.h | 1743 --- .../Device/Nuvoton/M031/Include/clk_reg.h | 918 -- .../Device/Nuvoton/M031/Include/crc_reg.h | 151 - .../Device/Nuvoton/M031/Include/ebi_reg.h | 224 - .../Device/Nuvoton/M031/Include/fmc_reg.h | 317 - .../Device/Nuvoton/M031/Include/gpio_reg.h | 710 -- .../Device/Nuvoton/M031/Include/hdiv_reg.h | 130 - .../Device/Nuvoton/M031/Include/i2c_reg.h | 750 -- .../Device/Nuvoton/M031/Include/pdma_reg.h | 675 -- .../Device/Nuvoton/M031/Include/pwm_reg.h | 2294 ---- .../Device/Nuvoton/M031/Include/qspi_reg.h | 586 - .../Device/Nuvoton/M031/Include/rtc_reg.h | 419 - .../Device/Nuvoton/M031/Include/spi_reg.h | 788 -- .../Device/Nuvoton/M031/Include/sys_reg.h | 1484 --- .../Nuvoton/M031/Include/system_M031Series.h | 105 - .../Device/Nuvoton/M031/Include/timer_reg.h | 336 - .../Device/Nuvoton/M031/Include/uart_reg.h | 1085 -- .../Device/Nuvoton/M031/Include/ui2c_reg.h | 570 - .../Device/Nuvoton/M031/Include/usbd_reg.h | 570 - .../Device/Nuvoton/M031/Include/uspi_reg.h | 673 -- .../Device/Nuvoton/M031/Include/uuart_reg.h | 666 -- .../Device/Nuvoton/M031/Include/wdt_reg.h | 174 - .../Device/Nuvoton/M031/Include/wwdt_reg.h | 148 - .../M031/Source/ARM/startup_M031Series.s | 259 - .../M031/Source/GCC/startup_M031Series.S | 229 - .../M031/Source/IAR/startup_M031Series.s | 202 - .../Nuvoton/M031/Source/system_M031Series.c | 130 - bsp/nuvoton/libraries/m031/Device/SConscript | 25 - .../libraries/m031/StdDriver/SConscript | 28 - .../libraries/m031/StdDriver/inc/nu_acmp.h | 401 - .../libraries/m031/StdDriver/inc/nu_adc.h | 418 - .../libraries/m031/StdDriver/inc/nu_bpwm.h | 379 - .../libraries/m031/StdDriver/inc/nu_clk.h | 600 -- .../libraries/m031/StdDriver/inc/nu_crc.h | 117 - .../libraries/m031/StdDriver/inc/nu_ebi.h | 260 - .../libraries/m031/StdDriver/inc/nu_fmc.h | 269 - .../libraries/m031/StdDriver/inc/nu_gpio.h | 481 - .../libraries/m031/StdDriver/inc/nu_hdiv.h | 88 - .../libraries/m031/StdDriver/inc/nu_i2c.h | 540 - .../libraries/m031/StdDriver/inc/nu_pdma.h | 358 - .../libraries/m031/StdDriver/inc/nu_pwm.h | 514 - .../libraries/m031/StdDriver/inc/nu_qspi.h | 412 - .../libraries/m031/StdDriver/inc/nu_rtc.h | 300 - .../libraries/m031/StdDriver/inc/nu_spi.h | 558 - .../libraries/m031/StdDriver/inc/nu_sys.h | 1391 --- .../libraries/m031/StdDriver/inc/nu_timer.h | 507 - .../libraries/m031/StdDriver/inc/nu_uart.h | 495 - .../libraries/m031/StdDriver/inc/nu_usbd.h | 699 -- .../m031/StdDriver/inc/nu_usci_i2c.h | 332 - .../m031/StdDriver/inc/nu_usci_spi.h | 428 - .../m031/StdDriver/inc/nu_usci_uart.h | 523 - .../libraries/m031/StdDriver/inc/nu_wdt.h | 220 - .../libraries/m031/StdDriver/inc/nu_wwdt.h | 155 - .../m031/StdDriver/lib/libStdDriver.ewd | 2966 ----- .../m031/StdDriver/lib/libStdDriver.ewp | 2152 ---- .../m031/StdDriver/lib/libStdDriver.eww | 10 - .../m031/StdDriver/lib/libStdDriver.uvprojx | 513 - .../m031/StdDriver/lib/nutool_clkcfg.h | 27 - .../libraries/m031/StdDriver/src/nu_acmp.c | 82 - .../libraries/m031/StdDriver/src/nu_adc.c | 200 - .../libraries/m031/StdDriver/src/nu_bpwm.c | 751 -- .../libraries/m031/StdDriver/src/nu_clk.c | 836 -- .../libraries/m031/StdDriver/src/nu_crc.c | 99 - .../libraries/m031/StdDriver/src/nu_ebi.c | 182 - .../libraries/m031/StdDriver/src/nu_fmc.c | 572 - .../libraries/m031/StdDriver/src/nu_gpio.c | 108 - .../libraries/m031/StdDriver/src/nu_i2c.c | 1582 --- .../libraries/m031/StdDriver/src/nu_pdma.c | 379 - .../libraries/m031/StdDriver/src/nu_pwm.c | 1063 -- .../libraries/m031/StdDriver/src/nu_qspi.c | 813 -- .../libraries/m031/StdDriver/src/nu_rtc.c | 782 -- .../libraries/m031/StdDriver/src/nu_spi.c | 934 -- .../libraries/m031/StdDriver/src/nu_sys.c | 205 - .../libraries/m031/StdDriver/src/nu_timer.c | 333 - .../libraries/m031/StdDriver/src/nu_uart.c | 722 -- .../libraries/m031/StdDriver/src/nu_usbd.c | 705 -- .../m031/StdDriver/src/nu_usci_i2c.c | 1689 --- .../m031/StdDriver/src/nu_usci_spi.c | 635 -- .../m031/StdDriver/src/nu_usci_uart.c | 729 -- .../libraries/m031/StdDriver/src/nu_wdt.c | 73 - .../libraries/m031/StdDriver/src/nu_wwdt.c | 73 - bsp/nuvoton/libraries/m031/rtt_port/Kconfig | 1 + .../m2354/CMSIS/Include/arm_common_tables.h | 121 - .../m2354/CMSIS/Include/arm_const_structs.h | 66 - .../libraries/m2354/CMSIS/Include/arm_math.h | 7257 ------------- .../m2354/CMSIS/Include/cmsis_armcc.h | 814 -- .../m2354/CMSIS/Include/cmsis_armclang.h | 1802 ---- .../m2354/CMSIS/Include/cmsis_compiler.h | 368 - .../libraries/m2354/CMSIS/Include/cmsis_gcc.h | 1979 ---- .../m2354/CMSIS/Include/cmsis_version.h | 39 - .../m2354/CMSIS/Include/core_armv8mbl.h | 1878 ---- .../m2354/CMSIS/Include/core_armv8mml.h | 2902 ----- .../libraries/m2354/CMSIS/Include/core_cm0.h | 888 -- .../m2354/CMSIS/Include/core_cm0plus.h | 1021 -- .../libraries/m2354/CMSIS/Include/core_cm23.h | 1878 ---- .../libraries/m2354/CMSIS/Include/core_cm3.h | 1928 ---- .../libraries/m2354/CMSIS/Include/core_cm33.h | 2898 ----- .../libraries/m2354/CMSIS/Include/core_cm4.h | 2113 ---- .../libraries/m2354/CMSIS/Include/core_cm7.h | 2655 ----- .../m2354/CMSIS/Include/core_sc000.h | 1016 -- .../m2354/CMSIS/Include/core_sc300.h | 1903 ---- .../libraries/m2354/CMSIS/Include/mpu_armv7.h | 183 - .../m2354/CMSIS/Include/tz_context.h | 69 - bsp/nuvoton/libraries/m2354/CMSIS/SConscript | 16 - .../Device/Nuvoton/M2354/Include/M2354.h | 1101 -- .../Device/Nuvoton/M2354/Include/NuMicro.h | 17 - .../Device/Nuvoton/M2354/Include/acmp_reg.h | 244 - .../Device/Nuvoton/M2354/Include/bpwm_reg.h | 1800 ---- .../Device/Nuvoton/M2354/Include/can_reg.h | 790 -- .../Device/Nuvoton/M2354/Include/clk_reg.h | 1815 ---- .../Device/Nuvoton/M2354/Include/crc_reg.h | 153 - .../Device/Nuvoton/M2354/Include/crpt_reg.h | 2083 ---- .../Device/Nuvoton/M2354/Include/dac_reg.h | 208 - .../Device/Nuvoton/M2354/Include/eadc_reg.h | 1707 --- .../Device/Nuvoton/M2354/Include/ebi_reg.h | 163 - .../Device/Nuvoton/M2354/Include/ecap_reg.h | 388 - .../Device/Nuvoton/M2354/Include/epwm_reg.h | 4001 ------- .../Device/Nuvoton/M2354/Include/ewdt_reg.h | 178 - .../Device/Nuvoton/M2354/Include/ewwdt_reg.h | 148 - .../Device/Nuvoton/M2354/Include/fmc_reg.h | 628 -- .../Device/Nuvoton/M2354/Include/gpio_reg.h | 888 -- .../Device/Nuvoton/M2354/Include/hdiv_reg.h | 114 - .../Device/Nuvoton/M2354/Include/i2c_reg.h | 717 -- .../Device/Nuvoton/M2354/Include/i2s_reg.h | 701 -- .../Nuvoton/M2354/Include/keystore_reg.h | 384 - .../Device/Nuvoton/M2354/Include/lcd_reg.h | 1050 -- .../Device/Nuvoton/M2354/Include/otg_reg.h | 394 - .../Device/Nuvoton/M2354/Include/pdma_reg.h | 814 -- .../Device/Nuvoton/M2354/Include/qei_reg.h | 308 - .../Device/Nuvoton/M2354/Include/qspi_reg.h | 622 -- .../Device/Nuvoton/M2354/Include/rtc_reg.h | 1302 --- .../Device/Nuvoton/M2354/Include/sc_reg.h | 980 -- .../Device/Nuvoton/M2354/Include/scu_reg.h | 2699 ----- .../Device/Nuvoton/M2354/Include/sdh_reg.h | 528 - .../Device/Nuvoton/M2354/Include/spi_reg.h | 854 -- .../Device/Nuvoton/M2354/Include/sys_reg.h | 2617 ----- .../Nuvoton/M2354/Include/system_M2354.h | 148 - .../Device/Nuvoton/M2354/Include/tamper_reg.h | 1042 -- .../Device/Nuvoton/M2354/Include/timer_reg.h | 1168 -- .../Device/Nuvoton/M2354/Include/trng_reg.h | 156 - .../Device/Nuvoton/M2354/Include/uart_reg.h | 1284 --- .../Device/Nuvoton/M2354/Include/ui2c_reg.h | 568 - .../Device/Nuvoton/M2354/Include/usbd_reg.h | 658 -- .../Device/Nuvoton/M2354/Include/usbh_reg.h | 799 -- .../Device/Nuvoton/M2354/Include/uspi_reg.h | 666 -- .../Device/Nuvoton/M2354/Include/uuart_reg.h | 670 -- .../Device/Nuvoton/M2354/Include/wdt_reg.h | 177 - .../Device/Nuvoton/M2354/Include/wwdt_reg.h | 148 - .../Nuvoton/M2354/Source/ARM/startup_M2354.s | 582 - .../Nuvoton/M2354/Source/GCC/startup_M2354.S | 418 - .../Nuvoton/M2354/Source/IAR/startup_M2354.s | 504 - .../Nuvoton/M2354/Source/system_M2354.c | 567 - bsp/nuvoton/libraries/m2354/Device/SConscript | 25 - .../libraries/m2354/StdDriver/SConscript | 28 - .../libraries/m2354/StdDriver/inc/nu_acmp.h | 382 - .../libraries/m2354/StdDriver/inc/nu_bpwm.h | 360 - .../libraries/m2354/StdDriver/inc/nu_can.h | 188 - .../libraries/m2354/StdDriver/inc/nu_clk.h | 1070 -- .../libraries/m2354/StdDriver/inc/nu_crc.h | 115 - .../libraries/m2354/StdDriver/inc/nu_crypto.h | 559 - .../libraries/m2354/StdDriver/inc/nu_dac.h | 255 - .../libraries/m2354/StdDriver/inc/nu_dpm.h | 130 - .../libraries/m2354/StdDriver/inc/nu_eadc.h | 560 - .../libraries/m2354/StdDriver/inc/nu_ebi.h | 369 - .../libraries/m2354/StdDriver/inc/nu_ecap.h | 458 - .../libraries/m2354/StdDriver/inc/nu_epwm.h | 650 -- .../libraries/m2354/StdDriver/inc/nu_ewdt.h | 218 - .../libraries/m2354/StdDriver/inc/nu_ewwdt.h | 150 - .../libraries/m2354/StdDriver/inc/nu_fmc.h | 588 - .../libraries/m2354/StdDriver/inc/nu_fvc.h | 55 - .../libraries/m2354/StdDriver/inc/nu_gpio.h | 1155 -- .../libraries/m2354/StdDriver/inc/nu_i2c.h | 523 - .../libraries/m2354/StdDriver/inc/nu_i2s.h | 355 - .../m2354/StdDriver/inc/nu_keystore.h | 132 - .../libraries/m2354/StdDriver/inc/nu_lcd.h | 531 - .../libraries/m2354/StdDriver/inc/nu_otg.h | 256 - .../m2354/StdDriver/inc/nu_partition_M2354.h | 697 -- .../libraries/m2354/StdDriver/inc/nu_pdma.h | 380 - .../libraries/m2354/StdDriver/inc/nu_plm.h | 95 - .../libraries/m2354/StdDriver/inc/nu_qei.h | 388 - .../libraries/m2354/StdDriver/inc/nu_qspi.h | 399 - .../libraries/m2354/StdDriver/inc/nu_rng.h | 57 - .../libraries/m2354/StdDriver/inc/nu_rtc.h | 396 - .../libraries/m2354/StdDriver/inc/nu_sc.h | 305 - .../libraries/m2354/StdDriver/inc/nu_scu.h | 358 - .../libraries/m2354/StdDriver/inc/nu_scuart.h | 353 - .../libraries/m2354/StdDriver/inc/nu_sdh.h | 203 - .../libraries/m2354/StdDriver/inc/nu_spi.h | 582 - .../libraries/m2354/StdDriver/inc/nu_sys.h | 4313 -------- .../libraries/m2354/StdDriver/inc/nu_tamper.h | 464 - .../libraries/m2354/StdDriver/inc/nu_timer.h | 541 - .../m2354/StdDriver/inc/nu_timer_pwm.h | 877 -- .../libraries/m2354/StdDriver/inc/nu_trng.h | 83 - .../libraries/m2354/StdDriver/inc/nu_uart.h | 515 - .../libraries/m2354/StdDriver/inc/nu_usbd.h | 796 -- .../m2354/StdDriver/inc/nu_usci_i2c.h | 318 - .../m2354/StdDriver/inc/nu_usci_spi.h | 420 - .../m2354/StdDriver/inc/nu_usci_uart.h | 445 - .../libraries/m2354/StdDriver/inc/nu_wdt.h | 217 - .../libraries/m2354/StdDriver/inc/nu_wwdt.h | 151 - .../m2354/StdDriver/lib/libStdDriver.ewd | 3285 ------ .../m2354/StdDriver/lib/libStdDriver.ewp | 2209 ---- .../m2354/StdDriver/lib/libStdDriver.eww | 10 - .../m2354/StdDriver/lib/libStdDriver.uvprojx | 607 -- .../m2354/StdDriver/lib/nutool_clkcfg.h | 26 - .../libraries/m2354/StdDriver/src/nu_acmp.c | 82 - .../libraries/m2354/StdDriver/src/nu_bpwm.c | 713 -- .../libraries/m2354/StdDriver/src/nu_can.c | 1191 -- .../libraries/m2354/StdDriver/src/nu_clk.c | 1406 --- .../libraries/m2354/StdDriver/src/nu_crc.c | 96 - .../libraries/m2354/StdDriver/src/nu_crypto.c | 2978 ----- .../libraries/m2354/StdDriver/src/nu_dac.c | 91 - .../libraries/m2354/StdDriver/src/nu_dpm.c | 409 - .../libraries/m2354/StdDriver/src/nu_eadc.c | 142 - .../libraries/m2354/StdDriver/src/nu_ebi.c | 234 - .../libraries/m2354/StdDriver/src/nu_ecap.c | 119 - .../libraries/m2354/StdDriver/src/nu_epwm.c | 1659 --- .../libraries/m2354/StdDriver/src/nu_ewdt.c | 69 - .../libraries/m2354/StdDriver/src/nu_ewwdt.c | 67 - .../libraries/m2354/StdDriver/src/nu_fmc.c | 861 -- .../libraries/m2354/StdDriver/src/nu_fvc.c | 132 - .../libraries/m2354/StdDriver/src/nu_gpio.c | 189 - .../libraries/m2354/StdDriver/src/nu_i2c.c | 1442 --- .../libraries/m2354/StdDriver/src/nu_i2s.c | 264 - .../m2354/StdDriver/src/nu_keystore.c | 561 - .../libraries/m2354/StdDriver/src/nu_lcd.c | 338 - .../libraries/m2354/StdDriver/src/nu_pdma.c | 448 - .../libraries/m2354/StdDriver/src/nu_qei.c | 145 - .../libraries/m2354/StdDriver/src/nu_qspi.c | 857 -- .../libraries/m2354/StdDriver/src/nu_rng.c | 475 - .../libraries/m2354/StdDriver/src/nu_rtc.c | 1174 -- .../libraries/m2354/StdDriver/src/nu_sc.c | 425 - .../libraries/m2354/StdDriver/src/nu_scuart.c | 272 - .../libraries/m2354/StdDriver/src/nu_sdh.c | 1138 -- .../libraries/m2354/StdDriver/src/nu_spi.c | 1650 --- .../libraries/m2354/StdDriver/src/nu_sys.c | 441 - .../libraries/m2354/StdDriver/src/nu_tamper.c | 505 - .../libraries/m2354/StdDriver/src/nu_timer.c | 409 - .../m2354/StdDriver/src/nu_timer_pwm.c | 577 - .../libraries/m2354/StdDriver/src/nu_trng.c | 177 - .../libraries/m2354/StdDriver/src/nu_uart.c | 687 -- .../libraries/m2354/StdDriver/src/nu_usbd.c | 778 -- .../m2354/StdDriver/src/nu_usci_i2c.c | 1659 --- .../m2354/StdDriver/src/nu_usci_spi.c | 635 -- .../m2354/StdDriver/src/nu_usci_uart.c | 729 -- .../libraries/m2354/StdDriver/src/nu_wdt.c | 70 - .../libraries/m2354/StdDriver/src/nu_wwdt.c | 67 - .../libraries/m2354/USBHostLib/SConscript | 12 - .../libraries/m2354/USBHostLib/inc/config.h | 96 - .../libraries/m2354/USBHostLib/inc/hub.h | 136 - .../libraries/m2354/USBHostLib/inc/ohci.h | 147 - .../libraries/m2354/USBHostLib/inc/usb.h | 470 - .../libraries/m2354/USBHostLib/inc/usbh_lib.h | 254 - .../m2354/USBHostLib/src/mem_alloc.c | 316 - .../libraries/m2354/USBHostLib/src/ohci.c | 1289 --- .../libraries/m2354/USBHostLib/src/usb_core.c | 278 - bsp/nuvoton/libraries/m2354/rtt_port/Kconfig | 1 + .../m460/CMSIS/Include/arm_common_tables.h | 121 - .../m460/CMSIS/Include/arm_const_structs.h | 66 - .../libraries/m460/CMSIS/Include/arm_math.h | 7257 ------------- .../m460/CMSIS/Include/cmsis_armcc.h | 814 -- .../m460/CMSIS/Include/cmsis_armcc_V6.h | 1804 ---- .../m460/CMSIS/Include/cmsis_armclang.h | 1809 ---- .../m460/CMSIS/Include/cmsis_compiler.h | 368 - .../libraries/m460/CMSIS/Include/cmsis_gcc.h | 1986 ---- .../m460/CMSIS/Include/cmsis_version.h | 39 - .../m460/CMSIS/Include/core_armv8mbl.h | 1878 ---- .../m460/CMSIS/Include/core_armv8mml.h | 2902 ----- .../libraries/m460/CMSIS/Include/core_cm0.h | 888 -- .../m460/CMSIS/Include/core_cm0plus.h | 1021 -- .../libraries/m460/CMSIS/Include/core_cm23.h | 1878 ---- .../libraries/m460/CMSIS/Include/core_cm3.h | 1928 ---- .../libraries/m460/CMSIS/Include/core_cm33.h | 2898 ----- .../libraries/m460/CMSIS/Include/core_cm4.h | 2113 ---- .../libraries/m460/CMSIS/Include/core_cm7.h | 2678 ----- .../m460/CMSIS/Include/core_cmFunc.h | 87 - .../m460/CMSIS/Include/core_cmInstr.h | 87 - .../m460/CMSIS/Include/core_cmSimd.h | 96 - .../libraries/m460/CMSIS/Include/core_sc000.h | 1016 -- .../libraries/m460/CMSIS/Include/core_sc300.h | 1903 ---- .../libraries/m460/CMSIS/Include/mpu_armv7.h | 183 - .../libraries/m460/CMSIS/Include/tz_context.h | 69 - bsp/nuvoton/libraries/m460/CMSIS/SConscript | 16 - .../Device/Nuvoton/m460/Include/NuMicro.h | 16 - .../Device/Nuvoton/m460/Include/acmp_reg.h | 617 -- .../Device/Nuvoton/m460/Include/bmc_reg.h | 725 -- .../Device/Nuvoton/m460/Include/bpwm_reg.h | 1835 ---- .../Device/Nuvoton/m460/Include/canfd_reg.h | 1712 --- .../Device/Nuvoton/m460/Include/ccap_reg.h | 453 - .../Device/Nuvoton/m460/Include/clk_reg.h | 2452 ----- .../Device/Nuvoton/m460/Include/crc_reg.h | 166 - .../Device/Nuvoton/m460/Include/crypto_reg.h | 6827 ------------ .../Device/Nuvoton/m460/Include/dac_reg.h | 239 - .../Device/Nuvoton/m460/Include/eadc_reg.h | 2390 ---- .../Device/Nuvoton/m460/Include/ebi_reg.h | 168 - .../Device/Nuvoton/m460/Include/ecap_reg.h | 390 - .../Device/Nuvoton/m460/Include/emac_reg.h | 2063 ---- .../Device/Nuvoton/m460/Include/epwm_reg.h | 5418 ---------- .../Device/Nuvoton/m460/Include/eqei_reg.h | 445 - .../Device/Nuvoton/m460/Include/fmc_reg.h | 687 -- .../Device/Nuvoton/m460/Include/gpio_reg.h | 1104 -- .../Device/Nuvoton/m460/Include/hbi_reg.h | 233 - .../Device/Nuvoton/m460/Include/hsotg_reg.h | 401 - .../Device/Nuvoton/m460/Include/hsusbd_reg.h | 1425 --- .../Device/Nuvoton/m460/Include/hsusbh_reg.h | 653 -- .../Device/Nuvoton/m460/Include/i2c_reg.h | 816 -- .../Device/Nuvoton/m460/Include/i2s_reg.h | 707 -- .../Nuvoton/m460/Include/keystore_reg.h | 398 - .../Device/Nuvoton/m460/Include/kpi_reg.h | 370 - .../m460/Device/Nuvoton/m460/Include/m460.h | 815 -- .../Device/Nuvoton/m460/Include/opa_reg.h | 268 - .../Device/Nuvoton/m460/Include/otg_reg.h | 399 - .../Device/Nuvoton/m460/Include/pdma_reg.h | 1899 ---- .../Device/Nuvoton/m460/Include/psio_reg.h | 1439 --- .../Device/Nuvoton/m460/Include/qspi_reg.h | 619 -- .../Device/Nuvoton/m460/Include/rtc_reg.h | 1233 --- .../m460/Device/Nuvoton/m460/Include/sc_reg.h | 1022 -- .../Device/Nuvoton/m460/Include/sdh_reg.h | 541 - .../Device/Nuvoton/m460/Include/spi_reg.h | 861 -- .../Device/Nuvoton/m460/Include/spim_reg.h | 557 - .../Device/Nuvoton/m460/Include/sys_reg.h | 4826 --------- .../Device/Nuvoton/m460/Include/system_m460.h | 79 - .../Device/Nuvoton/m460/Include/tcm_reg.h | 714 -- .../Device/Nuvoton/m460/Include/timer_reg.h | 1231 --- .../Device/Nuvoton/m460/Include/trng_reg.h | 138 - .../Device/Nuvoton/m460/Include/uart_reg.h | 1317 --- .../Device/Nuvoton/m460/Include/ui2c_reg.h | 583 - .../Device/Nuvoton/m460/Include/usbd_reg.h | 772 -- .../Device/Nuvoton/m460/Include/usbh_reg.h | 797 -- .../Device/Nuvoton/m460/Include/uspi_reg.h | 677 -- .../Device/Nuvoton/m460/Include/uuart_reg.h | 689 -- .../Device/Nuvoton/m460/Include/wdt_reg.h | 176 - .../Device/Nuvoton/m460/Include/wwdt_reg.h | 152 - .../Nuvoton/m460/Source/ARM/startup_m460.s | 593 - .../Nuvoton/m460/Source/GCC/startup_M460.S | 428 - .../Nuvoton/m460/Source/IAR/startup_M460.s | 499 - .../Device/Nuvoton/m460/Source/system_m460.c | 94 - bsp/nuvoton/libraries/m460/Device/SConscript | 25 - .../libraries/m460/StdDriver/SConscript | 28 - .../libraries/m460/StdDriver/inc/nu_acmp.h | 455 - .../libraries/m460/StdDriver/inc/nu_bmc.h | 228 - .../libraries/m460/StdDriver/inc/nu_bpwm.h | 360 - .../libraries/m460/StdDriver/inc/nu_canfd.h | 477 - .../libraries/m460/StdDriver/inc/nu_ccap.h | 175 - .../libraries/m460/StdDriver/inc/nu_clk.h | 1281 --- .../libraries/m460/StdDriver/inc/nu_crc.h | 112 - .../libraries/m460/StdDriver/inc/nu_crypto.h | 563 - .../libraries/m460/StdDriver/inc/nu_dac.h | 270 - .../libraries/m460/StdDriver/inc/nu_eadc.h | 728 -- .../libraries/m460/StdDriver/inc/nu_ebi.h | 350 - .../libraries/m460/StdDriver/inc/nu_ecap.h | 458 - .../libraries/m460/StdDriver/inc/nu_epwm.h | 652 -- .../libraries/m460/StdDriver/inc/nu_eqei.h | 434 - .../libraries/m460/StdDriver/inc/nu_fmc.h | 384 - .../libraries/m460/StdDriver/inc/nu_gpio.h | 564 - .../libraries/m460/StdDriver/inc/nu_hbi.h | 298 - .../libraries/m460/StdDriver/inc/nu_hsotg.h | 290 - .../libraries/m460/StdDriver/inc/nu_hsusbd.h | 404 - .../libraries/m460/StdDriver/inc/nu_i2c.h | 512 - .../libraries/m460/StdDriver/inc/nu_i2s.h | 354 - .../m460/StdDriver/inc/nu_keystore.h | 144 - .../libraries/m460/StdDriver/inc/nu_kpi.h | 69 - .../libraries/m460/StdDriver/inc/nu_opa.h | 209 - .../libraries/m460/StdDriver/inc/nu_otg.h | 266 - .../libraries/m460/StdDriver/inc/nu_pdma.h | 446 - .../libraries/m460/StdDriver/inc/nu_psio.h | 1191 -- .../libraries/m460/StdDriver/inc/nu_qspi.h | 437 - .../libraries/m460/StdDriver/inc/nu_rng.h | 58 - .../libraries/m460/StdDriver/inc/nu_rtc.h | 397 - .../libraries/m460/StdDriver/inc/nu_sc.h | 335 - .../libraries/m460/StdDriver/inc/nu_scuart.h | 356 - .../libraries/m460/StdDriver/inc/nu_sdh.h | 207 - .../libraries/m460/StdDriver/inc/nu_spi.h | 617 -- .../libraries/m460/StdDriver/inc/nu_spim.h | 634 -- .../libraries/m460/StdDriver/inc/nu_sys.h | 7092 ------------ .../libraries/m460/StdDriver/inc/nu_timer.h | 537 - .../m460/StdDriver/inc/nu_timer_pwm.h | 783 -- .../libraries/m460/StdDriver/inc/nu_trng.h | 83 - .../libraries/m460/StdDriver/inc/nu_uart.h | 537 - .../libraries/m460/StdDriver/inc/nu_usbd.h | 830 -- .../m460/StdDriver/inc/nu_usci_i2c.h | 337 - .../m460/StdDriver/inc/nu_usci_spi.h | 426 - .../m460/StdDriver/inc/nu_usci_uart.h | 519 - .../libraries/m460/StdDriver/inc/nu_wdt.h | 236 - .../libraries/m460/StdDriver/inc/nu_wwdt.h | 150 - .../m460/StdDriver/lib/libStdDriver.uvprojx | 608 -- .../m460/StdDriver/lib/nutool_clkcfg.h | 26 - .../libraries/m460/StdDriver/src/nu_acmp.c | 85 - .../libraries/m460/StdDriver/src/nu_bmc.c | 352 - .../libraries/m460/StdDriver/src/nu_bpwm.c | 758 -- .../libraries/m460/StdDriver/src/nu_canfd.c | 1862 ---- .../libraries/m460/StdDriver/src/nu_ccap.c | 406 - .../libraries/m460/StdDriver/src/nu_clk.c | 1845 ---- .../libraries/m460/StdDriver/src/nu_crc.c | 117 - .../libraries/m460/StdDriver/src/nu_crypto.c | 3036 ------ .../libraries/m460/StdDriver/src/nu_dac.c | 90 - .../libraries/m460/StdDriver/src/nu_eadc.c | 232 - .../libraries/m460/StdDriver/src/nu_ebi.c | 193 - .../libraries/m460/StdDriver/src/nu_ecap.c | 134 - .../libraries/m460/StdDriver/src/nu_epwm.c | 1694 --- .../libraries/m460/StdDriver/src/nu_eqei.c | 163 - .../libraries/m460/StdDriver/src/nu_fmc.c | 1232 --- .../libraries/m460/StdDriver/src/nu_gpio.c | 180 - .../libraries/m460/StdDriver/src/nu_hbi.c | 301 - .../libraries/m460/StdDriver/src/nu_hsusbd.c | 741 -- .../libraries/m460/StdDriver/src/nu_i2c.c | 1661 --- .../libraries/m460/StdDriver/src/nu_i2s.c | 301 - .../m460/StdDriver/src/nu_keystore.c | 763 -- .../libraries/m460/StdDriver/src/nu_kpi.c | 271 - .../libraries/m460/StdDriver/src/nu_pdma.c | 470 - .../libraries/m460/StdDriver/src/nu_qspi.c | 901 -- .../libraries/m460/StdDriver/src/nu_rng.c | 361 - .../libraries/m460/StdDriver/src/nu_rtc.c | 1178 -- .../libraries/m460/StdDriver/src/nu_sc.c | 477 - .../libraries/m460/StdDriver/src/nu_scuart.c | 286 - .../libraries/m460/StdDriver/src/nu_sdh.c | 1454 --- .../libraries/m460/StdDriver/src/nu_spi.c | 2127 ---- .../libraries/m460/StdDriver/src/nu_spim.c | 1383 --- .../libraries/m460/StdDriver/src/nu_sys.c | 331 - .../libraries/m460/StdDriver/src/nu_timer.c | 437 - .../m460/StdDriver/src/nu_timer_pwm.c | 595 - .../libraries/m460/StdDriver/src/nu_trng.c | 177 - .../libraries/m460/StdDriver/src/nu_uart.c | 670 -- .../libraries/m460/StdDriver/src/nu_usbd.c | 743 -- .../m460/StdDriver/src/nu_usci_i2c.c | 1799 ---- .../m460/StdDriver/src/nu_usci_spi.c | 677 -- .../m460/StdDriver/src/nu_usci_uart.c | 713 -- .../libraries/m460/StdDriver/src/nu_wdt.c | 83 - .../libraries/m460/StdDriver/src/nu_wwdt.c | 66 - .../libraries/m460/USBHostLib/SConscript | 12 - .../libraries/m460/USBHostLib/inc/config.h | 114 - .../libraries/m460/USBHostLib/inc/ehci.h | 281 - .../libraries/m460/USBHostLib/inc/hub.h | 139 - .../libraries/m460/USBHostLib/inc/ohci.h | 148 - .../libraries/m460/USBHostLib/inc/usb.h | 486 - .../libraries/m460/USBHostLib/inc/usbh_lib.h | 186 - .../libraries/m460/USBHostLib/src/ehci.c | 1312 --- .../libraries/m460/USBHostLib/src/ehci_iso.c | 916 -- .../libraries/m460/USBHostLib/src/mem_alloc.c | 503 - .../libraries/m460/USBHostLib/src/ohci.c | 1297 --- .../libraries/m460/USBHostLib/src/usb_core.c | 290 - bsp/nuvoton/libraries/m460/rtt_port/Kconfig | 1 + .../m480/CMSIS/Include/arm_common_tables.h | 136 - .../m480/CMSIS/Include/arm_const_structs.h | 79 - .../libraries/m480/CMSIS/Include/arm_math.h | 7154 ------------ .../m480/CMSIS/Include/cmsis_armcc.h | 734 -- .../m480/CMSIS/Include/cmsis_armcc_V6.h | 1804 ---- .../libraries/m480/CMSIS/Include/cmsis_gcc.h | 1373 --- .../libraries/m480/CMSIS/Include/core_cm0.h | 798 -- .../m480/CMSIS/Include/core_cm0plus.h | 914 -- .../libraries/m480/CMSIS/Include/core_cm3.h | 1763 --- .../libraries/m480/CMSIS/Include/core_cm4.h | 1937 ---- .../libraries/m480/CMSIS/Include/core_cm7.h | 2512 ----- .../m480/CMSIS/Include/core_cmFunc.h | 87 - .../m480/CMSIS/Include/core_cmInstr.h | 87 - .../m480/CMSIS/Include/core_cmSimd.h | 96 - .../libraries/m480/CMSIS/Include/core_sc000.h | 926 -- .../libraries/m480/CMSIS/Include/core_sc300.h | 1745 --- bsp/nuvoton/libraries/m480/CMSIS/SConscript | 16 - .../m480/Device/Nuvoton/M480/Include/M480.h | 713 -- .../Device/Nuvoton/M480/Include/NuMicro.h | 17 - .../Device/Nuvoton/M480/Include/acmp_reg.h | 240 - .../Device/Nuvoton/M480/Include/bpwm_reg.h | 1835 ---- .../Device/Nuvoton/M480/Include/can_reg.h | 759 -- .../Device/Nuvoton/M480/Include/ccap_reg.h | 496 - .../Device/Nuvoton/M480/Include/clk_reg.h | 1698 --- .../Device/Nuvoton/M480/Include/crc_reg.h | 150 - .../Device/Nuvoton/M480/Include/crypto_reg.h | 2219 ---- .../Device/Nuvoton/M480/Include/dac_reg.h | 210 - .../Device/Nuvoton/M480/Include/eadc_reg.h | 1714 --- .../Device/Nuvoton/M480/Include/ebi_reg.h | 429 - .../Device/Nuvoton/M480/Include/ecap_reg.h | 390 - .../Device/Nuvoton/M480/Include/emac_reg.h | 2063 ---- .../Device/Nuvoton/M480/Include/epwm_reg.h | 4023 ------- .../Device/Nuvoton/M480/Include/fmc_reg.h | 688 -- .../Device/Nuvoton/M480/Include/gpio_reg.h | 936 -- .../Device/Nuvoton/M480/Include/hsotg_reg.h | 398 - .../Device/Nuvoton/M480/Include/hsusbd_reg.h | 1381 --- .../Device/Nuvoton/M480/Include/hsusbh_reg.h | 653 -- .../Device/Nuvoton/M480/Include/i2c_reg.h | 725 -- .../Device/Nuvoton/M480/Include/i2s_reg.h | 707 -- .../Device/Nuvoton/M480/Include/opa_reg.h | 268 - .../Device/Nuvoton/M480/Include/otg_reg.h | 399 - .../Device/Nuvoton/M480/Include/pdma_reg.h | 886 -- .../Device/Nuvoton/M480/Include/qei_reg.h | 315 - .../Device/Nuvoton/M480/Include/qspi_reg.h | 592 - .../Device/Nuvoton/M480/Include/rtc_reg.h | 1274 --- .../m480/Device/Nuvoton/M480/Include/sc_reg.h | 1019 -- .../Device/Nuvoton/M480/Include/sdh_reg.h | 541 - .../Device/Nuvoton/M480/Include/spi_reg.h | 800 -- .../Device/Nuvoton/M480/Include/spim_reg.h | 557 - .../Device/Nuvoton/M480/Include/sys_reg.h | 3662 ------- .../Device/Nuvoton/M480/Include/system_M480.h | 76 - .../Device/Nuvoton/M480/Include/timer_reg.h | 1094 -- .../Device/Nuvoton/M480/Include/trng_reg.h | 138 - .../Device/Nuvoton/M480/Include/uart_reg.h | 1273 --- .../Device/Nuvoton/M480/Include/ui2c_reg.h | 583 - .../Device/Nuvoton/M480/Include/usbd_reg.h | 649 -- .../Device/Nuvoton/M480/Include/usbh_reg.h | 797 -- .../Device/Nuvoton/M480/Include/uspi_reg.h | 677 -- .../Device/Nuvoton/M480/Include/uuart_reg.h | 679 -- .../Device/Nuvoton/M480/Include/wdt_reg.h | 183 - .../Device/Nuvoton/M480/Include/wwdt_reg.h | 149 - .../Nuvoton/M480/Source/ARM/startup_M480.s | 514 - .../Nuvoton/M480/Source/GCC/startup_M480.S | 375 - .../Nuvoton/M480/Source/IAR/startup_M480.s | 451 - .../Device/Nuvoton/M480/Source/system_M480.c | 110 - bsp/nuvoton/libraries/m480/Device/SConscript | 25 - .../libraries/m480/StdDriver/SConscript | 28 - .../libraries/m480/StdDriver/inc/nu_acmp.h | 415 - .../libraries/m480/StdDriver/inc/nu_bpwm.h | 361 - .../libraries/m480/StdDriver/inc/nu_can.h | 192 - .../libraries/m480/StdDriver/inc/nu_ccap.h | 165 - .../libraries/m480/StdDriver/inc/nu_clk.h | 714 -- .../libraries/m480/StdDriver/inc/nu_crc.h | 113 - .../libraries/m480/StdDriver/inc/nu_crypto.h | 378 - .../libraries/m480/StdDriver/inc/nu_dac.h | 269 - .../libraries/m480/StdDriver/inc/nu_eadc.h | 620 -- .../libraries/m480/StdDriver/inc/nu_ebi.h | 352 - .../libraries/m480/StdDriver/inc/nu_ecap.h | 458 - .../libraries/m480/StdDriver/inc/nu_emac.h | 357 - .../libraries/m480/StdDriver/inc/nu_epwm.h | 645 -- .../libraries/m480/StdDriver/inc/nu_fmc.h | 302 - .../libraries/m480/StdDriver/inc/nu_gpio.h | 497 - .../libraries/m480/StdDriver/inc/nu_hsotg.h | 268 - .../libraries/m480/StdDriver/inc/nu_hsusbd.h | 382 - .../libraries/m480/StdDriver/inc/nu_i2c.h | 502 - .../libraries/m480/StdDriver/inc/nu_i2s.h | 353 - .../libraries/m480/StdDriver/inc/nu_opa.h | 209 - .../libraries/m480/StdDriver/inc/nu_otg.h | 268 - .../libraries/m480/StdDriver/inc/nu_pdma.h | 391 - .../libraries/m480/StdDriver/inc/nu_qei.h | 390 - .../libraries/m480/StdDriver/inc/nu_qspi.h | 375 - .../libraries/m480/StdDriver/inc/nu_rtc.h | 342 - .../libraries/m480/StdDriver/inc/nu_sc.h | 268 - .../libraries/m480/StdDriver/inc/nu_scuart.h | 267 - .../libraries/m480/StdDriver/inc/nu_sdh.h | 203 - .../libraries/m480/StdDriver/inc/nu_spi.h | 602 -- .../libraries/m480/StdDriver/inc/nu_spim.h | 634 -- .../libraries/m480/StdDriver/inc/nu_sys.h | 1636 --- .../libraries/m480/StdDriver/inc/nu_timer.h | 523 - .../m480/StdDriver/inc/nu_timer_pwm.h | 746 -- .../libraries/m480/StdDriver/inc/nu_trng.h | 86 - .../libraries/m480/StdDriver/inc/nu_uart.h | 507 - .../libraries/m480/StdDriver/inc/nu_usbd.h | 693 -- .../m480/StdDriver/inc/nu_usci_i2c.h | 332 - .../m480/StdDriver/inc/nu_usci_spi.h | 429 - .../m480/StdDriver/inc/nu_usci_uart.h | 520 - .../libraries/m480/StdDriver/inc/nu_wdt.h | 216 - .../libraries/m480/StdDriver/inc/nu_wwdt.h | 152 - .../m480/StdDriver/lib/libStdDriver.ewd | 3285 ------ .../m480/StdDriver/lib/libStdDriver.ewp | 2197 ---- .../m480/StdDriver/lib/libStdDriver.eww | 10 - .../m480/StdDriver/lib/libStdDriver.uvprojx | 587 - .../m480/StdDriver/lib/libStdDriver_4.uvproj | 591 - .../m480/StdDriver/lib/nutool_clkcfg.h | 26 - .../libraries/m480/StdDriver/src/nu_acmp.c | 75 - .../libraries/m480/StdDriver/src/nu_bpwm.c | 745 -- .../libraries/m480/StdDriver/src/nu_can.c | 1292 --- .../libraries/m480/StdDriver/src/nu_ccap.c | 296 - .../libraries/m480/StdDriver/src/nu_clk.c | 1353 --- .../libraries/m480/StdDriver/src/nu_crc.c | 95 - .../libraries/m480/StdDriver/src/nu_crypto.c | 1995 ---- .../libraries/m480/StdDriver/src/nu_dac.c | 90 - .../libraries/m480/StdDriver/src/nu_eadc.c | 143 - .../libraries/m480/StdDriver/src/nu_ebi.c | 195 - .../libraries/m480/StdDriver/src/nu_ecap.c | 118 - .../libraries/m480/StdDriver/src/nu_emac.c | 1179 -- .../libraries/m480/StdDriver/src/nu_epwm.c | 1699 --- .../libraries/m480/StdDriver/src/nu_fmc.c | 1041 -- .../libraries/m480/StdDriver/src/nu_gpio.c | 153 - .../libraries/m480/StdDriver/src/nu_hsusbd.c | 725 -- .../libraries/m480/StdDriver/src/nu_i2c.c | 1486 --- .../libraries/m480/StdDriver/src/nu_i2s.c | 250 - .../libraries/m480/StdDriver/src/nu_pdma.c | 446 - .../libraries/m480/StdDriver/src/nu_qei.c | 144 - .../libraries/m480/StdDriver/src/nu_qspi.c | 860 -- .../libraries/m480/StdDriver/src/nu_rtc.c | 1095 -- .../libraries/m480/StdDriver/src/nu_sc.c | 400 - .../libraries/m480/StdDriver/src/nu_scuart.c | 242 - .../libraries/m480/StdDriver/src/nu_sdh.c | 1275 --- .../libraries/m480/StdDriver/src/nu_spi.c | 1443 --- .../libraries/m480/StdDriver/src/nu_spim.c | 1308 --- .../libraries/m480/StdDriver/src/nu_sys.c | 284 - .../libraries/m480/StdDriver/src/nu_timer.c | 353 - .../m480/StdDriver/src/nu_timer_pwm.c | 443 - .../libraries/m480/StdDriver/src/nu_trng.c | 172 - .../libraries/m480/StdDriver/src/nu_uart.c | 656 -- .../libraries/m480/StdDriver/src/nu_usbd.c | 745 -- .../m480/StdDriver/src/nu_usci_i2c.c | 1679 --- .../m480/StdDriver/src/nu_usci_spi.c | 664 -- .../m480/StdDriver/src/nu_usci_uart.c | 702 -- .../libraries/m480/StdDriver/src/nu_wdt.c | 69 - .../libraries/m480/StdDriver/src/nu_wwdt.c | 69 - .../libraries/m480/USBHostLib/SConscript | 12 - .../libraries/m480/USBHostLib/inc/config.h | 114 - .../libraries/m480/USBHostLib/inc/ehci.h | 281 - .../libraries/m480/USBHostLib/inc/hub.h | 139 - .../libraries/m480/USBHostLib/inc/ohci.h | 148 - .../libraries/m480/USBHostLib/inc/usb.h | 486 - .../libraries/m480/USBHostLib/inc/usbh_lib.h | 186 - .../libraries/m480/USBHostLib/src/ehci.c | 1312 --- .../libraries/m480/USBHostLib/src/ehci_iso.c | 916 -- .../libraries/m480/USBHostLib/src/mem_alloc.c | 503 - .../libraries/m480/USBHostLib/src/ohci.c | 1298 --- .../libraries/m480/USBHostLib/src/usb_core.c | 299 - bsp/nuvoton/libraries/m480/rtt_port/Kconfig | 1 + .../ma35/CMSIS/Include/arm_common_tables.h | 136 - .../ma35/CMSIS/Include/arm_const_structs.h | 79 - .../libraries/ma35/CMSIS/Include/arm_math.h | 7154 ------------ .../ma35/CMSIS/Include/cmsis_armcc.h | 734 -- .../ma35/CMSIS/Include/cmsis_armcc_V6.h | 1804 ---- .../libraries/ma35/CMSIS/Include/cmsis_gcc.h | 1377 --- .../libraries/ma35/CMSIS/Include/core_cm0.h | 798 -- .../ma35/CMSIS/Include/core_cm0plus.h | 914 -- .../libraries/ma35/CMSIS/Include/core_cm3.h | 1763 --- .../libraries/ma35/CMSIS/Include/core_cm4.h | 1937 ---- .../libraries/ma35/CMSIS/Include/core_cm7.h | 2535 ----- .../ma35/CMSIS/Include/core_cmFunc.h | 87 - .../ma35/CMSIS/Include/core_cmInstr.h | 87 - .../ma35/CMSIS/Include/core_cmSimd.h | 96 - .../libraries/ma35/CMSIS/Include/core_sc000.h | 926 -- .../libraries/ma35/CMSIS/Include/core_sc300.h | 1745 --- bsp/nuvoton/libraries/ma35/CMSIS/SConscript | 14 - .../Device/Nuvoton/MA35D1/Include/NuMicro.h | 15 - .../Device/Nuvoton/MA35D1/Include/adc_reg.h | 378 - .../Device/Nuvoton/MA35D1/Include/canfd_reg.h | 1709 --- .../Device/Nuvoton/MA35D1/Include/ccap_reg.h | 453 - .../Device/Nuvoton/MA35D1/Include/clk_reg.h | 2596 ----- .../Nuvoton/MA35D1/Include/crypto_reg.h | 7135 ------------ .../Nuvoton/MA35D1/Include/ddr32phy_reg.h | 9569 ----------------- .../Device/Nuvoton/MA35D1/Include/disp_reg.h | 1432 --- .../Device/Nuvoton/MA35D1/Include/dpm_reg.h | 315 - .../Device/Nuvoton/MA35D1/Include/eadc_reg.h | 2278 ---- .../Device/Nuvoton/MA35D1/Include/ebi_reg.h | 428 - .../Device/Nuvoton/MA35D1/Include/ecap_reg.h | 389 - .../Device/Nuvoton/MA35D1/Include/epwm_reg.h | 4978 --------- .../Device/Nuvoton/MA35D1/Include/gfx_reg.h | 382 - .../Device/Nuvoton/MA35D1/Include/gmac_reg.h | 2606 ----- .../Device/Nuvoton/MA35D1/Include/gpio_reg.h | 1221 --- .../Nuvoton/MA35D1/Include/hsusbd_reg.h | 3108 ------ .../Nuvoton/MA35D1/Include/hsusbh_reg.h | 597 - .../Device/Nuvoton/MA35D1/Include/hwsem_reg.h | 452 - .../Device/Nuvoton/MA35D1/Include/i2c_reg.h | 453 - .../Device/Nuvoton/MA35D1/Include/i2s_reg.h | 704 -- .../Device/Nuvoton/MA35D1/Include/kpi_reg.h | 409 - .../Device/Nuvoton/MA35D1/Include/ks_reg.h | 473 - .../Device/Nuvoton/MA35D1/Include/ma35d1.h | 1052 -- .../Device/Nuvoton/MA35D1/Include/nfi_reg.h | 2041 ---- .../Device/Nuvoton/MA35D1/Include/otp_reg.h | 346 - .../Device/Nuvoton/MA35D1/Include/pdma_reg.h | 1020 -- .../Device/Nuvoton/MA35D1/Include/plm_reg.h | 76 - .../Device/Nuvoton/MA35D1/Include/qei_reg.h | 314 - .../Device/Nuvoton/MA35D1/Include/qspi_reg.h | 661 -- .../Device/Nuvoton/MA35D1/Include/rtc_reg.h | 1318 --- .../Device/Nuvoton/MA35D1/Include/sc_reg.h | 972 -- .../Device/Nuvoton/MA35D1/Include/sdh_reg.h | 2670 ----- .../Device/Nuvoton/MA35D1/Include/spi_reg.h | 893 -- .../Device/Nuvoton/MA35D1/Include/ssmcc_reg.h | 932 -- .../Device/Nuvoton/MA35D1/Include/sspcc_reg.h | 2625 ----- .../Device/Nuvoton/MA35D1/Include/sys_reg.h | 5816 ---------- .../Nuvoton/MA35D1/Include/system_ma35d1.h | 65 - .../Device/Nuvoton/MA35D1/Include/timer_reg.h | 1069 -- .../Device/Nuvoton/MA35D1/Include/trng_reg.h | 922 -- .../Device/Nuvoton/MA35D1/Include/uart_reg.h | 1061 -- .../Nuvoton/MA35D1/Include/umctl2_reg.h | 3918 ------- .../Device/Nuvoton/MA35D1/Include/usbh_reg.h | 796 -- .../Device/Nuvoton/MA35D1/Include/wdt_reg.h | 179 - .../Device/Nuvoton/MA35D1/Include/whc_reg.h | 1034 -- .../Device/Nuvoton/MA35D1/Include/wwdt_reg.h | 147 - .../MA35D1/Source/ARM/startup_ma35d1_subm.s | 488 - .../MA35D1/Source/GCC/startup_ma35d1_subm.S | 352 - .../MA35D1/Source/IAR/startup_ma35d1_subm.s | 430 - .../MA35D1/Source/system_ma35d1_subm.c | 67 - bsp/nuvoton/libraries/ma35/Device/SConscript | 22 - .../libraries/ma35/StdDriver/SConscript | 27 - .../libraries/ma35/StdDriver/inc/nu_adc.h | 287 - .../libraries/ma35/StdDriver/inc/nu_canfd.h | 476 - .../libraries/ma35/StdDriver/inc/nu_ccap.h | 175 - .../libraries/ma35/StdDriver/inc/nu_clk.h | 622 -- .../libraries/ma35/StdDriver/inc/nu_disp.h | 206 - .../libraries/ma35/StdDriver/inc/nu_eadc.h | 630 -- .../libraries/ma35/StdDriver/inc/nu_ebi.h | 350 - .../libraries/ma35/StdDriver/inc/nu_ecap.h | 453 - .../libraries/ma35/StdDriver/inc/nu_epwm.h | 643 -- .../libraries/ma35/StdDriver/inc/nu_gpio.h | 600 -- .../libraries/ma35/StdDriver/inc/nu_hwsem.h | 205 - .../libraries/ma35/StdDriver/inc/nu_i2c.h | 296 - .../libraries/ma35/StdDriver/inc/nu_i2s.h | 351 - .../libraries/ma35/StdDriver/inc/nu_kpi.h | 169 - .../libraries/ma35/StdDriver/inc/nu_pdma.h | 421 - .../libraries/ma35/StdDriver/inc/nu_qei.h | 388 - .../libraries/ma35/StdDriver/inc/nu_qspi.h | 379 - .../libraries/ma35/StdDriver/inc/nu_rtc.h | 224 - .../libraries/ma35/StdDriver/inc/nu_sc.h | 266 - .../libraries/ma35/StdDriver/inc/nu_scuart.h | 265 - .../libraries/ma35/StdDriver/inc/nu_sdh.h | 129 - .../libraries/ma35/StdDriver/inc/nu_spi.h | 607 -- .../libraries/ma35/StdDriver/inc/nu_ssmcc.h | 73 - .../libraries/ma35/StdDriver/inc/nu_sspcc.h | 384 - .../libraries/ma35/StdDriver/inc/nu_sys.h | 1855 ---- .../libraries/ma35/StdDriver/inc/nu_timer.h | 522 - .../ma35/StdDriver/inc/nu_timer_pwm.h | 745 -- .../libraries/ma35/StdDriver/inc/nu_uart.h | 489 - .../libraries/ma35/StdDriver/inc/nu_wdt.h | 214 - .../libraries/ma35/StdDriver/inc/nu_whc.h | 279 - .../libraries/ma35/StdDriver/inc/nu_wwdt.h | 150 - .../libraries/ma35/StdDriver/src/nu_adc.c | 87 - .../libraries/ma35/StdDriver/src/nu_canfd.c | 1894 ---- .../libraries/ma35/StdDriver/src/nu_ccap.c | 406 - .../libraries/ma35/StdDriver/src/nu_clk.c | 1763 --- .../libraries/ma35/StdDriver/src/nu_disp.c | 577 - .../libraries/ma35/StdDriver/src/nu_eadc.c | 141 - .../libraries/ma35/StdDriver/src/nu_ebi.c | 193 - .../libraries/ma35/StdDriver/src/nu_ecap.c | 96 - .../libraries/ma35/StdDriver/src/nu_epwm.c | 1616 --- .../libraries/ma35/StdDriver/src/nu_gpio.c | 255 - .../libraries/ma35/StdDriver/src/nu_i2c.c | 1244 --- .../libraries/ma35/StdDriver/src/nu_i2s.c | 267 - .../libraries/ma35/StdDriver/src/nu_kpi.c | 135 - .../libraries/ma35/StdDriver/src/nu_pdma.c | 443 - .../libraries/ma35/StdDriver/src/nu_qei.c | 122 - .../libraries/ma35/StdDriver/src/nu_qspi.c | 788 -- .../libraries/ma35/StdDriver/src/nu_rtc.c | 731 -- .../libraries/ma35/StdDriver/src/nu_sc.c | 368 - .../libraries/ma35/StdDriver/src/nu_scuart.c | 222 - .../libraries/ma35/StdDriver/src/nu_sdh.c | 276 - .../libraries/ma35/StdDriver/src/nu_spi.c | 1313 --- .../libraries/ma35/StdDriver/src/nu_ssmcc.c | 133 - .../libraries/ma35/StdDriver/src/nu_sspcc.c | 106 - .../libraries/ma35/StdDriver/src/nu_sys.c | 149 - .../libraries/ma35/StdDriver/src/nu_timer.c | 396 - .../ma35/StdDriver/src/nu_timer_pwm.c | 437 - .../libraries/ma35/StdDriver/src/nu_uart.c | 545 - .../libraries/ma35/StdDriver/src/nu_wdt.c | 68 - .../libraries/ma35/StdDriver/src/nu_whc.c | 100 - .../libraries/ma35/StdDriver/src/nu_wwdt.c | 67 - .../libraries/ma35/UsbHostLib/SConscript | 12 - .../libraries/ma35/UsbHostLib/inc/config.h | 140 - .../libraries/ma35/UsbHostLib/inc/ehci.h | 277 - .../libraries/ma35/UsbHostLib/inc/hub.h | 124 - .../libraries/ma35/UsbHostLib/inc/ohci.h | 147 - .../libraries/ma35/UsbHostLib/inc/usb.h | 386 - .../libraries/ma35/UsbHostLib/inc/usbh_lib.h | 189 - .../libraries/ma35/UsbHostLib/src/_ehci.c_ | 1273 --- .../ma35/UsbHostLib/src/_ehci_iso.c_ | 902 -- .../libraries/ma35/UsbHostLib/src/_ohci.c_ | 1281 --- .../libraries/ma35/UsbHostLib/src/ehci_0.c | 43 - .../libraries/ma35/UsbHostLib/src/ehci_1.c | 43 - .../libraries/ma35/UsbHostLib/src/mem_alloc.c | 501 - .../libraries/ma35/UsbHostLib/src/ohci_0.c | 41 - .../libraries/ma35/UsbHostLib/src/ohci_1.c | 41 - .../libraries/ma35/UsbHostLib/src/support.c | 273 - .../libraries/ma35/UsbHostLib/src/usb_core.c | 337 - bsp/nuvoton/libraries/ma35/libcpu/SConscript | 15 - .../libraries/ma35/libcpu/arm/SConscript | 17 - .../ma35/libcpu/arm/cortex-m4/SConscript | 14 - .../ma35/libcpu/arm/cortex-m4/interrupt.c | 156 - .../ma35/libcpu/arm/cortex-m4/interrupt.h | 27 - bsp/nuvoton/libraries/ma35/rtt_port/Kconfig | 1 + .../libraries/n9h30/Driver/Include/N9H30.h | 2097 ---- .../libraries/n9h30/Driver/Include/NuMicro.h | 51 - .../libraries/n9h30/Driver/Include/adc_reg.h | 378 - .../libraries/n9h30/Driver/Include/emac_reg.h | 2063 ---- .../libraries/n9h30/Driver/Include/nu_2d.h | 190 - .../libraries/n9h30/Driver/Include/nu_adc.h | 279 - .../libraries/n9h30/Driver/Include/nu_can.h | 459 - .../libraries/n9h30/Driver/Include/nu_cap.h | 316 - .../n9h30/Driver/Include/nu_crypto.h | 689 -- .../libraries/n9h30/Driver/Include/nu_emac.h | 396 - .../n9h30/Driver/Include/nu_etimer.h | 717 -- .../libraries/n9h30/Driver/Include/nu_fmi.h | 394 - .../libraries/n9h30/Driver/Include/nu_gpio.h | 162 - .../libraries/n9h30/Driver/Include/nu_i2c.h | 105 - .../libraries/n9h30/Driver/Include/nu_i2s.h | 130 - .../libraries/n9h30/Driver/Include/nu_jpeg.h | 398 - .../n9h30/Driver/Include/nu_jpegcodec.h | 227 - .../libraries/n9h30/Driver/Include/nu_lcd.h | 310 - .../libraries/n9h30/Driver/Include/nu_pwm.h | 238 - .../libraries/n9h30/Driver/Include/nu_rtc.h | 508 - .../n9h30/Driver/Include/nu_scuart.h | 335 - .../libraries/n9h30/Driver/Include/nu_sdh.h | 764 -- .../libraries/n9h30/Driver/Include/nu_spi.h | 121 - .../libraries/n9h30/Driver/Include/nu_sys.h | 373 - .../libraries/n9h30/Driver/Include/nu_timer.h | 61 - .../libraries/n9h30/Driver/Include/nu_uart.h | 777 -- .../libraries/n9h30/Driver/Include/nu_usbd.h | 937 -- .../libraries/n9h30/Driver/Include/nu_wdt.h | 185 - .../libraries/n9h30/Driver/Include/nu_wwdt.h | 120 - bsp/nuvoton/libraries/n9h30/Driver/SConscript | 26 - .../libraries/n9h30/Driver/Source/nu_can.c | 1286 --- .../libraries/n9h30/Driver/Source/nu_cap.c | 1520 --- .../libraries/n9h30/Driver/Source/nu_crypto.c | 394 - .../libraries/n9h30/Driver/Source/nu_emac.c | 1158 -- .../libraries/n9h30/Driver/Source/nu_etimer.c | 341 - .../libraries/n9h30/Driver/Source/nu_fmi.c | 920 -- .../libraries/n9h30/Driver/Source/nu_gpio.c | 500 - .../libraries/n9h30/Driver/Source/nu_i2s.c | 461 - .../libraries/n9h30/Driver/Source/nu_lcd.c | 959 -- .../libraries/n9h30/Driver/Source/nu_pwm.c | 1117 -- .../libraries/n9h30/Driver/Source/nu_rtc.c | 1153 -- .../libraries/n9h30/Driver/Source/nu_scuart.c | 246 - .../libraries/n9h30/Driver/Source/nu_sdh.c | 1187 -- .../libraries/n9h30/Driver/Source/nu_spi.c | 336 - .../libraries/n9h30/Driver/Source/nu_sys.c | 675 -- .../libraries/n9h30/Driver/Source/nu_timer.c | 146 - .../libraries/n9h30/Driver/Source/nu_uart.c | 2200 ---- .../libraries/n9h30/Driver/Source/nu_usbd.c | 619 -- .../libraries/n9h30/Driver/Source/nu_wdt.c | 66 - .../libraries/n9h30/Driver/Source/nu_wwdt.c | 72 - .../libraries/n9h30/Script/InitDDR2.ini | 2 - bsp/nuvoton/libraries/n9h30/Script/N9H30.sct | 12 - .../libraries/n9h30/UsbHostLib/SConscript | 12 - .../libraries/n9h30/UsbHostLib/inc/config.h | 1524 --- .../libraries/n9h30/UsbHostLib/inc/ehci.h | 279 - .../libraries/n9h30/UsbHostLib/inc/hub.h | 124 - .../libraries/n9h30/UsbHostLib/inc/ohci.h | 147 - .../libraries/n9h30/UsbHostLib/inc/usb.h | 394 - .../libraries/n9h30/UsbHostLib/inc/usbh_lib.h | 188 - .../libraries/n9h30/UsbHostLib/src/ehci.c | 1289 --- .../libraries/n9h30/UsbHostLib/src/ehci_iso.c | 918 -- .../n9h30/UsbHostLib/src/mem_alloc.c | 540 - .../libraries/n9h30/UsbHostLib/src/ohci.c | 1301 --- .../libraries/n9h30/UsbHostLib/src/support.c | 282 - .../libraries/n9h30/UsbHostLib/src/usb_core.c | 312 - bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig | 1 + .../libraries/nuc980/Driver/Include/NuMicro.h | 49 - .../libraries/nuc980/Driver/Include/adc_reg.h | 378 - .../nuc980/Driver/Include/emac_reg.h | 2063 ---- .../libraries/nuc980/Driver/Include/nu_adc.h | 279 - .../libraries/nuc980/Driver/Include/nu_can.h | 461 - .../libraries/nuc980/Driver/Include/nu_cap.h | 471 - .../nuc980/Driver/Include/nu_crypto.h | 1456 --- .../libraries/nuc980/Driver/Include/nu_ebi.h | 418 - .../libraries/nuc980/Driver/Include/nu_emac.h | 399 - .../nuc980/Driver/Include/nu_etimer.h | 905 -- .../libraries/nuc980/Driver/Include/nu_gpio.h | 835 -- .../libraries/nuc980/Driver/Include/nu_i2c.h | 541 - .../libraries/nuc980/Driver/Include/nu_i2s.h | 133 - .../libraries/nuc980/Driver/Include/nu_pdma.h | 1249 --- .../libraries/nuc980/Driver/Include/nu_pwm.h | 271 - .../libraries/nuc980/Driver/Include/nu_qspi.h | 929 -- .../libraries/nuc980/Driver/Include/nu_rtc.h | 445 - .../libraries/nuc980/Driver/Include/nu_sc.h | 425 - .../nuc980/Driver/Include/nu_scuart.h | 333 - .../libraries/nuc980/Driver/Include/nu_sdh.h | 721 -- .../libraries/nuc980/Driver/Include/nu_spi.h | 852 -- .../libraries/nuc980/Driver/Include/nu_sys.h | 838 -- .../libraries/nuc980/Driver/Include/nu_uart.h | 888 -- .../libraries/nuc980/Driver/Include/nu_usbd.h | 942 -- .../libraries/nuc980/Driver/Include/nu_wdt.h | 218 - .../libraries/nuc980/Driver/Include/nu_wwdt.h | 118 - .../libraries/nuc980/Driver/Include/nuc980.h | 1748 --- .../Driver/Library/libStdDriver.uvprojx | 495 - .../Driver/Library/libStdDriver_4.uvproj | 501 - .../libraries/nuc980/Driver/SConscript | 26 - .../libraries/nuc980/Driver/Source/nu_can.c | 1286 --- .../libraries/nuc980/Driver/Source/nu_cap.c | 397 - .../nuc980/Driver/Source/nu_crypto.c | 2673 ----- .../libraries/nuc980/Driver/Source/nu_ebi.c | 190 - .../libraries/nuc980/Driver/Source/nu_emac.c | 1170 -- .../nuc980/Driver/Source/nu_etimer.c | 490 - .../libraries/nuc980/Driver/Source/nu_gpio.c | 151 - .../libraries/nuc980/Driver/Source/nu_i2c.c | 1243 --- .../libraries/nuc980/Driver/Source/nu_i2s.c | 463 - .../libraries/nuc980/Driver/Source/nu_pdma.c | 396 - .../libraries/nuc980/Driver/Source/nu_qspi.c | 598 - .../libraries/nuc980/Driver/Source/nu_rtc.c | 808 -- .../nuc980/Driver/Source/nu_scuart.c | 242 - .../libraries/nuc980/Driver/Source/nu_sdh.c | 1181 -- .../libraries/nuc980/Driver/Source/nu_spi.c | 603 -- .../libraries/nuc980/Driver/Source/nu_sys.c | 723 -- .../libraries/nuc980/Driver/Source/nu_uart.c | 776 -- .../libraries/nuc980/Driver/Source/nu_usbd.c | 679 -- .../libraries/nuc980/Driver/Source/nu_wdt.c | 67 - .../libraries/nuc980/Driver/Source/nu_wwdt.c | 67 - .../libraries/nuc980/Script/NUC980xx41.ini | 24 - .../libraries/nuc980/Script/NUC980xx61.ini | 24 - .../libraries/nuc980/Script/NUC980xx71.ini | 26 - .../libraries/nuc980/UsbHostLib/SConscript | 12 - .../libraries/nuc980/UsbHostLib/inc/config.h | 1566 --- .../libraries/nuc980/UsbHostLib/inc/ehci.h | 279 - .../libraries/nuc980/UsbHostLib/inc/hub.h | 124 - .../libraries/nuc980/UsbHostLib/inc/ohci.h | 147 - .../libraries/nuc980/UsbHostLib/inc/usb.h | 394 - .../nuc980/UsbHostLib/inc/usbh_lib.h | 188 - .../libraries/nuc980/UsbHostLib/src/ehci.c | 1289 --- .../nuc980/UsbHostLib/src/ehci_iso.c | 918 -- .../nuc980/UsbHostLib/src/mem_alloc.c | 540 - .../libraries/nuc980/UsbHostLib/src/ohci.c | 1301 --- .../libraries/nuc980/UsbHostLib/src/support.c | 274 - .../nuc980/UsbHostLib/src/usb_core.c | 312 - bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig | 1 + bsp/nuvoton/ma35-rtp/.config | 18 + bsp/nuvoton/ma35-rtp/SConstruct | 19 + bsp/nuvoton/ma35-rtp/rtconfig.h | 8 + bsp/nuvoton/ma35-rtp/rtthread.bin | Bin 107036 -> 106648 bytes bsp/nuvoton/nk-980iot/.config | 15 + bsp/nuvoton/nk-980iot/SConstruct | 18 + bsp/nuvoton/nk-980iot/rtconfig.h | 6 + bsp/nuvoton/nk-n9h30/.config | 15 + bsp/nuvoton/nk-n9h30/SConstruct | 18 + bsp/nuvoton/nk-n9h30/rtconfig.h | 6 + bsp/nuvoton/nk-rtu980/.config | 15 + bsp/nuvoton/nk-rtu980/SConstruct | 18 + bsp/nuvoton/nk-rtu980/rtconfig.h | 6 + bsp/nuvoton/numaker-hmi-ma35d1/.config | 18 + bsp/nuvoton/numaker-hmi-ma35d1/SConstruct | 19 + bsp/nuvoton/numaker-hmi-ma35d1/rtconfig.h | 8 + bsp/nuvoton/numaker-iot-m467/.config | 18 + bsp/nuvoton/numaker-iot-m467/SConstruct | 19 + bsp/nuvoton/numaker-iot-m467/rtconfig.h | 8 + bsp/nuvoton/numaker-iot-m487/.config | 18 + bsp/nuvoton/numaker-iot-m487/SConstruct | 19 + bsp/nuvoton/numaker-iot-m487/rtconfig.h | 8 + bsp/nuvoton/numaker-iot-ma35d1/.config | 18 + bsp/nuvoton/numaker-iot-ma35d1/SConstruct | 19 + bsp/nuvoton/numaker-iot-ma35d1/rtconfig.h | 8 + bsp/nuvoton/numaker-m032ki/.config | 18 + bsp/nuvoton/numaker-m032ki/SConstruct | 19 + bsp/nuvoton/numaker-m032ki/rtconfig.h | 8 + bsp/nuvoton/numaker-m2354/.config | 18 + bsp/nuvoton/numaker-m2354/SConstruct | 19 + bsp/nuvoton/numaker-m2354/rtconfig.h | 8 + bsp/nuvoton/numaker-m467hj/.config | 18 + bsp/nuvoton/numaker-m467hj/SConstruct | 19 + bsp/nuvoton/numaker-m467hj/rtconfig.h | 8 + bsp/nuvoton/numaker-pfm-m487/.config | 18 + bsp/nuvoton/numaker-pfm-m487/SConstruct | 19 + bsp/nuvoton/numaker-pfm-m487/rtconfig.h | 8 + 952 files changed, 530 insertions(+), 682496 deletions(-) delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/arm_common_tables.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/arm_const_structs.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/arm_math.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc_V6.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_gcc.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm0.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm0plus.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm3.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm4.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm7.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmFunc.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmInstr.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmSimd.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_sc000.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/Include/core_sc300.h delete mode 100644 bsp/nuvoton/libraries/m031/CMSIS/SConscript delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/M031Series.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/NuMicro.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/acmp_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/adc_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/bpwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/clk_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/crc_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ebi_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/fmc_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/gpio_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/hdiv_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/i2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pdma_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/qspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/rtc_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/spi_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/sys_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/system_M031Series.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/timer_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uart_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ui2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/usbd_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uuart_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wwdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/ARM/startup_M031Series.s delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/GCC/startup_M031Series.S delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/IAR/startup_M031Series.s delete mode 100644 bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/system_M031Series.c delete mode 100644 bsp/nuvoton/libraries/m031/Device/SConscript delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/SConscript delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_acmp.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_adc.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_bpwm.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_clk.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_crc.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_ebi.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_fmc.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_gpio.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_hdiv.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_i2c.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pdma.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pwm.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_qspi.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_rtc.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_spi.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_sys.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_timer.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_uart.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usbd.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_i2c.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_spi.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_uart.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wdt.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wwdt.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewd delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewp delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.eww delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.uvprojx delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/lib/nutool_clkcfg.h delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_acmp.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_adc.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_bpwm.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_clk.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_crc.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_ebi.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_fmc.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_gpio.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_i2c.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_pdma.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_pwm.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_qspi.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_rtc.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_spi.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_sys.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_timer.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_uart.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_usbd.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_i2c.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_spi.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_uart.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_wdt.c delete mode 100644 bsp/nuvoton/libraries/m031/StdDriver/src/nu_wwdt.c delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_common_tables.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_const_structs.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_math.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armcc.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armclang.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_compiler.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_gcc.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_version.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mbl.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mml.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm0.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm0plus.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm23.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm3.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm33.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm4.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm7.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_sc000.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/core_sc300.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/mpu_armv7.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/Include/tz_context.h delete mode 100644 bsp/nuvoton/libraries/m2354/CMSIS/SConscript delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/M2354.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/acmp_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/bpwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/can_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/clk_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crc_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crpt_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/dac_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/eadc_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ebi_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ecap_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/epwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewwdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/fmc_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/gpio_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/hdiv_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2s_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/keystore_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/lcd_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/otg_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/pdma_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qei_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/rtc_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sc_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/scu_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sdh_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/spi_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sys_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/tamper_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/timer_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/trng_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uart_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ui2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbd_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbh_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uuart_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wwdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/ARM/startup_M2354.s delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/GCC/startup_M2354.S delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/IAR/startup_M2354.s delete mode 100644 bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/system_M2354.c delete mode 100644 bsp/nuvoton/libraries/m2354/Device/SConscript delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/SConscript delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_acmp.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_bpwm.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_can.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_clk.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crc.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crypto.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dac.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dpm.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_eadc.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ebi.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ecap.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_epwm.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewdt.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewwdt.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fmc.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fvc.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_gpio.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2c.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2s.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_keystore.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_lcd.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_otg.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_partition_M2354.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_pdma.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_plm.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qei.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qspi.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rng.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rtc.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sc.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scu.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scuart.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sdh.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_spi.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sys.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_tamper.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer_pwm.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_trng.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_uart.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usbd.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_i2c.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_spi.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_uart.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wdt.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wwdt.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewd delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.eww delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/lib/nutool_clkcfg.h delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_acmp.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_bpwm.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_can.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_clk.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crc.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crypto.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dac.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dpm.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_eadc.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ebi.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ecap.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_epwm.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewdt.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewwdt.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fmc.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fvc.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_gpio.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2c.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2s.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_keystore.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_lcd.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_pdma.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qei.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qspi.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rng.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rtc.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sc.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_scuart.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sdh.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_spi.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sys.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_tamper.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer_pwm.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_trng.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_uart.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usbd.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_i2c.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_spi.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_uart.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wdt.c delete mode 100644 bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wwdt.c delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/SConscript delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/inc/config.h delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/inc/hub.h delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/inc/ohci.h delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/inc/usb.h delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/inc/usbh_lib.h delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/src/mem_alloc.c delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/src/ohci.c delete mode 100644 bsp/nuvoton/libraries/m2354/USBHostLib/src/usb_core.c delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/arm_common_tables.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/arm_const_structs.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/arm_math.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc_V6.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armclang.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_compiler.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_gcc.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_version.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_armv8mbl.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_armv8mml.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm0.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm0plus.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm23.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm3.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm33.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm4.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm7.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmFunc.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmInstr.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmSimd.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_sc000.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/core_sc300.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/mpu_armv7.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/Include/tz_context.h delete mode 100644 bsp/nuvoton/libraries/m460/CMSIS/SConscript delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/NuMicro.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/acmp_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bmc_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bpwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/canfd_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ccap_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/clk_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crc_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crypto_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/dac_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eadc_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ebi_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ecap_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/emac_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/epwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eqei_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/fmc_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/gpio_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hbi_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsotg_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbd_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbh_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2s_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/keystore_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/kpi_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/m460.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/opa_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/otg_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/pdma_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/psio_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/qspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/rtc_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/sc_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/sdh_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/spi_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/spim_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/sys_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/system_m460.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/tcm_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/timer_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/trng_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uart_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ui2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbd_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbh_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uuart_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wwdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/ARM/startup_m460.s delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/GCC/startup_M460.S delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/IAR/startup_M460.s delete mode 100644 bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/system_m460.c delete mode 100644 bsp/nuvoton/libraries/m460/Device/SConscript delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/SConscript delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_acmp.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bmc.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bpwm.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_canfd.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ccap.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_clk.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crc.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crypto.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_dac.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eadc.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ebi.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ecap.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_epwm.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eqei.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_fmc.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_gpio.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hbi.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsotg.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsusbd.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_i2c.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_i2s.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_keystore.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_kpi.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_opa.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_otg.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_pdma.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_psio.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_qspi.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rng.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rtc.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sc.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_scuart.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sdh.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spi.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spim.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sys.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer_pwm.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_trng.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_uart.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usbd.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_i2c.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_spi.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_uart.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wdt.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wwdt.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/lib/libStdDriver.uvprojx delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/lib/nutool_clkcfg.h delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_acmp.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_bmc.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_bpwm.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_canfd.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_ccap.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_clk.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_crc.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_crypto.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_dac.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_eadc.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_ebi.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_ecap.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_epwm.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_eqei.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_fmc.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_gpio.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_hbi.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_hsusbd.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2c.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2s.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_keystore.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_kpi.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_pdma.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_qspi.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_rng.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_rtc.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_sc.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_scuart.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_sdh.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_spi.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_spim.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_sys.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer_pwm.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_trng.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_uart.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_usbd.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_i2c.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_spi.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_uart.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_wdt.c delete mode 100644 bsp/nuvoton/libraries/m460/StdDriver/src/nu_wwdt.c delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/SConscript delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/inc/config.h delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/inc/ehci.h delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/inc/hub.h delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/inc/ohci.h delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/inc/usb.h delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/inc/usbh_lib.h delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/src/ehci.c delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/src/ehci_iso.c delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/src/mem_alloc.c delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/src/ohci.c delete mode 100644 bsp/nuvoton/libraries/m460/USBHostLib/src/usb_core.c delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/arm_common_tables.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/arm_const_structs.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/arm_math.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc_V6.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_gcc.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm0.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm0plus.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm3.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm4.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm7.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmFunc.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmInstr.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmSimd.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_sc000.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/Include/core_sc300.h delete mode 100644 bsp/nuvoton/libraries/m480/CMSIS/SConscript delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/M480.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/NuMicro.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/acmp_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/bpwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/can_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ccap_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/clk_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crc_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crypto_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/dac_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/eadc_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ebi_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ecap_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/emac_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/epwm_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/fmc_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/gpio_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsotg_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbd_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbh_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2s_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/opa_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/otg_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/pdma_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qei_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/rtc_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sc_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sdh_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spi_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spim_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sys_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/system_M480.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/timer_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/trng_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uart_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ui2c_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbd_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbh_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uspi_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uuart_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wwdt_reg.h delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/ARM/startup_M480.s delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/GCC/startup_M480.S delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/IAR/startup_M480.s delete mode 100644 bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/system_M480.c delete mode 100644 bsp/nuvoton/libraries/m480/Device/SConscript delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/SConscript delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_acmp.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_bpwm.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_can.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ccap.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_clk.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crc.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crypto.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_dac.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_eadc.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ebi.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ecap.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_emac.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_epwm.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_fmc.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_gpio.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsotg.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsusbd.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_i2c.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_i2s.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_opa.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_otg.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_pdma.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qei.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qspi.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_rtc.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sc.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_scuart.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sdh.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spi.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spim.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sys.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer_pwm.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_trng.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_uart.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usbd.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_i2c.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_spi.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_uart.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wdt.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wwdt.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewd delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewp delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.eww delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.uvprojx delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver_4.uvproj delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/lib/nutool_clkcfg.h delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_acmp.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_bpwm.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_can.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_ccap.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_clk.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_crc.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_crypto.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_dac.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_eadc.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_ebi.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_ecap.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_emac.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_epwm.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_fmc.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_gpio.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_hsusbd.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2c.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2s.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_pdma.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_qei.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_qspi.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_rtc.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_sc.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_scuart.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_sdh.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_spi.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_spim.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_sys.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer_pwm.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_trng.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_uart.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_usbd.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_i2c.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_spi.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_uart.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_wdt.c delete mode 100644 bsp/nuvoton/libraries/m480/StdDriver/src/nu_wwdt.c delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/SConscript delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/inc/config.h delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/inc/ehci.h delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/inc/hub.h delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/inc/ohci.h delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/inc/usb.h delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/inc/usbh_lib.h delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/src/ehci.c delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/src/ehci_iso.c delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/src/mem_alloc.c delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/src/ohci.c delete mode 100644 bsp/nuvoton/libraries/m480/USBHostLib/src/usb_core.c delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_common_tables.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_const_structs.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_math.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc_V6.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_gcc.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm0.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm0plus.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm3.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm4.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm7.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmFunc.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmInstr.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmSimd.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_sc000.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/Include/core_sc300.h delete mode 100644 bsp/nuvoton/libraries/ma35/CMSIS/SConscript delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/NuMicro.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/adc_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/canfd_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ccap_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/clk_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/crypto_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ddr32phy_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/disp_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/dpm_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/eadc_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ebi_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ecap_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/epwm_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gfx_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gmac_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gpio_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/hsusbd_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/hsusbh_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/hwsem_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/i2c_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/i2s_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/kpi_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ks_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ma35d1.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/nfi_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/otp_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/pdma_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/plm_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/qei_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/qspi_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/rtc_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sc_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sdh_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/spi_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ssmcc_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sspcc_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sys_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/system_ma35d1.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/timer_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/trng_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/uart_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/umctl2_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/usbh_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wdt_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/whc_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wwdt_reg.h delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/ARM/startup_ma35d1_subm.s delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/GCC/startup_ma35d1_subm.S delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/IAR/startup_ma35d1_subm.s delete mode 100644 bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/system_ma35d1_subm.c delete mode 100644 bsp/nuvoton/libraries/ma35/Device/SConscript delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/SConscript delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_adc.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_canfd.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ccap.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_clk.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_disp.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_eadc.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ebi.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ecap.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_epwm.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_gpio.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_hwsem.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2c.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2s.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_kpi.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_pdma.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qei.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qspi.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_rtc.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sc.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_scuart.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sdh.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_spi.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ssmcc.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sspcc.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sys.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer_pwm.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_uart.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wdt.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_whc.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wwdt.h delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_adc.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_canfd.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ccap.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_clk.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_disp.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_eadc.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ebi.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ecap.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_epwm.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_gpio.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2c.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2s.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_kpi.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_pdma.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qei.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qspi.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_rtc.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sc.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_scuart.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sdh.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_spi.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ssmcc.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sspcc.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sys.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer_pwm.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_uart.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wdt.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_whc.c delete mode 100644 bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wwdt.c delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/SConscript delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/inc/config.h delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/inc/ehci.h delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/inc/hub.h delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/inc/ohci.h delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usb.h delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usbh_lib.h delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci.c_ delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci_iso.c_ delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ohci.c_ delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_0.c delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_1.c delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/mem_alloc.c delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_0.c delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_1.c delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/support.c delete mode 100644 bsp/nuvoton/libraries/ma35/UsbHostLib/src/usb_core.c delete mode 100644 bsp/nuvoton/libraries/ma35/libcpu/SConscript delete mode 100644 bsp/nuvoton/libraries/ma35/libcpu/arm/SConscript delete mode 100644 bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/SConscript delete mode 100644 bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.c delete mode 100644 bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/N9H30.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/NuMicro.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/adc_reg.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/emac_reg.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_2d.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_adc.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_can.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_cap.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_crypto.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_emac.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_etimer.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_fmi.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_gpio.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2c.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2s.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpeg.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpegcodec.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_lcd.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_pwm.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_rtc.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_scuart.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sdh.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_spi.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sys.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_timer.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_usbd.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_wdt.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Include/nu_wwdt.h delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/SConscript delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_can.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_cap.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_crypto.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_emac.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_etimer.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_fmi.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_gpio.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_i2s.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_lcd.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_pwm.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_rtc.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_scuart.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sdh.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_spi.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sys.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_timer.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_uart.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_usbd.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wdt.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wwdt.c delete mode 100644 bsp/nuvoton/libraries/n9h30/Script/InitDDR2.ini delete mode 100644 bsp/nuvoton/libraries/n9h30/Script/N9H30.sct delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/SConscript delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/config.h delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/ehci.h delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/hub.h delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/ohci.h delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usb.h delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usbh_lib.h delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci.c delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci_iso.c delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/src/mem_alloc.c delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ohci.c delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/src/support.c delete mode 100644 bsp/nuvoton/libraries/n9h30/UsbHostLib/src/usb_core.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/NuMicro.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/adc_reg.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/emac_reg.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_adc.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_can.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_cap.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_crypto.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_ebi.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_emac.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_etimer.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_gpio.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2c.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2s.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pdma.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pwm.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_qspi.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_rtc.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sc.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_scuart.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sdh.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_spi.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sys.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_uart.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_usbd.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_wdt.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nu_wwdt.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Include/nuc980.h delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver.uvprojx delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver_4.uvproj delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/SConscript delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_can.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_cap.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_crypto.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_ebi.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_emac.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_etimer.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_gpio.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2c.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2s.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_pdma.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_qspi.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_rtc.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_scuart.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sdh.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_spi.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sys.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_uart.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_usbd.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wdt.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wwdt.c delete mode 100644 bsp/nuvoton/libraries/nuc980/Script/NUC980xx41.ini delete mode 100644 bsp/nuvoton/libraries/nuc980/Script/NUC980xx61.ini delete mode 100644 bsp/nuvoton/libraries/nuc980/Script/NUC980xx71.ini delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/SConscript delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/config.h delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/ehci.h delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/hub.h delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/ohci.h delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usb.h delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usbh_lib.h delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci.c delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci_iso.c delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/src/mem_alloc.c delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ohci.c delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/src/support.c delete mode 100644 bsp/nuvoton/libraries/nuc980/UsbHostLib/src/usb_core.c diff --git a/bsp/nuvoton/README.md b/bsp/nuvoton/README.md index c4b93ed78ab..d36d3b22312 100644 --- a/bsp/nuvoton/README.md +++ b/bsp/nuvoton/README.md @@ -9,7 +9,7 @@ Current supported BSP shown in below table: | NK-980IOT | ARM926EJS | [nk-980iot](nk-980iot) | | NuMaker-M2354 | CORTEX-M23 | [numaker-m2354](numaker-m2354) | | NK-RTU980 | ARM926EJS | [nk-rtu980](nk-rtu980) | -| NK-N9H30 | CORTEX-M4 | [nk-n9h30](nk-n9h30) | +| NK-N9H30 | ARM926EJS | [nk-n9h30](nk-n9h30) | | NuMaker-M032KI | CORTEX-M0 | [numaker-m032ki](numaker-m032ki) | | NuMaker-M467HJ | CORTEX-M4 | [numaker-m467hj](numaker-m467hj) | | NuMaker-IoT-M467 | CORTEX-M4 | [numaker-iot-m467](numaker-iot-m467) | diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_common_tables.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_common_tables.h deleted file mode 100644 index 03153851b8f..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_common_tables.h +++ /dev/null @@ -1,136 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. October 2015 -* $Revision: V.1.4.5 a -* -* Project: CMSIS DSP Library -* Title: arm_common_tables.h -* -* Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_COMMON_TABLES_H -#define _ARM_COMMON_TABLES_H - -#include "arm_math.h" - -extern const uint16_t armBitRevTable[1024]; -extern const q15_t armRecipTableQ15[64]; -extern const q31_t armRecipTableQ31[64]; -/* extern const q31_t realCoefAQ31[1024]; */ -/* extern const q31_t realCoefBQ31[1024]; */ -extern const float32_t twiddleCoef_16[32]; -extern const float32_t twiddleCoef_32[64]; -extern const float32_t twiddleCoef_64[128]; -extern const float32_t twiddleCoef_128[256]; -extern const float32_t twiddleCoef_256[512]; -extern const float32_t twiddleCoef_512[1024]; -extern const float32_t twiddleCoef_1024[2048]; -extern const float32_t twiddleCoef_2048[4096]; -extern const float32_t twiddleCoef_4096[8192]; -#define twiddleCoef twiddleCoef_4096 -extern const q31_t twiddleCoef_16_q31[24]; -extern const q31_t twiddleCoef_32_q31[48]; -extern const q31_t twiddleCoef_64_q31[96]; -extern const q31_t twiddleCoef_128_q31[192]; -extern const q31_t twiddleCoef_256_q31[384]; -extern const q31_t twiddleCoef_512_q31[768]; -extern const q31_t twiddleCoef_1024_q31[1536]; -extern const q31_t twiddleCoef_2048_q31[3072]; -extern const q31_t twiddleCoef_4096_q31[6144]; -extern const q15_t twiddleCoef_16_q15[24]; -extern const q15_t twiddleCoef_32_q15[48]; -extern const q15_t twiddleCoef_64_q15[96]; -extern const q15_t twiddleCoef_128_q15[192]; -extern const q15_t twiddleCoef_256_q15[384]; -extern const q15_t twiddleCoef_512_q15[768]; -extern const q15_t twiddleCoef_1024_q15[1536]; -extern const q15_t twiddleCoef_2048_q15[3072]; -extern const q15_t twiddleCoef_4096_q15[6144]; -extern const float32_t twiddleCoef_rfft_32[32]; -extern const float32_t twiddleCoef_rfft_64[64]; -extern const float32_t twiddleCoef_rfft_128[128]; -extern const float32_t twiddleCoef_rfft_256[256]; -extern const float32_t twiddleCoef_rfft_512[512]; -extern const float32_t twiddleCoef_rfft_1024[1024]; -extern const float32_t twiddleCoef_rfft_2048[2048]; -extern const float32_t twiddleCoef_rfft_4096[4096]; - - -/* floating-point bit reversal tables */ -#define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) -#define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) -#define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) -#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) -#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) -#define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) -#define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) -#define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; - -/* fixed-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) -#define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) -#define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) -#define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) -#define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) -#define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) -#define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) -#define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; - -/* Tables for Fast Math Sine and Cosine */ -extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; -extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; -extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; - -#endif /* ARM_COMMON_TABLES_H */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_const_structs.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_const_structs.h deleted file mode 100644 index 4d026173446..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_const_structs.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. March 2015 -* $Revision: V.1.4.5 -* -* Project: CMSIS DSP Library -* Title: arm_const_structs.h -* -* Description: This file has constant structs that are initialized for -* user convenience. For example, some can be given as -* arguments to the arm_cfft_f32() function. -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_CONST_STRUCTS_H -#define _ARM_CONST_STRUCTS_H - -#include "arm_math.h" -#include "arm_common_tables.h" - -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; - -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; - -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; - -#endif diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_math.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_math.h deleted file mode 100644 index d33f8a9b3b5..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/arm_math.h +++ /dev/null @@ -1,7154 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2015 ARM Limited. All rights reserved. -* -* $Date: 20. October 2015 -* $Revision: V1.4.5 b -* -* Project: CMSIS DSP Library -* Title: arm_math.h -* -* Description: Public header file for CMSIS DSP Library -* -* Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. - * -------------------------------------------------------------------- */ - -/** - \mainpage CMSIS DSP Software Library - * - * Introduction - * ------------ - * - * This user manual describes the CMSIS DSP software library, - * a suite of common signal processing functions for use on Cortex-M processor based devices. - * - * The library is divided into a number of functions each covering a specific category: - * - Basic math functions - * - Fast math functions - * - Complex math functions - * - Filters - * - Matrix functions - * - Transforms - * - Motor control functions - * - Statistical functions - * - Support functions - * - Interpolation functions - * - * The library has separate functions for operating on 8-bit integers, 16-bit integers, - * 32-bit integer and 32-bit floating-point values. - * - * Using the Library - * ------------ - * - * The library installer contains prebuilt versions of the libraries in the Lib folder. - * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7l_math.lib (Little endian on Cortex-M7) - * - arm_cortexM7b_math.lib (Big endian on Cortex-M7) - * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4l_math.lib (Little endian on Cortex-M4) - * - arm_cortexM4b_math.lib (Big endian on Cortex-M4) - * - arm_cortexM3l_math.lib (Little endian on Cortex-M3) - * - arm_cortexM3b_math.lib (Big endian on Cortex-M3) - * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+) - * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+) - * - * The library functions are declared in the public file arm_math.h which is placed in the Include folder. - * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single - * public header file arm_math.h for Cortex-M7/M4/M3/M0/M0+ with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. - * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or - * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. - * - * Examples - * -------- - * - * The library ships with a number of examples which demonstrate how to use the library functions. - * - * Toolchain Support - * ------------ - * - * The library has been developed and tested with MDK-ARM version 5.14.0.0 - * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. - * - * Building the Library - * ------------ - * - * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. - * - arm_cortexM_math.uvprojx - * - * - * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above. - * - * Pre-processor Macros - * ------------ - * - * Each library project have differant pre-processor macros. - * - * - UNALIGNED_SUPPORT_DISABLE: - * - * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access - * - * - ARM_MATH_BIG_ENDIAN: - * - * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. - * - * - ARM_MATH_MATRIX_CHECK: - * - * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices - * - * - ARM_MATH_ROUNDING: - * - * Define macro ARM_MATH_ROUNDING for rounding on support functions - * - * - ARM_MATH_CMx: - * - * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target - * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and - * ARM_MATH_CM7 for building the library on cortex-M7. - * - * - __FPU_PRESENT: - * - * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries - * - *
- * CMSIS-DSP in ARM::CMSIS Pack - * ----------------------------- - * - * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: - * |File/Folder |Content | - * |------------------------------|------------------------------------------------------------------------| - * |\b CMSIS\\Documentation\\DSP | This documentation | - * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | - * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | - * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | - * - *
- * Revision History of CMSIS-DSP - * ------------ - * Please refer to \ref ChangeLog_pg. - * - * Copyright Notice - * ------------ - * - * Copyright (C) 2010-2015 ARM Limited. All rights reserved. - */ - - -/** - * @defgroup groupMath Basic Math Functions - */ - -/** - * @defgroup groupFastMath Fast Math Functions - * This set of functions provides a fast approximation to sine, cosine, and square root. - * As compared to most of the other functions in the CMSIS math library, the fast math functions - * operate on individual values and not arrays. - * There are separate functions for Q15, Q31, and floating-point data. - * - */ - -/** - * @defgroup groupCmplxMath Complex Math Functions - * This set of functions operates on complex data vectors. - * The data in the complex arrays is stored in an interleaved fashion - * (real, imag, real, imag, ...). - * In the API functions, the number of samples in a complex array refers - * to the number of complex values; the array contains twice this number of - * real values. - */ - -/** - * @defgroup groupFilters Filtering Functions - */ - -/** - * @defgroup groupMatrix Matrix Functions - * - * This set of functions provides basic matrix math operations. - * The functions operate on matrix data structures. For example, - * the type - * definition for the floating-point matrix structure is shown - * below: - *
- *     typedef struct
- *     {
- *       uint16_t numRows;     // number of rows of the matrix.
- *       uint16_t numCols;     // number of columns of the matrix.
- *       float32_t *pData;     // points to the data of the matrix.
- *     } arm_matrix_instance_f32;
- * 
- * There are similar definitions for Q15 and Q31 data types. - * - * The structure specifies the size of the matrix and then points to - * an array of data. The array is of size numRows X numCols - * and the values are arranged in row order. That is, the - * matrix element (i, j) is stored at: - *
- *     pData[i*numCols + j]
- * 
- * - * \par Init Functions - * There is an associated initialization function for each type of matrix - * data structure. - * The initialization function sets the values of the internal structure fields. - * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() - * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. - * - * \par - * Use of the initialization function is optional. However, if initialization function is used - * then the instance structure cannot be placed into a const data section. - * To place the instance structure in a const data - * section, manually initialize the data structure. For example: - *
- * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
- * 
- * where nRows specifies the number of rows, nColumns - * specifies the number of columns, and pData points to the - * data array. - * - * \par Size Checking - * By default all of the matrix functions perform size checking on the input and - * output matrices. For example, the matrix addition function verifies that the - * two input matrices and the output matrix all have the same number of rows and - * columns. If the size check fails the functions return: - *
- *     ARM_MATH_SIZE_MISMATCH
- * 
- * Otherwise the functions return - *
- *     ARM_MATH_SUCCESS
- * 
- * There is some overhead associated with this matrix size checking. - * The matrix size checking is enabled via the \#define - *
- *     ARM_MATH_MATRIX_CHECK
- * 
- * within the library project settings. By default this macro is defined - * and size checking is enabled. By changing the project settings and - * undefining this macro size checking is eliminated and the functions - * run a bit faster. With size checking disabled the functions always - * return ARM_MATH_SUCCESS. - */ - -/** - * @defgroup groupTransforms Transform Functions - */ - -/** - * @defgroup groupController Controller Functions - */ - -/** - * @defgroup groupStats Statistics Functions - */ -/** - * @defgroup groupSupport Support Functions - */ - -/** - * @defgroup groupInterpolation Interpolation Functions - * These functions perform 1- and 2-dimensional interpolation of data. - * Linear interpolation is used for 1-dimensional data and - * bilinear interpolation is used for 2-dimensional data. - */ - -/** - * @defgroup groupExamples Examples - */ -#ifndef _ARM_MATH_H -#define _ARM_MATH_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ - -#if defined(ARM_MATH_CM7) - #include "core_cm7.h" -#elif defined (ARM_MATH_CM4) - #include "core_cm4.h" -#elif defined (ARM_MATH_CM3) - #include "core_cm3.h" -#elif defined (ARM_MATH_CM0) - #include "core_cm0.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_CM0PLUS) - #include "core_cm0plus.h" - #define ARM_MATH_CM0_FAMILY -#else - #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" -#endif - -#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ -#include "string.h" -#include "math.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - - /** - * @brief Macros required for reciprocal calculation in Normalized LMS - */ - -#define DELTA_Q31 (0x100) -#define DELTA_Q15 0x5 -#define INDEX_MASK 0x0000003F -#ifndef PI -#define PI 3.14159265358979f -#endif - - /** - * @brief Macros required for SINE and COSINE Fast math approximations - */ - -#define FAST_MATH_TABLE_SIZE 512 -#define FAST_MATH_Q31_SHIFT (32 - 10) -#define FAST_MATH_Q15_SHIFT (16 - 10) -#define CONTROLLER_Q31_SHIFT (32 - 9) -#define TABLE_SIZE 256 -#define TABLE_SPACING_Q31 0x400000 -#define TABLE_SPACING_Q15 0x80 - - /** - * @brief Macros required for SINE and COSINE Controller functions - */ - /* 1.31(q31) Fixed value of 2/360 */ - /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ -#define INPUT_SPACING 0xB60B61 - - /** - * @brief Macro for Unaligned Support - */ -#ifndef UNALIGNED_SUPPORT_DISABLE - #define ALIGN4 -#else - #if defined (__GNUC__) - #define ALIGN4 __attribute__((aligned(4))) - #else - #define ALIGN4 __align(4) - #endif -#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ - - /** - * @brief Error status returned by some functions in the library. - */ - - typedef enum - { - ARM_MATH_SUCCESS = 0, /**< No error */ - ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ - ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ - ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ - ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ - ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ - ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ - } arm_status; - - /** - * @brief 8-bit fractional data type in 1.7 format. - */ - typedef int8_t q7_t; - - /** - * @brief 16-bit fractional data type in 1.15 format. - */ - typedef int16_t q15_t; - - /** - * @brief 32-bit fractional data type in 1.31 format. - */ - typedef int32_t q31_t; - - /** - * @brief 64-bit fractional data type in 1.63 format. - */ - typedef int64_t q63_t; - - /** - * @brief 32-bit floating-point type definition. - */ - typedef float float32_t; - - /** - * @brief 64-bit floating-point type definition. - */ - typedef double float64_t; - - /** - * @brief definition to read/write two 16 bit values. - */ -#if defined __CC_ARM - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __GNUC__ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __ICCARM__ - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED - -#elif defined __CSMC__ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED - -#elif defined __TASKING__ - #define __SIMD32_TYPE __unaligned int32_t - #define CMSIS_UNUSED - -#else - #error Unknown compiler -#endif - -#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) -#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) -#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) -#define __SIMD64(addr) (*(int64_t **) & (addr)) - -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - /** - * @brief definition to pack two 16 bit values. - */ -#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ - (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) -#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ - (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) - -#endif - - - /** - * @brief definition to pack four 8 bit values. - */ -#ifndef ARM_MATH_BIG_ENDIAN - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) -#else - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) - -#endif - - - /** - * @brief Clips Q63 to Q31 values. - */ - static __INLINE q31_t clip_q63_to_q31( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; - } - - /** - * @brief Clips Q63 to Q15 values. - */ - static __INLINE q15_t clip_q63_to_q15( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); - } - - /** - * @brief Clips Q31 to Q7 values. - */ - static __INLINE q7_t clip_q31_to_q7( - q31_t x) - { - return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? - ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; - } - - /** - * @brief Clips Q31 to Q15 values. - */ - static __INLINE q15_t clip_q31_to_q15( - q31_t x) - { - return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? - ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; - } - - /** - * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. - */ - - static __INLINE q63_t mult32x64( - q63_t x, - q31_t y) - { - return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + - (((q63_t) (x >> 32) * y))); - } - -/* - #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) - #define __CLZ __clz - #endif - */ -/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ -#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) - static __INLINE uint32_t __CLZ( - q31_t data); - - static __INLINE uint32_t __CLZ( - q31_t data) - { - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); - } -#endif - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. - */ - - static __INLINE uint32_t arm_recip_q31( - q31_t in, - q31_t * dst, - q31_t * pRecipTable) - { - q31_t out; - uint32_t tempVal; - uint32_t index, i; - uint32_t signBits; - - if(in > 0) - { - signBits = ((uint32_t) (__CLZ( in) - 1)); - } - else - { - signBits = ((uint32_t) (__CLZ(-in) - 1)); - } - - /* Convert input sample to 1.31 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 24); - index = (index & INDEX_MASK); - - /* 1.31 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t) (((q63_t) in * out) >> 31); - tempVal = 0x7FFFFFFFu - tempVal; - /* 1.31 with exp 1 */ - /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ - out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1u); - } - - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. - */ - static __INLINE uint32_t arm_recip_q15( - q15_t in, - q15_t * dst, - q15_t * pRecipTable) - { - q15_t out = 0; - uint32_t tempVal = 0; - uint32_t index = 0, i = 0; - uint32_t signBits = 0; - - if(in > 0) - { - signBits = ((uint32_t)(__CLZ( in) - 17)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 17)); - } - - /* Convert input sample to 1.15 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 8); - index = (index & INDEX_MASK); - - /* 1.15 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t) (((q31_t) in * out) >> 15); - tempVal = 0x7FFFu - tempVal; - /* 1.15 with exp 1 */ - out = (q15_t) (((q31_t) out * tempVal) >> 14); - /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1); - } - - - /* - * @brief C custom defined intrinisic function for only M0 processors - */ -#if defined(ARM_MATH_CM0_FAMILY) - static __INLINE q31_t __SSAT( - q31_t x, - uint32_t y) - { - int32_t posMax, negMin; - uint32_t i; - - posMax = 1; - for (i = 0; i < (y - 1); i++) - { - posMax = posMax * 2; - } - - if(x > 0) - { - posMax = (posMax - 1); - - if(x > posMax) - { - x = posMax; - } - } - else - { - negMin = -posMax; - - if(x < negMin) - { - x = negMin; - } - } - return (x); - } -#endif /* end of ARM_MATH_CM0_FAMILY */ - - - /* - * @brief C custom defined intrinsic function for M3 and M0 processors - */ -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - - /* - * @brief C custom defined QADD8 for M3 and M0 processors - */ - static __INLINE uint32_t __QADD8( - uint32_t x, - uint32_t y) - { - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); - } - - - /* - * @brief C custom defined QSUB8 for M3 and M0 processors - */ - static __INLINE uint32_t __QSUB8( - uint32_t x, - uint32_t y) - { - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); - } - - - /* - * @brief C custom defined QADD16 for M3 and M0 processors - */ - static __INLINE uint32_t __QADD16( - uint32_t x, - uint32_t y) - { -/* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ - q31_t r = 0, s = 0; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHADD16 for M3 and M0 processors - */ - static __INLINE uint32_t __SHADD16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QSUB16 for M3 and M0 processors - */ - static __INLINE uint32_t __QSUB16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHSUB16 for M3 and M0 processors - */ - static __INLINE uint32_t __SHSUB16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QASX for M3 and M0 processors - */ - static __INLINE uint32_t __QASX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHASX for M3 and M0 processors - */ - static __INLINE uint32_t __SHASX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QSAX for M3 and M0 processors - */ - static __INLINE uint32_t __QSAX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHSAX for M3 and M0 processors - */ - static __INLINE uint32_t __SHSAX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SMUSDX for M3 and M0 processors - */ - static __INLINE uint32_t __SMUSDX( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); - } - - /* - * @brief C custom defined SMUADX for M3 and M0 processors - */ - static __INLINE uint32_t __SMUADX( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); - } - - - /* - * @brief C custom defined QADD for M3 and M0 processors - */ - static __INLINE int32_t __QADD( - int32_t x, - int32_t y) - { - return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); - } - - - /* - * @brief C custom defined QSUB for M3 and M0 processors - */ - static __INLINE int32_t __QSUB( - int32_t x, - int32_t y) - { - return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); - } - - - /* - * @brief C custom defined SMLAD for M3 and M0 processors - */ - static __INLINE uint32_t __SMLAD( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLADX for M3 and M0 processors - */ - static __INLINE uint32_t __SMLADX( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLSDX for M3 and M0 processors - */ - static __INLINE uint32_t __SMLSDX( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLALD for M3 and M0 processors - */ - static __INLINE uint64_t __SMLALD( - uint32_t x, - uint32_t y, - uint64_t sum) - { -/* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + - ( ((q63_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLALDX for M3 and M0 processors - */ - static __INLINE uint64_t __SMLALDX( - uint32_t x, - uint32_t y, - uint64_t sum) - { -/* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q63_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMUAD for M3 and M0 processors - */ - static __INLINE uint32_t __SMUAD( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); - } - - - /* - * @brief C custom defined SMUSD for M3 and M0 processors - */ - static __INLINE uint32_t __SMUSD( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); - } - - - /* - * @brief C custom defined SXTB16 for M3 and M0 processors - */ - static __INLINE uint32_t __SXTB16( - uint32_t x) - { - return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | - ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) )); - } - -#endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ - - - /** - * @brief Instance structure for the Q7 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q7; - - /** - * @brief Instance structure for the Q15 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_f32; - - - /** - * @brief Processing function for the Q7 FIR filter. - * @param[in] S points to an instance of the Q7 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q7( - const arm_fir_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q7 FIR filter. - * @param[in,out] S points to an instance of the Q7 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed. - */ - void arm_fir_init_q7( - arm_fir_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR filter. - * @param[in] S points to an instance of the Q15 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_fast_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR filter. - * @param[in,out] S points to an instance of the Q15 FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if - * numTaps is not a supported value. - */ - arm_status arm_fir_init_q15( - arm_fir_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR filter. - * @param[in] S points to an instance of the Q31 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_fast_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR filter. - * @param[in,out] S points to an instance of the Q31 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ - void arm_fir_init_q31( - arm_fir_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point FIR filter. - * @param[in] S points to an instance of the floating-point FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_f32( - const arm_fir_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR filter. - * @param[in,out] S points to an instance of the floating-point FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ - void arm_fir_init_f32( - arm_fir_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 Biquad cascade filter. - */ - typedef struct - { - int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - } arm_biquad_casd_df1_inst_q15; - - /** - * @brief Instance structure for the Q31 Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - } arm_biquad_casd_df1_inst_q31; - - /** - * @brief Instance structure for the floating-point Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_casd_df1_inst_f32; - - - /** - * @brief Processing function for the Q15 Biquad cascade filter. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cascade_df1_init_q15( - arm_biquad_casd_df1_inst_q15 * S, - uint8_t numStages, - q15_t * pCoeffs, - q15_t * pState, - int8_t postShift); - - - /** - * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_fast_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 Biquad cascade filter - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_fast_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cascade_df1_init_q31( - arm_biquad_casd_df1_inst_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q31_t * pState, - int8_t postShift); - - - /** - * @brief Processing function for the floating-point Biquad cascade filter. - * @param[in] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_f32( - const arm_biquad_casd_df1_inst_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point Biquad cascade filter. - * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df1_init_f32( - arm_biquad_casd_df1_inst_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float32_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f32; - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float64_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f64; - - /** - * @brief Instance structure for the Q15 matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q15_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_q15; - - /** - * @brief Instance structure for the Q31 matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q31_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_q31; - - - /** - * @brief Floating-point matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pScratch); - - - /** - * @brief Q31, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_f32( - const arm_matrix_instance_f32 * pSrc, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_q15( - const arm_matrix_instance_q15 * pSrc, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_q31( - const arm_matrix_instance_q31 * pSrc, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - - /** - * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_fast_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - - /** - * @brief Q31 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_fast_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix scaling. - * @param[in] pSrc points to the input matrix - * @param[in] scale scale factor - * @param[out] pDst points to the output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_f32( - const arm_matrix_instance_f32 * pSrc, - float32_t scale, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_q15( - const arm_matrix_instance_q15 * pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_q31( - const arm_matrix_instance_q31 * pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Q31 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_q31( - arm_matrix_instance_q31 * S, - uint16_t nRows, - uint16_t nColumns, - q31_t * pData); - - - /** - * @brief Q15 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_q15( - arm_matrix_instance_q15 * S, - uint16_t nRows, - uint16_t nColumns, - q15_t * pData); - - - /** - * @brief Floating-point matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_f32( - arm_matrix_instance_f32 * S, - uint16_t nRows, - uint16_t nColumns, - float32_t * pData); - - - - /** - * @brief Instance structure for the Q15 PID Control. - */ - typedef struct - { - q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ -#ifdef ARM_MATH_CM0_FAMILY - q15_t A1; - q15_t A2; -#else - q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ -#endif - q15_t state[3]; /**< The state array of length 3. */ - q15_t Kp; /**< The proportional gain. */ - q15_t Ki; /**< The integral gain. */ - q15_t Kd; /**< The derivative gain. */ - } arm_pid_instance_q15; - - /** - * @brief Instance structure for the Q31 PID Control. - */ - typedef struct - { - q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - q31_t A2; /**< The derived gain, A2 = Kd . */ - q31_t state[3]; /**< The state array of length 3. */ - q31_t Kp; /**< The proportional gain. */ - q31_t Ki; /**< The integral gain. */ - q31_t Kd; /**< The derivative gain. */ - } arm_pid_instance_q31; - - /** - * @brief Instance structure for the floating-point PID Control. - */ - typedef struct - { - float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - float32_t A2; /**< The derived gain, A2 = Kd . */ - float32_t state[3]; /**< The state array of length 3. */ - float32_t Kp; /**< The proportional gain. */ - float32_t Ki; /**< The integral gain. */ - float32_t Kd; /**< The derivative gain. */ - } arm_pid_instance_f32; - - - - /** - * @brief Initialization function for the floating-point PID Control. - * @param[in,out] S points to an instance of the PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_f32( - arm_pid_instance_f32 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - */ - void arm_pid_reset_f32( - arm_pid_instance_f32 * S); - - - /** - * @brief Initialization function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_q31( - arm_pid_instance_q31 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - */ - - void arm_pid_reset_q31( - arm_pid_instance_q31 * S); - - - /** - * @brief Initialization function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_q15( - arm_pid_instance_q15 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the Q15 PID Control. - * @param[in,out] S points to an instance of the q15 PID Control structure - */ - void arm_pid_reset_q15( - arm_pid_instance_q15 * S); - - - /** - * @brief Instance structure for the floating-point Linear Interpolate function. - */ - typedef struct - { - uint32_t nValues; /**< nValues */ - float32_t x1; /**< x1 */ - float32_t xSpacing; /**< xSpacing */ - float32_t *pYData; /**< pointer to the table of Y values */ - } arm_linear_interp_instance_f32; - - /** - * @brief Instance structure for the floating-point bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - float32_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_f32; - - /** - * @brief Instance structure for the Q31 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q31_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q31; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q15_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q15; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q7_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q7; - - - /** - * @brief Q7 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q15( - arm_cfft_radix2_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q15( - const arm_cfft_radix2_instance_q15 * S, - q15_t * pSrc); - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q15( - arm_cfft_radix4_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_q15( - const arm_cfft_radix4_instance_q15 * S, - q15_t * pSrc); - - /** - * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q31; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q31( - arm_cfft_radix2_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q31( - const arm_cfft_radix2_instance_q31 * S, - q31_t * pSrc); - - /** - * @brief Instance structure for the Q31 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q31; - -/* Deprecated */ - void arm_cfft_radix4_q31( - const arm_cfft_radix4_instance_q31 * S, - q31_t * pSrc); - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q31( - arm_cfft_radix4_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix2_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_f32( - arm_cfft_radix2_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_f32( - const arm_cfft_radix2_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix4_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_f32( - arm_cfft_radix4_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_f32( - const arm_cfft_radix4_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q15; - -void arm_cfft_q15( - const arm_cfft_instance_q15 * S, - q15_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q31; - -void arm_cfft_q31( - const arm_cfft_instance_q31 * S, - q31_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_f32; - - void arm_cfft_f32( - const arm_cfft_instance_f32 * S, - float32_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the Q15 RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q15; - - arm_status arm_rfft_init_q15( - arm_rfft_instance_q15 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q15( - const arm_rfft_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst); - - /** - * @brief Instance structure for the Q31 RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q31; - - arm_status arm_rfft_init_q31( - arm_rfft_instance_q31 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q31( - const arm_rfft_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint16_t fftLenBy2; /**< length of the complex FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_f32; - - arm_status arm_rfft_init_f32( - arm_rfft_instance_f32 * S, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_f32( - const arm_rfft_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct - { - arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ - uint16_t fftLenRFFT; /**< length of the real sequence */ - float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ - } arm_rfft_fast_instance_f32 ; - -arm_status arm_rfft_fast_init_f32 ( - arm_rfft_fast_instance_f32 * S, - uint16_t fftLen); - -void arm_rfft_fast_f32( - arm_rfft_fast_instance_f32 * S, - float32_t * p, float32_t * pOut, - uint8_t ifftFlag); - - /** - * @brief Instance structure for the floating-point DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - float32_t normalize; /**< normalizing factor. */ - float32_t *pTwiddle; /**< points to the twiddle factor table. */ - float32_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_f32; - - - /** - * @brief Initialization function for the floating-point DCT4/IDCT4. - * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. - */ - arm_status arm_dct4_init_f32( - arm_dct4_instance_f32 * S, - arm_rfft_instance_f32 * S_RFFT, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint16_t N, - uint16_t Nby2, - float32_t normalize); - - - /** - * @brief Processing function for the floating-point DCT4/IDCT4. - * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_f32( - const arm_dct4_instance_f32 * S, - float32_t * pState, - float32_t * pInlineBuffer); - - - /** - * @brief Instance structure for the Q31 DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q31_t normalize; /**< normalizing factor. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - q31_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q31; - - - /** - * @brief Initialization function for the Q31 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure - * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - arm_status arm_dct4_init_q31( - arm_dct4_instance_q31 * S, - arm_rfft_instance_q31 * S_RFFT, - arm_cfft_radix4_instance_q31 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize); - - - /** - * @brief Processing function for the Q31 DCT4/IDCT4. - * @param[in] S points to an instance of the Q31 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_q31( - const arm_dct4_instance_q31 * S, - q31_t * pState, - q31_t * pInlineBuffer); - - - /** - * @brief Instance structure for the Q15 DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q15_t normalize; /**< normalizing factor. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - q15_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q15; - - - /** - * @brief Initialization function for the Q15 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - arm_status arm_dct4_init_q15( - arm_dct4_instance_q15 * S, - arm_rfft_instance_q15 * S_RFFT, - arm_cfft_radix4_instance_q15 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize); - - - /** - * @brief Processing function for the Q15 DCT4/IDCT4. - * @param[in] S points to an instance of the Q15 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_q15( - const arm_dct4_instance_q15 * S, - q15_t * pState, - q15_t * pInlineBuffer); - - - /** - * @brief Floating-point vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a floating-point vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scale scale factor to be applied - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_f32( - float32_t * pSrc, - float32_t scale, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q7 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q7( - q7_t * pSrc, - q7_t scaleFract, - int8_t shift, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q15 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q15( - q15_t * pSrc, - q15_t scaleFract, - int8_t shift, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q31 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q31( - q31_t * pSrc, - q31_t scaleFract, - int8_t shift, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Dot product of floating-point vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t blockSize, - float32_t * result); - - - /** - * @brief Dot product of Q7 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q7( - q7_t * pSrcA, - q7_t * pSrcB, - uint32_t blockSize, - q31_t * result); - - - /** - * @brief Dot product of Q15 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - - /** - * @brief Dot product of Q31 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - - /** - * @brief Shifts the elements of a Q7 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q7( - q7_t * pSrc, - int8_t shiftBits, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Shifts the elements of a Q15 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q15( - q15_t * pSrc, - int8_t shiftBits, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Shifts the elements of a Q31 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q31( - q31_t * pSrc, - int8_t shiftBits, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_f32( - float32_t * pSrc, - float32_t offset, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q7( - q7_t * pSrc, - q7_t offset, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q15( - q15_t * pSrc, - q15_t offset, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q31( - q31_t * pSrc, - q31_t offset, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a floating-point vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q7 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a floating-point vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_f32( - float32_t value, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q7 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q7( - q7_t value, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q15 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q15( - q15_t value, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q31 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q31( - q31_t value, - q31_t * pDst, - uint32_t blockSize); - - -/** - * @brief Convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ - void arm_conv_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ - void arm_conv_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ - void arm_conv_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ - void arm_conv_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ - void arm_conv_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Partial convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Partial convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q7 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Partial convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Instance structure for the Q15 FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - } arm_fir_decimate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - } arm_fir_decimate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - } arm_fir_decimate_instance_f32; - - - /** - * @brief Processing function for the floating-point FIR decimator. - * @param[in] S points to an instance of the floating-point FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_f32( - const arm_fir_decimate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR decimator. - * @param[in,out] S points to an instance of the floating-point FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_f32( - arm_fir_decimate_instance_f32 * S, - uint16_t numTaps, - uint8_t M, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR decimator. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_fast_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR decimator. - * @param[in,out] S points to an instance of the Q15 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_q15( - arm_fir_decimate_instance_q15 * S, - uint16_t numTaps, - uint8_t M, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR decimator. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_q31( - const arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_fast_q31( - arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR decimator. - * @param[in,out] S points to an instance of the Q31 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_q31( - arm_fir_decimate_instance_q31 * S, - uint16_t numTaps, - uint8_t M, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ - } arm_fir_interpolate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ - } arm_fir_interpolate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ - } arm_fir_interpolate_instance_f32; - - - /** - * @brief Processing function for the Q15 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_q15( - const arm_fir_interpolate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR interpolator. - * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_q15( - arm_fir_interpolate_instance_q15 * S, - uint8_t L, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_q31( - const arm_fir_interpolate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR interpolator. - * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_q31( - arm_fir_interpolate_instance_q31 * S, - uint8_t L, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point FIR interpolator. - * @param[in] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_f32( - const arm_fir_interpolate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR interpolator. - * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_f32( - arm_fir_interpolate_instance_f32 * S, - uint8_t L, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the high precision Q31 Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ - } arm_biquad_cas_df1_32x64_ins_q31; - - - /** - * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cas_df1_32x64_q31( - const arm_biquad_cas_df1_32x64_ins_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cas_df1_32x64_init_q31( - arm_biquad_cas_df1_32x64_ins_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q63_t * pState, - uint8_t postShift); - - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f32; - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_stereo_df2T_instance_f32; - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f64; - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df2T_f32( - const arm_biquad_cascade_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_stereo_df2T_f32( - const arm_biquad_cascade_stereo_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df2T_f64( - const arm_biquad_cascade_df2T_instance_f64 * S, - float64_t * pSrc, - float64_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df2T_init_f32( - arm_biquad_cascade_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_stereo_df2T_init_f32( - arm_biquad_cascade_stereo_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df2T_init_f64( - arm_biquad_cascade_df2T_instance_f64 * S, - uint8_t numStages, - float64_t * pCoeffs, - float64_t * pState); - - - /** - * @brief Instance structure for the Q15 FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_f32; - - - /** - * @brief Initialization function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_q15( - arm_fir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pCoeffs, - q15_t * pState); - - - /** - * @brief Processing function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_q15( - const arm_fir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_q31( - arm_fir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pCoeffs, - q31_t * pState); - - - /** - * @brief Processing function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_q31( - const arm_fir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_f32( - arm_fir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Processing function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_f32( - const arm_fir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_f32; - - - /** - * @brief Processing function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_f32( - const arm_iir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_init_f32( - arm_iir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pkCoeffs, - float32_t * pvCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_q31( - const arm_iir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_init_q31( - arm_iir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pkCoeffs, - q31_t * pvCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the Q15 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_q15( - const arm_iir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process per call. - */ - void arm_iir_lattice_init_q15( - arm_iir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pkCoeffs, - q15_t * pvCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the floating-point LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that controls filter coefficient updates. */ - } arm_lms_instance_f32; - - - /** - * @brief Processing function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_f32( - const arm_lms_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_init_f32( - arm_lms_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - } arm_lms_instance_q15; - - - /** - * @brief Initialization function for the Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_init_q15( - arm_lms_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint32_t postShift); - - - /** - * @brief Processing function for Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_q15( - const arm_lms_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - } arm_lms_instance_q31; - - - /** - * @brief Processing function for Q31 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_q31( - const arm_lms_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q31 LMS filter. - * @param[in] S points to an instance of the Q31 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_init_q31( - arm_lms_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint32_t postShift); - - - /** - * @brief Instance structure for the floating-point normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that control filter coefficient updates. */ - float32_t energy; /**< saves previous frame energy. */ - float32_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_f32; - - - /** - * @brief Processing function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_f32( - arm_lms_norm_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_init_f32( - arm_lms_norm_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q31_t *recipTable; /**< points to the reciprocal initial value table. */ - q31_t energy; /**< saves previous frame energy. */ - q31_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q31; - - - /** - * @brief Processing function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_q31( - arm_lms_norm_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_norm_init_q31( - arm_lms_norm_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint8_t postShift); - - - /** - * @brief Instance structure for the Q15 normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< Number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q15_t *recipTable; /**< Points to the reciprocal initial value table. */ - q15_t energy; /**< saves previous frame energy. */ - q15_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q15; - - - /** - * @brief Processing function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_q15( - arm_lms_norm_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_norm_init_q15( - arm_lms_norm_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint8_t postShift); - - - /** - * @brief Correlation of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Correlation of Q15 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ - void arm_correlate_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - - /** - * @brief Correlation of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - - void arm_correlate_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - - void arm_correlate_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ - void arm_correlate_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - - /** - * @brief Correlation of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ - void arm_correlate_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Instance structure for the floating-point sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_f32; - - /** - * @brief Instance structure for the Q31 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q31; - - /** - * @brief Instance structure for the Q15 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q15; - - /** - * @brief Instance structure for the Q7 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q7; - - - /** - * @brief Processing function for the floating-point sparse FIR filter. - * @param[in] S points to an instance of the floating-point sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_f32( - arm_fir_sparse_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - float32_t * pScratchIn, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point sparse FIR filter. - * @param[in,out] S points to an instance of the floating-point sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_f32( - arm_fir_sparse_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 sparse FIR filter. - * @param[in] S points to an instance of the Q31 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q31( - arm_fir_sparse_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - q31_t * pScratchIn, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 sparse FIR filter. - * @param[in,out] S points to an instance of the Q31 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q31( - arm_fir_sparse_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 sparse FIR filter. - * @param[in] S points to an instance of the Q15 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q15( - arm_fir_sparse_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - q15_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 sparse FIR filter. - * @param[in,out] S points to an instance of the Q15 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q15( - arm_fir_sparse_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q7 sparse FIR filter. - * @param[in] S points to an instance of the Q7 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q7( - arm_fir_sparse_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - q7_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q7 sparse FIR filter. - * @param[in,out] S points to an instance of the Q7 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q7( - arm_fir_sparse_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Floating-point sin_cos function. - * @param[in] theta input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cos output. - */ - void arm_sin_cos_f32( - float32_t theta, - float32_t * pSinVal, - float32_t * pCosVal); - - - /** - * @brief Q31 sin_cos function. - * @param[in] theta scaled input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cosine output. - */ - void arm_sin_cos_q31( - q31_t theta, - q31_t * pSinVal, - q31_t * pCosVal); - - - /** - * @brief Floating-point complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - /** - * @brief Q31 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup PID PID Motor Control - * - * A Proportional Integral Derivative (PID) controller is a generic feedback control - * loop mechanism widely used in industrial control systems. - * A PID controller is the most commonly used type of feedback controller. - * - * This set of functions implements (PID) controllers - * for Q15, Q31, and floating-point data types. The functions operate on a single sample - * of data and each call to the function returns a single processed value. - * S points to an instance of the PID control data structure. in - * is the input sample value. The functions return the output value. - * - * \par Algorithm: - *
-   *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
-   *    A0 = Kp + Ki + Kd
-   *    A1 = (-Kp ) - (2 * Kd )
-   *    A2 = Kd  
- * - * \par - * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant - * - * \par - * \image html PID.gif "Proportional Integral Derivative Controller" - * - * \par - * The PID controller calculates an "error" value as the difference between - * the measured output and the reference input. - * The controller attempts to minimize the error by adjusting the process control inputs. - * The proportional value determines the reaction to the current error, - * the integral value determines the reaction based on the sum of recent errors, - * and the derivative value determines the reaction based on the rate at which the error has been changing. - * - * \par Instance Structure - * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. - * A separate instance structure must be defined for each PID Controller. - * There are separate instance structure declarations for each of the 3 supported data types. - * - * \par Reset Functions - * There is also an associated reset function for each data type which clears the state array. - * - * \par Initialization Functions - * There is also an associated initialization function for each data type. - * The initialization function performs the following operations: - * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. - * - Zeros out the values in the state buffer. - * - * \par - * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. - * - * \par Fixed-Point Behavior - * Care must be taken when using the fixed-point versions of the PID Controller functions. - * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup PID - * @{ - */ - - /** - * @brief Process function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - */ - static __INLINE float32_t arm_pid_f32( - arm_pid_instance_f32 * S, - float32_t in) - { - float32_t out; - - /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ - out = (S->A0 * in) + - (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - - } - - /** - * @brief Process function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 64-bit accumulator. - * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. - * Thus, if the accumulator result overflows it wraps around rather than clip. - * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. - * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. - */ - static __INLINE q31_t arm_pid_q31( - arm_pid_instance_q31 * S, - q31_t in) - { - q63_t acc; - q31_t out; - - /* acc = A0 * x[n] */ - acc = (q63_t) S->A0 * in; - - /* acc += A1 * x[n-1] */ - acc += (q63_t) S->A1 * S->state[0]; - - /* acc += A2 * x[n-2] */ - acc += (q63_t) S->A2 * S->state[1]; - - /* convert output to 1.31 format to add y[n-1] */ - out = (q31_t) (acc >> 31u); - - /* out += y[n-1] */ - out += S->state[2]; - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - } - - - /** - * @brief Process function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using a 64-bit internal accumulator. - * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. - * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. - * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. - * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. - * Lastly, the accumulator is saturated to yield a result in 1.15 format. - */ - static __INLINE q15_t arm_pid_q15( - arm_pid_instance_q15 * S, - q15_t in) - { - q63_t acc; - q15_t out; - -#ifndef ARM_MATH_CM0_FAMILY - __SIMD32_TYPE *vstate; - - /* Implementation of PID controller */ - - /* acc = A0 * x[n] */ - acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - vstate = __SIMD32_CONST(S->state); - acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc); -#else - /* acc = A0 * x[n] */ - acc = ((q31_t) S->A0) * in; - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - acc += (q31_t) S->A1 * S->state[0]; - acc += (q31_t) S->A2 * S->state[1]; -#endif - - /* acc += y[n-1] */ - acc += (q31_t) S->state[2] << 15; - - /* saturate the output */ - out = (q15_t) (__SSAT((acc >> 15), 16)); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - } - - /** - * @} end of PID group - */ - - - /** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 * src, - arm_matrix_instance_f32 * dst); - - - /** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - arm_status arm_mat_inverse_f64( - const arm_matrix_instance_f64 * src, - arm_matrix_instance_f64 * dst); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup clarke Vector Clarke Transform - * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. - * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents - * in the two-phase orthogonal stator axis Ialpha and Ibeta. - * When Ialpha is superposed with Ia as shown in the figure below - * \image html clarke.gif Stator current space vector and its components in (a,b). - * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta - * can be calculated using only Ia and Ib. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeFormula.gif - * where Ia and Ib are the instantaneous stator phases and - * pIalpha and pIbeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup clarke - * @{ - */ - - /** - * - * @brief Floating-point Clarke transform - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - */ - static __INLINE void arm_clarke_f32( - float32_t Ia, - float32_t Ib, - float32_t * pIalpha, - float32_t * pIbeta) - { - /* Calculate pIalpha using the equation, pIalpha = Ia */ - *pIalpha = Ia; - - /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ - *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); - } - - - /** - * @brief Clarke transform for Q31 version - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - static __INLINE void arm_clarke_q31( - q31_t Ia, - q31_t Ib, - q31_t * pIalpha, - q31_t * pIbeta) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIalpha from Ia by equation pIalpha = Ia */ - *pIalpha = Ia; - - /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); - - /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ - product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); - - /* pIbeta is calculated by adding the intermediate products */ - *pIbeta = __QADD(product1, product2); - } - - /** - * @} end of clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_q7_to_q31( - q7_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_clarke Vector Inverse Clarke Transform - * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeInvFormula.gif - * where pIa and pIb are the instantaneous stator phases and - * Ialpha and Ibeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_clarke - * @{ - */ - - /** - * @brief Floating-point Inverse Clarke transform - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - */ - static __INLINE void arm_inv_clarke_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pIa, - float32_t * pIb) - { - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ - *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; - } - - - /** - * @brief Inverse Clarke transform for Q31 version - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the subtraction, hence there is no risk of overflow. - */ - static __INLINE void arm_inv_clarke_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pIa, - q31_t * pIb) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); - - /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); - - /* pIb is calculated by subtracting the products */ - *pIb = __QSUB(product2, product1); - } - - /** - * @} end of inv_clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_q7_to_q15( - q7_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup park Vector Park Transform - * - * Forward Park transform converts the input two-coordinate vector to flux and torque components. - * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents - * from the stationary to the moving reference frame and control the spatial relationship between - * the stator vector current and rotor flux vector. - * If we consider the d axis aligned with the rotor flux, the diagram below shows the - * current vector and the relationship from the two reference frames: - * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkFormula.gif - * where Ialpha and Ibeta are the stator vector components, - * pId and pIq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup park - * @{ - */ - - /** - * @brief Floating-point Park transform - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * The function implements the forward Park transform. - * - */ - static __INLINE void arm_park_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pId, - float32_t * pIq, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ - *pId = Ialpha * cosVal + Ibeta * sinVal; - - /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ - *pIq = -Ialpha * sinVal + Ibeta * cosVal; - } - - - /** - * @brief Park transform for Q31 version - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition and subtraction, hence there is no risk of overflow. - */ - static __INLINE void arm_park_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pId, - q31_t * pIq, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Ialpha * cosVal) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * sinVal) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Ialpha * sinVal) */ - product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * cosVal) */ - product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); - - /* Calculate pId by adding the two intermediate products 1 and 2 */ - *pId = __QADD(product1, product2); - - /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ - *pIq = __QSUB(product4, product3); - } - - /** - * @} end of park group - */ - - /** - * @brief Converts the elements of the Q7 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q7_to_float( - q7_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_park Vector Inverse Park transform - * Inverse Park transform converts the input flux and torque components to two-coordinate vector. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkInvFormula.gif - * where pIalpha and pIbeta are the stator vector components, - * Id and Iq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_park - * @{ - */ - - /** - * @brief Floating-point Inverse Park transform - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - */ - static __INLINE void arm_inv_park_f32( - float32_t Id, - float32_t Iq, - float32_t * pIalpha, - float32_t * pIbeta, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ - *pIalpha = Id * cosVal - Iq * sinVal; - - /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ - *pIbeta = Id * sinVal + Iq * cosVal; - } - - - /** - * @brief Inverse Park transform for Q31 version - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - static __INLINE void arm_inv_park_q31( - q31_t Id, - q31_t Iq, - q31_t * pIalpha, - q31_t * pIbeta, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Id * cosVal) */ - product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Iq * sinVal) */ - product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Id * sinVal) */ - product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Iq * cosVal) */ - product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); - - /* Calculate pIalpha by using the two intermediate products 1 and 2 */ - *pIalpha = __QSUB(product1, product2); - - /* Calculate pIbeta by using the two intermediate products 3 and 4 */ - *pIbeta = __QADD(product4, product3); - } - - /** - * @} end of Inverse park group - */ - - - /** - * @brief Converts the elements of the Q31 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_float( - q31_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
-   *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
-   *       where x0, x1 are nearest values of input x
-   *             y0, y1 are nearest values to output y
-   * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ - - /** - * @addtogroup LinearInterpolate - * @{ - */ - - /** - * @brief Process function for the floating-point Linear Interpolation Function. - * @param[in,out] S is an instance of the floating-point Linear Interpolation structure - * @param[in] x input sample to process - * @return y processed output sample. - * - */ - static __INLINE float32_t arm_linear_interp_f32( - arm_linear_interp_instance_f32 * S, - float32_t x) - { - float32_t y; - float32_t x0, x1; /* Nearest input values */ - float32_t y0, y1; /* Nearest output values */ - float32_t xSpacing = S->xSpacing; /* spacing between input values */ - int32_t i; /* Index variable */ - float32_t *pYData = S->pYData; /* pointer to output table */ - - /* Calculation of index */ - i = (int32_t) ((x - S->x1) / xSpacing); - - if(i < 0) - { - /* Iniatilize output for below specified range as least output value of table */ - y = pYData[0]; - } - else if((uint32_t)i >= S->nValues) - { - /* Iniatilize output for above specified range as last output value of table */ - y = pYData[S->nValues - 1]; - } - else - { - /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; - - /* Read of nearest output values */ - y0 = pYData[i]; - y1 = pYData[i + 1]; - - /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); - - } - - /* returns output value */ - return (y); - } - - - /** - * - * @brief Process function for the Q31 Linear Interpolation Function. - * @param[in] pYData pointer to Q31 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - static __INLINE q31_t arm_linear_interp_q31( - q31_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q31_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (q31_t)0xFFF00000) >> 20); - - if(index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if(index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* shift left by 11 to keep fract in 1.31 format */ - fract = (x & 0x000FFFFF) << 11; - - /* Read two nearest output values from the index in 1.31(q31) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 2.30 format */ - y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); - - /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ - y += ((q31_t) (((q63_t) y1 * fract) >> 32)); - - /* Convert y to 1.31 format */ - return (y << 1u); - } - } - - - /** - * - * @brief Process function for the Q15 Linear Interpolation Function. - * @param[in] pYData pointer to Q15 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - static __INLINE q15_t arm_linear_interp_q15( - q15_t * pYData, - q31_t x, - uint32_t nValues) - { - q63_t y; /* output */ - q15_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (int32_t)0xFFF00000) >> 20); - - if(index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if(index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 13.35 format */ - y = ((q63_t) y0 * (0xFFFFF - fract)); - - /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ - y += ((q63_t) y1 * (fract)); - - /* convert y to 1.15 format */ - return (q15_t) (y >> 20); - } - } - - - /** - * - * @brief Process function for the Q7 Linear Interpolation Function. - * @param[in] pYData pointer to Q7 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - */ - static __INLINE q7_t arm_linear_interp_q7( - q7_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q7_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - uint32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - if (x < 0) - { - return (pYData[0]); - } - index = (x >> 20) & 0xfff; - - if(index >= (nValues - 1)) - { - return (pYData[nValues - 1]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index and are in 1.7(q7) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ - y = ((y0 * (0xFFFFF - fract))); - - /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ - y += (y1 * fract); - - /* convert y to 1.7(q7) format */ - return (q7_t) (y >> 20); - } - } - - /** - * @} end of LinearInterpolate group - */ - - /** - * @brief Fast approximation to the trigonometric sine function for floating-point data. - * @param[in] x input value in radians. - * @return sin(x). - */ - float32_t arm_sin_f32( - float32_t x); - - - /** - * @brief Fast approximation to the trigonometric sine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - q31_t arm_sin_q31( - q31_t x); - - - /** - * @brief Fast approximation to the trigonometric sine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - q15_t arm_sin_q15( - q15_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for floating-point data. - * @param[in] x input value in radians. - * @return cos(x). - */ - float32_t arm_cos_f32( - float32_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - q31_t arm_cos_q31( - q31_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - q15_t arm_cos_q15( - q15_t x); - - - /** - * @ingroup groupFastMath - */ - - - /** - * @defgroup SQRT Square Root - * - * Computes the square root of a number. - * There are separate functions for Q15, Q31, and floating-point data types. - * The square root function is computed using the Newton-Raphson algorithm. - * This is an iterative algorithm of the form: - *
-   *      x1 = x0 - f(x0)/f'(x0)
-   * 
- * where x1 is the current estimate, - * x0 is the previous estimate, and - * f'(x0) is the derivative of f() evaluated at x0. - * For the square root function, the algorithm reduces to: - *
-   *     x0 = in/2                         [initial guess]
-   *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
-   * 
- */ - - - /** - * @addtogroup SQRT - * @{ - */ - - /** - * @brief Floating-point square root function. - * @param[in] in input value. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - static __INLINE arm_status arm_sqrt_f32( - float32_t in, - float32_t * pOut) - { - if(in >= 0.0f) - { - -#if (__FPU_USED == 1) && defined ( __CC_ARM ) - *pOut = __sqrtf(in); -#elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined(__GNUC__) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) - __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); -#else - *pOut = sqrtf(in); -#endif - - return (ARM_MATH_SUCCESS); - } - else - { - *pOut = 0.0f; - return (ARM_MATH_ARGUMENT_ERROR); - } - } - - - /** - * @brief Q31 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q31( - q31_t in, - q31_t * pOut); - - - /** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q15( - q15_t in, - q15_t * pOut); - - /** - * @} end of SQRT group - */ - - - /** - * @brief floating-point Circular write function. - */ - static __INLINE void arm_circularWrite_f32( - int32_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const int32_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - - /** - * @brief floating-point Circular Read function. - */ - static __INLINE void arm_circularRead_f32( - int32_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - int32_t * dst, - int32_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (int32_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Q15 Circular write function. - */ - static __INLINE void arm_circularWrite_q15( - q15_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q15_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - /** - * @brief Q15 Circular Read function. - */ - static __INLINE void arm_circularRead_q15( - q15_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q15_t * dst, - q15_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (q15_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update wOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Q7 Circular write function. - */ - static __INLINE void arm_circularWrite_q7( - q7_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q7_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - /** - * @brief Q7 Circular Read function. - */ - static __INLINE void arm_circularRead_q7( - q7_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q7_t * dst, - q7_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (q7_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Sum of the squares of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q31( - q31_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q15( - q15_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q7( - q7_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Mean value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult); - - - /** - * @brief Mean value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Mean value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Mean value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Variance of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Variance of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Variance of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Standard deviation of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Standard deviation of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Standard deviation of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Floating-point complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t numSamples, - q31_t * realResult, - q31_t * imagResult); - - - /** - * @brief Q31 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t numSamples, - q63_t * realResult, - q63_t * imagResult); - - - /** - * @brief Floating-point complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t numSamples, - float32_t * realResult, - float32_t * imagResult); - - - /** - * @brief Q15 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_q15( - q15_t * pSrcCmplx, - q15_t * pSrcReal, - q15_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_q31( - q31_t * pSrcCmplx, - q31_t * pSrcReal, - q31_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_f32( - float32_t * pSrcCmplx, - float32_t * pSrcReal, - float32_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Minimum value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] result is output pointer - * @param[in] index is the array index of the minimum value in the input buffer. - */ - void arm_min_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * result, - uint32_t * index); - - - /** - * @brief Minimum value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[in] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Minimum value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Minimum value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q7 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q15 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q31 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a floating-point vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Q15 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Converts the elements of the floating-point vector to Q31 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q31 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q31( - float32_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the floating-point vector to Q15 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q15( - float32_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the floating-point vector to Q7 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q7 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q7( - float32_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q31 vector to Q15 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_q15( - q31_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q31 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_q7( - q31_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_float( - q15_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q31 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_q31( - q15_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_q7( - q15_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
-   *   typedef struct
-   *   {
-   *     uint16_t numRows;
-   *     uint16_t numCols;
-   *     float32_t *pData;
-   * } arm_bilinear_interp_instance_f32;
-   * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
-   *     XF = floor(x)
-   *     YF = floor(y)
-   * 
- * \par - * The interpolated output point is computed as: - *
-   *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
-   *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
-   *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
-   *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
-   * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ - - /** - * @addtogroup BilinearInterpolate - * @{ - */ - - - /** - * - * @brief Floating-point bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate. - * @param[in] Y interpolation coordinate. - * @return out interpolated value. - */ - static __INLINE float32_t arm_bilinear_interp_f32( - const arm_bilinear_interp_instance_f32 * S, - float32_t X, - float32_t Y) - { - float32_t out; - float32_t f00, f01, f10, f11; - float32_t *pData = S->pData; - int32_t xIndex, yIndex, index; - float32_t xdiff, ydiff; - float32_t b1, b2, b3, b4; - - xIndex = (int32_t) X; - yIndex = (int32_t) Y; - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) - { - return (0); - } - - /* Calculation of index for two nearest points in X-direction */ - index = (xIndex - 1) + (yIndex - 1) * S->numCols; - - - /* Read two nearest points in X-direction */ - f00 = pData[index]; - f01 = pData[index + 1]; - - /* Calculation of index for two nearest points in Y-direction */ - index = (xIndex - 1) + (yIndex) * S->numCols; - - - /* Read two nearest points in Y-direction */ - f10 = pData[index]; - f11 = pData[index + 1]; - - /* Calculation of intermediate values */ - b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; - - /* Calculation of fractional part in X */ - xdiff = X - xIndex; - - /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; - - /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; - - /* return to application */ - return (out); - } - - - /** - * - * @brief Q31 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q31_t arm_bilinear_interp_q31( - arm_bilinear_interp_instance_q31 * S, - q31_t X, - q31_t Y) - { - q31_t out; /* Temporary output */ - q31_t acc = 0; /* output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q31_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q31_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* shift left xfract by 11 to keep 1.31 format */ - xfract = (X & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; - x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; - - /* 20 bits for the fractional part */ - /* shift left yfract by 11 to keep 1.31 format */ - yfract = (Y & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; - y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ - out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); - acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); - - /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); - - /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* Convert acc to 1.31(q31) format */ - return ((q31_t)(acc << 2)); - } - - - /** - * @brief Q15 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q15_t arm_bilinear_interp_q15( - arm_bilinear_interp_instance_q15 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q15_t x1, x2, y1, y2; /* Nearest output values */ - q31_t xfract, yfract; /* X, Y fractional parts */ - int32_t rI, cI; /* Row and column indices */ - q15_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ - - /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ - /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ - out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); - acc = ((q63_t) out * (0xFFFFF - yfract)); - - /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); - acc += ((q63_t) out * (xfract)); - - /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* acc is in 13.51 format and down shift acc by 36 times */ - /* Convert out to 1.15 format */ - return ((q15_t)(acc >> 36)); - } - - - /** - * @brief Q7 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q7_t arm_bilinear_interp_q7( - arm_bilinear_interp_instance_q7 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q7_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q7_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ - out = ((x1 * (0xFFFFF - xfract))); - acc = (((q63_t) out * (0xFFFFF - yfract))); - - /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ - out = ((x2 * (0xFFFFF - yfract))); - acc += (((q63_t) out * (xfract))); - - /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y1 * (0xFFFFF - xfract))); - acc += (((q63_t) out * (yfract))); - - /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y2 * (yfract))); - acc += (((q63_t) out * (xfract))); - - /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ - return ((q7_t)(acc >> 40)); - } - - /** - * @} end of BilinearInterpolate group - */ - - -/* SMMLAR */ -#define multAcc_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMLSR */ -#define multSub_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMULR */ -#define mult_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) - -/* SMMLA */ -#define multAcc_32x32_keep32(a, x, y) \ - a += (q31_t) (((q63_t) x * y) >> 32) - -/* SMMLS */ -#define multSub_32x32_keep32(a, x, y) \ - a -= (q31_t) (((q63_t) x * y) >> 32) - -/* SMMUL */ -#define mult_32x32_keep32(a, x, y) \ - a = (q31_t) (((q63_t) x * y ) >> 32) - - -#if defined ( __CC_ARM ) - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("push") \ - _Pragma ("O1") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_EXIT \ - _Pragma ("pop") - #else - #define LOW_OPTIMIZATION_EXIT - #endif - - /* Enter low optimization region - place directly above function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - - /* Exit low optimization region - place directly after end of function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__GNUC__) - #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") )) - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ICCARM__) - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #define LOW_OPTIMIZATION_EXIT - - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__CSMC__) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__TASKING__) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#endif - - -#ifdef __cplusplus -} -#endif - - -#if defined ( __GNUC__ ) -#pragma GCC diagnostic pop -#endif - -#endif /* _ARM_MATH_H */ - -/** - * - * End of file. - */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc.h deleted file mode 100644 index 74c49c67def..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc.h +++ /dev/null @@ -1,734 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#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 - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/* intrinsic void __enable_irq(); */ -/* 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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)1); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \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 (__FPU_PRESENT == 1U) && (__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 (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - register uint32_t __regfpscr __ASM("fpscr"); - __regfpscr = (fpscr); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __rev - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_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] value Value to rotate - \param [in] value 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - #define __RBIT __rbit -#else -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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) - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -#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 /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_H */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc_V6.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc_V6.h deleted file mode 100644 index 6d8f998d84f..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_armcc_V6.h +++ /dev/null @@ -1,1804 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc_V6.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_ARMCC_V6_H -#define __CMSIS_ARMCC_V6_H - - -/* ########################### 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, control" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile("MSR control, %0" : : "r"(control) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get IPSR Register (non-secure) - \details Returns the content of the non-secure IPSR Register when in secure state. - \return IPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_IPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get APSR Register (non-secure) - \details Returns the content of the non-secure APSR Register when in secure state. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_APSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get xPSR Register (non-secure) - \details Returns the content of the non-secure xPSR Register when in secure state. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_xPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp, %0" : : "r"(topOfProcStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp_ns, %0" : : "r"(topOfProcStack) : "sp"); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp, %0" : : "r"(topOfMainStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp_ns, %0" : : "r"(topOfMainStack) : "sp"); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, primask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile("MSR primask, %0" : : "r"(priMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile("MSR primask_ns, %0" : : "r"(priMask) : "memory"); -} -#endif - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, basepri" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile("MSR basepri, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_ns, %0" : : "r"(value) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile("MSR basepri_max, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Base Priority with condition (non_secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_MAX_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_max_ns, %0" : : "r"(value) : "memory"); -} -#endif - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, faultmask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask, %0" : : "r"(faultMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask_ns, %0" : : "r"(faultMask) : "memory"); -} -#endif - - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \brief Get Process Stack Pointer Limit - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim, %0" : : "r"(ProcStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim_ns, %0\n" : : "r"(ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim" : "=r"(result)); - - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim, %0" : : "r"(MainStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim_ns, %0" : : "r"(MainStackPtrLimit)); -} -#endif - -#endif /* (__ARM_ARCH_8M__ == 1U) */ - - -#if ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=4 */ - -/** - \brief Get FPSCR - \details eturns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#define __get_FPSCR __builtin_arm_get_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get FPSCR (non-secure) - \details Returns the current value of the non-secure Floating Point Status/Control register when in secure state. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FPSCR_NS(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr_ns" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#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 - */ -#define __set_FPSCR __builtin_arm_set_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set FPSCR (non-secure) - \details Assigns the given value to the non-secure Floating Point Status/Control register when in secure state. - \param [in] fpscr Floating Point Status/Control value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FPSCR_NS(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr_ns, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#endif /* ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __builtin_bswap32 - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16 __builtin_bswap16 /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -#if 0 -__attribute__((always_inline)) __STATIC_INLINE 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); -} -#endif - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -/* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ - int32_t result; - - __ASM volatile("revsh %0, %1" : __CMSIS_GCC_OUT_REG(result) : __CMSIS_GCC_USE_REG(value)); - return (result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -/* ToDo: ARMCC_V6: check if __builtin_arm_rbit is supported */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - __ASM volatile("rbit %0, %1" : "=r"(result) : "r"(value)); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \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 - - -/** - \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*/ -#define __SSAT(ARG1,ARG2) \ -({ \ - 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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat -#if 0 -#define __USAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) -#endif - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile("strt %1, %0" : "=Q"(*ptr) : "r"(value)); -} - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 /* (__ARM_ARCH_8M__ == 1U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__ARM_FEATURE_DSP == 1U) /* ToDo: ARMCC_V6: This should be ARCH >= ARMv7-M + SIMD */ - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) \ -({ \ - uint32_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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("uxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("sxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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 __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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_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 == 1U) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_V6_H */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_gcc.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_gcc.h deleted file mode 100644 index bb89fbba9e4..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/cmsis_gcc.h +++ /dev/null @@ -1,1373 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_GCC_H -#define __CMSIS_GCC_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#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. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); - return(result); -} - - -/** - \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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp"); -} - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msp\n" : "=r" (result) ); - return(result); -} - - -/** - \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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp"); -} - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (__CORTEX_M >= 0x03U) - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); -} - - -/** - \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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (value) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - -#endif /* (__CORTEX_M >= 0x03U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - __ASM volatile (""); - return(result); -#else - return(0); -#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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc"); - __ASM volatile (""); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) -{ - __ASM volatile ("wfe"); -} - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (short)__builtin_bswap16(value); -#else - int32_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] value Value to rotate - \param [in] value Number of Bits to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __CLREX(void) -{ - __ASM volatile ("clrex" ::: "memory"); -} - - -/** - \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(ARG1,ARG2) \ -({ \ - uint32_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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1,ARG2) \ -({ \ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %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 ("ldrbt %0, [%1]" : "=r" (result) : "r" (addr) : "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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %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 ("ldrht %0, [%1]" : "=r" (result) : "r" (addr) : "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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*addr) ); - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *addr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*addr) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *addr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*addr) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *addr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*addr) : "r" (value) ); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 __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; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_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 /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#if defined ( __GNUC__ ) -#pragma GCC diagnostic pop -#endif - -#endif /* __CMSIS_GCC_H */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm0.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm0.h deleted file mode 100644 index 711dad55170..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm0.h +++ /dev/null @@ -1,798 +0,0 @@ -/**************************************************************************//** - * @file core_cm0.h - * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM0 definitions */ -#define __CM0_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM0_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \ - __CM0_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 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_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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M0 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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/m031/CMSIS/Include/core_cm0plus.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm0plus.h deleted file mode 100644 index b04aa390532..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm0plus.h +++ /dev/null @@ -1,914 +0,0 @@ -/**************************************************************************//** - * @file core_cm0plus.h - * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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+ - @{ - */ - -/* CMSIS CM0+ definitions */ -#define __CM0PLUS_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM0PLUS_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16U) | \ - __CM0PLUS_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 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 */ -#if (__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 (__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 (__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 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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M0+ 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 (__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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/m031/CMSIS/Include/core_cm3.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm3.h deleted file mode 100644 index b4ac4c7b05a..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm3.h +++ /dev/null @@ -1,1763 +0,0 @@ -/**************************************************************************//** - * @file core_cm3.h - * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM3 definitions */ -#define __CM3_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM3_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16U) | \ - __CM3_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x03U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 4U - #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:15; /*!< bit: 9..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_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 RSERVED1[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 (__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 */ - -/* 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 */ - -#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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M3 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 (__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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/m031/CMSIS/Include/core_cm4.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm4.h deleted file mode 100644 index dc840ebf222..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm4.h +++ /dev/null @@ -1,1937 +0,0 @@ -/**************************************************************************//** - * @file core_cm4.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM4 definitions */ -#define __CM4_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM4_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \ - __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x04U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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 (__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_PCS_VFP - #if (__FPU_PRESENT == 1) - #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 (__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 (__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 ( __TMS470__ ) - #if defined __TI_VFP_SUPPORT__ - #if (__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 (__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 (__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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ -#include "core_cmSimd.h" /* Compiler specific SIMD Intrinsics */ - -#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 4U - #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: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 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 RSERVED1[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 */ - -/* 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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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 - - -#if (__FPU_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 */ -} 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 */ - -/*@} end of group CMSIS_FPU */ -#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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M4 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 (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1U) - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point 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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/m031/CMSIS/Include/core_cm7.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm7.h deleted file mode 100644 index 3b7530ad505..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cm7.h +++ /dev/null @@ -1,2512 +0,0 @@ -/**************************************************************************//** - * @file core_cm7.h - * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM7 definitions */ -#define __CM7_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM7_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16U) | \ - __CM7_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x07U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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 (__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_PCS_VFP - #if (__FPU_PRESENT == 1) - #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 (__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 (__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 ( __TMS470__ ) - #if defined __TI_VFP_SUPPORT__ - #if (__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 (__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 (__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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ -#include "core_cmSimd.h" /* Compiler specific SIMD Intrinsics */ - -#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: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 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 RSERVED1[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 1 */ - 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 */ - -/* 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_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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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 - - -#if (__FPU_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 */ - -/*@} end of group CMSIS_FPU */ -#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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M4 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 (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1U) - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point 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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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) -{ - uint32_t mvfr0; - - mvfr0 = SCB->MVFR0; - if ((mvfr0 & 0x00000FF0UL) == 0x220UL) - { - return 2UL; /* Double + Single precision FPU */ - } - else if ((mvfr0 & 0x00000FF0UL) == 0x020UL) - { - return 1UL; /* Single precision FPU */ - } - else - { - return 0UL; /* 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 ) - - -/** - \brief Enable I-Cache - \details Turns on I-Cache - */ -__STATIC_INLINE void SCB_EnableICache (void) -{ - #if (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; /* invalidate I-Cache */ - SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; /* enable I-Cache */ - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Disable I-Cache - \details Turns off I-Cache - */ -__STATIC_INLINE void SCB_DisableICache (void) -{ - #if (__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_INLINE void SCB_InvalidateICache (void) -{ - #if (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Enable D-Cache - \details Turns on D-Cache - */ -__STATIC_INLINE void SCB_EnableDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - __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_INLINE void SCB_DisableDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* Level 1 data cache */ - __DSB(); - - ccsidr = SCB->CCSIDR; - - SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ - - /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Invalidate D-Cache - \details Invalidates D-Cache - */ -__STATIC_INLINE void SCB_InvalidateDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Clean D-Cache - \details Cleans D-Cache - */ -__STATIC_INLINE void SCB_CleanDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Clean & Invalidate D-Cache - \details Cleans and Invalidates D-Cache - */ -__STATIC_INLINE void SCB_CleanInvalidateDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Invalidate by address - \details Invalidates D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t)addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCIMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Clean by address - \details Cleans D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCCMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Clean and Invalidate by address - \details Cleans and invalidates D_Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCCIMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __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 (__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 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/nuvoton/libraries/m031/CMSIS/Include/core_cmFunc.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmFunc.h deleted file mode 100644 index 652a48af07a..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmFunc.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmFunc.h - * @brief CMSIS Cortex-M Core Function Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMFUNC_H -#define __CORE_CMFUNC_H - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@} end of CMSIS_Core_RegAccFunctions */ - -#endif /* __CORE_CMFUNC_H */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmInstr.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmInstr.h deleted file mode 100644 index f474b0e6f36..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmInstr.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmInstr.h - * @brief CMSIS Cortex-M Core Instruction Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMINSTR_H -#define __CORE_CMINSTR_H - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - -#endif /* __CORE_CMINSTR_H */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmSimd.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmSimd.h deleted file mode 100644 index 66bf5c2a725..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_cmSimd.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file core_cmSimd.h - * @brief CMSIS Cortex-M SIMD Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMSIMD_H -#define __CORE_CMSIMD_H - -#ifdef __cplusplus - extern "C" { -#endif - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CMSIMD_H */ diff --git a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_sc000.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_sc000.h deleted file mode 100644 index 514dbd81b9f..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_sc000.h +++ /dev/null @@ -1,926 +0,0 @@ -/**************************************************************************//** - * @file core_sc000.h - * @brief CMSIS SC000 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS SC000 definitions */ -#define __SC000_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __SC000_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16U) | \ - __SC000_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (000U) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 SC000 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 (__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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/m031/CMSIS/Include/core_sc300.h b/bsp/nuvoton/libraries/m031/CMSIS/Include/core_sc300.h deleted file mode 100644 index 8bd18aa318a..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/Include/core_sc300.h +++ /dev/null @@ -1,1745 +0,0 @@ -/**************************************************************************//** - * @file core_sc300.h - * @brief CMSIS SC300 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS SC300 definitions */ -#define __SC300_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __SC300_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16U) | \ - __SC300_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (300U) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 4U - #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:15; /*!< bit: 9..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_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 RSERVED1[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 */ - -/* 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 */ - uint32_t RESERVED1[1U]; -} 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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M3 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 (__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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/m031/CMSIS/SConscript b/bsp/nuvoton/libraries/m031/CMSIS/SConscript deleted file mode 100644 index 904fca41463..00000000000 --- a/bsp/nuvoton/libraries/m031/CMSIS/SConscript +++ /dev/null @@ -1,16 +0,0 @@ -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(""" -""") - -path = [cwd + '/Include',] - -group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/M031Series.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/M031Series.h deleted file mode 100644 index c8d840c71ec..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/M031Series.h +++ /dev/null @@ -1,590 +0,0 @@ -/**************************************************************************//** - * @file m031series.h - * @version V3.0 - * $Revision: 12 $ - * $Date: 18/08/16 4:06p $ - * @brief M031 Series Peripheral Access Layer Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -/** - \mainpage NuMicro M031 Driver Reference Guide - * - * Introduction - * - * This user manual describes the usage of M031 Series MCU device driver - * - * Disclaimer - * - * The Software is furnished "AS IS", without warranty as to performance or results, and - * the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all - * warranties, express, implied or otherwise, with regard to the Software, its use, or - * operation, including without limitation any and all warranties of merchantability, fitness - * for a particular purpose, and non-infringement of intellectual property rights. - * - * Important Notice - * - * Nuvoton Products are neither intended nor warranted for usage in systems or equipment, - * any malfunction or failure of which may cause loss of human life, bodily injury or severe - * property damage. Such applications are deemed, "Insecure Usage". - * - * Insecure usage includes, but is not limited to: equipment for surgical implementation, - * atomic energy control instruments, airplane or spaceship instruments, the control or - * operation of dynamic, brake or safety systems designed for vehicular use, traffic signal - * instruments, all types of safety devices, and other applications intended to support or - * sustain life. - * - * All Insecure Usage shall be made at customer's risk, and in the event that third parties - * lay claims to Nuvoton as a result of customer's Insecure Usage, customer shall indemnify - * the damages and liabilities thus incurred by Nuvoton. - * - * Please note that all data and specifications are subject to change without notice. All the - * trademarks of products and companies mentioned in this datasheet belong to their respective - * owners. - * - * Copyright Notice - * - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - */ - -#ifndef __M031SERIES_H__ -#define __M031SERIES_H__ - -/******************************************************************************/ -/* Processor and Core Peripherals */ -/******************************************************************************/ -/** @addtogroup CMSIS_Device CMSIS Definitions - Configuration of the Cortex-M0 Processor and Core Peripherals - @{ -*/ - - -/* - * ========================================================================== - * ---------- Interrupt Number Definition ----------------------------------- - * ========================================================================== - */ - -/** - * @details Interrupt Number Definition. The maximum of 32 Specific Interrupts are possible. - */ -typedef enum IRQn -{ - /****** Cortex-M0 Processor Exceptions Numbers ***************************************************/ - NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */ - SVCall_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */ - PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */ - SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */ - - /****** ARMIKMCU Swift specific Interrupt Numbers ************************************************/ - BOD_IRQn = 0, /*!< Brown-Out Low Voltage Detected Interrupt */ - WDT_IRQn = 1, /*!< Watch Dog Timer Interrupt */ - EINT024_IRQn = 2, /*!< EINT0, EINT2 and EINT4 Interrupt */ - EINT135_IRQn = 3, /*!< EINT1, EINT3 and EINT5 Interrupt */ - GPIO_PAPB_IRQn = 4, /*!< GPIO_PAPBPGPH Interrupt */ - GPIO_PAPBPGPH_IRQn = 4, /*!< GPIO_PAPBPGPH Interrupt */ - GPIO_PCPDPEPF_IRQn = 5, /*!< GPIO_PCPDPEPF Interrupt */ - PWM0_IRQn = 6, /*!< PWM0 Interrupt */ - PWM1_IRQn = 7, /*!< PWM1 Interrupt */ - TMR0_IRQn = 8, /*!< TIMER0 Interrupt */ - TMR1_IRQn = 9, /*!< TIMER1 Interrupt */ - TMR2_IRQn = 10, /*!< TIMER2 Interrupt */ - TMR3_IRQn = 11, /*!< TIMER3 Interrupt */ - UART02_IRQn = 12, /*!< UART0 and UART2 Interrupt */ - UART1_IRQn = 13, /*!< UART1 and UART3 Interrupt */ - UART13_IRQn = 13, /*!< UART1 and UART3 Interrupt */ - SPI0_IRQn = 14, /*!< SPI0 Interrupt */ - QSPI0_IRQn = 15, /*!< QSPI0 Interrupt */ - ISP_IRQn = 16, /*!< ISP Interrupt */ - UART57_IRQn = 17, /*!< UART5 and UART7 Interrupt */ - I2C0_IRQn = 18, /*!< I2C0 Interrupt */ - I2C1_IRQn = 19, /*!< I2C1 Interrupt */ - BPWM0_IRQn = 20, /*!< BPWM0 Interrupt */ - BPWM1_IRQn = 21, /*!< BPWM1 Interrupt */ - USCI_IRQn = 22, /*!< USCI0 and USCI1 interrupt */ - USCI01_IRQn = 22, /*!< USCI0 and USCI1 interrupt */ - USBD_IRQn = 23, /*!< USB Device Interrupt */ - ACMP01_IRQn = 25, /*!< ACMP0/1 Interrupt */ - PDMA_IRQn = 26, /*!< PDMA Interrupt */ - UART46_IRQn = 27, /*!< UART4 and UART6 Interrupt */ - PWRWU_IRQn = 28, /*!< Power Down Wake Up Interrupt */ - ADC_IRQn = 29, /*!< ADC Interrupt */ - CKFAIL_IRQn = 30, /*!< Clock fail detect Interrupt */ - RTC_IRQn = 31, /*!< RTC Interrupt */ -} IRQn_Type; - - -/* - * ========================================================================== - * ----------- Processor and Core Peripheral Section ------------------------ - * ========================================================================== - */ - -/* Configuration of the Cortex-M0 Processor and Core Peripherals */ -#define __MPU_PRESENT 0 /*!< armikcmu does not provide a MPU present or not */ -#define __NVIC_PRIO_BITS 2 /*!< armikcmu Supports 2 Bits for the Priority Levels */ -#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ - -/*@}*/ /* end of group CMSIS_Device */ - -#include "core_cm0.h" /*!< Cortex-M0 processor and core peripherals */ -#include "system_M031Series.h" /*!< M031 System */ - - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - - -/** - * Initialize the system clock - * - * @param None - * @return None - * - * @brief Setup the microcontroller system - * Initialize the PLL and update the SystemFrequency variable - */ -extern void SystemInit(void); - - - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -#include "acmp_reg.h" -#include "adc_reg.h" -#include "clk_reg.h" -#include "crc_reg.h" -#include "ebi_reg.h" -#include "fmc_reg.h" -#include "gpio_reg.h" -#include "hdiv_reg.h" -#include "i2c_reg.h" -#include "pdma_reg.h" -#include "pwm_reg.h" -#include "bpwm_reg.h" -#include "qspi_reg.h" -#include "spi_reg.h" -#include "sys_reg.h" -#include "rtc_reg.h" -#include "timer_reg.h" -#include "uart_reg.h" -#include "ui2c_reg.h" -#include "usbd_reg.h" -#include "uspi_reg.h" -#include "uuart_reg.h" -#include "wdt_reg.h" -#include "wwdt_reg.h" - - -/******************************************************************************/ -/* Peripheral memory map */ -/******************************************************************************/ -/** @addtogroup PERIPHERAL_BASE Peripheral Memory Base - Memory Mapped Structure for Series Peripheral - @{ - */ -/* Peripheral and SRAM base address */ -#define FLASH_BASE (( uint32_t)0x00000000) -#define SRAM_BASE (( uint32_t)0x20000000) -#define AHB_BASE (( uint32_t)0x40000000) -#define APB1_BASE (( uint32_t)0x40000000) -#define APB2_BASE (( uint32_t)0x40000000) - -/* Peripheral memory map */ - -#define SYS_BASE (AHB_BASE + 0x00000) /*!< System Global Controller Base Address */ -#define CLK_BASE (AHB_BASE + 0x00200) /*!< System Clock Controller Base Address */ -#define INT_BASE (AHB_BASE + 0x00300) /*!< Interrupt Source Controller Base Address */ -#define NMI_BASE (AHB_BASE + 0x00300) /*!< Interrupt Source Controller Base Address */ - -#define GPIO_BASE (AHB_BASE + 0x4000) /*!< GPIO Base Address */ -#define PA_BASE (GPIO_BASE ) /*!< GPIO PA Base Address */ -#define PB_BASE (GPIO_BASE + 0x0040) /*!< GPIO PB Base Address */ -#define PC_BASE (GPIO_BASE + 0x0080) /*!< GPIO PC Base Address */ -#define PD_BASE (GPIO_BASE + 0x00C0) /*!< GPIO PD Base Address */ -#define PE_BASE (GPIO_BASE + 0x0100) /*!< GPIO PE Base Address */ -#define PF_BASE (GPIO_BASE + 0x0140) /*!< GPIO PF Base Address */ -#define PG_BASE (GPIO_BASE + 0x0180) /*!< GPIO PG Base Address */ -#define PH_BASE (GPIO_BASE + 0x01C0) /*!< GPIO PH Base Address */ -#define GPIO_DBCTL_BASE (GPIO_BASE + 0x0440) /*!< GPIO De-bounce Cycle Control Base Address */ -#define GPIO_PIN_DATA_BASE (GPIO_BASE + 0x0800) /*!< GPIO Pin Data Input/Output Control Base Address */ - -#define PDMA_BASE (AHB_BASE + 0x08000) /*!< PDMA Base Address */ -#define FMC_BASE (AHB_BASE + 0x0C000) /*!< Flash Memory Controller Base Address */ -#define EBI_BASE (AHB_BASE + 0x10000) /*!< EBI Base Address */ -#define HDIV_BASE (AHB_BASE + 0x14000) /*!< HDIV Base Address */ -#define CRC_BASE (AHB_BASE + 0x31000) /*!< CRC Base Address */ - -#define WDT_BASE (APB1_BASE + 0x40000) /*!< Watch Dog Timer Base Address */ -#define WWDT_BASE (APB1_BASE + 0x40100) /*!< Window Watch Dog Timer Base Address */ -#define RTC_BASE (APB1_BASE + 0x41000) /*!< RTC Base Address */ -#define ADC_BASE (APB1_BASE + 0x43000) /*!< ADC Base Address */ -#define ACMP01_BASE (APB1_BASE + 0x45000) /*!< ACMP01 Base Address */ - -#define TIMER0_BASE (APB1_BASE + 0x50000) /*!< Timer0 Base Address */ -#define TIMER1_BASE (APB1_BASE + 0x50020) /*!< Timer1 Base Address */ -#define TIMER2_BASE (APB2_BASE + 0x51000) /*!< Timer2 Base Address */ -#define TIMER3_BASE (APB2_BASE + 0x51020) /*!< Timer3 Base Address */ - -#define PWM0_BASE (APB1_BASE + 0x58000) /*!< PWM0 Base Address */ -#define PWM1_BASE (APB2_BASE + 0x59000) /*!< PWM1 Base Address */ - -#define BPWM0_BASE (APB1_BASE + 0x5A000) /*!< BPWM0 Base Address */ -#define BPWM1_BASE (APB2_BASE + 0x5B000) /*!< BPWM1 Base Address */ - -#define QSPI0_BASE (APB1_BASE + 0x60000) /*!< QSPI0 Base Address */ -#define SPI0_BASE (APB1_BASE + 0x61000) /*!< SPI0 Base Address */ - -#define UART0_BASE (APB1_BASE + 0x70000) /*!< UART0 Base Address */ -#define UART1_BASE (APB2_BASE + 0x71000) /*!< UART1 Base Address */ -#define UART2_BASE (APB2_BASE + 0x72000) /*!< UART2 Base Address */ -#define UART3_BASE (APB2_BASE + 0x73000) /*!< UART3 Base Address */ -#define UART4_BASE (APB2_BASE + 0x74000) /*!< UART4 Base Address */ -#define UART5_BASE (APB2_BASE + 0x75000) /*!< UART5 Base Address */ -#define UART6_BASE (APB2_BASE + 0x76000) /*!< UART6 Base Address */ -#define UART7_BASE (APB2_BASE + 0x77000) /*!< UART7 Base Address */ - -#define I2C0_BASE (APB1_BASE + 0x80000) /*!< I2C0 Base Address */ -#define I2C1_BASE (APB2_BASE + 0x81000) /*!< I2C1 Base Address */ - -#define USBD_BASE (AHB_BASE + 0xC0000) /*!< USBD1.1 Base Address */ -#define USCI0_BASE (APB1_BASE + 0xD0000) /*!< USCI0 Base Address */ -#define USCI1_BASE (APB2_BASE + 0xD1000) /*!< USCI1 Base Address */ - - -/**@}*/ /* PERIPHERAL */ - -/******************************************************************************/ -/* Peripheral declaration */ -/******************************************************************************/ - -/** @addtogroup PMODULE Peripheral Pointer - The Declaration of Peripheral Pointer - @{ - */ -#define PA ((GPIO_T *) PA_BASE) /*!< GPIO PORTA Configuration Struct */ -#define PB ((GPIO_T *) PB_BASE) /*!< GPIO PORTB Configuration Struct */ -#define PC ((GPIO_T *) PC_BASE) /*!< GPIO PORTC Configuration Struct */ -#define PD ((GPIO_T *) PD_BASE) /*!< GPIO PORTD Configuration Struct */ -#define PE ((GPIO_T *) PE_BASE) /*!< GPIO PORTE Configuration Struct */ -#define PF ((GPIO_T *) PF_BASE) /*!< GPIO PORTF Configuration Struct */ -#define PG ((GPIO_T *) PG_BASE) /*!< GPIO PORTG Configuration Struct */ -#define PH ((GPIO_T *) PH_BASE) /*!< GPIO PORTH Configuration Struct */ -#define GPIO ((GPIO_DBCTL_T *) GPIO_DBCTL_BASE) /*!< Interrupt De-bounce Cycle Control Configuration Struct */ - -#define UART0 ((UART_T *) UART0_BASE) /*!< UART0 Configuration Struct */ -#define UART1 ((UART_T *) UART1_BASE) /*!< UART1 Configuration Struct */ -#define UART2 ((UART_T *) UART2_BASE) /*!< UART2 Configuration Struct */ -#define UART3 ((UART_T *) UART3_BASE) /*!< UART3 Configuration Struct */ -#define UART4 ((UART_T *) UART4_BASE) /*!< UART4 Configuration Struct */ -#define UART5 ((UART_T *) UART5_BASE) /*!< UART5 Configuration Struct */ -#define UART6 ((UART_T *) UART6_BASE) /*!< UART6 Configuration Struct */ -#define UART7 ((UART_T *) UART7_BASE) /*!< UART7 Configuration Struct */ - -#define TIMER0 ((TIMER_T *) TIMER0_BASE) /*!< TIMER0 Configuration Struct */ -#define TIMER1 ((TIMER_T *) TIMER1_BASE) /*!< TIMER1 Configuration Struct */ -#define TIMER2 ((TIMER_T *) TIMER2_BASE) /*!< TIMER2 Configuration Struct */ -#define TIMER3 ((TIMER_T *) TIMER3_BASE) /*!< TIMER3 Configuration Struct */ - -#define WDT ((WDT_T *) WDT_BASE) /*!< Watch Dog Timer Configuration Struct */ - -#define WWDT ((WWDT_T *) WWDT_BASE) /*!< Window Watch Dog Timer Configuration Struct */ - -#define SPI0 ((SPI_T *) SPI0_BASE) /*!< SPI0 Configuration Struct */ -#define QSPI0 ((QSPI_T *) QSPI0_BASE) /*!< QSPI0 Configuration Struct */ - -#define I2C0 ((I2C_T *) I2C0_BASE) /*!< I2C0 Configuration Struct */ -#define I2C1 ((I2C_T *) I2C1_BASE) /*!< I2C1 Configuration Struct */ - -#define ADC ((ADC_T *) ADC_BASE) /*!< ADC Configuration Struct */ - -#define ACMP01 ((ACMP_T *) ACMP01_BASE) /*!< ACMP01 Configuration Struct */ - -#define CLK ((CLK_T *) CLK_BASE) /*!< System Clock Controller Configuration Struct */ - -#define SYS ((SYS_T *) SYS_BASE) /*!< System Global Controller Configuration Struct */ - -#define SYSINT ((NMI_T *) INT_BASE) /*!< Interrupt Source Controller Configuration Struct */ -#define NMI ((NMI_T *) NMI_BASE) /*!< Interrupt Source Controller Configuration Struct */ - -#define FMC ((FMC_T *) FMC_BASE) /*!< Flash Memory Controller */ - -#define PWM0 ((PWM_T *) PWM0_BASE) /*!< PWM0 Configuration Struct */ -#define PWM1 ((PWM_T *) PWM1_BASE) /*!< PWM1 Configuration Struct */ -#define BPWM0 ((BPWM_T *) BPWM0_BASE) /*!< BPWM0 Configuration Struct */ -#define BPWM1 ((BPWM_T *) BPWM1_BASE) /*!< BPWM1 Configuration Struct */ - -#define EBI ((EBI_T *) EBI_BASE) /*!< EBI Configuration Struct */ - -#define HDIV ((HDIV_T *) HDIV_BASE) /*!< HDIV Configuration Struct */ - -#define CRC ((CRC_T *) CRC_BASE) /*!< CRC Configuration Struct */ - -#define USBD ((USBD_T *) USBD_BASE) /*!< CRC Configuration Struct */ - -#define PDMA ((PDMA_T *) PDMA_BASE) /*!< PDMA Configuration Struct */ - -#define UI2C0 ((UI2C_T *) USCI0_BASE) /*!< UI2C0 Configuration Struct */ -#define UI2C1 ((UI2C_T *) USCI1_BASE) /*!< UI2C1 Configuration Struct */ - -#define USPI0 ((USPI_T *) USCI0_BASE) /*!< USPI0 Configuration Struct */ -#define USPI1 ((USPI_T *) USCI1_BASE) /*!< USPI1 Configuration Struct */ - -#define UUART0 ((UUART_T *) USCI0_BASE) /*!< UUART0 Configuration Struct */ -#define UUART1 ((UUART_T *) USCI1_BASE) /*!< UUART1 Configuration Struct */ - -#define RTC ((RTC_T *) RTC_BASE) /*!< RTC Configuration Struct */ - -/**@}*/ /* end of group PMODULE */ - - -//============================================================================= - -/** @addtogroup IO_ROUTINE I/O Routines - The Declaration of I/O Routines - @{ - */ - -typedef volatile unsigned char vu8; -typedef volatile unsigned long vu32; -typedef volatile unsigned short vu16; - -/** - * @brief Get a 8-bit unsigned value from specified address - * @param[in] addr Address to get 8-bit data from - * @return 8-bit unsigned value stored in specified address - */ -#define M8(addr) (*((vu8 *) (addr))) - -/** - * @brief Get a 16-bit unsigned value from specified address - * @param[in] addr Address to get 16-bit data from - * @return 16-bit unsigned value stored in specified address - * @note The input address must be 16-bit aligned - */ -#define M16(addr) (*((vu16 *) (addr))) - -/** - * @brief Get a 32-bit unsigned value from specified address - * @param[in] addr Address to get 32-bit data from - * @return 32-bit unsigned value stored in specified address - * @note The input address must be 32-bit aligned - */ -#define M32(addr) (*((vu32 *) (addr))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outpw(port,value) (*((volatile unsigned int *)(port))=(value)) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inpw(port) ((*((volatile unsigned int *)(port)))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outps(port,value) (*((volatile unsigned short *)(port))=(value)) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inps(port) ((*((volatile unsigned short *)(port)))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outpb(port,value) (*((volatile unsigned char *)(port))=(value)) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inpb(port) ((*((volatile unsigned char *)(port)))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outp32(port,value) (*((volatile unsigned int *)(port))=(value)) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inp32(port) ((*((volatile unsigned int *)(port)))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outp16(port,value) (*((volatile unsigned short *)(port))=(value)) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inp16(port) ((*((volatile unsigned short *)(port)))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outp8(port,value) (*((volatile unsigned char *)(port))=(value)) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inp8(port) ((*((volatile unsigned char *)(port)))) - -/*@}*/ /* end of group IO_ROUTINE */ - -/******************************************************************************/ -/* Legacy Constants */ -/******************************************************************************/ - -/** @addtogroup Legacy_Constants Legacy Constants - Legacy Constants - @{ -*/ - -#define E_SUCCESS (0) - -#ifndef NULL - #define NULL (0) ///< NULL pointer -#endif - -#define TRUE (1UL) ///< Boolean true, define to use in API parameters or return value -#define FALSE (0UL) ///< Boolean false, define to use in API parameters or return value - -#define ENABLE (1UL) ///< Enable, define to use in API parameters -#define DISABLE (0UL) ///< Disable, define to use in API parameters - -/* Define one bit mask */ -#define BIT0 (0x00000001UL) ///< Bit 0 mask of an 32 bit integer -#define BIT1 (0x00000002UL) ///< Bit 1 mask of an 32 bit integer -#define BIT2 (0x00000004UL) ///< Bit 2 mask of an 32 bit integer -#define BIT3 (0x00000008UL) ///< Bit 3 mask of an 32 bit integer -#define BIT4 (0x00000010UL) ///< Bit 4 mask of an 32 bit integer -#define BIT5 (0x00000020UL) ///< Bit 5 mask of an 32 bit integer -#define BIT6 (0x00000040UL) ///< Bit 6 mask of an 32 bit integer -#define BIT7 (0x00000080UL) ///< Bit 7 mask of an 32 bit integer -#define BIT8 (0x00000100UL) ///< Bit 8 mask of an 32 bit integer -#define BIT9 (0x00000200UL) ///< Bit 9 mask of an 32 bit integer -#define BIT10 (0x00000400UL) ///< Bit 10 mask of an 32 bit integer -#define BIT11 (0x00000800UL) ///< Bit 11 mask of an 32 bit integer -#define BIT12 (0x00001000UL) ///< Bit 12 mask of an 32 bit integer -#define BIT13 (0x00002000UL) ///< Bit 13 mask of an 32 bit integer -#define BIT14 (0x00004000UL) ///< Bit 14 mask of an 32 bit integer -#define BIT15 (0x00008000UL) ///< Bit 15 mask of an 32 bit integer -#define BIT16 (0x00010000UL) ///< Bit 16 mask of an 32 bit integer -#define BIT17 (0x00020000UL) ///< Bit 17 mask of an 32 bit integer -#define BIT18 (0x00040000UL) ///< Bit 18 mask of an 32 bit integer -#define BIT19 (0x00080000UL) ///< Bit 19 mask of an 32 bit integer -#define BIT20 (0x00100000UL) ///< Bit 20 mask of an 32 bit integer -#define BIT21 (0x00200000UL) ///< Bit 21 mask of an 32 bit integer -#define BIT22 (0x00400000UL) ///< Bit 22 mask of an 32 bit integer -#define BIT23 (0x00800000UL) ///< Bit 23 mask of an 32 bit integer -#define BIT24 (0x01000000UL) ///< Bit 24 mask of an 32 bit integer -#define BIT25 (0x02000000UL) ///< Bit 25 mask of an 32 bit integer -#define BIT26 (0x04000000UL) ///< Bit 26 mask of an 32 bit integer -#define BIT27 (0x08000000UL) ///< Bit 27 mask of an 32 bit integer -#define BIT28 (0x10000000UL) ///< Bit 28 mask of an 32 bit integer -#define BIT29 (0x20000000UL) ///< Bit 29 mask of an 32 bit integer -#define BIT30 (0x40000000UL) ///< Bit 30 mask of an 32 bit integer -#define BIT31 (0x80000000UL) ///< Bit 31 mask of an 32 bit integer - - -/* Byte Mask Definitions */ -#define BYTE0_Msk (0x000000FFUL) ///< Mask to get bit0~bit7 from a 32 bit integer -#define BYTE1_Msk (0x0000FF00UL) ///< Mask to get bit8~bit15 from a 32 bit integer -#define BYTE2_Msk (0x00FF0000UL) ///< Mask to get bit16~bit23 from a 32 bit integer -#define BYTE3_Msk (0xFF000000UL) ///< Mask to get bit24~bit31 from a 32 bit integer - -#define GET_BYTE0(u32Param) (((u32Param) & BYTE0_Msk) ) /*!< Extract Byte 0 (Bit 0~ 7) from parameter u32Param */ -#define GET_BYTE1(u32Param) (((u32Param) & BYTE1_Msk) >> 8) /*!< Extract Byte 1 (Bit 8~15) from parameter u32Param */ -#define GET_BYTE2(u32Param) (((u32Param) & BYTE2_Msk) >> 16) /*!< Extract Byte 2 (Bit 16~23) from parameter u32Param */ -#define GET_BYTE3(u32Param) (((u32Param) & BYTE3_Msk) >> 24) /*!< Extract Byte 3 (Bit 24~31) from parameter u32Param */ - -/* Chip Series number definitions */ -#define GET_CHIP_SERIES_NUM ((SYS->PDID & 0xF00) >> 8) /*!< Extract chip series number from PDID */ -#define CHIP_SERIES_NUM_B (0xBUL) /*!< Chip series number for M031_B */ -#define CHIP_SERIES_NUM_C (0xCUL) /*!< Chip series number for M031_C */ -#define CHIP_SERIES_NUM_D (0xDUL) /*!< Chip series number for M031_D */ -#define CHIP_SERIES_NUM_E (0xEUL) /*!< Chip series number for M031_E */ -#define CHIP_SERIES_NUM_G (0x6UL) /*!< Chip series number for M031_G */ -#define CHIP_SERIES_NUM_I (0x1UL) /*!< Chip series number for M031_I */ - -/*@}*/ /* end of group Legacy_Constants */ - -/******************************************************************************/ -/* Peripheral header files */ -/******************************************************************************/ -#include "nu_sys.h" -#include "nu_clk.h" -#include "nu_acmp.h" -#include "nu_adc.h" -#include "nu_crc.h" -#include "nu_ebi.h" -#include "nu_fmc.h" -#include "nu_gpio.h" -#include "nu_i2c.h" -#include "nu_pdma.h" -#include "nu_pwm.h" -#include "nu_bpwm.h" -#include "nu_qspi.h" -#include "nu_spi.h" -#include "nu_rtc.h" -#include "nu_hdiv.h" -#include "nu_timer.h" -#include "nu_uart.h" -#include "nu_usbd.h" -#include "nu_usci_i2c.h" -#include "nu_usci_spi.h" -#include "nu_usci_uart.h" -#include "nu_wdt.h" -#include "nu_wwdt.h" - -#endif // __M031SERIES_H__ - -/* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/NuMicro.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/NuMicro.h deleted file mode 100644 index d4db737f901..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/NuMicro.h +++ /dev/null @@ -1,17 +0,0 @@ -/**************************************************************************//** - * @file NuMicro.h - * @version V1.00 - * @brief NuMicro peripheral access layer header file. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NUMICRO_H__ -#define __NUMICRO_H__ - -#include "nutool_clkcfg.h" -#include "M031Series.h" - -#endif /* __NUMICRO_H__ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/acmp_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/acmp_reg.h deleted file mode 100644 index b1878c2af93..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/acmp_reg.h +++ /dev/null @@ -1,255 +0,0 @@ -/**************************************************************************//** - * @file acmp_reg.h - * @version V1.00 - * @brief ACMP register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ACMP_REG_H__ -#define __ACMP_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ACMP Analog Comparator Controller (ACMP) - Memory Mapped Structure for ACMP Controller -@{ */ - -typedef struct -{ - - - /** - * @var ACMP_T::CTL - * Offset: 0x00/0x04 Analog Comparator 0/1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPEN |Comparator Enable Bit - * | | |0 = Comparator 0 Disabled. - * | | |1 = Comparator 0 Enabled. - * |[1] |ACMPIE |Comparator Interrupt Enable Bit - * | | |0 = Comparator 0 interrupt Disabled. - * | | |1 = Comparator 0 interrupt Enabled. If WKEN (ACMP_CTL0[16]) is set to 1, the wake-up interrupt function will be enabled as well. - * |[3] |ACMPOINV |Comparator Output Inverse - * | | |0 = Comparator 0 output inverse Disabled. - * | | |1 = Comparator 0 output inverse Enabled. - * |[5:4] |NEGSEL |Comparator Negative Input Selection - * | | |00 = ACMP0_N pin. - * | | |01 = Internal comparator reference voltage (CRV). - * | | |10 = Band-gap voltage. - * | | |11 = Reserved. - * |[7:6] |POSSEL |Comparator Positive Input Selection - * | | |00 = Input from ACMP0_P0. - * | | |01 = Input from ACMP0_P1. - * | | |10 = Input from ACMP0_P2. - * | | |11 = Input from ACMP0_P3. - * |[9:8] |INTPOL |Interrupt Condition Polarity Selection - * | | |ACMPIF0 will be set to 1 when comparator output edge condition is detected. - * | | |00 = Rising edge or falling edge. - * | | |01 = Rising edge. - * | | |10 = Falling edge. - * | | |11 = Reserved. - * |[12] |OUTSEL |Comparator Output Select - * | | |0 = Comparator 0 output to ACMP0_O pin is unfiltered comparator output. - * | | |1 = Comparator 0 output to ACMP0_O pin is from filter output. - * |[15:13] |FILTSEL |Comparator Output Filter Count Selection - * | | |000 = Filter function is Disabled. - * | | |001 = ACMP0 output is sampled 1 consecutive PCLK. - * | | |010 = ACMP0 output is sampled 2 consecutive PCLKs. - * | | |011 = ACMP0 output is sampled 4 consecutive PCLKs. - * | | |100 = ACMP0 output is sampled 8 consecutive PCLKs. - * | | |101 = ACMP0 output is sampled 16 consecutive PCLKs. - * | | |110 = ACMP0 output is sampled 32 consecutive PCLKs. - * | | |111 = ACMP0 output is sampled 64 consecutive PCLKs. - * |[16] |WKEN |Power-down Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[17] |WLATEN |Window Latch Mode Enable Bit - * | | |0 = Window Latch Mode Disabled. - * | | |1 = Window Latch Mode Enabled. - * |[18] |WCMPSEL |Window Compare Mode Selection - * | | |0 = Window Compare Mode Disabled. - * | | |1 = Window Compare Mode is Selected. - * @var ACMP_T::STATUS - * Offset: 0x08 Analog Comparator Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPIF0 |Comparator 0 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL0[9:8]) is detected on comparator 0 output. This will generate an interrupt if ACMPIE (ACMP_CTL0[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |ACMPIF1 |Comparator 1 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL1[9:8]) is detected on comparator 1 output. - * | | |This will cause an interrupt if ACMPIE (ACMP_CTL1[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |ACMPO0 |Comparator 0 Output - * | | |Synchronized to the PCLK to allow reading by software. Cleared when the comparator 0 is disabled, i.e. ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[5] |ACMPO1 |Comparator 1 Output - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 1 is disabled, i.e - * | | |ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[8] |WKIF0 |Comparator 0 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP0 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |WKIF1 |Comparator 1 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP1 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |ACMPS0 |Comparator 0 Status - * | | |Synchronized to the PCLK to allow reading by software. Cleared when the comparator 0 is disabled, i.e. ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[13] |ACMPS1 |Comparator 1 Status - * | | |Synchronized to the PCLK to allow reading by software. Cleared when the comparator 1 is disabled, i.e. ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[16] |ACMPWO |Comparator Window Output - * | | |This bit shows the output status of window compare mode. - * | | |0 = The positive input voltage is outside the window. - * | | |1 = The positive input voltage is in the window. - * @var ACMP_T::VREF - * Offset: 0x0C Analog Comparator Reference Voltage Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CRVCTL |Comparator Reference Voltage Setting - * | | |CRV = CRV source voltage * (1/6+CRVCTL/24). - * |[6] |CRVSSEL |CRV Source Voltage Selection - * | | |0 = AVDD is selected as CRV source voltage. - * | | |1 = VREF is selected as as CRV source voltage. - */ - __IO uint32_t CTL[2]; /*!< [0x0000~0x0004] Analog Comparator 0/1 Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] Analog Comparator Status Register */ - __IO uint32_t VREF; /*!< [0x000c] Analog Comparator Reference Voltage Control Register */ - __IO uint32_t CALCTL; /*!< [0x0010] Analog Comparator Calibration Control Register */ - __I uint32_t CALSR; /*!< [0x0014] Analog Comparator Calibration Status Register */ - -} ACMP_T; - -/** - @addtogroup ACMP_CONST ACMP Bit Field Definition - Constant Definitions for ACMP Controller -@{ */ - -#define ACMP_CTL_ACMPEN_Pos (0) /*!< ACMP_T::CTL: ACMPEN Position */ -#define ACMP_CTL_ACMPEN_Msk (0x1ul << ACMP_CTL_ACMPEN_Pos) /*!< ACMP_T::CTL: ACMPEN Mask */ - -#define ACMP_CTL_ACMPIE_Pos (1) /*!< ACMP_T::CTL: ACMPIE Position */ -#define ACMP_CTL_ACMPIE_Msk (0x1ul << ACMP_CTL_ACMPIE_Pos) /*!< ACMP_T::CTL: ACMPIE Mask */ - -#define ACMP_CTL_HYSEN_Pos (2) /*!< ACMP_T::CTL: HYSEN Position */ -#define ACMP_CTL_HYSEN_Msk (0x1ul << ACMP_CTL_HYSEN_Pos) /*!< ACMP_T::CTL: HYSEN Mask */ - -#define ACMP_CTL_ACMPOINV_Pos (3) /*!< ACMP_T::CTL: ACMPOINV Position */ -#define ACMP_CTL_ACMPOINV_Msk (0x1ul << ACMP_CTL_ACMPOINV_Pos) /*!< ACMP_T::CTL: ACMPOINV Mask */ - -#define ACMP_CTL_NEGSEL_Pos (4) /*!< ACMP_T::CTL: NEGSEL Position */ -#define ACMP_CTL_NEGSEL_Msk (0x3ul << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_T::CTL: NEGSEL Mask */ - -#define ACMP_CTL_POSSEL_Pos (6) /*!< ACMP_T::CTL: POSSEL Position */ -#define ACMP_CTL_POSSEL_Msk (0x3ul << ACMP_CTL_POSSEL_Pos) /*!< ACMP_T::CTL: POSSEL Mask */ - -#define ACMP_CTL_INTPOL_Pos (8) /*!< ACMP_T::CTL: INTPOL Position */ -#define ACMP_CTL_INTPOL_Msk (0x3ul << ACMP_CTL_INTPOL_Pos) /*!< ACMP_T::CTL: INTPOL Mask */ - -#define ACMP_CTL_OUTSEL_Pos (12) /*!< ACMP_T::CTL: OUTSEL Position */ -#define ACMP_CTL_OUTSEL_Msk (0x1ul << ACMP_CTL_OUTSEL_Pos) /*!< ACMP_T::CTL: OUTSEL Mask */ - -#define ACMP_CTL_FILTSEL_Pos (13) /*!< ACMP_T::CTL: FILTSEL Position */ -#define ACMP_CTL_FILTSEL_Msk (0x7ul << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_T::CTL: FILTSEL Mask */ - -#define ACMP_CTL_WKEN_Pos (16) /*!< ACMP_T::CTL: WKEN Position */ -#define ACMP_CTL_WKEN_Msk (0x1ul << ACMP_CTL_WKEN_Pos) /*!< ACMP_T::CTL: WKEN Mask */ - -#define ACMP_CTL_WLATEN_Pos (17) /*!< ACMP_T::CTL: WLATEN Position */ -#define ACMP_CTL_WLATEN_Msk (0x1ul << ACMP_CTL_WLATEN_Pos) /*!< ACMP_T::CTL: WLATEN Mask */ - -#define ACMP_CTL_WCMPSEL_Pos (18) /*!< ACMP_T::CTL: WCMPSEL Position */ -#define ACMP_CTL_WCMPSEL_Msk (0x1ul << ACMP_CTL_WCMPSEL_Pos) /*!< ACMP_T::CTL: WCMPSEL Mask */ - -#define ACMP_STATUS_ACMPIF0_Pos (0) /*!< ACMP_T::STATUS: ACMPIF0 Position */ -#define ACMP_STATUS_ACMPIF0_Msk (0x1ul << ACMP_STATUS_ACMPIF0_Pos) /*!< ACMP_T::STATUS: ACMPIF0 Mask */ - -#define ACMP_STATUS_ACMPIF1_Pos (1) /*!< ACMP_T::STATUS: ACMPIF1 Position */ -#define ACMP_STATUS_ACMPIF1_Msk (0x1ul << ACMP_STATUS_ACMPIF1_Pos) /*!< ACMP_T::STATUS: ACMPIF1 Mask */ - -#define ACMP_STATUS_ACMPO0_Pos (4) /*!< ACMP_T::STATUS: ACMPO0 Position */ -#define ACMP_STATUS_ACMPO0_Msk (0x1ul << ACMP_STATUS_ACMPO0_Pos) /*!< ACMP_T::STATUS: ACMPO0 Mask */ - -#define ACMP_STATUS_ACMPO1_Pos (5) /*!< ACMP_T::STATUS: ACMPO1 Position */ -#define ACMP_STATUS_ACMPO1_Msk (0x1ul << ACMP_STATUS_ACMPO1_Pos) /*!< ACMP_T::STATUS: ACMPO1 Mask */ - -#define ACMP_STATUS_WKIF0_Pos (8) /*!< ACMP_T::STATUS: WKIF0 Position */ -#define ACMP_STATUS_WKIF0_Msk (0x1ul << ACMP_STATUS_WKIF0_Pos) /*!< ACMP_T::STATUS: WKIF0 Mask */ - -#define ACMP_STATUS_WKIF1_Pos (9) /*!< ACMP_T::STATUS: WKIF1 Position */ -#define ACMP_STATUS_WKIF1_Msk (0x1ul << ACMP_STATUS_WKIF1_Pos) /*!< ACMP_T::STATUS: WKIF1 Mask */ - -#define ACMP_STATUS_ACMPS0_Pos (12) /*!< ACMP_T::STATUS: ACMPS0 Position */ -#define ACMP_STATUS_ACMPS0_Msk (0x1ul << ACMP_STATUS_ACMPS0_Pos) /*!< ACMP_T::STATUS: ACMPS0 Mask */ - -#define ACMP_STATUS_ACMPS1_Pos (13) /*!< ACMP_T::STATUS: ACMPS1 Position */ -#define ACMP_STATUS_ACMPS1_Msk (0x1ul << ACMP_STATUS_ACMPS1_Pos) /*!< ACMP_T::STATUS: ACMPS1 Mask */ - -#define ACMP_STATUS_ACMPWO_Pos (16) /*!< ACMP_T::STATUS: ACMPWO Position */ -#define ACMP_STATUS_ACMPWO_Msk (0x1ul << ACMP_STATUS_ACMPWO_Pos) /*!< ACMP_T::STATUS: ACMPWO Mask */ - -#define ACMP_VREF_CRVCTL_Pos (0) /*!< ACMP_T::VREF: CRVCTL Position */ -#define ACMP_VREF_CRVCTL_Msk (0xful << ACMP_VREF_CRVCTL_Pos) /*!< ACMP_T::VREF: CRVCTL Mask */ - -#define ACMP_VREF_CRVSSEL_Pos (6) /*!< ACMP_T::VREF: CRVSSEL Position */ -#define ACMP_VREF_CRVSSEL_Msk (0x1ul << ACMP_VREF_CRVSSEL_Pos) /*!< ACMP_T::VREF: CRVSSEL Mask */ - -#define ACMP_CALCTL_CALTRG0_Pos (0) /*!< ACMP_T::CALCTL: CALTRG0 Position */ -#define ACMP_CALCTL_CALTRG0_Msk (0x1ul << ACMP_CALCTL_CALTRG0_Pos) /*!< ACMP_T::CALCTL: CALTRG0 Mask */ - -#define ACMP_CALCTL_CALTRG1_Pos (1) /*!< ACMP_T::CALCTL: CALTRG1 Position */ -#define ACMP_CALCTL_CALTRG1_Msk (0x1ul << ACMP_CALCTL_CALTRG1_Pos) /*!< ACMP_T::CALCTL: CALTRG1 Mask */ - -#define ACMP_CALCTL_CALCLK0_Pos (4) /*!< ACMP_T::CALCTL: CALCLK0 Position */ -#define ACMP_CALCTL_CALCLK0_Msk (0x3ul << ACMP_CALCTL_CALCLK0_Pos) /*!< ACMP_T::CALCTL: CALCLK0 Mask */ - -#define ACMP_CALCTL_CALCLK1_Pos (6) /*!< ACMP_T::CALCTL: CALCLK1 Position */ -#define ACMP_CALCTL_CALCLK1_Msk (0x3ul << ACMP_CALCTL_CALCLK1_Pos) /*!< ACMP_T::CALCTL: CALCLK1 Mask */ - -#define ACMP_CALCTL_CALRVS0_Pos (16) /*!< ACMP_T::CALCTL: CALRVS0 Position */ -#define ACMP_CALCTL_CALRVS0_Msk (0x1ul << ACMP_CALCTL_CALRVS0_Pos) /*!< ACMP_T::CALCTL: CALRVS0 Mask */ - -#define ACMP_CALCTL_CALRVS1_Pos (17) /*!< ACMP_T::CALCTL: CALRVS1 Position */ -#define ACMP_CALCTL_CALRVS1_Msk (0x1ul << ACMP_CALCTL_CALRVS1_Pos) /*!< ACMP_T::CALCTL: CALRVS1 Mask */ - -#define ACMP_CALSR_DONE0_Pos (0) /*!< ACMP_T::CALSR: DONE0 Position */ -#define ACMP_CALSR_DONE0_Msk (0x1ul << ACMP_CALSR_DONE0_Pos) /*!< ACMP_T::CALSR: DONE0 Mask */ - -#define ACMP_CALSR_CALNS0_Pos (1) /*!< ACMP_T::CALSR: CALNS0 Position */ -#define ACMP_CALSR_CALNS0_Msk (0x1ul << ACMP_CALSR_CALNS0_Pos) /*!< ACMP_T::CALSR: CALNS0 Mask */ - -#define ACMP_CALSR_CALPS0_Pos (2) /*!< ACMP_T::CALSR: CALPS0 Position */ -#define ACMP_CALSR_CALPS0_Msk (0x1ul << ACMP_CALSR_CALPS0_Pos) /*!< ACMP_T::CALSR: CALPS0 Mask */ - -#define ACMP_CALSR_DONE1_Pos (4) /*!< ACMP_T::CALSR: DONE1 Position */ -#define ACMP_CALSR_DONE1_Msk (0x1ul << ACMP_CALSR_DONE1_Pos) /*!< ACMP_T::CALSR: DONE1 Mask */ - -#define ACMP_CALSR_CALNS1_Pos (5) /*!< ACMP_T::CALSR: CALNS1 Position */ -#define ACMP_CALSR_CALNS1_Msk (0x1ul << ACMP_CALSR_CALNS1_Pos) /*!< ACMP_T::CALSR: CALNS1 Mask */ - -#define ACMP_CALSR_CALPS1_Pos (6) /*!< ACMP_T::CALSR: CALPS1 Position */ -#define ACMP_CALSR_CALPS1_Msk (0x1ul << ACMP_CALSR_CALPS1_Pos) /*!< ACMP_T::CALSR: CALPS1 Mask */ - -/**@}*/ /* ACMP_CONST */ -/**@}*/ /* end of ACMP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __ACMP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/adc_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/adc_reg.h deleted file mode 100644 index 77cd67586ae..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/adc_reg.h +++ /dev/null @@ -1,400 +0,0 @@ -/**************************************************************************//** - * @file adc_reg.h - * @version V1.00 - * @brief ADC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ADC_REG_H__ -#define __ADC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ADC Analog to Digital Converter (ADC) - Memory Mapped Structure for ADC Controller -@{ */ - -typedef struct -{ - - - /** - * @var ADC_T::ADDR - * Offset: 0x00-0x74 ADC Data Register 0-29 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RSLT |A/D Conversion Result (Read Only) - * | | |This field contains conversion result of ADC. - * |[16] |OVERRUN |Overrun Flag (Read Only) - * | | |If converted data in RSLT bits has not been read before new conversion result is loaded to this register, OVERRUN bit is set to 1. It is cleared by hardware after ADDR register is read. - * | | |0 = Data in RSLT bits is not overwrote. - * | | |1 = Data in RSLT bits is overwrote. - * |[17] |VALID |Valid Flag (Read Only) - * | | |This bit will be set to 1 when the conversion of the corresponding channel is completed. This bit will be cleared to 0 by hardware after ADDR register is read. - * | | |0 = Data in RSLT bits is not valid. - * | | |1 = Data in RSLT bits is valid. - * @var ADC_T::ADCR - * Offset: 0x80 ADC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADEN |A/D Converter Enable Bit - * | | |0 = A/D converter Disabled. - * | | |1 = A/D converter Enabled. - * | | |Note: Before starting A/D conversion function, this bit should be set to 1. Clear it to 0 to disable A/D converter analog circuit to save power consumption. - * |[1] |ADIE |A/D Interrupt Enable Bit - * | | |A/D conversion end interrupt request is generated if ADIE bit is set to 1. - * | | |0 = A/D interrupt function Disabled. - * | | |1 = A/D interrupt function Enabled. - * |[3:2] |ADMD |A/D Converter Operation Mode Control - * | | |00 = Single conversion. - * | | |01 = Burst conversion. - * | | |10 = Single-cycle Scan. - * | | |11 = Continuous Scan. - * | | |Note1: When changing the operation mode, software should clear ADST bit first. - * | | |Note2: In Burst mode, the A/D result data is always at ADC Data Register 0. - * |[5:4] |TRGS |Hardware Trigger Source - * | | |00 = A/D conversion is started by external STADC pin. - * | | |01 = Timer0 ~ Timer3 overflow pulse trigger. - * | | |10 = Reserved. - * | | |11 = A/D conversion is started by PWM trigger. - * | | |Note: Software should clear TRGEN bit and ADST bit to 0 before changing TRGS bits. - * |[7:6] |TRGCOND |External Trigger Condition - * | | |These two bits decide external pin STADC trigger event is level or edge. The signal must be kept at stable state at least 8 PCLKs for level trigger and at least 4 PCLKs for edge trigger. - * | | |00 = Low level. - * | | |01 = High level. - * | | |10 = Falling edge. - * | | |11 = Rising edge. - * |[8] |TRGEN |External Trigger Enable Bit - * | | |Enable or disable triggering of A/D conversion by external STADC pin, PWM trigger and Timer trigger. If external trigger is enabled, the ADST bit can be set to 1 by the selected hardware trigger source. - * | | |0 = External trigger Disabled. - * | | |1 = External trigger Enabled. - * | | |Note: The ADC external trigger function is only supported in Single-cycle Scan mode. - * |[9] |PTEN |PDMA Transfer Enable Bit - * | | |When A/D conversion is completed, the converted data is loaded into ADDR0~15, ADDR29. Software can enable this bit to generate a PDMA data transfer request. - * | | |0 = PDMA data transfer Disabled. - * | | |1 = PDMA data transfer in ADDR0~15, ADDR29 Enabled. - * | | |Note: When PTEN=1, software must set ADIE=0 to disable interrupt. - * |[10] |DIFFEN |Differential Input Mode Control - * | | |Differential input voltage (Vdiff) = Vplus - Vminus. - * | | |The relation between Vplus and Vminus is Vplus + Vminus = Vref. - * | | |The Vplus of differential input paired channel x is from ADC0_CHy pin; Vminus is from ADC0_CHz pin, x=0,1..7, y=2*x, z=y+1. - * | | |0 = Single-end analog input mode. - * | | |1 = Differential analog input mode. - * | | |Note: In Differential Input mode, only the even number of the two corresponding channels needs to be enabled in ADCHER register. The conversion result will be placed to the corresponding data register of the enabled channel. - * |[11] |ADST |A/D Conversion Start or Calibration Start - * | | |ADST bit can be set to 1 from four sources: software, external pin STADC, PWM trigger and Timer trigger. ADST bit will be cleared to 0 by hardware automatically at the ends of Single mode, Single-cycle Scan mode and Calibration mode. In Continuous Scan mode and Burst mode, A/D conversion is continuously performed until software writes 0 to this bit or chip is reset. - * | | |0 = Conversion stops and A/D converter enters idle state. - * | | |1 = Conversion starts or Calibration Start. - * | | |Note1: When ADST become from 1 to 0, ADC macro will reset to initial state. After macro reset to initial state, user should wait at most 2 ADC clock and set this bit to start next conversion. - * | | |Note2: Calibration Start only if CALEN (ADC_ADCALR[0]) = 1. - * |[12] |RESET |ADC RESET (Write Protect) - * | | |If user writes this bit, the ADC analog macro will reset - * | | |Calibration data in macro will be deleted, but registers in ADC controller will keep. - * | | |Note: This bit is cleared by hardware. - * |[31] |DMOF |Differential Input Mode Output Format - * | | |If user enables differential input mode, the conversion result can be expressed with binary straight format (unsigned format) or 2's complement format (signed format). - * | | |0 = A/D Conversion result will be filled in RSLT at ADDRx registers with unsigned format (straight binary format). - * | | |1 = A/D Conversion result will be filled in RSLT at ADDRx registers with 2's complement format. - * @var ADC_T::ADCHER - * Offset: 0x84 ADC Channel Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CHEN |Analog Input Channel Enable Control - * | | |Set ADCHER[15:0] bits to enable the corresponding analog input channel 15 ~ 0 - * | | |If DIFFEN bit is set to 1, only the even number channel needs to be enabled. - * | | |Besides, set ADCHER[29] bit will enable internal channel for band-gap voltage respectively - * | | |Other bits are reserved. - * | | |0 = Channel Disabled. - * | | |1 = Channel Enabled. - * | | |Note1: If the internal channel for band-gap voltage (CHEN[29]) is active, the maximum sampling rate will be 1M SPS. - * @var ADC_T::ADCMPR - * Offset: 0x88/0x8C ADC Compare Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CMPEN |Compare Enable Bit - * | | |Set this bit to 1 to enable ADC controller to compare CMPD (ADCMPRx[27:16]) with specified channel conversion result when converted data is loaded into ADDR register. - * | | |0 = Compare function Disabled. - * | | |1 = Compare function Enabled. - * |[1] |CMPIE |Compare Interrupt Enable Bit - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND and CMPMATCNT, CMPFx bit will be asserted, in the meanwhile, if CMPIE bit is set to 1, a compare interrupt request is generated. - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * |[2] |CMPCOND |Compare Condition - * | | |0 = Set the compare condition as that when a 12-bit A/D conversion result is less than the 12-bit CMPD bits, the internal match counter will increase one. - * | | |1 = Set the compare condition as that when a 12-bit A/D conversion result is greater than or equal to the 12-bit CMPD bits, the internal match counter will increase one. - * | | |Note: When the internal counter reaches to (CMPMATCNT +1), the CMPFx bit will be set. - * |[7:3] |CMPCH |Compare Channel Selection - * | | |00000 = Channel 0 conversion result is selected to be compared. - * | | |00001 = Channel 1 conversion result is selected to be compared. - * | | |00010 = Channel 2 conversion result is selected to be compared. - * | | |00011 = Channel 3 conversion result is selected to be compared. - * | | |00100 = Channel 4 conversion result is selected to be compared. - * | | |00101 = Channel 5 conversion result is selected to be compared. - * | | |00110 = Channel 6 conversion result is selected to be compared. - * | | |00111 = Channel 7 conversion result is selected to be compared. - * | | |01000 = Channel 8 conversion result is selected to be compared. - * | | |01001 = Channel 9 conversion result is selected to be compared. - * | | |01010 = Channel 10 conversion result is selected to be compared. - * | | |01011 = Channel 11 conversion result is selected to be compared. - * | | |01100 = Channel 12 conversion result is selected to be compared. - * | | |01101 = Channel 13 conversion result is selected to be compared. - * | | |01110 = Channel 14 conversion result is selected to be compared. - * | | |01111 = Channel 15 conversion result is selected to be compared. - * | | |11101 = Band-gap voltage conversion result is selected to be compared. - * | | |Others = Reserved. - * |[11:8] |CMPMATCNT |Compare Match Count - * | | |When the specified A/D channel analog conversion result matches the compare condition defined by CMPCOND bit, the internal match counter will increase 1. When the internal counter reaches the value to (CMPMATCNT +1), the CMPFx bit will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = Compare Window Mode Disabled. - * | | |1 = Compare Window Mode Enabled. - * | | |Note: This bit is only presented in ADCMPR0 register. - * |[27:16] |CMPD |Comparison Data - * | | |The 12-bit data is used to compare with conversion result of specified channel. - * | | |Note: CMPD bits should be filled in unsigned format (straight binary format). - * @var ADC_T::ADSR0 - * Offset: 0x90 ADC Status Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADF |A/D Conversion End Flag - * | | |A status flag that indicates the end of A/D conversion. Software can write 1 to clear this bit. - * | | |ADF bit is set to 1 at the following three conditions: - * | | |1. When A/D conversion ends in Single mode. - * | | |2. When A/D conversion ends on all specified channels in Single-cycle Scan mode and Continuous Scan mode. - * | | |3. When more than or equal to 8 samples in FIFO in Burst mode. - * |[1] |CMPF0 |Compare Flag 0 - * | | |When the A/D conversion result of the selected channel meets setting condition in ADCMPR0 register then this bit is set to 1. This bit is cleared by writing 1 to it. - * | | |0 = Conversion result in ADDR does not meet ADCMPR0 setting. - * | | |1 = Conversion result in ADDR meets ADCMPR0 setting. - * |[2] |CMPF1 |Compare Flag 1 - * | | |When the A/D conversion result of the selected channel meets setting condition in ADCMPR1 register then this bit is set to 1; it is cleared by writing 1 to it. - * | | |0 = Conversion result in ADDR does not meet ADCMPR1 setting. - * | | |1 = Conversion result in ADDR meets ADCMPR1 setting. - * |[7] |BUSY |BUSY/IDLE (Read Only) - * | | |This bit is a mirror of ADST bit in ADCR register. - * | | |0 = A/D converter is in idle state. - * | | |1 = A/D converter is busy at conversion. - * |[8] |VALIDF |Data Valid Flag (Read Only) - * | | |If any one of VALID (ADDRx[17]) is set, this flag will be set to 1. - * | | |Note: When ADC is in burst mode and any conversion result is valid, this flag will be set to 1. - * |[16] |OVERRUNF |Overrun Flag (Read Only) - * | | |If any one of OVERRUN (ADDRx[16]) is set, this flag will be set to 1. - * | | |Note: When ADC is in burst mode and the FIFO is overrun, this flag will be set to 1. - * |[31:27] |CHANNEL |Current Conversion Channel (Read Only) - * | | |When BUSY=1, this filed reflects current conversion channel. When BUSY=0, it shows the number of the next converted channel. - * @var ADC_T::ADSR1 - * Offset: 0x94 ADC Status Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VALID |Data Valid Flag (Read Only) - * | | |VALID[29, 15:0] are the mirror of the VALID bits in ADDR29[17], ADDR15[17]~ ADDR0[17]. The other bits are reserved. - * | | |Note: When ADC is in burst mode and any conversion result is valid, VALID[29, 15:0] will be set to 1. - * @var ADC_T::ADSR2 - * Offset: 0x98 ADC Status Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |OVERRUN |Overrun Flag (Read Only) - * | | |OVERRUN[29, 15:0] are the mirror of the OVERRUN bit in ADDR29[16], ADDR15[16] ~ ADDR0[16]. The other bits are reserved. - * | | |Note: When ADC is in burst mode and the FIFO is overrun, OVERRUN[29, 15:0] will be set to 1. - * @var ADC_T::ESMPCTL - * Offset: 0xA0 ADC Extend Sample Time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |EXTSMPT |ADC Sampling Time Extend - * | | |When ADC converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, user can extend ADC sampling time after trigger source is coming to get enough sampling time. - * | | |The range of start delay time is from 0~255 ADC clock. - * @var ADC_T::ADPDMA - * Offset: 0x100 ADC PDMA Current Transfer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |CURDAT |ADC PDMA Current Transfer Data Register (Read Only) - * | | |When PDMA transferring, read this register can monitor current PDMA transfer data. - * | | |Current PDMA transfer data could be the content of ADDR0 ~ ADDR15 and ADDR29 registers. - * @var ADC_T::ADCALR - * Offset: 0x180 ADC Calibration Mode Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CALEN |Calibration Function Enable Bit - * | | |0 = Calibration function Disable. - * | | |1 = Calibration function Enable. - * | | |Note: If chip power off, calibration function should be executed again. - * |[1] |CALIE |Calibration Interrupt Enable - * | | |If calibration function is enabled and the calibration finish, CALIF bit will be asserted, in the meanwhile, if CALIE bit is set to 1, a calibration interrupt request is generated. - * | | |0 = Calibration function Interrupt Disable. - * | | |1 = Calibration function Interrupt Enable. - * @var ADC_T::ADCALSTSR - * Offset: 0x184 ADC Calibration Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CALIF |Calibration Finish Interrupt Flag - * | | |If calibration finish, this flag will be set to 1. It is cleared by writing 1 to it. - */ - __I uint32_t ADDR[30]; /*!< [0x0000-0x0074] ADC Data Register 0 ~ 29 */ - __I uint32_t RESERVE1[2]; - __IO uint32_t ADCR; /*!< [0x0080] ADC Control Register */ - __IO uint32_t ADCHER; /*!< [0x0084] ADC Channel Enable Register */ - __IO uint32_t ADCMPR[2]; /*!< [0x0088-0x008c] ADC Compare Register 0/1 */ - __IO uint32_t ADSR0; /*!< [0x0090] ADC Status Register0 */ - __I uint32_t ADSR1; /*!< [0x0094] ADC Status Register1 */ - __I uint32_t ADSR2; /*!< [0x0098] ADC Status Register2 */ - __I uint32_t RESERVE2[1]; - __IO uint32_t ESMPCTL; /*!< [0x00a0] ADC Extend Sample Time Control Register */ - __IO uint32_t CFDCTL; /*!< [0x00a4] ADC Channel Floating Detect Control Register */ - __I uint32_t RESERVE3[22]; - __I uint32_t ADPDMA; /*!< [0x0100] ADC PDMA Current Transfer Data Register */ - __I uint32_t RESERVE4[31]; - __IO uint32_t ADCALR; /*!< [0x0180] ADC Calibration Mode Register */ - __IO uint32_t ADCALSTSR; /*!< [0x0184] ADC Calibration Status Register */ - __IO uint32_t ADCALDBR; /*!< [0x0188] ADC Calibration Debug Mode Register */ -} ADC_T; - -/** - @addtogroup ADC_CONST ADC Bit Field Definition - Constant Definitions for ADC Controller -@{ */ - -#define ADC_ADDR_RSLT_Pos (0) /*!< ADC_T::ADDR: RSLT Position */ -#define ADC_ADDR_RSLT_Msk (0xfffful << ADC_ADDR_RSLT_Pos) /*!< ADC_T::ADDR: RSLT Mask */ - -#define ADC_ADDR_OVERRUN_Pos (16) /*!< ADC_T::ADDR: OVERRUN Position */ -#define ADC_ADDR_OVERRUN_Msk (0x1ul << ADC_ADDR_OVERRUN_Pos) /*!< ADC_T::ADDR: OVERRUN Mask */ - -#define ADC_ADDR_VALID_Pos (17) /*!< ADC_T::ADDR: VALID Position */ -#define ADC_ADDR_VALID_Msk (0x1ul << ADC_ADDR_VALID_Pos) /*!< ADC_T::ADDR: VALID Mask */ - -#define ADC_ADCR_ADEN_Pos (0) /*!< ADC_T::ADCR: ADEN Position */ -#define ADC_ADCR_ADEN_Msk (0x1ul << ADC_ADCR_ADEN_Pos) /*!< ADC_T::ADCR: ADEN Mask */ - -#define ADC_ADCR_ADIE_Pos (1) /*!< ADC_T::ADCR: ADIE Position */ -#define ADC_ADCR_ADIE_Msk (0x1ul << ADC_ADCR_ADIE_Pos) /*!< ADC_T::ADCR: ADIE Mask */ - -#define ADC_ADCR_ADMD_Pos (2) /*!< ADC_T::ADCR: ADMD Position */ -#define ADC_ADCR_ADMD_Msk (0x3ul << ADC_ADCR_ADMD_Pos) /*!< ADC_T::ADCR: ADMD Mask */ - -#define ADC_ADCR_TRGS_Pos (4) /*!< ADC_T::ADCR: TRGS Position */ -#define ADC_ADCR_TRGS_Msk (0x3ul << ADC_ADCR_TRGS_Pos) /*!< ADC_T::ADCR: TRGS Mask */ - -#define ADC_ADCR_TRGCOND_Pos (6) /*!< ADC_T::ADCR: TRGCOND Position */ -#define ADC_ADCR_TRGCOND_Msk (0x3ul << ADC_ADCR_TRGCOND_Pos) /*!< ADC_T::ADCR: TRGCOND Mask */ - -#define ADC_ADCR_TRGEN_Pos (8) /*!< ADC_T::ADCR: TRGEN Position */ -#define ADC_ADCR_TRGEN_Msk (0x1ul << ADC_ADCR_TRGEN_Pos) /*!< ADC_T::ADCR: TRGEN Mask */ - -#define ADC_ADCR_PTEN_Pos (9) /*!< ADC_T::ADCR: PTEN Position */ -#define ADC_ADCR_PTEN_Msk (0x1ul << ADC_ADCR_PTEN_Pos) /*!< ADC_T::ADCR: PTEN Mask */ - -#define ADC_ADCR_DIFFEN_Pos (10) /*!< ADC_T::ADCR: DIFFEN Position */ -#define ADC_ADCR_DIFFEN_Msk (0x1ul << ADC_ADCR_DIFFEN_Pos) /*!< ADC_T::ADCR: DIFFEN Mask */ - -#define ADC_ADCR_ADST_Pos (11) /*!< ADC_T::ADCR: ADST Position */ -#define ADC_ADCR_ADST_Msk (0x1ul << ADC_ADCR_ADST_Pos) /*!< ADC_T::ADCR: ADST Mask */ - -#define ADC_ADCR_RESET_Pos (12) /*!< ADC_T::ADCR: RESET Position */ -#define ADC_ADCR_RESET_Msk (0x1ul << ADC_ADCR_RESET_Pos) /*!< ADC_T::ADCR: RESET Mask */ - -#define ADC_ADCR_DMOF_Pos (31) /*!< ADC_T::ADCR: DMOF Position */ -#define ADC_ADCR_DMOF_Msk (0x1ul << ADC_ADCR_DMOF_Pos) /*!< ADC_T::ADCR: DMOF Mask */ - -#define ADC_ADCHER_CHEN_Pos (0) /*!< ADC_T::ADCHER: CHEN Position */ -#define ADC_ADCHER_CHEN_Msk (0xfffffffful << ADC_ADCHER_CHEN_Pos) /*!< ADC_T::ADCHER: CHEN Mask */ - -#define ADC_ADCMPR_CMPEN_Pos (0) /*!< ADC_T::ADCMPR: CMPEN Position */ -#define ADC_ADCMPR_CMPEN_Msk (0x1ul << ADC_ADCMPR_CMPEN_Pos) /*!< ADC_T::ADCMPR: CMPEN Mask */ - -#define ADC_ADCMPR_CMPIE_Pos (1) /*!< ADC_T::ADCMPR: CMPIE Position */ -#define ADC_ADCMPR_CMPIE_Msk (0x1ul << ADC_ADCMPR_CMPIE_Pos) /*!< ADC_T::ADCMPR: CMPIE Mask */ - -#define ADC_ADCMPR_CMPCOND_Pos (2) /*!< ADC_T::ADCMPR: CMPCOND Position */ -#define ADC_ADCMPR_CMPCOND_Msk (0x1ul << ADC_ADCMPR_CMPCOND_Pos) /*!< ADC_T::ADCMPR: CMPCOND Mask */ - -#define ADC_ADCMPR_CMPCH_Pos (3) /*!< ADC_T::ADCMPR: CMPCH Position */ -#define ADC_ADCMPR_CMPCH_Msk (0x1ful << ADC_ADCMPR_CMPCH_Pos) /*!< ADC_T::ADCMPR: CMPCH Mask */ - -#define ADC_ADCMPR_CMPMATCNT_Pos (8) /*!< ADC_T::ADCMPR: CMPMATCNT Position */ -#define ADC_ADCMPR_CMPMATCNT_Msk (0xful << ADC_ADCMPR_CMPMATCNT_Pos) /*!< ADC_T::ADCMPR: CMPMATCNT Mask */ - -#define ADC_ADCMPR_CMPWEN_Pos (15) /*!< ADC_T::ADCMPR: CMPWEN Position */ -#define ADC_ADCMPR_CMPWEN_Msk (0x1ul << ADC_ADCMPR_CMPWEN_Pos) /*!< ADC_T::ADCMPR: CMPWEN Mask */ - -#define ADC_ADCMPR_CMPD_Pos (16) /*!< ADC_T::ADCMPR: CMPD Position */ -#define ADC_ADCMPR_CMPD_Msk (0xffful << ADC_ADCMPR_CMPD_Pos) /*!< ADC_T::ADCMPR: CMPD Mask */ - -#define ADC_ADSR0_ADF_Pos (0) /*!< ADC_T::ADSR0: ADF Position */ -#define ADC_ADSR0_ADF_Msk (0x1ul << ADC_ADSR0_ADF_Pos) /*!< ADC_T::ADSR0: ADF Mask */ - -#define ADC_ADSR0_CMPF0_Pos (1) /*!< ADC_T::ADSR0: CMPF0 Position */ -#define ADC_ADSR0_CMPF0_Msk (0x1ul << ADC_ADSR0_CMPF0_Pos) /*!< ADC_T::ADSR0: CMPF0 Mask */ - -#define ADC_ADSR0_CMPF1_Pos (2) /*!< ADC_T::ADSR0: CMPF1 Position */ -#define ADC_ADSR0_CMPF1_Msk (0x1ul << ADC_ADSR0_CMPF1_Pos) /*!< ADC_T::ADSR0: CMPF1 Mask */ - -#define ADC_ADSR0_BUSY_Pos (7) /*!< ADC_T::ADSR0: BUSY Position */ -#define ADC_ADSR0_BUSY_Msk (0x1ul << ADC_ADSR0_BUSY_Pos) /*!< ADC_T::ADSR0: BUSY Mask */ - -#define ADC_ADSR0_VALIDF_Pos (8) /*!< ADC_T::ADSR0: VALIDF Position */ -#define ADC_ADSR0_VALIDF_Msk (0x1ul << ADC_ADSR0_VALIDF_Pos) /*!< ADC_T::ADSR0: VALIDF Mask */ - -#define ADC_ADSR0_OVERRUNF_Pos (16) /*!< ADC_T::ADSR0: OVERRUNF Position */ -#define ADC_ADSR0_OVERRUNF_Msk (0x1ul << ADC_ADSR0_OVERRUNF_Pos) /*!< ADC_T::ADSR0: OVERRUNF Mask */ - -#define ADC_ADSR0_CHANNEL_Pos (27) /*!< ADC_T::ADSR0: CHANNEL Position */ -#define ADC_ADSR0_CHANNEL_Msk (0x1ful << ADC_ADSR0_CHANNEL_Pos) /*!< ADC_T::ADSR0: CHANNEL Mask */ - -#define ADC_ADSR1_VALID_Pos (0) /*!< ADC_T::ADSR1: VALID Position */ -#define ADC_ADSR1_VALID_Msk (0xfffffffful << ADC_ADSR1_VALID_Pos) /*!< ADC_T::ADSR1: VALID Mask */ - -#define ADC_ADSR2_OVERRUN_Pos (0) /*!< ADC_T::ADSR2: OVERRUN Position */ -#define ADC_ADSR2_OVERRUN_Msk (0xfffffffful << ADC_ADSR2_OVERRUN_Pos) /*!< ADC_T::ADSR2: OVERRUN Mask */ - -#define ADC_ESMPCTL_EXTSMPT_Pos (0) /*!< ADC_T::ESMPCTL: EXTSMPT Position */ -#define ADC_ESMPCTL_EXTSMPT_Msk (0xfful << ADC_ESMPCTL_EXTSMPT_Pos) /*!< ADC_T::ESMPCTL: EXTSMPT Mask */ - -#define ADC_CFDCTL_PRECHEN_Pos (0) /*!< ADC_T::CFDCTL: PRECHEN Position */ -#define ADC_CFDCTL_PRECHEN_Msk (0x1ul << ADC_CFDCTL_PRECHEN_Pos) /*!< ADC_T::CFDCTL: PRECHEN Mask */ - -#define ADC_CFDCTL_DISCHEN_Pos (1) /*!< ADC_T::CFDCTL: DISCHEN Position */ -#define ADC_CFDCTL_DISCHEN_Msk (0x1ul << ADC_CFDCTL_DISCHEN_Pos) /*!< ADC_T::CFDCTL: DISCHEN Mask */ - -#define ADC_CFDCTL_FDETCHEN_Pos (8) /*!< ADC_T::CFDCTL: FDETCHEN Position */ -#define ADC_CFDCTL_FDETCHEN_Msk (0x1ul << ADC_CFDCTL_FDETCHEN_Pos) /*!< ADC_T::CFDCTL: FDETCHEN Mask */ - -#define ADC_ADPDMA_CURDAT_Pos (0) /*!< ADC_T::ADPDMA: CURDAT Position */ -#define ADC_ADPDMA_CURDAT_Msk (0x3fffful << ADC_ADPDMA_CURDAT_Pos) /*!< ADC_T::ADPDMA: CURDAT Mask */ - -#define ADC_ADCALR_CALEN_Pos (0) /*!< ADC_T::ADCALR: CALEN Position */ -#define ADC_ADCALR_CALEN_Msk (0x1ul << ADC_ADCALR_CALEN_Pos) /*!< ADC_T::ADCALR: CALEN Mask */ - -#define ADC_ADCALR_CALIE_Pos (1) /*!< ADC_T::ADCALR: CALIE Position */ -#define ADC_ADCALR_CALIE_Msk (0x1ul << ADC_ADCALR_CALIE_Pos) /*!< ADC_T::ADCALR: CALIE Mask */ - -#define ADC_ADCALSTSR_CALIF_Pos (0) /*!< ADC_T::ADCALSTSR: CALIF Position */ -#define ADC_ADCALSTSR_CALIF_Msk (0x1ul << ADC_ADCALSTSR_CALIF_Pos) /*!< ADC_T::ADCALSTSR: CALIF Mask */ - -/**@}*/ /* ADC_CONST */ -/**@}*/ /* end of ADC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __ADC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/bpwm_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/bpwm_reg.h deleted file mode 100644 index 25bcede03af..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/bpwm_reg.h +++ /dev/null @@ -1,1743 +0,0 @@ -/**************************************************************************//** - * @file bpwm_reg.h - * @version V1.00 - * @brief BPWM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __BPWM_REG_H__ -#define __BPWM_REG_H__ - - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup BPWM Basic Pulse Width Modulation Controller (BPWM) - Memory Mapped Structure for BPWM Controller -@{ */ -typedef struct -{ - /** - * @var BCAPDAT_T::RCAPDAT - * Offset: 0x20C~0x238 BPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |BPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the BPWM counter value will be saved in this register. - * @var BCAPDAT_T::FCAPDAT - * Offset: 0x210 BPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |BPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the BPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] BPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] BPWM Falling Capture Data Register 0~5 */ -} BCAPDAT_T; - -typedef struct -{ - - - /** - * @var BPWM_T::CTL0 - * Offset: 0x00 BPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[1] |CTRLD1 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[2] |CTRLD2 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[3] |CTRLD3 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[4] |CTRLD4 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[5] |CTRLD5 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[16] |IMMLDEN0 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, BPWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt Disabled. - * | | |1 = ICE debug mode counter halt Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects BPWM output. - * | | |BPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |BPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var BPWM_T::CTL1 - * Offset: 0x04 BPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |BPWM Counter Behavior Type 0 - * | | |Each bit n controls corresponding BPWM channel n. - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * @var BPWM_T::CLKSRC - * Offset: 0x10 BPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |BPWM_CH01 External Clock Source Select - * | | |000 = BPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var BPWM_T::CLKPSC - * Offset: 0x14 BPWM Clock Prescale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |BPWM Counter Clock Prescale - * | | |The clock of BPWM counter is decided by clock prescaler - * | | |Each BPWM pair share one BPWM counter clock prescaler - * | | |The clock of BPWM counter is divided by (CLKPSC+ 1) - * @var BPWM_T::CNTEN - * Offset: 0x20 BPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |BPWM Counter 0 Enable Bit - * | | |0 = BPWM Counter and clock prescaler stop running. - * | | |1 = BPWM Counter and clock prescaler start running. - * @var BPWM_T::CNTCLR - * Offset: 0x24 BPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear BPWM Counter Control Bit 0 - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit BPWM counter to 0000H. - * @var BPWM_T::PERIOD - * Offset: 0x30 BPWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |BPWM Period Register - * | | |Up-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |Down-Count mode: In this mode, BPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |BPWM period time = (PERIOD+1) * BPWM_CLK period. - * | | |Up-Down-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |BPWM period time = 2 * PERIOD * BPWM_CLK period. - * @var BPWM_T::CMPDAT[6] - * Offset: 0x50~0x64 BPWM Comparator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPDAT |BPWM Comparator Register - * | | |CMPDAT use to compare with CNTR to generate BPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 denote as 6 independent BPWM_CH0~5 compared point. - * @var BPWM_T::CNT - * Offset: 0x90 BPWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |BPWM Data Register (Read Only) - * | | |User can monitor CNTR to know the current value in 16-bit period counter. - * |[16] |DIRF |BPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is Down count. - * | | |1 = Counter is UP count. - * @var BPWM_T::WGCTL0 - * Offset: 0xB0 BPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[3:2] |ZPCTL1 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[5:4] |ZPCTL2 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[7:6] |ZPCTL3 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[9:8] |ZPCTL4 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[11:10] |ZPCTL5 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[17:16] |PRDPCTL0 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * @var BPWM_T::WGCTL1 - * Offset: 0xB4 BPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[3:2] |CMPUCTL1 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[5:4] |CMPUCTL2 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[7:6] |CMPUCTL3 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[9:8] |CMPUCTL4 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[11:10] |CMPUCTL5 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[17:16] |CMPDCTL0 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[19:18] |CMPDCTL1 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[21:20] |CMPDCTL2 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[23:22] |CMPDCTL3 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[25:24] |CMPDCTL4 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[27:26] |CMPDCTL5 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * @var BPWM_T::MSKEN - * Offset: 0xB8 BPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[1] |MSKEN1 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[2] |MSKEN2 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[3] |MSKEN3 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[4] |MSKEN4 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[5] |MSKEN5 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * @var BPWM_T::MSK - * Offset: 0xBC BPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[1] |MSKDAT1 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[2] |MSKDAT2 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[3] |MSKDAT3 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[4] |MSKDAT4 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[5] |MSKDAT5 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * @var BPWM_T::POLCTL - * Offset: 0xD4 BPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[1] |PINV1 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[2] |PINV2 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[3] |PINV3 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[4] |PINV4 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[5] |PINV5 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * @var BPWM_T::POEN - * Offset: 0xD8 BPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[1] |POEN1 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[2] |POEN2 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[3] |POEN3 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[4] |POEN4 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[5] |POEN5 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * @var BPWM_T::INTEN - * Offset: 0xE0 BPWM Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |BPWM Zero Point Interrupt 0 Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * |[8] |PIEN0 |BPWM Period Point Interrupt 0 Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When up-down counter type period point means center point. - * |[16] |CMPUIEN0 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[17] |CMPUIEN1 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[18] |CMPUIEN2 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[19] |CMPUIEN3 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[20] |CMPUIEN4 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[21] |CMPUIEN5 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[24] |CMPDIEN0 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[25] |CMPDIEN1 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[26] |CMPDIEN2 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[27] |CMPDIEN3 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[28] |CMPDIEN4 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[29] |CMPDIEN5 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * @var BPWM_T::INTSTS - * Offset: 0xE8 BPWM Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |BPWM Zero Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches 0, software can write 1 to clear this bit to 0. - * |[8] |PIF0 |BPWM Period Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches BPWM_PERIOD0, software can write 1 to clear this bit to 0. - * |[16] |CMPUIF0 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[17] |CMPUIF1 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[18] |CMPUIF2 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[19] |CMPUIF3 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[20] |CMPUIF4 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[21] |CMPUIF5 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[24] |CMPDIF0 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[25] |CMPDIF1 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[26] |CMPDIF2 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[27] |CMPDIF3 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[28] |CMPDIF4 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[29] |CMPDIF5 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * @var BPWM_T::EADCTS0 - * Offset: 0xF8 BPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |BPWM_CH0 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN0 |BPWM_CH0 Trigger EADC Enable Bit - * |[11:8] |TRGSEL1 |BPWM_CH1 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN1 |BPWM_CH1 Trigger EADC Enable Bit - * |[19:16] |TRGSEL2 |BPWM_CH2 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved - * |[23] |TRGEN2 |BPWM_CH2 Trigger EADC Enable Bit - * |[27:24] |TRGSEL3 |BPWM_CH3 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved. - * |[31] |TRGEN3 |BPWM_CH3 Trigger EADC Enable Bit - * @var BPWM_T::EADCTS1 - * Offset: 0xFC BPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |BPWM_CH4 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN4 |BPWM_CH4 Trigger EADC Enable Bit - * |[11:8] |TRGSEL5 |BPWM_CH5 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN5 |BPWM_CH5 Trigger EADC Enable Bit - * @var BPWM_T::SSCTL - * Offset: 0x110 BPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |BPWM Synchronous Start Function 0 Enable Bit - * | | |When synchronous start function is enabled, the BPWM_CH0 counter enable bit (CNTEN0) can be enabled by writing BPWM synchronous start trigger bit (CNTSEN). - * | | |0 = BPWM synchronous start function Disabled. - * | | |1 = BPWM synchronous start function Enabled. - * |[9:8] |SSRC |BPWM Synchronous Start Source Select - * | | |00 = Synchronous start source come from PWM0. - * | | |01 = Synchronous start source come from PWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var BPWM_T::SSTRG - * Offset: 0x114 BPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |BPWM Counter Synchronous Start Enable Bit(Write Only) - * | | |BPMW counter synchronous enable function is used to make PWM or BPWM channels start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit if correlated BPWM channel counter synchronous start function is enabled. - * @var BPWM_T::STATUS - * Offset: 0x120 BPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAX0 |Time-base Counter 0 Equal to 0xFFFF Latched Status - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. Software can write 1 to clear this bit. - * |[16] |EADCTRG0 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. Software can write 1 to clear this bit. - * |[17] |EADCTRG1 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. Software can write 1 to clear this bit. - * |[18] |EADCTRG2 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. Software can write 1 to clear this bit. - * |[19] |EADCTRG3 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. Software can write 1 to clear this bit. - * |[20] |EADCTRG4 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. Software can write 1 to clear this bit. - * |[21] |EADCTRG5 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. Software can write 1 to clear this bit. - * @var BPWM_T::CAPINEN - * Offset: 0x200 BPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * @var BPWM_T::CAPCTL - * Offset: 0x204 BPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var BPWM_T::CAPSTS - * Offset: 0x208 BPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRIFOV0 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[1] |CRIFOV1 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[2] |CRIFOV2 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[3] |CRIFOV3 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[4] |CRIFOV4 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[5] |CRIFOV5 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[8] |CFIFOV0 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[9] |CFIFOV1 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[10] |CFIFOV2 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[11] |CFIFOV3 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[12] |CFIFOV4 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[13] |CFIFOV5 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * @var BPWM_T::CAPIEN - * Offset: 0x250 BPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CAPRIENn |BPWM Capture Rising Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[13:8] |CAPFIENn |BPWM Capture Falling Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var BPWM_T::CAPIF - * Offset: 0x254 BPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIF0 |BPWM Capture Rising Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |CAPRIF1 |BPWM Capture Rising Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[2] |CAPRIF2 |BPWM Capture Rising Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |CAPRIF3 |BPWM Capture Rising Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[4] |CAPRIF4 |BPWM Capture Rising Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[5] |CAPRIF5 |BPWM Capture Rising Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[8] |CAPFIF0 |BPWM Capture Falling Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[9] |CAPFIF1 |BPWM Capture Falling Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[10] |CAPFIF2 |BPWM Capture Falling Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[11] |CAPFIF3 |BPWM Capture Falling Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[12] |CAPFIF4 |BPWM Capture Falling Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * |[13] |CAPFIF5 |BPWM Capture Falling Latch Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: This bit is cleared by writing 1 to it. - * @var BPWM_T::PBUF - * Offset: 0x304 BPWM PERIOD Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |BPWM Period Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var BPWM_T::CMPBUF[6] - * Offset: 0x31C~0x330 BPWM CMPDAT 0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |BPWM Comparator Buffer (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL0; /*!< [0x0000] BPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] BPWM Control Register 1 */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CLKSRC; /*!< [0x0010] BPWM Clock Source Register */ - __IO uint32_t CLKPSC; /*!< [0x0014] BPWM Clock Prescale Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t CNTEN; /*!< [0x0020] BPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] BPWM Clear Counter Register */ - __I uint32_t RESERVE2[2]; - __IO uint32_t PERIOD; /*!< [0x0030] BPWM Period Register */ - __I uint32_t RESERVE3[7]; - __IO uint32_t CMPDAT[6]; /*!< [0x0050 ~ 0x0064] BPWM Comparator Register 0 ~ 6 */ - __I uint32_t RESERVE4[10]; - __I uint32_t CNT; /*!< [0x0090] BPWM Counter Register */ - __I uint32_t RESERVE5[7]; - __IO uint32_t WGCTL0; /*!< [0x00b0] BPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] BPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] BPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] BPWM Mask Data Register */ - __I uint32_t RESERVE6[5]; - __IO uint32_t POLCTL; /*!< [0x00d4] BPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] BPWM Output Enable Register */ - __I uint32_t RESERVE7[1]; - __IO uint32_t INTEN; /*!< [0x00e0] BPWM Interrupt Enable Register */ - __I uint32_t RESERVE8[1]; - __IO uint32_t INTSTS; /*!< [0x00e8] BPWM Interrupt Flag Register */ - __I uint32_t RESERVE9[3]; - __IO uint32_t EADCTS0; /*!< [0x00f8] BPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] BPWM Trigger EADC Source Select Register 1 */ - __I uint32_t RESERVE10[4]; - __IO uint32_t SSCTL; /*!< [0x0110] BPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] BPWM Synchronous Start Trigger Register */ - __I uint32_t RESERVE11[2]; - __IO uint32_t STATUS; /*!< [0x0120] BPWM Status Register */ - __I uint32_t RESERVE12[55]; - __IO uint32_t CAPINEN; /*!< [0x0200] BPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] BPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] BPWM Capture Status Register */ - BCAPDAT_T CAPDAT[6]; /*!< [0x020C ~ 0x0238] BPWM Rising and Falling Capture Data Register 0~5 */ - __I uint32_t RESERVE13[5]; - __IO uint32_t CAPIEN; /*!< [0x0250] BPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] BPWM Capture Interrupt Flag Register */ - __I uint32_t RESERVE14[43]; - __I uint32_t PBUF; /*!< [0x0304] BPWM PERIOD Buffer */ - __I uint32_t RESERVE15[5]; - __I uint32_t CMPBUF[6]; /*!< [0x031c ~ 0x0330] BPWM CMPDAT 0 ~ 5 Buffer */ - -} BPWM_T; - -/** - @addtogroup BPWM_CONST BPWM Bit Field Definition - Constant Definitions for BPWM Controller -@{ */ - -#define BPWM_CTL0_CTRLD0_Pos (0) /*!< BPWM_T::CTL0: CTRLD0 Position */ -#define BPWM_CTL0_CTRLD0_Msk (0x1ul << BPWM_CTL0_CTRLD0_Pos) /*!< BPWM_T::CTL0: CTRLD0 Mask */ - -#define BPWM_CTL0_CTRLD1_Pos (1) /*!< BPWM_T::CTL0: CTRLD1 Position */ -#define BPWM_CTL0_CTRLD1_Msk (0x1ul << BPWM_CTL0_CTRLD1_Pos) /*!< BPWM_T::CTL0: CTRLD1 Mask */ - -#define BPWM_CTL0_CTRLD2_Pos (2) /*!< BPWM_T::CTL0: CTRLD2 Position */ -#define BPWM_CTL0_CTRLD2_Msk (0x1ul << BPWM_CTL0_CTRLD2_Pos) /*!< BPWM_T::CTL0: CTRLD2 Mask */ - -#define BPWM_CTL0_CTRLD3_Pos (3) /*!< BPWM_T::CTL0: CTRLD3 Position */ -#define BPWM_CTL0_CTRLD3_Msk (0x1ul << BPWM_CTL0_CTRLD3_Pos) /*!< BPWM_T::CTL0: CTRLD3 Mask */ - -#define BPWM_CTL0_CTRLD4_Pos (4) /*!< BPWM_T::CTL0: CTRLD4 Position */ -#define BPWM_CTL0_CTRLD4_Msk (0x1ul << BPWM_CTL0_CTRLD4_Pos) /*!< BPWM_T::CTL0: CTRLD4 Mask */ - -#define BPWM_CTL0_CTRLD5_Pos (5) /*!< BPWM_T::CTL0: CTRLD5 Position */ -#define BPWM_CTL0_CTRLD5_Msk (0x1ul << BPWM_CTL0_CTRLD5_Pos) /*!< BPWM_T::CTL0: CTRLD5 Mask */ - -#define BPWM_CTL0_IMMLDEN0_Pos (16) /*!< BPWM_T::CTL0: IMMLDEN0 Position */ -#define BPWM_CTL0_IMMLDEN0_Msk (0x1ul << BPWM_CTL0_IMMLDEN0_Pos) /*!< BPWM_T::CTL0: IMMLDEN0 Mask */ - -#define BPWM_CTL0_IMMLDEN1_Pos (17) /*!< BPWM_T::CTL0: IMMLDEN1 Position */ -#define BPWM_CTL0_IMMLDEN1_Msk (0x1ul << BPWM_CTL0_IMMLDEN1_Pos) /*!< BPWM_T::CTL0: IMMLDEN1 Mask */ - -#define BPWM_CTL0_IMMLDEN2_Pos (18) /*!< BPWM_T::CTL0: IMMLDEN2 Position */ -#define BPWM_CTL0_IMMLDEN2_Msk (0x1ul << BPWM_CTL0_IMMLDEN2_Pos) /*!< BPWM_T::CTL0: IMMLDEN2 Mask */ - -#define BPWM_CTL0_IMMLDEN3_Pos (19) /*!< BPWM_T::CTL0: IMMLDEN3 Position */ -#define BPWM_CTL0_IMMLDEN3_Msk (0x1ul << BPWM_CTL0_IMMLDEN3_Pos) /*!< BPWM_T::CTL0: IMMLDEN3 Mask */ - -#define BPWM_CTL0_IMMLDEN4_Pos (20) /*!< BPWM_T::CTL0: IMMLDEN4 Position */ -#define BPWM_CTL0_IMMLDEN4_Msk (0x1ul << BPWM_CTL0_IMMLDEN4_Pos) /*!< BPWM_T::CTL0: IMMLDEN4 Mask */ - -#define BPWM_CTL0_IMMLDEN5_Pos (21) /*!< BPWM_T::CTL0: IMMLDEN5 Position */ -#define BPWM_CTL0_IMMLDEN5_Msk (0x1ul << BPWM_CTL0_IMMLDEN5_Pos) /*!< BPWM_T::CTL0: IMMLDEN5 Mask */ - -#define BPWM_CTL0_DBGHALT_Pos (30) /*!< BPWM_T::CTL0: DBGHALT Position */ -#define BPWM_CTL0_DBGHALT_Msk (0x1ul << BPWM_CTL0_DBGHALT_Pos) /*!< BPWM_T::CTL0: DBGHALT Mask */ - -#define BPWM_CTL0_DBGTRIOFF_Pos (31) /*!< BPWM_T::CTL0: DBGTRIOFF Position */ -#define BPWM_CTL0_DBGTRIOFF_Msk (0x1ul << BPWM_CTL0_DBGTRIOFF_Pos) /*!< BPWM_T::CTL0: DBGTRIOFF Mask */ - -#define BPWM_CTL1_CNTTYPE0_Pos (0) /*!< BPWM_T::CTL1: CNTTYPE0 Position */ -#define BPWM_CTL1_CNTTYPE0_Msk (0x3ul << BPWM_CTL1_CNTTYPE0_Pos) /*!< BPWM_T::CTL1: CNTTYPE0 Mask */ - -#define BPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< BPWM_T::CLKSRC: ECLKSRC0 Position */ -#define BPWM_CLKSRC_ECLKSRC0_Msk (0x7ul << BPWM_CLKSRC_ECLKSRC0_Pos) /*!< BPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define BPWM_CLKPSC_CLKPSC_Pos (0) /*!< BPWM_T::CLKPSC: CLKPSC Position */ -#define BPWM_CLKPSC_CLKPSC_Msk (0xffful << BPWM_CLKPSC_CLKPSC_Pos) /*!< BPWM_T::CLKPSC: CLKPSC Mask */ - -#define BPWM_CNTEN_CNTEN0_Pos (0) /*!< BPWM_T::CNTEN: CNTEN0 Position */ -#define BPWM_CNTEN_CNTEN0_Msk (0x1ul << BPWM_CNTEN_CNTEN0_Pos) /*!< BPWM_T::CNTEN: CNTEN0 Mask */ - -#define BPWM_CNTCLR_CNTCLR0_Pos (0) /*!< BPWM_T::CNTCLR: CNTCLR0 Position */ -#define BPWM_CNTCLR_CNTCLR0_Msk (0x1ul << BPWM_CNTCLR_CNTCLR0_Pos) /*!< BPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define BPWM_PERIOD_PERIOD_Pos (0) /*!< BPWM_T::PERIOD: PERIOD Position */ -#define BPWM_PERIOD_PERIOD_Msk (0xfffful << BPWM_PERIOD_PERIOD_Pos) /*!< BPWM_T::PERIOD: PERIOD Mask */ - -#define BPWM_CMPDAT_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT0: CMPDAT Position */ -#define BPWM_CMPDAT_CMPDAT_Msk (0xfffful << BPWM_CMPDAT_CMPDAT_Pos) /*!< BPWM_T::CMPDAT0: CMPDAT Mask */ - -#define BPWM_CNT_CNT_Pos (0) /*!< BPWM_T::CNT: CNT Position */ -#define BPWM_CNT_CNT_Msk (0xfffful << BPWM_CNT_CNT_Pos) /*!< BPWM_T::CNT: CNT Mask */ - -#define BPWM_CNT_DIRF_Pos (16) /*!< BPWM_T::CNT: DIRF Position */ -#define BPWM_CNT_DIRF_Msk (0x1ul << BPWM_CNT_DIRF_Pos) /*!< BPWM_T::CNT: DIRF Mask */ - -#define BPWM_WGCTL0_ZPCTL0_Pos (0) /*!< BPWM_T::WGCTL0: ZPCTL0 Position */ -#define BPWM_WGCTL0_ZPCTL0_Msk (0x3ul << BPWM_WGCTL0_ZPCTL0_Pos) /*!< BPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define BPWM_WGCTL0_ZPCTL1_Pos (2) /*!< BPWM_T::WGCTL0: ZPCTL1 Position */ -#define BPWM_WGCTL0_ZPCTL1_Msk (0x3ul << BPWM_WGCTL0_ZPCTL1_Pos) /*!< BPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define BPWM_WGCTL0_ZPCTL2_Pos (4) /*!< BPWM_T::WGCTL0: ZPCTL2 Position */ -#define BPWM_WGCTL0_ZPCTL2_Msk (0x3ul << BPWM_WGCTL0_ZPCTL2_Pos) /*!< BPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define BPWM_WGCTL0_ZPCTL3_Pos (6) /*!< BPWM_T::WGCTL0: ZPCTL3 Position */ -#define BPWM_WGCTL0_ZPCTL3_Msk (0x3ul << BPWM_WGCTL0_ZPCTL3_Pos) /*!< BPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define BPWM_WGCTL0_ZPCTL4_Pos (8) /*!< BPWM_T::WGCTL0: ZPCTL4 Position */ -#define BPWM_WGCTL0_ZPCTL4_Msk (0x3ul << BPWM_WGCTL0_ZPCTL4_Pos) /*!< BPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define BPWM_WGCTL0_ZPCTL5_Pos (10) /*!< BPWM_T::WGCTL0: ZPCTL5 Position */ -#define BPWM_WGCTL0_ZPCTL5_Msk (0x3ul << BPWM_WGCTL0_ZPCTL5_Pos) /*!< BPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define BPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< BPWM_T::WGCTL0: PRDPCTL0 Position */ -#define BPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL0_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define BPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< BPWM_T::WGCTL0: PRDPCTL1 Position */ -#define BPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL1_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define BPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< BPWM_T::WGCTL0: PRDPCTL2 Position */ -#define BPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL2_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define BPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< BPWM_T::WGCTL0: PRDPCTL3 Position */ -#define BPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL3_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define BPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< BPWM_T::WGCTL0: PRDPCTL4 Position */ -#define BPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL4_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define BPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< BPWM_T::WGCTL0: PRDPCTL5 Position */ -#define BPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL5_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define BPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< BPWM_T::WGCTL1: CMPUCTL0 Position */ -#define BPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define BPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< BPWM_T::WGCTL1: CMPUCTL1 Position */ -#define BPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define BPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< BPWM_T::WGCTL1: CMPUCTL2 Position */ -#define BPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define BPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< BPWM_T::WGCTL1: CMPUCTL3 Position */ -#define BPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define BPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< BPWM_T::WGCTL1: CMPUCTL4 Position */ -#define BPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define BPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< BPWM_T::WGCTL1: CMPUCTL5 Position */ -#define BPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define BPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< BPWM_T::WGCTL1: CMPDCTL0 Position */ -#define BPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define BPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< BPWM_T::WGCTL1: CMPDCTL1 Position */ -#define BPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define BPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< BPWM_T::WGCTL1: CMPDCTL2 Position */ -#define BPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define BPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< BPWM_T::WGCTL1: CMPDCTL3 Position */ -#define BPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define BPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< BPWM_T::WGCTL1: CMPDCTL4 Position */ -#define BPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define BPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< BPWM_T::WGCTL1: CMPDCTL5 Position */ -#define BPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define BPWM_MSKEN_MSKEN0_Pos (0) /*!< BPWM_T::MSKEN: MSKEN0 Position */ -#define BPWM_MSKEN_MSKEN0_Msk (0x1ul << BPWM_MSKEN_MSKEN0_Pos) /*!< BPWM_T::MSKEN: MSKEN0 Mask */ - -#define BPWM_MSKEN_MSKEN1_Pos (1) /*!< BPWM_T::MSKEN: MSKEN1 Position */ -#define BPWM_MSKEN_MSKEN1_Msk (0x1ul << BPWM_MSKEN_MSKEN1_Pos) /*!< BPWM_T::MSKEN: MSKEN1 Mask */ - -#define BPWM_MSKEN_MSKEN2_Pos (2) /*!< BPWM_T::MSKEN: MSKEN2 Position */ -#define BPWM_MSKEN_MSKEN2_Msk (0x1ul << BPWM_MSKEN_MSKEN2_Pos) /*!< BPWM_T::MSKEN: MSKEN2 Mask */ - -#define BPWM_MSKEN_MSKEN3_Pos (3) /*!< BPWM_T::MSKEN: MSKEN3 Position */ -#define BPWM_MSKEN_MSKEN3_Msk (0x1ul << BPWM_MSKEN_MSKEN3_Pos) /*!< BPWM_T::MSKEN: MSKEN3 Mask */ - -#define BPWM_MSKEN_MSKEN4_Pos (4) /*!< BPWM_T::MSKEN: MSKEN4 Position */ -#define BPWM_MSKEN_MSKEN4_Msk (0x1ul << BPWM_MSKEN_MSKEN4_Pos) /*!< BPWM_T::MSKEN: MSKEN4 Mask */ - -#define BPWM_MSKEN_MSKEN5_Pos (5) /*!< BPWM_T::MSKEN: MSKEN5 Position */ -#define BPWM_MSKEN_MSKEN5_Msk (0x1ul << BPWM_MSKEN_MSKEN5_Pos) /*!< BPWM_T::MSKEN: MSKEN5 Mask */ - -#define BPWM_MSK_MSKDAT0_Pos (0) /*!< BPWM_T::MSK: MSKDAT0 Position */ -#define BPWM_MSK_MSKDAT0_Msk (0x1ul << BPWM_MSK_MSKDAT0_Pos) /*!< BPWM_T::MSK: MSKDAT0 Mask */ - -#define BPWM_MSK_MSKDAT1_Pos (1) /*!< BPWM_T::MSK: MSKDAT1 Position */ -#define BPWM_MSK_MSKDAT1_Msk (0x1ul << BPWM_MSK_MSKDAT1_Pos) /*!< BPWM_T::MSK: MSKDAT1 Mask */ - -#define BPWM_MSK_MSKDAT2_Pos (2) /*!< BPWM_T::MSK: MSKDAT2 Position */ -#define BPWM_MSK_MSKDAT2_Msk (0x1ul << BPWM_MSK_MSKDAT2_Pos) /*!< BPWM_T::MSK: MSKDAT2 Mask */ - -#define BPWM_MSK_MSKDAT3_Pos (3) /*!< BPWM_T::MSK: MSKDAT3 Position */ -#define BPWM_MSK_MSKDAT3_Msk (0x1ul << BPWM_MSK_MSKDAT3_Pos) /*!< BPWM_T::MSK: MSKDAT3 Mask */ - -#define BPWM_MSK_MSKDAT4_Pos (4) /*!< BPWM_T::MSK: MSKDAT4 Position */ -#define BPWM_MSK_MSKDAT4_Msk (0x1ul << BPWM_MSK_MSKDAT4_Pos) /*!< BPWM_T::MSK: MSKDAT4 Mask */ - -#define BPWM_MSK_MSKDAT5_Pos (5) /*!< BPWM_T::MSK: MSKDAT5 Position */ -#define BPWM_MSK_MSKDAT5_Msk (0x1ul << BPWM_MSK_MSKDAT5_Pos) /*!< BPWM_T::MSK: MSKDAT5 Mask */ - -#define BPWM_POLCTL_PINV0_Pos (0) /*!< BPWM_T::POLCTL: PINV0 Position */ -#define BPWM_POLCTL_PINV0_Msk (0x1ul << BPWM_POLCTL_PINV0_Pos) /*!< BPWM_T::POLCTL: PINV0 Mask */ - -#define BPWM_POLCTL_PINV1_Pos (1) /*!< BPWM_T::POLCTL: PINV1 Position */ -#define BPWM_POLCTL_PINV1_Msk (0x1ul << BPWM_POLCTL_PINV1_Pos) /*!< BPWM_T::POLCTL: PINV1 Mask */ - -#define BPWM_POLCTL_PINV2_Pos (2) /*!< BPWM_T::POLCTL: PINV2 Position */ -#define BPWM_POLCTL_PINV2_Msk (0x1ul << BPWM_POLCTL_PINV2_Pos) /*!< BPWM_T::POLCTL: PINV2 Mask */ - -#define BPWM_POLCTL_PINV3_Pos (3) /*!< BPWM_T::POLCTL: PINV3 Position */ -#define BPWM_POLCTL_PINV3_Msk (0x1ul << BPWM_POLCTL_PINV3_Pos) /*!< BPWM_T::POLCTL: PINV3 Mask */ - -#define BPWM_POLCTL_PINV4_Pos (4) /*!< BPWM_T::POLCTL: PINV4 Position */ -#define BPWM_POLCTL_PINV4_Msk (0x1ul << BPWM_POLCTL_PINV4_Pos) /*!< BPWM_T::POLCTL: PINV4 Mask */ - -#define BPWM_POLCTL_PINV5_Pos (5) /*!< BPWM_T::POLCTL: PINV5 Position */ -#define BPWM_POLCTL_PINV5_Msk (0x1ul << BPWM_POLCTL_PINV5_Pos) /*!< BPWM_T::POLCTL: PINV5 Mask */ - -#define BPWM_POEN_POEN0_Pos (0) /*!< BPWM_T::POEN: POEN0 Position */ -#define BPWM_POEN_POEN0_Msk (0x1ul << BPWM_POEN_POEN0_Pos) /*!< BPWM_T::POEN: POEN0 Mask */ - -#define BPWM_POEN_POEN1_Pos (1) /*!< BPWM_T::POEN: POEN1 Position */ -#define BPWM_POEN_POEN1_Msk (0x1ul << BPWM_POEN_POEN1_Pos) /*!< BPWM_T::POEN: POEN1 Mask */ - -#define BPWM_POEN_POEN2_Pos (2) /*!< BPWM_T::POEN: POEN2 Position */ -#define BPWM_POEN_POEN2_Msk (0x1ul << BPWM_POEN_POEN2_Pos) /*!< BPWM_T::POEN: POEN2 Mask */ - -#define BPWM_POEN_POEN3_Pos (3) /*!< BPWM_T::POEN: POEN3 Position */ -#define BPWM_POEN_POEN3_Msk (0x1ul << BPWM_POEN_POEN3_Pos) /*!< BPWM_T::POEN: POEN3 Mask */ - -#define BPWM_POEN_POEN4_Pos (4) /*!< BPWM_T::POEN: POEN4 Position */ -#define BPWM_POEN_POEN4_Msk (0x1ul << BPWM_POEN_POEN4_Pos) /*!< BPWM_T::POEN: POEN4 Mask */ - -#define BPWM_POEN_POEN5_Pos (5) /*!< BPWM_T::POEN: POEN5 Position */ -#define BPWM_POEN_POEN5_Msk (0x1ul << BPWM_POEN_POEN5_Pos) /*!< BPWM_T::POEN: POEN5 Mask */ - -#define BPWM_INTEN_ZIEN0_Pos (0) /*!< BPWM_T::INTEN: ZIEN0 Position */ -#define BPWM_INTEN_ZIEN0_Msk (0x1ul << BPWM_INTEN_ZIEN0_Pos) /*!< BPWM_T::INTEN: ZIEN0 Mask */ - -#define BPWM_INTEN_PIEN0_Pos (8) /*!< BPWM_T::INTEN: PIEN0 Position */ -#define BPWM_INTEN_PIEN0_Msk (0x1ul << BPWM_INTEN_PIEN0_Pos) /*!< BPWM_T::INTEN: PIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN0_Pos (16) /*!< BPWM_T::INTEN: CMPUIEN0 Position */ -#define BPWM_INTEN_CMPUIEN0_Msk (0x1ul << BPWM_INTEN_CMPUIEN0_Pos) /*!< BPWM_T::INTEN: CMPUIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN1_Pos (17) /*!< BPWM_T::INTEN: CMPUIEN1 Position */ -#define BPWM_INTEN_CMPUIEN1_Msk (0x1ul << BPWM_INTEN_CMPUIEN1_Pos) /*!< BPWM_T::INTEN: CMPUIEN1 Mask */ - -#define BPWM_INTEN_CMPUIEN2_Pos (18) /*!< BPWM_T::INTEN: CMPUIEN2 Position */ -#define BPWM_INTEN_CMPUIEN2_Msk (0x1ul << BPWM_INTEN_CMPUIEN2_Pos) /*!< BPWM_T::INTEN: CMPUIEN2 Mask */ - -#define BPWM_INTEN_CMPUIEN3_Pos (19) /*!< BPWM_T::INTEN: CMPUIEN3 Position */ -#define BPWM_INTEN_CMPUIEN3_Msk (0x1ul << BPWM_INTEN_CMPUIEN3_Pos) /*!< BPWM_T::INTEN: CMPUIEN3 Mask */ - -#define BPWM_INTEN_CMPUIEN4_Pos (20) /*!< BPWM_T::INTEN: CMPUIEN4 Position */ -#define BPWM_INTEN_CMPUIEN4_Msk (0x1ul << BPWM_INTEN_CMPUIEN4_Pos) /*!< BPWM_T::INTEN: CMPUIEN4 Mask */ - -#define BPWM_INTEN_CMPUIEN5_Pos (21) /*!< BPWM_T::INTEN: CMPUIEN5 Position */ -#define BPWM_INTEN_CMPUIEN5_Msk (0x1ul << BPWM_INTEN_CMPUIEN5_Pos) /*!< BPWM_T::INTEN: CMPUIEN5 Mask */ - -#define BPWM_INTEN_CMPDIEN0_Pos (24) /*!< BPWM_T::INTEN: CMPDIEN0 Position */ -#define BPWM_INTEN_CMPDIEN0_Msk (0x1ul << BPWM_INTEN_CMPDIEN0_Pos) /*!< BPWM_T::INTEN: CMPDIEN0 Mask */ - -#define BPWM_INTEN_CMPDIEN1_Pos (25) /*!< BPWM_T::INTEN: CMPDIEN1 Position */ -#define BPWM_INTEN_CMPDIEN1_Msk (0x1ul << BPWM_INTEN_CMPDIEN1_Pos) /*!< BPWM_T::INTEN: CMPDIEN1 Mask */ - -#define BPWM_INTEN_CMPDIEN2_Pos (26) /*!< BPWM_T::INTEN: CMPDIEN2 Position */ -#define BPWM_INTEN_CMPDIEN2_Msk (0x1ul << BPWM_INTEN_CMPDIEN2_Pos) /*!< BPWM_T::INTEN: CMPDIEN2 Mask */ - -#define BPWM_INTEN_CMPDIEN3_Pos (27) /*!< BPWM_T::INTEN: CMPDIEN3 Position */ -#define BPWM_INTEN_CMPDIEN3_Msk (0x1ul << BPWM_INTEN_CMPDIEN3_Pos) /*!< BPWM_T::INTEN: CMPDIEN3 Mask */ - -#define BPWM_INTEN_CMPDIEN4_Pos (28) /*!< BPWM_T::INTEN: CMPDIEN4 Position */ -#define BPWM_INTEN_CMPDIEN4_Msk (0x1ul << BPWM_INTEN_CMPDIEN4_Pos) /*!< BPWM_T::INTEN: CMPDIEN4 Mask */ - -#define BPWM_INTEN_CMPDIEN5_Pos (29) /*!< BPWM_T::INTEN: CMPDIEN5 Position */ -#define BPWM_INTEN_CMPDIEN5_Msk (0x1ul << BPWM_INTEN_CMPDIEN5_Pos) /*!< BPWM_T::INTEN: CMPDIEN5 Mask */ - -#define BPWM_INTSTS_ZIF0_Pos (0) /*!< BPWM_T::INTSTS: ZIF0 Position */ -#define BPWM_INTSTS_ZIF0_Msk (0x1ul << BPWM_INTSTS_ZIF0_Pos) /*!< BPWM_T::INTSTS: ZIF0 Mask */ - -#define BPWM_INTSTS_PIF0_Pos (8) /*!< BPWM_T::INTSTS: PIF0 Position */ -#define BPWM_INTSTS_PIF0_Msk (0x1ul << BPWM_INTSTS_PIF0_Pos) /*!< BPWM_T::INTSTS: PIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF0_Pos (16) /*!< BPWM_T::INTSTS: CMPUIF0 Position */ -#define BPWM_INTSTS_CMPUIF0_Msk (0x1ul << BPWM_INTSTS_CMPUIF0_Pos) /*!< BPWM_T::INTSTS: CMPUIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF1_Pos (17) /*!< BPWM_T::INTSTS: CMPUIF1 Position */ -#define BPWM_INTSTS_CMPUIF1_Msk (0x1ul << BPWM_INTSTS_CMPUIF1_Pos) /*!< BPWM_T::INTSTS: CMPUIF1 Mask */ - -#define BPWM_INTSTS_CMPUIF2_Pos (18) /*!< BPWM_T::INTSTS: CMPUIF2 Position */ -#define BPWM_INTSTS_CMPUIF2_Msk (0x1ul << BPWM_INTSTS_CMPUIF2_Pos) /*!< BPWM_T::INTSTS: CMPUIF2 Mask */ - -#define BPWM_INTSTS_CMPUIF3_Pos (19) /*!< BPWM_T::INTSTS: CMPUIF3 Position */ -#define BPWM_INTSTS_CMPUIF3_Msk (0x1ul << BPWM_INTSTS_CMPUIF3_Pos) /*!< BPWM_T::INTSTS: CMPUIF3 Mask */ - -#define BPWM_INTSTS_CMPUIF4_Pos (20) /*!< BPWM_T::INTSTS: CMPUIF4 Position */ -#define BPWM_INTSTS_CMPUIF4_Msk (0x1ul << BPWM_INTSTS_CMPUIF4_Pos) /*!< BPWM_T::INTSTS: CMPUIF4 Mask */ - -#define BPWM_INTSTS_CMPUIF5_Pos (21) /*!< BPWM_T::INTSTS: CMPUIF5 Position */ -#define BPWM_INTSTS_CMPUIF5_Msk (0x1ul << BPWM_INTSTS_CMPUIF5_Pos) /*!< BPWM_T::INTSTS: CMPUIF5 Mask */ - -#define BPWM_INTSTS_CMPDIF0_Pos (24) /*!< BPWM_T::INTSTS: CMPDIF0 Position */ -#define BPWM_INTSTS_CMPDIF0_Msk (0x1ul << BPWM_INTSTS_CMPDIF0_Pos) /*!< BPWM_T::INTSTS: CMPDIF0 Mask */ - -#define BPWM_INTSTS_CMPDIF1_Pos (25) /*!< BPWM_T::INTSTS: CMPDIF1 Position */ -#define BPWM_INTSTS_CMPDIF1_Msk (0x1ul << BPWM_INTSTS_CMPDIF1_Pos) /*!< BPWM_T::INTSTS: CMPDIF1 Mask */ - -#define BPWM_INTSTS_CMPDIF2_Pos (26) /*!< BPWM_T::INTSTS: CMPDIF2 Position */ -#define BPWM_INTSTS_CMPDIF2_Msk (0x1ul << BPWM_INTSTS_CMPDIF2_Pos) /*!< BPWM_T::INTSTS: CMPDIF2 Mask */ - -#define BPWM_INTSTS_CMPDIF3_Pos (27) /*!< BPWM_T::INTSTS: CMPDIF3 Position */ -#define BPWM_INTSTS_CMPDIF3_Msk (0x1ul << BPWM_INTSTS_CMPDIF3_Pos) /*!< BPWM_T::INTSTS: CMPDIF3 Mask */ - -#define BPWM_INTSTS_CMPDIF4_Pos (28) /*!< BPWM_T::INTSTS: CMPDIF4 Position */ -#define BPWM_INTSTS_CMPDIF4_Msk (0x1ul << BPWM_INTSTS_CMPDIF4_Pos) /*!< BPWM_T::INTSTS: CMPDIF4 Mask */ - -#define BPWM_INTSTS_CMPDIF5_Pos (29) /*!< BPWM_T::INTSTS: CMPDIF5 Position */ -#define BPWM_INTSTS_CMPDIF5_Msk (0x1ul << BPWM_INTSTS_CMPDIF5_Pos) /*!< BPWM_T::INTSTS: CMPDIF5 Mask */ - -#define BPWM_EADCTS0_TRGSEL0_Pos (0) /*!< BPWM_T::EADCTS0: TRGSEL0 Position */ -#define BPWM_EADCTS0_TRGSEL0_Msk (0xful << BPWM_EADCTS0_TRGSEL0_Pos) /*!< BPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define BPWM_EADCTS0_TRGEN0_Pos (7) /*!< BPWM_T::EADCTS0: TRGEN0 Position */ -#define BPWM_EADCTS0_TRGEN0_Msk (0x1ul << BPWM_EADCTS0_TRGEN0_Pos) /*!< BPWM_T::EADCTS0: TRGEN0 Mask */ - -#define BPWM_EADCTS0_TRGSEL1_Pos (8) /*!< BPWM_T::EADCTS0: TRGSEL1 Position */ -#define BPWM_EADCTS0_TRGSEL1_Msk (0xful << BPWM_EADCTS0_TRGSEL1_Pos) /*!< BPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define BPWM_EADCTS0_TRGEN1_Pos (15) /*!< BPWM_T::EADCTS0: TRGEN1 Position */ -#define BPWM_EADCTS0_TRGEN1_Msk (0x1ul << BPWM_EADCTS0_TRGEN1_Pos) /*!< BPWM_T::EADCTS0: TRGEN1 Mask */ - -#define BPWM_EADCTS0_TRGSEL2_Pos (16) /*!< BPWM_T::EADCTS0: TRGSEL2 Position */ -#define BPWM_EADCTS0_TRGSEL2_Msk (0xful << BPWM_EADCTS0_TRGSEL2_Pos) /*!< BPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define BPWM_EADCTS0_TRGEN2_Pos (23) /*!< BPWM_T::EADCTS0: TRGEN2 Position */ -#define BPWM_EADCTS0_TRGEN2_Msk (0x1ul << BPWM_EADCTS0_TRGEN2_Pos) /*!< BPWM_T::EADCTS0: TRGEN2 Mask */ - -#define BPWM_EADCTS0_TRGSEL3_Pos (24) /*!< BPWM_T::EADCTS0: TRGSEL3 Position */ -#define BPWM_EADCTS0_TRGSEL3_Msk (0xful << BPWM_EADCTS0_TRGSEL3_Pos) /*!< BPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define BPWM_EADCTS0_TRGEN3_Pos (31) /*!< BPWM_T::EADCTS0: TRGEN3 Position */ -#define BPWM_EADCTS0_TRGEN3_Msk (0x1ul << BPWM_EADCTS0_TRGEN3_Pos) /*!< BPWM_T::EADCTS0: TRGEN3 Mask */ - -#define BPWM_EADCTS1_TRGSEL4_Pos (0) /*!< BPWM_T::EADCTS1: TRGSEL4 Position */ -#define BPWM_EADCTS1_TRGSEL4_Msk (0xful << BPWM_EADCTS1_TRGSEL4_Pos) /*!< BPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define BPWM_EADCTS1_TRGEN4_Pos (7) /*!< BPWM_T::EADCTS1: TRGEN4 Position */ -#define BPWM_EADCTS1_TRGEN4_Msk (0x1ul << BPWM_EADCTS1_TRGEN4_Pos) /*!< BPWM_T::EADCTS1: TRGEN4 Mask */ - -#define BPWM_EADCTS1_TRGSEL5_Pos (8) /*!< BPWM_T::EADCTS1: TRGSEL5 Position */ -#define BPWM_EADCTS1_TRGSEL5_Msk (0xful << BPWM_EADCTS1_TRGSEL5_Pos) /*!< BPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define BPWM_EADCTS1_TRGEN5_Pos (15) /*!< BPWM_T::EADCTS1: TRGEN5 Position */ -#define BPWM_EADCTS1_TRGEN5_Msk (0x1ul << BPWM_EADCTS1_TRGEN5_Pos) /*!< BPWM_T::EADCTS1: TRGEN5 Mask */ - -#define BPWM_SSCTL_SSEN0_Pos (0) /*!< BPWM_T::SSCTL: SSEN0 Position */ -#define BPWM_SSCTL_SSEN0_Msk (0x1ul << BPWM_SSCTL_SSEN0_Pos) /*!< BPWM_T::SSCTL: SSEN0 Mask */ - -#define BPWM_SSCTL_SSRC_Pos (8) /*!< BPWM_T::SSCTL: SSRC Position */ -#define BPWM_SSCTL_SSRC_Msk (0x3ul << BPWM_SSCTL_SSRC_Pos) /*!< BPWM_T::SSCTL: SSRC Mask */ - -#define BPWM_SSTRG_CNTSEN_Pos (0) /*!< BPWM_T::SSTRG: CNTSEN Position */ -#define BPWM_SSTRG_CNTSEN_Msk (0x1ul << BPWM_SSTRG_CNTSEN_Pos) /*!< BPWM_T::SSTRG: CNTSEN Mask */ - -#define BPWM_STATUS_CNTMAX0_Pos (0) /*!< BPWM_T::STATUS: CNTMAX0 Position */ -#define BPWM_STATUS_CNTMAX0_Msk (0x1ul << BPWM_STATUS_CNTMAX0_Pos) /*!< BPWM_T::STATUS: CNTMAX0 Mask */ - -#define BPWM_STATUS_EADCTRG0_Pos (16) /*!< BPWM_T::STATUS: EADCTRG0 Position */ -#define BPWM_STATUS_EADCTRG0_Msk (0x1ul << BPWM_STATUS_EADCTRG0_Pos) /*!< BPWM_T::STATUS: EADCTRG0 Mask */ - -#define BPWM_STATUS_EADCTRG1_Pos (17) /*!< BPWM_T::STATUS: EADCTRG1 Position */ -#define BPWM_STATUS_EADCTRG1_Msk (0x1ul << BPWM_STATUS_EADCTRG1_Pos) /*!< BPWM_T::STATUS: EADCTRG1 Mask */ - -#define BPWM_STATUS_EADCTRG2_Pos (18) /*!< BPWM_T::STATUS: EADCTRG2 Position */ -#define BPWM_STATUS_EADCTRG2_Msk (0x1ul << BPWM_STATUS_EADCTRG2_Pos) /*!< BPWM_T::STATUS: EADCTRG2 Mask */ - -#define BPWM_STATUS_EADCTRG3_Pos (19) /*!< BPWM_T::STATUS: EADCTRG3 Position */ -#define BPWM_STATUS_EADCTRG3_Msk (0x1ul << BPWM_STATUS_EADCTRG3_Pos) /*!< BPWM_T::STATUS: EADCTRG3 Mask */ - -#define BPWM_STATUS_EADCTRG4_Pos (20) /*!< BPWM_T::STATUS: EADCTRG4 Position */ -#define BPWM_STATUS_EADCTRG4_Msk (0x1ul << BPWM_STATUS_EADCTRG4_Pos) /*!< BPWM_T::STATUS: EADCTRG4 Mask */ - -#define BPWM_STATUS_EADCTRG5_Pos (21) /*!< BPWM_T::STATUS: EADCTRG5 Position */ -#define BPWM_STATUS_EADCTRG5_Msk (0x1ul << BPWM_STATUS_EADCTRG5_Pos) /*!< BPWM_T::STATUS: EADCTRG5 Mask */ - -#define BPWM_CAPINEN_CAPINEN0_Pos (0) /*!< BPWM_T::CAPINEN: CAPINEN0 Position */ -#define BPWM_CAPINEN_CAPINEN0_Msk (0x1ul << BPWM_CAPINEN_CAPINEN0_Pos) /*!< BPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define BPWM_CAPINEN_CAPINEN1_Pos (1) /*!< BPWM_T::CAPINEN: CAPINEN1 Position */ -#define BPWM_CAPINEN_CAPINEN1_Msk (0x1ul << BPWM_CAPINEN_CAPINEN1_Pos) /*!< BPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define BPWM_CAPINEN_CAPINEN2_Pos (2) /*!< BPWM_T::CAPINEN: CAPINEN2 Position */ -#define BPWM_CAPINEN_CAPINEN2_Msk (0x1ul << BPWM_CAPINEN_CAPINEN2_Pos) /*!< BPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define BPWM_CAPINEN_CAPINEN3_Pos (3) /*!< BPWM_T::CAPINEN: CAPINEN3 Position */ -#define BPWM_CAPINEN_CAPINEN3_Msk (0x1ul << BPWM_CAPINEN_CAPINEN3_Pos) /*!< BPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define BPWM_CAPINEN_CAPINEN4_Pos (4) /*!< BPWM_T::CAPINEN: CAPINEN4 Position */ -#define BPWM_CAPINEN_CAPINEN4_Msk (0x1ul << BPWM_CAPINEN_CAPINEN4_Pos) /*!< BPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define BPWM_CAPINEN_CAPINEN5_Pos (5) /*!< BPWM_T::CAPINEN: CAPINEN5 Position */ -#define BPWM_CAPINEN_CAPINEN5_Msk (0x1ul << BPWM_CAPINEN_CAPINEN5_Pos) /*!< BPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define BPWM_CAPCTL_CAPEN0_Pos (0) /*!< BPWM_T::CAPCTL: CAPEN0 Position */ -#define BPWM_CAPCTL_CAPEN0_Msk (0x1ul << BPWM_CAPCTL_CAPEN0_Pos) /*!< BPWM_T::CAPCTL: CAPEN0 Mask */ - -#define BPWM_CAPCTL_CAPEN1_Pos (1) /*!< BPWM_T::CAPCTL: CAPEN1 Position */ -#define BPWM_CAPCTL_CAPEN1_Msk (0x1ul << BPWM_CAPCTL_CAPEN1_Pos) /*!< BPWM_T::CAPCTL: CAPEN1 Mask */ - -#define BPWM_CAPCTL_CAPEN2_Pos (2) /*!< BPWM_T::CAPCTL: CAPEN2 Position */ -#define BPWM_CAPCTL_CAPEN2_Msk (0x1ul << BPWM_CAPCTL_CAPEN2_Pos) /*!< BPWM_T::CAPCTL: CAPEN2 Mask */ - -#define BPWM_CAPCTL_CAPEN3_Pos (3) /*!< BPWM_T::CAPCTL: CAPEN3 Position */ -#define BPWM_CAPCTL_CAPEN3_Msk (0x1ul << BPWM_CAPCTL_CAPEN3_Pos) /*!< BPWM_T::CAPCTL: CAPEN3 Mask */ - -#define BPWM_CAPCTL_CAPEN4_Pos (4) /*!< BPWM_T::CAPCTL: CAPEN4 Position */ -#define BPWM_CAPCTL_CAPEN4_Msk (0x1ul << BPWM_CAPCTL_CAPEN4_Pos) /*!< BPWM_T::CAPCTL: CAPEN4 Mask */ - -#define BPWM_CAPCTL_CAPEN5_Pos (5) /*!< BPWM_T::CAPCTL: CAPEN5 Position */ -#define BPWM_CAPCTL_CAPEN5_Msk (0x1ul << BPWM_CAPCTL_CAPEN5_Pos) /*!< BPWM_T::CAPCTL: CAPEN5 Mask */ - -#define BPWM_CAPCTL_CAPINV0_Pos (8) /*!< BPWM_T::CAPCTL: CAPINV0 Position */ -#define BPWM_CAPCTL_CAPINV0_Msk (0x1ul << BPWM_CAPCTL_CAPINV0_Pos) /*!< BPWM_T::CAPCTL: CAPINV0 Mask */ - -#define BPWM_CAPCTL_CAPINV1_Pos (9) /*!< BPWM_T::CAPCTL: CAPINV1 Position */ -#define BPWM_CAPCTL_CAPINV1_Msk (0x1ul << BPWM_CAPCTL_CAPINV1_Pos) /*!< BPWM_T::CAPCTL: CAPINV1 Mask */ - -#define BPWM_CAPCTL_CAPINV2_Pos (10) /*!< BPWM_T::CAPCTL: CAPINV2 Position */ -#define BPWM_CAPCTL_CAPINV2_Msk (0x1ul << BPWM_CAPCTL_CAPINV2_Pos) /*!< BPWM_T::CAPCTL: CAPINV2 Mask */ - -#define BPWM_CAPCTL_CAPINV3_Pos (11) /*!< BPWM_T::CAPCTL: CAPINV3 Position */ -#define BPWM_CAPCTL_CAPINV3_Msk (0x1ul << BPWM_CAPCTL_CAPINV3_Pos) /*!< BPWM_T::CAPCTL: CAPINV3 Mask */ - -#define BPWM_CAPCTL_CAPINV4_Pos (12) /*!< BPWM_T::CAPCTL: CAPINV4 Position */ -#define BPWM_CAPCTL_CAPINV4_Msk (0x1ul << BPWM_CAPCTL_CAPINV4_Pos) /*!< BPWM_T::CAPCTL: CAPINV4 Mask */ - -#define BPWM_CAPCTL_CAPINV5_Pos (13) /*!< BPWM_T::CAPCTL: CAPINV5 Position */ -#define BPWM_CAPCTL_CAPINV5_Msk (0x1ul << BPWM_CAPCTL_CAPINV5_Pos) /*!< BPWM_T::CAPCTL: CAPINV5 Mask */ - -#define BPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< BPWM_T::CAPCTL: RCRLDEN0 Position */ -#define BPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define BPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< BPWM_T::CAPCTL: RCRLDEN1 Position */ -#define BPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define BPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< BPWM_T::CAPCTL: RCRLDEN2 Position */ -#define BPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define BPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< BPWM_T::CAPCTL: RCRLDEN3 Position */ -#define BPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define BPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< BPWM_T::CAPCTL: RCRLDEN4 Position */ -#define BPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define BPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< BPWM_T::CAPCTL: RCRLDEN5 Position */ -#define BPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define BPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< BPWM_T::CAPCTL: FCRLDEN0 Position */ -#define BPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define BPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< BPWM_T::CAPCTL: FCRLDEN1 Position */ -#define BPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define BPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< BPWM_T::CAPCTL: FCRLDEN2 Position */ -#define BPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define BPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< BPWM_T::CAPCTL: FCRLDEN3 Position */ -#define BPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define BPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< BPWM_T::CAPCTL: FCRLDEN4 Position */ -#define BPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define BPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< BPWM_T::CAPCTL: FCRLDEN5 Position */ -#define BPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define BPWM_CAPSTS_CRIFOV0_Pos (0) /*!< BPWM_T::CAPSTS: CRIFOV0 Position */ -#define BPWM_CAPSTS_CRIFOV0_Msk (0x1ul << BPWM_CAPSTS_CRIFOV0_Pos) /*!< BPWM_T::CAPSTS: CRIFOV0 Mask */ - -#define BPWM_CAPSTS_CRIFOV1_Pos (1) /*!< BPWM_T::CAPSTS: CRIFOV1 Position */ -#define BPWM_CAPSTS_CRIFOV1_Msk (0x1ul << BPWM_CAPSTS_CRIFOV1_Pos) /*!< BPWM_T::CAPSTS: CRIFOV1 Mask */ - -#define BPWM_CAPSTS_CRIFOV2_Pos (2) /*!< BPWM_T::CAPSTS: CRIFOV2 Position */ -#define BPWM_CAPSTS_CRIFOV2_Msk (0x1ul << BPWM_CAPSTS_CRIFOV2_Pos) /*!< BPWM_T::CAPSTS: CRIFOV2 Mask */ - -#define BPWM_CAPSTS_CRIFOV3_Pos (3) /*!< BPWM_T::CAPSTS: CRIFOV3 Position */ -#define BPWM_CAPSTS_CRIFOV3_Msk (0x1ul << BPWM_CAPSTS_CRIFOV3_Pos) /*!< BPWM_T::CAPSTS: CRIFOV3 Mask */ - -#define BPWM_CAPSTS_CRIFOV4_Pos (4) /*!< BPWM_T::CAPSTS: CRIFOV4 Position */ -#define BPWM_CAPSTS_CRIFOV4_Msk (0x1ul << BPWM_CAPSTS_CRIFOV4_Pos) /*!< BPWM_T::CAPSTS: CRIFOV4 Mask */ - -#define BPWM_CAPSTS_CRIFOV5_Pos (5) /*!< BPWM_T::CAPSTS: CRIFOV5 Position */ -#define BPWM_CAPSTS_CRIFOV5_Msk (0x1ul << BPWM_CAPSTS_CRIFOV5_Pos) /*!< BPWM_T::CAPSTS: CRIFOV5 Mask */ - -#define BPWM_CAPSTS_CFIFOV0_Pos (8) /*!< BPWM_T::CAPSTS: CFIFOV0 Position */ -#define BPWM_CAPSTS_CFIFOV0_Msk (0x1ul << BPWM_CAPSTS_CFIFOV0_Pos) /*!< BPWM_T::CAPSTS: CFIFOV0 Mask */ - -#define BPWM_CAPSTS_CFIFOV1_Pos (9) /*!< BPWM_T::CAPSTS: CFIFOV1 Position */ -#define BPWM_CAPSTS_CFIFOV1_Msk (0x1ul << BPWM_CAPSTS_CFIFOV1_Pos) /*!< BPWM_T::CAPSTS: CFIFOV1 Mask */ - -#define BPWM_CAPSTS_CFIFOV2_Pos (10) /*!< BPWM_T::CAPSTS: CFIFOV2 Position */ -#define BPWM_CAPSTS_CFIFOV2_Msk (0x1ul << BPWM_CAPSTS_CFIFOV2_Pos) /*!< BPWM_T::CAPSTS: CFIFOV2 Mask */ - -#define BPWM_CAPSTS_CFIFOV3_Pos (11) /*!< BPWM_T::CAPSTS: CFIFOV3 Position */ -#define BPWM_CAPSTS_CFIFOV3_Msk (0x1ul << BPWM_CAPSTS_CFIFOV3_Pos) /*!< BPWM_T::CAPSTS: CFIFOV3 Mask */ - -#define BPWM_CAPSTS_CFIFOV4_Pos (12) /*!< BPWM_T::CAPSTS: CFIFOV4 Position */ -#define BPWM_CAPSTS_CFIFOV4_Msk (0x1ul << BPWM_CAPSTS_CFIFOV4_Pos) /*!< BPWM_T::CAPSTS: CFIFOV4 Mask */ - -#define BPWM_CAPSTS_CFIFOV5_Pos (13) /*!< BPWM_T::CAPSTS: CFIFOV5 Position */ -#define BPWM_CAPSTS_CFIFOV5_Msk (0x1ul << BPWM_CAPSTS_CFIFOV5_Pos) /*!< BPWM_T::CAPSTS: CFIFOV5 Mask */ - -#define BPWM_RCAPDAT_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT: RCAPDAT Position */ -#define BPWM_RCAPDAT_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT: RCAPDAT Mask */ - -#define BPWM_FCAPDAT_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT: FCAPDAT Position */ -#define BPWM_FCAPDAT_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT: FCAPDAT Mask */ - -#define BPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT0: RCAPDAT Position */ -#define BPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT0_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define BPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT0: FCAPDAT Position */ -#define BPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT0_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define BPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT1: RCAPDAT Position */ -#define BPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT1_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define BPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT1: FCAPDAT Position */ -#define BPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT1_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define BPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT2: RCAPDAT Position */ -#define BPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT2_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define BPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT2: FCAPDAT Position */ -#define BPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT2_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define BPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT3: RCAPDAT Position */ -#define BPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT3_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define BPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT3: FCAPDAT Position */ -#define BPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT3_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define BPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT4: RCAPDAT Position */ -#define BPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT4_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define BPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT4: FCAPDAT Position */ -#define BPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT4_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define BPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT5: RCAPDAT Position */ -#define BPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT5_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define BPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT5: FCAPDAT Position */ -#define BPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT5_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define BPWM_CAPIEN_CAPRIENn_Pos (0) /*!< BPWM_T::CAPIEN: CAPRIENn Position */ -#define BPWM_CAPIEN_CAPRIENn_Msk (0x3ful << BPWM_CAPIEN_CAPRIENn_Pos) /*!< BPWM_T::CAPIEN: CAPRIENn Mask */ - -#define BPWM_CAPIEN_CAPFIENn_Pos (8) /*!< BPWM_T::CAPIEN: CAPFIENn Position */ -#define BPWM_CAPIEN_CAPFIENn_Msk (0x3ful << BPWM_CAPIEN_CAPFIENn_Pos) /*!< BPWM_T::CAPIEN: CAPFIENn Mask */ - -#define BPWM_CAPIF_CAPRIF0_Pos (0) /*!< BPWM_T::CAPIF: CAPRIF0 Position */ -#define BPWM_CAPIF_CAPRIF0_Msk (0x1ul << BPWM_CAPIF_CAPRIF0_Pos) /*!< BPWM_T::CAPIF: CAPRIF0 Mask */ - -#define BPWM_CAPIF_CAPRIF1_Pos (1) /*!< BPWM_T::CAPIF: CAPRIF1 Position */ -#define BPWM_CAPIF_CAPRIF1_Msk (0x1ul << BPWM_CAPIF_CAPRIF1_Pos) /*!< BPWM_T::CAPIF: CAPRIF1 Mask */ - -#define BPWM_CAPIF_CAPRIF2_Pos (2) /*!< BPWM_T::CAPIF: CAPRIF2 Position */ -#define BPWM_CAPIF_CAPRIF2_Msk (0x1ul << BPWM_CAPIF_CAPRIF2_Pos) /*!< BPWM_T::CAPIF: CAPRIF2 Mask */ - -#define BPWM_CAPIF_CAPRIF3_Pos (3) /*!< BPWM_T::CAPIF: CAPRIF3 Position */ -#define BPWM_CAPIF_CAPRIF3_Msk (0x1ul << BPWM_CAPIF_CAPRIF3_Pos) /*!< BPWM_T::CAPIF: CAPRIF3 Mask */ - -#define BPWM_CAPIF_CAPRIF4_Pos (4) /*!< BPWM_T::CAPIF: CAPRIF4 Position */ -#define BPWM_CAPIF_CAPRIF4_Msk (0x1ul << BPWM_CAPIF_CAPRIF4_Pos) /*!< BPWM_T::CAPIF: CAPRIF4 Mask */ - -#define BPWM_CAPIF_CAPRIF5_Pos (5) /*!< BPWM_T::CAPIF: CAPRIF5 Position */ -#define BPWM_CAPIF_CAPRIF5_Msk (0x1ul << BPWM_CAPIF_CAPRIF5_Pos) /*!< BPWM_T::CAPIF: CAPRIF5 Mask */ - -#define BPWM_CAPIF_CAPFIF0_Pos (8) /*!< BPWM_T::CAPIF: CAPFIF0 Position */ -#define BPWM_CAPIF_CAPFIF0_Msk (0x1ul << BPWM_CAPIF_CAPFIF0_Pos) /*!< BPWM_T::CAPIF: CAPFIF0 Mask */ - -#define BPWM_CAPIF_CAPFIF1_Pos (9) /*!< BPWM_T::CAPIF: CAPFIF1 Position */ -#define BPWM_CAPIF_CAPFIF1_Msk (0x1ul << BPWM_CAPIF_CAPFIF1_Pos) /*!< BPWM_T::CAPIF: CAPFIF1 Mask */ - -#define BPWM_CAPIF_CAPFIF2_Pos (10) /*!< BPWM_T::CAPIF: CAPFIF2 Position */ -#define BPWM_CAPIF_CAPFIF2_Msk (0x1ul << BPWM_CAPIF_CAPFIF2_Pos) /*!< BPWM_T::CAPIF: CAPFIF2 Mask */ - -#define BPWM_CAPIF_CAPFIF3_Pos (11) /*!< BPWM_T::CAPIF: CAPFIF3 Position */ -#define BPWM_CAPIF_CAPFIF3_Msk (0x1ul << BPWM_CAPIF_CAPFIF3_Pos) /*!< BPWM_T::CAPIF: CAPFIF3 Mask */ - -#define BPWM_CAPIF_CAPFIF4_Pos (12) /*!< BPWM_T::CAPIF: CAPFIF4 Position */ -#define BPWM_CAPIF_CAPFIF4_Msk (0x1ul << BPWM_CAPIF_CAPFIF4_Pos) /*!< BPWM_T::CAPIF: CAPFIF4 Mask */ - -#define BPWM_CAPIF_CAPFIF5_Pos (13) /*!< BPWM_T::CAPIF: CAPFIF5 Position */ -#define BPWM_CAPIF_CAPFIF5_Msk (0x1ul << BPWM_CAPIF_CAPFIF5_Pos) /*!< BPWM_T::CAPIF: CAPFIF5 Mask */ - -#define BPWM_PBUF_PBUF_Pos (0) /*!< BPWM_T::PBUF: PBUF Position */ -#define BPWM_PBUF_PBUF_Msk (0xfffful << BPWM_PBUF_PBUF_Pos) /*!< BPWM_T::PBUF: PBUF Mask */ - -#define BPWM_CMPBUF_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF0: CMPBUF Position */ -#define BPWM_CMPBUF_CMPBUF_Msk (0xfffful << BPWM_CMPBUFn_CMPBUF_Pos) /*!< BPWM_T::CMPBUF0: CMPBUF Mask */ - -#define BPWM_CMPBUF0_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF0: CMPBUF Position */ -#define BPWM_CMPBUF0_CMPBUF_Msk (0xfffful << BPWM_CMPBUF0_CMPBUF_Pos) /*!< BPWM_T::CMPBUF0: CMPBUF Mask */ - -#define BPWM_CMPBUF1_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF1: CMPBUF Position */ -#define BPWM_CMPBUF1_CMPBUF_Msk (0xfffful << BPWM_CMPBUF1_CMPBUF_Pos) /*!< BPWM_T::CMPBUF1: CMPBUF Mask */ - -#define BPWM_CMPBUF2_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF2: CMPBUF Position */ -#define BPWM_CMPBUF2_CMPBUF_Msk (0xfffful << BPWM_CMPBUF2_CMPBUF_Pos) /*!< BPWM_T::CMPBUF2: CMPBUF Mask */ - -#define BPWM_CMPBUF3_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF3: CMPBUF Position */ -#define BPWM_CMPBUF3_CMPBUF_Msk (0xfffful << BPWM_CMPBUF3_CMPBUF_Pos) /*!< BPWM_T::CMPBUF3: CMPBUF Mask */ - -#define BPWM_CMPBUF4_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF4: CMPBUF Position */ -#define BPWM_CMPBUF4_CMPBUF_Msk (0xfffful << BPWM_CMPBUF4_CMPBUF_Pos) /*!< BPWM_T::CMPBUF4: CMPBUF Mask */ - -#define BPWM_CMPBUF5_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF5: CMPBUF Position */ -#define BPWM_CMPBUF5_CMPBUF_Msk (0xfffful << BPWM_CMPBUF5_CMPBUF_Pos) /*!< BPWM_T::CMPBUF5: CMPBUF Mask */ - -/**@}*/ /* BPWM_CONST */ -/**@}*/ /* end of BPWM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __BPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/clk_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/clk_reg.h deleted file mode 100644 index ede4d17230d..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/clk_reg.h +++ /dev/null @@ -1,918 +0,0 @@ -/**************************************************************************//** - * @file clk_reg.h - * @version V1.00 - * @brief CLK register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CLK_REG_H__ -#define __CLK_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CLK System Clock Controller (CLK) - Memory Mapped Structure for CLK Controller -@{ */ - -typedef struct -{ - - - /** - * @var CLK_T::PWRCTL - * Offset: 0x00 System Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTEN |HXT Enable Bit (Write Protect) - * | | |0 = External high speed crystal (HXT) Disabled. - * | | |1 = External high speed crystal (HXT) Enabled. - * | | |Note1: Reset by power on reset. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |LXTEN |LXT Enable Bit (Write Protect) - * | | |0 = External low speed crystal (LXT) Disabled. - * | | |1 = External low speed crystal (LXT) Enabled. - * | | |Note1: Reset by RTC power on reset. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |HIRCEN |HIRC Enable Bit (Write Protect) - * | | |0 = Internal high speed RC oscillator (HIRC) Disabled. - * | | |1 = Internal high speed RC oscillator (HIRC) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |LIRCEN |LIRC Enable Bit (Write Protect) - * | | |0 = Internal low speed RC oscillator (LIRC) Disabled. - * | | |1 = Internal low speed RC oscillator (LIRC) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |PDWKDLY |Enable the Wake-up Delay Counter (Write Protect) - * | | |When the chip wakes up from Power-down mode, the clock control will delay certain clock cycles to wait system clock stable. - * | | |The delayed clock cycle is 4096 clock cycles when chip works at external high speed crystal oscillator (HXT), and 512 clock cycles when chip works at internal high speed RC oscillator (HIRC). - * | | |0 = Clock cycles delay Disabled. - * | | |1 = Clock cycles delay Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |PDWKIEN |Power-down Mode Wake-up Interrupt Enable Bit (Write Protect) - * | | |0 = Power-down mode wake-up interrupt Disabled. - * | | |1 = Power-down mode wake-up interrupt Enabled. - * | | |Note1: The interrupt will occur when both PDWKIF and PDWKIEN are high. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |PDWKIF |Power-down Mode Wake-up Interrupt Status - * | | |Set by "Power-down wake-up event", it indicates that resume from Power-down mode. - * | | |The flag is set if any wake-up source is occurred. Refer Power Modes and Wake-up Sources chapter. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: This bit works only if PDWKIEN (CLK_PWRCTL[5]) set to 1. - * |[7] |PDEN |System Power-down Enable (Write Protect) - * | | |When this bit is set to 1, Power-down mode is enabled and chip keeps active till the CPU sleep mode is also active and then the chip enters Power-down mode. - * | | |When chip wakes up from Power-down mode, this bit is auto cleared. Users need to set this bit again for next Power-down. - * | | |In Power-down mode, HXT and the HIRC will be disabled in this mode, but LXT and LIRC are not controlled by Power-down mode. - * | | |In Power-down mode, the PLL and system clock are disabled, and ignored the clock source selection. The clocks of peripheral are not controlled by Power-down mode, if the peripheral clock source is from LXT or LIRC. - * | | |0 = Chip operating normally or chip in idle mode because of WFI command. - * | | |1 = Chip enters Power-down mode instant or wait CPU sleep command WFI. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |HXTTBEN |HXT Crystal TURBO Mode (Write Protect) - * | | |0 = HXT Crystal TURBO mode disabled. - * | | |1 = HXT Crystal TURBO mode enabled. - * | | |Note1: Reset by power on reset. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[22:20] |HXTGAIN |HXT Gain Control Bit (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |Gain control is used to enlarge the gain of crystal to make sure crystal work normally. If gain control is enabled, crystal will consume more power than gain control off. - * | | |000 = HXT frequency is lower than from 4 MHz. - * | | |001 = HXT frequency is from 4 MHz to 8 MHz. - * | | |010 = HXT frequency is from 8 MHz to 12 MHz. - * | | |011 = HXT frequency is from 12 MHz to 16 MHz. - * | | |100 = HXT frequency is from 16 MHz to 24 MHz. - * | | |111 = HXT frequency is from 24 MHz to 32 MHz. - * | | |Others: Reserved - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[24] |LXTSELXT |LXT Mode Selection - * | | |0 = LXT work as crystal mode. PF.4 and PF.5 are configured as external low speed crystal (LXT) pins. - * | | |1 = LXT work as external clock mode. PF.5 is configured as external clock input pin. - * | | |Note1: When LXTSELXT = 1, PF.5 MFP should be setting as GPIO mode. The DC characteristic of X32_IN is the same as GPIO. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[26:25] |LXTGAIN |LXT Gain Control Bit (Write Protect) - * | | |00 = LXT Crystal ESR = 35K, CL=12.5pFReserved. - * | | |10 = LXT Crystal ESR = 70K, CL=12.5pFReserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::AHBCLK - * Offset: 0x04 AHB Devices Clock Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |PDMACKEN |PDMA Controller Clock Enable Bit - * | | |0 = PDMA peripheral clock Disabled. - * | | |1 = PDMA peripheral clock Enabled. - * |[2] |ISPCKEN |Flash ISP Controller Clock Enable Bit - * | | |0 = Flash ISP peripheral clock Disabled. - * | | |1 = Flash ISP peripheral clock Enabled. - * |[3] |EBICKEN |EBI Controller Clock Enable Bit - * | | |0 = EBI peripheral clock Disabled. - * | | |1 = EBI peripheral clock Enabled.Reserved. - * |[4] |HDIVCKEN |HDIV Controller Clock Enable Bit - * | | |0 = HDIV peripheral clock Disabled. - * | | |1 = HDIV peripheral clock Enabled.Reserved. - * |[7] |CRCCKEN |CRC Generator Controller Clock Enable Bit - * | | |0 = CRC peripheral clock Disabled. - * | | |1 = CRC peripheral clock Enabled. - * @var CLK_T::APBCLK0 - * Offset: 0x08 APB Devices Clock Enable Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDTCKEN |Watchdog Timer Clock Enable Bit (Write Protect) - * | | |0 = Watchdog timer clock Disabled. - * | | |1 = Watchdog timer clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. Reserved. - * | | |Note: Reset by power on reset or watch dog reset or software chip reset. - * |[2] |TMR0CKEN |Timer0 Clock Enable Bit - * | | |0 = Timer0 clock Disabled. - * | | |1 = Timer0 clock Enabled. - * |[3] |TMR1CKEN |Timer1 Clock Enable Bit - * | | |0 = Timer1 clock Disabled. - * | | |1 = Timer1 clock Enabled. - * |[4] |TMR2CKEN |Timer2 Clock Enable Bit - * | | |0 = Timer2 clock Disabled. - * | | |1 = Timer2 clock Enabled. - * |[5] |TMR3CKEN |Timer3 Clock Enable Bit - * | | |0 = Timer3 clock Disabled. - * | | |1 = Timer3 clock Enabled. - * |[6] |CLKOCKEN |CLKO Clock Enable Bit - * | | |0 = CLKO clock Disabled. - * | | |1 = CLKO clock Enabled. - * |[7] |ACMP01CKEN|Analog Comparator 0/1 Clock Enable Bit - * | | |0 = Analog comparator 0/1 clock Disabled. - * | | |1 = Analog comparator 0/1 clock Enabled. - * |[8] |I2C0CKEN |I2C0 Clock Enable Bit - * | | |0 = I2C0 clock Disabled. - * | | |1 = I2C0 clock Enabled. - * |[9] |I2C1CKEN |I2C1 Clock Enable Bit - * | | |0 = I2C1 clock Disabled. - * | | |1 = I2C1 clock Enabled. - * |[13] |SPI0CKEN |SPI0 Clock Enable Bit - * | | |0 = SPI0 clock Disabled. - * | | |1 = SPI0 clock Enabled. - * |[16] |UART0CKEN |UART0 Clock Enable Bit - * | | |0 = UART0 clock Disabled. - * | | |1 = UART0 clock Enabled. - * |[17] |UART1CKEN |UART1 Clock Enable Bit - * | | |0 = UART1 clock Disabled. - * | | |1 = UART1 clock Enabled. - * |[18] |UART2CKEN |UART2 Clock Enable Bit - * | | |0 = UART2 clock Disabled. - * | | |1 = UART2 clock Enabled. - * |[27] |USBDCKEN |USB Device Clock Enable Bit - * | | |0 = USB Device clock Disabled. - * | | |1 = USB Device clock Enabled.Reserved. - * |[28] |ADCCKEN |Analog-digital-converter (ADC) Clock Enable Bit - * | | |0 = ADC clock Disabled. - * | | |1 = ADC clock Enabled.Reserved. - * @var CLK_T::APBCLK1 - * Offset: 0x0C APB Devices Clock Enable Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |USCI0CKEN |USCI0 Clock Enable Bit - * | | |0 = USCI0 clock Disabled. - * | | |1 = USCI0 clock Enabled. - * |[16] |PWM0CKEN |PWM0 Clock Enable Bit - * | | |0 = PWM0 clock Disabled. - * | | |1 = PWM0 clock Enabled. - * |[17] |PWM1CKEN |PWM1 Clock Enable Bit - * | | |0 = PWM1 clock Disabled. - * | | |1 = PWM1 clock Enabled. - * @var CLK_T::CLKSEL0 - * Offset: 0x10 Clock Source Select Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |HCLKSEL |HCLK Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |000 = Clock source from HXT. - * | | |001 = Clock source from LXT. - * | | |010 = Clock source from PLL. (M031_E/M032_E/M031_D only) - * | | | = Clock source from HIRC. (M031_C/B only) - * | | |011 = Clock source from LIRC. - * | | |111= Clock source from HIRC. - * | | |Other = Reserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: Reset by power on reset. - * |[5:3] |STCLKSEL |Cortex-M0 SysTick Clock Source Selection (Write Protect) - * | | |If SYST_CTRL[2]=0, SysTick uses listed clock source below. - * | | |000 = Clock source from HXT. - * | | |001 = Clock source from LXT. - * | | |010 = Clock source from HXT/2. - * | | |011 = Clock source from HCLK/2. - * | | |111 = Clock source from HIRC/2. - * | | |Other = Reserved. - * | | |Note: if SysTick clock source is not from HCLK (i.e. SYST_CTRL[2] = 0), SysTick clock source must less than or equal to HCLK/2. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |USBDSEL |USB Device Clock Source Selection (Write Protect) - * | | |These bits are protected bit. It means programming this bit needs to write "59h", "16h", "88h" to address 0x4000_0100 to disable register protection. Refer to the register REGWRPROT at address GCR_BA+0x100. - * | | |0 = Clock source from HIRC. - * | | |1 = Clock source from PLL divided. (M031_E/M032_E only) - * | | | = Clock source from HIRC. (M031_D/C/B only) - * @var CLK_T::CLKSEL1 - * Offset: 0x14 Clock Source Select Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WDTSEL |Watchdog Timer Clock Source Selection (Write Protect) - * | | |00 = Reserved. - * | | |01 = Clock source from external low speed crystal oscillator (LXT). - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from internal low speed RC oscillator (LIRC). - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Will be forced to 11 when CONFIG0[31], CONFIG0[4], CONFIG0[3] are all ones. - * |[3:2] |WWDTSEL |Window Watchdog Timer Clock Source Selection (Write Protect) - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * |[6:4] |CLKOSEL |Clock Divider Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from external low speed crystal oscillator (LXT). - * | | |010 = Clock source from HCLK. - * | | |011 = Clock source from internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from internal low speed RC oscillator (LIRC). - * | | |101 = Clock source from internal high speed RC oscillator (HIRC). - * | | |110 = Clock source from PLL. (M031_E/D only). - * | | | = Clock source from internal high speed RC oscillator (HIRC). (M031_C/B only). - * |[10:8] |TMR0SEL |TIMER0 Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock T0 pin. - * | | |101 = Clock source from internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[14:12] |TMR1SEL |TIMER1 Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock T1 pin. - * | | |101 = Clock source from internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[18:16] |TMR2SEL |TIMER2 Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock T2 pin. - * | | |101 = Clock source from internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[22:20] |TMR3SEL |TIMER3 Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock T3 pin. - * | | |101 = Clock source from internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[26:24] |UART0SEL |UART0 Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. (M031_E/D only) - * | | | = Clock source from PCLK0. (M031_C/B only). - * | | |010 = Clock source from external low speed crystal oscillator (LXT). - * | | |011 = Clock source from internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK0. - * | | |Other = Reserved. - * |[30:28] |UART1SEL |UART1 Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. (M031_E/D only) - * | | | = Clock source from PCLK1. (M031_C/B only). - * | | |010 = Clock source from external low speed crystal oscillator (LXT). - * | | |011 = Clock source from internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK1. - * | | |Other = Reserved. - * @var CLK_T::CLKSEL2 - * Offset: 0x18 Clock Source Select Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWM0SEL |PWM0 Clock Source Selection - * | | |The peripheral clock source of PWM0 is defined by PWM0SEL. - * | | |0 = Clock source from PLL. (M031_E/D only) - * | | | = Clock source from PCLK0. (M031_C/B only). - * | | |1 = Clock source from PCLK0. - * |[1] |PWM1SEL |PWM1 Clock Source Selection - * | | |The peripheral clock source of PWM1 is defined by PWM1SEL. - * | | |0 = Clock source from PLL. (M031_E/D only) - * | | | = Clock source from PCLK1. (M031_C/B only). - * | | |1 = Clock source from PCLK1. - * |[5:4] |SPI0SEL |SPI0 Clock Source Selection - * | | |00 = Clock source from external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. (M031_E/D only) - * | | | = Clock source from PCLK1. (M031_C/B only). - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from internal high speed RC oscillator (HIRC). - * |[21:20] |ADCSEL |ADC Clock Source Selection - * | | |00 = Clock source from external high speed crystal oscillator (HXT) clock. - * | | |01 = Clock source from PLL. (M031_E/D only) - * | | | = Clock source from PCLK1. (M031_C/B only). - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from internal high speed RC oscillator (HIRC) clock. - * @var CLK_T::CLKSEL3 - * Offset: 0x1C Clock Source Select Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[26:24] |UART2SEL |UART2 Clock Source Selection - * | | |000 = Clock source from external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. (M031_E/D only) - * | | | = Clock source from PCLK0. (M031_C/B only). - * | | |010 = Clock source from external low speed crystal oscillator (LXT). - * | | |011 = Clock source from internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK0. - * | | |Other = Reserved. - * @var CLK_T::CLKDIV0 - * Offset: 0x20 Clock Divider Number Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |HCLKDIV |HCLK Clock Divide Number From HCLK Clock Source - * | | |HCLK clock frequency = (HCLK clock source frequency) / (HCLKDIV + 1). - * |[7:4] |USBDIV |USB Clock Divide Number From PLL Clock - * | | |USB clock frequency = (PLL frequency) / (USBDIV + 1). - * |[11:8] |UART0DIV |UART0 Clock Divide Number From UART0 Clock Source - * | | |UART0 clock frequency = (UART0 clock source frequency) / (UART0DIV + 1). - * |[15:12] |UART1DIV |UART1 Clock Divide Number From UART1 Clock Source - * | | |UART1 clock frequency = (UART1 clock source frequency) / (UART1DIV + 1). - * |[23:16] |ADCDIV |ADC Clock Divide Number From ADC Clock Source - * | | |ADC clock frequency = (ADC clock source frequency) / (ADCDIV + 1). - * @var CLK_T::CLKDIV4 - * Offset: 0x30 Clock Divider Number Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |UART2DIV |UART2 Clock Divide Number From UART2 Clock Source - * | | |UART2 clock frequency = (UART2 clock source frequency) / (UART2DIV + 1). - * @var CLK_T::PCLKDIV - * Offset: 0x34 APB Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |APB0DIV |APB0 Clock DIvider - * | | |APB0 clock can be divided from HCLK. - * | | |000 = PCLK0 = HCLK. - * | | |001 = PCLK0 = 1/2 HCLK. - * | | |010 = PCLK0 = 1/4 HCLK. - * | | |011 = PCLK0 = 1/8 HCLK. - * | | |100 = PCLK0 = 1/16 HCLK. - * | | |Others = Reserved. - * |[6:4] |APB1DIV |APB1 Clock DIvider - * | | |APB1 clock can be divided from HCLK. - * | | |000 = PCLK1 = HCLK. - * | | |001 = PCLK1 = 1/2 HCLK. - * | | |010 = PCLK1 = 1/4 HCLK. - * | | |011 = PCLK1 = 1/8 HCLK. - * | | |100 = PCLK1 = 1/16 HCLK. - * | | |Others = Reserved. - * @var CLK_T::PLLCTL - * Offset: 0x40 PLL Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Refer to the formulas below the table. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13:9] |INDIV |PLL Input Divider Control (Write Protect) - * | | |Refer to the formulas below the table. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[15:14] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Refer to the formulas below the table. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |PD |Power-down Mode (Write Protect) - * | | |If set the PDEN bit to 1 in CLK_PWRCTL register, the PLL will enter Power-down mode, too. - * | | |0 = PLL is in normal mode. - * | | |1 = PLL is in Power-down mode (default). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock FIN. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[18] |OE |PLL OE (FOUT Enable) Pin Control (Write Protect) - * | | |0 = PLL FOUT Enabled. - * | | |1 = PLL FOUT is fixed low. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[19] |PLLSRC |PLL Source Clock Selection (Write Protect) - * | | |0 = PLL source clock from external high-speed crystal oscillator (HXT). - * | | |1 = PLL source clock from 48 MHz internal high-speed oscillator (HIRC/4). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |STBSEL |PLL Stable Counter Selection (Write Protect) - * | | |0 = PLL stable time is 6144 PLL source clock (suitable for source clock is equal to or less than 12 MHz). - * | | |1 = PLL stable time is 16128 PLL source clock (suitable for source clock is larger than 12 MHz). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::STATUS - * Offset: 0x50 Clock Status Monitor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTSTB |HXT Clock Source Stable Flag (Read Only) - * | | |0 = External high speed crystal oscillator (HXT) clock is not stable or disabled. - * | | |1 = External high speed crystal oscillator (HXT) clock is stable and enabled. - * |[1] |LXTSTB |LXT Clock Source Stable Flag (Read Only) - * | | |0 = External low speed crystal oscillator (LXT) clock is not stable or disabled. - * | | |1 = External low speed crystal oscillator (LXT) clock is stabled and enabled. - * |[2] |PLLSTB |Internal PLL Clock Source Stable Flag (Read Only) - * | | |0 = Internal PLL clock is not stable or disabled. - * | | |1 = Internal PLL clock is stable and enabled. - * | | |Reserved. (M031_C/B only) - * |[3] |LIRCSTB |LIRC Clock Source Stable Flag (Read Only) - * | | |0 = Internal low speed RC oscillator (LIRC) clock is not stable or disabled. - * | | |1 = Internal low speed RC oscillator (LIRC) clock is stable and enabled. - * |[4] |HIRCSTB |HIRC Clock Source Stable Flag (Read Only) - * | | |0 = Internal high speed RC oscillator (HIRC) clock is not stable or disabled. - * | | |1 = Internal high speed RC oscillator (HIRC) clock is stable and enabled. - * |[7] |CLKSFAIL |Clock Switching Fail Flag (Read Only) - * | | |This bit is updated when software switches system clock source. If switch target clock is stable, this bit will be set to 0. If switch target clock is not stable, this bit will be set to 1. - * | | |0 = Clock switching success. - * | | |1 = Clock switching failure. - * | | |Note: Write 1 to clear the bit to 0. - * @var CLK_T::CLKOCTL - * Offset: 0x60 Clock Output Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |FREQSEL |Clock Output Frequency Selection - * | | |The formula of output frequency is - * | | |Fout = Fin/(2^(N+1)). - * | | |Fin is the input clock frequency. - * | | |Fout is the frequency of divider output clock. - * | | |N is the 4-bit value of FREQSEL[3:0]. - * |[4] |CLKOEN |Clock Output Enable Bit - * | | |0 = Clock Output function Disabled. - * | | |1 = Clock Output function Enabled. - * |[5] |DIV1EN |Clock Output Divide One Enable Bit - * | | |0 = Clock Output will output clock with source frequency divided by FREQSEL. - * | | |1 = Clock Output will output clock with source frequency. - * @var CLK_T::CLKDCTL - * Offset: 0x70 Clock Fail Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |HXTFDEN |HXT Clock Fail Detector Enable Bit - * | | |0 = External high speed crystal oscillator (HXT) clock fail detector Disabled. - * | | |1 = External high speed crystal oscillator (HXT) clock fail detector Enabled. - * |[5] |HXTFIEN |HXT Clock Fail Interrupt Enable Bit - * | | |0 = External high speed crystal oscillator (HXT) clock fail interrupt Disabled. - * | | |1 = External high speed crystal oscillator (HXT) clock fail interrupt Enabled. - * |[12] |LXTFDEN |LXT Clock Fail Detector Enable Bit - * | | |0 = External low speed crystal oscillator (LXT) clock fail detector Disabled. - * | | |1 = External low speed crystal oscillator (LXT) clock fail detector Enabled. - * |[13] |LXTFIEN |LXT Clock Fail Interrupt Enable Bit - * | | |0 = External low speed crystal oscillator (LXT) clock fail interrupt Disabled. - * | | |1 = External low speed crystal oscillator (LXT) clock fail interrupt Enabled. - * |[16] |HXTFQDEN |HXT Clock Frequency Range Detector Enable Bit - * | | |0 = External high speed crystal oscillator (HXT) clock frequency range detector Disabled. - * | | |1 = External high speed crystal oscillator (HXT) clock frequency range detector Enabled. - * |[17] |HXTFQIEN |HXT Clock Frequency Range Detector Interrupt Enable Bit - * | | |0 = External high speed crystal oscillator (HXT) clock frequency range detector fail interrupt Disabled. - * | | |1 = External high speed crystal oscillator (HXT) clock frequency range detector fail interrupt Enabled. - * @var CLK_T::CLKDSTS - * Offset: 0x74 Clock Fail Detector Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFIF |HXT Clock Fail Interrupt Flag (Write Protect) - * | | |0 = External high speed crystal oscillator (HXT) clock is normal. - * | | |1 = External high speed crystal oscillator (HXT) clock stops. - * | | |Note: Write 1 to clear the bit to 0. - * |[1] |LXTFIF |LXT Clock Fail Interrupt Flag (Write Protect) - * | | |0 = External low speed crystal oscillator (LXT) clock is normal. - * | | |1 = External low speed crystal oscillator (LXT) stops. - * | | |Note: Write 1 to clear the bit to 0. - * |[8] |HXTFQIF |HXT Clock Frequency Range Detector Interrupt Flag (Write Protect) - * | | |0 = External high speed crystal oscillator (HXT) clock frequency is normal. - * | | |1 = External high speed crystal oscillator (HXT) clock frequency is abnormal. - * | | |Note: Write 1 to clear the bit to 0. - * @var CLK_T::CDUPB - * Offset: 0x78 Clock Frequency Range Detector Upper Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |UPERBD |HXT Clock Frequency Range Detector Upper Boundary Value - * | | |The bits define the maximum value of frequency range detector window. - * | | |When HXT frequency higher than this maximum frequency value, the HXT Clock Frequency Range Detector Interrupt Flag will set to 1. - * @var CLK_T::CDLOWB - * Offset: 0x7C Clock Frequency Range Detector Lower Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |LOWERBD |HXT Clock Frequency Range Detector Lower Boundary Value - * | | |The bits define the minimum value of frequency range detector window. - * | | |When HXT frequency lower than this minimum frequency value, the HXT Clock Frequency Range Detector Interrupt Flag will set to 1. - * @var CLK_T::HXTFSEL - * Offset: 0xB4 HXT Filter Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFSEL |HXT Filter Select - * | | |0 = HXT frequency is > 12MHz. - * | | |1 = HXT frequency is <= 12MHz. - * | | |Note: This bit should not be changed during HXT is running. - */ - __IO uint32_t PWRCTL; /*!< [0x0000] System Power-down Control Register */ - __IO uint32_t AHBCLK; /*!< [0x0004] AHB Devices Clock Enable Control Register */ - __IO uint32_t APBCLK0; /*!< [0x0008] APB Devices Clock Enable Control Register 0 */ - __IO uint32_t APBCLK1; /*!< [0x000c] APB Devices Clock Enable Control Register 1 */ - __IO uint32_t CLKSEL0; /*!< [0x0010] Clock Source Select Control Register 0 */ - __IO uint32_t CLKSEL1; /*!< [0x0014] Clock Source Select Control Register 1 */ - __IO uint32_t CLKSEL2; /*!< [0x0018] Clock Source Select Control Register 2 */ - __IO uint32_t CLKSEL3; /*!< [0x001c] Clock Source Select Control Register 3 */ - __IO uint32_t CLKDIV0; /*!< [0x0020] Clock Divider Number Register 0 */ - __I uint32_t RESERVE0[3]; - __IO uint32_t CLKDIV4; /*!< [0x0030] Clock Divider Number Register 4 */ - __IO uint32_t PCLKDIV; /*!< [0x0034] APB Clock Divider Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t PLLCTL; /*!< [0x0040] PLL Control Register */ - __I uint32_t RESERVE2[3]; - __I uint32_t STATUS; /*!< [0x0050] Clock Status Monitor Register */ - __I uint32_t RESERVE3[3]; - __IO uint32_t CLKOCTL; /*!< [0x0060] Clock Output Control Register */ - __I uint32_t RESERVE4[3]; - __IO uint32_t CLKDCTL; /*!< [0x0070] Clock Fail Detector Control Register */ - __IO uint32_t CLKDSTS; /*!< [0x0074] Clock Fail Detector Status Register */ - __IO uint32_t CDUPB; /*!< [0x0078] Clock Frequency Range Detector Upper Boundary Register */ - __IO uint32_t CDLOWB; /*!< [0x007c] Clock Frequency Range Detector Lower Boundary Register */ - __IO uint32_t LDOCTL; /*!< [0x0080] LDO Control Register */ - __I uint32_t RESERVE5[12]; - __IO uint32_t HXTFSEL; /*!< [0x00b4] HXT Filter Select Control Register */ - __I uint32_t RESERVE9[14]; - __IO uint32_t TESTCLK; /*!< [0x00f0] Test Clock Control Register */ - -} CLK_T; - -/** - @addtogroup CLK_CONST CLK Bit Field Definition - Constant Definitions for CLK Controller -@{ */ - -#define CLK_PWRCTL_HXTEN_Pos (0) /*!< CLK_T::PWRCTL: HXTEN Position */ -#define CLK_PWRCTL_HXTEN_Msk (0x1ul << CLK_PWRCTL_HXTEN_Pos) /*!< CLK_T::PWRCTL: HXTEN Mask */ - -#define CLK_PWRCTL_LXTEN_Pos (1) /*!< CLK_T::PWRCTL: LXTEN Position */ -#define CLK_PWRCTL_LXTEN_Msk (0x1ul << CLK_PWRCTL_LXTEN_Pos) /*!< CLK_T::PWRCTL: LXTEN Mask */ - -#define CLK_PWRCTL_HIRCEN_Pos (2) /*!< CLK_T::PWRCTL: HIRCEN Position */ -#define CLK_PWRCTL_HIRCEN_Msk (0x1ul << CLK_PWRCTL_HIRCEN_Pos) /*!< CLK_T::PWRCTL: HIRCEN Mask */ - -#define CLK_PWRCTL_LIRCEN_Pos (3) /*!< CLK_T::PWRCTL: LIRCEN Position */ -#define CLK_PWRCTL_LIRCEN_Msk (0x1ul << CLK_PWRCTL_LIRCEN_Pos) /*!< CLK_T::PWRCTL: LIRCEN Mask */ - -#define CLK_PWRCTL_PDWKDLY_Pos (4) /*!< CLK_T::PWRCTL: PDWKDLY Position */ -#define CLK_PWRCTL_PDWKDLY_Msk (0x1ul << CLK_PWRCTL_PDWKDLY_Pos) /*!< CLK_T::PWRCTL: PDWKDLY Mask */ - -#define CLK_PWRCTL_PDWKIEN_Pos (5) /*!< CLK_T::PWRCTL: PDWKIEN Position */ -#define CLK_PWRCTL_PDWKIEN_Msk (0x1ul << CLK_PWRCTL_PDWKIEN_Pos) /*!< CLK_T::PWRCTL: PDWKIEN Mask */ - -#define CLK_PWRCTL_PDWKIF_Pos (6) /*!< CLK_T::PWRCTL: PDWKIF Position */ -#define CLK_PWRCTL_PDWKIF_Msk (0x1ul << CLK_PWRCTL_PDWKIF_Pos) /*!< CLK_T::PWRCTL: PDWKIF Mask */ - -#define CLK_PWRCTL_PDEN_Pos (7) /*!< CLK_T::PWRCTL: PDEN Position */ -#define CLK_PWRCTL_PDEN_Msk (0x1ul << CLK_PWRCTL_PDEN_Pos) /*!< CLK_T::PWRCTL: PDEN Mask */ - -#define CLK_PWRCTL_DBPDEN_Pos (9) /*!< CLK_T::PWRCTL: DBPDEN Position */ -#define CLK_PWRCTL_DBPDEN_Msk (0x1ul << CLK_PWRCTL_DBPDEN_Pos) /*!< CLK_T::PWRCTL: DBPDEN Mask */ - -#define CLK_PWRCTL_HXTTBEN_Pos (13) /*!< CLK_T::PWRCTL: HXTTBEN Position */ -#define CLK_PWRCTL_HXTTBEN_Msk (0x1ul << CLK_PWRCTL_HXTTBEN_Pos) /*!< CLK_T::PWRCTL: HXTTBEN Mask */ - -#define CLK_PWRCTL_HIRCSTBS_Pos (16) /*!< CLK_T::PWRCTL: HIRCSTBS Position */ -#define CLK_PWRCTL_HIRCSTBS_Msk (0x3ul << CLK_PWRCTL_HIRCSTBS_Pos) /*!< CLK_T::PWRCTL: HIRCSTBS Mask */ - -#define CLK_PWRCTL_HXTGAIN_Pos (20) /*!< CLK_T::PWRCTL: HXTGAIN Position */ -#define CLK_PWRCTL_HXTGAIN_Msk (0x7ul << CLK_PWRCTL_HXTGAIN_Pos) /*!< CLK_T::PWRCTL: HXTGAIN Mask */ - -#define CLK_PWRCTL_LXTSELXT_Pos (24) /*!< CLK_T::PWRCTL: LXTSELXT Position */ -#define CLK_PWRCTL_LXTSELXT_Msk (0x1ul << CLK_PWRCTL_LXTSELXT_Pos) /*!< CLK_T::PWRCTL: LXTSELXT Mask */ - -#define CLK_PWRCTL_LXTGAIN_Pos (25) /*!< CLK_T::PWRCTL: LXTGAIN Position */ -#define CLK_PWRCTL_LXTGAIN_Msk (0x3ul << CLK_PWRCTL_LXTGAIN_Pos) /*!< CLK_T::PWRCTL: LXTGAIN Mask */ - -#define CLK_PWRCTL_LXTSTBS_Pos (30) /*!< CLK_T::PWRCTL: LXTSTBS Position */ -#define CLK_PWRCTL_LXTSTBS_Msk (0x1ul << CLK_PWRCTL_LXTSTBS_Pos) /*!< CLK_T::PWRCTL: LXTSTBS Mask */ - -#define CLK_PWRCTL_LXTTBEN_Pos (31) /*!< CLK_T::PWRCTL: LXTTBEN Position */ -#define CLK_PWRCTL_LXTTBEN_Msk (0x1ul << CLK_PWRCTL_LXTTBEN_Pos) /*!< CLK_T::PWRCTL: LXTTBEN Mask */ - -#define CLK_AHBCLK_PDMACKEN_Pos (1) /*!< CLK_T::AHBCLK: PDMACKEN Position */ -#define CLK_AHBCLK_PDMACKEN_Msk (0x1ul << CLK_AHBCLK_PDMACKEN_Pos) /*!< CLK_T::AHBCLK: PDMACKEN Mask */ - -#define CLK_AHBCLK_ISPCKEN_Pos (2) /*!< CLK_T::AHBCLK: ISPCKEN Position */ -#define CLK_AHBCLK_ISPCKEN_Msk (0x1ul << CLK_AHBCLK_ISPCKEN_Pos) /*!< CLK_T::AHBCLK: ISPCKEN Mask */ - -#define CLK_AHBCLK_EBICKEN_Pos (3) /*!< CLK_T::AHBCLK: EBICKEN Position */ -#define CLK_AHBCLK_EBICKEN_Msk (0x1ul << CLK_AHBCLK_EBICKEN_Pos) /*!< CLK_T::AHBCLK: EBICKEN Mask */ - -#define CLK_AHBCLK_HDIVCKEN_Pos (4) /*!< CLK_T::AHBCLK: HDIVCKEN Position */ -#define CLK_AHBCLK_HDIVCKEN_Msk (0x1ul << CLK_AHBCLK_HDIVCKEN_Pos) /*!< CLK_T::AHBCLK: HDIVCKEN Mask */ - -#define CLK_AHBCLK_CRCCKEN_Pos (7) /*!< CLK_T::AHBCLK: CRCCKEN Position */ -#define CLK_AHBCLK_CRCCKEN_Msk (0x1ul << CLK_AHBCLK_CRCCKEN_Pos) /*!< CLK_T::AHBCLK: CRCCKEN Mask */ - -#define CLK_AHBCLK_SRAM0IDLE_Pos (20) /*!< CLK_T::AHBCLK: SRAM0IDLE Position */ -#define CLK_AHBCLK_SRAM0IDLE_Msk (0x1ul << CLK_AHBCLK_SRAM0IDLE_Pos) /*!< CLK_T::AHBCLK: SRAM0IDLE Mask */ - -#define CLK_APBCLK0_WDTCKEN_Pos (0) /*!< CLK_T::APBCLK0: WDTCKEN Position */ -#define CLK_APBCLK0_WDTCKEN_Msk (0x1ul << CLK_APBCLK0_WDTCKEN_Pos) /*!< CLK_T::APBCLK0: WDTCKEN Mask */ - -#define CLK_APBCLK0_RTCCKEN_Pos (1) /*!< CLK_T::APBCLK0: RTCCKEN Position */ -#define CLK_APBCLK0_RTCCKEN_Msk (0x1ul << CLK_APBCLK0_RTCCKEN_Pos) /*!< CLK_T::APBCLK0: RTCCKEN Mask */ - -#define CLK_APBCLK0_TMR0CKEN_Pos (2) /*!< CLK_T::APBCLK0: TMR0CKEN Position */ -#define CLK_APBCLK0_TMR0CKEN_Msk (0x1ul << CLK_APBCLK0_TMR0CKEN_Pos) /*!< CLK_T::APBCLK0: TMR0CKEN Mask */ - -#define CLK_APBCLK0_TMR1CKEN_Pos (3) /*!< CLK_T::APBCLK0: TMR1CKEN Position */ -#define CLK_APBCLK0_TMR1CKEN_Msk (0x1ul << CLK_APBCLK0_TMR1CKEN_Pos) /*!< CLK_T::APBCLK0: TMR1CKEN Mask */ - -#define CLK_APBCLK0_TMR2CKEN_Pos (4) /*!< CLK_T::APBCLK0: TMR2CKEN Position */ -#define CLK_APBCLK0_TMR2CKEN_Msk (0x1ul << CLK_APBCLK0_TMR2CKEN_Pos) /*!< CLK_T::APBCLK0: TMR2CKEN Mask */ - -#define CLK_APBCLK0_TMR3CKEN_Pos (5) /*!< CLK_T::APBCLK0: TMR3CKEN Position */ -#define CLK_APBCLK0_TMR3CKEN_Msk (0x1ul << CLK_APBCLK0_TMR3CKEN_Pos) /*!< CLK_T::APBCLK0: TMR3CKEN Mask */ - -#define CLK_APBCLK0_CLKOCKEN_Pos (6) /*!< CLK_T::APBCLK0: CLKOCKEN Position */ -#define CLK_APBCLK0_CLKOCKEN_Msk (0x1ul << CLK_APBCLK0_CLKOCKEN_Pos) /*!< CLK_T::APBCLK0: CLKOCKEN Mask */ - -#define CLK_APBCLK0_ACMP01CKEN_Pos (7) /*!< CLK_T::APBCLK0: ACMP01CKEN Position */ -#define CLK_APBCLK0_ACMP01CKEN_Msk (0x1ul << CLK_APBCLK0_ACMP01CKEN_Pos) /*!< CLK_T::APBCLK0: ACMP01CKEN Mask */ - -#define CLK_APBCLK0_I2C0CKEN_Pos (8) /*!< CLK_T::APBCLK0: I2C0CKEN Position */ -#define CLK_APBCLK0_I2C0CKEN_Msk (0x1ul << CLK_APBCLK0_I2C0CKEN_Pos) /*!< CLK_T::APBCLK0: I2C0CKEN Mask */ - -#define CLK_APBCLK0_I2C1CKEN_Pos (9) /*!< CLK_T::APBCLK0: I2C1CKEN Position */ -#define CLK_APBCLK0_I2C1CKEN_Msk (0x1ul << CLK_APBCLK0_I2C1CKEN_Pos) /*!< CLK_T::APBCLK0: I2C1CKEN Mask */ - -#define CLK_APBCLK0_QSPI0CKEN_Pos (12) /*!< CLK_T::APBCLK0: QSPI0CKEN Position */ -#define CLK_APBCLK0_QSPI0CKEN_Msk (0x1ul << CLK_APBCLK0_QSPI0CKEN_Pos) /*!< CLK_T::APBCLK0: QSPI0CKEN Mask */ - -#define CLK_APBCLK0_SPI0CKEN_Pos (13) /*!< CLK_T::APBCLK0: SPI0CKEN Position */ -#define CLK_APBCLK0_SPI0CKEN_Msk (0x1ul << CLK_APBCLK0_SPI0CKEN_Pos) /*!< CLK_T::APBCLK0: SPI0CKEN Mask */ - -#define CLK_APBCLK0_UART0CKEN_Pos (16) /*!< CLK_T::APBCLK0: UART0CKEN Position */ -#define CLK_APBCLK0_UART0CKEN_Msk (0x1ul << CLK_APBCLK0_UART0CKEN_Pos) /*!< CLK_T::APBCLK0: UART0CKEN Mask */ - -#define CLK_APBCLK0_UART1CKEN_Pos (17) /*!< CLK_T::APBCLK0: UART1CKEN Position */ -#define CLK_APBCLK0_UART1CKEN_Msk (0x1ul << CLK_APBCLK0_UART1CKEN_Pos) /*!< CLK_T::APBCLK0: UART1CKEN Mask */ - -#define CLK_APBCLK0_UART2CKEN_Pos (18) /*!< CLK_T::APBCLK0: UART2CKEN Position */ -#define CLK_APBCLK0_UART2CKEN_Msk (0x1ul << CLK_APBCLK0_UART2CKEN_Pos) /*!< CLK_T::APBCLK0: UART2CKEN Mask */ - -#define CLK_APBCLK0_UART3CKEN_Pos (19) /*!< CLK_T::APBCLK0: UART3CKEN Position */ -#define CLK_APBCLK0_UART3CKEN_Msk (0x1ul << CLK_APBCLK0_UART3CKEN_Pos) /*!< CLK_T::APBCLK0: UART3CKEN Mask */ - -#define CLK_APBCLK0_UART4CKEN_Pos (20) /*!< CLK_T::APBCLK0: UART4CKEN Position */ -#define CLK_APBCLK0_UART4CKEN_Msk (0x1ul << CLK_APBCLK0_UART4CKEN_Pos) /*!< CLK_T::APBCLK0: UART4CKEN Mask */ - -#define CLK_APBCLK0_UART5CKEN_Pos (21) /*!< CLK_T::APBCLK0: UART5CKEN Position */ -#define CLK_APBCLK0_UART5CKEN_Msk (0x1ul << CLK_APBCLK0_UART5CKEN_Pos) /*!< CLK_T::APBCLK0: UART5CKEN Mask */ - -#define CLK_APBCLK0_UART6CKEN_Pos (22) /*!< CLK_T::APBCLK0: UART6CKEN Position */ -#define CLK_APBCLK0_UART6CKEN_Msk (0x1ul << CLK_APBCLK0_UART6CKEN_Pos) /*!< CLK_T::APBCLK0: UART6CKEN Mask */ - -#define CLK_APBCLK0_UART7CKEN_Pos (23) /*!< CLK_T::APBCLK0: UART7CKEN Position */ -#define CLK_APBCLK0_UART7CKEN_Msk (0x1ul << CLK_APBCLK0_UART7CKEN_Pos) /*!< CLK_T::APBCLK0: UART7CKEN Mask */ - -#define CLK_APBCLK0_USBDCKEN_Pos (27) /*!< CLK_T::APBCLK0: USBDCKEN Position */ -#define CLK_APBCLK0_USBDCKEN_Msk (0x1ul << CLK_APBCLK0_USBDCKEN_Pos) /*!< CLK_T::APBCLK0: USBDCKEN Mask */ - -#define CLK_APBCLK0_ADCCKEN_Pos (28) /*!< CLK_T::APBCLK0: ADCCKEN Position */ -#define CLK_APBCLK0_ADCCKEN_Msk (0x1ul << CLK_APBCLK0_ADCCKEN_Pos) /*!< CLK_T::APBCLK0: ADCCKEN Mask */ - -#define CLK_APBCLK1_USCI0CKEN_Pos (8) /*!< CLK_T::APBCLK1: USCI0CKEN Position */ -#define CLK_APBCLK1_USCI0CKEN_Msk (0x1ul << CLK_APBCLK1_USCI0CKEN_Pos) /*!< CLK_T::APBCLK1: USCI0CKEN Mask */ - -#define CLK_APBCLK1_USCI1CKEN_Pos (9) /*!< CLK_T::APBCLK1: USCI1CKEN Position */ -#define CLK_APBCLK1_USCI1CKEN_Msk (0x1ul << CLK_APBCLK1_USCI1CKEN_Pos) /*!< CLK_T::APBCLK1: USCI1CKEN Mask */ - -#define CLK_APBCLK1_PWM0CKEN_Pos (16) /*!< CLK_T::APBCLK1: PWM0CKEN Position */ -#define CLK_APBCLK1_PWM0CKEN_Msk (0x1ul << CLK_APBCLK1_PWM0CKEN_Pos) /*!< CLK_T::APBCLK1: PWM0CKEN Mask */ - -#define CLK_APBCLK1_PWM1CKEN_Pos (17) /*!< CLK_T::APBCLK1: PWM1CKEN Position */ -#define CLK_APBCLK1_PWM1CKEN_Msk (0x1ul << CLK_APBCLK1_PWM1CKEN_Pos) /*!< CLK_T::APBCLK1: PWM1CKEN Mask */ - -#define CLK_APBCLK1_BPWM0CKEN_Pos (18) /*!< CLK_T::APBCLK1: BPWM0CKEN Position */ -#define CLK_APBCLK1_BPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM0CKEN Mask */ - -#define CLK_APBCLK1_BPWM1CKEN_Pos (19) /*!< CLK_T::APBCLK1: BPWM1CKEN Position */ -#define CLK_APBCLK1_BPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM1CKEN Mask */ - -#define CLK_CLKSEL0_HCLKSEL_Pos (0) /*!< CLK_T::CLKSEL0: HCLKSEL Position */ -#define CLK_CLKSEL0_HCLKSEL_Msk (0x7ul << CLK_CLKSEL0_HCLKSEL_Pos) /*!< CLK_T::CLKSEL0: HCLKSEL Mask */ - -#define CLK_CLKSEL0_STCLKSEL_Pos (3) /*!< CLK_T::CLKSEL0: STCLKSEL Position */ -#define CLK_CLKSEL0_STCLKSEL_Msk (0x7ul << CLK_CLKSEL0_STCLKSEL_Pos) /*!< CLK_T::CLKSEL0: STCLKSEL Mask */ - -#define CLK_CLKSEL0_USBDSEL_Pos (8) /*!< CLK_T::CLKSEL0: USBDSEL Position */ -#define CLK_CLKSEL0_USBDSEL_Msk (0x1ul << CLK_CLKSEL0_USBDSEL_Pos) /*!< CLK_T::CLKSEL0: USBDSEL Mask */ - -#define CLK_CLKSEL1_WDTSEL_Pos (0) /*!< CLK_T::CLKSEL1: WDTSEL Position */ -#define CLK_CLKSEL1_WDTSEL_Msk (0x3ul << CLK_CLKSEL1_WDTSEL_Pos) /*!< CLK_T::CLKSEL1: WDTSEL Mask */ - -#define CLK_CLKSEL1_WWDTSEL_Pos (2) /*!< CLK_T::CLKSEL1: WWDTSEL Position */ -#define CLK_CLKSEL1_WWDTSEL_Msk (0x3ul << CLK_CLKSEL1_WWDTSEL_Pos) /*!< CLK_T::CLKSEL1: WWDTSEL Mask */ - -#define CLK_CLKSEL1_CLKOSEL_Pos (4) /*!< CLK_T::CLKSEL1: CLKOSEL Position */ -#define CLK_CLKSEL1_CLKOSEL_Msk (0x7ul << CLK_CLKSEL1_CLKOSEL_Pos) /*!< CLK_T::CLKSEL1: CLKOSEL Mask */ - -#define CLK_CLKSEL1_TMR0SEL_Pos (8) /*!< CLK_T::CLKSEL1: TMR0SEL Position */ -#define CLK_CLKSEL1_TMR0SEL_Msk (0x7ul << CLK_CLKSEL1_TMR0SEL_Pos) /*!< CLK_T::CLKSEL1: TMR0SEL Mask */ - -#define CLK_CLKSEL1_TMR1SEL_Pos (12) /*!< CLK_T::CLKSEL1: TMR1SEL Position */ -#define CLK_CLKSEL1_TMR1SEL_Msk (0x7ul << CLK_CLKSEL1_TMR1SEL_Pos) /*!< CLK_T::CLKSEL1: TMR1SEL Mask */ - -#define CLK_CLKSEL1_TMR2SEL_Pos (16) /*!< CLK_T::CLKSEL1: TMR2SEL Position */ -#define CLK_CLKSEL1_TMR2SEL_Msk (0x7ul << CLK_CLKSEL1_TMR2SEL_Pos) /*!< CLK_T::CLKSEL1: TMR2SEL Mask */ - -#define CLK_CLKSEL1_TMR3SEL_Pos (20) /*!< CLK_T::CLKSEL1: TMR3SEL Position */ -#define CLK_CLKSEL1_TMR3SEL_Msk (0x7ul << CLK_CLKSEL1_TMR3SEL_Pos) /*!< CLK_T::CLKSEL1: TMR3SEL Mask */ - -#define CLK_CLKSEL1_UART0SEL_Pos (24) /*!< CLK_T::CLKSEL1: UART0SEL Position */ -#define CLK_CLKSEL1_UART0SEL_Msk (0x7ul << CLK_CLKSEL1_UART0SEL_Pos) /*!< CLK_T::CLKSEL1: UART0SEL Mask */ - -#define CLK_CLKSEL1_UART1SEL_Pos (28) /*!< CLK_T::CLKSEL1: UART1SEL Position */ -#define CLK_CLKSEL1_UART1SEL_Msk (0x7ul << CLK_CLKSEL1_UART1SEL_Pos) /*!< CLK_T::CLKSEL1: UART1SEL Mask */ - -#define CLK_CLKSEL2_PWM0SEL_Pos (0) /*!< CLK_T::CLKSEL2: PWM0SEL Position */ -#define CLK_CLKSEL2_PWM0SEL_Msk (0x1ul << CLK_CLKSEL2_PWM0SEL_Pos) /*!< CLK_T::CLKSEL2: PWM0SEL Mask */ - -#define CLK_CLKSEL2_PWM1SEL_Pos (1) /*!< CLK_T::CLKSEL2: PWM1SEL Position */ -#define CLK_CLKSEL2_PWM1SEL_Msk (0x1ul << CLK_CLKSEL2_PWM1SEL_Pos) /*!< CLK_T::CLKSEL2: PWM1SEL Mask */ - -#define CLK_CLKSEL2_QSPI0SEL_Pos (2) /*!< CLK_T::CLKSEL2: QSPI0SEL Position */ -#define CLK_CLKSEL2_QSPI0SEL_Msk (0x3ul << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< CLK_T::CLKSEL2: QSPI0SEL Mask */ - -#define CLK_CLKSEL2_SPI0SEL_Pos (4) /*!< CLK_T::CLKSEL2: SPI0SEL Position */ -#define CLK_CLKSEL2_SPI0SEL_Msk (0x3ul << CLK_CLKSEL2_SPI0SEL_Pos) /*!< CLK_T::CLKSEL2: SPI0SEL Mask */ - -#define CLK_CLKSEL2_BPWM0SEL_Pos (8) /*!< CLK_T::CLKSEL2: BPWM0SEL Position */ -#define CLK_CLKSEL2_BPWM0SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM0SEL Mask */ - -#define CLK_CLKSEL2_BPWM1SEL_Pos (9) /*!< CLK_T::CLKSEL2: BPWM1SEL Position */ -#define CLK_CLKSEL2_BPWM1SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM1SEL Mask */ - -#define CLK_CLKSEL2_ADCSEL_Pos (20) /*!< CLK_T::CLKSEL2: ADCSEL Position */ -#define CLK_CLKSEL2_ADCSEL_Msk (0x3ul << CLK_CLKSEL2_ADCSEL_Pos) /*!< CLK_T::CLKSEL2: ADCSEL Mask */ - -#define CLK_CLKSEL3_UART6SEL_Pos (8) /*!< CLK_T::CLKSEL63: UART6SEL Position */ -#define CLK_CLKSEL3_UART6SEL_Msk (0x7ul << CLK_CLKSEL3_UART6SEL_Pos) /*!< CLK_T::CLKSEL3: UART6SEL Mask */ - -#define CLK_CLKSEL3_UART7SEL_Pos (12) /*!< CLK_T::CLKSEL3: UART7SEL Position */ -#define CLK_CLKSEL3_UART7SEL_Msk (0x7ul << CLK_CLKSEL3_UART7SEL_Pos) /*!< CLK_T::CLKSEL3: UART7SEL Mask */ - -#define CLK_CLKSEL3_UART4SEL_Pos (16) /*!< CLK_T::CLKSEL3: UART4SEL Position */ -#define CLK_CLKSEL3_UART4SEL_Msk (0x7ul << CLK_CLKSEL3_UART4SEL_Pos) /*!< CLK_T::CLKSEL3: UART4SEL Mask */ - -#define CLK_CLKSEL3_UART5SEL_Pos (20) /*!< CLK_T::CLKSEL3: UART5SEL Position */ -#define CLK_CLKSEL3_UART5SEL_Msk (0x7ul << CLK_CLKSEL3_UART5SEL_Pos) /*!< CLK_T::CLKSEL3: UART5SEL Mask */ - -#define CLK_CLKSEL3_UART2SEL_Pos (24) /*!< CLK_T::CLKSEL3: UART2SEL Position */ -#define CLK_CLKSEL3_UART2SEL_Msk (0x7ul << CLK_CLKSEL3_UART2SEL_Pos) /*!< CLK_T::CLKSEL3: UART2SEL Mask */ - -#define CLK_CLKSEL3_UART3SEL_Pos (28) /*!< CLK_T::CLKSEL3: UART3SEL Position */ -#define CLK_CLKSEL3_UART3SEL_Msk (0x7ul << CLK_CLKSEL3_UART3SEL_Pos) /*!< CLK_T::CLKSEL3: UART3SEL Mask */ - -#define CLK_CLKDIV0_HCLKDIV_Pos (0) /*!< CLK_T::CLKDIV0: HCLKDIV Position */ -#define CLK_CLKDIV0_HCLKDIV_Msk (0xful << CLK_CLKDIV0_HCLKDIV_Pos) /*!< CLK_T::CLKDIV0: HCLKDIV Mask */ - -#define CLK_CLKDIV0_USBDIV_Pos (4) /*!< CLK_T::CLKDIV0: USBDIV Position */ -#define CLK_CLKDIV0_USBDIV_Msk (0xful << CLK_CLKDIV0_USBDIV_Pos) /*!< CLK_T::CLKDIV0: USBDIV Mask */ - -#define CLK_CLKDIV0_UART0DIV_Pos (8) /*!< CLK_T::CLKDIV0: UART0DIV Position */ -#define CLK_CLKDIV0_UART0DIV_Msk (0xful << CLK_CLKDIV0_UART0DIV_Pos) /*!< CLK_T::CLKDIV0: UART0DIV Mask */ - -#define CLK_CLKDIV0_UART1DIV_Pos (12) /*!< CLK_T::CLKDIV0: UART1DIV Position */ -#define CLK_CLKDIV0_UART1DIV_Msk (0xful << CLK_CLKDIV0_UART1DIV_Pos) /*!< CLK_T::CLKDIV0: UART1DIV Mask */ - -#define CLK_CLKDIV0_ADCDIV_Pos (16) /*!< CLK_T::CLKDIV0: ADCDIV Position */ -#define CLK_CLKDIV0_ADCDIV_Msk (0xfful << CLK_CLKDIV0_ADCDIV_Pos) /*!< CLK_T::CLKDIV0: ADCDIV Mask */ - -#define CLK_CLKDIV4_UART2DIV_Pos (0) /*!< CLK_T::CLKDIV4: UART2DIV Position */ -#define CLK_CLKDIV4_UART2DIV_Msk (0xful << CLK_CLKDIV4_UART2DIV_Pos) /*!< CLK_T::CLKDIV4: UART2DIV Mask */ - -#define CLK_CLKDIV4_UART3DIV_Pos (4) /*!< CLK_T::CLKDIV4: UART3DIV Position */ -#define CLK_CLKDIV4_UART3DIV_Msk (0xful << CLK_CLKDIV4_UART3DIV_Pos) /*!< CLK_T::CLKDIV4: UART3DIV Mask */ - -#define CLK_CLKDIV4_UART4DIV_Pos (8) /*!< CLK_T::CLKDIV4: UART4DIV Position */ -#define CLK_CLKDIV4_UART4DIV_Msk (0xful << CLK_CLKDIV4_UART4DIV_Pos) /*!< CLK_T::CLKDIV4: UART4DIV Mask */ - -#define CLK_CLKDIV4_UART5DIV_Pos (12) /*!< CLK_T::CLKDIV4: UART5DIV Position */ -#define CLK_CLKDIV4_UART5DIV_Msk (0xful << CLK_CLKDIV4_UART5DIV_Pos) /*!< CLK_T::CLKDIV4: UART5DIV Mask */ - -#define CLK_CLKDIV4_UART6DIV_Pos (16) /*!< CLK_T::CLKDIV4: UART6DIV Position */ -#define CLK_CLKDIV4_UART6DIV_Msk (0xful << CLK_CLKDIV4_UART6DIV_Pos) /*!< CLK_T::CLKDIV4: UART6DIV Mask */ - -#define CLK_CLKDIV4_UART7DIV_Pos (20) /*!< CLK_T::CLKDIV4: UART7DIV Position */ -#define CLK_CLKDIV4_UART7DIV_Msk (0xful << CLK_CLKDIV4_UART7DIV_Pos) /*!< CLK_T::CLKDIV4: UART7DIV Mask */ - -#define CLK_PCLKDIV_APB0DIV_Pos (0) /*!< CLK_T::PCLKDIV: APB0DIV Position */ -#define CLK_PCLKDIV_APB0DIV_Msk (0x7ul << CLK_PCLKDIV_APB0DIV_Pos) /*!< CLK_T::PCLKDIV: APB0DIV Mask */ - -#define CLK_PCLKDIV_APB1DIV_Pos (4) /*!< CLK_T::PCLKDIV: APB1DIV Position */ -#define CLK_PCLKDIV_APB1DIV_Msk (0x7ul << CLK_PCLKDIV_APB1DIV_Pos) /*!< CLK_T::PCLKDIV: APB1DIV Mask */ - -#define CLK_PLLCTL_FBDIV_Pos (0) /*!< CLK_T::PLLCTL: FBDIV Position */ -#define CLK_PLLCTL_FBDIV_Msk (0x1fful << CLK_PLLCTL_FBDIV_Pos) /*!< CLK_T::PLLCTL: FBDIV Mask */ - -#define CLK_PLLCTL_INDIV_Pos (9) /*!< CLK_T::PLLCTL: INDIV Position */ -#define CLK_PLLCTL_INDIV_Msk (0x1ful << CLK_PLLCTL_INDIV_Pos) /*!< CLK_T::PLLCTL: INDIV Mask */ - -#define CLK_PLLCTL_OUTDIV_Pos (14) /*!< CLK_T::PLLCTL: OUTDIV Position */ -#define CLK_PLLCTL_OUTDIV_Msk (0x3ul << CLK_PLLCTL_OUTDIV_Pos) /*!< CLK_T::PLLCTL: OUTDIV Mask */ - -#define CLK_PLLCTL_PD_Pos (16) /*!< CLK_T::PLLCTL: PD Position */ -#define CLK_PLLCTL_PD_Msk (0x1ul << CLK_PLLCTL_PD_Pos) /*!< CLK_T::PLLCTL: PD Mask */ - -#define CLK_PLLCTL_BP_Pos (17) /*!< CLK_T::PLLCTL: BP Position */ -#define CLK_PLLCTL_BP_Msk (0x1ul << CLK_PLLCTL_BP_Pos) /*!< CLK_T::PLLCTL: BP Mask */ - -#define CLK_PLLCTL_OE_Pos (18) /*!< CLK_T::PLLCTL: OE Position */ -#define CLK_PLLCTL_OE_Msk (0x1ul << CLK_PLLCTL_OE_Pos) /*!< CLK_T::PLLCTL: OE Mask */ - -#define CLK_PLLCTL_PLLSRC_Pos (19) /*!< CLK_T::PLLCTL: PLLSRC Position */ -#define CLK_PLLCTL_PLLSRC_Msk (0x1ul << CLK_PLLCTL_PLLSRC_Pos) /*!< CLK_T::PLLCTL: PLLSRC Mask */ - -#define CLK_PLLCTL_STBSEL_Pos (23) /*!< CLK_T::PLLCTL: STBSEL Position */ -#define CLK_PLLCTL_STBSEL_Msk (0x1ul << CLK_PLLCTL_STBSEL_Pos) /*!< CLK_T::PLLCTL: STBSEL Mask */ - -#define CLK_STATUS_HXTSTB_Pos (0) /*!< CLK_T::STATUS: HXTSTB Position */ -#define CLK_STATUS_HXTSTB_Msk (0x1ul << CLK_STATUS_HXTSTB_Pos) /*!< CLK_T::STATUS: HXTSTB Mask */ - -#define CLK_STATUS_LXTSTB_Pos (1) /*!< CLK_T::STATUS: LXTSTB Position */ -#define CLK_STATUS_LXTSTB_Msk (0x1ul << CLK_STATUS_LXTSTB_Pos) /*!< CLK_T::STATUS: LXTSTB Mask */ - -#define CLK_STATUS_PLLSTB_Pos (2) /*!< CLK_T::STATUS: PLLSTB Position */ -#define CLK_STATUS_PLLSTB_Msk (0x1ul << CLK_STATUS_PLLSTB_Pos) /*!< CLK_T::STATUS: PLLSTB Mask */ - -#define CLK_STATUS_LIRCSTB_Pos (3) /*!< CLK_T::STATUS: LIRCSTB Position */ -#define CLK_STATUS_LIRCSTB_Msk (0x1ul << CLK_STATUS_LIRCSTB_Pos) /*!< CLK_T::STATUS: LIRCSTB Mask */ - -#define CLK_STATUS_HIRCSTB_Pos (4) /*!< CLK_T::STATUS: HIRCSTB Position */ -#define CLK_STATUS_HIRCSTB_Msk (0x1ul << CLK_STATUS_HIRCSTB_Pos) /*!< CLK_T::STATUS: HIRCSTB Mask */ - -#define CLK_STATUS_CLKSFAIL_Pos (7) /*!< CLK_T::STATUS: CLKSFAIL Position */ -#define CLK_STATUS_CLKSFAIL_Msk (0x1ul << CLK_STATUS_CLKSFAIL_Pos) /*!< CLK_T::STATUS: CLKSFAIL Mask */ - -#define CLK_CLKOCTL_FREQSEL_Pos (0) /*!< CLK_T::CLKOCTL: FREQSEL Position */ -#define CLK_CLKOCTL_FREQSEL_Msk (0xful << CLK_CLKOCTL_FREQSEL_Pos) /*!< CLK_T::CLKOCTL: FREQSEL Mask */ - -#define CLK_CLKOCTL_CLKOEN_Pos (4) /*!< CLK_T::CLKOCTL: CLKOEN Position */ -#define CLK_CLKOCTL_CLKOEN_Msk (0x1ul << CLK_CLKOCTL_CLKOEN_Pos) /*!< CLK_T::CLKOCTL: CLKOEN Mask */ - -#define CLK_CLKOCTL_DIV1EN_Pos (5) /*!< CLK_T::CLKOCTL: DIV1EN Position */ -#define CLK_CLKOCTL_DIV1EN_Msk (0x1ul << CLK_CLKOCTL_DIV1EN_Pos) /*!< CLK_T::CLKOCTL: DIV1EN Mask */ - -#define CLK_CLKOCTL_CLK1HZEN_Pos (6) /*!< CLK_T::CLKOCTL: CLK1HZEN Position */ -#define CLK_CLKOCTL_CLK1HZEN_Msk (0x1ul << CLK_CLKOCTL_CLK1HZEN_Pos) /*!< CLK_T::CLKOCTL: CLK1HZEN Mask */ - -#define CLK_CLKDCTL_HXTFDEN_Pos (4) /*!< CLK_T::CLKDCTL: HXTFDEN Position */ -#define CLK_CLKDCTL_HXTFDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFDEN Mask */ - -#define CLK_CLKDCTL_HXTFIEN_Pos (5) /*!< CLK_T::CLKDCTL: HXTFIEN Position */ -#define CLK_CLKDCTL_HXTFIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFIEN Mask */ - -#define CLK_CLKDCTL_LXTFDEN_Pos (12) /*!< CLK_T::CLKDCTL: LXTFDEN Position */ -#define CLK_CLKDCTL_LXTFDEN_Msk (0x1ul << CLK_CLKDCTL_LXTFDEN_Pos) /*!< CLK_T::CLKDCTL: LXTFDEN Mask */ - -#define CLK_CLKDCTL_LXTFIEN_Pos (13) /*!< CLK_T::CLKDCTL: LXTFIEN Position */ -#define CLK_CLKDCTL_LXTFIEN_Msk (0x1ul << CLK_CLKDCTL_LXTFIEN_Pos) /*!< CLK_T::CLKDCTL: LXTFIEN Mask */ - -#define CLK_CLKDCTL_HXTFQDEN_Pos (16) /*!< CLK_T::CLKDCTL: HXTFQDEN Position */ -#define CLK_CLKDCTL_HXTFQDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQDEN Mask */ - -#define CLK_CLKDCTL_HXTFQIEN_Pos (17) /*!< CLK_T::CLKDCTL: HXTFQIEN Position */ -#define CLK_CLKDCTL_HXTFQIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQIEN Mask */ - -#define CLK_CLKDSTS_HXTFIF_Pos (0) /*!< CLK_T::CLKDSTS: HXTFIF Position */ -#define CLK_CLKDSTS_HXTFIF_Msk (0x1ul << CLK_CLKDSTS_HXTFIF_Pos) /*!< CLK_T::CLKDSTS: HXTFIF Mask */ - -#define CLK_CLKDSTS_LXTFIF_Pos (1) /*!< CLK_T::CLKDSTS: LXTFIF Position */ -#define CLK_CLKDSTS_LXTFIF_Msk (0x1ul << CLK_CLKDSTS_LXTFIF_Pos) /*!< CLK_T::CLKDSTS: LXTFIF Mask */ - -#define CLK_CLKDSTS_HXTFQIF_Pos (8) /*!< CLK_T::CLKDSTS: HXTFQIF Position */ -#define CLK_CLKDSTS_HXTFQIF_Msk (0x1ul << CLK_CLKDSTS_HXTFQIF_Pos) /*!< CLK_T::CLKDSTS: HXTFQIF Mask */ - -#define CLK_CDUPB_UPERBD_Pos (0) /*!< CLK_T::CDUPB: UPERBD Position */ -#define CLK_CDUPB_UPERBD_Msk (0x3fful << CLK_CDUPB_UPERBD_Pos) /*!< CLK_T::CDUPB: UPERBD Mask */ - -#define CLK_CDLOWB_LOWERBD_Pos (0) /*!< CLK_T::CDLOWB: LOWERBD Position */ -#define CLK_CDLOWB_LOWERBD_Msk (0x3fful << CLK_CDLOWB_LOWERBD_Pos) /*!< CLK_T::CDLOWB: LOWERBD Mask */ - -#define CLK_HXTFSEL_HXTFSEL_Pos (0) /*!< CLK_T::HXTFSEL: HXTFSEL Position */ -#define CLK_HXTFSEL_HXTFSEL_Msk (0x1ul << CLK_HXTFSEL_HXTFSEL_Pos) /*!< CLK_T::HXTFSEL: HXTFSEL Mask */ - -/**@}*/ /* CLK_CONST */ -/**@}*/ /* end of CLK register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __CLK_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/crc_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/crc_reg.h deleted file mode 100644 index 3a5d83177db..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/crc_reg.h +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************//** - * @file crc_reg.h - * @version V1.00 - * @brief CRC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CRC_REG_H__ -#define __CRC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CRC Cyclic Redundancy Check Controller(CRC) - Memory Mapped Structure for CRC Controller -@{ */ - -typedef struct -{ - - - /** - * @var CRC_T::CTL - * Offset: 0x00 CRC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRCEN |CRC Channel Enable Bit - * | | |0 = No effect. - * | | |1 = CRC operation Enabled. - * |[1] |CHKSINIT |Checksum Initialization - * | | |0 = No effect. - * | | |1 = Initial checksum value by auto reload CRC_SEED register value to CRC_CHECKSUM register value. - * | | |Note: This bit will be cleared automatically. - * |[24] |DATREV |Write Data Bit Order Reverse - * | | |This bit is used to enable the bit order reverse function per byte for write data value in CRC_DAT register. - * | | |0 = Bit order reversed for CRC write data in Disabled. - * | | |1 = Bit order reversed for CRC write data in Enabled (per byte). - * | | |Note: If the write data is 0xAABBCCDD, the bit order reverse for CRC write data in is 0x55DD33BB. - * |[25] |CHKSREV |Checksum Bit Order Reverse - * | | |This bit is used to enable the bit order reverse function for checksum result in CRC_CHECKSUM register. - * | | |0 = Bit order reverse for CRC checksum Disabled. - * | | |1 = Bit order reverse for CRC checksum Enabled. - * | | |Note: If the checksum result is 0xDD7B0F2E, the bit order reverse for CRC checksum is 0x74F0DEBB. - * |[26] |DATFMT |Write Data 1's Complement - * | | |This bit is used to enable the 1's complement function for write data value in CRC_DAT register. - * | | |0 = 1's complement for CRC writes data in Disabled. - * | | |1 = 1's complement for CRC writes data in Enabled. - * |[27] |CHKSFMT |Checksum 1's Complement - * | | |This bit is used to enable the 1's complement function for checksum result in CRC_CHECKSUM register. - * | | |0 = 1's complement for CRC checksum Disabled. - * | | |1 = 1's complement for CRC checksum Enabled. - * |[29:28] |DATLEN |CPU Write Data Length - * | | |This field indicates the write data length. - * | | |00 = Data length is 8-bit mode. - * | | |01 = Data length is 16-bit mode. - * | | |1x = Data length is 32-bit mode. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0]. - * |[31:30] |CRCMODE |CRC Polynomial Mode - * | | |This field indicates the CRC operation polynomial mode. - * | | |00 = CRC-CCITT Polynomial mode. - * | | |01 = CRC-8 Polynomial mode. - * | | |10 = CRC-16 Polynomial mode. - * | | |11 = CRC-32 Polynomial mode. - * @var CRC_T::DAT - * Offset: 0x04 CRC Write Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |CRC Write Data Bits - * | | |User can write data directly by CPU mode or use PDMA function to write data to this field to perform CRC operation. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0]. - * @var CRC_T::SEED - * Offset: 0x08 CRC Seed Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |CRC Seed Value - * | | |This field indicates the CRC seed value. - * | | |Note: This field will be reloaded as checksum initial value (CRC_CHECKSUM register) after perform CHKSINIT (CRC_CTL[1]). - * @var CRC_T::CHECKSUM - * Offset: 0x0C CRC Checksum Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CHECKSUM |CRC Checksum Results - * | | |This field indicates the CRC checksum result. - */ - __IO uint32_t CTL; /*!< [0x0000] CRC Control Register */ - __IO uint32_t DAT; /*!< [0x0004] CRC Write Data Register */ - __IO uint32_t SEED; /*!< [0x0008] CRC Seed Register */ - __I uint32_t CHECKSUM; /*!< [0x000c] CRC Checksum Register */ - -} CRC_T; - -/** - @addtogroup CRC_CONST CRC Bit Field Definition - Constant Definitions for CRC Controller -@{ */ - - -#define CRC_CTL_CRCEN_Pos (0) /*!< CRC_T::CTL: CRCEN Position */ -#define CRC_CTL_CRCEN_Msk (0x1ul << CRC_CTL_CRCEN_Pos) /*!< CRC_T::CTL: CRCEN Mask */ - -#define CRC_CTL_CHKSINIT_Pos (1) /*!< CRC_T::CTL: CHKSINIT Position */ -#define CRC_CTL_CHKSINIT_Msk (0x1ul << CRC_CTL_CHKSINIT_Pos) /*!< CRC_T::CTL: CHKSINIT Mask */ - -#define CRC_CTL_DATREV_Pos (24) /*!< CRC_T::CTL: DATREV Position */ -#define CRC_CTL_DATREV_Msk (0x1ul << CRC_CTL_DATREV_Pos) /*!< CRC_T::CTL: DATREV Mask */ - -#define CRC_CTL_CHKSREV_Pos (25) /*!< CRC_T::CTL: CHKSREV Position */ -#define CRC_CTL_CHKSREV_Msk (0x1ul << CRC_CTL_CHKSREV_Pos) /*!< CRC_T::CTL: CHKSREV Mask */ - -#define CRC_CTL_DATFMT_Pos (26) /*!< CRC_T::CTL: DATFMT Position */ -#define CRC_CTL_DATFMT_Msk (0x1ul << CRC_CTL_DATFMT_Pos) /*!< CRC_T::CTL: DATFMT Mask */ - -#define CRC_CTL_CHKSFMT_Pos (27) /*!< CRC_T::CTL: CHKSFMT Position */ -#define CRC_CTL_CHKSFMT_Msk (0x1ul << CRC_CTL_CHKSFMT_Pos) /*!< CRC_T::CTL: CHKSFMT Mask */ - -#define CRC_CTL_DATLEN_Pos (28) /*!< CRC_T::CTL: DATLEN Position */ -#define CRC_CTL_DATLEN_Msk (0x3ul << CRC_CTL_DATLEN_Pos) /*!< CRC_T::CTL: DATLEN Mask */ - -#define CRC_CTL_CRCMODE_Pos (30) /*!< CRC_T::CTL: CRCMODE Position */ -#define CRC_CTL_CRCMODE_Msk (0x3ul << CRC_CTL_CRCMODE_Pos) /*!< CRC_T::CTL: CRCMODE Mask */ - -#define CRC_DAT_DATA_Pos (0) /*!< CRC_T::DAT: DATA Position */ -#define CRC_DAT_DATA_Msk (0xfffffffful << CRC_DAT_DATA_Pos) /*!< CRC_T::DAT: DATA Mask */ - -#define CRC_SEED_SEED_Pos (0) /*!< CRC_T::SEED: SEED Position */ -#define CRC_SEED_SEED_Msk (0xfffffffful << CRC_SEED_SEED_Pos) /*!< CRC_T::SEED: SEED Mask */ - -#define CRC_CHECKSUM_CHECKSUM_Pos (0) /*!< CRC_T::CHECKSUM: CHECKSUM Position */ -#define CRC_CHECKSUM_CHECKSUM_Msk (0xfffffffful << CRC_CHECKSUM_CHECKSUM_Pos) /*!< CRC_T::CHECKSUM: CHECKSUM Mask */ - -/**@}*/ /* CRC_CONST */ -/**@}*/ /* end of CRC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __CRC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ebi_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ebi_reg.h deleted file mode 100644 index b147997f884..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ebi_reg.h +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************//** - * @file ebi_reg.h - * @version V1.00 - * @brief EBI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EBI_REG_H__ -#define __EBI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller -@{ */ - -typedef struct -{ - - - /** - * @var EBI_T::CTL0 - * Offset: 0x00 External Bus Interface Bank0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When continuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time Of of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE + 1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register. - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register. - * @var EBI_T::TCTL0 - * Offset: 0x04 External Bus Interface Bank0 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC define data access time (tACC). - * | | |tACC = (TACC + 1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD define data access hold time (tAHD). - * | | |tAHD = (TAHD + 1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - * @var EBI_T::CTL1 - * Offset: 0x10 External Bus Interface Bank1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When con ttinuousenuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time Of of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE + 1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register. - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register. - * @var EBI_T::TCTL1 - * Offset: 0x14 External Bus Interface Bank1 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC define data access time (tACC). - * | | |tACC = (TACC + 1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD define data access hold time (tAHD). - * | | |tAHD = (TAHD + 1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - */ - __IO uint32_t CTL0; /*!< [0x0000] External Bus Interface Bank0 Control Register */ - __IO uint32_t TCTL0; /*!< [0x0004] External Bus Interface Bank0 Timing Control Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CTL1; /*!< [0x0010] External Bus Interface Bank1 Control Register */ - __IO uint32_t TCTL1; /*!< [0x0014] External Bus Interface Bank1 Timing Control Register */ - -} EBI_T; - -/** - @addtogroup EBI_CONST EBI Bit Field Definition - Constant Definitions for EBI Controller -@{ */ - -#define EBI_CTL_EN_Pos (0) /*!< EBI_T::CTL0: EN Position */ -#define EBI_CTL_EN_Msk (0x1ul << EBI_CTL_EN_Pos) /*!< EBI_T::CTL0: EN Mask */ - -#define EBI_CTL_DW16_Pos (1) /*!< EBI_T::CTL0: DW16 Position */ -#define EBI_CTL_DW16_Msk (0x1ul << EBI_CTL_DW16_Pos) /*!< EBI_T::CTL0: DW16 Mask */ - -#define EBI_CTL_CSPOLINV_Pos (2) /*!< EBI_T::CTL0: CSPOLINV Position */ -#define EBI_CTL_CSPOLINV_Msk (0x1ul << EBI_CTL_CSPOLINV_Pos) /*!< EBI_T::CTL0: CSPOLINV Mask */ - -#define EBI_CTL_CACCESS_Pos (4) /*!< EBI_T::CTL0: CACCESS Position */ -#define EBI_CTL_CACCESS_Msk (0x1ul << EBI_CTL_CACCESS_Pos) /*!< EBI_T::CTL0: CACCESS Mask */ - -#define EBI_CTL_MCLKDIV_Pos (8) /*!< EBI_T::CTL0: MCLKDIV Position */ -#define EBI_CTL_MCLKDIV_Msk (0x7ul << EBI_CTL_MCLKDIV_Pos) /*!< EBI_T::CTL0: MCLKDIV Mask */ - -#define EBI_CTL_TALE_Pos (16) /*!< EBI_T::CTL0: TALE Position */ -#define EBI_CTL_TALE_Msk (0x7ul << EBI_CTL_TALE_Pos) /*!< EBI_T::CTL0: TALE Mask */ - -#define EBI_CTL_WBUFEN_Pos (24) /*!< EBI_T::CTL0: WBUFEN Position */ -#define EBI_CTL_WBUFEN_Msk (0x1ul << EBI_CTL_WBUFEN_Pos) /*!< EBI_T::CTL0: WBUFEN Mask */ - -#define EBI_TCTL_TACC_Pos (3) /*!< EBI_T::TCTL0: TACC Position */ -#define EBI_TCTL_TACC_Msk (0x1ful << EBI_TCTL_TACC_Pos) /*!< EBI_T::TCTL0: TACC Mask */ - -#define EBI_TCTL_TAHD_Pos (8) /*!< EBI_T::TCTL0: TAHD Position */ -#define EBI_TCTL_TAHD_Msk (0x7ul << EBI_TCTL_TAHD_Pos) /*!< EBI_T::TCTL0: TAHD Mask */ - -#define EBI_TCTL_W2X_Pos (12) /*!< EBI_T::TCTL0: W2X Position */ -#define EBI_TCTL_W2X_Msk (0xful << EBI_TCTL_W2X_Pos) /*!< EBI_T::TCTL0: W2X Mask */ - -#define EBI_TCTL_RAHDOFF_Pos (22) /*!< EBI_T::TCTL0: RAHDOFF Position */ -#define EBI_TCTL_RAHDOFF_Msk (0x1ul << EBI_TCTL_RAHDOFF_Pos) /*!< EBI_T::TCTL0: RAHDOFF Mask */ - -#define EBI_TCTL_WAHDOFF_Pos (23) /*!< EBI_T::TCTL0: WAHDOFF Position */ -#define EBI_TCTL_WAHDOFF_Msk (0x1ul << EBI_TCTL_WAHDOFF_Pos) /*!< EBI_T::TCTL0: WAHDOFF Mask */ - -#define EBI_TCTL_R2R_Pos (24) /*!< EBI_T::TCTL0: R2R Position */ -#define EBI_TCTL_R2R_Msk (0xful << EBI_TCTL_R2R_Pos) /*!< EBI_T::TCTL0: R2R Mask */ - -/**@}*/ /* EBI_CONST */ -/**@}*/ /* end of EBI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __EBI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/fmc_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/fmc_reg.h deleted file mode 100644 index b40ecc1a456..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/fmc_reg.h +++ /dev/null @@ -1,317 +0,0 @@ -/**************************************************************************//** - * @file fmc_reg.h - * @version V1.00 - * @brief FMC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __FMC_REG_H__ -#define __FMC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup FMC Flash Memory Controller(FMC) - Memory Mapped Structure for FMC Controller -@{ */ - -typedef struct -{ - - - /** - * @var FMC_T::ISPCTL - * Offset: 0x00 ISP Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPEN |ISP Enable Bit (Write Protection) - * | | |ISP function enable bit. Set this bit to enable ISP function. - * | | |0 = ISP function Disabled. - * | | |1 = ISP function Enabled. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * |[1] |BS |Boot Select (Write Protection) - * | | |Set/clear this bit to select next booting from LDROM/APROM, respectively. - * | | |This bit also functions as chip booting status flag, which can be used to check where chip booted from. - * | | |This bit is initiated with the inversed value of CBS[1] (CONFIG0[7]) after any reset is happened except CPU reset (RSTS_CPU is 1) or system reset (RSTS_SYS) is happened. - * | | |0 = Booting from APROM. - * | | |1 = Booting from LDROM. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * |[2] |SPUEN |SPROM Update Enable Bit (Write Protection) - * | | |0 = SPROM cannot be updated. - * | | |1 = SPROM can be updated. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * |[3] |APUEN |APROM Update Enable Bit (Write Protection) - * | | |0 = APROM cannot be updated when the chip runs in APROM. - * | | |1 = APROM can be updated when the chip runs in APROM. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * |[4] |CFGUEN |CONFIG Update Enable Bit (Write Protection) - * | | |0 = CONFIG cannot be updated. - * | | |1 = CONFIG can be updated. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * |[5] |LDUEN |LDROM Update Enable Bit (Write Protection) - * | | |LDROM update enable bit. - * | | |0 = LDROM cannot be updated. - * | | |1 = LDROM can be updated. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * |[6] |ISPFF |ISP Fail Flag (Write Protection) - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |This bit needs to be cleared by writing 1 to it. - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0. - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection. - * | | |(7) Erase or Program command at brown-out detected. - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::ISPADDR - * Offset: 0x04 ISP Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPADDR |ISP Address - * | | |The NuMicro M031 series is equipped with embedded flash. - * | | |ISPADDR[1:0] must be kept 00 for ISP 32-bit operation and ISPADR[8:0] must be kept all 0 for Vector Page Re-map Command. - * | | |For CRC32 Checksum Calculation command, this field is the flash starting address for checksum calculation, 512 bytes alignment is necessary for checksum calculation. - * @var FMC_T::ISPDAT - * Offset: 0x08 ISP Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT |ISP Data - * | | |Write data to this register before ISP program operation. - * | | |Read data from this register after ISP read operation. - * | | |For Run CRC32 Checksum Calculation command, ISPDAT is the memory size (byte) and 512 bytes alignment. - * | | |For ISP Read Checksum command, ISPDAT is the checksum result. - * | | |If ISPDAT = 0x0000_0000, it means that (1) the checksum calculation is in progress, or (2) the memory range for checksum calculation is incorrect. - * @var FMC_T::ISPCMD - * Offset: 0x0C ISP Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |CMD |ISP CMD - * | | |ISP command table is shown below: - * | | |0x00 = FLASH Read. - * | | |0x04 = Read Unique ID.. - * | | |0x0B = Read Company ID. - * | | |0x0C = Read Device ID. - * | | |0x0D = Read CRC32 Checksum. - * | | |0x21 = FLASH 32-bit Program. - * | | |0x22 = FLASH Page Erase.. - * | | |0x2D = Run CRC32 Checksum Calculation. - * | | |0x2E = Vector Remap. - * | | |The other commands are invalid. - * @var FMC_T::ISPTRG - * Offset: 0x10 ISP Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPGO |ISP Start Trigger (Write Protection) - * | | |Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP operation is finished. - * | | |0 = ISP operation is finished. - * | | |1 = ISP is progressed. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::DFBA - * Offset: 0x14 Data Flash Base Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DFBA |Data Flash Base Address - * | | |This register indicates Data Flash start address. It is a read only register. - * | | |The Data Flash is shared with APROM. the content of this register is loaded from CONFIG1. - * | | |This register is valid when DFEN (CONFIG0[0]) =0. - * @var FMC_T::FTCTL - * Offset: 0x18 Flash Access Time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:4] |FOM |Frequency Optimization Mode (Write Protect) - * | | |The NuMicro Mini58TM series support adjustable flash access timing to optimize the flash access cycles in different working frequency. - * | | |0x1 = Frequency <= 24MHz.. - * | | |Others = Frequency <= 50MHz. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::ISPSTS - * Offset: 0x40 ISP Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPBUSY |ISP BUSY (Read Only) - * | | |0 = ISP operation is finished. - * | | |1 = ISP operation is busy. - * |[2:1] |CBS |Boot Selection of CONFIG (Read Only) - * | | |This bit is initiated with the CBS (CONFIG0[7:6]) after any reset is happened except CPU reset (RSTS_CPU is 1) or system reset (RSTS_SYS) is happened. - * | | |00 = LDROM with IAP mode. - * | | |01 = LDROM without IAP mode. - * | | |10 = APROM with IAP mode. - * | | |11 = APROM without IAP mode. - * |[6] |ISPFF |ISP Fail Flag (Write Protection) - * | | |This bit is the mirror of ISPFF (FMC_ISPCTL[6]), it needs to be cleared by writing 1 to FMC_ISPCTL[6] or FMC_ISPSTS[6]. - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0. - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection. - * | | |(7) Erase or Program command at brown-out detected. - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands. - * |[29:9] |VECMAP |Vector Page Mapping Address (Read Only) - * | | |All access to 0x0000_0000~0x0000_01FF is remapped to the Flash memory or SRAM address {VECMAP[20:0], 9'h000} ~ {VECMAP[20:0], 9'h1FF}, except SPROM. - * | | |VECMAP [20:19] = 00 system vector address is mapped to Flash memory. - * | | |VECMAP [20:19] = 10 system vector address is mapped to SRAM memory. - * | | |VECMAP [18:12] should be 0.All access to 0x0000_0000~0x0000_01FF is remapped to the flash memory address {VECMAP[11:0], 9'h000} ~ {VECMAP[11:0], 9'h1FF} - * |[31] |SCODE |Security Code Active Flag - * | | |This bit is set to 1 by hardware when detecting SPROM secured code is active at flash initialization, or software writes 1 to this bit to make secured code active; this bit is only cleared by SPROM page erase operation. - * | | |0 = SPROM secured code is inactive. - * | | |1 = SPROM secured code is active. - */ - __IO uint32_t ISPCTL; /*!< [0x0000] ISP Control Register */ - __IO uint32_t ISPADDR; /*!< [0x0004] ISP Address Register */ - __IO uint32_t ISPDAT; /*!< [0x0008] ISP Data Register */ - __IO uint32_t ISPCMD; /*!< [0x000c] ISP Command Register */ - __IO uint32_t ISPTRG; /*!< [0x0010] ISP Trigger Control Register */ - __I uint32_t DFBA; /*!< [0x0014] Data Flash Base Address */ - __IO uint32_t FTCTL; /*!< [0x0018] Flash Access Time Control Register */ - __IO uint32_t ICPCTL; /*!< [0x001C] Flash ICP Enable Control Register */ - __I uint32_t RESERVE0[8]; - __IO uint32_t ISPSTS; /*!< [0x0040] ISP Status Register */ - __I uint32_t RESERVE1[15]; - __IO uint32_t MPDAT0; /*!< [0x0080] ISP Data0 Register */ - __IO uint32_t MPDAT1; /*!< [0x0084] ISP Data1 Register */ - __IO uint32_t MPDAT2; /*!< [0x0088] ISP Data2 Register */ - __IO uint32_t MPDAT3; /*!< [0x008c] ISP Data3 Register */ - __I uint32_t RESERVE2[12]; - __I uint32_t MPSTS; /*!< [0x00c0] ISP Multi-Program Status Register */ - __I uint32_t MPADDR; /*!< [0x00c4] ISP Multi-Program Address Register */ - __I uint32_t RESERVE3[0x3CD]; - __I uint32_t VERSION; /*!< [0x0FFC] FMC Version Register */ -} FMC_T; - -/** - @addtogroup FMC_CONST FMC Bit Field Definition - Constant Definitions for FMC Controller -@{ */ - -#define FMC_ISPCTL_ISPEN_Pos (0) /*!< FMC_T::ISPCTL: ISPEN Position */ -#define FMC_ISPCTL_ISPEN_Msk (0x1ul << FMC_ISPCTL_ISPEN_Pos) /*!< FMC_T::ISPCTL: ISPEN Mask */ - -#define FMC_ISPCTL_BS_Pos (1) /*!< FMC_T::ISPCTL: BS Position */ -#define FMC_ISPCTL_BS_Msk (0x1ul << FMC_ISPCTL_BS_Pos) /*!< FMC_T::ISPCTL: BS Mask */ - -#define FMC_ISPCTL_SPUEN_Pos (2) /*!< FMC_T::ISPCTL: SPUEN Position */ -#define FMC_ISPCTL_SPUEN_Msk (0x1ul << FMC_ISPCTL_SPUEN_Pos) /*!< FMC_T::ISPCTL: SPUEN Mask */ - -#define FMC_ISPCTL_APUEN_Pos (3) /*!< FMC_T::ISPCTL: APUEN Position */ -#define FMC_ISPCTL_APUEN_Msk (0x1ul << FMC_ISPCTL_APUEN_Pos) /*!< FMC_T::ISPCTL: APUEN Mask */ - -#define FMC_ISPCTL_CFGUEN_Pos (4) /*!< FMC_T::ISPCTL: CFGUEN Position */ -#define FMC_ISPCTL_CFGUEN_Msk (0x1ul << FMC_ISPCTL_CFGUEN_Pos) /*!< FMC_T::ISPCTL: CFGUEN Mask */ - -#define FMC_ISPCTL_LDUEN_Pos (5) /*!< FMC_T::ISPCTL: LDUEN Position */ -#define FMC_ISPCTL_LDUEN_Msk (0x1ul << FMC_ISPCTL_LDUEN_Pos) /*!< FMC_T::ISPCTL: LDUEN Mask */ - -#define FMC_ISPCTL_ISPFF_Pos (6) /*!< FMC_T::ISPCTL: ISPFF Position */ -#define FMC_ISPCTL_ISPFF_Msk (0x1ul << FMC_ISPCTL_ISPFF_Pos) /*!< FMC_T::ISPCTL: ISPFF Mask */ - -#define FMC_ISPCTL_INTEN_Pos (24) /*!< FMC_T::ISPCTL: INTEN Position */ -#define FMC_ISPCTL_INTEN_Msk (0x1ul << FMC_ISPCTL_INTEN_Pos) /*!< FMC_T::ISPCTL: INTEN Mask */ - -#define FMC_ISPADDR_ISPADDR_Pos (0) /*!< FMC_T::ISPADDR: ISPADDR Position */ -#define FMC_ISPADDR_ISPADDR_Msk (0xfffffffful << FMC_ISPADDR_ISPADDR_Pos) /*!< FMC_T::ISPADDR: ISPADDR Mask */ - -#define FMC_ISPDAT_ISPDAT_Pos (0) /*!< FMC_T::ISPDAT: ISPDAT Position */ -#define FMC_ISPDAT_ISPDAT_Msk (0xfffffffful << FMC_ISPDAT_ISPDAT_Pos) /*!< FMC_T::ISPDAT: ISPDAT Mask */ - -#define FMC_ISPCMD_CMD_Pos (0) /*!< FMC_T::ISPCMD: CMD Position */ -#define FMC_ISPCMD_CMD_Msk (0x7ful << FMC_ISPCMD_CMD_Pos) /*!< FMC_T::ISPCMD: CMD Mask */ - -#define FMC_ISPTRG_ISPGO_Pos (0) /*!< FMC_T::ISPTRG: ISPGO Position */ -#define FMC_ISPTRG_ISPGO_Msk (0x1ul << FMC_ISPTRG_ISPGO_Pos) /*!< FMC_T::ISPTRG: ISPGO Mask */ - -#define FMC_DFBA_DFBA_Pos (0) /*!< FMC_T::DFBA: DFBA Position */ -#define FMC_DFBA_DFBA_Msk (0xfffffffful << FMC_DFBA_DFBA_Pos) /*!< FMC_T::DFBA: DFBA Mask */ - -#define FMC_FTCTL_FOM_Pos (4) /*!< FMC_T::FTCTL: FOM Position */ -#define FMC_FTCTL_FOM_Msk (0x7ul << FMC_FTCTL_FOM_Pos) /*!< FMC_T::FTCTL: FOM Mask */ - -#define FMC_ISPSTS_ISPBUSY_Pos (0) /*!< FMC_T::ISPSTS: ISPBUSY Position */ -#define FMC_ISPSTS_ISPBUSY_Msk (0x1ul << FMC_ISPSTS_ISPBUSY_Pos) /*!< FMC_T::ISPSTS: ISPBUSY Mask */ - -#define FMC_ISPSTS_CBS_Pos (1) /*!< FMC_T::ISPSTS: CBS Position */ -#define FMC_ISPSTS_CBS_Msk (0x3ul << FMC_ISPSTS_CBS_Pos) /*!< FMC_T::ISPSTS: CBS Mask */ - -#define FMC_ISPSTS_PGFF_Pos (5) /*!< FMC_T::ISPSTS: PGFF Position */ -#define FMC_ISPSTS_PGFF_Msk (0x1ul << FMC_ISPSTS_PGFF_Pos) /*!< FMC_T::ISPSTS: PGFF Mask */ - -#define FMC_ISPSTS_ISPFF_Pos (6) /*!< FMC_T::ISPSTS: ISPFF Position */ -#define FMC_ISPSTS_ISPFF_Msk (0x1ul << FMC_ISPSTS_ISPFF_Pos) /*!< FMC_T::ISPSTS: ISPFF Mask */ - -#define FMC_ISPSTS_ALLONE_Pos (7) /*!< FMC_T::ISPSTS: ISPFF Position */ -#define FMC_ISPSTS_ALLONE_Msk (0x1ul << FMC_ISPSTS_ALLONE_Pos) - -#define FMC_ISPSTS_INTFLAG_Pos (8) /*!< FMC_T::ISPSTS: INTFLAG Position */ -#define FMC_ISPSTS_INTFLAG_Msk (0x1ul << FMC_ISPSTS_INTFLAG_Pos) /*!< FMC_T::ISPSTS: INTFLAG Mask */ - -#define FMC_ISPSTS_VECMAP_Pos (9) /*!< FMC_T::ISPSTS: VECMAP Position */ -#define FMC_ISPSTS_VECMAP_Msk (0x1ffffful << FMC_ISPSTS_VECMAP_Pos) /*!< FMC_T::ISPSTS: VECMAP Mask */ - -#define FMC_ISPSTS_SCODE_Pos (31) /*!< FMC_T::ISPSTS: SCODE Position */ -#define FMC_ISPSTS_SCODE_Msk (0x1ul << FMC_ISPSTS_SCODE_Pos) /*!< FMC_T::ISPSTS: SCODE Mask */ - -#define FMC_MPDAT0_ISPDAT0_Pos (0) /*!< FMC_T::MPDAT0: ISPDAT0 Position */ -#define FMC_MPDAT0_ISPDAT0_Msk (0xfffffffful << FMC_MPDAT0_ISPDAT0_Pos) /*!< FMC_T::MPDAT0: ISPDAT0 Mask */ - -#define FMC_MPDAT1_ISPDAT1_Pos (0) /*!< FMC_T::MPDAT1: ISPDAT1 Position */ -#define FMC_MPDAT1_ISPDAT1_Msk (0xfffffffful << FMC_MPDAT1_ISPDAT1_Pos) /*!< FMC_T::MPDAT1: ISPDAT1 Mask */ - -#define FMC_MPDAT2_ISPDAT2_Pos (0) /*!< FMC_T::MPDAT2: ISPDAT2 Position */ -#define FMC_MPDAT2_ISPDAT2_Msk (0xfffffffful << FMC_MPDAT2_ISPDAT2_Pos) /*!< FMC_T::MPDAT2: ISPDAT2 Mask */ - -#define FMC_MPDAT3_ISPDAT3_Pos (0) /*!< FMC_T::MPDAT3: ISPDAT3 Position */ -#define FMC_MPDAT3_ISPDAT3_Msk (0xfffffffful << FMC_MPDAT3_ISPDAT3_Pos) /*!< FMC_T::MPDAT3: ISPDAT3 Mask */ - -#define FMC_MPSTS_MPBUSY_Pos (0) /*!< FMC_T::MPSTS: MPBUSY Position */ -#define FMC_MPSTS_MPBUSY_Msk (0x1ul << FMC_MPSTS_MPBUSY_Pos) /*!< FMC_T::MPSTS: MPBUSY Mask */ - -#define FMC_MPSTS_PPGO_Pos (1) /*!< FMC_T::MPSTS: PPGO Position */ -#define FMC_MPSTS_PPGO_Msk (0x1ul << FMC_MPSTS_PPGO_Pos) /*!< FMC_T::MPSTS: PPGO Mask */ - -#define FMC_MPSTS_ISPFF_Pos (2) /*!< FMC_T::MPSTS: ISPFF Position */ -#define FMC_MPSTS_ISPFF_Msk (0x1ul << FMC_MPSTS_ISPFF_Pos) /*!< FMC_T::MPSTS: ISPFF Mask */ - -#define FMC_MPSTS_D0_Pos (4) /*!< FMC_T::MPSTS: D0 Position */ -#define FMC_MPSTS_D0_Msk (0x1ul << FMC_MPSTS_D0_Pos) /*!< FMC_T::MPSTS: D0 Mask */ - -#define FMC_MPSTS_D1_Pos (5) /*!< FMC_T::MPSTS: D1 Position */ -#define FMC_MPSTS_D1_Msk (0x1ul << FMC_MPSTS_D1_Pos) /*!< FMC_T::MPSTS: D1 Mask */ - -#define FMC_MPSTS_D2_Pos (6) /*!< FMC_T::MPSTS: D2 Position */ -#define FMC_MPSTS_D2_Msk (0x1ul << FMC_MPSTS_D2_Pos) /*!< FMC_T::MPSTS: D2 Mask */ - -#define FMC_MPSTS_D3_Pos (7) /*!< FMC_T::MPSTS: D3 Position */ -#define FMC_MPSTS_D3_Msk (0x1ul << FMC_MPSTS_D3_Pos) /*!< FMC_T::MPSTS: D3 Mask */ - -#define FMC_MPADDR_MPADDR_Pos (0) /*!< FMC_T::MPADDR: MPADDR Position */ -#define FMC_MPADDR_MPADDR_Msk (0xfffffffful << FMC_MPADDR_MPADDR_Pos) /*!< FMC_T::MPADDR: MPADDR Mask */ - -/**@}*/ /* FMC_CONST */ -/**@}*/ /* end of FMC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __FMC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/gpio_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/gpio_reg.h deleted file mode 100644 index ab3d03ff021..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/gpio_reg.h +++ /dev/null @@ -1,710 +0,0 @@ -/**************************************************************************//** - * @file gpio_reg.h - * @version V1.00 - * @brief GPIO register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __GPIO_REG_H__ -#define __GPIO_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup GPIO General Purpose Input/Output Controller (GPIO) - Memory Mapped Structure for GPIO Controller -@{ */ - -typedef struct -{ - - - /** - * @var GPIO_T::MODE - * Offset: 0x00/0x40/0x80/0xC0/0x100/0x140 PA-PF I/O Mode Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|MODEn |Port A-F I/O Pin[n] Mode Control - * | | |Determine each I/O mode of Px.n pins. - * | | |00 = Px.n is in Input mode. - * | | |01 = Px.n is in Push-pull Output mode. - * | | |10 = Px.n is in Open-drain Output mode. - * | | |11 = Px.n is in Quasi-bidirectional mode. - * | | |Note1: The initial value of this field is defined by CIOINI (CONFIG0 [10]). If CIOINI is set to 0, the default value is 0xFFFF_FFFF and all pins will be quasi-bidirectional mode after chip powered on. If CIOINI is set to 1, the default value is 0x0000_0000 and all pins will be input mode after chip powered on. - * | | |Note2: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::DINOFF - * Offset: 0x04/0x44/0x84/0xC4/0x104/0x144 PA-PF Digital Input Path Disable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n+16] |DINOFFn |Port A-F Pin[n] Digital Input Path Disable Bit - * | | |Each of these bits is used to control if the digital input path of corresponding Px.n pin is disabled. If input is analog signal, users can disable Px.n digital input path to avoid input current leakage. - * | | |0 = Px.n digital input path Enabled. - * | | |1 = Px.n digital input path Disabled (digital input tied to low). - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::DOUT - * Offset: 0x08/0x48/0x88/0xC8/0x108/0x148 PA-PF Data Output Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DOUTn |Port A-F Pin[n] Output Value - * | | |Each of these bits controls the status of a Px.n pin when the Px.n is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |0 = Px.n will drive Low if the Px.n pin is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |1 = Px.n will drive High if the Px.n pin is configured as Push-pull output or Quasi-bidirectional mode. - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::DATMSK - * Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C PA-PF Data Output Write Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DATMSKn |Port A-F Pin[n] Data Output Write Mask - * | | |These bits are used to protect the corresponding DOUT (Px_DOUT[n]) bit. When the DATMSK (Px_DATMSK[n]) bit is set to 1, the corresponding DOUT (Px_DOUT[n]) bit is protected. If the write signal is masked, writing data to the protect bit is ignored. - * | | |0 = Corresponding DOUT (Px_DOUT[n]) bit can be updated. - * | | |1 = Corresponding DOUT (Px_DOUT[n]) bit protected. - * | | |Note1: This function only protects the corresponding DOUT (Px_DOUT[n]) bit, and will not protect the corresponding PDIO (Pxn_PDIO[0]) bit. - * | | |Note2: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::PIN - * Offset: 0x10/0x50/0x90/0xD0/0x110/0x150 PA-PF Pin Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |PINn |Port A-F Pin[n] Pin Value - * | | |Each bit of the register reflects the actual status of the respective Px.n pin. If the bit is 1, it indicates the corresponding pin status is high; else the pin status is low. - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::DBEN - * Offset: 0x14/0x54/0x94/0xD4/0x114/0x154 PA-PF De-Bounce Enable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DBENn |Port A-F Pin[n] Input Signal De-bounce Enable Bit - * | | |The DBEN[n] bit is used to enable the de-bounce function for each corresponding bit. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the interrupt. The de-bounce clock source is controlled by DBCLKSRC (GPIO_DBCTL [4]), one de-bounce sample cycle period is controlled by DBCLKSEL (GPIO_DBCTL [3:0]). - * | | |0 = Px.n de-bounce function Disabled. - * | | |1 = Px.n de-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered interrupt. If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::INTTYPE - * Offset: 0x18/0x58/0x98/0xD8/0x118/0x158 PA-PF Interrupt Trigger Type Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |TYPEn |Port A-F Pin[n] Edge or Level Detection Interrupt Trigger Type Control - * | | |TYPE (Px_INTTYPE[n]) bit is used to control the triggered interrupt is by level trigger or by edge trigger. If the interrupt is by edge trigger, the trigger source can be controlled by de-bounce. - * | | |If the interrupt is by level trigger, the input source is sampled by one HCLK clock and generates the interrupt. - * | | |0 = Edge trigger interrupt. - * | | |1 = Level trigger interrupt. - * | | |If the pin is set as the level trigger interrupt, only one level can be set on the registers RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]). If both levels to trigger interrupt are set, the setting is ignored and no interrupt will occur. - * | | |The de-bounce function is valid only for edge triggered interrupt. If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::INTEN - * Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C PA-PF Interrupt Enable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |FLIENn |Port A-F Pin[n] Falling Edge or Low Level Interrupt Trigger Type Enable Bit - * | | |The FLIEN (Px_INTEN[n]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. Set bit to 1 also enable the pin wake-up function. - * | | |When setting the FLIEN (Px_INTEN[n]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at low level. - * | | |If the interrupt is edge trigger(TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from high to low. - * | | |0 = Px.n level low or high to low interrupt Disabled. - * | | |1 = Px.n level low or high to low interrupt Enabled. - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * |[n+16] |RHIENn |Port A-F Pin[n] Rising Edge or High Level Interrupt Trigger Type Enable Bit - * | | |The RHIEN (Px_INTEN[n+16]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. Set bit to 1 also enable the pin wake-up function. - * | | |When setting the RHIEN (Px_INTEN[n+16]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at high level. - * | | |If the interrupt is edge trigger (TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from low to high. - * | | |0 = Px.n level high or low to high interrupt Disabled. - * | | |1 = Px.n level high or low to high interrupt Enabled. - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - * @var GPIO_T::INTSRC - * Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160 PA-PF Interrupt Source Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |INTSRCn |Port A-F Pin[n] Interrupt Source Flag - * | | |Write Operation : - * | | |0 = No action. - * | | |1 = Clear the corresponding pending interrupt. - * | | |Read Operation : - * | | |0 = No interrupt at Px.n. - * | | |1 = Px.n generates an interrupt. - * | | |Note: - * | | |The PC.8~13,15/PD.4~14/PF.7~13 pin is ignored. - */ - - __IO uint32_t MODE; /*!< [0x0000] PA I/O Mode Control */ - __IO uint32_t DINOFF; /*!< [0x0004] PA Digital Input Path Disable Control */ - __IO uint32_t DOUT; /*!< [0x0008] PA Data Output Value */ - __IO uint32_t DATMSK; /*!< [0x000c] PA Data Output Write Mask */ - __I uint32_t PIN; /*!< [0x0010] PA Pin Value */ - __IO uint32_t DBEN; /*!< [0x0014] PA De-bounce Enable Control Register */ - __IO uint32_t INTTYPE; /*!< [0x0018] PA Interrupt Trigger Type Control */ - __IO uint32_t INTEN; /*!< [0x001c] PA Interrupt Enable Control Register */ - __IO uint32_t INTSRC; /*!< [0x0020] PA Interrupt Source Flag */ -} GPIO_T; - -typedef struct -{ - - - /** - * @var GPIO_DBCTL_T::DBCTL - * Offset: 0x180 Interrupt De-bounce Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DBCLKSEL |De-bounce Sampling Cycle Selection - * | | |0000 = Sample interrupt input once per 1 clocks. - * | | |0001 = Sample interrupt input once per 2 clocks. - * | | |0010 = Sample interrupt input once per 4 clocks. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 2*256 clocks. - * | | |1010 = Sample interrupt input once per 4*256 clocks. - * | | |1011 = Sample interrupt input once per 8*256 clocks. - * | | |1100 = Sample interrupt input once per 16*256 clocks. - * | | |1101 = Sample interrupt input once per 32*256 clocks. - * | | |1110 = Sample interrupt input once per 64*256 clocks. - * | | |1111 = Sample interrupt input once per 128*256 clocks. - * |[4] |DBCLKSRC |De-bounce Counter Clock Source Selection - * | | |0 = De-bounce counter clock source is the HCLK. - * | | |1 = De-bounce counter clock source is the 32 kHz internal low speed RC oscillator (LIRC). - * |[5] |ICLKON |Interrupt Clock on Mode - * | | |0 = Edge detection circuit is active only if I/O pin corresponding RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]) bit is set to 1. - * | | |1 = All I/O pins edge detection circuit is always active after reset. - * | | |Note: It is recommended to disable this bit to save system power if no special application concern. - */ - - __IO uint32_t DBCTL; /*!< [0x0440] Interrupt De-bounce Control Register */ -} GPIO_DBCTL_T; - - -/** - @addtogroup GPIO_CONST GPIO Bit Field Definition - Constant Definitions for GPIO Controller -@{ */ - -#define GPIO_MODE_MODE0_Pos (0) /*!< GPIO_T::MODE: MODE0 Position */ -#define GPIO_MODE_MODE0_Msk (0x3ul << GPIO_MODE_MODE0_Pos) /*!< GPIO_T::MODE: MODE0 Mask */ - -#define GPIO_MODE_MODE1_Pos (2) /*!< GPIO_T::MODE: MODE1 Position */ -#define GPIO_MODE_MODE1_Msk (0x3ul << GPIO_MODE_MODE1_Pos) /*!< GPIO_T::MODE: MODE1 Mask */ - -#define GPIO_MODE_MODE2_Pos (4) /*!< GPIO_T::MODE: MODE2 Position */ -#define GPIO_MODE_MODE2_Msk (0x3ul << GPIO_MODE_MODE2_Pos) /*!< GPIO_T::MODE: MODE2 Mask */ - -#define GPIO_MODE_MODE3_Pos (6) /*!< GPIO_T::MODE: MODE3 Position */ -#define GPIO_MODE_MODE3_Msk (0x3ul << GPIO_MODE_MODE3_Pos) /*!< GPIO_T::MODE: MODE3 Mask */ - -#define GPIO_MODE_MODE4_Pos (8) /*!< GPIO_T::MODE: MODE4 Position */ -#define GPIO_MODE_MODE4_Msk (0x3ul << GPIO_MODE_MODE4_Pos) /*!< GPIO_T::MODE: MODE4 Mask */ - -#define GPIO_MODE_MODE5_Pos (10) /*!< GPIO_T::MODE: MODE5 Position */ -#define GPIO_MODE_MODE5_Msk (0x3ul << GPIO_MODE_MODE5_Pos) /*!< GPIO_T::MODE: MODE5 Mask */ - -#define GPIO_MODE_MODE6_Pos (12) /*!< GPIO_T::MODE: MODE6 Position */ -#define GPIO_MODE_MODE6_Msk (0x3ul << GPIO_MODE_MODE6_Pos) /*!< GPIO_T::MODE: MODE6 Mask */ - -#define GPIO_MODE_MODE7_Pos (14) /*!< GPIO_T::MODE: MODE7 Position */ -#define GPIO_MODE_MODE7_Msk (0x3ul << GPIO_MODE_MODE7_Pos) /*!< GPIO_T::MODE: MODE7 Mask */ - -#define GPIO_MODE_MODE8_Pos (16) /*!< GPIO_T::MODE: MODE8 Position */ -#define GPIO_MODE_MODE8_Msk (0x3ul << GPIO_MODE_MODE8_Pos) /*!< GPIO_T::MODE: MODE8 Mask */ - -#define GPIO_MODE_MODE9_Pos (18) /*!< GPIO_T::MODE: MODE9 Position */ -#define GPIO_MODE_MODE9_Msk (0x3ul << GPIO_MODE_MODE9_Pos) /*!< GPIO_T::MODE: MODE9 Mask */ - -#define GPIO_MODE_MODE10_Pos (20) /*!< GPIO_T::MODE: MODE10 Position */ -#define GPIO_MODE_MODE10_Msk (0x3ul << GPIO_MODE_MODE10_Pos) /*!< GPIO_T::MODE: MODE10 Mask */ - -#define GPIO_MODE_MODE11_Pos (22) /*!< GPIO_T::MODE: MODE11 Position */ -#define GPIO_MODE_MODE11_Msk (0x3ul << GPIO_MODE_MODE11_Pos) /*!< GPIO_T::MODE: MODE11 Mask */ - -#define GPIO_MODE_MODE12_Pos (24) /*!< GPIO_T::MODE: MODE12 Position */ -#define GPIO_MODE_MODE12_Msk (0x3ul << GPIO_MODE_MODE12_Pos) /*!< GPIO_T::MODE: MODE12 Mask */ - -#define GPIO_MODE_MODE13_Pos (26) /*!< GPIO_T::MODE: MODE13 Position */ -#define GPIO_MODE_MODE13_Msk (0x3ul << GPIO_MODE_MODE13_Pos) /*!< GPIO_T::MODE: MODE13 Mask */ - -#define GPIO_MODE_MODE14_Pos (28) /*!< GPIO_T::MODE: MODE14 Position */ -#define GPIO_MODE_MODE14_Msk (0x3ul << GPIO_MODE_MODE14_Pos) /*!< GPIO_T::MODE: MODE14 Mask */ - -#define GPIO_MODE_MODE15_Pos (30) /*!< GPIO_T::MODE: MODE15 Position */ -#define GPIO_MODE_MODE15_Msk (0x3ul << GPIO_MODE_MODE15_Pos) /*!< GPIO_T::MODE: MODE15 Mask */ - -#define GPIO_DINOFF_DINOFF0_Pos (16) /*!< GPIO_T::DINOFF: DINOFF0 Position */ -#define GPIO_DINOFF_DINOFF0_Msk (0x1ul << GPIO_DINOFF_DINOFF0_Pos) /*!< GPIO_T::DINOFF: DINOFF0 Mask */ - -#define GPIO_DINOFF_DINOFF1_Pos (17) /*!< GPIO_T::DINOFF: DINOFF1 Position */ -#define GPIO_DINOFF_DINOFF1_Msk (0x1ul << GPIO_DINOFF_DINOFF1_Pos) /*!< GPIO_T::DINOFF: DINOFF1 Mask */ - -#define GPIO_DINOFF_DINOFF2_Pos (18) /*!< GPIO_T::DINOFF: DINOFF2 Position */ -#define GPIO_DINOFF_DINOFF2_Msk (0x1ul << GPIO_DINOFF_DINOFF2_Pos) /*!< GPIO_T::DINOFF: DINOFF2 Mask */ - -#define GPIO_DINOFF_DINOFF3_Pos (19) /*!< GPIO_T::DINOFF: DINOFF3 Position */ -#define GPIO_DINOFF_DINOFF3_Msk (0x1ul << GPIO_DINOFF_DINOFF3_Pos) /*!< GPIO_T::DINOFF: DINOFF3 Mask */ - -#define GPIO_DINOFF_DINOFF4_Pos (20) /*!< GPIO_T::DINOFF: DINOFF4 Position */ -#define GPIO_DINOFF_DINOFF4_Msk (0x1ul << GPIO_DINOFF_DINOFF4_Pos) /*!< GPIO_T::DINOFF: DINOFF4 Mask */ - -#define GPIO_DINOFF_DINOFF5_Pos (21) /*!< GPIO_T::DINOFF: DINOFF5 Position */ -#define GPIO_DINOFF_DINOFF5_Msk (0x1ul << GPIO_DINOFF_DINOFF5_Pos) /*!< GPIO_T::DINOFF: DINOFF5 Mask */ - -#define GPIO_DINOFF_DINOFF6_Pos (22) /*!< GPIO_T::DINOFF: DINOFF6 Position */ -#define GPIO_DINOFF_DINOFF6_Msk (0x1ul << GPIO_DINOFF_DINOFF6_Pos) /*!< GPIO_T::DINOFF: DINOFF6 Mask */ - -#define GPIO_DINOFF_DINOFF7_Pos (23) /*!< GPIO_T::DINOFF: DINOFF7 Position */ -#define GPIO_DINOFF_DINOFF7_Msk (0x1ul << GPIO_DINOFF_DINOFF7_Pos) /*!< GPIO_T::DINOFF: DINOFF7 Mask */ - -#define GPIO_DINOFF_DINOFF8_Pos (24) /*!< GPIO_T::DINOFF: DINOFF8 Position */ -#define GPIO_DINOFF_DINOFF8_Msk (0x1ul << GPIO_DINOFF_DINOFF8_Pos) /*!< GPIO_T::DINOFF: DINOFF8 Mask */ - -#define GPIO_DINOFF_DINOFF9_Pos (25) /*!< GPIO_T::DINOFF: DINOFF9 Position */ -#define GPIO_DINOFF_DINOFF9_Msk (0x1ul << GPIO_DINOFF_DINOFF9_Pos) /*!< GPIO_T::DINOFF: DINOFF9 Mask */ - -#define GPIO_DINOFF_DINOFF10_Pos (26) /*!< GPIO_T::DINOFF: DINOFF10 Position */ -#define GPIO_DINOFF_DINOFF10_Msk (0x1ul << GPIO_DINOFF_DINOFF10_Pos) /*!< GPIO_T::DINOFF: DINOFF10 Mask */ - -#define GPIO_DINOFF_DINOFF11_Pos (27) /*!< GPIO_T::DINOFF: DINOFF11 Position */ -#define GPIO_DINOFF_DINOFF11_Msk (0x1ul << GPIO_DINOFF_DINOFF11_Pos) /*!< GPIO_T::DINOFF: DINOFF11 Mask */ - -#define GPIO_DINOFF_DINOFF12_Pos (28) /*!< GPIO_T::DINOFF: DINOFF12 Position */ -#define GPIO_DINOFF_DINOFF12_Msk (0x1ul << GPIO_DINOFF_DINOFF12_Pos) /*!< GPIO_T::DINOFF: DINOFF12 Mask */ - -#define GPIO_DINOFF_DINOFF13_Pos (29) /*!< GPIO_T::DINOFF: DINOFF13 Position */ -#define GPIO_DINOFF_DINOFF13_Msk (0x1ul << GPIO_DINOFF_DINOFF13_Pos) /*!< GPIO_T::DINOFF: DINOFF13 Mask */ - -#define GPIO_DINOFF_DINOFF14_Pos (30) /*!< GPIO_T::DINOFF: DINOFF14 Position */ -#define GPIO_DINOFF_DINOFF14_Msk (0x1ul << GPIO_DINOFF_DINOFF14_Pos) /*!< GPIO_T::DINOFF: DINOFF14 Mask */ - -#define GPIO_DINOFF_DINOFF15_Pos (31) /*!< GPIO_T::DINOFF: DINOFF15 Position */ -#define GPIO_DINOFF_DINOFF15_Msk (0x1ul << GPIO_DINOFF_DINOFF15_Pos) /*!< GPIO_T::DINOFF: DINOFF15 Mask */ - -#define GPIO_DOUT_DOUT0_Pos (0) /*!< GPIO_T::DOUT: DOUT0 Position */ -#define GPIO_DOUT_DOUT0_Msk (0x1ul << GPIO_DOUT_DOUT0_Pos) /*!< GPIO_T::DOUT: DOUT0 Mask */ - -#define GPIO_DOUT_DOUT1_Pos (1) /*!< GPIO_T::DOUT: DOUT1 Position */ -#define GPIO_DOUT_DOUT1_Msk (0x1ul << GPIO_DOUT_DOUT1_Pos) /*!< GPIO_T::DOUT: DOUT1 Mask */ - -#define GPIO_DOUT_DOUT2_Pos (2) /*!< GPIO_T::DOUT: DOUT2 Position */ -#define GPIO_DOUT_DOUT2_Msk (0x1ul << GPIO_DOUT_DOUT2_Pos) /*!< GPIO_T::DOUT: DOUT2 Mask */ - -#define GPIO_DOUT_DOUT3_Pos (3) /*!< GPIO_T::DOUT: DOUT3 Position */ -#define GPIO_DOUT_DOUT3_Msk (0x1ul << GPIO_DOUT_DOUT3_Pos) /*!< GPIO_T::DOUT: DOUT3 Mask */ - -#define GPIO_DOUT_DOUT4_Pos (4) /*!< GPIO_T::DOUT: DOUT4 Position */ -#define GPIO_DOUT_DOUT4_Msk (0x1ul << GPIO_DOUT_DOUT4_Pos) /*!< GPIO_T::DOUT: DOUT4 Mask */ - -#define GPIO_DOUT_DOUT5_Pos (5) /*!< GPIO_T::DOUT: DOUT5 Position */ -#define GPIO_DOUT_DOUT5_Msk (0x1ul << GPIO_DOUT_DOUT5_Pos) /*!< GPIO_T::DOUT: DOUT5 Mask */ - -#define GPIO_DOUT_DOUT6_Pos (6) /*!< GPIO_T::DOUT: DOUT6 Position */ -#define GPIO_DOUT_DOUT6_Msk (0x1ul << GPIO_DOUT_DOUT6_Pos) /*!< GPIO_T::DOUT: DOUT6 Mask */ - -#define GPIO_DOUT_DOUT7_Pos (7) /*!< GPIO_T::DOUT: DOUT7 Position */ -#define GPIO_DOUT_DOUT7_Msk (0x1ul << GPIO_DOUT_DOUT7_Pos) /*!< GPIO_T::DOUT: DOUT7 Mask */ - -#define GPIO_DOUT_DOUT8_Pos (8) /*!< GPIO_T::DOUT: DOUT8 Position */ -#define GPIO_DOUT_DOUT8_Msk (0x1ul << GPIO_DOUT_DOUT8_Pos) /*!< GPIO_T::DOUT: DOUT8 Mask */ - -#define GPIO_DOUT_DOUT9_Pos (9) /*!< GPIO_T::DOUT: DOUT9 Position */ -#define GPIO_DOUT_DOUT9_Msk (0x1ul << GPIO_DOUT_DOUT9_Pos) /*!< GPIO_T::DOUT: DOUT9 Mask */ - -#define GPIO_DOUT_DOUT10_Pos (10) /*!< GPIO_T::DOUT: DOUT10 Position */ -#define GPIO_DOUT_DOUT10_Msk (0x1ul << GPIO_DOUT_DOUT10_Pos) /*!< GPIO_T::DOUT: DOUT10 Mask */ - -#define GPIO_DOUT_DOUT11_Pos (11) /*!< GPIO_T::DOUT: DOUT11 Position */ -#define GPIO_DOUT_DOUT11_Msk (0x1ul << GPIO_DOUT_DOUT11_Pos) /*!< GPIO_T::DOUT: DOUT11 Mask */ - -#define GPIO_DOUT_DOUT12_Pos (12) /*!< GPIO_T::DOUT: DOUT12 Position */ -#define GPIO_DOUT_DOUT12_Msk (0x1ul << GPIO_DOUT_DOUT12_Pos) /*!< GPIO_T::DOUT: DOUT12 Mask */ - -#define GPIO_DOUT_DOUT13_Pos (13) /*!< GPIO_T::DOUT: DOUT13 Position */ -#define GPIO_DOUT_DOUT13_Msk (0x1ul << GPIO_DOUT_DOUT13_Pos) /*!< GPIO_T::DOUT: DOUT13 Mask */ - -#define GPIO_DOUT_DOUT14_Pos (14) /*!< GPIO_T::DOUT: DOUT14 Position */ -#define GPIO_DOUT_DOUT14_Msk (0x1ul << GPIO_DOUT_DOUT14_Pos) /*!< GPIO_T::DOUT: DOUT14 Mask */ - -#define GPIO_DOUT_DOUT15_Pos (15) /*!< GPIO_T::DOUT: DOUT15 Position */ -#define GPIO_DOUT_DOUT15_Msk (0x1ul << GPIO_DOUT_DOUT15_Pos) /*!< GPIO_T::DOUT: DOUT15 Mask */ - -#define GPIO_DATMSK_DATMSK0_Pos (0) /*!< GPIO_T::DATMSK: DATMSK0 Position */ -#define GPIO_DATMSK_DATMSK0_Msk (0x1ul << GPIO_DATMSK_DATMSK0_Pos) /*!< GPIO_T::DATMSK: DATMSK0 Mask */ - -#define GPIO_DATMSK_DATMSK1_Pos (1) /*!< GPIO_T::DATMSK: DATMSK1 Position */ -#define GPIO_DATMSK_DATMSK1_Msk (0x1ul << GPIO_DATMSK_DATMSK1_Pos) /*!< GPIO_T::DATMSK: DATMSK1 Mask */ - -#define GPIO_DATMSK_DATMSK2_Pos (2) /*!< GPIO_T::DATMSK: DATMSK2 Position */ -#define GPIO_DATMSK_DATMSK2_Msk (0x1ul << GPIO_DATMSK_DATMSK2_Pos) /*!< GPIO_T::DATMSK: DATMSK2 Mask */ - -#define GPIO_DATMSK_DATMSK3_Pos (3) /*!< GPIO_T::DATMSK: DATMSK3 Position */ -#define GPIO_DATMSK_DATMSK3_Msk (0x1ul << GPIO_DATMSK_DATMSK3_Pos) /*!< GPIO_T::DATMSK: DATMSK3 Mask */ - -#define GPIO_DATMSK_DATMSK4_Pos (4) /*!< GPIO_T::DATMSK: DATMSK4 Position */ -#define GPIO_DATMSK_DATMSK4_Msk (0x1ul << GPIO_DATMSK_DATMSK4_Pos) /*!< GPIO_T::DATMSK: DATMSK4 Mask */ - -#define GPIO_DATMSK_DATMSK5_Pos (5) /*!< GPIO_T::DATMSK: DATMSK5 Position */ -#define GPIO_DATMSK_DATMSK5_Msk (0x1ul << GPIO_DATMSK_DATMSK5_Pos) /*!< GPIO_T::DATMSK: DATMSK5 Mask */ - -#define GPIO_DATMSK_DATMSK6_Pos (6) /*!< GPIO_T::DATMSK: DATMSK6 Position */ -#define GPIO_DATMSK_DATMSK6_Msk (0x1ul << GPIO_DATMSK_DATMSK6_Pos) /*!< GPIO_T::DATMSK: DATMSK6 Mask */ - -#define GPIO_DATMSK_DATMSK7_Pos (7) /*!< GPIO_T::DATMSK: DATMSK7 Position */ -#define GPIO_DATMSK_DATMSK7_Msk (0x1ul << GPIO_DATMSK_DATMSK7_Pos) /*!< GPIO_T::DATMSK: DATMSK7 Mask */ - -#define GPIO_DATMSK_DATMSK8_Pos (8) /*!< GPIO_T::DATMSK: DATMSK8 Position */ -#define GPIO_DATMSK_DATMSK8_Msk (0x1ul << GPIO_DATMSK_DATMSK8_Pos) /*!< GPIO_T::DATMSK: DATMSK8 Mask */ - -#define GPIO_DATMSK_DATMSK9_Pos (9) /*!< GPIO_T::DATMSK: DATMSK9 Position */ -#define GPIO_DATMSK_DATMSK9_Msk (0x1ul << GPIO_DATMSK_DATMSK9_Pos) /*!< GPIO_T::DATMSK: DATMSK9 Mask */ - -#define GPIO_DATMSK_DATMSK10_Pos (10) /*!< GPIO_T::DATMSK: DATMSK10 Position */ -#define GPIO_DATMSK_DATMSK10_Msk (0x1ul << GPIO_DATMSK_DATMSK10_Pos) /*!< GPIO_T::DATMSK: DATMSK10 Mask */ - -#define GPIO_DATMSK_DATMSK11_Pos (11) /*!< GPIO_T::DATMSK: DATMSK11 Position */ -#define GPIO_DATMSK_DATMSK11_Msk (0x1ul << GPIO_DATMSK_DATMSK11_Pos) /*!< GPIO_T::DATMSK: DATMSK11 Mask */ - -#define GPIO_DATMSK_DATMSK12_Pos (12) /*!< GPIO_T::DATMSK: DATMSK12 Position */ -#define GPIO_DATMSK_DATMSK12_Msk (0x1ul << GPIO_DATMSK_DATMSK12_Pos) /*!< GPIO_T::DATMSK: DATMSK12 Mask */ - -#define GPIO_DATMSK_DATMSK13_Pos (13) /*!< GPIO_T::DATMSK: DATMSK13 Position */ -#define GPIO_DATMSK_DATMSK13_Msk (0x1ul << GPIO_DATMSK_DATMSK13_Pos) /*!< GPIO_T::DATMSK: DATMSK13 Mask */ - -#define GPIO_DATMSK_DATMSK14_Pos (14) /*!< GPIO_T::DATMSK: DATMSK14 Position */ -#define GPIO_DATMSK_DATMSK14_Msk (0x1ul << GPIO_DATMSK_DATMSK14_Pos) /*!< GPIO_T::DATMSK: DATMSK14 Mask */ - -#define GPIO_DATMSK_DATMSK15_Pos (15) /*!< GPIO_T::DATMSK: DATMSK15 Position */ -#define GPIO_DATMSK_DATMSK15_Msk (0x1ul << GPIO_DATMSK_DATMSK15_Pos) /*!< GPIO_T::DATMSK: DATMSK15 Mask */ - -#define GPIO_PIN_PIN0_Pos (0) /*!< GPIO_T::PIN: PIN0 Position */ -#define GPIO_PIN_PIN0_Msk (0x1ul << GPIO_PIN_PIN0_Pos) /*!< GPIO_T::PIN: PIN0 Mask */ - -#define GPIO_PIN_PIN1_Pos (1) /*!< GPIO_T::PIN: PIN1 Position */ -#define GPIO_PIN_PIN1_Msk (0x1ul << GPIO_PIN_PIN1_Pos) /*!< GPIO_T::PIN: PIN1 Mask */ - -#define GPIO_PIN_PIN2_Pos (2) /*!< GPIO_T::PIN: PIN2 Position */ -#define GPIO_PIN_PIN2_Msk (0x1ul << GPIO_PIN_PIN2_Pos) /*!< GPIO_T::PIN: PIN2 Mask */ - -#define GPIO_PIN_PIN3_Pos (3) /*!< GPIO_T::PIN: PIN3 Position */ -#define GPIO_PIN_PIN3_Msk (0x1ul << GPIO_PIN_PIN3_Pos) /*!< GPIO_T::PIN: PIN3 Mask */ - -#define GPIO_PIN_PIN4_Pos (4) /*!< GPIO_T::PIN: PIN4 Position */ -#define GPIO_PIN_PIN4_Msk (0x1ul << GPIO_PIN_PIN4_Pos) /*!< GPIO_T::PIN: PIN4 Mask */ - -#define GPIO_PIN_PIN5_Pos (5) /*!< GPIO_T::PIN: PIN5 Position */ -#define GPIO_PIN_PIN5_Msk (0x1ul << GPIO_PIN_PIN5_Pos) /*!< GPIO_T::PIN: PIN5 Mask */ - -#define GPIO_PIN_PIN6_Pos (6) /*!< GPIO_T::PIN: PIN6 Position */ -#define GPIO_PIN_PIN6_Msk (0x1ul << GPIO_PIN_PIN6_Pos) /*!< GPIO_T::PIN: PIN6 Mask */ - -#define GPIO_PIN_PIN7_Pos (7) /*!< GPIO_T::PIN: PIN7 Position */ -#define GPIO_PIN_PIN7_Msk (0x1ul << GPIO_PIN_PIN7_Pos) /*!< GPIO_T::PIN: PIN7 Mask */ - -#define GPIO_PIN_PIN8_Pos (8) /*!< GPIO_T::PIN: PIN8 Position */ -#define GPIO_PIN_PIN8_Msk (0x1ul << GPIO_PIN_PIN8_Pos) /*!< GPIO_T::PIN: PIN8 Mask */ - -#define GPIO_PIN_PIN9_Pos (9) /*!< GPIO_T::PIN: PIN9 Position */ -#define GPIO_PIN_PIN9_Msk (0x1ul << GPIO_PIN_PIN9_Pos) /*!< GPIO_T::PIN: PIN9 Mask */ - -#define GPIO_PIN_PIN10_Pos (10) /*!< GPIO_T::PIN: PIN10 Position */ -#define GPIO_PIN_PIN10_Msk (0x1ul << GPIO_PIN_PIN10_Pos) /*!< GPIO_T::PIN: PIN10 Mask */ - -#define GPIO_PIN_PIN11_Pos (11) /*!< GPIO_T::PIN: PIN11 Position */ -#define GPIO_PIN_PIN11_Msk (0x1ul << GPIO_PIN_PIN11_Pos) /*!< GPIO_T::PIN: PIN11 Mask */ - -#define GPIO_PIN_PIN12_Pos (12) /*!< GPIO_T::PIN: PIN12 Position */ -#define GPIO_PIN_PIN12_Msk (0x1ul << GPIO_PIN_PIN12_Pos) /*!< GPIO_T::PIN: PIN12 Mask */ - -#define GPIO_PIN_PIN13_Pos (13) /*!< GPIO_T::PIN: PIN13 Position */ -#define GPIO_PIN_PIN13_Msk (0x1ul << GPIO_PIN_PIN13_Pos) /*!< GPIO_T::PIN: PIN13 Mask */ - -#define GPIO_PIN_PIN14_Pos (14) /*!< GPIO_T::PIN: PIN14 Position */ -#define GPIO_PIN_PIN14_Msk (0x1ul << GPIO_PIN_PIN14_Pos) /*!< GPIO_T::PIN: PIN14 Mask */ - -#define GPIO_PIN_PIN15_Pos (15) /*!< GPIO_T::PIN: PIN15 Position */ -#define GPIO_PIN_PIN15_Msk (0x1ul << GPIO_PIN_PIN15_Pos) /*!< GPIO_T::PIN: PIN15 Mask */ - -#define GPIO_DBEN_DBEN0_Pos (0) /*!< GPIO_T::DBEN: DBEN0 Position */ -#define GPIO_DBEN_DBEN0_Msk (0x1ul << GPIO_DBEN_DBEN0_Pos) /*!< GPIO_T::DBEN: DBEN0 Mask */ - -#define GPIO_DBEN_DBEN1_Pos (1) /*!< GPIO_T::DBEN: DBEN1 Position */ -#define GPIO_DBEN_DBEN1_Msk (0x1ul << GPIO_DBEN_DBEN1_Pos) /*!< GPIO_T::DBEN: DBEN1 Mask */ - -#define GPIO_DBEN_DBEN2_Pos (2) /*!< GPIO_T::DBEN: DBEN2 Position */ -#define GPIO_DBEN_DBEN2_Msk (0x1ul << GPIO_DBEN_DBEN2_Pos) /*!< GPIO_T::DBEN: DBEN2 Mask */ - -#define GPIO_DBEN_DBEN3_Pos (3) /*!< GPIO_T::DBEN: DBEN3 Position */ -#define GPIO_DBEN_DBEN3_Msk (0x1ul << GPIO_DBEN_DBEN3_Pos) /*!< GPIO_T::DBEN: DBEN3 Mask */ - -#define GPIO_DBEN_DBEN4_Pos (4) /*!< GPIO_T::DBEN: DBEN4 Position */ -#define GPIO_DBEN_DBEN4_Msk (0x1ul << GPIO_DBEN_DBEN4_Pos) /*!< GPIO_T::DBEN: DBEN4 Mask */ - -#define GPIO_DBEN_DBEN5_Pos (5) /*!< GPIO_T::DBEN: DBEN5 Position */ -#define GPIO_DBEN_DBEN5_Msk (0x1ul << GPIO_DBEN_DBEN5_Pos) /*!< GPIO_T::DBEN: DBEN5 Mask */ - -#define GPIO_DBEN_DBEN6_Pos (6) /*!< GPIO_T::DBEN: DBEN6 Position */ -#define GPIO_DBEN_DBEN6_Msk (0x1ul << GPIO_DBEN_DBEN6_Pos) /*!< GPIO_T::DBEN: DBEN6 Mask */ - -#define GPIO_DBEN_DBEN7_Pos (7) /*!< GPIO_T::DBEN: DBEN7 Position */ -#define GPIO_DBEN_DBEN7_Msk (0x1ul << GPIO_DBEN_DBEN7_Pos) /*!< GPIO_T::DBEN: DBEN7 Mask */ - -#define GPIO_DBEN_DBEN8_Pos (8) /*!< GPIO_T::DBEN: DBEN8 Position */ -#define GPIO_DBEN_DBEN8_Msk (0x1ul << GPIO_DBEN_DBEN8_Pos) /*!< GPIO_T::DBEN: DBEN8 Mask */ - -#define GPIO_DBEN_DBEN9_Pos (9) /*!< GPIO_T::DBEN: DBEN9 Position */ -#define GPIO_DBEN_DBEN9_Msk (0x1ul << GPIO_DBEN_DBEN9_Pos) /*!< GPIO_T::DBEN: DBEN9 Mask */ - -#define GPIO_DBEN_DBEN10_Pos (10) /*!< GPIO_T::DBEN: DBEN10 Position */ -#define GPIO_DBEN_DBEN10_Msk (0x1ul << GPIO_DBEN_DBEN10_Pos) /*!< GPIO_T::DBEN: DBEN10 Mask */ - -#define GPIO_DBEN_DBEN11_Pos (11) /*!< GPIO_T::DBEN: DBEN11 Position */ -#define GPIO_DBEN_DBEN11_Msk (0x1ul << GPIO_DBEN_DBEN11_Pos) /*!< GPIO_T::DBEN: DBEN11 Mask */ - -#define GPIO_DBEN_DBEN12_Pos (12) /*!< GPIO_T::DBEN: DBEN12 Position */ -#define GPIO_DBEN_DBEN12_Msk (0x1ul << GPIO_DBEN_DBEN12_Pos) /*!< GPIO_T::DBEN: DBEN12 Mask */ - -#define GPIO_DBEN_DBEN13_Pos (13) /*!< GPIO_T::DBEN: DBEN13 Position */ -#define GPIO_DBEN_DBEN13_Msk (0x1ul << GPIO_DBEN_DBEN13_Pos) /*!< GPIO_T::DBEN: DBEN13 Mask */ - -#define GPIO_DBEN_DBEN14_Pos (14) /*!< GPIO_T::DBEN: DBEN14 Position */ -#define GPIO_DBEN_DBEN14_Msk (0x1ul << GPIO_DBEN_DBEN14_Pos) /*!< GPIO_T::DBEN: DBEN14 Mask */ - -#define GPIO_DBEN_DBEN15_Pos (15) /*!< GPIO_T::DBEN: DBEN15 Position */ -#define GPIO_DBEN_DBEN15_Msk (0x1ul << GPIO_DBEN_DBEN15_Pos) /*!< GPIO_T::DBEN: DBEN15 Mask */ - -#define GPIO_INTTYPE_TYPE0_Pos (0) /*!< GPIO_T::INTTYPE: TYPE0 Position */ -#define GPIO_INTTYPE_TYPE0_Msk (0x1ul << GPIO_INTTYPE_TYPE0_Pos) /*!< GPIO_T::INTTYPE: TYPE0 Mask */ - -#define GPIO_INTTYPE_TYPE1_Pos (1) /*!< GPIO_T::INTTYPE: TYPE1 Position */ -#define GPIO_INTTYPE_TYPE1_Msk (0x1ul << GPIO_INTTYPE_TYPE1_Pos) /*!< GPIO_T::INTTYPE: TYPE1 Mask */ - -#define GPIO_INTTYPE_TYPE2_Pos (2) /*!< GPIO_T::INTTYPE: TYPE2 Position */ -#define GPIO_INTTYPE_TYPE2_Msk (0x1ul << GPIO_INTTYPE_TYPE2_Pos) /*!< GPIO_T::INTTYPE: TYPE2 Mask */ - -#define GPIO_INTTYPE_TYPE3_Pos (3) /*!< GPIO_T::INTTYPE: TYPE3 Position */ -#define GPIO_INTTYPE_TYPE3_Msk (0x1ul << GPIO_INTTYPE_TYPE3_Pos) /*!< GPIO_T::INTTYPE: TYPE3 Mask */ - -#define GPIO_INTTYPE_TYPE4_Pos (4) /*!< GPIO_T::INTTYPE: TYPE4 Position */ -#define GPIO_INTTYPE_TYPE4_Msk (0x1ul << GPIO_INTTYPE_TYPE4_Pos) /*!< GPIO_T::INTTYPE: TYPE4 Mask */ - -#define GPIO_INTTYPE_TYPE5_Pos (5) /*!< GPIO_T::INTTYPE: TYPE5 Position */ -#define GPIO_INTTYPE_TYPE5_Msk (0x1ul << GPIO_INTTYPE_TYPE5_Pos) /*!< GPIO_T::INTTYPE: TYPE5 Mask */ - -#define GPIO_INTTYPE_TYPE6_Pos (6) /*!< GPIO_T::INTTYPE: TYPE6 Position */ -#define GPIO_INTTYPE_TYPE6_Msk (0x1ul << GPIO_INTTYPE_TYPE6_Pos) /*!< GPIO_T::INTTYPE: TYPE6 Mask */ - -#define GPIO_INTTYPE_TYPE7_Pos (7) /*!< GPIO_T::INTTYPE: TYPE7 Position */ -#define GPIO_INTTYPE_TYPE7_Msk (0x1ul << GPIO_INTTYPE_TYPE7_Pos) /*!< GPIO_T::INTTYPE: TYPE7 Mask */ - -#define GPIO_INTTYPE_TYPE8_Pos (8) /*!< GPIO_T::INTTYPE: TYPE8 Position */ -#define GPIO_INTTYPE_TYPE8_Msk (0x1ul << GPIO_INTTYPE_TYPE8_Pos) /*!< GPIO_T::INTTYPE: TYPE8 Mask */ - -#define GPIO_INTTYPE_TYPE9_Pos (9) /*!< GPIO_T::INTTYPE: TYPE9 Position */ -#define GPIO_INTTYPE_TYPE9_Msk (0x1ul << GPIO_INTTYPE_TYPE9_Pos) /*!< GPIO_T::INTTYPE: TYPE9 Mask */ - -#define GPIO_INTTYPE_TYPE10_Pos (10) /*!< GPIO_T::INTTYPE: TYPE10 Position */ -#define GPIO_INTTYPE_TYPE10_Msk (0x1ul << GPIO_INTTYPE_TYPE10_Pos) /*!< GPIO_T::INTTYPE: TYPE10 Mask */ - -#define GPIO_INTTYPE_TYPE11_Pos (11) /*!< GPIO_T::INTTYPE: TYPE11 Position */ -#define GPIO_INTTYPE_TYPE11_Msk (0x1ul << GPIO_INTTYPE_TYPE11_Pos) /*!< GPIO_T::INTTYPE: TYPE11 Mask */ - -#define GPIO_INTTYPE_TYPE12_Pos (12) /*!< GPIO_T::INTTYPE: TYPE12 Position */ -#define GPIO_INTTYPE_TYPE12_Msk (0x1ul << GPIO_INTTYPE_TYPE12_Pos) /*!< GPIO_T::INTTYPE: TYPE12 Mask */ - -#define GPIO_INTTYPE_TYPE13_Pos (13) /*!< GPIO_T::INTTYPE: TYPE13 Position */ -#define GPIO_INTTYPE_TYPE13_Msk (0x1ul << GPIO_INTTYPE_TYPE13_Pos) /*!< GPIO_T::INTTYPE: TYPE13 Mask */ - -#define GPIO_INTTYPE_TYPE14_Pos (14) /*!< GPIO_T::INTTYPE: TYPE14 Position */ -#define GPIO_INTTYPE_TYPE14_Msk (0x1ul << GPIO_INTTYPE_TYPE14_Pos) /*!< GPIO_T::INTTYPE: TYPE14 Mask */ - -#define GPIO_INTTYPE_TYPE15_Pos (15) /*!< GPIO_T::INTTYPE: TYPE15 Position */ -#define GPIO_INTTYPE_TYPE15_Msk (0x1ul << GPIO_INTTYPE_TYPE15_Pos) /*!< GPIO_T::INTTYPE: TYPE15 Mask */ - -#define GPIO_INTEN_FLIEN0_Pos (0) /*!< GPIO_T::INTEN: FLIEN0 Position */ -#define GPIO_INTEN_FLIEN0_Msk (0x1ul << GPIO_INTEN_FLIEN0_Pos) /*!< GPIO_T::INTEN: FLIEN0 Mask */ - -#define GPIO_INTEN_FLIEN1_Pos (1) /*!< GPIO_T::INTEN: FLIEN1 Position */ -#define GPIO_INTEN_FLIEN1_Msk (0x1ul << GPIO_INTEN_FLIEN1_Pos) /*!< GPIO_T::INTEN: FLIEN1 Mask */ - -#define GPIO_INTEN_FLIEN2_Pos (2) /*!< GPIO_T::INTEN: FLIEN2 Position */ -#define GPIO_INTEN_FLIEN2_Msk (0x1ul << GPIO_INTEN_FLIEN2_Pos) /*!< GPIO_T::INTEN: FLIEN2 Mask */ - -#define GPIO_INTEN_FLIEN3_Pos (3) /*!< GPIO_T::INTEN: FLIEN3 Position */ -#define GPIO_INTEN_FLIEN3_Msk (0x1ul << GPIO_INTEN_FLIEN3_Pos) /*!< GPIO_T::INTEN: FLIEN3 Mask */ - -#define GPIO_INTEN_FLIEN4_Pos (4) /*!< GPIO_T::INTEN: FLIEN4 Position */ -#define GPIO_INTEN_FLIEN4_Msk (0x1ul << GPIO_INTEN_FLIEN4_Pos) /*!< GPIO_T::INTEN: FLIEN4 Mask */ - -#define GPIO_INTEN_FLIEN5_Pos (5) /*!< GPIO_T::INTEN: FLIEN5 Position */ -#define GPIO_INTEN_FLIEN5_Msk (0x1ul << GPIO_INTEN_FLIEN5_Pos) /*!< GPIO_T::INTEN: FLIEN5 Mask */ - -#define GPIO_INTEN_FLIEN6_Pos (6) /*!< GPIO_T::INTEN: FLIEN6 Position */ -#define GPIO_INTEN_FLIEN6_Msk (0x1ul << GPIO_INTEN_FLIEN6_Pos) /*!< GPIO_T::INTEN: FLIEN6 Mask */ - -#define GPIO_INTEN_FLIEN7_Pos (7) /*!< GPIO_T::INTEN: FLIEN7 Position */ -#define GPIO_INTEN_FLIEN7_Msk (0x1ul << GPIO_INTEN_FLIEN7_Pos) /*!< GPIO_T::INTEN: FLIEN7 Mask */ - -#define GPIO_INTEN_FLIEN8_Pos (8) /*!< GPIO_T::INTEN: FLIEN8 Position */ -#define GPIO_INTEN_FLIEN8_Msk (0x1ul << GPIO_INTEN_FLIEN8_Pos) /*!< GPIO_T::INTEN: FLIEN8 Mask */ - -#define GPIO_INTEN_FLIEN9_Pos (9) /*!< GPIO_T::INTEN: FLIEN9 Position */ -#define GPIO_INTEN_FLIEN9_Msk (0x1ul << GPIO_INTEN_FLIEN9_Pos) /*!< GPIO_T::INTEN: FLIEN9 Mask */ - -#define GPIO_INTEN_FLIEN10_Pos (10) /*!< GPIO_T::INTEN: FLIEN10 Position */ -#define GPIO_INTEN_FLIEN10_Msk (0x1ul << GPIO_INTEN_FLIEN10_Pos) /*!< GPIO_T::INTEN: FLIEN10 Mask */ - -#define GPIO_INTEN_FLIEN11_Pos (11) /*!< GPIO_T::INTEN: FLIEN11 Position */ -#define GPIO_INTEN_FLIEN11_Msk (0x1ul << GPIO_INTEN_FLIEN11_Pos) /*!< GPIO_T::INTEN: FLIEN11 Mask */ - -#define GPIO_INTEN_FLIEN12_Pos (12) /*!< GPIO_T::INTEN: FLIEN12 Position */ -#define GPIO_INTEN_FLIEN12_Msk (0x1ul << GPIO_INTEN_FLIEN12_Pos) /*!< GPIO_T::INTEN: FLIEN12 Mask */ - -#define GPIO_INTEN_FLIEN13_Pos (13) /*!< GPIO_T::INTEN: FLIEN13 Position */ -#define GPIO_INTEN_FLIEN13_Msk (0x1ul << GPIO_INTEN_FLIEN13_Pos) /*!< GPIO_T::INTEN: FLIEN13 Mask */ - -#define GPIO_INTEN_FLIEN14_Pos (14) /*!< GPIO_T::INTEN: FLIEN14 Position */ -#define GPIO_INTEN_FLIEN14_Msk (0x1ul << GPIO_INTEN_FLIEN14_Pos) /*!< GPIO_T::INTEN: FLIEN14 Mask */ - -#define GPIO_INTEN_FLIEN15_Pos (15) /*!< GPIO_T::INTEN: FLIEN15 Position */ -#define GPIO_INTEN_FLIEN15_Msk (0x1ul << GPIO_INTEN_FLIEN15_Pos) /*!< GPIO_T::INTEN: FLIEN15 Mask */ - -#define GPIO_INTEN_RHIEN0_Pos (16) /*!< GPIO_T::INTEN: RHIEN0 Position */ -#define GPIO_INTEN_RHIEN0_Msk (0x1ul << GPIO_INTEN_RHIEN0_Pos) /*!< GPIO_T::INTEN: RHIEN0 Mask */ - -#define GPIO_INTEN_RHIEN1_Pos (17) /*!< GPIO_T::INTEN: RHIEN1 Position */ -#define GPIO_INTEN_RHIEN1_Msk (0x1ul << GPIO_INTEN_RHIEN1_Pos) /*!< GPIO_T::INTEN: RHIEN1 Mask */ - -#define GPIO_INTEN_RHIEN2_Pos (18) /*!< GPIO_T::INTEN: RHIEN2 Position */ -#define GPIO_INTEN_RHIEN2_Msk (0x1ul << GPIO_INTEN_RHIEN2_Pos) /*!< GPIO_T::INTEN: RHIEN2 Mask */ - -#define GPIO_INTEN_RHIEN3_Pos (19) /*!< GPIO_T::INTEN: RHIEN3 Position */ -#define GPIO_INTEN_RHIEN3_Msk (0x1ul << GPIO_INTEN_RHIEN3_Pos) /*!< GPIO_T::INTEN: RHIEN3 Mask */ - -#define GPIO_INTEN_RHIEN4_Pos (20) /*!< GPIO_T::INTEN: RHIEN4 Position */ -#define GPIO_INTEN_RHIEN4_Msk (0x1ul << GPIO_INTEN_RHIEN4_Pos) /*!< GPIO_T::INTEN: RHIEN4 Mask */ - -#define GPIO_INTEN_RHIEN5_Pos (21) /*!< GPIO_T::INTEN: RHIEN5 Position */ -#define GPIO_INTEN_RHIEN5_Msk (0x1ul << GPIO_INTEN_RHIEN5_Pos) /*!< GPIO_T::INTEN: RHIEN5 Mask */ - -#define GPIO_INTEN_RHIEN6_Pos (22) /*!< GPIO_T::INTEN: RHIEN6 Position */ -#define GPIO_INTEN_RHIEN6_Msk (0x1ul << GPIO_INTEN_RHIEN6_Pos) /*!< GPIO_T::INTEN: RHIEN6 Mask */ - -#define GPIO_INTEN_RHIEN7_Pos (23) /*!< GPIO_T::INTEN: RHIEN7 Position */ -#define GPIO_INTEN_RHIEN7_Msk (0x1ul << GPIO_INTEN_RHIEN7_Pos) /*!< GPIO_T::INTEN: RHIEN7 Mask */ - -#define GPIO_INTEN_RHIEN8_Pos (24) /*!< GPIO_T::INTEN: RHIEN8 Position */ -#define GPIO_INTEN_RHIEN8_Msk (0x1ul << GPIO_INTEN_RHIEN8_Pos) /*!< GPIO_T::INTEN: RHIEN8 Mask */ - -#define GPIO_INTEN_RHIEN9_Pos (25) /*!< GPIO_T::INTEN: RHIEN9 Position */ -#define GPIO_INTEN_RHIEN9_Msk (0x1ul << GPIO_INTEN_RHIEN9_Pos) /*!< GPIO_T::INTEN: RHIEN9 Mask */ - -#define GPIO_INTEN_RHIEN10_Pos (26) /*!< GPIO_T::INTEN: RHIEN10 Position */ -#define GPIO_INTEN_RHIEN10_Msk (0x1ul << GPIO_INTEN_RHIEN10_Pos) /*!< GPIO_T::INTEN: RHIEN10 Mask */ - -#define GPIO_INTEN_RHIEN11_Pos (27) /*!< GPIO_T::INTEN: RHIEN11 Position */ -#define GPIO_INTEN_RHIEN11_Msk (0x1ul << GPIO_INTEN_RHIEN11_Pos) /*!< GPIO_T::INTEN: RHIEN11 Mask */ - -#define GPIO_INTEN_RHIEN12_Pos (28) /*!< GPIO_T::INTEN: RHIEN12 Position */ -#define GPIO_INTEN_RHIEN12_Msk (0x1ul << GPIO_INTEN_RHIEN12_Pos) /*!< GPIO_T::INTEN: RHIEN12 Mask */ - -#define GPIO_INTEN_RHIEN13_Pos (29) /*!< GPIO_T::INTEN: RHIEN13 Position */ -#define GPIO_INTEN_RHIEN13_Msk (0x1ul << GPIO_INTEN_RHIEN13_Pos) /*!< GPIO_T::INTEN: RHIEN13 Mask */ - -#define GPIO_INTEN_RHIEN14_Pos (30) /*!< GPIO_T::INTEN: RHIEN14 Position */ -#define GPIO_INTEN_RHIEN14_Msk (0x1ul << GPIO_INTEN_RHIEN14_Pos) /*!< GPIO_T::INTEN: RHIEN14 Mask */ - -#define GPIO_INTEN_RHIEN15_Pos (31) /*!< GPIO_T::INTEN: RHIEN15 Position */ -#define GPIO_INTEN_RHIEN15_Msk (0x1ul << GPIO_INTEN_RHIEN15_Pos) /*!< GPIO_T::INTEN: RHIEN15 Mask */ - -#define GPIO_INTSRC_INTSRC0_Pos (0) /*!< GPIO_T::INTSRC: INTSRC0 Position */ -#define GPIO_INTSRC_INTSRC0_Msk (0x1ul << GPIO_INTSRC_INTSRC0_Pos) /*!< GPIO_T::INTSRC: INTSRC0 Mask */ - -#define GPIO_INTSRC_INTSRC1_Pos (1) /*!< GPIO_T::INTSRC: INTSRC1 Position */ -#define GPIO_INTSRC_INTSRC1_Msk (0x1ul << GPIO_INTSRC_INTSRC1_Pos) /*!< GPIO_T::INTSRC: INTSRC1 Mask */ - -#define GPIO_INTSRC_INTSRC2_Pos (2) /*!< GPIO_T::INTSRC: INTSRC2 Position */ -#define GPIO_INTSRC_INTSRC2_Msk (0x1ul << GPIO_INTSRC_INTSRC2_Pos) /*!< GPIO_T::INTSRC: INTSRC2 Mask */ - -#define GPIO_INTSRC_INTSRC3_Pos (3) /*!< GPIO_T::INTSRC: INTSRC3 Position */ -#define GPIO_INTSRC_INTSRC3_Msk (0x1ul << GPIO_INTSRC_INTSRC3_Pos) /*!< GPIO_T::INTSRC: INTSRC3 Mask */ - -#define GPIO_INTSRC_INTSRC4_Pos (4) /*!< GPIO_T::INTSRC: INTSRC4 Position */ -#define GPIO_INTSRC_INTSRC4_Msk (0x1ul << GPIO_INTSRC_INTSRC4_Pos) /*!< GPIO_T::INTSRC: INTSRC4 Mask */ - -#define GPIO_INTSRC_INTSRC5_Pos (5) /*!< GPIO_T::INTSRC: INTSRC5 Position */ -#define GPIO_INTSRC_INTSRC5_Msk (0x1ul << GPIO_INTSRC_INTSRC5_Pos) /*!< GPIO_T::INTSRC: INTSRC5 Mask */ - -#define GPIO_INTSRC_INTSRC6_Pos (6) /*!< GPIO_T::INTSRC: INTSRC6 Position */ -#define GPIO_INTSRC_INTSRC6_Msk (0x1ul << GPIO_INTSRC_INTSRC6_Pos) /*!< GPIO_T::INTSRC: INTSRC6 Mask */ - -#define GPIO_INTSRC_INTSRC7_Pos (7) /*!< GPIO_T::INTSRC: INTSRC7 Position */ -#define GPIO_INTSRC_INTSRC7_Msk (0x1ul << GPIO_INTSRC_INTSRC7_Pos) /*!< GPIO_T::INTSRC: INTSRC7 Mask */ - -#define GPIO_INTSRC_INTSRC8_Pos (8) /*!< GPIO_T::INTSRC: INTSRC8 Position */ -#define GPIO_INTSRC_INTSRC8_Msk (0x1ul << GPIO_INTSRC_INTSRC8_Pos) /*!< GPIO_T::INTSRC: INTSRC8 Mask */ - -#define GPIO_INTSRC_INTSRC9_Pos (9) /*!< GPIO_T::INTSRC: INTSRC9 Position */ -#define GPIO_INTSRC_INTSRC9_Msk (0x1ul << GPIO_INTSRC_INTSRC9_Pos) /*!< GPIO_T::INTSRC: INTSRC9 Mask */ - -#define GPIO_INTSRC_INTSRC10_Pos (10) /*!< GPIO_T::INTSRC: INTSRC10 Position */ -#define GPIO_INTSRC_INTSRC10_Msk (0x1ul << GPIO_INTSRC_INTSRC10_Pos) /*!< GPIO_T::INTSRC: INTSRC10 Mask */ - -#define GPIO_INTSRC_INTSRC11_Pos (11) /*!< GPIO_T::INTSRC: INTSRC11 Position */ -#define GPIO_INTSRC_INTSRC11_Msk (0x1ul << GPIO_INTSRC_INTSRC11_Pos) /*!< GPIO_T::INTSRC: INTSRC11 Mask */ - -#define GPIO_INTSRC_INTSRC12_Pos (12) /*!< GPIO_T::INTSRC: INTSRC12 Position */ -#define GPIO_INTSRC_INTSRC12_Msk (0x1ul << GPIO_INTSRC_INTSRC12_Pos) /*!< GPIO_T::INTSRC: INTSRC12 Mask */ - -#define GPIO_INTSRC_INTSRC13_Pos (13) /*!< GPIO_T::INTSRC: INTSRC13 Position */ -#define GPIO_INTSRC_INTSRC13_Msk (0x1ul << GPIO_INTSRC_INTSRC13_Pos) /*!< GPIO_T::INTSRC: INTSRC13 Mask */ - -#define GPIO_INTSRC_INTSRC14_Pos (14) /*!< GPIO_T::INTSRC: INTSRC14 Position */ -#define GPIO_INTSRC_INTSRC14_Msk (0x1ul << GPIO_INTSRC_INTSRC14_Pos) /*!< GPIO_T::INTSRC: INTSRC14 Mask */ - -#define GPIO_INTSRC_INTSRC15_Pos (15) /*!< GPIO_T::INTSRC: INTSRC15 Position */ -#define GPIO_INTSRC_INTSRC15_Msk (0x1ul << GPIO_INTSRC_INTSRC15_Pos) /*!< GPIO_T::INTSRC: INTSRC15 Mask */ - -#define GPIO_DBCTL_DBCLKSEL_Pos (0) /*!< GPIO_DBCTL_T::DBCTL: DBCLKSEL Position */ -#define GPIO_DBCTL_DBCLKSEL_Msk (0xful << GPIO_DBCTL_DBCLKSEL_Pos) /*!< GPIO_DBCTL_T::DBCTL: DBCLKSEL Mask */ - -#define GPIO_DBCTL_DBCLKSRC_Pos (4) /*!< GPIO_DBCTL_T::DBCTL: DBCLKSRC Position */ -#define GPIO_DBCTL_DBCLKSRC_Msk (0x1ul << GPIO_DBCTL_DBCLKSRC_Pos) /*!< GPIO_DBCTL_T::DBCTL: DBCLKSRC Mask */ - -#define GPIO_DBCTL_ICLKON_Pos (5) /*!< GPIO_DBCTL_T::DBCTL: ICLKON Position */ -#define GPIO_DBCTL_ICLKON_Msk (0x1ul << GPIO_DBCTL_ICLKON_Pos) /*!< GPIO_DBCTL_T::DBCTL: ICLKON Mask */ - -#define GPIO_PDIO_PDIO_Pos (0) /*!< PDIO Position */ -#define GPIO_PDIO_PDIO_Msk (0x1ul << GPIO_PDIO_PDIO_Pos) /*!< PDIO Mask */ - -/**@}*/ /* GPIO_CONST */ -/**@}*/ /* end of GPIO register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __GPIO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/hdiv_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/hdiv_reg.h deleted file mode 100644 index 4cb467cbf79..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/hdiv_reg.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************//** - * @file hdiv_reg.h - * @version V1.00 - * @brief HDIV register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HDIV_REG_H__ -#define __HDIV_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup HDIV Hardware Divider (HDIV) - Memory Mapped Structure for HDIV Controller -@{ */ - -typedef struct -{ - - - /** - * DIVIDEND - * =================================================================================================== - * Offset: 0x00 Dividend Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DIVIDEND |Dividend Source - * | | |This register is given the dividend of divider before calculation starting. - */ - __IO uint32_t DIVIDEND; - - /** - * DIVISOR - * =================================================================================================== - * Offset: 0x04 Divisor Source Resister - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DIVISOR |Divisor Source - * | | |This register is given the divisor of divider before calculation starts. - * | | |Note: When this register is written, hardware divider will start calculate. - */ - __IO uint32_t DIVISOR; - - /** - * QUOTIENT - * =================================================================================================== - * Offset: 0x08 Quotient Result Resister - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |QUOTIENT |Quotient Result - * | | |This register holds the quotient result of divider after calculation complete. - */ - __IO uint32_t QUOTIENT; - - /** - * REM - * =================================================================================================== - * Offset: 0x0C Remainder Result Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |REM |Remainder Result - * | | |The remainder of hardware divider is 16-bit sign integer (REM[15:0]) with sign extension - * | | |(REM[31:16]) to 32-bit integer. - */ - __IO uint32_t REM; - - /** - * STATUS - * =================================================================================================== - * Offset: 0x10 Divider Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |DIVBYZERO |Divisor Zero Warning - * | | |0 = The divisor is not 0. - * | | |1 = The divisor is 0. - * | | |Note: The DIVBYZERO flag is used to indicate divide-by-zero situation and updated whenever - * | | |HDIV_DIVISOR is written. - * | | |This register is read only. - */ - __I uint32_t STATUS; - -} HDIV_T; - -/** - @addtogroup HDIV_CONST HDIV Bit Field Definition - Constant Definitions for HDIV Controller -@{ */ - -#define HDIV_DIVIDEND_DIVIDEND_Pos (0) /*!< HDIV_T::DIVIDEND: DIVIDEND Position */ -#define HDIV_DIVIDEND_DIVIDEND_Msk (0xfffffffful << HDIV_DIVIDEND_DIVIDEND_Pos) /*!< HDIV_T::DIVIDEND: DIVIDEND Mask */ - -#define HDIV_DIVISOR_DIVISOR_Pos (0) /*!< HDIV_T::DIVISOR: DIVISOR Position */ -#define HDIV_DIVISOR_DIVISOR_Msk (0xfffful << HDIV_DIVISOR_DIVISOR_Pos) /*!< HDIV_T::DIVISOR: DIVISOR Mask */ - -#define HDIV_QUOTIENT_QUOTIENT_Pos (0) /*!< HDIV_T::QUOTIENT: QUOTIENT Position */ -#define HDIV_QUOTIENT_QUOTIENT_Msk (0xfffffffful << HDIV_QUOTIENT_QUOTIENT_Pos) /*!< HDIV_T::QUOTIENT: QUOTIENT Mask */ - -#define HDIV_REM_REM_Pos (0) /*!< HDIV_T::REM: REM Position */ -#define HDIV_REM_REM_Msk (0xfffffffful << HDIV_REM_REM_Pos) /*!< HDIV_T::REM: REM Mask */ - -#define HDIV_STATUS_DIVBYZERO_Pos (1) /*!< HDIV_T::STATUS: DIVBYZERO Position */ -#define HDIV_STATUS_DIVBYZERO_Msk (0x1ul << HDIV_STATUS_DIVBYZERO_Pos) /*!< HDIV_T::STATUS: DIVBYZERO Mask */ - -/**@}*/ /* HDIV_CONST */ -/**@}*/ /* end of HDIV register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __HDIV_REG_H__ */ - - -/**@}*/ /* HDIV_CONST */ -/**@}*/ /* end of HDIV register group */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/i2c_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/i2c_reg.h deleted file mode 100644 index 8e7f9da7fd7..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/i2c_reg.h +++ /dev/null @@ -1,750 +0,0 @@ -/**************************************************************************//** - * @file i2c_reg.h - * @version V1.00 - * @brief I2C register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __I2C_REG_H__ -#define __I2C_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup I2C Inter-IC Bus Controller (I2C) - Memory Mapped Structure for I2C Controller -@{ */ - -typedef struct -{ - - - /** - * @var I2C_T::CTL0 - * Offset: 0x00 I2C Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |AA |Assert Acknowledge Control - * | | |When AA =1 prior to address or data is received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter. - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line. - * |[3] |SI |I2C Interrupt Flag - * | | |When a new I2C state is present in the I2C_STATUS0 register, the SI flag is set by hardware. - * | | |If bit INTEN (I2C_CTL0 [7]) is set, the I2C interrupt is requested. - * | | |SI must be cleared by software. - * | | |Clear SI by writing 1 to this bit. - * |[4] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C controller will check the bus condition if a STOP condition is detected. - * | | |This bit will be cleared by hardware automatically. - * |[5] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[6] |I2CEN |I2C Controller Enable Bit - * | | |Set to enable I2C serial function controller. - * | | |When I2CEN=1 the I2C serial function enable. - * | | |The multi-function pin function must set to SDA, and SCL of I2C function first. - * | | |0 = I2C controller Disabled. - * | | |1 = I2C controller Enabled. - * |[7] |INTEN |Enable Interrupt - * | | |0 = I2C interrupt Disabled. - * | | |1 = I2C interrupt Enabled. - * @var I2C_T::ADDR0 - * Offset: 0x04 I2C Slave Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[7:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode. - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address. - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 7'h00, the address can not be used. - * @var I2C_T::DAT - * Offset: 0x08 I2C Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |I2C Data - * | | |Bit [7:0] is located with the 8-bit transferred/received data of I2C serial port. - * @var I2C_T::STATUS0 - * Offset: 0x0C I2C Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |STATUS |I2C Status - * | | |The three least significant bits are always 0. - * | | |The five most significant bits contain the status code. - * | | |There are 28 possible status codes. - * | | |When the content of I2C_STATUS0 is F8H, no serial interrupt is requested. - * | | |Others I2C_STATUS0 values correspond to defined I2C states. - * | | |When each of these states is entered, a status interrupt is requested (SI = 1). - * | | |A valid status code is present in I2C_STATUS0 one cycle after SI is set by hardware and is still present one cycle after SI has been reset by software. - * | | |In addition, states 00H stands for a Bus Error. - * | | |A Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame. - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit. - * @var I2C_T::CLKDIV - * Offset: 0x10 I2C Clock Divided Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DIVIDER |I2C Clock Divided - * | | |Indicates the I2C clock rate: Data Baud Rate of I2C = (system clock) / (4x (I2C_CLKDIV+1)). - * | | |Note: The minimum value of I2C_CLKDIV is 4. - * @var I2C_T::TOCTL - * Offset: 0x14 I2C Time-out Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIF |Time-out Flag - * | | |This bit is set by hardware when I2C time-out happened and it can interrupt CPU if I2C interrupt enable bit (INTEN) is set to 1. - * | | |Note: Software can write 1 to clear this bit. - * |[1] |TOCDIV4 |Time-out Counter Input Clock Divided by 4 - * | | |When enabled, the time-out period is extended 4 times. - * | | |0 = Time-out period is extend 4 times Disabled. - * | | |1 = Time-out period is extend 4 times Enabled. - * |[2] |TOCEN |Time-out Counter Enable Bit - * | | |When enabled, the 14-bit time-out counter will start counting when SI is cleared. - * | | |Setting flag SI to '1' will reset counter and re-start up counting after SI is cleared. - * | | |0 = Time-out counter Disabled. - * | | |1 = Time-out counter Enabled. - * @var I2C_T::ADDR1 - * Offset: 0x18 I2C Slave Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[7:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode. - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address. - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 7'h00, the address can not be used. - * @var I2C_T::ADDR2 - * Offset: 0x1C I2C Slave Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[7:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode. - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address. - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 7'h00, the address can not be used. - * @var I2C_T::ADDR3 - * Offset: 0x20 I2C Slave Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[7:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode. - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address. - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 7'h00, the address can not be used. - * @var I2C_T::ADDRMSK0 - * Offset: 0x24 I2C Slave Address Mask Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care). - * | | |I2C bus controllers support multiple address recognition with four address mask register. - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care. - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK1 - * Offset: 0x28 I2C Slave Address Mask Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care). - * | | |I2C bus controllers support multiple address recognition with four address mask register. - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care. - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK2 - * Offset: 0x2C I2C Slave Address Mask Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care). - * | | |I2C bus controllers support multiple address recognition with four address mask register. - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care. - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK3 - * Offset: 0x30 I2C Slave Address Mask Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care). - * | | |I2C bus controllers support multiple address recognition with four address mask register. - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care. - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::WKCTL - * Offset: 0x3C I2C Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |I2C Wake-up Enable Bit - * | | |0 = I2C wake-up function Disabled. - * | | |1= I2C wake-up function Enabled. - * |[7] |NHDBUSEN |I2C No Hold BUS Enable Bit - * | | |0 = I2C hold bus after wake-up. - * | | |1= I2C don't hold bus after wake-up. - * | | |Note: The I2C controller could respond when WKIF event is not clear, it may cause error data transmitted or received. - * | | |If data transmitted or received when WKIF event is not clear, user must reset I2C controller and execute the original operation again. - * @var I2C_T::WKSTS - * Offset: 0x40 I2C Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKIF |I2C Wake-up Flag - * | | |When chip is woken up from Power-down mode by I2C, this bit is set to 1. - * | | |Software can write 1 to clear this bit. - * |[1] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release WKIF. Software can write 1 to clear this bit. - * |[2] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame (Read Only) - * | | |0 = Write command be record on the address match wakeup frame. - * | | |1 = Read command be record on the address match wakeup frame. - * | | |Note: This bit will be cleared when software can write 1 to WKAKDONE (I2C_WKSTS[1]) bit. - * @var I2C_T::CTL1 - * Offset: 0x44 I2C Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[1] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the I2C request to PDMA. - * |[3] |OVRIEN |I2C over Run Interrupt Control Bit - * | | |Setting OVRIEN to logic 1 will send a interrupt to system when the TWOFF bit is enabled and there is over run event in received buffer. - * |[4] |UDRIEN |I2C Under Run Interrupt Control Bit - * | | |Setting UDRIEN to logic 1 will send a interrupt to system when the TWOFF bit is enabled and there is under run event happened in transmitted buffer. - * |[5] |TWOBUFEN |Two-level BUFFER Enable Bit - * | | |0 = Two-level buffer Disabled. - * | | |1 = Two-level buffer Enabled. - * | | |Set to enable the two-level buffer for I2C transmitted or received buffer. - * | | |It is used to improve the performance of the I2C bus. - * | | |If this bit is set = 1, the control bit of STA for repeat start or STO bit should be set after the current SI is cleared. - * | | |For example: if there are 4 data shall be transmitted and then stop it. - * | | |The STO bit shall be set after the 3rd data's SI event being clear. - * | | |In this time, the 4th data can be transmitted and the I2C stop after the 4th data transmission done. - * |[6] |BUFRST |Two-level BUFFER Reset - * | | |0 = No effect. - * | | |1 = Reset the related counters, two-level buffer state machine, and the content of data buffer. - * |[7] |NSTRETCH |No Stretch on the I2C Bus - * | | |0 = The I2C SCL bus is stretched by hardware if the SI is not cleared in master mode. - * | | |1 = The I2C SCL bus is not stretched by hardware if the SI is not cleared in master mode. - * |[8] |PDMASTR |PDMA Stretch Bit - * | | |0 = I2C send STOP automatically after PDMA transfer done. (only master TX) - * | | |1 = I2C SCL bus is stretched by hardware after PDMA transfer done if the SI is not cleared. - * | | |(only master TX) - * @var I2C_T::STATUS1 - * Offset: 0x48 I2C Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |FULL |TWO-lEVEL BUFFER FULL - * | | |This bit indicates two-level buffer TX or RX full or not when the TWOBUFEN = 1. - * | | |This bit is set when POINTER is equal to 2. - * | | |Note:This bit is read only. - * |[5] |EMPTY |TWO-lEVEL BUFFER EMPTY - * | | |This bit indicates two-level buffer TX or RX empty or not when the TWOBUFEN = 1. - * | | |This bit is set when POINTER is equal to 0. - * | | |Note:This bit is read only. - * |[6] |OVR |I2C over Run Status Bit - * | | |This bit indicates the received two-level buffer TX or RX is over run when the TWOBUFEN = 1. - * | | |Note:This bit is read only. - * |[7] |UDR |I2C Under Run Status Bit - * | | |This bit indicates the transmitted two-level buffer TX or RX is under run when the TWOBUFEN = 1. - * | | |Note:This bit is read only. - * |[8] |ONBUSY |On Bus Busy (Read Only) - * | | |Indicates that a communication is in progress on the bus. - * | | |It is set by hardware when a START condition is detected. - * | | |It is cleared by hardware when a STOP condition is detected. - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * @var I2C_T::TMCTL - * Offset: 0x4C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control - * | | |This field is used to generate a delay timing between SDA falling edge and SCL rising edge in transmission mode. - * | | |The delay setup time is numbers of peripheral clock = STCTL x PCLK. - * | | |Note: Setup time setting should not make SCL output less than three PCLKs. - * |[24:16] |HTCTL |Hold Time Configure Control - * | | |This field is used to generate the delay timing between SCL falling edge and SDA rising edge in transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x PCLK. - * @var I2C_T::BUSCTL - * Offset: 0x50 I2C Bus Management Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACKMEN |Acknowledge Control by Manual - * | | |In order to allow ACK control in slave reception including the command and data, slave byte control mode must be enabled by setting the ACKMEN bit. - * | | |0 = Slave byte control Disabled. - * | | |1 = Slave byte control Enabled. - * | | |The 9th bit can response the ACK or NACK according the received data by user. - * | | |When the byte is received, stretching the SCLK signal low between the 8th and 9th SCLK pulse. - * | | |Note: If the BMDEN =1 and this bit is enabled, the information of I2C_STATUS0 will be fixed as 0xF0 in slave receive condition. - * |[1] |PECEN |Packet Error Checking Calculation Enable Bit - * | | |0 = Packet Error Checking Calculation Disabled. - * | | |1 = Packet Error Checking Calculation Enabled. - * | | |Note: When I2C enter powerdown mode, the bit should be enabled after wake-up if needed PEC calculation. - * |[2] |BMDEN |Bus Management Device Default Address Enable Bit - * | | |0 = Device default address Disable. - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses NACKed - * | | |1 = Device default address Enabled. - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses ACKed. - * |[3] |BMHEN |Bus Management Host Enable Bit - * | | |0 = Host function Disabled. - * | | |1 = Host function Enabled. - * |[4] |ALERTEN |Bus Management Alert Enable Bit - * | | |Device Mode (BMHEN =0). - * | | |0 = Release the BM_ALERT pin high and Alert Response Header disabled: 0001100x followed by NACK if both of BMDEN and ACKMEN are enabled. - * | | |1 = Drive BM_ALERT pin low and Alert Response Address Header enables: 0001100x followed by ACK if both of BMDEN and ACKMEN are enabled. - * | | |Host Mode (BMHEN =1). - * | | |0 = BM_ALERT pin not supported. - * | | |1 = BM_ALERT pin supported. - * |[5] |SCTLOSTS |Suspend/Control Data Output Status - * | | |0 = The output of SUSCON pin is low. - * | | |1 = The output of SUSCON pin is high. - * |[6] |SCTLOEN |Suspend or Control Pin Output Enable Bit - * | | |0 = The SUSCON pin in input. - * | | |1 = The output enable is active on the SUSCON pin. - * |[7] |BUSEN |BUS Enable Bit - * | | |0 = The system management function Disabled. - * | | |1 = The system management function Enabled. - * | | |Note: When the bit is enabled, the internal 14-bit counter is used to calculate the time out event of clock low condition. - * |[8] |PECTXEN |Packet Error Checking Byte Transmission/Reception - * | | |0 = No PEC transfer. - * | | |1 = PEC transmission is requested. - * | | |Note: 1.This bit has no effect in slave mode when ACKMEN =0. - * |[9] |TIDLE |Timer Check in Idle State - * | | |The BUSTOUT is used to calculate the time-out of clock low in bus active and the idle period in bus Idle. - * | | |This bit is used to define which condition is enabled. - * | | |0 = BUSTOUT is used to calculate the clock low period in bus active. - * | | |1 = BUSTOUT is used to calculate the IDLE period in bus Idle. - * | | |Note: The BUSY (I2C_BUSSTS[0]) indicate the current bus state. - * |[10] |PECCLR |PEC Clear at Repeat Start - * | | |The calculation of PEC starts when PECEN is set to 1 and it is cleared when the STA or STO bit is detected. - * | | |This PECCLR bit is used to enable the condition of REPEAT START can clear the PEC calculation. - * | | |0 = PEC calculation is cleared by "Repeat Start" function Disabled. - * | | |1 = PEC calculation is cleared by "Repeat Start" function Enabled. - * |[11] |ACKM9SI |Acknowledge Manual Enable Extra SI Interrupt - * | | |0 = There is no SI interrupt in the 9th clock cycle when the BUSEN =1 and ACKMEN =1. - * | | |1 = There is SI interrupt in the 9th clock cycle when the BUSEN =1 and ACKMEN =1. - * |[12] |BCDIEN |Packet Error Checking Byte Count Done Interrupt Enable Bit - * | | |0 = Byte count done interrupt Disabled. - * | | |1 = Byte count done interrupt Enabled. - * | | |Note: This bit is used in PECEN =1. - * |[13] |PECDIEN |Packet Error Checking Byte Transfer Done Interrupt Enable Bit - * | | |0 = PEC transfer done interrupt Disabled. - * | | |1 = PEC transfer done interrupt Enabled. - * | | |Note: This bit is used in PECEN =1. - * @var I2C_T::BUSTCTL - * Offset: 0x54 I2C Bus Management Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSTOEN |Bus Time Out Enable Bit - * | | |0 = Bus clock low time-out detection Disabled. - * | | |1 = Bus clock low time-out detection Enabled (bus clock is low for more than TTime-out (in BIDLE=0) or high more than TTime-out(in BIDLE =1) - * |[1] |CLKTOEN |Cumulative Clock Low Time Out Enable Bit - * | | |0 = Cumulative clock low time-out detection Disabled. - * | | |1 = Cumulative clock low time-out detection Enabled. - * | | |For Master, it calculates the period from START to ACK - * | | |For Slave, it calculates the period from START to STOP - * |[2] |BUSTOIEN |Time-out Interrupt Enable Bit - * | | |BUSY =1. - * | | |0 = SCLK low time-out interrupt Disabled. - * | | |1 = SCLK low time-out interrupt Enabled. - * | | |BUSY =0. - * | | |0 = Bus IDLE time-out interrupt Disabled. - * | | |1 = Bus IDLE time-out interrupt Enabled. - * |[3] |CLKTOIEN |Extended Clock Time Out Interrupt Enable Bit - * | | |0 = Clock time out interrupt Disabled. - * | | |1 = Clock time out interrupt Enabled. - * |[4] |TORSTEN |Time Out Reset Enable Bit - * | | |0 = I2C state machine reset Disabled. - * | | |1 = I2C state machine reset Enabled. (The clock and data bus will be released to high) - * @var I2C_T::BUSSTS - * Offset: 0x58 I2C Bus Management Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Bus Busy (Read Only) - * | | |Indicates that a communication is in progress on the bus. - * | | |It is set by hardware when a START condition is detected. - * | | |It is cleared by hardware when a STOP condition is detected. - * | | |0 = Bus is IDLE (both SCLK and SDA High). - * | | |1 = Bus is busy. - * |[1] |BCDONE |Byte Count Transmission/Receive Done - * | | |0 = Byte count transmission/ receive is not finished when the PECEN is set. - * | | |1 = Byte count transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * |[2] |PECERR |PEC Error in Reception - * | | |0 = PEC value equal the received PEC data packet. - * | | |1 = PEC value doesn't match the receive PEC data packet. - * | | |Note: Software can write 1 to clear this bit. - * |[3] |ALERT |SMBus Alert Status - * | | |Device Mode (BMHEN =0). - * | | |0 = SMBALERT pin state is low. - * | | |1 = SMBALERT pin state is high. - * | | |Host Mode (BMHEN =1). - * | | |0 = No SMBALERT event. - * | | |1 = There is SMBALERT event (falling edge) is detected in SMALERT pin when the BMHEN = 1 (SMBus host configuration) and the ALERTEN = 1. - * | | |Note: - * | | |1. The SMBALERT pin is an open-drain pin, the pull-high resistor is must in the system - * | | |2. Software can write 1 to clear this bit. - * |[4] |SCTLDIN |Bus Suspend or Control Signal Input Status (Read Only) - * | | |0 = The input status of SUSCON pin is 0. - * | | |1 = The input status of SUSCON pin is 1. - * |[5] |BUSTO |Bus Time-out Status - * | | |0 = There is no any time-out or external clock time-out. - * | | |1 = A time-out or external clock time-out occurred. - * | | |In bus busy, the bit indicates the total clock low time-out event occurred; otherwise, it indicates the bus idle time-out event occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[6] |CLKTO |Clock Low Cumulate Time-out Status - * | | |0 = Cumulative clock low is no any time-out. - * | | |1 = Cumulative clock low time-out occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[7] |PECDONE |PEC Byte Transmission/Receive Done - * | | |0 = PEC transmission/ receive is not finished when the PECEN is set. - * | | |1 = PEC transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * @var I2C_T::PKTSIZE - * Offset: 0x5C I2C Packet Error Checking Byte Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |PLDSIZE |Transfer Byte Number - * | | |The transmission or receive byte number in one transaction when the PECEN is set. - * | | |The maximum transaction or receive byte is 256 Bytes. - * | | |Note: The byte number counting includes address, command code, and data frame. - * @var I2C_T::PKTCRC - * Offset: 0x60 I2C Packet Error Checking Byte Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PECCRC |Packet Error Checking Byte Value - * | | |This byte indicates the packet error checking content after transmission or receive byte count by using the C(x) = X8 + X2 + X + 1. - * | | |It is read only. - * @var I2C_T::BUSTOUT - * Offset: 0x64 I2C Bus Management Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BUSTO |Bus Management Time-out Value - * | | |Indicates the bus time-out value in bus is IDLE or SCLK low. - * | | |Note: If the user wants to revise the value of BUSTOUT, the TORSTEN (I2C_BUSTCTL[4]) bit shall be set to 1 and clear to 0 first in the BUSEN(I2C_BUSCTL[7]) is set. - * @var I2C_T::CLKTOUT - * Offset: 0x68 I2C Bus Management Clock Low Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CLKTO |Bus Clock Low Timer - * | | |The field is used to configure the cumulative clock extension time-out. - * | | |Note: If the user wants to revise the value of CLKLTOUT, the TORSTEN bit shall be set to 1 and clear to 0 first in the BUSEN is set. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2C Control Register 0 */ - __IO uint32_t ADDR0; /*!< [0x0004] I2C Slave Address Register0 */ - __IO uint32_t DAT; /*!< [0x0008] I2C Data Register */ - __I uint32_t STATUS0; /*!< [0x000c] I2C Status Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0010] I2C Clock Divided Register */ - __IO uint32_t TOCTL; /*!< [0x0014] I2C Time-out Control Register */ - __IO uint32_t ADDR1; /*!< [0x0018] I2C Slave Address Register1 */ - __IO uint32_t ADDR2; /*!< [0x001c] I2C Slave Address Register2 */ - __IO uint32_t ADDR3; /*!< [0x0020] I2C Slave Address Register3 */ - __IO uint32_t ADDRMSK0; /*!< [0x0024] I2C Slave Address Mask Register0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0028] I2C Slave Address Mask Register1 */ - __IO uint32_t ADDRMSK2; /*!< [0x002c] I2C Slave Address Mask Register2 */ - __IO uint32_t ADDRMSK3; /*!< [0x0030] I2C Slave Address Mask Register3 */ - __I uint32_t RESERVE0[2]; - __IO uint32_t WKCTL; /*!< [0x003c] I2C Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0040] I2C Wake-up Status Register */ - __IO uint32_t CTL1; /*!< [0x0044] I2C Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0048] I2C Status Register 1 */ - __IO uint32_t TMCTL; /*!< [0x004c] I2C Timing Configure Control Register */ - __IO uint32_t BUSCTL; /*!< [0x0050] I2C Bus Management Control Register */ - __IO uint32_t BUSTCTL; /*!< [0x0054] I2C Bus Management Timer Control Register */ - __IO uint32_t BUSSTS; /*!< [0x0058] I2C Bus Management Status Register */ - __IO uint32_t PKTSIZE; /*!< [0x005c] I2C Packet Error Checking Byte Number Register */ - __I uint32_t PKTCRC; /*!< [0x0060] I2C Packet Error Checking Byte Value Register */ - __IO uint32_t BUSTOUT; /*!< [0x0064] I2C Bus Management Timer Register */ - __IO uint32_t CLKTOUT; /*!< [0x0068] I2C Bus Management Clock Low Timer Register */ -} I2C_T; - -/** - @addtogroup I2C_CONST I2C Bit Field Definition - Constant Definitions for I2C Controller -@{ */ - -#define I2C_CTL0_AA_Pos (2) /*!< I2C_T::CTL0: AA Position */ -#define I2C_CTL0_AA_Msk (0x1ul << I2C_CTL0_AA_Pos) /*!< I2C_T::CTL0: AA Mask */ - -#define I2C_CTL0_SI_Pos (3) /*!< I2C_T::CTL0: SI Position */ -#define I2C_CTL0_SI_Msk (0x1ul << I2C_CTL0_SI_Pos) /*!< I2C_T::CTL0: SI Mask */ - -#define I2C_CTL0_STO_Pos (4) /*!< I2C_T::CTL0: STO Position */ -#define I2C_CTL0_STO_Msk (0x1ul << I2C_CTL0_STO_Pos) /*!< I2C_T::CTL0: STO Mask */ - -#define I2C_CTL0_STA_Pos (5) /*!< I2C_T::CTL0: STA Position */ -#define I2C_CTL0_STA_Msk (0x1ul << I2C_CTL0_STA_Pos) /*!< I2C_T::CTL0: STA Mask */ - -#define I2C_CTL0_I2CEN_Pos (6) /*!< I2C_T::CTL0: I2CEN Position */ -#define I2C_CTL0_I2CEN_Msk (0x1ul << I2C_CTL0_I2CEN_Pos) /*!< I2C_T::CTL0: I2CEN Mask */ - -#define I2C_CTL0_INTEN_Pos (7) /*!< I2C_T::CTL0: INTEN Position */ -#define I2C_CTL0_INTEN_Msk (0x1ul << I2C_CTL0_INTEN_Pos) /*!< I2C_T::CTL0: INTEN Mask */ - -#define I2C_ADDR0_GC_Pos (0) /*!< I2C_T::ADDR0: GC Position */ -#define I2C_ADDR0_GC_Msk (0x1ul << I2C_ADDR0_GC_Pos) /*!< I2C_T::ADDR0: GC Mask */ - -#define I2C_ADDR0_ADDR_Pos (1) /*!< I2C_T::ADDR0: ADDR Position */ -#define I2C_ADDR0_ADDR_Msk (0x7ful << I2C_ADDR0_ADDR_Pos) /*!< I2C_T::ADDR0: ADDR Mask */ - -#define I2C_DAT_DAT_Pos (0) /*!< I2C_T::DAT: DAT Position */ -#define I2C_DAT_DAT_Msk (0xfful << I2C_DAT_DAT_Pos) /*!< I2C_T::DAT: DAT Mask */ - -#define I2C_STATUS0_STATUS_Pos (0) /*!< I2C_T::STATUS0: STATUS Position */ -#define I2C_STATUS0_STATUS_Msk (0xfful << I2C_STATUS0_STATUS_Pos) /*!< I2C_T::STATUS0: STATUS Mask */ - -#define I2C_CLKDIV_DIVIDER_Pos (0) /*!< I2C_T::CLKDIV: DIVIDER Position */ -#define I2C_CLKDIV_DIVIDER_Msk (0x3fful << I2C_CLKDIV_DIVIDER_Pos) /*!< I2C_T::CLKDIV: DIVIDER Mask */ - -#define I2C_TOCTL_TOIF_Pos (0) /*!< I2C_T::TOCTL: TOIF Position */ -#define I2C_TOCTL_TOIF_Msk (0x1ul << I2C_TOCTL_TOIF_Pos) /*!< I2C_T::TOCTL: TOIF Mask */ - -#define I2C_TOCTL_TOCDIV4_Pos (1) /*!< I2C_T::TOCTL: TOCDIV4 Position */ -#define I2C_TOCTL_TOCDIV4_Msk (0x1ul << I2C_TOCTL_TOCDIV4_Pos) /*!< I2C_T::TOCTL: TOCDIV4 Mask */ - -#define I2C_TOCTL_TOCEN_Pos (2) /*!< I2C_T::TOCTL: TOCEN Position */ -#define I2C_TOCTL_TOCEN_Msk (0x1ul << I2C_TOCTL_TOCEN_Pos) /*!< I2C_T::TOCTL: TOCEN Mask */ - -#define I2C_ADDR1_GC_Pos (0) /*!< I2C_T::ADDR1: GC Position */ -#define I2C_ADDR1_GC_Msk (0x1ul << I2C_ADDR1_GC_Pos) /*!< I2C_T::ADDR1: GC Mask */ - -#define I2C_ADDR1_ADDR_Pos (1) /*!< I2C_T::ADDR1: ADDR Position */ -#define I2C_ADDR1_ADDR_Msk (0x7ful << I2C_ADDR1_ADDR_Pos) /*!< I2C_T::ADDR1: ADDR Mask */ - -#define I2C_ADDR2_GC_Pos (0) /*!< I2C_T::ADDR2: GC Position */ -#define I2C_ADDR2_GC_Msk (0x1ul << I2C_ADDR2_GC_Pos) /*!< I2C_T::ADDR2: GC Mask */ - -#define I2C_ADDR2_ADDR_Pos (1) /*!< I2C_T::ADDR2: ADDR Position */ -#define I2C_ADDR2_ADDR_Msk (0x7ful << I2C_ADDR2_ADDR_Pos) /*!< I2C_T::ADDR2: ADDR Mask */ - -#define I2C_ADDR3_GC_Pos (0) /*!< I2C_T::ADDR3: GC Position */ -#define I2C_ADDR3_GC_Msk (0x1ul << I2C_ADDR3_GC_Pos) /*!< I2C_T::ADDR3: GC Mask */ - -#define I2C_ADDR3_ADDR_Pos (1) /*!< I2C_T::ADDR3: ADDR Position */ -#define I2C_ADDR3_ADDR_Msk (0x7ful << I2C_ADDR3_ADDR_Pos) /*!< I2C_T::ADDR3: ADDR Mask */ - -#define I2C_ADDRMSK0_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK0: ADDRMSK Position */ -#define I2C_ADDRMSK0_ADDRMSK_Msk (0x7ful << I2C_ADDRMSK0_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define I2C_ADDRMSK1_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK1: ADDRMSK Position */ -#define I2C_ADDRMSK1_ADDRMSK_Msk (0x7ful << I2C_ADDRMSK1_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define I2C_ADDRMSK2_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK2: ADDRMSK Position */ -#define I2C_ADDRMSK2_ADDRMSK_Msk (0x7ful << I2C_ADDRMSK2_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK2: ADDRMSK Mask */ - -#define I2C_ADDRMSK3_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK3: ADDRMSK Position */ -#define I2C_ADDRMSK3_ADDRMSK_Msk (0x7ful << I2C_ADDRMSK3_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK3: ADDRMSK Mask */ - -#define I2C_WKCTL_WKEN_Pos (0) /*!< I2C_T::WKCTL: WKEN Position */ -#define I2C_WKCTL_WKEN_Msk (0x1ul << I2C_WKCTL_WKEN_Pos) /*!< I2C_T::WKCTL: WKEN Mask */ - -#define I2C_WKCTL_NHDBUSEN_Pos (7) /*!< I2C_T::WKCTL: NHDBUSEN Position */ -#define I2C_WKCTL_NHDBUSEN_Msk (0x1ul << I2C_WKCTL_NHDBUSEN_Pos) /*!< I2C_T::WKCTL: NHDBUSEN Mask */ - -#define I2C_WKSTS_WKIF_Pos (0) /*!< I2C_T::WKSTS: WKIF Position */ -#define I2C_WKSTS_WKIF_Msk (0x1ul << I2C_WKSTS_WKIF_Pos) /*!< I2C_T::WKSTS: WKIF Mask */ - -#define I2C_WKSTS_WKAKDONE_Pos (1) /*!< I2C_T::WKSTS: WKAKDONE Position */ -#define I2C_WKSTS_WKAKDONE_Msk (0x1ul << I2C_WKSTS_WKAKDONE_Pos) /*!< I2C_T::WKSTS: WKAKDONE Mask */ - -#define I2C_WKSTS_WRSTSWK_Pos (2) /*!< I2C_T::WKSTS: WRSTSWK Position */ -#define I2C_WKSTS_WRSTSWK_Msk (0x1ul << I2C_WKSTS_WRSTSWK_Pos) /*!< I2C_T::WKSTS: WRSTSWK Mask */ - -#define I2C_CTL1_TXPDMAEN_Pos (0) /*!< I2C_T::CTL1: TXPDMAEN Position */ -#define I2C_CTL1_TXPDMAEN_Msk (0x1ul << I2C_CTL1_TXPDMAEN_Pos) /*!< I2C_T::CTL1: TXPDMAEN Mask */ - -#define I2C_CTL1_RXPDMAEN_Pos (1) /*!< I2C_T::CTL1: RXPDMAEN Position */ -#define I2C_CTL1_RXPDMAEN_Msk (0x1ul << I2C_CTL1_RXPDMAEN_Pos) /*!< I2C_T::CTL1: RXPDMAEN Mask */ - -#define I2C_CTL1_PDMARST_Pos (2) /*!< I2C_T::CTL1: PDMARST Position */ -#define I2C_CTL1_PDMARST_Msk (0x1ul << I2C_CTL1_PDMARST_Pos) /*!< I2C_T::CTL1: PDMARST Mask */ - -#define I2C_CTL1_OVRIEN_Pos (3) /*!< I2C_T::CTL1: OVRIEN Position */ -#define I2C_CTL1_OVRIEN_Msk (0x1ul << I2C_CTL1_OVRIEN_Pos) /*!< I2C_T::CTL1: OVRIEN Mask */ - -#define I2C_CTL1_UDRIEN_Pos (4) /*!< I2C_T::CTL1: UDRIEN Position */ -#define I2C_CTL1_UDRIEN_Msk (0x1ul << I2C_CTL1_UDRIEN_Pos) /*!< I2C_T::CTL1: UDRIEN Mask */ - -#define I2C_CTL1_TWOBUFEN_Pos (5) /*!< I2C_T::CTL1: TWOBUFEN Position */ -#define I2C_CTL1_TWOBUFEN_Msk (0x1ul << I2C_CTL1_TWOBUFEN_Pos) /*!< I2C_T::CTL1: TWOBUFEN Mask */ - -#define I2C_CTL1_BUFRST_Pos (6) /*!< I2C_T::CTL1: BUFRST Position */ -#define I2C_CTL1_BUFRST_Msk (0x1ul << I2C_CTL1_BUFRST_Pos) /*!< I2C_T::CTL1: BUFRST Mask */ - -#define I2C_CTL1_NSTRETCH_Pos (7) /*!< I2C_T::CTL1: NSTRETCH Position */ -#define I2C_CTL1_NSTRETCH_Msk (0x1ul << I2C_CTL1_NSTRETCH_Pos) /*!< I2C_T::CTL1: NSTRETCH Mask */ - -#define I2C_CTL1_PDMASTR_Pos (8) /*!< I2C_T::CTL1: PDMASTR Position */ -#define I2C_CTL1_PDMASTR_Msk (0x1ul << I2C_CTL1_PDMASTR_Pos) /*!< I2C_T::CTL1: PDMASTR Mask */ - -#define I2C_STATUS1_FULL_Pos (4) /*!< I2C_T::STATUS1: FULL Position */ -#define I2C_STATUS1_FULL_Msk (0x1ul << I2C_STATUS1_FULL_Pos) /*!< I2C_T::STATUS1: FULL Mask */ - -#define I2C_STATUS1_EMPTY_Pos (5) /*!< I2C_T::STATUS1: EMPTY Position */ -#define I2C_STATUS1_EMPTY_Msk (0x1ul << I2C_STATUS1_EMPTY_Pos) /*!< I2C_T::STATUS1: EMPTY Mask */ - -#define I2C_STATUS1_OVR_Pos (6) /*!< I2C_T::STATUS1: OVR Position */ -#define I2C_STATUS1_OVR_Msk (0x1ul << I2C_STATUS1_OVR_Pos) /*!< I2C_T::STATUS1: OVR Mask */ - -#define I2C_STATUS1_UDR_Pos (7) /*!< I2C_T::STATUS1: UDR Position */ -#define I2C_STATUS1_UDR_Msk (0x1ul << I2C_STATUS1_UDR_Pos) /*!< I2C_T::STATUS1: UDR Mask */ - -#define I2C_STATUS1_ONBUSY_Pos (8) /*!< I2C_T::STATUS1: ONBUSY Position */ -#define I2C_STATUS1_ONBUSY_Msk (0x1ul << I2C_STATUS1_ONBUSY_Pos) /*!< I2C_T::STATUS1: ONBUSY Mask */ - -#define I2C_TMCTL_STCTL_Pos (0) /*!< I2C_T::TMCTL: STCTL Position */ -#define I2C_TMCTL_STCTL_Msk (0x1fful << I2C_TMCTL_STCTL_Pos) /*!< I2C_T::TMCTL: STCTL Mask */ - -#define I2C_TMCTL_HTCTL_Pos (16) /*!< I2C_T::TMCTL: HTCTL Position */ -#define I2C_TMCTL_HTCTL_Msk (0x1fful << I2C_TMCTL_HTCTL_Pos) /*!< I2C_T::TMCTL: HTCTL Mask */ - -#define I2C_BUSCTL_ACKMEN_Pos (0) /*!< I2C_T::BUSCTL: ACKMEN Position */ -#define I2C_BUSCTL_ACKMEN_Msk (0x1ul << I2C_BUSCTL_ACKMEN_Pos) /*!< I2C_T::BUSCTL: ACKMEN Mask */ - -#define I2C_BUSCTL_PECEN_Pos (1) /*!< I2C_T::BUSCTL: PECEN Position */ -#define I2C_BUSCTL_PECEN_Msk (0x1ul << I2C_BUSCTL_PECEN_Pos) /*!< I2C_T::BUSCTL: PECEN Mask */ - -#define I2C_BUSCTL_BMDEN_Pos (2) /*!< I2C_T::BUSCTL: BMDEN Position */ -#define I2C_BUSCTL_BMDEN_Msk (0x1ul << I2C_BUSCTL_BMDEN_Pos) /*!< I2C_T::BUSCTL: BMDEN Mask */ - -#define I2C_BUSCTL_BMHEN_Pos (3) /*!< I2C_T::BUSCTL: BMHEN Position */ -#define I2C_BUSCTL_BMHEN_Msk (0x1ul << I2C_BUSCTL_BMHEN_Pos) /*!< I2C_T::BUSCTL: BMHEN Mask */ - -#define I2C_BUSCTL_ALERTEN_Pos (4) /*!< I2C_T::BUSCTL: ALERTEN Position */ -#define I2C_BUSCTL_ALERTEN_Msk (0x1ul << I2C_BUSCTL_ALERTEN_Pos) /*!< I2C_T::BUSCTL: ALERTEN Mask */ - -#define I2C_BUSCTL_SCTLOSTS_Pos (5) /*!< I2C_T::BUSCTL: SCTLOSTS Position */ -#define I2C_BUSCTL_SCTLOSTS_Msk (0x1ul << I2C_BUSCTL_SCTLOSTS_Pos) /*!< I2C_T::BUSCTL: SCTLOSTS Mask */ - -#define I2C_BUSCTL_SCTLOEN_Pos (6) /*!< I2C_T::BUSCTL: SCTLOEN Position */ -#define I2C_BUSCTL_SCTLOEN_Msk (0x1ul << I2C_BUSCTL_SCTLOEN_Pos) /*!< I2C_T::BUSCTL: SCTLOEN Mask */ - -#define I2C_BUSCTL_BUSEN_Pos (7) /*!< I2C_T::BUSCTL: BUSEN Position */ -#define I2C_BUSCTL_BUSEN_Msk (0x1ul << I2C_BUSCTL_BUSEN_Pos) /*!< I2C_T::BUSCTL: BUSEN Mask */ - -#define I2C_BUSCTL_PECTXEN_Pos (8) /*!< I2C_T::BUSCTL: PECTXEN Position */ -#define I2C_BUSCTL_PECTXEN_Msk (0x1ul << I2C_BUSCTL_PECTXEN_Pos) /*!< I2C_T::BUSCTL: PECTXEN Mask */ - -#define I2C_BUSCTL_TIDLE_Pos (9) /*!< I2C_T::BUSCTL: TIDLE Position */ -#define I2C_BUSCTL_TIDLE_Msk (0x1ul << I2C_BUSCTL_TIDLE_Pos) /*!< I2C_T::BUSCTL: TIDLE Mask */ - -#define I2C_BUSCTL_PECCLR_Pos (10) /*!< I2C_T::BUSCTL: PECCLR Position */ -#define I2C_BUSCTL_PECCLR_Msk (0x1ul << I2C_BUSCTL_PECCLR_Pos) /*!< I2C_T::BUSCTL: PECCLR Mask */ - -#define I2C_BUSCTL_ACKM9SI_Pos (11) /*!< I2C_T::BUSCTL: ACKM9SI Position */ -#define I2C_BUSCTL_ACKM9SI_Msk (0x1ul << I2C_BUSCTL_ACKM9SI_Pos) /*!< I2C_T::BUSCTL: ACKM9SI Mask */ - -#define I2C_BUSCTL_BCDIEN_Pos (12) /*!< I2C_T::BUSCTL: BCDIEN Position */ -#define I2C_BUSCTL_BCDIEN_Msk (0x1ul << I2C_BUSCTL_BCDIEN_Pos) /*!< I2C_T::BUSCTL: BCDIEN Mask */ - -#define I2C_BUSCTL_PECDIEN_Pos (13) /*!< I2C_T::BUSCTL: PECDIEN Position */ -#define I2C_BUSCTL_PECDIEN_Msk (0x1ul << I2C_BUSCTL_PECDIEN_Pos) /*!< I2C_T::BUSCTL: PECDIEN Mask */ - -#define I2C_BUSTCTL_BUSTOEN_Pos (0) /*!< I2C_T::BUSTCTL: BUSTOEN Position */ -#define I2C_BUSTCTL_BUSTOEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOEN Mask */ - -#define I2C_BUSTCTL_CLKTOEN_Pos (1) /*!< I2C_T::BUSTCTL: CLKTOEN Position */ -#define I2C_BUSTCTL_CLKTOEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOEN Mask */ - -#define I2C_BUSTCTL_BUSTOIEN_Pos (2) /*!< I2C_T::BUSTCTL: BUSTOIEN Position */ -#define I2C_BUSTCTL_BUSTOIEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOIEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOIEN Mask */ - -#define I2C_BUSTCTL_CLKTOIEN_Pos (3) /*!< I2C_T::BUSTCTL: CLKTOIEN Position */ -#define I2C_BUSTCTL_CLKTOIEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOIEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOIEN Mask */ - -#define I2C_BUSTCTL_TORSTEN_Pos (4) /*!< I2C_T::BUSTCTL: TORSTEN Position */ -#define I2C_BUSTCTL_TORSTEN_Msk (0x1ul << I2C_BUSTCTL_TORSTEN_Pos) /*!< I2C_T::BUSTCTL: TORSTEN Mask */ - -#define I2C_BUSSTS_BUSY_Pos (0) /*!< I2C_T::BUSSTS: BUSY Position */ -#define I2C_BUSSTS_BUSY_Msk (0x1ul << I2C_BUSSTS_BUSY_Pos) /*!< I2C_T::BUSSTS: BUSY Mask */ - -#define I2C_BUSSTS_BCDONE_Pos (1) /*!< I2C_T::BUSSTS: BCDONE Position */ -#define I2C_BUSSTS_BCDONE_Msk (0x1ul << I2C_BUSSTS_BCDONE_Pos) /*!< I2C_T::BUSSTS: BCDONE Mask */ - -#define I2C_BUSSTS_PECERR_Pos (2) /*!< I2C_T::BUSSTS: PECERR Position */ -#define I2C_BUSSTS_PECERR_Msk (0x1ul << I2C_BUSSTS_PECERR_Pos) /*!< I2C_T::BUSSTS: PECERR Mask */ - -#define I2C_BUSSTS_ALERT_Pos (3) /*!< I2C_T::BUSSTS: ALERT Position */ -#define I2C_BUSSTS_ALERT_Msk (0x1ul << I2C_BUSSTS_ALERT_Pos) /*!< I2C_T::BUSSTS: ALERT Mask */ - -#define I2C_BUSSTS_SCTLDIN_Pos (4) /*!< I2C_T::BUSSTS: SCTLDIN Position */ -#define I2C_BUSSTS_SCTLDIN_Msk (0x1ul << I2C_BUSSTS_SCTLDIN_Pos) /*!< I2C_T::BUSSTS: SCTLDIN Mask */ - -#define I2C_BUSSTS_BUSTO_Pos (5) /*!< I2C_T::BUSSTS: BUSTO Position */ -#define I2C_BUSSTS_BUSTO_Msk (0x1ul << I2C_BUSSTS_BUSTO_Pos) /*!< I2C_T::BUSSTS: BUSTO Mask */ - -#define I2C_BUSSTS_CLKTO_Pos (6) /*!< I2C_T::BUSSTS: CLKTO Position */ -#define I2C_BUSSTS_CLKTO_Msk (0x1ul << I2C_BUSSTS_CLKTO_Pos) /*!< I2C_T::BUSSTS: CLKTO Mask */ - -#define I2C_BUSSTS_PECDONE_Pos (7) /*!< I2C_T::BUSSTS: PECDONE Position */ -#define I2C_BUSSTS_PECDONE_Msk (0x1ul << I2C_BUSSTS_PECDONE_Pos) /*!< I2C_T::BUSSTS: PECDONE Mask */ - -#define I2C_PKTSIZE_PLDSIZE_Pos (0) /*!< I2C_T::PKTSIZE: PLDSIZE Position */ -#define I2C_PKTSIZE_PLDSIZE_Msk (0x1fful << I2C_PKTSIZE_PLDSIZE_Pos) /*!< I2C_T::PKTSIZE: PLDSIZE Mask */ - -#define I2C_PKTCRC_PECCRC_Pos (0) /*!< I2C_T::PKTCRC: PECCRC Position */ -#define I2C_PKTCRC_PECCRC_Msk (0xfful << I2C_PKTCRC_PECCRC_Pos) /*!< I2C_T::PKTCRC: PECCRC Mask */ - -#define I2C_BUSTOUT_BUSTO_Pos (0) /*!< I2C_T::BUSTOUT: BUSTO Position */ -#define I2C_BUSTOUT_BUSTO_Msk (0xfful << I2C_BUSTOUT_BUSTO_Pos) /*!< I2C_T::BUSTOUT: BUSTO Mask */ - -#define I2C_CLKTOUT_CLKTO_Pos (0) /*!< I2C_T::CLKTOUT: CLKTO Position */ -#define I2C_CLKTOUT_CLKTO_Msk (0xfful << I2C_CLKTOUT_CLKTO_Pos) /*!< I2C_T::CLKTOUT: CLKTO Mask */ - -/**@}*/ /* I2C_CONST */ -/**@}*/ /* end of I2C register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __I2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pdma_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pdma_reg.h deleted file mode 100644 index 3c51b398a46..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pdma_reg.h +++ /dev/null @@ -1,675 +0,0 @@ -/**************************************************************************//** - * @file pdma_reg.h - * @version V1.00 - * @brief PDMA register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __PDMA_REG_H__ -#define __PDMA_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup PDMA Peripheral Direct Memory Access Controller (PDMA) - Memory Mapped Structure for PDMA Controller -@{ */ - - -typedef struct -{ - - - /** - * @var DSCT_T::CTL - * Offset: 0x00 Descriptor Table Control Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE |PDMA Operation Mode Selection - * | | |00 = Idle state: Channel is stopped or this table is complete, when PDMA finish channel table task, OPMODE will be cleared to idle state automatically. - * | | |01 = Basic mode: The descriptor table only has one task. When this task is finished, the PDMA_INTSTS[1] will be asserted. - * | | |10 = Scatter-Gather mode: When operating in this mode, user must give the next descriptor table address in PDMA_DSCT_NEXT register; PDMA controller will ignore this task, then load the next task to execute. - * | | |11 = Reserved. - * | | |Note: Before filling new transfer task in the Descriptor Table, user must check the PDMA_INTSTS[1] to make sure the curren task is complete. - * |[2] |TXTYPE |Transfer Type - * | | |0 = Burst transfer type. - * | | |1 = Single transfer type. - * |[6:4] |BURSIZE |Burst Size - * | | |000 = 128 Transfers. - * | | |001 = 64 Transfers. - * | | |010 = 32 Transfers. - * | | |011 = 16 Transfers. - * | | |100 = 8 Transfers. - * | | |101 = 4 Transfers. - * | | |110 = 2 Transfers. - * | | |111 = 1 Transfers. - * | | |Note: This field is only useful in burst transfer type. - * |[7] |TBINTDIS |Table Interrupt Disable Bit - * | | |This field can be used to decide whether to enable table interrupt or not. - * | | |If the TBINTDIS bit is enabled it will not generates TDIFn(PDMA_TDSTS[8:0]) when PDMA controller finishes transfer task. - * | | |0 = Table interrupt Enabled. - * | | |1 = Table interrupt Disabled. - * | | |Note: This function only for scatter-gather mode. - * |[9:8] |SAINC |Source Address Increment - * | | |This field is used to set the source address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * | | |Note: This function do not support in memory to memory transfer type. - * |[11:10] |DAINC |Destination Address Increment - * | | |This field is used to set the destination address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * | | |Note: This function do not support in memory to memory transfer type. - * |[13:12] |TXWIDTH |Transfer Width Selection - * | | |This field is used for transfer width. - * | | |00 = One byte (8 bit) is transferred for every operation. - * | | |01= One half-word (16 bit) is transferred for every operation. - * | | |10 = One word (32-bit) is transferred for every operation. - * | | |11 = Reserved. - * | | |Note: The PDMA transfer source address (PDMA_DSCT_SA) and PDMA transfer destination address (PDMA_DSCT_DA) should be alignment under the TXWIDTH selection - * |[31:16] |TXCNT |Transfer Count - * | | |The TXCNT represents the required number of PDMA transfer, the real transfer count is (TXCNT + 1); The maximum transfer count is 65536, every transfer may be byte, half-word or word that is dependent on TXWIDTH field. - * | | |Note: When PDMA finish each transfer data, this field will be decrease immediately. - * @var DSCT_T::SA - * Offset: 0x04 Source Address Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SA |PDMA Transfer Source Address - * | | |This field indicates a 32-bit source address of PDMA controller. - * @var DSCT_T::DA - * Offset: 0x08 Destination Address Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DA |PDMA Transfer Destination Address - * | | |This field indicates a 32-bit destination address of PDMA controller. - * @var DSCT_T::NEXT - * Offset: 0x0C Next Scatter-gather Descriptor Table Offset Address of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |NEXT |PDMA Next Descriptor Table Offset - * | | |This field indicates the offset of the next descriptor table address in system memory. - * | | |Write Operation: - * | | |If the system memory based address is 0x2000_0000 (PDMA_SCATBA), and the next descriptor table is start from 0x2000_0100, then this field must fill in 0x0100. - * | | |Read Operation: - * | | |When operating in scatter-gather mode, the last two bits NEXT[1:0] will become reserved, and indicate the first next address of system memory. - * | | |Note1: The descriptor table address must be word boundary. - * | | |Note2: Before filled transfer task in the descriptor table, user must check if the descriptor table is complete. - * |[31:16] |EXENEXT |PDMA Execution Next Descriptor Table Offset - * | | |This field indicates the offset of next descriptor table address of current execution descriptor table in system memory. - * | | |Note: write operation is useless in this field. - */ - __IO uint32_t CTL; /*!< [0x0000] Descriptor Table Control Register of PDMA Channel n. */ - __IO uint32_t SA; /*!< [0x0004] Source Address Register of PDMA Channel n */ - __IO uint32_t DA; /*!< [0x0008] Destination Address Register of PDMA Channel n */ - __IO uint32_t NEXT; /*!< [0x000c] Next Scatter-Gather Descriptor Table Offset Address of PDMA Channel n */ - -} DSCT_T; - - -typedef struct -{ - - - /** - * @var PDMA_T::CURSCAT - * Offset: 0x100 Current Scatter-gather Descriptor Table Address of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURADDR |PDMA Current Description Address (Read Only) - * | | |This field indicates a 32-bit current external description address of PDMA controller. - * | | |Note: This field is read only and used for Scatter-Gather mode only to indicate the current external description address. - * @var PDMA_T::CHCTL - * Offset: 0x400 PDMA Channel Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |CHENn |PDMA Channel Enable Bits - * | | |Set this bit to 1 to enable PDMAn operation. Channel cannot be active if it is not set as enabled. - * | | |0 = PDMA channel [n] Disabled. - * | | |1 = PDMA channel [n] Enabled. - * | | |Note: Setting the corresponding bit of PDMA_PAUSE or PDMA_CHRST register will also clear this bit. - * @var PDMA_T::PAUSE - * Offset: 0x404 PDMA Transfer Pause Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |PAUSEn |PDMA Channel N Transfer Pause Control (Write Only) - * | | |User can set PAUSEn bit field to pause the PDMA transfer. - * | | |When user sets PAUSEn bit, the PDMA controller will pause the on-going transfer, then clear the channel enable bit CHEN(PDMA_CHCTL [n], n=0,1..8) and clear request active flag(PDMA_TRGSTS[n:0], n=0,1..8). - * | | |If the paused channel is re-enabled again, the remaining transfers will be processed. - * | | |0 = No effect. - * | | |1 = Pause PDMA channel n transfer. - * @var PDMA_T::SWREQ - * Offset: 0x408 PDMA Software Request Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |SWREQn |PDMA Software Request (Write Only) - * | | |Set this bit to 1 to generate a software request to PDMA [n]. - * | | |0 = No effect. - * | | |1 = Generate a software request. - * | | |Note1: User can read PDMA_TRGSTS register to know which channel is on active. - * | | |Active flag may be triggered by software request or peripheral request. - * | | |Note2: If user does not enable corresponding PDMA channel, the software request will be ignored. - * @var PDMA_T::TRGSTS - * Offset: 0x40C PDMA Channel Request Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |REQSTSn |PDMA Channel Request Status (Read Only) - * | | |This flag indicates whether channel[n] have a request or not, no matter request from software or peripheral. - * | | |When PDMA controller finishes channel transfer, this bit will be cleared automatically. - * | | |0 = PDMA Channel n has no request. - * | | |1 = PDMA Channel n has a request. - * | | |Note: If user pauses or resets each PDMA transfer by setting PDMA_PAUSE or PDMA_CHRST register respectively, this bit will be cleared automatically after finishing the current transfer. - * @var PDMA_T::PRISET - * Offset: 0x410 PDMA Fixed Priority Setting Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |FPRISETn |PDMA Fixed Priority Setting - * | | |Set this bit to 1 to enable fixed priority level. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set PDMA channel [n] to fixed priority channel. - * | | |Read Operation: - * | | |0 = Corresponding PDMA channel is round-robin priority. - * | | |1 = Corresponding PDMA channel is fixed priority. - * | | |Note: This field only set to fixed priority, clear fixed priority use PDMA_PRICLR register. - * @var PDMA_T::PRICLR - * Offset: 0x414 PDMA Fixed Priority Clear Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |FPRICLRn |PDMA Fixed Priority Clear Bits (Write Only) - * | | |Set this bit to 1 to clear fixed priority level. - * | | |0 = No effect. - * | | |1 = Clear PDMA channel [n] fixed priority setting. - * | | |Note: User can read PDMA_PRISET register to know the channel priority. - * @var PDMA_T::INTEN - * Offset: 0x418 PDMA Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |INTENn |PDMA Interrupt Enable Bits - * | | |This field is used to enable PDMA channel[n] interrupt. - * | | |0 = PDMA channel n interrupt Disabled. - * | | |1 = PDMA channel n interrupt Enabled. - * @var PDMA_T::INTSTS - * Offset: 0x41C PDMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABTIF |PDMA Read/Write Target Abort Interrupt Flag (Read Only) - * | | |This bit indicates that PDMA has target abort error; Software can read PDMA_ABTSTS register to find which channel has target abort error. - * | | |0 = No AHB bus ERROR response received. - * | | |1 = AHB bus ERROR response received. - * |[1] |TDIF |Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that PDMA controller has finished transmission; User can read PDMA_TDSTS register to indicate which channel finished transfer. - * | | |0 = Not finished yet. - * | | |1 = PDMA channel has finished transmission. - * |[2] |ALIGNF |Transfer Alignment Interrupt Flag (Read Only) - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * |[8] |REQTOF0 |Request Time-out Flag for Channel 0 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC0, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * |[9] |REQTOF1 |Request Time-out Flag for Channel 1 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC1, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * @var PDMA_T::ABTSTS - * Offset: 0x420 PDMA Channel Read/Write Target Abort Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |ABTIFn |PDMA Read/Write Target Abort Interrupt Status Flag - * | | |This bit indicates which PDMA controller has target abort error; User can write 1 to clear these bits. - * | | |0 = No AHB bus ERROR response received when channel n transfer. - * | | |1 = AHB bus ERROR response received when channel n transfer. - * @var PDMA_T::TDSTS - * Offset: 0x424 PDMA Channel Transfer Done Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |TDIFn |Transfer Done Flag - * | | |This bit indicates whether PDMA controller channel transfer has been finished or not, user can write 1 to clear these bits. - * | | |0 = PDMA channel transfer has not finished. - * | | |1 = PDMA channel has finished transmission. - * @var PDMA_T::ALIGN - * Offset: 0x428 PDMA Transfer Alignment Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |ALIGNn |Transfer Alignment Flag - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * @var PDMA_T::TACTSTS - * Offset: 0x42C PDMA Transfer Active Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |TXACTFn |Transfer on Active Flag (Read Only) - * | | |This bit indicates which PDMA channel is in active. - * | | |0 = PDMA channel is not finished. - * | | |1 = PDMA channel is active. - * @var PDMA_T::TOUTPSC - * Offset: 0x430 PDMA Time-out Prescaler Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TOUTPSC0 |PDMA Channel 0 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 0 time-out clock source is HCLK/2^8. - * | | |001 = PDMA channel 0 time-out clock source is HCLK/2^9. - * | | |010 = PDMA channel 0 time-out clock source is HCLK/2^10. - * | | |011 = PDMA channel 0 time-out clock source is HCLK/2^11. - * | | |100 = PDMA channel 0 time-out clock source is HCLK/2^12. - * | | |101 = PDMA channel 0 time-out clock source is HCLK/2^13. - * | | |110 = PDMA channel 0 time-out clock source is HCLK/2^14. - * | | |111 = PDMA channel 0 time-out clock source is HCLK/2^15. - * |[6:4] |TOUTPSC1 |PDMA Channel 1 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 1 time-out clock source is HCLK/2^8. - * | | |001 = PDMA channel 1 time-out clock source is HCLK/2^9. - * | | |010 = PDMA channel 1 time-out clock source is HCLK/2^10. - * | | |011 = PDMA channel 1 time-out clock source is HCLK/2^11. - * | | |100 = PDMA channel 1 time-out clock source is HCLK/2^12. - * | | |101 = PDMA channel 1 time-out clock source is HCLK/2^13. - * | | |110 = PDMA channel 1 time-out clock source is HCLK/2^14. - * | | |111 = PDMA channel 1 time-out clock source is HCLK/2^15. - * @var PDMA_T::TOUTEN - * Offset: 0x434 PDMA Time-out Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TOUTENn |PDMA Time-out Enable Bits - * | | |0 = PDMA Channel n time-out function Disabled. - * | | |1 = PDMA Channel n time-out function Enabled. - * @var PDMA_T::TOUTIEN - * Offset: 0x438 PDMA Time-out Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TOUTIENn |PDMA Time-out Interrupt Enable Bits - * | | |0 = PDMA Channel n time-out interrupt Disabled. - * | | |1 = PDMA Channel n time-out interrupt Enabled. - * @var PDMA_T::SCATBA - * Offset: 0x43C PDMA Scatter-gather Descriptor Table Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |SCATBA |PDMA Scatter-gather Descriptor Table Address - * | | |In Scatter-Gather mode, this is the base address for calculating the next link - list address. - * | | |The next link address equation is - * | | |Next Link Address = PDMA_SCATBA + PDMA_DSCT_NEXT. - * | | |Note: Only useful in Scatter-Gather mode. - * @var PDMA_T::TOC0_1 - * Offset: 0x440 PDMA Time-out Counter Ch1 and Ch0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TOC0 |Time-out Counter for Channel 0 - * | | |This controls the period of time-out function for channel 0. - * | | |The calculation unit is based on TOUTPSC0 (PDMA_TOUTPSC[2:0]) clock. - * | | |Time-out period = (Period of time-out clock) * (16-bit TOCn), n = 0,1. - * |[31:16] |TOC1 |Time-out Counter for Channel 1 - * | | |This controls the period of time-out function for channel 1. - * | | |The calculation unit is based on TOUTPSC1 (PDMA_TOUTPSC[6:4]) clock. - * | | |The example of time-out period can refer TOC0 bit description. - * @var PDMA_T::CHRST - * Offset: 0x460 PDMA Channel Reset Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |CHnRST |Channel N Reset - * | | |0 = corresponding channel n is not reset. - * | | |1 = corresponding channel n is reset. - * @var PDMA_T::REQSEL0_3 - * Offset: 0x480 PDMA Request Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |REQSRC0 |Channel 0 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 0. - * | | |User can configure the peripheral by setting REQSRC0. - * | | |0 = Disable PDMA peripheral request. - * | | |1 = reserved. - * | | |2 = reserved. - * | | |3 = reserved. - * | | |4 = Channel connects to UART0_TX. - * | | |5 = Channel connects to UART0_RX. - * | | |6 = Channel connects to UART1_TX. - * | | |7 = Channel connects to UART1_RX. - * | | |8 = Channel connects to UART2_TX. - * | | |9 = Channel connects to UART2_RX. - * | | |10 = Channel connects to USCI0_TX. - * | | |11 = Channel connects to USCI0_RX. - * | | |12 = Channel connects to USCI1_TX. - * | | |13 = Channel connects to USCI1_RX. - * | | |14 = Reserved. - * | | |15 = Reserved. - * | | |16 = Channel connects to QSPI0_TX. - * | | |17 = Channel connects to QSPI0_RX. - * | | |18 = Channel connects to SPI0_TX. - * | | |19 = Channel connects to SPI0_RX. - * | | |20 = Channel connects to ADC_RX. - * | | |21 = Channel connects to PWM0_P1_RX. - * | | |22 = Channel connects to PWM0_P2_RX. - * | | |23 = Channel connects to PWM0_P3_RX. - * | | |24 = Channel connects to PWM1_P1_RX. - * | | |25 = Channel connects to PWM1_P2_RX. - * | | |26 = Channel connects to PWM1_P3_RX. - * | | |27 = Reserved. - * | | |28 = Channel connects to I2C0_TX. - * | | |29 = Channel connects to I2C0_RX. - * | | |30 = Channel connects to I2C1_TX. - * | | |31 = Channel connects to I2C1_RX. - * | | |32 = Channel connects to TMR0. - * | | |33 = Channel connects to TMR1. - * | | |34 = Channel connects to TMR2. - * | | |35 = Channel connects to TMR3. - * | | |36 = Channel connects to UART3_TX. - * | | |37 = Channel connects to UART3_RX. - * | | |38 = Channel connects to UART4_TX. - * | | |39 = Channel connects to UART4_RX. - * | | |40 = Channel connects to UART5_TX. - * | | |41 = Channel connects to UART5_RX. - * | | |42 = Channel connects to UART6_TX. - * | | |43 = Channel connects to UART6_RX. - * | | |44 = Channel connects to UART7_TX. - * | | |45 = Channel connects to UART7_RX. - * | | |Others = Reserved. - * | | |Note 1: A peripheral cannot be assigned to two channels at the same time. - * | | |Note 2: This field is useless when transfer between memory and memory. - * |[13:8] |REQSRC1 |Channel 1 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 1. - * | | |User can configure the peripheral setting by REQSRC1. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - * |[21:16] |REQSRC2 |Channel 2 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 2. - * | | |User can configure the peripheral setting by REQSRC2. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - * |[29:24] |REQSRC3 |Channel 3 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 3. - * | | |User can configure the peripheral setting by REQSRC3. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL4_7 - * Offset: 0x484 PDMA Request Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |REQSRC4 |Channel 4 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 4. - * | | |User can configure the peripheral setting by REQSRC4. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - * |[13:8] |REQSRC5 |Channel 5 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 5. - * | | |User can configure the peripheral setting by REQSRC5. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - * |[21:16] |REQSRC6 |Channel 6 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 6. - * | | |User can configure the peripheral setting by REQSRC6. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - * |[29:24] |REQSRC7 |Channel 7 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 7. - * | | |User can configure the peripheral setting by REQSRC7. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL8 - * Offset: 0x488 PDMA Request Source Select Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |REQSRC8 |Channel 8 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 8. - * | | |User can configure the peripheral setting by REQSRC8. - * | | |Note: The channel configuration is the same as REQSRC0 field. - * | | |Please refer to the explanation of REQSRC0. - */ - DSCT_T DSCT[9]; /*!< [0x0000 ~ 0x008C] Control Register of PDMA Channel 0 ~ 8 */ - __I uint32_t RESERVE0[28]; - __I uint32_t CURSCAT[9]; /*!< [0x0100 ~ 0x110] Current Scatter-gather Descriptor Table Address of PDMA Channel n */ - __I uint32_t RESERVE1[183]; - __IO uint32_t CHCTL; /*!< [0x0400] PDMA Channel Control Register */ - __O uint32_t PAUSE; /*!< [0x0404] PDMA Transfer Pause Control Register */ - __O uint32_t SWREQ; /*!< [0x0408] PDMA Software Request Register */ - __I uint32_t TRGSTS; /*!< [0x040c] PDMA Channel Request Status Register */ - __IO uint32_t PRISET; /*!< [0x0410] PDMA Fixed Priority Setting Register */ - __O uint32_t PRICLR; /*!< [0x0414] PDMA Fixed Priority Clear Register */ - __IO uint32_t INTEN; /*!< [0x0418] PDMA Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x041c] PDMA Interrupt Status Register */ - __IO uint32_t ABTSTS; /*!< [0x0420] PDMA Channel Read/Write Target Abort Flag Register */ - __IO uint32_t TDSTS; /*!< [0x0424] PDMA Channel Transfer Done Flag Register */ - __IO uint32_t ALIGN; /*!< [0x0428] PDMA Transfer Alignment Status Register */ - __I uint32_t TACTSTS; /*!< [0x042c] PDMA Transfer Active Flag Register */ - __IO uint32_t TOUTPSC; /*!< [0x0430] PDMA Time-out Prescaler Register */ - __IO uint32_t TOUTEN; /*!< [0x0434] PDMA Time-out Enable Register */ - __IO uint32_t TOUTIEN; /*!< [0x0438] PDMA Time-out Interrupt Enable Register */ - __IO uint32_t SCATBA; /*!< [0x043c] PDMA Scatter-gather Descriptor Table Base Address Register */ - __IO uint32_t TOC0_1; /*!< [0x0440] PDMA Time-out Counter Ch1 and Ch0 Register */ - __I uint32_t RESERVE2[7]; - __IO uint32_t CHRST; /*!< [0x0460] PDMA Channel Reset Register */ - __I uint32_t RESERVE3[7]; - __IO uint32_t REQSEL0_3; /*!< [0x0480] PDMA Request Source Select Register 0 */ - __IO uint32_t REQSEL4_7; /*!< [0x0484] PDMA Request Source Select Register 1 */ - __IO uint32_t REQSEL8; /*!< [0x0488] PDMA Request Source Select Register 2 */ -} PDMA_T; - -/** - @addtogroup PDMA_CONST PDMA Bit Field Definition - Constant Definitions for PDMA Controller -@{ */ - -#define PDMA_DSCT_CTL_OPMODE_Pos (0) /*!< DSCT_T::CTL: OPMODE Position */ -#define PDMA_DSCT_CTL_OPMODE_Msk (0x3ul << PDMA_DSCT_CTL_OPMODE_Pos) /*!< DSCT_T::CTL: OPMODE Mask */ - -#define PDMA_DSCT_CTL_TXTYPE_Pos (2) /*!< DSCT_T::CTL: TXTYPE Position */ -#define PDMA_DSCT_CTL_TXTYPE_Msk (0x1ul << PDMA_DSCT_CTL_TXTYPE_Pos) /*!< DSCT_T::CTL: TXTYPE Mask */ - -#define PDMA_DSCT_CTL_BURSIZE_Pos (4) /*!< DSCT_T::CTL: BURSIZE Position */ -#define PDMA_DSCT_CTL_BURSIZE_Msk (0x7ul << PDMA_DSCT_CTL_BURSIZE_Pos) /*!< DSCT_T::CTL: BURSIZE Mask */ - -#define PDMA_DSCT_CTL_TBINTDIS_Pos (7) /*!< DSCT_T::CTL: TBINTDIS Position */ -#define PDMA_DSCT_CTL_TBINTDIS_Msk (0x1ul << PDMA_DSCT_CTL_TBINTDIS_Pos) /*!< DSCT_T::CTL: TBINTDIS Mask */ - -#define PDMA_DSCT_CTL_SAINC_Pos (8) /*!< DSCT_T::CTL: SAINC Position */ -#define PDMA_DSCT_CTL_SAINC_Msk (0x3ul << PDMA_DSCT_CTL_SAINC_Pos) /*!< DSCT_T::CTL: SAINC Mask */ - -#define PDMA_DSCT_CTL_DAINC_Pos (10) /*!< DSCT_T::CTL: DAINC Position */ -#define PDMA_DSCT_CTL_DAINC_Msk (0x3ul << PDMA_DSCT_CTL_DAINC_Pos) /*!< DSCT_T::CTL: DAINC Mask */ - -#define PDMA_DSCT_CTL_TXWIDTH_Pos (12) /*!< DSCT_T::CTL: TXWIDTH Position */ -#define PDMA_DSCT_CTL_TXWIDTH_Msk (0x3ul << PDMA_DSCT_CTL_TXWIDTH_Pos) /*!< DSCT_T::CTL: TXWIDTH Mask */ - -#define PDMA_DSCT_CTL_TXCNT_Pos (16) /*!< DSCT_T::CTL: TXCNT Position */ -#define PDMA_DSCT_CTL_TXCNT_Msk (0xfffful << PDMA_DSCT_CTL_TXCNT_Pos) /*!< DSCT_T::CTL: TXCNT Mask */ - -#define PDMA_DSCT_SA_SA_Pos (0) /*!< DSCT_T::SA: SA Position */ -#define PDMA_DSCT_SA_SA_Msk (0xfffffffful << PDMA_DSCT_SA_SA_Pos) /*!< DSCT_T::SA: SA Mask */ - -#define PDMA_DSCT_DA_DA_Pos (0) /*!< DSCT_T::DA: DA Position */ -#define PDMA_DSCT_DA_DA_Msk (0xfffffffful << PDMA_DSCT_DA_DA_Pos) /*!< DSCT_T::DA: DA Mask */ - -#define PDMA_DSCT_NEXT_NEXT_Pos (0) /*!< DSCT_T::NEXT: NEXT Position */ -#define PDMA_DSCT_NEXT_NEXT_Msk (0xfffful << PDMA_DSCT_NEXT_NEXT_Pos) /*!< DSCT_T::NEXT: NEXT Mask */ - -#define PDMA_DSCT_NEXT_EXENEXT_Pos (16) /*!< DSCT_T::NEXT: EXENEXT Position */ -#define PDMA_DSCT_NEXT_EXENEXT_Msk (0xfffful << PDMA_DSCT_NEXT_EXENEXT_Pos) /*!< DSCT_T::NEXT: EXENEXT Mask */ - -#define PDMA_CURSCAT_CURADDR_Pos (0) /*!< PDMA_T::CURSCAT: CURADDR Position */ -#define PDMA_CURSCAT_CURADDR_Msk (0xfffffffful << PDMA_CURSCAT_CURADDR_Pos) /*!< PDMA_T::CURSCAT: CURADDR Mask */ - -#define PDMA_CHCTL_CHENn_Pos (0) /*!< PDMA_T::CHCTL: CHENn Position */ -#define PDMA_CHCTL_CHENn_Msk (0x1fful << PDMA_CHCTL_CHENn_Pos) /*!< PDMA_T::CHCTL: CHENn Mask */ - -#define PDMA_PAUSE_PAUSEn_Pos (0) /*!< PDMA_T::PAUSE: PAUSEn Position */ -#define PDMA_PAUSE_PAUSEn_Msk (0x1fful << PDMA_PAUSE_PAUSEn_Pos) /*!< PDMA_T::PAUSE: PAUSEn Mask */ - -#define PDMA_SWREQ_SWREQn_Pos (0) /*!< PDMA_T::SWREQ: SWREQn Position */ -#define PDMA_SWREQ_SWREQn_Msk (0x1fful << PDMA_SWREQ_SWREQn_Pos) /*!< PDMA_T::SWREQ: SWREQn Mask */ - -#define PDMA_TRGSTS_REQSTSn_Pos (0) /*!< PDMA_T::TRGSTS: REQSTSn Position */ -#define PDMA_TRGSTS_REQSTSn_Msk (0x1fful << PDMA_TRGSTS_REQSTSn_Pos) /*!< PDMA_T::TRGSTS: REQSTSn Mask */ - -#define PDMA_PRISET_FPRISETn_Pos (0) /*!< PDMA_T::PRISET: FPRISETn Position */ -#define PDMA_PRISET_FPRISETn_Msk (0x1fful << PDMA_PRISET_FPRISETn_Pos) /*!< PDMA_T::PRISET: FPRISETn Mask */ - -#define PDMA_PRICLR_FPRICLRn_Pos (0) /*!< PDMA_T::PRICLR: FPRICLRn Position */ -#define PDMA_PRICLR_FPRICLRn_Msk (0x1fful << PDMA_PRICLR_FPRICLRn_Pos) /*!< PDMA_T::PRICLR: FPRICLRn Mask */ - -#define PDMA_INTEN_INTENn_Pos (0) /*!< PDMA_T::INTEN: INTENn Position */ -#define PDMA_INTEN_INTENn_Msk (0x1fful << PDMA_INTEN_INTENn_Pos) /*!< PDMA_T::INTEN: INTENn Mask */ - -#define PDMA_INTSTS_ABTIF_Pos (0) /*!< PDMA_T::INTSTS: ABTIF Position */ -#define PDMA_INTSTS_ABTIF_Msk (0x1ul << PDMA_INTSTS_ABTIF_Pos) /*!< PDMA_T::INTSTS: ABTIF Mask */ - -#define PDMA_INTSTS_TDIF_Pos (1) /*!< PDMA_T::INTSTS: TDIF Position */ -#define PDMA_INTSTS_TDIF_Msk (0x1ul << PDMA_INTSTS_TDIF_Pos) /*!< PDMA_T::INTSTS: TDIF Mask */ - -#define PDMA_INTSTS_ALIGNF_Pos (2) /*!< PDMA_T::INTSTS: ALIGNF Position */ -#define PDMA_INTSTS_ALIGNF_Msk (0x1ul << PDMA_INTSTS_ALIGNF_Pos) /*!< PDMA_T::INTSTS: ALIGNF Mask */ - -#define PDMA_INTSTS_REQTOF0_Pos (8) /*!< PDMA_T::INTSTS: REQTOF0 Position */ -#define PDMA_INTSTS_REQTOF0_Msk (0x1ul << PDMA_INTSTS_REQTOF0_Pos) /*!< PDMA_T::INTSTS: REQTOF0 Mask */ - -#define PDMA_INTSTS_REQTOF1_Pos (9) /*!< PDMA_T::INTSTS: REQTOF1 Position */ -#define PDMA_INTSTS_REQTOF1_Msk (0x1ul << PDMA_INTSTS_REQTOF1_Pos) /*!< PDMA_T::INTSTS: REQTOF1 Mask */ - -#define PDMA_ABTSTS_ABTIF0_Pos (0) /*!< PDMA_T::ABTSTS: ABTIF0 Position */ -#define PDMA_ABTSTS_ABTIF0_Msk (0x1ul << PDMA_ABTSTS_ABTIF0_Pos) /*!< PDMA_T::ABTSTS: ABTIF0 Mask */ - -#define PDMA_ABTSTS_ABTIF1_Pos (1) /*!< PDMA_T::ABTSTS: ABTIF1 Position */ -#define PDMA_ABTSTS_ABTIF1_Msk (0x1ul << PDMA_ABTSTS_ABTIF1_Pos) /*!< PDMA_T::ABTSTS: ABTIF1 Mask */ - -#define PDMA_ABTSTS_ABTIF2_Pos (2) /*!< PDMA_T::ABTSTS: ABTIF2 Position */ -#define PDMA_ABTSTS_ABTIF2_Msk (0x1ul << PDMA_ABTSTS_ABTIF2_Pos) /*!< PDMA_T::ABTSTS: ABTIF2 Mask */ - -#define PDMA_ABTSTS_ABTIF3_Pos (3) /*!< PDMA_T::ABTSTS: ABTIF3 Position */ -#define PDMA_ABTSTS_ABTIF3_Msk (0x1ul << PDMA_ABTSTS_ABTIF3_Pos) /*!< PDMA_T::ABTSTS: ABTIF3 Mask */ - -#define PDMA_ABTSTS_ABTIF4_Pos (4) /*!< PDMA_T::ABTSTS: ABTIF4 Position */ -#define PDMA_ABTSTS_ABTIF4_Msk (0x1ul << PDMA_ABTSTS_ABTIF4_Pos) /*!< PDMA_T::ABTSTS: ABTIF4 Mask */ - -#define PDMA_ABTSTS_ABTIF5_Pos (5) /*!< PDMA_T::ABTSTS: ABTIF5 Position */ -#define PDMA_ABTSTS_ABTIF5_Msk (0x1ul << PDMA_ABTSTS_ABTIF5_Pos) /*!< PDMA_T::ABTSTS: ABTIF5 Mask */ - -#define PDMA_ABTSTS_ABTIF6_Pos (6) /*!< PDMA_T::ABTSTS: ABTIF6 Position */ -#define PDMA_ABTSTS_ABTIF6_Msk (0x1ul << PDMA_ABTSTS_ABTIF6_Pos) /*!< PDMA_T::ABTSTS: ABTIF6 Mask */ - -#define PDMA_ABTSTS_ABTIF7_Pos (7) /*!< PDMA_T::ABTSTS: ABTIF7 Position */ -#define PDMA_ABTSTS_ABTIF7_Msk (0x1ul << PDMA_ABTSTS_ABTIF7_Pos) /*!< PDMA_T::ABTSTS: ABTIF7 Mask */ - -#define PDMA_ABTSTS_ABTIF8_Pos (8) /*!< PDMA_T::ABTSTS: ABTIF8 Position */ -#define PDMA_ABTSTS_ABTIF8_Msk (0x1ul << PDMA_ABTSTS_ABTIF8_Pos) /*!< PDMA_T::ABTSTS: ABTIF8 Mask */ - -#define PDMA_TDSTS_TDIF0_Pos (0) /*!< PDMA_T::TDSTS: TDIF0 Position */ -#define PDMA_TDSTS_TDIF0_Msk (0x1ul << PDMA_TDSTS_TDIF0_Pos) /*!< PDMA_T::TDSTS: TDIF0 Mask */ - -#define PDMA_TDSTS_TDIF1_Pos (1) /*!< PDMA_T::TDSTS: TDIF1 Position */ -#define PDMA_TDSTS_TDIF1_Msk (0x1ul << PDMA_TDSTS_TDIF1_Pos) /*!< PDMA_T::TDSTS: TDIF1 Mask */ - -#define PDMA_TDSTS_TDIF2_Pos (2) /*!< PDMA_T::TDSTS: TDIF2 Position */ -#define PDMA_TDSTS_TDIF2_Msk (0x1ul << PDMA_TDSTS_TDIF2_Pos) /*!< PDMA_T::TDSTS: TDIF2 Mask */ - -#define PDMA_TDSTS_TDIF3_Pos (3) /*!< PDMA_T::TDSTS: TDIF3 Position */ -#define PDMA_TDSTS_TDIF3_Msk (0x1ul << PDMA_TDSTS_TDIF3_Pos) /*!< PDMA_T::TDSTS: TDIF3 Mask */ - -#define PDMA_TDSTS_TDIF4_Pos (4) /*!< PDMA_T::TDSTS: TDIF4 Position */ -#define PDMA_TDSTS_TDIF4_Msk (0x1ul << PDMA_TDSTS_TDIF4_Pos) /*!< PDMA_T::TDSTS: TDIF4 Mask */ - -#define PDMA_TDSTS_TDIF5_Pos (5) /*!< PDMA_T::TDSTS: TDIF5 Position */ -#define PDMA_TDSTS_TDIF5_Msk (0x1ul << PDMA_TDSTS_TDIF5_Pos) /*!< PDMA_T::TDSTS: TDIF5 Mask */ - -#define PDMA_TDSTS_TDIF6_Pos (6) /*!< PDMA_T::TDSTS: TDIF6 Position */ -#define PDMA_TDSTS_TDIF6_Msk (0x1ul << PDMA_TDSTS_TDIF6_Pos) /*!< PDMA_T::TDSTS: TDIF6 Mask */ - -#define PDMA_TDSTS_TDIF7_Pos (7) /*!< PDMA_T::TDSTS: TDIF7 Position */ -#define PDMA_TDSTS_TDIF7_Msk (0x1ul << PDMA_TDSTS_TDIF7_Pos) /*!< PDMA_T::TDSTS: TDIF7 Mask */ - -#define PDMA_TDSTS_TDIF8_Pos (8) /*!< PDMA_T::TDSTS: TDIF8 Position */ -#define PDMA_TDSTS_TDIF8_Msk (0x1ul << PDMA_TDSTS_TDIF8_Pos) /*!< PDMA_T::TDSTS: TDIF8 Mask */ - -#define PDMA_ALIGN_ALIGNn_Pos (0) /*!< PDMA_T::ALIGN: ALIGNn Position */ -#define PDMA_ALIGN_ALIGNn_Msk (0x1fful << PDMA_ALIGN_ALIGNn_Pos) /*!< PDMA_T::ALIGN: ALIGNn Mask */ - -#define PDMA_TACTSTS_TXACTFn_Pos (0) /*!< PDMA_T::TACTSTS: TXACTFn Position */ -#define PDMA_TACTSTS_TXACTFn_Msk (0x1fful << PDMA_TACTSTS_TXACTFn_Pos) /*!< PDMA_T::TACTSTS: TXACTFn Mask */ - -#define PDMA_TOUTPSC_TOUTPSC0_Pos (0) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Position */ -#define PDMA_TOUTPSC_TOUTPSC0_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC0_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Mask */ - -#define PDMA_TOUTPSC_TOUTPSC1_Pos (4) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Position */ -#define PDMA_TOUTPSC_TOUTPSC1_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC1_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Mask */ - -#define PDMA_TOUTEN_TOUTENn_Pos (0) /*!< PDMA_T::TOUTEN: TOUTENn Position */ -#define PDMA_TOUTEN_TOUTENn_Msk (0x3ul << PDMA_TOUTEN_TOUTENn_Pos) /*!< PDMA_T::TOUTEN: TOUTENn Mask */ - -#define PDMA_TOUTIEN_TOUTIENn_Pos (0) /*!< PDMA_T::TOUTIEN: TOUTIENn Position */ -#define PDMA_TOUTIEN_TOUTIENn_Msk (0x3ul << PDMA_TOUTIEN_TOUTIENn_Pos) /*!< PDMA_T::TOUTIEN: TOUTIENn Mask */ - -#define PDMA_SCATBA_SCATBA_Pos (16) /*!< PDMA_T::SCATBA: SCATBA Position */ -#define PDMA_SCATBA_SCATBA_Msk (0xfffful << PDMA_SCATBA_SCATBA_Pos) /*!< PDMA_T::SCATBA: SCATBA Mask */ - -#define PDMA_TOC0_1_TOC0_Pos (0) /*!< PDMA_T::TOC0_1: TOC0 Position */ -#define PDMA_TOC0_1_TOC0_Msk (0xfffful << PDMA_TOC0_1_TOC0_Pos) /*!< PDMA_T::TOC0_1: TOC0 Mask */ - -#define PDMA_TOC0_1_TOC1_Pos (16) /*!< PDMA_T::TOC0_1: TOC1 Position */ -#define PDMA_TOC0_1_TOC1_Msk (0xfffful << PDMA_TOC0_1_TOC1_Pos) /*!< PDMA_T::TOC0_1: TOC1 Mask */ - -#define PDMA_CHRST_CHnRST_Pos (0) /*!< PDMA_T::CHRST: CHnRST Position */ -#define PDMA_CHRST_CHnRST_Msk (0x1fful << PDMA_CHRST_CHnRST_Pos) /*!< PDMA_T::CHRST: CHnRST Mask */ - -#define PDMA_REQSEL0_3_REQSRC0_Pos (0) /*!< PDMA_T::REQSEL0_3: REQSRC0 Position */ -#define PDMA_REQSEL0_3_REQSRC0_Msk (0x3ful << PDMA_REQSEL0_3_REQSRC0_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC0 Mask */ - -#define PDMA_REQSEL0_3_REQSRC1_Pos (8) /*!< PDMA_T::REQSEL0_3: REQSRC1 Position */ -#define PDMA_REQSEL0_3_REQSRC1_Msk (0x3ful << PDMA_REQSEL0_3_REQSRC1_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC1 Mask */ - -#define PDMA_REQSEL0_3_REQSRC2_Pos (16) /*!< PDMA_T::REQSEL0_3: REQSRC2 Position */ -#define PDMA_REQSEL0_3_REQSRC2_Msk (0x3ful << PDMA_REQSEL0_3_REQSRC2_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC2 Mask */ - -#define PDMA_REQSEL0_3_REQSRC3_Pos (24) /*!< PDMA_T::REQSEL0_3: REQSRC3 Position */ -#define PDMA_REQSEL0_3_REQSRC3_Msk (0x3ful << PDMA_REQSEL0_3_REQSRC3_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC3 Mask */ - -#define PDMA_REQSEL4_7_REQSRC4_Pos (0) /*!< PDMA_T::REQSEL4_7: REQSRC4 Position */ -#define PDMA_REQSEL4_7_REQSRC4_Msk (0x3ful << PDMA_REQSEL4_7_REQSRC4_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC4 Mask */ - -#define PDMA_REQSEL4_7_REQSRC5_Pos (8) /*!< PDMA_T::REQSEL4_7: REQSRC5 Position */ -#define PDMA_REQSEL4_7_REQSRC5_Msk (0x3ful << PDMA_REQSEL4_7_REQSRC5_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC5 Mask */ - -#define PDMA_REQSEL4_7_REQSRC6_Pos (16) /*!< PDMA_T::REQSEL4_7: REQSRC6 Position */ -#define PDMA_REQSEL4_7_REQSRC6_Msk (0x3ful << PDMA_REQSEL4_7_REQSRC6_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC6 Mask */ - -#define PDMA_REQSEL4_7_REQSRC7_Pos (24) /*!< PDMA_T::REQSEL4_7: REQSRC7 Position */ -#define PDMA_REQSEL4_7_REQSRC7_Msk (0x3ful << PDMA_REQSEL4_7_REQSRC7_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC7 Mask */ - -#define PDMA_REQSEL8_REQSRC8_Pos (0) /*!< PDMA_T::REQSEL8: REQSRC8 Position */ -#define PDMA_REQSEL8_REQSRC8_Msk (0x3ful << PDMA_REQSEL8_REQSRC8_Pos) /*!< PDMA_T::REQSEL8: REQSRC8 Mask */ -/**@}*/ /* PDMA_CONST */ -/**@}*/ /* end of PDMA register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __PDMA_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pwm_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pwm_reg.h deleted file mode 100644 index 04d49de17b9..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/pwm_reg.h +++ /dev/null @@ -1,2294 +0,0 @@ -/**************************************************************************//** - * @file pwm_reg.h - * @version V1.00 - * @brief PWM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __PWM_REG_H__ -#define __PWM_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup PWM Pulse Width Modulation Controller (PWM) - Memory Mapped Structure for PWM Controller -@{ */ - -typedef struct -{ - /** - * @var PWM_T::CTL0 - * Offset: 0x00 PWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLDn |Center Load Enable Bits - * | | |0 = Center Loading mode is disable for corresponding PWM channel n - * | | |1 = Center Loading mode is enable for corresponding PWM channel n - * | | |Each bit n controls the corresponding PWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period. - * | | |CMPDAT will load to CMPBUF at the center point of a period. - * |[16] |IMMLDENn |Immediately Load Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period. - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, PWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt disable. - * | | |1 = ICE debug mode counter halt enable. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable (Write Protect) - * | | |0 = ICE debug mode acknowledgement affects PWM output. - * | | |PWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |PWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * @var PWM_T::CTL1 - * Offset: 0x04 PWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |PWM Counter Behavior Type 0 - * | | |The two bits control channel 1 and channel 0. - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[5:4] |CNTTYPE2 |PWM Counter Behavior Type 2 - * | | |The two bits control channel 3 and channel 2. - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[9:8] |CNTTYPE4 |PWM Counter Behavior Type 4 - * | | |The two bits control channel 5 and channel 4. - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[26:24] |PWMMODEn |PWM Mode - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = PWM independent mode. - * | | |1 = PWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * @var PWM_T::CLKSRC - * Offset: 0x10 PWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |PWM_CH01 External Clock Source Select - * | | |000 = PWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[10:8] |ECLKSRC2 |PWM_CH23 External Clock Source Select - * | | |000 = PWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[18:16] |ECLKSRC4 |PWM_CH45 External Clock Source Select - * | | |000 = PWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var PWM_T::CLKPSC[3] - * Offset: 0x14 PWM Clock Prescale Register 0/1, 2/3, 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |PWM Counter Clock Prescale - * | | |The clock of PWM counter is decided by clock prescaler. - * | | |Each PWM pair share one PWM counter clock prescaler. - * | | |The clock of PWM counter is divided by (CLKPSC+1). - * @var PWM_T::CNTEN - * Offset: 0x20 PWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |PWM Counter Enable 0 - * | | |0 = PWM Counter and clock prescaler Stop Running. - * | | |1 = PWM Counter and clock prescaler Start Running. - * |[2] |CNTEN2 |PWM Counter Enable 2 - * | | |0 = PWM Counter and clock prescaler Stop Running. - * | | |1 = PWM Counter and clock prescaler Start Running. - * |[4] |CNTEN4 |PWM Counter Enable 4 - * | | |0 = PWM Counter and clock prescaler Stop Running. - * | | |1 = PWM Counter and clock prescaler Start Running. - * @var PWM_T::CNTCLR - * Offset: 0x24 PWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear PWM Counter Control Bit 0 - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit PWM counter to 0000H. - * |[2] |CNTCLR2 |Clear PWM Counter Control Bit 2 - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit PWM counter to 0000H. - * |[4] |CNTCLR4 |Clear PWM Counter Control Bit 4 - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit PWM counter to 0000H. - * @var PWM_T::PERIOD - * Offset: 0x30~0x44 PWM Period Register 0/2/4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |PWM Period Register - * | | |Up-Count mode: In this mode, PWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |Down-Count mode: In this mode, PWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |PWM period time = (PERIOD+1) * PWM_CLK period. - * | | |Up-Down-Count mode: In this mode, PWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |PWM period time = 2 * PERIOD * PWM_CLK period. - * @var PWM_T::CMPDAT - * Offset: 0x50~0x64 PWM Comparator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |PWM Comparator Register - * | | |CMP use to compare with CNT to generate PWM waveform, interrupt and trigger ADC. - * | | |In independent mode, PWM_CMPDAT0~5 denote as 6 independent PWM_CH0~5 compared point. - * | | |In complementary mode, PWM_CMPDAT0, 2, 4 denote as first compared point, and PWM_CMPDAT1, 3, 5 denote as second compared point for the corresponding 3 complementary pairs PWM_CH0 and PWM_CH1, PWM_CH2 and PWM_CH3, PWM_CH4 and PWM_CH5. - * @var PWM_T::DTCTL[3] - * Offset: 0x70 PWM Dead-Time Control Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |Dead-time = (DTCNT[11:0]+1) * PWM_CLK period. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[16] |DTEN |Enable Dead-time Insertion for PWM Pair (PWM_CH0, PWM_CH1) (PWM_CH2, PWM_CH3) (PWM_CH4, PWM_CH5) (Write Protect) - * | | |Dead-time insertion is only active when this pair of complementary PWM is enabled. - * | | |If dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Dead-time insertion Disabled on the pin pair. - * | | |1 = Dead-time insertion Enabled on the pin pair. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from PWM_CLK. - * | | |1 = Dead-time clock source from prescaler output. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * @var PWM_T::CNT - * Offset: 0x90~0xA4 PWM Counter Register 0/2/4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |PWM Data Register (Read Only) - * | | |User can monitor CNT to know the current value in 16-bit period counter. - * |[16] |DIRF |PWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is Down count. - * | | |1 = Counter is UP count. - * @var PWM_T::WGCTL0 - * Offset: 0xB0 PWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |PWM Zero Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM zero point output Low. - * | | |10 = PWM zero point output High. - * | | |11 = PWM zero point output Toggle. - * | | |Note: PWM can control output level when PWM counter count to 0. - * |[3:2] |ZPCTL1 |PWM Zero Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM zero point output Low. - * | | |10 = PWM zero point output High. - * | | |11 = PWM zero point output Toggle. - * | | |Note: PWM can control output level when PWM counter count to 0. - * |[5:4] |ZPCTL2 |PWM Zero Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM zero point output Low. - * | | |10 = PWM zero point output High. - * | | |11 = PWM zero point output Toggle. - * | | |Note: PWM can control output level when PWM counter count to 0. - * |[7:6] |ZPCTL3 |PWM Zero Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM zero point output Low. - * | | |10 = PWM zero point output High. - * | | |11 = PWM zero point output Toggle. - * | | |Note: PWM can control output level when PWM counter count to 0. - * |[9:8] |ZPCTL4 |PWM Zero Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM zero point output Low. - * | | |10 = PWM zero point output High. - * | | |11 = PWM zero point output Toggle. - * | | |Note: PWM can control output level when PWM counter count to 0. - * |[11:10] |ZPCTL5 |PWM Zero Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM zero point output Low. - * | | |10 = PWM zero point output High. - * | | |11 = PWM zero point output Toggle. - * | | |Note: PWM can control output level when PWM counter count to 0. - * |[17:16] |PRDPCTL0 |PWM Period (Center) Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM period (center) point output Low. - * | | |10 = PWM period (center) point output High. - * | | |11 = PWM period (center) point output Toggle. - * | | |Note1: PWM can control output level when PWM counter count to (PERIODn+1). - * | | |Note2: This bit is center point control when PWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |PWM Period (Center) Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM period (center) point output Low. - * | | |10 = PWM period (center) point output High. - * | | |11 = PWM period (center) point output Toggle. - * | | |Note1: PWM can control output level when PWM counter count to (PERIODn+1). - * | | |Note2: This bit is center point control when PWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |PWM Period (Center) Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM period (center) point output Low. - * | | |10 = PWM period (center) point output High. - * | | |11 = PWM period (center) point output Toggle. - * | | |Note1: PWM can control output level when PWM counter count to (PERIODn+1). - * | | |Note2: This bit is center point control when PWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |PWM Period (Center) Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM period (center) point output Low. - * | | |10 = PWM period (center) point output High. - * | | |11 = PWM period (center) point output Toggle. - * | | |Note1: PWM can control output level when PWM counter count to (PERIODn+1). - * | | |Note2: This bit is center point control when PWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |PWM Period (Center) Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM period (center) point output Low. - * | | |10 = PWM period (center) point output High. - * | | |11 = PWM period (center) point output Toggle. - * | | |Note1: PWM can control output level when PWM counter count to (PERIODn+1). - * | | |Note2: This bit is center point control when PWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |PWM Period (Center) Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM period (center) point output Low. - * | | |10 = PWM period (center) point output High. - * | | |11 = PWM period (center) point output Toggle. - * | | |Note1: PWM can control output level when PWM counter count to (PERIODn+1). - * | | |Note2: This bit is center point control when PWM counter operating in up-down counter type. - * @var PWM_T::WGCTL1 - * Offset: 0xB4 PWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |PWM Compare Up Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare up point output Low. - * | | |10 = PWM compare up point output High. - * | | |11 = PWM compare up point output Toggle. - * | | |Note1: PWM can control output level when PWM counter up count to CMPDAT. - * | | |Note2: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[3:2] |CMPUCTL1 |PWM Compare Up Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare up point output Low. - * | | |10 = PWM compare up point output High. - * | | |11 = PWM compare up point output Toggle. - * | | |Note1: PWM can control output level when PWM counter up count to CMPDAT. - * | | |Note2: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[5:4] |CMPUCTL2 |PWM Compare Up Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare up point output Low. - * | | |10 = PWM compare up point output High. - * | | |11 = PWM compare up point output Toggle. - * | | |Note1: PWM can control output level when PWM counter up count to CMPDAT. - * | | |Note2: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[7:6] |CMPUCTL3 |PWM Compare Up Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare up point output Low. - * | | |10 = PWM compare up point output High. - * | | |11 = PWM compare up point output Toggle. - * | | |Note1: PWM can control output level when PWM counter up count to CMPDAT. - * | | |Note2: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[9:8] |CMPUCTL4 |PWM Compare Up Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare up point output Low. - * | | |10 = PWM compare up point output High. - * | | |11 = PWM compare up point output Toggle. - * | | |Note1: PWM can control output level when PWM counter up count to CMPDAT. - * | | |Note2: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[11:10] |CMPUCTL5 |PWM Compare Up Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare up point output Low. - * | | |10 = PWM compare up point output High. - * | | |11 = PWM compare up point output Toggle. - * | | |Note1: PWM can control output level when PWM counter up count to CMPDAT. - * | | |Note2: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[17:16] |CMPDCTL0 |PWM Compare Down Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare down point output Low. - * | | |10 = PWM compare down point output High. - * | | |11 = PWM compare down point output Toggle. - * | | |Note1: PWM can control output level when PWM counter down count to CMPDAT. - * | | |Note2: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[19:18] |CMPDCTL1 |PWM Compare Down Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare down point output Low. - * | | |10 = PWM compare down point output High. - * | | |11 = PWM compare down point output Toggle. - * | | |Note1: PWM can control output level when PWM counter down count to CMPDAT. - * | | |Note2: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[21:20] |CMPDCTL2 |PWM Compare Down Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare down point output Low. - * | | |10 = PWM compare down point output High. - * | | |11 = PWM compare down point output Toggle. - * | | |Note1: PWM can control output level when PWM counter down count to CMPDAT. - * | | |Note2: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[23:22] |CMPDCTL3 |PWM Compare Down Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare down point output Low. - * | | |10 = PWM compare down point output High. - * | | |11 = PWM compare down point output Toggle. - * | | |Note1: PWM can control output level when PWM counter down count to CMPDAT. - * | | |Note2: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[25:24] |CMPDCTL4 |PWM Compare Down Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare down point output Low. - * | | |10 = PWM compare down point output High. - * | | |11 = PWM compare down point output Toggle. - * | | |Note1: PWM can control output level when PWM counter down count to CMPDAT. - * | | |Note2: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[27:26] |CMPDCTL5 |PWM Compare Down Point Control - * | | |Each bit n controls the corresponding PWM channel n. - * | | |00 = Do nothing. - * | | |01 = PWM compare down point output Low. - * | | |10 = PWM compare down point output High. - * | | |11 = PWM compare down point output Toggle. - * | | |Note1: PWM can control output level when PWM counter down count to CMPDAT. - * | | |Note2: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * @var PWM_T::MSKEN - * Offset: 0xB8 PWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |MSKENn |PWM Mask Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |The PWM output signal will be masked when this bit is enabled. - * | | |The corresponding PWM channel n will output MSKDATn (PWM_MSK[5:0]) data. - * | | |0 = PWM output signal is non-masked. - * | | |1 = PWM output signal is masked and output MSKDATn data. - * @var PWM_T::MSK - * Offset: 0xBC PWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |MSKDATn |PWM Mask Data Bit - * | | |This data bit control the state of PWMn output pin, if corresponding mask function is enabled. - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Output logic low to PWM channel n. - * | | |1 = Output logic high to PWM channel n. - * @var PWM_T::BNF - * Offset: 0xC0 PWM Brake Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRK0FEN |PWM Brake 0 Noise Filter Enable Bit - * | | |0 = Noise filter of PWM Brake 0 Disabled. - * | | |1 = Noise filter of PWM Brake 0 Enabled. - * |[3:1] |BRK0FCS |Brake 0 Edge Detector Filter Clock Selection - * | | |000 = Filter clock is HCLK. - * | | |001 = Filter clock is HCLK/2. - * | | |010 = Filter clock is HCLK/4. - * | | |011 = Filter clock is HCLK/8. - * | | |100 = Filter clock is HCLK/16. - * | | |101 = Filter clock is HCLK/32. - * | | |110 = Filter clock is HCLK/64. - * | | |111 = Filter clock is HCLK/128. - * |[6:4] |BRK0FCNT |Brake 0 Edge Detector Filter Count - * | | |The register bits control the Brake0 filter counter to count from 0 to BRK1FCNT. - * |[7] |BRK0PINV |Brake 0 Pin Inverse - * | | |0 = The state of pin PWMx_BRAKE0 is passed to the negative edge detector. - * | | |1 = The inversed state of pin PWMx_BRAKE10 is passed to the negative edge detector. - * |[8] |BRK1FEN |PWM Brake 1 Noise Filter Enable Bit - * | | |0 = Noise filter of PWM Brake 1 Disabled. - * | | |1 = Noise filter of PWM Brake 1 Enabled. - * |[11:9] |BRK1FCS |Brake 1 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[14:12] |BRK1FCNT |Brake 1 Edge Detector Filter Count - * | | |The register bits control the Brake1 filter counter to count from 0 to BRK1FCNT. - * |[15] |BRK1PINV |Brake 1 Pin Inverse - * | | |0 = The state of pin PWMx_BRAKE1 is passed to the negative edge detector. - * | | |1 = The inversed state of pin PWMx_BRAKE1 is passed to the negative edge detector. - * |[16] |BK0SRC |Brake 0 Pin Source Select - * | | |For PWM0 setting: - * | | |0 = Brake 0 pin source come from PWM0_BRAKE0. - * | | |1 = Brake 0 pin source come from PWM1_BRAKE0. - * | | |For PWM1 setting: - * | | |0 = Brake 0 pin source come from PWM1_BRAKE0. - * | | |1 = Brake 0 pin source come from PWM0_BRAKE0. - * |[24] |BK1SRC |Brake 1 Pin Source Select - * | | |For PWM0 setting: - * | | |0 = Brake 1 pin source come from PWM0_BRAKE1. - * | | |1 = Brake 1 pin source come from PWM1_BRAKE1. - * | | |For PWM1 setting: - * | | |0 = Brake 1 pin source come from PWM1_BRAKE1. - * | | |1 = Brake 1 pin source come from PWM0_BRAKE1. - * @var PWM_T::FAILBRK - * Offset: 0xC4 PWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger PWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by CSS detection Disabled. - * | | |1 = Brake Function triggered by CSS detection Enabled. - * |[1] |BODBRKEN |Brown-out Detection Trigger PWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by BOD Disabled. - * | | |1 = Brake Function triggered by BOD Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger PWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by Core lockup detection Disabled. - * | | |1 = Brake Function triggered by Core lockup detection Enabled. - * @var PWM_T::BRKCTL[3] - * Offset: 0xC8 PWM Brake Edge Detect Control Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CPO0EBEN |Enable ACMP0_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as edge-detect brake source Disabled. - * | | |1 = ACMP0_O as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[1] |CPO1EBEN |Enable ACMP1_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as edge-detect brake source Disabled. - * | | |1 = ACMP1_O as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[4] |BRKP0EEN |Enable PWMx_BRAKE0 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKE0 pin as edge-detect brake source Disabled. - * | | |1 = PWMx_BRAKE0 pin as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[5] |BRKP1EEN |Enable PWMx_BRAKE1 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKE1 pin as edge-detect brake source Disabled. - * | | |1 = PWMx_BRAKE1 pin as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as edge-detect brake source Disabled. - * | | |1 = System Fail condition as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |CPO0LBEN |Enable ACMP0_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as level-detect brake source Disabled. - * | | |1 = ACMP0_O as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |CPO1LBEN |Enable ACMP1_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as level-detect brake source Disabled. - * | | |1 = ACMP1_O as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[12] |BRKP0LEN |Enable BKP0 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKE0 pin as level-detect brake source Disabled. - * | | |1 = PWMx_BRAKE0 pin as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[13] |BRKP1LEN |Enable BKP1 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKE1 pin as level-detect brake source Disabled. - * | | |1 = PWMx_BRAKE1 pin as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as level-detect brake source Disabled. - * | | |1 = System Fail condition as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[17:16] |BRKAEVEN |PWM Brake Action Select for Even Channel (Write Protect) - * | | |00 = PWMx brake event will not affect even channels output. - * | | |01 = PWM even channel output tri-state when PWMx brake event happened. - * | | |10 = PWM even channel output low level when PWMx brake event happened. - * | | |11 = PWM even channel output high level when PWMx brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[19:18] |BRKAODD |PWM Brake Action Select for Odd Channel (Write Protect) - * | | |00 = PWMx brake event will not affect odd channels output. - * | | |01 = PWM odd channel output tri-state when PWMx brake event happened. - * | | |10 = PWM odd channel output low level when PWMx brake event happened. - * | | |11 = PWM odd channel output high level when PWMx brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[20] |EADCEBEN |Enable EADC Result Monitor (EADCRM) As Edge-detect Brake Source (Write Protect) - * | | |0 = EADCRM as edge-detect brake source Disabled. - * | | |1 = EADCRM as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[28] |EADCLBEN |Enable EADC Result Monitor (EADCRM) As Level-detect Brake Source (Write Protect) - * | | |0 = EADCRM as level-detect brake source Disabled. - * | | |1 = EADCRM as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var PWM_T::POLCTL - * Offset: 0xD4 PWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |PINVn |PWM PIN Polar Inverse Control - * | | |The register controls polarity state of PWM output - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = PWM output polar inverse Disabled. - * | | |1 = PWM output polar inverse Enabled. - * @var PWM_T::POEN - * Offset: 0xD8 PWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |POENn |PWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = PWM pin at tri-state. - * | | |1 = PWM pin in output mode. - * @var PWM_T::SWBRK - * Offset: 0xDC PWM Software Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |BRKETRGn |PWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Each bit n controls the corresponding PWM pair n. - * | | |Write 1 to this bit will trigger Edge brake, and set BRKEIFn to 1 in PWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[10:8] |BRKLTRGn |PWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Each bit n controls the corresponding PWM pair n. - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in PWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * @var PWM_T::INTEN0 - * Offset: 0xE0 PWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |PWM Zero Point Interrupt Enable 0 - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[2] |ZIEN2 |PWM Zero Point Interrupt Enable 2 - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[4] |ZIEN4 |PWM Zero Point Interrupt Enable 4 - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[8] |PIEN0 |PWM Period Point Interrupt Enable 0 - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When counter type is up-down, period point means center point. - * |[10] |PIEN2 |PWM Period Point Interrupt Enable 2 - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When counter type is up-down, period point means center point. - * |[12] |PIEN4 |PWM Period Point Interrupt Enable 4 - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When counter type is up-down, period point means center point. - * |[21:16] |CMPUIENn |PWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[29:24] |CMPDIENn |PWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * @var PWM_T::INTEN1 - * Offset: 0xE4 PWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN0_1|PWM Edge-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[1] |BRKEIEN2_3|PWM Edge-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[2] |BRKEIEN4_5|PWM Edge-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[8] |BRKLIEN0_1|PWM Level-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Level-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[9] |BRKLIEN2_3|PWM Level-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Level-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[10] |BRKLIEN4_5|PWM Level-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Level-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * @var PWM_T::INTSTS0 - * Offset: 0xE8 PWM Interrupt Flag Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |PWM Zero Point Interrupt Flag 0 - * | | |This bit is set by hardware when PWM_CH0 counter reaches zero, software can write 1 to clear this bit to zero. - * |[2] |ZIF2 |PWM Zero Point Interrupt Flag 2 - * | | |This bit is set by hardware when PWM_CH2 counter reaches zero, software can write 1 to clear this bit to zero. - * |[4] |ZIF4 |PWM Zero Point Interrupt Flag 4 - * | | |This bit is set by hardware when PWM_CH4 counter reaches zero, software can write 1 to clear this bit to zero. - * |[8] |PIF0 |PWM Period Point Interrupt Flag 0 - * | | |This bit is set by hardware when PWM_CH0 counter reaches PWM_PERIOD0, software can write 1 to clear this bit to zero. - * |[10] |PIF2 |PWM Period Point Interrupt Flag 2 - * | | |This bit is set by hardware when PWM_CH2 counter reaches PWM_PERIOD2, software can write 1 to clear this bit to zero. - * |[12] |PIF4 |PWM Period Point Interrupt Flag 4 - * | | |This bit is set by hardware when PWM_CH4 counter reaches PWM_PERIOD4, software can write 1 to clear this bit to zero. - * |[21:16] |CMPUIFn |PWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when PWM counter up count and reaches PWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding PWM channel n. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[29:24] |CMPDIFn |PWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding PWM channel n. - * | | |Flag is set by hardware when PWM counter down count and reaches PWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * @var PWM_T::INTSTS1 - * Offset: 0xEC PWM Interrupt Flag Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |PWM Channel 0 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 0 edge-detect brake event do not happened. - * | | |1 = When PWM channel 0 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[1] |BRKEIF1 |PWM Channel 1 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 1 edge-detect brake event do not happened. - * | | |1 = When PWM channel 1 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[2] |BRKEIF2 |PWM Channel 2 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 2 edge-detect brake event do not happened. - * | | |1 = When PWM channel 2 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[3] |BRKEIF3 |PWM Channel 3 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 3 edge-detect brake event do not happened. - * | | |1 = When PWM channel 3 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[4] |BRKEIF4 |PWM Channel 4 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 4 edge-detect brake event do not happened. - * | | |1 = When PWM channel 4 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[5] |BRKEIF5 |PWM Channel 5 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 5 edge-detect brake event do not happened. - * | | |1 = When PWM channel 5 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[8] |BRKLIF0 |PWM Channel 0 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 0 level-detect brake event do not happened. - * | | |1 = When PWM channel 0 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[9] |BRKLIF1 |PWM Channel 1 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 1 level-detect brake event do not happened. - * | | |1 = When PWM channel 1 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[10] |BRKLIF2 |PWM Channel 2 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 2 level-detect brake event do not happened. - * | | |1 = When PWM channel 2 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[11] |BRKLIF3 |PWM Channel 3 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 3 level-detect brake event do not happened. - * | | |1 = When PWM channel 3 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[12] |BRKLIF4 |PWM Channel 4 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 4 level-detect brake event do not happened. - * | | |1 = When PWM channel 4 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[13] |BRKLIF5 |PWM Channel 5 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = PWM channel 5 level-detect brake event do not happened. - * | | |1 = When PWM channel 5 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * |[16] |BRKESTS0 |PWM Channel 0 Edge-detect Brake Status - * | | |0 = PWM channel 0 edge-detect brake state is released. - * | | |1 = When PWM channel 0 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel0 at brake state, writing 1 to clear. - * |[17] |BRKESTS1 |PWM Channel 1 Edge-detect Brake Status - * | | |0 = PWM channel 1 edge-detect brake state is released. - * | | |1 = When PWM channel 1 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel1 at brake state, writing 1 to clear. - * |[18] |BRKESTS2 |PWM Channel 2 Edge-detect Brake Status - * | | |0 = PWM channel 2 edge-detect brake state is released. - * | | |1 = When PWM channel 2 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel2 at brake state, writing 1 to clear. - * |[19] |BRKESTS3 |PWM Channel 3 Edge-detect Brake Status - * | | |0 = PWM channel 3 edge-detect brake state is released. - * | | |1 = When PWM channel 3 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel3 at brake state, writing 1 to clear. - * |[20] |BRKESTS4 |PWM Channel 4 Edge-detect Brake Status - * | | |0 = PWM channel 4 edge-detect brake state is released. - * | | |1 = When PWM channel 4 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel4 at brake state, writing 1 to clear. - * |[21] |BRKESTS5 |PWM Channel 5 Edge-detect Brake Status - * | | |0 = PWM channel 5 edge-detect brake state is released. - * | | |1 = When PWM channel 5 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel5 at brake state, writing 1 to clear. - * |[24] |BRKLSTS0 |PWM Channel 0 Level-detect Brake Status (Read Only) - * | | |0 = PWM channel 0 level-detect brake state is released. - * | | |1 = When PWM channel 0 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel0 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, PWM will release brake state until current PWM period finished - * | | |The PWM waveform will start output from next full PWM period. - * |[25] |BRKLSTS1 |PWM Channel 1 Level-detect Brake Status (Read Only) - * | | |0 = PWM channel 1 level-detect brake state is released. - * | | |1 = When PWM channel 1 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel1 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, PWM will release brake state until current PWM period finished - * | | |The PWM waveform will start output from next full PWM period. - * |[26] |BRKLSTS2 |PWM Channel 2 Level-detect Brake Status (Read Only) - * | | |0 = PWM channel 2 level-detect brake state is released. - * | | |1 = When PWM channel 2 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel2 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, PWM will release brake state until current PWM period finished - * | | |The PWM waveform will start output from next full PWM period. - * |[27] |BRKLSTS3 |PWM Channel 3 Level-detect Brake Status (Read Only) - * | | |0 = PWM channel 3 level-detect brake state is released. - * | | |1 = When PWM channel 3 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel3 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, PWM will release brake state until current PWM period finished - * | | |The PWM waveform will start output from next full PWM period. - * |[28] |BRKLSTS4 |PWM Channel 4 Level-detect Brake Status (Read Only) - * | | |0 = PWM channel 4 level-detect brake state is released. - * | | |1 = When PWM channel 4 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel4 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, PWM will release brake state until current PWM period finished - * | | |The PWM waveform will start output from next full PWM period. - * |[29] |BRKLSTS5 |PWM Channel 5 Level-detect Brake Status (Read Only) - * | | |0 = PWM channel 5 level-detect brake state is released. - * | | |1 = When PWM channel 5 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the PWM channel5 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, PWM will release brake state until current PWM period finished - * | | |The PWM waveform will start output from next full PWM period. - * @var PWM_T::ADCTS0 - * Offset: 0xF8 PWM Trigger ADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |PWM_CH0 Trigger ADC Source Select - * | | |0000 = PWM_CH0 zero point. - * | | |0001 = PWM_CH0 period point. - * | | |0010 = PWM_CH0 zero or period point. - * | | |0011 = PWM_CH0 up-count CMPDAT point. - * | | |0100 = PWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = PWM_CH1 up-count CMPDAT point. - * | | |1001 = PWM_CH1 down-count CMPDAT point. - * | | |Others = reserved. - * |[7] |TRGEN0 |PWM_CH0 Trigger ADC Enable Bit - * |[11:8] |TRGSEL1 |PWM_CH1 Trigger ADC Source Select - * | | |0000 = PWM_CH0 zero point. - * | | |0001 = PWM_CH0 period point. - * | | |0010 = PWM_CH0 zero or period point. - * | | |0011 = PWM_CH0 up-count CMPDAT point. - * | | |0100 = PWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = PWM_CH1 up-count CMPDAT point. - * | | |1001 = PWM_CH1 down-count CMPDAT point. - * | | |Others = reserved. - * |[15] |TRGEN1 |PWM_CH1 Trigger ADC Enable Bit - * |[19:16] |TRGSEL2 |PWM_CH2 Trigger ADC Source Select - * | | |0000 = PWM_CH2 zero point. - * | | |0001 = PWM_CH2 period point. - * | | |0010 = PWM_CH2 zero or period point. - * | | |0011 = PWM_CH2 up-count CMPDAT point. - * | | |0100 = PWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = PWM_CH3 up-count CMPDAT point. - * | | |1001 = PWM_CH3 down-count CMPDAT point. - * | | |Others = reserved. - * |[23] |TRGEN2 |PWM_CH2 Trigger ADC Enable Bit - * |[27:24] |TRGSEL3 |PWM_CH3 Trigger ADC Source Select - * | | |0000 = PWM_CH2 zero point. - * | | |0001 = PWM_CH2 period point. - * | | |0010 = PWM_CH2 zero or period point. - * | | |0011 = PWM_CH2 up-count CMPDAT point. - * | | |0100 = PWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = PWM_CH3 up-count CMPDAT point. - * | | |1001 = PWM_CH3 down-count CMPDAT point. - * | | |Others = reserved. - * |[31] |TRGEN3 |PWM_CH3 Trigger ADC Enable Bit - * @var PWM_T::ADCTS1 - * Offset: 0xFC PWM Trigger ADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |PWM_CH4 Trigger ADC Source Select - * | | |0000 = PWM_CH4 zero point. - * | | |0001 = PWM_CH4 period point. - * | | |0010 = PWM_CH4 zero or period point. - * | | |0011 = PWM_CH4 up-count CMPDAT point. - * | | |0100 = PWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = PWM_CH5 up-count CMPDAT point. - * | | |1001 = PWM_CH5 down-count CMPDAT point. - * | | |Others = reserved. - * |[7] |TRGEN4 |PWM_CH4 Trigger ADC Enable Bit - * |[11:8] |TRGSEL5 |PWM_CH5 Trigger ADC Source Select - * | | |0000 = PWM_CH4 zero point. - * | | |0001 = PWM_CH4 period point. - * | | |0010 = PWM_CH4 zero or period point. - * | | |0011 = PWM_CH4 up-count CMPDAT point. - * | | |0100 = PWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = PWM_CH5 up-count CMPDAT point. - * | | |1001 = PWM_CH5 down-count CMPDAT point. - * | | |Others = reserved. - * |[15] |TRGEN5 |PWM_CH5 Trigger ADC Enable Bit - * @var PWM_T::SSCTL - * Offset: 0x110 PWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |PWM Synchronous Start Function Enable 0 - * | | |When synchronous start function is enabled, the PWM_CH0 counter enable bit (CNTEN0) can be enabled by writing PWM synchronous start trigger bit (CNTSEN). - * | | |0 = PWM synchronous start function Disabled. - * | | |1 = PWM synchronous start function Enabled. - * |[2] |SSEN2 |PWM Synchronous Start Function Enable 2 - * | | |When synchronous start function is enabled, the PWM_CH2 counter enable bit (CNTEN2) can be enabled by writing PWM synchronous start trigger bit (CNTSEN). - * | | |0 = PWM synchronous start function Disabled. - * | | |1 = PWM synchronous start function Enabled. - * |[4] |SSEN4 |PWM Synchronous Start Function Enable 4 - * | | |When synchronous start function is enabled, the PWM_CH4 counter enable bit (CNTEN4) can be enabled by writing PWM synchronous start trigger bit (CNTSEN). - * | | |0 = PWM synchronous start function Disabled. - * | | |1 = PWM synchronous start function Enabled. - * |[9:8] |SSRC |PWM Synchronous Start Source Select - * | | |00 = Synchronous start source come from PWM0. - * | | |01 = Synchronous start source come from PWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var PWM_T::SSTRG - * Offset: 0x114 PWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |PWM Counter Synchronous Start Enable (Write Only) - * | | |PMW counter synchronous enable function is used to make selected PWM channels (include PWM0_CHx and PWM1_CHx) start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit (CNTENn, n denotes channel 0 to 5) if correlated PWM channel counter synchronous start function is enabled. - * @var PWM_T::STATUS - * Offset: 0x120 PWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAX0 |Time-base Counter 0 Equal to 0xFFFF Latched Status - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value. - * | | |Note: This bit can be clear by software writing 1. - * |[2] |CNTMAX2 |Time-base Counter 2 Equal to 0xFFFF Latched Status - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value. - * | | |Note: This bit can be clear by software writing 1. - * |[4] |CNTMAX4 |Time-base Counter 4 Equal to 0xFFFF Latched Status - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value. - * | | |Note: This bit can be clear by software writing 1. - * |[21:16] |ADCTRGn |ADC Start of Conversion Status - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Indicates no ADC start of conversion trigger event has occurred. - * | | |1 = Indicates an ADC start of conversion trigger event has occurred. - * | | |Note: This bit can be clear by software writing 1. - * @var PWM_T::CAPINEN - * Offset: 0x200 PWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CAPINENn |Capture Input Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = PWM Channel capture input path Disabled. - * | | |The input of PWM channel capture function is always regarded as 0. - * | | |1 = PWM Channel capture input path Enabled. - * | | |The input of PWM channel capture function comes from correlative multifunction pin. - * @var PWM_T::CAPCTL - * Offset: 0x204 PWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CAPENn |Capture Function Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the PWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[13:8] |CAPINVn |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[21:16] |RCRLDENn |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[29:24] |FCRLDENn |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var PWM_T::CAPSTS - * Offset: 0x208 PWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CRLIFOVn |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Each bit n controls the corresponding PWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[13:8] |CFLIFOVn |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Each bit n controls the corresponding PWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * @var PWM_T::RCAPDAT0 - * Offset: 0x20C PWM Rising Capture Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |PWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::FCAPDAT0 - * Offset: 0x210 PWM Falling Capture Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |PWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::RCAPDAT1 - * Offset: 0x214 PWM Rising Capture Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |PWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::FCAPDAT1 - * Offset: 0x218 PWM Falling Capture Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |PWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::RCAPDAT2 - * Offset: 0x21C PWM Rising Capture Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |PWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::FCAPDAT2 - * Offset: 0x220 PWM Falling Capture Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |PWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::RCAPDAT3 - * Offset: 0x224 PWM Rising Capture Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |PWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::FCAPDAT3 - * Offset: 0x228 PWM Falling Capture Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |PWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::RCAPDAT4 - * Offset: 0x22C PWM Rising Capture Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |PWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::FCAPDAT4 - * Offset: 0x230 PWM Falling Capture Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |PWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::RCAPDAT5 - * Offset: 0x234 PWM Rising Capture Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |PWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::FCAPDAT5 - * Offset: 0x238 PWM Falling Capture Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |PWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the PWM counter value will be saved in this register. - * @var PWM_T::PDMACTL - * Offset: 0x23C PWM PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHEN0_1 |Channel 0/1 PDMA Enable Bit - * | | |0 = Channel 0/1 PDMA function Disabled. - * | | |1 = Channel 0/1 PDMA function Enabled for the channel 0/1 captured data and transfer to memory. - * |[2:1] |CAPMOD0_1 |Select PWM_RCAPDAT0/1 or PWM_FCAPDAT0/1 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = PWM_RCAPDAT0/1. - * | | |10 = PWM_FCAPDAT0/1. - * | | |11 = Both PWM_RCAPDAT0/1 and PWM_FCAPDAT0/1. - * |[3] |CAPORD0_1 |Capture Channel 0/1 Rising/Falling Order - * | | |Set this bit to determine whether the PWM_RCAPDAT0/1 or PWM_FCAPDAT0/1 is the first captured data transferred to memory through PDMA when CAPMOD0_1 =11. - * | | |0 = PWM_FCAPDAT0/1 is the first captured data to memory. - * | | |1 = PWM_RCAPDAT0/1 is the first captured data to memory. - * |[4] |CHSEL0_1 |Select Channel 0/1 to Do PDMA Transfer - * | | |0 = Channel 0. - * | | |1 = Channel 1. - * |[8] |CHEN2_3 |Channel 2/3 PDMA Enable Bit - * | | |0 = Channel 2/3 PDMA function Disabled. - * | | |1 = Channel 2/3 PDMA function Enabled for the channel 2/3 captured data and transfer to memory. - * |[10:9] |CAPMOD2_3 |Select PWM_RCAPDAT2/3 or PWM_FCAODAT2/3 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = PWM_RCAPDAT2/3. - * | | |10 = PWM_FCAPDAT2/3. - * | | |11 = Both PWM_RCAPDAT2/3 and PWM_FCAPDAT2/3. - * |[11] |CAPORD2_3 |Capture Channel 2/3 Rising/Falling Order - * | | |Set this bit to determine whether the PWM_RCAPDAT2/3 or PWM_FCAPDAT2/3 is the first captured data transferred to memory through PDMA when CAPMOD2_3 =11. - * | | |0 = PWM_FCAPDAT2/3 is the first captured data to memory. - * | | |1 = PWM_RCAPDAT2/3 is the first captured data to memory. - * |[12] |CHSEL2_3 |Select Channel 2/3 to Do PDMA Transfer - * | | |0 = Channel 2. - * | | |1 = Channel 3. - * |[16] |CHEN4_5 |Channel 4/5 PDMA Enable Bit - * | | |0 = Channel 4/5 PDMA function Disabled. - * | | |1 = Channel 4/5 PDMA function Enabled for the channel 4/5 captured data and transfer to memory. - * |[18:17] |CAPMOD4_5 |Select PWM_RCAPDAT4/5 or PWM_FCAPDAT4/5 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = PWM_RCAPDAT4/5. - * | | |10 = PWM_FCAPDAT4/5. - * | | |11 = Both PWM_RCAPDAT4/5 and PWM_FCAPDAT4/5. - * |[19] |CAPORD4_5 |Capture Channel 4/5 Rising/Falling Order - * | | |Set this bit to determine whether the PWM_RCAPDAT4/5 or PWM_FCAPDAT4/5 is the first captured data transferred to memory through PDMA when CAPMOD4_5 =11. - * | | |0 = PWM_FCAPDAT4/5 is the first captured data to memory. - * | | |1 = PWM_RCAPDAT4/5 is the first captured data to memory. - * |[20] |CHSEL4_5 |Select Channel 4/5 to Do PDMA Transfer - * | | |0 = Channel 4. - * | | |1 = Channel 5. - * @var PWM_T::PDMACAP0_1 - * Offset: 0x240 PWM Capture Channel 01 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |PWM Capture PDMA Register (Read Only) - * | | |This register is use as a buffer to transfer PWM capture rising or falling data to memory by PDMA. - * @var PWM_T::PDMACAP2_3 - * Offset: 0x244 PWM Capture Channel 23 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |PWM Capture PDMA Register (Read Only) - * | | |This register is use as a buffer to transfer PWM capture rising or falling data to memory by PDMA. - * @var PWM_T::PDMACAP4_5 - * Offset: 0x248 PWM Capture Channel 45 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |PWM Capture PDMA Register (Read Only) - * | | |This register is use as a buffer to transfer PWM capture rising or falling data to memory by PDMA. - * @var PWM_T::CAPIEN - * Offset: 0x250 PWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CAPRIENn |PWM Capture Rising Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[13:8] |CAPFIENn |PWM Capture Falling Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding PWM channel n. - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var PWM_T::CAPIF - * Offset: 0x254 PWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CRLIFn |PWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding PWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[13:8] |CFLIFn |PWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding PWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * @var PWM_T::PBUF - * Offset: 0x304~0x318 PWM PERIOD0/2/4 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |PWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var PWM_T::CMPBUF - * Offset: 0x31C~~0x330 PWM CMPDAT0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |PWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL0; /*!< [0x0000] PWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] PWM Control Register 1 */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CLKSRC; /*!< [0x0010] PWM Clock Source Register */ - __IO uint32_t CLKPSC[3]; /*!< [0x0014~0x001c] PWM Clock Pre-scale Register 0_1 ~ 4_5 */ - __IO uint32_t CNTEN; /*!< [0x0020] PWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] PWM Clear Counter Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t PERIOD[6]; /*!< [0x0030~0x0044] PWM Period Register 0/2/4 */ - __I uint32_t RESERVE2[2]; - __IO uint32_t CMPDAT[6]; /*!< [0x0050~0x0064] PWM Comparator Register 0~5 */ - __I uint32_t RESERVE3[2]; - __IO uint32_t DTCTL[3]; /*!< [0x0070~0x0078] PWM Dead-Time Control Register 0_1 */ - __I uint32_t RESERVE4[5]; - __I uint32_t CNT[6]; /*!< [0x0090~0x00a4] PWM Counter Register 0/2/4 */ - __I uint32_t RESERVE5[2]; - __IO uint32_t WGCTL0; /*!< [0x00b0] PWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] PWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] PWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] PWM Mask Data Register */ - __IO uint32_t BNF; /*!< [0x00c0] PWM Brake Noise Filter Register */ - __IO uint32_t FAILBRK; /*!< [0x00c4] PWM System Fail Brake Control Register */ - __IO uint32_t BRKCTL[3]; /*!< [0x00c8~0x00d0] PWM Brake Edge Detect Control Register 0_5 */ - __IO uint32_t POLCTL; /*!< [0x00d4] PWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] PWM Output Enable Register */ - __O uint32_t SWBRK; /*!< [0x00dc] PWM Software Brake Control Register */ - __IO uint32_t INTEN0; /*!< [0x00e0] PWM Interrupt Enable Register 0 */ - __IO uint32_t INTEN1; /*!< [0x00e4] PWM Interrupt Enable Register 1 */ - __IO uint32_t INTSTS0; /*!< [0x00e8] PWM Interrupt Flag Register 0 */ - __IO uint32_t INTSTS1; /*!< [0x00ec] PWM Interrupt Flag Register 1 */ - __I uint32_t RESERVE6[2]; - __IO uint32_t ADCTS0; /*!< [0x00f8] PWM Trigger ADC Source Select Register 0 */ - __IO uint32_t ADCTS1; /*!< [0x00fc] PWM Trigger ADC Source Select Register 1 */ - __I uint32_t RESERVE7[4]; - __IO uint32_t SSCTL; /*!< [0x0110] PWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] PWM Synchronous Start Trigger Register */ - __I uint32_t RESERVE8[2]; - __IO uint32_t STATUS; /*!< [0x0120] PWM Status Register */ - __I uint32_t RESERVE9[55]; - __IO uint32_t CAPINEN; /*!< [0x0200] PWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] PWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] PWM Capture Status Register */ - __I uint32_t RCAPDAT0; /*!< [0x020c] PWM Rising Capture Data Register 0 */ - __I uint32_t FCAPDAT0; /*!< [0x0210] PWM Falling Capture Data Register 0 */ - __I uint32_t RCAPDAT1; /*!< [0x0214] PWM Rising Capture Data Register 1 */ - __I uint32_t FCAPDAT1; /*!< [0x0218] PWM Falling Capture Data Register 1 */ - __I uint32_t RCAPDAT2; /*!< [0x021c] PWM Rising Capture Data Register 2 */ - __I uint32_t FCAPDAT2; /*!< [0x0220] PWM Falling Capture Data Register 2 */ - __I uint32_t RCAPDAT3; /*!< [0x0224] PWM Rising Capture Data Register 3 */ - __I uint32_t FCAPDAT3; /*!< [0x0228] PWM Falling Capture Data Register 3 */ - __I uint32_t RCAPDAT4; /*!< [0x022c] PWM Rising Capture Data Register 4 */ - __I uint32_t FCAPDAT4; /*!< [0x0230] PWM Falling Capture Data Register 4 */ - __I uint32_t RCAPDAT5; /*!< [0x0234] PWM Rising Capture Data Register 5 */ - __I uint32_t FCAPDAT5; /*!< [0x0238] PWM Falling Capture Data Register 5 */ - __IO uint32_t PDMACTL; /*!< [0x023c] PWM PDMA Control Register */ - __I uint32_t PDMACAP0_1; /*!< [0x0240] PWM Capture Channel 01 PDMA Register */ - __I uint32_t PDMACAP2_3; /*!< [0x0244] PWM Capture Channel 23 PDMA Register */ - __I uint32_t PDMACAP4_5; /*!< [0x0248] PWM Capture Channel 45 PDMA Register */ - __I uint32_t RESERVE10[1]; - __IO uint32_t CAPIEN; /*!< [0x0250] PWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] PWM Capture Interrupt Flag Register */ - __I uint32_t RESERVE11[43]; - __I uint32_t PBUF[6]; /*!< [0x0304~0x0318] PWM PERIOD0/2/4 Buffer */ - __I uint32_t CMPBUF[6]; /*!< [0x031c~0x0330] PWM CMPDAT0~5 Buffer */ -} PWM_T; - -/** - @addtogroup PWM_CONST PWM Bit Field Definition - Constant Definitions for PWM Controller -@{ */ - -#define PWM_CTL0_CTRLD0_Pos (0) /*!< PWM_T::CTL0: CTRLD0 Position */ -#define PWM_CTL0_CTRLD0_Msk (0x1ul << PWM_CTL0_CTRLD0_Pos) /*!< PWM_T::CTL0: CTRLD0 Mask */ - -#define PWM_CTL0_CTRLD1_Pos (1) /*!< PWM_T::CTL0: CTRLD1 Position */ -#define PWM_CTL0_CTRLD1_Msk (0x1ul << PWM_CTL0_CTRLD1_Pos) /*!< PWM_T::CTL0: CTRLD1 Mask */ - -#define PWM_CTL0_CTRLD2_Pos (2) /*!< PWM_T::CTL0: CTRLD2 Position */ -#define PWM_CTL0_CTRLD2_Msk (0x1ul << PWM_CTL0_CTRLD2_Pos) /*!< PWM_T::CTL0: CTRLD2 Mask */ - -#define PWM_CTL0_CTRLD3_Pos (3) /*!< PWM_T::CTL0: CTRLD3 Position */ -#define PWM_CTL0_CTRLD3_Msk (0x1ul << PWM_CTL0_CTRLD3_Pos) /*!< PWM_T::CTL0: CTRLD3 Mask */ - -#define PWM_CTL0_CTRLD4_Pos (4) /*!< PWM_T::CTL0: CTRLD4 Position */ -#define PWM_CTL0_CTRLD4_Msk (0x1ul << PWM_CTL0_CTRLD4_Pos) /*!< PWM_T::CTL0: CTRLD4 Mask */ - -#define PWM_CTL0_CTRLD5_Pos (5) /*!< PWM_T::CTL0: CTRLD5 Position */ -#define PWM_CTL0_CTRLD5_Msk (0x1ul << PWM_CTL0_CTRLD5_Pos) /*!< PWM_T::CTL0: CTRLD5 Mask */ - -#define PWM_CTL0_IMMLDEN0_Pos (16) /*!< PWM_T::CTL0: IMMLDEN0 Position */ -#define PWM_CTL0_IMMLDEN0_Msk (0x1ul << PWM_CTL0_IMMLDEN0_Pos) /*!< PWM_T::CTL0: IMMLDEN0 Mask */ - -#define PWM_CTL0_IMMLDEN1_Pos (17) /*!< PWM_T::CTL0: IMMLDEN1 Position */ -#define PWM_CTL0_IMMLDEN1_Msk (0x1ul << PWM_CTL0_IMMLDEN1_Pos) /*!< PWM_T::CTL0: IMMLDEN1 Mask */ - -#define PWM_CTL0_IMMLDEN2_Pos (18) /*!< PWM_T::CTL0: IMMLDEN2 Position */ -#define PWM_CTL0_IMMLDEN2_Msk (0x1ul << PWM_CTL0_IMMLDEN2_Pos) /*!< PWM_T::CTL0: IMMLDEN2 Mask */ - -#define PWM_CTL0_IMMLDEN3_Pos (19) /*!< PWM_T::CTL0: IMMLDEN3 Position */ -#define PWM_CTL0_IMMLDEN3_Msk (0x1ul << PWM_CTL0_IMMLDEN3_Pos) /*!< PWM_T::CTL0: IMMLDEN3 Mask */ - -#define PWM_CTL0_IMMLDEN4_Pos (20) /*!< PWM_T::CTL0: IMMLDEN4 Position */ -#define PWM_CTL0_IMMLDEN4_Msk (0x1ul << PWM_CTL0_IMMLDEN4_Pos) /*!< PWM_T::CTL0: IMMLDEN4 Mask */ - -#define PWM_CTL0_IMMLDEN5_Pos (21) /*!< PWM_T::CTL0: IMMLDEN5 Position */ -#define PWM_CTL0_IMMLDEN5_Msk (0x1ul << PWM_CTL0_IMMLDEN5_Pos) /*!< PWM_T::CTL0: IMMLDEN5 Mask */ - -#define PWM_CTL0_DBGHALT_Pos (30) /*!< PWM_T::CTL0: DBGHALT Position */ -#define PWM_CTL0_DBGHALT_Msk (0x1ul << PWM_CTL0_DBGHALT_Pos) /*!< PWM_T::CTL0: DBGHALT Mask */ - -#define PWM_CTL0_DBGTRIOFF_Pos (31) /*!< PWM_T::CTL0: DBGTRIOFF Position */ -#define PWM_CTL0_DBGTRIOFF_Msk (0x1ul << PWM_CTL0_DBGTRIOFF_Pos) /*!< PWM_T::CTL0: DBGTRIOFF Mask */ - -#define PWM_CTL1_CNTTYPE0_Pos (0) /*!< PWM_T::CTL1: CNTTYPE0 Position */ -#define PWM_CTL1_CNTTYPE0_Msk (0x3ul << PWM_CTL1_CNTTYPE0_Pos) /*!< PWM_T::CTL1: CNTTYPE0 Mask */ - -#define PWM_CTL1_CNTTYPE2_Pos (4) /*!< PWM_T::CTL1: CNTTYPE2 Position */ -#define PWM_CTL1_CNTTYPE2_Msk (0x3ul << PWM_CTL1_CNTTYPE2_Pos) /*!< PWM_T::CTL1: CNTTYPE2 Mask */ - -#define PWM_CTL1_CNTTYPE4_Pos (8) /*!< PWM_T::CTL1: CNTTYPE4 Position */ -#define PWM_CTL1_CNTTYPE4_Msk (0x3ul << PWM_CTL1_CNTTYPE4_Pos) /*!< PWM_T::CTL1: CNTTYPE4 Mask */ - -#define PWM_CTL1_OUTMODE0_Pos (24) /*!< PWM_T::CTL1: PWMMODE0 Position */ -#define PWM_CTL1_OUTMODE0_Msk (0x1ul << PWM_CTL1_OUTMODE0_Pos) /*!< PWM_T::CTL1: PWMMODE0 Mask */ - -#define PWM_CTL1_OUTMODE2_Pos (25) /*!< PWM_T::CTL1: PWMMODE2 Position */ -#define PWM_CTL1_OUTMODE2_Msk (0x1ul << PWM_CTL1_OUTMODE2_Pos) /*!< PWM_T::CTL1: PWMMODE2 Mask */ - -#define PWM_CTL1_OUTMODE4_Pos (26) /*!< PWM_T::CTL1: PWMMODE4 Position */ -#define PWM_CTL1_OUTMODE4_Msk (0x1ul << PWM_CTL1_OUTMODE4_Pos) /*!< PWM_T::CTL1: PWMMODE4 Mask */ - -#define PWM_CLKSRC_ECLKSRC0_Pos (0) /*!< PWM_T::CLKSRC: ECLKSRC0 Position */ -#define PWM_CLKSRC_ECLKSRC0_Msk (0x7ul << PWM_CLKSRC_ECLKSRC0_Pos) /*!< PWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define PWM_CLKSRC_ECLKSRC2_Pos (8) /*!< PWM_T::CLKSRC: ECLKSRC2 Position */ -#define PWM_CLKSRC_ECLKSRC2_Msk (0x7ul << PWM_CLKSRC_ECLKSRC2_Pos) /*!< PWM_T::CLKSRC: ECLKSRC2 Mask */ - -#define PWM_CLKSRC_ECLKSRC4_Pos (16) /*!< PWM_T::CLKSRC: ECLKSRC4 Position */ -#define PWM_CLKSRC_ECLKSRC4_Msk (0x7ul << PWM_CLKSRC_ECLKSRC4_Pos) /*!< PWM_T::CLKSRC: ECLKSRC4 Mask */ - -#define PWM_CLKPSC0_1_CLKPSC_Pos (0) /*!< PWM_T::CLKPSC: CLKPSC Position */ -#define PWM_CLKPSC0_1_CLKPSC_Msk (0xffful << PWM_CLKPSC0_1_CLKPSC_Pos) /*!< PWM_T::CLKPSC: CLKPSC Mask */ - -#define PWM_CLKPSC2_3_CLKPSC_Pos (0) /*!< PWM_T::CLKPSC: CLKPSC Position */ -#define PWM_CLKPSC2_3_CLKPSC_Msk (0xffful << PWM_CLKPSC2_3_CLKPSC_Pos) /*!< PWM_T::CLKPSC: CLKPSC Mask */ - -#define PWM_CLKPSC4_5_CLKPSC_Pos (0) /*!< PWM_T::CLKPSC: CLKPSC Position */ -#define PWM_CLKPSC4_5_CLKPSC_Msk (0xffful << PWM_CLKPSC4_5_CLKPSC_Pos) /*!< PWM_T::CLKPSC: CLKPSC Mask */ - -#define PWM_CNTEN_CNTEN0_Pos (0) /*!< PWM_T::CNTEN: CNTEN0 Position */ -#define PWM_CNTEN_CNTEN0_Msk (0x1ul << PWM_CNTEN_CNTEN0_Pos) /*!< PWM_T::CNTEN: CNTEN0 Mask */ - -#define PWM_CNTEN_CNTEN2_Pos (2) /*!< PWM_T::CNTEN: CNTEN2 Position */ -#define PWM_CNTEN_CNTEN2_Msk (0x1ul << PWM_CNTEN_CNTEN2_Pos) /*!< PWM_T::CNTEN: CNTEN2 Mask */ - -#define PWM_CNTEN_CNTEN4_Pos (4) /*!< PWM_T::CNTEN: CNTEN4 Position */ -#define PWM_CNTEN_CNTEN4_Msk (0x1ul << PWM_CNTEN_CNTEN4_Pos) /*!< PWM_T::CNTEN: CNTEN4 Mask */ - -#define PWM_CNTCLR_CNTCLR0_Pos (0) /*!< PWM_T::CNTCLR: CNTCLR0 Position */ -#define PWM_CNTCLR_CNTCLR0_Msk (0x1ul << PWM_CNTCLR_CNTCLR0_Pos) /*!< PWM_T::CNTCLR: CNTCLR0 Mask */ - -#define PWM_CNTCLR_CNTCLR2_Pos (2) /*!< PWM_T::CNTCLR: CNTCLR2 Position */ -#define PWM_CNTCLR_CNTCLR2_Msk (0x1ul << PWM_CNTCLR_CNTCLR2_Pos) /*!< PWM_T::CNTCLR: CNTCLR2 Mask */ - -#define PWM_CNTCLR_CNTCLR4_Pos (4) /*!< PWM_T::CNTCLR: CNTCLR4 Position */ -#define PWM_CNTCLR_CNTCLR4_Msk (0x1ul << PWM_CNTCLR_CNTCLR4_Pos) /*!< PWM_T::CNTCLR: CNTCLR4 Mask */ - -#define PWM_PERIOD_PERIOD_Pos (0) /*!< PWM_T::PERIOD: PERIOD Position */ -#define PWM_PERIOD_PERIOD_Msk (0xfffful << PWM_PERIOD_PERIOD_Pos) /*!< PWM_T::PERIOD: PERIOD Mask */ - -#define PWM_CMPDAT_CMP_Pos (0) /*!< PWM_T::CMPDAT: CMP Position */ -#define PWM_CMPDAT_CMP_Msk (0xfffful << PWM_CMPDAT_CMP_Pos) /*!< PWM_T::CMPDAT: CMP Mask */ - -#define PWM_DTCTL_DTCNT_Pos (0) /*!< PWM_T::DTCTL: DTCNT Position */ -#define PWM_DTCTL_DTCNT_Msk (0xffful << PWM_DTCTL_DTCNT_Pos) /*!< PWM_T::DTCTL: DTCNT Mask */ - -#define PWM_DTCTL_DTEN_Pos (16) /*!< PWM_T::DTCTL: DTEN Position */ -#define PWM_DTCTL_DTEN_Msk (0x1ul << PWM_DTCTL_DTEN_Pos) /*!< PWM_T::DTCTL: DTEN Mask */ - -#define PWM_DTCTL_DTCKSEL_Pos (24) /*!< PWM_T::DTCTL: DTCKSEL Position */ -#define PWM_DTCTL_DTCKSEL_Msk (0x1ul << PWM_DTCTL_DTCKSEL_Pos) /*!< PWM_T::DTCTL: DTCKSEL Mask */ - -#define PWM_DTCTL0_1_DTCNT_Pos (0) /*!< PWM_T::DTCTL: DTCNT Position */ -#define PWM_DTCTL0_1_DTCNT_Msk (0xffful << PWM_DTCTL0_1_DTCNT_Pos) /*!< PWM_T::DTCTL: DTCNT Mask */ - -#define PWM_DTCTL0_1_DTEN_Pos (16) /*!< PWM_T::DTCTL: DTEN Position */ -#define PWM_DTCTL0_1_DTEN_Msk (0x1ul << PWM_DTCTL0_1_DTEN_Pos) /*!< PWM_T::DTCTL: DTEN Mask */ - -#define PWM_DTCTL0_1_DTCKSEL_Pos (24) /*!< PWM_T::DTCTL: DTCKSEL Position */ -#define PWM_DTCTL0_1_DTCKSEL_Msk (0x1ul << PWM_DTCTL0_1_DTCKSEL_Pos) /*!< PWM_T::DTCTL: DTCKSEL Mask */ - -#define PWM_DTCTL2_3_DTCNT_Pos (0) /*!< PWM_T::DTCTL: DTCNT Position */ -#define PWM_DTCTL2_3_DTCNT_Msk (0xffful << PWM_DTCTL2_3_DTCNT_Pos) /*!< PWM_T::DTCTL: DTCNT Mask */ - -#define PWM_DTCTL2_3_DTEN_Pos (16) /*!< PWM_T::DTCTL: DTEN Position */ -#define PWM_DTCTL2_3_DTEN_Msk (0x1ul << PWM_DTCTL2_3_DTEN_Pos) /*!< PWM_T::DTCTL: DTEN Mask */ - -#define PWM_DTCTL2_3_DTCKSEL_Pos (24) /*!< PWM_T::DTCTL: DTCKSEL Position */ -#define PWM_DTCTL2_3_DTCKSEL_Msk (0x1ul << PWM_DTCTL2_3_DTCKSEL_Pos) /*!< PWM_T::DTCTL: DTCKSEL Mask */ - -#define PWM_DTCTL4_5_DTCNT_Pos (0) /*!< PWM_T::DTCTL: DTCNT Position */ -#define PWM_DTCTL4_5_DTCNT_Msk (0xffful << PWM_DTCTL4_5_DTCNT_Pos) /*!< PWM_T::DTCTL: DTCNT Mask */ - -#define PWM_DTCTL4_5_DTEN_Pos (16) /*!< PWM_T::DTCTL: DTEN Position */ -#define PWM_DTCTL4_5_DTEN_Msk (0x1ul << PWM_DTCTL4_5_DTEN_Pos) /*!< PWM_T::DTCTL: DTEN Mask */ - -#define PWM_DTCTL4_5_DTCKSEL_Pos (24) /*!< PWM_T::DTCTL: DTCKSEL Position */ -#define PWM_DTCTL4_5_DTCKSEL_Msk (0x1ul << PWM_DTCTL4_5_DTCKSEL_Pos) /*!< PWM_T::DTCTL: DTCKSEL Mask */ - -#define PWM_CNT_CNT_Pos (0) /*!< PWM_T::CNT: CNT Position */ -#define PWM_CNT_CNT_Msk (0xfffful << PWM_CNT_CNT_Pos) /*!< PWM_T::CNT: CNT Mask */ - -#define PWM_CNT_DIRF_Pos (16) /*!< PWM_T::CNT: DIRF Position */ -#define PWM_CNT_DIRF_Msk (0x1ul << PWM_CNT_DIRF_Pos) /*!< PWM_T::CNT: DIRF Mask */ - -#define PWM_WGCTL0_ZPCTL0_Pos (0) /*!< PWM_T::WGCTL0: ZPCTL0 Position */ -#define PWM_WGCTL0_ZPCTL0_Msk (0x3ul << PWM_WGCTL0_ZPCTL0_Pos) /*!< PWM_T::WGCTL0: ZPCTL0 Mask */ - -#define PWM_WGCTL0_ZPCTL1_Pos (2) /*!< PWM_T::WGCTL0: ZPCTL1 Position */ -#define PWM_WGCTL0_ZPCTL1_Msk (0x3ul << PWM_WGCTL0_ZPCTL1_Pos) /*!< PWM_T::WGCTL0: ZPCTL1 Mask */ - -#define PWM_WGCTL0_ZPCTL2_Pos (4) /*!< PWM_T::WGCTL0: ZPCTL2 Position */ -#define PWM_WGCTL0_ZPCTL2_Msk (0x3ul << PWM_WGCTL0_ZPCTL2_Pos) /*!< PWM_T::WGCTL0: ZPCTL2 Mask */ - -#define PWM_WGCTL0_ZPCTL3_Pos (6) /*!< PWM_T::WGCTL0: ZPCTL3 Position */ -#define PWM_WGCTL0_ZPCTL3_Msk (0x3ul << PWM_WGCTL0_ZPCTL3_Pos) /*!< PWM_T::WGCTL0: ZPCTL3 Mask */ - -#define PWM_WGCTL0_ZPCTL4_Pos (8) /*!< PWM_T::WGCTL0: ZPCTL4 Position */ -#define PWM_WGCTL0_ZPCTL4_Msk (0x3ul << PWM_WGCTL0_ZPCTL4_Pos) /*!< PWM_T::WGCTL0: ZPCTL4 Mask */ - -#define PWM_WGCTL0_ZPCTL5_Pos (10) /*!< PWM_T::WGCTL0: ZPCTL5 Position */ -#define PWM_WGCTL0_ZPCTL5_Msk (0x3ul << PWM_WGCTL0_ZPCTL5_Pos) /*!< PWM_T::WGCTL0: ZPCTL5 Mask */ - -#define PWM_WGCTL0_PRDPCTL0_Pos (16) /*!< PWM_T::WGCTL0: PRDPCTL0 Position */ -#define PWM_WGCTL0_PRDPCTL0_Msk (0x3ul << PWM_WGCTL0_PRDPCTL0_Pos) /*!< PWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define PWM_WGCTL0_PRDPCTL1_Pos (18) /*!< PWM_T::WGCTL0: PRDPCTL1 Position */ -#define PWM_WGCTL0_PRDPCTL1_Msk (0x3ul << PWM_WGCTL0_PRDPCTL1_Pos) /*!< PWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define PWM_WGCTL0_PRDPCTL2_Pos (20) /*!< PWM_T::WGCTL0: PRDPCTL2 Position */ -#define PWM_WGCTL0_PRDPCTL2_Msk (0x3ul << PWM_WGCTL0_PRDPCTL2_Pos) /*!< PWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define PWM_WGCTL0_PRDPCTL3_Pos (22) /*!< PWM_T::WGCTL0: PRDPCTL3 Position */ -#define PWM_WGCTL0_PRDPCTL3_Msk (0x3ul << PWM_WGCTL0_PRDPCTL3_Pos) /*!< PWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define PWM_WGCTL0_PRDPCTL4_Pos (24) /*!< PWM_T::WGCTL0: PRDPCTL4 Position */ -#define PWM_WGCTL0_PRDPCTL4_Msk (0x3ul << PWM_WGCTL0_PRDPCTL4_Pos) /*!< PWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define PWM_WGCTL0_PRDPCTL5_Pos (26) /*!< PWM_T::WGCTL0: PRDPCTL5 Position */ -#define PWM_WGCTL0_PRDPCTL5_Msk (0x3ul << PWM_WGCTL0_PRDPCTL5_Pos) /*!< PWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define PWM_WGCTL1_CMPUCTL0_Pos (0) /*!< PWM_T::WGCTL1: CMPUCTL0 Position */ -#define PWM_WGCTL1_CMPUCTL0_Msk (0x3ul << PWM_WGCTL1_CMPUCTL0_Pos) /*!< PWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define PWM_WGCTL1_CMPUCTL1_Pos (2) /*!< PWM_T::WGCTL1: CMPUCTL1 Position */ -#define PWM_WGCTL1_CMPUCTL1_Msk (0x3ul << PWM_WGCTL1_CMPUCTL1_Pos) /*!< PWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define PWM_WGCTL1_CMPUCTL2_Pos (4) /*!< PWM_T::WGCTL1: CMPUCTL2 Position */ -#define PWM_WGCTL1_CMPUCTL2_Msk (0x3ul << PWM_WGCTL1_CMPUCTL2_Pos) /*!< PWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define PWM_WGCTL1_CMPUCTL3_Pos (6) /*!< PWM_T::WGCTL1: CMPUCTL3 Position */ -#define PWM_WGCTL1_CMPUCTL3_Msk (0x3ul << PWM_WGCTL1_CMPUCTL3_Pos) /*!< PWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define PWM_WGCTL1_CMPUCTL4_Pos (8) /*!< PWM_T::WGCTL1: CMPUCTL4 Position */ -#define PWM_WGCTL1_CMPUCTL4_Msk (0x3ul << PWM_WGCTL1_CMPUCTL4_Pos) /*!< PWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define PWM_WGCTL1_CMPUCTL5_Pos (10) /*!< PWM_T::WGCTL1: CMPUCTL5 Position */ -#define PWM_WGCTL1_CMPUCTL5_Msk (0x3ul << PWM_WGCTL1_CMPUCTL5_Pos) /*!< PWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define PWM_WGCTL1_CMPDCTL0_Pos (16) /*!< PWM_T::WGCTL1: CMPDCTL0 Position */ -#define PWM_WGCTL1_CMPDCTL0_Msk (0x3ul << PWM_WGCTL1_CMPDCTL0_Pos) /*!< PWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define PWM_WGCTL1_CMPDCTL1_Pos (18) /*!< PWM_T::WGCTL1: CMPDCTL1 Position */ -#define PWM_WGCTL1_CMPDCTL1_Msk (0x3ul << PWM_WGCTL1_CMPDCTL1_Pos) /*!< PWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define PWM_WGCTL1_CMPDCTL2_Pos (20) /*!< PWM_T::WGCTL1: CMPDCTL2 Position */ -#define PWM_WGCTL1_CMPDCTL2_Msk (0x3ul << PWM_WGCTL1_CMPDCTL2_Pos) /*!< PWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define PWM_WGCTL1_CMPDCTL3_Pos (22) /*!< PWM_T::WGCTL1: CMPDCTL3 Position */ -#define PWM_WGCTL1_CMPDCTL3_Msk (0x3ul << PWM_WGCTL1_CMPDCTL3_Pos) /*!< PWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define PWM_WGCTL1_CMPDCTL4_Pos (24) /*!< PWM_T::WGCTL1: CMPDCTL4 Position */ -#define PWM_WGCTL1_CMPDCTL4_Msk (0x3ul << PWM_WGCTL1_CMPDCTL4_Pos) /*!< PWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define PWM_WGCTL1_CMPDCTL5_Pos (26) /*!< PWM_T::WGCTL1: CMPDCTL5 Position */ -#define PWM_WGCTL1_CMPDCTL5_Msk (0x3ul << PWM_WGCTL1_CMPDCTL5_Pos) /*!< PWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define PWM_MSKEN_MSKEN0_Pos (0) /*!< PWM_T::MSKEN: MSKEN0 Position */ -#define PWM_MSKEN_MSKEN0_Msk (0x1ul << PWM_MSKEN_MSKEN0_Pos) /*!< PWM_T::MSKEN: MSKEN0 Mask */ - -#define PWM_MSKEN_MSKEN1_Pos (1) /*!< PWM_T::MSKEN: MSKEN1 Position */ -#define PWM_MSKEN_MSKEN1_Msk (0x1ul << PWM_MSKEN_MSKEN1_Pos) /*!< PWM_T::MSKEN: MSKEN1 Mask */ - -#define PWM_MSKEN_MSKEN2_Pos (2) /*!< PWM_T::MSKEN: MSKEN2 Position */ -#define PWM_MSKEN_MSKEN2_Msk (0x1ul << PWM_MSKEN_MSKEN2_Pos) /*!< PWM_T::MSKEN: MSKEN2 Mask */ - -#define PWM_MSKEN_MSKEN3_Pos (3) /*!< PWM_T::MSKEN: MSKEN3 Position */ -#define PWM_MSKEN_MSKEN3_Msk (0x1ul << PWM_MSKEN_MSKEN3_Pos) /*!< PWM_T::MSKEN: MSKEN3 Mask */ - -#define PWM_MSKEN_MSKEN4_Pos (4) /*!< PWM_T::MSKEN: MSKEN4 Position */ -#define PWM_MSKEN_MSKEN4_Msk (0x1ul << PWM_MSKEN_MSKEN4_Pos) /*!< PWM_T::MSKEN: MSKEN4 Mask */ - -#define PWM_MSKEN_MSKEN5_Pos (5) /*!< PWM_T::MSKEN: MSKEN5 Position */ -#define PWM_MSKEN_MSKEN5_Msk (0x1ul << PWM_MSKEN_MSKEN5_Pos) /*!< PWM_T::MSKEN: MSKEN5 Mask */ - -#define PWM_MSK_MSKDAT0_Pos (0) /*!< PWM_T::MSK: MSKDAT0 Position */ -#define PWM_MSK_MSKDAT0_Msk (0x1ul << PWM_MSK_MSKDAT0_Pos) /*!< PWM_T::MSK: MSKDAT0 Mask */ - -#define PWM_MSK_MSKDAT1_Pos (1) /*!< PWM_T::MSK: MSKDAT1 Position */ -#define PWM_MSK_MSKDAT1_Msk (0x1ul << PWM_MSK_MSKDAT1_Pos) /*!< PWM_T::MSK: MSKDAT1 Mask */ - -#define PWM_MSK_MSKDAT2_Pos (2) /*!< PWM_T::MSK: MSKDAT2 Position */ -#define PWM_MSK_MSKDAT2_Msk (0x1ul << PWM_MSK_MSKDAT2_Pos) /*!< PWM_T::MSK: MSKDAT2 Mask */ - -#define PWM_MSK_MSKDAT3_Pos (3) /*!< PWM_T::MSK: MSKDAT3 Position */ -#define PWM_MSK_MSKDAT3_Msk (0x1ul << PWM_MSK_MSKDAT3_Pos) /*!< PWM_T::MSK: MSKDAT3 Mask */ - -#define PWM_MSK_MSKDAT4_Pos (4) /*!< PWM_T::MSK: MSKDAT4 Position */ -#define PWM_MSK_MSKDAT4_Msk (0x1ul << PWM_MSK_MSKDAT4_Pos) /*!< PWM_T::MSK: MSKDAT4 Mask */ - -#define PWM_MSK_MSKDAT5_Pos (5) /*!< PWM_T::MSK: MSKDAT5 Position */ -#define PWM_MSK_MSKDAT5_Msk (0x1ul << PWM_MSK_MSKDAT5_Pos) /*!< PWM_T::MSK: MSKDAT5 Mask */ - -#define PWM_BNF_BRK0NFEN_Pos (0) /*!< PWM_T::BNF: BRK0FEN Position */ -#define PWM_BNF_BRK0NFEN_Msk (0x1ul << PWM_BNF_BRK0NFEN_Pos) /*!< PWM_T::BNF: BRK0FEN Mask */ - -#define PWM_BNF_BRK0NFSEL_Pos (1) /*!< PWM_T::BNF: BRK0FCS Position */ -#define PWM_BNF_BRK0NFSEL_Msk (0x7ul << PWM_BNF_BRK0NFSEL_Pos) /*!< PWM_T::BNF: BRK0FCS Mask */ - -#define PWM_BNF_BRK0FCNT_Pos (4) /*!< PWM_T::BNF: BRK0FCNT Position */ -#define PWM_BNF_BRK0FCNT_Msk (0x7ul << PWM_BNF_BRK0FCNT_Pos) /*!< PWM_T::BNF: BRK0FCNT Mask */ - -#define PWM_BNF_BRK0PINV_Pos (7) /*!< PWM_T::BNF: BRK0PINV Position */ -#define PWM_BNF_BRK0PINV_Msk (0x1ul << PWM_BNF_BRK0PINV_Pos) /*!< PWM_T::BNF: BRK0PINV Mask */ - -#define PWM_BNF_BRK1NFEN_Pos (8) /*!< PWM_T::BNF: BRK1FEN Position */ -#define PWM_BNF_BRK1NFEN_Msk (0x1ul << PWM_BNF_BRK1NFEN_Pos) /*!< PWM_T::BNF: BRK1FEN Mask */ - -#define PWM_BNF_BRK1NFSEL_Pos (9) /*!< PWM_T::BNF: BRK1FCS Position */ -#define PWM_BNF_BRK1NFSEL_Msk (0x7ul << PWM_BNF_BRK1NFSEL_Pos) /*!< PWM_T::BNF: BRK1NFSEL Mask */ - -#define PWM_BNF_BRK1FCNT_Pos (12) /*!< PWM_T::BNF: BRK1FCNT Position */ -#define PWM_BNF_BRK1FCNT_Msk (0x7ul << PWM_BNF_BRK1FCNT_Pos) /*!< PWM_T::BNF: BRK1FCNT Mask */ - -#define PWM_BNF_BRK1PINV_Pos (15) /*!< PWM_T::BNF: BRK1PINV Position */ -#define PWM_BNF_BRK1PINV_Msk (0x1ul << PWM_BNF_BRK1PINV_Pos) /*!< PWM_T::BNF: BRK1PINV Mask */ - -#define PWM_BNF_BK0SRC_Pos (16) /*!< PWM_T::BNF: BK0SRC Position */ -#define PWM_BNF_BK0SRC_Msk (0x1ul << PWM_BNF_BK0SRC_Pos) /*!< PWM_T::BNF: BK0SRC Mask */ - -#define PWM_BNF_BK1SRC_Pos (24) /*!< PWM_T::BNF: BK1SRC Position */ -#define PWM_BNF_BK1SRC_Msk (0x1ul << PWM_BNF_BK1SRC_Pos) /*!< PWM_T::BNF: BK1SRC Mask */ - -#define PWM_FAILBRK_CSSBRKEN_Pos (0) /*!< PWM_T::FAILBRK: CSSBRKEN Position */ -#define PWM_FAILBRK_CSSBRKEN_Msk (0x1ul << PWM_FAILBRK_CSSBRKEN_Pos) /*!< PWM_T::FAILBRK: CSSBRKEN Mask */ - -#define PWM_FAILBRK_BODBRKEN_Pos (1) /*!< PWM_T::FAILBRK: BODBRKEN Position */ -#define PWM_FAILBRK_BODBRKEN_Msk (0x1ul << PWM_FAILBRK_BODBRKEN_Pos) /*!< PWM_T::FAILBRK: BODBRKEN Mask */ - -#define PWM_FAILBRK_CORBRKEN_Pos (3) /*!< PWM_T::FAILBRK: CORBRKEN Position */ -#define PWM_FAILBRK_CORBRKEN_Msk (0x1ul << PWM_FAILBRK_CORBRKEN_Pos) /*!< PWM_T::FAILBRK: CORBRKEN Mask */ - -#define PWM_BRKCTL_CPO0EBEN_Pos (0) /*!< PWM_T::BRKCTL: CPO0EBEN Position */ -#define PWM_BRKCTL_CPO0EBEN_Msk (0x1ul << PWM_BRKCTL_CPO0EBEN_Pos) /*!< PWM_T::BRKCTL: CPO0EBEN Mask */ - -#define PWM_BRKCTL_CPO1EBEN_Pos (1) /*!< PWM_T::BRKCTL: CPO1EBEN Position */ -#define PWM_BRKCTL_CPO1EBEN_Msk (0x1ul << PWM_BRKCTL_CPO1EBEN_Pos) /*!< PWM_T::BRKCTL: CPO1EBEN Mask */ - -#define PWM_BRKCTL_BRKP0EEN_Pos (4) /*!< PWM_T::BRKCTL: BRKP0EEN Position */ -#define PWM_BRKCTL_BRKP0EEN_Msk (0x1ul << PWM_BRKCTL_BRKP0EEN_Pos) /*!< PWM_T::BRKCTL: BRKP0EEN Mask */ - -#define PWM_BRKCTL_BRKP1EEN_Pos (5) /*!< PWM_T::BRKCTL: BRKP1EEN Position */ -#define PWM_BRKCTL_BRKP1EEN_Msk (0x1ul << PWM_BRKCTL_BRKP1EEN_Pos) /*!< PWM_T::BRKCTL: BRKP1EEN Mask */ - -#define PWM_BRKCTL_SYSEBEN_Pos (7) /*!< PWM_T::BRKCTL: SYSEBEN Position */ -#define PWM_BRKCTL_SYSEBEN_Msk (0x1ul << PWM_BRKCTL_SYSEBEN_Pos) /*!< PWM_T::BRKCTL: SYSEBEN Mask */ - -#define PWM_BRKCTL_CPO0LBEN_Pos (8) /*!< PWM_T::BRKCTL: CPO0LBEN Position */ -#define PWM_BRKCTL_CPO0LBEN_Msk (0x1ul << PWM_BRKCTL_CPO0LBEN_Pos) /*!< PWM_T::BRKCTL: CPO0LBEN Mask */ - -#define PWM_BRKCTL_CPO1LBEN_Pos (9) /*!< PWM_T::BRKCTL: CPO1LBEN Position */ -#define PWM_BRKCTL_CPO1LBEN_Msk (0x1ul << PWM_BRKCTL_CPO1LBEN_Pos) /*!< PWM_T::BRKCTL: CPO1LBEN Mask */ - -#define PWM_BRKCTL_BRKP0LEN_Pos (12) /*!< PWM_T::BRKCTL: BRKP0LEN Position */ -#define PWM_BRKCTL_BRKP0LEN_Msk (0x1ul << PWM_BRKCTL_BRKP0LEN_Pos) /*!< PWM_T::BRKCTL: BRKP0LEN Mask */ - -#define PWM_BRKCTL_BRKP1LEN_Pos (13) /*!< PWM_T::BRKCTL: BRKP1LEN Position */ -#define PWM_BRKCTL_BRKP1LEN_Msk (0x1ul << PWM_BRKCTL_BRKP1LEN_Pos) /*!< PWM_T::BRKCTL: BRKP1LEN Mask */ - -#define PWM_BRKCTL_SYSLBEN_Pos (15) /*!< PWM_T::BRKCTL: SYSLBEN Position */ -#define PWM_BRKCTL_SYSLBEN_Msk (0x1ul << PWM_BRKCTL_SYSLBEN_Pos) /*!< PWM_T::BRKCTL: SYSLBEN Mask */ - -#define PWM_BRKCTL_BRKAEVEN_Pos (16) /*!< PWM_T::BRKCTL: BRKAEVEN Position */ -#define PWM_BRKCTL_BRKAEVEN_Msk (0x3ul << PWM_BRKCTL_BRKAEVEN_Pos) /*!< PWM_T::BRKCTL: BRKAEVEN Mask */ - -#define PWM_BRKCTL_BRKAODD_Pos (18) /*!< PWM_T::BRKCTL: BRKAODD Position */ -#define PWM_BRKCTL_BRKAODD_Msk (0x3ul << PWM_BRKCTL_BRKAODD_Pos) /*!< PWM_T::BRKCTL: BRKAODD Mask */ - -#define PWM_BRKCTL0_1_CPO0EBEN_Pos (0) /*!< PWM_T::BRKCTL: CPO0EBEN Position */ -#define PWM_BRKCTL0_1_CPO0EBEN_Msk (0x1ul << PWM_BRKCTL0_1_CPO0EBEN_Pos) /*!< PWM_T::BRKCTL: CPO0EBEN Mask */ - -#define PWM_BRKCTL0_1_CPO1EBEN_Pos (1) /*!< PWM_T::BRKCTL: CPO1EBEN Position */ -#define PWM_BRKCTL0_1_CPO1EBEN_Msk (0x1ul << PWM_BRKCTL0_1_CPO1EBEN_Pos) /*!< PWM_T::BRKCTL: CPO1EBEN Mask */ - -#define PWM_BRKCTL0_1_BRKP0EEN_Pos (4) /*!< PWM_T::BRKCTL: BRKP0EEN Position */ -#define PWM_BRKCTL0_1_BRKP0EEN_Msk (0x1ul << PWM_BRKCTL0_1_BRKP0EEN_Pos) /*!< PWM_T::BRKCTL: BRKP0EEN Mask */ - -#define PWM_BRKCTL0_1_BRKP1EEN_Pos (5) /*!< PWM_T::BRKCTL: BRKP1EEN Position */ -#define PWM_BRKCTL0_1_BRKP1EEN_Msk (0x1ul << PWM_BRKCTL0_1_BRKP1EEN_Pos) /*!< PWM_T::BRKCTL: BRKP1EEN Mask */ - -#define PWM_BRKCTL0_1_SYSEBEN_Pos (7) /*!< PWM_T::BRKCTL: SYSEBEN Position */ -#define PWM_BRKCTL0_1_SYSEBEN_Msk (0x1ul << PWM_BRKCTL0_1_SYSEBEN_Pos) /*!< PWM_T::BRKCTL: SYSEBEN Mask */ - -#define PWM_BRKCTL0_1_CPO0LBEN_Pos (8) /*!< PWM_T::BRKCTL: CPO0LBEN Position */ -#define PWM_BRKCTL0_1_CPO0LBEN_Msk (0x1ul << PWM_BRKCTL0_1_CPO0LBEN_Pos) /*!< PWM_T::BRKCTL: CPO0LBEN Mask */ - -#define PWM_BRKCTL0_1_CPO1LBEN_Pos (9) /*!< PWM_T::BRKCTL: CPO1LBEN Position */ -#define PWM_BRKCTL0_1_CPO1LBEN_Msk (0x1ul << PWM_BRKCTL0_1_CPO1LBEN_Pos) /*!< PWM_T::BRKCTL: CPO1LBEN Mask */ - -#define PWM_BRKCTL0_1_BRKP0LEN_Pos (12) /*!< PWM_T::BRKCTL: BRKP0LEN Position */ -#define PWM_BRKCTL0_1_BRKP0LEN_Msk (0x1ul << PWM_BRKCTL0_1_BRKP0LEN_Pos) /*!< PWM_T::BRKCTL: BRKP0LEN Mask */ - -#define PWM_BRKCTL0_1_BRKP1LEN_Pos (13) /*!< PWM_T::BRKCTL: BRKP1LEN Position */ -#define PWM_BRKCTL0_1_BRKP1LEN_Msk (0x1ul << PWM_BRKCTL0_1_BRKP1LEN_Pos) /*!< PWM_T::BRKCTL: BRKP1LEN Mask */ - -#define PWM_BRKCTL0_1_SYSLBEN_Pos (15) /*!< PWM_T::BRKCTL: SYSLBEN Position */ -#define PWM_BRKCTL0_1_SYSLBEN_Msk (0x1ul << PWM_BRKCTL0_1_SYSLBEN_Pos) /*!< PWM_T::BRKCTL: SYSLBEN Mask */ - -#define PWM_BRKCTL0_1_BRKAEVEN_Pos (16) /*!< PWM_T::BRKCTL: BRKAEVEN Position */ -#define PWM_BRKCTL0_1_BRKAEVEN_Msk (0x3ul << PWM_BRKCTL0_1_BRKAEVEN_Pos) /*!< PWM_T::BRKCTL: BRKAEVEN Mask */ - -#define PWM_BRKCTL0_1_BRKAODD_Pos (18) /*!< PWM_T::BRKCTL: BRKAODD Position */ -#define PWM_BRKCTL0_1_BRKAODD_Msk (0x3ul << PWM_BRKCTL0_1_BRKAODD_Pos) /*!< PWM_T::BRKCTL: BRKAODD Mask */ - -#define PWM_BRKCTL2_3_CPO0EBEN_Pos (0) /*!< PWM_T::BRKCTL: CPO0EBEN Position */ -#define PWM_BRKCTL2_3_CPO0EBEN_Msk (0x1ul << PWM_BRKCTL2_3_CPO0EBEN_Pos) /*!< PWM_T::BRKCTL: CPO0EBEN Mask */ - -#define PWM_BRKCTL2_3_CPO1EBEN_Pos (1) /*!< PWM_T::BRKCTL: CPO1EBEN Position */ -#define PWM_BRKCTL2_3_CPO1EBEN_Msk (0x1ul << PWM_BRKCTL2_3_CPO1EBEN_Pos) /*!< PWM_T::BRKCTL: CPO1EBEN Mask */ - -#define PWM_BRKCTL2_3_BRKP0EEN_Pos (4) /*!< PWM_T::BRKCTL: BRKP0EEN Position */ -#define PWM_BRKCTL2_3_BRKP0EEN_Msk (0x1ul << PWM_BRKCTL2_3_BRKP0EEN_Pos) /*!< PWM_T::BRKCTL: BRKP0EEN Mask */ - -#define PWM_BRKCTL2_3_BRKP1EEN_Pos (5) /*!< PWM_T::BRKCTL: BRKP1EEN Position */ -#define PWM_BRKCTL2_3_BRKP1EEN_Msk (0x1ul << PWM_BRKCTL2_3_BRKP1EEN_Pos) /*!< PWM_T::BRKCTL: BRKP1EEN Mask */ - -#define PWM_BRKCTL2_3_SYSEBEN_Pos (7) /*!< PWM_T::BRKCTL: SYSEBEN Position */ -#define PWM_BRKCTL2_3_SYSEBEN_Msk (0x1ul << PWM_BRKCTL2_3_SYSEBEN_Pos) /*!< PWM_T::BRKCTL: SYSEBEN Mask */ - -#define PWM_BRKCTL2_3_CPO0LBEN_Pos (8) /*!< PWM_T::BRKCTL: CPO0LBEN Position */ -#define PWM_BRKCTL2_3_CPO0LBEN_Msk (0x1ul << PWM_BRKCTL2_3_CPO0LBEN_Pos) /*!< PWM_T::BRKCTL: CPO0LBEN Mask */ - -#define PWM_BRKCTL2_3_CPO1LBEN_Pos (9) /*!< PWM_T::BRKCTL: CPO1LBEN Position */ -#define PWM_BRKCTL2_3_CPO1LBEN_Msk (0x1ul << PWM_BRKCTL2_3_CPO1LBEN_Pos) /*!< PWM_T::BRKCTL: CPO1LBEN Mask */ - -#define PWM_BRKCTL2_3_BRKP0LEN_Pos (12) /*!< PWM_T::BRKCTL: BRKP0LEN Position */ -#define PWM_BRKCTL2_3_BRKP0LEN_Msk (0x1ul << PWM_BRKCTL2_3_BRKP0LEN_Pos) /*!< PWM_T::BRKCTL: BRKP0LEN Mask */ - -#define PWM_BRKCTL2_3_BRKP1LEN_Pos (13) /*!< PWM_T::BRKCTL: BRKP1LEN Position */ -#define PWM_BRKCTL2_3_BRKP1LEN_Msk (0x1ul << PWM_BRKCTL2_3_BRKP1LEN_Pos) /*!< PWM_T::BRKCTL: BRKP1LEN Mask */ - -#define PWM_BRKCTL2_3_SYSLBEN_Pos (15) /*!< PWM_T::BRKCTL: SYSLBEN Position */ -#define PWM_BRKCTL2_3_SYSLBEN_Msk (0x1ul << PWM_BRKCTL2_3_SYSLBEN_Pos) /*!< PWM_T::BRKCTL: SYSLBEN Mask */ - -#define PWM_BRKCTL2_3_BRKAEVEN_Pos (16) /*!< PWM_T::BRKCTL: BRKAEVEN Position */ -#define PWM_BRKCTL2_3_BRKAEVEN_Msk (0x3ul << PWM_BRKCTL2_3_BRKAEVEN_Pos) /*!< PWM_T::BRKCTL: BRKAEVEN Mask */ - -#define PWM_BRKCTL2_3_BRKAODD_Pos (18) /*!< PWM_T::BRKCTL: BRKAODD Position */ -#define PWM_BRKCTL2_3_BRKAODD_Msk (0x3ul << PWM_BRKCTL2_3_BRKAODD_Pos) /*!< PWM_T::BRKCTL: BRKAODD Mask */ - -#define PWM_BRKCTL4_5_CPO0EBEN_Pos (0) /*!< PWM_T::BRKCTL: CPO0EBEN Position */ -#define PWM_BRKCTL4_5_CPO0EBEN_Msk (0x1ul << PWM_BRKCTL4_5_CPO0EBEN_Pos) /*!< PWM_T::BRKCTL: CPO0EBEN Mask */ - -#define PWM_BRKCTL4_5_CPO1EBEN_Pos (1) /*!< PWM_T::BRKCTL: CPO1EBEN Position */ -#define PWM_BRKCTL4_5_CPO1EBEN_Msk (0x1ul << PWM_BRKCTL4_5_CPO1EBEN_Pos) /*!< PWM_T::BRKCTL: CPO1EBEN Mask */ - -#define PWM_BRKCTL4_5_BRKP0EEN_Pos (4) /*!< PWM_T::BRKCTL: BRKP0EEN Position */ -#define PWM_BRKCTL4_5_BRKP0EEN_Msk (0x1ul << PWM_BRKCTL4_5_BRKP0EEN_Pos) /*!< PWM_T::BRKCTL: BRKP0EEN Mask */ - -#define PWM_BRKCTL4_5_BRKP1EEN_Pos (5) /*!< PWM_T::BRKCTL: BRKP1EEN Position */ -#define PWM_BRKCTL4_5_BRKP1EEN_Msk (0x1ul << PWM_BRKCTL4_5_BRKP1EEN_Pos) /*!< PWM_T::BRKCTL: BRKP1EEN Mask */ - -#define PWM_BRKCTL4_5_SYSEBEN_Pos (7) /*!< PWM_T::BRKCTL: SYSEBEN Position */ -#define PWM_BRKCTL4_5_SYSEBEN_Msk (0x1ul << PWM_BRKCTL4_5_SYSEBEN_Pos) /*!< PWM_T::BRKCTL: SYSEBEN Mask */ - -#define PWM_BRKCTL4_5_CPO0LBEN_Pos (8) /*!< PWM_T::BRKCTL: CPO0LBEN Position */ -#define PWM_BRKCTL4_5_CPO0LBEN_Msk (0x1ul << PWM_BRKCTL4_5_CPO0LBEN_Pos) /*!< PWM_T::BRKCTL: CPO0LBEN Mask */ - -#define PWM_BRKCTL4_5_CPO1LBEN_Pos (9) /*!< PWM_T::BRKCTL: CPO1LBEN Position */ -#define PWM_BRKCTL4_5_CPO1LBEN_Msk (0x1ul << PWM_BRKCTL4_5_CPO1LBEN_Pos) /*!< PWM_T::BRKCTL: CPO1LBEN Mask */ - -#define PWM_BRKCTL4_5_BRKP0LEN_Pos (12) /*!< PWM_T::BRKCTL: BRKP0LEN Position */ -#define PWM_BRKCTL4_5_BRKP0LEN_Msk (0x1ul << PWM_BRKCTL4_5_BRKP0LEN_Pos) /*!< PWM_T::BRKCTL: BRKP0LEN Mask */ - -#define PWM_BRKCTL4_5_BRKP1LEN_Pos (13) /*!< PWM_T::BRKCTL: BRKP1LEN Position */ -#define PWM_BRKCTL4_5_BRKP1LEN_Msk (0x1ul << PWM_BRKCTL4_5_BRKP1LEN_Pos) /*!< PWM_T::BRKCTL: BRKP1LEN Mask */ - -#define PWM_BRKCTL4_5_SYSLBEN_Pos (15) /*!< PWM_T::BRKCTL: SYSLBEN Position */ -#define PWM_BRKCTL4_5_SYSLBEN_Msk (0x1ul << PWM_BRKCTL4_5_SYSLBEN_Pos) /*!< PWM_T::BRKCTL: SYSLBEN Mask */ - -#define PWM_BRKCTL4_5_BRKAEVEN_Pos (16) /*!< PWM_T::BRKCTL: BRKAEVEN Position */ -#define PWM_BRKCTL4_5_BRKAEVEN_Msk (0x3ul << PWM_BRKCTL4_5_BRKAEVEN_Pos) /*!< PWM_T::BRKCTL: BRKAEVEN Mask */ - -#define PWM_BRKCTL4_5_BRKAODD_Pos (18) /*!< PWM_T::BRKCTL: BRKAODD Position */ -#define PWM_BRKCTL4_5_BRKAODD_Msk (0x3ul << PWM_BRKCTL4_5_BRKAODD_Pos) /*!< PWM_T::BRKCTL: BRKAODD Mask */ - -#define PWM_POLCTL_PINV0_Pos (0) /*!< PWM_T::POLCTL: PINV0 Position */ -#define PWM_POLCTL_PINV0_Msk (0x1ul << PWM_POLCTL_PINV0_Pos) /*!< PWM_T::POLCTL: PINV0 Mask */ - -#define PWM_POLCTL_PINV1_Pos (1) /*!< PWM_T::POLCTL: PINV1 Position */ -#define PWM_POLCTL_PINV1_Msk (0x1ul << PWM_POLCTL_PINV1_Pos) /*!< PWM_T::POLCTL: PINV1 Mask */ - -#define PWM_POLCTL_PINV2_Pos (2) /*!< PWM_T::POLCTL: PINV2 Position */ -#define PWM_POLCTL_PINV2_Msk (0x1ul << PWM_POLCTL_PINV2_Pos) /*!< PWM_T::POLCTL: PINV2 Mask */ - -#define PWM_POLCTL_PINV3_Pos (3) /*!< PWM_T::POLCTL: PINV3 Position */ -#define PWM_POLCTL_PINV3_Msk (0x1ul << PWM_POLCTL_PINV3_Pos) /*!< PWM_T::POLCTL: PINV3 Mask */ - -#define PWM_POLCTL_PINV4_Pos (4) /*!< PWM_T::POLCTL: PINV4 Position */ -#define PWM_POLCTL_PINV4_Msk (0x1ul << PWM_POLCTL_PINV4_Pos) /*!< PWM_T::POLCTL: PINV4 Mask */ - -#define PWM_POLCTL_PINV5_Pos (5) /*!< PWM_T::POLCTL: PINV5 Position */ -#define PWM_POLCTL_PINV5_Msk (0x1ul << PWM_POLCTL_PINV5_Pos) /*!< PWM_T::POLCTL: PINV5 Mask */ - -#define PWM_POEN_POEN0_Pos (0) /*!< PWM_T::POEN: POEN0 Position */ -#define PWM_POEN_POEN0_Msk (0x1ul << PWM_POEN_POEN0_Pos) /*!< PWM_T::POEN: POEN0 Mask */ - -#define PWM_POEN_POEN1_Pos (1) /*!< PWM_T::POEN: POEN1 Position */ -#define PWM_POEN_POEN1_Msk (0x1ul << PWM_POEN_POEN1_Pos) /*!< PWM_T::POEN: POEN1 Mask */ - -#define PWM_POEN_POEN2_Pos (2) /*!< PWM_T::POEN: POEN2 Position */ -#define PWM_POEN_POEN2_Msk (0x1ul << PWM_POEN_POEN2_Pos) /*!< PWM_T::POEN: POEN2 Mask */ - -#define PWM_POEN_POEN3_Pos (3) /*!< PWM_T::POEN: POEN3 Position */ -#define PWM_POEN_POEN3_Msk (0x1ul << PWM_POEN_POEN3_Pos) /*!< PWM_T::POEN: POEN3 Mask */ - -#define PWM_POEN_POEN4_Pos (4) /*!< PWM_T::POEN: POEN4 Position */ -#define PWM_POEN_POEN4_Msk (0x1ul << PWM_POEN_POEN4_Pos) /*!< PWM_T::POEN: POEN4 Mask */ - -#define PWM_POEN_POEN5_Pos (5) /*!< PWM_T::POEN: POEN5 Position */ -#define PWM_POEN_POEN5_Msk (0x1ul << PWM_POEN_POEN5_Pos) /*!< PWM_T::POEN: POEN5 Mask */ - -#define PWM_SWBRK_BRKETRG0_Pos (0) /*!< PWM_T::SWBRK: BRKETRG0 Position */ -#define PWM_SWBRK_BRKETRG0_Msk (0x1ul << PWM_SWBRK_BRKETRG0_Pos) /*!< PWM_T::SWBRK: BRKETRG0 Mask */ - -#define PWM_SWBRK_BRKETRG2_Pos (1) /*!< PWM_T::SWBRK: BRKETRG2 Position */ -#define PWM_SWBRK_BRKETRG2_Msk (0x1ul << PWM_SWBRK_BRKETRG2_Pos) /*!< PWM_T::SWBRK: BRKETRG2 Mask */ - -#define PWM_SWBRK_BRKETRG4_Pos (2) /*!< PWM_T::SWBRK: BRKETRG4 Position */ -#define PWM_SWBRK_BRKETRG4_Msk (0x1ul << PWM_SWBRK_BRKETRG4_Pos) /*!< PWM_T::SWBRK: BRKETRG4 Mask */ - -#define PWM_SWBRK_BRKLTRG0_Pos (8) /*!< PWM_T::SWBRK: BRKLTRG0 Position */ -#define PWM_SWBRK_BRKLTRG0_Msk (0x1ul << PWM_SWBRK_BRKLTRG0_Pos) /*!< PWM_T::SWBRK: BRKLTRG0 Mask */ - -#define PWM_SWBRK_BRKLTRG2_Pos (9) /*!< PWM_T::SWBRK: BRKLTRG2 Position */ -#define PWM_SWBRK_BRKLTRG2_Msk (0x1ul << PWM_SWBRK_BRKLTRG2_Pos) /*!< PWM_T::SWBRK: BRKLTRG2 Mask */ - -#define PWM_SWBRK_BRKLTRG4_Pos (10) /*!< PWM_T::SWBRK: BRKLTRG4 Position */ -#define PWM_SWBRK_BRKLTRG4_Msk (0x1ul << PWM_SWBRK_BRKLTRG4_Pos) /*!< PWM_T::SWBRK: BRKLTRG4 Mask */ - -#define PWM_INTEN0_ZIEN0_Pos (0) /*!< PWM_T::INTEN0: ZIEN0 Position */ -#define PWM_INTEN0_ZIEN0_Msk (0x1ul << PWM_INTEN0_ZIEN0_Pos) /*!< PWM_T::INTEN0: ZIEN0 Mask */ - -#define PWM_INTEN0_ZIEN2_Pos (2) /*!< PWM_T::INTEN0: ZIEN2 Position */ -#define PWM_INTEN0_ZIEN2_Msk (0x1ul << PWM_INTEN0_ZIEN2_Pos) /*!< PWM_T::INTEN0: ZIEN2 Mask */ - -#define PWM_INTEN0_ZIEN4_Pos (4) /*!< PWM_T::INTEN0: ZIEN4 Position */ -#define PWM_INTEN0_ZIEN4_Msk (0x1ul << PWM_INTEN0_ZIEN4_Pos) /*!< PWM_T::INTEN0: ZIEN4 Mask */ - -#define PWM_INTEN0_PIEN0_Pos (8) /*!< PWM_T::INTEN0: PIEN0 Position */ -#define PWM_INTEN0_PIEN0_Msk (0x1ul << PWM_INTEN0_PIEN0_Pos) /*!< PWM_T::INTEN0: PIEN0 Mask */ - -#define PWM_INTEN0_PIEN2_Pos (10) /*!< PWM_T::INTEN0: PIEN2 Position */ -#define PWM_INTEN0_PIEN2_Msk (0x1ul << PWM_INTEN0_PIEN2_Pos) /*!< PWM_T::INTEN0: PIEN2 Mask */ - -#define PWM_INTEN0_PIEN4_Pos (12) /*!< PWM_T::INTEN0: PIEN4 Position */ -#define PWM_INTEN0_PIEN4_Msk (0x1ul << PWM_INTEN0_PIEN4_Pos) /*!< PWM_T::INTEN0: PIEN4 Mask */ - -#define PWM_INTEN0_CMPUIEN0_Pos (16) /*!< PWM_T::INTEN0: CMPUIEN0 Position */ -#define PWM_INTEN0_CMPUIEN0_Msk (0x1ul << PWM_INTEN0_CMPUIEN0_Pos) /*!< PWM_T::INTEN0: CMPUIEN0 Mask */ - -#define PWM_INTEN0_CMPUIEN1_Pos (17) /*!< PWM_T::INTEN0: CMPUIEN1 Position */ -#define PWM_INTEN0_CMPUIEN1_Msk (0x1ul << PWM_INTEN0_CMPUIEN1_Pos) /*!< PWM_T::INTEN0: CMPUIEN1 Mask */ - -#define PWM_INTEN0_CMPUIEN2_Pos (18) /*!< PWM_T::INTEN0: CMPUIEN2 Position */ -#define PWM_INTEN0_CMPUIEN2_Msk (0x1ul << PWM_INTEN0_CMPUIEN2_Pos) /*!< PWM_T::INTEN0: CMPUIEN2 Mask */ - -#define PWM_INTEN0_CMPUIEN3_Pos (19) /*!< PWM_T::INTEN0: CMPUIEN3 Position */ -#define PWM_INTEN0_CMPUIEN3_Msk (0x1ul << PWM_INTEN0_CMPUIEN3_Pos) /*!< PWM_T::INTEN0: CMPUIEN3 Mask */ - -#define PWM_INTEN0_CMPUIEN4_Pos (20) /*!< PWM_T::INTEN0: CMPUIEN4 Position */ -#define PWM_INTEN0_CMPUIEN4_Msk (0x1ul << PWM_INTEN0_CMPUIEN4_Pos) /*!< PWM_T::INTEN0: CMPUIEN4 Mask */ - -#define PWM_INTEN0_CMPUIEN5_Pos (21) /*!< PWM_T::INTEN0: CMPUIEN5 Position */ -#define PWM_INTEN0_CMPUIEN5_Msk (0x1ul << PWM_INTEN0_CMPUIEN5_Pos) /*!< PWM_T::INTEN0: CMPUIEN5 Mask */ - -#define PWM_INTEN0_CMPDIEN0_Pos (24) /*!< PWM_T::INTEN0: CMPDIEN0 Position */ -#define PWM_INTEN0_CMPDIEN0_Msk (0x1ul << PWM_INTEN0_CMPDIEN0_Pos) /*!< PWM_T::INTEN0: CMPDIEN0 Mask */ - -#define PWM_INTEN0_CMPDIEN1_Pos (25) /*!< PWM_T::INTEN0: CMPDIEN1 Position */ -#define PWM_INTEN0_CMPDIEN1_Msk (0x1ul << PWM_INTEN0_CMPDIEN1_Pos) /*!< PWM_T::INTEN0: CMPDIEN1 Mask */ - -#define PWM_INTEN0_CMPDIEN2_Pos (26) /*!< PWM_T::INTEN0: CMPDIEN2 Position */ -#define PWM_INTEN0_CMPDIEN2_Msk (0x1ul << PWM_INTEN0_CMPDIEN2_Pos) /*!< PWM_T::INTEN0: CMPDIEN2 Mask */ - -#define PWM_INTEN0_CMPDIEN3_Pos (27) /*!< PWM_T::INTEN0: CMPDIEN3 Position */ -#define PWM_INTEN0_CMPDIEN3_Msk (0x1ul << PWM_INTEN0_CMPDIEN3_Pos) /*!< PWM_T::INTEN0: CMPDIEN3 Mask */ - -#define PWM_INTEN0_CMPDIEN4_Pos (28) /*!< PWM_T::INTEN0: CMPDIEN4 Position */ -#define PWM_INTEN0_CMPDIEN4_Msk (0x1ul << PWM_INTEN0_CMPDIEN4_Pos) /*!< PWM_T::INTEN0: CMPDIEN4 Mask */ - -#define PWM_INTEN0_CMPDIEN5_Pos (29) /*!< PWM_T::INTEN0: CMPDIEN5 Position */ -#define PWM_INTEN0_CMPDIEN5_Msk (0x1ul << PWM_INTEN0_CMPDIEN5_Pos) /*!< PWM_T::INTEN0: CMPDIEN5 Mask */ - -#define PWM_INTEN1_BRKEIEN0_1_Pos (0) /*!< PWM_T::INTEN1: BRKEIEN0_1 Position */ -#define PWM_INTEN1_BRKEIEN0_1_Msk (0x1ul << PWM_INTEN1_BRKEIEN0_1_Pos) /*!< PWM_T::INTEN1: BRKEIEN0_1 Mask */ - -#define PWM_INTEN1_BRKEIEN2_3_Pos (1) /*!< PWM_T::INTEN1: BRKEIEN2_3 Position */ -#define PWM_INTEN1_BRKEIEN2_3_Msk (0x1ul << PWM_INTEN1_BRKEIEN2_3_Pos) /*!< PWM_T::INTEN1: BRKEIEN2_3 Mask */ - -#define PWM_INTEN1_BRKEIEN4_5_Pos (2) /*!< PWM_T::INTEN1: BRKEIEN4_5 Position */ -#define PWM_INTEN1_BRKEIEN4_5_Msk (0x1ul << PWM_INTEN1_BRKEIEN4_5_Pos) /*!< PWM_T::INTEN1: BRKEIEN4_5 Mask */ - -#define PWM_INTEN1_BRKLIEN0_1_Pos (8) /*!< PWM_T::INTEN1: BRKLIEN0_1 Position */ -#define PWM_INTEN1_BRKLIEN0_1_Msk (0x1ul << PWM_INTEN1_BRKLIEN0_1_Pos) /*!< PWM_T::INTEN1: BRKLIEN0_1 Mask */ - -#define PWM_INTEN1_BRKLIEN2_3_Pos (9) /*!< PWM_T::INTEN1: BRKLIEN2_3 Position */ -#define PWM_INTEN1_BRKLIEN2_3_Msk (0x1ul << PWM_INTEN1_BRKLIEN2_3_Pos) /*!< PWM_T::INTEN1: BRKLIEN2_3 Mask */ - -#define PWM_INTEN1_BRKLIEN4_5_Pos (10) /*!< PWM_T::INTEN1: BRKLIEN4_5 Position */ -#define PWM_INTEN1_BRKLIEN4_5_Msk (0x1ul << PWM_INTEN1_BRKLIEN4_5_Pos) /*!< PWM_T::INTEN1: BRKLIEN4_5 Mask */ - -#define PWM_INTSTS0_ZIF0_Pos (0) /*!< PWM_T::INTSTS0: ZIF0 Position */ -#define PWM_INTSTS0_ZIF0_Msk (0x1ul << PWM_INTSTS0_ZIF0_Pos) /*!< PWM_T::INTSTS0: ZIF0 Mask */ - -#define PWM_INTSTS0_ZIF2_Pos (2) /*!< PWM_T::INTSTS0: ZIF2 Position */ -#define PWM_INTSTS0_ZIF2_Msk (0x1ul << PWM_INTSTS0_ZIF2_Pos) /*!< PWM_T::INTSTS0: ZIF2 Mask */ - -#define PWM_INTSTS0_ZIF4_Pos (4) /*!< PWM_T::INTSTS0: ZIF4 Position */ -#define PWM_INTSTS0_ZIF4_Msk (0x1ul << PWM_INTSTS0_ZIF4_Pos) /*!< PWM_T::INTSTS0: ZIF4 Mask */ - -#define PWM_INTSTS0_PIF0_Pos (8) /*!< PWM_T::INTSTS0: PIF0 Position */ -#define PWM_INTSTS0_PIF0_Msk (0x1ul << PWM_INTSTS0_PIF0_Pos) /*!< PWM_T::INTSTS0: PIF0 Mask */ - -#define PWM_INTSTS0_PIF2_Pos (10) /*!< PWM_T::INTSTS0: PIF2 Position */ -#define PWM_INTSTS0_PIF2_Msk (0x1ul << PWM_INTSTS0_PIF2_Pos) /*!< PWM_T::INTSTS0: PIF2 Mask */ - -#define PWM_INTSTS0_PIF4_Pos (12) /*!< PWM_T::INTSTS0: PIF4 Position */ -#define PWM_INTSTS0_PIF4_Msk (0x1ul << PWM_INTSTS0_PIF4_Pos) /*!< PWM_T::INTSTS0: PIF4 Mask */ - -#define PWM_INTSTS0_CMPUIF0_Pos (16) /*!< PWM_T::INTSTS0: CMPUIF0 Position */ -#define PWM_INTSTS0_CMPUIF0_Msk (0x1ul << PWM_INTSTS0_CMPUIF0_Pos) /*!< PWM_T::INTSTS0: CMPUIF0 Mask */ - -#define PWM_INTSTS0_CMPUIF1_Pos (17) /*!< PWM_T::INTSTS0: CMPUIF1 Position */ -#define PWM_INTSTS0_CMPUIF1_Msk (0x1ul << PWM_INTSTS0_CMPUIF1_Pos) /*!< PWM_T::INTSTS0: CMPUIF1 Mask */ - -#define PWM_INTSTS0_CMPUIF2_Pos (18) /*!< PWM_T::INTSTS0: CMPUIF2 Position */ -#define PWM_INTSTS0_CMPUIF2_Msk (0x1ul << PWM_INTSTS0_CMPUIF2_Pos) /*!< PWM_T::INTSTS0: CMPUIF2 Mask */ - -#define PWM_INTSTS0_CMPUIF3_Pos (19) /*!< PWM_T::INTSTS0: CMPUIF3 Position */ -#define PWM_INTSTS0_CMPUIF3_Msk (0x1ul << PWM_INTSTS0_CMPUIF3_Pos) /*!< PWM_T::INTSTS0: CMPUIF3 Mask */ - -#define PWM_INTSTS0_CMPUIF4_Pos (20) /*!< PWM_T::INTSTS0: CMPUIF4 Position */ -#define PWM_INTSTS0_CMPUIF4_Msk (0x1ul << PWM_INTSTS0_CMPUIF4_Pos) /*!< PWM_T::INTSTS0: CMPUIF4 Mask */ - -#define PWM_INTSTS0_CMPUIF5_Pos (21) /*!< PWM_T::INTSTS0: CMPUIF5 Position */ -#define PWM_INTSTS0_CMPUIF5_Msk (0x1ul << PWM_INTSTS0_CMPUIF5_Pos) /*!< PWM_T::INTSTS0: CMPUIF5 Mask */ - -#define PWM_INTSTS0_CMPDIF0_Pos (24) /*!< PWM_T::INTSTS0: CMPDIF0 Position */ -#define PWM_INTSTS0_CMPDIF0_Msk (0x1ul << PWM_INTSTS0_CMPDIF0_Pos) /*!< PWM_T::INTSTS0: CMPDIF0 Mask */ - -#define PWM_INTSTS0_CMPDIF1_Pos (25) /*!< PWM_T::INTSTS0: CMPDIF1 Position */ -#define PWM_INTSTS0_CMPDIF1_Msk (0x1ul << PWM_INTSTS0_CMPDIF1_Pos) /*!< PWM_T::INTSTS0: CMPDIF1 Mask */ - -#define PWM_INTSTS0_CMPDIF2_Pos (26) /*!< PWM_T::INTSTS0: CMPDIF2 Position */ -#define PWM_INTSTS0_CMPDIF2_Msk (0x1ul << PWM_INTSTS0_CMPDIF2_Pos) /*!< PWM_T::INTSTS0: CMPDIF2 Mask */ - -#define PWM_INTSTS0_CMPDIF3_Pos (27) /*!< PWM_T::INTSTS0: CMPDIF3 Position */ -#define PWM_INTSTS0_CMPDIF3_Msk (0x1ul << PWM_INTSTS0_CMPDIF3_Pos) /*!< PWM_T::INTSTS0: CMPDIF3 Mask */ - -#define PWM_INTSTS0_CMPDIF4_Pos (28) /*!< PWM_T::INTSTS0: CMPDIF4 Position */ -#define PWM_INTSTS0_CMPDIF4_Msk (0x1ul << PWM_INTSTS0_CMPDIF4_Pos) /*!< PWM_T::INTSTS0: CMPDIF4 Mask */ - -#define PWM_INTSTS0_CMPDIF5_Pos (29) /*!< PWM_T::INTSTS0: CMPDIF5 Position */ -#define PWM_INTSTS0_CMPDIF5_Msk (0x1ul << PWM_INTSTS0_CMPDIF5_Pos) /*!< PWM_T::INTSTS0: CMPDIF5 Mask */ - -#define PWM_INTSTS1_BRKEIF0_Pos (0) /*!< PWM_T::INTSTS1: BRKEIF0 Position */ -#define PWM_INTSTS1_BRKEIF0_Msk (0x1ul << PWM_INTSTS1_BRKEIF0_Pos) /*!< PWM_T::INTSTS1: BRKEIF0 Mask */ - -#define PWM_INTSTS1_BRKEIF1_Pos (1) /*!< PWM_T::INTSTS1: BRKEIF1 Position */ -#define PWM_INTSTS1_BRKEIF1_Msk (0x1ul << PWM_INTSTS1_BRKEIF1_Pos) /*!< PWM_T::INTSTS1: BRKEIF1 Mask */ - -#define PWM_INTSTS1_BRKEIF2_Pos (2) /*!< PWM_T::INTSTS1: BRKEIF2 Position */ -#define PWM_INTSTS1_BRKEIF2_Msk (0x1ul << PWM_INTSTS1_BRKEIF2_Pos) /*!< PWM_T::INTSTS1: BRKEIF2 Mask */ - -#define PWM_INTSTS1_BRKEIF3_Pos (3) /*!< PWM_T::INTSTS1: BRKEIF3 Position */ -#define PWM_INTSTS1_BRKEIF3_Msk (0x1ul << PWM_INTSTS1_BRKEIF3_Pos) /*!< PWM_T::INTSTS1: BRKEIF3 Mask */ - -#define PWM_INTSTS1_BRKEIF4_Pos (4) /*!< PWM_T::INTSTS1: BRKEIF4 Position */ -#define PWM_INTSTS1_BRKEIF4_Msk (0x1ul << PWM_INTSTS1_BRKEIF4_Pos) /*!< PWM_T::INTSTS1: BRKEIF4 Mask */ - -#define PWM_INTSTS1_BRKEIF5_Pos (5) /*!< PWM_T::INTSTS1: BRKEIF5 Position */ -#define PWM_INTSTS1_BRKEIF5_Msk (0x1ul << PWM_INTSTS1_BRKEIF5_Pos) /*!< PWM_T::INTSTS1: BRKEIF5 Mask */ - -#define PWM_INTSTS1_BRKLIF0_Pos (8) /*!< PWM_T::INTSTS1: BRKLIF0 Position */ -#define PWM_INTSTS1_BRKLIF0_Msk (0x1ul << PWM_INTSTS1_BRKLIF0_Pos) /*!< PWM_T::INTSTS1: BRKLIF0 Mask */ - -#define PWM_INTSTS1_BRKLIF1_Pos (9) /*!< PWM_T::INTSTS1: BRKLIF1 Position */ -#define PWM_INTSTS1_BRKLIF1_Msk (0x1ul << PWM_INTSTS1_BRKLIF1_Pos) /*!< PWM_T::INTSTS1: BRKLIF1 Mask */ - -#define PWM_INTSTS1_BRKLIF2_Pos (10) /*!< PWM_T::INTSTS1: BRKLIF2 Position */ -#define PWM_INTSTS1_BRKLIF2_Msk (0x1ul << PWM_INTSTS1_BRKLIF2_Pos) /*!< PWM_T::INTSTS1: BRKLIF2 Mask */ - -#define PWM_INTSTS1_BRKLIF3_Pos (11) /*!< PWM_T::INTSTS1: BRKLIF3 Position */ -#define PWM_INTSTS1_BRKLIF3_Msk (0x1ul << PWM_INTSTS1_BRKLIF3_Pos) /*!< PWM_T::INTSTS1: BRKLIF3 Mask */ - -#define PWM_INTSTS1_BRKLIF4_Pos (12) /*!< PWM_T::INTSTS1: BRKLIF4 Position */ -#define PWM_INTSTS1_BRKLIF4_Msk (0x1ul << PWM_INTSTS1_BRKLIF4_Pos) /*!< PWM_T::INTSTS1: BRKLIF4 Mask */ - -#define PWM_INTSTS1_BRKLIF5_Pos (13) /*!< PWM_T::INTSTS1: BRKLIF5 Position */ -#define PWM_INTSTS1_BRKLIF5_Msk (0x1ul << PWM_INTSTS1_BRKLIF5_Pos) /*!< PWM_T::INTSTS1: BRKLIF5 Mask */ - -#define PWM_INTSTS1_BRKESTS0_Pos (16) /*!< PWM_T::INTSTS1: BRKESTS0 Position */ -#define PWM_INTSTS1_BRKESTS0_Msk (0x1ul << PWM_INTSTS1_BRKESTS0_Pos) /*!< PWM_T::INTSTS1: BRKESTS0 Mask */ - -#define PWM_INTSTS1_BRKESTS1_Pos (17) /*!< PWM_T::INTSTS1: BRKESTS1 Position */ -#define PWM_INTSTS1_BRKESTS1_Msk (0x1ul << PWM_INTSTS1_BRKESTS1_Pos) /*!< PWM_T::INTSTS1: BRKESTS1 Mask */ - -#define PWM_INTSTS1_BRKESTS2_Pos (18) /*!< PWM_T::INTSTS1: BRKESTS2 Position */ -#define PWM_INTSTS1_BRKESTS2_Msk (0x1ul << PWM_INTSTS1_BRKESTS2_Pos) /*!< PWM_T::INTSTS1: BRKESTS2 Mask */ - -#define PWM_INTSTS1_BRKESTS3_Pos (19) /*!< PWM_T::INTSTS1: BRKESTS3 Position */ -#define PWM_INTSTS1_BRKESTS3_Msk (0x1ul << PWM_INTSTS1_BRKESTS3_Pos) /*!< PWM_T::INTSTS1: BRKESTS3 Mask */ - -#define PWM_INTSTS1_BRKESTS4_Pos (20) /*!< PWM_T::INTSTS1: BRKESTS4 Position */ -#define PWM_INTSTS1_BRKESTS4_Msk (0x1ul << PWM_INTSTS1_BRKESTS4_Pos) /*!< PWM_T::INTSTS1: BRKESTS4 Mask */ - -#define PWM_INTSTS1_BRKESTS5_Pos (21) /*!< PWM_T::INTSTS1: BRKESTS5 Position */ -#define PWM_INTSTS1_BRKESTS5_Msk (0x1ul << PWM_INTSTS1_BRKESTS5_Pos) /*!< PWM_T::INTSTS1: BRKESTS5 Mask */ - -#define PWM_INTSTS1_BRKLSTS0_Pos (24) /*!< PWM_T::INTSTS1: BRKLSTS0 Position */ -#define PWM_INTSTS1_BRKLSTS0_Msk (0x1ul << PWM_INTSTS1_BRKLSTS0_Pos) /*!< PWM_T::INTSTS1: BRKLSTS0 Mask */ - -#define PWM_INTSTS1_BRKLSTS1_Pos (25) /*!< PWM_T::INTSTS1: BRKLSTS1 Position */ -#define PWM_INTSTS1_BRKLSTS1_Msk (0x1ul << PWM_INTSTS1_BRKLSTS1_Pos) /*!< PWM_T::INTSTS1: BRKLSTS1 Mask */ - -#define PWM_INTSTS1_BRKLSTS2_Pos (26) /*!< PWM_T::INTSTS1: BRKLSTS2 Position */ -#define PWM_INTSTS1_BRKLSTS2_Msk (0x1ul << PWM_INTSTS1_BRKLSTS2_Pos) /*!< PWM_T::INTSTS1: BRKLSTS2 Mask */ - -#define PWM_INTSTS1_BRKLSTS3_Pos (27) /*!< PWM_T::INTSTS1: BRKLSTS3 Position */ -#define PWM_INTSTS1_BRKLSTS3_Msk (0x1ul << PWM_INTSTS1_BRKLSTS3_Pos) /*!< PWM_T::INTSTS1: BRKLSTS3 Mask */ - -#define PWM_INTSTS1_BRKLSTS4_Pos (28) /*!< PWM_T::INTSTS1: BRKLSTS4 Position */ -#define PWM_INTSTS1_BRKLSTS4_Msk (0x1ul << PWM_INTSTS1_BRKLSTS4_Pos) /*!< PWM_T::INTSTS1: BRKLSTS4 Mask */ - -#define PWM_INTSTS1_BRKLSTS5_Pos (29) /*!< PWM_T::INTSTS1: BRKLSTS5 Position */ -#define PWM_INTSTS1_BRKLSTS5_Msk (0x1ul << PWM_INTSTS1_BRKLSTS5_Pos) /*!< PWM_T::INTSTS1: BRKLSTS5 Mask */ - -#define PWM_ADCTS0_TRGSEL0_Pos (0) /*!< PWM_T::ADCTS0: TRGSEL0 Position */ -#define PWM_ADCTS0_TRGSEL0_Msk (0xful << PWM_ADCTS0_TRGSEL0_Pos) /*!< PWM_T::ADCTS0: TRGSEL0 Mask */ - -#define PWM_ADCTS0_TRGEN0_Pos (7) /*!< PWM_T::ADCTS0: TRGEN0 Position */ -#define PWM_ADCTS0_TRGEN0_Msk (0x1ul << PWM_ADCTS0_TRGEN0_Pos) /*!< PWM_T::ADCTS0: TRGEN0 Mask */ - -#define PWM_ADCTS0_TRGSEL1_Pos (8) /*!< PWM_T::ADCTS0: TRGSEL1 Position */ -#define PWM_ADCTS0_TRGSEL1_Msk (0xful << PWM_ADCTS0_TRGSEL1_Pos) /*!< PWM_T::ADCTS0: TRGSEL1 Mask */ - -#define PWM_ADCTS0_TRGEN1_Pos (15) /*!< PWM_T::ADCTS0: TRGEN1 Position */ -#define PWM_ADCTS0_TRGEN1_Msk (0x1ul << PWM_ADCTS0_TRGEN1_Pos) /*!< PWM_T::ADCTS0: TRGEN1 Mask */ - -#define PWM_ADCTS0_TRGSEL2_Pos (16) /*!< PWM_T::ADCTS0: TRGSEL2 Position */ -#define PWM_ADCTS0_TRGSEL2_Msk (0xful << PWM_ADCTS0_TRGSEL2_Pos) /*!< PWM_T::ADCTS0: TRGSEL2 Mask */ - -#define PWM_ADCTS0_TRGEN2_Pos (23) /*!< PWM_T::ADCTS0: TRGEN2 Position */ -#define PWM_ADCTS0_TRGEN2_Msk (0x1ul << PWM_ADCTS0_TRGEN2_Pos) /*!< PWM_T::ADCTS0: TRGEN2 Mask */ - -#define PWM_ADCTS0_TRGSEL3_Pos (24) /*!< PWM_T::ADCTS0: TRGSEL3 Position */ -#define PWM_ADCTS0_TRGSEL3_Msk (0xful << PWM_ADCTS0_TRGSEL3_Pos) /*!< PWM_T::ADCTS0: TRGSEL3 Mask */ - -#define PWM_ADCTS0_TRGEN3_Pos (31) /*!< PWM_T::ADCTS0: TRGEN3 Position */ -#define PWM_ADCTS0_TRGEN3_Msk (0x1ul << PWM_ADCTS0_TRGEN3_Pos) /*!< PWM_T::ADCTS0: TRGEN3 Mask */ - -#define PWM_ADCTS1_TRGSEL4_Pos (0) /*!< PWM_T::ADCTS1: TRGSEL4 Position */ -#define PWM_ADCTS1_TRGSEL4_Msk (0xful << PWM_ADCTS1_TRGSEL4_Pos) /*!< PWM_T::ADCTS1: TRGSEL4 Mask */ - -#define PWM_ADCTS1_TRGEN4_Pos (7) /*!< PWM_T::ADCTS1: TRGEN4 Position */ -#define PWM_ADCTS1_TRGEN4_Msk (0x1ul << PWM_ADCTS1_TRGEN4_Pos) /*!< PWM_T::ADCTS1: TRGEN4 Mask */ - -#define PWM_ADCTS1_TRGSEL5_Pos (8) /*!< PWM_T::ADCTS1: TRGSEL5 Position */ -#define PWM_ADCTS1_TRGSEL5_Msk (0xful << PWM_ADCTS1_TRGSEL5_Pos) /*!< PWM_T::ADCTS1: TRGSEL5 Mask */ - -#define PWM_ADCTS1_TRGEN5_Pos (15) /*!< PWM_T::ADCTS1: TRGEN5 Position */ -#define PWM_ADCTS1_TRGEN5_Msk (0x1ul << PWM_ADCTS1_TRGEN5_Pos) /*!< PWM_T::ADCTS1: TRGEN5 Mask */ - -#define PWM_SSCTL_SSEN0_Pos (0) /*!< PWM_T::SSCTL: SSEN0 Position */ -#define PWM_SSCTL_SSEN0_Msk (0x1ul << PWM_SSCTL_SSEN0_Pos) /*!< PWM_T::SSCTL: SSEN0 Mask */ - -#define PWM_SSCTL_SSEN2_Pos (2) /*!< PWM_T::SSCTL: SSEN2 Position */ -#define PWM_SSCTL_SSEN2_Msk (0x1ul << PWM_SSCTL_SSEN2_Pos) /*!< PWM_T::SSCTL: SSEN2 Mask */ - -#define PWM_SSCTL_SSEN4_Pos (4) /*!< PWM_T::SSCTL: SSEN4 Position */ -#define PWM_SSCTL_SSEN4_Msk (0x1ul << PWM_SSCTL_SSEN4_Pos) /*!< PWM_T::SSCTL: SSEN4 Mask */ - -#define PWM_SSCTL_SSRC_Pos (8) /*!< PWM_T::SSCTL: SSRC Position */ -#define PWM_SSCTL_SSRC_Msk (0x3ul << PWM_SSCTL_SSRC_Pos) /*!< PWM_T::SSCTL: SSRC Mask */ - -#define PWM_SSTRG_CNTSEN_Pos (0) /*!< PWM_T::SSTRG: CNTSEN Position */ -#define PWM_SSTRG_CNTSEN_Msk (0x1ul << PWM_SSTRG_CNTSEN_Pos) /*!< PWM_T::SSTRG: CNTSEN Mask */ - -#define PWM_STATUS_CNTMAX0_Pos (0) /*!< PWM_T::STATUS: CNTMAX0 Position */ -#define PWM_STATUS_CNTMAX0_Msk (0x1ul << PWM_STATUS_CNTMAX0_Pos) /*!< PWM_T::STATUS: CNTMAX0 Mask */ - -#define PWM_STATUS_CNTMAX2_Pos (2) /*!< PWM_T::STATUS: CNTMAX2 Position */ -#define PWM_STATUS_CNTMAX2_Msk (0x1ul << PWM_STATUS_CNTMAX2_Pos) /*!< PWM_T::STATUS: CNTMAX2 Mask */ - -#define PWM_STATUS_CNTMAX4_Pos (4) /*!< PWM_T::STATUS: CNTMAX4 Position */ -#define PWM_STATUS_CNTMAX4_Msk (0x1ul << PWM_STATUS_CNTMAX4_Pos) /*!< PWM_T::STATUS: CNTMAX4 Mask */ - -#define PWM_STATUS_ADCTRG0_Pos (16) /*!< PWM_T::STATUS: ADCTRGF0 Position */ -#define PWM_STATUS_ADCTRG0_Msk (0x1ul << PWM_STATUS_ADCTRG0_Pos) /*!< PWM_T::STATUS: ADCTRGF0 Mask */ - -#define PWM_STATUS_ADCTRG1_Pos (17) /*!< PWM_T::STATUS: ADCTRGF1 Position */ -#define PWM_STATUS_ADCTRG1_Msk (0x1ul << PWM_STATUS_ADCTRG1_Pos) /*!< PWM_T::STATUS: ADCTRGF1 Mask */ - -#define PWM_STATUS_ADCTRG2_Pos (18) /*!< PWM_T::STATUS: ADCTRGF2 Position */ -#define PWM_STATUS_ADCTRG2_Msk (0x1ul << PWM_STATUS_ADCTRG2_Pos) /*!< PWM_T::STATUS: ADCTRGF2 Mask */ - -#define PWM_STATUS_ADCTRG3_Pos (19) /*!< PWM_T::STATUS: ADCTRGF3 Position */ -#define PWM_STATUS_ADCTRG3_Msk (0x1ul << PWM_STATUS_ADCTRG3_Pos) /*!< PWM_T::STATUS: ADCTRGF3 Mask */ - -#define PWM_STATUS_ADCTRG4_Pos (20) /*!< PWM_T::STATUS: ADCTRGF4 Position */ -#define PWM_STATUS_ADCTRG4_Msk (0x1ul << PWM_STATUS_ADCTRG4_Pos) /*!< PWM_T::STATUS: ADCTRGF4 Mask */ - -#define PWM_STATUS_ADCTRG5_Pos (21) /*!< PWM_T::STATUS: ADCTRGF5 Position */ -#define PWM_STATUS_ADCTRG5_Msk (0x1ul << PWM_STATUS_ADCTRG5_Pos) /*!< PWM_T::STATUS: ADCTRGF5 Mask */ - -#define PWM_CAPINEN_CAPINEN0_Pos (0) /*!< PWM_T::CAPINEN: CAPINEN0 Position */ -#define PWM_CAPINEN_CAPINEN0_Msk (0x1ul << PWM_CAPINEN_CAPINEN0_Pos) /*!< PWM_T::CAPINEN: CAPINEN0 Mask */ - -#define PWM_CAPINEN_CAPINEN1_Pos (1) /*!< PWM_T::CAPINEN: CAPINEN1 Position */ -#define PWM_CAPINEN_CAPINEN1_Msk (0x1ul << PWM_CAPINEN_CAPINEN1_Pos) /*!< PWM_T::CAPINEN: CAPINEN1 Mask */ - -#define PWM_CAPINEN_CAPINEN2_Pos (2) /*!< PWM_T::CAPINEN: CAPINEN2 Position */ -#define PWM_CAPINEN_CAPINEN2_Msk (0x1ul << PWM_CAPINEN_CAPINEN2_Pos) /*!< PWM_T::CAPINEN: CAPINEN2 Mask */ - -#define PWM_CAPINEN_CAPINEN3_Pos (3) /*!< PWM_T::CAPINEN: CAPINEN3 Position */ -#define PWM_CAPINEN_CAPINEN3_Msk (0x1ul << PWM_CAPINEN_CAPINEN3_Pos) /*!< PWM_T::CAPINEN: CAPINEN3 Mask */ - -#define PWM_CAPINEN_CAPINEN4_Pos (4) /*!< PWM_T::CAPINEN: CAPINEN4 Position */ -#define PWM_CAPINEN_CAPINEN4_Msk (0x1ul << PWM_CAPINEN_CAPINEN4_Pos) /*!< PWM_T::CAPINEN: CAPINEN4 Mask */ - -#define PWM_CAPINEN_CAPINEN5_Pos (5) /*!< PWM_T::CAPINEN: CAPINEN5 Position */ -#define PWM_CAPINEN_CAPINEN5_Msk (0x1ul << PWM_CAPINEN_CAPINEN5_Pos) /*!< PWM_T::CAPINEN: CAPINEN5 Mask */ - -#define PWM_CAPCTL_CAPEN0_Pos (0) /*!< PWM_T::CAPCTL: CAPEN0 Position */ -#define PWM_CAPCTL_CAPEN0_Msk (0x1ul << PWM_CAPCTL_CAPEN0_Pos) /*!< PWM_T::CAPCTL: CAPEN0 Mask */ - -#define PWM_CAPCTL_CAPEN1_Pos (1) /*!< PWM_T::CAPCTL: CAPEN1 Position */ -#define PWM_CAPCTL_CAPEN1_Msk (0x1ul << PWM_CAPCTL_CAPEN1_Pos) /*!< PWM_T::CAPCTL: CAPEN1 Mask */ - -#define PWM_CAPCTL_CAPEN2_Pos (2) /*!< PWM_T::CAPCTL: CAPEN2 Position */ -#define PWM_CAPCTL_CAPEN2_Msk (0x1ul << PWM_CAPCTL_CAPEN2_Pos) /*!< PWM_T::CAPCTL: CAPEN2 Mask */ - -#define PWM_CAPCTL_CAPEN3_Pos (3) /*!< PWM_T::CAPCTL: CAPEN3 Position */ -#define PWM_CAPCTL_CAPEN3_Msk (0x1ul << PWM_CAPCTL_CAPEN3_Pos) /*!< PWM_T::CAPCTL: CAPEN3 Mask */ - -#define PWM_CAPCTL_CAPEN4_Pos (4) /*!< PWM_T::CAPCTL: CAPEN4 Position */ -#define PWM_CAPCTL_CAPEN4_Msk (0x1ul << PWM_CAPCTL_CAPEN4_Pos) /*!< PWM_T::CAPCTL: CAPEN4 Mask */ - -#define PWM_CAPCTL_CAPEN5_Pos (5) /*!< PWM_T::CAPCTL: CAPEN5 Position */ -#define PWM_CAPCTL_CAPEN5_Msk (0x1ul << PWM_CAPCTL_CAPEN5_Pos) /*!< PWM_T::CAPCTL: CAPEN5 Mask */ - -#define PWM_CAPCTL_CAPINV0_Pos (8) /*!< PWM_T::CAPCTL: CAPINV0 Position */ -#define PWM_CAPCTL_CAPINV0_Msk (0x1ul << PWM_CAPCTL_CAPINV0_Pos) /*!< PWM_T::CAPCTL: CAPINV0 Mask */ - -#define PWM_CAPCTL_CAPINV1_Pos (9) /*!< PWM_T::CAPCTL: CAPINV1 Position */ -#define PWM_CAPCTL_CAPINV1_Msk (0x1ul << PWM_CAPCTL_CAPINV1_Pos) /*!< PWM_T::CAPCTL: CAPINV1 Mask */ - -#define PWM_CAPCTL_CAPINV2_Pos (10) /*!< PWM_T::CAPCTL: CAPINV2 Position */ -#define PWM_CAPCTL_CAPINV2_Msk (0x1ul << PWM_CAPCTL_CAPINV2_Pos) /*!< PWM_T::CAPCTL: CAPINV2 Mask */ - -#define PWM_CAPCTL_CAPINV3_Pos (11) /*!< PWM_T::CAPCTL: CAPINV3 Position */ -#define PWM_CAPCTL_CAPINV3_Msk (0x1ul << PWM_CAPCTL_CAPINV3_Pos) /*!< PWM_T::CAPCTL: CAPINV3 Mask */ - -#define PWM_CAPCTL_CAPINV4_Pos (12) /*!< PWM_T::CAPCTL: CAPINV4 Position */ -#define PWM_CAPCTL_CAPINV4_Msk (0x1ul << PWM_CAPCTL_CAPINV4_Pos) /*!< PWM_T::CAPCTL: CAPINV4 Mask */ - -#define PWM_CAPCTL_CAPINV5_Pos (13) /*!< PWM_T::CAPCTL: CAPINV5 Position */ -#define PWM_CAPCTL_CAPINV5_Msk (0x1ul << PWM_CAPCTL_CAPINV5_Pos) /*!< PWM_T::CAPCTL: CAPINV5 Mask */ - -#define PWM_CAPCTL_RCRLDEN0_Pos (16) /*!< PWM_T::CAPCTL: RCRLDEN0 Position */ -#define PWM_CAPCTL_RCRLDEN0_Msk (0x1ul << PWM_CAPCTL_RCRLDEN0_Pos) /*!< PWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define PWM_CAPCTL_RCRLDEN1_Pos (17) /*!< PWM_T::CAPCTL: RCRLDEN1 Position */ -#define PWM_CAPCTL_RCRLDEN1_Msk (0x1ul << PWM_CAPCTL_RCRLDEN1_Pos) /*!< PWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define PWM_CAPCTL_RCRLDEN2_Pos (18) /*!< PWM_T::CAPCTL: RCRLDEN2 Position */ -#define PWM_CAPCTL_RCRLDEN2_Msk (0x1ul << PWM_CAPCTL_RCRLDEN2_Pos) /*!< PWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define PWM_CAPCTL_RCRLDEN3_Pos (19) /*!< PWM_T::CAPCTL: RCRLDEN3 Position */ -#define PWM_CAPCTL_RCRLDEN3_Msk (0x1ul << PWM_CAPCTL_RCRLDEN3_Pos) /*!< PWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define PWM_CAPCTL_RCRLDEN4_Pos (20) /*!< PWM_T::CAPCTL: RCRLDEN4 Position */ -#define PWM_CAPCTL_RCRLDEN4_Msk (0x1ul << PWM_CAPCTL_RCRLDEN4_Pos) /*!< PWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define PWM_CAPCTL_RCRLDEN5_Pos (21) /*!< PWM_T::CAPCTL: RCRLDEN5 Position */ -#define PWM_CAPCTL_RCRLDEN5_Msk (0x1ul << PWM_CAPCTL_RCRLDEN5_Pos) /*!< PWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define PWM_CAPCTL_FCRLDEN0_Pos (24) /*!< PWM_T::CAPCTL: FCRLDEN0 Position */ -#define PWM_CAPCTL_FCRLDEN0_Msk (0x1ul << PWM_CAPCTL_FCRLDEN0_Pos) /*!< PWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define PWM_CAPCTL_FCRLDEN1_Pos (25) /*!< PWM_T::CAPCTL: FCRLDEN1 Position */ -#define PWM_CAPCTL_FCRLDEN1_Msk (0x1ul << PWM_CAPCTL_FCRLDEN1_Pos) /*!< PWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define PWM_CAPCTL_FCRLDEN2_Pos (26) /*!< PWM_T::CAPCTL: FCRLDEN2 Position */ -#define PWM_CAPCTL_FCRLDEN2_Msk (0x1ul << PWM_CAPCTL_FCRLDEN2_Pos) /*!< PWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define PWM_CAPCTL_FCRLDEN3_Pos (27) /*!< PWM_T::CAPCTL: FCRLDEN3 Position */ -#define PWM_CAPCTL_FCRLDEN3_Msk (0x1ul << PWM_CAPCTL_FCRLDEN3_Pos) /*!< PWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define PWM_CAPCTL_FCRLDEN4_Pos (28) /*!< PWM_T::CAPCTL: FCRLDEN4 Position */ -#define PWM_CAPCTL_FCRLDEN4_Msk (0x1ul << PWM_CAPCTL_FCRLDEN4_Pos) /*!< PWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define PWM_CAPCTL_FCRLDEN5_Pos (29) /*!< PWM_T::CAPCTL: FCRLDEN5 Position */ -#define PWM_CAPCTL_FCRLDEN5_Msk (0x1ul << PWM_CAPCTL_FCRLDEN5_Pos) /*!< PWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define PWM_CAPSTS_CRLIFOV0_Pos (0) /*!< PWM_T::CAPSTS: CRLIFOV0 Position */ -#define PWM_CAPSTS_CRLIFOV0_Msk (0x1ul << PWM_CAPSTS_CRLIFOV0_Pos) /*!< PWM_T::CAPSTS: CRLIFOV0 Mask */ - -#define PWM_CAPSTS_CRLIFOV1_Pos (1) /*!< PWM_T::CAPSTS: CRLIFOV1 Position */ -#define PWM_CAPSTS_CRLIFOV1_Msk (0x1ul << PWM_CAPSTS_CRLIFOV1_Pos) /*!< PWM_T::CAPSTS: CRLIFOV1 Mask */ - -#define PWM_CAPSTS_CRLIFOV2_Pos (2) /*!< PWM_T::CAPSTS: CRLIFOV2 Position */ -#define PWM_CAPSTS_CRLIFOV2_Msk (0x1ul << PWM_CAPSTS_CRLIFOV2_Pos) /*!< PWM_T::CAPSTS: CRLIFOV2 Mask */ - -#define PWM_CAPSTS_CRLIFOV3_Pos (3) /*!< PWM_T::CAPSTS: CRLIFOV3 Position */ -#define PWM_CAPSTS_CRLIFOV3_Msk (0x1ul << PWM_CAPSTS_CRLIFOV3_Pos) /*!< PWM_T::CAPSTS: CRLIFOV3 Mask */ - -#define PWM_CAPSTS_CRLIFOV4_Pos (4) /*!< PWM_T::CAPSTS: CRLIFOV4 Position */ -#define PWM_CAPSTS_CRLIFOV4_Msk (0x1ul << PWM_CAPSTS_CRLIFOV4_Pos) /*!< PWM_T::CAPSTS: CRLIFOV4 Mask */ - -#define PWM_CAPSTS_CRLIFOV5_Pos (5) /*!< PWM_T::CAPSTS: CRLIFOV5 Position */ -#define PWM_CAPSTS_CRLIFOV5_Msk (0x1ul << PWM_CAPSTS_CRLIFOV5_Pos) /*!< PWM_T::CAPSTS: CRLIFOV5 Mask */ - -#define PWM_CAPSTS_CFLIFOV0_Pos (8) /*!< PWM_T::CAPSTS: CFLIFOV0 Position */ -#define PWM_CAPSTS_CFLIFOV0_Msk (0x1ul << PWM_CAPSTS_CFLIFOV0_Pos) /*!< PWM_T::CAPSTS: CFLIFOV0 Mask */ - -#define PWM_CAPSTS_CFLIFOV1_Pos (9) /*!< PWM_T::CAPSTS: CFLIFOV1 Position */ -#define PWM_CAPSTS_CFLIFOV1_Msk (0x1ul << PWM_CAPSTS_CFLIFOV1_Pos) /*!< PWM_T::CAPSTS: CFLIFOV1 Mask */ - -#define PWM_CAPSTS_CFLIFOV2_Pos (10) /*!< PWM_T::CAPSTS: CFLIFOV2 Position */ -#define PWM_CAPSTS_CFLIFOV2_Msk (0x1ul << PWM_CAPSTS_CFLIFOV2_Pos) /*!< PWM_T::CAPSTS: CFLIFOV2 Mask */ - -#define PWM_CAPSTS_CFLIFOV3_Pos (11) /*!< PWM_T::CAPSTS: CFLIFOV3 Position */ -#define PWM_CAPSTS_CFLIFOV3_Msk (0x1ul << PWM_CAPSTS_CFLIFOV3_Pos) /*!< PWM_T::CAPSTS: CFLIFOV3 Mask */ - -#define PWM_CAPSTS_CFLIFOV4_Pos (12) /*!< PWM_T::CAPSTS: CFLIFOV4 Position */ -#define PWM_CAPSTS_CFLIFOV4_Msk (0x1ul << PWM_CAPSTS_CFLIFOV4_Pos) /*!< PWM_T::CAPSTS: CFLIFOV4 Mask */ - -#define PWM_CAPSTS_CFLIFOV5_Pos (13) /*!< PWM_T::CAPSTS: CFLIFOV5 Position */ -#define PWM_CAPSTS_CFLIFOV5_Msk (0x1ul << PWM_CAPSTS_CFLIFOV5_Pos) /*!< PWM_T::CAPSTS: CFLIFOV5 Mask */ - -#define PWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< PWM_T::RCAPDAT0: RCAPDAT Position */ -#define PWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << PWM_RCAPDAT0_RCAPDAT_Pos) /*!< PWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define PWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< PWM_T::FCAPDAT0: FCAPDAT Position */ -#define PWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << PWM_FCAPDAT0_FCAPDAT_Pos) /*!< PWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define PWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< PWM_T::RCAPDAT1: RCAPDAT Position */ -#define PWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << PWM_RCAPDAT1_RCAPDAT_Pos) /*!< PWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define PWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< PWM_T::FCAPDAT1: FCAPDAT Position */ -#define PWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << PWM_FCAPDAT1_FCAPDAT_Pos) /*!< PWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define PWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< PWM_T::RCAPDAT2: RCAPDAT Position */ -#define PWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << PWM_RCAPDAT2_RCAPDAT_Pos) /*!< PWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define PWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< PWM_T::FCAPDAT2: FCAPDAT Position */ -#define PWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << PWM_FCAPDAT2_FCAPDAT_Pos) /*!< PWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define PWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< PWM_T::RCAPDAT3: RCAPDAT Position */ -#define PWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << PWM_RCAPDAT3_RCAPDAT_Pos) /*!< PWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define PWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< PWM_T::FCAPDAT3: FCAPDAT Position */ -#define PWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << PWM_FCAPDAT3_FCAPDAT_Pos) /*!< PWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define PWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< PWM_T::RCAPDAT4: RCAPDAT Position */ -#define PWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << PWM_RCAPDAT4_RCAPDAT_Pos) /*!< PWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define PWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< PWM_T::FCAPDAT4: FCAPDAT Position */ -#define PWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << PWM_FCAPDAT4_FCAPDAT_Pos) /*!< PWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define PWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< PWM_T::RCAPDAT5: RCAPDAT Position */ -#define PWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << PWM_RCAPDAT5_RCAPDAT_Pos) /*!< PWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define PWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< PWM_T::FCAPDAT5: FCAPDAT Position */ -#define PWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << PWM_FCAPDAT5_FCAPDAT_Pos) /*!< PWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define PWM_PDMACTL_CHEN0_1_Pos (0) /*!< PWM_T::PDMACTL: CHEN0_1 Position */ -#define PWM_PDMACTL_CHEN0_1_Msk (0x1ul << PWM_PDMACTL_CHEN0_1_Pos) /*!< PWM_T::PDMACTL: CHEN0_1 Mask */ - -#define PWM_PDMACTL_CAPMOD0_1_Pos (1) /*!< PWM_T::PDMACTL: CAPMOD0_1 Position */ -#define PWM_PDMACTL_CAPMOD0_1_Msk (0x3ul << PWM_PDMACTL_CAPMOD0_1_Pos) /*!< PWM_T::PDMACTL: CAPMOD0_1 Mask */ - -#define PWM_PDMACTL_CAPORD0_1_Pos (3) /*!< PWM_T::PDMACTL: CAPORD0_1 Position */ -#define PWM_PDMACTL_CAPORD0_1_Msk (0x1ul << PWM_PDMACTL_CAPORD0_1_Pos) /*!< PWM_T::PDMACTL: CAPORD0_1 Mask */ - -#define PWM_PDMACTL_CHSEL0_1_Pos (4) /*!< PWM_T::PDMACTL: CHSEL0_1 Position */ -#define PWM_PDMACTL_CHSEL0_1_Msk (0x1ul << PWM_PDMACTL_CHSEL0_1_Pos) /*!< PWM_T::PDMACTL: CHSEL0_1 Mask */ - -#define PWM_PDMACTL_CHEN2_3_Pos (8) /*!< PWM_T::PDMACTL: CHEN2_3 Position */ -#define PWM_PDMACTL_CHEN2_3_Msk (0x1ul << PWM_PDMACTL_CHEN2_3_Pos) /*!< PWM_T::PDMACTL: CHEN2_3 Mask */ - -#define PWM_PDMACTL_CAPMOD2_3_Pos (9) /*!< PWM_T::PDMACTL: CAPMOD2_3 Position */ -#define PWM_PDMACTL_CAPMOD2_3_Msk (0x3ul << PWM_PDMACTL_CAPMOD2_3_Pos) /*!< PWM_T::PDMACTL: CAPMOD2_3 Mask */ - -#define PWM_PDMACTL_CAPORD2_3_Pos (11) /*!< PWM_T::PDMACTL: CAPORD2_3 Position */ -#define PWM_PDMACTL_CAPORD2_3_Msk (0x1ul << PWM_PDMACTL_CAPORD2_3_Pos) /*!< PWM_T::PDMACTL: CAPORD2_3 Mask */ - -#define PWM_PDMACTL_CHSEL2_3_Pos (12) /*!< PWM_T::PDMACTL: CHSEL2_3 Position */ -#define PWM_PDMACTL_CHSEL2_3_Msk (0x1ul << PWM_PDMACTL_CHSEL2_3_Pos) /*!< PWM_T::PDMACTL: CHSEL2_3 Mask */ - -#define PWM_PDMACTL_CHEN4_5_Pos (16) /*!< PWM_T::PDMACTL: CHEN4_5 Position */ -#define PWM_PDMACTL_CHEN4_5_Msk (0x1ul << PWM_PDMACTL_CHEN4_5_Pos) /*!< PWM_T::PDMACTL: CHEN4_5 Mask */ - -#define PWM_PDMACTL_CAPMOD4_5_Pos (17) /*!< PWM_T::PDMACTL: CAPMOD4_5 Position */ -#define PWM_PDMACTL_CAPMOD4_5_Msk (0x3ul << PWM_PDMACTL_CAPMOD4_5_Pos) /*!< PWM_T::PDMACTL: CAPMOD4_5 Mask */ - -#define PWM_PDMACTL_CAPORD4_5_Pos (19) /*!< PWM_T::PDMACTL: CAPORD4_5 Position */ -#define PWM_PDMACTL_CAPORD4_5_Msk (0x1ul << PWM_PDMACTL_CAPORD4_5_Pos) /*!< PWM_T::PDMACTL: CAPORD4_5 Mask */ - -#define PWM_PDMACTL_CHSEL4_5_Pos (20) /*!< PWM_T::PDMACTL: CHSEL4_5 Position */ -#define PWM_PDMACTL_CHSEL4_5_Msk (0x1ul << PWM_PDMACTL_CHSEL4_5_Pos) /*!< PWM_T::PDMACTL: CHSEL4_5 Mask */ - -#define PWM_PDMACAP0_1_CAPBUF_Pos (0) /*!< PWM_T::PDMACAP0_1: CAPBUF Position */ -#define PWM_PDMACAP0_1_CAPBUF_Msk (0xfffful << PWM_PDMACAP0_1_CAPBUF_Pos) /*!< PWM_T::PDMACAP0_1: CAPBUF Mask */ - -#define PWM_PDMACAP2_3_CAPBUF_Pos (0) /*!< PWM_T::PDMACAP2_3: CAPBUF Position */ -#define PWM_PDMACAP2_3_CAPBUF_Msk (0xfffful << PWM_PDMACAP2_3_CAPBUF_Pos) /*!< PWM_T::PDMACAP2_3: CAPBUF Mask */ - -#define PWM_PDMACAP4_5_CAPBUF_Pos (0) /*!< PWM_T::PDMACAP4_5: CAPBUF Position */ -#define PWM_PDMACAP4_5_CAPBUF_Msk (0xfffful << PWM_PDMACAP4_5_CAPBUF_Pos) /*!< PWM_T::PDMACAP4_5: CAPBUF Mask */ - -#define PWM_CAPIEN_CAPRIEN0_Pos (0) /*!< PWM_T::CAPIEN: CAPRIEN0 Position */ -#define PWM_CAPIEN_CAPRIEN0_Msk (0x1ul << PWM_CAPIEN_CAPRIEN0_Pos) /*!< PWM_T::CAPIEN: CAPRIEN0 Mask */ - -#define PWM_CAPIEN_CAPRIEN1_Pos (1) /*!< PWM_T::CAPIEN: CAPRIEN1 Position */ -#define PWM_CAPIEN_CAPRIEN1_Msk (0x1ul << PWM_CAPIEN_CAPRIEN1_Pos) /*!< PWM_T::CAPIEN: CAPRIEN1 Mask */ - -#define PWM_CAPIEN_CAPRIEN2_Pos (2) /*!< PWM_T::CAPIEN: CAPRIEN2 Position */ -#define PWM_CAPIEN_CAPRIEN2_Msk (0x1ul << PWM_CAPIEN_CAPRIEN2_Pos) /*!< PWM_T::CAPIEN: CAPRIEN2 Mask */ - -#define PWM_CAPIEN_CAPRIEN3_Pos (3) /*!< PWM_T::CAPIEN: CAPRIEN3 Position */ -#define PWM_CAPIEN_CAPRIEN3_Msk (0x1ul << PWM_CAPIEN_CAPRIEN3_Pos) /*!< PWM_T::CAPIEN: CAPRIEN3 Mask */ - -#define PWM_CAPIEN_CAPRIEN4_Pos (4) /*!< PWM_T::CAPIEN: CAPRIEN4 Position */ -#define PWM_CAPIEN_CAPRIEN4_Msk (0x1ul << PWM_CAPIEN_CAPRIEN4_Pos) /*!< PWM_T::CAPIEN: CAPRIEN4 Mask */ - -#define PWM_CAPIEN_CAPRIEN5_Pos (5) /*!< PWM_T::CAPIEN: CAPRIEN5 Position */ -#define PWM_CAPIEN_CAPRIEN5_Msk (0x1ul << PWM_CAPIEN_CAPRIEN5_Pos) /*!< PWM_T::CAPIEN: CAPRIEN5 Mask */ - -#define PWM_CAPIEN_CAPFIEN0_Pos (8) /*!< PWM_T::CAPIEN: CAPFIEN0 Position */ -#define PWM_CAPIEN_CAPFIEN0_Msk (0x1ul << PWM_CAPIEN_CAPFIEN0_Pos) /*!< PWM_T::CAPIEN: CAPFIEN0 Mask */ - -#define PWM_CAPIEN_CAPFIEN1_Pos (9) /*!< PWM_T::CAPIEN: CAPFIEN1 Position */ -#define PWM_CAPIEN_CAPFIEN1_Msk (0x1ul << PWM_CAPIEN_CAPFIEN1_Pos) /*!< PWM_T::CAPIEN: CAPFIEN1 Mask */ - -#define PWM_CAPIEN_CAPFIEN2_Pos (10) /*!< PWM_T::CAPIEN: CAPFIEN2 Position */ -#define PWM_CAPIEN_CAPFIEN2_Msk (0x1ul << PWM_CAPIEN_CAPFIEN2_Pos) /*!< PWM_T::CAPIEN: CAPFIEN2 Mask */ - -#define PWM_CAPIEN_CAPFIEN3_Pos (11) /*!< PWM_T::CAPIEN: CAPFIEN3 Position */ -#define PWM_CAPIEN_CAPFIEN3_Msk (0x1ul << PWM_CAPIEN_CAPFIEN3_Pos) /*!< PWM_T::CAPIEN: CAPFIEN3 Mask */ - -#define PWM_CAPIEN_CAPFIEN4_Pos (12) /*!< PWM_T::CAPIEN: CAPFIEN4 Position */ -#define PWM_CAPIEN_CAPFIEN4_Msk (0x1ul << PWM_CAPIEN_CAPFIEN4_Pos) /*!< PWM_T::CAPIEN: CAPFIEN4 Mask */ - -#define PWM_CAPIEN_CAPFIEN5_Pos (13) /*!< PWM_T::CAPIEN: CAPFIEN5 Position */ -#define PWM_CAPIEN_CAPFIEN5_Msk (0x1ul << PWM_CAPIEN_CAPFIEN5_Pos) /*!< PWM_T::CAPIEN: CAPFIEN5 Mask */ - -#define PWM_CAPIF_CRLIF0_Pos (0) /*!< PWM_T::CAPIF: CRLIF0 Position */ -#define PWM_CAPIF_CRLIF0_Msk (0x1ul << PWM_CAPIF_CRLIF0_Pos) /*!< PWM_T::CAPIF: CRLIF0 Mask */ - -#define PWM_CAPIF_CRLIF1_Pos (1) /*!< PWM_T::CAPIF: CRLIF1 Position */ -#define PWM_CAPIF_CRLIF1_Msk (0x1ul << PWM_CAPIF_CRLIF1_Pos) /*!< PWM_T::CAPIF: CRLIF1 Mask */ - -#define PWM_CAPIF_CRLIF2_Pos (2) /*!< PWM_T::CAPIF: CRLIF2 Position */ -#define PWM_CAPIF_CRLIF2_Msk (0x1ul << PWM_CAPIF_CRLIF2_Pos) /*!< PWM_T::CAPIF: CRLIF2 Mask */ - -#define PWM_CAPIF_CRLIF3_Pos (3) /*!< PWM_T::CAPIF: CRLIF3 Position */ -#define PWM_CAPIF_CRLIF3_Msk (0x1ul << PWM_CAPIF_CRLIF3_Pos) /*!< PWM_T::CAPIF: CRLIF3 Mask */ - -#define PWM_CAPIF_CRLIF4_Pos (4) /*!< PWM_T::CAPIF: CRLIF4 Position */ -#define PWM_CAPIF_CRLIF4_Msk (0x1ul << PWM_CAPIF_CRLIF4_Pos) /*!< PWM_T::CAPIF: CRLIF4 Mask */ - -#define PWM_CAPIF_CRLIF5_Pos (5) /*!< PWM_T::CAPIF: CRLIF5 Position */ -#define PWM_CAPIF_CRLIF5_Msk (0x1ul << PWM_CAPIF_CRLIF5_Pos) /*!< PWM_T::CAPIF: CRLIF5 Mask */ - -#define PWM_CAPIF_CFLIF0_Pos (8) /*!< PWM_T::CAPIF: CFLIF0 Position */ -#define PWM_CAPIF_CFLIF0_Msk (0x1ul << PWM_CAPIF_CFLIF0_Pos) /*!< PWM_T::CAPIF: CFLIF0 Mask */ - -#define PWM_CAPIF_CFLIF1_Pos (9) /*!< PWM_T::CAPIF: CFLIF1 Position */ -#define PWM_CAPIF_CFLIF1_Msk (0x1ul << PWM_CAPIF_CFLIF1_Pos) /*!< PWM_T::CAPIF: CFLIF1 Mask */ - -#define PWM_CAPIF_CFLIF2_Pos (10) /*!< PWM_T::CAPIF: CFLIF2 Position */ -#define PWM_CAPIF_CFLIF2_Msk (0x1ul << PWM_CAPIF_CFLIF2_Pos) /*!< PWM_T::CAPIF: CFLIF2 Mask */ - -#define PWM_CAPIF_CFLIF3_Pos (11) /*!< PWM_T::CAPIF: CFLIF3 Position */ -#define PWM_CAPIF_CFLIF3_Msk (0x1ul << PWM_CAPIF_CFLIF3_Pos) /*!< PWM_T::CAPIF: CFLIF3 Mask */ - -#define PWM_CAPIF_CFLIF4_Pos (12) /*!< PWM_T::CAPIF: CFLIF4 Position */ -#define PWM_CAPIF_CFLIF4_Msk (0x1ul << PWM_CAPIF_CFLIF4_Pos) /*!< PWM_T::CAPIF: CFLIF4 Mask */ - -#define PWM_CAPIF_CFLIF5_Pos (13) /*!< PWM_T::CAPIF: CFLIF5 Position */ -#define PWM_CAPIF_CFLIF5_Msk (0x1ul << PWM_CAPIF_CFLIF5_Pos) /*!< PWM_T::CAPIF: CFLIF5 Mask */ - -#define PWM_PBUF_PBUF_Pos (0) /*!< PWM_T::PBUF: PBUF Position */ -#define PWM_PBUF_PBUF_Msk (0xfffful << PWM_PBUF_PBUF_Pos) /*!< PWM_T::PBUF: PBUF Mask */ - -#define PWM_CMPBUF_CMPBUF_Pos (0) /*!< PWM_T::CMPBUF: CMPBUF Position */ -#define PWM_CMPBUF_CMPBUF_Msk (0xfffful << PWM_CMPBUF_CMPBUF_Pos) /*!< PWM_T::CMPBUF: CMPBUF Mask */ - -/**@}*/ /* PWM_CONST */ -/**@}*/ /* end of PWM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __PWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/qspi_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/qspi_reg.h deleted file mode 100644 index 978b29c9a3d..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/qspi_reg.h +++ /dev/null @@ -1,586 +0,0 @@ -/**************************************************************************//** - * @file qspi_reg.h - * @version V1.00 - * @brief QSPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __QSPI_REG_H__ -#define __QSPI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup QSPI Quad Serial Peripheral Interface Controller (QSPI) - Memory Mapped Structure for QSPI Controller -@{ */ -typedef struct -{ - - - /** - * @var QSPI_T::CTL - * Offset: 0x00 QSPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIEN |QSPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1. - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of QSPIx_CTL, QSPIx_CLKDIV, QSPIx_SSCTL and QSPIx_FIFOCTL registers, user shall clear the SPIEN (QSPIx_CTL[0]) and confirm the SPIENSTS (QSPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of QSPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of QSPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of QSPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of QSPI bus clock. - * |[3] |CLKPOL |Clock Polarity - * | | |0 = QSPI bus clock is idle low. - * | | |1 = QSPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval (Master Only) - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a transfer. - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word. - * | | |The default value is 0x3. - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of QSPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 .... 0.5 QSPICLK clock cycle. - * | | |SUSPITV = 0x1 .... 1.5 QSPICLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE .... 14.5 QSPICLK clock cycle. - * | | |SUSPITV = 0xF .... 15.5 QSPICLK clock cycle. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction. - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 .... 8 bits. - * | | |DWIDTH = 0x09 .... 9 bits. - * | | |..... - * | | |DWIDTH = 0x1F .... 31 bits. - * | | |DWIDTH = 0x00 .... 32 bits. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the QSPI TX register, is sent first to the QSPI data output pin, and the first bit received from the QSPI data input pin will be put in the LSB position of the RX register (bit 0 of QSPI_RX). - * |[14] |HALFDPX |QSPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for QSPI transfer. - * | | |The bit field DATDIR (QSPIx_CTL[20]) can be used to set the data direction in half-duplex transfer. - * | | |0 = QSPI operates in full-duplex transfer. - * | | |1 = QSPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only Mode Enable Bit (Master Only) - * | | |This bit field is only available in Master mode. - * | | |In receive-only mode, QSPI Master will generate QSPI bus clock continuously for receiving data bit from QSPI slave device and assert the BUSY status. - * | | |0 = Receive-only mode Disabled. - * | | |1 = Receive-only mode Enabled. - * |[16] |TWOBIT |2-bit Transfer Mode Enable Bit - * | | |0 = 2-Bit Transfer mode Disabled. - * | | |1 = 2-Bit Transfer mode Enabled. - * | | |Note: When 2-Bit Transfer mode is enabled, the first serial transmitted bit data is from the first FIFO buffer data, and the 2nd serial transmitted bit data is from the second FIFO buffer data. - * | | |As the same as transmitted function, the first received bit data is stored into the first FIFO buffer and the 2nd received bit data is stored into the second FIFO buffer at the same time. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = QSPI unit transfer interrupt Disabled. - * | | |1 = QSPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled. - * | | |A byte suspend interval will be inserted among each byte. - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction in half-duplex transfer and Dual/Quad transfer. - * | | |0 = QSPI data is input direction. - * | | |1 = QSPI data is output direction. - * |[21] |DUALIOEN |Dual I/O Mode Enable Bit - * | | |0 = Dual I/O mode Disabled. - * | | |1 = Dual I/O mode Enabled. - * |[22] |QUADIOEN |Quad I/O Mode Enable Bit - * | | |0 = Quad I/O mode Disabled. - * | | |1 = Quad I/O mode Enabled. - * @var QSPI_T::CLKDIV - * Offset: 0x04 QSPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the QSPI bus clock of QSPI Master. - * | | |The frequency is obtained according to the following equation. - * | | |fspi_eclk = fspi_clock_src / (DIVIDER + 1) - * | | |where - * | | |fspi_clock_src is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * | | |Note: The time interval must be larger than or equal 8 peripheral clock cycles between releasing QSPI IP software reset and setting this clock divider register. - * @var QSPI_T::SSCTL - * Offset: 0x08 QSPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control (Master Only) - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = set the QSPIx_SS line to inactive state. - * | | |1 = set the QSPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the QSPIx_SS line at inactive state. - * | | |1 = QSPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time. - * | | |The active state of QSPIx_SS is specified in SSACTPOL (QSPIx_SSCTL[2]). - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (QSPIx_SS). - * | | |0 = The slave selection signal QSPIx_SS is active low. - * | | |1 = The slave selection signal QSPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit (Master Only) - * | | |0 = Automatic slave selection function Disabled - * | | |Slave selection signal will be asserted/de-asserted according to SS (QSPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * |[4] |SLV3WIRE |Slave 3-wire Mode Enable Bit - * | | |In Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPI0_CLK, QSPI0_MISO and QSPI0_MOSI pins. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[5] |SLVTOIEN |Slave Mode Time-out Interrupt Enable Bit - * | | |0 = Slave mode time-out interrupt Disabled. - * | | |1 = Slave mode time-out interrupt Enabled. - * |[6] |SLVTORST |Slave Mode Time-out Reset Control - * | | |0 = When Slave mode time-out event occurs, the TX and RX control circuit will not be reset. - * | | |1 = When Slave mode time-out event occurs, the TX and RX control circuit will be reset by hardware. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * |[31:16] |SLVTOCNT |Slave Mode Time-out Period - * | | |In Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active. - * | | |The clock source of the time-out counter is Slave peripheral clock. - * | | |If the value is 0, it indicates the slave mode time-out function is disabled. - * @var QSPI_T::PDMACTL - * Offset: 0x0C QSPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In QSPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function. - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the QSPI controller. This bit will be automatically cleared to 0. - * @var QSPI_T::FIFOCTL - * Offset: 0x10 QSPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit. - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1. - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit. - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1. - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * | | |Note: If TX underflow event occurs in QSPI Slave mode, this bit can be used to make QSPI return to idle state. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The QSPI data out is keep 0 if there is TX underflow event in Slave mode. - * | | |1 = The QSPI data out is keep 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is no any data in TX FIFO when the slave selection signal is active. - * | | |2. When TX underflow event occurs, QSPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward. - * | | |Data stored in TX FIFO will be sent through QSPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |When TX underflow event occurs in Slave mode, TXUFIF (QSPIx_STATUS[19]) will be set to 1 - * | | |This bit is used to enable the TX underflow interrupt. - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer. - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer. - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[26:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0. - * |[30:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0. - * @var QSPI_T::STATUS - * Offset: 0x14 QSPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = QSPI controller is in idle state. - * | | |1 = QSPI controller is in busy state. - * | | |The following lists the bus busy conditions: - * | | |a. QSPIx_CTL[0] = 1 and TXEMPTY = 0. - * | | |b. For QSPI Master mode, QSPIx_CTL[0] = 1 and TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For QSPI Master mode, QSPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d. For QSPI Slave mode, the QSPIx_CTL[0] = 1 and there is serial clock input into the QSPI core logic when slave select is active. - * | | |e. For QSPI Slave mode, the QSPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = QSPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode. - * | | |If SSACTPOL (QSPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the QSPI slave select is in inactive status. - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag - * | | |When the slave select is active and the value of SLVTOCNT is not 0, as the bus clock is detected, the slave time-out counter in QSPI controller logic will be started. - * | | |When the value of time-out counter is greater than or equal to the value of SLVTOCNT (QSPI_SSCTL[31:16]) before one transaction is done, the slave time-out interrupt event will be asserted. - * | | |0 = Slave time-out is not active. - * | | |1 = Slave time-out is active. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBEIF also active when the slave select goes to inactive state. - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is overrun. - * | | |1 = Receive FIFO is overrun. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 QSPI peripheral clock periods in Master mode or over 576 QSPI peripheral clock periods in Slave mode. - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |SPIENSTS |QSPI Enable Status (Read Only) - * | | |0 = The QSPI controller is disabled. - * | | |1 = The QSPI controller is enabled. - * | | |Note: The QSPI peripheral clock is asynchronous with the system clock. - * | | |In order to make sure the QSPI control logic is disabled, this bit indicates the real status of QSPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slave's transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles. - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var QSPI_T::TX - * Offset: 0x20 QSPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 8-level transmit FIFO buffers. - * | | |The number of valid bits depends on the setting of DWIDTH (QSPIx_CTL[12:8]). - * | | |If DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted. - * | | |If DWIDTH is set to 0x00 , the QSPI controller will perform a 32-bit transfer. - * | | |Note: In Master mode, QSPI controller will start to transfer the QSPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var QSPI_T::RX - * Offset: 0x30 QSPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register (Read Only) - * | | |There are 8-level FIFO buffers in this controller. - * | | |The data receive register holds the data received from QSPI data input pin. - * | | |If the RXEMPTY (QSPIx_STATUS[8]) is not set to 1, the receive FIFO buffers can be accessed through software by reading this register. - */ - __IO uint32_t CTL; /*!< [0x0000] QSPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] QSPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] QSPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] QSPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] QSPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] QSPI Status Register */ - __I uint32_t RESERVE0[2]; - __O uint32_t TX; /*!< [0x0020] QSPI Data Transmit Register */ - __I uint32_t RESERVE1[3]; - __I uint32_t RX; /*!< [0x0030] QSPI Data Receive Register */ - -} QSPI_T; - -/** - @addtogroup QSPI_CONST QSPI Bit Field Definition - Constant Definitions for QSPI Controller -@{ */ - -#define QSPI_CTL_SPIEN_Pos (0) /*!< QSPI_T::CTL: SPIEN Position */ -#define QSPI_CTL_SPIEN_Msk (0x1ul << QSPI_CTL_SPIEN_Pos) /*!< QSPI_T::CTL: SPIEN Mask */ - -#define QSPI_CTL_RXNEG_Pos (1) /*!< QSPI_T::CTL: RXNEG Position */ -#define QSPI_CTL_RXNEG_Msk (0x1ul << QSPI_CTL_RXNEG_Pos) /*!< QSPI_T::CTL: RXNEG Mask */ - -#define QSPI_CTL_TXNEG_Pos (2) /*!< QSPI_T::CTL: TXNEG Position */ -#define QSPI_CTL_TXNEG_Msk (0x1ul << QSPI_CTL_TXNEG_Pos) /*!< QSPI_T::CTL: TXNEG Mask */ - -#define QSPI_CTL_CLKPOL_Pos (3) /*!< QSPI_T::CTL: CLKPOL Position */ -#define QSPI_CTL_CLKPOL_Msk (0x1ul << QSPI_CTL_CLKPOL_Pos) /*!< QSPI_T::CTL: CLKPOL Mask */ - -#define QSPI_CTL_SUSPITV_Pos (4) /*!< QSPI_T::CTL: SUSPITV Position */ -#define QSPI_CTL_SUSPITV_Msk (0xful << QSPI_CTL_SUSPITV_Pos) /*!< QSPI_T::CTL: SUSPITV Mask */ - -#define QSPI_CTL_DWIDTH_Pos (8) /*!< QSPI_T::CTL: DWIDTH Position */ -#define QSPI_CTL_DWIDTH_Msk (0x1ful << QSPI_CTL_DWIDTH_Pos) /*!< QSPI_T::CTL: DWIDTH Mask */ - -#define QSPI_CTL_LSB_Pos (13) /*!< QSPI_T::CTL: LSB Position */ -#define QSPI_CTL_LSB_Msk (0x1ul << QSPI_CTL_LSB_Pos) /*!< QSPI_T::CTL: LSB Mask */ - -#define QSPI_CTL_HALFDPX_Pos (14) /*!< QSPI_T::CTL: HALFDPX Position */ -#define QSPI_CTL_HALFDPX_Msk (0x1ul << QSPI_CTL_HALFDPX_Pos) /*!< QSPI_T::CTL: HALFDPX Mask */ - -#define QSPI_CTL_RXONLY_Pos (15) /*!< QSPI_T::CTL: RXONLY Position */ -#define QSPI_CTL_RXONLY_Msk (0x1ul << QSPI_CTL_RXONLY_Pos) /*!< QSPI_T::CTL: RXONLY Mask */ - -#define QSPI_CTL_TWOBIT_Pos (16) /*!< QSPI_T::CTL: TWOBIT Position */ -#define QSPI_CTL_TWOBIT_Msk (0x1ul << QSPI_CTL_TWOBIT_Pos) /*!< QSPI_T::CTL: TWOBIT Mask */ - -#define QSPI_CTL_UNITIEN_Pos (17) /*!< QSPI_T::CTL: UNITIEN Position */ -#define QSPI_CTL_UNITIEN_Msk (0x1ul << QSPI_CTL_UNITIEN_Pos) /*!< QSPI_T::CTL: UNITIEN Mask */ - -#define QSPI_CTL_SLAVE_Pos (18) /*!< QSPI_T::CTL: SLAVE Position */ -#define QSPI_CTL_SLAVE_Msk (0x1ul << QSPI_CTL_SLAVE_Pos) /*!< QSPI_T::CTL: SLAVE Mask */ - -#define QSPI_CTL_REORDER_Pos (19) /*!< QSPI_T::CTL: REORDER Position */ -#define QSPI_CTL_REORDER_Msk (0x1ul << QSPI_CTL_REORDER_Pos) /*!< QSPI_T::CTL: REORDER Mask */ - -#define QSPI_CTL_DATDIR_Pos (20) /*!< QSPI_T::CTL: DATDIR Position */ -#define QSPI_CTL_DATDIR_Msk (0x1ul << QSPI_CTL_DATDIR_Pos) /*!< QSPI_T::CTL: DATDIR Mask */ - -#define QSPI_CTL_DUALIOEN_Pos (21) /*!< QSPI_T::CTL: DUALIOEN Position */ -#define QSPI_CTL_DUALIOEN_Msk (0x1ul << QSPI_CTL_DUALIOEN_Pos) /*!< QSPI_T::CTL: DUALIOEN Mask */ - -#define QSPI_CTL_QUADIOEN_Pos (22) /*!< QSPI_T::CTL: QUADIOEN Position */ -#define QSPI_CTL_QUADIOEN_Msk (0x1ul << QSPI_CTL_QUADIOEN_Pos) /*!< QSPI_T::CTL: QUADIOEN Mask */ - -#define QSPI_CLKDIV_DIVIDER_Pos (0) /*!< QSPI_T::CLKDIV: DIVIDER Position */ -#define QSPI_CLKDIV_DIVIDER_Msk (0x1fful << QSPI_CLKDIV_DIVIDER_Pos) /*!< QSPI_T::CLKDIV: DIVIDER Mask */ - -#define QSPI_SSCTL_SS_Pos (0) /*!< QSPI_T::SSCTL: SS Position */ -#define QSPI_SSCTL_SS_Msk (0x1ul << QSPI_SSCTL_SS_Pos) /*!< QSPI_T::SSCTL: SS Mask */ - -#define QSPI_SSCTL_SSACTPOL_Pos (2) /*!< QSPI_T::SSCTL: SSACTPOL Position */ -#define QSPI_SSCTL_SSACTPOL_Msk (0x1ul << QSPI_SSCTL_SSACTPOL_Pos) /*!< QSPI_T::SSCTL: SSACTPOL Mask */ - -#define QSPI_SSCTL_AUTOSS_Pos (3) /*!< QSPI_T::SSCTL: AUTOSS Position */ -#define QSPI_SSCTL_AUTOSS_Msk (0x1ul << QSPI_SSCTL_AUTOSS_Pos) /*!< QSPI_T::SSCTL: AUTOSS Mask */ - -#define QSPI_SSCTL_SLV3WIRE_Pos (4) /*!< QSPI_T::SSCTL: SLV3WIRE Position */ -#define QSPI_SSCTL_SLV3WIRE_Msk (0x1ul << QSPI_SSCTL_SLV3WIRE_Pos) /*!< QSPI_T::SSCTL: SLV3WIRE Mask */ - -#define QSPI_SSCTL_SLVTOIEN_Pos (5) /*!< QSPI_T::SSCTL: SLVTOIEN Position */ -#define QSPI_SSCTL_SLVTOIEN_Msk (0x1ul << QSPI_SSCTL_SLVTOIEN_Pos) /*!< QSPI_T::SSCTL: SLVTOIEN Mask */ - -#define QSPI_SSCTL_SLVTORST_Pos (6) /*!< QSPI_T::SSCTL: SLVTORST Position */ -#define QSPI_SSCTL_SLVTORST_Msk (0x1ul << QSPI_SSCTL_SLVTORST_Pos) /*!< QSPI_T::SSCTL: SLVTORST Mask */ - -#define QSPI_SSCTL_SLVBEIEN_Pos (8) /*!< QSPI_T::SSCTL: SLVBEIEN Position */ -#define QSPI_SSCTL_SLVBEIEN_Msk (0x1ul << QSPI_SSCTL_SLVBEIEN_Pos) /*!< QSPI_T::SSCTL: SLVBEIEN Mask */ - -#define QSPI_SSCTL_SLVURIEN_Pos (9) /*!< QSPI_T::SSCTL: SLVURIEN Position */ -#define QSPI_SSCTL_SLVURIEN_Msk (0x1ul << QSPI_SSCTL_SLVURIEN_Pos) /*!< QSPI_T::SSCTL: SLVURIEN Mask */ - -#define QSPI_SSCTL_SSACTIEN_Pos (12) /*!< QSPI_T::SSCTL: SSACTIEN Position */ -#define QSPI_SSCTL_SSACTIEN_Msk (0x1ul << QSPI_SSCTL_SSACTIEN_Pos) /*!< QSPI_T::SSCTL: SSACTIEN Mask */ - -#define QSPI_SSCTL_SSINAIEN_Pos (13) /*!< QSPI_T::SSCTL: SSINAIEN Position */ -#define QSPI_SSCTL_SSINAIEN_Msk (0x1ul << QSPI_SSCTL_SSINAIEN_Pos) /*!< QSPI_T::SSCTL: SSINAIEN Mask */ - -#define QSPI_SSCTL_SLVTOCNT_Pos (16) /*!< QSPI_T::SSCTL: SLVTOCNT Position */ -#define QSPI_SSCTL_SLVTOCNT_Msk (0xfffful << QSPI_SSCTL_SLVTOCNT_Pos) /*!< QSPI_T::SSCTL: SLVTOCNT Mask */ - -#define QSPI_PDMACTL_TXPDMAEN_Pos (0) /*!< QSPI_T::PDMACTL: TXPDMAEN Position */ -#define QSPI_PDMACTL_TXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_TXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: TXPDMAEN Mask */ - -#define QSPI_PDMACTL_RXPDMAEN_Pos (1) /*!< QSPI_T::PDMACTL: RXPDMAEN Position */ -#define QSPI_PDMACTL_RXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_RXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: RXPDMAEN Mask */ - -#define QSPI_PDMACTL_PDMARST_Pos (2) /*!< QSPI_T::PDMACTL: PDMARST Position */ -#define QSPI_PDMACTL_PDMARST_Msk (0x1ul << QSPI_PDMACTL_PDMARST_Pos) /*!< QSPI_T::PDMACTL: PDMARST Mask */ - -#define QSPI_FIFOCTL_RXRST_Pos (0) /*!< QSPI_T::FIFOCTL: RXRST Position */ -#define QSPI_FIFOCTL_RXRST_Msk (0x1ul << QSPI_FIFOCTL_RXRST_Pos) /*!< QSPI_T::FIFOCTL: RXRST Mask */ - -#define QSPI_FIFOCTL_TXRST_Pos (1) /*!< QSPI_T::FIFOCTL: TXRST Position */ -#define QSPI_FIFOCTL_TXRST_Msk (0x1ul << QSPI_FIFOCTL_TXRST_Pos) /*!< QSPI_T::FIFOCTL: TXRST Mask */ - -#define QSPI_FIFOCTL_RXTHIEN_Pos (2) /*!< QSPI_T::FIFOCTL: RXTHIEN Position */ -#define QSPI_FIFOCTL_RXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTHIEN Mask */ - -#define QSPI_FIFOCTL_TXTHIEN_Pos (3) /*!< QSPI_T::FIFOCTL: TXTHIEN Position */ -#define QSPI_FIFOCTL_TXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_TXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: TXTHIEN Mask */ - -#define QSPI_FIFOCTL_RXTOIEN_Pos (4) /*!< QSPI_T::FIFOCTL: RXTOIEN Position */ -#define QSPI_FIFOCTL_RXTOIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTOIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTOIEN Mask */ - -#define QSPI_FIFOCTL_RXOVIEN_Pos (5) /*!< QSPI_T::FIFOCTL: RXOVIEN Position */ -#define QSPI_FIFOCTL_RXOVIEN_Msk (0x1ul << QSPI_FIFOCTL_RXOVIEN_Pos) /*!< QSPI_T::FIFOCTL: RXOVIEN Mask */ - -#define QSPI_FIFOCTL_TXUFPOL_Pos (6) /*!< QSPI_T::FIFOCTL: TXUFPOL Position */ -#define QSPI_FIFOCTL_TXUFPOL_Msk (0x1ul << QSPI_FIFOCTL_TXUFPOL_Pos) /*!< QSPI_T::FIFOCTL: TXUFPOL Mask */ - -#define QSPI_FIFOCTL_TXUFIEN_Pos (7) /*!< QSPI_T::FIFOCTL: TXUFIEN Position */ -#define QSPI_FIFOCTL_TXUFIEN_Msk (0x1ul << QSPI_FIFOCTL_TXUFIEN_Pos) /*!< QSPI_T::FIFOCTL: TXUFIEN Mask */ - -#define QSPI_FIFOCTL_RXFBCLR_Pos (8) /*!< QSPI_T::FIFOCTL: RXFBCLR Position */ -#define QSPI_FIFOCTL_RXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_RXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: RXFBCLR Mask */ - -#define QSPI_FIFOCTL_TXFBCLR_Pos (9) /*!< QSPI_T::FIFOCTL: TXFBCLR Position */ -#define QSPI_FIFOCTL_TXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_TXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: TXFBCLR Mask */ - -#define QSPI_FIFOCTL_RXTH_Pos (24) /*!< QSPI_T::FIFOCTL: RXTH Position */ -#define QSPI_FIFOCTL_RXTH_Msk (0x7ul << QSPI_FIFOCTL_RXTH_Pos) /*!< QSPI_T::FIFOCTL: RXTH Mask */ - -#define QSPI_FIFOCTL_TXTH_Pos (28) /*!< QSPI_T::FIFOCTL: TXTH Position */ -#define QSPI_FIFOCTL_TXTH_Msk (0x7ul << QSPI_FIFOCTL_TXTH_Pos) /*!< QSPI_T::FIFOCTL: TXTH Mask */ - -#define QSPI_STATUS_BUSY_Pos (0) /*!< QSPI_T::STATUS: BUSY Position */ -#define QSPI_STATUS_BUSY_Msk (0x1ul << QSPI_STATUS_BUSY_Pos) /*!< QSPI_T::STATUS: BUSY Mask */ - -#define QSPI_STATUS_UNITIF_Pos (1) /*!< QSPI_T::STATUS: UNITIF Position */ -#define QSPI_STATUS_UNITIF_Msk (0x1ul << QSPI_STATUS_UNITIF_Pos) /*!< QSPI_T::STATUS: UNITIF Mask */ - -#define QSPI_STATUS_SSACTIF_Pos (2) /*!< QSPI_T::STATUS: SSACTIF Position */ -#define QSPI_STATUS_SSACTIF_Msk (0x1ul << QSPI_STATUS_SSACTIF_Pos) /*!< QSPI_T::STATUS: SSACTIF Mask */ - -#define QSPI_STATUS_SSINAIF_Pos (3) /*!< QSPI_T::STATUS: SSINAIF Position */ -#define QSPI_STATUS_SSINAIF_Msk (0x1ul << QSPI_STATUS_SSINAIF_Pos) /*!< QSPI_T::STATUS: SSINAIF Mask */ - -#define QSPI_STATUS_SSLINE_Pos (4) /*!< QSPI_T::STATUS: SSLINE Position */ -#define QSPI_STATUS_SSLINE_Msk (0x1ul << QSPI_STATUS_SSLINE_Pos) /*!< QSPI_T::STATUS: SSLINE Mask */ - -#define QSPI_STATUS_SLVTOIF_Pos (5) /*!< QSPI_T::STATUS: SLVTOIF Position */ -#define QSPI_STATUS_SLVTOIF_Msk (0x1ul << QSPI_STATUS_SLVTOIF_Pos) /*!< QSPI_T::STATUS: SLVTOIF Mask */ - -#define QSPI_STATUS_SLVBEIF_Pos (6) /*!< QSPI_T::STATUS: SLVBEIF Position */ -#define QSPI_STATUS_SLVBEIF_Msk (0x1ul << QSPI_STATUS_SLVBEIF_Pos) /*!< QSPI_T::STATUS: SLVBEIF Mask */ - -#define QSPI_STATUS_SLVURIF_Pos (7) /*!< QSPI_T::STATUS: SLVURIF Position */ -#define QSPI_STATUS_SLVURIF_Msk (0x1ul << QSPI_STATUS_SLVURIF_Pos) /*!< QSPI_T::STATUS: SLVURIF Mask */ - -#define QSPI_STATUS_RXEMPTY_Pos (8) /*!< QSPI_T::STATUS: RXEMPTY Position */ -#define QSPI_STATUS_RXEMPTY_Msk (0x1ul << QSPI_STATUS_RXEMPTY_Pos) /*!< QSPI_T::STATUS: RXEMPTY Mask */ - -#define QSPI_STATUS_RXFULL_Pos (9) /*!< QSPI_T::STATUS: RXFULL Position */ -#define QSPI_STATUS_RXFULL_Msk (0x1ul << QSPI_STATUS_RXFULL_Pos) /*!< QSPI_T::STATUS: RXFULL Mask */ - -#define QSPI_STATUS_RXTHIF_Pos (10) /*!< QSPI_T::STATUS: RXTHIF Position */ -#define QSPI_STATUS_RXTHIF_Msk (0x1ul << QSPI_STATUS_RXTHIF_Pos) /*!< QSPI_T::STATUS: RXTHIF Mask */ - -#define QSPI_STATUS_RXOVIF_Pos (11) /*!< QSPI_T::STATUS: RXOVIF Position */ -#define QSPI_STATUS_RXOVIF_Msk (0x1ul << QSPI_STATUS_RXOVIF_Pos) /*!< QSPI_T::STATUS: RXOVIF Mask */ - -#define QSPI_STATUS_RXTOIF_Pos (12) /*!< QSPI_T::STATUS: RXTOIF Position */ -#define QSPI_STATUS_RXTOIF_Msk (0x1ul << QSPI_STATUS_RXTOIF_Pos) /*!< QSPI_T::STATUS: RXTOIF Mask */ - -#define QSPI_STATUS_SPIENSTS_Pos (15) /*!< QSPI_T::STATUS: SPIENSTS Position */ -#define QSPI_STATUS_SPIENSTS_Msk (0x1ul << QSPI_STATUS_SPIENSTS_Pos) /*!< QSPI_T::STATUS: SPIENSTS Mask */ - -#define QSPI_STATUS_TXEMPTY_Pos (16) /*!< QSPI_T::STATUS: TXEMPTY Position */ -#define QSPI_STATUS_TXEMPTY_Msk (0x1ul << QSPI_STATUS_TXEMPTY_Pos) /*!< QSPI_T::STATUS: TXEMPTY Mask */ - -#define QSPI_STATUS_TXFULL_Pos (17) /*!< QSPI_T::STATUS: TXFULL Position */ -#define QSPI_STATUS_TXFULL_Msk (0x1ul << QSPI_STATUS_TXFULL_Pos) /*!< QSPI_T::STATUS: TXFULL Mask */ - -#define QSPI_STATUS_TXTHIF_Pos (18) /*!< QSPI_T::STATUS: TXTHIF Position */ -#define QSPI_STATUS_TXTHIF_Msk (0x1ul << QSPI_STATUS_TXTHIF_Pos) /*!< QSPI_T::STATUS: TXTHIF Mask */ - -#define QSPI_STATUS_TXUFIF_Pos (19) /*!< QSPI_T::STATUS: TXUFIF Position */ -#define QSPI_STATUS_TXUFIF_Msk (0x1ul << QSPI_STATUS_TXUFIF_Pos) /*!< QSPI_T::STATUS: TXUFIF Mask */ - -#define QSPI_STATUS_TXRXRST_Pos (23) /*!< QSPI_T::STATUS: TXRXRST Position */ -#define QSPI_STATUS_TXRXRST_Msk (0x1ul << QSPI_STATUS_TXRXRST_Pos) /*!< QSPI_T::STATUS: TXRXRST Mask */ - -#define QSPI_STATUS_RXCNT_Pos (24) /*!< QSPI_T::STATUS: RXCNT Position */ -#define QSPI_STATUS_RXCNT_Msk (0xful << QSPI_STATUS_RXCNT_Pos) /*!< QSPI_T::STATUS: RXCNT Mask */ - -#define QSPI_STATUS_TXCNT_Pos (28) /*!< QSPI_T::STATUS: TXCNT Position */ -#define QSPI_STATUS_TXCNT_Msk (0xful << QSPI_STATUS_TXCNT_Pos) /*!< QSPI_T::STATUS: TXCNT Mask */ - -#define QSPI_TX_TX_Pos (0) /*!< QSPI_T::TX: TX Position */ -#define QSPI_TX_TX_Msk (0xfffffffful << QSPI_TX_TX_Pos) /*!< QSPI_T::TX: TX Mask */ - -#define QSPI_RX_RX_Pos (0) /*!< QSPI_T::RX: RX Position */ -#define QSPI_RX_RX_Msk (0xfffffffful << QSPI_RX_RX_Pos) /*!< QSPI_T::RX: RX Mask */ - - - -/**@}*/ /* QSPI_CONST */ -/**@}*/ /* end of QSPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __QSPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/rtc_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/rtc_reg.h deleted file mode 100644 index 91f27a32d37..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/rtc_reg.h +++ /dev/null @@ -1,419 +0,0 @@ -/**************************************************************************//** - * @file rtc_reg.h - * @version V1.00 - * @brief RTC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __RTC_REG_H__ -#define __RTC_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Real Time Clock Controller -------------------------*/ -/** - @addtogroup RTC Real Time Clock Controller(RTC) - Memory Mapped Structure for RTC Controller -@{ */ - -typedef struct -{ - - - /** - * @var RTC_T::INIT - * Offset: 0x00 RTC Initiation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INIT_ACTIVE|RTC Active Status (Read Only) - * | | |0 = RTC is at reset state. - * | | |1 = RTC is at normal active state. - * |[31:1] |INIT |RTC Initiation - * | | |When RTC block is powered on, RTC is at reset state - * | | |User has to write a number (0x a5eb1357) to INIT to make RTC leaving reset state - * | | |Once the INIT is written as 0xa5eb1357, the RTC will be in un-reset state permanently. - * | | |The INIT is a write-only field and read value will be always 0. - * @var RTC_T::FREQADJ - * Offset: 0x08 RTC Frequency Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |FRACTION |Fraction Part - * | | |Formula: FRACTION = (fraction part of detected value) X 64. - * | | |Note: Digit in FCR must be expressed as hexadecimal number. - * |[12:8] |INTEGER |Integer Part - * | | |00000 = Integer part of detected value is 32752. - * | | |00001 = Integer part of detected value is 32753. - * | | |00010 = Integer part of detected value is 32754. - * | | |00011 = Integer part of detected value is 32755. - * | | |00100 = Integer part of detected value is 32756. - * | | |00101 = Integer part of detected value is 32757. - * | | |00110 = Integer part of detected value is 32758. - * | | |00111 = Integer part of detected value is 32759. - * | | |01000 = Integer part of detected value is 32760. - * | | |01001 = Integer part of detected value is 32761. - * | | |01010 = Integer part of detected value is 32762. - * | | |01011 = Integer part of detected value is 32763. - * | | |01100 = Integer part of detected value is 32764. - * | | |01101 = Integer part of detected value is 32765. - * | | |01110 = Integer part of detected value is 32766. - * | | |01111 = Integer part of detected value is 32767. - * | | |10000 = Integer part of detected value is 32768. - * | | |10001 = Integer part of detected value is 32769. - * | | |10010 = Integer part of detected value is 32770. - * | | |10011 = Integer part of detected value is 32771. - * | | |10100 = Integer part of detected value is 32772. - * | | |10101 = Integer part of detected value is 32773. - * | | |10110 = Integer part of detected value is 32774. - * | | |10111 = Integer part of detected value is 32775. - * | | |11000 = Integer part of detected value is 32776. - * | | |11001 = Integer part of detected value is 32777. - * | | |11010 = Integer part of detected value is 32778. - * | | |11011 = Integer part of detected value is 32779. - * | | |11100 = Integer part of detected value is 32780. - * | | |11101 = Integer part of detected value is 32781. - * | | |11110 = Integer part of detected value is 32782. - * | | |11111 = Integer part of detected value is 32783. - * @var RTC_T::TIME - * Offset: 0x0C RTC Time Loading Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit (0~5) - * |[11:8] |MIN |1-Min Time Digit (0~9) - * |[14:12] |TENMIN |10-Min Time Digit (0~5) - * |[19:16] |HR |1-Hour Time Digit (0~9) - * |[21:20] |TENHR |10-Hour Time Digit (0~2) - * | | |When RTC runs as 12-hour time scale mode, RTC_TIME[21] (the high bit of TENHR[1:0]) means AM/PM indication (If RTC_TIME[21] is 1, it indicates PM time message.) - * |[30:24] |HZCNT |Index of sub-second counter(0x00 ~0x7F) - * @var RTC_T::CAL - * Offset: 0x10 RTC Calendar Loading Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit (0~3) - * |[11:8] |MON |1-Month Calendar Digit (0~9) - * |[12] |TENMON |10-Month Calendar Digit (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit (0~9) - * @var RTC_T::CLKFMT - * Offset: 0x14 RTC Time Scale Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |24HEN |24-hour / 12-hour Time Scale Selection - * | | |Indicates that RTC_TIME and RTC_TALM are in 24-hour time scale or 12-hour time scale - * | | |0 = 12-hour time scale with AM and PM indication selected. - * | | |1 = 24-hour time scale selected. - * |[8] |HZCNTEN |Sub-second Counter Enable Bit - * | | |0 = HZCNT disabled in RTC_TIME and RTC_TALM. - * | | |1 = HZCNT enabled in RTC_TIME and RTC_TALM . - * @var RTC_T::WEEKDAY - * Offset: 0x18 RTC Day of the Week Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |WEEKDAY |Day of the Week Register - * | | |000 = Sunday. - * | | |001 = Monday. - * | | |010 = Tuesday. - * | | |011 = Wednesday. - * | | |100 = Thursday. - * | | |101 = Friday. - * | | |110 = Saturday. - * | | |111 = Reserved. - * @var RTC_T::TALM - * Offset: 0x1C RTC Time Alarm Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit of Alarm Setting (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit of Alarm Setting (0~5) - * |[11:8] |MIN |1-Min Time Digit of Alarm Setting (0~9) - * |[14:12] |TENMIN |10-Min Time Digit of Alarm Setting (0~5) - * |[19:16] |HR |1-Hour Time Digit of Alarm Setting (0~9) - * |[21:20] |TENHR |10-Hour Time Digit of Alarm Setting (0~2) - * | | |When RTC runs as 12-hour time scale mode, RTC_TIME[21] (the high bit of TENHR[1:0]) means AM/PM indication (If RTC_TIME[21] is 1, it indicates PM time message.) - * |[30:24] |HZCNT |Index of sub-second counter(0x00 ~0x7F) - * @var RTC_T::CALM - * Offset: 0x20 RTC Calendar Alarm Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit of Alarm Setting (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit of Alarm Setting (0~3) - * |[11:8] |MON |1-Month Calendar Digit of Alarm Setting (0~9) - * |[12] |TENMON |10-Month Calendar Digit of Alarm Setting (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit of Alarm Setting (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit of Alarm Setting (0~9) - * @var RTC_T::LEAPYEAR - * Offset: 0x24 RTC Leap Year Indicator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LEAPYEAR |Leap Year Indication Register (Read Only) - * | | |0 = This year is not a leap year. - * | | |1 = This year is leap year. - * @var RTC_T::INTEN - * Offset: 0x28 RTC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALMIEN |Alarm Interrupt Enable Bit - * | | |Set ALMIEN to 1 can also enable chip wake-up function when RTC alarm interrupt event is generated. - * | | |0 = RTC Alarm interrupt Disabled. - * | | |1 = RTC Alarm interrupt Enabled. - * |[1] |TICKIEN |Time Tick Interrupt Enable Bit - * @var RTC_T::INTSTS - * Offset: 0x2C RTC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALMIF |RTC Alarm Interrupt Flag - * | | |0 = Alarm condition is not matched. - * | | |1 = Alarm condition is matched. - * | | |Note: Write 1 to clear this bit. - * |[1] |TICKIF |RTC Time Tick Interrupt Flag - * @var RTC_T::TICK - * Offset: 0x30 RTC Time Tick Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TICK |Time Tick Register - * | | |These bits are used to select RTC time tick period for Periodic Time Tick Interrupt request. - * | | |000 = Time tick is 1 second. - * | | |001 = Time tick is 1/2 second. - * | | |010 = Time tick is 1/4 second. - * | | |011 = Time tick is 1/8 second. - * | | |100 = Time tick is 1/16 second. - * | | |101 = Time tick is 1/32 second. - * | | |110 = Time tick is 1/64 second. - * | | |111 = Time tick is 1/128 second. - * | | |Note: This register can be read back after the RTC register access enable bit RWENF (RTC_RWEN[16]) is active. - * @var RTC_T::TAMSK - * Offset: 0x34 RTC Time Alarm Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSEC |Mask 1-Sec Time Digit of Alarm Setting (0~9) - * |[1] |MTENSEC |Mask 10-Sec Time Digit of Alarm Setting (0~5) - * |[2] |MMIN |Mask 1-Min Time Digit of Alarm Setting (0~9) - * |[3] |MTENMIN |Mask 10-Min Time Digit of Alarm Setting (0~5) - * |[4] |MHR |Mask 1-Hour Time Digit of Alarm Setting (0~9) - * | | |Note: MHR function is only for 24-hour time scale mode. - * |[5] |MTENHR |Mask 10-Hour Time Digit of Alarm Setting (0~2) - * | | |Note: MTENHR function is only for 24-hour time scale mode. - * @var RTC_T::CAMSK - * Offset: 0x38 RTC Calendar Alarm Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MDAY |Mask 1-Day Calendar Digit of Alarm Setting (0~9) - * |[1] |MTENDAY |Mask 10-Day Calendar Digit of Alarm Setting (0~3) - * |[2] |MMON |Mask 1-Month Calendar Digit of Alarm Setting (0~9) - * |[3] |MTENMON |Mask 10-Month Calendar Digit of Alarm Setting (0~1) - * |[4] |MYEAR |Mask 1-Year Calendar Digit of Alarm Setting (0~9) - * |[5] |MTENYEAR |Mask 10-Year Calendar Digit of Alarm Setting (0~9) - * @var RTC_T::LXTCTL - * Offset: 0x100 RTC 32.768 kHz Oscillator Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |C32KS |Clock 32K Source Selection: - * | | |0 = Internal 32K clock is from 32K crystal . - * | | |1 = Internal 32K clock is from LIRC32K. - */ - __IO uint32_t INIT; /*!< [0x0000] RTC Initiation Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t FREQADJ; /*!< [0x0008] RTC Frequency Compensation Register */ - __IO uint32_t TIME; /*!< [0x000c] RTC Time Loading Register */ - __IO uint32_t CAL; /*!< [0x0010] RTC Calendar Loading Register */ - __IO uint32_t CLKFMT; /*!< [0x0014] RTC Time Scale Selection Register */ - __IO uint32_t WEEKDAY; /*!< [0x0018] RTC Day of the Week Register */ - __IO uint32_t TALM; /*!< [0x001c] RTC Time Alarm Register */ - __IO uint32_t CALM; /*!< [0x0020] RTC Calendar Alarm Register */ - __I uint32_t LEAPYEAR; /*!< [0x0024] RTC Leap Year Indicator Register */ - __IO uint32_t INTEN; /*!< [0x0028] RTC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x002c] RTC Interrupt Status Register */ - __IO uint32_t TICK; /*!< [0x0030] RTC Time Tick Register */ - __IO uint32_t TAMSK; /*!< [0x0034] RTC Time Alarm Mask Register */ - __IO uint32_t CAMSK; /*!< [0x0038] RTC Calendar Alarm Mask Register */ - __I uint32_t RESERVE1[49]; /* 0x3C ~ 0xFC */ - __IO uint32_t LXTCTL; /*!< [0x0100] RTC 32.768 kHz Oscillator Control Register */ - -} RTC_T; - -/** - @addtogroup RTC_CONST RTC Bit Field Definition - Constant Definitions for RTC Controller -@{ */ - -#define RTC_INIT_ACTIVE_Pos (0) /*!< RTC_T::INIT: ACTIVE Position */ -#define RTC_INIT_ACTIVE_Msk (0x1ul << RTC_INIT_ACTIVE_Pos) /*!< RTC_T::INIT: ACTIVE Mask */ - -#define RTC_INIT_INIT_Pos (1) /*!< RTC_T::INIT: INIT Position */ -#define RTC_INIT_INIT_Msk (0x7ffffffful << RTC_INIT_INIT_Pos) /*!< RTC_T::INIT: INIT Mask */ - -#define RTC_FREQADJ_FRACTION_Pos (0) /*!< RTC_T::FREQADJ: FRACTION Position */ -#define RTC_FREQADJ_FRACTION_Msk (0x3ful << RTC_FREQADJ_FRACTION_Pos) /*!< RTC_T::FREQADJ: FRACTION Mask */ - -#define RTC_FREQADJ_INTEGER_Pos (8) /*!< RTC_T::FREQADJ: INTEGER Position */ -#define RTC_FREQADJ_INTEGER_Msk (0x1ful << RTC_FREQADJ_INTEGER_Pos) /*!< RTC_T::FREQADJ: INTEGER Mask */ - -#define RTC_TIME_SEC_Pos (0) /*!< RTC_T::TIME: SEC Position */ -#define RTC_TIME_SEC_Msk (0xful << RTC_TIME_SEC_Pos) /*!< RTC_T::TIME: SEC Mask */ - -#define RTC_TIME_TENSEC_Pos (4) /*!< RTC_T::TIME: TENSEC Position */ -#define RTC_TIME_TENSEC_Msk (0x7ul << RTC_TIME_TENSEC_Pos) /*!< RTC_T::TIME: TENSEC Mask */ - -#define RTC_TIME_MIN_Pos (8) /*!< RTC_T::TIME: MIN Position */ -#define RTC_TIME_MIN_Msk (0xful << RTC_TIME_MIN_Pos) /*!< RTC_T::TIME: MIN Mask */ - -#define RTC_TIME_TENMIN_Pos (12) /*!< RTC_T::TIME: TENMIN Position */ -#define RTC_TIME_TENMIN_Msk (0x7ul << RTC_TIME_TENMIN_Pos) /*!< RTC_T::TIME: TENMIN Mask */ - -#define RTC_TIME_HR_Pos (16) /*!< RTC_T::TIME: HR Position */ -#define RTC_TIME_HR_Msk (0xful << RTC_TIME_HR_Pos) /*!< RTC_T::TIME: HR Mask */ - -#define RTC_TIME_TENHR_Pos (20) /*!< RTC_T::TIME: TENHR Position */ -#define RTC_TIME_TENHR_Msk (0x3ul << RTC_TIME_TENHR_Pos) /*!< RTC_T::TIME: TENHR Mask */ - -#define RTC_TIME_HZCNT_Pos (24) /*!< RTC_T::TIME: HZCNT Position */ -#define RTC_TIME_HZCNT_Msk (0x7ful << RTC_TIME_HZCNT_Pos) /*!< RTC_T::TIME: HZCNT Mask */ - -#define RTC_CAL_DAY_Pos (0) /*!< RTC_T::CAL: DAY Position */ -#define RTC_CAL_DAY_Msk (0xful << RTC_CAL_DAY_Pos) /*!< RTC_T::CAL: DAY Mask */ - -#define RTC_CAL_TENDAY_Pos (4) /*!< RTC_T::CAL: TENDAY Position */ -#define RTC_CAL_TENDAY_Msk (0x3ul << RTC_CAL_TENDAY_Pos) /*!< RTC_T::CAL: TENDAY Mask */ - -#define RTC_CAL_MON_Pos (8) /*!< RTC_T::CAL: MON Position */ -#define RTC_CAL_MON_Msk (0xful << RTC_CAL_MON_Pos) /*!< RTC_T::CAL: MON Mask */ - -#define RTC_CAL_TENMON_Pos (12) /*!< RTC_T::CAL: TENMON Position */ -#define RTC_CAL_TENMON_Msk (0x1ul << RTC_CAL_TENMON_Pos) /*!< RTC_T::CAL: TENMON Mask */ - -#define RTC_CAL_YEAR_Pos (16) /*!< RTC_T::CAL: YEAR Position */ -#define RTC_CAL_YEAR_Msk (0xful << RTC_CAL_YEAR_Pos) /*!< RTC_T::CAL: YEAR Mask */ - -#define RTC_CAL_TENYEAR_Pos (20) /*!< RTC_T::CAL: TENYEAR Position */ -#define RTC_CAL_TENYEAR_Msk (0xful << RTC_CAL_TENYEAR_Pos) /*!< RTC_T::CAL: TENYEAR Mask */ - -#define RTC_CLKFMT_24HEN_Pos (0) /*!< RTC_T::CLKFMT: 24HEN Position */ -#define RTC_CLKFMT_24HEN_Msk (0x1ul << RTC_CLKFMT_24HEN_Pos) /*!< RTC_T::CLKFMT: 24HEN Mask */ - -#define RTC_CLKFMT_HZCNTEN_Pos (8) /*!< RTC_T::CLKFMT: HZCNTEN Position */ -#define RTC_CLKFMT_HZCNTEN_Msk (0x1ul << RTC_CLKFMT_HZCNTEN_Pos) /*!< RTC_T::CLKFMT: HZCNTEN Mask */ - -#define RTC_WEEKDAY_WEEKDAY_Pos (0) /*!< RTC_T::WEEKDAY: WEEKDAY Position */ -#define RTC_WEEKDAY_WEEKDAY_Msk (0x7ul << RTC_WEEKDAY_WEEKDAY_Pos) /*!< RTC_T::WEEKDAY: WEEKDAY Mask */ - -#define RTC_TALM_SEC_Pos (0) /*!< RTC_T::TALM: SEC Position */ -#define RTC_TALM_SEC_Msk (0xful << RTC_TALM_SEC_Pos) /*!< RTC_T::TALM: SEC Mask */ - -#define RTC_TALM_TENSEC_Pos (4) /*!< RTC_T::TALM: TENSEC Position */ -#define RTC_TALM_TENSEC_Msk (0x7ul << RTC_TALM_TENSEC_Pos) /*!< RTC_T::TALM: TENSEC Mask */ - -#define RTC_TALM_MIN_Pos (8) /*!< RTC_T::TALM: MIN Position */ -#define RTC_TALM_MIN_Msk (0xful << RTC_TALM_MIN_Pos) /*!< RTC_T::TALM: MIN Mask */ - -#define RTC_TALM_TENMIN_Pos (12) /*!< RTC_T::TALM: TENMIN Position */ -#define RTC_TALM_TENMIN_Msk (0x7ul << RTC_TALM_TENMIN_Pos) /*!< RTC_T::TALM: TENMIN Mask */ - -#define RTC_TALM_HR_Pos (16) /*!< RTC_T::TALM: HR Position */ -#define RTC_TALM_HR_Msk (0xful << RTC_TALM_HR_Pos) /*!< RTC_T::TALM: HR Mask */ - -#define RTC_TALM_TENHR_Pos (20) /*!< RTC_T::TALM: TENHR Position */ -#define RTC_TALM_TENHR_Msk (0x3ul << RTC_TALM_TENHR_Pos) /*!< RTC_T::TALM: TENHR Mask */ - -#define RTC_TALM_HZCNT_Pos (24) /*!< RTC_T::TALM: HZCNT Position */ -#define RTC_TALM_HZCNT_Msk (0x7ful << RTC_TALM_HZCNT_Pos) /*!< RTC_T::TALM: HZCNT Mask */ - -#define RTC_CALM_DAY_Pos (0) /*!< RTC_T::CALM: DAY Position */ -#define RTC_CALM_DAY_Msk (0xful << RTC_CALM_DAY_Pos) /*!< RTC_T::CALM: DAY Mask */ - -#define RTC_CALM_TENDAY_Pos (4) /*!< RTC_T::CALM: TENDAY Position */ -#define RTC_CALM_TENDAY_Msk (0x3ul << RTC_CALM_TENDAY_Pos) /*!< RTC_T::CALM: TENDAY Mask */ - -#define RTC_CALM_MON_Pos (8) /*!< RTC_T::CALM: MON Position */ -#define RTC_CALM_MON_Msk (0xful << RTC_CALM_MON_Pos) /*!< RTC_T::CALM: MON Mask */ - -#define RTC_CALM_TENMON_Pos (12) /*!< RTC_T::CALM: TENMON Position */ -#define RTC_CALM_TENMON_Msk (0x1ul << RTC_CALM_TENMON_Pos) /*!< RTC_T::CALM: TENMON Mask */ - -#define RTC_CALM_YEAR_Pos (16) /*!< RTC_T::CALM: YEAR Position */ -#define RTC_CALM_YEAR_Msk (0xful << RTC_CALM_YEAR_Pos) /*!< RTC_T::CALM: YEAR Mask */ - -#define RTC_CALM_TENYEAR_Pos (20) /*!< RTC_T::CALM: TENYEAR Position */ -#define RTC_CALM_TENYEAR_Msk (0xful << RTC_CALM_TENYEAR_Pos) /*!< RTC_T::CALM: TENYEAR Mask */ - -#define RTC_LEAPYEAR_LEAPYEAR_Pos (0) /*!< RTC_T::LEAPYEAR: LEAPYEAR Position */ -#define RTC_LEAPYEAR_LEAPYEAR_Msk (0x1ul << RTC_LEAPYEAR_LEAPYEAR_Pos) /*!< RTC_T::LEAPYEAR: LEAPYEAR Mask */ - -#define RTC_INTEN_ALMIEN_Pos (0) /*!< RTC_T::INTEN: ALMIEN Position */ -#define RTC_INTEN_ALMIEN_Msk (0x1ul << RTC_INTEN_ALMIEN_Pos) /*!< RTC_T::INTEN: ALMIEN Mask */ - -#define RTC_INTEN_TICKIEN_Pos (1) /*!< RTC_T::INTEN: TICKIEN Position */ -#define RTC_INTEN_TICKIEN_Msk (0x1ul << RTC_INTEN_TICKIEN_Pos) /*!< RTC_T::INTEN: TICKIEN Mask */ - -#define RTC_INTSTS_ALMIF_Pos (0) /*!< RTC_T::INTSTS: ALMIF Position */ -#define RTC_INTSTS_ALMIF_Msk (0x1ul << RTC_INTSTS_ALMIF_Pos) /*!< RTC_T::INTSTS: ALMIF Mask */ - -#define RTC_INTSTS_TICKIF_Pos (1) /*!< RTC_T::INTSTS: TICKIF Position */ -#define RTC_INTSTS_TICKIF_Msk (0x1ul << RTC_INTSTS_TICKIF_Pos) /*!< RTC_T::INTSTS: TICKIF Mask */ - -#define RTC_TICK_TICK_Pos (0) /*!< RTC_T::TICK: TICK Position */ -#define RTC_TICK_TICK_Msk (0x7ul << RTC_TICK_TICK_Pos) /*!< RTC_T::TICK: TICK Mask */ - -#define RTC_TAMSK_MSEC_Pos (0) /*!< RTC_T::TAMSK: MSEC Position */ -#define RTC_TAMSK_MSEC_Msk (0x1ul << RTC_TAMSK_MSEC_Pos) /*!< RTC_T::TAMSK: MSEC Mask */ - -#define RTC_TAMSK_MTENSEC_Pos (1) /*!< RTC_T::TAMSK: MTENSEC Position */ -#define RTC_TAMSK_MTENSEC_Msk (0x1ul << RTC_TAMSK_MTENSEC_Pos) /*!< RTC_T::TAMSK: MTENSEC Mask */ - -#define RTC_TAMSK_MMIN_Pos (2) /*!< RTC_T::TAMSK: MMIN Position */ -#define RTC_TAMSK_MMIN_Msk (0x1ul << RTC_TAMSK_MMIN_Pos) /*!< RTC_T::TAMSK: MMIN Mask */ - -#define RTC_TAMSK_MTENMIN_Pos (3) /*!< RTC_T::TAMSK: MTENMIN Position */ -#define RTC_TAMSK_MTENMIN_Msk (0x1ul << RTC_TAMSK_MTENMIN_Pos) /*!< RTC_T::TAMSK: MTENMIN Mask */ - -#define RTC_TAMSK_MHR_Pos (4) /*!< RTC_T::TAMSK: MHR Position */ -#define RTC_TAMSK_MHR_Msk (0x1ul << RTC_TAMSK_MHR_Pos) /*!< RTC_T::TAMSK: MHR Mask */ - -#define RTC_TAMSK_MTENHR_Pos (5) /*!< RTC_T::TAMSK: MTENHR Position */ -#define RTC_TAMSK_MTENHR_Msk (0x1ul << RTC_TAMSK_MTENHR_Pos) /*!< RTC_T::TAMSK: MTENHR Mask */ - -#define RTC_CAMSK_MDAY_Pos (0) /*!< RTC_T::CAMSK: MDAY Position */ -#define RTC_CAMSK_MDAY_Msk (0x1ul << RTC_CAMSK_MDAY_Pos) /*!< RTC_T::CAMSK: MDAY Mask */ - -#define RTC_CAMSK_MTENDAY_Pos (1) /*!< RTC_T::CAMSK: MTENDAY Position */ -#define RTC_CAMSK_MTENDAY_Msk (0x1ul << RTC_CAMSK_MTENDAY_Pos) /*!< RTC_T::CAMSK: MTENDAY Mask */ - -#define RTC_CAMSK_MMON_Pos (2) /*!< RTC_T::CAMSK: MMON Position */ -#define RTC_CAMSK_MMON_Msk (0x1ul << RTC_CAMSK_MMON_Pos) /*!< RTC_T::CAMSK: MMON Mask */ - -#define RTC_CAMSK_MTENMON_Pos (3) /*!< RTC_T::CAMSK: MTENMON Position */ -#define RTC_CAMSK_MTENMON_Msk (0x1ul << RTC_CAMSK_MTENMON_Pos) /*!< RTC_T::CAMSK: MTENMON Mask */ - -#define RTC_CAMSK_MYEAR_Pos (4) /*!< RTC_T::CAMSK: MYEAR Position */ -#define RTC_CAMSK_MYEAR_Msk (0x1ul << RTC_CAMSK_MYEAR_Pos) /*!< RTC_T::CAMSK: MYEAR Mask */ - -#define RTC_CAMSK_MTENYEAR_Pos (5) /*!< RTC_T::CAMSK: MTENYEAR Position */ -#define RTC_CAMSK_MTENYEAR_Msk (0x1ul << RTC_CAMSK_MTENYEAR_Pos) /*!< RTC_T::CAMSK: MTENYEAR Mask */ - -#define RTC_LXTCTL_C32KS_Pos (7) /*!< RTC_T::LXTCTL: C32KS Position */ -#define RTC_LXTCTL_C32KS_Msk (0x1ul << RTC_LXTCTL_C32KS_Pos) /*!< RTC_T::LXTCTL: C32KS Mask */ - -/**@}*/ /* RTC_CONST */ -/**@}*/ /* end of RTC register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __RTC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/spi_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/spi_reg.h deleted file mode 100644 index f36fc296ebe..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/spi_reg.h +++ /dev/null @@ -1,788 +0,0 @@ -/**************************************************************************//** - * @file spi_reg.h - * @version V1.00 - * @brief SPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SPI_REG_H__ -#define __SPI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SPI Serial Peripheral Interface Controller(SPI) - Memory Mapped Structure for SPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var SPI_T::CTL - * Offset: 0x00 SPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIEN |SPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1. - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of SPIx_CTL, SPIx_CLKDIV, SPIx_SSCTL and SPIx_FIFOCTL registers, user shall clear the SPIEN (SPIx_CTL[0]) and confirm the SPIENSTS (SPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of SPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of SPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of SPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of SPI bus clock. - * |[3] |CLKPOL |Clock Polarity - * | | |0 = SPI bus clock is idle low. - * | | |1 = SPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval (Master Only) - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a transfer. - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word. - * | | |The default value is 0x3. - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 u2026. 0.5 SPICLK clock cycle. - * | | |SUSPITV = 0x1 u2026. 1.5 SPICLK clock cycle. - * | | |...... - * | | |SUSPITV = 0xE u2026. 14.5 SPICLK clock cycle. - * | | |SUSPITV = 0xF u2026. 15.5 SPICLK clock cycle. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 ... 8 bits. - * | | |DWIDTH = 0x09 ... 9 bits. - * | | |...... - * | | |DWIDTH = 0x1F ... 31 bits. - * | | |DWIDTH = 0x00 ... 32 bits. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the SPI TX register, is sent first to the SPI data output pin, and the first bit received from the SPI data input pin will be put in the LSB position of the RX register (bit 0 of SPI_RX). - * |[14] |HALFDPX |SPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for SPI transfer - * | | |The bit field DATDIR (SPIx_CTL[20]) can be used to set the data direction while in half-duplex transfer. - * | | |0 = SPI operates in full-duplex transfer. - * | | |1 = SPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only FUNCTION Mode Enable Bit (Master Only) - * | | |This bit field is only available in Master mode. - * | | |In receive-only mode, SPI Master will generate SPI bus clock continuously for receiving data bit from SPI slave device and assert the BUSY status. - * | | |If both AUTOSS (SPI_SSCTL[3]) and RXONLY are enabled, the output slave select signal will be activated. - * | | |0 = Receive-only function mode Disabled. - * | | |1 = Receive-only functionmode Enabled. - * | | |Note: We suggest users switch to receive-only mode when BUSY (SPI_STATUS[0]) is low. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = SPI unit transfer interrupt Disabled. - * | | |1 = SPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled. - * | | |A byte suspend interval will be inserted among each byte. - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: - * | | |Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction while in half-duplex transfer. - * | | |0 = SPI data is input direction. - * | | |1 = SPI data is output direction. - * @var SPI_T::CLKDIV - * Offset: 0x04 SPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the SPI bus clock of SPI Master - * | | |The frequency is obtained according to the following equation. - * | | | FREQ_spi_eclk = FREQ_spi_clock_src/(DIVIDER+1) - * | | |where - * | | | FREQ_spi_clock_src is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * | | |Note: Not supported in I2S mode. - * @var SPI_T::SSCTL - * Offset: 0x08 SPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control (Master Only) - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = set the SPIx_SS line to inactive state. - * | | |1 = set the SPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the SPIx_SS line at inactive state. - * | | |1 = SPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time. - * | | |The active state of SPIx_SS is specified in SSACTPOL (SPIx_SSCTL[2]). - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (SPIx_SS). - * | | |0 = The slave selection signal SPIx_SS is active low. - * | | |1 = The slave selection signal SPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit (Master Only) - * | | |0 = Automatic slave selection function Disabled. - * | | |Slave selection signal will be asserted/de-asserted according to SS (SPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * @var SPI_T::PDMACTL - * Offset: 0x0C SPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In SPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receiver PDMA function Disabled. - * | | |1 = Receiver PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the SPI controller. This bit will be automatically cleared to 0. - * @var SPI_T::FIFOCTL - * Offset: 0x10 SPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit. - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1. - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit. - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1. - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Slave Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The SPI data out is keep 0 if there is TX underflow event in Slave mode. - * | | |1 = The SPI data out is keep 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is not any data in TX FIFO when the slave selection signal is active. - * | | |2. This bit should be set as 0 in I2S mode. - * | | |3. When TX underflow event occurs, SPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward. - * | | |Data stored in TX FIFO will be sent through SPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer. - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer. - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1. - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[25:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0. - * | | |The MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length. - * |[29:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0. - * | | |The MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length. - * @var SPI_T::STATUS - * Offset: 0x14 SPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = SPI controller is in idle state. - * | | |1 = SPI controller is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. SPIx_CTL[0] = 1 and the TXEMPTY = 0. - * | | |b. For SPI Master mode, SPIx_CTL[0] = 1 and the TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Master mode, SPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d. For SPI Slave mode, the SPIx_CTL[0] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |e. For SPI Slave mode, the SPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = SPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode. - * | | |If SSACTPOL (SPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the SPI slave select is in inactive status. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBCEEIF also active when the slave select goes to inactive state - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the RXreceive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is over run. - * | | |1 = Receive FIFO is over run. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock periods in Master mode or over 576 SPI peripheral clock periods in Slave mode. - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |SPIENSTS |SPI Enable Status (Read Only) - * | | |0 = The SPI controller is disabled. - * | | |1 = The SPI controller is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock. - * | | |In order to make sure the SPI control logic is disabled, this bit indicates the real status of SPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slaveu2019s transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles. - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var SPI_T::TX - * Offset: 0x20 SPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 4-level transmit FIFO buffers. - * | | |The number of valid bits depends on the setting of DWIDTH (SPIx_CTL[12:8]) in SPI mode or WDWIDTH (SPIx_I2SCTL[5:4]) in I2S mode. - * | | |For exampleIn SPI mode, if DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted. - * | | |If DWIDTH is set to 0x00 , the SPI controller will perform a 32-bit transfer. - * | | |In I2S mode, if WDWIDTH (SPIx_I2SCTL[5:4]) is set to 0x2, the data width of audio channel is 24-bit and corresponding to TX[243:0]. - * | | |If WDWIDTH is set as 0x0, 0x1, or 0x3, all bits of this field are valid and referred to the data arrangement in I2S mode FIFO operation section. - * | | |Note: In Master mode, SPI controller will start to transfer the SPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var SPI_T::RX - * Offset: 0x30 SPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register - * | | |There are 8-/4-level FIFO buffers in this controller. - * | | |The data receive register holds the data received from SPI data input pin. - * | | |If the RXEMPTY (SPIx_STATUS[8] or SPIx_I2SSTS[8]) is not set to 1, the receive FIFO buffers can be accessed through software by reading this register. - * | | |This is a read only register. - * @var SPI_T::I2SCTL - * Offset: 0x60 I2S Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SEN |I2S Controller Enable Bit - * | | |0 = Disabled I2S mode. - * | | |1 = Enabled I2S mode. - * | | |Note: - * | | |1. If enable this bit, I2Sx_BCLK will start to output in master Master mode. - * | | |2. Before changing the configurations of SPIx_I2SCTL, SPIx_I2SCLK, and SPIx_FIFOCTL registers, user shall clear the I2SEN (SPIx_I2SCTL[0]) and confirm the I2SENSTS (SPIx_I2SSTS[15]) is 0. - * |[1] |TXEN |Transmit Enable Bit - * | | |0 = Data transmit Disabled. - * | | |1 = Data transmit Enabled. - * |[2] |RXEN |Receive Enable Bit - * | | |0 = Data receiving receive Disabled. - * | | |1 = Data receiving receive Enabled. - * |[3] |MUTE |Transmit Mute Enable Bit - * | | |0 = Transmit data is shifted from buffer. - * | | |1 = Transmit channel zero. - * |[5:4] |WDWIDTH |Word Width - * | | |00 = data size is 8-bit. - * | | |01 = data size is 16-bit. - * | | |10 = data size is 24-bit. - * | | |11 = data size is 32-bit. - * |[6] |MONO |Monaural Data - * | | |0 = Data is stereo format. - * | | |1 = Data is monaural format. - * |[7] |ORDER |Stereo Data Order in FIFO - * | | |0 = Left channel data at high byte. - * | | |1 = Left channel data at low byte. - * |[8] |SLAVE |Slave Mode - * | | |I2S can operate as master or slave - * | | |In Master mode, I2Sx_BCLK and I2Sx_LRCLK pins are output mode and send bit clock from M031 series to Audio audio CODEC chip. - * | | |In Slave mode, I2Sx_BCLK and I2Sx_LRCLK pins are input mode and I2Sx_BCLK and I2Sx_LRCLK signals are received from outer Audio audio CODEC chip. - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[15] |MCLKEN |Master Clock Enable Bit - * | | |If MCLKEN is set to 1, I2S controller will generate master clock on SPIx_I2SMCLK pin for external audio devices. - * | | |0 = Master clock Disabled. - * | | |1 = Master clock Enabled. - * |[16] |RZCEN |Right Channel Zero Cross Detection Enable Bit - * | | |If this bit is set to 1, when right channel data sign bit change or next shift data bits are all 0 then RZCIF flag in SPIx_I2SSTS register is set to 1. - * | | |This function is only available in transmit operation. - * | | |0 = Right channel zero cross detection Disabled. - * | | |1 = Right channel zero cross detection Enabled. - * |[17] |LZCEN |Left Channel Zero Cross Detection Enable Bit - * | | |If this bit is set to 1, when left channel data sign bit changes or next shift data bits are all 0 then LZCIF flag in SPIx_I2SSTS register is set to 1. - * | | |This function is only available in transmit operation. - * | | |0 = Left channel zero cross detection Disabled. - * | | |1 = Left channel zero cross detection Enabled. - * |[23] |RXLCH |Receive Left Channel Enable Bit - * | | |When monaural format is selected (MONO = 1), I2S controller will receive right channel data if RXLCH is set to 0, and receive left channel data if RXLCH is set to 1. - * | | |0 = Receive right channel data in Mono mode. - * | | |1 = Receive left channel data in Mono mode. - * |[24] |RZCIEN |Right Channel Zero- CCross Interrupt Enable Bit - * | | |Interrupt occurs if this bit is set to 1 and right channel zero- cross event occurs. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[25] |LZCIEN |Left Channel Zero- CCross Interrupt Enable Bit - * | | |Interrupt occurs if this bit is set to 1 and left channel zero- cross event occurs. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[29:28] |FORMAT |Data Format Selection - * | | |00 = I2S data format. - * | | |01 = MSB justified data format. - * | | |10 = PCM mode A. - * | | |11 = PCM mode B. - * @var SPI_T::I2SCLK - * Offset: 0x64 I2S Clock Divider Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |MCLKDIV |Master Clock Divider - * | | |If MCLKEN is set to 1, I2S controller will generate master clock for external audio devices. - * | | |The master clock rate, F_MCLK, is determined by the following expressions. - * | | |If MCLKDIV >= 1, F_MCLK = F_I2SCLK/(2x(MCLKDIV)). - * | | |If MCLKDIV = 0, F_MCLK = F_I2SCLK. - * | | |F_I2SCLK is the frequency of I2S peripheral clock. - * | | |In general, the master clock rate is 256 times sampling clock rate. - * |[17:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode. - * | | |The bit clock rate, F_BCLK, is determined by the following expression. - * | | |F_BCLK = F_I2SCLK /(2x(BCLKDIV + 1)) , where F_I2SCLK is the frequency of I2S peripheral clock. - * @var SPI_T::I2SSTS - * Offset: 0x68 I2S Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |RIGHT |Right Channel (Read Only) - * | | |This bit indicates the current transmit data is belong to which channel. - * | | |0 = Left channel. - * | | |1 = Right channel. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the Rxreceive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * | | |Note: If RXTHIEN = 1 and RXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock period in Master mode or over 576 SPI peripheral clock period in Slave mode. - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |I2SENSTS |I2S Enable Status (Read Only) - * | | |0 = The SPI/I2S control logic is disabled. - * | | |1 = The SPI/I2S control logic is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI/I2S controller logic is disabled, this bit indicates the real status of SPI/I2S controller logic for user. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * | | |Note: If TXTHIEN = 1 and TXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[19] |TXUFIF |Transmit FIFO Underflow Interrupt Flag - * | | |When the transmit FIFO buffer is empty and there is no datum written into the FIFO buffer, if there is more bus clock input, this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[20] |RZCIF |Right Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on right channel. - * | | |1 = Zero cross event occurred on right channel. - * |[21] |LZCIF |Left Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on left channel. - * | | |1 = Zero cross event occurred on left channel. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles. - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[26:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[30:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - */ - - __IO uint32_t CTL; /*!< [0x0000] SPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] SPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] SPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] SPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] SPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] SPI Status Register */ - __I uint32_t RESERVE0[2]; - __O uint32_t TX; /*!< [0x0020] SPI Data Transmit Register */ - __I uint32_t RESERVE1[3]; - __I uint32_t RX; /*!< [0x0030] SPI Data Receive Register */ - __I uint32_t RESERVE2[5]; /*!< [0x0034] Reserved */ - __IO uint32_t INTERNAL; /*!< [0x0048] SPI Internal Control Register */ - __I uint32_t RESERVE3; /*!< [0x004C] Reserved */ - __I uint32_t VER_NUM; /*!< [0x0050] SPI Version Number Register */ - __I uint32_t RESERVE4[3]; /*!< [0x0054] Reserved */ - __IO uint32_t I2SCTL; /*!< [0x0060] I2S Control Register */ - __IO uint32_t I2SCLK; /*!< [0x0064] I2S Clock Divider Control Register */ - __IO uint32_t I2SSTS; /*!< [0x0068] I2S Status Register */ - -} SPI_T; - -/** - @addtogroup SPI_CONST SPI Bit Field Definition - Constant Definitions for SPI Controller -@{ */ - -#define SPI_CTL_SPIEN_Pos (0) /*!< SPI_T::CTL: SPIEN Position */ -#define SPI_CTL_SPIEN_Msk (0x1ul << SPI_CTL_SPIEN_Pos) /*!< SPI_T::CTL: SPIEN Mask */ - -#define SPI_CTL_RXNEG_Pos (1) /*!< SPI_T::CTL: RXNEG Position */ -#define SPI_CTL_RXNEG_Msk (0x1ul << SPI_CTL_RXNEG_Pos) /*!< SPI_T::CTL: RXNEG Mask */ - -#define SPI_CTL_TXNEG_Pos (2) /*!< SPI_T::CTL: TXNEG Position */ -#define SPI_CTL_TXNEG_Msk (0x1ul << SPI_CTL_TXNEG_Pos) /*!< SPI_T::CTL: TXNEG Mask */ - -#define SPI_CTL_CLKPOL_Pos (3) /*!< SPI_T::CTL: CLKPOL Position */ -#define SPI_CTL_CLKPOL_Msk (0x1ul << SPI_CTL_CLKPOL_Pos) /*!< SPI_T::CTL: CLKPOL Mask */ - -#define SPI_CTL_SUSPITV_Pos (4) /*!< SPI_T::CTL: SUSPITV Position */ -#define SPI_CTL_SUSPITV_Msk (0xful << SPI_CTL_SUSPITV_Pos) /*!< SPI_T::CTL: SUSPITV Mask */ - -#define SPI_CTL_DWIDTH_Pos (8) /*!< SPI_T::CTL: DWIDTH Position */ -#define SPI_CTL_DWIDTH_Msk (0x1ful << SPI_CTL_DWIDTH_Pos) /*!< SPI_T::CTL: DWIDTH Mask */ - -#define SPI_CTL_LSB_Pos (13) /*!< SPI_T::CTL: LSB Position */ -#define SPI_CTL_LSB_Msk (0x1ul << SPI_CTL_LSB_Pos) /*!< SPI_T::CTL: LSB Mask */ - -#define SPI_CTL_HALFDPX_Pos (14) /*!< SPI_T::CTL: HALFDPX Position */ -#define SPI_CTL_HALFDPX_Msk (0x1ul << SPI_CTL_HALFDPX_Pos) /*!< SPI_T::CTL: HALFDPX Mask */ - -#define SPI_CTL_RXONLY_Pos (15) /*!< SPI_T::CTL: RXONLY Position */ -#define SPI_CTL_RXONLY_Msk (0x1ul << SPI_CTL_RXONLY_Pos) /*!< SPI_T::CTL: RXONLY Mask */ - -#define SPI_CTL_UNITIEN_Pos (17) /*!< SPI_T::CTL: UNITIEN Position */ -#define SPI_CTL_UNITIEN_Msk (0x1ul << SPI_CTL_UNITIEN_Pos) /*!< SPI_T::CTL: UNITIEN Mask */ - -#define SPI_CTL_SLAVE_Pos (18) /*!< SPI_T::CTL: SLAVE Position */ -#define SPI_CTL_SLAVE_Msk (0x1ul << SPI_CTL_SLAVE_Pos) /*!< SPI_T::CTL: SLAVE Mask */ - -#define SPI_CTL_REORDER_Pos (19) /*!< SPI_T::CTL: REORDER Position */ -#define SPI_CTL_REORDER_Msk (0x1ul << SPI_CTL_REORDER_Pos) /*!< SPI_T::CTL: REORDER Mask */ - -#define SPI_CTL_DATDIR_Pos (20) /*!< SPI_T::CTL: DATDIR Position */ -#define SPI_CTL_DATDIR_Msk (0x1ul << SPI_CTL_DATDIR_Pos) /*!< SPI_T::CTL: DATDIR Mask */ - -#define SPI_CLKDIV_DIVIDER_Pos (0) /*!< SPI_T::CLKDIV: DIVIDER Position */ -#define SPI_CLKDIV_DIVIDER_Msk (0x1fful << SPI_CLKDIV_DIVIDER_Pos) /*!< SPI_T::CLKDIV: DIVIDER Mask */ - -#define SPI_SSCTL_SS_Pos (0) /*!< SPI_T::SSCTL: SS Position */ -#define SPI_SSCTL_SS_Msk (0x1ul << SPI_SSCTL_SS_Pos) /*!< SPI_T::SSCTL: SS Mask */ - -#define SPI_SSCTL_SSACTPOL_Pos (2) /*!< SPI_T::SSCTL: SSACTPOL Position */ -#define SPI_SSCTL_SSACTPOL_Msk (0x1ul << SPI_SSCTL_SSACTPOL_Pos) /*!< SPI_T::SSCTL: SSACTPOL Mask */ - -#define SPI_SSCTL_AUTOSS_Pos (3) /*!< SPI_T::SSCTL: AUTOSS Position */ -#define SPI_SSCTL_AUTOSS_Msk (0x1ul << SPI_SSCTL_AUTOSS_Pos) /*!< SPI_T::SSCTL: AUTOSS Mask */ - -#define SPI_SSCTL_SLVBEIEN_Pos (8) /*!< SPI_T::SSCTL: SLVBEIEN Position */ -#define SPI_SSCTL_SLVBEIEN_Msk (0x1ul << SPI_SSCTL_SLVBEIEN_Pos) /*!< SPI_T::SSCTL: SLVBEIEN Mask */ - -#define SPI_SSCTL_SLVURIEN_Pos (9) /*!< SPI_T::SSCTL: SLVURIEN Position */ -#define SPI_SSCTL_SLVURIEN_Msk (0x1ul << SPI_SSCTL_SLVURIEN_Pos) /*!< SPI_T::SSCTL: SLVURIEN Mask */ - -#define SPI_SSCTL_SSACTIEN_Pos (12) /*!< SPI_T::SSCTL: SSACTIEN Position */ -#define SPI_SSCTL_SSACTIEN_Msk (0x1ul << SPI_SSCTL_SSACTIEN_Pos) /*!< SPI_T::SSCTL: SSACTIEN Mask */ - -#define SPI_SSCTL_SSINAIEN_Pos (13) /*!< SPI_T::SSCTL: SSINAIEN Position */ -#define SPI_SSCTL_SSINAIEN_Msk (0x1ul << SPI_SSCTL_SSINAIEN_Pos) /*!< SPI_T::SSCTL: SSINAIEN Mask */ - -#define SPI_PDMACTL_TXPDMAEN_Pos (0) /*!< SPI_T::PDMACTL: TXPDMAEN Position */ -#define SPI_PDMACTL_TXPDMAEN_Msk (0x1ul << SPI_PDMACTL_TXPDMAEN_Pos) /*!< SPI_T::PDMACTL: TXPDMAEN Mask */ - -#define SPI_PDMACTL_RXPDMAEN_Pos (1) /*!< SPI_T::PDMACTL: RXPDMAEN Position */ -#define SPI_PDMACTL_RXPDMAEN_Msk (0x1ul << SPI_PDMACTL_RXPDMAEN_Pos) /*!< SPI_T::PDMACTL: RXPDMAEN Mask */ - -#define SPI_PDMACTL_PDMARST_Pos (2) /*!< SPI_T::PDMACTL: PDMARST Position */ -#define SPI_PDMACTL_PDMARST_Msk (0x1ul << SPI_PDMACTL_PDMARST_Pos) /*!< SPI_T::PDMACTL: PDMARST Mask */ - -#define SPI_FIFOCTL_RXRST_Pos (0) /*!< SPI_T::FIFOCTL: RXRST Position */ -#define SPI_FIFOCTL_RXRST_Msk (0x1ul << SPI_FIFOCTL_RXRST_Pos) /*!< SPI_T::FIFOCTL: RXRST Mask */ - -#define SPI_FIFOCTL_TXRST_Pos (1) /*!< SPI_T::FIFOCTL: TXRST Position */ -#define SPI_FIFOCTL_TXRST_Msk (0x1ul << SPI_FIFOCTL_TXRST_Pos) /*!< SPI_T::FIFOCTL: TXRST Mask */ - -#define SPI_FIFOCTL_RXTHIEN_Pos (2) /*!< SPI_T::FIFOCTL: RXTHIEN Position */ -#define SPI_FIFOCTL_RXTHIEN_Msk (0x1ul << SPI_FIFOCTL_RXTHIEN_Pos) /*!< SPI_T::FIFOCTL: RXTHIEN Mask */ - -#define SPI_FIFOCTL_TXTHIEN_Pos (3) /*!< SPI_T::FIFOCTL: TXTHIEN Position */ -#define SPI_FIFOCTL_TXTHIEN_Msk (0x1ul << SPI_FIFOCTL_TXTHIEN_Pos) /*!< SPI_T::FIFOCTL: TXTHIEN Mask */ - -#define SPI_FIFOCTL_RXTOIEN_Pos (4) /*!< SPI_T::FIFOCTL: RXTOIEN Position */ -#define SPI_FIFOCTL_RXTOIEN_Msk (0x1ul << SPI_FIFOCTL_RXTOIEN_Pos) /*!< SPI_T::FIFOCTL: RXTOIEN Mask */ - -#define SPI_FIFOCTL_RXOVIEN_Pos (5) /*!< SPI_T::FIFOCTL: RXOVIEN Position */ -#define SPI_FIFOCTL_RXOVIEN_Msk (0x1ul << SPI_FIFOCTL_RXOVIEN_Pos) /*!< SPI_T::FIFOCTL: RXOVIEN Mask */ - -#define SPI_FIFOCTL_TXUFPOL_Pos (6) /*!< SPI_T::FIFOCTL: TXUFPOL Position */ -#define SPI_FIFOCTL_TXUFPOL_Msk (0x1ul << SPI_FIFOCTL_TXUFPOL_Pos) /*!< SPI_T::FIFOCTL: TXUFPOL Mask */ - -#define SPI_FIFOCTL_TXUFIEN_Pos (7) /*!< SPI_T::FIFOCTL: TXUFIEN Position */ -#define SPI_FIFOCTL_TXUFIEN_Msk (0x1ul << SPI_FIFOCTL_TXUFIEN_Pos) /*!< SPI_T::FIFOCTL: TXUFIEN Mask */ - -#define SPI_FIFOCTL_RXFBCLR_Pos (8) /*!< SPI_T::FIFOCTL: RXFBCLR Position */ -#define SPI_FIFOCTL_RXFBCLR_Msk (0x1ul << SPI_FIFOCTL_RXFBCLR_Pos) /*!< SPI_T::FIFOCTL: RXFBCLR Mask */ - -#define SPI_FIFOCTL_TXFBCLR_Pos (9) /*!< SPI_T::FIFOCTL: TXFBCLR Position */ -#define SPI_FIFOCTL_TXFBCLR_Msk (0x1ul << SPI_FIFOCTL_TXFBCLR_Pos) /*!< SPI_T::FIFOCTL: TXFBCLR Mask */ - -#define SPI_FIFOCTL_RXTH_Pos (24) /*!< SPI_T::FIFOCTL: RXTH Position */ -#define SPI_FIFOCTL_RXTH_Msk (0x7ul << SPI_FIFOCTL_RXTH_Pos) /*!< SPI_T::FIFOCTL: RXTH Mask */ - -#define SPI_FIFOCTL_TXTH_Pos (28) /*!< SPI_T::FIFOCTL: TXTH Position */ -#define SPI_FIFOCTL_TXTH_Msk (0x7ul << SPI_FIFOCTL_TXTH_Pos) /*!< SPI_T::FIFOCTL: TXTH Mask */ - -#define SPI_STATUS_BUSY_Pos (0) /*!< SPI_T::STATUS: BUSY Position */ -#define SPI_STATUS_BUSY_Msk (0x1ul << SPI_STATUS_BUSY_Pos) /*!< SPI_T::STATUS: BUSY Mask */ - -#define SPI_STATUS_UNITIF_Pos (1) /*!< SPI_T::STATUS: UNITIF Position */ -#define SPI_STATUS_UNITIF_Msk (0x1ul << SPI_STATUS_UNITIF_Pos) /*!< SPI_T::STATUS: UNITIF Mask */ - -#define SPI_STATUS_SSACTIF_Pos (2) /*!< SPI_T::STATUS: SSACTIF Position */ -#define SPI_STATUS_SSACTIF_Msk (0x1ul << SPI_STATUS_SSACTIF_Pos) /*!< SPI_T::STATUS: SSACTIF Mask */ - -#define SPI_STATUS_SSINAIF_Pos (3) /*!< SPI_T::STATUS: SSINAIF Position */ -#define SPI_STATUS_SSINAIF_Msk (0x1ul << SPI_STATUS_SSINAIF_Pos) /*!< SPI_T::STATUS: SSINAIF Mask */ - -#define SPI_STATUS_SSLINE_Pos (4) /*!< SPI_T::STATUS: SSLINE Position */ -#define SPI_STATUS_SSLINE_Msk (0x1ul << SPI_STATUS_SSLINE_Pos) /*!< SPI_T::STATUS: SSLINE Mask */ - -#define SPI_STATUS_SLVBEIF_Pos (6) /*!< SPI_T::STATUS: SLVBEIF Position */ -#define SPI_STATUS_SLVBEIF_Msk (0x1ul << SPI_STATUS_SLVBEIF_Pos) /*!< SPI_T::STATUS: SLVBEIF Mask */ - -#define SPI_STATUS_SLVURIF_Pos (7) /*!< SPI_T::STATUS: SLVURIF Position */ -#define SPI_STATUS_SLVURIF_Msk (0x1ul << SPI_STATUS_SLVURIF_Pos) /*!< SPI_T::STATUS: SLVURIF Mask */ - -#define SPI_STATUS_RXEMPTY_Pos (8) /*!< SPI_T::STATUS: RXEMPTY Position */ -#define SPI_STATUS_RXEMPTY_Msk (0x1ul << SPI_STATUS_RXEMPTY_Pos) /*!< SPI_T::STATUS: RXEMPTY Mask */ - -#define SPI_STATUS_RXFULL_Pos (9) /*!< SPI_T::STATUS: RXFULL Position */ -#define SPI_STATUS_RXFULL_Msk (0x1ul << SPI_STATUS_RXFULL_Pos) /*!< SPI_T::STATUS: RXFULL Mask */ - -#define SPI_STATUS_RXTHIF_Pos (10) /*!< SPI_T::STATUS: RXTHIF Position */ -#define SPI_STATUS_RXTHIF_Msk (0x1ul << SPI_STATUS_RXTHIF_Pos) /*!< SPI_T::STATUS: RXTHIF Mask */ - -#define SPI_STATUS_RXOVIF_Pos (11) /*!< SPI_T::STATUS: RXOVIF Position */ -#define SPI_STATUS_RXOVIF_Msk (0x1ul << SPI_STATUS_RXOVIF_Pos) /*!< SPI_T::STATUS: RXOVIF Mask */ - -#define SPI_STATUS_RXTOIF_Pos (12) /*!< SPI_T::STATUS: RXTOIF Position */ -#define SPI_STATUS_RXTOIF_Msk (0x1ul << SPI_STATUS_RXTOIF_Pos) /*!< SPI_T::STATUS: RXTOIF Mask */ - -#define SPI_STATUS_SPIENSTS_Pos (15) /*!< SPI_T::STATUS: SPIENSTS Position */ -#define SPI_STATUS_SPIENSTS_Msk (0x1ul << SPI_STATUS_SPIENSTS_Pos) /*!< SPI_T::STATUS: SPIENSTS Mask */ - -#define SPI_STATUS_TXEMPTY_Pos (16) /*!< SPI_T::STATUS: TXEMPTY Position */ -#define SPI_STATUS_TXEMPTY_Msk (0x1ul << SPI_STATUS_TXEMPTY_Pos) /*!< SPI_T::STATUS: TXEMPTY Mask */ - -#define SPI_STATUS_TXFULL_Pos (17) /*!< SPI_T::STATUS: TXFULL Position */ -#define SPI_STATUS_TXFULL_Msk (0x1ul << SPI_STATUS_TXFULL_Pos) /*!< SPI_T::STATUS: TXFULL Mask */ - -#define SPI_STATUS_TXTHIF_Pos (18) /*!< SPI_T::STATUS: TXTHIF Position */ -#define SPI_STATUS_TXTHIF_Msk (0x1ul << SPI_STATUS_TXTHIF_Pos) /*!< SPI_T::STATUS: TXTHIF Mask */ - -#define SPI_STATUS_TXUFIF_Pos (19) /*!< SPI_T::STATUS: TXUFIF Position */ -#define SPI_STATUS_TXUFIF_Msk (0x1ul << SPI_STATUS_TXUFIF_Pos) /*!< SPI_T::STATUS: TXUFIF Mask */ - -#define SPI_STATUS_TXRXRST_Pos (23) /*!< SPI_T::STATUS: TXRXRST Position */ -#define SPI_STATUS_TXRXRST_Msk (0x1ul << SPI_STATUS_TXRXRST_Pos) /*!< SPI_T::STATUS: TXRXRST Mask */ - -#define SPI_STATUS_RXCNT_Pos (24) /*!< SPI_T::STATUS: RXCNT Position */ -#define SPI_STATUS_RXCNT_Msk (0xful << SPI_STATUS_RXCNT_Pos) /*!< SPI_T::STATUS: RXCNT Mask */ - -#define SPI_STATUS_TXCNT_Pos (28) /*!< SPI_T::STATUS: TXCNT Position */ -#define SPI_STATUS_TXCNT_Msk (0xful << SPI_STATUS_TXCNT_Pos) /*!< SPI_T::STATUS: TXCNT Mask */ - -#define SPI_TX_TX_Pos (0) /*!< SPI_T::TX: TX Position */ -#define SPI_TX_TX_Msk (0xfffffffful << SPI_TX_TX_Pos) /*!< SPI_T::TX: TX Mask */ - -#define SPI_RX_RX_Pos (0) /*!< SPI_T::RX: RX Position */ -#define SPI_RX_RX_Msk (0xfffffffful << SPI_RX_RX_Pos) /*!< SPI_T::RX: RX Mask */ - -#define SPI_I2SCTL_I2SEN_Pos (0) /*!< SPI_T::I2SCTL: I2SEN Position */ -#define SPI_I2SCTL_I2SEN_Msk (0x1ul << SPI_I2SCTL_I2SEN_Pos) /*!< SPI_T::I2SCTL: I2SEN Mask */ - -#define SPI_I2SCTL_TXEN_Pos (1) /*!< SPI_T::I2SCTL: TXEN Position */ -#define SPI_I2SCTL_TXEN_Msk (0x1ul << SPI_I2SCTL_TXEN_Pos) /*!< SPI_T::I2SCTL: TXEN Mask */ - -#define SPI_I2SCTL_RXEN_Pos (2) /*!< SPI_T::I2SCTL: RXEN Position */ -#define SPI_I2SCTL_RXEN_Msk (0x1ul << SPI_I2SCTL_RXEN_Pos) /*!< SPI_T::I2SCTL: RXEN Mask */ - -#define SPI_I2SCTL_MUTE_Pos (3) /*!< SPI_T::I2SCTL: MUTE Position */ -#define SPI_I2SCTL_MUTE_Msk (0x1ul << SPI_I2SCTL_MUTE_Pos) /*!< SPI_T::I2SCTL: MUTE Mask */ - -#define SPI_I2SCTL_WDWIDTH_Pos (4) /*!< SPI_T::I2SCTL: WDWIDTH Position */ -#define SPI_I2SCTL_WDWIDTH_Msk (0x3ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPI_T::I2SCTL: WDWIDTH Mask */ - -#define SPI_I2SCTL_MONO_Pos (6) /*!< SPI_T::I2SCTL: MONO Position */ -#define SPI_I2SCTL_MONO_Msk (0x1ul << SPI_I2SCTL_MONO_Pos) /*!< SPI_T::I2SCTL: MONO Mask */ - -#define SPI_I2SCTL_ORDER_Pos (7) /*!< SPI_T::I2SCTL: ORDER Position */ -#define SPI_I2SCTL_ORDER_Msk (0x1ul << SPI_I2SCTL_ORDER_Pos) /*!< SPI_T::I2SCTL: ORDER Mask */ - -#define SPI_I2SCTL_SLAVE_Pos (8) /*!< SPI_T::I2SCTL: SLAVE Position */ -#define SPI_I2SCTL_SLAVE_Msk (0x1ul << SPI_I2SCTL_SLAVE_Pos) /*!< SPI_T::I2SCTL: SLAVE Mask */ - -#define SPI_I2SCTL_MCLKEN_Pos (15) /*!< SPI_T::I2SCTL: MCLKEN Position */ -#define SPI_I2SCTL_MCLKEN_Msk (0x1ul << SPI_I2SCTL_MCLKEN_Pos) /*!< SPI_T::I2SCTL: MCLKEN Mask */ - -#define SPI_I2SCTL_RZCEN_Pos (16) /*!< SPI_T::I2SCTL: RZCEN Position */ -#define SPI_I2SCTL_RZCEN_Msk (0x1ul << SPI_I2SCTL_RZCEN_Pos) /*!< SPI_T::I2SCTL: RZCEN Mask */ - -#define SPI_I2SCTL_LZCEN_Pos (17) /*!< SPI_T::I2SCTL: LZCEN Position */ -#define SPI_I2SCTL_LZCEN_Msk (0x1ul << SPI_I2SCTL_LZCEN_Pos) /*!< SPI_T::I2SCTL: LZCEN Mask */ - -#define SPI_I2SCTL_RXLCH_Pos (23) /*!< SPI_T::I2SCTL: RXLCH Position */ -#define SPI_I2SCTL_RXLCH_Msk (0x1ul << SPI_I2SCTL_RXLCH_Pos) /*!< SPI_T::I2SCTL: RXLCH Mask */ - -#define SPI_I2SCTL_RZCIEN_Pos (24) /*!< SPI_T::I2SCTL: RZCIEN Position */ -#define SPI_I2SCTL_RZCIEN_Msk (0x1ul << SPI_I2SCTL_RZCIEN_Pos) /*!< SPI_T::I2SCTL: RZCIEN Mask */ - -#define SPI_I2SCTL_LZCIEN_Pos (25) /*!< SPI_T::I2SCTL: LZCIEN Position */ -#define SPI_I2SCTL_LZCIEN_Msk (0x1ul << SPI_I2SCTL_LZCIEN_Pos) /*!< SPI_T::I2SCTL: LZCIEN Mask */ - -#define SPI_I2SCTL_FORMAT_Pos (28) /*!< SPI_T::I2SCTL: FORMAT Position */ -#define SPI_I2SCTL_FORMAT_Msk (0x3ul << SPI_I2SCTL_FORMAT_Pos) /*!< SPI_T::I2SCTL: FORMAT Mask */ - -#define SPI_I2SCLK_MCLKDIV_Pos (0) /*!< SPI_T::I2SCLK: MCLKDIV Position */ -#define SPI_I2SCLK_MCLKDIV_Msk (0x7ful << SPI_I2SCLK_MCLKDIV_Pos) /*!< SPI_T::I2SCLK: MCLKDIV Mask */ - -#define SPI_I2SCLK_BCLKDIV_Pos (8) /*!< SPI_T::I2SCLK: BCLKDIV Position */ -#define SPI_I2SCLK_BCLKDIV_Msk (0x3fful << SPI_I2SCLK_BCLKDIV_Pos) /*!< SPI_T::I2SCLK: BCLKDIV Mask */ - -#define SPI_I2SSTS_RIGHT_Pos (4) /*!< SPI_T::I2SSTS: RIGHT Position */ -#define SPI_I2SSTS_RIGHT_Msk (0x1ul << SPI_I2SSTS_RIGHT_Pos) /*!< SPI_T::I2SSTS: RIGHT Mask */ - -#define SPI_I2SSTS_RXEMPTY_Pos (8) /*!< SPI_T::I2SSTS: RXEMPTY Position */ -#define SPI_I2SSTS_RXEMPTY_Msk (0x1ul << SPI_I2SSTS_RXEMPTY_Pos) /*!< SPI_T::I2SSTS: RXEMPTY Mask */ - -#define SPI_I2SSTS_RXFULL_Pos (9) /*!< SPI_T::I2SSTS: RXFULL Position */ -#define SPI_I2SSTS_RXFULL_Msk (0x1ul << SPI_I2SSTS_RXFULL_Pos) /*!< SPI_T::I2SSTS: RXFULL Mask */ - -#define SPI_I2SSTS_RXTHIF_Pos (10) /*!< SPI_T::I2SSTS: RXTHIF Position */ -#define SPI_I2SSTS_RXTHIF_Msk (0x1ul << SPI_I2SSTS_RXTHIF_Pos) /*!< SPI_T::I2SSTS: RXTHIF Mask */ - -#define SPI_I2SSTS_RXOVIF_Pos (11) /*!< SPI_T::I2SSTS: RXOVIF Position */ -#define SPI_I2SSTS_RXOVIF_Msk (0x1ul << SPI_I2SSTS_RXOVIF_Pos) /*!< SPI_T::I2SSTS: RXOVIF Mask */ - -#define SPI_I2SSTS_RXTOIF_Pos (12) /*!< SPI_T::I2SSTS: RXTOIF Position */ -#define SPI_I2SSTS_RXTOIF_Msk (0x1ul << SPI_I2SSTS_RXTOIF_Pos) /*!< SPI_T::I2SSTS: RXTOIF Mask */ - -#define SPI_I2SSTS_I2SENSTS_Pos (15) /*!< SPI_T::I2SSTS: I2SENSTS Position */ -#define SPI_I2SSTS_I2SENSTS_Msk (0x1ul << SPI_I2SSTS_I2SENSTS_Pos) /*!< SPI_T::I2SSTS: I2SENSTS Mask */ - -#define SPI_I2SSTS_TXEMPTY_Pos (16) /*!< SPI_T::I2SSTS: TXEMPTY Position */ -#define SPI_I2SSTS_TXEMPTY_Msk (0x1ul << SPI_I2SSTS_TXEMPTY_Pos) /*!< SPI_T::I2SSTS: TXEMPTY Mask */ - -#define SPI_I2SSTS_TXFULL_Pos (17) /*!< SPI_T::I2SSTS: TXFULL Position */ -#define SPI_I2SSTS_TXFULL_Msk (0x1ul << SPI_I2SSTS_TXFULL_Pos) /*!< SPI_T::I2SSTS: TXFULL Mask */ - -#define SPI_I2SSTS_TXTHIF_Pos (18) /*!< SPI_T::I2SSTS: TXTHIF Position */ -#define SPI_I2SSTS_TXTHIF_Msk (0x1ul << SPI_I2SSTS_TXTHIF_Pos) /*!< SPI_T::I2SSTS: TXTHIF Mask */ - -#define SPI_I2SSTS_TXUFIF_Pos (19) /*!< SPI_T::I2SSTS: TXUFIF Position */ -#define SPI_I2SSTS_TXUFIF_Msk (0x1ul << SPI_I2SSTS_TXUFIF_Pos) /*!< SPI_T::I2SSTS: TXUFIF Mask */ - -#define SPI_I2SSTS_RZCIF_Pos (20) /*!< SPI_T::I2SSTS: RZCIF Position */ -#define SPI_I2SSTS_RZCIF_Msk (0x1ul << SPI_I2SSTS_RZCIF_Pos) /*!< SPI_T::I2SSTS: RZCIF Mask */ - -#define SPI_I2SSTS_LZCIF_Pos (21) /*!< SPI_T::I2SSTS: LZCIF Position */ -#define SPI_I2SSTS_LZCIF_Msk (0x1ul << SPI_I2SSTS_LZCIF_Pos) /*!< SPI_T::I2SSTS: LZCIF Mask */ - -#define SPI_I2SSTS_TXRXRST_Pos (23) /*!< SPI_T::I2SSTS: TXRXRST Position */ -#define SPI_I2SSTS_TXRXRST_Msk (0x1ul << SPI_I2SSTS_TXRXRST_Pos) /*!< SPI_T::I2SSTS: TXRXRST Mask */ - -#define SPI_I2SSTS_RXCNT_Pos (24) /*!< SPI_T::I2SSTS: RXCNT Position */ -#define SPI_I2SSTS_RXCNT_Msk (0x7ul << SPI_I2SSTS_RXCNT_Pos) /*!< SPI_T::I2SSTS: RXCNT Mask */ - -#define SPI_I2SSTS_TXCNT_Pos (28) /*!< SPI_T::I2SSTS: TXCNT Position */ -#define SPI_I2SSTS_TXCNT_Msk (0x7ul << SPI_I2SSTS_TXCNT_Pos) /*!< SPI_T::I2SSTS: TXCNT Mask */ - -/**@}*/ /* SPI_CONST */ -/**@}*/ /* end of SPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __SPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/sys_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/sys_reg.h deleted file mode 100644 index eaf4e2f7a85..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/sys_reg.h +++ /dev/null @@ -1,1484 +0,0 @@ -/**************************************************************************//** - * @file sys_reg.h - * @version V1.00 - * @brief SYS register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SYS_REG_H__ -#define __SYS_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SYS System Manger Controller (SYS) - Memory Mapped Structure for SYS Controller -@{ */ - -typedef struct -{ - - - /** - * @var SYS_T::PDID - * Offset: 0x00 Part Device Identification Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PDID |Part Device Identification Number (Read Only) - * | | |This register reflects device part number code. Software can read this register to identify which device is used. - * @var SYS_T::RSTSTS - * Offset: 0x04 System Reset Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PORF |POR Reset Flag - * | | |The POR reset flag is set by the "Reset Signal" from the Power-on Reset (POR) Controller or bit CHIPRST (SYS_IPRST0[0]) to indicate the previous reset source. - * | | |0 = No reset from POR or CHIPRST. - * | | |1 = Power-on Reset (POR) or CHIPRST had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |PINRF |NRESET Pin Reset Flag - * | | |The nRESET pin reset flag is set by the "Reset Signal" from the nRESET Pin to indicate the previous reset source. - * | | |0 = No reset from nRESET pin. - * | | |1 = Pin nRESET had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |WDTRF |WDT Reset Flag - * | | |The WDT reset flag is set by the "Reset Signal" from the Watchdog Timer or Window Watchdog Timer to indicate the previous reset source. - * | | |0 = No reset from watchdog timer or window watchdog timer. - * | | |1 = The watchdog timer or window watchdog timer had issued the reset signal to reset the system. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: Watchdog Timer register RSTF(WDT_CTL[2]) bit is set if the system has been reset by WDT time-out reset - * | | |Window Watchdog Timer register WWDTRF(WWDT_STATUS[1]) bit is set if the system has been reset by WWDT time-out reset. - * |[3] |LVRF |LVR Reset Flag - * | | |The LVR reset flag is set by the "Reset Signal" from the Low Voltage Reset Controller to indicate the previous reset source. - * | | |0 = No reset from LVR. - * | | |1 = LVR controller had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |BODRF |BOD Reset Flag - * | | |The BOD reset flag is set by the "Reset Signal" from the Brown-Out Detector to indicate the previous reset source. - * | | |0 = No reset from BOD. - * | | |1 = The BOD had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |SYSRF |System Reset Flag - * | | |The system reset flag is set by the "Reset Signal" from the Cortex-M0 Core to indicate the previous reset source. - * | | |0 = No reset from Cortex-M0. - * | | |1 = The Cortex- M0 had issued the reset signal to reset the system by writing 1 to the bit SYSRESETREQ(AIRCR[2], Application Interrupt and Reset Control Register, address = 0xE000ED0C) in system control registers of Cortex-M0 core. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |CPURF |CPU Reset Flag - * | | |The CPU reset flag is set by hardware if software writes CPURST (SYS_IPRST0[1]) 1 to reset Cortex- M0 Core and Flash Memory Controller (FMC). - * | | |0 = No reset from CPU. - * | | |1 = The Cortex-M0 Core and FMC are reset by software setting CPURST to 1. - * | | |Note: Write to clear this bit to 0. - * |[8] |CPULKRF |CPU Lockup Reset Flag - * | | |0 = No reset from CPU lockup happened. - * | | |1 = The Cortex-M0 lockup happened and chip is reset. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: When CPU lockup happened under ICE is connected, This flag will set to 1 but chip will not reset. - * @var SYS_T::IPRST0 - * Offset: 0x08 Peripheral Reset Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHIPRST |Chip One-shot Reset (Write Protect) - * | | |Setting this bit will reset the whole chip, including Processor core and all peripherals, and this bit will automatically return to 0 after the 2 clock cycles. - * | | |The CHIPRST is same as the POR reset, all the chip controllers is reset and the chip setting from flash are also reload. - * | | |About the difference between CHIPRST and SYSRESETREQ(AIRCR[2]), please refer to section 6.2.2. - * | | |0 = Chip normal operation. - * | | |1 = Chip one-shot reset. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Reset by powr on reset. - * |[1] |CPURST |Processor Core One-shot Reset (Write Protect) - * | | |Setting this bit will only reset the processor core and Flash Memory Controller(FMC), and this bit will automatically return to 0 after the 2 clock cycles. - * | | |0 = Processor core normal operation. - * | | |1 = Processor core one-shot reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PDMARST |PDMA Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the PDMA - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = PDMA controller normal operation. - * | | |1 = PDMA controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |EBIRST |EBI Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the EBI - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = EBI controller normal operation. - * | | |1 = EBI controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |HDIVRST |HDIV Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the hardware divider. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = Hardware divider controller normal operation. - * | | |1 = Hardware divider controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |CRCRST |CRC Calculation Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the CRC calculation controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CRC calculation controller normal operation. - * | | |1 = CRC calculation controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::IPRST1 - * Offset: 0x0C Peripheral Reset Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |GPIORST |GPIO Controller Reset - * | | |0 = GPIO controller normal operation. - * | | |1 = GPIO controller reset. - * |[2] |TMR0RST |Timer0 Controller Reset - * | | |0 = Timer0 controller normal operation. - * | | |1 = Timer0 controller reset. - * |[3] |TMR1RST |Timer1 Controller Reset - * | | |0 = Timer1 controller normal operation. - * | | |1 = Timer1 controller reset. - * |[4] |TMR2RST |Timer2 Controller Reset - * | | |0 = Timer2 controller normal operation. - * | | |1 = Timer2 controller reset. - * |[5] |TMR3RST |Timer3 Controller Reset - * | | |0 = Timer3 controller normal operation. - * | | |1 = Timer3 controller reset. - * |[7] |ACMP01RST |Analog Comparator 0/1 Controller Reset - * | | |0 = Analog Comparator 0/1 controller normal operation. - * | | |1 = Analog Comparator 0/1 controller reset. - * |[8] |I2C0RST |I2C0 Controller Reset - * | | |0 = I2C0 controller normal operation. - * | | |1 = I2C0 controller reset. - * |[9] |I2C1RST |I2C1 Controller Reset - * | | |0 = I2C1 controller normal operation. - * | | |1 = I2C1 controller reset. - * |[13] |SPI0RST |SPI0 Controller Reset - * | | |0 = SPI0 controller normal operation. - * | | |1 = SPI0 controller reset. - * |[16] |UART0RST |UART0 Controller Reset - * | | |0 = UART0 controller normal operation. - * | | |1 = UART0 controller reset. - * |[17] |UART1RST |UART1 Controller Reset - * | | |0 = UART1 controller normal operation. - * | | |1 = UART1 controller reset. - * |[18] |UART2RST |UART2 Controller Reset - * | | |0 = UART2 controller normal operation. - * | | |1 = UART2 controller reset. - * |[27] |USBDRST |USBD Controller Reset - * | | |0 = USBD controller normal operation. - * | | |1 = USBD controller reset. - * |[28] |ADCRST |ADC Controller Reset - * | | |0 = ADC controller normal operation. - * | | |1 = ADC controller reset. - * @var SYS_T::IPRST2 - * Offset: 0x10 Peripheral Reset Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |USCI0RST |USCI0 Controller Reset - * | | |0 = USCI0 controller normal operation. - * | | |1 = USCI0 controller reset. - * |[16] |PWM0RST |PWM0 Controller Reset - * | | |0 = PWM0 controller normal operation. - * | | |1 = PWM0 controller reset. - * |[17] |PWM1RST |PWM1 Controller Reset - * | | |0 = PWM1 controller normal operation. - * | | |1 = PWM1 controller reset. - * @var SYS_T::BODCTL - * Offset: 0x18 Brown-out Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODEN |Brown-out Detector Enable Bit (Write Protect) - * | | |The default value is set by flash controller user configuration register CBODEN (CONFIG0 [19]). - * | | |0 = Brown-out Detector function Disabled. - * | | |1 = Brown-out Detector function Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Reset by powr on reset. - * |[3] |BODRSTEN |Brown-out Reset Enable Bit (Write Protect) - * | | |The default value is set by flash controller user configuration register CBORST(CONFIG0[20]) bit . - * | | |0 = Brown-out "INTERRUPT" function Enabled. - * | | |1 = Brown-out "RESET" function Enabled. - * | | |Note1: - * | | |While the Brown-out Detector function is enabled (BODEN high) and BOD reset function is enabled (BODRSTEN high), BOD will assert a signal to reset chip when the detected voltage is lower than the threshold (BODOUT high). - * | | |While the BOD function is enabled (BODEN high) and BOD interrupt function is enabled (BODRSTEN low), BOD will assert an interrupt if BODOUT is high. BOD interrupt will keep till to the BODEN set to 0. BOD interrupt can be blocked by disabling the NVIC BOD interrupt or disabling BOD function (set BODEN low). - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note3: Reset by powr on reset. - * |[4] |BODIF |Brown-out Detector Interrupt Flag - * | | |0 = Brown-out Detector does not detect any voltage draft at VDD down through or up through the voltage of BODVL setting. - * | | |1 = When Brown-out Detector detects the VDD is dropped down through the voltage of BODVL setting or the VDD is raised up through the voltage of BODVL setting, this bit is set to 1 and the brown-out interrupt is requested if brown-out interrupt is enabled. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |BODLPM |Brown-out Detector Low Power Mode (Write Protect) - * | | |0 = BOD operate in normal mode (default). - * | | |1 = BOD Low Power mode Enabled. - * | | |Note1: The BOD consumes about 100uA in normal mode, the low power mode can reduce the current to about 1/10 but slow the BOD response. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |BODOUT |Brown-out Detector Output Status - * | | |0 = Brown-out Detector output status is 0. - * | | |It means the detected voltage is higher than BODVL setting or BODEN is 0. - * | | |1 = Brown-out Detector output status is 1. - * | | |It means the detected voltage is lower than BODVL setting. If the BODEN is 0, BOD function disabled , this bit always responds 0000. - * |[7] |LVREN |Low Voltage Reset Enable Bit (Write Protect) - * | | |The LVR function resets the chip when the input power voltage is lower than LVR circuit setting. LVR function is enabled by default. - * | | |0 = Low Voltage Reset function Disabled. - * | | |1 = Low Voltage Reset function Enabled. - * | | |Note1: After enabling the bit, the LVR function will be active with 200us delay for LVR output stable (default). - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10:8] |BODDGSEL |Brown-out Detector Output De-glitch Time Select (Write Protect) - * | | |000 = BOD output is sampled by RC32K clock. - * | | |001 = 64 system clock (HCLK). - * | | |010 = 128 system clock (HCLK). - * | | |011 = 256 system clock (HCLK). - * | | |100 = 512 system clock (HCLK). - * | | |101 = 1024 system clock (HCLK). - * | | |110 = 2048 system clock (HCLK). - * | | |111 = 4096 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[14:12] |LVRDGSEL |LVR Output De-glitch Time Select (Write Protect) - * | | |000 = Without de-glitch function. - * | | |001 = 64 system clock (HCLK). - * | | |010 = 128 system clock (HCLK). - * | | |011 = 256 system clock (HCLK). - * | | |100 = 512 system clock (HCLK). - * | | |101 = 1024 system clock (HCLK). - * | | |110 = 2048 system clock (HCLK). - * | | |111 = 4096 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[16] |BODVL |Brown-out Detector Threshold Voltage Selection (Write Protect) - * | | |The default value is set by flash controller user configuration register CBOV (CONFIG0 [21]). - * | | |0 = Brown-Out Detector threshold voltage is 2.0V. - * | | |1 = Brown-Out Detector threshold voltage is 2.5V. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Reset by powr on reset. - * @var SYS_T::PORCTL - * Offset: 0x24 Power-On-reset Controller Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |POROFF |Power-on Reset Enable Bit (Write Protect) - * | | |When powered on, the POR circuit generates a reset signal to reset the whole chip function, but noise on the power may cause the POR active again. User can disable internal POR circuit to avoid unpredictable noise to cause chip reset by writing 0x5AA5 to this field. - * | | |The POR function will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::GPA_MFPL - * Offset: 0x30 GPIOA Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA0MFP |PA.0 Multi-function Pin Selection - * |[7:4] |PA1MFP |PA.1 Multi-function Pin Selection - * |[11:8] |PA2MFP |PA.2 Multi-function Pin Selection - * |[15:12] |PA3MFP |PA.3 Multi-function Pin Selection - * |[19:16] |PA4MFP |PA.4 Multi-function Pin Selection - * |[23:20] |PA5MFP |PA.5 Multi-function Pin Selection - * |[27:24] |PA6MFP |PA.6 Multi-function Pin Selection - * |[31:28] |PA7MFP |PA.7 Multi-function Pin Selection - * @var SYS_T::GPA_MFPH - * Offset: 0x34 GPIOA High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA8MFP |PA.8 Multi-function Pin Selection - * |[7:4] |PA9MFP |PA.9 Multi-function Pin Selection - * |[11:8] |PA10MFP |PA.10 Multi-function Pin Selection - * |[15:12] |PA11MFP |PA.11 Multi-function Pin Selection - * |[19:16] |PA12MFP |PA.12 Multi-function Pin Selection - * |[23:20] |PA13MFP |PA.13 Multi-function Pin Selection - * |[27:24] |PA14MFP |PA.14 Multi-function Pin Selection - * |[31:28] |PA15MFP |PA.15 Multi-function Pin Selection - * @var SYS_T::GPB_MFPL - * Offset: 0x38 GPIOB Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB0MFP |PB.0 Multi-function Pin Selection - * |[7:4] |PB1MFP |PB.1 Multi-function Pin Selection - * |[11:8] |PB2MFP |PB.2 Multi-function Pin Selection - * |[15:12] |PB3MFP |PB.3 Multi-function Pin Selection - * |[19:16] |PB4MFP |PB.4 Multi-function Pin Selection - * |[23:20] |PB5MFP |PB.5 Multi-function Pin Selection - * |[27:24] |PB6MFP |PB.6 Multi-function Pin Selection - * |[31:28] |PB7MFP |PB.7 Multi-function Pin Selection - * @var SYS_T::GPB_MFPH - * Offset: 0x3C GPIOB High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB8MFP |PB.8 Multi-function Pin Selection - * |[7:4] |PB9MFP |PB.9 Multi-function Pin Selection - * |[11:8] |PB10MFP |PB.10 Multi-function Pin Selection - * |[15:12] |PB11MFP |PB.11 Multi-function Pin Selection - * |[19:16] |PB12MFP |PB.12 Multi-function Pin Selection - * |[23:20] |PB13MFP |PB.13 Multi-function Pin Selection - * |[27:24] |PB14MFP |PB.14 Multi-function Pin Selection - * |[31:28] |PB15MFP |PB.15 Multi-function Pin Selection - * @var SYS_T::GPC_MFPL - * Offset: 0x40 GPIOC Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC0MFP |PC.0 Multi-function Pin Selection - * |[7:4] |PC1MFP |PC.1 Multi-function Pin Selection - * |[11:8] |PC2MFP |PC.2 Multi-function Pin Selection - * |[15:12] |PC3MFP |PC.3 Multi-function Pin Selection - * |[19:16] |PC4MFP |PC.4 Multi-function Pin Selection - * |[23:20] |PC5MFP |PC.5 Multi-function Pin Selection - * |[27:24] |PC6MFP |PC.6 Multi-function Pin Selection - * |[31:28] |PC7MFP |PC.7 Multi-function Pin Selection - * @var SYS_T::GPC_MFPH - * Offset: 0x44 GPIOC High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC8MFP |PC.8 Multi-function Pin Selection - * |[7:4] |PC9MFP |PC.9 Multi-function Pin Selection - * |[11:8] |PC10MFP |PC.10 Multi-function Pin Selection - * |[15:12] |PC11MFP |PC.11 Multi-function Pin Selection - * |[19:16] |PC12MFP |PC.12 Multi-function Pin Selection - * |[23:20] |PC13MFP |PC.13 Multi-function Pin Selection - * |[27:24] |PC14MFP |PC.14 Multi-function Pin Selection - * |[31:28] |PC15MFP |PC.15 Multi-function Pin Selection - * @var SYS_T::GPD_MFPL - * Offset: 0x48 GPIOD Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD0MFP |PD.0 Multi-function Pin Selection - * |[7:4] |PD1MFP |PD.1 Multi-function Pin Selection - * |[11:8] |PD2MFP |PD.2 Multi-function Pin Selection - * |[15:12] |PD3MFP |PD.3 Multi-function Pin Selection - * |[19:16] |PD4MFP |PD.4 Multi-function Pin Selection - * |[23:20] |PD5MFP |PD.5 Multi-function Pin Selection - * |[27:24] |PD6MFP |PD.6 Multi-function Pin Selection - * |[31:28] |PD7MFP |PD.7 Multi-function Pin Selection - * @var SYS_T::GPD_MFPH - * Offset: 0x4C GPIOD High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD8MFP |PD.8 Multi-function Pin Selection - * |[7:4] |PD9MFP |PD.9 Multi-function Pin Selection - * |[11:8] |PD10MFP |PD.10 Multi-function Pin Selection - * |[15:12] |PD11MFP |PD.11 Multi-function Pin Selection - * |[19:16] |PD12MFP |PD.12 Multi-function Pin Selection - * |[23:20] |PD13MFP |PD.13 Multi-function Pin Selection - * |[27:24] |PD14MFP |PD.14 Multi-function Pin Selection - * |[31:28] |PD15MFP |PD.15 Multi-function Pin Selection - * @var SYS_T::GPF_MFPL - * Offset: 0x58 GPIOF Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF0MFP |PF.0 Multi-function Pin Selection - * |[7:4] |PF1MFP |PF.1 Multi-function Pin Selection - * |[11:8] |PF2MFP |PF.2 Multi-function Pin Selection - * |[15:12] |PF3MFP |PF.3 Multi-function Pin Selection - * |[19:16] |PF4MFP |PF.4 Multi-function Pin Selection - * |[23:20] |PF5MFP |PF.5 Multi-function Pin Selection - * |[27:24] |PF6MFP |PF.6 Multi-function Pin Selection - * |[31:28] |PF7MFP |PF.7 Multi-function Pin Selection - * @var SYS_T::GPF_MFPH - * Offset: 0x5C GPIOF High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF8MFP |PF.8 Multi-function Pin Selection - * |[7:4] |PF9MFP |PF.9 Multi-function Pin Selection - * |[11:8] |PF10MFP |PF.10 Multi-function Pin Selection - * |[15:12] |PF11MFP |PF.11 Multi-function Pin Selection - * |[19:16] |PF12MFP |PF.12 Multi-function Pin Selection - * |[23:20] |PF13MFP |PF.13 Multi-function Pin Selection - * |[27:24] |PF14MFP |PF.14 Multi-function Pin Selection - * |[31:28] |PF15MFP |PF.15 Multi-function Pin Selection - * @var SYS_T::LPLDOCTL - * Offset: 0x78 Low Power LDO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPLDO_EN |Low Power LDO Enalbe Bit - * | | |This bit enables uLDO voltage output. - * | | |0 = uLDO Voltage Output Disabled. - * | | |1 = uLDO Voltage Output Enabled. - * @var SYS_T::MODCTL - * Offset: 0xC0 Modulation Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MODEN |Modulation Function Enable Bit - * | | |This bit enables modulation funcion by modulating with PWM0 channel output and USCI0(USCI0_DAT0) or UART0(UART0_TXD) output. - * | | |0 = Modulation Function Disabled. - * | | |1 = Modulation Function Enabled. - * |[1] |MODH |Modulation at Data High - * | | |Select modulation pulse(PWM0) at high or low of UART0_TXD or USCI0_DAT0. - * | | |0: Modulation pulse at UART0_TXD low or USCI0_DAT0 low. - * | | |1: Modulation pulse at UART0_TXD high or USCI0_DAT0 high. - * |[7:4] |MODPWMSEL |PWM0 Channel Select for Modulation - * | | |Select the PWM0 channel to modulate with the UART0_TXD or USCI0_DAT0. - * | | |0000: PWM0 Channel 0 modulate with UART0_TXD. - * | | |0001: PWM0 Channel 1 modulate with UART0_TXD. - * | | |0010: PWM0 Channel 2 modulate with UART0_TXD. - * | | |0011: PWM0 Channel 3 modulete with UART0_TXD. - * | | |0100: PWM0 Channel 4 modulete with UART0_TXD. - * | | |0101: PWM0 Channel 5 modulete with UART0_TXD. - * | | |0110: Reserved. - * | | |0111: Reserved. - * | | |1000: PWM0 Channel 0 modulate with USCI0_DAT0. - * | | |1001: PWM0 Channel 1 modulate with USCI0_DAT0. - * | | |1010: PWM0 Channel 2 modulate with USCI0_DAT0. - * | | |1011: PWM0 Channel 3 modulete with USCI0_DAT0. - * | | |1100: PWM0 Channel 4 modulete with USCI0_DAT0. - * | | |1101: PWM0 Channel 5 modulete with USCI0_DAT0. - * | | |1110: Reserved. - * | | |1111: Reserved. - * | | |Note: This bis is valid while MODEN (SYS_MODCTL[0]) is set to 1. - * @var SYS_T::SRAM_BISTCTL - * Offset: 0xD0 System SRAM BIST Test Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |USBBIST |USB BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for USB RAM. - * | | |0 = system USB BIST Disabled. - * | | |1 = system USB BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |PDMABIST |PDMA BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for PDMA RAM. - * | | |0 = system PDMA BIST Disabled. - * | | |1 = system PDMA BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::SRAM_BISTSTS - * Offset: 0xD4 System SRAM BIST Test Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |USBBEF |USB SRAM BIST Fail Flag - * | | |0 = USB SRAM BIST test pass. - * | | |1 = USB SRAM BIST test fail. - * |[7] |PDMABISTF |PDMA SRAM BIST Failed Flag - * | | |0 = PDMA SRAM BIST pass. - * | | |1 = PDMA SRAM BIST failed. - * |[20] |USBBEND |USB SRAM BIST Test Finish - * | | |0 = USB SRAM BIST is active. - * | | |1 = USB SRAM BIST test finish. - * |[23] |PDMAEND |PDMA SRAM BIST Test Finish - * | | |0 = PDMA SRAM BIST is active. - * | | |1 = PDMA SRAM BIST test finish. - * @var SYS_T::HIRCTRIMCTL - * Offset: 0xF0 HIRC Trim Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FREQSEL |Trim Frequency Selection - * | | |This field indicates the target frequency of 48 MHz internal high speed RC oscillator (HIRC) auto trim. - * | | |During auto trim operation, if clock error detected with CESTOPEN is set to 1 or trim retry limitation count reached, this field will be cleared to 00 automatically. - * | | |00 = Disable HIRC auto trim function. - * | | |01 = Enable HIRC auto trim function and trim HIRC to 48 MHz. - * | | |10 = Reserved.. - * | | |11 = Reserved. - * |[5:4] |LOOPSEL |Trim Calculation Loop Selection - * | | |This field defines that trim value calculation is based on how many reference clocks. - * | | |00 = Trim value calculation is based on average difference in 4 clocks of reference clock. - * | | |01 = Trim value calculation is based on average difference in 8 clocks of reference clock. - * | | |10 = Trim value calculation is based on average difference in 16 clocks of reference clock. - * | | |11 = Trim value calculation is based on average difference in 32 clocks of reference clock. - * | | |Note: For example, if LOOPSEL is set as 00, auto trim circuit will calculate trim value based on the average frequency difference in 4 clocks of reference clock. - * |[7:6] |RETRYCNT |Trim Value Update Limitation Count - * | | |This field defines that how many times the auto trim circuit will try to update the HIRC trim value before the frequency of HIRC locked. - * | | |Once the HIRC locked, the internal trim value update counter will be reset. - * | | |If the trim value update counter reached this limitation value and frequency of HIRC still doesn't lock, the auto trim operation will be disabled and FREQSEL will be cleared to 00. - * | | |00 = Trim retry count limitation is 64 loops. - * | | |01 = Trim retry count limitation is 128 loops. - * | | |10 = Trim retry count limitation is 256 loops. - * | | |11 = Trim retry count limitation is 512 loops. - * |[8] |CESTOPEN |Clock Error Stop Enable Bit - * | | |0 = The trim operation is keep going if clock is inaccuracy. - * | | |1 = The trim operation is stopped if clock is inaccuracy. - * |[9] |BOUNDEN |Boundary Enable Bit - * | | |0 = Boundary function is disable. - * | | |1 = Boundary function is enable. - * |[10] |REFCKSEL |Reference Clock Selection - * | | |0 = HIRC trim reference clock is from LXT (32.768 kHz). - * | | |1 = HIRC trim reference clock is from USB SOF (Start-Of-Frame) packet. - * | | |Note1: HIRC trim reference clock is 40Khz in test mode. - * | | |Note2: HIRC trim reference clock support LXT or HXT or SOF depends on the chip spec. - * | | |For M031 16k/2k, RC trim supports HXT as reference clock . - * | | |For M031 32k/4k, RC trim supports LXT and HXT as reference clock . - * | | |For M031 64k/8k, RC trim supports LXT as reference clock . - * | | |For M031 128k/16k, RC trim supports LXT and SOF as reference clock . - * |[20:16] |BOUNDARY |Boundary Selection - * | | |Fill the boundary range from 0x1 to 0x1F, 0x0 is reserved.Reserved. - * | | |Note: This field is effective only when the BOUNDEN(SYS_HIRCTRIMCTL[9]) is enable. - * @var SYS_T::HIRCTRIMIEN - * Offset: 0xF4 HIRC Trim Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TFALIEN |Trim Failure Interrupt Enable Bit - * | | |This bit controls if an interrupt will be triggered while HIRC trim value update limitation count reached and HIRC frequency still not locked on target frequency set by FREQSEL(SYS_HIRCTRIMCTL[1:0]). - * | | |If this bit is high and TFAILIF(SYS_HIRCTRIMSTS[1]) is set during auto trim operation, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |0 = Disable TFAILIF(SYS_HIRCTRIMSTS[1]) status to trigger an interrupt to CPU. - * | | |1 = Enable TFAILIF(SYS_HIRCTRIMSTS[1]) status to trigger an interrupt to CPU. - * |[2] |CLKEIEN |Clock Error Interrupt Enable Bit - * | | |This bit controls if CPU would get an interrupt while clock is inaccuracy during auto trim operation. - * | | |If this bit is set to1, and CLKERRIF(SYS_HIRCTRIMSTS[2]) is set during auto trim operation, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |0 = Disable CLKERRIF(SYS_HIRCTRIMSTS[2]) status to trigger an interrupt to CPU. - * | | |1 = Enable CLKERRIF(SYS_HIRCTRIMSTS[2]) status to trigger an interrupt to CPU. - * @var SYS_T::HIRCTRIMSTS - * Offset: 0xF8 HIRC Trim Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FREQLOCK |HIRC Frequency Lock Status - * | | |This bit indicates the HIRC frequency is locked. - * | | |This is a status bit and doesn't trigger any interrupt. Write 1 to clear this to 0. This bit will be set automatically, if the frequecy is lock and the RC_TRIM is enabled. - * | | |0 = The internal high-speed oscillator frequency doesn't lock at 48 MHz yet. - * | | |1 = The internal high-speed oscillator frequency locked at 48 MHz. - * | | |Note: Reset by powr on reset. - * |[1] |TFAILIF |Trim Failure Interrupt Status - * | | |This bit indicates that HIRC trim value update limitation count reached and the HIRC clock frequency still doesn't be locked - * | | |Once this bit is set, the auto trim operation stopped and FREQSEL(SYS_HIRCTRIMCTL[1:0]) will be cleared to 00 by hardware automatically. - * | | |If this bit is set and TFAILIEN(SYS_HIRCIEN[1]) is high, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. Write 1 to clear this to 0. - * | | |0 = Trim value update limitation count does not reach. - * | | |1 = Trim value update limitation count reached and HIRC frequency still not locked. - * | | |Note: Reset by powr on reset. - * |[2] |CLKERIF |Clock Error Interrupt Status - * | | |When the frequency of 38.4 kHz external low speed crystal oscillator (LXT) or 48MHz internal high speed RC oscillator (HIRC) is shift larger to unreasonable value, this bit will be set and to be an indicate that clock frequency is inaccuracy. Once this bit is set to 1, the auto trim operation stopped and FREQSEL(SYS_HIRCTRIMCTL[1:0]) will be cleared to 00 by hardware automatically if CESTOPEN(SYS_HIRCTRIMCTL[8]) is set to 1. - * | | |If this bit is set and CLKEIEN(SYS_HIRCTIEN[2]) is high, an interrupt will be triggered to notify the clock frequency is inaccuracy. Write 1 to clear this to 0. - * | | |0 = Clock frequency is accuracy. - * | | |1 = Clock frequency is inaccuracy. - * | | |Note: Reset by powr on reset. - * |[3] |OVBDIF |Over Boundary Status - * | | |When the over boundary function is set, if there occurs the over boundary condition, this flag will be set. - * | | |0 = Over boundary coundition did not occur. - * | | |1 = Over boundary coundition occurred. - * | | |Note: Write 1 to clear this flag. - * @var SYS_T::REGLCTL - * Offset: 0x100 Register Lock Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REGLCTL |Register Lock Control Code (Write Only) - * | | |Some registers have write-protection function. - * | | |Writing these registers have to disable the protected function by writing the sequence value "59h", "16h", "88h" to this field. After this sequence is completed, the REGLCTL bit will be set to 1 and write-protection registers can be normal write. - * | | |REGLCTL[0] - * | | |Register Lock Control Disable Index (Read Only) - * | | |0 = Write-protection Enabled for writing protected registers. Any write to the protected register is ignored. - * | | |1 = Write-protection Disabled for writing protected registers. - * @var SYS_T::PORDISAN - * Offset: 0x1EC Analog POR Disable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |POROFFAN |Power-on Reset Enable Bit (Write Protect) - * | | |After powered on, User can turn off internal analog POR circuit to save power by writing 0x5AA5 to this field. - * | | |The analog POR circuit will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - */ - __I uint32_t PDID; /*!< [0x0000] Part Device Identification Number Register */ - __IO uint32_t RSTSTS; /*!< [0x0004] System Reset Status Register */ - __IO uint32_t IPRST0; /*!< [0x0008] Peripheral Reset Control Register 0 */ - __IO uint32_t IPRST1; /*!< [0x000c] Peripheral Reset Control Register 1 */ - __IO uint32_t IPRST2; /*!< [0x0010] Peripheral Reset Control Register 2 */ - __I uint32_t RESERVE0[1]; - __IO uint32_t BODCTL; /*!< [0x0018] Brown-out Detector Control Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t PORCTL; /*!< [0x0024] Power-On-reset Controller Register */ - __I uint32_t RESERVE2[2]; - __IO uint32_t GPA_MFPL; /*!< [0x0030] GPIOA Low Byte Multiple Function Control Register */ - __IO uint32_t GPA_MFPH; /*!< [0x0034] GPIOA High Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPL; /*!< [0x0038] GPIOB Low Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPH; /*!< [0x003c] GPIOB High Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPL; /*!< [0x0040] GPIOC Low Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPH; /*!< [0x0044] GPIOC High Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPL; /*!< [0x0048] GPIOD Low Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPH; /*!< [0x004c] GPIOD High Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPL; /*!< [0x0050] GPIOE Low Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPH; /*!< [0x0054] GPIOE High Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPL; /*!< [0x0058] GPIOF Low Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPH; /*!< [0x005c] GPIOF High Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPL; /*!< [0x0060] GPIOG High Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPH; /*!< [0x0064] GPIOG High Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPL; /*!< [0x0068] GPIOH High Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPH; /*!< [0x006c] GPIOH High Byte Multiple Function Control Register */ - __I uint32_t RESERVE3[2]; - __IO uint32_t LPLDOCTL; /*!< [0x0078] Low Power LDO Control Register */ - __I uint32_t RESERVE4[17]; - __IO uint32_t MODCTL; /*!< [0x00c0] Modulation Control Register */ - __I uint32_t RESERVE5[3]; - __IO uint32_t SRAM_BISTCTL; /*!< [0x00d0] System SRAM BIST Test Control Register */ - __I uint32_t SRAM_BISTSTS; /*!< [0x00d4] System SRAM BIST Test Status Register */ - __IO uint32_t SRAM_PARITY; /*!< [0x00d8] System SRAM Parity Test Control Register (Only for Testing) */ - __IO uint32_t SRAM_INTCTL; /*!< [0x00dc] System SRAM Interrupt Enable Control Register */ - __IO uint32_t SRAM_STATUS; /*!< [0x00e0] System SRAM Parity Error Status Register */ - __I uint32_t SRAM_ERRADDR; /*!< [0x00e4] System SRAM Parity Check Error Address Register */ - __I uint32_t RESERVE6[2]; - __IO uint32_t HIRCTRIMCTL; /*!< [0x00f0] HIRC Trim Control Register */ - __IO uint32_t HIRCTRIMIEN; /*!< [0x00f4] HIRC Trim Interrupt Enable Register */ - __IO uint32_t HIRCTRIMSTS; /*!< [0x00f8] HIRC Trim Interrupt Status Register */ - __I uint32_t RESERVE7[1]; - __O uint32_t REGLCTL; /*!< [0x0100] Register Lock Control Register */ - __I uint32_t RESERVE8[5]; - __IO uint32_t HIRCADJ; /*!< [0x0118] HIRC Trim Value Register */ - __I uint32_t RESERVE9[1]; - __I uint32_t LDOTRIM; /*!< [0x0120] LDO Trim Code Register */ - __I uint32_t LVR16TRIM; /*!< [0x0124] LVR16 Trim Code Register */ - __I uint32_t RESERVE10[4]; - __I uint32_t LIRCT; /*!< [0x0138] Low Speed Internal Oscillator Trim Code Register */ - __I uint32_t RESERVE11[5]; - __I uint32_t LVR17TRIM; /*!< [0x0150] LVR17 Trim Code Register */ - __I uint32_t LVR20TRIM; /*!< [0x0154] LVR20 Trim Code Register */ - __I uint32_t LVR25TRIM; /*!< [0x0158] LVR25 Trim Code Register */ - __I uint32_t uLDOVITRIM; /*!< [0x015c] ULDO V Trim and I TRIM Code Register */ - __IO uint32_t LVRITRIMSEL; /*!< [0x0160] LVR Itrim and Version Select Register */ - __I uint32_t RESERVE12[9]; - __IO uint32_t HIRCTCTL; /*!< [0x0188] HIRC Test Mode Control Register */ - __IO uint32_t ADCCHIP; /*!< [0x018c] R/W ADC CHIP Control Register */ - __IO uint32_t HXTTCTL; /*!< [0x0190] R/W HXT Test Mode Control Register */ - __I uint32_t RESERVE13[22]; - __IO uint32_t PORDISAN; /*!< [0x01ec] Analog POR Disable Control Register */ -} SYS_T; - -typedef struct -{ - - - /** - * @var NMI_T::NMIEN - * Offset: 0x00 NMI Source Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD NMI Source Enable (Write Protect) - * | | |0 = BOD NMI source Disabled. - * | | |1 = BOD NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |IRC_INT |IRC TRIM NMI Source Enable (Write Protect) - * | | |0 = IRC TRIM NMI source Disabled. - * | | |1 = IRC TRIM NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PWRWU_INT |Power-down Mode Wake-up NMI Source Enable (Write Protect) - * | | |0 = Power-down mode wake-up NMI source Disabled. - * | | |1 = Power-down mode wake-up NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |CLKFAIL |Clock Fail Detected and IRC Auto Trim Interrupt NMI Source Enable (Write Protect) - * | | |0 = Clock fail detected and IRC Auto Trim interrupt NMI source Disabled. - * | | |1 = Clock fail detected and IRC Auto Trim interrupt NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |EINT0 |External Interrupt From PA.6 or PB.5 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.6 or PB.5 pin NMI source Disabled. - * | | |1 = External interrupt from PA.6 or PB.5 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[9] |EINT1 |External Interrupt From PA.7, PB.4 or PD.15 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.7, PB.4 or PD.15 pin NMI source Disabled. - * | | |1 = External interrupt from PA.7, PB.4 or PD.15 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10] |EINT2 |External Interrupt From PB.3 or PC.6 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.3 or PC.6 pin NMI source Disabled. - * | | |1 = External interrupt from PB.3 or PC.6 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11] |EINT3 |External Interrupt From PB.2 or PC.7 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.2 or PC.7 pin NMI source Disabled. - * | | |1 = External interrupt from PB.2 or PC.7 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |EINT4 |External Interrupt From PA.8, PB.6 or PF.15 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.8, PB.6 or PF.15 pin NMI source Disabled. - * | | |1 = External interrupt from PA.8, PB.6 or PF.15 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |EINT5 |External Interrupt From PB.7 or PF.14 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.7 or PF.14 pin NMI source Disabled. - * | | |1 = External interrupt from PB.7 or PF.14 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[14] |UART0_INT |UART0 NMI Source Enable (Write Protect) - * | | |0 = UART0 NMI source Disabled. - * | | |1 = UART0 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[15] |UART1_INT |UART1 NMI Source Enable (Write Protect) - * | | |0 = UART1 NMI source Disabled. - * | | |1 = UART1 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var NMI_T::NMISTS - * Offset: 0x04 NMI Source Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD Interrupt Flag (Read Only) - * | | |0 = BOD interrupt is deasserted. - * | | |1 = BOD interrupt is asserted. - * |[1] |IRC_INT |IRC TRIM Interrupt Flag (Read Only) - * | | |0 = HIRC TRIM interrupt is deasserted. - * | | |1 = HIRC TRIM interrupt is asserted. - * |[2] |PWRWU_INT |Power-down Mode Wake-up Interrupt Flag (Read Only) - * | | |0 = Power-down mode wake-up interrupt is deasserted. - * | | |1 = Power-down mode wake-up interrupt is asserted. - * |[4] |CLKFAIL |Clock Fail Detected or IRC Auto Trim Interrupt Flag (Read Only) - * | | |0 = Clock fail detected or IRC Auto Trim interrupt is deasserted. - * | | |1 = Clock fail detected or IRC Auto Trim interrupt is asserted. - * |[8] |EINT0 |External Interrupt From PA.6 or PB.5 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.6 or PB.5 interrupt is deasserted. - * | | |1 = External Interrupt from PA.6 or PB.5 interrupt is asserted. - * |[9] |EINT1 |External Interrupt From PA.7, PB.4 or PD.15 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.7, PB.4 or PD.15 interrupt is deasserted. - * | | |1 = External Interrupt from PA.7, PB.4 or PD.15 interrupt is asserted. - * |[10] |EINT2 |External Interrupt From PB.3 or PC.6 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.3 or PC.6 interrupt is deasserted. - * | | |1 = External Interrupt from PB.3 or PC.6 interrupt is asserted. - * |[11] |EINT3 |External Interrupt From PB.2 or PC.7 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.2 or PC.7 interrupt is deasserted. - * | | |1 = External Interrupt from PB.2 or PC.7 interrupt is asserted. - * |[12] |EINT4 |External Interrupt From PA.8, PB.6 or PF.15 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.8, PB.6 or PF.15 interrupt is deasserted. - * | | |1 = External Interrupt from PA.8, PB.6 or PF.15 interrupt is asserted. - * |[13] |EINT5 |External Interrupt From PB.7 or PF.14 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.7 or PF.14 interrupt is deasserted. - * | | |1 = External Interrupt from PB.7 or PF.14 interrupt is asserted. - * |[14] |UART0_INT |UART0 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is deasserted. - * | | |1 = UART1 interrupt is asserted. - * |[15] |UART1_INT |UART1 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is deasserted. - * | | |1 = UART1 interrupt is asserted. - */ - __IO uint32_t NMIEN; /*!< [0x0000] NMI Source Interrupt Enable Register */ - __I uint32_t NMISTS; /*!< [0x0004] NMI Source Interrupt Status Register */ - -} NMI_T; - -/** - @addtogroup SYS_CONST SYS Bit Field Definition - Constant Definitions for SYS Controller -@{ */ - -#define SYS_PDID_PDID_Pos (0) /*!< SYS_T::PDID: PDID Position */ -#define SYS_PDID_PDID_Msk (0xfffffffful << SYS_PDID_PDID_Pos) /*!< SYS_T::PDID: PDID Mask */ - -#define SYS_RSTSTS_PORF_Pos (0) /*!< SYS_T::RSTSTS: PORF Position */ -#define SYS_RSTSTS_PORF_Msk (0x1ul << SYS_RSTSTS_PORF_Pos) /*!< SYS_T::RSTSTS: PORF Mask */ - -#define SYS_RSTSTS_PINRF_Pos (1) /*!< SYS_T::RSTSTS: PINRF Position */ -#define SYS_RSTSTS_PINRF_Msk (0x1ul << SYS_RSTSTS_PINRF_Pos) /*!< SYS_T::RSTSTS: PINRF Mask */ - -#define SYS_RSTSTS_WDTRF_Pos (2) /*!< SYS_T::RSTSTS: WDTRF Position */ -#define SYS_RSTSTS_WDTRF_Msk (0x1ul << SYS_RSTSTS_WDTRF_Pos) /*!< SYS_T::RSTSTS: WDTRF Mask */ - -#define SYS_RSTSTS_LVRF_Pos (3) /*!< SYS_T::RSTSTS: LVRF Position */ -#define SYS_RSTSTS_LVRF_Msk (0x1ul << SYS_RSTSTS_LVRF_Pos) /*!< SYS_T::RSTSTS: LVRF Mask */ - -#define SYS_RSTSTS_BODRF_Pos (4) /*!< SYS_T::RSTSTS: BODRF Position */ -#define SYS_RSTSTS_BODRF_Msk (0x1ul << SYS_RSTSTS_BODRF_Pos) /*!< SYS_T::RSTSTS: BODRF Mask */ - -#define SYS_RSTSTS_SYSRF_Pos (5) /*!< SYS_T::RSTSTS: SYSRF Position */ -#define SYS_RSTSTS_SYSRF_Msk (0x1ul << SYS_RSTSTS_SYSRF_Pos) /*!< SYS_T::RSTSTS: SYSRF Mask */ - -#define SYS_RSTSTS_CPURF_Pos (7) /*!< SYS_T::RSTSTS: CPURF Position */ -#define SYS_RSTSTS_CPURF_Msk (0x1ul << SYS_RSTSTS_CPURF_Pos) /*!< SYS_T::RSTSTS: CPURF Mask */ - -#define SYS_RSTSTS_CPULKRF_Pos (8) /*!< SYS_T::RSTSTS: CPULKRF Position */ -#define SYS_RSTSTS_CPULKRF_Msk (0x1ul << SYS_RSTSTS_CPULKRF_Pos) /*!< SYS_T::RSTSTS: CPULKRF Mask */ - -#define SYS_IPRST0_CHIPRST_Pos (0) /*!< SYS_T::IPRST0: CHIPRST Position */ -#define SYS_IPRST0_CHIPRST_Msk (0x1ul << SYS_IPRST0_CHIPRST_Pos) /*!< SYS_T::IPRST0: CHIPRST Mask */ - -#define SYS_IPRST0_CPURST_Pos (1) /*!< SYS_T::IPRST0: CPURST Position */ -#define SYS_IPRST0_CPURST_Msk (0x1ul << SYS_IPRST0_CPURST_Pos) /*!< SYS_T::IPRST0: CPURST Mask */ - -#define SYS_IPRST0_PDMARST_Pos (2) /*!< SYS_T::IPRST0: PDMARST Position */ -#define SYS_IPRST0_PDMARST_Msk (0x1ul << SYS_IPRST0_PDMARST_Pos) /*!< SYS_T::IPRST0: PDMARST Mask */ - -#define SYS_IPRST0_EBIRST_Pos (3) /*!< SYS_T::IPRST0: EBIRST Position */ -#define SYS_IPRST0_EBIRST_Msk (0x1ul << SYS_IPRST0_EBIRST_Pos) /*!< SYS_T::IPRST0: EBIRST Mask */ - -#define SYS_IPRST0_HDIVRST_Pos (4) /*!< SYS_T::IPRST0: HDIVRST Position */ -#define SYS_IPRST0_HDIVRST_Msk (0x1ul << SYS_IPRST0_HDIVRST_Pos) /*!< SYS_T::IPRST0: HDIVRST Mask */ - -#define SYS_IPRST0_CRCRST_Pos (7) /*!< SYS_T::IPRST0: CRCRST Position */ -#define SYS_IPRST0_CRCRST_Msk (0x1ul << SYS_IPRST0_CRCRST_Pos) /*!< SYS_T::IPRST0: CRCRST Mask */ - -#define SYS_IPRST1_GPIORST_Pos (1) /*!< SYS_T::IPRST1: GPIORST Position */ -#define SYS_IPRST1_GPIORST_Msk (0x1ul << SYS_IPRST1_GPIORST_Pos) /*!< SYS_T::IPRST1: GPIORST Mask */ - -#define SYS_IPRST1_TMR0RST_Pos (2) /*!< SYS_T::IPRST1: TMR0RST Position */ -#define SYS_IPRST1_TMR0RST_Msk (0x1ul << SYS_IPRST1_TMR0RST_Pos) /*!< SYS_T::IPRST1: TMR0RST Mask */ - -#define SYS_IPRST1_TMR1RST_Pos (3) /*!< SYS_T::IPRST1: TMR1RST Position */ -#define SYS_IPRST1_TMR1RST_Msk (0x1ul << SYS_IPRST1_TMR1RST_Pos) /*!< SYS_T::IPRST1: TMR1RST Mask */ - -#define SYS_IPRST1_TMR2RST_Pos (4) /*!< SYS_T::IPRST1: TMR2RST Position */ -#define SYS_IPRST1_TMR2RST_Msk (0x1ul << SYS_IPRST1_TMR2RST_Pos) /*!< SYS_T::IPRST1: TMR2RST Mask */ - -#define SYS_IPRST1_TMR3RST_Pos (5) /*!< SYS_T::IPRST1: TMR3RST Position */ -#define SYS_IPRST1_TMR3RST_Msk (0x1ul << SYS_IPRST1_TMR3RST_Pos) /*!< SYS_T::IPRST1: TMR3RST Mask */ - -#define SYS_IPRST1_ACMP01RST_Pos (7) /*!< SYS_T::IPRST1: ACMP01RST Position */ -#define SYS_IPRST1_ACMP01RST_Msk (0x1ul << SYS_IPRST1_ACMP01RST_Pos) /*!< SYS_T::IPRST1: ACMP01RST Mask */ - -#define SYS_IPRST1_I2C0RST_Pos (8) /*!< SYS_T::IPRST1: I2C0RST Position */ -#define SYS_IPRST1_I2C0RST_Msk (0x1ul << SYS_IPRST1_I2C0RST_Pos) /*!< SYS_T::IPRST1: I2C0RST Mask */ - -#define SYS_IPRST1_I2C1RST_Pos (9) /*!< SYS_T::IPRST1: I2C1RST Position */ -#define SYS_IPRST1_I2C1RST_Msk (0x1ul << SYS_IPRST1_I2C1RST_Pos) /*!< SYS_T::IPRST1: I2C1RST Mask */ - -#define SYS_IPRST1_QSPI0RST_Pos (12) /*!< SYS_T::IPRST1: QSPI0RST Position */ -#define SYS_IPRST1_QSPI0RST_Msk (0x1ul << SYS_IPRST1_QSPI0RST_Pos) /*!< SYS_T::IPRST1: QSPI0RST Mask */ - -#define SYS_IPRST1_SPI0RST_Pos (13) /*!< SYS_T::IPRST1: SPI0RST Position */ -#define SYS_IPRST1_SPI0RST_Msk (0x1ul << SYS_IPRST1_SPI0RST_Pos) /*!< SYS_T::IPRST1: SPI0RST Mask */ - -#define SYS_IPRST1_UART0RST_Pos (16) /*!< SYS_T::IPRST1: UART0RST Position */ -#define SYS_IPRST1_UART0RST_Msk (0x1ul << SYS_IPRST1_UART0RST_Pos) /*!< SYS_T::IPRST1: UART0RST Mask */ - -#define SYS_IPRST1_UART1RST_Pos (17) /*!< SYS_T::IPRST1: UART1RST Position */ -#define SYS_IPRST1_UART1RST_Msk (0x1ul << SYS_IPRST1_UART1RST_Pos) /*!< SYS_T::IPRST1: UART1RST Mask */ - -#define SYS_IPRST1_UART2RST_Pos (18) /*!< SYS_T::IPRST1: UART2RST Position */ -#define SYS_IPRST1_UART2RST_Msk (0x1ul << SYS_IPRST1_UART2RST_Pos) /*!< SYS_T::IPRST1: UART2RST Mask */ - -#define SYS_IPRST1_UART3RST_Pos (19) /*!< SYS_T::IPRST1: UART3RST Position */ -#define SYS_IPRST1_UART3RST_Msk (0x1ul << SYS_IPRST1_UART3RST_Pos) /*!< SYS_T::IPRST1: UART3RST Mask */ - -#define SYS_IPRST1_UART4RST_Pos (20) /*!< SYS_T::IPRST1: UART4RST Position */ -#define SYS_IPRST1_UART4RST_Msk (0x1ul << SYS_IPRST1_UART4RST_Pos) /*!< SYS_T::IPRST1: UART4RST Mask */ - -#define SYS_IPRST1_UART5RST_Pos (21) /*!< SYS_T::IPRST1: UART5RST Position */ -#define SYS_IPRST1_UART5RST_Msk (0x1ul << SYS_IPRST1_UART5RST_Pos) /*!< SYS_T::IPRST1: UART5RST Mask */ - -#define SYS_IPRST1_UART6RST_Pos (22) /*!< SYS_T::IPRST1: UART6RST Position */ -#define SYS_IPRST1_UART6RST_Msk (0x1ul << SYS_IPRST1_UART6RST_Pos) /*!< SYS_T::IPRST1: UART6RST Mask */ - -#define SYS_IPRST1_UART7RST_Pos (23) /*!< SYS_T::IPRST1: UART7RST Position */ -#define SYS_IPRST1_UART7RST_Msk (0x1ul << SYS_IPRST1_UART7RST_Pos) /*!< SYS_T::IPRST1: UART7RST Mask */ - -#define SYS_IPRST1_USBDRST_Pos (27) /*!< SYS_T::IPRST1: USBDRST Position */ -#define SYS_IPRST1_USBDRST_Msk (0x1ul << SYS_IPRST1_USBDRST_Pos) /*!< SYS_T::IPRST1: USBDRST Mask */ - -#define SYS_IPRST1_ADCRST_Pos (28) /*!< SYS_T::IPRST1: ADCRST Position */ -#define SYS_IPRST1_ADCRST_Msk (0x1ul << SYS_IPRST1_ADCRST_Pos) /*!< SYS_T::IPRST1: ADCRST Mask */ - -#define SYS_IPRST2_USCI0RST_Pos (8) /*!< SYS_T::IPRST2: USCI0RST Position */ -#define SYS_IPRST2_USCI0RST_Msk (0x1ul << SYS_IPRST2_USCI0RST_Pos) /*!< SYS_T::IPRST2: USCI0RST Mask */ - -#define SYS_IPRST2_USCI1RST_Pos (9) /*!< SYS_T::IPRST2: USCI1RST Position */ -#define SYS_IPRST2_USCI1RST_Msk (0x1ul << SYS_IPRST2_USCI1RST_Pos) /*!< SYS_T::IPRST2: USCI1RST Mask */ - -#define SYS_IPRST2_PWM0RST_Pos (16) /*!< SYS_T::IPRST2: PWM0RST Position */ -#define SYS_IPRST2_PWM0RST_Msk (0x1ul << SYS_IPRST2_PWM0RST_Pos) /*!< SYS_T::IPRST2: PWM0RST Mask */ - -#define SYS_IPRST2_PWM1RST_Pos (17) /*!< SYS_T::IPRST2: PWM1RST Position */ -#define SYS_IPRST2_PWM1RST_Msk (0x1ul << SYS_IPRST2_PWM1RST_Pos) /*!< SYS_T::IPRST2: PWM1RST Mask */ - -#define SYS_IPRST2_BPWM0RST_Pos (18) /*!< SYS_T::IPRST2: BPWM0RST Position */ -#define SYS_IPRST2_BPWM0RST_Msk (0x1ul << SYS_IPRST2_BPWM0RST_Pos) /*!< SYS_T::IPRST2: BPWM0RST Mask */ - -#define SYS_IPRST2_BPWM1RST_Pos (19) /*!< SYS_T::IPRST2: BPWM1RST Position */ -#define SYS_IPRST2_BPWM1RST_Msk (0x1ul << SYS_IPRST2_BPWM1RST_Pos) /*!< SYS_T::IPRST2: BPWM1RST Mask */ - -#define SYS_BODCTL_BODEN_Pos (0) /*!< SYS_T::BODCTL: BODEN Position */ -#define SYS_BODCTL_BODEN_Msk (0x1ul << SYS_BODCTL_BODEN_Pos) /*!< SYS_T::BODCTL: BODEN Mask */ - -#define SYS_BODCTL_BODRSTEN_Pos (3) /*!< SYS_T::BODCTL: BODRSTEN Position */ -#define SYS_BODCTL_BODRSTEN_Msk (0x1ul << SYS_BODCTL_BODRSTEN_Pos) /*!< SYS_T::BODCTL: BODRSTEN Mask */ - -#define SYS_BODCTL_BODIF_Pos (4) /*!< SYS_T::BODCTL: BODIF Position */ -#define SYS_BODCTL_BODIF_Msk (0x1ul << SYS_BODCTL_BODIF_Pos) /*!< SYS_T::BODCTL: BODIF Mask */ - -#define SYS_BODCTL_BODLPM_Pos (5) /*!< SYS_T::BODCTL: BODLPM Position */ -#define SYS_BODCTL_BODLPM_Msk (0x1ul << SYS_BODCTL_BODLPM_Pos) /*!< SYS_T::BODCTL: BODLPM Mask */ - -#define SYS_BODCTL_BODOUT_Pos (6) /*!< SYS_T::BODCTL: BODOUT Position */ -#define SYS_BODCTL_BODOUT_Msk (0x1ul << SYS_BODCTL_BODOUT_Pos) /*!< SYS_T::BODCTL: BODOUT Mask */ - -#define SYS_BODCTL_LVREN_Pos (7) /*!< SYS_T::BODCTL: LVREN Position */ -#define SYS_BODCTL_LVREN_Msk (0x1ul << SYS_BODCTL_LVREN_Pos) /*!< SYS_T::BODCTL: LVREN Mask */ - -#define SYS_BODCTL_BODDGSEL_Pos (8) /*!< SYS_T::BODCTL: BODDGSEL Position */ -#define SYS_BODCTL_BODDGSEL_Msk (0x7ul << SYS_BODCTL_BODDGSEL_Pos) /*!< SYS_T::BODCTL: BODDGSEL Mask */ - -#define SYS_BODCTL_LVRDGSEL_Pos (12) /*!< SYS_T::BODCTL: LVRDGSEL Position */ -#define SYS_BODCTL_LVRDGSEL_Msk (0x7ul << SYS_BODCTL_LVRDGSEL_Pos) /*!< SYS_T::BODCTL: LVRDGSEL Mask */ - -#define SYS_BODCTL_BODVL_Pos (16) /*!< SYS_T::BODCTL: BODVL Position */ -#define SYS_BODCTL_BODVL_Msk (0x1ul << SYS_BODCTL_BODVL_Pos) /*!< SYS_T::BODCTL: BODVL Mask */ - -#define SYS_BODCTL_LVRVL_Pos (20) /*!< SYS_T::BODCTL: LVRVL Position */ -#define SYS_BODCTL_LVRVL_Msk (0x1ul << SYS_BODCTL_LVRVL_Pos) /*!< SYS_T::BODCTL: LVRVL Mask */ - -#define SYS_PORCTL_POROFF_Pos (0) /*!< SYS_T::PORCTL: POROFF Position */ -#define SYS_PORCTL_POROFF_Msk (0xfffful << SYS_PORCTL_POROFF_Pos) /*!< SYS_T::PORCTL: POROFF Mask */ - -#define SYS_GPA_MFPL_PA0MFP_Pos (0) /*!< SYS_T::GPA_MFPL: PA0MFP Position */ -#define SYS_GPA_MFPL_PA0MFP_Msk (0xful << SYS_GPA_MFPL_PA0MFP_Pos) /*!< SYS_T::GPA_MFPL: PA0MFP Mask */ - -#define SYS_GPA_MFPL_PA1MFP_Pos (4) /*!< SYS_T::GPA_MFPL: PA1MFP Position */ -#define SYS_GPA_MFPL_PA1MFP_Msk (0xful << SYS_GPA_MFPL_PA1MFP_Pos) /*!< SYS_T::GPA_MFPL: PA1MFP Mask */ - -#define SYS_GPA_MFPL_PA2MFP_Pos (8) /*!< SYS_T::GPA_MFPL: PA2MFP Position */ -#define SYS_GPA_MFPL_PA2MFP_Msk (0xful << SYS_GPA_MFPL_PA2MFP_Pos) /*!< SYS_T::GPA_MFPL: PA2MFP Mask */ - -#define SYS_GPA_MFPL_PA3MFP_Pos (12) /*!< SYS_T::GPA_MFPL: PA3MFP Position */ -#define SYS_GPA_MFPL_PA3MFP_Msk (0xful << SYS_GPA_MFPL_PA3MFP_Pos) /*!< SYS_T::GPA_MFPL: PA3MFP Mask */ - -#define SYS_GPA_MFPL_PA4MFP_Pos (16) /*!< SYS_T::GPA_MFPL: PA4MFP Position */ -#define SYS_GPA_MFPL_PA4MFP_Msk (0xful << SYS_GPA_MFPL_PA4MFP_Pos) /*!< SYS_T::GPA_MFPL: PA4MFP Mask */ - -#define SYS_GPA_MFPL_PA5MFP_Pos (20) /*!< SYS_T::GPA_MFPL: PA5MFP Position */ -#define SYS_GPA_MFPL_PA5MFP_Msk (0xful << SYS_GPA_MFPL_PA5MFP_Pos) /*!< SYS_T::GPA_MFPL: PA5MFP Mask */ - -#define SYS_GPA_MFPL_PA6MFP_Pos (24) /*!< SYS_T::GPA_MFPL: PA6MFP Position */ -#define SYS_GPA_MFPL_PA6MFP_Msk (0xful << SYS_GPA_MFPL_PA6MFP_Pos) /*!< SYS_T::GPA_MFPL: PA6MFP Mask */ - -#define SYS_GPA_MFPL_PA7MFP_Pos (28) /*!< SYS_T::GPA_MFPL: PA7MFP Position */ -#define SYS_GPA_MFPL_PA7MFP_Msk (0xful << SYS_GPA_MFPL_PA7MFP_Pos) /*!< SYS_T::GPA_MFPL: PA7MFP Mask */ - -#define SYS_GPA_MFPH_PA8MFP_Pos (0) /*!< SYS_T::GPA_MFPH: PA8MFP Position */ -#define SYS_GPA_MFPH_PA8MFP_Msk (0xful << SYS_GPA_MFPH_PA8MFP_Pos) /*!< SYS_T::GPA_MFPH: PA8MFP Mask */ - -#define SYS_GPA_MFPH_PA9MFP_Pos (4) /*!< SYS_T::GPA_MFPH: PA9MFP Position */ -#define SYS_GPA_MFPH_PA9MFP_Msk (0xful << SYS_GPA_MFPH_PA9MFP_Pos) /*!< SYS_T::GPA_MFPH: PA9MFP Mask */ - -#define SYS_GPA_MFPH_PA10MFP_Pos (8) /*!< SYS_T::GPA_MFPH: PA10MFP Position */ -#define SYS_GPA_MFPH_PA10MFP_Msk (0xful << SYS_GPA_MFPH_PA10MFP_Pos) /*!< SYS_T::GPA_MFPH: PA10MFP Mask */ - -#define SYS_GPA_MFPH_PA11MFP_Pos (12) /*!< SYS_T::GPA_MFPH: PA11MFP Position */ -#define SYS_GPA_MFPH_PA11MFP_Msk (0xful << SYS_GPA_MFPH_PA11MFP_Pos) /*!< SYS_T::GPA_MFPH: PA11MFP Mask */ - -#define SYS_GPA_MFPH_PA12MFP_Pos (16) /*!< SYS_T::GPA_MFPH: PA12MFP Position */ -#define SYS_GPA_MFPH_PA12MFP_Msk (0xful << SYS_GPA_MFPH_PA12MFP_Pos) /*!< SYS_T::GPA_MFPH: PA12MFP Mask */ - -#define SYS_GPA_MFPH_PA13MFP_Pos (20) /*!< SYS_T::GPA_MFPH: PA13MFP Position */ -#define SYS_GPA_MFPH_PA13MFP_Msk (0xful << SYS_GPA_MFPH_PA13MFP_Pos) /*!< SYS_T::GPA_MFPH: PA13MFP Mask */ - -#define SYS_GPA_MFPH_PA14MFP_Pos (24) /*!< SYS_T::GPA_MFPH: PA14MFP Position */ -#define SYS_GPA_MFPH_PA14MFP_Msk (0xful << SYS_GPA_MFPH_PA14MFP_Pos) /*!< SYS_T::GPA_MFPH: PA14MFP Mask */ - -#define SYS_GPA_MFPH_PA15MFP_Pos (28) /*!< SYS_T::GPA_MFPH: PA15MFP Position */ -#define SYS_GPA_MFPH_PA15MFP_Msk (0xful << SYS_GPA_MFPH_PA15MFP_Pos) /*!< SYS_T::GPA_MFPH: PA15MFP Mask */ - -#define SYS_GPB_MFPL_PB0MFP_Pos (0) /*!< SYS_T::GPB_MFPL: PB0MFP Position */ -#define SYS_GPB_MFPL_PB0MFP_Msk (0xful << SYS_GPB_MFPL_PB0MFP_Pos) /*!< SYS_T::GPB_MFPL: PB0MFP Mask */ - -#define SYS_GPB_MFPL_PB1MFP_Pos (4) /*!< SYS_T::GPB_MFPL: PB1MFP Position */ -#define SYS_GPB_MFPL_PB1MFP_Msk (0xful << SYS_GPB_MFPL_PB1MFP_Pos) /*!< SYS_T::GPB_MFPL: PB1MFP Mask */ - -#define SYS_GPB_MFPL_PB2MFP_Pos (8) /*!< SYS_T::GPB_MFPL: PB2MFP Position */ -#define SYS_GPB_MFPL_PB2MFP_Msk (0xful << SYS_GPB_MFPL_PB2MFP_Pos) /*!< SYS_T::GPB_MFPL: PB2MFP Mask */ - -#define SYS_GPB_MFPL_PB3MFP_Pos (12) /*!< SYS_T::GPB_MFPL: PB3MFP Position */ -#define SYS_GPB_MFPL_PB3MFP_Msk (0xful << SYS_GPB_MFPL_PB3MFP_Pos) /*!< SYS_T::GPB_MFPL: PB3MFP Mask */ - -#define SYS_GPB_MFPL_PB4MFP_Pos (16) /*!< SYS_T::GPB_MFPL: PB4MFP Position */ -#define SYS_GPB_MFPL_PB4MFP_Msk (0xful << SYS_GPB_MFPL_PB4MFP_Pos) /*!< SYS_T::GPB_MFPL: PB4MFP Mask */ - -#define SYS_GPB_MFPL_PB5MFP_Pos (20) /*!< SYS_T::GPB_MFPL: PB5MFP Position */ -#define SYS_GPB_MFPL_PB5MFP_Msk (0xful << SYS_GPB_MFPL_PB5MFP_Pos) /*!< SYS_T::GPB_MFPL: PB5MFP Mask */ - -#define SYS_GPB_MFPL_PB6MFP_Pos (24) /*!< SYS_T::GPB_MFPL: PB6MFP Position */ -#define SYS_GPB_MFPL_PB6MFP_Msk (0xful << SYS_GPB_MFPL_PB6MFP_Pos) /*!< SYS_T::GPB_MFPL: PB6MFP Mask */ - -#define SYS_GPB_MFPL_PB7MFP_Pos (28) /*!< SYS_T::GPB_MFPL: PB7MFP Position */ -#define SYS_GPB_MFPL_PB7MFP_Msk (0xful << SYS_GPB_MFPL_PB7MFP_Pos) /*!< SYS_T::GPB_MFPL: PB7MFP Mask */ - -#define SYS_GPB_MFPH_PB8MFP_Pos (0) /*!< SYS_T::GPB_MFPH: PB8MFP Position */ -#define SYS_GPB_MFPH_PB8MFP_Msk (0xful << SYS_GPB_MFPH_PB8MFP_Pos) /*!< SYS_T::GPB_MFPH: PB8MFP Mask */ - -#define SYS_GPB_MFPH_PB9MFP_Pos (4) /*!< SYS_T::GPB_MFPH: PB9MFP Position */ -#define SYS_GPB_MFPH_PB9MFP_Msk (0xful << SYS_GPB_MFPH_PB9MFP_Pos) /*!< SYS_T::GPB_MFPH: PB9MFP Mask */ - -#define SYS_GPB_MFPH_PB10MFP_Pos (8) /*!< SYS_T::GPB_MFPH: PB10MFP Position */ -#define SYS_GPB_MFPH_PB10MFP_Msk (0xful << SYS_GPB_MFPH_PB10MFP_Pos) /*!< SYS_T::GPB_MFPH: PB10MFP Mask */ - -#define SYS_GPB_MFPH_PB11MFP_Pos (12) /*!< SYS_T::GPB_MFPH: PB11MFP Position */ -#define SYS_GPB_MFPH_PB11MFP_Msk (0xful << SYS_GPB_MFPH_PB11MFP_Pos) /*!< SYS_T::GPB_MFPH: PB11MFP Mask */ - -#define SYS_GPB_MFPH_PB12MFP_Pos (16) /*!< SYS_T::GPB_MFPH: PB12MFP Position */ -#define SYS_GPB_MFPH_PB12MFP_Msk (0xful << SYS_GPB_MFPH_PB12MFP_Pos) /*!< SYS_T::GPB_MFPH: PB12MFP Mask */ - -#define SYS_GPB_MFPH_PB13MFP_Pos (20) /*!< SYS_T::GPB_MFPH: PB13MFP Position */ -#define SYS_GPB_MFPH_PB13MFP_Msk (0xful << SYS_GPB_MFPH_PB13MFP_Pos) /*!< SYS_T::GPB_MFPH: PB13MFP Mask */ - -#define SYS_GPB_MFPH_PB14MFP_Pos (24) /*!< SYS_T::GPB_MFPH: PB14MFP Position */ -#define SYS_GPB_MFPH_PB14MFP_Msk (0xful << SYS_GPB_MFPH_PB14MFP_Pos) /*!< SYS_T::GPB_MFPH: PB14MFP Mask */ - -#define SYS_GPB_MFPH_PB15MFP_Pos (28) /*!< SYS_T::GPB_MFPH: PB15MFP Position */ -#define SYS_GPB_MFPH_PB15MFP_Msk (0xful << SYS_GPB_MFPH_PB15MFP_Pos) /*!< SYS_T::GPB_MFPH: PB15MFP Mask */ - -#define SYS_GPC_MFPL_PC0MFP_Pos (0) /*!< SYS_T::GPC_MFPL: PC0MFP Position */ -#define SYS_GPC_MFPL_PC0MFP_Msk (0xful << SYS_GPC_MFPL_PC0MFP_Pos) /*!< SYS_T::GPC_MFPL: PC0MFP Mask */ - -#define SYS_GPC_MFPL_PC1MFP_Pos (4) /*!< SYS_T::GPC_MFPL: PC1MFP Position */ -#define SYS_GPC_MFPL_PC1MFP_Msk (0xful << SYS_GPC_MFPL_PC1MFP_Pos) /*!< SYS_T::GPC_MFPL: PC1MFP Mask */ - -#define SYS_GPC_MFPL_PC2MFP_Pos (8) /*!< SYS_T::GPC_MFPL: PC2MFP Position */ -#define SYS_GPC_MFPL_PC2MFP_Msk (0xful << SYS_GPC_MFPL_PC2MFP_Pos) /*!< SYS_T::GPC_MFPL: PC2MFP Mask */ - -#define SYS_GPC_MFPL_PC3MFP_Pos (12) /*!< SYS_T::GPC_MFPL: PC3MFP Position */ -#define SYS_GPC_MFPL_PC3MFP_Msk (0xful << SYS_GPC_MFPL_PC3MFP_Pos) /*!< SYS_T::GPC_MFPL: PC3MFP Mask */ - -#define SYS_GPC_MFPL_PC4MFP_Pos (16) /*!< SYS_T::GPC_MFPL: PC4MFP Position */ -#define SYS_GPC_MFPL_PC4MFP_Msk (0xful << SYS_GPC_MFPL_PC4MFP_Pos) /*!< SYS_T::GPC_MFPL: PC4MFP Mask */ - -#define SYS_GPC_MFPL_PC5MFP_Pos (20) /*!< SYS_T::GPC_MFPL: PC5MFP Position */ -#define SYS_GPC_MFPL_PC5MFP_Msk (0xful << SYS_GPC_MFPL_PC5MFP_Pos) /*!< SYS_T::GPC_MFPL: PC5MFP Mask */ - -#define SYS_GPC_MFPL_PC6MFP_Pos (24) /*!< SYS_T::GPC_MFPL: PC6MFP Position */ -#define SYS_GPC_MFPL_PC6MFP_Msk (0xful << SYS_GPC_MFPL_PC6MFP_Pos) /*!< SYS_T::GPC_MFPL: PC6MFP Mask */ - -#define SYS_GPC_MFPL_PC7MFP_Pos (28) /*!< SYS_T::GPC_MFPL: PC7MFP Position */ -#define SYS_GPC_MFPL_PC7MFP_Msk (0xful << SYS_GPC_MFPL_PC7MFP_Pos) /*!< SYS_T::GPC_MFPL: PC7MFP Mask */ - -#define SYS_GPC_MFPH_PC8MFP_Pos (0) /*!< SYS_T::GPC_MFPH: PC8MFP Position */ -#define SYS_GPC_MFPH_PC8MFP_Msk (0xful << SYS_GPC_MFPH_PC8MFP_Pos) /*!< SYS_T::GPC_MFPH: PC8MFP Mask */ - -#define SYS_GPC_MFPH_PC9MFP_Pos (4) /*!< SYS_T::GPC_MFPH: PC9MFP Position */ -#define SYS_GPC_MFPH_PC9MFP_Msk (0xful << SYS_GPC_MFPH_PC9MFP_Pos) /*!< SYS_T::GPC_MFPH: PC9MFP Mask */ - -#define SYS_GPC_MFPH_PC10MFP_Pos (8) /*!< SYS_T::GPC_MFPH: PC10MFP Position */ -#define SYS_GPC_MFPH_PC10MFP_Msk (0xful << SYS_GPC_MFPH_PC10MFP_Pos) /*!< SYS_T::GPC_MFPH: PC10MFP Mask */ - -#define SYS_GPC_MFPH_PC11MFP_Pos (12) /*!< SYS_T::GPC_MFPH: PC11MFP Position */ -#define SYS_GPC_MFPH_PC11MFP_Msk (0xful << SYS_GPC_MFPH_PC11MFP_Pos) /*!< SYS_T::GPC_MFPH: PC11MFP Mask */ - -#define SYS_GPC_MFPH_PC12MFP_Pos (16) /*!< SYS_T::GPC_MFPH: PC12MFP Position */ -#define SYS_GPC_MFPH_PC12MFP_Msk (0xful << SYS_GPC_MFPH_PC12MFP_Pos) /*!< SYS_T::GPC_MFPH: PC12MFP Mask */ - -#define SYS_GPC_MFPH_PC13MFP_Pos (20) /*!< SYS_T::GPC_MFPH: PC13MFP Position */ -#define SYS_GPC_MFPH_PC13MFP_Msk (0xful << SYS_GPC_MFPH_PC13MFP_Pos) /*!< SYS_T::GPC_MFPH: PC13MFP Mask */ - -#define SYS_GPC_MFPH_PC14MFP_Pos (24) /*!< SYS_T::GPC_MFPH: PC14MFP Position */ -#define SYS_GPC_MFPH_PC14MFP_Msk (0xful << SYS_GPC_MFPH_PC14MFP_Pos) /*!< SYS_T::GPC_MFPH: PC14MFP Mask */ - -#define SYS_GPC_MFPH_PC15MFP_Pos (28) /*!< SYS_T::GPC_MFPH: PC15MFP Position */ -#define SYS_GPC_MFPH_PC15MFP_Msk (0xful << SYS_GPC_MFPH_PC15MFP_Pos) /*!< SYS_T::GPC_MFPH: PC15MFP Mask */ - -#define SYS_GPD_MFPL_PD0MFP_Pos (0) /*!< SYS_T::GPD_MFPL: PD0MFP Position */ -#define SYS_GPD_MFPL_PD0MFP_Msk (0xful << SYS_GPD_MFPL_PD0MFP_Pos) /*!< SYS_T::GPD_MFPL: PD0MFP Mask */ - -#define SYS_GPD_MFPL_PD1MFP_Pos (4) /*!< SYS_T::GPD_MFPL: PD1MFP Position */ -#define SYS_GPD_MFPL_PD1MFP_Msk (0xful << SYS_GPD_MFPL_PD1MFP_Pos) /*!< SYS_T::GPD_MFPL: PD1MFP Mask */ - -#define SYS_GPD_MFPL_PD2MFP_Pos (8) /*!< SYS_T::GPD_MFPL: PD2MFP Position */ -#define SYS_GPD_MFPL_PD2MFP_Msk (0xful << SYS_GPD_MFPL_PD2MFP_Pos) /*!< SYS_T::GPD_MFPL: PD2MFP Mask */ - -#define SYS_GPD_MFPL_PD3MFP_Pos (12) /*!< SYS_T::GPD_MFPL: PD3MFP Position */ -#define SYS_GPD_MFPL_PD3MFP_Msk (0xful << SYS_GPD_MFPL_PD3MFP_Pos) /*!< SYS_T::GPD_MFPL: PD3MFP Mask */ - -#define SYS_GPD_MFPL_PD4MFP_Pos (16) /*!< SYS_T::GPD_MFPL: PD4MFP Position */ -#define SYS_GPD_MFPL_PD4MFP_Msk (0xful << SYS_GPD_MFPL_PD4MFP_Pos) /*!< SYS_T::GPD_MFPL: PD4MFP Mask */ - -#define SYS_GPD_MFPL_PD5MFP_Pos (20) /*!< SYS_T::GPD_MFPL: PD5MFP Position */ -#define SYS_GPD_MFPL_PD5MFP_Msk (0xful << SYS_GPD_MFPL_PD5MFP_Pos) /*!< SYS_T::GPD_MFPL: PD5MFP Mask */ - -#define SYS_GPD_MFPL_PD6MFP_Pos (24) /*!< SYS_T::GPD_MFPL: PD6MFP Position */ -#define SYS_GPD_MFPL_PD6MFP_Msk (0xful << SYS_GPD_MFPL_PD6MFP_Pos) /*!< SYS_T::GPD_MFPL: PD6MFP Mask */ - -#define SYS_GPD_MFPL_PD7MFP_Pos (28) /*!< SYS_T::GPD_MFPL: PD7MFP Position */ -#define SYS_GPD_MFPL_PD7MFP_Msk (0xful << SYS_GPD_MFPL_PD7MFP_Pos) /*!< SYS_T::GPD_MFPL: PD7MFP Mask */ - -#define SYS_GPD_MFPH_PD8MFP_Pos (0) /*!< SYS_T::GPD_MFPH: PD8MFP Position */ -#define SYS_GPD_MFPH_PD8MFP_Msk (0xful << SYS_GPD_MFPH_PD8MFP_Pos) /*!< SYS_T::GPD_MFPH: PD8MFP Mask */ - -#define SYS_GPD_MFPH_PD9MFP_Pos (4) /*!< SYS_T::GPD_MFPH: PD9MFP Position */ -#define SYS_GPD_MFPH_PD9MFP_Msk (0xful << SYS_GPD_MFPH_PD9MFP_Pos) /*!< SYS_T::GPD_MFPH: PD9MFP Mask */ - -#define SYS_GPD_MFPH_PD10MFP_Pos (8) /*!< SYS_T::GPD_MFPH: PD10MFP Position */ -#define SYS_GPD_MFPH_PD10MFP_Msk (0xful << SYS_GPD_MFPH_PD10MFP_Pos) /*!< SYS_T::GPD_MFPH: PD10MFP Mask */ - -#define SYS_GPD_MFPH_PD11MFP_Pos (12) /*!< SYS_T::GPD_MFPH: PD11MFP Position */ -#define SYS_GPD_MFPH_PD11MFP_Msk (0xful << SYS_GPD_MFPH_PD11MFP_Pos) /*!< SYS_T::GPD_MFPH: PD11MFP Mask */ - -#define SYS_GPD_MFPH_PD12MFP_Pos (16) /*!< SYS_T::GPD_MFPH: PD12MFP Position */ -#define SYS_GPD_MFPH_PD12MFP_Msk (0xful << SYS_GPD_MFPH_PD12MFP_Pos) /*!< SYS_T::GPD_MFPH: PD12MFP Mask */ - -#define SYS_GPD_MFPH_PD13MFP_Pos (20) /*!< SYS_T::GPD_MFPH: PD13MFP Position */ -#define SYS_GPD_MFPH_PD13MFP_Msk (0xful << SYS_GPD_MFPH_PD13MFP_Pos) /*!< SYS_T::GPD_MFPH: PD13MFP Mask */ - -#define SYS_GPD_MFPH_PD14MFP_Pos (24) /*!< SYS_T::GPD_MFPH: PD14MFP Position */ -#define SYS_GPD_MFPH_PD14MFP_Msk (0xful << SYS_GPD_MFPH_PD14MFP_Pos) /*!< SYS_T::GPD_MFPH: PD14MFP Mask */ - -#define SYS_GPD_MFPH_PD15MFP_Pos (28) /*!< SYS_T::GPD_MFPH: PD15MFP Position */ -#define SYS_GPD_MFPH_PD15MFP_Msk (0xful << SYS_GPD_MFPH_PD15MFP_Pos) /*!< SYS_T::GPD_MFPH: PD15MFP Mask */ - -#define SYS_GPE_MFPL_PE0MFP_Pos (0) /*!< SYS_T::GPE_MFPL: PE0MFP Position */ -#define SYS_GPE_MFPL_PE0MFP_Msk (0xful << SYS_GPE_MFPL_PE0MFP_Pos) /*!< SYS_T::GPE_MFPL: PE0MFP Mask */ - -#define SYS_GPE_MFPL_PE1MFP_Pos (4) /*!< SYS_T::GPE_MFPL: PE1MFP Position */ -#define SYS_GPE_MFPL_PE1MFP_Msk (0xful << SYS_GPE_MFPL_PE1MFP_Pos) /*!< SYS_T::GPE_MFPL: PE1MFP Mask */ - -#define SYS_GPE_MFPL_PE2MFP_Pos (8) /*!< SYS_T::GPE_MFPL: PE2MFP Position */ -#define SYS_GPE_MFPL_PE2MFP_Msk (0xful << SYS_GPE_MFPL_PE2MFP_Pos) /*!< SYS_T::GPE_MFPL: PE2MFP Mask */ - -#define SYS_GPE_MFPL_PE3MFP_Pos (12) /*!< SYS_T::GPE_MFPL: PE3MFP Position */ -#define SYS_GPE_MFPL_PE3MFP_Msk (0xful << SYS_GPE_MFPL_PE3MFP_Pos) /*!< SYS_T::GPE_MFPL: PE3MFP Mask */ - -#define SYS_GPE_MFPL_PE4MFP_Pos (16) /*!< SYS_T::GPE_MFPL: PE4MFP Position */ -#define SYS_GPE_MFPL_PE4MFP_Msk (0xful << SYS_GPE_MFPL_PE4MFP_Pos) /*!< SYS_T::GPE_MFPL: PE4MFP Mask */ - -#define SYS_GPE_MFPL_PE5MFP_Pos (20) /*!< SYS_T::GPE_MFPL: PE5MFP Position */ -#define SYS_GPE_MFPL_PE5MFP_Msk (0xful << SYS_GPE_MFPL_PE5MFP_Pos) /*!< SYS_T::GPE_MFPL: PE5MFP Mask */ - -#define SYS_GPE_MFPL_PE6MFP_Pos (24) /*!< SYS_T::GPE_MFPL: PE6MFP Position */ -#define SYS_GPE_MFPL_PE6MFP_Msk (0xful << SYS_GPE_MFPL_PE6MFP_Pos) /*!< SYS_T::GPE_MFPL: PE6MFP Mask */ - -#define SYS_GPE_MFPL_PE7MFP_Pos (28) /*!< SYS_T::GPE_MFPL: PE7MFP Position */ -#define SYS_GPE_MFPL_PE7MFP_Msk (0xful << SYS_GPE_MFPL_PE7MFP_Pos) /*!< SYS_T::GPE_MFPL: PE7MFP Mask */ - -#define SYS_GPE_MFPH_PE8MFP_Pos (0) /*!< SYS_T::GPE_MFPH: PE8MFP Position */ -#define SYS_GPE_MFPH_PE8MFP_Msk (0xful << SYS_GPE_MFPH_PE8MFP_Pos) /*!< SYS_T::GPE_MFPH: PE8MFP Mask */ - -#define SYS_GPE_MFPH_PE9MFP_Pos (4) /*!< SYS_T::GPE_MFPH: PE9MFP Position */ -#define SYS_GPE_MFPH_PE9MFP_Msk (0xful << SYS_GPE_MFPH_PE9MFP_Pos) /*!< SYS_T::GPE_MFPH: PE9MFP Mask */ - -#define SYS_GPE_MFPH_PE10MFP_Pos (8) /*!< SYS_T::GPE_MFPH: PE10MFP Position */ -#define SYS_GPE_MFPH_PE10MFP_Msk (0xful << SYS_GPE_MFPH_PE10MFP_Pos) /*!< SYS_T::GPE_MFPH: PE10MFP Mask */ - -#define SYS_GPE_MFPH_PE11MFP_Pos (12) /*!< SYS_T::GPE_MFPH: PE11MFP Position */ -#define SYS_GPE_MFPH_PE11MFP_Msk (0xful << SYS_GPE_MFPH_PE11MFP_Pos) /*!< SYS_T::GPE_MFPH: PE11MFP Mask */ - -#define SYS_GPE_MFPH_PE12MFP_Pos (16) /*!< SYS_T::GPE_MFPH: PE12MFP Position */ -#define SYS_GPE_MFPH_PE12MFP_Msk (0xful << SYS_GPE_MFPH_PE12MFP_Pos) /*!< SYS_T::GPE_MFPH: PE12MFP Mask */ - -#define SYS_GPE_MFPH_PE13MFP_Pos (20) /*!< SYS_T::GPE_MFPH: PE13MFP Position */ -#define SYS_GPE_MFPH_PE13MFP_Msk (0xful << SYS_GPE_MFPH_PE13MFP_Pos) /*!< SYS_T::GPE_MFPH: PE13MFP Mask */ - -#define SYS_GPE_MFPH_PE14MFP_Pos (24) /*!< SYS_T::GPE_MFPH: PE14MFP Position */ -#define SYS_GPE_MFPH_PE14MFP_Msk (0xful << SYS_GPE_MFPH_PE14MFP_Pos) /*!< SYS_T::GPE_MFPH: PE14MFP Mask */ - -#define SYS_GPE_MFPH_PE15MFP_Pos (28) /*!< SYS_T::GPE_MFPH: PE15MFP Position */ -#define SYS_GPE_MFPH_PE15MFP_Msk (0xful << SYS_GPE_MFPH_PE15MFP_Pos) /*!< SYS_T::GPE_MFPH: PE15MFP Mask */ - -#define SYS_GPF_MFPL_PF0MFP_Pos (0) /*!< SYS_T::GPF_MFPL: PF0MFP Position */ -#define SYS_GPF_MFPL_PF0MFP_Msk (0xful << SYS_GPF_MFPL_PF0MFP_Pos) /*!< SYS_T::GPF_MFPL: PF0MFP Mask */ - -#define SYS_GPF_MFPL_PF1MFP_Pos (4) /*!< SYS_T::GPF_MFPL: PF1MFP Position */ -#define SYS_GPF_MFPL_PF1MFP_Msk (0xful << SYS_GPF_MFPL_PF1MFP_Pos) /*!< SYS_T::GPF_MFPL: PF1MFP Mask */ - -#define SYS_GPF_MFPL_PF2MFP_Pos (8) /*!< SYS_T::GPF_MFPL: PF2MFP Position */ -#define SYS_GPF_MFPL_PF2MFP_Msk (0xful << SYS_GPF_MFPL_PF2MFP_Pos) /*!< SYS_T::GPF_MFPL: PF2MFP Mask */ - -#define SYS_GPF_MFPL_PF3MFP_Pos (12) /*!< SYS_T::GPF_MFPL: PF3MFP Position */ -#define SYS_GPF_MFPL_PF3MFP_Msk (0xful << SYS_GPF_MFPL_PF3MFP_Pos) /*!< SYS_T::GPF_MFPL: PF3MFP Mask */ - -#define SYS_GPF_MFPL_PF4MFP_Pos (16) /*!< SYS_T::GPF_MFPL: PF4MFP Position */ -#define SYS_GPF_MFPL_PF4MFP_Msk (0xful << SYS_GPF_MFPL_PF4MFP_Pos) /*!< SYS_T::GPF_MFPL: PF4MFP Mask */ - -#define SYS_GPF_MFPL_PF5MFP_Pos (20) /*!< SYS_T::GPF_MFPL: PF5MFP Position */ -#define SYS_GPF_MFPL_PF5MFP_Msk (0xful << SYS_GPF_MFPL_PF5MFP_Pos) /*!< SYS_T::GPF_MFPL: PF5MFP Mask */ - -#define SYS_GPF_MFPL_PF6MFP_Pos (24) /*!< SYS_T::GPF_MFPL: PF6MFP Position */ -#define SYS_GPF_MFPL_PF6MFP_Msk (0xful << SYS_GPF_MFPL_PF6MFP_Pos) /*!< SYS_T::GPF_MFPL: PF6MFP Mask */ - -#define SYS_GPF_MFPL_PF7MFP_Pos (28) /*!< SYS_T::GPF_MFPL: PF7MFP Position */ -#define SYS_GPF_MFPL_PF7MFP_Msk (0xful << SYS_GPF_MFPL_PF7MFP_Pos) /*!< SYS_T::GPF_MFPL: PF7MFP Mask */ - -#define SYS_GPF_MFPH_PF8MFP_Pos (0) /*!< SYS_T::GPF_MFPH: PF8MFP Position */ -#define SYS_GPF_MFPH_PF8MFP_Msk (0xful << SYS_GPF_MFPH_PF8MFP_Pos) /*!< SYS_T::GPF_MFPH: PF8MFP Mask */ - -#define SYS_GPF_MFPH_PF9MFP_Pos (4) /*!< SYS_T::GPF_MFPH: PF9MFP Position */ -#define SYS_GPF_MFPH_PF9MFP_Msk (0xful << SYS_GPF_MFPH_PF9MFP_Pos) /*!< SYS_T::GPF_MFPH: PF9MFP Mask */ - -#define SYS_GPF_MFPH_PF10MFP_Pos (8) /*!< SYS_T::GPF_MFPH: PF10MFP Position */ -#define SYS_GPF_MFPH_PF10MFP_Msk (0xful << SYS_GPF_MFPH_PF10MFP_Pos) /*!< SYS_T::GPF_MFPH: PF10MFP Mask */ - -#define SYS_GPF_MFPH_PF11MFP_Pos (12) /*!< SYS_T::GPF_MFPH: PF11MFP Position */ -#define SYS_GPF_MFPH_PF11MFP_Msk (0xful << SYS_GPF_MFPH_PF11MFP_Pos) /*!< SYS_T::GPF_MFPH: PF11MFP Mask */ - -#define SYS_GPF_MFPH_PF12MFP_Pos (16) /*!< SYS_T::GPF_MFPH: PF12MFP Position */ -#define SYS_GPF_MFPH_PF12MFP_Msk (0xful << SYS_GPF_MFPH_PF12MFP_Pos) /*!< SYS_T::GPF_MFPH: PF12MFP Mask */ - -#define SYS_GPF_MFPH_PF13MFP_Pos (20) /*!< SYS_T::GPF_MFPH: PF13MFP Position */ -#define SYS_GPF_MFPH_PF13MFP_Msk (0xful << SYS_GPF_MFPH_PF13MFP_Pos) /*!< SYS_T::GPF_MFPH: PF13MFP Mask */ - -#define SYS_GPF_MFPH_PF14MFP_Pos (24) /*!< SYS_T::GPF_MFPH: PF14MFP Position */ -#define SYS_GPF_MFPH_PF14MFP_Msk (0xful << SYS_GPF_MFPH_PF14MFP_Pos) /*!< SYS_T::GPF_MFPH: PF14MFP Mask */ - -#define SYS_GPF_MFPH_PF15MFP_Pos (28) /*!< SYS_T::GPF_MFPH: PF15MFP Position */ -#define SYS_GPF_MFPH_PF15MFP_Msk (0xful << SYS_GPF_MFPH_PF15MFP_Pos) /*!< SYS_T::GPF_MFPH: PF15MFP Mask */ - -#define SYS_GPG_MFPL_PG0MFP_Pos (0) /*!< SYS_T::GPG_MFPL: PG0MFP Position */ -#define SYS_GPG_MFPL_PG0MFP_Msk (0xful << SYS_GPG_MFPL_PG0MFP_Pos) /*!< SYS_T::GPG_MFPL: PG0MFP Mask */ - -#define SYS_GPG_MFPL_PG1MFP_Pos (4) /*!< SYS_T::GPG_MFPL: PG1MFP Position */ -#define SYS_GPG_MFPL_PG1MFP_Msk (0xful << SYS_GPG_MFPL_PG1MFP_Pos) /*!< SYS_T::GPG_MFPL: PG1MFP Mask */ - -#define SYS_GPG_MFPL_PG2MFP_Pos (8) /*!< SYS_T::GPG_MFPL: PG2MFP Position */ -#define SYS_GPG_MFPL_PG2MFP_Msk (0xful << SYS_GPG_MFPL_PG2MFP_Pos) /*!< SYS_T::GPG_MFPL: PG2MFP Mask */ - -#define SYS_GPG_MFPL_PG3MFP_Pos (12) /*!< SYS_T::GPG_MFPL: PG3MFP Position */ -#define SYS_GPG_MFPL_PG3MFP_Msk (0xful << SYS_GPG_MFPL_PG3MFP_Pos) /*!< SYS_T::GPG_MFPL: PG3MFP Mask */ - -#define SYS_GPG_MFPL_PG4MFP_Pos (16) /*!< SYS_T::GPG_MFPL: PG4MFP Position */ -#define SYS_GPG_MFPL_PG4MFP_Msk (0xful << SYS_GPG_MFPL_PG4MFP_Pos) /*!< SYS_T::GPG_MFPL: PG4MFP Mask */ - -#define SYS_GPG_MFPL_PG5MFP_Pos (20) /*!< SYS_T::GPG_MFPL: PG5MFP Position */ -#define SYS_GPG_MFPL_PG5MFP_Msk (0xful << SYS_GPG_MFPL_PG5MFP_Pos) /*!< SYS_T::GPG_MFPL: PG5MFP Mask */ - -#define SYS_GPG_MFPL_PG6MFP_Pos (24) /*!< SYS_T::GPG_MFPL: PG6MFP Position */ -#define SYS_GPG_MFPL_PG6MFP_Msk (0xful << SYS_GPG_MFPL_PG6MFP_Pos) /*!< SYS_T::GPG_MFPL: PG6MFP Mask */ - -#define SYS_GPG_MFPL_PG7MFP_Pos (28) /*!< SYS_T::GPG_MFPL: PG7MFP Position */ -#define SYS_GPG_MFPL_PG7MFP_Msk (0xful << SYS_GPG_MFPL_PG7MFP_Pos) /*!< SYS_T::GPG_MFPL: PG7MFP Mask */ - -#define SYS_GPG_MFPH_PG8MFP_Pos (0) /*!< SYS_T::GPG_MFPH: PG8MFP Position */ -#define SYS_GPG_MFPH_PG8MFP_Msk (0xful << SYS_GPG_MFPH_PG8MFP_Pos) /*!< SYS_T::GPG_MFPH: PG8MFP Mask */ - -#define SYS_GPG_MFPH_PG9MFP_Pos (4) /*!< SYS_T::GPG_MFPH: PG9MFP Position */ -#define SYS_GPG_MFPH_PG9MFP_Msk (0xful << SYS_GPG_MFPH_PG9MFP_Pos) /*!< SYS_T::GPG_MFPH: PG9MFP Mask */ - -#define SYS_GPG_MFPH_PG10MFP_Pos (8) /*!< SYS_T::GPG_MFPH: PG10MFP Position */ -#define SYS_GPG_MFPH_PG10MFP_Msk (0xful << SYS_GPG_MFPH_PG10MFP_Pos) /*!< SYS_T::GPG_MFPH: PG10MFP Mask */ - -#define SYS_GPG_MFPH_PG11MFP_Pos (12) /*!< SYS_T::GPG_MFPH: PG11MFP Position */ -#define SYS_GPG_MFPH_PG11MFP_Msk (0xful << SYS_GPG_MFPH_PG11MFP_Pos) /*!< SYS_T::GPG_MFPH: PG11MFP Mask */ - -#define SYS_GPG_MFPH_PG12MFP_Pos (16) /*!< SYS_T::GPG_MFPH: PG12MFP Position */ -#define SYS_GPG_MFPH_PG12MFP_Msk (0xful << SYS_GPG_MFPH_PG12MFP_Pos) /*!< SYS_T::GPG_MFPH: PG12MFP Mask */ - -#define SYS_GPG_MFPH_PG13MFP_Pos (20) /*!< SYS_T::GPG_MFPH: PG13MFP Position */ -#define SYS_GPG_MFPH_PG13MFP_Msk (0xful << SYS_GPG_MFPH_PG13MFP_Pos) /*!< SYS_T::GPG_MFPH: PG13MFP Mask */ - -#define SYS_GPG_MFPH_PG14MFP_Pos (24) /*!< SYS_T::GPG_MFPH: PG14MFP Position */ -#define SYS_GPG_MFPH_PG14MFP_Msk (0xful << SYS_GPG_MFPH_PG14MFP_Pos) /*!< SYS_T::GPG_MFPH: PG14MFP Mask */ - -#define SYS_GPG_MFPH_PG15MFP_Pos (28) /*!< SYS_T::GPG_MFPH: PG15MFP Position */ -#define SYS_GPG_MFPH_PG15MFP_Msk (0xful << SYS_GPG_MFPH_PG15MFP_Pos) /*!< SYS_T::GPG_MFPH: PG15MFP Mask */ - -#define SYS_GPH_MFPL_PH0MFP_Pos (0) /*!< SYS_T::GPH_MFPL: PH0MFP Position */ -#define SYS_GPH_MFPL_PH0MFP_Msk (0xful << SYS_GPH_MFPL_PH0MFP_Pos) /*!< SYS_T::GPH_MFPL: PH0MFP Mask */ - -#define SYS_GPH_MFPL_PH1MFP_Pos (4) /*!< SYS_T::GPH_MFPL: PH1MFP Position */ -#define SYS_GPH_MFPL_PH1MFP_Msk (0xful << SYS_GPH_MFPL_PH1MFP_Pos) /*!< SYS_T::GPH_MFPL: PH1MFP Mask */ - -#define SYS_GPH_MFPL_PH2MFP_Pos (8) /*!< SYS_T::GPH_MFPL: PH2MFP Position */ -#define SYS_GPH_MFPL_PH2MFP_Msk (0xful << SYS_GPH_MFPL_PH2MFP_Pos) /*!< SYS_T::GPH_MFPL: PH2MFP Mask */ - -#define SYS_GPH_MFPL_PH3MFP_Pos (12) /*!< SYS_T::GPH_MFPL: PH3MFP Position */ -#define SYS_GPH_MFPL_PH3MFP_Msk (0xful << SYS_GPH_MFPL_PH3MFP_Pos) /*!< SYS_T::GPH_MFPL: PH3MFP Mask */ - -#define SYS_GPH_MFPL_PH4MFP_Pos (16) /*!< SYS_T::GPH_MFPL: PH4MFP Position */ -#define SYS_GPH_MFPL_PH4MFP_Msk (0xful << SYS_GPH_MFPL_PH4MFP_Pos) /*!< SYS_T::GPH_MFPL: PH4MFP Mask */ - -#define SYS_GPH_MFPL_PH5MFP_Pos (20) /*!< SYS_T::GPH_MFPL: PH5MFP Position */ -#define SYS_GPH_MFPL_PH5MFP_Msk (0xful << SYS_GPH_MFPL_PH5MFP_Pos) /*!< SYS_T::GPH_MFPL: PH5MFP Mask */ - -#define SYS_GPH_MFPL_PH6MFP_Pos (24) /*!< SYS_T::GPH_MFPL: PH6MFP Position */ -#define SYS_GPH_MFPL_PH6MFP_Msk (0xful << SYS_GPH_MFPL_PH6MFP_Pos) /*!< SYS_T::GPH_MFPL: PH6MFP Mask */ - -#define SYS_GPH_MFPL_PH7MFP_Pos (28) /*!< SYS_T::GPH_MFPL: PH7MFP Position */ -#define SYS_GPH_MFPL_PH7MFP_Msk (0xful << SYS_GPH_MFPL_PH7MFP_Pos) /*!< SYS_T::GPH_MFPL: PH7MFP Mask */ - -#define SYS_GPH_MFPH_PH8MFP_Pos (0) /*!< SYS_T::GPH_MFPH: PH8MFP Position */ -#define SYS_GPH_MFPH_PH8MFP_Msk (0xful << SYS_GPH_MFPH_PH8MFP_Pos) /*!< SYS_T::GPH_MFPH: PH8MFP Mask */ - -#define SYS_GPH_MFPH_PH9MFP_Pos (4) /*!< SYS_T::GPH_MFPH: PH9MFP Position */ -#define SYS_GPH_MFPH_PH9MFP_Msk (0xful << SYS_GPH_MFPH_PH9MFP_Pos) /*!< SYS_T::GPH_MFPH: PH9MFP Mask */ - -#define SYS_GPH_MFPH_PH10MFP_Pos (8) /*!< SYS_T::GPH_MFPH: PH10MFP Position */ -#define SYS_GPH_MFPH_PH10MFP_Msk (0xful << SYS_GPH_MFPH_PH10MFP_Pos) /*!< SYS_T::GPH_MFPH: PH10MFP Mask */ - -#define SYS_GPH_MFPH_PH11MFP_Pos (12) /*!< SYS_T::GPH_MFPH: PH11MFP Position */ -#define SYS_GPH_MFPH_PH11MFP_Msk (0xful << SYS_GPH_MFPH_PH11MFP_Pos) /*!< SYS_T::GPH_MFPH: PH11MFP Mask */ - -#define SYS_GPH_MFPH_PH12MFP_Pos (16) /*!< SYS_T::GPH_MFPH: PH12MFP Position */ -#define SYS_GPH_MFPH_PH12MFP_Msk (0xful << SYS_GPH_MFPH_PH12MFP_Pos) /*!< SYS_T::GPH_MFPH: PH12MFP Mask */ - -#define SYS_GPH_MFPH_PH13MFP_Pos (20) /*!< SYS_T::GPH_MFPH: PH13MFP Position */ -#define SYS_GPH_MFPH_PH13MFP_Msk (0xful << SYS_GPH_MFPH_PH13MFP_Pos) /*!< SYS_T::GPH_MFPH: PH13MFP Mask */ - -#define SYS_GPH_MFPH_PH14MFP_Pos (24) /*!< SYS_T::GPH_MFPH: PH14MFP Position */ -#define SYS_GPH_MFPH_PH14MFP_Msk (0xful << SYS_GPH_MFPH_PH14MFP_Pos) /*!< SYS_T::GPH_MFPH: PH14MFP Mask */ - -#define SYS_GPH_MFPH_PH15MFP_Pos (28) /*!< SYS_T::GPH_MFPH: PH15MFP Position */ -#define SYS_GPH_MFPH_PH15MFP_Msk (0xful << SYS_GPH_MFPH_PH15MFP_Pos) /*!< SYS_T::GPH_MFPH: PH15MFP Mask */ - -#define SYS_LPLDOCTL_LPLDO_EN_Pos (0) /*!< SYS_T::LPLDOCTL: LPLDO_EN Position */ -#define SYS_LPLDOCTL_LPLDO_EN_Msk (0x1ul << SYS_LPLDOCTL_LPLDO_EN_Pos) /*!< SYS_T::LPLDOCTL: LPLDO_EN Mask */ - -#define SYS_MODCTL_MODEN_Pos (0) /*!< SYS_T::MODCTL: MODEN Position */ -#define SYS_MODCTL_MODEN_Msk (0x1ul << SYS_MODCTL_MODEN_Pos) /*!< SYS_T::MODCTL: MODEN Mask */ - -#define SYS_MODCTL_MODH_Pos (1) /*!< SYS_T::MODCTL: MODH Position */ -#define SYS_MODCTL_MODH_Msk (0x1ul << SYS_MODCTL_MODH_Pos) /*!< SYS_T::MODCTL: MODH Mask */ - -#define SYS_MODCTL_MODPWMSEL_Pos (4) /*!< SYS_T::MODCTL: MODPWMSEL Position */ -#define SYS_MODCTL_MODPWMSEL_Msk (0xful << SYS_MODCTL_MODPWMSEL_Pos) /*!< SYS_T::MODCTL: MODPWMSEL Mask */ - -#define SYS_SRAM_BISTCTL_SRBIST_Pos (0) /*!< SYS_T::SRAM_BISTCTL: SRBIST Position */ -#define SYS_SRAM_BISTCTL_SRBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_SRBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: SRBIST Mask */ - -#define SYS_SRAM_BISTCTL_USBBIST_Pos (4) /*!< SYS_T::SRAM_BISTCTL: USBBIST Position */ -#define SYS_SRAM_BISTCTL_USBBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_USBBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: USBBIST Mask */ - -#define SYS_SRAM_BISTCTL_PDMABIST_Pos (7) /*!< SYS_T::SRAM_BISTCTL: PDMABIST Position */ -#define SYS_SRAM_BISTCTL_PDMABIST_Msk (0x1ul << SYS_SRAM_BISTCTL_PDMABIST_Pos) /*!< SYS_T::SRAM_BISTCTL: PDMABIST Mask */ - -#define SYS_SRAM_BISTSTS_SRBISTEF_Pos (0) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF Position */ -#define SYS_SRAM_BISTSTS_SRBISTEF_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBISTEF_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF Mask */ - -#define SYS_SRAM_BISTSTS_USBBEF_Pos (4) /*!< SYS_T::SRAM_BISTSTS: USBBEF Position */ -#define SYS_SRAM_BISTSTS_USBBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_USBBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: USBBEF Mask */ - -#define SYS_SRAM_BISTSTS_PDMABISTF_Pos (7) /*!< SYS_T::SRAM_BISTSTS: PDMABISTF Position*/ -#define SYS_SRAM_BISTSTS_PDMABISTF_Msk (0x1ul << SYS_SRAM_BISTSTS_PDMABISTF_Pos) /*!< SYS_T::SRAM_BISTSTS: PDMABISTF Mask */ - -#define SYS_SRAM_BISTSTS_SRBEND_Pos (16) /*!< SYS_T::SRAM_BISTSTS: SRBEND Position */ -#define SYS_SRAM_BISTSTS_SRBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBEND Mask */ - -#define SYS_SRAM_BISTSTS_USBBEND_Pos (20) /*!< SYS_T::SRAM_BISTSTS: USBBEND Position */ -#define SYS_SRAM_BISTSTS_USBBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_USBBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: USBBEND Mask */ - -#define SYS_SRAM_BISTSTS_PDMAEND_Pos (23) /*!< SYS_T::SRAM_BISTSTS: PDMAEND Position */ -#define SYS_SRAM_BISTSTS_PDMAEND_Msk (0x1ul << SYS_SRAM_BISTSTS_PDMAEND_Pos) /*!< SYS_T::SRAM_BISTSTS: PDMAEND Mask */ - -#define SYS_SRAM_PARITY_PTESTEN_Pos (0) /*!< SYS_T::SRAM_PARITY: PTESTEN Position */ -#define SYS_SRAM_PARITY_PTESTEN_Msk (0x1ul << SYS_SRAM_PARITY_PTESTEN_Pos) /*!< SYS_T::SRAM_PARITY: PTESTEN Mask */ - -#define SYS_SRAM_PARITY_PTESTPB_Pos (4) /*!< SYS_T::SRAM_PARITY: PTESTPB Position */ -#define SYS_SRAM_PARITY_PTESTPB_Msk (0xful << SYS_SRAM_PARITY_PTESTPB_Pos) /*!< SYS_T::SRAM_PARITY: PTESTPB Mask */ - -#define SYS_SRAM_INTCTL_PERRIEN_Pos (0) /*!< SYS_T::SRAM_INTCTL: PERRIEN Position */ -#define SYS_SRAM_INTCTL_PERRIEN_Msk (0x1ul << SYS_SRAM_INTCTL_PERRIEN_Pos) /*!< SYS_T::SRAM_INTCTL: PERRIEN Mask */ - -#define SYS_SRAM_STATUS_PERRIF_Pos (0) /*!< SYS_T::SRAM_STATUS: PERRIF Position */ -#define SYS_SRAM_STATUS_PERRIF_Msk (0x1ul << SYS_SRAM_STATUS_PERRIF_Pos) /*!< SYS_T::SRAM_STATUS: PERRIF Mask */ - -#define SYS_SRAM_ERRADDR_ERRADDR_Pos (0) /*!< SYS_T::SRAM_ERRADDR: ERRADDR Position */ -#define SYS_SRAM_ERRADDR_ERRADDR_Msk (0xfffffffful << SYS_SRAM_ERRADDR_ERRADDR_Pos) /*!< SYS_T::SRAM_ERRADDR: ERRADDR Mask */ - -#define SYS_HIRCTRIMCTL_FREQSEL_Pos (0) /*!< SYS_T::HIRCTRIMCTL: FREQSEL Position */ -#define SYS_HIRCTRIMCTL_FREQSEL_Msk (0x3ul << SYS_HIRCTRIMCTL_FREQSEL_Pos) /*!< SYS_T::HIRCTRIMCTL: FREQSEL Mask */ - -#define SYS_HIRCTRIMCTL_LOOPSEL_Pos (4) /*!< SYS_T::HIRCTRIMCTL: LOOPSEL Position */ -#define SYS_HIRCTRIMCTL_LOOPSEL_Msk (0x3ul << SYS_HIRCTRIMCTL_LOOPSEL_Pos) /*!< SYS_T::HIRCTRIMCTL: LOOPSEL Mask */ - -#define SYS_HIRCTRIMCTL_RETRYCNT_Pos (6) /*!< SYS_T::HIRCTRIMCTL: RETRYCNT Position */ -#define SYS_HIRCTRIMCTL_RETRYCNT_Msk (0x3ul << SYS_HIRCTRIMCTL_RETRYCNT_Pos) /*!< SYS_T::HIRCTRIMCTL: RETRYCNT Mask */ - -#define SYS_HIRCTRIMCTL_CESTOPEN_Pos (8) /*!< SYS_T::HIRCTRIMCTL: CESTOPEN Position */ -#define SYS_HIRCTRIMCTL_CESTOPEN_Msk (0x1ul << SYS_HIRCTRIMCTL_CESTOPEN_Pos) /*!< SYS_T::HIRCTRIMCTL: CESTOPEN Mask */ - -#define SYS_HIRCTRIMCTL_BOUNDEN_Pos (9) /*!< SYS_T::HIRCTRIMCTL: BOUNDEN Position */ -#define SYS_HIRCTRIMCTL_BOUNDEN_Msk (0x1ul << SYS_HIRCTRIMCTL_BOUNDEN_Pos) /*!< SYS_T::HIRCTRIMCTL: BOUNDEN Mask */ - -#define SYS_HIRCTRIMCTL_REFCKSEL_Pos (10) /*!< SYS_T::HIRCTRIMCTL: REFCKSEL Position */ -#define SYS_HIRCTRIMCTL_REFCKSEL_Msk (0x1ul << SYS_HIRCTRIMCTL_REFCKSEL_Pos) /*!< SYS_T::HIRCTRIMCTL: REFCKSEL Mask */ - -#define SYS_HIRCTRIMCTL_BOUNDARY_Pos (16) /*!< SYS_T::HIRCTRIMCTL: BOUNDARY Position */ -#define SYS_HIRCTRIMCTL_BOUNDARY_Msk (0x1ful << SYS_HIRCTRIMCTL_BOUNDARY_Pos) /*!< SYS_T::HIRCTRIMCTL: BOUNDARY Mask */ - -#define SYS_HIRCTRIMIEN_TFALIEN_Pos (1) /*!< SYS_T::HIRCTRIMIEN: TFALIEN Position */ -#define SYS_HIRCTRIMIEN_TFALIEN_Msk (0x1ul << SYS_HIRCTRIMIEN_TFALIEN_Pos) /*!< SYS_T::HIRCTRIMIEN: TFALIEN Mask */ - -#define SYS_HIRCTRIMIEN_CLKEIEN_Pos (2) /*!< SYS_T::HIRCTRIMIEN: CLKEIEN Position */ -#define SYS_HIRCTRIMIEN_CLKEIEN_Msk (0x1ul << SYS_HIRCTRIMIEN_CLKEIEN_Pos) /*!< SYS_T::HIRCTRIMIEN: CLKEIEN Mask */ - -#define SYS_HIRCTRIMSTS_FREQLOCK_Pos (0) /*!< SYS_T::HIRCTRIMSTS: FREQLOCK Position */ -#define SYS_HIRCTRIMSTS_FREQLOCK_Msk (0x1ul << SYS_HIRCTRIMSTS_FREQLOCK_Pos) /*!< SYS_T::HIRCTRIMSTS: FREQLOCK Mask */ - -#define SYS_HIRCTRIMSTS_TFAILIF_Pos (1) /*!< SYS_T::HIRCTRIMSTS: TFAILIF Position */ -#define SYS_HIRCTRIMSTS_TFAILIF_Msk (0x1ul << SYS_HIRCTRIMSTS_TFAILIF_Pos) /*!< SYS_T::HIRCTRIMSTS: TFAILIF Mask */ - -#define SYS_HIRCTRIMSTS_CLKERIF_Pos (2) /*!< SYS_T::HIRCTRIMSTS: CLKERIF Position */ -#define SYS_HIRCTRIMSTS_CLKERIF_Msk (0x1ul << SYS_HIRCTRIMSTS_CLKERIF_Pos) /*!< SYS_T::HIRCTRIMSTS: CLKERIF Mask */ - -#define SYS_HIRCTRIMSTS_OVBDIF_Pos (3) /*!< SYS_T::HIRCTRIMSTS: OVBDIF Position */ -#define SYS_HIRCTRIMSTS_OVBDIF_Msk (0x1ul << SYS_HIRCTRIMSTS_OVBDIF_Pos) /*!< SYS_T::HIRCTRIMSTS: OVBDIF Mask */ - -#define SYS_REGLCTL_REGLCTL_Pos (0) /*!< SYS_T::REGLCTL: REGLCTL Position */ -#define SYS_REGLCTL_REGLCTL_Msk (0xfful << SYS_REGLCTL_REGLCTL_Pos) /*!< SYS_T::REGLCTL: REGLCTL Mask */ - -#define SYS_PORDISAN_POROFFAN_Pos (0) /*!< SYS_T::PORDISAN: POROFFAN Position */ -#define SYS_PORDISAN_POROFFAN_Msk (0xfffful << SYS_PORDISAN_POROFFAN_Pos) /*!< SYS_T::PORDISAN: POROFFAN Mask */ - -#define NMI_NMIEN_BODOUT_Pos (0) /*!< NMI_T::NMIEN: BODOUT Position */ -#define NMI_NMIEN_BODOUT_Msk (0x1ul << NMI_NMIEN_BODOUT_Pos) /*!< NMI_T::NMIEN: BODOUT Mask */ - -#define NMI_NMIEN_IRC_INT_Pos (1) /*!< NMI_T::NMIEN: IRC_INT Position */ -#define NMI_NMIEN_IRC_INT_Msk (0x1ul << NMI_NMIEN_IRC_INT_Pos) /*!< NMI_T::NMIEN: IRC_INT Mask */ - -#define NMI_NMIEN_PWRWU_INT_Pos (2) /*!< NMI_T::NMIEN: PWRWU_INT Position */ -#define NMI_NMIEN_PWRWU_INT_Msk (0x1ul << NMI_NMIEN_PWRWU_INT_Pos) /*!< NMI_T::NMIEN: PWRWU_INT Mask */ - -#define NMI_NMIEN_SRAM_PERR_Pos (3) /*!< NMI_T::NMIEN: SRAM_PERR Position */ -#define NMI_NMIEN_SRAM_PERR_Msk (0x1ul << NMI_NMIEN_SRAM_PERR_Pos) /*!< NMI_T::NMIEN: SRAM_PERR Mask */ - -#define NMI_NMIEN_CLKFAIL_Pos (4) /*!< NMI_T::NMIEN: CLKFAIL Position */ -#define NMI_NMIEN_CLKFAIL_Msk (0x1ul << NMI_NMIEN_CLKFAIL_Pos) /*!< NMI_T::NMIEN: CLKFAIL Mask */ - -#define NMI_NMIEN_RTC_INT_Pos (6) /*!< NMI_T::NMIEN: RTC_INT Position */ -#define NMI_NMIEN_RTC_INT_Msk (0x1ul << NMI_NMIEN_RTC_INT_Pos) /*!< NMI_T::NMIEN: RTC_INT Mask */ - -#define NMI_NMIEN_EINT0_Pos (8) /*!< NMI_T::NMIEN: EINT0 Position */ -#define NMI_NMIEN_EINT0_Msk (0x1ul << NMI_NMIEN_EINT0_Pos) /*!< NMI_T::NMIEN: EINT0 Mask */ - -#define NMI_NMIEN_EINT1_Pos (9) /*!< NMI_T::NMIEN: EINT1 Position */ -#define NMI_NMIEN_EINT1_Msk (0x1ul << NMI_NMIEN_EINT1_Pos) /*!< NMI_T::NMIEN: EINT1 Mask */ - -#define NMI_NMIEN_EINT2_Pos (10) /*!< NMI_T::NMIEN: EINT2 Position */ -#define NMI_NMIEN_EINT2_Msk (0x1ul << NMI_NMIEN_EINT2_Pos) /*!< NMI_T::NMIEN: EINT2 Mask */ - -#define NMI_NMIEN_EINT3_Pos (11) /*!< NMI_T::NMIEN: EINT3 Position */ -#define NMI_NMIEN_EINT3_Msk (0x1ul << NMI_NMIEN_EINT3_Pos) /*!< NMI_T::NMIEN: EINT3 Mask */ - -#define NMI_NMIEN_EINT4_Pos (12) /*!< NMI_T::NMIEN: EINT4 Position */ -#define NMI_NMIEN_EINT4_Msk (0x1ul << NMI_NMIEN_EINT4_Pos) /*!< NMI_T::NMIEN: EINT4 Mask */ - -#define NMI_NMIEN_EINT5_Pos (13) /*!< NMI_T::NMIEN: EINT5 Position */ -#define NMI_NMIEN_EINT5_Msk (0x1ul << NMI_NMIEN_EINT5_Pos) /*!< NMI_T::NMIEN: EINT5 Mask */ - -#define NMI_NMIEN_UART0_INT_Pos (14) /*!< NMI_T::NMIEN: UART0_INT Position */ -#define NMI_NMIEN_UART0_INT_Msk (0x1ul << NMI_NMIEN_UART0_INT_Pos) /*!< NMI_T::NMIEN: UART0_INT Mask */ - -#define NMI_NMIEN_UART1_INT_Pos (15) /*!< NMI_T::NMIEN: UART1_INT Position */ -#define NMI_NMIEN_UART1_INT_Msk (0x1ul << NMI_NMIEN_UART1_INT_Pos) /*!< NMI_T::NMIEN: UART1_INT Mask */ - -#define NMI_NMISTS_BODOUT_Pos (0) /*!< NMI_T::NMISTS: BODOUT Position */ -#define NMI_NMISTS_BODOUT_Msk (0x1ul << NMI_NMISTS_BODOUT_Pos) /*!< NMI_T::NMISTS: BODOUT Mask */ - -#define NMI_NMISTS_IRC_INT_Pos (1) /*!< NMI_T::NMISTS: IRC_INT Position */ -#define NMI_NMISTS_IRC_INT_Msk (0x1ul << NMI_NMISTS_IRC_INT_Pos) /*!< NMI_T::NMISTS: IRC_INT Mask */ - -#define NMI_NMISTS_PWRWU_INT_Pos (2) /*!< NMI_T::NMISTS: PWRWU_INT Position */ -#define NMI_NMISTS_PWRWU_INT_Msk (0x1ul << NMI_NMISTS_PWRWU_INT_Pos) /*!< NMI_T::NMISTS: PWRWU_INT Mask */ - -#define NMI_NMISTS_SRAM_PERR_Pos (3) /*!< NMI_T::NMISTS: SRAM_PERR Position */ -#define NMI_NMISTS_SRAM_PERR_Msk (0x1ul << NMI_NMISTS_SRAM_PERR_Pos) /*!< NMI_T::NMISTS: SRAM_PERR Mask */ - -#define NMI_NMISTS_CLKFAIL_Pos (4) /*!< NMI_T::NMISTS: CLKFAIL Position */ -#define NMI_NMISTS_CLKFAIL_Msk (0x1ul << NMI_NMISTS_CLKFAIL_Pos) /*!< NMI_T::NMISTS: CLKFAIL Mask */ - -#define NMI_NMISTS_RTC_INT_Pos (6) /*!< NMI_T::NMISTS: RTC_INT Position */ -#define NMI_NMISTS_RTC_INT_Msk (0x1ul << NMI_NMISTS_RTC_INT_Pos) /*!< NMI_T::NMISTS: RTC_INT Mask */ - -#define NMI_NMISTS_EINT0_Pos (8) /*!< NMI_T::NMISTS: EINT0 Position */ -#define NMI_NMISTS_EINT0_Msk (0x1ul << NMI_NMISTS_EINT0_Pos) /*!< NMI_T::NMISTS: EINT0 Mask */ - -#define NMI_NMISTS_EINT1_Pos (9) /*!< NMI_T::NMISTS: EINT1 Position */ -#define NMI_NMISTS_EINT1_Msk (0x1ul << NMI_NMISTS_EINT1_Pos) /*!< NMI_T::NMISTS: EINT1 Mask */ - -#define NMI_NMISTS_EINT2_Pos (10) /*!< NMI_T::NMISTS: EINT2 Position */ -#define NMI_NMISTS_EINT2_Msk (0x1ul << NMI_NMISTS_EINT2_Pos) /*!< NMI_T::NMISTS: EINT2 Mask */ - -#define NMI_NMISTS_EINT3_Pos (11) /*!< NMI_T::NMISTS: EINT3 Position */ -#define NMI_NMISTS_EINT3_Msk (0x1ul << NMI_NMISTS_EINT3_Pos) /*!< NMI_T::NMISTS: EINT3 Mask */ - -#define NMI_NMISTS_EINT4_Pos (12) /*!< NMI_T::NMISTS: EINT4 Position */ -#define NMI_NMISTS_EINT4_Msk (0x1ul << NMI_NMISTS_EINT4_Pos) /*!< NMI_T::NMISTS: EINT4 Mask */ - -#define NMI_NMISTS_EINT5_Pos (13) /*!< NMI_T::NMISTS: EINT5 Position */ -#define NMI_NMISTS_EINT5_Msk (0x1ul << NMI_NMISTS_EINT5_Pos) /*!< NMI_T::NMISTS: EINT5 Mask */ - -#define NMI_NMISTS_UART0_INT_Pos (14) /*!< NMI_T::NMISTS: UART0_INT Position */ -#define NMI_NMISTS_UART0_INT_Msk (0x1ul << NMI_NMISTS_UART0_INT_Pos) /*!< NMI_T::NMISTS: UART0_INT Mask */ - -#define NMI_NMISTS_UART1_INT_Pos (15) /*!< NMI_T::NMISTS: UART1_INT Position */ -#define NMI_NMISTS_UART1_INT_Msk (0x1ul << NMI_NMISTS_UART1_INT_Pos) /*!< NMI_T::NMISTS: UART1_INT Mask */ - -/**@}*/ /* SYS_CONST */ -/**@}*/ /* end of SYS register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __SYS_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/system_M031Series.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/system_M031Series.h deleted file mode 100644 index 1f95fcdb010..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/system_M031Series.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************//** - * @file system_M031Series.h - * @version V3.00 - * $Revision: 5 $ - * $Date: 18/05/29 5:31p $ - * @brief M031 Series System Setting Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __SYSTEM_M031_H__ -#define __SYSTEM_M031_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macro Definition */ -/*---------------------------------------------------------------------------------------------------------*/ -#ifndef DEBUG_PORT -#define DEBUG_PORT UART0 /*!< Select Debug Port which is used for retarget.c to output debug message to UART */ -#endif - -/** - * - * @details This is used to enable PLL to speed up booting at startup. Remove it will cause system using - * default clock source (External crystal or internal 22.1184MHz IRC). - * Enable this option will cause system booting in 72MHz(By XTAL) or 71.8848MHz(By IRC22M) according to - * user configuration setting in CONFIG0 - * - */ - -/*---------------------------------------------------------------------------- - Define SYSCLK - *----------------------------------------------------------------------------*/ -#ifndef __HXT -#define __HXT (32000000UL) /*!< External Crystal Clock Frequency */ -#endif /*!defined(__HXT) */ - -#ifndef __LXT -#define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */ -#endif /*!defined(__LXT) */ - -#define __LIRC (38400UL) /*!< Internal 38.4KHz RC Oscillator Frequency */ -#define __HIRC (48000000UL) /*!< Internal 48M RC Oscillator Frequency */ -#define __HSI (96000000UL) /*!< PLL default output is 96MHz from HIRC */ - -extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ -extern uint32_t CyclesPerUs; /*!< Cycles per micro second */ -extern uint32_t PllClock; /*!< PLL Output Clock Frequency */ - -#if USE_ASSERT -/** - * @brief Assert Function - * - * @param[in] expr Expression to be evaluated - * - * @return None - * - * @details If the expression is false, an error message will be printed out - * from debug port (UART0 or UART1). - */ -#define ASSERT_PARAM(expr) { if (!(expr)) { AssertError((uint8_t*)__FILE__, __LINE__); } } - -void AssertError(uint8_t* file, uint32_t line); -#else -#define ASSERT_PARAM(expr) -#endif - -#define assert_param(expr) ASSERT_PARAM(expr) - - -/** - * @brief System Initialization - * - * @param None - * - * @return None - * - * @details The necessary initialization of system. - */ -extern void SystemInit(void); - - -/** - * @brief Update the Variable SystemCoreClock - * - * @param None - * - * @return None - * - * @details This function is used to update the variable SystemCoreClock - * and must be called whenever the core clock is changed. - */ -extern void SystemCoreClockUpdate(void); - -#ifdef __cplusplus -} -#endif - -#endif - -/* Copyright (C) 2014 Nuvoton Technology Corp. All rights reserved. */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/timer_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/timer_reg.h deleted file mode 100644 index 2e05d08ad2a..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/timer_reg.h +++ /dev/null @@ -1,336 +0,0 @@ -/**************************************************************************//** - * @file timer_reg.h - * @version V1.00 - * @brief TIMER register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TIMER_REG_H__ -#define __TIMER_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup TIMER Timer Controller (TIMER) - Memory Mapped Structure for TIMER Controller -@{ */ - -typedef struct -{ - - - /** - * @var TIMER_T::CTL - * Offset: 0x00/0x20 Timer0~3 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PSC |Prescale Counter - * | | |Timer input clock or event source is divided by (PSC+1) before it is fed to the timer up counter. If this field is 0 (PSC = 0), then there is no scaling. - * | | |Note: Update prescale counter value will reset internal 8-bit prescale counter and 24-bit up counter value. - * |[8] |TRGPDMA |Trigger PDMA Enable Bit - * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger PDMA. - * | | |0 = Timer interrupt trigger PDMA Disabled. - * | | |1 = Timer interrupt trigger PDMA Enabled. - * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger PDMA. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger PDMA. - * |[9] |TRGBPWM |Trigger BPWM Enable Bit - * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger BPWM. - * | | |0 = Timer interrupt trigger BPWM Disabled. - * | | |1 = Timer interrupt trigger BPWM Enabled. - * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger BPWM. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger BPWM. - * |[10] |INTRGEN |Inter-timer Trigger Mode Enable Bit - * | | |Setting this bit will enable the inter-timer trigger capture function. - * | | |The Timer0/2 will be in event counter mode and counting with external clock source or event. Also, Timer1/3 will be in trigger-counting mode of capture function. - * | | |0 = Inter-Timer Trigger mode Disabled. - * | | |1 = Inter-Timer Trigger mode Enabled. - * | | |Note: For Timer1/3, this bit is ignored and the read back value is always 0. - * |[16] |CAPSRC |Capture Pin Source Selection - * | | |0 = Capture Function source is from TMx_EXT (x= 0~3) pin. - * | | |1 = Capture Function source is from internal ACMP output signal or LIRC. User can set INTERCAPSEL (TIMERx_EXTCTL[10:8]) to decide which internal ACMP output signal or LIRC as timer capture source. - * |[18] |TRGSSEL |Trigger Source Select Bit - * | | |This bit is used to select trigger source is from Timer time-out interrupt signal or capture interrupt signal. - * | | |0 = Timer time-out interrupt signal is used to trigger PWM, ADC and PDMA. - * | | |1 = Capture interrupt signal is used to trigger PWM, ADC and PDMA. - * |[19] |TRGPWM |Trigger PWM Enable Bit - * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger PWM. - * | | |0 = Timer interrupt trigger PWM Disabled. - * | | |1 = Timer interrupt trigger PWM Enabled. - * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger PWM. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger PWM. - * |[21] |TRGADC |Trigger ADC Enable Bit - * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger ADC. - * | | |0 = Timer interrupt trigger ADC Disabled. - * | | |1 = Timer interrupt trigger ADC Enabled. - * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger ADC. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger ADC. - * |[22] |TGLPINSEL |Toggle-output Pin Select - * | | |0 = Toggle mode output to Tx (Timer Event Counter Pin). - * | | |1 = Toggle mode output to Tx_EXT (Timer External Capture Pin). - * |[23] |WKEN |Wake-up Function Enable Bit - * | | |If this bit is set to 1, while timer interrupt flag TIF (TIMERx_INTSTS[0]) is 1 and INTEN (TIMERx_CTL[29]) is enabled, the timer interrupt signal will generate a wake-up trigger event to CPU. - * | | |0 = Wake-up function Disabled if timer interrupt signal generated. - * | | |1 = Wake-up function Enabled if timer interrupt signal generated. - * |[24] |EXTCNTEN |Event Counter Mode Enable Bit - * | | |This bit is for external counting pin function enabled. - * | | |0 = Event counter mode Disabled. - * | | |1 = Event counter mode Enabled. - * | | |Note1: When timer is used as an event counter, this bit should be set to 1 and select PCLKx (x=0~1) as timer clock source. - * | | |Note2: When TMR0/TMR2 INTRGEN is set to 1, this bit is forced to 1. When INTRGEN is 1 and TMR1/TMR3 CAPIF (TIMERx_EINTSTS[0]) is 1, this bit is forced to 0. - * |[25] |ACTSTS |Timer Active Status Bit (Read Only) - * | | |This bit indicates the 24-bit up counter status. - * | | |0 = 24-bit up counter is not active. - * | | |1 = 24-bit up counter is active. - * | | |Note: This bit may active when CNT 0 transition to CNT 1. - * |[26] |RSTCNT |Timer Counter Reset Bit - * | | |Setting this bit will reset the 24-bit up counter value CNT (TIMERx_CNT[23:0]) and also force CNTEN (TIMERx_CTL[30]) to 0 if ACTSTS (TIMERx_CTL[25]) is 1. - * | | |0 = No effect. - * | | |1 = Reset internal 8-bit prescale counter, 24-bit up counter value and CNTEN bit. - * | | |Note: This bit will be auto cleared. - * |[28:27] |OPMODE |Timer Counting Mode Select - * | | |00 = The timer controller is operated in One-shot mode. - * | | |01 = The timer controller is operated in Periodic mode. - * | | |10 = The timer controller is operated in Toggle-output mode. - * | | |11 = The timer controller is operated in Continuous Counting mode. - * |[29] |INTEN |Timer Interrupt Enable Bit - * | | |0 = Timer time-out interrupt Disabled. - * | | |1 = Timer time-out interrupt Enabled. - * | | |Note: If this bit is enabled, when the timer time-out interrupt flag TIF is set to 1, the timer interrupt signal is generated and inform to CPU. - * |[30] |CNTEN |Timer Counting Enable Bit - * | | |0 = Stops/Suspends counting. - * | | |1 = Starts counting. - * | | |Note1: In stop status, and then set CNTEN to 1 will enable the 24-bit up counter to keep counting from the last stop counting value. - * | | |Note2: This bit is auto-cleared by hardware in one-shot mode (TIMER_CTL[28:27] = 00) when the timer time-out interrupt flag TIF (TIMERx_INTSTS[0]) is generated. - * | | |Note3: Set enable/disable this bit needs 2 * TMR_CLK period to become active, user can read ACTSTS (TIMERx_CTL[25]) to check enable/disable command is completed or not. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects TIMER counting. - * | | |TIMER counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |TIMER counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var TIMER_T::CMP - * Offset: 0x04/0x24 Timer0~3 Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CMPDAT |Timer Comparator Value - * | | |CMPDAT is a 24-bit compared value register - * | | |When the internal 24-bit up counter value is equal to CMPDAT value, the TIF (TIMERx_INTSTS[0] Timer Interrupt Flag) will set to 1. - * | | |Time-out period = (Period of timer clock input) * (8-bit PSC + 1) * (24-bit CMPDAT). - * | | |Note1: Never write 0x0 or 0x1 in CMPDAT field, or the core will run into unknown state. - * | | |Note2: When timer is operating at continuous counting mode, the 24-bit up counter will keep counting continuously even if user writes a new value into CMPDAT field. But if timer is operating at other modes, the 24-bit up counter will restart counting from 0 and using newest CMPDAT value to be the timer compared value while user writes a new value into CMPDAT field. - * @var TIMER_T::INTSTS - * Offset: 0x08/0x28 Timer0~3 Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TIF |Timer Interrupt Flag - * | | |This bit indicates the interrupt flag status of Timer while 24-bit timer up counter CNT (TIMERx_CNT[23:0]) value reaches to CMPDAT (TIMERx_CMP[23:0]) value. - * | | |0 = No effect. - * | | |1 = CNT value matches the CMPDAT value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |TWKF |Timer Wake-up Flag - * | | |This bit indicates the interrupt wake-up flag status of timer. - * | | |0 = Timer does not cause CPU wake-up. - * | | |1 = CPU wake-up from Idle or Power-down mode if timer time-out interrupt signal generated. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::CNT - * Offset: 0x0C/0x2C Timer0~3 Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Timer Data Register - * | | |Read this register to get CNT value. For example: - * | | |If EXTCNTEN (TIMERx_CTL[24]) is 0, user can read CNT value for getting current 24-bit counter value. - * | | |If EXTCNTEN (TIMERx_CTL[24]) is 1, user can read CNT value for getting current 24-bit event input counter value. - * @var TIMER_T::CAP - * Offset: 0x10/0x30 Timer0~3 Capture Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CAPDAT |Timer Capture Data Register - * | | |When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT pin matched the CAPEDGE (TIMERx_EXTCTL[2:1]) setting, CAPIF (TIMERx_EINTSTS[0]) will set to 1 and the current timer counter value CNT (TIMERx_CNT[23:0]) will be auto-loaded into this CAPDAT field. - * @var TIMER_T::EXTCTL - * Offset: 0x14/0x34 Timer0~3 External Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTPHASE |Timer External Count Phase - * | | |This bit indicates the detection phase of external counting pin TMx (x= 0~3). - * | | |0 = A falling edge of external counting pin will be counted. - * | | |1 = A rising edge of external counting pin will be counted. - * |[2:1] |CAPEDGE |Timer External Capture Pin Edge Detect - * | | |00 = A Falling edge on Tx_EXT (x= 0~3) pin, LIRC or ACMPx (x=0~1) will be detected. - * | | |01 = A Rising edge on Tx_EXT (x= 0~3) pin, LIRC or ACMPx (x=0~1) will be detected. - * | | |10 = Either Rising or Falling edge on Tx_EXT (x= 0~3) pin, LIRC or ACMPx (x=0~1) will be detected. - * | | |11 = Reserved. - * |[3] |CAPEN |Timer Capture Enable Bit - * | | |This bit enables the capture input function. - * | | |0 =Capture source Disabled. - * | | |1 =Capture source Enabled. - * | | |Note: TMR1/TMR3 CAPEN will be forced to 1 when TMR0/TMR2 INTRGEN is enabled. - * |[4] |CAPFUNCS |Capture Function Selection - * | | |0 = External Capture Mode Enabled. - * | | |1 = External Reset Mode Enabled. - * | | |Note1: When CAPFUNCS is 0, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field. - * | | |Note2: When CAPFUNCS is 1, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field then CNT value will be reset immediately. - * |[5] |CAPIEN |Timer External Capture Interrupt Enable Bit - * | | |0 = TMx_EXT (x= 0~3) pin, LIRC, or ACMP detection Interrupt Disabled. - * | | |1 = TMx_EXT (x= 0~3) pin, LIRC, or ACMP detection Interrupt Enabled. - * | | |Note: CAPIEN is used to enable timer external interrupt - * | | |If CAPIEN enabled, timer will rise an interrupt when CAPIF (TIMERx_EINTSTS[0]) is 1. - * | | |For example, while CAPIEN = 1, CAPEN = 1, and CAPEDGE = 00, a 1 to 0 transition on the Tx_EXT (x= 0~3) pin, or ACMP will cause the CAPIF to be set then the interrupt signal is generated and sent to NVIC to inform CPU. - * |[6] |CAPDBEN |Timer External Capture Pin De-bounce Enable Bit - * | | |0 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Disabled. - * | | |1 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx_EXT pin or ACMP output is detected with de-bounce circuit. - * |[7] |CNTDBEN |Timer Counter Pin De-bounce Enable Bit - * | | |0 = TMx (x= 0~3) pin de-bounce Disabled. - * | | |1 = TMx (x= 0~3) pin de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx pin is detected with de-bounce circuit. - * |[10:8] |INTERCAPSEL|Internal Capture Source Selection to Trigger Capture Function - * | | |000 = Capture Function source is from internal ACMP0 output signal. - * | | |001 = Capture Function source is from internal ACMP1 output signal. - * | | |101 = Capture Function source is from LIRC. - * | | |Others = Reserved. - * | | |Note: these bits only available when CAPSRC (TIMERx_CTL[16]) is 1. - * |[16] |ECNTSSEL |Event Counter Source Selection to Trigger Event Counter Function - * | | |0 = Event Counter input source is from TMx (x= 0~3) pin. - * | | |1 = Event Counter input source is from USB internal SOF output signal. - * @var TIMER_T::EINTSTS - * Offset: 0x18/0x38 Timer0~3 External Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPIF |Timer External Capture Interrupt Flag - * | | |This bit indicates the timer external capture interrupt flag status. - * | | |0 = TMx_EXT (x= 0~3) pin interrupt did not occur. - * | | |1 = TMx_EXT (x= 0~3) pin interrupt occurred. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on Tx_EXT (x= 0~3) pin matched the CAPEDGE (TIMERx_EXTCTL[2:1]) setting, this bit will set to 1 by hardware. - * | | |Note3: There is a new incoming capture event detected before CPU clearing the CAPIF status. If the above condition occurred, the Timer will keep register TIMERx_CAP unchanged and drop the new capture value. - */ - __IO uint32_t CTL; /*!< [0x0000] Timer0 Control Register */ - __IO uint32_t CMP; /*!< [0x0004] Timer0 Comparator Register */ - __IO uint32_t INTSTS; /*!< [0x0008] Timer0 Interrupt Status Register */ - __I uint32_t CNT; /*!< [0x000c] Timer0 Data Register */ - __I uint32_t CAP; /*!< [0x0010] Timer0 Capture Data Register */ - __IO uint32_t EXTCTL; /*!< [0x0014] Timer0 External Control Register */ - __IO uint32_t EINTSTS; /*!< [0x0018] Timer0 External Interrupt Status Register */ -} TIMER_T; - -/** - @addtogroup TIMER_CONST TIMER Bit Field Definition - Constant Definitions for TIMER Controller -@{ */ - -#define TIMER_CTL_PSC_Pos (0) /*!< TIMER_T::CTL: PSC Position */ -#define TIMER_CTL_PSC_Msk (0xfful << TIMER_CTL_PSC_Pos) /*!< TIMER_T::CTL: PSC Mask */ - -#define TIMER_CTL_TRGPDMA_Pos (8) /*!< TIMER_T::CTL: TRGPDMA Position */ -#define TIMER_CTL_TRGPDMA_Msk (0x1ul << TIMER_CTL_TRGPDMA_Pos) /*!< TIMER_T::CTL: TRGPDMA Mask */ - -#define TIMER_CTL_TRGBPWM_Pos (9) /*!< TIMER_T::CTL: TRGBPWM Position */ -#define TIMER_CTL_TRGBPWM_Msk (0x1ul << TIMER_CTL_TRGBPWM_Pos) /*!< TIMER_T::CTL: TRGBPWM Mask */ - -#define TIMER_CTL_INTRGEN_Pos (10) /*!< TIMER_T::CTL: INTRGEN Position */ -#define TIMER_CTL_INTRGEN_Msk (0x1ul << TIMER_CTL_INTRGEN_Pos) /*!< TIMER_T::CTL: INTRGEN Mask */ - -#define TIMER_CTL_CAPSRC_Pos (16) /*!< TIMER_T::CTL: CAPSRC Position */ -#define TIMER_CTL_CAPSRC_Msk (0x1ul << TIMER_CTL_CAPSRC_Pos) /*!< TIMER_T::CTL: CAPSRC Mask */ - -#define TIMER_CTL_TRGSSEL_Pos (18) /*!< TIMER_T::CTL: TRGSSEL Position */ -#define TIMER_CTL_TRGSSEL_Msk (0x1ul << TIMER_CTL_TRGSSEL_Pos) /*!< TIMER_T::CTL: TRGSSEL Mask */ - -#define TIMER_CTL_TRGPWM_Pos (19) /*!< TIMER_T::CTL: TRGPWM Position */ -#define TIMER_CTL_TRGPWM_Msk (0x1ul << TIMER_CTL_TRGPWM_Pos) /*!< TIMER_T::CTL: TRGPWM Mask */ - -#define TIMER_CTL_TRGADC_Pos (21) /*!< TIMER_T::CTL: TRGADC Position */ -#define TIMER_CTL_TRGADC_Msk (0x1ul << TIMER_CTL_TRGADC_Pos) /*!< TIMER_T::CTL: TRGADC Mask */ - -#define TIMER_CTL_TGLPINSEL_Pos (22) /*!< TIMER_T::CTL: TGLPINSEL Position */ -#define TIMER_CTL_TGLPINSEL_Msk (0x1ul << TIMER_CTL_TGLPINSEL_Pos) /*!< TIMER_T::CTL: TGLPINSEL Mask */ - -#define TIMER_CTL_WKEN_Pos (23) /*!< TIMER_T::CTL: WKEN Position */ -#define TIMER_CTL_WKEN_Msk (0x1ul << TIMER_CTL_WKEN_Pos) /*!< TIMER_T::CTL: WKEN Mask */ - -#define TIMER_CTL_EXTCNTEN_Pos (24) /*!< TIMER_T::CTL: EXTCNTEN Position */ -#define TIMER_CTL_EXTCNTEN_Msk (0x1ul << TIMER_CTL_EXTCNTEN_Pos) /*!< TIMER_T::CTL: EXTCNTEN Mask */ - -#define TIMER_CTL_ACTSTS_Pos (25) /*!< TIMER_T::CTL: ACTSTS Position */ -#define TIMER_CTL_ACTSTS_Msk (0x1ul << TIMER_CTL_ACTSTS_Pos) /*!< TIMER_T::CTL: ACTSTS Mask */ - -#define TIMER_CTL_RSTCNT_Pos (26) /*!< TIMER_T::CTL: RSTCNT Position */ -#define TIMER_CTL_RSTCNT_Msk (0x1ul << TIMER_CTL_RSTCNT_Pos) /*!< TIMER_T::CTL: RSTCNT Mask */ - -#define TIMER_CTL_OPMODE_Pos (27) /*!< TIMER_T::CTL: OPMODE Position */ -#define TIMER_CTL_OPMODE_Msk (0x3ul << TIMER_CTL_OPMODE_Pos) /*!< TIMER_T::CTL: OPMODE Mask */ - -#define TIMER_CTL_INTEN_Pos (29) /*!< TIMER_T::CTL: INTEN Position */ -#define TIMER_CTL_INTEN_Msk (0x1ul << TIMER_CTL_INTEN_Pos) /*!< TIMER_T::CTL: INTEN Mask */ - -#define TIMER_CTL_CNTEN_Pos (30) /*!< TIMER_T::CTL: CNTEN Position */ -#define TIMER_CTL_CNTEN_Msk (0x1ul << TIMER_CTL_CNTEN_Pos) /*!< TIMER_T::CTL: CNTEN Mask */ - -#define TIMER_CTL_ICEDEBUG_Pos (31) /*!< TIMER_T::CTL: ICEDEBUG Position */ -#define TIMER_CTL_ICEDEBUG_Msk (0x1ul << TIMER_CTL_ICEDEBUG_Pos) /*!< TIMER_T::CTL: ICEDEBUG Mask */ - -#define TIMER_CMP_CMPDAT_Pos (0) /*!< TIMER_T::CMP: CMPDAT Position */ -#define TIMER_CMP_CMPDAT_Msk (0xfffffful << TIMER_CMP_CMPDAT_Pos) /*!< TIMER_T::CMP: CMPDAT Mask */ - -#define TIMER_INTSTS_TIF_Pos (0) /*!< TIMER_T::INTSTS: TIF Position */ -#define TIMER_INTSTS_TIF_Msk (0x1ul << TIMER_INTSTS_TIF_Pos) /*!< TIMER_T::INTSTS: TIF Mask */ - -#define TIMER_INTSTS_TWKF_Pos (1) /*!< TIMER_T::INTSTS: TWKF Position */ -#define TIMER_INTSTS_TWKF_Msk (0x1ul << TIMER_INTSTS_TWKF_Pos) /*!< TIMER_T::INTSTS: TWKF Mask */ - -#define TIMER_CNT_CNT_Pos (0) /*!< TIMER_T::CNT: CNT Position */ -#define TIMER_CNT_CNT_Msk (0xfffffful << TIMER_CNT_CNT_Pos) /*!< TIMER_T::CNT: CNT Mask */ - -#define TIMER_CAP_CAPDAT_Pos (0) /*!< TIMER_T::CAP: CAPDAT Position */ -#define TIMER_CAP_CAPDAT_Msk (0xfffffful << TIMER_CAP_CAPDAT_Pos) /*!< TIMER_T::CAP: CAPDAT Mask */ - -#define TIMER_EXTCTL_CNTPHASE_Pos (0) /*!< TIMER_T::EXTCTL: CNTPHASE Position */ -#define TIMER_EXTCTL_CNTPHASE_Msk (0x1ul << TIMER_EXTCTL_CNTPHASE_Pos) /*!< TIMER_T::EXTCTL: CNTPHASE Mask */ - -#define TIMER_EXTCTL_CAPEDGE_Pos (1) /*!< TIMER_T::EXTCTL: CAPEDGE Position */ -#define TIMER_EXTCTL_CAPEDGE_Msk (0x3ul << TIMER_EXTCTL_CAPEDGE_Pos) /*!< TIMER_T::EXTCTL: CAPEDGE Mask */ - -#define TIMER_EXTCTL_CAPEN_Pos (3) /*!< TIMER_T::EXTCTL: CAPEN Position */ -#define TIMER_EXTCTL_CAPEN_Msk (0x1ul << TIMER_EXTCTL_CAPEN_Pos) /*!< TIMER_T::EXTCTL: CAPEN Mask */ - -#define TIMER_EXTCTL_CAPFUNCS_Pos (4) /*!< TIMER_T::EXTCTL: CAPFUNCS Position */ -#define TIMER_EXTCTL_CAPFUNCS_Msk (0x1ul << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< TIMER_T::EXTCTL: CAPFUNCS Mask */ - -#define TIMER_EXTCTL_CAPIEN_Pos (5) /*!< TIMER_T::EXTCTL: CAPIEN Position */ -#define TIMER_EXTCTL_CAPIEN_Msk (0x1ul << TIMER_EXTCTL_CAPIEN_Pos) /*!< TIMER_T::EXTCTL: CAPIEN Mask */ - -#define TIMER_EXTCTL_CAPDBEN_Pos (6) /*!< TIMER_T::EXTCTL: CAPDBEN Position */ -#define TIMER_EXTCTL_CAPDBEN_Msk (0x1ul << TIMER_EXTCTL_CAPDBEN_Pos) /*!< TIMER_T::EXTCTL: CAPDBEN Mask */ - -#define TIMER_EXTCTL_CNTDBEN_Pos (7) /*!< TIMER_T::EXTCTL: CNTDBEN Position */ -#define TIMER_EXTCTL_CNTDBEN_Msk (0x1ul << TIMER_EXTCTL_CNTDBEN_Pos) /*!< TIMER_T::EXTCTL: CNTDBEN Mask */ - -#define TIMER_EXTCTL_INTERCAPSEL_Pos (8) /*!< TIMER_T::EXTCTL: INTERCAPSEL Position */ -#define TIMER_EXTCTL_INTERCAPSEL_Msk (0x7ul << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< TIMER_T::EXTCTL: INTERCAPSEL Mask */ - -#define TIMER_EXTCTL_ECNTSSEL_Pos (16) /*!< TIMER_T::EXTCTL: ECNTSSEL Position */ -#define TIMER_EXTCTL_ECNTSSEL_Msk (0x1ul << TIMER_EXTCTL_ECNTSSEL_Pos) /*!< TIMER_T::EXTCTL: ECNTSSEL Mask */ - -#define TIMER_EINTSTS_CAPIF_Pos (0) /*!< TIMER_T::EINTSTS: CAPIF Position */ -#define TIMER_EINTSTS_CAPIF_Msk (0x1ul << TIMER_EINTSTS_CAPIF_Pos) /*!< TIMER_T::EINTSTS: CAPIF Mask */ - -/**@}*/ /* TIMER_CONST */ -/**@}*/ /* end of TIMER register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __TIMER_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uart_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uart_reg.h deleted file mode 100644 index 256a2950a86..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uart_reg.h +++ /dev/null @@ -1,1085 +0,0 @@ -/**************************************************************************//** - * @file uart_reg.h - * @version V1.00 - * @brief UART register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UART_REG_H__ -#define __UART_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UART Universal Asynchronous Receiver/Transmitter Controller(UART) - Memory Mapped Structure for UART Controller -@{ */ - -typedef struct -{ - - - /** - * @var UART_T::DAT - * Offset: 0x00 UART Receive/Transmit Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Data Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing one byte to this register, the data byte will be stored in transmitter FIFO. - * | | |The UART controller will send out the data stored in transmitter FIFO top location through the UART_TXD. - * | | |Read Operation: - * | | |By reading this register, the UART controller will return an 8-bit data received from receiver FIFO. - * |[8] |PARITY |Parity Bit Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing to this bit, the parity bit will be stored in transmitter FIFO. - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set, the UART controller will send out this bit follow the DAT (UART_DAT[7:0]) through the UART_TXD. - * | | |Read Operation: - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are enabled, the parity bit can be read by this bit. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set. - * @var UART_T::INTEN - * Offset: 0x04 UART Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIEN |Receive Data Available Interrupt Enable Bit - * | | |0 = Receive data available interrupt Disabled. - * | | |1 = Receive data available interrupt Enabled. - * |[1] |THREIEN |Transmit Holding Register Empty Interrupt Enable Bit - * | | |0 = Transmit holding register empty interrupt Disabled. - * | | |1 = Transmit holding register empty interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive Line Status interrupt Disabled. - * | | |1 = Receive Line Status interrupt Enabled. - * |[3] |MODEMIEN |Modem Status Interrupt Enable Bit - * | | |0 = Modem status interrupt Disabled. - * | | |1 = Modem status interrupt Enabled. - * |[4] |RXTOIEN |RX Time-out Interrupt Enable Bit - * | | |0 = RX time-out interrupt Disabled. - * | | |1 = RX time-out interrupt Enabled. - * |[5] |BUFERRIEN |Buffer Error Interrupt Enable Bit - * | | |0 = Buffer error interrupt Disabled. - * | | |1 = Buffer error interrupt Enabled. - * |[6] |WKIEN |Wake-up Interrupt Enable Bit - * | | |0 = Wake-up Interrupt Disabled. - * | | |1 = Wake-up Interrupt Enabled. - * |[11] |TOCNTEN |Receive Buffer Time-out Counter Enable Bit - * | | |0 = Receive Buffer Time-out counter Disabled. - * | | |1 = Receive Buffer Time-out counter Enabled. - * |[12] |ATORTSEN |nRTS Auto-flow Control Enable Bit - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: When nRTS auto-flow is enabled, if the number of bytes in the RX FIFO equals the RTSTRGLV (UART_FIFO[19:16]), the UART will de-assert nRTS signal. - * |[13] |ATOCTSEN |nCTS Auto-flow Control Enable Bit - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * | | |Note: When nCTS auto-flow is enabled, the UART will send data to external device if nCTS input assert (UART will not send data to device until nCTS is asserted). - * |[14] |TXPDMAEN |TX PDMA Enable Bit - * | | |0 = TX PDMA Disabled. - * | | |1 = TX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused. - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]), UART PDMA transmit request operation is stopped. - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing "1" to corresponding BIF, FEF and PEF to make UART PDMA transmit request operation continue. - * |[15] |RXPDMAEN |RX PDMA Enable Bit - * | | |This bit can enable or disable RX PDMA service. - * | | |0 = RX PDMA Disabled. - * | | |1 = RX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused. - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]), UART PDMA receive request operation is stopped. - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing "1" to corresponding BIF, FEF and PEF to make UART PDMA receive request operation continue. - * |[16] |SWBEIEN |Single-wire Bit Error Detection Interrupt Enable Bit - * | | |Set this bit, the Single-wire Half Duplex Bit Error Detection Interrupt SWBEINT(UART_INTSTS[24]) is generated when Single-wire Bit Error Detection SWBEIF(UART_INTSTS[16]) is set. - * | | |0 = Single-wire Bit Error Detect Inerrupt Disabled. - * | | |1 = Single-wire Bit Error Detect Inerrupt Enabled. - * | | |Note: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * |[18] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[22] |TXENDIEN |Transmitter Empty Interrupt Enable Bit - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt TXENDINT (UART_INTSTS[30]) will be generated when TXENDIF (UART_INTSTS[22]) is set (TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted). - * | | |0 = Transmitter empty interrupt Disabled. - * | | |1 = Transmitter empty interrupt Enabled. - * @var UART_T::FIFO - * Offset: 0x08 UART FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RXRST |RX Field Software Reset - * | | |When RXRST (UART_FIFO[1]) is set, all the byte in the receiver FIFO and RX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the RX internal state machine and pointers. - * | | |Note1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note2: Before setting this bit, it should wait for the RXIDLE (UART_FIFOSTS[29]) be set. - * |[2] |TXRST |TX Field Software Reset - * | | |When TXRST (UART_FIFO[2]) is set, all the byte in the transmit FIFO and TX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the TX internal state machine and pointers. - * | | |Note1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note2: Before setting this bit, it should wait for the TXEMPTYF (UART_FIFOSTS[28]) be set. - * |[7:4] |RFITL |RX FIFO Interrupt Trigger Level - * | | |When the number of bytes in the receive FIFO equals the RFITL, the RDAIF (UART_INTSTS[0]) will be set (if RDAIEN (UART_INTEN [0]) enabled, and an interrupt will be generated). - * | | |0000 = RX FIFO Interrupt Trigger Level is 1 byte. - * | | |0001 = RX FIFO Interrupt Trigger Level is 4 bytes. - * | | |0010 = RX FIFO Interrupt Trigger Level is 8 bytes. - * | | |0011 = RX FIFO Interrupt Trigger Level is 14 bytes. - * | | |Others = Reserved. - * |[8] |RXOFF |Receiver Disable Bit - * | | |The receiver is disabled or not (set 1 to disable receiver). - * | | |0 = Receiver Enabled. - * | | |1 = Receiver Disabled. - * | | |Note: This bit is used for RS-485 Normal Multi-drop mode. - * | | |It should be programmed before RS485NMM (UART_ALTCTL [8]) is programmed. - * |[19:16] |RTSTRGLV |nRTS Trigger Level for Auto-flow Control - * | | |0000 = nRTS Trigger Level is 1 byte. - * | | |0001 = nRTS Trigger Level is 4 bytes. - * | | |0010 = nRTS Trigger Level is 8 bytes. - * | | |0011 = nRTS Trigger Level is 14 bytes. - * | | |Others = Reserved. - * | | |Note: This field is used for auto nRTS flow control. - * @var UART_T::LINE - * Offset: 0x0C UART Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WLS |Word Length Selection - * | | |This field sets UART word length. - * | | |00 = 5 bits. - * | | |01 = 6 bits. - * | | |10 = 7 bits. - * | | |11 = 8 bits. - * |[2] |NSB |Number of "STOP Bit" - * | | |0 = One "STOP bit" is generated in the transmitted data. - * | | |1 = When select 5-bit word length, 1.5 "STOP bit" is generated in the transmitted data. - * | | |When select 6-, 7- and 8-bit word length, 2 "STOP bit" is generated in the transmitted data. - * |[3] |PBE |Parity Bit Enable Bit - * | | |0 = Parity bit generated Disabled. - * | | |1 = Parity bit generated Enabled. - * | | |Note: Parity bit is generated on each outgoing character and is checked on each incoming data. - * |[4] |EPE |Even Parity Enable Bit - * | | |0 = Odd number of logic 1's is transmitted and checked in each word. - * | | |1 = Even number of logic 1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) is set. - * |[5] |SPE |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: If PBE (UART_LINE[3]) and EPE (UART_LINE[4]) are logic 1, the parity bit is transmitted and checked as logic 0 - * | | |If PBE (UART_LINE[3]) is 1 and EPE (UART_LINE[4]) is 0 then the parity bit is transmitted and checked as 1. - * |[6] |BCB |Break Control Bit - * | | |0 = Break Control Disabled. - * | | |1 = Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the transmitted serial data output (TX) is forced to the Spacing State (logic 0) - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[7] |PSS |Parity Bit Source Selection - * | | |The parity bit can be selected to be generated and checked automatically or by software. - * | | |0 = Parity bit is generated by EPE (UART_LINE[4]) and SPE (UART_LINE[5]) setting and checked automatically. - * | | |1 = Parity bit generated and checked by software. - * | | |Note1: This bit has effect only when PBE (UART_LINE[3]) is set. - * | | |Note2: If PSS is 0, the parity bit is transmitted and checked automatically - * | | |If PSS is 1, the transmitted parity bit value can be determined by writing PARITY (UART_DAT[8]) and the parity bit can be read by reading PARITY (UART_DAT[8]). - * |[8] |TXDINV |TX Data Inverted - * | | |0 = Transmitted data signal inverted Disabled. - * | | |1 = Transmitted data signal inverted Enabled. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select UART, LIN or RS485 function. - * |[9] |RXDINV |RX Data Inverted - * | | |0 = Received data signal inverted Disabled. - * | | |1 = Received data signal inverted Enabled. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select UART, LIN or RS485 function. - * @var UART_T::MODEM - * Offset: 0x10 UART Modem Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RTS |nRTS (Request-to-send) Signal Control - * | | |This bit is direct control internal nRTS signal active or not, and then drive the nRTS pin output with RTSACTLV bit configuration. - * | | |0 = nRTS signal is active. - * | | |1 = nRTS signal is inactive. - * | | |Note1: The nRTS signal control bit is not effective when nRTS auto-flow control is enabled in UART function mode. - * | | |Note2: The nRTS signal control bit is not effective when RS-485 auto direction mode (AUD) is enabled in RS-485 function mode. - * | | |Note3: Single-wire mode is support this feature. - * |[9] |RTSACTLV |nRTS Pin Active Level - * | | |This bit defines the active level state of nRTS pin output. - * | | |0 = nRTS pin output is high level active. - * | | |1 = nRTS pin output is low level active. (Default). - * | | |Note1: Refer to Figure 7.11-13 and Figure 7.11-14 for UART function mode. - * | | |Note2: Refer to Figure 7.11-24 and Figure 7.11-25 for RS-485 function mode. - * | | |Note3: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * |[13] |RTSSTS |nRTS Pin Status (Read Only) - * | | |This bit mirror from nRTS pin output of voltage logic status. - * | | |0 = nRTS pin output is low level voltage logic state. - * | | |1 = nRTS pin output is high level voltage logic state. - * @var UART_T::MODEMSTS - * Offset: 0x14 UART Modem Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSDETF |Detect nCTS State Change Flag - * | | |This bit is set whenever nCTS input has change state, and it will generate Modem interrupt to CPU when MODEMIEN (UART_INTEN [3]) is set to 1. - * | | |0 = nCTS input has not change state. - * | | |1 = nCTS input has change state. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[4] |CTSSTS |nCTS Pin Status (Read Only) - * | | |This bit mirror from nCTS pin input of voltage logic status. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - * | | |Note: This bit echoes when UART controller peripheral clock is enabled, and nCTS multi-function port is selected. - * |[8] |CTSACTLV |nCTS Pin Active Level - * | | |This bit defines the active level state of nCTS pin input. - * | | |0 = nCTS pin input is high level active. - * | | |1 = nCTS pin input is low level active. (Default). - * | | |Note: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * @var UART_T::FIFOSTS - * Offset: 0x18 UART FIFO Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXOVIF |RX Overflow Error Interrupt Flag - * | | |This bit is set when RX FIFO overflow. - * | | |If the number of bytes of received data is greater than RX_FIFO (UART_DAT) size 16 bytes, this bit will be set. - * | | |0 = RX FIFO is not overflow. - * | | |1 = RX FIFO is overflow. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[1] |ABRDIF |Auto-baud Rate Detect Interrupt Flag - * | | |This bit is set to logic "1" when Auto-baud Rate detect function is finished. - * | | |0 = Auto-baud rate detect function is not finished. - * | | |1 = Auto-baud rate detect function is finished. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[2] |ABRDTOIF |Auto-baud Rate Detect Time-out Interrupt Flag - * | | |This bit is set to logic "1" in Auto-baud Rate Detect mode when the baud rate counter is overflow. - * | | |0 = Auto-baud rate counter is underflow. - * | | |1 = Auto-baud rate counter is overflow. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[3] |ADDRDETF |RS-485 Address Byte Detect Flag - * | | |0 = Receiver detects a data that is not an address bit (bit 9 ="0"). - * | | |1 = Receiver detects a data that is an address bit (bit 9 ="1"). - * | | |Note1: This field is used for RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1 to enable Address detection mode. - * | | |Note2: This bit can be cleared by writing "1" to it. - * |[4] |PEF |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid "parity bit". - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[5] |FEF |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid "stop bit" (that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[6] |BIF |Break Interrupt Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the "spacing state" (logic 0) for longer than a full word transmission time (that is, the total time of "start bit" + data bits + parity + stop bits). - * | | |0 = No Break interrupt is generated. - * | | |1 = Break interrupt is generated. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[13:8] |RXPTR |RX FIFO Pointer (Read Only) - * | | |This field indicates the RX FIFO Buffer Pointer - * | | |When UART receives one byte from external device, RXPTR increases one. - * | | |When one byte of RX FIFO is read by CPU, RXPTR decreases one. - * | | |The Maximum value shown in RXPTR is 15. - * | | |When the using level of RX FIFO Buffer equal to 16, the RXFULL bit is set to 1 and RXPTR will show 0. - * | | |As one byte of RX FIFO is read by CPU, the RXFULL bit is cleared to 0 and RXPTR will show 15. - * |[14] |RXEMPTY |Receiver FIFO Empty (Read Only) - * | | |This bit initiate RX FIFO empty or not. - * | | |0 = RX FIFO is not empty. - * | | |1 = RX FIFO is empty. - * | | |Note: When the last byte of RX FIFO has been read by CPU, hardware sets this bit high. - * | | |It will be cleared when UART receives any new data. - * |[15] |RXFULL |Receiver FIFO Full (Read Only) - * | | |This bit initiates RX FIFO full or not. - * | | |0 = RX FIFO is not full. - * | | |1 = RX FIFO is full. - * | | |Note: This bit is set when the number of usage in RX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[21:16] |TXPTR |TX FIFO Pointer (Read Only) - * | | |This field indicates the TX FIFO Buffer Pointer. - * | | |When CPU writes one byte into UART_DAT, TXPTR increases one. - * | | |When one byte of TX FIFO is transferred to Transmitter Shift Register, TXPTR decreases one. - * | | |The Maximum value shown in TXPTR is 15 - * | | |When the using level of TX FIFO Buffer equal to 16, the TXFULL bit is set to 1 and TXPTR will show 0. - * | | |As one byte of TX FIFO is transferred to Transmitter Shift Register, the TXFULL bit is cleared to 0 and TXPTR will show 15. - * |[22] |TXEMPTY |Transmitter FIFO Empty (Read Only) - * | | |This bit indicates TX FIFO empty or not. - * | | |0 = TX FIFO is not empty. - * | | |1 = TX FIFO is empty. - * | | |Note: When the last byte of TX FIFO has been transferred to Transmitter Shift Register, hardware sets this bit high. - * | | |It will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[23] |TXFULL |Transmitter FIFO Full (Read Only) - * | | |This bit indicates TX FIFO full or not. - * | | |0 = TX FIFO is not full. - * | | |1 = TX FIFO is full. - * | | |Note: This bit is set when the number of usage in TX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[24] |TXOVIF |TX Overflow Error Interrupt Flag - * | | |If TX FIFO (UART_DAT) is full, an additional write to UART_DAT will cause this bit to logic 1. - * | | |0 = TX FIFO is not overflow. - * | | |1 = TX FIFO is overflow. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[28] |TXEMPTYF |Transmitter Empty Flag (Read Only) - * | | |This bit is set by hardware when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted. - * | | |0 = TX FIFO is not empty or the STOP bit of the last byte has been not transmitted. - * | | |1 = TX FIFO is empty and the STOP bit of the last byte has been transmitted. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[29] |RXIDLE |RX Idle Status (Read Only) - * | | |This bit is set by hardware when RX is idle. - * | | |0 = RX is busy. - * | | |1 = RX is idle. (Default) - * |[31] |TXRXACT |TX and RX Active Status (Read Only) - * | | |This bit indicates TX and RX are active or inactive. - * | | |0 = TX and RX are inactive. - * | | |1 = TX and RX are active. (Default) - * | | |Note: When TXRXDIS (UART_FUNCSEL[3]) is set and both TX and RX are in idle state, this bit is cleared. - * | | |The UART controller can not transmit or receive data at this moment. - * | | |Otherwise this bit is set. - * @var UART_T::INTSTS - * Offset: 0x1C UART Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIF |Receive Data Available Interrupt Flag - * | | |When the number of bytes in the RX FIFO equals the RFITL then the RDAIF(UART_INTSTS[0]) will be set. - * | | |If RDAIEN (UART_INTEN [0]) is enabled, the RDA interrupt will be generated. - * | | |0 = No RDA interrupt flag is generated. - * | | |1 = RDA interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when the number of unread bytes of RX FIFO drops below the threshold level (RFITL(UART_FIFO[7:4]). - * |[1] |THREIF |Transmit Holding Register Empty Interrupt Flag - * | | |This bit is set when the last data of TX FIFO is transferred to Transmitter Shift Register. - * | | |If THREIEN (UART_INTEN[1]) is enabled, the THRE interrupt will be generated. - * | | |0 = No THRE interrupt flag is generated. - * | | |1 = THRE interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[2] |RLSIF |Receive Line Interrupt Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]), is set). - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated. - * | | |1 = RLS interrupt flag is generated. - * | | |Note1: In RS-485 function mode, this field is set include "receiver detect and received address byte character (bit9 = "1") bit". - * | | |At the same time, the bit of ADDRDETF (UART_FIFOSTS[3]) is also set. - * | | |Note2: This bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[3] |MODEMIF |MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS[0]) = 1). - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated. - * | | |1 = Modem interrupt flag is generated. - * | | |Note: This bit is read only and reset to 0 when bit CTSDETF is cleared by a write 1 on CTSDETF(UART_MODEMSTS[0]). - * |[4] |RXTOIF |RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]) - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated. - * | | |0 = No RX time-out interrupt flag is generated. - * | | |1 = RX time-out interrupt flag is generated. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[5] |BUFERRIF |Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX FIFO or RX FIFO overflows (TXOVIF (UART_FIFOSTS[24]) or RXOVIF (UART_FIFOSTS[0]) is set). - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer is not correct. - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated. - * | | |1 = Buffer error interrupt flag is generated. - * | | |Note: This bit is cleared if both of RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]) are cleared to 0 by writing 1 to RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]). - * |[6] |WKIF |UART Wake-up Interrupt Flag (Read Only) - * | | |This bit is set when TOUTWKF (UART_WKSTS[4]), RS485WKF (UART_WKSTS[3]), RFRTWKF (UART_WKSTS[2]), DATWKF (UART_WKSTS[1]) or CTSWKF(UART_WKSTS[0]) is set to 1. - * | | |0 = No UART wake-up interrupt flag is generated. - * | | |1 = UART wake-up interrupt flag is generated. - * | | |Note: This bit is cleared if all of TOUTWKF, RS485WKF, RFRTWKF, DATWKF and CTSWKF are cleared to 0 by writing 1 to the corresponding interrupt flag. - * |[8] |RDAINT |Receive Data Available Interrupt Indicator (Read Only) - * | | |This bit is set if RDAIEN (UART_INTEN[0]) and RDAIF (UART_INTSTS[0]) are both set to 1. - * | | |0 = No RDA interrupt is generated. - * | | |1 = RDA interrupt is generated. - * |[9] |THREINT |Transmit Holding Register Empty Interrupt Indicator (Read Only) - * | | |This bit is set if THREIEN (UART_INTEN[1]) and THREIF(UART_INTSTS[1]) are both set to 1. - * | | |0 = No THRE interrupt is generated. - * | | |1 = THRE interrupt is generated. - * |[10] |RLSINT |Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and RLSIF(UART_INTSTS[2]) are both set to 1. - * | | |0 = No RLS interrupt is generated. - * | | |1 = RLS interrupt is generated. - * |[11] |MODEMINT |MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN(UART_INTEN[3]) and MODEMIF(UART_INTSTS[3]) are both set to 1. - * | | |0 = No Modem interrupt is generated. - * | | |1 = Modem interrupt is generated. - * |[12] |RXTOINT |RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and RXTOIF(UART_INTSTS[4]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated. - * | | |1 = RX time-out interrupt is generated. - * |[13] |BUFERRINT |Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN(UART_INTEN[5]) and BUFERRIF(UART_ INTSTS[5]) are both set to 1. - * | | |0 = No buffer error interrupt is generated. - * | | |1 = Buffer error interrupt is generated. - * |[14] |WKINT |UART Wake-up Interrupt Indicator (Read Only) - * | | |This bit is set if WKIEN (UART_INTEN[6]) and WKIF (UART_INTSTS[6]) are both set to 1. - * | | |0 = No UART wake-up interrupt is generated. - * | | |1 = UART wake-up interrupt is generated. - * |[16] |SWBEIF |Single-wire Bit Error Detection Interrupt Flag - * | | |This bit is set when the single wire bus state not equals to UART controller TX state in Single-wire mode. - * | | |0 = No single-wire bit error detection interrupt flag is generated. - * | | |1 = Single-wire bit error detection interrupt flag is generated. - * | | |Note1: This bit is active when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * | | |Note2: This bit can be cleared by writing "1" to it. - * |[18] |HWRLSIF |PDMA Mode Receive Line Status Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF (UART_FIFOSTS[6]), FEF (UART_FIFOSTS[5]) and PEF (UART_FIFOSTS[4]) is set). - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated in PDMA mode. - * | | |1 = RLS interrupt flag is generated in PDMA mode. - * | | |Note1: In RS-485 function mode, this field include "receiver detect any address byte received address byte character (bit9 = "1") bit". - * | | |Note2: In UART function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[19] |HWMODIF |PDMA Mode MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS [0] =1)). - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated in PDMA mode. - * | | |1 = Modem interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and reset to 0 when the bit CTSDETF (UART_MODEMSTS[0]) is cleared by writing 1 on CTSDETF (UART_MODEMSTS [0]). - * |[20] |HWTOIF |PDMA Mode RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]) - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated . - * | | |0 = No RX time-out interrupt flag is generated in PDMA mode. - * | | |1 = RX time-out interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[21] |HWBUFEIF |PDMA Mode Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX or RX FIFO overflows (TXOVIF (UART_FIFOSTS [24]) or RXOVIF (UART_FIFOSTS[0]) is set). - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer maybe is not correct. - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated in PDMA mode. - * | | |1 = Buffer error interrupt flag is generated in PDMA mode. - * | | |Note: This bit is cleared when both TXOVIF (UART_FIFOSTS[24]]) and RXOVIF (UART_FIFOSTS[0]) are cleared. - * |[22] |TXENDIF |Transmitter Empty Interrupt Flag - * | | |This bit is set when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted (TXEMPTYF (UART_FIFOSTS[28]) is set). - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt will be generated. - * | | |0 = No transmitter empty interrupt flag is generated. - * | | |1 = Transmitter empty interrupt flag is generated. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[24] |SWBEINT |Single-wire Bit Error Detect Interrupt Indicator (Read Only) - * | | |This bit is set if SWBEIEN (UART_INTEN[16]) and SWBEIF (UART_INTSTS[16]) are both set to 1. - * | | |0 = No Single-wire Bit Error Detection Interrupt generated. - * | | |1 = Single-wire Bit Error Detection Interrupt generated. - * |[26] |HWRLSINT |PDMA Mode Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and HWRLSIF(UART_INTSTS[18]) are both set to 1. - * | | |0 = No RLS interrupt is generated in PDMA mode. - * | | |1 = RLS interrupt is generated in PDMA mode. - * |[27] |HWMODINT |PDMA Mode MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN (UART_INTEN[3]) and HWMODIF(UART_INTSTS[19]) are both set to 1. - * | | |0 = No Modem interrupt is generated in PDMA mode. - * | | |1 = Modem interrupt is generated in PDMA mode. - * |[28] |HWTOINT |PDMA Mode RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and HWTOIF(UART_INTSTS[20]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated in PDMA mode. - * | | |1 = RX time-out interrupt is generated in PDMA mode. - * |[29] |HWBUFEINT |PDMA Mode Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN (UART_INTEN[5]) and HWBUFEIF (UART_INTSTS[21]) are both set to 1. - * | | |0 = No buffer error interrupt is generated in PDMA mode. - * | | |1 = Buffer error interrupt is generated in PDMA mode. - * |[30] |TXENDINT |Transmitter Empty Interrupt Indicator (Read Only) - * | | |This bit is set if TXENDIEN (UART_INTEN[22]) and TXENDIF(UART_INTSTS[22]) are both set to 1. - * | | |0 = No Transmitter Empty interrupt is generated. - * | | |1 = Transmitter Empty interrupt is generated. - * |[31] |ABRINT |Auto-baud Rate Interrupt Indicator (Read Only) - * | | |This bit is set if ABRIEN (UART_INTEN[18]) and ABRIF (UART_ALTCTL[17]) are both set to 1. - * | | |0 = No Auto-baud Rate interrupt is generated. - * | | |1 = The Auto-baud Rate interrupt is generated. - * @var UART_T::TOUT - * Offset: 0x20 UART Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TOIC |Time-out Interrupt Comparator - * | | |The time-out counter resets and starts counting (the counting clock = baud rate) whenever the RX FIFO receives a new data word if time out counter is enabled by setting TOCNTEN (UART_INTEN[11]). - * | | |Once the content of time-out counter is equal to that of time-out interrupt comparator (TOIC (UART_TOUT[7:0])), a receiver time-out interrupt (RXTOINT(UART_INTSTS[12])) is generated if RXTOIEN (UART_INTEN [4]) enabled. - * | | |A new incoming data word or RX FIFO empty will clear RXTOIF (UART_INTSTS[4]). - * | | |In order to avoid receiver time-out interrupt generation immediately during one character is being received, TOIC value should be set between 40 and 255. - * | | |So, for example, if TOIC is set with 40, the time-out interrupt is generated after four characters are not received when 1 stop bit and no parity check is set for UART transfer. - * |[15:8] |DLY |TX Delay Time Value - * | | |This field is used to programming the transfer delay time between the last stop bit and next start bit - * | | |The unit is bit time. - * @var UART_T::BAUD - * Offset: 0x24 UART Baud Rate Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |BRD |Baud Rate Divider - * | | |The field indicates the baud rate divider. - * | | |This filed is used in baud rate calculation. - * | | |The detail description is shown in Table 7.11-4. - * |[27:24] |EDIVM1 |Extra Divider for BAUD Rate Mode 1 - * | | |This field is used for baud rate calculation in mode 1 and has no effect for baud rate calculation in mode 0 and mode 2. - * | | |The detail description is shown in Table 7.11-4. - * |[28] |BAUDM0 |BAUD Rate Mode Selection Bit 0 - * | | |This bit is baud rate mode selection bit 0 - * | | |UART provides three baud rate calculation modes. - * | | |This bit combines with BAUDM1 (UART_BAUD[29]) to select baud rate calculation mode. - * | | |The detail description is shown in Table 7.11-4. - * |[29] |BAUDM1 |BAUD Rate Mode Selection Bit 1 - * | | |This bit is baud rate mode selection bit 1. - * | | |UART provides three baud rate calculation modes. - * | | |This bit combines with BAUDM0 (UART_BAUD[28]) to select baud rate calculation mode. - * | | |The detail description is shown in Table 7.11-4. - * | | |Note: In IrDA mode must be operated in mode 0. - * @var UART_T::IRDA - * Offset: 0x28 UART IrDA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXEN |IrDA Receiver/Transmitter Selection Enable Bit - * | | |0 = IrDA Transmitter Disabled and Receiver Enabled. (Default) - * | | |1 = IrDA Transmitter Enabled and Receiver Disabled. - * |[5] |TXINV |IrDA Inverse Transmitting Output Signal - * | | |0 = None inverse transmitting signal. (Default). - * | | |1 = Inverse transmitting output signal. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select IrDA function. - * |[6] |RXINV |IrDA Inverse Receive Input Signal - * | | |0 = None inverse receiving input signal. - * | | |1 = Inverse receiving input signal. (Default) - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select IrDA function. - * @var UART_T::ALTCTL - * Offset: 0x2C UART Alternate Control/Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |BRKFL |UART LIN Break Field Length - * | | |This field indicates a 4-bit LIN TX break field count. - * | | |Note1: This break field length is BRKFL + 1. - * | | |Note2: According to LIN spec, the reset value is 0xC (break field length = 13). - * |[6] |LINRXEN |LIN RX Enable Bit - * | | |0 = LIN RX mode Disabled. - * | | |1 = LIN RX mode Enabled. - * |[7] |LINTXEN |LIN TX Break Mode Enable Bit - * | | |0 = LIN TX Break mode Disabled. - * | | |1 = LIN TX Break mode Enabled. - * | | |Note: When TX break field transfer operation finished, this bit will be cleared automatically. - * |[8] |RS485NMM |RS-485 Normal Multi-drop Operation Mode (NMM) - * | | |0 = RS-485 Normal Multi-drop Operation mode (NMM) Disabled. - * | | |1 = RS-485 Normal Multi-drop Operation mode (NMM) Enabled. - * | | |Note: It cannot be active with RS-485_AAD operation mode. - * |[9] |RS485AAD |RS-485 Auto Address Detection Operation Mode (AAD) - * | | |0 = RS-485 Auto Address Detection Operation mode (AAD) Disabled. - * | | |1 = RS-485 Auto Address Detection Operation mode (AAD) Enabled. - * | | |Note: It cannot be active with RS-485_NMM operation mode. - * |[10] |RS485AUD |RS-485 Auto Direction Function (AUD) - * | | |0 = RS-485 Auto Direction Operation function (AUD) Disabled. - * | | |1 = RS-485 Auto Direction Operation function (AUD) Enabled. - * | | |Note: It can be active with RS-485_AAD or RS-485_NMM operation mode. - * |[15] |ADDRDEN |RS-485 Address Detection Enable Bit - * | | |This bit is used to enable RS-485 Address Detection mode. - * | | |0 = Address detection mode Disabled. - * | | |1 = Address detection mode Enabled. - * | | |Note: This bit is used for RS-485 any operation mode. - * |[17] |ABRIF |Auto-baud Rate Interrupt Flag (Read Only) - * | | |This bit is set when auto-baud rate detection function finished or the auto-baud rate counter was overflow and if ABRIEN(UART_INTEN [18]) is set then the auto-baud rate interrupt will be generated. - * | | |0 = No auto-baud rate interrupt flag is generated. - * | | |1 = Auto-baud rate interrupt flag is generated. - * | | |Note: This bit is read only, but it can be cleared by writing "1" to ABRDTOIF (UART_FIFOSTS[2]) and ABRDIF(UART_FIFOSTS[1]). - * |[18] |ABRDEN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note : This bit is cleared automatically after auto-baud detection is finished. - * |[20:19] |ABRDBITS |Auto-baud Rate Detect Bit Length - * | | |00 = 1-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x01. - * | | |01 = 2-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x02. - * | | |10 = 4-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x08. - * | | |11 = 8-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x80. - * | | |Note : The calculation of bit number includes the START bit. - * |[31:24] |ADDRMV |Address Match Value - * | | |This field contains the RS-485 address match values. - * | | |Note: This field is used for RS-485 auto address detection mode. - * @var UART_T::FUNCSEL - * Offset: 0x30 UART Function Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNCSEL |Function Select - * | | |000 = UART function.Reserved. - * | | |010 = IrDA function. - * | | |011 = RS-485 function. - * | | |100 = UART Single-wire function. - * | | |Others = Reserved. - * |[3] |TXRXDIS |TX and RX Disable Bit - * | | |Setting this bit can disable TX and RX. - * | | |0 = TX and RX Enabled. - * | | |1 = TX and RX Disabled. - * | | |Note: The TX and RX will not disable immediately when this bit is set. - * | | |The TX and RX compelet current task before disable TX and RX. - * | | |When TX and RX disable, the TXRXACT (UART_FIFOSTS[31]) is cleared. - * @var UART_T::BRCOMP - * Offset: 0x3C UART Baud Rate Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |BRCOMP |Baud Rate Compensation Patten - * | | |These 9-bits are used to define the relative bit is compensated or not. - * | | |BRCOMP[7:0] is used to define the compensation of UART_DAT[7:0] and BRCOM[8] is used to define the parity bit. - * |[31] |BRCOMPDEC |Baud Rate Compensation Decrease - * | | |0 = Positive (increase one module clock) compensation for each compensated bit. - * | | |1 = Negative (decrease one module clock) compensation for each compensated bit. - * @var UART_T::WKCTL - * Offset: 0x40 UART Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKCTSEN |nCTS Wake-up Enable Bit - * | | |0 = nCTS Wake-up system function Disabled. - * | | |1 = nCTS Wake-up system function Enabled. - * | | |Note:When the system is in Power-down mode, an external.nCTS change will wake up system from Power-down mode. - * |[1] |WKDATEN |Incoming Data Wake-up Enable Bit - * | | |0 = Incoming data wake-up system function Disabled. - * | | |1 = Incoming data wake-up system function Enabled. - * | | |Note:When the system is in Power-down mode, incoming data will wake-up system from Power-down mode. - * |[2] |WKRFRTEN |Received Data FIFO Reached Threshold Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold wake-up system function Enabled. - * | | |Note1: When the system is in Power-down mode, Received Data FIFO reached threshold will wake-up system from Power-down mode. - * | | |Note2: This bit is valid in UART0 and UART1. - * |[3] |WKRS485EN |RS-485 Address Match (AAD Mode) Wake-up Enable Bit - * | | |0 = RS-485 Address Match (AAD mode) wake-up system function Disabled. - * | | |1 = RS-485 Address Match (AAD mode) wake-up system function Enabled. - * | | |Note1: When the system is in.Power-down mode, RS-485 Address Match will wake-up system from Power-down mode. - * | | |Note2: This bit is used for RS-485 Auto Address Detection (AAD) mode in RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1. - * | | |Note3: This bit is valid in UART0 and UART1. - * |[4] |WKTOUTEN |Received Data FIFO Reached Threshold Time-out Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold time-out wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold time-out wake-up system function Enabled. - * | | |Note1: When the system is in Power-down mode, Received Data FIFO reached threshold time-out will wake up system from Power-down mode. - * | | |Note2: It is suggested the function is enabled when the WKRFRTEN (UART_WKCTL[2]) is set to 1. - * | | |Note3: This bit is valid in UART0 and UART1. - * @var UART_T::WKSTS - * Offset: 0x44 UART Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSWKF |nCTS Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by nCTS wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by nCTS wake-up. - * | | |Note1: If WKCTSEN (UART_WKCTL[0]) is enabled, the nCTS wake-up cause this bit is set to "1". - * | | |Note2: This bit can be cleared by writing "1" to it. - * |[1] |DATWKF |Incoming Data Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by data wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Incoming Data wake-up. - * | | |Note1: If WKDATEN (UART_WKCTL[1]) is enabled, the Incoming Data wake-up cause this bit is set to "1". - * | | |Note2: This bit can be cleared by writing "1" to it. - * |[2] |RFRTWKF |Received Data FIFO Reached Threshold Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO reached threshold wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO Reached Threshold wake-up. - * | | |Note1: If WKRFRTEN (UART_WKCTL[2]) is enabled, the Received Data FIFO Reached Threshold wake-up cause this bit is set to "1". - * | | |Note2: This bit can be cleared by writing "1" to it. - * | | |Note3: This bit is valid in UART0 and UART1. - * |[3] |RS485WKF |RS-485 Address Match (AAD Mode) Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by RS-485 Address Match (AAD mode). - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by RS-485 Address Match (AAD mode) wake-up. - * | | |Note1: If WKRS485EN (UART_WKCTL[3]) is enabled, the RS-485 Address Match (AAD mode) wake-up cause this bit is set to "1". - * | | |Note2: This bit can be cleared by writing "1" to it. - * | | |Note3: This bit is valid in UART0 and UART1. - * |[4] |TOUTWKF |Received Data FIFO Threshold Time-out Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO Threshold Time-out wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO reached threshold time-out. - * | | |Note1: If WKTOUTEN (UART_WKCTL[4]) is enabled, the Received Data FIFO reached threshold time-out wake-up cause this bit is set to "1". - * | | |Note2: This bit can be cleared by writing "1" to it. - * | | |Note3: This bit is valid in UART0 and UART1. - * @var UART_T::DWKCOMP - * Offset: 0x48 UART Incoming Data Wake-up Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STCOMP |Start Bit Compensation Value - * | | |These bits field indicate how many clock cycle selected by UART_CLK do the UART controller can get the 1st bit (start bit) when the device is wake-up from Power-down mode. - * | | |Note: It is valid only when WKDATEN (UART_WKCTL[1]) is set. - */ - __IO uint32_t DAT; /*!< [0x0000] UART Receive/Transmit Buffer Register */ - __IO uint32_t INTEN; /*!< [0x0004] UART Interrupt Enable Register */ - __IO uint32_t FIFO; /*!< [0x0008] UART FIFO Control Register */ - __IO uint32_t LINE; /*!< [0x000c] UART Line Control Register */ - __IO uint32_t MODEM; /*!< [0x0010] UART Modem Control Register */ - __IO uint32_t MODEMSTS; /*!< [0x0014] UART Modem Status Register */ - __IO uint32_t FIFOSTS; /*!< [0x0018] UART FIFO Status Register */ - __IO uint32_t INTSTS; /*!< [0x001c] UART Interrupt Status Register */ - __IO uint32_t TOUT; /*!< [0x0020] UART Time-out Register */ - __IO uint32_t BAUD; /*!< [0x0024] UART Baud Rate Divider Register */ - __IO uint32_t IRDA; /*!< [0x0028] UART IrDA Control Register */ - __IO uint32_t ALTCTL; /*!< [0x002c] UART Alternate Control/Status Register */ - __IO uint32_t FUNCSEL; /*!< [0x0030] UART Function Select Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t BRCOMP; /*!< [0x003c] UART Baud Rate Compensation Register */ - __IO uint32_t WKCTL; /*!< [0x0040] UART Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0044] UART Wake-up Status Register */ - __IO uint32_t DWKCOMP; /*!< [0x0048] UART Incoming Data Wake-up Compensation Register */ - -} UART_T; - - -/** - @addtogroup UART_CONST UART Bit Field Definition - Constant Definitions for UART Controller -@{ */ - -#define UART_DAT_DAT_Pos (0) /*!< UART_T::DAT: DAT Position */ -#define UART_DAT_DAT_Msk (0xfful << UART_DAT_DAT_Pos) /*!< UART_T::DAT: DAT Mask */ - -#define UART_DAT_PARITY_Pos (8) /*!< UART_T::DAT: PARITY Position */ -#define UART_DAT_PARITY_Msk (0x1ul << UART_DAT_PARITY_Pos) /*!< UART_T::DAT: PARITY Mask */ - -#define UART_INTEN_RDAIEN_Pos (0) /*!< UART_T::INTEN: RDAIEN Position */ -#define UART_INTEN_RDAIEN_Msk (0x1ul << UART_INTEN_RDAIEN_Pos) /*!< UART_T::INTEN: RDAIEN Mask */ - -#define UART_INTEN_THREIEN_Pos (1) /*!< UART_T::INTEN: THREIEN Position */ -#define UART_INTEN_THREIEN_Msk (0x1ul << UART_INTEN_THREIEN_Pos) /*!< UART_T::INTEN: THREIEN Mask */ - -#define UART_INTEN_RLSIEN_Pos (2) /*!< UART_T::INTEN: RLSIEN Position */ -#define UART_INTEN_RLSIEN_Msk (0x1ul << UART_INTEN_RLSIEN_Pos) /*!< UART_T::INTEN: RLSIEN Mask */ - -#define UART_INTEN_MODEMIEN_Pos (3) /*!< UART_T::INTEN: MODEMIEN Position */ -#define UART_INTEN_MODEMIEN_Msk (0x1ul << UART_INTEN_MODEMIEN_Pos) /*!< UART_T::INTEN: MODEMIEN Mask */ - -#define UART_INTEN_RXTOIEN_Pos (4) /*!< UART_T::INTEN: RXTOIEN Position */ -#define UART_INTEN_RXTOIEN_Msk (0x1ul << UART_INTEN_RXTOIEN_Pos) /*!< UART_T::INTEN: RXTOIEN Mask */ - -#define UART_INTEN_BUFERRIEN_Pos (5) /*!< UART_T::INTEN: BUFERRIEN Position */ -#define UART_INTEN_BUFERRIEN_Msk (0x1ul << UART_INTEN_BUFERRIEN_Pos) /*!< UART_T::INTEN: BUFERRIEN Mask */ - -#define UART_INTEN_WKIEN_Pos (6) /*!< UART_T::INTEN: WKIEN Position */ -#define UART_INTEN_WKIEN_Msk (0x1ul << UART_INTEN_WKIEN_Pos) /*!< UART_T::INTEN: WKIEN Mask */ - -#define UART_INTEN_TOCNTEN_Pos (11) /*!< UART_T::INTEN: TOCNTEN Position */ -#define UART_INTEN_TOCNTEN_Msk (0x1ul << UART_INTEN_TOCNTEN_Pos) /*!< UART_T::INTEN: TOCNTEN Mask */ - -#define UART_INTEN_ATORTSEN_Pos (12) /*!< UART_T::INTEN: ATORTSEN Position */ -#define UART_INTEN_ATORTSEN_Msk (0x1ul << UART_INTEN_ATORTSEN_Pos) /*!< UART_T::INTEN: ATORTSEN Mask */ - -#define UART_INTEN_ATOCTSEN_Pos (13) /*!< UART_T::INTEN: ATOCTSEN Position */ -#define UART_INTEN_ATOCTSEN_Msk (0x1ul << UART_INTEN_ATOCTSEN_Pos) /*!< UART_T::INTEN: ATOCTSEN Mask */ - -#define UART_INTEN_TXPDMAEN_Pos (14) /*!< UART_T::INTEN: TXPDMAEN Position */ -#define UART_INTEN_TXPDMAEN_Msk (0x1ul << UART_INTEN_TXPDMAEN_Pos) /*!< UART_T::INTEN: TXPDMAEN Mask */ - -#define UART_INTEN_RXPDMAEN_Pos (15) /*!< UART_T::INTEN: RXPDMAEN Position */ -#define UART_INTEN_RXPDMAEN_Msk (0x1ul << UART_INTEN_RXPDMAEN_Pos) /*!< UART_T::INTEN: RXPDMAEN Mask */ - -#define UART_INTEN_SWBEIEN_Pos (16) /*!< UART_T::INTEN: SWBEIEN Position */ -#define UART_INTEN_SWBEIEN_Msk (0x1ul << UART_INTEN_SWBEIEN_Pos) /*!< UART_T::INTEN: SWBEIEN Mask */ - -#define UART_INTEN_ABRIEN_Pos (18) /*!< UART_T::INTEN: ABRIEN Position */ -#define UART_INTEN_ABRIEN_Msk (0x1ul << UART_INTEN_ABRIEN_Pos) /*!< UART_T::INTEN: ABRIEN Mask */ - -#define UART_INTEN_TXENDIEN_Pos (22) /*!< UART_T::INTEN: TXENDIEN Position */ -#define UART_INTEN_TXENDIEN_Msk (0x1ul << UART_INTEN_TXENDIEN_Pos) /*!< UART_T::INTEN: TXENDIEN Mask */ - -#define UART_FIFO_RXRST_Pos (1) /*!< UART_T::FIFO: RXRST Position */ -#define UART_FIFO_RXRST_Msk (0x1ul << UART_FIFO_RXRST_Pos) /*!< UART_T::FIFO: RXRST Mask */ - -#define UART_FIFO_TXRST_Pos (2) /*!< UART_T::FIFO: TXRST Position */ -#define UART_FIFO_TXRST_Msk (0x1ul << UART_FIFO_TXRST_Pos) /*!< UART_T::FIFO: TXRST Mask */ - -#define UART_FIFO_RFITL_Pos (4) /*!< UART_T::FIFO: RFITL Position */ -#define UART_FIFO_RFITL_Msk (0xful << UART_FIFO_RFITL_Pos) /*!< UART_T::FIFO: RFITL Mask */ - -#define UART_FIFO_RXOFF_Pos (8) /*!< UART_T::FIFO: RXOFF Position */ -#define UART_FIFO_RXOFF_Msk (0x1ul << UART_FIFO_RXOFF_Pos) /*!< UART_T::FIFO: RXOFF Mask */ - -#define UART_FIFO_RTSTRGLV_Pos (16) /*!< UART_T::FIFO: RTSTRGLV Position */ -#define UART_FIFO_RTSTRGLV_Msk (0xful << UART_FIFO_RTSTRGLV_Pos) /*!< UART_T::FIFO: RTSTRGLV Mask */ - -#define UART_LINE_WLS_Pos (0) /*!< UART_T::LINE: WLS Position */ -#define UART_LINE_WLS_Msk (0x3ul << UART_LINE_WLS_Pos) /*!< UART_T::LINE: WLS Mask */ - -#define UART_LINE_NSB_Pos (2) /*!< UART_T::LINE: NSB Position */ -#define UART_LINE_NSB_Msk (0x1ul << UART_LINE_NSB_Pos) /*!< UART_T::LINE: NSB Mask */ - -#define UART_LINE_PBE_Pos (3) /*!< UART_T::LINE: PBE Position */ -#define UART_LINE_PBE_Msk (0x1ul << UART_LINE_PBE_Pos) /*!< UART_T::LINE: PBE Mask */ - -#define UART_LINE_EPE_Pos (4) /*!< UART_T::LINE: EPE Position */ -#define UART_LINE_EPE_Msk (0x1ul << UART_LINE_EPE_Pos) /*!< UART_T::LINE: EPE Mask */ - -#define UART_LINE_SPE_Pos (5) /*!< UART_T::LINE: SPE Position */ -#define UART_LINE_SPE_Msk (0x1ul << UART_LINE_SPE_Pos) /*!< UART_T::LINE: SPE Mask */ - -#define UART_LINE_BCB_Pos (6) /*!< UART_T::LINE: BCB Position */ -#define UART_LINE_BCB_Msk (0x1ul << UART_LINE_BCB_Pos) /*!< UART_T::LINE: BCB Mask */ - -#define UART_LINE_PSS_Pos (7) /*!< UART_T::LINE: PSS Position */ -#define UART_LINE_PSS_Msk (0x1ul << UART_LINE_PSS_Pos) /*!< UART_T::LINE: PSS Mask */ - -#define UART_LINE_TXDINV_Pos (8) /*!< UART_T::LINE: TXDINV Position */ -#define UART_LINE_TXDINV_Msk (0x1ul << UART_LINE_TXDINV_Pos) /*!< UART_T::LINE: TXDINV Mask */ - -#define UART_LINE_RXDINV_Pos (9) /*!< UART_T::LINE: RXDINV Position */ -#define UART_LINE_RXDINV_Msk (0x1ul << UART_LINE_RXDINV_Pos) /*!< UART_T::LINE: RXDINV Mask */ - -#define UART_MODEM_RTS_Pos (1) /*!< UART_T::MODEM: RTS Position */ -#define UART_MODEM_RTS_Msk (0x1ul << UART_MODEM_RTS_Pos) /*!< UART_T::MODEM: RTS Mask */ - -#define UART_MODEM_RTSACTLV_Pos (9) /*!< UART_T::MODEM: RTSACTLV Position */ -#define UART_MODEM_RTSACTLV_Msk (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< UART_T::MODEM: RTSACTLV Mask */ - -#define UART_MODEM_RTSSTS_Pos (13) /*!< UART_T::MODEM: RTSSTS Position */ -#define UART_MODEM_RTSSTS_Msk (0x1ul << UART_MODEM_RTSSTS_Pos) /*!< UART_T::MODEM: RTSSTS Mask */ - -#define UART_MODEMSTS_CTSDETF_Pos (0) /*!< UART_T::MODEMSTS: CTSDETF Position */ -#define UART_MODEMSTS_CTSDETF_Msk (0x1ul << UART_MODEMSTS_CTSDETF_Pos) /*!< UART_T::MODEMSTS: CTSDETF Mask */ - -#define UART_MODEMSTS_CTSSTS_Pos (4) /*!< UART_T::MODEMSTS: CTSSTS Position */ -#define UART_MODEMSTS_CTSSTS_Msk (0x1ul << UART_MODEMSTS_CTSSTS_Pos) /*!< UART_T::MODEMSTS: CTSSTS Mask */ - -#define UART_MODEMSTS_CTSACTLV_Pos (8) /*!< UART_T::MODEMSTS: CTSACTLV Position */ -#define UART_MODEMSTS_CTSACTLV_Msk (0x1ul << UART_MODEMSTS_CTSACTLV_Pos) /*!< UART_T::MODEMSTS: CTSACTLV Mask */ - -#define UART_FIFOSTS_RXOVIF_Pos (0) /*!< UART_T::FIFOSTS: RXOVIF Position */ -#define UART_FIFOSTS_RXOVIF_Msk (0x1ul << UART_FIFOSTS_RXOVIF_Pos) /*!< UART_T::FIFOSTS: RXOVIF Mask */ - -#define UART_FIFOSTS_ABRDIF_Pos (1) /*!< UART_T::FIFOSTS: ABRDIF Position */ -#define UART_FIFOSTS_ABRDIF_Msk (0x1ul << UART_FIFOSTS_ABRDIF_Pos) /*!< UART_T::FIFOSTS: ABRDIF Mask */ - -#define UART_FIFOSTS_ABRDTOIF_Pos (2) /*!< UART_T::FIFOSTS: ABRDTOIF Position */ -#define UART_FIFOSTS_ABRDTOIF_Msk (0x1ul << UART_FIFOSTS_ABRDTOIF_Pos) /*!< UART_T::FIFOSTS: ABRDTOIF Mask */ - -#define UART_FIFOSTS_ADDRDETF_Pos (3) /*!< UART_T::FIFOSTS: ADDRDETF Position */ -#define UART_FIFOSTS_ADDRDETF_Msk (0x1ul << UART_FIFOSTS_ADDRDETF_Pos) /*!< UART_T::FIFOSTS: ADDRDETF Mask */ - -#define UART_FIFOSTS_PEF_Pos (4) /*!< UART_T::FIFOSTS: PEF Position */ -#define UART_FIFOSTS_PEF_Msk (0x1ul << UART_FIFOSTS_PEF_Pos) /*!< UART_T::FIFOSTS: PEF Mask */ - -#define UART_FIFOSTS_FEF_Pos (5) /*!< UART_T::FIFOSTS: FEF Position */ -#define UART_FIFOSTS_FEF_Msk (0x1ul << UART_FIFOSTS_FEF_Pos) /*!< UART_T::FIFOSTS: FEF Mask */ - -#define UART_FIFOSTS_BIF_Pos (6) /*!< UART_T::FIFOSTS: BIF Position */ -#define UART_FIFOSTS_BIF_Msk (0x1ul << UART_FIFOSTS_BIF_Pos) /*!< UART_T::FIFOSTS: BIF Mask */ - -#define UART_FIFOSTS_RXPTR_Pos (8) /*!< UART_T::FIFOSTS: RXPTR Position */ -#define UART_FIFOSTS_RXPTR_Msk (0x3ful << UART_FIFOSTS_RXPTR_Pos) /*!< UART_T::FIFOSTS: RXPTR Mask */ - -#define UART_FIFOSTS_RXEMPTY_Pos (14) /*!< UART_T::FIFOSTS: RXEMPTY Position */ -#define UART_FIFOSTS_RXEMPTY_Msk (0x1ul << UART_FIFOSTS_RXEMPTY_Pos) /*!< UART_T::FIFOSTS: RXEMPTY Mask */ - -#define UART_FIFOSTS_RXFULL_Pos (15) /*!< UART_T::FIFOSTS: RXFULL Position */ -#define UART_FIFOSTS_RXFULL_Msk (0x1ul << UART_FIFOSTS_RXFULL_Pos) /*!< UART_T::FIFOSTS: RXFULL Mask */ - -#define UART_FIFOSTS_TXPTR_Pos (16) /*!< UART_T::FIFOSTS: TXPTR Position */ -#define UART_FIFOSTS_TXPTR_Msk (0x3ful << UART_FIFOSTS_TXPTR_Pos) /*!< UART_T::FIFOSTS: TXPTR Mask */ - -#define UART_FIFOSTS_TXEMPTY_Pos (22) /*!< UART_T::FIFOSTS: TXEMPTY Position */ -#define UART_FIFOSTS_TXEMPTY_Msk (0x1ul << UART_FIFOSTS_TXEMPTY_Pos) /*!< UART_T::FIFOSTS: TXEMPTY Mask */ - -#define UART_FIFOSTS_TXFULL_Pos (23) /*!< UART_T::FIFOSTS: TXFULL Position */ -#define UART_FIFOSTS_TXFULL_Msk (0x1ul << UART_FIFOSTS_TXFULL_Pos) /*!< UART_T::FIFOSTS: TXFULL Mask */ - -#define UART_FIFOSTS_TXOVIF_Pos (24) /*!< UART_T::FIFOSTS: TXOVIF Position */ -#define UART_FIFOSTS_TXOVIF_Msk (0x1ul << UART_FIFOSTS_TXOVIF_Pos) /*!< UART_T::FIFOSTS: TXOVIF Mask */ - -#define UART_FIFOSTS_TXEMPTYF_Pos (28) /*!< UART_T::FIFOSTS: TXEMPTYF Position */ -#define UART_FIFOSTS_TXEMPTYF_Msk (0x1ul << UART_FIFOSTS_TXEMPTYF_Pos) /*!< UART_T::FIFOSTS: TXEMPTYF Mask */ - -#define UART_FIFOSTS_RXIDLE_Pos (29) /*!< UART_T::FIFOSTS: RXIDLE Position */ -#define UART_FIFOSTS_RXIDLE_Msk (0x1ul << UART_FIFOSTS_RXIDLE_Pos) /*!< UART_T::FIFOSTS: RXIDLE Mask */ - -#define UART_FIFOSTS_TXRXACT_Pos (31) /*!< UART_T::FIFOSTS: TXRXACT Position */ -#define UART_FIFOSTS_TXRXACT_Msk (0x1ul << UART_FIFOSTS_TXRXACT_Pos) /*!< UART_T::FIFOSTS: TXRXACT Mask */ - -#define UART_INTSTS_RDAIF_Pos (0) /*!< UART_T::INTSTS: RDAIF Position */ -#define UART_INTSTS_RDAIF_Msk (0x1ul << UART_INTSTS_RDAIF_Pos) /*!< UART_T::INTSTS: RDAIF Mask */ - -#define UART_INTSTS_THREIF_Pos (1) /*!< UART_T::INTSTS: THREIF Position */ -#define UART_INTSTS_THREIF_Msk (0x1ul << UART_INTSTS_THREIF_Pos) /*!< UART_T::INTSTS: THREIF Mask */ - -#define UART_INTSTS_RLSIF_Pos (2) /*!< UART_T::INTSTS: RLSIF Position */ -#define UART_INTSTS_RLSIF_Msk (0x1ul << UART_INTSTS_RLSIF_Pos) /*!< UART_T::INTSTS: RLSIF Mask */ - -#define UART_INTSTS_MODEMIF_Pos (3) /*!< UART_T::INTSTS: MODEMIF Position */ -#define UART_INTSTS_MODEMIF_Msk (0x1ul << UART_INTSTS_MODEMIF_Pos) /*!< UART_T::INTSTS: MODEMIF Mask */ - -#define UART_INTSTS_RXTOIF_Pos (4) /*!< UART_T::INTSTS: RXTOIF Position */ -#define UART_INTSTS_RXTOIF_Msk (0x1ul << UART_INTSTS_RXTOIF_Pos) /*!< UART_T::INTSTS: RXTOIF Mask */ - -#define UART_INTSTS_BUFERRIF_Pos (5) /*!< UART_T::INTSTS: BUFERRIF Position */ -#define UART_INTSTS_BUFERRIF_Msk (0x1ul << UART_INTSTS_BUFERRIF_Pos) /*!< UART_T::INTSTS: BUFERRIF Mask */ - -#define UART_INTSTS_WKIF_Pos (6) /*!< UART_T::INTSTS: WKIF Position */ -#define UART_INTSTS_WKIF_Msk (0x1ul << UART_INTSTS_WKIF_Pos) /*!< UART_T::INTSTS: WKIF Mask */ - -#define UART_INTSTS_RDAINT_Pos (8) /*!< UART_T::INTSTS: RDAINT Position */ -#define UART_INTSTS_RDAINT_Msk (0x1ul << UART_INTSTS_RDAINT_Pos) /*!< UART_T::INTSTS: RDAINT Mask */ - -#define UART_INTSTS_THREINT_Pos (9) /*!< UART_T::INTSTS: THREINT Position */ -#define UART_INTSTS_THREINT_Msk (0x1ul << UART_INTSTS_THREINT_Pos) /*!< UART_T::INTSTS: THREINT Mask */ - -#define UART_INTSTS_RLSINT_Pos (10) /*!< UART_T::INTSTS: RLSINT Position */ -#define UART_INTSTS_RLSINT_Msk (0x1ul << UART_INTSTS_RLSINT_Pos) /*!< UART_T::INTSTS: RLSINT Mask */ - -#define UART_INTSTS_MODEMINT_Pos (11) /*!< UART_T::INTSTS: MODEMINT Position */ -#define UART_INTSTS_MODEMINT_Msk (0x1ul << UART_INTSTS_MODEMINT_Pos) /*!< UART_T::INTSTS: MODEMINT Mask */ - -#define UART_INTSTS_RXTOINT_Pos (12) /*!< UART_T::INTSTS: RXTOINT Position */ -#define UART_INTSTS_RXTOINT_Msk (0x1ul << UART_INTSTS_RXTOINT_Pos) /*!< UART_T::INTSTS: RXTOINT Mask */ - -#define UART_INTSTS_BUFERRINT_Pos (13) /*!< UART_T::INTSTS: BUFERRINT Position */ -#define UART_INTSTS_BUFERRINT_Msk (0x1ul << UART_INTSTS_BUFERRINT_Pos) /*!< UART_T::INTSTS: BUFERRINT Mask */ - -#define UART_INTSTS_WKINT_Pos (14) /*!< UART_T::INTSTS: WKINT Position */ -#define UART_INTSTS_WKINT_Msk (0x1ul << UART_INTSTS_WKINT_Pos) /*!< UART_T::INTSTS: WKINT Mask */ - -#define UART_INTSTS_SWBEIF_Pos (16) /*!< UART_T::INTSTS: SWBEIF Position */ -#define UART_INTSTS_SWBEIF_Msk (0x1ul << UART_INTSTS_SWBEIF_Pos) /*!< UART_T::INTSTS: SWBEIF Mask */ - -#define UART_INTSTS_HWRLSIF_Pos (18) /*!< UART_T::INTSTS: HWRLSIF Position */ -#define UART_INTSTS_HWRLSIF_Msk (0x1ul << UART_INTSTS_HWRLSIF_Pos) /*!< UART_T::INTSTS: HWRLSIF Mask */ - -#define UART_INTSTS_HWMODIF_Pos (19) /*!< UART_T::INTSTS: HWMODIF Position */ -#define UART_INTSTS_HWMODIF_Msk (0x1ul << UART_INTSTS_HWMODIF_Pos) /*!< UART_T::INTSTS: HWMODIF Mask */ - -#define UART_INTSTS_HWTOIF_Pos (20) /*!< UART_T::INTSTS: HWTOIF Position */ -#define UART_INTSTS_HWTOIF_Msk (0x1ul << UART_INTSTS_HWTOIF_Pos) /*!< UART_T::INTSTS: HWTOIF Mask */ - -#define UART_INTSTS_HWBUFEIF_Pos (21) /*!< UART_T::INTSTS: HWBUFEIF Position */ -#define UART_INTSTS_HWBUFEIF_Msk (0x1ul << UART_INTSTS_HWBUFEIF_Pos) /*!< UART_T::INTSTS: HWBUFEIF Mask */ - -#define UART_INTSTS_TXENDIF_Pos (22) /*!< UART_T::INTSTS: TXENDIF Position */ -#define UART_INTSTS_TXENDIF_Msk (0x1ul << UART_INTSTS_TXENDIF_Pos) /*!< UART_T::INTSTS: TXENDIF Mask */ - -#define UART_INTSTS_SWBEINT_Pos (24) /*!< UART_T::INTSTS: SWBEINT Position */ -#define UART_INTSTS_SWBEINT_Msk (0x1ul << UART_INTSTS_SWBEINT_Pos) /*!< UART_T::INTSTS: SWBEINT Mask */ - -#define UART_INTSTS_HWRLSINT_Pos (26) /*!< UART_T::INTSTS: HWRLSINT Position */ -#define UART_INTSTS_HWRLSINT_Msk (0x1ul << UART_INTSTS_HWRLSINT_Pos) /*!< UART_T::INTSTS: HWRLSINT Mask */ - -#define UART_INTSTS_HWMODINT_Pos (27) /*!< UART_T::INTSTS: HWMODINT Position */ -#define UART_INTSTS_HWMODINT_Msk (0x1ul << UART_INTSTS_HWMODINT_Pos) /*!< UART_T::INTSTS: HWMODINT Mask */ - -#define UART_INTSTS_HWTOINT_Pos (28) /*!< UART_T::INTSTS: HWTOINT Position */ -#define UART_INTSTS_HWTOINT_Msk (0x1ul << UART_INTSTS_HWTOINT_Pos) /*!< UART_T::INTSTS: HWTOINT Mask */ - -#define UART_INTSTS_HWBUFEINT_Pos (29) /*!< UART_T::INTSTS: HWBUFEINT Position */ -#define UART_INTSTS_HWBUFEINT_Msk (0x1ul << UART_INTSTS_HWBUFEINT_Pos) /*!< UART_T::INTSTS: HWBUFEINT Mask */ - -#define UART_INTSTS_TXENDINT_Pos (30) /*!< UART_T::INTSTS: TXENDINT Position */ -#define UART_INTSTS_TXENDINT_Msk (0x1ul << UART_INTSTS_TXENDINT_Pos) /*!< UART_T::INTSTS: TXENDINT Mask */ - -#define UART_INTSTS_ABRINT_Pos (31) /*!< UART_T::INTSTS: ABRINT Position */ -#define UART_INTSTS_ABRINT_Msk (0x1ul << UART_INTSTS_ABRINT_Pos) /*!< UART_T::INTSTS: ABRINT Mask */ - -#define UART_TOUT_TOIC_Pos (0) /*!< UART_T::TOUT: TOIC Position */ -#define UART_TOUT_TOIC_Msk (0xfful << UART_TOUT_TOIC_Pos) /*!< UART_T::TOUT: TOIC Mask */ - -#define UART_TOUT_DLY_Pos (8) /*!< UART_T::TOUT: DLY Position */ -#define UART_TOUT_DLY_Msk (0xfful << UART_TOUT_DLY_Pos) /*!< UART_T::TOUT: DLY Mask */ - -#define UART_BAUD_BRD_Pos (0) /*!< UART_T::BAUD: BRD Position */ -#define UART_BAUD_BRD_Msk (0xfffful << UART_BAUD_BRD_Pos) /*!< UART_T::BAUD: BRD Mask */ - -#define UART_BAUD_EDIVM1_Pos (24) /*!< UART_T::BAUD: EDIVM1 Position */ -#define UART_BAUD_EDIVM1_Msk (0xful << UART_BAUD_EDIVM1_Pos) /*!< UART_T::BAUD: EDIVM1 Mask */ - -#define UART_BAUD_BAUDM0_Pos (28) /*!< UART_T::BAUD: BAUDM0 Position */ -#define UART_BAUD_BAUDM0_Msk (0x1ul << UART_BAUD_BAUDM0_Pos) /*!< UART_T::BAUD: BAUDM0 Mask */ - -#define UART_BAUD_BAUDM1_Pos (29) /*!< UART_T::BAUD: BAUDM1 Position */ -#define UART_BAUD_BAUDM1_Msk (0x1ul << UART_BAUD_BAUDM1_Pos) /*!< UART_T::BAUD: BAUDM1 Mask */ - -#define UART_IRDA_TXEN_Pos (1) /*!< UART_T::IRDA: TXEN Position */ -#define UART_IRDA_TXEN_Msk (0x1ul << UART_IRDA_TXEN_Pos) /*!< UART_T::IRDA: TXEN Mask */ - -#define UART_IRDA_TXINV_Pos (5) /*!< UART_T::IRDA: TXINV Position */ -#define UART_IRDA_TXINV_Msk (0x1ul << UART_IRDA_TXINV_Pos) /*!< UART_T::IRDA: TXINV Mask */ - -#define UART_IRDA_RXINV_Pos (6) /*!< UART_T::IRDA: RXINV Position */ -#define UART_IRDA_RXINV_Msk (0x1ul << UART_IRDA_RXINV_Pos) /*!< UART_T::IRDA: RXINV Mask */ - -#define UART_ALTCTL_BRKFL_Pos (0) /*!< UART_T::ALTCTL: BRKFL Position */ -#define UART_ALTCTL_BRKFL_Msk (0xful << UART_ALTCTL_BRKFL_Pos) /*!< UART_T::ALTCTL: BRKFL Mask */ - -#define UART_ALTCTL_LINRXEN_Pos (6) /*!< UART_T::ALTCTL: LINRXEN Position */ -#define UART_ALTCTL_LINRXEN_Msk (0x1ul << UART_ALTCTL_LINRXEN_Pos) /*!< UART_T::ALTCTL: LINRXEN Mask */ - -#define UART_ALTCTL_LINTXEN_Pos (7) /*!< UART_T::ALTCTL: LINTXEN Position */ -#define UART_ALTCTL_LINTXEN_Msk (0x1ul << UART_ALTCTL_LINTXEN_Pos) /*!< UART_T::ALTCTL: LINTXEN Mask */ - -#define UART_ALTCTL_RS485NMM_Pos (8) /*!< UART_T::ALTCTL: RS485NMM Position */ -#define UART_ALTCTL_RS485NMM_Msk (0x1ul << UART_ALTCTL_RS485NMM_Pos) /*!< UART_T::ALTCTL: RS485NMM Mask */ - -#define UART_ALTCTL_RS485AAD_Pos (9) /*!< UART_T::ALTCTL: RS485AAD Position */ -#define UART_ALTCTL_RS485AAD_Msk (0x1ul << UART_ALTCTL_RS485AAD_Pos) /*!< UART_T::ALTCTL: RS485AAD Mask */ - -#define UART_ALTCTL_RS485AUD_Pos (10) /*!< UART_T::ALTCTL: RS485AUD Position */ -#define UART_ALTCTL_RS485AUD_Msk (0x1ul << UART_ALTCTL_RS485AUD_Pos) /*!< UART_T::ALTCTL: RS485AUD Mask */ - -#define UART_ALTCTL_ADDRDEN_Pos (15) /*!< UART_T::ALTCTL: ADDRDEN Position */ -#define UART_ALTCTL_ADDRDEN_Msk (0x1ul << UART_ALTCTL_ADDRDEN_Pos) /*!< UART_T::ALTCTL: ADDRDEN Mask */ - -#define UART_ALTCTL_ABRIF_Pos (17) /*!< UART_T::ALTCTL: ABRIF Position */ -#define UART_ALTCTL_ABRIF_Msk (0x1ul << UART_ALTCTL_ABRIF_Pos) /*!< UART_T::ALTCTL: ABRIF Mask */ - -#define UART_ALTCTL_ABRDEN_Pos (18) /*!< UART_T::ALTCTL: ABRDEN Position */ -#define UART_ALTCTL_ABRDEN_Msk (0x1ul << UART_ALTCTL_ABRDEN_Pos) /*!< UART_T::ALTCTL: ABRDEN Mask */ - -#define UART_ALTCTL_ABRDBITS_Pos (19) /*!< UART_T::ALTCTL: ABRDBITS Position */ -#define UART_ALTCTL_ABRDBITS_Msk (0x3ul << UART_ALTCTL_ABRDBITS_Pos) /*!< UART_T::ALTCTL: ABRDBITS Mask */ - -#define UART_ALTCTL_ADDRMV_Pos (24) /*!< UART_T::ALTCTL: ADDRMV Position */ -#define UART_ALTCTL_ADDRMV_Msk (0xfful << UART_ALTCTL_ADDRMV_Pos) /*!< UART_T::ALTCTL: ADDRMV Mask */ - -#define UART_FUNCSEL_FUNCSEL_Pos (0) /*!< UART_T::FUNCSEL: FUNCSEL Position */ -#define UART_FUNCSEL_FUNCSEL_Msk (0x7ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_T::FUNCSEL: FUNCSEL Mask */ - -#define UART_FUNCSEL_TXRXDIS_Pos (3) /*!< UART_T::FUNCSEL: TXRXDIS Position */ -#define UART_FUNCSEL_TXRXDIS_Msk (0x1ul << UART_FUNCSEL_TXRXDIS_Pos) /*!< UART_T::FUNCSEL: TXRXDIS Mask */ - -#define UART_BRCOMP_BRCOMP_Pos (0) /*!< UART_T::BRCOMP: BRCOMP Position */ -#define UART_BRCOMP_BRCOMP_Msk (0x1fful << UART_BRCOMP_BRCOMP_Pos) /*!< UART_T::BRCOMP: BRCOMP Mask */ - -#define UART_BRCOMP_BRCOMPDEC_Pos (31) /*!< UART_T::BRCOMP: BRCOMPDEC Position */ -#define UART_BRCOMP_BRCOMPDEC_Msk (0x1ul << UART_BRCOMP_BRCOMPDEC_Pos) /*!< UART_T::BRCOMP: BRCOMPDEC Mask */ - -#define UART_WKCTL_WKCTSEN_Pos (0) /*!< UART_T::WKCTL: WKCTSEN Position */ -#define UART_WKCTL_WKCTSEN_Msk (0x1ul << UART_WKCTL_WKCTSEN_Pos) /*!< UART_T::WKCTL: WKCTSEN Mask */ - -#define UART_WKCTL_WKDATEN_Pos (1) /*!< UART_T::WKCTL: WKDATEN Position */ -#define UART_WKCTL_WKDATEN_Msk (0x1ul << UART_WKCTL_WKDATEN_Pos) /*!< UART_T::WKCTL: WKDATEN Mask */ - -#define UART_WKCTL_WKRFRTEN_Pos (2) /*!< UART_T::WKCTL: WKRFRTEN Position */ -#define UART_WKCTL_WKRFRTEN_Msk (0x1ul << UART_WKCTL_WKRFRTEN_Pos) /*!< UART_T::WKCTL: WKRFRTEN Mask */ - -#define UART_WKCTL_WKRS485EN_Pos (3) /*!< UART_T::WKCTL: WKRS485EN Position */ -#define UART_WKCTL_WKRS485EN_Msk (0x1ul << UART_WKCTL_WKRS485EN_Pos) /*!< UART_T::WKCTL: WKRS485EN Mask */ - -#define UART_WKCTL_WKTOUTEN_Pos (4) /*!< UART_T::WKCTL: WKTOUTEN Position */ -#define UART_WKCTL_WKTOUTEN_Msk (0x1ul << UART_WKCTL_WKTOUTEN_Pos) /*!< UART_T::WKCTL: WKTOUTEN Mask */ - -#define UART_WKSTS_CTSWKF_Pos (0) /*!< UART_T::WKSTS: CTSWKF Position */ -#define UART_WKSTS_CTSWKF_Msk (0x1ul << UART_WKSTS_CTSWKF_Pos) /*!< UART_T::WKSTS: CTSWKF Mask */ - -#define UART_WKSTS_DATWKF_Pos (1) /*!< UART_T::WKSTS: DATWKF Position */ -#define UART_WKSTS_DATWKF_Msk (0x1ul << UART_WKSTS_DATWKF_Pos) /*!< UART_T::WKSTS: DATWKF Mask */ - -#define UART_WKSTS_RFRTWKF_Pos (2) /*!< UART_T::WKSTS: RFRTWKF Position */ -#define UART_WKSTS_RFRTWKF_Msk (0x1ul << UART_WKSTS_RFRTWKF_Pos) /*!< UART_T::WKSTS: RFRTWKF Mask */ - -#define UART_WKSTS_RS485WKF_Pos (3) /*!< UART_T::WKSTS: RS485WKF Position */ -#define UART_WKSTS_RS485WKF_Msk (0x1ul << UART_WKSTS_RS485WKF_Pos) /*!< UART_T::WKSTS: RS485WKF Mask */ - -#define UART_WKSTS_TOUTWKF_Pos (4) /*!< UART_T::WKSTS: TOUTWKF Position */ -#define UART_WKSTS_TOUTWKF_Msk (0x1ul << UART_WKSTS_TOUTWKF_Pos) /*!< UART_T::WKSTS: TOUTWKF Mask */ - -#define UART_DWKCOMP_STCOMP_Pos (0) /*!< UART_T::DWKCOMP: STCOMP Position */ -#define UART_DWKCOMP_STCOMP_Msk (0xfffful << UART_DWKCOMP_STCOMP_Pos) /*!< UART_T::DWKCOMP: STCOMP Mask */ - -/**@}*/ /* UART_CONST */ -/**@}*/ /* end of UART register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __UART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ui2c_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ui2c_reg.h deleted file mode 100644 index 3cd53dc9e35..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/ui2c_reg.h +++ /dev/null @@ -1,570 +0,0 @@ -/**************************************************************************//** - * @file ui2c_reg.h - * @version V1.00 - * @brief UI2C register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UI2C_REG_H__ -#define __UI2C_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UI2C I2C Mode of USCI Controller (UI2C) - Memory Mapped Structure for UI2C Controller -@{ */ - -typedef struct -{ - - - /** - * @var UI2C_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller. - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI. - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol. - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var UI2C_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK = fDIV_CLK. - * | | |01 = fSAMP_CLK = fPROT_CLK. - * | | |10 = fSAMP_CLK = fSCLK. - * | | |11 = fSAMP_CLK = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter is Disabled. - * | | |1 = Time measurement counter is Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK. - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * @var UI2C_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission. - * | | |The data word is always right-aligned in the data buffer. - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * @var UI2C_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UI2C_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note: In I2C protocol, RXDAT[12:8] indicate the different transmission conditions which defined in I2C. - * @var UI2C_T::DEVADDR0 - * Offset: 0x44 USCI Device Address Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address. - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit. - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note1: The DEVADDR [9:7] must be set 3'b000 when I2C operating in 7-bit address mode. - * | | |Note2: When software set 10'h000, the address can not be used. - * @var UI2C_T::DEVADDR1 - * Offset: 0x48 USCI Device Address Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address. - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit. - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note1: The DEVADDR [9:7] must be set 3'b000 when I2C operating in 7-bit address mode. - * | | |Note2: When software set 10'h000, the address can not be used. - * @var UI2C_T::ADDRMSK0 - * Offset: 0x4C USCI Device Address Mask Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care). - * | | |USCI support multiple address recognition with two address mask register. - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care. - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var UI2C_T::ADDRMSK1 - * Offset: 0x50 USCI Device Address Mask Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care). - * | | |USCI support multiple address recognition with two address mask register. - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care. - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var UI2C_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[1] |WKADDREN |Wake-up Address Match Enable Bit - * | | |0 = The chip is woken up according data toggle. - * | | |1 = The chip is woken up according address match. - * @var UI2C_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1. - * | | |Software can write 1 to clear this bit. - * @var UI2C_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCFUNC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[1] |AA |Assert Acknowledge Control - * | | |When AA =1 prior to address or data received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter. - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line. - * |[2] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C hardware will check the bus condition if a STOP condition is detected this bit will be cleared by hardware automatically. - * | | |In a slave mode, setting STO resets I2C hardware to the defined "not addressed" slave mode when bus error (UI2C_PROTSTS.ERRIF = 1). - * |[3] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[4] |ADDR10EN |Address 10-bit Function Enable Bit - * | | |0 = Address match 10 bit function Disabled. - * | | |1 = Address match 10 bit function Enabled. - * |[5] |PTRG |I2C Protocol Trigger (Write Only) - * | | |When a new state is present in the UI2C_PROTSTS register, if the related interrupt enable bits are set, the I2C interrupt is requested. - * | | |It must write one by software to this bit after the related interrupt flags are set to 1 and the I2C protocol function will go ahead until the STOP is active or the PROTEN is disabled. - * | | |0 = I2C's stretch disabled and the I2C protocol function will go ahead. - * | | |1 = I2C's stretch active. - * |[8] |SCLOUTEN |SCL Output Enable Bit - * | | |This bit enables monitor pulling SCL to low. - * | | |This monitor will pull SCL to low until it has had time to respond to an I2C interrupt. - * | | |0 = SCL output will be forced high due to open drain mechanism. - * | | |1 = I2C module may act as a slave peripheral just like in normal operation, the I2C holds the clock line low until it has had time to clear I2C interrupt. - * |[9] |MONEN |Monitor Mode Enable Bit - * | | |This bit enables monitor mode. - * | | |In monitor mode the SDA output will be put in high impedance mode. - * | | |This prevents the I2C module from outputting data of any kind (including ACK) onto the I2C data bus. - * | | |0 = The monitor mode Disabled. - * | | |1 = The monitor mode Enabled. - * | | |Note: Depending on the state of the SCLOUTEN bit, the SCL output may be also forced high, preventing the module from having control over the I2C clock line. - * |[25:16] |TOCNT |Time-out Clock Cycle - * | | |This bit field indicates how many clock cycle selected by TMCNTSRC (UI2C_BRGEN [5]) when each interrupt flags are clear. - * | | |The time-out is enable when TOCNT bigger than 0. - * | | |Note: The TMCNTSRC (UI2C_BRGEN [5]) must be set zero on I2C mode. - * |[31] |PROTEN |I2C Protocol Enable Bit - * | | |0 = I2C Protocol Disabled. - * | | |1 = I2C Protocol Enabled. - * @var UI2C_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIEN |Time-out Interrupt Enable Bit - * | | |In I2C protocol, this bit enables the interrupt generation in case of a time-out event. - * | | |0 = The time-out interrupt Disabled. - * | | |1 = The time-out interrupt Enabled. - * |[1] |STARIEN |START Condition Received Interrupt Enable Bit - * | | |This bit enables the generation of a protocol interrupt if a START condition is detected. - * | | |0 = The start condition interrupt Disabled. - * | | |1 = The start condition interrupt Enabled. - * |[2] |STORIEN |STOP Condition Received Interrupt Enable Bit - * | | |This bit enables the generation of a protocol interrupt if a STOP condition is detected. - * | | |0 = The stop condition interrupt Disabled. - * | | |1 = The stop condition interrupt Enabled. - * |[3] |NACKIEN |Non - Acknowledge Interrupt Enable Bit - * | | |This bit enables the generation of a protocol interrupt if a Non - acknowledge is detected by a master. - * | | |0 = The non - acknowledge interrupt Disabled. - * | | |1 = The non - acknowledge interrupt Enabled. - * |[4] |ARBLOIEN |Arbitration Lost Interrupt Enable Bit - * | | |This bit enables the generation of a protocol interrupt if an arbitration lost event is detected. - * | | |0 = The arbitration lost interrupt Disabled. - * | | |1 = The arbitration lost interrupt Enabled. - * |[5] |ERRIEN |Error Interrupt Enable Bit - * | | |This bit enables the generation of a protocol interrupt if an I2C error condition is detected (indicated by ERRIF (UI2C_PROTSTS [12])). - * | | |0 = The error interrupt Disabled. - * | | |1 = The error interrupt Enabled. - * |[6] |ACKIEN |Acknowledge Interrupt Enable Bit - * | | |This bit enables the generation of a protocol interrupt if an acknowledge is detected by a master. - * | | |0 = The acknowledge interrupt Disabled. - * | | |1 = The acknowledge interrupt Enabled. - * @var UI2C_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5] |TOIF |Time-out Interrupt Flag - * | | |0 = A time-out interrupt status has not occurred. - * | | |1 = A time-out interrupt status has occurred. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[6] |ONBUSY |On Bus Busy - * | | |Indicates that a communication is in progress on the bus. - * | | |It is set by hardware when a START condition is detected. - * | | |It is cleared by hardware when a STOP condition is detected. - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * |[8] |STARIF |Start Condition Received Interrupt Flag - * | | |This bit indicates that a start condition or repeated start condition has been detected on master mode. - * | | |However, this bit also indicates that a repeated start condition has been detected on slave mode. - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.STARIEN = 1. - * | | |0 = A start condition has not yet been detected. - * | | |1 = A start condition has been detected. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[9] |STORIF |Stop Condition Received Interrupt Flag - * | | |This bit indicates that a stop condition has been detected on the I2C bus lines. - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.STORIEN = 1. - * | | |0 = A stop condition has not yet been detected. - * | | |1 = A stop condition has been detected. - * | | |Note1: It is cleared by software writing 1 into this bit. - * |[10] |NACKIF |Non - Acknowledge Received Interrupt Flag - * | | |This bit indicates that a non - acknowledge has been received in master mode. - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.NACKIEN = 1. - * | | |0 = A non - acknowledge has not been received. - * | | |1 = A non - acknowledge has been received. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[11] |ARBLOIF |Arbitration Lost Interrupt Flag - * | | |This bit indicates that an arbitration has been lost. - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.ARBLOIEN = 1. - * | | |0 = An arbitration has not been lost. - * | | |1 = An arbitration has been lost. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[12] |ERRIF |Error Interrupt Flag - * | | |This bit indicates that a Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame. - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit. - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.ERRIEN = 1. - * | | |0 = An I2C error has not been detected. - * | | |1 = An I2C error has been detected. - * | | |Note1: It is cleared by software writing 1 into this bit. - * | | |Note2: This bit is set for slave mode, and user must write 1 into STO register to the defined "not addressed" slave mode. - * |[13] |ACKIF |Acknowledge Received Interrupt Flag - * | | |This bit indicates that an acknowledge has been received in master mode. - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.ACKIEN = 1. - * | | |0 = An acknowledge has not been received. - * | | |1 = An acknowledge has been received. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[14] |SLASEL |Slave Select Status - * | | |This bit indicates that this device has been selected as slave. - * | | |0 = The device is not selected as slave. - * | | |1 = The device is selected as slave. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[15] |SLAREAD |Slave Read Request Status - * | | |This bit indicates that a slave read request has been detected. - * | | |0 = A slave R/W bit is 1 has not been detected. - * | | |1 = A slave R/W bit is 1 has been detected. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[16] |WKAKDONE |Wake-up Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release when WKUPIF is set. - * |[17] |WRSTSWK |Read/Write Status Bit in Address Wake-up Frame - * | | |0 = Write command be record on the address match wake-up frame. - * | | |1 = Read command be record on the address match wake-up frame. - * |[18] |BUSHANG |Bus Hang-up - * | | |This bit indicates bus hang-up status. - * | | |There is 4-bit counter count when SCL hold high and refer fSAMP_CLK. - * | | |The hang-up counter will count to overflow and set this bit when SDA is low. - * | | |The counter will be reset by falling edge of SCL signal. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is hang-up status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * |[19] |ERRARBLO |Error Arbitration Lost - * | | |This bit indicates bus arbitration lost due to bigger noise which is can't be filtered by input processor. - * | | |The I2C can send start condition when ERRARBLO is set. - * | | |Thus this bit doesn't be cared on slave mode. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is error arbitration lost status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * @var UI2C_T::ADMAT - * Offset: 0x88 I2C Slave Match Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADMAT0 |USCI Address 0 Match Status Register - * | | |When address 0 is matched, hardware will inform which address used. - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[1] |ADMAT1 |USCI Address 1 Match Status Register - * | | |When address 1 is matched, hardware will inform which address used. - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * @var UI2C_T::TMCTL - * Offset: 0x8C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control - * | | |This field is used to generate a delay timing between SDA edge and SCL rising edge in transmission mode. - * | | |The delay setup time is numbers of peripheral clock = STCTL x fPCLK. - * |[24:16] |HTCTL |Hold Time Configure Control - * | | |This field is used to generate the delay timing between SCL falling edge SDA edge in - * | | |transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x fPCLK. - * | | |Note: Hold time adjust function can only work in master mode, when slave mode, this field should set as 0. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - __I uint32_t RESERVE1[8]; - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __I uint32_t RESERVE2[3]; - __IO uint32_t DEVADDR0; /*!< [0x0044] USCI Device Address Register 0 */ - __IO uint32_t DEVADDR1; /*!< [0x0048] USCI Device Address Register 1 */ - __IO uint32_t ADDRMSK0; /*!< [0x004c] USCI Device Address Mask Register 0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0050] USCI Device Address Mask Register 1 */ - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - __I uint32_t RESERVE3[8]; - __IO uint32_t ADMAT; /*!< [0x0088] I2C Slave Match Address Register */ - __IO uint32_t TMCTL; /*!< [0x008c] I2C Timing Configure Control Register */ - -} UI2C_T; - -/** - @addtogroup UI2C_CONST UI2C Bit Field Definition - Constant Definitions for UI2C Controller -@{ */ - -#define UI2C_CTL_FUNMODE_Pos (0) /*!< UI2C_T::CTL: FUNMODE Position */ -#define UI2C_CTL_FUNMODE_Msk (0x7ul << UI2C_CTL_FUNMODE_Pos) /*!< UI2C_T::CTL: FUNMODE Mask */ - -#define UI2C_BRGEN_RCLKSEL_Pos (0) /*!< UI2C_T::BRGEN: RCLKSEL Position */ -#define UI2C_BRGEN_RCLKSEL_Msk (0x1ul << UI2C_BRGEN_RCLKSEL_Pos) /*!< UI2C_T::BRGEN: RCLKSEL Mask */ - -#define UI2C_BRGEN_PTCLKSEL_Pos (1) /*!< UI2C_T::BRGEN: PTCLKSEL Position */ -#define UI2C_BRGEN_PTCLKSEL_Msk (0x1ul << UI2C_BRGEN_PTCLKSEL_Pos) /*!< UI2C_T::BRGEN: PTCLKSEL Mask */ - -#define UI2C_BRGEN_SPCLKSEL_Pos (2) /*!< UI2C_T::BRGEN: SPCLKSEL Position */ -#define UI2C_BRGEN_SPCLKSEL_Msk (0x3ul << UI2C_BRGEN_SPCLKSEL_Pos) /*!< UI2C_T::BRGEN: SPCLKSEL Mask */ - -#define UI2C_BRGEN_TMCNTEN_Pos (4) /*!< UI2C_T::BRGEN: TMCNTEN Position */ -#define UI2C_BRGEN_TMCNTEN_Msk (0x1ul << UI2C_BRGEN_TMCNTEN_Pos) /*!< UI2C_T::BRGEN: TMCNTEN Mask */ - -#define UI2C_BRGEN_TMCNTSRC_Pos (5) /*!< UI2C_T::BRGEN: TMCNTSRC Position */ -#define UI2C_BRGEN_TMCNTSRC_Msk (0x1ul << UI2C_BRGEN_TMCNTSRC_Pos) /*!< UI2C_T::BRGEN: TMCNTSRC Mask */ - -#define UI2C_BRGEN_PDSCNT_Pos (8) /*!< UI2C_T::BRGEN: PDSCNT Position */ -#define UI2C_BRGEN_PDSCNT_Msk (0x3ul << UI2C_BRGEN_PDSCNT_Pos) /*!< UI2C_T::BRGEN: PDSCNT Mask */ - -#define UI2C_BRGEN_DSCNT_Pos (10) /*!< UI2C_T::BRGEN: DSCNT Position */ -#define UI2C_BRGEN_DSCNT_Msk (0x1ful << UI2C_BRGEN_DSCNT_Pos) /*!< UI2C_T::BRGEN: DSCNT Mask */ - -#define UI2C_BRGEN_CLKDIV_Pos (16) /*!< UI2C_T::BRGEN: CLKDIV Position */ -#define UI2C_BRGEN_CLKDIV_Msk (0x3fful << UI2C_BRGEN_CLKDIV_Pos) /*!< UI2C_T::BRGEN: CLKDIV Mask */ - -#define UI2C_LINECTL_LSB_Pos (0) /*!< UI2C_T::LINECTL: LSB Position */ -#define UI2C_LINECTL_LSB_Msk (0x1ul << UI2C_LINECTL_LSB_Pos) /*!< UI2C_T::LINECTL: LSB Mask */ - -#define UI2C_LINECTL_DWIDTH_Pos (8) /*!< UI2C_T::LINECTL: DWIDTH Position */ -#define UI2C_LINECTL_DWIDTH_Msk (0xful << UI2C_LINECTL_DWIDTH_Pos) /*!< UI2C_T::LINECTL: DWIDTH Mask */ - -#define UI2C_TXDAT_TXDAT_Pos (0) /*!< UI2C_T::TXDAT: TXDAT Position */ -#define UI2C_TXDAT_TXDAT_Msk (0xfffful << UI2C_TXDAT_TXDAT_Pos) /*!< UI2C_T::TXDAT: TXDAT Mask */ - -#define UI2C_RXDAT_RXDAT_Pos (0) /*!< UI2C_T::RXDAT: RXDAT Position */ -#define UI2C_RXDAT_RXDAT_Msk (0xfffful << UI2C_RXDAT_RXDAT_Pos) /*!< UI2C_T::RXDAT: RXDAT Mask */ - -#define UI2C_DEVADDR0_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR0: DEVADDR Position */ -#define UI2C_DEVADDR0_DEVADDR_Msk (0x3fful << UI2C_DEVADDR0_DEVADDR_Pos) /*!< UI2C_T::DEVADDR0: DEVADDR Mask */ - -#define UI2C_DEVADDR1_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR1: DEVADDR Position */ -#define UI2C_DEVADDR1_DEVADDR_Msk (0x3fful << UI2C_DEVADDR1_DEVADDR_Pos) /*!< UI2C_T::DEVADDR1: DEVADDR Mask */ - -#define UI2C_ADDRMSK0_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK0: ADDRMSK Position */ -#define UI2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK0_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define UI2C_ADDRMSK1_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK1: ADDRMSK Position */ -#define UI2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK1_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define UI2C_WKCTL_WKEN_Pos (0) /*!< UI2C_T::WKCTL: WKEN Position */ -#define UI2C_WKCTL_WKEN_Msk (0x1ul << UI2C_WKCTL_WKEN_Pos) /*!< UI2C_T::WKCTL: WKEN Mask */ - -#define UI2C_WKCTL_WKADDREN_Pos (1) /*!< UI2C_T::WKCTL: WKADDREN Position */ -#define UI2C_WKCTL_WKADDREN_Msk (0x1ul << UI2C_WKCTL_WKADDREN_Pos) /*!< UI2C_T::WKCTL: WKADDREN Mask */ - -#define UI2C_WKSTS_WKF_Pos (0) /*!< UI2C_T::WKSTS: WKF Position */ -#define UI2C_WKSTS_WKF_Msk (0x1ul << UI2C_WKSTS_WKF_Pos) /*!< UI2C_T::WKSTS: WKF Mask */ - -#define UI2C_PROTCTL_GCFUNC_Pos (0) /*!< UI2C_T::PROTCTL: GCFUNC Position */ -#define UI2C_PROTCTL_GCFUNC_Msk (0x1ul << UI2C_PROTCTL_GCFUNC_Pos) /*!< UI2C_T::PROTCTL: GCFUNC Mask */ - -#define UI2C_PROTCTL_AA_Pos (1) /*!< UI2C_T::PROTCTL: AA Position */ -#define UI2C_PROTCTL_AA_Msk (0x1ul << UI2C_PROTCTL_AA_Pos) /*!< UI2C_T::PROTCTL: AA Mask */ - -#define UI2C_PROTCTL_STO_Pos (2) /*!< UI2C_T::PROTCTL: STO Position */ -#define UI2C_PROTCTL_STO_Msk (0x1ul << UI2C_PROTCTL_STO_Pos) /*!< UI2C_T::PROTCTL: STO Mask */ - -#define UI2C_PROTCTL_STA_Pos (3) /*!< UI2C_T::PROTCTL: STA Position */ -#define UI2C_PROTCTL_STA_Msk (0x1ul << UI2C_PROTCTL_STA_Pos) /*!< UI2C_T::PROTCTL: STA Mask */ - -#define UI2C_PROTCTL_ADDR10EN_Pos (4) /*!< UI2C_T::PROTCTL: ADDR10EN Position */ -#define UI2C_PROTCTL_ADDR10EN_Msk (0x1ul << UI2C_PROTCTL_ADDR10EN_Pos) /*!< UI2C_T::PROTCTL: ADDR10EN Mask */ - -#define UI2C_PROTCTL_PTRG_Pos (5) /*!< UI2C_T::PROTCTL: PTRG Position */ -#define UI2C_PROTCTL_PTRG_Msk (0x1ul << UI2C_PROTCTL_PTRG_Pos) /*!< UI2C_T::PROTCTL: PTRG Mask */ - -#define UI2C_PROTCTL_SCLOUTEN_Pos (8) /*!< UI2C_T::PROTCTL: SCLOUTEN Position */ -#define UI2C_PROTCTL_SCLOUTEN_Msk (0x1ul << UI2C_PROTCTL_SCLOUTEN_Pos) /*!< UI2C_T::PROTCTL: SCLOUTEN Mask */ - -#define UI2C_PROTCTL_MONEN_Pos (9) /*!< UI2C_T::PROTCTL: MONEN Position */ -#define UI2C_PROTCTL_MONEN_Msk (0x1ul << UI2C_PROTCTL_MONEN_Pos) /*!< UI2C_T::PROTCTL: MONEN Mask */ - -#define UI2C_PROTCTL_TOCNT_Pos (16) /*!< UI2C_T::PROTCTL: TOCNT Position */ -#define UI2C_PROTCTL_TOCNT_Msk (0x3fful << UI2C_PROTCTL_TOCNT_Pos) /*!< UI2C_T::PROTCTL: TOCNT Mask */ - -#define UI2C_PROTCTL_PROTEN_Pos (31) /*!< UI2C_T::PROTCTL: PROTEN Position */ -#define UI2C_PROTCTL_PROTEN_Msk (0x1ul << UI2C_PROTCTL_PROTEN_Pos) /*!< UI2C_T::PROTCTL: PROTEN Mask */ - -#define UI2C_PROTIEN_TOIEN_Pos (0) /*!< UI2C_T::PROTIEN: TOIEN Position */ -#define UI2C_PROTIEN_TOIEN_Msk (0x1ul << UI2C_PROTIEN_TOIEN_Pos) /*!< UI2C_T::PROTIEN: TOIEN Mask */ - -#define UI2C_PROTIEN_STARIEN_Pos (1) /*!< UI2C_T::PROTIEN: STARIEN Position */ -#define UI2C_PROTIEN_STARIEN_Msk (0x1ul << UI2C_PROTIEN_STARIEN_Pos) /*!< UI2C_T::PROTIEN: STARIEN Mask */ - -#define UI2C_PROTIEN_STORIEN_Pos (2) /*!< UI2C_T::PROTIEN: STORIEN Position */ -#define UI2C_PROTIEN_STORIEN_Msk (0x1ul << UI2C_PROTIEN_STORIEN_Pos) /*!< UI2C_T::PROTIEN: STORIEN Mask */ - -#define UI2C_PROTIEN_NACKIEN_Pos (3) /*!< UI2C_T::PROTIEN: NACKIEN Position */ -#define UI2C_PROTIEN_NACKIEN_Msk (0x1ul << UI2C_PROTIEN_NACKIEN_Pos) /*!< UI2C_T::PROTIEN: NACKIEN Mask */ - -#define UI2C_PROTIEN_ARBLOIEN_Pos (4) /*!< UI2C_T::PROTIEN: ARBLOIEN Position */ -#define UI2C_PROTIEN_ARBLOIEN_Msk (0x1ul << UI2C_PROTIEN_ARBLOIEN_Pos) /*!< UI2C_T::PROTIEN: ARBLOIEN Mask */ - -#define UI2C_PROTIEN_ERRIEN_Pos (5) /*!< UI2C_T::PROTIEN: ERRIEN Position */ -#define UI2C_PROTIEN_ERRIEN_Msk (0x1ul << UI2C_PROTIEN_ERRIEN_Pos) /*!< UI2C_T::PROTIEN: ERRIEN Mask */ - -#define UI2C_PROTIEN_ACKIEN_Pos (6) /*!< UI2C_T::PROTIEN: ACKIEN Position */ -#define UI2C_PROTIEN_ACKIEN_Msk (0x1ul << UI2C_PROTIEN_ACKIEN_Pos) /*!< UI2C_T::PROTIEN: ACKIEN Mask */ - -#define UI2C_PROTSTS_TOIF_Pos (5) /*!< UI2C_T::PROTSTS: TOIF Position */ -#define UI2C_PROTSTS_TOIF_Msk (0x1ul << UI2C_PROTSTS_TOIF_Pos) /*!< UI2C_T::PROTSTS: TOIF Mask */ - -#define UI2C_PROTSTS_ONBUSY_Pos (6) /*!< UI2C_T::PROTSTS: ONBUSY Position */ -#define UI2C_PROTSTS_ONBUSY_Msk (0x1ul << UI2C_PROTSTS_ONBUSY_Pos) /*!< UI2C_T::PROTSTS: ONBUSY Mask */ - -#define UI2C_PROTSTS_STARIF_Pos (8) /*!< UI2C_T::PROTSTS: STARIF Position */ -#define UI2C_PROTSTS_STARIF_Msk (0x1ul << UI2C_PROTSTS_STARIF_Pos) /*!< UI2C_T::PROTSTS: STARIF Mask */ - -#define UI2C_PROTSTS_STORIF_Pos (9) /*!< UI2C_T::PROTSTS: STORIF Position */ -#define UI2C_PROTSTS_STORIF_Msk (0x1ul << UI2C_PROTSTS_STORIF_Pos) /*!< UI2C_T::PROTSTS: STORIF Mask */ - -#define UI2C_PROTSTS_NACKIF_Pos (10) /*!< UI2C_T::PROTSTS: NACKIF Position */ -#define UI2C_PROTSTS_NACKIF_Msk (0x1ul << UI2C_PROTSTS_NACKIF_Pos) /*!< UI2C_T::PROTSTS: NACKIF Mask */ - -#define UI2C_PROTSTS_ARBLOIF_Pos (11) /*!< UI2C_T::PROTSTS: ARBLOIF Position */ -#define UI2C_PROTSTS_ARBLOIF_Msk (0x1ul << UI2C_PROTSTS_ARBLOIF_Pos) /*!< UI2C_T::PROTSTS: ARBLOIF Mask */ - -#define UI2C_PROTSTS_ERRIF_Pos (12) /*!< UI2C_T::PROTSTS: ERRIF Position */ -#define UI2C_PROTSTS_ERRIF_Msk (0x1ul << UI2C_PROTSTS_ERRIF_Pos) /*!< UI2C_T::PROTSTS: ERRIF Mask */ - -#define UI2C_PROTSTS_ACKIF_Pos (13) /*!< UI2C_T::PROTSTS: ACKIF Position */ -#define UI2C_PROTSTS_ACKIF_Msk (0x1ul << UI2C_PROTSTS_ACKIF_Pos) /*!< UI2C_T::PROTSTS: ACKIF Mask */ - -#define UI2C_PROTSTS_SLASEL_Pos (14) /*!< UI2C_T::PROTSTS: SLASEL Position */ -#define UI2C_PROTSTS_SLASEL_Msk (0x1ul << UI2C_PROTSTS_SLASEL_Pos) /*!< UI2C_T::PROTSTS: SLASEL Mask */ - -#define UI2C_PROTSTS_SLAREAD_Pos (15) /*!< UI2C_T::PROTSTS: SLAREAD Position */ -#define UI2C_PROTSTS_SLAREAD_Msk (0x1ul << UI2C_PROTSTS_SLAREAD_Pos) /*!< UI2C_T::PROTSTS: SLAREAD Mask */ - -#define UI2C_PROTSTS_WKAKDONE_Pos (16) /*!< UI2C_T::PROTSTS: WKAKDONE Position */ -#define UI2C_PROTSTS_WKAKDONE_Msk (0x1ul << UI2C_PROTSTS_WKAKDONE_Pos) /*!< UI2C_T::PROTSTS: WKAKDONE Mask */ - -#define UI2C_PROTSTS_WRSTSWK_Pos (17) /*!< UI2C_T::PROTSTS: WRSTSWK Position */ -#define UI2C_PROTSTS_WRSTSWK_Msk (0x1ul << UI2C_PROTSTS_WRSTSWK_Pos) /*!< UI2C_T::PROTSTS: WRSTSWK Mask */ - -#define UI2C_PROTSTS_BUSHANG_Pos (18) /*!< UI2C_T::PROTSTS: BUSHANG Position */ -#define UI2C_PROTSTS_BUSHANG_Msk (0x1ul << UI2C_PROTSTS_BUSHANG_Pos) /*!< UI2C_T::PROTSTS: BUSHANG Mask */ - -#define UI2C_PROTSTS_ERRARBLO_Pos (19) /*!< UI2C_T::PROTSTS: ERRARBLO Position */ -#define UI2C_PROTSTS_ERRARBLO_Msk (0x1ul << UI2C_PROTSTS_ERRARBLO_Pos) /*!< UI2C_T::PROTSTS: ERRARBLO Mask */ - -#define UI2C_ADMAT_ADMAT0_Pos (0) /*!< UI2C_T::ADMAT: ADMAT0 Position */ -#define UI2C_ADMAT_ADMAT0_Msk (0x1ul << UI2C_ADMAT_ADMAT0_Pos) /*!< UI2C_T::ADMAT: ADMAT0 Mask */ - -#define UI2C_ADMAT_ADMAT1_Pos (1) /*!< UI2C_T::ADMAT: ADMAT1 Position */ -#define UI2C_ADMAT_ADMAT1_Msk (0x1ul << UI2C_ADMAT_ADMAT1_Pos) /*!< UI2C_T::ADMAT: ADMAT1 Mask */ - -#define UI2C_TMCTL_STCTL_Pos (0) /*!< UI2C_T::TMCTL: STCTL Position */ -#define UI2C_TMCTL_STCTL_Msk (0x1fful << UI2C_TMCTL_STCTL_Pos) /*!< UI2C_T::TMCTL: STCTL Mask */ - -#define UI2C_TMCTL_HTCTL_Pos (16) /*!< UI2C_T::TMCTL: HTCTL Position */ -#define UI2C_TMCTL_HTCTL_Msk (0x1fful << UI2C_TMCTL_HTCTL_Pos) /*!< UI2C_T::TMCTL: HTCTL Mask */ - -/**@}*/ /* UI2C_CONST */ -/**@}*/ /* end of UI2C register group */ - - -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __UI2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/usbd_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/usbd_reg.h deleted file mode 100644 index b9d80f392e0..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/usbd_reg.h +++ /dev/null @@ -1,570 +0,0 @@ -/**************************************************************************//** - * @file usbd_reg.h - * @version V1.00 - * @brief USBD register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBD_REG_H__ -#define __USBD_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USBD USB Device Controller(USBD) - Memory Mapped Structure for USBD Controller -@{ */ - - - -typedef struct -{ - - /** - * @var USBD_EP_T::BUFSEG - * Offset: 0x500/0x510/0x520/0x530/0x540/0x550/0x560/0x570 Endpoint Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |BUFSEG |Endpoint Buffer Segmentation - * | | |It is used to indicate the offset address for each endpoint with the USB SRAM starting address The effective starting address of the endpoint is - * | | |USBD_SRAM address + { BUFSEG[8:3], 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Refer to the section 6.17.5.76.21.5.7 for the endpoint SRAM structure and its description. - * @var USBD_EP_T::MXPLD - * Offset: 0x504/0x514/0x524/0x534/0x544/0x554/0x564/0x574 Endpoint Maximal Payload Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |MXPLD |Maximal Payload - * | | |Define the data length which is transmitted to host (IN token) or the actual data length which is received from the host (OUT token) - * | | |It also used to indicate that the endpoint is ready to be transmitted in IN token or received in OUT token. - * | | |(1) When the register is written by CPU, - * | | |For IN token, the value of MXPLD is used to define the data length to be transmitted and indicate the data buffer is ready. - * | | |For OUT token, it means that the controller is ready to receive data from the host and the value of MXPLD is the maximal data length comes from host. - * | | |(2) When the register is read by CPU, - * | | |For IN token, the value of MXPLD is indicated by the data length be transmitted to host - * | | |For OUT token, the value of MXPLD is indicated the actual data length receiving from host. - * | | |Note: Once MXPLD is written, the data packets will be transmitted/received immediately after IN/OUT token arrived. - * @var USBD_EP_T::CFG - * Offset: 0x508/0x518/0x528/0x538/0x548/0x558/0x568/0x578 Endpoint Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNUM |Endpoint Number - * | | |These bits are used to define the endpoint number of the current endpoint. - * |[4] |ISOCH |Isochronous Endpoint - * | | |This bit is used to set the endpoint as Isochronous endpoint, no handshake. - * | | |0 = No Isochronous endpoint. - * | | |1 = Isochronous endpoint. - * |[6:5] |STATE |Endpoint STATE - * | | |00 = Endpoint is Disabled. - * | | |01 = Out endpoint. - * | | |10 = IN endpoint. - * | | |11 = Undefined. - * |[7] |DSQSYNC |Data Sequence Synchronization - * | | |0 = DATA0 PID. - * | | |1 = DATA1 PID. - * | | |Note: It is used to specify the DATA0 or DATA1 PID in the following IN token transaction. - * | | |Hardware will toggle automatically in IN token base on the bit. - * |[9] |CSTALL |Clear STALL Response - * | | |0 = Disable the device to clear the STALL handshake in setup stage. - * | | |1 = Clear the device to response STALL handshake in setup stage. - * @var USBD_EP_T::CFGP - * Offset: 0x50C/0x51C/0x52C/0x53C/0x54C/0x55C/0x56C/0x57C Endpoint Set Stall and Clear In/Out Ready Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CLRRDY |Clear Ready - * | | |When the USBD_MXPLDx register is set by user, it means that the endpoint is ready to transmit or receive data. - * | | |If the user wants to disable this transaction before the transaction start, users can set this bit to 1 to disable it and it is auto clear to 0. - * | | |For IN token, write '1' to clear the IN token had ready to transmit the data to USB. - * | | |For OUT token, write '1' to clear the OUT token had ready to receive the data from USB. - * | | |This bit is write 1 only and is always 0 when it is read back. - * |[1] |SSTALL |Set STALL - * | | |0 = Disable the device to response STALL. - * | | |1 = Set the device to respond STALL automatically. - */ - __IO uint32_t BUFSEG; /*!< [0x0000] Endpoint Buffer Segmentation Register */ - __IO uint32_t MXPLD; /*!< [0x0004] Endpoint Maximal Payload Register */ - __IO uint32_t CFG; /*!< [0x0008] Endpoint Configuration Register */ - __IO uint32_t CFGP; /*!< [0x000c] Endpoint Set Stall and Clear In/Out Ready Control Register */ - -} USBD_EP_T; - -typedef struct -{ - /** - * @var USBD_T::INTEN - * Offset: 0x00 USB Device Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIEN |Bus Event Interrupt Enable Bit - * | | |0 = BUS event interrupt Disabled. - * | | |1 = BUS event interrupt Enabled. - * |[1] |USBIEN |USB Event Interrupt Enable Bit - * | | |0 = USB event interrupt Disabled. - * | | |1 = USB event interrupt Enabled. - * |[2] |VBDETIEN |VBUS Detection Interrupt Enable Bit - * | | |0 = VBUS detection Interrupt Disabled. - * | | |1 = VBUS detection Interrupt Enabled. - * |[3] |NEVWKIEN |USB No-event-wake-up Interrupt Enable Bit - * | | |0 = No-event-wake-up Interrupt Disabled. - * | | |1 = No-event-wake-up Interrupt Enabled. - * |[4] |SOFIEN |Start of Frame Interrupt Enable Bit - * | | |0 = SOF Interrupt Disabled. - * | | |1 = SOF Interrupt Enabled. - * |[8] |WKEN |Wake-up Function Enable Bit - * | | |0 = USB wake-up function Disabled. - * | | |1 = USB wake-up function Enabled. - * |[15] |INNAKEN |Active NAK Function and Its Status in IN Token - * | | |0 = When device responds NAK after receiving IN token, IN NAK status will not be updated to USBD_EPSTS0 register, so that the USB interrupt event will not be asserted. - * | | |1 = IN NAK status will be updated to USBD_EPSTS0 register and the USB interrupt event will be asserted, when the device responds NAK after receiving IN token. - * @var USBD_T::INTSTS - * Offset: 0x04 USB Device Interrupt Event Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIF |BUS Interrupt Status - * | | |The BUS event means that there is one of the suspense or the resume function in the bus. - * | | |0 = No BUS event occurred. - * | | |1 = Bus event occurred; check USBD_ATTR[3:0] to know which kind of bus event was occurred, cleared by write 1 to USBD_INTSTS[0]. - * |[1] |USBIF |USB Event Interrupt Status - * | | |The USB event includes the SETUP Token, IN Token, OUT ACK, ISO IN, or ISO OUT events in the bus. - * | | |0 = No USB event occurred. - * | | |1 = USB event occurred, check EPSTS0~5[2:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[1] or EPSTS0~11 and SETUP (USBD_INTSTS[31]). - * |[2] |VBDETIF |VBUS Detection Interrupt Status - * | | |0 = There is not attached/detached event in the USB. - * | | |1 = There is attached/detached event in the USB bus and it is cleared by write 1 to USBD_INTSTS[2]. - * |[3] |NEVWKIF |No-event-wake-up Interrupt Status - * | | |0 = NEVWK event does not occur. - * | | |1 = No-event-wake-up event occurred, cleared by write 1 to USBD_INTSTS[3]. - * |[4] |SOFIF |Start of Frame Interrupt Status - * | | |0 = SOF event does not occur. - * | | |1 = SOF event occurred, cleared by write 1 to USBD_INTSTS[4]. - * |[16] |EPEVT0 |Endpoint 0's USB Event Status - * | | |0 = No event occurred in endpoint 0. - * | | |1 = USB event occurred on Endpoint 0, check USBD_EPSTS0[3:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[16] or USBD_INTSTS[1]. - * |[17] |EPEVT1 |Endpoint 1's USB Event Status - * | | |0 = No event occurred in endpoint 1. - * | | |1 = USB event occurred on Endpoint 1, check USBD_EPSTS0[7:4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[17] or USBD_INTSTS[1]. - * |[18] |EPEVT2 |Endpoint 2's USB Event Status - * | | |0 = No event occurred in endpoint 2. - * | | |1 = USB event occurred on Endpoint 2, check USBD_EPSTS0[11:8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[18] or USBD_INTSTS[1]. - * |[19] |EPEVT3 |Endpoint 3's USB Event Status - * | | |0 = No event occurred in endpoint 3. - * | | |1 = USB event occurred on Endpoint 3, check USBD_EPSTS0[15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[19] or USBD_INTSTS[1]. - * |[20] |EPEVT4 |Endpoint 4's USB Event Status - * | | |0 = No event occurred in endpoint 4. - * | | |1 = USB event occurred on Endpoint 4, check USBD_EPSTS0[19:16] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[20] or USBD_INTSTS[1]. - * |[21] |EPEVT5 |Endpoint 5's USB Event Status - * | | |0 = No event occurred in endpoint 5. - * | | |1 = USB event occurred on Endpoint 5, check USBD_EPSTS0[23:20] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[21] or USBD_INTSTS[1]. - * |[22] |EPEVT6 |Endpoint 6's USB Event Status - * | | |0 = No event occurred in endpoint 6. - * | | |1 = USB event occurred on Endpoint 6, check USBD_EPSTS0[27:24] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[22] or USBD_INTSTS[1]. - * |[23] |EPEVT7 |Endpoint 7's USB Event Status - * | | |0 = No event occurred in endpoint 7. - * | | |1 = USB event occurred on Endpoint 7, check USBD_EPSTS0[31:28] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[23] or USBD_INTSTS[1]. - * |[31] |SETUP |Setup Event Status - * | | |0 = No Setup event. - * | | |1 = Setup event occurred, cleared by write 1 to USBD_INTSTS[31]. - * @var USBD_T::FADDR - * Offset: 0x08 USB Device Function Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |FADDR |USB Device Function Address - * @var USBD_T::EPSTS - * Offset: 0x0C USB Device Endpoint Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |OV |Overrun - * | | |It indicates that the received data is over the maximum payload number or not. - * | | |if received data is over the maximum payload number, the extra data will be ignored. - * | | |0 = No overrun. - * | | |1 = Out Data is more than the Max Payload in MXPLD register or the Setup Data is more than 8 Bytes. - * @var USBD_T::ATTR - * Offset: 0x10 USB Device Bus Status and Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBRST |USB Reset Status (Read Only) - * | | |0 = Bus no reset. - * | | |1 = Bus reset when SE0 (single-ended 0) more than 2.5us. - * |[1] |SUSPEND |Suspend Status (Read Only) - * | | |0 = Bus no suspend. - * | | |1 = Bus idle more than 3ms, either cable is plugged off or host is sleeping. - * |[2] |RESUME |Resume Status (Read Only) - * | | |0 = No bus resume. - * | | |1 = Resume from suspend. - * |[3] |TOUT |Time-out Status (Read Only) - * | | |When USB Device controller after received setup token or out token, USB controller stay J state to wait data package. - * | | |If the waiting time exceeds 18-bit length timing, TOUT flag will be generated. - * | | |0 = No time-out. - * | | |1 = No Bus response more than 18 bits time. - * |[4] |PHYEN |PHY Transceiver Function Enable Bit - * | | |0 = PHY transceiver function Disabled. - * | | |1 = PHY transceiver function Enabled. - * |[5] |RWAKEUP |Remote Wake-up - * | | |0 = Release the USB bus from K state. - * | | |1 = Force USB bus to K (USB_D+ low, USB_D-: high) state, used for remote wake-up. - * |[7] |USBEN |USB Controller Enable Bit - * | | |0 = USB Controller Disabled. - * | | |1 = USB Controller Enabled. - * |[8] |DPPUEN |Pull-up Resistor on USB_DP Enable Bit - * | | |0 = Pull-up resistor in USB_D+ bus Disabled. - * | | |1 = Pull-up resistor in USB_D+ bus Active. - * |[10] |BYTEM |CPU Access USB SRAM Size Mode Selection - * | | |0 = Word mode: The size of the transfer from CPU to USB SRAM can be Word only. - * | | |1 = Byte mode: The size of the transfer from CPU to USB SRAM can be Byte only. - * |[11] |LPMACK |LPM Token Acknowledge Enable Bit - * | | |The NYET/ACK will be returned only on a successful LPM transaction if no errors in both the EXT token and the LPM token and a valid bLinkState = 0001 (L1) is received, else ERROR and STALL will be returned automatically, respectively. - * | | |0= the valid LPM Token will be NYET. - * | | |1= the valid LPM Token will be ACK. - * |[12] |L1SUSPEND |LPM L1 Suspend (Read Only) - * | | |0 = Bus no L1 state suspend. - * | | |1 = This bit is set by the hardware when LPM command to enter the L1 state is successfully received and acknowledged. - * |[13] |L1RESUME |LPM L1 Resume (Read Only) - * | | |0 = Bus no LPM L1 state resume. - * | | |1 = LPM L1 state Resume from LPM L1 state suspend. - * @var USBD_T::VBUSDET - * Offset: 0x14 USB Device VBUS Detection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDET |Device VBUS Detection - * | | |0 = Controller is not attached to the USB host. - * | | |1 = Controller is attached to the USB host. - * @var USBD_T::STBUFSEG - * Offset: 0x18 SETUP Token Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |STBUFSEG |SETUP Token Buffer Segmentation - * | | |It is used to indicate the offset address for the SETUP token with the USB Device SRAM starting address The effective starting address is - * | | |USBD_SRAM address + {STBUFSEG, 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Note: It is used for SETUP token only. - * @var USBD_T::EPSTS0 - * Offset: 0x20 USB Device Endpoint Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPSTS0 |Endpoint 0 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[7:4] |EPSTS1 |Endpoint 1 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[11:8] |EPSTS2 |Endpoint 2 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[15:12] |EPSTS3 |Endpoint 3 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[19:16] |EPSTS4 |Endpoint 4 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[23:20] |EPSTS5 |Endpoint 5 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[27:24] |EPSTS6 |Endpoint 6 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[31:28] |EPSTS7 |Endpoint 7 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * @var USBD_T::LPMATTR - * Offset: 0x88 USB LPM Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |LPMLINKSTS|LPM Link State - * | | |These bits contain the bLinkState received with last ACK LPM Token. - * |[7:4] |LPMBESL |LPM Best Effort Service Latency - * | | |These bits contain the BESL value received with last ACK LPM Token. - * |[8] |LPMRWAKUP |LPM Remote Wakeup - * | | |This bit contains the bRemoteWake value received with last ACK LPM Token. - * @var USBD_T::FN - * Offset: 0x8C USB Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FN |Frame Number - * | | |These bits contain the 11-bits frame number in the last received SOF packet. - * @var USBD_T::SE0 - * Offset: 0x90 USB Device Drive SE0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SE0 |Drive Single Ended Zero in USB Bus - * | | |The Single Ended Zero (SE0) is when both lines (USB_D+ and USB_D-) are being pulled low. - * | | |0 = Normal operation. - * | | |1 = Force USB PHY transceiver to drive SE0. - */ - __IO uint32_t INTEN; /*!< [0x0000] USB Device Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0004] USB Device Interrupt Event Status Register */ - __IO uint32_t FADDR; /*!< [0x0008] USB Device Function Address Register */ - __I uint32_t EPSTS; /*!< [0x000c] USB Device Endpoint Status Register */ - __IO uint32_t ATTR; /*!< [0x0010] USB Device Bus Status and Attribution Register */ - __I uint32_t VBUSDET; /*!< [0x0014] USB Device VBUS Detection Register */ - __IO uint32_t STBUFSEG; /*!< [0x0018] SETUP Token Buffer Segmentation Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t EPSTS0; /*!< [0x0020] USB Device Endpoint Status Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[25]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t LPMATTR; /*!< [0x0088] USB LPM Attribution Register */ - __I uint32_t FN; /*!< [0x008c] USB Frame number Register */ - __IO uint32_t SE0; /*!< [0x0090] USB Device Drive SE0 Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[283]; - /// @endcond //HIDDEN_SYMBOLS - USBD_EP_T EP[8]; /*!< [0x0500~0x5BC] USB Device Endpoints(0~7) */ - -} USBD_T; - -/** - @addtogroup USBD_CONST USBD Bit Field Definition - Constant Definitions for USBD Controller -@{ */ - -#define USBD_INTEN_BUSIEN_Pos (0) /*!< USBD_T::INTEN: BUSIEN Position */ -#define USBD_INTEN_BUSIEN_Msk (0x1ul << USBD_INTEN_BUSIEN_Pos) /*!< USBD_T::INTEN: BUSIEN Mask */ - -#define USBD_INTEN_USBIEN_Pos (1) /*!< USBD_T::INTEN: USBIEN Position */ -#define USBD_INTEN_USBIEN_Msk (0x1ul << USBD_INTEN_USBIEN_Pos) /*!< USBD_T::INTEN: USBIEN Mask */ - -#define USBD_INTEN_VBDETIEN_Pos (2) /*!< USBD_T::INTEN: VBDETIEN Position */ -#define USBD_INTEN_VBDETIEN_Msk (0x1ul << USBD_INTEN_VBDETIEN_Pos) /*!< USBD_T::INTEN: VBDETIEN Mask */ - -#define USBD_INTEN_NEVWKIEN_Pos (3) /*!< USBD_T::INTEN: NEVWKIEN Position */ -#define USBD_INTEN_NEVWKIEN_Msk (0x1ul << USBD_INTEN_NEVWKIEN_Pos) /*!< USBD_T::INTEN: NEVWKIEN Mask */ - -#define USBD_INTEN_SOFIEN_Pos (4) /*!< USBD_T::INTEN: SOFIEN Position */ -#define USBD_INTEN_SOFIEN_Msk (0x1ul << USBD_INTEN_SOFIEN_Pos) /*!< USBD_T::INTEN: SOFIEN Mask */ - -#define USBD_INTEN_WKEN_Pos (8) /*!< USBD_T::INTEN: WKEN Position */ -#define USBD_INTEN_WKEN_Msk (0x1ul << USBD_INTEN_WKEN_Pos) /*!< USBD_T::INTEN: WKEN Mask */ - -#define USBD_INTEN_INNAKEN_Pos (15) /*!< USBD_T::INTEN: INNAKEN Position */ -#define USBD_INTEN_INNAKEN_Msk (0x1ul << USBD_INTEN_INNAKEN_Pos) /*!< USBD_T::INTEN: INNAKEN Mask */ - -#define USBD_INTSTS_BUSIF_Pos (0) /*!< USBD_T::INTSTS: BUSIF Position */ -#define USBD_INTSTS_BUSIF_Msk (0x1ul << USBD_INTSTS_BUSIF_Pos) /*!< USBD_T::INTSTS: BUSIF Mask */ - -#define USBD_INTSTS_USBIF_Pos (1) /*!< USBD_T::INTSTS: USBIF Position */ -#define USBD_INTSTS_USBIF_Msk (0x1ul << USBD_INTSTS_USBIF_Pos) /*!< USBD_T::INTSTS: USBIF Mask */ - -#define USBD_INTSTS_VBDETIF_Pos (2) /*!< USBD_T::INTSTS: VBDETIF Position */ -#define USBD_INTSTS_VBDETIF_Msk (0x1ul << USBD_INTSTS_VBDETIF_Pos) /*!< USBD_T::INTSTS: VBDETIF Mask */ - -#define USBD_INTSTS_NEVWKIF_Pos (3) /*!< USBD_T::INTSTS: NEVWKIF Position */ -#define USBD_INTSTS_NEVWKIF_Msk (0x1ul << USBD_INTSTS_NEVWKIF_Pos) /*!< USBD_T::INTSTS: NEVWKIF Mask */ - -#define USBD_INTSTS_SOFIF_Pos (4) /*!< USBD_T::INTSTS: SOFIF Position */ -#define USBD_INTSTS_SOFIF_Msk (0x1ul << USBD_INTSTS_SOFIF_Pos) /*!< USBD_T::INTSTS: SOFIF Mask */ - -#define USBD_INTSTS_EPEVT0_Pos (16) /*!< USBD_T::INTSTS: EPEVT0 Position */ -#define USBD_INTSTS_EPEVT0_Msk (0x1ul << USBD_INTSTS_EPEVT0_Pos) /*!< USBD_T::INTSTS: EPEVT0 Mask */ - -#define USBD_INTSTS_EPEVT1_Pos (17) /*!< USBD_T::INTSTS: EPEVT1 Position */ -#define USBD_INTSTS_EPEVT1_Msk (0x1ul << USBD_INTSTS_EPEVT1_Pos) /*!< USBD_T::INTSTS: EPEVT1 Mask */ - -#define USBD_INTSTS_EPEVT2_Pos (18) /*!< USBD_T::INTSTS: EPEVT2 Position */ -#define USBD_INTSTS_EPEVT2_Msk (0x1ul << USBD_INTSTS_EPEVT2_Pos) /*!< USBD_T::INTSTS: EPEVT2 Mask */ - -#define USBD_INTSTS_EPEVT3_Pos (19) /*!< USBD_T::INTSTS: EPEVT3 Position */ -#define USBD_INTSTS_EPEVT3_Msk (0x1ul << USBD_INTSTS_EPEVT3_Pos) /*!< USBD_T::INTSTS: EPEVT3 Mask */ - -#define USBD_INTSTS_EPEVT4_Pos (20) /*!< USBD_T::INTSTS: EPEVT4 Position */ -#define USBD_INTSTS_EPEVT4_Msk (0x1ul << USBD_INTSTS_EPEVT4_Pos) /*!< USBD_T::INTSTS: EPEVT4 Mask */ - -#define USBD_INTSTS_EPEVT5_Pos (21) /*!< USBD_T::INTSTS: EPEVT5 Position */ -#define USBD_INTSTS_EPEVT5_Msk (0x1ul << USBD_INTSTS_EPEVT5_Pos) /*!< USBD_T::INTSTS: EPEVT5 Mask */ - -#define USBD_INTSTS_EPEVT6_Pos (22) /*!< USBD_T::INTSTS: EPEVT6 Position */ -#define USBD_INTSTS_EPEVT6_Msk (0x1ul << USBD_INTSTS_EPEVT6_Pos) /*!< USBD_T::INTSTS: EPEVT6 Mask */ - -#define USBD_INTSTS_EPEVT7_Pos (23) /*!< USBD_T::INTSTS: EPEVT7 Position */ -#define USBD_INTSTS_EPEVT7_Msk (0x1ul << USBD_INTSTS_EPEVT7_Pos) /*!< USBD_T::INTSTS: EPEVT7 Mask */ - -#define USBD_INTSTS_SETUP_Pos (31) /*!< USBD_T::INTSTS: SETUP Position */ -#define USBD_INTSTS_SETUP_Msk (0x1ul << USBD_INTSTS_SETUP_Pos) /*!< USBD_T::INTSTS: SETUP Mask */ - -#define USBD_FADDR_FADDR_Pos (0) /*!< USBD_T::FADDR: FADDR Position */ -#define USBD_FADDR_FADDR_Msk (0x7ful << USBD_FADDR_FADDR_Pos) /*!< USBD_T::FADDR: FADDR Mask */ - -#define USBD_EPSTS_OV_Pos (7) /*!< USBD_T::EPSTS: OV Position */ -#define USBD_EPSTS_OV_Msk (0x1ul << USBD_EPSTS_OV_Pos) /*!< USBD_T::EPSTS: OV Mask */ - -#define USBD_ATTR_USBRST_Pos (0) /*!< USBD_T::ATTR: USBRST Position */ -#define USBD_ATTR_USBRST_Msk (0x1ul << USBD_ATTR_USBRST_Pos) /*!< USBD_T::ATTR: USBRST Mask */ - -#define USBD_ATTR_SUSPEND_Pos (1) /*!< USBD_T::ATTR: SUSPEND Position */ -#define USBD_ATTR_SUSPEND_Msk (0x1ul << USBD_ATTR_SUSPEND_Pos) /*!< USBD_T::ATTR: SUSPEND Mask */ - -#define USBD_ATTR_RESUME_Pos (2) /*!< USBD_T::ATTR: RESUME Position */ -#define USBD_ATTR_RESUME_Msk (0x1ul << USBD_ATTR_RESUME_Pos) /*!< USBD_T::ATTR: RESUME Mask */ - -#define USBD_ATTR_TOUT_Pos (3) /*!< USBD_T::ATTR: TOUT Position */ -#define USBD_ATTR_TOUT_Msk (0x1ul << USBD_ATTR_TOUT_Pos) /*!< USBD_T::ATTR: TOUT Mask */ - -#define USBD_ATTR_PHYEN_Pos (4) /*!< USBD_T::ATTR: PHYEN Position */ -#define USBD_ATTR_PHYEN_Msk (0x1ul << USBD_ATTR_PHYEN_Pos) /*!< USBD_T::ATTR: PHYEN Mask */ - -#define USBD_ATTR_RWAKEUP_Pos (5) /*!< USBD_T::ATTR: RWAKEUP Position */ -#define USBD_ATTR_RWAKEUP_Msk (0x1ul << USBD_ATTR_RWAKEUP_Pos) /*!< USBD_T::ATTR: RWAKEUP Mask */ - -#define USBD_ATTR_USBEN_Pos (7) /*!< USBD_T::ATTR: USBEN Position */ -#define USBD_ATTR_USBEN_Msk (0x1ul << USBD_ATTR_USBEN_Pos) /*!< USBD_T::ATTR: USBEN Mask */ - -#define USBD_ATTR_DPPUEN_Pos (8) /*!< USBD_T::ATTR: DPPUEN Position */ -#define USBD_ATTR_DPPUEN_Msk (0x1ul << USBD_ATTR_DPPUEN_Pos) /*!< USBD_T::ATTR: DPPUEN Mask */ - -#define USBD_ATTR_BYTEM_Pos (10) /*!< USBD_T::ATTR: BYTEM Position */ -#define USBD_ATTR_BYTEM_Msk (0x1ul << USBD_ATTR_BYTEM_Pos) /*!< USBD_T::ATTR: BYTEM Mask */ - -#define USBD_ATTR_LPMACK_Pos (11) /*!< USBD_T::ATTR: LPMACK Position */ -#define USBD_ATTR_LPMACK_Msk (0x1ul << USBD_ATTR_LPMACK_Pos) /*!< USBD_T::ATTR: LPMACK Mask */ - -#define USBD_ATTR_L1SUSPEND_Pos (12) /*!< USBD_T::ATTR: L1SUSPEND Position */ -#define USBD_ATTR_L1SUSPEND_Msk (0x1ul << USBD_ATTR_L1SUSPEND_Pos) /*!< USBD_T::ATTR: L1SUSPEND Mask */ - -#define USBD_ATTR_L1RESUME_Pos (13) /*!< USBD_T::ATTR: L1RESUME Position */ -#define USBD_ATTR_L1RESUME_Msk (0x1ul << USBD_ATTR_L1RESUME_Pos) /*!< USBD_T::ATTR: L1RESUME Mask */ - -#define USBD_VBUSDET_VBUSDET_Pos (0) /*!< USBD_T::VBUSDET: VBUSDET Position */ -#define USBD_VBUSDET_VBUSDET_Msk (0x1ul << USBD_VBUSDET_VBUSDET_Pos) /*!< USBD_T::VBUSDET: VBUSDET Mask */ - -#define USBD_STBUFSEG_STBUFSEG_Pos (3) /*!< USBD_T::STBUFSEG: STBUFSEG Position */ -#define USBD_STBUFSEG_STBUFSEG_Msk (0x3ful << USBD_STBUFSEG_STBUFSEG_Pos) /*!< USBD_T::STBUFSEG: STBUFSEG Mask */ - -#define USBD_EPSTS0_EPSTS0_Pos (0) /*!< USBD_T::EPSTS0: EPSTS0 Position */ -#define USBD_EPSTS0_EPSTS0_Msk (0xful << USBD_EPSTS0_EPSTS0_Pos) /*!< USBD_T::EPSTS0: EPSTS0 Mask */ - -#define USBD_EPSTS0_EPSTS1_Pos (4) /*!< USBD_T::EPSTS0: EPSTS1 Position */ -#define USBD_EPSTS0_EPSTS1_Msk (0xful << USBD_EPSTS0_EPSTS1_Pos) /*!< USBD_T::EPSTS0: EPSTS1 Mask */ - -#define USBD_EPSTS0_EPSTS2_Pos (8) /*!< USBD_T::EPSTS0: EPSTS2 Position */ -#define USBD_EPSTS0_EPSTS2_Msk (0xful << USBD_EPSTS0_EPSTS2_Pos) /*!< USBD_T::EPSTS0: EPSTS2 Mask */ - -#define USBD_EPSTS0_EPSTS3_Pos (12) /*!< USBD_T::EPSTS0: EPSTS3 Position */ -#define USBD_EPSTS0_EPSTS3_Msk (0xful << USBD_EPSTS0_EPSTS3_Pos) /*!< USBD_T::EPSTS0: EPSTS3 Mask */ - -#define USBD_EPSTS0_EPSTS4_Pos (16) /*!< USBD_T::EPSTS0: EPSTS4 Position */ -#define USBD_EPSTS0_EPSTS4_Msk (0xful << USBD_EPSTS0_EPSTS4_Pos) /*!< USBD_T::EPSTS0: EPSTS4 Mask */ -#define USBD_EPSTS0_EPSTS5_Pos (20) /*!< USBD_T::EPSTS0: EPSTS5 Position */ -#define USBD_EPSTS0_EPSTS5_Msk (0xful << USBD_EPSTS0_EPSTS5_Pos) /*!< USBD_T::EPSTS0: EPSTS5 Mask */ - -#define USBD_EPSTS0_EPSTS6_Pos (24) /*!< USBD_T::EPSTS0: EPSTS6 Position */ -#define USBD_EPSTS0_EPSTS6_Msk (0xful << USBD_EPSTS0_EPSTS6_Pos) /*!< USBD_T::EPSTS0: EPSTS6 Mask */ - -#define USBD_EPSTS0_EPSTS7_Pos (28) /*!< USBD_T::EPSTS0: EPSTS7 Position */ -#define USBD_EPSTS0_EPSTS7_Msk (0xful << USBD_EPSTS0_EPSTS7_Pos) /*!< USBD_T::EPSTS0: EPSTS7 Mask */ - -#define USBD_LPMATTR_LPMLINKSTS_Pos (0) /*!< USBD_T::LPMATTR: LPMLINKSTS Position */ -#define USBD_LPMATTR_LPMLINKSTS_Msk (0xful << USBD_LPMATTR_LPMLINKSTS_Pos) /*!< USBD_T::LPMATTR: LPMLINKSTS Mask */ - -#define USBD_LPMATTR_LPMBESL_Pos (4) /*!< USBD_T::LPMATTR: LPMBESL Position */ -#define USBD_LPMATTR_LPMBESL_Msk (0xful << USBD_LPMATTR_LPMBESL_Pos) /*!< USBD_T::LPMATTR: LPMBESL Mask */ - -#define USBD_LPMATTR_LPMRWAKUP_Pos (8) /*!< USBD_T::LPMATTR: LPMRWAKUP Position */ -#define USBD_LPMATTR_LPMRWAKUP_Msk (0x1ul << USBD_LPMATTR_LPMRWAKUP_Pos) /*!< USBD_T::LPMATTR: LPMRWAKUP Mask */ - -#define USBD_FN_FN_Pos (0) /*!< USBD_T::FN: FN Position */ -#define USBD_FN_FN_Msk (0x7fful << USBD_FN_FN_Pos) /*!< USBD_T::FN: FN Mask */ - -#define USBD_SE0_SE0_Pos (0) /*!< USBD_T::SE0: SE0 Position */ -#define USBD_SE0_SE0_Msk (0x1ul << USBD_SE0_SE0_Pos) /*!< USBD_T::SE0: SE0 Mask */ - -#define USBD_BUFSEG_BUFSEG_Pos (3) /*!< USBD_EP_T::BUFSEG: BUFSEG Position */ -#define USBD_BUFSEG_BUFSEG_Msk (0x3ful << USBD_BUFSEG_BUFSEG_Pos) /*!< USBD_EP_T::BUFSEG: BUFSEG Mask */ - -#define USBD_MXPLD_MXPLD_Pos (0) /*!< USBD_EP_T::MXPLD: MXPLD Position */ -#define USBD_MXPLD_MXPLD_Msk (0x1fful << USBD_MXPLD_MXPLD_Pos) /*!< USBD_EP_T::MXPLD: MXPLD Mask */ - -#define USBD_CFG_EPNUM_Pos (0) /*!< USBD_EP_T::CFG: EPNUM Position */ -#define USBD_CFG_EPNUM_Msk (0xful << USBD_CFG_EPNUM_Pos) /*!< USBD_EP_T::CFG: EPNUM Mask */ - -#define USBD_CFG_ISOCH_Pos (4) /*!< USBD_EP_T::CFG: ISOCH Position */ -#define USBD_CFG_ISOCH_Msk (0x1ul << USBD_CFG_ISOCH_Pos) /*!< USBD_EP_T::CFG: ISOCH Mask */ - -#define USBD_CFG_STATE_Pos (5) /*!< USBD_EP_T::CFG: STATE Position */ -#define USBD_CFG_STATE_Msk (0x3ul << USBD_CFG_STATE_Pos) /*!< USBD_EP_T::CFG: STATE Mask */ - -#define USBD_CFG_DSQSYNC_Pos (7) /*!< USBD_EP_T::CFG: DSQSYNC Position */ -#define USBD_CFG_DSQSYNC_Msk (0x1ul << USBD_CFG_DSQSYNC_Pos) /*!< USBD_EP_T::CFG: DSQSYNC Mask */ - -#define USBD_CFG_CSTALL_Pos (9) /*!< USBD_EP_T::CFG: CSTALL Position */ -#define USBD_CFG_CSTALL_Msk (0x1ul << USBD_CFG_CSTALL_Pos) /*!< USBD_EP_T::CFG: CSTALL Mask */ - -#define USBD_CFGP_CLRRDY_Pos (0) /*!< USBD_EP_T::CFGP: CLRRDY Position */ -#define USBD_CFGP_CLRRDY_Msk (0x1ul << USBD_CFGP_CLRRDY_Pos) /*!< USBD_EP_T::CFGP: CLRRDY Mask */ - -#define USBD_CFGP_SSTALL_Pos (1) /*!< USBD_EP_T::CFGP: SSTALL Position */ -#define USBD_CFGP_SSTALL_Msk (0x1ul << USBD_CFGP_SSTALL_Pos) /*!< USBD_EP_T::CFGP: SSTALL Mask */ - -/**@}*/ /* USBD_CONST */ -/**@}*/ /* end of USBD register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __USBD_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uspi_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uspi_reg.h deleted file mode 100644 index debfe82ded0..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uspi_reg.h +++ /dev/null @@ -1,673 +0,0 @@ -/**************************************************************************//** - * @file uspi_reg.h - * @version V1.00 - * @brief USPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USPI_REG_H__ -#define __USPI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USPI SPI Mode of USCI Controller (USPI) - Memory Mapped Structure for USPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var USPI_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller. - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI. - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol. - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var USPI_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt Disabled. - * | | |1 = The transmit start interrupt Enabled. - * | | |Note: The transmit start event happens when hardware starts to move TX data from data buffer to shift data unit. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt Disabled. - * | | |1 = The transmit finish interrupt Enabled. - * | | |Note: The transmit finish event happens when hardware sends the last bit of TX data from shift data unit. - * |[3] |RXSTIEN |Receive Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt Disabled. - * | | |1 = The receive start interrupt Enabled. - * | | |Note: For SPI master mode, the receive start event happens when SPI master sends slave select active and spi clock to the external SPI slave. - * | | |For SPI slave mode, the receive start event happens when slave select of SPI slave is active and spi clock of SPI slave is inputed from the external SPI master. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt Disabled. - * | | |1 = The receive end interrupt Enabled. - * | | |Note: The receive finish event happens when hardware receives the last bit of RX data into shift data unit. - * @var USPI_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fDIV_CLK. - * | | |01 = fPROT_CLK. - * | | |10 = fSCLK. - * | | |11 = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter Disabled. - * | | |1 = Time measurement counter Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * @var USPI_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal, which is synchronized with PCLK, can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * @var USPI_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal, which is synchronized with PCLK, can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var USPI_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal, which is synchronized with PCLK, can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * @var USPI_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT0/1 pin. - * | | |0 = Data output values of USCIx_DAT0/1 pins are not inverted. - * | | |1 = Data output values of USCIx_DAT0/1 pins are inverted. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: The control signal has different definitions in different protocol. - * | | |In SPI protocol, the control signal means slave select signal. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission. - * | | |The data word is always right-aligned in the data buffer. - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * @var USPI_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * | | |In order to avoid overwriting the transmit data, user have to check TXEMPTY (USPI_BUFSTS[8]) status before writing transmit data into this bit field. - * |[16] |PORTDIR |Port Direction Control - * | | |This bit field is only available while USCI operates in SPI protocol (FUNMODE = 0x1) with half-duplex transfer. - * | | |It is used to define the direction of the data port pin. - * | | |When software writes USPI_TXDAT register, the transmit data and its port direction are settled simultaneously. - * | | |0 = The data pin is configured as output mode. - * | | |1 = The data pin is configured as input mode. - * @var USPI_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * @var USPI_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6] |TXUDRIEN |Slave Transmit Under Run Interrupt Enable Bit - * | | |0 = Transmit under-run interrupt Disabled. - * | | |1 = Transmit under-run interrupt Enabled. - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared. - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Interrupt Enable Bit - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared. - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note1: It is cleared automatically after one PCLK cycle. - * | | |Note2: Write 1 to this bit will set the output data pin to zero if USPI_PROTCTL[28]=0. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * @var USPI_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Over-run Interrupt Status - * | | |This bit indicates that a receive buffer overrun event has been detected. - * | | |If RXOVIEN (USPI_BUFCTL[14]) is enabled, the corresponding interrupt request is activated. - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun event has not been detected. - * | | |1 = A receive buffer overrun event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty and available for the next transmission datum. - * |[9] |TXFULL |Transmit Buffer Full Indicator - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * |[11] |TXUDRIF |Transmit Buffer Under-run Interrupt Status - * | | |This bit indicates that a transmit buffer under-run event has been detected. - * | | |If enabled by TXUDRIEN (USPI_BUFCTL[6]), the corresponding interrupt request is activated. - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A transmit buffer under-run event has not been detected. - * | | |1 = A transmit buffer under-run event has been detected. - * @var USPI_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * @var USPI_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var USPI_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1. - * | | |Software can write 1 to clear this bit. - * @var USPI_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLAVE |Slave Mode Selection - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[1] |SLV3WIRE |Slave 3-wire Mode Selection (Slave Only) - * | | |The SPI protocol can work with 3-wire interface (without slave select signal) in Slave mode. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[2] |SS |Slave Select Control (Master Only) - * | | |If AUTOSS bit is cleared, setting this bit to 1 will set the slave select signal to active state, and setting this bit to 0 will set the slave select back to inactive state. - * | | |If the AUTOSS function is enabled (AUTOSS = 1), the setting value of this bit will not affect the current state of slave select signal. - * | | |Note: In SPI protocol, the internal slave select signal is active high. - * |[3] |AUTOSS |Automatic Slave Select Function Enable (Master Only) - * | | |0 = Slave select signal will be controlled by the setting value of SS (USPI_PROTCTL[2]) bit. - * | | |1 = Slave select signal will be generated automatically. - * | | |The slave select signal will be asserted by the SPI controller when transmit/receive is started, and will be de-asserted after each transmit/receive is finished. - * |[7:6] |SCLKMODE |Serial Bus Clock Mode - * | | |This bit field defines the SCLK idle status, data transmit, and data receive edge. - * | | |MODE0 = The idle state of SPI clock is low level. - * | | |Data is transmitted with falling edge and received with rising edge. - * | | |MODE1 = The idle state of SPI clock is low level. - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |MODE2 = The idle state of SPI clock is high level. - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |MODE3 = The idle state of SPI clock is high level. - * | | |Data is transmitted with falling edge and received with rising edge. - * |[11:8] |SUSPITV |Suspend Interval (Master Only) - * | | |This bit field provides the configurable suspend interval between two successive transmit/receive transaction in a transfer. - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word. - * | | |The default value is 0x3. - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPI_CLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 ... 0.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0x1 ... 1.5 SPI_CLK clock cycle. - * | | |... - * | | |SUSPITV = 0xE ... 14.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0xF ... 15.5 SPI_CLK clock cycle. - * |[14:12] |TSMSEL |Transmit Data Mode Selection - * | | |This bit field describes how receive and transmit data is shifted in and out. - * | | |TSMSEL = 000b: Full-duplex SPI. - * | | |TSMSEL = 100b: Half-duplex SPI. - * | | |Other values are reserved. - * | | |Note: Changing the value of this bit field will produce the TXRST and RXRST to clear the TX/RX data buffer automatically. - * |[25:16] |SLVTOCNT |Slave Mode Time-out Period (Slave Only) - * | | |In Slave mode, this bit field is used for Slave time-out period. - * | | |This bit field indicates how many clock periods (selected by TMCNTSRC, USPI_BRGEN[5]) between the two edges of input SCLK will assert the Slave time-out event. - * | | |Writing 0x0 into this bit field will disable the Slave time-out function. - * | | |Example: Assume SLVTOCNT is 0x0A and TMCNTSRC (USPI_BRGEN[5]) is 1, it means the time-out event will occur if the state of SPI bus clock pin is not changed more than (10+1) periods of fDIV_CLK. - * |[28] |TXUDRPOL |Transmit Under-run Data Polarity (for Slave) - * | | |This bit defines the transmitting data value of USCIx_DAT1 when no data is available for transferring. - * | | |0 = The output data value is 0 if TX under run event occurs. - * | | |1 = The output data value is 1 if TX under run event occurs. - * |[31] |PROTEN |SPI Protocol Enable Bit - * | | |0 = SPI Protocol Disabled. - * | | |1 = SPI Protocol Enabled. - * @var USPI_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to inactive. - * | | |0 = Slave select inactive interrupt generation Disabled. - * | | |1 = Slave select inactive interrupt generation Enabled. - * |[1] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to active. - * | | |0 = Slave select active interrupt generation Disabled. - * | | |1 = Slave select active interrupt generation Enabled. - * |[2] |SLVTOIEN |Slave Time-out Interrupt Enable Bit - * | | |In SPI protocol, this bit enables the interrupt generation in case of a Slave time-out event. - * | | |0 = The Slave time-out interrupt Disabled. - * | | |1 = The Slave time-out interrupt Enabled. - * |[3] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |If data transfer is terminated by slave time-out or slave select inactive event in Slave mode, so that the transmit/receive data bit count does not match the setting of DWIDTH (USPI_LINECTL[11:8]). - * | | |Bit count error event occurs. - * | | |0 = The Slave mode bit count error interrupt Disabled. - * | | |1 = The Slave mode bit count error interrupt Enabled. - * @var USPI_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = Transmit start event did not occur. - * | | |1 = Transmit start event occurred. - * | | |Note: It is cleared by software write 1 to this bit. - * | | |The transmit start event happens when hardware starts to move TX data from data buffer to shift data unit. - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = Transmit end event did not occur. - * | | |1 = Transmit end event occurred. - * | | |Note: It is cleared by software write 1 to this bit. - * | | |The transmit end event happens when hardware sends the last bit of TX data from shift data unit. - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = Receive start event did not occur. - * | | |1 = Receive start event occurred. - * | | |Note: It is cleared by software write 1 to this bit. - * | | |For SPI master mode, the receive start event happens when SPI master sends slave select active and spi clock to the external SPI slave. - * | | |For SPI slave mode, the receive start event happens when slave select of SPI slave is active and spi clock of SPI slave is inputed from the external SPI master. - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = Receive end event did not occur. - * | | |1 = Receive end event occurred. - * | | |Note: It is cleared by software write 1 to this bit. - * | | |The receive end event happens when hardware receives the last bit of RX data into shift data unit. - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag (for Slave Only) - * | | |0 = Slave time-out event did not occur. - * | | |1 = Slave time-out event occurred. - * | | |Note: It is cleared by software write 1 to this bit. - * |[6] |SLVBEIF |Slave Bit Count Error Interrupt Flag (for Slave Only) - * | | |0 = Slave bit count error event did not occur. - * | | |1 = Slave bit count error event occurred. - * | | |Note: It is cleared by software write 1 to this bit. - * | | |If the transmit/receive data bit count does not match the setting of DWIDTH (USPI_LINECTL[11:8]), bit count error event occurs.It is cleared by software write 1 to this bit. - * |[8] |SSINAIF |Slave Select Inactive Interrupt Flag (for Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to inactive. - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = The slave select signal has not changed to inactive. - * | | |1 = The slave select signal has changed to inactive. - * | | |Note: The internal slave select signal is active high. - * |[9] |SSACTIF |Slave Select Active Interrupt Flag (for Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to active. - * | | |It is cleared by software writes one to this bit. - * | | |0 = The slave select signal has not changed to active. - * | | |1 = The slave select signal has changed to active. - * | | |Note: The internal slave select signal is active high. - * |[16] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |This bit is only available in Slave mode. - * | | |It used to monitor the current status of the input slave select signal on the bus. - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * |[17] |BUSY |Busy Status (Read Only) - * | | |0 = SPI is in idle state. - * | | |1 = SPI is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. USPI_PROTCTL[31] = 1 and the TXEMPTY = 0. - * | | |b. For SPI Master mode, the TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |d. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[18] |SLVUDR |Slave Mode Transmit Under-run Status (Read Only) - * | | |In Slave mode, if there is no available transmit data in buffer while transmit data shift out caused by input serial bus clock, this status flag will be set to 1. - * | | |This bit indicates whether the current shift-out data of word transmission is switched to TXUDRPOL (USPI_PROTCTL[28]) or not. - * | | |0 = Slave transmit under run event does not occur. - * | | |1 = Slave transmit under run event occurs. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - __I uint32_t RESERVE1[3]; - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - __I uint32_t RESERVE2[1]; - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - __I uint32_t RESERVE3[4]; - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} USPI_T; - -/** - @addtogroup USPI_CONST USPI Bit Field Definition - Constant Definitions for USPI Controller -@{ */ - -#define USPI_CTL_FUNMODE_Pos (0) /*!< USPI_T::CTL: FUNMODE Position */ -#define USPI_CTL_FUNMODE_Msk (0x7ul << USPI_CTL_FUNMODE_Pos) /*!< USPI_T::CTL: FUNMODE Mask */ - -#define USPI_INTEN_TXSTIEN_Pos (1) /*!< USPI_T::INTEN: TXSTIEN Position */ -#define USPI_INTEN_TXSTIEN_Msk (0x1ul << USPI_INTEN_TXSTIEN_Pos) /*!< USPI_T::INTEN: TXSTIEN Mask */ - -#define USPI_INTEN_TXENDIEN_Pos (2) /*!< USPI_T::INTEN: TXENDIEN Position */ -#define USPI_INTEN_TXENDIEN_Msk (0x1ul << USPI_INTEN_TXENDIEN_Pos) /*!< USPI_T::INTEN: TXENDIEN Mask */ - -#define USPI_INTEN_RXSTIEN_Pos (3) /*!< USPI_T::INTEN: RXSTIEN Position */ -#define USPI_INTEN_RXSTIEN_Msk (0x1ul << USPI_INTEN_RXSTIEN_Pos) /*!< USPI_T::INTEN: RXSTIEN Mask */ - -#define USPI_INTEN_RXENDIEN_Pos (4) /*!< USPI_T::INTEN: RXENDIEN Position */ -#define USPI_INTEN_RXENDIEN_Msk (0x1ul << USPI_INTEN_RXENDIEN_Pos) /*!< USPI_T::INTEN: RXENDIEN Mask */ - -#define USPI_BRGEN_RCLKSEL_Pos (0) /*!< USPI_T::BRGEN: RCLKSEL Position */ -#define USPI_BRGEN_RCLKSEL_Msk (0x1ul << USPI_BRGEN_RCLKSEL_Pos) /*!< USPI_T::BRGEN: RCLKSEL Mask */ - -#define USPI_BRGEN_PTCLKSEL_Pos (1) /*!< USPI_T::BRGEN: PTCLKSEL Position */ -#define USPI_BRGEN_PTCLKSEL_Msk (0x1ul << USPI_BRGEN_PTCLKSEL_Pos) /*!< USPI_T::BRGEN: PTCLKSEL Mask */ - -#define USPI_BRGEN_SPCLKSEL_Pos (2) /*!< USPI_T::BRGEN: SPCLKSEL Position */ -#define USPI_BRGEN_SPCLKSEL_Msk (0x3ul << USPI_BRGEN_SPCLKSEL_Pos) /*!< USPI_T::BRGEN: SPCLKSEL Mask */ - -#define USPI_BRGEN_TMCNTEN_Pos (4) /*!< USPI_T::BRGEN: TMCNTEN Position */ -#define USPI_BRGEN_TMCNTEN_Msk (0x1ul << USPI_BRGEN_TMCNTEN_Pos) /*!< USPI_T::BRGEN: TMCNTEN Mask */ - -#define USPI_BRGEN_TMCNTSRC_Pos (5) /*!< USPI_T::BRGEN: TMCNTSRC Position */ -#define USPI_BRGEN_TMCNTSRC_Msk (0x1ul << USPI_BRGEN_TMCNTSRC_Pos) /*!< USPI_T::BRGEN: TMCNTSRC Mask */ - -#define USPI_BRGEN_CLKDIV_Pos (16) /*!< USPI_T::BRGEN: CLKDIV Position */ -#define USPI_BRGEN_CLKDIV_Msk (0x3fful << USPI_BRGEN_CLKDIV_Pos) /*!< USPI_T::BRGEN: CLKDIV Mask */ - -#define USPI_DATIN0_SYNCSEL_Pos (0) /*!< USPI_T::DATIN0: SYNCSEL Position */ -#define USPI_DATIN0_SYNCSEL_Msk (0x1ul << USPI_DATIN0_SYNCSEL_Pos) /*!< USPI_T::DATIN0: SYNCSEL Mask */ - -#define USPI_DATIN0_ININV_Pos (2) /*!< USPI_T::DATIN0: ININV Position */ -#define USPI_DATIN0_ININV_Msk (0x1ul << USPI_DATIN0_ININV_Pos) /*!< USPI_T::DATIN0: ININV Mask */ - -#define USPI_CTLIN0_SYNCSEL_Pos (0) /*!< USPI_T::CTLIN0: SYNCSEL Position */ -#define USPI_CTLIN0_SYNCSEL_Msk (0x1ul << USPI_CTLIN0_SYNCSEL_Pos) /*!< USPI_T::CTLIN0: SYNCSEL Mask */ - -#define USPI_CTLIN0_ININV_Pos (2) /*!< USPI_T::CTLIN0: ININV Position */ -#define USPI_CTLIN0_ININV_Msk (0x1ul << USPI_CTLIN0_ININV_Pos) /*!< USPI_T::CTLIN0: ININV Mask */ - -#define USPI_CLKIN_SYNCSEL_Pos (0) /*!< USPI_T::CLKIN: SYNCSEL Position */ -#define USPI_CLKIN_SYNCSEL_Msk (0x1ul << USPI_CLKIN_SYNCSEL_Pos) /*!< USPI_T::CLKIN: SYNCSEL Mask */ - -#define USPI_LINECTL_LSB_Pos (0) /*!< USPI_T::LINECTL: LSB Position */ -#define USPI_LINECTL_LSB_Msk (0x1ul << USPI_LINECTL_LSB_Pos) /*!< USPI_T::LINECTL: LSB Mask */ - -#define USPI_LINECTL_DATOINV_Pos (5) /*!< USPI_T::LINECTL: DATOINV Position */ -#define USPI_LINECTL_DATOINV_Msk (0x1ul << USPI_LINECTL_DATOINV_Pos) /*!< USPI_T::LINECTL: DATOINV Mask */ - -#define USPI_LINECTL_CTLOINV_Pos (7) /*!< USPI_T::LINECTL: CTLOINV Position */ -#define USPI_LINECTL_CTLOINV_Msk (0x1ul << USPI_LINECTL_CTLOINV_Pos) /*!< USPI_T::LINECTL: CTLOINV Mask */ - -#define USPI_LINECTL_DWIDTH_Pos (8) /*!< USPI_T::LINECTL: DWIDTH Position */ -#define USPI_LINECTL_DWIDTH_Msk (0xful << USPI_LINECTL_DWIDTH_Pos) /*!< USPI_T::LINECTL: DWIDTH Mask */ - -#define USPI_TXDAT_TXDAT_Pos (0) /*!< USPI_T::TXDAT: TXDAT Position */ -#define USPI_TXDAT_TXDAT_Msk (0xfffful << USPI_TXDAT_TXDAT_Pos) /*!< USPI_T::TXDAT: TXDAT Mask */ - -#define USPI_TXDAT_PORTDIR_Pos (16) /*!< USPI_T::TXDAT: PORTDIR Position */ -#define USPI_TXDAT_PORTDIR_Msk (0x1ul << USPI_TXDAT_PORTDIR_Pos) /*!< USPI_T::TXDAT: PORTDIR Mask */ - -#define USPI_RXDAT_RXDAT_Pos (0) /*!< USPI_T::RXDAT: RXDAT Position */ -#define USPI_RXDAT_RXDAT_Msk (0xfffful << USPI_RXDAT_RXDAT_Pos) /*!< USPI_T::RXDAT: RXDAT Mask */ - -#define USPI_BUFCTL_TXUDRIEN_Pos (6) /*!< USPI_T::BUFCTL: TXUDRIEN Position */ -#define USPI_BUFCTL_TXUDRIEN_Msk (0x1ul << USPI_BUFCTL_TXUDRIEN_Pos) /*!< USPI_T::BUFCTL: TXUDRIEN Mask */ - -#define USPI_BUFCTL_TXCLR_Pos (7) /*!< USPI_T::BUFCTL: TXCLR Position */ -#define USPI_BUFCTL_TXCLR_Msk (0x1ul << USPI_BUFCTL_TXCLR_Pos) /*!< USPI_T::BUFCTL: TXCLR Mask */ - -#define USPI_BUFCTL_RXOVIEN_Pos (14) /*!< USPI_T::BUFCTL: RXOVIEN Position */ -#define USPI_BUFCTL_RXOVIEN_Msk (0x1ul << USPI_BUFCTL_RXOVIEN_Pos) /*!< USPI_T::BUFCTL: RXOVIEN Mask */ - -#define USPI_BUFCTL_RXCLR_Pos (15) /*!< USPI_T::BUFCTL: RXCLR Position */ -#define USPI_BUFCTL_RXCLR_Msk (0x1ul << USPI_BUFCTL_RXCLR_Pos) /*!< USPI_T::BUFCTL: RXCLR Mask */ - -#define USPI_BUFCTL_TXRST_Pos (16) /*!< USPI_T::BUFCTL: TXRST Position */ -#define USPI_BUFCTL_TXRST_Msk (0x1ul << USPI_BUFCTL_TXRST_Pos) /*!< USPI_T::BUFCTL: TXRST Mask */ - -#define USPI_BUFCTL_RXRST_Pos (17) /*!< USPI_T::BUFCTL: RXRST Position */ -#define USPI_BUFCTL_RXRST_Msk (0x1ul << USPI_BUFCTL_RXRST_Pos) /*!< USPI_T::BUFCTL: RXRST Mask */ - -#define USPI_BUFSTS_RXEMPTY_Pos (0) /*!< USPI_T::BUFSTS: RXEMPTY Position */ -#define USPI_BUFSTS_RXEMPTY_Msk (0x1ul << USPI_BUFSTS_RXEMPTY_Pos) /*!< USPI_T::BUFSTS: RXEMPTY Mask */ - -#define USPI_BUFSTS_RXFULL_Pos (1) /*!< USPI_T::BUFSTS: RXFULL Position */ -#define USPI_BUFSTS_RXFULL_Msk (0x1ul << USPI_BUFSTS_RXFULL_Pos) /*!< USPI_T::BUFSTS: RXFULL Mask */ - -#define USPI_BUFSTS_RXOVIF_Pos (3) /*!< USPI_T::BUFSTS: RXOVIF Position */ -#define USPI_BUFSTS_RXOVIF_Msk (0x1ul << USPI_BUFSTS_RXOVIF_Pos) /*!< USPI_T::BUFSTS: RXOVIF Mask */ - -#define USPI_BUFSTS_TXEMPTY_Pos (8) /*!< USPI_T::BUFSTS: TXEMPTY Position */ -#define USPI_BUFSTS_TXEMPTY_Msk (0x1ul << USPI_BUFSTS_TXEMPTY_Pos) /*!< USPI_T::BUFSTS: TXEMPTY Mask */ - -#define USPI_BUFSTS_TXFULL_Pos (9) /*!< USPI_T::BUFSTS: TXFULL Position */ -#define USPI_BUFSTS_TXFULL_Msk (0x1ul << USPI_BUFSTS_TXFULL_Pos) /*!< USPI_T::BUFSTS: TXFULL Mask */ - -#define USPI_BUFSTS_TXUDRIF_Pos (11) /*!< USPI_T::BUFSTS: TXUDRIF Position */ -#define USPI_BUFSTS_TXUDRIF_Msk (0x1ul << USPI_BUFSTS_TXUDRIF_Pos) /*!< USPI_T::BUFSTS: TXUDRIF Mask */ - -#define USPI_PDMACTL_PDMARST_Pos (0) /*!< USPI_T::PDMACTL: PDMARST Position */ -#define USPI_PDMACTL_PDMARST_Msk (0x1ul << USPI_PDMACTL_PDMARST_Pos) /*!< USPI_T::PDMACTL: PDMARST Mask */ - -#define USPI_PDMACTL_TXPDMAEN_Pos (1) /*!< USPI_T::PDMACTL: TXPDMAEN Position */ -#define USPI_PDMACTL_TXPDMAEN_Msk (0x1ul << USPI_PDMACTL_TXPDMAEN_Pos) /*!< USPI_T::PDMACTL: TXPDMAEN Mask */ - -#define USPI_PDMACTL_RXPDMAEN_Pos (2) /*!< USPI_T::PDMACTL: RXPDMAEN Position */ -#define USPI_PDMACTL_RXPDMAEN_Msk (0x1ul << USPI_PDMACTL_RXPDMAEN_Pos) /*!< USPI_T::PDMACTL: RXPDMAEN Mask */ - -#define USPI_PDMACTL_PDMAEN_Pos (3) /*!< USPI_T::PDMACTL: PDMAEN Position */ -#define USPI_PDMACTL_PDMAEN_Msk (0x1ul << USPI_PDMACTL_PDMAEN_Pos) /*!< USPI_T::PDMACTL: PDMAEN Mask */ - -#define USPI_WKCTL_WKEN_Pos (0) /*!< USPI_T::WKCTL: WKEN Position */ -#define USPI_WKCTL_WKEN_Msk (0x1ul << USPI_WKCTL_WKEN_Pos) /*!< USPI_T::WKCTL: WKEN Mask */ - -#define USPI_WKCTL_PDBOPT_Pos (2) /*!< USPI_T::WKCTL: PDBOPT Position */ -#define USPI_WKCTL_PDBOPT_Msk (0x1ul << USPI_WKCTL_PDBOPT_Pos) /*!< USPI_T::WKCTL: PDBOPT Mask */ - -#define USPI_WKSTS_WKF_Pos (0) /*!< USPI_T::WKSTS: WKF Position */ -#define USPI_WKSTS_WKF_Msk (0x1ul << USPI_WKSTS_WKF_Pos) /*!< USPI_T::WKSTS: WKF Mask */ - -#define USPI_PROTCTL_SLAVE_Pos (0) /*!< USPI_T::PROTCTL: SLAVE Position */ -#define USPI_PROTCTL_SLAVE_Msk (0x1ul << USPI_PROTCTL_SLAVE_Pos) /*!< USPI_T::PROTCTL: SLAVE Mask */ - -#define USPI_PROTCTL_SLV3WIRE_Pos (1) /*!< USPI_T::PROTCTL: SLV3WIRE Position */ -#define USPI_PROTCTL_SLV3WIRE_Msk (0x1ul << USPI_PROTCTL_SLV3WIRE_Pos) /*!< USPI_T::PROTCTL: SLV3WIRE Mask */ - -#define USPI_PROTCTL_SS_Pos (2) /*!< USPI_T::PROTCTL: SS Position */ -#define USPI_PROTCTL_SS_Msk (0x1ul << USPI_PROTCTL_SS_Pos) /*!< USPI_T::PROTCTL: SS Mask */ - -#define USPI_PROTCTL_AUTOSS_Pos (3) /*!< USPI_T::PROTCTL: AUTOSS Position */ -#define USPI_PROTCTL_AUTOSS_Msk (0x1ul << USPI_PROTCTL_AUTOSS_Pos) /*!< USPI_T::PROTCTL: AUTOSS Mask */ - -#define USPI_PROTCTL_SCLKMODE_Pos (6) /*!< USPI_T::PROTCTL: SCLKMODE Position */ -#define USPI_PROTCTL_SCLKMODE_Msk (0x3ul << USPI_PROTCTL_SCLKMODE_Pos) /*!< USPI_T::PROTCTL: SCLKMODE Mask */ - -#define USPI_PROTCTL_SUSPITV_Pos (8) /*!< USPI_T::PROTCTL: SUSPITV Position */ -#define USPI_PROTCTL_SUSPITV_Msk (0xful << USPI_PROTCTL_SUSPITV_Pos) /*!< USPI_T::PROTCTL: SUSPITV Mask */ - -#define USPI_PROTCTL_TSMSEL_Pos (12) /*!< USPI_T::PROTCTL: TSMSEL Position */ -#define USPI_PROTCTL_TSMSEL_Msk (0x7ul << USPI_PROTCTL_TSMSEL_Pos) /*!< USPI_T::PROTCTL: TSMSEL Mask */ - -#define USPI_PROTCTL_SLVTOCNT_Pos (16) /*!< USPI_T::PROTCTL: SLVTOCNT Position */ -#define USPI_PROTCTL_SLVTOCNT_Msk (0x3fful << USPI_PROTCTL_SLVTOCNT_Pos) /*!< USPI_T::PROTCTL: SLVTOCNT Mask */ - -#define USPI_PROTCTL_TXUDRPOL_Pos (28) /*!< USPI_T::PROTCTL: TXUDRPOL Position */ -#define USPI_PROTCTL_TXUDRPOL_Msk (0x1ul << USPI_PROTCTL_TXUDRPOL_Pos) /*!< USPI_T::PROTCTL: TXUDRPOL Mask */ - -#define USPI_PROTCTL_PROTEN_Pos (31) /*!< USPI_T::PROTCTL: PROTEN Position */ -#define USPI_PROTCTL_PROTEN_Msk (0x1ul << USPI_PROTCTL_PROTEN_Pos) /*!< USPI_T::PROTCTL: PROTEN Mask */ - -#define USPI_PROTIEN_SSINAIEN_Pos (0) /*!< USPI_T::PROTIEN: SSINAIEN Position */ -#define USPI_PROTIEN_SSINAIEN_Msk (0x1ul << USPI_PROTIEN_SSINAIEN_Pos) /*!< USPI_T::PROTIEN: SSINAIEN Mask */ - -#define USPI_PROTIEN_SSACTIEN_Pos (1) /*!< USPI_T::PROTIEN: SSACTIEN Position */ -#define USPI_PROTIEN_SSACTIEN_Msk (0x1ul << USPI_PROTIEN_SSACTIEN_Pos) /*!< USPI_T::PROTIEN: SSACTIEN Mask */ - -#define USPI_PROTIEN_SLVTOIEN_Pos (2) /*!< USPI_T::PROTIEN: SLVTOIEN Position */ -#define USPI_PROTIEN_SLVTOIEN_Msk (0x1ul << USPI_PROTIEN_SLVTOIEN_Pos) /*!< USPI_T::PROTIEN: SLVTOIEN Mask */ - -#define USPI_PROTIEN_SLVBEIEN_Pos (3) /*!< USPI_T::PROTIEN: SLVBEIEN Position */ -#define USPI_PROTIEN_SLVBEIEN_Msk (0x1ul << USPI_PROTIEN_SLVBEIEN_Pos) /*!< USPI_T::PROTIEN: SLVBEIEN Mask */ - -#define USPI_PROTSTS_TXSTIF_Pos (1) /*!< USPI_T::PROTSTS: TXSTIF Position */ -#define USPI_PROTSTS_TXSTIF_Msk (0x1ul << USPI_PROTSTS_TXSTIF_Pos) /*!< USPI_T::PROTSTS: TXSTIF Mask */ - -#define USPI_PROTSTS_TXENDIF_Pos (2) /*!< USPI_T::PROTSTS: TXENDIF Position */ -#define USPI_PROTSTS_TXENDIF_Msk (0x1ul << USPI_PROTSTS_TXENDIF_Pos) /*!< USPI_T::PROTSTS: TXENDIF Mask */ - -#define USPI_PROTSTS_RXSTIF_Pos (3) /*!< USPI_T::PROTSTS: RXSTIF Position */ -#define USPI_PROTSTS_RXSTIF_Msk (0x1ul << USPI_PROTSTS_RXSTIF_Pos) /*!< USPI_T::PROTSTS: RXSTIF Mask */ - -#define USPI_PROTSTS_RXENDIF_Pos (4) /*!< USPI_T::PROTSTS: RXENDIF Position */ -#define USPI_PROTSTS_RXENDIF_Msk (0x1ul << USPI_PROTSTS_RXENDIF_Pos) /*!< USPI_T::PROTSTS: RXENDIF Mask */ - -#define USPI_PROTSTS_SLVTOIF_Pos (5) /*!< USPI_T::PROTSTS: SLVTOIF Position */ -#define USPI_PROTSTS_SLVTOIF_Msk (0x1ul << USPI_PROTSTS_SLVTOIF_Pos) /*!< USPI_T::PROTSTS: SLVTOIF Mask */ - -#define USPI_PROTSTS_SLVBEIF_Pos (6) /*!< USPI_T::PROTSTS: SLVBEIF Position */ -#define USPI_PROTSTS_SLVBEIF_Msk (0x1ul << USPI_PROTSTS_SLVBEIF_Pos) /*!< USPI_T::PROTSTS: SLVBEIF Mask */ - -#define USPI_PROTSTS_SSINAIF_Pos (8) /*!< USPI_T::PROTSTS: SSINAIF Position */ -#define USPI_PROTSTS_SSINAIF_Msk (0x1ul << USPI_PROTSTS_SSINAIF_Pos) /*!< USPI_T::PROTSTS: SSINAIF Mask */ - -#define USPI_PROTSTS_SSACTIF_Pos (9) /*!< USPI_T::PROTSTS: SSACTIF Position */ -#define USPI_PROTSTS_SSACTIF_Msk (0x1ul << USPI_PROTSTS_SSACTIF_Pos) /*!< USPI_T::PROTSTS: SSACTIF Mask */ - -#define USPI_PROTSTS_SSLINE_Pos (16) /*!< USPI_T::PROTSTS: SSLINE Position */ -#define USPI_PROTSTS_SSLINE_Msk (0x1ul << USPI_PROTSTS_SSLINE_Pos) /*!< USPI_T::PROTSTS: SSLINE Mask */ - -#define USPI_PROTSTS_BUSY_Pos (17) /*!< USPI_T::PROTSTS: BUSY Position */ -#define USPI_PROTSTS_BUSY_Msk (0x1ul << USPI_PROTSTS_BUSY_Pos) /*!< USPI_T::PROTSTS: BUSY Mask */ - -#define USPI_PROTSTS_SLVUDR_Pos (18) /*!< USPI_T::PROTSTS: SLVUDR Position */ -#define USPI_PROTSTS_SLVUDR_Msk (0x1ul << USPI_PROTSTS_SLVUDR_Pos) /*!< USPI_T::PROTSTS: SLVUDR Mask */ - -/**@}*/ /* USPI_CONST */ -/**@}*/ /* end of USPI register group */ - - -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __USPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uuart_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uuart_reg.h deleted file mode 100644 index 68023d166e3..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/uuart_reg.h +++ /dev/null @@ -1,666 +0,0 @@ -/**************************************************************************//** - * @file uuart_reg.h - * @version V1.00 - * @brief UUART register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UUART_REG_H__ -#define __UUART_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UUART UART Mode of USCI Controller (UUART) - Memory Mapped Structure for UUART Controller -@{ */ - -typedef struct -{ - - - /** - * @var UUART_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller. - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI. - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol. - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var UUART_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt Disabled. - * | | |1 = The transmit start interrupt Enabled. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt Disabled. - * | | |1 = The transmit finish interrupt Enabled. - * |[3] |RXSTIEN |Receive Start Interrupt Enable BIt - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt Disabled. - * | | |1 = The receive start interrupt Enabled. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt Disabled. - * | | |1 = The receive end interrupt Enabled. - * @var UUART_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK = fDIV_CLK. - * | | |01 = fSAMP_CLK = fPROT_CLK. - * | | |10 = fSAMP_CLK = fSCLK. - * | | |11 = fSAMP_CLK = fREF_CLK. - * |[4] |TMCNTEN |Timing Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Timing measurement counter is Disabled. - * | | |1 = Timing measurement counter is Enabled. - * |[5] |TMCNTSRC |Timing Measurement Counter Clock Source Selection - * | | |0 = Timing measurement counter with fPROT_CLK. - * | | |1 = Timing measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK. - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * | | |Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value. - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(UUART_PROTCTL[6])) is enabled. - * | | |The revised value is the average bit time between bit 5 and bit 6. - * | | |The user can use revised CLKDIV and new BRDETITV (UUART_PROTCTL[24:16]) to calculate the precise baud rate. - * @var UUART_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * |[4:3] |EDGEDET |Input Signal Edge Detection Mode - * | | |This bit field selects which edge actives the trigger event of input data signal. - * | | |00 = The trigger event activation is disabled. - * | | |01 = A rising edge activates the trigger event of input data signal. - * | | |10 = A falling edge activates the trigger event of input data signal. - * | | |11 = Both edges activate the trigger event of input data signal. - * | | |Note: In UART function mode, it is suggested to set this bit field as 10. - * @var UUART_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var UUART_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * @var UUART_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT1 pin. - * | | |0 = The value of USCIx_DAT1 is equal to the data shift register. - * | | |1 = The value of USCIx_DAT1 is the inversion of data shift register. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: In UART protocol, the control signal means nRTS signal. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission. - * | | |The data word is always right-aligned in the data buffer. - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * | | |Note: In UART protocol, the length can be configured as 6~13 bits. - * @var UUART_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UUART_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note: RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (UUART_PROTSTS[7:5]). - * @var UUART_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared (filling level is cleared and output pointer is set to input pointer value). - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Error Interrupt Enable Bit - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared (filling level is cleared and output pointer is set to input pointer value). - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note1: It is cleared automatically after one PCLK cycle. - * | | |Note2: It is suggested to check the RXBUSY (UUART_PROTSTS[10]) before this bit will be set to 1. - * @var UUART_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Over-run Error Interrupt Status - * | | |This bit indicates that a receive buffer overrun error event has been detected. - * | | |If RXOVIEN (UUART_BUFCTL[14]) is enabled, the corresponding interrupt request is activated. - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun error event has not been detected. - * | | |1 = A receive buffer overrun error event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty. - * |[9] |TXFULL |Transmit Buffer Full Indicator - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * @var UUART_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * @var UUART_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var UUART_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1. - * | | |Software can write 1 to clear this bit. - * @var UUART_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STOPB |Stop Bits - * | | |This bit defines the number of stop bits in an UART frame. - * | | |0 = The number of stop bits is 1. - * | | |1 = The number of stop bits is 2. - * |[1] |PARITYEN |Parity Enable Bit - * | | |This bit defines the parity bit is enabled in an UART frame. - * | | |0 = The parity bit Disabled. - * | | |1 = The parity bit Enabled. - * |[2] |EVENPARITY|Even Parity Enable Bit - * | | |0 = Odd number of logic 1's is transmitted and checked in each word. - * | | |1 = Even number of logic 1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PARITYEN is set. - * |[3] |RTSAUTOEN |nRTS Auto-flow Control Enable Bit - * | | |When nRTS auto-flow is enabled, if the receiver buffer is full (RXFULL (UUART_BUFSTS[1] =1), the UART will de-assert nRTS signal. - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: This bit has effect only when the RTSAUDIREN is not set. - * |[4] |CTSAUTOEN |nCTS Auto-flow Control Enable Bit - * | | |When nCTS auto-flow is enabled, the UART will send data to external device when nCTS input assert (UART will not send data to device if nCTS input is dis-asserted). - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * |[5] |RTSAUDIREN|nRTS Auto Direction Enable Bit - * | | |When nRTS auto direction is enabled, if the transmitted bytes in the TX buffer is empty, the UART asserted nRTS signal automatically. - * | | |0 = nRTS auto direction control Disabled. - * | | |1 = nRTS auto direction control Enabled. - * | | |Note 1: This bit is used for nRTS auto direction control for RS485. - * | | |Note 2: This bit has effect only when the RTSAUTOEN is not set. - * |[6] |ABREN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note: When the auto - baud rate detect operation finishes, hardware will clear this bit. - * | | |The associated interrupt ABRDETIF (UUART_PROTST[9]) will be generated (If ARBIEN (UUART_PROTIEN [1]) is enabled). - * |[9] |DATWKEN |Data Wake-up Mode Enable Bit - * | | |0 = Data wake-up mode Disabled. - * | | |1 = Data wake-up mode Enabled. - * |[10] |CTSWKEN |nCTS Wake-up Mode Enable Bit - * | | |0 = nCTS wake-up mode Disabled. - * | | |1 = nCTS wake-up mode Enabled. - * |[14:11] |WAKECNT |Wake-up Counter - * | | |These bits field indicate how many clock cycle selected by fPDS_CNT do the slave can get the 1st bit (start bit) when the device is wake-up from Power-down mode. - * |[24:16] |BRDETITV |Baud Rate Detection Interval - * | | |This bit fields indicate how many clock cycle selected by TMCNTSRC (UUART_BRGEN [5]) does the slave calculates the baud rate in one bits. - * | | |The order of the bus shall be 1 and 0 step by step (e.g. - * | | |the input data pattern shall be 0x55). - * | | |The user can read the value to know the current input baud rate of the bus whenever the ABRDETIF (UUART_PROTSTS[9]) is set. - * | | |Note: This bit can be cleared to 0 by software writing '0' to the BRDETITV. - * |[26] |STICKEN |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: Refer to RS-485 Support section for detailed information. - * |[29] |BCEN |Transmit Break Control Enable Bit - * | | |0 = Transmit Break Control Disabled. - * | | |1 = Transmit Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the serial data output (TX) is forced to the Spacing State (logic 0). - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[31] |PROTEN |UART Protocol Enable Bit - * | | |0 = UART Protocol Disabled. - * | | |1 = UART Protocol Enabled. - * @var UUART_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive line status interrupt Disabled. - * | | |1 = Receive line status interrupt Enabled. - * | | |Note: UUART_PROTSTS[7:5] indicates the current interrupt event for receive line status interrupt. - * @var UUART_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = A transmit start interrupt status has not occurred. - * | | |1 = A transmit start interrupt status has occurred. - * | | |Note1: It is cleared by software writing one into this bit. - * | | |Note2: Used for user to load next transmit data when there is no data in transmit buffer. - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = A transmit end interrupt status has not occurred. - * | | |1 = A transmit end interrupt status has occurred. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = A receive start interrupt status has not occurred. - * | | |1 = A receive start interrupt status has occurred. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = A receive finish interrupt status has not occurred. - * | | |1 = A receive finish interrupt status has occurred. - * | | |Note: It is cleared by software writing 1 into this bit. - * |[5] |PARITYERR |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid "parity bit". - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by writing "1" among the BREAK, FRMERR and PARITYERR bits. - * |[6] |FRMERR |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid "stop bit" (that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by writing "1" among the BREAK, FRMERR and PARITYERR bits. - * |[7] |BREAK |Break Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the "spacing state" (logic 0) for longer than a full word transmission time (that is, the total time of "start bit" + data bits + parity + stop bits). - * | | |0 = No Break is generated. - * | | |1 = Break is generated in the receiver bus. - * | | |Note: This bit can be cleared by writing "1" among the BREAK, FRMERR and PARITYERR bits. - * |[9] |ABRDETIF |Auto-baud Rate Interrupt Flag - * | | |This bit is set when auto-baud rate detection is done among the falling edge of the input data. - * | | |If the ABRIEN (UUART_PROTCTL[6]) is set, the auto-baud rate interrupt will be generated. - * | | |This bit can be set 4 times when the input data pattern is 0x55 and it is cleared before the next falling edge of the input bus. - * | | |0 = Auto-baud rate detect function is not done. - * | | |1 = One Bit auto-baud rate detect function is done. - * | | |Note: This bit can be cleared by writing "1" to it. - * |[10] |RXBUSY |RX Bus Status Flag (Read Only) - * | | |This bit indicates the busy status of the receiver. - * | | |0 = The receiver is Idle. - * | | |1 = The receiver is BUSY. - * |[11] |ABERRSTS |Auto-baud Rate Error Status - * | | |This bit is set when auto-baud rate detection counter overrun. - * | | |When the auto-baud rate counter overrun, the user shall revise the CLKDIV (UUART_BRGEN[25:16]) value and enable ABREN (UUART_PROTCTL[6]) to detect the correct baud rate again. - * | | |0 = Auto-baud rate detect counter is not overrun. - * | | |1 = Auto-baud rate detect counter is overrun. - * | | |Note 1: This bit is set at the same time of ABRDETIF. - * | | |Note 2: This bit can be cleared by writing "1" to ABRDETIF or ABERRSTS. - * |[16] |CTSSYNCLV |nCTS Synchronized Level Status (Read Only) - * | | |This bit used to indicate the current status of the internal synchronized nCTS signal. - * | | |0 = The internal synchronized nCTS is low. - * | | |1 = The internal synchronized nCTS is high. - * |[17] |CTSLV |nCTS Pin Status (Read Only) - * | | |This bit used to monitor the current status of nCTS pin input. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - __I uint32_t RESERVE1[3]; - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - __I uint32_t RESERVE2[1]; - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - __I uint32_t RESERVE3[4]; - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} UUART_T; - -/** - @addtogroup UUART_CONST UUART Bit Field Definition - Constant Definitions for UUART Controller -@{ */ - -#define UUART_CTL_FUNMODE_Pos (0) /*!< UUART_T::CTL: FUNMODE Position */ -#define UUART_CTL_FUNMODE_Msk (0x7ul << UUART_CTL_FUNMODE_Pos) /*!< UUART_T::CTL: FUNMODE Mask */ - -#define UUART_INTEN_TXSTIEN_Pos (1) /*!< UUART_T::INTEN: TXSTIEN Position */ -#define UUART_INTEN_TXSTIEN_Msk (0x1ul << UUART_INTEN_TXSTIEN_Pos) /*!< UUART_T::INTEN: TXSTIEN Mask */ - -#define UUART_INTEN_TXENDIEN_Pos (2) /*!< UUART_T::INTEN: TXENDIEN Position */ -#define UUART_INTEN_TXENDIEN_Msk (0x1ul << UUART_INTEN_TXENDIEN_Pos) /*!< UUART_T::INTEN: TXENDIEN Mask */ - -#define UUART_INTEN_RXSTIEN_Pos (3) /*!< UUART_T::INTEN: RXSTIEN Position */ -#define UUART_INTEN_RXSTIEN_Msk (0x1ul << UUART_INTEN_RXSTIEN_Pos) /*!< UUART_T::INTEN: RXSTIEN Mask */ - -#define UUART_INTEN_RXENDIEN_Pos (4) /*!< UUART_T::INTEN: RXENDIEN Position */ -#define UUART_INTEN_RXENDIEN_Msk (0x1ul << UUART_INTEN_RXENDIEN_Pos) /*!< UUART_T::INTEN: RXENDIEN Mask */ - -#define UUART_BRGEN_RCLKSEL_Pos (0) /*!< UUART_T::BRGEN: RCLKSEL Position */ -#define UUART_BRGEN_RCLKSEL_Msk (0x1ul << UUART_BRGEN_RCLKSEL_Pos) /*!< UUART_T::BRGEN: RCLKSEL Mask */ - -#define UUART_BRGEN_PTCLKSEL_Pos (1) /*!< UUART_T::BRGEN: PTCLKSEL Position */ -#define UUART_BRGEN_PTCLKSEL_Msk (0x1ul << UUART_BRGEN_PTCLKSEL_Pos) /*!< UUART_T::BRGEN: PTCLKSEL Mask */ - -#define UUART_BRGEN_SPCLKSEL_Pos (2) /*!< UUART_T::BRGEN: SPCLKSEL Position */ -#define UUART_BRGEN_SPCLKSEL_Msk (0x3ul << UUART_BRGEN_SPCLKSEL_Pos) /*!< UUART_T::BRGEN: SPCLKSEL Mask */ - -#define UUART_BRGEN_TMCNTEN_Pos (4) /*!< UUART_T::BRGEN: TMCNTEN Position */ -#define UUART_BRGEN_TMCNTEN_Msk (0x1ul << UUART_BRGEN_TMCNTEN_Pos) /*!< UUART_T::BRGEN: TMCNTEN Mask */ - -#define UUART_BRGEN_TMCNTSRC_Pos (5) /*!< UUART_T::BRGEN: TMCNTSRC Position */ -#define UUART_BRGEN_TMCNTSRC_Msk (0x1ul << UUART_BRGEN_TMCNTSRC_Pos) /*!< UUART_T::BRGEN: TMCNTSRC Mask */ - -#define UUART_BRGEN_PDSCNT_Pos (8) /*!< UUART_T::BRGEN: PDSCNT Position */ -#define UUART_BRGEN_PDSCNT_Msk (0x3ul << UUART_BRGEN_PDSCNT_Pos) /*!< UUART_T::BRGEN: PDSCNT Mask */ - -#define UUART_BRGEN_DSCNT_Pos (10) /*!< UUART_T::BRGEN: DSCNT Position */ -#define UUART_BRGEN_DSCNT_Msk (0x1ful << UUART_BRGEN_DSCNT_Pos) /*!< UUART_T::BRGEN: DSCNT Mask */ - -#define UUART_BRGEN_CLKDIV_Pos (16) /*!< UUART_T::BRGEN: CLKDIV Position */ -#define UUART_BRGEN_CLKDIV_Msk (0x3fful << UUART_BRGEN_CLKDIV_Pos) /*!< UUART_T::BRGEN: CLKDIV Mask */ - -#define UUART_DATIN0_SYNCSEL_Pos (0) /*!< UUART_T::DATIN0: SYNCSEL Position */ -#define UUART_DATIN0_SYNCSEL_Msk (0x1ul << UUART_DATIN0_SYNCSEL_Pos) /*!< UUART_T::DATIN0: SYNCSEL Mask */ - -#define UUART_DATIN0_ININV_Pos (2) /*!< UUART_T::DATIN0: ININV Position */ -#define UUART_DATIN0_ININV_Msk (0x1ul << UUART_DATIN0_ININV_Pos) /*!< UUART_T::DATIN0: ININV Mask */ - -#define UUART_DATIN0_EDGEDET_Pos (3) /*!< UUART_T::DATIN0: EDGEDET Position */ -#define UUART_DATIN0_EDGEDET_Msk (0x3ul << UUART_DATIN0_EDGEDET_Pos) /*!< UUART_T::DATIN0: EDGEDET Mask */ - -#define UUART_CTLIN0_SYNCSEL_Pos (0) /*!< UUART_T::CTLIN0: SYNCSEL Position */ -#define UUART_CTLIN0_SYNCSEL_Msk (0x1ul << UUART_CTLIN0_SYNCSEL_Pos) /*!< UUART_T::CTLIN0: SYNCSEL Mask */ - -#define UUART_CTLIN0_ININV_Pos (2) /*!< UUART_T::CTLIN0: ININV Position */ -#define UUART_CTLIN0_ININV_Msk (0x1ul << UUART_CTLIN0_ININV_Pos) /*!< UUART_T::CTLIN0: ININV Mask */ - -#define UUART_CLKIN_SYNCSEL_Pos (0) /*!< UUART_T::CLKIN: SYNCSEL Position */ -#define UUART_CLKIN_SYNCSEL_Msk (0x1ul << UUART_CLKIN_SYNCSEL_Pos) /*!< UUART_T::CLKIN: SYNCSEL Mask */ - -#define UUART_LINECTL_LSB_Pos (0) /*!< UUART_T::LINECTL: LSB Position */ -#define UUART_LINECTL_LSB_Msk (0x1ul << UUART_LINECTL_LSB_Pos) /*!< UUART_T::LINECTL: LSB Mask */ - -#define UUART_LINECTL_DATOINV_Pos (5) /*!< UUART_T::LINECTL: DATOINV Position */ -#define UUART_LINECTL_DATOINV_Msk (0x1ul << UUART_LINECTL_DATOINV_Pos) /*!< UUART_T::LINECTL: DATOINV Mask */ - -#define UUART_LINECTL_CTLOINV_Pos (7) /*!< UUART_T::LINECTL: CTLOINV Position */ -#define UUART_LINECTL_CTLOINV_Msk (0x1ul << UUART_LINECTL_CTLOINV_Pos) /*!< UUART_T::LINECTL: CTLOINV Mask */ - -#define UUART_LINECTL_DWIDTH_Pos (8) /*!< UUART_T::LINECTL: DWIDTH Position */ -#define UUART_LINECTL_DWIDTH_Msk (0xful << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_T::LINECTL: DWIDTH Mask */ - -#define UUART_TXDAT_TXDAT_Pos (0) /*!< UUART_T::TXDAT: TXDAT Position */ -#define UUART_TXDAT_TXDAT_Msk (0xfffful << UUART_TXDAT_TXDAT_Pos) /*!< UUART_T::TXDAT: TXDAT Mask */ - -#define UUART_RXDAT_RXDAT_Pos (0) /*!< UUART_T::RXDAT: RXDAT Position */ -#define UUART_RXDAT_RXDAT_Msk (0xfffful << UUART_RXDAT_RXDAT_Pos) /*!< UUART_T::RXDAT: RXDAT Mask */ - -#define UUART_BUFCTL_TXCLR_Pos (7) /*!< UUART_T::BUFCTL: TXCLR Position */ -#define UUART_BUFCTL_TXCLR_Msk (0x1ul << UUART_BUFCTL_TXCLR_Pos) /*!< UUART_T::BUFCTL: TXCLR Mask */ - -#define UUART_BUFCTL_RXOVIEN_Pos (14) /*!< UUART_T::BUFCTL: RXOVIEN Position */ -#define UUART_BUFCTL_RXOVIEN_Msk (0x1ul << UUART_BUFCTL_RXOVIEN_Pos) /*!< UUART_T::BUFCTL: RXOVIEN Mask */ - -#define UUART_BUFCTL_RXCLR_Pos (15) /*!< UUART_T::BUFCTL: RXCLR Position */ -#define UUART_BUFCTL_RXCLR_Msk (0x1ul << UUART_BUFCTL_RXCLR_Pos) /*!< UUART_T::BUFCTL: RXCLR Mask */ - -#define UUART_BUFCTL_TXRST_Pos (16) /*!< UUART_T::BUFCTL: TXRST Position */ -#define UUART_BUFCTL_TXRST_Msk (0x1ul << UUART_BUFCTL_TXRST_Pos) /*!< UUART_T::BUFCTL: TXRST Mask */ - -#define UUART_BUFCTL_RXRST_Pos (17) /*!< UUART_T::BUFCTL: RXRST Position */ -#define UUART_BUFCTL_RXRST_Msk (0x1ul << UUART_BUFCTL_RXRST_Pos) /*!< UUART_T::BUFCTL: RXRST Mask */ - -#define UUART_BUFSTS_RXEMPTY_Pos (0) /*!< UUART_T::BUFSTS: RXEMPTY Position */ -#define UUART_BUFSTS_RXEMPTY_Msk (0x1ul << UUART_BUFSTS_RXEMPTY_Pos) /*!< UUART_T::BUFSTS: RXEMPTY Mask */ - -#define UUART_BUFSTS_RXFULL_Pos (1) /*!< UUART_T::BUFSTS: RXFULL Position */ -#define UUART_BUFSTS_RXFULL_Msk (0x1ul << UUART_BUFSTS_RXFULL_Pos) /*!< UUART_T::BUFSTS: RXFULL Mask */ - -#define UUART_BUFSTS_RXOVIF_Pos (3) /*!< UUART_T::BUFSTS: RXOVIF Position */ -#define UUART_BUFSTS_RXOVIF_Msk (0x1ul << UUART_BUFSTS_RXOVIF_Pos) /*!< UUART_T::BUFSTS: RXOVIF Mask */ - -#define UUART_BUFSTS_TXEMPTY_Pos (8) /*!< UUART_T::BUFSTS: TXEMPTY Position */ -#define UUART_BUFSTS_TXEMPTY_Msk (0x1ul << UUART_BUFSTS_TXEMPTY_Pos) /*!< UUART_T::BUFSTS: TXEMPTY Mask */ - -#define UUART_BUFSTS_TXFULL_Pos (9) /*!< UUART_T::BUFSTS: TXFULL Position */ -#define UUART_BUFSTS_TXFULL_Msk (0x1ul << UUART_BUFSTS_TXFULL_Pos) /*!< UUART_T::BUFSTS: TXFULL Mask */ - -#define UUART_PDMACTL_PDMARST_Pos (0) /*!< UUART_T::PDMACTL: PDMARST Position */ -#define UUART_PDMACTL_PDMARST_Msk (0x1ul << UUART_PDMACTL_PDMARST_Pos) /*!< UUART_T::PDMACTL: PDMARST Mask */ - -#define UUART_PDMACTL_TXPDMAEN_Pos (1) /*!< UUART_T::PDMACTL: TXPDMAEN Position*/ -#define UUART_PDMACTL_TXPDMAEN_Msk (0x1ul << UUART_PDMACTL_TXPDMAEN_Pos) /*!< UUART_T::PDMACTL: TXPDMAEN Mask */ - -#define UUART_PDMACTL_RXPDMAEN_Pos (2) /*!< UUART_T::PDMACTL: RXPDMAEN Position*/ -#define UUART_PDMACTL_RXPDMAEN_Msk (0x1ul << UUART_PDMACTL_RXPDMAEN_Pos) /*!< UUART_T::PDMACTL: RXPDMAEN Mask */ - -#define UUART_PDMACTL_PDMAEN_Pos (3) /*!< UUART_T::PDMACTL: PDMAEN Position */ -#define UUART_PDMACTL_PDMAEN_Msk (0x1ul << UUART_PDMACTL_PDMAEN_Pos) /*!< UUART_T::PDMACTL: PDMAEN Mask */ - -#define UUART_WKCTL_WKEN_Pos (0) /*!< UUART_T::WKCTL: WKEN Position */ -#define UUART_WKCTL_WKEN_Msk (0x1ul << UUART_WKCTL_WKEN_Pos) /*!< UUART_T::WKCTL: WKEN Mask */ - -#define UUART_WKCTL_PDBOPT_Pos (2) /*!< UUART_T::WKCTL: PDBOPT Position */ -#define UUART_WKCTL_PDBOPT_Msk (0x1ul << UUART_WKCTL_PDBOPT_Pos) /*!< UUART_T::WKCTL: PDBOPT Mask */ - -#define UUART_WKSTS_WKF_Pos (0) /*!< UUART_T::WKSTS: WKF Position */ -#define UUART_WKSTS_WKF_Msk (0x1ul << UUART_WKSTS_WKF_Pos) /*!< UUART_T::WKSTS: WKF Mask */ - -#define UUART_PROTCTL_STOPB_Pos (0) /*!< UUART_T::PROTCTL: STOPB Position */ -#define UUART_PROTCTL_STOPB_Msk (0x1ul << UUART_PROTCTL_STOPB_Pos) /*!< UUART_T::PROTCTL: STOPB Mask */ - -#define UUART_PROTCTL_PARITYEN_Pos (1) /*!< UUART_T::PROTCTL: PARITYEN Position*/ -#define UUART_PROTCTL_PARITYEN_Msk (0x1ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_T::PROTCTL: PARITYEN Mask */ - -#define UUART_PROTCTL_EVENPARITY_Pos (2) /*!< UUART_T::PROTCTL: EVENPARITY Position*/ -#define UUART_PROTCTL_EVENPARITY_Msk (0x1ul << UUART_PROTCTL_EVENPARITY_Pos) /*!< UUART_T::PROTCTL: EVENPARITY Mask */ - -#define UUART_PROTCTL_RTSAUTOEN_Pos (3) /*!< UUART_T::PROTCTL: RTSAUTOEN Position*/ -#define UUART_PROTCTL_RTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_RTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: RTSAUTOEN Mask */ - -#define UUART_PROTCTL_CTSAUTOEN_Pos (4) /*!< UUART_T::PROTCTL: CTSAUTOEN Position*/ -#define UUART_PROTCTL_CTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_CTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: CTSAUTOEN Mask */ - -#define UUART_PROTCTL_RTSAUDIREN_Pos (5) /*!< UUART_T::PROTCTL: RTSAUDIREN Position*/ -#define UUART_PROTCTL_RTSAUDIREN_Msk (0x1ul << UUART_PROTCTL_RTSAUDIREN_Pos) /*!< UUART_T::PROTCTL: RTSAUDIREN Mask */ - -#define UUART_PROTCTL_ABREN_Pos (6) /*!< UUART_T::PROTCTL: ABREN Position */ -#define UUART_PROTCTL_ABREN_Msk (0x1ul << UUART_PROTCTL_ABREN_Pos) /*!< UUART_T::PROTCTL: ABREN Mask */ - -#define UUART_PROTCTL_DATWKEN_Pos (9) /*!< UUART_T::PROTCTL: DATWKEN Position */ -#define UUART_PROTCTL_DATWKEN_Msk (0x1ul << UUART_PROTCTL_DATWKEN_Pos) /*!< UUART_T::PROTCTL: DATWKEN Mask */ - -#define UUART_PROTCTL_CTSWKEN_Pos (10) /*!< UUART_T::PROTCTL: CTSWKEN Position */ -#define UUART_PROTCTL_CTSWKEN_Msk (0x1ul << UUART_PROTCTL_CTSWKEN_Pos) /*!< UUART_T::PROTCTL: CTSWKEN Mask */ - -#define UUART_PROTCTL_WAKECNT_Pos (11) /*!< UUART_T::PROTCTL: WAKECNT Position */ -#define UUART_PROTCTL_WAKECNT_Msk (0xful << UUART_PROTCTL_WAKECNT_Pos) /*!< UUART_T::PROTCTL: WAKECNT Mask */ - -#define UUART_PROTCTL_BRDETITV_Pos (16) /*!< UUART_T::PROTCTL: BRDETITV Position*/ -#define UUART_PROTCTL_BRDETITV_Msk (0x1fful << UUART_PROTCTL_BRDETITV_Pos) /*!< UUART_T::PROTCTL: BRDETITV Mask */ - -#define UUART_PROTCTL_STICKEN_Pos (26) /*!< UUART_T::PROTCTL: STICKEN Position */ -#define UUART_PROTCTL_STICKEN_Msk (0x1ul << UUART_PROTCTL_STICKEN_Pos) /*!< UUART_T::PROTCTL: STICKEN Mask */ - -#define UUART_PROTCTL_BCEN_Pos (29) /*!< UUART_T::PROTCTL: BCEN Position */ -#define UUART_PROTCTL_BCEN_Msk (0x1ul << UUART_PROTCTL_BCEN_Pos) /*!< UUART_T::PROTCTL: BCEN Mask */ - -#define UUART_PROTCTL_PROTEN_Pos (31) /*!< UUART_T::PROTCTL: PROTEN Position */ -#define UUART_PROTCTL_PROTEN_Msk (0x1ul << UUART_PROTCTL_PROTEN_Pos) /*!< UUART_T::PROTCTL: PROTEN Mask */ - -#define UUART_PROTIEN_ABRIEN_Pos (1) /*!< UUART_T::PROTIEN: ABRIEN Position */ -#define UUART_PROTIEN_ABRIEN_Msk (0x1ul << UUART_PROTIEN_ABRIEN_Pos) /*!< UUART_T::PROTIEN: ABRIEN Mask */ - -#define UUART_PROTIEN_RLSIEN_Pos (2) /*!< UUART_T::PROTIEN: RLSIEN Position */ -#define UUART_PROTIEN_RLSIEN_Msk (0x1ul << UUART_PROTIEN_RLSIEN_Pos) /*!< UUART_T::PROTIEN: RLSIEN Mask */ - -#define UUART_PROTSTS_TXSTIF_Pos (1) /*!< UUART_T::PROTSTS: TXSTIF Position */ -#define UUART_PROTSTS_TXSTIF_Msk (0x1ul << UUART_PROTSTS_TXSTIF_Pos) /*!< UUART_T::PROTSTS: TXSTIF Mask */ - -#define UUART_PROTSTS_TXENDIF_Pos (2) /*!< UUART_T::PROTSTS: TXENDIF Position */ -#define UUART_PROTSTS_TXENDIF_Msk (0x1ul << UUART_PROTSTS_TXENDIF_Pos) /*!< UUART_T::PROTSTS: TXENDIF Mask */ - -#define UUART_PROTSTS_RXSTIF_Pos (3) /*!< UUART_T::PROTSTS: RXSTIF Position */ -#define UUART_PROTSTS_RXSTIF_Msk (0x1ul << UUART_PROTSTS_RXSTIF_Pos) /*!< UUART_T::PROTSTS: RXSTIF Mask */ - -#define UUART_PROTSTS_RXENDIF_Pos (4) /*!< UUART_T::PROTSTS: RXENDIF Position */ -#define UUART_PROTSTS_RXENDIF_Msk (0x1ul << UUART_PROTSTS_RXENDIF_Pos) /*!< UUART_T::PROTSTS: RXENDIF Mask */ - -#define UUART_PROTSTS_PARITYERR_Pos (5) /*!< UUART_T::PROTSTS: PARITYERR Position*/ -#define UUART_PROTSTS_PARITYERR_Msk (0x1ul << UUART_PROTSTS_PARITYERR_Pos) /*!< UUART_T::PROTSTS: PARITYERR Mask */ - -#define UUART_PROTSTS_FRMERR_Pos (6) /*!< UUART_T::PROTSTS: FRMERR Position */ -#define UUART_PROTSTS_FRMERR_Msk (0x1ul << UUART_PROTSTS_FRMERR_Pos) /*!< UUART_T::PROTSTS: FRMERR Mask */ - -#define UUART_PROTSTS_BREAK_Pos (7) /*!< UUART_T::PROTSTS: BREAK Position */ -#define UUART_PROTSTS_BREAK_Msk (0x1ul << UUART_PROTSTS_BREAK_Pos) /*!< UUART_T::PROTSTS: BREAK Mask */ - -#define UUART_PROTSTS_ABRDETIF_Pos (9) /*!< UUART_T::PROTSTS: ABRDETIF Position*/ -#define UUART_PROTSTS_ABRDETIF_Msk (0x1ul << UUART_PROTSTS_ABRDETIF_Pos) /*!< UUART_T::PROTSTS: ABRDETIF Mask */ - -#define UUART_PROTSTS_RXBUSY_Pos (10) /*!< UUART_T::PROTSTS: RXBUSY Position */ -#define UUART_PROTSTS_RXBUSY_Msk (0x1ul << UUART_PROTSTS_RXBUSY_Pos) /*!< UUART_T::PROTSTS: RXBUSY Mask */ - -#define UUART_PROTSTS_ABERRSTS_Pos (11) /*!< UUART_T::PROTSTS: ABERRSTS Position*/ -#define UUART_PROTSTS_ABERRSTS_Msk (0x1ul << UUART_PROTSTS_ABERRSTS_Pos) /*!< UUART_T::PROTSTS: ABERRSTS Mask */ - -#define UUART_PROTSTS_CTSSYNCLV_Pos (16) /*!< UUART_T::PROTSTS: CTSSYNCLV Position*/ -#define UUART_PROTSTS_CTSSYNCLV_Msk (0x1ul << UUART_PROTSTS_CTSSYNCLV_Pos) /*!< UUART_T::PROTSTS: CTSSYNCLV Mask */ - -#define UUART_PROTSTS_CTSLV_Pos (17) /*!< UUART_T::PROTSTS: CTSLV Position */ -#define UUART_PROTSTS_CTSLV_Msk (0x1ul << UUART_PROTSTS_CTSLV_Pos) /*!< UUART_T::PROTSTS: CTSLV Mask */ - -/**@}*/ /* UUART_CONST */ -/**@}*/ /* end of UUART register group */ - - -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __UUART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wdt_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wdt_reg.h deleted file mode 100644 index 89eba1f6e0c..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wdt_reg.h +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************//** - * @file wdt_reg.h - * @version V1.00 - * @brief WDT register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WDT_REG_H__ -#define __WDT_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup WDT Watch Dog Timer Controller(WDT) - Memory Mapped Structure for WDT Controller -@{ */ - -typedef struct -{ - - /** - * @var WDT_T::CTL - * Offset: 0x00 WDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RSTEN |WDT Time-out Reset Enable Bit (Write Protect) - * | | |Setting this bit will enable the WDT time-out reset function If the WDT up counter value has not been cleared after the specific WDT reset delay period expires. - * | | |0 = WDT time-out reset function Disabled. - * | | |1 = WDT time-out reset function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |RSTF |WDT Time-out Reset Flag - * | | |This bit indicates the system has been reset by WDT time-out reset or not. - * | | |0 = WDT time-out reset did not occur. - * | | |1 = WDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |IF |WDT Time-out Interrupt Flag - * | | |This bit will set to 1 while WDT up counter value reaches the selected WDT time-out interval. - * | | |0 = WDT time-out interrupt did not occur. - * | | |1 = WDT time-out interrupt occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[4] |WKEN |WDT Time-out Wake-up Function Control (Write Protect) - * | | |If this bit is set to 1, while WDT time-out interrupt flag IF (WDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (WDT_CTL[6]) is enabled, the WDT time-out interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event Disabled if WDT time-out interrupt signal generated. - * | | |1 = Wake-up trigger event Enabled if WDT time-out interrupt signal generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Chip can be woken up by WDT time-out interrupt signal generated only if WDT clock source is selected to 10 kHz internal low speed RC oscillator (LIRC) or LXT. - * |[5] |WKF |WDT Time-out Wake-up Flag (Write Protect) - * | | |This bit indicates the interrupt wake-up flag status of WDT. - * | | |0 = WDT does not cause chip wake-up. - * | | |1 = Chip wake-up from Idle or Power-down mode if WDT time-out interrupt signal generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[6] |INTEN |WDT Time-out Interrupt Enable Bit (Write Protect) - * | | |If this bit is enabled, the WDT time-out interrupt signal is generated and inform to CPU. - * | | |0 = WDT time-out interrupt Disabled. - * | | |1 = WDT time-out interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |WDTEN |WDT Enable Bit (Write Protect) - * | | |0 = WDT Disabled (This action will reset the internal up counter value). - * | | |1 = WDT Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: If CWDTEN[2:0] (combined by Config0[31] and Config0[4:3]) bits is not configured to 111, this bit is forced as 1 and user cannot change this bit to 0. - * |[11:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect) - * | | |These four bits select the time-out interval period for the WDT. - * | | |0000 = 24 * WDT_CLK. - * | | |0001 = 26 * WDT_CLK. - * | | |0010 = 28 * WDT_CLK. - * | | |0011 = 210 * WDT_CLK. - * | | |0100 = 212 * WDT_CLK. - * | | |0101 = 214 * WDT_CLK. - * | | |0110 = 216 * WDT_CLK. - * | | |0111 = 218 * WDT_CLK. - * | | |1000 = 220 * WDT_CLK. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[30] |SYNC |WDT Enable Control SYNC Flag Indicator (Read Only) - * | | |If user executes enable/disable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is completed or not. - * | | |0 = Set WDTEN bit is completed. - * | | |1 = Set WDTEN bit is synchronizing and not become active yet. - * | | |Note: Performing enable or disable WDTEN bit needs 2 * WDT_CLK period to become active. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement affects WDT counting. - * | | |WDT up counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |WDT up counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var WDT_T::ALTCTL - * Offset: 0x04 WDT Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RSTDSEL |WDT Reset Delay Selection (Write Protect). - * | | |When WDT time-out happened, user has a time named WDT Reset Delay Period to clear WDT counter by writing 0x00005aa5 to RSTCNT (WDT_RSTCNT[31:0]) to prevent WDT time-out reset happened. - * | | |User can select a suitable setting of RSTDSEL for different WDT Reset Delay Period. - * | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK. - * | | |01 = WDT Reset Delay Period is 130 * WDT_CLK. - * | | |10 = WDT Reset Delay Period is 18 * WDT_CLK. - * | | |11 = WDT Reset Delay Period is 3 * WDT_CLK. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This register will be reset to 0 if WDT time-out reset happened. - * @var WDT_T::RSTCNT - * Offset: 0x08 WDT Reset Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RSTCNT |WDT Reset Counter Register - * | | |Writing 0x00005AA5 to this field will reset the internal 18-bit WDT up counter value to 0. - * | | |Note1: Performing RSTCNT to reset counter needs 2 * WDT_CLK period to become active. - */ - __IO uint32_t CTL; /*!< [0x0000] WDT Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0004] WDT Alternative Control Register */ - __O uint32_t RSTCNT; /*!< [0x0008] WDT Reset Counter Register */ - -} WDT_T; - -/** - @addtogroup WDT_CONST WDT Bit Field Definition - Constant Definitions for WDT Controller -@{ */ - -#define WDT_CTL_RSTEN_Pos (1) /*!< WDT_T::CTL: RSTEN Position */ -#define WDT_CTL_RSTEN_Msk (0x1ul << WDT_CTL_RSTEN_Pos) /*!< WDT_T::CTL: RSTEN Mask */ - -#define WDT_CTL_RSTF_Pos (2) /*!< WDT_T::CTL: RSTF Position */ -#define WDT_CTL_RSTF_Msk (0x1ul << WDT_CTL_RSTF_Pos) /*!< WDT_T::CTL: RSTF Mask */ - -#define WDT_CTL_IF_Pos (3) /*!< WDT_T::CTL: IF Position */ -#define WDT_CTL_IF_Msk (0x1ul << WDT_CTL_IF_Pos) /*!< WDT_T::CTL: IF Mask */ - -#define WDT_CTL_WKEN_Pos (4) /*!< WDT_T::CTL: WKEN Position */ -#define WDT_CTL_WKEN_Msk (0x1ul << WDT_CTL_WKEN_Pos) /*!< WDT_T::CTL: WKEN Mask */ - -#define WDT_CTL_WKF_Pos (5) /*!< WDT_T::CTL: WKF Position */ -#define WDT_CTL_WKF_Msk (0x1ul << WDT_CTL_WKF_Pos) /*!< WDT_T::CTL: WKF Mask */ - -#define WDT_CTL_INTEN_Pos (6) /*!< WDT_T::CTL: INTEN Position */ -#define WDT_CTL_INTEN_Msk (0x1ul << WDT_CTL_INTEN_Pos) /*!< WDT_T::CTL: INTEN Mask */ - -#define WDT_CTL_WDTEN_Pos (7) /*!< WDT_T::CTL: WDTEN Position */ -#define WDT_CTL_WDTEN_Msk (0x1ul << WDT_CTL_WDTEN_Pos) /*!< WDT_T::CTL: WDTEN Mask */ - -#define WDT_CTL_TOUTSEL_Pos (8) /*!< WDT_T::CTL: TOUTSEL Position */ -#define WDT_CTL_TOUTSEL_Msk (0xful << WDT_CTL_TOUTSEL_Pos) /*!< WDT_T::CTL: TOUTSEL Mask */ - -#define WDT_CTL_SYNC_Pos (30) /*!< WDT_T::CTL: SYNC Position */ -#define WDT_CTL_SYNC_Msk (0x1ul << WDT_CTL_SYNC_Pos) /*!< WDT_T::CTL: SYNC Mask */ - -#define WDT_CTL_ICEDEBUG_Pos (31) /*!< WDT_T::CTL: ICEDEBUG Position */ -#define WDT_CTL_ICEDEBUG_Msk (0x1ul << WDT_CTL_ICEDEBUG_Pos) /*!< WDT_T::CTL: ICEDEBUG Mask */ - -#define WDT_ALTCTL_RSTDSEL_Pos (0) /*!< WDT_T::ALTCTL: RSTDSEL Position */ -#define WDT_ALTCTL_RSTDSEL_Msk (0x3ul << WDT_ALTCTL_RSTDSEL_Pos) /*!< WDT_T::ALTCTL: RSTDSEL Mask */ - -#define WDT_RSTCNT_RSTCNT_Pos (0) /*!< WDT_T::RSTCNT: RSTCNT Position */ -#define WDT_RSTCNT_RSTCNT_Msk (0xfffffffful << WDT_RSTCNT_RSTCNT_Pos) /*!< WDT_T::RSTCNT: RSTCNT Mask */ - -/**@}*/ /* WDT_CONST */ -/**@}*/ /* end of WDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __WDT_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wwdt_reg.h b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wwdt_reg.h deleted file mode 100644 index 0b01cc6b8a7..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Include/wwdt_reg.h +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************//** - * @file wwdt_reg.h - * @version V1.00 - * @brief WWDT register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WWDT_REG_H__ -#define __WWDT_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup WWDT Window Watchdog Timer(WWDT) - Memory Mapped Structure for WWDT Controller -@{ */ - -typedef struct -{ - - - /** - * @var WWDT_T::RLDCNT - * Offset: 0x00 WWDT Reload Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RLDCNT |WWDT Reload Counter Register - * | | |Writing 0x00005AA5 to this register will reload the WWDT counter value to 0x3F. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT (WWDT_CTL[21:16]). - * | | |If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, WWDT reset signal will be generated immediately. - * @var WWDT_T::CTL - * Offset: 0x04 WWDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTEN |WWDT Enable Bit - * | | |0 = WWDT counter is stopped. - * | | |1 = WWDT counter starts counting. - * |[1] |INTEN |WWDT Interrupt Enable Bit - * | | |If this bit is enabled, the WWDT counter compare match interrupt signal is generated and inform to CPU. - * | | |0 = WWDT counter compare match interrupt Disabled. - * | | |1 = WWDT counter compare match interrupt Enabled. - * |[11:8] |PSCSEL |WWDT Counter Prescale Period Selection - * | | |0000 = Pre-scale is 1; Max time-out period is 1 * 64 * WWDT_CLK. - * | | |0001 = Pre-scale is 2; Max time-out period is 2 * 64 * WWDT_CLK. - * | | |0010 = Pre-scale is 4; Max time-out period is 4 * 64 * WWDT_CLK. - * | | |0011 = Pre-scale is 8; Max time-out period is 8 * 64 * WWDT_CLK. - * | | |0100 = Pre-scale is 16; Max time-out period is 16 * 64 * WWDT_CLK. - * | | |0101 = Pre-scale is 32; Max time-out period is 32 * 64 * WWDT_CLK. - * | | |0110 = Pre-scale is 64; Max time-out period is 64 * 64 * WWDT_CLK. - * | | |0111 = Pre-scale is 128; Max time-out period is 128 * 64 * WWDT_CLK. - * | | |1000 = Pre-scale is 192; Max time-out period is 192 * 64 * WWDT_CLK. - * | | |1001 = Pre-scale is 256; Max time-out period is 256 * 64 * WWDT_CLK. - * | | |1010 = Pre-scale is 384; Max time-out period is 384 * 64 * WWDT_CLK. - * | | |1011 = Pre-scale is 512; Max time-out period is 512 * 64 * WWDT_CLK. - * | | |1100 = Pre-scale is 768; Max time-out period is 768 * 64 * WWDT_CLK. - * | | |1101 = Pre-scale is 1024; Max time-out period is 1024 * 64 * WWDT_CLK. - * | | |1110 = Pre-scale is 1536; Max time-out period is 1536 * 64 * WWDT_CLK. - * | | |1111 = Pre-scale is 2048; Max time-out period is 2048 * 64 * WWDT_CLK. - * |[21:16] |CMPDAT |WWDT Window Compare Register - * | | |Set this register to adjust the valid reload window. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT. - * | | |If user writes WWDT_RLDCNT register when current WWDT counter value larger than CMPDAT, WWDT reset signal will generate immediately. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit - * | | |0 = ICE debug mode acknowledgement effects WWDT counting. - * | | |WWDT down counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |Note: WWDT down counter will keep going no matter CPU is held by ICE or not. - * @var WWDT_T::STATUS - * Offset: 0x08 WWDT Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTIF |WWDT Compare Match Interrupt Flag - * | | |This bit indicates the interrupt flag status of WWDT while WWDT counter value matches CMPDAT (WWDT_CTL[21:16]). - * | | |0 = No effect. - * | | |1 = WWDT counter value matches CMPDAT. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WWDTRF |WWDT Timer-out Reset Flag - * | | |This bit indicates the system has been reset by WWDT time-out reset or not. - * | | |0 = WWDT time-out reset did not occur. - * | | |1 = WWDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var WWDT_T::CNT - * Offset: 0x0C WWDT Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CNTDAT |WWDT Counter Value - * | | |CNTDAT will be updated continuously to monitor 6-bit WWDT down counter value. - */ - __O uint32_t RLDCNT; /*!< [0x0000] WWDT Reload Counter Register */ - __IO uint32_t CTL; /*!< [0x0004] WWDT Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] WWDT Status Register */ - __I uint32_t CNT; /*!< [0x000c] WWDT Counter Value Register */ - -} WWDT_T; - -/** - @addtogroup WWDT_CONST WWDT Bit Field Definition - Constant Definitions for WWDT Controller -@{ */ - -#define WWDT_RLDCNT_RLDCNT_Pos (0) /*!< WWDT_T::RLDCNT: RLDCNT Position */ -#define WWDT_RLDCNT_RLDCNT_Msk (0xfffffffful << WWDT_RLDCNT_RLDCNT_Pos) /*!< WWDT_T::RLDCNT: RLDCNT Mask */ - -#define WWDT_CTL_WWDTEN_Pos (0) /*!< WWDT_T::CTL: WWDTEN Position */ -#define WWDT_CTL_WWDTEN_Msk (0x1ul << WWDT_CTL_WWDTEN_Pos) /*!< WWDT_T::CTL: WWDTEN Mask */ - -#define WWDT_CTL_INTEN_Pos (1) /*!< WWDT_T::CTL: INTEN Position */ -#define WWDT_CTL_INTEN_Msk (0x1ul << WWDT_CTL_INTEN_Pos) /*!< WWDT_T::CTL: INTEN Mask */ - -#define WWDT_CTL_PSCSEL_Pos (8) /*!< WWDT_T::CTL: PSCSEL Position */ -#define WWDT_CTL_PSCSEL_Msk (0xful << WWDT_CTL_PSCSEL_Pos) /*!< WWDT_T::CTL: PSCSEL Mask */ - -#define WWDT_CTL_CMPDAT_Pos (16) /*!< WWDT_T::CTL: CMPDAT Position */ -#define WWDT_CTL_CMPDAT_Msk (0x3ful << WWDT_CTL_CMPDAT_Pos) /*!< WWDT_T::CTL: CMPDAT Mask */ - -#define WWDT_CTL_ICEDEBUG_Pos (31) /*!< WWDT_T::CTL: ICEDEBUG Position */ -#define WWDT_CTL_ICEDEBUG_Msk (0x1ul << WWDT_CTL_ICEDEBUG_Pos) /*!< WWDT_T::CTL: ICEDEBUG Mask */ - -#define WWDT_STATUS_WWDTIF_Pos (0) /*!< WWDT_T::STATUS: WWDTIF Position */ -#define WWDT_STATUS_WWDTIF_Msk (0x1ul << WWDT_STATUS_WWDTIF_Pos) /*!< WWDT_T::STATUS: WWDTIF Mask */ - -#define WWDT_STATUS_WWDTRF_Pos (1) /*!< WWDT_T::STATUS: WWDTRF Position */ -#define WWDT_STATUS_WWDTRF_Msk (0x1ul << WWDT_STATUS_WWDTRF_Pos) /*!< WWDT_T::STATUS: WWDTRF Mask */ - -#define WWDT_CNT_CNTDAT_Pos (0) /*!< WWDT_T::CNT: CNTDAT Position */ -#define WWDT_CNT_CNTDAT_Msk (0x3ful << WWDT_CNT_CNTDAT_Pos) /*!< WWDT_T::CNT: CNTDAT Mask */ - -/**@}*/ /* WWDT_CONST */ -/**@}*/ /* end of WWDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __WWDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/ARM/startup_M031Series.s b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/ARM/startup_M031Series.s deleted file mode 100644 index 843ca6e0878..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/ARM/startup_M031Series.s +++ /dev/null @@ -1,259 +0,0 @@ -;/**************************************************************************//** -; * @file startup_m031series.s -; * @version V2.00 -; * $Revision: 4 $ -; * $Date: 18/04/02 4:02p $ -; * @brief M031 Series Startup Source File -; * -; * @note -; * SPDX-License-Identifier: Apache-2.0 -; * Copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -; * -; ******************************************************************************/ - IF :LNOT: :DEF: Stack_Size -Stack_Size EQU 0x00002000 - ENDIF - - AREA |.STACK|, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - IF :LNOT: :DEF: Heap_Size -Heap_Size EQU 0x00000000 - ENDIF - 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 g_pfnVectors - -g_pfnVectors DCD __initial_sp ; Top of Stack - DCD Reset_Handler ; Reset Handler - DCD NMI_Handler ; NMI Handler - DCD HardFault_Handler ; Hard Fault Handler - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD SVC_Handler ; SVCall Handler - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD PendSV_Handler ; PendSV Handler - DCD SysTick_Handler ; SysTick Handler - - ; External Interrupts - ; maximum of 32 External Interrupts are possible - DCD BOD_IRQHandler - DCD WDT_IRQHandler - DCD EINT024_IRQHandler - DCD EINT135_IRQHandler - DCD GPABGH_IRQHandler - DCD GPCDEF_IRQHandler - DCD PWM0_IRQHandler - DCD PWM1_IRQHandler - DCD TMR0_IRQHandler - DCD TMR1_IRQHandler - DCD TMR2_IRQHandler - DCD TMR3_IRQHandler - DCD UART02_IRQHandler - DCD UART13_IRQHandler - DCD SPI0_IRQHandler - DCD QSPI0_IRQHandler - DCD ISP_IRQHandler - DCD UART57_IRQHandler - DCD I2C0_IRQHandler - DCD I2C1_IRQHandler - DCD BPWM0_IRQHandler - DCD BPWM1_IRQHandler - DCD USCI01_IRQHandler - DCD USBD_IRQHandler - DCD Default_Handler - DCD ACMP01_IRQHandler - DCD PDMA_IRQHandler - DCD UART46_IRQHandler - DCD PWRWU_IRQHandler - DCD ADC_IRQHandler - DCD CKFAIL_IRQHandler - DCD RTC_IRQHandler - - - - AREA |.text|, CODE, READONLY - - - -; Reset Handler -Reset_Handler PROC - EXPORT Reset_Handler [WEAK] - IMPORT SystemInit - IMPORT __main - - - LDR R0, =0x40000100 - ; Unlock Register - - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - ; Init POR - LDR R2, =0x40000024 - LDR R1, =0x00005AA5 - STR R1, [R2] - - ; Init LDO_RDY - LDR R2, =0x40000280 - LDR R1, =0x00000001 - STR R1, [R2] - - ; Lock register - MOVS R1, #0 - STR R1, [R0] - - 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 -SVC_Handler PROC - EXPORT SVC_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 BOD_IRQHandler [WEAK] - EXPORT WDT_IRQHandler [WEAK] - EXPORT EINT024_IRQHandler [WEAK] - EXPORT EINT135_IRQHandler [WEAK] - EXPORT GPABGH_IRQHandler [WEAK] - EXPORT GPCDEF_IRQHandler [WEAK] - EXPORT PWM0_IRQHandler [WEAK] - EXPORT PWM1_IRQHandler [WEAK] - EXPORT TMR0_IRQHandler [WEAK] - EXPORT TMR1_IRQHandler [WEAK] - EXPORT TMR2_IRQHandler [WEAK] - EXPORT TMR3_IRQHandler [WEAK] - EXPORT UART02_IRQHandler [WEAK] - EXPORT UART13_IRQHandler [WEAK] - EXPORT SPI0_IRQHandler [WEAK] - EXPORT QSPI0_IRQHandler [WEAK] - EXPORT ISP_IRQHandler [WEAK] - EXPORT UART57_IRQHandler [WEAK] - EXPORT I2C0_IRQHandler [WEAK] - EXPORT I2C1_IRQHandler [WEAK] - EXPORT BPWM0_IRQHandler [WEAK] - EXPORT BPWM1_IRQHandler [WEAK] - EXPORT USCI01_IRQHandler [WEAK] - EXPORT USBD_IRQHandler [WEAK] - EXPORT ACMP01_IRQHandler [WEAK] - EXPORT PDMA_IRQHandler [WEAK] - EXPORT UART46_IRQHandler [WEAK] - EXPORT PWRWU_IRQHandler [WEAK] - EXPORT ADC_IRQHandler [WEAK] - EXPORT CKFAIL_IRQHandler [WEAK] - EXPORT RTC_IRQHandler [WEAK] - -BOD_IRQHandler -WDT_IRQHandler -EINT024_IRQHandler -EINT135_IRQHandler -GPABGH_IRQHandler -GPCDEF_IRQHandler -PWM0_IRQHandler -PWM1_IRQHandler -TMR0_IRQHandler -TMR1_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -UART02_IRQHandler -UART13_IRQHandler -SPI0_IRQHandler -QSPI0_IRQHandler -ISP_IRQHandler -UART57_IRQHandler -I2C0_IRQHandler -I2C1_IRQHandler -BPWM0_IRQHandler -BPWM1_IRQHandler -USCI01_IRQHandler -USBD_IRQHandler -ACMP01_IRQHandler -PDMA_IRQHandler -UART46_IRQHandler -PWRWU_IRQHandler -ADC_IRQHandler -CKFAIL_IRQHandler -RTC_IRQHandler - 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/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/GCC/startup_M031Series.S b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/GCC/startup_M031Series.S deleted file mode 100644 index 365f092a233..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/GCC/startup_M031Series.S +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************//** - * @file startup_m031series.s - * @version V2.00 - * $Revision: 6 $ - * $Date: 18/04/12 4:44p $ - * @brief CMSIS Cortex-M0 Core Device Startup File for M031 - * - * @note - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ - - .syntax unified - .cpu cortex-m0 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: -/* Unlock Register */ - ldr r0, =0x40000100 - ldr r1, =0x59 - str r1, [r0] - ldr r1, =0x16 - str r1, [r0] - ldr r1, =0x88 - str r1, [r0] - -#if 1 -/* Init POR */ - ldr r0, =0x40000024 - ldr r1, =0x00005AA5 - str r1, [r0] - -/* Init LDO_RDY */ - ldr r0, =0x40000280 - ldr r1, =0x00000001 - str r1, [r0] -#endif - /* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss - -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2, #4] - adds r2, r2, #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - /* Call the clock system intitialization function.*/ - bl SystemInit - -/* Lock register */ - ldr r0, =0x40000100 - ldr r1, =0 - str r1, [r0] - -/* Call the application entry point.*/ - - bl entry - bx lr - -.size Reset_Handler, . - Reset_Handler -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - - .size Default_Handler, .-Default_Handler -/******************************************************************************* -* -* The minimal vector table for a Cortex M0. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -*******************************************************************************/ - - - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .long _estack /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler */ - .long HardFault_Handler /* Hard Fault Handler */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long SVC_Handler /* SVCall Handler */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long PendSV_Handler /* PendSV Handler */ - .long SysTick_Handler /* SysTick Handler */ - - /* External interrupts */ - .long BOD_IRQHandler /* 0: BOD */ - .long WDT_IRQHandler /* 1: WDT */ - .long EINT024_IRQHandler /* 2: EINT0 */ - .long EINT135_IRQHandler /* 3: EINT1 */ - .long GPABGH_IRQHandler /* 4: GPAB */ - .long GPCDEF_IRQHandler /* 5: GPCDEF */ - .long PWM0_IRQHandler /* 6: PWM0 */ - .long PWM1_IRQHandler /* 7: PWM1 */ - .long TMR0_IRQHandler /* 8: TIMER0 */ - .long TMR1_IRQHandler /* 9: TIMER1 */ - .long TMR2_IRQHandler /* 10: TIMER2 */ - .long TMR3_IRQHandler /* 11: TIMER3 */ - .long UART02_IRQHandler /* 12: UART02 */ - .long UART13_IRQHandler /* 13: UART13 */ - .long SPI0_IRQHandler /* 14: SPI0 */ - .long QSPI0_IRQHandler /* 15: QSPI0 */ - .long ISP_IRQHandler /* 16: Reserved */ - .long UART57_IRQHandler /* 17: UART57 */ - .long I2C0_IRQHandler /* 18: I2C0 */ - .long I2C1_IRQHandler /* 19: I2C1 */ - .long BPWM0_IRQHandler /* 20: BPWM0 */ - .long BPWM1_IRQHandler /* 21: BPWM1 */ - .long USCI01_IRQHandler /* 22: USCI01 */ - .long USBD_IRQHandler /* 23: USBD */ - .long Default_Handler /* 24: Reserved */ - .long ACMP01_IRQHandler /* 25: ACMP01 */ - .long PDMA_IRQHandler /* 26: PDMA */ - .long UART46_IRQHandler /* 27: UART46 */ - .long PWRWU_IRQHandler /* 28: PWRWU */ - .long ADC_IRQHandler /* 29: ADC */ - .long CKFAIL_IRQHandler /* 30: CLK Fail Detect */ - .long RTC_IRQHandler /* 31: RTC */ -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - - - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, Default_Handler - .endm - - def_irq_handler NMI_Handler - def_irq_handler HardFault_Handler - def_irq_handler SVC_Handler - def_irq_handler PendSV_Handler - def_irq_handler SysTick_Handler - def_irq_handler BOD_IRQHandler - def_irq_handler WDT_IRQHandler - def_irq_handler EINT024_IRQHandler - def_irq_handler EINT135_IRQHandler - def_irq_handler GPABGH_IRQHandler - def_irq_handler GPCDEF_IRQHandler - def_irq_handler PWM0_IRQHandler - def_irq_handler PWM1_IRQHandler - def_irq_handler TMR0_IRQHandler - def_irq_handler TMR1_IRQHandler - def_irq_handler TMR2_IRQHandler - def_irq_handler TMR3_IRQHandler - def_irq_handler UART02_IRQHandler - def_irq_handler UART13_IRQHandler - def_irq_handler SPI0_IRQHandler - def_irq_handler QSPI0_IRQHandler - def_irq_handler ISP_IRQHandler - def_irq_handler UART57_IRQHandler - def_irq_handler I2C0_IRQHandler - def_irq_handler I2C1_IRQHandler - def_irq_handler BPWM0_IRQHandler - def_irq_handler BPWM1_IRQHandler - def_irq_handler USCI01_IRQHandler - def_irq_handler USBD_IRQHandler - def_irq_handler ACMP01_IRQHandler - def_irq_handler PDMA_IRQHandler - def_irq_handler UART46_IRQHandler - def_irq_handler PWRWU_IRQHandler - def_irq_handler ADC_IRQHandler - def_irq_handler CKFAIL_IRQHandler - def_irq_handler RTC_IRQHandler - - - - .end diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/IAR/startup_M031Series.s b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/IAR/startup_M031Series.s deleted file mode 100644 index 6d9f364364f..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/IAR/startup_M031Series.s +++ /dev/null @@ -1,202 +0,0 @@ -;/**************************************************************************//** -; * @file startup_M031Series.s -; * @version V3.00 -; * $Revision: 5 $ -; * $Date: 18/04/02 4:02p $ -; * @brief M031 Series Startup Source File for IAR Platform -; * -; * @note -; * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -; * -; ******************************************************************************/ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) ;; 8 bytes alignment - - SECTION .intvec:CODE:NOROOT(2);; 4 bytes alignment - - EXTERN SystemInit - EXTERN __iar_program_start - PUBLIC __vector_table - - DATA -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler - DCD HardFault_Handler - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD SVC_Handler - DCD 0 - DCD 0 - DCD PendSV_Handler - DCD SysTick_Handler - - ; External Interrupts - DCD BOD_IRQHandler ; Brownout low voltage detected interrupt - DCD WDT_IRQHandler ; Watch Dog Timer interrupt - DCD EINT024_IRQHandler - DCD EINT135_IRQHandler - DCD GPABGH_IRQHandler - DCD GPCDEF_IRQHandler - DCD PWM0_IRQHandler ; PWM0 or PWM2 interrupt - DCD PWM1_IRQHandler ; PWM1 or PWM3 interrupt - DCD TMR0_IRQHandler ; Timer 0 interrupt - DCD TMR1_IRQHandler ; Timer 1 interrupt - DCD TMR2_IRQHandler ; Timer 2 interrupt - DCD TMR3_IRQHandler ; Timer 3 interrupt - DCD UART02_IRQHandler - DCD UART13_IRQHandler - DCD SPI0_IRQHandler - DCD QSPI0_IRQHandler - DCD ISP_IRQHandler - DCD UART57_IRQHandler - DCD I2C0_IRQHandler - DCD I2C1_IRQHandler - DCD BPWM0_IRQHandler - DCD BPWM1_IRQHandler - DCD USCI01_IRQHandler - DCD USBD_IRQHandler - DCD Default_Handler - DCD ACMP01_IRQHandler - DCD PDMA_IRQHandler - DCD UART46_IRQHandler - DCD PWRWU_IRQHandler ; Clock controller interrupt for chip wake up from power-down - DCD ADC_IRQHandler ; ADC interrupt - DCD CKFAIL_IRQHandler ; Clock fail detect and IRC TRIM interrupt - DCD RTC_IRQHandler - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) ; 4 bytes alignment -Reset_Handler - LDR R0, =0x40000100 - ; Unlock Register - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - ; Init POR - LDR R2, =0x40000024 - LDR R1, =0x00005AA5 - STR R1, [R2] - - ; Init LDO_RDY - LDR R2, =0x40000280 - LDR R1, =0x00000001 - STR R1, [R2] - - ; Disable NMI (Assign to reserved IRQ) - LDR R2, =0x40000380 - LDR R1, =0x0000001F - STR R1, [R2] - - ; Lock register - MOVS R1, #0 - STR R1, [R0] - - LDR R0, =SystemInit - BLX R0 - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK HardFault_Handler - PUBWEAK NMI_Handler - PUBWEAK SVC_Handler - PUBWEAK PendSV_Handler - PUBWEAK SysTick_Handler - PUBWEAK BOD_IRQHandler - PUBWEAK WDT_IRQHandler - PUBWEAK EINT024_IRQHandler - PUBWEAK EINT135_IRQHandler - PUBWEAK GPABGH_IRQHandler - PUBWEAK GPCDEF_IRQHandler - PUBWEAK PWM0_IRQHandler - PUBWEAK PWM1_IRQHandler - PUBWEAK TMR0_IRQHandler - PUBWEAK TMR1_IRQHandler - PUBWEAK TMR2_IRQHandler - PUBWEAK TMR3_IRQHandler - PUBWEAK UART02_IRQHandler - PUBWEAK UART13_IRQHandler - PUBWEAK SPI0_IRQHandler - PUBWEAK QSPI0_IRQHandler - PUBWEAK ISP_IRQHandler - PUBWEAK UART57_IRQHandler - PUBWEAK I2C0_IRQHandler - PUBWEAK I2C1_IRQHandler - PUBWEAK BPWM0_IRQHandler - PUBWEAK BPWM1_IRQHandler - PUBWEAK USCI01_IRQHandler - PUBWEAK USBD_IRQHandler - PUBWEAK ACMP01_IRQHandler - PUBWEAK PDMA_IRQHandler - PUBWEAK UART46_IRQHandler - PUBWEAK PWRWU_IRQHandler - PUBWEAK ADC_IRQHandler - PUBWEAK CKFAIL_IRQHandler - PUBWEAK RTC_IRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) - -HardFault_Handler -NMI_Handler -SVC_Handler -PendSV_Handler -SysTick_Handler -BOD_IRQHandler -WDT_IRQHandler -EINT024_IRQHandler -EINT135_IRQHandler -GPABGH_IRQHandler -GPCDEF_IRQHandler -PWM0_IRQHandler -PWM1_IRQHandler -TMR0_IRQHandler -TMR1_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -UART02_IRQHandler -UART13_IRQHandler -SPI0_IRQHandler -QSPI0_IRQHandler -ISP_IRQHandler -UART57_IRQHandler -I2C0_IRQHandler -I2C1_IRQHandler -BPWM0_IRQHandler -BPWM1_IRQHandler -USCI01_IRQHandler -USBD_IRQHandler -ACMP01_IRQHandler -PDMA_IRQHandler -UART46_IRQHandler -PWRWU_IRQHandler -ADC_IRQHandler -CKFAIL_IRQHandler -RTC_IRQHandler -Default_Handler - - B Default_Handler - - - END - diff --git a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/system_M031Series.c b/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/system_M031Series.c deleted file mode 100644 index dea5e692d71..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/Nuvoton/M031/Source/system_M031Series.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************//** - * @file system_M031Series.c - * @version V2.00 - * $Revision: 5 $ - * $Date: 18/07/19 1:44p $ - * @brief M031 Series System Setting Source File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - * - ******************************************************************************/ -#include -#include -#include "NuMicro.h" - - - -/*---------------------------------------------------------------------------- - Clock Variable definitions - *----------------------------------------------------------------------------*/ -uint32_t SystemCoreClock = __HSI; /*!< System Clock Frequency (Core Clock) */ -uint32_t CyclesPerUs = (__HSI / 1000000); /*!< Cycles per micro second */ -uint32_t PllClock = __HSI; /*!< PLL Output Clock Frequency */ -const uint32_t gau32ClkSrcTbl[] = {__HXT, __LXT, __HSI, __LIRC, __HIRC, 0UL, 0UL, __HIRC}; - - -/** - * @brief Update the Variable SystemCoreClock - * - * @param None - * - * @return None - * - * @details This function is used to update the variable SystemCoreClock - * and must be called whenever the core clock is changed. - */ -void SystemCoreClockUpdate(void) -{ - uint32_t u32Freq, u32ClkSrc; - uint32_t u32HclkDiv; - - u32ClkSrc = CLK->CLKSEL0 & CLK_CLKSEL0_HCLKSEL_Msk; - - /* Update PLL Clock */ - PllClock = CLK_GetPLLClockFreq(); - - if(u32ClkSrc != CLK_CLKSEL0_HCLKSEL_PLL) - { - /* Use the clock sources directly */ - u32Freq = gau32ClkSrcTbl[u32ClkSrc]; - } - else - { - /* Use PLL clock */ - u32Freq = PllClock; - } - - u32HclkDiv = (CLK->CLKDIV0 & CLK_CLKDIV0_HCLKDIV_Msk) + 1; - - /* Update System Core Clock */ - SystemCoreClock = u32Freq / u32HclkDiv; - - CyclesPerUs = (SystemCoreClock + 500000) / 1000000; -} - - -/** - * @brief System Initialization - * - * @param None - * - * @return None - * - * @details The necessary initialization of system. Global variables are forbidden here. - */ -void SystemInit(void) -{ - /* Unlock protected registers */ - SYS_UnlockReg(); - - /* Set HXTGain Level dependend on HXT Frequency */ - CLK->PWRCTL = CLK->PWRCTL & ~CLK_PWRCTL_HXTGAIN_Msk; - if ((__HXT >= FREQ_4MHZ) && (__HXT < FREQ_8MHZ)) - { - CLK->PWRCTL |= (1 << CLK_PWRCTL_HXTGAIN_Pos); - } - else if ((__HXT >= FREQ_8MHZ) && (__HXT < FREQ_12MHZ)) - { - CLK->PWRCTL |= (2 << CLK_PWRCTL_HXTGAIN_Pos); - } - else if ((__HXT >= FREQ_12MHZ) && (__HXT < FREQ_16MHZ)) - { - CLK->PWRCTL |= (3 << CLK_PWRCTL_HXTGAIN_Pos); - } - else if ((__HXT >= FREQ_16MHZ) && (__HXT < FREQ_24MHZ)) - { - CLK->PWRCTL |= (4 << CLK_PWRCTL_HXTGAIN_Pos); - } - else - { - CLK->PWRCTL |= (7 << CLK_PWRCTL_HXTGAIN_Pos); - } - - /* Lock protected registers */ - SYS_LockReg(); -} - -#if USE_ASSERT - -/** - * @brief Assert Error Message - * - * @param[in] file the source file name - * @param[in] line line number - * - * @return None - * - * @details The function prints the source file name and line number where - * the ASSERT_PARAM() error occurs, and then stops in an infinite loop. - */ -void AssertError(uint8_t * file, uint32_t line) -{ - - printf("[%s] line %d : wrong parameters.\r\n", file, line); - - /* Infinite loop */ - while(1) ; -} -#endif diff --git a/bsp/nuvoton/libraries/m031/Device/SConscript b/bsp/nuvoton/libraries/m031/Device/SConscript deleted file mode 100644 index fcd850fa09e..00000000000 --- a/bsp/nuvoton/libraries/m031/Device/SConscript +++ /dev/null @@ -1,25 +0,0 @@ -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(""" -Nuvoton/M031/Source/system_M031Series.c -""") - -# add for startup script -if rtconfig.PLATFORM in ['gcc']: - src = src + ['Nuvoton/M031/Source/GCC/startup_M031Series.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src = src + ['Nuvoton/M031/Source/ARM/startup_M031Series.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src = src + ['Nuvoton/M031/Source/IAR/startup_M031Series.s'] - -path = [cwd + '/Nuvoton/M031/Include',] - -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m031/StdDriver/SConscript b/bsp/nuvoton/libraries/m031/StdDriver/SConscript deleted file mode 100644 index b8c471cad1a..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/SConscript +++ /dev/null @@ -1,28 +0,0 @@ -# RT-Thread building script for component -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -libs = [] -src = Glob('*src/*.c') + Glob('src/*.cpp') -cpppath = [cwd + '/inc'] -libpath = [cwd + '/lib'] - -if not GetDepend('BSP_USE_STDDRIVER_SOURCE'): - if rtconfig.PLATFORM in ['armcc', 'armclang']: - if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'): - libs += ['libstddriver_keil'] - elif GetOption('target') == 'mdk4' and os.path.isfile('./lib/libstddriver_keil4.lib'): - libs += ['libstddriver_keil4'] - elif rtconfig.PLATFORM in ['gcc'] and os.path.isfile('./lib/libstddriver_gcc.a'): - libs += ['libstddriver_gcc'] - elif os.path.isfile('./lib/libstddriver_iar.a'): - libs += ['libstddriver_iar'] - -if not libs: - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath) -else: - src = [] - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath) - -Return('group') diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_acmp.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_acmp.h deleted file mode 100644 index 4f09de47daf..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_acmp.h +++ /dev/null @@ -1,401 +0,0 @@ -/**************************************************************************//** - * @file nu_acmp.h - * @version V0.10 - * $Revision: 2 $ - * $Date: 18/12/21 10:53a $ - * @brief M031 Series ACMP Driver Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_ACMP_H__ -#define __NU_ACMP_H__ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Include related headers */ -/*---------------------------------------------------------------------------------------------------------*/ -#include "M031Series.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_CONSTANTS ACMP Exported Constants - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_CTL_FILTSEL_OFF (0UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for filter function disabled. \hideinitializer */ -#define ACMP_CTL_FILTSEL_1PCLK (1UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 1 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_2PCLK (2UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 2 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_4PCLK (3UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 4 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_8PCLK (4UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 8 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_16PCLK (5UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 16 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_32PCLK (6UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 32 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_64PCLK (7UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 64 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_INTPOL_RF (0UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting rising edge and falling edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_INTPOL_R (1UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting rising edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_INTPOL_F (2UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting falling edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_POSSEL_P0 (0UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P0 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P1 (1UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P1 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P2 (2UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P2 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P3 (3UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P3 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_NEGSEL_PIN (0UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting the voltage of ACMP negative input pin as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_CRV (1UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting internal comparator reference voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_VBG (2UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting internal Band-gap voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_ENABLE (1UL << ACMP_CTL_HYSEN_Pos) /*!< ACMP_CTL setting for enabling the hysteresis function. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_DISABLE (0UL << ACMP_CTL_HYSEN_Pos) /*!< ACMP_CTL setting for disabling the hysteresis function. \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_VREF constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_VREF_CRVSSEL_VDDA (0UL << ACMP_VREF_CRVSSEL_Pos) /*!< ACMP_VREF setting for selecting analog supply voltage VDDA as the CRV source voltage \hideinitializer */ -#define ACMP_VREF_CRVSSEL_INTVREF (1UL << ACMP_VREF_CRVSSEL_Pos) /*!< ACMP_VREF setting for selecting internal reference voltage as the CRV source voltage \hideinitializer */ - - -/*@}*/ /* end of group ACMP_EXPORTED_CONSTANTS */ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPOINV bit of ACMP_CTL register to enable output inverse function. - * \hideinitializer - */ -#define ACMP_ENABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to disable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPOINV bit of ACMP_CTL register to disable output inverse function. - * \hideinitializer - */ -#define ACMP_DISABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to select ACMP negative input source - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Src is comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * @return None - * @details This macro will set NEGSEL (ACMP_CTL[5:4]) to determine the source of negative input. - * \hideinitializer - */ -#define ACMP_SET_NEG_SRC(acmp, u32ChNum, u32Src) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_NEGSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to enable hysteresis function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set HYSEN bit of ACMP_CTL register to enable hysteresis function. - * \hideinitializer - */ -#define ACMP_ENABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_HYSEN_Msk) - -/** - * @brief This macro is used to disable hysteresis function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear HYSEN bit of ACMP_CTL register to disable hysteresis function. - * \hideinitializer - */ -#define ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_HYSEN_Msk) - -/** - * @brief This macro is used to enable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPIE bit of ACMP_CTL register to enable interrupt function. - * If wake-up function is enabled, the wake-up interrupt will be enabled as well. - * \hideinitializer - */ -#define ACMP_ENABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to disable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPIE bit of ACMP_CTL register to disable interrupt function. - * \hideinitializer - */ -#define ACMP_DISABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to enable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPEN bit of ACMP_CTL register to enable analog comparator. - * \hideinitializer - */ -#define ACMP_ENABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to disable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - * \hideinitializer - */ -#define ACMP_DISABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to get ACMP output value - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP output value - * @details This macro will return the ACMP output value. - * \hideinitializer - */ -#define ACMP_GET_OUTPUT(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPO0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to get ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP interrupt occurred (1) or not (0) - * @details This macro will return the ACMP interrupt flag. - * \hideinitializer - */ -#define ACMP_GET_INT_FLAG(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to clear ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to ACMPIFn bit of ACMP_STATUS register to clear interrupt flag. - * \hideinitializer - */ -#define ACMP_CLR_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to clear ACMP wake-up interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to WKIFn bit of ACMP_STATUS register to clear interrupt flag. - * \hideinitializer - */ -#define ACMP_CLR_WAKEUP_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_WKIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to enable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WKEN (ACMP_CTL[16]) to enable ACMP wake-up function. - * \hideinitializer - */ -#define ACMP_ENABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WKEN (ACMP_CTL[16]) to disable ACMP wake-up function. - * \hideinitializer - */ -#define ACMP_DISABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to select ACMP positive input pin - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Pin Comparator positive pin selection. Including: - * - \ref ACMP_CTL_POSSEL_P0 - * - \ref ACMP_CTL_POSSEL_P1 - * - \ref ACMP_CTL_POSSEL_P2 - * - \ref ACMP_CTL_POSSEL_P3 - * @return None - * @details This macro will set POSSEL (ACMP_CTL[7:6]) to determine the comparator positive input pin. - * \hideinitializer - */ -#define ACMP_SELECT_P(acmp, u32ChNum, u32Pin) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_POSSEL_Msk) | (u32Pin)) - -/** - * @brief This macro is used to enable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set OUTSEL (ACMP_CTL[12]) to enable output filter function. - * \hideinitializer - */ -#define ACMP_ENABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to disable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear OUTSEL (ACMP_CTL[12]) to disable output filter function. - * \hideinitializer - */ -#define ACMP_DISABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to set ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cnt is comparator filter count setting. - * - \ref ACMP_CTL_FILTSEL_OFF - * - \ref ACMP_CTL_FILTSEL_1PCLK - * - \ref ACMP_CTL_FILTSEL_2PCLK - * - \ref ACMP_CTL_FILTSEL_4PCLK - * - \ref ACMP_CTL_FILTSEL_8PCLK - * - \ref ACMP_CTL_FILTSEL_16PCLK - * - \ref ACMP_CTL_FILTSEL_32PCLK - * - \ref ACMP_CTL_FILTSEL_64PCLK - * @return None - * @details When ACMP output filter function is enabled, the output sampling count is determined by FILTSEL (ACMP_CTL[15:13]). - * \hideinitializer - */ -#define ACMP_SET_FILTER(acmp, u32ChNum, u32Cnt) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_FILTSEL_Msk) | (u32Cnt)) - -/** - * @brief This macro is used to select comparator reference voltage - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32Level The comparator reference voltage setting. - * The formula is: - * comparator reference voltage = CRV source voltage x (1/6 + u32Level/24) - * The range of u32Level is 0 ~ 15. - * @return None - * @details When CRV is selected as ACMP negative input source, the CRV level is determined by CRVCTL (ACMP_VREF[3:0]). - * \hideinitializer - */ -#define ACMP_CRV_SEL(acmp, u32Level) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRVCTL_Msk) | ((u32Level)<VREF = ((acmp)->VREF & ~ACMP_VREF_CRVSSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to select ACMP interrupt condition - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cond Comparator interrupt condition selection. Including: - * - \ref ACMP_CTL_INTPOL_RF - * - \ref ACMP_CTL_INTPOL_R - * - \ref ACMP_CTL_INTPOL_F - * @return None - * @details The ACMP output interrupt condition can be rising edge, falling edge or any edge. - * \hideinitializer - */ -#define ACMP_SELECT_INT_COND(acmp, u32ChNum, u32Cond) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_INTPOL_Msk) | (u32Cond)) - -/** - * @brief This macro is used to enable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WLATEN (ACMP_CTL[17]) to enable ACMP window latch mode. - * When ACMP0/1_WLAT pin is at high level, ACMPO0/1 passes through window latch - * block; when ACMP0/1_WLAT pin is at low level, the output of window latch block, - * WLATOUT, is frozen. - * \hideinitializer - */ -#define ACMP_ENABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to disable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WLATEN (ACMP_CTL[17]) to disable ACMP window latch mode. - * \hideinitializer - */ -#define ACMP_DISABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to enable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WCMPSEL (ACMP_CTL[18]) to enable ACMP window compare mode. - * When window compare mode is enabled, user can connect the specific analog voltage - * source to either the positive inputs of both comparators or the negative inputs of - * both comparators. The upper bound and lower bound of the designated range are - * determined by the voltages applied to the other inputs of both comparators. If the - * output of a comparator is low and the other comparator outputs high, which means two - * comparators implies the upper and lower bound. User can directly monitor a specific - * analog voltage source via ACMPWO (ACMP_STATUS[16]). - * \hideinitializer - */ -#define ACMP_ENABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WCMPSEL_Msk) - -/** - * @brief This macro is used to disable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WCMPSEL (ACMP_CTL[18]) to disable ACMP window compare mode. - * \hideinitializer - */ -#define ACMP_DISABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WCMPSEL_Msk) - - -/* Function prototype declaration */ -void ACMP_Open(ACMP_T *, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysteresisEn); -void ACMP_Close(ACMP_T *, uint32_t u32ChNum); - - - -/*@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ACMP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - - -#endif //__NU_ACMP_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_adc.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_adc.h deleted file mode 100644 index 16cfca998fc..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_adc.h +++ /dev/null @@ -1,418 +0,0 @@ -/**************************************************************************//** - * @file nu_adc.h - * @version V0.10 - * $Revision: 2 $ - * $Date: 19/01/11 11:23a $ - * @brief M031 Series ADC Driver Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_ADC_H__ -#define __NU_ADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ADC_Driver ADC Driver - @{ -*/ - -/** @addtogroup ADC_EXPORTED_CONSTANTS ADC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ADCR Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ADC_ADCR_ADEN_CONVERTER_DISABLE (0UL<ADDR[(u32ChNum)] & ADC_ADDR_RSLT_Msk) - -/** - * @brief Return the user-specified interrupt flags. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32Mask The combination of following interrupt status bits. Each bit corresponds to a interrupt status. - * Valid values are: - * - \ref ADC_ADF_INT :Convert complete interrupt flag. - * - \ref ADC_CMP0_INT :Comparator 0 interrupt flag. - * - \ref ADC_CMP1_INT :Comparator 1 interrupt flag. - * @return User specified interrupt flags. - * @details Get the status of the ADC interrupt flag. - * \hideinitializer - */ -#define ADC_GET_INT_FLAG(adc, u32Mask) ((adc)->ADSR0 & (u32Mask)) - -/** - * @brief This macro clear the selected interrupt status bits. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32Mask The combination of following interrupt status bits. Each bit corresponds to a interrupt status. - * Valid values are: - * - \ref ADC_ADF_INT :Convert complete interrupt flag. - * - \ref ADC_CMP0_INT :Comparator 0 interrupt flag. - * - \ref ADC_CMP1_INT :Comparator 1 interrupt flag. - * @return None - * @details ADF (ADSR0[0])/CMPF0 (ADSR0[1])/CMPF1 (ADSR0[2]) can be cleared by writing 1 to itself. - * \hideinitializer - */ -#define ADC_CLR_INT_FLAG(adc, u32Mask) ((adc)->ADSR0 = (u32Mask)) - -/** - * @brief Get the busy state of ADC. - * @param[in] adc The pointer of the specified ADC module. - * @retval 0 ADC is not busy. - * @retval 1 ADC is busy. - * @details ADSR0[7] (BUSY) is a mirror of ADCR[11] (ADST). - * \hideinitializer - */ -#define ADC_IS_BUSY(adc) ((adc)->ADSR0 & ADC_ADSR0_BUSY_Msk ? 1 : 0) - -/** - * @brief Check if the ADC conversion data is over written or not. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32ChNum ADC Channel, valid value are from 0 to 15 and 29. - * @retval 0 ADC data is not overrun. - * @retval 1 ADC data is overrun. - * @details ADSR2[31:0] (OVERRUN) is the mirror of ADDR0~31[16] OVERRUN bits. - * \hideinitializer - */ -#define ADC_IS_DATA_OVERRUN(adc, u32ChNum) (((adc)->ADSR2 & (1<<(u32ChNum))) ? 1 : 0) - -/** - * @brief Check if the ADC conversion data is valid or not. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32ChNum ADC Channel, valid value are from 0 to 15 and 29. - * @retval 0 ADC data is not valid. - * @retval 1 ADC data is valid. - * @details VALID (ADDR0~31[17]) is set to 1 when corresponding channel analog input conversion is completed and cleared by hardware after ADDR register is read. - * \hideinitializer - */ -#define ADC_IS_DATA_VALID(adc, u32ChNum) ((adc)->ADSR1 & (0x1<<(u32ChNum)) ? 1 : 0) - -/** - * @brief Power down ADC module. - * @param[in] adc The pointer of the specified ADC module. - * @return None - * @details Disable A/D converter analog circuit for saving power consumption. - * \hideinitializer - */ -#define ADC_POWER_DOWN(adc) ((adc)->ADCR &= ~ADC_ADCR_ADEN_Msk) - -/** - * @brief Power on ADC module. - * @param[in] adc The pointer of the specified ADC module. - * @return None - * @details Before starting A/D conversion function, ADEN bit (ADCR[0]) should be set to 1. - * \hideinitializer - */ -#define ADC_POWER_ON(adc) ((adc)->ADCR |= ADC_ADCR_ADEN_Msk) - -/** - * @brief Configure the comparator 0 and enable it. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32ChNum Specifies the source channel, valid value are from 0 to 15 and 29. - * @param[in] u32Condition Specifies the compare condition. Valid values are: - * - \ref ADC_ADCMPR_CMPCOND_LESS_THAN :The compare condition is "less than the compare value". - * - \ref ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value". - * @param[in] u32Data Specifies the compare value, valid value are between 0 ~ 0xFFF. - * @param[in] u32MatchCount Specifies the match count setting, valid values are between 1~16. - * @return None - * @details For example, ADC_ENABLE_CMP0(ADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10); - * means ADC will assert comparator 0 flag if channel 5 conversion result is greater than or - * equal to 0x800 for 10 times continuously. - * \hideinitializer - */ -#define ADC_ENABLE_CMP0(adc, \ - u32ChNum, \ - u32Condition, \ - u32Data, \ - u32MatchCount) ((adc)->ADCMPR[0] = ((u32ChNum) << ADC_ADCMPR_CMPCH_Pos) | \ - (u32Condition) | \ - ((u32Data) << ADC_ADCMPR_CMPD_Pos) | \ - (((u32MatchCount) - 1) << ADC_ADCMPR_CMPMATCNT_Pos) |\ - ADC_ADCMPR_CMPEN_Msk) - -/** - * @brief Disable comparator 0 - * @param[in] adc The pointer of the specified ADC module - * @return None - * @details Set CMPEN (ADCMPR0[0]) to 0 and reset comparator 0 configurations to disable ADC compare function. - * \hideinitializer - */ -#define ADC_DISABLE_CMP0(adc) ((adc)->ADCMPR[0] = 0) - -/** - * @brief Configure the comparator 1 and enable it. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32ChNum Specifies the source channel, valid value are from 0 to 15 and 29. - * @param[in] u32Condition Specifies the compare condition. Valid values are: - * - \ref ADC_ADCMPR_CMPCOND_LESS_THAN :The compare condition is "less than the compare value". - * - \ref ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value". - * @param[in] u32Data Specifies the compare value, valid value are between 0 ~ 0xFFF. - * @param[in] u32MatchCount Specifies the match count setting, valid values are between 1~16. - * @return None - * @details For example, ADC_ENABLE_CMP1(ADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10); - * means ADC will assert comparator 1 flag if channel 5 conversion result is greater than or - * equal to 0x800 for 10 times continuously. - * \hideinitializer - */ -#define ADC_ENABLE_CMP1(adc, \ - u32ChNum, \ - u32Condition, \ - u32Data, \ - u32MatchCount) ((adc)->ADCMPR[1] = ((u32ChNum) << ADC_ADCMPR_CMPCH_Pos) | \ - (u32Condition) | \ - ((u32Data) << ADC_ADCMPR_CMPD_Pos) | \ - (((u32MatchCount) - 1) << ADC_ADCMPR_CMPMATCNT_Pos) |\ - ADC_ADCMPR_CMPEN_Msk) - -/** - * @brief Disable comparator 1. - * @param[in] adc The pointer of the specified ADC module. - * @return None - * @details Set CMPEN (ADCMPR1[0]) to 0 and reset comparator 1 configurations to disable ADC compare function. - * \hideinitializer - */ -#define ADC_DISABLE_CMP1(adc) ((adc)->ADCMPR[1] = 0) - -/** - * @brief Enable the compare window mode. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0. - * @return None - * @details CMPF0 (ADSR0[1]) will be set when both ADC_CMP0 and ADC_CMP1 compared condition matched. - * \hideinitializer - */ -#define ADC_ENABLE_CMP_WINDOW_MODE(adc, u32CMP) ((adc)->ADCMPR[(u32CMP)] |= ADC_ADCMPR_CMPWEN_Msk) - -/** - * @brief Disable the compare window mode. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0. - * @return None - * @details Disable the compare window mode for specified ADC module. - * \hideinitializer - */ -#define ADC_DISABLE_CMP_WINDOW_MODE(adc, u32CMP) ((adc)->ADCMPR[(u32CMP)] &= ~ADC_ADCMPR_CMPWEN_Msk) - -/** - * @brief Set ADC input channel. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32Mask Channel enable bit. Each bit corresponds to a input channel. Bit 0 is channel 0, bit 1 is channel 1..., bit 15 is channel 15. - * @return None - * @details Enabled channel will be converted while ADC starts. - * @note In single mode, ADC can only convert 1 channel. If more than 1 channel are enabled, only the channel with smallest number will be converted. - * \hideinitializer - */ -#define ADC_SET_INPUT_CHANNEL(adc, u32Mask) ((adc)->ADCHER = ((adc)->ADCHER & ~ADC_ADCHER_CHEN_Msk) | (u32Mask)) - -/** - * @brief Set the output format mode. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32Format Decides the output format. Valid values are: - * - \ref ADC_ADCR_DMOF_UNSIGNED_OUTPUT : Select the straight binary format as the output format of the conversion result. - * - \ref ADC_ADCR_DMOF_TWOS_COMPLEMENT : Select the 2's complement format as the output format of the conversion result. - * @return None - * @details The macro is used to set the output format of ADC differential input mode. - * @note ADC compare function can not support 2's complement output format, u32Format should be set to ADC_ADCR_DMOF_UNSIGNED_OUTPUT. - * \hideinitializer - */ -#define ADC_SET_DMOF(adc, u32Format) ((adc)->ADCR = ((adc)->ADCR & ~ADC_ADCR_DMOF_Msk) | (u32Format)) - -/** - * @brief Start the A/D conversion. - * @param[in] adc The pointer of the specified ADC module. - * @return None - * @details Set ADST bit to 1 to start the A/D conversion. - * \hideinitializer - */ -#define ADC_START_CONV(adc) ((adc)->ADCR |= ADC_ADCR_ADST_Msk) - -/** - * @brief Stop the A/D conversion. - * @param[in] adc The pointer of the specified ADC module. - * @return None - * @details ADST (ADCR[11]) will be cleared to 0 by hardware automatically at the ends of single mode and single-cycle scan mode. - * In continuous scan mode and burst mode, A/D conversion is continuously performed until software writes 0 to this bit. - * @note When the ADST bit is cleared to 0, the ADST bit must be kept at 0 at least one ADC peripheral clock period - * before setting it to 1 again, otherwise the A/D converter may not work. - * If ADST bit is cleared to 0 when ADC is in converting, the BUSY bit will be cleared to 0 immediately, - * ADC will terminate the current conversion and enter idle state directly. - * \hideinitializer - */ -#define ADC_STOP_CONV(adc) ((adc)->ADCR &= ~ADC_ADCR_ADST_Msk) - -/** - * @brief Enable PDMA transfer. - * @param[in] adc The pointer of the specified ADC module - * @return None - * @details Enable PDMA to transfer the conversion data. - * @note While enable PDMA transfer, software must set ADIE = 0 to disable interrupt. - * \hideinitializer - */ -#define ADC_ENABLE_PDMA(adc) ((adc)->ADCR |= ADC_ADCR_PTEN_Msk) - -/** - * @brief Disable PDMA transfer. - * @param[in] adc The pointer of the specified ADC module - * @return None - * @details Disable PDMA to transfer the conversion data. - * \hideinitializer - */ -#define ADC_DISABLE_PDMA(adc) ((adc)->ADCR &= ~ADC_ADCR_PTEN_Msk) - -/** - * @brief Get PDMA current transfer data - * @param[in] adc The pointer of the specified ADC module. - * @return PDMA current transfer data - * \hideinitializer - */ -#define ADC_GET_PDMA_DATA(adc) ((adc)->ADPDMA & ADC_ADPDMA_CURDAT_Msk) - -/** - * @brief Enable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc The pointer of the specified ADC module - * @param[in] u32Mask The combination of interrupt status bits listed below. Each bit - * corresponds to a interrupt status. This parameter decides which - * interrupts will be enabled. - * - \ref ADC_ADF_INT :ADC convert complete interrupt - * - \ref ADC_CMP0_INT :ADC comparator 0 interrupt - * - \ref ADC_CMP1_INT :ADC comparator 1 interrupt - * @return None - * \hideinitializer - */ -#define ADC_ENABLE_INT ADC_EnableInt - -/** - * @brief Disable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc The pointer of the specified ADC module - * @param[in] u32Mask The combination of interrupt status bits listed below. Each bit - * corresponds to a interrupt status. This parameter decides which - * interrupts will be disabled. - * - \ref ADC_ADF_INT :ADC convert complete interrupt - * - \ref ADC_CMP0_INT :ADC comparator 0 interrupt - * - \ref ADC_CMP1_INT :ADC comparator 1 interrupt - * @return None - * \hideinitializer - */ -#define ADC_DISABLE_INT ADC_DisableInt - - -void ADC_Open(ADC_T *adc, - uint32_t u32InputMode, - uint32_t u32OpMode, - uint32_t u32ChMask); -void ADC_Close(ADC_T *adc); -void ADC_EnableHWTrigger(ADC_T *adc, - uint32_t u32Source, - uint32_t u32Param); -void ADC_DisableHWTrigger(ADC_T *adc); -void ADC_EnableInt(ADC_T *adc, uint32_t u32Mask); -void ADC_DisableInt(ADC_T *adc, uint32_t u32Mask); -void ADC_SetExtendSampleTime(ADC_T *adc, - uint32_t u32ModuleNum, - uint32_t u32ExtendSampleTime); - - -/*@}*/ /* end of group ADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_ADC_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_bpwm.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_bpwm.h deleted file mode 100644 index 538963760cf..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_bpwm.h +++ /dev/null @@ -1,379 +0,0 @@ -/****************************************************************************** - * @file nu_bpwm.h - * @version V1.00 - * $Revision: 9 $ - * $Date: 18/06/07 3:47p $ - * @brief M031 series BPWM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_BPWM_H__ -#define __NU_BPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - - -/** @addtogroup BPWM_EXPORTED_CONSTANTS BPWM Exported Constants - @{ -*/ -#define BPWM_CHANNEL_NUM (6UL) /*!< BPWM channel number */ -#define BPWM_CH_0_MASK (0x1UL) /*!< BPWM channel 0 mask */ -#define BPWM_CH_1_MASK (0x2UL) /*!< BPWM channel 1 mask */ -#define BPWM_CH_2_MASK (0x4UL) /*!< BPWM channel 2 mask */ -#define BPWM_CH_3_MASK (0x8UL) /*!< BPWM channel 3 mask */ -#define BPWM_CH_4_MASK (0x10UL) /*!< BPWM channel 4 mask */ -#define BPWM_CH_5_MASK (0x20UL) /*!< BPWM channel 5 mask */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_UP_COUNTER (0UL) /*!< Up counter type */ -#define BPWM_DOWN_COUNTER (1UL) /*!< Down counter type */ -#define BPWM_UP_DOWN_COUNTER (2UL) /*!< Up-Down counter type */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_EDGE_ALIGNED (1UL) /*!< BPWM working in edge aligned type(down count) */ -#define BPWM_CENTER_ALIGNED (2UL) /*!< BPWM working in center aligned type */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_OUTPUT_NOTHING (0UL) /*!< BPWM output nothing */ -#define BPWM_OUTPUT_LOW (1UL) /*!< BPWM output low */ -#define BPWM_OUTPUT_HIGH (2UL) /*!< BPWM output high */ -#define BPWM_OUTPUT_TOGGLE (3UL) /*!< BPWM output toggle */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_SSCTL_SSRC_PWM0 (0UL<SSCTL = ((bpwm)->SSCTL & ~BPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_DISABLE_TIMER_SYNC(bpwm, u32ChannelMask) ((bpwm)->SSCTL &= ~BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief This macro enable BPWM counter synchronous start counting function. - * @param[in] bpwm The pointer of the specified BPWM module - * @return None - * @details This macro is used to make selected BPWM0 and BPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by BPWM_ENABLE_TIMER_SYNC() and BPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define BPWM_TRIGGER_SYNC_START(bpwm) ((bpwm)->SSTRG = BPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * \hideinitializer - */ -#define BPWM_ENABLE_OUTPUT_INVERTER(bpwm, u32ChannelMask) ((bpwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_RISING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_FALLING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define BPWM_MASK_OUTPUT(bpwm, u32ChannelMask, u32LevelMask) \ - { \ - (bpwm)->MSKEN = (u32ChannelMask); \ - (bpwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 1 ~ 0xFFF - * @return None - * \hideinitializer - */ -#define BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescaler) ((bpwm)->CLKPSC = (u32Prescaler)) - -/** -* @brief This macro get the prescaler of the selected channel -* @param[in] bpwm The pointer of the specified BPWM module -* @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5. This parameter is not used. -* @return Return Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF -* @details This macro is used to get the prescaler of specified channel. -* @note All channels share channel 0's setting. -* The clock of BPWM counter is divided by (u32Prescaler + 1). -* \hideinitializer -*/ -#define BPWM_GET_PRESCALER(bpwm, u32ChannelNum) (bpwm)->CLKPSC - -/** - * @brief This macro set the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Duty of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * \hideinitializer - */ -#define BPWM_SET_CMR(bpwm, u32ChannelNum, u32CMR) ((bpwm)->CMPDAT[(u32ChannelNum)] = (u32CMR)) - -/** - * @brief This macro get the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return Return the duty of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the duty of specified channel. - * \hideinitializer - */ -#define BPWM_GET_CMR(bpwm, u32ChannelNum) ((bpwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * @note BPWM counter will stop if period length set to 0 - * \hideinitializer - */ -#define BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR) ((bpwm)->PERIOD = (u32CNR)) - -/** - * @brief This macro get the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Return the period of specified channel. - * @details This macro is used to get the period of specified channel. - * \hideinitializer - */ -#define BPWM_GET_CNR(bpwm, u32ChannelNum) ((bpwm)->PERIOD) - -/** - * @brief This macro set the BPWM aligned type - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @param[in] u32AlignedType BPWM aligned type, valid values are: - * - \ref BPWM_UP_COUNTER - * - \ref BPWM_DOWN_COUNTER - * - \ref BPWM_UP_DOWN_COUNTER - * @return None - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_SET_ALIGNED_TYPE(bpwm, u32ChannelMask, u32AlignedType) ((bpwm)->CTL1 = (u32AlignedType)) - -/** - * @brief Clear counter of channel 0 - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to clear counter of channel 0 - * \hideinitializer - */ -#define BPWM_CLR_COUNTER(bpwm, u32ChannelMask) ((bpwm)->CNTCLR = (BPWM_CNTCLR_CNTCLR0_Msk)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * \hideinitializer - */ -#define BPWM_SET_OUTPUT_LEVEL(bpwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - uint32_t i; \ - for(i = 0UL; i < 6UL; i++) { \ - if((u32ChannelMask) & (1UL << i)) { \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (i << 1UL))) | ((u32ZeroLevel) << (i << 1UL))); \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (BPWM_WGCTL0_PRDPCTL0_Pos + (i << 1UL)))) | ((u32PeriodLevel) << (BPWM_WGCTL0_PRDPCTL0_Pos + (i << 1UL)))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (i << 1UL))) | ((u32CmpUpLevel) << (i << 1UL))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (BPWM_WGCTL1_CMPDCTL0_Pos + (i << 1UL)))) | ((u32CmpDownLevel) << (BPWM_WGCTL1_CMPDCTL0_Pos + (i << 1UL)))); \ - } \ - } \ - }while(0) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define BPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); - - -/*@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_BPWM_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_clk.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_clk.h deleted file mode 100644 index a5fd1dce663..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_clk.h +++ /dev/null @@ -1,600 +0,0 @@ -/**************************************************************************//** - * @file nu_clk.h - * @version V0.10 - * $Revision: 12 $ - * $Date: 18/07/05 4:42p $ - * @brief M031 Series Clock Controller (CLK) Driver Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_CLK_H__ -#define __NU_CLK_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_CONSTANTS CLK Exported Constants - @{ -*/ - - -#define FREQ_4MHZ 4000000 /*!< Define frequency macro 4MHz \hideinitializer */ -#define FREQ_8MHZ 8000000 /*!< Define frequency macro 8MHz \hideinitializer */ -#define FREQ_12MHZ 12000000 /*!< Define frequency macro 12MHz \hideinitializer */ -#define FREQ_16MHZ 16000000 /*!< Define frequency macro 16MHz \hideinitializer */ -#define FREQ_24MHZ 24000000 /*!< Define frequency macro 24MHz \hideinitializer */ -#define FREQ_25MHZ 25000000 /*!< Define frequency macro 25MHz \hideinitializer */ -#define FREQ_32MHZ 32000000 /*!< Define frequency macro 32MHz \hideinitializer */ -#define FREQ_48MHZ 48000000 /*!< Define frequency macro 48MHz \hideinitializer */ -#define FREQ_50MHZ 50000000 /*!< Define frequency macro 50MHz \hideinitializer */ -#define FREQ_51MHZ 51000000 /*!< Define frequency macro 51MHz \hideinitializer */ -#define FREQ_64MHZ 64000000 /*!< Define frequency macro 64MHz \hideinitializer */ -#define FREQ_68MHZ 68000000 /*!< Define frequency macro 68MHz \hideinitializer */ -#define FREQ_72MHZ 72000000 /*!< Define frequency macro 72MHz \hideinitializer */ -#define FREQ_96MHZ 96000000 /*!< Define frequency macro 96MHz \hideinitializer */ -#define FREQ_100MHZ 100000000 /*!< Define frequency macro 100MHz \hideinitializer */ -#define FREQ_144MHZ 144000000 /*!< Define frequency macro 144MHz \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* PWRCTL constant definitions. (Write-protection) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PWRCTL_HXTGAIN_L0 (0) /*!< Setting HXT Gain Control to level 0 for lower than 4MHz external crystal \hideinitializer */ -#define CLK_PWRCTL_HXTGAIN_L1 (1) /*!< Setting HXT Gain Control to level 1 for 4MHz ~ 8MHz external crystal \hideinitializer */ -#define CLK_PWRCTL_HXTGAIN_L2 (2) /*!< Setting HXT Gain Control to level 2 for 8MHz ~ 12MHz external crystal \hideinitializer */ -#define CLK_PWRCTL_HXTGAIN_L3 (3) /*!< Setting HXT Gain Control to level 3 for 12MHz ~ 16MHz external crystal \hideinitializer */ -#define CLK_PWRCTL_HXTGAIN_L4 (4) /*!< Setting HXT Gain Control to level 4 for 16MHz ~ 24MHz external crystal \hideinitializer */ -#define CLK_PWRCTL_HXTGAIN_L5 (5) /*!< Setting HXT Gain Control to level 5 \hideinitializer */ -#define CLK_PWRCTL_HXTGAIN_L6 (6) /*!< Setting HXT Gain Control to level 6 \hideinitializer */ -#define CLK_PWRCTL_HXTGAIN_L7 (7) /*!< Setting HXT Gain Control to level 7 for 24MHz ~ 32MHz external crystal \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL0 constant definitions. (Write-protection) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL0_HCLKSEL_HXT (0x00UL<= 2 \hideinitializer */ -#define CLK_PLLCTL_NF(x) ((x-2)<>30) & 0x3UL) /*!< Calculate AHBCLK/APBCLK offset on MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 \hideinitializer */ -#define MODULE_CLKSEL(x) (((x) >>28) & 0x3UL) /*!< Calculate CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3 \hideinitializer */ -#define MODULE_CLKSEL_Msk(x) (((x) >>25) & 0x7UL) /*!< Calculate CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos(x) (((x) >>20) & 0x1fUL) /*!< Calculate CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV(x) (((x) >>18) & 0x3UL) /*!< Calculate CLKDIV offset on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV3, 0x3:CLKDIV4 \hideinitializer */ -#define MODULE_CLKDIV_Msk(x) (((x) >>10) & 0xffUL) /*!< Calculate CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos(x) (((x) >>5 ) & 0x1fUL) /*!< Calculate CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos(x) (((x) >>0 ) & 0x1fUL) /*!< Calculate APBCLK offset on MODULE index \hideinitializer */ -#define MODULE_NoMsk 0x0 /*!< Not mask on MODULE index \hideinitializer */ -#define NA MODULE_NoMsk /*!< Not Available \hideinitializer */ - -#define MODULE_APBCLK_ENC(x) (((x) & 0x03UL) << 30) /*!< MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 \hideinitializer */ -#define MODULE_CLKSEL_ENC(x) (((x) & 0x03UL) << 28) /*!< CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3 \hideinitializer */ -#define MODULE_CLKSEL_Msk_ENC(x) (((x) & 0x07UL) << 25) /*!< CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos_ENC(x) (((x) & 0x1fUL) << 20) /*!< CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_ENC(x) (((x) & 0x03UL) << 18) /*!< APBCLK CLKDIV on MODULE index, 0x0:CLKDIV, 0x1:CLKDIV1, 0x2:CLKDIV3, 0x3:CLKDIV4 \hideinitializer */ -#define MODULE_CLKDIV_Msk_ENC(x) (((x) & 0xffUL) << 10) /*!< CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos_ENC(x) (((x) & 0x1fUL) << 5) /*!< CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos_ENC(x) (((x) & 0x1fUL) << 0) /*!< AHBCLK/APBCLK offset on MODULE index \hideinitializer */ - - -//AHBCLK -#define PDMA_MODULE (MODULE_APBCLK_ENC( 0)|MODULE_IP_EN_Pos_ENC(CLK_AHBCLK_PDMACKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< PDMA Module \hideinitializer */ - -#define ISP_MODULE (MODULE_APBCLK_ENC( 0)|MODULE_IP_EN_Pos_ENC(CLK_AHBCLK_ISPCKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ISP Module \hideinitializer */ - -#define EBI_MODULE (MODULE_APBCLK_ENC( 0)|MODULE_IP_EN_Pos_ENC(CLK_AHBCLK_EBICKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EBI Module \hideinitializer */ - -#define HDIV_MODULE (MODULE_APBCLK_ENC( 0)|MODULE_IP_EN_Pos_ENC(CLK_AHBCLK_HDIVCKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< HDIV Module \hideinitializer */ - -#define CRC_MODULE (MODULE_APBCLK_ENC( 0)|MODULE_IP_EN_Pos_ENC(CLK_AHBCLK_CRCCKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CRC Module \hideinitializer */ - -//APBCLK0 -#define WDT_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_WDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 3)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_WDTSEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< WDT Module \hideinitializer */ - -#define WWDT_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_WDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 3)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_WWDTSEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< WWDT Module \hideinitializer */ - -#define RTC_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_RTCCKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< RTC Module \hideinitializer */ - -#define TMR0_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_TMR0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_TMR0SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TMR0 Module \hideinitializer */ - -#define TMR1_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_TMR1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_TMR1SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TMR1 Module \hideinitializer */ - -#define TMR2_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_TMR2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_TMR2SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TMR2 Module \hideinitializer */ - -#define TMR3_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_TMR3CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_TMR3SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TMR3 Module \hideinitializer */ - -#define CLKO_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_CLKOCKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_CLKOSEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CLKO Module \hideinitializer */ - -#define UART0_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_UART0SEL_Pos)|\ - MODULE_CLKDIV_ENC( 0)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV0_UART0DIV_Pos)) /*!< UART0 Module \hideinitializer */ - -#define UART1_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL1_UART1SEL_Pos)|\ - MODULE_CLKDIV_ENC( 0)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV0_UART1DIV_Pos)) /*!< UART1 Module \hideinitializer */ - -#define UART2_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL3_UART2SEL_Pos)|\ - MODULE_CLKDIV_ENC( 3)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV4_UART2DIV_Pos)) /*!< UART2 Module \hideinitializer */ - -#define UART3_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART3CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL3_UART3SEL_Pos)|\ - MODULE_CLKDIV_ENC( 3)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV4_UART3DIV_Pos)) /*!< UART3 Module \hideinitializer */ - -#define UART4_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART4CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL3_UART4SEL_Pos)|\ - MODULE_CLKDIV_ENC( 3)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV4_UART4DIV_Pos)) /*!< UART4 Module \hideinitializer */ - -#define UART5_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART5CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL3_UART5SEL_Pos)|\ - MODULE_CLKDIV_ENC( 3)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV4_UART5DIV_Pos)) /*!< UART5 Module \hideinitializer */ - -#define UART6_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART6CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL3_UART6SEL_Pos)|\ - MODULE_CLKDIV_ENC( 3)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV4_UART6DIV_Pos)) /*!< UART6 Module \hideinitializer */ - -#define UART7_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_UART7CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3)|MODULE_CLKSEL_Msk_ENC( 7)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL3_UART7SEL_Pos)|\ - MODULE_CLKDIV_ENC( 3)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV4_UART7DIV_Pos)) /*!< UART7 Module \hideinitializer */ - -#define I2C0_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_I2C0CKEN_Pos) |\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C0 Module \hideinitializer */ - -#define I2C1_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_I2C1CKEN_Pos) |\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C1 Module \hideinitializer */ - -#define QSPI0_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_QSPI0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2)|MODULE_CLKSEL_Msk_ENC( 3)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL2_QSPI0SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< QSPI0 Module \hideinitializer */ - -#define SPI0_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_SPI0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2)|MODULE_CLKSEL_Msk_ENC( 3)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL2_SPI0SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI0 Module \hideinitializer */ - -#define ADC_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_ADCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2)|MODULE_CLKSEL_Msk_ENC( 3)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL2_ADCSEL_Pos)|\ - MODULE_CLKDIV_ENC( 0)|MODULE_CLKDIV_Msk_ENC(0xFF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV0_ADCDIV_Pos)) /*!< ADC Module \hideinitializer */ - -#define ACMP01_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_ACMP01CKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ACMP Module \hideinitializer */ - -#define USBD_MODULE (MODULE_APBCLK_ENC( 1)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK0_USBDCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0)|MODULE_CLKSEL_Msk_ENC( 1)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL0_USBDSEL_Pos)|\ - MODULE_CLKDIV_ENC( 0)|MODULE_CLKDIV_Msk_ENC(0xF)|MODULE_CLKDIV_Pos_ENC(CLK_CLKDIV0_USBDIV_Pos)) /*!< USBD Module \hideinitializer */ - -//APBCLK1 -#define PWM0_MODULE (MODULE_APBCLK_ENC( 2)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK1_PWM0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2)|MODULE_CLKSEL_Msk_ENC( 1)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL2_PWM0SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< PWM0 Module \hideinitializer */ - -#define PWM1_MODULE (MODULE_APBCLK_ENC( 2)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK1_PWM1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2)|MODULE_CLKSEL_Msk_ENC( 1)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL2_PWM1SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< PWM1 Module \hideinitializer */ - -#define BPWM0_MODULE (MODULE_APBCLK_ENC( 2)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK1_BPWM0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2)|MODULE_CLKSEL_Msk_ENC( 1)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL2_BPWM0SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< BPWM0 Module \hideinitializer */ - -#define BPWM1_MODULE (MODULE_APBCLK_ENC( 2)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK1_BPWM1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2)|MODULE_CLKSEL_Msk_ENC( 1)|MODULE_CLKSEL_Pos_ENC(CLK_CLKSEL2_BPWM1SEL_Pos)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< BPWM1 Module \hideinitializer */ - -#define USCI0_MODULE (MODULE_APBCLK_ENC( 2)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK1_USCI0CKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< USCI0 Module \hideinitializer */ - -#define USCI1_MODULE (MODULE_APBCLK_ENC( 2)|MODULE_IP_EN_Pos_ENC(CLK_APBCLK1_USCI1CKEN_Pos)|\ - MODULE_CLKSEL_ENC(NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< USCI1 Module \hideinitializer */ - -/*@}*/ /* end of group CLK_EXPORTED_CONSTANTS */ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/** - * @brief Get PLL Clock Output Frequency - * @param None - * @return PLL clock output frequency - * @details To get actual PLL clock output frequency. The clock uint is in Hz. - * \hideinitializer - */ -static __INLINE uint32_t CLK_GetPLLClockFreq(void) -{ - uint32_t u32PllFreq; - uint32_t u32FIN, u32NF, u32NR, u32NO; - uint8_t au8NoTbl[4] = {1, 2, 2, 4}; /* OUTDIV :DEF: {1, 2, 2, 4} */ - uint32_t u32Reg; - - u32PllFreq = 0; - u32Reg = CLK->PLLCTL; - - if ((u32Reg & (CLK_PLLCTL_PD_Msk | CLK_PLLCTL_OE_Msk)) == 0) - { - /* PLL is enabled and output enabled */ - if (u32Reg & CLK_PLLCTL_PLLSRC_Msk) - { - u32FIN = (__HIRC >> 2); - } else - u32FIN = __HXT; - - if (u32Reg & CLK_PLLCTL_BP_Msk) - { - /* PLL is in bypass mode */ - u32PllFreq = u32FIN; - } - else - { - /* PLL is in normal work mode */ - u32NO = au8NoTbl[((u32Reg & CLK_PLLCTL_OUTDIV_Msk) >> CLK_PLLCTL_OUTDIV_Pos)]; - u32NF = ((u32Reg & CLK_PLLCTL_FBDIV_Msk) >> CLK_PLLCTL_FBDIV_Pos) + 2; - u32NR = ((u32Reg & CLK_PLLCTL_INDIV_Msk) >> CLK_PLLCTL_INDIV_Pos) + 2; - /* u32FIN is shifted 2 bits to avoid overflow */ - u32PllFreq = (((u32FIN >> 2) * u32NF) / (u32NR * u32NO) << 2); - } - } - - return u32PllFreq; -} - -/** - * @brief This function execute delay function. - * @param[in] us Delay time. The Max value is 2^24 / CPU Clock(MHz). Ex: - * 50MHz => 335544us, 48MHz => 349525us, 28MHz => 699050us ... - * @return None - * @details Use the SysTick to generate the delay time and the UNIT is in us. - * The SysTick clock source is from HCLK, i.e. the same as system core clock. - * User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function. - * \hideinitializer - */ -__STATIC_INLINE void CLK_SysTickDelay(uint32_t us) -{ - SysTick->LOAD = us * CyclesPerUs; - SysTick->VAL = (0x00); - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0); - - /* Disable SysTick counter */ - SysTick->CTRL = 0; -} - - -/** - * @brief Get current UART0 clock frquency. - * @param None. - * @return UART0 clock frquency. The clock UNIT is in Hz. - * \hideinitializer - */ -static __INLINE uint32_t CLK_GetUARTFreq(void) -{ - uint32_t u32Freqout, u32AHBDivider, u32ClkSel, PCLK0Div; - - u32Freqout = 0; - u32ClkSel = CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk ; - - if (u32ClkSel == CLK_CLKSEL1_UART0SEL_HXT) /* external HXT crystal clock */ - { - u32Freqout = __HXT; - } - else if(u32ClkSel == CLK_CLKSEL1_UART0SEL_PLL) /* PLL clock */ - { - u32Freqout = CLK_GetPLLClockFreq(); - } - else if(u32ClkSel == CLK_CLKSEL1_UART0SEL_LXT) /* LXT clock */ - { - u32Freqout = __LXT; - } - else if(u32ClkSel == CLK_CLKSEL1_UART0SEL_HIRC) /* HIRC clock */ - { - u32Freqout = __HIRC; - } - else if(u32ClkSel == CLK_CLKSEL1_UART0SEL_PCLK0) /* PCLK0 clock */ - { - PCLK0Div = (CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) >> CLK_PCLKDIV_APB0DIV_Pos; - u32Freqout = (SystemCoreClock >> PCLK0Div); - } - else if(u32ClkSel == CLK_CLKSEL1_UART0SEL_LIRC) /* LIRC clock */ - { - u32Freqout = __LIRC; - } - - u32AHBDivider = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) + 1 ; - - return (u32Freqout/u32AHBDivider); -} - - -uint32_t CLK_WaitClockReady(uint32_t); -void CLK_DisableCKO(void); -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En); -uint32_t CLK_GetHCLKFreq(void); -uint32_t CLK_GetCPUFreq(void); -uint32_t CLK_GetLXTFreq(void); -uint32_t CLK_GetHXTFreq(void); -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv); -uint32_t CLK_SetCoreClock(uint32_t u32Hclk); -uint32_t CLK_GetPCLK0Freq(void); -uint32_t CLK_GetPCLK1Freq(void); -void CLK_EnableXtalRC(uint32_t u32ClkMask); -void CLK_DisableXtalRC(uint32_t u32ClkMask); -void CLK_DisableModuleClock(uint32_t u32ModuleIdx); -void CLK_EnableModuleClock(uint32_t u32ModuleIdx); -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_DisablePLL(void); -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq); -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc); -void CLK_DisableSysTick(void); -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count); -void CLK_PowerDown(void); -void CLK_Idle(void); - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CLK_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_crc.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_crc.h deleted file mode 100644 index 5090bdf1d4c..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_crc.h +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** - * @file nu_crc.h - * @version V1.00 - * $Revision: 9 $ - * $Date: 18/07/09 4:18p $ - * @brief M031 series CRC driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -****************************************************************************/ - -#ifndef __NU_CRC_H__ -#define __NU_CRC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_CONSTANTS CRC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* CRC Polynomial Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CRC_CCITT (0UL << CRC_CTL_CRCMODE_Pos) /*!SEED = (u32Seed); CRC->CTL |= CRC_CTL_CHKSINIT_Msk; }while(0) - -/** - * @brief Get CRC Seed Value - * - * @param None - * - * @return CRC seed value - * - * @details This macro gets the current CRC seed value. - * \hideinitializer - */ -#define CRC_GET_SEED() (CRC->SEED) - -/** - * @brief CRC Write Data - * - * @param[in] u32Data Write data - * - * @return None - * - * @details User can write data directly to CRC Write Data Register(CRC_DAT) by this macro to perform CRC operation. - * \hideinitializer - */ -#define CRC_WRITE_DATA(u32Data) (CRC->DAT = (u32Data)) - -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen); -uint32_t CRC_GetChecksum(void); - -/*@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CRC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_ebi.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_ebi.h deleted file mode 100644 index ae66aa18b62..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_ebi.h +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************//** - * @file nu_ebi.h - * @version V1.00 - * $Revision: 3 $ - * $Date: 18/06/07 2:32p $ - * @brief M031 series External Bus Interface(EBI) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EBI_H__ -#define __NU_EBI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_CONSTANTS EBI Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0_BASE_ADDR 0x60000000UL /*!< EBI bank0 base address \hideinitializer */ -#define EBI_BANK1_BASE_ADDR 0x60100000UL /*!< EBI bank1 base address \hideinitializer */ -#define EBI_MAX_SIZE 0x00100000UL /*!< Maximum EBI size for each bank is 1 MB \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI bank number */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0 0UL /*!< EBI bank 0 \hideinitializer */ -#define EBI_BANK1 1UL /*!< EBI bank 1 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI data bus width */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BUSWIDTH_8BIT 8UL /*!< EBI bus width is 8-bit \hideinitializer */ -#define EBI_BUSWIDTH_16BIT 16UL /*!< EBI bus width is 16-bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI CS Active Level */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_CS_ACTIVE_LOW 0UL /*!< EBI CS active level is low \hideinitializer */ -#define EBI_CS_ACTIVE_HIGH 1UL /*!< EBI CS active level is high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI MCLK divider and Timing */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_MCLKDIV_1 0x0UL /*!< EBI output clock(MCLK) is HCLK/1 \hideinitializer */ -#define EBI_MCLKDIV_2 0x1UL /*!< EBI output clock(MCLK) is HCLK/2 \hideinitializer */ -#define EBI_MCLKDIV_4 0x2UL /*!< EBI output clock(MCLK) is HCLK/4 \hideinitializer */ -#define EBI_MCLKDIV_8 0x3UL /*!< EBI output clock(MCLK) is HCLK/8 \hideinitializer */ -#define EBI_MCLKDIV_16 0x4UL /*!< EBI output clock(MCLK) is HCLK/16 \hideinitializer */ -#define EBI_MCLKDIV_32 0x5UL /*!< EBI output clock(MCLK) is HCLK/32 \hideinitializer */ - -#define EBI_TIMING_FASTEST 0x0UL /*!< EBI timing is the fastest \hideinitializer */ -#define EBI_TIMING_VERYFAST 0x1UL /*!< EBI timing is very fast \hideinitializer */ -#define EBI_TIMING_FAST 0x2UL /*!< EBI timing is fast \hideinitializer */ -#define EBI_TIMING_NORMAL 0x3UL /*!< EBI timing is normal \hideinitializer */ -#define EBI_TIMING_SLOW 0x4UL /*!< EBI timing is slow \hideinitializer */ -#define EBI_TIMING_VERYSLOW 0x5UL /*!< EBI timing is very slow \hideinitializer */ -#define EBI_TIMING_SLOWEST 0x6UL /*!< EBI timing is the slowest \hideinitializer */ - -#define EBI_OPMODE_NORMAL 0x0UL /*!< EBI bus operate in normal mode \hideinitializer */ -#define EBI_OPMODE_CACCESS (EBI_CTL_CACCESS_Msk) /*!< EBI bus operate in Continuous Data Access mode \hideinitializer */ - -/*@}*/ /* end of group EBI_EXPORTED_CONSTANTS */ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Read 8-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank0. - */ -#define EBI0_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank0. - */ -#define EBI0_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank0. - */ -#define EBI0_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank0. - */ -#define EBI0_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank0. - */ -#define EBI0_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank0. - */ -#define EBI0_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank1. - */ -#define EBI1_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank1. - */ -#define EBI1_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank1. - */ -#define EBI1_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank1. - */ -#define EBI1_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank1. - */ -#define EBI1_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank1. - */ -#define EBI1_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Enable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to improve EBI write operation for EBI bank0 and bank1. - */ -#define EBI_ENABLE_WRITE_BUFFER() (EBI->CTL0 |= EBI_CTL_WBUFEN_Msk); - -/** - * @brief Disable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to disable EBI write buffer function. - */ -#define EBI_DISABLE_WRITE_BUFFER() (EBI->CTL0 &= ~EBI_CTL_WBUFEN_Msk); - -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel); -void EBI_Close(uint32_t u32Bank); -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv); - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_EBI_H__ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_fmc.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_fmc.h deleted file mode 100644 index b6cf1b4b779..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_fmc.h +++ /dev/null @@ -1,269 +0,0 @@ -/**************************************************************************//** - * @file nu_fmc.h - * @version V1.00 - * $Revision: 11 $ - * $Date: 18/06/20 3:38p $ - * @brief M031 Series Flash Memory Controller Driver Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_FMC_H__ -#define __NU_FMC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - - -/** @addtogroup FMC_EXPORTED_CONSTANTS FMC Exported Constants - @{ -*/ - -//#define PAGE_SIZE_2048 /*!< Please enable the compiler option for 2K page size */ - -/*----------------------------------------------------------------------------------------------------------*/ -/* Define Base Address */ -/*----------------------------------------------------------------------------------------------------------*/ -#define FMC_APROM_BASE 0x00000000UL /*!< APROM base address \hideinitializer */ -#define FMC_LDROM_BASE 0x00100000UL /*!< LDROM Base Address \hideinitializer */ -#define FMC_SPROM_BASE 0x00200000UL /*!< SPROM Base Address \hideinitializer */ -#define FMC_CONFIG_BASE 0x00300000UL /*!< CONFIG Base Address \hideinitializer */ -#define FMC_USER_CONFIG_0 0x00300000UL /*!< User Config 0 address \hideinitializer */ -#define FMC_USER_CONFIG_1 0x00300004UL /*!< User Config 1 address \hideinitializer */ -#define FMC_USER_CONFIG_2 0x00300008UL /*!< User Config 2 address \hideinitializer */ - -#ifndef PAGE_SIZE_2048 -#define FMC_FLASH_PAGE_SIZE (0x200) /*!< Flash Page Size (512 bytes) \hideinitializer */ -#define FMC_PAGE_ADDR_MASK (0xFFFFFE00UL) /*!< Flash page address mask \hideinitializer */ - -#define FMC_SPROM_SIZE (0x200) /*!< SPROM Size (512 bytes) \hideinitializer */ -#else -#define FMC_FLASH_PAGE_SIZE (0x800) /*!< Flash Page Size (2048 bytes) \hideinitializer */ -#define FMC_PAGE_ADDR_MASK (0xFFFFF800UL) /*!< Flash page address mask \hideinitializer */ - -#define FMC_SPROM_SIZE (0x800) /*!< SPROM Size (2048 bytes) \hideinitializer */ -#endif - -#define FMC_MULTI_WORD_PROG_LEN (256UL) /*!< The length of a multi-word program. \hideinitializer */ - -/*----------------------------------------------------------------------------------------------------------*/ -/* ISPCMD constant definitions */ -/*----------------------------------------------------------------------------------------------------------*/ -#define FMC_ISPCMD_READ 0x00UL /*!< ISP Command: Read flash word \hideinitializer */ -#define FMC_ISPCMD_READ_UID 0x04UL /*!< ISP Command: Read Unique ID \hideinitializer */ -#define FMC_ISPCMD_READ_ALL1 0x08UL /*!< ISP Command: Read all-one result \hideinitializer */ // I version -#define FMC_ISPCMD_READ_CID 0x0BUL /*!< ISP Command: Read Company ID \hideinitializer */ -#define FMC_ISPCMD_READ_DID 0x0CUL /*!< ISP Command: Read Device ID \hideinitializer */ -#define FMC_ISPCMD_READ_CKS 0x0DUL /*!< ISP Command: Read checksum \hideinitializer */ -#define FMC_ISPCMD_PROGRAM 0x21UL /*!< ISP Command: Write flash word \hideinitializer */ -#define FMC_ISPCMD_PROGRAM_64 0x61UL /*!< ISP Command: 64-bit program Flash \hideinitializer */ -#define FMC_ISPCMD_PAGE_ERASE 0x22UL /*!< ISP Command: Page Erase Flash \hideinitializer */ -#define FMC_ISPCMD_BANK_ERASE 0x23UL /*!< ISP Command: Bank Erase Flash \hideinitializer */ -#define FMC_ISPCMD_MULTI_PROG 0x27UL /*!< ISP Command: Flash Multi-Word Program \hideinitializer */ -#define FMC_ISPCMD_RUN_ALL1 0x28UL /*!< ISP Command: Run all-one verification \hideinitializer */ // I version -#define FMC_ISPCMD_RUN_CKS 0x2DUL /*!< ISP Command: Run checksum calculation \hideinitializer */ -#define FMC_ISPCMD_BANK_REMAP 0x2CUL /*!< ISP Command: Bank Remap \hideinitializer */ -#define FMC_ISPCMD_VECMAP 0x2EUL /*!< ISP Command: Vector Page Remap \hideinitializer */ - -#define IS_BOOT_FROM_APROM 0UL /*!< Is booting from APROM \hideinitializer */ -#define IS_BOOT_FROM_LDROM 1UL /*!< Is booting from LDROM \hideinitializer */ - -#define READ_ALLONE_YES 0xA11FFFFFUL /*!< Check-all-one result is all one. \hideinitializer */ -#define READ_ALLONE_NOT 0xA1100000UL /*!< Check-all-one result is not all one. \hideinitializer */ -#define READ_ALLONE_CMD_FAIL 0xFFFFFFFFUL /*!< Check-all-one command failed. \hideinitializer */ -/*@}*/ /* end of group FMC_EXPORTED_CONSTANTS */ - - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macros */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define FMC_SET_APROM_BOOT() (FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk) /*!< Select booting from APROM \hideinitializer */ -#define FMC_SET_LDROM_BOOT() (FMC->ISPCTL |= FMC_ISPCTL_BS_Msk) /*!< Select booting from LDROM \hideinitializer */ -#define FMC_ENABLE_AP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk) /*!< Enable APROM update \hideinitializer */ -#define FMC_DISABLE_AP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk) /*!< Disable APROM update \hideinitializer */ -#define FMC_ENABLE_CFG_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) /*!< Enable User Config update \hideinitializer */ -#define FMC_DISABLE_CFG_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk) /*!< Disable User Config update \hideinitializer */ -#define FMC_ENABLE_LD_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) /*!< Enable LDROM update \hideinitializer */ -#define FMC_DISABLE_LD_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk) /*!< Disable LDROM update \hideinitializer */ -#define FMC_ENABLE_SP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_SPUEN_Msk) /*!< Enable SPROM update \hideinitializer */ -#define FMC_DISABLE_SP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_SPUEN_Msk) /*!< Disable SPROM update \hideinitializer */ -#define FMC_DISABLE_ISP() (FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk) /*!< Disable ISP function \hideinitializer */ -#define FMC_ENABLE_ISP() (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) /*!< Enable ISP function \hideinitializer */ -#define FMC_GET_FAIL_FLAG() ((FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) ? 1UL : 0UL) /*!< Get ISP fail flag \hideinitializer */ -#define FMC_CLR_FAIL_FLAG() (FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk) /*!< Clear ISP fail flag \hideinitializer */ -#define FMC_ENABLE_ISP_INT() (FMC->ISPCTL |= FMC_ISPCTL_INTEN_Msk) /*!< Enable ISP interrupt */ -#define FMC_DISABLE_ISP_INT() (FMC->ISPCTL &= ~FMC_ISPCTL_INTEN_Msk) /*!< Disable ISP interrupt */ -#define FMC_GET_ISP_INT_FLAG() ((FMC->ISPSTS & FMC_ISPSTS_INTFLAG_Msk) ? 1UL : 0UL) /*!< Get ISP interrupt flag Status */ -#define FMC_CLEAR_ISP_INT_FLAG() (FMC->ISPSTS = FMC_ISPSTS_INTFLAG_Msk) /*!< Clear ISP interrupt flag*/ - -/*---------------------------------------------------------------------------------------------------------*/ - -__STATIC_INLINE uint32_t FMC_ReadCID(void); -__STATIC_INLINE uint32_t FMC_ReadPID(void); -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index); -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index); -__STATIC_INLINE void FMC_SetVectorPageAddr(uint32_t u32PageAddr); -__STATIC_INLINE uint32_t FMC_GetVECMAP(void); - -/** - * @brief Get current vector mapping address. - * @param None - * @return The current vector mapping address. - * @details To get VECMAP value which is the page address for remapping to vector page (0x0). - * @note - * VECMAP only valid when new IAP function is enabled. (CBS = 10'b or 00'b) - */ -__STATIC_INLINE uint32_t FMC_GetVECMAP(void) -{ - return (FMC->ISPSTS & FMC_ISPSTS_VECMAP_Msk); -} - -/** - * @brief Read company ID - * @param None - * @return The company ID (32-bit) - * @details The company ID of Nuvoton is fixed to be 0xDA - */ -__STATIC_INLINE uint32_t FMC_ReadCID(void) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_CID; /* Set ISP Command Code */ - FMC->ISPADDR = 0x0u; /* Must keep 0x0 when read CID */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC->ISPDAT; -} - -/** - * @brief Read product ID - * @param None - * @return The product ID (32-bit) - * @details This function is used to read product ID. - */ -__STATIC_INLINE uint32_t FMC_ReadPID(void) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_DID; /* Set ISP Command Code */ - FMC->ISPADDR = 0x04u; /* Must keep 0x4 when read PID */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC->ISPDAT; -} - -/** - * @brief Read Unique ID - * @param[in] u8Index UID index. 0 = UID[31:0], 1 = UID[63:32], 2 = UID[95:64] - * @return The 32-bit unique ID data of specified UID index. - * @details To read out 96-bit Unique ID. - */ -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_UID; - FMC->ISPADDR = ((uint32_t)u8Index << 2u); - FMC->ISPDAT = 0u; - FMC->ISPTRG = 0x1u; -#if ISBEN - __ISB(); -#endif - while (FMC->ISPTRG) {} - - return FMC->ISPDAT; -} - -/** - * @brief To read UCID - * @param[in] u32Index Index of the UCID to read. u32Index must be 0, 1, 2, or 3. - * @return The UCID of specified index - * @details This function is used to read unique chip ID (UCID). - */ -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_UID; /* Set ISP Command Code */ - FMC->ISPADDR = (0x04u * u32Index) + 0x10u; /* The UCID is at offset 0x10 with word alignment. */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC->ISPDAT; -} - -/** - * @brief Set vector mapping address - * @param[in] u32PageAddr The page address to remap to address 0x0. The address must be page alignment. - * @return To set VECMAP to remap specified page address to 0x0. - * @details This function is used to set VECMAP to map specified page to vector page (0x0). - * @note - * VECMAP only valid when new IAP function is enabled. (CBS = 10'b or 00'b) - */ -__STATIC_INLINE void FMC_SetVectorPageAddr(uint32_t u32PageAddr) -{ - FMC->ISPCMD = FMC_ISPCMD_VECMAP; /* Set ISP Command Code */ - FMC->ISPADDR = u32PageAddr; /* The address of specified page which will be map to address 0x0. It must be page alignment. */ - FMC->ISPTRG = 0x1u; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG) {} /* Waiting for ISP Done */ -} - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -extern void FMC_Close(void); -extern int32_t FMC_Erase(uint32_t u32PageAddr); -extern int32_t FMC_Erase_SPROM(void); -extern int32_t FMC_Erase_Bank(uint32_t u32BankAddr); -extern int32_t FMC_GetBootSource(void); -extern void FMC_Open(void); -extern uint32_t FMC_Read(uint32_t u32Addr); -extern uint32_t FMC_ReadDataFlashBaseAddr(void); -extern void FMC_SetBootSource(int32_t i32BootSrc); -extern void FMC_Write(uint32_t u32Addr, uint32_t u32Data); -extern int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1); -extern int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count); -extern int32_t FMC_WriteConfig(uint32_t u32Config[], uint32_t u32Count); -extern uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count); -extern uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count); -extern int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len); -extern int32_t FMC_RemapBank(uint32_t u32BankIdx); - -/*@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group FMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_FMC_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_gpio.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_gpio.h deleted file mode 100644 index bf0f4dc57a8..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_gpio.h +++ /dev/null @@ -1,481 +0,0 @@ -/**************************************************************************//** - * @file nu_gpio.h - * @version V0.10 - * $Revision: 2 $ - * $Date: 18/12/20 6:49p $ - * @brief M031 Series General Purpose I/O (GPIO) Driver Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_GPIO_H__ -#define __NU_GPIO_H__ - -#include "M031Series.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_CONSTANTS GPIO Exported Constants - @{ -*/ - -#define GPIO_PIN_MAX 16 /*!< Specify Maximum Pins of Each GPIO Port \hideinitializer */ - - -/* Define GPIO Pin Data Input/Output. It could be used to control each I/O pin by pin address mapping. - Example 1: - - PA0 = 1; - - It is used to set GPIO PA.0 to high; - - Example 2: - - if (PA0) - PA0 = 0; - - If GPIO PA.0 pin status is high, then set GPIO PA.0 data output to low. - */ -#define GPIO_PIN_DATA(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2)))) /*!< Specify GPIO Pin Data Input/Output \hideinitializer */ -#define PA0 GPIO_PIN_DATA(0, 0 ) /*!< Specify PA.0 Pin Data Input/Output \hideinitializer */ -#define PA1 GPIO_PIN_DATA(0, 1 ) /*!< Specify PA.1 Pin Data Input/Output \hideinitializer */ -#define PA2 GPIO_PIN_DATA(0, 2 ) /*!< Specify PA.2 Pin Data Input/Output \hideinitializer */ -#define PA3 GPIO_PIN_DATA(0, 3 ) /*!< Specify PA.3 Pin Data Input/Output \hideinitializer */ -#define PA4 GPIO_PIN_DATA(0, 4 ) /*!< Specify PA.4 Pin Data Input/Output \hideinitializer */ -#define PA5 GPIO_PIN_DATA(0, 5 ) /*!< Specify PA.5 Pin Data Input/Output \hideinitializer */ -#define PA6 GPIO_PIN_DATA(0, 6 ) /*!< Specify PA.6 Pin Data Input/Output \hideinitializer */ -#define PA7 GPIO_PIN_DATA(0, 7 ) /*!< Specify PA.7 Pin Data Input/Output \hideinitializer */ -#define PA8 GPIO_PIN_DATA(0, 8 ) /*!< Specify PA.8 Pin Data Input/Output \hideinitializer */ -#define PA9 GPIO_PIN_DATA(0, 9 ) /*!< Specify PA.9 Pin Data Input/Output \hideinitializer */ -#define PA10 GPIO_PIN_DATA(0, 10) /*!< Specify PA.10 Pin Data Input/Output \hideinitializer */ -#define PA11 GPIO_PIN_DATA(0, 11) /*!< Specify PA.11 Pin Data Input/Output \hideinitializer */ -#define PA12 GPIO_PIN_DATA(0, 12) /*!< Specify PA.12 Pin Data Input/Output \hideinitializer */ -#define PA13 GPIO_PIN_DATA(0, 13) /*!< Specify PA.13 Pin Data Input/Output \hideinitializer */ -#define PA14 GPIO_PIN_DATA(0, 14) /*!< Specify PA.14 Pin Data Input/Output \hideinitializer */ -#define PA15 GPIO_PIN_DATA(0, 15) /*!< Specify PA.15 Pin Data Input/Output \hideinitializer */ - -#define PB0 GPIO_PIN_DATA(1, 0 ) /*!< Specify PB.0 Pin Data Input/Output \hideinitializer */ -#define PB1 GPIO_PIN_DATA(1, 1 ) /*!< Specify PB.1 Pin Data Input/Output \hideinitializer */ -#define PB2 GPIO_PIN_DATA(1, 2 ) /*!< Specify PB.2 Pin Data Input/Output \hideinitializer */ -#define PB3 GPIO_PIN_DATA(1, 3 ) /*!< Specify PB.3 Pin Data Input/Output \hideinitializer */ -#define PB4 GPIO_PIN_DATA(1, 4 ) /*!< Specify PB.4 Pin Data Input/Output \hideinitializer */ -#define PB5 GPIO_PIN_DATA(1, 5 ) /*!< Specify PB.5 Pin Data Input/Output \hideinitializer */ -#define PB6 GPIO_PIN_DATA(1, 6 ) /*!< Specify PB.6 Pin Data Input/Output \hideinitializer */ -#define PB7 GPIO_PIN_DATA(1, 7 ) /*!< Specify PB.7 Pin Data Input/Output \hideinitializer */ -#define PB8 GPIO_PIN_DATA(1, 8 ) /*!< Specify PB.8 Pin Data Input/Output \hideinitializer */ -#define PB9 GPIO_PIN_DATA(1, 9 ) /*!< Specify PB.9 Pin Data Input/Output \hideinitializer */ -#define PB10 GPIO_PIN_DATA(1, 10) /*!< Specify PB.10 Pin Data Input/Output \hideinitializer */ -#define PB11 GPIO_PIN_DATA(1, 11) /*!< Specify PB.11 Pin Data Input/Output \hideinitializer */ -#define PB12 GPIO_PIN_DATA(1, 12) /*!< Specify PB.12 Pin Data Input/Output \hideinitializer */ -#define PB13 GPIO_PIN_DATA(1, 13) /*!< Specify PB.13 Pin Data Input/Output \hideinitializer */ -#define PB14 GPIO_PIN_DATA(1, 14) /*!< Specify PB.14 Pin Data Input/Output \hideinitializer */ -#define PB15 GPIO_PIN_DATA(1, 15) /*!< Specify PB.15 Pin Data Input/Output \hideinitializer */ - -#define PC0 GPIO_PIN_DATA(2, 0 ) /*!< Specify PC.0 Pin Data Input/Output \hideinitializer */ -#define PC1 GPIO_PIN_DATA(2, 1 ) /*!< Specify PC.1 Pin Data Input/Output \hideinitializer */ -#define PC2 GPIO_PIN_DATA(2, 2 ) /*!< Specify PC.2 Pin Data Input/Output \hideinitializer */ -#define PC3 GPIO_PIN_DATA(2, 3 ) /*!< Specify PC.3 Pin Data Input/Output \hideinitializer */ -#define PC4 GPIO_PIN_DATA(2, 4 ) /*!< Specify PC.4 Pin Data Input/Output \hideinitializer */ -#define PC5 GPIO_PIN_DATA(2, 5 ) /*!< Specify PC.5 Pin Data Input/Output \hideinitializer */ -#define PC6 GPIO_PIN_DATA(2, 6 ) /*!< Specify PC.6 Pin Data Input/Output \hideinitializer */ -#define PC7 GPIO_PIN_DATA(2, 7 ) /*!< Specify PC.7 Pin Data Input/Output \hideinitializer */ -#define PC8 GPIO_PIN_DATA(2, 8 ) /*!< Specify PC.8 Pin Data Input/Output \hideinitializer */ -#define PC9 GPIO_PIN_DATA(2, 9 ) /*!< Specify PC.9 Pin Data Input/Output \hideinitializer */ -#define PC10 GPIO_PIN_DATA(2, 10) /*!< Specify PC.10 Pin Data Input/Output \hideinitializer */ -#define PC11 GPIO_PIN_DATA(2, 11) /*!< Specify PC.11 Pin Data Input/Output \hideinitializer */ -#define PC12 GPIO_PIN_DATA(2, 12) /*!< Specify PC.12 Pin Data Input/Output \hideinitializer */ -#define PC13 GPIO_PIN_DATA(2, 13) /*!< Specify PC.13 Pin Data Input/Output \hideinitializer */ -#define PC14 GPIO_PIN_DATA(2, 14) /*!< Specify PC.14 Pin Data Input/Output \hideinitializer */ - -#define PD0 GPIO_PIN_DATA(3, 0 ) /*!< Specify PD.0 Pin Data Input/Output \hideinitializer */ -#define PD1 GPIO_PIN_DATA(3, 1 ) /*!< Specify PD.1 Pin Data Input/Output \hideinitializer */ -#define PD2 GPIO_PIN_DATA(3, 2 ) /*!< Specify PD.2 Pin Data Input/Output \hideinitializer */ -#define PD3 GPIO_PIN_DATA(3, 3 ) /*!< Specify PD.3 Pin Data Input/Output \hideinitializer */ -#define PD4 GPIO_PIN_DATA(3, 4 ) /*!< Specify PD.4 Pin Data Input/Output \hideinitializer */ -#define PD5 GPIO_PIN_DATA(3, 5 ) /*!< Specify PD.5 Pin Data Input/Output \hideinitializer */ -#define PD6 GPIO_PIN_DATA(3, 6 ) /*!< Specify PD.6 Pin Data Input/Output \hideinitializer */ -#define PD7 GPIO_PIN_DATA(3, 7 ) /*!< Specify PD.7 Pin Data Input/Output \hideinitializer */ -#define PD8 GPIO_PIN_DATA(3, 8 ) /*!< Specify PD.8 Pin Data Input/Output \hideinitializer */ -#define PD9 GPIO_PIN_DATA(3, 9 ) /*!< Specify PD.9 Pin Data Input/Output \hideinitializer */ -#define PD10 GPIO_PIN_DATA(3, 10) /*!< Specify PD.10 Pin Data Input/Output \hideinitializer */ -#define PD11 GPIO_PIN_DATA(3, 11) /*!< Specify PD.11 Pin Data Input/Output \hideinitializer */ -#define PD12 GPIO_PIN_DATA(3, 12) /*!< Specify PD.12 Pin Data Input/Output \hideinitializer */ -#define PD13 GPIO_PIN_DATA(3, 13) /*!< Specify PD.13 Pin Data Input/Output \hideinitializer */ -#define PD14 GPIO_PIN_DATA(3, 14) /*!< Specify PD.14 Pin Data Input/Output \hideinitializer */ -#define PD15 GPIO_PIN_DATA(3, 15) /*!< Specify PD.15 Pin Data Input/Output \hideinitializer */ - -#define PE0 GPIO_PIN_DATA(4, 0 ) /*!< Specify PE.0 Pin Data Input/Output \hideinitializer */ -#define PE1 GPIO_PIN_DATA(4, 1 ) /*!< Specify PE.1 Pin Data Input/Output \hideinitializer */ -#define PE2 GPIO_PIN_DATA(4, 2 ) /*!< Specify PE.2 Pin Data Input/Output \hideinitializer */ -#define PE3 GPIO_PIN_DATA(4, 3 ) /*!< Specify PE.3 Pin Data Input/Output \hideinitializer */ -#define PE4 GPIO_PIN_DATA(4, 4 ) /*!< Specify PE.4 Pin Data Input/Output \hideinitializer */ -#define PE5 GPIO_PIN_DATA(4, 5 ) /*!< Specify PE.5 Pin Data Input/Output \hideinitializer */ -#define PE6 GPIO_PIN_DATA(4, 6 ) /*!< Specify PE.6 Pin Data Input/Output \hideinitializer */ -#define PE7 GPIO_PIN_DATA(4, 7 ) /*!< Specify PE.7 Pin Data Input/Output \hideinitializer */ -#define PE8 GPIO_PIN_DATA(4, 8 ) /*!< Specify PE.8 Pin Data Input/Output \hideinitializer */ -#define PE9 GPIO_PIN_DATA(4, 9 ) /*!< Specify PE.9 Pin Data Input/Output \hideinitializer */ -#define PE10 GPIO_PIN_DATA(4, 10) /*!< Specify PE.10 Pin Data Input/Output \hideinitializer */ -#define PE11 GPIO_PIN_DATA(4, 11) /*!< Specify PE.11 Pin Data Input/Output \hideinitializer */ -#define PE12 GPIO_PIN_DATA(4, 12) /*!< Specify PE.12 Pin Data Input/Output \hideinitializer */ -#define PE13 GPIO_PIN_DATA(4, 13) /*!< Specify PE.13 Pin Data Input/Output \hideinitializer */ -#define PE14 GPIO_PIN_DATA(4, 14) /*!< Specify PE.14 Pin Data Input/Output \hideinitializer */ -#define PE15 GPIO_PIN_DATA(4, 15) /*!< Specify PE.15 Pin Data Input/Output \hideinitializer */ - -#define PF0 GPIO_PIN_DATA(5, 0 ) /*!< Specify PF.0 Pin Data Input/Output \hideinitializer */ -#define PF1 GPIO_PIN_DATA(5, 1 ) /*!< Specify PF.1 Pin Data Input/Output \hideinitializer */ -#define PF2 GPIO_PIN_DATA(5, 2 ) /*!< Specify PF.2 Pin Data Input/Output \hideinitializer */ -#define PF3 GPIO_PIN_DATA(5, 3 ) /*!< Specify PF.3 Pin Data Input/Output \hideinitializer */ -#define PF4 GPIO_PIN_DATA(5, 4 ) /*!< Specify PF.4 Pin Data Input/Output \hideinitializer */ -#define PF5 GPIO_PIN_DATA(5, 5 ) /*!< Specify PF.5 Pin Data Input/Output \hideinitializer */ -#define PF6 GPIO_PIN_DATA(5, 6 ) /*!< Specify PF.6 Pin Data Input/Output \hideinitializer */ -#define PF7 GPIO_PIN_DATA(5, 7 ) /*!< Specify PF.7 Pin Data Input/Output \hideinitializer */ -#define PF8 GPIO_PIN_DATA(5, 8 ) /*!< Specify PF.8 Pin Data Input/Output \hideinitializer */ -#define PF9 GPIO_PIN_DATA(5, 9 ) /*!< Specify PF.9 Pin Data Input/Output \hideinitializer */ -#define PF10 GPIO_PIN_DATA(5, 10) /*!< Specify PF.10 Pin Data Input/Output \hideinitializer */ -#define PF11 GPIO_PIN_DATA(5, 11) /*!< Specify PF.11 Pin Data Input/Output \hideinitializer */ -#define PF14 GPIO_PIN_DATA(5, 14) /*!< Specify PF.14 Pin Data Input/Output \hideinitializer */ -#define PF15 GPIO_PIN_DATA(5, 15) /*!< Specify PF.15 Pin Data Input/Output \hideinitializer */ - -#define PG2 GPIO_PIN_DATA(6, 2 ) /*!< Specify PG.2 Pin Data Input/Output \hideinitializer */ -#define PG3 GPIO_PIN_DATA(6, 3 ) /*!< Specify PG.3 Pin Data Input/Output \hideinitializer */ -#define PG4 GPIO_PIN_DATA(6, 4 ) /*!< Specify PG.4 Pin Data Input/Output \hideinitializer */ -#define PG9 GPIO_PIN_DATA(6, 9 ) /*!< Specify PG.9 Pin Data Input/Output \hideinitializer */ -#define PG10 GPIO_PIN_DATA(6, 10) /*!< Specify PG.10 Pin Data Input/Output \hideinitializer */ -#define PG11 GPIO_PIN_DATA(6, 11) /*!< Specify PG.11 Pin Data Input/Output \hideinitializer */ -#define PG12 GPIO_PIN_DATA(6, 12) /*!< Specify PG.12 Pin Data Input/Output \hideinitializer */ -#define PG13 GPIO_PIN_DATA(6, 13) /*!< Specify PG.13 Pin Data Input/Output \hideinitializer */ -#define PG14 GPIO_PIN_DATA(6, 14) /*!< Specify PG.14 Pin Data Input/Output \hideinitializer */ -#define PG15 GPIO_PIN_DATA(6, 15) /*!< Specify PG.15 Pin Data Input/Output \hideinitializer */ - -#define PH4 GPIO_PIN_DATA(7, 4 ) /*!< Specify PH.4 Pin Data Input/Output \hideinitializer */ -#define PH5 GPIO_PIN_DATA(7, 5 ) /*!< Specify PH.5 Pin Data Input/Output \hideinitializer */ -#define PH6 GPIO_PIN_DATA(7, 6 ) /*!< Specify PH.6 Pin Data Input/Output \hideinitializer */ -#define PH7 GPIO_PIN_DATA(7, 7 ) /*!< Specify PH.7 Pin Data Input/Output \hideinitializer */ -#define PH8 GPIO_PIN_DATA(7, 8 ) /*!< Specify PH.8 Pin Data Input/Output \hideinitializer */ -#define PH9 GPIO_PIN_DATA(7, 9 ) /*!< Specify PH.9 Pin Data Input/Output \hideinitializer */ -#define PH10 GPIO_PIN_DATA(7, 10) /*!< Specify PH.10 Pin Data Input/Output \hideinitializer */ -#define PH11 GPIO_PIN_DATA(7, 11) /*!< Specify PH.11 Pin Data Input/Output \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_MODE_INPUT 0x0UL /*!< Input Mode \hideinitializer */ -#define GPIO_MODE_OUTPUT 0x1UL /*!< Output Mode \hideinitializer */ -#define GPIO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode \hideinitializer */ -#define GPIO_MODE_QUASI 0x3UL /*!< Quasi-bidirectional Mode \hideinitializer */ -#define GPIO_MODE(pin, mode) ((mode) << ((pin)<<1)) /*!< Generate the PMD mode setting for each pin \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Interrupt Type Constant Definitions (Parameter of GPIO_EnableInt()) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INT_RISING 0x00010000UL /*!< Interrupt enable by Input Rising Edge \hideinitializer */ -#define GPIO_INT_FALLING 0x00000001UL /*!< Interrupt enable by Input Falling Edge \hideinitializer */ -#define GPIO_INT_BOTH_EDGE 0x00010001UL /*!< Interrupt enable by both Rising Edge and Falling Edge \hideinitializer */ -#define GPIO_INT_HIGH 0x01010000UL /*!< Interrupt enable by Level-High \hideinitializer */ -#define GPIO_INT_LOW 0x01000001UL /*!< Interrupt enable by Level-Low \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_INTTYPE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INTTYPE_EDGE 0UL /*!< GPIO_INTTYPE Setting for Edge Trigger Mode \hideinitializer */ -#define GPIO_INTTYPE_LEVEL 1UL /*!< GPIO_INTTYPE Setting for Level Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_DBCTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_DBCTL_ICLK_OFF (0x0UL<INTSRC = (u32PinMask)) - -/** - * @brief Disable Pin De-bounce Function - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PD, and PE. - * It could be BIT0 ~ BIT14 for PC. - * It could be BIT0 ~ BIT11, BIT14, and BIT15 for PF. - * It could be BIT2 ~ BIT4, and BIT9 ~ BIT15 for PG. - * It could be BIT4 ~ BIT11 for PH. - * @return None - * @details Disable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask)) - -/** - * @brief Enable Pin De-bounce Function - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PD, and PE. - * It could be BIT0 ~ BIT14 for PC. - * It could be BIT0 ~ BIT11, BIT14, and BIT15 for PF. - * It could be BIT2 ~ BIT4, and BIT9 ~ BIT15 for PG. - * It could be BIT4 ~ BIT11 for PH. - * @return None - * @details Enable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask)) - -/** - * @brief Disable I/O Digital Input Path - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PD, and PE. - * It could be BIT0 ~ BIT14 for PC. - * It could be BIT0 ~ BIT11, BIT14, and BIT15 for PF. - * It could be BIT2 ~ BIT4, and BIT9 ~ BIT15 for PG. - * It could be BIT4 ~ BIT11 for PH. - * @return None - * @details Disable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16)) - -/** - * @brief Enable I/O Digital Input Path - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PD, and PE. - * It could be BIT0 ~ BIT14 for PC. - * It could be BIT0 ~ BIT11, BIT14, and BIT15 for PF. - * It could be BIT2 ~ BIT4, and BIT9 ~ BIT15 for PG. - * It could be BIT4 ~ BIT11 for PH. - * @return None - * @details Enable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16)) - -/** - * @brief Disable I/O DOUT mask - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PD, and PE. - * It could be BIT0 ~ BIT14 for PC. - * It could be BIT0 ~ BIT11, BIT14, and BIT15 for PF. - * It could be BIT2 ~ BIT4, and BIT9 ~ BIT15 for PG. - * It could be BIT4 ~ BIT11 for PH. - * @return None - * @details Disable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask)) - -/** - * @brief Enable I/O DOUT mask - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PD, and PE. - * It could be BIT0 ~ BIT14 for PC. - * It could be BIT0 ~ BIT11, BIT14, and BIT15 for PF. - * It could be BIT2 ~ BIT4, and BIT9 ~ BIT15 for PG. - * It could be BIT4 ~ BIT11 for PH. - * @return None - * @details Enable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask)) - -/** - * @brief Get GPIO Pin Interrupt Flag - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PD, and PE. - * It could be BIT0 ~ BIT14 for PC. - * It could be BIT0 ~ BIT11, BIT14, and BIT15 for PF. - * It could be BIT2 ~ BIT4, and BIT9 ~ BIT15 for PG. - * It could be BIT4 ~ BIT11 for PH. - * @retval 0 No interrupt at specified GPIO pin - * @retval 1 The specified GPIO pin generate an interrupt - * @details Get the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask)) - -/** - * @brief Set De-bounce Sampling Cycle Time - * @param[in] u32ClkSrc The de-bounce counter clock source. It could be - * - \ref GPIO_DBCTL_DBCLKSRC_HCLK - * - \ref GPIO_DBCTL_DBCLKSRC_LIRC - * @param[in] u32ClkSel The de-bounce sampling cycle selection. It could be - * - \ref GPIO_DBCTL_DBCLKSEL_1 - * - \ref GPIO_DBCTL_DBCLKSEL_2 - * - \ref GPIO_DBCTL_DBCLKSEL_4 - * - \ref GPIO_DBCTL_DBCLKSEL_8 - * - \ref GPIO_DBCTL_DBCLKSEL_16 - * - \ref GPIO_DBCTL_DBCLKSEL_32 - * - \ref GPIO_DBCTL_DBCLKSEL_64 - * - \ref GPIO_DBCTL_DBCLKSEL_128 - * - \ref GPIO_DBCTL_DBCLKSEL_256 - * - \ref GPIO_DBCTL_DBCLKSEL_512 - * - \ref GPIO_DBCTL_DBCLKSEL_1024 - * - \ref GPIO_DBCTL_DBCLKSEL_2048 - * - \ref GPIO_DBCTL_DBCLKSEL_4096 - * - \ref GPIO_DBCTL_DBCLKSEL_8192 - * - \ref GPIO_DBCTL_DBCLKSEL_16384 - * - \ref GPIO_DBCTL_DBCLKSEL_32768 - * @return None - * @details Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source. \n - * Example: GPIO_SET_DEBOUNCE_TIME(GPIO_DBCTL_DBCLKSRC_LIRC, GPIO_DBCTL_DBCLKSEL_4). \n - * It's meaning the de-bounce counter clock source is LIRC (38.4 KHz) and sampling cycle selection is 4. \n - * Then the target de-bounce sampling cycle time is (4)*(1/38400) s = 4*26.042 us = 104.168 us, - * and system will sampling interrupt input once per 104.168 us. - * \hideinitializer - */ -#define GPIO_SET_DEBOUNCE_TIME(u32ClkSrc, u32ClkSel) (GPIO->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) - -/** - * @brief Set GPIO Interrupt Clock on bit - * @param[in] port Not used in M031. - * @return None - * @details Set the I/O pins edge detection circuit always active after reset for specified port. - * \hideinitializer - */ -#define GPIO_SET_DEBOUNCE_ICLKON(port) (GPIO->DBCTL |= GPIO_DBCTL_ICLKON_Msk) - -/** - * @brief Clear GPIO Interrupt Clock on bit - * @param[in] port Not used in M031. - * @return None - * @details Set edge detection circuit active only if I/O pin edge interrupt enabled for specified port - * \hideinitializer - */ -#define GPIO_CLR_DEBOUNCE_ICLKON(port) (GPIO->DBCTL &= ~(GPIO_DBCTL_ICLKON_Msk)) - -/** - * @brief Get GPIO Port IN Data - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @return The specified port data - * @details Get the PIN register of specified GPIO port. - * \hideinitializer - */ -#define GPIO_GET_IN_DATA(port) ((port)->PIN) - -/** - * @brief Set GPIO Port OUT Data - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, or PH. - * @param[in] u32Data GPIO port data. - * @return None - * @details Set the Data into specified GPIO port. - * \hideinitializer - */ -#define GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data)) - -/** - * @brief Toggle Specified GPIO pin - * @param[in] u32Pin Pxy - * @return None - * @details Toggle the specified GPIO pint. - * \hideinitializer - */ -#define GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1) - -/** - * @brief Enable External GPIO interrupt - * @param[in] port GPIO port. It could be PA, PB, PC, PD, or PF. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PD, and PE. - * It could be 0 ~ 14 for PC. - * It could be 0 ~ 11, 14, and 15 for PF. - * It could be 2 ~ 4, and 9 ~ 15 for PG. - * It could be 4 ~ 11 for PH. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be - * - \ref GPIO_INT_RISING - * - \ref GPIO_INT_FALLING - * - \ref GPIO_INT_BOTH_EDGE - * - \ref GPIO_INT_HIGH - * - \ref GPIO_INT_LOW - * @return None - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_EnableEINT GPIO_EnableInt - -/** - * @brief Disable External GPIO interrupt - * @param[in] port GPIO port. It could be PA, PB, PC, PD, or PF. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PD, and PE. - * It could be 0 ~ 14 for PC. - * It could be 0 ~ 11, 14, and 15 for PF. - * It could be 2 ~ 4, and 9 ~ 15 for PG. - * It could be 4 ~ 11 for PH. - * @return None - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_DisableEINT GPIO_DisableInt - - -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs); -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin); - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_GPIO_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_hdiv.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_hdiv.h deleted file mode 100644 index 8013b9f797f..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_hdiv.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************//** - * @file nu_hdiv.h - * @version V1.00 - * $Revision: 1 $ - * $Date: 18/07/25 3:42p $ - * @brief M031 series Hardware Divider(HDIV) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_HDIV_H__ -#define __NU_HDIV_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HDIV_Driver HDIV Driver - @{ -*/ - -/** @addtogroup HDIV_EXPORTED_FUNCTIONS HDIV Exported Functions - @{ -*/ - -/** - * @brief Division function to calculate (x/y) - * - * @param[in] x the dividend of the division - * @param[in] y the divisor of the division - * - * @return The result of (x/y) - * - * @details This is a division function to calculate x/y - * - */ -static __INLINE int32_t HDIV_Div(int32_t x, int16_t y) -{ - uint32_t *p32; - - p32 = (uint32_t *)HDIV_BASE; - *p32++ = x; - *p32++ = y; - return *p32; -} - - -/** - * @brief To calculate the remainder of x/y, i.e., the result of x mod y. - * - * @param[in] x the dividend of the division - * @param[in] y the divisor of the division - * - * @return The remainder of (x/y) - * - * @details This function is used to calculate the remainder of x/y. - */ -static __INLINE int16_t HDIV_Mod(int32_t x, int16_t y) -{ - uint32_t *p32; - - p32 = (uint32_t *)HDIV_BASE; - *p32++ = x; - *p32++ = y; - return p32[1]; -} - -/*@}*/ /* end of group HDIV_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HDIV_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_HDIV_H__ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_i2c.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_i2c.h deleted file mode 100644 index 70ddf334799..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_i2c.h +++ /dev/null @@ -1,540 +0,0 @@ -/****************************************************************************//** - * @file nu_i2c.h - * @version V1.00 - * @brief M031 series I2C driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_I2C_H__ -#define __NU_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - -/** @addtogroup I2C_EXPORTED_CONSTANTS I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_CTL_STA_SI 0x28UL /*!< I2C_CTL setting for I2C control bits. It would set STA and SI bits \hideinitializer */ -#define I2C_CTL_STA_SI_AA 0x2CUL /*!< I2C_CTL setting for I2C control bits. It would set STA, SI and AA bits \hideinitializer */ -#define I2C_CTL_STO_SI 0x18UL /*!< I2C_CTL setting for I2C control bits. It would set STO and SI bits \hideinitializer */ -#define I2C_CTL_STO_SI_AA 0x1CUL /*!< I2C_CTL setting for I2C control bits. It would set STO, SI and AA bits \hideinitializer */ -#define I2C_CTL_SI 0x08UL /*!< I2C_CTL setting for I2C control bits. It would set SI bit \hideinitializer */ -#define I2C_CTL_SI_AA 0x0CUL /*!< I2C_CTL setting for I2C control bits. It would set SI and AA bits \hideinitializer */ -#define I2C_CTL_STA 0x20UL /*!< I2C_CTL setting for I2C control bits. It would set STA bit \hideinitializer */ -#define I2C_CTL_STO 0x10UL /*!< I2C_CTL setting for I2C control bits. It would set STO bit \hideinitializer */ -#define I2C_CTL_AA 0x04UL /*!< I2C_CTL setting for I2C control bits. It would set AA bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_GCMODE_ENABLE 1 /*!< Enable I2C GC Mode \hideinitializer */ -#define I2C_GCMODE_DISABLE 0 /*!< Disable I2C GC Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C SMBUS constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_SMBH_ENABLE 1 /*!< Enable SMBus Host Mode enable \hideinitializer */ -#define I2C_SMBD_ENABLE 0 /*!< Enable SMBus Device Mode enable \hideinitializer */ -#define I2C_PECTX_ENABLE 1 /*!< Enable SMBus Packet Error Check Transmit function \hideinitializer */ -#define I2C_PECTX_DISABLE 0 /*!< Disable SMBus Packet Error Check Transmit function \hideinitializer */ - -/*@}*/ /* end of group I2C_EXPORTED_CONSTANTS */ - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ -/** - * @brief The macro is used to set I2C bus condition at One Time - * - * @param[in] i2c Specify I2C port - * @param[in] u8Ctrl A byte writes to I2C control register - * - * @return None - * - * @details Set I2C_CTL register to control I2C bus conditions of START, STOP, SI, ACK. - * \hideinitializer - */ -#define I2C_SET_CONTROL_REG(i2c, u8Ctrl) ((i2c)->CTL0 = ((i2c)->CTL0 & ~0x3C) | (u8Ctrl)) - -/** - * @brief The macro is used to set START condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus START condition in I2C_CTL register. - * \hideinitializer - */ -#define I2C_START(i2c) ((i2c)->CTL0 = ((i2c)->CTL0 | I2C_CTL0_SI_Msk) | I2C_CTL0_STA_Msk) - -/** - * @brief The macro is used to wait I2C bus status get ready - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When a new status is presented of I2C bus, the SI flag will be set in I2C_CTL register. - * \hideinitializer - */ -#define I2C_WAIT_READY(i2c) while(!((i2c)->CTL0 & I2C_CTL0_SI_Msk)) - -/** - * @brief The macro is used to Read I2C Bus Data Register - * - * @param[in] i2c Specify I2C port - * - * @return A byte of I2C data register - * - * @details I2C controller read data from bus and save it in I2C_DAT register. - * \hideinitializer - */ -#define I2C_GET_DATA(i2c) ((i2c)->DAT) - -/** - * @brief Write a Data to I2C Data Register - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data A byte that writes to data register - * - * @return None - * - * @details When write a data to I2C_DAT register, the I2C controller will shift it to I2C bus. - * \hideinitializer - */ -#define I2C_SET_DATA(i2c, u8Data) ((i2c)->DAT = (u8Data)) - -/** - * @brief Get I2C Bus status code - * - * @param[in] i2c Specify I2C port - * - * @return I2C status code - * - * @details To get this status code to monitor I2C bus event. - * \hideinitializer - */ -#define I2C_GET_STATUS(i2c) ((i2c)->STATUS0) - -/** - * @brief Get Time-out flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 I2C Bus time-out is not happened - * @retval 1 I2C Bus time-out is happened - * - * @details When I2C bus occurs time-out event, the time-out flag will be set. - * \hideinitializer - */ -#define I2C_GET_TIMEOUT_FLAG(i2c) ( ((i2c)->TOCTL & I2C_TOCTL_TOIF_Msk) == I2C_TOCTL_TOIF_Msk ? 1:0 ) - -/** - * @brief To get wake-up flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details I2C bus occurs wake-up event, wake-up flag will be set. - * \hideinitializer - */ -#define I2C_GET_WAKEUP_FLAG(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKIF_Msk) == I2C_WKSTS_WKIF_Msk ? 1:0 ) - -/** - * @brief To clear wake-up flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define I2C_CLEAR_WAKEUP_FLAG(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKIF_Msk) - -/** - * @brief To get wake-up address frame ACK done flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 The ACK bit cycle of address match frame is not done - * @retval 1 The ACK bit cycle of address match frame is done in power-down - * - * @details I2C bus occurs wake-up event and address frame ACK is done, this flag will be set. - * \hideinitializer - */ -#define I2C_GET_WAKEUP_DONE(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKAKDONE_Msk) == I2C_WKSTS_WKAKDONE_Msk ? 1 : 0) - -/** - * @brief To clear address frame ACK done flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up done is set, use this macro to clear it. - * \hideinitializer - */ -#define I2C_CLEAR_WAKEUP_DONE(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKAKDONE_Msk) - -/** - * @brief To get read/write status bit in address wakeup frame - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Write command be record on the address match wakeup frame - * @retval 1 Read command be record on the address match wakeup frame. - * - * @details I2C bus occurs wake-up event and address frame is received, this bit will record read/write status. - * \hideinitializer -*/ -#define I2C_GET_WAKEUP_WR_STATUS(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WRSTSWK_Msk) == I2C_WKSTS_WRSTSWK_Msk ? 1 : 0) - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * \hideinitializer - * - */ -#define I2C_SMBUS_GET_STATUS(i2c) ((i2c)->BUSSTS) - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return Packet error check byte value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * \hideinitializer - */ -#define I2C_SMBUS_GET_PEC_VALUE(i2c) ((i2c)->PKTCRC) - -/** - * @brief Set SMBus Bytes number of Transmission or reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * \hideinitializer - */ -#define I2C_SMBUS_SET_PACKET_BYTE_COUNT(i2c, u32PktSize) ((i2c)->PKTSIZE = (u32PktSize)) - -/** - * @brief Enable SMBus Alert function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin will pull lo, and reply ACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin is supported to receive alert state(Lo trigger) - * \hideinitializer - */ -#define I2C_SMBUS_ENABLE_ALERT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Disable SMBus Alert pin function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin will pull hi, and reply NACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin is not supported to receive alert state(Lo trigger) - * \hideinitializer - */ -#define I2C_SMBUS_DISABLE_ALERT(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is output mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output mode. - * - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_OUT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is input mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is input mode. - * - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_IN(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin output high state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output hi state. - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_HIGH(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOSTS_Msk) - - -/** - * @brief Set SMBus SUSCON pin output low state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output lo state. - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_LOW(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOSTS_Msk) - -/** - * @brief Enable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The 9th bit can response the ACK or NACK according the received data by user. When the byte is received, SCLK line stretching to low between the 8th and 9th SCLK pulse. - * \hideinitializer - */ -#define I2C_SMBUS_ACK_MANUAL(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Disable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable acknowledge response control by user. - * \hideinitializer - */ -#define I2C_SMBUS_ACK_AUTO(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Enable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * \hideinitializer - */ -#define I2C_SMBUS_9THBIT_INT_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Disable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * \hideinitializer - */ -#define I2C_SMBUS_9THBIT_INT_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Enable SMBus PEC clear at REPEAT START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable the condition of REAEAT START can clear the PEC calculation. - * \hideinitializer - */ -#define I2C_SMBUS_RST_PEC_AT_START_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Disable SMBus PEC clear at Repeat START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable the condition of Repeat START can clear the PEC calculation. - * \hideinitializer - */ -#define I2C_SMBUS_RST_PEC_AT_START_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Enable RX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set RXPDMAEN bit of I2C_CTL1 register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_RX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Enable TX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set TXPDMAEN bit of I2C_CTL1 register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_TX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear RXPDMAEN bit of I2C_CTL1 register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_RX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear TXPDMAEN bit of I2C_CTL1 register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_TX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Enable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Enable this function is to stretch bus by hardware after PDMA transfer is done if SI is not cleared. - * \hideinitializer - */ -#define I2C_ENABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Disable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C will send STOP after PDMA transfers done automatically. - * \hideinitializer - */ -#define I2C_DISABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Reset PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C PDMA engine will be reset after this function is called. - * \hideinitializer - */ -#define I2C_DISABLE_RST_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMARST_Msk) - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c); - -/** - * @brief The macro is used to set STOP condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus STOP condition in I2C_CTL register. - */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c) -{ - - (i2c)->CTL0 |= (I2C_CTL0_SI_Msk | I2C_CTL0_STO_Msk); - while(i2c->CTL0 & I2C_CTL0_STO_Msk) - { - } -} - -void I2C_ClearTimeoutFlag(I2C_T *i2c); -void I2C_Close(I2C_T *i2c); -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack); -void I2C_DisableInt(I2C_T *i2c); -void I2C_EnableInt(I2C_T *i2c); -uint32_t I2C_GetBusClockFreq(I2C_T *i2c); -uint32_t I2C_GetIntFlag(I2C_T *i2c); -uint32_t I2C_GetStatus(I2C_T *i2c); -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock); -uint8_t I2C_GetData(I2C_T *i2c); -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode); -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask); -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock); -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout); -void I2C_DisableTimeout(I2C_T *i2c); -void I2C_EnableWakeup(I2C_T *i2c); -void I2C_DisableWakeup(I2C_T *i2c); -void I2C_SetData(I2C_T *i2c, uint8_t u8Data); -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr); -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint32_t I2C_SMBusGetStatus(I2C_T *i2c); -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag); -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize); -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice); -void I2C_SMBusClose(I2C_T *i2c); -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn); -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c); -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk); -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pdma.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pdma.h deleted file mode 100644 index 10fcaabc872..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pdma.h +++ /dev/null @@ -1,358 +0,0 @@ -/**************************************************************************//** - * @file nu_pdma.h - * @version V1.00 - * @brief M031 series PDMA driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PDMA_H__ -#define __NU_PDMA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - -/** @addtogroup PDMA_EXPORTED_CONSTANTS PDMA Exported Constants - @{ -*/ -#define PDMA_CH_MAX 9UL /*!< Specify Maximum Channels of PDMA \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Operation Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_OP_STOP 0x00000000UL /*!INTSTS)) - -/** - * @brief Get Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_TD_STS(pdma) ((uint32_t)((pdma)->TDSTS)) - -/** - * @brief Clear Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TD_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->TDSTS = (u32Mask))) - -/** - * @brief Get Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ABORT_STS(pdma) ((uint32_t)((pdma)->ABTSTS)) - -/** - * @brief Clear Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ABORT_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->ABTSTS = (u32Mask))) - -/** - * @brief Get Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ALIGN_STS(pdma) ((uint32_t)((pdma)->ALIGN)) - -/** - * @brief Clear Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ALIGN_FLAG(pdma,u32Mask) ((uint32_t)((pdma)->ALIGN = (u32Mask))) - -/** - * @brief Clear Timeout Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details Clear the selected channel timeout interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TMOUT_FLAG(pdma, u32Ch) ((uint32_t)((pdma)->INTSTS = (1UL << ((u32Ch) + 8UL)))) - -/** - * @brief Check Channel Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @retval 0 Idle state - * @retval 1 Busy state - * - * @details Check the selected channel is busy or not. - * \hideinitializer - */ -#define PDMA_IS_CH_BUSY(pdma, u32Ch) ((uint32_t)((pdma)->TRGSTS & (1UL << (u32Ch)))? 1 : 0) - -/** - * @brief Set Source Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel source address. - * \hideinitializer - */ -#define PDMA_SET_SRC_ADDR(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].SA = (u32Addr))) - -/** - * @brief Set Destination Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel destination address. - * \hideinitializer - */ -#define PDMA_SET_DST_ADDR(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].DA = (u32Addr))) - -/** - * @brief Set Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32TransCount Transfer Count - * - * @return None - * - * @details This macro set the selected channel transfer count. - * \hideinitializer - */ -#define PDMA_SET_TRANS_CNT(pdma, u32Ch, u32TransCount) ((uint32_t)((pdma)->DSCT[(u32Ch)].CTL=((pdma)->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1UL) << PDMA_DSCT_CTL_TXCNT_Pos))) - -/** - * @brief Set Scatter-gather descriptor Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The descriptor address - * - * @return None - * - * @details This macro set the selected channel scatter-gather descriptor address. - * \hideinitializer - */ -#define PDMA_SET_SCATTER_DESC(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].NEXT = (u32Addr) - ((pdma)->SCATBA))) - -/** - * @brief Stop the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro stop the selected channel. - * \hideinitializer - */ -#define PDMA_STOP(pdma, u32Ch) ((uint32_t)((pdma)->PAUSE = (1UL << (u32Ch)))) - -/** - * @brief Pause the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro pause the selected channel. - * \hideinitializer - */ -#define PDMA_PAUSE(pdma, u32Ch) ((uint32_t)((pdma)->PAUSE = (1UL << (u32Ch)))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define PDMA functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_Close(PDMA_T *pdma); -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount); -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl); -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr); -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize); -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt); -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch); -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); - - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_PDMA_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pwm.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pwm.h deleted file mode 100644 index 45539bdc17d..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_pwm.h +++ /dev/null @@ -1,514 +0,0 @@ -/**************************************************************************//** - * @file nu_pwm.h - * @version V1.00 - * $Revision: 9 $ - * $Date: 18/06/07 3:47p $ - * @brief M031 series PWM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PWM_H__ -#define __NU_PWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PWM_Driver PWM Driver - @{ -*/ - -/** @addtogroup PWM_EXPORTED_CONSTANTS PWM Exported Constants - @{ -*/ -#define PWM_CHANNEL_NUM (6UL) /*!< PWM channel number \hideinitializer */ -#define PWM_CH_0_MASK (0x1UL) /*!< PWM channel 0 mask \hideinitializer */ -#define PWM_CH_1_MASK (0x2UL) /*!< PWM channel 1 mask \hideinitializer */ -#define PWM_CH_2_MASK (0x4UL) /*!< PWM channel 2 mask \hideinitializer */ -#define PWM_CH_3_MASK (0x8UL) /*!< PWM channel 3 mask \hideinitializer */ -#define PWM_CH_4_MASK (0x10UL) /*!< PWM channel 4 mask \hideinitializer */ -#define PWM_CH_5_MASK (0x20UL) /*!< PWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PWM_UP_COUNTER (0UL) /*!< Up counter type \hideinitializer */ -#define PWM_DOWN_COUNTER (1UL) /*!< Down counter type \hideinitializer */ -#define PWM_UP_DOWN_COUNTER (2UL) /*!< Up-Down counter type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PWM_EDGE_ALIGNED (1UL) /*!< PWM working in edge aligned type(down count) \hideinitializer */ -#define PWM_CENTER_ALIGNED (2UL) /*!< PWM working in center aligned type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PWM_OUTPUT_NOTHING (0UL) /*!< PWM output nothing \hideinitializer */ -#define PWM_OUTPUT_LOW (1UL) /*!< PWM output low \hideinitializer */ -#define PWM_OUTPUT_HIGH (2UL) /*!< PWM output high \hideinitializer */ -#define PWM_OUTPUT_TOGGLE (3UL) /*!< PWM output toggle \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PWM_SSCTL_SSRC_PWM0 (0UL<CTL1 = (pwm)->CTL1 | (0x7ul<CTL1 = (pwm)->CTL1 & ~(0x7ul<SSCTL = ((pwm)->SSCTL & ~PWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | (u32ChannelMask)) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define PWM_DISABLE_TIMER_SYNC(pwm, u32ChannelMask) \ - do{ \ - int i;\ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (pwm)->SSCTL &= ~(1UL << i); \ - } \ - }while(0) - -/** - * @brief This macro enable PWM counter synchronous start counting function. - * @param[in] pwm The pointer of the specified PWM module - * @return None - * @details This macro is used to make selected PWM0 and PWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by PWM_ENABLE_TIMER_SYNC() and PWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define PWM_TRIGGER_SYNC_START(pwm) ((pwm)->SSTRG = PWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to enable output inverter of specified channel(s). - * \hideinitializer - */ -#define PWM_ENABLE_OUTPUT_INVERTER(pwm, u32ChannelMask) ((pwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured rising data of specified channel. - * \hideinitializer - */ -#define PWM_GET_CAPTURE_RISING_DATA(pwm, u32ChannelNum) (*(__IO uint32_t *) (&((pwm)->RCAPDAT0) + ((u32ChannelNum) << 1))) - -/** - * @brief This macro get captured falling data - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured falling data of specified channel. - * \hideinitializer - */ -#define PWM_GET_CAPTURE_FALLING_DATA(pwm, u32ChannelNum) (*(__IO uint32_t *) (&((pwm)->FCAPDAT0) + ((u32ChannelNum) << 1))) - -/** - * @brief This macro mask output logic to high or low - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define PWM_MASK_OUTPUT(pwm, u32ChannelMask, u32LevelMask) \ - { \ - (pwm)->MSKEN = (u32ChannelMask); \ - (pwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of the selected channel - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @return None - * @details This macro is used to set the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of PWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define PWM_SET_PRESCALER(pwm, u32ChannelNum, u32Prescaler) ((pwm)->CLKPSC[(u32ChannelNum) >> 1] = (u32Prescaler)) - -/** - * @brief This macro get the prescaler of the selected channel - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return Return Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @details This macro is used to get the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of PWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define PWM_GET_PRESCALER(pwm, u32ChannelNum) (*(__IO uint32_t *) (&((pwm)->CLKPSC[0]) + ((u32ChannelNum) >> 1))) - -/** - * @brief This macro set the comparator of the selected channel - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the comparator of specified channel. - * @note This new setting will take effect on next PWM period. - * \hideinitializer - */ -#define PWM_SET_CMR(pwm, u32ChannelNum, u32CMR) ((pwm)->CMPDAT[(u32ChannelNum)]= (u32CMR)) - -/** - * @brief This macro get the comparator of the selected channel - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return Return the comparator of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the comparator of specified channel. - * \hideinitializer - */ -#define PWM_GET_CMR(pwm, u32ChannelNum) ((pwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the period of the selected channel - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the period of specified channel. - * @note This new setting will take effect on next PWM period. - * @note PWM counter will stop if period length set to 0. - * \hideinitializer - */ -#define PWM_SET_CNR(pwm, u32ChannelNum, u32CNR) ((pwm)->PERIOD[(u32ChannelNum>>1)<<1] = (u32CNR)) - -/** - * @brief This macro get the period of the selected channel - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return Return the period of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the period of specified channel. - * \hideinitializer - */ -#define PWM_GET_CNR(pwm, u32ChannelNum) ((pwm)->PERIOD[(u32ChannelNum>>1)<<1]) - -/** - * @brief This macro set the PWM aligned type - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32AlignedType PWM aligned type, valid values are: - * - \ref PWM_EDGE_ALIGNED - * - \ref PWM_CENTER_ALIGNED - * @return None - * @details This macro is used to set the PWM aligned type of specified channel(s). - * \hideinitializer - */ -#define PWM_SET_ALIGNED_TYPE(pwm, u32ChannelMask, u32AlignedType) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (pwm)->CTL1 = (((pwm)->CTL1 & ~(3UL << (i << 1))) | ((u32AlignedType) << (i << 1))); \ - } \ - }while(0) - -/** - * @brief Clear counter of specified channel(s) - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to clear counter of specified channel(s). - * \hideinitializer - */ -#define PWM_CLR_COUNTER(pwm, u32ChannelMask) \ - do{ \ - uint32_t i; \ - for(i = 0UL; i < 6UL; i++) { \ - if((u32ChannelMask) & (1UL << i)) \ - ((pwm)->CNTCLR |= (1UL << ((i >> 1UL) << 1UL))); \ - } \ - }while(0) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref PWM_OUTPUT_NOTHING - * - \ref PWM_OUTPUT_LOW - * - \ref PWM_OUTPUT_HIGH - * - \ref PWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref PWM_OUTPUT_NOTHING - * - \ref PWM_OUTPUT_LOW - * - \ref PWM_OUTPUT_HIGH - * - \ref PWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref PWM_OUTPUT_NOTHING - * - \ref PWM_OUTPUT_LOW - * - \ref PWM_OUTPUT_HIGH - * - \ref PWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref PWM_OUTPUT_NOTHING - * - \ref PWM_OUTPUT_LOW - * - \ref PWM_OUTPUT_HIGH - * - \ref PWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s). - * \hideinitializer - */ -#define PWM_SET_OUTPUT_LEVEL(pwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) { \ - (pwm)->WGCTL0 = (((pwm)->WGCTL0 & ~(3UL << (i << 1))) | ((u32ZeroLevel) << (i << 1))); \ - (pwm)->WGCTL0 = (((pwm)->WGCTL0 & ~(3UL << (PWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))) | ((u32PeriodLevel) << (PWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))); \ - (pwm)->WGCTL1 = (((pwm)->WGCTL1 & ~(3UL << (i << 1))) | ((u32CmpUpLevel) << (i << 1))); \ - (pwm)->WGCTL1 = (((pwm)->WGCTL1 & ~(3UL << (PWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))) | ((u32CmpDownLevel) << (PWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))); \ - } \ - } \ - }while(0) - -/** - * @brief Trigger brake event from specified channel(s) - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @param[in] u32BrakeType Type of brake trigger. PWM_FB_EDGE of this macro is only supported in M45xD/M45xC. - * - \ref PWM_FB_EDGE - * - \ref PWM_FB_LEVEL - * @return None - * @details This macro is used to trigger brake event from specified channel(s). - * \hideinitializer - */ -#define PWM_TRIGGER_BRAKE(pwm, u32ChannelMask, u32BrakeType) ((pwm)->SWBRK |= ((u32ChannelMask) << (u32BrakeType))) - -/** - * @brief Set Dead zone clock source - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32AfterPrescaler Dead zone clock source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @return None - * @details This macro is used to set Dead zone clock source. Every two channels share the same setting. - * @note The write-protection function should be disabled before using this function. - * @note This function is only supported in M45xD/M45xC. - * \hideinitializer - */ -#define PWM_SET_DEADZONE_CLK_SRC(pwm, u32ChannelNum, u32AfterPrescaler) \ - ((pwm)->DTCTL[(u32ChannelNum) >> 1] = (((pwm)->DTCTL[(u32ChannelNum) >> 1] & ~PWM_DTCTL0_1_DTCKSEL_Msk) | \ - ((u32AfterPrescaler) << PWM_DTCTL0_1_DTCKSEL_Pos))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define PWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t PWM_ConfigCaptureChannel(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t PWM_ConfigOutputChannel(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void PWM_Start(PWM_T *pwm, uint32_t u32ChannelMask); -void PWM_Stop(PWM_T *pwm, uint32_t u32ChannelMask); -void PWM_ForceStop(PWM_T *pwm, uint32_t u32ChannelMask); -void PWM_EnableADCTrigger(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void PWM_DisableADCTrigger(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_ClearADCTriggerFlag(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t PWM_GetADCTriggerFlag(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_EnableFaultBrake(PWM_T *pwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource); -void PWM_EnableCapture(PWM_T *pwm, uint32_t u32ChannelMask); -void PWM_DisableCapture(PWM_T *pwm, uint32_t u32ChannelMask); -void PWM_EnableOutput(PWM_T *pwm, uint32_t u32ChannelMask); -void PWM_DisableOutput(PWM_T *pwm, uint32_t u32ChannelMask); -void PWM_EnablePDMA(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode); -void PWM_DisablePDMA(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_EnableDeadZone(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Duration); -void PWM_DisableDeadZone(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_EnableCaptureInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void PWM_DisableCaptureInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void PWM_ClearCaptureIntFlag(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t PWM_GetCaptureIntFlag(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_EnableDutyInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void PWM_DisableDutyInt(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_ClearDutyIntFlag(PWM_T *pwm, uint32_t u32ChannelNum); -uint32_t PWM_GetDutyIntFlag(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_EnableFaultBrakeInt(PWM_T *pwm, uint32_t u32BrakeSource); -void PWM_DisableFaultBrakeInt(PWM_T *pwm, uint32_t u32BrakeSource); -void PWM_ClearFaultBrakeIntFlag(PWM_T *pwm, uint32_t u32BrakeSource); -uint32_t PWM_GetFaultBrakeIntFlag(PWM_T *pwm, uint32_t u32BrakeSource); -void PWM_EnablePeriodInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void PWM_DisablePeriodInt(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_ClearPeriodIntFlag(PWM_T *pwm, uint32_t u32ChannelNum); -uint32_t PWM_GetPeriodIntFlag(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_EnableZeroInt(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_DisableZeroInt(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_ClearZeroIntFlag(PWM_T *pwm, uint32_t u32ChannelNum); -uint32_t PWM_GetZeroIntFlag(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_EnableLoadMode(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void PWM_DisableLoadMode(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void PWM_SetClockSource(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -void PWM_EnableBrakeNoiseFilter(PWM_T *pwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void PWM_DisableBrakeNoiseFilter(PWM_T *pwm, uint32_t u32BrakePinNum); -void PWM_EnableBrakePinInverse(PWM_T *pwm, uint32_t u32BrakePinNum); -void PWM_DisableBrakePinInverse(PWM_T *pwm, uint32_t u32BrakePinNum); -void PWM_SetBrakePinSource(PWM_T *pwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule); -uint32_t PWM_GetWrapAroundFlag(PWM_T *pwm, uint32_t u32ChannelNum); -void PWM_ClearWrapAroundFlag(PWM_T *pwm, uint32_t u32ChannelNum); - -/*@}*/ /* end of group PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_PWM_H__ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_qspi.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_qspi.h deleted file mode 100644 index 63bdeb9f271..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_qspi.h +++ /dev/null @@ -1,412 +0,0 @@ -/**************************************************************************//** - * @file nu_qspi.h - * @version V1.00 - * @brief M031 series QSPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_QSPI_H__ -#define __NU_QSPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - -/** @addtogroup QSPI_EXPORTED_CONSTANTS QSPI Exported Constants - @{ -*/ - -#define QSPI_MODE_0 (QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define QSPI_MODE_1 (QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_2 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_3 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define QSPI_SLAVE (QSPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define QSPI_MASTER (0x0UL) /*!< Set as master \hideinitializer */ - -#define QSPI_SS (QSPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define QSPI_SS_ACTIVE_HIGH (QSPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define QSPI_SS_ACTIVE_LOW (0x0UL) /*!< SS active low \hideinitializer */ - -/* QSPI Interrupt Mask */ -#define QSPI_UNIT_INT_MASK (0x001UL) /*!< Unit transfer interrupt mask \hideinitializer */ -#define QSPI_SSACT_INT_MASK (0x002UL) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define QSPI_SSINACT_INT_MASK (0x004UL) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define QSPI_SLVUR_INT_MASK (0x008UL) /*!< Slave under run interrupt mask \hideinitializer */ -#define QSPI_SLVBE_INT_MASK (0x010UL) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define QSPI_SLVTO_INT_MASK (0x020UL) /*!< Slave Mode Time-out interrupt mask \hideinitializer */ -#define QSPI_TXUF_INT_MASK (0x040UL) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define QSPI_FIFO_TXTH_INT_MASK (0x080UL) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTH_INT_MASK (0x100UL) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXOV_INT_MASK (0x200UL) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTO_INT_MASK (0x400UL) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* QSPI Status Mask */ -#define QSPI_BUSY_MASK (0x01UL) /*!< Busy status mask \hideinitializer */ -#define QSPI_RX_EMPTY_MASK (0x02UL) /*!< RX empty status mask \hideinitializer */ -#define QSPI_RX_FULL_MASK (0x04UL) /*!< RX full status mask \hideinitializer */ -#define QSPI_TX_EMPTY_MASK (0x08UL) /*!< TX empty status mask \hideinitializer */ -#define QSPI_TX_FULL_MASK (0x10UL) /*!< TX full status mask \hideinitializer */ -#define QSPI_TXRX_RESET_MASK (0x20UL) /*!< TX or RX reset status mask \hideinitializer */ -#define QSPI_SPIEN_STS_MASK (0x40UL) /*!< SPIEN status mask \hideinitializer */ -#define QSPI_SSLINE_STS_MASK (0x80UL) /*!< QSPIx_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group QSPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Write 1 to UNITIF bit of QSPI_STATUS register to clear the unit transfer interrupt flag. - * \hideinitializer - */ -#define QSPI_CLR_UNIT_TRANS_INT_FLAG(qspi) ((qspi)->STATUS = QSPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set RXPDMAEN bit of QSPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_RX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit of QSPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_RX_PDMA(qspi) ((qspi)->PDMACTL |= (QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk)) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear RXPDMAEN bit of QSPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit of QSPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~(QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] qspi The pointer of the specified QSPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (QSPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_COUNT(qspi) (((qspi)->STATUS & QSPI_STATUS_RXCNT_Msk) >> QSPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of QSPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_RXEMPTY_Msk)>>QSPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of QSPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXEMPTY_Msk)>>QSPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of QSPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_FULL_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXFULL_Msk)>>QSPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Data in RX register. - * @details Read QSPI_RX register to get the received datum. - * \hideinitializer - */ -#define QSPI_READ_RX(qspi) ((qspi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxData The datum which user attempt to transfer through QSPI bus. - * @return None. - * @details Write u32TxData to QSPI_TX register. - * \hideinitializer - */ -#define QSPI_WRITE_TX(qspi, u32TxData) ((qspi)->TX = (u32TxData)) - -/** - * @brief Set QSPIx_SS pin to high state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to high state. - * \hideinitializer - */ -#define QSPI_SET_SS_HIGH(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~QSPI_SSCTL_AUTOSS_Msk)) | (QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk)) - -/** - * @brief Set QSPIx_SS pin to low state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to low state. - * \hideinitializer - */ -#define QSPI_SET_SS_LOW(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk))) | QSPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (QSPI_CTL[7:4]). - * \hideinitializer - */ -#define QSPI_ENABLE_BYTE_REORDER(qspi) ((qspi)->CTL |= QSPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear REORDER bit field of QSPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define QSPI_DISABLE_BYTE_REORDER(qspi) ((qspi)->CTL &= ~QSPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one QSPI bus clock cycle). - * \hideinitializer - */ -#define QSPI_SET_SUSPEND_CYCLE(qspi, u32SuspCycle) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << QSPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the QSPI transfer sequence with LSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set LSB bit of QSPI_CTL register to set the QSPI transfer sequence with LSB first. - * \hideinitializer - */ -#define QSPI_SET_LSB_FIRST(qspi) ((qspi)->CTL |= QSPI_CTL_LSB_Msk) - -/** - * @brief Set the QSPI transfer sequence with MSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear LSB bit of QSPI_CTL register to set the QSPI transfer sequence with MSB first. - * \hideinitializer - */ -#define QSPI_SET_MSB_FIRST(qspi) ((qspi)->CTL &= ~QSPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a QSPI transaction. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define QSPI_SET_DATA_WIDTH(qspi, u32Width) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << QSPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the QSPI busy state. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 QSPI controller is not busy. - * @retval 1 QSPI controller is busy. - * @details This macro will return the busy state of QSPI controller. - * \hideinitializer - */ -#define QSPI_IS_BUSY(qspi) ( ((qspi)->STATUS & QSPI_STATUS_BUSY_Msk)>>QSPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set SPIEN (QSPI_CTL[0]) to enable QSPI controller. - * \hideinitializer - */ -#define QSPI_ENABLE(qspi) ((qspi)->CTL |= QSPI_CTL_SPIEN_Msk) - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear SPIEN (QSPI_CTL[0]) to disable QSPI controller. - * \hideinitializer - */ -#define QSPI_DISABLE(qspi) ((qspi)->CTL &= ~QSPI_CTL_SPIEN_Msk) - -/** - * @brief Disable 2-bit Transfer mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TWOBIT bit of QSPI_CTL register to disable 2-bit Transfer mode. - * \hideinitializer - */ -#define QSPI_DISABLE_2BIT_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_TWOBIT_Msk ) - -/** - * @brief Enable 2-bit Transfer mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TWOBIT bit of QSPI_CTL register to enable 2-bit Transfer mode. - * \hideinitializer - */ -#define QSPI_ENABLE_2BIT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_TWOBIT_Msk ) - -/** - * @brief Disable Slave 3-wire mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear SLV3WIRE bit of QSPI_SSCTL register to disable Slave 3-wire mode. - * \hideinitializer - */ -#define QSPI_DISABLE_3WIRE_MODE(qspi) ( (qspi)->SSCTL &= ~QSPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable Slave 3-wire mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set SLV3WIRE bit of QSPI_SSCTL register to enable Slave 3-wire mode. - * \hideinitializer - */ -#define QSPI_ENABLE_3WIRE_MODE(qspi) ( (qspi)->SSCTL |= QSPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Disable QSPI Dual IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_DUAL_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Disable QSPI Quad IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_QUAD_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_QUADIOEN_Msk ) - - - - -/* Function prototype declaration */ -uint32_t QSPI_Open(QSPI_T *qspi, uint32_t u32MasterSlave, uint32_t u32QSPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void QSPI_Close(QSPI_T *qspi); -void QSPI_ClearRxFIFO(QSPI_T *qspi); -void QSPI_ClearTxFIFO(QSPI_T *qspi); -void QSPI_DisableAutoSS(QSPI_T *qspi); -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock); -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t QSPI_GetBusClock(QSPI_T *qspi); -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask); - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_QSPI_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_rtc.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_rtc.h deleted file mode 100644 index fdebdeccb4b..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_rtc.h +++ /dev/null @@ -1,300 +0,0 @@ -/****************************************************************************** - * @file nu_rtc.h - * @version V1.00 - * $Revision: 4 $ - * $Date: 18/06/07 2:32p $ - * @brief M031 series Real Time Clock(RTC) driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_RTC_H__ -#define __NU_RTC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_CONSTANTS RTC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Initial Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_INIT_KEY 0xA5EB1357UL /*!< RTC Initiation Key to make RTC leaving reset state \hideinitializer */ -#define RTC_WRITE_KEY 0x0000A965UL /*!< RTC Register Access Enable Key to enable RTC read/write accessible and kept 1024 RTC clock \hideinitializer */ -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Frequency Compensation Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_INTEGER_32752 (0x0ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32752HZ \hideinitializer */ -#define RTC_INTEGER_32753 (0x1ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32753HZ \hideinitializer */ -#define RTC_INTEGER_32754 (0x2ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32754HZ \hideinitializer */ -#define RTC_INTEGER_32755 (0x3ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32755HZ \hideinitializer */ -#define RTC_INTEGER_32756 (0x4ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32756HZ \hideinitializer */ -#define RTC_INTEGER_32757 (0x5ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32757HZ \hideinitializer */ -#define RTC_INTEGER_32758 (0x6ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32758HZ \hideinitializer */ -#define RTC_INTEGER_32759 (0x7ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32759HZ \hideinitializer */ -#define RTC_INTEGER_32760 (0x8ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32760HZ \hideinitializer */ -#define RTC_INTEGER_32761 (0x9ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32761HZ \hideinitializer */ -#define RTC_INTEGER_32762 (0xaul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32762HZ \hideinitializer */ -#define RTC_INTEGER_32763 (0xbul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32763HZ \hideinitializer */ -#define RTC_INTEGER_32764 (0xcul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32764HZ \hideinitializer */ -#define RTC_INTEGER_32765 (0xdul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32765HZ \hideinitializer */ -#define RTC_INTEGER_32766 (0xeul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32766HZ \hideinitializer */ -#define RTC_INTEGER_32767 (0xful << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32767HZ \hideinitializer */ -#define RTC_INTEGER_32768 (0x10ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32768HZ \hideinitializer */ -#define RTC_INTEGER_32769 (0x11ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32769HZ \hideinitializer */ -#define RTC_INTEGER_32770 (0x12ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32770HZ \hideinitializer */ -#define RTC_INTEGER_32771 (0x13ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32771HZ \hideinitializer */ -#define RTC_INTEGER_32772 (0x14ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32772HZ \hideinitializer */ -#define RTC_INTEGER_32773 (0x15ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32773HZ \hideinitializer */ -#define RTC_INTEGER_32774 (0x16ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32774HZ \hideinitializer */ -#define RTC_INTEGER_32775 (0x17ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32775HZ \hideinitializer */ -#define RTC_INTEGER_32776 (0x18ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32776HZ \hideinitializer */ -#define RTC_INTEGER_32777 (0x19ul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32777HZ \hideinitializer */ -#define RTC_INTEGER_32778 (0x1aul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32778HZ \hideinitializer */ -#define RTC_INTEGER_32779 (0x1bul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32779HZ \hideinitializer */ -#define RTC_INTEGER_32780 (0x1cul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32780HZ \hideinitializer */ -#define RTC_INTEGER_32781 (0x1dul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32781HZ \hideinitializer */ -#define RTC_INTEGER_32782 (0x1eul << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32782HZ \hideinitializer */ -#define RTC_INTEGER_32783 (0x1ful << RTC_FREQADJ_INTEGER_Pos ) /*!< RTC Frequency is 32783HZ \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Time Attribute Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_12 0UL /*!< RTC as 12-hour time scale with AM and PM indication \hideinitializer */ -#define RTC_CLOCK_24 1UL /*!< RTC as 24-hour time scale \hideinitializer */ -#define RTC_AM 1UL /*!< RTC as AM indication \hideinitializer */ -#define RTC_PM 2UL /*!< RTC as PM indication \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tick Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TICK_1_SEC 0x0UL /*!< RTC time tick period is 1 second \hideinitializer */ -#define RTC_TICK_1_2_SEC 0x1UL /*!< RTC time tick period is 1/2 second \hideinitializer */ -#define RTC_TICK_1_4_SEC 0x2UL /*!< RTC time tick period is 1/4 second \hideinitializer */ -#define RTC_TICK_1_8_SEC 0x3UL /*!< RTC time tick period is 1/8 second \hideinitializer */ -#define RTC_TICK_1_16_SEC 0x4UL /*!< RTC time tick period is 1/16 second \hideinitializer */ -#define RTC_TICK_1_32_SEC 0x5UL /*!< RTC time tick period is 1/32 second \hideinitializer */ -#define RTC_TICK_1_64_SEC 0x6UL /*!< RTC time tick period is 1/64 second \hideinitializer */ -#define RTC_TICK_1_128_SEC 0x7UL /*!< RTC time tick period is 1/128 second \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Day of Week Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_SUNDAY 0x0UL /*!< Day of the Week is Sunday \hideinitializer */ -#define RTC_MONDAY 0x1UL /*!< Day of the Week is Monday \hideinitializer */ -#define RTC_TUESDAY 0x2UL /*!< Day of the Week is Tuesday \hideinitializer */ -#define RTC_WEDNESDAY 0x3UL /*!< Day of the Week is Wednesday \hideinitializer */ -#define RTC_THURSDAY 0x4UL /*!< Day of the Week is Thursday \hideinitializer */ -#define RTC_FRIDAY 0x5UL /*!< Day of the Week is Friday \hideinitializer */ -#define RTC_SATURDAY 0x6UL /*!< Day of the Week is Saturday \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_YEAR2000 2000UL /*!< RTC Reference for compute year data \hideinitializer */ -#define RTC_FCR_REFERENCE 32761UL /*!< RTC Reference for frequency compensation \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Clock Source Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLKSRC_LXT 0x0UL /*!< Clock Source from LXT \hideinitializer */ -#define RTC_CLKSRC_LIRC 0x1UL /*!< Clock Source from LIRC \hideinitializer */ - -/*@}*/ /* end of group RTC_EXPORTED_CONSTANTS */ - - -/** @addtogroup RTC_EXPORTED_STRUCTS RTC Exported Structs - @{ -*/ -/** - * @details RTC define Time Data Struct - */ -typedef struct -{ - uint32_t u32Year; /*!< Year value */ - uint32_t u32Month; /*!< Month value */ - uint32_t u32Day; /*!< Day value */ - uint32_t u32DayOfWeek; /*!< Day of week value */ - uint32_t u32Hour; /*!< Hour value */ - uint32_t u32Minute; /*!< Minute value */ - uint32_t u32Second; /*!< Second value */ - uint32_t u32TimeScale; /*!< 12-Hour, 24-Hour */ - uint32_t u32AmPm; /*!< Only Time Scale select 12-hr used */ -} S_RTC_TIME_DATA_T; - -/*@}*/ /* end of group RTC_EXPORTED_STRUCTS */ - - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Indicate is Leap Year or not - * - * @param None - * - * @retval 0 This year is not a leap year - * @retval 1 This year is a leap year - * - * @details According to current date, return this year is leap year or not. - * \hideinitializer - */ -#define RTC_IS_LEAP_YEAR() (RTC->LEAPYEAR & RTC_LEAPYEAR_LEAPYEAR_Msk ? 1:0) - -/** - * @brief Clear RTC Alarm Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC alarm interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_ALARM_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_ALMIF_Msk) - -/** - * @brief Clear RTC Tick Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC tick interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TICK_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_TICKIF_Msk) - -/** - * @brief Get RTC Alarm Interrupt Flag - * - * @param None - * - * @retval 0 RTC alarm interrupt did not occur - * @retval 1 RTC alarm interrupt occurred - * - * @details This macro indicates RTC alarm interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_ALARM_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_ALMIF_Msk)? 1:0) - -/** - * @brief Get RTC Time Tick Interrupt Flag - * - * @param None - * - * @retval 0 RTC time tick interrupt did not occur - * @retval 1 RTC time tick interrupt occurred - * - * @details This macro indicates RTC time tick interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TICK_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_TICKIF_Msk)? 1:0) - -/** - * @brief Enable RTC Tick Wake-up Function - * - * @param None - * - * @return None - * - * @details This macro is used to enable RTC tick interrupt wake-up function. - * \hideinitializer - */ -#define RTC_ENABLE_TICK_WAKEUP() ((RTC->INTEN |= RTC_INTEN_TICKIEN_Msk)) - -/** - * @brief Disable RTC Tick Wake-up Function - * - * @param None - * - * @return None - * - * @details This macro is used to disable RTC tick interrupt wake-up function. - * \hideinitializer - */ -#define RTC_DISABLE_TICK_WAKEUP() ((RTC->INTEN &= ~RTC_INTEN_TICKIEN_Msk)); - -/** - * @brief Enable RTC Alarm Wake-up Function - * - * @param None - * - * @return None - * - * @details This macro is used to enable RTC Alarm interrupt wake-up function. - * \hideinitializer - */ -#define RTC_ENABLE_ALARM_WAKEUP() ((RTC->INTEN |= RTC_INTEN_ALMIEN_Msk)) - -/** - * @brief Disable RTC Alarm Wake-up Function - * - * @param None - * - * @return None - * - * @details This macro is used to disable RTC Alarm interrupt wake-up function. - * \hideinitializer - */ -#define RTC_DISABLE_ALARM_WAKEUP() ((RTC->INTEN &= ~RTC_INTEN_ALMIEN_Msk)); - -/** - * @brief Select RTC Clock Source - * - * @param[in] u32ClkSrc Specify the clock source. It consists of: - * - \ref RTC_CLKSRC_LXT : Clock source from LXT - * - \ref RTC_CLKSRC_LIRC : Clock source from LIRC - * @return None - * - * @details This macro is used to select RTC clock source. - * \hideinitializer - */ -#define RTC_CLKSRCSEL(u32ClkSrc) ((RTC->LXTCTL &= ~RTC_LXTCTL_C32KS_Msk) | u32ClkSrc); - -void RTC_Open(S_RTC_TIME_DATA_T *psPt); -void RTC_Close(void); -void RTC_32KCalibration(int32_t i32FrequencyX10000); -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *psPt); -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *psPt); -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *psPt); -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *psPt); -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek); -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day); -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk); -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk); -uint32_t RTC_GetDayOfWeek(void); -void RTC_SetTickPeriod(uint32_t u32TickSelection); -void RTC_EnableInt(uint32_t u32IntFlagMask); -void RTC_DisableInt(uint32_t u32IntFlagMask); - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RTC_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_spi.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_spi.h deleted file mode 100644 index 1d2b3da1adf..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_spi.h +++ /dev/null @@ -1,558 +0,0 @@ -/****************************************************************************** - * @file nu_spi.h - * @version V1.00 - * $Revision: 4 $ - * $Date: 18/06/07 2:32p $ - * @brief M031 series SPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SPI_H__ -#define __NU_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ -#define SPI_NONE (0x00ul) /*!< SPI interface not existed \hideinitializer */ -#define SPI_MODE_0 (SPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define SPI_MODE_1 (SPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_2 (SPI_CTL_CLKPOL_Msk | SPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_3 (SPI_CTL_CLKPOL_Msk | SPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ -#define SPI_SLAVE (SPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define SPI_MASTER (0x0ul) /*!< Set as master \hideinitializer */ -#define SPI_SS (SPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define SPI_SS_ACTIVE_HIGH (SPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define SPI_SS_ACTIVE_LOW (0x0ul) /*!< SS active low \hideinitializer */ - -/* SPI Interrupt Mask */ -#define SPI_UNIT_INT_MASK (0x001ul) /*!< Unit transfer interrupt mask \hideinitializer */ -#define SPI_SSACT_INT_MASK (0x002ul) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define SPI_SSINACT_INT_MASK (0x004ul) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define SPI_SLVUR_INT_MASK (0x008ul) /*!< Slave under run interrupt mask \hideinitializer */ -#define SPI_SLVBE_INT_MASK (0x010ul) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define SPI_TXUF_INT_MASK (0x040ul) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define SPI_FIFO_TXTH_INT_MASK (0x080ul) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTH_INT_MASK (0x100ul) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXOV_INT_MASK (0x200ul) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTO_INT_MASK (0x400ul) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* SPI Status Mask */ -#define SPI_BUSY_MASK (0x01ul) /*!< Busy status mask \hideinitializer */ -#define SPI_RX_EMPTY_MASK (0x02ul) /*!< RX empty status mask \hideinitializer */ -#define SPI_RX_FULL_MASK (0x04ul) /*!< RX full status mask \hideinitializer */ -#define SPI_TX_EMPTY_MASK (0x08ul) /*!< TX empty status mask \hideinitializer */ -#define SPI_TX_FULL_MASK (0x10ul) /*!< TX full status mask \hideinitializer */ -#define SPI_TXRX_RESET_MASK (0x20ul) /*!< TX or RX reset status mask \hideinitializer */ -#define SPI_SPIEN_STS_MASK (0x40ul) /*!< SPIEN status mask \hideinitializer */ -#define SPI_SSLINE_STS_MASK (0x80ul) /*!< SPIx_SS line status mask \hideinitializer */ - - -/* SPII2S Data Width */ -#define SPII2S_DATABIT_8 (0ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPII2S data width is 8-bit \hideinitializer */ -#define SPII2S_DATABIT_16 (1ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPII2S data width is 16-bit \hideinitializer */ -#define SPII2S_DATABIT_24 (2ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPII2S data width is 24-bit \hideinitializer */ -#define SPII2S_DATABIT_32 (3ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPII2S data width is 32-bit \hideinitializer */ - -/* SPII2S Audio Format */ -#define SPII2S_MONO SPI_I2SCTL_MONO_Msk /*!< Monaural channel \hideinitializer */ -#define SPII2S_STEREO (0x0ul) /*!< Stereo channel \hideinitializer */ - -/* SPII2S Data Format */ -#define SPII2S_FORMAT_I2S (0ul<STATUS = SPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set RXPDMAEN bit of SPI_PDMACTL register to enable RX PDMA transfer function. - */ -#define SPI_TRIGGER_RX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit of SPI_PDMACTL register to enable TX PDMA transfer function. - */ -#define SPI_TRIGGER_TX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to enable TX and RX PDMA transfer function. - */ -#define SPI_TRIGGER_TX_RX_PDMA(spi) ( (spi)->PDMACTL |= (SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear RXPDMAEN bit of SPI_PDMACTL register to disable RX PDMA transfer function. - */ -#define SPI_DISABLE_RX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit of SPI_PDMACTL register to disable TX PDMA transfer function. - */ -#define SPI_DISABLE_TX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to disable TX and RX PDMA transfer function. - */ -#define SPI_DISABLE_TX_RX_PDMA(spi) ( (spi)->PDMACTL &= ~(SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] spi The pointer of the specified SPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (SPI_STATUS[27:24]) to get the count of available data in RX FIFO. - */ -#define SPI_GET_RX_FIFO_COUNT(spi) (((spi)->STATUS & SPI_STATUS_RXCNT_Msk) >> SPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of SPI_STATUS register to get the RX FIFO empty flag. - */ -#define SPI_GET_RX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_RXEMPTY_Msk)>>SPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of SPI_STATUS register to get the TX FIFO empty flag. - */ -#define SPI_GET_TX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXEMPTY_Msk)>>SPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of SPI_STATUS register to get the TX FIFO full flag. - */ -#define SPI_GET_TX_FIFO_FULL_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXFULL_Msk)>>SPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] spi The pointer of the specified SPI module. - * @return Data in RX register. - * @details Read SPI_RX register to get the received datum. - */ -#define SPI_READ_RX(spi) ((spi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through SPI bus. - * @return None. - * @details Write u32TxData to SPI_TX register. - */ -#define SPI_WRITE_TX(spi, u32TxData) ((spi)->TX = (u32TxData)) - -/** - * @brief Set SPIx_SS pin to high state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to high state. - */ -#define SPI_SET_SS_HIGH(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~SPI_SSCTL_AUTOSS_Msk)) | (SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk)) - -/** - * @brief Set SPIx_SS pin to low state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to low state. - */ -#define SPI_SET_SS_LOW(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk))) | SPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (SPI_CTL[7:4]). - */ -#define SPI_ENABLE_BYTE_REORDER(spi) ((spi)->CTL |= SPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear REORDER bit field of SPI_CTL register to disable Byte Reorder function. - */ -#define SPI_DISABLE_BYTE_REORDER(spi) ((spi)->CTL &= ~SPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one SPI bus clock cycle). - */ -#define SPI_SET_SUSPEND_CYCLE(spi, u32SuspCycle) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << SPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the SPI transfer sequence with LSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set LSB bit of SPI_CTL register to set the SPI transfer sequence with LSB first. - */ -#define SPI_SET_LSB_FIRST(spi) ((spi)->CTL |= SPI_CTL_LSB_Msk) - -/** - * @brief Set the SPI transfer sequence with MSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of SPI_CTL register to set the SPI transfer sequence with MSB first. - */ -#define SPI_SET_MSB_FIRST(spi) ((spi)->CTL &= ~SPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a SPI transaction. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - */ -#define SPI_SET_DATA_WIDTH(spi, u32Width) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << SPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the SPI busy state. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 SPI controller is not busy. - * @retval 1 SPI controller is busy. - * @details This macro will return the busy state of SPI controller. - */ -#define SPI_IS_BUSY(spi) ( ((spi)->STATUS & SPI_STATUS_BUSY_Msk)>>SPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SPIEN (SPI_CTL[0]) to enable SPI controller. - */ -#define SPI_ENABLE(spi) ((spi)->CTL |= SPI_CTL_SPIEN_Msk) - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SPIEN (SPI_CTL[0]) to disable SPI controller. - */ -#define SPI_DISABLE(spi) ((spi)->CTL &= ~SPI_CTL_SPIEN_Msk) - - -/** - * @brief Enable zero cross detection function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will set RZCEN or LZCEN bit of SPI_I2SCTL register to enable zero cross detection function. - */ -static __INLINE void SPII2S_ENABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if (u32ChMask == SPII2S_RIGHT) - i2s->I2SCTL |= SPI_I2SCTL_RZCEN_Msk; - else - i2s->I2SCTL |= SPI_I2SCTL_LZCEN_Msk; -} - -/** - * @brief Disable zero cross detection function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will clear RZCEN or LZCEN bit of SPI_I2SCTL register to disable zero cross detection function. - */ -static __INLINE void SPII2S_DISABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if (u32ChMask == SPII2S_RIGHT) - i2s->I2SCTL &= ~SPI_I2SCTL_RZCEN_Msk; - else - i2s->I2SCTL &= ~SPI_I2SCTL_LZCEN_Msk; -} - -/** - * @brief Enable SPII2S TX DMA function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will set TXPDMAEN bit of SPI_PDMACTL register to transmit data with PDMA. - */ -#define SPII2S_ENABLE_TXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable SPII2S TX DMA function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will clear TXPDMAEN bit of SPI_PDMACTL register to disable TX DMA function. - */ -#define SPII2S_DISABLE_TXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Enable SPII2S RX DMA function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will set RXPDMAEN bit of SPI_PDMACTL register to receive data with PDMA. - */ -#define SPII2S_ENABLE_RXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable SPII2S RX DMA function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will clear RXPDMAEN bit of SPI_PDMACTL register to disable RX DMA function. - */ -#define SPII2S_DISABLE_RXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Enable SPII2S TX function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will set TXEN bit of SPI_I2SCTL register to enable SPII2S TX function. - */ -#define SPII2S_ENABLE_TX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Disable SPII2S TX function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will clear TXEN bit of SPI_I2SCTL register to disable SPII2S TX function. - */ -#define SPII2S_DISABLE_TX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Enable SPII2S RX function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will set RXEN bit of SPI_I2SCTL register to enable SPII2S RX function. - */ -#define SPII2S_ENABLE_RX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Disable SPII2S RX function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will clear RXEN bit of SPI_I2SCTL register to disable SPII2S RX function. - */ -#define SPII2S_DISABLE_RX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Enable TX Mute function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will set MUTE bit of SPI_I2SCTL register to enable SPII2S TX mute function. - */ -#define SPII2S_ENABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Disable TX Mute function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will clear MUTE bit of SPI_I2SCTL register to disable SPII2S TX mute function. - */ -#define SPII2S_DISABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Clear TX FIFO. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will clear TX FIFO. The internal TX FIFO pointer will be reset to FIFO start point. - */ -#define SPII2S_CLR_TX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk ) - -/** - * @brief Clear RX FIFO. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details This macro will clear RX FIFO. The internal RX FIFO pointer will be reset to FIFO start point. - */ -#define SPII2S_CLR_RX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref SPII2S_MONO_LEFT - * - \ref SPII2S_MONO_RIGHT - * @return None - * @details This function selects the recording source channel of monaural mode. - */ -static __INLINE void SPII2S_SET_MONO_RX_CHANNEL(SPI_T *i2s, uint32_t u32Ch) -{ - u32Ch == SPII2S_MONO_LEFT ? - (i2s->I2SCTL |= SPI_I2SCTL_RXLCH_Msk) : - (i2s->I2SCTL &= ~SPI_I2SCTL_RXLCH_Msk); -} - -/** - * @brief Write data to SPII2S TX FIFO. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32Data The value written to TX FIFO. - * @return None - * @details This macro will write a value to TX FIFO. - */ -#define SPII2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TX = (u32Data) ) - -/** - * @brief Read RX FIFO. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return The value read from RX FIFO. - * @details This function will return a value read from RX FIFO. - */ -#define SPII2S_READ_RX_FIFO(i2s) ( (i2s)->RX ) - -/** - * @brief Get the interrupt flag. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return The interrupt flags specified by the u32mask parameter. - * @details This macro will return the combination interrupt flags of SPI_I2SSTS register. The flags are specified by the u32mask parameter. - */ -#define SPII2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS & (u32Mask) ) - -/** - * @brief Clear the interrupt flag. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return None - * @details This macro will clear the interrupt flags specified by the u32mask parameter. - * @note Except TX and RX FIFO threshold interrupt flags, the other interrupt flags can be cleared by writing 1 to itself. - */ -#define SPII2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS = (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s The pointer of the specified SPII2S module. - * @return TX FIFO level - * @details This macro will return the number of available words in TX FIFO. - */ -#define SPII2S_GET_TX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_TXCNT_Msk) >> SPI_I2SSTS_TXCNT_Pos ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s The pointer of the specified SPII2S module. - * @return RX FIFO level - * @details This macro will return the number of available words in RX FIFO. - */ -#define SPII2S_GET_RX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_RXCNT_Msk) >> SPI_I2SSTS_RXCNT_Pos ) - - - -/* Function prototype declaration */ -uint32_t SPI_Open(SPI_T *spi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void SPI_Close(SPI_T *spi); -void SPI_ClearRxFIFO(SPI_T *spi); -void SPI_ClearTxFIFO(SPI_T *spi); -void SPI_DisableAutoSS(SPI_T *spi); -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock); -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t SPI_GetBusClock(SPI_T *spi); -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask); -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask); -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask); - -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat); -void SPII2S_Close(SPI_T *i2s); -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask); -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask); -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock); -void SPII2S_DisableMCLK(SPI_T *i2s); -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); - - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_SPI_H__ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_sys.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_sys.h deleted file mode 100644 index e36ea74cc54..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_sys.h +++ /dev/null @@ -1,1391 +0,0 @@ -/**************************************************************************//** - * @file nu_sys.h - * @version V0.10 - * $Revision: 7 $ - * $Date: 19/06/10 2:48p $ - * @brief M031 Series SYS Driver Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SYS_H__ -#define __NU_SYS_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - -/** @addtogroup SYS_EXPORTED_CONSTANTS SYS Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Module Reset Control Resister constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_RST ((0x0<<24)|SYS_IPRST0_PDMARST_Pos) /*!< PDMA reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define EBI_RST ((0x0<<24)|SYS_IPRST0_EBIRST_Pos) /*!< EBI reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define HDIV_RST ((0x0<<24)|SYS_IPRST0_HDIVRST_Pos) /*!< HDIV reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define CRC_RST ((0x0<<24)|SYS_IPRST0_CRCRST_Pos) /*!< CRC reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ - -#define GPIO_RST ((0x4<<24)|SYS_IPRST1_GPIORST_Pos) /*!< GPIO reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define TMR0_RST ((0x4<<24)|SYS_IPRST1_TMR0RST_Pos) /*!< TMR0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define TMR1_RST ((0x4<<24)|SYS_IPRST1_TMR1RST_Pos) /*!< TMR1 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define TMR2_RST ((0x4<<24)|SYS_IPRST1_TMR2RST_Pos) /*!< TMR2 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define TMR3_RST ((0x4<<24)|SYS_IPRST1_TMR3RST_Pos) /*!< TMR3 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define ACMP01_RST ((0x4<<24)|SYS_IPRST1_ACMP01RST_Pos) /*!< ACMP reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define I2C0_RST ((0x4<<24)|SYS_IPRST1_I2C0RST_Pos) /*!< I2C0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define I2C1_RST ((0x4<<24)|SYS_IPRST1_I2C1RST_Pos) /*!< I2C1 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define QSPI0_RST ((0x4<<24)|SYS_IPRST1_QSPI0RST_Pos) /*!< QSPI0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define SPI0_RST ((0x4<<24)|SYS_IPRST1_SPI0RST_Pos) /*!< SPI0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART0_RST ((0x4<<24)|SYS_IPRST1_UART0RST_Pos) /*!< UART0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART1_RST ((0x4<<24)|SYS_IPRST1_UART1RST_Pos) /*!< UART1 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART2_RST ((0x4<<24)|SYS_IPRST1_UART2RST_Pos) /*!< UART2 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART3_RST ((0x4<<24)|SYS_IPRST1_UART3RST_Pos) /*!< UART3 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART4_RST ((0x4<<24)|SYS_IPRST1_UART4RST_Pos) /*!< UART4 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART5_RST ((0x4<<24)|SYS_IPRST1_UART5RST_Pos) /*!< UART5 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART6_RST ((0x4<<24)|SYS_IPRST1_UART6RST_Pos) /*!< UART6 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define UART7_RST ((0x4<<24)|SYS_IPRST1_UART7RST_Pos) /*!< UART7 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define USBD_RST ((0x4<<24)|SYS_IPRST1_USBDRST_Pos) /*!< USBD reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define ADC_RST ((0x4<<24)|SYS_IPRST1_ADCRST_Pos) /*!< ADC reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ - -#define USCI0_RST ((0x8<<24)|SYS_IPRST2_USCI0RST_Pos) /*!< USCI0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define USCI1_RST ((0x8<<24)|SYS_IPRST2_USCI1RST_Pos) /*!< USCI1 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define PWM0_RST ((0x8<<24)|SYS_IPRST2_PWM0RST_Pos) /*!< PWM0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define PWM1_RST ((0x8<<24)|SYS_IPRST2_PWM1RST_Pos) /*!< PWM1 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define BPWM0_RST ((0x8<<24)|SYS_IPRST2_BPWM0RST_Pos) /*!< BPWM0 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ -#define BPWM1_RST ((0x8<<24)|SYS_IPRST2_BPWM1RST_Pos) /*!< BPWM1 reset is one of the \ref SYS_ResetModule parameter \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brown Out Detector Threshold Voltage Selection constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_BODCTL_BOD_RST_EN (1UL<GPD_MFPL = (SYS->GPD_MFPL & ~SYS_GPD_MFPL_PD2MFP_Msk) | SYS_GPD_MFPL_PD2MFP_UART0_RXD; - SYS->GPD_MFPL = (SYS->GPD_MFPL & ~SYS_GPD_MFPL_PD3MFP_Msk) | SYS_GPD_MFPL_PD3MFP_UART0_TXD; -*/ -/* PA.0 MFP */ -#define SYS_GPA_MFPL_PA0MFP_GPIO (0x00UL<BODCTL |= SYS_BODCTL_BODIF_Msk) - -/** - * @brief Set Brown-out detector function to normal mode - * @param None - * @return None - * @details This macro set Brown-out detector to normal mode. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_CLEAR_BOD_LPM() (SYS->BODCTL &= ~SYS_BODCTL_BODLPM_Msk) - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This macro disable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_BOD() (SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk) - -/** - * @brief Enable Brown-out detector function - * @param None - * @return None - * @details This macro enable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_BOD() (SYS->BODCTL |= SYS_BODCTL_BODEN_Msk) - -/** - * @brief Get Brown-out detector interrupt flag - * @param None - * @retval 0 Brown-out detect interrupt flag is not set. - * @retval >=1 Brown-out detect interrupt flag is set. - * @details This macro get Brown-out detector interrupt flag. - * \hideinitializer - */ -#define SYS_GET_BOD_INT_FLAG() (SYS->BODCTL & SYS_BODCTL_BODIF_Msk) - -/** - * @brief Get Brown-out detector status - * @param None - * @retval 0 System voltage is higher than BOD threshold voltage setting or BOD function is disabled. - * @retval >=1 System voltage is lower than BOD threshold voltage setting. - * @details This macro get Brown-out detector output status. - * If the BOD function is disabled, this function always return 0. - * \hideinitializer - */ -#define SYS_GET_BOD_OUTPUT() (SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) - -/** - * @brief Disable Brown-out detector reset function - * @param None - * @return None - * @details This macro disable Brown-out detector reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_BOD_RST() (SYS->BODCTL &= ~SYS_BODCTL_BODRSTEN_Msk) - -/** - * @brief Enable Brown-out detector reset function - * @param None - * @return None - * @details This macro enable Brown-out detect reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_BOD_RST() (SYS->BODCTL |= SYS_BODCTL_BODRSTEN_Msk) - -/** - * @brief Set Brown-out detector function low power mode - * @param None - * @return None - * @details This macro set Brown-out detector to low power mode. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_SET_BOD_LPM() (SYS->BODCTL |= SYS_BODCTL_BODLPM_Msk) - -/** - * @brief Set Brown-out detector voltage level - * @param[in] u32Level is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_2_5V - * - \ref SYS_BODCTL_BODVL_2_0V - * @return None - * @details This macro set Brown-out detector voltage level. - * The write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_SET_BOD_LEVEL(u32Level) (SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | (u32Level)) - -/** - * @brief Get reset source is from Brown-out detector reset - * @param None - * @retval 0 Previous reset source is not from Brown-out detector reset - * @retval >=1 Previous reset source is from Brown-out detector reset - * @details This macro get previous reset source is from Brown-out detect reset or not. - * \hideinitializer - */ -#define SYS_IS_BOD_RST() (SYS->RSTSTS & SYS_RSTSTS_BODRF_Msk) - -/** - * @brief Get reset source is from CPU reset - * @param None - * @retval 0 Previous reset source is not from CPU reset - * @retval >=1 Previous reset source is from CPU reset - * @details This macro get previous reset source is from CPU reset. - * \hideinitializer - */ -#define SYS_IS_CPU_RST() (SYS->RSTSTS & SYS_RSTSTS_CPURF_Msk) - -/** - * @brief Get reset source is from LVR Reset - * @param None - * @retval 0 Previous reset source is not from Low-Voltage-Reset - * @retval >=1 Previous reset source is from Low-Voltage-Reset - * @details This macro get previous reset source is from Low-Voltage-Reset. - * \hideinitializer - */ -#define SYS_IS_LVR_RST() (SYS->RSTSTS & SYS_RSTSTS_LVRF_Msk) - -/** - * @brief Get reset source is from Power-on Reset - * @param None - * @retval 0 Previous reset source is not from Power-on Reset - * @retval >=1 Previous reset source is from Power-on Reset - * @details This macro get previous reset source is from Power-on Reset. - * \hideinitializer - */ -#define SYS_IS_POR_RST() (SYS->RSTSTS & SYS_RSTSTS_PORF_Msk) - -/** - * @brief Get reset source is from reset pin reset - * @param None - * @retval 0 Previous reset source is not from reset pin reset - * @retval >=1 Previous reset source is from reset pin reset - * @details This macro get previous reset source is from reset pin reset. - * \hideinitializer - */ -#define SYS_IS_RSTPIN_RST() (SYS->RSTSTS & SYS_RSTSTS_PINRF_Msk) - -/** - * @brief Get reset source is from system reset - * @param None - * @retval 0 Previous reset source is not from system reset - * @retval >=1 Previous reset source is from system reset - * @details This macro get previous reset source is from system reset. - * \hideinitializer - */ -#define SYS_IS_SYSTEM_RST() (SYS->RSTSTS & SYS_RSTSTS_SYSRF_Msk) - -/** - * @brief Get reset source is from watchdog timer or window watchdog timer reset - * @param None - * @retval 0 Previous reset source is not from watchdog timer or window watchdog timer reset - * @retval >=1 Previous reset source is from watchdog timer or window watchdog timer reset - * @details This macro get previous reset source is from watchdog timer or window watchdog timer reset. - * \hideinitializer - */ -#define SYS_IS_WDT_RST() (SYS->RSTSTS & SYS_RSTSTS_WDTRF_Msk) - -/** - * @brief Disable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro disable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_LVR() (SYS->BODCTL &= ~SYS_BODCTL_LVREN_Msk) - -/** - * @brief Enable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro enable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_LVR() (SYS->BODCTL |= SYS_BODCTL_LVREN_Msk) - -/** - * @brief Disable Power-on Reset function - * @param None - * @return None - * @details This macro disable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_POR() (SYS->PORCTL = 0x5AA5) - -/** - * @brief Enable Power-on Reset function - * @param None - * @return None - * @details This macro enable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_POR() (SYS->PORCTL = 0) - -/** - * @brief Clear reset source flag - * @param[in] u32RstSrc is reset source. Including : - * - \ref SYS_RSTSTS_PORF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_SYSRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_CPULKRF_Msk - * @return None - * @details This macro clear reset source flag. - * \hideinitializer - */ -#define SYS_CLEAR_RST_SOURCE(u32RstSrc) ((SYS->RSTSTS) = (u32RstSrc) ) - - -/** - * @brief Disable register write-protection function - * @param None - * @return None - * @details This function disable register write-protection function. - * To unlock the protected register to allow write access. - * \hideinitializer - */ -__STATIC_INLINE void SYS_UnlockReg(void) -{ - do { - SYS->REGLCTL = 0x59; - SYS->REGLCTL = 0x16; - SYS->REGLCTL = 0x88; - } while (SYS->REGLCTL == 0); -} - -/** - * @brief Enable register write-protection function - * @param None - * @return None - * @details This function is used to enable register write-protection function. - * To lock the protected register to forbid write access. - * \hideinitializer - */ -__STATIC_INLINE void SYS_LockReg(void) -{ - SYS->REGLCTL = 0; -} - - -void SYS_ClearResetSrc(uint32_t u32Src); -uint32_t SYS_GetBODStatus(void); -uint32_t SYS_GetResetSrc(void); -uint32_t SYS_IsRegLocked(void); -uint32_t SYS_ReadPDID(void); -void SYS_ResetChip(void); -void SYS_ResetCPU(void); -void SYS_ResetModule(uint32_t u32ModuleIndex); -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel); -void SYS_DisableBOD(void); - - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SYS_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_timer.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_timer.h deleted file mode 100644 index 1090174ca60..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_timer.h +++ /dev/null @@ -1,507 +0,0 @@ -/**************************************************************************//** - * @file nu_timer.h - * @version V0.10 - * $Revision: 6 $ - * $Date: 18/07/13 4:59p $ - * @brief M031 Series Timer Controller (TIMER) Driver Header File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_H__ -#define __NU_TIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_CONSTANTS TIMER Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* TIMER Operation Mode, External Counter and Capture Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TIMER_ONESHOT_MODE (0UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in one-shot mode \hideinitializer */ -#define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in periodic mode \hideinitializer */ -#define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in toggle-output mode \hideinitializer */ -#define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in continuous counting mode \hideinitializer */ - -#define TIMER_TOUT_PIN_FROM_TX (0UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from Tx pin \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TX_EXT (1UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from Tx_EXT pin \hideinitializer */ - -#define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to get timer counter value \hideinitializer */ -#define TIMER_CAPTURE_COUNTER_RESET_MODE (1UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to reset timer counter \hideinitializer */ - -#define TIMER_CAPTURE_FALLING_EDGE (0UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Falling edge detection to trigger timer capture \hideinitializer */ -#define TIMER_CAPTURE_RISING_EDGE (1UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Rising edge detection to trigger timer capture \hideinitializer */ -#define TIMER_CAPTURE_FALLING_AND_RISING_EDGE (2UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both falling and rising edge detection to trigger timer capture \hideinitializer */ - -#define TIMER_COUNTER_FALLING_EDGE (0UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on falling edge detection \hideinitializer */ -#define TIMER_COUNTER_RISING_EDGE (1UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on rising edge detection \hideinitializer */ - -#define TIMER_TRGSRC_TIMEOUT_EVENT (0UL << TIMER_CTL_TRGSSEL_Pos) /*!< Trigger source from Timeout event \hideinitializer */ -#define TIMER_TRGSRC_CAPTURE_EVENT (1UL << TIMER_CTL_TRGSSEL_Pos) /*!< Trigger source from Capture event \hideinitializer */ - -#define TIMER_CAPSRC_TX_EXT (0UL << TIMER_CTL_CAPSRC_Pos) /*!< Capture source from Tx_EXT pin \hideinitializer */ -#define TIMER_CAPSRC_INTERNAL (1UL << TIMER_CTL_CAPSRC_Pos) /*!< Capture source from Internal event such as LIRC or ACMP0/1 \hideinitializer */ - -#define TIMER_INTERCAPSEL_ACMP0 (0UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from Internal event ACMP0 \hideinitializer */ -#define TIMER_INTERCAPSEL_ACMP1 (1UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from Internal event ACMP1 \hideinitializer */ -#define TIMER_INTERCAPSEL_LIRC (5UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from Internal event LIRC \hideinitializer */ - -#define TIMER_TRG_TO_PWM (TIMER_CTL_TRGPWM_Msk) /*!< Timer trigger PWM \hideinitializer */ -#define TIMER_TRG_TO_ADC (TIMER_CTL_TRGADC_Msk) /*!< Timer trigger ADC \hideinitializer */ -#define TIMER_TRG_TO_PDMA (TIMER_CTL_TRGPDMA_Msk) /*!< Timer trigger PDMA \hideinitializer */ -#define TIMER_TRG_TO_BPWM (TIMER_CTL_TRGBPWM_Msk) /*!< Timer trigger BPWM \hideinitializer */ - -#define TIMER_CMP_MAX_VALUE (0xFFFFFFUL) /*!< Max Timer compare value \hideinitializer */ - -/*@}*/ /* end of group TIMER_EXPORTED_CONSTANTS */ - - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Set Timer Compared Value - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32Value Timer compare value. Valid values are between 2 to 0xFFFFFF. - * - * @return None - * - * @details This macro is used to set timer compared value to adjust timer time-out interval. - * @note 1. Never write 0x0 or 0x1 in this field, or the core will run into unknown state. - * @note 2. If update timer compared value in continuous counting mode, timer counter value will keep counting continuously. - * But if timer is operating at other modes, the timer up counter will restart counting and start from 0. - * - * \hideinitializer - */ -#define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMP = (u32Value)) - -/** - * @brief Set Timer Prescale Value - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32Value Timer prescale value. Valid values are between 0 to 0xFF. - * - * @return None - * - * @details This macro is used to set timer prescale value and timer source clock will be divided by (prescale + 1) \n - * before it is fed into timer. - * - * \hideinitializer - */ -#define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_PSC_Msk) | (u32Value)) - -/** - * @brief Check specify Timer Status - * - * @param[in] timer The pointer of the specified Timer module. - * - * @retval 0 Timer 24-bit up counter is inactive - * @retval 1 Timer 24-bit up counter is active - * - * @details This macro is used to check if specify Timer counter is inactive or active. - * - * \hideinitializer - */ -#define TIMER_IS_ACTIVE(timer) (((timer)->CTL & TIMER_CTL_ACTSTS_Msk)? 1 : 0) - -/** - * @brief Select Toggle-output Pin - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32ToutSel Toggle-output pin selection, valid values are: - * - \ref TIMER_TOUT_PIN_FROM_TX - * - \ref TIMER_TOUT_PIN_FROM_TX_EXT - * - * @return None - * - * @details This macro is used to select timer toggle-output pin is output on Tx or Tx_EXT pin. - * - * \hideinitializer - */ -#define TIMER_SELECT_TOUT_PIN(timer, u32ToutSel) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_TGLPINSEL_Msk) | (u32ToutSel)) - -/** - * @brief Start Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to start Timer counting. - * - * \hideinitializer - */ -static __INLINE void TIMER_Start(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to stop/suspend Timer counting. - * - * \hideinitializer - */ -static __INLINE void TIMER_Stop(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Enable Timer Interrupt Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to enable the timer interrupt wake-up function and interrupt source could be time-out interrupt, \n - * counter event interrupt or capture trigger interrupt. - * @note To wake the system from Power-down mode, timer clock source must be ether LXT or LIRC. - * - * \hideinitializer - */ -static __INLINE void TIMER_EnableWakeup(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Disable Timer Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to disable the timer interrupt wake-up function. - * - * \hideinitializer - */ -static __INLINE void TIMER_DisableWakeup(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Enable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of capture pin. - * - * \hideinitializer - */ -static __INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Disable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of capture pin. - * - * \hideinitializer - */ -static __INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Enable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of counter pin. - * - * \hideinitializer - */ -static __INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Disable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of counter pin. - * - * \hideinitializer - */ -static __INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Enable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to enable the timer time-out interrupt function. - * - * \hideinitializer - */ -static __INLINE void TIMER_EnableInt(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Disable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to disable the timer time-out interrupt function. - * - * \hideinitializer - */ -static __INLINE void TIMER_DisableInt(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Enable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to enable the timer capture trigger interrupt function. - * - * \hideinitializer - */ -static __INLINE void TIMER_EnableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Disable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to disable the timer capture trigger interrupt function. - * - * \hideinitializer - */ -static __INLINE void TIMER_DisableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Get Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. - * - * @retval 0 Timer time-out interrupt did not occur - * @retval 1 Timer time-out interrupt occurred - * - * @details This function indicates timer time-out interrupt occurred or not. - * - * \hideinitializer - */ -static __INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer) -{ - return ((timer->INTSTS & TIMER_INTSTS_TIF_Msk) ? 1 : 0); -} - -/** - * @brief Clear Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function clears timer time-out interrupt flag to 0. - * - * \hideinitializer - */ -static __INLINE void TIMER_ClearIntFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TIF_Msk; -} - -/** - * @brief Get Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. - * - * @retval 0 Timer capture interrupt did not occur - * @retval 1 Timer capture interrupt occurred - * - * @details This function indicates timer capture trigger interrupt occurred or not. - * - * \hideinitializer - */ -static __INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer) -{ - return timer->EINTSTS; -} - -/** - * @brief Clear Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function clears timer capture trigger interrupt flag to 0. - * - * \hideinitializer - */ -static __INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer) -{ - timer->EINTSTS = TIMER_EINTSTS_CAPIF_Msk; -} - -/** - * @brief Get Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. - * - * @retval 0 Timer does not cause CPU wake-up - * @retval 1 Timer interrupt event cause CPU wake-up - * - * @details This function indicates timer interrupt event has waked up system or not. - * - * \hideinitializer - */ -static __INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer) -{ - return (timer->INTSTS & TIMER_INTSTS_TWKF_Msk ? 1 : 0); -} - -/** - * @brief Clear Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function clears the timer wake-up system flag to 0. - * - * \hideinitializer - */ -static __INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TWKF_Msk; -} - -/** - * @brief Get Capture value - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return 24-bit Capture Value - * - * @details This function reports the current 24-bit timer capture value. - * - * \hideinitializer - */ -static __INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer) -{ - return timer->CAP; -} - -/** - * @brief Get Counter value - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return 24-bit Counter Value - * - * @details This function reports the current 24-bit timer counter value. - * - * \hideinitializer - */ -static __INLINE uint32_t TIMER_GetCounter(TIMER_T *timer) -{ - return timer->CNT; -} - -/** - * @brief Reset Counter - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This function is used to reset current counter value and internal prescale counter value. - */ -__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_RSTCNT_Msk; -} - -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq); -void TIMER_Close(TIMER_T *timer); -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec); -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge); -void TIMER_DisableCapture(TIMER_T *timer); -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge); -void TIMER_DisableEventCounter(TIMER_T *timer); -uint32_t TIMER_GetModuleClock(TIMER_T *timer); -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt); -void TIMER_DisableFreqCounter(TIMER_T *timer); -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src); -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask); - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_TIMER_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_uart.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_uart.h deleted file mode 100644 index a9b0cd08444..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_uart.h +++ /dev/null @@ -1,495 +0,0 @@ -/**************************************************************************** - * @file nu_uart.h - * @version V1.00 - * @brief M031 series UART driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_UART_H__ -#define __NU_UART_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - -/** @addtogroup UART_EXPORTED_CONSTANTS UART Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART FIFO size constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define UART0_FIFO_SIZE 16ul /*!< UART0 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART1_FIFO_SIZE 16ul /*!< UART1 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART2_FIFO_SIZE 1ul /*!< UART2 supports separated receive/transmit 1/1 bytes entry FIFO \hideinitializer */ -#define UART3_FIFO_SIZE 1ul /*!< UART3 supports separated receive/transmit 1/1 bytes entry FIFO \hideinitializer */ -#define UART4_FIFO_SIZE 16ul /*!< UART4 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART5_FIFO_SIZE 16ul /*!< UART5 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART6_FIFO_SIZE 1ul /*!< UART6 supports separated receive/transmit 1/1 bytes entry FIFO \hideinitializer */ -#define UART7_FIFO_SIZE 1ul /*!< UART7 supports separated receive/transmit 1/1 bytes entry FIFO \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_FIFO constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define UART_FIFO_RFITL_1BYTE (0x0ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 1 byte \hideinitializer */ -#define UART_FIFO_RFITL_4BYTES (0x1ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 4 bytes \hideinitializer */ -#define UART_FIFO_RFITL_8BYTES (0x2ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 8 bytes \hideinitializer */ -#define UART_FIFO_RFITL_14BYTES (0x3ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 14 bytes \hideinitializer */ - -#define UART_FIFO_RTSTRGLV_1BYTE (0x0ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 1 byte \hideinitializer */ -#define UART_FIFO_RTSTRGLV_4BYTES (0x1ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 4 bytes \hideinitializer */ -#define UART_FIFO_RTSTRGLV_8BYTES (0x2ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 8 bytes \hideinitializer */ -#define UART_FIFO_RTSTRGLV_14BYTES (0x3ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 14 bytes \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_LINE constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_WORD_LEN_5 (0ul) /*!< UART_LINE setting to set UART word length to 5 bits \hideinitializer */ -#define UART_WORD_LEN_6 (1ul) /*!< UART_LINE setting to set UART word length to 6 bits \hideinitializer */ -#define UART_WORD_LEN_7 (2ul) /*!< UART_LINE setting to set UART word length to 7 bits \hideinitializer */ -#define UART_WORD_LEN_8 (3ul) /*!< UART_LINE setting to set UART word length to 8 bits \hideinitializer */ - -#define UART_PARITY_NONE (0x0ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to set UART as no parity \hideinitializer */ -#define UART_PARITY_ODD (0x1ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to set UART as odd parity \hideinitializer */ -#define UART_PARITY_EVEN (0x3ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to set UART as even parity \hideinitializer */ -#define UART_PARITY_MARK (0x5ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to keep parity bit as '1' \hideinitializer */ -#define UART_PARITY_SPACE (0x7ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to keep parity bit as '0' \hideinitializer */ - -#define UART_STOP_BIT_1 (0x0ul << UART_LINE_NSB_Pos) /*!< UART_LINE setting for one stop bit \hideinitializer */ -#define UART_STOP_BIT_1_5 (0x1ul << UART_LINE_NSB_Pos) /*!< UART_LINE setting for 1.5 stop bit when 5-bit word length \hideinitializer */ -#define UART_STOP_BIT_2 (0x1ul << UART_LINE_NSB_Pos) /*!< UART_LINE setting for two stop bit when 6, 7, 8-bit word length \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART RTS ACTIVE LEVEL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_RTS_IS_LOW_LEV_ACTIVE (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< Set RTS is Low Level Active \hideinitializer */ -#define UART_RTS_IS_HIGH_LEV_ACTIVE (0x0ul << UART_MODEM_RTSACTLV_Pos) /*!< Set RTS is High Level Active \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_IRDA constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_IRDA_TXEN (0x1ul << UART_IRDA_TXEN_Pos) /*!< Set IrDA function Tx mode \hideinitializer */ -#define UART_IRDA_RXEN (0x0ul << UART_IRDA_TXEN_Pos) /*!< Set IrDA function Rx mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_FUNCSEL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_FUNCSEL_UART (0x0ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set UART Function (Default) \hideinitializer */ -#define UART_FUNCSEL_LIN (0x1ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set LIN Function \hideinitializer */ -#define UART_FUNCSEL_IrDA (0x2ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set IrDA Function \hideinitializer */ -#define UART_FUNCSEL_RS485 (0x3ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set RS485 Function \hideinitializer */ -#define UART_FUNCSEL_SINGLE_WIRE (0x4ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set Single Wire Function \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART BAUDRATE MODE constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_BAUD_MODE0 (0ul) /*!< Set UART Baudrate Mode is Mode0 \hideinitializer */ -#define UART_BAUD_MODE2 (UART_BAUD_BAUDM1_Msk | UART_BAUD_BAUDM0_Msk) /*!< Set UART Baudrate Mode is Mode2 \hideinitializer */ - - -/*@}*/ /* end of group UART_EXPORTED_CONSTANTS */ - - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - - -/** - * @brief Calculate UART baudrate mode0 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode0 divider - * - * @details This macro calculate UART baudrate mode0 divider. - * \hideinitializer - */ -#define UART_BAUD_MODE0_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)*8ul)) / (u32BaudRate) >> 4ul)-2ul) - - -/** - * @brief Calculate UART baudrate mode2 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode2 divider - * - * @details This macro calculate UART baudrate mode2 divider. - * \hideinitializer - */ -#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)/2ul)) / (u32BaudRate))-2ul) - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UART_WRITE(uart, u8Data) ((uart)->DAT = (u8Data)) - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module - * - * @return The oldest data byte in RX FIFO. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UART_READ(uart) ((uart)->DAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not empty - * @retval >=1 Tx FIFO is empty - * - * @details This macro get Transmitter FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_TX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not empty - * @retval >=1 Rx FIFO is empty - * - * @details This macro get Receiver FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_RX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified UART port transmission is over. - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. - * It indicates if specified UART port transmission is over nor not. - * \hideinitializer - */ -#define UART_IS_TX_EMPTY(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos) - - -/** - * @brief Wait specified UART port transmission is over - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro wait specified UART port transmission is over. - * \hideinitializer - */ -#define UART_WAIT_TX_EMPTY(uart) while(!((((uart)->FIFOSTS) & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos)) - - -/** - * @brief Check RX is ready or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 The number of bytes in the RX FIFO is less than the RFITL - * @retval 1 The number of bytes in the RX FIFO equals or larger than RFITL - * - * @details This macro check receive data available interrupt flag is set or not. - * \hideinitializer - */ -#define UART_IS_RX_READY(uart) (((uart)->INTSTS & UART_INTSTS_RDAIF_Msk)>>UART_INTSTS_RDAIF_Pos) - - -/** - * @brief Check TX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 TX FIFO is full - * @retval 0 TX FIFO is not full - * - * @details This macro check TX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_TX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk)>>UART_FIFOSTS_TXFULL_Pos) - - -/** - * @brief Check RX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 RX FIFO is full - * @retval 0 RX FIFO is not full - * - * @details This macro check RX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_RX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk)>>UART_FIFOSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not full. - * @retval >=1 Tx FIFO is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UART_GET_TX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not full. - * @retval >=1 Rx FIFO is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UART_GET_RX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk) - -/** - * @brief Rx Idle Status register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx is busy. - * @retval 1 Rx is Idle(Default) - * - * @details This macro get Rx Idle Status register value. - * \hideinitializer - */ -#define UART_RX_IDLE(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXIDLE_Msk )>> UART_FIFOSTS_RXIDLE_Pos) - - -/** - * @brief Enable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_SWBEIEN_Msk : Single-wire bit error detection interrupt - * - \ref UART_INTEN_RXPDMAEN_Msk : RX PDMA interrupt - * - \ref UART_INTEN_TXPDMAEN_Msk : TX PDMA interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_ENABLE_INT(uart, u32eIntSel) ((uart)->INTEN |= (u32eIntSel)) - - -/** - * @brief Disable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_SWBEIEN_Msk : Single-wire bit error detection interrupt - * - \ref UART_INTEN_RXPDMAEN_Msk : RX PDMA interrupt - * - \ref UART_INTEN_TXPDMAEN_Msk : TX PDMA interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_DISABLE_INT(uart, u32eIntSel) ((uart)->INTEN &= ~ (u32eIntSel)) - - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref UART_INTSTS_ABRINT_Msk : Auto-baud Rate Interrupt Indicator - * - \ref UART_INTSTS_TXENDINT_Msk : Transmitter Empty Interrupt Indicator - * - \ref UART_INTSTS_HWBUFEINT_Msk : In PDMA Mode, Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_HWTOINT_Msk : In PDMA Mode, Time-out Interrupt Indicator - * - \ref UART_INTSTS_HWMODINT_Msk : In PDMA Mode, MODEM Status Interrupt Indicator - * - \ref UART_INTSTS_HWRLSINT_Msk : In PDMA Mode, Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_SWBEINT_Msk : In Single-wire Mode, Bit Error Detect Interrupt Indicator - * - \ref UART_INTSTS_TXENDIF_Msk : Transmitter Empty Interrupt Flag - * - \ref UART_INTSTS_HWBUFEIF_Msk : In PDMA Mode, Buffer Error Interrupt Flag - * - \ref UART_INTSTS_HWTOIF_Msk : In PDMA Mode, Time-out Interrupt Flag - * - \ref UART_INTSTS_HWMODIF_Msk : In PDMA Mode, MODEM Interrupt Flag - * - \ref UART_INTSTS_HWRLSIF_Msk : In PDMA Mode, Receive Line Status Flag - * - \ref UART_INTSTS_SWBEIF_Msk : In Single-wire Mode, Bit Error Detection Interrupt Flag - * - \ref UART_INTSTS_WKINT_Msk : Wake-up Interrupt Indicator - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_RXTOINT_Msk : Time-out Interrupt Indicator - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status Interrupt Indicator - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_THREINT_Msk : Transmit Holding Register Empty Interrupt Indicator - * - \ref UART_INTSTS_RDAINT_Msk : Receive Data Available Interrupt Indicator - * - \ref UART_INTSTS_WKIF_Msk : Wake-up Interrupt Flag - * - \ref UART_INTSTS_BUFERRIF_Msk : Buffer Error Interrupt Flag - * - \ref UART_INTSTS_RXTOIF_Msk : Rx Time-out Interrupt Flag - * - \ref UART_INTSTS_MODEMIF_Msk : Modem Interrupt Flag - * - \ref UART_INTSTS_RLSIF_Msk : Receive Line Status Interrupt Flag - * - \ref UART_INTSTS_THREIF_Msk : Tx Empty Interrupt Flag - * - \ref UART_INTSTS_RDAIF_Msk : Rx Ready Interrupt Flag - * - * @retval 0 The specified interrupt is not happened. - * @retval 1 The specified interrupt is happened. - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define UART_GET_INT_FLAG(uart,u32eIntTypeFlag) (((uart)->INTSTS & (u32eIntTypeFlag))?1:0) - - -/** - * @brief Clear RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro clear RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_CLEAR_ADDR_FLAG(uart) ((uart)->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk) - - -/** - * @brief Get RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Receiver detects a data that is not an address bit. - * @retval 1 Receiver detects a data that is an address bit. - * - * @details This macro get RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_GET_ADDR_FLAG(uart) (((uart)->FIFOSTS & UART_FIFOSTS_ADDRDETF_Msk) >> UART_FIFOSTS_ADDRDETF_Pos) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T *uart); -__STATIC_INLINE void UART_SET_RTS(UART_T *uart); - - -/** - * @brief Set RTS pin to low - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to low. - */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - uart->MODEM &= ~UART_MODEM_RTS_Msk; -} - - -/** - * @brief Set RTS pin to high - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to high. - */ -__STATIC_INLINE void UART_SET_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk | UART_MODEM_RTS_Msk; -} - - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Close(UART_T *uart); -void UART_DisableFlowCtrl(UART_T *uart); -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_EnableFlowCtrl(UART_T *uart); -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Open(UART_T *uart, uint32_t u32baudrate); -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -void UART_SetLine_Config(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC); -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction); -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr); -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); -void UART_SelectSingleWireMode(UART_T *uart); - - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_UART_H__*/ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usbd.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usbd.h deleted file mode 100644 index d8761703723..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usbd.h +++ /dev/null @@ -1,699 +0,0 @@ - -/**************************************************************************//** - * @file usbd.H - * @version V1.00 - * $Revision: 9 $ - * $Date: 18/07/13 3:05p $ - * @brief M031 series USB driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_USBD_H__ -#define __NU_USBD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - -/** @addtogroup USBD_EXPORTED_STRUCT USBD Exported Struct - @{ -*/ -typedef struct s_usbd_info -{ - uint8_t *gu8DevDesc; /*!< Pointer for USB Device Descriptor */ - uint8_t *gu8ConfigDesc; /*!< Pointer for USB Configuration Descriptor */ - uint8_t **gu8StringDesc; /*!< Pointer for USB String Descriptor pointers */ - uint8_t **gu8HidReportDesc; /*!< Pointer for USB HID Report Descriptor */ - uint8_t *gu8BosDesc; /*!< Pointer for USB BOS Descriptor */ - uint32_t *gu32HidReportSize; /*!< Pointer for HID Report descriptor Size */ - uint32_t *gu32ConfigHidDescIdx; /*!< Pointer for HID Descriptor start index */ - -} S_USBD_INFO_T; /*!< Device description structure */ - -extern const S_USBD_INFO_T gsInfo; - -/*@}*/ /* end of group USBD_EXPORTED_STRUCTS */ - - - - -/** @addtogroup USBD_EXPORTED_CONSTANTS USBD Exported Constants - @{ -*/ -#define USBD_BUF_BASE (USBD_BASE+0x100ul) /*!< USBD buffer base address \hideinitializer */ -#define USBD_MAX_EP 8ul /*!< Total EP number \hideinitializer */ - -#define EP0 0ul /*!< Endpoint 0 \hideinitializer */ -#define EP1 1ul /*!< Endpoint 1 \hideinitializer */ -#define EP2 2ul /*!< Endpoint 2 \hideinitializer */ -#define EP3 3ul /*!< Endpoint 3 \hideinitializer */ -#define EP4 4ul /*!< Endpoint 4 \hideinitializer */ -#define EP5 5ul /*!< Endpoint 5 \hideinitializer */ -#define EP6 6ul /*!< Endpoint 6 \hideinitializer */ -#define EP7 7ul /*!< Endpoint 7 \hideinitializer */ - -/** @cond HIDDEN_SYMBOLS */ -/* USB Request Type */ -#define REQ_STANDARD 0x00ul -#define REQ_CLASS 0x20ul -#define REQ_VENDOR 0x40ul - -/* USB Standard Request */ -#define GET_STATUS 0x00ul -#define CLEAR_FEATURE 0x01ul -#define SET_FEATURE 0x03ul -#define SET_ADDRESS 0x05ul -#define GET_DESCRIPTOR 0x06ul -#define SET_DESCRIPTOR 0x07ul -#define GET_CONFIGURATION 0x08ul -#define SET_CONFIGURATION 0x09ul -#define GET_INTERFACE 0x0Aul -#define SET_INTERFACE 0x0Bul -#define SYNC_FRAME 0x0Cul - -/* USB Descriptor Type */ -#define DESC_DEVICE 0x01ul -#define DESC_CONFIG 0x02ul -#define DESC_STRING 0x03ul -#define DESC_INTERFACE 0x04ul -#define DESC_ENDPOINT 0x05ul -#define DESC_QUALIFIER 0x06ul -#define DESC_OTHERSPEED 0x07ul -#define DESC_IFPOWER 0x08ul -#define DESC_OTG 0x09ul -#define DESC_BOS 0x0Ful -#define DESC_CAPABILITY 0x10ul - -/* USB Device Capability Type */ -#define CAP_WIRELESS 0x01ul -#define CAP_USB20_EXT 0x02ul - -/* USB HID Descriptor Type */ -#define DESC_HID 0x21ul -#define DESC_HID_RPT 0x22ul - -/* USB Descriptor Length */ -#define LEN_DEVICE 18ul -#define LEN_QUALIFIER 10ul -#define LEN_CONFIG 9ul -#define LEN_INTERFACE 9ul -#define LEN_ENDPOINT 7ul -#define LEN_OTG 5ul -#define LEN_BOS 5ul -#define LEN_HID 9ul -#define LEN_CCID 0x36ul -#define LEN_BOSCAP 7ul - -/*! b, then return a. Otherwise, return b. - * \hideinitializer - */ -#define USBD_Maximum(a,b) ((a)>(b) ? (a) : (b)) - - -/** - * @brief Compare two input numbers and return minimum one - * - * @param[in] a First number to be compared - * @param[in] b Second number to be compared - * - * @return Minimum value between a and b - * - * @details If a < b, then return a. Otherwise, return b. - * \hideinitializer - */ -#define USBD_Minimum(a,b) ((a)<(b) ? (a) : (b)) - - -/** - * @brief Enable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB and PHY. - * \hideinitializer - */ -#define USBD_ENABLE_USB() ((uint32_t)(USBD->ATTR |= 0x7D0)) - -/** - * @brief Disable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB. - * \hideinitializer - */ -#define USBD_DISABLE_USB() ((uint32_t)(USBD->ATTR &= ~USBD_USB_EN)) - -/** - * @brief Enable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB PHY. - * \hideinitializer - */ -#define USBD_ENABLE_PHY() ((uint32_t)(USBD->ATTR |= USBD_PHY_EN)) - -/** - * @brief Disable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB PHY. - * \hideinitializer - */ -#define USBD_DISABLE_PHY() ((uint32_t)(USBD->ATTR &= ~USBD_PHY_EN)) - -/** - * @brief Enable SE0. Force USB PHY transceiver to drive SE0. - * - * @param None - * - * @return None - * - * @details Set DRVSE0 bit of USB_DRVSE0 register to enable software-disconnect function. Force USB PHY transceiver to drive SE0 to bus. - * \hideinitializer - */ -#define USBD_SET_SE0() ((uint32_t)(USBD->SE0 |= USBD_DRVSE0)) - -/** - * @brief Disable SE0 - * - * @param None - * - * @return None - * - * @details Clear DRVSE0 bit of USB_DRVSE0 register to disable software-disconnect function. - * \hideinitializer - */ -#define USBD_CLR_SE0() ((uint32_t)(USBD->SE0 &= ~USBD_DRVSE0)) - -/** - * @brief Set USB device address - * - * @param[in] addr The USB device address. - * - * @return None - * - * @details Write USB device address to USB_FADDR register. - * \hideinitializer - */ -#define USBD_SET_ADDR(addr) (USBD->FADDR = (addr)) - -/** - * @brief Get USB device address - * - * @param None - * - * @return USB device address - * - * @details Read USB_FADDR register to get USB device address. - * \hideinitializer - */ -#define USBD_GET_ADDR() ((uint32_t)(USBD->FADDR)) - -/** - * @brief Enable USB interrupt function - * - * @param[in] intr The combination of the specified interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. - * (USBD_INT_WAKEUP, USBD_INT_FLDET, USBD_INT_USB, USBD_INT_BUS) - * - * @return None - * - * @details Enable USB related interrupt functions specified by intr parameter. - * \hideinitializer - */ -#define USBD_ENABLE_INT(intr) (USBD->INTEN |= (intr)) - -/** - * @brief Get interrupt status - * - * @param None - * - * @return The value of USB_INTSTS register - * - * @details Return all interrupt flags of USB_INTSTS register. - * \hideinitializer - */ -#define USBD_GET_INT_FLAG() ((uint32_t)(USBD->INTSTS)) - -/** - * @brief Clear USB interrupt flag - * - * @param[in] flag The combination of the specified interrupt flags. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. - * (USBD_INTSTS_WAKEUP, USBD_INTSTS_FLDET, USBD_INTSTS_BUS, USBD_INTSTS_USB) - * - * @return None - * - * @details Clear USB related interrupt flags specified by flag parameter. - * \hideinitializer - */ -#define USBD_CLR_INT_FLAG(flag) (USBD->INTSTS = (flag)) - -/** - * @brief Get endpoint status - * - * @param None - * - * @return The value of USB_EPSTS register. - * - * @details Return all endpoint status. - * \hideinitializer - */ -#define USBD_GET_EP_FLAG() ((uint32_t)(USBD->EPSTS)) - -/** - * @brief Get USB bus state - * - * @param None - * - * @return The value of USB_ATTR[3:0]. - * Bit 0 indicates USB bus reset status. - * Bit 1 indicates USB bus suspend status. - * Bit 2 indicates USB bus resume status. - * Bit 3 indicates USB bus time-out status. - * - * @details Return USB_ATTR[3:0] for USB bus events. - * \hideinitializer - */ -#define USBD_GET_BUS_STATE() ((uint32_t)(USBD->ATTR & 0xf)) - -/** - * @brief Check cable connection state - * - * @param None - * - * @retval 0 USB cable is not attached. - * @retval 1 USB cable is attached. - * - * @details Check the connection state by FLDET bit of USB_FLDET register. - * \hideinitializer - */ -#define USBD_IS_ATTACHED() ((uint32_t)(USBD->VBUSDET & USBD_VBUSDET_VBUSDET_Msk)) - -/** - * @brief Stop USB transaction of the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @return None - * - * @details Write 1 to CLRRDY bit of USB_CFGPx register to stop USB transaction of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_STOP_TRANSACTION(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_CLRRDY_Msk) - -/** - * @brief Set USB DATA1 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @return None - * - * @details Set DSQ_SYNC bit of USB_CFGx register to specify the DATA1 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions. - * \hideinitializer - */ -#define USBD_SET_DATA1(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DSQSYNC_Msk) - -/** - * @brief Set USB DATA0 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @return None - * - * @details Clear DSQ_SYNC bit of USB_CFGx register to specify the DATA0 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions. - * \hideinitializer - */ -#define USBD_SET_DATA0(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DSQSYNC_Msk)) - -/** - * @brief Set USB payload size (IN data) - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @param[in] size The transfer length. - * - * @return None - * - * @details This macro will write the transfer length to USB_MXPLDx register for IN data transaction. - * \hideinitializer - */ -#define USBD_SET_PAYLOAD_LEN(ep, size) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4))) = (size)) - -/** - * @brief Get USB payload size (OUT data) - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 endpoint ID. This parameter could be 0 ~ 7. - * - * @return The value of USB_MXPLDx register. - * - * @details Get the data length of OUT data transaction by reading USB_MXPLDx register. - * \hideinitializer - */ -#define USBD_GET_PAYLOAD_LEN(ep) ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4)))) - -/** - * @brief Configure endpoint - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @param[in] config The USB configuration. - * - * @return None - * - * @details This macro will write config parameter to USB_CFGx register of specified endpoint ID. - * \hideinitializer - */ -#define USBD_CONFIG_EP(ep, config) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) = (config)) - -/** - * @brief Set USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @param[in] offset The SRAM offset. - * - * @return None - * - * @details This macro will set the SRAM offset for the specified endpoint ID. - * \hideinitializer - */ -#define USBD_SET_EP_BUF_ADDR(ep, offset) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4))) = (offset)) - -/** - * @brief Get the offset of the specified USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @return The offset of the specified endpoint buffer. - * - * @details This macro will return the SRAM offset of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_GET_EP_BUF_ADDR(ep) ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4)))) - -/** - * @brief Set USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @return None - * - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - * \hideinitializer - */ -#define USBD_SET_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0ul].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_SSTALL_Msk) - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @return None - * - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - * \hideinitializer - */ -#define USBD_CLR_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) &= ~USBD_CFGP_SSTALL_Msk) - -/** - * @brief Get USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M451 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 7. - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_GET_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) & USBD_CFGP_SSTALL_Msk) - -/** - * @brief To support byte access between USB SRAM and system SRAM - * - * @param[in] dest Destination pointer. - * - * @param[in] src Source pointer. - * - * @param[in] size Byte count. - * - * @return None - * - * @details This function will copy the number of data specified by size and src parameters to the address specified by dest parameter. - * - */ -__STATIC_INLINE void USBD_MemCopy(uint8_t dest[], uint8_t src[], uint32_t size) -{ - uint32_t volatile i = 0ul; - - while (size--) - { - dest[i] = src[i]; - i++; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Set USB endpoint stall state. Endpoint will respond STALL token automatically. - * - */ -__STATIC_INLINE void USBD_SetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for (i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if ((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg | USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Clear USB endpoint stall state. Endpoint will respond ACK/NAK token. - */ -__STATIC_INLINE void USBD_ClearStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for (i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if ((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg & ~USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - * - */ -__STATIC_INLINE uint32_t USBD_GetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for (i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if ((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - break; - } - } - - return ((*((__IO uint32_t *)(u32CfgAddr))) & USBD_CFGP_SSTALL); -} - - -extern volatile uint8_t g_usbd_RemoteWakeupEn; - - -typedef void (*VENDOR_REQ)(void); /*!< Functional pointer type definition for Vendor class */ -typedef void (*CLASS_REQ)(void); /*!< Functional pointer type declaration for USB class request callback handler */ -typedef void (*SET_INTERFACE_REQ)(uint32_t u32AltInterface); /*!< Functional pointer type declaration for USB set interface request callback handler */ -typedef void (*SET_CONFIG_CB)(void); /*!< Functional pointer type declaration for USB set configuration request callback handler */ - - -/*--------------------------------------------------------------------*/ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface); -void USBD_Start(void); -void USBD_GetSetupPacket(uint8_t *buf); -void USBD_ProcessSetupPacket(void); -void USBD_StandardRequest(void); -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size); -void USBD_CtrlIn(void); -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size); -void USBD_CtrlOut(void); -void USBD_SwReset(void); -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq); -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback); -void USBD_LockEpStall(uint32_t u32EpBitmap); - -/*@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_USBD_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_i2c.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_i2c.h deleted file mode 100644 index 64e6f456717..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_i2c.h +++ /dev/null @@ -1,332 +0,0 @@ -/**************************************************************************//** - * @file nu_usci_i2c.h - * @version V1.00 - * @brief M031 series USCI I2C(UI2C) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_USCI_I2C_H__ -#define __NU_USCI_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - -/** @addtogroup USCI_I2C_EXPORTED_CONSTANTS USCI_I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C master event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_MASTER_EVENT -{ - MASTER_SEND_ADDRESS = 10u, /*!< Master send address to Slave */ - MASTER_SEND_H_WR_ADDRESS, /*!< Master send High address to Slave */ - MASTER_SEND_H_RD_ADDRESS, /*!< Master send address to Slave (Read ADDR) */ - MASTER_SEND_L_ADDRESS, /*!< Master send Low address to Slave */ - MASTER_SEND_DATA, /*!< Master Send Data to Slave */ - MASTER_SEND_REPEAT_START, /*!< Master send repeat start to Slave */ - MASTER_READ_DATA, /*!< Master Get Data from Slave */ - MASTER_STOP, /*!< Master send stop to Slave */ - MASTER_SEND_START /*!< Master send start to Slave */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C slave event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_SLAVE_EVENT -{ - SLAVE_ADDRESS_ACK = 100u, /*!< Slave send address ACK */ - SLAVE_H_WR_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_WR_ADDRESS_ACK, /*!< Slave send Low address ACK */ - SLAVE_GET_DATA, /*!< Slave Get Data from Master (Write CMD) */ - SLAVE_SEND_DATA, /*!< Slave Send Data to Master (Read CMD) */ - SLAVE_H_RD_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_RD_ADDRESS_ACK /*!< Slave send Low address ACK */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_CTL_PTRG 0x20UL /*!< USCI_CTL setting for I2C control bits. It would set PTRG bit \hideinitializer */ -#define UI2C_CTL_STA 0x08UL /*!< USCI_CTL setting for I2C control bits. It would set STA bit \hideinitializer */ -#define UI2C_CTL_STO 0x04UL /*!< USCI_CTL setting for I2C control bits. It would set STO bit \hideinitializer */ -#define UI2C_CTL_AA 0x02UL /*!< USCI_CTL setting for I2C control bits. It would set AA bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_GCMODE_ENABLE (1U) /*!< Enable USCI_I2C GC Mode \hideinitializer */ -#define UI2C_GCMODE_DISABLE (0U) /*!< Disable USCI_I2C GC Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C Wakeup Mode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_DATA_TOGGLE_WK (0x0U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according data toggle \hideinitializer */ -#define UI2C_ADDR_MATCH_WK (0x1U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according address match \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_TO_INT_MASK (0x001U) /*!< Time-out interrupt mask \hideinitializer */ -#define UI2C_STAR_INT_MASK (0x002U) /*!< Start condition received interrupt mask \hideinitializer */ -#define UI2C_STOR_INT_MASK (0x004U) /*!< Stop condition received interrupt mask \hideinitializer */ -#define UI2C_NACK_INT_MASK (0x008U) /*!< Non-acknowledge interrupt mask \hideinitializer */ -#define UI2C_ARBLO_INT_MASK (0x010U) /*!< Arbitration lost interrupt mask \hideinitializer */ -#define UI2C_ERR_INT_MASK (0x020U) /*!< Error interrupt mask \hideinitializer */ -#define UI2C_ACK_INT_MASK (0x040U) /*!< Acknowledge interrupt mask \hideinitializer */ - -/*@}*/ /* end of group USCI_I2C_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This macro sets the USCI_I2C protocol control register at one time - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Ctrl Set the register value of USCI_I2C control register. - * - * @return None - * - * @details Set UI2C_PROTCTL register to control USCI_I2C bus conditions of START, STOP, PTRG, ACK. - * \hideinitializer - */ -#define UI2C_SET_CONTROL_REG(ui2c, u8Ctrl) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2EU) | (u8Ctrl)) - -/** - * @brief This macro only set START bit to protocol control register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus START condition in UI2C_PROTCTL register. - * \hideinitializer - */ -#define UI2C_START(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~UI2C_PROTCTL_PTRG_Msk) | UI2C_PROTCTL_STA_Msk) - -/** - * @brief This macro only set STOP bit to the control register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus STOP condition in UI2C_PROTCTL register. - * \hideinitializer - */ -#define UI2C_STOP(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2E) | (UI2C_PROTCTL_PTRG_Msk | UI2C_PROTCTL_STO_Msk)) - -/** - * @brief This macro returns the data stored in data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Data - * - * @details Read a byte data value of UI2C_RXDAT register from USCI_I2C bus - * \hideinitializer - */ -#define UI2C_GET_DATA(ui2c) ((ui2c)->RXDAT) - -/** - * @brief This macro writes the data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details Write a byte data value of UI2C_TXDAT register, then sends address or data to USCI I2C bus - * \hideinitializer - */ -#define UI2C_SET_DATA(ui2c, u8Data) ((ui2c)->TXDAT = (u8Data)) - -/** - * @brief This macro returns time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 USCI_I2C bus time-out is not happened - * @retval 1 USCI_I2C bus time-out is happened - * - * @details USCI_I2C bus occurs time-out event, the time-out flag will be set. If not occurs time-out event, this bit is cleared. - * \hideinitializer - */ -#define UI2C_GET_TIMEOUT_FLAG(ui2c) (((ui2c)->PROTSTS & UI2C_PROTSTS_TOIF_Msk) == UI2C_PROTSTS_TOIF_Msk ? 1:0) - -/** - * @brief This macro returns wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details USCI_I2C controller wake-up flag will be set when USCI_I2C bus occurs wake-up from deep-sleep. - * \hideinitializer - */ -#define UI2C_GET_WAKEUP_FLAG(ui2c) (((ui2c)->WKSTS & UI2C_WKSTS_WKF_Msk) == UI2C_WKSTS_WKF_Msk ? 1:0) - -/** - * @brief This macro is used to clear USCI_I2C wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details If USCI_I2C wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define UI2C_CLR_WAKEUP_FLAG(ui2c) ((ui2c)->WKSTS = UI2C_WKSTS_WKF_Msk) - -/** - * @brief This macro disables the USCI_I2C 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details The UI2C_I2C is 7-bit address mode, when disable USCI_I2C 10-bit address match function. - * \hideinitializer - */ -#define UI2C_DISABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL &= ~(UI2C_PROTCTL_ADDR10EN_Msk)) - -/** - * @brief This macro enables the 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To enable USCI_I2C 10-bit address match function. - * \hideinitializer - */ -#define UI2C_ENABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL |= UI2C_PROTCTL_ADDR10EN_Msk) - -/** - * @brief This macro gets USCI_I2C protocol interrupt flag or bus status - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return A word data of USCI_I2C_PROTSTS register - * - * @details Read a word data of USCI_I2C PROTSTS register to get USCI_I2C bus Interrupt flags or status. - * \hideinitializer - */ -#define UI2C_GET_PROT_STATUS(ui2c) ((ui2c)->PROTSTS) - -/** - * @brief This macro clears specified protocol interrupt flag - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UI2C_PROTSTS_ACKIF_Msk - * - \ref UI2C_PROTSTS_ERRIF_Msk - * - \ref UI2C_PROTSTS_ARBLOIF_Msk - * - \ref UI2C_PROTSTS_NACKIF_Msk - * - \ref UI2C_PROTSTS_STORIF_Msk - * - \ref UI2C_PROTSTS_STARIF_Msk - * - \ref UI2C_PROTSTS_TOIF_Msk - * @return None - * - * @details To clear interrupt flag when USCI_I2C occurs interrupt and set interrupt flag. - * \hideinitializer - */ -#define UI2C_CLR_PROT_INT_FLAG(ui2c,u32IntTypeFlag) ((ui2c)->PROTSTS = (u32IntTypeFlag)) - -/** - * @brief This macro enables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Set specified USCI_I2C protocol interrupt bits to enable interrupt function. - * \hideinitializer - */ -#define UI2C_ENABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN |= (u32IntSel)) - -/** - * @brief This macro disables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Clear specified USCI_I2C protocol interrupt bits to disable interrupt function. - * \hideinitializer - */ -#define UI2C_DISABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN &= ~ (u32IntSel)) - - -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock); -void UI2C_Close(UI2C_T *ui2c); -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c); -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack); -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask); -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c); -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock); -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_ClearIntFlag(UI2C_T *ui2c , uint32_t u32Mask); -uint32_t UI2C_GetData(UI2C_T *ui2c); -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data); -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode); -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask); -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt); -void UI2C_DisableTimeout(UI2C_T *ui2c); -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode); -void UI2C_DisableWakeup(UI2C_T *ui2c); -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, const uint8_t data); -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, const uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, const uint8_t data); -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, const uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, const uint8_t data); -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, const uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr); -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen); -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen); -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen); - -/*@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_I2C_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_spi.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_spi.h deleted file mode 100644 index 09900787c1a..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_spi.h +++ /dev/null @@ -1,428 +0,0 @@ -/****************************************************************************//** - * @file nu_usci_spi.h - * @version V1.00 - * @brief M031 series USCI_SPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_USCI_SPI_H__ -#define __NU_USCI_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - -/** @addtogroup USCI_SPI_EXPORTED_CONSTANTS USCI_SPI Exported Constants - @{ -*/ - -#define USPI_MODE_0 (0x0UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with falling edge and receive with rising edge \hideinitializer */ -#define USPI_MODE_1 (0x1UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with rising edge and receive with falling edge \hideinitializer */ -#define USPI_MODE_2 (0x2UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with rising edge and receive with falling edge \hideinitializer */ -#define USPI_MODE_3 (0x3UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with falling edge and receive with rising edge \hideinitializer */ - -#define USPI_SLAVE (USPI_PROTCTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define USPI_MASTER (0x0UL) /*!< Set as master \hideinitializer */ - -#define USPI_SS (USPI_PROTCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define USPI_SS_ACTIVE_HIGH (0x0UL) /*!< SS active high \hideinitializer */ -#define USPI_SS_ACTIVE_LOW (USPI_LINECTL_CTLOINV_Msk) /*!< SS active low \hideinitializer */ - -/* USCI_SPI Interrupt Mask */ -#define USPI_SSINACT_INT_MASK (0x001UL) /*!< Slave Select Inactive interrupt mask \hideinitializer */ -#define USPI_SSACT_INT_MASK (0x002UL) /*!< Slave Select Active interrupt mask \hideinitializer */ -#define USPI_SLVTO_INT_MASK (0x004UL) /*!< Slave Mode Time-out interrupt mask \hideinitializer */ -#define USPI_SLVBE_INT_MASK (0x008UL) /*!< Slave Mode Bit Count Error interrupt mask \hideinitializer */ -#define USPI_TXUDR_INT_MASK (0x010UL) /*!< Slave Transmit Under Run interrupt mask \hideinitializer */ -#define USPI_RXOV_INT_MASK (0x020UL) /*!< Receive Buffer Overrun interrupt mask \hideinitializer */ -#define USPI_TXST_INT_MASK (0x040UL) /*!< Transmit Start interrupt mask \hideinitializer */ -#define USPI_TXEND_INT_MASK (0x080UL) /*!< Transmit End interrupt mask \hideinitializer */ -#define USPI_RXST_INT_MASK (0x100UL) /*!< Receive Start interrupt mask \hideinitializer */ -#define USPI_RXEND_INT_MASK (0x200UL) /*!< Receive End interrupt mask \hideinitializer */ - -/* USCI_SPI Status Mask */ -#define USPI_BUSY_MASK (0x01UL) /*!< Busy status mask \hideinitializer */ -#define USPI_RX_EMPTY_MASK (0x02UL) /*!< RX empty status mask \hideinitializer */ -#define USPI_RX_FULL_MASK (0x04UL) /*!< RX full status mask \hideinitializer */ -#define USPI_TX_EMPTY_MASK (0x08UL) /*!< TX empty status mask \hideinitializer */ -#define USPI_TX_FULL_MASK (0x10UL) /*!< TX full status mask \hideinitializer */ -#define USPI_SSLINE_STS_MASK (0x20UL) /*!< USCI_SPI_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group USCI_SPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief Disable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL &= ~USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL |= USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Get the Rx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Rx buffer flag - * @retval 0: Rx buffer is not empty - * @retval 1: Rx buffer is empty - * \hideinitializer - */ -#define USPI_GET_RX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_RXEMPTY_Msk) == USPI_BUFSTS_RXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not empty - * @retval 1: Tx buffer is empty - * \hideinitializer - */ -#define USPI_GET_TX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXEMPTY_Msk) == USPI_BUFSTS_TXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer full flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not full - * @retval 1: Tx buffer is full - * \hideinitializer - */ -#define USPI_GET_TX_FULL_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXFULL_Msk) == USPI_BUFSTS_TXFULL_Msk ? 1:0 ) - -/** - * @brief Get the datum read from RX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return data in Rx register - * \hideinitializer - */ -#define USPI_READ_RX(uspi) ( (uspi)->RXDAT ) - -/** - * @brief Write datum to TX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through USCI_SPI bus. - * @return None - * \hideinitializer - */ -#define USPI_WRITE_TX(uspi, u32TxData) ( (uspi)->TXDAT = (u32TxData) ) - -/** - * @brief Set USCI_SPI_SS pin to high state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to high state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_HIGH(uspi) \ - do{ \ - (uspi)->LINECTL &= ~(USPI_LINECTL_CTLOINV_Msk); \ - (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \ - }while(0) - -/** - * @brief Set USCI_SPI_SS pin to low state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to low state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_LOW(uspi) \ - do{ \ - (uspi)->LINECTL |= (USPI_LINECTL_CTLOINV_Msk); \ - (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \ - }while(0) - -/** - * @brief Set the length of suspend interval. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SuspCycle Decide the length of suspend interval. - * @return None - * \hideinitializer - */ -#define USPI_SET_SUSPEND_CYCLE(uspi, u32SuspCycle) ( (uspi)->PROTCTL = ((uspi)->PROTCTL & ~USPI_PROTCTL_SUSPITV_Msk) | ((u32SuspCycle) << USPI_PROTCTL_SUSPITV_Pos) ) - -/** - * @brief Set the USCI_SPI transfer sequence with LSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_LSB_FIRST(uspi) ( (uspi)->LINECTL |= USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the USCI_SPI transfer sequence with MSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_MSB_FIRST(uspi) ( (uspi)->LINECTL &= ~USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the data width of a USCI_SPI transaction. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Width The data width - * @return None - * \hideinitializer - */ -#define USPI_SET_DATA_WIDTH(uspi, u32Width) \ - do{ \ - if((u32Width) == 16ul){ \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | (0 << USPI_LINECTL_DWIDTH_Pos); \ - }else { \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | ((u32Width) << USPI_LINECTL_DWIDTH_Pos); \ - } \ - }while(0) - -/** - * @brief Get the USCI_SPI busy state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return USCI_SPI busy status - * @retval 0: USCI_SPI module is not busy - * @retval 1: USCI_SPI module is busy - * \hideinitializer - */ -#define USPI_IS_BUSY(uspi) ( ((uspi)->PROTSTS & USPI_PROTSTS_BUSY_Msk) == USPI_PROTSTS_BUSY_Msk ? 1:0 ) - -/** - * @brief Get the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Wakeup status. - * @retval 0 Flag is not set. - * @retval 1 Flag is set. - * \hideinitializer - */ -#define USPI_GET_WAKEUP_FLAG(uspi) ( ((uspi)->WKSTS & USPI_WKSTS_WKF_Msk) == USPI_WKSTS_WKF_Msk ? 1:0 ) - -/** - * @brief Clear the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_CLR_WAKEUP_FLAG(uspi) ( (uspi)->WKSTS |= USPI_WKSTS_WKF_Msk ) - -/** - * @brief Get protocol interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of protocol status register. - * \hideinitializer - */ -#define USPI_GET_PROT_STATUS(uspi) ( (uspi)->PROTSTS ) - -/** - * @brief Clear specified protocol interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_PROTSTS_SSACTIF_Msk - * - \ref USPI_PROTSTS_SSINAIF_Msk - * - \ref USPI_PROTSTS_SLVBEIF_Msk - * - \ref USPI_PROTSTS_SLVTOIF_Msk - * - \ref USPI_PROTSTS_RXENDIF_Msk - * - \ref USPI_PROTSTS_RXSTIF_Msk - * - \ref USPI_PROTSTS_TXENDIF_Msk - * - \ref USPI_PROTSTS_TXSTIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_PROT_INT_FLAG(uspi, u32IntTypeFlag) ( (uspi)->PROTSTS = (u32IntTypeFlag) ) - -/** - * @brief Get buffer interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of buffer status register. - * \hideinitializer - */ -#define USPI_GET_BUF_STATUS(uspi) ( (uspi)->BUFSTS ) - -/** - * @brief Clear specified buffer interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_BUFSTS_TXUDRIF_Msk - * - \ref USPI_BUFSTS_RXOVIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_BUF_INT_FLAG(uspi, u32IntTypeFlag) ( (uspi)->BUFSTS = (u32IntTypeFlag) ) - -/** - * @brief Enable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_PROT_INT(uspi, u32IntSel) ( (uspi)->PROTIEN |= (u32IntSel) ) - -/** - * @brief Disable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_PROT_INT(uspi, u32IntSel) ( (uspi)->PROTIEN &= ~ (u32IntSel) ) - -/** - * @brief Enable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_BUF_INT(uspi, u32IntSel) ( (uspi)->BUFCTL |= (u32IntSel) ) - -/** - * @brief Disable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_BUF_INT(uspi, u32IntSel) ( (uspi)->BUFCTL &= ~ (u32IntSel) ) - -/** - * @brief Enable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_TRANS_INT(uspi, u32IntSel) ( (uspi)->INTEN |= (u32IntSel) ) - -/** - * @brief Disable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_TRANS_INT(uspi, u32IntSel) ( (uspi)->INTEN &= ~ (u32IntSel) ) - -/** - * @brief Trigger RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set RXPDMAEN bit of USPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_RX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_RXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Trigger TX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit of USPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_TX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_TX_RX_PDMA(uspi) ((uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk|USPI_PDMACTL_RXPDMAEN_Msk|USPI_PDMACTL_PDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear RXPDMAEN bit of USPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit of USPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_TX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_TX_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~(USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_RXPDMAEN_Msk)) - -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void USPI_Close(USPI_T *uspi); -void USPI_ClearRxBuf(USPI_T *uspi); -void USPI_ClearTxBuf(USPI_T *uspi); -void USPI_DisableAutoSS(USPI_T *uspi); -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock); -uint32_t USPI_GetBusClock(USPI_T *uspi); -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask); -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask); -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask); -void USPI_EnableWakeup(USPI_T *uspi); -void USPI_DisableWakeup(USPI_T *uspi); - - -/*@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_SPI_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_uart.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_uart.h deleted file mode 100644 index d3fcd317a6b..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_usci_uart.h +++ /dev/null @@ -1,523 +0,0 @@ -/**************************************************************************//** - * @file nu_usci_uart.h - * @version V1.00 - * @brief M031 series USCI UART (UUART) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_USCI_UART_H__ -#define __NU_USCI_UART_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_CONSTANTS USCI_UART Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_LINECTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_WORD_LEN_6 (6ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 6 bits \hideinitializer */ -#define UUART_WORD_LEN_7 (7ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 7 bits \hideinitializer */ -#define UUART_WORD_LEN_8 (8ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 8 bits \hideinitializer */ -#define UUART_WORD_LEN_9 (9ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 9 bits \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_PROTCTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_PARITY_NONE (0x0ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as no parity \hideinitializer */ -#define UUART_PARITY_ODD (0x1ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as odd parity \hideinitializer */ -#define UUART_PARITY_EVEN (0x3ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as even parity \hideinitializer */ - -#define UUART_STOP_BIT_1 (0x0ul) /*!< UUART_PROTCTL setting for one stop bit \hideinitializer */ -#define UUART_STOP_BIT_2 (0x1ul) /*!< UUART_PROTCTL setting for two stop bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI UART interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_ABR_INT_MASK (0x002ul) /*!< Auto-baud rate interrupt mask \hideinitializer */ -#define UUART_RLS_INT_MASK (0x004ul) /*!< Receive line status interrupt mask \hideinitializer */ -#define UUART_BUF_RXOV_INT_MASK (0x008ul) /*!< Buffer RX overrun interrupt mask \hideinitializer */ -#define UUART_TXST_INT_MASK (0x010ul) /*!< TX start interrupt mask \hideinitializer */ -#define UUART_TXEND_INT_MASK (0x020ul) /*!< Tx end interrupt mask \hideinitializer */ -#define UUART_RXST_INT_MASK (0x040ul) /*!< RX start interrupt mask \hideinitializer */ -#define UUART_RXEND_INT_MASK (0x080ul) /*!< RX end interrupt mask \hideinitializer */ - - -/*@}*/ /* end of group USCI_UART_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UUART_WRITE(uuart, u8Data) ((uuart)->TXDAT = (u8Data)) - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The oldest data byte in RX buffer. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UUART_READ(uuart) ((uuart)->RXDAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not empty - * @retval >=1 Tx buffer is empty - * - * @details This macro get Transmitter buffer empty register value. - * \hideinitializer - */ -#define UUART_GET_TX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not empty - * @retval >=1 Rx buffer is empty - * - * @details This macro get Receiver buffer empty register value. - * \hideinitializer - */ -#define UUART_GET_RX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified usci_uart port transmission is over. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. \n - * It indicates if specified usci_uart port transmission is over nor not. - * \hideinitializer - */ -#define UUART_IS_TX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos) - - -/** - * @brief Check specified usci_uart port receiver is empty. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx receiver is not empty - * @retval 1 Rx receiver is empty - * - * @details This macro return Receive Empty Flag register bit value. \n - * It indicates if specified usci_uart port receiver is empty nor not. - * \hideinitializer - */ -#define UUART_IS_RX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) >> UUART_BUFSTS_RXEMPTY_Pos) - - -/** - * @brief Wait specified usci_uart port transmission is over - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro wait specified usci_uart port transmission is over. - * \hideinitializer - */ -#define UUART_WAIT_TX_EMPTY(uuart) while(!((((uuart)->BUFSTS) & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos)) - - -/** - * @brief Check TX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 TX buffer is full - * @retval 0 TX buffer is not full - * - * @details This macro check TX buffer is full or not. - * \hideinitializer - */ -#define UUART_IS_TX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk)>>UUART_BUFSTS_TXFULL_Pos) - - -/** - * @brief Check RX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 RX buffer is full - * @retval 0 RX buffer is not full - * - * @details This macro check RX buffer is full or not. - * \hideinitializer - */ -#define UUART_IS_RX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk)>>UUART_BUFSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not full. - * @retval >=1 Tx buffer is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UUART_GET_TX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not full. - * @retval >=1 Rx buffer is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UUART_GET_RX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk) - - -/** - * @brief Enable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART protocol interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART protocol interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN &= ~(u32IntSel)) - - -/** - * @brief Enable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART buffer interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART buffer interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL &= ~ (u32IntSel)) - - -/** - * @brief Enable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART transfer interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART transfer interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN &= ~(u32IntSel)) - - -/** - * @brief Get protocol interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of protocol status register. - * - * @details This macro get protocol status register value. - * \hideinitializer - */ -#define UUART_GET_PROT_STATUS(uuart) ((uuart)->PROTSTS) - - -/** - * @brief Clear specified protocol interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_PROTSTS_ABERRSTS_Msk : Auto-baud Rate Error Interrupt Indicator - * - \ref UUART_PROTSTS_ABRDETIF_Msk : Auto-baud Rate Detected Interrupt Flag - * - \ref UUART_PROTSTS_BREAK_Msk : Break Flag - * - \ref UUART_PROTSTS_FRMERR_Msk : Framing Error Flag - * - \ref UUART_PROTSTS_PARITYERR_Msk : Parity Error Flag - * - \ref UUART_PROTSTS_RXENDIF_Msk : Receive End Interrupt Flag - * - \ref UUART_PROTSTS_RXSTIF_Msk : Receive Start Interrupt Flag - * - \ref UUART_PROTSTS_TXENDIF_Msk : Transmit End Interrupt Flag - * - \ref UUART_PROTSTS_TXSTIF_Msk : Transmit Start Interrupt Flag - * - * @return None - * - * @details This macro clear specified protocol interrupt flag. - * \hideinitializer - */ -#define UUART_CLR_PROT_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->PROTSTS = (u32IntTypeFlag)) - - -/** - * @brief Get transmit/receive buffer interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of buffer status register. - * - * @details This macro get buffer status register value. - * \hideinitializer - */ -#define UUART_GET_BUF_STATUS(uuart) ((uuart)->BUFSTS) - - -/** - * @brief Clear specified buffer interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_BUFSTS_RXOVIF_Msk : Receive Buffer Over-run Error Interrupt Indicator - * - * @return None - * - * @details This macro clear specified buffer interrupt flag. - * \hideinitializer - */ -#define UUART_CLR_BUF_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->BUFSTS = (u32IntTypeFlag)) - - -/** - * @brief Get wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Chip did not wake up from power-down mode. - * @retval 1 Chip waked up from power-down mode. - * - * @details This macro get wakeup flag. - * \hideinitializer - */ -#define UUART_GET_WAKEUP_FLAG(uuart) ((uuart)->WKSTS & UUART_WKSTS_WKF_Msk ? 1: 0 ) - - -/** - * @brief Clear wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro clear wakeup flag. - * \hideinitializer - */ -#define UUART_CLR_WAKEUP_FLAG(uuart) ((uuart)->WKSTS = UUART_WKSTS_WKF_Msk) - - -/** - * @brief Enable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UUART_PDMA_ENABLE(uuart, u32FuncSel) ((uuart)->PDMACTL |= (u32FuncSel)) - - -/** - * @brief Disable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UUART_PDMA_DISABLE(uuart, u32FuncSel) ((uuart)->PDMACTL &= ~(u32FuncSel)) - - -/** - * @brief Trigger RX PDMA function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Set RXPDMAEN bit of UUART_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define UUART_TRIGGER_RX_PDMA(uuart) ((uuart)->PDMACTL |= UUART_PDMACTL_RXPDMAEN_Msk|UUART_PDMACTL_PDMAEN_Msk) - - -/** - * @brief Trigger TX PDMA function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Set TXPDMAEN bit of UUART_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define UUART_TRIGGER_TX_PDMA(uuart) ((uuart)->PDMACTL |= UUART_PDMACTL_TXPDMAEN_Msk|UUART_PDMACTL_PDMAEN_Msk) - - -/** - * @brief Disable RX PDMA transfer. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Clear RXPDMAEN bit of UUART_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define UUART_DISABLE_RX_PDMA(uuart) ( (uuart)->PDMACTL &= ~UUART_PDMACTL_RXPDMAEN_Msk ) - - -/** - * @brief Disable TX PDMA transfer. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Clear TXPDMAEN bit of UUART_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define UUART_DISABLE_TX_PDMA(uuart) ( (uuart)->PDMACTL &= ~UUART_PDMACTL_TXPDMAEN_Msk ) - - -void UUART_ClearIntFlag(UUART_T* uuart, uint32_t u32Mask); -uint32_t UUART_GetIntFlag(UUART_T* uuart, uint32_t u32Mask); -void UUART_Close(UUART_T* uuart); -void UUART_DisableInt(UUART_T* uuart, uint32_t u32Mask); -void UUART_EnableInt(UUART_T* uuart, uint32_t u32Mask); -uint32_t UUART_Open(UUART_T* uuart, uint32_t u32baudrate); -uint32_t UUART_Read(UUART_T* uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t UUART_SetLine_Config(UUART_T* uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -uint32_t UUART_Write(UUART_T* uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); -void UUART_EnableWakeup(UUART_T* uuart, uint32_t u32WakeupMode); -void UUART_DisableWakeup(UUART_T* uuart); -void UUART_EnableFlowCtrl(UUART_T* uuart); -void UUART_DisableFlowCtrl(UUART_T* uuart); - - -/*@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_UART_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wdt.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wdt.h deleted file mode 100644 index 90e4c78c7ba..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wdt.h +++ /dev/null @@ -1,220 +0,0 @@ -/**************************************************************************//** - * @file nu_wdt.h - * @version V3.00 - * $Revision: 6 $ - * $Date: 18/06/08 11:34a $ - * @brief M031 series Watchdog Timer(WDT) driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WDT_H__ -#define __NU_WDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_CONSTANTS WDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Time-out Interval Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_TIMEOUT_2POW4 (0UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^4 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW6 (1UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^6 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW8 (2UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^8 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW10 (3UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^10 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW12 (4UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^12 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW14 (5UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^14 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW16 (6UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^16 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW18 (7UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^18 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW20 (8UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^20 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Reset Delay Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_DELAY_1026CLK (0UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 1026 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_130CLK (1UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 130 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_18CLK (2UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 18 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_3CLK (3UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 3 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Free Reset Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_COUNTER_KEYWORD (0x00005AA5UL) /*!< Fill this value to WDT_RSTCNT register to free reset WDT counter \hideinitializer */ - -/*@}*/ /* end of group WDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Clear WDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out reset system flag. - * \hideinitializer - */ -#define WDT_CLEAR_RESET_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_RSTF_Msk) - -/** - * @brief Clear WDT Time-out Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out interrupt flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_INT_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_IF_Msk) - -/** - * @brief Clear WDT Wake-up Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out wake-up system flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk)) | WDT_CTL_WKF_Msk) - -/** - * @brief Get WDT Time-out Reset Flag - * - * @param None - * - * @retval 0 WDT time-out reset system did not occur - * @retval 1 WDT time-out reset system occurred - * - * @details This macro indicates system has been reset by WDT time-out reset or not. - * \hideinitializer - */ -#define WDT_GET_RESET_FLAG() ((WDT->CTL & WDT_CTL_RSTF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Interrupt Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt did not occur - * @retval 1 WDT time-out interrupt occurred - * - * @details This macro indicates WDT time-out interrupt occurred or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_INT_FLAG() ((WDT->CTL & WDT_CTL_IF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Wake-up Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt does not cause CPU wake-up - * @retval 1 WDT time-out interrupt event cause CPU wake-up - * - * @details This macro indicates WDT time-out interrupt event has waked up system or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_WAKEUP_FLAG() ((WDT->CTL & WDT_CTL_WKF_Msk)? 1UL : 0UL) - -/** - * @brief Reset WDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reset the internal 18-bit WDT up counter value. - * @note If WDT is activated and time-out reset system function is enabled also, user should \n - * reset the 18-bit WDT up counter value to avoid generate WDT time-out reset signal to \n - * reset system before the WDT time-out reset delay period expires. - * \hideinitializer - */ -#define WDT_RESET_COUNTER() (WDT->RSTCNT = WDT_RESET_COUNTER_KEYWORD) - -__STATIC_INLINE void WDT_Close(void); -__STATIC_INLINE void WDT_EnableInt(void); -__STATIC_INLINE void WDT_DisableInt(void); -/** - * @brief Stop WDT Counting - * - * @param None - * - * @return None - * - * @details This function will stop WDT counting and disable WDT module. - */ -__STATIC_INLINE void WDT_Close(void) -{ - WDT->CTL = 0UL; - while(WDT->CTL & WDT_CTL_SYNC_Msk); // Wait disable WDTEN bit completed, it needs 2 * WDT_CLK. - return; -} - -/** - * @brief Enable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will enable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_EnableInt(void) -{ - WDT->CTL |= WDT_CTL_INTEN_Msk; - while(WDT->CTL & WDT_CTL_SYNC_Msk); // Wait enable WDTEN bit completed, it needs 2 * WDT_CLK. - return; -} - -/** - * @brief Disable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will disable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_DisableInt(void) -{ - /* Do not touch another write 1 clear bits */ - WDT->CTL &= ~(WDT_CTL_INTEN_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk); - return; -} - -void WDT_Open(uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup); - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_WDT_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wwdt.h b/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wwdt.h deleted file mode 100644 index 6c61a556959..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/inc/nu_wwdt.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************//** - * @file nu_wwdt.h - * @version V3.00 - * $Revision: 5 $ - * $Date: 18/06/07 9:48a $ - * @brief M031 series Window Watchdog Timet(WWDT) driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WWDT_H__ -#define __NU_WWDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_CONSTANTS WWDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Prescale Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_PRESCALER_1 (0 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2 (1 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_4 (2 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 4 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_8 (3 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 8 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_16 (4 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 16 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_32 (5 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 32 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_64 (6 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 64 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_128 (7 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 128 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_192 (8 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 192 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_256 (9 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 256 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_384 (10 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 384 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_512 (11 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 512 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_768 (12 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 768 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1024 (13 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1024 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1536 (14 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1536 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2048 (15 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2048 * (64*WWDT_CLK) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Reload Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_RELOAD_WORD (0x00005AA5) /*!< Fill this value to WWDT_RLDCNT register to reload WWDT counter \hideinitializer */ - -/*@}*/ /* end of group WWDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Clear WWDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT time-out reset system flag. - * \hideinitializer - */ -#define WWDT_CLEAR_RESET_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTRF_Msk) - -/** - * @brief Clear WWDT Compared Match Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT compared match interrupt flag. - * \hideinitializer - */ -#define WWDT_CLEAR_INT_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTIF_Msk) - -/** - * @brief Get WWDT Reset System Flag - * - * @param None - * - * @retval 0 WWDT time-out reset system did not occur - * @retval 1 WWDT time-out reset system occurred - * - * @details This macro is used to indicate system has been reset by WWDT time-out reset or not. - * \hideinitializer - */ -#define WWDT_GET_RESET_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTRF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Compared Match Interrupt Flag - * - * @param None - * - * @retval 0 WWDT compare match interrupt did not occur - * @retval 1 WWDT compare match interrupt occurred - * - * @details This macro is used to indicate WWDT counter value matches CMPDAT value or not. - * \hideinitializer - */ -#define WWDT_GET_INT_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTIF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Counter - * - * @param None - * - * @return WWDT Counter Value - * - * @details This macro reflects the current WWDT counter value. - * \hideinitializer - */ -#define WWDT_GET_COUNTER() (WWDT->CNT) - -/** - * @brief Reload WWDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reload the WWDT counter value to 0x3F. - * @note User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value \n - * between 0 and CMPDAT value. If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, \n - * WWDT reset signal will generate immediately to reset system. - * \hideinitializer - */ -#define WWDT_RELOAD_COUNTER() (WWDT->RLDCNT = WWDT_RELOAD_WORD) - -void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt); - -/*@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WWDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_WWDT_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewd b/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewd deleted file mode 100644 index 243a7f2ba53..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewd +++ /dev/null @@ -1,2966 +0,0 @@ - - - 3 - - Release - - ARM - - 0 - - C-SPY - 2 - - 30 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 1 - 1 - 0 - - - - - - - - CADI_ID - 2 - - 0 - 1 - 0 - - - - - - - - - CMSISDAP_ID - 2 - - 4 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GDBSERVER_ID - 2 - - 0 - 1 - 0 - - - - - - - - - - - IJET_ID - 2 - - 8 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JLINK_ID - 2 - - 16 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 2 - 1 - 0 - - - - - - - - - - NULINK_ID - 2 - - 0 - 1 - 0 - - - - - - - PEMICRO_ID - 2 - - 3 - 1 - 0 - - - - - - - - STLINK_ID - 2 - - 6 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 0 - - - - - - - - TIFET_ID - 2 - - 1 - 1 - 0 - - - - - - - - - - - - - - - - - - - XDS100_ID - 2 - - 8 - 1 - 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\FreeRtos\FreeRtosArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\HWRTOSplugin\HWRTOSplugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin2.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8BE.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\TargetAccessServer\TargetAccessServer.ENU.ewplugin - 0 - - - $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin - 0 - - - - - Debug - - ARM - - 1 - - C-SPY - 2 - - 30 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 1 - 1 - 1 - - - - - - - - CADI_ID - 2 - - 0 - 1 - 1 - - - - - - - - - CMSISDAP_ID - 2 - - 4 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GDBSERVER_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - IJET_ID - 2 - - 8 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JLINK_ID - 2 - - 16 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 2 - 1 - 1 - - - - - - - - - - NULINK_ID - 2 - - 0 - 1 - 1 - - - - - - - PEMICRO_ID - 2 - - 3 - 1 - 1 - - - - - - - - STLINK_ID - 2 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - TIFET_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - - - XDS100_ID - 2 - - 8 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $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\FreeRtos\FreeRtosArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\HWRTOSplugin\HWRTOSplugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin2.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8BE.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\TargetAccessServer\TargetAccessServer.ENU.ewplugin - 0 - - - $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin - 0 - - - - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewp b/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewp deleted file mode 100644 index 53e51392c1d..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.ewp +++ /dev/null @@ -1,2152 +0,0 @@ - - - 3 - - Release - - ARM - - 0 - - General - 3 - - 31 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 35 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 10 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 0 - - - - - - - - - CUSTOM - 3 - - - - 0 - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 22 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 0 - - - - - - - BILINK - 0 - - - - - Debug - - ARM - - 1 - - General - 3 - - 31 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 35 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 10 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 1 - - - - - - - - - CUSTOM - 3 - - - - 0 - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 22 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - src - - $PROJ_DIR$\..\src\nu_acmp.c - - - $PROJ_DIR$\..\src\nu_adc.c - - - $PROJ_DIR$\..\src\nu_bpwm.c - - - $PROJ_DIR$\..\src\nu_clk.c - - - $PROJ_DIR$\..\src\nu_crc.c - - - $PROJ_DIR$\..\src\nu_ebi.c - - - $PROJ_DIR$\..\src\nu_fmc.c - - - $PROJ_DIR$\..\src\nu_gpio.c - - - $PROJ_DIR$\..\src\nu_i2c.c - - - $PROJ_DIR$\..\src\nu_pdma.c - - - $PROJ_DIR$\..\src\nu_pwm.c - - - $PROJ_DIR$\..\src\nu_qspi.c - - - $PROJ_DIR$\..\src\nu_rtc.c - - - $PROJ_DIR$\..\src\nu_spi.c - - - $PROJ_DIR$\..\src\nu_sys.c - - - $PROJ_DIR$\..\src\nu_timer.c - - - $PROJ_DIR$\..\src\nu_uart.c - - - $PROJ_DIR$\..\src\nu_usbd.c - - - $PROJ_DIR$\..\src\nu_usci_i2c.c - - - $PROJ_DIR$\..\src\nu_usci_spi.c - - - $PROJ_DIR$\..\src\nu_usci_uart.c - - - $PROJ_DIR$\..\src\nu_wdt.c - - - $PROJ_DIR$\..\src\nu_wwdt.c - - - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.eww b/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.eww deleted file mode 100644 index fcdfcdfe308..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.eww +++ /dev/null @@ -1,10 +0,0 @@ - - - - - $WS_DIR$\libStdDriver.ewp - - - - - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.uvprojx b/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.uvprojx deleted file mode 100644 index 4bd7f3545a4..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/lib/libStdDriver.uvprojx +++ /dev/null @@ -1,513 +0,0 @@ - - - - 2.1 - -
### uVision Project, (C) Keil Software
- - - - libstddriver-m031 - 0x4 - ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC - 5060750::V5.06 update 6 (build 750)::ARMCC - 0 - - - M032KIAAE - Nuvoton - Nuvoton.NuMicro_DFP.1.3.10 - http://www.nuvoton.com/hq/enu/Documents/KEILSoftwarePack - IRAM(0x20000000,0x18000) IROM(0x00000000,0x80000) CPUTYPE("Cortex-M0") CLOCK(12000000) - - - UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M031_AP_512 -FS00 -FL080000 -FP0($$Device:M032KIAAE$Flash\M031_AP_512.FLM)) - 0 - $$Device:M032KIAAE$Device\M031\Include\M031Series.h - - - - - - - - - - $$Device:M032KIAAE$SVD\Nuvoton\M031AE_v1.svd - 0 - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - .\build\keil5\ - libstddriver_keil - 0 - 1 - 1 - 1 - 1 - .\build\keil5\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 1 - 0 - xcopy /y ".\build\keil5\@L.lib" "." - - 0 - 0 - 0 - 0 - - 1 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - 1 - - - SARMCM3.DLL - - DARMCM1.DLL - -pCM0 - SARMCM3.DLL - - TARMCM1.DLL - -pCM0 - - - - 1 - 0 - 0 - 0 - 16 - - - - - 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-M0" - - 0 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 8 - 1 - 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 - 0x20000000 - 0x18000 - - - 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 - 0x20000000 - 0x18000 - - - 0 - 0x0 - 0x0 - - - - - - 1 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 2 - 0 - 0 - 0 - 0 - 0 - 5 - 3 - 0 - 0 - 0 - 1 - 0 - - - - - ..\inc;..\..\CMSIS\Include;..\..\Device\Nuvoton\M031\Include;. - - - - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - 0 - 1 - 0 - 0x00000000 - 0x20000000 - - - - - - - - - - - - - src - - - nu_acmp.c - 1 - ..\src\nu_acmp.c - - - nu_adc.c - 1 - ..\src\nu_adc.c - - - nu_bpwm.c - 1 - ..\src\nu_bpwm.c - - - nu_clk.c - 1 - ..\src\nu_clk.c - - - nu_crc.c - 1 - ..\src\nu_crc.c - - - nu_ebi.c - 1 - ..\src\nu_ebi.c - - - nu_fmc.c - 1 - ..\src\nu_fmc.c - - - nu_gpio.c - 1 - ..\src\nu_gpio.c - - - nu_i2c.c - 1 - ..\src\nu_i2c.c - - - nu_pdma.c - 1 - ..\src\nu_pdma.c - - - nu_pwm.c - 1 - ..\src\nu_pwm.c - - - nu_qspi.c - 1 - ..\src\nu_qspi.c - - - nu_rtc.c - 1 - ..\src\nu_rtc.c - - - nu_spi.c - 1 - ..\src\nu_spi.c - - - nu_sys.c - 1 - ..\src\nu_sys.c - - - nu_timer.c - 1 - ..\src\nu_timer.c - - - nu_uart.c - 1 - ..\src\nu_uart.c - - - nu_usbd.c - 1 - ..\src\nu_usbd.c - - - nu_usci_i2c.c - 1 - ..\src\nu_usci_i2c.c - - - nu_usci_spi.c - 1 - ..\src\nu_usci_spi.c - - - nu_usci_uart.c - 1 - ..\src\nu_usci_uart.c - - - nu_wdt.c - 1 - ..\src\nu_wdt.c - - - nu_wwdt.c - 1 - ..\src\nu_wwdt.c - - - - - - - - - - - - - -
diff --git a/bsp/nuvoton/libraries/m031/StdDriver/lib/nutool_clkcfg.h b/bsp/nuvoton/libraries/m031/StdDriver/lib/nutool_clkcfg.h deleted file mode 100644 index 3a712eee979..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/lib/nutool_clkcfg.h +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** - * @file nutool_clkcfg.h - * @version V1.05 - * @Date 2020/09/15-18:09:27 - * @brief NuMicro generated code file - * - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (C) 2013-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NUTOOL_CLKCFG_H__ -#define __NUTOOL_CLKCFG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif -#undef __HXT -#define __HXT (32000000UL) /*!< High Speed External Crystal Clock Frequency */ - -#ifdef __cplusplus -} -#endif -#endif /*__NUTOOL_CLKCFG_H__*/ - -/*** (C) COPYRIGHT 2013-2020 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_acmp.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_acmp.c deleted file mode 100644 index 9568bbed07c..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_acmp.c +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************//** - * @file acmp.c - * @version V3.00 - * $Revision: 3 $ - * $Date: 18/03/16 11:13a $ - * @brief M031 Series Analog Comparator(ACMP) Driver Source File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "M031Series.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - - -/** - * @brief Configure the specified ACMP module - * - * @param[in] Acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * @param[in] u32NegSrc Comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * @param[in] u32HysteresisEn The hysteresis function option. Including: - * - \ref ACMP_CTL_HYSTERESIS_ENABLE - * - \ref ACMP_CTL_HYSTERESIS_DISABLE - * - * @return None - * - * @details Configure hysteresis function, select the source of negative input and enable analog comparator. - */ -void ACMP_Open(ACMP_T *Acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysteresisEn) -{ - Acmp->CTL[u32ChNum] = (Acmp->CTL[u32ChNum] & (~(ACMP_CTL_NEGSEL_Msk | ACMP_CTL_HYSEN_Msk))) | (u32NegSrc | u32HysteresisEn | ACMP_CTL_ACMPEN_Msk); -} - -/** - * @brief Close analog comparator - * - * @param[in] Acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * - * @return None - * - * @details This function will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - */ -void ACMP_Close(ACMP_T *Acmp, uint32_t u32ChNum) -{ - Acmp->CTL[u32ChNum] &= (~ACMP_CTL_ACMPEN_Msk); -} - - - -/*@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ACMP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_adc.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_adc.c deleted file mode 100644 index 508589cec87..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_adc.c +++ /dev/null @@ -1,200 +0,0 @@ -/**************************************************************************//** - * @file adc.c - * @version V3.00 - * $Revision: 7 $ - * $Date: 18/07/24 2:17p $ - * @brief M031 Series ADC Driver Source File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ADC_Driver ADC Driver - @{ -*/ - -/** @addtogroup ADC_EXPORTED_FUNCTIONS ADC Exported Functions - @{ -*/ - -/** - * @brief This API configures ADC module to be ready for convert the input from selected channel - * @param[in] adc The pointer of the specified ADC module - * @param[in] u32InputMode Decides the ADC analog input mode. Valid values are: - * - \ref ADC_ADCR_DIFFEN_SINGLE_END :Single-end input mode - * - \ref ADC_ADCR_DIFFEN_DIFFERENTIAL :Differential input mode - * @param[in] u32OpMode Decides the ADC operation mode. Valid values are: - * - \ref ADC_ADCR_ADMD_SINGLE :Single mode. - * - \ref ADC_ADCR_ADMD_BURST :Burst mode. - * - \ref ADC_ADCR_ADMD_SINGLE_CYCLE :Single cycle scan mode. - * - \ref ADC_ADCR_ADMD_CONTINUOUS :Continuous scan mode. - * @param[in] u32ChMask Channel enable bit. Each bit corresponds to a input channel. Bit 0 is channel 0, bit 1 is channel 1..., bit 15 is channel 15. - * @return None - * @note M031 series MCU ADC can only convert 1 channel at a time. If more than 1 channels are enabled, only channel - * with smallest number will be convert. - * @note This API does not turn on ADC power nor does trigger ADC conversion. - * @note This API will reset and calibrate ADC if ADC never be calibrated after chip power on. - */ -void ADC_Open(ADC_T *adc, - uint32_t u32InputMode, - uint32_t u32OpMode, - uint32_t u32ChMask) -{ - /* Do calibration for ADC to decrease the effect of electrical random noise. */ - if ((adc->ADCALSTSR & ADC_ADCALSTSR_CALIF_Msk) == 0) - { - /* Must reset ADC before ADC calibration */ - adc->ADCR |= ADC_ADCR_RESET_Msk; - while((adc->ADCR & ADC_ADCR_RESET_Msk) == ADC_ADCR_RESET_Msk); - - adc->ADCALSTSR |= ADC_ADCALSTSR_CALIF_Msk; /* Clear Calibration Finish Interrupt Flag */ - adc->ADCALR |= ADC_ADCALR_CALEN_Msk; /* Enable Calibration function */ - ADC_START_CONV(adc); /* Start to calibration */ - while((adc->ADCALSTSR & ADC_ADCALSTSR_CALIF_Msk) != ADC_ADCALSTSR_CALIF_Msk); /* Wait calibration finish */ - } - - adc->ADCR = (adc->ADCR & (~(ADC_ADCR_DIFFEN_Msk | ADC_ADCR_ADMD_Msk))) | \ - (u32InputMode) | \ - (u32OpMode); - - adc->ADCHER = (adc->ADCHER & ~ADC_ADCHER_CHEN_Msk) | (u32ChMask); - - return; -} - -/** - * @brief Disable ADC module - * @param[in] adc The pointer of the specified ADC module - * @return None - */ -void ADC_Close(ADC_T *adc) -{ - SYS->IPRST1 |= SYS_IPRST1_ADCRST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_ADCRST_Msk; - return; -} - -/** - * @brief Configure the hardware trigger condition and enable hardware trigger - * @param[in] adc The pointer of the specified ADC module - * @param[in] u32Source Decides the hardware trigger source. Valid values are: - * - \ref ADC_ADCR_TRGS_STADC :A/D conversion is started by external STADC pin. - * - \ref ADC_ADCR_TRGS_TIMER :A/D conversion is started by Timer. - * - \ref ADC_ADCR_TRGS_PWM :A/D conversion is started by PWM. - * @param[in] u32Param While ADC trigger by PWM or Timer, this parameter is unused. - * While ADC trigger by external pin, this parameter is used to set trigger condition. - * Valid values are: - * - \ref ADC_ADCR_TRGCOND_LOW_LEVEL :STADC Low level active - * - \ref ADC_ADCR_TRGCOND_HIGH_LEVEL :STADC High level active - * - \ref ADC_ADCR_TRGCOND_FALLING_EDGE :STADC Falling edge active - * - \ref ADC_ADCR_TRGCOND_RISING_EDGE :STADC Rising edge active - * @return None - * @note Software should disable TRGEN (ADCR[8]) and ADST (ADCR[11]) before change TRGS(ADCR[5:4]). - */ -void ADC_EnableHWTrigger(ADC_T *adc, - uint32_t u32Source, - uint32_t u32Param) -{ - if(u32Source == ADC_ADCR_TRGS_STADC) - { - adc->ADCR = (adc->ADCR & ~(ADC_ADCR_TRGS_Msk | ADC_ADCR_TRGCOND_Msk | ADC_ADCR_TRGEN_Msk)) | - ((u32Source) | (u32Param) | ADC_ADCR_TRGEN_Msk); - } - else if(u32Source == ADC_ADCR_TRGS_TIMER) - { - adc->ADCR = (adc->ADCR & ~(ADC_ADCR_TRGS_Msk | ADC_ADCR_TRGCOND_Msk | ADC_ADCR_TRGEN_Msk)) | - ((u32Source) | ADC_ADCR_TRGEN_Msk); - } - else - { - adc->ADCR = (adc->ADCR & ~(ADC_ADCR_TRGS_Msk | ADC_ADCR_TRGCOND_Msk | ADC_ADCR_TRGEN_Msk)) | - ((u32Source) | ADC_ADCR_TRGEN_Msk); - } - return; -} - -/** - * @brief Disable hardware trigger ADC function. - * @param[in] adc The pointer of the specified ADC module - * @return None - */ -void ADC_DisableHWTrigger(ADC_T *adc) -{ - adc->ADCR &= ~(ADC_ADCR_TRGS_Msk | ADC_ADCR_TRGCOND_Msk | ADC_ADCR_TRGEN_Msk); - return; -} - -/** - * @brief Enable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc The pointer of the specified ADC module - * @param[in] u32Mask The combination of interrupt status bits listed below. Each bit - * corresponds to a interrupt status. This parameter decides which - * interrupts will be enabled. - * - \ref ADC_ADF_INT :ADC convert complete interrupt - * - \ref ADC_CMP0_INT :ADC comparator 0 interrupt - * - \ref ADC_CMP1_INT :ADC comparator 1 interrupt - * @return None - */ -void ADC_EnableInt(ADC_T *adc, uint32_t u32Mask) -{ - if((u32Mask) & ADC_ADF_INT) - adc->ADCR |= ADC_ADCR_ADIE_Msk; - if((u32Mask) & ADC_CMP0_INT) - adc->ADCMPR[0] |= ADC_ADCMPR_CMPIE_Msk; - if((u32Mask) & ADC_CMP1_INT) - adc->ADCMPR[1] |= ADC_ADCMPR_CMPIE_Msk; - - return; -} - -/** - * @brief Disable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc The pointer of the specified ADC module - * @param[in] u32Mask The combination of interrupt status bits listed below. Each bit - * corresponds to a interrupt status. This parameter decides which - * interrupts will be disabled. - * - \ref ADC_ADF_INT :ADC convert complete interrupt - * - \ref ADC_CMP0_INT :ADC comparator 0 interrupt - * - \ref ADC_CMP1_INT :ADC comparator 1 interrupt - * @return None - */ -void ADC_DisableInt(ADC_T *adc, uint32_t u32Mask) -{ - if((u32Mask) & ADC_ADF_INT) - adc->ADCR &= ~ADC_ADCR_ADIE_Msk; - if((u32Mask) & ADC_CMP0_INT) - adc->ADCMPR[0] &= ~ADC_ADCMPR_CMPIE_Msk; - if((u32Mask) & ADC_CMP1_INT) - adc->ADCMPR[1] &= ~ADC_ADCMPR_CMPIE_Msk; - - return; -} - -/** - * @brief Set ADC extend sample time. - * @param[in] adc The pointer of the specified ADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are 0. - * @param[in] u32ExtendSampleTime Decides the extend sampling time, the range is from 0~255 ADC clock. Valid value are from 0 to 0xFF. - * @return None - * @details When A/D converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, - * user can extend A/D sampling time after trigger source is coming to get enough sampling time. - */ -void ADC_SetExtendSampleTime(ADC_T *adc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime) -{ - adc->ESMPCTL = (adc->ESMPCTL & ~ADC_ESMPCTL_EXTSMPT_Msk) | - (u32ExtendSampleTime << ADC_ESMPCTL_EXTSMPT_Pos); -} - -/*@}*/ /* end of group ADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_bpwm.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_bpwm.c deleted file mode 100644 index 3e27ebb9153..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_bpwm.c +++ /dev/null @@ -1,751 +0,0 @@ -/**************************************************************************//** - * @file bpwm.c - * @version V1.00 - * $Revision: 4 $ - * $Date: 18/04/24 3:49p $ - * @brief M031 series BPWM driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - - -/** @addtogroup BPWM_EXPORTED_FUNCTIONS BPWM Exported Functions - @{ -*/ - -/** - * @brief Configure BPWM capture and get the nearest unit time. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure BPWM capture and get the nearest unit time. - */ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32Src; - uint32_t u32BPWMClockSrc; - uint32_t u32NearestUnitTimeNsec; - uint16_t u16Prescale = 1UL, u16CNR = 0xFFFFUL; - uint8_t u8BreakLoop = 0UL; - - if (bpwm == BPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk; - } - else /* (bpwm == BPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk; - } - - if (u32Src == 0UL) - { - //clock source is from PLL clock - u32BPWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - //clock source is from PCLK - SystemCoreClockUpdate(); - - if (bpwm == BPWM0) - { - u32BPWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (bpwm == BPWM1) */ - { - u32BPWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - u32BPWMClockSrc /= 1000UL; - - for (u16Prescale = 1UL; u16Prescale <= 0x1000UL; u16Prescale++) - { - u32NearestUnitTimeNsec = (1000000UL * u16Prescale) / u32BPWMClockSrc; - - if (u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if (u16Prescale == 0x1000UL) - { - /* limit to the maximum unit time(nano second) */ - u8BreakLoop = 1UL; - } - - if (!((1000000UL * (u16Prescale + 1UL) > (u32NearestUnitTimeNsec * u32BPWMClockSrc)))) - { - u8BreakLoop = 1UL; - } - } - else - { - u8BreakLoop = 1UL; - } - - if (u8BreakLoop) - { - break; - } - } - - // convert to real register value - u16Prescale = u16Prescale - 1UL; - // all channels share a prescaler - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, (uint32_t)u16Prescale); - - // set BPWM to down count type(edge aligned) - (bpwm)->CTL1 = BPWM_DOWN_COUNTER; - - BPWM_SET_CNR(bpwm, u32ChannelNum, u16CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure BPWM generator and get the nearest frequency in edge aligned(down countertype) auto-reload mode - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since all channels shares a prescaler. Call this API to configure BPWM frequency may affect - * existing frequency of other channel. - */ -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32Src; - uint32_t u32BPWMClockSrc; - uint32_t i; - uint16_t u16Prescale = 1UL, u16CNR = 0xFFFFUL; - - if (bpwm == BPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk; - } - else /* (bpwm == BPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk; - } - - if (u32Src == 0UL) - { - //clock source is from PLL clock - u32BPWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - //clock source is from PCLK - SystemCoreClockUpdate(); - - if (bpwm == BPWM0) - { - u32BPWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (bpwm == BPWM1) */ - { - u32BPWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - for (u16Prescale = 1UL; u16Prescale < 0xFFFUL; u16Prescale++) //prescale could be 0~0xFFF - { - i = (u32BPWMClockSrc / u32Frequency) / u16Prescale; - - // If target value is larger than CNR, need to use a larger prescaler - if (i <= (0x10000UL)) - { - u16CNR = (uint16_t)i; - break; - } - } - - // Store return value here 'cos we're gonna change u16Prescale & u16CNR to the real value to fill into register - i = u32BPWMClockSrc / ((uint32_t)u16Prescale * (uint32_t)u16CNR); - - // convert to real register value - u16Prescale = u16Prescale - 1UL; - // all channels share a prescaler - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, (uint32_t)u16Prescale); - // set BPWM to down count type - (bpwm)->CTL1 = BPWM_DOWN_COUNTER; - - u16CNR = u16CNR - 1UL; - BPWM_SET_CNR(bpwm, u32ChannelNum, u16CNR); - - if (u32DutyCycle) - { - if (u32DutyCycle >= 100UL) - BPWM_SET_CMR(bpwm, u32ChannelNum, u16CNR); - else - BPWM_SET_CMR(bpwm, u32ChannelNum, u32DutyCycle * (u16CNR + 1UL) / 100UL); - - (bpwm)->WGCTL0 &= ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1UL)); - (bpwm)->WGCTL0 |= (BPWM_OUTPUT_LOW << ((u32ChannelNum << 1UL) + BPWM_WGCTL0_PRDPCTL0_Pos)); - (bpwm)->WGCTL1 &= ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1UL)); - (bpwm)->WGCTL1 |= (BPWM_OUTPUT_HIGH << ((u32ChannelNum << 1UL) + BPWM_WGCTL1_CMPDCTL0_Pos)); - } - else - { - BPWM_SET_CMR(bpwm, u32ChannelNum, 0UL); - (bpwm)->WGCTL0 &= ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1UL)); - (bpwm)->WGCTL0 |= (BPWM_OUTPUT_LOW << ((u32ChannelNum << 1UL) + BPWM_WGCTL0_ZPCTL0_Pos)); - (bpwm)->WGCTL1 &= ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1UL)); - (bpwm)->WGCTL1 |= (BPWM_OUTPUT_HIGH << ((u32ChannelNum << 1UL) + BPWM_WGCTL1_CMPDCTL0_Pos)); - } - - return (i); -} - -/** - * @brief Start BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to start BPWM module. - * @note All channels share one counter. - */ -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CNTEN = BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Stop BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM module. - * @note All channels share one period. - */ -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->PERIOD = 0UL; -} - -/** - * @brief Stop BPWM generation immediately by clear channel enable bit - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM generation immediately by clear channel enable bit. - * @note All channels share one counter. - */ -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CNTEN &= ~BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_OR_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_DOWN_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable selected channel to trigger ADC - */ -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if (u32ChannelNum < 4UL) - { - (bpwm)->EADCTS0 &= ~((BPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3UL)); - (bpwm)->EADCTS0 |= ((BPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3UL)); - } - else - { - (bpwm)->EADCTS1 &= ~((BPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4UL) << 3UL)); - (bpwm)->EADCTS1 |= ((BPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4UL) << 3UL)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger ADC - */ -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - if (u32ChannelNum < 4UL) - { - (bpwm)->EADCTS0 &= ~(BPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3UL)); - } - else - { - (bpwm)->EADCTS1 &= ~(BPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4UL) << 3UL)); - } -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag - */ -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (bpwm)->STATUS = (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get BPWM trigger ADC to start of conversion flag for specified channel - */ -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->STATUS & (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s) - */ -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN |= u32ChannelMask; - (bpwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s) - */ -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN &= ~u32ChannelMask; - (bpwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enables BPWM output generation of selected channel(s) - */ -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disables BPWM output generation of selected channel(s) - */ -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((((bpwm)->CAPIF & (BPWM_CAPIF_CAPFIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1UL) | \ - (((bpwm)->CAPIF & (BPWM_CAPIF_CAPRIF0_Msk << u32ChannelNum)) ? 1UL : 0UL)); -} -/** - * @brief Enable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref BPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (bpwm)->INTEN |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel - */ -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN &= ~((uint32_t)(BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | BPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel - */ -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = (BPWM_INTSTS_CMPUIF0_Msk | BPWM_INTSTS_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel - */ -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return ((((bpwm)->INTSTS & ((BPWM_INTSTS_CMPDIF0_Msk | BPWM_INTSTS_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (bpwm)->INTEN |= BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN &= ~BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = BPWM_INTSTS_PIF0_Msk; -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->INTSTS & BPWM_INTSTS_PIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to enable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN |= BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN &= ~BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = BPWM_INTSTS_ZIF0_Msk; -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return zero interrupt flag of specified channel - * @retval 0 zero interrupt did not occur - * @retval 1 zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->INTSTS & BPWM_INTSTS_ZIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode BPWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode BPWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Set BPWM clock source - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32ClkSrcSel BPWM external clock source. - * - \ref BPWM_CLKSRC_BPWM_CLK - * - \ref BPWM_CLKSRC_TIMER0 - * - \ref BPWM_CLKSRC_TIMER1 - * - \ref BPWM_CLKSRC_TIMER2 - * - \ref BPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set BPWM clock source. - * @note All channels share channel 0's setting. - */ -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (bpwm)->CLKSRC = (u32ClkSrcSel); -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->STATUS & BPWM_STATUS_CNTMAX0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->STATUS = BPWM_STATUS_CNTMAX0_Msk; -} - - -/*@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_clk.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_clk.c deleted file mode 100644 index 25c05190827..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_clk.c +++ /dev/null @@ -1,836 +0,0 @@ -/**************************************************************************//** - * @file clk.c - * @version V3.00 - * $Revision: 6 $ - * $Date: 18/07/05 4:42p $ - * @brief M031 Series Clock Controller (CLK) Driver Source File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - -/** - * @brief Disable frequency output function - * @param None - * @return None - * @details This function disable frequency output function. - */ -void CLK_DisableCKO(void) -{ - /* Disable CKO clock source */ - CLK->APBCLK0 &= (~CLK_APBCLK0_CLKOCKEN_Msk); -} - -/** - * @brief This function enable frequency output function and - * configure frequency clock source and divider. - * @param[in] u32ClkSrc is frequency output function clock source. Including : - * - \ref CLK_CLKSEL1_CLKOSEL_HXT - * - \ref CLK_CLKSEL1_CLKOSEL_LXT - * - \ref CLK_CLKSEL1_CLKOSEL_HCLK - * - \ref CLK_CLKSEL1_CLKOSEL_HIRC - * - \ref CLK_CLKSEL1_CLKOSEL_LIRC - * - \ref CLK_CLKSEL1_CLKOSEL_PLL - * - \ref CLK_CLKSEL1_CLKOSEL_SOF - * @param[in] u32ClkDiv is divider selection for output frequency. - * @param[in] u32ClkDivBy1En is frequency divided by one enable. - * @return None - * - * @details Output selected clock to CKO. The output clock frequency is divided by u32ClkDiv. - * The formula is: - * CKO frequency = (Clock source frequency) / 2^(u32ClkDiv + 1) - * This function is just used to set CKO clock. - * User must enable I/O for CKO clock output pin by themselves. - */ -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) -{ - /* CKO = clock source / 2^(u32ClkDiv + 1) */ - CLK->CLKOCTL = CLK_CLKOCTL_CLKOEN_Msk | u32ClkDiv | (u32ClkDivBy1En << CLK_CLKOCTL_DIV1EN_Pos); - - /* Enable CKO clock source */ - CLK->APBCLK0 |= CLK_APBCLK0_CLKOCKEN_Msk; - - /* Select CKO clock source */ - CLK->CLKSEL1 = (CLK->CLKSEL1 & (~CLK_CLKSEL1_CLKOSEL_Msk)) | (u32ClkSrc); -} - -/** - * @brief Enter to Power-down mode - * @param None - * @return None - * @details This function is used to let system enter to Power-down mode. \n - * The register write-protection function should be disabled before using this function. - * @note Must be care of HIRC/MIRC auto trim is disabled when using this function. - */ -void CLK_PowerDown(void) -{ - volatile uint32_t u32SysTickTICKINT = 0; /* Backup Systick interrupt enable bit */ - - /* Check HIRC/MIRC auto trim function disable */ - if(SYS->HIRCTRIMCTL & SYS_HIRCTRIMCTL_FREQSEL_Msk) - { - return; - } - - /* Set the processor uses deep sleep as its low power mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* Set system Power-down enabled */ - CLK->PWRCTL |= CLK_PWRCTL_PDEN_Msk; - - /* Backup systick interrupt setting */ - u32SysTickTICKINT = SysTick->CTRL & SysTick_CTRL_TICKINT_Msk; - - /* Disable systick interrupt */ - SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; - - /* Chip enter Power-down mode after CPU run WFI instruction */ - __WFI(); - - /* Restore systick interrupt setting */ - if(u32SysTickTICKINT) SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; -} - -/** - * @brief Enter to Idle mode - * @param None - * @return None - * @details This function let system enter to Idle mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_Idle(void) -{ - /* Set the processor uses sleep as its low power mode */ - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - - /* Set chip in idle mode because of WFI command */ - CLK->PWRCTL &= ~CLK_PWRCTL_PDEN_Msk; - - /* Chip enter idle mode after CPU run WFI instruction */ - __WFI(); -} - -/** - * @brief Get external high speed crystal clock frequency - * @param None - * @return External high frequency crystal frequency - * @details This function get external high frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetHXTFreq(void) -{ - if(CLK->PWRCTL & CLK_PWRCTL_HXTEN_Msk) - return __HXT; - else - return 0; -} - -/** - * @brief Get external low speed crystal clock frequency - * @param None - * @return External low speed crystal clock frequency - * @details This function get external low frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetLXTFreq(void) -{ - if(CLK->PWRCTL & CLK_PWRCTL_LXTEN_Msk) - return __LXT; - else - return 0; -} - -/** - * @brief Get PCLK0 frequency - * @param None - * @return PCLK0 frequency - * @details This function get PCLK0 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPCLK0Freq(void) -{ - uint32_t PCLK0Div; - - SystemCoreClockUpdate(); - PCLK0Div = (CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) >> CLK_PCLKDIV_APB0DIV_Pos; - return (SystemCoreClock >> PCLK0Div); -} - -/** - * @brief Get PCLK1 frequency - * @param None - * @return PCLK1 frequency - * @details This function get PCLK1 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPCLK1Freq(void) -{ - uint32_t PCLK1Div; - - SystemCoreClockUpdate(); - PCLK1Div = (CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) >> CLK_PCLKDIV_APB1DIV_Pos; - return (SystemCoreClock >> PCLK1Div); -} - -/** - * @brief Get HCLK frequency - * @param None - * @return HCLK frequency - * @details This function get HCLK frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetHCLKFreq(void) -{ - SystemCoreClockUpdate(); - return SystemCoreClock; -} - -/** - * @brief Get CPU frequency - * @param None - * @return CPU frequency - * @details This function get CPU frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetCPUFreq(void) -{ - SystemCoreClockUpdate(); - return SystemCoreClock; -} - -/** - * @brief Set HCLK frequency - * @param[in] u32Hclk is HCLK frequency. The range of u32Hclk is 25.5MHz ~ 48MHz. -* NOTE: For M031_G/I, the HCLK frequency up to 72MHz. - * @return HCLK frequency - * @details This function is used to set HCLK frequency. The frequency unit is Hz. \n - * It would configure PLL frequency to 51MHz ~ 96MHz, - * set HCLK clock divider as 2 and switch HCLK clock source to PLL. \n - * The register write-protection function should be disabled before using this function. - * NOTE: For M031_G/I, the PLL frequency up to 144MHz. - */ -uint32_t CLK_SetCoreClock(uint32_t u32Hclk) -{ - uint32_t u32HIRCSTB; - uint32_t u32HCLK_UpperLimit; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* The range of u32Hclk is 25.5 MHz ~ 48 MHz or 72 MHz */ - if ((GET_CHIP_SERIES_NUM == CHIP_SERIES_NUM_G) || (GET_CHIP_SERIES_NUM == CHIP_SERIES_NUM_I)) - u32HCLK_UpperLimit = FREQ_72MHZ; - else - u32HCLK_UpperLimit = FREQ_48MHZ; - - if(u32Hclk > u32HCLK_UpperLimit) - u32Hclk = u32HCLK_UpperLimit; - if(u32Hclk < (FREQ_51MHZ >> 1)) - u32Hclk = (FREQ_51MHZ >> 1); - - /* Switch HCLK clock source to HIRC clock for safe */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_Msk; - CLK->CLKDIV0 &= (~CLK_CLKDIV0_HCLKDIV_Msk); - - /* Configure PLL setting if HXT clock is stable */ - if(CLK->STATUS & CLK_STATUS_HXTSTB_Msk) - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HXT, (u32Hclk << 1)); - - /* Configure PLL setting if HXT clock is not stable */ - else - { - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HIRC_DIV4, (u32Hclk << 1)); - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - } - - /* Select HCLK clock source to PLL, - Select HCLK clock source divider as 2 - and update system core clock - */ - CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_PLL, CLK_CLKDIV0_HCLK(2)); - - /* Disable HIRC if HIRC is disabled before setting core clock */ - if(u32HIRCSTB == 0) - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; - - /* Return actually HCLK frequency is PLL frequency divide 2 */ - return u32Hclk >> 1; -} - -/** - * @brief Set HCLK clock source and HCLK clock divider - * @param[in] u32ClkSrc is HCLK clock source. Including : - * - \ref CLK_CLKSEL0_HCLKSEL_HXT - * - \ref CLK_CLKSEL0_HCLKSEL_LXT - * - \ref CLK_CLKSEL0_HCLKSEL_PLL - * - \ref CLK_CLKSEL0_HCLKSEL_LIRC - * - \ref CLK_CLKSEL0_HCLKSEL_HIRC - * @param[in] u32ClkDiv is HCLK clock divider. Including : - * - \ref CLK_CLKDIV0_HCLK(x) - * @return None - * @details This function set HCLK clock source and HCLK clock divider. The HCLK clock divider is set by CLK_CLKDIV0_HCLK(x) where x = 1~16. - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32HIRCSTB; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* Switch to HIRC for Safe. Avoid HCLK too high when applying new divider. */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & (~CLK_CLKSEL0_HCLKSEL_Msk)) | CLK_CLKSEL0_HCLKSEL_HIRC; - - /* Apply new Divider */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & (~CLK_CLKDIV0_HCLKDIV_Msk)) | u32ClkDiv; - - /* Switch HCLK to new HCLK source */ - CLK->CLKSEL0 = (CLK->CLKSEL0 & (~CLK_CLKSEL0_HCLKSEL_Msk)) | u32ClkSrc; - - /* Update System Core Clock */ - SystemCoreClockUpdate(); - - /* Disable HIRC if HIRC is disabled before switching HCLK source */ - if(u32HIRCSTB == 0) - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; -} - -/** - * @brief This function set selected module clock source and module clock divider - * @param[in] u32ModuleIdx is module index. - * @param[in] u32ClkSrc is module clock source. - * @param[in] u32ClkDiv is module clock divider. - * @return None - * @details Valid parameter combinations listed in following table: - * - * |Module index |Clock source |Divider | - * | :---------------- | :----------------------------------- | :----------------------- | - * |\ref USBD_MODULE |\ref CLK_CLKSEL0_USBDSEL_HIRC |\ref CLK_CLKDIV0_USB(x) | - * |\ref USBD_MODULE |\ref CLK_CLKSEL0_USBDSEL_PLL |\ref CLK_CLKDIV0_USB(x) | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LXT | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_HCLK_DIV2048 | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LIRC | x | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_HCLK_DIV2048 | x | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_LIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_LXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HCLK | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_LIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_PLL | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_SOF | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_PCLK0 | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_EXT_TRG | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LIRC | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_PCLK0 | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_EXT_TRG | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_PCLK1 | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_EXT_TRG | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_PCLK1 | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_EXT_TRG | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HIRC | x | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_HXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_PLL |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_LXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_HIRC |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_PCLK0 |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_LIRC |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_HXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_PLL |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_LXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_HIRC |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_PCLK1 |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_LIRC |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_HXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_PLL |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_LXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_HIRC |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_PCLK0 |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_LIRC |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_HXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_PLL |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_LXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_HIRC |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_PCLK1 |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_LIRC |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_PLL |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_LXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HIRC |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_PCLK0 |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_LIRC |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_PLL |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_LXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HIRC |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_PCLK1 |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_LIRC |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_HXT |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_PLL |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_LXT |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_HIRC |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_PCLK0 |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_LIRC |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_HXT |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_PLL |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_LXT |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_HIRC |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_PCLK1 |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_LIRC |\ref CLK_CLKDIV4_UART7(x) | - * |\ref PWM0_MODULE |\ref CLK_CLKSEL2_PWM0SEL_PLL | x | - * |\ref PWM0_MODULE |\ref CLK_CLKSEL2_PWM0SEL_PCLK0 | x | - * |\ref PWM1_MODULE |\ref CLK_CLKSEL2_PWM1SEL_PLL | x | - * |\ref PWM1_MODULE |\ref CLK_CLKSEL2_PWM1SEL_PCLK1 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HXT | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PLL | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PCLK0 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HIRC | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HXT | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PLL | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PCLK1 | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HIRC | x | - * |\ref BPWM0_MODULE |\ref CLK_CLKSEL2_BPWM0SEL_PLL | x | - * |\ref BPWM0_MODULE |\ref CLK_CLKSEL2_BPWM0SEL_PCLK0 | x | - * |\ref BPWM1_MODULE |\ref CLK_CLKSEL2_BPWM1SEL_PLL | x | - * |\ref BPWM1_MODULE |\ref CLK_CLKSEL2_BPWM1SEL_PCLK1 | x | - * |\ref ADC_MODULE |\ref CLK_CLKSEL2_ADCSEL_HXT |\ref CLK_CLKDIV0_ADC(x) | - * |\ref ADC_MODULE |\ref CLK_CLKSEL2_ADCSEL_PLL |\ref CLK_CLKDIV0_ADC(x) | - * |\ref ADC_MODULE |\ref CLK_CLKSEL2_ADCSEL_PCLK1 |\ref CLK_CLKDIV0_ADC(x) | - * |\ref ADC_MODULE |\ref CLK_CLKSEL2_ADCSEL_HIRC |\ref CLK_CLKDIV0_ADC(x) | - */ -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32sel = 0, u32div = 0; - uint32_t u32SelTbl[4] = {0x0, 0x4, 0x8, 0xC}; /* CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3 */ - uint32_t u32DivTbl[4] = {0x0, 0x0, 0x0, 0x10}; /* CLKDIV offset on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV3, 0x3:CLKDIV4 */ - - if(MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock divider control register address */ - u32div = (uint32_t)&CLK->CLKDIV0 + (u32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); - /* Apply new divider */ - M32(u32div) = (M32(u32div) & (~(MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx)))) | u32ClkDiv; - } - - if(MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32sel = (uint32_t)&CLK->CLKSEL0 + (u32SelTbl[MODULE_CLKSEL(u32ModuleIdx)]); - /* Set new clock selection setting */ - M32(u32sel) = (M32(u32sel) & (~(MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx)))) | u32ClkSrc; - } -} - -/** - * @brief Set SysTick clock source - * @param[in] u32ClkSrc is module clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * @return None - * @details This function set SysTick clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc) -{ - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; -} - -/** - * @brief Enable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * @return None - * @details This function enable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL |= u32ClkMask; -} - -/** - * @brief Disable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * @return None - * @details This function disable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL &= ~u32ClkMask; -} - -/** - * @brief This function enable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref HDIV_MODULE - * - \ref CRC_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref CLKO_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref QSPI0_MODULE - * - \ref SPI0_MODULE - * - \ref ADC_MODULE - * - \ref ACMP01_MODULE - * - \ref USBD_MODULE - * - \ref PWM0_MODULE - * - \ref PWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref USCI0_MODULE - * - \ref USCI1_MODULE - * @return None - * @details This function enable module clock. - */ -void CLK_EnableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32ClkTbl[3] = {0x0, 0x4, 0x8}; /* AHBCLK/APBCLK offset on MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 */ - - *(volatile uint32_t *)((uint32_t)&CLK->AHBCLK + (u32ClkTbl[MODULE_APBCLK(u32ModuleIdx)])) |= 1 << MODULE_IP_EN_Pos(u32ModuleIdx); -} - -/** - * @brief This function disable module clock - * @param[in] u32ModuleIdx is module index - * - \ref PDMA_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref HDIV_MODULE - * - \ref CRC_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref CLKO_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref QSPI0_MODULE - * - \ref SPI0_MODULE - * - \ref ADC_MODULE - * - \ref ACMP01_MODULE - * - \ref USBD_MODULE - * - \ref PWM0_MODULE - * - \ref PWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref USCI0_MODULE - * - \ref USCI1_MODULE - * @return None - * @details This function disable module clock. - */ -void CLK_DisableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32ClkTbl[3] = {0x0, 0x4, 0x8}; /* AHBCLK/APBCLK offset on MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 */ - - *(volatile uint32_t *)((uint32_t)&CLK->AHBCLK + (u32ClkTbl[MODULE_APBCLK(u32ModuleIdx)])) &= ~(1 << MODULE_IP_EN_Pos(u32ModuleIdx)); -} - -/** - * @brief Set PLL frequency - * @param[in] u32PllClkSrc is PLL clock source. Including : - * - \ref CLK_PLLCTL_PLLSRC_HXT - * - \ref CLK_PLLCTL_PLLSRC_HIRC_DIV4 - * @param[in] u32PllFreq is PLL frequency. The frequency unit is Hz. - * @return Actual PLL frequency - * @details This function is used to configure PLLCTL register to set specified PLL frequency. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq) -{ - uint32_t u32PllSrcClk, u32NR, u32NF, u32NO, u32CLK_SRC, u32Outdiv; - uint32_t u32Tmp, u32Tmp2, u32Tmp3, u32Min, u32MinNF, u32MinNR; - uint32_t u32PLL_UpperLimit; - - /* Disable PLL first to avoid unstable when setting PLL */ - CLK_DisablePLL(); - - /* PLL source clock is from HXT */ - if(u32PllClkSrc == CLK_PLLCTL_PLLSRC_HXT) - { - /* Enable HXT clock */ - CLK->PWRCTL |= CLK_PWRCTL_HXTEN_Msk; - - /* Wait for HXT clock ready */ - CLK_WaitClockReady(CLK_STATUS_HXTSTB_Msk); - - /* Select PLL source clock from HXT */ - u32CLK_SRC = CLK_PLLCTL_PLLSRC_HXT; - u32PllSrcClk = __HXT; - - /* u32NR start from 2 since NR = INDIV + 2 */ - u32NR = 2; - } - - /* PLL source clock is from HIRC/4 */ - else - { - /* Enable HIRC clock */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - - /* Wait for HIRC clock ready */ - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - - /* Select PLL source clock from HIRC */ - u32CLK_SRC = CLK_PLLCTL_PLLSRC_HIRC_DIV4; - u32PllSrcClk = __HIRC >> 2; - - /* u32NR start from 2 since NR = INDIV + 2 */ - u32NR = 2; - } - - /* Select "NO" according to request frequency */ - /* Constraint: PLL output frequency must <= 96MHz */ - /* PLL output frequency must > 50.14MHz to meet all constraints */ - if ((GET_CHIP_SERIES_NUM == CHIP_SERIES_NUM_G) || (GET_CHIP_SERIES_NUM == CHIP_SERIES_NUM_I)) - u32PLL_UpperLimit = FREQ_144MHZ; - else - u32PLL_UpperLimit = FREQ_96MHZ; - - if((u32PllFreq <= u32PLL_UpperLimit) && (u32PllFreq >= FREQ_51MHZ)) - { - if (u32PllFreq <= FREQ_96MHZ) - { - u32NO = 4; - u32Outdiv = 3; - u32PllFreq = u32PllFreq << 2; /* u32PllFreq = (FIN * NF / NR) now */ - } - else - { - u32NO = 2; - u32Outdiv = 2; - u32PllFreq = u32PllFreq << 1; /* u32PllFreq = (FIN * NF / NR) now */ - } - } - else - { - /* Wrong frequency request. Just return default setting. */ - goto lexit; - } - - /* Find best solution */ - u32Min = (uint32_t) 0xFFFFFFFF; /* initial u32Min to max value of uint32_t */ - u32MinNR = 0; - u32MinNF = 0; - for(; u32NR <= 33; u32NR++) /* max NR = 33 since NR = INDIV + 2 and INDIV = 0 ~ 31 */ - { - u32Tmp = u32PllSrcClk / u32NR; - /* Constraint 2: 800KHz < (FIN / (2*NR)) < 8MHz */ - if((u32Tmp > 1600000) && (u32Tmp < 16000000)) - { - for(u32NF = 2; u32NF <= 513; u32NF++) /* NF = 2~513 since NF = FBDIV + 2 and FBDIV = 0 ~ 511 */ - { - u32Tmp2 = u32Tmp * u32NF; - /* Constraint 3: 200MHz < (FIN * NF / NR) < 500MHz */ - if((u32Tmp2 >= 200000000) && (u32Tmp2 < 500000000)) - { - u32Tmp3 = (u32Tmp2 > u32PllFreq) ? u32Tmp2 - u32PllFreq : u32PllFreq - u32Tmp2; - if(u32Tmp3 < u32Min) - { - u32Min = u32Tmp3; - u32MinNR = u32NR; - u32MinNF = u32NF; - - /* Break when get good results */ - if(u32Min == 0) - break; - } - } - } - } - } - - /* Enable and apply new PLL setting. */ - CLK->PLLCTL = u32CLK_SRC | - (u32Outdiv << CLK_PLLCTL_OUTDIV_Pos) | - ((u32MinNR - 2) << CLK_PLLCTL_INDIV_Pos) | - ((u32MinNF - 2) << CLK_PLLCTL_FBDIV_Pos); - - /* Wait for PLL clock stable */ - CLK_WaitClockReady(CLK_STATUS_PLLSTB_Msk); - - /* Return actual PLL output clock frequency */ - return (u32PllSrcClk / (u32NO * u32MinNR) * u32MinNF); - -lexit: - - /* Apply default PLL setting and return */ - if(u32PllClkSrc == CLK_PLLCTL_PLLSRC_HXT) - CLK->PLLCTL = CLK_PLLCTL_96MHz_HXT; - else - CLK->PLLCTL = CLK_PLLCTL_96MHz_HIRC_DIV4; - - /* Wait for PLL clock stable */ - CLK_WaitClockReady(CLK_STATUS_PLLSTB_Msk); - - return CLK_GetPLLClockFreq(); -} - -/** - * @brief Disable PLL - * @param None - * @return None - * @details This function set PLL in Power-down mode. \n - * If the current HCLK is PLL, this function will switch HCLK to HIRC before disable PLL. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisablePLL(void) -{ - /* Switch HCLK to HIRC before disable PLL if current HCLK is PLL */ - if ((CLK->CLKSEL0 & CLK_CLKSEL0_HCLKSEL_Msk) == CLK_CLKSEL0_HCLKSEL_PLL) - { - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & (~CLK_CLKSEL0_HCLKSEL_Msk)) | CLK_CLKSEL0_HCLKSEL_HIRC; - } - - CLK->PLLCTL |= CLK_PLLCTL_PD_Msk; -} - -/** - * @brief This function check selected clock source status - * @param[in] u32ClkMask is selected clock source. Including : - * - \ref CLK_STATUS_HXTSTB_Msk - * - \ref CLK_STATUS_LXTSTB_Msk - * - \ref CLK_STATUS_HIRCSTB_Msk - * - \ref CLK_STATUS_LIRCSTB_Msk - * - \ref CLK_STATUS_PLLSTB_Msk - * @retval 0 clock is not stable - * @retval 1 clock is stable - * @details To wait for clock ready by specified clock source stable flag or timeout (~300ms) - */ -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask) -{ - int32_t i32TimeOutCnt = 2160000; - - while((CLK->STATUS & u32ClkMask) != u32ClkMask) - { - if(i32TimeOutCnt-- <= 0) - return 0; - } - - return 1; -} - -/** - * @brief Enable System Tick counter - * @param[in] u32ClkSrc is System Tick clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK - * @param[in] u32Count is System Tick reload value. It could be 0~0xFFFFFF. - * @return None - * @details This function set System Tick clock source, reload value, enable System Tick counter and interrupt. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0; - - /* Set System Tick clock source */ - if(u32ClkSrc == CLK_CLKSEL0_STCLKSEL_HCLK) - SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk; - else - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; - - /* Set System Tick reload value */ - SysTick->LOAD = u32Count; - - /* Clear System Tick current value and counter flag */ - SysTick->VAL = 0; - - /* Set System Tick interrupt enabled and counter enabled */ - SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk; -} - -/** - * @brief Disable System Tick counter - * @param None - * @return None - * @details This function disable System Tick counter. - */ -void CLK_DisableSysTick(void) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0; -} - - - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_crc.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_crc.c deleted file mode 100644 index ddda689cbf1..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_crc.c +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************//** - * @file crc.c - * @version V3.00 - * $Revision: 4 $ - * $Date: 18/04/24 3:49p $ - * @brief M031 series Cyclic Redundancy Check(CRC) driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_FUNCTIONS CRC Exported Functions - @{ -*/ - -/** - * @brief CRC Open - * - * @param[in] u32Mode CRC operation polynomial mode. Valid values are: - * - \ref CRC_CCITT - * - \ref CRC_8 - * - \ref CRC_16 - * - \ref CRC_32 - * @param[in] u32Attribute CRC operation data attribute. Valid values are combined with: - * - \ref CRC_CHECKSUM_COM - * - \ref CRC_CHECKSUM_RVS - * - \ref CRC_WDATA_COM - * - \ref CRC_WDATA_RVS - * @param[in] u32Seed Seed value. - * @param[in] u32DataLen CPU Write Data Length. Valid values are: - * - \ref CRC_CPU_WDATA_8 - * - \ref CRC_CPU_WDATA_16 - * - \ref CRC_CPU_WDATA_32 - * - * @return None - * - * @details This function will enable the CRC controller by specify CRC operation mode, attribute, initial seed and write data length. \n - * After that, user can start to perform CRC calculate by calling CRC_WRITE_DATA macro or CRC_DAT register directly. - */ -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen) -{ - CRC->SEED = u32Seed; - CRC->CTL = u32Mode | u32Attribute | u32DataLen | CRC_CTL_CRCEN_Msk; - - /* Setting CRCRST bit will reload the initial seed value(CRC_SEED register) to CRC controller */ - CRC->CTL |= CRC_CTL_CHKSINIT_Msk; -} - -/** - * @brief Get CRC Checksum - * - * @param[in] None - * - * @return Checksum Result - * - * @details This macro gets the CRC checksum result by current CRC polynomial mode. - */ -uint32_t CRC_GetChecksum(void) -{ - uint32_t ret; - - switch(CRC->CTL & CRC_CTL_CRCMODE_Msk) - { - case CRC_CCITT: - case CRC_16: - ret = (CRC->CHECKSUM & 0xFFFFU); - break; - case CRC_32: - ret = (CRC->CHECKSUM); - break; - case CRC_8: - ret = (CRC->CHECKSUM & 0xFFU); - break; - default: - ret = 0U; - break; - } - - return ret; -} - -/*@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CRC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_ebi.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_ebi.c deleted file mode 100644 index 19ab6a6db17..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_ebi.c +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************//** - * @file ebi.c - * @version V1.00 - * $Revision: 5 $ - * $Date: 18/08/20 11:48a $ - * @brief M031 series External Bus Interface(EBI) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Initialize EBI for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * @param[in] u32DataWidth Data bus width. Valid values are: - * - \ref EBI_BUSWIDTH_8BIT - * - \ref EBI_BUSWIDTH_16BIT - * @param[in] u32TimingClass Default timing configuration. Valid values are: - * - \ref EBI_TIMING_FASTEST - * - \ref EBI_TIMING_VERYFAST - * - \ref EBI_TIMING_FAST - * - \ref EBI_TIMING_NORMAL - * - \ref EBI_TIMING_SLOW - * - \ref EBI_TIMING_VERYSLOW - * - \ref EBI_TIMING_SLOWEST - * @param[in] u32BusMode Set EBI bus operate mode. Valid values are: - * - \ref EBI_OPMODE_NORMAL - * - \ref EBI_OPMODE_CACCESS - * @param[in] u32CSActiveLevel CS is active High/Low. Valid values are: - * - \ref EBI_CS_ACTIVE_HIGH - * - \ref EBI_CS_ACTIVE_LOW - * - * @return None - * - * @details This function is used to open specify EBI bank with different bus width, timing setting and \n - * active level of CS pin to access EBI device. - * @note Write Buffer Enable(WBUFEN) and Extend Time Of ALE(TALE) are only available in EBI bank0 control register. - */ -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel) -{ - volatile uint32_t *pu32EBICTL = (uint32_t *)((uint32_t)&EBI->CTL0 + (u32Bank * 0x10)); - volatile uint32_t *pu32EBITCTL = (uint32_t *)((uint32_t)&EBI->TCTL0 + (u32Bank * 0x10)); - - if(u32DataWidth == EBI_BUSWIDTH_8BIT) - *pu32EBICTL &= ~EBI_CTL_DW16_Msk; - else - *pu32EBICTL |= EBI_CTL_DW16_Msk; - - *pu32EBICTL |= u32BusMode; - - switch (u32TimingClass) - { - case EBI_TIMING_FASTEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_VERYFAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_FAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_NORMAL: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_SLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_VERYSLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_4 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_SLOWEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_8 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - default: - *pu32EBICTL &= ~EBI_CTL_EN_Msk; - break; - } -} - -/** - * @brief Disable EBI on specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - * @return None - * - * @details This function is used to close specify EBI function. - */ -void EBI_Close(uint32_t u32Bank) -{ - volatile uint32_t *pu32EBICTL = (uint32_t *)((uint32_t)&EBI->CTL0 + (u32Bank * 0x10U)); - - *pu32EBICTL &= ~EBI_CTL_EN_Msk; -} - -/** - * @brief Set EBI Bus Timing for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * @param[in] u32TimingConfig Configure EBI timing settings, includes TACC, TAHD, W2X and R2R setting. - * @param[in] u32MclkDiv Divider for MCLK. Valid values are: - * - \ref EBI_MCLKDIV_1 - * - \ref EBI_MCLKDIV_2 - * - \ref EBI_MCLKDIV_4 - * - \ref EBI_MCLKDIV_8 - * - \ref EBI_MCLKDIV_16 - * - \ref EBI_MCLKDIV_32 - * - * @return None - * - * @details This function is used to configure specify EBI bus timing for access EBI device. - */ -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv) -{ - volatile uint32_t *pu32EBICTL = (uint32_t *)((uint32_t)&EBI->CTL0 + (u32Bank * 0x10U)); - volatile uint32_t *pu32EBITCTL = (uint32_t *)((uint32_t)&EBI->TCTL0 + (u32Bank * 0x10U)); - - *pu32EBICTL = (*pu32EBICTL & ~EBI_CTL_MCLKDIV_Msk) | (u32MclkDiv << EBI_CTL_MCLKDIV_Pos); - *pu32EBITCTL = u32TimingConfig; -} - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_fmc.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_fmc.c deleted file mode 100644 index a5a1149a7a4..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_fmc.c +++ /dev/null @@ -1,572 +0,0 @@ -/**************************************************************************//** - * @file fmc.c - * @version V1.00 - * $Revision: 3 $ - * $Date: 18/04/24 3:05p $ - * @brief M031 series FMC driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include - -#include "NuMicro.h" - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - - -/** - * @brief Disable FMC ISP function. - * @return None - */ -void FMC_Close(void) -{ - FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk; -} - - -/** - * @brief Execute FMC_ISPCMD_PAGE_ERASE command to erase a flash page. The page size is 4096 bytes. - * @param[in] u32PageAddr Address of the flash page to be erased. - * It must be a 4096 bytes aligned address. - * @return ISP page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - */ -int32_t FMC_Erase(uint32_t u32PageAddr) -{ - int32_t ret = 0; - - if (u32PageAddr == FMC_SPROM_BASE) - { - ret = FMC_Erase_SPROM(); - } - else - { - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = u32PageAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - } - return ret; -} - -/** - * @brief Execute Flash Bank erase - * - * @param[in] u32BankAddr Base address of the flash bank to be erased. - * - * @return ISP bank erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * - * @details Execute FMC_ISPCMD_BANK_ERASE command to erase a flash bank. - */ -int32_t FMC_Erase_Bank(uint32_t u32BankAddr) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_BANK_ERASE; - FMC->ISPADDR = u32BankAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_PAGE_ERASE command to erase SPROM. The page size is 4096 bytes. - * @return SPROM page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - */ -int32_t FMC_Erase_SPROM(void) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = FMC_SPROM_BASE; - FMC->ISPDAT = 0x0055AA03UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_BANK_REMAP command to remap bank. - * @return Bank remap success or not. - * @retval 0 Success - * @retval -1 Erase failed - */ -int32_t FMC_RemapBank(uint32_t u32BankIdx) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_BANK_REMAP; - FMC->ISPADDR = u32BankIdx; - FMC->ISPDAT = 0x5AA55AA5UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Get the current boot source. - * @return The current boot source. - * @retval 0 Is boot from APROM. - * @retval 1 Is boot from LDROM. - */ -int32_t FMC_GetBootSource (void) -{ - int32_t ret = 0; - - if (FMC->ISPCTL & FMC_ISPCTL_BS_Msk) - { - ret = 1; - } - - return ret; -} - - -/** - * @brief Enable FMC ISP function - * @return None - */ -void FMC_Open(void) -{ - FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk; -} - - -/** - * @brief Execute FMC_ISPCMD_READ command to read a word from flash. - * @param[in] u32Addr Address of the flash location to be read. - * It must be a word aligned address. - * @return The word data read from specified flash address. - */ -uint32_t FMC_Read(uint32_t u32Addr) -{ - FMC->ISPCMD = FMC_ISPCMD_READ; - FMC->ISPADDR = u32Addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - return FMC->ISPDAT; -} - - -/** - * @brief Get the base address of Data Flash if enabled. - * @retval The base address of Data Flash - */ -uint32_t FMC_ReadDataFlashBaseAddr(void) -{ - return FMC->DFBA; -} - -/** - * @brief Set boot source from LDROM or APROM after next software reset - * @param[in] i32BootSrc - * 1: Boot from LDROM - * 0: Boot from APROM - * @return None - * @details This function is used to switch APROM boot or LDROM boot. User need to call - * FMC_SetBootSource to select boot source first, then use CPU reset or - * System Reset Request to reset system. - */ -void FMC_SetBootSource(int32_t i32BootSrc) -{ - if(i32BootSrc) - { - FMC->ISPCTL |= FMC_ISPCTL_BS_Msk; /* Boot from LDROM */ - } - else - { - FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk;/* Boot from APROM */ - } -} - -/** - * @brief Execute ISP FMC_ISPCMD_PROGRAM to program a word to flash. - * @param[in] u32Addr Address of the flash location to be programmed. - * It must be a word aligned address. - * @param[in] u32Data The word data to be programmed. - * @return None - */ -void FMC_Write(uint32_t u32Addr, uint32_t u32Data) -{ - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = u32Addr; - FMC->ISPDAT = u32Data; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } -} - -/** - * @brief Execute ISP FMC_ISPCMD_PROGRAM_64 to program a double-word to flash. - * @param[in] u32addr Address of the flash location to be programmed. - * It must be a double-word aligned address. - * @param[in] u32data0 The word data to be programmed to flash address u32addr. - * @param[in] u32data1 The word data to be programmed to flash address u32addr+4. - * @return 0 Success - * @return -1 Failed - */ -int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_PROGRAM_64; - FMC->ISPADDR = u32addr; - FMC->MPDAT0 = u32data0; - FMC->MPDAT1 = u32data1; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_READ command to read User Configuration. - * @param[out] u32Config A three-word array. - * u32Config[0] holds CONFIG0, while u32Config[1] holds CONFIG1. - * @param[in] u32Count Available word count in u32Config. - * @return Success or not. - * @retval 0 Success. - * @retval -1 Invalid parameter. - */ -int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count) -{ - int32_t ret = 0; - - u32Config[0] = FMC_Read(FMC_CONFIG_BASE); - - if (u32Count > 3UL) - { - ret = -1; - } - else - { - if(u32Count > 1UL) - { - u32Config[1] = FMC_Read(FMC_CONFIG_BASE+4UL); - } - if(u32Count > 2UL) - { - u32Config[2] = FMC_Read(FMC_CONFIG_BASE+8UL); - } - } - return ret; -} - -/** - * @brief Execute ISP commands to erase then write User Configuration. - * @param[in] u32Config A two-word array. - * u32Config[0] holds CONFIG0, while u32Config[1] holds CONFIG1. - * @param[in] u32Count Always be 2 in this BSP. - * @return Success or not. - * @retval 0 Success. - * @retval -1 Invalid parameter. - */ -int32_t FMC_WriteConfig(uint32_t u32Config[], uint32_t u32Count) -{ - int32_t ret = 0; - uint32_t i; - - for (i = 0u; i < u32Count; i++) - { - FMC_Write(FMC_CONFIG_BASE + i * 4u, u32Config[i]); - - if (FMC_Read(FMC_CONFIG_BASE + i * 4u) != u32Config[i]) - { - ret = -1; - } - } - - return ret; -} - -/** - * @brief Run CRC32 checksum calculation and get result. - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 512 bytes. - * @return Success or not. - * @retval 0 Success. - * @retval 0xFFFFFFFF Invalid parameter. - */ -uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret; - - if ((u32addr % 512UL) || (u32count % 512UL)) - { - ret = 0xFFFFFFFF; - } - else - { - FMC->ISPCMD = FMC_ISPCMD_RUN_CKS; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = u32count; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - FMC->ISPCMD = FMC_ISPCMD_READ_CKS; - FMC->ISPADDR = u32addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - ret = FMC->ISPDAT; - } - - return ret; -} - -/** - * @brief Run flash all one verification and get result. - * - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 512 bytes. - * - * @retval READ_ALLONE_YES The contents of verified flash area are 0xFFFFFFFF. - * @retval READ_ALLONE_NOT Some contents of verified flash area are not 0xFFFFFFFF. - * @retval READ_ALLONE_CMD_FAIL Unexpected error occurred. - * - * @details Run ISP check all one command to check specify area is all one or not. - */ -#define FMC_APROM_BANK1_BASE (0x40000) -#define FMC_CHECKALLONE_UNIT (512) -uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret = READ_ALLONE_CMD_FAIL; - - /** Workaround solution for M031 with 512KB Flash uses FMC Read command instead of FMC All-One-Verification command to - * check the Flash content from 0x40000 to 0x401FF. - */ - if(u32addr == FMC_APROM_BANK1_BASE) - { - uint32_t i; - u32count = u32count - FMC_CHECKALLONE_UNIT; - for(i = FMC_APROM_BANK1_BASE; i < (FMC_APROM_BANK1_BASE + FMC_CHECKALLONE_UNIT); i = i+4) - { - if( FMC_Read(i) != 0xFFFFFFFF) - return READ_ALLONE_NOT; - } - - if(u32count == 0) - return READ_ALLONE_YES; - else - u32addr = u32addr + FMC_CHECKALLONE_UNIT; - } - - FMC->ISPSTS = 0x80UL; /* clear check all one bit */ - - FMC->ISPCMD = FMC_ISPCMD_RUN_ALL1; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = u32count; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - do - { - FMC->ISPCMD = FMC_ISPCMD_READ_ALL1; - FMC->ISPADDR = u32addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - } - while (FMC->ISPDAT == 0UL); - - if (FMC->ISPDAT == READ_ALLONE_YES) - { - ret = FMC->ISPDAT; - } - - if (FMC->ISPDAT == READ_ALLONE_NOT) - { - ret = FMC->ISPDAT; - } - - return ret; -} - -/** - * @brief Write Multi-Word bytes to flash - * - * @param[in] u32Addr Start flash address in APROM where the data chunk to be programmed into. - * This address must be 8-bytes aligned to flash address. - * @param[in] pu32Buf Buffer that carry the data chunk. - * @param[in] u32Len Length of the data chunk in bytes. - * - * @retval >=0 Number of data bytes were programmed. - * @return -1 Invalid address. - * - * @detail Program Multi-Word data into specified address of flash. - */ -#if defined ( __CC_ARM ) -#pragma arm section code="fastcode" -int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len) - -#elif defined ( __ICCARM__ ) -int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len) @ "fastcode" - -#elif defined ( __GNUC__ ) -#pragma GCC push_options -#pragma GCC optimize ("O0") -__attribute__ ((used, long_call, section(".fastcode"))) int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len) - -#else -int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len) -#endif -{ - - uint32_t i, idx, u32OnProg, retval = 0; - int32_t err; - - if ((u32Addr % 8) != 0) - { - return -1; - } - - idx = 0u; - FMC->ISPCMD = FMC_ISPCMD_MULTI_PROG; - FMC->ISPADDR = u32Addr; - retval += 16; - do - { - err = 0; - u32OnProg = 1u; - FMC->MPDAT0 = pu32Buf[idx + 0u]; - FMC->MPDAT1 = pu32Buf[idx + 1u]; - FMC->MPDAT2 = pu32Buf[idx + 2u]; - FMC->MPDAT3 = pu32Buf[idx + 3u]; - FMC->ISPTRG = 0x1u; - idx += 4u; - - for (i = idx; i < (FMC_MULTI_WORD_PROG_LEN / 4u); i += 4u) /* Max data length is 256 bytes (512/4 words)*/ - { - __set_PRIMASK(1u); /* Mask interrupt to avoid status check coherence error*/ - do - { - if ((FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk) == 0u) - { - __set_PRIMASK(0u); - - FMC->ISPADDR = FMC->MPADDR & (~0xful); - idx = (FMC->ISPADDR - u32Addr) / 4u; - err = -1; - } - } - while ((FMC->MPSTS & (3u << FMC_MPSTS_D0_Pos)) && (err == 0)); - - if (err == 0) - { - retval += 8; - - /* Update new data for D0 */ - FMC->MPDAT0 = pu32Buf[i]; - FMC->MPDAT1 = pu32Buf[i + 1u]; - do - { - if ((FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk) == 0u) - { - __set_PRIMASK(0u); - FMC->ISPADDR = FMC->MPADDR & (~0xful); - idx = (FMC->ISPADDR - u32Addr) / 4u; - err = -1; - } - } - while ((FMC->MPSTS & (3u << FMC_MPSTS_D2_Pos)) && (err == 0)); - - if (err == 0) - { - retval += 8; - - /* Update new data for D2*/ - FMC->MPDAT2 = pu32Buf[i + 2u]; - FMC->MPDAT3 = pu32Buf[i + 3u]; - __set_PRIMASK(0u); - } - } - - if (err < 0) - { - break; - } - } - if (err == 0) - { - u32OnProg = 0u; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - } - } - while (u32OnProg); - return retval; -} -#if defined ( __CC_ARM ) -#pragma arm section - -#elif defined ( __GNUC__ ) -#pragma GCC pop_options - -#endif - -/*@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group FMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_gpio.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_gpio.c deleted file mode 100644 index e0644a56fc2..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_gpio.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************//** - * @file gpio.c - * @version V3.00 - * $Revision: 2 $ - * $Date: 18/03/28 5:52p $ - * @brief M031 Series General Purpose I/O (GPIO) Driver Source File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Set GPIO operation mode - * @param[in] port GPIO port. It could be PA, PB, PC, PD, or PF. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA and PB. - * It could be BIT0 ~ BIT7, and BIT14 for PC. - * It could be BIT0 ~ BIT3, and BIT15 for PD. - * It could be BIT0 ~ BIT6, BIT14, and BIT15 for PF. - * @param[in] u32Mode Operation mode. It could be - * - \ref GPIO_MODE_INPUT - * - \ref GPIO_MODE_OUTPUT - * - \ref GPIO_MODE_OPEN_DRAIN - * - \ref GPIO_MODE_QUASI - * @return None - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for(i = 0; i < GPIO_PIN_MAX; i++) - { - if(u32PinMask & (1 << i)) - { - port->MODE = (port->MODE & ~(GPIO_MODE_MODE0_Msk << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Enable GPIO interrupt - * @param[in] port GPIO port. It could be PA, PB, PC, PD, or PF. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA and PB. - * It could be 0 ~ 7, and 14 for PC. - * It could be 0 ~ 3, and 15 for PD. - * It could be 0 ~ 6, 14, and 15 for PF. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be - * - \ref GPIO_INT_RISING - * - \ref GPIO_INT_FALLING - * - \ref GPIO_INT_BOTH_EDGE - * - \ref GPIO_INT_HIGH - * - \ref GPIO_INT_LOW - * @return None - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs) -{ - /* Configure interrupt mode of specified pin */ - port->INTTYPE |= (((u32IntAttribs >> 24) & 0xFFUL) << u32Pin); - - /* Enable interrupt function of specified pin */ - port->INTEN |= ((u32IntAttribs & 0xFFFFFFUL) << u32Pin); -} - -/** - * @brief Disable GPIO interrupt - * @param[in] port GPIO port. It could be PA, PB, PC, PD, or PF. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA and PB. - * It could be 0 ~ 7, and 14 for PC. - * It could be 0 ~ 3, and 15 for PD. - * It could be 0 ~ 6, 14, and 15 for PF. - * @return None - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin) -{ - /* Configure interrupt mode of specified pin */ - port->INTTYPE &= ~(1UL << u32Pin); - - /* Disable interrupt function of specified pin */ - port->INTEN &= ~((0x00010001UL) << u32Pin); -} - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_i2c.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_i2c.c deleted file mode 100644 index e4f99a7769d..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_i2c.c +++ /dev/null @@ -1,1582 +0,0 @@ -/**************************************************************************//** - * @file i2c.c - * @version V1.00 - * @brief M031 series I2C driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ - -/** - * @brief Enable specify I2C Controller and set Clock Divider - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C bus clock in Hz - * - * @return Actual I2C bus clock frequency - * - * @details The function enable the specify I2C Controller and set proper Clock Divider - * in I2C CLOCK DIVIDED REGISTER (I2CLK) according to the target I2C Bus clock. - * I2C Bus clock = PCLK / (4*(divider+1). - * - */ -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if (i2c == I2C1) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - /* Enable I2C */ - i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Disable specify I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Reset I2C Controller and disable specify I2C port. - * - */ - -void I2C_Close(I2C_T *i2c) -{ - /* Reset I2C Controller */ - if (i2c == I2C0) - { - SYS->IPRST1 |= SYS_IPRST1_I2C0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C0RST_Msk; - } - else if (i2c == I2C1) - { - SYS->IPRST1 |= SYS_IPRST1_I2C1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C1RST_Msk; - } - - /* Disable I2C */ - i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; -} - -/** - * @brief Clear Time-out Counter flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When Time-out flag will be set, use this function to clear I2C Bus Time-out counter flag . - * - */ -void I2C_ClearTimeoutFlag(I2C_T *i2c) -{ - i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; -} - -/** - * @brief Set Control bit of I2C Controller - * - * @param[in] i2c Specify I2C port - * @param[in] u8Start Set I2C START condition - * @param[in] u8Stop Set I2C STOP condition - * @param[in] u8Si Clear SI flag - * @param[in] u8Ack Set I2C ACK bit - * - * @return None - * - * @details The function set I2C Control bit of I2C Bus protocol. - * - */ -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - - if (u8Start) - { - u32Reg |= I2C_CTL_STA; - } - - if (u8Stop) - { - u32Reg |= I2C_CTL_STO; - } - - if (u8Si) - { - u32Reg |= I2C_CTL_SI; - } - - if (u8Ack) - { - u32Reg |= I2C_CTL_AA; - } - - i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; -} - -/** - * @brief Disable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for disable I2C interrupt - * - */ -void I2C_DisableInt(I2C_T *i2c) -{ - i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Enable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for enable I2C interrupt - * - */ -void I2C_EnableInt(I2C_T *i2c) -{ - i2c->CTL0 |= I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Get I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * - * @return The actual I2C Bus clock in Hz - * - * @details To get the actual I2C Bus Clock frequency. - */ -uint32_t I2C_GetBusClockFreq(I2C_T *i2c) -{ - uint32_t u32Divider = i2c->CLKDIV; - uint32_t u32Pclk; - - if (i2c == I2C1) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - return (u32Pclk / ((u32Divider + 1U) << 2U)); -} - -/** - * @brief Set I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C Bus Clock in Hz - * - * @return The actual I2C Bus Clock in Hz - * - * @details To set the actual I2C Bus Clock frequency. - */ -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if (i2c == I2C1) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Get Interrupt Flag - * - * @param[in] i2c Specify I2C port - * - * @return I2C interrupt flag status - * - * @details To get I2C Bus interrupt flag. - */ -uint32_t I2C_GetIntFlag(I2C_T *i2c) -{ - return ((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk ? 1U : 0U); -} - -/** - * @brief Get I2C Bus Status Code - * - * @param[in] i2c Specify I2C port - * - * @return I2C Status Code - * - * @details To get I2C Bus Status Code. - */ -uint32_t I2C_GetStatus(I2C_T *i2c) -{ - return (i2c->STATUS0); -} - -/** - * @brief Read a Byte from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return I2C Data - * - * @details To read a bytes data from specify I2C port. - */ -uint8_t I2C_GetData(I2C_T *i2c) -{ - return (uint8_t)(i2c->DAT); -} - -/** - * @brief Send a byte to I2C Bus - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data The data to send to I2C bus - * - * @return None - * - * @details This function is used to write a byte to specified I2C port - */ -void I2C_SetData(I2C_T *i2c, uint8_t u8Data) -{ - i2c->DAT = u8Data; -} - -/** - * @brief Set 7-bit Slave Address and GC Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address register (0~3) - * @param[in] u8SlaveAddr 7-bit slave address - * @param[in] u8GCMode Enable/Disable GC mode (I2C_GCMODE_ENABLE / I2C_GCMODE_DISABLE) - * - * @return None - * - * @details This function is used to set 7-bit slave addresses in I2C SLAVE ADDRESS REGISTER (I2C_ADDR0~3) - * and enable GC Mode. - * - */ -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDR1 = ((uint32_t)u8SlaveAddr << 1U); - break; - - case 2: - i2c->ADDR2 = ((uint32_t)u8SlaveAddr << 1U); - break; - - case 3: - i2c->ADDR3 = ((uint32_t)u8SlaveAddr << 1U); - break; - - case 0: - default: - i2c->ADDR0 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - } -} - -/** - * @brief Configure the mask bits of 7-bit Slave Address - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address mask register (0~3) - * @param[in] u8SlaveAddrMask A byte for slave address mask - * - * @return None - * - * @details This function is used to set 7-bit slave addresses. - * - */ -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDRMSK1 = (uint32_t)u8SlaveAddrMask << 1U; - break; - - case 2: - i2c->ADDRMSK2 = (uint32_t)u8SlaveAddrMask << 1U; - break; - - case 3: - i2c->ADDRMSK3 = (uint32_t)u8SlaveAddrMask << 1U; - break; - - case 0: - default: - i2c->ADDRMSK0 = (uint32_t)u8SlaveAddrMask << 1U; - break; - } -} - -/** - * @brief Enable Time-out Counter Function and support Long Time-out - * - * @param[in] i2c Specify I2C port - * @param[in] u8LongTimeout Configure DIV4 to enable Long Time-out (0/1) - * - * @return None - * - * @details This function enable Time-out Counter function and configure DIV4 to support Long - * Time-out. - * - */ -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) -{ - if (u8LongTimeout) - { - i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; - } - else - { - i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; - } - - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Disable Time-out Counter Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Time-out Counter function in I2C_TOCTL register. - * - */ -void I2C_DisableTimeout(I2C_T *i2c) -{ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Enable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To enable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_EnableWakeup(I2C_T *i2c) -{ - i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_DisableWakeup(I2C_T *i2c) -{ - i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * - */ -uint32_t I2C_SMBusGetStatus(I2C_T *i2c) -{ - return (i2c->BUSSTS); -} - -/** - * @brief Clear SMBus Interrupt Flag - * - * @param[in] i2c Specify I2C port - * @param[in] u8SMBusIntFlag Specify SMBus interrupt flag - * - * @return None - * - * @details To clear flags of I2C_BUSSTS status register if interrupt set. - * - */ -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag) -{ - i2c->BUSSTS = u8SMBusIntFlag; -} - -/** - * @brief Set SMBus Bytes Counts of Transmission or Reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * - */ -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize) -{ - i2c->PKTSIZE = u32PktSize; -} - -/** - * @brief Init SMBus Host/Device Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8HostDevice Init SMBus port mode(I2C_SMBH_ENABLE/I2C_SMBD_ENABLE) - * - * @return None - * - * @details Using SMBus communication must specify the port is a Host or a Device. - * - */ -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice) -{ - /* Clear BMHEN, BMDEN of BUSCTL Register */ - i2c->BUSCTL &= ~(I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BMDEN_Msk); - - /* Set SMBus Host/Device Mode, and enable Bus Management*/ - if(u8HostDevice == (uint8_t)I2C_SMBH_ENABLE) - { - i2c->BUSCTL |= (I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } - else - { - i2c->BUSCTL |= (I2C_BUSCTL_BMDEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } -} - -/** - * @brief Disable SMBus function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable all SMBus function include Bus disable, CRC check, Acknowledge by manual, Host/Device Mode. - * - */ -void I2C_SMBusClose(I2C_T *i2c) -{ - - i2c->BUSCTL = 0x00U; -} - -/** - * @brief Enable SMBus PEC Transmit Function - * - * @param[in] i2c Specify I2C port - * @param[in] u8PECTxEn CRC transmit enable(PECTX_ENABLE) or disable(PECTX_DISABLE) - * - * @return None - * - * @details When enable CRC check function, the Host or Device needs to transmit CRC byte. - * - */ -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn) -{ - i2c->BUSCTL &= ~I2C_BUSCTL_PECTXEN_Msk; - - if(u8PECTxEn) - { - i2c->BUSCTL |= (I2C_BUSCTL_PECEN_Msk | I2C_BUSCTL_PECTXEN_Msk); - } - else - { - i2c->BUSCTL |= I2C_BUSCTL_PECEN_Msk; - } -} - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return A byte is packet error check value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * - */ -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c) -{ - return (uint8_t)i2c->PKTCRC; -} - -/** - * @brief Calculate Time-out of SMBus idle period - * - * @param[in] i2c Specify I2C port - * @param[in] us Time-out length(us) - * @param[in] u32Hclk I2C peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Idle state. - * - */ - -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk) -{ - uint32_t u32Div, u32Hclk_kHz; - - i2c->BUSCTL |= I2C_BUSCTL_TIDLE_Msk; - u32Hclk_kHz = u32Hclk / 1000U; - u32Div = (((us * u32Hclk_kHz) / 1000U) >> 2U) - 1U; - if(u32Div > 255U) - { - i2c->BUSTOUT = 0xFFU; - } - else - { - i2c->BUSTOUT = u32Div; - } - -} - -/** - * @brief Calculate Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in active state. - * Time-out length is calculate the SCL line "one clock" pull low timing. - * - */ - -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if(u32Div <= 0xFFU) - { - i2c->BUSTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->BUSTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - -/** - * @brief Calculate Cumulative Clock low Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Active state. - * Time-out length is calculate the SCL line "clocks" low cumulative timing. - * - */ - -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if(u32Div <= 0xFFU) - { - i2c->CLKTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->CLKTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - -/** - * @brief Write a byte to Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master write a byte data to Slave. - * - */ - -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - - I2C_START(i2c); - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data[] Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master write multi bytes data to Slave. - * - */ - -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - case 0x28: - if (u32txLen < u32wLen) - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - } - - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Send Slave address with write bit */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - if (u32txLen < 1U) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - } - - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data[] Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - if (u32txLen < u32wLen) - I2C_SET_DATA(i2c, data[u32txLen++]); - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - } - - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1; - break; - - case 0x28: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0U; - } - else if ((u32txLen < 1U) && (u8Addr == 0U)) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - } - - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] data[] A data array for write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify two bytes address that multi data write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0U; - } - else if ((u32txLen < u32wLen) && (u8Addr == 0U)) - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - } - - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master to read a byte data from Slave. - * - */ -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1U) | 0x01U)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x40: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x48: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x58: - rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} -/** - * @brief Read multi bytes from Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1U) | 0x01U)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x40: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - - case 0x48: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1; - break; - - case 0x50: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - - if (u32rxLen < (u32rLen - 1)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - - break; - - case 0x58: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - - case 0x10: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1U) | 0x01U)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x40: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x48: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x58: - rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - - case 0x10: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1U) | 0x01U)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x40: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - - case 0x48: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x50: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - - if (u32rxLen < (u32rLen - 1U)) - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - else - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - - break; - - case 0x58: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify an address(2 bytes) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Addr = 1U, u8Ctrl = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U));/* Write Hi byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0U; - } - else - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - - break; - - case 0x10: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1U) | 0x01U)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x40: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x48: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x58: - rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - - I2C_START(i2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - I2C_WAIT_READY(i2c) {} - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1U | 0x00U)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x18: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U));/* Write Hi byte address of register */ - break; - - case 0x20: /* Slave Address NACK */ - case 0x30: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x28: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0U; - } - else - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - - break; - - case 0x10: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1U) | 0x01U)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - - case 0x40: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - - case 0x48: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case 0x50: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - - if (u32rxLen < (u32rLen - 1U)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - - break; - - case 0x58: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0U; - break; - - case 0x38: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1U; - break; - } - - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_pdma.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_pdma.c deleted file mode 100644 index 0de6af94e5c..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_pdma.c +++ /dev/null @@ -1,379 +0,0 @@ -/**************************************************************************//** - * @file pdma.c - * @version V1.00 - * @brief M031 series PDMA driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - - -/** @addtogroup PDMA_EXPORTED_FUNCTIONS PDMA Exported Functions - @{ -*/ - -/** - * @brief PDMA Open - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable the PDMA channels. - */ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask) -{ - uint32_t i; - - for (i = 0UL; i < PDMA_CH_MAX; i++) - { - if ((1 << i) & u32Mask) - { - pdma->DSCT[i].CTL = 0UL; - } - } - - pdma->CHCTL |= u32Mask; -} - -/** - * @brief PDMA Close - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details This function disable all PDMA channels. - */ -void PDMA_Close(PDMA_T *pdma) -{ - pdma->CHCTL = 0UL; -} - -/** - * @brief Set PDMA Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Width Data width. Valid values are - * - \ref PDMA_WIDTH_8 - * - \ref PDMA_WIDTH_16 - * - \ref PDMA_WIDTH_32 - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected channel data width and transfer count. - */ -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXCNT_Msk | PDMA_DSCT_CTL_TXWIDTH_Msk); - pdma->DSCT[u32Ch].CTL |= (u32Width | ((u32TransCount - 1UL) << PDMA_DSCT_CTL_TXCNT_Pos)); -} - -/** - * @brief Set PDMA Transfer Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32SrcAddr Source address - * @param[in] u32SrcCtrl Source control attribute. Valid values are - * - \ref PDMA_SAR_INC - * - \ref PDMA_SAR_FIX - * @param[in] u32DstAddr Destination address - * @param[in] u32DstCtrl Destination control attribute. Valid values are - * - \ref PDMA_DAR_INC - * - \ref PDMA_DAR_FIX - * - * @return None - * - * @details This function set the selected channel source/destination address and attribute. - */ -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl) -{ - pdma->DSCT[u32Ch].SA = u32SrcAddr; - pdma->DSCT[u32Ch].DA = u32DstAddr; - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_SAINC_Msk | PDMA_DSCT_CTL_DAINC_Msk); - pdma->DSCT[u32Ch].CTL |= (u32SrcCtrl | u32DstCtrl); -} - -/** - * @brief Set PDMA Transfer Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Peripheral The selected peripheral. Valid values are - * - \ref PDMA_MEM - * - \ref PDMA_UART0_TX - * - \ref PDMA_UART0_RX - * - \ref PDMA_UART1_TX - * - \ref PDMA_UART1_RX - * - \ref PDMA_UART2_TX - * - \ref PDMA_UART2_RX - * - \ref PDMA_USCI0_TX - * - \ref PDMA_USCI0_RX - * - \ref PDMA_USCI1_TX - * - \ref PDMA_USCI1_RX - * - \ref PDMA_QSPI0_TX - * - \ref PDMA_QSPI0_RX - * - \ref PDMA_SPI0_TX - * - \ref PDMA_SPI0_RX - * - \ref PDMA_ADC_RX - * - \ref PDMA_PWM0_P1_RX - * - \ref PDMA_PWM0_P2_RX - * - \ref PDMA_PWM0_P3_RX - * - \ref PDMA_PWM1_P1_RX - * - \ref PDMA_PWM1_P2_RX - * - \ref PDMA_PWM1_P3_RX - * - \ref PDMA_I2C0_TX - * - \ref PDMA_I2C0_RX - * - \ref PDMA_I2C1_TX - * - \ref PDMA_I2C1_RX - * - \ref PDMA_TMR0 - * - \ref PDMA_TMR1 - * - \ref PDMA_TMR2 - * - \ref PDMA_TMR3 - * - \ref PDMA_UART3_TX - * - \ref PDMA_UART3_RX - * - \ref PDMA_UART4_TX - * - \ref PDMA_UART4_RX - * - \ref PDMA_UART5_TX - * - \ref PDMA_UART5_RX - * - \ref PDMA_UART6_TX - * - \ref PDMA_UART6_RX - * - \ref PDMA_UART7_TX - * - \ref PDMA_UART7_RX - * @param[in] u32ScatterEn Scatter-gather mode enable - * @param[in] u32DescAddr Scatter-gather descriptor address - * - * @return None - * - * @details This function set the selected channel transfer mode. Include peripheral setting. - */ -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - pau32REQSEL[u32Ch / 4] = (pau32REQSEL[u32Ch / 4] & ~u32REQSEL_Msk) | (u32Peripheral << u32REQSEL_Pos); - - if (u32ScatterEn) - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_SCATTER; - pdma->DSCT[u32Ch].NEXT = u32DescAddr - (pdma->SCATBA); - } - else - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_BASIC; - } - } - else {} -} - -/** - * @brief Set PDMA Burst Type and Size - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32BurstType Burst mode or single mode. Valid values are - * - \ref PDMA_REQ_SINGLE - * - \ref PDMA_REQ_BURST - * @param[in] u32BurstSize Set the size of burst mode. Valid values are - * - \ref PDMA_BURST_128 - * - \ref PDMA_BURST_64 - * - \ref PDMA_BURST_32 - * - \ref PDMA_BURST_16 - * - \ref PDMA_BURST_8 - * - \ref PDMA_BURST_4 - * - \ref PDMA_BURST_2 - * - \ref PDMA_BURST_1 - * - * @return None - * - * @details This function set the selected channel burst type and size. - */ -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXTYPE_Msk | PDMA_DSCT_CTL_BURSIZE_Msk); - pdma->DSCT[u32Ch].CTL |= (u32BurstType | u32BurstSize); -} - -/** - * @brief Enable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable timeout function of the selected channel(s). - */ -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN |= u32Mask; -} - -/** - * @brief Disable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function disable timeout function of the selected channel(s). - */ -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN &= ~u32Mask; -} - -/** - * @brief Set PDMA Timeout Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32OnOff Enable/disable time out function - * @param[in] u32TimeOutCnt Timeout count - * - * @return None - * - * @details This function set the timeout count. - * @note M031 only supported channel 0/1. - */ -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt) -{ - if (u32Ch < 2) - { - __IO uint32_t *pau32TOC = (__IO uint32_t *)&pdma->TOC0_1; - uint32_t u32TOC_Pos, u32TOC_Msk; - - u32TOC_Pos = (u32Ch % 2) * 16 ; - u32TOC_Msk = PDMA_TOC0_1_TOC0_Msk << u32TOC_Pos; - pau32TOC[u32Ch / 2] = (pau32TOC[u32Ch / 2] & ~u32TOC_Msk) | (u32TimeOutCnt << u32TOC_Pos); - - if (u32OnOff) - pdma->TOUTEN |= (1 << u32Ch); - else - pdma->TOUTEN &= ~(1 << u32Ch); - } - else {} -} - -/** - * @brief Trigger PDMA - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This function trigger the selected channel. - */ -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch) -{ - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk, u32ChReq; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - - u32ChReq = (pau32REQSEL[u32Ch / 4] & u32REQSEL_Msk) >> u32REQSEL_Pos; - - if (u32ChReq == PDMA_MEM) - { - pdma->SWREQ = (1ul << u32Ch); - } - else {} -} - -/** - * @brief Enable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function enable the selected channel interrupt. - */ -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN |= (1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL &= ~PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN |= (1ul << u32Ch); - break; - - default: - break; - } -} - -/** - * @brief Disable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function disable the selected channel interrupt. - */ -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN &= ~(1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN &= ~(1ul << u32Ch); - break; - - default: - break; - } -} - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_pwm.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_pwm.c deleted file mode 100644 index eb5acf9551d..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_pwm.c +++ /dev/null @@ -1,1063 +0,0 @@ -/**************************************************************************//** - * @file pwm.c - * @version V1.00 - * $Revision: 4 $ - * $Date: 18/04/25 11:43a $ - * @brief M031 series PWM driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PWM_Driver PWM Driver - @{ -*/ - - -/** @addtogroup PWM_EXPORTED_FUNCTIONS PWM Exported Functions - @{ -*/ - -/** - * @brief Configure PWM capture and get the nearest unit time. - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure PWM capture and get the nearest unit time. - */ -uint32_t PWM_ConfigCaptureChannel(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32Src; - uint32_t u32PWMClockSrc; - uint32_t u32NearestUnitTimeNsec; - uint16_t u16Prescale = 1UL, u16CNR = 0xFFFFUL; - uint8_t u8BreakLoop = 0UL; - - if (pwm == PWM0) - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_PWM0SEL_Msk; - else//(pwm == PWM1) - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_PWM1SEL_Msk; - - if (u32Src == 0UL) - { - //clock source is from PLL clock - u32PWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - //clock source is from PCLK - SystemCoreClockUpdate(); - - if (pwm == PWM0) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (pwm == PWM1) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - u32PWMClockSrc /= 1000UL; - - for (u16Prescale = 1UL; u16Prescale <= 0x1000UL; u16Prescale++) - { - u32NearestUnitTimeNsec = (1000000UL * u16Prescale) / u32PWMClockSrc; - - if (u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if (u16Prescale == 0x1000UL) - { - /* limit to the maximum unit time(nano second) */ - u8BreakLoop = 1UL; - } - - if (!((1000000UL * (u16Prescale + 1UL) > (u32NearestUnitTimeNsec * u32PWMClockSrc)))) - { - u8BreakLoop = 1UL; - } - } - else - { - u8BreakLoop = 1UL; - } - - if (u8BreakLoop) - { - break; - } - } - - // convert to real register value - u16Prescale = u16Prescale - 1UL; - // every two channels share a prescaler - PWM_SET_PRESCALER(pwm, u32ChannelNum, (uint32_t)u16Prescale); - - // set PWM to down count type(edge aligned) - (pwm)->CTL1 = ((pwm)->CTL1 & ~(PWM_CTL1_CNTTYPE0_Msk << ((u32ChannelNum >> 1UL) << 2UL))) | (1UL << ((u32ChannelNum >> 1UL) << 2UL)); - - PWM_SET_CNR(pwm, u32ChannelNum, u16CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure PWM generator and get the nearest frequency in edge aligned auto-reload mode - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since every two channels, (0 & 1), (2 & 3), shares a prescaler. Call this API to configure PWM frequency may affect - * existing frequency of other channel. - */ -uint32_t PWM_ConfigOutputChannel(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32Src; - uint32_t u32PWMClockSrc; - uint32_t i; - uint16_t u16Prescale = 1UL, u16CNR = 0xFFFFUL; - - if (pwm == PWM0) - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_PWM0SEL_Msk; - else//(pwm == PWM1) - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_PWM1SEL_Msk; - - if (u32Src == 0UL) - { - //clock source is from PLL clock - u32PWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - //clock source is from PCLK - SystemCoreClockUpdate(); - - if (pwm == PWM0) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (pwm == PWM1) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - for (u16Prescale = 1UL; u16Prescale < 0xFFFUL; u16Prescale++) //prescale could be 0~0xFFF - { - i = (u32PWMClockSrc / u32Frequency) / u16Prescale; - - // If target value is larger than CNR, need to use a larger prescaler - if (i <= (0x10000UL)) - { - u16CNR = (uint16_t)i; - break; - } - } - - // Store return value here 'cos we're gonna change u16Prescale & u16CNR to the real value to fill into register - i = u32PWMClockSrc / ((uint32_t)u16Prescale * (uint32_t)u16CNR); - - // convert to real register value - u16Prescale = u16Prescale - 1UL; - // every two channels share a prescaler - PWM_SET_PRESCALER(pwm, u32ChannelNum, (uint32_t)u16Prescale); - // set PWM to down count type(edge aligned) - (pwm)->CTL1 = ((pwm)->CTL1 & ~(PWM_CTL1_CNTTYPE0_Msk << ((u32ChannelNum >> 1UL) << 2UL))) | (1UL << ((u32ChannelNum >> 1UL) << 2UL)); - - u16CNR -= 1UL; - PWM_SET_CNR(pwm, u32ChannelNum, u16CNR); - - if (u32DutyCycle) - { - if (u32DutyCycle >= 100UL) - PWM_SET_CMR(pwm, u32ChannelNum, u16CNR); - else - PWM_SET_CMR(pwm, u32ChannelNum, u32DutyCycle * (u16CNR + 1UL) / 100UL); - - (pwm)->WGCTL0 &= ~((PWM_WGCTL0_PRDPCTL0_Msk | PWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1UL)); - (pwm)->WGCTL0 |= (PWM_OUTPUT_LOW << ((u32ChannelNum << 1UL) + PWM_WGCTL0_PRDPCTL0_Pos)); - (pwm)->WGCTL1 &= ~((PWM_WGCTL1_CMPDCTL0_Msk | PWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1UL)); - (pwm)->WGCTL1 |= (PWM_OUTPUT_HIGH << ((u32ChannelNum << 1UL) + PWM_WGCTL1_CMPDCTL0_Pos)); - } - else - { - PWM_SET_CMR(pwm, u32ChannelNum, 0UL); - (pwm)->WGCTL0 &= ~((PWM_WGCTL0_PRDPCTL0_Msk | PWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1UL)); - (pwm)->WGCTL0 |= (PWM_OUTPUT_LOW << ((u32ChannelNum << 1UL) + PWM_WGCTL0_ZPCTL0_Pos)); - (pwm)->WGCTL1 &= ~((PWM_WGCTL1_CMPDCTL0_Msk | PWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1UL)); - (pwm)->WGCTL1 |= (PWM_OUTPUT_HIGH << ((u32ChannelNum << 1UL) + PWM_WGCTL1_CMPDCTL0_Pos)); - } - - return (i); -} - -/** - * @brief Start PWM module - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to start PWM module. - * @note Every two channels share the same setting. - */ -void PWM_Start(PWM_T *pwm, uint32_t u32ChannelMask) -{ - uint32_t i; - - for (i = 0UL; i < PWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (pwm)->CNTEN |= (1UL << ((i >> 1UL) << 1UL)); - } - } -} - -/** - * @brief Stop PWM module - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop PWM module. - * @note Every two channels share the same setting. - */ -void PWM_Stop(PWM_T *pwm, uint32_t u32ChannelMask) -{ - uint32_t i; - - for (i = 0UL; i < PWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (pwm)->PERIOD[((i >> 1UL) << 1UL)] = 0UL; - } - } -} - -/** - * @brief Stop PWM generation immediately by clear channel enable bit - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop PWM generation immediately by clear channel enable bit. - * @note Every two channels share the same setting. - */ -void PWM_ForceStop(PWM_T *pwm, uint32_t u32ChannelMask) -{ - uint32_t i; - - for (i = 0UL; i < PWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (pwm)->CNTEN &= ~(1UL << ((i >> 1UL) << 1UL)); - } - } -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref PWM_TRIGGER_ADC_EVEN_ZERO_POINT - * - \ref PWM_TRIGGER_ADC_EVEN_PERIOD_POINT - * - \ref PWM_TRIGGER_ADC_EVEN_ZERO_OR_PERIOD_POINT - * - \ref PWM_TRIGGER_ADC_EVEN_COMPARE_UP_COUNT_POINT - * - \ref PWM_TRIGGER_ADC_EVEN_COMPARE_DOWN_COUNT_POINT - * - \ref PWM_TRIGGER_ADC_ODD_COMPARE_UP_COUNT_POINT - * - \ref PWM_TRIGGER_ADC_ODD_COMPARE_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable selected channel to trigger ADC. - */ -void PWM_EnableADCTrigger(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if (u32ChannelNum < 4UL) - { - (pwm)->ADCTS0 &= ~((PWM_ADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3UL)); - (pwm)->ADCTS0 |= ((PWM_ADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3UL)); - } - else - { - (pwm)->ADCTS1 &= ~((PWM_ADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4UL) << 3UL)); - (pwm)->ADCTS1 |= ((PWM_ADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4UL) << 3UL)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger ADC. - */ -void PWM_DisableADCTrigger(PWM_T *pwm, uint32_t u32ChannelNum) -{ - if (u32ChannelNum < 4UL) - { - (pwm)->ADCTS0 &= ~(PWM_ADCTS0_TRGEN0_Msk << (u32ChannelNum << 3UL)); - } - else - { - (pwm)->ADCTS1 &= ~(PWM_ADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4UL) << 3UL)); - } -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag. - */ -void PWM_ClearADCTriggerFlag(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (pwm)->STATUS = (PWM_STATUS_ADCTRG0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get PWM trigger ADC to start of conversion flag for specified channel. - */ -uint32_t PWM_GetADCTriggerFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - return (((pwm)->STATUS & (PWM_STATUS_ADCTRG0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief This function enable fault brake of selected channel(s) - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * @param[in] u32LevelMask Output high or low while fault brake occurs, each bit represent the level of a channel - * while fault brake occurs. Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32BrakeSource Fault brake source, could be one of following source - * - \ref PWM_FB_EDGE_ACMP0 - * - \ref PWM_FB_EDGE_ACMP1 - * - \ref PWM_FB_EDGE_BKP0 - * - \ref PWM_FB_EDGE_BKP1 - * - \ref PWM_FB_EDGE_SYS_CSS - * - \ref PWM_FB_EDGE_SYS_BOD - * - \ref PWM_FB_EDGE_SYS_COR - * - \ref PWM_FB_LEVEL_ACMP0 - * - \ref PWM_FB_LEVEL_ACMP1 - * - \ref PWM_FB_LEVEL_BKP0 - * - \ref PWM_FB_LEVEL_BKP1 - * - \ref PWM_FB_LEVEL_SYS_CSS - * - \ref PWM_FB_LEVEL_SYS_BOD - * - \ref PWM_FB_LEVEL_SYS_COR - * @return None - * @details This function is used to enable fault brake of selected channel(s). - * The write-protection function should be disabled before using this function. - */ -void PWM_EnableFaultBrake(PWM_T *pwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource) -{ - uint32_t i; - - for (i = 0UL; i < PWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - if ((u32BrakeSource == PWM_FB_EDGE_SYS_CSS) || (u32BrakeSource == PWM_FB_EDGE_SYS_BOD) || \ - (u32BrakeSource == PWM_FB_EDGE_SYS_COR) || \ - (u32BrakeSource == PWM_FB_LEVEL_SYS_CSS) || (u32BrakeSource == PWM_FB_LEVEL_SYS_BOD) || \ - (u32BrakeSource == PWM_FB_LEVEL_SYS_COR)) - { - (pwm)->BRKCTL[i >> 1UL] |= (u32BrakeSource & (PWM_BRKCTL_SYSEBEN_Msk | PWM_BRKCTL_SYSLBEN_Msk)); - (pwm)->FAILBRK |= (u32BrakeSource & 0xBUL); - } - else - { - (pwm)->BRKCTL[i >> 1UL] |= u32BrakeSource; - } - } - - if (u32LevelMask & (1UL << i)) - { - if ((i & 0x1UL) == 0UL) - { - //set brake action as high level for even channel - (pwm)->BRKCTL[i >> 1UL] &= ~PWM_BRKCTL0_1_BRKAEVEN_Msk; - (pwm)->BRKCTL[i >> 1UL] |= ((3UL) << PWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - //set brake action as high level for odd channel - (pwm)->BRKCTL[i >> 1UL] &= ~PWM_BRKCTL0_1_BRKAODD_Msk; - (pwm)->BRKCTL[i >> 1UL] |= ((3UL) << PWM_BRKCTL0_1_BRKAODD_Pos); - } - } - else - { - if ((i & 0x1UL) == 0UL) - { - //set brake action as low level for even channel - (pwm)->BRKCTL[i >> 1UL] &= ~PWM_BRKCTL0_1_BRKAEVEN_Msk; - (pwm)->BRKCTL[i >> 1UL] |= ((2UL) << PWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - //set brake action as low level for odd channel - (pwm)->BRKCTL[i >> 1UL] &= ~PWM_BRKCTL0_1_BRKAODD_Msk; - (pwm)->BRKCTL[i >> 1UL] |= ((2UL) << PWM_BRKCTL0_1_BRKAODD_Pos); - } - } - } - -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s). - */ -void PWM_EnableCapture(PWM_T *pwm, uint32_t u32ChannelMask) -{ - (pwm)->CAPINEN |= u32ChannelMask; - (pwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s). - */ -void PWM_DisableCapture(PWM_T *pwm, uint32_t u32ChannelMask) -{ - (pwm)->CAPINEN &= ~u32ChannelMask; - (pwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables PWM output generation of selected channel(s) - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enable PWM output generation of selected channel(s). - */ -void PWM_EnableOutput(PWM_T *pwm, uint32_t u32ChannelMask) -{ - (pwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables PWM output generation of selected channel(s) - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disable PWM output generation of selected channel(s). - */ -void PWM_DisableOutput(PWM_T *pwm, uint32_t u32ChannelMask) -{ - (pwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enable Dead zone of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Duration Dead zone length in PWM clock count, valid values are between 0~0xFFF, but 0 means there is no Dead zone. - * @return None - * @details This function is used to enable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void PWM_EnableDeadZone(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Duration) -{ - // every two channels share the same setting - (pwm)->DTCTL[(u32ChannelNum) >> 1UL] &= ~PWM_DTCTL0_1_DTCNT_Msk; - (pwm)->DTCTL[(u32ChannelNum) >> 1UL] |= PWM_DTCTL0_1_DTEN_Msk | u32Duration; -} - -/** - * @brief Disable Dead zone of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - */ -void PWM_DisableDeadZone(PWM_T *pwm, uint32_t u32ChannelNum) -{ - // every two channels shares the same setting - (pwm)->DTCTL[(u32ChannelNum) >> 1UL] &= ~PWM_DTCTL0_1_DTEN_Msk; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref PWM_CAPTURE_INT_RISING_LATCH - * - \ref PWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void PWM_EnableCaptureInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (pwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref PWM_CAPTURE_INT_RISING_LATCH - * - \ref PWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void PWM_DisableCaptureInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (pwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref PWM_CAPTURE_INT_RISING_LATCH - * - \ref PWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void PWM_ClearCaptureIntFlag(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (pwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t PWM_GetCaptureIntFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - uint32_t u32CapFFlag, u32CapRFlag ; - u32CapFFlag = (((pwm)->CAPIF & (PWM_CAPIF_CFLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) ; - u32CapRFlag = (((pwm)->CAPIF & (PWM_CAPIF_CRLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) ; - return ((u32CapFFlag << 1UL) | u32CapRFlag); -} -/** - * @brief Enable duty interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref PWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref PWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void PWM_EnableDutyInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (pwm)->INTEN0 |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel. - */ -void PWM_DisableDutyInt(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->INTEN0 &= ~((PWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | PWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel. - */ -void PWM_ClearDutyIntFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->INTSTS0 = (PWM_INTSTS0_CMPUIF0_Msk | PWM_INTSTS0_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel. - */ -uint32_t PWM_GetDutyIntFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - return ((((pwm)->INTSTS0 & ((PWM_INTSTS0_CMPDIF0_Msk | PWM_INTSTS0_CMPUIF0_Msk) << u32ChannelNum))) ? 1 : 0); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode PWM counter loading mode. - * - \ref PWM_LOAD_MODE_IMMEDIATE - * - \ref PWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void PWM_EnableLoadMode(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (pwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode PWM counter loading mode. - * - \ref PWM_LOAD_MODE_IMMEDIATE - * - \ref PWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void PWM_DisableLoadMode(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (pwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief This function enable fault brake interrupt - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref PWM_FB_EDGE - * - \ref PWM_FB_LEVEL - * @return None - * @details This function is used to enable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void PWM_EnableFaultBrakeInt(PWM_T *pwm, uint32_t u32BrakeSource) -{ - (pwm)->INTEN1 |= (0x7UL << u32BrakeSource); -} - -/** - * @brief This function disable fault brake interrupt - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref PWM_FB_EDGE - * - \ref PWM_FB_LEVEL - * @return None - * @details This function is used to disable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void PWM_DisableFaultBrakeInt(PWM_T *pwm, uint32_t u32BrakeSource) -{ - (pwm)->INTEN1 &= ~(0x7UL << u32BrakeSource); -} - -/** - * @brief This function clear fault brake interrupt of selected source - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref PWM_FB_EDGE - * - \ref PWM_FB_LEVEL - * @return None - * @details This function is used to clear fault brake interrupt of selected source. - * The write-protection function should be disabled before using this function. - */ -void PWM_ClearFaultBrakeIntFlag(PWM_T *pwm, uint32_t u32BrakeSource) -{ - (pwm)->INTSTS1 = (0x3fUL << u32BrakeSource); -} - -/** - * @brief This function get fault brake interrupt flag of selected source - * @param[in] pwm The pointer of the specified PWM module - * @param[in] u32BrakeSource Fault brake source, could be either - * - \ref PWM_FB_EDGE - * - \ref PWM_FB_LEVEL - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * @details This function is used to get fault brake interrupt flag of selected source. - */ -uint32_t PWM_GetFaultBrakeIntFlag(PWM_T *pwm, uint32_t u32BrakeSource) -{ - return (((pwm)->INTSTS1 & (0x3fUL << u32BrakeSource)) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - */ -void PWM_EnablePeriodInt(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (pwm)->INTEN0 |= (PWM_INTEN0_PIEN0_Msk << ((u32ChannelNum >> 1UL) << 1UL)); -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return None - * @details This function is used to disable period interrupt of selected channel. - */ -void PWM_DisablePeriodInt(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->INTEN0 &= ~(PWM_INTEN0_PIEN0_Msk << ((u32ChannelNum >> 1UL) << 1UL)); -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return None - * @details This function is used to clear period interrupt of selected channel. - */ -void PWM_ClearPeriodIntFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->INTSTS0 = (PWM_INTSTS0_PIF0_Msk << ((u32ChannelNum >> 1UL) << 1UL)); -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel. - */ -uint32_t PWM_GetPeriodIntFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - return (((pwm)->INTSTS0 & (PWM_INTSTS0_PIF0_Msk << ((u32ChannelNum >> 1UL) << 1UL))) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return None - * @details This function is used to enable zero interrupt of selected channel. - */ -void PWM_EnableZeroInt(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->INTEN0 |= (PWM_INTEN0_ZIEN0_Msk << ((u32ChannelNum >> 1UL) << 1UL)); -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return None - * @details This function is used to disable zero interrupt of selected channel. - */ -void PWM_DisableZeroInt(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->INTEN0 &= ~(PWM_INTEN0_ZIEN0_Msk << ((u32ChannelNum >> 1UL) << 1UL)); -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return None - * @details This function is used to clear zero interrupt of selected channel. - */ -void PWM_ClearZeroIntFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->INTSTS0 = (PWM_INTSTS0_ZIF0_Msk << ((u32ChannelNum >> 1UL) << 1UL)); -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return zero interrupt flag of specified channel - * @retval 0 zero interrupt did not occur - * @retval 1 zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - */ -uint32_t PWM_GetZeroIntFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - return (((pwm)->INTSTS0 & (PWM_INTSTS0_ZIF0_Msk << ((u32ChannelNum >> 1UL) << 1UL))) ? 1UL : 0UL); -} - -/** - * @brief Set PWM clock source - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5 - * @param[in] u32ClkSrcSel PWM external clock source. - * - \ref PWM_CLKSRC_PWM_CLK - * - \ref PWM_CLKSRC_TIMER0 - * - \ref PWM_CLKSRC_TIMER1 - * - \ref PWM_CLKSRC_TIMER2 - * - \ref PWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set PWM clock source. - * @note Every two channels share the same setting. - */ -void PWM_SetClockSource(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (pwm)->CLKSRC = ((pwm)->CLKSRC & ~(PWM_CLKSRC_ECLKSRC0_Msk << ((u32ChannelNum >> 1UL) * PWM_CLKSRC_ECLKSRC2_Pos))) | \ - (u32ClkSrcSel << ((u32ChannelNum >> 1UL) * PWM_CLKSRC_ECLKSRC2_Pos)); -} - -/** - * @brief Enable PWM brake noise filter function - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref PWM_NF_CLK_DIV_1 - * - \ref PWM_NF_CLK_DIV_2 - * - \ref PWM_NF_CLK_DIV_4 - * - \ref PWM_NF_CLK_DIV_8 - * - \ref PWM_NF_CLK_DIV_16 - * - \ref PWM_NF_CLK_DIV_32 - * - \ref PWM_NF_CLK_DIV_64 - * - \ref PWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable PWM brake noise filter function. - */ -void PWM_EnableBrakeNoiseFilter(PWM_T *pwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (pwm)->BNF = ((pwm)->BNF & ~((PWM_BNF_BRK0FCNT_Msk | PWM_BNF_BRK0NFSEL_Msk) << (u32BrakePinNum * PWM_BNF_BRK1NFEN_Pos))) | \ - (((u32ClkCnt << PWM_BNF_BRK0FCNT_Pos) | (u32ClkDivSel << PWM_BNF_BRK0NFSEL_Pos) | PWM_BNF_BRK0NFEN_Msk) << (u32BrakePinNum * PWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Disable PWM brake noise filter function - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable PWM brake noise filter function. - */ -void PWM_DisableBrakeNoiseFilter(PWM_T *pwm, uint32_t u32BrakePinNum) -{ - (pwm)->BNF &= ~(PWM_BNF_BRK0NFEN_Msk << (u32BrakePinNum * PWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Enable PWM brake pin inverse function - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to enable PWM brake pin inverse function. - */ -void PWM_EnableBrakePinInverse(PWM_T *pwm, uint32_t u32BrakePinNum) -{ - (pwm)->BNF |= (PWM_BNF_BRK0PINV_Msk << (u32BrakePinNum * PWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Disable PWM brake pin inverse function - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable PWM brake pin inverse function. - */ -void PWM_DisableBrakePinInverse(PWM_T *pwm, uint32_t u32BrakePinNum) -{ - (pwm)->BNF &= ~(PWM_BNF_BRK0PINV_Msk << (u32BrakePinNum * PWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Set PWM brake pin source - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32SelAnotherModule Select to another module. Valid values are TRUE or FALSE. - * @return None - * @details This function is used to set PWM brake pin source. - */ -void PWM_SetBrakePinSource(PWM_T *pwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule) -{ - (pwm)->BNF = ((pwm)->BNF & ~(PWM_BNF_BK0SRC_Msk << (u32BrakePinNum << 3UL))) | (u32SelAnotherModule << (PWM_BNF_BK0SRC_Pos + (u32BrakePinNum << 3UL))); -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - */ -uint32_t PWM_GetWrapAroundFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - return (((pwm)->STATUS & (PWM_STATUS_CNTMAX0_Msk << ((u32ChannelNum >> 1UL) << 1UL))) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5. Every two channels share the same setting. - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - */ -void PWM_ClearWrapAroundFlag(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->STATUS = (PWM_STATUS_CNTMAX0_Msk << ((u32ChannelNum >> 1UL) << 1UL)); -} - -/** - * @brief Enables PDMA transfer of selected channel for PWM capture - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. - * @param[in] u32RisingFirst The capture order is rising, falling first. Every two channels share the same setting. Valid values are TRUE and FALSE. - * @param[in] u32Mode Captured data transferred by PDMA interrupt type. It could be either - * - \ref PWM_CAPTURE_PDMA_RISING_LATCH - * - \ref PWM_CAPTURE_PDMA_FALLING_LATCH - * - \ref PWM_CAPTURE_PDMA_RISING_FALLING_LATCH - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for PWM capture. - * @note This function can only selects even or odd channel of pairs to do PDMA transfer. - */ -void PWM_EnablePDMA(PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode) -{ - uint32_t u32IsOddCh; - u32IsOddCh = u32ChannelNum % 2UL; - (pwm)->PDMACTL = ((pwm)->PDMACTL & ~((PWM_PDMACTL_CHSEL0_1_Msk | PWM_PDMACTL_CAPORD0_1_Msk | PWM_PDMACTL_CAPMOD0_1_Msk) << ((u32ChannelNum >> 1UL) << 3UL))) | \ - (((u32IsOddCh << PWM_PDMACTL_CHSEL0_1_Pos) | (u32RisingFirst << PWM_PDMACTL_CAPORD0_1_Pos) | \ - u32Mode | PWM_PDMACTL_CHEN0_1_Msk) << ((u32ChannelNum >> 1UL) << 3UL)); -} - -/** - * @brief Disables PDMA transfer of selected channel for PWM capture - * @param[in] pwm The pointer of the specified PWM module - * - PWM0 : PWM Group 0 - * - PWM1 : PWM Group 1 - * @param[in] u32ChannelNum PWM channel number. - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for PWM capture. - */ -void PWM_DisablePDMA(PWM_T *pwm, uint32_t u32ChannelNum) -{ - (pwm)->PDMACTL &= ~(PWM_PDMACTL_CHEN0_1_Msk << ((u32ChannelNum >> 1UL) << 3UL)); -} - -/*@}*/ /* end of group PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_qspi.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_qspi.c deleted file mode 100644 index 209cc12092d..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_qspi.c +++ /dev/null @@ -1,813 +0,0 @@ -/**************************************************************************//** - * @file qspi.c - * @version V1.00 - * @brief M031 series QSPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32MasterSlave Decides the QSPI module is operating in master mode or in slave mode. (QSPI_SLAVE, QSPI_MASTER) - * @param[in] u32QSPIMode Decides the transfer timing. (QSPI_MODE_0, QSPI_MODE_1, QSPI_MODE_2, QSPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a QSPI transaction. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI peripheral clock. - * @details By default, the QSPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the QSPI clock divider setting will be 0. - * The actual clock rate may be different from the target QSPI clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the - * actual QSPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the QSPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t QSPI_Open(QSPI_T *qspi, - uint32_t u32MasterSlave, - uint32_t u32QSPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0UL, u32Div, u32HCLKFreq, u32RetValue = 0UL; - - if (u32DataWidth == 32UL) - { - u32DataWidth = 0UL; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32MasterSlave == QSPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - } - - /* Check clock source of QSPI */ - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0UL) - { - /* Set DIVIDER to the maximum value 0x1FF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer */ - - if (u32Div > 0x1FFUL) - { - u32Div = 0x1FFUL; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1UL)); - } - } - } - else /* For slave mode, force the QSPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - - /* Select PCLK as the clock source of QSPI */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - - return u32RetValue; -} - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will reset QSPI controller. - */ -void QSPI_Close(QSPI_T *qspi) -{ - /* Reset QSPI */ - SYS->IPRST1 |= SYS_IPRST1_QSPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_QSPI0RST_Msk; -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI RX FIFO buffer. The RXEMPTY (QSPI_STATUS[8]) will be set to 1. - */ -void QSPI_ClearRxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI TX FIFO buffer. The TXEMPTY (QSPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void QSPI_ClearTxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void QSPI_DisableAutoSS(QSPI_T *qspi) -{ - qspi->SSCTL &= ~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (QSPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (QSPI_SS_ACTIVE_HIGH, QSPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - qspi->SSCTL = (qspi->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | QSPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the QSPI bus clock. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target QSPI bus clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - } - - /* Check clock source of QSPI */ - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0UL) - { - /* Set DIVIDER to the maximum value 0x1FF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer */ - - if (u32Div > 0x1FFUL) - { - u32Div = 0x1FFUL; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1UL)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - qspi->FIFOCTL = (qspi->FIFOCTL & ~(QSPI_FIFOCTL_TXTH_Msk | QSPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << QSPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << QSPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of QSPI bus clock. Only available in Master mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Actual QSPI bus clock frequency in Hz. - * @details This function will calculate the actual QSPI bus clock rate according to the QSPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t QSPI_GetBusClock(QSPI_T *qspi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc; - - /* Get DIVIDER setting */ - u32Div = (qspi->CLKDIV & QSPI_CLKDIV_DIVIDER_Msk) >> QSPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of QSPI */ - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - - /* Return QSPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1UL)); -} - -/** - * @brief Enable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL |= QSPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave mode time-out interrupt flag */ - if ((u32Mask & QSPI_SLVTO_INT_MASK) == QSPI_SLVTO_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVTOIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL &= ~QSPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave mode time-out interrupt flag */ - if ((u32Mask & QSPI_SLVTO_INT_MASK) == QSPI_SLVTO_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVTOIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get QSPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = qspi->STATUS & QSPI_STATUS_UNITIF_Msk; - - /* Check unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_UNIT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSACTIF_Msk; - - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSINAIF_Msk; - - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSINACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVURIF_Msk; - - /* Check slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVUR_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVBEIF_Msk; - - /* Check slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVBE_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVTOIF_Msk; - - /* Check slave mode time-out interrupt flag */ - if ((u32Mask & QSPI_SLVTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVTO_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXUFIF_Msk; - - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_TXUF_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXTHIF_Msk; - - /* Check TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTHIF_Msk; - - /* Check RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXOVIF_Msk; - - /* Check RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTOIF_Msk; - - /* Check RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear QSPI related interrupt flags specified by u32Mask parameter. - */ -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - if (u32Mask & QSPI_UNIT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & QSPI_SSACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & QSPI_SSINACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & QSPI_SLVUR_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & QSPI_SLVBE_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & QSPI_SLVTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVTOIF_Msk; /* Clear slave mode time-out interrupt flag */ - } - - if (u32Mask & QSPI_TXUF_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXOV_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get QSPI status. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_BUSY_MASK - * - \ref QSPI_RX_EMPTY_MASK - * - \ref QSPI_RX_FULL_MASK - * - \ref QSPI_TX_EMPTY_MASK - * - \ref QSPI_TX_FULL_MASK - * - \ref QSPI_TXRX_RESET_MASK - * - \ref QSPI_SPIEN_STS_MASK - * - \ref QSPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0UL, u32TmpValue; - - u32TmpValue = qspi->STATUS & QSPI_STATUS_BUSY_Msk; - - /* Check busy status */ - if ((u32Mask & QSPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_BUSY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXEMPTY_Msk; - - /* Check RX empty flag */ - if ((u32Mask & QSPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXFULL_Msk; - - /* Check RX full flag */ - if ((u32Mask & QSPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXEMPTY_Msk; - - /* Check TX empty flag */ - if ((u32Mask & QSPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXFULL_Msk; - - /* Check TX full flag */ - if ((u32Mask & QSPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXRXRST_Msk; - - /* Check TX/RX reset flag */ - if ((u32Mask & QSPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TXRX_RESET_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SPIENSTS_Msk; - - /* Check SPIEN flag */ - if ((u32Mask & QSPI_SPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_SPIEN_STS_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SSLINE_Msk; - - /* Check QSPIx_SS line status */ - if ((u32Mask & QSPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_rtc.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_rtc.c deleted file mode 100644 index 5d56d2b6292..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_rtc.c +++ /dev/null @@ -1,782 +0,0 @@ -/**************************************************************************//** - * @file rtc.c - * @version V1.00 - * $Revision: 4 $ - * $Date: 18/04/25 11:43a $ - * @brief M031 series Real Time Clock(RTC) driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "M031Series.h" - - -/** @cond HIDDEN_SYMBOLS */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macro, type and constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_GLOBALS - -/*---------------------------------------------------------------------------------------------------------*/ -/* Global file scope (static) variables */ -/*---------------------------------------------------------------------------------------------------------*/ -static volatile uint32_t g_u32HiYear, g_u32LoYear, g_u32HiMonth, g_u32LoMonth, g_u32HiDay, g_u32LoDay; -static volatile uint32_t g_u32HiHour, g_u32LoHour, g_u32HiMin, g_u32LoMin, g_u32HiSec, g_u32LoSec; - -/** @endcond HIDDEN_SYMBOLS */ - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Initialize RTC module and start counting - * - * @param[in] psPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This function is used to: \n - * 1. Write initial key to let RTC start count. \n - * 2. Input parameter indicates start date/time. \n - * 3. User has to make sure that parameters of RTC date/time are reasonable. \n - * @note Null pointer for using default starting date/time. - */ -void RTC_Open(S_RTC_TIME_DATA_T *psPt) -{ - RTC->INIT = RTC_INIT_KEY; - - if (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - RTC->INIT = RTC_INIT_KEY; - - while (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - } - } - - if (psPt == NULL) - { - /* No RTC date/time data */ - } - else - { - /* Set RTC date and time */ - RTC_SetDateAndTime(psPt); - } -} - -/** - * @brief Disable RTC Clock - * - * @param None - * - * @return None - * - * @details This API will disable RTC peripheral clock and stops RTC counting. - */ -void RTC_Close(void) -{ - CLK->APBCLK0 &= ~CLK_APBCLK0_RTCCKEN_Msk; -} - -/** - * @brief Set Frequency Compensation Data - * - * @param[in] i32FrequencyX10000 Specify the RTC clock X 10000, ex: 327736512 means 32773.6512. - * - * @return None - * - */ -void RTC_32KCalibration(int32_t i32FrequencyX10000) -{ - - /* - Frequency counter measurement : 32773.6512 Hz - */ - uint32_t u32Index; - uint32_t u32Compensate; - - /* 327736512 %10000 = 6512 */ - u32Compensate = (uint32_t)(i32FrequencyX10000 % 10000); - /*Fraction Part: (6512 X 64)/10000 = 41.6768(0x2A) => RTC_FREQADJ[5:0]=0x2A*/ - u32Compensate = ((u32Compensate * 64) / 10000); - u32Compensate &= 0x3F; - /* - Formula for 32K compensation is - FREQADJ = 0~0x00001F00 (Frequency range : 32752Hz ~ 32783Hz) - */ - - if (i32FrequencyX10000 >= (uint32_t)327840000) - { - u32Compensate = 0x1F3F; - } - else if (i32FrequencyX10000 < (uint32_t)327520000) - { - u32Compensate = 0x0; - } - else - { - /* Integer Part: 32773 => RTC_FREQADJ[12:8] = 0x15 */ - for (u32Index = 0; u32Index < 0x20 ; u32Index++) - { - if ((i32FrequencyX10000 >= 327520000 + (u32Index * 10000)) && (i32FrequencyX10000 < 327520000 + ((u32Index + 1) * 10000))) - { - u32Compensate += (u32Index << RTC_FREQADJ_INTEGER_Pos); - break; - } - } - } - - - RTC->FREQADJ = (uint32_t)u32Compensate; -} - -/** - * @brief Get Current RTC Date and Time - * - * @param[out] psPt The returned pointer is specified the current RTC value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the current RTC date and time value. - */ -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *psPt) -{ - uint32_t u32Tmp; - - psPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - psPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get [Date digit] data */ - g_u32HiYear = (RTC->CAL & RTC_CAL_TENYEAR_Msk) >> RTC_CAL_TENYEAR_Pos; - g_u32LoYear = (RTC->CAL & RTC_CAL_YEAR_Msk) >> RTC_CAL_YEAR_Pos; - g_u32HiMonth = (RTC->CAL & RTC_CAL_TENMON_Msk) >> RTC_CAL_TENMON_Pos; - g_u32LoMonth = (RTC->CAL & RTC_CAL_MON_Msk) >> RTC_CAL_MON_Pos; - g_u32HiDay = (RTC->CAL & RTC_CAL_TENDAY_Msk) >> RTC_CAL_TENDAY_Pos; - g_u32LoDay = (RTC->CAL & RTC_CAL_DAY_Msk) >> RTC_CAL_DAY_Pos; - - /* Get [Time digit] data */ - g_u32HiHour = (RTC->TIME & RTC_TIME_TENHR_Msk) >> RTC_TIME_TENHR_Pos; - g_u32LoHour = (RTC->TIME & RTC_TIME_HR_Msk) >> RTC_TIME_HR_Pos; - g_u32HiMin = (RTC->TIME & RTC_TIME_TENMIN_Msk) >> RTC_TIME_TENMIN_Pos; - g_u32LoMin = (RTC->TIME & RTC_TIME_MIN_Msk) >> RTC_TIME_MIN_Pos; - g_u32HiSec = (RTC->TIME & RTC_TIME_TENSEC_Msk) >> RTC_TIME_TENSEC_Pos; - g_u32LoSec = (RTC->TIME & RTC_TIME_SEC_Msk) >> RTC_TIME_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32HiYear * 10ul); - u32Tmp += g_u32LoYear; - psPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32HiMonth * 10ul); - psPt->u32Month = u32Tmp + g_u32LoMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32HiDay * 10ul); - psPt->u32Day = u32Tmp + g_u32LoDay; - - /* Compute 12/24 hour */ - if (psPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32HiHour * 10ul); - u32Tmp += g_u32LoHour; - psPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (psPt->u32Hour >= 21ul) - { - psPt->u32AmPm = RTC_PM; - psPt->u32Hour -= 20ul; - } - else - { - psPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32HiMin * 10ul); - u32Tmp += g_u32LoMin; - psPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32HiSec * 10ul); - u32Tmp += g_u32LoSec; - psPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32HiHour * 10ul); - u32Tmp += g_u32LoHour; - psPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32HiMin * 10ul); - u32Tmp += g_u32LoMin; - psPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32HiSec * 10ul); - u32Tmp += g_u32LoSec; - psPt->u32Second = u32Tmp; - } -} - -/** - * @brief Get RTC Alarm Date and Time - * - * @param[out] psPt The returned pointer is specified the RTC alarm value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the RTC alarm date and time setting. - */ -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *psPt) -{ - uint32_t u32Tmp; - - psPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - psPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get alarm [Date digit] data */ - g_u32HiYear = (RTC->CALM & RTC_CALM_TENYEAR_Msk) >> RTC_CALM_TENYEAR_Pos; - g_u32LoYear = (RTC->CALM & RTC_CALM_YEAR_Msk) >> RTC_CALM_YEAR_Pos; - g_u32HiMonth = (RTC->CALM & RTC_CALM_TENMON_Msk) >> RTC_CALM_TENMON_Pos; - g_u32LoMonth = (RTC->CALM & RTC_CALM_MON_Msk) >> RTC_CALM_MON_Pos; - g_u32HiDay = (RTC->CALM & RTC_CALM_TENDAY_Msk) >> RTC_CALM_TENDAY_Pos; - g_u32LoDay = (RTC->CALM & RTC_CALM_DAY_Msk) >> RTC_CALM_DAY_Pos; - - /* Get alarm [Time digit] data */ - g_u32HiHour = (RTC->TALM & RTC_TALM_TENHR_Msk) >> RTC_TALM_TENHR_Pos; - g_u32LoHour = (RTC->TALM & RTC_TALM_HR_Msk) >> RTC_TALM_HR_Pos; - g_u32HiMin = (RTC->TALM & RTC_TALM_TENMIN_Msk) >> RTC_TALM_TENMIN_Pos; - g_u32LoMin = (RTC->TALM & RTC_TALM_MIN_Msk) >> RTC_TALM_MIN_Pos; - g_u32HiSec = (RTC->TALM & RTC_TALM_TENSEC_Msk) >> RTC_TALM_TENSEC_Pos; - g_u32LoSec = (RTC->TALM & RTC_TALM_SEC_Msk) >> RTC_TALM_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32HiYear * 10ul); - u32Tmp += g_u32LoYear; - psPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32HiMonth * 10ul); - psPt->u32Month = u32Tmp + g_u32LoMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32HiDay * 10ul); - psPt->u32Day = u32Tmp + g_u32LoDay; - - /* Compute 12/24 hour */ - if (psPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32HiHour * 10ul); - u32Tmp += g_u32LoHour; - psPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (psPt->u32Hour >= 21ul) - { - psPt->u32AmPm = RTC_PM; - psPt->u32Hour -= 20ul; - } - else - { - psPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32HiMin * 10ul); - u32Tmp += g_u32LoMin; - psPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32HiSec * 10ul); - u32Tmp += g_u32LoSec; - psPt->u32Second = u32Tmp; - - } - else - { - u32Tmp = (g_u32HiHour * 10ul); - u32Tmp += g_u32LoHour; - psPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32HiMin * 10ul); - u32Tmp += g_u32LoMin; - psPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32HiSec * 10ul); - u32Tmp += g_u32LoSec; - psPt->u32Second = u32Tmp; - } -} - -/** - * @brief Update Current RTC Date and Time - * - * @param[in] psPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update current date and time to RTC. - */ -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *psPt) -{ - uint32_t u32RegCAL, u32RegTIME; - - if (psPt == NULL) - { - /* No RTC date/time data */ - } - else - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - - if (psPt->u32TimeScale == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (psPt->u32AmPm == RTC_PM) - { - psPt->u32Hour += 20ul; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set Day of the Week */ - RTC->WEEKDAY = psPt->u32DayOfWeek; - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Current Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCAL = ((psPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((psPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((psPt->u32Month / 10ul) << 12); - u32RegCAL |= ((psPt->u32Month % 10ul) << 8); - u32RegCAL |= ((psPt->u32Day / 10ul) << 4); - u32RegCAL |= (psPt->u32Day % 10ul); - - u32RegTIME = ((psPt->u32Hour / 10ul) << 20); - u32RegTIME |= ((psPt->u32Hour % 10ul) << 16); - u32RegTIME |= ((psPt->u32Minute / 10ul) << 12); - u32RegTIME |= ((psPt->u32Minute % 10ul) << 8); - u32RegTIME |= ((psPt->u32Second / 10ul) << 4); - u32RegTIME |= (psPt->u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Calender and Time Loading */ - /*-----------------------------------------------------------------------------------------------------*/ - - RTC->CAL = (uint32_t)u32RegCAL; - RTC->TIME = (uint32_t)u32RegTIME; - } -} - -/** - * @brief Update RTC Alarm Date and Time - * - * @param[in] psPt Specify the time property and alarm date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update alarm date and time setting to RTC. - */ -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *psPt) -{ - uint32_t u32RegCALM, u32RegTALM; - - if (psPt == NULL) - { - /* No RTC date/time data */ - } - else - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - - if (psPt->u32TimeScale == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (psPt->u32AmPm == RTC_PM) - { - psPt->u32Hour += 20ul; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Alarm Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCALM = ((psPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((psPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((psPt->u32Month / 10ul) << 12); - u32RegCALM |= ((psPt->u32Month % 10ul) << 8); - u32RegCALM |= ((psPt->u32Day / 10ul) << 4); - u32RegCALM |= (psPt->u32Day % 10ul); - - u32RegTALM = ((psPt->u32Hour / 10ul) << 20); - u32RegTALM |= ((psPt->u32Hour % 10ul) << 16); - u32RegTALM |= ((psPt->u32Minute / 10ul) << 12); - u32RegTALM |= ((psPt->u32Minute % 10ul) << 8); - u32RegTALM |= ((psPt->u32Second / 10ul) << 4); - u32RegTALM |= (psPt->u32Second % 10ul); - - - RTC->CALM = (uint32_t)u32RegCALM; - RTC->TALM = (uint32_t)u32RegTALM; - } -} - -/** - * @brief Update RTC Current Date - * - * @param[in] u32Year The year calendar digit of current RTC setting. - * @param[in] u32Month The month calendar digit of current RTC setting. - * @param[in] u32Day The day calendar digit of current RTC setting. - * @param[in] u32DayOfWeek The Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] - * - * @return None - * - * @details This API is used to update current date to RTC. - */ -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek) -{ - uint32_t u32RegCAL; - - u32RegCAL = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((u32Month / 10ul) << 12); - u32RegCAL |= ((u32Month % 10ul) << 8); - u32RegCAL |= ((u32Day / 10ul) << 4); - u32RegCAL |= (u32Day % 10ul); - - /* Set Day of the Week */ - RTC->WEEKDAY = u32DayOfWeek & RTC_WEEKDAY_WEEKDAY_Msk; - - /* Set RTC Calender Loading */ - RTC->CAL = (uint32_t)u32RegCAL; -} - -/** - * @brief Update RTC Current Time - * - * @param[in] u32Hour The hour time digit of current RTC setting. - * @param[in] u32Minute The minute time digit of current RTC setting. - * @param[in] u32Second The second time digit of current RTC setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update current time to RTC. - */ -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTIME; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == RTC_CLOCK_12) && (u32AmPm == RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTIME = ((u32Hour / 10ul) << 20); - u32RegTIME |= ((u32Hour % 10ul) << 16); - u32RegTIME |= ((u32Minute / 10ul) << 12); - u32RegTIME |= ((u32Minute % 10ul) << 8); - u32RegTIME |= ((u32Second / 10ul) << 4); - u32RegTIME |= (u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (u32TimeMode == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - RTC->TIME = (uint32_t)u32RegTIME; -} - -/** - * @brief Update RTC Alarm Date - * - * @param[in] u32Year The year calendar digit of RTC alarm setting. - * @param[in] u32Month The month calendar digit of RTC alarm setting. - * @param[in] u32Day The day calendar digit of RTC alarm setting. - * - * @return None - * - * @details This API is used to update alarm date setting to RTC. - */ -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day) -{ - uint32_t u32RegCALM; - - u32RegCALM = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((u32Month / 10ul) << 12); - u32RegCALM |= ((u32Month % 10ul) << 8); - u32RegCALM |= ((u32Day / 10ul) << 4); - u32RegCALM |= (u32Day % 10ul); - - /* Set RTC Alarm Date */ - RTC->CALM = (uint32_t)u32RegCALM; -} - -/** - * @brief Update RTC Alarm Time - * - * @param[in] u32Hour The hour time digit of RTC alarm setting. - * @param[in] u32Minute The minute time digit of RTC alarm setting. - * @param[in] u32Second The second time digit of RTC alarm setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update alarm time setting to RTC. - */ -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTALM; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if((u32TimeMode == (uint32_t)RTC_CLOCK_12) && (u32AmPm == (uint32_t)RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTALM = ((u32Hour / 10ul) << 20); - u32RegTALM |= ((u32Hour % 10ul) << 16); - u32RegTALM |= ((u32Minute / 10ul) << 12); - u32RegTALM |= ((u32Minute % 10ul) << 8); - u32RegTALM |= ((u32Second / 10ul) << 4); - u32RegTALM |= (u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if(u32TimeMode == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set RTC Alarm Time */ - RTC->TALM = (uint32_t)u32RegTALM; -} - -/** - * @brief Set RTC Alarm Date Mask Function - * - * @param[in] u8IsTenYMsk 1: enable 10-Year digit alarm mask; 0: disabled. - * @param[in] u8IsYMsk 1: enable 1-Year digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsTenDMsk 1: enable 10-Day digit alarm mask; 0: disabled. - * @param[in] u8IsDMsk 1: enable 1-Day digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm date mask function. - */ -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk) -{ - RTC->CAMSK = ((uint32_t)u8IsTenYMsk << RTC_CAMSK_MTENYEAR_Pos) | - ((uint32_t)u8IsYMsk << RTC_CAMSK_MYEAR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_CAMSK_MTENMON_Pos) | - ((uint32_t)u8IsMMsk << RTC_CAMSK_MMON_Pos) | - ((uint32_t)u8IsTenDMsk << RTC_CAMSK_MTENDAY_Pos) | - ((uint32_t)u8IsDMsk << RTC_CAMSK_MDAY_Pos); -} - -/** - * @brief Set RTC Alarm Time Mask Function - * - * @param[in] u8IsTenHMsk 1: enable 10-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsHMsk 1: enable 1-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Min digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Min digit alarm mask; 0: disabled. - * @param[in] u8IsTenSMsk 1: enable 10-Sec digit alarm mask; 0: disabled. - * @param[in] u8IsSMsk 1: enable 1-Sec digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm time mask function. - */ -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk) -{ - RTC->TAMSK = ((uint32_t)u8IsTenHMsk << RTC_TAMSK_MTENHR_Pos) | - ((uint32_t)u8IsHMsk << RTC_TAMSK_MHR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_TAMSK_MTENMIN_Pos) | - ((uint32_t)u8IsMMsk << RTC_TAMSK_MMIN_Pos) | - ((uint32_t)u8IsTenSMsk << RTC_TAMSK_MTENSEC_Pos) | - ((uint32_t)u8IsSMsk << RTC_TAMSK_MSEC_Pos); -} - -/** - * @brief Get Day of the Week - * - * @param None - * - * @retval 0 Sunday - * @retval 1 Monday - * @retval 2 Tuesday - * @retval 3 Wednesday - * @retval 4 Thursday - * @retval 5 Friday - * @retval 6 Saturday - * - * @details This API is used to get day of the week of current RTC date. - */ -uint32_t RTC_GetDayOfWeek(void) -{ - return (RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk); -} - -/** - * @brief Set RTC Tick Period Time - * - * @param[in] u32TickSelection It is used to set the RTC tick period time for Periodic Time Tick request. \n - * It consists of: - * - \ref RTC_TICK_1_SEC : Time tick is 1 second - * - \ref RTC_TICK_1_2_SEC : Time tick is 1/2 second - * - \ref RTC_TICK_1_4_SEC : Time tick is 1/4 second - * - \ref RTC_TICK_1_8_SEC : Time tick is 1/8 second - * - \ref RTC_TICK_1_16_SEC : Time tick is 1/16 second - * - \ref RTC_TICK_1_32_SEC : Time tick is 1/32 second - * - \ref RTC_TICK_1_64_SEC : Time tick is 1/64 second - * - \ref RTC_TICK_1_128_SEC : Time tick is 1/128 second - * - * @return None - * - * @details This API is used to set RTC tick period time for each tick interrupt. - */ -void RTC_SetTickPeriod(uint32_t u32TickSelection) -{ - RTC->TICK = (RTC->TICK & ~RTC_TICK_TICK_Msk) | u32TickSelection; -} - -/** - * @brief Enable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - * @return None - * - * @details This API is used to enable the specify RTC interrupt function. - */ -void RTC_EnableInt(uint32_t u32IntFlagMask) -{ - RTC->INTEN |= u32IntFlagMask; -} - -/** - * @brief Disable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - * @return None - * - * @details This API is used to disable the specify RTC interrupt function. - */ -void RTC_DisableInt(uint32_t u32IntFlagMask) -{ - RTC->INTEN &= ~u32IntFlagMask; - RTC->INTSTS = u32IntFlagMask; -} - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_spi.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_spi.c deleted file mode 100644 index 1109859222a..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_spi.c +++ /dev/null @@ -1,934 +0,0 @@ -/**************************************************************************//** - * @file spi.c - * @version V1.00 - * $Revision: 4 $ - * $Date: 18/04/25 11:43a $ - * @brief M031 series SPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ - -/** - * @brief This function make SPI module be ready to transfer. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32MasterSlave Decides the SPI module is operating in master mode or in slave mode. (SPI_SLAVE, SPI_MASTER) - * @param[in] u32SPIMode Decides the transfer timing. (SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a SPI transaction. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI peripheral clock. - * @details By default, the SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the SPI clock divider setting will be 0. - * The actual clock rate may be different from the target SPI clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the - * actual SPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPI_Open(SPI_T *spi, - uint32_t u32MasterSlave, - uint32_t u32SPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0, u32Div, u32HCLKFreq; - - /* check SPI interface */ - if (spi != SPI0) return SPI_NONE; - - /* Disable I2S mode */ - spi->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; - - if (u32DataWidth == 32) - u32DataWidth = 0; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32MasterSlave == SPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - } - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - u32ClkSrc = __HXT; /* Clock source is HXT */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - u32ClkSrc = u32HCLKFreq / ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) + 1); - else - u32ClkSrc = 48000000; /* Clock source is HIRC48 */ - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0; - /* Return master peripheral clock rate */ - return u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0; - /* Return master peripheral clock rate */ - return u32ClkSrc; - } - else if (u32BusClock == 0) - { - /* Set DIVIDER to the maximum value 0xFF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - return (u32ClkSrc / (0xFF + 1)); - } - else - { - u32Div = (((u32ClkSrc * 10) / u32BusClock + 5) / 10) - 1; /* Round to the nearest integer */ - if (u32Div > 0xFF) - { - u32Div = 0xFF; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - return (u32ClkSrc / (0xFF + 1)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - return (u32ClkSrc / (u32Div + 1)); - } - } - } - else /* For slave mode, force the SPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0; - - /* Select PCLK as the clock source of SPI */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Return slave peripheral clock rate */ - return (CLK_GetHCLKFreq() / ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) + 1)); - } -} - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will reset SPI controller. - */ -void SPI_Close(SPI_T *spi) -{ - if (spi == SPI0) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI RX FIFO buffer. The RXEMPTY (SPI_STATUS[8]) will be set to 1. - */ -void SPI_ClearRxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI TX FIFO buffer. The TXEMPTY (SPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void SPI_ClearTxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void SPI_DisableAutoSS(SPI_T *spi) -{ - spi->SSCTL &= ~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (SPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (SPI_SS_ACTIVE_HIGH, SPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - spi->SSCTL = (spi->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | SPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the SPI bus clock. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target SPI bus clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the actual SPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div; - - /* check SPI interface */ - if (spi != SPI0) return SPI_NONE; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - } - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - u32ClkSrc = __HXT; /* Clock source is HXT */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - u32ClkSrc = CLK_GetHCLKFreq() / ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) + 1); - else - u32ClkSrc = 48000000; /* Clock source is HIRC48 */ - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0; - /* Return master peripheral clock rate */ - return u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0; - /* Return master peripheral clock rate */ - return u32ClkSrc; - } - else if (u32BusClock == 0) - { - /* Set DIVIDER to the maximum value 0xFF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - return (u32ClkSrc / (0xFF + 1)); - } - else - { - u32Div = (((u32ClkSrc * 10) / u32BusClock + 5) / 10) - 1; /* Round to the nearest integer */ - if (u32Div > 0xFF) - { - u32Div = 0xFF; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - return (u32ClkSrc / (0xFF + 1)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - return (u32ClkSrc / (u32Div + 1)); - } - } -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - spi->FIFOCTL = (spi->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of SPI bus clock. Only available in Master mode. - * @param[in] spi The pointer of the specified SPI module. - * @return Actual SPI bus clock frequency in Hz. - * @details This function will calculate the actual SPI bus clock rate according to the SPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t SPI_GetBusClock(SPI_T *spi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc = 0, u32HCLKFreq; - - /* check SPI interface */ - if (spi != SPI0) return SPI_NONE; - - /* Get DIVIDER setting */ - u32Div = (spi->CLKDIV & SPI_CLKDIV_DIVIDER_Msk) >> SPI_CLKDIV_DIVIDER_Pos; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - u32ClkSrc = __HXT; /* Clock source is HXT */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - u32ClkSrc = u32HCLKFreq / ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) + 1); - else - u32ClkSrc = 48000000; /* Clock source is HIRC48 */ - } - - /* Return SPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1)); -} - -/** - * @brief Enable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - spi->CTL |= SPI_CTL_UNITIEN_Msk; - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - spi->SSCTL |= SPI_SSCTL_SSACTIEN_Msk; - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - spi->SSCTL |= SPI_SSCTL_SSINAIEN_Msk; - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - spi->SSCTL |= SPI_SSCTL_SLVURIEN_Msk; - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - spi->SSCTL |= SPI_SSCTL_SLVBEIEN_Msk; - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - spi->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - spi->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - spi->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - spi->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - spi->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; -} - -/** - * @brief Disable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - spi->CTL &= ~SPI_CTL_UNITIEN_Msk; - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - spi->SSCTL &= ~SPI_SSCTL_SSACTIEN_Msk; - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - spi->SSCTL &= ~SPI_SSCTL_SSINAIEN_Msk; - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - spi->SSCTL &= ~SPI_SSCTL_SLVURIEN_Msk; - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - spi->SSCTL &= ~SPI_SSCTL_SLVBEIEN_Msk; - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - spi->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - spi->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - spi->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; -} - -/** - * @brief Get interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get SPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0; - - /* Check unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) && (spi->STATUS & SPI_STATUS_UNITIF_Msk)) - u32IntFlag |= SPI_UNIT_INT_MASK; - - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) && (spi->STATUS & SPI_STATUS_SSACTIF_Msk)) - u32IntFlag |= SPI_SSACT_INT_MASK; - - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) && (spi->STATUS & SPI_STATUS_SSINAIF_Msk)) - u32IntFlag |= SPI_SSINACT_INT_MASK; - - /* Check slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) && (spi->STATUS & SPI_STATUS_SLVURIF_Msk)) - u32IntFlag |= SPI_SLVUR_INT_MASK; - - /* Check slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) && (spi->STATUS & SPI_STATUS_SLVBEIF_Msk)) - u32IntFlag |= SPI_SLVBE_INT_MASK; - - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) && (spi->STATUS & SPI_STATUS_TXUFIF_Msk)) - u32IntFlag |= SPI_TXUF_INT_MASK; - - /* Check TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) && (spi->STATUS & SPI_STATUS_TXTHIF_Msk)) - u32IntFlag |= SPI_FIFO_TXTH_INT_MASK; - - /* Check RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) && (spi->STATUS & SPI_STATUS_RXTHIF_Msk)) - u32IntFlag |= SPI_FIFO_RXTH_INT_MASK; - - /* Check RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) && (spi->STATUS & SPI_STATUS_RXOVIF_Msk)) - u32IntFlag |= SPI_FIFO_RXOV_INT_MASK; - - /* Check RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) && (spi->STATUS & SPI_STATUS_RXTOIF_Msk)) - u32IntFlag |= SPI_FIFO_RXTO_INT_MASK; - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear SPI related interrupt flags specified by u32Mask parameter. - */ -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - if (u32Mask & SPI_UNIT_INT_MASK) - spi->STATUS = SPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - - if (u32Mask & SPI_SSACT_INT_MASK) - spi->STATUS = SPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - - if (u32Mask & SPI_SSINACT_INT_MASK) - spi->STATUS = SPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - - if (u32Mask & SPI_SLVUR_INT_MASK) - spi->STATUS = SPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - - if (u32Mask & SPI_SLVBE_INT_MASK) - spi->STATUS = SPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - - if (u32Mask & SPI_TXUF_INT_MASK) - spi->STATUS = SPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - - if (u32Mask & SPI_FIFO_RXOV_INT_MASK) - spi->STATUS = SPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - - if (u32Mask & SPI_FIFO_RXTO_INT_MASK) - spi->STATUS = SPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ -} - -/** - * @brief Get SPI status. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_BUSY_MASK - * - \ref SPI_RX_EMPTY_MASK - * - \ref SPI_RX_FULL_MASK - * - \ref SPI_TX_EMPTY_MASK - * - \ref SPI_TX_FULL_MASK - * - \ref SPI_TXRX_RESET_MASK - * - \ref SPI_SPIEN_STS_MASK - * - \ref SPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0; - - /* Check busy status */ - if ((u32Mask & SPI_BUSY_MASK) && (spi->STATUS & SPI_STATUS_BUSY_Msk)) - u32Flag |= SPI_BUSY_MASK; - - /* Check RX empty flag */ - if ((u32Mask & SPI_RX_EMPTY_MASK) && (spi->STATUS & SPI_STATUS_RXEMPTY_Msk)) - u32Flag |= SPI_RX_EMPTY_MASK; - - /* Check RX full flag */ - if ((u32Mask & SPI_RX_FULL_MASK) && (spi->STATUS & SPI_STATUS_RXFULL_Msk)) - u32Flag |= SPI_RX_FULL_MASK; - - /* Check TX empty flag */ - if ((u32Mask & SPI_TX_EMPTY_MASK) && (spi->STATUS & SPI_STATUS_TXEMPTY_Msk)) - u32Flag |= SPI_TX_EMPTY_MASK; - - /* Check TX full flag */ - if ((u32Mask & SPI_TX_FULL_MASK) && (spi->STATUS & SPI_STATUS_TXFULL_Msk)) - u32Flag |= SPI_TX_FULL_MASK; - - /* Check TX/RX reset flag */ - if ((u32Mask & SPI_TXRX_RESET_MASK) && (spi->STATUS & SPI_STATUS_TXRXRST_Msk)) - u32Flag |= SPI_TXRX_RESET_MASK; - - /* Check SPIEN flag */ - if ((u32Mask & SPI_SPIEN_STS_MASK) && (spi->STATUS & SPI_STATUS_SPIENSTS_Msk)) - u32Flag |= SPI_SPIEN_STS_MASK; - - /* Check SPIx_SS line status */ - if ((u32Mask & SPI_SSLINE_STS_MASK) && (spi->STATUS & SPI_STATUS_SSLINE_Msk)) - u32Flag |= SPI_SSLINE_STS_MASK; - - return u32Flag; -} - - -/** - * @brief This function is used to get SPII2S source clock frequency. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return SPII2S source clock frequency (Hz). - * @details Return the source clock frequency according to the setting of SPI0SEL (CLKSEL2[25:24]) - */ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s) -{ - uint32_t u32Freq = 0, u32HCLKFreq; - - /* check SPI interface */ - if (i2s != SPI0) return SPI_NONE; - - if (i2s == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - u32Freq = __HXT; /* Clock source is HXT */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - /* Clock source is PCLK0 */ - u32Freq = u32HCLKFreq / ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) + 1); - } - else - u32Freq = 48000000; /* Clock source is HIRC48 */ - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of SPII2S interface for general purpose use. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32MasterSlave SPII2S operation mode. Valid values are listed below. - * - \ref SPII2S_MODE_MASTER - * - \ref SPII2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are listed below. - * - \ref SPII2S_DATABIT_8 - * - \ref SPII2S_DATABIT_16 - * - \ref SPII2S_DATABIT_24 - * - \ref SPII2S_DATABIT_32 - * @param[in] u32Channels Audio format. Valid values are listed below. - * - \ref SPII2S_MONO - * - \ref SPII2S_STEREO - * @param[in] u32DataFormat Data format. Valid values are listed below. - * - \ref SPII2S_FORMAT_I2S - * - \ref SPII2S_FORMAT_MSB - * - \ref SPII2S_FORMAT_PCMA - * - \ref SPII2S_FORMAT_PCMB - * @return Real sample rate of master mode or peripheral clock rate of slave mode. - * @details This function will reset SPI/I2S controller and configure SPII2S controller according to the input parameters. - * Set TX FIFO threshold to 2 and RX FIFO threshold to 1. Both the TX and RX functions will be enabled. - * The actual sample rate may be different from the target sample rate. The real sample rate will be returned for reference. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat) -{ - uint32_t u32Divider; - uint32_t u32BitRate, u32SrcClk; - uint32_t u32HCLKFreq; - - /* check SPI interface */ - if (i2s != SPI0) return SPI_NONE; - - /* Reset SPI/I2S */ - if (i2s == SPI0) - { - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - - /* Configure SPII2S controller */ - i2s->I2SCTL = u32MasterSlave | u32WordWidth | u32Channels | u32DataFormat; - /* Set TX FIFO threshold to 2 and RX FIFO threshold to 1 */ - i2s->FIFOCTL = SPII2S_FIFO_TX_LEVEL_WORD_2 | SPII2S_FIFO_RX_LEVEL_WORD_2; - - if (u32MasterSlave == SPI_MASTER) - { - /* Get the source clock rate */ - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - - /* Calculate the bit clock rate */ - u32BitRate = u32SampleRate * ((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1) * 16; - u32Divider = ((u32SrcClk / u32BitRate) >> 1) - 1; - /* Set BCLKDIV setting */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_BCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_BCLKDIV_Pos); - - /* Calculate bit clock rate */ - u32BitRate = u32SrcClk / ((u32Divider + 1) * 2); - /* Calculate real sample rate */ - u32SampleRate = u32BitRate / (((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1) * 16); - - /* Enable TX function, RX function and SPII2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - - /* Return the real sample rate */ - return u32SampleRate; - } - else - { - /* Set BCLKDIV = 0 */ - i2s->I2SCLK &= ~SPI_I2SCLK_BCLKDIV_Msk; - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Enable TX function, RX function and SPII2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - return (u32HCLKFreq / ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) + 1)); - } -} - -/** - * @brief Disable SPII2S function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details Disable SPII2S function. - */ -void SPII2S_Close(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; -} - -/** - * @brief Enable interrupt function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * @return None - * @details This function enables the interrupt according to the u32Mask parameter. - */ -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Enable TX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - i2s->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - i2s->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - i2s->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - i2s->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - - /* Enable TX underflow interrupt flag */ - if ((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - i2s->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - - /* Enable right channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - i2s->I2SCTL |= SPI_I2SCTL_RZCIEN_Msk; - - /* Enable left channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - i2s->I2SCTL |= SPI_I2SCTL_LZCIEN_Msk; -} - -/** - * @brief Disable interrupt function. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * @return None - * @details This function disables the interrupt according to the u32Mask parameter. - */ -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Disable TX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - - /* Disable TX underflow interrupt flag */ - if ((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - - /* Disable right channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - i2s->I2SCTL &= ~SPI_I2SCTL_RZCIEN_Msk; - - /* Disable left channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - i2s->I2SCTL &= ~SPI_I2SCTL_LZCIEN_Msk; -} - -/** - * @brief Enable master clock (MCLK). - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32BusClock The target MCLK clock rate. - * @return Actual MCLK clock rate - * @details Set the master clock rate according to u32BusClock parameter and enable master clock output. - * The actual master clock rate may be different from the target master clock rate. The real master clock rate will be returned for reference. - */ -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock) -{ - uint32_t u32Divider; - uint32_t u32SrcClk; - - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - if (u32BusClock == u32SrcClk) - u32Divider = 0; - else - { - u32Divider = (u32SrcClk / u32BusClock) >> 1; - /* MCLKDIV is a 7-bit width configuration. The maximum value is 0xFF. */ - if (u32Divider > 0xFF) - u32Divider = 0xFF; - } - - /* Write u32Divider to MCLKDIV (SPI_I2SCLK[5:0]) */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_MCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_MCLKDIV_Pos); - - /* Enable MCLK output */ - i2s->I2SCTL |= SPI_I2SCTL_MCLKEN_Msk; - - if (u32Divider == 0) - return u32SrcClk; /* If MCLKDIV=0, master clock rate is equal to the source clock rate. */ - else - return ((u32SrcClk >> 1) / u32Divider); /* If MCLKDIV>0, master clock rate = source clock rate / (MCLKDIV * 2) */ -} - -/** - * @brief Disable master clock (MCLK). - * @param[in] i2s The pointer of the specified SPII2S module. - * @return None - * @details Clear MCLKEN bit of SPI_I2SCTL register to disable master clock output. - */ -void SPII2S_DisableMCLK(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified SPII2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->FIFOCTL = (i2s->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_sys.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_sys.c deleted file mode 100644 index ee0433c07b8..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_sys.c +++ /dev/null @@ -1,205 +0,0 @@ -/**************************************************************************//** - * @file sys.c - * @version V3.00 - * $Revision: 3 $ - * $Date: 18/07/05 4:42p $ - * @brief M031 Series System Manager (SYS) Driver Source File - * - * @note - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - *****************************************************************************/ -#include "M031Series.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - - -/** @addtogroup SYS_EXPORTED_FUNCTIONS SYS Exported Functions - @{ -*/ - -/** - * @brief Clear reset source - * @param[in] u32Src is reset source. Including : - * - \ref SYS_RSTSTS_CPULKRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_SYSRF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_PORF_Msk - * @return None - * @details This function clear the selected reset source. - */ -void SYS_ClearResetSrc(uint32_t u32Src) -{ - SYS->RSTSTS = u32Src; -} - -/** - * @brief Get Brown-out detector output status - * @param None - * @retval 0 System voltage is higher than BODVL setting or BODEN is 0. - * @retval 1 System voltage is lower than BODVL setting. - * @details This function get Brown-out detector output status. - */ -uint32_t SYS_GetBODStatus(void) -{ - return ((SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) >> SYS_BODCTL_BODOUT_Pos); -} - -/** - * @brief Get reset status register value - * @param None - * @return Reset source - * @details This function get the system reset status register value. - */ -uint32_t SYS_GetResetSrc(void) -{ - return (SYS->RSTSTS); -} - -/** - * @brief Check if register is locked or not - * @param None - * @retval 0 Write-protection function is disabled. - * 1 Write-protection function is enabled. - * @details This function check register write-protection bit setting. - */ -uint32_t SYS_IsRegLocked(void) -{ - return !(SYS->REGLCTL & 0x1); -} - -/** - * @brief Get product ID - * @param None - * @return Product ID - * @details This function get product ID. - */ -uint32_t SYS_ReadPDID(void) -{ - return SYS->PDID; -} - -/** - * @brief Reset chip with chip reset - * @param None - * @return None - * @details This function reset chip with chip reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetChip(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk; -} - -/** - * @brief Reset chip with CPU reset - * @param None - * @return None - * @details This function reset CPU with CPU reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetCPU(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CPURST_Msk; -} - -/** - * @brief Reset selected module - * @param[in] u32ModuleIndex is module index. Including : - * - \ref PDMA_RST - * - \ref EBI_RST - * - \ref HDIV_RST - * - \ref CRC_RST - * - \ref GPIO_RST - * - \ref TMR0_RST - * - \ref TMR1_RST - * - \ref TMR2_RST - * - \ref TMR3_RST - * - \ref ACMP01_RST - * - \ref I2C0_RST - * - \ref I2C1_RST - * - \ref QSPI0_RST - * - \ref SPI0_RST - * - \ref UART0_RST - * - \ref UART1_RST - * - \ref UART2_RST - * - \ref UART3_RST - * - \ref UART4_RST - * - \ref UART5_RST - * - \ref UART6_RST - * - \ref UART7_RST - * - \ref USBD_RST - * - \ref ADC_RST - * - \ref USCI0_RST - * - \ref USCI1_RST - * - \ref PWM0_RST - * - \ref PWM1_RST - * - \ref BPWM0_RST - * - \ref BPWM1_RST - * @return None - * @details This function reset selected module. - */ -void SYS_ResetModule(uint32_t u32ModuleIndex) -{ - /* Generate reset signal to the corresponding module */ - *(volatile uint32_t *)((uint32_t)&SYS->IPRST0 + (u32ModuleIndex >> 24)) |= 1 << (u32ModuleIndex & 0x00ffffff); - - /* Release corresponding module from reset state */ - *(volatile uint32_t *)((uint32_t)&SYS->IPRST0 + (u32ModuleIndex >> 24)) &= ~(1 << (u32ModuleIndex & 0x00ffffff)); -} - - -/** - * @brief Enable and configure Brown-out detector function - * @param[in] i32Mode is reset or interrupt mode. Including : - * - \ref SYS_BODCTL_BOD_RST_EN - * - \ref SYS_BODCTL_BOD_INTERRUPT_EN - * @param[in] u32BODLevel is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_2_5V - * - \ref SYS_BODCTL_BODVL_2_0V - * @return None - * @details This function configure Brown-out detector reset or interrupt mode, enable Brown-out function and set Brown-out voltage level. - * The register write-protection function should be disabled before using this function. - */ -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel) -{ - /* Enable Brown-out Detector function */ - SYS->BODCTL |= SYS_BODCTL_BODEN_Msk; - - /* Enable Brown-out interrupt or reset function */ - SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODRSTEN_Msk) | i32Mode; - - /* Select Brown-out Detector threshold voltage */ - SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | u32BODLevel; -} - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This function disable Brown-out detector function. - * The register write-protection function should be disabled before using this function. - */ -void SYS_DisableBOD(void) -{ - SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk; -} - - - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_timer.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_timer.c deleted file mode 100644 index eb118f8618a..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_timer.c +++ /dev/null @@ -1,333 +0,0 @@ -/**************************************************************************//** - * @file timer.c - * @version V3.00 - * $Revision: 5 $ - * $Date: 18/07/13 5:00p $ - * @brief M031 Series Timer Controller (TIMER) Driver Source File - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Open Timer with Operate Mode and Frequency - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32Mode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * @param[in] u32Freq Target working frequency - * - * @return Real timer working frequency - * - * @details This API is used to configure timer to operate in specified mode and frequency. - * If timer cannot work in target frequency, a closest frequency will be chose and returned. - * @note After calling this API, Timer is \b NOT running yet. But could start timer running be calling - * \ref TIMER_Start macro or program registers directly. - */ -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Cmpr = 0, u32Prescale = 0; - - /* Fastest possible timer working freq is (u32Clk / 2). While cmpr = 2, pre-scale = 0. */ - if(u32Freq >= (u32Clk >> 1)) - { - u32Cmpr = 2; - } - else - { - u32Cmpr = u32Clk / u32Freq; - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if (u32Prescale > 0) - u32Cmpr = u32Cmpr / (u32Prescale + 1); - } - - timer->CTL = u32Mode | u32Prescale; - timer->CMP = u32Cmpr; - - return(u32Clk / (u32Cmpr * (u32Prescale + 1))); -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This API stops timer counting and disable all timer interrupt function. - */ -void TIMER_Close(TIMER_T *timer) -{ - timer->CTL = 0; - timer->EXTCTL = 0; -} - -/** - * @brief Create a specify Delay Time - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32Usec Delay period in micro seconds. Valid values are between 100~1000000 (100 micro second ~ 1 second). - * - * @return None - * - * @details This API is used to create a delay loop for u32Usec micro seconds by using timer one-shot mode. - * @note This API overwrites the register setting of the timer used to count the delay time. - * @note This API use polling mode. So there is no need to enable interrupt for the timer module used to generate delay. - */ -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Prescale = 0, delay = (SystemCoreClock / u32Clk) + 1; - uint32_t u32Cmpr, u32NsecPerTick; - - /* Clear current timer configuration */ - timer->CTL = 0; - timer->EXTCTL = 0; - - if(u32Clk <= 1000000) /* min delay is 1000 us if timer clock source is <= 1 MHz */ - { - if(u32Usec < 1000) - u32Usec = 1000; - if(u32Usec > 1000000) - u32Usec = 1000000; - } - else - { - if(u32Usec < 100) - u32Usec = 100; - if(u32Usec > 1000000) - u32Usec = 1000000; - } - - if(u32Clk <= 1000000) - { - u32Prescale = 0; - u32NsecPerTick = 1000000000 / u32Clk; - u32Cmpr = (u32Usec * 1000) / u32NsecPerTick; - } - else - { - u32Cmpr = u32Usec * (u32Clk / 1000000); - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if (u32Prescale > 0) - u32Cmpr = u32Cmpr / (u32Prescale + 1); - } - - timer->CMP = u32Cmpr; - timer->CTL = TIMER_CTL_CNTEN_Msk | TIMER_ONESHOT_MODE | u32Prescale; - - /* When system clock is faster than timer clock, it is possible timer active bit cannot set in time while we check it. */ - /* And the while loop below return immediately, so put a tiny delay here allowing timer start counting and raise active flag. */ - for(; delay > 0; delay--) - { - __NOP(); - } - - while(timer->CTL & TIMER_CTL_ACTSTS_Msk); -} - -/** - * @brief Enable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32CapMode Timer capture mode. Could be - * - \ref TIMER_CAPTURE_FREE_COUNTING_MODE - * - \ref TIMER_CAPTURE_COUNTER_RESET_MODE - * @param[in] u32Edge Timer capture event trigger edge. Possible values are - * - \ref TIMER_CAPTURE_FALLING_EDGE - * - \ref TIMER_CAPTURE_RISING_EDGE - * - \ref TIMER_CAPTURE_FALLING_AND_RISING_EDGE - * - * @return None - * - * @details This API is used to enable timer capture function with specify capture trigger edge \n - * to get current counter value or reset counter value to 0. - * @note Timer frequency should be configured separately by using \ref TIMER_Open API, or program registers directly. - */ -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~(TIMER_EXTCTL_CAPFUNCS_Msk | TIMER_EXTCTL_CAPEDGE_Msk)) | - u32CapMode | u32Edge | TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Disable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This API is used to disable the timer capture function. - */ -void TIMER_DisableCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32Edge Detection edge of counter pin. Could be ether - * - \ref TIMER_COUNTER_FALLING_EDGE, or - * - \ref TIMER_COUNTER_RISING_EDGE - * - * @return None - * - * @details This function is used to enable the timer counter function with specify detection edge. - * @note Timer compare value should be configured separately by using \ref TIMER_SET_CMP_VALUE macro or program registers directly. - * @note While using event counter function, \ref TIMER_TOGGLE_MODE cannot set as timer operation mode. - */ -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~TIMER_EXTCTL_CNTPHASE_Msk) | u32Edge; - timer->CTL |= TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Disable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - * - * @details This API is used to disable the timer event counter function. - */ -void TIMER_DisableEventCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Get Timer Clock Frequency - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return Timer clock frequency - * - * @details This API is used to get the timer clock frequency. - * @note This API cannot return correct clock rate if timer source is from external clock input. - */ -uint32_t TIMER_GetModuleClock(TIMER_T *timer) -{ - uint32_t u32Src; - const uint32_t au32Clk[] = {__HXT, __LXT, 0, 0, 0, __LIRC, 0, __HIRC}; - - if(timer == TIMER0) - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR0SEL_Msk) >> CLK_CLKSEL1_TMR0SEL_Pos; - else if(timer == TIMER1) - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR1SEL_Msk) >> CLK_CLKSEL1_TMR1SEL_Pos; - else if(timer == TIMER2) - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR2SEL_Msk) >> CLK_CLKSEL1_TMR2SEL_Pos; - else /* Timer 3 */ - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR3SEL_Msk) >> CLK_CLKSEL1_TMR3SEL_Pos; - - if(u32Src == 2) - { - if ((timer == TIMER0) || (timer == TIMER1)) - return CLK_GetPCLK0Freq(); - else - return CLK_GetPCLK1Freq(); - } - - return (au32Clk[u32Src]); -} - -/** - * @brief Enable the Timer Frequency Counter Function - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32DropCount This parameter has no effect in M031 series BSP. - * @param[in] u32Timeout This parameter has no effect in M031 series BSP. - * @param[in] u32EnableInt Enable interrupt assertion after capture complete or not. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function is used to calculate input event frequency. After enable - * this function, a pair of timers, such as TIMER0 and TIMER1, - * will be configured for this function. The mode used to calculate input - * event frequency is mentioned as "Inter Timer Trigger Mode" in Technical - * Reference Manual - */ -void TIMER_EnableFreqCounter(TIMER_T *timer, uint32_t u32DropCount, uint32_t u32Timeout, uint32_t u32EnableInt) -{ - TIMER_T *t; /* store the timer base to configure compare value */ - - t = (timer == TIMER0) ? TIMER1 : TIMER3; - - t->CMP = 0xFFFFFF; - t->EXTCTL = u32EnableInt ? TIMER_EXTCTL_CAPIEN_Msk : 0; - timer->CTL = TIMER_CTL_INTRGEN_Msk | TIMER_CTL_CNTEN_Msk; - - return; -} - -/** - * @brief Disable the Timer Frequency Counter Function - * - * @param[in] timer The pointer of the specified Timer module. - * - * @return None - */ -void TIMER_DisableFreqCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTRGEN_Msk; -} - -/** - * @brief Select Other Modules Triggered Source - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32Src Selects the interrupt source to trigger other modules. Could be: - * - \ref TIMER_TRGSRC_TIMEOUT_EVENT - * - \ref TIMER_TRGSRC_CAPTURE_EVENT - * - * @return None - */ -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src) -{ - timer->CTL = (timer->CTL & ~TIMER_CTL_TRGSSEL_Msk) | u32Src; -} - -/** - * @brief Set Modules Trigger by Timer Interrupt Event - * - * @param[in] timer The pointer of the specified Timer module. - * @param[in] u32Mask The mask of modules (PWM, ADC, BPWM and PDMA) trigger by timer. Is the combination of - * - \ref TIMER_TRG_TO_PWM - * - \ref TIMER_TRG_TO_ADC - * - \ref TIMER_TRG_TO_PDMA - * - \ref TIMER_TRG_TO_BPWM - * - * @return None - */ -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask) -{ - timer->CTL = (timer->CTL & ~(TIMER_CTL_TRGPWM_Msk | TIMER_CTL_TRGADC_Msk | TIMER_CTL_TRGPDMA_Msk | TIMER_CTL_TRGBPWM_Msk)) | (u32Mask); -} - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_uart.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_uart.c deleted file mode 100644 index 9e0336cab10..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_uart.c +++ /dev/null @@ -1,722 +0,0 @@ -/**************************************************************************** - * @file uart.c - * @version V1.00 - * @brief M031 series UART driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -/** - * @brief Clear UART specified interrupt flag - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTSTS_SWBEINT_Msk : Single-wire Bit Error Detect Interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error interrupt - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status interrupt - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status interrupt - * - * @return None - * - * @details The function is used to clear UART specified interrupt flag. - */ - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag) -{ - - - if (u32InterruptFlag & UART_INTSTS_SWBEINT_Msk) /* Clear Bit Error Detection Interrupt */ - { - uart->INTSTS = UART_INTSTS_SWBEIF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_RLSINT_Msk) /* Clear Receive Line Status Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_BIF_Msk | UART_FIFOSTS_FEF_Msk | UART_FIFOSTS_PEF_Msk; - uart->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_MODEMINT_Msk) /* Clear Modem Status Interrupt */ - { - uart->MODEMSTS |= UART_MODEMSTS_CTSDETF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_BUFERRINT_Msk) /* Clear Buffer Error Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_RXOVIF_Msk | UART_FIFOSTS_TXOVIF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_WKINT_Msk) /* Clear Wake-up Interrupt */ - { - uart->WKSTS = UART_WKSTS_CTSWKF_Msk | UART_WKSTS_DATWKF_Msk | - UART_WKSTS_RFRTWKF_Msk | UART_WKSTS_RS485WKF_Msk | - UART_WKSTS_TOUTWKF_Msk; - } - -} - - -/** - * @brief Disable UART interrupt - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART interrupt. - */ -void UART_Close(UART_T *uart) -{ - uart->INTEN = 0ul; -} - - -/** - * @brief Disable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART auto flow control. - */ -void UART_DisableFlowCtrl(UART_T *uart) -{ - uart->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk); -} - - -/** - * @brief Disable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTSTS_SWBEINT_Msk : Single-wire Bit Error Detect Interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to disable UART specified interrupt and disable NVIC UART IRQ. - */ -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Disable UART specified interrupt */ - UART_DISABLE_INT(uart, u32InterruptFlag); - -} - - -/** - * @brief Enable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to Enable UART auto flow control. - */ -void UART_EnableFlowCtrl(UART_T *uart) -{ - /* Set RTS pin output is low level active */ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - - /* Set CTS pin input is low level active */ - uart->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk; - - /* Set RTS and CTS auto flow control enable */ - uart->INTEN |= UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk; -} - - -/** - * @brief The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module: - * - \ref UART_INTSTS_SWBEINT_Msk : Single-wire Bit Error Detect Interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - */ -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Enable UART specified interrupt */ - UART_ENABLE_INT(uart, u32InterruptFlag); - -} - - -/** - * @brief Open and set UART function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The baudrate of UART module. - * - * @return None - * - * @details This function use to enable UART function and set baud-rate. - */ -void UART_Open(UART_T *uart, uint32_t u32baudrate) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - uint32_t u32ClkTbl[6ul] = {__HXT, 0ul, __LXT, __HIRC, 0ul, __LIRC}; - uint32_t u32Baud_Div = 0ul; - - - if (uart == (UART_T *)UART0) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = ((uint32_t)(CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk)) >> CLK_CLKSEL1_UART0SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - } - else if (uart == (UART_T *)UART1) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - } - else if (uart == (UART_T *)UART2) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - } - else if (uart == (UART_T *)UART3) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - } - else if (uart == (UART_T *)UART4) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - } - else if (uart == (UART_T *)UART5) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - } - else if (uart == (UART_T *)UART6) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART6SEL_Msk) >> CLK_CLKSEL3_UART6SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART6DIV_Msk) >> CLK_CLKDIV4_UART6DIV_Pos; - } - else if (uart == (UART_T *)UART7) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART7SEL_Msk) >> CLK_CLKSEL3_UART7SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART7DIV_Msk) >> CLK_CLKDIV4_UART7DIV_Pos; - } - - /* Select UART function */ - uart->FUNCSEL = UART_FUNCSEL_UART; - - /* Set UART line configuration */ - uart->LINE = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1; - - /* Set UART Rx and RTS trigger level */ - uart->FIFO &= ~(UART_FIFO_RFITL_Msk | UART_FIFO_RTSTRGLV_Msk); - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 1ul) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Get PCLK clock frequency if UART clock source selection is PCLK */ - if (u32UartClkSrcSel == 4ul) - { - /* UART Port as UART0 ,UART2, UART4 or UART6 */ - if ((uart == (UART_T *)UART0) || (uart == (UART_T *)UART2) || (uart == (UART_T *)UART4) || (uart == (UART_T *)UART6)) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPCLK0Freq(); - } - else /* UART Port as UART1, UART3, UART5 or UART7*/ - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPCLK1Freq(); - } - - } - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } -} - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive FIFO. - * @param[in] u32ReadBytes The the read bytes number of data. - * - * @return u32Count Receive byte count - * - * @details The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf. - */ -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while (uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - pu8RxBuf[u32Count] = (uint8_t)uart->DAT; /* Get Data from UART RX */ - } - } - - return u32Count; - -} - - -/** - * @brief Set UART line configuration - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The register value of baudrate of UART module. - * If u32baudrate = 0, UART baudrate will not change. - * @param[in] u32data_width The data length of UART module. - * - \ref UART_WORD_LEN_5 - * - \ref UART_WORD_LEN_6 - * - \ref UART_WORD_LEN_7 - * - \ref UART_WORD_LEN_8 - * @param[in] u32parity The parity setting (none/odd/even/mark/space) of UART module. - * - \ref UART_PARITY_NONE - * - \ref UART_PARITY_ODD - * - \ref UART_PARITY_EVEN - * - \ref UART_PARITY_MARK - * - \ref UART_PARITY_SPACE - * @param[in] u32stop_bits The stop bit length (1/1.5/2 bit) of UART module. - * - \ref UART_STOP_BIT_1 - * - \ref UART_STOP_BIT_1_5 - * - \ref UART_STOP_BIT_2 - * - * @return None - * - * @details This function use to config UART line setting. - */ -void UART_SetLine_Config(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - uint32_t u32ClkTbl[6ul] = {__HXT, 0ul, __LXT, __HIRC, 0, __LIRC}; - uint32_t u32Baud_Div = 0ul; - - - if (uart == (UART_T *)UART0) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk) >> CLK_CLKSEL1_UART0SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - } - else if (uart == (UART_T *)UART1) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - } - else if (uart == (UART_T *)UART2) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - } - else if (uart == (UART_T *)UART3) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - } - else if (uart == (UART_T *)UART4) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - } - else if (uart == (UART_T *)UART5) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - } - else if (uart == (UART_T *)UART6) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART6SEL_Msk) >> CLK_CLKSEL3_UART6SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART6DIV_Msk) >> CLK_CLKDIV4_UART6DIV_Pos; - } - else if (uart == (UART_T *)UART7) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART7SEL_Msk) >> CLK_CLKSEL3_UART7SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART7DIV_Msk) >> CLK_CLKDIV4_UART7DIV_Pos; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 1ul) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Get PCLK clock frequency if UART clock source selection is PCLK */ - if (u32UartClkSrcSel == 4ul) - { - if ((uart == (UART_T *)UART0) || (uart == (UART_T *)UART2) || (uart == (UART_T *)UART4) || (uart == (UART_T *)UART6)) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPCLK0Freq(); - } - else /* UART Port as UART1, UART3, UART5, UART7*/ - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPCLK1Freq(); - } - } - - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } - - /* Set UART line configuration */ - uart->LINE = u32data_width | u32parity | u32stop_bits; -} - - -/** - * @brief Set Rx timeout count - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32TOC Rx timeout counter. - * - * @return None - * - * @details This function use to set Rx timeout count. - */ -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC) -{ - /* Set time-out interrupt comparator */ - uart->TOUT = (uart->TOUT & ~UART_TOUT_TOIC_Msk) | (u32TOC); - - /* Set time-out counter enable */ - uart->INTEN |= UART_INTEN_TOCNTEN_Msk; -} - - -/** - * @brief Select and configure IrDA function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Buadrate The baudrate of UART module. - * @param[in] u32Direction The direction of UART module in IrDA mode: - * - \ref UART_IRDA_TXEN - * - \ref UART_IRDA_RXEN - * - * @return None - * - * @details The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate. - */ -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - uint32_t u32ClkTbl[6ul] = {__HXT, 0ul, __LXT, __HIRC, 0ul, __LIRC}; - uint32_t u32Baud_Div; - - /* Select IrDA function mode */ - uart->FUNCSEL = UART_FUNCSEL_IrDA; - - - if (uart == UART0) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk) >> CLK_CLKSEL1_UART0SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - } - else if (uart == UART1) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - } - else if (uart == UART2) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - } - else if (uart == UART3) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - } - else if (uart == UART4) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - } - else if (uart == UART5) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - } - else if (uart == UART6) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART6SEL_Msk) >> CLK_CLKSEL3_UART6SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART6DIV_Msk) >> CLK_CLKDIV4_UART6DIV_Pos; - } - else if (uart == UART7) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART7SEL_Msk) >> CLK_CLKSEL3_UART7SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART7DIV_Msk) >> CLK_CLKDIV4_UART7DIV_Pos; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 1ul) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Get PCLK clock frequency if UART clock source selection is PCLK */ - if (u32UartClkSrcSel == 4ul) - { - if ((uart == (UART_T *)UART0) || (uart == (UART_T *)UART2) || (uart == (UART_T *)UART4) || (uart == (UART_T *)UART6)) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPCLK0Freq(); - } - else /* UART Port as UART1, UART3, UART5, UART7*/ - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPCLK1Freq(); - } - } - - - /* Set UART IrDA baud rate in mode 0 */ - if (u32Buadrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32Buadrate); - - if (u32Baud_Div < 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | u32Baud_Div); - } - else - { - } - } - - /* Configure IrDA relative settings */ - if (u32Direction == UART_IRDA_RXEN) - { - uart->IRDA |= UART_IRDA_RXINV_Msk; /*Rx signal is inverse*/ - uart->IRDA &= ~UART_IRDA_TXEN_Msk; - } - else - { - uart->IRDA &= ~UART_IRDA_TXINV_Msk; /*Tx signal is not inverse*/ - uart->IRDA |= UART_IRDA_TXEN_Msk; - } - -} - - -/** - * @brief Select and configure RS485 function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The operation mode(NMM/AUD/AAD). - * - \ref UART_ALTCTL_RS485NMM_Msk - * - \ref UART_ALTCTL_RS485AUD_Msk - * - \ref UART_ALTCTL_RS485AAD_Msk - * @param[in] u32Addr The RS485 address. - * - * @return None - * - * @details The function is used to set RS485 relative setting. - */ -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr) -{ - /* Select UART RS485 function mode */ - uart->FUNCSEL = UART_FUNCSEL_RS485; - - /* Set RS485 configuration */ - uart->ALTCTL &= ~(UART_ALTCTL_RS485NMM_Msk | UART_ALTCTL_RS485AUD_Msk | UART_ALTCTL_RS485AAD_Msk | UART_ALTCTL_ADDRMV_Msk); - uart->ALTCTL |= (u32Mode | (u32Addr << UART_ALTCTL_ADDRMV_Pos)); -} - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8TxBuf The buffer to send the data to UART transmission FIFO. - * @param[out] u32WriteBytes The byte number of data. - * - * @return u32Count transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by UART. - */ -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - - while (uart->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) /* Check Tx Full */ - { - u32delayno++; - - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - uart->DAT = pu8TxBuf[u32Count]; /* Send UART Data from buffer */ - } - } - - return u32Count; - -} -/** - * @brief Select Single Wire mode function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to select Single Wire mode. - */ -void UART_SelectSingleWireMode(UART_T *uart) -{ - - /* Select UART SingleWire function mode */ - uart->FUNCSEL = ((uart->FUNCSEL & (~UART_FUNCSEL_FUNCSEL_Msk)) | UART_FUNCSEL_SINGLE_WIRE); - -} - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usbd.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usbd.c deleted file mode 100644 index d4b52db39b0..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usbd.c +++ /dev/null @@ -1,705 +0,0 @@ -/**************************************************************************//** - * @file usbd.c - * @version V1.00 - * $Revision: 5 $ - * $Date: 18/06/12 9:23a $ - * @brief M031 series USBD driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - - -/** @addtogroup USBD_EXPORTED_FUNCTIONS USBD Exported Functions - @{ -*/ - -/* Global variables for Control Pipe */ -uint8_t g_usbd_SetupPacket[8] = {0ul}; /*!< Setup packet buffer */ -volatile uint8_t g_usbd_RemoteWakeupEn = 0ul; /*!< Remote wake up function enable flag */ - -/** - * @cond HIDDEN_SYMBOLS - */ -static uint8_t *g_usbd_CtrlInPointer = 0; -static uint8_t *g_usbd_CtrlOutPointer = 0; -static volatile uint32_t g_usbd_CtrlInSize = 0ul; -static volatile uint32_t g_usbd_CtrlOutSize = 0ul; -static volatile uint32_t g_usbd_CtrlOutSizeLimit = 0ul; -static volatile uint32_t g_usbd_UsbAddr = 0ul; -static volatile uint32_t g_usbd_UsbConfig = 0ul; -static volatile uint32_t g_usbd_CtrlMaxPktSize = 8ul; -static volatile uint32_t g_usbd_UsbAltInterface = 0ul; -static volatile uint8_t g_usbd_CtrlInZeroFlag = 0ul; -/** - * @endcond - */ - -const S_USBD_INFO_T *g_usbd_sInfo; /*!< A pointer for USB information structure */ - -VENDOR_REQ g_usbd_pfnVendorRequest = NULL; /*!< USB Vendor Request Functional Pointer */ -CLASS_REQ g_usbd_pfnClassRequest = NULL; /*!< USB Class Request Functional Pointer */ -SET_INTERFACE_REQ g_usbd_pfnSetInterface = NULL; /*!< USB Set Interface Functional Pointer */ -SET_CONFIG_CB g_usbd_pfnSetConfigCallback = NULL; /*!< USB Set configuration callback function pointer */ -uint32_t g_u32EpStallLock = 0ul; /*!< Bit map flag to lock specified EP when SET_FEATURE */ - -/** - * @brief This function makes USBD module to be ready to use - * - * @param[in] param The structure of USBD information. - * @param[in] pfnClassReq USB Class request callback function. - * @param[in] pfnSetInterface USB Set Interface request callback function. - * - * @return None - * - * @details This function will enable USB controller, USB PHY transceiver and pull-up resistor of USB_D+ pin. USB PHY will drive SE0 to bus. - */ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface) -{ - g_usbd_sInfo = param; - g_usbd_pfnClassRequest = pfnClassReq; - g_usbd_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - g_usbd_CtrlMaxPktSize = g_usbd_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ - USBD->ATTR = 0x6D0ul; - /* Force SE0 */ - USBD_SET_SE0(); -} - -/** - * @brief This function makes USB host to recognize the device - * - * @param None - * - * @return None - * - * @details Enable WAKEUP, FLDET, USB and BUS interrupts. Disable software-disconnect function after 100ms delay with SysTick timer. - */ -void USBD_Start(void) -{ - /* Disable software-disconnect function */ - USBD_CLR_SE0(); - USBD->ATTR = 0x7D0ul; - - /* Clear USB-related interrupts before enable interrupt */ - USBD_CLR_INT_FLAG(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); - - /* Enable USB-related interrupts. */ - USBD_ENABLE_INT(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); -} - -/** - * @brief Get the received SETUP packet - * - * @param[in] buf A buffer pointer used to store 8-byte SETUP packet. - * - * @return None - * - * @details Store SETUP packet to a user-specified buffer. - * - */ -void USBD_GetSetupPacket(uint8_t *buf) -{ - USBD_MemCopy(buf, g_usbd_SetupPacket, 8ul); -} - -/** - * @brief Process SETUP packet - * - * @param None - * - * @return None - * - * @details Parse SETUP packet and perform the corresponding action. - * - */ -void USBD_ProcessSetupPacket(void) -{ - /* Get SETUP packet from USB buffer */ - USBD_MemCopy(g_usbd_SetupPacket, (uint8_t *)USBD_BUF_BASE, 8ul); - - /* Check the request type */ - switch(g_usbd_SetupPacket[0] & 0x60ul) - { - case REQ_STANDARD: - { - USBD_StandardRequest(); - break; - } - case REQ_CLASS: - { - if(g_usbd_pfnClassRequest != NULL) - { - g_usbd_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: - { - if(g_usbd_pfnVendorRequest != NULL) - { - g_usbd_pfnVendorRequest(); - } - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } -} - -/** - * @brief Process GetDescriptor request - * - * @param None - * - * @return None - * - * @details Parse GetDescriptor request and perform the corresponding action. - * - */ -void USBD_GetDescriptor(void) -{ - uint32_t u32Len; - - u32Len = 0ul; - u32Len = g_usbd_SetupPacket[7]; - u32Len <<= 8ul; - u32Len += g_usbd_SetupPacket[6]; - - switch(g_usbd_SetupPacket[3]) - { - /* Get Device Descriptor */ - case DESC_DEVICE: - { - u32Len = USBD_Minimum(u32Len, (uint32_t)LEN_DEVICE); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8DevDesc, u32Len); - break; - } - /* Get Configuration Descriptor */ - case DESC_CONFIG: - { - uint32_t u32TotalLen; - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8); - u32Len = USBD_Minimum(u32Len, u32TotalLen); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8ConfigDesc, u32Len); - break; - } - - /* Get BOS Descriptor */ - case DESC_BOS: - { - if(g_usbd_sInfo->gu8BosDesc) - { - u32Len = USBD_Minimum(u32Len, LEN_BOS+LEN_BOSCAP); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8BosDesc, u32Len); - } - else - { - /* Not support. Reply STALL. */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - } - - break; - } - /* Get HID Descriptor */ - case DESC_HID: - { - /* CV3.0 HID Class Descriptor Test, - Need to indicate index of the HID Descriptor within gu8ConfigDescriptor, specifically HID Composite device. */ - uint32_t u32ConfigDescOffset; /* u32ConfigDescOffset is configuration descriptor offset (HID descriptor start index) */ - u32Len = USBD_Minimum(u32Len, LEN_HID); - u32ConfigDescOffset = g_usbd_sInfo->gu32ConfigHidDescIdx[g_usbd_SetupPacket[4]]; - USBD_PrepareCtrlIn((uint8_t *)&g_usbd_sInfo->gu8ConfigDesc[u32ConfigDescOffset], u32Len); - break; - } - /* Get Report Descriptor */ - case DESC_HID_RPT: - { - u32Len = USBD_Minimum(u32Len, g_usbd_sInfo->gu32HidReportSize[g_usbd_SetupPacket[4]]); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8HidReportDesc[g_usbd_SetupPacket[4]], u32Len); - break; - } - /* Get String Descriptor */ - case DESC_STRING: - { - /* Get String Descriptor */ - if(g_usbd_SetupPacket[2] < 4ul) - { - u32Len = USBD_Minimum(u32Len, g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]][0]); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]], u32Len); - break; - } - else - { - /* Not support. Reply STALL. */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - default: - /* Not support. Reply STALL.*/ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } -} - -/** - * @brief Process standard request - * - * @param None - * - * @return None - * - * @details Parse standard request and perform the corresponding action. - * - */ -void USBD_StandardRequest(void) -{ - uint32_t addr; - /* clear global variables for new request */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - - if((g_usbd_SetupPacket[0] & 0x80ul) == 0x80ul) /* request data transfer direction */ - { - /* Device to host */ - switch(g_usbd_SetupPacket[1]) - { - case GET_CONFIGURATION: - { - /* Return current configuration setting */ - /* Data stage */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)g_usbd_UsbConfig; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - case GET_DESCRIPTOR: - { - USBD_GetDescriptor(); - USBD_PrepareCtrlOut(0, 0ul); /* For status stage */ - break; - } - case GET_INTERFACE: - { - /* Return current interface setting */ - /* Data stage */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)g_usbd_UsbAltInterface; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - case GET_STATUS: - { - /* Device */ - if(g_usbd_SetupPacket[0] == 0x80ul) - { - uint8_t u8Tmp; - - u8Tmp = (uint8_t)0ul; - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x40ul) == 0x40ul) - { - u8Tmp |= (uint8_t)1ul; /* Self-Powered/Bus-Powered.*/ - } - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x20ul) == 0x20ul) - { - u8Tmp |= (uint8_t)(g_usbd_RemoteWakeupEn << 1ul); /* Remote wake up */ - } - - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = u8Tmp; - } - /* Interface */ - else if(g_usbd_SetupPacket[0] == 0x81ul) - { - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)0ul; - } - /* Endpoint */ - else if(g_usbd_SetupPacket[0] == 0x82ul) - { - uint8_t ep = (uint8_t)(g_usbd_SetupPacket[4] & 0xFul); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)(USBD_GetStall(ep) ? 1ul : 0ul); - } - - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0) + 1ul; - M8(addr) = (uint8_t)0ul; - /* Data stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 2ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } - else - { - /* Host to device */ - switch(g_usbd_SetupPacket[1]) - { - case CLEAR_FEATURE: - { - if(g_usbd_SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - uint32_t epNum, i; - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_u32EpStallLock is added to support it */ - epNum = (uint8_t)(g_usbd_SetupPacket[4] & 0xFul); - for(i = 0ul; i < USBD_MAX_EP; i++) - { - if(((USBD->EP[i].CFG & 0xFul) == epNum) && ((g_u32EpStallLock & (1ul << i)) == 0ul)) - { - USBD->EP[i].CFGP &= ~USBD_CFGP_SSTALL_Msk; - } - } - } - else if(g_usbd_SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_usbd_RemoteWakeupEn = (uint8_t)0; - } - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_ADDRESS: - { - g_usbd_UsbAddr = g_usbd_SetupPacket[2]; - /* Status Stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - - break; - } - case SET_CONFIGURATION: - { - g_usbd_UsbConfig = g_usbd_SetupPacket[2]; - - if(g_usbd_pfnSetConfigCallback) - { - g_usbd_pfnSetConfigCallback(); - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_FEATURE: - { - if(g_usbd_SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - USBD_SetStall((uint8_t)(g_usbd_SetupPacket[4] & 0xFul)); - } - else if(g_usbd_SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_usbd_RemoteWakeupEn = (uint8_t)1ul; - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - - break; - } - case SET_INTERFACE: - { - g_usbd_UsbAltInterface = g_usbd_SetupPacket[2]; - if(g_usbd_pfnSetInterface != NULL) - { - g_usbd_pfnSetInterface(g_usbd_UsbAltInterface); - } - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } -} - -/** - * @brief Prepare the first Control IN pipe - * - * @param[in] pu8Buf The pointer of data sent to USB host. - * @param[in] u32Size The IN transfer size. - * - * @return None - * - * @details Prepare data for Control IN transfer. - * - */ -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size) -{ - uint32_t addr; - if(u32Size > g_usbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - g_usbd_CtrlInPointer = pu8Buf + g_usbd_CtrlMaxPktSize; - g_usbd_CtrlInSize = u32Size - g_usbd_CtrlMaxPktSize; - USBD_SET_DATA1(EP0); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, pu8Buf, g_usbd_CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlMaxPktSize); - } - else - { - /* Data size <= MXPLD */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - if (u32Size == g_usbd_CtrlMaxPktSize) - g_usbd_CtrlInZeroFlag = 1ul; - USBD_SET_DATA1(EP0); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, pu8Buf, u32Size); - USBD_SET_PAYLOAD_LEN(EP0, u32Size); - } -} - -/** - * @brief Repeat Control IN pipe - * - * @param None - * - * @return None - * - * @details This function processes the remained data of Control IN transfer. - * - */ -void USBD_CtrlIn(void) -{ - uint32_t addr; - - if(g_usbd_CtrlInSize) - { - /* Process remained data */ - if(g_usbd_CtrlInSize > g_usbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, (uint8_t *)g_usbd_CtrlInPointer, g_usbd_CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlMaxPktSize); - g_usbd_CtrlInPointer += g_usbd_CtrlMaxPktSize; - g_usbd_CtrlInSize -= g_usbd_CtrlMaxPktSize; - } - else - { - /* Data size <= MXPLD */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, (uint8_t *)g_usbd_CtrlInPointer, g_usbd_CtrlInSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlInSize); - if(g_usbd_CtrlInSize == g_usbd_CtrlMaxPktSize) - g_usbd_CtrlInZeroFlag = 1ul; - g_usbd_CtrlInPointer = 0ul; - g_usbd_CtrlInSize = 0ul; - } - } - else - { - /* In ACK for Set address */ - if((g_usbd_SetupPacket[0] == REQ_STANDARD) && (g_usbd_SetupPacket[1] == SET_ADDRESS)) - { - addr = USBD_GET_ADDR(); - if((addr != g_usbd_UsbAddr) && (addr == 0ul)) - USBD_SET_ADDR(g_usbd_UsbAddr); - } - - /* For the case of data size is integral times maximum packet size */ - if (g_usbd_CtrlInZeroFlag) - { - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - g_usbd_CtrlInZeroFlag = 0ul; - } - } -} - -/** - * @brief Prepare the first Control OUT pipe - * - * @param[in] pu8Buf The pointer of data received from USB host. - * @param[in] u32Size The OUT transfer size. - * - * @return None - * - * @details This function is used to prepare the first Control OUT transfer. - * - */ -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size) -{ - g_usbd_CtrlOutPointer = pu8Buf; - g_usbd_CtrlOutSize = 0ul; - g_usbd_CtrlOutSizeLimit = u32Size; - USBD_SET_PAYLOAD_LEN(EP1, g_usbd_CtrlMaxPktSize); -} - -/** - * @brief Repeat Control OUT pipe - * - * @param None - * - * @return None - * - * @details This function processes the successive Control OUT transfer. - * - */ -void USBD_CtrlOut(void) -{ - uint32_t u32Size; - uint32_t addr; - - if(g_usbd_CtrlOutSize < g_usbd_CtrlOutSizeLimit) - { - u32Size = USBD_GET_PAYLOAD_LEN(EP1); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP1); - USBD_MemCopy((uint8_t *)g_usbd_CtrlOutPointer, (uint8_t *)addr, u32Size); - g_usbd_CtrlOutPointer += u32Size; - g_usbd_CtrlOutSize += u32Size; - - if(g_usbd_CtrlOutSize < g_usbd_CtrlOutSizeLimit) - { - USBD_SET_PAYLOAD_LEN(EP1, g_usbd_CtrlMaxPktSize); - } - - } -} - -/** - * @brief Reset software flags - * - * @param None - * - * @return None - * - * @details This function resets all variables for protocol and resets USB device address to 0. - * - */ -void USBD_SwReset(void) -{ - uint32_t i; - - /* Reset all variables for protocol */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - g_usbd_CtrlOutPointer = 0; - g_usbd_CtrlOutSize = 0ul; - g_usbd_CtrlOutSizeLimit = 0ul; - g_u32EpStallLock = 0ul; - memset(g_usbd_SetupPacket, 0, 8ul); - - /* Reset PID DATA0 */ - for(i=0ul; iEP[i].CFG &= ~USBD_CFG_DSQSYNC_Msk; - } - - /* Reset USB device address */ - USBD_SET_ADDR(0ul); -} - -/** - * @brief USBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set USBD vendor request callback function - */ -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq) -{ - g_usbd_pfnVendorRequest = pfnVendorReq; -} - -/** - * @brief The callback function which called when get SET CONFIGURATION request - * - * @param[in] pfnSetConfigCallback Callback function pointer for SET CONFIGURATION request - * - * @return None - * - * @details This function is used to set the callback function which will be called at SET CONFIGURATION request. - */ -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback) -{ - g_usbd_pfnSetConfigCallback = pfnSetConfigCallback; -} - - -/** - * @brief EP stall lock function to avoid stall clear by USB SET FEATURE request. - * - * @param[in] u32EpBitmap Use bitmap to select which endpoints will be locked - * - * @return None - * - * @details This function is used to lock relative endpoint to avoid stall clear by SET FEATURE request. - * If ep stall locked, user needs to reset USB device or re-configure device to clear it. - */ -void USBD_LockEpStall(uint32_t u32EpBitmap) -{ - g_u32EpStallLock = u32EpBitmap; -} - - -/*@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_i2c.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_i2c.c deleted file mode 100644 index bdc89a9c1c0..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_i2c.c +++ /dev/null @@ -1,1689 +0,0 @@ -/**************************************************************************//** - * @file usci_i2c.c - * @version V1.00 - * @brief M031 series USCI I2C(UI2C) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This function makes USCI_I2C module be ready and set the wanted bus clock - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Enable USCI_I2C module and configure USCI_I2C module(bus clock, data format). - */ -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if (ui2c == UI2C0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32ClkDiv = (uint32_t)((((((u32Pclk / 2U) * 10U) / (u32BusClock)) + 5U) / 10U) - 1U); /* Compute proper divider for USCI_I2C clock */ - - /* Enable USCI_I2C protocol */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; - ui2c->CTL = 4U << UI2C_CTL_FUNMODE_Pos; - - /* Data format configuration */ - /* 8 bit data length */ - ui2c->LINECTL &= ~UI2C_LINECTL_DWIDTH_Msk; - ui2c->LINECTL |= 8U << UI2C_LINECTL_DWIDTH_Pos; - - /* MSB data format */ - ui2c->LINECTL &= ~UI2C_LINECTL_LSB_Msk; - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - ui2c->PROTCTL |= UI2C_PROTCTL_PROTEN_Msk; - - return (u32Pclk / ((u32ClkDiv + 1U) << 1U)); -} - -/** - * @brief This function closes the USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Close USCI_I2C protocol function. - */ -void UI2C_Close(UI2C_T *ui2c) -{ - /* Disable USCI_I2C function */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; -} - -/** - * @brief This function clears the time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Clear time-out flag when time-out flag is set. - */ -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c) -{ - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; -} - -/** - * @brief This function sets the control bit of the USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Start Set START bit to USCI_I2C module. - * @param[in] u8Stop Set STOP bit to USCI_I2C module. - * @param[in] u8Ptrg Set PTRG bit to USCI_I2C module. - * @param[in] u8Ack Set ACK bit to USCI_I2C module. - * - * @return None - * - * @details The function set USCI_I2C control bit of USCI_I2C bus protocol. - */ -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - uint32_t u32Val = ui2c->PROTCTL & ~(UI2C_PROTCTL_STA_Msk | UI2C_PROTCTL_STO_Msk | UI2C_PROTCTL_AA_Msk); - - if (u8Start) - { - u32Reg |= UI2C_PROTCTL_STA_Msk; - } - - if (u8Stop) - { - u32Reg |= UI2C_PROTCTL_STO_Msk; - } - - if (u8Ptrg) - { - u32Reg |= UI2C_PROTCTL_PTRG_Msk; - } - - if (u8Ack) - { - u32Reg |= UI2C_PROTCTL_AA_Msk; - } - - ui2c->PROTCTL = u32Val | u32Reg; -} - -/** - * @brief This function disables the interrupt of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to an interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details The function is used to disable USCI_I2C bus interrupt events. - */ -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Disable time-out interrupt flag */ - if ((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_TOIEN_Msk; - } - - /* Disable start condition received interrupt flag */ - if ((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STARIEN_Msk; - } - - /* Disable stop condition received interrupt flag */ - if ((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STORIEN_Msk; - } - - /* Disable non-acknowledge interrupt flag */ - if ((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_NACKIEN_Msk; - } - - /* Disable arbitration lost interrupt flag */ - if ((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ARBLOIEN_Msk; - } - - /* Disable error interrupt flag */ - if ((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ERRIEN_Msk; - } - - /* Disable acknowledge interrupt flag */ - if ((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function enables the interrupt of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * @return None - * - * @details The function is used to enable USCI_I2C bus interrupt events. - */ -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Enable time-out interrupt flag */ - if ((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_TOIEN_Msk; - } - - /* Enable start condition received interrupt flag */ - if ((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STARIEN_Msk; - } - - /* Enable stop condition received interrupt flag */ - if ((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STORIEN_Msk; - } - - /* Enable non-acknowledge interrupt flag */ - if ((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_NACKIEN_Msk; - } - - /* Enable arbitration lost interrupt flag */ - if ((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ARBLOIEN_Msk; - } - - /* Enable error interrupt flag */ - if ((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ERRIEN_Msk; - } - - /* Enable acknowledge interrupt flag */ - if ((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function returns the real bus clock of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details The function returns the actual USCI_I2C module bus clock. - */ -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c) -{ - uint32_t u32Divider; - uint32_t u32Pclk; - - if (ui2c == UI2C0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32Divider = (ui2c->BRGEN & UI2C_BRGEN_CLKDIV_Msk) >> UI2C_BRGEN_CLKDIV_Pos; - - return (u32Pclk / ((u32Divider + 1U) << 1U)); -} - -/** - * @brief This function sets bus clock frequency of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Use this function set USCI_I2C bus clock frequency and return actual bus clock. - */ -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if (ui2c == UI2C0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32ClkDiv = (uint32_t)((((((u32Pclk / 2U) * 10U) / (u32BusClock)) + 5U) / 10U) - 1U); /* Compute proper divider for USCI_I2C clock */ - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - - return (u32Pclk / ((u32ClkDiv + 1U) << 1U)); -} - -/** - * @brief This function gets the interrupt flag of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details Use this function to get USCI_I2C interrupt flag when module occurs interrupt event. - */ -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U; - uint32_t u32TmpValue; - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_TOIF_Msk; - - /* Check Time-out Interrupt Flag */ - if ((u32Mask & UI2C_TO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_TO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STARIF_Msk; - - /* Check Start Condition Received Interrupt Flag */ - if ((u32Mask & UI2C_STAR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STAR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STORIF_Msk; - - /* Check Stop Condition Received Interrupt Flag */ - if ((u32Mask & UI2C_STOR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STOR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_NACKIF_Msk; - - /* Check Non-Acknowledge Interrupt Flag */ - if ((u32Mask & UI2C_NACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_NACK_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ARBLOIF_Msk; - - /* Check Arbitration Lost Interrupt Flag */ - if ((u32Mask & UI2C_ARBLO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ARBLO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ERRIF_Msk; - - /* Check Error Interrupt Flag */ - if ((u32Mask & UI2C_ERR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ERR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ACKIF_Msk; - - /* Check Acknowledge Interrupt Flag */ - if ((u32Mask & UI2C_ACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ACK_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief This function clears the interrupt flag of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details Use this function to clear USCI_I2C interrupt flag when module occurs interrupt event and set flag. - */ -void UI2C_ClearIntFlag(UI2C_T *ui2c , uint32_t u32Mask) -{ - /* Clear Time-out Interrupt Flag */ - if (u32Mask & UI2C_TO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; - } - - /* Clear Start Condition Received Interrupt Flag */ - if (u32Mask & UI2C_STAR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STARIF_Msk; - } - - /* Clear Stop Condition Received Interrupt Flag */ - if (u32Mask & UI2C_STOR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STORIF_Msk; - } - - /* Clear Non-Acknowledge Interrupt Flag */ - if (u32Mask & UI2C_NACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_NACKIF_Msk; - } - - /* Clear Arbitration Lost Interrupt Flag */ - if (u32Mask & UI2C_ARBLO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ARBLOIF_Msk; - } - - /* Clear Error Interrupt Flag */ - if (u32Mask & UI2C_ERR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ERRIF_Msk; - } - - /* Clear Acknowledge Interrupt Flag */ - if (u32Mask & UI2C_ACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ACKIF_Msk; - } -} - -/** - * @brief This function returns the data stored in data register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return USCI_I2C data. - * - * @details To read a byte data from USCI_I2C module receive data register. - */ -uint32_t UI2C_GetData(UI2C_T *ui2c) -{ - return (ui2c->RXDAT); -} - -/** - * @brief This function writes a byte data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details To write a byte data to transmit data register to transmit data. - */ -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data) -{ - ui2c->TXDAT = u8Data; -} - -/** - * @brief Configure slave address and enable GC mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channel number [0/1] - * @param[in] u16SlaveAddr The slave address. - * @param[in] u8GCMode GC mode enable or not. Valid values are: - * - \ref UI2C_GCMODE_ENABLE - * - \ref UI2C_GCMODE_DISABLE - * - * @return None - * - * @details To configure USCI_I2C module slave address and GC mode. - */ -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) -{ - if (u8SlaveNo) - { - ui2c->DEVADDR1 = u16SlaveAddr; - } - else - { - ui2c->DEVADDR0 = u16SlaveAddr; - } - - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_GCFUNC_Msk) | u8GCMode; -} - -/** - * @brief Configure the mask bit of slave address. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channel number [0/1] - * @param[in] u16SlaveAddrMask The slave address mask. - * - * @return None - * - * @details To configure USCI_I2C module slave address mask bit. - * @note The corresponding address bit is "Don't Care". - */ -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) -{ - if (u8SlaveNo) - { - ui2c->ADDRMSK1 = u16SlaveAddrMask; - } - else - { - ui2c->ADDRMSK0 = u16SlaveAddrMask; - } -} - -/** - * @brief This function enables time-out function and configures timeout counter - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32TimeoutCnt Timeout counter. Valid values are between 0~0x3FF - * - * @return None - * - * @details To enable USCI_I2C bus time-out function and set time-out counter. - */ -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt) -{ - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_TOCNT_Msk) | (u32TimeoutCnt << UI2C_PROTCTL_TOCNT_Pos); - ui2c->BRGEN = (ui2c->BRGEN & ~UI2C_BRGEN_TMCNTSRC_Msk) | UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function disables time-out function - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C bus time-out function. - */ -void UI2C_DisableTimeout(UI2C_T *ui2c) -{ - ui2c->PROTCTL &= ~UI2C_PROTCTL_TOCNT_Msk; - ui2c->BRGEN &= ~UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function enables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8WakeupMode The wake-up mode selection. Valid values are: - * - \ref UI2C_DATA_TOGGLE_WK - * - \ref UI2C_ADDR_MATCH_WK - * - * @return None - * - * @details To enable USCI_I2C module wake-up function. - */ -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode) -{ - ui2c->WKCTL = (ui2c->WKCTL & ~UI2C_WKCTL_WKADDREN_Msk) | (u8WakeupMode | UI2C_WKCTL_WKEN_Msk); -} - -/** - * @brief This function disables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C module wake-up function. - */ -void UI2C_DisableWakeup(UI2C_T *ui2c) -{ - ui2c->WKCTL &= ~UI2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Write a byte to Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master write a byte data to Slave. - * - */ - -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, const uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master write multi bytes data to Slave. - * - */ - -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, const uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, const uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, const uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - if (u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, const uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 2U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify two bytes address that multi data write to in Slave. - * - */ - -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, const uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u8Addr = 0; - } - else - { - if (u32txLen < u32wLen) - { - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master to read a byte data from Slave. - * - */ -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - eEvent = MASTER_READ_DATA; - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Err = 1U; - } - else - { - rdata = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; - - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < (u32rLen - 1U)) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - /* SLA+R ACK */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address(2 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Addr = 1U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/*@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_spi.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_spi.c deleted file mode 100644 index ee91b5fb2aa..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_spi.c +++ /dev/null @@ -1,635 +0,0 @@ -/****************************************************************************//** - * @file usci_spi.c - * @version V1.00 - * @brief M031 series USCI_SPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief This function make USCI_SPI module be ready to transfer. - * By default, the USCI_SPI transfer sequence is MSB first, the slave selection - * signal is active low and the automatic slave select function is disabled. In - * Slave mode, the u32BusClock must be NULL and the USCI_SPI clock - * divider setting will be 0. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32MasterSlave Decide the USCI_SPI module is operating in master mode or in slave mode. Valid values are: - * - \ref USPI_SLAVE - * - \ref USPI_MASTER - * @param[in] u32SPIMode Decide the transfer timing. Valid values are: - * - \ref USPI_MODE_0 - * - \ref USPI_MODE_1 - * - \ref USPI_MODE_2 - * - \ref USPI_MODE_3 - * @param[in] u32DataWidth The data width of a USCI_SPI transaction. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock in Hz. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv = 0UL; - uint32_t u32Pclk; - uint32_t u32RetValue = 0UL; - - if (uspi == USPI0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - if(u32BusClock != 0UL) - { - u32ClkDiv = (uint32_t)((((((u32Pclk / 2UL) * 10UL) / (u32BusClock)) + 5UL) / 10UL) - 1UL); /* Compute proper divider for USCI_SPI clock */ - } - - /* Enable USCI_SPI protocol */ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; - uspi->CTL = 1UL << USPI_CTL_FUNMODE_Pos; - - /* Data format configuration */ - if(u32DataWidth == 16UL) - { - u32DataWidth = 0UL; - } - uspi->LINECTL &= ~USPI_LINECTL_DWIDTH_Msk; - uspi->LINECTL |= (u32DataWidth << USPI_LINECTL_DWIDTH_Pos); - - /* MSB data format */ - uspi->LINECTL &= ~USPI_LINECTL_LSB_Msk; - - /* Set slave selection signal active low */ - if(u32MasterSlave == USPI_MASTER) - { - uspi->LINECTL |= USPI_LINECTL_CTLOINV_Msk; - } - else - { - uspi->CTLIN0 |= USPI_CTLIN0_ININV_Msk; - } - - /* Set operating mode and transfer timing */ - uspi->PROTCTL &= ~(USPI_PROTCTL_SCLKMODE_Msk | USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SLAVE_Msk); - uspi->PROTCTL |= (u32MasterSlave | u32SPIMode); - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - uspi->PROTCTL |= USPI_PROTCTL_PROTEN_Msk; - - if(u32BusClock != 0UL) - { - u32RetValue = (u32Pclk / ((u32ClkDiv + 1UL) << 1UL)); - } - else - { - u32RetValue = 0UL; - } - - return u32RetValue; -} - -/** - * @brief Disable USCI_SPI function mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_Close(USPI_T *uspi) -{ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; -} - -/** - * @brief Clear Rx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearRxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_RXCLR_Msk; -} - -/** - * @brief Clear Tx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearTxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_TXCLR_Msk; -} - -/** - * @brief Disable the automatic slave select function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableAutoSS(USPI_T *uspi) -{ - uspi->PROTCTL &= ~(USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave select function. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SSPinMask This parameter is not used. - * @param[in] u32ActiveLevel The active level of slave select signal. Valid values are: - * - \ref USPI_SS_ACTIVE_HIGH - * - \ref USPI_SS_ACTIVE_LOW - * @return None - */ -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - uspi->LINECTL = (uspi->LINECTL & ~USPI_LINECTL_CTLOINV_Msk) | u32ActiveLevel; - uspi->PROTCTL |= USPI_PROTCTL_AUTOSS_Msk; -} - -/** - * @brief Set the USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if (uspi == USPI0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32ClkDiv = (uint32_t)((((((u32Pclk / 2UL) * 10UL) / (u32BusClock)) + 5UL) / 10UL) - 1UL); /* Compute proper divider for USCI_SPI clock */ - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - - return (u32Pclk / ((u32ClkDiv + 1UL) << 1UL)); -} - -/** - * @brief Get the actual frequency of USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Actual USCI_SPI bus clock frequency. - */ -uint32_t USPI_GetBusClock(USPI_T *uspi) -{ - uint32_t u32ClkDiv, u32BusClk; - - u32ClkDiv = (uspi->BRGEN & USPI_BRGEN_CLKDIV_Msk) >> USPI_BRGEN_CLKDIV_Pos; - - if (uspi == USPI0) - { - u32BusClk = (CLK_GetPCLK0Freq() / ((u32ClkDiv + 1UL) << 1UL)); - } - else - { - u32BusClk = (CLK_GetPCLK1Freq() / ((u32ClkDiv + 1UL) << 1UL)); - } - - return u32BusClk; -} - -/** - * @brief Enable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be enabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Enable slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSINAIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSACTIEN_Msk; - } - - /* Enable slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVTOIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVBEIEN_Msk; - } - - /* Enable TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_TXUDRIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_RXOVIEN_Msk; - } - - /* Enable TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXSTIEN_Msk; - } - - /* Enable TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXENDIEN_Msk; - } - - /* Enable RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXSTIEN_Msk; - } - - /* Enable RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXENDIEN_Msk; - } -} - -/** - * @brief Disable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Disable slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSINAIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSACTIEN_Msk; - } - - /* Disable slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVTOIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVBEIEN_Msk; - } - - /* Disable TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_TXUDRIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_RXOVIEN_Msk; - } - - /* Disable TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXSTIEN_Msk; - } - - /* Disable TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXENDIEN_Msk; - } - - /* Disable RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXSTIEN_Msk; - } - - /* Disable RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXENDIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return Interrupt flags of selected sources. - */ -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32ProtStatus, u32BufStatus; - uint32_t u32IntFlag = 0UL; - - u32ProtStatus = uspi->PROTSTS; - u32BufStatus = uspi->BUFSTS; - - /* Check slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SSINAIF_Msk)) - { - u32IntFlag |= USPI_SSINACT_INT_MASK; - } - - /* Check slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SSACTIF_Msk)) - { - u32IntFlag |= USPI_SSACT_INT_MASK; - } - - /* Check slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SLVTOIF_Msk)) - { - u32IntFlag |= USPI_SLVTO_INT_MASK; - } - - /* Check slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SLVBEIF_Msk)) - { - u32IntFlag |= USPI_SLVBE_INT_MASK; - } - - /* Check TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) && (u32BufStatus & USPI_BUFSTS_TXUDRIF_Msk)) - { - u32IntFlag |= USPI_TXUDR_INT_MASK; - } - - /* Check RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) && (u32BufStatus & USPI_BUFSTS_RXOVIF_Msk)) - { - u32IntFlag |= USPI_RXOV_INT_MASK; - } - - /* Check TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_TXSTIF_Msk)) - { - u32IntFlag |= USPI_TXST_INT_MASK; - } - - /* Check TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_TXENDIF_Msk)) - { - u32IntFlag |= USPI_TXEND_INT_MASK; - } - - /* Check RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_RXSTIF_Msk)) - { - u32IntFlag |= USPI_RXST_INT_MASK; - } - - /* Check RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_RXENDIF_Msk)) - { - u32IntFlag |= USPI_RXEND_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - /* Clear slave selection signal inactive interrupt flag */ - if(u32Mask & USPI_SSINACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSINAIF_Msk; - } - - /* Clear slave selection signal active interrupt flag */ - if(u32Mask & USPI_SSACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSACTIF_Msk; - } - - /* Clear slave time-out interrupt flag */ - if(u32Mask & USPI_SLVTO_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVTOIF_Msk; - } - - /* Clear slave bit count error interrupt flag */ - if(u32Mask & USPI_SLVBE_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVBEIF_Msk; - } - - /* Clear TX under run interrupt flag */ - if(u32Mask & USPI_TXUDR_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_TXUDRIF_Msk; - } - - /* Clear RX overrun interrupt flag */ - if(u32Mask & USPI_RXOV_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_RXOVIF_Msk; - } - - /* Clear TX start interrupt flag */ - if(u32Mask & USPI_TXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXSTIF_Msk; - } - - /* Clear TX end interrupt flag */ - if(u32Mask & USPI_TXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXENDIF_Msk; - } - - /* Clear RX start interrupt flag */ - if(u32Mask & USPI_RXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXSTIF_Msk; - } - - /* Clear RX end interrupt flag */ - if(u32Mask & USPI_RXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXENDIF_Msk; - } -} - -/** - * @brief Get USCI_SPI status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref USPI_BUSY_MASK - * - \ref USPI_RX_EMPTY_MASK - * - \ref USPI_RX_FULL_MASK - * - \ref USPI_TX_EMPTY_MASK - * - \ref USPI_TX_FULL_MASK - * - \ref USPI_SSLINE_STS_MASK - * @return Flags of selected sources. - */ -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32ProtStatus, u32BufStatus; - uint32_t u32Flag = 0UL; - - u32ProtStatus = uspi->PROTSTS; - u32BufStatus = uspi->BUFSTS; - - /* Check busy status */ - if((u32Mask & USPI_BUSY_MASK) && (u32ProtStatus & USPI_PROTSTS_BUSY_Msk)) - { - u32Flag |= USPI_BUSY_MASK; - } - - /* Check RX empty flag */ - if((u32Mask & USPI_RX_EMPTY_MASK) && (u32BufStatus & USPI_BUFSTS_RXEMPTY_Msk)) - { - u32Flag |= USPI_RX_EMPTY_MASK; - } - - /* Check RX full flag */ - if((u32Mask & USPI_RX_FULL_MASK) && (u32BufStatus & USPI_BUFSTS_RXFULL_Msk)) - { - u32Flag |= USPI_RX_FULL_MASK; - } - - /* Check TX empty flag */ - if((u32Mask & USPI_TX_EMPTY_MASK) && (u32BufStatus & USPI_BUFSTS_TXEMPTY_Msk)) - { - u32Flag |= USPI_TX_EMPTY_MASK; - } - - /* Check TX full flag */ - if((u32Mask & USPI_TX_FULL_MASK) && (u32BufStatus & USPI_BUFSTS_TXFULL_Msk)) - { - u32Flag |= USPI_TX_FULL_MASK; - } - - /* Check USCI_SPI_SS line status */ - if((u32Mask & USPI_SSLINE_STS_MASK) && (u32ProtStatus & USPI_PROTSTS_SSLINE_Msk)) - { - u32Flag |= USPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - -/** - * @brief Enable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_EnableWakeup(USPI_T *uspi) -{ - uspi->WKCTL |= USPI_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableWakeup(USPI_T *uspi) -{ - uspi->WKCTL &= ~USPI_WKCTL_WKEN_Msk; -} - -/*@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_uart.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_uart.c deleted file mode 100644 index 847cba7a6b3..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_usci_uart.c +++ /dev/null @@ -1,729 +0,0 @@ -/**************************************************************************//** - * @file usci_uart.c - * @version V1.00 - * @brief M031 series USCI UART (UUART) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "M031Series.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - -/** - * @brief Clear USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to clear USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -void UUART_ClearIntFlag(UUART_T* uuart, uint32_t u32Mask) -{ - - if(u32Mask & UUART_ABR_INT_MASK) /* Clear Auto-baud Rate Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_ABRDETIF_Msk; - } - - if(u32Mask & UUART_RLS_INT_MASK) /* Clear Receive Line Status Interrupt */ - { - uuart->PROTSTS = (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk); - } - - if(u32Mask & UUART_BUF_RXOV_INT_MASK) /* Clear Receive Buffer Over-run Error Interrupt */ - { - uuart->BUFSTS = UUART_BUFSTS_RXOVIF_Msk; - } - - if(u32Mask & UUART_TXST_INT_MASK) /* Clear Transmit Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXSTIF_Msk; - } - - if(u32Mask & UUART_TXEND_INT_MASK) /* Clear Transmit End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXENDIF_Msk; - } - - if(u32Mask & UUART_RXST_INT_MASK) /* Clear Receive Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXSTIF_Msk; - } - - if(u32Mask & UUART_RXEND_INT_MASK) /* Clear Receive End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXENDIF_Msk; - } - -} - - -/** - * @brief Get USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details The function is used to get USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -uint32_t UUART_GetIntFlag(UUART_T* uuart, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0ul; - uint32_t u32Tmp1, u32Tmp2; - - /* Check Auto-baud Rate Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_ABR_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_ABRDETIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_ABR_INT_MASK; - } - - /* Check Receive Line Status Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RLS_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk)); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RLS_INT_MASK; - } - - /* Check Receive Buffer Over-run Error Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_BUF_RXOV_INT_MASK); - u32Tmp2 = (uuart->BUFSTS & UUART_BUFSTS_RXOVIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_BUF_RXOV_INT_MASK; - } - - /* Check Transmit Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXSTIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXST_INT_MASK; - } - - /* Check Transmit End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXENDIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXEND_INT_MASK; - } - - /* Check Receive Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXSTIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXST_INT_MASK; - } - - /* Check Receive End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXENDIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXEND_INT_MASK; - } - - return u32IntFlag; -} - - -/** - * @brief Disable USCI_UART function mode - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART function mode. - */ -void UUART_Close(UUART_T* uuart) -{ - uuart->CTL = 0UL; -} - - -/** - * @brief Disable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to disabled USCI_UART related interrupts specified by u32Mask parameter. - */ -void UUART_DisableInt(UUART_T* uuart, uint32_t u32Mask) -{ - - /* Disable Auto-baud rate interrupt flag */ - if((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_ABRIEN_Msk; - } - - /* Disable receive line status interrupt flag */ - if((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_RLSIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL &= ~UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Disable TX start interrupt flag */ - if((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXSTIEN_Msk; - } - - /* Disable TX end interrupt flag */ - if((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXENDIEN_Msk; - } - - /* Disable RX start interrupt flag */ - if((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXSTIEN_Msk; - } - - /* Disable RX end interrupt flag */ - if((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Enable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to enable USCI_UART related interrupts specified by u32Mask parameter. - */ -void UUART_EnableInt(UUART_T* uuart, uint32_t u32Mask) -{ - /* Enable Auto-baud rate interrupt flag */ - if((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_ABRIEN_Msk; - } - - /* Enable receive line status interrupt flag */ - if((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_RLSIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL |= UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Enable TX start interrupt flag */ - if((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXSTIEN_Msk; - } - - /* Enable TX end interrupt flag */ - if((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXENDIEN_Msk; - } - - /* Enable RX start interrupt flag */ - if((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXSTIEN_Msk; - } - - /* Enable RX end interrupt flag */ - if((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Open and set USCI_UART function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The baud rate of USCI_UART module. - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to enable USCI_UART function and set baud-rate. - */ -uint32_t UUART_Open(UUART_T* uuart, uint32_t u32baudrate) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - if(uuart == UUART0) - { - u32PCLKFreq = CLK_GetPCLK0Freq(); - } - else - { - u32PCLKFreq = CLK_GetPCLK1Freq(); - } - - /* Calculate baud rate divider */ - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div + 1ul)); - - if(u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - if(u32Div >= 65536ul) - { - - /* Set the smallest baud rate that USCI_UART can generate */ - u32PDSCnt = 0x4ul; - u32MinDSCnt = 0x10ul; - u32MinClkDiv = 0x400ul; - - } - else - { - - u32Tmp = 0x400ul * 0x10ul; - for(u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if(u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if(u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - u32Tmp = 0ul; - - for(u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - - u32ClkDiv = u32Div / u32DSCnt; - - if(u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv + 1ul) * u32DSCnt) - u32Div; - } - - if(u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if(u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if(u32Min == 0ul) - { - break; - } - } - } - - } - - /* Enable USCI_UART protocol */ - uuart->CTL &= ~UUART_CTL_FUNMODE_Msk; - uuart->CTL = 2ul << UUART_CTL_FUNMODE_Pos; - - /* Set USCI_UART line configuration */ - uuart->LINECTL = UUART_WORD_LEN_8 | UUART_LINECTL_LSB_Msk; - uuart->DATIN0 = (2ul << UUART_DATIN0_EDGEDET_Pos); /* Set falling edge detection */ - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv - 1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt - 1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt - 1ul) << UUART_BRGEN_PDSCNT_Pos); - - uuart->PROTCTL |= UUART_PROTCTL_PROTEN_Msk; - - return (u32PCLKFreq / u32PDSCnt / u32MinDSCnt / u32MinClkDiv); -} - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive buffer. - * @param[in] u32ReadBytes The read bytes number of data. - * - * @return Receive byte count - * - * @details The function is used to read Rx data from RX buffer and the data will be stored in pu8RxBuf. - */ -uint32_t UUART_Read(UUART_T* uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - - for(u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while(uuart->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - break; - } - } - - if(u32delayno >= 0x40000000ul) - { - break; - } - - pu8RxBuf[u32Count] = (uint8_t)uuart->RXDAT; /* Get Data from USCI RX */ - } - - return u32Count; - -} - - -/** - * @brief Set USCI_UART line configuration - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The register value of baud rate of USCI_UART module. - * If u32baudrate = 0, USCI_UART baud rate will not change. - * @param[in] u32data_width The data length of USCI_UART module. - * - \ref UUART_WORD_LEN_6 - * - \ref UUART_WORD_LEN_7 - * - \ref UUART_WORD_LEN_8 - * - \ref UUART_WORD_LEN_9 - * @param[in] u32parity The parity setting (none/odd/even) of USCI_UART module. - * - \ref UUART_PARITY_NONE - * - \ref UUART_PARITY_ODD - * - \ref UUART_PARITY_EVEN - * @param[in] u32stop_bits The stop bit length (1/2 bit) of USCI_UART module. - * - \ref UUART_STOP_BIT_1 - * - \ref UUART_STOP_BIT_2 - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to config USCI_UART line setting. - */ -uint32_t UUART_SetLine_Config(UUART_T* uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - if(uuart == UUART0) - { - u32PCLKFreq = CLK_GetPCLK0Freq(); - } - else - { - u32PCLKFreq = CLK_GetPCLK1Freq(); - } - - if(u32baudrate != 0ul) - { - - /* Calculate baud rate divider */ - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div + 1ul)); - - if(u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - if(u32Div >= 65536ul) - { - - /* Set the smallest baud rate that USCI_UART can generate */ - u32PDSCnt = 0x4ul; - u32MinDSCnt = 0x10ul; - u32MinClkDiv = 0x400ul; - - } - else - { - - u32Tmp = 0x400ul * 0x10ul; - for(u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if(u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if(u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - - for(u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - u32ClkDiv = u32Div / u32DSCnt; - - if(u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv + 1ul) * u32DSCnt) - u32Div; - } - - if(u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if(u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if(u32Min == 0ul) - { - break; - } - } - } - - } - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv - 1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt - 1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt - 1ul) << UUART_BRGEN_PDSCNT_Pos); - } - else - { - u32PDSCnt = ((uuart->BRGEN & UUART_BRGEN_PDSCNT_Msk) >> UUART_BRGEN_PDSCNT_Pos) + 1ul; - u32MinDSCnt = ((uuart->BRGEN & UUART_BRGEN_DSCNT_Msk) >> UUART_BRGEN_DSCNT_Pos) + 1ul; - u32MinClkDiv = ((uuart->BRGEN & UUART_BRGEN_CLKDIV_Msk) >> UUART_BRGEN_CLKDIV_Pos) + 1ul; - } - - /* Set USCI_UART line configuration */ - uuart->LINECTL = (uuart->LINECTL & ~UUART_LINECTL_DWIDTH_Msk) | u32data_width; - uuart->PROTCTL = (uuart->PROTCTL & ~(UUART_PROTCTL_STICKEN_Msk | UUART_PROTCTL_EVENPARITY_Msk | - UUART_PROTCTL_PARITYEN_Msk)) | u32parity; - uuart->PROTCTL = (uuart->PROTCTL & ~UUART_PROTCTL_STOPB_Msk) | u32stop_bits; - - return (u32PCLKFreq / u32PDSCnt / u32MinDSCnt / u32MinClkDiv); -} - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8TxBuf The buffer to send the data to USCI transmission buffer. - * @param[out] u32WriteBytes The byte number of data. - * - * @return Transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by USCI_UART. - */ -uint32_t UUART_Write(UUART_T* uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - - for(u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while((uuart->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) == 0ul) /* Wait Tx empty */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - break; - } - } - - if(u32delayno >= 0x40000000ul) - { - break; - } - - uuart->TXDAT = (uint8_t)pu8TxBuf[u32Count]; /* Send USCI_UART Data to buffer */ - } - - return u32Count; -} - - -/** - * @brief Enable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32WakeupMode The wakeup mode of USCI_UART module. -* - \ref UUART_PROTCTL_DATWKEN_Msk : Data wake-up Mode -* - \ref UUART_PROTCTL_CTSWKEN_Msk : nCTS wake-up Mode - * - * @return None - * - * @details The function is used to enable Wake-up function of USCI_UART. - */ -void UUART_EnableWakeup(UUART_T* uuart, uint32_t u32WakeupMode) -{ - uuart->PROTCTL |= u32WakeupMode; - uuart->WKCTL |= UUART_WKCTL_WKEN_Msk; -} - - -/** - * @brief Disable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable Wake-up function of USCI_UART. - */ -void UUART_DisableWakeup(UUART_T* uuart) -{ - uuart->PROTCTL &= ~(UUART_PROTCTL_DATWKEN_Msk | UUART_PROTCTL_CTSWKEN_Msk); - uuart->WKCTL &= ~UUART_WKCTL_WKEN_Msk; -} - -/** - * @brief Enable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to enable USCI_UART auto flow control. - */ -void UUART_EnableFlowCtrl(UUART_T* uuart) -{ - /* Set RTS signal is low level active */ - uuart->LINECTL &= ~UUART_LINECTL_CTLOINV_Msk; - - /* Set CTS signal is low level active */ - uuart->CTLIN0 &= ~UUART_CTLIN0_ININV_Msk; - - /* Enable CTS and RTS auto flow control function */ - uuart->PROTCTL |= UUART_PROTCTL_RTSAUTOEN_Msk | UUART_PROTCTL_CTSAUTOEN_Msk; -} - -/** - * @brief Disable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART auto flow control. - */ -void UUART_DisableFlowCtrl(UUART_T* uuart) -{ - /* Disable CTS and RTS auto flow control function */ - uuart->PROTCTL &= ~(UUART_PROTCTL_RTSAUTOEN_Msk | UUART_PROTCTL_CTSAUTOEN_Msk); -} - -/*@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_wdt.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_wdt.c deleted file mode 100644 index 5575df4cd3e..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_wdt.c +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************//** - * @file wdt.c - * @version V3.00 - * $Revision: 3 $ - * $Date: 18/04/03 5:38p $ - * @brief M031 series Watchdog Timer(WDT) driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Initialize WDT and start counting - * - * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: - * - \ref WDT_TIMEOUT_2POW4 - * - \ref WDT_TIMEOUT_2POW6 - * - \ref WDT_TIMEOUT_2POW8 - * - \ref WDT_TIMEOUT_2POW10 - * - \ref WDT_TIMEOUT_2POW12 - * - \ref WDT_TIMEOUT_2POW14 - * - \ref WDT_TIMEOUT_2POW16 - * - \ref WDT_TIMEOUT_2POW18 - * - \ref WDT_TIMEOUT_2POW20 - * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: - * - \ref WDT_RESET_DELAY_1026CLK - * - \ref WDT_RESET_DELAY_130CLK - * - \ref WDT_RESET_DELAY_18CLK - * - \ref WDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable WDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - */ -void WDT_Open(uint32_t u32TimeoutInterval, - uint32_t u32ResetDelay, - uint32_t u32EnableReset, - uint32_t u32EnableWakeup) -{ - WDT->ALTCTL = u32ResetDelay; - - WDT->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk | - (u32EnableReset << WDT_CTL_RSTEN_Pos) | - (u32EnableWakeup << WDT_CTL_WKEN_Pos); - return; -} - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_wwdt.c b/bsp/nuvoton/libraries/m031/StdDriver/src/nu_wwdt.c deleted file mode 100644 index a9e5c38f1d2..00000000000 --- a/bsp/nuvoton/libraries/m031/StdDriver/src/nu_wwdt.c +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************//** - * @file wwdt.c - * @version V3.00 - * $Revision: 3 $ - * $Date: 18/04/03 5:38p $ - * @brief M031 series Window Watchdog Timer(WWDT) driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Open WWDT function to start counting - * - * @param[in] u32PreScale Prescale period for the WWDT counter period. Valid values are: - * - \ref WWDT_PRESCALER_1 - * - \ref WWDT_PRESCALER_2 - * - \ref WWDT_PRESCALER_4 - * - \ref WWDT_PRESCALER_8 - * - \ref WWDT_PRESCALER_16 - * - \ref WWDT_PRESCALER_32 - * - \ref WWDT_PRESCALER_64 - * - \ref WWDT_PRESCALER_128 - * - \ref WWDT_PRESCALER_192 - * - \ref WWDT_PRESCALER_256 - * - \ref WWDT_PRESCALER_384 - * - \ref WWDT_PRESCALER_512 - * - \ref WWDT_PRESCALER_768 - * - \ref WWDT_PRESCALER_1024 - * - \ref WWDT_PRESCALER_1536 - * - \ref WWDT_PRESCALER_2048 - * @param[in] u32CmpValue Setting the window compared value. Valid values are between 0x0 to 0x3F. - * @param[in] u32EnableInt Enable WWDT interrupt function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function make WWDT module start counting with different counter period and compared window value. - * @note Application can call this function only once after boot up. - */ -void WWDT_Open(uint32_t u32PreScale, - uint32_t u32CmpValue, - uint32_t u32EnableInt) -{ - WWDT->CTL = u32PreScale | - (u32CmpValue << WWDT_CTL_CMPDAT_Pos) | - ((u32EnableInt == TRUE) ? WWDT_CTL_INTEN_Msk : 0U) | - WWDT_CTL_WWDTEN_Msk; - return; -} - -/*@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WWDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m031/rtt_port/Kconfig b/bsp/nuvoton/libraries/m031/rtt_port/Kconfig index cd579bc5cfe..ea590078a7a 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/Kconfig +++ b/bsp/nuvoton/libraries/m031/rtt_port/Kconfig @@ -4,6 +4,7 @@ config SOC_SERIES_M032 select SOC_FAMILY_NUMICRO select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN + select PKG_USING_NUVOTON_SERIES_DRIVER default y config BSP_USE_STDDRIVER_SOURCE diff --git a/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_common_tables.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_common_tables.h deleted file mode 100644 index dfea7460e9a..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_common_tables.h +++ /dev/null @@ -1,121 +0,0 @@ -/* ---------------------------------------------------------------------- - * Project: CMSIS DSP Library - * Title: arm_common_tables.h - * Description: Extern declaration for common tables - * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ -/* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. 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 _ARM_COMMON_TABLES_H -#define _ARM_COMMON_TABLES_H - -#include "arm_math.h" - -extern const uint16_t armBitRevTable[1024]; -extern const q15_t armRecipTableQ15[64]; -extern const q31_t armRecipTableQ31[64]; -extern const float32_t twiddleCoef_16[32]; -extern const float32_t twiddleCoef_32[64]; -extern const float32_t twiddleCoef_64[128]; -extern const float32_t twiddleCoef_128[256]; -extern const float32_t twiddleCoef_256[512]; -extern const float32_t twiddleCoef_512[1024]; -extern const float32_t twiddleCoef_1024[2048]; -extern const float32_t twiddleCoef_2048[4096]; -extern const float32_t twiddleCoef_4096[8192]; -#define twiddleCoef twiddleCoef_4096 -extern const q31_t twiddleCoef_16_q31[24]; -extern const q31_t twiddleCoef_32_q31[48]; -extern const q31_t twiddleCoef_64_q31[96]; -extern const q31_t twiddleCoef_128_q31[192]; -extern const q31_t twiddleCoef_256_q31[384]; -extern const q31_t twiddleCoef_512_q31[768]; -extern const q31_t twiddleCoef_1024_q31[1536]; -extern const q31_t twiddleCoef_2048_q31[3072]; -extern const q31_t twiddleCoef_4096_q31[6144]; -extern const q15_t twiddleCoef_16_q15[24]; -extern const q15_t twiddleCoef_32_q15[48]; -extern const q15_t twiddleCoef_64_q15[96]; -extern const q15_t twiddleCoef_128_q15[192]; -extern const q15_t twiddleCoef_256_q15[384]; -extern const q15_t twiddleCoef_512_q15[768]; -extern const q15_t twiddleCoef_1024_q15[1536]; -extern const q15_t twiddleCoef_2048_q15[3072]; -extern const q15_t twiddleCoef_4096_q15[6144]; -extern const float32_t twiddleCoef_rfft_32[32]; -extern const float32_t twiddleCoef_rfft_64[64]; -extern const float32_t twiddleCoef_rfft_128[128]; -extern const float32_t twiddleCoef_rfft_256[256]; -extern const float32_t twiddleCoef_rfft_512[512]; -extern const float32_t twiddleCoef_rfft_1024[1024]; -extern const float32_t twiddleCoef_rfft_2048[2048]; -extern const float32_t twiddleCoef_rfft_4096[4096]; - -/* floating-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_16_TABLE_LENGTH ((uint16_t)20) -#define ARMBITREVINDEXTABLE_32_TABLE_LENGTH ((uint16_t)48) -#define ARMBITREVINDEXTABLE_64_TABLE_LENGTH ((uint16_t)56) -#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208) -#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440) -#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448) -#define ARMBITREVINDEXTABLE_1024_TABLE_LENGTH ((uint16_t)1800) -#define ARMBITREVINDEXTABLE_2048_TABLE_LENGTH ((uint16_t)3808) -#define ARMBITREVINDEXTABLE_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE_16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE_32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE_64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE_4096_TABLE_LENGTH]; - -/* fixed-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH ((uint16_t)12) -#define ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH ((uint16_t)24) -#define ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH ((uint16_t)56) -#define ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH ((uint16_t)112) -#define ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH ((uint16_t)240) -#define ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH ((uint16_t)480) -#define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992) -#define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) -#define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; - -/* Tables for Fast Math Sine and Cosine */ -extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; -extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; -extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; - -#endif /* ARM_COMMON_TABLES_H */ diff --git a/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_const_structs.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_const_structs.h deleted file mode 100644 index 80a3e8bbe72..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_const_structs.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ---------------------------------------------------------------------- - * Project: CMSIS DSP Library - * Title: arm_const_structs.h - * Description: Constant structs that are initialized for user convenience. - * For example, some can be given as arguments to the arm_cfft_f32() function. - * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ -/* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. 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 _ARM_CONST_STRUCTS_H -#define _ARM_CONST_STRUCTS_H - -#include "arm_math.h" -#include "arm_common_tables.h" - - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; - - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; - - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; - -#endif diff --git a/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_math.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_math.h deleted file mode 100644 index a489ab614de..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/arm_math.h +++ /dev/null @@ -1,7257 +0,0 @@ -/* ---------------------------------------------------------------------- - * Project: CMSIS DSP Library - * Title: arm_math.h - * Description: Public header file for CMSIS DSP Library - * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ -/* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. 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. - */ - -/** - \mainpage CMSIS DSP Software Library - * - * Introduction - * ------------ - * - * This user manual describes the CMSIS DSP software library, - * a suite of common signal processing functions for use on Cortex-M processor based devices. - * - * The library is divided into a number of functions each covering a specific category: - * - Basic math functions - * - Fast math functions - * - Complex math functions - * - Filters - * - Matrix functions - * - Transforms - * - Motor control functions - * - Statistical functions - * - Support functions - * - Interpolation functions - * - * The library has separate functions for operating on 8-bit integers, 16-bit integers, - * 32-bit integer and 32-bit floating-point values. - * - * Using the Library - * ------------ - * - * The library installer contains prebuilt versions of the libraries in the Lib folder. - * - arm_cortexM7lfdp_math.lib (Cortex-M7, Little endian, Double Precision Floating Point Unit) - * - arm_cortexM7bfdp_math.lib (Cortex-M7, Big endian, Double Precision Floating Point Unit) - * - arm_cortexM7lfsp_math.lib (Cortex-M7, Little endian, Single Precision Floating Point Unit) - * - arm_cortexM7bfsp_math.lib (Cortex-M7, Big endian and Single Precision Floating Point Unit on) - * - arm_cortexM7l_math.lib (Cortex-M7, Little endian) - * - arm_cortexM7b_math.lib (Cortex-M7, Big endian) - * - arm_cortexM4lf_math.lib (Cortex-M4, Little endian, Floating Point Unit) - * - arm_cortexM4bf_math.lib (Cortex-M4, Big endian, Floating Point Unit) - * - arm_cortexM4l_math.lib (Cortex-M4, Little endian) - * - arm_cortexM4b_math.lib (Cortex-M4, Big endian) - * - arm_cortexM3l_math.lib (Cortex-M3, Little endian) - * - arm_cortexM3b_math.lib (Cortex-M3, Big endian) - * - arm_cortexM0l_math.lib (Cortex-M0 / Cortex-M0+, Little endian) - * - arm_cortexM0b_math.lib (Cortex-M0 / Cortex-M0+, Big endian) - * - arm_ARMv8MBLl_math.lib (ARMv8M Baseline, Little endian) - * - arm_ARMv8MMLl_math.lib (ARMv8M Mainline, Little endian) - * - arm_ARMv8MMLlfsp_math.lib (ARMv8M Mainline, Little endian, Single Precision Floating Point Unit) - * - arm_ARMv8MMLld_math.lib (ARMv8M Mainline, Little endian, DSP instructions) - * - arm_ARMv8MMLldfsp_math.lib (ARMv8M Mainline, Little endian, DSP instructions, Single Precision Floating Point Unit) - * - * The library functions are declared in the public file arm_math.h which is placed in the Include folder. - * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single - * public header file arm_math.h for Cortex-M cores with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. - * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or - * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. - * For ARMv8M cores define pre processor MACRO ARM_MATH_ARMV8MBL or ARM_MATH_ARMV8MML. - * Set Pre processor MACRO __DSP_PRESENT if ARMv8M Mainline core supports DSP instructions. - * - * - * Examples - * -------- - * - * The library ships with a number of examples which demonstrate how to use the library functions. - * - * Toolchain Support - * ------------ - * - * The library has been developed and tested with MDK-ARM version 5.14.0.0 - * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. - * - * Building the Library - * ------------ - * - * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. - * - arm_cortexM_math.uvprojx - * - * - * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above. - * - * Pre-processor Macros - * ------------ - * - * Each library project have differant pre-processor macros. - * - * - UNALIGNED_SUPPORT_DISABLE: - * - * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access - * - * - ARM_MATH_BIG_ENDIAN: - * - * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. - * - * - ARM_MATH_MATRIX_CHECK: - * - * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices - * - * - ARM_MATH_ROUNDING: - * - * Define macro ARM_MATH_ROUNDING for rounding on support functions - * - * - ARM_MATH_CMx: - * - * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target - * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and - * ARM_MATH_CM7 for building the library on cortex-M7. - * - * - ARM_MATH_ARMV8MxL: - * - * Define macro ARM_MATH_ARMV8MBL for building the library on ARMv8M Baseline target, ARM_MATH_ARMV8MBL for building library - * on ARMv8M Mainline target. - * - * - __FPU_PRESENT: - * - * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for floating point libraries. - * - * - __DSP_PRESENT: - * - * Initialize macro __DSP_PRESENT = 1 when ARMv8M Mainline core supports DSP instructions. - * - *
- * CMSIS-DSP in ARM::CMSIS Pack - * ----------------------------- - * - * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: - * |File/Folder |Content | - * |------------------------------|------------------------------------------------------------------------| - * |\b CMSIS\\Documentation\\DSP | This documentation | - * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | - * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | - * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | - * - *
- * Revision History of CMSIS-DSP - * ------------ - * Please refer to \ref ChangeLog_pg. - * - * Copyright Notice - * ------------ - * - * Copyright (C) 2010-2015 ARM Limited. All rights reserved. - */ - - -/** - * @defgroup groupMath Basic Math Functions - */ - -/** - * @defgroup groupFastMath Fast Math Functions - * This set of functions provides a fast approximation to sine, cosine, and square root. - * As compared to most of the other functions in the CMSIS math library, the fast math functions - * operate on individual values and not arrays. - * There are separate functions for Q15, Q31, and floating-point data. - * - */ - -/** - * @defgroup groupCmplxMath Complex Math Functions - * This set of functions operates on complex data vectors. - * The data in the complex arrays is stored in an interleaved fashion - * (real, imag, real, imag, ...). - * In the API functions, the number of samples in a complex array refers - * to the number of complex values; the array contains twice this number of - * real values. - */ - -/** - * @defgroup groupFilters Filtering Functions - */ - -/** - * @defgroup groupMatrix Matrix Functions - * - * This set of functions provides basic matrix math operations. - * The functions operate on matrix data structures. For example, - * the type - * definition for the floating-point matrix structure is shown - * below: - *
- *     typedef struct
- *     {
- *       uint16_t numRows;     // number of rows of the matrix.
- *       uint16_t numCols;     // number of columns of the matrix.
- *       float32_t *pData;     // points to the data of the matrix.
- *     } arm_matrix_instance_f32;
- * 
- * There are similar definitions for Q15 and Q31 data types. - * - * The structure specifies the size of the matrix and then points to - * an array of data. The array is of size numRows X numCols - * and the values are arranged in row order. That is, the - * matrix element (i, j) is stored at: - *
- *     pData[i*numCols + j]
- * 
- * - * \par Init Functions - * There is an associated initialization function for each type of matrix - * data structure. - * The initialization function sets the values of the internal structure fields. - * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() - * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. - * - * \par - * Use of the initialization function is optional. However, if initialization function is used - * then the instance structure cannot be placed into a const data section. - * To place the instance structure in a const data - * section, manually initialize the data structure. For example: - *
- * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
- * 
- * where nRows specifies the number of rows, nColumns - * specifies the number of columns, and pData points to the - * data array. - * - * \par Size Checking - * By default all of the matrix functions perform size checking on the input and - * output matrices. For example, the matrix addition function verifies that the - * two input matrices and the output matrix all have the same number of rows and - * columns. If the size check fails the functions return: - *
- *     ARM_MATH_SIZE_MISMATCH
- * 
- * Otherwise the functions return - *
- *     ARM_MATH_SUCCESS
- * 
- * There is some overhead associated with this matrix size checking. - * The matrix size checking is enabled via the \#define - *
- *     ARM_MATH_MATRIX_CHECK
- * 
- * within the library project settings. By default this macro is defined - * and size checking is enabled. By changing the project settings and - * undefining this macro size checking is eliminated and the functions - * run a bit faster. With size checking disabled the functions always - * return ARM_MATH_SUCCESS. - */ - -/** - * @defgroup groupTransforms Transform Functions - */ - -/** - * @defgroup groupController Controller Functions - */ - -/** - * @defgroup groupStats Statistics Functions - */ -/** - * @defgroup groupSupport Support Functions - */ - -/** - * @defgroup groupInterpolation Interpolation Functions - * These functions perform 1- and 2-dimensional interpolation of data. - * Linear interpolation is used for 1-dimensional data and - * bilinear interpolation is used for 2-dimensional data. - */ - -/** - * @defgroup groupExamples Examples - */ -#ifndef _ARM_MATH_H -#define _ARM_MATH_H - -/* Compiler specific diagnostic adjustment */ -#if defined ( __CC_ARM ) - -#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) - -#elif defined ( __GNUC__ ) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wunused-parameter" - -#elif defined ( __ICCARM__ ) - -#elif defined ( __TI_ARM__ ) - -#elif defined ( __CSMC__ ) - -#elif defined ( __TASKING__ ) - -#else - #error Unknown compiler -#endif - - -#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ - -#if defined(ARM_MATH_CM7) - #include "core_cm7.h" - #define ARM_MATH_DSP -#elif defined (ARM_MATH_CM4) - #include "core_cm4.h" - #define ARM_MATH_DSP -#elif defined (ARM_MATH_CM3) - #include "core_cm3.h" -#elif defined (ARM_MATH_CM0) - #include "core_cm0.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_CM0PLUS) - #include "core_cm0plus.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_ARMV8MBL) - #include "core_armv8mbl.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_ARMV8MML) - #include "core_armv8mml.h" - #if (defined (__DSP_PRESENT) && (__DSP_PRESENT == 1)) - #define ARM_MATH_DSP - #endif -#else - #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS, ARM_MATH_CM0, ARM_MATH_ARMV8MBL, ARM_MATH_ARMV8MML" -#endif - -#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ -#include "string.h" -#include "math.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** - * @brief Macros required for reciprocal calculation in Normalized LMS - */ - -#define DELTA_Q31 (0x100) -#define DELTA_Q15 0x5 -#define INDEX_MASK 0x0000003F -#ifndef PI -#define PI 3.14159265358979f -#endif - -/** - * @brief Macros required for SINE and COSINE Fast math approximations - */ - -#define FAST_MATH_TABLE_SIZE 512 -#define FAST_MATH_Q31_SHIFT (32 - 10) -#define FAST_MATH_Q15_SHIFT (16 - 10) -#define CONTROLLER_Q31_SHIFT (32 - 9) -#define TABLE_SPACING_Q31 0x400000 -#define TABLE_SPACING_Q15 0x80 - -/** - * @brief Macros required for SINE and COSINE Controller functions - */ -/* 1.31(q31) Fixed value of 2/360 */ -/* -1 to +1 is divided into 360 values so total spacing is (2/360) */ -#define INPUT_SPACING 0xB60B61 - -/** - * @brief Macro for Unaligned Support - */ -#ifndef UNALIGNED_SUPPORT_DISABLE -#define ALIGN4 -#else -#if defined (__GNUC__) -#define ALIGN4 __attribute__((aligned(4))) -#else -#define ALIGN4 __align(4) -#endif -#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ - -/** - * @brief Error status returned by some functions in the library. - */ - -typedef enum -{ - ARM_MATH_SUCCESS = 0, /**< No error */ - ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ - ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ - ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ - ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ - ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ - ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ -} arm_status; - -/** - * @brief 8-bit fractional data type in 1.7 format. - */ -typedef int8_t q7_t; - -/** - * @brief 16-bit fractional data type in 1.15 format. - */ -typedef int16_t q15_t; - -/** - * @brief 32-bit fractional data type in 1.31 format. - */ -typedef int32_t q31_t; - -/** - * @brief 64-bit fractional data type in 1.63 format. - */ -typedef int64_t q63_t; - -/** - * @brief 32-bit floating-point type definition. - */ -typedef float float32_t; - -/** - * @brief 64-bit floating-point type definition. - */ -typedef double float64_t; - -/** - * @brief definition to read/write two 16 bit values. - */ -#if defined ( __CC_ARM ) -#define __SIMD32_TYPE int32_t __packed -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE __attribute__((always_inline)) - -#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE __attribute__((always_inline)) - -#elif defined ( __GNUC__ ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE __attribute__((always_inline)) - -#elif defined ( __ICCARM__ ) -#define __SIMD32_TYPE int32_t __packed -#define CMSIS_UNUSED -#define CMSIS_INLINE - -#elif defined ( __TI_ARM__ ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE - -#elif defined ( __CSMC__ ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED -#define CMSIS_INLINE - -#elif defined ( __TASKING__ ) -#define __SIMD32_TYPE __unaligned int32_t -#define CMSIS_UNUSED -#define CMSIS_INLINE - -#else -#error Unknown compiler -#endif - -#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) -#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) -#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) -#define __SIMD64(addr) (*(int64_t **) & (addr)) - -/* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#if !defined (ARM_MATH_DSP) -/** - * @brief definition to pack two 16 bit values. - */ -#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ - (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) -#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ - (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) - -/* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#endif /* !defined (ARM_MATH_DSP) */ - -/** -* @brief definition to pack four 8 bit values. -*/ -#ifndef ARM_MATH_BIG_ENDIAN - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) -#else - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) - -#endif - - -/** - * @brief Clips Q63 to Q31 values. - */ -CMSIS_INLINE __STATIC_INLINE q31_t clip_q63_to_q31( - q63_t x) -{ - return ((q31_t)(x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFFFFFF ^ ((q31_t)(x >> 63)))) : (q31_t) x; -} - -/** - * @brief Clips Q63 to Q15 values. - */ -CMSIS_INLINE __STATIC_INLINE q15_t clip_q63_to_q15( - q63_t x) -{ - return ((q31_t)(x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFF ^ ((q15_t)(x >> 63)))) : (q15_t)(x >> 15); -} - -/** - * @brief Clips Q31 to Q7 values. - */ -CMSIS_INLINE __STATIC_INLINE q7_t clip_q31_to_q7( - q31_t x) -{ - return ((q31_t)(x >> 24) != ((q31_t) x >> 23)) ? - ((0x7F ^ ((q7_t)(x >> 31)))) : (q7_t) x; -} - -/** - * @brief Clips Q31 to Q15 values. - */ -CMSIS_INLINE __STATIC_INLINE q15_t clip_q31_to_q15( - q31_t x) -{ - return ((q31_t)(x >> 16) != ((q31_t) x >> 15)) ? - ((0x7FFF ^ ((q15_t)(x >> 31)))) : (q15_t) x; -} - -/** - * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. - */ - -CMSIS_INLINE __STATIC_INLINE q63_t mult32x64( - q63_t x, - q31_t y) -{ - return ((((q63_t)(x & 0x00000000FFFFFFFF) * y) >> 32) + - (((q63_t)(x >> 32) * y))); -} - -/* - #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) - #define __CLZ __clz - #endif - */ -/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ -#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) -CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( - q31_t data); - -CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( - q31_t data) -{ - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while ((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); -} -#endif - -/** - * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. - */ - -CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q31( - q31_t in, - q31_t *dst, - q31_t *pRecipTable) -{ - q31_t out; - uint32_t tempVal; - uint32_t index, i; - uint32_t signBits; - - if (in > 0) - { - signBits = ((uint32_t)(__CLZ(in) - 1)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 1)); - } - - /* Convert input sample to 1.31 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 24); - index = (index & INDEX_MASK); - - /* 1.31 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t)(((q63_t) in * out) >> 31); - tempVal = 0x7FFFFFFFu - tempVal; - /* 1.31 with exp 1 */ - /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ - out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1u); -} - - -/** - * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. - */ -CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q15( - q15_t in, - q15_t *dst, - q15_t *pRecipTable) -{ - q15_t out = 0; - uint32_t tempVal = 0; - uint32_t index = 0, i = 0; - uint32_t signBits = 0; - - if (in > 0) - { - signBits = ((uint32_t)(__CLZ(in) - 17)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 17)); - } - - /* Convert input sample to 1.15 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 8); - index = (index & INDEX_MASK); - - /* 1.15 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t)(((q31_t) in * out) >> 15); - tempVal = 0x7FFFu - tempVal; - /* 1.15 with exp 1 */ - out = (q15_t)(((q31_t) out * tempVal) >> 14); - /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1); -} - - -/* - * @brief C custom defined intrinisic function for only M0 processors - */ -#if defined(ARM_MATH_CM0_FAMILY) -CMSIS_INLINE __STATIC_INLINE q31_t __SSAT( - q31_t x, - uint32_t y) -{ - int32_t posMax, negMin; - uint32_t i; - - posMax = 1; - for (i = 0; i < (y - 1); i++) - { - posMax = posMax * 2; - } - - if (x > 0) - { - posMax = (posMax - 1); - - if (x > posMax) - { - x = posMax; - } - } - else - { - negMin = -posMax; - - if (x < negMin) - { - x = negMin; - } - } - return (x); -} -#endif /* end of ARM_MATH_CM0_FAMILY */ - - -/* - * @brief C custom defined intrinsic function for M3 and M0 processors - */ -/* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#if !defined (ARM_MATH_DSP) - -/* - * @brief C custom defined QADD8 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QADD8( - uint32_t x, - uint32_t y) -{ - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x) >> 24) + (((q31_t)y) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r))); -} - - -/* - * @brief C custom defined QSUB8 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB8( - uint32_t x, - uint32_t y) -{ - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x) >> 24) - (((q31_t)y) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r))); -} - - -/* - * @brief C custom defined QADD16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QADD16( - uint32_t x, - uint32_t y) -{ - /* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ - q31_t r = 0, s = 0; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) + (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHADD16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHADD16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) + (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QSUB16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) - (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHSUB16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHSUB16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) - (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QASX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QASX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHASX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHASX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QSAX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QSAX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHSAX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHSAX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SMUSDX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSDX( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)))); -} - -/* - * @brief C custom defined SMUADX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUADX( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)))); -} - - -/* - * @brief C custom defined QADD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE int32_t __QADD( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); -} - - -/* - * @brief C custom defined QSUB for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE int32_t __QSUB( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); -} - - -/* - * @brief C custom defined SMLAD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMLAD( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLADX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMLADX( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLSDX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMLSDX( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLALD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALD( - uint32_t x, - uint32_t y, - uint64_t sum) -{ - /* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)) + - (((q63_t)sum)))); -} - - -/* - * @brief C custom defined SMLALDX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALDX( - uint32_t x, - uint32_t y, - uint64_t sum) -{ - /* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q63_t)sum)))); -} - - -/* - * @brief C custom defined SMUAD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUAD( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)))); -} - - -/* - * @brief C custom defined SMUSD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSD( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)))); -} - - -/* - * @brief C custom defined SXTB16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SXTB16( - uint32_t x) -{ - return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | - ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000))); -} - -/* - * @brief C custom defined SMMLA for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE int32_t __SMMLA( - int32_t x, - int32_t y, - int32_t sum) -{ - return (sum + (int32_t)(((int64_t) x * y) >> 32)); -} - -#if 0 -/* - * @brief C custom defined PKHBT for unavailable DSP extension - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __PKHBT( - uint32_t x, - uint32_t y, - uint32_t leftshift) -{ - return (((x) & 0x0000FFFFUL) | - ((y << leftshift) & 0xFFFF0000UL)); -} - -/* - * @brief C custom defined PKHTB for unavailable DSP extension - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __PKHTB( - uint32_t x, - uint32_t y, - uint32_t rightshift) -{ - return (((x) & 0xFFFF0000UL) | - ((y >> rightshift) & 0x0000FFFFUL)); -} -#endif - -/* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#endif /* !defined (ARM_MATH_DSP) */ - - -/** - * @brief Instance structure for the Q7 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ -} arm_fir_instance_q7; - -/** - * @brief Instance structure for the Q15 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ -} arm_fir_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ -} arm_fir_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ -} arm_fir_instance_f32; - - -/** - * @brief Processing function for the Q7 FIR filter. - * @param[in] S points to an instance of the Q7 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q7( - const arm_fir_instance_q7 *S, - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q7 FIR filter. - * @param[in,out] S points to an instance of the Q7 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed. - */ -void arm_fir_init_q7( - arm_fir_instance_q7 *S, - uint16_t numTaps, - q7_t *pCoeffs, - q7_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR filter. - * @param[in] S points to an instance of the Q15 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q15( - const arm_fir_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_fast_q15( - const arm_fir_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR filter. - * @param[in,out] S points to an instance of the Q15 FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if - * numTaps is not a supported value. - */ -arm_status arm_fir_init_q15( - arm_fir_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR filter. - * @param[in] S points to an instance of the Q31 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q31( - const arm_fir_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_fast_q31( - const arm_fir_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR filter. - * @param[in,out] S points to an instance of the Q31 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ -void arm_fir_init_q31( - arm_fir_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point FIR filter. - * @param[in] S points to an instance of the floating-point FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_f32( - const arm_fir_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR filter. - * @param[in,out] S points to an instance of the floating-point FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ -void arm_fir_init_f32( - arm_fir_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 Biquad cascade filter. - */ -typedef struct -{ - int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ -} arm_biquad_casd_df1_inst_q15; - -/** - * @brief Instance structure for the Q31 Biquad cascade filter. - */ -typedef struct -{ - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ -} arm_biquad_casd_df1_inst_q31; - -/** - * @brief Instance structure for the floating-point Biquad cascade filter. - */ -typedef struct -{ - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_casd_df1_inst_f32; - - -/** - * @brief Processing function for the Q15 Biquad cascade filter. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_q15( - const arm_biquad_casd_df1_inst_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cascade_df1_init_q15( - arm_biquad_casd_df1_inst_q15 *S, - uint8_t numStages, - q15_t *pCoeffs, - q15_t *pState, - int8_t postShift); - - -/** - * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_fast_q15( - const arm_biquad_casd_df1_inst_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 Biquad cascade filter - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_q31( - const arm_biquad_casd_df1_inst_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_fast_q31( - const arm_biquad_casd_df1_inst_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cascade_df1_init_q31( - arm_biquad_casd_df1_inst_q31 *S, - uint8_t numStages, - q31_t *pCoeffs, - q31_t *pState, - int8_t postShift); - - -/** - * @brief Processing function for the floating-point Biquad cascade filter. - * @param[in] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_f32( - const arm_biquad_casd_df1_inst_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point Biquad cascade filter. - * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df1_init_f32( - arm_biquad_casd_df1_inst_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Instance structure for the floating-point matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float32_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_f32; - - -/** - * @brief Instance structure for the floating-point matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float64_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_f64; - -/** - * @brief Instance structure for the Q15 matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q15_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_q15; - -/** - * @brief Instance structure for the Q31 matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q31_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_q31; - - -/** - * @brief Floating-point matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pScratch); - - -/** - * @brief Q31, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_f32( - const arm_matrix_instance_f32 *pSrc, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_q15( - const arm_matrix_instance_q15 *pSrc, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_q31( - const arm_matrix_instance_q31 *pSrc, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pState); - - -/** - * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_fast_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pState); - - -/** - * @brief Q31 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_fast_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix scaling. - * @param[in] pSrc points to the input matrix - * @param[in] scale scale factor - * @param[out] pDst points to the output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_f32( - const arm_matrix_instance_f32 *pSrc, - float32_t scale, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_q15( - const arm_matrix_instance_q15 *pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_q31( - const arm_matrix_instance_q31 *pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Q31 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_q31( - arm_matrix_instance_q31 *S, - uint16_t nRows, - uint16_t nColumns, - q31_t *pData); - - -/** - * @brief Q15 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_q15( - arm_matrix_instance_q15 *S, - uint16_t nRows, - uint16_t nColumns, - q15_t *pData); - - -/** - * @brief Floating-point matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_f32( - arm_matrix_instance_f32 *S, - uint16_t nRows, - uint16_t nColumns, - float32_t *pData); - - - -/** - * @brief Instance structure for the Q15 PID Control. - */ -typedef struct -{ - q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ -#if !defined (ARM_MATH_DSP) - q15_t A1; - q15_t A2; -#else - q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ -#endif - q15_t state[3]; /**< The state array of length 3. */ - q15_t Kp; /**< The proportional gain. */ - q15_t Ki; /**< The integral gain. */ - q15_t Kd; /**< The derivative gain. */ -} arm_pid_instance_q15; - -/** - * @brief Instance structure for the Q31 PID Control. - */ -typedef struct -{ - q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - q31_t A2; /**< The derived gain, A2 = Kd . */ - q31_t state[3]; /**< The state array of length 3. */ - q31_t Kp; /**< The proportional gain. */ - q31_t Ki; /**< The integral gain. */ - q31_t Kd; /**< The derivative gain. */ -} arm_pid_instance_q31; - -/** - * @brief Instance structure for the floating-point PID Control. - */ -typedef struct -{ - float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - float32_t A2; /**< The derived gain, A2 = Kd . */ - float32_t state[3]; /**< The state array of length 3. */ - float32_t Kp; /**< The proportional gain. */ - float32_t Ki; /**< The integral gain. */ - float32_t Kd; /**< The derivative gain. */ -} arm_pid_instance_f32; - - - -/** - * @brief Initialization function for the floating-point PID Control. - * @param[in,out] S points to an instance of the PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_f32( - arm_pid_instance_f32 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - */ -void arm_pid_reset_f32( - arm_pid_instance_f32 *S); - - -/** - * @brief Initialization function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_q31( - arm_pid_instance_q31 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - */ - -void arm_pid_reset_q31( - arm_pid_instance_q31 *S); - - -/** - * @brief Initialization function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_q15( - arm_pid_instance_q15 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the Q15 PID Control. - * @param[in,out] S points to an instance of the q15 PID Control structure - */ -void arm_pid_reset_q15( - arm_pid_instance_q15 *S); - - -/** - * @brief Instance structure for the floating-point Linear Interpolate function. - */ -typedef struct -{ - uint32_t nValues; /**< nValues */ - float32_t x1; /**< x1 */ - float32_t xSpacing; /**< xSpacing */ - float32_t *pYData; /**< pointer to the table of Y values */ -} arm_linear_interp_instance_f32; - -/** - * @brief Instance structure for the floating-point bilinear interpolation function. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - float32_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_f32; - -/** -* @brief Instance structure for the Q31 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q31_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q31; - -/** -* @brief Instance structure for the Q15 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q15_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q15; - -/** -* @brief Instance structure for the Q15 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q7_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q7; - - -/** - * @brief Q7 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix2_instance_q15; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_q15( - arm_cfft_radix2_instance_q15 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_q15( - const arm_cfft_radix2_instance_q15 *S, - q15_t *pSrc); - - -/** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix4_instance_q15; - -/* Deprecated */ -arm_status arm_cfft_radix4_init_q15( - arm_cfft_radix4_instance_q15 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix4_q15( - const arm_cfft_radix4_instance_q15 *S, - q15_t *pSrc); - -/** - * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix2_instance_q31; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_q31( - arm_cfft_radix2_instance_q31 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_q31( - const arm_cfft_radix2_instance_q31 *S, - q31_t *pSrc); - -/** - * @brief Instance structure for the Q31 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix4_instance_q31; - -/* Deprecated */ -void arm_cfft_radix4_q31( - const arm_cfft_radix4_instance_q31 *S, - q31_t *pSrc); - -/* Deprecated */ -arm_status arm_cfft_radix4_init_q31( - arm_cfft_radix4_instance_q31 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ -} arm_cfft_radix2_instance_f32; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_f32( - arm_cfft_radix2_instance_f32 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_f32( - const arm_cfft_radix2_instance_f32 *S, - float32_t *pSrc); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ -} arm_cfft_radix4_instance_f32; - -/* Deprecated */ -arm_status arm_cfft_radix4_init_f32( - arm_cfft_radix4_instance_f32 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix4_f32( - const arm_cfft_radix4_instance_f32 *S, - float32_t *pSrc); - -/** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_q15; - -void arm_cfft_q15( - const arm_cfft_instance_q15 *S, - q15_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_q31; - -void arm_cfft_q31( - const arm_cfft_instance_q31 *S, - q31_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_f32; - -void arm_cfft_f32( - const arm_cfft_instance_f32 *S, - float32_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the Q15 RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_q15; - -arm_status arm_rfft_init_q15( - arm_rfft_instance_q15 *S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_q15( - const arm_rfft_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst); - -/** - * @brief Instance structure for the Q31 RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_q31; - -arm_status arm_rfft_init_q31( - arm_rfft_instance_q31 *S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_q31( - const arm_rfft_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst); - -/** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint16_t fftLenBy2; /**< length of the complex FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_f32; - -arm_status arm_rfft_init_f32( - arm_rfft_instance_f32 *S, - arm_cfft_radix4_instance_f32 *S_CFFT, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_f32( - const arm_rfft_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst); - -/** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct -{ - arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ - uint16_t fftLenRFFT; /**< length of the real sequence */ - float32_t *pTwiddleRFFT; /**< Twiddle factors real stage */ -} arm_rfft_fast_instance_f32 ; - -arm_status arm_rfft_fast_init_f32( - arm_rfft_fast_instance_f32 *S, - uint16_t fftLen); - -void arm_rfft_fast_f32( - arm_rfft_fast_instance_f32 *S, - float32_t *p, float32_t *pOut, - uint8_t ifftFlag); - -/** - * @brief Instance structure for the floating-point DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - float32_t normalize; /**< normalizing factor. */ - float32_t *pTwiddle; /**< points to the twiddle factor table. */ - float32_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_f32; - - -/** - * @brief Initialization function for the floating-point DCT4/IDCT4. - * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. - */ -arm_status arm_dct4_init_f32( - arm_dct4_instance_f32 *S, - arm_rfft_instance_f32 *S_RFFT, - arm_cfft_radix4_instance_f32 *S_CFFT, - uint16_t N, - uint16_t Nby2, - float32_t normalize); - - -/** - * @brief Processing function for the floating-point DCT4/IDCT4. - * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_f32( - const arm_dct4_instance_f32 *S, - float32_t *pState, - float32_t *pInlineBuffer); - - -/** - * @brief Instance structure for the Q31 DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q31_t normalize; /**< normalizing factor. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - q31_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_q31; - - -/** - * @brief Initialization function for the Q31 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure - * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ -arm_status arm_dct4_init_q31( - arm_dct4_instance_q31 *S, - arm_rfft_instance_q31 *S_RFFT, - arm_cfft_radix4_instance_q31 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize); - - -/** - * @brief Processing function for the Q31 DCT4/IDCT4. - * @param[in] S points to an instance of the Q31 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_q31( - const arm_dct4_instance_q31 *S, - q31_t *pState, - q31_t *pInlineBuffer); - - -/** - * @brief Instance structure for the Q15 DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q15_t normalize; /**< normalizing factor. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - q15_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_q15; - - -/** - * @brief Initialization function for the Q15 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ -arm_status arm_dct4_init_q15( - arm_dct4_instance_q15 *S, - arm_rfft_instance_q15 *S_RFFT, - arm_cfft_radix4_instance_q15 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize); - - -/** - * @brief Processing function for the Q15 DCT4/IDCT4. - * @param[in] S points to an instance of the Q15 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_q15( - const arm_dct4_instance_q15 *S, - q15_t *pState, - q15_t *pInlineBuffer); - - -/** - * @brief Floating-point vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a floating-point vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scale scale factor to be applied - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_f32( - float32_t *pSrc, - float32_t scale, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q7 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q7( - q7_t *pSrc, - q7_t scaleFract, - int8_t shift, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q15 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q15( - q15_t *pSrc, - q15_t scaleFract, - int8_t shift, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q31 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q31( - q31_t *pSrc, - q31_t scaleFract, - int8_t shift, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Dot product of floating-point vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_f32( - float32_t *pSrcA, - float32_t *pSrcB, - uint32_t blockSize, - float32_t *result); - - -/** - * @brief Dot product of Q7 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q7( - q7_t *pSrcA, - q7_t *pSrcB, - uint32_t blockSize, - q31_t *result); - - -/** - * @brief Dot product of Q15 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q15( - q15_t *pSrcA, - q15_t *pSrcB, - uint32_t blockSize, - q63_t *result); - - -/** - * @brief Dot product of Q31 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q31( - q31_t *pSrcA, - q31_t *pSrcB, - uint32_t blockSize, - q63_t *result); - - -/** - * @brief Shifts the elements of a Q7 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q7( - q7_t *pSrc, - int8_t shiftBits, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Shifts the elements of a Q15 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q15( - q15_t *pSrc, - int8_t shiftBits, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Shifts the elements of a Q31 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q31( - q31_t *pSrc, - int8_t shiftBits, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_f32( - float32_t *pSrc, - float32_t offset, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q7( - q7_t *pSrc, - q7_t offset, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q15( - q15_t *pSrc, - q15_t offset, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q31( - q31_t *pSrc, - q31_t offset, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a floating-point vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q7 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a floating-point vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_f32( - float32_t value, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q7 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q7( - q7_t value, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q15 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q15( - q15_t value, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q31 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q31( - q31_t value, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ -void arm_conv_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ -void arm_conv_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ -void arm_conv_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ -void arm_conv_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** -* @brief Convolution of Q7 sequences. -* @param[in] pSrcA points to the first input sequence. -* @param[in] srcALen length of the first input sequence. -* @param[in] pSrcB points to the second input sequence. -* @param[in] srcBLen length of the second input sequence. -* @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. -* @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. -* @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). -*/ -void arm_conv_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst); - - -/** - * @brief Partial convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q7 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Instance structure for the Q15 FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_f32; - - -/** - * @brief Processing function for the floating-point FIR decimator. - * @param[in] S points to an instance of the floating-point FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_f32( - const arm_fir_decimate_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR decimator. - * @param[in,out] S points to an instance of the floating-point FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_f32( - arm_fir_decimate_instance_f32 *S, - uint16_t numTaps, - uint8_t M, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR decimator. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_q15( - const arm_fir_decimate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_fast_q15( - const arm_fir_decimate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR decimator. - * @param[in,out] S points to an instance of the Q15 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_q15( - arm_fir_decimate_instance_q15 *S, - uint16_t numTaps, - uint8_t M, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR decimator. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_q31( - const arm_fir_decimate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - -/** - * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_fast_q31( - arm_fir_decimate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR decimator. - * @param[in,out] S points to an instance of the Q31 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_q31( - arm_fir_decimate_instance_q31 *S, - uint16_t numTaps, - uint8_t M, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ -} arm_fir_interpolate_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ -} arm_fir_interpolate_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ -} arm_fir_interpolate_instance_f32; - - -/** - * @brief Processing function for the Q15 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_q15( - const arm_fir_interpolate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR interpolator. - * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_q15( - arm_fir_interpolate_instance_q15 *S, - uint8_t L, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_q31( - const arm_fir_interpolate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR interpolator. - * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_q31( - arm_fir_interpolate_instance_q31 *S, - uint8_t L, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point FIR interpolator. - * @param[in] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_f32( - const arm_fir_interpolate_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR interpolator. - * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_f32( - arm_fir_interpolate_instance_f32 *S, - uint8_t L, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the high precision Q31 Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ -} arm_biquad_cas_df1_32x64_ins_q31; - - -/** - * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cas_df1_32x64_q31( - const arm_biquad_cas_df1_32x64_ins_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cas_df1_32x64_init_q31( - arm_biquad_cas_df1_32x64_ins_q31 *S, - uint8_t numStages, - q31_t *pCoeffs, - q63_t *pState, - uint8_t postShift); - - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_df2T_instance_f32; - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_stereo_df2T_instance_f32; - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_df2T_instance_f64; - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df2T_f32( - const arm_biquad_cascade_df2T_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_stereo_df2T_f32( - const arm_biquad_cascade_stereo_df2T_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df2T_f64( - const arm_biquad_cascade_df2T_instance_f64 *S, - float64_t *pSrc, - float64_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df2T_init_f32( - arm_biquad_cascade_df2T_instance_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_stereo_df2T_init_f32( - arm_biquad_cascade_stereo_df2T_instance_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df2T_init_f64( - arm_biquad_cascade_df2T_instance_f64 *S, - uint8_t numStages, - float64_t *pCoeffs, - float64_t *pState); - - -/** - * @brief Instance structure for the Q15 FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_f32; - - -/** - * @brief Initialization function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_q15( - arm_fir_lattice_instance_q15 *S, - uint16_t numStages, - q15_t *pCoeffs, - q15_t *pState); - - -/** - * @brief Processing function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_q15( - const arm_fir_lattice_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_q31( - arm_fir_lattice_instance_q31 *S, - uint16_t numStages, - q31_t *pCoeffs, - q31_t *pState); - - -/** - * @brief Processing function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_q31( - const arm_fir_lattice_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_f32( - arm_fir_lattice_instance_f32 *S, - uint16_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Processing function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_f32( - const arm_fir_lattice_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_q15; - -/** - * @brief Instance structure for the Q31 IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_q31; - -/** - * @brief Instance structure for the floating-point IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_f32; - - -/** - * @brief Processing function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_f32( - const arm_iir_lattice_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_init_f32( - arm_iir_lattice_instance_f32 *S, - uint16_t numStages, - float32_t *pkCoeffs, - float32_t *pvCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_q31( - const arm_iir_lattice_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_init_q31( - arm_iir_lattice_instance_q31 *S, - uint16_t numStages, - q31_t *pkCoeffs, - q31_t *pvCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the Q15 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_q15( - const arm_iir_lattice_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process per call. - */ -void arm_iir_lattice_init_q15( - arm_iir_lattice_instance_q15 *S, - uint16_t numStages, - q15_t *pkCoeffs, - q15_t *pvCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the floating-point LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that controls filter coefficient updates. */ -} arm_lms_instance_f32; - - -/** - * @brief Processing function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_f32( - const arm_lms_instance_f32 *S, - float32_t *pSrc, - float32_t *pRef, - float32_t *pOut, - float32_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_init_f32( - arm_lms_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - float32_t mu, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ -} arm_lms_instance_q15; - - -/** - * @brief Initialization function for the Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_init_q15( - arm_lms_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - q15_t mu, - uint32_t blockSize, - uint32_t postShift); - - -/** - * @brief Processing function for Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_q15( - const arm_lms_instance_q15 *S, - q15_t *pSrc, - q15_t *pRef, - q15_t *pOut, - q15_t *pErr, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q31 LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ -} arm_lms_instance_q31; - - -/** - * @brief Processing function for Q31 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_q31( - const arm_lms_instance_q31 *S, - q31_t *pSrc, - q31_t *pRef, - q31_t *pOut, - q31_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q31 LMS filter. - * @param[in] S points to an instance of the Q31 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_init_q31( - arm_lms_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - q31_t mu, - uint32_t blockSize, - uint32_t postShift); - - -/** - * @brief Instance structure for the floating-point normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that control filter coefficient updates. */ - float32_t energy; /**< saves previous frame energy. */ - float32_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_f32; - - -/** - * @brief Processing function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_f32( - arm_lms_norm_instance_f32 *S, - float32_t *pSrc, - float32_t *pRef, - float32_t *pOut, - float32_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_init_f32( - arm_lms_norm_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - float32_t mu, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q31 normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q31_t *recipTable; /**< points to the reciprocal initial value table. */ - q31_t energy; /**< saves previous frame energy. */ - q31_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_q31; - - -/** - * @brief Processing function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_q31( - arm_lms_norm_instance_q31 *S, - q31_t *pSrc, - q31_t *pRef, - q31_t *pOut, - q31_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_norm_init_q31( - arm_lms_norm_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - q31_t mu, - uint32_t blockSize, - uint8_t postShift); - - -/** - * @brief Instance structure for the Q15 normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< Number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q15_t *recipTable; /**< Points to the reciprocal initial value table. */ - q15_t energy; /**< saves previous frame energy. */ - q15_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_q15; - - -/** - * @brief Processing function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_q15( - arm_lms_norm_instance_q15 *S, - q15_t *pSrc, - q15_t *pRef, - q15_t *pOut, - q15_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_norm_init_q15( - arm_lms_norm_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - q15_t mu, - uint32_t blockSize, - uint8_t postShift); - - -/** - * @brief Correlation of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst); - - -/** -* @brief Correlation of Q15 sequences -* @param[in] pSrcA points to the first input sequence. -* @param[in] srcALen length of the first input sequence. -* @param[in] pSrcB points to the second input sequence. -* @param[in] srcBLen length of the second input sequence. -* @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. -* @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. -*/ -void arm_correlate_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch); - - -/** - * @brief Correlation of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - -void arm_correlate_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - -void arm_correlate_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ -void arm_correlate_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch); - - -/** - * @brief Correlation of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ -void arm_correlate_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst); - - -/** - * @brief Instance structure for the floating-point sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_f32; - -/** - * @brief Instance structure for the Q31 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q31; - -/** - * @brief Instance structure for the Q15 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q15; - -/** - * @brief Instance structure for the Q7 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q7; - - -/** - * @brief Processing function for the floating-point sparse FIR filter. - * @param[in] S points to an instance of the floating-point sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_f32( - arm_fir_sparse_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - float32_t *pScratchIn, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point sparse FIR filter. - * @param[in,out] S points to an instance of the floating-point sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_f32( - arm_fir_sparse_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 sparse FIR filter. - * @param[in] S points to an instance of the Q31 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q31( - arm_fir_sparse_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - q31_t *pScratchIn, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 sparse FIR filter. - * @param[in,out] S points to an instance of the Q31 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q31( - arm_fir_sparse_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 sparse FIR filter. - * @param[in] S points to an instance of the Q15 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q15( - arm_fir_sparse_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - q15_t *pScratchIn, - q31_t *pScratchOut, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 sparse FIR filter. - * @param[in,out] S points to an instance of the Q15 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q15( - arm_fir_sparse_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q7 sparse FIR filter. - * @param[in] S points to an instance of the Q7 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q7( - arm_fir_sparse_instance_q7 *S, - q7_t *pSrc, - q7_t *pDst, - q7_t *pScratchIn, - q31_t *pScratchOut, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q7 sparse FIR filter. - * @param[in,out] S points to an instance of the Q7 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q7( - arm_fir_sparse_instance_q7 *S, - uint16_t numTaps, - q7_t *pCoeffs, - q7_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Floating-point sin_cos function. - * @param[in] theta input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cos output. - */ -void arm_sin_cos_f32( - float32_t theta, - float32_t *pSinVal, - float32_t *pCosVal); - - -/** - * @brief Q31 sin_cos function. - * @param[in] theta scaled input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cosine output. - */ -void arm_sin_cos_q31( - q31_t theta, - q31_t *pSinVal, - q31_t *pCosVal); - - -/** - * @brief Floating-point complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - -/** - * @brief Q31 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @ingroup groupController - */ - -/** - * @defgroup PID PID Motor Control - * - * A Proportional Integral Derivative (PID) controller is a generic feedback control - * loop mechanism widely used in industrial control systems. - * A PID controller is the most commonly used type of feedback controller. - * - * This set of functions implements (PID) controllers - * for Q15, Q31, and floating-point data types. The functions operate on a single sample - * of data and each call to the function returns a single processed value. - * S points to an instance of the PID control data structure. in - * is the input sample value. The functions return the output value. - * - * \par Algorithm: - *
- *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
- *    A0 = Kp + Ki + Kd
- *    A1 = (-Kp ) - (2 * Kd )
- *    A2 = Kd  
- * - * \par - * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant - * - * \par - * \image html PID.gif "Proportional Integral Derivative Controller" - * - * \par - * The PID controller calculates an "error" value as the difference between - * the measured output and the reference input. - * The controller attempts to minimize the error by adjusting the process control inputs. - * The proportional value determines the reaction to the current error, - * the integral value determines the reaction based on the sum of recent errors, - * and the derivative value determines the reaction based on the rate at which the error has been changing. - * - * \par Instance Structure - * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. - * A separate instance structure must be defined for each PID Controller. - * There are separate instance structure declarations for each of the 3 supported data types. - * - * \par Reset Functions - * There is also an associated reset function for each data type which clears the state array. - * - * \par Initialization Functions - * There is also an associated initialization function for each data type. - * The initialization function performs the following operations: - * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. - * - Zeros out the values in the state buffer. - * - * \par - * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. - * - * \par Fixed-Point Behavior - * Care must be taken when using the fixed-point versions of the PID Controller functions. - * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup PID - * @{ - */ - -/** - * @brief Process function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - */ -CMSIS_INLINE __STATIC_INLINE float32_t arm_pid_f32( - arm_pid_instance_f32 *S, - float32_t in) -{ - float32_t out; - - /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ - out = (S->A0 * in) + - (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - -} - -/** - * @brief Process function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 64-bit accumulator. - * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. - * Thus, if the accumulator result overflows it wraps around rather than clip. - * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. - * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. - */ -CMSIS_INLINE __STATIC_INLINE q31_t arm_pid_q31( - arm_pid_instance_q31 *S, - q31_t in) -{ - q63_t acc; - q31_t out; - - /* acc = A0 * x[n] */ - acc = (q63_t) S->A0 * in; - - /* acc += A1 * x[n-1] */ - acc += (q63_t) S->A1 * S->state[0]; - - /* acc += A2 * x[n-2] */ - acc += (q63_t) S->A2 * S->state[1]; - - /* convert output to 1.31 format to add y[n-1] */ - out = (q31_t)(acc >> 31u); - - /* out += y[n-1] */ - out += S->state[2]; - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); -} - - -/** - * @brief Process function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using a 64-bit internal accumulator. - * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. - * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. - * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. - * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. - * Lastly, the accumulator is saturated to yield a result in 1.15 format. - */ -CMSIS_INLINE __STATIC_INLINE q15_t arm_pid_q15( - arm_pid_instance_q15 *S, - q15_t in) -{ - q63_t acc; - q15_t out; - -#if defined (ARM_MATH_DSP) - __SIMD32_TYPE *vstate; - - /* Implementation of PID controller */ - - /* acc = A0 * x[n] */ - acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - vstate = __SIMD32_CONST(S->state); - acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t) * vstate, (uint64_t)acc); -#else - /* acc = A0 * x[n] */ - acc = ((q31_t) S->A0) * in; - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - acc += (q31_t) S->A1 * S->state[0]; - acc += (q31_t) S->A2 * S->state[1]; -#endif - - /* acc += y[n-1] */ - acc += (q31_t) S->state[2] << 15; - - /* saturate the output */ - out = (q15_t)(__SSAT((acc >> 15), 16)); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); -} - -/** - * @} end of PID group - */ - - -/** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ -arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 *src, - arm_matrix_instance_f32 *dst); - - -/** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ -arm_status arm_mat_inverse_f64( - const arm_matrix_instance_f64 *src, - arm_matrix_instance_f64 *dst); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup clarke Vector Clarke Transform - * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. - * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents - * in the two-phase orthogonal stator axis Ialpha and Ibeta. - * When Ialpha is superposed with Ia as shown in the figure below - * \image html clarke.gif Stator current space vector and its components in (a,b). - * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta - * can be calculated using only Ia and Ib. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeFormula.gif - * where Ia and Ib are the instantaneous stator phases and - * pIalpha and pIbeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup clarke - * @{ - */ - -/** - * - * @brief Floating-point Clarke transform - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - */ -CMSIS_INLINE __STATIC_INLINE void arm_clarke_f32( - float32_t Ia, - float32_t Ib, - float32_t *pIalpha, - float32_t *pIbeta) -{ - /* Calculate pIalpha using the equation, pIalpha = Ia */ - *pIalpha = Ia; - - /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ - *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); -} - - -/** - * @brief Clarke transform for Q31 version - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_clarke_q31( - q31_t Ia, - q31_t Ib, - q31_t *pIalpha, - q31_t *pIbeta) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIalpha from Ia by equation pIalpha = Ia */ - *pIalpha = Ia; - - /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ - product1 = (q31_t)(((q63_t) Ia * 0x24F34E8B) >> 30); - - /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ - product2 = (q31_t)(((q63_t) Ib * 0x49E69D16) >> 30); - - /* pIbeta is calculated by adding the intermediate products */ - *pIbeta = __QADD(product1, product2); -} - -/** - * @} end of clarke group - */ - -/** - * @brief Converts the elements of the Q7 vector to Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_q7_to_q31( - q7_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup inv_clarke Vector Inverse Clarke Transform - * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeInvFormula.gif - * where pIa and pIb are the instantaneous stator phases and - * Ialpha and Ibeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup inv_clarke - * @{ - */ - -/** -* @brief Floating-point Inverse Clarke transform -* @param[in] Ialpha input two-phase orthogonal vector axis alpha -* @param[in] Ibeta input two-phase orthogonal vector axis beta -* @param[out] pIa points to output three-phase coordinate a -* @param[out] pIb points to output three-phase coordinate b -*/ -CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t *pIa, - float32_t *pIb) -{ - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ - *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; -} - - -/** - * @brief Inverse Clarke transform for Q31 version - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the subtraction, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t *pIa, - q31_t *pIb) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ - product1 = (q31_t)(((q63_t)(Ialpha) * (0x40000000)) >> 31); - - /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ - product2 = (q31_t)(((q63_t)(Ibeta) * (0x6ED9EBA1)) >> 31); - - /* pIb is calculated by subtracting the products */ - *pIb = __QSUB(product2, product1); -} - -/** - * @} end of inv_clarke group - */ - -/** - * @brief Converts the elements of the Q7 vector to Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_q7_to_q15( - q7_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup park Vector Park Transform - * - * Forward Park transform converts the input two-coordinate vector to flux and torque components. - * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents - * from the stationary to the moving reference frame and control the spatial relationship between - * the stator vector current and rotor flux vector. - * If we consider the d axis aligned with the rotor flux, the diagram below shows the - * current vector and the relationship from the two reference frames: - * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkFormula.gif - * where Ialpha and Ibeta are the stator vector components, - * pId and pIq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup park - * @{ - */ - -/** - * @brief Floating-point Park transform - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * The function implements the forward Park transform. - * - */ -CMSIS_INLINE __STATIC_INLINE void arm_park_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t *pId, - float32_t *pIq, - float32_t sinVal, - float32_t cosVal) -{ - /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ - *pId = Ialpha * cosVal + Ibeta * sinVal; - - /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ - *pIq = -Ialpha * sinVal + Ibeta * cosVal; -} - - -/** - * @brief Park transform for Q31 version - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition and subtraction, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_park_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t *pId, - q31_t *pIq, - q31_t sinVal, - q31_t cosVal) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Ialpha * cosVal) */ - product1 = (q31_t)(((q63_t)(Ialpha) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * sinVal) */ - product2 = (q31_t)(((q63_t)(Ibeta) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Ialpha * sinVal) */ - product3 = (q31_t)(((q63_t)(Ialpha) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * cosVal) */ - product4 = (q31_t)(((q63_t)(Ibeta) * (cosVal)) >> 31); - - /* Calculate pId by adding the two intermediate products 1 and 2 */ - *pId = __QADD(product1, product2); - - /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ - *pIq = __QSUB(product4, product3); -} - -/** - * @} end of park group - */ - -/** - * @brief Converts the elements of the Q7 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q7_to_float( - q7_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @ingroup groupController - */ - -/** - * @defgroup inv_park Vector Inverse Park transform - * Inverse Park transform converts the input flux and torque components to two-coordinate vector. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkInvFormula.gif - * where pIalpha and pIbeta are the stator vector components, - * Id and Iq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup inv_park - * @{ - */ - -/** -* @brief Floating-point Inverse Park transform -* @param[in] Id input coordinate of rotor reference frame d -* @param[in] Iq input coordinate of rotor reference frame q -* @param[out] pIalpha points to output two-phase orthogonal vector axis alpha -* @param[out] pIbeta points to output two-phase orthogonal vector axis beta -* @param[in] sinVal sine value of rotation angle theta -* @param[in] cosVal cosine value of rotation angle theta -*/ -CMSIS_INLINE __STATIC_INLINE void arm_inv_park_f32( - float32_t Id, - float32_t Iq, - float32_t *pIalpha, - float32_t *pIbeta, - float32_t sinVal, - float32_t cosVal) -{ - /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ - *pIalpha = Id * cosVal - Iq * sinVal; - - /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ - *pIbeta = Id * sinVal + Iq * cosVal; -} - - -/** - * @brief Inverse Park transform for Q31 version - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_inv_park_q31( - q31_t Id, - q31_t Iq, - q31_t *pIalpha, - q31_t *pIbeta, - q31_t sinVal, - q31_t cosVal) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Id * cosVal) */ - product1 = (q31_t)(((q63_t)(Id) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Iq * sinVal) */ - product2 = (q31_t)(((q63_t)(Iq) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Id * sinVal) */ - product3 = (q31_t)(((q63_t)(Id) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Iq * cosVal) */ - product4 = (q31_t)(((q63_t)(Iq) * (cosVal)) >> 31); - - /* Calculate pIalpha by using the two intermediate products 1 and 2 */ - *pIalpha = __QSUB(product1, product2); - - /* Calculate pIbeta by using the two intermediate products 3 and 4 */ - *pIbeta = __QADD(product4, product3); -} - -/** - * @} end of Inverse park group - */ - - -/** - * @brief Converts the elements of the Q31 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_float( - q31_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - -/** - * @ingroup groupInterpolation - */ - -/** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
- *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
- *       where x0, x1 are nearest values of input x
- *             y0, y1 are nearest values to output y
- * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ - -/** - * @addtogroup LinearInterpolate - * @{ - */ - -/** - * @brief Process function for the floating-point Linear Interpolation Function. - * @param[in,out] S is an instance of the floating-point Linear Interpolation structure - * @param[in] x input sample to process - * @return y processed output sample. - * - */ -CMSIS_INLINE __STATIC_INLINE float32_t arm_linear_interp_f32( - arm_linear_interp_instance_f32 *S, - float32_t x) -{ - float32_t y; - float32_t x0, x1; /* Nearest input values */ - float32_t y0, y1; /* Nearest output values */ - float32_t xSpacing = S->xSpacing; /* spacing between input values */ - int32_t i; /* Index variable */ - float32_t *pYData = S->pYData; /* pointer to output table */ - - /* Calculation of index */ - i = (int32_t)((x - S->x1) / xSpacing); - - if (i < 0) - { - /* Iniatilize output for below specified range as least output value of table */ - y = pYData[0]; - } - else if ((uint32_t)i >= S->nValues) - { - /* Iniatilize output for above specified range as last output value of table */ - y = pYData[S->nValues - 1]; - } - else - { - /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; - - /* Read of nearest output values */ - y0 = pYData[i]; - y1 = pYData[i + 1]; - - /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); - - } - - /* returns output value */ - return (y); -} - - -/** -* -* @brief Process function for the Q31 Linear Interpolation Function. -* @param[in] pYData pointer to Q31 Linear Interpolation table -* @param[in] x input sample to process -* @param[in] nValues number of table values -* @return y processed output sample. -* -* \par -* Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. -* This function can support maximum of table size 2^12. -* -*/ -CMSIS_INLINE __STATIC_INLINE q31_t arm_linear_interp_q31( - q31_t *pYData, - q31_t x, - uint32_t nValues) -{ - q31_t y; /* output */ - q31_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (q31_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* shift left by 11 to keep fract in 1.31 format */ - fract = (x & 0x000FFFFF) << 11; - - /* Read two nearest output values from the index in 1.31(q31) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 2.30 format */ - y = ((q31_t)((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); - - /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ - y += ((q31_t)(((q63_t) y1 * fract) >> 32)); - - /* Convert y to 1.31 format */ - return (y << 1u); - } -} - - -/** - * - * @brief Process function for the Q15 Linear Interpolation Function. - * @param[in] pYData pointer to Q15 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ -CMSIS_INLINE __STATIC_INLINE q15_t arm_linear_interp_q15( - q15_t *pYData, - q31_t x, - uint32_t nValues) -{ - q63_t y; /* output */ - q15_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (int32_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 13.35 format */ - y = ((q63_t) y0 * (0xFFFFF - fract)); - - /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ - y += ((q63_t) y1 * (fract)); - - /* convert y to 1.15 format */ - return (q15_t)(y >> 20); - } -} - - -/** - * - * @brief Process function for the Q7 Linear Interpolation Function. - * @param[in] pYData pointer to Q7 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - */ -CMSIS_INLINE __STATIC_INLINE q7_t arm_linear_interp_q7( - q7_t *pYData, - q31_t x, - uint32_t nValues) -{ - q31_t y; /* output */ - q7_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - uint32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - if (x < 0) - { - return (pYData[0]); - } - index = (x >> 20) & 0xfff; - - if (index >= (nValues - 1)) - { - return (pYData[nValues - 1]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index and are in 1.7(q7) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ - y = ((y0 * (0xFFFFF - fract))); - - /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ - y += (y1 * fract); - - /* convert y to 1.7(q7) format */ - return (q7_t)(y >> 20); - } -} - -/** - * @} end of LinearInterpolate group - */ - -/** - * @brief Fast approximation to the trigonometric sine function for floating-point data. - * @param[in] x input value in radians. - * @return sin(x). - */ -float32_t arm_sin_f32( - float32_t x); - - -/** - * @brief Fast approximation to the trigonometric sine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ -q31_t arm_sin_q31( - q31_t x); - - -/** - * @brief Fast approximation to the trigonometric sine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ -q15_t arm_sin_q15( - q15_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for floating-point data. - * @param[in] x input value in radians. - * @return cos(x). - */ -float32_t arm_cos_f32( - float32_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ -q31_t arm_cos_q31( - q31_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ -q15_t arm_cos_q15( - q15_t x); - - -/** - * @ingroup groupFastMath - */ - - -/** - * @defgroup SQRT Square Root - * - * Computes the square root of a number. - * There are separate functions for Q15, Q31, and floating-point data types. - * The square root function is computed using the Newton-Raphson algorithm. - * This is an iterative algorithm of the form: - *
- *      x1 = x0 - f(x0)/f'(x0)
- * 
- * where x1 is the current estimate, - * x0 is the previous estimate, and - * f'(x0) is the derivative of f() evaluated at x0. - * For the square root function, the algorithm reduces to: - *
- *     x0 = in/2                         [initial guess]
- *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
- * 
- */ - - -/** - * @addtogroup SQRT - * @{ - */ - -/** - * @brief Floating-point square root function. - * @param[in] in input value. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -CMSIS_INLINE __STATIC_INLINE arm_status arm_sqrt_f32( - float32_t in, - float32_t *pOut) -{ - if (in >= 0.0f) - { - -#if (__FPU_USED == 1) && defined ( __CC_ARM ) - *pOut = __sqrtf(in); -#elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined(__GNUC__) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) - __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); -#else - *pOut = sqrtf(in); -#endif - - return (ARM_MATH_SUCCESS); - } - else - { - *pOut = 0.0f; - return (ARM_MATH_ARGUMENT_ERROR); - } -} - - -/** - * @brief Q31 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -arm_status arm_sqrt_q31( - q31_t in, - q31_t *pOut); - - -/** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -arm_status arm_sqrt_q15( - q15_t in, - q15_t *pOut); - -/** - * @} end of SQRT group - */ - - -/** - * @brief floating-point Circular write function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_f32( - int32_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const int32_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - - -/** - * @brief floating-point Circular Read function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularRead_f32( - int32_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - int32_t *dst, - int32_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (int32_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Q15 Circular write function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q15( - q15_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const q15_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - -/** - * @brief Q15 Circular Read function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q15( - q15_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - q15_t *dst, - q15_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q15_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update wOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Q7 Circular write function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q7( - q7_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const q7_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - -/** - * @brief Q7 Circular Read function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q7( - q7_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - q7_t *dst, - q7_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q7_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Sum of the squares of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q31( - q31_t *pSrc, - uint32_t blockSize, - q63_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q15( - q15_t *pSrc, - uint32_t blockSize, - q63_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q7( - q7_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Mean value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *pResult); - - -/** - * @brief Mean value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Mean value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Mean value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Variance of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Variance of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Variance of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Standard deviation of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Standard deviation of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Standard deviation of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Floating-point complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_q15( - q15_t *pSrcA, - q15_t *pSrcB, - uint32_t numSamples, - q31_t *realResult, - q31_t *imagResult); - - -/** - * @brief Q31 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_q31( - q31_t *pSrcA, - q31_t *pSrcB, - uint32_t numSamples, - q63_t *realResult, - q63_t *imagResult); - - -/** - * @brief Floating-point complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_f32( - float32_t *pSrcA, - float32_t *pSrcB, - uint32_t numSamples, - float32_t *realResult, - float32_t *imagResult); - - -/** - * @brief Q15 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_q15( - q15_t *pSrcCmplx, - q15_t *pSrcReal, - q15_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_q31( - q31_t *pSrcCmplx, - q31_t *pSrcReal, - q31_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_f32( - float32_t *pSrcCmplx, - float32_t *pSrcReal, - float32_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Minimum value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] result is output pointer - * @param[in] index is the array index of the minimum value in the input buffer. - */ -void arm_min_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *result, - uint32_t *index); - - -/** - * @brief Minimum value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[in] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Minimum value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Minimum value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q7 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q15 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q31 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a floating-point vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Q15 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Converts the elements of the floating-point vector to Q31 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q31 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q31( - float32_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the floating-point vector to Q15 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q15( - float32_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the floating-point vector to Q7 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q7 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q7( - float32_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q31 vector to Q15 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_q15( - q31_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q31 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_q7( - q31_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_float( - q15_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to Q31 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_q31( - q15_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_q7( - q15_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @ingroup groupInterpolation - */ - -/** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
- *   typedef struct
- *   {
- *     uint16_t numRows;
- *     uint16_t numCols;
- *     float32_t *pData;
- * } arm_bilinear_interp_instance_f32;
- * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
- *     XF = floor(x)
- *     YF = floor(y)
- * 
- * \par - * The interpolated output point is computed as: - *
- *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
- *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
- *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
- *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
- * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ - -/** - * @addtogroup BilinearInterpolate - * @{ - */ - - -/** -* -* @brief Floating-point bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate. -* @param[in] Y interpolation coordinate. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE float32_t arm_bilinear_interp_f32( - const arm_bilinear_interp_instance_f32 *S, - float32_t X, - float32_t Y) -{ - float32_t out; - float32_t f00, f01, f10, f11; - float32_t *pData = S->pData; - int32_t xIndex, yIndex, index; - float32_t xdiff, ydiff; - float32_t b1, b2, b3, b4; - - xIndex = (int32_t) X; - yIndex = (int32_t) Y; - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) - { - return (0); - } - - /* Calculation of index for two nearest points in X-direction */ - index = (xIndex - 1) + (yIndex - 1) * S->numCols; - - - /* Read two nearest points in X-direction */ - f00 = pData[index]; - f01 = pData[index + 1]; - - /* Calculation of index for two nearest points in Y-direction */ - index = (xIndex - 1) + (yIndex) * S->numCols; - - - /* Read two nearest points in Y-direction */ - f10 = pData[index]; - f11 = pData[index + 1]; - - /* Calculation of intermediate values */ - b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; - - /* Calculation of fractional part in X */ - xdiff = X - xIndex; - - /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; - - /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; - - /* return to application */ - return (out); -} - - -/** -* -* @brief Q31 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE q31_t arm_bilinear_interp_q31( - arm_bilinear_interp_instance_q31 *S, - q31_t X, - q31_t Y) -{ - q31_t out; /* Temporary output */ - q31_t acc = 0; /* output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q31_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q31_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* shift left xfract by 11 to keep 1.31 format */ - xfract = (X & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; - x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; - - /* 20 bits for the fractional part */ - /* shift left yfract by 11 to keep 1.31 format */ - yfract = (Y & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; - y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ - out = ((q31_t)(((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); - acc = ((q31_t)(((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); - - /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); - acc += ((q31_t)((q63_t) out * (xfract) >> 32)); - - /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); - acc += ((q31_t)((q63_t) out * (yfract) >> 32)); - - /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) y2 * (xfract) >> 32)); - acc += ((q31_t)((q63_t) out * (yfract) >> 32)); - - /* Convert acc to 1.31(q31) format */ - return ((q31_t)(acc << 2)); -} - - -/** -* @brief Q15 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15( - arm_bilinear_interp_instance_q15 *S, - q31_t X, - q31_t Y) -{ - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q15_t x1, x2, y1, y2; /* Nearest output values */ - q31_t xfract, yfract; /* X, Y fractional parts */ - int32_t rI, cI; /* Row and column indices */ - q15_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ - - /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ - /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ - out = (q31_t)(((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); - acc = ((q63_t) out * (0xFFFFF - yfract)); - - /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); - acc += ((q63_t) out * (xfract)); - - /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) y2 * (xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* acc is in 13.51 format and down shift acc by 36 times */ - /* Convert out to 1.15 format */ - return ((q15_t)(acc >> 36)); -} - - -/** -* @brief Q7 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7( - arm_bilinear_interp_instance_q7 *S, - q31_t X, - q31_t Y) -{ - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q7_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q7_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ - out = ((x1 * (0xFFFFF - xfract))); - acc = (((q63_t) out * (0xFFFFF - yfract))); - - /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ - out = ((x2 * (0xFFFFF - yfract))); - acc += (((q63_t) out * (xfract))); - - /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y1 * (0xFFFFF - xfract))); - acc += (((q63_t) out * (yfract))); - - /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y2 * (yfract))); - acc += (((q63_t) out * (xfract))); - - /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ - return ((q7_t)(acc >> 40)); -} - -/** - * @} end of BilinearInterpolate group - */ - - -/* SMMLAR */ -#define multAcc_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMLSR */ -#define multSub_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMULR */ -#define mult_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) - -/* SMMLA */ -#define multAcc_32x32_keep32(a, x, y) \ - a += (q31_t) (((q63_t) x * y) >> 32) - -/* SMMLS */ -#define multSub_32x32_keep32(a, x, y) \ - a -= (q31_t) (((q63_t) x * y) >> 32) - -/* SMMUL */ -#define mult_32x32_keep32(a, x, y) \ - a = (q31_t) (((q63_t) x * y ) >> 32) - - -#if defined ( __CC_ARM ) -/* Enter low optimization region - place directly above function definition */ -#if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) -#define LOW_OPTIMIZATION_ENTER \ - _Pragma ("push") \ - _Pragma ("O1") -#else -#define LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) -#define LOW_OPTIMIZATION_EXIT \ - _Pragma ("pop") -#else -#define LOW_OPTIMIZATION_EXIT -#endif - -/* Enter low optimization region - place directly above function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER - -/* Exit low optimization region - place directly after end of function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined (__ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __GNUC__ ) -#define LOW_OPTIMIZATION_ENTER \ - __attribute__(( optimize("-O1") )) -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __ICCARM__ ) -/* Enter low optimization region - place directly above function definition */ -#if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) -#define LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") -#else -#define LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#define LOW_OPTIMIZATION_EXIT - -/* Enter low optimization region - place directly above function definition */ -#if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") -#else -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __TI_ARM__ ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __CSMC__ ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __TASKING__ ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#endif - - -#ifdef __cplusplus -} -#endif - -/* Compiler specific diagnostic adjustment */ -#if defined ( __CC_ARM ) - -#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) - -#elif defined ( __GNUC__ ) - #pragma GCC diagnostic pop - -#elif defined ( __ICCARM__ ) - -#elif defined ( __TI_ARM__ ) - -#elif defined ( __CSMC__ ) - -#elif defined ( __TASKING__ ) - -#else - #error Unknown compiler -#endif - -#endif /* _ARM_MATH_H */ - -/** - * - * End of file. - */ diff --git a/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armcc.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armcc.h deleted file mode 100644 index 1d6a5fbd5c5..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armcc.h +++ /dev/null @@ -1,814 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc.h - * @brief CMSIS compiler ARMCC (ARM compiler V5) header file - * @version V5.0.2 - * @date 13. February 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#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 - -/* ########################### 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)) ) */ - - -#if ((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 -} - -#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __rev - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_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; - int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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) - -#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/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armclang.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armclang.h deleted file mode 100644 index 2148297082b..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_armclang.h +++ /dev/null @@ -1,1802 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang.h - * @brief CMSIS compiler ARMCLANG (ARM compiler V6) header file - * @version V5.0.3 - * @date 27. March 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 - -#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 __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 - - -/* ########################### 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_SP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return(result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - - return(result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -/* #define __get_FPSCR __builtin_arm_get_fpscr */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - uint32_t result; - - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - return(result); -#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 - */ -/* #define __set_FPSCR __builtin_arm_set_fpscr */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "memory"); -#else - (void)fpscr; -#endif -} - -#endif /* ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __builtin_bswap32 - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16 __builtin_bswap16 /* ToDo ARMCLANG: check if __builtin_bswap16 could be used */ -#if 0 -__attribute__((always_inline)) __STATIC_INLINE 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); -} -#endif - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ - /* ToDo ARMCLANG: check if __builtin_bswap16 could be used */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ - int32_t result; - - __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ - /* ToDo ARMCLANG: check if __builtin_arm_rbit is supported */ -__attribute__((always_inline)) __STATIC_INLINE 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 - int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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)) - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) ) - -__attribute__((always_inline)) __STATIC_INLINE 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/nuvoton/libraries/m2354/CMSIS/Include/cmsis_compiler.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_compiler.h deleted file mode 100644 index 971380b7d1e..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_compiler.h +++ /dev/null @@ -1,368 +0,0 @@ -/**************************************************************************//** - * @file cmsis_compiler.h - * @brief CMSIS compiler generic header file - * @version V5.0.2 - * @date 13. February 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#include "cmsis_armclang.h" - - -/* - * GNU Compiler - */ -#elif defined ( __GNUC__ ) -#include "cmsis_gcc.h" - - -/* - * IAR Compiler - */ -#elif defined ( __ICCARM__ ) - - -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif - -#include - -/* CMSIS compiler control architecture macros */ -#if (__CORE__ == __ARM6M__) || (__CORE__ == __ARM6SM__) - #ifndef __ARM_ARCH_6M__ - #define __ARM_ARCH_6M__ 1 - #endif -#elif (__CORE__ == __ARM7M__) - #ifndef __ARM_ARCH_7M__ - #define __ARM_ARCH_7M__ 1 - #endif -#elif (__CORE__ == __ARM7EM__) - #ifndef __ARM_ARCH_7EM__ - #define __ARM_ARCH_7EM__ 1 - #endif -#endif - -#ifndef __NO_RETURN - #define __NO_RETURN __noreturn -#endif -#ifndef __USED - #define __USED __root -#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 - -// Workaround for missing __CLZ intrinsic in -// various versions of the IAR compilers. -// __IAR_FEATURE_CLZ__ should be defined by -// the compiler that supports __CLZ internally. -#if (defined (__ARM_ARCH_6M__)) && (__ARM_ARCH_6M__ == 1) && (!defined (__IAR_FEATURE_CLZ__)) -__STATIC_INLINE uint32_t __CLZ(uint32_t data) -{ - if (data == 0u) - { - return 32u; - } - - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while ((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); -} -#endif - - -/* - * 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 __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 - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT -#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 __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 - - -/* - * 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 __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 - - -#else -#error Unknown compiler. -#endif - - -#endif /* __CMSIS_COMPILER_H */ - diff --git a/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_gcc.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_gcc.h deleted file mode 100644 index 05f75703940..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_gcc.h +++ /dev/null @@ -1,1979 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS compiler GCC header file - * @version V5.0.2 - * @date 13. February 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 __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 - - -/* ########################### 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_SP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return(result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - - return(result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE 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) || (__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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) || (__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 -} - -#endif /* ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - - -/*@} 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. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) -//{ -// __ASM volatile ("nop"); -//} -#define __NOP() __ASM volatile ("nop") /* This implementation generates debug information */ - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) -//{ -// __ASM volatile ("wfi"); -//} -#define __WFI() __ASM volatile ("wfi") /* This implementation generates debug information */ - - -/** - \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. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) -//{ -// __ASM volatile ("wfe"); -//} -#define __WFE() __ASM volatile ("wfe") /* This implementation generates debug information */ - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) -//{ -// __ASM volatile ("sev"); -//} -#define __SEV() __ASM volatile ("sev") /* This implementation generates debug information */ - - -/** - \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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (short)__builtin_bswap16(value); -#else - int32_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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT(ARG1,ARG2) \ -({ \ - 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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1,ARG2) \ -({ \ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 (__ARM_FEATURE_DSP == 1) /* ToDo ARMCLANG: This should be ARCH >= ARMv7-M + SIMD */ - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) ) - -__attribute__((always_inline)) __STATIC_INLINE 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/nuvoton/libraries/m2354/CMSIS/Include/cmsis_version.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_version.h deleted file mode 100644 index d458a6c8599..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/cmsis_version.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************//** - * @file cmsis_version.h - * @brief CMSIS Core(M) Version definitions - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 ( 0U) /*!< [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/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mbl.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mbl.h deleted file mode 100644 index f37a244eda8..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mbl.h +++ /dev/null @@ -1,1878 +0,0 @@ -/**************************************************************************//** - * @file core_armv8mbl.h - * @brief CMSIS ARMv8MBL Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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_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 -{ - __IOM 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 */ - __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 */ - uint32_t RESERVED0[7U]; - __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; - -/* 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 ARMv8-M Baseline */ -/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for ARMv8-M Baseline */ -#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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } -} - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 */ - - -/* ########################## 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/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mml.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mml.h deleted file mode 100644 index 060d81e3237..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_armv8mml.h +++ /dev/null @@ -1,2902 +0,0 @@ -/**************************************************************************//** - * @file core_armv8mml.h - * @brief CMSIS ARMv8MML Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#if defined __ARM_PCS_VFP -#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_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 */ - 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_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 -{ - __IOM 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 */ - __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]; - __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; - -/* 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_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHPR[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB_NS->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB_NS->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ - -/*@} 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) -{ - 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/nuvoton/libraries/m2354/CMSIS/Include/core_cm0.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm0.h deleted file mode 100644 index f78676fbb4f..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm0.h +++ /dev/null @@ -1,888 +0,0 @@ -/**************************************************************************//** - * @file core_cm0.h - * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 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_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 not available for Cortex-M0 */ -/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for Cortex-M0 */ -#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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_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[0U] & (1UL << (((uint32_t)(int32_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)(int32_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)(int32_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)(int32_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)(int32_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. - 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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m2354/CMSIS/Include/core_cm0plus.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm0plus.h deleted file mode 100644 index d301f0437a6..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm0plus.h +++ /dev/null @@ -1,1021 +0,0 @@ -/**************************************************************************//** - * @file core_cm0plus.h - * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 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 */ -#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; - -/* 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 not available for Cortex-M0+ */ -/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for Cortex-M0+ */ -#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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_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[0U] & (1UL << (((uint32_t)(int32_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)(int32_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)(int32_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)(int32_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)(int32_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. - 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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m2354/CMSIS/Include/core_cm23.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm23.h deleted file mode 100644 index b97fa9dd3f0..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm23.h +++ /dev/null @@ -1,1878 +0,0 @@ -/**************************************************************************//** - * @file core_cm23.h - * @brief CMSIS Cortex-M23 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP - #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_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 -{ - __IOM 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 */ - __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 */ - uint32_t RESERVED0[7U]; - __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; - -/* 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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } -} - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 */ - - -/* ########################## 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/nuvoton/libraries/m2354/CMSIS/Include/core_cm3.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm3.h deleted file mode 100644 index d2761ceb16d..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm3.h +++ /dev/null @@ -1,1928 +0,0 @@ -/**************************************************************************//** - * @file core_cm3.h - * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 RSERVED1[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 */ - -#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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHP[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHP[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m2354/CMSIS/Include/core_cm33.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm33.h deleted file mode 100644 index 9753b3e993e..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm33.h +++ /dev/null @@ -1,2898 +0,0 @@ -/**************************************************************************//** - * @file core_cm33.h - * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#if defined __ARM_PCS_VFP -#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_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 */ - 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_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 -{ - __IOM 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 */ - __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]; - __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; - -/* 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_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHPR[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } -} - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB_NS->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB_NS->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ - -/*@} 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) -{ - 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/nuvoton/libraries/m2354/CMSIS/Include/core_cm4.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm4.h deleted file mode 100644 index 56e9e82b92e..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm4.h +++ /dev/null @@ -1,2113 +0,0 @@ -/**************************************************************************//** - * @file core_cm4.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 RSERVED1[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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 /* 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 */ -} 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 */ - -/*@} 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHP[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHP[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m2354/CMSIS/Include/core_cm7.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm7.h deleted file mode 100644 index bf701fe8ef4..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_cm7.h +++ /dev/null @@ -1,2655 +0,0 @@ -/**************************************************************************//** - * @file core_cm7.h - * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP - #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 RSERVED1[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_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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 /* 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 */ - -/*@} 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)SCB->SHPR[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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 ) - - -/** - \brief Enable I-Cache - \details Turns on I-Cache - */ -__STATIC_INLINE void SCB_EnableICache (void) -{ - #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) - __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_INLINE 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_INLINE void SCB_InvalidateICache (void) -{ - #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Enable D-Cache - \details Turns on D-Cache - */ -__STATIC_INLINE void SCB_EnableDCache (void) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_DisableDCache (void) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - register uint32_t ccsidr; - register uint32_t sets; - register uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_InvalidateDCache (void) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_CleanDCache (void) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_CleanInvalidateDCache (void) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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 - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t)addr; - int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCIMVAC = op_addr; - op_addr += (uint32_t)linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Clean by address - \details Cleans D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCCMVAC = op_addr; - op_addr += (uint32_t)linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Clean and Invalidate by address - \details Cleans and invalidates D_Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCCIMVAC = op_addr; - op_addr += (uint32_t)linesize; - op_size -= linesize; - } - - __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/nuvoton/libraries/m2354/CMSIS/Include/core_sc000.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_sc000.h deleted file mode 100644 index bd26eaa0db9..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_sc000.h +++ /dev/null @@ -1,1016 +0,0 @@ -/**************************************************************************//** - * @file core_sc000.h - * @brief CMSIS SC000 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP - #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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_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[0U] & (1UL << (((uint32_t)(int32_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)(int32_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)(int32_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)(int32_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)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m2354/CMSIS/Include/core_sc300.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_sc300.h deleted file mode 100644 index 780372a350c..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/core_sc300.h +++ /dev/null @@ -1,1903 +0,0 @@ -/**************************************************************************//** - * @file core_sc300.h - * @brief CMSIS SC300 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP - #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 RSERVED1[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 */ - uint32_t RESERVED1[1U]; -} 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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHP[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)SCB->SHP[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m2354/CMSIS/Include/mpu_armv7.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/mpu_armv7.h deleted file mode 100644 index d678faa98df..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/mpu_armv7.h +++ /dev/null @@ -1,183 +0,0 @@ -/****************************************************************************** - * @file mpu_armv7.h - * @brief CMSIS MPU API for ARMv7 MPU - * @version V5.0.2 - * @date 09. June 2017 - ******************************************************************************/ -/* - * Copyright (c) 2017 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 ARM_MPU_ARMV7_H -#define ARM_MPU_ARMV7_H - -#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) -#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) -#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) -#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) -#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) -#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) -#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) -#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) -#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) -#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) -#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) -#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) -#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) -#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) -#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) -#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) -#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) -#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) -#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) -#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) -#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) -#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) -#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) -#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) -#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) -#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) -#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) -#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) - -#define ARM_MPU_AP_NONE 0u -#define ARM_MPU_AP_PRIV 1u -#define ARM_MPU_AP_URO 2u -#define ARM_MPU_AP_FULL 3u -#define ARM_MPU_AP_PRO 5u -#define ARM_MPU_AP_RO 6u - -/** 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) | (1UL << MPU_RBAR_VALID_Pos)) - -/** -* MPU Region Attribut 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) \ - ((DisableExec << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \ - ((AccessPermission << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \ - ((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) | \ - ((SubRegionDisable << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \ - ((Size << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \ - ((1UL << MPU_RASR_ENABLE_Pos) & MPU_RASR_ENABLE_Msk) - - -/** -* Struct for a single MPU Region -*/ -typedef struct _ARM_MPU_Region_t -{ - 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) -{ - __DSB(); - __ISB(); - MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; -#endif -} - -/** Disable the MPU. -*/ -__STATIC_INLINE void ARM_MPU_Disable() -{ - __DSB(); - __ISB(); -#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 orderedCpy(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) -{ - orderedCpy(&(MPU->RBAR), &(table->RBAR), cnt * sizeof(ARM_MPU_Region_t) / 4u); -} - -#endif diff --git a/bsp/nuvoton/libraries/m2354/CMSIS/Include/tz_context.h b/bsp/nuvoton/libraries/m2354/CMSIS/Include/tz_context.h deleted file mode 100644 index ecc24c079f3..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/Include/tz_context.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2015-2016 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. - * - * ---------------------------------------------------------------------------- - * - * $Date: 21. September 2016 - * $Revision: V1.0 - * - * Project: TrustZone for ARMv8-M - * Title: Context Management for ARMv8-M TrustZone - * - * Version 1.0 - * Initial Release - *---------------------------------------------------------------------------*/ - -#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/nuvoton/libraries/m2354/CMSIS/SConscript b/bsp/nuvoton/libraries/m2354/CMSIS/SConscript deleted file mode 100644 index 904fca41463..00000000000 --- a/bsp/nuvoton/libraries/m2354/CMSIS/SConscript +++ /dev/null @@ -1,16 +0,0 @@ -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(""" -""") - -path = [cwd + '/Include',] - -group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/M2354.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/M2354.h deleted file mode 100644 index 8ef3b514e27..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/M2354.h +++ /dev/null @@ -1,1101 +0,0 @@ -/**************************************************************************//** - * @file M2354.h - * @version V3.0 - * @brief Peripheral Access Layer Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ - -/** - \mainpage Introduction - * - * - * This user manual describes the usage of M2354 device driver - * - * Disclaimer - * - * The Software is furnished "AS IS", without warranty as to performance or results, and - * the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all - * warranties, express, implied or otherwise, with regard to the Software, its use, or - * operation, including without limitation any and all warranties of merchantability, fitness - * for a particular purpose, and non-infringement of intellectual property rights. - * - */ - - -#ifndef __M2354_H__ -#define __M2354_H__ - -/*=============================================================================*/ -typedef volatile unsigned char vu8; -typedef volatile unsigned int vu32; -typedef volatile unsigned short vu16; -#define M8(adr) (*((vu8 *) (adr))) -#define M16(adr) (*((vu16 *) (adr))) -#define M32(adr) (*((vu32 *) (adr))) - -#define outpw(port,value) (*((volatile unsigned int *)(port))=(value)) -#define inpw(port) ((*((volatile unsigned int *)(port)))) -#define outpb(port,value) (*((volatile unsigned char *)(port))=(value)) -#define inpb(port) ((*((volatile unsigned char *)(port)))) -#define outps(port,value) (*((volatile unsigned short *)(port))=(value)) -#define inps(port) ((*((volatile unsigned short *)(port)))) - -#define outp32(port,value) (*((volatile unsigned int *)(port))=(value)) -#define inp32(port) ((*((volatile unsigned int *)(port)))) -#define outp8(port,value) (*((volatile unsigned char *)(port))=(value)) -#define inp8(port) ((*((volatile unsigned char *)(port)))) -#define outp16(port,value) (*((volatile unsigned short *)(port))=(value)) -#define inp16(port) ((*((volatile unsigned short *)(port)))) - - -#define E_SUCCESS 0 - -#define TRUE (1L) -#define FALSE (0L) - -#define ENABLE 1 -#define DISABLE 0 - -/* Bit Mask Definitions */ -#define BIT0 0x00000001UL -#define BIT1 0x00000002UL -#define BIT2 0x00000004UL -#define BIT3 0x00000008UL -#define BIT4 0x00000010UL -#define BIT5 0x00000020UL -#define BIT6 0x00000040UL -#define BIT7 0x00000080UL -#define BIT8 0x00000100UL -#define BIT9 0x00000200UL -#define BIT10 0x00000400UL -#define BIT11 0x00000800UL -#define BIT12 0x00001000UL -#define BIT13 0x00002000UL -#define BIT14 0x00004000UL -#define BIT15 0x00008000UL -#define BIT16 0x00010000UL -#define BIT17 0x00020000UL -#define BIT18 0x00040000UL -#define BIT19 0x00080000UL -#define BIT20 0x00100000UL -#define BIT21 0x00200000UL -#define BIT22 0x00400000UL -#define BIT23 0x00800000UL -#define BIT24 0x01000000UL -#define BIT25 0x02000000UL -#define BIT26 0x04000000UL -#define BIT27 0x08000000UL -#define BIT28 0x10000000UL -#define BIT29 0x20000000UL -#define BIT30 0x40000000UL -#define BIT31 0x80000000UL - - -/* Byte Mask Definitions */ -#define BYTE0_Msk (0x000000FFUL) -#define BYTE1_Msk (0x0000FF00UL) -#define BYTE2_Msk (0x00FF0000UL) -#define BYTE3_Msk (0xFF000000UL) - -#define _GET_BYTE0(u32Param) (((u32Param) & BYTE0_Msk) ) /*!< Extract Byte 0 (Bit 0~ 7) from parameter u32Param */ -#define _GET_BYTE1(u32Param) (((u32Param) & BYTE1_Msk) >> 8UL) /*!< Extract Byte 1 (Bit 8~15) from parameter u32Param */ -#define _GET_BYTE2(u32Param) (((u32Param) & BYTE2_Msk) >> 16UL) /*!< Extract Byte 2 (Bit 16~23) from parameter u32Param */ -#define _GET_BYTE3(u32Param) (((u32Param) & BYTE3_Msk) >> 24UL) /*!< Extract Byte 3 (Bit 24~31) from parameter u32Param */ - - - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************/ -/* Processor and Core Peripherals */ -/******************************************************************************/ -/** @addtogroup CMSIS_Device CMSIS Definitions - Configuration of the Cortex-M23 Processor and Core Peripherals - @{ -*/ - - -/* - * ========================================================================== - * ---------- Interrupt Number Definition ----------------------------------- - * ========================================================================== - */ - -/** - * @details Interrupt Number Definition. The maximum of 32 Specific Interrupts are possible. - */ -typedef enum IRQn -{ - /****** Cortex-M0 Processor Exceptions Numbers ***************************************************/ - NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /*!< 3 Cortex-M23 Hard Fault Interrupt */ - SVCall_IRQn = -5, /*!< 11 Cortex-M23 SV Call Interrupt */ - PendSV_IRQn = -2, /*!< 14 Cortex-M23 Pend SV Interrupt */ - SysTick_IRQn = -1, /*!< 15 Cortex-M23 System Tick Interrupt */ - - /****** ARMIKMCU Swift specific Interrupt Numbers ************************************************/ - - BOD_IRQn = 0, /*!< Brown Out detection Interrupt */ - IRC_IRQn = 1, /*!< Internal RC Interrupt */ - PWRWU_IRQn = 2, /*!< Power Down Wake Up Interrupt */ - RAMPE_IRQn = 3, /*!< SRAM parity check failed Interrupt */ - CKFAIL_IRQn = 4, /*!< Clock failed Interrupt */ - ISP_IRQn = 5, /*!< FMC ISP Interrupt */ - RTC_IRQn = 6, /*!< Real Time Clock Interrupt */ - RTC_TAMPER_IRQn = 7, /*!< RTC Tamper detection Interrupt */ - WDT_IRQn = 8, /*!< Watchdog Timer Interrupt */ - WWDT_IRQn = 9, /*!< Window Watchdog Timer Interrupt */ - EINT0_IRQn = 10, /*!< External Input 0 Interrupt */ - EINT1_IRQn = 11, /*!< External Input 1 Interrupt */ - EINT2_IRQn = 12, /*!< External Input 2 Interrupt */ - EINT3_IRQn = 13, /*!< External Input 3 Interrupt */ - EINT4_IRQn = 14, /*!< External Input 4 Interrupt */ - EINT5_IRQn = 15, /*!< External Input 5 Interrupt */ - GPA_IRQn = 16, /*!< GPIO Port A Interrupt */ - GPB_IRQn = 17, /*!< GPIO Port B Interrupt */ - GPC_IRQn = 18, /*!< GPIO Port C Interrupt */ - GPD_IRQn = 19, /*!< GPIO Port D Interrupt */ - GPE_IRQn = 20, /*!< GPIO Port E Interrupt */ - GPF_IRQn = 21, /*!< GPIO Port F Interrupt */ - QSPI0_IRQn = 22, /*!< QSPI0 Interrupt */ - SPI0_IRQn = 23, /*!< SPI0 Interrupt */ - BRAKE0_IRQn = 24, /*!< BRAKE0 Interrupt */ - EPWM0_P0_IRQn = 25, /*!< EPWM0P0 Interrupt */ - EPWM0_P1_IRQn = 26, /*!< EPWM0P1 Interrupt */ - EPWM0_P2_IRQn = 27, /*!< EPWM0P2 Interrupt */ - BRAKE1_IRQn = 28, /*!< BRAKE1 Interrupt */ - EPWM1_P0_IRQn = 29, /*!< EPWM1P0 Interrupt */ - EPWM1_P1_IRQn = 30, /*!< EPWM1P1 Interrupt */ - EPWM1_P2_IRQn = 31, /*!< EPWM1P2 Interrupt */ - TMR0_IRQn = 32, /*!< Timer 0 Interrupt */ - TMR1_IRQn = 33, /*!< Timer 1 Interrupt */ - TMR2_IRQn = 34, /*!< Timer 2 Interrupt */ - TMR3_IRQn = 35, /*!< Timer 3 Interrupt */ - UART0_IRQn = 36, /*!< UART 0 Interrupt */ - UART1_IRQn = 37, /*!< UART 1 Interrupt */ - I2C0_IRQn = 38, /*!< I2C 0 Interrupt */ - I2C1_IRQn = 39, /*!< I2C 1 Interrupt */ - PDMA0_IRQn = 40, /*!< Peripheral DMA 0 Interrupt */ - DAC_IRQn = 41, /*!< DAC Interrupt */ - EADC0_IRQn = 42, /*!< EADC Source 0 Interrupt */ - EADC1_IRQn = 43, /*!< EADC Source 1 Interrupt */ - ACMP01_IRQn = 44, /*!< Analog Comparator 0 and 1 Interrupt */ - EADC2_IRQn = 46, /*!< EADC Source 2 Interrupt */ - EADC3_IRQn = 47, /*!< EADC Source 3 Interrupt */ - UART2_IRQn = 48, /*!< UART2 Interrupt */ - UART3_IRQn = 49, /*!< UART3 Interrupt */ - SPI1_IRQn = 51, /*!< SPI1 Interrupt */ - SPI2_IRQn = 52, /*!< SPI2 Interrupt */ - USBD_IRQn = 53, /*!< USB device Interrupt */ - USBH_IRQn = 54, /*!< USB host Interrupt */ - USBOTG_IRQn = 55, /*!< USB OTG Interrupt */ - CAN0_IRQn = 56, /*!< CAN0 Interrupt */ - SC0_IRQn = 58, /*!< Smart Card 0 Interrupt */ - SC1_IRQn = 59, /*!< Smart Card 1 Interrupt */ - SC2_IRQn = 60, /*!< Smart Card 2 Interrupt */ - SPI3_IRQn = 62, /*!< SPI3 Interrupt */ - SDH0_IRQn = 64, /*!< SDH0 Interrupt */ - I2S0_IRQn = 68, /*!< I2S0 Interrupt */ - CRPT_IRQn = 71, /*!< CRPT Interrupt */ - GPG_IRQn = 72, /*!< GPIO Port G Interrupt */ - EINT6_IRQn = 73, /*!< External Input 6 Interrupt */ - UART4_IRQn = 74, /*!< UART4 Interrupt */ - UART5_IRQn = 75, /*!< UART5 Interrupt */ - USCI0_IRQn = 76, /*!< USCI0 Interrupt */ - USCI1_IRQn = 77, /*!< USCI1 Interrupt */ - BPWM0_IRQn = 78, /*!< BPWM0 Interrupt */ - BPWM1_IRQn = 79, /*!< BPWM1 Interrupt */ - I2C2_IRQn = 82, /*!< I2C2 Interrupt */ - QEI0_IRQn = 84, /*!< QEI0 Interrupt */ - QEI1_IRQn = 85, /*!< QEI1 Interrupt */ - ECAP0_IRQn = 86, /*!< ECAP0 Interrupt */ - ECAP1_IRQn = 87, /*!< ECAP1 Interrupt */ - GPH_IRQn = 88, /*!< GPIO Port H Interrupt */ - EINT7_IRQn = 89, /*!< External Input 7 Interrupt */ - PDMA1_IRQn = 98, /*!< Peripheral DMA 1 Interrupt */ - SCU_IRQn = 99, /*!< SCU Interrupt */ - LCD_IRQn = 100, /*!< LCD interrupt */ - TRNG_IRQn = 101, /*!< TRNG interrupt */ - KS_IRQn = 109, /*!< Key Store interrupt */ - TAMPER_IRQn = 110, /*!< TAMPER interrupt */ - EWDT_IRQn = 111, /*!< Extra Watchdog Timer interrupt */ - EWWDT_IRQn = 112, /*!< Extra Window Watchdog Timer interrupt */ - NS_ISP_IRQn = 113, /*!< Non-secure FMC ISP interrupt */ - TMR4_IRQn = 114, /*!< Timer 4 Interrupt */ - TMR5_IRQn = 115, /*!< Timer 5 Interrupt */ - - -} IRQn_Type; - - -/* ================================================================================ */ -/* ================ Processor and Core Peripheral Section ================ */ -/* ================================================================================ */ - -/* ------- Start of section using anonymous unions and disabling warnings ------- */ -#if defined (__CC_ARM) -#pragma push -#pragma anon_unions -#elif defined (__ICCARM__) -#pragma language=extended -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wc11-extensions" -#pragma clang diagnostic ignored "-Wreserved-id-macro" -#elif defined (__GNUC__) -/* anonymous unions are enabled by default */ -#elif defined (__TMS470__) -/* anonymous unions are enabled by default */ -#elif defined (__TASKING__) -#pragma warning 586 -#elif defined (__CSMC__) -/* anonymous unions are enabled by default */ -#else -#warning Not supported compiler type -#endif - - -/* -------- Configuration of the Cortex-ARMv8MBL Processor and Core Peripherals ------- */ -#define __ARMv8MBL_REV 0x0000U /* Core revision r0p0 */ -#define __SAU_PRESENT 1U /* SAU present */ -#define __SAUREGION_PRESENT 1U /* SAU present */ -#define __MPU_PRESENT 1U /* MPU present */ -#define __VTOR_PRESENT 1U /* VTOR present */ -#define __NVIC_PRIO_BITS 2U /* Number of Bits used for Priority Levels */ -#define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */ -#define USE_ASSERT 0U /* Define to use Assert function or not */ - -/**@}*/ /* end of group CMSIS */ - -#include "core_armv8mbl.h" /* Processor and core peripherals */ -#include "system_M2354.h" /* System Header */ -#include "nu_partition_M2354.h" - -/** - * Initialize the system clock - * - * @brief Setup the micro controller system - * Initialize the PLL and update the SystemFrequency variable - */ -extern void SystemInit(void); - - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - - -#include "acmp_reg.h" -#include "bpwm_reg.h" -#include "can_reg.h" -#include "clk_reg.h" -#include "crc_reg.h" -#include "dac_reg.h" -#include "eadc_reg.h" -#include "ebi_reg.h" -#include "ecap_reg.h" -#include "fmc_reg.h" -#include "gpio_reg.h" -#include "hdiv_reg.h" -#include "i2c_reg.h" -#include "i2s_reg.h" -#include "pdma_reg.h" -#include "epwm_reg.h" -#include "qei_reg.h" -#include "rtc_reg.h" -#include "sc_reg.h" -#include "scu_reg.h" -#include "sdh_reg.h" -#include "qspi_reg.h" -#include "spi_reg.h" -#include "sys_reg.h" -#include "timer_reg.h" -#include "trng_reg.h" -#include "uart_reg.h" -#include "ui2c_reg.h" -#include "usbh_reg.h" -#include "usbd_reg.h" -#include "otg_reg.h" -#include "crpt_reg.h" -#include "uspi_reg.h" -#include "uuart_reg.h" -#include "wdt_reg.h" -#include "wwdt_reg.h" -#include "keystore_reg.h" -#include "tamper_reg.h" -#include "lcd_reg.h" -#include "ewdt_reg.h" -#include "ewwdt_reg.h" - - - -/******************************************************************************/ -/* Peripheral memory map */ -/******************************************************************************/ -/** @addtogroup PERIPHERAL_BASE Peripheral Memory Base - Memory Mapped Structure for Series Peripheral - @{ - */ - - -/* Peripheral and SRAM base address */ -#define SRAM_BASE (0x20000000UL) /*!< (SRAM ) Base Address */ -#define PERIPH_BASE (0x40000000UL) /*!< (Peripheral) Base Address */ -#define NS_OFFSET (0x10000000UL) - -/* Peripheral memory map */ -#define AHBPERIPH_BASE PERIPH_BASE -#define APBPERIPH_BASE (PERIPH_BASE + 0x00040000UL) - -/*!< AHB peripherals */ -#define SYS_BASE (AHBPERIPH_BASE + 0x00000UL) -#define CLK_BASE (AHBPERIPH_BASE + 0x00200UL) -#define INT_BASE (AHBPERIPH_BASE + 0x00300UL) -#define GPIO_BASE (AHBPERIPH_BASE + 0x04000UL) -#define GPIOA_BASE (AHBPERIPH_BASE + 0x04000UL) -#define GPIOB_BASE (AHBPERIPH_BASE + 0x04040UL) -#define GPIOC_BASE (AHBPERIPH_BASE + 0x04080UL) -#define GPIOD_BASE (AHBPERIPH_BASE + 0x040C0UL) -#define GPIOE_BASE (AHBPERIPH_BASE + 0x04100UL) -#define GPIOF_BASE (AHBPERIPH_BASE + 0x04140UL) -#define GPIOG_BASE (AHBPERIPH_BASE + 0x04180UL) -#define GPIOH_BASE (AHBPERIPH_BASE + 0x041C0UL) -#define GPIO_DBCTL_BASE (AHBPERIPH_BASE + 0x04440UL) -#define GPIO_PIN_DATA_BASE (AHBPERIPH_BASE + 0x04800UL) -#define PDMA0_BASE (AHBPERIPH_BASE + 0x08000UL) -#define PDMA1_BASE (AHBPERIPH_BASE + 0x18000UL) -#define USBH_BASE (AHBPERIPH_BASE + 0x09000UL) -#define FMC_BASE (AHBPERIPH_BASE + 0x0C000UL) -#define SDH0_BASE (AHBPERIPH_BASE + 0x0D000UL) -#define SDH1_BASE (AHBPERIPH_BASE + 0x0E000UL) -#define EBI_BASE (AHBPERIPH_BASE + 0x10000UL) -#define CRC_BASE (AHBPERIPH_BASE + 0x31000UL) -#define CRPT_BASE (AHBPERIPH_BASE + 0x32000UL) -#define SCU_BASE (AHBPERIPH_BASE + 0x2F000UL) -#define FVC_BASE (AHBPERIPH_BASE + 0x2F500UL) -#define DPM_BASE (AHBPERIPH_BASE + 0x2F600UL) -#define PLM_BASE (AHBPERIPH_BASE + 0x2F700UL) - -#define BTF_BASE (AHBPERIPH_BASE + 0x2F800UL) - -/*!< APB peripherals */ -#define WDT_BASE (APBPERIPH_BASE + 0x00000UL) -#define WWDT_BASE (APBPERIPH_BASE + 0x00100UL) -#define RTC_BASE (APBPERIPH_BASE + 0x01000UL) -#define EADC_BASE (APBPERIPH_BASE + 0x03000UL) -#define ACMP01_BASE (APBPERIPH_BASE + 0x05000UL) -#define DAC0_BASE (APBPERIPH_BASE + 0x07000UL) -#define DAC1_BASE (APBPERIPH_BASE + 0x07040UL) -#define I2S0_BASE (APBPERIPH_BASE + 0x08000UL) -#define OTG_BASE (APBPERIPH_BASE + 0x0D000UL) -#define TMR01_BASE (APBPERIPH_BASE + 0x10000UL) -#define TMR23_BASE (APBPERIPH_BASE + 0x11000UL) -#define TMR45_BASE (APBPERIPH_BASE + 0x12000UL) -#define EPWM0_BASE (APBPERIPH_BASE + 0x18000UL) -#define EPWM1_BASE (APBPERIPH_BASE + 0x19000UL) -#define BPWM0_BASE (APBPERIPH_BASE + 0x1A000UL) -#define BPWM1_BASE (APBPERIPH_BASE + 0x1B000UL) -#define QSPI0_BASE (APBPERIPH_BASE + 0x20000UL) -#define SPI0_BASE (APBPERIPH_BASE + 0x21000UL) -#define SPI1_BASE (APBPERIPH_BASE + 0x22000UL) -#define SPI2_BASE (APBPERIPH_BASE + 0x23000UL) -#define SPI3_BASE (APBPERIPH_BASE + 0x24000UL) -#define UART0_BASE (APBPERIPH_BASE + 0x30000UL) -#define UART0_BASE (APBPERIPH_BASE + 0x30000UL) -#define UART1_BASE (APBPERIPH_BASE + 0x31000UL) -#define UART2_BASE (APBPERIPH_BASE + 0x32000UL) -#define UART3_BASE (APBPERIPH_BASE + 0x33000UL) -#define UART4_BASE (APBPERIPH_BASE + 0x34000UL) -#define UART5_BASE (APBPERIPH_BASE + 0x35000UL) -#define I2C0_BASE (APBPERIPH_BASE + 0x40000UL) -#define I2C1_BASE (APBPERIPH_BASE + 0x41000UL) -#define I2C2_BASE (APBPERIPH_BASE + 0x42000UL) -#define SC0_BASE (APBPERIPH_BASE + 0x50000UL) -#define SC1_BASE (APBPERIPH_BASE + 0x51000UL) -#define SC2_BASE (APBPERIPH_BASE + 0x52000UL) -#define CAN0_BASE (APBPERIPH_BASE + 0x60000UL) -#define QEI0_BASE (APBPERIPH_BASE + 0x70000UL) -#define QEI1_BASE (APBPERIPH_BASE + 0x71000UL) -#define ECAP0_BASE (APBPERIPH_BASE + 0x74000UL) -#define ECAP1_BASE (APBPERIPH_BASE + 0x75000UL) -#define TRNG_BASE (APBPERIPH_BASE + 0x79000UL) -#define USBD_BASE (APBPERIPH_BASE + 0x80000UL) -#define USCI0_BASE (APBPERIPH_BASE + 0x90000UL) -#define USCI1_BASE (APBPERIPH_BASE + 0x91000UL) - -#define EWDT_BASE (APBPERIPH_BASE + 0x02000UL) -#define EWWDT_BASE (APBPERIPH_BASE + 0x02100UL) - - -#define KS_BASE (AHBPERIPH_BASE + 0x35000UL) -#define TAMPER_BASE (AHBPERIPH_BASE + 0xBD000UL) -#define LCD_BASE (AHBPERIPH_BASE + 0xBB000UL) - - - -/**@}*/ /* PERIPHERAL */ - -/******************************************************************************/ -/* Peripheral declaration */ -/******************************************************************************/ - -/** @addtogroup PMODULE Peripheral Pointer - The Declaration of Peripheral Pointer - @{ - */ - -/** @addtogroup PMODULE_S Secure Peripheral Pointer - The Declaration of Secure Peripheral Pointer - @{ -*/ - -#define PA_S ((GPIO_T *) GPIOA_BASE) /*!< GPIO PORTA Pointer */ -#define PB_S ((GPIO_T *) GPIOB_BASE) /*!< GPIO PORTB Pointer */ -#define PC_S ((GPIO_T *) GPIOC_BASE) /*!< GPIO PORTC Pointer */ -#define PD_S ((GPIO_T *) GPIOD_BASE) /*!< GPIO PORTD Pointer */ -#define PE_S ((GPIO_T *) GPIOE_BASE) /*!< GPIO PORTE Pointer */ -#define PF_S ((GPIO_T *) GPIOF_BASE) /*!< GPIO PORTF Pointer */ -#define PG_S ((GPIO_T *) GPIOG_BASE) /*!< GPIO PORTG Pointer */ -#define PH_S ((GPIO_T *) GPIOH_BASE) /*!< GPIO PORTH Pointer */ - -#define UART0_S ((UART_T *) UART0_BASE) /*!< UART0 Pointer */ -#define UART1_S ((UART_T *) UART1_BASE) /*!< UART1 Pointer */ -#define UART2_S ((UART_T *) UART2_BASE) /*!< UART2 Pointer */ -#define UART3_S ((UART_T *) UART3_BASE) /*!< UART3 Pointer */ -#define UART4_S ((UART_T *) UART4_BASE) /*!< UART4 Pointer */ -#define UART5_S ((UART_T *) UART5_BASE) /*!< UART5 Pointer */ - - -#define TIMER0_S ((TIMER_T *) TMR01_BASE) /*!< TIMER0 Pointer */ -#define TIMER1_S ((TIMER_T *) (TMR01_BASE + 0x100UL)) /*!< TIMER1 Pointer */ -#define TIMER2_S ((TIMER_T *) TMR23_BASE) /*!< TIMER2 Pointer */ -#define TIMER3_S ((TIMER_T *) (TMR23_BASE + 0x100UL)) /*!< TIMER3 Pointer */ -#define TIMER4_S ((TIMER_T *) TMR45_BASE) /*!< TIMER4 Pointer */ -#define TIMER5_S ((TIMER_T *) (TMR45_BASE + 0x100UL)) /*!< TIMER5 Pointer */ - -#define WDT_S ((WDT_T *) WDT_BASE) /*!< Watch Dog Timer Pointer */ - -#define WWDT_S ((WWDT_T *) WWDT_BASE) /*!< Window Watch Dog Timer Pointer */ - -#define QSPI0_S ((QSPI_T *) QSPI0_BASE) /*!< QSPI0 Pointer */ -#define SPI0_S ((SPI_T *) SPI0_BASE) /*!< SPI0 Pointer */ -#define SPI1_S ((SPI_T *) SPI1_BASE) /*!< SPI1 Pointer */ -#define SPI2_S ((SPI_T *) SPI2_BASE) /*!< SPI2 Pointer */ -#define SPI3_S ((SPI_T *) SPI3_BASE) /*!< SPI3 Pointer */ - -#define I2S0_S ((I2S_T *) I2S0_BASE) /*!< I2S0 Pointer */ - -#define I2C0_S ((I2C_T *) I2C0_BASE) /*!< I2C0 Pointer */ -#define I2C1_S ((I2C_T *) I2C1_BASE) /*!< I2C1 Pointer */ -#define I2C2_S ((I2C_T *) I2C2_BASE) /*!< I2C1 Pointer */ - -#define QEI0_S ((QEI_T *) QEI0_BASE) /*!< QEI0 Pointer */ -#define QEI1_S ((QEI_T *) QEI1_BASE) /*!< QEI1 Pointer */ - -#define RTC_S ((RTC_T *) RTC_BASE) /*!< RTC Pointer */ - -#define ACMP01_S ((ACMP_T *) ACMP01_BASE) /*!< ACMP01 Pointer */ - -#define CLK_S ((CLK_T *) CLK_BASE) /*!< System Clock Controller Pointer */ - -#define DAC0_S ((DAC_T *) DAC0_BASE) /*!< DAC0 Pointer */ -#define DAC1_S ((DAC_T *) DAC1_BASE) /*!< DAC1 Pointer */ - -#define EADC_S ((EADC_T *) EADC_BASE) /*!< EADC Pointer */ - -#define SYS_S ((SYS_T *) SYS_BASE) /*!< System Global Controller Pointer */ - -#define SYSINT_S ((SYS_INT_T *) INT_BASE) /*!< Interrupt Source Controller Pointer */ - -#define FMC_S ((FMC_T *) FMC_BASE) /*!< Flash Memory Controller */ - -#define SDH0_S ((SDH_T *) SDH0_BASE) - -#define CRPT_S ((CRPT_T *) CRPT_BASE) /*!< Crypto Accelerator Pointer */ -#define TRNG_S ((TRNG_T *)TRNG_BASE) /*!< True Random Number Pointer */ - -#define BPWM0_S ((BPWM_T *) BPWM0_BASE) /*!< BPWM0 Pointer */ -#define BPWM1_S ((BPWM_T *) BPWM1_BASE) /*!< BPWM1 Pointer */ - -#define EPWM0_S ((EPWM_T *) EPWM0_BASE) /*!< EPWM0 Pointer */ -#define EPWM1_S ((EPWM_T *) EPWM1_BASE) /*!< EPWM1 Pointer */ - -#define SC0_S ((SC_T *) SC0_BASE) /*!< SC0 Pointer */ -#define SC1_S ((SC_T *) SC1_BASE) /*!< SC1 Pointer */ -#define SC2_S ((SC_T *) SC2_BASE) /*!< SC2 Pointer */ - -#define EBI_S ((EBI_T *) EBI_BASE) /*!< EBI Pointer */ - -#define CRC_S ((CRC_T *) CRC_BASE) /*!< CRC Pointer */ - -#define USBD_S ((USBD_T *) USBD_BASE) /*!< USB Device Pointer */ -#define USBH_S ((USBH_T *) USBH_BASE) /*!< USBH Pointer */ -#define OTG_S ((OTG_T *) OTG_BASE) /*!< OTG Pointer */ - -#define PDMA0_S ((PDMA_T *) PDMA0_BASE) /*!< PDMA0 Pointer */ -#define PDMA1_S ((PDMA_T *) PDMA1_BASE) /*!< PDMA1 Pointer */ - -#define UI2C0_S ((UI2C_T *) USCI0_BASE) /*!< UI2C0 Pointer */ -#define UI2C1_S ((UI2C_T *) USCI1_BASE) /*!< UI2C1 Pointer */ - -#define USPI0_S ((USPI_T *) USCI0_BASE) /*!< USPI0 Pointer */ -#define USPI1_S ((USPI_T *) USCI1_BASE) /*!< USPI1 Pointer */ - -#define UUART0_S ((UUART_T *) USCI0_BASE) /*!< UUART0 Pointer */ -#define UUART1_S ((UUART_T *) USCI1_BASE) /*!< UUART1 Pointer */ - -#define SCU_S ((SCU_T *) SCU_BASE) /*!< SCU Pointer */ -#define ECAP0_S ((ECAP_T *) ECAP0_BASE) /*!< ECAP0 Pointer */ -#define ECAP1_S ((ECAP_T *) ECAP1_BASE) /*!< ECAP1 Pointer */ - -#define CAN0_S ((CAN_T *)CAN0_BASE) /*!< CAN0 Pointer */ - -#define KS_S ((KS_T *)KS_BASE) /*!< Key Store Pointer */ -#define TAMPER_S ((TAMPER_T *)TAMPER_BASE) /*!< TAMPER Pointer */ -#define LCD_S ((LCD_T *)LCD_BASE) /*!< LCD Pointer */ - -#define EWDT_S ((EWDT_T *) EWDT_BASE) /*!< Extra Watch Dog Timer Pointer */ - -#define EWWDT_S ((EWWDT_T *) EWWDT_BASE) /*!< Extra Window Watch Dog Timer Pointer*/ - -#define FVC_S ((FVC_T *) FVC_BASE) -#define DPM_S ((DPM_T *) DPM_BASE) -#define PLM_S ((PLM_T *) PLM_BASE) - - - -/**@}*/ /* end of group PMODULE_S */ - -/** @addtogroup PMODULE_NS Non-secure Peripheral Pointer - The Declaration of Non-secure Peripheral Pointer - @{ -*/ - - -#define PA_NS ((GPIO_T *) (GPIOA_BASE+NS_OFFSET)) /*!< GPIO PORTA Pointer */ -#define PB_NS ((GPIO_T *) (GPIOB_BASE+NS_OFFSET)) /*!< GPIO PORTB Pointer */ -#define PC_NS ((GPIO_T *) (GPIOC_BASE+NS_OFFSET)) /*!< GPIO PORTC Pointer */ -#define PD_NS ((GPIO_T *) (GPIOD_BASE+NS_OFFSET)) /*!< GPIO PORTD Pointer */ -#define PE_NS ((GPIO_T *) (GPIOE_BASE+NS_OFFSET)) /*!< GPIO PORTE Pointer */ -#define PF_NS ((GPIO_T *) (GPIOF_BASE+NS_OFFSET)) /*!< GPIO PORTF Pointer */ -#define PG_NS ((GPIO_T *) (GPIOG_BASE+NS_OFFSET)) /*!< GPIO PORTG Pointer */ -#define PH_NS ((GPIO_T *) (GPIOH_BASE+NS_OFFSET)) /*!< GPIO PORTH Pointer */ -#define UART0_NS ((UART_T *) (UART0_BASE+NS_OFFSET)) /*!< UART0 Pointer */ -#define UART1_NS ((UART_T *) (UART1_BASE+NS_OFFSET)) /*!< UART1 Pointer */ -#define UART2_NS ((UART_T *) (UART2_BASE+NS_OFFSET)) /*!< UART2 Pointer */ -#define UART3_NS ((UART_T *) (UART3_BASE+NS_OFFSET)) /*!< UART3 Pointer */ -#define UART4_NS ((UART_T *) (UART4_BASE+NS_OFFSET)) /*!< UART4 Pointer */ -#define UART5_NS ((UART_T *) (UART5_BASE+NS_OFFSET)) /*!< UART5 Pointer */ -#define TIMER2_NS ((TIMER_T *) (TMR23_BASE+NS_OFFSET)) /*!< TIMER2 Pointer */ -#define TIMER3_NS ((TIMER_T *) (TMR23_BASE+NS_OFFSET+0x100UL)) /*!< TIMER3 Pointer */ -#define TIMER4_NS ((TIMER_T *) (TMR45_BASE+NS_OFFSET)) /*!< TIMER4 Pointer */ -#define TIMER5_NS ((TIMER_T *) (TMR45_BASE+NS_OFFSET+0x100UL)) /*!< TIMER5 Pointer */ -#define QSPI0_NS ((QSPI_T *) (QSPI0_BASE+NS_OFFSET)) /*!< QSPI0 Pointer */ -#define SPI0_NS ((SPI_T *) (SPI0_BASE+NS_OFFSET)) /*!< SPI0 Pointer */ -#define SPI1_NS ((SPI_T *) (SPI1_BASE+NS_OFFSET)) /*!< SPI1 Pointer */ -#define SPI2_NS ((SPI_T *) (SPI2_BASE+NS_OFFSET)) /*!< SPI2 Pointer */ -#define SPI3_NS ((SPI_T *) (SPI3_BASE+NS_OFFSET)) /*!< SPI3 Pointer */ -#define I2S0_NS ((I2S_T *) (I2S0_BASE+NS_OFFSET)) /*!< I2S0 Pointer */ -#define I2C0_NS ((I2C_T *) (I2C0_BASE+NS_OFFSET)) /*!< I2C0 Pointer */ -#define I2C1_NS ((I2C_T *) (I2C1_BASE+NS_OFFSET)) /*!< I2C1 Pointer */ -#define I2C2_NS ((I2C_T *) (I2C2_BASE+NS_OFFSET)) /*!< I2C1 Pointer */ -#define QEI0_NS ((QEI_T *) (QEI0_BASE+NS_OFFSET)) /*!< QEI0 Pointer */ -#define QEI1_NS ((QEI_T *) (QEI1_BASE+NS_OFFSET)) /*!< QEI1 Pointer */ -#define ACMP01_NS ((ACMP_T *) (ACMP01_BASE+NS_OFFSET)) /*!< ACMP01 Pointer */ -#define DAC0_NS ((DAC_T *) (DAC0_BASE+NS_OFFSET)) /*!< DAC0 Pointer */ -#define DAC1_NS ((DAC_T *) (DAC1_BASE+NS_OFFSET)) /*!< DAC1 Pointer */ -#define EADC_NS ((EADC_T *) (EADC_BASE+NS_OFFSET)) /*!< EADC Pointer */ -#define SDH0_NS ((SDH_T *) (SDH0_BASE +NS_OFFSET)) -#define CRPT_NS ((CRPT_T *) (CRPT_BASE +NS_OFFSET)) -#define TRNG_NS ((TRNG_T *) (TRNG_BASE +NS_OFFSET)) /*!< Random Number Generator Pointer */ -#define BPWM0_NS ((BPWM_T *) (BPWM0_BASE+NS_OFFSET)) /*!< BPWM0 Pointer */ -#define BPWM1_NS ((BPWM_T *) (BPWM1_BASE+NS_OFFSET)) /*!< BPWM1 Pointer */ -#define EPWM0_NS ((EPWM_T *) (EPWM0_BASE+NS_OFFSET)) /*!< EPWM0 Pointer */ -#define EPWM1_NS ((EPWM_T *) (EPWM1_BASE+NS_OFFSET)) /*!< EPWM1 Pointer */ -#define SC0_NS ((SC_T *) (SC0_BASE +NS_OFFSET)) /*!< SC0 Pointer */ -#define SC1_NS ((SC_T *) (SC1_BASE +NS_OFFSET)) /*!< SC1 Pointer */ -#define SC2_NS ((SC_T *) (SC2_BASE +NS_OFFSET)) /*!< SC2 Pointer */ -#define EBI_NS ((EBI_T *) (EBI_BASE +NS_OFFSET)) /*!< EBI Pointer */ -#define CRC_NS ((CRC_T *) (CRC_BASE +NS_OFFSET)) /*!< CRC Pointer */ -#define USBD_NS ((USBD_T *) (USBD_BASE +NS_OFFSET)) /*!< USB Device Pointer */ -#define USBH_NS ((USBH_T *) (USBH_BASE +NS_OFFSET)) /*!< USBH Pointer */ -#define OTG_NS ((OTG_T *) (OTG_BASE +NS_OFFSET)) /*!< OTG Pointer */ -#define PDMA1_NS ((PDMA_T *) (PDMA1_BASE +NS_OFFSET)) /*!< PDMA1 Pointer */ -#define UI2C0_NS ((UI2C_T *) (USCI0_BASE +NS_OFFSET)) /*!< UI2C0 Pointer */ -#define UI2C1_NS ((UI2C_T *) (USCI1_BASE +NS_OFFSET)) /*!< UI2C1 Pointer */ -#define USPI0_NS ((USPI_T *) (USCI0_BASE +NS_OFFSET)) /*!< USPI0 Pointer */ -#define USPI1_NS ((USPI_T *) (USCI1_BASE +NS_OFFSET)) /*!< USPI1 Pointer */ -#define UUART0_NS ((UUART_T *) (USCI0_BASE+NS_OFFSET)) /*!< UUART0 Pointer */ -#define UUART1_NS ((UUART_T *) (USCI1_BASE+NS_OFFSET)) /*!< UUART1 Pointer */ -#define SCU_NS ((SCU_T *) (SCU_BASE +NS_OFFSET)) /*!< SCU Pointer */ -#define ECAP0_NS ((ECAP_T *) (ECAP0_BASE+NS_OFFSET)) /*!< ECAP0 Pointer */ -#define ECAP1_NS ((ECAP_T *) (ECAP1_BASE+NS_OFFSET)) /*!< ECAP1 Pointer */ -#define CAN0_NS ((CAN_T *) (CAN0_BASE +NS_OFFSET)) /*!< CAN0 Pointer */ - -#define EWDT_NS ((EWDT_T *) (EWDT_BASE+NS_OFFSET)) /*!< Extra Watch Dog Timer Pointer */ - -#define EWWDT_NS ((EWWDT_T *) (EWWDT_BASE+NS_OFFSET)) /*!< Extra Window Watch Dog Timer Pointer*/ - - -#define LCD_NS ((LCD_T *)(LCD_BASE+NS_OFFSET)) /*!< LCD Pointer */ -#define DPM_NS ((DPM_T *)(DPM_BASE+NS_OFFSET)) -#define FMC_NS ((FMC_T *)(FMC_BASE+NS_OFFSET)) /*!< Flash Memory Controller */ -#define SYS_NS ((SYS_T *)(SYS_BASE+NS_OFFSET)) -#define CLK_NS ((CLK_T *)(CLK_BASE+NS_OFFSET)) - - -/**@}*/ /* end of group PMODULE_NS */ - -/** @addtogroup PMODULE_SNS Peripheral Pointer - The Declaration of Peripheral Pointer - @{ -*/ - -/* Always Secure Modules */ -#define SYS SYS_S -#define SYSINT SYSINT_S -#define CLK CLK_S -#define FMC FMC_S -#define SCU SCU_S -#define FVC FVC_S -#define PLM PLM_S -#define DPM DPM_S -#define PDMA0 PDMA0_S -#define WDT WDT_S -#define WWDT WWDT_S -#define TIMER0 TIMER0_S -#define TIMER1 TIMER1_S -#define RTC RTC_S -#define KS KS_S -#define TAMPER TAMPER_S - -#if defined (SCU_INIT_PNSSET0_VAL) && (SCU_INIT_PNSSET0_VAL & BIT9 ) -# define USBH USBH_NS -#else -# define USBH USBH_S -#endif - -#if defined (SCU_INIT_PNSSET0_VAL) && (SCU_INIT_PNSSET0_VAL & BIT13) -# define SDH0 SDH0_NS -#else -# define SDH0 SDH0_S -#endif - -#if defined (SCU_INIT_PNSSET0_VAL) && (SCU_INIT_PNSSET0_VAL & BIT16) -# define EBI EBI_NS -#else -# define EBI EBI_S -#endif - - -#if defined (SCU_INIT_PNSSET0_VAL) && (SCU_INIT_PNSSET0_VAL & BIT24) -# define PDMA1 PDMA1_NS -#else -# define PDMA1 PDMA1_S -#endif - -#if defined (SCU_INIT_PNSSET1_VAL) && (SCU_INIT_PNSSET1_VAL & BIT17) -# define CRC CRC_NS -#else -# define CRC CRC_S -#endif - -#if defined (SCU_INIT_PNSSET1_VAL) && (SCU_INIT_PNSSET1_VAL & BIT18) -# define CRPT CRPT_NS -#else -# define CRPT CRPT_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT2 ) -# define EWDT EWDT_NS -# define EWWDT EWWDT_NS -#else -# define EWDT EWDT_S -# define EWWDT EWWDT_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT3 ) -# define EADC EADC_NS -#else -# define EADC EADC_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT3 ) -# define EADC EADC_NS -#else -# define EADC EADC_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT3 ) -# define EADC EADC_NS -#else -# define EADC EADC_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT3 ) -# define EADC EADC_NS -#else -# define EADC EADC_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT5 ) -# define ACMP01 ACMP01_NS -#else -# define ACMP01 ACMP01_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT7 ) -# define DAC0 DAC0_NS -# define DAC1 DAC1_NS -#else -# define DAC0 DAC0_S -# define DAC1 DAC1_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT8 ) -# define I2S0 I2S0_NS -#else -# define I2S0 I2S0_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT13) -# define OTG OTG_NS -#else -# define OTG OTG_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT17) -# define TIMER2 TIMER2_NS -# define TIMER3 TIMER3_NS -#else -# define TIMER2 TIMER2_S -# define TIMER3 TIMER3_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT18) -# define TIMER4 TIMER4_NS -# define TIMER5 TIMER5_NS -#else -# define TIMER4 TIMER4_S -# define TIMER5 TIMER5_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT24) -# define EPWM0 EPWM0_NS -#else -# define EPWM0 EPWM0_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT24) -# define EPWM0 EPWM0_NS -#else -# define EPWM0 EPWM0_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT24) -# define EPWM0 EPWM0_NS -#else -# define EPWM0 EPWM0_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT25) -# define EPWM1 EPWM1_NS -#else -# define EPWM1 EPWM1_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT25) -# define EPWM1 EPWM1_NS -#else -# define EPWM1 EPWM1_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT25) -# define EPWM1 EPWM1_NS -#else -# define EPWM1 EPWM1_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT26) -# define BPWM0 BPWM0_NS -#else -# define BPWM0 BPWM0_S -#endif - -#if defined (SCU_INIT_PNSSET2_VAL) && (SCU_INIT_PNSSET2_VAL & BIT27) -# define BPWM1 BPWM1_NS -#else -# define BPWM1 BPWM1_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT0 ) -# define QSPI0 QSPI0_NS -#else -# define QSPI0 QSPI0_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT1 ) -# define SPI0 SPI0_NS -#else -# define SPI0 SPI0_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT2 ) -# define SPI1 SPI1_NS -#else -# define SPI1 SPI1_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT3 ) -# define SPI2 SPI2_NS -#else -# define SPI2 SPI2_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT4 ) -# define SPI3 SPI3_NS -#else -# define SPI3 SPI3_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT16) -# define UART0 UART0_NS -#else -# define UART0 UART0_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT17) -# define UART1 UART1_NS -#else -# define UART1 UART1_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT18) -# define UART2 UART2_NS -#else -# define UART2 UART2_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT19) -# define UART3 UART3_NS -#else -# define UART3 UART3_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT20) -# define UART4 UART4_NS -#else -# define UART4 UART4_S -#endif - -#if defined (SCU_INIT_PNSSET3_VAL) && (SCU_INIT_PNSSET3_VAL & BIT21) -# define UART5 UART5_NS -#else -# define UART5 UART5_S -#endif - -#if defined (SCU_INIT_PNSSET4_VAL) && (SCU_INIT_PNSSET4_VAL & BIT0 ) -# define I2C0 I2C0_NS -#else -# define I2C0 I2C0_S -#endif - -#if defined (SCU_INIT_PNSSET4_VAL) && (SCU_INIT_PNSSET4_VAL & BIT1 ) -# define I2C1 I2C1_NS -#else -# define I2C1 I2C1_S -#endif - -#if defined (SCU_INIT_PNSSET4_VAL) && (SCU_INIT_PNSSET4_VAL & BIT2 ) -# define I2C2 I2C2_NS -#else -# define I2C2 I2C2_S -#endif - -#if defined (SCU_INIT_PNSSET4_VAL) && (SCU_INIT_PNSSET4_VAL & BIT16) -# define SC0 SC0_NS -#else -# define SC0 SC0_S -#endif - -#if defined (SCU_INIT_PNSSET4_VAL) && (SCU_INIT_PNSSET4_VAL & BIT17) -# define SC1 SC1_NS -#else -# define SC1 SC1_S -#endif - -#if defined (SCU_INIT_PNSSET4_VAL) && (SCU_INIT_PNSSET4_VAL & BIT18) -# define SC2 SC2_NS -#else -# define SC2 SC2_S -#endif - -#if defined (SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & BIT0 ) -# define CAN0 CAN0_NS -#else -# define CAN0 CAN0_S -#endif - -#if defined (SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & BIT16) -# define QEI0 QEI0_NS -#else -# define QEI0 QEI0_S -#endif - -#if defined (SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & BIT17) -# define QEI1 QEI1_NS -#else -# define QEI1 QEI1_S -#endif - -#if defined (SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & BIT20) -# define ECAP0 ECAP0_NS -#else -# define ECAP0 ECAP0_S -#endif - -#if defined (SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & BIT21) -# define ECAP1 ECAP1_NS -#else -# define ECAP1 ECAP1_S -#endif - -#if defined (SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & BIT25) -# define TRNG TRNG_NS -#else -# define TRNG TRNG_S -#endif - -#if defined (SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & BIT27) -# define LCD LCD_NS -#else -# define LCD LCD_S -#endif - -#if defined (SCU_INIT_PNSSET6_VAL) && (SCU_INIT_PNSSET6_VAL & BIT0 ) -# define USBD USBD_NS -#else -# define USBD USBD_S -#endif - -#if defined (SCU_INIT_PNSSET6_VAL) && (SCU_INIT_PNSSET6_VAL & BIT16) -# define USCI0 USCI0_NS -# define UI2C0 UI2C0_NS -# define USPI0 USPI0_NS -# define UUART0 UUART0_NS - -#else -# define USCI0 USCI0_S -# define UI2C0 UI2C0_S -# define USPI0 USPI0_S -# define UUART0 UUART0_S - -#endif - -#if defined (SCU_INIT_PNSSET6_VAL) && (SCU_INIT_PNSSET6_VAL & BIT17) -# define USCI1 USCI1_NS -# define USPI1 USPI1_NS -# define UI2C1 UI2C1_NS -# define UUART1 UUART1_NS - -#else -# define USCI1 USCI1_S -# define USPI1 USPI1_S -# define UI2C1 UI2C1_S -# define UUART1 UUART1_S -#endif - -#define PA ( (__PC() & NS_OFFSET) ? PA_NS : PA_S) -#define PB ( (__PC() & NS_OFFSET) ? PB_NS : PB_S) -#define PC ( (__PC() & NS_OFFSET) ? PC_NS : PC_S) -#define PD ( (__PC() & NS_OFFSET) ? PD_NS : PD_S) -#define PE ( (__PC() & NS_OFFSET) ? PE_NS : PE_S) -#define PF ( (__PC() & NS_OFFSET) ? PF_NS : PF_S) -#define PG ( (__PC() & NS_OFFSET) ? PG_NS : PG_S) -#define PH ( (__PC() & NS_OFFSET) ? PH_NS : PH_S) - -/**@}*/ /* end of group PMODULE_SNS */ - -/**@}*/ /* end of group PMODULE */ - -/* -------------------- End of section using anonymous unions ------------------- */ -#if defined (__CC_ARM) -#pragma pop -#elif defined (__ICCARM__) -/* leave anonymous unions enabled */ -#elif (__ARMCC_VERSION >= 6010050) -#pragma clang diagnostic pop -#elif defined (__GNUC__) -/* anonymous unions are enabled by default */ -#elif defined (__TMS470__) -/* anonymous unions are enabled by default */ -#elif defined (__TASKING__) -#pragma warning restore -#elif defined (__CSMC__) -/* anonymous unions are enabled by default */ -#else -#warning Not supported compiler type -#endif - -#ifdef __cplusplus -} -#endif - - - -/******************************************************************************/ -/* Peripheral header files */ -/******************************************************************************/ -#include "nu_sys.h" -#include "nu_clk.h" -#include "nu_dac.h" -#include "nu_eadc.h" -#include "nu_ebi.h" -#include "nu_ecap.h" -#include "nu_fmc.h" -#include "nu_gpio.h" -#include "nu_i2c.h" -#include "nu_i2s.h" -#include "nu_bpwm.h" -#include "nu_epwm.h" -#include "nu_qspi.h" -#include "nu_spi.h" -#include "nu_timer.h" -#include "nu_timer_pwm.h" -#include "nu_wdt.h" -#include "nu_wwdt.h" -#include "nu_rtc.h" -#include "nu_uart.h" -#include "nu_acmp.h" -#include "nu_crc.h" -#include "nu_usbd.h" -#include "nu_otg.h" -#include "nu_pdma.h" -#include "nu_ebi.h" -#include "nu_keystore.h" -#include "nu_crypto.h" -#include "nu_sc.h" -#include "nu_scuart.h" -#include "nu_usci_spi.h" -#include "nu_usci_uart.h" -#include "nu_usci_i2c.h" -#include "nu_sdh.h" -#include "nu_qei.h" -#include "nu_can.h" -#include "nu_scu.h" -#include "nu_tamper.h" -#include "nu_rng.h" -#include "nu_trng.h" -#include "nu_dpm.h" -#include "nu_fvc.h" -#include "nu_ewwdt.h" -#include "nu_ewdt.h" -#include "nu_plm.h" -#include "nu_lcd.h" - -#endif /* __M2354_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h deleted file mode 100644 index cccccd4e7ad..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h +++ /dev/null @@ -1,17 +0,0 @@ -/**************************************************************************//** - * @file NuMicro.h - * @version V1.00 - * @brief NuMicro peripheral access layer header file. - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NUMICRO_H__ -#define __NUMICRO_H__ - -#include "nutool_clkcfg.h" -#include "M2354.h" - -#endif /* __NUMICRO_H__ */ - - diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/acmp_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/acmp_reg.h deleted file mode 100644 index 5d110acfa12..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/acmp_reg.h +++ /dev/null @@ -1,244 +0,0 @@ -/**************************************************************************//** - * @file acmp_reg.h - * @version V1.00 - * @brief ACMP register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ACMP_REG_H__ -#define __ACMP_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Analog Comparator Controller -------------------------*/ -/** - @addtogroup ACMP Analog Comparator Controller(ACMP) - Memory Mapped Structure for ACMP Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var ACMP_T::CTL - * Offset: 0x00 Analog Comparator 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPEN |Comparator Enable Bit - * | | |0 = Comparator 0 Disabled. - * | | |1 = Comparator 0 Enabled. - * |[1] |ACMPIE |Comparator Interrupt Enable Bit - * | | |0 = Comparator 0 interrupt Disabled. - * | | |1 = Comparator 0 interrupt Enabled. - * | | |If WKEN (ACMP_CTL0[16]) is set to 1, the wake-up interrupt function will be enabled as well. - * |[2] |HYSEN |Comparator Hysteresis Enable Bit - * | | |0 = Comparator 0 hysteresis Disabled. - * | | |1 = Comparator 0 hysteresis Enabled. - * | | |Note: If HYSEN = 0, user can adjust HYS by HYSSEL. - * | | |Note: If HYSEN = 1, HYSSEL is invalid. The Hysteresis is fixed to 30mV. - * |[3] |ACMPOINV |Comparator Output Inverse - * | | |0 = Comparator 0 output inverse Disabled. - * | | |1 = Comparator 0 output inverse Enabled. - * |[5:4] |NEGSEL |Comparator Negative Input Selection - * | | |00 = ACMP0_N pin. - * | | |01 = Internal comparator reference voltage (CRV). - * | | |10 = Band-gap voltage. - * | | |11 = DAC output. - * |[7:6] |POSSEL |Comparator Positive Input Selection - * | | |00 = Input from ACMP0_P0. - * | | |01 = Input from ACMP0_P1. - * | | |10 = Input from ACMP0_P2. - * | | |11 = Input from ACMP0_P3. - * |[9:8] |INTPOL |Interrupt Condition Polarity Selection - * | | |ACMPIF0 will be set to 1 when comparator output edge condition is detected. - * | | |00 = Rising edge or falling edge. - * | | |01 = Rising edge. - * | | |10 = Falling edge. - * | | |11 = Reserved. - * |[12] |OUTSEL |Comparator Output Select - * | | |0 = Comparator 0 output to ACMP0_O pin is unfiltered comparator output. - * | | |1 = Comparator 0 output to ACMP0_O pin is from filter output. - * |[15:13] |FILTSEL |Comparator Output Filter Count Selection - * | | |000 = Filter function is Disabled. - * | | |001 = ACMP0 output is sampled 1 consecutive PCLK. - * | | |010 = ACMP0 output is sampled 2 consecutive PCLKs. - * | | |011 = ACMP0 output is sampled 4 consecutive PCLKs. - * | | |100 = ACMP0 output is sampled 8 consecutive PCLKs. - * | | |101 = ACMP0 output is sampled 16 consecutive PCLKs. - * | | |110 = ACMP0 output is sampled 32 consecutive PCLKs. - * | | |111 = ACMP0 output is sampled 64 consecutive PCLKs. - * |[16] |WKEN |Power-down Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[17] |WLATEN |Window Latch Mode Enable Bit - * | | |0 = Window Latch Mode Disabled. - * | | |1 = Window Latch Mode Enabled. - * |[18] |WCMPSEL |Window Compare Mode Selection - * | | |0 = Window Compare Mode Disabled. - * | | |1 = Window Compare Mode is Selected. - * |[25:24] |HYSSEL |Hysteresis Mode Selection - * | | |00 = Hysteresis is 0mV. - * | | |01 = Hysteresis is 10mV. - * | | |10 = Hysteresis is 20mV. - * | | |11 = Hysteresis is 30mV. - * |[29:28] |MODESEL |Propagation Delay Mode Selection - * | | |00 = Max propagation delay is 4.5uS, operation current is 1.2uA. - * | | |01 = Max propagation delay is 2uS, operation current is 3uA. - * | | |10 = Max propagation delay is 600nS, operation current is 10uA. - * | | |11 = Max propagation delay is 200nS, operation current is 75uA. - * @var ACMP_T::STATUS - * Offset: 0x08 Analog Comparator Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPIF0 |Comparator 0 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL0[9:8]) is detected on comparator 0 output - * | | |This will generate an interrupt if ACMPIE (ACMP_CTL0[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |ACMPIF1 |Comparator 1 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL1[9:8]) is detected on comparator 1 output - * | | |This will cause an interrupt if ACMPIE (ACMP_CTL1[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |ACMPO0 |Comparator 0 Output - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 0 is disabled, i.e - * | | |ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[5] |ACMPO1 |Comparator 1 Output - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 1 is disabled, i.e - * | | |ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[8] |WKIF0 |Comparator 0 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP0 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |WKIF1 |Comparator 1 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP1 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |ACMPS0 |Comparator 0 Status - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 0 is disabled, i.e - * | | |ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[13] |ACMPS1 |Comparator 1 Status - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 1 is disabled, i.e - * | | |ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[16] |ACMPWO |Comparator Window Output - * | | |This bit shows the output status of window compare mode - * | | |0 = The positive input voltage is outside the window. - * | | |1 = The positive input voltage is in the window. - * @var ACMP_T::VREF - * Offset: 0x0C Analog Comparator Reference Voltage Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CRVCTL |Comparator Reference Voltage Setting - * | | |CRV = CRV source voltage * (1/6+CRVCTL/24). - * |[6] |CRVSSEL |CRV Source Voltage Selection - * | | |0 = VDDA is selected as CRV source voltage. - * | | |1 = The reference voltage defined by SYS_VREFCTL register is selected as CRV source voltage. - */ - - __IO uint32_t CTL[2]; /*!< [0x0000~0x0004] Analog Comparator 0~1 Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] Analog Comparator Status Register */ - __IO uint32_t VREF; /*!< [0x000c] Analog Comparator Reference Voltage Control Register */ - -} ACMP_T; - -/** - @addtogroup ACMP_CONST ACMP Bit Field Definition - Constant Definitions for ACMP Controller - @{ -*/ - -#define ACMP_CTL_ACMPEN_Pos (0) /*!< ACMP_T::CTL: ACMPEN Position */ -#define ACMP_CTL_ACMPEN_Msk (0x1ul << ACMP_CTL_ACMPEN_Pos) /*!< ACMP_T::CTL: ACMPEN Mask */ - -#define ACMP_CTL_ACMPIE_Pos (1) /*!< ACMP_T::CTL: ACMPIE Position */ -#define ACMP_CTL_ACMPIE_Msk (0x1ul << ACMP_CTL_ACMPIE_Pos) /*!< ACMP_T::CTL: ACMPIE Mask */ - -#define ACMP_CTL_HYSEN_Pos (2) /*!< ACMP_T::CTL: HYSEN Position */ -#define ACMP_CTL_HYSEN_Msk (0x1ul << ACMP_CTL_HYSEN_Pos) /*!< ACMP_T::CTL: HYSEN Mask */ - -#define ACMP_CTL_ACMPOINV_Pos (3) /*!< ACMP_T::CTL: ACMPOINV Position */ -#define ACMP_CTL_ACMPOINV_Msk (0x1ul << ACMP_CTL_ACMPOINV_Pos) /*!< ACMP_T::CTL: ACMPOINV Mask */ - -#define ACMP_CTL_NEGSEL_Pos (4) /*!< ACMP_T::CTL: NEGSEL Position */ -#define ACMP_CTL_NEGSEL_Msk (0x3ul << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_T::CTL: NEGSEL Mask */ - -#define ACMP_CTL_POSSEL_Pos (6) /*!< ACMP_T::CTL: POSSEL Position */ -#define ACMP_CTL_POSSEL_Msk (0x3ul << ACMP_CTL_POSSEL_Pos) /*!< ACMP_T::CTL: POSSEL Mask */ - -#define ACMP_CTL_INTPOL_Pos (8) /*!< ACMP_T::CTL: INTPOL Position */ -#define ACMP_CTL_INTPOL_Msk (0x3ul << ACMP_CTL_INTPOL_Pos) /*!< ACMP_T::CTL: INTPOL Mask */ - -#define ACMP_CTL_OUTSEL_Pos (12) /*!< ACMP_T::CTL: OUTSEL Position */ -#define ACMP_CTL_OUTSEL_Msk (0x1ul << ACMP_CTL_OUTSEL_Pos) /*!< ACMP_T::CTL: OUTSEL Mask */ - -#define ACMP_CTL_FILTSEL_Pos (13) /*!< ACMP_T::CTL: FILTSEL Position */ -#define ACMP_CTL_FILTSEL_Msk (0x7ul << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_T::CTL: FILTSEL Mask */ - -#define ACMP_CTL_WKEN_Pos (16) /*!< ACMP_T::CTL: WKEN Position */ -#define ACMP_CTL_WKEN_Msk (0x1ul << ACMP_CTL_WKEN_Pos) /*!< ACMP_T::CTL: WKEN Mask */ - -#define ACMP_CTL_WLATEN_Pos (17) /*!< ACMP_T::CTL: WLATEN Position */ -#define ACMP_CTL_WLATEN_Msk (0x1ul << ACMP_CTL_WLATEN_Pos) /*!< ACMP_T::CTL: WLATEN Mask */ - -#define ACMP_CTL_WCMPSEL_Pos (18) /*!< ACMP_T::CTL: WCMPSEL Position */ -#define ACMP_CTL_WCMPSEL_Msk (0x1ul << ACMP_CTL_WCMPSEL_Pos) /*!< ACMP_T::CTL: WCMPSEL Mask */ - -#define ACMP_CTL_HYSSEL_Pos (24) /*!< ACMP_T::CTL: HYSSEL Position */ -#define ACMP_CTL_HYSSEL_Msk (0x3ul << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_T::CTL: HYSSEL Mask */ - -#define ACMP_CTL_MODESEL_Pos (28) /*!< ACMP_T::CTL: MODESEL Position */ -#define ACMP_CTL_MODESEL_Msk (0x3ul << ACMP_CTL_MODESEL_Pos) /*!< ACMP_T::CTL: MODESEL Mask */ - -#define ACMP_STATUS_ACMPIF0_Pos (0) /*!< ACMP_T::STATUS: ACMPIF0 Position */ -#define ACMP_STATUS_ACMPIF0_Msk (0x1ul << ACMP_STATUS_ACMPIF0_Pos) /*!< ACMP_T::STATUS: ACMPIF0 Mask */ - -#define ACMP_STATUS_ACMPIF1_Pos (1) /*!< ACMP_T::STATUS: ACMPIF1 Position */ -#define ACMP_STATUS_ACMPIF1_Msk (0x1ul << ACMP_STATUS_ACMPIF1_Pos) /*!< ACMP_T::STATUS: ACMPIF1 Mask */ - -#define ACMP_STATUS_ACMPO0_Pos (4) /*!< ACMP_T::STATUS: ACMPO0 Position */ -#define ACMP_STATUS_ACMPO0_Msk (0x1ul << ACMP_STATUS_ACMPO0_Pos) /*!< ACMP_T::STATUS: ACMPO0 Mask */ - -#define ACMP_STATUS_ACMPO1_Pos (5) /*!< ACMP_T::STATUS: ACMPO1 Position */ -#define ACMP_STATUS_ACMPO1_Msk (0x1ul << ACMP_STATUS_ACMPO1_Pos) /*!< ACMP_T::STATUS: ACMPO1 Mask */ - -#define ACMP_STATUS_WKIF0_Pos (8) /*!< ACMP_T::STATUS: WKIF0 Position */ -#define ACMP_STATUS_WKIF0_Msk (0x1ul << ACMP_STATUS_WKIF0_Pos) /*!< ACMP_T::STATUS: WKIF0 Mask */ - -#define ACMP_STATUS_WKIF1_Pos (9) /*!< ACMP_T::STATUS: WKIF1 Position */ -#define ACMP_STATUS_WKIF1_Msk (0x1ul << ACMP_STATUS_WKIF1_Pos) /*!< ACMP_T::STATUS: WKIF1 Mask */ - -#define ACMP_STATUS_ACMPS0_Pos (12) /*!< ACMP_T::STATUS: ACMPS0 Position */ -#define ACMP_STATUS_ACMPS0_Msk (0x1ul << ACMP_STATUS_ACMPS0_Pos) /*!< ACMP_T::STATUS: ACMPS0 Mask */ - -#define ACMP_STATUS_ACMPS1_Pos (13) /*!< ACMP_T::STATUS: ACMPS1 Position */ -#define ACMP_STATUS_ACMPS1_Msk (0x1ul << ACMP_STATUS_ACMPS1_Pos) /*!< ACMP_T::STATUS: ACMPS1 Mask */ - -#define ACMP_STATUS_ACMPWO_Pos (16) /*!< ACMP_T::STATUS: ACMPWO Position */ -#define ACMP_STATUS_ACMPWO_Msk (0x1ul << ACMP_STATUS_ACMPWO_Pos) /*!< ACMP_T::STATUS: ACMPWO Mask */ - -#define ACMP_VREF_CRVCTL_Pos (0) /*!< ACMP_T::VREF: CRVCTL Position */ -#define ACMP_VREF_CRVCTL_Msk (0xful << ACMP_VREF_CRVCTL_Pos) /*!< ACMP_T::VREF: CRVCTL Mask */ - -#define ACMP_VREF_CRVSSEL_Pos (6) /*!< ACMP_T::VREF: CRVSSEL Position */ -#define ACMP_VREF_CRVSSEL_Msk (0x1ul << ACMP_VREF_CRVSSEL_Pos) /*!< ACMP_T::VREF: CRVSSEL Mask */ - -/**@}*/ /* ACMP_CONST */ -/**@}*/ /* end of ACMP register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __ACMP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/bpwm_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/bpwm_reg.h deleted file mode 100644 index 14455bf7f1d..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/bpwm_reg.h +++ /dev/null @@ -1,1800 +0,0 @@ -/**************************************************************************//** - * @file bpwm_reg.h - * @version V1.00 - * @brief BPWM register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __BPWM_REG_H__ -#define __BPWM_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Basic Pulse Width Modulation Controller -------------------------*/ -/** - @addtogroup BPWM Basic Pulse Width Modulation Controller(BPWM) - Memory Mapped Structure for BPWM Controller - @{ -*/ - -typedef struct -{ - /** - * @var BCAPDAT_T::RCAPDAT - * Offset: 0x20C BPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |BPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the BPWM counter value will be saved in this register. - * @var BCAPDAT_T::FCAPDAT - * Offset: 0x210 BPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |BPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the BPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] BPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] BPWM Falling Capture Data Register 0~5 */ -} BCAPDAT_T; - - -typedef struct -{ - /** - * @var BPWM_T::CTL0 - * Offset: 0x00 BPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[1] |CTRLD1 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[2] |CTRLD2 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[3] |CTRLD3 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[4] |CTRLD4 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[5] |CTRLD5 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[16] |IMMLDEN0 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, BPWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt Disable. - * | | |1 = ICE debug mode counter halt Enable. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects BPWM output. - * | | |BPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |BPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * @var BPWM_T::CTL1 - * Offset: 0x04 BPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |BPWM Counter Behavior Type 0 - * | | |Each bit n controls corresponding BPWM channel n. - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * @var BPWM_T::CLKSRC - * Offset: 0x10 BPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |BPWM_CH01 External Clock Source Select - * | | |000 = BPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var BPWM_T::CLKPSC - * Offset: 0x14 BPWM Clock Prescale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |BPWM Counter Clock Prescale - * | | |The clock of BPWM counter is decided by clock prescaler - * | | |Each BPWM pair share one BPWM counter clock prescaler - * | | |The clock of BPWM counter is divided by (CLKPSC+ 1) - * @var BPWM_T::CNTEN - * Offset: 0x20 BPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |BPWM Counter 0 Enable Bit - * | | |0 = BPWM Counter and clock prescaler stop running. - * | | |1 = BPWM Counter and clock prescaler start running. - * @var BPWM_T::CNTCLR - * Offset: 0x24 BPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear BPWM Counter Control Bit 0 - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit BPWM counter to 0000H. - * @var BPWM_T::PERIOD - * Offset: 0x30 BPWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |BPWM Period Register - * | | |Up-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |Down-Count mode: In this mode, BPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |BPWM period time = (PERIOD+1) * BPWM_CLK period. - * | | |Up-Down-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |BPWM period time = 2 * PERIOD * BPWM_CLK period. - * @var BPWM_T::CMPDAT[6] - * Offset: 0x50 BPWM Comparator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPDAT |BPWM Comparator Register - * | | |CMPDAT use to compare with CNTR to generate BPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 denote as 6 independent BPWM_CH0~5 compared point. - * @var BPWM_T::CNT - * Offset: 0x90 BPWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |BPWM Data Register (Read Only) - * | | |User can monitor CNTR to know the current value in 16-bit period counter. - * |[16] |DIRF |BPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is Down count. - * | | |1 = Counter is UP count. - * @var BPWM_T::WGCTL0 - * Offset: 0xB0 BPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[3:2] |ZPCTL1 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[5:4] |ZPCTL2 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[7:6] |ZPCTL3 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[9:8] |ZPCTL4 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[11:10] |ZPCTL5 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[17:16] |PRDPCTL0 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * @var BPWM_T::WGCTL1 - * Offset: 0xB4 BPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[3:2] |CMPUCTL1 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[5:4] |CMPUCTL2 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[7:6] |CMPUCTL3 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[9:8] |CMPUCTL4 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[11:10] |CMPUCTL5 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[17:16] |CMPDCTL0 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[19:18] |CMPDCTL1 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[21:20] |CMPDCTL2 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[23:22] |CMPDCTL3 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[25:24] |CMPDCTL4 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[27:26] |CMPDCTL5 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * @var BPWM_T::MSKEN - * Offset: 0xB8 BPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[1] |MSKEN1 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[2] |MSKEN2 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[3] |MSKEN3 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[4] |MSKEN4 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[5] |MSKEN5 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * @var BPWM_T::MSK - * Offset: 0xBC BPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[1] |MSKDAT1 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[2] |MSKDAT2 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[3] |MSKDAT3 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[4] |MSKDAT4 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[5] |MSKDAT5 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * @var BPWM_T::POLCTL - * Offset: 0xD4 BPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[1] |PINV1 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[2] |PINV2 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[3] |PINV3 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[4] |PINV4 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[5] |PINV5 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * @var BPWM_T::POEN - * Offset: 0xD8 BPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[1] |POEN1 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[2] |POEN2 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[3] |POEN3 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[4] |POEN4 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[5] |POEN5 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * @var BPWM_T::INTEN - * Offset: 0xE0 BPWM Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |BPWM Zero Point Interrupt 0 Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * |[8] |PIEN0 |BPWM Period Point Interrupt 0 Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When up-down counter type period point means center point. - * |[16] |CMPUIEN0 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[17] |CMPUIEN1 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[18] |CMPUIEN2 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[19] |CMPUIEN3 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[20] |CMPUIEN4 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[21] |CMPUIEN5 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[24] |CMPDIEN0 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[25] |CMPDIEN1 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[26] |CMPDIEN2 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[27] |CMPDIEN3 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[28] |CMPDIEN4 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[29] |CMPDIEN5 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * @var BPWM_T::INTSTS - * Offset: 0xE8 BPWM Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |BPWM Zero Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches zero, software can write 1 to clear this bit to zero. - * |[8] |PIF0 |BPWM Period Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches BPWM_PERIOD0, software can write 1 to clear this bit to zero. - * |[16] |CMPUIF0 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[17] |CMPUIF1 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[18] |CMPUIF2 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[19] |CMPUIF3 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[20] |CMPUIF4 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[21] |CMPUIF5 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[24] |CMPDIF0 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[25] |CMPDIF1 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[26] |CMPDIF2 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[27] |CMPDIF3 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[28] |CMPDIF4 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[29] |CMPDIF5 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * @var BPWM_T::EADCTS0 - * Offset: 0xF8 BPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |BPWM_CH0 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN0 |BPWM_CH0 Trigger EADC Enable Bit - * |[11:8] |TRGSEL1 |BPWM_CH1 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN1 |BPWM_CH1 Trigger EADC Enable Bit - * |[19:16] |TRGSEL2 |BPWM_CH2 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved - * |[23] |TRGEN2 |BPWM_CH2 Trigger EADC Enable Bit - * |[27:24] |TRGSEL3 |BPWM_CH3 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved. - * |[31] |TRGEN3 |BPWM_CH3 Trigger EADC Enable Bit - * @var BPWM_T::EADCTS1 - * Offset: 0xFC BPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |BPWM_CH4 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN4 |BPWM_CH4 Trigger EADC Enable Bit - * |[11:8] |TRGSEL5 |BPWM_CH5 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN5 |BPWM_CH5 Trigger EADC Enable Bit - * @var BPWM_T::SSCTL - * Offset: 0x110 BPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |BPWM Synchronous Start Function 0 Enable Bit - * | | |When synchronous start function is enabled, the BPWM_CH0 counter enable bit (CNTEN0) can be enabled by writing BPWM synchronous start trigger bit (CNTSEN). - * | | |0 = BPWM synchronous start function Disabled. - * | | |1 = BPWM synchronous start function Enabled. - * |[9:8] |SSRC |BPWM Synchronous Start Source Select - * | | |00 = Synchronous start source come from PWM0. - * | | |01 = Synchronous start source come from PWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var BPWM_T::SSTRG - * Offset: 0x114 BPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |BPWM Counter Synchronous Start Enable Bit(Write Only) - * | | |BPMW counter synchronous enable function is used to make PWM or BPWM channels start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit if correlated BPWM channel counter synchronous start function is enabled. - * @var BPWM_T::STATUS - * Offset: 0x120 BPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAX0 |Time-base Counter 0 Equal to 0xFFFF Latched Status - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[16] |EADCTRG0 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[17] |EADCTRG1 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[18] |EADCTRG2 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[19] |EADCTRG3 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[20] |EADCTRG4 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[21] |EADCTRG5 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * @var BPWM_T::CAPINEN - * Offset: 0x200 BPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * @var BPWM_T::CAPCTL - * Offset: 0x204 BPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var BPWM_T::CAPSTS - * Offset: 0x208 BPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRIFOV0 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[1] |CRIFOV1 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[2] |CRIFOV2 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[3] |CRIFOV3 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[4] |CRIFOV4 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[5] |CRIFOV5 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[8] |CFIFOV0 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[9] |CFIFOV1 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[10] |CFIFOV2 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[11] |CFIFOV3 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[12] |CFIFOV4 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[13] |CFIFOV5 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * @var BPWM_T::CAPIEN - * Offset: 0x250 BPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CAPRIENn |BPWM Capture Rising Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[13:8] |CAPFIENn |BPWM Capture Falling Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var BPWM_T::CAPIF - * Offset: 0x254 BPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIF0 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[1] |CAPRIF1 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[2] |CAPRIF2 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[3] |CAPRIF3 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[4] |CAPRIF4 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[5] |CAPRIF5 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[8] |CAPFIF0 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[9] |CAPFIF1 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[10] |CAPFIF2 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[11] |CAPFIF3 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[12] |CAPFIF4 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[13] |CAPFIF5 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * @var BPWM_T::PBUF - * Offset: 0x304 BPWM PERIOD Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |BPWM Period Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var BPWM_T::CMPBUF[6] - * Offset: 0x31C BPWM CMPDAT 0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |BPWM Comparator Buffer (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL0; /*!< [0x0000] BPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] BPWM Control Register 1 */ - __I uint32_t RESERVED0[2]; - __IO uint32_t CLKSRC; /*!< [0x0010] BPWM Clock Source Register */ - __IO uint32_t CLKPSC; /*!< [0x0014] BPWM Clock Prescale Register */ - __I uint32_t RESERVED1[2]; - __IO uint32_t CNTEN; /*!< [0x0020] BPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] BPWM Clear Counter Register */ - __I uint32_t RESERVED2[2]; - __IO uint32_t PERIOD; /*!< [0x0030] BPWM Period Register */ - __I uint32_t RESERVED3[7]; - __IO uint32_t CMPDAT[6]; /*!< [0x0050~0x0064] BPWM Comparator Register 0~5 */ - __I uint32_t RESERVED4[10]; - __I uint32_t CNT; /*!< [0x0090] BPWM Counter Register */ - __I uint32_t RESERVED5[7]; - __IO uint32_t WGCTL0; /*!< [0x00b0] BPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] BPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] BPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] BPWM Mask Data Register */ - __I uint32_t RESERVED6[5]; - __IO uint32_t POLCTL; /*!< [0x00d4] BPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] BPWM Output Enable Register */ - __I uint32_t RESERVED7[1]; - __IO uint32_t INTEN; /*!< [0x00e0] BPWM Interrupt Enable Register */ - __I uint32_t RESERVED8[1]; - __IO uint32_t INTSTS; /*!< [0x00e8] BPWM Interrupt Flag Register */ - __I uint32_t RESERVED9[3]; - __IO uint32_t EADCTS0; /*!< [0x00f8] BPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] BPWM Trigger EADC Source Select Register 1 */ - __I uint32_t RESERVED10[4]; - __IO uint32_t SSCTL; /*!< [0x0110] BPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] BPWM Synchronous Start Trigger Register */ - __I uint32_t RESERVED11[2]; - __IO uint32_t STATUS; /*!< [0x0120] BPWM Status Register */ - __I uint32_t RESERVED12[55]; - __IO uint32_t CAPINEN; /*!< [0x0200] BPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] BPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] BPWM Capture Status Register */ - BCAPDAT_T CAPDAT[6]; /*!< [0x020c~0x0238] BPWM Rising and Falling Capture Data Register 0~5 */ - __I uint32_t RESERVED13[5]; - __IO uint32_t CAPIEN; /*!< [0x0250] BPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] BPWM Capture Interrupt Flag Register */ - __I uint32_t RESERVED14[43]; - __I uint32_t PBUF; /*!< [0x0304] BPWM PERIOD Buffer */ - __I uint32_t RESERVED15[5]; - __I uint32_t CMPBUF[6]; /*!< [0x031c~0x0330] BPWM CMPDAT 0~5 Buffer */ - -} BPWM_T; - -/** - @addtogroup BPWM_CONST BPWM Bit Field Definition - Constant Definitions for BPWM Controller - @{ -*/ - -#define BPWM_CTL0_CTRLD0_Pos (0) /*!< BPWM_T::CTL0: CTRLD0 Position */ -#define BPWM_CTL0_CTRLD0_Msk (0x1ul << BPWM_CTL0_CTRLD0_Pos) /*!< BPWM_T::CTL0: CTRLD0 Mask */ - -#define BPWM_CTL0_CTRLD1_Pos (1) /*!< BPWM_T::CTL0: CTRLD1 Position */ -#define BPWM_CTL0_CTRLD1_Msk (0x1ul << BPWM_CTL0_CTRLD1_Pos) /*!< BPWM_T::CTL0: CTRLD1 Mask */ - -#define BPWM_CTL0_CTRLD2_Pos (2) /*!< BPWM_T::CTL0: CTRLD2 Position */ -#define BPWM_CTL0_CTRLD2_Msk (0x1ul << BPWM_CTL0_CTRLD2_Pos) /*!< BPWM_T::CTL0: CTRLD2 Mask */ - -#define BPWM_CTL0_CTRLD3_Pos (3) /*!< BPWM_T::CTL0: CTRLD3 Position */ -#define BPWM_CTL0_CTRLD3_Msk (0x1ul << BPWM_CTL0_CTRLD3_Pos) /*!< BPWM_T::CTL0: CTRLD3 Mask */ - -#define BPWM_CTL0_CTRLD4_Pos (4) /*!< BPWM_T::CTL0: CTRLD4 Position */ -#define BPWM_CTL0_CTRLD4_Msk (0x1ul << BPWM_CTL0_CTRLD4_Pos) /*!< BPWM_T::CTL0: CTRLD4 Mask */ - -#define BPWM_CTL0_CTRLD5_Pos (5) /*!< BPWM_T::CTL0: CTRLD5 Position */ -#define BPWM_CTL0_CTRLD5_Msk (0x1ul << BPWM_CTL0_CTRLD5_Pos) /*!< BPWM_T::CTL0: CTRLD5 Mask */ - -#define BPWM_CTL0_IMMLDEN0_Pos (16) /*!< BPWM_T::CTL0: IMMLDEN0 Position */ -#define BPWM_CTL0_IMMLDEN0_Msk (0x1ul << BPWM_CTL0_IMMLDEN0_Pos) /*!< BPWM_T::CTL0: IMMLDEN0 Mask */ - -#define BPWM_CTL0_IMMLDEN1_Pos (17) /*!< BPWM_T::CTL0: IMMLDEN1 Position */ -#define BPWM_CTL0_IMMLDEN1_Msk (0x1ul << BPWM_CTL0_IMMLDEN1_Pos) /*!< BPWM_T::CTL0: IMMLDEN1 Mask */ - -#define BPWM_CTL0_IMMLDEN2_Pos (18) /*!< BPWM_T::CTL0: IMMLDEN2 Position */ -#define BPWM_CTL0_IMMLDEN2_Msk (0x1ul << BPWM_CTL0_IMMLDEN2_Pos) /*!< BPWM_T::CTL0: IMMLDEN2 Mask */ - -#define BPWM_CTL0_IMMLDEN3_Pos (19) /*!< BPWM_T::CTL0: IMMLDEN3 Position */ -#define BPWM_CTL0_IMMLDEN3_Msk (0x1ul << BPWM_CTL0_IMMLDEN3_Pos) /*!< BPWM_T::CTL0: IMMLDEN3 Mask */ - -#define BPWM_CTL0_IMMLDEN4_Pos (20) /*!< BPWM_T::CTL0: IMMLDEN4 Position */ -#define BPWM_CTL0_IMMLDEN4_Msk (0x1ul << BPWM_CTL0_IMMLDEN4_Pos) /*!< BPWM_T::CTL0: IMMLDEN4 Mask */ - -#define BPWM_CTL0_IMMLDEN5_Pos (21) /*!< BPWM_T::CTL0: IMMLDEN5 Position */ -#define BPWM_CTL0_IMMLDEN5_Msk (0x1ul << BPWM_CTL0_IMMLDEN5_Pos) /*!< BPWM_T::CTL0: IMMLDEN5 Mask */ - -#define BPWM_CTL0_DBGHALT_Pos (30) /*!< BPWM_T::CTL0: DBGHALT Position */ -#define BPWM_CTL0_DBGHALT_Msk (0x1ul << BPWM_CTL0_DBGHALT_Pos) /*!< BPWM_T::CTL0: DBGHALT Mask */ - -#define BPWM_CTL0_DBGTRIOFF_Pos (31) /*!< BPWM_T::CTL0: DBGTRIOFF Position */ -#define BPWM_CTL0_DBGTRIOFF_Msk (0x1ul << BPWM_CTL0_DBGTRIOFF_Pos) /*!< BPWM_T::CTL0: DBGTRIOFF Mask */ - -#define BPWM_CTL1_CNTTYPE0_Pos (0) /*!< BPWM_T::CTL1: CNTTYPE0 Position */ -#define BPWM_CTL1_CNTTYPE0_Msk (0x3ul << BPWM_CTL1_CNTTYPE0_Pos) /*!< BPWM_T::CTL1: CNTTYPE0 Mask */ - -#define BPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< BPWM_T::CLKSRC: ECLKSRC0 Position */ -#define BPWM_CLKSRC_ECLKSRC0_Msk (0x7ul << BPWM_CLKSRC_ECLKSRC0_Pos) /*!< BPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define BPWM_CLKPSC_CLKPSC_Pos (0) /*!< BPWM_T::CLKPSC: CLKPSC Position */ -#define BPWM_CLKPSC_CLKPSC_Msk (0xffful << BPWM_CLKPSC_CLKPSC_Pos) /*!< BPWM_T::CLKPSC: CLKPSC Mask */ - -#define BPWM_CNTEN_CNTEN0_Pos (0) /*!< BPWM_T::CNTEN: CNTEN0 Position */ -#define BPWM_CNTEN_CNTEN0_Msk (0x1ul << BPWM_CNTEN_CNTEN0_Pos) /*!< BPWM_T::CNTEN: CNTEN0 Mask */ - -#define BPWM_CNTCLR_CNTCLR0_Pos (0) /*!< BPWM_T::CNTCLR: CNTCLR0 Position */ -#define BPWM_CNTCLR_CNTCLR0_Msk (0x1ul << BPWM_CNTCLR_CNTCLR0_Pos) /*!< BPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define BPWM_PERIOD_PERIOD_Pos (0) /*!< BPWM_T::PERIOD: PERIOD Position */ -#define BPWM_PERIOD_PERIOD_Msk (0xfffful << BPWM_PERIOD_PERIOD_Pos) /*!< BPWM_T::PERIOD: PERIOD Mask */ - -#define BPWM_CMPDAT0_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT0: CMPDAT Position */ -#define BPWM_CMPDAT0_CMPDAT_Msk (0xfffful << BPWM_CMPDAT0_CMPDAT_Pos) /*!< BPWM_T::CMPDAT0: CMPDAT Mask */ - -#define BPWM_CMPDAT1_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT1: CMPDAT Position */ -#define BPWM_CMPDAT1_CMPDAT_Msk (0xfffful << BPWM_CMPDAT1_CMPDAT_Pos) /*!< BPWM_T::CMPDAT1: CMPDAT Mask */ - -#define BPWM_CMPDAT2_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT2: CMPDAT Position */ -#define BPWM_CMPDAT2_CMPDAT_Msk (0xfffful << BPWM_CMPDAT2_CMPDAT_Pos) /*!< BPWM_T::CMPDAT2: CMPDAT Mask */ - -#define BPWM_CMPDAT3_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT3: CMPDAT Position */ -#define BPWM_CMPDAT3_CMPDAT_Msk (0xfffful << BPWM_CMPDAT3_CMPDAT_Pos) /*!< BPWM_T::CMPDAT3: CMPDAT Mask */ - -#define BPWM_CMPDAT4_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT4: CMPDAT Position */ -#define BPWM_CMPDAT4_CMPDAT_Msk (0xfffful << BPWM_CMPDAT4_CMPDAT_Pos) /*!< BPWM_T::CMPDAT4: CMPDAT Mask */ - -#define BPWM_CMPDAT5_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT5: CMPDAT Position */ -#define BPWM_CMPDAT5_CMPDAT_Msk (0xfffful << BPWM_CMPDAT5_CMPDAT_Pos) /*!< BPWM_T::CMPDAT5: CMPDAT Mask */ - -#define BPWM_CNT_CNT_Pos (0) /*!< BPWM_T::CNT: CNT Position */ -#define BPWM_CNT_CNT_Msk (0xfffful << BPWM_CNT_CNT_Pos) /*!< BPWM_T::CNT: CNT Mask */ - -#define BPWM_CNT_DIRF_Pos (16) /*!< BPWM_T::CNT: DIRF Position */ -#define BPWM_CNT_DIRF_Msk (0x1ul << BPWM_CNT_DIRF_Pos) /*!< BPWM_T::CNT: DIRF Mask */ - -#define BPWM_WGCTL0_ZPCTL0_Pos (0) /*!< BPWM_T::WGCTL0: ZPCTL0 Position */ -#define BPWM_WGCTL0_ZPCTL0_Msk (0x3ul << BPWM_WGCTL0_ZPCTL0_Pos) /*!< BPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define BPWM_WGCTL0_ZPCTL1_Pos (2) /*!< BPWM_T::WGCTL0: ZPCTL1 Position */ -#define BPWM_WGCTL0_ZPCTL1_Msk (0x3ul << BPWM_WGCTL0_ZPCTL1_Pos) /*!< BPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define BPWM_WGCTL0_ZPCTL2_Pos (4) /*!< BPWM_T::WGCTL0: ZPCTL2 Position */ -#define BPWM_WGCTL0_ZPCTL2_Msk (0x3ul << BPWM_WGCTL0_ZPCTL2_Pos) /*!< BPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define BPWM_WGCTL0_ZPCTL3_Pos (6) /*!< BPWM_T::WGCTL0: ZPCTL3 Position */ -#define BPWM_WGCTL0_ZPCTL3_Msk (0x3ul << BPWM_WGCTL0_ZPCTL3_Pos) /*!< BPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define BPWM_WGCTL0_ZPCTL4_Pos (8) /*!< BPWM_T::WGCTL0: ZPCTL4 Position */ -#define BPWM_WGCTL0_ZPCTL4_Msk (0x3ul << BPWM_WGCTL0_ZPCTL4_Pos) /*!< BPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define BPWM_WGCTL0_ZPCTL5_Pos (10) /*!< BPWM_T::WGCTL0: ZPCTL5 Position */ -#define BPWM_WGCTL0_ZPCTL5_Msk (0x3ul << BPWM_WGCTL0_ZPCTL5_Pos) /*!< BPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define BPWM_WGCTL0_ZPCTLn_Pos (0) /*!< BPWM_T::WGCTL0: ZPCTLn Position */ -#define BPWM_WGCTL0_ZPCTLn_Msk (0xffful << BPWM_WGCTL0_ZPCTLn_Pos) /*!< BPWM_T::WGCTL0: ZPCTLn Mask */ - -#define BPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< BPWM_T::WGCTL0: PRDPCTL0 Position */ -#define BPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL0_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define BPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< BPWM_T::WGCTL0: PRDPCTL1 Position */ -#define BPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL1_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define BPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< BPWM_T::WGCTL0: PRDPCTL2 Position */ -#define BPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL2_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define BPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< BPWM_T::WGCTL0: PRDPCTL3 Position */ -#define BPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL3_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define BPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< BPWM_T::WGCTL0: PRDPCTL4 Position */ -#define BPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL4_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define BPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< BPWM_T::WGCTL0: PRDPCTL5 Position */ -#define BPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL5_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define BPWM_WGCTL0_PRDPCTLn_Pos (16) /*!< BPWM_T::WGCTL0: PRDPCTLn Position */ -#define BPWM_WGCTL0_PRDPCTLn_Msk (0xffful << BPWM_WGCTL0_PRDPCTLn_Pos) /*!< BPWM_T::WGCTL0: PRDPCTLn Mask */ - -#define BPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< BPWM_T::WGCTL1: CMPUCTL0 Position */ -#define BPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define BPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< BPWM_T::WGCTL1: CMPUCTL1 Position */ -#define BPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define BPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< BPWM_T::WGCTL1: CMPUCTL2 Position */ -#define BPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define BPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< BPWM_T::WGCTL1: CMPUCTL3 Position */ -#define BPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define BPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< BPWM_T::WGCTL1: CMPUCTL4 Position */ -#define BPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define BPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< BPWM_T::WGCTL1: CMPUCTL5 Position */ -#define BPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define BPWM_WGCTL1_CMPUCTLn_Pos (0) /*!< BPWM_T::WGCTL1: CMPUCTLn Position */ -#define BPWM_WGCTL1_CMPUCTLn_Msk (0xffful << BPWM_WGCTL1_CMPUCTLn_Pos) /*!< BPWM_T::WGCTL1: CMPUCTLn Mask */ - -#define BPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< BPWM_T::WGCTL1: CMPDCTL0 Position */ -#define BPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define BPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< BPWM_T::WGCTL1: CMPDCTL1 Position */ -#define BPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define BPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< BPWM_T::WGCTL1: CMPDCTL2 Position */ -#define BPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define BPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< BPWM_T::WGCTL1: CMPDCTL3 Position */ -#define BPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define BPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< BPWM_T::WGCTL1: CMPDCTL4 Position */ -#define BPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define BPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< BPWM_T::WGCTL1: CMPDCTL5 Position */ -#define BPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define BPWM_WGCTL1_CMPDCTLn_Pos (16) /*!< BPWM_T::WGCTL1: CMPDCTLn Position */ -#define BPWM_WGCTL1_CMPDCTLn_Msk (0xffful << BPWM_WGCTL1_CMPDCTLn_Pos) /*!< BPWM_T::WGCTL1: CMPDCTLn Mask */ - -#define BPWM_MSKEN_MSKEN0_Pos (0) /*!< BPWM_T::MSKEN: MSKEN0 Position */ -#define BPWM_MSKEN_MSKEN0_Msk (0x1ul << BPWM_MSKEN_MSKEN0_Pos) /*!< BPWM_T::MSKEN: MSKEN0 Mask */ - -#define BPWM_MSKEN_MSKEN1_Pos (1) /*!< BPWM_T::MSKEN: MSKEN1 Position */ -#define BPWM_MSKEN_MSKEN1_Msk (0x1ul << BPWM_MSKEN_MSKEN1_Pos) /*!< BPWM_T::MSKEN: MSKEN1 Mask */ - -#define BPWM_MSKEN_MSKEN2_Pos (2) /*!< BPWM_T::MSKEN: MSKEN2 Position */ -#define BPWM_MSKEN_MSKEN2_Msk (0x1ul << BPWM_MSKEN_MSKEN2_Pos) /*!< BPWM_T::MSKEN: MSKEN2 Mask */ - -#define BPWM_MSKEN_MSKEN3_Pos (3) /*!< BPWM_T::MSKEN: MSKEN3 Position */ -#define BPWM_MSKEN_MSKEN3_Msk (0x1ul << BPWM_MSKEN_MSKEN3_Pos) /*!< BPWM_T::MSKEN: MSKEN3 Mask */ - -#define BPWM_MSKEN_MSKEN4_Pos (4) /*!< BPWM_T::MSKEN: MSKEN4 Position */ -#define BPWM_MSKEN_MSKEN4_Msk (0x1ul << BPWM_MSKEN_MSKEN4_Pos) /*!< BPWM_T::MSKEN: MSKEN4 Mask */ - -#define BPWM_MSKEN_MSKEN5_Pos (5) /*!< BPWM_T::MSKEN: MSKEN5 Position */ -#define BPWM_MSKEN_MSKEN5_Msk (0x1ul << BPWM_MSKEN_MSKEN5_Pos) /*!< BPWM_T::MSKEN: MSKEN5 Mask */ - -#define BPWM_MSKEN_MSKENn_Pos (0) /*!< BPWM_T::MSKEN: MSKENn Position */ -#define BPWM_MSKEN_MSKENn_Msk (0x3ful << BPWM_MSKEN_MSKENn_Pos) /*!< BPWM_T::MSKEN: MSKENn Mask */ - -#define BPWM_MSK_MSKDAT0_Pos (0) /*!< BPWM_T::MSK: MSKDAT0 Position */ -#define BPWM_MSK_MSKDAT0_Msk (0x1ul << BPWM_MSK_MSKDAT0_Pos) /*!< BPWM_T::MSK: MSKDAT0 Mask */ - -#define BPWM_MSK_MSKDAT1_Pos (1) /*!< BPWM_T::MSK: MSKDAT1 Position */ -#define BPWM_MSK_MSKDAT1_Msk (0x1ul << BPWM_MSK_MSKDAT1_Pos) /*!< BPWM_T::MSK: MSKDAT1 Mask */ - -#define BPWM_MSK_MSKDAT2_Pos (2) /*!< BPWM_T::MSK: MSKDAT2 Position */ -#define BPWM_MSK_MSKDAT2_Msk (0x1ul << BPWM_MSK_MSKDAT2_Pos) /*!< BPWM_T::MSK: MSKDAT2 Mask */ - -#define BPWM_MSK_MSKDAT3_Pos (3) /*!< BPWM_T::MSK: MSKDAT3 Position */ -#define BPWM_MSK_MSKDAT3_Msk (0x1ul << BPWM_MSK_MSKDAT3_Pos) /*!< BPWM_T::MSK: MSKDAT3 Mask */ - -#define BPWM_MSK_MSKDAT4_Pos (4) /*!< BPWM_T::MSK: MSKDAT4 Position */ -#define BPWM_MSK_MSKDAT4_Msk (0x1ul << BPWM_MSK_MSKDAT4_Pos) /*!< BPWM_T::MSK: MSKDAT4 Mask */ - -#define BPWM_MSK_MSKDAT5_Pos (5) /*!< BPWM_T::MSK: MSKDAT5 Position */ -#define BPWM_MSK_MSKDAT5_Msk (0x1ul << BPWM_MSK_MSKDAT5_Pos) /*!< BPWM_T::MSK: MSKDAT5 Mask */ - -#define BPWM_MSK_MSKDATn_Pos (0) /*!< BPWM_T::MSK: MSKDATn Position */ -#define BPWM_MSK_MSKDATn_Msk (0x3ful << BPWM_MSK_MSKDATn_Pos) /*!< BPWM_T::MSK: MSKDATn Mask */ - -#define BPWM_POLCTL_PINV0_Pos (0) /*!< BPWM_T::POLCTL: PINV0 Position */ -#define BPWM_POLCTL_PINV0_Msk (0x1ul << BPWM_POLCTL_PINV0_Pos) /*!< BPWM_T::POLCTL: PINV0 Mask */ - -#define BPWM_POLCTL_PINV1_Pos (1) /*!< BPWM_T::POLCTL: PINV1 Position */ -#define BPWM_POLCTL_PINV1_Msk (0x1ul << BPWM_POLCTL_PINV1_Pos) /*!< BPWM_T::POLCTL: PINV1 Mask */ - -#define BPWM_POLCTL_PINV2_Pos (2) /*!< BPWM_T::POLCTL: PINV2 Position */ -#define BPWM_POLCTL_PINV2_Msk (0x1ul << BPWM_POLCTL_PINV2_Pos) /*!< BPWM_T::POLCTL: PINV2 Mask */ - -#define BPWM_POLCTL_PINV3_Pos (3) /*!< BPWM_T::POLCTL: PINV3 Position */ -#define BPWM_POLCTL_PINV3_Msk (0x1ul << BPWM_POLCTL_PINV3_Pos) /*!< BPWM_T::POLCTL: PINV3 Mask */ - -#define BPWM_POLCTL_PINV4_Pos (4) /*!< BPWM_T::POLCTL: PINV4 Position */ -#define BPWM_POLCTL_PINV4_Msk (0x1ul << BPWM_POLCTL_PINV4_Pos) /*!< BPWM_T::POLCTL: PINV4 Mask */ - -#define BPWM_POLCTL_PINV5_Pos (5) /*!< BPWM_T::POLCTL: PINV5 Position */ -#define BPWM_POLCTL_PINV5_Msk (0x1ul << BPWM_POLCTL_PINV5_Pos) /*!< BPWM_T::POLCTL: PINV5 Mask */ - -#define BPWM_POLCTL_PINVn_Pos (0) /*!< BPWM_T::POLCTL: PINVn Position */ -#define BPWM_POLCTL_PINVn_Msk (0x3ful << BPWM_POLCTL_PINVn_Pos) /*!< BPWM_T::POLCTL: PINVn Mask */ - -#define BPWM_POEN_POEN0_Pos (0) /*!< BPWM_T::POEN: POEN0 Position */ -#define BPWM_POEN_POEN0_Msk (0x1ul << BPWM_POEN_POEN0_Pos) /*!< BPWM_T::POEN: POEN0 Mask */ - -#define BPWM_POEN_POEN1_Pos (1) /*!< BPWM_T::POEN: POEN1 Position */ -#define BPWM_POEN_POEN1_Msk (0x1ul << BPWM_POEN_POEN1_Pos) /*!< BPWM_T::POEN: POEN1 Mask */ - -#define BPWM_POEN_POEN2_Pos (2) /*!< BPWM_T::POEN: POEN2 Position */ -#define BPWM_POEN_POEN2_Msk (0x1ul << BPWM_POEN_POEN2_Pos) /*!< BPWM_T::POEN: POEN2 Mask */ - -#define BPWM_POEN_POEN3_Pos (3) /*!< BPWM_T::POEN: POEN3 Position */ -#define BPWM_POEN_POEN3_Msk (0x1ul << BPWM_POEN_POEN3_Pos) /*!< BPWM_T::POEN: POEN3 Mask */ - -#define BPWM_POEN_POEN4_Pos (4) /*!< BPWM_T::POEN: POEN4 Position */ -#define BPWM_POEN_POEN4_Msk (0x1ul << BPWM_POEN_POEN4_Pos) /*!< BPWM_T::POEN: POEN4 Mask */ - -#define BPWM_POEN_POEN5_Pos (5) /*!< BPWM_T::POEN: POEN5 Position */ -#define BPWM_POEN_POEN5_Msk (0x1ul << BPWM_POEN_POEN5_Pos) /*!< BPWM_T::POEN: POEN5 Mask */ - -#define BPWM_POEN_POENn_Pos (0) /*!< BPWM_T::POEN: POENn Position */ -#define BPWM_POEN_POENn_Msk (0x3ful << BPWM_POEN_POENn_Pos) /*!< BPWM_T::POEN: POENn Mask */ - -#define BPWM_INTEN_ZIEN0_Pos (0) /*!< BPWM_T::INTEN: ZIEN0 Position */ -#define BPWM_INTEN_ZIEN0_Msk (0x1ul << BPWM_INTEN_ZIEN0_Pos) /*!< BPWM_T::INTEN: ZIEN0 Mask */ - -#define BPWM_INTEN_PIEN0_Pos (8) /*!< BPWM_T::INTEN: PIEN0 Position */ -#define BPWM_INTEN_PIEN0_Msk (0x1ul << BPWM_INTEN_PIEN0_Pos) /*!< BPWM_T::INTEN: PIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN0_Pos (16) /*!< BPWM_T::INTEN: CMPUIEN0 Position */ -#define BPWM_INTEN_CMPUIEN0_Msk (0x1ul << BPWM_INTEN_CMPUIEN0_Pos) /*!< BPWM_T::INTEN: CMPUIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN1_Pos (17) /*!< BPWM_T::INTEN: CMPUIEN1 Position */ -#define BPWM_INTEN_CMPUIEN1_Msk (0x1ul << BPWM_INTEN_CMPUIEN1_Pos) /*!< BPWM_T::INTEN: CMPUIEN1 Mask */ - -#define BPWM_INTEN_CMPUIEN2_Pos (18) /*!< BPWM_T::INTEN: CMPUIEN2 Position */ -#define BPWM_INTEN_CMPUIEN2_Msk (0x1ul << BPWM_INTEN_CMPUIEN2_Pos) /*!< BPWM_T::INTEN: CMPUIEN2 Mask */ - -#define BPWM_INTEN_CMPUIEN3_Pos (19) /*!< BPWM_T::INTEN: CMPUIEN3 Position */ -#define BPWM_INTEN_CMPUIEN3_Msk (0x1ul << BPWM_INTEN_CMPUIEN3_Pos) /*!< BPWM_T::INTEN: CMPUIEN3 Mask */ - -#define BPWM_INTEN_CMPUIEN4_Pos (20) /*!< BPWM_T::INTEN: CMPUIEN4 Position */ -#define BPWM_INTEN_CMPUIEN4_Msk (0x1ul << BPWM_INTEN_CMPUIEN4_Pos) /*!< BPWM_T::INTEN: CMPUIEN4 Mask */ - -#define BPWM_INTEN_CMPUIEN5_Pos (21) /*!< BPWM_T::INTEN: CMPUIEN5 Position */ -#define BPWM_INTEN_CMPUIEN5_Msk (0x1ul << BPWM_INTEN_CMPUIEN5_Pos) /*!< BPWM_T::INTEN: CMPUIEN5 Mask */ - -#define BPWM_INTEN_CMPUIENn_Pos (16) /*!< BPWM_T::INTEN: CMPUIENn Position */ -#define BPWM_INTEN_CMPUIENn_Msk (0x3ful << BPWM_INTEN_CMPUIENn_Pos) /*!< BPWM_T::INTEN: CMPUIENn Mask */ - -#define BPWM_INTEN_CMPDIEN0_Pos (24) /*!< BPWM_T::INTEN: CMPDIEN0 Position */ -#define BPWM_INTEN_CMPDIEN0_Msk (0x1ul << BPWM_INTEN_CMPDIEN0_Pos) /*!< BPWM_T::INTEN: CMPDIEN0 Mask */ - -#define BPWM_INTEN_CMPDIEN1_Pos (25) /*!< BPWM_T::INTEN: CMPDIEN1 Position */ -#define BPWM_INTEN_CMPDIEN1_Msk (0x1ul << BPWM_INTEN_CMPDIEN1_Pos) /*!< BPWM_T::INTEN: CMPDIEN1 Mask */ - -#define BPWM_INTEN_CMPDIEN2_Pos (26) /*!< BPWM_T::INTEN: CMPDIEN2 Position */ -#define BPWM_INTEN_CMPDIEN2_Msk (0x1ul << BPWM_INTEN_CMPDIEN2_Pos) /*!< BPWM_T::INTEN: CMPDIEN2 Mask */ - -#define BPWM_INTEN_CMPDIEN3_Pos (27) /*!< BPWM_T::INTEN: CMPDIEN3 Position */ -#define BPWM_INTEN_CMPDIEN3_Msk (0x1ul << BPWM_INTEN_CMPDIEN3_Pos) /*!< BPWM_T::INTEN: CMPDIEN3 Mask */ - -#define BPWM_INTEN_CMPDIEN4_Pos (28) /*!< BPWM_T::INTEN: CMPDIEN4 Position */ -#define BPWM_INTEN_CMPDIEN4_Msk (0x1ul << BPWM_INTEN_CMPDIEN4_Pos) /*!< BPWM_T::INTEN: CMPDIEN4 Mask */ - -#define BPWM_INTEN_CMPDIEN5_Pos (29) /*!< BPWM_T::INTEN: CMPDIEN5 Position */ -#define BPWM_INTEN_CMPDIEN5_Msk (0x1ul << BPWM_INTEN_CMPDIEN5_Pos) /*!< BPWM_T::INTEN: CMPDIEN5 Mask */ - -#define BPWM_INTEN_CMPDIENn_Pos (24) /*!< BPWM_T::INTEN: CMPDIENn Position */ -#define BPWM_INTEN_CMPDIENn_Msk (0x3ful << BPWM_INTEN_CMPDIENn_Pos) /*!< BPWM_T::INTEN: CMPDIENn Mask */ - -#define BPWM_INTSTS_ZIF0_Pos (0) /*!< BPWM_T::INTSTS: ZIF0 Position */ -#define BPWM_INTSTS_ZIF0_Msk (0x1ul << BPWM_INTSTS_ZIF0_Pos) /*!< BPWM_T::INTSTS: ZIF0 Mask */ - -#define BPWM_INTSTS_PIF0_Pos (8) /*!< BPWM_T::INTSTS: PIF0 Position */ -#define BPWM_INTSTS_PIF0_Msk (0x1ul << BPWM_INTSTS_PIF0_Pos) /*!< BPWM_T::INTSTS: PIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF0_Pos (16) /*!< BPWM_T::INTSTS: CMPUIF0 Position */ -#define BPWM_INTSTS_CMPUIF0_Msk (0x1ul << BPWM_INTSTS_CMPUIF0_Pos) /*!< BPWM_T::INTSTS: CMPUIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF1_Pos (17) /*!< BPWM_T::INTSTS: CMPUIF1 Position */ -#define BPWM_INTSTS_CMPUIF1_Msk (0x1ul << BPWM_INTSTS_CMPUIF1_Pos) /*!< BPWM_T::INTSTS: CMPUIF1 Mask */ - -#define BPWM_INTSTS_CMPUIF2_Pos (18) /*!< BPWM_T::INTSTS: CMPUIF2 Position */ -#define BPWM_INTSTS_CMPUIF2_Msk (0x1ul << BPWM_INTSTS_CMPUIF2_Pos) /*!< BPWM_T::INTSTS: CMPUIF2 Mask */ - -#define BPWM_INTSTS_CMPUIF3_Pos (19) /*!< BPWM_T::INTSTS: CMPUIF3 Position */ -#define BPWM_INTSTS_CMPUIF3_Msk (0x1ul << BPWM_INTSTS_CMPUIF3_Pos) /*!< BPWM_T::INTSTS: CMPUIF3 Mask */ - -#define BPWM_INTSTS_CMPUIF4_Pos (20) /*!< BPWM_T::INTSTS: CMPUIF4 Position */ -#define BPWM_INTSTS_CMPUIF4_Msk (0x1ul << BPWM_INTSTS_CMPUIF4_Pos) /*!< BPWM_T::INTSTS: CMPUIF4 Mask */ - -#define BPWM_INTSTS_CMPUIF5_Pos (21) /*!< BPWM_T::INTSTS: CMPUIF5 Position */ -#define BPWM_INTSTS_CMPUIF5_Msk (0x1ul << BPWM_INTSTS_CMPUIF5_Pos) /*!< BPWM_T::INTSTS: CMPUIF5 Mask */ - -#define BPWM_INTSTS_CMPUIFn_Pos (16) /*!< BPWM_T::INTSTS: CMPUIFn Position */ -#define BPWM_INTSTS_CMPUIFn_Msk (0x3ful << BPWM_INTSTS_CMPUIFn_Pos) /*!< BPWM_T::INTSTS: CMPUIFn Mask */ - -#define BPWM_INTSTS_CMPDIF0_Pos (24) /*!< BPWM_T::INTSTS: CMPDIF0 Position */ -#define BPWM_INTSTS_CMPDIF0_Msk (0x1ul << BPWM_INTSTS_CMPDIF0_Pos) /*!< BPWM_T::INTSTS: CMPDIF0 Mask */ - -#define BPWM_INTSTS_CMPDIF1_Pos (25) /*!< BPWM_T::INTSTS: CMPDIF1 Position */ -#define BPWM_INTSTS_CMPDIF1_Msk (0x1ul << BPWM_INTSTS_CMPDIF1_Pos) /*!< BPWM_T::INTSTS: CMPDIF1 Mask */ - -#define BPWM_INTSTS_CMPDIF2_Pos (26) /*!< BPWM_T::INTSTS: CMPDIF2 Position */ -#define BPWM_INTSTS_CMPDIF2_Msk (0x1ul << BPWM_INTSTS_CMPDIF2_Pos) /*!< BPWM_T::INTSTS: CMPDIF2 Mask */ - -#define BPWM_INTSTS_CMPDIF3_Pos (27) /*!< BPWM_T::INTSTS: CMPDIF3 Position */ -#define BPWM_INTSTS_CMPDIF3_Msk (0x1ul << BPWM_INTSTS_CMPDIF3_Pos) /*!< BPWM_T::INTSTS: CMPDIF3 Mask */ - -#define BPWM_INTSTS_CMPDIF4_Pos (28) /*!< BPWM_T::INTSTS: CMPDIF4 Position */ -#define BPWM_INTSTS_CMPDIF4_Msk (0x1ul << BPWM_INTSTS_CMPDIF4_Pos) /*!< BPWM_T::INTSTS: CMPDIF4 Mask */ - -#define BPWM_INTSTS_CMPDIF5_Pos (29) /*!< BPWM_T::INTSTS: CMPDIF5 Position */ -#define BPWM_INTSTS_CMPDIF5_Msk (0x1ul << BPWM_INTSTS_CMPDIF5_Pos) /*!< BPWM_T::INTSTS: CMPDIF5 Mask */ - -#define BPWM_INTSTS_CMPDIFn_Pos (24) /*!< BPWM_T::INTSTS: CMPDIFn Position */ -#define BPWM_INTSTS_CMPDIFn_Msk (0x3ful << BPWM_INTSTS_CMPDIFn_Pos) /*!< BPWM_T::INTSTS: CMPDIFn Mask */ - -#define BPWM_EADCTS0_TRGSEL0_Pos (0) /*!< BPWM_T::EADCTS0: TRGSEL0 Position */ -#define BPWM_EADCTS0_TRGSEL0_Msk (0xful << BPWM_EADCTS0_TRGSEL0_Pos) /*!< BPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define BPWM_EADCTS0_TRGEN0_Pos (7) /*!< BPWM_T::EADCTS0: TRGEN0 Position */ -#define BPWM_EADCTS0_TRGEN0_Msk (0x1ul << BPWM_EADCTS0_TRGEN0_Pos) /*!< BPWM_T::EADCTS0: TRGEN0 Mask */ - -#define BPWM_EADCTS0_TRGSEL1_Pos (8) /*!< BPWM_T::EADCTS0: TRGSEL1 Position */ -#define BPWM_EADCTS0_TRGSEL1_Msk (0xful << BPWM_EADCTS0_TRGSEL1_Pos) /*!< BPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define BPWM_EADCTS0_TRGEN1_Pos (15) /*!< BPWM_T::EADCTS0: TRGEN1 Position */ -#define BPWM_EADCTS0_TRGEN1_Msk (0x1ul << BPWM_EADCTS0_TRGEN1_Pos) /*!< BPWM_T::EADCTS0: TRGEN1 Mask */ - -#define BPWM_EADCTS0_TRGSEL2_Pos (16) /*!< BPWM_T::EADCTS0: TRGSEL2 Position */ -#define BPWM_EADCTS0_TRGSEL2_Msk (0xful << BPWM_EADCTS0_TRGSEL2_Pos) /*!< BPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define BPWM_EADCTS0_TRGEN2_Pos (23) /*!< BPWM_T::EADCTS0: TRGEN2 Position */ -#define BPWM_EADCTS0_TRGEN2_Msk (0x1ul << BPWM_EADCTS0_TRGEN2_Pos) /*!< BPWM_T::EADCTS0: TRGEN2 Mask */ - -#define BPWM_EADCTS0_TRGSEL3_Pos (24) /*!< BPWM_T::EADCTS0: TRGSEL3 Position */ -#define BPWM_EADCTS0_TRGSEL3_Msk (0xful << BPWM_EADCTS0_TRGSEL3_Pos) /*!< BPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define BPWM_EADCTS0_TRGEN3_Pos (31) /*!< BPWM_T::EADCTS0: TRGEN3 Position */ -#define BPWM_EADCTS0_TRGEN3_Msk (0x1ul << BPWM_EADCTS0_TRGEN3_Pos) /*!< BPWM_T::EADCTS0: TRGEN3 Mask */ - -#define BPWM_EADCTS1_TRGSEL4_Pos (0) /*!< BPWM_T::EADCTS1: TRGSEL4 Position */ -#define BPWM_EADCTS1_TRGSEL4_Msk (0xful << BPWM_EADCTS1_TRGSEL4_Pos) /*!< BPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define BPWM_EADCTS1_TRGEN4_Pos (7) /*!< BPWM_T::EADCTS1: TRGEN4 Position */ -#define BPWM_EADCTS1_TRGEN4_Msk (0x1ul << BPWM_EADCTS1_TRGEN4_Pos) /*!< BPWM_T::EADCTS1: TRGEN4 Mask */ - -#define BPWM_EADCTS1_TRGSEL5_Pos (8) /*!< BPWM_T::EADCTS1: TRGSEL5 Position */ -#define BPWM_EADCTS1_TRGSEL5_Msk (0xful << BPWM_EADCTS1_TRGSEL5_Pos) /*!< BPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define BPWM_EADCTS1_TRGEN5_Pos (15) /*!< BPWM_T::EADCTS1: TRGEN5 Position */ -#define BPWM_EADCTS1_TRGEN5_Msk (0x1ul << BPWM_EADCTS1_TRGEN5_Pos) /*!< BPWM_T::EADCTS1: TRGEN5 Mask */ - -#define BPWM_SSCTL_SSEN0_Pos (0) /*!< BPWM_T::SSCTL: SSEN0 Position */ -#define BPWM_SSCTL_SSEN0_Msk (0x1ul << BPWM_SSCTL_SSEN0_Pos) /*!< BPWM_T::SSCTL: SSEN0 Mask */ - -#define BPWM_SSCTL_SSRC_Pos (8) /*!< BPWM_T::SSCTL: SSRC Position */ -#define BPWM_SSCTL_SSRC_Msk (0x3ul << BPWM_SSCTL_SSRC_Pos) /*!< BPWM_T::SSCTL: SSRC Mask */ - -#define BPWM_SSTRG_CNTSEN_Pos (0) /*!< BPWM_T::SSTRG: CNTSEN Position */ -#define BPWM_SSTRG_CNTSEN_Msk (0x1ul << BPWM_SSTRG_CNTSEN_Pos) /*!< BPWM_T::SSTRG: CNTSEN Mask */ - -#define BPWM_STATUS_CNTMAX0_Pos (0) /*!< BPWM_T::STATUS: CNTMAX0 Position */ -#define BPWM_STATUS_CNTMAX0_Msk (0x1ul << BPWM_STATUS_CNTMAX0_Pos) /*!< BPWM_T::STATUS: CNTMAX0 Mask */ - -#define BPWM_STATUS_EADCTRG0_Pos (16) /*!< BPWM_T::STATUS: EADCTRG0 Position */ -#define BPWM_STATUS_EADCTRG0_Msk (0x1ul << BPWM_STATUS_EADCTRG0_Pos) /*!< BPWM_T::STATUS: EADCTRG0 Mask */ - -#define BPWM_STATUS_EADCTRG1_Pos (17) /*!< BPWM_T::STATUS: EADCTRG1 Position */ -#define BPWM_STATUS_EADCTRG1_Msk (0x1ul << BPWM_STATUS_EADCTRG1_Pos) /*!< BPWM_T::STATUS: EADCTRG1 Mask */ - -#define BPWM_STATUS_EADCTRG2_Pos (18) /*!< BPWM_T::STATUS: EADCTRG2 Position */ -#define BPWM_STATUS_EADCTRG2_Msk (0x1ul << BPWM_STATUS_EADCTRG2_Pos) /*!< BPWM_T::STATUS: EADCTRG2 Mask */ - -#define BPWM_STATUS_EADCTRG3_Pos (19) /*!< BPWM_T::STATUS: EADCTRG3 Position */ -#define BPWM_STATUS_EADCTRG3_Msk (0x1ul << BPWM_STATUS_EADCTRG3_Pos) /*!< BPWM_T::STATUS: EADCTRG3 Mask */ - -#define BPWM_STATUS_EADCTRG4_Pos (20) /*!< BPWM_T::STATUS: EADCTRG4 Position */ -#define BPWM_STATUS_EADCTRG4_Msk (0x1ul << BPWM_STATUS_EADCTRG4_Pos) /*!< BPWM_T::STATUS: EADCTRG4 Mask */ - -#define BPWM_STATUS_EADCTRG5_Pos (21) /*!< BPWM_T::STATUS: EADCTRG5 Position */ -#define BPWM_STATUS_EADCTRG5_Msk (0x1ul << BPWM_STATUS_EADCTRG5_Pos) /*!< BPWM_T::STATUS: EADCTRG5 Mask */ - -#define BPWM_STATUS_EADCTRGn_Pos (16) /*!< BPWM_T::STATUS: EADCTRGn Position */ -#define BPWM_STATUS_EADCTRGn_Msk (0x3ful << BPWM_STATUS_EADCTRGn_Pos) /*!< BPWM_T::STATUS: EADCTRGn Mask */ - -#define BPWM_CAPINEN_CAPINEN0_Pos (0) /*!< BPWM_T::CAPINEN: CAPINEN0 Position */ -#define BPWM_CAPINEN_CAPINEN0_Msk (0x1ul << BPWM_CAPINEN_CAPINEN0_Pos) /*!< BPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define BPWM_CAPINEN_CAPINEN1_Pos (1) /*!< BPWM_T::CAPINEN: CAPINEN1 Position */ -#define BPWM_CAPINEN_CAPINEN1_Msk (0x1ul << BPWM_CAPINEN_CAPINEN1_Pos) /*!< BPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define BPWM_CAPINEN_CAPINEN2_Pos (2) /*!< BPWM_T::CAPINEN: CAPINEN2 Position */ -#define BPWM_CAPINEN_CAPINEN2_Msk (0x1ul << BPWM_CAPINEN_CAPINEN2_Pos) /*!< BPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define BPWM_CAPINEN_CAPINEN3_Pos (3) /*!< BPWM_T::CAPINEN: CAPINEN3 Position */ -#define BPWM_CAPINEN_CAPINEN3_Msk (0x1ul << BPWM_CAPINEN_CAPINEN3_Pos) /*!< BPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define BPWM_CAPINEN_CAPINEN4_Pos (4) /*!< BPWM_T::CAPINEN: CAPINEN4 Position */ -#define BPWM_CAPINEN_CAPINEN4_Msk (0x1ul << BPWM_CAPINEN_CAPINEN4_Pos) /*!< BPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define BPWM_CAPINEN_CAPINEN5_Pos (5) /*!< BPWM_T::CAPINEN: CAPINEN5 Position */ -#define BPWM_CAPINEN_CAPINEN5_Msk (0x1ul << BPWM_CAPINEN_CAPINEN5_Pos) /*!< BPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define BPWM_CAPINEN_CAPINENn_Pos (0) /*!< BPWM_T::CAPINEN: CAPINENn Position */ -#define BPWM_CAPINEN_CAPINENn_Msk (0x3ful << BPWM_CAPINEN_CAPINENn_Pos) /*!< BPWM_T::CAPINEN: CAPINENn Mask */ - -#define BPWM_CAPCTL_CAPEN0_Pos (0) /*!< BPWM_T::CAPCTL: CAPEN0 Position */ -#define BPWM_CAPCTL_CAPEN0_Msk (0x1ul << BPWM_CAPCTL_CAPEN0_Pos) /*!< BPWM_T::CAPCTL: CAPEN0 Mask */ - -#define BPWM_CAPCTL_CAPEN1_Pos (1) /*!< BPWM_T::CAPCTL: CAPEN1 Position */ -#define BPWM_CAPCTL_CAPEN1_Msk (0x1ul << BPWM_CAPCTL_CAPEN1_Pos) /*!< BPWM_T::CAPCTL: CAPEN1 Mask */ - -#define BPWM_CAPCTL_CAPEN2_Pos (2) /*!< BPWM_T::CAPCTL: CAPEN2 Position */ -#define BPWM_CAPCTL_CAPEN2_Msk (0x1ul << BPWM_CAPCTL_CAPEN2_Pos) /*!< BPWM_T::CAPCTL: CAPEN2 Mask */ - -#define BPWM_CAPCTL_CAPEN3_Pos (3) /*!< BPWM_T::CAPCTL: CAPEN3 Position */ -#define BPWM_CAPCTL_CAPEN3_Msk (0x1ul << BPWM_CAPCTL_CAPEN3_Pos) /*!< BPWM_T::CAPCTL: CAPEN3 Mask */ - -#define BPWM_CAPCTL_CAPEN4_Pos (4) /*!< BPWM_T::CAPCTL: CAPEN4 Position */ -#define BPWM_CAPCTL_CAPEN4_Msk (0x1ul << BPWM_CAPCTL_CAPEN4_Pos) /*!< BPWM_T::CAPCTL: CAPEN4 Mask */ - -#define BPWM_CAPCTL_CAPEN5_Pos (5) /*!< BPWM_T::CAPCTL: CAPEN5 Position */ -#define BPWM_CAPCTL_CAPEN5_Msk (0x1ul << BPWM_CAPCTL_CAPEN5_Pos) /*!< BPWM_T::CAPCTL: CAPEN5 Mask */ - -#define BPWM_CAPCTL_CAPENn_Pos (0) /*!< BPWM_T::CAPCTL: CAPENn Position */ -#define BPWM_CAPCTL_CAPENn_Msk (0x3ful << BPWM_CAPCTL_CAPENn_Pos) /*!< BPWM_T::CAPCTL: CAPENn Mask */ - -#define BPWM_CAPCTL_CAPINV0_Pos (8) /*!< BPWM_T::CAPCTL: CAPINV0 Position */ -#define BPWM_CAPCTL_CAPINV0_Msk (0x1ul << BPWM_CAPCTL_CAPINV0_Pos) /*!< BPWM_T::CAPCTL: CAPINV0 Mask */ - -#define BPWM_CAPCTL_CAPINV1_Pos (9) /*!< BPWM_T::CAPCTL: CAPINV1 Position */ -#define BPWM_CAPCTL_CAPINV1_Msk (0x1ul << BPWM_CAPCTL_CAPINV1_Pos) /*!< BPWM_T::CAPCTL: CAPINV1 Mask */ - -#define BPWM_CAPCTL_CAPINV2_Pos (10) /*!< BPWM_T::CAPCTL: CAPINV2 Position */ -#define BPWM_CAPCTL_CAPINV2_Msk (0x1ul << BPWM_CAPCTL_CAPINV2_Pos) /*!< BPWM_T::CAPCTL: CAPINV2 Mask */ - -#define BPWM_CAPCTL_CAPINV3_Pos (11) /*!< BPWM_T::CAPCTL: CAPINV3 Position */ -#define BPWM_CAPCTL_CAPINV3_Msk (0x1ul << BPWM_CAPCTL_CAPINV3_Pos) /*!< BPWM_T::CAPCTL: CAPINV3 Mask */ - -#define BPWM_CAPCTL_CAPINV4_Pos (12) /*!< BPWM_T::CAPCTL: CAPINV4 Position */ -#define BPWM_CAPCTL_CAPINV4_Msk (0x1ul << BPWM_CAPCTL_CAPINV4_Pos) /*!< BPWM_T::CAPCTL: CAPINV4 Mask */ - -#define BPWM_CAPCTL_CAPINV5_Pos (13) /*!< BPWM_T::CAPCTL: CAPINV5 Position */ -#define BPWM_CAPCTL_CAPINV5_Msk (0x1ul << BPWM_CAPCTL_CAPINV5_Pos) /*!< BPWM_T::CAPCTL: CAPINV5 Mask */ - -#define BPWM_CAPCTL_CAPINVn_Pos (8) /*!< BPWM_T::CAPCTL: CAPINVn Position */ -#define BPWM_CAPCTL_CAPINVn_Msk (0x3ful << BPWM_CAPCTL_CAPINVn_Pos) /*!< BPWM_T::CAPCTL: CAPINVn Mask */ - -#define BPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< BPWM_T::CAPCTL: RCRLDEN0 Position */ -#define BPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define BPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< BPWM_T::CAPCTL: RCRLDEN1 Position */ -#define BPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define BPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< BPWM_T::CAPCTL: RCRLDEN2 Position */ -#define BPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define BPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< BPWM_T::CAPCTL: RCRLDEN3 Position */ -#define BPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define BPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< BPWM_T::CAPCTL: RCRLDEN4 Position */ -#define BPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define BPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< BPWM_T::CAPCTL: RCRLDEN5 Position */ -#define BPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define BPWM_CAPCTL_RCRLDENn_Pos (16) /*!< BPWM_T::CAPCTL: RCRLDENn Position */ -#define BPWM_CAPCTL_RCRLDENn_Msk (0x3ful << BPWM_CAPCTL_RCRLDENn_Pos) /*!< BPWM_T::CAPCTL: RCRLDENn Mask */ - -#define BPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< BPWM_T::CAPCTL: FCRLDEN0 Position */ -#define BPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define BPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< BPWM_T::CAPCTL: FCRLDEN1 Position */ -#define BPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define BPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< BPWM_T::CAPCTL: FCRLDEN2 Position */ -#define BPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define BPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< BPWM_T::CAPCTL: FCRLDEN3 Position */ -#define BPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define BPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< BPWM_T::CAPCTL: FCRLDEN4 Position */ -#define BPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define BPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< BPWM_T::CAPCTL: FCRLDEN5 Position */ -#define BPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define BPWM_CAPCTL_FCRLDENn_Pos (24) /*!< BPWM_T::CAPCTL: FCRLDENn Position */ -#define BPWM_CAPCTL_FCRLDENn_Msk (0x3ful << BPWM_CAPCTL_FCRLDENn_Pos) /*!< BPWM_T::CAPCTL: FCRLDENn Mask */ - -#define BPWM_CAPSTS_CRIFOV0_Pos (0) /*!< BPWM_T::CAPSTS: CRIFOV0 Position */ -#define BPWM_CAPSTS_CRIFOV0_Msk (0x1ul << BPWM_CAPSTS_CRIFOV0_Pos) /*!< BPWM_T::CAPSTS: CRIFOV0 Mask */ - -#define BPWM_CAPSTS_CRIFOV1_Pos (1) /*!< BPWM_T::CAPSTS: CRIFOV1 Position */ -#define BPWM_CAPSTS_CRIFOV1_Msk (0x1ul << BPWM_CAPSTS_CRIFOV1_Pos) /*!< BPWM_T::CAPSTS: CRIFOV1 Mask */ - -#define BPWM_CAPSTS_CRIFOV2_Pos (2) /*!< BPWM_T::CAPSTS: CRIFOV2 Position */ -#define BPWM_CAPSTS_CRIFOV2_Msk (0x1ul << BPWM_CAPSTS_CRIFOV2_Pos) /*!< BPWM_T::CAPSTS: CRIFOV2 Mask */ - -#define BPWM_CAPSTS_CRIFOV3_Pos (3) /*!< BPWM_T::CAPSTS: CRIFOV3 Position */ -#define BPWM_CAPSTS_CRIFOV3_Msk (0x1ul << BPWM_CAPSTS_CRIFOV3_Pos) /*!< BPWM_T::CAPSTS: CRIFOV3 Mask */ - -#define BPWM_CAPSTS_CRIFOV4_Pos (4) /*!< BPWM_T::CAPSTS: CRIFOV4 Position */ -#define BPWM_CAPSTS_CRIFOV4_Msk (0x1ul << BPWM_CAPSTS_CRIFOV4_Pos) /*!< BPWM_T::CAPSTS: CRIFOV4 Mask */ - -#define BPWM_CAPSTS_CRIFOV5_Pos (5) /*!< BPWM_T::CAPSTS: CRIFOV5 Position */ -#define BPWM_CAPSTS_CRIFOV5_Msk (0x1ul << BPWM_CAPSTS_CRIFOV5_Pos) /*!< BPWM_T::CAPSTS: CRIFOV5 Mask */ - -#define BPWM_CAPSTS_CRIFOVn_Pos (0) /*!< BPWM_T::CAPSTS: CRIFOVn Position */ -#define BPWM_CAPSTS_CRIFOVn_Msk (0x3ful << BPWM_CAPSTS_CRIFOVn_Pos) /*!< BPWM_T::CAPSTS: CRIFOVn Mask */ - -#define BPWM_CAPSTS_CFIFOV0_Pos (8) /*!< BPWM_T::CAPSTS: CFIFOV0 Position */ -#define BPWM_CAPSTS_CFIFOV0_Msk (0x1ul << BPWM_CAPSTS_CFIFOV0_Pos) /*!< BPWM_T::CAPSTS: CFIFOV0 Mask */ - -#define BPWM_CAPSTS_CFIFOV1_Pos (9) /*!< BPWM_T::CAPSTS: CFIFOV1 Position */ -#define BPWM_CAPSTS_CFIFOV1_Msk (0x1ul << BPWM_CAPSTS_CFIFOV1_Pos) /*!< BPWM_T::CAPSTS: CFIFOV1 Mask */ - -#define BPWM_CAPSTS_CFIFOV2_Pos (10) /*!< BPWM_T::CAPSTS: CFIFOV2 Position */ -#define BPWM_CAPSTS_CFIFOV2_Msk (0x1ul << BPWM_CAPSTS_CFIFOV2_Pos) /*!< BPWM_T::CAPSTS: CFIFOV2 Mask */ - -#define BPWM_CAPSTS_CFIFOV3_Pos (11) /*!< BPWM_T::CAPSTS: CFIFOV3 Position */ -#define BPWM_CAPSTS_CFIFOV3_Msk (0x1ul << BPWM_CAPSTS_CFIFOV3_Pos) /*!< BPWM_T::CAPSTS: CFIFOV3 Mask */ - -#define BPWM_CAPSTS_CFIFOV4_Pos (12) /*!< BPWM_T::CAPSTS: CFIFOV4 Position */ -#define BPWM_CAPSTS_CFIFOV4_Msk (0x1ul << BPWM_CAPSTS_CFIFOV4_Pos) /*!< BPWM_T::CAPSTS: CFIFOV4 Mask */ - -#define BPWM_CAPSTS_CFIFOV5_Pos (13) /*!< BPWM_T::CAPSTS: CFIFOV5 Position */ -#define BPWM_CAPSTS_CFIFOV5_Msk (0x1ul << BPWM_CAPSTS_CFIFOV5_Pos) /*!< BPWM_T::CAPSTS: CFIFOV5 Mask */ - -#define BPWM_CAPSTS_CFIFOVn_Pos (8) /*!< BPWM_T::CAPSTS: CFIFOVn Position */ -#define BPWM_CAPSTS_CFIFOVn_Msk (0x3ful << BPWM_CAPSTS_CFIFOVn_Pos) /*!< BPWM_T::CAPSTS: CFIFOVn Mask */ - -#define BPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT0: RCAPDAT Position */ -#define BPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT0_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define BPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT0: FCAPDAT Position */ -#define BPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT0_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define BPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT1: RCAPDAT Position */ -#define BPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT1_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define BPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT1: FCAPDAT Position */ -#define BPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT1_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define BPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT2: RCAPDAT Position */ -#define BPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT2_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define BPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT2: FCAPDAT Position */ -#define BPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT2_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define BPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT3: RCAPDAT Position */ -#define BPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT3_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define BPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT3: FCAPDAT Position */ -#define BPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT3_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define BPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT4: RCAPDAT Position */ -#define BPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT4_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define BPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT4: FCAPDAT Position */ -#define BPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT4_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define BPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT5: RCAPDAT Position */ -#define BPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT5_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define BPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT5: FCAPDAT Position */ -#define BPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT5_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define BPWM_CAPIEN_CAPRIENn_Pos (0) /*!< BPWM_T::CAPIEN: CAPRIENn Position */ -#define BPWM_CAPIEN_CAPRIENn_Msk (0x3ful << BPWM_CAPIEN_CAPRIENn_Pos) /*!< BPWM_T::CAPIEN: CAPRIENn Mask */ - -#define BPWM_CAPIEN_CAPFIENn_Pos (8) /*!< BPWM_T::CAPIEN: CAPFIENn Position */ -#define BPWM_CAPIEN_CAPFIENn_Msk (0x3ful << BPWM_CAPIEN_CAPFIENn_Pos) /*!< BPWM_T::CAPIEN: CAPFIENn Mask */ - -#define BPWM_CAPIF_CAPRIF0_Pos (0) /*!< BPWM_T::CAPIF: CAPRIF0 Position */ -#define BPWM_CAPIF_CAPRIF0_Msk (0x1ul << BPWM_CAPIF_CAPRIF0_Pos) /*!< BPWM_T::CAPIF: CAPRIF0 Mask */ - -#define BPWM_CAPIF_CAPRIF1_Pos (1) /*!< BPWM_T::CAPIF: CAPRIF1 Position */ -#define BPWM_CAPIF_CAPRIF1_Msk (0x1ul << BPWM_CAPIF_CAPRIF1_Pos) /*!< BPWM_T::CAPIF: CAPRIF1 Mask */ - -#define BPWM_CAPIF_CAPRIF2_Pos (2) /*!< BPWM_T::CAPIF: CAPRIF2 Position */ -#define BPWM_CAPIF_CAPRIF2_Msk (0x1ul << BPWM_CAPIF_CAPRIF2_Pos) /*!< BPWM_T::CAPIF: CAPRIF2 Mask */ - -#define BPWM_CAPIF_CAPRIF3_Pos (3) /*!< BPWM_T::CAPIF: CAPRIF3 Position */ -#define BPWM_CAPIF_CAPRIF3_Msk (0x1ul << BPWM_CAPIF_CAPRIF3_Pos) /*!< BPWM_T::CAPIF: CAPRIF3 Mask */ - -#define BPWM_CAPIF_CAPRIF4_Pos (4) /*!< BPWM_T::CAPIF: CAPRIF4 Position */ -#define BPWM_CAPIF_CAPRIF4_Msk (0x1ul << BPWM_CAPIF_CAPRIF4_Pos) /*!< BPWM_T::CAPIF: CAPRIF4 Mask */ - -#define BPWM_CAPIF_CAPRIF5_Pos (5) /*!< BPWM_T::CAPIF: CAPRIF5 Position */ -#define BPWM_CAPIF_CAPRIF5_Msk (0x1ul << BPWM_CAPIF_CAPRIF5_Pos) /*!< BPWM_T::CAPIF: CAPRIF5 Mask */ - -#define BPWM_CAPIF_CAPRIFn_Pos (0) /*!< BPWM_T::CAPIF: CAPRIFn Position */ -#define BPWM_CAPIF_CAPRIFn_Msk (0x3ful << BPWM_CAPIF_CAPRIFn_Pos) /*!< BPWM_T::CAPIF: CAPRIFn Mask */ - -#define BPWM_CAPIF_CAPFIF0_Pos (8) /*!< BPWM_T::CAPIF: CAPFIF0 Position */ -#define BPWM_CAPIF_CAPFIF0_Msk (0x1ul << BPWM_CAPIF_CAPFIF0_Pos) /*!< BPWM_T::CAPIF: CAPFIF0 Mask */ - -#define BPWM_CAPIF_CAPFIF1_Pos (9) /*!< BPWM_T::CAPIF: CAPFIF1 Position */ -#define BPWM_CAPIF_CAPFIF1_Msk (0x1ul << BPWM_CAPIF_CAPFIF1_Pos) /*!< BPWM_T::CAPIF: CAPFIF1 Mask */ - -#define BPWM_CAPIF_CAPFIF2_Pos (10) /*!< BPWM_T::CAPIF: CAPFIF2 Position */ -#define BPWM_CAPIF_CAPFIF2_Msk (0x1ul << BPWM_CAPIF_CAPFIF2_Pos) /*!< BPWM_T::CAPIF: CAPFIF2 Mask */ - -#define BPWM_CAPIF_CAPFIF3_Pos (11) /*!< BPWM_T::CAPIF: CAPFIF3 Position */ -#define BPWM_CAPIF_CAPFIF3_Msk (0x1ul << BPWM_CAPIF_CAPFIF3_Pos) /*!< BPWM_T::CAPIF: CAPFIF3 Mask */ - -#define BPWM_CAPIF_CAPFIF4_Pos (12) /*!< BPWM_T::CAPIF: CAPFIF4 Position */ -#define BPWM_CAPIF_CAPFIF4_Msk (0x1ul << BPWM_CAPIF_CAPFIF4_Pos) /*!< BPWM_T::CAPIF: CAPFIF4 Mask */ - -#define BPWM_CAPIF_CAPFIF5_Pos (13) /*!< BPWM_T::CAPIF: CAPFIF5 Position */ -#define BPWM_CAPIF_CAPFIF5_Msk (0x1ul << BPWM_CAPIF_CAPFIF5_Pos) /*!< BPWM_T::CAPIF: CAPFIF5 Mask */ - -#define BPWM_CAPIF_CAPFIFn_Pos (8) /*!< BPWM_T::CAPIF: CAPFIFn Position */ -#define BPWM_CAPIF_CAPFIFn_Msk (0x3ful << BPWM_CAPIF_CAPFIFn_Pos) /*!< BPWM_T::CAPIF: CAPFIFn Mask */ - -#define BPWM_PBUF_PBUF_Pos (0) /*!< BPWM_T::PBUF: PBUF Position */ -#define BPWM_PBUF_PBUF_Msk (0xfffful << BPWM_PBUF_PBUF_Pos) /*!< BPWM_T::PBUF: PBUF Mask */ - -#define BPWM_CMPBUF0_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF0: CMPBUF Position */ -#define BPWM_CMPBUF0_CMPBUF_Msk (0xfffful << BPWM_CMPBUF0_CMPBUF_Pos) /*!< BPWM_T::CMPBUF0: CMPBUF Mask */ - -#define BPWM_CMPBUF1_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF1: CMPBUF Position */ -#define BPWM_CMPBUF1_CMPBUF_Msk (0xfffful << BPWM_CMPBUF1_CMPBUF_Pos) /*!< BPWM_T::CMPBUF1: CMPBUF Mask */ - -#define BPWM_CMPBUF2_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF2: CMPBUF Position */ -#define BPWM_CMPBUF2_CMPBUF_Msk (0xfffful << BPWM_CMPBUF2_CMPBUF_Pos) /*!< BPWM_T::CMPBUF2: CMPBUF Mask */ - -#define BPWM_CMPBUF3_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF3: CMPBUF Position */ -#define BPWM_CMPBUF3_CMPBUF_Msk (0xfffful << BPWM_CMPBUF3_CMPBUF_Pos) /*!< BPWM_T::CMPBUF3: CMPBUF Mask */ - -#define BPWM_CMPBUF4_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF4: CMPBUF Position */ -#define BPWM_CMPBUF4_CMPBUF_Msk (0xfffful << BPWM_CMPBUF4_CMPBUF_Pos) /*!< BPWM_T::CMPBUF4: CMPBUF Mask */ - -#define BPWM_CMPBUF5_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF5: CMPBUF Position */ -#define BPWM_CMPBUF5_CMPBUF_Msk (0xfffful << BPWM_CMPBUF5_CMPBUF_Pos) /*!< BPWM_T::CMPBUF5: CMPBUF Mask */ - -/**@}*/ /* BPWM_CONST */ -/**@}*/ /* end of BPWM register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __BPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/can_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/can_reg.h deleted file mode 100644 index 76f5d2816ce..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/can_reg.h +++ /dev/null @@ -1,790 +0,0 @@ -/**************************************************************************//** - * @file can_reg.h - * @version V1.00 - * @brief CAN register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CAN_REG_H__ -#define __CAN_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Controller Area Network Controller -------------------------*/ -/** - @addtogroup CAN Controller Area Network Controller(CAN) - Memory Mapped Structure for CAN Controller - @{ -*/ - - -typedef struct -{ - - - - /** - * @var CAN_IF_T::CREQ - * Offset: 0x20, 0x80 IFn (Register Map Note 2) Command Request Registers - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |MessageNumber|Message Number - * | | |0x01-0x20: Valid Message Number, the Message Object in the Message - * | | |RAM is selected for data transfer. - * | | |0x00: Not a valid Message Number, interpreted as 0x20. - * | | |0x21-0x3F: Not a valid Message Number, interpreted as 0x01-0x1F. - * |[15] |Busy |Busy Flag - * | | |0 = Read/write action has finished. - * | | |1 = Writing to the IFn Command Request Register is in progress. - * | | |This bit can only be read by the software. - * @var CAN_IF_T::CMASK - * Offset: 0x24, 0x84 IFn Command Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DAT_B |Access Data Bytes [7:4] - * | | |Write Operation: - * | | |0 = Data Bytes [7:4] unchanged. - * | | |1 = Transfer Data Bytes [7:4] to Message Object. - * | | |Read Operation: - * | | |0 = Data Bytes [7:4] unchanged. - * | | |1 = Transfer Data Bytes [7:4] to IFn Message Buffer Register. - * |[1] |DAT_A |Access Data Bytes [3:0] - * | | |Write Operation: - * | | |0 = Data Bytes [3:0] unchanged. - * | | |1 = Transfer Data Bytes [3:0] to Message Object. - * | | |Read Operation: - * | | |0 = Data Bytes [3:0] unchanged. - * | | |1 = Transfer Data Bytes [3:0] to IFn Message Buffer Register. - * |[2] |TxRqst_NewDat|Access Transmission Request Bit When Write Operation - * | | |0 = TxRqst bit unchanged. - * | | |1 = Set TxRqst bit. - * | | |Note: If a transmission is requested by programming bit TxRqst/NewDat in the IFn Command Mask Register, bit TxRqst in the IFn Message Control Register will be ignored. - * | | |Access New Data Bit when Read Operation. - * | | |0 = NewDat bit remains unchanged. - * | | |1 = Clear NewDat bit in the Message Object. - * | | |Note: A read access to a Message Object can be combined with the reset of the control bits IntPnd and NewDat. - * | | |The values of these bits transferred to the IFn Message Control Register always reflect the status before resetting these bits. - * |[3] |ClrIntPnd |Clear Interrupt Pending Bit - * | | |Write Operation: - * | | |When writing to a Message Object, this bit is ignored. - * | | |Read Operation: - * | | |0 = IntPnd bit (CAN_IFn_MCON[13]) remains unchanged. - * | | |1 = Clear IntPnd bit in the Message Object. - * |[4] |Control |Control Access Control Bits - * | | |Write Operation: - * | | |0 = Control Bits unchanged. - * | | |1 = Transfer Control Bits to Message Object. - * | | |Read Operation: - * | | |0 = Control Bits unchanged. - * | | |1 = Transfer Control Bits to IFn Message Buffer Register. - * |[5] |Arb |Access Arbitration Bits - * | | |Write Operation: - * | | |0 = Arbitration bits unchanged. - * | | |1 = Transfer Identifier + Dir (CAN_IFn_ARB2[13]) + Xtd (CAN_IFn_ARB2[14]) + MsgVal (CAN_IFn_APB2[15]) to Message Object. - * | | |Read Operation: - * | | |0 = Arbitration bits unchanged. - * | | |1 = Transfer Identifier + Dir + Xtd + MsgVal to IFn Message Buffer Register. - * |[6] |Mask |Access Mask Bits - * | | |Write Operation: - * | | |0 = Mask bits unchanged. - * | | |1 = Transfer Identifier Mask + MDir + MXtd to Message Object. - * | | |Read Operation: - * | | |0 = Mask bits unchanged. - * | | |1 = Transfer Identifier Mask + MDir + MXtd to IFn Message Buffer Register. - * |[7] |WR_RD |Write / Read Mode - * | | |0 = Read: Transfer data from the Message Object addressed by the Command Request Register into the selected Message Buffer Registers. - * | | |1 = Write: Transfer data from the selected Message Buffer Registers to the Message Object addressed by the Command Request Register. - * @var CAN_IF_T::MASK1 - * Offset: 0x28, 0x88 IFn Mask 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |Msk[15:0] |Identifier Mask 15-0 - * | | |0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering. - * | | |1 = The corresponding identifier bit is used for acceptance filtering. - * @var CAN_IF_T::MASK2 - * Offset: 0x2C, 0x8C IFn Mask 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |Msk[28:16]|Identifier Mask 28-16 - * | | |0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering. - * | | |1 = The corresponding identifier bit is used for acceptance filtering. - * |[14] |MDir |Mask Message Direction - * | | |0 = The message direction bit (Dir (CAN_IFn_ARB2[13])) has no effect on the acceptance filtering. - * | | |1 = The message direction bit (Dir) is used for acceptance filtering. - * |[15] |MXtd |Mask Extended Identifier - * | | |0 = The extended identifier bit (IDE) has no effect on the acceptance filtering. - * | | |1 = The extended identifier bit (IDE) is used for acceptance filtering. - * | | |Note: When 11-bit ("standard") Identifiers are used for a Message Object, the identifiers of received Data Frames are written into bits ID28 to ID18 (CAN_IFn_ARB2[12:2]). - * | | |For acceptance filtering, only these bits together with mask bits Msk28 to Msk18 (CAN_IFn_MASK2[12:2]) are considered. - * @var CAN_IF_T::ARB1 - * Offset: 0x30, 0x90 IFn Arbitration 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ID[15:0] |Message Identifier 15-0 - * | | |ID28 - ID0, 29-bit Identifier ("Extended Frame"). - * | | |ID28 - ID18, 11-bit Identifier ("Standard Frame") - * @var CAN_IF_T::ARB2 - * Offset: 0x34, 0x94 IFn Arbitration 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |ID[28:16] |Message Identifier 28-16 - * | | |ID28 - ID0, 29-bit Identifier ("Extended Frame"). - * | | |ID28 - ID18, 11-bit Identifier ("Standard Frame") - * |[13] |Dir |Message Direction - * | | |0 = Direction is receive. - * | | |On TxRqst, a Remote Frame with the identifier of this Message Object is transmitted. - * | | |On reception of a Data Frame with matching identifier, that message is stored in this Message Object. - * | | |1 = Direction is transmit. - * | | |On TxRqst, the respective Message Object is transmitted as a Data Frame. - * | | |On reception of a Remote Frame with matching identifier, the TxRqst bit (CAN_IFn_CMASK[2]) of this Message Object is set (if RmtEn (CAN_IFn_MCON[9]) = one). - * |[14] |Xtd |Extended Identifier - * | | |0 = The 11-bit ("standard") Identifier will be used for this Message Object. - * | | |1 = The 29-bit ("extended") Identifier will be used for this Message Object. - * |[15] |MsgVal |Message Valid - * | | |0 = The Message Object is ignored by the Message Handler. - * | | |1 = The Message Object is configured and should be considered by the Message Handler. - * | | |Note: The application software must reset the MsgVal bit of all unused Messages Objects during the initialization before it resets bit Init (CAN_CON[0]). - * | | |This bit must also be reset before the identifier Id28-0 (CAN_IFn_ARB1/2), the control bits Xtd (CAN_IFn_ARB2[14]), Dir (CAN_IFn_APB2[13]), or the Data Length Code DLC3-0 (CAN_IFn_MCON[3:0]) are modified, or if the Messages Object is no longer required. - * @var CAN_IF_T::MCON - * Offset: 0x38, 0x98 IFn Message Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DLC |Data Length Code - * | | |0-8: Data Frame has 0-8 data bytes. - * | | |9-15: Data Frame has 8 data bytes - * | | |Note: The Data Length Code of a Message Object must be defined the same as in all the corresponding objects with the same identifier at other nodes. - * | | |When the Message Handler stores a data frame, it will write the DLC to the value given by the received message. - * | | |Data 0: 1st data byte of a CAN Data Frame - * | | |Data 1: 2nd data byte of a CAN Data Frame - * | | |Data 2: 3rd data byte of a CAN Data Frame - * | | |Data 3: 4th data byte of a CAN Data Frame - * | | |Data 4: 5th data byte of a CAN Data Frame - * | | |Data 5: 6th data byte of a CAN Data Frame - * | | |Data 6: 7th data byte of a CAN Data Frame - * | | |Data 7 : 8th data byte of a CAN Data Frame - * | | |Note: The Data 0 Byte is the first data byte shifted into the shift register of the CAN Core during a reception while the Data 7 byte is the last. - * | | |When the Message Handler stores a Data Frame, it will write all the eight data bytes into a Message Object. - * | | |If the Data Length Code is less than 8, the remaining bytes of the Message Object will be overwritten by unspecified values. - * |[7] |EoB |End Of Buffer - * | | |0 = Message Object belongs to a FIFO Buffer and is not the last Message Object of that FIFO Buffer. - * | | |1 = Single Message Object or last Message Object of a FIFO Buffer. - * | | |Note: This bit is used to concatenate two or more Message Objects (up to 32) to build a FIFO Buffer. - * | | |For single Message Objects (not belonging to a FIFO Buffer), this bit must always be set to one. - * |[8] |TxRqst |Transmit Request - * | | |0 = This Message Object is not waiting for transmission. - * | | |1 = The transmission of this Message Object is requested and is not yet done. - * |[9] |RmtEn |Remote Enable Control - * | | |0 = At the reception of a Remote Frame, TxRqst (CAN_IFn_MCON[8]) is left unchanged. - * | | |1 = At the reception of a Remote Frame, TxRqst is set. - * |[10] |RxIE |Receive Interrupt Enable Control - * | | |0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after a successful reception of a frame. - * | | |1 = IntPnd will be set after a successful reception of a frame. - * |[11] |TxIE |Transmit Interrupt Enable Control - * | | |0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after the successful transmission of a frame. - * | | |1 = IntPnd will be set after a successful transmission of a frame. - * |[12] |UMask |Use Acceptance Mask - * | | |0 = Mask ignored. - * | | |1 = Use Mask (Msk28-0, MXtd, and MDir) for acceptance filtering. - * | | |Note: If the UMask bit is set to one, the Message Object's mask bits have to be programmed during initialization of the Message Object before MsgVal bit (CAN_IFn_APB2[15]) is set to one. - * |[13] |IntPnd |Interrupt Pending - * | | |0 = This message object is not the source of an interrupt. - * | | |1 = This message object is the source of an interrupt. - * | | |The Interrupt Identifier in the Interrupt Register will point to this message object if there is no other interrupt source with higher priority. - * |[14] |MsgLst |Message Lost (only valid for Message Objects with direction = receive). - * | | |0 = No message lost since last time this bit was reset by the CPU. - * | | |1 = The Message Handler stored a new message into this object when NewDat was still set, the CPU has lost a message. - * |[15] |NewDat |New Data - * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since last time this flag was cleared by the application software. - * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object. - * @var CAN_IF_T::DAT_A1 - * Offset: 0x3C, 0x9C IFn Data A1 Register (Register Map Note 3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data0 |Data Byte 0 - * | | |1st data byte of a CAN Data Frame - * |[15:8] |Data1 |Data Byte 1 - * | | |2nd data byte of a CAN Data Frame - * @var CAN_IF_T::DAT_A2 - * Offset: 0x40, 0xA0 IFn Data A2 Register (Register Map Note 3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data2 |Data Byte 2 - * | | |3rd data byte of CAN Data Frame - * |[15:8] |Data3 |Data Byte 3 - * | | |4th data byte of CAN Data Frame - * @var CAN_IF_T::DAT_B1 - * Offset: 0x44, 0xA4 IFn Data B1 Register (Register Map Note 3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data4 |Data Byte 4 - * | | |5th data byte of CAN Data Frame - * |[15:8] |Data5 |Data Byte 5 - * | | |6th data byte of CAN Data Frame - * @var CAN_IF_T::DAT_B2 - * Offset: 0x48, 0xA8 IFn Data B2 Register (Register Map Note 3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data6 |Data Byte 6 - * | | |7th data byte of CAN Data Frame. - * |[15:8] |Data7 |Data Byte 7 - * | | |8th data byte of CAN Data Frame. - */ - - __IO uint32_t CREQ; /* Offset: 0x20, 0x80 IFn (Register Map Note 2) Command Request Registers */ - __IO uint32_t CMASK; /* Offset: 0x24, 0x84 IFn Command Mask Register */ - __IO uint32_t MASK1; /* Offset: 0x28, 0x88 IFn Mask 1 Register */ - __IO uint32_t MASK2; /* Offset: 0x2C, 0x8C IFn Mask 2 Register */ - __IO uint32_t ARB1; /* Offset: 0x30, 0x90 IFn Arbitration 1 Register */ - __IO uint32_t ARB2; /* Offset: 0x34, 0x94 IFn Arbitration 2 Register */ - __IO uint32_t MCON; /* Offset: 0x38, 0x98 IFn Message Control Register */ - __IO uint32_t DAT_A1; /* Offset: 0x3C, 0x9C IFn Data A1 Register (Register Map Note 3) */ - __IO uint32_t DAT_A2; /* Offset: 0x40, 0xA0 IFn Data A2 Register (Register Map Note 3) */ - __IO uint32_t DAT_B1; /* Offset: 0x44, 0xA4 IFn Data B1 Register (Register Map Note 3) */ - __IO uint32_t DAT_B2; /* Offset: 0x48, 0xA8 IFn Data B2 Register (Register Map Note 3) */ - __I uint32_t RESERVE0[13]; - -} CAN_IF_T; - - - - -typedef struct -{ - - - - /** - * @var CAN_T::CON - * Offset: 0x00 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |Init |Init Initialization - * | | |0 = Normal Operation. - * | | |1 = Initialization is started. - * |[1] |IE |Module Interrupt Enable Control - * | | |0 = Disabled. - * | | |1 = Enabled. - * |[2] |SIE |Status Change Interrupt Enable Control - * | | |0 = Disabled - No Status Change Interrupt will be generated. - * | | |1 = Enabled - An interrupt will be generated when a message transfer is successfully completed or a CAN bus error is detected. - * |[3] |EIE |Error Interrupt Enable Control - * | | |0 = Disabled - No Error Status Interrupt will be generated. - * | | |1 = Enabled - A change in the bits BOff (CAN_STATUS[7]) or EWarn (CAN_STATUS[6]) in the Status Register will generate an interrupt. - * |[5] |DAR |Automatic Re-Transmission Disable Control - * | | |0 = Automatic Retransmission of disturbed messages enabled. - * | | |1 = Automatic Retransmission disabled. - * |[6] |CCE |Configuration Change Enable Control - * | | |0 = No write access to the Bit Timing Register. - * | | |1 = Write access to the Bit Timing Register (CAN_BTIME) allowed. (while Init bit (CAN_CON[0]) = 1). - * |[7] |Test |Test Mode Enable Control - * | | |0 = Normal Operation. - * | | |1 = Test Mode. - * @var CAN_T::STATUS - * Offset: 0x04 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |LEC |Last Error Code (Type Of The Last Error To Occur On The CAN Bus) - * | | |The LEC field holds a code, which indicates the type of the last error to occur on the CAN bus. - * | | |This field will be cleared to '0' when a message has been transferred (reception or transmission) without error. - * | | |The unused code '7' may be written by the CPU to check for updates. - * | | |The following table describes the error code. - * |[3] |TxOK |Transmitted A Message Successfully - * | | |0 = Since this bit was reset by the CPU, no message has been successfully transmitted. - * | | |This bit is never reset by the CAN Core. - * | | |1 = Since this bit was last reset by the CPU, a message has been successfully (error free and acknowledged by at least one other node) transmitted. - * |[4] |RxOK |Received A Message Successfully - * | | |0 = No message has been successfully received since this bit was last reset by the CPU. - * | | |This bit is never reset by the CAN Core. - * | | |1 = A message has been successfully received since this bit was last reset by the CPU (independent of the result of acceptance filtering). - * |[5] |EPass |Error Passive (Read Only) - * | | |0 = The CAN Core is error active. - * | | |1 = The CAN Core is in the error passive state as defined in the CAN Specification. - * |[6] |EWarn |Error Warning Status (Read Only) - * | | |0 = Both error counters are below the error warning limit of 96. - * | | |1 = At least one of the error counters in the EML has reached the error warning limit of 96. - * |[7] |BOff |Bus-Off Status (Read Only) - * | | |0 = The CAN module is not in bus-off state. - * | | |1 = The CAN module is in bus-off state. - * @var CAN_T::ERR - * Offset: 0x08 Error Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TEC |Transmit Error Counter - * | | |Actual state of the Transmit Error Counter. Values between 0 and 255. - * |[14:8] |REC |Receive Error Counter - * | | |Actual state of the Receive Error Counter. Values between 0 and 127. - * |[15] |RP |Receive Error Passive - * | | |0 = The Receive Error Counter is below the error passive level. - * | | |1 = The Receive Error Counter has reached the error passive level as defined in the CAN Specification. - * @var CAN_T::BTIME - * Offset: 0x0C Bit Timing Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |BRP |Baud Rate Prescaler - * | | |0x01-0x3F: The value by which the oscillator frequency is divided for generating the bit time quanta. - * | | |The bit time is built up from a multiple of this quanta. - * | | |Valid values for the Baud Rate Prescaler are [ 0 ... 63 ]. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[7:6] |SJW |(Re)Synchronization Jump Width - * | | |0x0-0x3: Valid programmed values are [0 ... 3]. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[11:8] |TSeg1 |Time Segment Before The Sample Point Minus Sync_Seg - * | | |0x01-0x0F: valid values for TSeg1 are [1 ... 15]. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed is used. - * |[14:12] |TSeg2 |Time Segment After Sample Point - * | | |0x0-0x7: Valid values for TSeg2 are [0 ... 7]. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * @var CAN_T::IIDR - * Offset: 0x10 Interrupt Identifier Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IntId |Interrupt Identifier (Indicates The Source Of The Interrupt) - * | | |If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt with the highest priority, disregarding their chronological order. - * | | |An interrupt remains pending until the application software has cleared it. - * | | |If IntId is different from 0x0000 and IE (CAN_IFn_MCON[1]) is set, the IRQ interrupt signal to the EIC is active. - * | | |The interrupt remains active until IntId is back to value 0x0000 (the cause of the interrupt is reset) or until IE is reset. - * | | |The Status Interrupt has the highest priority. - * | | |Among the message interrupts, the Message Object' s interrupt priority decreases with increasing message number. - * | | |A message interrupt is cleared by clearing the Message Object's IntPnd bit (CAN_IFn_MCON[13]). - * | | |The Status Interrupt is cleared by reading the Status Register. - * @var CAN_T::TEST - * Offset: 0x14 Test Register (Register Map Note 1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |Res |Reserved - * | | |There are reserved bits. - * | | |These bits are always read as '0' and must always be written with '0'. - * |[2] |Basic |Basic Mode - * | | |0 = Basic Mode disabled. - * | | |1= IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer. - * |[3] |Silent |Silent Mode - * | | |0 = Normal operation. - * | | |1 = The module is in Silent Mode. - * |[4] |LBack |Loop Back Mode Enable Control - * | | |0 = Loop Back Mode is disabled. - * | | |1 = Loop Back Mode is enabled. - * |[6:5] |Tx10 |Tx[1:0]: Control Of CAN_TX Pin - * | | |00 = Reset value, CAN_TX pin is controlled by the CAN Core. - * | | |01 = Sample Point can be monitored at CAN_TX pin. - * | | |10 = CAN_TX pin drives a dominant ('0') value. - * | | |11 = CAN_TX pin drives a recessive ('1') value. - * |[7] |Rx |Monitors The Actual Value Of CAN_RX Pin (Read Only) - * | | |0 = The CAN bus is dominant (CAN_RX = '0'). - * | | |1 = The CAN bus is recessive (CAN_RX = '1'). - * @var CAN_T::BRPE - * Offset: 0x18 Baud Rate Prescaler Extension Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |BRPE |BRPE: Baud Rate Prescaler Extension - * | | |0x00-0x0F: By programming BRPE, the Baud Rate Prescaler can be extended to values up to 1023. - * | | |The actual interpretation by the hardware is that one more than the value programmed by BRPE (MSBs) and BTIME (LSBs) is used. - * @var CAN_T::IF - * Offset: 0x20~0xFC CAN Interface Registers - * --------------------------------------------------------------------------------------------------- - * CAN interface structure. Refer to \ref CAN_IF_T for detail information. - * - * @var CAN_T::TXREQ1 - * Offset: 0x100 Transmission Request Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TxRqst[16:1]|Transmission Request Bits 16-1 (Of All Message Objects) - * | | |0 = This Message Object is not waiting for transmission. - * | | |1 = The transmission of this Message Object is requested and is not yet done. - * | | |These bits are read only. - * @var CAN_T::TXREQ2 - * Offset: 0x104 Transmission Request Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TxRqst[32:17]|Transmission Request Bits 32-17 (Of All Message Objects) - * | | |0 = This Message Object is not waiting for transmission. - * | | |1 = The transmission of this Message Object is requested and is not yet done. - * | | |These bits are read only. - * @var CAN_T::NDAT1 - * Offset: 0x120 New Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |NewData[16:1]|New Data Bits 16-1 (Of All Message Objects) - * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since the last time this flag was cleared by the application software. - * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object. - * @var CAN_T::NDAT2 - * Offset: 0x124 New Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |NewData[32:17]|New Data Bits 32-17 (Of All Message Objects) - * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since the last time this flag was cleared by the application software. - * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object. - * @var CAN_T::IPND1 - * Offset: 0x140 Interrupt Pending Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IntPnd[16:1]|Interrupt Pending Bits 16-1 (Of All Message Objects) - * | | |0 = This message object is not the source of an interrupt. - * | | |1 = This message object is the source of an interrupt. - * @var CAN_T::IPND2 - * Offset: 0x144 Interrupt Pending Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IntPnd[32:17]|Interrupt Pending Bits 32-17(Of All Message Objects) - * | | |0 = This message object is not the source of an interrupt. - * | | |1 = This message object is the source of an interrupt. - * @var CAN_T::MVLD1 - * Offset: 0x160 Message Valid Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MsgVal[16:1]|Message Valid Bits 16-1 (Of All Message Objects) (Read Only) - * | | |0 = This Message Object is ignored by the Message Handler. - * | | |1 = This Message Object is configured and should be considered by the Message Handler. - * | | |Ex. - * | | |CAN_MVLD1[0] means Message object No.1 is valid or not. - * | | |If CAN_MVLD1[0] is set, message object No.1 is configured. - * @var CAN_T::MVLD2 - * Offset: 0x164 Message Valid Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MsgVal[32:17]|Message Valid Bits 32-17 (Of All Message Objects) (Read Only) - * | | |0 = This Message Object is ignored by the Message Handler. - * | | |1 = This Message Object is configured and should be considered by the Message Handler. - * | | |Ex.CAN_MVLD2[15] means Message object No.32 is valid or not. - * | | |If CAN_MVLD2[15] is set, message object No.32 is configured. - * @var CAN_T::WU_EN - * Offset: 0x168 Wake-up Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WAKUP_EN |Wake-Up Enable Control - * | | |0 = The wake-up function Disabled. - * | | |1 = The wake-up function Enabled. - * | | |Note: User can wake-up system when there is a falling edge in the CAN_Rx pin. - * @var CAN_T::WU_STATUS - * Offset: 0x16C Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WAKUP_STS |Wake-Up Status - * | | |0 = No wake-up event occurred. - * | | |1 = Wake-up event occurred. - * | | |Note: This bit can be cleared by writing '0'. - */ - - __IO uint32_t CON; /* Offset: 0x00 Control Register */ - __IO uint32_t STATUS; /* Offset: 0x04 Status Register */ - __I uint32_t ERR; /* Offset: 0x08 Error Counter Register */ - __IO uint32_t BTIME; /* Offset: 0x0C Bit Timing Register */ - __I uint32_t IIDR; /* Offset: 0x10 Interrupt Identifier Register */ - __IO uint32_t TEST; /* Offset: 0x14 Test Register (Register Map Note 1) */ - __IO uint32_t BRPE; /* Offset: 0x18 Baud Rate Prescaler Extension Register */ - __I uint32_t RESERVE0[1]; - __IO CAN_IF_T IF[2]; /* Offset: 0x20~0xFC CAN Interface Registers */ - __I uint32_t RESERVE1[8]; - __I uint32_t TXREQ1; /* Offset: 0x100 Transmission Request Register 1 */ - __I uint32_t TXREQ2; /* Offset: 0x104 Transmission Request Register 2 */ - __I uint32_t RESERVE3[6]; - __I uint32_t NDAT1; /* Offset: 0x120 New Data Register 1 */ - __I uint32_t NDAT2; /* Offset: 0x124 New Data Register 2 */ - __I uint32_t RESERVE4[6]; - __I uint32_t IPND1; /* Offset: 0x140 Interrupt Pending Register 1 */ - __I uint32_t IPND2; /* Offset: 0x144 Interrupt Pending Register 2 */ - __I uint32_t RESERVE5[6]; - __I uint32_t MVLD1; /* Offset: 0x160 Message Valid Register 1 */ - __I uint32_t MVLD2; /* Offset: 0x164 Message Valid Register 2 */ - __IO uint32_t WU_EN; /* Offset: 0x168 Wake-up Enable Register */ - __IO uint32_t WU_STATUS; /* Offset: 0x16C Wake-up Status Register */ - -} CAN_T; - - - -/** - @addtogroup CAN_CONST CAN Bit Field Definition - Constant Definitions for CAN Controller - @{ -*/ -/* CAN CON Bit Field Definitions */ -#define CAN_CON_TEST_Pos 7 /*!< CAN_T::CON: TEST Position */ -#define CAN_CON_TEST_Msk (0x1ul << CAN_CON_TEST_Pos) /*!< CAN_T::CON: TEST Mask */ - -#define CAN_CON_CCE_Pos 6 /*!< CAN_T::CON: CCE Position */ -#define CAN_CON_CCE_Msk (0x1ul << CAN_CON_CCE_Pos) /*!< CAN_T::CON: CCE Mask */ - -#define CAN_CON_DAR_Pos 5 /*!< CAN_T::CON: DAR Position */ -#define CAN_CON_DAR_Msk (0x1ul << CAN_CON_DAR_Pos) /*!< CAN_T::CON: DAR Mask */ - -#define CAN_CON_EIE_Pos 3 /*!< CAN_T::CON: EIE Position */ -#define CAN_CON_EIE_Msk (0x1ul << CAN_CON_EIE_Pos) /*!< CAN_T::CON: EIE Mask */ - -#define CAN_CON_SIE_Pos 2 /*!< CAN_T::CON: SIE Position */ -#define CAN_CON_SIE_Msk (0x1ul << CAN_CON_SIE_Pos) /*!< CAN_T::CON: SIE Mask */ - -#define CAN_CON_IE_Pos 1 /*!< CAN_T::CON: IE Position */ -#define CAN_CON_IE_Msk (0x1ul << CAN_CON_IE_Pos) /*!< CAN_T::CON: IE Mask */ - -#define CAN_CON_INIT_Pos 0 /*!< CAN_T::CON: INIT Position */ -#define CAN_CON_INIT_Msk (0x1ul << CAN_CON_INIT_Pos) /*!< CAN_T::CON: INIT Mask */ - -/* CAN STATUS Bit Field Definitions */ -#define CAN_STATUS_BOFF_Pos 7 /*!< CAN_T::STATUS: BOFF Position */ -#define CAN_STATUS_BOFF_Msk (0x1ul << CAN_STATUS_BOFF_Pos) /*!< CAN_T::STATUS: BOFF Mask */ - -#define CAN_STATUS_EWARN_Pos 6 /*!< CAN_T::STATUS: EWARN Position */ -#define CAN_STATUS_EWARN_Msk (0x1ul << CAN_STATUS_EWARN_Pos) /*!< CAN_T::STATUS: EWARN Mask */ - -#define CAN_STATUS_EPASS_Pos 5 /*!< CAN_T::STATUS: EPASS Position */ -#define CAN_STATUS_EPASS_Msk (0x1ul << CAN_STATUS_EPASS_Pos) /*!< CAN_T::STATUS: EPASS Mask */ - -#define CAN_STATUS_RXOK_Pos 4 /*!< CAN_T::STATUS: RXOK Position */ -#define CAN_STATUS_RXOK_Msk (0x1ul << CAN_STATUS_RXOK_Pos) /*!< CAN_T::STATUS: RXOK Mask */ - -#define CAN_STATUS_TXOK_Pos 3 /*!< CAN_T::STATUS: TXOK Position */ -#define CAN_STATUS_TXOK_Msk (0x1ul << CAN_STATUS_TXOK_Pos) /*!< CAN_T::STATUS: TXOK Mask */ - -#define CAN_STATUS_LEC_Pos 0 /*!< CAN_T::STATUS: LEC Position */ -#define CAN_STATUS_LEC_Msk (0x7ul << CAN_STATUS_LEC_Pos) /*!< CAN_T::STATUS: LEC Mask */ - -/* CAN ERR Bit Field Definitions */ -#define CAN_ERR_RP_Pos 15 /*!< CAN_T::ERR: RP Position */ -#define CAN_ERR_RP_Msk (0x1ul << CAN_ERR_RP_Pos) /*!< CAN_T::ERR: RP Mask */ - -#define CAN_ERR_REC_Pos 8 /*!< CAN_T::ERR: REC Position */ -#define CAN_ERR_REC_Msk (0x7Ful << CAN_ERR_REC_Pos) /*!< CAN_T::ERR: REC Mask */ - -#define CAN_ERR_TEC_Pos 0 /*!< CAN_T::ERR: TEC Position */ -#define CAN_ERR_TEC_Msk (0xFFul << CAN_ERR_TEC_Pos) /*!< CAN_T::ERR: TEC Mask */ - -/* CAN BTIME Bit Field Definitions */ -#define CAN_BTIME_TSEG2_Pos 12 /*!< CAN_T::BTIME: TSEG2 Position */ -#define CAN_BTIME_TSEG2_Msk (0x7ul << CAN_BTIME_TSEG2_Pos) /*!< CAN_T::BTIME: TSEG2 Mask */ - -#define CAN_BTIME_TSEG1_Pos 8 /*!< CAN_T::BTIME: TSEG1 Position */ -#define CAN_BTIME_TSEG1_Msk (0xFul << CAN_BTIME_TSEG1_Pos) /*!< CAN_T::BTIME: TSEG1 Mask */ - -#define CAN_BTIME_SJW_Pos 6 /*!< CAN_T::BTIME: SJW Position */ -#define CAN_BTIME_SJW_Msk (0x3ul << CAN_BTIME_SJW_Pos) /*!< CAN_T::BTIME: SJW Mask */ - -#define CAN_BTIME_BRP_Pos 0 /*!< CAN_T::BTIME: BRP Position */ -#define CAN_BTIME_BRP_Msk (0x3Ful << CAN_BTIME_BRP_Pos) /*!< CAN_T::BTIME: BRP Mask */ - -/* CAN IIDR Bit Field Definitions */ -#define CAN_IIDR_INTID_Pos 0 /*!< CAN_T::IIDR: INTID Position */ -#define CAN_IIDR_INTID_Msk (0xFFFFul << CAN_IIDR_INTID_Pos) /*!< CAN_T::IIDR: INTID Mask */ - -/* CAN TEST Bit Field Definitions */ -#define CAN_TEST_RX_Pos 7 /*!< CAN_T::TEST: RX Position */ -#define CAN_TEST_RX_Msk (0x1ul << CAN_TEST_RX_Pos) /*!< CAN_T::TEST: RX Mask */ - -#define CAN_TEST_TX_Pos 5 /*!< CAN_T::TEST: TX Position */ -#define CAN_TEST_TX_Msk (0x3ul << CAN_TEST_TX_Pos) /*!< CAN_T::TEST: TX Mask */ - -#define CAN_TEST_LBACK_Pos 4 /*!< CAN_T::TEST: LBACK Position */ -#define CAN_TEST_LBACK_Msk (0x1ul << CAN_TEST_LBACK_Pos) /*!< CAN_T::TEST: LBACK Mask */ - -#define CAN_TEST_SILENT_Pos 3 /*!< CAN_T::TEST: Silent Position */ -#define CAN_TEST_SILENT_Msk (0x1ul << CAN_TEST_SILENT_Pos) /*!< CAN_T::TEST: Silent Mask */ - -#define CAN_TEST_BASIC_Pos 2 /*!< CAN_T::TEST: Basic Position */ -#define CAN_TEST_BASIC_Msk (0x1ul << CAN_TEST_BASIC_Pos) /*!< CAN_T::TEST: Basic Mask */ - -/* CAN BPRE Bit Field Definitions */ -#define CAN_BRPE_BRPE_Pos 0 /*!< CAN_T::BRPE: BRPE Position */ -#define CAN_BRPE_BRPE_Msk (0xFul << CAN_BRPE_BRPE_Pos) /*!< CAN_T::BRPE: BRPE Mask */ - -/* CAN IFn_CREQ Bit Field Definitions */ -#define CAN_IF_CREQ_BUSY_Pos 15 /*!< CAN_IF_T::CREQ: BUSY Position */ -#define CAN_IF_CREQ_BUSY_Msk (0x1ul << CAN_IF_CREQ_BUSY_Pos) /*!< CAN_IF_T::CREQ: BUSY Mask */ - -#define CAN_IF_CREQ_MSGNUM_Pos 0 /*!< CAN_IF_T::CREQ: MSGNUM Position */ -#define CAN_IF_CREQ_MSGNUM_Msk (0x3Ful << CAN_IF_CREQ_MSGNUM_Pos) /*!< CAN_IF_T::CREQ: MSGNUM Mask */ - -/* CAN IFn_CMASK Bit Field Definitions */ -#define CAN_IF_CMASK_WRRD_Pos 7 /*!< CAN_IF_T::CMASK: WRRD Position */ -#define CAN_IF_CMASK_WRRD_Msk (0x1ul << CAN_IF_CMASK_WRRD_Pos) /*!< CAN_IF_T::CMASK: WRRD Mask */ - -#define CAN_IF_CMASK_MASK_Pos 6 /*!< CAN_IF_T::CMASK: MASK Position */ -#define CAN_IF_CMASK_MASK_Msk (0x1ul << CAN_IF_CMASK_MASK_Pos) /*!< CAN_IF_T::CMASK: MASK Mask */ - -#define CAN_IF_CMASK_ARB_Pos 5 /*!< CAN_IF_T::CMASK: ARB Position */ -#define CAN_IF_CMASK_ARB_Msk (0x1ul << CAN_IF_CMASK_ARB_Pos) /*!< CAN_IF_T::CMASK: ARB Mask */ - -#define CAN_IF_CMASK_CONTROL_Pos 4 /*!< CAN_IF_T::CMASK: CONTROL Position */ -#define CAN_IF_CMASK_CONTROL_Msk (0x1ul << CAN_IF_CMASK_CONTROL_Pos) /*!< CAN_IF_T::CMASK: CONTROL Mask */ - -#define CAN_IF_CMASK_CLRINTPND_Pos 3 /*!< CAN_IF_T::CMASK: CLRINTPND Position */ -#define CAN_IF_CMASK_CLRINTPND_Msk (0x1ul << CAN_IF_CMASK_CLRINTPND_Pos) /*!< CAN_IF_T::CMASK: CLRINTPND Mask */ - -#define CAN_IF_CMASK_TXRQSTNEWDAT_Pos 2 /*!< CAN_IF_T::CMASK: TXRQSTNEWDAT Position */ -#define CAN_IF_CMASK_TXRQSTNEWDAT_Msk (0x1ul << CAN_IF_CMASK_TXRQSTNEWDAT_Pos) /*!< CAN_IF_T::CMASK: TXRQSTNEWDAT Mask */ - -#define CAN_IF_CMASK_DATAA_Pos 1 /*!< CAN_IF_T::CMASK: DATAA Position */ -#define CAN_IF_CMASK_DATAA_Msk (0x1ul << CAN_IF_CMASK_DATAA_Pos) /*!< CAN_IF_T::CMASK: DATAA Mask */ - -#define CAN_IF_CMASK_DATAB_Pos 0 /*!< CAN_IF_T::CMASK: DATAB Position */ -#define CAN_IF_CMASK_DATAB_Msk (0x1ul << CAN_IF_CMASK_DATAB_Pos) /*!< CAN_IF_T::CMASK: DATAB Mask */ - -/* CAN IFn_MASK1 Bit Field Definitions */ -#define CAN_IF_MASK1_MSK_Pos 0 /*!< CAN_IF_T::MASK1: MSK Position */ -#define CAN_IF_MASK1_MSK_Msk (0xFFul << CAN_IF_MASK1_MSK_Pos) /*!< CAN_IF_T::MASK1: MSK Mask */ - -/* CAN IFn_MASK2 Bit Field Definitions */ -#define CAN_IF_MASK2_MXTD_Pos 15 /*!< CAN_IF_T::MASK2: MXTD Position */ -#define CAN_IF_MASK2_MXTD_Msk (0x1ul << CAN_IF_MASK2_MXTD_Pos) /*!< CAN_IF_T::MASK2: MXTD Mask */ - -#define CAN_IF_MASK2_MDIR_Pos 14 /*!< CAN_IF_T::MASK2: MDIR Position */ -#define CAN_IF_MASK2_MDIR_Msk (0x1ul << CAN_IF_MASK2_MDIR_Pos) /*!< CAN_IF_T::MASK2: MDIR Mask */ - -#define CAN_IF_MASK2_MSK_Pos 0 /*!< CAN_IF_T::MASK2: MSK Position */ -#define CAN_IF_MASK2_MSK_Msk (0x1FFul << CAN_IF_MASK2_MSK_Pos) /*!< CAN_IF_T::MASK2: MSK Mask */ - -/* CAN IFn_ARB1 Bit Field Definitions */ -#define CAN_IF_ARB1_ID_Pos 0 /*!< CAN_IF_T::ARB1: ID Position */ -#define CAN_IF_ARB1_ID_Msk (0xFFFFul << CAN_IF_ARB1_ID_Pos) /*!< CAN_IF_T::ARB1: ID Mask */ - -/* CAN IFn_ARB2 Bit Field Definitions */ -#define CAN_IF_ARB2_MSGVAL_Pos 15 /*!< CAN_IF_T::ARB2: MSGVAL Position */ -#define CAN_IF_ARB2_MSGVAL_Msk (0x1ul << CAN_IF_ARB2_MSGVAL_Pos) /*!< CAN_IF_T::ARB2: MSGVAL Mask */ - -#define CAN_IF_ARB2_XTD_Pos 14 /*!< CAN_IF_T::ARB2: XTD Position */ -#define CAN_IF_ARB2_XTD_Msk (0x1ul << CAN_IF_ARB2_XTD_Pos) /*!< CAN_IF_T::ARB2: XTD Mask */ - -#define CAN_IF_ARB2_DIR_Pos 13 /*!< CAN_IF_T::ARB2: DIR Position */ -#define CAN_IF_ARB2_DIR_Msk (0x1ul << CAN_IF_ARB2_DIR_Pos) /*!< CAN_IF_T::ARB2: DIR Mask */ - -#define CAN_IF_ARB2_ID_Pos 0 /*!< CAN_IF_T::ARB2: ID Position */ -#define CAN_IF_ARB2_ID_Msk (0x1FFFul << CAN_IF_ARB2_ID_Pos) /*!< CAN_IF_T::ARB2: ID Mask */ - -/* CAN IFn_MCON Bit Field Definitions */ -#define CAN_IF_MCON_NEWDAT_Pos 15 /*!< CAN_IF_T::MCON: NEWDAT Position */ -#define CAN_IF_MCON_NEWDAT_Msk (0x1ul << CAN_IF_MCON_NEWDAT_Pos) /*!< CAN_IF_T::MCON: NEWDAT Mask */ - -#define CAN_IF_MCON_MSGLST_Pos 14 /*!< CAN_IF_T::MCON: MSGLST Position */ -#define CAN_IF_MCON_MSGLST_Msk (0x1ul << CAN_IF_MCON_MSGLST_Pos) /*!< CAN_IF_T::MCON: MSGLST Mask */ - -#define CAN_IF_MCON_INTPND_Pos 13 /*!< CAN_IF_T::MCON: INTPND Position */ -#define CAN_IF_MCON_INTPND_Msk (0x1ul << CAN_IF_MCON_INTPND_Pos) /*!< CAN_IF_T::MCON: INTPND Mask */ - -#define CAN_IF_MCON_UMASK_Pos 12 /*!< CAN_IF_T::MCON: UMASK Position */ -#define CAN_IF_MCON_UMASK_Msk (0x1ul << CAN_IF_MCON_UMASK_Pos) /*!< CAN_IF_T::MCON: UMASK Mask */ - -#define CAN_IF_MCON_TXIE_Pos 11 /*!< CAN_IF_T::MCON: TXIE Position */ -#define CAN_IF_MCON_TXIE_Msk (0x1ul << CAN_IF_MCON_TXIE_Pos) /*!< CAN_IF_T::MCON: TXIE Mask */ - -#define CAN_IF_MCON_RXIE_Pos 10 /*!< CAN_IF_T::MCON: RXIE Position */ -#define CAN_IF_MCON_RXIE_Msk (0x1ul << CAN_IF_MCON_RXIE_Pos) /*!< CAN_IF_T::MCON: RXIE Mask */ - -#define CAN_IF_MCON_RMTEN_Pos 9 /*!< CAN_IF_T::MCON: RMTEN Position */ -#define CAN_IF_MCON_RMTEN_Msk (0x1ul << CAN_IF_MCON_RMTEN_Pos) /*!< CAN_IF_T::MCON: RMTEN Mask */ - -#define CAN_IF_MCON_TXRQST_Pos 8 /*!< CAN_IF_T::MCON: TXRQST Position */ -#define CAN_IF_MCON_TXRQST_Msk (0x1ul << CAN_IF_MCON_TXRQST_Pos) /*!< CAN_IF_T::MCON: TXRQST Mask */ - -#define CAN_IF_MCON_EOB_Pos 7 /*!< CAN_IF_T::MCON: EOB Position */ -#define CAN_IF_MCON_EOB_Msk (0x1ul << CAN_IF_MCON_EOB_Pos) /*!< CAN_IF_T::MCON: EOB Mask */ - -#define CAN_IF_MCON_DLC_Pos 0 /*!< CAN_IF_T::MCON: DLC Position */ -#define CAN_IF_MCON_DLC_Msk (0xFul << CAN_IF_MCON_DLC_Pos) /*!< CAN_IF_T::MCON: DLC Mask */ - -/* CAN IFn_DATA_A1 Bit Field Definitions */ -#define CAN_IF_DAT_A1_DATA1_Pos 8 /*!< CAN_IF_T::DATAA1: DATA1 Position */ -#define CAN_IF_DAT_A1_DATA1_Msk (0xFFul << CAN_IF_DAT_A1_DATA1_Pos) /*!< CAN_IF_T::DATAA1: DATA1 Mask */ - -#define CAN_IF_DAT_A1_DATA0_Pos 0 /*!< CAN_IF_T::DATAA1: DATA0 Position */ -#define CAN_IF_DAT_A1_DATA0_Msk (0xFFul << CAN_IF_DAT_A1_DATA0_Pos) /*!< CAN_IF_T::DATAA1: DATA0 Mask */ - -/* CAN IFn_DATA_A2 Bit Field Definitions */ -#define CAN_IF_DAT_A2_DATA3_Pos 8 /*!< CAN_IF_T::DATAA1: DATA3 Position */ -#define CAN_IF_DAT_A2_DATA3_Msk (0xFFul << CAN_IF_DAT_A2_DATA3_Pos) /*!< CAN_IF_T::DATAA1: DATA3 Mask */ - -#define CAN_IF_DAT_A2_DATA2_Pos 0 /*!< CAN_IF_T::DATAA1: DATA2 Position */ -#define CAN_IF_DAT_A2_DATA2_Msk (0xFFul << CAN_IF_DAT_A2_DATA2_Pos) /*!< CAN_IF_T::DATAA1: DATA2 Mask */ - -/* CAN IFn_DATA_B1 Bit Field Definitions */ -#define CAN_IF_DAT_B1_DATA5_Pos 8 /*!< CAN_IF_T::DATAB1: DATA5 Position */ -#define CAN_IF_DAT_B1_DATA5_Msk (0xFFul << CAN_IF_DAT_B1_DATA5_Pos) /*!< CAN_IF_T::DATAB1: DATA5 Mask */ - -#define CAN_IF_DAT_B1_DATA4_Pos 0 /*!< CAN_IF_T::DATAB1: DATA4 Position */ -#define CAN_IF_DAT_B1_DATA4_Msk (0xFFul << CAN_IF_DAT_B1_DATA4_Pos) /*!< CAN_IF_T::DATAB1: DATA4 Mask */ - -/* CAN IFn_DATA_B2 Bit Field Definitions */ -#define CAN_IF_DAT_B2_DATA7_Pos 8 /*!< CAN_IF_T::DATAB2: DATA7 Position */ -#define CAN_IF_DAT_B2_DATA7_Msk (0xFFul << CAN_IF_DAT_B2_DATA7_Pos) /*!< CAN_IF_T::DATAB2: DATA7 Mask */ - -#define CAN_IF_DAT_B2_DATA6_Pos 0 /*!< CAN_IF_T::DATAB2: DATA6 Position */ -#define CAN_IF_DAT_B2_DATA6_Msk (0xFFul << CAN_IF_DAT_B2_DATA6_Pos) /*!< CAN_IF_T::DATAB2: DATA6 Mask */ - -/* CAN IFn_TXRQST1 Bit Field Definitions */ -#define CAN_TXRQST1_TXRQST_Pos 0 /*!< CAN_T::TXRQST1: TXRQST Position */ -#define CAN_TXRQST1_TXRQST_Msk (0xFFFFul << CAN_TXRQST1_TXRQST_Pos) /*!< CAN_T::TXRQST1: TXRQST Mask */ - -/* CAN IFn_TXRQST2 Bit Field Definitions */ -#define CAN_TXRQST2_TXRQST_Pos 0 /*!< CAN_T::TXRQST2: TXRQST Position */ -#define CAN_TXRQST2_TXRQST_Msk (0xFFFFul << CAN_TXRQST2_TXRQST_Pos) /*!< CAN_T::TXRQST2: TXRQST Mask */ - -/* CAN IFn_NDAT1 Bit Field Definitions */ -#define CAN_NDAT1_NEWDATA_Pos 0 /*!< CAN_T::NDAT1: NEWDATA Position */ -#define CAN_NDAT1_NEWDATA_Msk (0xFFFFul << CAN_NDAT1_NEWDATA_Pos) /*!< CAN_T::NDAT1: NEWDATA Mask */ - -/* CAN IFn_NDAT2 Bit Field Definitions */ -#define CAN_NDAT2_NEWDATA_Pos 0 /*!< CAN_T::NDAT2: NEWDATA Position */ -#define CAN_NDAT2_NEWDATA_Msk (0xFFFFul << CAN_NDAT2_NEWDATA_Pos) /*!< CAN_T::NDAT2: NEWDATA Mask */ - -/* CAN IFn_IPND1 Bit Field Definitions */ -#define CAN_IPND1_INTPND_Pos 0 /*!< CAN_T::IPND1: INTPND Position */ -#define CAN_IPND1_INTPND_Msk (0xFFFFul << CAN_IPND1_INTPND_Pos) /*!< CAN_T::IPND1: INTPND Mask */ - -/* CAN IFn_IPND2 Bit Field Definitions */ -#define CAN_IPND2_INTPND_Pos 0 /*!< CAN_T::IPND2: INTPND Position */ -#define CAN_IPND2_INTPND_Msk (0xFFFFul << CAN_IPND2_INTPND_Pos) /*!< CAN_T::IPND2: INTPND Mask */ - -/* CAN IFn_MVLD1 Bit Field Definitions */ -#define CAN_MVLD1_MSGVAL_Pos 0 /*!< CAN_T::MVLD1: MSGVAL Position */ -#define CAN_MVLD1_MSGVAL_Msk (0xFFFFul << CAN_MVLD1_MSGVAL_Pos) /*!< CAN_T::MVLD1: MSGVAL Mask */ - -/* CAN IFn_MVLD2 Bit Field Definitions */ -#define CAN_MVLD2_MSGVAL_Pos 0 /*!< CAN_T::MVLD2: MSGVAL Position */ -#define CAN_MVLD2_MSGVAL_Msk (0xFFFFul << CAN_MVLD2_MSGVAL_Pos) /*!< CAN_T::MVLD2: MSGVAL Mask */ - -/* CAN WUEN Bit Field Definitions */ -#define CAN_WU_EN_WAKUP_EN_Pos 0 /*!< CAN_T::WU_EN: WAKUP_EN Position */ -#define CAN_WU_EN_WAKUP_EN_Msk (0x1ul << CAN_WU_EN_WAKUP_EN_Pos) /*!< CAN_T::WU_EN: WAKUP_EN Mask */ - -/* CAN WUSTATUS Bit Field Definitions */ -#define CAN_WU_STATUS_WAKUP_STS_Pos 0 /*!< CAN_T::WU_STATUS: WAKUP_STS Position */ -#define CAN_WU_STATUS_WAKUP_STS_Msk (0x1ul << CAN_WU_STATUS_WAKUP_STS_Pos) /*!< CAN_T::WU_STATUS: WAKUP_STS Mask */ - - -/**@}*/ /* CAN_CONST */ -/**@}*/ /* end of CAN register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __CAN_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/clk_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/clk_reg.h deleted file mode 100644 index 34a3eb82e6f..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/clk_reg.h +++ /dev/null @@ -1,1815 +0,0 @@ -/**************************************************************************//** - * @file clk_reg.h - * @version V1.00 - * @brief CLK register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CLK_REG_H__ -#define __CLK_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- System Clock Controller -------------------------*/ -/** - @addtogroup CLK System Clock Controller(CLK) - Memory Mapped Structure for CLK Controller - @{ -*/ - -typedef struct -{ - - /** - * @var CLK_T::PWRCTL - * Offset: 0x00 System Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTEN |HXT Enable Bit (Write Protect) - * | | |0 = 4~24 MHz external high speed crystal (HXT) Disabled. - * | | |1 = 4~24 MHz external high speed crystal (HXT) Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: HXT cannot be disabled and HXTEN will always read as 1 if HCLK clock source is selected from HXT or PLL (clock source from HXT). - * |[1] |LXTEN |LXT Enable Bit (Write Protect) - * | | |0 = 32.768 kHz external low speed crystal (extLXT) Disabled. - * | | |1 = 32.768 kHz external low speed crystal (extLXT) Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: LXT cannot be disabled and LXTEN will always read as 1 if HCLK clock source is selected from LXT when the LXT clock source is selected as extLXT by setting C32KS(RTC_LXTCTL[7]) to 1. - * |[2] |HIRCEN |HIRC Enable Bit (Write Protect) - * | | |The HCLK default clock source is from HIRC and this bit default value is 1. - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) Disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: HIRC cannot be disabled and HIRCEN will always read as 1 if HCLK clock source is selected from HIRC or PLL (clock source from HIRC). - * |[3] |LIRCEN |LIRC Enable Bit (Write Protect) - * | | |0 = 32 kHz internal low speed RC oscillator (LIRC) Disabled. - * | | |1 = 32 kHz internal low speed RC oscillator (LIRC) Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: LIRC cannot be disabled and LIRCEN will always read as 1 if HCLK clock source is selected from LIRC. - * | | |Note3: If CWDTEN(CONFIG[31,4:3]) is set to 111, LIRC clock can be enabled or disabled by setting LIRCEN(CLK_PWRCTL[3]). - * | | |If CWDTEN(CONFIG0[31,4:3]) is not set to 111, LIRC cannot be disabled in normal mode and LIRCEN will always read as 1 - * | | |In Power-down mode, LIRC clock is controlled by LIRCEN(CLK_PWRCTL[3]) and CWDTPDEN (CONFIG0[30]) setting. - * |[5] |PDWKIEN |Power-down Mode Wake-up Interrupt Enable Bit (Write Protect) - * | | |0 = Power-down mode wake-up interrupt Disabled. - * | | |1 = Power-down mode wake-up interrupt Enabled. - * | | |Note1: The interrupt will occur when both PDWKIF and PDWKIEN are high, after resume from Power-down mode. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |PDWKIF |Power-down Mode Wake-up Interrupt Status - * | | |Set by Power-down wake-up event, it indicates that resume from Power-down mode. - * | | |The flag is set if the EINT7~0, GPIO, UART0~5, USBH, USBD, OTG, CAN0, BOD, ACMP, WDT, EWDT, SDH0, TIMER, I2C0~2, USCI0~1, RTC, TAMPER and CLKD wake-up occurred. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: This bit works only if PDWKIEN (CLK_PWRCTL[5]) set to 1. - * |[7] |PDEN |System Power-down Enable (Write Protect) - * | | |When this bit is set to 1, Power-down mode is enabled and the chip keeps active till the CPU sleep mode is also active and then the chip enters Power-down mode. - * | | |When chip wakes up from Power-down mode, this bit is auto cleared. Users need to set this bit again for next Power-down. - * | | |In Power-down mode, HXT, HIRC, HIRC48, PLL and system clock will be disabled and ignored the clock source selection. - * | | |The clocks of peripheral are not controlled by Power-down mode, if the peripheral clock source is from LXT, LIRC or MIRC. - * | | |0 = Chip operating normally or chip in idle mode because of WFI command. - * | | |1 = Chip waits CPU sleep command WFI and then enters Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11:10] |HXTGAIN |HXT Gain Control Bit (Write Protect) - * | | |Gain control is used to enlarge the gain of crystal to make sure crystal work normally. - * | | |If gain control is enabled, crystal will consume more power than gain control off. - * | | |00 = HXT frequency is lower than from 8 MHz. - * | | |01 = HXT frequency is from 8 MHz to 12 MHz. - * | | |10 = HXT frequency is from 12 MHz to 16 MHz. - * | | |11 = HXT frequency is higher than 16 MHz. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[12] |HXTSELTYP |HXT Crystal Type Select Bit (Write Protect) - * | | |0 = Select INV type. - * | | |1 = Select GM type. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |HXTTBEN |HXT Crystal TURBO Mode (Write Protect) - * | | |0 = HXT Crystal TURBO mode disabled. - * | | |1 = HXT Crystal TURBO mode enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[18] |HIRC48EN |HIRC48 Enable Bit (Write Protect) - * | | |0 = 48 MHz internal high speed RC oscillator (HIRC48) Disabled. - * | | |1 = 48 MHz internal high speed RC oscillator (HIRC48) Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: HIRC48 cannot be disabled and HIRC48EN will always read as 1 if HCLK clock source is selected from HIRC48. - * |[20] |MIRC1P2MEN|MIRC1P2M Enable Bit (Write Protect) - * | | |0 = 1.2 MHz internal medium speed RC oscillator (MIRC1P2M) Disabled. - * | | |1 = 1.2 MHz internal medium speed RC oscillator (MIRC1P2M) Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: This clock source only for LCD use. - * |[21] |MIRCEN |MIRC Enable Bit (Write Protect) - * | | |0 = 4 MHz internal medium speed RC oscillator (MIRC) Disabled. - * | | |1 = 4 MHz internal medium speed RC oscillator (MIRC) Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: MIRC cannot be disabled and MIRC will always read as 1 if HCLK clock source is selected from MIRC. - * @var CLK_T::AHBCLK - * Offset: 0x04 AHB Devices Clock Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMA0CKEN |PDMA0 Controller Clock Enable Bit (Secure) - * | | |0 = PDMA0 peripheral clock Disabled. - * | | |1 = PDMA0 peripheral clock Enabled. - * |[1] |PDMA1CKEN |PDMA1 Controller Clock Enable Bit - * | | |0 = PDMA1 peripheral clock Disabled. - * | | |1 = PDMA1 peripheral clock Enabled. - * |[2] |ISPCKEN |Flash ISP Controller Clock Enable Bit - * | | |0 = Flash ISP peripheral clock Disabled. - * | | |1 = Flash ISP peripheral clock Enabled. - * |[3] |EBICKEN |EBI Controller Clock Enable Bit - * | | |0 = EBI peripheral clock Disabled. - * | | |1 = EBI peripheral clock Enabled. - * |[4] |EXSTCKEN |External System Tick Clock Enable Bit - * | | |0 = External System tick clock Disabled. - * | | |1 = External System tick clock Enabled. - * |[6] |SDH0CKEN |SDHOST0 Controller Clock Enable Bit - * | | |0 = SDHOST0 peripheral clock Disabled. - * | | |1 = SDHOST0 peripheral clock Enabled. - * |[7] |CRCCKEN |CRC Generator Controller Clock Enable Bit - * | | |0 = CRC peripheral clock Disabled. - * | | |1 = CRC peripheral clock Enabled. - * |[12] |CRPTCKEN |Cryptographic Accelerator Clock Enable Bit - * | | |0 = Cryptographic Accelerator clock Disabled. - * | | |1 = Cryptographic Accelerator clock Enabled. - * |[13] |KSCKEN |Key Store Clock Enable Bit - * | | |0 = Key store clock Disabled. - * | | |1 = Key store clock Enabled. - * |[14] |TRACECKEN |Trace Clock Enable Bit - * | | |0 = Trace clock Disabled. - * | | |1 = Trace clock Enabled. - * |[15] |FMCIDLE |Flash Memory Controller Clock Enable Bit in IDLE Mode - * | | |0 = FMC clock Disabled when chip is under IDLE mode. - * | | |1 = FMC clock Enabled when chip is under IDLE mode. - * |[16] |USBHCKEN |USB HOST 1.1 Controller Clock Enable Bit - * | | |0 = USB HOST 1.1 peripheral clock Disabled. - * | | |1 = USB HOST 1.1 peripheral clock Enabled. - * |[20] |SRAM0CKEN |SRAM Bank0 Controller Clock Enable Bit - * | | |0 = SRAM bank0 clock Disabled. - * | | |1 = SRAM bank0 clock Enabled. - * |[21] |SRAM1CKEN |SRAM Bank1 Controller Clock Enable Bit - * | | |0 = SRAM bank1 clock Disabled. - * | | |1 = SRAM bank1 clock Enabled. - * |[22] |SRAM2CKEN |SRAM Bank2 Controller Clock Enable Bit - * | | |0 = SRAM bank2 clock Disabled. - * | | |1 = SRAM bank2 clock Enabled. - * |[24] |GPACKEN |GPIOA Clock Enable Bit - * | | |0 = GPIOA port clock Disabled. - * | | |1 = GPIOA port clock Enabled. - * |[25] |GPBCKEN |GPIOB Clock Enable Bit - * | | |0 = GPIOB port clock Disabled. - * | | |1 = GPIOB port clock Enabled. - * |[26] |GPCCKEN |GPIOC Clock Enable Bit - * | | |0 = GPIOC port clock Disabled. - * | | |1 = GPIOC port clock Enabled. - * |[27] |GPDCKEN |GPIOD Clock Enable Bit - * | | |0 = GPIOD port clock Disabled. - * | | |1 = GPIOD port clock Enabled. - * |[28] |GPECKEN |GPIOE Clock Enable Bit - * | | |0 = GPIOE port clock Disabled. - * | | |1 = GPIOE port clock Enabled. - * |[29] |GPFCKEN |GPIOF Clock Enable Bit - * | | |0 = GPIOF port clock Disabled. - * | | |1 = GPIOF port clock Enabled. - * |[30] |GPGCKEN |GPIOG Clock Enable Bit - * | | |0 = GPIOG port clock Disabled. - * | | |1 = GPIOG port clock Enabled. - * |[31] |GPHCKEN |GPIOH Clock Enable Bit - * | | |0 = GPIOH port clock Disabled. - * | | |1 = GPIOH port clock Enabled. - * @var CLK_T::APBCLK0 - * Offset: 0x08 APB Devices Clock Enable Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDTCKEN |Watchdog Timer Clock Enable Bit (Write Protect) - * | | |0 = Watchdog timer and Windows watchdog timer clock Disabled. - * | | |1 = Watchdog timer and Windows watchdog timer clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |RTCCKEN |Real-time-clock APB Interface Clock Enable Bit - * | | |This bit is used to control the RTC APB clock only. - * | | |The RTC peripheral clock source is selected from RTCCKSEL(RTC_LXTCTL[7]). - * | | |It can be selected to 32.768 kHz external low speed crystal (LXT) or 32 kHz internal low speed RC oscillator (LIRC). - * | | |0 = RTC clock Disabled. - * | | |1 = RTC clock Enabled. - * |[2] |TMR0CKEN |Timer0 Clock Enable Bit - * | | |0 = Timer0 clock Disabled. - * | | |1 = Timer0 clock Enabled. - * |[3] |TMR1CKEN |Timer1 Clock Enable Bit - * | | |0 = Timer1 clock Disabled. - * | | |1 = Timer1 clock Enabled. - * |[4] |TMR2CKEN |Timer2 Clock Enable Bit - * | | |0 = Timer2 clock Disabled. - * | | |1 = Timer2 clock Enabled. - * |[5] |TMR3CKEN |Timer3 Clock Enable Bit - * | | |0 = Timer3 clock Disabled. - * | | |1 = Timer3 clock Enabled. - * |[6] |CLKOCKEN |CLKO Clock Enable Bit - * | | |0 = CLKO clock Disabled. - * | | |1 = CLKO clock Enabled. - * |[7] |ACMP01CKEN|Analog Comparator 0/1 Clock Enable Bit - * | | |0 = Analog comparator 0/1 clock Disabled. - * | | |1 = Analog comparator 0/1 clock Enabled. - * |[8] |I2C0CKEN |I2C0 Clock Enable Bit - * | | |0 = I2C0 clock Disabled. - * | | |1 = I2C0 clock Enabled. - * |[9] |I2C1CKEN |I2C1 Clock Enable Bit - * | | |0 = I2C1 clock Disabled. - * | | |1 = I2C1 clock Enabled. - * |[10] |I2C2CKEN |I2C2 Clock Enable Bit - * | | |0 = I2C2 clock Disabled. - * | | |1 = I2C2 clock Enabled. - * |[12] |QSPI0CKEN |QSPI0 Clock Enable Bit - * | | |0 = QSPI0 clock Disabled. - * | | |1 = QSPI0 clock Enabled. - * |[13] |SPI0CKEN |SPI0 Clock Enable Bit - * | | |0 = SPI0 clock Disabled. - * | | |1 = SPI0 clock Enabled. - * |[14] |SPI1CKEN |SPI1 Clock Enable Bit - * | | |0 = SPI1 clock Disabled. - * | | |1 = SPI1 clock Enabled. - * |[15] |SPI2CKEN |SPI2 Clock Enable Bit - * | | |0 = SPI2 clock Disabled. - * | | |1 = SPI2 clock Enabled. - * |[16] |UART0CKEN |UART0 Clock Enable Bit - * | | |0 = UART0 clock Disabled. - * | | |1 = UART0 clock Enabled. - * |[17] |UART1CKEN |UART1 Clock Enable Bit - * | | |0 = UART1 clock Disabled. - * | | |1 = UART1 clock Enabled. - * |[18] |UART2CKEN |UART2 Clock Enable Bit - * | | |0 = UART2 clock Disabled. - * | | |1 = UART2 clock Enabled. - * |[19] |UART3CKEN |UART3 Clock Enable Bit - * | | |0 = UART3 clock Disabled. - * | | |1 = UART3 clock Enabled. - * |[20] |UART4CKEN |UART4 Clock Enable Bit - * | | |0 = UART4 clock Disabled. - * | | |1 = UART4 clock Enabled. - * |[21] |UART5CKEN |UART5 Clock Enable Bit - * | | |0 = UART5 clock Disabled. - * | | |1 = UART5 clock Enabled. - * |[24] |CAN0CKEN |CAN0 Clock Enable Bit - * | | |0 = CAN0 clock Disabled. - * | | |1 = CAN0 clock Enabled. - * |[26] |OTGCKEN |USB OTG Clock Enable Bit - * | | |0 = USB OTG clock Disabled. - * | | |1 = USB OTG clock Enabled. - * |[27] |USBDCKEN |USB Device Clock Enable Bit - * | | |0 = USB Device clock Disabled. - * | | |1 = USB Device clock Enabled. - * |[28] |EADCCKEN |Enhanced Analog-digital-converter (EADC) Clock Enable Bit - * | | |0 = EADC clock Disabled. - * | | |1 = EADC clock Enabled. - * |[29] |I2S0CKEN |I2S0 Clock Enable Bit - * | | |0 = I2S0 Clock Disabled. - * | | |1 = I2S0 Clock Enabled. - * |[31] |EWDTCKEN |Extra Watchdog Timer Clock Enable Bit (Write Protect) - * | | |0 = Extra Watchdog timer and Extra Windows watchdog timer clock Disabled. - * | | |1 = Extra Watchdog timer and Extra Windows watchdog timer clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::APBCLK1 - * Offset: 0x0C APB Devices Clock Enable Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SC0CKEN |Smart Card 0 (SC0) Clock Enable Bit - * | | |0 = SC0 clock Disabled. - * | | |1 = SC0 clock Enabled. - * |[1] |SC1CKEN |Smart Card 1 (SC1) Clock Enable Bit - * | | |0 = SC1 clock Disabled. - * | | |1 = SC1 clock Enabled. - * |[2] |SC2CKEN |Smart Card 2 (SC2) Clock Enable Bit - * | | |0 = SC2 clock Disabled. - * | | |1 = SC2 clock Enabled. - * |[4] |TMR4CKEN |Timer4 Clock Enable Bit - * | | |0 = Timer4 clock Disabled. - * | | |1 = Timer4 clock Enabled. - * |[5] |TMR5CKEN |Timer5 Clock Enable Bit - * | | |0 = Timer5 clock Disabled. - * | | |1 = Timer5 clock Enabled. - * |[6] |SPI3CKEN |SPI3 Clock Enable Bit - * | | |0 = SPI3 clock Disabled. - * | | |1 = SPI3 clock Enabled. - * |[8] |USCI0CKEN |USCI0 Clock Enable Bit - * | | |0 = USCI0 clock Disabled. - * | | |1 = USCI0 clock Enabled. - * |[9] |USCI1CKEN |USCI1 Clock Enable Bit - * | | |0 = USCI1 clock Disabled. - * | | |1 = USCI1 clock Enabled. - * |[12] |DACCKEN |DAC Clock Enable Bit - * | | |0 = DAC clock Disabled. - * | | |1 = DAC clock Enabled. - * |[16] |EPWM0CKEN |EPWM0 Clock Enable Bit - * | | |0 = EPWM0 clock Disabled. - * | | |1 = EPWM0 clock Enabled. - * |[17] |EPWM1CKEN |EPWM1 Clock Enable Bit - * | | |0 = EPWM1 clock Disabled. - * | | |1 = EPWM1 clock Enabled. - * |[18] |BPWM0CKEN |BPWM0 Clock Enable Bit - * | | |0 = BPWM0 clock Disabled. - * | | |1 = BPWM0 clock Enabled. - * |[19] |BPWM1CKEN |BPWM1 Clock Enable Bit - * | | |0 = BPWM1 clock Disabled. - * | | |1 = BPWM1 clock Enabled. - * |[22] |QEI0CKEN |QEI0 Clock Enable Bit - * | | |0 = QEI0 clock Disabled. - * | | |1 = QEI0 clock Enabled. - * |[23] |QEI1CKEN |QEI1 Clock Enable Bit - * | | |0 = QEI1 clock Disabled. - * | | |1 = QEI1 clock Enabled. - * |[25] |TRNGCKEN |TRNG Clock Enable Bit - * | | |0 = TRNG clock Disabled. - * | | |1 = TRNG clock Enabled. - * |[26] |ECAP0CKEN |ECAP0 Clock Enable Bit - * | | |0 = ECAP0 clock Disabled. - * | | |1 = ECAP0 clock Enabled. - * |[27] |ECAP1CKEN |ECAP1 Clock Enable Bit - * | | |0 = ECAP1 clock Disabled. - * | | |1 = ECAP1 clock Enabled. - * |[28] |LCDCPCKEN |LCD Charge Pump Clock Enable Bit - * | | |0 = LCD charge pump clock Disabled. - * | | |1 = LCD charge pump clock Enabled. - * @var CLK_T::CLKSEL0 - * Offset: 0x10 Clock Source Select Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |HCLKSEL |HCLK Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |000 = Clock source from HXT. - * | | |001 = Clock source from LXT. - * | | |010 = Clock source from PLL. - * | | |011 = Clock source from LIRC. - * | | |100 = Reserved. - * | | |101 = Clock source from HIRC48. - * | | |110 = Clock source from MIRC. - * | | |111 = Clock source from HIRC. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[5:3] |STCLKSEL |SysTick Clock Source Selection (Write Protect) - * | | |If SYST_CTRL[2]=0, SysTick uses listed clock source below. - * | | |000 = Clock source from HXT. - * | | |001 = Clock source from LXT. - * | | |010 = Clock source from HXT/2. - * | | |011 = Clock source from HCLK/2. - * | | |111 = Clock source from HIRC/2. - * | | |Others = Reserved. - * | | |Note1: if SysTick clock source is not from HCLK (i.e SYST_CTRL[2] = 0), - * | | |SysTick need to enable EXSTCKEN(CLK_AHBCLK[4]) and clock frequency must less than or equal to HCLK/2. - * | | |Note2: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[8] |USBSEL |USB Clock Source Selection (Write Protect) - * | | |0 = Clock source from HIRC48. - * | | |1 = Clock source from PLL. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[21:20] |SDH0SEL |SDHOST0 Peripheral Clock Source Selection (Write Protect) - * | | |00 = Clock source from HXT clock. - * | | |01 = Clock source from PLL clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from HIRC clock. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::CLKSEL1 - * Offset: 0x14 Clock Source Select Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WDTSEL |Watchdog Timer Clock Source Selection (Write Protect) - * | | |00 = Reserved. - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[2] |LCDSEL |LCD Clock Source Selection - * | | |0 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |1 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * |[3] |LCDCPSEL |LCD Charge Pump Clock Source Selection - * | | |0 = Clock source from 1.2 MHz internal medium speed RC oscillator (MIRC1P2M). - * | | |1 = Clock source from 4 MHz internal medium speed RC oscillator (MIRC). - * |[5:4] |EWDTSEL |Extra Watchdog Timer Clock Source Selection (Write Protect) - * | | |00 = Reserved. - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[7:6] |EWWDTSEL |Extra Window Watchdog Timer Clock Source Selection (Write Protect) - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[10:8] |TMR0SEL |TIMER0 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM0 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[14:12] |TMR1SEL |TIMER1 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM1 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[18:16] |TMR2SEL |TIMER2 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM2 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[22:20] |TMR3SEL |TIMER3 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM3 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[29:28] |CLKOSEL |Clock Output Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[31:30] |WWDTSEL |Window Watchdog Timer Clock Source Selection (Write Protect) - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::CLKSEL2 - * Offset: 0x18 Clock Source Select Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EPWM0SEL |EPWM0 Clock Source Selection (Read Only) - * | | |The peripheral clock source of EPWM0 is defined by EPWM0SEL. - * | | |1 = Clock source from PCLK0. - * |[1] |EPWM1SEL |EPWM1 Clock Source Selection (Read Only) - * | | |The peripheral clock source of EPWM1 is defined by EPWM1SEL. - * | | |1 = Clock source from PCLK1. - * |[3:2] |QSPI0SEL |QSPI0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[5:4] |SPI0SEL |SPI0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[7:6] |SPI1SEL |SPI1 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[8] |BPWM0SEL |BPWM0 Clock Source Selection (Read Only) - * | | |The peripheral clock source of BPWM0 is defined by BPWM0SEL. - * | | |1 = Clock source from PCLK0. - * |[9] |BPWM1SEL |BPWM1 Clock Source Selection (Read Only) - * | | |The peripheral clock source of BPWM1 is defined by BPWM1SEL. - * | | |1 = Clock source from PCLK1. - * |[11:10] |SPI2SEL |SPI2 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[13:12] |SPI3SEL |SPI3 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[18:16] |UART0SEL |UART0 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. - * | | |010 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK0. - * | | |Others = Reserved. - * |[22:20] |UART1SEL |UART1 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. - * | | |010 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK1. - * | | |Others = Reserved. - * |[26:24] |UART2SEL |UART2 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. - * | | |010 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK0. - * | | |Others = Reserved. - * |[32:28] |UART3SEL |UART3 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. - * | | |010 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK1. - * | | |Others = Reserved. - * @var CLK_T::CLKSEL3 - * Offset: 0x1C Clock Source Select Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SC0SEL |Smart Card 0 (SC0) Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[3:2] |SC1SEL |Smart Card 1 (SC1) Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[5:4] |SC2SEL |Smart Card 2 (SC2) Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[10:8] |TMR4SEL |TIMER4 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM4 pin. - * | | |100 = Clock source from 4 MHz internal medium speed RC oscillator (MIRC). - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |110 = Reserved. - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[14:12] |TMR5SEL |TIMER5 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM5 pin. - * | | |100 = Clock source from 4 MHz internal medium speed RC oscillator (MIRC). - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |110 = Reserved. - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[17:16] |I2S0SEL |I2S0 Clock Source Selection - * | | |00 = Clock source from HXT clock. - * | | |01 = Clock source from PLL clock. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from HIRC clock. - * |[27:24] |UART4SEL |UART4 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. - * | | |010 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK0. - * | | |Others = Reserved. - * |[28:30] |UART5SEL |UART5 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL. - * | | |010 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from PCLK1. - * | | |Others = Reserved. - * @var CLK_T::CLKDIV0 - * Offset: 0x20 Clock Divider Number Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |HCLKDIV |HCLK Clock Divide Number from HCLK Clock Source - * | | |HCLK clock frequency = (HCLK clock source frequency) / (HCLKDIV + 1). - * |[7:4] |USBDIV |USB Clock Divide Number from USB Clock Source - * | | |USB clock frequency = (USB clock source frequency) / (USBDIV + 1). - * |[11:8] |UART0DIV |UART0 Clock Divide Number from UART0 Clock Source - * | | |UART0 clock frequency = (UART0 clock source frequency) / (UART0DIV + 1). - * |[15:12] |UART1DIV |UART1 Clock Divide Number from UART1 Clock Source - * | | |UART1 clock frequency = (UART1 clock source frequency) / (UART1DIV + 1). - * |[23:16] |EADCDIV |EADC Clock Divide Number from EADC Clock Source - * | | |EADC clock frequency = (EADC clock source frequency) / (EADCDIV + 1). - * |[31:24] |SDH0DIV |SDHOST0 Clock Divide Number from SDHOST0 Clock Source - * | | |SDHOST0 clock frequency = (SDHOST0 clock source frequency) / (SDH0DIV + 1). - * @var CLK_T::CLKDIV1 - * Offset: 0x24 Clock Divider Number Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SC0DIV |Smart Card 0 (SC0) Clock Divide Number from SC0 Clock Source - * | | |SC0 clock frequency = (SC0 clock source frequency) / (SC0DIV + 1). - * |[15:8] |SC1DIV |Smart Card 1 (SC1) Clock Divide Number from SC1 Clock Source - * | | |SC1 clock frequency = (SC1 clock source frequency) / (SC1DIV + 1). - * |[23:16] |SC2DIV |Smart Card 2 (SC2) Clock Divide Number from SC2 Clock Source - * | | |SC2 clock frequency = (SC2 clock source frequency) / (SC2DIV + 1). - * @var CLK_T::CLKDIV4 - * Offset: 0x30 Clock Divider Number Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |UART2DIV |UART2 Clock Divide Number from UART2 Clock Source - * | | |UART2 clock frequency = (UART2 clock source frequency) / (UART2DIV + 1). - * |[7:4] |UART3DIV |UART3 Clock Divide Number from UART3 Clock Source - * | | |UART3 clock frequency = (UART3 clock source frequency) / (UART3DIV + 1). - * |[11:8] |UART4DIV |UART4 Clock Divide Number from UART4 Clock Source - * | | |UART4 clock frequency = (UART4 clock source frequency) / (UART4DIV + 1). - * |[15:12] |UART5DIV |UART5 Clock Divide Number from UART5 Clock Source - * | | |UART5 clock frequency = (UART5 clock source frequency) / (UART5DIV + 1). - * @var CLK_T::PLLCTL - * Offset: 0x40 PLL Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Refer to the PLL formulas. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[13:9] |INDIV |PLL Input Divider Control (Write Protect) - * | | |Refer to the PLL formulas. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[15:14] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Refer to the PLL formulas. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[16] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note1: If set the PDEN bit to 1 in CLK_PWRCTL register, the PLL will enter Power-down mode, too. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock FIN. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[19] |PLLSRC |PLL Source Clock Selection (Write Protect) - * | | |0 = PLL source clock from 4~24 MHz external high-speed crystal oscillator (HXT). - * | | |1 = PLL source clock from 12 MHz internal high-speed oscillator (HIRC). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |STBSEL |PLL Stable Counter Selection (Write Protect) - * | | |0 = PLL stable time is 6144 PLL source clock (suitable for source clock is equal to or less than 12 MHz). - * | | |1 = PLL stable time is 12288 PLL source clock (suitable for source clock is larger than 12 MHz). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::STATUS - * Offset: 0x50 Clock Status Monitor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTSTB |HXT Clock Source Stable Flag (Read Only) - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock is not stable or disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock is stable and enabled. - * |[1] |LXTSTB |LXT Clock Source Stable Flag (Read Only) - * | | |LXT clock source can be selected as extLXT or LIRC32 by setting C32KS(RTC_LXTCTL[7]). - * | | |If C32KS is set to 0 the LXT stable flag is set when extLXT clock source is stable. - * | | |If C32KS is set to 1 the LXT stable flag is set when LIRC32 clock source is stable. - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is not stable or disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock is stabled and enabled. - * |[2] |PLLSTB |Internal PLL Clock Source Stable Flag (Read Only) - * | | |0 = Internal PLL clock is not stable or disabled. - * | | |1 = Internal PLL clock is stable and enabled. - * |[3] |LIRCSTB |LIRC Clock Source Stable Flag (Read Only) - * | | |0 = 32 kHz internal low speed RC oscillator (LIRC) clock is not stable or disabled. - * | | |1 = 32 kHz internal low speed RC oscillator (LIRC) clock is stable and enabled. - * |[4] |HIRCSTB |HIRC Clock Source Stable Flag (Read Only) - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) clock is not stable or disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) clock is stable and enabled. - * |[5] |MIRCSTB |MIRC Clock Source Stable Flag (Read Only) - * | | |0 = 4 MHz internal medium speed RC oscillator (MIRC) clock is not stable or disabled. - * | | |1 = 4 MHz internal medium speed RC oscillator (MIRC) clock is stable and enabled. - * |[6] |HIRC48STB |HIRC48 Clock Source Stable Flag (Read Only) - * | | |0 = 48 MHz internal high speed RC oscillator (HIRC48) clock is not stable or disabled. - * | | |1 = 48 MHz internal high speed RC oscillator (HIRC48) clock is stable and enabled. - * |[7] |CLKSFAIL |Clock Switching Fail Flag (Read Only) - * | | |This bit is updated when software switches system clock source. - * | | |If switch target clock is stable, this bit will be set to 0. - * | | |If switch target clock is not stable, this bit will be set to 1. - * | | |0 = Clock switching success. - * | | |1 = Clock switching failure. - * | | |Note: This bit is read only. - * | | |After selected clock source is stable, hardware will switch system clock to selected clock automatically, and CLKSFAIL will be cleared automatically by hardware. - * |[8] |EXTLXTSTB |EXTLXT Clock Source Stable Flag (Read Only) - * | | |0 = 32.768 kHz external low speed crystal oscillator (extLXT) clock is not stable or disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (extLXT) clock is stable and enabled. - * |[9] |LIRC32STB |LIRC32 Clock Source Stable Flag (Read Only) - * | | |0 = 32 kHz internal low speed RC oscillator (LIRC32) clock is not stable or disabled. - * | | |1 = 32 kHz internal low speed RC oscillator (LIRC32) clock is stable and enabled. - * @var CLK_T::CLKOCTL - * Offset: 0x60 Clock Output Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |FREQSEL |Clock Output Frequency Selection - * | | |The formula of output frequency is Fout = Fin/2^(N+1). - * | | |Fin is the input clock frequency. - * | | |Fout is the frequency of divider output clock. - * | | |N is the 4-bit value of FREQSEL[3:0]. - * |[4] |CLKOEN |Clock Output Enable Bit - * | | |0 = Clock Output function Disabled. - * | | |1 = Clock Output function Enabled. - * |[5] |DIV1EN |Clock Output Divide One Enable Bit - * | | |0 = Clock Output will output clock with source frequency divided by FREQSEL. - * | | |1 = Clock Output will output clock with source frequency. - * |[6] |CLK1HZEN |Clock Output 1Hz Enable Bit - * | | |0 = 1 Hz clock output for 32.768 kHz frequency compensation Disabled. - * | | |1 = 1 Hz clock output for 32.768 kHz frequency compensation Enabled. - * @var CLK_T::CLKDCTL - * Offset: 0x70 Clock Fail Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |HXTFDEN |HXT Clock Fail Detector Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector Enabled. - * |[5] |HXTFIEN |HXT Clock Fail Interrupt Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Enabled. - * |[6] |HXTFDSEL |HXT Clock Fail Detector Selection - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector after HXT stable. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector bypass HXT stable. - * | | |Note: When HXT Clock Fail Detector Selection is set, detector will keep detect whether HXT is stable or not, prevent HXT fail before stable. - * |[12] |LXTFDEN |LXT Clock Fail Detector Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Enabled. - * |[13] |LXTFIEN |LXT Clock Fail Interrupt Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Enabled. - * |[16] |HXTFQDEN |HXT Clock Frequency Monitor Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency monitor Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency monitor Enabled. - * |[17] |HXTFQIEN |HXT Clock Frequency Monitor Interrupt Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency monitor fail interrupt Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency monitor fail interrupt Enabled. - * @var CLK_T::CLKDSTS - * Offset: 0x74 Clock Fail Detector Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFIF |HXT Clock Fail Interrupt Flag (Write Protect) - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock is normal. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock stops. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |LXTFIF |LXT Clock Fail Interrupt Flag (Write Protect) - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is normal. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) stops. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |HXTFQIF |HXT Clock Frequency Monitor Interrupt Flag (Write Protect) - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock is normal. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency is abnormal. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::CDUPB - * Offset: 0x78 Clock Frequency Detector Upper Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |UPERBD |HXT Clock Frequency Detector Upper Boundary - * | | |The bits define the high value of frequency monitor window. - * | | |When HXT frequency monitor value higher than this register, the HXT frequency detect fail interrupt flag will set to 1. - * @var CLK_T::CDLOWB - * Offset: 0x7C Clock Frequency Detector Lower Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |LOWERBD |HXT Clock Frequency Detector Lower Boundary - * | | |The bits define the low value of frequency monitor window. - * | | |When HXT frequency monitor value lower than this register, the HXT frequency detect fail interrupt flag will set to 1. - * @var CLK_T::PMUCTL - * Offset: 0x90 Power Manager Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |PDMSEL |Power-down Mode Selection (Write Protect) - * | | |These bits control chip Power-down mode grade selection when CPU execute WFI/WFE instruction. - * | | |000 = Power-down mode is selected (PD). - * | | |001 = Low leakage Power-down mode is selected (LLPD). - * | | |010 = Fast wake-up Power-down (FWPD). - * | | |011 = Ultra low leakage Power-down mode is selected (ULLPD). - * | | |100 = Standby Power-down mode is selected (SPD). - * | | |101 = Reserved. - * | | |110 = Deep Power-down mode is selected (DPD). - * | | |111 = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[4] |VDROPEN |Standby Power Down Mode Regulator Output Voltage Drop Enable Bit (Write Protect) - * | | |If this bit be asserted, regulator output voltage drop to 0.9V when SPD mode. - * | | |0 = Regulator voltage auto drop function Disabled. - * | | |1 = Regulator voltage auto drop function Enabled. (default) - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |WRBUSY |Write Busy Flag (Read Only) - * | | |If CLK_PMUCTL be written, this bit be asserted automatic by hardware, and be de-asserted when write procedure finish. - * | | |0 = CLK_PMUCTL write ready. - * | | |1 = CLK_PMUCTL write ignore. - * |[8] |WKTMREN |Wake-up Timer Enable Bit (Write Protect) - * | | |0 = Wake-up timer Disable in Deep Power-down mode or Standby Power-down mode. - * | | |1 = Wake-up timer Enabled in Deep Power-down mode or Standby Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11:9] |WKTMRIS |Wake-up Timer Time-out Interval Select (Write Protect) - * | | |These bits control wake-up timer time-out interval when chip under Deep Power-down mode or Standby Power-down mode. - * | | |000 = Time-out interval is 410 LIRC clocks (12.8ms). - * | | |001 = Time-out interval is 819 LIRC clocks (25.6ms). - * | | |010 = Time-out interval is 1638 LIRC clocks (51.2ms). - * | | |011 = Time-out interval is 3277 LIRC clocks (102.4ms). - * | | |100 = Time-out interval is 13107 LIRC clocks (409.6ms). - * | | |101 = Time-out interval is 26214 LIRC clocks (819.2ms). - * | | |110 = Time-out interval is 52429 LIRC clocks (1638.4ms). - * | | |111 = Time-out interval is 209715 LIRC clocks (6553.6ms). - * |[17:16] |WKPINEN0 |Wake-up Pin 0 Enable (Write Protect) - * | | |This is control register for GPC.0 to wake-up pin. - * | | |00 = Wake-up pin Disable in Deep Power-down mode. - * | | |01 = Wake-up pin rising edge Enabled in Deep Power-down mode. - * | | |10 = Wake-up pin falling edge Enabled in Deep Power-down mode. - * | | |11 = Wake-up pin both edge Enabled in Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[18] |ACMPSPWK |ACMP Standby Power-down Mode Wake-up Enable (Write Protect) - * | | |0 = ACMP wake-up disable in Standby Power-down mode. - * | | |1 = ACMP wake-up enabled in Standby Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[19] |TAMPERWK |Tamper Standby Power-down Mode Wake-up Enable Bit (Write Protect) - * | | |0 = Tamper wake-up disable at Standby Power-down mode. - * | | |1 = Tamper wake-up enabled at Standby Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |RTCWKEN |RTC Wake-up Enable (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |0 = RTC wake-up Disable in Deep Power-down mode or Standby Power-down mode. - * | | |1 = RTC wake-up Enabled in Deep Power-down mode or Standby Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[25:24] |WKPINEN1 |Wake-up Pin 1 Enable (Write Protect) - * | | |This is control register for GPB.0 to wake-up pin. - * | | |00 = Wake-up pin Disable in Deep Power-down mode. - * | | |01 = Wake-up pin rising edge Enabled in Deep Power-down mode. - * | | |10 = Wake-up pin falling edge Enabled in Deep Power-down mode. - * | | |11 = Wake-up pin both edge Enabled in Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[27:26] |WKPINEN2 |Wake-up Pin 2 Enable (Write Protect) - * | | |This is control register for GPB.2 to wake-up pin. - * | | |00 = Wake-up pin Disable in Deep Power-down mode. - * | | |01 = Wake-up pin rising edge Enabled in Deep Power-down mode. - * | | |10 = Wake-up pin falling edge Enabled in Deep Power-down mode. - * | | |11 = Wake-up pin both edge Enabled in Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[29:28] |WKPINEN3 |Wake-up Pin 3 Enable (Write Protect) - * | | |This is control register for GPB.12 to wake-up pin. - * | | |00 = Wake-up pin Disable in Deep Power-down mode. - * | | |01 = Wake-up pin rising edge Enabled in Deep Power-down mode. - * | | |10 = Wake-up pin falling edge Enabled in Deep Power-down mode. - * | | |11 = Wake-up pin both edge Enabled in Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[31:30] |WKPINEN4 |Wake-up Pin 4 Enable (Write Protect) - * | | |This is control register for GPF.6 to wake-up pin. - * | | |00 = Wake-up pin Disable in Deep Power-down mode. - * | | |01 = Wake-up pin rising edge Enabled in Deep Power-down mode. - * | | |10 = Wake-up pin falling edge Enabled in Deep Power-down mode. - * | | |11 = Wake-up pin both edge Enabled in Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::PMUSTS - * Offset: 0x94 Power Manager Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINWK0 |Pin 0 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) was requested by a transition of the Wake-up pin (GPC.0). - * | | |This flag is cleared when DPD mode is entered. - * |[1] |TMRWK |Timer Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) or Standby Power-down (SPD) mode was requested by wakeup timer time-out. - * | | |This flag is cleared when DPD or SPD mode is entered. - * |[2] |RTCWK |RTC Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Deep Power-down mode (DPD) or Standby Power-down (SPD) mode was requested with a RTC alarm, tick time or tamper happened. - * | | |This flag is cleared when DPD or SPD mode is entered. - * |[3] |PINWK1 |Pin 1 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) was requested by a transition of the Wake-up pin (GPB.0). - * | | |This flag is cleared when DPD mode is entered. - * |[4] |PINWK2 |Pin 2 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) was requested by a transition of the Wake-up pin (GPB.2). - * | | |This flag is cleared when DPD mode is entered. - * |[5] |PINWK3 |Pin 3 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) was requested by a transition of the Wake-up pin (GPB.12). - * | | |This flag is cleared when DPD mode is entered. - * |[6] |PINWK4 |Pin 4 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) was requested by a transition of the Wake-up pin (GPF.6). - * | | |This flag is cleared when DPD mode is entered. - * |[8] |GPAWK |GPA Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode (SPD) was requested by a transition of selected one GPA group pins. - * | | |This flag is cleared when SPD mode is entered. - * |[9] |GPBWK |GPB Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode (SPD) was requested by a transition of selected one GPB group pins. - * | | |This flag is cleared when SPD mode is entered. - * |[10] |GPCWK |GPC Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode (SPD) was requested by a transition of selected one GPC group pins. - * | | |This flag is cleared when SPD mode is entered. - * |[11] |GPDWK |GPD Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode (SPD) was requested by a transition of selected one GPD group pins. - * | | |This flag is cleared when SPD mode is entered. - * |[12] |LVRWK |LVR Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of device from Standby Power-down mode (SPD) was requested with a LVR happened. - * | | |This flag is cleared when SPD mode is entered. - * |[13] |BODWK |BOD Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of device from Standby Power-down mode (SPD) was requested with a BOD happened. - * | | |This flag is cleared when SPD mode is entered. - * |[14] |ACMPWK |ACMP Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of device from Standby Power-down mode (SPD) was requested with a ACMP transition. - * | | |This flag is cleared when SPD mode is entered. - * |[15] |TAMPERWK |Tamper Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with a Tamper event occurred. - * | | |This flag is cleared when SPD mode is entered. - * |[31] |CLRWK |Clear Wake-up Flag - * | | |0 = No clear. - * | | |1 = Clear all wake-up flag. - * | | |Note: This bit is auto cleared by hardware. - * @var CLK_T::SWKDBCTL - * Offset: 0x9C Standby Power-down Wake-up De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SWKDBCLKSEL|Standby Power-down Wake-up De-bounce Sampling Cycle Selection - * | | |0000 = Sample wake-up input once per 1 clocks. - * | | |0001 = Sample wake-up input once per 2 clocks. - * | | |0010 = Sample wake-up input once per 4 clocks. - * | | |0011 = Sample wake-up input once per 8 clocks. - * | | |0100 = Sample wake-up input once per 16 clocks. - * | | |0101 = Sample wake-up input once per 32 clocks. - * | | |0110 = Sample wake-up input once per 64 clocks. - * | | |0111 = Sample wake-up input once per 128 clocks. - * | | |1000 = Sample wake-up input once per 256 clocks. - * | | |1001 = Sample wake-up input once per 2*256 clocks. - * | | |1010 = Sample wake-up input once per 4*256 clocks. - * | | |1011 = Sample wake-up input once per 8*256 clocks. - * | | |1100 = Sample wake-up input once per 16*256 clocks. - * | | |1101 = Sample wake-up input once per 32*256 clocks. - * | | |1110 = Sample wake-up input once per 64*256 clocks. - * | | |1111 = Sample wake-up input once per 128*256 clocks. - * | | |Note: De-bounce counter clock source is the 32 kHz internal low speed RC oscillator (LIRC). - * @var CLK_T::PASWKCTL - * Offset: 0xA0 GPA Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPA group pin wake-up function disabled. - * | | |1 = GPA group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPA group pin rising edge wake-up function Disabled. - * | | |1 = GPA group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPA group pin falling edge wake-up function Disabled. - * | | |1 = GPA group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPA Standby Power-down Wake-up Pin Select - * | | |0000 = GPA.0 wake-up function enabled. - * | | |0001 = GPA.1 wake-up function enabled. - * | | |0010 = GPA.2 wake-up function enabled. - * | | |0011 = GPA.3 wake-up function enabled. - * | | |0100 = GPA.4 wake-up function enabled. - * | | |0101 = GPA.5 wake-up function enabled. - * | | |0110 = GPA.6 wake-up function enabled. - * | | |0111 = GPA.7 wake-up function enabled. - * | | |1000 = GPA.8 wake-up function enabled. - * | | |1001 = GPA.9 wake-up function enabled. - * | | |1010 = GPA.10 wake-up function enabled. - * | | |1011 = GPA.11 wake-up function enabled. - * | | |1100 = GPA.12 wake-up function enabled. - * | | |1101 = GPA.13 wake-up function enabled. - * | | |1110 = GPA.14 wake-up function enabled. - * | | |1111 = GPA.15 wake-up function enabled. - * |[8] |DBEN |GPA Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wakeup. - * | | |The de-bounce clock source is the 32 kHz internal low speed RC oscillator (LIRC). - * | | |0 = Standby power-down wake-up pin De-bounce function Disable. - * | | |1 = Standby power-down wake-up pin De-bounce function Enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PBSWKCTL - * Offset: 0xA4 GPB Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPB group pin wake-up function Disabled. - * | | |1 = GPB group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPB group pin rising edge wake-up function Disabled. - * | | |1 = GPB group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPB group pin falling edge wake-up function Disabled. - * | | |1 = GPB group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPB Standby Power-down Wake-up Pin Select - * | | |0000 = GPB.0 wake-up function enabled. - * | | |0001 = GPB.1 wake-up function enabled. - * | | |0010 = GPB.2 wake-up function enabled. - * | | |0011 = GPB.3 wake-up function enabled. - * | | |0100 = GPB.4 wake-up function enabled. - * | | |0101 = GPB.5 wake-up function enabled. - * | | |0110 = GPB.6 wake-up function enabled. - * | | |0111 = GPB.7 wake-up function enabled. - * | | |1000 = GPB.8 wake-up function enabled. - * | | |1001 = GPB.9 wake-up function enabled. - * | | |1010 = GPB.10 wake-up function enabled. - * | | |1011 = GPB.11 wake-up function enabled. - * | | |1100 = GPB.12 wake-up function enabled. - * | | |1101 = GPB.13 wake-up function enabled. - * | | |1110 = GPB.14 wake-up function enabled. - * | | |1111 = GPB.15 wake-up function enabled. - * |[8] |DBEN |GPB Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wakeup. - * | | |The de-bounce clock source is the 32 kHz internal low speed RC oscillator (LIRC). - * | | |0 = Standby power-down wake-up pin De-bounce function Disable. - * | | |1 = Standby power-down wake-up pin De-bounce function Enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PCSWKCTL - * Offset: 0xA8 GPC Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPC group pin wake-up function Disabled. - * | | |1 = GPC group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPC group pin rising edge wake-up function Disabled. - * | | |1 = GPC group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPC group pin falling edge wake-up function Disabled. - * | | |1 = GPC group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPC Standby Power-down Wake-up Pin Select - * | | |0000 = GPC.0 wake-up function enabled. - * | | |0001 = GPC.1 wake-up function enabled. - * | | |0010 = GPC.2 wake-up function enabled. - * | | |0011 = GPC.3 wake-up function enabled. - * | | |0100 = GPC.4 wake-up function enabled. - * | | |0101 = GPC.5 wake-up function enabled. - * | | |0110 = GPC.6 wake-up function enabled. - * | | |0111 = GPC.7 wake-up function enabled. - * | | |1000 = GPC.8 wake-up function enabled. - * | | |1001 = GPC.9 wake-up function enabled. - * | | |1010 = GPC.10 wake-up function enabled. - * | | |1011 = GPC.11 wake-up function enabled. - * | | |1100 = GPC.12 wake-up function enabled. - * | | |1101 = GPC.13 wake-up function enabled. - * | | |1110 = Reserved. - * | | |1111 = Reserved. - * |[8] |DBEN |GPC Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wakeup. - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * | | |0 = Standby power-down wake-up pin De-bounce function Disable. - * | | |1 = Standby power-down wake-up pin De-bounce function Enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PDSWKCTL - * Offset: 0xAC GPD Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPD group pin wake-up function Disabled. - * | | |1 = GPD group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPD group pin rising edge wake-up function Disabled. - * | | |1 = GPD group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPD group pin falling edge wake-up function Disabled. - * | | |1 = GPD group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPD Standby Power-down Wake-up Pin Select - * | | |0000 = GPD.0 wake-up function enabled. - * | | |0001 = GPD.1 wake-up function enabled. - * | | |0010 = GPD.2 wake-up function enabled. - * | | |0011 = GPD.3 wake-up function enabled. - * | | |0100 = GPD.4 wake-up function enabled. - * | | |0101 = GPD.5 wake-up function enabled. - * | | |0110 = GPD.6 wake-up function enabled. - * | | |0111 = GPD.7 wake-up function enabled. - * | | |1000 = GPD.8 wake-up function enabled. - * | | |1001 = GPD.9 wake-up function enabled. - * | | |1010 = GPD.10 wake-up function enabled. - * | | |1011 = GPD.11 wake-up function enabled. - * | | |1100 = GPD.12 wake-up function enabled. - * | | |1101 = Reserved. - * | | |1110 = GPD.14 wake-up function enabled. - * | | |1111 = Reserved. - * |[8] |DBEN |GPD Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wakeup. - * | | |The de-bounce clock source is the 32 kHz internal low speed RC oscillator (LIRC). - * | | |0 = Standby power-down wake-up pin De-bounce function Disable. - * | | |1 = Standby power-down wake-up pin De-bounce function Enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::IOPDCTL - * Offset: 0xB0 GPIO Standby Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IOHR |GPIO Hold Release - * | | |When GPIO enter standby power-down mode, all I/O status are hold to keep normal operating status. - * | | |After chip was waked up from standby Power-down mode, the I/O still keeps hold status until user sets this bit to release I/O hold status. - * | | |Note: This bit is auto cleared by hardware. - * @var CLK_T::HXTFSEL - * Offset: 0xB4 HXT Filter Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFSEL |HXT Filter Select - * | | |0 = HXT frequency is > 12MHz. - * | | |1 = HXT frequency is <= 12MHz. - * | | |Note: This bit is auto cleared by hardware. - */ - - - __IO uint32_t PWRCTL; /*!< [0x0000] System Power-down Control Register */ - __IO uint32_t AHBCLK; /*!< [0x0004] AHB Devices Clock Enable Control Register */ - __IO uint32_t APBCLK0; /*!< [0x0008] APB Devices Clock Enable Control Register 0 */ - __IO uint32_t APBCLK1; /*!< [0x000C] APB Devices Clock Enable Control Register 1 */ - __IO uint32_t CLKSEL0; /*!< [0x0010] Clock Source Select Control Register 0 */ - __IO uint32_t CLKSEL1; /*!< [0x0014] Clock Source Select Control Register 1 */ - __IO uint32_t CLKSEL2; /*!< [0x0018] Clock Source Select Control Register 2 */ - __IO uint32_t CLKSEL3; /*!< [0x001C] Clock Source Select Control Register 3 */ - __IO uint32_t CLKDIV0; /*!< [0x0020] Clock Divider Number Register 0 */ - __IO uint32_t CLKDIV1; /*!< [0x0024] Clock Divider Number Register 1 */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CLKDIV4; /*!< [0x0030] Clock Divider Number Register 4 */ - __I uint32_t RESERVE7[1]; - __I uint32_t RESERVE1[2]; - __IO uint32_t PLLCTL; /*!< [0x0040] PLL Control Register */ - __I uint32_t RESERVE2[3]; - __I uint32_t STATUS; /*!< [0x0050] Clock Status Monitor Register */ - __I uint32_t RESERVE3[3]; - __IO uint32_t CLKOCTL; /*!< [0x0060] Clock Output Control Register */ - __I uint32_t RESERVE4[3]; - __IO uint32_t CLKDCTL; /*!< [0x0070] Clock Fail Detector Control Register */ - __IO uint32_t CLKDSTS; /*!< [0x0074] Clock Fail Detector Status Register */ - __IO uint32_t CDUPB; /*!< [0x0078] Clock Frequency Detector Upper Boundary Register */ - __IO uint32_t CDLOWB; /*!< [0x007C] Clock Frequency Detector Low Boundary Register */ - __I uint32_t RESERVE5[4]; - __IO uint32_t PMUCTL; /*!< [0x0090] Power Manager Control Register */ - __IO uint32_t PMUSTS; /*!< [0x0094] Power Manager Status Register */ - __I uint32_t RESERVE6[1]; - __IO uint32_t SWKDBCTL; /*!< [0x009C] Standby Power-down Wake-up De-bounce Control Register */ - __IO uint32_t PASWKCTL; /*!< [0x00A0] GPA Standby Power-down Wake-up Control Register */ - __IO uint32_t PBSWKCTL; /*!< [0x00A4] GPB Standby Power-down Wake-up Control Register */ - __IO uint32_t PCSWKCTL; /*!< [0x00A8] GPC Standby Power-down Wake-up Control Register */ - __IO uint32_t PDSWKCTL; /*!< [0x00AC] GPD Standby Power-down Wake-up Control Register */ - __IO uint32_t IOPDCTL; /*!< [0x00B0] GPIO Standby Power-down Control Register */ - __IO uint32_t HXTFSEL; /*!< [0x00B4] HXT Filter Select Control Register */ - -} CLK_T; - -/** - @addtogroup CLK_CONST CLK Bit Field Definition - Constant Definitions for CLK Controller - @{ -*/ - -#define CLK_PWRCTL_HXTEN_Pos (0) /*!< CLK_T::PWRCTL: HXTEN Position */ -#define CLK_PWRCTL_HXTEN_Msk (0x1ul << CLK_PWRCTL_HXTEN_Pos) /*!< CLK_T::PWRCTL: HXTEN Mask */ - -#define CLK_PWRCTL_LXTEN_Pos (1) /*!< CLK_T::PWRCTL: LXTEN Position */ -#define CLK_PWRCTL_LXTEN_Msk (0x1ul << CLK_PWRCTL_LXTEN_Pos) /*!< CLK_T::PWRCTL: LXTEN Mask */ - -#define CLK_PWRCTL_HIRCEN_Pos (2) /*!< CLK_T::PWRCTL: HIRCEN Position */ -#define CLK_PWRCTL_HIRCEN_Msk (0x1ul << CLK_PWRCTL_HIRCEN_Pos) /*!< CLK_T::PWRCTL: HIRCEN Mask */ - -#define CLK_PWRCTL_LIRCEN_Pos (3) /*!< CLK_T::PWRCTL: LIRCEN Position */ -#define CLK_PWRCTL_LIRCEN_Msk (0x1ul << CLK_PWRCTL_LIRCEN_Pos) /*!< CLK_T::PWRCTL: LIRCEN Mask */ - -#define CLK_PWRCTL_PDWKIEN_Pos (5) /*!< CLK_T::PWRCTL: PDWKIEN Position */ -#define CLK_PWRCTL_PDWKIEN_Msk (0x1ul << CLK_PWRCTL_PDWKIEN_Pos) /*!< CLK_T::PWRCTL: PDWKIEN Mask */ - -#define CLK_PWRCTL_PDWKIF_Pos (6) /*!< CLK_T::PWRCTL: PDWKIF Position */ -#define CLK_PWRCTL_PDWKIF_Msk (0x1ul << CLK_PWRCTL_PDWKIF_Pos) /*!< CLK_T::PWRCTL: PDWKIF Mask */ - -#define CLK_PWRCTL_PDEN_Pos (7) /*!< CLK_T::PWRCTL: PDEN Position */ -#define CLK_PWRCTL_PDEN_Msk (0x1ul << CLK_PWRCTL_PDEN_Pos) /*!< CLK_T::PWRCTL: PDEN Mask */ - -#define CLK_PWRCTL_HXTGAIN_Pos (10) /*!< CLK_T::PWRCTL: HXTGAIN Position */ -#define CLK_PWRCTL_HXTGAIN_Msk (0x3ul << CLK_PWRCTL_HXTGAIN_Pos) /*!< CLK_T::PWRCTL: HXTGAIN Mask */ - -#define CLK_PWRCTL_HXTSELTYP_Pos (12) /*!< CLK_T::PWRCTL: HXTSELTYP Position */ -#define CLK_PWRCTL_HXTSELTYP_Msk (0x1ul << CLK_PWRCTL_HXTSELTYP_Pos) /*!< CLK_T::PWRCTL: HXTSELTYP Mask */ - -#define CLK_PWRCTL_HXTTBEN_Pos (13) /*!< CLK_T::PWRCTL: HXTTBEN Position */ -#define CLK_PWRCTL_HXTTBEN_Msk (0x1ul << CLK_PWRCTL_HXTTBEN_Pos) /*!< CLK_T::PWRCTL: HXTTBEN Mask */ - -#define CLK_PWRCTL_HIRC48EN_Pos (18) /*!< CLK_T::PWRCTL: HIRC48EN Position */ -#define CLK_PWRCTL_HIRC48EN_Msk (0x1ul << CLK_PWRCTL_HIRC48EN_Pos) /*!< CLK_T::PWRCTL: HIRC48EN Mask */ - -#define CLK_PWRCTL_MIRC1P2MEN_Pos (20) /*!< CLK_T::PWRCTL: MIRC1P2MEN Position */ -#define CLK_PWRCTL_MIRC1P2MEN_Msk (0x1ul << CLK_PWRCTL_MIRC1P2MEN_Pos) /*!< CLK_T::PWRCTL: MIRC1P2MEN Mask */ - -#define CLK_PWRCTL_MIRCEN_Pos (21) /*!< CLK_T::PWRCTL: MIRCEN Position */ -#define CLK_PWRCTL_MIRCEN_Msk (0x1ul << CLK_PWRCTL_MIRCEN_Pos) /*!< CLK_T::PWRCTL: MIRCEN Mask */ - -#define CLK_AHBCLK_PDMA0CKEN_Pos (0) /*!< CLK_T::AHBCLK: PDMA0CKEN Position */ -#define CLK_AHBCLK_PDMA0CKEN_Msk (0x1ul << CLK_AHBCLK_PDMA0CKEN_Pos) /*!< CLK_T::AHBCLK: PDMA0CKEN Mask */ - -#define CLK_AHBCLK_PDMA1CKEN_Pos (1) /*!< CLK_T::AHBCLK: PDMA1CKEN Position */ -#define CLK_AHBCLK_PDMA1CKEN_Msk (0x1ul << CLK_AHBCLK_PDMA1CKEN_Pos) /*!< CLK_T::AHBCLK: PDMA1CKEN Mask */ - -#define CLK_AHBCLK_ISPCKEN_Pos (2) /*!< CLK_T::AHBCLK: ISPCKEN Position */ -#define CLK_AHBCLK_ISPCKEN_Msk (0x1ul << CLK_AHBCLK_ISPCKEN_Pos) /*!< CLK_T::AHBCLK: ISPCKEN Mask */ - -#define CLK_AHBCLK_EBICKEN_Pos (3) /*!< CLK_T::AHBCLK: EBICKEN Position */ -#define CLK_AHBCLK_EBICKEN_Msk (0x1ul << CLK_AHBCLK_EBICKEN_Pos) /*!< CLK_T::AHBCLK: EBICKEN Mask */ - -#define CLK_AHBCLK_EXSTCKEN_Pos (4) /*!< CLK_T::AHBCLK: EXSTCKEN Position */ -#define CLK_AHBCLK_EXSTCKEN_Msk (0x1ul << CLK_AHBCLK_EXSTCKEN_Pos) /*!< CLK_T::AHBCLK: EXSTCKEN Mask */ - -#define CLK_AHBCLK_SDH0CKEN_Pos (6) /*!< CLK_T::AHBCLK: SDH0CKEN Position */ -#define CLK_AHBCLK_SDH0CKEN_Msk (0x1ul << CLK_AHBCLK_SDH0CKEN_Pos) /*!< CLK_T::AHBCLK: SDH0CKEN Mask */ - -#define CLK_AHBCLK_CRCCKEN_Pos (7) /*!< CLK_T::AHBCLK: CRCCKEN Position */ -#define CLK_AHBCLK_CRCCKEN_Msk (0x1ul << CLK_AHBCLK_CRCCKEN_Pos) /*!< CLK_T::AHBCLK: CRCCKEN Mask */ - -#define CLK_AHBCLK_CRPTCKEN_Pos (12) /*!< CLK_T::AHBCLK: CRPTCKEN Position */ -#define CLK_AHBCLK_CRPTCKEN_Msk (0x1ul << CLK_AHBCLK_CRPTCKEN_Pos) /*!< CLK_T::AHBCLK: CRPTCKEN Mask */ - -#define CLK_AHBCLK_KSCKEN_Pos (13) /*!< CLK_T::AHBCLK: KSCKEN Position */ -#define CLK_AHBCLK_KSCKEN_Msk (0x1ul << CLK_AHBCLK_KSCKEN_Pos) /*!< CLK_T::AHBCLK: KSCKEN Mask */ - -#define CLK_AHBCLK_TRACECKEN_Pos (14) /*!< CLK_T::AHBCLK: TRACECKEN Position */ -#define CLK_AHBCLK_TRACECKEN_Msk (0x1ul << CLK_AHBCLK_TRACECKEN_Pos) /*!< CLK_T::AHBCLK: TRACECKEN Mask */ - -#define CLK_AHBCLK_FMCIDLE_Pos (15) /*!< CLK_T::AHBCLK: FMCIDLE Position */ -#define CLK_AHBCLK_FMCIDLE_Msk (0x1ul << CLK_AHBCLK_FMCIDLE_Pos) /*!< CLK_T::AHBCLK: FMCIDLE Mask */ - -#define CLK_AHBCLK_USBHCKEN_Pos (16) /*!< CLK_T::AHBCLK: USBHCKEN Position */ -#define CLK_AHBCLK_USBHCKEN_Msk (0x1ul << CLK_AHBCLK_USBHCKEN_Pos) /*!< CLK_T::AHBCLK: USBHCKEN Mask */ - -#define CLK_AHBCLK_SRAM0CKEN_Pos (20) /*!< CLK_T::AHBCLK: SRAM0CKEN Position */ -#define CLK_AHBCLK_SRAM0CKEN_Msk (0x1ul << CLK_AHBCLK_SRAM0CKEN_Pos) /*!< CLK_T::AHBCLK: SRAM0CKEN Mask */ - -#define CLK_AHBCLK_SRAM1CKEN_Pos (21) /*!< CLK_T::AHBCLK: SRAM1CKEN Position */ -#define CLK_AHBCLK_SRAM1CKEN_Msk (0x1ul << CLK_AHBCLK_SRAM1CKEN_Pos) /*!< CLK_T::AHBCLK: SRAM1CKEN Mask */ - -#define CLK_AHBCLK_SRAM2CKEN_Pos (22) /*!< CLK_T::AHBCLK: SRAM2CKEN Position */ -#define CLK_AHBCLK_SRAM2CKEN_Msk (0x1ul << CLK_AHBCLK_SRAM2CKEN_Pos) /*!< CLK_T::AHBCLK: SRAM2CKEN Mask */ - -#define CLK_AHBCLK_GPACKEN_Pos (24) /*!< CLK_T::AHBCLK: GPACKEN Position */ -#define CLK_AHBCLK_GPACKEN_Msk (0x1ul << CLK_AHBCLK_GPACKEN_Pos) /*!< CLK_T::AHBCLK: GPACKEN Mask */ - -#define CLK_AHBCLK_GPBCKEN_Pos (25) /*!< CLK_T::AHBCLK: GPBCKEN Position */ -#define CLK_AHBCLK_GPBCKEN_Msk (0x1ul << CLK_AHBCLK_GPBCKEN_Pos) /*!< CLK_T::AHBCLK: GPBCKEN Mask */ - -#define CLK_AHBCLK_GPCCKEN_Pos (26) /*!< CLK_T::AHBCLK: GPCCKEN Position */ -#define CLK_AHBCLK_GPCCKEN_Msk (0x1ul << CLK_AHBCLK_GPCCKEN_Pos) /*!< CLK_T::AHBCLK: GPCCKEN Mask */ - -#define CLK_AHBCLK_GPDCKEN_Pos (27) /*!< CLK_T::AHBCLK: GPDCKEN Position */ -#define CLK_AHBCLK_GPDCKEN_Msk (0x1ul << CLK_AHBCLK_GPDCKEN_Pos) /*!< CLK_T::AHBCLK: GPDCKEN Mask */ - -#define CLK_AHBCLK_GPECKEN_Pos (28) /*!< CLK_T::AHBCLK: GPECKEN Position */ -#define CLK_AHBCLK_GPECKEN_Msk (0x1ul << CLK_AHBCLK_GPECKEN_Pos) /*!< CLK_T::AHBCLK: GPECKEN Mask */ - -#define CLK_AHBCLK_GPFCKEN_Pos (29) /*!< CLK_T::AHBCLK: GPFCKEN Position */ -#define CLK_AHBCLK_GPFCKEN_Msk (0x1ul << CLK_AHBCLK_GPFCKEN_Pos) /*!< CLK_T::AHBCLK: GPFCKEN Mask */ - -#define CLK_AHBCLK_GPGCKEN_Pos (30) /*!< CLK_T::AHBCLK: GPGCKEN Position */ -#define CLK_AHBCLK_GPGCKEN_Msk (0x1ul << CLK_AHBCLK_GPGCKEN_Pos) /*!< CLK_T::AHBCLK: GPGCKEN Mask */ - -#define CLK_AHBCLK_GPHCKEN_Pos (31) /*!< CLK_T::AHBCLK: GPHCKEN Position */ -#define CLK_AHBCLK_GPHCKEN_Msk (0x1ul << CLK_AHBCLK_GPHCKEN_Pos) /*!< CLK_T::AHBCLK: GPHCKEN Mask */ - -#define CLK_APBCLK0_WDTCKEN_Pos (0) /*!< CLK_T::APBCLK0: WDTCKEN Position */ -#define CLK_APBCLK0_WDTCKEN_Msk (0x1ul << CLK_APBCLK0_WDTCKEN_Pos) /*!< CLK_T::APBCLK0: WDTCKEN Mask */ - -#define CLK_APBCLK0_RTCCKEN_Pos (1) /*!< CLK_T::APBCLK0: RTCCKEN Position */ -#define CLK_APBCLK0_RTCCKEN_Msk (0x1ul << CLK_APBCLK0_RTCCKEN_Pos) /*!< CLK_T::APBCLK0: RTCCKEN Mask */ - -#define CLK_APBCLK0_TMR0CKEN_Pos (2) /*!< CLK_T::APBCLK0: TMR0CKEN Position */ -#define CLK_APBCLK0_TMR0CKEN_Msk (0x1ul << CLK_APBCLK0_TMR0CKEN_Pos) /*!< CLK_T::APBCLK0: TMR0CKEN Mask */ - -#define CLK_APBCLK0_TMR1CKEN_Pos (3) /*!< CLK_T::APBCLK0: TMR1CKEN Position */ -#define CLK_APBCLK0_TMR1CKEN_Msk (0x1ul << CLK_APBCLK0_TMR1CKEN_Pos) /*!< CLK_T::APBCLK0: TMR1CKEN Mask */ - -#define CLK_APBCLK0_TMR2CKEN_Pos (4) /*!< CLK_T::APBCLK0: TMR2CKEN Position */ -#define CLK_APBCLK0_TMR2CKEN_Msk (0x1ul << CLK_APBCLK0_TMR2CKEN_Pos) /*!< CLK_T::APBCLK0: TMR2CKEN Mask */ - -#define CLK_APBCLK0_TMR3CKEN_Pos (5) /*!< CLK_T::APBCLK0: TMR3CKEN Position */ -#define CLK_APBCLK0_TMR3CKEN_Msk (0x1ul << CLK_APBCLK0_TMR3CKEN_Pos) /*!< CLK_T::APBCLK0: TMR3CKEN Mask */ - -#define CLK_APBCLK0_CLKOCKEN_Pos (6) /*!< CLK_T::APBCLK0: CLKOCKEN Position */ -#define CLK_APBCLK0_CLKOCKEN_Msk (0x1ul << CLK_APBCLK0_CLKOCKEN_Pos) /*!< CLK_T::APBCLK0: CLKOCKEN Mask */ - -#define CLK_APBCLK0_ACMP01CKEN_Pos (7) /*!< CLK_T::APBCLK0: ACMP01CKEN Position */ -#define CLK_APBCLK0_ACMP01CKEN_Msk (0x1ul << CLK_APBCLK0_ACMP01CKEN_Pos) /*!< CLK_T::APBCLK0: ACMP01CKEN Mask */ - -#define CLK_APBCLK0_I2C0CKEN_Pos (8) /*!< CLK_T::APBCLK0: I2C0CKEN Position */ -#define CLK_APBCLK0_I2C0CKEN_Msk (0x1ul << CLK_APBCLK0_I2C0CKEN_Pos) /*!< CLK_T::APBCLK0: I2C0CKEN Mask */ - -#define CLK_APBCLK0_I2C1CKEN_Pos (9) /*!< CLK_T::APBCLK0: I2C1CKEN Position */ -#define CLK_APBCLK0_I2C1CKEN_Msk (0x1ul << CLK_APBCLK0_I2C1CKEN_Pos) /*!< CLK_T::APBCLK0: I2C1CKEN Mask */ - -#define CLK_APBCLK0_I2C2CKEN_Pos (10) /*!< CLK_T::APBCLK0: I2C2CKEN Position */ -#define CLK_APBCLK0_I2C2CKEN_Msk (0x1ul << CLK_APBCLK0_I2C2CKEN_Pos) /*!< CLK_T::APBCLK0: I2C2CKEN Mask */ - -#define CLK_APBCLK0_QSPI0CKEN_Pos (12) /*!< CLK_T::APBCLK0: QSPI0CKEN Position */ -#define CLK_APBCLK0_QSPI0CKEN_Msk (0x1ul << CLK_APBCLK0_QSPI0CKEN_Pos) /*!< CLK_T::APBCLK0: QSPI0CKEN Mask */ - -#define CLK_APBCLK0_SPI0CKEN_Pos (13) /*!< CLK_T::APBCLK0: SPI0CKEN Position */ -#define CLK_APBCLK0_SPI0CKEN_Msk (0x1ul << CLK_APBCLK0_SPI0CKEN_Pos) /*!< CLK_T::APBCLK0: SPI0CKEN Mask */ - -#define CLK_APBCLK0_SPI1CKEN_Pos (14) /*!< CLK_T::APBCLK0: SPI1CKEN Position */ -#define CLK_APBCLK0_SPI1CKEN_Msk (0x1ul << CLK_APBCLK0_SPI1CKEN_Pos) /*!< CLK_T::APBCLK0: SPI1CKEN Mask */ - -#define CLK_APBCLK0_SPI2CKEN_Pos (15) /*!< CLK_T::APBCLK0: SPI2CKEN Position */ -#define CLK_APBCLK0_SPI2CKEN_Msk (0x1ul << CLK_APBCLK0_SPI2CKEN_Pos) /*!< CLK_T::APBCLK0: SPI2CKEN Mask */ - -#define CLK_APBCLK0_UART0CKEN_Pos (16) /*!< CLK_T::APBCLK0: UART0CKEN Position */ -#define CLK_APBCLK0_UART0CKEN_Msk (0x1ul << CLK_APBCLK0_UART0CKEN_Pos) /*!< CLK_T::APBCLK0: UART0CKEN Mask */ - -#define CLK_APBCLK0_UART1CKEN_Pos (17) /*!< CLK_T::APBCLK0: UART1CKEN Position */ -#define CLK_APBCLK0_UART1CKEN_Msk (0x1ul << CLK_APBCLK0_UART1CKEN_Pos) /*!< CLK_T::APBCLK0: UART1CKEN Mask */ - -#define CLK_APBCLK0_UART2CKEN_Pos (18) /*!< CLK_T::APBCLK0: UART2CKEN Position */ -#define CLK_APBCLK0_UART2CKEN_Msk (0x1ul << CLK_APBCLK0_UART2CKEN_Pos) /*!< CLK_T::APBCLK0: UART2CKEN Mask */ - -#define CLK_APBCLK0_UART3CKEN_Pos (19) /*!< CLK_T::APBCLK0: UART3CKEN Position */ -#define CLK_APBCLK0_UART3CKEN_Msk (0x1ul << CLK_APBCLK0_UART3CKEN_Pos) /*!< CLK_T::APBCLK0: UART3CKEN Mask */ - -#define CLK_APBCLK0_UART4CKEN_Pos (20) /*!< CLK_T::APBCLK0: UART4CKEN Position */ -#define CLK_APBCLK0_UART4CKEN_Msk (0x1ul << CLK_APBCLK0_UART4CKEN_Pos) /*!< CLK_T::APBCLK0: UART4CKEN Mask */ - -#define CLK_APBCLK0_UART5CKEN_Pos (21) /*!< CLK_T::APBCLK0: UART5CKEN Position */ -#define CLK_APBCLK0_UART5CKEN_Msk (0x1ul << CLK_APBCLK0_UART5CKEN_Pos) /*!< CLK_T::APBCLK0: UART5CKEN Mask */ - -#define CLK_APBCLK0_TAMPERCKEN_Pos (22) /*!< CLK_T::APBCLK0: TAMPERCKEN Position */ -#define CLK_APBCLK0_TAMPERCKEN_Msk (0x1ul << CLK_APBCLK0_TAMPERCKEN_Pos) /*!< CLK_T::APBCLK0: TAMPERCKEN Mask */ - -#define CLK_APBCLK0_CAN0CKEN_Pos (24) /*!< CLK_T::APBCLK0: CAN0CKEN Position */ -#define CLK_APBCLK0_CAN0CKEN_Msk (0x1ul << CLK_APBCLK0_CAN0CKEN_Pos) /*!< CLK_T::APBCLK0: CAN0CKEN Mask */ - -#define CLK_APBCLK0_OTGCKEN_Pos (26) /*!< CLK_T::APBCLK0: OTGCKEN Position */ -#define CLK_APBCLK0_OTGCKEN_Msk (0x1ul << CLK_APBCLK0_OTGCKEN_Pos) /*!< CLK_T::APBCLK0: OTGCKEN Mask */ - -#define CLK_APBCLK0_USBDCKEN_Pos (27) /*!< CLK_T::APBCLK0: USBDCKEN Position */ -#define CLK_APBCLK0_USBDCKEN_Msk (0x1ul << CLK_APBCLK0_USBDCKEN_Pos) /*!< CLK_T::APBCLK0: USBDCKEN Mask */ - -#define CLK_APBCLK0_USBDCKEN_Pos (27) /*!< CLK_T::APBCLK0: USBDCKEN Position */ -#define CLK_APBCLK0_USBDCKEN_Msk (0x1ul << CLK_APBCLK0_USBDCKEN_Pos) /*!< CLK_T::APBCLK0: USBDCKEN Mask */ - -#define CLK_APBCLK0_EADCCKEN_Pos (28) /*!< CLK_T::APBCLK0: EADCCKEN Position */ -#define CLK_APBCLK0_EADCCKEN_Msk (0x1ul << CLK_APBCLK0_EADCCKEN_Pos) /*!< CLK_T::APBCLK0: EADCCKEN Mask */ - -#define CLK_APBCLK0_I2S0CKEN_Pos (29) /*!< CLK_T::APBCLK0: I2S0CKEN Position */ -#define CLK_APBCLK0_I2S0CKEN_Msk (0x1ul << CLK_APBCLK0_I2S0CKEN_Pos) /*!< CLK_T::APBCLK0: I2S0CKEN Mask */ - -#define CLK_APBCLK0_EWDTCKEN_Pos (31) /*!< CLK_T::APBCLK0: EWDTCKEN Position */ -#define CLK_APBCLK0_EWDTCKEN_Msk (0x1ul << CLK_APBCLK0_EWDTCKEN_Pos) /*!< CLK_T::APBCLK0: EWDTCKEN Mask */ - -#define CLK_APBCLK1_SC0CKEN_Pos (0) /*!< CLK_T::APBCLK1: SC0CKEN Position */ -#define CLK_APBCLK1_SC0CKEN_Msk (0x1ul << CLK_APBCLK1_SC0CKEN_Pos) /*!< CLK_T::APBCLK1: SC0CKEN Mask */ - -#define CLK_APBCLK1_SC1CKEN_Pos (1) /*!< CLK_T::APBCLK1: SC1CKEN Position */ -#define CLK_APBCLK1_SC1CKEN_Msk (0x1ul << CLK_APBCLK1_SC1CKEN_Pos) /*!< CLK_T::APBCLK1: SC1CKEN Mask */ - -#define CLK_APBCLK1_SC2CKEN_Pos (2) /*!< CLK_T::APBCLK1: SC2CKEN Position */ -#define CLK_APBCLK1_SC2CKEN_Msk (0x1ul << CLK_APBCLK1_SC2CKEN_Pos) /*!< CLK_T::APBCLK1: SC2CKEN Mask */ - -#define CLK_APBCLK1_TMR4CKEN_Pos (4) /*!< CLK_T::APBCLK1: TMR4CKEN Position */ -#define CLK_APBCLK1_TMR4CKEN_Msk (0x1ul << CLK_APBCLK1_TMR4CKEN_Pos) /*!< CLK_T::APBCLK1: TMR4CKEN Mask */ - -#define CLK_APBCLK1_TMR5CKEN_Pos (5) /*!< CLK_T::APBCLK1: TMR5CKEN Position */ -#define CLK_APBCLK1_TMR5CKEN_Msk (0x1ul << CLK_APBCLK1_TMR5CKEN_Pos) /*!< CLK_T::APBCLK1: TMR5CKEN Mask */ - -#define CLK_APBCLK1_SPI3CKEN_Pos (6) /*!< CLK_T::APBCLK1: SPI3CKEN Position */ -#define CLK_APBCLK1_SPI3CKEN_Msk (0x1ul << CLK_APBCLK1_SPI3CKEN_Pos) /*!< CLK_T::APBCLK1: SPI3CKEN Mask */ - -#define CLK_APBCLK1_USCI0CKEN_Pos (8) /*!< CLK_T::APBCLK1: USCI0CKEN Position */ -#define CLK_APBCLK1_USCI0CKEN_Msk (0x1ul << CLK_APBCLK1_USCI0CKEN_Pos) /*!< CLK_T::APBCLK1: USCI0CKEN Mask */ - -#define CLK_APBCLK1_USCI1CKEN_Pos (9) /*!< CLK_T::APBCLK1: USCI1CKEN Position */ -#define CLK_APBCLK1_USCI1CKEN_Msk (0x1ul << CLK_APBCLK1_USCI1CKEN_Pos) /*!< CLK_T::APBCLK1: USCI1CKEN Mask */ - -#define CLK_APBCLK1_DACCKEN_Pos (12) /*!< CLK_T::APBCLK1: DACCKEN Position */ -#define CLK_APBCLK1_DACCKEN_Msk (0x1ul << CLK_APBCLK1_DACCKEN_Pos) /*!< CLK_T::APBCLK1: DACCKEN Mask */ - -#define CLK_APBCLK1_EPWM0CKEN_Pos (16) /*!< CLK_T::APBCLK1: EPWM0CKEN Position */ -#define CLK_APBCLK1_EPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM0CKEN Mask */ - -#define CLK_APBCLK1_EPWM1CKEN_Pos (17) /*!< CLK_T::APBCLK1: EPWM1CKEN Position */ -#define CLK_APBCLK1_EPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM1CKEN Mask */ - -#define CLK_APBCLK1_BPWM0CKEN_Pos (18) /*!< CLK_T::APBCLK1: BPWM0CKEN Position */ -#define CLK_APBCLK1_BPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM0CKEN Mask */ - -#define CLK_APBCLK1_BPWM1CKEN_Pos (19) /*!< CLK_T::APBCLK1: BPWM1CKEN Position */ -#define CLK_APBCLK1_BPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM1CKEN Mask */ - -#define CLK_APBCLK1_QEI0CKEN_Pos (22) /*!< CLK_T::APBCLK1: QEI0CKEN Position */ -#define CLK_APBCLK1_QEI0CKEN_Msk (0x1ul << CLK_APBCLK1_QEI0CKEN_Pos) /*!< CLK_T::APBCLK1: QEI0CKEN Mask */ - -#define CLK_APBCLK1_QEI1CKEN_Pos (23) /*!< CLK_T::APBCLK1: QEI1CKEN Position */ -#define CLK_APBCLK1_QEI1CKEN_Msk (0x1ul << CLK_APBCLK1_QEI1CKEN_Pos) /*!< CLK_T::APBCLK1: QEI1CKEN Mask */ - -#define CLK_APBCLK1_LCDCKEN_Pos (24) /*!< CLK_T::APBCLK1: LCDCKEN Position */ -#define CLK_APBCLK1_LCDCKEN_Msk (0x1ul << CLK_APBCLK1_LCDCKEN_Pos) /*!< CLK_T::APBCLK1: LCKCKEN Mask */ - -#define CLK_APBCLK1_TRNGCKEN_Pos (25) /*!< CLK_T::APBCLK1: TRNGCKEN Position */ -#define CLK_APBCLK1_TRNGCKEN_Msk (0x1ul << CLK_APBCLK1_TRNGCKEN_Pos) /*!< CLK_T::APBCLK1: TRNGCKEN Mask */ - -#define CLK_APBCLK1_ECAP0CKEN_Pos (26) /*!< CLK_T::APBCLK1: ECAP0CKEN Position */ -#define CLK_APBCLK1_ECAP0CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP0CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP0CKEN Mask */ - -#define CLK_APBCLK1_ECAP1CKEN_Pos (27) /*!< CLK_T::APBCLK1: ECAP1CKEN Position */ -#define CLK_APBCLK1_ECAP1CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP1CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP1CKEN Mask */ - -#define CLK_APBCLK1_LCDCPCKEN_Pos (28) /*!< CLK_T::APBCLK1: LCDCPCKEN Position */ -#define CLK_APBCLK1_LCDCPCKEN_Msk (0x1ul << CLK_APBCLK1_LCDCPCKEN_Pos) /*!< CLK_T::APBCLK1: LCDCPCKEN Mask */ - -#define CLK_CLKSEL0_HCLKSEL_Pos (0) /*!< CLK_T::CLKSEL0: HCLKSEL Position */ -#define CLK_CLKSEL0_HCLKSEL_Msk (0x7ul << CLK_CLKSEL0_HCLKSEL_Pos) /*!< CLK_T::CLKSEL0: HCLKSEL Mask */ - -#define CLK_CLKSEL0_STCLKSEL_Pos (3) /*!< CLK_T::CLKSEL0: STCLKSEL Position */ -#define CLK_CLKSEL0_STCLKSEL_Msk (0x7ul << CLK_CLKSEL0_STCLKSEL_Pos) /*!< CLK_T::CLKSEL0: STCLKSEL Mask */ - -#define CLK_CLKSEL0_USBSEL_Pos (8) /*!< CLK_T::CLKSEL0: USBSEL Position */ -#define CLK_CLKSEL0_USBSEL_Msk (0x1ul << CLK_CLKSEL0_USBSEL_Pos) /*!< CLK_T::CLKSEL0: USBSEL Mask */ - -#define CLK_CLKSEL0_SDH0SEL_Pos (20) /*!< CLK_T::CLKSEL0: SDH0SEL Position */ -#define CLK_CLKSEL0_SDH0SEL_Msk (0x3ul << CLK_CLKSEL0_SDH0SEL_Pos) /*!< CLK_T::CLKSEL0: SDH0SEL Mask */ - -#define CLK_CLKSEL1_WDTSEL_Pos (0) /*!< CLK_T::CLKSEL1: WDTSEL Position */ -#define CLK_CLKSEL1_WDTSEL_Msk (0x3ul << CLK_CLKSEL1_WDTSEL_Pos) /*!< CLK_T::CLKSEL1: WDTSEL Mask */ - -#define CLK_CLKSEL1_LCDSEL_Pos (2) /*!< CLK_T::CLKSEL1: LCDSEL Position */ -#define CLK_CLKSEL1_LCDSEL_Msk (0x1ul << CLK_CLKSEL1_LCDSEL_Pos) /*!< CLK_T::CLKSEL1: LCDSEL Mask */ - -#define CLK_CLKSEL1_LCDCPSEL_Pos (3) /*!< CLK_T::CLKSEL1: LCDCPSEL Position */ -#define CLK_CLKSEL1_LCDCPSEL_Msk (0x1ul << CLK_CLKSEL1_LCDCPSEL_Pos) /*!< CLK_T::CLKSEL1: LCDCPSEL Mask */ - -#define CLK_CLKSEL1_EWDTSEL_Pos (4) /*!< CLK_T::CLKSEL1: EWDTSEL Position */ -#define CLK_CLKSEL1_EWDTSEL_Msk (0x3ul << CLK_CLKSEL1_EWDTSEL_Pos) /*!< CLK_T::CLKSEL1: EWDTSEL Mask */ - -#define CLK_CLKSEL1_EWWDTSEL_Pos (6) /*!< CLK_T::CLKSEL1: EWWDTSEL Position */ -#define CLK_CLKSEL1_EWWDTSEL_Msk (0x3ul << CLK_CLKSEL1_EWWDTSEL_Pos) /*!< CLK_T::CLKSEL1: EWWDTSEL Mask */ - -#define CLK_CLKSEL1_TMR0SEL_Pos (8) /*!< CLK_T::CLKSEL1: TMR0SEL Position */ -#define CLK_CLKSEL1_TMR0SEL_Msk (0x7ul << CLK_CLKSEL1_TMR0SEL_Pos) /*!< CLK_T::CLKSEL1: TMR0SEL Mask */ - -#define CLK_CLKSEL1_TMR1SEL_Pos (12) /*!< CLK_T::CLKSEL1: TMR1SEL Position */ -#define CLK_CLKSEL1_TMR1SEL_Msk (0x7ul << CLK_CLKSEL1_TMR1SEL_Pos) /*!< CLK_T::CLKSEL1: TMR1SEL Mask */ - -#define CLK_CLKSEL1_TMR2SEL_Pos (16) /*!< CLK_T::CLKSEL1: TMR2SEL Position */ -#define CLK_CLKSEL1_TMR2SEL_Msk (0x7ul << CLK_CLKSEL1_TMR2SEL_Pos) /*!< CLK_T::CLKSEL1: TMR2SEL Mask */ - -#define CLK_CLKSEL1_TMR3SEL_Pos (20) /*!< CLK_T::CLKSEL1: TMR3SEL Position */ -#define CLK_CLKSEL1_TMR3SEL_Msk (0x7ul << CLK_CLKSEL1_TMR3SEL_Pos) /*!< CLK_T::CLKSEL1: TMR3SEL Mask */ - -#define CLK_CLKSEL1_CLKOSEL_Pos (28) /*!< CLK_T::CLKSEL1: CLKOSEL Position */ -#define CLK_CLKSEL1_CLKOSEL_Msk (0x3ul << CLK_CLKSEL1_CLKOSEL_Pos) /*!< CLK_T::CLKSEL1: CLKOSEL Mask */ - -#define CLK_CLKSEL1_WWDTSEL_Pos (30) /*!< CLK_T::CLKSEL1: WWDTSEL Position */ -#define CLK_CLKSEL1_WWDTSEL_Msk (0x3ul << CLK_CLKSEL1_WWDTSEL_Pos) /*!< CLK_T::CLKSEL1: WWDTSEL Mask */ - -#define CLK_CLKSEL2_EPWM0SEL_Pos (0) /*!< CLK_T::CLKSEL2: EPWM0SEL Position */ -#define CLK_CLKSEL2_EPWM0SEL_Msk (0x1ul << CLK_CLKSEL2_EPWM0SEL_Pos) /*!< CLK_T::CLKSEL2: EPWM0SEL Mask */ - -#define CLK_CLKSEL2_EPWM1SEL_Pos (1) /*!< CLK_T::CLKSEL2: EPWM1SEL Position */ -#define CLK_CLKSEL2_EPWM1SEL_Msk (0x1ul << CLK_CLKSEL2_EPWM1SEL_Pos) /*!< CLK_T::CLKSEL2: EPWM1SEL Mask */ - -#define CLK_CLKSEL2_QSPI0SEL_Pos (2) /*!< CLK_T::CLKSEL2: QSPI0SEL Position */ -#define CLK_CLKSEL2_QSPI0SEL_Msk (0x3ul << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< CLK_T::CLKSEL2: QSPI0SEL Mask */ - -#define CLK_CLKSEL2_SPI0SEL_Pos (4) /*!< CLK_T::CLKSEL2: SPI0SEL Position */ -#define CLK_CLKSEL2_SPI0SEL_Msk (0x3ul << CLK_CLKSEL2_SPI0SEL_Pos) /*!< CLK_T::CLKSEL2: SPI0SEL Mask */ - -#define CLK_CLKSEL2_SPI1SEL_Pos (6) /*!< CLK_T::CLKSEL2: SPI1SEL Position */ -#define CLK_CLKSEL2_SPI1SEL_Msk (0x3ul << CLK_CLKSEL2_SPI1SEL_Pos) /*!< CLK_T::CLKSEL2: SPI1SEL Mask */ - -#define CLK_CLKSEL2_SPI2SEL_Pos (10) /*!< CLK_T::CLKSEL2: SPI2SEL Position */ -#define CLK_CLKSEL2_SPI2SEL_Msk (0x3ul << CLK_CLKSEL2_SPI2SEL_Pos) /*!< CLK_T::CLKSEL2: SPI2SEL Mask */ - -#define CLK_CLKSEL2_BPWM0SEL_Pos (8) /*!< CLK_T::CLKSEL2: BPWM0SEL Position */ -#define CLK_CLKSEL2_BPWM0SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM0SEL Mask */ - -#define CLK_CLKSEL2_BPWM1SEL_Pos (9) /*!< CLK_T::CLKSEL2: BPWM1SEL Position */ -#define CLK_CLKSEL2_BPWM1SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM1SEL Mask */ - -#define CLK_CLKSEL2_SPI3SEL_Pos (12) /*!< CLK_T::CLKSEL2: SPI3SEL Position */ -#define CLK_CLKSEL2_SPI3SEL_Msk (0x3ul << CLK_CLKSEL2_SPI3SEL_Pos) /*!< CLK_T::CLKSEL2: SPI3SEL Mask */ - -#define CLK_CLKSEL2_UART0SEL_Pos (16) /*!< CLK_T::CLKSEL2: UART0SEL Position */ -#define CLK_CLKSEL2_UART0SEL_Msk (0x7ul << CLK_CLKSEL2_UART0SEL_Pos) /*!< CLK_T::CLKSEL2: UART0SEL Mask */ - -#define CLK_CLKSEL2_UART1SEL_Pos (20) /*!< CLK_T::CLKSEL2: UART1SEL Position */ -#define CLK_CLKSEL2_UART1SEL_Msk (0x7ul << CLK_CLKSEL2_UART1SEL_Pos) /*!< CLK_T::CLKSEL2: UART1SEL Mask */ - -#define CLK_CLKSEL2_UART2SEL_Pos (24) /*!< CLK_T::CLKSEL2: UART2SEL Position */ -#define CLK_CLKSEL2_UART2SEL_Msk (0x7ul << CLK_CLKSEL2_UART2SEL_Pos) /*!< CLK_T::CLKSEL2: UART2SEL Mask */ - -#define CLK_CLKSEL2_UART3SEL_Pos (28) /*!< CLK_T::CLKSEL2: UART3SEL Position */ -#define CLK_CLKSEL2_UART3SEL_Msk (0x7ul << CLK_CLKSEL2_UART3SEL_Pos) /*!< CLK_T::CLKSEL2: UART3SEL Mask */ - -#define CLK_CLKSEL3_SC0SEL_Pos (0) /*!< CLK_T::CLKSEL3: SC0SEL Position */ -#define CLK_CLKSEL3_SC0SEL_Msk (0x3ul << CLK_CLKSEL3_SC0SEL_Pos) /*!< CLK_T::CLKSEL3: SC0SEL Mask */ - -#define CLK_CLKSEL3_SC1SEL_Pos (2) /*!< CLK_T::CLKSEL3: SC1SEL Position */ -#define CLK_CLKSEL3_SC1SEL_Msk (0x3ul << CLK_CLKSEL3_SC1SEL_Pos) /*!< CLK_T::CLKSEL3: SC1SEL Mask */ - -#define CLK_CLKSEL3_SC2SEL_Pos (4) /*!< CLK_T::CLKSEL3: SC2SEL Position */ -#define CLK_CLKSEL3_SC2SEL_Msk (0x3ul << CLK_CLKSEL3_SC2SEL_Pos) /*!< CLK_T::CLKSEL3: SC2SEL Mask */ - -#define CLK_CLKSEL3_TMR4SEL_Pos (8) /*!< CLK_T::CLKSEL3: TMR4SEL Position */ -#define CLK_CLKSEL3_TMR4SEL_Msk (0x7ul << CLK_CLKSEL3_TMR4SEL_Pos) /*!< CLK_T::CLKSEL3: TMR4SEL Mask */ - -#define CLK_CLKSEL3_TMR5SEL_Pos (12) /*!< CLK_T::CLKSEL3: TMR5SEL Position */ -#define CLK_CLKSEL3_TMR5SEL_Msk (0x7ul << CLK_CLKSEL3_TMR5SEL_Pos) /*!< CLK_T::CLKSEL3: TMR5SEL Mask */ - -#define CLK_CLKSEL3_I2S0SEL_Pos (16) /*!< CLK_T::CLKSEL3: I2S0SEL Position */ -#define CLK_CLKSEL3_I2S0SEL_Msk (0x3ul << CLK_CLKSEL3_I2S0SEL_Pos) /*!< CLK_T::CLKSEL3: I2S0SEL Mask */ - -#define CLK_CLKSEL3_UART4SEL_Pos (24) /*!< CLK_T::CLKSEL3: UART4SEL Position */ -#define CLK_CLKSEL3_UART4SEL_Msk (0x7ul << CLK_CLKSEL3_UART4SEL_Pos) /*!< CLK_T::CLKSEL3: UART4SEL Mask */ - -#define CLK_CLKSEL3_UART5SEL_Pos (28) /*!< CLK_T::CLKSEL3: UART5SEL Position */ -#define CLK_CLKSEL3_UART5SEL_Msk (0x7ul << CLK_CLKSEL3_UART5SEL_Pos) /*!< CLK_T::CLKSEL3: UART5SEL Mask */ - -#define CLK_CLKDIV0_HCLKDIV_Pos (0) /*!< CLK_T::CLKDIV0: HCLKDIV Position */ -#define CLK_CLKDIV0_HCLKDIV_Msk (0xful << CLK_CLKDIV0_HCLKDIV_Pos) /*!< CLK_T::CLKDIV0: HCLKDIV Mask */ - -#define CLK_CLKDIV0_USBDIV_Pos (4) /*!< CLK_T::CLKDIV0: USBDIV Position */ -#define CLK_CLKDIV0_USBDIV_Msk (0xful << CLK_CLKDIV0_USBDIV_Pos) /*!< CLK_T::CLKDIV0: USBDIV Mask */ - -#define CLK_CLKDIV0_UART0DIV_Pos (8) /*!< CLK_T::CLKDIV0: UART0DIV Position */ -#define CLK_CLKDIV0_UART0DIV_Msk (0xful << CLK_CLKDIV0_UART0DIV_Pos) /*!< CLK_T::CLKDIV0: UART0DIV Mask */ - -#define CLK_CLKDIV0_UART1DIV_Pos (12) /*!< CLK_T::CLKDIV0: UART1DIV Position */ -#define CLK_CLKDIV0_UART1DIV_Msk (0xful << CLK_CLKDIV0_UART1DIV_Pos) /*!< CLK_T::CLKDIV0: UART1DIV Mask */ - -#define CLK_CLKDIV0_EADCDIV_Pos (16) /*!< CLK_T::CLKDIV0: EADCDIV Position */ -#define CLK_CLKDIV0_EADCDIV_Msk (0xfful << CLK_CLKDIV0_EADCDIV_Pos) /*!< CLK_T::CLKDIV0: EADCDIV Mask */ - -#define CLK_CLKDIV0_SDH0DIV_Pos (24) /*!< CLK_T::CLKDIV0: SDH0DIV Position */ -#define CLK_CLKDIV0_SDH0DIV_Msk (0xfful << CLK_CLKDIV0_SDH0DIV_Pos) /*!< CLK_T::CLKDIV0: SDH0DIV Mask */ - -#define CLK_CLKDIV1_SC0DIV_Pos (0) /*!< CLK_T::CLKDIV1: SC0DIV Position */ -#define CLK_CLKDIV1_SC0DIV_Msk (0xfful << CLK_CLKDIV1_SC0DIV_Pos) /*!< CLK_T::CLKDIV1: SC0DIV Mask */ - -#define CLK_CLKDIV1_SC1DIV_Pos (8) /*!< CLK_T::CLKDIV1: SC1DIV Position */ -#define CLK_CLKDIV1_SC1DIV_Msk (0xfful << CLK_CLKDIV1_SC1DIV_Pos) /*!< CLK_T::CLKDIV1: SC1DIV Mask */ - -#define CLK_CLKDIV1_SC2DIV_Pos (16) /*!< CLK_T::CLKDIV1: SC2DIV Position */ -#define CLK_CLKDIV1_SC2DIV_Msk (0xfful << CLK_CLKDIV1_SC2DIV_Pos) /*!< CLK_T::CLKDIV1: SC2DIV Mask */ - -#define CLK_CLKDIV4_UART2DIV_Pos (0) /*!< CLK_T::CLKDIV4: UART2DIV Position */ -#define CLK_CLKDIV4_UART2DIV_Msk (0xful << CLK_CLKDIV4_UART2DIV_Pos) /*!< CLK_T::CLKDIV4: UART2DIV Mask */ - -#define CLK_CLKDIV4_UART3DIV_Pos (4) /*!< CLK_T::CLKDIV4: UART3DIV Position */ -#define CLK_CLKDIV4_UART3DIV_Msk (0xful << CLK_CLKDIV4_UART3DIV_Pos) /*!< CLK_T::CLKDIV4: UART3DIV Mask */ - -#define CLK_CLKDIV4_UART4DIV_Pos (8) /*!< CLK_T::CLKDIV4: UART4DIV Position */ -#define CLK_CLKDIV4_UART4DIV_Msk (0xful << CLK_CLKDIV4_UART4DIV_Pos) /*!< CLK_T::CLKDIV4: UART4DIV Mask */ - -#define CLK_CLKDIV4_UART5DIV_Pos (12) /*!< CLK_T::CLKDIV4: UART5DIV Position */ -#define CLK_CLKDIV4_UART5DIV_Msk (0xful << CLK_CLKDIV4_UART5DIV_Pos) /*!< CLK_T::CLKDIV4: UART5DIV Mask */ - -#define CLK_PLLCTL_FBDIV_Pos (0) /*!< CLK_T::PLLCTL: FBDIV Position */ -#define CLK_PLLCTL_FBDIV_Msk (0x1fful << CLK_PLLCTL_FBDIV_Pos) /*!< CLK_T::PLLCTL: FBDIV Mask */ - -#define CLK_PLLCTL_INDIV_Pos (9) /*!< CLK_T::PLLCTL: INDIV Position */ -#define CLK_PLLCTL_INDIV_Msk (0x1ful << CLK_PLLCTL_INDIV_Pos) /*!< CLK_T::PLLCTL: INDIV Mask */ - -#define CLK_PLLCTL_OUTDIV_Pos (14) /*!< CLK_T::PLLCTL: OUTDIV Position */ -#define CLK_PLLCTL_OUTDIV_Msk (0x3ul << CLK_PLLCTL_OUTDIV_Pos) /*!< CLK_T::PLLCTL: OUTDIV Mask */ - -#define CLK_PLLCTL_PD_Pos (16) /*!< CLK_T::PLLCTL: PD Position */ -#define CLK_PLLCTL_PD_Msk (0x1ul << CLK_PLLCTL_PD_Pos) /*!< CLK_T::PLLCTL: PD Mask */ - -#define CLK_PLLCTL_BP_Pos (17) /*!< CLK_T::PLLCTL: BP Position */ -#define CLK_PLLCTL_BP_Msk (0x1ul << CLK_PLLCTL_BP_Pos) /*!< CLK_T::PLLCTL: BP Mask */ - -#define CLK_PLLCTL_PLLSRC_Pos (19) /*!< CLK_T::PLLCTL: PLLSRC Position */ -#define CLK_PLLCTL_PLLSRC_Msk (0x1ul << CLK_PLLCTL_PLLSRC_Pos) /*!< CLK_T::PLLCTL: PLLSRC Mask */ - -#define CLK_PLLCTL_STBSEL_Pos (23) /*!< CLK_T::PLLCTL: STBSEL Position */ -#define CLK_PLLCTL_STBSEL_Msk (0x1ul << CLK_PLLCTL_STBSEL_Pos) /*!< CLK_T::PLLCTL: STBSEL Mask */ - -#define CLK_STATUS_HXTSTB_Pos (0) /*!< CLK_T::STATUS: HXTSTB Position */ -#define CLK_STATUS_HXTSTB_Msk (0x1ul << CLK_STATUS_HXTSTB_Pos) /*!< CLK_T::STATUS: HXTSTB Mask */ - -#define CLK_STATUS_LXTSTB_Pos (1) /*!< CLK_T::STATUS: LXTSTB Position */ -#define CLK_STATUS_LXTSTB_Msk (0x1ul << CLK_STATUS_LXTSTB_Pos) /*!< CLK_T::STATUS: LXTSTB Mask */ - -#define CLK_STATUS_PLLSTB_Pos (2) /*!< CLK_T::STATUS: PLLSTB Position */ -#define CLK_STATUS_PLLSTB_Msk (0x1ul << CLK_STATUS_PLLSTB_Pos) /*!< CLK_T::STATUS: PLLSTB Mask */ - -#define CLK_STATUS_LIRCSTB_Pos (3) /*!< CLK_T::STATUS: LIRCSTB Position */ -#define CLK_STATUS_LIRCSTB_Msk (0x1ul << CLK_STATUS_LIRCSTB_Pos) /*!< CLK_T::STATUS: LIRCSTB Mask */ - -#define CLK_STATUS_HIRCSTB_Pos (4) /*!< CLK_T::STATUS: HIRCSTB Position */ -#define CLK_STATUS_HIRCSTB_Msk (0x1ul << CLK_STATUS_HIRCSTB_Pos) /*!< CLK_T::STATUS: HIRCSTB Mask */ - -#define CLK_STATUS_MIRCSTB_Pos (5) /*!< CLK_T::STATUS: MIRCSTB Position */ -#define CLK_STATUS_MIRCSTB_Msk (0x1ul << CLK_STATUS_MIRCSTB_Pos) /*!< CLK_T::STATUS: MIRCSTB Mask */ - -#define CLK_STATUS_HIRC48STB_Pos (6) /*!< CLK_T::STATUS: HIRC48STB Position */ -#define CLK_STATUS_HIRC48STB_Msk (0x1ul << CLK_STATUS_HIRC48STB_Pos) /*!< CLK_T::STATUS: HIRC48STB Mask */ - -#define CLK_STATUS_CLKSFAIL_Pos (7) /*!< CLK_T::STATUS: CLKSFAIL Position */ -#define CLK_STATUS_CLKSFAIL_Msk (0x1ul << CLK_STATUS_CLKSFAIL_Pos) /*!< CLK_T::STATUS: CLKSFAIL Mask */ - -#define CLK_STATUS_EXTLXTSTB_Pos (8) /*!< CLK_T::STATUS: EXTLXTSTB Position */ -#define CLK_STATUS_EXTLXTSTB_Msk (0x1ul << CLK_STATUS_EXTLXTSTB_Pos) /*!< CLK_T::STATUS: EXTLXTSTB Mask */ - -#define CLK_STATUS_LIRC32STB_Pos (9) /*!< CLK_T::STATUS: LIRC32STB Position */ -#define CLK_STATUS_LIRC32STB_Msk (0x1ul << CLK_STATUS_LIRC32STB_Pos) /*!< CLK_T::STATUS: LIRC32STB Mask */ - -#define CLK_CLKOCTL_FREQSEL_Pos (0) /*!< CLK_T::CLKOCTL: FREQSEL Position */ -#define CLK_CLKOCTL_FREQSEL_Msk (0xful << CLK_CLKOCTL_FREQSEL_Pos) /*!< CLK_T::CLKOCTL: FREQSEL Mask */ - -#define CLK_CLKOCTL_CLKOEN_Pos (4) /*!< CLK_T::CLKOCTL: CLKOEN Position */ -#define CLK_CLKOCTL_CLKOEN_Msk (0x1ul << CLK_CLKOCTL_CLKOEN_Pos) /*!< CLK_T::CLKOCTL: CLKOEN Mask */ - -#define CLK_CLKOCTL_DIV1EN_Pos (5) /*!< CLK_T::CLKOCTL: DIV1EN Position */ -#define CLK_CLKOCTL_DIV1EN_Msk (0x1ul << CLK_CLKOCTL_DIV1EN_Pos) /*!< CLK_T::CLKOCTL: DIV1EN Mask */ - -#define CLK_CLKOCTL_CLK1HZEN_Pos (6) /*!< CLK_T::CLKOCTL: CLK1HZEN Position */ -#define CLK_CLKOCTL_CLK1HZEN_Msk (0x1ul << CLK_CLKOCTL_CLK1HZEN_Pos) /*!< CLK_T::CLKOCTL: CLK1HZEN Mask */ - -#define CLK_CLKDCTL_HXTFDEN_Pos (4) /*!< CLK_T::CLKDCTL: HXTFDEN Position */ -#define CLK_CLKDCTL_HXTFDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFDEN Mask */ - -#define CLK_CLKDCTL_HXTFIEN_Pos (5) /*!< CLK_T::CLKDCTL: HXTFIEN Position */ -#define CLK_CLKDCTL_HXTFIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFIEN Mask */ - -#define CLK_CLKDCTL_HXTFDSEL_Pos (6) /*!< CLK_T::CLKDCTL: HXTFDSEL Position */ -#define CLK_CLKDCTL_HXTFDSEL_Msk (0x1ul << CLK_CLKDCTL_HXTFDSEL_Pos) /*!< CLK_T::CLKDCTL: HXTFDSEL Mask */ - -#define CLK_CLKDCTL_LXTFDEN_Pos (12) /*!< CLK_T::CLKDCTL: LXTFDEN Position */ -#define CLK_CLKDCTL_LXTFDEN_Msk (0x1ul << CLK_CLKDCTL_LXTFDEN_Pos) /*!< CLK_T::CLKDCTL: LXTFDEN Mask */ - -#define CLK_CLKDCTL_LXTFIEN_Pos (13) /*!< CLK_T::CLKDCTL: LXTFIEN Position */ -#define CLK_CLKDCTL_LXTFIEN_Msk (0x1ul << CLK_CLKDCTL_LXTFIEN_Pos) /*!< CLK_T::CLKDCTL: LXTFIEN Mask */ - -#define CLK_CLKDCTL_HXTFQDEN_Pos (16) /*!< CLK_T::CLKDCTL: HXTFQDEN Position */ -#define CLK_CLKDCTL_HXTFQDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQDEN Mask */ - -#define CLK_CLKDCTL_HXTFQIEN_Pos (17) /*!< CLK_T::CLKDCTL: HXTFQIEN Position */ -#define CLK_CLKDCTL_HXTFQIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQIEN Mask */ - -#define CLK_CLKDSTS_HXTFIF_Pos (0) /*!< CLK_T::CLKDSTS: HXTFIF Position */ -#define CLK_CLKDSTS_HXTFIF_Msk (0x1ul << CLK_CLKDSTS_HXTFIF_Pos) /*!< CLK_T::CLKDSTS: HXTFIF Mask */ - -#define CLK_CLKDSTS_LXTFIF_Pos (1) /*!< CLK_T::CLKDSTS: LXTFIF Position */ -#define CLK_CLKDSTS_LXTFIF_Msk (0x1ul << CLK_CLKDSTS_LXTFIF_Pos) /*!< CLK_T::CLKDSTS: LXTFIF Mask */ - -#define CLK_CLKDSTS_HXTFQIF_Pos (8) /*!< CLK_T::CLKDSTS: HXTFQIF Position */ -#define CLK_CLKDSTS_HXTFQIF_Msk (0x1ul << CLK_CLKDSTS_HXTFQIF_Pos) /*!< CLK_T::CLKDSTS: HXTFQIF Mask */ - -#define CLK_CDUPB_UPERBD_Pos (0) /*!< CLK_T::CDUPB: UPERBD Position */ -#define CLK_CDUPB_UPERBD_Msk (0x3fful << CLK_CDUPB_UPERBD_Pos) /*!< CLK_T::CDUPB: UPERBD Mask */ - -#define CLK_CDLOWB_LOWERBD_Pos (0) /*!< CLK_T::CDLOWB: LOWERBD Position */ -#define CLK_CDLOWB_LOWERBD_Msk (0x3fful << CLK_CDLOWB_LOWERBD_Pos) /*!< CLK_T::CDLOWB: LOWERBD Mask */ - -#define CLK_PMUCTL_PDMSEL_Pos (0) /*!< CLK_T::PMUCTL: PDMSEL Position */ -#define CLK_PMUCTL_PDMSEL_Msk (0x7ul<< CLK_PMUCTL_PDMSEL_Pos) /*!< CLK_T::PMUCTL: PDMSEL Mask */ - -#define CLK_PMUCTL_VDROPEN_Pos (4) /*!< CLK_T::PMUCTL: VDROPEN Position */ -#define CLK_PMUCTL_VDROPEN_Msk (0x1ul<< CLK_PMUCTL_VDROPEN_Pos) /*!< CLK_T::PMUCTL: VDROPEN Mask */ - -#define CLK_PMUCTL_WRBUSY_Pos (7) /*!< CLK_T::PMUCTL: WRBUSY Position */ -#define CLK_PMUCTL_WRBUSY_Msk (0x1ul<< CLK_PMUCTL_WRBUSY_Pos) /*!< CLK_T::PMUCTL: WRBUSY Mask */ - -#define CLK_PMUCTL_WKTMREN_Pos (8) /*!< CLK_T::PMUCTL: WKTMREN Position */ -#define CLK_PMUCTL_WKTMREN_Msk (0x1ul<< CLK_PMUCTL_WKTMREN_Pos) /*!< CLK_T::PMUCTL: WKTMREN Mask */ - -#define CLK_PMUCTL_WKTMRIS_Pos (9) /*!< CLK_T::PMUCTL: WKTMRIS Position */ -#define CLK_PMUCTL_WKTMRIS_Msk (0x7ul<< CLK_PMUCTL_WKTMRIS_Pos) /*!< CLK_T::PMUCTL: WKTMRIS Mask */ - -#define CLK_PMUCTL_WKPINEN_Pos (16) /*!< CLK_T::PMUCTL: WKPINEN Position */ -#define CLK_PMUCTL_WKPINEN_Msk (0x3ul<< CLK_PMUCTL_WKPINEN_Pos) /*!< CLK_T::PMUCTL: WKPINEN Mask */ - -#define CLK_PMUCTL_WKPINEN0_Pos (16) /*!< CLK_T::PMUCTL: WKPINEN0 Position */ -#define CLK_PMUCTL_WKPINEN0_Msk (0x3ul<< CLK_PMUCTL_WKPINEN0_Pos) /*!< CLK_T::PMUCTL: WKPINEN0 Mask */ - -#define CLK_PMUCTL_ACMPSPWK_Pos (18) /*!< CLK_T::PMUCTL: ACMPSPWK Position */ -#define CLK_PMUCTL_ACMPSPWK_Msk (0x1ul<< CLK_PMUCTL_ACMPSPWK_Pos) /*!< CLK_T::PMUCTL: ACMPSPWK Mask */ - -#define CLK_PMUCTL_TAMPERWK_Pos (19) /*!< CLK_T::PMUCTL: TAMPERWK Position */ -#define CLK_PMUCTL_TAMPERWK_Msk (0x1ul<< CLK_PMUCTL_TAMPERWK_Pos) /*!< CLK_T::PMUCTL: TAMPERWK Mask */ - -#define CLK_PMUCTL_RTCWKEN_Pos (23) /*!< CLK_T::PMUCTL: RTCWKEN Position */ -#define CLK_PMUCTL_RTCWKEN_Msk (0x1ul<< CLK_PMUCTL_RTCWKEN_Pos) /*!< CLK_T::PMUCTL: RTCWKEN Mask */ - -#define CLK_PMUCTL_WKPINEN1_Pos (24) /*!< CLK_T::PMUCTL: WKPINEN1 Position */ -#define CLK_PMUCTL_WKPINEN1_Msk (0x3ul << CLK_PMUCTL_WKPINEN1_Pos) /*!< CLK_T::PMUCTL: WKPINEN1 Mask */ - -#define CLK_PMUCTL_WKPINEN2_Pos (26) /*!< CLK_T::PMUCTL: WKPINEN2 Position */ -#define CLK_PMUCTL_WKPINEN2_Msk (0x3ul << CLK_PMUCTL_WKPINEN2_Pos) /*!< CLK_T::PMUCTL: WKPINEN2 Mask */ - -#define CLK_PMUCTL_WKPINEN3_Pos (28) /*!< CLK_T::PMUCTL: WKPINEN3 Position */ -#define CLK_PMUCTL_WKPINEN3_Msk (0x3ul << CLK_PMUCTL_WKPINEN3_Pos) /*!< CLK_T::PMUCTL: WKPINEN3 Mask */ - -#define CLK_PMUCTL_WKPINEN4_Pos (30) /*!< CLK_T::PMUCTL: WKPINEN4 Position */ -#define CLK_PMUCTL_WKPINEN4_Msk (0x3ul << CLK_PMUCTL_WKPINEN4_Pos) /*!< CLK_T::PMUCTL: WKPINEN4 Mask */ - -#define CLK_PMUSTS_PINWK0_Pos (0) /*!< CLK_T::PMUSTS: PINWK0 Position */ -#define CLK_PMUSTS_PINWK0_Msk (0x1ul << CLK_PMUSTS_PINWK0_Pos) /*!< CLK_T::PMUSTS: PINWK0 Mask */ - -#define CLK_PMUSTS_PINWK_Pos (0) /*!< CLK_T::PMUSTS: PINWK Position */ -#define CLK_PMUSTS_PINWK_Msk (0x1ul << CLK_PMUSTS_PINWK_Pos) /*!< CLK_T::PMUSTS: PINWK Mask */ - -#define CLK_PMUSTS_TMRWK_Pos (1) /*!< CLK_T::PMUSTS: TMRWK Position */ -#define CLK_PMUSTS_TMRWK_Msk (0x1ul << CLK_PMUSTS_TMRWK_Pos) /*!< CLK_T::PMUSTS: TMRWK Mask */ - -#define CLK_PMUSTS_RTCWK_Pos (2) /*!< CLK_T::PMUSTS: RTCWK Position */ -#define CLK_PMUSTS_RTCWK_Msk (0x1ul << CLK_PMUSTS_RTCWK_Pos) /*!< CLK_T::PMUSTS: RTCWK Mask */ - -#define CLK_PMUSTS_PINWK1_Pos (3) /*!< CLK_T::PMUSTS: PINWK1 Position */ -#define CLK_PMUSTS_PINWK1_Msk (0x1ul << CLK_PMUSTS_PINWK1_Pos) /*!< CLK_T::PMUSTS: PINWK1 Mask */ - -#define CLK_PMUSTS_PINWK2_Pos (4) /*!< CLK_T::PMUSTS: PINWK2 Position */ -#define CLK_PMUSTS_PINWK2_Msk (0x1ul << CLK_PMUSTS_PINWK2_Pos) /*!< CLK_T::PMUSTS: PINWK2 Mask */ - -#define CLK_PMUSTS_PINWK3_Pos (5) /*!< CLK_T::PMUSTS: PINWK3 Position */ -#define CLK_PMUSTS_PINWK3_Msk (0x1ul << CLK_PMUSTS_PINWK3_Pos) /*!< CLK_T::PMUSTS: PINWK3 Mask */ - -#define CLK_PMUSTS_PINWK4_Pos (6) /*!< CLK_T::PMUSTS: PINWK4 Position */ -#define CLK_PMUSTS_PINWK4_Msk (0x1ul << CLK_PMUSTS_PINWK4_Pos) /*!< CLK_T::PMUSTS: PINWK4 Mask */ - -#define CLK_PMUSTS_GPAWK_Pos (8) /*!< CLK_T::PMUSTS: GPAWK Position */ -#define CLK_PMUSTS_GPAWK_Msk (0x1ul << CLK_PMUSTS_GPAWK_Pos) /*!< CLK_T::PMUSTS: GPAWK Mask */ - -#define CLK_PMUSTS_GPBWK_Pos (9) /*!< CLK_T::PMUSTS: GPBWK Position */ -#define CLK_PMUSTS_GPBWK_Msk (0x1ul << CLK_PMUSTS_GPBWK_Pos) /*!< CLK_T::PMUSTS: GPBWK Mask */ - -#define CLK_PMUSTS_GPCWK_Pos (10) /*!< CLK_T::PMUSTS: GPCWK Position */ -#define CLK_PMUSTS_GPCWK_Msk (0x1ul << CLK_PMUSTS_GPCWK_Pos) /*!< CLK_T::PMUSTS: GPCWK Mask */ - -#define CLK_PMUSTS_GPDWK_Pos (11) /*!< CLK_T::PMUSTS: GPDWK Position */ -#define CLK_PMUSTS_GPDWK_Msk (0x1ul << CLK_PMUSTS_GPDWK_Pos) /*!< CLK_T::PMUSTS: GPDWK Mask */ - -#define CLK_PMUSTS_LVRWK_Pos (12) /*!< CLK_T::PMUSTS: LVRWK Position */ -#define CLK_PMUSTS_LVRWK_Msk (0x1ul << CLK_PMUSTS_LVRWK_Pos) /*!< CLK_T::PMUSTS: LVRWK Mask */ - -#define CLK_PMUSTS_BODWK_Pos (13) /*!< CLK_T::PMUSTS: BODWK Position */ -#define CLK_PMUSTS_BODWK_Msk (0x1ul << CLK_PMUSTS_BODWK_Pos) /*!< CLK_T::PMUSTS: BODWK Mask */ - -#define CLK_PMUSTS_ACMPWK_Pos (14) /*!< CLK_T::PMUSTS: ACMPWK Position */ -#define CLK_PMUSTS_ACMPWK_Msk (0x1ul << CLK_PMUSTS_ACMPWK_Pos) /*!< CLK_T::PMUSTS: ACMPWK Mask */ - -#define CLK_PMUSTS_TAMPERWK_Pos (15) /*!< CLK_T::PMUSTS: TAMPERWK Position */ -#define CLK_PMUSTS_TAMPERWK_Msk (0x1ul << CLK_PMUSTS_TAMPERWK_Pos) /*!< CLK_T::PMUSTS: TAMPERWK Mask */ - -#define CLK_PMUSTS_CLRWK_Pos (31) /*!< CLK_T::PMUSTS: CLRWK Position */ -#define CLK_PMUSTS_CLRWK_Msk (0x1ul << CLK_PMUSTS_CLRWK_Pos) /*!< CLK_T::PMUSTS: CLRWK Mask */ - -#define CLK_SWKDBCTL_SWKDBCLKSEL_Pos (0) /*!< CLK_T::SWKDBCTL: SWKDBCLKSEL Position */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_Msk (0xFul<< CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< CLK_T::SWKDBCTL: SWKDBCLKSEL Mask */ - -#define CLK_PASWKCTL_WKEN_Pos (0) /*!< CLK_T::PASWKCTL: WKEN Position */ -#define CLK_PASWKCTL_WKEN_Msk (0x1ul << CLK_PASWKCTL_WKEN_Pos) /*!< CLK_T::PASWKCTL: WKEN Mask */ - -#define CLK_PASWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PASWKCTL: PRWKEN Position */ -#define CLK_PASWKCTL_PRWKEN_Msk (0x1ul << CLK_PASWKCTL_PRWKEN_Pos) /*!< CLK_T::PASWKCTL: PRWKEN Mask */ - -#define CLK_PASWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PASWKCTL: PFWKEN Position */ -#define CLK_PASWKCTL_PFWKEN_Msk (0x1ul << CLK_PASWKCTL_PFWKEN_Pos) /*!< CLK_T::PASWKCTL: PFWKEN Mask */ - -#define CLK_PASWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PASWKCTL: WKPSEL Position */ -#define CLK_PASWKCTL_WKPSEL_Msk (0xful << CLK_PASWKCTL_WKPSEL_Pos) /*!< CLK_T::PASWKCTL: WKPSEL Mask */ - -#define CLK_PASWKCTL_DBEN_Pos (8) /*!< CLK_T::PASWKCTL: DBEN Position */ -#define CLK_PASWKCTL_DBEN_Msk (0x1ul << CLK_PASWKCTL_DBEN_Pos) /*!< CLK_T::PASWKCTL: DBEN Mask */ - -#define CLK_PBSWKCTL_WKEN_Pos (0) /*!< CLK_T::PBSWKCTL: WKEN Position */ -#define CLK_PBSWKCTL_WKEN_Msk (0x1ul << CLK_PBSWKCTL_WKEN_Pos) /*!< CLK_T::PBSWKCTL: WKEN Mask */ - -#define CLK_PBSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PBSWKCTL: PRWKEN Position */ -#define CLK_PBSWKCTL_PRWKEN_Msk (0x1ul << CLK_PBSWKCTL_PRWKEN_Pos) /*!< CLK_T::PBSWKCTL: PRWKEN Mask */ - -#define CLK_PBSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PBSWKCTL: PFWKEN Position */ -#define CLK_PBSWKCTL_PFWKEN_Msk (0x1ul << CLK_PBSWKCTL_PFWKEN_Pos) /*!< CLK_T::PBSWKCTL: PFWKEN Mask */ - -#define CLK_PBSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PBSWKCTL: WKPSEL Position */ -#define CLK_PBSWKCTL_WKPSEL_Msk (0xful << CLK_PBSWKCTL_WKPSEL_Pos) /*!< CLK_T::PBSWKCTL: WKPSEL Mask */ - -#define CLK_PBSWKCTL_DBEN_Pos (8) /*!< CLK_T::PBSWKCTL: DBEN Position */ -#define CLK_PBSWKCTL_DBEN_Msk (0x1ul << CLK_PBSWKCTL_DBEN_Pos) /*!< CLK_T::PBSWKCTL: DBEN Mask */ - -#define CLK_PCSWKCTL_WKEN_Pos (0) /*!< CLK_T::PCSWKCTL: WKEN Position */ -#define CLK_PCSWKCTL_WKEN_Msk (0x1ul << CLK_PCSWKCTL_WKEN_Pos) /*!< CLK_T::PCSWKCTL: WKEN Mask */ - -#define CLK_PCSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PCSWKCTL: PRWKEN Position */ -#define CLK_PCSWKCTL_PRWKEN_Msk (0x1ul << CLK_PCSWKCTL_PRWKEN_Pos) /*!< CLK_T::PCSWKCTL: PRWKEN Mask */ - -#define CLK_PCSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PCSWKCTL: PFWKEN Position */ -#define CLK_PCSWKCTL_PFWKEN_Msk (0x1ul << CLK_PCSWKCTL_PFWKEN_Pos) /*!< CLK_T::PCSWKCTL: PFWKEN Mask */ - -#define CLK_PCSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PCSWKCTL: WKPSEL Position */ -#define CLK_PCSWKCTL_WKPSEL_Msk (0xful << CLK_PCSWKCTL_WKPSEL_Pos) /*!< CLK_T::PCSWKCTL: WKPSEL Mask */ - -#define CLK_PCSWKCTL_DBEN_Pos (8) /*!< CLK_T::PCSWKCTL: DBEN Position */ -#define CLK_PCSWKCTL_DBEN_Msk (0x1ul << CLK_PCSWKCTL_DBEN_Pos) /*!< CLK_T::PCSWKCTL: DBEN Mask */ - -#define CLK_PDSWKCTL_WKEN_Pos (0) /*!< CLK_T::PDSWKCTL: WKEN Position */ -#define CLK_PDSWKCTL_WKEN_Msk (0x1ul << CLK_PDSWKCTL_WKEN_Pos) /*!< CLK_T::PDSWKCTL: WKEN Mask */ - -#define CLK_PDSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PDSWKCTL: PRWKEN Position */ -#define CLK_PDSWKCTL_PRWKEN_Msk (0x1ul << CLK_PDSWKCTL_PRWKEN_Pos) /*!< CLK_T::PDSWKCTL: PRWKEN Mask */ - -#define CLK_PDSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PDSWKCTL: PFWKEN Position */ -#define CLK_PDSWKCTL_PFWKEN_Msk (0x1ul << CLK_PDSWKCTL_PFWKEN_Pos) /*!< CLK_T::PDSWKCTL: PFWKEN Mask */ - -#define CLK_PDSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PDSWKCTL: WKPSEL Position */ -#define CLK_PDSWKCTL_WKPSEL_Msk (0xful << CLK_PDSWKCTL_WKPSEL_Pos) /*!< CLK_T::PDSWKCTL: WKPSEL Mask */ - -#define CLK_PDSWKCTL_DBEN_Pos (8) /*!< CLK_T::PDSWKCTL: DBEN Position */ -#define CLK_PDSWKCTL_DBEN_Msk (0x1ul << CLK_PDSWKCTL_DBEN_Pos) /*!< CLK_T::PDSWKCTL: DBEN Mask */ - -#define CLK_IOPDCTL_IOHR_Pos (0) /*!< CLK_T::IOPDCTL: IOHR Position */ -#define CLK_IOPDCTL_IOHR_Msk (0x1ul << CLK_IOPDCTL_IOHR_Pos) /*!< CLK_T::IOPDCTL: IOHR Mask */ - -#define CLK_HXTFSEL_HXTFSEL_Pos (0) /*!< CLK_T::HXTFSEL: HXTFSEL Position */ -#define CLK_HXTFSEL_HXTFSEL_Msk (0x1ul << CLK_HXTFSEL_HXTFSEL_Pos) /*!< CLK_T::HXTFSEL: HXTFSEL Mask */ - - -/**@}*/ /* CLK_CONST */ -/**@}*/ /* end of CLK register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __CLK_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crc_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crc_reg.h deleted file mode 100644 index 4fe19138236..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crc_reg.h +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************//** - * @file crc_reg.h - * @version V1.00 - * @brief CRC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CRC_REG_H__ -#define __CRC_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Cyclic Redundancy Check Controller -------------------------*/ -/** - @addtogroup CRC Cyclic Redundancy Check Controller(CRC) - Memory Mapped Structure for CRC Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var CRC_T::CTL - * Offset: 0x00 CRC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRCEN |CRC Channel Generator Enable Bit - * | | |Set this bit 1 to enable CRC generator for CRC operation. - * | | |0 = No effect. - * | | |1 = CRC operation generator is active. - * |[1] |CHKSINIT |Checksum Initialization - * | | |Set this bit will auto reload SEED (CRC_SEED [31:0]) to CHECKSUM (CRC_CHECKSUM[31:0]) as CRC operation initial value. - * | | |0 = No effect. - * | | |1 = Reload SEED value to CHECKSUM register as CRC operation initial checksum value. - * | | |The others contents of CRC_CTL register will not be cleared. - * | | |Note1: This bit will be cleared automatically - * | | |Note2: Setting this bit will reload the seed value from CRC_SEED register as checksum initial value. - * |[24] |DATREV |Write Data Bit Order Reverse Enable Bit - * | | |This bit is used to enable the bit order reverse function per byte for write data value DATA (CRC_DATA[31:0]) in CRC_DAT register. - * | | |0 = Bit order reversed for CRC_DATA write data in Disabled. - * | | |1 = Bit order reversed for CRC_DATA write data in Enabled (per byte). - * | | |Note: If the write data is 0xAABBCCDD, the bit order reverse for CRC write data in is 0x55DD33BB. - * |[25] |CHKSREV |Checksum Bit Order Reverse Enable Bit - * | | |This bit is used to enable the bit order reverse function for checksum result CHECKSUM (CRC_CHECKSUM[31:0]). - * | | |0 = Bit order reverse for CRC CHECKSUMCRC checksum Disabled. - * | | |1 = Bit order reverse for CRC CHECKSUMCRC checksum Enabled. - * | | |Note: If the checksum result is 0xDD7B0F2E, the bit order reverse result for CRC checksum is 0x74F0DEBB. - * |[26] |DATFMT |Write Data 1's Complement Enable Bit - * | | |This bit is used to enable the 1's complement function for write data value DATA (CRC_DATA[31:0]). - * | | |0 = 1's complement for CRC_DATA writes data in Disabled. - * | | |1 = 1's complement for CRC_DATA writes data in Enabled. - * |[27] |CHKSFMT |Checksum 1's Complement Enable Bit - * | | |This bit is used to enable the 1's complement function for checksum result in CHECKSUM (CRC_CHECKSUM[31:0]) register. - * | | |0 = 1's complement for CRC CHECKSUM Disabled. - * | | |1 = 1's complement for CRC CHECKSUMCRC Enabled. - * |[29:28] |DATLEN |CPU Write Data Length - * | | |This field indicates the valid write data length of DATA (CRC_DAT[31:0]). - * | | |00 = Data length is 8-bit mode. - * | | |01 = Data length is 16-bit mode. - * | | |1x = Data length is 32-bit mode. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0] - * |[31:30] |CRCMODE |CRC Polynomial Mode - * | | |This field indicates the CRC operation polynomial mode. - * | | |00 = CRC-CCITT Polynomial mode. - * | | |01 = CRC-8 Polynomial mode. - * | | |10 = CRC-16 Polynomial mode. - * | | |11 = CRC-32 Polynomial mode. - * @var CRC_T::DAT - * Offset: 0x04 CRC Write Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |CRC Write Data Bits - * | | |User can write data directly by CPU mode or use PDMA function to write data to this field to perform CRC operation. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0]. - * @var CRC_T::SEED - * Offset: 0x08 CRC Seed Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |CRC Seed Value - * | | |This field indicates the CRC seed value. - * | | |Note1: This field SEED value will be reloaded to as checksum initial value CHECKSUM (CRC_CHECKSUM[31:0]) register) after perform CRC engine reset, CHKSINIT (CRC_CTL[1]) to 1. - * | | |Note2: The valid bits of CRC_SEED[31:0] is correlated to CRCMODE (CRC_CTL[31:30]). - * @var CRC_T::CHECKSUM - * Offset: 0x0C CRC Checksum Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CHECKSUM |CRC Checksum Results - * | | |This field indicates the CRC checksum result. - * | | |Note: The valid bits of CRC_CHECKSUM[31:0] is correlated to CRCMODE (CRC_CTL[31:30]). - */ - __IO uint32_t CTL; /*!< [0x0000] CRC Control Register */ - __IO uint32_t DAT; /*!< [0x0004] CRC Write Data Register */ - __IO uint32_t SEED; /*!< [0x0008] CRC Seed Register */ - __I uint32_t CHECKSUM; /*!< [0x000c] CRC Checksum Register */ - -} CRC_T; - -/** - @addtogroup CRC_CONST CRC Bit Field Definition - Constant Definitions for CRC Controller - @{ -*/ - -#define CRC_CTL_CRCEN_Pos (0) /*!< CRC_T::CTL: CRCEN Position */ -#define CRC_CTL_CRCEN_Msk (0x1ul << CRC_CTL_CRCEN_Pos) /*!< CRC_T::CTL: CRCEN Mask */ - -#define CRC_CTL_CHKSINIT_Pos (1) /*!< CRC_T::CTL: CHKSINIT Position */ -#define CRC_CTL_CHKSINIT_Msk (0x1ul << CRC_CTL_CHKSINIT_Pos) /*!< CRC_T::CTL: CHKSINIT Mask */ - -#define CRC_CTL_DATREV_Pos (24) /*!< CRC_T::CTL: DATREV Position */ -#define CRC_CTL_DATREV_Msk (0x1ul << CRC_CTL_DATREV_Pos) /*!< CRC_T::CTL: DATREV Mask */ - -#define CRC_CTL_CHKSREV_Pos (25) /*!< CRC_T::CTL: CHKSREV Position */ -#define CRC_CTL_CHKSREV_Msk (0x1ul << CRC_CTL_CHKSREV_Pos) /*!< CRC_T::CTL: CHKSREV Mask */ - -#define CRC_CTL_DATFMT_Pos (26) /*!< CRC_T::CTL: DATFMT Position */ -#define CRC_CTL_DATFMT_Msk (0x1ul << CRC_CTL_DATFMT_Pos) /*!< CRC_T::CTL: DATFMT Mask */ - -#define CRC_CTL_CHKSFMT_Pos (27) /*!< CRC_T::CTL: CHKSFMT Position */ -#define CRC_CTL_CHKSFMT_Msk (0x1ul << CRC_CTL_CHKSFMT_Pos) /*!< CRC_T::CTL: CHKSFMT Mask */ - -#define CRC_CTL_DATLEN_Pos (28) /*!< CRC_T::CTL: DATLEN Position */ -#define CRC_CTL_DATLEN_Msk (0x3ul << CRC_CTL_DATLEN_Pos) /*!< CRC_T::CTL: DATLEN Mask */ - -#define CRC_CTL_CRCMODE_Pos (30) /*!< CRC_T::CTL: CRCMODE Position */ -#define CRC_CTL_CRCMODE_Msk (0x3ul << CRC_CTL_CRCMODE_Pos) /*!< CRC_T::CTL: CRCMODE Mask */ - -#define CRC_DAT_DATA_Pos (0) /*!< CRC_T::DAT: DATA Position */ -#define CRC_DAT_DATA_Msk (0xfffffffful << CRC_DAT_DATA_Pos) /*!< CRC_T::DAT: DATA Mask */ - -#define CRC_SEED_SEED_Pos (0) /*!< CRC_T::SEED: SEED Position */ -#define CRC_SEED_SEED_Msk (0xfffffffful << CRC_SEED_SEED_Pos) /*!< CRC_T::SEED: SEED Mask */ - -#define CRC_CHECKSUM_CHECKSUM_Pos (0) /*!< CRC_T::CHECKSUM: CHECKSUM Position */ -#define CRC_CHECKSUM_CHECKSUM_Msk (0xfffffffful << CRC_CHECKSUM_CHECKSUM_Pos) /*!< CRC_T::CHECKSUM: CHECKSUM Mask */ - -/**@}*/ /* CRC_CONST */ -/**@}*/ /* end of CRC register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __CLK_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crpt_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crpt_reg.h deleted file mode 100644 index ddffb2ba95c..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/crpt_reg.h +++ /dev/null @@ -1,2083 +0,0 @@ -/**************************************************************************//** -* @file crpt_reg.h -* @version V1.00 -* @brief CRPT register definition header file -* -* @copyright SPDX-License-Identifier: Apache-2.0 -* @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __CRPT_REG_H__ -#define __CRPT_REG_H__ - - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Cryptographic Accelerator -------------------------*/ -/** - @addtogroup CRPT Cryptographic Accelerator(CRPT) - Memory Mapped Structure for CRPT Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var CRPT_T::INTEN - * Offset: 0x00 Crypto Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIEN |AES Interrupt Enable Bit - * | | |0 = AES interrupt Disabled. - * | | |1 = AES interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when amount of data set in AES_DMA_CNT is fed into the AES engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the AES engine finishes the operation. - * |[1] |AESEIEN |AES Error Flag Enable Bit - * | | |0 = AES error interrupt flag Disabled. - * | | |1 = AES error interrupt flag Enabled. - * |[16] |PRNGIEN |PRNG Interrupt Enable Bit - * | | |0 = PRNG interrupt Disabled. - * | | |1 = PRNG interrupt Enabled. - * |[17] |PRNGEIEN |PRNG Error Flag Enable Bit - * | | |0 = PRNG error interrupt flag Disabled. - * | | |1 = PRNG error interrupt flag Enabled. - * |[22] |ECCIEN |ECC Interrupt Enable Bit - * | | |0 = ECC interrupt Disabled. - * | | |1 = ECC interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when amount of data set in ECC_DMA_CNT is fed into the ECC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the ECC engine finishes the operation. - * |[23] |ECCEIEN |ECC Error Interrupt Enable Bit - * | | |0 = ECC error interrupt flag Disabled. - * | | |1 = ECC error interrupt flag Enabled. - * |[24] |HMACIEN |SHA/HMAC Interrupt Enable Bit - * | | |0 = SHA/HMAC interrupt Disabled. - * | | |1 = SHA/HMAC interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when amount of data set in HMAC_DMA_CNT is fed into the SHA/HMAC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the SHA/HMAC engine finishes the operation. - * |[25] |HMACEIEN |SHA/HMAC Error Interrupt Enable Bit - * | | |0 = SHA/HMAC error interrupt flag Disabled. - * | | |1 = HMAC error interrupt flag Enabled. - * |[30] |RSAIEN |RSA Interrupt Enable Bit - * | | |0 = RSA interrupt Disabled. - * | | |1 = RSA interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when amount of data set in RSA_DMA_CNT is fed into the RSA engine. - * |[31] |RSAEIEN |RSA Error Interrupt Enable Bit - * | | |0 = RSA error interrupt flag Disabled. - * | | |1 = RSA error interrupt flag Enabled. - * @var CRPT_T::INTSTS - * Offset: 0x04 Crypto Interrupt Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIF |AES Finish Interrupt Flag - * | | |0 = No AES interrupt. - * | | |1 = AES encryption/decryption done interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[1] |AESEIF |AES Error Flag - * | | |0 = No AES error. - * | | |1 = AES encryption/decryption error interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[16] |PRNGIF |PRNG Finish Interrupt Flag - * | | |0 = No PRNG interrupt. - * | | |1 = PRNG key generation done interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[17] |PRNGEIF |PRNGError Flag - * | | |0 = No PRNG error. - * | | |1 = PRNG key generation error interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[22] |ECCIF |ECC Finish Interrupt Flag - * | | |0 = No ECC interrupt. - * | | |1 = ECC operation done interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[23] |ECCEIF |ECC Error Flag - * | | |This register includes operating and setting error - * | | |The detail flag is shown in CRPT_ECC_STS register. - * | | |0 = No ECC error. - * | | |1 = ECC error interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[24] |HMACIF |SHA/HMAC Finish Interrupt Flag - * | | |0 = No SHA/HMAC interrupt. - * | | |1 = SHA/HMAC operation done interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[25] |HMACEIF |SHA/HMAC Error Flag - * | | |This register includes operating and setting error - * | | |The detail flag is shown in CRPT_HMAC_STS register. - * | | |0 = No SHA/HMAC error. - * | | |1 = SHA/HMAC error interrupt. - * | | |Note:This bit is cleared by writing 1, and it has no effect by writing 0. - * |[30] |RSAIF |RSA Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No RSA interrupt. - * | | |1 = RSA operation done interrupt. - * |[31] |RSAEIF |RSA Error Interrupt Flag - * | | |This register includes operating and setting error - * | | |The detail flag is shown in CRPT_RSA_STS register. - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No RSA error. - * | | |1 = RSA error interrupt. - * @var CRPT_T::PRNG_CTL - * Offset: 0x08 PRNG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Start PRNG Engine - * | | |0 = Stop PRNG engine. - * | | |1 = Generate new key and store the new key to register CRPT_PRNG_KEYx, which will be cleared when the new key is generated. - * |[1] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * |[5:2] |KEYSZ |PRNG Generate Key Size - * | | |0000 = 128 bits. - * | | |0001 = 163 bits. - * | | |0010 = 192 bits. - * | | |0011 = 224 bits. - * | | |0100 = 233 bits. - * | | |0101 = 255 bits. - * | | |0110 = 256 bits. - * | | |0111 = 283 bits (only for KS). - * | | |1000 = 384 bits (only for KS). - * | | |1001 = 409 bits (only for KS). - * | | |1010 = 512 bits (only for KS). - * | | |1011 = 521 bits (only for KS). - * | | |1100 = 571 bits (only for KS). - * | | |1101 = Reserved. - * | | |1110 = Reserved. - * | | |1111 = Reserved. - * | | |Note: 283~571 bits only generate for Key Store. - * |[6] |SEEDSEL |Seed Select - * | | |This bit can be set to 1 only after SEEDRDY (TRNG_CTL[9]) bit become to 1. - * | | |0 = Select the seed which is from PRNG. - * | | |1 = Select the seed which is from TRNG. (not from CRPT_PRNG_SEED) - * |[7] |SEEDSRC |Seed Source (Read Only) - * | | |0 = Seed is from PRNG. - * | | |1 = Seed is from TRNG. (not from CRPT_PRNG_SEED) - * | | |Note: This bit is cleared to u20180u2019 when SEEDSEL is 0. - * |[8] |BUSY |PRNG Busy (Read Only) - * | | |0 = PRNG engine is idle. - * | | |1 = Indicate that the PRNG engine is generating CRPT_PRNG_KEYx. - * @var CRPT_T::PRNG_SEED - * Offset: 0x0C Seed for PRNG - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed for PRNG (Write Only) - * | | |The bits store the seed for PRNG engine. - * | | |Note: In TRNG+PRNG mode, the seed is from TRNGengine, and it will not store in this register. - * @var CRPT_T::PRNG_KEY - * Offset: 0x10-0x2C PRNG Generated Key - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_STS - * Offset: 0x30 PRNG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |PRNG Busy Flag - * | | |0 = PRNG engine is idle. - * | | |1 = Indicate that the PRNG engine is generating CRPT_PRNG_KEYx. - * |[16] |KCTLERR |PRNG Key Control Register Error Flag - * | | |0 = No error. - * | | |1 = PRNG key control error - * | | |When PRNG execute ECDSA or ECDH, but PRNG seed not from TRNG or key is not written to the SRAM of key store (WSDST,CRPT_PRNG_KSCTL[23:22] is not equal to u201900u2019). - * |[17] |KSERR |PRNG Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access key store fail. - * @var CRPT_T::AES_FDBCK - * Offset: 0x50-0x5C AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next block operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRPT_T::AES_GCM_IVCNT - * Offset: 0x80-0x84 AES GCM IV Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM IV Byte Count - * | | |The bit length of IV is 64 bits for AES GCM mode - * | | |The CRPT_AES_GCM_IVCNT keeps the low weightbyte count of initial vector (i.e., len(IV)[34:3])of AES GCM mode and can be read and written. - * @var CRPT_T::AES_GCM_ACNT - * Offset: 0x88-0x8C AES GCM A Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM aByte Count - * | | |The bit length of A is 64 bits for AES GCM mode - * | | |The CRPT_AES_GCM_ACNT keeps the low weightbyte count of theadditional authenticated data (i.e., len(A)[34:3])of AES GCM mode and can be read and written. - * @var CRPT_T::AES_GCM_PCNT - * Offset: 0x90-0x94 AES GCM P Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM PByte Count - * | | |The bit length of Por Cis 39 bits for AES GCM mode - * | | |The CRPT_AES_GCM_PCNT0 keeps the low weightbyte count of theplaintextor ciphertext (i.e., len(P)[34:3] or len(C)[34:3])of AES GCM mode and can be read and written. - * |[60:32] |CNT |AES GCM P Byte Count - * | | |The bit length of Por C is 39 bits for AES GCM mode - * | | |The CRPT_AES_GCM_PCNT1 keeps the high weightbyte count of theplaintext or ciphertext (i.e., len(P)[38:35] or len(C)[38:35])of AES GCM mode and can be read and written. - * | | |The bit length of Por C is 64 bits for AES CCM mode - * | | |The CRPT_AES_GCM_PCNT1 keeps the high weightbyte count of theplaintext or ciphertext (i.e., len(P)[63:35] or len(C)[63:35])of AES CCM mode and can be read and written. - * @var CRPT_T::AES_FBADDR - * Offset: 0xA0 AES DMA Feedback Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FBADDR |AES DMA Feedback Address - * | | |In DMA cascade mode, software can update DMA feedbackaddress register for automatically reading and writing feedback vaules via DMA.The FBADDR keeps the feedback address of the feedback data for the next cascade operation - * | | |Based on the feedback address, the AES accelerator can read thefeedback dataof the last cascade opeation from SRAM memory space and write thefeedback dataof the current cascade opeation to SRAM memory space - * | | |The start of feedback address should be located at word boundary - * | | |In other words, bit 1 and 0 of FBADDR are ignored. - * | | |FBADDR can be read and written. - * | | |In DMA mode, software can update the next CRPT_AES_FBADDR before triggering START. - * @var CRPT_T::AES_CTL - * Offset: 0x100 AES Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |AES Engine Start - * | | |0 = No effect. - * | | |1 = Start AES engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it read back. - * |[1] |STOP |AES Engine Stop - * | | |0 = No effect. - * | | |1 = Stop AES engine. - * | | |Note: This bit is always 0 when it read back. - * |[3:2] |KEYSZ |AES Key Size - * | | |This bit defines three different key size for AES operation. - * | | |2u2019b00 = 128 bits key. - * | | |2u2019b01 = 192 bits key. - * | | |2u2019b10 = 256 bits key. - * | | |2u2019b11 = Reserved. - * | | |If the AES accelerator is operating and the corresponding flag BUSY is 1, updating this register has no effect. - * | | |Note:When SM4EN=1, the key size of AESmust be 128. - * |[5] |DMALAST |AES Last Block - * | | |In DMA mode, this bit must be set as beginning the last DMA cascade round. - * | | |In Non-DMA mode, this bit must be set when feeding in the last block of data in ECB, CBC, CTR, OFB, and CFB mode, and feeding in the (last-1) block of data at CBC-CS1, CBC-CS2, and CBC-CS3 mode. - * | | |This bit is always 0 when it read back. Must be written again once START is triggered. - * |[6] |DMACSCAD |AES Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |AES Engine DMA Enable Bit - * | | |0 = AES DMA engine Disabled. - * | | |The AES engine operates in Non-DMA mode. The data need to be written in CRPT_AES_DATIN. - * | | |1 = AES_DMA engine Enabled. - * | | |The AES engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[15:8] |OPMODE |AES Engine Operation Modes - * | | |0x00 = ECB (Electronic Codebook Mode) 0x01 = CBC (Cipher Block Chaining Mode). - * | | |0x02 = CFB (Cipher Feedback Mode). - * | | |0x03 = OFB (Output Feedback Mode). - * | | |0x04 = CTR (Counter Mode). - * | | |0x10 = CBC-CS1 (CBC Ciphertext-Stealing 1 Mode). - * | | |0x11 = CBC-CS2 (CBC Ciphertext-Stealing 2 Mode). - * | | |0x12 = CBC-CS3 (CBC Ciphertext-Stealing 3 Mode). - * | | |0x20 = GCM (Galois/Counter Mode). - * | | |0x21 = GHASH (Galois Hash Function). - * | | |0x22 = CCM (Counter with CBC-MAC Mode). - * |[16] |ENCRYPTO |AES Encryption/Decryption - * | | |0 = AES engine executes decryption operation. - * | | |1 = AES engine executes encryption operation. - * |[17] |SM4EN |SM4 Engine Enable - * | | |0 = Enable AES engine. - * | | |1 =Enable SM4 engine. - * |[20] |FBIN |Feedback Input to AES Via DMA Automatically - * | | |0 = Disable DMA automatical feedback input fucntion. - * | | |1 =Enable DMA automatical feedback input fucntion.when DMAEN = 1. - * |[21] |FBOUT |Feedback Output From AES Via DMA Automatically - * | | |0 = Disable DMA automatical feedback output fucntion. - * | | |1 =Enable DMA automatical feedback output fucntion when DMAEN = 1. - * |[22] |OUTSWAP |AES Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 =The order that CPU reads data from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |AES Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 =The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[24] |KOUTSWAP |AES Engine Output Key, Initial Vector and Feedback Swap - * | | |0 = Keep the original order. - * | | |1 =The order that CPU readskey, initial vector and feeback from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[25] |KINSWAP |AES Engine Input Key and Initial Vector Swap - * | | |0 = Keep the original order. - * | | |1 =The order that CPU feeds key and initial vector to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[30:26] |KEYUNPRT |Unprotect Key - * | | |Writing 0 to CRPT_AES_CTL[31] and u201C10110u201D to CRPT_AES_CTL[30:26] is to unprotect theAES key. - * | | |The KEYUNPRT can be read and written - * | | |When it is written as the AES engine is operating, BUSY flag is 1, there would be no effect on KEYUNPRT. - * |[31] |KEYPRT |Protect Key - * | | |Read as a flag to reflect KEYPRT. - * | | |0 = No effect. - * | | |1 = Protect the content of the AES key from reading - * | | |The return value for reading CRPT_AES_KEYx is not the content of the registers CRPT_AES_KEYx - * | | |Once it is set, it can be cleared by asserting KEYUNPRT - * | | |And the key content would be cleared as well. - * @var CRPT_T::AES_STS - * Offset: 0x104 AES Engine Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |AES Engine Busy - * | | |0 = The AES engine is idle or finished. - * | | |1 = The AES engine is under processing. - * |[8] |INBUFEMPTY|AES Input Buffer Empty - * | | |0 = There are some data in input buffer waiting for the AES engine to process. - * | | |1 = AES input buffer is empty - * | | |Software needs to feed data to the AES engine - * | | |Otherwise, the AES engine will be pending to wait for input data. - * |[9] |INBUFFULL |AES Input Buffer Full Flag - * | | |0 = AES input buffer is not full. Software can feed the data into the AES engine. - * | | |1 = AES input buffer is full - * | | |Software cannot feed data to the AES engine - * | | |Otherwise, the flag INBUFERR will be set to 1. - * |[10] |INBUFERR |AES Input Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during feeding data to the AES engine. - * |[12] |CNTERR |CRPT_AES_CNT Setting Error - * | | |0 = No error in CRPT_AES_CNT setting. - * | | |1 = CRPT_AES_CNT is 0 or not a multiply of 16 in ECB, CBC, CFB, OFB, and CTR mode if DMAEN (CRPT_AES_CTL[7]) is enabled. - * |[16] |OUTBUFEMPTY|AES Out Buffer Empty - * | | |0 = AES output buffer is not empty. There are some valid data kept in output buffer. - * | | |1 = AES output buffer is empty - * | | |Software cannot get data from CRPT_AES_DATOUT - * | | |Otherwise, the flag OUTBUFERR will be set to 1 since the output buffer is empty. - * |[17] |OUTBUFFULL|AES Out Buffer Full Flag - * | | |0 = AES output buffer is not full. - * | | |1 = AES output buffer is full, and software needs to get data from CRPT_AES_DATOUT - * | | |Otherwise, the AES engine will be pending since the output buffer is full. - * |[18] |OUTBUFERR |AES Out Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during getting the result from AES engine. - * |[20] |BUSERR |AES DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and AES engine. - * |[21] |KSERR |AES Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop AES engine. - * @var CRPT_T::AES_DATIN - * Offset: 0x108 AES Engine Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |AES Engine Input Port - * | | |CPU feeds data to AES engine through this port by checking CRPT_AES_STS. Feed data as INBUFFULL is 0. - * @var CRPT_T::AES_DATOUT - * Offset: 0x10C AES Engine Data Output Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATOUT |AES Engine Output Port - * | | |CPU gets results from the AES engine through this port by checking CRPT_AES_STS - * | | |Get data as OUTBUFEMPTY is 0. - * @var CRPT_T::AES_KEY - * Offset: 0x110-0x12C AES Key Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_IV - * Offset: 0x130-0x13C AES Initial Vector Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES_SADDR - * Offset: 0x140 AES DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between SRAM memory space and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text (encryption) / cipher text (descryption) from SRAM memory space and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesnu2019t affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AES_SADDR before triggering START. - * | | |The value of CRPT_AES_SADDR and CRPT_AES_DADDR can be the same. - * @var CRPT_T::AES_DADDR - * Offset: 0x144 AES DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between SRAM memory space and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine output text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text (encryption) / plain text (decryption) back to SRAM memory space after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesnu2019t affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AES_DADDR before triggering START. - * | | |The value of CRPT_AES_SADDR and CRPT_AES_DADDR can be the same. - * @var CRPT_T::AES_CNT - * Offset: 0x148 AES Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRPT_AES_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRPT_AES_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_AES_CNT can be read and written - * | | |Writing to CRPT_AES_CNT while the AES accelerator is operating doesnu2019t affect the current AES operation - * | | |But the value of CRPT_AES_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be more than 16 bytes - * | | |Operations that are qual or less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, CTR, CCM and GCM mode, CRPT_AES_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AES_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * | | |In AES GCM mode without DMA cascade fucntion, the value of CRPT_AES_CNT is equal to the total value of{CRPT_AES_GCM_IVCNT1, CRPT_AES_GCM_IVCNT0}, {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0}. - * | | |In AES GCM mode with DMA cascade fucntion,the value of CRPT_AES_CNT represents the byte count of source text in this cascade function - * | | |Thus, the value of CRPT_AES_CNT is less than or equal to the total value of {CRPT_AES_GCM_IVCNT1, CRPT_AES_GCM_IVCNT0}, {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0} and must be block alignment. - * | | |In AES CCM mode without DMA cascade fucntion, the value of CRPT_AES_CNT is equal to the total value of {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0}. - * | | |In AES CCM mode with DMA cascade fucntion,the value of CRPT_AES_CNT represents the byte count of source text in this cascade function - * | | |Thus, the value of CRPT_AES_CNT is less than or equal to the total value of {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0} and must be block alignment, except for the last block of plaintext or ciphertext. - * @var CRPT_T::HMAC_CTL - * Offset: 0x300 SHA/HMAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |SHA/HMAC Engine Start - * | | |0 = No effect. - * | | |1 = Start SHA/HMAC engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it read back. - * |[1] |STOP |SHA/HMAC Engine Stop - * | | |0 = No effect. - * | | |1 = Stop SHA/HMAC engine. - * | | |Note: This bit is always 0 when it read back. - * |[4] |DMAFIRST |SHA/HMAC First Blockin Cascadefunction - * | | |This bit must be set as feeding in first byte of data. - * |[5] |DMALAST |SHA/HMAC Last Block - * | | |This bit must be set as feeding in last byte of data. - * |[6] |DMACSCAD |SHA/HMAC Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |SHA/HMAC Engine DMA Enable Bit - * | | |0 = SHA/HMAC DMA engine Disabled. - * | | |SHA/HMAC engine operates in Non-DMA mode. The data need to be written in CRPT_HMAC_DATIN. - * | | |1 = SHA/HMAC DMA engine Enabled. - * | | |SHA/HMAC engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[10:8] |OPMODE |SHA/HMAC Engine Operation Modes - * | | |0x0xx: SHA1-160 - * | | |0x100: SHA2-256 - * | | |0x101: SHA2-224 - * | | |0x110: SHA2-512 - * | | |0x111: SHA2-384 - * | | |Note: These bits can be read and written. But writing tothem wouldnu2019t take effect as BUSY is 1.. - * | | |Note:When SM3EN=1, SHA/HMAC only execute SM3-256. - * |[11] |HMACEN |HMAC_SHA Engine Operating Mode - * | | |0 = Execute SHA function. - * | | |1 = Execute HMAC function. - * |[13] |SM3EN |SM3 Engine Enable Bit - * | | |0 = Execute other function. - * | | |1 = Execute SM3 function. - * |[20] |FBIN |Feedback Input to SHA/HMAC Via DMA Automatically - * | | |0 = Disable DMA automatical feedback input fucntion.. - * | | |1 = Enable DMA automatical feedback input fucntion when DMAEN = 1. - * |[21] |FBOUT |Feedback Output From SHA/HMAC Via DMA Automatically - * | | |0 = Disable DMA automatical feedback output fucntion.. - * | | |1 = Enable DMA automatical feedback output fucntion when DMAEN = 1. - * |[22] |OUTSWAP |SHA/HMAC Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |SHA/HMAC Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * @var CRPT_T::HMAC_STS - * Offset: 0x304 SHA/HMAC Status Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |SHA/HMAC Engine Busy - * | | |0 = SHA/HMAC engine is idle or finished. - * | | |1 = SHA/HMAC engine is busy. - * |[1] |DMABUSY |SHA/HMAC Engine DMA Busy Flag - * | | |0 = SHA/HMAC DMA engine is idle or finished. - * | | |1 = SHA/HMAC DMA engine is busy. - * |[8] |DMAERR |SHA/HMAC Engine DMA Error Flag - * | | |0 = Show the SHA/HMAC engine access normal. - * | | |1 = Show the SHA/HMAC engine access error. - * |[9] |KSERR |HMAC Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop HMAC engine. - * |[16] |DATINREQ |SHA/HMAC Non-dMA Mode Data Input Request - * | | |0 = No effect. - * | | |1 = Request SHA/HMAC Non-DMA mode data input. - * @var CRPT_T::HMAC_DGST - * Offset: 0x308-0x344 SHA/HMAC Output Feedback Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMACOutput Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_KEYCNT - * Offset: 0x348 SHA/HMAC Key Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEYCNT |SHA/HMAC Key Byte Count - * | | |The CRPT_HMAC_KEYCNT keeps the byte count of key that SHA/HMAC engine operates - * | | |The register is 32-bit and the maximum byte count is 4G bytes - * | | |It can be read and written. - * | | |Writing to the register CRPT_HMAC_KEYCNT as the SHA/HMAC accelerator operating doesnu2019t affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_KEYCNT will be updated later on - * | | |Consequently, software can prepare the key count for the next SHA/HMAC operation. - * @var CRPT_T::HMAC_SADDR - * Offset: 0x34C SHA/HMAC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |SHA/HMAC DMA Source Address - * | | |The SHA/HMAC accelerator supports DMA function to transfer the plain text between SRAM memory space and embedded FIFO - * | | |The CRPT_HMAC_SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the SHA/HMAC accelerator can read the plain text from SRAM memory space and do SHA/HMAC operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_HMAC_SADDR are ignored. - * | | |CRPT_HMAC_SADDR can be read and written - * | | |Writing to CRPT_HMAC_SADDR while the SHA/HMAC accelerator is operating doesnu2019t affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next SHA/HMAC operation. - * | | |In DMA mode, software can update the next CRPT_HMAC_SADDR before triggering START. - * | | |CRPT_HMAC_SADDR and CRPT_HMAC_DADDR can be the same in the value. - * @var CRPT_T::HMAC_DMACNT - * Offset: 0x350 SHA/HMAC Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMACNT |SHA/HMAC Operation Byte Count - * | | |The CRPT_HMAC_DMACNT keeps the byte count of source text that is for the SHA/HMAC engine operating in DMA mode - * | | |The CRPT_HMAC_DMACNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_HMAC_DMACNT can be read and written - * | | |Writing to CRPT_HMAC_DMACNT while the SHA/HMAC accelerator is operating doesnu2019t affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_DMACNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next SHA/HMAC operation. - * | | |In Non-DMA mode, CRPT_HMAC_DMACNT must be set as the byte count of the last block before feeding in the last block of data. - * @var CRPT_T::HMAC_DATIN - * Offset: 0x354 SHA/HMAC Engine Non-dMA Mode Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |SHA/HMAC Engine Input Port - * | | |CPU feeds data to SHA/HMAC engine through this port by checking CRPT_HMAC_STS - * | | |Feed data as DATINREQ is 1. - * @var CRPT_T::HMAC_FDBCK - * Offset: 0x358-0x42C SHA/HMAC Output Feedback Data After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FBADDR - * Offset: 0x4FC SHA/HMAC DMA Feedback Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FBADDR |SHA/HMAC DMA Feedback Address - * | | |In DMA cascade mode, software can update DMA feedbackaddress register for automatically reading and writing feedback vaules via DMA.The FBADDR keeps the feedback address of the feedback data for the next cascade operation - * | | |Based on the feedback address, the SHA/HMAC accelerator can read thefeedback dataof the last cascade opeation from SRAM memory space and write thefeedback dataof the current cascade opeation to SRAM memory space - * | | |The start of feedback address should be located at word boundary - * | | |In other words, bit 1 and 0 of FBADDR are ignored. - * | | |FBADDR can be read and written. - * | | |In DMA mode, software can update the next CRPT_HMAC_FBADDR before triggering START. - * @var CRPT_T::ECC_CTL - * Offset: 0x800 ECC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |ECC Accelerator Start - * | | |0 = No effect. - * | | |1 = Start ECC accelerator. BUSY flag will be set. - * | | |This bit is always 0 when it read back. - * | | |ECC accelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |ECC Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort ECC accelerator and make it into idle state. - * | | |This bit is always 0 when it read back. - * | | |Remember to clear ECC interrupt flag after stopping ECC accelerator. - * |[3] |PFA2C |Primg Field Adder with 2Cycles - * | | |0 = cost1 cycle . - * | | |1 = cost 2 cycles. - * |[4] |ECDSAS |Generate S in ECDSA Signature Generation - * | | |0 = No effect. - * | | |1 = Formula for generating S. - * | | |POINTX1 = ((POINTX2 * POINTY1 + POINTY2 ) / POINTX1) % CURVEN. - * |[5] |ECDSAR |Generate R in ECDSA Signature Generation - * | | |0 = No effect. - * | | |1 = Formula for generating R. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * |[7] |DMAEN |ECC Accelerator DMA Enable Bit - * | | |0 = ECC DMA engine Disabled. - * | | |1 = ECC DMA engine Enabled. - * | | |Only when START and DMAEN are 1, ECC DMA engine will be active - * |[8] |FSEL |Field Selection - * | | |0 = Binary Field (GF(2m )). - * | | |1 = Prime Field (GF(p)). - * |[10:9] |ECCOP |Point Operation for BF and PF - * | | |00 = Point multiplication :. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * | | |01 = Modulus operation : choose by MODOP (CRPT_ECC_CTL[12:11]). - * | | |10 = Point addition :. - * | | |(POINTX1, POINTY1) = (POINTX1, POINTY1) +. - * | | |(POINTX2, POINTY2) - * | | |11 = Point doubling :. - * | | |(POINTX1, POINTY1) = 2 * (POINTX1, POINTY1). - * | | |Besides above three input data, point operations still need the parameters of elliptic curve (CURVEA, CURVEB, CURVEN and CURVEM) as shown in Figure 6.27-11 - * |[12:11] |MODOP |Modulus Operation for PF - * | | |00 = Division :. - * | | |POINTX1 = (POINTY1 / POINTX1) % CURVEN. - * | | |01 = Multiplication :. - * | | |POINTX1 = (POINTX1 * POINTY1) % CURVEN. - * | | |10 = Addition :. - * | | |POINTX1 = (POINTX1 + POINTY1) % CURVEN. - * | | |11 = Subtraction :. - * | | |POINTX1 = (POINTX1 - POINTY1) % CURVEN. - * | | |MODOP is active only when ECCOP = 01. - * |[13] |CSEL |Curve Selection - * | | |0 = NISTsuggested curve. - * | | |1 = Montgomery curve. - * |[14] |SCAP |Side-channel Attack Protection - * | | |0 = Full speed without side-channel protection. - * | | |1 = Less speed with side-channel protection. - * |[15] |SBM |Secure-boot Mode - * | | |0 = (POINTX1,POINTY1)from user data. - * | | |1 = (POINTX1,POINTY1)from secure boot key. - * |[16] |LDP1 |The Control Signal of RegisterPOINTX1and POINTY1for the xand Y Coordinate of the First Point - * | | |0 = The register for POINTX1 and POINTY1 is not modified by DMA or user. - * | | |1 = The register for POINTX1 and POINTY1 is modified by DMA or user. - * |[17] |LDP2 |The Control Signal of Register POINTX2and POINTY2for the xand Y Coordinate of the Second Point - * | | |0 = The register for POINTX2 and POINTY2 is not modified by DMA or user. - * | | |1 = The register for POINTX2 and POINTY2 is modified by DMA or user. - * |[18] |LDA |The Control Signal of Register for the Parameter CURVEA of Elliptic Curve - * | | |0 = The register for CURVEA is not modified by DMA or user. - * | | |1 = The register for CURVEA is modified by DMA or user. - * |[19] |LDB |The Control Signal of Register for the Parameter CURVEB of Elliptic Curve - * | | |0 = The register for CURVEB is not modified by DMA or user. - * | | |1 = The register for CURVEB is modified by DMA or user. - * |[20] |LDN |The Control Signal of Register for the Parameter CURVEN of Elliptic Curve - * | | |0 = The register for CURVEN is not modified by DMA or user. - * | | |1 = The register for CURVEN is modified by DMA or user. - * |[21] |LDK |The Control Signal of Register for SCALARK - * | | |0 = The register for SCALARK is not modified by DMA or user. - * | | |1 = The register for SCALARK is modified by DMA or user. - * |[31:22] |CURVEM |The key length of elliptic curve. - * @var CRPT_T::ECC_STS - * Offset: 0x804 ECC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |ECC Accelerator Busy Flag - * | | |0 = The ECC accelerator is idle or finished. - * | | |1 = The ECC accelerator is under processing and protects all registers. - * | | |Remember to clear ECC interrupt flag after ECC accelerator finished - * |[1] |DMABUSY |ECC DMA Busy Flag - * | | |0 = ECC DMA is idle or finished. - * | | |1 = ECC DMA is busy. - * |[16] |BUSERR |ECC DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and ECC accelerator.. - * |[17] |KSERR |ECC Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop ECC engine. - * @var CRPT_T::ECC_X1 - * Offset: 0x808-0x84C ECC the X-coordinate Word of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_Y1 - * Offset: 0x850-0x894 ECC the Y-coordinate Word of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_X2 - * Offset: 0x898-0x8DC ECC the X-coordinate Word of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_Y2 - * Offset: 0x8E0-0x924 ECC the Y-coordinate Word of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_A - * Offset: 0x928-0x96C ECC the Parameter CURVEA Word of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_B - * Offset: 0x970-0x9B4 ECC the Parameter CURVEB Word of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_N - * Offset: 0x9B8-0x9FC ECC the Parameter CURVEN Word of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRPT_T::ECC_K - * Offset: 0xA00-0xA44 ECC the Scalar SCALARK Word of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRPT_T::ECC_SADDR - * Offset: 0xA48 ECC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |ECC DMA Source Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and ECC accelerator. - * | | |The SADDR keeps the source address of the data buffer where the source text is stored. Based on the source address, - * | | |the ECC accelerator can read the DATA and PARAMETER from SRAM memory space and do ECC operation. - * | | |The start of source address should be located at word boundary. That is, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written. In DMA mode, software must update the CRYPTO_ECC_SADDR before triggering START. - * @var CRPT_T::ECC_DADDR - * Offset: 0xA4C ECC DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |ECC DMA Destination Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory and ECC accelerator - * | | |The DADDR keeps the destination address of the data buffer where output data of ECC engine will be stored - * | | |Based on the destination address, the ECC accelerator can write the result data back to SRAM memory space after the ECC operation is finished - * | | |The start of destination address should be located at word boundary - * | | |That is, bit 1 and 0 of DADDR are ignored - * | | |DADDR can be read and written - * | | |In DMA mode, software must update the CRPT_ECC_DADDR before triggering START - * @var CRPT_T::ECC_STARTREG - * Offset: 0xA50 ECC Starting Address of Updated Registers - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |STARTREG |ECC Starting Address of Updated Registers - * | | |The address of the updated registers that DMA feeds the first data or parameter to ECC engine - * | | |When ECC engine is active, ECC accelerator does not allow users to modify STARTREG, for example, to update input data from register CRPT_ECC POINTX1 - * | | |Thus, the value of STARTREG is 0x808. - * @var CRPT_T::ECC_WORDCNT - * Offset: 0xA54 ECC DMA Word Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WORDCNT |ECC DMA Word Count - * | | |The CRPT_ECC_WORDCNT keeps the word count of source data that is for the required input data of ECC accelerator with various operations in DMA mode - * | | |Although CRPT_ECC_WORDCNT is 32-bit, the maximum of word count in ECC accelerator is 144words - * | | |CRPT_ECC_WORDCNT can be read and written - * @var CRPT_T::RSA_CTL - * Offset: 0xB00 RSA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |RSA Accelerator Start - * | | |0 = No effect. - * | | |1 = Start RSAaccelerator. BUSY flag will be set. - * | | |This bit is always 0 when it read back. - * | | |RSAaccelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |RSA Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort RSA accelerator and make it into initialstate. - * | | |This bit is always 0 when it read back. - * | | |Remember to clear RSA interrupt flag after stopping RSA accelerator. - * |[2] |CRT |CRT Enable Control - * | | |0 = CRT Disabled. - * | | |1 = CRT Enabled. - * | | |CRT is only used in decryption with key length 2048, 3072,4096 bits. - * |[3] |CRTBYP |CRT BypassEnable Control - * | | |0 = CRT Bypass Disabled. - * | | |1 = CRT Bypass Enabled. - * | | |CRT bypass is only used in CRT decryption with the same key. - * | | |Note: If users want to decrypt repeatedly with the same key, they can execute CRT bypass mode after the first time CRT decryption(means the second time to the latest time), but they canu2019t set CRTBYP to 1 in non-CRT mode. - * |[5:4] |KEYLENG |The Key Length of RSA Operation - * | | |00 = 1024bits. - * | | |01 = 2048bits. - * | | |10 = 3072bits. - * | | |11 = 4096bits. - * |[8] |SCAP |Side Channel Attack Protection Enable Control - * | | |0 = Side Channel Attack Protection Disabled. - * | | |1 = Side Channel Attack Protection Enabled. - * @var CRPT_T::RSA_STS - * Offset: 0xB04 RSA Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |RSA Accelerator Busy Flag - * | | |0 = The RSA accelerator is idle or finished. - * | | |1 = The RSA accelerator is under processing and protects all registers. - * | | |Remember to clear RSA interrupt flag after RSA accelerator finished - * |[1] |DMABUSY |RSA DMA Busy Flag - * | | |0 = RSA DMA is idle or finished. - * | | |1 = RSA DMA is busy. - * |[16] |BUSERR |RSA DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and RSA accelerator. - * |[17] |CTLERR |RSA Control Register Error Flag - * | | |0 = No error. - * | | |1 = RSA control error. RSA will not start in the unsupported situation. - * | | |Note: If user use the control error condition, but donu2019t set START(CRPT_RSA_CTL[0]) to 1, CTLERR still be set to 1. - * |[18] |KSERR |RSA Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop RSA engine. - * @var CRPT_T::RSA_SADDR - * Offset: 0xB08-0xB18 RSA DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR0 |RSA DMA Source Address Register0 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelarator. - * | | |This register is stored the address of RSA the Base of Exponentiation (M,N,E,p,q). - * @var CRPT_T::RSA_DADDR - * Offset: 0xB1C RSA DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |RSA DMA Destination Address Register - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelarator. - * | | |This register is stored the address of RSA DMA Destination Address Register (Ans). - * @var CRPT_T::RSA_MADDR - * Offset: 0xB20-0xB38 RSA DMA Middle Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR |RSA DMA Middle Address Register - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelarator. - * | | |This register is stored the address of RSA CRT the Temporary Value (Cp -> Mp -> Sp, Cq -> Mq -> Sq, Dp, Dq, Rp, Rq, E'). - * @var CRPT_T::PRNG_KSCTL - * Offset: 0xF00 PRNG Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Write Key Number - * | | |The key number is sent to key store - * | | |Note: Only for destination Is OTP of Key Store. - * |[16] |TRUST |Write Key Trust Selection Bit - * | | |0 = Set written key as the non-secure key. - * | | |1 = Set written key as the secure key. - * |[18] |PRIV |Privilege Key Selection Bit - * | | |0 = Set key as the non-privilege key. - * | | |1 = Set key as the privilege key. - * |[19] |ECDH |ECDH Control Bit - * | | |0 =reserved. - * | | |1 = key is written to key store and used in ECDH. - * | | |Note:When ECDH was set to u20181u2019, 1 - * | | |PRNG seed must from TRNG and key is must written to the SRAM of key store (WSDST, CRPT_PRNG_KSCTL[23:22] must set to u201800u2019) - * | | |Otherwise, KCTLERRwill become u20181u2019(CRPT_PRNG_KSSTS[16]) - * | | |2 - * | | |Key must in the interval [1, n-1] (the parameter n is from ECC) - * | | |The value of n canu2019t be 0 or 1, otherwise, PRNG will always keep busy. - * |[20] |ECDSA |ECDSA Control Bit - * | | |0 =reserved. - * | | |1 = key is written to key store and used in ECDSA. - * | | |Note:When ECDSA was set to u20181u2019, 1 - * | | |PRNG seed must from TRNGand key is must written to the SRAM of key store (WSDST, CRPT_PRNG_KSCTL[23:22] must set to u201800u2019) - * | | |Otherwise, KCTLERRwill become u20181u2019(CRPT_PRNG_KSSTS[16]) - * | | |2.Key must in the interval [1, n-1] (the parameter n is from ECC) - * | | |The value of n canu2019t be 0 or 1, otherwise, PRNG will always keep busy. - * |[21] |WDST |Write Key Destination - * | | |0 = key is written to registers CRPT_PRNG_KEYx. - * | | |1 = key is written to key store. - * |[23:22] |WSDST |Write Key Store Destination - * | | |00 = key is written to the SRAM of key store. - * | | |10 = key is written to the OTP of key store. - * | | |Others = reserved. - * |[26:24] |OWNER |Write Key Owner Selection Bits - * | | |000 = Only for AES used. - * | | |001 = Only for HMAC engine used. - * | | |100 = Only for ECC engine used. - * | | |101 = Only for CPU engine use. - * | | |Others = reserved. - * @var CRPT_T::PRNG_KSSTS - * Offset: 0xF04 PRNG Key Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Key Number - * | | |The key number is generated by key store - * |[16] |KCTLERR |PRNG Key Control Register Error Flag - * | | |0 = No error. - * | | |1 = PRNG key control error - * | | |When PRNG execute ECDSA or ECDH, but PRNG seed not from TRNG or key is not written to the SRAM of key store (WSDST,CRPT_PRNG_KSCTL[23:22] is not equal to u201900u2019). - * @var CRPT_T::AES_KSCTL - * Offset: 0xF10 AES Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Destination - * | | |0 = key is read from registers CRPT_AESx_KEYx. - * | | |1 = key is read from key store. - * |[7:6] |RSSRC |Read Key Store Destination - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRPT_T::HMAC_KSCTL - * Offset: 0xF30 HMAC Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Destination - * | | |0 = key is read from HMAC registers. - * | | |1 = key is read from key store. - * |[7:6] |RSSRC |Read Key Store Destination - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRPT_T::ECC_KSCTL - * Offset: 0xF40 ECC Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUMK |Read Key Number K - * | | |The key number of CRPT_ECC_K is sent to key store when RSRCK =1. - * |[5] |RSRCK |Read Key Destinationfor Key Number K - * | | |0 = key is read from ECC registers. - * | | |1 = key is read from key store. - * |[7:6] |RSSRCK |Read Key Store Destinationfor Key Number K - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * |[14] |ECDH |ECDH Control Bit - * | | |0 =reserved. - * | | |1 = Set ECC opereration is in ECDH - * | | |When this bit and RSRCK are equal to 0x1, ECC will read ECDH private key to CRPT_ECC_K from key store. - * |[16] |TRUST |Write Key Trust Selection Bit - * | | |0 = Set ECDH written key as the non-secure key. - * | | |1 = Set ECDH written key as the secure key. - * |[18] |PRIV |Write Key Privilege Selection Bit - * | | |0 = Set ECDH written key as the non-privilege key. - * | | |1 = Set ECDHwritten key as the privilege key. - * |[20] |XY |ECDH Output Select Bit - * | | |0 =The ECDH written key is from X-coordinate Value. - * | | |1 = The ECDH written key is from Y-coordinate Value. - * |[21] |WDST |Write Key Destination - * | | |0 = The ECDH writtenkey is in registers CRPT_ECC_X1 and CRPT_ECC_Y. - * | | |1 = The ECDH writtenkey is written to key store. - * |[23:22] |WSDST |Write Key Store Destination - * | | |00 = The ECDH writtenkey is written to the SRAM of key store. - * | | |10 = The ECDH writtenkey is written to the OTP of key store. - * | | |Others = reserved. - * |[26:24] |OWNER |Write Key Owner Selection Bits - * | | |000 = The ECDH written key is only for AES used. - * | | |001 = The ECDH written key is only for HMAC engine used. - * | | |100 = The ECDH written key is only for ECC engine used. - * | | |101 = The ECDH written key is only for CPU engine use. - * | | |Others = reserved. - * @var CRPT_T::ECC_KSSTS - * Offset: 0xF44 ECC Key Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Key Number - * | | |The key number is generated by key store after ECDH. - * @var CRPT_T::ECC_KSXY - * Offset: 0xF48 ECC XY Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUMX |Read Key Number X - * | | |The key number of CRPT_ECC_X1 is sent to key store when RSRCXY =1. - * |[5] |RSRCXY |Read Key Source for Key Number xand Y - * | | |0 = key is read from ECC registers. - * | | |1 = key is read from key store. - * |[7:6] |RSSRCX |Read Key Store Source for Key Number X - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * |[12:8] |NUMY |Read Key Number Y - * | | |The key number of CRPT_ECC_Y1 is sent to key store when RSRCXY =1. - * |[15:14] |RSSRCY |Read Key Store Source for Key Number Y - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRPT_T::RSA_KSCTL - * Offset: 0xF50 RSA Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Destination - * | | |0 = key is read from RSA engine. - * | | |1 = key is read from key store. - * |[7:6] |RSSRC |Read Key Store Destination - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * |[12:8] |BKNUM |Read Exponent Blind Key Number - * | | |The key number is sent to key store, and its destination always be the SRAM of key store - * | | |CPU canu2019t read the exponent blind key. - * | | |Note:Use this key number, only when executing SCA protection but no-CRT mode. - * @var CRPT_T::RSA_KSSTS - * Offset: 0xF54-0xF58 RSA Key Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM0 |Key Number0 - * | | |The key number is generated by key store, RSA can get complete p by key number in Key Store while operating. - * |[12:8] |NUM1 |Key Number1 - * | | |The key number is generated by key store, RSA can get complete q by key number in Key Store while operating. - * |[20:16] |NUM2 |Key Number2 - * | | |The key number is generated by key store, RSA can get or store Cp by key number in Key Store while operating. - * |[28:24] |NUM3 |Key Number3 - * | | |The key number is generated by key store, RSA can get or store Cq by key number in Key Store while operating. - * |[36:32] |NUM4 |Key Number4 - * | | |The key number is generated by key store, RSA can get or store Dp by key number in Key Store while operating. - * |[44:40] |NUM5 |Key Number5 - * | | |The key number is generated by key store, RSA can get or store Dq by key number in Key Store while operating. - * |[52:48] |NUM6 |Key Number6 - * | | |The key number is generated by key store, RSA can get or store Rp by key number in Key Store while operating. - * |[60:56] |NUM7 |Key Number7 - * | | |The key number is generated by key store, RSA can get or store Rq by key number in Key Store while operating. - */ - __IO uint32_t INTEN; /*!< [0x0000] Crypto Interrupt Enable Control Register */ - __IO uint32_t INTSTS; /*!< [0x0004] Crypto Interrupt Flag */ - __IO uint32_t PRNG_CTL; /*!< [0x0008] PRNG Control Register */ - __O uint32_t PRNG_SEED; /*!< [0x000c] Seed for PRNG */ - __I uint32_t PRNG_KEY[8]; /*!< [0x0010] ~ [0x002c] PRNG Generated Key0 ~ Key7 */ - __I uint32_t PRNG_STS; /*!< [0x0030] PRNG Status Register */ - __I uint32_t RESERVE0[7]; - __I uint32_t AES_FDBCK[4]; /*!< [0x0050] ~ [0x005c] AES Engine Output Feedback Data after Cryptographic Operation */ - __I uint32_t RESERVE1[8]; - __IO uint32_t AES_GCM_IVCNT[2]; /*!< [0x0080] ~ [0x0084] AES GCM IV Byte Count Register 0 */ - __IO uint32_t AES_GCM_ACNT[2]; /*!< [0x0088] ~ [0x008c] AES GCM A Byte Count Register 0 */ - __IO uint32_t AES_GCM_PCNT[2]; /*!< [0x0090] ~ [0x0094] AES GCM P Byte Count Register 0 */ - __I uint32_t RESERVE2[2]; - __IO uint32_t AES_FBADDR; /*!< [0x00a0] AES DMA Feedback Address Register */ - __I uint32_t RESERVE3[23]; - __IO uint32_t AES_CTL; /*!< [0x0100] AES Control Register */ - __I uint32_t AES_STS; /*!< [0x0104] AES Engine Flag */ - __IO uint32_t AES_DATIN; /*!< [0x0108] AES Engine Data Input Port Register */ - __I uint32_t AES_DATOUT; /*!< [0x010c] AES Engine Data Output Port Register */ - __IO uint32_t AES_KEY[8]; /*!< [0x0110] ~ [0x012c] AES Key Word 0~7 Register for Channel 0 */ - __IO uint32_t AES_IV[4]; /*!< [0x0130] ~ [0x013c] AES Initial Vector Word 0 ~ 3 Register for Channel 0 */ - __IO uint32_t AES_SADDR; /*!< [0x0140] AES DMA Source Address Register */ - __IO uint32_t AES_DADDR; /*!< [0x0144] AES DMA Destination Address Register */ - __IO uint32_t AES_CNT; /*!< [0x0148] AES Byte Count Register */ - __I uint32_t RESERVE4[109]; - __IO uint32_t HMAC_CTL; /*!< [0x0300] SHA/HMAC Control Register */ - __I uint32_t HMAC_STS; /*!< [0x0304] SHA/HMAC Status Flag */ - __I uint32_t HMAC_DGST[16]; /*!< [0x0308] ~ [0x0344] SHA/HMAC Digest Message 0~15 */ - __IO uint32_t HMAC_KEYCNT; /*!< [0x0348] SHA/HMAC Key Byte Count Register */ - __IO uint32_t HMAC_SADDR; /*!< [0x034c] SHA/HMAC DMA Source Address Register */ - __IO uint32_t HMAC_DMACNT; /*!< [0x0350] SHA/HMAC Byte Count Register */ - __IO uint32_t HMAC_DATIN; /*!< [0x0354] SHA/HMAC Engine Non-dMA Mode Data Input Port Register */ - __IO uint32_t HMAC_FDBCK[54]; /*!< [0x0358] ~ [0x042c] SHA/HMAC Output Feedback Data 0After SHA/HMAC Operation */ - __I uint32_t RESERVE5[51]; - __IO uint32_t HMAC_FBADDR; /*!< [0x04fc] SHA/HMAC DMA Feedback Address Register */ - __I uint32_t RESERVE6[192]; - __IO uint32_t ECC_CTL; /*!< [0x0800] ECC Control Register */ - __I uint32_t ECC_STS; /*!< [0x0804] ECC Status Register */ - __IO uint32_t ECC_X1[18]; /*!< [0x0808] ~ [0x084c] ECC the X-coordinate Word0 of the First Point */ - __IO uint32_t ECC_Y1[18]; /*!< [0x0850] ~ [0x0894] ECC The Y-coordinate word 0~17 of the first point */ - __IO uint32_t ECC_X2[18]; /*!< [0x0898] ~ [0x08dc] ECC The X-coordinate word 0~17 of the second point */ - __IO uint32_t ECC_Y2[18]; /*!< [0x08e0] ~ [0x0924] ECC The Y-coordinate word 0~17 of the second point */ - __IO uint32_t ECC_A[18]; /*!< [0x0928] ~ [0x096c] ECC The parameter CURVEA word 0~17 of elliptic curve */ - __IO uint32_t ECC_B[18]; /*!< [0x0970] ~ [0x09b4] ECC The parameter CURVEB word 0~17 of elliptic curve */ - __IO uint32_t ECC_N[18]; /*!< [0x09b8] ~ [0x09fc] ECC The parameter CURVEN word 0~17 of elliptic curve */ - __O uint32_t ECC_K[18]; /*!< [0x0a00] ~ [0x0a44] ECC The scalar SCALARK word 0~17 of point multiplication */ - __IO uint32_t ECC_SADDR; /*!< [0x0a48] ECC DMA Source Address Register */ - __IO uint32_t ECC_DADDR; /*!< [0x0a4c] ECC DMA Destination Address Register */ - __IO uint32_t ECC_STARTREG; /*!< [0x0a50] ECC Starting Address of Updated Registers */ - __IO uint32_t ECC_WORDCNT; /*!< [0x0a54] ECC DMA Word Count */ - __I uint32_t RESERVE7[42]; - __IO uint32_t RSA_CTL; /*!< [0x0b00] RSA Control Register */ - __I uint32_t RSA_STS; /*!< [0x0b04] RSA Status Register */ - __IO uint32_t RSA_SADDR[5]; /*!< [0x0b08] ~ [0x0b18] RSA DMA Source Address Register0 */ - __IO uint32_t RSA_DADDR; /*!< [0x0b1c] RSA DMA Destination Address Register */ - __IO uint32_t RSA_MADDR[7]; /*!< [0x0b20] ~ [0x0b38] RSA DMA Middle Address Register0 */ - __I uint32_t RESERVE8[241]; - __O uint32_t PRNG_KSCTL; /*!< [0x0f00] PRNG Key Control Register */ - __I uint32_t PRNG_KSSTS; /*!< [0x0f04] PRNG Key Status Register */ - __I uint32_t RESERVE9[2]; - __O uint32_t AES_KSCTL; /*!< [0x0f10] AES Key Control Register */ - __I uint32_t RESERVE10[7]; - __O uint32_t HMAC_KSCTL; /*!< [0x0f30] HMAC Key Control Register */ - __I uint32_t RESERVE11[3]; - __O uint32_t ECC_KSCTL; /*!< [0x0f40] ECC Key Control Register */ - __I uint32_t ECC_KSSTS; /*!< [0x0f44] ECC Key Status Register */ - __O uint32_t ECC_KSXY; /*!< [0x0f48] ECC XY Number Register */ - __I uint32_t RESERVE12[1]; - __O uint32_t RSA_KSCTL; /*!< [0x0f50] RSA Key Control Register */ - __IO uint32_t RSA_KSSTS[2]; /*!< [0x0f54] ~ [0x0f58] RSA Key Status Register 0 */ - __I uint32_t RESERVE13[40]; - -} CRPT_T; - -/** - @addtogroup CRPT_CONST CRYPTO Bit Field Definition - Constant Definitions for CRYPTO Controller - @{ -*/ - -#define CRPT_INTEN_AESIEN_Pos (0) /*!< CRPT_T::INTEN: AESIEN Position */ -#define CRPT_INTEN_AESIEN_Msk (0x1ul << CRPT_INTEN_AESIEN_Pos) /*!< CRPT_T::INTEN: AESIEN Mask */ - -#define CRPT_INTEN_AESEIEN_Pos (1) /*!< CRPT_T::INTEN: AESEIEN Position */ -#define CRPT_INTEN_AESEIEN_Msk (0x1ul << CRPT_INTEN_AESEIEN_Pos) /*!< CRPT_T::INTEN: AESEIEN Mask */ - -#define CRPT_INTEN_PRNGIEN_Pos (16) /*!< CRPT_T::INTEN: PRNGIEN Position */ -#define CRPT_INTEN_PRNGIEN_Msk (0x1ul << CRPT_INTEN_PRNGIEN_Pos) /*!< CRPT_T::INTEN: PRNGIEN Mask */ - -#define CRPT_INTEN_PRNGEIEN_Pos (17) /*!< CRPT_T::INTEN: PRNGEIEN Position */ -#define CRPT_INTEN_PRNGEIEN_Msk (0x1ul << CRPT_INTEN_PRNGEIEN_Pos) /*!< CRPT_T::INTEN: PRNGEIEN Mask */ - -#define CRPT_INTEN_ECCIEN_Pos (22) /*!< CRPT_T::INTEN: ECCIEN Position */ -#define CRPT_INTEN_ECCIEN_Msk (0x1ul << CRPT_INTEN_ECCIEN_Pos) /*!< CRPT_T::INTEN: ECCIEN Mask */ - -#define CRPT_INTEN_ECCEIEN_Pos (23) /*!< CRPT_T::INTEN: ECCEIEN Position */ -#define CRPT_INTEN_ECCEIEN_Msk (0x1ul << CRPT_INTEN_ECCEIEN_Pos) /*!< CRPT_T::INTEN: ECCEIEN Mask */ - -#define CRPT_INTEN_HMACIEN_Pos (24) /*!< CRPT_T::INTEN: HMACIEN Position */ -#define CRPT_INTEN_HMACIEN_Msk (0x1ul << CRPT_INTEN_HMACIEN_Pos) /*!< CRPT_T::INTEN: HMACIEN Mask */ - -#define CRPT_INTEN_HMACEIEN_Pos (25) /*!< CRPT_T::INTEN: HMACEIEN Position */ -#define CRPT_INTEN_HMACEIEN_Msk (0x1ul << CRPT_INTEN_HMACEIEN_Pos) /*!< CRPT_T::INTEN: HMACEIEN Mask */ - -#define CRPT_INTEN_RSAIEN_Pos (30) /*!< CRPT_T::INTEN: RSAIEN Position */ -#define CRPT_INTEN_RSAIEN_Msk (0x1ul << CRPT_INTEN_RSAIEN_Pos) /*!< CRPT_T::INTEN: RSAIEN Mask */ - -#define CRPT_INTEN_RSAEIEN_Pos (31) /*!< CRPT_T::INTEN: RSAEIEN Position */ -#define CRPT_INTEN_RSAEIEN_Msk (0x1ul << CRPT_INTEN_RSAEIEN_Pos) /*!< CRPT_T::INTEN: RSAEIEN Mask */ - -#define CRPT_INTSTS_AESIF_Pos (0) /*!< CRPT_T::INTSTS: AESIF Position */ -#define CRPT_INTSTS_AESIF_Msk (0x1ul << CRPT_INTSTS_AESIF_Pos) /*!< CRPT_T::INTSTS: AESIF Mask */ - -#define CRPT_INTSTS_AESEIF_Pos (1) /*!< CRPT_T::INTSTS: AESEIF Position */ -#define CRPT_INTSTS_AESEIF_Msk (0x1ul << CRPT_INTSTS_AESEIF_Pos) /*!< CRPT_T::INTSTS: AESEIF Mask */ - -#define CRPT_INTSTS_PRNGIF_Pos (16) /*!< CRPT_T::INTSTS: PRNGIF Position */ -#define CRPT_INTSTS_PRNGIF_Msk (0x1ul << CRPT_INTSTS_PRNGIF_Pos) /*!< CRPT_T::INTSTS: PRNGIF Mask */ - -#define CRPT_INTSTS_PRNGEIF_Pos (17) /*!< CRPT_T::INTSTS: PRNGEIF Position */ -#define CRPT_INTSTS_PRNGEIF_Msk (0x1ul << CRPT_INTSTS_PRNGEIF_Pos) /*!< CRPT_T::INTSTS: PRNGEIF Mask */ - -#define CRPT_INTSTS_ECCIF_Pos (22) /*!< CRPT_T::INTSTS: ECCIF Position */ -#define CRPT_INTSTS_ECCIF_Msk (0x1ul << CRPT_INTSTS_ECCIF_Pos) /*!< CRPT_T::INTSTS: ECCIF Mask */ - -#define CRPT_INTSTS_ECCEIF_Pos (23) /*!< CRPT_T::INTSTS: ECCEIF Position */ -#define CRPT_INTSTS_ECCEIF_Msk (0x1ul << CRPT_INTSTS_ECCEIF_Pos) /*!< CRPT_T::INTSTS: ECCEIF Mask */ - -#define CRPT_INTSTS_HMACIF_Pos (24) /*!< CRPT_T::INTSTS: HMACIF Position */ -#define CRPT_INTSTS_HMACIF_Msk (0x1ul << CRPT_INTSTS_HMACIF_Pos) /*!< CRPT_T::INTSTS: HMACIF Mask */ - -#define CRPT_INTSTS_HMACEIF_Pos (25) /*!< CRPT_T::INTSTS: HMACEIF Position */ -#define CRPT_INTSTS_HMACEIF_Msk (0x1ul << CRPT_INTSTS_HMACEIF_Pos) /*!< CRPT_T::INTSTS: HMACEIF Mask */ - -#define CRPT_INTSTS_RSAIF_Pos (30) /*!< CRPT_T::INTSTS: RSAIF Position */ -#define CRPT_INTSTS_RSAIF_Msk (0x1ul << CRPT_INTSTS_RSAIF_Pos) /*!< CRPT_T::INTSTS: RSAIF Mask */ - -#define CRPT_INTSTS_RSAEIF_Pos (31) /*!< CRPT_T::INTSTS: RSAEIF Position */ -#define CRPT_INTSTS_RSAEIF_Msk (0x1ul << CRPT_INTSTS_RSAEIF_Pos) /*!< CRPT_T::INTSTS: RSAEIF Mask */ - -#define CRPT_PRNG_CTL_START_Pos (0) /*!< CRPT_T::PRNG_CTL: START Position */ -#define CRPT_PRNG_CTL_START_Msk (0x1ul << CRPT_PRNG_CTL_START_Pos) /*!< CRPT_T::PRNG_CTL: START Mask */ - -#define CRPT_PRNG_CTL_SEEDRLD_Pos (1) /*!< CRPT_T::PRNG_CTL: SEEDRLD Position */ -#define CRPT_PRNG_CTL_SEEDRLD_Msk (0x1ul << CRPT_PRNG_CTL_SEEDRLD_Pos) /*!< CRPT_T::PRNG_CTL: SEEDRLD Mask */ - -#define CRPT_PRNG_CTL_KEYSZ_Pos (2) /*!< CRPT_T::PRNG_CTL: KEYSZ Position */ -#define CRPT_PRNG_CTL_KEYSZ_Msk (0xful << CRPT_PRNG_CTL_KEYSZ_Pos) /*!< CRPT_T::PRNG_CTL: KEYSZ Mask */ - -#define CRPT_PRNG_CTL_SEEDSEL_Pos (6) /*!< CRPT_T::PRNG_CTL: SEEDSEL Position */ -#define CRPT_PRNG_CTL_SEEDSEL_Msk (0x1ul << CRPT_PRNG_CTL_SEEDSEL_Pos) /*!< CRPT_T::PRNG_CTL: SEEDSEL Mask */ - -#define CRPT_PRNG_CTL_SEEDSRC_Pos (7) /*!< CRPT_T::PRNG_CTL: SEEDSRC Position */ -#define CRPT_PRNG_CTL_SEEDSRC_Msk (0x1ul << CRPT_PRNG_CTL_SEEDSRC_Pos) /*!< CRPT_T::PRNG_CTL: SEEDSRC Mask */ - -#define CRPT_PRNG_CTL_BUSY_Pos (8) /*!< CRPT_T::PRNG_CTL: BUSY Position */ -#define CRPT_PRNG_CTL_BUSY_Msk (0x1ul << CRPT_PRNG_CTL_BUSY_Pos) /*!< CRPT_T::PRNG_CTL: BUSY Mask */ - -#define CRPT_PRNG_SEED_SEED_Pos (0) /*!< CRPT_T::PRNG_SEED: SEED Position */ -#define CRPT_PRNG_SEED_SEED_Msk (0xfffffffful << CRPT_PRNG_SEED_SEED_Pos) /*!< CRPT_T::PRNG_SEED: SEED Mask */ - -#define CRPT_PRNG_KEY0_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY0: KEY Position */ -#define CRPT_PRNG_KEY0_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY0_KEY_Pos) /*!< CRPT_T::PRNG_KEY0: KEY Mask */ - -#define CRPT_PRNG_KEY1_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY1: KEY Position */ -#define CRPT_PRNG_KEY1_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY1_KEY_Pos) /*!< CRPT_T::PRNG_KEY1: KEY Mask */ - -#define CRPT_PRNG_KEY2_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY2: KEY Position */ -#define CRPT_PRNG_KEY2_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY2_KEY_Pos) /*!< CRPT_T::PRNG_KEY2: KEY Mask */ - -#define CRPT_PRNG_KEY3_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY3: KEY Position */ -#define CRPT_PRNG_KEY3_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY3_KEY_Pos) /*!< CRPT_T::PRNG_KEY3: KEY Mask */ - -#define CRPT_PRNG_KEY4_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY4: KEY Position */ -#define CRPT_PRNG_KEY4_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY4_KEY_Pos) /*!< CRPT_T::PRNG_KEY4: KEY Mask */ - -#define CRPT_PRNG_KEY5_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY5: KEY Position */ -#define CRPT_PRNG_KEY5_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY5_KEY_Pos) /*!< CRPT_T::PRNG_KEY5: KEY Mask */ - -#define CRPT_PRNG_KEY6_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY6: KEY Position */ -#define CRPT_PRNG_KEY6_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY6_KEY_Pos) /*!< CRPT_T::PRNG_KEY6: KEY Mask */ - -#define CRPT_PRNG_KEY7_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY7: KEY Position */ -#define CRPT_PRNG_KEY7_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY7_KEY_Pos) /*!< CRPT_T::PRNG_KEY7: KEY Mask */ - -#define CRPT_PRNG_STS_BUSY_Pos (0) /*!< CRPT_T::PRNG_STS: BUSY Position */ -#define CRPT_PRNG_STS_BUSY_Msk (0x1ul << CRPT_PRNG_STS_BUSY_Pos) /*!< CRPT_T::PRNG_STS: BUSY Mask */ - -#define CRPT_PRNG_STS_KCTLERR_Pos (16) /*!< CRPT_T::PRNG_STS: KCTLERR Position */ -#define CRPT_PRNG_STS_KCTLERR_Msk (0x1ul << CRPT_PRNG_STS_KCTLERR_Pos) /*!< CRPT_T::PRNG_STS: KCTLERR Mask */ - -#define CRPT_PRNG_STS_KSERR_Pos (17) /*!< CRPT_T::PRNG_STS: KSERR Position */ -#define CRPT_PRNG_STS_KSERR_Msk (0x1ul << CRPT_PRNG_STS_KSERR_Pos) /*!< CRPT_T::PRNG_STS: KSERR Mask */ - -#define CRPT_AES_FDBCK0_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK0: FDBCK Position */ -#define CRPT_AES_FDBCK0_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK0_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK0: FDBCK Mask */ - -#define CRPT_AES_FDBCK1_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK1: FDBCK Position */ -#define CRPT_AES_FDBCK1_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK1_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK1: FDBCK Mask */ - -#define CRPT_AES_FDBCK2_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK2: FDBCK Position */ -#define CRPT_AES_FDBCK2_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK2_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK2: FDBCK Mask */ - -#define CRPT_AES_FDBCK3_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK3: FDBCK Position */ -#define CRPT_AES_FDBCK3_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK3_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK3: FDBCK Mask */ - -#define CRPT_AES_GCM_IVCNT0_CNT_Pos (0) /*!< CRPT_T::AES_GCM_IVCNT0: CNT Position */ -#define CRPT_AES_GCM_IVCNT0_CNT_Msk (0xfffffffful << CRPT_AES_GCM_IVCNT0_CNT_Pos) /*!< CRPT_T::AES_GCM_IVCNT0: CNT Mask */ - -#define CRPT_AES_GCM_IVCNT1_CNT_Pos (0) /*!< CRPT_T::AES_GCM_IVCNT1: CNT Position */ -#define CRPT_AES_GCM_IVCNT1_CNT_Msk (0x1ffffffful << CRPT_AES_GCM_IVCNT1_CNT_Pos) /*!< CRPT_T::AES_GCM_IVCNT1: CNT Mask */ - -#define CRPT_AES_GCM_ACNT0_CNT_Pos (0) /*!< CRPT_T::AES_GCM_ACNT0: CNT Position */ -#define CRPT_AES_GCM_ACNT0_CNT_Msk (0xfffffffful << CRPT_AES_GCM_ACNT0_CNT_Pos) /*!< CRPT_T::AES_GCM_ACNT0: CNT Mask */ - -#define CRPT_AES_GCM_ACNT1_CNT_Pos (0) /*!< CRPT_T::AES_GCM_ACNT1: CNT Position */ -#define CRPT_AES_GCM_ACNT1_CNT_Msk (0x1ffffffful << CRPT_AES_GCM_ACNT1_CNT_Pos) /*!< CRPT_T::AES_GCM_ACNT1: CNT Mask */ - -#define CRPT_AES_GCM_PCNT0_CNT_Pos (0) /*!< CRPT_T::AES_GCM_PCNT0: CNT Position */ -#define CRPT_AES_GCM_PCNT0_CNT_Msk (0xfffffffful << CRPT_AES_GCM_PCNT0_CNT_Pos) /*!< CRPT_T::AES_GCM_PCNT0: CNT Mask */ - -#define CRPT_AES_GCM_PCNT1_CNT_Pos (0) /*!< CRPT_T::AES_GCM_PCNT1: CNT Position */ -#define CRPT_AES_GCM_PCNT1_CNT_Msk (0x1ffffffful << CRPT_AES_GCM_PCNT1_CNT_Pos) /*!< CRPT_T::AES_GCM_PCNT1: CNT Mask */ - -#define CRPT_AES_FBADDR_FBADDR_Pos (0) /*!< CRPT_T::AES_FBADDR: FBADDR Position */ -#define CRPT_AES_FBADDR_FBADDR_Msk (0xfffffffful << CRPT_AES_FBADDR_FBADDR_Pos) /*!< CRPT_T::AES_FBADDR: FBADDR Mask */ - -#define CRPT_AES_CTL_START_Pos (0) /*!< CRPT_T::AES_CTL: START Position */ -#define CRPT_AES_CTL_START_Msk (0x1ul << CRPT_AES_CTL_START_Pos) /*!< CRPT_T::AES_CTL: START Mask */ - -#define CRPT_AES_CTL_STOP_Pos (1) /*!< CRPT_T::AES_CTL: STOP Position */ -#define CRPT_AES_CTL_STOP_Msk (0x1ul << CRPT_AES_CTL_STOP_Pos) /*!< CRPT_T::AES_CTL: STOP Mask */ - -#define CRPT_AES_CTL_KEYSZ_Pos (2) /*!< CRPT_T::AES_CTL: KEYSZ Position */ -#define CRPT_AES_CTL_KEYSZ_Msk (0x3ul << CRPT_AES_CTL_KEYSZ_Pos) /*!< CRPT_T::AES_CTL: KEYSZ Mask */ - -#define CRPT_AES_CTL_DMALAST_Pos (5) /*!< CRPT_T::AES_CTL: DMALAST Position */ -#define CRPT_AES_CTL_DMALAST_Msk (0x1ul << CRPT_AES_CTL_DMALAST_Pos) /*!< CRPT_T::AES_CTL: DMALAST Mask */ - -#define CRPT_AES_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::AES_CTL: DMACSCAD Position */ -#define CRPT_AES_CTL_DMACSCAD_Msk (0x1ul << CRPT_AES_CTL_DMACSCAD_Pos) /*!< CRPT_T::AES_CTL: DMACSCAD Mask */ - -#define CRPT_AES_CTL_DMAEN_Pos (7) /*!< CRPT_T::AES_CTL: DMAEN Position */ -#define CRPT_AES_CTL_DMAEN_Msk (0x1ul << CRPT_AES_CTL_DMAEN_Pos) /*!< CRPT_T::AES_CTL: DMAEN Mask */ - -#define CRPT_AES_CTL_OPMODE_Pos (8) /*!< CRPT_T::AES_CTL: OPMODE Position */ -#define CRPT_AES_CTL_OPMODE_Msk (0xfful << CRPT_AES_CTL_OPMODE_Pos) /*!< CRPT_T::AES_CTL: OPMODE Mask */ - -#define CRPT_AES_CTL_ENCRPT_Pos (16) /*!< CRPT_T::AES_CTL: ENCRYPTO Position */ -#define CRPT_AES_CTL_ENCRPT_Msk (0x1ul << CRPT_AES_CTL_ENCRPT_Pos) /*!< CRPT_T::AES_CTL: ENCRYPTO Mask */ - -#define CRPT_AES_CTL_SM4EN_Pos (17) /*!< CRPT_T::AES_CTL: SM4EN Position */ -#define CRPT_AES_CTL_SM4EN_Msk (0x1ul << CRPT_AES_CTL_SM4EN_Pos) /*!< CRPT_T::AES_CTL: SM4EN Mask */ - -#define CRPT_AES_CTL_FBIN_Pos (20) /*!< CRPT_T::AES_CTL: FBIN Position */ -#define CRPT_AES_CTL_FBIN_Msk (0x1ul << CRPT_AES_CTL_FBIN_Pos) /*!< CRPT_T::AES_CTL: FBIN Mask */ - -#define CRPT_AES_CTL_FBOUT_Pos (21) /*!< CRPT_T::AES_CTL: FBOUT Position */ -#define CRPT_AES_CTL_FBOUT_Msk (0x1ul << CRPT_AES_CTL_FBOUT_Pos) /*!< CRPT_T::AES_CTL: FBOUT Mask */ - -#define CRPT_AES_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::AES_CTL: OUTSWAP Position */ -#define CRPT_AES_CTL_OUTSWAP_Msk (0x1ul << CRPT_AES_CTL_OUTSWAP_Pos) /*!< CRPT_T::AES_CTL: OUTSWAP Mask */ - -#define CRPT_AES_CTL_INSWAP_Pos (23) /*!< CRPT_T::AES_CTL: INSWAP Position */ -#define CRPT_AES_CTL_INSWAP_Msk (0x1ul << CRPT_AES_CTL_INSWAP_Pos) /*!< CRPT_T::AES_CTL: INSWAP Mask */ - -#define CRPT_AES_CTL_KOUTSWAP_Pos (24) /*!< CRPT_T::AES_CTL: KOUTSWAP Position */ -#define CRPT_AES_CTL_KOUTSWAP_Msk (0x1ul << CRPT_AES_CTL_KOUTSWAP_Pos) /*!< CRPT_T::AES_CTL: KOUTSWAP Mask */ - -#define CRPT_AES_CTL_KINSWAP_Pos (25) /*!< CRPT_T::AES_CTL: KINSWAP Position */ -#define CRPT_AES_CTL_KINSWAP_Msk (0x1ul << CRPT_AES_CTL_KINSWAP_Pos) /*!< CRPT_T::AES_CTL: KINSWAP Mask */ - -#define CRPT_AES_CTL_KEYUNPRT_Pos (26) /*!< CRPT_T::AES_CTL: KEYUNPRT Position */ -#define CRPT_AES_CTL_KEYUNPRT_Msk (0x1ful << CRPT_AES_CTL_KEYUNPRT_Pos) /*!< CRPT_T::AES_CTL: KEYUNPRT Mask */ - -#define CRPT_AES_CTL_KEYPRT_Pos (31) /*!< CRPT_T::AES_CTL: KEYPRT Position */ -#define CRPT_AES_CTL_KEYPRT_Msk (0x1ul << CRPT_AES_CTL_KEYPRT_Pos) /*!< CRPT_T::AES_CTL: KEYPRT Mask */ - -#define CRPT_AES_STS_BUSY_Pos (0) /*!< CRPT_T::AES_STS: BUSY Position */ -#define CRPT_AES_STS_BUSY_Msk (0x1ul << CRPT_AES_STS_BUSY_Pos) /*!< CRPT_T::AES_STS: BUSY Mask */ - -#define CRPT_AES_STS_INBUFEMPTY_Pos (8) /*!< CRPT_T::AES_STS: INBUFEMPTY Position */ -#define CRPT_AES_STS_INBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_INBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: INBUFEMPTY Mask */ - -#define CRPT_AES_STS_INBUFFULL_Pos (9) /*!< CRPT_T::AES_STS: INBUFFULL Position */ -#define CRPT_AES_STS_INBUFFULL_Msk (0x1ul << CRPT_AES_STS_INBUFFULL_Pos) /*!< CRPT_T::AES_STS: INBUFFULL Mask */ - -#define CRPT_AES_STS_INBUFERR_Pos (10) /*!< CRPT_T::AES_STS: INBUFERR Position */ -#define CRPT_AES_STS_INBUFERR_Msk (0x1ul << CRPT_AES_STS_INBUFERR_Pos) /*!< CRPT_T::AES_STS: INBUFERR Mask */ - -#define CRPT_AES_STS_CNTERR_Pos (12) /*!< CRPT_T::AES_STS: CNTERR Position */ -#define CRPT_AES_STS_CNTERR_Msk (0x1ul << CRPT_AES_STS_CNTERR_Pos) /*!< CRPT_T::AES_STS: CNTERR Mask */ - -#define CRPT_AES_STS_OUTBUFEMPTY_Pos (16) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Position*/ -#define CRPT_AES_STS_OUTBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_OUTBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Mask */ - -#define CRPT_AES_STS_OUTBUFFULL_Pos (17) /*!< CRPT_T::AES_STS: OUTBUFFULL Position */ -#define CRPT_AES_STS_OUTBUFFULL_Msk (0x1ul << CRPT_AES_STS_OUTBUFFULL_Pos) /*!< CRPT_T::AES_STS: OUTBUFFULL Mask */ - -#define CRPT_AES_STS_OUTBUFERR_Pos (18) /*!< CRPT_T::AES_STS: OUTBUFERR Position */ -#define CRPT_AES_STS_OUTBUFERR_Msk (0x1ul << CRPT_AES_STS_OUTBUFERR_Pos) /*!< CRPT_T::AES_STS: OUTBUFERR Mask */ - -#define CRPT_AES_STS_BUSERR_Pos (20) /*!< CRPT_T::AES_STS: BUSERR Position */ -#define CRPT_AES_STS_BUSERR_Msk (0x1ul << CRPT_AES_STS_BUSERR_Pos) /*!< CRPT_T::AES_STS: BUSERR Mask */ - -#define CRPT_AES_STS_KSERR_Pos (21) /*!< CRPT_T::AES_STS: KSERR Position */ -#define CRPT_AES_STS_KSERR_Msk (0x1ul << CRPT_AES_STS_KSERR_Pos) /*!< CRPT_T::AES_STS: KSERR Mask */ - -#define CRPT_AES_DATIN_DATIN_Pos (0) /*!< CRPT_T::AES_DATIN: DATIN Position */ -#define CRPT_AES_DATIN_DATIN_Msk (0xfffffffful << CRPT_AES_DATIN_DATIN_Pos) /*!< CRPT_T::AES_DATIN: DATIN Mask */ - -#define CRPT_AES_DATOUT_DATOUT_Pos (0) /*!< CRPT_T::AES_DATOUT: DATOUT Position */ -#define CRPT_AES_DATOUT_DATOUT_Msk (0xfffffffful << CRPT_AES_DATOUT_DATOUT_Pos) /*!< CRPT_T::AES_DATOUT: DATOUT Mask */ - -#define CRPT_AES_KEY0_KEY_Pos (0) /*!< CRPT_T::AES_KEY0: KEY Position */ -#define CRPT_AES_KEY0_KEY_Msk (0xfffffffful << CRPT_AES_KEY0_KEY_Pos) /*!< CRPT_T::AES_KEY0: KEY Mask */ - -#define CRPT_AES_KEY1_KEY_Pos (0) /*!< CRPT_T::AES_KEY1: KEY Position */ -#define CRPT_AES_KEY1_KEY_Msk (0xfffffffful << CRPT_AES_KEY1_KEY_Pos) /*!< CRPT_T::AES_KEY1: KEY Mask */ - -#define CRPT_AES_KEY2_KEY_Pos (0) /*!< CRPT_T::AES_KEY2: KEY Position */ -#define CRPT_AES_KEY2_KEY_Msk (0xfffffffful << CRPT_AES_KEY2_KEY_Pos) /*!< CRPT_T::AES_KEY2: KEY Mask */ - -#define CRPT_AES_KEY3_KEY_Pos (0) /*!< CRPT_T::AES_KEY3: KEY Position */ -#define CRPT_AES_KEY3_KEY_Msk (0xfffffffful << CRPT_AES_KEY3_KEY_Pos) /*!< CRPT_T::AES_KEY3: KEY Mask */ - -#define CRPT_AES_KEY4_KEY_Pos (0) /*!< CRPT_T::AES_KEY4: KEY Position */ -#define CRPT_AES_KEY4_KEY_Msk (0xfffffffful << CRPT_AES_KEY4_KEY_Pos) /*!< CRPT_T::AES_KEY4: KEY Mask */ - -#define CRPT_AES_KEY5_KEY_Pos (0) /*!< CRPT_T::AES_KEY5: KEY Position */ -#define CRPT_AES_KEY5_KEY_Msk (0xfffffffful << CRPT_AES_KEY5_KEY_Pos) /*!< CRPT_T::AES_KEY5: KEY Mask */ - -#define CRPT_AES_KEY6_KEY_Pos (0) /*!< CRPT_T::AES_KEY6: KEY Position */ -#define CRPT_AES_KEY6_KEY_Msk (0xfffffffful << CRPT_AES_KEY6_KEY_Pos) /*!< CRPT_T::AES_KEY6: KEY Mask */ - -#define CRPT_AES_KEY7_KEY_Pos (0) /*!< CRPT_T::AES_KEY7: KEY Position */ -#define CRPT_AES_KEY7_KEY_Msk (0xfffffffful << CRPT_AES_KEY7_KEY_Pos) /*!< CRPT_T::AES_KEY7: KEY Mask */ - -#define CRPT_AES_IV0_IV_Pos (0) /*!< CRPT_T::AES_IV0: IV Position */ -#define CRPT_AES_IV0_IV_Msk (0xfffffffful << CRPT_AES_IV0_IV_Pos) /*!< CRPT_T::AES_IV0: IV Mask */ - -#define CRPT_AES_IV1_IV_Pos (0) /*!< CRPT_T::AES_IV1: IV Position */ -#define CRPT_AES_IV1_IV_Msk (0xfffffffful << CRPT_AES_IV1_IV_Pos) /*!< CRPT_T::AES_IV1: IV Mask */ - -#define CRPT_AES_IV2_IV_Pos (0) /*!< CRPT_T::AES_IV2: IV Position */ -#define CRPT_AES_IV2_IV_Msk (0xfffffffful << CRPT_AES_IV2_IV_Pos) /*!< CRPT_T::AES_IV2: IV Mask */ - -#define CRPT_AES_IV3_IV_Pos (0) /*!< CRPT_T::AES_IV3: IV Position */ -#define CRPT_AES_IV3_IV_Msk (0xfffffffful << CRPT_AES_IV3_IV_Pos) /*!< CRPT_T::AES_IV3: IV Mask */ - -#define CRPT_AES_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES_SADDR: SADDR Position */ -#define CRPT_AES_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES_SADDR_SADDR_Pos) /*!< CRPT_T::AES_SADDR: SADDR Mask */ - -#define CRPT_AES_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES_DADDR: DADDR Position */ -#define CRPT_AES_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES_DADDR_DADDR_Pos) /*!< CRPT_T::AES_DADDR: DADDR Mask */ - -#define CRPT_AES_CNT_CNT_Pos (0) /*!< CRPT_T::AES_CNT: CNT Position */ -#define CRPT_AES_CNT_CNT_Msk (0xfffffffful << CRPT_AES_CNT_CNT_Pos) /*!< CRPT_T::AES_CNT: CNT Mask */ - -#define CRPT_HMAC_CTL_START_Pos (0) /*!< CRPT_T::HMAC_CTL: START Position */ -#define CRPT_HMAC_CTL_START_Msk (0x1ul << CRPT_HMAC_CTL_START_Pos) /*!< CRPT_T::HMAC_CTL: START Mask */ - -#define CRPT_HMAC_CTL_STOP_Pos (1) /*!< CRPT_T::HMAC_CTL: STOP Position */ -#define CRPT_HMAC_CTL_STOP_Msk (0x1ul << CRPT_HMAC_CTL_STOP_Pos) /*!< CRPT_T::HMAC_CTL: STOP Mask */ - -#define CRPT_HMAC_CTL_DMAFIRST_Pos (4) /*!< CRPT_T::HMAC_CTL: DMAFIRST Position */ -#define CRPT_HMAC_CTL_DMAFIRST_Msk (0x1ul << CRPT_HMAC_CTL_DMAFIRST_Pos) /*!< CRPT_T::HMAC_CTL: DMAFIRST Mask */ - -#define CRPT_HMAC_CTL_DMALAST_Pos (5) /*!< CRPT_T::HMAC_CTL: DMALAST Position */ -#define CRPT_HMAC_CTL_DMALAST_Msk (0x1ul << CRPT_HMAC_CTL_DMALAST_Pos) /*!< CRPT_T::HMAC_CTL: DMALAST Mask */ - -#define CRPT_HMAC_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::HMAC_CTL: DMACSCAD Position */ -#define CRPT_HMAC_CTL_DMACSCAD_Msk (0x1ul << CRPT_HMAC_CTL_DMACSCAD_Pos) /*!< CRPT_T::HMAC_CTL: DMACSCAD Mask */ - -#define CRPT_HMAC_CTL_DMAEN_Pos (7) /*!< CRPT_T::HMAC_CTL: DMAEN Position */ -#define CRPT_HMAC_CTL_DMAEN_Msk (0x1ul << CRPT_HMAC_CTL_DMAEN_Pos) /*!< CRPT_T::HMAC_CTL: DMAEN Mask */ - -#define CRPT_HMAC_CTL_OPMODE_Pos (8) /*!< CRPT_T::HMAC_CTL: OPMODE Position */ -#define CRPT_HMAC_CTL_OPMODE_Msk (0x7ul << CRPT_HMAC_CTL_OPMODE_Pos) /*!< CRPT_T::HMAC_CTL: OPMODE Mask */ - -#define CRPT_HMAC_CTL_HMACEN_Pos (11) /*!< CRPT_T::HMAC_CTL: HMACEN Position */ -#define CRPT_HMAC_CTL_HMACEN_Msk (0x1ul << CRPT_HMAC_CTL_HMACEN_Pos) /*!< CRPT_T::HMAC_CTL: HMACEN Mask */ - -#define CRPT_HMAC_CTL_SM3EN_Pos (13) /*!< CRPT_T::HMAC_CTL: SM3EN Position */ -#define CRPT_HMAC_CTL_SM3EN_Msk (0x1ul << CRPT_HMAC_CTL_SM3EN_Pos) /*!< CRPT_T::HMAC_CTL: SM3EN Mask */ - -#define CRPT_HMAC_CTL_FBIN_Pos (20) /*!< CRPT_T::HMAC_CTL: FBIN Position */ -#define CRPT_HMAC_CTL_FBIN_Msk (0x1ul << CRPT_HMAC_CTL_FBIN_Pos) /*!< CRPT_T::HMAC_CTL: FBIN Mask */ - -#define CRPT_HMAC_CTL_FBOUT_Pos (21) /*!< CRPT_T::HMAC_CTL: FBOUT Position */ -#define CRPT_HMAC_CTL_FBOUT_Msk (0x1ul << CRPT_HMAC_CTL_FBOUT_Pos) /*!< CRPT_T::HMAC_CTL: FBOUT Mask */ - -#define CRPT_HMAC_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::HMAC_CTL: OUTSWAP Position */ -#define CRPT_HMAC_CTL_OUTSWAP_Msk (0x1ul << CRPT_HMAC_CTL_OUTSWAP_Pos) /*!< CRPT_T::HMAC_CTL: OUTSWAP Mask */ - -#define CRPT_HMAC_CTL_INSWAP_Pos (23) /*!< CRPT_T::HMAC_CTL: INSWAP Position */ -#define CRPT_HMAC_CTL_INSWAP_Msk (0x1ul << CRPT_HMAC_CTL_INSWAP_Pos) /*!< CRPT_T::HMAC_CTL: INSWAP Mask */ - -#define CRPT_HMAC_STS_BUSY_Pos (0) /*!< CRPT_T::HMAC_STS: BUSY Position */ -#define CRPT_HMAC_STS_BUSY_Msk (0x1ul << CRPT_HMAC_STS_BUSY_Pos) /*!< CRPT_T::HMAC_STS: BUSY Mask */ - -#define CRPT_HMAC_STS_DMABUSY_Pos (1) /*!< CRPT_T::HMAC_STS: DMABUSY Position */ -#define CRPT_HMAC_STS_DMABUSY_Msk (0x1ul << CRPT_HMAC_STS_DMABUSY_Pos) /*!< CRPT_T::HMAC_STS: DMABUSY Mask */ - -#define CRPT_HMAC_STS_DMAERR_Pos (8) /*!< CRPT_T::HMAC_STS: DMAERR Position */ -#define CRPT_HMAC_STS_DMAERR_Msk (0x1ul << CRPT_HMAC_STS_DMAERR_Pos) /*!< CRPT_T::HMAC_STS: DMAERR Mask */ - -#define CRPT_HMAC_STS_KSERR_Pos (9) /*!< CRPT_T::HMAC_STS: KSERR Position */ -#define CRPT_HMAC_STS_KSERR_Msk (0x1ul << CRPT_HMAC_STS_KSERR_Pos) /*!< CRPT_T::HMAC_STS: KSERR Mask */ - -#define CRPT_HMAC_STS_DATINREQ_Pos (16) /*!< CRPT_T::HMAC_STS: DATINREQ Position */ -#define CRPT_HMAC_STS_DATINREQ_Msk (0x1ul << CRPT_HMAC_STS_DATINREQ_Pos) /*!< CRPT_T::HMAC_STS: DATINREQ Mask */ - -#define CRPT_HMAC_DGST0_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST0: DGST Position */ -#define CRPT_HMAC_DGST0_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST0_DGST_Pos) /*!< CRPT_T::HMAC_DGST0: DGST Mask */ - -#define CRPT_HMAC_DGST1_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST1: DGST Position */ -#define CRPT_HMAC_DGST1_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST1_DGST_Pos) /*!< CRPT_T::HMAC_DGST1: DGST Mask */ - -#define CRPT_HMAC_DGST2_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST2: DGST Position */ -#define CRPT_HMAC_DGST2_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST2_DGST_Pos) /*!< CRPT_T::HMAC_DGST2: DGST Mask */ - -#define CRPT_HMAC_DGST3_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST3: DGST Position */ -#define CRPT_HMAC_DGST3_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST3_DGST_Pos) /*!< CRPT_T::HMAC_DGST3: DGST Mask */ - -#define CRPT_HMAC_DGST4_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST4: DGST Position */ -#define CRPT_HMAC_DGST4_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST4_DGST_Pos) /*!< CRPT_T::HMAC_DGST4: DGST Mask */ - -#define CRPT_HMAC_DGST5_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST5: DGST Position */ -#define CRPT_HMAC_DGST5_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST5_DGST_Pos) /*!< CRPT_T::HMAC_DGST5: DGST Mask */ - -#define CRPT_HMAC_DGST6_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST6: DGST Position */ -#define CRPT_HMAC_DGST6_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST6_DGST_Pos) /*!< CRPT_T::HMAC_DGST6: DGST Mask */ - -#define CRPT_HMAC_DGST7_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST7: DGST Position */ -#define CRPT_HMAC_DGST7_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST7_DGST_Pos) /*!< CRPT_T::HMAC_DGST7: DGST Mask */ - -#define CRPT_HMAC_DGST8_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST8: DGST Position */ -#define CRPT_HMAC_DGST8_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST8_DGST_Pos) /*!< CRPT_T::HMAC_DGST8: DGST Mask */ - -#define CRPT_HMAC_DGST9_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST9: DGST Position */ -#define CRPT_HMAC_DGST9_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST9_DGST_Pos) /*!< CRPT_T::HMAC_DGST9: DGST Mask */ - -#define CRPT_HMAC_DGST10_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST10: DGST Position */ -#define CRPT_HMAC_DGST10_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST10_DGST_Pos) /*!< CRPT_T::HMAC_DGST10: DGST Mask */ - -#define CRPT_HMAC_DGST11_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST11: DGST Position */ -#define CRPT_HMAC_DGST11_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST11_DGST_Pos) /*!< CRPT_T::HMAC_DGST11: DGST Mask */ - -#define CRPT_HMAC_DGST12_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST12: DGST Position */ -#define CRPT_HMAC_DGST12_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST12_DGST_Pos) /*!< CRPT_T::HMAC_DGST12: DGST Mask */ - -#define CRPT_HMAC_DGST13_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST13: DGST Position */ -#define CRPT_HMAC_DGST13_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST13_DGST_Pos) /*!< CRPT_T::HMAC_DGST13: DGST Mask */ - -#define CRPT_HMAC_DGST14_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST14: DGST Position */ -#define CRPT_HMAC_DGST14_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST14_DGST_Pos) /*!< CRPT_T::HMAC_DGST14: DGST Mask */ - -#define CRPT_HMAC_DGST15_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST15: DGST Position */ -#define CRPT_HMAC_DGST15_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST15_DGST_Pos) /*!< CRPT_T::HMAC_DGST15: DGST Mask */ - -#define CRPT_HMAC_KEYCNT_KEYCNT_Pos (0) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Position */ -#define CRPT_HMAC_KEYCNT_KEYCNT_Msk (0xfffffffful << CRPT_HMAC_KEYCNT_KEYCNT_Pos) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Mask */ - -#define CRPT_HMAC_SADDR_SADDR_Pos (0) /*!< CRPT_T::HMAC_SADDR: SADDR Position */ -#define CRPT_HMAC_SADDR_SADDR_Msk (0xfffffffful << CRPT_HMAC_SADDR_SADDR_Pos) /*!< CRPT_T::HMAC_SADDR: SADDR Mask */ - -#define CRPT_HMAC_DMACNT_DMACNT_Pos (0) /*!< CRPT_T::HMAC_DMACNT: DMACNT Position */ -#define CRPT_HMAC_DMACNT_DMACNT_Msk (0xfffffffful << CRPT_HMAC_DMACNT_DMACNT_Pos) /*!< CRPT_T::HMAC_DMACNT: DMACNT Mask */ - -#define CRPT_HMAC_DATIN_DATIN_Pos (0) /*!< CRPT_T::HMAC_DATIN: DATIN Position */ -#define CRPT_HMAC_DATIN_DATIN_Msk (0xfffffffful << CRPT_HMAC_DATIN_DATIN_Pos) /*!< CRPT_T::HMAC_DATIN: DATIN Mask */ - -#define CRPT_HMAC_FDBCK0_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK0: FDBCK Position */ -#define CRPT_HMAC_FDBCK0_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK0_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK0: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK1_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK1: FDBCK Position */ -#define CRPT_HMAC_FDBCK1_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK1_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK1: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK2_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK2: FDBCK Position */ -#define CRPT_HMAC_FDBCK2_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK2_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK2: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK3_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK3: FDBCK Position */ -#define CRPT_HMAC_FDBCK3_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK3_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK3: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK4_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK4: FDBCK Position */ -#define CRPT_HMAC_FDBCK4_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK4_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK4: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK5_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK5: FDBCK Position */ -#define CRPT_HMAC_FDBCK5_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK5_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK5: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK6_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK6: FDBCK Position */ -#define CRPT_HMAC_FDBCK6_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK6_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK6: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK7_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK7: FDBCK Position */ -#define CRPT_HMAC_FDBCK7_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK7_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK7: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK8_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK8: FDBCK Position */ -#define CRPT_HMAC_FDBCK8_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK8_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK8: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK9_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK9: FDBCK Position */ -#define CRPT_HMAC_FDBCK9_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK9_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK9: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK10_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK10: FDBCK Position */ -#define CRPT_HMAC_FDBCK10_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK10_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK10: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK11_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK11: FDBCK Position */ -#define CRPT_HMAC_FDBCK11_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK11_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK11: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK12_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK12: FDBCK Position */ -#define CRPT_HMAC_FDBCK12_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK12_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK12: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK13_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK13: FDBCK Position */ -#define CRPT_HMAC_FDBCK13_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK13_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK13: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK14_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK14: FDBCK Position */ -#define CRPT_HMAC_FDBCK14_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK14_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK14: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK15_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK15: FDBCK Position */ -#define CRPT_HMAC_FDBCK15_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK15_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK15: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK16_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK16: FDBCK Position */ -#define CRPT_HMAC_FDBCK16_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK16_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK16: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK17_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK17: FDBCK Position */ -#define CRPT_HMAC_FDBCK17_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK17_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK17: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK18_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK18: FDBCK Position */ -#define CRPT_HMAC_FDBCK18_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK18_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK18: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK19_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK19: FDBCK Position */ -#define CRPT_HMAC_FDBCK19_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK19_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK19: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK20_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK20: FDBCK Position */ -#define CRPT_HMAC_FDBCK20_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK20_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK20: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK21_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK21: FDBCK Position */ -#define CRPT_HMAC_FDBCK21_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK21_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK21: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK22_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK22: FDBCK Position */ -#define CRPT_HMAC_FDBCK22_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK22_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK22: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK23_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK23: FDBCK Position */ -#define CRPT_HMAC_FDBCK23_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK23_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK23: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK24_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK24: FDBCK Position */ -#define CRPT_HMAC_FDBCK24_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK24_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK24: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK25_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK25: FDBCK Position */ -#define CRPT_HMAC_FDBCK25_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK25_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK25: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK26_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK26: FDBCK Position */ -#define CRPT_HMAC_FDBCK26_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK26_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK26: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK27_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK27: FDBCK Position */ -#define CRPT_HMAC_FDBCK27_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK27_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK27: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK28_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK28: FDBCK Position */ -#define CRPT_HMAC_FDBCK28_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK28_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK28: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK29_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK29: FDBCK Position */ -#define CRPT_HMAC_FDBCK29_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK29_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK29: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK30_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK30: FDBCK Position */ -#define CRPT_HMAC_FDBCK30_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK30_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK30: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK31_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK31: FDBCK Position */ -#define CRPT_HMAC_FDBCK31_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK31_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK31: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK32_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK32: FDBCK Position */ -#define CRPT_HMAC_FDBCK32_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK32_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK32: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK33_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK33: FDBCK Position */ -#define CRPT_HMAC_FDBCK33_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK33_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK33: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK34_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK34: FDBCK Position */ -#define CRPT_HMAC_FDBCK34_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK34_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK34: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK35_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK35: FDBCK Position */ -#define CRPT_HMAC_FDBCK35_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK35_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK35: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK36_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK36: FDBCK Position */ -#define CRPT_HMAC_FDBCK36_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK36_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK36: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK37_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK37: FDBCK Position */ -#define CRPT_HMAC_FDBCK37_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK37_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK37: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK38_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK38: FDBCK Position */ -#define CRPT_HMAC_FDBCK38_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK38_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK38: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK39_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK39: FDBCK Position */ -#define CRPT_HMAC_FDBCK39_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK39_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK39: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK40_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK40: FDBCK Position */ -#define CRPT_HMAC_FDBCK40_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK40_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK40: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK41_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK41: FDBCK Position */ -#define CRPT_HMAC_FDBCK41_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK41_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK41: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK42_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK42: FDBCK Position */ -#define CRPT_HMAC_FDBCK42_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK42_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK42: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK43_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK43: FDBCK Position */ -#define CRPT_HMAC_FDBCK43_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK43_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK43: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK44_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK44: FDBCK Position */ -#define CRPT_HMAC_FDBCK44_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK44_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK44: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK45_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK45: FDBCK Position */ -#define CRPT_HMAC_FDBCK45_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK45_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK45: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK46_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK46: FDBCK Position */ -#define CRPT_HMAC_FDBCK46_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK46_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK46: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK47_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK47: FDBCK Position */ -#define CRPT_HMAC_FDBCK47_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK47_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK47: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK48_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK48: FDBCK Position */ -#define CRPT_HMAC_FDBCK48_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK48_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK48: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK49_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK49: FDBCK Position */ -#define CRPT_HMAC_FDBCK49_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK49_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK49: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK50_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK50: FDBCK Position */ -#define CRPT_HMAC_FDBCK50_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK50_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK50: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK51_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK51: FDBCK Position */ -#define CRPT_HMAC_FDBCK51_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK51_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK51: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK52_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK52: FDBCK Position */ -#define CRPT_HMAC_FDBCK52_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK52_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK52: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK53_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK53: FDBCK Position */ -#define CRPT_HMAC_FDBCK53_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK53_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK53: FDBCK Mask */ - -#define CRPT_HMAC_FBADDR_FBADDR_Pos (0) /*!< CRPT_T::HMAC_FBADDR: FBADDR Position */ -#define CRPT_HMAC_FBADDR_FBADDR_Msk (0xfffffffful << CRPT_HMAC_FBADDR_FBADDR_Pos) /*!< CRPT_T::HMAC_FBADDR: FBADDR Mask */ - -#define CRPT_ECC_CTL_START_Pos (0) /*!< CRPT_T::ECC_CTL: START Position */ -#define CRPT_ECC_CTL_START_Msk (0x1ul << CRPT_ECC_CTL_START_Pos) /*!< CRPT_T::ECC_CTL: START Mask */ - -#define CRPT_ECC_CTL_STOP_Pos (1) /*!< CRPT_T::ECC_CTL: STOP Position */ -#define CRPT_ECC_CTL_STOP_Msk (0x1ul << CRPT_ECC_CTL_STOP_Pos) /*!< CRPT_T::ECC_CTL: STOP Mask */ - -#define CRPT_ECC_CTL_PFA2C_Pos (3) /*!< CRPT_T::ECC_CTL: PFA2C Position */ -#define CRPT_ECC_CTL_PFA2C_Msk (0x1ul << CRPT_ECC_CTL_PFA2C_Pos) /*!< CRPT_T::ECC_CTL: PFA2C Mask */ - -#define CRPT_ECC_CTL_ECDSAS_Pos (4) /*!< CRPT_T::ECC_CTL: ECDSAS Position */ -#define CRPT_ECC_CTL_ECDSAS_Msk (0x1ul << CRPT_ECC_CTL_ECDSAS_Pos) /*!< CRPT_T::ECC_CTL: ECDSAS Mask */ - -#define CRPT_ECC_CTL_ECDSAR_Pos (5) /*!< CRPT_T::ECC_CTL: ECDSAR Position */ -#define CRPT_ECC_CTL_ECDSAR_Msk (0x1ul << CRPT_ECC_CTL_ECDSAR_Pos) /*!< CRPT_T::ECC_CTL: ECDSAR Mask */ - -#define CRPT_ECC_CTL_DMAEN_Pos (7) /*!< CRPT_T::ECC_CTL: DMAEN Position */ -#define CRPT_ECC_CTL_DMAEN_Msk (0x1ul << CRPT_ECC_CTL_DMAEN_Pos) /*!< CRPT_T::ECC_CTL: DMAEN Mask */ - -#define CRPT_ECC_CTL_FSEL_Pos (8) /*!< CRPT_T::ECC_CTL: FSEL Position */ -#define CRPT_ECC_CTL_FSEL_Msk (0x1ul << CRPT_ECC_CTL_FSEL_Pos) /*!< CRPT_T::ECC_CTL: FSEL Mask */ - -#define CRPT_ECC_CTL_ECCOP_Pos (9) /*!< CRPT_T::ECC_CTL: ECCOP Position */ -#define CRPT_ECC_CTL_ECCOP_Msk (0x3ul << CRPT_ECC_CTL_ECCOP_Pos) /*!< CRPT_T::ECC_CTL: ECCOP Mask */ - -#define CRPT_ECC_CTL_MODOP_Pos (11) /*!< CRPT_T::ECC_CTL: MODOP Position */ -#define CRPT_ECC_CTL_MODOP_Msk (0x3ul << CRPT_ECC_CTL_MODOP_Pos) /*!< CRPT_T::ECC_CTL: MODOP Mask */ - -#define CRPT_ECC_CTL_CSEL_Pos (13) /*!< CRPT_T::ECC_CTL: CSEL Position */ -#define CRPT_ECC_CTL_CSEL_Msk (0x1ul << CRPT_ECC_CTL_CSEL_Pos) /*!< CRPT_T::ECC_CTL: CSEL Mask */ - -#define CRPT_ECC_CTL_SCAP_Pos (14) /*!< CRPT_T::ECC_CTL: SCAP Position */ -#define CRPT_ECC_CTL_SCAP_Msk (0x1ul << CRPT_ECC_CTL_SCAP_Pos) /*!< CRPT_T::ECC_CTL: SCAP Mask */ - -#define CRPT_ECC_CTL_SBM_Pos (15) /*!< CRPT_T::ECC_CTL: SBM Position */ -#define CRPT_ECC_CTL_SBM_Msk (0x1ul << CRPT_ECC_CTL_SBM_Pos) /*!< CRPT_T::ECC_CTL: SBM Mask */ - -#define CRPT_ECC_CTL_LDP1_Pos (16) /*!< CRPT_T::ECC_CTL: LDP1 Position */ -#define CRPT_ECC_CTL_LDP1_Msk (0x1ul << CRPT_ECC_CTL_LDP1_Pos) /*!< CRPT_T::ECC_CTL: LDP1 Mask */ - -#define CRPT_ECC_CTL_LDP2_Pos (17) /*!< CRPT_T::ECC_CTL: LDP2 Position */ -#define CRPT_ECC_CTL_LDP2_Msk (0x1ul << CRPT_ECC_CTL_LDP2_Pos) /*!< CRPT_T::ECC_CTL: LDP2 Mask */ - -#define CRPT_ECC_CTL_LDA_Pos (18) /*!< CRPT_T::ECC_CTL: LDA Position */ -#define CRPT_ECC_CTL_LDA_Msk (0x1ul << CRPT_ECC_CTL_LDA_Pos) /*!< CRPT_T::ECC_CTL: LDA Mask */ - -#define CRPT_ECC_CTL_LDB_Pos (19) /*!< CRPT_T::ECC_CTL: LDB Position */ -#define CRPT_ECC_CTL_LDB_Msk (0x1ul << CRPT_ECC_CTL_LDB_Pos) /*!< CRPT_T::ECC_CTL: LDB Mask */ - -#define CRPT_ECC_CTL_LDN_Pos (20) /*!< CRPT_T::ECC_CTL: LDN Position */ -#define CRPT_ECC_CTL_LDN_Msk (0x1ul << CRPT_ECC_CTL_LDN_Pos) /*!< CRPT_T::ECC_CTL: LDN Mask */ - -#define CRPT_ECC_CTL_LDK_Pos (21) /*!< CRPT_T::ECC_CTL: LDK Position */ -#define CRPT_ECC_CTL_LDK_Msk (0x1ul << CRPT_ECC_CTL_LDK_Pos) /*!< CRPT_T::ECC_CTL: LDK Mask */ - -#define CRPT_ECC_CTL_CURVEM_Pos (22) /*!< CRPT_T::ECC_CTL: CURVEM Position */ -#define CRPT_ECC_CTL_CURVEM_Msk (0x3fful << CRPT_ECC_CTL_CURVEM_Pos) /*!< CRPT_T::ECC_CTL: CURVEM Mask */ - -#define CRPT_ECC_STS_BUSY_Pos (0) /*!< CRPT_T::ECC_STS: BUSY Position */ -#define CRPT_ECC_STS_BUSY_Msk (0x1ul << CRPT_ECC_STS_BUSY_Pos) /*!< CRPT_T::ECC_STS: BUSY Mask */ - -#define CRPT_ECC_STS_DMABUSY_Pos (1) /*!< CRPT_T::ECC_STS: DMABUSY Position */ -#define CRPT_ECC_STS_DMABUSY_Msk (0x1ul << CRPT_ECC_STS_DMABUSY_Pos) /*!< CRPT_T::ECC_STS: DMABUSY Mask */ - -#define CRPT_ECC_STS_BUSERR_Pos (16) /*!< CRPT_T::ECC_STS: BUSERR Position */ -#define CRPT_ECC_STS_BUSERR_Msk (0x1ul << CRPT_ECC_STS_BUSERR_Pos) /*!< CRPT_T::ECC_STS: BUSERR Mask */ - -#define CRPT_ECC_STS_KSERR_Pos (17) /*!< CRPT_T::ECC_STS: KSERR Position */ -#define CRPT_ECC_STS_KSERR_Msk (0x1ul << CRPT_ECC_STS_KSERR_Pos) /*!< CRPT_T::ECC_STS: KSERR Mask */ - -#define CRPT_ECC_X1_Pos (0) /*!< CRPT_T::ECC_X1: POINTX Position */ -#define CRPT_ECC_X1_Msk (0xfffffffful << CRPT_ECC_X1_Pos) /*!< CRPT_T::ECC_X1: POINTX Mask */ - - -#define CRPT_ECC_X2_Pos (0) /*!< CRPT_T::ECC_X2: POINTX2 Position */ -#define CRPT_ECC_X2TX_Msk (0xfffffffful << CRPT_ECC_X2_Pos) /*!< CRPT_T::ECC_X2: POINTX2 Mask */ - - -#define CRPT_ECC_Y2_Pos (0) /*!< CRPT_T::ECC_Y2: POINTY2 Position */ -#define CRPT_ECC_Y2_Msk (0xfffffffful << CRPT_ECC_Y2_Pos) /*!< CRPT_T::ECC_Y2: POINTY2 Mask */ - -#define CRPT_ECC_A_Pos (0) /*!< CRPT_T::ECC_A: CURVEA Position */ -#define CRPT_ECC_A_Msk (0xfffffffful << CRPT_ECC_A_Pos) /*!< CRPT_T::ECC_A: CURVEA Mask */ - -#define CRPT_ECC_B_Pos (0) /*!< CRPT_T::ECC_B: CURVEB Position */ -#define CRPT_ECC_B_Msk (0xfffffffful << CRPT_ECC_B_Pos) /*!< CRPT_T::ECC_B: CURVEB Mask */ - -#define CRPT_ECC_N_Pos (0) /*!< CRPT_T::ECC_N: SCALARK Position */ -#define CRPT_ECC_N_Msk (0xfffffffful << CRPT_ECC_N_Pos) /*!< CRPT_T::ECC_N: SCALARK Mask */ - -#define CRPT_ECC_DADDR_DADDR_Pos (0) /*!< CRPT_T::ECC_DADDR: DADDR Position */ -#define CRPT_ECC_DADDR_DADDR_Msk (0xfffffffful << CRPT_ECC_DADDR_DADDR_Pos) /*!< CRPT_T::ECC_DADDR: DADDR Mask */ - -#define CRPT_ECC_STARTREG_STARTREG_Pos (0) /*!< CRPT_T::ECC_STARTREG: STARTREG Position*/ -#define CRPT_ECC_STARTREG_STARTREG_Msk (0xfffffffful << CRPT_ECC_STARTREG_STARTREG_Pos) /*!< CRPT_T::ECC_STARTREG: STARTREG Mask */ - -#define CRPT_ECC_WORDCNT_WORDCNT_Pos (0) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Position*/ -#define CRPT_ECC_WORDCNT_WORDCNT_Msk (0xfffffffful << CRPT_ECC_WORDCNT_WORDCNT_Pos) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Mask */ - -#define CRPT_RSA_CTL_START_Pos (0) /*!< CRPT_T::RSA_CTL: START Position */ -#define CRPT_RSA_CTL_START_Msk (0x1ul << CRPT_RSA_CTL_START_Pos) /*!< CRPT_T::RSA_CTL: START Mask */ - -#define CRPT_RSA_CTL_STOP_Pos (1) /*!< CRPT_T::RSA_CTL: STOP Position */ -#define CRPT_RSA_CTL_STOP_Msk (0x1ul << CRPT_RSA_CTL_STOP_Pos) /*!< CRPT_T::RSA_CTL: STOP Mask */ - -#define CRPT_RSA_CTL_CRT_Pos (2) /*!< CRPT_T::RSA_CTL: CRT Position */ -#define CRPT_RSA_CTL_CRT_Msk (0x1ul << CRPT_RSA_CTL_CRT_Pos) /*!< CRPT_T::RSA_CTL: CRT Mask */ - -#define CRPT_RSA_CTL_CRTBYP_Pos (3) /*!< CRPT_T::RSA_CTL: CRTBYP Position */ -#define CRPT_RSA_CTL_CRTBYP_Msk (0x1ul << CRPT_RSA_CTL_CRTBYP_Pos) /*!< CRPT_T::RSA_CTL: CRTBYP Mask */ - -#define CRPT_RSA_CTL_KEYLENG_Pos (4) /*!< CRPT_T::RSA_CTL: KEYLENG Position */ -#define CRPT_RSA_CTL_KEYLENG_Msk (0x3ul << CRPT_RSA_CTL_KEYLENG_Pos) /*!< CRPT_T::RSA_CTL: KEYLENG Mask */ - -#define CRPT_RSA_CTL_SCAP_Pos (8) /*!< CRPT_T::RSA_CTL: SCAP Position */ -#define CRPT_RSA_CTL_SCAP_Msk (0x1ul << CRPT_RSA_CTL_SCAP_Pos) /*!< CRPT_T::RSA_CTL: SCAP Mask */ - -#define CRPT_RSA_STS_BUSY_Pos (0) /*!< CRPT_T::RSA_STS: BUSY Position */ -#define CRPT_RSA_STS_BUSY_Msk (0x1ul << CRPT_RSA_STS_BUSY_Pos) /*!< CRPT_T::RSA_STS: BUSY Mask */ - -#define CRPT_RSA_STS_DMABUSY_Pos (1) /*!< CRPT_T::RSA_STS: DMABUSY Position */ -#define CRPT_RSA_STS_DMABUSY_Msk (0x1ul << CRPT_RSA_STS_DMABUSY_Pos) /*!< CRPT_T::RSA_STS: DMABUSY Mask */ - -#define CRPT_RSA_STS_BUSERR_Pos (16) /*!< CRPT_T::RSA_STS: BUSERR Position */ -#define CRPT_RSA_STS_BUSERR_Msk (0x1ul << CRPT_RSA_STS_BUSERR_Pos) /*!< CRPT_T::RSA_STS: BUSERR Mask */ - -#define CRPT_RSA_STS_CTLERR_Pos (17) /*!< CRPT_T::RSA_STS: CTLERR Position */ -#define CRPT_RSA_STS_CTLERR_Msk (0x1ul << CRPT_RSA_STS_CTLERR_Pos) /*!< CRPT_T::RSA_STS: CTLERR Mask */ - -#define CRPT_RSA_STS_KSERR_Pos (18) /*!< CRPT_T::RSA_STS: KSERR Position */ -#define CRPT_RSA_STS_KSERR_Msk (0x1ul << CRPT_RSA_STS_KSERR_Pos) /*!< CRPT_T::RSA_STS: KSERR Mask */ - -#define CRPT_RSA_SADDR_Pos (0) /*!< CRPT_T::RSA_SADDR: SADDR Position */ -#define CRPT_RSA_SADDR_Msk (0xfffffffful << CRPT_RSA_SADDR_Pos) /*!< CRPT_T::RSA_SADDR: SADDR Mask */ - -#define CRPT_RSA_DADDR_Pos (0) /*!< CRPT_T::RSA_DADDR: DADDR Position */ -#define CRPT_RSA_DADDR_Msk (0xfffffffful << CRPT_RSA_DADDR_Pos) /*!< CRPT_T::RSA_DADDR: DADDR Mask */ - -#define CRPT_RSA_MADDR_Pos (0) /*!< CRPT_T::RSA_MADDR: MADDR Position */ -#define CRPT_RSA_MADDR_Msk (0xfffffffful << CRPT_RSA_MADDR_Pos) /*!< CRPT_T::RSA_MADDR: MADDR Mask */ - -#define CRPT_PRNG_KSCTL_NUM_Pos (0) /*!< CRPT_T::PRNG_KSCTL: NUM Position */ -#define CRPT_PRNG_KSCTL_NUM_Msk (0x1ful << CRPT_PRNG_KSCTL_NUM_Pos) /*!< CRPT_T::PRNG_KSCTL: NUM Mask */ - -#define CRPT_PRNG_KSCTL_TRUST_Pos (16) /*!< CRPT_T::PRNG_KSCTL: TRUST Position */ -#define CRPT_PRNG_KSCTL_TRUST_Msk (0x1ul << CRPT_PRNG_KSCTL_TRUST_Pos) /*!< CRPT_T::PRNG_KSCTL: TRUST Mask */ - -#define CRPT_PRNG_KSCTL_PRIV_Pos (18) /*!< CRPT_T::PRNG_KSCTL: PRIV Position */ -#define CRPT_PRNG_KSCTL_PRIV_Msk (0x1ul << CRPT_PRNG_KSCTL_PRIV_Pos) /*!< CRPT_T::PRNG_KSCTL: PRIV Mask */ - -#define CRPT_PRNG_KSCTL_ECDH_Pos (19) /*!< CRPT_T::PRNG_KSCTL: ECDH Position */ -#define CRPT_PRNG_KSCTL_ECDH_Msk (0x1ul << CRPT_PRNG_KSCTL_ECDH_Pos) /*!< CRPT_T::PRNG_KSCTL: ECDH Mask */ - -#define CRPT_PRNG_KSCTL_ECDSA_Pos (20) /*!< CRPT_T::PRNG_KSCTL: ECDSA Position */ -#define CRPT_PRNG_KSCTL_ECDSA_Msk (0x1ul << CRPT_PRNG_KSCTL_ECDSA_Pos) /*!< CRPT_T::PRNG_KSCTL: ECDSA Mask */ - -#define CRPT_PRNG_KSCTL_WDST_Pos (21) /*!< CRPT_T::PRNG_KSCTL: WDST Position */ -#define CRPT_PRNG_KSCTL_WDST_Msk (0x1ul << CRPT_PRNG_KSCTL_WDST_Pos) /*!< CRPT_T::PRNG_KSCTL: WDST Mask */ - -#define CRPT_PRNG_KSCTL_WSDST_Pos (22) /*!< CRPT_T::PRNG_KSCTL: WSDST Position */ -#define CRPT_PRNG_KSCTL_WSDST_Msk (0x3ul << CRPT_PRNG_KSCTL_WSDST_Pos) /*!< CRPT_T::PRNG_KSCTL: WSDST Mask */ - -#define CRPT_PRNG_KSCTL_OWNER_Pos (24) /*!< CRPT_T::PRNG_KSCTL: OWNER Position */ -#define CRPT_PRNG_KSCTL_OWNER_Msk (0x7ul << CRPT_PRNG_KSCTL_OWNER_Pos) /*!< CRPT_T::PRNG_KSCTL: OWNER Mask */ - -#define CRPT_PRNG_KSSTS_NUM_Pos (0) /*!< CRPT_T::PRNG_KSSTS: NUM Position */ -#define CRPT_PRNG_KSSTS_NUM_Msk (0x1ful << CRPT_PRNG_KSSTS_NUM_Pos) /*!< CRPT_T::PRNG_KSSTS: NUM Mask */ - -#define CRPT_PRNG_KSSTS_KCTLERR_Pos (16) /*!< CRPT_T::PRNG_KSSTS: KCTLERR Position */ -#define CRPT_PRNG_KSSTS_KCTLERR_Msk (0x1ul << CRPT_PRNG_KSSTS_KCTLERR_Pos) /*!< CRPT_T::PRNG_KSSTS: KCTLERR Mask */ - -#define CRPT_AES_KSCTL_NUM_Pos (0) /*!< CRPT_T::AES_KSCTL: NUM Position */ -#define CRPT_AES_KSCTL_NUM_Msk (0x1ful << CRPT_AES_KSCTL_NUM_Pos) /*!< CRPT_T::AES_KSCTL: NUM Mask */ - -#define CRPT_AES_KSCTL_RSRC_Pos (5) /*!< CRPT_T::AES_KSCTL: RSRC Position */ -#define CRPT_AES_KSCTL_RSRC_Msk (0x1ul << CRPT_AES_KSCTL_RSRC_Pos) /*!< CRPT_T::AES_KSCTL: RSRC Mask */ - -#define CRPT_AES_KSCTL_RSSRC_Pos (6) /*!< CRPT_T::AES_KSCTL: RSSRC Position */ -#define CRPT_AES_KSCTL_RSSRC_Msk (0x3ul << CRPT_AES_KSCTL_RSSRC_Pos) /*!< CRPT_T::AES_KSCTL: RSSRC Mask */ - -#define CRPT_HMAC_KSCTL_NUM_Pos (0) /*!< CRPT_T::HMAC_KSCTL: NUM Position */ -#define CRPT_HMAC_KSCTL_NUM_Msk (0x1ful << CRPT_HMAC_KSCTL_NUM_Pos) /*!< CRPT_T::HMAC_KSCTL: NUM Mask */ - -#define CRPT_HMAC_KSCTL_RSRC_Pos (5) /*!< CRPT_T::HMAC_KSCTL: RSRC Position */ -#define CRPT_HMAC_KSCTL_RSRC_Msk (0x1ul << CRPT_HMAC_KSCTL_RSRC_Pos) /*!< CRPT_T::HMAC_KSCTL: RSRC Mask */ - -#define CRPT_HMAC_KSCTL_RSSRC_Pos (6) /*!< CRPT_T::HMAC_KSCTL: RSSRC Position */ -#define CRPT_HMAC_KSCTL_RSSRC_Msk (0x3ul << CRPT_HMAC_KSCTL_RSSRC_Pos) /*!< CRPT_T::HMAC_KSCTL: RSSRC Mask */ - -#define CRPT_ECC_KSCTL_NUMK_Pos (0) /*!< CRPT_T::ECC_KSCTL: NUMK Position */ -#define CRPT_ECC_KSCTL_NUMK_Msk (0x1ful << CRPT_ECC_KSCTL_NUMK_Pos) /*!< CRPT_T::ECC_KSCTL: NUMK Mask */ - -#define CRPT_ECC_KSCTL_RSRCK_Pos (5) /*!< CRPT_T::ECC_KSCTL: RSRCK Position */ -#define CRPT_ECC_KSCTL_RSRCK_Msk (0x1ul << CRPT_ECC_KSCTL_RSRCK_Pos) /*!< CRPT_T::ECC_KSCTL: RSRCK Mask */ - -#define CRPT_ECC_KSCTL_RSSRCK_Pos (6) /*!< CRPT_T::ECC_KSCTL: RSSRCK Position */ -#define CRPT_ECC_KSCTL_RSSRCK_Msk (0x3ul << CRPT_ECC_KSCTL_RSSRCK_Pos) /*!< CRPT_T::ECC_KSCTL: RSSRCK Mask */ - -#define CRPT_ECC_KSCTL_ECDH_Pos (14) /*!< CRPT_T::ECC_KSCTL: ECDH Position */ -#define CRPT_ECC_KSCTL_ECDH_Msk (0x1ul << CRPT_ECC_KSCTL_ECDH_Pos) /*!< CRPT_T::ECC_KSCTL: ECDH Mask */ - -#define CRPT_ECC_KSCTL_TRUST_Pos (16) /*!< CRPT_T::ECC_KSCTL: TRUST Position */ -#define CRPT_ECC_KSCTL_TRUST_Msk (0x1ul << CRPT_ECC_KSCTL_TRUST_Pos) /*!< CRPT_T::ECC_KSCTL: TRUST Mask */ - -#define CRPT_ECC_KSCTL_PRIV_Pos (18) /*!< CRPT_T::ECC_KSCTL: PRIV Position */ -#define CRPT_ECC_KSCTL_PRIV_Msk (0x1ul << CRPT_ECC_KSCTL_PRIV_Pos) /*!< CRPT_T::ECC_KSCTL: PRIV Mask */ - -#define CRPT_ECC_KSCTL_XY_Pos (20) /*!< CRPT_T::ECC_KSCTL: XY Position */ -#define CRPT_ECC_KSCTL_XY_Msk (0x1ul << CRPT_ECC_KSCTL_XY_Pos) /*!< CRPT_T::ECC_KSCTL: XY Mask */ - -#define CRPT_ECC_KSCTL_WDST_Pos (21) /*!< CRPT_T::ECC_KSCTL: WDST Position */ -#define CRPT_ECC_KSCTL_WDST_Msk (0x1ul << CRPT_ECC_KSCTL_WDST_Pos) /*!< CRPT_T::ECC_KSCTL: WDST Mask */ - -#define CRPT_ECC_KSCTL_WSDST_Pos (22) /*!< CRPT_T::ECC_KSCTL: WSDST Position */ -#define CRPT_ECC_KSCTL_WSDST_Msk (0x3ul << CRPT_ECC_KSCTL_WSDST_Pos) /*!< CRPT_T::ECC_KSCTL: WSDST Mask */ - -#define CRPT_ECC_KSCTL_OWNER_Pos (24) /*!< CRPT_T::ECC_KSCTL: OWNER Position */ -#define CRPT_ECC_KSCTL_OWNER_Msk (0x7ul << CRPT_ECC_KSCTL_OWNER_Pos) /*!< CRPT_T::ECC_KSCTL: OWNER Mask */ - -#define CRPT_ECC_KSSTS_NUM_Pos (0) /*!< CRPT_T::ECC_KSSTS: NUM Position */ -#define CRPT_ECC_KSSTS_NUM_Msk (0x1ful << CRPT_ECC_KSSTS_NUM_Pos) /*!< CRPT_T::ECC_KSSTS: NUM Mask */ - -#define CRPT_ECC_KSXY_NUMX_Pos (0) /*!< CRPT_T::ECC_KSXY: NUMX Position */ -#define CRPT_ECC_KSXY_NUMX_Msk (0x1ful << CRPT_ECC_KSXY_NUMX_Pos) /*!< CRPT_T::ECC_KSXY: NUMX Mask */ - -#define CRPT_ECC_KSXY_RSRCXY_Pos (5) /*!< CRPT_T::ECC_KSXY: RSRCXY Position */ -#define CRPT_ECC_KSXY_RSRCXY_Msk (0x1ul << CRPT_ECC_KSXY_RSRCXY_Pos) /*!< CRPT_T::ECC_KSXY: RSRCXY Mask */ - -#define CRPT_ECC_KSXY_RSSRCX_Pos (6) /*!< CRPT_T::ECC_KSXY: RSSRCX Position */ -#define CRPT_ECC_KSXY_RSSRCX_Msk (0x3ul << CRPT_ECC_KSXY_RSSRCX_Pos) /*!< CRPT_T::ECC_KSXY: RSSRCX Mask */ - -#define CRPT_ECC_KSXY_NUMY_Pos (8) /*!< CRPT_T::ECC_KSXY: NUMY Position */ -#define CRPT_ECC_KSXY_NUMY_Msk (0x1ful << CRPT_ECC_KSXY_NUMY_Pos) /*!< CRPT_T::ECC_KSXY: NUMY Mask */ - -#define CRPT_ECC_KSXY_RSSRCY_Pos (14) /*!< CRPT_T::ECC_KSXY: RSSRCY Position */ -#define CRPT_ECC_KSXY_RSSRCY_Msk (0x3ul << CRPT_ECC_KSXY_RSSRCY_Pos) /*!< CRPT_T::ECC_KSXY: RSSRCY Mask */ - -#define CRPT_RSA_KSCTL_NUM_Pos (0) /*!< CRPT_T::RSA_KSCTL: NUM Position */ -#define CRPT_RSA_KSCTL_NUM_Msk (0x1ful << CRPT_RSA_KSCTL_NUM_Pos) /*!< CRPT_T::RSA_KSCTL: NUM Mask */ - -#define CRPT_RSA_KSCTL_RSRC_Pos (5) /*!< CRPT_T::RSA_KSCTL: RSRC Position */ -#define CRPT_RSA_KSCTL_RSRC_Msk (0x1ul << CRPT_RSA_KSCTL_RSRC_Pos) /*!< CRPT_T::RSA_KSCTL: RSRC Mask */ - -#define CRPT_RSA_KSCTL_RSSRC_Pos (6) /*!< CRPT_T::RSA_KSCTL: RSSRC Position */ -#define CRPT_RSA_KSCTL_RSSRC_Msk (0x3ul << CRPT_RSA_KSCTL_RSSRC_Pos) /*!< CRPT_T::RSA_KSCTL: RSSRC Mask */ - -#define CRPT_RSA_KSCTL_BKNUM_Pos (8) /*!< CRPT_T::RSA_KSCTL: BKNUM Position */ -#define CRPT_RSA_KSCTL_BKNUM_Msk (0x1ful << CRPT_RSA_KSCTL_BKNUM_Pos) /*!< CRPT_T::RSA_KSCTL: BKNUM Mask */ - -#define CRPT_RSA_KSSTS0_NUM0_Pos (0) /*!< CRPT_T::RSA_KSSTS0: NUM0 Position */ -#define CRPT_RSA_KSSTS0_NUM0_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM0_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM0 Mask */ - -#define CRPT_RSA_KSSTS0_NUM1_Pos (8) /*!< CRPT_T::RSA_KSSTS0: NUM1 Position */ -#define CRPT_RSA_KSSTS0_NUM1_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM1_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM1 Mask */ - -#define CRPT_RSA_KSSTS0_NUM2_Pos (16) /*!< CRPT_T::RSA_KSSTS0: NUM2 Position */ -#define CRPT_RSA_KSSTS0_NUM2_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM2_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM2 Mask */ - -#define CRPT_RSA_KSSTS0_NUM3_Pos (24) /*!< CRPT_T::RSA_KSSTS0: NUM3 Position */ -#define CRPT_RSA_KSSTS0_NUM3_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM3_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM3 Mask */ - -#define CRPT_RSA_KSSTS1_NUM4_Pos (0) /*!< CRPT_T::RSA_KSSTS1: NUM4 Position */ -#define CRPT_RSA_KSSTS1_NUM4_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM4_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM4 Mask */ - -#define CRPT_RSA_KSSTS1_NUM5_Pos (8) /*!< CRPT_T::RSA_KSSTS1: NUM5 Position */ -#define CRPT_RSA_KSSTS1_NUM5_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM5_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM5 Mask */ - -#define CRPT_RSA_KSSTS1_NUM6_Pos (16) /*!< CRPT_T::RSA_KSSTS1: NUM6 Position */ -#define CRPT_RSA_KSSTS1_NUM6_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM6_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM6 Mask */ - -#define CRPT_RSA_KSSTS1_NUM7_Pos (24) /*!< CRPT_T::RSA_KSSTS1: NUM7 Position */ -#define CRPT_RSA_KSSTS1_NUM7_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM7_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM7 Mask */ - -#define CRPT_VERSION_MINOR_Pos (0) /*!< CRPT_T::VERSION: MINOR Position */ -#define CRPT_VERSION_MINOR_Msk (0xfffful << CRPT_VERSION_MINOR_Pos) /*!< CRPT_T::VERSION: MINOR Mask */ - -#define CRPT_VERSION_SUB_Pos (16) /*!< CRPT_T::VERSION: SUB Position */ -#define CRPT_VERSION_SUB_Msk (0xfful << CRPT_VERSION_SUB_Pos) /*!< CRPT_T::VERSION: SUB Mask */ - -#define CRPT_VERSION_MAJOR_Pos (24) /*!< CRPT_T::VERSION: MAJOR Position */ -#define CRPT_VERSION_MAJOR_Msk (0xfful << CRPT_VERSION_MAJOR_Pos) /*!< CRPT_T::VERSION: MAJOR Mask */ - -/**@}*/ /* CRPT_CONST */ -/**@}*/ /* end of CRYPTO register group */ - - -/**@}*/ /* end of REGISTER group */ - -#endif /* __CRPT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/dac_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/dac_reg.h deleted file mode 100644 index 564203dbf3a..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/dac_reg.h +++ /dev/null @@ -1,208 +0,0 @@ -/**************************************************************************//** - * @file dac_reg.h - * @version V1.00 - * @brief DAC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __DAC_REG_H__ -#define __DAC_REG_H__ - - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Digital to Analog Converter -------------------------*/ -/** - @addtogroup DAC Digital to Analog Converter(DAC) - Memory Mapped Structure for DAC Controller - @{ -*/ - - -typedef struct -{ - - - - /** - * @var DAC_T::CTL - * Offset: 0x00 DAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DACEN |DAC Enable Bit - * | | |0 = DAC is Disabled. - * | | |1 = DAC is Enabled. - * |[1] |DACIEN |DAC Interrupt Enable Bit - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[2] |DMAEN |DMA Mode Enable Bit - * | | |0 = DMA mode Disabled. - * | | |1 = DMA mode Enabled. - * |[3] |DMAURIEN |DMA Under-run Interrupt Enable Bit - * | | |0 = DMA under-run interrupt Disabled. - * | | |1 = DMA under-run interrupt Enabled. - * |[4] |TRGEN |Trigger Mode Enable Bit - * | | |0 = DAC event trigger mode Disabled. - * | | |1 = DAC event trigger mode Enabled. - * |[7:5] |TRGSEL |Trigger Source Selection - * | | |000 = Software trigger. - * | | |001 = External pin DAC0_ST trigger. - * | | |010 = Timer 0 trigger. - * | | |011 = Timer 1 trigger. - * | | |100 = Timer 2 trigger. - * | | |101 = Timer 3 trigger. - * | | |110 = EPWM0 trigger. - * | | |111 = EPWM1 trigger. - * |[8] |BYPASS |Bypass Buffer Mode - * | | |0 = Output voltage buffer Enabled. - * | | |1 = Output voltage buffer Disabled. - * |[10] |LALIGN |DAC Data Left-aligned Enabled Control - * | | |0 = Right alignment. - * | | |1 = Left alignment. - * |[13:12] |ETRGSEL |External Pin Trigger Selection - * | | |00 = Low level trigger. - * | | |01 = High level trigger. - * | | |10 = Falling edge trigger. - * | | |11 = Rising edge trigger. - * |[15:14] |BWSEL |DAC Data Bit-width Selection - * | | |00 = data is 12 bits. - * | | |01 = data is 8 bits. - * | | |Others = reserved. - * |[16] |GRPEN |DAC Group Mode Enable Bit - * | | |0 = DAC0 and DAC1 are not grouped. - * | | |1 = DAC0 and DAC1 are grouped. - * @var DAC_T::SWTRG - * Offset: 0x04 DAC Software Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWTRG |Software Trigger - * | | |0 = Software trigger Disabled. - * | | |1 = Software trigger Enabled. - * | | |User writes this bit to generate one shot pulse and it is cleared to 0 by hardware automatically; Reading this bit will always get 0. - * @var DAC_T::DAT - * Offset: 0x08 DAC Data Holding Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DACDAT |DAC 12-bit Holding Data - * | | |These bits are written by user software which specifies 12-bit conversion data for DAC output. - * | | |The unused bits (DACDAT[3:0] in left-alignment mode and DACDAT[15:12] in right alignment mode) are ignored by DAC controller hardware. - * | | |12 bit left alignment: user has to load data into DACDAT[15:4] bits. - * | | |12 bit right alignment: user has to load data into DACDAT[11:0] bits. - * @var DAC_T::DATOUT - * Offset: 0x0C DAC Data Output Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DATOUT |DAC 12-bit Output Data - * | | |These bits are current digital data for DAC output conversion. - * | | |It is loaded from DAC_DAT register and user cannot write it directly. - * @var DAC_T::STATUS - * Offset: 0x10 DAC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FINISH |DAC Conversion Complete Finish Flag - * | | |0 = DAC is in conversion state. - * | | |1 = DAC conversion finish. - * | | |This bit set to 1 when conversion time counter counts to SETTLET. - * | | |It is cleared to 0 when DAC starts a new conversion. - * | | |User writes 1 to clear this bit to 0. - * |[1] |DMAUDR |DMA Under-run Interrupt Flag - * | | |0 = No DMA under-run error condition occurred. - * | | |1 = DMA under-run error condition occurred. - * | | |User writes 1 to clear this bit. - * |[8] |BUSY |DAC Busy Flag (Read Only) - * | | |0 = DAC is ready for next conversion. - * | | |1 = DAC is busy in conversion. - * | | |This is read only bit. - * @var DAC_T::TCTL - * Offset: 0x14 DAC Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |SETTLET |DAC Output Settling Time - * | | |User software needs to write appropriate value to these bits to meet DAC conversion settling time base on PCLK (APB clock) speed. - * | | |For example, DAC controller clock speed is 64MHz and DAC conversion setting time is 1 us, SETTLET value must be greater than 0x40. - */ - __IO uint32_t CTL; /*!< [0x0000] DAC Control Register */ - __IO uint32_t SWTRG; /*!< [0x0004] DAC Software Trigger Control Register */ - __IO uint32_t DAT; /*!< [0x0008] DAC Data Holding Register */ - __I uint32_t DATOUT; /*!< [0x000c] DAC Data Output Register */ - __IO uint32_t STATUS; /*!< [0x0010] DAC Status Register */ - __IO uint32_t TCTL; /*!< [0x0014] DAC Timing Control Register */ - -} DAC_T; - -/** - @addtogroup DAC_CONST DAC Bit Field Definition - Constant Definitions for DAC Controller - @{ -*/ - -#define DAC_CTL_DACEN_Pos (0) /*!< DAC_T::CTL: DACEN Position */ -#define DAC_CTL_DACEN_Msk (0x1ul << DAC_CTL_DACEN_Pos) /*!< DAC_T::CTL: DACEN Mask */ - -#define DAC_CTL_DACIEN_Pos (1) /*!< DAC_T::CTL: DACIEN Position */ -#define DAC_CTL_DACIEN_Msk (0x1ul << DAC_CTL_DACIEN_Pos) /*!< DAC_T::CTL: DACIEN Mask */ - -#define DAC_CTL_DMAEN_Pos (2) /*!< DAC_T::CTL: DMAEN Position */ -#define DAC_CTL_DMAEN_Msk (0x1ul << DAC_CTL_DMAEN_Pos) /*!< DAC_T::CTL: DMAEN Mask */ - -#define DAC_CTL_DMAURIEN_Pos (3) /*!< DAC_T::CTL: DMAURIEN Position */ -#define DAC_CTL_DMAURIEN_Msk (0x1ul << DAC_CTL_DMAURIEN_Pos) /*!< DAC_T::CTL: DMAURIEN Mask */ - -#define DAC_CTL_TRGEN_Pos (4) /*!< DAC_T::CTL: TRGEN Position */ -#define DAC_CTL_TRGEN_Msk (0x1ul << DAC_CTL_TRGEN_Pos) /*!< DAC_T::CTL: TRGEN Mask */ - -#define DAC_CTL_TRGSEL_Pos (5) /*!< DAC_T::CTL: TRGSEL Position */ -#define DAC_CTL_TRGSEL_Msk (0x7ul << DAC_CTL_TRGSEL_Pos) /*!< DAC_T::CTL: TRGSEL Mask */ - -#define DAC_CTL_BYPASS_Pos (8) /*!< DAC_T::CTL: BYPASS Position */ -#define DAC_CTL_BYPASS_Msk (0x1ul << DAC_CTL_BYPASS_Pos) /*!< DAC_T::CTL: BYPASS Mask */ - -#define DAC_CTL_LALIGN_Pos (10) /*!< DAC_T::CTL: LALIGN Position */ -#define DAC_CTL_LALIGN_Msk (0x1ul << DAC_CTL_LALIGN_Pos) /*!< DAC_T::CTL: LALIGN Mask */ - -#define DAC_CTL_ETRGSEL_Pos (12) /*!< DAC_T::CTL: ETRGSEL Position */ -#define DAC_CTL_ETRGSEL_Msk (0x3ul << DAC_CTL_ETRGSEL_Pos) /*!< DAC_T::CTL: ETRGSEL Mask */ - -#define DAC_CTL_BWSEL_Pos (14) /*!< DAC_T::CTL: BWSEL Position */ -#define DAC_CTL_BWSEL_Msk (0x3ul << DAC_CTL_BWSEL_Pos) /*!< DAC_T::CTL: BWSEL Mask */ - -#define DAC_CTL_GRPEN_Pos (16) /*!< DAC_T::CTL: GRPEN Position */ -#define DAC_CTL_GRPEN_Msk (0x1ul << DAC_CTL_GRPEN_Pos) /*!< DAC_T::CTL: GRPEN Mask */ - -#define DAC_SWTRG_SWTRG_Pos (0) /*!< DAC_T::SWTRG: SWTRG Position */ -#define DAC_SWTRG_SWTRG_Msk (0x1ul << DAC_SWTRG_SWTRG_Pos) /*!< DAC_T::SWTRG: SWTRG Mask */ - -#define DAC_DAT_DACDAT_Pos (0) /*!< DAC_T::DAT: DACDAT Position */ -#define DAC_DAT_DACDAT_Msk (0xfffful << DAC_DAT_DACDAT_Pos) /*!< DAC_T::DAT: DACDAT Mask */ - -#define DAC_DATOUT_DATOUT_Pos (0) /*!< DAC_T::DATOUT: DATOUT Position */ -#define DAC_DATOUT_DATOUT_Msk (0xffful << DAC_DATOUT_DATOUT_Pos) /*!< DAC_T::DATOUT: DATOUT Mask */ - -#define DAC_STATUS_FINISH_Pos (0) /*!< DAC_T::STATUS: FINISH Position */ -#define DAC_STATUS_FINISH_Msk (0x1ul << DAC_STATUS_FINISH_Pos) /*!< DAC_T::STATUS: FINISH Mask */ - -#define DAC_STATUS_DMAUDR_Pos (1) /*!< DAC_T::STATUS: DMAUDR Position */ -#define DAC_STATUS_DMAUDR_Msk (0x1ul << DAC_STATUS_DMAUDR_Pos) /*!< DAC_T::STATUS: DMAUDR Mask */ - -#define DAC_STATUS_BUSY_Pos (8) /*!< DAC_T::STATUS: BUSY Position */ -#define DAC_STATUS_BUSY_Msk (0x1ul << DAC_STATUS_BUSY_Pos) /*!< DAC_T::STATUS: BUSY Mask */ - -#define DAC_TCTL_SETTLET_Pos (0) /*!< DAC_T::TCTL: SETTLET Position */ -#define DAC_TCTL_SETTLET_Msk (0x3fful << DAC_TCTL_SETTLET_Pos) /*!< DAC_T::TCTL: SETTLET Mask */ - -/**@}*/ /* DAC_CONST */ -/**@}*/ /* end of DAC register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __DAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/eadc_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/eadc_reg.h deleted file mode 100644 index bedb6a60c01..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/eadc_reg.h +++ /dev/null @@ -1,1707 +0,0 @@ -/**************************************************************************//** - * @file eadc_reg.h - * @version V1.00 - * @brief EADC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EADC_REG_H__ -#define __EADC_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Enhanced Analog to Digital Converter -------------------------*/ -/** - @addtogroup EADC Enhanced Analog to Digital Converter(EADC) - Memory Mapped Structure for EADC Controller - @{ -*/ - - -typedef struct -{ - - - /** - * @var EADC_T::DAT[19] - * Offset: 0x00 ADC Data Register 0~18 for Sample Module 0~18 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2'complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::CURDAT - * Offset: 0x4C ADC PDMA Current Transfer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |CURDAT |ADC PDMA Current Transfer Data Register - * | | |This register is a shadow register of EADC_DATn (n=0~18) for PDMA support. - * | | |This is a read only register. - * @var EADC_T::CTL - * Offset: 0x50 ADC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCEN |ADC Converter Enable Bit - * | | |0 = Disabled EADC. - * | | |1 = Enabled EADC. - * | | |Note: Before starting ADC conversion function, this bit should be set to 1 - * | | |Clear it to 0 to disable ADC converter analog circuit power consumption. - * |[1] |ADCRST |ADC Converter Control Circuits Reset - * | | |0 = No effect. - * | | |1 = Cause ADC control circuits reset to initial state, but not change the ADC registers value. - * | | |Note: ADCRST bit remains 1 during ADC reset, when ADC reset end, the ADCRST bit is automatically cleared to 0. - * |[2] |ADCIEN0 |Specific Sample Module ADC ADINT0 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF0 (EADC_STATUS2[0]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN0 bit is set then conversion end interrupt request ADINT0 is generated. - * | | |0 = Specific sample module ADC ADINT0 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT0 interrupt function Enabled. - * |[3] |ADCIEN1 |Specific Sample Module ADC ADINT1 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF1 (EADC_STATUS2[1]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN1 bit is set then conversion end interrupt request ADINT1 is generated. - * | | |0 = Specific sample module ADC ADINT1 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT1 interrupt function Enabled. - * |[4] |ADCIEN2 |Specific Sample Module ADC ADINT2 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF2 (EADC_STATUS2[2]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN2 bit is set then conversion end interrupt request ADINT2 is generated. - * | | |0 = Specific sample module ADC ADINT2 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT2 interrupt function Enabled. - * |[5] |ADCIEN3 |Specific Sample Module ADC ADINT3 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF3 (EADC_STATUS2[3]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN3 bit is set then conversion end interrupt request ADINT3 is generated. - * | | |0 = Specific sample module ADC ADINT3 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT3 interrupt function Enabled. - * |[7:6] |RESSEL |Resolution Selection - * | | |00 = 6-bit ADC result will be put at RESULT (EADC_DATn[5:0]). - * | | |01 = 8-bit ADC result will be put at RESULT (EADC_DATn[7:0]). - * | | |10 = 10-bit ADC result will be put at RESULT (EADC_DATn[9:0]). - * | | |11 = 12-bit ADC result will be put at RESULT (EADC_DATn[11:0]). - * |[8] |DIFFEN |Differential Analog Input Mode Enable Bit - * | | |0 = Single-end analog input mode. - * | | |1 = Differential analog input mode. - * |[9] |DMOF |ADC Differential Input Mode Output Format - * | | |0 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0] , n= 0 ~18) with unsigned format. - * | | |1 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0] , n= 0 ~18) with 2'complement format. - * @var EADC_T::SWTRG - * Offset: 0x54 ADC Sample Module Software Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |SWTRG |ADC Sample Module 0~18 Software Force to Start ADC Conversion - * | | |0 = No effect. - * | | |1 = Cause an ADC conversion when the priority is given to sample module. - * | | |Note: After write this register to start ADC conversion, the EADC_PENDSTS register will show which sample module will conversion - * | | |If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - * @var EADC_T::PENDSTS - * Offset: 0x58 ADC Start of Conversion Pending Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |STPF |ADC Sample Module 0~18 Start of Conversion Pending Flag - * | | |Read: - * | | |0 = There is no pending conversion for sample module. - * | | |1 = Sample module ADC start of conversion is pending. - * | | |Write: - * | | |1 = clear pending flag and cancel the conversion for sample module. - * | | |Note: This bit remains 1 during pending state, when the respective ADC conversion is end, the STPFn (n=0~18) bit is automatically cleared to 0 - * @var EADC_T::OVSTS - * Offset: 0x5C ADC Sample Module Start of Conversion Overrun Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |SPOVF |ADC SAMPLE0~18 Overrun Flag - * | | |0 = No sample module event overrun. - * | | |1 = Indicates a new sample module event is generated while an old one event is pending. - * | | |Note: This bit is cleared by writing 1 to it. - * @var EADC_T::SCTL[19] - * Offset: 0x80 ADC Sample Module 0~18 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0 (slow channel). - * | | |01H = EADC_CH1 (slow channel). - * | | |02H = EADC_CH2 (slow channel). - * | | |03H = EADC_CH3 (slow channel). - * | | |04H = EADC_CH4 (slow channel). - * | | |05H = EADC_CH5 (slow channel). - * | | |06H = EADC_CH6 (slow channel). - * | | |07H = EADC_CH7 (slow channel). - * | | |08H = EADC_CH8 (slow channel). - * | | |09H = EADC_CH9 (slow channel). - * | | |0AH = EADC_CH10 (fast channel). - * | | |0BH = EADC_CH11 (fast channel). - * | | |0CH = EADC_CH12 (fast channel). - * | | |0DH = EADC_CH13 (fast channel). - * | | |0EH = EADC_CH14 (fast channel). - * | | |0FH = EADC_CH15 (fast channel). - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK x n (n=1,2,4,16 from TRGDLYDIV setting). - * |[20:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = EPWM0TG0. - * | | |BH = EPWM0TG1. - * | | |CH = EPWM0TG2. - * | | |DH = EPWM0TG3. - * | | |EH = EPWM0TG4. - * | | |FH = EPWM0TG5. - * | | |10H = EPWM1TG0. - * | | |11H = EPWM1TG1. - * | | |12H = EPWM1TG2. - * | | |13H = EPWM1TG3. - * | | |14H = EPWM1TG4. - * | | |15H = EPWM1TG5. - * | | |16H = BPWM0TG. - * | | |17H = BPWM1TG. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * |[23] |DBMEN |Double Buffer Mode Enable Bit - * | | |0 = Sample has one sample result register. (default). - * | | |1 = Sample has two sample result registers. - * |[31:24] |EXTSMPT |ADC Sampling Time Extend - * | | |When ADC converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, user can extend ADC sampling time after trigger source is coming to get enough sampling time. - * | | |The range of start delay time is from 0~255 ADC clock. - * @var EADC_T::INTSRC[4] - * Offset: 0xD0 ADC interrupt 0~3 Source Enable Control Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPLIE0 |Sample Module 0 Interrupt Enable Bit - * | | |0 = Sample Module 0 interrupt Disabled. - * | | |1 = Sample Module 0 interrupt Enabled. - * |[1] |SPLIE1 |Sample Module 1 Interrupt Enable Bit - * | | |0 = Sample Module 1 interrupt Disabled. - * | | |1 = Sample Module 1 interrupt Enabled. - * |[2] |SPLIE2 |Sample Module 2 Interrupt Enable Bit - * | | |0 = Sample Module 2 interrupt Disabled. - * | | |1 = Sample Module 2 interrupt Enabled. - * |[3] |SPLIE3 |Sample Module 3 Interrupt Enable Bit - * | | |0 = Sample Module 3 interrupt Disabled. - * | | |1 = Sample Module 3 interrupt Enabled. - * |[4] |SPLIE4 |Sample Module 4 Interrupt Enable Bit - * | | |0 = Sample Module 4 interrupt Disabled. - * | | |1 = Sample Module 4 interrupt Enabled. - * |[5] |SPLIE5 |Sample Module 5 Interrupt Enable Bit - * | | |0 = Sample Module 5 interrupt Disabled. - * | | |1 = Sample Module 5 interrupt Enabled. - * |[6] |SPLIE6 |Sample Module 6 Interrupt Enable Bit - * | | |0 = Sample Module 6 interrupt Disabled. - * | | |1 = Sample Module 6 interrupt Enabled. - * |[7] |SPLIE7 |Sample Module 7 Interrupt Enable Bit - * | | |0 = Sample Module 7 interrupt Disabled. - * | | |1 = Sample Module 7 interrupt Enabled. - * |[8] |SPLIE8 |Sample Module 8 Interrupt Enable Bit - * | | |0 = Sample Module 8 interrupt Disabled. - * | | |1 = Sample Module 8 interrupt Enabled. - * |[9] |SPLIE9 |Sample Module 9 Interrupt Enable Bit - * | | |0 = Sample Module 9 interrupt Disabled. - * | | |1 = Sample Module 9 interrupt Enabled. - * |[10] |SPLIE10 |Sample Module 10 Interrupt Enable Bit - * | | |0 = Sample Module 10 interrupt Disabled. - * | | |1 = Sample Module 10 interrupt Enabled. - * |[11] |SPLIE11 |Sample Module 11 Interrupt Enable Bit - * | | |0 = Sample Module 11 interrupt Disabled. - * | | |1 = Sample Module 11 interrupt Enabled. - * |[12] |SPLIE12 |Sample Module 12 Interrupt Enable Bit - * | | |0 = Sample Module 12 interrupt Disabled. - * | | |1 = Sample Module 12 interrupt Enabled. - * |[13] |SPLIE13 |Sample Module 13 Interrupt Enable Bit - * | | |0 = Sample Module 13 interrupt Disabled. - * | | |1 = Sample Module 13 interrupt Enabled. - * |[14] |SPLIE14 |Sample Module 14 Interrupt Enable Bit - * | | |0 = Sample Module 14 interrupt Disabled. - * | | |1 = Sample Module 14 interrupt Enabled. - * |[15] |SPLIE15 |Sample Module 15 Interrupt Enable Bit - * | | |0 = Sample Module 15 interrupt Disabled. - * | | |1 = Sample Module 15 interrupt Enabled. - * |[16] |SPLIE16 |Sample Module 16 Interrupt Enable Bit - * | | |0 = Sample Module 16 interrupt Disabled. - * | | |1 = Sample Module 16 interrupt Enabled. - * |[17] |SPLIE17 |Sample Module 17 Interrupt Enable Bit - * | | |0 = Sample Module 17 interrupt Disabled. - * | | |1 = Sample Module 17 interrupt Enabled. - * |[18] |SPLIE18 |Sample Module 18 Interrupt Enable Bit - * | | |0 = Sample Module 18 interrupt Disabled. - * | | |1 = Sample Module 18 interrupt Enabled. - * @var EADC_T::CMP[4] - * Offset: 0xE0 ADC Result Compare Register 0~3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCMPEN |ADC Result Compare Enable Bit - * | | |0 = Compare Disabled. - * | | |1 = Compare Enabled. - * | | |Set this bit to 1 to enable compare CMPDAT (EADC_CMPn[27:16], n=0~3) with specified sample module conversion result when converted data is loaded into EADC_DAT register. - * |[1] |ADCMPIE |ADC Result Compare Interrupt Enable Bit - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, if ADCMPIE is set to 1, a compare interrupt request is generated. - * |[2] |CMPCOND |Compare Condition - * | | |0= Set the compare condition as that when a 12-bit ADC conversion result is less than the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |1= Set the compare condition as that when a 12-bit ADC conversion result is greater or equal to the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |Note: When the internal counter reaches the value to (CMPMCNT (EADC_CMPn[11:8], n=0~3) +1), the CMPF bit will be set. - * |[7:3] |CMPSPL |Compare Sample Module Selection - * | | |00000 = Sample Module 0 conversion result EADC_DAT0 is selected to be compared. - * | | |00001 = Sample Module 1 conversion result EADC_DAT1 is selected to be compared. - * | | |00010 = Sample Module 2 conversion result EADC_DAT2 is selected to be compared. - * | | |00011 = Sample Module 3 conversion result EADC_DAT3 is selected to be compared. - * | | |00100 = Sample Module 4 conversion result EADC_DAT4 is selected to be compared. - * | | |00101 = Sample Module 5 conversion result EADC_DAT5 is selected to be compared. - * | | |00110 = Sample Module 6 conversion result EADC_DAT6 is selected to be compared. - * | | |00111 = Sample Module 7 conversion result EADC_DAT7 is selected to be compared. - * | | |01000 = Sample Module 8 conversion result EADC_DAT8 is selected to be compared. - * | | |01001 = Sample Module 9 conversion result EADC_DAT9 is selected to be compared. - * | | |01010 = Sample Module 10 conversion result EADC_DAT10 is selected to be compared. - * | | |01011 = Sample Module 11 conversion result EADC_DAT11 is selected to be compared. - * | | |01100 = Sample Module 12 conversion result EADC_DAT12 is selected to be compared. - * | | |01101 = Sample Module 13 conversion result EADC_DAT13 is selected to be compared. - * | | |01110 = Sample Module 14 conversion result EADC_DAT14 is selected to be compared. - * | | |01111 = Sample Module 15 conversion result EADC_DAT15 is selected to be compared. - * | | |10000 = Sample Module 16 conversion result EADC_DAT16 is selected to be compared. - * | | |10001 = Sample Module 17 conversion result EADC_DAT17 is selected to be compared. - * | | |10010 = Sample Module 18 conversion result EADC_DAT18 is selected to be compared. - * |[11:8] |CMPMCNT |Compare Match Count - * | | |When the specified ADC sample module analog conversion result matches the compare condition defined by CMPCOND (EADC_CMPn[2], n=0~3), the internal match counter will increase 1 - * | | |If the compare result does not meet the compare condition, the internal compare match counter will reset to 0 - * | | |When the internal counter reaches the value to (CMPMCNT +1), the ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = ADCMPF0 (EADC_STATUS2[4]) will be set when EADC_CMP0 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when EADC_CMP2 compared condition matched - * | | |1 = ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * | | |Note: This bit is only present in EADC_CMP0 and EADC_CMP2 register. - * |[27:16] |CMPDAT |Comparison Data - * | | |The 12 bits data is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage transition without imposing a load on software. - * @var EADC_T::STATUS0 - * Offset: 0xF0 ADC Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |VALID |EADC_DAT0~15 Data Valid Flag - * | | |It is a mirror of VALID bit in sample module ADC result data register EADC_DATn. (n=0~18). - * |[31:16] |OV |EADC_DAT0~15 Overrun Flag - * | | |It is a mirror to OV bit in sample module ADC result data register EADC_DATn. (n=0~18). - * @var EADC_T::STATUS1 - * Offset: 0xF4 ADC Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |VALID |EADC_DAT16~18 Data Valid Flag - * | | |It is a mirror of VALID bit in sample module ADC result data register EADC_DATn. (n=0~18). - * |[18:16] |OV |EADC_DAT16~18 Overrun Flag - * | | |It is a mirror to OV bit in sample module ADC result data register EADC_DATn. (n=0~18). - * @var EADC_T::STATUS2 - * Offset: 0xF8 ADC Status Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADIF0 |ADC ADINT0 Interrupt Flag - * | | |0 = No ADINT0 interrupt pulse received. - * | | |1 = ADINT0 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[1] |ADIF1 |ADC ADINT1 Interrupt Flag - * | | |0 = No ADINT1 interrupt pulse received. - * | | |1 = ADINT1 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[2] |ADIF2 |ADC ADINT2 Interrupt Flag - * | | |0 = No ADINT2 interrupt pulse received. - * | | |1 = ADINT2 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[3] |ADIF3 |ADC ADINT3 Interrupt Flag - * | | |0 = No ADINT3 interrupt pulse received. - * | | |1 = ADINT3 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[4] |ADCMPF0 |ADC Compare 0 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP0 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP0 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP0 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[5] |ADCMPF1 |ADC Compare 1 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP1 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP1 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP1 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |ADCMPF2 |ADC Compare 2 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP2 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP2 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP2 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[7] |ADCMPF3 |ADC Compare 3 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP3 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP3 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP3 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[8] |ADOVIF0 |ADC ADINT0 Interrupt Flag Overrun - * | | |0 = ADINT0 interrupt flag is not overwritten to 1. - * | | |1 = ADINT0 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[9] |ADOVIF1 |ADC ADINT1 Interrupt Flag Overrun - * | | |0 = ADINT1 interrupt flag is not overwritten to 1. - * | | |1 = ADINT1 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[10] |ADOVIF2 |ADC ADINT2 Interrupt Flag Overrun - * | | |0 = ADINT2 interrupt flag is not overwritten to 1. - * | | |1 = ADINT2 interrupt flag is s overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[11] |ADOVIF3 |ADC ADINT3 Interrupt Flag Overrun - * | | |0 = ADINT3 interrupt flag is not overwritten to 1. - * | | |1 = ADINT3 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[12] |ADCMPO0 |ADC Compare 0 Output Status (Read Only) - * | | |The 12 bits compare0 data CMPDAT0 (EADC_CMP0[27:16]) is used to compare with conversion result of specified sample module. - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT0 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT0 setting. - * |[13] |ADCMPO1 |ADC Compare 1 Output Status (Read Only) - * | | |The 12 bits compare1 data CMPDAT1 (EADC_CMP1[27:16]) is used to compare with conversion result of specified sample module. - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT1 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT1 setting. - * |[14] |ADCMPO2 |ADC Compare 2 Output Status (Read Only) - * | | |The 12 bits compare2 data CMPDAT2 (EADC_CMP2[27:16]) is used to compare with conversion result of specified sample module. - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT2 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT2 setting. - * |[15] |ADCMPO3 |ADC Compare 3 Output Status (Read Only) - * | | |The 12 bits compare3 data CMPDAT3 (EADC_CMP3[27:16]) is used to compare with conversion result of specified sample module. - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT3 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT3 setting. - * |[20:16] |CHANNEL |Current Conversion Channel (Read Only) - * | | |This filed reflects ADC current conversion channel when BUSY=1. - * | | |It is read only. - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = EADC_CH8. - * | | |09H = EADC_CH9. - * | | |0AH = EADC_CH10. - * | | |0BH = EADC_CH11. - * | | |0CH = EADC_CH12. - * | | |0DH = EADC_CH13. - * | | |0EH = EADC_CH14. - * | | |0FH = EADC_CH15. - * | | |10H = VBG. - * | | |11H = VTEMP. - * | | |12H = VBAT/4. - * |[23] |BUSY |Busy/Idle (Read Only) - * | | |0 = EADC is in idle state. - * | | |1 = EADC is busy at conversion. - * |[24] |ADOVIF |All ADC Interrupt Flag Overrun Bits Check (Read Only) - * | | |n=0~3. - * | | |0 = None of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * | | |1 = Any one of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * | | |Note: This bit will keep 1 when any ADOVIFn Flag is equal to 1. - * |[25] |STOVF |for All ADC Sample Module Start of Conversion Overrun Flags Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * | | |1 = Any one of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * | | |Note: This bit will keep 1 when any SPOVFn Flag is equal to 1. - * |[26] |AVALID |for All Sample Module ADC Result Data Register EADC_DAT Data Valid Flag Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * | | |1 = Any one of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * | | |Note: This bit will keep 1 when any VALIDn Flag is equal to 1. - * |[27] |AOV |for All Sample Module ADC Result Data Register Overrun Flags Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * | | |1 = Any one of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * | | |Note: This bit will keep 1 when any OVn Flag is equal to 1. - * @var EADC_T::STATUS3 - * Offset: 0xFC ADC Status Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CURSPL |ADC Current Sample Module - * | | |This register show the current ADC is controlled by which sample module control logic modules. - * | | |If the ADC is Idle, this bit filed will set to 0x1F. - * | | |This is a read only register. - * @var EADC_T::DDAT - * Offset: 0x100-0x10C ADC Double Data Register n for Sample Module n, n=0~3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Results - * | | |This field contains 12 bits conversion results. - * | | |When the DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT [11:0] and zero will be filled in RESULT [15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2'complement format will be filled in RESULT [11:0] and signed bits to will be filled in RESULT [15:12]. - * |[16] |OV |Overrun Flag - * | | |0 = Data in RESULT (EADC_DATn[15:0], n=0~3) is recent conversion result. - * | | |1 = Data in RESULT (EADC_DATn[15:0], n=0~3) is overwrite. - * | | |If converted data in RESULT[15:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |It is cleared by hardware after EADC_DDAT register is read. - * |[17] |VALID |Valid Flag - * | | |0 = Double data in RESULT (EADC_DDATn[15:0]) is not valid. - * | | |1 = Double data in RESULT (EADC_DDATn[15:0]) is valid. - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DDATn register is read. - * | | |(n=0~3). - * @var EADC_T::PWRM - * Offset: 0x110 ADC Power Management Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWUPRDY |ADC Power-up Sequence Completed and Ready for Conversion (Read Only) - * | | |0 = ADC is not ready for conversion may be in power down state or in the progress of power up. - * | | |1 = ADC is ready for conversion. - * |[1] |PWUCALEN |Power Up Calibration Function Enable Control - * | | |0 = Disable the function of calibration at power up. - * | | |1 = Enable the function of calibration at power up. - * | | |Note: This bit work together with CALSEL (EADC_CALCTL [3]), see the following - * | | |{PWUCALEN, CALSEL } Description: - * | | |PWUCALEN is 0 and CALSEL is 0: No need to calibrate. - * | | |PWUCALEN is 0 and CALSEL is 1: No need to calibrate. - * | | |PWUCALEN is 1 and CALSEL is 0: Load calibration word when power up. - * | | |PWUCALEN is 1 and CALSEL is 1: Calibrate when power up. - * |[3:2] |PWDMOD |ADC Power-down Mode - * | | |Set this bit fields to select ADC power down mode when system power-down. - * | | |00 = ADC Deep power down mode. - * | | |01 = ADC Power down. - * | | |10 = ADC Standby mode. - * | | |11 = ADC Deep power down mode. - * | | |Note: Different PWDMOD has different power down/up sequence, in order to avoid ADC powering up with wrong sequence; user must keep PWMOD consistent each time in power down and start up - * |[19:8] |LDOSUT |ADC Internal LDO Start-up Time - * | | |Set this bit fields to control LDO start-up time - * | | |The minimum required LDO start-up time is 20us - * | | |LDO start-up time = (1/ADC_CLK) x LDOSUT. - * @var EADC_T::CALCTL - * Offset: 0x114 ADC Calibration Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |CALSTART |Calibration Functional Block Start - * | | |0 = Stops calibration functional block. - * | | |1 = Starts calibration functional block. - * | | |Note: This bit is set by SW and clear by HW after re-calibration finish - * |[2] |CALDONE |Calibration Functional Block Complete (Read Only) - * | | |0 = During a calibration. - * | | |1 = Calibration is completed. - * |[3] |CALSEL |Select Calibration Functional Block - * | | |0 = Load calibration word when calibration functional block is active. - * | | |1 = Execute calibration when calibration functional block is active. - * @var EADC_T::CALDWRD - * Offset: 0x118 ADC Calibration Load Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |CALWORD |Calibration Word Bits - * | | |Write to this register with the previous calibration word before load calibration action. - * | | |Read this register after calibration done. - * | | |Note: The calibration block contains two parts CALIBRATION and LOAD CALIBRATION; if the calibration block configure as CALIBRATION; then this register represent the result of calibration when calibration is completed; if configure as LOAD CALIBRATION ; configure this register before loading calibration action, after loading calibration complete, the laoded calibration word will apply to the ADC; while in loading calibration function the loaded value will not be equal to the original CALWORD until calibration is done. - */ - - __I uint32_t DAT[19]; /*!< [0x0000~0x0048] ADC Data Register n for Sample Module n, n=0~18 */ - __I uint32_t CURDAT; /*!< [0x004c] ADC PDMA Current Transfer Data Register */ - __IO uint32_t CTL; /*!< [0x0050] ADC Control Register */ - __O uint32_t SWTRG; /*!< [0x0054] ADC Sample Module Software Start Register */ - __IO uint32_t PENDSTS; /*!< [0x0058] ADC Start of Conversion Pending Flag Register */ - __IO uint32_t OVSTS; /*!< [0x005c] ADC Sample Module Start of Conversion Overrun Flag Register */ - __I uint32_t RESERVE0[8]; - __IO uint32_t SCTL[19]; /*!< [0x0080~0x00c8] ADC Sample Module n Control Register, n=0~18 */ - __I uint32_t RESERVE1[1]; - __IO uint32_t INTSRC[4]; /*!< [0x00d0~0x00dc] ADC interrupt n Source Enable Control Register, n=0~3 */ - __IO uint32_t CMP[4]; /*!< [0x00e0~0x00ec] ADC Result Compare Register n, n=0~3 */ - __I uint32_t STATUS0; /*!< [0x00f0] ADC Status Register 0 */ - __I uint32_t STATUS1; /*!< [0x00f4] ADC Status Register 1 */ - __IO uint32_t STATUS2; /*!< [0x00f8] ADC Status Register 2 */ - __I uint32_t STATUS3; /*!< [0x00fc] ADC Status Register 3 */ - __I uint32_t DDAT[4]; /*!< [0x0100~0x010c] ADC Double Data Register n for Sample Module n, n=0~3 */ - __IO uint32_t PWRM; /*!< [0x0110] ADC Power Management Register */ - __IO uint32_t CALCTL; /*!< [0x0114] ADC Calibration Control Register */ - __IO uint32_t CALDWRD; /*!< [0x0118] ADC Calibration Load Word Register */ - __I uint32_t RESERVE2[5]; - __IO uint32_t PDMACTL; /*!< [0x0130] ADC PDMA Control Register */ - -} EADC_T; - -/** - @addtogroup EADC_CONST EADC Bit Field Definition - Constant Definitions for EADC Controller - @{ -*/ - -#define EADC_DAT_RESULT_Pos (0) /*!< EADC_T::DAT: RESULT Position */ -#define EADC_DAT_RESULT_Msk (0xfffful << EADC_DAT_RESULT_Pos) /*!< EADC_T::DAT: RESULT Mask */ - -#define EADC_DAT_OV_Pos (16) /*!< EADC_T::DAT: OV Position */ -#define EADC_DAT_OV_Msk (0x1ul << EADC_DAT_OV_Pos) /*!< EADC_T::DAT: OV Mask */ - -#define EADC_DAT_VALID_Pos (17) /*!< EADC_T::DAT: VALID Position */ -#define EADC_DAT_VALID_Msk (0x1ul << EADC_DAT_VALID_Pos) /*!< EADC_T::DAT: VALID Mask */ - -#define EADC_DAT0_RESULT_Pos (0) /*!< EADC_T::DAT0: RESULT Position */ -#define EADC_DAT0_RESULT_Msk (0xfffful << EADC_DAT0_RESULT_Pos) /*!< EADC_T::DAT0: RESULT Mask */ - -#define EADC_DAT0_OV_Pos (16) /*!< EADC_T::DAT0: OV Position */ -#define EADC_DAT0_OV_Msk (0x1ul << EADC_DAT0_OV_Pos) /*!< EADC_T::DAT0: OV Mask */ - -#define EADC_DAT0_VALID_Pos (17) /*!< EADC_T::DAT0: VALID Position */ -#define EADC_DAT0_VALID_Msk (0x1ul << EADC_DAT0_VALID_Pos) /*!< EADC_T::DAT0: VALID Mask */ - -#define EADC_DAT1_RESULT_Pos (0) /*!< EADC_T::DAT1: RESULT Position */ -#define EADC_DAT1_RESULT_Msk (0xfffful << EADC_DAT1_RESULT_Pos) /*!< EADC_T::DAT1: RESULT Mask */ - -#define EADC_DAT1_OV_Pos (16) /*!< EADC_T::DAT1: OV Position */ -#define EADC_DAT1_OV_Msk (0x1ul << EADC_DAT1_OV_Pos) /*!< EADC_T::DAT1: OV Mask */ - -#define EADC_DAT1_VALID_Pos (17) /*!< EADC_T::DAT1: VALID Position */ -#define EADC_DAT1_VALID_Msk (0x1ul << EADC_DAT1_VALID_Pos) /*!< EADC_T::DAT1: VALID Mask */ - -#define EADC_DAT2_RESULT_Pos (0) /*!< EADC_T::DAT2: RESULT Position */ -#define EADC_DAT2_RESULT_Msk (0xfffful << EADC_DAT2_RESULT_Pos) /*!< EADC_T::DAT2: RESULT Mask */ - -#define EADC_DAT2_OV_Pos (16) /*!< EADC_T::DAT2: OV Position */ -#define EADC_DAT2_OV_Msk (0x1ul << EADC_DAT2_OV_Pos) /*!< EADC_T::DAT2: OV Mask */ - -#define EADC_DAT2_VALID_Pos (17) /*!< EADC_T::DAT2: VALID Position */ -#define EADC_DAT2_VALID_Msk (0x1ul << EADC_DAT2_VALID_Pos) /*!< EADC_T::DAT2: VALID Mask */ - -#define EADC_DAT3_RESULT_Pos (0) /*!< EADC_T::DAT3: RESULT Position */ -#define EADC_DAT3_RESULT_Msk (0xfffful << EADC_DAT3_RESULT_Pos) /*!< EADC_T::DAT3: RESULT Mask */ - -#define EADC_DAT3_OV_Pos (16) /*!< EADC_T::DAT3: OV Position */ -#define EADC_DAT3_OV_Msk (0x1ul << EADC_DAT3_OV_Pos) /*!< EADC_T::DAT3: OV Mask */ - -#define EADC_DAT3_VALID_Pos (17) /*!< EADC_T::DAT3: VALID Position */ -#define EADC_DAT3_VALID_Msk (0x1ul << EADC_DAT3_VALID_Pos) /*!< EADC_T::DAT3: VALID Mask */ - -#define EADC_DAT4_RESULT_Pos (0) /*!< EADC_T::DAT4: RESULT Position */ -#define EADC_DAT4_RESULT_Msk (0xfffful << EADC_DAT4_RESULT_Pos) /*!< EADC_T::DAT4: RESULT Mask */ - -#define EADC_DAT4_OV_Pos (16) /*!< EADC_T::DAT4: OV Position */ -#define EADC_DAT4_OV_Msk (0x1ul << EADC_DAT4_OV_Pos) /*!< EADC_T::DAT4: OV Mask */ - -#define EADC_DAT4_VALID_Pos (17) /*!< EADC_T::DAT4: VALID Position */ -#define EADC_DAT4_VALID_Msk (0x1ul << EADC_DAT4_VALID_Pos) /*!< EADC_T::DAT4: VALID Mask */ - -#define EADC_DAT5_RESULT_Pos (0) /*!< EADC_T::DAT5: RESULT Position */ -#define EADC_DAT5_RESULT_Msk (0xfffful << EADC_DAT5_RESULT_Pos) /*!< EADC_T::DAT5: RESULT Mask */ - -#define EADC_DAT5_OV_Pos (16) /*!< EADC_T::DAT5: OV Position */ -#define EADC_DAT5_OV_Msk (0x1ul << EADC_DAT5_OV_Pos) /*!< EADC_T::DAT5: OV Mask */ - -#define EADC_DAT5_VALID_Pos (17) /*!< EADC_T::DAT5: VALID Position */ -#define EADC_DAT5_VALID_Msk (0x1ul << EADC_DAT5_VALID_Pos) /*!< EADC_T::DAT5: VALID Mask */ - -#define EADC_DAT6_RESULT_Pos (0) /*!< EADC_T::DAT6: RESULT Position */ -#define EADC_DAT6_RESULT_Msk (0xfffful << EADC_DAT6_RESULT_Pos) /*!< EADC_T::DAT6: RESULT Mask */ - -#define EADC_DAT6_OV_Pos (16) /*!< EADC_T::DAT6: OV Position */ -#define EADC_DAT6_OV_Msk (0x1ul << EADC_DAT6_OV_Pos) /*!< EADC_T::DAT6: OV Mask */ - -#define EADC_DAT6_VALID_Pos (17) /*!< EADC_T::DAT6: VALID Position */ -#define EADC_DAT6_VALID_Msk (0x1ul << EADC_DAT6_VALID_Pos) /*!< EADC_T::DAT6: VALID Mask */ - -#define EADC_DAT7_RESULT_Pos (0) /*!< EADC_T::DAT7: RESULT Position */ -#define EADC_DAT7_RESULT_Msk (0xfffful << EADC_DAT7_RESULT_Pos) /*!< EADC_T::DAT7: RESULT Mask */ - -#define EADC_DAT7_OV_Pos (16) /*!< EADC_T::DAT7: OV Position */ -#define EADC_DAT7_OV_Msk (0x1ul << EADC_DAT7_OV_Pos) /*!< EADC_T::DAT7: OV Mask */ - -#define EADC_DAT7_VALID_Pos (17) /*!< EADC_T::DAT7: VALID Position */ -#define EADC_DAT7_VALID_Msk (0x1ul << EADC_DAT7_VALID_Pos) /*!< EADC_T::DAT7: VALID Mask */ - -#define EADC_DAT8_RESULT_Pos (0) /*!< EADC_T::DAT8: RESULT Position */ -#define EADC_DAT8_RESULT_Msk (0xfffful << EADC_DAT8_RESULT_Pos) /*!< EADC_T::DAT8: RESULT Mask */ - -#define EADC_DAT8_OV_Pos (16) /*!< EADC_T::DAT8: OV Position */ -#define EADC_DAT8_OV_Msk (0x1ul << EADC_DAT8_OV_Pos) /*!< EADC_T::DAT8: OV Mask */ - -#define EADC_DAT8_VALID_Pos (17) /*!< EADC_T::DAT8: VALID Position */ -#define EADC_DAT8_VALID_Msk (0x1ul << EADC_DAT8_VALID_Pos) /*!< EADC_T::DAT8: VALID Mask */ - -#define EADC_DAT9_RESULT_Pos (0) /*!< EADC_T::DAT9: RESULT Position */ -#define EADC_DAT9_RESULT_Msk (0xfffful << EADC_DAT9_RESULT_Pos) /*!< EADC_T::DAT9: RESULT Mask */ - -#define EADC_DAT9_OV_Pos (16) /*!< EADC_T::DAT9: OV Position */ -#define EADC_DAT9_OV_Msk (0x1ul << EADC_DAT9_OV_Pos) /*!< EADC_T::DAT9: OV Mask */ - -#define EADC_DAT9_VALID_Pos (17) /*!< EADC_T::DAT9: VALID Position */ -#define EADC_DAT9_VALID_Msk (0x1ul << EADC_DAT9_VALID_Pos) /*!< EADC_T::DAT9: VALID Mask */ - -#define EADC_DAT10_RESULT_Pos (0) /*!< EADC_T::DAT10: RESULT Position */ -#define EADC_DAT10_RESULT_Msk (0xfffful << EADC_DAT10_RESULT_Pos) /*!< EADC_T::DAT10: RESULT Mask */ - -#define EADC_DAT10_OV_Pos (16) /*!< EADC_T::DAT10: OV Position */ -#define EADC_DAT10_OV_Msk (0x1ul << EADC_DAT10_OV_Pos) /*!< EADC_T::DAT10: OV Mask */ - -#define EADC_DAT10_VALID_Pos (17) /*!< EADC_T::DAT10: VALID Position */ -#define EADC_DAT10_VALID_Msk (0x1ul << EADC_DAT10_VALID_Pos) /*!< EADC_T::DAT10: VALID Mask */ - -#define EADC_DAT11_RESULT_Pos (0) /*!< EADC_T::DAT11: RESULT Position */ -#define EADC_DAT11_RESULT_Msk (0xfffful << EADC_DAT11_RESULT_Pos) /*!< EADC_T::DAT11: RESULT Mask */ - -#define EADC_DAT11_OV_Pos (16) /*!< EADC_T::DAT11: OV Position */ -#define EADC_DAT11_OV_Msk (0x1ul << EADC_DAT11_OV_Pos) /*!< EADC_T::DAT11: OV Mask */ - -#define EADC_DAT11_VALID_Pos (17) /*!< EADC_T::DAT11: VALID Position */ -#define EADC_DAT11_VALID_Msk (0x1ul << EADC_DAT11_VALID_Pos) /*!< EADC_T::DAT11: VALID Mask */ - -#define EADC_DAT12_RESULT_Pos (0) /*!< EADC_T::DAT12: RESULT Position */ -#define EADC_DAT12_RESULT_Msk (0xfffful << EADC_DAT12_RESULT_Pos) /*!< EADC_T::DAT12: RESULT Mask */ - -#define EADC_DAT12_OV_Pos (16) /*!< EADC_T::DAT12: OV Position */ -#define EADC_DAT12_OV_Msk (0x1ul << EADC_DAT12_OV_Pos) /*!< EADC_T::DAT12: OV Mask */ - -#define EADC_DAT12_VALID_Pos (17) /*!< EADC_T::DAT12: VALID Position */ -#define EADC_DAT12_VALID_Msk (0x1ul << EADC_DAT12_VALID_Pos) /*!< EADC_T::DAT12: VALID Mask */ - -#define EADC_DAT13_RESULT_Pos (0) /*!< EADC_T::DAT13: RESULT Position */ -#define EADC_DAT13_RESULT_Msk (0xfffful << EADC_DAT13_RESULT_Pos) /*!< EADC_T::DAT13: RESULT Mask */ - -#define EADC_DAT13_OV_Pos (16) /*!< EADC_T::DAT13: OV Position */ -#define EADC_DAT13_OV_Msk (0x1ul << EADC_DAT13_OV_Pos) /*!< EADC_T::DAT13: OV Mask */ - -#define EADC_DAT13_VALID_Pos (17) /*!< EADC_T::DAT13: VALID Position */ -#define EADC_DAT13_VALID_Msk (0x1ul << EADC_DAT13_VALID_Pos) /*!< EADC_T::DAT13: VALID Mask */ - -#define EADC_DAT14_RESULT_Pos (0) /*!< EADC_T::DAT14: RESULT Position */ -#define EADC_DAT14_RESULT_Msk (0xfffful << EADC_DAT14_RESULT_Pos) /*!< EADC_T::DAT14: RESULT Mask */ - -#define EADC_DAT14_OV_Pos (16) /*!< EADC_T::DAT14: OV Position */ -#define EADC_DAT14_OV_Msk (0x1ul << EADC_DAT14_OV_Pos) /*!< EADC_T::DAT14: OV Mask */ - -#define EADC_DAT14_VALID_Pos (17) /*!< EADC_T::DAT14: VALID Position */ -#define EADC_DAT14_VALID_Msk (0x1ul << EADC_DAT14_VALID_Pos) /*!< EADC_T::DAT14: VALID Mask */ - -#define EADC_DAT15_RESULT_Pos (0) /*!< EADC_T::DAT15: RESULT Position */ -#define EADC_DAT15_RESULT_Msk (0xfffful << EADC_DAT15_RESULT_Pos) /*!< EADC_T::DAT15: RESULT Mask */ - -#define EADC_DAT15_OV_Pos (16) /*!< EADC_T::DAT15: OV Position */ -#define EADC_DAT15_OV_Msk (0x1ul << EADC_DAT15_OV_Pos) /*!< EADC_T::DAT15: OV Mask */ - -#define EADC_DAT15_VALID_Pos (17) /*!< EADC_T::DAT15: VALID Position */ -#define EADC_DAT15_VALID_Msk (0x1ul << EADC_DAT15_VALID_Pos) /*!< EADC_T::DAT15: VALID Mask */ - -#define EADC_DAT16_RESULT_Pos (0) /*!< EADC_T::DAT16: RESULT Position */ -#define EADC_DAT16_RESULT_Msk (0xfffful << EADC_DAT16_RESULT_Pos) /*!< EADC_T::DAT16: RESULT Mask */ - -#define EADC_DAT16_OV_Pos (16) /*!< EADC_T::DAT16: OV Position */ -#define EADC_DAT16_OV_Msk (0x1ul << EADC_DAT16_OV_Pos) /*!< EADC_T::DAT16: OV Mask */ - -#define EADC_DAT16_VALID_Pos (17) /*!< EADC_T::DAT16: VALID Position */ -#define EADC_DAT16_VALID_Msk (0x1ul << EADC_DAT16_VALID_Pos) /*!< EADC_T::DAT16: VALID Mask */ - -#define EADC_DAT17_RESULT_Pos (0) /*!< EADC_T::DAT17: RESULT Position */ -#define EADC_DAT17_RESULT_Msk (0xfffful << EADC_DAT17_RESULT_Pos) /*!< EADC_T::DAT17: RESULT Mask */ - -#define EADC_DAT17_OV_Pos (16) /*!< EADC_T::DAT17: OV Position */ -#define EADC_DAT17_OV_Msk (0x1ul << EADC_DAT17_OV_Pos) /*!< EADC_T::DAT17: OV Mask */ - -#define EADC_DAT17_VALID_Pos (17) /*!< EADC_T::DAT17: VALID Position */ -#define EADC_DAT17_VALID_Msk (0x1ul << EADC_DAT17_VALID_Pos) /*!< EADC_T::DAT17: VALID Mask */ - -#define EADC_DAT18_RESULT_Pos (0) /*!< EADC_T::DAT18: RESULT Position */ -#define EADC_DAT18_RESULT_Msk (0xfffful << EADC_DAT18_RESULT_Pos) /*!< EADC_T::DAT18: RESULT Mask */ - -#define EADC_DAT18_OV_Pos (16) /*!< EADC_T::DAT18: OV Position */ -#define EADC_DAT18_OV_Msk (0x1ul << EADC_DAT18_OV_Pos) /*!< EADC_T::DAT18: OV Mask */ - -#define EADC_DAT18_VALID_Pos (17) /*!< EADC_T::DAT18: VALID Position */ -#define EADC_DAT18_VALID_Msk (0x1ul << EADC_DAT18_VALID_Pos) /*!< EADC_T::DAT18: VALID Mask */ - -#define EADC_CURDAT_CURDAT_Pos (0) /*!< EADC_T::CURDAT: CURDAT Position */ -#define EADC_CURDAT_CURDAT_Msk (0x3fffful << EADC_CURDAT_CURDAT_Pos) /*!< EADC_T::CURDAT: CURDAT Mask */ - -#define EADC_CTL_ADCEN_Pos (0) /*!< EADC_T::CTL: ADCEN Position */ -#define EADC_CTL_ADCEN_Msk (0x1ul << EADC_CTL_ADCEN_Pos) /*!< EADC_T::CTL: ADCEN Mask */ - -#define EADC_CTL_ADCRST_Pos (1) /*!< EADC_T::CTL: ADCRST Position */ -#define EADC_CTL_ADCRST_Msk (0x1ul << EADC_CTL_ADCRST_Pos) /*!< EADC_T::CTL: ADCRST Mask */ - -#define EADC_CTL_ADCIEN0_Pos (2) /*!< EADC_T::CTL: ADCIEN0 Position */ -#define EADC_CTL_ADCIEN0_Msk (0x1ul << EADC_CTL_ADCIEN0_Pos) /*!< EADC_T::CTL: ADCIEN0 Mask */ - -#define EADC_CTL_ADCIEN1_Pos (3) /*!< EADC_T::CTL: ADCIEN1 Position */ -#define EADC_CTL_ADCIEN1_Msk (0x1ul << EADC_CTL_ADCIEN1_Pos) /*!< EADC_T::CTL: ADCIEN1 Mask */ - -#define EADC_CTL_ADCIEN2_Pos (4) /*!< EADC_T::CTL: ADCIEN2 Position */ -#define EADC_CTL_ADCIEN2_Msk (0x1ul << EADC_CTL_ADCIEN2_Pos) /*!< EADC_T::CTL: ADCIEN2 Mask */ - -#define EADC_CTL_ADCIEN3_Pos (5) /*!< EADC_T::CTL: ADCIEN3 Position */ -#define EADC_CTL_ADCIEN3_Msk (0x1ul << EADC_CTL_ADCIEN3_Pos) /*!< EADC_T::CTL: ADCIEN3 Mask */ - -#define EADC_CTL_RESSEL_Pos (6) /*!< EADC_T::CTL: RESSEL Position */ -#define EADC_CTL_RESSEL_Msk (0x3ul << EADC_CTL_RESSEL_Pos) /*!< EADC_T::CTL: RESSEL Mask */ - -#define EADC_CTL_DIFFEN_Pos (8) /*!< EADC_T::CTL: DIFFEN Position */ -#define EADC_CTL_DIFFEN_Msk (0x1ul << EADC_CTL_DIFFEN_Pos) /*!< EADC_T::CTL: DIFFEN Mask */ - -#define EADC_CTL_DMOF_Pos (9) /*!< EADC_T::CTL: DMOF Position */ -#define EADC_CTL_DMOF_Msk (0x1ul << EADC_CTL_DMOF_Pos) /*!< EADC_T::CTL: DMOF Mask */ - -#define EADC_SWTRG_SWTRG_Pos (0) /*!< EADC_T::SWTRG: SWTRG Position */ -#define EADC_SWTRG_SWTRG_Msk (0x7fffful << EADC_SWTRG_SWTRG_Pos) /*!< EADC_T::SWTRG: SWTRG Mask */ - -#define EADC_PENDSTS_STPF_Pos (0) /*!< EADC_T::PENDSTS: STPF Position */ -#define EADC_PENDSTS_STPF_Msk (0x7fffful << EADC_PENDSTS_STPF_Pos) /*!< EADC_T::PENDSTS: STPF Mask */ - -#define EADC_OVSTS_SPOVF_Pos (0) /*!< EADC_T::OVSTS: SPOVF Position */ -#define EADC_OVSTS_SPOVF_Msk (0x7fffful << EADC_OVSTS_SPOVF_Pos) /*!< EADC_T::OVSTS: SPOVF Mask */ - -#define EADC_SCTL_CHSEL_Pos (0) /*!< EADC_T::SCTL: CHSEL Position */ -#define EADC_SCTL_CHSEL_Msk (0xful << EADC_SCTL_CHSEL_Pos) /*!< EADC_T::SCTL: CHSEL Mask */ - -#define EADC_SCTL_EXTREN_Pos (4) /*!< EADC_T::SCTL: EXTREN Position */ -#define EADC_SCTL_EXTREN_Msk (0x1ul << EADC_SCTL_EXTREN_Pos) /*!< EADC_T::SCTL: EXTREN Mask */ - -#define EADC_SCTL_EXTFEN_Pos (5) /*!< EADC_T::SCTL: EXTFEN Position */ -#define EADC_SCTL_EXTFEN_Msk (0x1ul << EADC_SCTL_EXTFEN_Pos) /*!< EADC_T::SCTL: EXTFEN Mask */ - -#define EADC_SCTL_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL: TRGDLYDIV Position */ -#define EADC_SCTL_TRGDLYDIV_Msk (0x3ul << EADC_SCTL_TRGDLYDIV_Pos) /*!< EADC_T::SCTL: TRGDLYDIV Mask */ - -#define EADC_SCTL_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL: TRGDLYCNT Position */ -#define EADC_SCTL_TRGDLYCNT_Msk (0xfful << EADC_SCTL_TRGDLYCNT_Pos) /*!< EADC_T::SCTL: TRGDLYCNT Mask */ - -#define EADC_SCTL_TRGSEL_Pos (16) /*!< EADC_T::SCTL: TRGSEL Position */ -#define EADC_SCTL_TRGSEL_Msk (0x1ful << EADC_SCTL_TRGSEL_Pos) /*!< EADC_T::SCTL: TRGSEL Mask */ - -#define EADC_SCTL_INTPOS_Pos (22) /*!< EADC_T::SCTL: INTPOS Position */ -#define EADC_SCTL_INTPOS_Msk (0x1ul << EADC_SCTL_INTPOS_Pos) /*!< EADC_T::SCTL: INTPOS Mask */ - -#define EADC_SCTL_DBMEN_Pos (23) /*!< EADC_T::SCTL: DBMEN Position */ -#define EADC_SCTL_DBMEN_Msk (0x1ul << EADC_SCTL_DBMEN_Pos) /*!< EADC_T::SCTL: DBMEN Mask */ - -#define EADC_SCTL_EXTSMPT_Pos (24) /*!< EADC_T::SCTL: EXTSMPT Position */ -#define EADC_SCTL_EXTSMPT_Msk (0xfful << EADC_SCTL_EXTSMPT_Pos) /*!< EADC_T::SCTL: EXTSMPT Mask */ - -#define EADC_SCTL0_CHSEL_Pos (0) /*!< EADC_T::SCTL0: CHSEL Position */ -#define EADC_SCTL0_CHSEL_Msk (0xful << EADC_SCTL0_CHSEL_Pos) /*!< EADC_T::SCTL0: CHSEL Mask */ - -#define EADC_SCTL0_EXTREN_Pos (4) /*!< EADC_T::SCTL0: EXTREN Position */ -#define EADC_SCTL0_EXTREN_Msk (0x1ul << EADC_SCTL0_EXTREN_Pos) /*!< EADC_T::SCTL0: EXTREN Mask */ - -#define EADC_SCTL0_EXTFEN_Pos (5) /*!< EADC_T::SCTL0: EXTFEN Position */ -#define EADC_SCTL0_EXTFEN_Msk (0x1ul << EADC_SCTL0_EXTFEN_Pos) /*!< EADC_T::SCTL0: EXTFEN Mask */ - -#define EADC_SCTL0_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL0: TRGDLYDIV Position */ -#define EADC_SCTL0_TRGDLYDIV_Msk (0x3ul << EADC_SCTL0_TRGDLYDIV_Pos) /*!< EADC_T::SCTL0: TRGDLYDIV Mask */ - -#define EADC_SCTL0_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL0: TRGDLYCNT Position */ -#define EADC_SCTL0_TRGDLYCNT_Msk (0xfful << EADC_SCTL0_TRGDLYCNT_Pos) /*!< EADC_T::SCTL0: TRGDLYCNT Mask */ - -#define EADC_SCTL0_TRGSEL_Pos (16) /*!< EADC_T::SCTL0: TRGSEL Position */ -#define EADC_SCTL0_TRGSEL_Msk (0x1ful << EADC_SCTL0_TRGSEL_Pos) /*!< EADC_T::SCTL0: TRGSEL Mask */ - -#define EADC_SCTL0_INTPOS_Pos (22) /*!< EADC_T::SCTL0: INTPOS Position */ -#define EADC_SCTL0_INTPOS_Msk (0x1ul << EADC_SCTL0_INTPOS_Pos) /*!< EADC_T::SCTL0: INTPOS Mask */ - -#define EADC_SCTL0_DBMEN_Pos (23) /*!< EADC_T::SCTL0: DBMEN Position */ -#define EADC_SCTL0_DBMEN_Msk (0x1ul << EADC_SCTL0_DBMEN_Pos) /*!< EADC_T::SCTL0: DBMEN Mask */ - -#define EADC_SCTL0_EXTSMPT_Pos (24) /*!< EADC_T::SCTL0: EXTSMPT Position */ -#define EADC_SCTL0_EXTSMPT_Msk (0xfful << EADC_SCTL0_EXTSMPT_Pos) /*!< EADC_T::SCTL0: EXTSMPT Mask */ - -#define EADC_SCTL1_CHSEL_Pos (0) /*!< EADC_T::SCTL1: CHSEL Position */ -#define EADC_SCTL1_CHSEL_Msk (0xful << EADC_SCTL1_CHSEL_Pos) /*!< EADC_T::SCTL1: CHSEL Mask */ - -#define EADC_SCTL1_EXTREN_Pos (4) /*!< EADC_T::SCTL1: EXTREN Position */ -#define EADC_SCTL1_EXTREN_Msk (0x1ul << EADC_SCTL1_EXTREN_Pos) /*!< EADC_T::SCTL1: EXTREN Mask */ - -#define EADC_SCTL1_EXTFEN_Pos (5) /*!< EADC_T::SCTL1: EXTFEN Position */ -#define EADC_SCTL1_EXTFEN_Msk (0x1ul << EADC_SCTL1_EXTFEN_Pos) /*!< EADC_T::SCTL1: EXTFEN Mask */ - -#define EADC_SCTL1_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL1: TRGDLYDIV Position */ -#define EADC_SCTL1_TRGDLYDIV_Msk (0x3ul << EADC_SCTL1_TRGDLYDIV_Pos) /*!< EADC_T::SCTL1: TRGDLYDIV Mask */ - -#define EADC_SCTL1_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL1: TRGDLYCNT Position */ -#define EADC_SCTL1_TRGDLYCNT_Msk (0xfful << EADC_SCTL1_TRGDLYCNT_Pos) /*!< EADC_T::SCTL1: TRGDLYCNT Mask */ - -#define EADC_SCTL1_TRGSEL_Pos (16) /*!< EADC_T::SCTL1: TRGSEL Position */ -#define EADC_SCTL1_TRGSEL_Msk (0x1ful << EADC_SCTL1_TRGSEL_Pos) /*!< EADC_T::SCTL1: TRGSEL Mask */ - -#define EADC_SCTL1_INTPOS_Pos (22) /*!< EADC_T::SCTL1: INTPOS Position */ -#define EADC_SCTL1_INTPOS_Msk (0x1ul << EADC_SCTL1_INTPOS_Pos) /*!< EADC_T::SCTL1: INTPOS Mask */ - -#define EADC_SCTL1_DBMEN_Pos (23) /*!< EADC_T::SCTL1: DBMEN Position */ -#define EADC_SCTL1_DBMEN_Msk (0x1ul << EADC_SCTL1_DBMEN_Pos) /*!< EADC_T::SCTL1: DBMEN Mask */ - -#define EADC_SCTL1_EXTSMPT_Pos (24) /*!< EADC_T::SCTL1: EXTSMPT Position */ -#define EADC_SCTL1_EXTSMPT_Msk (0xfful << EADC_SCTL1_EXTSMPT_Pos) /*!< EADC_T::SCTL1: EXTSMPT Mask */ - -#define EADC_SCTL2_CHSEL_Pos (0) /*!< EADC_T::SCTL2: CHSEL Position */ -#define EADC_SCTL2_CHSEL_Msk (0xful << EADC_SCTL2_CHSEL_Pos) /*!< EADC_T::SCTL2: CHSEL Mask */ - -#define EADC_SCTL2_EXTREN_Pos (4) /*!< EADC_T::SCTL2: EXTREN Position */ -#define EADC_SCTL2_EXTREN_Msk (0x1ul << EADC_SCTL2_EXTREN_Pos) /*!< EADC_T::SCTL2: EXTREN Mask */ - -#define EADC_SCTL2_EXTFEN_Pos (5) /*!< EADC_T::SCTL2: EXTFEN Position */ -#define EADC_SCTL2_EXTFEN_Msk (0x1ul << EADC_SCTL2_EXTFEN_Pos) /*!< EADC_T::SCTL2: EXTFEN Mask */ - -#define EADC_SCTL2_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL2: TRGDLYDIV Position */ -#define EADC_SCTL2_TRGDLYDIV_Msk (0x3ul << EADC_SCTL2_TRGDLYDIV_Pos) /*!< EADC_T::SCTL2: TRGDLYDIV Mask */ - -#define EADC_SCTL2_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL2: TRGDLYCNT Position */ -#define EADC_SCTL2_TRGDLYCNT_Msk (0xfful << EADC_SCTL2_TRGDLYCNT_Pos) /*!< EADC_T::SCTL2: TRGDLYCNT Mask */ - -#define EADC_SCTL2_TRGSEL_Pos (16) /*!< EADC_T::SCTL2: TRGSEL Position */ -#define EADC_SCTL2_TRGSEL_Msk (0x1ful << EADC_SCTL2_TRGSEL_Pos) /*!< EADC_T::SCTL2: TRGSEL Mask */ - -#define EADC_SCTL2_INTPOS_Pos (22) /*!< EADC_T::SCTL2: INTPOS Position */ -#define EADC_SCTL2_INTPOS_Msk (0x1ul << EADC_SCTL2_INTPOS_Pos) /*!< EADC_T::SCTL2: INTPOS Mask */ - -#define EADC_SCTL2_DBMEN_Pos (23) /*!< EADC_T::SCTL2: DBMEN Position */ -#define EADC_SCTL2_DBMEN_Msk (0x1ul << EADC_SCTL2_DBMEN_Pos) /*!< EADC_T::SCTL2: DBMEN Mask */ - -#define EADC_SCTL2_EXTSMPT_Pos (24) /*!< EADC_T::SCTL2: EXTSMPT Position */ -#define EADC_SCTL2_EXTSMPT_Msk (0xfful << EADC_SCTL2_EXTSMPT_Pos) /*!< EADC_T::SCTL2: EXTSMPT Mask */ - -#define EADC_SCTL3_CHSEL_Pos (0) /*!< EADC_T::SCTL3: CHSEL Position */ -#define EADC_SCTL3_CHSEL_Msk (0xful << EADC_SCTL3_CHSEL_Pos) /*!< EADC_T::SCTL3: CHSEL Mask */ - -#define EADC_SCTL3_EXTREN_Pos (4) /*!< EADC_T::SCTL3: EXTREN Position */ -#define EADC_SCTL3_EXTREN_Msk (0x1ul << EADC_SCTL3_EXTREN_Pos) /*!< EADC_T::SCTL3: EXTREN Mask */ - -#define EADC_SCTL3_EXTFEN_Pos (5) /*!< EADC_T::SCTL3: EXTFEN Position */ -#define EADC_SCTL3_EXTFEN_Msk (0x1ul << EADC_SCTL3_EXTFEN_Pos) /*!< EADC_T::SCTL3: EXTFEN Mask */ - -#define EADC_SCTL3_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL3: TRGDLYDIV Position */ -#define EADC_SCTL3_TRGDLYDIV_Msk (0x3ul << EADC_SCTL3_TRGDLYDIV_Pos) /*!< EADC_T::SCTL3: TRGDLYDIV Mask */ - -#define EADC_SCTL3_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL3: TRGDLYCNT Position */ -#define EADC_SCTL3_TRGDLYCNT_Msk (0xfful << EADC_SCTL3_TRGDLYCNT_Pos) /*!< EADC_T::SCTL3: TRGDLYCNT Mask */ - -#define EADC_SCTL3_TRGSEL_Pos (16) /*!< EADC_T::SCTL3: TRGSEL Position */ -#define EADC_SCTL3_TRGSEL_Msk (0x1ful << EADC_SCTL3_TRGSEL_Pos) /*!< EADC_T::SCTL3: TRGSEL Mask */ - -#define EADC_SCTL3_INTPOS_Pos (22) /*!< EADC_T::SCTL3: INTPOS Position */ -#define EADC_SCTL3_INTPOS_Msk (0x1ul << EADC_SCTL3_INTPOS_Pos) /*!< EADC_T::SCTL3: INTPOS Mask */ - -#define EADC_SCTL3_DBMEN_Pos (23) /*!< EADC_T::SCTL3: DBMEN Position */ -#define EADC_SCTL3_DBMEN_Msk (0x1ul << EADC_SCTL3_DBMEN_Pos) /*!< EADC_T::SCTL3: DBMEN Mask */ - -#define EADC_SCTL3_EXTSMPT_Pos (24) /*!< EADC_T::SCTL3: EXTSMPT Position */ -#define EADC_SCTL3_EXTSMPT_Msk (0xfful << EADC_SCTL3_EXTSMPT_Pos) /*!< EADC_T::SCTL3: EXTSMPT Mask */ - -#define EADC_SCTL4_CHSEL_Pos (0) /*!< EADC_T::SCTL4: CHSEL Position */ -#define EADC_SCTL4_CHSEL_Msk (0xful << EADC_SCTL4_CHSEL_Pos) /*!< EADC_T::SCTL4: CHSEL Mask */ - -#define EADC_SCTL4_EXTREN_Pos (4) /*!< EADC_T::SCTL4: EXTREN Position */ -#define EADC_SCTL4_EXTREN_Msk (0x1ul << EADC_SCTL4_EXTREN_Pos) /*!< EADC_T::SCTL4: EXTREN Mask */ - -#define EADC_SCTL4_EXTFEN_Pos (5) /*!< EADC_T::SCTL4: EXTFEN Position */ -#define EADC_SCTL4_EXTFEN_Msk (0x1ul << EADC_SCTL4_EXTFEN_Pos) /*!< EADC_T::SCTL4: EXTFEN Mask */ - -#define EADC_SCTL4_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL4: TRGDLYDIV Position */ -#define EADC_SCTL4_TRGDLYDIV_Msk (0x3ul << EADC_SCTL4_TRGDLYDIV_Pos) /*!< EADC_T::SCTL4: TRGDLYDIV Mask */ - -#define EADC_SCTL4_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL4: TRGDLYCNT Position */ -#define EADC_SCTL4_TRGDLYCNT_Msk (0xfful << EADC_SCTL4_TRGDLYCNT_Pos) /*!< EADC_T::SCTL4: TRGDLYCNT Mask */ - -#define EADC_SCTL4_TRGSEL_Pos (16) /*!< EADC_T::SCTL4: TRGSEL Position */ -#define EADC_SCTL4_TRGSEL_Msk (0x1ful << EADC_SCTL4_TRGSEL_Pos) /*!< EADC_T::SCTL4: TRGSEL Mask */ - -#define EADC_SCTL4_INTPOS_Pos (22) /*!< EADC_T::SCTL4: INTPOS Position */ -#define EADC_SCTL4_INTPOS_Msk (0x1ul << EADC_SCTL4_INTPOS_Pos) /*!< EADC_T::SCTL4: INTPOS Mask */ - -#define EADC_SCTL4_EXTSMPT_Pos (24) /*!< EADC_T::SCTL4: EXTSMPT Position */ -#define EADC_SCTL4_EXTSMPT_Msk (0xfful << EADC_SCTL4_EXTSMPT_Pos) /*!< EADC_T::SCTL4: EXTSMPT Mask */ - -#define EADC_SCTL5_CHSEL_Pos (0) /*!< EADC_T::SCTL5: CHSEL Position */ -#define EADC_SCTL5_CHSEL_Msk (0xful << EADC_SCTL5_CHSEL_Pos) /*!< EADC_T::SCTL5: CHSEL Mask */ - -#define EADC_SCTL5_EXTREN_Pos (4) /*!< EADC_T::SCTL5: EXTREN Position */ -#define EADC_SCTL5_EXTREN_Msk (0x1ul << EADC_SCTL5_EXTREN_Pos) /*!< EADC_T::SCTL5: EXTREN Mask */ - -#define EADC_SCTL5_EXTFEN_Pos (5) /*!< EADC_T::SCTL5: EXTFEN Position */ -#define EADC_SCTL5_EXTFEN_Msk (0x1ul << EADC_SCTL5_EXTFEN_Pos) /*!< EADC_T::SCTL5: EXTFEN Mask */ - -#define EADC_SCTL5_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL5: TRGDLYDIV Position */ -#define EADC_SCTL5_TRGDLYDIV_Msk (0x3ul << EADC_SCTL5_TRGDLYDIV_Pos) /*!< EADC_T::SCTL5: TRGDLYDIV Mask */ - -#define EADC_SCTL5_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL5: TRGDLYCNT Position */ -#define EADC_SCTL5_TRGDLYCNT_Msk (0xfful << EADC_SCTL5_TRGDLYCNT_Pos) /*!< EADC_T::SCTL5: TRGDLYCNT Mask */ - -#define EADC_SCTL5_TRGSEL_Pos (16) /*!< EADC_T::SCTL5: TRGSEL Position */ -#define EADC_SCTL5_TRGSEL_Msk (0x1ful << EADC_SCTL5_TRGSEL_Pos) /*!< EADC_T::SCTL5: TRGSEL Mask */ - -#define EADC_SCTL5_INTPOS_Pos (22) /*!< EADC_T::SCTL5: INTPOS Position */ -#define EADC_SCTL5_INTPOS_Msk (0x1ul << EADC_SCTL5_INTPOS_Pos) /*!< EADC_T::SCTL5: INTPOS Mask */ - -#define EADC_SCTL5_EXTSMPT_Pos (24) /*!< EADC_T::SCTL5: EXTSMPT Position */ -#define EADC_SCTL5_EXTSMPT_Msk (0xfful << EADC_SCTL5_EXTSMPT_Pos) /*!< EADC_T::SCTL5: EXTSMPT Mask */ - -#define EADC_SCTL6_CHSEL_Pos (0) /*!< EADC_T::SCTL6: CHSEL Position */ -#define EADC_SCTL6_CHSEL_Msk (0xful << EADC_SCTL6_CHSEL_Pos) /*!< EADC_T::SCTL6: CHSEL Mask */ - -#define EADC_SCTL6_EXTREN_Pos (4) /*!< EADC_T::SCTL6: EXTREN Position */ -#define EADC_SCTL6_EXTREN_Msk (0x1ul << EADC_SCTL6_EXTREN_Pos) /*!< EADC_T::SCTL6: EXTREN Mask */ - -#define EADC_SCTL6_EXTFEN_Pos (5) /*!< EADC_T::SCTL6: EXTFEN Position */ -#define EADC_SCTL6_EXTFEN_Msk (0x1ul << EADC_SCTL6_EXTFEN_Pos) /*!< EADC_T::SCTL6: EXTFEN Mask */ - -#define EADC_SCTL6_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL6: TRGDLYDIV Position */ -#define EADC_SCTL6_TRGDLYDIV_Msk (0x3ul << EADC_SCTL6_TRGDLYDIV_Pos) /*!< EADC_T::SCTL6: TRGDLYDIV Mask */ - -#define EADC_SCTL6_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL6: TRGDLYCNT Position */ -#define EADC_SCTL6_TRGDLYCNT_Msk (0xfful << EADC_SCTL6_TRGDLYCNT_Pos) /*!< EADC_T::SCTL6: TRGDLYCNT Mask */ - -#define EADC_SCTL6_TRGSEL_Pos (16) /*!< EADC_T::SCTL6: TRGSEL Position */ -#define EADC_SCTL6_TRGSEL_Msk (0x1ful << EADC_SCTL6_TRGSEL_Pos) /*!< EADC_T::SCTL6: TRGSEL Mask */ - -#define EADC_SCTL6_INTPOS_Pos (22) /*!< EADC_T::SCTL6: INTPOS Position */ -#define EADC_SCTL6_INTPOS_Msk (0x1ul << EADC_SCTL6_INTPOS_Pos) /*!< EADC_T::SCTL6: INTPOS Mask */ - -#define EADC_SCTL6_EXTSMPT_Pos (24) /*!< EADC_T::SCTL6: EXTSMPT Position */ -#define EADC_SCTL6_EXTSMPT_Msk (0xfful << EADC_SCTL6_EXTSMPT_Pos) /*!< EADC_T::SCTL6: EXTSMPT Mask */ - -#define EADC_SCTL7_CHSEL_Pos (0) /*!< EADC_T::SCTL7: CHSEL Position */ -#define EADC_SCTL7_CHSEL_Msk (0xful << EADC_SCTL7_CHSEL_Pos) /*!< EADC_T::SCTL7: CHSEL Mask */ - -#define EADC_SCTL7_EXTREN_Pos (4) /*!< EADC_T::SCTL7: EXTREN Position */ -#define EADC_SCTL7_EXTREN_Msk (0x1ul << EADC_SCTL7_EXTREN_Pos) /*!< EADC_T::SCTL7: EXTREN Mask */ - -#define EADC_SCTL7_EXTFEN_Pos (5) /*!< EADC_T::SCTL7: EXTFEN Position */ -#define EADC_SCTL7_EXTFEN_Msk (0x1ul << EADC_SCTL7_EXTFEN_Pos) /*!< EADC_T::SCTL7: EXTFEN Mask */ - -#define EADC_SCTL7_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL7: TRGDLYDIV Position */ -#define EADC_SCTL7_TRGDLYDIV_Msk (0x3ul << EADC_SCTL7_TRGDLYDIV_Pos) /*!< EADC_T::SCTL7: TRGDLYDIV Mask */ - -#define EADC_SCTL7_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL7: TRGDLYCNT Position */ -#define EADC_SCTL7_TRGDLYCNT_Msk (0xfful << EADC_SCTL7_TRGDLYCNT_Pos) /*!< EADC_T::SCTL7: TRGDLYCNT Mask */ - -#define EADC_SCTL7_TRGSEL_Pos (16) /*!< EADC_T::SCTL7: TRGSEL Position */ -#define EADC_SCTL7_TRGSEL_Msk (0x1ful << EADC_SCTL7_TRGSEL_Pos) /*!< EADC_T::SCTL7: TRGSEL Mask */ - -#define EADC_SCTL7_INTPOS_Pos (22) /*!< EADC_T::SCTL7: INTPOS Position */ -#define EADC_SCTL7_INTPOS_Msk (0x1ul << EADC_SCTL7_INTPOS_Pos) /*!< EADC_T::SCTL7: INTPOS Mask */ - -#define EADC_SCTL7_EXTSMPT_Pos (24) /*!< EADC_T::SCTL7: EXTSMPT Position */ -#define EADC_SCTL7_EXTSMPT_Msk (0xfful << EADC_SCTL7_EXTSMPT_Pos) /*!< EADC_T::SCTL7: EXTSMPT Mask */ - -#define EADC_SCTL8_CHSEL_Pos (0) /*!< EADC_T::SCTL8: CHSEL Position */ -#define EADC_SCTL8_CHSEL_Msk (0xful << EADC_SCTL8_CHSEL_Pos) /*!< EADC_T::SCTL8: CHSEL Mask */ - -#define EADC_SCTL8_EXTREN_Pos (4) /*!< EADC_T::SCTL8: EXTREN Position */ -#define EADC_SCTL8_EXTREN_Msk (0x1ul << EADC_SCTL8_EXTREN_Pos) /*!< EADC_T::SCTL8: EXTREN Mask */ - -#define EADC_SCTL8_EXTFEN_Pos (5) /*!< EADC_T::SCTL8: EXTFEN Position */ -#define EADC_SCTL8_EXTFEN_Msk (0x1ul << EADC_SCTL8_EXTFEN_Pos) /*!< EADC_T::SCTL8: EXTFEN Mask */ - -#define EADC_SCTL8_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL8: TRGDLYDIV Position */ -#define EADC_SCTL8_TRGDLYDIV_Msk (0x3ul << EADC_SCTL8_TRGDLYDIV_Pos) /*!< EADC_T::SCTL8: TRGDLYDIV Mask */ - -#define EADC_SCTL8_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL8: TRGDLYCNT Position */ -#define EADC_SCTL8_TRGDLYCNT_Msk (0xfful << EADC_SCTL8_TRGDLYCNT_Pos) /*!< EADC_T::SCTL8: TRGDLYCNT Mask */ - -#define EADC_SCTL8_TRGSEL_Pos (16) /*!< EADC_T::SCTL8: TRGSEL Position */ -#define EADC_SCTL8_TRGSEL_Msk (0x1ful << EADC_SCTL8_TRGSEL_Pos) /*!< EADC_T::SCTL8: TRGSEL Mask */ - -#define EADC_SCTL8_INTPOS_Pos (22) /*!< EADC_T::SCTL8: INTPOS Position */ -#define EADC_SCTL8_INTPOS_Msk (0x1ul << EADC_SCTL8_INTPOS_Pos) /*!< EADC_T::SCTL8: INTPOS Mask */ - -#define EADC_SCTL8_EXTSMPT_Pos (24) /*!< EADC_T::SCTL8: EXTSMPT Position */ -#define EADC_SCTL8_EXTSMPT_Msk (0xfful << EADC_SCTL8_EXTSMPT_Pos) /*!< EADC_T::SCTL8: EXTSMPT Mask */ - -#define EADC_SCTL9_CHSEL_Pos (0) /*!< EADC_T::SCTL9: CHSEL Position */ -#define EADC_SCTL9_CHSEL_Msk (0xful << EADC_SCTL9_CHSEL_Pos) /*!< EADC_T::SCTL9: CHSEL Mask */ - -#define EADC_SCTL9_EXTREN_Pos (4) /*!< EADC_T::SCTL9: EXTREN Position */ -#define EADC_SCTL9_EXTREN_Msk (0x1ul << EADC_SCTL9_EXTREN_Pos) /*!< EADC_T::SCTL9: EXTREN Mask */ - -#define EADC_SCTL9_EXTFEN_Pos (5) /*!< EADC_T::SCTL9: EXTFEN Position */ -#define EADC_SCTL9_EXTFEN_Msk (0x1ul << EADC_SCTL9_EXTFEN_Pos) /*!< EADC_T::SCTL9: EXTFEN Mask */ - -#define EADC_SCTL9_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL9: TRGDLYDIV Position */ -#define EADC_SCTL9_TRGDLYDIV_Msk (0x3ul << EADC_SCTL9_TRGDLYDIV_Pos) /*!< EADC_T::SCTL9: TRGDLYDIV Mask */ - -#define EADC_SCTL9_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL9: TRGDLYCNT Position */ -#define EADC_SCTL9_TRGDLYCNT_Msk (0xfful << EADC_SCTL9_TRGDLYCNT_Pos) /*!< EADC_T::SCTL9: TRGDLYCNT Mask */ - -#define EADC_SCTL9_TRGSEL_Pos (16) /*!< EADC_T::SCTL9: TRGSEL Position */ -#define EADC_SCTL9_TRGSEL_Msk (0x1ful << EADC_SCTL9_TRGSEL_Pos) /*!< EADC_T::SCTL9: TRGSEL Mask */ - -#define EADC_SCTL9_INTPOS_Pos (22) /*!< EADC_T::SCTL9: INTPOS Position */ -#define EADC_SCTL9_INTPOS_Msk (0x1ul << EADC_SCTL9_INTPOS_Pos) /*!< EADC_T::SCTL9: INTPOS Mask */ - -#define EADC_SCTL9_EXTSMPT_Pos (24) /*!< EADC_T::SCTL9: EXTSMPT Position */ -#define EADC_SCTL9_EXTSMPT_Msk (0xfful << EADC_SCTL9_EXTSMPT_Pos) /*!< EADC_T::SCTL9: EXTSMPT Mask */ - -#define EADC_SCTL10_CHSEL_Pos (0) /*!< EADC_T::SCTL10: CHSEL Position */ -#define EADC_SCTL10_CHSEL_Msk (0xful << EADC_SCTL10_CHSEL_Pos) /*!< EADC_T::SCTL10: CHSEL Mask */ - -#define EADC_SCTL10_EXTREN_Pos (4) /*!< EADC_T::SCTL10: EXTREN Position */ -#define EADC_SCTL10_EXTREN_Msk (0x1ul << EADC_SCTL10_EXTREN_Pos) /*!< EADC_T::SCTL10: EXTREN Mask */ - -#define EADC_SCTL10_EXTFEN_Pos (5) /*!< EADC_T::SCTL10: EXTFEN Position */ -#define EADC_SCTL10_EXTFEN_Msk (0x1ul << EADC_SCTL10_EXTFEN_Pos) /*!< EADC_T::SCTL10: EXTFEN Mask */ - -#define EADC_SCTL10_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL10: TRGDLYDIV Position */ -#define EADC_SCTL10_TRGDLYDIV_Msk (0x3ul << EADC_SCTL10_TRGDLYDIV_Pos) /*!< EADC_T::SCTL10: TRGDLYDIV Mask */ - -#define EADC_SCTL10_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL10: TRGDLYCNT Position */ -#define EADC_SCTL10_TRGDLYCNT_Msk (0xfful << EADC_SCTL10_TRGDLYCNT_Pos) /*!< EADC_T::SCTL10: TRGDLYCNT Mask */ - -#define EADC_SCTL10_TRGSEL_Pos (16) /*!< EADC_T::SCTL10: TRGSEL Position */ -#define EADC_SCTL10_TRGSEL_Msk (0x1ful << EADC_SCTL10_TRGSEL_Pos) /*!< EADC_T::SCTL10: TRGSEL Mask */ - -#define EADC_SCTL10_INTPOS_Pos (22) /*!< EADC_T::SCTL10: INTPOS Position */ -#define EADC_SCTL10_INTPOS_Msk (0x1ul << EADC_SCTL10_INTPOS_Pos) /*!< EADC_T::SCTL10: INTPOS Mask */ - -#define EADC_SCTL10_EXTSMPT_Pos (24) /*!< EADC_T::SCTL10: EXTSMPT Position */ -#define EADC_SCTL10_EXTSMPT_Msk (0xfful << EADC_SCTL10_EXTSMPT_Pos) /*!< EADC_T::SCTL10: EXTSMPT Mask */ - -#define EADC_SCTL11_CHSEL_Pos (0) /*!< EADC_T::SCTL11: CHSEL Position */ -#define EADC_SCTL11_CHSEL_Msk (0xful << EADC_SCTL11_CHSEL_Pos) /*!< EADC_T::SCTL11: CHSEL Mask */ - -#define EADC_SCTL11_EXTREN_Pos (4) /*!< EADC_T::SCTL11: EXTREN Position */ -#define EADC_SCTL11_EXTREN_Msk (0x1ul << EADC_SCTL11_EXTREN_Pos) /*!< EADC_T::SCTL11: EXTREN Mask */ - -#define EADC_SCTL11_EXTFEN_Pos (5) /*!< EADC_T::SCTL11: EXTFEN Position */ -#define EADC_SCTL11_EXTFEN_Msk (0x1ul << EADC_SCTL11_EXTFEN_Pos) /*!< EADC_T::SCTL11: EXTFEN Mask */ - -#define EADC_SCTL11_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL11: TRGDLYDIV Position */ -#define EADC_SCTL11_TRGDLYDIV_Msk (0x3ul << EADC_SCTL11_TRGDLYDIV_Pos) /*!< EADC_T::SCTL11: TRGDLYDIV Mask */ - -#define EADC_SCTL11_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL11: TRGDLYCNT Position */ -#define EADC_SCTL11_TRGDLYCNT_Msk (0xfful << EADC_SCTL11_TRGDLYCNT_Pos) /*!< EADC_T::SCTL11: TRGDLYCNT Mask */ - -#define EADC_SCTL11_TRGSEL_Pos (16) /*!< EADC_T::SCTL11: TRGSEL Position */ -#define EADC_SCTL11_TRGSEL_Msk (0x1ful << EADC_SCTL11_TRGSEL_Pos) /*!< EADC_T::SCTL11: TRGSEL Mask */ - -#define EADC_SCTL11_INTPOS_Pos (22) /*!< EADC_T::SCTL11: INTPOS Position */ -#define EADC_SCTL11_INTPOS_Msk (0x1ul << EADC_SCTL11_INTPOS_Pos) /*!< EADC_T::SCTL11: INTPOS Mask */ - -#define EADC_SCTL11_EXTSMPT_Pos (24) /*!< EADC_T::SCTL11: EXTSMPT Position */ -#define EADC_SCTL11_EXTSMPT_Msk (0xfful << EADC_SCTL11_EXTSMPT_Pos) /*!< EADC_T::SCTL11: EXTSMPT Mask */ - -#define EADC_SCTL12_CHSEL_Pos (0) /*!< EADC_T::SCTL12: CHSEL Position */ -#define EADC_SCTL12_CHSEL_Msk (0xful << EADC_SCTL12_CHSEL_Pos) /*!< EADC_T::SCTL12: CHSEL Mask */ - -#define EADC_SCTL12_EXTREN_Pos (4) /*!< EADC_T::SCTL12: EXTREN Position */ -#define EADC_SCTL12_EXTREN_Msk (0x1ul << EADC_SCTL12_EXTREN_Pos) /*!< EADC_T::SCTL12: EXTREN Mask */ - -#define EADC_SCTL12_EXTFEN_Pos (5) /*!< EADC_T::SCTL12: EXTFEN Position */ -#define EADC_SCTL12_EXTFEN_Msk (0x1ul << EADC_SCTL12_EXTFEN_Pos) /*!< EADC_T::SCTL12: EXTFEN Mask */ - -#define EADC_SCTL12_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL12: TRGDLYDIV Position */ -#define EADC_SCTL12_TRGDLYDIV_Msk (0x3ul << EADC_SCTL12_TRGDLYDIV_Pos) /*!< EADC_T::SCTL12: TRGDLYDIV Mask */ - -#define EADC_SCTL12_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL12: TRGDLYCNT Position */ -#define EADC_SCTL12_TRGDLYCNT_Msk (0xfful << EADC_SCTL12_TRGDLYCNT_Pos) /*!< EADC_T::SCTL12: TRGDLYCNT Mask */ - -#define EADC_SCTL12_TRGSEL_Pos (16) /*!< EADC_T::SCTL12: TRGSEL Position */ -#define EADC_SCTL12_TRGSEL_Msk (0x1ful << EADC_SCTL12_TRGSEL_Pos) /*!< EADC_T::SCTL12: TRGSEL Mask */ - -#define EADC_SCTL12_INTPOS_Pos (22) /*!< EADC_T::SCTL12: INTPOS Position */ -#define EADC_SCTL12_INTPOS_Msk (0x1ul << EADC_SCTL12_INTPOS_Pos) /*!< EADC_T::SCTL12: INTPOS Mask */ - -#define EADC_SCTL12_EXTSMPT_Pos (24) /*!< EADC_T::SCTL12: EXTSMPT Position */ -#define EADC_SCTL12_EXTSMPT_Msk (0xfful << EADC_SCTL12_EXTSMPT_Pos) /*!< EADC_T::SCTL12: EXTSMPT Mask */ - -#define EADC_SCTL13_CHSEL_Pos (0) /*!< EADC_T::SCTL13: CHSEL Position */ -#define EADC_SCTL13_CHSEL_Msk (0xful << EADC_SCTL13_CHSEL_Pos) /*!< EADC_T::SCTL13: CHSEL Mask */ - -#define EADC_SCTL13_EXTREN_Pos (4) /*!< EADC_T::SCTL13: EXTREN Position */ -#define EADC_SCTL13_EXTREN_Msk (0x1ul << EADC_SCTL13_EXTREN_Pos) /*!< EADC_T::SCTL13: EXTREN Mask */ - -#define EADC_SCTL13_EXTFEN_Pos (5) /*!< EADC_T::SCTL13: EXTFEN Position */ -#define EADC_SCTL13_EXTFEN_Msk (0x1ul << EADC_SCTL13_EXTFEN_Pos) /*!< EADC_T::SCTL13: EXTFEN Mask */ - -#define EADC_SCTL13_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL13: TRGDLYDIV Position */ -#define EADC_SCTL13_TRGDLYDIV_Msk (0x3ul << EADC_SCTL13_TRGDLYDIV_Pos) /*!< EADC_T::SCTL13: TRGDLYDIV Mask */ - -#define EADC_SCTL13_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL13: TRGDLYCNT Position */ -#define EADC_SCTL13_TRGDLYCNT_Msk (0xfful << EADC_SCTL13_TRGDLYCNT_Pos) /*!< EADC_T::SCTL13: TRGDLYCNT Mask */ - -#define EADC_SCTL13_TRGSEL_Pos (16) /*!< EADC_T::SCTL13: TRGSEL Position */ -#define EADC_SCTL13_TRGSEL_Msk (0x1ful << EADC_SCTL13_TRGSEL_Pos) /*!< EADC_T::SCTL13: TRGSEL Mask */ - -#define EADC_SCTL13_INTPOS_Pos (22) /*!< EADC_T::SCTL13: INTPOS Position */ -#define EADC_SCTL13_INTPOS_Msk (0x1ul << EADC_SCTL13_INTPOS_Pos) /*!< EADC_T::SCTL13: INTPOS Mask */ - -#define EADC_SCTL13_EXTSMPT_Pos (24) /*!< EADC_T::SCTL13: EXTSMPT Position */ -#define EADC_SCTL13_EXTSMPT_Msk (0xfful << EADC_SCTL13_EXTSMPT_Pos) /*!< EADC_T::SCTL13: EXTSMPT Mask */ - -#define EADC_SCTL14_CHSEL_Pos (0) /*!< EADC_T::SCTL14: CHSEL Position */ -#define EADC_SCTL14_CHSEL_Msk (0xful << EADC_SCTL14_CHSEL_Pos) /*!< EADC_T::SCTL14: CHSEL Mask */ - -#define EADC_SCTL14_EXTREN_Pos (4) /*!< EADC_T::SCTL14: EXTREN Position */ -#define EADC_SCTL14_EXTREN_Msk (0x1ul << EADC_SCTL14_EXTREN_Pos) /*!< EADC_T::SCTL14: EXTREN Mask */ - -#define EADC_SCTL14_EXTFEN_Pos (5) /*!< EADC_T::SCTL14: EXTFEN Position */ -#define EADC_SCTL14_EXTFEN_Msk (0x1ul << EADC_SCTL14_EXTFEN_Pos) /*!< EADC_T::SCTL14: EXTFEN Mask */ - -#define EADC_SCTL14_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL14: TRGDLYDIV Position */ -#define EADC_SCTL14_TRGDLYDIV_Msk (0x3ul << EADC_SCTL14_TRGDLYDIV_Pos) /*!< EADC_T::SCTL14: TRGDLYDIV Mask */ - -#define EADC_SCTL14_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL14: TRGDLYCNT Position */ -#define EADC_SCTL14_TRGDLYCNT_Msk (0xfful << EADC_SCTL14_TRGDLYCNT_Pos) /*!< EADC_T::SCTL14: TRGDLYCNT Mask */ - -#define EADC_SCTL14_TRGSEL_Pos (16) /*!< EADC_T::SCTL14: TRGSEL Position */ -#define EADC_SCTL14_TRGSEL_Msk (0x1ful << EADC_SCTL14_TRGSEL_Pos) /*!< EADC_T::SCTL14: TRGSEL Mask */ - -#define EADC_SCTL14_INTPOS_Pos (22) /*!< EADC_T::SCTL14: INTPOS Position */ -#define EADC_SCTL14_INTPOS_Msk (0x1ul << EADC_SCTL14_INTPOS_Pos) /*!< EADC_T::SCTL14: INTPOS Mask */ - -#define EADC_SCTL14_EXTSMPT_Pos (24) /*!< EADC_T::SCTL14: EXTSMPT Position */ -#define EADC_SCTL14_EXTSMPT_Msk (0xfful << EADC_SCTL14_EXTSMPT_Pos) /*!< EADC_T::SCTL14: EXTSMPT Mask */ - -#define EADC_SCTL15_CHSEL_Pos (0) /*!< EADC_T::SCTL15: CHSEL Position */ -#define EADC_SCTL15_CHSEL_Msk (0xful << EADC_SCTL15_CHSEL_Pos) /*!< EADC_T::SCTL15: CHSEL Mask */ - -#define EADC_SCTL15_EXTREN_Pos (4) /*!< EADC_T::SCTL15: EXTREN Position */ -#define EADC_SCTL15_EXTREN_Msk (0x1ul << EADC_SCTL15_EXTREN_Pos) /*!< EADC_T::SCTL15: EXTREN Mask */ - -#define EADC_SCTL15_EXTFEN_Pos (5) /*!< EADC_T::SCTL15: EXTFEN Position */ -#define EADC_SCTL15_EXTFEN_Msk (0x1ul << EADC_SCTL15_EXTFEN_Pos) /*!< EADC_T::SCTL15: EXTFEN Mask */ - -#define EADC_SCTL15_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL15: TRGDLYDIV Position */ -#define EADC_SCTL15_TRGDLYDIV_Msk (0x3ul << EADC_SCTL15_TRGDLYDIV_Pos) /*!< EADC_T::SCTL15: TRGDLYDIV Mask */ - -#define EADC_SCTL15_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL15: TRGDLYCNT Position */ -#define EADC_SCTL15_TRGDLYCNT_Msk (0xfful << EADC_SCTL15_TRGDLYCNT_Pos) /*!< EADC_T::SCTL15: TRGDLYCNT Mask */ - -#define EADC_SCTL15_TRGSEL_Pos (16) /*!< EADC_T::SCTL15: TRGSEL Position */ -#define EADC_SCTL15_TRGSEL_Msk (0x1ful << EADC_SCTL15_TRGSEL_Pos) /*!< EADC_T::SCTL15: TRGSEL Mask */ - -#define EADC_SCTL15_INTPOS_Pos (22) /*!< EADC_T::SCTL15: INTPOS Position */ -#define EADC_SCTL15_INTPOS_Msk (0x1ul << EADC_SCTL15_INTPOS_Pos) /*!< EADC_T::SCTL15: INTPOS Mask */ - -#define EADC_SCTL15_EXTSMPT_Pos (24) /*!< EADC_T::SCTL15: EXTSMPT Position */ -#define EADC_SCTL15_EXTSMPT_Msk (0xfful << EADC_SCTL15_EXTSMPT_Pos) /*!< EADC_T::SCTL15: EXTSMPT Mask */ - -#define EADC_SCTL16_EXTSMPT_Pos (24) /*!< EADC_T::SCTL16: EXTSMPT Position */ -#define EADC_SCTL16_EXTSMPT_Msk (0xfful << EADC_SCTL16_EXTSMPT_Pos) /*!< EADC_T::SCTL16: EXTSMPT Mask */ - -#define EADC_SCTL17_EXTSMPT_Pos (24) /*!< EADC_T::SCTL17: EXTSMPT Position */ -#define EADC_SCTL17_EXTSMPT_Msk (0xfful << EADC_SCTL17_EXTSMPT_Pos) /*!< EADC_T::SCTL17: EXTSMPT Mask */ - -#define EADC_SCTL18_EXTSMPT_Pos (24) /*!< EADC_T::SCTL18: EXTSMPT Position */ -#define EADC_SCTL18_EXTSMPT_Msk (0xfful << EADC_SCTL18_EXTSMPT_Pos) /*!< EADC_T::SCTL18: EXTSMPT Mask */ - -#define EADC_INTSRC0_SPLIE0_Pos (0) /*!< EADC_T::INTSRC0: SPLIE0 Position */ -#define EADC_INTSRC0_SPLIE0_Msk (0x1ul << EADC_INTSRC0_SPLIE0_Pos) /*!< EADC_T::INTSRC0: SPLIE0 Mask */ - -#define EADC_INTSRC0_SPLIE1_Pos (1) /*!< EADC_T::INTSRC0: SPLIE1 Position */ -#define EADC_INTSRC0_SPLIE1_Msk (0x1ul << EADC_INTSRC0_SPLIE1_Pos) /*!< EADC_T::INTSRC0: SPLIE1 Mask */ - -#define EADC_INTSRC0_SPLIE2_Pos (2) /*!< EADC_T::INTSRC0: SPLIE2 Position */ -#define EADC_INTSRC0_SPLIE2_Msk (0x1ul << EADC_INTSRC0_SPLIE2_Pos) /*!< EADC_T::INTSRC0: SPLIE2 Mask */ - -#define EADC_INTSRC0_SPLIE3_Pos (3) /*!< EADC_T::INTSRC0: SPLIE3 Position */ -#define EADC_INTSRC0_SPLIE3_Msk (0x1ul << EADC_INTSRC0_SPLIE3_Pos) /*!< EADC_T::INTSRC0: SPLIE3 Mask */ - -#define EADC_INTSRC0_SPLIE4_Pos (4) /*!< EADC_T::INTSRC0: SPLIE4 Position */ -#define EADC_INTSRC0_SPLIE4_Msk (0x1ul << EADC_INTSRC0_SPLIE4_Pos) /*!< EADC_T::INTSRC0: SPLIE4 Mask */ - -#define EADC_INTSRC0_SPLIE5_Pos (5) /*!< EADC_T::INTSRC0: SPLIE5 Position */ -#define EADC_INTSRC0_SPLIE5_Msk (0x1ul << EADC_INTSRC0_SPLIE5_Pos) /*!< EADC_T::INTSRC0: SPLIE5 Mask */ - -#define EADC_INTSRC0_SPLIE6_Pos (6) /*!< EADC_T::INTSRC0: SPLIE6 Position */ -#define EADC_INTSRC0_SPLIE6_Msk (0x1ul << EADC_INTSRC0_SPLIE6_Pos) /*!< EADC_T::INTSRC0: SPLIE6 Mask */ - -#define EADC_INTSRC0_SPLIE7_Pos (7) /*!< EADC_T::INTSRC0: SPLIE7 Position */ -#define EADC_INTSRC0_SPLIE7_Msk (0x1ul << EADC_INTSRC0_SPLIE7_Pos) /*!< EADC_T::INTSRC0: SPLIE7 Mask */ - -#define EADC_INTSRC0_SPLIE8_Pos (8) /*!< EADC_T::INTSRC0: SPLIE8 Position */ -#define EADC_INTSRC0_SPLIE8_Msk (0x1ul << EADC_INTSRC0_SPLIE8_Pos) /*!< EADC_T::INTSRC0: SPLIE8 Mask */ - -#define EADC_INTSRC0_SPLIE9_Pos (9) /*!< EADC_T::INTSRC0: SPLIE9 Position */ -#define EADC_INTSRC0_SPLIE9_Msk (0x1ul << EADC_INTSRC0_SPLIE9_Pos) /*!< EADC_T::INTSRC0: SPLIE9 Mask */ - -#define EADC_INTSRC0_SPLIE10_Pos (10) /*!< EADC_T::INTSRC0: SPLIE10 Position */ -#define EADC_INTSRC0_SPLIE10_Msk (0x1ul << EADC_INTSRC0_SPLIE10_Pos) /*!< EADC_T::INTSRC0: SPLIE10 Mask */ - -#define EADC_INTSRC0_SPLIE11_Pos (11) /*!< EADC_T::INTSRC0: SPLIE11 Position */ -#define EADC_INTSRC0_SPLIE11_Msk (0x1ul << EADC_INTSRC0_SPLIE11_Pos) /*!< EADC_T::INTSRC0: SPLIE11 Mask */ - -#define EADC_INTSRC0_SPLIE12_Pos (12) /*!< EADC_T::INTSRC0: SPLIE12 Position */ -#define EADC_INTSRC0_SPLIE12_Msk (0x1ul << EADC_INTSRC0_SPLIE12_Pos) /*!< EADC_T::INTSRC0: SPLIE12 Mask */ - -#define EADC_INTSRC0_SPLIE13_Pos (13) /*!< EADC_T::INTSRC0: SPLIE13 Position */ -#define EADC_INTSRC0_SPLIE13_Msk (0x1ul << EADC_INTSRC0_SPLIE13_Pos) /*!< EADC_T::INTSRC0: SPLIE13 Mask */ - -#define EADC_INTSRC0_SPLIE14_Pos (14) /*!< EADC_T::INTSRC0: SPLIE14 Position */ -#define EADC_INTSRC0_SPLIE14_Msk (0x1ul << EADC_INTSRC0_SPLIE14_Pos) /*!< EADC_T::INTSRC0: SPLIE14 Mask */ - -#define EADC_INTSRC0_SPLIE15_Pos (15) /*!< EADC_T::INTSRC0: SPLIE15 Position */ -#define EADC_INTSRC0_SPLIE15_Msk (0x1ul << EADC_INTSRC0_SPLIE15_Pos) /*!< EADC_T::INTSRC0: SPLIE15 Mask */ - -#define EADC_INTSRC0_SPLIE16_Pos (16) /*!< EADC_T::INTSRC0: SPLIE16 Position */ -#define EADC_INTSRC0_SPLIE16_Msk (0x1ul << EADC_INTSRC0_SPLIE16_Pos) /*!< EADC_T::INTSRC0: SPLIE16 Mask */ - -#define EADC_INTSRC0_SPLIE17_Pos (17) /*!< EADC_T::INTSRC0: SPLIE17 Position */ -#define EADC_INTSRC0_SPLIE17_Msk (0x1ul << EADC_INTSRC0_SPLIE17_Pos) /*!< EADC_T::INTSRC0: SPLIE17 Mask */ - -#define EADC_INTSRC0_SPLIE18_Pos (18) /*!< EADC_T::INTSRC0: SPLIE18 Position */ -#define EADC_INTSRC0_SPLIE18_Msk (0x1ul << EADC_INTSRC0_SPLIE18_Pos) /*!< EADC_T::INTSRC0: SPLIE18 Mask */ - -#define EADC_INTSRC1_SPLIE0_Pos (0) /*!< EADC_T::INTSRC1: SPLIE0 Position */ -#define EADC_INTSRC1_SPLIE0_Msk (0x1ul << EADC_INTSRC1_SPLIE0_Pos) /*!< EADC_T::INTSRC1: SPLIE0 Mask */ - -#define EADC_INTSRC1_SPLIE1_Pos (1) /*!< EADC_T::INTSRC1: SPLIE1 Position */ -#define EADC_INTSRC1_SPLIE1_Msk (0x1ul << EADC_INTSRC1_SPLIE1_Pos) /*!< EADC_T::INTSRC1: SPLIE1 Mask */ - -#define EADC_INTSRC1_SPLIE2_Pos (2) /*!< EADC_T::INTSRC1: SPLIE2 Position */ -#define EADC_INTSRC1_SPLIE2_Msk (0x1ul << EADC_INTSRC1_SPLIE2_Pos) /*!< EADC_T::INTSRC1: SPLIE2 Mask */ - -#define EADC_INTSRC1_SPLIE3_Pos (3) /*!< EADC_T::INTSRC1: SPLIE3 Position */ -#define EADC_INTSRC1_SPLIE3_Msk (0x1ul << EADC_INTSRC1_SPLIE3_Pos) /*!< EADC_T::INTSRC1: SPLIE3 Mask */ - -#define EADC_INTSRC1_SPLIE4_Pos (4) /*!< EADC_T::INTSRC1: SPLIE4 Position */ -#define EADC_INTSRC1_SPLIE4_Msk (0x1ul << EADC_INTSRC1_SPLIE4_Pos) /*!< EADC_T::INTSRC1: SPLIE4 Mask */ - -#define EADC_INTSRC1_SPLIE5_Pos (5) /*!< EADC_T::INTSRC1: SPLIE5 Position */ -#define EADC_INTSRC1_SPLIE5_Msk (0x1ul << EADC_INTSRC1_SPLIE5_Pos) /*!< EADC_T::INTSRC1: SPLIE5 Mask */ - -#define EADC_INTSRC1_SPLIE6_Pos (6) /*!< EADC_T::INTSRC1: SPLIE6 Position */ -#define EADC_INTSRC1_SPLIE6_Msk (0x1ul << EADC_INTSRC1_SPLIE6_Pos) /*!< EADC_T::INTSRC1: SPLIE6 Mask */ - -#define EADC_INTSRC1_SPLIE7_Pos (7) /*!< EADC_T::INTSRC1: SPLIE7 Position */ -#define EADC_INTSRC1_SPLIE7_Msk (0x1ul << EADC_INTSRC1_SPLIE7_Pos) /*!< EADC_T::INTSRC1: SPLIE7 Mask */ - -#define EADC_INTSRC1_SPLIE8_Pos (8) /*!< EADC_T::INTSRC1: SPLIE8 Position */ -#define EADC_INTSRC1_SPLIE8_Msk (0x1ul << EADC_INTSRC1_SPLIE8_Pos) /*!< EADC_T::INTSRC1: SPLIE8 Mask */ - -#define EADC_INTSRC1_SPLIE9_Pos (9) /*!< EADC_T::INTSRC1: SPLIE9 Position */ -#define EADC_INTSRC1_SPLIE9_Msk (0x1ul << EADC_INTSRC1_SPLIE9_Pos) /*!< EADC_T::INTSRC1: SPLIE9 Mask */ - -#define EADC_INTSRC1_SPLIE10_Pos (10) /*!< EADC_T::INTSRC1: SPLIE10 Position */ -#define EADC_INTSRC1_SPLIE10_Msk (0x1ul << EADC_INTSRC1_SPLIE10_Pos) /*!< EADC_T::INTSRC1: SPLIE10 Mask */ - -#define EADC_INTSRC1_SPLIE11_Pos (11) /*!< EADC_T::INTSRC1: SPLIE11 Position */ -#define EADC_INTSRC1_SPLIE11_Msk (0x1ul << EADC_INTSRC1_SPLIE11_Pos) /*!< EADC_T::INTSRC1: SPLIE11 Mask */ - -#define EADC_INTSRC1_SPLIE12_Pos (12) /*!< EADC_T::INTSRC1: SPLIE12 Position */ -#define EADC_INTSRC1_SPLIE12_Msk (0x1ul << EADC_INTSRC1_SPLIE12_Pos) /*!< EADC_T::INTSRC1: SPLIE12 Mask */ - -#define EADC_INTSRC1_SPLIE13_Pos (13) /*!< EADC_T::INTSRC1: SPLIE13 Position */ -#define EADC_INTSRC1_SPLIE13_Msk (0x1ul << EADC_INTSRC1_SPLIE13_Pos) /*!< EADC_T::INTSRC1: SPLIE13 Mask */ - -#define EADC_INTSRC1_SPLIE14_Pos (14) /*!< EADC_T::INTSRC1: SPLIE14 Position */ -#define EADC_INTSRC1_SPLIE14_Msk (0x1ul << EADC_INTSRC1_SPLIE14_Pos) /*!< EADC_T::INTSRC1: SPLIE14 Mask */ - -#define EADC_INTSRC1_SPLIE15_Pos (15) /*!< EADC_T::INTSRC1: SPLIE15 Position */ -#define EADC_INTSRC1_SPLIE15_Msk (0x1ul << EADC_INTSRC1_SPLIE15_Pos) /*!< EADC_T::INTSRC1: SPLIE15 Mask */ - -#define EADC_INTSRC1_SPLIE16_Pos (16) /*!< EADC_T::INTSRC1: SPLIE16 Position */ -#define EADC_INTSRC1_SPLIE16_Msk (0x1ul << EADC_INTSRC1_SPLIE16_Pos) /*!< EADC_T::INTSRC1: SPLIE16 Mask */ - -#define EADC_INTSRC1_SPLIE17_Pos (17) /*!< EADC_T::INTSRC1: SPLIE17 Position */ -#define EADC_INTSRC1_SPLIE17_Msk (0x1ul << EADC_INTSRC1_SPLIE17_Pos) /*!< EADC_T::INTSRC1: SPLIE17 Mask */ - -#define EADC_INTSRC1_SPLIE18_Pos (18) /*!< EADC_T::INTSRC1: SPLIE18 Position */ -#define EADC_INTSRC1_SPLIE18_Msk (0x1ul << EADC_INTSRC1_SPLIE18_Pos) /*!< EADC_T::INTSRC1: SPLIE18 Mask */ - -#define EADC_INTSRC2_SPLIE0_Pos (0) /*!< EADC_T::INTSRC2: SPLIE0 Position */ -#define EADC_INTSRC2_SPLIE0_Msk (0x1ul << EADC_INTSRC2_SPLIE0_Pos) /*!< EADC_T::INTSRC2: SPLIE0 Mask */ - -#define EADC_INTSRC2_SPLIE1_Pos (1) /*!< EADC_T::INTSRC2: SPLIE1 Position */ -#define EADC_INTSRC2_SPLIE1_Msk (0x1ul << EADC_INTSRC2_SPLIE1_Pos) /*!< EADC_T::INTSRC2: SPLIE1 Mask */ - -#define EADC_INTSRC2_SPLIE2_Pos (2) /*!< EADC_T::INTSRC2: SPLIE2 Position */ -#define EADC_INTSRC2_SPLIE2_Msk (0x1ul << EADC_INTSRC2_SPLIE2_Pos) /*!< EADC_T::INTSRC2: SPLIE2 Mask */ - -#define EADC_INTSRC2_SPLIE3_Pos (3) /*!< EADC_T::INTSRC2: SPLIE3 Position */ -#define EADC_INTSRC2_SPLIE3_Msk (0x1ul << EADC_INTSRC2_SPLIE3_Pos) /*!< EADC_T::INTSRC2: SPLIE3 Mask */ - -#define EADC_INTSRC2_SPLIE4_Pos (4) /*!< EADC_T::INTSRC2: SPLIE4 Position */ -#define EADC_INTSRC2_SPLIE4_Msk (0x1ul << EADC_INTSRC2_SPLIE4_Pos) /*!< EADC_T::INTSRC2: SPLIE4 Mask */ - -#define EADC_INTSRC2_SPLIE5_Pos (5) /*!< EADC_T::INTSRC2: SPLIE5 Position */ -#define EADC_INTSRC2_SPLIE5_Msk (0x1ul << EADC_INTSRC2_SPLIE5_Pos) /*!< EADC_T::INTSRC2: SPLIE5 Mask */ - -#define EADC_INTSRC2_SPLIE6_Pos (6) /*!< EADC_T::INTSRC2: SPLIE6 Position */ -#define EADC_INTSRC2_SPLIE6_Msk (0x1ul << EADC_INTSRC2_SPLIE6_Pos) /*!< EADC_T::INTSRC2: SPLIE6 Mask */ - -#define EADC_INTSRC2_SPLIE7_Pos (7) /*!< EADC_T::INTSRC2: SPLIE7 Position */ -#define EADC_INTSRC2_SPLIE7_Msk (0x1ul << EADC_INTSRC2_SPLIE7_Pos) /*!< EADC_T::INTSRC2: SPLIE7 Mask */ - -#define EADC_INTSRC2_SPLIE8_Pos (8) /*!< EADC_T::INTSRC2: SPLIE8 Position */ -#define EADC_INTSRC2_SPLIE8_Msk (0x1ul << EADC_INTSRC2_SPLIE8_Pos) /*!< EADC_T::INTSRC2: SPLIE8 Mask */ - -#define EADC_INTSRC2_SPLIE9_Pos (9) /*!< EADC_T::INTSRC2: SPLIE9 Position */ -#define EADC_INTSRC2_SPLIE9_Msk (0x1ul << EADC_INTSRC2_SPLIE9_Pos) /*!< EADC_T::INTSRC2: SPLIE9 Mask */ - -#define EADC_INTSRC2_SPLIE10_Pos (10) /*!< EADC_T::INTSRC2: SPLIE10 Position */ -#define EADC_INTSRC2_SPLIE10_Msk (0x1ul << EADC_INTSRC2_SPLIE10_Pos) /*!< EADC_T::INTSRC2: SPLIE10 Mask */ - -#define EADC_INTSRC2_SPLIE11_Pos (11) /*!< EADC_T::INTSRC2: SPLIE11 Position */ -#define EADC_INTSRC2_SPLIE11_Msk (0x1ul << EADC_INTSRC2_SPLIE11_Pos) /*!< EADC_T::INTSRC2: SPLIE11 Mask */ - -#define EADC_INTSRC2_SPLIE12_Pos (12) /*!< EADC_T::INTSRC2: SPLIE12 Position */ -#define EADC_INTSRC2_SPLIE12_Msk (0x1ul << EADC_INTSRC2_SPLIE12_Pos) /*!< EADC_T::INTSRC2: SPLIE12 Mask */ - -#define EADC_INTSRC2_SPLIE13_Pos (13) /*!< EADC_T::INTSRC2: SPLIE13 Position */ -#define EADC_INTSRC2_SPLIE13_Msk (0x1ul << EADC_INTSRC2_SPLIE13_Pos) /*!< EADC_T::INTSRC2: SPLIE13 Mask */ - -#define EADC_INTSRC2_SPLIE14_Pos (14) /*!< EADC_T::INTSRC2: SPLIE14 Position */ -#define EADC_INTSRC2_SPLIE14_Msk (0x1ul << EADC_INTSRC2_SPLIE14_Pos) /*!< EADC_T::INTSRC2: SPLIE14 Mask */ - -#define EADC_INTSRC2_SPLIE15_Pos (15) /*!< EADC_T::INTSRC2: SPLIE15 Position */ -#define EADC_INTSRC2_SPLIE15_Msk (0x1ul << EADC_INTSRC2_SPLIE15_Pos) /*!< EADC_T::INTSRC2: SPLIE15 Mask */ - -#define EADC_INTSRC2_SPLIE16_Pos (16) /*!< EADC_T::INTSRC2: SPLIE16 Position */ -#define EADC_INTSRC2_SPLIE16_Msk (0x1ul << EADC_INTSRC2_SPLIE16_Pos) /*!< EADC_T::INTSRC2: SPLIE16 Mask */ - -#define EADC_INTSRC2_SPLIE17_Pos (17) /*!< EADC_T::INTSRC2: SPLIE17 Position */ -#define EADC_INTSRC2_SPLIE17_Msk (0x1ul << EADC_INTSRC2_SPLIE17_Pos) /*!< EADC_T::INTSRC2: SPLIE17 Mask */ - -#define EADC_INTSRC2_SPLIE18_Pos (18) /*!< EADC_T::INTSRC2: SPLIE18 Position */ -#define EADC_INTSRC2_SPLIE18_Msk (0x1ul << EADC_INTSRC2_SPLIE18_Pos) /*!< EADC_T::INTSRC2: SPLIE18 Mask */ - -#define EADC_INTSRC3_SPLIE0_Pos (0) /*!< EADC_T::INTSRC3: SPLIE0 Position */ -#define EADC_INTSRC3_SPLIE0_Msk (0x1ul << EADC_INTSRC3_SPLIE0_Pos) /*!< EADC_T::INTSRC3: SPLIE0 Mask */ - -#define EADC_INTSRC3_SPLIE1_Pos (1) /*!< EADC_T::INTSRC3: SPLIE1 Position */ -#define EADC_INTSRC3_SPLIE1_Msk (0x1ul << EADC_INTSRC3_SPLIE1_Pos) /*!< EADC_T::INTSRC3: SPLIE1 Mask */ - -#define EADC_INTSRC3_SPLIE2_Pos (2) /*!< EADC_T::INTSRC3: SPLIE2 Position */ -#define EADC_INTSRC3_SPLIE2_Msk (0x1ul << EADC_INTSRC3_SPLIE2_Pos) /*!< EADC_T::INTSRC3: SPLIE2 Mask */ - -#define EADC_INTSRC3_SPLIE3_Pos (3) /*!< EADC_T::INTSRC3: SPLIE3 Position */ -#define EADC_INTSRC3_SPLIE3_Msk (0x1ul << EADC_INTSRC3_SPLIE3_Pos) /*!< EADC_T::INTSRC3: SPLIE3 Mask */ - -#define EADC_INTSRC3_SPLIE4_Pos (4) /*!< EADC_T::INTSRC3: SPLIE4 Position */ -#define EADC_INTSRC3_SPLIE4_Msk (0x1ul << EADC_INTSRC3_SPLIE4_Pos) /*!< EADC_T::INTSRC3: SPLIE4 Mask */ - -#define EADC_INTSRC3_SPLIE5_Pos (5) /*!< EADC_T::INTSRC3: SPLIE5 Position */ -#define EADC_INTSRC3_SPLIE5_Msk (0x1ul << EADC_INTSRC3_SPLIE5_Pos) /*!< EADC_T::INTSRC3: SPLIE5 Mask */ - -#define EADC_INTSRC3_SPLIE6_Pos (6) /*!< EADC_T::INTSRC3: SPLIE6 Position */ -#define EADC_INTSRC3_SPLIE6_Msk (0x1ul << EADC_INTSRC3_SPLIE6_Pos) /*!< EADC_T::INTSRC3: SPLIE6 Mask */ - -#define EADC_INTSRC3_SPLIE7_Pos (7) /*!< EADC_T::INTSRC3: SPLIE7 Position */ -#define EADC_INTSRC3_SPLIE7_Msk (0x1ul << EADC_INTSRC3_SPLIE7_Pos) /*!< EADC_T::INTSRC3: SPLIE7 Mask */ - -#define EADC_INTSRC3_SPLIE8_Pos (8) /*!< EADC_T::INTSRC3: SPLIE8 Position */ -#define EADC_INTSRC3_SPLIE8_Msk (0x1ul << EADC_INTSRC3_SPLIE8_Pos) /*!< EADC_T::INTSRC3: SPLIE8 Mask */ - -#define EADC_INTSRC3_SPLIE9_Pos (9) /*!< EADC_T::INTSRC3: SPLIE9 Position */ -#define EADC_INTSRC3_SPLIE9_Msk (0x1ul << EADC_INTSRC3_SPLIE9_Pos) /*!< EADC_T::INTSRC3: SPLIE9 Mask */ - -#define EADC_INTSRC3_SPLIE10_Pos (10) /*!< EADC_T::INTSRC3: SPLIE10 Position */ -#define EADC_INTSRC3_SPLIE10_Msk (0x1ul << EADC_INTSRC3_SPLIE10_Pos) /*!< EADC_T::INTSRC3: SPLIE10 Mask */ - -#define EADC_INTSRC3_SPLIE11_Pos (11) /*!< EADC_T::INTSRC3: SPLIE11 Position */ -#define EADC_INTSRC3_SPLIE11_Msk (0x1ul << EADC_INTSRC3_SPLIE11_Pos) /*!< EADC_T::INTSRC3: SPLIE11 Mask */ - -#define EADC_INTSRC3_SPLIE12_Pos (12) /*!< EADC_T::INTSRC3: SPLIE12 Position */ -#define EADC_INTSRC3_SPLIE12_Msk (0x1ul << EADC_INTSRC3_SPLIE12_Pos) /*!< EADC_T::INTSRC3: SPLIE12 Mask */ - -#define EADC_INTSRC3_SPLIE13_Pos (13) /*!< EADC_T::INTSRC3: SPLIE13 Position */ -#define EADC_INTSRC3_SPLIE13_Msk (0x1ul << EADC_INTSRC3_SPLIE13_Pos) /*!< EADC_T::INTSRC3: SPLIE13 Mask */ - -#define EADC_INTSRC3_SPLIE14_Pos (14) /*!< EADC_T::INTSRC3: SPLIE14 Position */ -#define EADC_INTSRC3_SPLIE14_Msk (0x1ul << EADC_INTSRC3_SPLIE14_Pos) /*!< EADC_T::INTSRC3: SPLIE14 Mask */ - -#define EADC_INTSRC3_SPLIE15_Pos (15) /*!< EADC_T::INTSRC3: SPLIE15 Position */ -#define EADC_INTSRC3_SPLIE15_Msk (0x1ul << EADC_INTSRC3_SPLIE15_Pos) /*!< EADC_T::INTSRC3: SPLIE15 Mask */ - -#define EADC_INTSRC3_SPLIE16_Pos (16) /*!< EADC_T::INTSRC3: SPLIE16 Position */ -#define EADC_INTSRC3_SPLIE16_Msk (0x1ul << EADC_INTSRC3_SPLIE16_Pos) /*!< EADC_T::INTSRC3: SPLIE16 Mask */ - -#define EADC_INTSRC3_SPLIE17_Pos (17) /*!< EADC_T::INTSRC3: SPLIE17 Position */ -#define EADC_INTSRC3_SPLIE17_Msk (0x1ul << EADC_INTSRC3_SPLIE17_Pos) /*!< EADC_T::INTSRC3: SPLIE17 Mask */ - -#define EADC_INTSRC3_SPLIE18_Pos (18) /*!< EADC_T::INTSRC3: SPLIE18 Position */ -#define EADC_INTSRC3_SPLIE18_Msk (0x1ul << EADC_INTSRC3_SPLIE18_Pos) /*!< EADC_T::INTSRC3: SPLIE18 Mask */ - -#define EADC_CMP_ADCMPEN_Pos (0) /*!< EADC_T::CMP: ADCMPEN Position */ -#define EADC_CMP_ADCMPEN_Msk (0x1ul << EADC_CMP_ADCMPEN_Pos) /*!< EADC_T::CMP: ADCMPEN Mask */ - -#define EADC_CMP_ADCMPIE_Pos (1) /*!< EADC_T::CMP: ADCMPIE Position */ -#define EADC_CMP_ADCMPIE_Msk (0x1ul << EADC_CMP_ADCMPIE_Pos) /*!< EADC_T::CMP: ADCMPIE Mask */ - -#define EADC_CMP_CMPCOND_Pos (2) /*!< EADC_T::CMP: CMPCOND Position */ -#define EADC_CMP_CMPCOND_Msk (0x1ul << EADC_CMP_CMPCOND_Pos) /*!< EADC_T::CMP: CMPCOND Mask */ - -#define EADC_CMP_CMPSPL_Pos (3) /*!< EADC_T::CMP: CMPSPL Position */ -#define EADC_CMP_CMPSPL_Msk (0x1ful << EADC_CMP_CMPSPL_Pos) /*!< EADC_T::CMP: CMPSPL Mask */ - -#define EADC_CMP_CMPMCNT_Pos (8) /*!< EADC_T::CMP: CMPMCNT Position */ -#define EADC_CMP_CMPMCNT_Msk (0xful << EADC_CMP_CMPMCNT_Pos) /*!< EADC_T::CMP: CMPMCNT Mask */ - -#define EADC_CMP_CMPWEN_Pos (15) /*!< EADC_T::CMP: CMPWEN Position */ -#define EADC_CMP_CMPWEN_Msk (0x1ul << EADC_CMP_CMPWEN_Pos) /*!< EADC_T::CMP: CMPWEN Mask */ - -#define EADC_CMP_CMPDAT_Pos (16) /*!< EADC_T::CMP: CMPDAT Position */ -#define EADC_CMP_CMPDAT_Msk (0xffful << EADC_CMP_CMPDAT_Pos) /*!< EADC_T::CMP: CMPDAT Mask */ - -#define EADC_CMP0_ADCMPEN_Pos (0) /*!< EADC_T::CMP0: ADCMPEN Position */ -#define EADC_CMP0_ADCMPEN_Msk (0x1ul << EADC_CMP0_ADCMPEN_Pos) /*!< EADC_T::CMP0: ADCMPEN Mask */ - -#define EADC_CMP0_ADCMPIE_Pos (1) /*!< EADC_T::CMP0: ADCMPIE Position */ -#define EADC_CMP0_ADCMPIE_Msk (0x1ul << EADC_CMP0_ADCMPIE_Pos) /*!< EADC_T::CMP0: ADCMPIE Mask */ - -#define EADC_CMP0_CMPCOND_Pos (2) /*!< EADC_T::CMP0: CMPCOND Position */ -#define EADC_CMP0_CMPCOND_Msk (0x1ul << EADC_CMP0_CMPCOND_Pos) /*!< EADC_T::CMP0: CMPCOND Mask */ - -#define EADC_CMP0_CMPSPL_Pos (3) /*!< EADC_T::CMP0: CMPSPL Position */ -#define EADC_CMP0_CMPSPL_Msk (0x1ful << EADC_CMP0_CMPSPL_Pos) /*!< EADC_T::CMP0: CMPSPL Mask */ - -#define EADC_CMP0_CMPMCNT_Pos (8) /*!< EADC_T::CMP0: CMPMCNT Position */ -#define EADC_CMP0_CMPMCNT_Msk (0xful << EADC_CMP0_CMPMCNT_Pos) /*!< EADC_T::CMP0: CMPMCNT Mask */ - -#define EADC_CMP0_CMPWEN_Pos (15) /*!< EADC_T::CMP0: CMPWEN Position */ -#define EADC_CMP0_CMPWEN_Msk (0x1ul << EADC_CMP0_CMPWEN_Pos) /*!< EADC_T::CMP0: CMPWEN Mask */ - -#define EADC_CMP0_CMPDAT_Pos (16) /*!< EADC_T::CMP0: CMPDAT Position */ -#define EADC_CMP0_CMPDAT_Msk (0xffful << EADC_CMP0_CMPDAT_Pos) /*!< EADC_T::CMP0: CMPDAT Mask */ - -#define EADC_CMP1_ADCMPEN_Pos (0) /*!< EADC_T::CMP1: ADCMPEN Position */ -#define EADC_CMP1_ADCMPEN_Msk (0x1ul << EADC_CMP1_ADCMPEN_Pos) /*!< EADC_T::CMP1: ADCMPEN Mask */ - -#define EADC_CMP1_ADCMPIE_Pos (1) /*!< EADC_T::CMP1: ADCMPIE Position */ -#define EADC_CMP1_ADCMPIE_Msk (0x1ul << EADC_CMP1_ADCMPIE_Pos) /*!< EADC_T::CMP1: ADCMPIE Mask */ - -#define EADC_CMP1_CMPCOND_Pos (2) /*!< EADC_T::CMP1: CMPCOND Position */ -#define EADC_CMP1_CMPCOND_Msk (0x1ul << EADC_CMP1_CMPCOND_Pos) /*!< EADC_T::CMP1: CMPCOND Mask */ - -#define EADC_CMP1_CMPSPL_Pos (3) /*!< EADC_T::CMP1: CMPSPL Position */ -#define EADC_CMP1_CMPSPL_Msk (0x1ful << EADC_CMP1_CMPSPL_Pos) /*!< EADC_T::CMP1: CMPSPL Mask */ - -#define EADC_CMP1_CMPMCNT_Pos (8) /*!< EADC_T::CMP1: CMPMCNT Position */ -#define EADC_CMP1_CMPMCNT_Msk (0xful << EADC_CMP1_CMPMCNT_Pos) /*!< EADC_T::CMP1: CMPMCNT Mask */ - -#define EADC_CMP1_CMPWEN_Pos (15) /*!< EADC_T::CMP1: CMPWEN Position */ -#define EADC_CMP1_CMPWEN_Msk (0x1ul << EADC_CMP1_CMPWEN_Pos) /*!< EADC_T::CMP1: CMPWEN Mask */ - -#define EADC_CMP1_CMPDAT_Pos (16) /*!< EADC_T::CMP1: CMPDAT Position */ -#define EADC_CMP1_CMPDAT_Msk (0xffful << EADC_CMP1_CMPDAT_Pos) /*!< EADC_T::CMP1: CMPDAT Mask */ - -#define EADC_CMP2_ADCMPEN_Pos (0) /*!< EADC_T::CMP2: ADCMPEN Position */ -#define EADC_CMP2_ADCMPEN_Msk (0x1ul << EADC_CMP2_ADCMPEN_Pos) /*!< EADC_T::CMP2: ADCMPEN Mask */ - -#define EADC_CMP2_ADCMPIE_Pos (1) /*!< EADC_T::CMP2: ADCMPIE Position */ -#define EADC_CMP2_ADCMPIE_Msk (0x1ul << EADC_CMP2_ADCMPIE_Pos) /*!< EADC_T::CMP2: ADCMPIE Mask */ - -#define EADC_CMP2_CMPCOND_Pos (2) /*!< EADC_T::CMP2: CMPCOND Position */ -#define EADC_CMP2_CMPCOND_Msk (0x1ul << EADC_CMP2_CMPCOND_Pos) /*!< EADC_T::CMP2: CMPCOND Mask */ - -#define EADC_CMP2_CMPSPL_Pos (3) /*!< EADC_T::CMP2: CMPSPL Position */ -#define EADC_CMP2_CMPSPL_Msk (0x1ful << EADC_CMP2_CMPSPL_Pos) /*!< EADC_T::CMP2: CMPSPL Mask */ - -#define EADC_CMP2_CMPMCNT_Pos (8) /*!< EADC_T::CMP2: CMPMCNT Position */ -#define EADC_CMP2_CMPMCNT_Msk (0xful << EADC_CMP2_CMPMCNT_Pos) /*!< EADC_T::CMP2: CMPMCNT Mask */ - -#define EADC_CMP2_CMPWEN_Pos (15) /*!< EADC_T::CMP2: CMPWEN Position */ -#define EADC_CMP2_CMPWEN_Msk (0x1ul << EADC_CMP2_CMPWEN_Pos) /*!< EADC_T::CMP2: CMPWEN Mask */ - -#define EADC_CMP2_CMPDAT_Pos (16) /*!< EADC_T::CMP2: CMPDAT Position */ -#define EADC_CMP2_CMPDAT_Msk (0xffful << EADC_CMP2_CMPDAT_Pos) /*!< EADC_T::CMP2: CMPDAT Mask */ - -#define EADC_CMP3_ADCMPEN_Pos (0) /*!< EADC_T::CMP3: ADCMPEN Position */ -#define EADC_CMP3_ADCMPEN_Msk (0x1ul << EADC_CMP3_ADCMPEN_Pos) /*!< EADC_T::CMP3: ADCMPEN Mask */ - -#define EADC_CMP3_ADCMPIE_Pos (1) /*!< EADC_T::CMP3: ADCMPIE Position */ -#define EADC_CMP3_ADCMPIE_Msk (0x1ul << EADC_CMP3_ADCMPIE_Pos) /*!< EADC_T::CMP3: ADCMPIE Mask */ - -#define EADC_CMP3_CMPCOND_Pos (2) /*!< EADC_T::CMP3: CMPCOND Position */ -#define EADC_CMP3_CMPCOND_Msk (0x1ul << EADC_CMP3_CMPCOND_Pos) /*!< EADC_T::CMP3: CMPCOND Mask */ - -#define EADC_CMP3_CMPSPL_Pos (3) /*!< EADC_T::CMP3: CMPSPL Position */ -#define EADC_CMP3_CMPSPL_Msk (0x1ful << EADC_CMP3_CMPSPL_Pos) /*!< EADC_T::CMP3: CMPSPL Mask */ - -#define EADC_CMP3_CMPMCNT_Pos (8) /*!< EADC_T::CMP3: CMPMCNT Position */ -#define EADC_CMP3_CMPMCNT_Msk (0xful << EADC_CMP3_CMPMCNT_Pos) /*!< EADC_T::CMP3: CMPMCNT Mask */ - -#define EADC_CMP3_CMPWEN_Pos (15) /*!< EADC_T::CMP3: CMPWEN Position */ -#define EADC_CMP3_CMPWEN_Msk (0x1ul << EADC_CMP3_CMPWEN_Pos) /*!< EADC_T::CMP3: CMPWEN Mask */ - -#define EADC_CMP3_CMPDAT_Pos (16) /*!< EADC_T::CMP3: CMPDAT Position */ -#define EADC_CMP3_CMPDAT_Msk (0xffful << EADC_CMP3_CMPDAT_Pos) /*!< EADC_T::CMP3: CMPDAT Mask */ - -#define EADC_STATUS0_VALID_Pos (0) /*!< EADC_T::STATUS0: VALID Position */ -#define EADC_STATUS0_VALID_Msk (0xfffful << EADC_STATUS0_VALID_Pos) /*!< EADC_T::STATUS0: VALID Mask */ - -#define EADC_STATUS0_OV_Pos (16) /*!< EADC_T::STATUS0: OV Position */ -#define EADC_STATUS0_OV_Msk (0xfffful << EADC_STATUS0_OV_Pos) /*!< EADC_T::STATUS0: OV Mask */ - -#define EADC_STATUS1_VALID_Pos (0) /*!< EADC_T::STATUS1: VALID Position */ -#define EADC_STATUS1_VALID_Msk (0x7ul << EADC_STATUS1_VALID_Pos) /*!< EADC_T::STATUS1: VALID Mask */ - -#define EADC_STATUS1_OV_Pos (16) /*!< EADC_T::STATUS1: OV Position */ -#define EADC_STATUS1_OV_Msk (0x7ul << EADC_STATUS1_OV_Pos) /*!< EADC_T::STATUS1: OV Mask */ - -#define EADC_STATUS2_ADIF0_Pos (0) /*!< EADC_T::STATUS2: ADIF0 Position */ -#define EADC_STATUS2_ADIF0_Msk (0x1ul << EADC_STATUS2_ADIF0_Pos) /*!< EADC_T::STATUS2: ADIF0 Mask */ - -#define EADC_STATUS2_ADIF1_Pos (1) /*!< EADC_T::STATUS2: ADIF1 Position */ -#define EADC_STATUS2_ADIF1_Msk (0x1ul << EADC_STATUS2_ADIF1_Pos) /*!< EADC_T::STATUS2: ADIF1 Mask */ - -#define EADC_STATUS2_ADIF2_Pos (2) /*!< EADC_T::STATUS2: ADIF2 Position */ -#define EADC_STATUS2_ADIF2_Msk (0x1ul << EADC_STATUS2_ADIF2_Pos) /*!< EADC_T::STATUS2: ADIF2 Mask */ - -#define EADC_STATUS2_ADIF3_Pos (3) /*!< EADC_T::STATUS2: ADIF3 Position */ -#define EADC_STATUS2_ADIF3_Msk (0x1ul << EADC_STATUS2_ADIF3_Pos) /*!< EADC_T::STATUS2: ADIF3 Mask */ - -#define EADC_STATUS2_ADCMPF0_Pos (4) /*!< EADC_T::STATUS2: ADCMPF0 Position */ -#define EADC_STATUS2_ADCMPF0_Msk (0x1ul << EADC_STATUS2_ADCMPF0_Pos) /*!< EADC_T::STATUS2: ADCMPF0 Mask */ - -#define EADC_STATUS2_ADCMPF1_Pos (5) /*!< EADC_T::STATUS2: ADCMPF1 Position */ -#define EADC_STATUS2_ADCMPF1_Msk (0x1ul << EADC_STATUS2_ADCMPF1_Pos) /*!< EADC_T::STATUS2: ADCMPF1 Mask */ - -#define EADC_STATUS2_ADCMPF2_Pos (6) /*!< EADC_T::STATUS2: ADCMPF2 Position */ -#define EADC_STATUS2_ADCMPF2_Msk (0x1ul << EADC_STATUS2_ADCMPF2_Pos) /*!< EADC_T::STATUS2: ADCMPF2 Mask */ - -#define EADC_STATUS2_ADCMPF3_Pos (7) /*!< EADC_T::STATUS2: ADCMPF3 Position */ -#define EADC_STATUS2_ADCMPF3_Msk (0x1ul << EADC_STATUS2_ADCMPF3_Pos) /*!< EADC_T::STATUS2: ADCMPF3 Mask */ - -#define EADC_STATUS2_ADOVIF0_Pos (8) /*!< EADC_T::STATUS2: ADOVIF0 Position */ -#define EADC_STATUS2_ADOVIF0_Msk (0x1ul << EADC_STATUS2_ADOVIF0_Pos) /*!< EADC_T::STATUS2: ADOVIF0 Mask */ - -#define EADC_STATUS2_ADOVIF1_Pos (9) /*!< EADC_T::STATUS2: ADOVIF1 Position */ -#define EADC_STATUS2_ADOVIF1_Msk (0x1ul << EADC_STATUS2_ADOVIF1_Pos) /*!< EADC_T::STATUS2: ADOVIF1 Mask */ - -#define EADC_STATUS2_ADOVIF2_Pos (10) /*!< EADC_T::STATUS2: ADOVIF2 Position */ -#define EADC_STATUS2_ADOVIF2_Msk (0x1ul << EADC_STATUS2_ADOVIF2_Pos) /*!< EADC_T::STATUS2: ADOVIF2 Mask */ - -#define EADC_STATUS2_ADOVIF3_Pos (11) /*!< EADC_T::STATUS2: ADOVIF3 Position */ -#define EADC_STATUS2_ADOVIF3_Msk (0x1ul << EADC_STATUS2_ADOVIF3_Pos) /*!< EADC_T::STATUS2: ADOVIF3 Mask */ - -#define EADC_STATUS2_ADCMPO0_Pos (12) /*!< EADC_T::STATUS2: ADCMPO0 Position */ -#define EADC_STATUS2_ADCMPO0_Msk (0x1ul << EADC_STATUS2_ADCMPO0_Pos) /*!< EADC_T::STATUS2: ADCMPO0 Mask */ - -#define EADC_STATUS2_ADCMPO1_Pos (13) /*!< EADC_T::STATUS2: ADCMPO1 Position */ -#define EADC_STATUS2_ADCMPO1_Msk (0x1ul << EADC_STATUS2_ADCMPO1_Pos) /*!< EADC_T::STATUS2: ADCMPO1 Mask */ - -#define EADC_STATUS2_ADCMPO2_Pos (14) /*!< EADC_T::STATUS2: ADCMPO2 Position */ -#define EADC_STATUS2_ADCMPO2_Msk (0x1ul << EADC_STATUS2_ADCMPO2_Pos) /*!< EADC_T::STATUS2: ADCMPO2 Mask */ - -#define EADC_STATUS2_ADCMPO3_Pos (15) /*!< EADC_T::STATUS2: ADCMPO3 Position */ -#define EADC_STATUS2_ADCMPO3_Msk (0x1ul << EADC_STATUS2_ADCMPO3_Pos) /*!< EADC_T::STATUS2: ADCMPO3 Mask */ - -#define EADC_STATUS2_CHANNEL_Pos (16) /*!< EADC_T::STATUS2: CHANNEL Position */ -#define EADC_STATUS2_CHANNEL_Msk (0x1ful << EADC_STATUS2_CHANNEL_Pos) /*!< EADC_T::STATUS2: CHANNEL Mask */ - -#define EADC_STATUS2_BUSY_Pos (23) /*!< EADC_T::STATUS2: BUSY Position */ -#define EADC_STATUS2_BUSY_Msk (0x1ul << EADC_STATUS2_BUSY_Pos) /*!< EADC_T::STATUS2: BUSY Mask */ - -#define EADC_STATUS2_ADOVIF_Pos (24) /*!< EADC_T::STATUS2: ADOVIF Position */ -#define EADC_STATUS2_ADOVIF_Msk (0x1ul << EADC_STATUS2_ADOVIF_Pos) /*!< EADC_T::STATUS2: ADOVIF Mask */ - -#define EADC_STATUS2_STOVF_Pos (25) /*!< EADC_T::STATUS2: STOVF Position */ -#define EADC_STATUS2_STOVF_Msk (0x1ul << EADC_STATUS2_STOVF_Pos) /*!< EADC_T::STATUS2: STOVF Mask */ - -#define EADC_STATUS2_AVALID_Pos (26) /*!< EADC_T::STATUS2: AVALID Position */ -#define EADC_STATUS2_AVALID_Msk (0x1ul << EADC_STATUS2_AVALID_Pos) /*!< EADC_T::STATUS2: AVALID Mask */ - -#define EADC_STATUS2_AOV_Pos (27) /*!< EADC_T::STATUS2: AOV Position */ -#define EADC_STATUS2_AOV_Msk (0x1ul << EADC_STATUS2_AOV_Pos) /*!< EADC_T::STATUS2: AOV Mask */ - -#define EADC_STATUS3_CURSPL_Pos (0) /*!< EADC_T::STATUS3: CURSPL Position */ -#define EADC_STATUS3_CURSPL_Msk (0x1ful << EADC_STATUS3_CURSPL_Pos) /*!< EADC_T::STATUS3: CURSPL Mask */ - -#define EADC_DDAT0_RESULT_Pos (0) /*!< EADC_T::DDAT0: RESULT Position */ -#define EADC_DDAT0_RESULT_Msk (0xfffful << EADC_DDAT0_RESULT_Pos) /*!< EADC_T::DDAT0: RESULT Mask */ - -#define EADC_DDAT0_OV_Pos (16) /*!< EADC_T::DDAT0: OV Position */ -#define EADC_DDAT0_OV_Msk (0x1ul << EADC_DDAT0_OV_Pos) /*!< EADC_T::DDAT0: OV Mask */ - -#define EADC_DDAT0_VALID_Pos (17) /*!< EADC_T::DDAT0: VALID Position */ -#define EADC_DDAT0_VALID_Msk (0x1ul << EADC_DDAT0_VALID_Pos) /*!< EADC_T::DDAT0: VALID Mask */ - -#define EADC_DDAT1_RESULT_Pos (0) /*!< EADC_T::DDAT1: RESULT Position */ -#define EADC_DDAT1_RESULT_Msk (0xfffful << EADC_DDAT1_RESULT_Pos) /*!< EADC_T::DDAT1: RESULT Mask */ - -#define EADC_DDAT1_OV_Pos (16) /*!< EADC_T::DDAT1: OV Position */ -#define EADC_DDAT1_OV_Msk (0x1ul << EADC_DDAT1_OV_Pos) /*!< EADC_T::DDAT1: OV Mask */ - -#define EADC_DDAT1_VALID_Pos (17) /*!< EADC_T::DDAT1: VALID Position */ -#define EADC_DDAT1_VALID_Msk (0x1ul << EADC_DDAT1_VALID_Pos) /*!< EADC_T::DDAT1: VALID Mask */ - -#define EADC_DDAT2_RESULT_Pos (0) /*!< EADC_T::DDAT2: RESULT Position */ -#define EADC_DDAT2_RESULT_Msk (0xfffful << EADC_DDAT2_RESULT_Pos) /*!< EADC_T::DDAT2: RESULT Mask */ - -#define EADC_DDAT2_OV_Pos (16) /*!< EADC_T::DDAT2: OV Position */ -#define EADC_DDAT2_OV_Msk (0x1ul << EADC_DDAT2_OV_Pos) /*!< EADC_T::DDAT2: OV Mask */ - -#define EADC_DDAT2_VALID_Pos (17) /*!< EADC_T::DDAT2: VALID Position */ -#define EADC_DDAT2_VALID_Msk (0x1ul << EADC_DDAT2_VALID_Pos) /*!< EADC_T::DDAT2: VALID Mask */ - -#define EADC_DDAT3_RESULT_Pos (0) /*!< EADC_T::DDAT3: RESULT Position */ -#define EADC_DDAT3_RESULT_Msk (0xfffful << EADC_DDAT3_RESULT_Pos) /*!< EADC_T::DDAT3: RESULT Mask */ - -#define EADC_DDAT3_OV_Pos (16) /*!< EADC_T::DDAT3: OV Position */ -#define EADC_DDAT3_OV_Msk (0x1ul << EADC_DDAT3_OV_Pos) /*!< EADC_T::DDAT3: OV Mask */ - -#define EADC_DDAT3_VALID_Pos (17) /*!< EADC_T::DDAT3: VALID Position */ -#define EADC_DDAT3_VALID_Msk (0x1ul << EADC_DDAT3_VALID_Pos) /*!< EADC_T::DDAT3: VALID Mask */ - -#define EADC_PWRM_PWUPRDY_Pos (0) /*!< EADC_T::PWRM: PWUPRDY Position */ -#define EADC_PWRM_PWUPRDY_Msk (0x1ul << EADC_PWRM_PWUPRDY_Pos) /*!< EADC_T::PWRM: PWUPRDY Mask */ - -#define EADC_PWRM_PWUCALEN_Pos (1) /*!< EADC_T::PWRM: PWUCALEN Position */ -#define EADC_PWRM_PWUCALEN_Msk (0x1ul << EADC_PWRM_PWUCALEN_Pos) /*!< EADC_T::PWRM: PWUCALEN Mask */ - -#define EADC_PWRM_PWDMOD_Pos (2) /*!< EADC_T::PWRM: PWDMOD Position */ -#define EADC_PWRM_PWDMOD_Msk (0x3ul << EADC_PWRM_PWDMOD_Pos) /*!< EADC_T::PWRM: PWDMOD Mask */ - -#define EADC_PWRM_LDOSUT_Pos (8) /*!< EADC_T::PWRM: LDOSUT Position */ -#define EADC_PWRM_LDOSUT_Msk (0xffful << EADC_PWRM_LDOSUT_Pos) /*!< EADC_T::PWRM: LDOSUT Mask */ - -#define EADC_CALCTL_CALSTART_Pos (1) /*!< EADC_T::CALCTL: CALSTART Position */ -#define EADC_CALCTL_CALSTART_Msk (0x1ul << EADC_CALCTL_CALSTART_Pos) /*!< EADC_T::CALCTL: CALSTART Mask */ - -#define EADC_CALCTL_CALDONE_Pos (2) /*!< EADC_T::CALCTL: CALDONE Position */ -#define EADC_CALCTL_CALDONE_Msk (0x1ul << EADC_CALCTL_CALDONE_Pos) /*!< EADC_T::CALCTL: CALDONE Mask */ - -#define EADC_CALCTL_CALSEL_Pos (3) /*!< EADC_T::CALCTL: CALSEL Position */ -#define EADC_CALCTL_CALSEL_Msk (0x1ul << EADC_CALCTL_CALSEL_Pos) /*!< EADC_T::CALCTL: CALSEL Mask */ - -#define EADC_CALDWRD_CALWORD_Pos (0) /*!< EADC_T::CALDWRD: CALWORD Position */ -#define EADC_CALDWRD_CALWORD_Msk (0x7ful << EADC_CALDWRD_CALWORD_Pos) /*!< EADC_T::CALDWRD: CALWORD Mask */ - -#define EADC_PDMACTL_PDMATEN_Pos (0) /*!< EADC_T::PDMACTL: PDMATEN Position */ -#define EADC_PDMACTL_PDMATEN_Msk (0x7fffful << EADC_PDMACTL_PDMATEN_Pos) /*!< EADC_T::PDMACTL: PDMATEN Mask */ - - -/**@}*/ /* EADC_CONST */ -/**@}*/ /* end of EADC register group */ -/**@}*/ /* end of REGISTER group */ - - - -#endif /* __EADC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ebi_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ebi_reg.h deleted file mode 100644 index f884d34c076..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ebi_reg.h +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************//** - * @file ebi_reg.h - * @version V1.00 - * @brief EBI register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EBI_REG_H__ -#define __EBI_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- External Bus Interface Controller -------------------------*/ -/** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var EBI_T::CTL0 - * Offset: 0x00 External Bus Interface Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separating Mode Enable Bit - * | | |0 = Address/Data Bus Separating Mode Disabled. - * | | |1 = Address/Data Bus Separating Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When continuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register - * @var EBI_T::TCTL0 - * Offset: 0x04 External Bus Interface Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC define data access time (tACC). - * | | |tACC = (TACC+1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD define data access hold time (tAHD). - * | | |tAHD = (TAHD+1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - */ - __IO uint32_t CTL0; /*!< [0x0000] External Bus Interface Bank0 Control Register */ - __IO uint32_t TCTL0; /*!< [0x0004] External Bus Interface Bank0 Timing Control Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CTL1; /*!< [0x0010] External Bus Interface Bank1 Control Register */ - __IO uint32_t TCTL1; /*!< [0x0014] External Bus Interface Bank1 Timing Control Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t CTL2; /*!< [0x0020] External Bus Interface Bank2 Control Register */ - __IO uint32_t TCTL2; /*!< [0x0024] External Bus Interface Bank2 Timing Control Register */ - -} EBI_T; - -/** - @addtogroup EBI_CONST EBI Bit Field Definition - Constant Definitions for EBI Controller - @{ -*/ - -#define EBI_CTL_EN_Pos (0) /*!< EBI_T::CTL0: EN Position */ -#define EBI_CTL_EN_Msk (0x1ul << EBI_CTL_EN_Pos) /*!< EBI_T::CTL0: EN Mask */ - -#define EBI_CTL_DW16_Pos (1) /*!< EBI_T::CTL0: DW16 Position */ -#define EBI_CTL_DW16_Msk (0x1ul << EBI_CTL_DW16_Pos) /*!< EBI_T::CTL0: DW16 Mask */ - -#define EBI_CTL_CSPOLINV_Pos (2) /*!< EBI_T::CTL0: CSPOLINV Position */ -#define EBI_CTL_CSPOLINV_Msk (0x1ul << EBI_CTL_CSPOLINV_Pos) /*!< EBI_T::CTL0: CSPOLINV Mask */ - -#define EBI_CTL_ADSEPEN_Pos (3) /*!< EBI_T::CTL0: ADSEPEN Position */ -#define EBI_CTL_ADSEPEN_Msk (0x1ul << EBI_CTL_ADSEPEN_Pos) /*!< EBI_T::CTL0: ADSEPEN Mask */ - -#define EBI_CTL_CACCESS_Pos (4) /*!< EBI_T::CTL0: CACCESS Position */ -#define EBI_CTL_CACCESS_Msk (0x1ul << EBI_CTL_CACCESS_Pos) /*!< EBI_T::CTL0: CACCESS Mask */ - -#define EBI_CTL_MCLKDIV_Pos (8) /*!< EBI_T::CTL0: MCLKDIV Position */ -#define EBI_CTL_MCLKDIV_Msk (0x7ul << EBI_CTL_MCLKDIV_Pos) /*!< EBI_T::CTL0: MCLKDIV Mask */ - -#define EBI_CTL_TALE_Pos (16) /*!< EBI_T::CTL0: TALE Position */ -#define EBI_CTL_TALE_Msk (0x7ul << EBI_CTL_TALE_Pos) /*!< EBI_T::CTL0: TALE Mask */ - -#define EBI_CTL_WBUFEN_Pos (24) /*!< EBI_T::CTL0: WBUFEN Position */ -#define EBI_CTL_WBUFEN_Msk (0x1ul << EBI_CTL_WBUFEN_Pos) /*!< EBI_T::CTL0: WBUFEN Mask */ - -#define EBI_TCTL_TACC_Pos (3) /*!< EBI_T::TCTL0: TACC Position */ -#define EBI_TCTL_TACC_Msk (0x1ful << EBI_TCTL_TACC_Pos) /*!< EBI_T::TCTL0: TACC Mask */ - -#define EBI_TCTL_TAHD_Pos (8) /*!< EBI_T::TCTL0: TAHD Position */ -#define EBI_TCTL_TAHD_Msk (0x7ul << EBI_TCTL_TAHD_Pos) /*!< EBI_T::TCTL0: TAHD Mask */ - -#define EBI_TCTL_W2X_Pos (12) /*!< EBI_T::TCTL0: W2X Position */ -#define EBI_TCTL_W2X_Msk (0xful << EBI_TCTL_W2X_Pos) /*!< EBI_T::TCTL0: W2X Mask */ - -#define EBI_TCTL_RAHDOFF_Pos (22) /*!< EBI_T::TCTL0: RAHDOFF Position */ -#define EBI_TCTL_RAHDOFF_Msk (0x1ul << EBI_TCTL_RAHDOFF_Pos) /*!< EBI_T::TCTL0: RAHDOFF Mask */ - -#define EBI_TCTL_WAHDOFF_Pos (23) /*!< EBI_T::TCTL0: WAHDOFF Position */ -#define EBI_TCTL_WAHDOFF_Msk (0x1ul << EBI_TCTL_WAHDOFF_Pos) /*!< EBI_T::TCTL0: WAHDOFF Mask */ - -#define EBI_TCTL_R2R_Pos (24) /*!< EBI_T::TCTL0: R2R Position */ -#define EBI_TCTL_R2R_Msk (0xful << EBI_TCTL_R2R_Pos) /*!< EBI_T::TCTL0: R2R Mask */ - -/**@}*/ /* EBI_CONST */ -/**@}*/ /* end of EBI register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __EBI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ecap_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ecap_reg.h deleted file mode 100644 index 8710ce59f0a..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ecap_reg.h +++ /dev/null @@ -1,388 +0,0 @@ -/**************************************************************************//** - * @file ecap_reg.h - * @version V1.00 - * @brief ECAP register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ECAP_REG_H__ -#define __ECAP_REG_H__ - -/** - @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Enhanced Input Capture Timer -------------------------*/ -/** - @addtogroup ECAP Enhanced Input Capture Timer(ECAP) - Memory Mapped Structure for ECAP Controller - @{ -*/ - -typedef struct -{ - - /** - * @var ECAP_T::CNT - * Offset: 0x00 Input Capture Counter (24-bit up counter) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Input Capture Timer/Counter - * | | |The input Capture Timer/Counter is a 24-bit up-counting counter - * | | |The clock source for the counter is from the clock divider - * @var ECAP_T::HLD0 - * Offset: 0x04 Input Capture Hold Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD1 - * Offset: 0x08 Input Capture Hold Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD2 - * Offset: 0x0C Input Capture Hold Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::CNTCMP - * Offset: 0x10 Input Capture Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNTCMP |Input Capture Counter Compare Register - * | | |If the compare function is enabled (CMPEN = 1), this register (ECAP_CNTCMP) is used to compare with the capture counter (ECAP_CNT). - * | | |If the reload control is enabled (RLDEN[n] = 1, n=0~3), an overflow event or capture events will trigger the hardware to load the value of this register (ECAP_CNTCMP) into ECAP_CNT. - * @var ECAP_T::CTL0 - * Offset: 0x14 Input Capture Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection - * | | |To determine the sampling frequency of the Noise Filter clock - * | | |000 = CAP_CLK. - * | | |001 = CAP_CLK/2. - * | | |010 = CAP_CLK/4. - * | | |011 = CAP_CLK/16. - * | | |100 = CAP_CLK/32. - * | | |101 = CAP_CLK/64. - * |[3] |CAPNFDIS |Input Capture Noise Filter Disable Control - * | | |0 = Noise filter of Input Capture Enabled. - * | | |1 = Noise filter of Input Capture Disabled (Bypass). - * |[4] |IC0EN |Port Pin IC0 Input to Input Capture Unit Enable Control - * | | |0 = IC0 input to Input Capture Unit Disabled. - * | | |1 = IC0 input to Input Capture Unit Enabled. - * |[5] |IC1EN |Port Pin IC1 Input to Input Capture Unit Enable Control - * | | |0 = IC1 input to Input Capture Unit Disabled. - * | | |1 = IC1 input to Input Capture Unit Enabled. - * |[6] |IC2EN |Port Pin IC2 Input to Input Capture Unit Enable Control - * | | |0 = IC2 input to Input Capture Unit Disabled. - * | | |1 = IC2 input to Input Capture Unit Enabled. - * |[9:8] |CAPSEL0 |CAP0 Input Source Selection - * | | |00 = CAP0 input is from port pin ICAP0. - * | | |01 = Reserved. - * | | |10 = CAP0 input is from signal CHA of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[11:10] |CAPSEL1 |CAP1 Input Source Selection - * | | |00 = CAP1 input is from port pin ICAP1. - * | | |01 = Reserved. - * | | |10 = CAP1 input is from signal CHB of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[13:12] |CAPSEL2 |CAP2 Input Source Selection - * | | |00 = CAP2 input is from port pin ICAP2. - * | | |01 = Reserved. - * | | |10 = CAP2 input is from signal CHX of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[16] |CAPIEN0 |Input Capture Channel 0 Interrupt Enable Control - * | | |0 = The flag CAPTF0 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF0 can trigger Input Capture interrupt Enabled. - * |[17] |CAPIEN1 |Input Capture Channel 1 Interrupt Enable Control - * | | |0 = The flag CAPTF1 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF1 can trigger Input Capture interrupt Enabled. - * |[18] |CAPIEN2 |Input Capture Channel 2 Interrupt Enable Control - * | | |0 = The flag CAPTF2 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF2 can trigger Input Capture interrupt Enabled. - * |[20] |OVIEN |CAPOVF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPOVF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPOVF can trigger Input Capture interrupt Enabled. - * |[21] |CMPIEN |CAPCMPF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPCMPF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPCMPF can trigger Input Capture interrupt Enabled. - * |[24] |CNTEN |Input Capture Counter Start Counting Control - * | | |Setting this bit to 1, the capture counter (ECAP_CNT) starts up-counting synchronously with the clock from the . - * | | |0 = ECAP_CNT stop counting. - * | | |1 = ECAP_CNT starts up-counting. - * |[25] |CMPCLREN |Input Capture Counter Cleared by Compare-match Control - * | | |If this bit is set to 1, the capture counter (ECAP_CNT) will be cleared to 0 when the compare-match event (CAPCMPF = 1) occurs. - * | | |0 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Enabled. - * |[28] |CMPEN |Compare Function Enable Control - * | | |The compare function in input capture timer/counter is to compare the dynamic counting ECAP_CNT with the compare register ECAP_CNTCMP, if ECAP_CNT value reaches ECAP_CNTCMP, the flag CAPCMPF will be set. - * | | |0 = The compare function Disabled. - * | | |1 = The compare function Enabled. - * |[29] |CAPEN |Input Capture Timer/Counter Enable Control - * | | |0 = Input Capture function Disabled. - * | | |1 = Input Capture function Enabled. - * @var ECAP_T::CTL1 - * Offset: 0x18 Input Capture Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |EDGESEL0 |Channel 0 Captured Edge Selection - * | | |Input capture0 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[3:2] |EDGESEL1 |Channel 1 Captured Edge Selection - * | | |Input capture1 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[5:4] |EDGESEL2 |Channel 2 Captured Edge Selection - * | | |Input capture2 can detect falling edge change only, rising edge change only or both edge changes - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[8] |CAP0RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE0 Enable Bit - * | | |0 = The reload triggered by Event CAPTE0 Disabled. - * | | |1 = The reload triggered by Event CAPTE0 Enabled. - * |[9] |CAP1RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE1 Enable Bit - * | | |0 = The reload triggered by Event CAPTE1 Disabled. - * | | |1 = The reload triggered by Event CAPTE1 Enabled. - * |[10] |CAP2RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE2 Enable Bit - * | | |0 = The reload triggered by Event CAPTE2 Disabled. - * | | |1 = The reload triggered by Event CAPTE2 Enabled. - * |[11] |OVRLDEN |Capture Counteru2019s Reload Function Triggered by Overflow Enable Bit - * | | |0 = The reload triggered by CAPOV Disabled. - * | | |1 = The reload triggered by CAPOV Enabled. - * |[14:12] |CLKSEL |Capture Timer Clock Divide Selection - * | | |The capture timer clock has a pre-divider with eight divided options controlled by CLKSEL[2:0]. - * | | |000 = CAP_CLK/1. - * | | |001 = CAP_CLK/4. - * | | |010 = CAP_CLK/16. - * | | |011 = CAP_CLK/32. - * | | |100 = CAP_CLK/64. - * | | |101 = CAP_CLK/96. - * | | |110 = CAP_CLK/112. - * | | |111 = CAP_CLK/128. - * |[17:16] |CNTSRCSEL |Capture Timer/Counter Clock Source Selection - * | | |Select the capture timer/counter clock source. - * | | |00 = CAP_CLK (default). - * | | |01 = CAP0. - * | | |10 = CAP1. - * | | |11 = CAP2. - * |[20] |CAP0CLREN |Capture Counter Cleared by Capture Event0 Control - * | | |0 = Event CAPTE0 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE0 can clear capture counter (ECAP_CNT) Enabled. - * |[21] |CAP1CLREN |Capture Counter Cleared by Capture Event1 Control - * | | |0 = Event CAPTE1 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE1 can clear capture counter (ECAP_CNT) Enabled. - * |[22] |CAP2CLREN |Capture Counter Cleared by Capture Event2 Control - * | | |0 = Event CAPTE2 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE2 can clear capture counter (ECAP_CNT) Enabled. - * @var ECAP_T::STATUS - * Offset: 0x1C Input Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPTF0 |Input Capture Channel 0 Triggered Flag - * | | |When the input capture channel 0 detects a valid edge change at CAP0 input, it will set flag CAPTF0 to high. - * | | |0 = No valid edge change has been detected at CAP0 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP0 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[1] |CAPTF1 |Input Capture Channel 1 Triggered Flag - * | | |When the input capture channel 1 detects a valid edge change at CAP1 input, it will set flag CAPTF1 to high. - * | | |0 = No valid edge change has been detected at CAP1 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP1 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[2] |CAPTF2 |Input Capture Channel 2 Triggered Flag - * | | |When the input capture channel 2 detects a valid edge change at CAP2 input, it will set flag CAPTF2 to high. - * | | |0 = No valid edge change has been detected at CAP2 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP2 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[4] |CAPCMPF |Input Capture Compare-match Flag - * | | |If the input capture compare function is enabled, the flag is set by hardware when capture counter (ECAP_CNT) up counts and reaches the ECAP_CNTCMP value. - * | | |0 = ECAP_CNT has not matched ECAP_CNTCMP value since last clear. - * | | |1 = ECAP_CNT has matched ECAP_CNTCMP value at least once since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[5] |CAPOVF |Input Capture Counter Overflow Flag - * | | |Flag is set by hardware when counter (ECAP_CNT) overflows from 0x00FF_FFFF to zero. - * | | |0 = No overflow event has occurred since last clear. - * | | |1 = Overflow event(s) has/have occurred since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[6] |CAP0 |Value of Input Channel 0, CAP0 (Read Only) - * | | |Reflecting the value of input channel 0, CAP0 - * | | |(The bit is read only and write is ignored) - * |[7] |CAP1 |Value of Input Channel 1, CAP1 (Read Only) - * | | |Reflecting the value of input channel 1, CAP1 - * | | |(The bit is read only and write is ignored) - * |[8] |CAP2 |Value of Input Channel 2, CAP2 (Read Only) - * | | |Reflecting the value of input channel 2, CAP2. - * | | |(The bit is read only and write is ignored) - */ - __IO uint32_t CNT; /*!< [0x0000] Input Capture Counter */ - __IO uint32_t HLD0; /*!< [0x0004] Input Capture Hold Register 0 */ - __IO uint32_t HLD1; /*!< [0x0008] Input Capture Hold Register 1 */ - __IO uint32_t HLD2; /*!< [0x000c] Input Capture Hold Register 2 */ - __IO uint32_t CNTCMP; /*!< [0x0010] Input Capture Compare Register */ - __IO uint32_t CTL0; /*!< [0x0014] Input Capture Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0018] Input Capture Control Register 1 */ - __IO uint32_t STATUS; /*!< [0x001c] Input Capture Status Register */ - -} ECAP_T; - -/** - @addtogroup ECAP_CONST ECAP Bit Field Definition - Constant Definitions for ECAP Controller - @{ -*/ - -#define ECAP_CNT_CNT_Pos (0) /*!< ECAP_T::CNT: CNT Position */ -#define ECAP_CNT_CNT_Msk (0xfffffful << ECAP_CNT_CNT_Pos) /*!< ECAP_T::CNT: CNT Mask */ - -#define ECAP_HLD0_HOLD_Pos (0) /*!< ECAP_T::HLD0: HOLD Position */ -#define ECAP_HLD0_HOLD_Msk (0xfffffful << ECAP_HLD0_HOLD_Pos) /*!< ECAP_T::HLD0: HOLD Mask */ - -#define ECAP_HLD1_HOLD_Pos (0) /*!< ECAP_T::HLD1: HOLD Position */ -#define ECAP_HLD1_HOLD_Msk (0xfffffful << ECAP_HLD1_HOLD_Pos) /*!< ECAP_T::HLD1: HOLD Mask */ - -#define ECAP_HLD2_HOLD_Pos (0) /*!< ECAP_T::HLD2: HOLD Position */ -#define ECAP_HLD2_HOLD_Msk (0xfffffful << ECAP_HLD2_HOLD_Pos) /*!< ECAP_T::HLD2: HOLD Mask */ - -#define ECAP_CNTCMP_CNTCMP_Pos (0) /*!< ECAP_T::CNTCMP: CNTCMP Position */ -#define ECAP_CNTCMP_CNTCMP_Msk (0xfffffful << ECAP_CNTCMP_CNTCMP_Pos) /*!< ECAP_T::CNTCMP: CNTCMP Mask */ - -#define ECAP_CTL0_NFCLKSEL_Pos (0) /*!< ECAP_T::CTL0: NFCLKSEL Position */ -#define ECAP_CTL0_NFCLKSEL_Msk (0x7ul << ECAP_CTL0_NFCLKSEL_Pos) /*!< ECAP_T::CTL0: NFCLKSEL Mask */ - -#define ECAP_CTL0_CAPNFDIS_Pos (3) /*!< ECAP_T::CTL0: CAPNFDIS Position */ -#define ECAP_CTL0_CAPNFDIS_Msk (0x1ul << ECAP_CTL0_CAPNFDIS_Pos) /*!< ECAP_T::CTL0: CAPNFDIS Mask */ - -#define ECAP_CTL0_IC0EN_Pos (4) /*!< ECAP_T::CTL0: IC0EN Position */ -#define ECAP_CTL0_IC0EN_Msk (0x1ul << ECAP_CTL0_IC0EN_Pos) /*!< ECAP_T::CTL0: IC0EN Mask */ - -#define ECAP_CTL0_IC1EN_Pos (5) /*!< ECAP_T::CTL0: IC1EN Position */ -#define ECAP_CTL0_IC1EN_Msk (0x1ul << ECAP_CTL0_IC1EN_Pos) /*!< ECAP_T::CTL0: IC1EN Mask */ - -#define ECAP_CTL0_IC2EN_Pos (6) /*!< ECAP_T::CTL0: IC2EN Position */ -#define ECAP_CTL0_IC2EN_Msk (0x1ul << ECAP_CTL0_IC2EN_Pos) /*!< ECAP_T::CTL0: IC2EN Mask */ - -#define ECAP_CTL0_CAPSEL0_Pos (8) /*!< ECAP_T::CTL0: CAPSEL0 Position */ -#define ECAP_CTL0_CAPSEL0_Msk (0x3ul << ECAP_CTL0_CAPSEL0_Pos) /*!< ECAP_T::CTL0: CAPSEL0 Mask */ - -#define ECAP_CTL0_CAPSEL1_Pos (10) /*!< ECAP_T::CTL0: CAPSEL1 Position */ -#define ECAP_CTL0_CAPSEL1_Msk (0x3ul << ECAP_CTL0_CAPSEL1_Pos) /*!< ECAP_T::CTL0: CAPSEL1 Mask */ - -#define ECAP_CTL0_CAPSEL2_Pos (12) /*!< ECAP_T::CTL0: CAPSEL2 Position */ -#define ECAP_CTL0_CAPSEL2_Msk (0x3ul << ECAP_CTL0_CAPSEL2_Pos) /*!< ECAP_T::CTL0: CAPSEL2 Mask */ - -#define ECAP_CTL0_CAPIEN0_Pos (16) /*!< ECAP_T::CTL0: CAPIEN0 Position */ -#define ECAP_CTL0_CAPIEN0_Msk (0x1ul << ECAP_CTL0_CAPIEN0_Pos) /*!< ECAP_T::CTL0: CAPIEN0 Mask */ - -#define ECAP_CTL0_CAPIEN1_Pos (17) /*!< ECAP_T::CTL0: CAPIEN1 Position */ -#define ECAP_CTL0_CAPIEN1_Msk (0x1ul << ECAP_CTL0_CAPIEN1_Pos) /*!< ECAP_T::CTL0: CAPIEN1 Mask */ - -#define ECAP_CTL0_CAPIEN2_Pos (18) /*!< ECAP_T::CTL0: CAPIEN2 Position */ -#define ECAP_CTL0_CAPIEN2_Msk (0x1ul << ECAP_CTL0_CAPIEN2_Pos) /*!< ECAP_T::CTL0: CAPIEN2 Mask */ - -#define ECAP_CTL0_OVIEN_Pos (20) /*!< ECAP_T::CTL0: OVIEN Position */ -#define ECAP_CTL0_OVIEN_Msk (0x1ul << ECAP_CTL0_OVIEN_Pos) /*!< ECAP_T::CTL0: OVIEN Mask */ - -#define ECAP_CTL0_CMPIEN_Pos (21) /*!< ECAP_T::CTL0: CMPIEN Position */ -#define ECAP_CTL0_CMPIEN_Msk (0x1ul << ECAP_CTL0_CMPIEN_Pos) /*!< ECAP_T::CTL0: CMPIEN Mask */ - -#define ECAP_CTL0_CNTEN_Pos (24) /*!< ECAP_T::CTL0: CNTEN Position */ -#define ECAP_CTL0_CNTEN_Msk (0x1ul << ECAP_CTL0_CNTEN_Pos) /*!< ECAP_T::CTL0: CNTEN Mask */ - -#define ECAP_CTL0_CMPCLREN_Pos (25) /*!< ECAP_T::CTL0: CMPCLREN Position */ -#define ECAP_CTL0_CMPCLREN_Msk (0x1ul << ECAP_CTL0_CMPCLREN_Pos) /*!< ECAP_T::CTL0: CMPCLREN Mask */ - -#define ECAP_CTL0_CMPEN_Pos (28) /*!< ECAP_T::CTL0: CMPEN Position */ -#define ECAP_CTL0_CMPEN_Msk (0x1ul << ECAP_CTL0_CMPEN_Pos) /*!< ECAP_T::CTL0: CMPEN Mask */ - -#define ECAP_CTL0_CAPEN_Pos (29) /*!< ECAP_T::CTL0: CAPEN Position */ -#define ECAP_CTL0_CAPEN_Msk (0x1ul << ECAP_CTL0_CAPEN_Pos) /*!< ECAP_T::CTL0: CAPEN Mask */ - -#define ECAP_CTL1_EDGESEL0_Pos (0) /*!< ECAP_T::CTL1: EDGESEL0 Position */ -#define ECAP_CTL1_EDGESEL0_Msk (0x3ul << ECAP_CTL1_EDGESEL0_Pos) /*!< ECAP_T::CTL1: EDGESEL0 Mask */ - -#define ECAP_CTL1_EDGESEL1_Pos (2) /*!< ECAP_T::CTL1: EDGESEL1 Position */ -#define ECAP_CTL1_EDGESEL1_Msk (0x3ul << ECAP_CTL1_EDGESEL1_Pos) /*!< ECAP_T::CTL1: EDGESEL1 Mask */ - -#define ECAP_CTL1_EDGESEL2_Pos (4) /*!< ECAP_T::CTL1: EDGESEL2 Position */ -#define ECAP_CTL1_EDGESEL2_Msk (0x3ul << ECAP_CTL1_EDGESEL2_Pos) /*!< ECAP_T::CTL1: EDGESEL2 Mask */ - -#define ECAP_CTL1_CAP0RLDEN_Pos (8) /*!< ECAP_T::CTL1: CAP0RLDEN Position */ -#define ECAP_CTL1_CAP0RLDEN_Msk (0x1ul << ECAP_CTL1_CAP0RLDEN_Pos) /*!< ECAP_T::CTL1: CAP0RLDEN Mask */ - -#define ECAP_CTL1_CAP1RLDEN_Pos (9) /*!< ECAP_T::CTL1: CAP1RLDEN Position */ -#define ECAP_CTL1_CAP1RLDEN_Msk (0x1ul << ECAP_CTL1_CAP1RLDEN_Pos) /*!< ECAP_T::CTL1: CAP1RLDEN Mask */ - -#define ECAP_CTL1_CAP2RLDEN_Pos (10) /*!< ECAP_T::CTL1: CAP2RLDEN Position */ -#define ECAP_CTL1_CAP2RLDEN_Msk (0x1ul << ECAP_CTL1_CAP2RLDEN_Pos) /*!< ECAP_T::CTL1: CAP2RLDEN Mask */ - -#define ECAP_CTL1_OVRLDEN_Pos (11) /*!< ECAP_T::CTL1: OVRLDEN Position */ -#define ECAP_CTL1_OVRLDEN_Msk (0x1ul << ECAP_CTL1_OVRLDEN_Pos) /*!< ECAP_T::CTL1: OVRLDEN Mask */ - -#define ECAP_CTL1_CLKSEL_Pos (12) /*!< ECAP_T::CTL1: CLKSEL Position */ -#define ECAP_CTL1_CLKSEL_Msk (0x7ul << ECAP_CTL1_CLKSEL_Pos) /*!< ECAP_T::CTL1: CLKSEL Mask */ - -#define ECAP_CTL1_CNTSRCSEL_Pos (16) /*!< ECAP_T::CTL1: CNTSRCSEL Position */ -#define ECAP_CTL1_CNTSRCSEL_Msk (0x3ul << ECAP_CTL1_CNTSRCSEL_Pos) /*!< ECAP_T::CTL1: CNTSRCSEL Mask */ - -#define ECAP_CTL1_CAP0CLREN_Pos (20) /*!< ECAP_T::CTL1: CAP0CLREN Position */ -#define ECAP_CTL1_CAP0CLREN_Msk (0x1ul << ECAP_CTL1_CAP0CLREN_Pos) /*!< ECAP_T::CTL1: CAP0CLREN Mask */ - -#define ECAP_CTL1_CAP1CLREN_Pos (21) /*!< ECAP_T::CTL1: CAP1CLREN Position */ -#define ECAP_CTL1_CAP1CLREN_Msk (0x1ul << ECAP_CTL1_CAP1CLREN_Pos) /*!< ECAP_T::CTL1: CAP1CLREN Mask */ - -#define ECAP_CTL1_CAP2CLREN_Pos (22) /*!< ECAP_T::CTL1: CAP2CLREN Position */ -#define ECAP_CTL1_CAP2CLREN_Msk (0x1ul << ECAP_CTL1_CAP2CLREN_Pos) /*!< ECAP_T::CTL1: CAP2CLREN Mask */ - -#define ECAP_STATUS_CAPTF0_Pos (0) /*!< ECAP_T::STATUS: CAPTF0 Position */ -#define ECAP_STATUS_CAPTF0_Msk (0x1ul << ECAP_STATUS_CAPTF0_Pos) /*!< ECAP_T::STATUS: CAPTF0 Mask */ - -#define ECAP_STATUS_CAPTF1_Pos (1) /*!< ECAP_T::STATUS: CAPTF1 Position */ -#define ECAP_STATUS_CAPTF1_Msk (0x1ul << ECAP_STATUS_CAPTF1_Pos) /*!< ECAP_T::STATUS: CAPTF1 Mask */ - -#define ECAP_STATUS_CAPTF2_Pos (2) /*!< ECAP_T::STATUS: CAPTF2 Position */ -#define ECAP_STATUS_CAPTF2_Msk (0x1ul << ECAP_STATUS_CAPTF2_Pos) /*!< ECAP_T::STATUS: CAPTF2 Mask */ - -#define ECAP_STATUS_CAPCMPF_Pos (4) /*!< ECAP_T::STATUS: CAPCMPF Position */ -#define ECAP_STATUS_CAPCMPF_Msk (0x1ul << ECAP_STATUS_CAPCMPF_Pos) /*!< ECAP_T::STATUS: CAPCMPF Mask */ - -#define ECAP_STATUS_CAPOVF_Pos (5) /*!< ECAP_T::STATUS: CAPOVF Position */ -#define ECAP_STATUS_CAPOVF_Msk (0x1ul << ECAP_STATUS_CAPOVF_Pos) /*!< ECAP_T::STATUS: CAPOVF Mask */ - -#define ECAP_STATUS_CAP0_Pos (8) /*!< ECAP_T::STATUS: CAP0 Position */ -#define ECAP_STATUS_CAP0_Msk (0x1ul << ECAP_STATUS_CAP0_Pos) /*!< ECAP_T::STATUS: CAP0 Mask */ - -#define ECAP_STATUS_CAP1_Pos (9) /*!< ECAP_T::STATUS: CAP1 Position */ -#define ECAP_STATUS_CAP1_Msk (0x1ul << ECAP_STATUS_CAP1_Pos) /*!< ECAP_T::STATUS: CAP1 Mask */ - -#define ECAP_STATUS_CAP2_Pos (10) /*!< ECAP_T::STATUS: CAP2 Position */ -#define ECAP_STATUS_CAP2_Msk (0x1ul << ECAP_STATUS_CAP2_Pos) /*!< ECAP_T::STATUS: CAP2 Mask */ - -/**@}*/ /* ECAP_CONST */ -/**@}*/ /* end of ECAP register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __ECAP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/epwm_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/epwm_reg.h deleted file mode 100644 index 813f8b1ae03..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/epwm_reg.h +++ /dev/null @@ -1,4001 +0,0 @@ -/**************************************************************************//** - * @file epwm_reg.h - * @version V1.00 - * @brief EPWM register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EPWM_REG_H__ -#define __EPWM_REG_H__ - -/** - @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Enhanced Pulse Width Modulation Controller -------------------------*/ -/** - @addtogroup EPWM Enhanced Pulse Width Modulation Controller(EPWM) - Memory Mapped Structure for EPWM Controller - @{ -*/ - -typedef struct -{ - /** - * @var ECAPDAT_T::RCAPDAT - * Offset: 0x20C EPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var ECAPDAT_T::FCAPDAT - * Offset: 0x210 EPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] EPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] EPWM Falling Capture Data Register 0~5 */ -} ECAPDAT_T; - -typedef struct -{ - - - /** - * @var EPWM_T::CTL0 - * Offset: 0x00 EPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |In up-down counter type, PERIOD0 register will load to PBUF0 register at the end point of each period. - * | | |CMPDAT0 register will load to CMPBUF0 register at the center point of a period. - * |[1] |CTRLD1 |Center Re-load - * | | |In up-down counter type, PERIOD1 register will load to PBUF1 register at the end point of each period. - * | | |CMPDAT1 register will load to CMPBUF1 register at the center point of a period. - * |[2] |CTRLD2 |Center Re-load - * | | |In up-down counter type, PERIOD2 register will load to PBUF2 register at the end point of each period. - * | | |CMPDAT2 register will load to CMPBUF2 register at the center point of a period. - * |[3] |CTRLD3 |Center Re-load - * | | |In up-down counter type, PERIOD3 register will load to PBUF3 register at the end point of each period. - * | | |CMPDAT3 register will load to CMPBUF3 register at the center point of a period. - * |[4] |CTRLD4 |Center Re-load - * | | |In up-down counter type, PERIOD4 register will load to PBUF4 register at the end point of each period. - * | | |CMPDAT4 register will load to CMPBUF4 register at the center point of a period. - * |[5] |CTRLD5 |Center Re-load - * | | |In up-down counter type, PERIOD5 register will load to PBUF5 register at the end point of each period. - * | | |CMPDAT5 register will load to CMPBUF5 register at the center point of a period. - * |[8] |WINLDEN0 |Window Load Enable Bits - * | | |0 = PERIOD0 register will load to PBUF0 register at the end point of each period. - * | | |CMPDAT0 register will load to CMPBUF0 register at the end point or center point of each period by setting CTRLD0 bit. - * | | |1 = PERIOD0 register will load to PBUF0 and CMPDAT0 registers will load to CMPBUF0 register at the end point of each period when valid reload window is set. - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register, and cleared by hardware after load success. - * |[9] |WINLDEN1 |Window Load Enable Bits - * | | |0 = PERIOD1 register will load to PBUF1 register at the end point of each period. - * | | |CMPDAT1 register will load to CMPBUF1 register at the end point or center point of each period by setting CTRLD1 bit. - * | | |1 = PERIOD1 register will load to PBUF1 and CMPDAT1 registers will load to CMPBUF1 register at the end point of each period when valid reload window is set. - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register, and cleared by hardware after load success. - * |[10] |WINLDEN2 |Window Load Enable Bits - * | | |0 = PERIOD2 register will load to PBUF2 register at the end point of each period. - * | | |CMPDAT2 register will load to CMPBUF2 register at the end point or center point of each period by setting CTRLD2 bit. - * | | |1 = PERIOD2 register will load to PBUF2 and CMPDAT2 registers will load to CMPBUF2 register at the end point of each period when valid reload window is set. - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register, and cleared by hardware after load success. - * |[11] |WINLDEN3 |Window Load Enable Bits - * | | |0 = PERIOD3 register will load to PBUF3 register at the end point of each period. - * | | |CMPDAT3 register will load to CMPBUF3 register at the end point or center point of each period by setting CTRLD3 bit. - * | | |1 = PERIOD3 register will load to PBUF3 and CMPDAT3 registers will load to CMPBUF3 register at the end point of each period when valid reload window is set. - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register, and cleared by hardware after load success. - * |[12] |WINLDEN4 |Window Load Enable Bits - * | | |0 = PERIOD4 register will load to PBUF4 register at the end point of each period. - * | | |CMPDAT4 register will load to CMPBUF4 register at the end point or center point of each period by setting CTRLD4 bit. - * | | |1 = PERIOD4 register will load to PBUF4 and CMPDAT4 registers will load to CMPBUF4 register at the end point of each period when valid reload window is set. - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register, and cleared by hardware after load success. - * |[13] |WINLDEN5 |Window Load Enable Bits - * | | |0 = PERIOD5 register will load to PBUF5 register at the end point of each period. - * | | |CMPDAT5 register will load to CMPBUF5 register at the end point or center point of each period by setting CTRLD5 bit. - * | | |1 = PERIOD5 register will load to PBUF5 and CMPDAT5 registers will load to CMPBUF5 register at the end point of each period when valid reload window is set. - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register, and cleared by hardware after load success. - * |[16] |IMMLDEN0 |Immediately Load Enable Bits - * | | |0 = PERIOD0 register will load to PBUF0 register at the end point of each period. - * | | |CMPDAT0 register will load to CMPBUF0 register at the end point or center point of each period by setting CTRLD0 bit. - * | | |1 = PERIOD0/CMPDAT0 registers will load to PBUF0 and CMPBUF0 register immediately when software update PERIOD0/CMPDAT0 register. - * | | |Note: If IMMLDEN0 bit is enabled, WINLDEN0 bit and CTRLD0 bits will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bits - * | | |0 = PERIOD1 register will load to PBUF1 register at the end point of each period. - * | | |CMPDAT1 register will load to CMPBUF1 register at the end point or center point of each period by setting CTRLD1 bit. - * | | |1 = PERIOD1/CMPDAT1 registers will load to PBUF1 and CMPBUF1 register immediately when software update PERIOD1/CMPDAT1 register. - * | | |Note: If IMMLDEN1 bit is enabled, WINLDEN1 bit and CTRLD1 bits will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bits - * | | |0 = PERIOD2 register will load to PBUF2 register at the end point of each period. - * | | |CMPDAT2 register will load to CMPBUF2 register at the end point or center point of each period by setting CTRLD2 bit. - * | | |1 = PERIOD2/CMPDAT2 registers will load to PBUF2 and CMPBUF2 register immediately when software update PERIOD2/CMPDAT2 register. - * | | |Note: If IMMLDEN2 bit is enabled, WINLDEN2 bit and CTRLD2 bits will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bits - * | | |0 = PERIOD3 register will load to PBUF3 register at the end point of each period. - * | | |CMPDAT3 register will load to CMPBUF3 register at the end point or center point of each period by setting CTRLD3 bit. - * | | |1 = PERIOD3/CMPDAT3 registers will load to PBUF3 and CMPBUF3 register immediately when software update PERIOD3/CMPDAT3 register. - * | | |Note: If IMMLDEN3 bit is enabled, WINLDEN3 bit and CTRLD3 bits will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bits - * | | |0 = PERIOD4 register will load to PBUF4 register at the end point of each period. - * | | |CMPDAT4 register will load to CMPBUF4 register at the end point or center point of each period by setting CTRLD4 bit. - * | | |1 = PERIOD4/CMPDAT4 registers will load to PBUF4 and CMPBUF4 register immediately when software update PERIOD4/CMPDAT4 register. - * | | |Note: If IMMLDEN4 bit is enabled, WINLDEN4 bit and CTRLD4 bits will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bits - * | | |0 = PERIOD5 register will load to PBUF5 register at the end point of each period. - * | | |CMPDAT5 register will load to CMPBUF5 register at the end point or center point of each period by setting CTRLD5 bit. - * | | |1 = PERIOD5/CMPDAT5 registers will load to PBUF5 and CMPBUF5 register immediately when software update PERIOD5/CMPDAT5 register. - * | | |Note: If IMMLDEN5 bit is enabled, WINLDEN5 bit and CTRLD5 bits will be invalid. - * |[24] |GROUPEN |Group Function Enable Bit - * | | |0 = The output waveform of each EPWM channel are independent. - * | | |1 = Unify the EPWMx_CH2 and EPWMx_CH4 to output the same waveform as EPWMx_CH0 and unify the EPWMx_CH3 and EPWMx_CH5 to output the same waveform as EPWMx_CH1. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, EPWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt disable. - * | | |1 = ICE debug mode counter halt enable. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects EPWM output. - * | | |EPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |EPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::CTL1 - * Offset: 0x04 EPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[3:2] |CNTTYPE1 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[5:4] |CNTTYPE2 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[7:6] |CNTTYPE3 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[9:8] |CNTTYPE4 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[11:10] |CNTTYPE5 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[16] |CNTMODE0 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[17] |CNTMODE1 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[18] |CNTMODE2 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[19] |CNTMODE3 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[20] |CNTMODE4 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[21] |CNTMODE5 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[24] |OUTMODE0 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[25] |OUTMODE2 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[26] |OUTMODE4 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * @var EPWM_T::SYNC - * Offset: 0x08 EPWM Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PHSEN0 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[1] |PHSEN2 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[2] |PHSEN4 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[9:8] |SINSRC0 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[11:10] |SINSRC2 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[13:12] |SINSRC4 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[16] |SNFLTEN |EPWM0_SYNC_IN Noise Filter Enable Bits - * | | |0 = Noise filter of input pin EPWM0_SYNC_IN is Disabled. - * | | |1 = Noise filter of input pin EPWM0_SYNC_IN is Enabled. - * |[19:17] |SFLTCSEL |SYNC Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[22:20] |SFLTCNT |SYNC Edge Detector Filter Count - * | | |The register bits control the counter number of edge detector. - * |[23] |SINPINV |SYNC Input Pin Inverse - * | | |0 = The state of pin EPWM0_SYNC_IN is passed to the negative edge detector. - * | | |1 = The inverse state of pin EPWM0_SYNC_IN is passed to the negative edge detector. - * |[24] |PHSDIR0 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[25] |PHSDIR2 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[26] |PHSDIR4 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * @var EPWM_T::SWSYNC - * Offset: 0x0C EPWM Software Control Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWSYNC0 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source is come from SYNC_IN or this bit. - * |[1] |SWSYNC2 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source is come from SYNC_IN or this bit. - * |[2] |SWSYNC4 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source is come from SYNC_IN or this bit. - * @var EPWM_T::CLKSRC - * Offset: 0x10 EPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |EPWM_CH01 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[10:8] |ECLKSRC2 |EPWM_CH23 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[18:16] |ECLKSRC4 |EPWM_CH45 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var EPWM_T::CLKPSC[3] - * Offset: 0x14 EPWM Clock Prescale Register 0/1, 2/3, 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair share one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CNTEN - * Offset: 0x20 EPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[1] |CNTEN1 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[2] |CNTEN2 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[3] |CNTEN3 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[4] |CNTEN4 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[5] |CNTEN5 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * @var EPWM_T::CNTCLR - * Offset: 0x24 EPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[1] |CNTCLR1 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[2] |CNTCLR2 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[3] |CNTCLR3 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[4] |CNTCLR4 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[5] |CNTCLR5 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * @var EPWM_T::LOAD - * Offset: 0x28 EPWM Load Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LOAD0 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDEN0(EPWM_CTL0[13:8]) = 1. - * |[1] |LOAD1 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDEN1(EPWM_CTL0[13:8]) = 1. - * |[2] |LOAD2 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDEN2(EPWM_CTL0[13:8]) = 1. - * |[3] |LOAD3 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDEN3(EPWM_CTL0[13:8]) = 1. - * |[4] |LOAD4 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDEN4(EPWM_CTL0[13:8]) = 1. - * |[5] |LOAD5 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * @var EPWM_T::PERIOD[6] - * Offset: 0x30 EPWM Period Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |Down-Count mode: In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * EPWM_CLK period. - * | | |Up-Down-Count mode: In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * EPWM_CLK period. - * @var EPWM_T::CMPDAT[6] - * Offset: 0x50 EPWM Comparator Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP use to compare with CNTR to generate EPWM waveform, interrupt and trigger EADC/DAC. - * | | |In independent mode, CMPDAT0~5 denote as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 denote as first compared point, and CMPDAT1, 3, 5 denote as second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::DTCTL[3] - * Offset: 0x70 EPWM Dead-Time Control Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[16] |DTEN |Enable Dead-time Insertion for EPWM Pair (EPWM_CH0, EPWM_CH1) (EPWM_CH2, EPWM_CH3) (EPWM_CH4, EPWM_CH5) (Write Protect) - * | | |Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Dead-time insertion Disabled on the pin pair. - * | | |1 = Dead-time insertion Enabled on the pin pair. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from EPWM_CLK. - * | | |1 = Dead-time clock source from prescaler output. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * @var EPWM_T::PHS[3] - * Offset: 0x80 EPWM Counter Phase Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PHS |EPWM Synchronous Start Phase Bits - * | | |PHS determines the EPWM synchronous start phase value. These bits only use in synchronous function. - * @var EPWM_T::CNT[6] - * Offset: 0x90 EPWM Counter Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNTR to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is Down count. - * | | |1 = Counter is UP count. - * @var EPWM_T::WGCTL0 - * Offset: 0xB0 EPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[3:2] |ZPCTL1 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[5:4] |ZPCTL2 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[7:6] |ZPCTL3 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[9:8] |ZPCTL4 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[11:10] |ZPCTL5 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[17:16] |PRDPCTL0 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIOD0+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIOD1+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIOD2+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIOD3+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIOD4+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIOD5+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * @var EPWM_T::WGCTL1 - * Offset: 0xB4 EPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[3:2] |CMPUCTL1 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[5:4] |CMPUCTL2 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[7:6] |CMPUCTL3 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[9:8] |CMPUCTL4 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[11:10] |CMPUCTL5 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[17:16] |CMPDCTL0 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[19:18] |CMPDCTL1 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[21:20] |CMPDCTL2 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[23:22] |CMPDCTL3 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[25:24] |CMPDCTL4 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[27:26] |CMPDCTL5 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * @var EPWM_T::MSKEN - * Offset: 0xB8 EPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled. - * | | |The corresponding EPWM channel 0 will output MSKDAT0 (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDAT0 data. - * |[1] |MSKEN1 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled. - * | | |The corresponding EPWM channel 1 will output MSKDAT1 (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDAT1 data. - * |[2] |MSKEN2 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled. - * | | |The corresponding EPWM channel 2 will output MSKDAT2 (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDAT2 data. - * |[3] |MSKEN3 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled. - * | | |The corresponding EPWM channel 3 will output MSKDAT3 (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDAT3 data. - * |[4] |MSKEN4 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled. - * | | |The corresponding EPWM channel 4 will output MSKDAT4 (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDAT4 data. - * |[5] |MSKEN5 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled. - * | | |The corresponding EPWM channel 5 will output MSKDAT5 (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDAT5 data. - * @var EPWM_T::MSK - * Offset: 0xBC EPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWM_CH0 output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM_CH0. - * | | |1 = Output logic high to EPWM_CH0. - * |[1] |MSKDAT1 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWM_CH1 output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM_CH1. - * | | |1 = Output logic high to EPWM_CH1. - * |[2] |MSKDAT2 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWM_CH2 output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM_CH2. - * | | |1 = Output logic high to EPWM_CH2. - * |[3] |MSKDAT3 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWM_CH3 output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM_CH3. - * | | |1 = Output logic high to EPWM_CH3. - * |[4] |MSKDAT4 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWM_CH4 output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM_CH4. - * | | |1 = Output logic high to EPWM_CH4. - * |[5] |MSKDAT5 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWM_CH5 output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM_CH5. - * | | |1 = Output logic high to EPWM_CH5. - * @var EPWM_T::BNF - * Offset: 0xC0 EPWM Brake Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRK0NFEN |EPWM Brake 0 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 0 Disabled. - * | | |1 = Noise filter of EPWM Brake 0 Enabled. - * |[3:1] |BRK0NFSEL |Brake 0 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[6:4] |BRK0FCNT |Brake 0 Edge Detector Filter Count - * | | |The register bits control the Brake0 filter counter to count from 0 to BRK0FCNT. - * |[7] |BRK0PINV |Brake 0 Pin Inverse - * | | |0 = The state of pin EPWMx_BRAKE0 is passed to the negative edge detector. - * | | |1 = The inversed state of pin EPWMx_BRAKE0 is passed to the negative edge detector. - * |[8] |BRK1NFEN |EPWM Brake 1 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 1 Disabled. - * | | |1 = Noise filter of EPWM Brake 1 Enabled. - * |[11:9] |BRK1NFSEL |Brake 1 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[14:12] |BRK1FCNT |Brake 1 Edge Detector Filter Count - * | | |The register bits control the Brake1 filter counter to count from 0 to BRK1FCNT. - * |[15] |BRK1PINV |Brake 1 Pin Inverse - * | | |0 = The state of pin EPWMx_BRAKE1 is passed to the negative edge detector. - * | | |1 = The inversed state of pin EPWMx_BRAKE1 is passed to the negative edge detector. - * |[16] |BK0SRC |Brake 0 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 0 pin source come from EPWM0_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |For EPWM1 setting: - * | | |0 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM0_BRAKE0. - * |[24] |BK1SRC |Brake 1 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 1 pin source come from EPWM0_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |For EPWM1 setting: - * | | |0 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM0_BRAKE1. - * @var EPWM_T::FAILBRK - * Offset: 0xC4 EPWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by CSS detection Disabled. - * | | |1 = Brake Function triggered by CSS detection Enabled. - * |[1] |BODBRKEN |Brown-out Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by BOD Disabled. - * | | |1 = Brake Function triggered by BOD Enabled. - * |[2] |RAMBRKEN |SRAM Parity Error Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by SRAM parity error detection Disabled. - * | | |1 = Brake Function triggered by SRAM parity error detection Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by Core lockup detection Disabled. - * | | |1 = Brake Function triggered by Core lockup detection Enabled. - * @var EPWM_T::BRKCTL[3] - * Offset: 0xC8 EPWM Brake Edge Detect Control Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CPO0EBEN |Enable ACMP0_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as edge-detect brake source Disabled. - * | | |1 = ACMP0_O as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[1] |CPO1EBEN |Enable ACMP1_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as edge-detect brake source Disabled. - * | | |1 = ACMP1_O as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[4] |BRKP0EEN |Enable EPWMx_BRAKE0 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[5] |BRKP1EEN |Enable EPWMx_BRAKE1 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as edge-detect brake source Disabled. - * | | |1 = System Fail condition as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[8] |CPO0LBEN |Enable ACMP0_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as level-detect brake source Disabled. - * | | |1 = ACMP0_O as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[9] |CPO1LBEN |Enable ACMP1_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as level-detect brake source Disabled. - * | | |1 = ACMP1_O as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[12] |BRKP0LEN |Enable BKP0 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[13] |BRKP1LEN |Enable BKP1 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as level-detect brake source Disabled. - * | | |1 = System Fail condition as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[17:16] |BRKAEVEN |EPWM Brake Action Select for Even Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect even channels output. - * | | |01 = EPWM even channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM even channel output low level when EPWMx brake event happened. - * | | |11 = EPWM even channel output high level when EPWMx brake event happened. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[19:18] |BRKAODD |EPWM Brake Action Select for Odd Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect odd channels output. - * | | |01 = EPWM odd channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM odd channel output low level when EPWMx brake event happened. - * | | |11 = EPWM odd channel output high level when EPWMx brake event happened. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[20] |EADCEBEN |Enable EADC Result Monitor (EADCRM) As Edge-detect Brake Source (Write Protect) - * | | |0 = EADCRM as edge-detect brake source Disabled. - * | | |1 = EADCRM as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[28] |EADCLBEN |Enable EADC Result Monitor (EADCRM) As Level-detect Brake Source (Write Protect) - * | | |0 = EADCRM as level-detect brake source Disabled. - * | | |1 = EADCRM as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::POLCTL - * Offset: 0xD4 EPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |EPWM_CH0 PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM_CH0 output. - * | | |0 = EPWM_CH0 output polar inverse Disabled. - * | | |1 = EPWM_CH0 output polar inverse Enabled. - * |[1] |PINV1 |EPWM_CH1 PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM_CH1 output. - * | | |0 = EPWM_CH1 output polar inverse Disabled. - * | | |1 = EPWM_CH1 output polar inverse Enabled. - * |[2] |PINV2 |EPWM_CH2 PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM_CH2 output. - * | | |0 = EPWM_CH2 output polar inverse Disabled. - * | | |1 = EPWM_CH2 output polar inverse Enabled. - * |[3] |PINV3 |EPWM_CH3 PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM_CH3 output. - * | | |0 = EPWM_CH3 output polar inverse Disabled. - * | | |1 = EPWM_CH3 output polar inverse Enabled. - * |[4] |PINV4 |EPWM_CH4 PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM_CH4 output. - * | | |0 = EPWM_CH4 output polar inverse Disabled. - * | | |1 = EPWM_CH4 output polar inverse Enabled. - * |[5] |PINV5 |EPWM_CH5 PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM_CH5 output. - * | | |0 = EPWM_CH5 output polar inverse Disabled. - * | | |1 = EPWM_CH5 output polar inverse Enabled. - * @var EPWM_T::POEN - * Offset: 0xD8 EPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |EPWM_CH0 Pin Output Enable Bits - * | | |0 = EPWM_CH0 pin at tri-state. - * | | |1 = EPWM_CH0 pin in output mode. - * |[1] |POEN1 |EPWM_CH1 Pin Output Enable Bits - * | | |0 = EPWM_CH1 pin at tri-state. - * | | |1 = EPWM_CH1 pin in output mode. - * |[2] |POEN2 |EPWM_CH2 Pin Output Enable Bits - * | | |0 = EPWM_CH2 pin at tri-state. - * | | |1 = EPWM_CH2 pin in output mode. - * |[3] |POEN3 |EPWM_CH3 Pin Output Enable Bits - * | | |0 = EPWM_CH3 pin at tri-state. - * | | |1 = EPWM_CH3 pin in output mode. - * |[4] |POEN4 |EPWM_CH4 Pin Output Enable Bits - * | | |0 = EPWM_CH4 pin at tri-state. - * | | |1 = EPWM_CH4 pin in output mode. - * |[5] |POEN5 |EPWM_CH5 Pin Output Enable Bits - * | | |0 = EPWM_CH5 pin at tri-state. - * | | |1 = EPWM_CH5 pin in output mode. - * @var EPWM_T::SWBRK - * Offset: 0xDC EPWM Software Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG0 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIF0 to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[1] |BRKETRG2 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIF2 to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[2] |BRKETRG4 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIF4 to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[8] |BRKLTRG0 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIF0 to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[9] |BRKLTRG2 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIF2 to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[10] |BRKLTRG4 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIF4 to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::INTEN0 - * Offset: 0xE0 EPWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[1] |ZIEN1 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[2] |ZIEN2 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[3] |ZIEN3 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[4] |ZIEN4 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[5] |ZIEN5 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[8] |PIEN0 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[9] |PIEN1 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[10] |PIEN2 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[11] |PIEN3 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[12] |PIEN4 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[13] |PIEN5 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[16] |CMPUIEN0 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[17] |CMPUIEN1 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[18] |CMPUIEN2 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[19] |CMPUIEN3 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[20] |CMPUIEN4 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[21] |CMPUIEN5 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[24] |CMPDIEN0 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[25] |CMPDIEN1 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[26] |CMPDIEN2 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[27] |CMPDIEN3 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[28] |CMPDIEN4 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[29] |CMPDIEN5 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * @var EPWM_T::INTEN1 - * Offset: 0xE4 EPWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN0_1|EPWM Edge-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[1] |BRKEIEN2_3|EPWM Edge-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[2] |BRKEIEN4_5|EPWM Edge-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[8] |BRKLIEN0_1|EPWM Level-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Level-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[9] |BRKLIEN2_3|EPWM Level-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Level-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[10] |BRKLIEN4_5|EPWM Level-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Level-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::INTSTS0 - * Offset: 0xE8 EPWM Interrupt Flag Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[1] |ZIF1 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[2] |ZIF2 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[3] |ZIF3 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[4] |ZIF4 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[5] |ZIF5 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[8] |PIF0 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIOD0, software can write 1 to clear this bit to zero - * |[9] |PIF1 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIOD1, software can write 1 to clear this bit to zero - * |[10] |PIF2 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIOD2, software can write 1 to clear this bit to zero - * |[11] |PIF3 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIOD4, software can write 1 to clear this bit to zero - * |[12] |PIF4 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIOD5, software can write 1 to clear this bit to zero - * |[13] |PIF5 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn, software can write 1 to clear this bit to zero. - * |[16] |CMPUIF0 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDAT0, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[17] |CMPUIF1 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDAT1, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[18] |CMPUIF2 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDAT2, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[19] |CMPUIF3 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDAT3, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[20] |CMPUIF4 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDAT4, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[21] |CMPUIF5 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDAT5, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[24] |CMPDIF0 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDAT0, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[25] |CMPDIF1 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDAT1, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[26] |CMPDIF2 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDAT2, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[27] |CMPDIF3 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDAT3, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[28] |CMPDIF4 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDAT4, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[29] |CMPDIF5 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDAT5, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * @var EPWM_T::INTSTS1 - * Offset: 0xEC EPWM Interrupt Flag Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |EPWM Channel0 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel0 edge-detect brake event do not happened. - * | | |1 = When EPWM channel0 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[1] |BRKEIF1 |EPWM Channel1 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel1 edge-detect brake event do not happened. - * | | |1 = When EPWM channel1 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[2] |BRKEIF2 |EPWM Channel2 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel2 edge-detect brake event do not happened. - * | | |1 = When EPWM channel2 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[3] |BRKEIF3 |EPWM Channel3 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel3 edge-detect brake event do not happened. - * | | |1 = When EPWM channel3 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[4] |BRKEIF4 |EPWM Channel4 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel4 edge-detect brake event do not happened. - * | | |1 = When EPWM channel4 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[5] |BRKEIF5 |EPWM Channel5 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel5 edge-detect brake event do not happened. - * | | |1 = When EPWM channel5 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[8] |BRKLIF0 |EPWM Channel0 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel0 level-detect brake event do not happened. - * | | |1 = When EPWM channel0 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[9] |BRKLIF1 |EPWM Channel1 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel1 level-detect brake event do not happened. - * | | |1 = When EPWM channel1 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[10] |BRKLIF2 |EPWM Channel2 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel2 level-detect brake event do not happened. - * | | |1 = When EPWM channel2 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[11] |BRKLIF3 |EPWM Channel3 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel3 level-detect brake event do not happened. - * | | |1 = When EPWM channel3 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[12] |BRKLIF4 |EPWM Channel4 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel4 level-detect brake event do not happened. - * | | |1 = When EPWM channel4 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[13] |BRKLIF5 |EPWM Channel5 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel5 level-detect brake event do not happened. - * | | |1 = When EPWM channel5 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer to SYS_REGLCTL register. - * |[16] |BRKESTS0 |EPWM Channel0 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel0 edge-detect brake state is released. - * | | |1 = When EPWM channel0 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel0 at brake state, writing 1 to clear. - * |[17] |BRKESTS1 |EPWM Channel1 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel1 edge-detect brake state is released. - * | | |1 = When EPWM channel1 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel1 at brake state, writing 1 to clear. - * |[18] |BRKESTS2 |EPWM Channel2 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel2 edge-detect brake state is released. - * | | |1 = When EPWM channel2 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel2 at brake state, writing 1 to clear. - * |[19] |BRKESTS3 |EPWM Channel3 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel3 edge-detect brake state is released. - * | | |1 = When EPWM channel3 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel3 at brake state, writing 1 to clear. - * |[20] |BRKESTS4 |EPWM Channel4 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel4 edge-detect brake state is released. - * | | |1 = When EPWM channel4 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel4 at brake state, writing 1 to clear. - * |[21] |BRKESTS5 |EPWM Channel5 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel5 edge-detect brake state is released. - * | | |1 = When EPWM channel5 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel5 at brake state, writing 1 to clear. - * |[24] |BRKLSTS0 |EPWM Channel0 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel0 level-detect brake state is released. - * | | |1 = When EPWM channel0 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel0 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[25] |BRKLSTS1 |EPWM Channel1 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel1 level-detect brake state is released. - * | | |1 = When EPWM channel1 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel1 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[26] |BRKLSTS2 |EPWM Channel2 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel2 level-detect brake state is released. - * | | |1 = When EPWM channel2 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel2 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[27] |BRKLSTS3 |EPWM Channel3 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel3 level-detect brake state is released. - * | | |1 = When EPWM channel3 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel3 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[28] |BRKLSTS4 |EPWM Channel4 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel4 level-detect brake state is released. - * | | |1 = When EPWM channel4 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel4 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[29] |BRKLSTS5 |EPWM Channel5 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel5 level-detect brake state is released. - * | | |1 = When EPWM channel5 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel5 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * @var EPWM_T::DACTRGEN - * Offset: 0xF4 EPWM Trigger DAC Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZTE0 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[1] |ZTE1 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[2] |ZTE2 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[3] |ZTE3 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[4] |ZTE4 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[5] |ZTE5 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[8] |PTE0 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[9] |PTE1 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[10] |PTE2 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[11] |PTE3 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[12] |PTE4 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[13] |PTE5 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[16] |CUTRGE0 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[17] |CUTRGE1 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[18] |CUTRGE2 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[19] |CUTRGE3 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[20] |CUTRGE4 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[21] |CUTRGE5 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[24] |CDTRGE0 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[25] |CDTRGE1 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[26] |CDTRGE2 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[27] |CDTRGE3 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[28] |CDTRGE4 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[29] |CDTRGE5 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * @var EPWM_T::EADCTS0 - * Offset: 0xF8 EPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |EPWM_CH0 Trigger EADC Source Select - * | | |0000 = EPWM_CH0 zero point. - * | | |0001 = EPWM_CH0 period point. - * | | |0010 = EPWM_CH0 zero or period point. - * | | |0011 = EPWM_CH0 up-count CMPDAT point. - * | | |0100 = EPWM_CH0 down-count CMPDAT point. - * | | |0101 = EPWM_CH1 zero point. - * | | |0110 = EPWM_CH1 period point. - * | | |0111 = EPWM_CH1 zero or period point. - * | | |1000 = EPWM_CH1 up-count CMPDAT point. - * | | |1001 = EPWM_CH1 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[7] |TRGEN0 |EPWM_CH0 Trigger EADC enable bit - * |[11:8] |TRGSEL1 |EPWM_CH1 Trigger EADC Source Select - * | | |0000 = EPWM_CH0 zero point. - * | | |0001 = EPWM_CH0 period point. - * | | |0010 = EPWM_CH0 zero or period point. - * | | |0011 = EPWM_CH0 up-count CMPDAT point. - * | | |0100 = EPWM_CH0 down-count CMPDAT point. - * | | |0101 = EPWM_CH1 zero point. - * | | |0110 = EPWM_CH1 period point. - * | | |0111 = EPWM_CH1 zero or period point. - * | | |1000 = EPWM_CH1 up-count CMPDAT point. - * | | |1001 = EPWM_CH1 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[15] |TRGEN1 |EPWM_CH1 Trigger EADC enable bit - * |[19:16] |TRGSEL2 |EPWM_CH2 Trigger EADC Source Select - * | | |0000 = EPWM_CH2 zero point. - * | | |0001 = EPWM_CH2 period point. - * | | |0010 = EPWM_CH2 zero or period point. - * | | |0011 = EPWM_CH2 up-count CMPDAT point. - * | | |0100 = EPWM_CH2 down-count CMPDAT point. - * | | |0101 = EPWM_CH3 zero point. - * | | |0110 = EPWM_CH3 period point. - * | | |0111 = EPWM_CH3 zero or period point. - * | | |1000 = EPWM_CH3 up-count CMPDAT point. - * | | |1001 = EPWM_CH3 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[23] |TRGEN2 |EPWM_CH2 Trigger EADC enable bit - * |[27:24] |TRGSEL3 |EPWM_CH3 Trigger EADC Source Select - * | | |0000 = EPWM_CH2 zero point. - * | | |0001 = EPWM_CH2 period point. - * | | |0010 = EPWM_CH2 zero or period point. - * | | |0011 = EPWM_CH2 up-count CMPDAT point. - * | | |0100 = EPWM_CH2 down-count CMPDAT point. - * | | |0101 = EPWM_CH3 zero point. - * | | |0110 = EPWM_CH3 period point. - * | | |0111 = EPWM_CH3 zero or period point. - * | | |1000 = EPWM_CH3 up-count CMPDAT point. - * | | |1001 = EPWM_CH3 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[31] |TRGEN3 |EPWM_CH3 Trigger EADC enable bit - * @var EPWM_T::EADCTS1 - * Offset: 0xFC EPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |EPWM_CH4 Trigger EADC Source Select - * | | |0000 = EPWM_CH4 zero point. - * | | |0001 = EPWM_CH4 period point. - * | | |0010 = EPWM_CH4 zero or period point. - * | | |0011 = EPWM_CH4 up-count CMPDAT point. - * | | |0100 = EPWM_CH4 down-count CMPDAT point. - * | | |0101 = EPWM_CH5 zero point. - * | | |0110 = EPWM_CH5 period point. - * | | |0111 = EPWM_CH5 zero or period point. - * | | |1000 = EPWM_CH5 up-count CMPDAT point. - * | | |1001 = EPWM_CH5 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[7] |TRGEN4 |EPWM_CH4 Trigger EADC enable bit - * |[11:8] |TRGSEL5 |EPWM_CH5 Trigger EADC Source Select - * | | |0000 = EPWM_CH4 zero point. - * | | |0001 = EPWM_CH4 period point. - * | | |0010 = EPWM_CH4 zero or period point. - * | | |0011 = EPWM_CH4 up-count CMPDAT point. - * | | |0100 = EPWM_CH4 down-count CMPDAT point. - * | | |0101 = EPWM_CH5 zero point. - * | | |0110 = EPWM_CH5 period point. - * | | |0111 = EPWM_CH5 zero or period point. - * | | |1000 = EPWM_CH5 up-count CMPDAT point. - * | | |1001 = EPWM_CH5 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[15] |TRGEN5 |EPWM_CH5 Trigger EADC enable bit - * @var EPWM_T::FTCMPDAT[3] - * Offset: 0x100 EPWM Free Trigger Compare Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMP |EPWM Free Trigger Compare Register - * | | |FTCMP use to compare with even CNTR to trigger EADC - * | | |FTCMPDAT0, 2, 4 corresponding complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::SSCTL - * Offset: 0x110 EPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[1] |SSEN1 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[2] |SSEN2 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[3] |SSEN3 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[4] |SSEN4 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[5] |SSEN5 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[9:8] |SSRC |EPWM Synchronous Start Source Select Bits - * | | |00 = Synchronous start source come from EPWM0. - * | | |01 = Synchronous start source come from EPWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var EPWM_T::SSTRG - * Offset: 0x114 EPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |EPWM Counter Synchronous Start Enable (Write Only) - * | | |PMW counter synchronous enable function is used to make selected EPWM channels (include EPWM0_CHx and EPWM1_CHx) start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit (CNTENn, n denotes channel 0 to 5) if correlated EPWM channel counter synchronous start function is enabled. - * @var EPWM_T::LEBCTL - * Offset: 0x118 EPWM Leading Edge Blanking Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LEBEN |EPWM Leading Edge Blanking Enable Bit - * | | |0 = EPWM Leading Edge Blanking Disabled. - * | | |1 = EPWM Leading Edge Blanking Enabled. - * |[8] |SRCEN0 |EPWM Leading Edge Blanking Source From EPWM_CH0 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH0 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH0 Enabled. - * |[9] |SRCEN2 |EPWM Leading Edge Blanking Source From EPWM_CH2 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH2 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH2 Enabled. - * |[10] |SRCEN4 |EPWM Leading Edge Blanking Source From EPWM_CH4 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH4 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH4 Enabled. - * |[17:16] |TRGTYPE |EPWM Leading Edge Blanking Trigger Type - * | | |0 = When detect leading edge blanking source rising edge, blanking counter start counting. - * | | |1 = When detect leading edge blanking source falling edge, blanking counter start counting. - * | | |2 = When detect leading edge blanking source rising or falling edge, blanking counter start counting. - * | | |3 = Reserved. - * @var EPWM_T::LEBCNT - * Offset: 0x11C EPWM Leading Edge Blanking Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |LEBCNT |EPWM Leading Edge Blanking Counter - * | | |This counter value decides leading edge blanking window size. - * | | |Blanking window size = LEBCNT+1, and LEB counter clock base is ECLK. - * @var EPWM_T::STATUS - * Offset: 0x120 EPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF0 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[1] |CNTMAXF1 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[2] |CNTMAXF2 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[3] |CNTMAXF3 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[4] |CNTMAXF4 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[5] |CNTMAXF5 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[8] |SYNCINF0 |Input Synchronization Latched Flag - * | | |0 = Indicates no SYNC_IN event has occurred. - * | | |1 = Indicates an SYNC_IN event has occurred, software can write 1 to clear this bit. - * |[9] |SYNCINF2 |Input Synchronization Latched Flag - * | | |0 = Indicates no SYNC_IN event has occurred. - * | | |1 = Indicates an SYNC_IN event has occurred, software can write 1 to clear this bit. - * |[10] |SYNCINF4 |Input Synchronization Latched Flag - * | | |0 = Indicates no SYNC_IN event has occurred. - * | | |1 = Indicates an SYNC_IN event has occurred, software can write 1 to clear this bit. - * |[16] |EADCTRGF0 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[17] |EADCTRGF1 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[18] |EADCTRGF2 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[19] |EADCTRGF3 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[20] |EADCTRGF4 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[21] |EADCTRGF5 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[24] |DACTRGF |DAC Start of Conversion Flag - * | | |0 = Indicates no DAC start of conversion trigger event has occurred. - * | | |1 = Indicates an DAC start of conversion trigger event has occurred, software can write 1 to clear this bit - * @var EPWM_T::IFA[6] - * Offset: 0x130 EPWM Interrupt Flag Accumulator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Interrupt Flag Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator stop mode disable. - * | | |1 = EPWM_CHn interrupt flag accumulator stop mode enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = CNT equal to Zero in channel n. - * | | |01 = CNT equal to PERIOD in channel n. - * | | |10 = CNT equal to CMPU in channel n. - * | | |11 = CNT equal to CMPD in channel n. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator disable. - * | | |1 = EPWM_CHn interrupt flag accumulator enable. - * @var EPWM_T::AINTSTS - * Offset: 0x150 EPWM Accumulator Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIF0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[1] |IFAIF1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[2] |IFAIF2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[3] |IFAIF3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[4] |IFAIF4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[5] |IFAIF5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * @var EPWM_T::AINTEN - * Offset: 0x154 EPWM Accumulator Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIEN0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[1] |IFAIEN1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[2] |IFAIEN2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[3] |IFAIEN3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[4] |IFAIEN4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[5] |IFAIEN5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * @var EPWM_T::APDMACTL - * Offset: 0x158 EPWM Accumulator PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APDMAEN0 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[1] |APDMAEN1 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[2] |APDMAEN2 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[3] |APDMAEN3 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[4] |APDMAEN4 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[5] |APDMAEN5 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * @var EPWM_T::CAPINEN - * Offset: 0x200 EPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * @var EPWM_T::CAPCTL - * Offset: 0x204 EPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var EPWM_T::CAPSTS - * Offset: 0x208 EPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIFOV0 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[1] |CRLIFOV1 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[2] |CRLIFOV2 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[3] |CRLIFOV3 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[4] |CRLIFOV4 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[5] |CRLIFOV5 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[8] |CFLIFOV0 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[9] |CFLIFOV1 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[10] |CFLIFOV2 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[11] |CFLIFOV3 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[12] |CFLIFOV4 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[13] |CFLIFOV5 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * @var EPWM_T::PDMACTL - * Offset: 0x23C EPWM PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHEN0_1 |Channel 0/1 PDMA Enable - * | | |0 = Channel 0/1 PDMA function Disabled. - * | | |1 = Channel 0/1 PDMA function Enabled for the channel 0/1 captured data and transfer to memory. - * |[2:1] |CAPMOD0_1 |Select EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT0/1 register. - * | | |10 = EPWM_FCAPDAT0/1 register. - * | | |11 = Both EPWM_RCAPDAT0/1 and EPWM_FCAPDAT0/1 registers. - * |[3] |CAPORD0_1 |Capture Channel 0/1 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 register is the first captured data transferred to memory through PDMA when CAPMOD0_1 bits are set to = 0x3. - * | | |0 = EPWM_FCAPDAT0/1 register is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT0/1 register is the first captured data to memory. - * |[4] |CHSEL0_1 |Select Channel 0/1 to Do PDMA Transfer - * | | |0 = Channel0. - * | | |1 = Channel1. - * |[8] |CHEN2_3 |Channel 2/3 PDMA Enable - * | | |0 = Channel 2/3 PDMA function Disabled. - * | | |1 = Channel 2/3 PDMA function Enabled for the channel 2/3 captured data and transfer to memory. - * |[10:9] |CAPMOD2_3 |Select EPWM_RCAPDAT2/3 or EPWM_FCAODAT2/3 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT2/3 register. - * | | |10 = EPWM_FCAPDAT2/3 register. - * | | |11 = Both EPWM_RCAPDAT2/3 and EPWM_FCAPDAT2/3 registers. - * |[11] |CAPORD2_3 |Capture Channel 2/3 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT2/3 or EPWM_FCAPDAT2/3 register is the first captured data transferred to memory through PDMA when CAPMOD2_3 bits are set to =0x3. - * | | |0 = EPWM_FCAPDAT2/3 register is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT2/3 register is the first captured data to memory. - * |[12] |CHSEL2_3 |Select Channel 2/3 to Do PDMA Transfer - * | | |0 = Channel2. - * | | |1 = Channel3. - * |[16] |CHEN4_5 |Channel 4/5 PDMA Enable - * | | |0 = Channel 4/5 PDMA function Disabled. - * | | |1 = Channel 4/5 PDMA function Enabled for the channel 4/5 captured data and transfer to memory. - * |[18:17] |CAPMOD4_5 |Select EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT4/5 register. - * | | |10 = EPWM_FCAPDAT4/5 register. - * | | |11 = Both EPWM_RCAPDAT4/5 and EPWM_FCAPDAT4/5 registers. - * |[19] |CAPORD4_5 |Capture Channel 4/5 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 register is the first captured data transferred to memory through PDMA when CAPMOD4_5 bits =are set to 0x3. - * | | |0 = EPWM_FCAPDAT4/5 register is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT4/5 register is the first captured data to memory. - * |[20] |CHSEL4_5 |Select Channel 4/5 to Do PDMA Transfer - * | | |0 = Channel4. - * | | |1 = Channel5. - * @var EPWM_T::PDMACAP[3] - * Offset: 0x240 EPWM Capture Channel 01 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |EPWM Capture PDMA Register (Read Only) - * | | |This register is use as a buffer to transfer EPWM capture rising or falling data to memory by PDMA. - * @var EPWM_T::CAPIEN - * Offset: 0x250 EPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIEN0 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPRIEN0 bit must be disabled. - * |[1] |CAPRIEN1 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPRIEN1 bit must be disabled. - * |[2] |CAPRIEN2 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPRIEN2 bit must be disabled. - * |[3] |CAPRIEN3 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPRIEN3 bit must be disabled. - * |[4] |CAPRIEN4 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPRIEN4 bit must be disabled. - * |[5] |CAPRIEN5 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPRIEN5 bit must be disabled. - * |[8] |CAPFIEN0 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPFIEN0 bit must be disabled. - * |[9] |CAPFIEN1 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPFIEN1 bit must be disabled. - * |[10] |CAPFIEN2 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPFIEN2 bit must be disabled. - * |[11] |CAPFIEN3 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPFIEN3 bit must be disabled. - * |[12] |CAPFIEN4 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPFIEN4 bit must be disabled. - * |[13] |CAPFIEN5 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * | | |Note: When Capture with PDMA operating, corresponding channel CAPFIEN5 bit must be disabled. - * @var EPWM_T::CAPIF - * Offset: 0x254 EPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIF0 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CRLIF0 bit will cleared by hardware after PDMA transfer data. - * |[1] |CRLIF1 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CRLIF1 bit will cleared by hardware after PDMA transfer data. - * |[2] |CRLIF2 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CRLIF2 bit will cleared by hardware after PDMA transfer data. - * |[3] |CRLIF3 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CRLIF3 bit will cleared by hardware after PDMA transfer data. - * |[4] |CRLIF4 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CRLIF4 bit will cleared by hardware after PDMA transfer data. - * |[5] |CRLIF5 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CRLIF5 bit will cleared by hardware after PDMA transfer data. - * |[8] |CFLIF0 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CFLIF0 bit will cleared by hardware after PDMA transfer data. - * |[9] |CFLIF1 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CFLIF1 bit will cleared by hardware after PDMA transfer data. - * |[10] |CFLIF2 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CFLIF2 bit will cleared by hardware after PDMA transfer data. - * |[11] |CFLIF3 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CFLIF3 bit will cleared by hardware after PDMA transfer data. - * |[12] |CFLIF4 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, corresponding channel CFLIF4 bit will cleared by hardware after PDMA transfer data. - * |[13] |CFLIF5 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will cleared by hardware after PDMA transfer data. - * @var EPWM_T::PBUF[6] - * Offset: 0x304 EPWM PERIOD0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::CMPBUF[6] - * Offset: 0x31C EPWM CMPDAT0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CPSCBUF[3] - * Offset: 0x334 EPWM CLKPSC0_1/2_3/4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Use as EPWM counter clock prescale active register. - * @var EPWM_T::FTCBUF[3] - * Offset: 0x340 EPWM FTCMPDAT0_1/2_3/4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMPBUF |EPWM FTCMPDAT Buffer (Read Only) - * | | |Used as FTCMPDAT active register. - * @var EPWM_T::FTCI - * Offset: 0x34C EPWM FTCMPDAT Indicator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FTCMU0 |EPWM FTCMPDAT Up Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=1, software can write 1 to clear this bit. - * |[1] |FTCMU2 |EPWM FTCMPDAT Up Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=1, software can write 1 to clear this bit. - * |[2] |FTCMU4 |EPWM FTCMPDAT Up Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=1, software can write 1 to clear this bit. - * |[8] |FTCMD0 |EPWM FTCMPDAT Down Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=0, software can write 1 to clear this bit. - * |[9] |FTCMD2 |EPWM FTCMPDAT Down Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=0, software can write 1 to clear this bit. - * |[10] |FTCMD4 |EPWM FTCMPDAT Down Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=0, software can write 1 to clear this bit. - */ - __IO uint32_t CTL0; /*!< [0x0000] EPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] EPWM Control Register 1 */ - __IO uint32_t SYNC; /*!< [0x0008] EPWM Synchronization Register */ - __IO uint32_t SWSYNC; /*!< [0x000c] EPWM Software Control Synchronization Register */ - __IO uint32_t CLKSRC; /*!< [0x0010] EPWM Clock Source Register */ - __IO uint32_t CLKPSC[3]; /*!< [0x0014~0x001c] EPWM Clock Prescale Register 0_1,2_3,4_5 */ - __IO uint32_t CNTEN; /*!< [0x0020] EPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] EPWM Clear Counter Register */ - __IO uint32_t LOAD; /*!< [0x0028] EPWM Load Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t PERIOD[6]; /*!< [0x0030~0x0044] EPWM Period Register 0~5 */ - __I uint32_t RESERVE1[2]; - __IO uint32_t CMPDAT[6]; /*!< [0x0050~0x0064] EPWM Comparator Register 0~5 */ - __I uint32_t RESERVE2[2]; - __IO uint32_t DTCTL[3]; /*!< [0x0070~0x0078] EPWM Dead-Time Control Register 0_1,2_3,4_5 */ - __I uint32_t RESERVE3[1]; - __IO uint32_t PHS[3]; /*!< [0x0080~0x0088] EPWM Counter Phase Register 0_1,2_3,4_5 */ - __I uint32_t RESERVE4[1]; - __I uint32_t CNT[6]; /*!< [0x0090~0x00A4 EPWM Counter Register 0~5 */ - __I uint32_t RESERVE5[2]; - __IO uint32_t WGCTL0; /*!< [0x00b0] EPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] EPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] EPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] EPWM Mask Data Register */ - __IO uint32_t BNF; /*!< [0x00c0] EPWM Brake Noise Filter Register */ - __IO uint32_t FAILBRK; /*!< [0x00c4] EPWM System Fail Brake Control Register */ - __IO uint32_t BRKCTL[3]; /*!< [0x00c8~0x00d0] EPWM Brake Edge Detect Control Register 0_1,2_3,4_5 */ - __IO uint32_t POLCTL; /*!< [0x00d4] EPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] EPWM Output Enable Register */ - __O uint32_t SWBRK; /*!< [0x00dc] EPWM Software Brake Control Register */ - __IO uint32_t INTEN0; /*!< [0x00e0] EPWM Interrupt Enable Register 0 */ - __IO uint32_t INTEN1; /*!< [0x00e4] EPWM Interrupt Enable Register 1 */ - __IO uint32_t INTSTS0; /*!< [0x00e8] EPWM Interrupt Flag Register 0 */ - __IO uint32_t INTSTS1; /*!< [0x00ec] EPWM Interrupt Flag Register 1 */ - __I uint32_t RESERVE6[1]; - __IO uint32_t DACTRGEN; /*!< [0x00f4] EPWM Trigger DAC Enable Register */ - __IO uint32_t EADCTS0; /*!< [0x00f8] EPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] EPWM Trigger EADC Source Select Register 1 */ - __IO uint32_t FTCMPDAT[3]; /*!< [0x0100~0x108] EPWM Free Trigger Compare Register 0_1,2_3,4_5 */ - __I uint32_t RESERVE7[1]; - __IO uint32_t SSCTL; /*!< [0x0110] EPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] EPWM Synchronous Start Trigger Register */ - __IO uint32_t LEBCTL; /*!< [0x0118] EPWM Leading Edge Blanking Control Register */ - __IO uint32_t LEBCNT; /*!< [0x011c] EPWM Leading Edge Blanking Counter Register */ - __IO uint32_t STATUS; /*!< [0x0120] EPWM Status Register */ - __I uint32_t RESERVE8[3]; - __IO uint32_t IFA[6]; /*!< [0x0130~0x144] EPWM Interrupt Flag Accumulator Register 0~5 */ - __I uint32_t RESERVE9[2]; - __IO uint32_t AINTSTS; /*!< [0x0150] EPWM Accumulator Interrupt Flag Register */ - __IO uint32_t AINTEN; /*!< [0x0154] EPWM Accumulator Interrupt Enable Register */ - __IO uint32_t APDMACTL; /*!< [0x0158] EPWM Accumulator PDMA Control Register */ - __I uint32_t RESERVE10[1]; - __IO uint32_t FDEN; /*!< [0x0160] EPWM Fault Detect Enable Register */ - __IO uint32_t FDCTL[6]; /*!< [0x0164~0x178] EPWM Fault Detect Control Register 0~5 */ - __IO uint32_t FDIEN; /*!< [0x017C] EPWM Fault Detect Interrupt Enable Register */ - __IO uint32_t FDSTS; /*!< [0x0180] EPWM Fault Detect Interrupt Flag Register */ - __IO uint32_t EADCPSCCTL; /*!< [0x0184] EPWM Trigger EADC Prescale Control Register */ - __IO uint32_t EADCPSC0; /*!< [0x0188] EPWM Trigger EADC Prescale Register 0 */ - __IO uint32_t EADCPSC1; /*!< [0x018C] EPWM Trigger EADC Prescale Register 1 */ - __IO uint32_t EADCPSCNT0; /*!< [0x0190] EPWM Trigger EADC Prescale Counter Register 0 */ - __IO uint32_t EADCPSCNT1; /*!< [0x0194] EPWM Trigger EADC Prescale Counter Register 1 */ - __I uint32_t RESERVE11[26]; - __IO uint32_t CAPINEN; /*!< [0x0200] EPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] EPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] EPWM Capture Status Register */ - ECAPDAT_T CAPDAT[6]; /*!< [0x020c~0x0238] EPWM Rising and Falling Capture Data Register 0~5 */ - __IO uint32_t PDMACTL; /*!< [0x023c] EPWM PDMA Control Register */ - __I uint32_t PDMACAP[3]; /*!< [0x0240~0x248] EPWM Capture Channel 0_1,2_3,4_5 PDMA Register */ - __I uint32_t RESERVE12[1]; - __IO uint32_t CAPIEN; /*!< [0x0250] EPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] EPWM Capture Interrupt Flag Register */ - __I uint32_t RESERVE13[43]; - __I uint32_t PBUF[6]; /*!< [0x0304~0x0318 EPWM PERIOD0~5 Buffer */ - __I uint32_t CMPBUF[6]; /*!< [0x031C~0x0330 EPWM CMPDAT0~5 Buffer */ - __I uint32_t CPSCBUF[3]; /*!< [0x0334~0x33c] EPWM CLKPSC0_1,2_3,4_5 Buffer */ - __I uint32_t FTCBUF[3]; /*!< [0x0340~0x348] EPWM FTCMPDAT0_1,2_3,4_5 Buffer */ - __IO uint32_t FTCI; /*!< [0x034c] EPWM FTCMPDAT Indicator Register */ - -} EPWM_T; - -/** - @addtogroup EPWM_CONST EPWM Bit Field Definition - Constant Definitions for EPWM Controller - @{ -*/ - -#define EPWM_CTL0_CTRLD0_Pos (0) /*!< EPWM_T::CTL0: CTRLD0 Position */ -#define EPWM_CTL0_CTRLD0_Msk (0x1ul << EPWM_CTL0_CTRLD0_Pos) /*!< EPWM_T::CTL0: CTRLD0 Mask */ - -#define EPWM_CTL0_CTRLD1_Pos (1) /*!< EPWM_T::CTL0: CTRLD1 Position */ -#define EPWM_CTL0_CTRLD1_Msk (0x1ul << EPWM_CTL0_CTRLD1_Pos) /*!< EPWM_T::CTL0: CTRLD1 Mask */ - -#define EPWM_CTL0_CTRLD2_Pos (2) /*!< EPWM_T::CTL0: CTRLD2 Position */ -#define EPWM_CTL0_CTRLD2_Msk (0x1ul << EPWM_CTL0_CTRLD2_Pos) /*!< EPWM_T::CTL0: CTRLD2 Mask */ - -#define EPWM_CTL0_CTRLD3_Pos (3) /*!< EPWM_T::CTL0: CTRLD3 Position */ -#define EPWM_CTL0_CTRLD3_Msk (0x1ul << EPWM_CTL0_CTRLD3_Pos) /*!< EPWM_T::CTL0: CTRLD3 Mask */ - -#define EPWM_CTL0_CTRLD4_Pos (4) /*!< EPWM_T::CTL0: CTRLD4 Position */ -#define EPWM_CTL0_CTRLD4_Msk (0x1ul << EPWM_CTL0_CTRLD4_Pos) /*!< EPWM_T::CTL0: CTRLD4 Mask */ - -#define EPWM_CTL0_CTRLD5_Pos (5) /*!< EPWM_T::CTL0: CTRLD5 Position */ -#define EPWM_CTL0_CTRLD5_Msk (0x1ul << EPWM_CTL0_CTRLD5_Pos) /*!< EPWM_T::CTL0: CTRLD5 Mask */ - -#define EPWM_CTL0_WINLDEN0_Pos (8) /*!< EPWM_T::CTL0: WINLDEN0 Position */ -#define EPWM_CTL0_WINLDEN0_Msk (0x1ul << EPWM_CTL0_WINLDEN0_Pos) /*!< EPWM_T::CTL0: WINLDEN0 Mask */ - -#define EPWM_CTL0_WINLDEN1_Pos (9) /*!< EPWM_T::CTL0: WINLDEN1 Position */ -#define EPWM_CTL0_WINLDEN1_Msk (0x1ul << EPWM_CTL0_WINLDEN1_Pos) /*!< EPWM_T::CTL0: WINLDEN1 Mask */ - -#define EPWM_CTL0_WINLDEN2_Pos (10) /*!< EPWM_T::CTL0: WINLDEN2 Position */ -#define EPWM_CTL0_WINLDEN2_Msk (0x1ul << EPWM_CTL0_WINLDEN2_Pos) /*!< EPWM_T::CTL0: WINLDEN2 Mask */ - -#define EPWM_CTL0_WINLDEN3_Pos (11) /*!< EPWM_T::CTL0: WINLDEN3 Position */ -#define EPWM_CTL0_WINLDEN3_Msk (0x1ul << EPWM_CTL0_WINLDEN3_Pos) /*!< EPWM_T::CTL0: WINLDEN3 Mask */ - -#define EPWM_CTL0_WINLDEN4_Pos (12) /*!< EPWM_T::CTL0: WINLDEN4 Position */ -#define EPWM_CTL0_WINLDEN4_Msk (0x1ul << EPWM_CTL0_WINLDEN4_Pos) /*!< EPWM_T::CTL0: WINLDEN4 Mask */ - -#define EPWM_CTL0_WINLDEN5_Pos (13) /*!< EPWM_T::CTL0: WINLDEN5 Position */ -#define EPWM_CTL0_WINLDEN5_Msk (0x1ul << EPWM_CTL0_WINLDEN5_Pos) /*!< EPWM_T::CTL0: WINLDEN5 Mask */ - -#define EPWM_CTL0_IMMLDEN0_Pos (16) /*!< EPWM_T::CTL0: IMMLDEN0 Position */ -#define EPWM_CTL0_IMMLDEN0_Msk (0x1ul << EPWM_CTL0_IMMLDEN0_Pos) /*!< EPWM_T::CTL0: IMMLDEN0 Mask */ - -#define EPWM_CTL0_IMMLDEN1_Pos (17) /*!< EPWM_T::CTL0: IMMLDEN1 Position */ -#define EPWM_CTL0_IMMLDEN1_Msk (0x1ul << EPWM_CTL0_IMMLDEN1_Pos) /*!< EPWM_T::CTL0: IMMLDEN1 Mask */ - -#define EPWM_CTL0_IMMLDEN2_Pos (18) /*!< EPWM_T::CTL0: IMMLDEN2 Position */ -#define EPWM_CTL0_IMMLDEN2_Msk (0x1ul << EPWM_CTL0_IMMLDEN2_Pos) /*!< EPWM_T::CTL0: IMMLDEN2 Mask */ - -#define EPWM_CTL0_IMMLDEN3_Pos (19) /*!< EPWM_T::CTL0: IMMLDEN3 Position */ -#define EPWM_CTL0_IMMLDEN3_Msk (0x1ul << EPWM_CTL0_IMMLDEN3_Pos) /*!< EPWM_T::CTL0: IMMLDEN3 Mask */ - -#define EPWM_CTL0_IMMLDEN4_Pos (20) /*!< EPWM_T::CTL0: IMMLDEN4 Position */ -#define EPWM_CTL0_IMMLDEN4_Msk (0x1ul << EPWM_CTL0_IMMLDEN4_Pos) /*!< EPWM_T::CTL0: IMMLDEN4 Mask */ - -#define EPWM_CTL0_IMMLDEN5_Pos (21) /*!< EPWM_T::CTL0: IMMLDEN5 Position */ -#define EPWM_CTL0_IMMLDEN5_Msk (0x1ul << EPWM_CTL0_IMMLDEN5_Pos) /*!< EPWM_T::CTL0: IMMLDEN5 Mask */ - -#define EPWM_CTL0_GROUPEN_Pos (24) /*!< EPWM_T::CTL0: GROUPEN Position */ -#define EPWM_CTL0_GROUPEN_Msk (0x1ul << EPWM_CTL0_GROUPEN_Pos) /*!< EPWM_T::CTL0: GROUPEN Mask */ - -#define EPWM_CTL0_DBGHALT_Pos (30) /*!< EPWM_T::CTL0: DBGHALT Position */ -#define EPWM_CTL0_DBGHALT_Msk (0x1ul << EPWM_CTL0_DBGHALT_Pos) /*!< EPWM_T::CTL0: DBGHALT Mask */ - -#define EPWM_CTL0_DBGTRIOFF_Pos (31) /*!< EPWM_T::CTL0: DBGTRIOFF Position */ -#define EPWM_CTL0_DBGTRIOFF_Msk (0x1ul << EPWM_CTL0_DBGTRIOFF_Pos) /*!< EPWM_T::CTL0: DBGTRIOFF Mask */ - -#define EPWM_CTL1_CNTTYPE0_Pos (0) /*!< EPWM_T::CTL1: CNTTYPE0 Position */ -#define EPWM_CTL1_CNTTYPE0_Msk (0x3ul << EPWM_CTL1_CNTTYPE0_Pos) /*!< EPWM_T::CTL1: CNTTYPE0 Mask */ - -#define EPWM_CTL1_CNTTYPE1_Pos (2) /*!< EPWM_T::CTL1: CNTTYPE1 Position */ -#define EPWM_CTL1_CNTTYPE1_Msk (0x3ul << EPWM_CTL1_CNTTYPE1_Pos) /*!< EPWM_T::CTL1: CNTTYPE1 Mask */ - -#define EPWM_CTL1_CNTTYPE2_Pos (4) /*!< EPWM_T::CTL1: CNTTYPE2 Position */ -#define EPWM_CTL1_CNTTYPE2_Msk (0x3ul << EPWM_CTL1_CNTTYPE2_Pos) /*!< EPWM_T::CTL1: CNTTYPE2 Mask */ - -#define EPWM_CTL1_CNTTYPE3_Pos (6) /*!< EPWM_T::CTL1: CNTTYPE3 Position */ -#define EPWM_CTL1_CNTTYPE3_Msk (0x3ul << EPWM_CTL1_CNTTYPE3_Pos) /*!< EPWM_T::CTL1: CNTTYPE3 Mask */ - -#define EPWM_CTL1_CNTTYPE4_Pos (8) /*!< EPWM_T::CTL1: CNTTYPE4 Position */ -#define EPWM_CTL1_CNTTYPE4_Msk (0x3ul << EPWM_CTL1_CNTTYPE4_Pos) /*!< EPWM_T::CTL1: CNTTYPE4 Mask */ - -#define EPWM_CTL1_CNTTYPE5_Pos (10) /*!< EPWM_T::CTL1: CNTTYPE5 Position */ -#define EPWM_CTL1_CNTTYPE5_Msk (0x3ul << EPWM_CTL1_CNTTYPE5_Pos) /*!< EPWM_T::CTL1: CNTTYPE5 Mask */ - -#define EPWM_CTL1_CNTMODE0_Pos (16) /*!< EPWM_T::CTL1: CNTMODE0 Position */ -#define EPWM_CTL1_CNTMODE0_Msk (0x1ul << EPWM_CTL1_CNTMODE0_Pos) /*!< EPWM_T::CTL1: CNTMODE0 Mask */ - -#define EPWM_CTL1_CNTMODE1_Pos (17) /*!< EPWM_T::CTL1: CNTMODE1 Position */ -#define EPWM_CTL1_CNTMODE1_Msk (0x1ul << EPWM_CTL1_CNTMODE1_Pos) /*!< EPWM_T::CTL1: CNTMODE1 Mask */ - -#define EPWM_CTL1_CNTMODE2_Pos (18) /*!< EPWM_T::CTL1: CNTMODE2 Position */ -#define EPWM_CTL1_CNTMODE2_Msk (0x1ul << EPWM_CTL1_CNTMODE2_Pos) /*!< EPWM_T::CTL1: CNTMODE2 Mask */ - -#define EPWM_CTL1_CNTMODE3_Pos (19) /*!< EPWM_T::CTL1: CNTMODE3 Position */ -#define EPWM_CTL1_CNTMODE3_Msk (0x1ul << EPWM_CTL1_CNTMODE3_Pos) /*!< EPWM_T::CTL1: CNTMODE3 Mask */ - -#define EPWM_CTL1_CNTMODE4_Pos (20) /*!< EPWM_T::CTL1: CNTMODE4 Position */ -#define EPWM_CTL1_CNTMODE4_Msk (0x1ul << EPWM_CTL1_CNTMODE4_Pos) /*!< EPWM_T::CTL1: CNTMODE4 Mask */ - -#define EPWM_CTL1_CNTMODE5_Pos (21) /*!< EPWM_T::CTL1: CNTMODE5 Position */ -#define EPWM_CTL1_CNTMODE5_Msk (0x1ul << EPWM_CTL1_CNTMODE5_Pos) /*!< EPWM_T::CTL1: CNTMODE5 Mask */ - -#define EPWM_CTL1_OUTMODE0_Pos (24) /*!< EPWM_T::CTL1: OUTMODE0 Position */ -#define EPWM_CTL1_OUTMODE0_Msk (0x1ul << EPWM_CTL1_OUTMODE0_Pos) /*!< EPWM_T::CTL1: OUTMODE0 Mask */ - -#define EPWM_CTL1_OUTMODE2_Pos (25) /*!< EPWM_T::CTL1: OUTMODE2 Position */ -#define EPWM_CTL1_OUTMODE2_Msk (0x1ul << EPWM_CTL1_OUTMODE2_Pos) /*!< EPWM_T::CTL1: OUTMODE2 Mask */ - -#define EPWM_CTL1_OUTMODE4_Pos (26) /*!< EPWM_T::CTL1: OUTMODE4 Position */ -#define EPWM_CTL1_OUTMODE4_Msk (0x1ul << EPWM_CTL1_OUTMODE4_Pos) /*!< EPWM_T::CTL1: OUTMODE4 Mask */ - -#define EPWM_SYNC_PHSEN0_Pos (0) /*!< EPWM_T::SYNC: PHSEN0 Position */ -#define EPWM_SYNC_PHSEN0_Msk (0x1ul << EPWM_SYNC_PHSEN0_Pos) /*!< EPWM_T::SYNC: PHSEN0 Mask */ - -#define EPWM_SYNC_PHSEN2_Pos (1) /*!< EPWM_T::SYNC: PHSEN2 Position */ -#define EPWM_SYNC_PHSEN2_Msk (0x1ul << EPWM_SYNC_PHSEN2_Pos) /*!< EPWM_T::SYNC: PHSEN2 Mask */ - -#define EPWM_SYNC_PHSEN4_Pos (2) /*!< EPWM_T::SYNC: PHSEN4 Position */ -#define EPWM_SYNC_PHSEN4_Msk (0x1ul << EPWM_SYNC_PHSEN4_Pos) /*!< EPWM_T::SYNC: PHSEN4 Mask */ - -#define EPWM_SYNC_SINSRC0_Pos (8) /*!< EPWM_T::SYNC: SINSRC0 Position */ -#define EPWM_SYNC_SINSRC0_Msk (0x3ul << EPWM_SYNC_SINSRC0_Pos) /*!< EPWM_T::SYNC: SINSRC0 Mask */ - -#define EPWM_SYNC_SINSRC2_Pos (10) /*!< EPWM_T::SYNC: SINSRC2 Position */ -#define EPWM_SYNC_SINSRC2_Msk (0x3ul << EPWM_SYNC_SINSRC2_Pos) /*!< EPWM_T::SYNC: SINSRC2 Mask */ - -#define EPWM_SYNC_SINSRC4_Pos (12) /*!< EPWM_T::SYNC: SINSRC4 Position */ -#define EPWM_SYNC_SINSRC4_Msk (0x3ul << EPWM_SYNC_SINSRC4_Pos) /*!< EPWM_T::SYNC: SINSRC4 Mask */ - -#define EPWM_SYNC_SNFLTEN_Pos (16) /*!< EPWM_T::SYNC: SNFLTEN Position */ -#define EPWM_SYNC_SNFLTEN_Msk (0x1ul << EPWM_SYNC_SNFLTEN_Pos) /*!< EPWM_T::SYNC: SNFLTEN Mask */ - -#define EPWM_SYNC_SFLTCSEL_Pos (17) /*!< EPWM_T::SYNC: SFLTCSEL Position */ -#define EPWM_SYNC_SFLTCSEL_Msk (0x7ul << EPWM_SYNC_SFLTCSEL_Pos) /*!< EPWM_T::SYNC: SFLTCSEL Mask */ - -#define EPWM_SYNC_SFLTCNT_Pos (20) /*!< EPWM_T::SYNC: SFLTCNT Position */ -#define EPWM_SYNC_SFLTCNT_Msk (0x7ul << EPWM_SYNC_SFLTCNT_Pos) /*!< EPWM_T::SYNC: SFLTCNT Mask */ - -#define EPWM_SYNC_SINPINV_Pos (23) /*!< EPWM_T::SYNC: SINPINV Position */ -#define EPWM_SYNC_SINPINV_Msk (0x1ul << EPWM_SYNC_SINPINV_Pos) /*!< EPWM_T::SYNC: SINPINV Mask */ - -#define EPWM_SYNC_PHSDIR0_Pos (24) /*!< EPWM_T::SYNC: PHSDIR0 Position */ -#define EPWM_SYNC_PHSDIR0_Msk (0x1ul << EPWM_SYNC_PHSDIR0_Pos) /*!< EPWM_T::SYNC: PHSDIR0 Mask */ - -#define EPWM_SYNC_PHSDIR2_Pos (25) /*!< EPWM_T::SYNC: PHSDIR2 Position */ -#define EPWM_SYNC_PHSDIR2_Msk (0x1ul << EPWM_SYNC_PHSDIR2_Pos) /*!< EPWM_T::SYNC: PHSDIR2 Mask */ - -#define EPWM_SYNC_PHSDIR4_Pos (26) /*!< EPWM_T::SYNC: PHSDIR4 Position */ -#define EPWM_SYNC_PHSDIR4_Msk (0x1ul << EPWM_SYNC_PHSDIR4_Pos) /*!< EPWM_T::SYNC: PHSDIR4 Mask */ - -#define EPWM_SWSYNC_SWSYNC0_Pos (0) /*!< EPWM_T::SWSYNC: SWSYNC0 Position */ -#define EPWM_SWSYNC_SWSYNC0_Msk (0x1ul << EPWM_SWSYNC_SWSYNC0_Pos) /*!< EPWM_T::SWSYNC: SWSYNC0 Mask */ - -#define EPWM_SWSYNC_SWSYNC2_Pos (1) /*!< EPWM_T::SWSYNC: SWSYNC2 Position */ -#define EPWM_SWSYNC_SWSYNC2_Msk (0x1ul << EPWM_SWSYNC_SWSYNC2_Pos) /*!< EPWM_T::SWSYNC: SWSYNC2 Mask */ - -#define EPWM_SWSYNC_SWSYNC4_Pos (2) /*!< EPWM_T::SWSYNC: SWSYNC4 Position */ -#define EPWM_SWSYNC_SWSYNC4_Msk (0x1ul << EPWM_SWSYNC_SWSYNC4_Pos) /*!< EPWM_T::SWSYNC: SWSYNC4 Mask */ - -#define EPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< EPWM_T::CLKSRC: ECLKSRC0 Position */ -#define EPWM_CLKSRC_ECLKSRC0_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC0_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define EPWM_CLKSRC_ECLKSRC2_Pos (8) /*!< EPWM_T::CLKSRC: ECLKSRC2 Position */ -#define EPWM_CLKSRC_ECLKSRC2_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC2_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC2 Mask */ - -#define EPWM_CLKSRC_ECLKSRC4_Pos (16) /*!< EPWM_T::CLKSRC: ECLKSRC4 Position */ -#define EPWM_CLKSRC_ECLKSRC4_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC4_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC4 Mask */ - -#define EPWM_CLKPSC0_1_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC0_1: CLKPSC Position */ -#define EPWM_CLKPSC0_1_CLKPSC_Msk (0xffful << EPWM_CLKPSC0_1_CLKPSC_Pos) /*!< EPWM_T::CLKPSC0_1: CLKPSC Mask */ - -#define EPWM_CLKPSC2_3_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC2_3: CLKPSC Position */ -#define EPWM_CLKPSC2_3_CLKPSC_Msk (0xffful << EPWM_CLKPSC2_3_CLKPSC_Pos) /*!< EPWM_T::CLKPSC2_3: CLKPSC Mask */ - -#define EPWM_CLKPSC4_5_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC4_5: CLKPSC Position */ -#define EPWM_CLKPSC4_5_CLKPSC_Msk (0xffful << EPWM_CLKPSC4_5_CLKPSC_Pos) /*!< EPWM_T::CLKPSC4_5: CLKPSC Mask */ - -#define EPWM_CNTEN_CNTEN0_Pos (0) /*!< EPWM_T::CNTEN: CNTEN0 Position */ -#define EPWM_CNTEN_CNTEN0_Msk (0x1ul << EPWM_CNTEN_CNTEN0_Pos) /*!< EPWM_T::CNTEN: CNTEN0 Mask */ - -#define EPWM_CNTEN_CNTEN1_Pos (1) /*!< EPWM_T::CNTEN: CNTEN1 Position */ -#define EPWM_CNTEN_CNTEN1_Msk (0x1ul << EPWM_CNTEN_CNTEN1_Pos) /*!< EPWM_T::CNTEN: CNTEN1 Mask */ - -#define EPWM_CNTEN_CNTEN2_Pos (2) /*!< EPWM_T::CNTEN: CNTEN2 Position */ -#define EPWM_CNTEN_CNTEN2_Msk (0x1ul << EPWM_CNTEN_CNTEN2_Pos) /*!< EPWM_T::CNTEN: CNTEN2 Mask */ - -#define EPWM_CNTEN_CNTEN3_Pos (3) /*!< EPWM_T::CNTEN: CNTEN3 Position */ -#define EPWM_CNTEN_CNTEN3_Msk (0x1ul << EPWM_CNTEN_CNTEN3_Pos) /*!< EPWM_T::CNTEN: CNTEN3 Mask */ - -#define EPWM_CNTEN_CNTEN4_Pos (4) /*!< EPWM_T::CNTEN: CNTEN4 Position */ -#define EPWM_CNTEN_CNTEN4_Msk (0x1ul << EPWM_CNTEN_CNTEN4_Pos) /*!< EPWM_T::CNTEN: CNTEN4 Mask */ - -#define EPWM_CNTEN_CNTEN5_Pos (5) /*!< EPWM_T::CNTEN: CNTEN5 Position */ -#define EPWM_CNTEN_CNTEN5_Msk (0x1ul << EPWM_CNTEN_CNTEN5_Pos) /*!< EPWM_T::CNTEN: CNTEN5 Mask */ - -#define EPWM_CNTCLR_CNTCLR0_Pos (0) /*!< EPWM_T::CNTCLR: CNTCLR0 Position */ -#define EPWM_CNTCLR_CNTCLR0_Msk (0x1ul << EPWM_CNTCLR_CNTCLR0_Pos) /*!< EPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define EPWM_CNTCLR_CNTCLR1_Pos (1) /*!< EPWM_T::CNTCLR: CNTCLR1 Position */ -#define EPWM_CNTCLR_CNTCLR1_Msk (0x1ul << EPWM_CNTCLR_CNTCLR1_Pos) /*!< EPWM_T::CNTCLR: CNTCLR1 Mask */ - -#define EPWM_CNTCLR_CNTCLR2_Pos (2) /*!< EPWM_T::CNTCLR: CNTCLR2 Position */ -#define EPWM_CNTCLR_CNTCLR2_Msk (0x1ul << EPWM_CNTCLR_CNTCLR2_Pos) /*!< EPWM_T::CNTCLR: CNTCLR2 Mask */ - -#define EPWM_CNTCLR_CNTCLR3_Pos (3) /*!< EPWM_T::CNTCLR: CNTCLR3 Position */ -#define EPWM_CNTCLR_CNTCLR3_Msk (0x1ul << EPWM_CNTCLR_CNTCLR3_Pos) /*!< EPWM_T::CNTCLR: CNTCLR3 Mask */ - -#define EPWM_CNTCLR_CNTCLR4_Pos (4) /*!< EPWM_T::CNTCLR: CNTCLR4 Position */ -#define EPWM_CNTCLR_CNTCLR4_Msk (0x1ul << EPWM_CNTCLR_CNTCLR4_Pos) /*!< EPWM_T::CNTCLR: CNTCLR4 Mask */ - -#define EPWM_CNTCLR_CNTCLR5_Pos (5) /*!< EPWM_T::CNTCLR: CNTCLR5 Position */ -#define EPWM_CNTCLR_CNTCLR5_Msk (0x1ul << EPWM_CNTCLR_CNTCLR5_Pos) /*!< EPWM_T::CNTCLR: CNTCLR5 Mask */ - -#define EPWM_LOAD_LOAD0_Pos (0) /*!< EPWM_T::LOAD: LOAD0 Position */ -#define EPWM_LOAD_LOAD0_Msk (0x1ul << EPWM_LOAD_LOAD0_Pos) /*!< EPWM_T::LOAD: LOAD0 Mask */ - -#define EPWM_LOAD_LOAD1_Pos (1) /*!< EPWM_T::LOAD: LOAD1 Position */ -#define EPWM_LOAD_LOAD1_Msk (0x1ul << EPWM_LOAD_LOAD1_Pos) /*!< EPWM_T::LOAD: LOAD1 Mask */ - -#define EPWM_LOAD_LOAD2_Pos (2) /*!< EPWM_T::LOAD: LOAD2 Position */ -#define EPWM_LOAD_LOAD2_Msk (0x1ul << EPWM_LOAD_LOAD2_Pos) /*!< EPWM_T::LOAD: LOAD2 Mask */ - -#define EPWM_LOAD_LOAD3_Pos (3) /*!< EPWM_T::LOAD: LOAD3 Position */ -#define EPWM_LOAD_LOAD3_Msk (0x1ul << EPWM_LOAD_LOAD3_Pos) /*!< EPWM_T::LOAD: LOAD3 Mask */ - -#define EPWM_LOAD_LOAD4_Pos (4) /*!< EPWM_T::LOAD: LOAD4 Position */ -#define EPWM_LOAD_LOAD4_Msk (0x1ul << EPWM_LOAD_LOAD4_Pos) /*!< EPWM_T::LOAD: LOAD4 Mask */ - -#define EPWM_LOAD_LOAD5_Pos (5) /*!< EPWM_T::LOAD: LOAD5 Position */ -#define EPWM_LOAD_LOAD5_Msk (0x1ul << EPWM_LOAD_LOAD5_Pos) /*!< EPWM_T::LOAD: LOAD5 Mask */ - -#define EPWM_PERIOD0_PERIOD_Pos (0) /*!< EPWM_T::PERIOD0: PERIOD Position */ -#define EPWM_PERIOD0_PERIOD_Msk (0xfffful << EPWM_PERIOD0_PERIOD_Pos) /*!< EPWM_T::PERIOD0: PERIOD Mask */ - -#define EPWM_PERIOD1_PERIOD_Pos (0) /*!< EPWM_T::PERIOD1: PERIOD Position */ -#define EPWM_PERIOD1_PERIOD_Msk (0xfffful << EPWM_PERIOD1_PERIOD_Pos) /*!< EPWM_T::PERIOD1: PERIOD Mask */ - -#define EPWM_PERIOD2_PERIOD_Pos (0) /*!< EPWM_T::PERIOD2: PERIOD Position */ -#define EPWM_PERIOD2_PERIOD_Msk (0xfffful << EPWM_PERIOD2_PERIOD_Pos) /*!< EPWM_T::PERIOD2: PERIOD Mask */ - -#define EPWM_PERIOD3_PERIOD_Pos (0) /*!< EPWM_T::PERIOD3: PERIOD Position */ -#define EPWM_PERIOD3_PERIOD_Msk (0xfffful << EPWM_PERIOD3_PERIOD_Pos) /*!< EPWM_T::PERIOD3: PERIOD Mask */ - -#define EPWM_PERIOD4_PERIOD_Pos (0) /*!< EPWM_T::PERIOD4: PERIOD Position */ -#define EPWM_PERIOD4_PERIOD_Msk (0xfffful << EPWM_PERIOD4_PERIOD_Pos) /*!< EPWM_T::PERIOD4: PERIOD Mask */ - -#define EPWM_PERIOD5_PERIOD_Pos (0) /*!< EPWM_T::PERIOD5: PERIOD Position */ -#define EPWM_PERIOD5_PERIOD_Msk (0xfffful << EPWM_PERIOD5_PERIOD_Pos) /*!< EPWM_T::PERIOD5: PERIOD Mask */ - -#define EPWM_CMPDAT0_CMP_Pos (0) /*!< EPWM_T::CMPDAT0: CMP Position */ -#define EPWM_CMPDAT0_CMP_Msk (0xfffful << EPWM_CMPDAT0_CMP_Pos) /*!< EPWM_T::CMPDAT0: CMP Mask */ - -#define EPWM_CMPDAT1_CMP_Pos (0) /*!< EPWM_T::CMPDAT1: CMP Position */ -#define EPWM_CMPDAT1_CMP_Msk (0xfffful << EPWM_CMPDAT1_CMP_Pos) /*!< EPWM_T::CMPDAT1: CMP Mask */ - -#define EPWM_CMPDAT2_CMP_Pos (0) /*!< EPWM_T::CMPDAT2: CMP Position */ -#define EPWM_CMPDAT2_CMP_Msk (0xfffful << EPWM_CMPDAT2_CMP_Pos) /*!< EPWM_T::CMPDAT2: CMP Mask */ - -#define EPWM_CMPDAT3_CMP_Pos (0) /*!< EPWM_T::CMPDAT3: CMP Position */ -#define EPWM_CMPDAT3_CMP_Msk (0xfffful << EPWM_CMPDAT3_CMP_Pos) /*!< EPWM_T::CMPDAT3: CMP Mask */ - -#define EPWM_CMPDAT4_CMP_Pos (0) /*!< EPWM_T::CMPDAT4: CMP Position */ -#define EPWM_CMPDAT4_CMP_Msk (0xfffful << EPWM_CMPDAT4_CMP_Pos) /*!< EPWM_T::CMPDAT4: CMP Mask */ - -#define EPWM_CMPDAT5_CMP_Pos (0) /*!< EPWM_T::CMPDAT5: CMP Position */ -#define EPWM_CMPDAT5_CMP_Msk (0xfffful << EPWM_CMPDAT5_CMP_Pos) /*!< EPWM_T::CMPDAT5: CMP Mask */ - -#define EPWM_DTCTL0_1_DTCNT_Pos (0) /*!< EPWM_T::DTCTL0_1: DTCNT Position */ -#define EPWM_DTCTL0_1_DTCNT_Msk (0xffful << EPWM_DTCTL0_1_DTCNT_Pos) /*!< EPWM_T::DTCTL0_1: DTCNT Mask */ - -#define EPWM_DTCTL0_1_DTEN_Pos (16) /*!< EPWM_T::DTCTL0_1: DTEN Position */ -#define EPWM_DTCTL0_1_DTEN_Msk (0x1ul << EPWM_DTCTL0_1_DTEN_Pos) /*!< EPWM_T::DTCTL0_1: DTEN Mask */ - -#define EPWM_DTCTL0_1_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL0_1: DTCKSEL Position */ -#define EPWM_DTCTL0_1_DTCKSEL_Msk (0x1ul << EPWM_DTCTL0_1_DTCKSEL_Pos) /*!< EPWM_T::DTCTL0_1: DTCKSEL Mask */ - -#define EPWM_DTCTL2_3_DTCNT_Pos (0) /*!< EPWM_T::DTCTL2_3: DTCNT Position */ -#define EPWM_DTCTL2_3_DTCNT_Msk (0xffful << EPWM_DTCTL2_3_DTCNT_Pos) /*!< EPWM_T::DTCTL2_3: DTCNT Mask */ - -#define EPWM_DTCTL2_3_DTEN_Pos (16) /*!< EPWM_T::DTCTL2_3: DTEN Position */ -#define EPWM_DTCTL2_3_DTEN_Msk (0x1ul << EPWM_DTCTL2_3_DTEN_Pos) /*!< EPWM_T::DTCTL2_3: DTEN Mask */ - -#define EPWM_DTCTL2_3_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL2_3: DTCKSEL Position */ -#define EPWM_DTCTL2_3_DTCKSEL_Msk (0x1ul << EPWM_DTCTL2_3_DTCKSEL_Pos) /*!< EPWM_T::DTCTL2_3: DTCKSEL Mask */ - -#define EPWM_DTCTL4_5_DTCNT_Pos (0) /*!< EPWM_T::DTCTL4_5: DTCNT Position */ -#define EPWM_DTCTL4_5_DTCNT_Msk (0xffful << EPWM_DTCTL4_5_DTCNT_Pos) /*!< EPWM_T::DTCTL4_5: DTCNT Mask */ - -#define EPWM_DTCTL4_5_DTEN_Pos (16) /*!< EPWM_T::DTCTL4_5: DTEN Position */ -#define EPWM_DTCTL4_5_DTEN_Msk (0x1ul << EPWM_DTCTL4_5_DTEN_Pos) /*!< EPWM_T::DTCTL4_5: DTEN Mask */ - -#define EPWM_DTCTL4_5_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL4_5: DTCKSEL Position */ -#define EPWM_DTCTL4_5_DTCKSEL_Msk (0x1ul << EPWM_DTCTL4_5_DTCKSEL_Pos) /*!< EPWM_T::DTCTL4_5: DTCKSEL Mask */ - -#define EPWM_PHS0_1_PHS_Pos (0) /*!< EPWM_T::PHS0_1: PHS Position */ -#define EPWM_PHS0_1_PHS_Msk (0xfffful << EPWM_PHS0_1_PHS_Pos) /*!< EPWM_T::PHS0_1: PHS Mask */ - -#define EPWM_PHS2_3_PHS_Pos (0) /*!< EPWM_T::PHS2_3: PHS Position */ -#define EPWM_PHS2_3_PHS_Msk (0xfffful << EPWM_PHS2_3_PHS_Pos) /*!< EPWM_T::PHS2_3: PHS Mask */ - -#define EPWM_PHS4_5_PHS_Pos (0) /*!< EPWM_T::PHS4_5: PHS Position */ -#define EPWM_PHS4_5_PHS_Msk (0xfffful << EPWM_PHS4_5_PHS_Pos) /*!< EPWM_T::PHS4_5: PHS Mask */ - -#define EPWM_CNT0_CNT_Pos (0) /*!< EPWM_T::CNT0: CNT Position */ -#define EPWM_CNT0_CNT_Msk (0xfffful << EPWM_CNT0_CNT_Pos) /*!< EPWM_T::CNT0: CNT Mask */ - -#define EPWM_CNT0_DIRF_Pos (16) /*!< EPWM_T::CNT0: DIRF Position */ -#define EPWM_CNT0_DIRF_Msk (0x1ul << EPWM_CNT0_DIRF_Pos) /*!< EPWM_T::CNT0: DIRF Mask */ - -#define EPWM_CNT1_CNT_Pos (0) /*!< EPWM_T::CNT1: CNT Position */ -#define EPWM_CNT1_CNT_Msk (0xfffful << EPWM_CNT1_CNT_Pos) /*!< EPWM_T::CNT1: CNT Mask */ - -#define EPWM_CNT1_DIRF_Pos (16) /*!< EPWM_T::CNT1: DIRF Position */ -#define EPWM_CNT1_DIRF_Msk (0x1ul << EPWM_CNT1_DIRF_Pos) /*!< EPWM_T::CNT1: DIRF Mask */ - -#define EPWM_CNT2_CNT_Pos (0) /*!< EPWM_T::CNT2: CNT Position */ -#define EPWM_CNT2_CNT_Msk (0xfffful << EPWM_CNT2_CNT_Pos) /*!< EPWM_T::CNT2: CNT Mask */ - -#define EPWM_CNT2_DIRF_Pos (16) /*!< EPWM_T::CNT2: DIRF Position */ -#define EPWM_CNT2_DIRF_Msk (0x1ul << EPWM_CNT2_DIRF_Pos) /*!< EPWM_T::CNT2: DIRF Mask */ - -#define EPWM_CNT3_CNT_Pos (0) /*!< EPWM_T::CNT3: CNT Position */ -#define EPWM_CNT3_CNT_Msk (0xfffful << EPWM_CNT3_CNT_Pos) /*!< EPWM_T::CNT3: CNT Mask */ - -#define EPWM_CNT3_DIRF_Pos (16) /*!< EPWM_T::CNT3: DIRF Position */ -#define EPWM_CNT3_DIRF_Msk (0x1ul << EPWM_CNT3_DIRF_Pos) /*!< EPWM_T::CNT3: DIRF Mask */ - -#define EPWM_CNT4_CNT_Pos (0) /*!< EPWM_T::CNT4: CNT Position */ -#define EPWM_CNT4_CNT_Msk (0xfffful << EPWM_CNT4_CNT_Pos) /*!< EPWM_T::CNT4: CNT Mask */ - -#define EPWM_CNT4_DIRF_Pos (16) /*!< EPWM_T::CNT4: DIRF Position */ -#define EPWM_CNT4_DIRF_Msk (0x1ul << EPWM_CNT4_DIRF_Pos) /*!< EPWM_T::CNT4: DIRF Mask */ - -#define EPWM_CNT5_CNT_Pos (0) /*!< EPWM_T::CNT5: CNT Position */ -#define EPWM_CNT5_CNT_Msk (0xfffful << EPWM_CNT5_CNT_Pos) /*!< EPWM_T::CNT5: CNT Mask */ - -#define EPWM_CNT5_DIRF_Pos (16) /*!< EPWM_T::CNT5: DIRF Position */ -#define EPWM_CNT5_DIRF_Msk (0x1ul << EPWM_CNT5_DIRF_Pos) /*!< EPWM_T::CNT5: DIRF Mask */ - -#define EPWM_WGCTL0_ZPCTL0_Pos (0) /*!< EPWM_T::WGCTL0: ZPCTL0 Position */ -#define EPWM_WGCTL0_ZPCTL0_Msk (0x3ul << EPWM_WGCTL0_ZPCTL0_Pos) /*!< EPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define EPWM_WGCTL0_ZPCTL1_Pos (2) /*!< EPWM_T::WGCTL0: ZPCTL1 Position */ -#define EPWM_WGCTL0_ZPCTL1_Msk (0x3ul << EPWM_WGCTL0_ZPCTL1_Pos) /*!< EPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define EPWM_WGCTL0_ZPCTL2_Pos (4) /*!< EPWM_T::WGCTL0: ZPCTL2 Position */ -#define EPWM_WGCTL0_ZPCTL2_Msk (0x3ul << EPWM_WGCTL0_ZPCTL2_Pos) /*!< EPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define EPWM_WGCTL0_ZPCTL3_Pos (6) /*!< EPWM_T::WGCTL0: ZPCTL3 Position */ -#define EPWM_WGCTL0_ZPCTL3_Msk (0x3ul << EPWM_WGCTL0_ZPCTL3_Pos) /*!< EPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define EPWM_WGCTL0_ZPCTL4_Pos (8) /*!< EPWM_T::WGCTL0: ZPCTL4 Position */ -#define EPWM_WGCTL0_ZPCTL4_Msk (0x3ul << EPWM_WGCTL0_ZPCTL4_Pos) /*!< EPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define EPWM_WGCTL0_ZPCTL5_Pos (10) /*!< EPWM_T::WGCTL0: ZPCTL5 Position */ -#define EPWM_WGCTL0_ZPCTL5_Msk (0x3ul << EPWM_WGCTL0_ZPCTL5_Pos) /*!< EPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define EPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< EPWM_T::WGCTL0: PRDPCTL0 Position */ -#define EPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL0_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define EPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< EPWM_T::WGCTL0: PRDPCTL1 Position */ -#define EPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL1_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define EPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< EPWM_T::WGCTL0: PRDPCTL2 Position */ -#define EPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL2_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define EPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< EPWM_T::WGCTL0: PRDPCTL3 Position */ -#define EPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL3_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define EPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< EPWM_T::WGCTL0: PRDPCTL4 Position */ -#define EPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL4_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define EPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< EPWM_T::WGCTL0: PRDPCTL5 Position */ -#define EPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL5_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define EPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< EPWM_T::WGCTL1: CMPUCTL0 Position */ -#define EPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define EPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< EPWM_T::WGCTL1: CMPUCTL1 Position */ -#define EPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define EPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< EPWM_T::WGCTL1: CMPUCTL2 Position */ -#define EPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define EPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< EPWM_T::WGCTL1: CMPUCTL3 Position */ -#define EPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define EPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< EPWM_T::WGCTL1: CMPUCTL4 Position */ -#define EPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define EPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< EPWM_T::WGCTL1: CMPUCTL5 Position */ -#define EPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define EPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< EPWM_T::WGCTL1: CMPDCTL0 Position */ -#define EPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define EPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< EPWM_T::WGCTL1: CMPDCTL1 Position */ -#define EPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define EPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< EPWM_T::WGCTL1: CMPDCTL2 Position */ -#define EPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define EPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< EPWM_T::WGCTL1: CMPDCTL3 Position */ -#define EPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define EPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< EPWM_T::WGCTL1: CMPDCTL4 Position */ -#define EPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define EPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< EPWM_T::WGCTL1: CMPDCTL5 Position */ -#define EPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define EPWM_MSKEN_MSKEN0_Pos (0) /*!< EPWM_T::MSKEN: MSKEN0 Position */ -#define EPWM_MSKEN_MSKEN0_Msk (0x1ul << EPWM_MSKEN_MSKEN0_Pos) /*!< EPWM_T::MSKEN: MSKEN0 Mask */ - -#define EPWM_MSKEN_MSKEN1_Pos (1) /*!< EPWM_T::MSKEN: MSKEN1 Position */ -#define EPWM_MSKEN_MSKEN1_Msk (0x1ul << EPWM_MSKEN_MSKEN1_Pos) /*!< EPWM_T::MSKEN: MSKEN1 Mask */ - -#define EPWM_MSKEN_MSKEN2_Pos (2) /*!< EPWM_T::MSKEN: MSKEN2 Position */ -#define EPWM_MSKEN_MSKEN2_Msk (0x1ul << EPWM_MSKEN_MSKEN2_Pos) /*!< EPWM_T::MSKEN: MSKEN2 Mask */ - -#define EPWM_MSKEN_MSKEN3_Pos (3) /*!< EPWM_T::MSKEN: MSKEN3 Position */ -#define EPWM_MSKEN_MSKEN3_Msk (0x1ul << EPWM_MSKEN_MSKEN3_Pos) /*!< EPWM_T::MSKEN: MSKEN3 Mask */ - -#define EPWM_MSKEN_MSKEN4_Pos (4) /*!< EPWM_T::MSKEN: MSKEN4 Position */ -#define EPWM_MSKEN_MSKEN4_Msk (0x1ul << EPWM_MSKEN_MSKEN4_Pos) /*!< EPWM_T::MSKEN: MSKEN4 Mask */ - -#define EPWM_MSKEN_MSKEN5_Pos (5) /*!< EPWM_T::MSKEN: MSKEN5 Position */ -#define EPWM_MSKEN_MSKEN5_Msk (0x1ul << EPWM_MSKEN_MSKEN5_Pos) /*!< EPWM_T::MSKEN: MSKEN5 Mask */ - -#define EPWM_MSK_MSKDAT0_Pos (0) /*!< EPWM_T::MSK: MSKDAT0 Position */ -#define EPWM_MSK_MSKDAT0_Msk (0x1ul << EPWM_MSK_MSKDAT0_Pos) /*!< EPWM_T::MSK: MSKDAT0 Mask */ - -#define EPWM_MSK_MSKDAT1_Pos (1) /*!< EPWM_T::MSK: MSKDAT1 Position */ -#define EPWM_MSK_MSKDAT1_Msk (0x1ul << EPWM_MSK_MSKDAT1_Pos) /*!< EPWM_T::MSK: MSKDAT1 Mask */ - -#define EPWM_MSK_MSKDAT2_Pos (2) /*!< EPWM_T::MSK: MSKDAT2 Position */ -#define EPWM_MSK_MSKDAT2_Msk (0x1ul << EPWM_MSK_MSKDAT2_Pos) /*!< EPWM_T::MSK: MSKDAT2 Mask */ - -#define EPWM_MSK_MSKDAT3_Pos (3) /*!< EPWM_T::MSK: MSKDAT3 Position */ -#define EPWM_MSK_MSKDAT3_Msk (0x1ul << EPWM_MSK_MSKDAT3_Pos) /*!< EPWM_T::MSK: MSKDAT3 Mask */ - -#define EPWM_MSK_MSKDAT4_Pos (4) /*!< EPWM_T::MSK: MSKDAT4 Position */ -#define EPWM_MSK_MSKDAT4_Msk (0x1ul << EPWM_MSK_MSKDAT4_Pos) /*!< EPWM_T::MSK: MSKDAT4 Mask */ - -#define EPWM_MSK_MSKDAT5_Pos (5) /*!< EPWM_T::MSK: MSKDAT5 Position */ -#define EPWM_MSK_MSKDAT5_Msk (0x1ul << EPWM_MSK_MSKDAT5_Pos) /*!< EPWM_T::MSK: MSKDAT5 Mask */ - -#define EPWM_BNF_BRK0NFEN_Pos (0) /*!< EPWM_T::BNF: BRK0NFEN Position */ -#define EPWM_BNF_BRK0NFEN_Msk (0x1ul << EPWM_BNF_BRK0NFEN_Pos) /*!< EPWM_T::BNF: BRK0NFEN Mask */ - -#define EPWM_BNF_BRK0NFSEL_Pos (1) /*!< EPWM_T::BNF: BRK0NFSEL Position */ -#define EPWM_BNF_BRK0NFSEL_Msk (0x7ul << EPWM_BNF_BRK0NFSEL_Pos) /*!< EPWM_T::BNF: BRK0NFSEL Mask */ - -#define EPWM_BNF_BRK0FCNT_Pos (4) /*!< EPWM_T::BNF: BRK0FCNT Position */ -#define EPWM_BNF_BRK0FCNT_Msk (0x7ul << EPWM_BNF_BRK0FCNT_Pos) /*!< EPWM_T::BNF: BRK0FCNT Mask */ - -#define EPWM_BNF_BRK0PINV_Pos (7) /*!< EPWM_T::BNF: BRK0PINV Position */ -#define EPWM_BNF_BRK0PINV_Msk (0x1ul << EPWM_BNF_BRK0PINV_Pos) /*!< EPWM_T::BNF: BRK0PINV Mask */ - -#define EPWM_BNF_BRK1NFEN_Pos (8) /*!< EPWM_T::BNF: BRK1NFEN Position */ -#define EPWM_BNF_BRK1NFEN_Msk (0x1ul << EPWM_BNF_BRK1NFEN_Pos) /*!< EPWM_T::BNF: BRK1NFEN Mask */ - -#define EPWM_BNF_BRK1NFSEL_Pos (9) /*!< EPWM_T::BNF: BRK1NFSEL Position */ -#define EPWM_BNF_BRK1NFSEL_Msk (0x7ul << EPWM_BNF_BRK1NFSEL_Pos) /*!< EPWM_T::BNF: BRK1NFSEL Mask */ - -#define EPWM_BNF_BRK1FCNT_Pos (12) /*!< EPWM_T::BNF: BRK1FCNT Position */ -#define EPWM_BNF_BRK1FCNT_Msk (0x7ul << EPWM_BNF_BRK1FCNT_Pos) /*!< EPWM_T::BNF: BRK1FCNT Mask */ - -#define EPWM_BNF_BRK1PINV_Pos (15) /*!< EPWM_T::BNF: BRK1PINV Position */ -#define EPWM_BNF_BRK1PINV_Msk (0x1ul << EPWM_BNF_BRK1PINV_Pos) /*!< EPWM_T::BNF: BRK1PINV Mask */ - -#define EPWM_BNF_BK0SRC_Pos (16) /*!< EPWM_T::BNF: BK0SRC Position */ -#define EPWM_BNF_BK0SRC_Msk (0x1ul << EPWM_BNF_BK0SRC_Pos) /*!< EPWM_T::BNF: BK0SRC Mask */ - -#define EPWM_BNF_BK1SRC_Pos (24) /*!< EPWM_T::BNF: BK1SRC Position */ -#define EPWM_BNF_BK1SRC_Msk (0x1ul << EPWM_BNF_BK1SRC_Pos) /*!< EPWM_T::BNF: BK1SRC Mask */ - -#define EPWM_FAILBRK_CSSBRKEN_Pos (0) /*!< EPWM_T::FAILBRK: CSSBRKEN Position */ -#define EPWM_FAILBRK_CSSBRKEN_Msk (0x1ul << EPWM_FAILBRK_CSSBRKEN_Pos) /*!< EPWM_T::FAILBRK: CSSBRKEN Mask */ - -#define EPWM_FAILBRK_BODBRKEN_Pos (1) /*!< EPWM_T::FAILBRK: BODBRKEN Position */ -#define EPWM_FAILBRK_BODBRKEN_Msk (0x1ul << EPWM_FAILBRK_BODBRKEN_Pos) /*!< EPWM_T::FAILBRK: BODBRKEN Mask */ - -#define EPWM_FAILBRK_RAMBRKEN_Pos (2) /*!< EPWM_T::FAILBRK: RAMBRKEN Position */ -#define EPWM_FAILBRK_RAMBRKEN_Msk (0x1ul << EPWM_FAILBRK_RAMBRKEN_Pos) /*!< EPWM_T::FAILBRK: RAMBRKEN Mask */ - -#define EPWM_FAILBRK_CORBRKEN_Pos (3) /*!< EPWM_T::FAILBRK: CORBRKEN Position */ -#define EPWM_FAILBRK_CORBRKEN_Msk (0x1ul << EPWM_FAILBRK_CORBRKEN_Pos) /*!< EPWM_T::FAILBRK: CORBRKEN Mask */ - -#define EPWM_BRKCTL0_1_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL0_1: CPO0EBEN Position */ -#define EPWM_BRKCTL0_1_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO0EBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL0_1: CPO1EBEN Position */ -#define EPWM_BRKCTL0_1_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO1EBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Position */ -#define EPWM_BRKCTL0_1_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Position */ -#define EPWM_BRKCTL0_1_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Mask */ - -#define EPWM_BRKCTL0_1_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Position */ -#define EPWM_BRKCTL0_1_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL0_1: CPO0LBEN Position */ -#define EPWM_BRKCTL0_1_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO0LBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL0_1: CPO1LBEN Position */ -#define EPWM_BRKCTL0_1_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO1LBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Position */ -#define EPWM_BRKCTL0_1_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Position */ -#define EPWM_BRKCTL0_1_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Mask */ - -#define EPWM_BRKCTL0_1_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Position */ -#define EPWM_BRKCTL0_1_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Position */ -#define EPWM_BRKCTL0_1_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL0_1: BRKAODD Position */ -#define EPWM_BRKCTL0_1_BRKAODD_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAODD_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAODD Mask */ - -#define EPWM_BRKCTL0_1_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL0_1: EADCEBEN Position */ -#define EPWM_BRKCTL0_1_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADCEBEN Mask */ - -#define EPWM_BRKCTL0_1_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL0_1: EADCLBEN Position */ -#define EPWM_BRKCTL0_1_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADCLBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL2_3: CPO0EBEN Position */ -#define EPWM_BRKCTL2_3_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO0EBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL2_3: CPO1EBEN Position */ -#define EPWM_BRKCTL2_3_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO1EBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Position */ -#define EPWM_BRKCTL2_3_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Position */ -#define EPWM_BRKCTL2_3_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Mask */ - -#define EPWM_BRKCTL2_3_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Position */ -#define EPWM_BRKCTL2_3_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL2_3: CPO0LBEN Position */ -#define EPWM_BRKCTL2_3_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO0LBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL2_3: CPO1LBEN Position */ -#define EPWM_BRKCTL2_3_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO1LBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Position */ -#define EPWM_BRKCTL2_3_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Position */ -#define EPWM_BRKCTL2_3_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Mask */ - -#define EPWM_BRKCTL2_3_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Position */ -#define EPWM_BRKCTL2_3_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Position */ -#define EPWM_BRKCTL2_3_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL2_3: BRKAODD Position */ -#define EPWM_BRKCTL2_3_BRKAODD_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAODD_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAODD Mask */ - -#define EPWM_BRKCTL2_3_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL2_3: EADCEBEN Position */ -#define EPWM_BRKCTL2_3_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADCEBEN Mask */ - -#define EPWM_BRKCTL2_3_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL2_3: EADCLBEN Position */ -#define EPWM_BRKCTL2_3_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADCLBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL4_5: CPO0EBEN Position */ -#define EPWM_BRKCTL4_5_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO0EBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL4_5: CPO1EBEN Position */ -#define EPWM_BRKCTL4_5_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO1EBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Position */ -#define EPWM_BRKCTL4_5_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Position */ -#define EPWM_BRKCTL4_5_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Mask */ - -#define EPWM_BRKCTL4_5_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Position */ -#define EPWM_BRKCTL4_5_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL4_5: CPO0LBEN Position */ -#define EPWM_BRKCTL4_5_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO0LBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL4_5: CPO1LBEN Position */ -#define EPWM_BRKCTL4_5_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO1LBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Position */ -#define EPWM_BRKCTL4_5_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Position */ -#define EPWM_BRKCTL4_5_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Mask */ - -#define EPWM_BRKCTL4_5_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Position */ -#define EPWM_BRKCTL4_5_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Position */ -#define EPWM_BRKCTL4_5_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL4_5: BRKAODD Position */ -#define EPWM_BRKCTL4_5_BRKAODD_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAODD_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAODD Mask */ - -#define EPWM_BRKCTL4_5_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL4_5: EADCEBEN Position */ -#define EPWM_BRKCTL4_5_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADCEBEN Mask */ - -#define EPWM_BRKCTL4_5_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL4_5: EADCLBEN Position */ -#define EPWM_BRKCTL4_5_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADCLBEN Mask */ - -#define EPWM_POLCTL_PINV0_Pos (0) /*!< EPWM_T::POLCTL: PINV0 Position */ -#define EPWM_POLCTL_PINV0_Msk (0x1ul << EPWM_POLCTL_PINV0_Pos) /*!< EPWM_T::POLCTL: PINV0 Mask */ - -#define EPWM_POLCTL_PINV1_Pos (1) /*!< EPWM_T::POLCTL: PINV1 Position */ -#define EPWM_POLCTL_PINV1_Msk (0x1ul << EPWM_POLCTL_PINV1_Pos) /*!< EPWM_T::POLCTL: PINV1 Mask */ - -#define EPWM_POLCTL_PINV2_Pos (2) /*!< EPWM_T::POLCTL: PINV2 Position */ -#define EPWM_POLCTL_PINV2_Msk (0x1ul << EPWM_POLCTL_PINV2_Pos) /*!< EPWM_T::POLCTL: PINV2 Mask */ - -#define EPWM_POLCTL_PINV3_Pos (3) /*!< EPWM_T::POLCTL: PINV3 Position */ -#define EPWM_POLCTL_PINV3_Msk (0x1ul << EPWM_POLCTL_PINV3_Pos) /*!< EPWM_T::POLCTL: PINV3 Mask */ - -#define EPWM_POLCTL_PINV4_Pos (4) /*!< EPWM_T::POLCTL: PINV4 Position */ -#define EPWM_POLCTL_PINV4_Msk (0x1ul << EPWM_POLCTL_PINV4_Pos) /*!< EPWM_T::POLCTL: PINV4 Mask */ - -#define EPWM_POLCTL_PINV5_Pos (5) /*!< EPWM_T::POLCTL: PINV5 Position */ -#define EPWM_POLCTL_PINV5_Msk (0x1ul << EPWM_POLCTL_PINV5_Pos) /*!< EPWM_T::POLCTL: PINV5 Mask */ - -#define EPWM_POEN_POEN0_Pos (0) /*!< EPWM_T::POEN: POEN0 Position */ -#define EPWM_POEN_POEN0_Msk (0x1ul << EPWM_POEN_POEN0_Pos) /*!< EPWM_T::POEN: POEN0 Mask */ - -#define EPWM_POEN_POEN1_Pos (1) /*!< EPWM_T::POEN: POEN1 Position */ -#define EPWM_POEN_POEN1_Msk (0x1ul << EPWM_POEN_POEN1_Pos) /*!< EPWM_T::POEN: POEN1 Mask */ - -#define EPWM_POEN_POEN2_Pos (2) /*!< EPWM_T::POEN: POEN2 Position */ -#define EPWM_POEN_POEN2_Msk (0x1ul << EPWM_POEN_POEN2_Pos) /*!< EPWM_T::POEN: POEN2 Mask */ - -#define EPWM_POEN_POEN3_Pos (3) /*!< EPWM_T::POEN: POEN3 Position */ -#define EPWM_POEN_POEN3_Msk (0x1ul << EPWM_POEN_POEN3_Pos) /*!< EPWM_T::POEN: POEN3 Mask */ - -#define EPWM_POEN_POEN4_Pos (4) /*!< EPWM_T::POEN: POEN4 Position */ -#define EPWM_POEN_POEN4_Msk (0x1ul << EPWM_POEN_POEN4_Pos) /*!< EPWM_T::POEN: POEN4 Mask */ - -#define EPWM_POEN_POEN5_Pos (5) /*!< EPWM_T::POEN: POEN5 Position */ -#define EPWM_POEN_POEN5_Msk (0x1ul << EPWM_POEN_POEN5_Pos) /*!< EPWM_T::POEN: POEN5 Mask */ - -#define EPWM_SWBRK_BRKETRG0_Pos (0) /*!< EPWM_T::SWBRK: BRKETRG0 Position */ -#define EPWM_SWBRK_BRKETRG0_Msk (0x1ul << EPWM_SWBRK_BRKETRG0_Pos) /*!< EPWM_T::SWBRK: BRKETRG0 Mask */ - -#define EPWM_SWBRK_BRKETRG2_Pos (1) /*!< EPWM_T::SWBRK: BRKETRG2 Position */ -#define EPWM_SWBRK_BRKETRG2_Msk (0x1ul << EPWM_SWBRK_BRKETRG2_Pos) /*!< EPWM_T::SWBRK: BRKETRG2 Mask */ - -#define EPWM_SWBRK_BRKETRG4_Pos (2) /*!< EPWM_T::SWBRK: BRKETRG4 Position */ -#define EPWM_SWBRK_BRKETRG4_Msk (0x1ul << EPWM_SWBRK_BRKETRG4_Pos) /*!< EPWM_T::SWBRK: BRKETRG4 Mask */ - -#define EPWM_SWBRK_BRKLTRG0_Pos (8) /*!< EPWM_T::SWBRK: BRKLTRG0 Position */ -#define EPWM_SWBRK_BRKLTRG0_Msk (0x1ul << EPWM_SWBRK_BRKLTRG0_Pos) /*!< EPWM_T::SWBRK: BRKLTRG0 Mask */ - -#define EPWM_SWBRK_BRKLTRG2_Pos (9) /*!< EPWM_T::SWBRK: BRKLTRG2 Position */ -#define EPWM_SWBRK_BRKLTRG2_Msk (0x1ul << EPWM_SWBRK_BRKLTRG2_Pos) /*!< EPWM_T::SWBRK: BRKLTRG2 Mask */ - -#define EPWM_SWBRK_BRKLTRG4_Pos (10) /*!< EPWM_T::SWBRK: BRKLTRG4 Position */ -#define EPWM_SWBRK_BRKLTRG4_Msk (0x1ul << EPWM_SWBRK_BRKLTRG4_Pos) /*!< EPWM_T::SWBRK: BRKLTRG4 Mask */ - -#define EPWM_INTEN0_ZIEN0_Pos (0) /*!< EPWM_T::INTEN0: ZIEN0 Position */ -#define EPWM_INTEN0_ZIEN0_Msk (0x1ul << EPWM_INTEN0_ZIEN0_Pos) /*!< EPWM_T::INTEN0: ZIEN0 Mask */ - -#define EPWM_INTEN0_ZIEN1_Pos (1) /*!< EPWM_T::INTEN0: ZIEN1 Position */ -#define EPWM_INTEN0_ZIEN1_Msk (0x1ul << EPWM_INTEN0_ZIEN1_Pos) /*!< EPWM_T::INTEN0: ZIEN1 Mask */ - -#define EPWM_INTEN0_ZIEN2_Pos (2) /*!< EPWM_T::INTEN0: ZIEN2 Position */ -#define EPWM_INTEN0_ZIEN2_Msk (0x1ul << EPWM_INTEN0_ZIEN2_Pos) /*!< EPWM_T::INTEN0: ZIEN2 Mask */ - -#define EPWM_INTEN0_ZIEN3_Pos (3) /*!< EPWM_T::INTEN0: ZIEN3 Position */ -#define EPWM_INTEN0_ZIEN3_Msk (0x1ul << EPWM_INTEN0_ZIEN3_Pos) /*!< EPWM_T::INTEN0: ZIEN3 Mask */ - -#define EPWM_INTEN0_ZIEN4_Pos (4) /*!< EPWM_T::INTEN0: ZIEN4 Position */ -#define EPWM_INTEN0_ZIEN4_Msk (0x1ul << EPWM_INTEN0_ZIEN4_Pos) /*!< EPWM_T::INTEN0: ZIEN4 Mask */ - -#define EPWM_INTEN0_ZIEN5_Pos (5) /*!< EPWM_T::INTEN0: ZIEN5 Position */ -#define EPWM_INTEN0_ZIEN5_Msk (0x1ul << EPWM_INTEN0_ZIEN5_Pos) /*!< EPWM_T::INTEN0: ZIEN5 Mask */ - -#define EPWM_INTEN0_PIEN0_Pos (8) /*!< EPWM_T::INTEN0: PIEN0 Position */ -#define EPWM_INTEN0_PIEN0_Msk (0x1ul << EPWM_INTEN0_PIEN0_Pos) /*!< EPWM_T::INTEN0: PIEN0 Mask */ - -#define EPWM_INTEN0_PIEN1_Pos (9) /*!< EPWM_T::INTEN0: PIEN1 Position */ -#define EPWM_INTEN0_PIEN1_Msk (0x1ul << EPWM_INTEN0_PIEN1_Pos) /*!< EPWM_T::INTEN0: PIEN1 Mask */ - -#define EPWM_INTEN0_PIEN2_Pos (10) /*!< EPWM_T::INTEN0: PIEN2 Position */ -#define EPWM_INTEN0_PIEN2_Msk (0x1ul << EPWM_INTEN0_PIEN2_Pos) /*!< EPWM_T::INTEN0: PIEN2 Mask */ - -#define EPWM_INTEN0_PIEN3_Pos (11) /*!< EPWM_T::INTEN0: PIEN3 Position */ -#define EPWM_INTEN0_PIEN3_Msk (0x1ul << EPWM_INTEN0_PIEN3_Pos) /*!< EPWM_T::INTEN0: PIEN3 Mask */ - -#define EPWM_INTEN0_PIEN4_Pos (12) /*!< EPWM_T::INTEN0: PIEN4 Position */ -#define EPWM_INTEN0_PIEN4_Msk (0x1ul << EPWM_INTEN0_PIEN4_Pos) /*!< EPWM_T::INTEN0: PIEN4 Mask */ - -#define EPWM_INTEN0_PIEN5_Pos (13) /*!< EPWM_T::INTEN0: PIEN5 Position */ -#define EPWM_INTEN0_PIEN5_Msk (0x1ul << EPWM_INTEN0_PIEN5_Pos) /*!< EPWM_T::INTEN0: PIEN5 Mask */ - -#define EPWM_INTEN0_CMPUIEN0_Pos (16) /*!< EPWM_T::INTEN0: CMPUIEN0 Position */ -#define EPWM_INTEN0_CMPUIEN0_Msk (0x1ul << EPWM_INTEN0_CMPUIEN0_Pos) /*!< EPWM_T::INTEN0: CMPUIEN0 Mask */ - -#define EPWM_INTEN0_CMPUIEN1_Pos (17) /*!< EPWM_T::INTEN0: CMPUIEN1 Position */ -#define EPWM_INTEN0_CMPUIEN1_Msk (0x1ul << EPWM_INTEN0_CMPUIEN1_Pos) /*!< EPWM_T::INTEN0: CMPUIEN1 Mask */ - -#define EPWM_INTEN0_CMPUIEN2_Pos (18) /*!< EPWM_T::INTEN0: CMPUIEN2 Position */ -#define EPWM_INTEN0_CMPUIEN2_Msk (0x1ul << EPWM_INTEN0_CMPUIEN2_Pos) /*!< EPWM_T::INTEN0: CMPUIEN2 Mask */ - -#define EPWM_INTEN0_CMPUIEN3_Pos (19) /*!< EPWM_T::INTEN0: CMPUIEN3 Position */ -#define EPWM_INTEN0_CMPUIEN3_Msk (0x1ul << EPWM_INTEN0_CMPUIEN3_Pos) /*!< EPWM_T::INTEN0: CMPUIEN3 Mask */ - -#define EPWM_INTEN0_CMPUIEN4_Pos (20) /*!< EPWM_T::INTEN0: CMPUIEN4 Position */ -#define EPWM_INTEN0_CMPUIEN4_Msk (0x1ul << EPWM_INTEN0_CMPUIEN4_Pos) /*!< EPWM_T::INTEN0: CMPUIEN4 Mask */ - -#define EPWM_INTEN0_CMPUIEN5_Pos (21) /*!< EPWM_T::INTEN0: CMPUIEN5 Position */ -#define EPWM_INTEN0_CMPUIEN5_Msk (0x1ul << EPWM_INTEN0_CMPUIEN5_Pos) /*!< EPWM_T::INTEN0: CMPUIEN5 Mask */ - -#define EPWM_INTEN0_CMPDIEN0_Pos (24) /*!< EPWM_T::INTEN0: CMPDIEN0 Position */ -#define EPWM_INTEN0_CMPDIEN0_Msk (0x1ul << EPWM_INTEN0_CMPDIEN0_Pos) /*!< EPWM_T::INTEN0: CMPDIEN0 Mask */ - -#define EPWM_INTEN0_CMPDIEN1_Pos (25) /*!< EPWM_T::INTEN0: CMPDIEN1 Position */ -#define EPWM_INTEN0_CMPDIEN1_Msk (0x1ul << EPWM_INTEN0_CMPDIEN1_Pos) /*!< EPWM_T::INTEN0: CMPDIEN1 Mask */ - -#define EPWM_INTEN0_CMPDIEN2_Pos (26) /*!< EPWM_T::INTEN0: CMPDIEN2 Position */ -#define EPWM_INTEN0_CMPDIEN2_Msk (0x1ul << EPWM_INTEN0_CMPDIEN2_Pos) /*!< EPWM_T::INTEN0: CMPDIEN2 Mask */ - -#define EPWM_INTEN0_CMPDIEN3_Pos (27) /*!< EPWM_T::INTEN0: CMPDIEN3 Position */ -#define EPWM_INTEN0_CMPDIEN3_Msk (0x1ul << EPWM_INTEN0_CMPDIEN3_Pos) /*!< EPWM_T::INTEN0: CMPDIEN3 Mask */ - -#define EPWM_INTEN0_CMPDIEN4_Pos (28) /*!< EPWM_T::INTEN0: CMPDIEN4 Position */ -#define EPWM_INTEN0_CMPDIEN4_Msk (0x1ul << EPWM_INTEN0_CMPDIEN4_Pos) /*!< EPWM_T::INTEN0: CMPDIEN4 Mask */ - -#define EPWM_INTEN0_CMPDIEN5_Pos (29) /*!< EPWM_T::INTEN0: CMPDIEN5 Position */ -#define EPWM_INTEN0_CMPDIEN5_Msk (0x1ul << EPWM_INTEN0_CMPDIEN5_Pos) /*!< EPWM_T::INTEN0: CMPDIEN5 Mask */ - -#define EPWM_INTEN1_BRKEIEN0_1_Pos (0) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Position */ -#define EPWM_INTEN1_BRKEIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKEIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKEIEN2_3_Pos (1) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Position */ -#define EPWM_INTEN1_BRKEIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKEIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKEIEN4_5_Pos (2) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Position */ -#define EPWM_INTEN1_BRKEIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKEIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Mask */ - -#define EPWM_INTEN1_BRKLIEN0_1_Pos (8) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Position */ -#define EPWM_INTEN1_BRKLIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKLIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKLIEN2_3_Pos (9) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Position */ -#define EPWM_INTEN1_BRKLIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKLIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKLIEN4_5_Pos (10) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Position */ -#define EPWM_INTEN1_BRKLIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKLIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Mask */ - -#define EPWM_INTSTS0_ZIF0_Pos (0) /*!< EPWM_T::INTSTS0: ZIF0 Position */ -#define EPWM_INTSTS0_ZIF0_Msk (0x1ul << EPWM_INTSTS0_ZIF0_Pos) /*!< EPWM_T::INTSTS0: ZIF0 Mask */ - -#define EPWM_INTSTS0_ZIF1_Pos (1) /*!< EPWM_T::INTSTS0: ZIF1 Position */ -#define EPWM_INTSTS0_ZIF1_Msk (0x1ul << EPWM_INTSTS0_ZIF1_Pos) /*!< EPWM_T::INTSTS0: ZIF1 Mask */ - -#define EPWM_INTSTS0_ZIF2_Pos (2) /*!< EPWM_T::INTSTS0: ZIF2 Position */ -#define EPWM_INTSTS0_ZIF2_Msk (0x1ul << EPWM_INTSTS0_ZIF2_Pos) /*!< EPWM_T::INTSTS0: ZIF2 Mask */ - -#define EPWM_INTSTS0_ZIF3_Pos (3) /*!< EPWM_T::INTSTS0: ZIF3 Position */ -#define EPWM_INTSTS0_ZIF3_Msk (0x1ul << EPWM_INTSTS0_ZIF3_Pos) /*!< EPWM_T::INTSTS0: ZIF3 Mask */ - -#define EPWM_INTSTS0_ZIF4_Pos (4) /*!< EPWM_T::INTSTS0: ZIF4 Position */ -#define EPWM_INTSTS0_ZIF4_Msk (0x1ul << EPWM_INTSTS0_ZIF4_Pos) /*!< EPWM_T::INTSTS0: ZIF4 Mask */ - -#define EPWM_INTSTS0_ZIF5_Pos (5) /*!< EPWM_T::INTSTS0: ZIF5 Position */ -#define EPWM_INTSTS0_ZIF5_Msk (0x1ul << EPWM_INTSTS0_ZIF5_Pos) /*!< EPWM_T::INTSTS0: ZIF5 Mask */ - -#define EPWM_INTSTS0_PIF0_Pos (8) /*!< EPWM_T::INTSTS0: PIF0 Position */ -#define EPWM_INTSTS0_PIF0_Msk (0x1ul << EPWM_INTSTS0_PIF0_Pos) /*!< EPWM_T::INTSTS0: PIF0 Mask */ - -#define EPWM_INTSTS0_PIF1_Pos (9) /*!< EPWM_T::INTSTS0: PIF1 Position */ -#define EPWM_INTSTS0_PIF1_Msk (0x1ul << EPWM_INTSTS0_PIF1_Pos) /*!< EPWM_T::INTSTS0: PIF1 Mask */ - -#define EPWM_INTSTS0_PIF2_Pos (10) /*!< EPWM_T::INTSTS0: PIF2 Position */ -#define EPWM_INTSTS0_PIF2_Msk (0x1ul << EPWM_INTSTS0_PIF2_Pos) /*!< EPWM_T::INTSTS0: PIF2 Mask */ - -#define EPWM_INTSTS0_PIF3_Pos (11) /*!< EPWM_T::INTSTS0: PIF3 Position */ -#define EPWM_INTSTS0_PIF3_Msk (0x1ul << EPWM_INTSTS0_PIF3_Pos) /*!< EPWM_T::INTSTS0: PIF3 Mask */ - -#define EPWM_INTSTS0_PIF4_Pos (12) /*!< EPWM_T::INTSTS0: PIF4 Position */ -#define EPWM_INTSTS0_PIF4_Msk (0x1ul << EPWM_INTSTS0_PIF4_Pos) /*!< EPWM_T::INTSTS0: PIF4 Mask */ - -#define EPWM_INTSTS0_PIF5_Pos (13) /*!< EPWM_T::INTSTS0: PIF5 Position */ -#define EPWM_INTSTS0_PIF5_Msk (0x1ul << EPWM_INTSTS0_PIF5_Pos) /*!< EPWM_T::INTSTS0: PIF5 Mask */ - -#define EPWM_INTSTS0_CMPUIF0_Pos (16) /*!< EPWM_T::INTSTS0: CMPUIF0 Position */ -#define EPWM_INTSTS0_CMPUIF0_Msk (0x1ul << EPWM_INTSTS0_CMPUIF0_Pos) /*!< EPWM_T::INTSTS0: CMPUIF0 Mask */ - -#define EPWM_INTSTS0_CMPUIF1_Pos (17) /*!< EPWM_T::INTSTS0: CMPUIF1 Position */ -#define EPWM_INTSTS0_CMPUIF1_Msk (0x1ul << EPWM_INTSTS0_CMPUIF1_Pos) /*!< EPWM_T::INTSTS0: CMPUIF1 Mask */ - -#define EPWM_INTSTS0_CMPUIF2_Pos (18) /*!< EPWM_T::INTSTS0: CMPUIF2 Position */ -#define EPWM_INTSTS0_CMPUIF2_Msk (0x1ul << EPWM_INTSTS0_CMPUIF2_Pos) /*!< EPWM_T::INTSTS0: CMPUIF2 Mask */ - -#define EPWM_INTSTS0_CMPUIF3_Pos (19) /*!< EPWM_T::INTSTS0: CMPUIF3 Position */ -#define EPWM_INTSTS0_CMPUIF3_Msk (0x1ul << EPWM_INTSTS0_CMPUIF3_Pos) /*!< EPWM_T::INTSTS0: CMPUIF3 Mask */ - -#define EPWM_INTSTS0_CMPUIF4_Pos (20) /*!< EPWM_T::INTSTS0: CMPUIF4 Position */ -#define EPWM_INTSTS0_CMPUIF4_Msk (0x1ul << EPWM_INTSTS0_CMPUIF4_Pos) /*!< EPWM_T::INTSTS0: CMPUIF4 Mask */ - -#define EPWM_INTSTS0_CMPUIF5_Pos (21) /*!< EPWM_T::INTSTS0: CMPUIF5 Position */ -#define EPWM_INTSTS0_CMPUIF5_Msk (0x1ul << EPWM_INTSTS0_CMPUIF5_Pos) /*!< EPWM_T::INTSTS0: CMPUIF5 Mask */ - -#define EPWM_INTSTS0_CMPDIF0_Pos (24) /*!< EPWM_T::INTSTS0: CMPDIF0 Position */ -#define EPWM_INTSTS0_CMPDIF0_Msk (0x1ul << EPWM_INTSTS0_CMPDIF0_Pos) /*!< EPWM_T::INTSTS0: CMPDIF0 Mask */ - -#define EPWM_INTSTS0_CMPDIF1_Pos (25) /*!< EPWM_T::INTSTS0: CMPDIF1 Position */ -#define EPWM_INTSTS0_CMPDIF1_Msk (0x1ul << EPWM_INTSTS0_CMPDIF1_Pos) /*!< EPWM_T::INTSTS0: CMPDIF1 Mask */ - -#define EPWM_INTSTS0_CMPDIF2_Pos (26) /*!< EPWM_T::INTSTS0: CMPDIF2 Position */ -#define EPWM_INTSTS0_CMPDIF2_Msk (0x1ul << EPWM_INTSTS0_CMPDIF2_Pos) /*!< EPWM_T::INTSTS0: CMPDIF2 Mask */ - -#define EPWM_INTSTS0_CMPDIF3_Pos (27) /*!< EPWM_T::INTSTS0: CMPDIF3 Position */ -#define EPWM_INTSTS0_CMPDIF3_Msk (0x1ul << EPWM_INTSTS0_CMPDIF3_Pos) /*!< EPWM_T::INTSTS0: CMPDIF3 Mask */ - -#define EPWM_INTSTS0_CMPDIF4_Pos (28) /*!< EPWM_T::INTSTS0: CMPDIF4 Position */ -#define EPWM_INTSTS0_CMPDIF4_Msk (0x1ul << EPWM_INTSTS0_CMPDIF4_Pos) /*!< EPWM_T::INTSTS0: CMPDIF4 Mask */ - -#define EPWM_INTSTS0_CMPDIF5_Pos (29) /*!< EPWM_T::INTSTS0: CMPDIF5 Position */ -#define EPWM_INTSTS0_CMPDIF5_Msk (0x1ul << EPWM_INTSTS0_CMPDIF5_Pos) /*!< EPWM_T::INTSTS0: CMPDIF5 Mask */ - -#define EPWM_INTSTS1_BRKEIF0_Pos (0) /*!< EPWM_T::INTSTS1: BRKEIF0 Position */ -#define EPWM_INTSTS1_BRKEIF0_Msk (0x1ul << EPWM_INTSTS1_BRKEIF0_Pos) /*!< EPWM_T::INTSTS1: BRKEIF0 Mask */ - -#define EPWM_INTSTS1_BRKEIF1_Pos (1) /*!< EPWM_T::INTSTS1: BRKEIF1 Position */ -#define EPWM_INTSTS1_BRKEIF1_Msk (0x1ul << EPWM_INTSTS1_BRKEIF1_Pos) /*!< EPWM_T::INTSTS1: BRKEIF1 Mask */ - -#define EPWM_INTSTS1_BRKEIF2_Pos (2) /*!< EPWM_T::INTSTS1: BRKEIF2 Position */ -#define EPWM_INTSTS1_BRKEIF2_Msk (0x1ul << EPWM_INTSTS1_BRKEIF2_Pos) /*!< EPWM_T::INTSTS1: BRKEIF2 Mask */ - -#define EPWM_INTSTS1_BRKEIF3_Pos (3) /*!< EPWM_T::INTSTS1: BRKEIF3 Position */ -#define EPWM_INTSTS1_BRKEIF3_Msk (0x1ul << EPWM_INTSTS1_BRKEIF3_Pos) /*!< EPWM_T::INTSTS1: BRKEIF3 Mask */ - -#define EPWM_INTSTS1_BRKEIF4_Pos (4) /*!< EPWM_T::INTSTS1: BRKEIF4 Position */ -#define EPWM_INTSTS1_BRKEIF4_Msk (0x1ul << EPWM_INTSTS1_BRKEIF4_Pos) /*!< EPWM_T::INTSTS1: BRKEIF4 Mask */ - -#define EPWM_INTSTS1_BRKEIF5_Pos (5) /*!< EPWM_T::INTSTS1: BRKEIF5 Position */ -#define EPWM_INTSTS1_BRKEIF5_Msk (0x1ul << EPWM_INTSTS1_BRKEIF5_Pos) /*!< EPWM_T::INTSTS1: BRKEIF5 Mask */ - -#define EPWM_INTSTS1_BRKLIF0_Pos (8) /*!< EPWM_T::INTSTS1: BRKLIF0 Position */ -#define EPWM_INTSTS1_BRKLIF0_Msk (0x1ul << EPWM_INTSTS1_BRKLIF0_Pos) /*!< EPWM_T::INTSTS1: BRKLIF0 Mask */ - -#define EPWM_INTSTS1_BRKLIF1_Pos (9) /*!< EPWM_T::INTSTS1: BRKLIF1 Position */ -#define EPWM_INTSTS1_BRKLIF1_Msk (0x1ul << EPWM_INTSTS1_BRKLIF1_Pos) /*!< EPWM_T::INTSTS1: BRKLIF1 Mask */ - -#define EPWM_INTSTS1_BRKLIF2_Pos (10) /*!< EPWM_T::INTSTS1: BRKLIF2 Position */ -#define EPWM_INTSTS1_BRKLIF2_Msk (0x1ul << EPWM_INTSTS1_BRKLIF2_Pos) /*!< EPWM_T::INTSTS1: BRKLIF2 Mask */ - -#define EPWM_INTSTS1_BRKLIF3_Pos (11) /*!< EPWM_T::INTSTS1: BRKLIF3 Position */ -#define EPWM_INTSTS1_BRKLIF3_Msk (0x1ul << EPWM_INTSTS1_BRKLIF3_Pos) /*!< EPWM_T::INTSTS1: BRKLIF3 Mask */ - -#define EPWM_INTSTS1_BRKLIF4_Pos (12) /*!< EPWM_T::INTSTS1: BRKLIF4 Position */ -#define EPWM_INTSTS1_BRKLIF4_Msk (0x1ul << EPWM_INTSTS1_BRKLIF4_Pos) /*!< EPWM_T::INTSTS1: BRKLIF4 Mask */ - -#define EPWM_INTSTS1_BRKLIF5_Pos (13) /*!< EPWM_T::INTSTS1: BRKLIF5 Position */ -#define EPWM_INTSTS1_BRKLIF5_Msk (0x1ul << EPWM_INTSTS1_BRKLIF5_Pos) /*!< EPWM_T::INTSTS1: BRKLIF5 Mask */ - -#define EPWM_INTSTS1_BRKESTS0_Pos (16) /*!< EPWM_T::INTSTS1: BRKESTS0 Position */ -#define EPWM_INTSTS1_BRKESTS0_Msk (0x1ul << EPWM_INTSTS1_BRKESTS0_Pos) /*!< EPWM_T::INTSTS1: BRKESTS0 Mask */ - -#define EPWM_INTSTS1_BRKESTS1_Pos (17) /*!< EPWM_T::INTSTS1: BRKESTS1 Position */ -#define EPWM_INTSTS1_BRKESTS1_Msk (0x1ul << EPWM_INTSTS1_BRKESTS1_Pos) /*!< EPWM_T::INTSTS1: BRKESTS1 Mask */ - -#define EPWM_INTSTS1_BRKESTS2_Pos (18) /*!< EPWM_T::INTSTS1: BRKESTS2 Position */ -#define EPWM_INTSTS1_BRKESTS2_Msk (0x1ul << EPWM_INTSTS1_BRKESTS2_Pos) /*!< EPWM_T::INTSTS1: BRKESTS2 Mask */ - -#define EPWM_INTSTS1_BRKESTS3_Pos (19) /*!< EPWM_T::INTSTS1: BRKESTS3 Position */ -#define EPWM_INTSTS1_BRKESTS3_Msk (0x1ul << EPWM_INTSTS1_BRKESTS3_Pos) /*!< EPWM_T::INTSTS1: BRKESTS3 Mask */ - -#define EPWM_INTSTS1_BRKESTS4_Pos (20) /*!< EPWM_T::INTSTS1: BRKESTS4 Position */ -#define EPWM_INTSTS1_BRKESTS4_Msk (0x1ul << EPWM_INTSTS1_BRKESTS4_Pos) /*!< EPWM_T::INTSTS1: BRKESTS4 Mask */ - -#define EPWM_INTSTS1_BRKESTS5_Pos (21) /*!< EPWM_T::INTSTS1: BRKESTS5 Position */ -#define EPWM_INTSTS1_BRKESTS5_Msk (0x1ul << EPWM_INTSTS1_BRKESTS5_Pos) /*!< EPWM_T::INTSTS1: BRKESTS5 Mask */ - -#define EPWM_INTSTS1_BRKLSTS0_Pos (24) /*!< EPWM_T::INTSTS1: BRKLSTS0 Position */ -#define EPWM_INTSTS1_BRKLSTS0_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS0_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS0 Mask */ - -#define EPWM_INTSTS1_BRKLSTS1_Pos (25) /*!< EPWM_T::INTSTS1: BRKLSTS1 Position */ -#define EPWM_INTSTS1_BRKLSTS1_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS1_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS1 Mask */ - -#define EPWM_INTSTS1_BRKLSTS2_Pos (26) /*!< EPWM_T::INTSTS1: BRKLSTS2 Position */ -#define EPWM_INTSTS1_BRKLSTS2_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS2_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS2 Mask */ - -#define EPWM_INTSTS1_BRKLSTS3_Pos (27) /*!< EPWM_T::INTSTS1: BRKLSTS3 Position */ -#define EPWM_INTSTS1_BRKLSTS3_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS3_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS3 Mask */ - -#define EPWM_INTSTS1_BRKLSTS4_Pos (28) /*!< EPWM_T::INTSTS1: BRKLSTS4 Position */ -#define EPWM_INTSTS1_BRKLSTS4_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS4_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS4 Mask */ - -#define EPWM_INTSTS1_BRKLSTS5_Pos (29) /*!< EPWM_T::INTSTS1: BRKLSTS5 Position */ -#define EPWM_INTSTS1_BRKLSTS5_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS5_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS5 Mask */ - -#define EPWM_DACTRGEN_ZTE0_Pos (0) /*!< EPWM_T::DACTRGEN: ZTE0 Position */ -#define EPWM_DACTRGEN_ZTE0_Msk (0x1ul << EPWM_DACTRGEN_ZTE0_Pos) /*!< EPWM_T::DACTRGEN: ZTE0 Mask */ - -#define EPWM_DACTRGEN_ZTE1_Pos (1) /*!< EPWM_T::DACTRGEN: ZTE1 Position */ -#define EPWM_DACTRGEN_ZTE1_Msk (0x1ul << EPWM_DACTRGEN_ZTE1_Pos) /*!< EPWM_T::DACTRGEN: ZTE1 Mask */ - -#define EPWM_DACTRGEN_ZTE2_Pos (2) /*!< EPWM_T::DACTRGEN: ZTE2 Position */ -#define EPWM_DACTRGEN_ZTE2_Msk (0x1ul << EPWM_DACTRGEN_ZTE2_Pos) /*!< EPWM_T::DACTRGEN: ZTE2 Mask */ - -#define EPWM_DACTRGEN_ZTE3_Pos (3) /*!< EPWM_T::DACTRGEN: ZTE3 Position */ -#define EPWM_DACTRGEN_ZTE3_Msk (0x1ul << EPWM_DACTRGEN_ZTE3_Pos) /*!< EPWM_T::DACTRGEN: ZTE3 Mask */ - -#define EPWM_DACTRGEN_ZTE4_Pos (4) /*!< EPWM_T::DACTRGEN: ZTE4 Position */ -#define EPWM_DACTRGEN_ZTE4_Msk (0x1ul << EPWM_DACTRGEN_ZTE4_Pos) /*!< EPWM_T::DACTRGEN: ZTE4 Mask */ - -#define EPWM_DACTRGEN_ZTE5_Pos (5) /*!< EPWM_T::DACTRGEN: ZTE5 Position */ -#define EPWM_DACTRGEN_ZTE5_Msk (0x1ul << EPWM_DACTRGEN_ZTE5_Pos) /*!< EPWM_T::DACTRGEN: ZTE5 Mask */ - -#define EPWM_DACTRGEN_PTE0_Pos (8) /*!< EPWM_T::DACTRGEN: PTE0 Position */ -#define EPWM_DACTRGEN_PTE0_Msk (0x1ul << EPWM_DACTRGEN_PTE0_Pos) /*!< EPWM_T::DACTRGEN: PTE0 Mask */ - -#define EPWM_DACTRGEN_PTE1_Pos (9) /*!< EPWM_T::DACTRGEN: PTE1 Position */ -#define EPWM_DACTRGEN_PTE1_Msk (0x1ul << EPWM_DACTRGEN_PTE1_Pos) /*!< EPWM_T::DACTRGEN: PTE1 Mask */ - -#define EPWM_DACTRGEN_PTE2_Pos (10) /*!< EPWM_T::DACTRGEN: PTE2 Position */ -#define EPWM_DACTRGEN_PTE2_Msk (0x1ul << EPWM_DACTRGEN_PTE2_Pos) /*!< EPWM_T::DACTRGEN: PTE2 Mask */ - -#define EPWM_DACTRGEN_PTE3_Pos (11) /*!< EPWM_T::DACTRGEN: PTE3 Position */ -#define EPWM_DACTRGEN_PTE3_Msk (0x1ul << EPWM_DACTRGEN_PTE3_Pos) /*!< EPWM_T::DACTRGEN: PTE3 Mask */ - -#define EPWM_DACTRGEN_PTE4_Pos (12) /*!< EPWM_T::DACTRGEN: PTE4 Position */ -#define EPWM_DACTRGEN_PTE4_Msk (0x1ul << EPWM_DACTRGEN_PTE4_Pos) /*!< EPWM_T::DACTRGEN: PTE4 Mask */ - -#define EPWM_DACTRGEN_PTE5_Pos (13) /*!< EPWM_T::DACTRGEN: PTE5 Position */ -#define EPWM_DACTRGEN_PTE5_Msk (0x1ul << EPWM_DACTRGEN_PTE5_Pos) /*!< EPWM_T::DACTRGEN: PTE5 Mask */ - -#define EPWM_DACTRGEN_CUTRGE0_Pos (16) /*!< EPWM_T::DACTRGEN: CUTRGE0 Position */ -#define EPWM_DACTRGEN_CUTRGE0_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE0_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE0 Mask */ - -#define EPWM_DACTRGEN_CUTRGE1_Pos (17) /*!< EPWM_T::DACTRGEN: CUTRGE1 Position */ -#define EPWM_DACTRGEN_CUTRGE1_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE1_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE1 Mask */ - -#define EPWM_DACTRGEN_CUTRGE2_Pos (18) /*!< EPWM_T::DACTRGEN: CUTRGE2 Position */ -#define EPWM_DACTRGEN_CUTRGE2_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE2_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE2 Mask */ - -#define EPWM_DACTRGEN_CUTRGE3_Pos (19) /*!< EPWM_T::DACTRGEN: CUTRGE3 Position */ -#define EPWM_DACTRGEN_CUTRGE3_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE3_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE3 Mask */ - -#define EPWM_DACTRGEN_CUTRGE4_Pos (20) /*!< EPWM_T::DACTRGEN: CUTRGE4 Position */ -#define EPWM_DACTRGEN_CUTRGE4_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE4_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE4 Mask */ - -#define EPWM_DACTRGEN_CUTRGE5_Pos (21) /*!< EPWM_T::DACTRGEN: CUTRGE5 Position */ -#define EPWM_DACTRGEN_CUTRGE5_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE5_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE5 Mask */ - -#define EPWM_DACTRGEN_CDTRGE0_Pos (24) /*!< EPWM_T::DACTRGEN: CDTRGE0 Position */ -#define EPWM_DACTRGEN_CDTRGE0_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE0_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE0 Mask */ - -#define EPWM_DACTRGEN_CDTRGE1_Pos (25) /*!< EPWM_T::DACTRGEN: CDTRGE1 Position */ -#define EPWM_DACTRGEN_CDTRGE1_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE1_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE1 Mask */ - -#define EPWM_DACTRGEN_CDTRGE2_Pos (26) /*!< EPWM_T::DACTRGEN: CDTRGE2 Position */ -#define EPWM_DACTRGEN_CDTRGE2_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE2_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE2 Mask */ - -#define EPWM_DACTRGEN_CDTRGE3_Pos (27) /*!< EPWM_T::DACTRGEN: CDTRGE3 Position */ -#define EPWM_DACTRGEN_CDTRGE3_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE3_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE3 Mask */ - -#define EPWM_DACTRGEN_CDTRGE4_Pos (28) /*!< EPWM_T::DACTRGEN: CDTRGE4 Position */ -#define EPWM_DACTRGEN_CDTRGE4_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE4_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE4 Mask */ - -#define EPWM_DACTRGEN_CDTRGE5_Pos (29) /*!< EPWM_T::DACTRGEN: CDTRGE5 Position */ -#define EPWM_DACTRGEN_CDTRGE5_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE5_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE5 Mask */ - -#define EPWM_EADCTS0_TRGSEL0_Pos (0) /*!< EPWM_T::EADCTS0: TRGSEL0 Position */ -#define EPWM_EADCTS0_TRGSEL0_Msk (0xful << EPWM_EADCTS0_TRGSEL0_Pos) /*!< EPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define EPWM_EADCTS0_TRGEN0_Pos (7) /*!< EPWM_T::EADCTS0: TRGEN0 Position */ -#define EPWM_EADCTS0_TRGEN0_Msk (0x1ul << EPWM_EADCTS0_TRGEN0_Pos) /*!< EPWM_T::EADCTS0: TRGEN0 Mask */ - -#define EPWM_EADCTS0_TRGSEL1_Pos (8) /*!< EPWM_T::EADCTS0: TRGSEL1 Position */ -#define EPWM_EADCTS0_TRGSEL1_Msk (0xful << EPWM_EADCTS0_TRGSEL1_Pos) /*!< EPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define EPWM_EADCTS0_TRGEN1_Pos (15) /*!< EPWM_T::EADCTS0: TRGEN1 Position */ -#define EPWM_EADCTS0_TRGEN1_Msk (0x1ul << EPWM_EADCTS0_TRGEN1_Pos) /*!< EPWM_T::EADCTS0: TRGEN1 Mask */ - -#define EPWM_EADCTS0_TRGSEL2_Pos (16) /*!< EPWM_T::EADCTS0: TRGSEL2 Position */ -#define EPWM_EADCTS0_TRGSEL2_Msk (0xful << EPWM_EADCTS0_TRGSEL2_Pos) /*!< EPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define EPWM_EADCTS0_TRGEN2_Pos (23) /*!< EPWM_T::EADCTS0: TRGEN2 Position */ -#define EPWM_EADCTS0_TRGEN2_Msk (0x1ul << EPWM_EADCTS0_TRGEN2_Pos) /*!< EPWM_T::EADCTS0: TRGEN2 Mask */ - -#define EPWM_EADCTS0_TRGSEL3_Pos (24) /*!< EPWM_T::EADCTS0: TRGSEL3 Position */ -#define EPWM_EADCTS0_TRGSEL3_Msk (0xful << EPWM_EADCTS0_TRGSEL3_Pos) /*!< EPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define EPWM_EADCTS0_TRGEN3_Pos (31) /*!< EPWM_T::EADCTS0: TRGEN3 Position */ -#define EPWM_EADCTS0_TRGEN3_Msk (0x1ul << EPWM_EADCTS0_TRGEN3_Pos) /*!< EPWM_T::EADCTS0: TRGEN3 Mask */ - -#define EPWM_EADCTS1_TRGSEL4_Pos (0) /*!< EPWM_T::EADCTS1: TRGSEL4 Position */ -#define EPWM_EADCTS1_TRGSEL4_Msk (0xful << EPWM_EADCTS1_TRGSEL4_Pos) /*!< EPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define EPWM_EADCTS1_TRGEN4_Pos (7) /*!< EPWM_T::EADCTS1: TRGEN4 Position */ -#define EPWM_EADCTS1_TRGEN4_Msk (0x1ul << EPWM_EADCTS1_TRGEN4_Pos) /*!< EPWM_T::EADCTS1: TRGEN4 Mask */ - -#define EPWM_EADCTS1_TRGSEL5_Pos (8) /*!< EPWM_T::EADCTS1: TRGSEL5 Position */ -#define EPWM_EADCTS1_TRGSEL5_Msk (0xful << EPWM_EADCTS1_TRGSEL5_Pos) /*!< EPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define EPWM_EADCTS1_TRGEN5_Pos (15) /*!< EPWM_T::EADCTS1: TRGEN5 Position */ -#define EPWM_EADCTS1_TRGEN5_Msk (0x1ul << EPWM_EADCTS1_TRGEN5_Pos) /*!< EPWM_T::EADCTS1: TRGEN5 Mask */ - -#define EPWM_FTCMPDAT0_1_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Position */ -#define EPWM_FTCMPDAT0_1_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT0_1_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Mask */ - -#define EPWM_FTCMPDAT2_3_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Position */ -#define EPWM_FTCMPDAT2_3_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT2_3_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Mask */ - -#define EPWM_FTCMPDAT4_5_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Position */ -#define EPWM_FTCMPDAT4_5_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT4_5_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Mask */ - -#define EPWM_SSCTL_SSEN0_Pos (0) /*!< EPWM_T::SSCTL: SSEN0 Position */ -#define EPWM_SSCTL_SSEN0_Msk (0x1ul << EPWM_SSCTL_SSEN0_Pos) /*!< EPWM_T::SSCTL: SSEN0 Mask */ - -#define EPWM_SSCTL_SSEN1_Pos (1) /*!< EPWM_T::SSCTL: SSEN1 Position */ -#define EPWM_SSCTL_SSEN1_Msk (0x1ul << EPWM_SSCTL_SSEN1_Pos) /*!< EPWM_T::SSCTL: SSEN1 Mask */ - -#define EPWM_SSCTL_SSEN2_Pos (2) /*!< EPWM_T::SSCTL: SSEN2 Position */ -#define EPWM_SSCTL_SSEN2_Msk (0x1ul << EPWM_SSCTL_SSEN2_Pos) /*!< EPWM_T::SSCTL: SSEN2 Mask */ - -#define EPWM_SSCTL_SSEN3_Pos (3) /*!< EPWM_T::SSCTL: SSEN3 Position */ -#define EPWM_SSCTL_SSEN3_Msk (0x1ul << EPWM_SSCTL_SSEN3_Pos) /*!< EPWM_T::SSCTL: SSEN3 Mask */ - -#define EPWM_SSCTL_SSEN4_Pos (4) /*!< EPWM_T::SSCTL: SSEN4 Position */ -#define EPWM_SSCTL_SSEN4_Msk (0x1ul << EPWM_SSCTL_SSEN4_Pos) /*!< EPWM_T::SSCTL: SSEN4 Mask */ - -#define EPWM_SSCTL_SSEN5_Pos (5) /*!< EPWM_T::SSCTL: SSEN5 Position */ -#define EPWM_SSCTL_SSEN5_Msk (0x1ul << EPWM_SSCTL_SSEN5_Pos) /*!< EPWM_T::SSCTL: SSEN5 Mask */ - -#define EPWM_SSCTL_SSRC_Pos (8) /*!< EPWM_T::SSCTL: SSRC Position */ -#define EPWM_SSCTL_SSRC_Msk (0x3ul << EPWM_SSCTL_SSRC_Pos) /*!< EPWM_T::SSCTL: SSRC Mask */ - -#define EPWM_SSTRG_CNTSEN_Pos (0) /*!< EPWM_T::SSTRG: CNTSEN Position */ -#define EPWM_SSTRG_CNTSEN_Msk (0x1ul << EPWM_SSTRG_CNTSEN_Pos) /*!< EPWM_T::SSTRG: CNTSEN Mask */ - -#define EPWM_LEBCTL_LEBEN_Pos (0) /*!< EPWM_T::LEBCTL: LEBEN Position */ -#define EPWM_LEBCTL_LEBEN_Msk (0x1ul << EPWM_LEBCTL_LEBEN_Pos) /*!< EPWM_T::LEBCTL: LEBEN Mask */ - -#define EPWM_LEBCTL_SRCEN0_Pos (8) /*!< EPWM_T::LEBCTL: SRCEN0 Position */ -#define EPWM_LEBCTL_SRCEN0_Msk (0x1ul << EPWM_LEBCTL_SRCEN0_Pos) /*!< EPWM_T::LEBCTL: SRCEN0 Mask */ - -#define EPWM_LEBCTL_SRCEN2_Pos (9) /*!< EPWM_T::LEBCTL: SRCEN2 Position */ -#define EPWM_LEBCTL_SRCEN2_Msk (0x1ul << EPWM_LEBCTL_SRCEN2_Pos) /*!< EPWM_T::LEBCTL: SRCEN2 Mask */ - -#define EPWM_LEBCTL_SRCEN4_Pos (10) /*!< EPWM_T::LEBCTL: SRCEN4 Position */ -#define EPWM_LEBCTL_SRCEN4_Msk (0x1ul << EPWM_LEBCTL_SRCEN4_Pos) /*!< EPWM_T::LEBCTL: SRCEN4 Mask */ - -#define EPWM_LEBCTL_TRGTYPE_Pos (16) /*!< EPWM_T::LEBCTL: TRGTYPE Position */ -#define EPWM_LEBCTL_TRGTYPE_Msk (0x3ul << EPWM_LEBCTL_TRGTYPE_Pos) /*!< EPWM_T::LEBCTL: TRGTYPE Mask */ - -#define EPWM_LEBCNT_LEBCNT_Pos (0) /*!< EPWM_T::LEBCNT: LEBCNT Position */ -#define EPWM_LEBCNT_LEBCNT_Msk (0x1fful << EPWM_LEBCNT_LEBCNT_Pos) /*!< EPWM_T::LEBCNT: LEBCNT Mask */ - -#define EPWM_STATUS_CNTMAXF0_Pos (0) /*!< EPWM_T::STATUS: CNTMAXF0 Position */ -#define EPWM_STATUS_CNTMAXF0_Msk (0x1ul << EPWM_STATUS_CNTMAXF0_Pos) /*!< EPWM_T::STATUS: CNTMAXF0 Mask */ - -#define EPWM_STATUS_CNTMAXF1_Pos (1) /*!< EPWM_T::STATUS: CNTMAXF1 Position */ -#define EPWM_STATUS_CNTMAXF1_Msk (0x1ul << EPWM_STATUS_CNTMAXF1_Pos) /*!< EPWM_T::STATUS: CNTMAXF1 Mask */ - -#define EPWM_STATUS_CNTMAXF2_Pos (2) /*!< EPWM_T::STATUS: CNTMAXF2 Position */ -#define EPWM_STATUS_CNTMAXF2_Msk (0x1ul << EPWM_STATUS_CNTMAXF2_Pos) /*!< EPWM_T::STATUS: CNTMAXF2 Mask */ - -#define EPWM_STATUS_CNTMAXF3_Pos (3) /*!< EPWM_T::STATUS: CNTMAXF3 Position */ -#define EPWM_STATUS_CNTMAXF3_Msk (0x1ul << EPWM_STATUS_CNTMAXF3_Pos) /*!< EPWM_T::STATUS: CNTMAXF3 Mask */ - -#define EPWM_STATUS_CNTMAXF4_Pos (4) /*!< EPWM_T::STATUS: CNTMAXF4 Position */ -#define EPWM_STATUS_CNTMAXF4_Msk (0x1ul << EPWM_STATUS_CNTMAXF4_Pos) /*!< EPWM_T::STATUS: CNTMAXF4 Mask */ - -#define EPWM_STATUS_CNTMAXF5_Pos (5) /*!< EPWM_T::STATUS: CNTMAXF5 Position */ -#define EPWM_STATUS_CNTMAXF5_Msk (0x1ul << EPWM_STATUS_CNTMAXF5_Pos) /*!< EPWM_T::STATUS: CNTMAXF5 Mask */ - -#define EPWM_STATUS_SYNCINF0_Pos (8) /*!< EPWM_T::STATUS: SYNCINF0 Position */ -#define EPWM_STATUS_SYNCINF0_Msk (0x1ul << EPWM_STATUS_SYNCINF0_Pos) /*!< EPWM_T::STATUS: SYNCINF0 Mask */ - -#define EPWM_STATUS_SYNCINF2_Pos (9) /*!< EPWM_T::STATUS: SYNCINF2 Position */ -#define EPWM_STATUS_SYNCINF2_Msk (0x1ul << EPWM_STATUS_SYNCINF2_Pos) /*!< EPWM_T::STATUS: SYNCINF2 Mask */ - -#define EPWM_STATUS_SYNCINF4_Pos (10) /*!< EPWM_T::STATUS: SYNCINF4 Position */ -#define EPWM_STATUS_SYNCINF4_Msk (0x1ul << EPWM_STATUS_SYNCINF4_Pos) /*!< EPWM_T::STATUS: SYNCINF4 Mask */ - -#define EPWM_STATUS_EADCTRGF0_Pos (16) /*!< EPWM_T::STATUS: EADCTRGF0 Position */ -#define EPWM_STATUS_EADCTRGF0_Msk (0x1ul << EPWM_STATUS_EADCTRGF0_Pos) /*!< EPWM_T::STATUS: EADCTRGF0 Mask */ - -#define EPWM_STATUS_EADCTRGF1_Pos (17) /*!< EPWM_T::STATUS: EADCTRGF1 Position */ -#define EPWM_STATUS_EADCTRGF1_Msk (0x1ul << EPWM_STATUS_EADCTRGF1_Pos) /*!< EPWM_T::STATUS: EADCTRGF1 Mask */ - -#define EPWM_STATUS_EADCTRGF2_Pos (18) /*!< EPWM_T::STATUS: EADCTRGF2 Position */ -#define EPWM_STATUS_EADCTRGF2_Msk (0x1ul << EPWM_STATUS_EADCTRGF2_Pos) /*!< EPWM_T::STATUS: EADCTRGF2 Mask */ - -#define EPWM_STATUS_EADCTRGF3_Pos (19) /*!< EPWM_T::STATUS: EADCTRGF3 Position */ -#define EPWM_STATUS_EADCTRGF3_Msk (0x1ul << EPWM_STATUS_EADCTRGF3_Pos) /*!< EPWM_T::STATUS: EADCTRGF3 Mask */ - -#define EPWM_STATUS_EADCTRGF4_Pos (20) /*!< EPWM_T::STATUS: EADCTRGF4 Position */ -#define EPWM_STATUS_EADCTRGF4_Msk (0x1ul << EPWM_STATUS_EADCTRGF4_Pos) /*!< EPWM_T::STATUS: EADCTRGF4 Mask */ - -#define EPWM_STATUS_EADCTRGF5_Pos (21) /*!< EPWM_T::STATUS: EADCTRGF5 Position */ -#define EPWM_STATUS_EADCTRGF5_Msk (0x1ul << EPWM_STATUS_EADCTRGF5_Pos) /*!< EPWM_T::STATUS: EADCTRGF5 Mask */ - -#define EPWM_STATUS_DACTRGF_Pos (24) /*!< EPWM_T::STATUS: DACTRGF Position */ -#define EPWM_STATUS_DACTRGF_Msk (0x1ul << EPWM_STATUS_DACTRGF_Pos) /*!< EPWM_T::STATUS: DACTRGF Mask */ - -#define EPWM_IFA0_IFACNT_Pos (0) /*!< EPWM_T::IFA0: IFACNT Position */ -#define EPWM_IFA0_IFACNT_Msk (0xfffful << EPWM_IFA0_IFACNT_Pos) /*!< EPWM_T::IFA0: IFACNT Mask */ - -#define EPWM_IFA0_STPMOD_Pos (24) /*!< EPWM_T::IFA0: STPMOD Position */ -#define EPWM_IFA0_STPMOD_Msk (0x1ul << EPWM_IFA0_STPMOD_Pos) /*!< EPWM_T::IFA0: STPMOD Mask */ - -#define EPWM_IFA0_IFASEL_Pos (28) /*!< EPWM_T::IFA0: IFASEL Position */ -#define EPWM_IFA0_IFASEL_Msk (0x3ul << EPWM_IFA0_IFASEL_Pos) /*!< EPWM_T::IFA0: IFASEL Mask */ - -#define EPWM_IFA0_IFAEN_Pos (31) /*!< EPWM_T::IFA0: IFAEN Position */ -#define EPWM_IFA0_IFAEN_Msk (0x1ul << EPWM_IFA0_IFAEN_Pos) /*!< EPWM_T::IFA0: IFAEN Mask */ - -#define EPWM_IFA1_IFACNT_Pos (0) /*!< EPWM_T::IFA1: IFACNT Position */ -#define EPWM_IFA1_IFACNT_Msk (0xfffful << EPWM_IFA1_IFACNT_Pos) /*!< EPWM_T::IFA1: IFACNT Mask */ - -#define EPWM_IFA1_STPMOD_Pos (24) /*!< EPWM_T::IFA1: STPMOD Position */ -#define EPWM_IFA1_STPMOD_Msk (0x1ul << EPWM_IFA1_STPMOD_Pos) /*!< EPWM_T::IFA1: STPMOD Mask */ - -#define EPWM_IFA1_IFASEL_Pos (28) /*!< EPWM_T::IFA1: IFASEL Position */ -#define EPWM_IFA1_IFASEL_Msk (0x3ul << EPWM_IFA1_IFASEL_Pos) /*!< EPWM_T::IFA1: IFASEL Mask */ - -#define EPWM_IFA1_IFAEN_Pos (31) /*!< EPWM_T::IFA1: IFAEN Position */ -#define EPWM_IFA1_IFAEN_Msk (0x1ul << EPWM_IFA1_IFAEN_Pos) /*!< EPWM_T::IFA1: IFAEN Mask */ - -#define EPWM_IFA2_IFACNT_Pos (0) /*!< EPWM_T::IFA2: IFACNT Position */ -#define EPWM_IFA2_IFACNT_Msk (0xfffful << EPWM_IFA2_IFACNT_Pos) /*!< EPWM_T::IFA2: IFACNT Mask */ - -#define EPWM_IFA2_STPMOD_Pos (24) /*!< EPWM_T::IFA2: STPMOD Position */ -#define EPWM_IFA2_STPMOD_Msk (0x1ul << EPWM_IFA2_STPMOD_Pos) /*!< EPWM_T::IFA2: STPMOD Mask */ - -#define EPWM_IFA2_IFASEL_Pos (28) /*!< EPWM_T::IFA2: IFASEL Position */ -#define EPWM_IFA2_IFASEL_Msk (0x3ul << EPWM_IFA2_IFASEL_Pos) /*!< EPWM_T::IFA2: IFASEL Mask */ - -#define EPWM_IFA2_IFAEN_Pos (31) /*!< EPWM_T::IFA2: IFAEN Position */ -#define EPWM_IFA2_IFAEN_Msk (0x1ul << EPWM_IFA2_IFAEN_Pos) /*!< EPWM_T::IFA2: IFAEN Mask */ - -#define EPWM_IFA3_IFACNT_Pos (0) /*!< EPWM_T::IFA3: IFACNT Position */ -#define EPWM_IFA3_IFACNT_Msk (0xfffful << EPWM_IFA3_IFACNT_Pos) /*!< EPWM_T::IFA3: IFACNT Mask */ - -#define EPWM_IFA3_STPMOD_Pos (24) /*!< EPWM_T::IFA3: STPMOD Position */ -#define EPWM_IFA3_STPMOD_Msk (0x1ul << EPWM_IFA3_STPMOD_Pos) /*!< EPWM_T::IFA3: STPMOD Mask */ - -#define EPWM_IFA3_IFASEL_Pos (28) /*!< EPWM_T::IFA3: IFASEL Position */ -#define EPWM_IFA3_IFASEL_Msk (0x3ul << EPWM_IFA3_IFASEL_Pos) /*!< EPWM_T::IFA3: IFASEL Mask */ - -#define EPWM_IFA3_IFAEN_Pos (31) /*!< EPWM_T::IFA3: IFAEN Position */ -#define EPWM_IFA3_IFAEN_Msk (0x1ul << EPWM_IFA3_IFAEN_Pos) /*!< EPWM_T::IFA3: IFAEN Mask */ - -#define EPWM_IFA4_IFACNT_Pos (0) /*!< EPWM_T::IFA4: IFACNT Position */ -#define EPWM_IFA4_IFACNT_Msk (0xfffful << EPWM_IFA4_IFACNT_Pos) /*!< EPWM_T::IFA4: IFACNT Mask */ - -#define EPWM_IFA4_STPMOD_Pos (24) /*!< EPWM_T::IFA4: STPMOD Position */ -#define EPWM_IFA4_STPMOD_Msk (0x1ul << EPWM_IFA4_STPMOD_Pos) /*!< EPWM_T::IFA4: STPMOD Mask */ - -#define EPWM_IFA4_IFASEL_Pos (28) /*!< EPWM_T::IFA4: IFASEL Position */ -#define EPWM_IFA4_IFASEL_Msk (0x3ul << EPWM_IFA4_IFASEL_Pos) /*!< EPWM_T::IFA4: IFASEL Mask */ - -#define EPWM_IFA4_IFAEN_Pos (31) /*!< EPWM_T::IFA4: IFAEN Position */ -#define EPWM_IFA4_IFAEN_Msk (0x1ul << EPWM_IFA4_IFAEN_Pos) /*!< EPWM_T::IFA4: IFAEN Mask */ - -#define EPWM_IFA5_IFACNT_Pos (0) /*!< EPWM_T::IFA5: IFACNT Position */ -#define EPWM_IFA5_IFACNT_Msk (0xfffful << EPWM_IFA5_IFACNT_Pos) /*!< EPWM_T::IFA5: IFACNT Mask */ - -#define EPWM_IFA5_STPMOD_Pos (24) /*!< EPWM_T::IFA5: STPMOD Position */ -#define EPWM_IFA5_STPMOD_Msk (0x1ul << EPWM_IFA5_STPMOD_Pos) /*!< EPWM_T::IFA5: STPMOD Mask */ - -#define EPWM_IFA5_IFASEL_Pos (28) /*!< EPWM_T::IFA5: IFASEL Position */ -#define EPWM_IFA5_IFASEL_Msk (0x3ul << EPWM_IFA5_IFASEL_Pos) /*!< EPWM_T::IFA5: IFASEL Mask */ - -#define EPWM_IFA5_IFAEN_Pos (31) /*!< EPWM_T::IFA5: IFAEN Position */ -#define EPWM_IFA5_IFAEN_Msk (0x1ul << EPWM_IFA5_IFAEN_Pos) /*!< EPWM_T::IFA5: IFAEN Mask */ - -#define EPWM_AINTSTS_IFAIF0_Pos (0) /*!< EPWM_T::AINTSTS: IFAIF0 Position */ -#define EPWM_AINTSTS_IFAIF0_Msk (0x1ul << EPWM_AINTSTS_IFAIF0_Pos) /*!< EPWM_T::AINTSTS: IFAIF0 Mask */ - -#define EPWM_AINTSTS_IFAIF1_Pos (1) /*!< EPWM_T::AINTSTS: IFAIF1 Position */ -#define EPWM_AINTSTS_IFAIF1_Msk (0x1ul << EPWM_AINTSTS_IFAIF1_Pos) /*!< EPWM_T::AINTSTS: IFAIF1 Mask */ - -#define EPWM_AINTSTS_IFAIF2_Pos (2) /*!< EPWM_T::AINTSTS: IFAIF2 Position */ -#define EPWM_AINTSTS_IFAIF2_Msk (0x1ul << EPWM_AINTSTS_IFAIF2_Pos) /*!< EPWM_T::AINTSTS: IFAIF2 Mask */ - -#define EPWM_AINTSTS_IFAIF3_Pos (3) /*!< EPWM_T::AINTSTS: IFAIF3 Position */ -#define EPWM_AINTSTS_IFAIF3_Msk (0x1ul << EPWM_AINTSTS_IFAIF3_Pos) /*!< EPWM_T::AINTSTS: IFAIF3 Mask */ - -#define EPWM_AINTSTS_IFAIF4_Pos (4) /*!< EPWM_T::AINTSTS: IFAIF4 Position */ -#define EPWM_AINTSTS_IFAIF4_Msk (0x1ul << EPWM_AINTSTS_IFAIF4_Pos) /*!< EPWM_T::AINTSTS: IFAIF4 Mask */ - -#define EPWM_AINTSTS_IFAIF5_Pos (5) /*!< EPWM_T::AINTSTS: IFAIF5 Position */ -#define EPWM_AINTSTS_IFAIF5_Msk (0x1ul << EPWM_AINTSTS_IFAIF5_Pos) /*!< EPWM_T::AINTSTS: IFAIF5 Mask */ - -#define EPWM_AINTEN_IFAIEN0_Pos (0) /*!< EPWM_T::AINTEN: IFAIEN0 Position */ -#define EPWM_AINTEN_IFAIEN0_Msk (0x1ul << EPWM_AINTEN_IFAIEN0_Pos) /*!< EPWM_T::AINTEN: IFAIEN0 Mask */ - -#define EPWM_AINTEN_IFAIEN1_Pos (1) /*!< EPWM_T::AINTEN: IFAIEN1 Position */ -#define EPWM_AINTEN_IFAIEN1_Msk (0x1ul << EPWM_AINTEN_IFAIEN1_Pos) /*!< EPWM_T::AINTEN: IFAIEN1 Mask */ - -#define EPWM_AINTEN_IFAIEN2_Pos (2) /*!< EPWM_T::AINTEN: IFAIEN2 Position */ -#define EPWM_AINTEN_IFAIEN2_Msk (0x1ul << EPWM_AINTEN_IFAIEN2_Pos) /*!< EPWM_T::AINTEN: IFAIEN2 Mask */ - -#define EPWM_AINTEN_IFAIEN3_Pos (3) /*!< EPWM_T::AINTEN: IFAIEN3 Position */ -#define EPWM_AINTEN_IFAIEN3_Msk (0x1ul << EPWM_AINTEN_IFAIEN3_Pos) /*!< EPWM_T::AINTEN: IFAIEN3 Mask */ - -#define EPWM_AINTEN_IFAIEN4_Pos (4) /*!< EPWM_T::AINTEN: IFAIEN4 Position */ -#define EPWM_AINTEN_IFAIEN4_Msk (0x1ul << EPWM_AINTEN_IFAIEN4_Pos) /*!< EPWM_T::AINTEN: IFAIEN4 Mask */ - -#define EPWM_AINTEN_IFAIEN5_Pos (5) /*!< EPWM_T::AINTEN: IFAIEN5 Position */ -#define EPWM_AINTEN_IFAIEN5_Msk (0x1ul << EPWM_AINTEN_IFAIEN5_Pos) /*!< EPWM_T::AINTEN: IFAIEN5 Mask */ - -#define EPWM_APDMACTL_APDMAEN0_Pos (0) /*!< EPWM_T::APDMACTL: APDMAEN0 Position */ -#define EPWM_APDMACTL_APDMAEN0_Msk (0x1ul << EPWM_APDMACTL_APDMAEN0_Pos) /*!< EPWM_T::APDMACTL: APDMAEN0 Mask */ - -#define EPWM_APDMACTL_APDMAEN1_Pos (1) /*!< EPWM_T::APDMACTL: APDMAEN1 Position */ -#define EPWM_APDMACTL_APDMAEN1_Msk (0x1ul << EPWM_APDMACTL_APDMAEN1_Pos) /*!< EPWM_T::APDMACTL: APDMAEN1 Mask */ - -#define EPWM_APDMACTL_APDMAEN2_Pos (2) /*!< EPWM_T::APDMACTL: APDMAEN2 Position */ -#define EPWM_APDMACTL_APDMAEN2_Msk (0x1ul << EPWM_APDMACTL_APDMAEN2_Pos) /*!< EPWM_T::APDMACTL: APDMAEN2 Mask */ - -#define EPWM_APDMACTL_APDMAEN3_Pos (3) /*!< EPWM_T::APDMACTL: APDMAEN3 Position */ -#define EPWM_APDMACTL_APDMAEN3_Msk (0x1ul << EPWM_APDMACTL_APDMAEN3_Pos) /*!< EPWM_T::APDMACTL: APDMAEN3 Mask */ - -#define EPWM_APDMACTL_APDMAEN4_Pos (4) /*!< EPWM_T::APDMACTL: APDMAEN4 Position */ -#define EPWM_APDMACTL_APDMAEN4_Msk (0x1ul << EPWM_APDMACTL_APDMAEN4_Pos) /*!< EPWM_T::APDMACTL: APDMAEN4 Mask */ - -#define EPWM_APDMACTL_APDMAEN5_Pos (5) /*!< EPWM_T::APDMACTL: APDMAEN5 Position */ -#define EPWM_APDMACTL_APDMAEN5_Msk (0x1ul << EPWM_APDMACTL_APDMAEN5_Pos) /*!< EPWM_T::APDMACTL: APDMAEN5 Mask */ - -#define EPWM_FDEN_FDEN0_Pos (0) /*!< EPWM_T::FDEN: FDEN0 Position */ -#define EPWM_FDEN_FDEN0_Msk (0x1ul << EPWM_FDEN_FDEN0_Pos) /*!< EPWM_T::FDEN: FDEN0 Mask */ - -#define EPWM_FDEN_FDEN1_Pos (1) /*!< EPWM_T::FDEN: FDEN1 Position */ -#define EPWM_FDEN_FDEN1_Msk (0x1ul << EPWM_FDEN_FDEN1_Pos) /*!< EPWM_T::FDEN: FDEN1 Mask */ - -#define EPWM_FDEN_FDEN2_Pos (2) /*!< EPWM_T::FDEN: FDEN2 Position */ -#define EPWM_FDEN_FDEN2_Msk (0x1ul << EPWM_FDEN_FDEN2_Pos) /*!< EPWM_T::FDEN: FDEN2 Mask */ - -#define EPWM_FDEN_FDEN3_Pos (3) /*!< EPWM_T::FDEN: FDEN3 Position */ -#define EPWM_FDEN_FDEN3_Msk (0x1ul << EPWM_FDEN_FDEN3_Pos) /*!< EPWM_T::FDEN: FDEN3 Mask */ - -#define EPWM_FDEN_FDEN4_Pos (4) /*!< EPWM_T::FDEN: FDEN4 Position */ -#define EPWM_FDEN_FDEN4_Msk (0x1ul << EPWM_FDEN_FDEN4_Pos) /*!< EPWM_T::FDEN: FDEN4 Mask */ - -#define EPWM_FDEN_FDEN5_Pos (5) /*!< EPWM_T::FDEN: FDEN5 Position */ -#define EPWM_FDEN_FDEN5_Msk (0x1ul << EPWM_FDEN_FDEN5_Pos) /*!< EPWM_T::FDEN: FDEN5 Mask */ - -#define EPWM_FDEN_FDODIS0_Pos (8) /*!< EPWM_T::FDEN: FDODIS0 Position */ -#define EPWM_FDEN_FDODIS0_Msk (0x1ul << EPWM_FDEN_FDODIS0_Pos) /*!< EPWM_T::FDEN: FDODIS0 Mask */ - -#define EPWM_FDEN_FDODIS1_Pos (9) /*!< EPWM_T::FDEN: FDODIS1 Position */ -#define EPWM_FDEN_FDODIS1_Msk (0x1ul << EPWM_FDEN_FDODIS1_Pos) /*!< EPWM_T::FDEN: FDODIS1 Mask */ - -#define EPWM_FDEN_FDODIS2_Pos (10) /*!< EPWM_T::FDEN: FDODIS2 Position */ -#define EPWM_FDEN_FDODIS2_Msk (0x1ul << EPWM_FDEN_FDODIS2_Pos) /*!< EPWM_T::FDEN: FDODIS2 Mask */ - -#define EPWM_FDEN_FDODIS3_Pos (11) /*!< EPWM_T::FDEN: FDODIS3 Position */ -#define EPWM_FDEN_FDODIS3_Msk (0x1ul << EPWM_FDEN_FDODIS3_Pos) /*!< EPWM_T::FDEN: FDODIS3 Mask */ - -#define EPWM_FDEN_FDODIS4_Pos (12) /*!< EPWM_T::FDEN: FDODIS4 Position */ -#define EPWM_FDEN_FDODIS4_Msk (0x1ul << EPWM_FDEN_FDODIS4_Pos) /*!< EPWM_T::FDEN: FDODIS4 Mask */ - -#define EPWM_FDEN_FDODIS5_Pos (13) /*!< EPWM_T::FDEN: FDODIS5 Position */ -#define EPWM_FDEN_FDODIS5_Msk (0x1ul << EPWM_FDEN_FDODIS5_Pos) /*!< EPWM_T::FDEN: FDODIS5 Mask */ - -#define EPWM_FDEN_FDCKS0_Pos (16) /*!< EPWM_T::FDEN: FDCKS0 Position */ -#define EPWM_FDEN_FDCKS0_Msk (0x1ul << EPWM_FDEN_FDCKS0_Pos) /*!< EPWM_T::FDEN: FDCKS0 Mask */ - -#define EPWM_FDEN_FDCKS1_Pos (17) /*!< EPWM_T::FDEN: FDCKS1 Position */ -#define EPWM_FDEN_FDCKS1_Msk (0x1ul << EPWM_FDEN_FDCKS1_Pos) /*!< EPWM_T::FDEN: FDCKS1 Mask */ - -#define EPWM_FDEN_FDCKS2_Pos (18) /*!< EPWM_T::FDEN: FDCKS2 Position */ -#define EPWM_FDEN_FDCKS2_Msk (0x1ul << EPWM_FDEN_FDCKS2_Pos) /*!< EPWM_T::FDEN: FDCKS2 Mask */ - -#define EPWM_FDEN_FDCKS3_Pos (19) /*!< EPWM_T::FDEN: FDCKS3 Position */ -#define EPWM_FDEN_FDCKS3_Msk (0x1ul << EPWM_FDEN_FDCKS3_Pos) /*!< EPWM_T::FDEN: FDCKS3 Mask */ - -#define EPWM_FDEN_FDCKS4_Pos (20) /*!< EPWM_T::FDEN: FDCKS4 Position */ -#define EPWM_FDEN_FDCKS4_Msk (0x1ul << EPWM_FDEN_FDCKS4_Pos) /*!< EPWM_T::FDEN: FDCKS4 Mask */ - -#define EPWM_FDEN_FDCKS5_Pos (21) /*!< EPWM_T::FDEN: FDCKS5 Position */ -#define EPWM_FDEN_FDCKS5_Msk (0x1ul << EPWM_FDEN_FDCKS5_Pos) /*!< EPWM_T::FDEN: FDCKS5 Mask */ - -#define EPWM_FDCTL0_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL0: TRMSKCNT Position */ -#define EPWM_FDCTL0_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL0_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL0: TRMSKCNT Mask */ - -#define EPWM_FDCTL0_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL0: FDMSKEN Position */ -#define EPWM_FDCTL0_FDMSKEN_Msk (0x1ul << EPWM_FDCTL0_FDMSKEN_Pos) /*!< EPWM_T::FDCTL0: FDMSKEN Mask */ - -#define EPWM_FDCTL0_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL0: DGSMPCYC Position */ -#define EPWM_FDCTL0_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL0_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL0: DGSMPCYC Mask */ - -#define EPWM_FDCTL0_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL0: FDCKSEL Position */ -#define EPWM_FDCTL0_FDCKSEL_Msk (0x3ul << EPWM_FDCTL0_FDCKSEL_Pos) /*!< EPWM_T::FDCTL0: FDCKSEL Mask */ - -#define EPWM_FDCTL0_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL0: FDDGEN Position */ -#define EPWM_FDCTL0_FDDGEN_Msk (0x1ul << EPWM_FDCTL0_FDDGEN_Pos) /*!< EPWM_T::FDCTL0: FDDGEN Mask */ - -#define EPWM_FDCTL1_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL1: TRMSKCNT Position */ -#define EPWM_FDCTL1_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL1_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL1: TRMSKCNT Mask */ - -#define EPWM_FDCTL1_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL1: FDMSKEN Position */ -#define EPWM_FDCTL1_FDMSKEN_Msk (0x1ul << EPWM_FDCTL1_FDMSKEN_Pos) /*!< EPWM_T::FDCTL1: FDMSKEN Mask */ - -#define EPWM_FDCTL1_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL1: DGSMPCYC Position */ -#define EPWM_FDCTL1_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL1_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL1: DGSMPCYC Mask */ - -#define EPWM_FDCTL1_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL1: FDCKSEL Position */ -#define EPWM_FDCTL1_FDCKSEL_Msk (0x3ul << EPWM_FDCTL1_FDCKSEL_Pos) /*!< EPWM_T::FDCTL1: FDCKSEL Mask */ - -#define EPWM_FDCTL1_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL1: FDDGEN Position */ -#define EPWM_FDCTL1_FDDGEN_Msk (0x1ul << EPWM_FDCTL1_FDDGEN_Pos) /*!< EPWM_T::FDCTL1: FDDGEN Mask */ - -#define EPWM_FDCTL2_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL2: TRMSKCNT Position */ -#define EPWM_FDCTL2_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL2_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL2: TRMSKCNT Mask */ - -#define EPWM_FDCTL2_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL2: FDMSKEN Position */ -#define EPWM_FDCTL2_FDMSKEN_Msk (0x1ul << EPWM_FDCTL2_FDMSKEN_Pos) /*!< EPWM_T::FDCTL2: FDMSKEN Mask */ - -#define EPWM_FDCTL2_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL2: DGSMPCYC Position */ -#define EPWM_FDCTL2_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL2_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL2: DGSMPCYC Mask */ - -#define EPWM_FDCTL2_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL2: FDCKSEL Position */ -#define EPWM_FDCTL2_FDCKSEL_Msk (0x3ul << EPWM_FDCTL2_FDCKSEL_Pos) /*!< EPWM_T::FDCTL2: FDCKSEL Mask */ - -#define EPWM_FDCTL2_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL2: FDDGEN Position */ -#define EPWM_FDCTL2_FDDGEN_Msk (0x1ul << EPWM_FDCTL2_FDDGEN_Pos) /*!< EPWM_T::FDCTL2: FDDGEN Mask */ - -#define EPWM_FDCTL3_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL3: TRMSKCNT Position */ -#define EPWM_FDCTL3_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL3_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL3: TRMSKCNT Mask */ - -#define EPWM_FDCTL3_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL3: FDMSKEN Position */ -#define EPWM_FDCTL3_FDMSKEN_Msk (0x1ul << EPWM_FDCTL3_FDMSKEN_Pos) /*!< EPWM_T::FDCTL3: FDMSKEN Mask */ - -#define EPWM_FDCTL3_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL3: DGSMPCYC Position */ -#define EPWM_FDCTL3_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL3_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL3: DGSMPCYC Mask */ - -#define EPWM_FDCTL3_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL3: FDCKSEL Position */ -#define EPWM_FDCTL3_FDCKSEL_Msk (0x3ul << EPWM_FDCTL3_FDCKSEL_Pos) /*!< EPWM_T::FDCTL3: FDCKSEL Mask */ - -#define EPWM_FDCTL3_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL3: FDDGEN Position */ -#define EPWM_FDCTL3_FDDGEN_Msk (0x1ul << EPWM_FDCTL3_FDDGEN_Pos) /*!< EPWM_T::FDCTL3: FDDGEN Mask */ - -#define EPWM_FDCTL4_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL4: TRMSKCNT Position */ -#define EPWM_FDCTL4_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL4_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL4: TRMSKCNT Mask */ - -#define EPWM_FDCTL4_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL4: FDMSKEN Position */ -#define EPWM_FDCTL4_FDMSKEN_Msk (0x1ul << EPWM_FDCTL4_FDMSKEN_Pos) /*!< EPWM_T::FDCTL4: FDMSKEN Mask */ - -#define EPWM_FDCTL4_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL4: DGSMPCYC Position */ -#define EPWM_FDCTL4_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL4_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL4: DGSMPCYC Mask */ - -#define EPWM_FDCTL4_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL4: FDCKSEL Position */ -#define EPWM_FDCTL4_FDCKSEL_Msk (0x3ul << EPWM_FDCTL4_FDCKSEL_Pos) /*!< EPWM_T::FDCTL4: FDCKSEL Mask */ - -#define EPWM_FDCTL4_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL4: FDDGEN Position */ -#define EPWM_FDCTL4_FDDGEN_Msk (0x1ul << EPWM_FDCTL4_FDDGEN_Pos) /*!< EPWM_T::FDCTL4: FDDGEN Mask */ - -#define EPWM_FDCTL5_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL5: TRMSKCNT Position */ -#define EPWM_FDCTL5_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL5_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL5: TRMSKCNT Mask */ - -#define EPWM_FDCTL5_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL5: FDMSKEN Position */ -#define EPWM_FDCTL5_FDMSKEN_Msk (0x1ul << EPWM_FDCTL5_FDMSKEN_Pos) /*!< EPWM_T::FDCTL5: FDMSKEN Mask */ - -#define EPWM_FDCTL5_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL5: DGSMPCYC Position */ -#define EPWM_FDCTL5_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL5_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL5: DGSMPCYC Mask */ - -#define EPWM_FDCTL5_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL5: FDCKSEL Position */ -#define EPWM_FDCTL5_FDCKSEL_Msk (0x3ul << EPWM_FDCTL5_FDCKSEL_Pos) /*!< EPWM_T::FDCTL5: FDCKSEL Mask */ - -#define EPWM_FDCTL5_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL5: FDDGEN Position */ -#define EPWM_FDCTL5_FDDGEN_Msk (0x1ul << EPWM_FDCTL5_FDDGEN_Pos) /*!< EPWM_T::FDCTL5: FDDGEN Mask */ - -#define EPWM_FDIEN_FDIEN0_Pos (0) /*!< EPWM_T::FDIEN: FDIEN0 Position */ -#define EPWM_FDIEN_FDIEN0_Msk (0x1ul << EPWM_FDIEN_FDIEN0_Pos) /*!< EPWM_T::FDIEN: FDIEN0 Mask */ - -#define EPWM_FDIEN_FDIEN1_Pos (1) /*!< EPWM_T::FDIEN: FDIEN1 Position */ -#define EPWM_FDIEN_FDIEN1_Msk (0x1ul << EPWM_FDIEN_FDIEN1_Pos) /*!< EPWM_T::FDIEN: FDIEN1 Mask */ - -#define EPWM_FDIEN_FDIEN2_Pos (2) /*!< EPWM_T::FDIEN: FDIEN2 Position */ -#define EPWM_FDIEN_FDIEN2_Msk (0x1ul << EPWM_FDIEN_FDIEN2_Pos) /*!< EPWM_T::FDIEN: FDIEN2 Mask */ - -#define EPWM_FDIEN_FDIEN3_Pos (3) /*!< EPWM_T::FDIEN: FDIEN3 Position */ -#define EPWM_FDIEN_FDIEN3_Msk (0x1ul << EPWM_FDIEN_FDIEN3_Pos) /*!< EPWM_T::FDIEN: FDIEN3 Mask */ - -#define EPWM_FDIEN_FDIEN4_Pos (4) /*!< EPWM_T::FDIEN: FDIEN4 Position */ -#define EPWM_FDIEN_FDIEN4_Msk (0x1ul << EPWM_FDIEN_FDIEN4_Pos) /*!< EPWM_T::FDIEN: FDIEN4 Mask */ - -#define EPWM_FDIEN_FDIEN5_Pos (5) /*!< EPWM_T::FDIEN: FDIEN5 Position */ -#define EPWM_FDIEN_FDIEN5_Msk (0x1ul << EPWM_FDIEN_FDIEN5_Pos) /*!< EPWM_T::FDIEN: FDIEN5 Mask */ - -#define EPWM_FDSTS_FDIF0_Pos (0) /*!< EPWM_T::FDSTS: FDIF0 Position */ -#define EPWM_FDSTS_FDIF0_Msk (0x1ul << EPWM_FDSTS_FDIF0_Pos) /*!< EPWM_T::FDSTS: FDIF0 Mask */ - -#define EPWM_FDSTS_FDIF1_Pos (1) /*!< EPWM_T::FDSTS: FDIF1 Position */ -#define EPWM_FDSTS_FDIF1_Msk (0x1ul << EPWM_FDSTS_FDIF1_Pos) /*!< EPWM_T::FDSTS: FDIF1 Mask */ - -#define EPWM_FDSTS_FDIF2_Pos (2) /*!< EPWM_T::FDSTS: FDIF2 Position */ -#define EPWM_FDSTS_FDIF2_Msk (0x1ul << EPWM_FDSTS_FDIF2_Pos) /*!< EPWM_T::FDSTS: FDIF2 Mask */ - -#define EPWM_FDSTS_FDIF3_Pos (3) /*!< EPWM_T::FDSTS: FDIF3 Position */ -#define EPWM_FDSTS_FDIF3_Msk (0x1ul << EPWM_FDSTS_FDIF3_Pos) /*!< EPWM_T::FDSTS: FDIF3 Mask */ - -#define EPWM_FDSTS_FDIF4_Pos (4) /*!< EPWM_T::FDSTS: FDIF4 Position */ -#define EPWM_FDSTS_FDIF4_Msk (0x1ul << EPWM_FDSTS_FDIF4_Pos) /*!< EPWM_T::FDSTS: FDIF4 Mask */ - -#define EPWM_FDSTS_FDIF5_Pos (5) /*!< EPWM_T::FDSTS: FDIF5 Position */ -#define EPWM_FDSTS_FDIF5_Msk (0x1ul << EPWM_FDSTS_FDIF5_Pos) /*!< EPWM_T::FDSTS: FDIF5 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN0_Pos (0) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Position */ -#define EPWM_EADCPSCCTL_PSCEN0_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN0_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN1_Pos (1) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Position */ -#define EPWM_EADCPSCCTL_PSCEN1_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN1_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN2_Pos (2) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Position */ -#define EPWM_EADCPSCCTL_PSCEN2_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN2_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN3_Pos (3) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Position */ -#define EPWM_EADCPSCCTL_PSCEN3_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN3_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN4_Pos (4) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Position */ -#define EPWM_EADCPSCCTL_PSCEN4_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN4_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN5_Pos (5) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Position */ -#define EPWM_EADCPSCCTL_PSCEN5_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN5_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Mask */ - -#define EPWM_EADCPSC0_EADCPSC0_Pos (0) /*!< EPWM_T::EADCPSC0: EADCPSC0 Position */ -#define EPWM_EADCPSC0_EADCPSC0_Msk (0xful << EPWM_EADCPSC0_EADCPSC0_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC0 Mask */ - -#define EPWM_EADCPSC0_EADCPSC1_Pos (8) /*!< EPWM_T::EADCPSC0: EADCPSC1 Position */ -#define EPWM_EADCPSC0_EADCPSC1_Msk (0xful << EPWM_EADCPSC0_EADCPSC1_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC1 Mask */ - -#define EPWM_EADCPSC0_EADCPSC2_Pos (16) /*!< EPWM_T::EADCPSC0: EADCPSC2 Position */ -#define EPWM_EADCPSC0_EADCPSC2_Msk (0xful << EPWM_EADCPSC0_EADCPSC2_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC2 Mask */ - -#define EPWM_EADCPSC0_EADCPSC3_Pos (24) /*!< EPWM_T::EADCPSC0: EADCPSC3 Position */ -#define EPWM_EADCPSC0_EADCPSC3_Msk (0xful << EPWM_EADCPSC0_EADCPSC3_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC3 Mask */ - -#define EPWM_EADCPSC1_EADCPSC4_Pos (0) /*!< EPWM_T::EADCPSC1: EADCPSC4 Position */ -#define EPWM_EADCPSC1_EADCPSC4_Msk (0xful << EPWM_EADCPSC1_EADCPSC4_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC4 Mask */ - -#define EPWM_EADCPSC1_EADCPSC5_Pos (8) /*!< EPWM_T::EADCPSC1: EADCPSC5 Position */ -#define EPWM_EADCPSC1_EADCPSC5_Msk (0xful << EPWM_EADCPSC1_EADCPSC5_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC5 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT0_Pos (0) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Position */ -#define EPWM_EADCPSCNT0_PSCNT0_Msk (0xful << EPWM_EADCPSCNT0_PSCNT0_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT1_Pos (8) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Position */ -#define EPWM_EADCPSCNT0_PSCNT1_Msk (0xful << EPWM_EADCPSCNT0_PSCNT1_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT2_Pos (16) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Position */ -#define EPWM_EADCPSCNT0_PSCNT2_Msk (0xful << EPWM_EADCPSCNT0_PSCNT2_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT3_Pos (24) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Position */ -#define EPWM_EADCPSCNT0_PSCNT3_Msk (0xful << EPWM_EADCPSCNT0_PSCNT3_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT4_Pos (0) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Position */ -#define EPWM_EADCPSCNT1_PSCNT4_Msk (0xful << EPWM_EADCPSCNT1_PSCNT4_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT5_Pos (8) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Position */ -#define EPWM_EADCPSCNT1_PSCNT5_Msk (0xful << EPWM_EADCPSCNT1_PSCNT5_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Mask */ - -#define EPWM_CAPINEN_CAPINEN0_Pos (0) /*!< EPWM_T::CAPINEN: CAPINEN0 Position */ -#define EPWM_CAPINEN_CAPINEN0_Msk (0x1ul << EPWM_CAPINEN_CAPINEN0_Pos) /*!< EPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define EPWM_CAPINEN_CAPINEN1_Pos (1) /*!< EPWM_T::CAPINEN: CAPINEN1 Position */ -#define EPWM_CAPINEN_CAPINEN1_Msk (0x1ul << EPWM_CAPINEN_CAPINEN1_Pos) /*!< EPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define EPWM_CAPINEN_CAPINEN2_Pos (2) /*!< EPWM_T::CAPINEN: CAPINEN2 Position */ -#define EPWM_CAPINEN_CAPINEN2_Msk (0x1ul << EPWM_CAPINEN_CAPINEN2_Pos) /*!< EPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define EPWM_CAPINEN_CAPINEN3_Pos (3) /*!< EPWM_T::CAPINEN: CAPINEN3 Position */ -#define EPWM_CAPINEN_CAPINEN3_Msk (0x1ul << EPWM_CAPINEN_CAPINEN3_Pos) /*!< EPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define EPWM_CAPINEN_CAPINEN4_Pos (4) /*!< EPWM_T::CAPINEN: CAPINEN4 Position */ -#define EPWM_CAPINEN_CAPINEN4_Msk (0x1ul << EPWM_CAPINEN_CAPINEN4_Pos) /*!< EPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define EPWM_CAPINEN_CAPINEN5_Pos (5) /*!< EPWM_T::CAPINEN: CAPINEN5 Position */ -#define EPWM_CAPINEN_CAPINEN5_Msk (0x1ul << EPWM_CAPINEN_CAPINEN5_Pos) /*!< EPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define EPWM_CAPCTL_CAPEN0_Pos (0) /*!< EPWM_T::CAPCTL: CAPEN0 Position */ -#define EPWM_CAPCTL_CAPEN0_Msk (0x1ul << EPWM_CAPCTL_CAPEN0_Pos) /*!< EPWM_T::CAPCTL: CAPEN0 Mask */ - -#define EPWM_CAPCTL_CAPEN1_Pos (1) /*!< EPWM_T::CAPCTL: CAPEN1 Position */ -#define EPWM_CAPCTL_CAPEN1_Msk (0x1ul << EPWM_CAPCTL_CAPEN1_Pos) /*!< EPWM_T::CAPCTL: CAPEN1 Mask */ - -#define EPWM_CAPCTL_CAPEN2_Pos (2) /*!< EPWM_T::CAPCTL: CAPEN2 Position */ -#define EPWM_CAPCTL_CAPEN2_Msk (0x1ul << EPWM_CAPCTL_CAPEN2_Pos) /*!< EPWM_T::CAPCTL: CAPEN2 Mask */ - -#define EPWM_CAPCTL_CAPEN3_Pos (3) /*!< EPWM_T::CAPCTL: CAPEN3 Position */ -#define EPWM_CAPCTL_CAPEN3_Msk (0x1ul << EPWM_CAPCTL_CAPEN3_Pos) /*!< EPWM_T::CAPCTL: CAPEN3 Mask */ - -#define EPWM_CAPCTL_CAPEN4_Pos (4) /*!< EPWM_T::CAPCTL: CAPEN4 Position */ -#define EPWM_CAPCTL_CAPEN4_Msk (0x1ul << EPWM_CAPCTL_CAPEN4_Pos) /*!< EPWM_T::CAPCTL: CAPEN4 Mask */ - -#define EPWM_CAPCTL_CAPEN5_Pos (5) /*!< EPWM_T::CAPCTL: CAPEN5 Position */ -#define EPWM_CAPCTL_CAPEN5_Msk (0x1ul << EPWM_CAPCTL_CAPEN5_Pos) /*!< EPWM_T::CAPCTL: CAPEN5 Mask */ - -#define EPWM_CAPCTL_CAPINV0_Pos (8) /*!< EPWM_T::CAPCTL: CAPINV0 Position */ -#define EPWM_CAPCTL_CAPINV0_Msk (0x1ul << EPWM_CAPCTL_CAPINV0_Pos) /*!< EPWM_T::CAPCTL: CAPINV0 Mask */ - -#define EPWM_CAPCTL_CAPINV1_Pos (9) /*!< EPWM_T::CAPCTL: CAPINV1 Position */ -#define EPWM_CAPCTL_CAPINV1_Msk (0x1ul << EPWM_CAPCTL_CAPINV1_Pos) /*!< EPWM_T::CAPCTL: CAPINV1 Mask */ - -#define EPWM_CAPCTL_CAPINV2_Pos (10) /*!< EPWM_T::CAPCTL: CAPINV2 Position */ -#define EPWM_CAPCTL_CAPINV2_Msk (0x1ul << EPWM_CAPCTL_CAPINV2_Pos) /*!< EPWM_T::CAPCTL: CAPINV2 Mask */ - -#define EPWM_CAPCTL_CAPINV3_Pos (11) /*!< EPWM_T::CAPCTL: CAPINV3 Position */ -#define EPWM_CAPCTL_CAPINV3_Msk (0x1ul << EPWM_CAPCTL_CAPINV3_Pos) /*!< EPWM_T::CAPCTL: CAPINV3 Mask */ - -#define EPWM_CAPCTL_CAPINV4_Pos (12) /*!< EPWM_T::CAPCTL: CAPINV4 Position */ -#define EPWM_CAPCTL_CAPINV4_Msk (0x1ul << EPWM_CAPCTL_CAPINV4_Pos) /*!< EPWM_T::CAPCTL: CAPINV4 Mask */ - -#define EPWM_CAPCTL_CAPINV5_Pos (13) /*!< EPWM_T::CAPCTL: CAPINV5 Position */ -#define EPWM_CAPCTL_CAPINV5_Msk (0x1ul << EPWM_CAPCTL_CAPINV5_Pos) /*!< EPWM_T::CAPCTL: CAPINV5 Mask */ - -#define EPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< EPWM_T::CAPCTL: RCRLDEN0 Position */ -#define EPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define EPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< EPWM_T::CAPCTL: RCRLDEN1 Position */ -#define EPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define EPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< EPWM_T::CAPCTL: RCRLDEN2 Position */ -#define EPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define EPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< EPWM_T::CAPCTL: RCRLDEN3 Position */ -#define EPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define EPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< EPWM_T::CAPCTL: RCRLDEN4 Position */ -#define EPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define EPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< EPWM_T::CAPCTL: RCRLDEN5 Position */ -#define EPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define EPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< EPWM_T::CAPCTL: FCRLDEN0 Position */ -#define EPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define EPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< EPWM_T::CAPCTL: FCRLDEN1 Position */ -#define EPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define EPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< EPWM_T::CAPCTL: FCRLDEN2 Position */ -#define EPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define EPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< EPWM_T::CAPCTL: FCRLDEN3 Position */ -#define EPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define EPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< EPWM_T::CAPCTL: FCRLDEN4 Position */ -#define EPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define EPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< EPWM_T::CAPCTL: FCRLDEN5 Position */ -#define EPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define EPWM_CAPSTS_CRLIFOV0_Pos (0) /*!< EPWM_T::CAPSTS: CRLIFOV0 Position */ -#define EPWM_CAPSTS_CRLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV0 Mask */ - -#define EPWM_CAPSTS_CRLIFOV1_Pos (1) /*!< EPWM_T::CAPSTS: CRLIFOV1 Position */ -#define EPWM_CAPSTS_CRLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV1 Mask */ - -#define EPWM_CAPSTS_CRLIFOV2_Pos (2) /*!< EPWM_T::CAPSTS: CRLIFOV2 Position */ -#define EPWM_CAPSTS_CRLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV2 Mask */ - -#define EPWM_CAPSTS_CRLIFOV3_Pos (3) /*!< EPWM_T::CAPSTS: CRLIFOV3 Position */ -#define EPWM_CAPSTS_CRLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV3 Mask */ - -#define EPWM_CAPSTS_CRLIFOV4_Pos (4) /*!< EPWM_T::CAPSTS: CRLIFOV4 Position */ -#define EPWM_CAPSTS_CRLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV4 Mask */ - -#define EPWM_CAPSTS_CRLIFOV5_Pos (5) /*!< EPWM_T::CAPSTS: CRLIFOV5 Position */ -#define EPWM_CAPSTS_CRLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV5 Mask */ - -#define EPWM_CAPSTS_CFLIFOV0_Pos (8) /*!< EPWM_T::CAPSTS: CFLIFOV0 Position */ -#define EPWM_CAPSTS_CFLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV0 Mask */ - -#define EPWM_CAPSTS_CFLIFOV1_Pos (9) /*!< EPWM_T::CAPSTS: CFLIFOV1 Position */ -#define EPWM_CAPSTS_CFLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV1 Mask */ - -#define EPWM_CAPSTS_CFLIFOV2_Pos (10) /*!< EPWM_T::CAPSTS: CFLIFOV2 Position */ -#define EPWM_CAPSTS_CFLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV2 Mask */ - -#define EPWM_CAPSTS_CFLIFOV3_Pos (11) /*!< EPWM_T::CAPSTS: CFLIFOV3 Position */ -#define EPWM_CAPSTS_CFLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV3 Mask */ - -#define EPWM_CAPSTS_CFLIFOV4_Pos (12) /*!< EPWM_T::CAPSTS: CFLIFOV4 Position */ -#define EPWM_CAPSTS_CFLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV4 Mask */ - -#define EPWM_CAPSTS_CFLIFOV5_Pos (13) /*!< EPWM_T::CAPSTS: CFLIFOV5 Position */ -#define EPWM_CAPSTS_CFLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV5 Mask */ - -#define EPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT0: RCAPDAT Position */ -#define EPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT0_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define EPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT0: FCAPDAT Position */ -#define EPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT0_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define EPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT1: RCAPDAT Position */ -#define EPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT1_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define EPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT1: FCAPDAT Position */ -#define EPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT1_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define EPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT2: RCAPDAT Position */ -#define EPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT2_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define EPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT2: FCAPDAT Position */ -#define EPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT2_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define EPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT3: RCAPDAT Position */ -#define EPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT3_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define EPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT3: FCAPDAT Position */ -#define EPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT3_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define EPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT4: RCAPDAT Position */ -#define EPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT4_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define EPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT4: FCAPDAT Position */ -#define EPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT4_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define EPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT5: RCAPDAT Position */ -#define EPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT5_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define EPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT5: FCAPDAT Position */ -#define EPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT5_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define EPWM_PDMACTL_CHEN0_1_Pos (0) /*!< EPWM_T::PDMACTL: CHEN0_1 Position */ -#define EPWM_PDMACTL_CHEN0_1_Msk (0x1ul << EPWM_PDMACTL_CHEN0_1_Pos) /*!< EPWM_T::PDMACTL: CHEN0_1 Mask */ - -#define EPWM_PDMACTL_CAPMOD0_1_Pos (1) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Position */ -#define EPWM_PDMACTL_CAPMOD0_1_Msk (0x3ul << EPWM_PDMACTL_CAPMOD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Mask */ - -#define EPWM_PDMACTL_CAPORD0_1_Pos (3) /*!< EPWM_T::PDMACTL: CAPORD0_1 Position */ -#define EPWM_PDMACTL_CAPORD0_1_Msk (0x1ul << EPWM_PDMACTL_CAPORD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPORD0_1 Mask */ - -#define EPWM_PDMACTL_CHSEL0_1_Pos (4) /*!< EPWM_T::PDMACTL: CHSEL0_1 Position */ -#define EPWM_PDMACTL_CHSEL0_1_Msk (0x1ul << EPWM_PDMACTL_CHSEL0_1_Pos) /*!< EPWM_T::PDMACTL: CHSEL0_1 Mask */ - -#define EPWM_PDMACTL_CHEN2_3_Pos (8) /*!< EPWM_T::PDMACTL: CHEN2_3 Position */ -#define EPWM_PDMACTL_CHEN2_3_Msk (0x1ul << EPWM_PDMACTL_CHEN2_3_Pos) /*!< EPWM_T::PDMACTL: CHEN2_3 Mask */ - -#define EPWM_PDMACTL_CAPMOD2_3_Pos (9) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Position */ -#define EPWM_PDMACTL_CAPMOD2_3_Msk (0x3ul << EPWM_PDMACTL_CAPMOD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Mask */ - -#define EPWM_PDMACTL_CAPORD2_3_Pos (11) /*!< EPWM_T::PDMACTL: CAPORD2_3 Position */ -#define EPWM_PDMACTL_CAPORD2_3_Msk (0x1ul << EPWM_PDMACTL_CAPORD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPORD2_3 Mask */ - -#define EPWM_PDMACTL_CHSEL2_3_Pos (12) /*!< EPWM_T::PDMACTL: CHSEL2_3 Position */ -#define EPWM_PDMACTL_CHSEL2_3_Msk (0x1ul << EPWM_PDMACTL_CHSEL2_3_Pos) /*!< EPWM_T::PDMACTL: CHSEL2_3 Mask */ - -#define EPWM_PDMACTL_CHEN4_5_Pos (16) /*!< EPWM_T::PDMACTL: CHEN4_5 Position */ -#define EPWM_PDMACTL_CHEN4_5_Msk (0x1ul << EPWM_PDMACTL_CHEN4_5_Pos) /*!< EPWM_T::PDMACTL: CHEN4_5 Mask */ - -#define EPWM_PDMACTL_CAPMOD4_5_Pos (17) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Position */ -#define EPWM_PDMACTL_CAPMOD4_5_Msk (0x3ul << EPWM_PDMACTL_CAPMOD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Mask */ - -#define EPWM_PDMACTL_CAPORD4_5_Pos (19) /*!< EPWM_T::PDMACTL: CAPORD4_5 Position */ -#define EPWM_PDMACTL_CAPORD4_5_Msk (0x1ul << EPWM_PDMACTL_CAPORD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPORD4_5 Mask */ - -#define EPWM_PDMACTL_CHSEL4_5_Pos (20) /*!< EPWM_T::PDMACTL: CHSEL4_5 Position */ -#define EPWM_PDMACTL_CHSEL4_5_Msk (0x1ul << EPWM_PDMACTL_CHSEL4_5_Pos) /*!< EPWM_T::PDMACTL: CHSEL4_5 Mask */ - -#define EPWM_PDMACAP0_1_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP0_1: CAPBUF Position */ -#define EPWM_PDMACAP0_1_CAPBUF_Msk (0xfffful << EPWM_PDMACAP0_1_CAPBUF_Pos) /*!< EPWM_T::PDMACAP0_1: CAPBUF Mask */ - -#define EPWM_PDMACAP2_3_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP2_3: CAPBUF Position */ -#define EPWM_PDMACAP2_3_CAPBUF_Msk (0xfffful << EPWM_PDMACAP2_3_CAPBUF_Pos) /*!< EPWM_T::PDMACAP2_3: CAPBUF Mask */ - -#define EPWM_PDMACAP4_5_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP4_5: CAPBUF Position */ -#define EPWM_PDMACAP4_5_CAPBUF_Msk (0xfffful << EPWM_PDMACAP4_5_CAPBUF_Pos) /*!< EPWM_T::PDMACAP4_5: CAPBUF Mask */ - -#define EPWM_CAPIEN_CAPRIEN0_Pos (0) /*!< EPWM_T::CAPIEN: CAPRIEN0 Position */ -#define EPWM_CAPIEN_CAPRIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN0 Mask */ - -#define EPWM_CAPIEN_CAPRIEN1_Pos (1) /*!< EPWM_T::CAPIEN: CAPRIEN1 Position */ -#define EPWM_CAPIEN_CAPRIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN1 Mask */ - -#define EPWM_CAPIEN_CAPRIEN2_Pos (2) /*!< EPWM_T::CAPIEN: CAPRIEN2 Position */ -#define EPWM_CAPIEN_CAPRIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN2 Mask */ - -#define EPWM_CAPIEN_CAPRIEN3_Pos (3) /*!< EPWM_T::CAPIEN: CAPRIEN3 Position */ -#define EPWM_CAPIEN_CAPRIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN3 Mask */ - -#define EPWM_CAPIEN_CAPRIEN4_Pos (4) /*!< EPWM_T::CAPIEN: CAPRIEN4 Position */ -#define EPWM_CAPIEN_CAPRIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN4 Mask */ - -#define EPWM_CAPIEN_CAPRIEN5_Pos (5) /*!< EPWM_T::CAPIEN: CAPRIEN5 Position */ -#define EPWM_CAPIEN_CAPRIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN5 Mask */ - -#define EPWM_CAPIEN_CAPFIEN0_Pos (8) /*!< EPWM_T::CAPIEN: CAPFIEN0 Position */ -#define EPWM_CAPIEN_CAPFIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN0 Mask */ - -#define EPWM_CAPIEN_CAPFIEN1_Pos (9) /*!< EPWM_T::CAPIEN: CAPFIEN1 Position */ -#define EPWM_CAPIEN_CAPFIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN1 Mask */ - -#define EPWM_CAPIEN_CAPFIEN2_Pos (10) /*!< EPWM_T::CAPIEN: CAPFIEN2 Position */ -#define EPWM_CAPIEN_CAPFIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN2 Mask */ - -#define EPWM_CAPIEN_CAPFIEN3_Pos (11) /*!< EPWM_T::CAPIEN: CAPFIEN3 Position */ -#define EPWM_CAPIEN_CAPFIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN3 Mask */ - -#define EPWM_CAPIEN_CAPFIEN4_Pos (12) /*!< EPWM_T::CAPIEN: CAPFIEN4 Position */ -#define EPWM_CAPIEN_CAPFIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN4 Mask */ - -#define EPWM_CAPIEN_CAPFIEN5_Pos (13) /*!< EPWM_T::CAPIEN: CAPFIEN5 Position */ -#define EPWM_CAPIEN_CAPFIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN5 Mask */ - -#define EPWM_CAPIF_CRLIF0_Pos (0) /*!< EPWM_T::CAPIF: CRLIF0 Position */ -#define EPWM_CAPIF_CRLIF0_Msk (0x1ul << EPWM_CAPIF_CRLIF0_Pos) /*!< EPWM_T::CAPIF: CRLIF0 Mask */ - -#define EPWM_CAPIF_CRLIF1_Pos (1) /*!< EPWM_T::CAPIF: CRLIF1 Position */ -#define EPWM_CAPIF_CRLIF1_Msk (0x1ul << EPWM_CAPIF_CRLIF1_Pos) /*!< EPWM_T::CAPIF: CRLIF1 Mask */ - -#define EPWM_CAPIF_CRLIF2_Pos (2) /*!< EPWM_T::CAPIF: CRLIF2 Position */ -#define EPWM_CAPIF_CRLIF2_Msk (0x1ul << EPWM_CAPIF_CRLIF2_Pos) /*!< EPWM_T::CAPIF: CRLIF2 Mask */ - -#define EPWM_CAPIF_CRLIF3_Pos (3) /*!< EPWM_T::CAPIF: CRLIF3 Position */ -#define EPWM_CAPIF_CRLIF3_Msk (0x1ul << EPWM_CAPIF_CRLIF3_Pos) /*!< EPWM_T::CAPIF: CRLIF3 Mask */ - -#define EPWM_CAPIF_CRLIF4_Pos (4) /*!< EPWM_T::CAPIF: CRLIF4 Position */ -#define EPWM_CAPIF_CRLIF4_Msk (0x1ul << EPWM_CAPIF_CRLIF4_Pos) /*!< EPWM_T::CAPIF: CRLIF4 Mask */ - -#define EPWM_CAPIF_CRLIF5_Pos (5) /*!< EPWM_T::CAPIF: CRLIF5 Position */ -#define EPWM_CAPIF_CRLIF5_Msk (0x1ul << EPWM_CAPIF_CRLIF5_Pos) /*!< EPWM_T::CAPIF: CRLIF5 Mask */ - -#define EPWM_CAPIF_CFLIF0_Pos (8) /*!< EPWM_T::CAPIF: CFLIF0 Position */ -#define EPWM_CAPIF_CFLIF0_Msk (0x1ul << EPWM_CAPIF_CFLIF0_Pos) /*!< EPWM_T::CAPIF: CFLIF0 Mask */ - -#define EPWM_CAPIF_CFLIF1_Pos (9) /*!< EPWM_T::CAPIF: CFLIF1 Position */ -#define EPWM_CAPIF_CFLIF1_Msk (0x1ul << EPWM_CAPIF_CFLIF1_Pos) /*!< EPWM_T::CAPIF: CFLIF1 Mask */ - -#define EPWM_CAPIF_CFLIF2_Pos (10) /*!< EPWM_T::CAPIF: CFLIF2 Position */ -#define EPWM_CAPIF_CFLIF2_Msk (0x1ul << EPWM_CAPIF_CFLIF2_Pos) /*!< EPWM_T::CAPIF: CFLIF2 Mask */ - -#define EPWM_CAPIF_CFLIF3_Pos (11) /*!< EPWM_T::CAPIF: CFLIF3 Position */ -#define EPWM_CAPIF_CFLIF3_Msk (0x1ul << EPWM_CAPIF_CFLIF3_Pos) /*!< EPWM_T::CAPIF: CFLIF3 Mask */ - -#define EPWM_CAPIF_CFLIF4_Pos (12) /*!< EPWM_T::CAPIF: CFLIF4 Position */ -#define EPWM_CAPIF_CFLIF4_Msk (0x1ul << EPWM_CAPIF_CFLIF4_Pos) /*!< EPWM_T::CAPIF: CFLIF4 Mask */ - -#define EPWM_CAPIF_CFLIF5_Pos (13) /*!< EPWM_T::CAPIF: CFLIF5 Position */ -#define EPWM_CAPIF_CFLIF5_Msk (0x1ul << EPWM_CAPIF_CFLIF5_Pos) /*!< EPWM_T::CAPIF: CFLIF5 Mask */ - -#define EPWM_PBUF0_PBUF_Pos (0) /*!< EPWM_T::PBUF0: PBUF Position */ -#define EPWM_PBUF0_PBUF_Msk (0xfffful << EPWM_PBUF0_PBUF_Pos) /*!< EPWM_T::PBUF0: PBUF Mask */ - -#define EPWM_PBUF1_PBUF_Pos (0) /*!< EPWM_T::PBUF1: PBUF Position */ -#define EPWM_PBUF1_PBUF_Msk (0xfffful << EPWM_PBUF1_PBUF_Pos) /*!< EPWM_T::PBUF1: PBUF Mask */ - -#define EPWM_PBUF2_PBUF_Pos (0) /*!< EPWM_T::PBUF2: PBUF Position */ -#define EPWM_PBUF2_PBUF_Msk (0xfffful << EPWM_PBUF2_PBUF_Pos) /*!< EPWM_T::PBUF2: PBUF Mask */ - -#define EPWM_PBUF3_PBUF_Pos (0) /*!< EPWM_T::PBUF3: PBUF Position */ -#define EPWM_PBUF3_PBUF_Msk (0xfffful << EPWM_PBUF3_PBUF_Pos) /*!< EPWM_T::PBUF3: PBUF Mask */ - -#define EPWM_PBUF4_PBUF_Pos (0) /*!< EPWM_T::PBUF4: PBUF Position */ -#define EPWM_PBUF4_PBUF_Msk (0xfffful << EPWM_PBUF4_PBUF_Pos) /*!< EPWM_T::PBUF4: PBUF Mask */ - -#define EPWM_PBUF5_PBUF_Pos (0) /*!< EPWM_T::PBUF5: PBUF Position */ -#define EPWM_PBUF5_PBUF_Msk (0xfffful << EPWM_PBUF5_PBUF_Pos) /*!< EPWM_T::PBUF5: PBUF Mask */ - -#define EPWM_CMPBUF0_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF0: CMPBUF Position */ -#define EPWM_CMPBUF0_CMPBUF_Msk (0xfffful << EPWM_CMPBUF0_CMPBUF_Pos) /*!< EPWM_T::CMPBUF0: CMPBUF Mask */ - -#define EPWM_CMPBUF1_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF1: CMPBUF Position */ -#define EPWM_CMPBUF1_CMPBUF_Msk (0xfffful << EPWM_CMPBUF1_CMPBUF_Pos) /*!< EPWM_T::CMPBUF1: CMPBUF Mask */ - -#define EPWM_CMPBUF2_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF2: CMPBUF Position */ -#define EPWM_CMPBUF2_CMPBUF_Msk (0xfffful << EPWM_CMPBUF2_CMPBUF_Pos) /*!< EPWM_T::CMPBUF2: CMPBUF Mask */ - -#define EPWM_CMPBUF3_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF3: CMPBUF Position */ -#define EPWM_CMPBUF3_CMPBUF_Msk (0xfffful << EPWM_CMPBUF3_CMPBUF_Pos) /*!< EPWM_T::CMPBUF3: CMPBUF Mask */ - -#define EPWM_CMPBUF4_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF4: CMPBUF Position */ -#define EPWM_CMPBUF4_CMPBUF_Msk (0xfffful << EPWM_CMPBUF4_CMPBUF_Pos) /*!< EPWM_T::CMPBUF4: CMPBUF Mask */ - -#define EPWM_CMPBUF5_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF5: CMPBUF Position */ -#define EPWM_CMPBUF5_CMPBUF_Msk (0xfffful << EPWM_CMPBUF5_CMPBUF_Pos) /*!< EPWM_T::CMPBUF5: CMPBUF Mask */ - -#define EPWM_CPSCBUF0_1_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF0_1: CPSCBUF Position */ -#define EPWM_CPSCBUF0_1_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF0_1_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF0_1: CPSCBUF Mask */ - -#define EPWM_CPSCBUF2_3_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF2_3: CPSCBUF Position */ -#define EPWM_CPSCBUF2_3_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF2_3_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF2_3: CPSCBUF Mask */ - -#define EPWM_CPSCBUF4_5_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF4_5: CPSCBUF Position */ -#define EPWM_CPSCBUF4_5_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF4_5_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF4_5: CPSCBUF Mask */ - -#define EPWM_FTCBUF0_1_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Position */ -#define EPWM_FTCBUF0_1_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF0_1_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Mask */ - -#define EPWM_FTCBUF2_3_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Position */ -#define EPWM_FTCBUF2_3_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF2_3_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Mask */ - -#define EPWM_FTCBUF4_5_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Position */ -#define EPWM_FTCBUF4_5_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF4_5_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Mask */ - -#define EPWM_FTCI_FTCMU0_Pos (0) /*!< EPWM_T::FTCI: FTCMU0 Position */ -#define EPWM_FTCI_FTCMU0_Msk (0x1ul << EPWM_FTCI_FTCMU0_Pos) /*!< EPWM_T::FTCI: FTCMU0 Mask */ - -#define EPWM_FTCI_FTCMU2_Pos (1) /*!< EPWM_T::FTCI: FTCMU2 Position */ -#define EPWM_FTCI_FTCMU2_Msk (0x1ul << EPWM_FTCI_FTCMU2_Pos) /*!< EPWM_T::FTCI: FTCMU2 Mask */ - -#define EPWM_FTCI_FTCMU4_Pos (2) /*!< EPWM_T::FTCI: FTCMU4 Position */ -#define EPWM_FTCI_FTCMU4_Msk (0x1ul << EPWM_FTCI_FTCMU4_Pos) /*!< EPWM_T::FTCI: FTCMU4 Mask */ - -#define EPWM_FTCI_FTCMD0_Pos (8) /*!< EPWM_T::FTCI: FTCMD0 Position */ -#define EPWM_FTCI_FTCMD0_Msk (0x1ul << EPWM_FTCI_FTCMD0_Pos) /*!< EPWM_T::FTCI: FTCMD0 Mask */ - -#define EPWM_FTCI_FTCMD2_Pos (9) /*!< EPWM_T::FTCI: FTCMD2 Position */ -#define EPWM_FTCI_FTCMD2_Msk (0x1ul << EPWM_FTCI_FTCMD2_Pos) /*!< EPWM_T::FTCI: FTCMD2 Mask */ - -#define EPWM_FTCI_FTCMD4_Pos (10) /*!< EPWM_T::FTCI: FTCMD4 Position */ -#define EPWM_FTCI_FTCMD4_Msk (0x1ul << EPWM_FTCI_FTCMD4_Pos) /*!< EPWM_T::FTCI: FTCMD4 Mask */ - -/**@}*/ /* EPWM_CONST */ -/**@}*/ /* end of EPWM register group */ -/**@}*/ /* end of REGISTER group */ - - - -#endif /* __EPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewdt_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewdt_reg.h deleted file mode 100644 index b8585af6303..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewdt_reg.h +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************//** - * @file ewdt_reg.h - * @version V1.00 - * @brief EWDT register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EWDT_REG_H__ -#define __EWDT_REG_H__ - -/** - @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Extra Watch Dog Timer Controller -------------------------*/ -/** - @addtogroup EWDT Extra Watch Dog Timer Controller(EWDT) - Memory Mapped Structure for EWDT Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var EWDT_T::CTL - * Offset: 0x00 EWDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RSTEN |EWDT Time-out Reset Enable Control (Write Protect) - * | | |Setting this bit will enable the EWDT time-out reset system function If the EWDT up counter value has not been cleared after the specific EWDT reset delay period expires. - * | | |0 = EWDT time-out reset system function Disabled. - * | | |1 = EWDT time-out reset system function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |RSTF |EWDT Time-out Reset Flag - * | | |This bit indicates the system has been reset by EWDT time-out reset system event or not. - * | | |0 = EWDT time-out reset system event did not occur. - * | | |1 = EWDT time-out reset system event has been occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |IF |EWDT Time-out Interrupt Flag - * | | |This bit will set to 1 while EWDT up counter value reaches the selected EWDT time-out interval - * | | |0 = EWDT time-out interrupt event interrupt did not occur. - * | | |1 = EWDT time-out interrupt interrupt event occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[4] |WKEN |EWDT Time-out Wake-up Function Control (Write Protect) - * | | |If this bit is set to 1, while EWDT time-out interrupt flag IF (EWDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (EWDT_CTL[6]) is enabled, the EWDT time-out interrupt signal will generate a event to trigger CPU wake-up trigger event to chip. - * | | |0 = Trigger Wake-up trigger event function Disabled if EWDT time-out interrupt signal generated. - * | | |1 = Trigger Wake-up trigger event function Enabled if EWDT time-out interrupt signal generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Chip can be woken-up by while EWDT time-out interrupt signal generated only if EWDT clock source is selected to LIRC or LXT (32 kHz). - * |[5] |WKF |EWDT Time-out Wake-up Flag (Write Protect) - * | | |This bit indicates the EWDT time-out event has triggered interrupt chip wake-up or not.flag status of EWDT - * | | |0 = WDT does not cause chip wake-up. - * | | |1 = Chip wake-up from Idle or Power-down mode if when WDT time-out interrupt signal is generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[6] |INTEN |WDT Time-out Interrupt Enable Control (Write Protect) - * | | |If this bit is enabled, when WDT time-out event occurs, the IF (WDT_CTL[3]) will be set to 1 and the WDT time-out interrupt signal is generated and inform to CPU. - * | | |0 = WDT time-out interrupt Disabled. - * | | |1 = WDT time-out interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |WDTEN |WDT Enable Control (Write Protect) - * | | |0 = Set WDT counter stop Disabled, and (This action will reset the internal up counter value will be reset also). - * | | |1 = Set WDT counter start Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Perform enable or disable WDTEN bit needs 2 * WDT_CLK period to become active, user can read SYNC (WDT_CTL[30]) to check enable/disable command is completed or not. - * | | |Note32: If CWDTEN[2:0] (combined by with Config0[31] and Config0[4:3]) bits is not configure to 0x111, this bit is forced as 1 and user cannot change this bit to 0. - * | | |Note3: This bit disabled needs 2 * WDT_CLK. - * |[11:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect) - * | | |These three bits select the time-out interval period after for the WDT starts counting. - * | | |000 = 2^4 * WDT_CLK. - * | | |001 = 2^6 * WDT_CLK. - * | | |010 = 2^8 * WDT_CLK. - * | | |011 = 2^10 * WDT_CLK. - * | | |100 = 2^12 * WDT_CLK. - * | | |101 = 2^14 * WDT_CLK. - * | | |110 = 2^16 * WDT_CLK. - * | | |111 = 2^18 * WDT_CLK. - * | | |111 = 2^20 * WDT_CLK. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[30] |SYNC |WDT Enable Control SYNC SYNC Flag Indicator (Read Only) - * | | |If use to synchronization, software er can check execute enable/disable this flag after enable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is become completed or not active or not.. - * | | |SYNC delay is - * | | |0 = Set WDTEN bit is WDT enable control synccompletedhronizing is completion. - * | | |1 = Set WDTEN bit WDT enable control is synchronizing and not become active yet.. - * | | |Note: Perform enable or disable WDTEN bit - * | | |This bit enabled needs 2 * WDT_CLK period to become active. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect) - * | | |0 = ICE debug mode acknowledgment affects WDT counting. - * | | |WDT up counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgment Disabled. - * | | |WDT up counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var EWDT_T::ALTCTL - * Offset: 0x04 EWDT Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RSTDSEL |WDT Reset Delay Period Selection (Write Protect) - * | | |When WDT time-out event happened, user has a time named WDT Reset Delay Period to clear execute WDT counter by setting RSTCNT (WDT_CTL[0]) reset to prevent WDT time-out reset system occurred happened - * | | |User can select a suitable setting of RSTDSEL for different application program WDT Reset Delay Period. - * | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK. - * | | |01 = WDT Reset Delay Period is 130 * WDT_CLK. - * | | |10 = WDT Reset Delay Period is 18 * WDT_CLK. - * | | |11 = WDT Reset Delay Period is 3 * WDT_CLK. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This register will be reset to 0 if WDT time-out reset system event occurred happened. - * @var EWDT_T::RSTCNT - * Offset: 0x08 EWDT Reset Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RSTCNT |WDT Reset Counter Register - * | | |Writing 0x00005AA5 to this register field will reset the internal 18-bit WDT up counter value to 0. - * | | |Note: This WDT_RSTCNT is not write protected, but this RSTCNT (WDT_CTL[0]) is write protected. - * | | |Note: Perform RSTCNT to reset counter needs 2 * WDT_CLK period to become active. - */ - __IO uint32_t CTL; /*!< [0x0000] EWDT Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0004] EWDT Alternative Control Register */ - __O uint32_t RSTCNT; /*!< [0x0008] EWDT Reset Counter Register */ - -} EWDT_T; - -/** - @addtogroup EWDT_CONST WDT Bit Field Definition - Constant Definitions for EWDT Controller - @{ -*/ - -#define EWDT_CTL_RSTEN_Pos (1) /*!< EWDT_T::CTL: RSTEN Position */ -#define EWDT_CTL_RSTEN_Msk (0x1ul << EWDT_CTL_RSTEN_Pos) /*!< EWDT_T::CTL: RSTEN Mask */ - -#define EWDT_CTL_RSTF_Pos (2) /*!< EWDT_T::CTL: RSTF Position */ -#define EWDT_CTL_RSTF_Msk (0x1ul << EWDT_CTL_RSTF_Pos) /*!< EWDT_T::CTL: RSTF Mask */ - -#define EWDT_CTL_IF_Pos (3) /*!< EWDT_T::CTL: IF Position */ -#define EWDT_CTL_IF_Msk (0x1ul << EWDT_CTL_IF_Pos) /*!< EWDT_T::CTL: IF Mask */ - -#define EWDT_CTL_WKEN_Pos (4) /*!< EWDT_T::CTL: WKEN Position */ -#define EWDT_CTL_WKEN_Msk (0x1ul << EWDT_CTL_WKEN_Pos) /*!< EWDT_T::CTL: WKEN Mask */ - -#define EWDT_CTL_WKF_Pos (5) /*!< EWDT_T::CTL: WKF Position */ -#define EWDT_CTL_WKF_Msk (0x1ul << EWDT_CTL_WKF_Pos) /*!< EWDT_T::CTL: WKF Mask */ - -#define EWDT_CTL_INTEN_Pos (6) /*!< EWDT_T::CTL: INTEN Position */ -#define EWDT_CTL_INTEN_Msk (0x1ul << EWDT_CTL_INTEN_Pos) /*!< EWDT_T::CTL: INTEN Mask */ - -#define EWDT_CTL_WDTEN_Pos (7) /*!< EWDT_T::CTL: WDTEN Position */ -#define EWDT_CTL_WDTEN_Msk (0x1ul << EWDT_CTL_WDTEN_Pos) /*!< EWDT_T::CTL: WDTEN Mask */ - -#define EWDT_CTL_TOUTSEL_Pos (8) /*!< EWDT_T::CTL: TOUTSEL Position */ -#define EWDT_CTL_TOUTSEL_Msk (0xful << EWDT_CTL_TOUTSEL_Pos) /*!< EWDT_T::CTL: TOUTSEL Mask */ - -#define EWDT_CTL_SYNC_Pos (30) /*!< EWDT_T::CTL: SYNC Position */ -#define EWDT_CTL_SYNC_Msk (0x1ul << EWDT_CTL_SYNC_Pos) /*!< EWDT_T::CTL: SYNC Mask */ - -#define EWDT_CTL_ICEDEBUG_Pos (31) /*!< EWDT_T::CTL: ICEDEBUG Position */ -#define EWDT_CTL_ICEDEBUG_Msk (0x1ul << EWDT_CTL_ICEDEBUG_Pos) /*!< EWDT_T::CTL: ICEDEBUG Mask */ - -#define EWDT_ALTCTL_RSTDSEL_Pos (0) /*!< EWDT_T::ALTCTL: RSTDSEL Position */ -#define EWDT_ALTCTL_RSTDSEL_Msk (0x3ul << EWDT_ALTCTL_RSTDSEL_Pos) /*!< EWDT_T::ALTCTL: RSTDSEL Mask */ - -#define EWDT_RSTCNT_RSTCNT_Pos (0) /*!< EWDT_T::RSTCNT: RSTCNT Position */ -#define EWDT_RSTCNT_RSTCNT_Msk (0xfffffffful << EWDT_RSTCNT_RSTCNT_Pos) /*!< EWDT_T::RSTCNT: RSTCNT Mask */ - - -/**@}*/ /* EWDT_CONST */ -/**@}*/ /* end of EWDT register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __EWDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewwdt_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewwdt_reg.h deleted file mode 100644 index 3331ccb6ea7..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ewwdt_reg.h +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************//** - * @file ewwdt_reg.h - * @version V1.00 - * @brief EWWDT register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EWWDT_REG_H__ -#define __EWWDT_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Extra Window Watchdog Timer -------------------------*/ -/** - @addtogroup EWWDT Extra Window Watchdog Timer(EWWDT) - Memory Mapped Structure for EWWDT Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var EWWDT_T::RLDCNT - * Offset: 0x00 WWDT Reload Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RLDCNT |WWDT Reload Counter Register - * | | |Writing only 0x00005AA5 to this register will reload the WWDT counter value to 0x3F. - * | | |Note1: User can only write execute WWDT_RLDCNT register to the reload WWDT counter value command when current current WWDT counter value CNTDAT (WWDT_CNT[5:0]) is between 10 and CMPDAT (WWDT_CTL[21:16]) - * | | |If user writes 0x00005AA5 in WWDT_RLDCNT register when current current CNTDATWWDT counter value is larger than CMPDAT, WWDT reset signal system event will be generated immediately. - * | | |Note2: Execute WWDT counter reload always needs (WWDT_CLK *3) period to reload CNTDAT to 0x3F and internal prescale counter will be reset also. - * @var EWWDT_T::CTL - * Offset: 0x04 WWDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTEN |WWDT Enable Control Bit - * | | |Set this bit to enable start WWDT counter counting. - * | | |0 = WWDT counter is stopped. - * | | |1 = WWDT counter is starting counting. - * |[1] |INTEN |WWDT Interrupt Enable Control Bit - * | | |If this bit is enabled, when WWDTIF (WWDT_STATUS[0]) is set to 1, the WWDT counter compare match interrupt signal is generated and inform to CPU. - * | | |0 = WWDT counter compare match interrupt Disabled. - * | | |1 = WWDT counter compare match interrupt Enabled. - * |[11:8] |PSCSEL |WWDT Counter Prescale Period Selection - * | | |0000 = Pre-scale is 1; Max time-out period is 1 * 64 * WWDT_CLK. - * | | |0001 = Pre-scale is 2; Max time-out period is 2 * 64 * WWDT_CLK. - * | | |0010 = Pre-scale is 4; Max time-out period is 4 * 64 * WWDT_CLK. - * | | |0011 = Pre-scale is 8; Max time-out period is 8 * 64 * WWDT_CLK. - * | | |0100 = Pre-scale is 16; Max time-out period is 16 * 64 * WWDT_CLK. - * | | |0101 = Pre-scale is 32; Max time-out period is 32 * 64 * WWDT_CLK. - * | | |0110 = Pre-scale is 64; Max time-out period is 64 * 64 * WWDT_CLK. - * | | |0111 = Pre-scale is 128; Max time-out period is 128 * 64 * WWDT_CLK. - * | | |1000 = Pre-scale is 192; Max time-out period is 192 * 64 * WWDT_CLK. - * | | |1001 = Pre-scale is 256; Max time-out period is 256 * 64 * WWDT_CLK. - * | | |1010 = Pre-scale is 384; Max time-out period is 384 * 64 * WWDT_CLK. - * | | |1011 = Pre-scale is 512; Max time-out period is 512 * 64 * WWDT_CLK. - * | | |1100 = Pre-scale is 768; Max time-out period is 768 * 64 * WWDT_CLK. - * | | |1101 = Pre-scale is 1024; Max time-out period is 1024 * 64 * WWDT_CLK. - * | | |1110 = Pre-scale is 1536; Max time-out period is 1536 * 64 * WWDT_CLK. - * | | |1111 = Pre-scale is 2048; Max time-out period is 2048 * 64 * WWDT_CLK. - * |[21:16] |CMPDAT |WWDT Window Compare Register Value - * | | |Set this register field to adjust the valid reload window interval when WWDTIF (WWDT_STATUS[0]) is generated.. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT CNTDAT (WWDT_CNT[5:]) is counter value between 10 and CMPDAT - * | | |If user writes 0x00005AA5 in WWDT_RLDCNT register when current WWDT counter value CNTDAT is larger than CMPDAT, WWDT reset system event signal will be generated immediately. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control - * | | |0 = ICE debug mode acknowledgment effects WWDT counter counting. - * | | |WWDT down counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgment Disabled. - * | | |WWDT down counter will keep going counting no matter CPU is held by ICE or not. - * @var EWWDT_T::STATUS - * Offset: 0x08 WWDT Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTIF |WWDT Compare Match Interrupt Flag - * | | |This bit indicates the that current CNTDAT (WWDT_CNT[5:0]) matches the CMPDAT (WWDT_CTL[21:16])interrupt flag status of WWDT while WWDT counter value matches CMPDAT (WWDT_CTL[21:16]). - * | | |0 = No effect. - * | | |1 = WWDT WWDT CNTDAT counter value matches the CMPDAT. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WWDTRF |WWDT Timer-out Reset System Flag - * | | |If this bit is set to 1, it This bit indicates the that system has been reset by WWDT counter time-out reset system event.or not. - * | | |0 = WWDT time-out reset system event did not occur. - * | | |1 = WWDT time-out reset system event occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var EWWDT_T::CNT - * Offset: 0x0C WWDT Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CNTDAT |WWDT Counter Value - * | | |CNTDAT will be updated continuously to monitor 6-bit WWDT down counter value. - */ - __O uint32_t RLDCNT; /*!< [0x0000] EWWDT Reload Counter Register */ - __IO uint32_t CTL; /*!< [0x0004] EWWDT Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] EWWDT Status Register */ - __I uint32_t CNT; /*!< [0x000c] EWWDT Counter Value Register */ - -} EWWDT_T; - - -/** - @addtogroup WWDT_CONST WWDT Bit Field Definition - Constant Definitions for WWDT Controller - @{ -*/ - -#define EWWDT_RLDCNT_RLDCNT_Pos (0) /*!< EWWDT_T::RLDCNT: RLDCNT Position */ -#define EWWDT_RLDCNT_RLDCNT_Msk (0xfffffffful << EWWDT_RLDCNT_RLDCNT_Pos) /*!< EWWDT_T::RLDCNT: RLDCNT Mask */ - -#define EWWDT_CTL_WWDTEN_Pos (0) /*!< EWWDT_T::CTL: WWDTEN Position */ -#define EWWDT_CTL_WWDTEN_Msk (0x1ul << EWWDT_CTL_WWDTEN_Pos) /*!< EWWDT_T::CTL: WWDTEN Mask */ - -#define EWWDT_CTL_INTEN_Pos (1) /*!< EWWDT_T::CTL: INTEN Position */ -#define EWWDT_CTL_INTEN_Msk (0x1ul << EWWDT_CTL_INTEN_Pos) /*!< EWWDT_T::CTL: INTEN Mask */ - -#define EWWDT_CTL_PSCSEL_Pos (8) /*!< EWWDT_T::CTL: PSCSEL Position */ -#define EWWDT_CTL_PSCSEL_Msk (0xful << EWWDT_CTL_PSCSEL_Pos) /*!< EWWDT_T::CTL: PSCSEL Mask */ - -#define EWWDT_CTL_CMPDAT_Pos (16) /*!< EWWDT_T::CTL: CMPDAT Position */ -#define EWWDT_CTL_CMPDAT_Msk (0x3ful << EWWDT_CTL_CMPDAT_Pos) /*!< EWWDT_T::CTL: CMPDAT Mask */ - -#define EWWDT_CTL_ICEDEBUG_Pos (31) /*!< EWWDT_T::CTL: ICEDEBUG Position */ -#define EWWDT_CTL_ICEDEBUG_Msk (0x1ul << EWWDT_CTL_ICEDEBUG_Pos) /*!< EWWDT_T::CTL: ICEDEBUG Mask */ - -#define EWWDT_STATUS_WWDTIF_Pos (0) /*!< EWWDT_T::STATUS: WWDTIF Position */ -#define EWWDT_STATUS_WWDTIF_Msk (0x1ul << EWWDT_STATUS_WWDTIF_Pos) /*!< EWWDT_T::STATUS: WWDTIF Mask */ - -#define EWWDT_STATUS_WWDTRF_Pos (1) /*!< EWWDT_T::STATUS: WWDTRF Position */ -#define EWWDT_STATUS_WWDTRF_Msk (0x1ul << EWWDT_STATUS_WWDTRF_Pos) /*!< EWWDT_T::STATUS: WWDTRF Mask */ - -#define EWWDT_CNT_CNTDAT_Pos (0) /*!< EWWDT_T::CNT: CNTDAT Position */ -#define EWWDT_CNT_CNTDAT_Msk (0x3ful << EWWDT_CNT_CNTDAT_Pos) /*!< EWWDT_T::CNT: CNTDAT Mask */ - -/**@}*/ /* EWWDT_CONST */ -/**@}*/ /* end of EWWDT register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __EWWDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/fmc_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/fmc_reg.h deleted file mode 100644 index 95cde7b8896..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/fmc_reg.h +++ /dev/null @@ -1,628 +0,0 @@ -/**************************************************************************//** - * @file fmc_reg.h - * @version V1.00 - * @brief FMC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __FMC_REG_H__ -#define __FMC_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Flash Memory Controller -------------------------*/ -/** - @addtogroup FMC Flash Memory Controller(FMC) - Memory Mapped Structure for FMC Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var FMC_T::ISPCTL - * Offset: 0x00 ISP Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPEN |ISP Enable Bit (Write Protect) - * | | |ISP function enable bit. Set this bit to enable ISP function. - * | | |0 = ISP function Disabled. - * | | |1 = ISP function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |BS |Boot Select (Write Protect) - * | | |When MBS in CONFIG0 is 1, set/clear this bit to select next booting from LDROM/APROM, respectively - * | | |This bit also functions as chip booting status flag, which can be used to check where chip booted from - * | | |This bit is initiated with the inverse value of CBS[1] (CONFIG0[7]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened - * | | |0 = Booting from APROM when MBS (CONFIG0[5]) is 1. - * | | |1 = Booting from LDROM when MBS (CONFIG0[5]) is 1. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |APUEN |APROM Update Enable Bit (Write Protect) - * | | |0 = APROM cannot be updated when the chip runs in APROM. - * | | |1 = APROM can be updated when the chip runs in APROM. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |CFGUEN |CONFIG Update Enable Bit (Write Protect) - * | | |0 = CONFIG cannot be updated. - * | | |1 = CONFIG can be updated. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |LDUEN |LDROM Update Enable Bit (Write Protect) - * | | |LDROM update enable bit. - * | | |0 = LDROM cannot be updated. - * | | |1 = LDROM can be updated. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |ISPFF |ISP Fail Flag (Write Protect) - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |This bit needs to be cleared by writing 1 to it. - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) Page Erase command at LOCK mode with ICE connection - * | | |(5) Erase or Program command at brown-out detected - * | | |(6) Destination address is illegal, such as over an available range. - * | | |(7) Invalid ISP commands - * | | |(8) KPROM is erased/programmed if KEYLOCK is set to 1 - * | | |(9) APROM is erased/programmed if KEYLOCK is set to 1 - * | | |(10) LDROM is erased/programmed if KEYLOCK is set to 1 - * | | |(11) CONFIG is erased/programmed if KEYLOCK is set to 1 and KEYENROM[0] is 0 - * | | |(12) Read any content of boot loader with ICE connection - * | | |(13) The address of block erase and bank erase is not in APROM - * | | |(14) ISP CMD in XOM region, except mass erase, page erase and chksum command - * | | |(15) The wrong setting of page erase ISP CMD in XOM - * | | |(16) Violate XOM setting one time protection - * | | |(17) Page erase ISP CMD in Secure/Non-secure region setting page - * | | |(18) Mass erase when MERASE (CFG0[13]) is disable - * | | |(19) Page erase, mass erase , multi-word program or 64-bit word program in OTP - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |BL |Boot Loader Booting (Write Protect) - * | | |This bit is initiated with the inverses value of MBS (CONFIG0[5]) - * | | |Any reset, except CPU reset (CPU is 1) or system reset (SYS), BL will be reloaded - * | | |This bit is used to check chip boot from Boot Loader or not - * | | |User should keep original value of this bit when updating FMC_ISPCTL register. - * | | |0 = Booting from APROM or LDROM. - * | | |1 = Booting from Boot Loader. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[24] |INTEN |Interrupt Enable (Write Protect) - * | | |0 = ISP INT Disabled. - * | | |1 = ISP INT Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. Before use INT, user need to clear the INTFLAG(FMC_ISPSTS[24]) make sure INT happen at correct time. - * @var FMC_T::ISPADDR - * Offset: 0x04 ISP Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPADDR |ISP Address - * | | |The NuMicro M2355 series is equipped with embedded flash - * | | |ISPADDR[1:0] must be kept 00 for ISP 32-bit operation - * | | |ISPADDR[2:0] must be kept 000 for ISP 64-bit operation. - * | | |For CRC32 Checksum Calculation command, this field is the flash starting address for checksum calculation, 2 KBytes alignment is necessary for CRC32 checksum calculation. - * | | |For FLASH 32-bit Program, ISP address needs word alignment (4-byte) - * | | |For FLASH 64-bit Program, ISP address needs double word alignment (8-byte). - * @var FMC_T::ISPDAT - * Offset: 0x08 ISP Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT |ISP Data - * | | |Write data to this register before ISP program operation. - * | | |Read data from this register after ISP read operation. - * | | |When ISPFF (FMC_ISPCTL[6]) is 1, ISPDAT = 0xffff_ffff - * | | |For Run CRC32 Checksum Calculation command, ISPDAT is the memory size (byte) and 2 KBytes alignment - * | | |For ISP Read CRC32 Checksum command, ISPDAT is the checksum result - * | | |If ISPDAT = 0x0000_0000, it means that (1) the checksum calculation is in progress, or (2) the memory range for checksum calculation is incorrect - * | | |For XOM page erase function, , ISPDAT = 0x0055_aa03. - * @var FMC_T::ISPCMD - * Offset: 0x0C ISP Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |CMD |ISP Command - * | | |ISP command table is shown below: - * | | |0x00= FLASH Read. - * | | |0x04= Read Unique ID. - * | | |0x08= Read Flash All-One Result. - * | | |0x0B= Read Company ID. - * | | |0x0C= Read Device ID. - * | | |0x0D= Read Checksum. - * | | |0x21= FLASH 32-bit Program. - * | | |0x22= FLASH Page Erase. Erase any page in two banks, except for OTP. - * | | |0x23= FLASH Bank Erase. Erase all pages of APROM in BANK0 or BANK1. - * | | |0x25= FLASH Block Erase Erase four pages alignment of APROM in BANK0 or BANK1.. - * | | |0x27= FLASH Multi-Word Program. - * | | |0x28= Run Flash All-One Verification. - * | | |0x2D= Run Checksum Calculation. - * | | |0x2E= Vector Remap. - * | | |0x40= FLASH 64-bit Read. - * | | |0x61= FLASH 64-bit Program. - * | | |The other commands are invalid. - * @var FMC_T::ISPTRG - * Offset: 0x10 ISP Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPGO |ISP Start Trigger (Write Protect) - * | | |Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP operation is finished - * | | |When ISPGO=1, the operation of accessing value from address FMC_BA+0x00 to FMC_BA+0x68 would halt CPU still ISPGO =0 - * | | |If user want to monitor whether ISP finish or not,user can access FMC_MPSTS[0] MPBUSY. - * | | |0 = ISP operation is finished. - * | | |1 = ISP is progressed. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::ISPSTS - * Offset: 0x40 ISP Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPBUSY |ISP Busy Flag (Read Only) - * | | |Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP operation is finished. - * | | |This bit is the mirror of ISPGO(FMC_ISPTRG[0]). - * | | |0 = ISP operation is finished. - * | | |1 = ISP is progressed. - * |[2] |CBS |Boot Selection of CONFIG (Read Only) - * | | |This bit is initiated with the CBS (CONFIG0[7]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened. - * | | |The following function is valid when MBS (FMC_ISPSTS[3])= 1. - * | | |0 = LDROM with IAP mode. - * | | |1 = APROM with IAP mode. - * |[3] |MBS |Boot From Boot Loader Selection Flag (Read Only) - * | | |This bit is initiated with the MBS (CONFIG0[5]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened - * | | |0 = Booting from Boot Loader. - * | | |1 = Booting from LDROM/APROM.(.see CBS bit setting) - * |[4] |FCYCDIS |Flash Access Cycle Auto-tuning Disabled Flag (Read Only) - * | | |This bit is set if flash access cycle auto-tuning function is disabled - * | | |The auto-tuning function is disabled by FADIS(FMC_CYCCTL[8]) or HIRC clock is not ready. - * | | |0 = Flash access cycle auto-tuning is Enabled. - * | | |1 = Flash access cycle auto-tuning is Disabled. - * |[5] |PGFF |Flash Program with Fast Verification Flag (Read Only) - * | | |This bit is set if data is mismatched at ISP programming verification - * | | |This bit is clear by performing ISP flash erase or ISP read CID operation - * | | |0 = Flash Program is success. - * | | |1 = Flash Program is fail. Program data is different with data in the flash memory - * |[6] |ISPFF |ISP Fail Flag (Write Protect) - * | | |This bit is the mirror of ISPFF (FMC_ISPCTL[6]), it needs to be cleared by writing 1 to FMC_ISPCTL[6] or FMC_ISPSTS[6] if this bit is set. - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) Page Erase command at LOCK mode with ICE connection - * | | |(5) Erase or Program command at brown-out detected - * | | |(6) Destination address is illegal, such as over an available range. - * | | |(7) Invalid ISP commands - * | | |(8) KPROM is erased/programmed if KEYLOCK is set to 1 - * | | |(9) APROM is erased/programmed if KEYLOCK is set to 1 - * | | |(10) LDROM is erased/programmed if KEYLOCK is set to 1 - * | | |(11) CONFIG is erased/programmed if KEYLOCK is set to 1 and KEYENROM[0] is 0. - * | | |(12) Read any content of boot loader with ICE connection - * | | |(13) The address of block erase and bank erase is not in APROM - * | | |(14) ISP CMD in XOM region, except mass erase, page erase and chksum command - * | | |(15) The wrong setting of page erase ISP CMD in XOM - * | | |(16) Violate XOM setting one time protection - * | | |(17) Page erase ISP CMD in Secure/Non-secure region setting page - * | | |(18) Mass erase when MERASE (CFG0[13]) is disable - * | | |(19) Page erase, mass erase , multi-word program or 64-bit word program in OTP - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |ALLONE |Flash All-one Verification Flag - * | | |This bit is set by hardware if all of flash bits are 1, and clear if flash bits are not all 1 after Run Flash All-One Verification complete; this bit also can be clear by writing 1 - * | | |0 = All of flash bits are 1 after Run Flash All-One Verification complete. - * | | |1 = Flash bits are not all 1 after Run Flash All-One Verification complete. - * |[23:9] |VECMAP |Vector Page Mapping Address (Read Only) - * | | |All access to 0x0000_0000~0x0000_01FF is remapped to the flash memory address {VECMAP[14:0], 9'h000} ~ {VECMAP[14:0], 9'h1FF} - * |[24] |INTFLAG |Interrupt Flag - * | | |0 = ISP is not finish. - * | | |1 = ISP done or ISPFF set. - * @var FMC_T::CYCCTL - * Offset: 0x4C Flash Access Cycle Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CYCLE |Flash Access Cycle Control (Write Protect) - * | | |This register is updated automatically by hardware while FCYCDIS (FMC_ISPSTS[4]) is 0, and updated by software while auto-tuning function disabled ( FADIS (FMC_CYCTL[8]) is 1). - * | | |When auto-tuning function disabled, user needs to check the speed of HCLK and set the cycle >0. - * | | |0000 = CPU access with zero wait cycle ; Flash access cycle is 1. The HCLK working frequency range is <27MHz; Cache is disabled by hardware. - * | | |0001 = CPU access with one wait cycle if cache miss; Flash access cycle is 1. The HCLK working frequency range range is<27MHz. - * | | |0010 = CPU access with two wait cycles if cache miss; Flash access cycle is 2. The optimized HCLK working frequency range is 25~52 MHz. - * | | |0011 = CPU access with three wait cycles if cache miss; Flash access cycle is 3. The optimized HCLK working frequency range is 49~79MHz. - * | | |Others = Reserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |FADIS |Flash Access Cycle Auto-tuning Disabled Control (Write Protect) - * | | |Set this bit to disable flash access cycle auto-tuning function - * | | |0 = Flash access cycle auto-tuning is enabled. - * | | |1 = Flash access cycle auto-tuning is disabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::MPDAT0 - * Offset: 0x80 ISP Data0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT0 |ISP Data 0 - * | | |This register is the first 32-bit data for 32-bit/64-bit/multi-word programming, and it is also the mirror of FMC_ISPDAT, both registers keep the same data - * @var FMC_T::MPDAT1 - * Offset: 0x84 ISP Data1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT1 |ISP Data 1 - * | | |This register is the second 32-bit data for 64-bit/multi-word programming. - * @var FMC_T::MPDAT2 - * Offset: 0x88 ISP Data2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT2 |ISP Data 2 - * | | |This register is the third 32-bit data for multi-word programming. - * @var FMC_T::MPDAT3 - * Offset: 0x8C ISP Data3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT3 |ISP Data 3 - * | | |This register is the fourth 32-bit data for multi-word programming. - * @var FMC_T::MPSTS - * Offset: 0xC0 ISP Multi-Program Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MPBUSY |ISP Multi-word Program Busy Flag (Read Only) - * | | |Write 1 to start ISP Multi-Word program operation and this bit will be cleared to 0 by hardware automatically when ISP Multi-Word program operation is finished. - * | | |This bit is the mirror of ISPGO(FMC_ISPTRG[0]). - * | | |0 = ISP Multi-Word program operation is finished. - * | | |1 = ISP Multi-Word program operation is progressed. - * |[1] |PPGO |ISP Multi-program Status (Read Only) - * | | |0 = ISP multi-word program operation is not active. - * | | |1 = ISP multi-word program operation is in progress. - * |[2] |ISPFF |ISP Fail Flag (Read Only) - * | | |This bit is the mirror of ISPFF (FMC_ISPCTL[6]), it needs to be cleared by writing 1 to FMC_ISPCTL[6] or FMC_ISPSTS[6] - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) Page Erase command at LOCK mode with ICE connection - * | | |(5) Erase or Program command at brown-out detected - * | | |(6) Destination address is illegal, such as over an available range. - * | | |(7) Invalid ISP commands - * |[4] |D0 |ISP DATA 0 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT0 is written and auto-clear to 0 when the FMC_MPDAT0 data is programmed to flash complete. - * | | |0 = FMC_MPDAT0 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT0 register has been written, and not program to flash complete. - * |[5] |D1 |ISP DATA 1 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT1 is written and auto-clear to 0 when the FMC_MPDAT1 data is programmed to flash complete. - * | | |0 = FMC_MPDAT1 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT1 register has been written, and not program to flash complete. - * |[6] |D2 |ISP DATA 2 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT2 is written and auto-clear to 0 when the FMC_MPDAT2 data is programmed to flash complete. - * | | |0 = FMC_MPDAT2 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT2 register has been written, and not program to flash complete. - * |[7] |D3 |ISP DATA 3 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT3 is written and auto-clear to 0 when the FMC_MPDAT3 data is programmed to flash complete. - * | | |0 = FMC_MPDAT3 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT3 register has been written, and not program to flash complete. - * @var FMC_T::MPADDR - * Offset: 0xC4 ISP Multi-Program Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MPADDR |ISP Multi-word Program Address - * | | |MPADDR is the address of ISP multi-word program operation when ISPGO flag is 1. - * | | |MPADDR will keep the final ISP address when ISP multi-word program is complete. - * @var FMC_T::XOMR0STS - * Offset: 0xD0 XOM Region 0 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 0 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 0. - * |[31:8] |BASE |XOM Region 0 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 0. - * @var FMC_T::XOMR1STS - * Offset: 0xD4 XOM Region 1 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 1 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 1. - * |[31:8] |BASE |XOM Region 1 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 1. - * @var FMC_T::XOMR2STS - * Offset: 0xD8 XOM Region 2 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 2 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 2. - * |[31:8] |BASE |XOM Region 2 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 2. - * @var FMC_T::XOMR3STS - * Offset: 0xDC XOM Region 3 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 3 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 3. - * |[31:8] |BASE |XOM Region 3 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 3. - * @var FMC_T::XOMSTS - * Offset: 0xE0 XOM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |XOMR0ON |XOM Region 0 On - * | | |XOM Region 0 active status. - * | | |0 = No active. - * | | |1 = XOM region 0 is active. - * |[1] |XOMR1ON |XOM Region 1 On - * | | |XOM Region 1 active status. - * | | |0 = No active. - * | | |1 = XOM region 1 is active. - * |[2] |XOMR2ON |XOM Region 2 On - * | | |XOM Region 2 active status. - * | | |0 = No active. - * | | |1 = XOM region 2 is active. - * |[3] |XOMR3ON |XOM Region 3 On - * | | |XOM Region 3 active status. - * | | |0 = No active. - * | | |1 = XOM region 3 is active. - * |[4] |XOMPEF |XOM Page Erase Function Fail - * | | |XOM page erase function status. If XOMPEF is set to 1, user needs to erase XOM region again. - * | | |0 = Success. - * | | |1 = Fail. - */ - __IO uint32_t ISPCTL; /*!< [0x0000] ISP Control Register */ - __IO uint32_t ISPADDR; /*!< [0x0004] ISP Address Register */ - __IO uint32_t ISPDAT; /*!< [0x0008] ISP Data Register */ - __IO uint32_t ISPCMD; /*!< [0x000c] ISP Command Register */ - __IO uint32_t ISPTRG; /*!< [0x0010] ISP Trigger Control Register */ - __I uint32_t RESERVE0[11]; - __IO uint32_t ISPSTS; /*!< [0x0040] ISP Status Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t CYCCTL; /*!< [0x004c] Flash Access Cycle Control Register */ - __I uint32_t RESERVE2[12]; - __IO uint32_t MPDAT0; /*!< [0x0080] ISP Data0 Register */ - __IO uint32_t MPDAT1; /*!< [0x0084] ISP Data1 Register */ - __IO uint32_t MPDAT2; /*!< [0x0088] ISP Data2 Register */ - __IO uint32_t MPDAT3; /*!< [0x008c] ISP Data3 Register */ - __I uint32_t RESERVE3[12]; - __I uint32_t MPSTS; /*!< [0x00c0] ISP Multi-Program Status Register */ - __I uint32_t MPADDR; /*!< [0x00c4] ISP Multi-Program Address Register */ - __I uint32_t RESERVE4[2]; - __I uint32_t XOMR0STS; /*!< [0x00d0] XOM Region 0 Status Register */ - __I uint32_t XOMR1STS; /*!< [0x00d4] XOM Region 1 Status Register */ - __I uint32_t XOMR2STS; /*!< [0x00d8] XOM Region 2 Status Register */ - __I uint32_t XOMR3STS; /*!< [0x00dc] XOM Region 3 Status Register */ - __I uint32_t XOMSTS; /*!< [0x00e0] XOM Status Register */ - __I uint32_t RESERVE5[7]; - __IO uint32_t DFCTL; /*!< [0x0100] Data Flash Function Control Register */ - __I uint32_t RESERVE6; - __IO uint32_t DFSTS; /*!< [0x0108] Data Flash Status Register */ - __O uint32_t SCRKEY; /*!< [0x010c] Data Flash Scrambling Key Register */ - -} FMC_T; - -/** - @addtogroup FMC_CONST FMC Bit Field Definition - Constant Definitions for FMC Controller - @{ -*/ - -#define FMC_ISPCTL_ISPEN_Pos (0) /*!< FMC_T::ISPCTL: ISPEN Position */ -#define FMC_ISPCTL_ISPEN_Msk (0x1ul << FMC_ISPCTL_ISPEN_Pos) /*!< FMC_T::ISPCTL: ISPEN Mask */ - -#define FMC_ISPCTL_APUEN_Pos (3) /*!< FMC_T::ISPCTL: APUEN Position */ -#define FMC_ISPCTL_APUEN_Msk (0x1ul << FMC_ISPCTL_APUEN_Pos) /*!< FMC_T::ISPCTL: APUEN Mask */ - -#define FMC_ISPCTL_CFGUEN_Pos (4) /*!< FMC_T::ISPCTL: CFGUEN Position */ -#define FMC_ISPCTL_CFGUEN_Msk (0x1ul << FMC_ISPCTL_CFGUEN_Pos) /*!< FMC_T::ISPCTL: CFGUEN Mask */ - -#define FMC_ISPCTL_LDUEN_Pos (5) /*!< FMC_T::ISPCTL: LDUEN Position */ -#define FMC_ISPCTL_LDUEN_Msk (0x1ul << FMC_ISPCTL_LDUEN_Pos) /*!< FMC_T::ISPCTL: LDUEN Mask */ - -#define FMC_ISPCTL_ISPFF_Pos (6) /*!< FMC_T::ISPCTL: ISPFF Position */ -#define FMC_ISPCTL_ISPFF_Msk (0x1ul << FMC_ISPCTL_ISPFF_Pos) /*!< FMC_T::ISPCTL: ISPFF Mask */ - -#define FMC_ISPCTL_INTEN_Pos (24) /*!< FMC_T::ISPCTL: INTEN Position */ -#define FMC_ISPCTL_INTEN_Msk (0x1ul << FMC_ISPCTL_INTEN_Pos) /*!< FMC_T::ISPCTL: INTEN Mask */ - -#define FMC_ISPADDR_ISPADDR_Pos (0) /*!< FMC_T::ISPADDR: ISPADDR Position */ -#define FMC_ISPADDR_ISPADDR_Msk (0xfffffffful << FMC_ISPADDR_ISPADDR_Pos) /*!< FMC_T::ISPADDR: ISPADDR Mask */ - -#define FMC_ISPDAT_ISPDAT_Pos (0) /*!< FMC_T::ISPDAT: ISPDAT Position */ -#define FMC_ISPDAT_ISPDAT_Msk (0xfffffffful << FMC_ISPDAT_ISPDAT_Pos) /*!< FMC_T::ISPDAT: ISPDAT Mask */ - -#define FMC_ISPCMD_CMD_Pos (0) /*!< FMC_T::ISPCMD: CMD Position */ -#define FMC_ISPCMD_CMD_Msk (0x7ful << FMC_ISPCMD_CMD_Pos) /*!< FMC_T::ISPCMD: CMD Mask */ - -#define FMC_ISPTRG_ISPGO_Pos (0) /*!< FMC_T::ISPTRG: ISPGO Position */ -#define FMC_ISPTRG_ISPGO_Msk (0x1ul << FMC_ISPTRG_ISPGO_Pos) /*!< FMC_T::ISPTRG: ISPGO Mask */ - -#define FMC_ISPSTS_ISPBUSY_Pos (0) /*!< FMC_T::ISPSTS: ISPBUSY Position */ -#define FMC_ISPSTS_ISPBUSY_Msk (0x1ul << FMC_ISPSTS_ISPBUSY_Pos) /*!< FMC_T::ISPSTS: ISPBUSY Mask */ - -#define FMC_ISPSTS_CBS_Pos (2) /*!< FMC_T::ISPSTS: CBS Position */ -#define FMC_ISPSTS_CBS_Msk (0x1ul << FMC_ISPSTS_CBS_Pos) /*!< FMC_T::ISPSTS: CBS Mask */ - -#define FMC_ISPSTS_MBS_Pos (3) /*!< FMC_T::ISPSTS: MBS Position */ -#define FMC_ISPSTS_MBS_Msk (0x1ul << FMC_ISPSTS_MBS_Pos) /*!< FMC_T::ISPSTS: MBS Mask */ - -#define FMC_ISPSTS_FCYCDIS_Pos (4) /*!< FMC_T::ISPSTS: FCYCDIS Position */ -#define FMC_ISPSTS_FCYCDIS_Msk (0x1ul << FMC_ISPSTS_FCYCDIS_Pos) /*!< FMC_T::ISPSTS: FCYCDIS Mask */ - -#define FMC_ISPSTS_PGFF_Pos (5) /*!< FMC_T::ISPSTS: PGFF Position */ -#define FMC_ISPSTS_PGFF_Msk (0x1ul << FMC_ISPSTS_PGFF_Pos) /*!< FMC_T::ISPSTS: PGFF Mask */ - -#define FMC_ISPSTS_ISPFF_Pos (6) /*!< FMC_T::ISPSTS: ISPFF Position */ -#define FMC_ISPSTS_ISPFF_Msk (0x1ul << FMC_ISPSTS_ISPFF_Pos) /*!< FMC_T::ISPSTS: ISPFF Mask */ - -#define FMC_ISPSTS_ALLONE_Pos (7) /*!< FMC_T::ISPSTS: ALLONE Position */ -#define FMC_ISPSTS_ALLONE_Msk (0x1ul << FMC_ISPSTS_ALLONE_Pos) /*!< FMC_T::ISPSTS: ALLONE Mask */ - -#define FMC_ISPSTS_VECMAP_Pos (9) /*!< FMC_T::ISPSTS: VECMAP Position */ -#define FMC_ISPSTS_VECMAP_Msk (0x7ffful << FMC_ISPSTS_VECMAP_Pos) /*!< FMC_T::ISPSTS: VECMAP Mask */ - -#define FMC_ISPSTS_INTFLAG_Pos (24) /*!< FMC_T::ISPSTS: INTFLAG Position */ -#define FMC_ISPSTS_INTFLAG_Msk (0x1ul << FMC_ISPSTS_INTFLAG_Pos) /*!< FMC_T::ISPSTS: INTFLAG Mask */ - -#define FMC_ISPSTS_ISPCERR_Pos (28) /*!< FMC_T::ISPSTS: ISPCERR Position */ -#define FMC_ISPSTS_ISPCERR_Msk (0x1ul << FMC_ISPSTS_ISPCERR_Pos) /*!< FMC_T::ISPSTS: ISPCERR Mask */ - -#define FMC_ISPSTS_MIRBOUND_Pos (29) /*!< FMC_T::ISPSTS: MIRBOUND Position */ -#define FMC_ISPSTS_MIRBOUND_Msk (0x1ul << FMC_ISPSTS_MIRBOUND_Pos) /*!< FMC_T::ISPSTS: MIRBOUND Mask */ - -#define FMC_ISPSTS_FBS_Pos (30) /*!< FMC_T::ISPSTS: FBS Position */ -#define FMC_ISPSTS_FBS_Msk (0x1ul << FMC_ISPSTS_FBS_Pos) /*!< FMC_T::ISPSTS: FBS Mask */ - -#define FMC_CYCCTL_CYCLE_Pos (0) /*!< FMC_T::CYCCTL: CYCLE Position */ -#define FMC_CYCCTL_CYCLE_Msk (0xful << FMC_CYCCTL_CYCLE_Pos) /*!< FMC_T::CYCCTL: CYCLE Mask */ - -#define FMC_CYCCTL_FADIS_Pos (8) /*!< FMC_T::CYCCTL: FADIS Position */ -#define FMC_CYCCTL_FADIS_Msk (0x1ul << FMC_CYCCTL_FADIS_Pos) /*!< FMC_T::CYCCTL: FADIS Mask */ - -#define FMC_KPKEY0_KPKEY0_Pos (0) /*!< FMC_T::KPKEY0: KPKEY0 Position */ -#define FMC_KPKEY0_KPKEY0_Msk (0xfffffffful << FMC_KPKEY0_KPKEY0_Pos) /*!< FMC_T::KPKEY0: KPKEY0 Mask */ - -#define FMC_KPKEY1_KPKEY1_Pos (0) /*!< FMC_T::KPKEY1: KPKEY1 Position */ -#define FMC_KPKEY1_KPKEY1_Msk (0xfffffffful << FMC_KPKEY1_KPKEY1_Pos) /*!< FMC_T::KPKEY1: KPKEY1 Mask */ - -#define FMC_KPKEY2_KPKEY2_Pos (0) /*!< FMC_T::KPKEY2: KPKEY2 Position */ -#define FMC_KPKEY2_KPKEY2_Msk (0xfffffffful << FMC_KPKEY2_KPKEY2_Pos) /*!< FMC_T::KPKEY2: KPKEY2 Mask */ - -#define FMC_KPKEYTRG_KPKEYGO_Pos (0) /*!< FMC_T::KPKEYTRG: KPKEYGO Position */ -#define FMC_KPKEYTRG_KPKEYGO_Msk (0x1ul << FMC_KPKEYTRG_KPKEYGO_Pos) /*!< FMC_T::KPKEYTRG: KPKEYGO Mask */ - -#define FMC_KPKEYTRG_TCEN_Pos (1) /*!< FMC_T::KPKEYTRG: TCEN Position */ -#define FMC_KPKEYTRG_TCEN_Msk (0x1ul << FMC_KPKEYTRG_TCEN_Pos) /*!< FMC_T::KPKEYTRG: TCEN Mask */ - -#define FMC_KPKEYSTS_KEYBUSY_Pos (0) /*!< FMC_T::KPKEYSTS: KEYBUSY Position */ -#define FMC_KPKEYSTS_KEYBUSY_Msk (0x1ul << FMC_KPKEYSTS_KEYBUSY_Pos) /*!< FMC_T::KPKEYSTS: KEYBUSY Mask */ - -#define FMC_KPKEYSTS_KEYLOCK_Pos (1) /*!< FMC_T::KPKEYSTS: KEYLOCK Position */ -#define FMC_KPKEYSTS_KEYLOCK_Msk (0x1ul << FMC_KPKEYSTS_KEYLOCK_Pos) /*!< FMC_T::KPKEYSTS: KEYLOCK Mask */ - -#define FMC_KPKEYSTS_KEYMATCH_Pos (2) /*!< FMC_T::KPKEYSTS: KEYMATCH Position */ -#define FMC_KPKEYSTS_KEYMATCH_Msk (0x1ul << FMC_KPKEYSTS_KEYMATCH_Pos) /*!< FMC_T::KPKEYSTS: KEYMATCH Mask */ - -#define FMC_KPKEYSTS_FORBID_Pos (3) /*!< FMC_T::KPKEYSTS: FORBID Position */ -#define FMC_KPKEYSTS_FORBID_Msk (0x1ul << FMC_KPKEYSTS_FORBID_Pos) /*!< FMC_T::KPKEYSTS: FORBID Mask */ - -#define FMC_KPKEYSTS_KEYFLAG_Pos (4) /*!< FMC_T::KPKEYSTS: KEYFLAG Position */ -#define FMC_KPKEYSTS_KEYFLAG_Msk (0x1ul << FMC_KPKEYSTS_KEYFLAG_Pos) /*!< FMC_T::KPKEYSTS: KEYFLAG Mask */ - -#define FMC_KPKEYSTS_CFGFLAG_Pos (5) /*!< FMC_T::KPKEYSTS: CFGFLAG Position */ -#define FMC_KPKEYSTS_CFGFLAG_Msk (0x1ul << FMC_KPKEYSTS_CFGFLAG_Pos) /*!< FMC_T::KPKEYSTS: CFGFLAG Mask */ - -#define FMC_KPKEYSTS_SBKPBUSY_Pos (8) /*!< FMC_T::KPKEYSTS: SBKPBUSY Position */ -#define FMC_KPKEYSTS_SBKPBUSY_Msk (0x1ul << FMC_KPKEYSTS_SBKPBUSY_Pos) /*!< FMC_T::KPKEYSTS: SBKPBUSY Mask */ - -#define FMC_KPKEYSTS_SBKPFLAG_Pos (9) /*!< FMC_T::KPKEYSTS: SBKPFLAG Position */ -#define FMC_KPKEYSTS_SBKPFLAG_Msk (0x1ul << FMC_KPKEYSTS_SBKPFLAG_Pos) /*!< FMC_T::KPKEYSTS: SBKPFLAG Mask */ - -#define FMC_KPKEYCNT_KPKECNT_Pos (0) /*!< FMC_T::KPKEYCNT: KPKECNT Position */ -#define FMC_KPKEYCNT_KPKECNT_Msk (0x3ful << FMC_KPKEYCNT_KPKECNT_Pos) /*!< FMC_T::KPKEYCNT: KPKECNT Mask */ - -#define FMC_KPKEYCNT_KPKEMAX_Pos (8) /*!< FMC_T::KPKEYCNT: KPKEMAX Position */ -#define FMC_KPKEYCNT_KPKEMAX_Msk (0x3ful << FMC_KPKEYCNT_KPKEMAX_Pos) /*!< FMC_T::KPKEYCNT: KPKEMAX Mask */ - -#define FMC_KPCNT_KPCNT_Pos (0) /*!< FMC_T::KPCNT: KPCNT Position */ -#define FMC_KPCNT_KPCNT_Msk (0xful << FMC_KPCNT_KPCNT_Pos) /*!< FMC_T::KPCNT: KPCNT Mask */ - -#define FMC_KPCNT_KPMAX_Pos (8) /*!< FMC_T::KPCNT: KPMAX Position */ -#define FMC_KPCNT_KPMAX_Msk (0xful << FMC_KPCNT_KPMAX_Pos) /*!< FMC_T::KPCNT: KPMAX Mask */ - -#define FMC_MPDAT0_ISPDAT0_Pos (0) /*!< FMC_T::MPDAT0: ISPDAT0 Position */ -#define FMC_MPDAT0_ISPDAT0_Msk (0xfffffffful << FMC_MPDAT0_ISPDAT0_Pos) /*!< FMC_T::MPDAT0: ISPDAT0 Mask */ - -#define FMC_MPDAT1_ISPDAT1_Pos (0) /*!< FMC_T::MPDAT1: ISPDAT1 Position */ -#define FMC_MPDAT1_ISPDAT1_Msk (0xfffffffful << FMC_MPDAT1_ISPDAT1_Pos) /*!< FMC_T::MPDAT1: ISPDAT1 Mask */ - -#define FMC_MPDAT2_ISPDAT2_Pos (0) /*!< FMC_T::MPDAT2: ISPDAT2 Position */ -#define FMC_MPDAT2_ISPDAT2_Msk (0xfffffffful << FMC_MPDAT2_ISPDAT2_Pos) /*!< FMC_T::MPDAT2: ISPDAT2 Mask */ - -#define FMC_MPDAT3_ISPDAT3_Pos (0) /*!< FMC_T::MPDAT3: ISPDAT3 Position */ -#define FMC_MPDAT3_ISPDAT3_Msk (0xfffffffful << FMC_MPDAT3_ISPDAT3_Pos) /*!< FMC_T::MPDAT3: ISPDAT3 Mask */ - -#define FMC_MPSTS_MPBUSY_Pos (0) /*!< FMC_T::MPSTS: MPBUSY Position */ -#define FMC_MPSTS_MPBUSY_Msk (0x1ul << FMC_MPSTS_MPBUSY_Pos) /*!< FMC_T::MPSTS: MPBUSY Mask */ - -#define FMC_MPSTS_PPGO_Pos (1) /*!< FMC_T::MPSTS: PPGO Position */ -#define FMC_MPSTS_PPGO_Msk (0x1ul << FMC_MPSTS_PPGO_Pos) /*!< FMC_T::MPSTS: PPGO Mask */ - -#define FMC_MPSTS_ISPFF_Pos (2) /*!< FMC_T::MPSTS: ISPFF Position */ -#define FMC_MPSTS_ISPFF_Msk (0x1ul << FMC_MPSTS_ISPFF_Pos) /*!< FMC_T::MPSTS: ISPFF Mask */ - -#define FMC_MPSTS_D0_Pos (4) /*!< FMC_T::MPSTS: D0 Position */ -#define FMC_MPSTS_D0_Msk (0x1ul << FMC_MPSTS_D0_Pos) /*!< FMC_T::MPSTS: D0 Mask */ - -#define FMC_MPSTS_D1_Pos (5) /*!< FMC_T::MPSTS: D1 Position */ -#define FMC_MPSTS_D1_Msk (0x1ul << FMC_MPSTS_D1_Pos) /*!< FMC_T::MPSTS: D1 Mask */ - -#define FMC_MPSTS_D2_Pos (6) /*!< FMC_T::MPSTS: D2 Position */ -#define FMC_MPSTS_D2_Msk (0x1ul << FMC_MPSTS_D2_Pos) /*!< FMC_T::MPSTS: D2 Mask */ - -#define FMC_MPSTS_D3_Pos (7) /*!< FMC_T::MPSTS: D3 Position */ -#define FMC_MPSTS_D3_Msk (0x1ul << FMC_MPSTS_D3_Pos) /*!< FMC_T::MPSTS: D3 Mask */ - -#define FMC_MPADDR_MPADDR_Pos (0) /*!< FMC_T::MPADDR: MPADDR Position */ -#define FMC_MPADDR_MPADDR_Msk (0xfffffffful << FMC_MPADDR_MPADDR_Pos) /*!< FMC_T::MPADDR: MPADDR Mask */ - -#define FMC_XOMR0STS_SIZE_Pos (0) /*!< FMC_T::XOMR0STS: SIZE Position */ -#define FMC_XOMR0STS_SIZE_Msk (0xfful << FMC_XOMR0STS_SIZE_Pos) /*!< FMC_T::XOMR0STS: SIZE Mask */ - -#define FMC_XOMR0STS_BASE_Pos (8) /*!< FMC_T::XOMR0STS: BASE Position */ -#define FMC_XOMR0STS_BASE_Msk (0xfffffful << FMC_XOMR0STS_BASE_Pos) /*!< FMC_T::XOMR0STS: BASE Mask */ - -#define FMC_XOMR1STS_SIZE_Pos (0) /*!< FMC_T::XOMR1STS: SIZE Position */ -#define FMC_XOMR1STS_SIZE_Msk (0xfful << FMC_XOMR1STS_SIZE_Pos) /*!< FMC_T::XOMR1STS: SIZE Mask */ - -#define FMC_XOMR1STS_BASE_Pos (8) /*!< FMC_T::XOMR1STS: BASE Position */ -#define FMC_XOMR1STS_BASE_Msk (0xfffffful << FMC_XOMR1STS_BASE_Pos) /*!< FMC_T::XOMR1STS: BASE Mask */ - -#define FMC_XOMR2STS_SIZE_Pos (0) /*!< FMC_T::XOMR2STS: SIZE Position */ -#define FMC_XOMR2STS_SIZE_Msk (0xfful << FMC_XOMR2STS_SIZE_Pos) /*!< FMC_T::XOMR2STS: SIZE Mask */ - -#define FMC_XOMR2STS_BASE_Pos (8) /*!< FMC_T::XOMR2STS: BASE Position */ -#define FMC_XOMR2STS_BASE_Msk (0xfffffful << FMC_XOMR2STS_BASE_Pos) /*!< FMC_T::XOMR2STS: BASE Mask */ - -#define FMC_XOMR3STS_SIZE_Pos (0) /*!< FMC_T::XOMR3STS: SIZE Position */ -#define FMC_XOMR3STS_SIZE_Msk (0xfful << FMC_XOMR3STS_SIZE_Pos) /*!< FMC_T::XOMR3STS: SIZE Mask */ - -#define FMC_XOMR3STS_BASE_Pos (8) /*!< FMC_T::XOMR3STS: BASE Position */ -#define FMC_XOMR3STS_BASE_Msk (0xfffffful << FMC_XOMR3STS_BASE_Pos) /*!< FMC_T::XOMR3STS: BASE Mask */ - -#define FMC_XOMSTS_XOMR0ON_Pos (0) /*!< FMC_T::XOMSTS: XOMR0ON Position */ -#define FMC_XOMSTS_XOMR0ON_Msk (0x1ul << FMC_XOMSTS_XOMR0ON_Pos) /*!< FMC_T::XOMSTS: XOMR0ON Mask */ - -#define FMC_XOMSTS_XOMR1ON_Pos (1) /*!< FMC_T::XOMSTS: XOMR1ON Position */ -#define FMC_XOMSTS_XOMR1ON_Msk (0x1ul << FMC_XOMSTS_XOMR1ON_Pos) /*!< FMC_T::XOMSTS: XOMR1ON Mask */ - -#define FMC_XOMSTS_XOMR2ON_Pos (2) /*!< FMC_T::XOMSTS: XOMR2ON Position */ -#define FMC_XOMSTS_XOMR2ON_Msk (0x1ul << FMC_XOMSTS_XOMR2ON_Pos) /*!< FMC_T::XOMSTS: XOMR2ON Mask */ - -#define FMC_XOMSTS_XOMR3ON_Pos (3) /*!< FMC_T::XOMSTS: XOMR3ON Position */ -#define FMC_XOMSTS_XOMR3ON_Msk (0x1ul << FMC_XOMSTS_XOMR3ON_Pos) /*!< FMC_T::XOMSTS: XOMR3ON Mask */ - -#define FMC_XOMSTS_XOMPEF_Pos (4) /*!< FMC_T::XOMSTS: XOMPEF Position */ -#define FMC_XOMSTS_XOMPEF_Msk (0x1ul << FMC_XOMSTS_XOMPEF_Pos) /*!< FMC_T::XOMSTS: XOMPEF Mask */ - -#define FMC_DFCTL_SCRAMEN_Pos (0) /*!< FMC_T::DFCTL: SCRAMEN Position */ -#define FMC_DFCTL_SCRAMEN_Msk (0x1ul << FMC_DFCTL_SCRAMEN_Pos) /*!< FMC_T::DFCTL: SCRAMEN Mask */ - -#define FMC_DFCTL_SILENTEN_Pos (1) /*!< FMC_T::DFCTL: SILENTEN Position */ -#define FMC_DFCTL_SILENTEN_Msk (0x1ul << FMC_DFCTL_SILENTEN_Pos) /*!< FMC_T::DFCTL: SILENTEN Mask */ - -#define FMC_DFSTS_TMPCLRDONE_Pos (0) /*!< FMC_T::DFSTS: TMPCLRDONE Position */ -#define FMC_DFSTS_TMPCLRDONE_Msk (0x1ul << FMC_DFSTS_TMPCLRDONE_Pos) /*!< FMC_T::DFSTS: TMPCLRDONE Mask */ - -#define FMC_DFSTS_TMPCLRBUSY_Pos (1) /*!< FMC_T::DFSTS: TMPCLRBUSY Position */ -#define FMC_DFSTS_TMPCLRBUSY_Msk (0x1ul << FMC_DFSTS_TMPCLRBUSY_Pos) /*!< FMC_T::DFSTS: TMPCLRBUSY Mask */ - -#define FMC_SCRKEY_SCRKEY_Pos (0) /*!< FMC_T::SCRKEY: SCRKEY Position */ -#define FMC_SCRKEY_SCRKEY_Msk (0xfffffffful << FMC_SCRKEY_SCRKEY_Pos) /*!< FMC_T::SCRKEY: SCRKEY Mask */ - -/**@}*/ /* FMC_CONST */ -/**@}*/ /* end of FMC register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __FMC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/gpio_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/gpio_reg.h deleted file mode 100644 index 65cdf437e0e..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/gpio_reg.h +++ /dev/null @@ -1,888 +0,0 @@ -/**************************************************************************//** - * @file gpio_reg.h - * @version V1.00 - * @brief GPIO register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __GPIO_REG_H__ -#define __GPIO_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- General Purpose Input/Output Controller -------------------------*/ -/** - @addtogroup GPIO General Purpose Input/Output Controller(GPIO) - Memory Mapped Structure for GPIO Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var GPIO_T::MODE - * Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0 PA-H I/O Mode Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|MODEn |Port A-H I/O Pin[n] Mode Control - * | | |Determine each I/O mode of Px.n pins. - * | | |00 = Px.n is in Input mode. - * | | |01 = Px.n is in Push-pull Output mode. - * | | |10 = Px.n is in Open-drain Output mode. - * | | |11 = Px.n is in Quasi-bidirectional mode. - * | | |Note 1: The initial value of this field is defined by CIOINI (CONFIG0 [10]). - * | | |If CIOINI is set to 0, the default value is 0xFFFF_FFFF and all pins will be quasi-bidirectional mode after chip powered on. - * | | |If CIOINI is set to 1, the default value is 0x0000_0000 and all pins will be input mode after chip powered on. - * | | |Note 2: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::DINOFF - * Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4 PA-H Digital Input Path Disable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n+16] |DINOFFn |Port A-H Pin[n] Digital Input Path Disable Control - * | | |Each of these bits is used to control if the digital input path of corresponding Px.n pin is disabled. - * | | |If input is analog signal, users can disable Px.n digital input path to avoid input current leakage. - * | | |0 = Px.n digital input path Enabled. - * | | |1 = Px.n digital input path Disabled (digital input tied to low). - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::DOUT - * Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8 PA-H Data Output Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DOUTn |Port A-H Pin[n] Output Value - * | | |Each of these bits controls the status of a Px.n pin when the Px.n is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |0 = Px.n will drive Low if the Px.n pin is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |1 = Px.n will drive High if the Px.n pin is configured as Push-pull output or Quasi-bidirectional mode. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::DATMSK - * Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC PA-H Data Output Write Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DATMSKn |Port A-H Pin[n] Data Output Write Mask - * | | |These bits are used to protect the corresponding DOUT (Px_DOUT[n]) bit. - * | | |When the DATMSK (Px_DATMSK[n]) bit is set to 1, the corresponding DOUT (Px_DOUT[n]) bit is protected. - * | | |If the write signal is masked, writing data to the protect bit is ignored. - * | | |0 = Corresponding DOUT (Px_DOUT[n]) bit can be updated. - * | | |1 = Corresponding DOUT (Px_DOUT[n]) bit protected. - * | | |Note 1: This function only protects the corresponding DOUT (Px_DOUT[n]) bit, and will not protect the corresponding PDIO (Pxn_PDIO[0]) bit. - * | | |Note 2: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::PIN - * Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0 PA-H Pin Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |PINn |Port A-H Pin[n] Pin Value - * | | |Each bit of the register reflects the actual status of the respective Px.n pin. - * | | |0 = The corresponding pin status is low. - * | | |1 = The corresponding pin status is high. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::DBEN - * Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4 PA-H De-Bounce Enable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DBENn |Port A-H Pin[n] Input Signal De-bounce Enable Bit - * | | |The DBEN[n] bit is used to enable the de-bounce function for each corresponding bit. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the interrupt. - * | | |The de-bounce clock source is controlled by DBCLKSRC (Px_DBCTL [4]), one de-bounce sample cycle period is controlled by DBCLKSEL (Px_DBCTL [3:0]). - * | | |0 = Px.n de-bounce function Disabled. - * | | |1 = Px.n de-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::INTTYPE - * Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8 PA-H Interrupt Trigger Type Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |TYPEn |Port A-H Pin[n] Edge or Level Detection Interrupt Trigger Type Control - * | | |TYPE (Px_INTTYPE[n]) bit is used to control the triggered interrupt is by level trigger or by edge trigger. - * | | |If the interrupt is by edge trigger, the trigger source can be controlled by de-bounce. - * | | |If the interrupt is by level trigger, the input source is sampled by one HCLK clock and generates the interrupt. - * | | |0 = Edge trigger interrupt. - * | | |1 = Level trigger interrupt. - * | | |If the pin is set as the level trigger interrupt, only one level can be set on the registers RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]). - * | | |If both levels to trigger interrupt are set, the setting is ignored and no interrupt will occur. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::INTEN - * Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC PA-H Interrupt Enable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |FLIENn |Port A-H Pin[n] Falling Edge or Low Level Interrupt Trigger Type Enable Bit - * | | |The FLIEN (Px_INTEN[n]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the FLIEN (Px_INTEN[n]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at low level. - * | | |If the interrupt is edge trigger(TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from high to low. - * | | |0 = Px.n level low or high to low interrupt Disabled. - * | | |1 = Px.n level low or high to low interrupt Enabled. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * |[n+16] |RHIENn |Port A-H Pin[n] Rising Edge or High Level Interrupt Trigger Type Enable Bit - * | | |The RHIEN (Px_INTEN[n+16]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the RHIEN (Px_INTEN[n+16]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at high level. - * | | |If the interrupt is edge trigger (TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from low to high. - * | | |0 = Px.n level high or low to high interrupt Disabled. - * | | |1 = Px.n level high or low to high interrupt Enabled. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::INTSRC - * Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0 PA-H Interrupt Source Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |INTSRCn |Port A-H Pin[n] Interrupt Source Flag - * | | |Write Operation : - * | | |0 = No action. - * | | |1 = Clear the corresponding pending interrupt. - * | | |Read Operation : - * | | |0 = No interrupt at Px.n. - * | | |1 = Px.n generates an interrupt. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::SMTEN - * Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4 PA-H Input Schmitt Trigger Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |SMTENn |Port A-H Pin[n] Input Schmitt Trigger Enable Bit - * | | |0 = Px.n input Schmitt trigger function Disabled. - * | | |1 = Px.n input Schmitt trigger function Enabled. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::SLEWCTL - * Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8 PA-H High Slew Rate Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|HSRENn |Port A-H Pin[n] High Slew Rate Control - * | | |00 = Px.n output with normal slew rate mode (maximum 40 MHz at 2.7V). - * | | |01 = Px.n output with high slew rate mode (maximum 80 MHz at 2.7V). - * | | |10 = Px.n output with fast slew rate mode (maximum 100 MHz at 2.7V. - * | | |11 = Reserved. - * | | |Note: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::PUSEL - * Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0 PA-H Pull-up and Pull-down Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|PUSELn |Port A-H Pin[n] Pull-up and Pull-down Enable Register - * | | |Determine each I/O Pull-up/pull-down of Px.n pins. - * | | |00 = Px.n pull-up and pull-down disabled. - * | | |01 = Px.n pull-up enabled. - * | | |10 = Px.n pull-down enabled. - * | | |11 = Px.n pull-up and pull-down disabled. - * | | |Note 1: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when MODEn (Px_MODE[2n+1:2n]) set as tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when MODEn (Px_MODE[2n+1:2n]) set as tri-state mode. - * | | |When both pull-up pull-down is set as 1 at tri-state mode, keep I/O in tri-state mode. - * | | |Note 2: The PC.14/ PC.15/ PD.13/ PD.15/ PF.12~15/ PG.0/ PG.1/ PG.5~8/ PH.0~3/ PH.12~15 pin is ignored. - * @var GPIO_T::DBCTL - * Offset: 0x34/0x74/0xB4/0xF4/0x134/0x174/0x1B4/0x1F4 PA-H Interrupt De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DBCLKSEL |De-bounce Sampling Cycle Selection - * | | |0000 = Sample interrupt input once per 1 clocks. - * | | |0001 = Sample interrupt input once per 2 clocks. - * | | |0010 = Sample interrupt input once per 4 clocks. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 2*256 clocks. - * | | |1010 = Sample interrupt input once per 4*256 clocks. - * | | |1011 = Sample interrupt input once per 8*256 clocks. - * | | |1100 = Sample interrupt input once per 16*256 clocks. - * | | |1101 = Sample interrupt input once per 32*256 clocks. - * | | |1110 = Sample interrupt input once per 64*256 clocks. - * | | |1111 = Sample interrupt input once per 128*256 clocks. - * |[4] |DBCLKSRC |De-bounce Counter Clock Source Selection - * | | |0 = De-bounce counter clock source is the HCLK. - * | | |1 = De-bounce counter clock source is the 32 kHz internal low speed RC oscillator (LIRC). - * |[5] |ICLKON |Interrupt Clock on Mode - * | | |0 = Edge detection circuit is active only if I/O pin corresponding RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]) bit is set to 1. - * | | |1 = All I/O pins edge detection circuit is always active after reset. - * | | |Note: It is recommended to disable this bit to save system power if no special application concern. - */ - - - __IO uint32_t MODE; /*!< [0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0] Port A-H I/O Mode Control */ - __IO uint32_t DINOFF; /*!< [0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4] Port A-H Digital Input Path Disable Control */ - __IO uint32_t DOUT; /*!< [0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8] Port A-H Data Output Value */ - __IO uint32_t DATMSK; /*!< [0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC] Port A-H Data Output Write Mask */ - __I uint32_t PIN; /*!< [0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0] Port A-H Pin Value */ - __IO uint32_t DBEN; /*!< [0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4] Port A-H De-Bounce Enable Control */ - __IO uint32_t INTTYPE; /*!< [0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8] Port A-H Interrupt Trigger Type Control */ - __IO uint32_t INTEN; /*!< [0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC] Port A-H Interrupt Enable Control */ - __IO uint32_t INTSRC; /*!< [0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0] Port A-H Interrupt Source Flag */ - __IO uint32_t SMTEN; /*!< [0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4] Port A-H Input Schmitt Trigger Enable */ - __IO uint32_t SLEWCTL; /*!< [0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8] Port A-H High Slew Rate Control */ - __I uint32_t RESERVE0[1]; - __IO uint32_t PUSEL; /*!< [0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0] Port A-H Pull-up and Pull-down Selection Register */ - __IO uint32_t DBCTL; /*!< [0x34/0x74/0xB4/0xF4/0x134/0x174/0x1B4/0x1F4] Port A-H Interrupt De-bounce Control */ - -} GPIO_T; - - - -/** - @addtogroup GPIO_CONST GPIO Bit Field Definition - Constant Definitions for GPIO Controller - @{ -*/ - -#define GPIO_MODE_MODE0_Pos (0) /*!< GPIO_T::MODE: MODE0 Position */ -#define GPIO_MODE_MODE0_Msk (0x3ul << GPIO_MODE_MODE0_Pos) /*!< GPIO_T::MODE: MODE0 Mask */ - -#define GPIO_MODE_MODE1_Pos (2) /*!< GPIO_T::MODE: MODE1 Position */ -#define GPIO_MODE_MODE1_Msk (0x3ul << GPIO_MODE_MODE1_Pos) /*!< GPIO_T::MODE: MODE1 Mask */ - -#define GPIO_MODE_MODE2_Pos (4) /*!< GPIO_T::MODE: MODE2 Position */ -#define GPIO_MODE_MODE2_Msk (0x3ul << GPIO_MODE_MODE2_Pos) /*!< GPIO_T::MODE: MODE2 Mask */ - -#define GPIO_MODE_MODE3_Pos (6) /*!< GPIO_T::MODE: MODE3 Position */ -#define GPIO_MODE_MODE3_Msk (0x3ul << GPIO_MODE_MODE3_Pos) /*!< GPIO_T::MODE: MODE3 Mask */ - -#define GPIO_MODE_MODE4_Pos (8) /*!< GPIO_T::MODE: MODE4 Position */ -#define GPIO_MODE_MODE4_Msk (0x3ul << GPIO_MODE_MODE4_Pos) /*!< GPIO_T::MODE: MODE4 Mask */ - -#define GPIO_MODE_MODE5_Pos (10) /*!< GPIO_T::MODE: MODE5 Position */ -#define GPIO_MODE_MODE5_Msk (0x3ul << GPIO_MODE_MODE5_Pos) /*!< GPIO_T::MODE: MODE5 Mask */ - -#define GPIO_MODE_MODE6_Pos (12) /*!< GPIO_T::MODE: MODE6 Position */ -#define GPIO_MODE_MODE6_Msk (0x3ul << GPIO_MODE_MODE6_Pos) /*!< GPIO_T::MODE: MODE6 Mask */ - -#define GPIO_MODE_MODE7_Pos (14) /*!< GPIO_T::MODE: MODE7 Position */ -#define GPIO_MODE_MODE7_Msk (0x3ul << GPIO_MODE_MODE7_Pos) /*!< GPIO_T::MODE: MODE7 Mask */ - -#define GPIO_MODE_MODE8_Pos (16) /*!< GPIO_T::MODE: MODE8 Position */ -#define GPIO_MODE_MODE8_Msk (0x3ul << GPIO_MODE_MODE8_Pos) /*!< GPIO_T::MODE: MODE8 Mask */ - -#define GPIO_MODE_MODE9_Pos (18) /*!< GPIO_T::MODE: MODE9 Position */ -#define GPIO_MODE_MODE9_Msk (0x3ul << GPIO_MODE_MODE9_Pos) /*!< GPIO_T::MODE: MODE9 Mask */ - -#define GPIO_MODE_MODE10_Pos (20) /*!< GPIO_T::MODE: MODE10 Position */ -#define GPIO_MODE_MODE10_Msk (0x3ul << GPIO_MODE_MODE10_Pos) /*!< GPIO_T::MODE: MODE10 Mask */ - -#define GPIO_MODE_MODE11_Pos (22) /*!< GPIO_T::MODE: MODE11 Position */ -#define GPIO_MODE_MODE11_Msk (0x3ul << GPIO_MODE_MODE11_Pos) /*!< GPIO_T::MODE: MODE11 Mask */ - -#define GPIO_MODE_MODE12_Pos (24) /*!< GPIO_T::MODE: MODE12 Position */ -#define GPIO_MODE_MODE12_Msk (0x3ul << GPIO_MODE_MODE12_Pos) /*!< GPIO_T::MODE: MODE12 Mask */ - -#define GPIO_MODE_MODE13_Pos (26) /*!< GPIO_T::MODE: MODE13 Position */ -#define GPIO_MODE_MODE13_Msk (0x3ul << GPIO_MODE_MODE13_Pos) /*!< GPIO_T::MODE: MODE13 Mask */ - -#define GPIO_MODE_MODE14_Pos (28) /*!< GPIO_T::MODE: MODE14 Position */ -#define GPIO_MODE_MODE14_Msk (0x3ul << GPIO_MODE_MODE14_Pos) /*!< GPIO_T::MODE: MODE14 Mask */ - -#define GPIO_MODE_MODE15_Pos (30) /*!< GPIO_T::MODE: MODE15 Position */ -#define GPIO_MODE_MODE15_Msk (0x3ul << GPIO_MODE_MODE15_Pos) /*!< GPIO_T::MODE: MODE15 Mask */ - -#define GPIO_DINOFF_DINOFF0_Pos (16) /*!< GPIO_T::DINOFF: DINOFF0 Position */ -#define GPIO_DINOFF_DINOFF0_Msk (0x1ul << GPIO_DINOFF_DINOFF0_Pos) /*!< GPIO_T::DINOFF: DINOFF0 Mask */ - -#define GPIO_DINOFF_DINOFF1_Pos (17) /*!< GPIO_T::DINOFF: DINOFF1 Position */ -#define GPIO_DINOFF_DINOFF1_Msk (0x1ul << GPIO_DINOFF_DINOFF1_Pos) /*!< GPIO_T::DINOFF: DINOFF1 Mask */ - -#define GPIO_DINOFF_DINOFF2_Pos (18) /*!< GPIO_T::DINOFF: DINOFF2 Position */ -#define GPIO_DINOFF_DINOFF2_Msk (0x1ul << GPIO_DINOFF_DINOFF2_Pos) /*!< GPIO_T::DINOFF: DINOFF2 Mask */ - -#define GPIO_DINOFF_DINOFF3_Pos (19) /*!< GPIO_T::DINOFF: DINOFF3 Position */ -#define GPIO_DINOFF_DINOFF3_Msk (0x1ul << GPIO_DINOFF_DINOFF3_Pos) /*!< GPIO_T::DINOFF: DINOFF3 Mask */ - -#define GPIO_DINOFF_DINOFF4_Pos (20) /*!< GPIO_T::DINOFF: DINOFF4 Position */ -#define GPIO_DINOFF_DINOFF4_Msk (0x1ul << GPIO_DINOFF_DINOFF4_Pos) /*!< GPIO_T::DINOFF: DINOFF4 Mask */ - -#define GPIO_DINOFF_DINOFF5_Pos (21) /*!< GPIO_T::DINOFF: DINOFF5 Position */ -#define GPIO_DINOFF_DINOFF5_Msk (0x1ul << GPIO_DINOFF_DINOFF5_Pos) /*!< GPIO_T::DINOFF: DINOFF5 Mask */ - -#define GPIO_DINOFF_DINOFF6_Pos (22) /*!< GPIO_T::DINOFF: DINOFF6 Position */ -#define GPIO_DINOFF_DINOFF6_Msk (0x1ul << GPIO_DINOFF_DINOFF6_Pos) /*!< GPIO_T::DINOFF: DINOFF6 Mask */ - -#define GPIO_DINOFF_DINOFF7_Pos (23) /*!< GPIO_T::DINOFF: DINOFF7 Position */ -#define GPIO_DINOFF_DINOFF7_Msk (0x1ul << GPIO_DINOFF_DINOFF7_Pos) /*!< GPIO_T::DINOFF: DINOFF7 Mask */ - -#define GPIO_DINOFF_DINOFF8_Pos (24) /*!< GPIO_T::DINOFF: DINOFF8 Position */ -#define GPIO_DINOFF_DINOFF8_Msk (0x1ul << GPIO_DINOFF_DINOFF8_Pos) /*!< GPIO_T::DINOFF: DINOFF8 Mask */ - -#define GPIO_DINOFF_DINOFF9_Pos (25) /*!< GPIO_T::DINOFF: DINOFF9 Position */ -#define GPIO_DINOFF_DINOFF9_Msk (0x1ul << GPIO_DINOFF_DINOFF9_Pos) /*!< GPIO_T::DINOFF: DINOFF9 Mask */ - -#define GPIO_DINOFF_DINOFF10_Pos (26) /*!< GPIO_T::DINOFF: DINOFF10 Position */ -#define GPIO_DINOFF_DINOFF10_Msk (0x1ul << GPIO_DINOFF_DINOFF10_Pos) /*!< GPIO_T::DINOFF: DINOFF10 Mask */ - -#define GPIO_DINOFF_DINOFF11_Pos (27) /*!< GPIO_T::DINOFF: DINOFF11 Position */ -#define GPIO_DINOFF_DINOFF11_Msk (0x1ul << GPIO_DINOFF_DINOFF11_Pos) /*!< GPIO_T::DINOFF: DINOFF11 Mask */ - -#define GPIO_DINOFF_DINOFF12_Pos (28) /*!< GPIO_T::DINOFF: DINOFF12 Position */ -#define GPIO_DINOFF_DINOFF12_Msk (0x1ul << GPIO_DINOFF_DINOFF12_Pos) /*!< GPIO_T::DINOFF: DINOFF12 Mask */ - -#define GPIO_DINOFF_DINOFF13_Pos (29) /*!< GPIO_T::DINOFF: DINOFF13 Position */ -#define GPIO_DINOFF_DINOFF13_Msk (0x1ul << GPIO_DINOFF_DINOFF13_Pos) /*!< GPIO_T::DINOFF: DINOFF13 Mask */ - -#define GPIO_DINOFF_DINOFF14_Pos (30) /*!< GPIO_T::DINOFF: DINOFF14 Position */ -#define GPIO_DINOFF_DINOFF14_Msk (0x1ul << GPIO_DINOFF_DINOFF14_Pos) /*!< GPIO_T::DINOFF: DINOFF14 Mask */ - -#define GPIO_DINOFF_DINOFF15_Pos (31) /*!< GPIO_T::DINOFF: DINOFF15 Position */ -#define GPIO_DINOFF_DINOFF15_Msk (0x1ul << GPIO_DINOFF_DINOFF15_Pos) /*!< GPIO_T::DINOFF: DINOFF15 Mask */ - -#define GPIO_DOUT_DOUT0_Pos (0) /*!< GPIO_T::DOUT: DOUT0 Position */ -#define GPIO_DOUT_DOUT0_Msk (0x1ul << GPIO_DOUT_DOUT0_Pos) /*!< GPIO_T::DOUT: DOUT0 Mask */ - -#define GPIO_DOUT_DOUT1_Pos (1) /*!< GPIO_T::DOUT: DOUT1 Position */ -#define GPIO_DOUT_DOUT1_Msk (0x1ul << GPIO_DOUT_DOUT1_Pos) /*!< GPIO_T::DOUT: DOUT1 Mask */ - -#define GPIO_DOUT_DOUT2_Pos (2) /*!< GPIO_T::DOUT: DOUT2 Position */ -#define GPIO_DOUT_DOUT2_Msk (0x1ul << GPIO_DOUT_DOUT2_Pos) /*!< GPIO_T::DOUT: DOUT2 Mask */ - -#define GPIO_DOUT_DOUT3_Pos (3) /*!< GPIO_T::DOUT: DOUT3 Position */ -#define GPIO_DOUT_DOUT3_Msk (0x1ul << GPIO_DOUT_DOUT3_Pos) /*!< GPIO_T::DOUT: DOUT3 Mask */ - -#define GPIO_DOUT_DOUT4_Pos (4) /*!< GPIO_T::DOUT: DOUT4 Position */ -#define GPIO_DOUT_DOUT4_Msk (0x1ul << GPIO_DOUT_DOUT4_Pos) /*!< GPIO_T::DOUT: DOUT4 Mask */ - -#define GPIO_DOUT_DOUT5_Pos (5) /*!< GPIO_T::DOUT: DOUT5 Position */ -#define GPIO_DOUT_DOUT5_Msk (0x1ul << GPIO_DOUT_DOUT5_Pos) /*!< GPIO_T::DOUT: DOUT5 Mask */ - -#define GPIO_DOUT_DOUT6_Pos (6) /*!< GPIO_T::DOUT: DOUT6 Position */ -#define GPIO_DOUT_DOUT6_Msk (0x1ul << GPIO_DOUT_DOUT6_Pos) /*!< GPIO_T::DOUT: DOUT6 Mask */ - -#define GPIO_DOUT_DOUT7_Pos (7) /*!< GPIO_T::DOUT: DOUT7 Position */ -#define GPIO_DOUT_DOUT7_Msk (0x1ul << GPIO_DOUT_DOUT7_Pos) /*!< GPIO_T::DOUT: DOUT7 Mask */ - -#define GPIO_DOUT_DOUT8_Pos (8) /*!< GPIO_T::DOUT: DOUT8 Position */ -#define GPIO_DOUT_DOUT8_Msk (0x1ul << GPIO_DOUT_DOUT8_Pos) /*!< GPIO_T::DOUT: DOUT8 Mask */ - -#define GPIO_DOUT_DOUT9_Pos (9) /*!< GPIO_T::DOUT: DOUT9 Position */ -#define GPIO_DOUT_DOUT9_Msk (0x1ul << GPIO_DOUT_DOUT9_Pos) /*!< GPIO_T::DOUT: DOUT9 Mask */ - -#define GPIO_DOUT_DOUT10_Pos (10) /*!< GPIO_T::DOUT: DOUT10 Position */ -#define GPIO_DOUT_DOUT10_Msk (0x1ul << GPIO_DOUT_DOUT10_Pos) /*!< GPIO_T::DOUT: DOUT10 Mask */ - -#define GPIO_DOUT_DOUT11_Pos (11) /*!< GPIO_T::DOUT: DOUT11 Position */ -#define GPIO_DOUT_DOUT11_Msk (0x1ul << GPIO_DOUT_DOUT11_Pos) /*!< GPIO_T::DOUT: DOUT11 Mask */ - -#define GPIO_DOUT_DOUT12_Pos (12) /*!< GPIO_T::DOUT: DOUT12 Position */ -#define GPIO_DOUT_DOUT12_Msk (0x1ul << GPIO_DOUT_DOUT12_Pos) /*!< GPIO_T::DOUT: DOUT12 Mask */ - -#define GPIO_DOUT_DOUT13_Pos (13) /*!< GPIO_T::DOUT: DOUT13 Position */ -#define GPIO_DOUT_DOUT13_Msk (0x1ul << GPIO_DOUT_DOUT13_Pos) /*!< GPIO_T::DOUT: DOUT13 Mask */ - -#define GPIO_DOUT_DOUT14_Pos (14) /*!< GPIO_T::DOUT: DOUT14 Position */ -#define GPIO_DOUT_DOUT14_Msk (0x1ul << GPIO_DOUT_DOUT14_Pos) /*!< GPIO_T::DOUT: DOUT14 Mask */ - -#define GPIO_DOUT_DOUT15_Pos (15) /*!< GPIO_T::DOUT: DOUT15 Position */ -#define GPIO_DOUT_DOUT15_Msk (0x1ul << GPIO_DOUT_DOUT15_Pos) /*!< GPIO_T::DOUT: DOUT15 Mask */ - -#define GPIO_DATMSK_DATMSK0_Pos (0) /*!< GPIO_T::DATMSK: DATMSK0 Position */ -#define GPIO_DATMSK_DATMSK0_Msk (0x1ul << GPIO_DATMSK_DATMSK0_Pos) /*!< GPIO_T::DATMSK: DATMSK0 Mask */ - -#define GPIO_DATMSK_DATMSK1_Pos (1) /*!< GPIO_T::DATMSK: DATMSK1 Position */ -#define GPIO_DATMSK_DATMSK1_Msk (0x1ul << GPIO_DATMSK_DATMSK1_Pos) /*!< GPIO_T::DATMSK: DATMSK1 Mask */ - -#define GPIO_DATMSK_DATMSK2_Pos (2) /*!< GPIO_T::DATMSK: DATMSK2 Position */ -#define GPIO_DATMSK_DATMSK2_Msk (0x1ul << GPIO_DATMSK_DATMSK2_Pos) /*!< GPIO_T::DATMSK: DATMSK2 Mask */ - -#define GPIO_DATMSK_DATMSK3_Pos (3) /*!< GPIO_T::DATMSK: DATMSK3 Position */ -#define GPIO_DATMSK_DATMSK3_Msk (0x1ul << GPIO_DATMSK_DATMSK3_Pos) /*!< GPIO_T::DATMSK: DATMSK3 Mask */ - -#define GPIO_DATMSK_DATMSK4_Pos (4) /*!< GPIO_T::DATMSK: DATMSK4 Position */ -#define GPIO_DATMSK_DATMSK4_Msk (0x1ul << GPIO_DATMSK_DATMSK4_Pos) /*!< GPIO_T::DATMSK: DATMSK4 Mask */ - -#define GPIO_DATMSK_DATMSK5_Pos (5) /*!< GPIO_T::DATMSK: DATMSK5 Position */ -#define GPIO_DATMSK_DATMSK5_Msk (0x1ul << GPIO_DATMSK_DATMSK5_Pos) /*!< GPIO_T::DATMSK: DATMSK5 Mask */ - -#define GPIO_DATMSK_DATMSK6_Pos (6) /*!< GPIO_T::DATMSK: DATMSK6 Position */ -#define GPIO_DATMSK_DATMSK6_Msk (0x1ul << GPIO_DATMSK_DATMSK6_Pos) /*!< GPIO_T::DATMSK: DATMSK6 Mask */ - -#define GPIO_DATMSK_DATMSK7_Pos (7) /*!< GPIO_T::DATMSK: DATMSK7 Position */ -#define GPIO_DATMSK_DATMSK7_Msk (0x1ul << GPIO_DATMSK_DATMSK7_Pos) /*!< GPIO_T::DATMSK: DATMSK7 Mask */ - -#define GPIO_DATMSK_DATMSK8_Pos (8) /*!< GPIO_T::DATMSK: DATMSK8 Position */ -#define GPIO_DATMSK_DATMSK8_Msk (0x1ul << GPIO_DATMSK_DATMSK8_Pos) /*!< GPIO_T::DATMSK: DATMSK8 Mask */ - -#define GPIO_DATMSK_DATMSK9_Pos (9) /*!< GPIO_T::DATMSK: DATMSK9 Position */ -#define GPIO_DATMSK_DATMSK9_Msk (0x1ul << GPIO_DATMSK_DATMSK9_Pos) /*!< GPIO_T::DATMSK: DATMSK9 Mask */ - -#define GPIO_DATMSK_DATMSK10_Pos (10) /*!< GPIO_T::DATMSK: DATMSK10 Position */ -#define GPIO_DATMSK_DATMSK10_Msk (0x1ul << GPIO_DATMSK_DATMSK10_Pos) /*!< GPIO_T::DATMSK: DATMSK10 Mask */ - -#define GPIO_DATMSK_DATMSK11_Pos (11) /*!< GPIO_T::DATMSK: DATMSK11 Position */ -#define GPIO_DATMSK_DATMSK11_Msk (0x1ul << GPIO_DATMSK_DATMSK11_Pos) /*!< GPIO_T::DATMSK: DATMSK11 Mask */ - -#define GPIO_DATMSK_DATMSK12_Pos (12) /*!< GPIO_T::DATMSK: DATMSK12 Position */ -#define GPIO_DATMSK_DATMSK12_Msk (0x1ul << GPIO_DATMSK_DATMSK12_Pos) /*!< GPIO_T::DATMSK: DATMSK12 Mask */ - -#define GPIO_DATMSK_DATMSK13_Pos (13) /*!< GPIO_T::DATMSK: DATMSK13 Position */ -#define GPIO_DATMSK_DATMSK13_Msk (0x1ul << GPIO_DATMSK_DATMSK13_Pos) /*!< GPIO_T::DATMSK: DATMSK13 Mask */ - -#define GPIO_DATMSK_DATMSK14_Pos (14) /*!< GPIO_T::DATMSK: DATMSK14 Position */ -#define GPIO_DATMSK_DATMSK14_Msk (0x1ul << GPIO_DATMSK_DATMSK14_Pos) /*!< GPIO_T::DATMSK: DATMSK14 Mask */ - -#define GPIO_DATMSK_DATMSK15_Pos (15) /*!< GPIO_T::DATMSK: DATMSK15 Position */ -#define GPIO_DATMSK_DATMSK15_Msk (0x1ul << GPIO_DATMSK_DATMSK15_Pos) /*!< GPIO_T::DATMSK: DATMSK15 Mask */ - -#define GPIO_PIN_PIN0_Pos (0) /*!< GPIO_T::PIN: PIN0 Position */ -#define GPIO_PIN_PIN0_Msk (0x1ul << GPIO_PIN_PIN0_Pos) /*!< GPIO_T::PIN: PIN0 Mask */ - -#define GPIO_PIN_PIN1_Pos (1) /*!< GPIO_T::PIN: PIN1 Position */ -#define GPIO_PIN_PIN1_Msk (0x1ul << GPIO_PIN_PIN1_Pos) /*!< GPIO_T::PIN: PIN1 Mask */ - -#define GPIO_PIN_PIN2_Pos (2) /*!< GPIO_T::PIN: PIN2 Position */ -#define GPIO_PIN_PIN2_Msk (0x1ul << GPIO_PIN_PIN2_Pos) /*!< GPIO_T::PIN: PIN2 Mask */ - -#define GPIO_PIN_PIN3_Pos (3) /*!< GPIO_T::PIN: PIN3 Position */ -#define GPIO_PIN_PIN3_Msk (0x1ul << GPIO_PIN_PIN3_Pos) /*!< GPIO_T::PIN: PIN3 Mask */ - -#define GPIO_PIN_PIN4_Pos (4) /*!< GPIO_T::PIN: PIN4 Position */ -#define GPIO_PIN_PIN4_Msk (0x1ul << GPIO_PIN_PIN4_Pos) /*!< GPIO_T::PIN: PIN4 Mask */ - -#define GPIO_PIN_PIN5_Pos (5) /*!< GPIO_T::PIN: PIN5 Position */ -#define GPIO_PIN_PIN5_Msk (0x1ul << GPIO_PIN_PIN5_Pos) /*!< GPIO_T::PIN: PIN5 Mask */ - -#define GPIO_PIN_PIN6_Pos (6) /*!< GPIO_T::PIN: PIN6 Position */ -#define GPIO_PIN_PIN6_Msk (0x1ul << GPIO_PIN_PIN6_Pos) /*!< GPIO_T::PIN: PIN6 Mask */ - -#define GPIO_PIN_PIN7_Pos (7) /*!< GPIO_T::PIN: PIN7 Position */ -#define GPIO_PIN_PIN7_Msk (0x1ul << GPIO_PIN_PIN7_Pos) /*!< GPIO_T::PIN: PIN7 Mask */ - -#define GPIO_PIN_PIN8_Pos (8) /*!< GPIO_T::PIN: PIN8 Position */ -#define GPIO_PIN_PIN8_Msk (0x1ul << GPIO_PIN_PIN8_Pos) /*!< GPIO_T::PIN: PIN8 Mask */ - -#define GPIO_PIN_PIN9_Pos (9) /*!< GPIO_T::PIN: PIN9 Position */ -#define GPIO_PIN_PIN9_Msk (0x1ul << GPIO_PIN_PIN9_Pos) /*!< GPIO_T::PIN: PIN9 Mask */ - -#define GPIO_PIN_PIN10_Pos (10) /*!< GPIO_T::PIN: PIN10 Position */ -#define GPIO_PIN_PIN10_Msk (0x1ul << GPIO_PIN_PIN10_Pos) /*!< GPIO_T::PIN: PIN10 Mask */ - -#define GPIO_PIN_PIN11_Pos (11) /*!< GPIO_T::PIN: PIN11 Position */ -#define GPIO_PIN_PIN11_Msk (0x1ul << GPIO_PIN_PIN11_Pos) /*!< GPIO_T::PIN: PIN11 Mask */ - -#define GPIO_PIN_PIN12_Pos (12) /*!< GPIO_T::PIN: PIN12 Position */ -#define GPIO_PIN_PIN12_Msk (0x1ul << GPIO_PIN_PIN12_Pos) /*!< GPIO_T::PIN: PIN12 Mask */ - -#define GPIO_PIN_PIN13_Pos (13) /*!< GPIO_T::PIN: PIN13 Position */ -#define GPIO_PIN_PIN13_Msk (0x1ul << GPIO_PIN_PIN13_Pos) /*!< GPIO_T::PIN: PIN13 Mask */ - -#define GPIO_PIN_PIN14_Pos (14) /*!< GPIO_T::PIN: PIN14 Position */ -#define GPIO_PIN_PIN14_Msk (0x1ul << GPIO_PIN_PIN14_Pos) /*!< GPIO_T::PIN: PIN14 Mask */ - -#define GPIO_PIN_PIN15_Pos (15) /*!< GPIO_T::PIN: PIN15 Position */ -#define GPIO_PIN_PIN15_Msk (0x1ul << GPIO_PIN_PIN15_Pos) /*!< GPIO_T::PIN: PIN15 Mask */ - -#define GPIO_DBEN_DBEN0_Pos (0) /*!< GPIO_T::DBEN: DBEN0 Position */ -#define GPIO_DBEN_DBEN0_Msk (0x1ul << GPIO_DBEN_DBEN0_Pos) /*!< GPIO_T::DBEN: DBEN0 Mask */ - -#define GPIO_DBEN_DBEN1_Pos (1) /*!< GPIO_T::DBEN: DBEN1 Position */ -#define GPIO_DBEN_DBEN1_Msk (0x1ul << GPIO_DBEN_DBEN1_Pos) /*!< GPIO_T::DBEN: DBEN1 Mask */ - -#define GPIO_DBEN_DBEN2_Pos (2) /*!< GPIO_T::DBEN: DBEN2 Position */ -#define GPIO_DBEN_DBEN2_Msk (0x1ul << GPIO_DBEN_DBEN2_Pos) /*!< GPIO_T::DBEN: DBEN2 Mask */ - -#define GPIO_DBEN_DBEN3_Pos (3) /*!< GPIO_T::DBEN: DBEN3 Position */ -#define GPIO_DBEN_DBEN3_Msk (0x1ul << GPIO_DBEN_DBEN3_Pos) /*!< GPIO_T::DBEN: DBEN3 Mask */ - -#define GPIO_DBEN_DBEN4_Pos (4) /*!< GPIO_T::DBEN: DBEN4 Position */ -#define GPIO_DBEN_DBEN4_Msk (0x1ul << GPIO_DBEN_DBEN4_Pos) /*!< GPIO_T::DBEN: DBEN4 Mask */ - -#define GPIO_DBEN_DBEN5_Pos (5) /*!< GPIO_T::DBEN: DBEN5 Position */ -#define GPIO_DBEN_DBEN5_Msk (0x1ul << GPIO_DBEN_DBEN5_Pos) /*!< GPIO_T::DBEN: DBEN5 Mask */ - -#define GPIO_DBEN_DBEN6_Pos (6) /*!< GPIO_T::DBEN: DBEN6 Position */ -#define GPIO_DBEN_DBEN6_Msk (0x1ul << GPIO_DBEN_DBEN6_Pos) /*!< GPIO_T::DBEN: DBEN6 Mask */ - -#define GPIO_DBEN_DBEN7_Pos (7) /*!< GPIO_T::DBEN: DBEN7 Position */ -#define GPIO_DBEN_DBEN7_Msk (0x1ul << GPIO_DBEN_DBEN7_Pos) /*!< GPIO_T::DBEN: DBEN7 Mask */ - -#define GPIO_DBEN_DBEN8_Pos (8) /*!< GPIO_T::DBEN: DBEN8 Position */ -#define GPIO_DBEN_DBEN8_Msk (0x1ul << GPIO_DBEN_DBEN8_Pos) /*!< GPIO_T::DBEN: DBEN8 Mask */ - -#define GPIO_DBEN_DBEN9_Pos (9) /*!< GPIO_T::DBEN: DBEN9 Position */ -#define GPIO_DBEN_DBEN9_Msk (0x1ul << GPIO_DBEN_DBEN9_Pos) /*!< GPIO_T::DBEN: DBEN9 Mask */ - -#define GPIO_DBEN_DBEN10_Pos (10) /*!< GPIO_T::DBEN: DBEN10 Position */ -#define GPIO_DBEN_DBEN10_Msk (0x1ul << GPIO_DBEN_DBEN10_Pos) /*!< GPIO_T::DBEN: DBEN10 Mask */ - -#define GPIO_DBEN_DBEN11_Pos (11) /*!< GPIO_T::DBEN: DBEN11 Position */ -#define GPIO_DBEN_DBEN11_Msk (0x1ul << GPIO_DBEN_DBEN11_Pos) /*!< GPIO_T::DBEN: DBEN11 Mask */ - -#define GPIO_DBEN_DBEN12_Pos (12) /*!< GPIO_T::DBEN: DBEN12 Position */ -#define GPIO_DBEN_DBEN12_Msk (0x1ul << GPIO_DBEN_DBEN12_Pos) /*!< GPIO_T::DBEN: DBEN12 Mask */ - -#define GPIO_DBEN_DBEN13_Pos (13) /*!< GPIO_T::DBEN: DBEN13 Position */ -#define GPIO_DBEN_DBEN13_Msk (0x1ul << GPIO_DBEN_DBEN13_Pos) /*!< GPIO_T::DBEN: DBEN13 Mask */ - -#define GPIO_DBEN_DBEN14_Pos (14) /*!< GPIO_T::DBEN: DBEN14 Position */ -#define GPIO_DBEN_DBEN14_Msk (0x1ul << GPIO_DBEN_DBEN14_Pos) /*!< GPIO_T::DBEN: DBEN14 Mask */ - -#define GPIO_DBEN_DBEN15_Pos (15) /*!< GPIO_T::DBEN: DBEN15 Position */ -#define GPIO_DBEN_DBEN15_Msk (0x1ul << GPIO_DBEN_DBEN15_Pos) /*!< GPIO_T::DBEN: DBEN15 Mask */ - -#define GPIO_INTTYPE_TYPE0_Pos (0) /*!< GPIO_T::INTTYPE: TYPE0 Position */ -#define GPIO_INTTYPE_TYPE0_Msk (0x1ul << GPIO_INTTYPE_TYPE0_Pos) /*!< GPIO_T::INTTYPE: TYPE0 Mask */ - -#define GPIO_INTTYPE_TYPE1_Pos (1) /*!< GPIO_T::INTTYPE: TYPE1 Position */ -#define GPIO_INTTYPE_TYPE1_Msk (0x1ul << GPIO_INTTYPE_TYPE1_Pos) /*!< GPIO_T::INTTYPE: TYPE1 Mask */ - -#define GPIO_INTTYPE_TYPE2_Pos (2) /*!< GPIO_T::INTTYPE: TYPE2 Position */ -#define GPIO_INTTYPE_TYPE2_Msk (0x1ul << GPIO_INTTYPE_TYPE2_Pos) /*!< GPIO_T::INTTYPE: TYPE2 Mask */ - -#define GPIO_INTTYPE_TYPE3_Pos (3) /*!< GPIO_T::INTTYPE: TYPE3 Position */ -#define GPIO_INTTYPE_TYPE3_Msk (0x1ul << GPIO_INTTYPE_TYPE3_Pos) /*!< GPIO_T::INTTYPE: TYPE3 Mask */ - -#define GPIO_INTTYPE_TYPE4_Pos (4) /*!< GPIO_T::INTTYPE: TYPE4 Position */ -#define GPIO_INTTYPE_TYPE4_Msk (0x1ul << GPIO_INTTYPE_TYPE4_Pos) /*!< GPIO_T::INTTYPE: TYPE4 Mask */ - -#define GPIO_INTTYPE_TYPE5_Pos (5) /*!< GPIO_T::INTTYPE: TYPE5 Position */ -#define GPIO_INTTYPE_TYPE5_Msk (0x1ul << GPIO_INTTYPE_TYPE5_Pos) /*!< GPIO_T::INTTYPE: TYPE5 Mask */ - -#define GPIO_INTTYPE_TYPE6_Pos (6) /*!< GPIO_T::INTTYPE: TYPE6 Position */ -#define GPIO_INTTYPE_TYPE6_Msk (0x1ul << GPIO_INTTYPE_TYPE6_Pos) /*!< GPIO_T::INTTYPE: TYPE6 Mask */ - -#define GPIO_INTTYPE_TYPE7_Pos (7) /*!< GPIO_T::INTTYPE: TYPE7 Position */ -#define GPIO_INTTYPE_TYPE7_Msk (0x1ul << GPIO_INTTYPE_TYPE7_Pos) /*!< GPIO_T::INTTYPE: TYPE7 Mask */ - -#define GPIO_INTTYPE_TYPE8_Pos (8) /*!< GPIO_T::INTTYPE: TYPE8 Position */ -#define GPIO_INTTYPE_TYPE8_Msk (0x1ul << GPIO_INTTYPE_TYPE8_Pos) /*!< GPIO_T::INTTYPE: TYPE8 Mask */ - -#define GPIO_INTTYPE_TYPE9_Pos (9) /*!< GPIO_T::INTTYPE: TYPE9 Position */ -#define GPIO_INTTYPE_TYPE9_Msk (0x1ul << GPIO_INTTYPE_TYPE9_Pos) /*!< GPIO_T::INTTYPE: TYPE9 Mask */ - -#define GPIO_INTTYPE_TYPE10_Pos (10) /*!< GPIO_T::INTTYPE: TYPE10 Position */ -#define GPIO_INTTYPE_TYPE10_Msk (0x1ul << GPIO_INTTYPE_TYPE10_Pos) /*!< GPIO_T::INTTYPE: TYPE10 Mask */ - -#define GPIO_INTTYPE_TYPE11_Pos (11) /*!< GPIO_T::INTTYPE: TYPE11 Position */ -#define GPIO_INTTYPE_TYPE11_Msk (0x1ul << GPIO_INTTYPE_TYPE11_Pos) /*!< GPIO_T::INTTYPE: TYPE11 Mask */ - -#define GPIO_INTTYPE_TYPE12_Pos (12) /*!< GPIO_T::INTTYPE: TYPE12 Position */ -#define GPIO_INTTYPE_TYPE12_Msk (0x1ul << GPIO_INTTYPE_TYPE12_Pos) /*!< GPIO_T::INTTYPE: TYPE12 Mask */ - -#define GPIO_INTTYPE_TYPE13_Pos (13) /*!< GPIO_T::INTTYPE: TYPE13 Position */ -#define GPIO_INTTYPE_TYPE13_Msk (0x1ul << GPIO_INTTYPE_TYPE13_Pos) /*!< GPIO_T::INTTYPE: TYPE13 Mask */ - -#define GPIO_INTTYPE_TYPE14_Pos (14) /*!< GPIO_T::INTTYPE: TYPE14 Position */ -#define GPIO_INTTYPE_TYPE14_Msk (0x1ul << GPIO_INTTYPE_TYPE14_Pos) /*!< GPIO_T::INTTYPE: TYPE14 Mask */ - -#define GPIO_INTTYPE_TYPE15_Pos (15) /*!< GPIO_T::INTTYPE: TYPE15 Position */ -#define GPIO_INTTYPE_TYPE15_Msk (0x1ul << GPIO_INTTYPE_TYPE15_Pos) /*!< GPIO_T::INTTYPE: TYPE15 Mask */ - -#define GPIO_INTEN_FLIEN0_Pos (0) /*!< GPIO_T::INTEN: FLIEN0 Position */ -#define GPIO_INTEN_FLIEN0_Msk (0x1ul << GPIO_INTEN_FLIEN0_Pos) /*!< GPIO_T::INTEN: FLIEN0 Mask */ - -#define GPIO_INTEN_FLIEN1_Pos (1) /*!< GPIO_T::INTEN: FLIEN1 Position */ -#define GPIO_INTEN_FLIEN1_Msk (0x1ul << GPIO_INTEN_FLIEN1_Pos) /*!< GPIO_T::INTEN: FLIEN1 Mask */ - -#define GPIO_INTEN_FLIEN2_Pos (2) /*!< GPIO_T::INTEN: FLIEN2 Position */ -#define GPIO_INTEN_FLIEN2_Msk (0x1ul << GPIO_INTEN_FLIEN2_Pos) /*!< GPIO_T::INTEN: FLIEN2 Mask */ - -#define GPIO_INTEN_FLIEN3_Pos (3) /*!< GPIO_T::INTEN: FLIEN3 Position */ -#define GPIO_INTEN_FLIEN3_Msk (0x1ul << GPIO_INTEN_FLIEN3_Pos) /*!< GPIO_T::INTEN: FLIEN3 Mask */ - -#define GPIO_INTEN_FLIEN4_Pos (4) /*!< GPIO_T::INTEN: FLIEN4 Position */ -#define GPIO_INTEN_FLIEN4_Msk (0x1ul << GPIO_INTEN_FLIEN4_Pos) /*!< GPIO_T::INTEN: FLIEN4 Mask */ - -#define GPIO_INTEN_FLIEN5_Pos (5) /*!< GPIO_T::INTEN: FLIEN5 Position */ -#define GPIO_INTEN_FLIEN5_Msk (0x1ul << GPIO_INTEN_FLIEN5_Pos) /*!< GPIO_T::INTEN: FLIEN5 Mask */ - -#define GPIO_INTEN_FLIEN6_Pos (6) /*!< GPIO_T::INTEN: FLIEN6 Position */ -#define GPIO_INTEN_FLIEN6_Msk (0x1ul << GPIO_INTEN_FLIEN6_Pos) /*!< GPIO_T::INTEN: FLIEN6 Mask */ - -#define GPIO_INTEN_FLIEN7_Pos (7) /*!< GPIO_T::INTEN: FLIEN7 Position */ -#define GPIO_INTEN_FLIEN7_Msk (0x1ul << GPIO_INTEN_FLIEN7_Pos) /*!< GPIO_T::INTEN: FLIEN7 Mask */ - -#define GPIO_INTEN_FLIEN8_Pos (8) /*!< GPIO_T::INTEN: FLIEN8 Position */ -#define GPIO_INTEN_FLIEN8_Msk (0x1ul << GPIO_INTEN_FLIEN8_Pos) /*!< GPIO_T::INTEN: FLIEN8 Mask */ - -#define GPIO_INTEN_FLIEN9_Pos (9) /*!< GPIO_T::INTEN: FLIEN9 Position */ -#define GPIO_INTEN_FLIEN9_Msk (0x1ul << GPIO_INTEN_FLIEN9_Pos) /*!< GPIO_T::INTEN: FLIEN9 Mask */ - -#define GPIO_INTEN_FLIEN10_Pos (10) /*!< GPIO_T::INTEN: FLIEN10 Position */ -#define GPIO_INTEN_FLIEN10_Msk (0x1ul << GPIO_INTEN_FLIEN10_Pos) /*!< GPIO_T::INTEN: FLIEN10 Mask */ - -#define GPIO_INTEN_FLIEN11_Pos (11) /*!< GPIO_T::INTEN: FLIEN11 Position */ -#define GPIO_INTEN_FLIEN11_Msk (0x1ul << GPIO_INTEN_FLIEN11_Pos) /*!< GPIO_T::INTEN: FLIEN11 Mask */ - -#define GPIO_INTEN_FLIEN12_Pos (12) /*!< GPIO_T::INTEN: FLIEN12 Position */ -#define GPIO_INTEN_FLIEN12_Msk (0x1ul << GPIO_INTEN_FLIEN12_Pos) /*!< GPIO_T::INTEN: FLIEN12 Mask */ - -#define GPIO_INTEN_FLIEN13_Pos (13) /*!< GPIO_T::INTEN: FLIEN13 Position */ -#define GPIO_INTEN_FLIEN13_Msk (0x1ul << GPIO_INTEN_FLIEN13_Pos) /*!< GPIO_T::INTEN: FLIEN13 Mask */ - -#define GPIO_INTEN_FLIEN14_Pos (14) /*!< GPIO_T::INTEN: FLIEN14 Position */ -#define GPIO_INTEN_FLIEN14_Msk (0x1ul << GPIO_INTEN_FLIEN14_Pos) /*!< GPIO_T::INTEN: FLIEN14 Mask */ - -#define GPIO_INTEN_FLIEN15_Pos (15) /*!< GPIO_T::INTEN: FLIEN15 Position */ -#define GPIO_INTEN_FLIEN15_Msk (0x1ul << GPIO_INTEN_FLIEN15_Pos) /*!< GPIO_T::INTEN: FLIEN15 Mask */ - -#define GPIO_INTEN_RHIEN0_Pos (16) /*!< GPIO_T::INTEN: RHIEN0 Position */ -#define GPIO_INTEN_RHIEN0_Msk (0x1ul << GPIO_INTEN_RHIEN0_Pos) /*!< GPIO_T::INTEN: RHIEN0 Mask */ - -#define GPIO_INTEN_RHIEN1_Pos (17) /*!< GPIO_T::INTEN: RHIEN1 Position */ -#define GPIO_INTEN_RHIEN1_Msk (0x1ul << GPIO_INTEN_RHIEN1_Pos) /*!< GPIO_T::INTEN: RHIEN1 Mask */ - -#define GPIO_INTEN_RHIEN2_Pos (18) /*!< GPIO_T::INTEN: RHIEN2 Position */ -#define GPIO_INTEN_RHIEN2_Msk (0x1ul << GPIO_INTEN_RHIEN2_Pos) /*!< GPIO_T::INTEN: RHIEN2 Mask */ - -#define GPIO_INTEN_RHIEN3_Pos (19) /*!< GPIO_T::INTEN: RHIEN3 Position */ -#define GPIO_INTEN_RHIEN3_Msk (0x1ul << GPIO_INTEN_RHIEN3_Pos) /*!< GPIO_T::INTEN: RHIEN3 Mask */ - -#define GPIO_INTEN_RHIEN4_Pos (20) /*!< GPIO_T::INTEN: RHIEN4 Position */ -#define GPIO_INTEN_RHIEN4_Msk (0x1ul << GPIO_INTEN_RHIEN4_Pos) /*!< GPIO_T::INTEN: RHIEN4 Mask */ - -#define GPIO_INTEN_RHIEN5_Pos (21) /*!< GPIO_T::INTEN: RHIEN5 Position */ -#define GPIO_INTEN_RHIEN5_Msk (0x1ul << GPIO_INTEN_RHIEN5_Pos) /*!< GPIO_T::INTEN: RHIEN5 Mask */ - -#define GPIO_INTEN_RHIEN6_Pos (22) /*!< GPIO_T::INTEN: RHIEN6 Position */ -#define GPIO_INTEN_RHIEN6_Msk (0x1ul << GPIO_INTEN_RHIEN6_Pos) /*!< GPIO_T::INTEN: RHIEN6 Mask */ - -#define GPIO_INTEN_RHIEN7_Pos (23) /*!< GPIO_T::INTEN: RHIEN7 Position */ -#define GPIO_INTEN_RHIEN7_Msk (0x1ul << GPIO_INTEN_RHIEN7_Pos) /*!< GPIO_T::INTEN: RHIEN7 Mask */ - -#define GPIO_INTEN_RHIEN8_Pos (24) /*!< GPIO_T::INTEN: RHIEN8 Position */ -#define GPIO_INTEN_RHIEN8_Msk (0x1ul << GPIO_INTEN_RHIEN8_Pos) /*!< GPIO_T::INTEN: RHIEN8 Mask */ - -#define GPIO_INTEN_RHIEN9_Pos (25) /*!< GPIO_T::INTEN: RHIEN9 Position */ -#define GPIO_INTEN_RHIEN9_Msk (0x1ul << GPIO_INTEN_RHIEN9_Pos) /*!< GPIO_T::INTEN: RHIEN9 Mask */ - -#define GPIO_INTEN_RHIEN10_Pos (26) /*!< GPIO_T::INTEN: RHIEN10 Position */ -#define GPIO_INTEN_RHIEN10_Msk (0x1ul << GPIO_INTEN_RHIEN10_Pos) /*!< GPIO_T::INTEN: RHIEN10 Mask */ - -#define GPIO_INTEN_RHIEN11_Pos (27) /*!< GPIO_T::INTEN: RHIEN11 Position */ -#define GPIO_INTEN_RHIEN11_Msk (0x1ul << GPIO_INTEN_RHIEN11_Pos) /*!< GPIO_T::INTEN: RHIEN11 Mask */ - -#define GPIO_INTEN_RHIEN12_Pos (28) /*!< GPIO_T::INTEN: RHIEN12 Position */ -#define GPIO_INTEN_RHIEN12_Msk (0x1ul << GPIO_INTEN_RHIEN12_Pos) /*!< GPIO_T::INTEN: RHIEN12 Mask */ - -#define GPIO_INTEN_RHIEN13_Pos (29) /*!< GPIO_T::INTEN: RHIEN13 Position */ -#define GPIO_INTEN_RHIEN13_Msk (0x1ul << GPIO_INTEN_RHIEN13_Pos) /*!< GPIO_T::INTEN: RHIEN13 Mask */ - -#define GPIO_INTEN_RHIEN14_Pos (30) /*!< GPIO_T::INTEN: RHIEN14 Position */ -#define GPIO_INTEN_RHIEN14_Msk (0x1ul << GPIO_INTEN_RHIEN14_Pos) /*!< GPIO_T::INTEN: RHIEN14 Mask */ - -#define GPIO_INTEN_RHIEN15_Pos (31) /*!< GPIO_T::INTEN: RHIEN15 Position */ -#define GPIO_INTEN_RHIEN15_Msk (0x1ul << GPIO_INTEN_RHIEN15_Pos) /*!< GPIO_T::INTEN: RHIEN15 Mask */ - -#define GPIO_INTSRC_INTSRC0_Pos (0) /*!< GPIO_T::INTSRC: INTSRC0 Position */ -#define GPIO_INTSRC_INTSRC0_Msk (0x1ul << GPIO_INTSRC_INTSRC0_Pos) /*!< GPIO_T::INTSRC: INTSRC0 Mask */ - -#define GPIO_INTSRC_INTSRC1_Pos (1) /*!< GPIO_T::INTSRC: INTSRC1 Position */ -#define GPIO_INTSRC_INTSRC1_Msk (0x1ul << GPIO_INTSRC_INTSRC1_Pos) /*!< GPIO_T::INTSRC: INTSRC1 Mask */ - -#define GPIO_INTSRC_INTSRC2_Pos (2) /*!< GPIO_T::INTSRC: INTSRC2 Position */ -#define GPIO_INTSRC_INTSRC2_Msk (0x1ul << GPIO_INTSRC_INTSRC2_Pos) /*!< GPIO_T::INTSRC: INTSRC2 Mask */ - -#define GPIO_INTSRC_INTSRC3_Pos (3) /*!< GPIO_T::INTSRC: INTSRC3 Position */ -#define GPIO_INTSRC_INTSRC3_Msk (0x1ul << GPIO_INTSRC_INTSRC3_Pos) /*!< GPIO_T::INTSRC: INTSRC3 Mask */ - -#define GPIO_INTSRC_INTSRC4_Pos (4) /*!< GPIO_T::INTSRC: INTSRC4 Position */ -#define GPIO_INTSRC_INTSRC4_Msk (0x1ul << GPIO_INTSRC_INTSRC4_Pos) /*!< GPIO_T::INTSRC: INTSRC4 Mask */ - -#define GPIO_INTSRC_INTSRC5_Pos (5) /*!< GPIO_T::INTSRC: INTSRC5 Position */ -#define GPIO_INTSRC_INTSRC5_Msk (0x1ul << GPIO_INTSRC_INTSRC5_Pos) /*!< GPIO_T::INTSRC: INTSRC5 Mask */ - -#define GPIO_INTSRC_INTSRC6_Pos (6) /*!< GPIO_T::INTSRC: INTSRC6 Position */ -#define GPIO_INTSRC_INTSRC6_Msk (0x1ul << GPIO_INTSRC_INTSRC6_Pos) /*!< GPIO_T::INTSRC: INTSRC6 Mask */ - -#define GPIO_INTSRC_INTSRC7_Pos (7) /*!< GPIO_T::INTSRC: INTSRC7 Position */ -#define GPIO_INTSRC_INTSRC7_Msk (0x1ul << GPIO_INTSRC_INTSRC7_Pos) /*!< GPIO_T::INTSRC: INTSRC7 Mask */ - -#define GPIO_INTSRC_INTSRC8_Pos (8) /*!< GPIO_T::INTSRC: INTSRC8 Position */ -#define GPIO_INTSRC_INTSRC8_Msk (0x1ul << GPIO_INTSRC_INTSRC8_Pos) /*!< GPIO_T::INTSRC: INTSRC8 Mask */ - -#define GPIO_INTSRC_INTSRC9_Pos (9) /*!< GPIO_T::INTSRC: INTSRC9 Position */ -#define GPIO_INTSRC_INTSRC9_Msk (0x1ul << GPIO_INTSRC_INTSRC9_Pos) /*!< GPIO_T::INTSRC: INTSRC9 Mask */ - -#define GPIO_INTSRC_INTSRC10_Pos (10) /*!< GPIO_T::INTSRC: INTSRC10 Position */ -#define GPIO_INTSRC_INTSRC10_Msk (0x1ul << GPIO_INTSRC_INTSRC10_Pos) /*!< GPIO_T::INTSRC: INTSRC10 Mask */ - -#define GPIO_INTSRC_INTSRC11_Pos (11) /*!< GPIO_T::INTSRC: INTSRC11 Position */ -#define GPIO_INTSRC_INTSRC11_Msk (0x1ul << GPIO_INTSRC_INTSRC11_Pos) /*!< GPIO_T::INTSRC: INTSRC11 Mask */ - -#define GPIO_INTSRC_INTSRC12_Pos (12) /*!< GPIO_T::INTSRC: INTSRC12 Position */ -#define GPIO_INTSRC_INTSRC12_Msk (0x1ul << GPIO_INTSRC_INTSRC12_Pos) /*!< GPIO_T::INTSRC: INTSRC12 Mask */ - -#define GPIO_INTSRC_INTSRC13_Pos (13) /*!< GPIO_T::INTSRC: INTSRC13 Position */ -#define GPIO_INTSRC_INTSRC13_Msk (0x1ul << GPIO_INTSRC_INTSRC13_Pos) /*!< GPIO_T::INTSRC: INTSRC13 Mask */ - -#define GPIO_INTSRC_INTSRC14_Pos (14) /*!< GPIO_T::INTSRC: INTSRC14 Position */ -#define GPIO_INTSRC_INTSRC14_Msk (0x1ul << GPIO_INTSRC_INTSRC14_Pos) /*!< GPIO_T::INTSRC: INTSRC14 Mask */ - -#define GPIO_INTSRC_INTSRC15_Pos (15) /*!< GPIO_T::INTSRC: INTSRC15 Position */ -#define GPIO_INTSRC_INTSRC15_Msk (0x1ul << GPIO_INTSRC_INTSRC15_Pos) /*!< GPIO_T::INTSRC: INTSRC15 Mask */ - -#define GPIO_SMTEN_SMTEN0_Pos (0) /*!< GPIO_T::SMTEN: SMTEN0 Position */ -#define GPIO_SMTEN_SMTEN0_Msk (0x1ul << GPIO_SMTEN_SMTEN0_Pos) /*!< GPIO_T::SMTEN: SMTEN0 Mask */ - -#define GPIO_SMTEN_SMTEN1_Pos (1) /*!< GPIO_T::SMTEN: SMTEN1 Position */ -#define GPIO_SMTEN_SMTEN1_Msk (0x1ul << GPIO_SMTEN_SMTEN1_Pos) /*!< GPIO_T::SMTEN: SMTEN1 Mask */ - -#define GPIO_SMTEN_SMTEN2_Pos (2) /*!< GPIO_T::SMTEN: SMTEN2 Position */ -#define GPIO_SMTEN_SMTEN2_Msk (0x1ul << GPIO_SMTEN_SMTEN2_Pos) /*!< GPIO_T::SMTEN: SMTEN2 Mask */ - -#define GPIO_SMTEN_SMTEN3_Pos (3) /*!< GPIO_T::SMTEN: SMTEN3 Position */ -#define GPIO_SMTEN_SMTEN3_Msk (0x1ul << GPIO_SMTEN_SMTEN3_Pos) /*!< GPIO_T::SMTEN: SMTEN3 Mask */ - -#define GPIO_SMTEN_SMTEN4_Pos (4) /*!< GPIO_T::SMTEN: SMTEN4 Position */ -#define GPIO_SMTEN_SMTEN4_Msk (0x1ul << GPIO_SMTEN_SMTEN4_Pos) /*!< GPIO_T::SMTEN: SMTEN4 Mask */ - -#define GPIO_SMTEN_SMTEN5_Pos (5) /*!< GPIO_T::SMTEN: SMTEN5 Position */ -#define GPIO_SMTEN_SMTEN5_Msk (0x1ul << GPIO_SMTEN_SMTEN5_Pos) /*!< GPIO_T::SMTEN: SMTEN5 Mask */ - -#define GPIO_SMTEN_SMTEN6_Pos (6) /*!< GPIO_T::SMTEN: SMTEN6 Position */ -#define GPIO_SMTEN_SMTEN6_Msk (0x1ul << GPIO_SMTEN_SMTEN6_Pos) /*!< GPIO_T::SMTEN: SMTEN6 Mask */ - -#define GPIO_SMTEN_SMTEN7_Pos (7) /*!< GPIO_T::SMTEN: SMTEN7 Position */ -#define GPIO_SMTEN_SMTEN7_Msk (0x1ul << GPIO_SMTEN_SMTEN7_Pos) /*!< GPIO_T::SMTEN: SMTEN7 Mask */ - -#define GPIO_SMTEN_SMTEN8_Pos (8) /*!< GPIO_T::SMTEN: SMTEN8 Position */ -#define GPIO_SMTEN_SMTEN8_Msk (0x1ul << GPIO_SMTEN_SMTEN8_Pos) /*!< GPIO_T::SMTEN: SMTEN8 Mask */ - -#define GPIO_SMTEN_SMTEN9_Pos (9) /*!< GPIO_T::SMTEN: SMTEN9 Position */ -#define GPIO_SMTEN_SMTEN9_Msk (0x1ul << GPIO_SMTEN_SMTEN9_Pos) /*!< GPIO_T::SMTEN: SMTEN9 Mask */ - -#define GPIO_SMTEN_SMTEN10_Pos (10) /*!< GPIO_T::SMTEN: SMTEN10 Position */ -#define GPIO_SMTEN_SMTEN10_Msk (0x1ul << GPIO_SMTEN_SMTEN10_Pos) /*!< GPIO_T::SMTEN: SMTEN10 Mask */ - -#define GPIO_SMTEN_SMTEN11_Pos (11) /*!< GPIO_T::SMTEN: SMTEN11 Position */ -#define GPIO_SMTEN_SMTEN11_Msk (0x1ul << GPIO_SMTEN_SMTEN11_Pos) /*!< GPIO_T::SMTEN: SMTEN11 Mask */ - -#define GPIO_SMTEN_SMTEN12_Pos (12) /*!< GPIO_T::SMTEN: SMTEN12 Position */ -#define GPIO_SMTEN_SMTEN12_Msk (0x1ul << GPIO_SMTEN_SMTEN12_Pos) /*!< GPIO_T::SMTEN: SMTEN12 Mask */ - -#define GPIO_SMTEN_SMTEN13_Pos (13) /*!< GPIO_T::SMTEN: SMTEN13 Position */ -#define GPIO_SMTEN_SMTEN13_Msk (0x1ul << GPIO_SMTEN_SMTEN13_Pos) /*!< GPIO_T::SMTEN: SMTEN13 Mask */ - -#define GPIO_SMTEN_SMTEN14_Pos (14) /*!< GPIO_T::SMTEN: SMTEN14 Position */ -#define GPIO_SMTEN_SMTEN14_Msk (0x1ul << GPIO_SMTEN_SMTEN14_Pos) /*!< GPIO_T::SMTEN: SMTEN14 Mask */ - -#define GPIO_SMTEN_SMTEN15_Pos (15) /*!< GPIO_T::SMTEN: SMTEN15 Position */ -#define GPIO_SMTEN_SMTEN15_Msk (0x1ul << GPIO_SMTEN_SMTEN15_Pos) /*!< GPIO_T::SMTEN: SMTEN15 Mask */ - -#define GPIO_SLEWCTL_HSREN0_Pos (0) /*!< GPIO_T::SLEWCTL: HSREN0 Position */ -#define GPIO_SLEWCTL_HSREN0_Msk (0x1ul << GPIO_SLEWCTL_HSREN0_Pos) /*!< GPIO_T::SLEWCTL: HSREN0 Mask */ - -#define GPIO_SLEWCTL_HSREN1_Pos (1) /*!< GPIO_T::SLEWCTL: HSREN1 Position */ -#define GPIO_SLEWCTL_HSREN1_Msk (0x1ul << GPIO_SLEWCTL_HSREN1_Pos) /*!< GPIO_T::SLEWCTL: HSREN1 Mask */ - -#define GPIO_SLEWCTL_HSREN2_Pos (2) /*!< GPIO_T::SLEWCTL: HSREN2 Position */ -#define GPIO_SLEWCTL_HSREN2_Msk (0x1ul << GPIO_SLEWCTL_HSREN2_Pos) /*!< GPIO_T::SLEWCTL: HSREN2 Mask */ - -#define GPIO_SLEWCTL_HSREN3_Pos (3) /*!< GPIO_T::SLEWCTL: HSREN3 Position */ -#define GPIO_SLEWCTL_HSREN3_Msk (0x1ul << GPIO_SLEWCTL_HSREN3_Pos) /*!< GPIO_T::SLEWCTL: HSREN3 Mask */ - -#define GPIO_SLEWCTL_HSREN4_Pos (4) /*!< GPIO_T::SLEWCTL: HSREN4 Position */ -#define GPIO_SLEWCTL_HSREN4_Msk (0x1ul << GPIO_SLEWCTL_HSREN4_Pos) /*!< GPIO_T::SLEWCTL: HSREN4 Mask */ - -#define GPIO_SLEWCTL_HSREN5_Pos (5) /*!< GPIO_T::SLEWCTL: HSREN5 Position */ -#define GPIO_SLEWCTL_HSREN5_Msk (0x1ul << GPIO_SLEWCTL_HSREN5_Pos) /*!< GPIO_T::SLEWCTL: HSREN5 Mask */ - -#define GPIO_SLEWCTL_HSREN6_Pos (6) /*!< GPIO_T::SLEWCTL: HSREN6 Position */ -#define GPIO_SLEWCTL_HSREN6_Msk (0x1ul << GPIO_SLEWCTL_HSREN6_Pos) /*!< GPIO_T::SLEWCTL: HSREN6 Mask */ - -#define GPIO_SLEWCTL_HSREN7_Pos (7) /*!< GPIO_T::SLEWCTL: HSREN7 Position */ -#define GPIO_SLEWCTL_HSREN7_Msk (0x1ul << GPIO_SLEWCTL_HSREN7_Pos) /*!< GPIO_T::SLEWCTL: HSREN7 Mask */ - -#define GPIO_SLEWCTL_HSREN8_Pos (8) /*!< GPIO_T::SLEWCTL: HSREN8 Position */ -#define GPIO_SLEWCTL_HSREN8_Msk (0x1ul << GPIO_SLEWCTL_HSREN8_Pos) /*!< GPIO_T::SLEWCTL: HSREN8 Mask */ - -#define GPIO_SLEWCTL_HSREN9_Pos (9) /*!< GPIO_T::SLEWCTL: HSREN9 Position */ -#define GPIO_SLEWCTL_HSREN9_Msk (0x1ul << GPIO_SLEWCTL_HSREN9_Pos) /*!< GPIO_T::SLEWCTL: HSREN9 Mask */ - -#define GPIO_SLEWCTL_HSREN10_Pos (10) /*!< GPIO_T::SLEWCTL: HSREN10 Position */ -#define GPIO_SLEWCTL_HSREN10_Msk (0x1ul << GPIO_SLEWCTL_HSREN10_Pos) /*!< GPIO_T::SLEWCTL: HSREN10 Mask */ - -#define GPIO_SLEWCTL_HSREN11_Pos (11) /*!< GPIO_T::SLEWCTL: HSREN11 Position */ -#define GPIO_SLEWCTL_HSREN11_Msk (0x1ul << GPIO_SLEWCTL_HSREN11_Pos) /*!< GPIO_T::SLEWCTL: HSREN11 Mask */ - -#define GPIO_SLEWCTL_HSREN12_Pos (12) /*!< GPIO_T::SLEWCTL: HSREN12 Position */ -#define GPIO_SLEWCTL_HSREN12_Msk (0x1ul << GPIO_SLEWCTL_HSREN12_Pos) /*!< GPIO_T::SLEWCTL: HSREN12 Mask */ - -#define GPIO_SLEWCTL_HSREN13_Pos (13) /*!< GPIO_T::SLEWCTL: HSREN13 Position */ -#define GPIO_SLEWCTL_HSREN13_Msk (0x1ul << GPIO_SLEWCTL_HSREN13_Pos) /*!< GPIO_T::SLEWCTL: HSREN13 Mask */ - -#define GPIO_SLEWCTL_HSREN14_Pos (14) /*!< GPIO_T::SLEWCTL: HSREN14 Position */ -#define GPIO_SLEWCTL_HSREN14_Msk (0x1ul << GPIO_SLEWCTL_HSREN14_Pos) /*!< GPIO_T::SLEWCTL: HSREN14 Mask */ - -#define GPIO_SLEWCTL_HSREN15_Pos (15) /*!< GPIO_T::SLEWCTL: HSREN15 Position */ -#define GPIO_SLEWCTL_HSREN15_Msk (0x1ul << GPIO_SLEWCTL_HSREN15_Pos) /*!< GPIO_T::SLEWCTL: HSREN15 Mask */ - -#define GPIO_PUSEL_PUSEL0_Pos (0) /*!< GPIO_T::PUSEL: PUSEL0 Position */ -#define GPIO_PUSEL_PUSEL0_Msk (0x3ul << GPIO_PUSEL_PUSEL0_Pos) /*!< GPIO_T::PUSEL: PUSEL0 Mask */ - -#define GPIO_PUSEL_PUSEL1_Pos (2) /*!< GPIO_T::PUSEL: PUSEL1 Position */ -#define GPIO_PUSEL_PUSEL1_Msk (0x3ul << GPIO_PUSEL_PUSEL1_Pos) /*!< GPIO_T::PUSEL: PUSEL1 Mask */ - -#define GPIO_PUSEL_PUSEL2_Pos (4) /*!< GPIO_T::PUSEL: PUSEL2 Position */ -#define GPIO_PUSEL_PUSEL2_Msk (0x3ul << GPIO_PUSEL_PUSEL2_Pos) /*!< GPIO_T::PUSEL: PUSEL2 Mask */ - -#define GPIO_PUSEL_PUSEL3_Pos (6) /*!< GPIO_T::PUSEL: PUSEL3 Position */ -#define GPIO_PUSEL_PUSEL3_Msk (0x3ul << GPIO_PUSEL_PUSEL3_Pos) /*!< GPIO_T::PUSEL: PUSEL3 Mask */ - -#define GPIO_PUSEL_PUSEL4_Pos (8) /*!< GPIO_T::PUSEL: PUSEL4 Position */ -#define GPIO_PUSEL_PUSEL4_Msk (0x3ul << GPIO_PUSEL_PUSEL4_Pos) /*!< GPIO_T::PUSEL: PUSEL4 Mask */ - -#define GPIO_PUSEL_PUSEL5_Pos (10) /*!< GPIO_T::PUSEL: PUSEL5 Position */ -#define GPIO_PUSEL_PUSEL5_Msk (0x3ul << GPIO_PUSEL_PUSEL5_Pos) /*!< GPIO_T::PUSEL: PUSEL5 Mask */ - -#define GPIO_PUSEL_PUSEL6_Pos (12) /*!< GPIO_T::PUSEL: PUSEL6 Position */ -#define GPIO_PUSEL_PUSEL6_Msk (0x3ul << GPIO_PUSEL_PUSEL6_Pos) /*!< GPIO_T::PUSEL: PUSEL6 Mask */ - -#define GPIO_PUSEL_PUSEL7_Pos (14) /*!< GPIO_T::PUSEL: PUSEL7 Position */ -#define GPIO_PUSEL_PUSEL7_Msk (0x3ul << GPIO_PUSEL_PUSEL7_Pos) /*!< GPIO_T::PUSEL: PUSEL7 Mask */ - -#define GPIO_PUSEL_PUSEL8_Pos (16) /*!< GPIO_T::PUSEL: PUSEL8 Position */ -#define GPIO_PUSEL_PUSEL8_Msk (0x3ul << GPIO_PUSEL_PUSEL8_Pos) /*!< GPIO_T::PUSEL: PUSEL8 Mask */ - -#define GPIO_PUSEL_PUSEL9_Pos (18) /*!< GPIO_T::PUSEL: PUSEL9 Position */ -#define GPIO_PUSEL_PUSEL9_Msk (0x3ul << GPIO_PUSEL_PUSEL9_Pos) /*!< GPIO_T::PUSEL: PUSEL9 Mask */ - -#define GPIO_PUSEL_PUSEL10_Pos (20) /*!< GPIO_T::PUSEL: PUSEL10 Position */ -#define GPIO_PUSEL_PUSEL10_Msk (0x3ul << GPIO_PUSEL_PUSEL10_Pos) /*!< GPIO_T::PUSEL: PUSEL10 Mask */ - -#define GPIO_PUSEL_PUSEL11_Pos (22) /*!< GPIO_T::PUSEL: PUSEL11 Position */ -#define GPIO_PUSEL_PUSEL11_Msk (0x3ul << GPIO_PUSEL_PUSEL11_Pos) /*!< GPIO_T::PUSEL: PUSEL11 Mask */ - -#define GPIO_PUSEL_PUSEL12_Pos (24) /*!< GPIO_T::PUSEL: PUSEL12 Position */ -#define GPIO_PUSEL_PUSEL12_Msk (0x3ul << GPIO_PUSEL_PUSEL12_Pos) /*!< GPIO_T::PUSEL: PUSEL12 Mask */ - -#define GPIO_PUSEL_PUSEL13_Pos (26) /*!< GPIO_T::PUSEL: PUSEL13 Position */ -#define GPIO_PUSEL_PUSEL13_Msk (0x3ul << GPIO_PUSEL_PUSEL13_Pos) /*!< GPIO_T::PUSEL: PUSEL13 Mask */ - -#define GPIO_PUSEL_PUSEL14_Pos (28) /*!< GPIO_T::PUSEL: PUSEL14 Position */ -#define GPIO_PUSEL_PUSEL14_Msk (0x3ul << GPIO_PUSEL_PUSEL14_Pos) /*!< GPIO_T::PUSEL: PUSEL14 Mask */ - -#define GPIO_PUSEL_PUSEL15_Pos (30) /*!< GPIO_T::PUSEL: PUSEL15 Position */ -#define GPIO_PUSEL_PUSEL15_Msk (0x3ul << GPIO_PUSEL_PUSEL15_Pos) /*!< GPIO_T::PUSEL: PUSEL15 Mask */ - -#define GPIO_DBCTL_DBCLKSEL_Pos (0) /*!< GPIO_T::DBCTL: DBCLKSEL Position */ -#define GPIO_DBCTL_DBCLKSEL_Msk (0xful << GPIO_DBCTL_DBCLKSEL_Pos) /*!< GPIO_T::DBCTL: DBCLKSEL Mask */ - -#define GPIO_DBCTL_DBCLKSRC_Pos (4) /*!< GPIO_T::DBCTL: DBCLKSRC Position */ -#define GPIO_DBCTL_DBCLKSRC_Msk (0x1ul << GPIO_DBCTL_DBCLKSRC_Pos) /*!< GPIO_T::DBCTL: DBCLKSRC Mask */ - -#define GPIO_DBCTL_ICLKON_Pos (5) /*!< GPIO_T::DBCTL: ICLKON Position */ -#define GPIO_DBCTL_ICLKON_Msk (0x1ul << GPIO_DBCTL_ICLKON_Pos) /*!< GPIO_T::DBCTL: ICLKON Mask */ - - -/**@}*/ /* GPIO_CONST */ -/**@}*/ /* end of GPIO register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __GPIO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/hdiv_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/hdiv_reg.h deleted file mode 100644 index 3ed76967cf6..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/hdiv_reg.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************//** - * @file hdiv_reg.h - * @version V1.00 - * @brief HDIV register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HDIV_REG_H__ -#define __HDIV_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Hardware Divider --------------------------------*/ -/** - @addtogroup HDIV Hardware Divider(HDIV) - Memory Mapped Structure for HDIV Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var HDIV_T::DIVIDEND - * Offset: 0x00 Dividend Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DIVIDEND |Dividend Source - * | | |This register is given the dividend of divider before calculation starting. - * @var HDIV_T::DIVISOR - * Offset: 0x04 Divisor Source Resister - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DIVISOR |Divisor Source - * | | |This register is given the divisor of divider before calculation starts. - * | | |Note: When this register is written, hardware divider will start calculate. - * @var HDIV_T::DIVQUO - * Offset: 0x08 Quotient Result Resister - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |QUOTIENT |Quotient Result - * | | |This register holds the quotient result of divider after calculation complete. - * @var HDIV_T::DIVREM - * Offset: 0x0C Remainder Result Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |REMAINDER |Remainder Result - * | | |The remainder of hardware divider is 16-bit sign integer (REMAINDER[15:0]), which holds the remainder result of divider after calculation complete. - * | | |The remainder of hardware divider with sign extension (REMAINDER[31:16]) to 32-bit integer. - * | | |This register holds the remainder result of divider after calculation complete. - * @var HDIV_T::DIVSTS - * Offset: 0x10 Divider Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FINISH |Division Finish Flag - * | | |0 = Under Calculation. - * | | |1 = Calculation finished. - * | | |The flag will become low when the divider is in calculation. - * | | |The flag will go back to high once the calculation finished. - * |[1] |DIV0 |Divisor Zero Warning - * | | |0 = The divisor is not 0. - * | | |1 = The divisor is 0. - * | | |Note: The DIV0 flag is used to indicate divide-by-zero situation and updated whenever DIVISOR is written - * | | |This register is read only. - */ - __IO uint32_t DIVIDEND; /*!< [0x0000] Dividend Source Register */ - __IO uint32_t DIVISOR; /*!< [0x0004] Divisor Source Resister */ - __IO uint32_t DIVQUO; /*!< [0x0008] Quotient Result Resister */ - __IO uint32_t DIVREM; /*!< [0x000c] Remainder Result Register */ - __I uint32_t DIVSTS; /*!< [0x0010] Divider Status Register */ - -} HDIV_T; - -/** - @addtogroup HDIV_CONST HDIV Bit Field Definition - Constant Definitions for HDIV Controller - @{ -*/ - -#define HDIV_DIVIDEND_DIVIDEND_Pos (0) /*!< HDIV_T::DIVIDEND: DIVIDEND Position */ -#define HDIV_DIVIDEND_DIVIDEND_Msk (0xfffffffful << HDIV_DIVIDEND_DIVIDEND_Pos) /*!< HDIV_T::DIVIDEND: DIVIDEND Mask */ - -#define HDIV_DIVISOR_DIVISOR_Pos (0) /*!< HDIV_T::DIVISOR: DIVISOR Position */ -#define HDIV_DIVISOR_DIVISOR_Msk (0xfffful << HDIV_DIVISOR_DIVISOR_Pos) /*!< HDIV_T::DIVISOR: DIVISOR Mask */ - -#define HDIV_DIVQUO_QUOTIENT_Pos (0) /*!< HDIV_T::DIVQUO: QUOTIENT Position */ -#define HDIV_DIVQUO_QUOTIENT_Msk (0xfffffffful << HDIV_DIVQUO_QUOTIENT_Pos) /*!< HDIV_T::DIVQUO: QUOTIENT Mask */ - -#define HDIV_DIVREM_REMAINDER_Pos (0) /*!< HDIV_T::DIVREM: REMAINDER Position */ -#define HDIV_DIVREM_REMAINDER_Msk (0xfffffffful << HDIV_DIVREM_REMAINDER_Pos) /*!< HDIV_T::DIVREM: REMAINDER Mask */ - -#define HDIV_DIVSTS_FINISH_Pos (0) /*!< HDIV_T::DIVSTS: FINISH Position */ -#define HDIV_DIVSTS_FINISH_Msk (0x1ul << HDIV_DIVSTS_FINISH_Pos) /*!< HDIV_T::DIVSTS: FINISH Mask */ - -#define HDIV_DIVSTS_DIV0_Pos (1) /*!< HDIV_T::DIVSTS: DIV0 Position */ -#define HDIV_DIVSTS_DIV0_Msk (0x1ul << HDIV_DIVSTS_DIV0_Pos) /*!< HDIV_T::DIVSTS: DIV0 Mask */ - -/**@}*/ /* HDIV_CONST */ -/**@}*/ /* end of HDIV register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __HDIV_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2c_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2c_reg.h deleted file mode 100644 index 6435a0e308c..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2c_reg.h +++ /dev/null @@ -1,717 +0,0 @@ -/**************************************************************************//** - * @file i2c_reg.h - * @version V1.00 - * @brief I2C register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __I2C_REG_H__ -#define __I2C_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Inter-IC Bus Controller -------------------------*/ -/** - @addtogroup I2C Inter-IC Bus Controller(I2C) - Memory Mapped Structure for I2C Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var I2C_T::CTL0 - * Offset: 0x00 I2C Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |AA |Assert Acknowledge Control - * | | |When AA =1 prior to address or data is received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line - * |[3] |SI |I2C Interrupt Flag - * | | |When a new I2C state is present in the I2C_STATUS register, the SI flag is set by hardware - * | | |If bit INTEN (I2C_CTL [7]) is set, the I2C interrupt is requested - * | | |SI must be cleared by software - * | | |Clear SI by writing 1 to this bit. - * | | |For ACKMEN is set in slave read mode, the SI flag is set in 8th clock period for user to confirm the acknowledge bit and 9th clock period for user to read the data in the data buffer. - * |[4] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C controller will check the bus condition if a STOP condition is detected - * | | |This bit will be cleared by hardware automatically. - * |[5] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[6] |I2CEN |I2C Controller Enable Bit - * | | |Set to enable I2C serial function controller - * | | |When I2CEN=1 the I2C serial function enable - * | | |The multi-function pin function must set to SDA, and SCL of I2C function first. - * | | |0 = I2C controller Disabled. - * | | |1 = I2C controller Enabled. - * |[7] |INTEN |Enable Interrupt - * | | |0 = I2C interrupt Disabled. - * | | |1 = I2C interrupt Enabled. - * @var I2C_T::ADDR0 - * Offset: 0x04 I2C Slave Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * @var I2C_T::DAT - * Offset: 0x08 I2C Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |I2C Data - * | | |Bit [7:0] is located with the 8-bit transferred/received data of I2C serial port. - * @var I2C_T::STATUS0 - * Offset: 0x0C I2C Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |STATUS |I2C Status - * | | |The three least significant bits are always 0 - * | | |The five most significant bits contain the status code - * | | |There are 28 possible status codes - * | | |When the content of I2C_STATUS0 is F8H, no serial interrupt is requested - * | | |Others I2C_STATUS0 values correspond to defined I2C states - * | | |When each of these states is entered, a status interrupt is requested (SI = 1) - * | | |A valid status code is present in I2C_STATUS0 one cycle after SI is set by hardware and is still present one cycle after SI has been reset by software - * | | |In addition, states 00H stands for a Bus Error - * | | |A Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit. - * @var I2C_T::CLKDIV - * Offset: 0x10 I2C Clock Divided Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DIVIDER |I2C Clock Divided - * | | |Indicates the I2C clock rate: Data Baud Rate of I2C = (system clock) / (4x (I2C_CLKDIV+1)). - * | | |Note: The minimum value of I2C_CLKDIV is 4. - * @var I2C_T::TOCTL - * Offset: 0x14 I2C Time-out Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIF |Time-out Flag - * | | |This bit is set by hardware when I2C time-out happened and it can interrupt CPU if I2C interrupt enable bit (INTEN) is set to 1. - * | | |Note: Software can write 1 to clear this bit. - * |[1] |TOCDIV4 |Time-out Counter Input Clock Divided by 4 - * | | |When Enabled, The time-out period is extend 4 times. - * | | |0 = Time-out period is extend 4 times Disabled. - * | | |1 = Time-out period is extend 4 times Enabled. - * |[2] |TOCEN |Time-out Counter Enable Bit - * | | |When Enabled, the 14-bit time-out counter will start counting when SI is clear - * | | |Setting flag SI to u20181' will reset counter and re-start up counting after SI is cleared. - * | | |0 = Time-out counter Disabled. - * | | |1 = Time-out counter Enabled. - * @var I2C_T::ADDR1 - * Offset: 0x18 I2C Slave Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * @var I2C_T::ADDR2 - * Offset: 0x1C I2C Slave Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * @var I2C_T::ADDR3 - * Offset: 0x20 I2C Slave Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * @var I2C_T::ADDRMSK0 - * Offset: 0x24 I2C Slave Address Mask Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK1 - * Offset: 0x28 I2C Slave Address Mask Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK2 - * Offset: 0x2C I2C Slave Address Mask Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK3 - * Offset: 0x30 I2C Slave Address Mask Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::WKCTL - * Offset: 0x3C I2C Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |I2C Wake-up Enable Bit - * | | |0 = I2C wake-up function Disabled. - * | | |1= I2C wake-up function Enabled. - * |[7] |NHDBUSEN |I2C No Hold BUS Enable Bit - * | | |0 = I2C don't hold bus after wake-up disable. - * | | |1= I2C don't hold bus after wake-up enable. - * | | |Note: I2C controller could response when WKIF event is not clear, it may cause error data transmitted or received - * | | |If data transmitted or received when WKIF event is not clear, user must reset I2C controller and execute the original operation again. - * @var I2C_T::WKSTS - * Offset: 0x40 I2C Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKIF |I2C Wake-up Flag - * | | |When chip is woken up from Power-down mode by I2C, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * |[1] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release WKIF. Software can write 1 to clear this bit. - * |[2] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame - * | | |0 = Write command be record on the address match wakeup frame. - * | | |1 = Read command be record on the address match wakeup frame. - * | | |Note: This bit will be cleared when software can write 1 to WKAKDONE bit. - * @var I2C_T::CTL1 - * Offset: 0x44 I2C Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function disable. - * | | |1 = Transmit PDMA function enable. - * |[1] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function disable. - * | | |1 = Receive PDMA function enable. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the I2C request to PDMA. This bit will be cleared to 0 automatically. - * |[8] |PDMASTR |PDMA Stretch Bit - * | | |0 = I2C send STOP automatically after PDMA transfer done. (only master TX) - * | | |1 = I2C SCL bus is stretched by hardware after PDMA transfer done if the SI is not cleared - * | | |(only master TX) - * |[9] |ADDR10EN |Address 10-bit Function Enable - * | | |0 = Address match 10-bit function is disabled. - * | | |1 = Address match 10-bit function is enabled. - * @var I2C_T::STATUS1 - * Offset: 0x48 I2C Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADMAT0 |I2C Address 0 Match Status Register - * | | |When address 0 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[1] |ADMAT1 |I2C Address 1 Match Status Register - * | | |When address 1 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[2] |ADMAT2 |I2C Address 2 Match Status Register - * | | |When address 2 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[3] |ADMAT3 |I2C Address 3 Match Status Register - * | | |When address 3 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[8] |ONBUSY |On Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected. - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * | | |Note:This bit is read only. - * @var I2C_T::TMCTL - * Offset: 0x4C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control Register - * | | |This field is used to generate a delay timing between SDA falling edge and SCL rising edge in transmission mode. - * | | |The delay setup time is numbers of peripheral clock = STCTL x PCLK. - * | | |Note: Setup time setting should not make SCL output less than three PCLKs. - * |[24:16] |HTCTL |Hold Time Configure Control Register - * | | |This field is used to generate the delay timing between SCL falling edge and SDA rising edge in transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x PCLK. - * @var I2C_T::BUSCTL - * Offset: 0x50 I2C Bus Management Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACKMEN |Acknowledge Control by Manual - * | | |In order to allow ACK control in slave reception including the command and data, slave byte control mode must be enabled by setting the ACKMEN bit. - * | | |0 = Slave byte control Disabled. - * | | |1 = Slave byte control Enabled - * | | |The 9th bit can response the ACK or NACK according the received data by user - * | | |When the byte is received, stretching the SCLK signal low between the 8th and 9th SCLK pulse. - * | | |Note: If the BMDEN =1 and this bit is enabled, the information of I2C_STATUS will be fixed as 0xF0 in slave receive condition. - * |[1] |PECEN |Packet Error Checking Calculation Enable Bit - * | | |0 = Packet Error Checking Calculation Disabled. - * | | |1 = Packet Error Checking Calculation Enabled. - * | | |Note: When I2C enter power down mode, the bit should be enabled after wake-up if needed PEC calculation. - * |[2] |BMDEN |Bus Management Device Default Address Enable Bit - * | | |0 = Device default address Disable - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses NACKed - * | | |1 = Device default address Enabled - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses ACKed. - * |[3] |BMHEN |Bus Management Host Enable Bit - * | | |0 = Host function Disabled. - * | | |1 = Host function Enabled. - * |[4] |ALERTEN |Bus Management Alert Enable Bit - * | | |Device Mode (BMHEN =0). - * | | |0 = Release the BM_ALERT pin high and Alert Response Header disabled: 0001100x followed by NACK if both of BMDEN and ACKMEN are enabled. - * | | |1 = Drive BM_ALERT pin low and Alert Response Address Header enables: 0001100x followed by ACK if both of BMDEN and ACKMEN are enabled. - * | | |Host Mode (BMHEN =1). - * | | |0 = BM_ALERT pin not supported. - * | | |1 = BM_ALERT pin supported. - * |[5] |SCTLOSTS |Suspend/Control Data Output Status - * | | |0 = The output of SUSCON pin is low. - * | | |1 = The output of SUSCON pin is high. - * |[6] |SCTLOEN |Suspend or Control Pin Output Enable Bit - * | | |0 = The SUSCON pin in input. - * | | |1 = The output enable is active on the SUSCON pin. - * |[7] |BUSEN |BUS Enable Bit - * | | |0 = The system management function is Disabled. - * | | |1 = The system management function is Enable. - * | | |Note: When the bit is enabled, the internal 14-bit counter is used to calculate the time out event of clock low condition. - * |[8] |PECTXEN |Packet Error Checking Byte Transmission/Reception - * | | |0 = No PEC transfer. - * | | |1 = PEC transmission is requested. - * | | |Note: 1.This bit has no effect in slave mode when ACKMEN =0. - * |[9] |TIDLE |Timer Check in Idle State - * | | |The BUSTOUT is used to calculate the time-out of clock low in bus active and the idle period in bus Idle - * | | |This bit is used to define which condition is enabled. - * | | |0 = The BUSTOUT is used to calculate the clock low period in bus active. - * | | |1 = The BUSTOUT is used to calculate the IDLE period in bus Idle. - * | | |Note: The BUSY (I2C_BUSSTS[0]) indicate the current bus state. - * |[10] |PECCLR |PEC Clear at Repeat Start - * | | |The calculation of PEC starts when PECEN is set to 1 and it is clear when the STA or STO bit is detected - * | | |This PECCLR bit is used to enable the condition of REPEAT START can clear the PEC calculation. - * | | |0 = The PEC calculation is cleared by Repeat Start function is Disabled. - * | | |1 = The PEC calculation is cleared by Repeat Start function is Enabled. - * |[11] |ACKM9SI |Acknowledge Manual Enable Extra SI Interrupt - * | | |0 = There is no SI interrupt in the 9th clock cycle when the BUSEN =1 and ACKMEN =1. - * | | |1 = There is SI interrupt in the 9th clock cycle when the BUSEN =1 and ACKMEN =1. - * |[12] |BCDIEN |Packet Error Checking Byte Count Done Interrupt Enable Bit - * | | |0 = Indicates the byte count done interrupt is Disabled. - * | | |1 = Indicates the byte count done interrupt is Enabled. - * | | |Note: This bit is used in PECEN =1. - * |[13] |PECDIEN |Packet Error Checking Byte Transfer Done Interrupt Enable Bit - * | | |0 = Indicates the PEC transfer done interrupt is Disabled. - * | | |1 = Indicates the PEC transfer done interrupt is Enabled. - * | | |Note: This bit is used in PECEN =1. - * @var I2C_T::BUSTCTL - * Offset: 0x54 I2C Bus Management Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSTOEN |Bus Time Out Enable Bit - * | | |0 = Indicates the bus clock low time-out detection is Disabled. - * | | |1 = Indicates the bus clock low time-out detection is Enabled (bus clock is low for more than Time-out (in BIDLE=0) or high more than Time-out(in BIDLE =1) - * |[1] |CLKTOEN |Cumulative Clock Low Time Out Enable Bit - * | | |0 = Indicates the cumulative clock low time-out detection is Disabled. - * | | |1 = Indicates the cumulative clock low time-out detection is Enabled. - * | | |For Master, it calculates the period from START to ACK - * | | |For Slave, it calculates the period from START to STOP - * |[2] |BUSTOIEN |Time-out Interrupt Enable Bit - * | | |BUSY =1. - * | | |0 = Indicates the SCLK low time-out interrupt is Disabled. - * | | |1 = Indicates the SCLK low time-out interrupt is Enabled. - * | | |BUSY =0. - * | | |0 = Indicates the bus IDLE time-out interrupt is Disabled. - * | | |1 = Indicates the bus IDLE time-out interrupt is Enabled. - * |[3] |CLKTOIEN |Extended Clock Time Out Interrupt Enable Bit - * | | |0 = Indicates the clock time out interrupt is Disabled. - * | | |1 = Indicates the clock time out interrupt is Enabled. - * |[4] |TORSTEN |Time Out Reset Enable Bit - * | | |0 = Indicates the I2C state machine reset is Disable. - * | | |1 = Indicates the I2C state machine reset is Enable. (The clock and data bus will be released to high) - * @var I2C_T::BUSSTS - * Offset: 0x58 I2C Bus Management Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * |[1] |BCDONE |Byte Count Transmission/Receive Done - * | | |0 = Indicates the byte count transmission/ receive is not finished when the PECEN is set. - * | | |1 = Indicates the byte count transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * |[2] |PECERR |PEC Error in Reception - * | | |0 = Indicates the PEC value equal the received PEC data packet. - * | | |1 = Indicates the PEC value doesn't match the receive PEC data packet. - * | | |Note: Software can write 1 to clear this bit. - * |[3] |ALERT |SMBus Alert Status - * | | |Device Mode (BMHEN =0). - * | | |0 = Indicates SMBALERT pin state is low. - * | | |1 = Indicates SMBALERT pin state is high. - * | | |Host Mode (BMHEN =1). - * | | |0 = No SMBALERT event. - * | | |1 = Indicates there is SMBALERT event (falling edge) is detected in SMALERT pin when the BMHEN = 1 (SMBus host configuration) and the ALERTEN = 1. - * | | |Note: 1 - * | | |The SMBALERT pin is an open-drain pin, the pull-high resistor is must in the system - * | | |2 - * | | |Software can write 1 to clear this bit. - * |[4] |SCTLDIN |Bus Suspend or Control Signal Input Status - * | | |0 = The input status of SUSCON pin is 0. - * | | |1 = The input status of SUSCON pin is 1. - * |[5] |BUSTO |Bus Time-out Status - * | | |0 = Indicates that there is no any time-out or external clock time-out. - * | | |1 = Indicates that a time-out or external clock time-out occurred. - * | | |In bus busy, the bit indicates the total clock low time-out event occurred otherwise, it indicates the bus idle time-out event occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[6] |CLKTO |Clock Low Accumulate Time-out Status - * | | |0 = Indicates that the cumulative clock low is no any time-out. - * | | |1 = Indicates that the cumulative clock low time-out occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[7] |PECDONE |PEC Byte Transmission/Receive Done - * | | |0 = Indicates the PEC transmission/ receive is not finished when the PECEN is set. - * | | |1 = Indicates the PEC transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * @var I2C_T::PKTSIZE - * Offset: 0x5C I2C Packet Error Checking Byte Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |PLDSIZE |Transfer Byte Number - * | | |The transmission or receive byte number in one transaction when the PECEN is set - * | | |The maximum transaction or receive byte is 256 Bytes. - * | | |Notice: The byte number counting includes address, command code, and data frame. - * @var I2C_T::PKTCRC - * Offset: 0x60 I2C Packet Error Checking Byte Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PECCRC |Packet Error Checking Byte Value - * | | |This byte indicates the packet error checking content after transmission or receive byte count by using the C(x) = X8 + X2 + X + 1 - * | | |It is read only. - * @var I2C_T::BUSTOUT - * Offset: 0x64 I2C Bus Management Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BUSTO |Bus Management Time-out Value - * | | |Indicate the bus time-out value in bus is IDLE or SCLK low. - * | | |Note: If the user wants to revise the value of BUSTOUT, the TORSTEN (I2C_BUSTCTL[4]) bit shall be set to 1 and clear to 0 first in the BUSEN(I2C_BUSCTL[7]) is set. - * @var I2C_T::CLKTOUT - * Offset: 0x68 I2C Bus Management Clock Low Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CLKTO |Bus Clock Low Timer - * | | |The field is used to configure the cumulative clock extension time-out. - * | | |Note: If the user wants to revise the value of CLKLTOUT, the TORSTEN bit shall be set to 1 and clear to 0 first in the BUSEN is set. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2C Control Register 0 */ - __IO uint32_t ADDR0; /*!< [0x0004] I2C Slave Address Register0 */ - __IO uint32_t DAT; /*!< [0x0008] I2C Data Register */ - __I uint32_t STATUS0; /*!< [0x000c] I2C Status Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0010] I2C Clock Divided Register */ - __IO uint32_t TOCTL; /*!< [0x0014] I2C Time-out Control Register */ - __IO uint32_t ADDR1; /*!< [0x0018] I2C Slave Address Register1 */ - __IO uint32_t ADDR2; /*!< [0x001c] I2C Slave Address Register2 */ - __IO uint32_t ADDR3; /*!< [0x0020] I2C Slave Address Register3 */ - __IO uint32_t ADDRMSK0; /*!< [0x0024] I2C Slave Address Mask Register0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0028] I2C Slave Address Mask Register1 */ - __IO uint32_t ADDRMSK2; /*!< [0x002c] I2C Slave Address Mask Register2 */ - __IO uint32_t ADDRMSK3; /*!< [0x0030] I2C Slave Address Mask Register3 */ - __I uint32_t RESERVE0[2]; - __IO uint32_t WKCTL; /*!< [0x003c] I2C Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0040] I2C Wake-up Status Register */ - __IO uint32_t CTL1; /*!< [0x0044] I2C Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0048] I2C Status Register 1 */ - __IO uint32_t TMCTL; /*!< [0x004c] I2C Timing Configure Control Register */ - __IO uint32_t BUSCTL; /*!< [0x0050] I2C Bus Management Control Register */ - __IO uint32_t BUSTCTL; /*!< [0x0054] I2C Bus Management Timer Control Register */ - __IO uint32_t BUSSTS; /*!< [0x0058] I2C Bus Management Status Register */ - __IO uint32_t PKTSIZE; /*!< [0x005c] I2C Packet Error Checking Byte Number Register */ - __I uint32_t PKTCRC; /*!< [0x0060] I2C Packet Error Checking Byte Value Register */ - __IO uint32_t BUSTOUT; /*!< [0x0064] I2C Bus Management Timer Register */ - __IO uint32_t CLKTOUT; /*!< [0x0068] I2C Bus Management Clock Low Timer Register */ - -} I2C_T; - -/** - @addtogroup I2C_CONST I2C Bit Field Definition - Constant Definitions for I2C Controller - @{ -*/ - -#define I2C_CTL0_AA_Pos (2) /*!< I2C_T::CTL0: AA Position */ -#define I2C_CTL0_AA_Msk (0x1ul << I2C_CTL0_AA_Pos) /*!< I2C_T::CTL0: AA Mask */ - -#define I2C_CTL0_SI_Pos (3) /*!< I2C_T::CTL0: SI Position */ -#define I2C_CTL0_SI_Msk (0x1ul << I2C_CTL0_SI_Pos) /*!< I2C_T::CTL0: SI Mask */ - -#define I2C_CTL0_STO_Pos (4) /*!< I2C_T::CTL0: STO Position */ -#define I2C_CTL0_STO_Msk (0x1ul << I2C_CTL0_STO_Pos) /*!< I2C_T::CTL0: STO Mask */ - -#define I2C_CTL0_STA_Pos (5) /*!< I2C_T::CTL0: STA Position */ -#define I2C_CTL0_STA_Msk (0x1ul << I2C_CTL0_STA_Pos) /*!< I2C_T::CTL0: STA Mask */ - -#define I2C_CTL0_I2CEN_Pos (6) /*!< I2C_T::CTL0: I2CEN Position */ -#define I2C_CTL0_I2CEN_Msk (0x1ul << I2C_CTL0_I2CEN_Pos) /*!< I2C_T::CTL0: I2CEN Mask */ - -#define I2C_CTL0_INTEN_Pos (7) /*!< I2C_T::CTL0: INTEN Position */ -#define I2C_CTL0_INTEN_Msk (0x1ul << I2C_CTL0_INTEN_Pos) /*!< I2C_T::CTL0: INTEN Mask */ - -#define I2C_ADDR0_GC_Pos (0) /*!< I2C_T::ADDR0: GC Position */ -#define I2C_ADDR0_GC_Msk (0x1ul << I2C_ADDR0_GC_Pos) /*!< I2C_T::ADDR0: GC Mask */ - -#define I2C_ADDR0_ADDR_Pos (1) /*!< I2C_T::ADDR0: ADDR Position */ -#define I2C_ADDR0_ADDR_Msk (0x3fful << I2C_ADDR0_ADDR_Pos) /*!< I2C_T::ADDR0: ADDR Mask */ - -#define I2C_DAT_DAT_Pos (0) /*!< I2C_T::DAT: DAT Position */ -#define I2C_DAT_DAT_Msk (0xfful << I2C_DAT_DAT_Pos) /*!< I2C_T::DAT: DAT Mask */ - -#define I2C_STATUS0_STATUS_Pos (0) /*!< I2C_T::STATUS0: STATUS Position */ -#define I2C_STATUS0_STATUS_Msk (0xfful << I2C_STATUS0_STATUS_Pos) /*!< I2C_T::STATUS0: STATUS Mask */ - -#define I2C_CLKDIV_DIVIDER_Pos (0) /*!< I2C_T::CLKDIV: DIVIDER Position */ -#define I2C_CLKDIV_DIVIDER_Msk (0x3fful << I2C_CLKDIV_DIVIDER_Pos) /*!< I2C_T::CLKDIV: DIVIDER Mask */ - -#define I2C_TOCTL_TOIF_Pos (0) /*!< I2C_T::TOCTL: TOIF Position */ -#define I2C_TOCTL_TOIF_Msk (0x1ul << I2C_TOCTL_TOIF_Pos) /*!< I2C_T::TOCTL: TOIF Mask */ - -#define I2C_TOCTL_TOCDIV4_Pos (1) /*!< I2C_T::TOCTL: TOCDIV4 Position */ -#define I2C_TOCTL_TOCDIV4_Msk (0x1ul << I2C_TOCTL_TOCDIV4_Pos) /*!< I2C_T::TOCTL: TOCDIV4 Mask */ - -#define I2C_TOCTL_TOCEN_Pos (2) /*!< I2C_T::TOCTL: TOCEN Position */ -#define I2C_TOCTL_TOCEN_Msk (0x1ul << I2C_TOCTL_TOCEN_Pos) /*!< I2C_T::TOCTL: TOCEN Mask */ - -#define I2C_ADDR1_GC_Pos (0) /*!< I2C_T::ADDR1: GC Position */ -#define I2C_ADDR1_GC_Msk (0x1ul << I2C_ADDR1_GC_Pos) /*!< I2C_T::ADDR1: GC Mask */ - -#define I2C_ADDR1_ADDR_Pos (1) /*!< I2C_T::ADDR1: ADDR Position */ -#define I2C_ADDR1_ADDR_Msk (0x3fful << I2C_ADDR1_ADDR_Pos) /*!< I2C_T::ADDR1: ADDR Mask */ - -#define I2C_ADDR2_GC_Pos (0) /*!< I2C_T::ADDR2: GC Position */ -#define I2C_ADDR2_GC_Msk (0x1ul << I2C_ADDR2_GC_Pos) /*!< I2C_T::ADDR2: GC Mask */ - -#define I2C_ADDR2_ADDR_Pos (1) /*!< I2C_T::ADDR2: ADDR Position */ -#define I2C_ADDR2_ADDR_Msk (0x3fful << I2C_ADDR2_ADDR_Pos) /*!< I2C_T::ADDR2: ADDR Mask */ - -#define I2C_ADDR3_GC_Pos (0) /*!< I2C_T::ADDR3: GC Position */ -#define I2C_ADDR3_GC_Msk (0x1ul << I2C_ADDR3_GC_Pos) /*!< I2C_T::ADDR3: GC Mask */ - -#define I2C_ADDR3_ADDR_Pos (1) /*!< I2C_T::ADDR3: ADDR Position */ -#define I2C_ADDR3_ADDR_Msk (0x3fful << I2C_ADDR3_ADDR_Pos) /*!< I2C_T::ADDR3: ADDR Mask */ - -#define I2C_ADDRMSK0_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK0: ADDRMSK Position */ -#define I2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK0_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define I2C_ADDRMSK1_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK1: ADDRMSK Position */ -#define I2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK1_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define I2C_ADDRMSK2_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK2: ADDRMSK Position */ -#define I2C_ADDRMSK2_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK2_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK2: ADDRMSK Mask */ - -#define I2C_ADDRMSK3_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK3: ADDRMSK Position */ -#define I2C_ADDRMSK3_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK3_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK3: ADDRMSK Mask */ - -#define I2C_WKCTL_WKEN_Pos (0) /*!< I2C_T::WKCTL: WKEN Position */ -#define I2C_WKCTL_WKEN_Msk (0x1ul << I2C_WKCTL_WKEN_Pos) /*!< I2C_T::WKCTL: WKEN Mask */ - -#define I2C_WKCTL_NHDBUSEN_Pos (7) /*!< I2C_T::WKCTL: NHDBUSEN Position */ -#define I2C_WKCTL_NHDBUSEN_Msk (0x1ul << I2C_WKCTL_NHDBUSEN_Pos) /*!< I2C_T::WKCTL: NHDBUSEN Mask */ - -#define I2C_WKSTS_WKIF_Pos (0) /*!< I2C_T::WKSTS: WKIF Position */ -#define I2C_WKSTS_WKIF_Msk (0x1ul << I2C_WKSTS_WKIF_Pos) /*!< I2C_T::WKSTS: WKIF Mask */ - -#define I2C_WKSTS_WKAKDONE_Pos (1) /*!< I2C_T::WKSTS: WKAKDONE Position */ -#define I2C_WKSTS_WKAKDONE_Msk (0x1ul << I2C_WKSTS_WKAKDONE_Pos) /*!< I2C_T::WKSTS: WKAKDONE Mask */ - -#define I2C_WKSTS_WRSTSWK_Pos (2) /*!< I2C_T::WKSTS: WRSTSWK Position */ -#define I2C_WKSTS_WRSTSWK_Msk (0x1ul << I2C_WKSTS_WRSTSWK_Pos) /*!< I2C_T::WKSTS: WRSTSWK Mask */ - -#define I2C_CTL1_TXPDMAEN_Pos (0) /*!< I2C_T::CTL1: TXPDMAEN Position */ -#define I2C_CTL1_TXPDMAEN_Msk (0x1ul << I2C_CTL1_TXPDMAEN_Pos) /*!< I2C_T::CTL1: TXPDMAEN Mask */ - -#define I2C_CTL1_RXPDMAEN_Pos (1) /*!< I2C_T::CTL1: RXPDMAEN Position */ -#define I2C_CTL1_RXPDMAEN_Msk (0x1ul << I2C_CTL1_RXPDMAEN_Pos) /*!< I2C_T::CTL1: RXPDMAEN Mask */ - -#define I2C_CTL1_PDMARST_Pos (2) /*!< I2C_T::CTL1: PDMARST Position */ -#define I2C_CTL1_PDMARST_Msk (0x1ul << I2C_CTL1_PDMARST_Pos) /*!< I2C_T::CTL1: PDMARST Mask */ - -#define I2C_CTL1_PDMASTR_Pos (8) /*!< I2C_T::CTL1: PDMASTR Position */ -#define I2C_CTL1_PDMASTR_Msk (0x1ul << I2C_CTL1_PDMASTR_Pos) /*!< I2C_T::CTL1: PDMASTR Mask */ - -#define I2C_CTL1_ADDR10EN_Pos (9) /*!< I2C_T::CTL1: ADDR10EN Position */ -#define I2C_CTL1_ADDR10EN_Msk (0x1ul << I2C_CTL1_ADDR10EN_Pos) /*!< I2C_T::CTL1: ADDR10EN Mask */ - -#define I2C_STATUS1_ADMAT0_Pos (0) /*!< I2C_T::STATUS1: ADMAT0 Position */ -#define I2C_STATUS1_ADMAT0_Msk (0x1ul << I2C_STATUS1_ADMAT0_Pos) /*!< I2C_T::STATUS1: ADMAT0 Mask */ - -#define I2C_STATUS1_ADMAT1_Pos (1) /*!< I2C_T::STATUS1: ADMAT1 Position */ -#define I2C_STATUS1_ADMAT1_Msk (0x1ul << I2C_STATUS1_ADMAT1_Pos) /*!< I2C_T::STATUS1: ADMAT1 Mask */ - -#define I2C_STATUS1_ADMAT2_Pos (2) /*!< I2C_T::STATUS1: ADMAT2 Position */ -#define I2C_STATUS1_ADMAT2_Msk (0x1ul << I2C_STATUS1_ADMAT2_Pos) /*!< I2C_T::STATUS1: ADMAT2 Mask */ - -#define I2C_STATUS1_ADMAT3_Pos (3) /*!< I2C_T::STATUS1: ADMAT3 Position */ -#define I2C_STATUS1_ADMAT3_Msk (0x1ul << I2C_STATUS1_ADMAT3_Pos) /*!< I2C_T::STATUS1: ADMAT3 Mask */ - -#define I2C_STATUS1_ONBUSY_Pos (8) /*!< I2C_T::STATUS1: ONBUSY Position */ -#define I2C_STATUS1_ONBUSY_Msk (0x1ul << I2C_STATUS1_ONBUSY_Pos) /*!< I2C_T::STATUS1: ONBUSY Mask */ - -#define I2C_TMCTL_STCTL_Pos (0) /*!< I2C_T::TMCTL: STCTL Position */ -#define I2C_TMCTL_STCTL_Msk (0x1fful << I2C_TMCTL_STCTL_Pos) /*!< I2C_T::TMCTL: STCTL Mask */ - -#define I2C_TMCTL_HTCTL_Pos (16) /*!< I2C_T::TMCTL: HTCTL Position */ -#define I2C_TMCTL_HTCTL_Msk (0x1fful << I2C_TMCTL_HTCTL_Pos) /*!< I2C_T::TMCTL: HTCTL Mask */ - -#define I2C_BUSCTL_ACKMEN_Pos (0) /*!< I2C_T::BUSCTL: ACKMEN Position */ -#define I2C_BUSCTL_ACKMEN_Msk (0x1ul << I2C_BUSCTL_ACKMEN_Pos) /*!< I2C_T::BUSCTL: ACKMEN Mask */ - -#define I2C_BUSCTL_PECEN_Pos (1) /*!< I2C_T::BUSCTL: PECEN Position */ -#define I2C_BUSCTL_PECEN_Msk (0x1ul << I2C_BUSCTL_PECEN_Pos) /*!< I2C_T::BUSCTL: PECEN Mask */ - -#define I2C_BUSCTL_BMDEN_Pos (2) /*!< I2C_T::BUSCTL: BMDEN Position */ -#define I2C_BUSCTL_BMDEN_Msk (0x1ul << I2C_BUSCTL_BMDEN_Pos) /*!< I2C_T::BUSCTL: BMDEN Mask */ - -#define I2C_BUSCTL_BMHEN_Pos (3) /*!< I2C_T::BUSCTL: BMHEN Position */ -#define I2C_BUSCTL_BMHEN_Msk (0x1ul << I2C_BUSCTL_BMHEN_Pos) /*!< I2C_T::BUSCTL: BMHEN Mask */ - -#define I2C_BUSCTL_ALERTEN_Pos (4) /*!< I2C_T::BUSCTL: ALERTEN Position */ -#define I2C_BUSCTL_ALERTEN_Msk (0x1ul << I2C_BUSCTL_ALERTEN_Pos) /*!< I2C_T::BUSCTL: ALERTEN Mask */ - -#define I2C_BUSCTL_SCTLOSTS_Pos (5) /*!< I2C_T::BUSCTL: SCTLOSTS Position */ -#define I2C_BUSCTL_SCTLOSTS_Msk (0x1ul << I2C_BUSCTL_SCTLOSTS_Pos) /*!< I2C_T::BUSCTL: SCTLOSTS Mask */ - -#define I2C_BUSCTL_SCTLOEN_Pos (6) /*!< I2C_T::BUSCTL: SCTLOEN Position */ -#define I2C_BUSCTL_SCTLOEN_Msk (0x1ul << I2C_BUSCTL_SCTLOEN_Pos) /*!< I2C_T::BUSCTL: SCTLOEN Mask */ - -#define I2C_BUSCTL_BUSEN_Pos (7) /*!< I2C_T::BUSCTL: BUSEN Position */ -#define I2C_BUSCTL_BUSEN_Msk (0x1ul << I2C_BUSCTL_BUSEN_Pos) /*!< I2C_T::BUSCTL: BUSEN Mask */ - -#define I2C_BUSCTL_PECTXEN_Pos (8) /*!< I2C_T::BUSCTL: PECTXEN Position */ -#define I2C_BUSCTL_PECTXEN_Msk (0x1ul << I2C_BUSCTL_PECTXEN_Pos) /*!< I2C_T::BUSCTL: PECTXEN Mask */ - -#define I2C_BUSCTL_TIDLE_Pos (9) /*!< I2C_T::BUSCTL: TIDLE Position */ -#define I2C_BUSCTL_TIDLE_Msk (0x1ul << I2C_BUSCTL_TIDLE_Pos) /*!< I2C_T::BUSCTL: TIDLE Mask */ - -#define I2C_BUSCTL_PECCLR_Pos (10) /*!< I2C_T::BUSCTL: PECCLR Position */ -#define I2C_BUSCTL_PECCLR_Msk (0x1ul << I2C_BUSCTL_PECCLR_Pos) /*!< I2C_T::BUSCTL: PECCLR Mask */ - -#define I2C_BUSCTL_ACKM9SI_Pos (11) /*!< I2C_T::BUSCTL: ACKM9SI Position */ -#define I2C_BUSCTL_ACKM9SI_Msk (0x1ul << I2C_BUSCTL_ACKM9SI_Pos) /*!< I2C_T::BUSCTL: ACKM9SI Mask */ - -#define I2C_BUSCTL_BCDIEN_Pos (12) /*!< I2C_T::BUSCTL: BCDIEN Position */ -#define I2C_BUSCTL_BCDIEN_Msk (0x1ul << I2C_BUSCTL_BCDIEN_Pos) /*!< I2C_T::BUSCTL: BCDIEN Mask */ - -#define I2C_BUSCTL_PECDIEN_Pos (13) /*!< I2C_T::BUSCTL: PECDIEN Position */ -#define I2C_BUSCTL_PECDIEN_Msk (0x1ul << I2C_BUSCTL_PECDIEN_Pos) /*!< I2C_T::BUSCTL: PECDIEN Mask */ - -#define I2C_BUSTCTL_BUSTOEN_Pos (0) /*!< I2C_T::BUSTCTL: BUSTOEN Position */ -#define I2C_BUSTCTL_BUSTOEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOEN Mask */ - -#define I2C_BUSTCTL_CLKTOEN_Pos (1) /*!< I2C_T::BUSTCTL: CLKTOEN Position */ -#define I2C_BUSTCTL_CLKTOEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOEN Mask */ - -#define I2C_BUSTCTL_BUSTOIEN_Pos (2) /*!< I2C_T::BUSTCTL: BUSTOIEN Position */ -#define I2C_BUSTCTL_BUSTOIEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOIEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOIEN Mask */ - -#define I2C_BUSTCTL_CLKTOIEN_Pos (3) /*!< I2C_T::BUSTCTL: CLKTOIEN Position */ -#define I2C_BUSTCTL_CLKTOIEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOIEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOIEN Mask */ - -#define I2C_BUSTCTL_TORSTEN_Pos (4) /*!< I2C_T::BUSTCTL: TORSTEN Position */ -#define I2C_BUSTCTL_TORSTEN_Msk (0x1ul << I2C_BUSTCTL_TORSTEN_Pos) /*!< I2C_T::BUSTCTL: TORSTEN Mask */ - -#define I2C_BUSSTS_BUSY_Pos (0) /*!< I2C_T::BUSSTS: BUSY Position */ -#define I2C_BUSSTS_BUSY_Msk (0x1ul << I2C_BUSSTS_BUSY_Pos) /*!< I2C_T::BUSSTS: BUSY Mask */ - -#define I2C_BUSSTS_BCDONE_Pos (1) /*!< I2C_T::BUSSTS: BCDONE Position */ -#define I2C_BUSSTS_BCDONE_Msk (0x1ul << I2C_BUSSTS_BCDONE_Pos) /*!< I2C_T::BUSSTS: BCDONE Mask */ - -#define I2C_BUSSTS_PECERR_Pos (2) /*!< I2C_T::BUSSTS: PECERR Position */ -#define I2C_BUSSTS_PECERR_Msk (0x1ul << I2C_BUSSTS_PECERR_Pos) /*!< I2C_T::BUSSTS: PECERR Mask */ - -#define I2C_BUSSTS_ALERT_Pos (3) /*!< I2C_T::BUSSTS: ALERT Position */ -#define I2C_BUSSTS_ALERT_Msk (0x1ul << I2C_BUSSTS_ALERT_Pos) /*!< I2C_T::BUSSTS: ALERT Mask */ - -#define I2C_BUSSTS_SCTLDIN_Pos (4) /*!< I2C_T::BUSSTS: SCTLDIN Position */ -#define I2C_BUSSTS_SCTLDIN_Msk (0x1ul << I2C_BUSSTS_SCTLDIN_Pos) /*!< I2C_T::BUSSTS: SCTLDIN Mask */ - -#define I2C_BUSSTS_BUSTO_Pos (5) /*!< I2C_T::BUSSTS: BUSTO Position */ -#define I2C_BUSSTS_BUSTO_Msk (0x1ul << I2C_BUSSTS_BUSTO_Pos) /*!< I2C_T::BUSSTS: BUSTO Mask */ - -#define I2C_BUSSTS_CLKTO_Pos (6) /*!< I2C_T::BUSSTS: CLKTO Position */ -#define I2C_BUSSTS_CLKTO_Msk (0x1ul << I2C_BUSSTS_CLKTO_Pos) /*!< I2C_T::BUSSTS: CLKTO Mask */ - -#define I2C_BUSSTS_PECDONE_Pos (7) /*!< I2C_T::BUSSTS: PECDONE Position */ -#define I2C_BUSSTS_PECDONE_Msk (0x1ul << I2C_BUSSTS_PECDONE_Pos) /*!< I2C_T::BUSSTS: PECDONE Mask */ - -#define I2C_PKTSIZE_PLDSIZE_Pos (0) /*!< I2C_T::PKTSIZE: PLDSIZE Position */ -#define I2C_PKTSIZE_PLDSIZE_Msk (0x1fful << I2C_PKTSIZE_PLDSIZE_Pos) /*!< I2C_T::PKTSIZE: PLDSIZE Mask */ - -#define I2C_PKTCRC_PECCRC_Pos (0) /*!< I2C_T::PKTCRC: PECCRC Position */ -#define I2C_PKTCRC_PECCRC_Msk (0xfful << I2C_PKTCRC_PECCRC_Pos) /*!< I2C_T::PKTCRC: PECCRC Mask */ - -#define I2C_BUSTOUT_BUSTO_Pos (0) /*!< I2C_T::BUSTOUT: BUSTO Position */ -#define I2C_BUSTOUT_BUSTO_Msk (0xfful << I2C_BUSTOUT_BUSTO_Pos) /*!< I2C_T::BUSTOUT: BUSTO Mask */ - -#define I2C_CLKTOUT_CLKTO_Pos (0) /*!< I2C_T::CLKTOUT: CLKTO Position */ -#define I2C_CLKTOUT_CLKTO_Msk (0xfful << I2C_CLKTOUT_CLKTO_Pos) /*!< I2C_T::CLKTOUT: CLKTO Mask */ - -/**@}*/ /* I2C_CONST */ -/**@}*/ /* end of I2C register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __I2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2s_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2s_reg.h deleted file mode 100644 index 5dc39514cb4..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/i2s_reg.h +++ /dev/null @@ -1,701 +0,0 @@ -/**************************************************************************//** - * @file i2s_reg.h - * @version V1.00 - * @brief I2S register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __I2S_REG_H__ -#define __I2S_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- I2S Interface Controller -------------------------*/ -/** - @addtogroup I2S I2S Interface Controller(I2S) - Memory Mapped Structure for I2S Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var I2S_T::CTL0 - * Offset: 0x00 I2S Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SEN |I2S Controller Enable Control - * | | |0 = I2S controller Disabled. - * | | |1 = I2S controller Enabled. - * |[1] |TXEN |Transmit Enable Control - * | | |0 = Data transmission Disabled. - * | | |1 = Data transmission Enabled. - * |[2] |RXEN |Receive Enable Control - * | | |0 = Data receiving Disabled. - * | | |1 = Data receiving Enabled. - * |[3] |MUTE |Transmit Mute Enable Control - * | | |0 = Transmit data is shifted from buffer. - * | | |1 = Send zero on transmit channel. - * |[5:4] |DATWIDTH |Data Width - * | | |This bit field is used to define the bit-width of data word in each audio channel - * | | |00 = The bit-width of data word is 8-bit. - * | | |01 = The bit-width of data word is 16-bit. - * | | |10 = The bit-width of data word is 24-bit. - * | | |11 = The bit-width of data word is 32-bit. - * |[6] |MONO |Monaural Data Control - * | | |0 = Data is stereo format. - * | | |1 = Data is monaural format. - * | | |Note: when chip records data, RXLCH (I2S_CTL0[23]) indicates which channel data will be saved if monaural format is selected. - * |[7] |ORDER |Stereo Data Order in FIFO - * | | |In 8-bit/16-bit data width, this bit is used to select whether the even or odd channel data is stored in higher byte - * | | |In 24-bit data width, this is used to select the left/right alignment method of audio data which is stored in data memory consisted of 32-bit FIFO entries. - * | | |0 = Even channel data at high byte in 8-bit/16-bit data width. - * | | |LSB of 24-bit audio data in each channel is aligned to right side in 32-bit FIFO entries. - * | | |1 = Even channel data at low byte. - * | | | MSB of 24-bit audio data in each channel is aligned to left side in 32-bit FIFO entries. - * |[8] |SLAVE |Slave Mode Enable Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * | | |Note: I2S can operate as master or slave - * | | |For Master mode, I2S_BCLK and I2S_LRCLK pins are output mode and send out bit clock to Audio CODEC chip - * | | |In Slave mode, I2S_BCLK and I2S_LRCLK pins are input mode and I2S_BCLK and I2S_LRCLK signals are received from outer Audio CODEC chip. - * |[15] |MCLKEN |Master Clock Enable Control - * | | |If MCLKEN is set to 1, I2S controller will generate master clock on I2S_MCLK pin for external audio devices. - * | | |0 = Master clock Disabled. - * | | |1 = Master clock Enabled. - * |[18] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No Effect. - * | | |1 = Clear TX FIFO. - * | | |Note 1: Write 1 to clear transmit FIFO, internal pointer is reset to FIFO start point, and TXCNT (I2S_STATUS1[12:8]) returns 0 and transmit FIFO becomes empty but data in transmit FIFO is not changed. - * | | |Note 2: This bit is clear by hardware automatically, read it return zero. - * |[19] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No Effect. - * | | |1 = Clear RX FIFO. - * | | |Note 1: Write 1 to clear receive FIFO, internal pointer is reset to FIFO start point, and RXCNT (I2S_STATUS1[20:16]) returns 0 and receive FIFO becomes empty. - * | | |Note 2: This bit is cleared by hardware automatically, read it return zero. - * |[20] |TXPDMAEN |Transmit PDMA Enable Control - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[21] |RXPDMAEN |Receive PDMA Enable Control - * | | |0 = Receiver PDMA function Disabled. - * | | |1 = Receiver PDMA function Enabled. - * |[23] |RXLCH |Receive Left Channel Enable Control - * | | |When monaural format is selected (MONO = 1), I2S will receive channel1 data if RXLCH is set to 0, and receive channel0 data if RXLCH is set to 1. - * | | |0 = Receives channel1 data in MONO mode. - * | | |1 = Receives channel0 data in MONO mode. - * |[26:24] |FORMAT |Data Format Selection - * | | |000 = I2S standard data format. - * | | |001 = I2S with MSB justified. - * | | |010 = I2S with LSB justified. - * | | |011 = Reserved. - * | | |100 = PCM standard data format. - * | | |101 = PCM with MSB justified. - * | | |110 = PCM with LSB justified. - * | | |111 = Reserved. - * |[27] |PCMSYNC |PCM Synchronization Pulse Length Selection - * | | |This bit field is used to select the high pulse length of frame synchronization signal in PCM protocol. - * | | |0 = One BCLK period. - * | | |1 = One channel period. - * | | |Note: This bit is only available in master mode. - * |[29:28] |CHWIDTH |Channel Width - * | | |This bit fields are used to define the length of audio channel - * | | |If CHWIDTH < DATWIDTH, the hardware will set the real channel length as the bit-width of audio data which is defined by DATWIDTH. - * | | |00 = The bit-width of each audio channel is 8-bit. - * | | |01 = The bit-width of each audio channel is 16-bit. - * | | |10 = The bit-width of each audio channel is 24-bit. - * | | |11 = The bit-width of each audio channel is 32-bit. - * |[31:30] |TDMCHNUM |TDM Channel Number - * | | |This bit fields are used to define the TDM channel number in one audio frame while PCM mode (FORMAT[2] = 1). - * | | |00 = 2 channels in audio frame. - * | | |01 = 4 channels in audio frame. - * | | |10 = 6 channels in audio frame. - * | | |11 = 8 channels in audio frame. - * @var I2S_T::CLKDIV - * Offset: 0x04 I2S Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |MCLKDIV |Master Clock Divider - * | | |If chip external crystal frequency is (2 x MCLKDIV) x 256fs then software can program these bits to generate 256fs clock frequency to audio codec chip - * | | |If MCLKDIV is set to 0, MCLK is the same as external clock input. - * | | |For example, sampling rate is 24 kHz and chip external crystal clock is 12.288 MHz, set MCLKDIV = 1. - * | | |F_MCLK = F_I2SCLK/(2 x MCLKDIV) (When MCLKDIV is >= 1 ). - * | | |F_MCLK = F_I2SCLK (When MCLKDIV is set to 0 ). - * | | |Note: F_MCLK is the frequency of MCLK, and F_I2SCLK is the frequency of the I2S_CLK. - * |[16:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode - * | | |Software can program these bit fields to generate sampling rate clock frequency. - * | | |F_BCLK= F_I2SCLK / (2 x (BCLKDIV + 1)). - * | | |Note: F_BCLK is the frequency of BCLK and F_I2SCLK is the frequency of I2S_CLK. - * @var I2S_T::IEN - * Offset: 0x08 I2S Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXUDFIEN |Receive FIFO Underflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: If software reads receive FIFO when it is empty then RXUDIF (I2S_STATUS0[8]) flag is set to 1. - * |[1] |RXOVFIEN |Receive FIFO Overflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and RXOVIF (I2S_STATUS0[9]) flag is set to 1. - * |[2] |RXTHIEN |Receive FIFO Threshold Level Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: When data word in receive FIFO is equal or higher than RXTH (I2S_CTL1[19:16]) and the RXTHIF (I2S_STATUS0[10]) bit is set to 1 - * | | |If RXTHIEN bit is enabled, interrupt occur. - * |[8] |TXUDFIEN |Transmit FIFO Underflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occur if this bit is set to 1 and TXUDIF (I2S_STATUS0[16]) flag is set to 1. - * |[9] |TXOVFIEN |Transmit FIFO Overflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and TXOVIF (I2S_STATUS0[17]) flag is set to 1. - * |[10] |TXTHIEN |Transmit FIFO Threshold Level Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and data words in transmit FIFO is less than TXTH (I2S_CTL1[11:8]). - * |[16] |CH0ZCIEN |Channel0 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel0 zero-cross. - * | | |Note 2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[17] |CH1ZCIEN |Channel1 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel1 zero-cross. - * | | |Note 2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[18] |CH2ZCIEN |Channel2 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel2 zero-cross. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[19] |CH3ZCIEN |Channel3 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel3 zero-cross. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[20] |CH4ZCIEN |Channel4 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel4 zero-cross. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[21] |CH5ZCIEN |Channel5 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel5 zero-cross. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[22] |CH6ZCIEN |Channel6 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel6 zero-cross. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[23] |CH7ZCIEN |Channel7 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel7 zero-cross. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * @var I2S_T::STATUS0 - * Offset: 0x0C I2S Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SINT |I2S Interrupt Flag (Read Only) - * | | |0 = No I2S interrupt. - * | | |1 = I2S interrupt. - * | | |Note: It is wire-OR of I2STXINT and I2SRXINT bits. - * |[1] |I2SRXINT |I2S Receive Interrupt (Read Only) - * | | |0 = No receive interrupt. - * | | |1 = Receive interrupt. - * |[2] |I2STXINT |I2S Transmit Interrupt (Read Only) - * | | |0 = No transmit interrupt. - * | | |1 = Transmit interrupt. - * |[5:3] |DATACH |Transmission Data Channel (Read Only) - * | | |This bit fields are used to indicate which audio channel is current transmit data belong. - * | | |000 = channel0 (means left channel while 2-channel I2S/PCM mode). - * | | |001 = channel1 (means right channel while 2-channel I2S/PCM mode). - * | | |010 = channel2 (available while 4-channel TDM PCM mode). - * | | |011 = channel3 (available while 4-channel TDM PCM mode). - * | | |100 = channel4 (available while 6-channel TDM PCM mode). - * | | |101 = channel5 (available while 6-channel TDM PCM mode). - * | | |110 = channel6 (available while 8-channel TDM PCM mode). - * | | |111 = channel7 (available while 8-channel TDM PCM mode). - * |[8] |RXUDIF |Receive FIFO Underflow Interrupt Flag - * | | |0 = No underflow occur. - * | | |1 = Underflow occur. - * | | |Note 1: When receive FIFO is empty, and software reads the receive FIFO again - * | | |This bit will be set to 1, and it indicates underflow situation occurs. - * | | |Note 2: Write 1 to clear this bit to zero - * |[9] |RXOVIF |Receive FIFO Overflow Interrupt Flag - * | | |0 = No overflow occur. - * | | |1 = Overflow occur. - * | | |Note 1: When receive FIFO is full and receive hardware attempt to write data into receive FIFO then this bit is set to 1, data in 1st buffer is overwrote. - * | | |Note 2: Write 1 to clear this bit to 0. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is not higher than threshold level. - * | | |1 = Data word(s) in FIFO is higher than threshold level. - * | | |Note: When data word(s) in receive FIFO is higher than threshold value set in RXTH (I2S_CTL1[19:16]) the RXTHIF bit becomes to 1 - * | | |It keeps at 1 till RXCNT (I2S_STATUS1[20:16]) is not higher than RXTH (I2S_CTL1[19:16]) after software read RXFIFO register. - * |[11] |RXFULL |Receive FIFO Full (Read Only) - * | | |0 = Not full. - * | | |1 = Full. - * | | |Note: This bit reflects data words number in receive FIFO is 16. - * |[12] |RXEMPTY |Receive FIFO Empty (Read Only) - * | | |0 = Not empty. - * | | |1 = Empty. - * | | |Note: This bit reflects data words number in receive FIFO is 0. - * |[16] |TXUDIF |Transmit FIFO Underflow Interrupt Flag - * | | |0 = No underflow. - * | | |1 = Underflow. - * | | |Note 1: This bit will be set to 1 when shift logic hardware read data from transmitting FIFO and the filling data level in transmitting FIFO is not enough for one audio frame. - * | | |Note 2: Write 1 to clear this bit to 0. - * |[17] |TXOVIF |Transmit FIFO Overflow Interrupt Flag - * | | |0 = No overflow. - * | | |1 = Overflow. - * | | |Note 1: Write data to transmit FIFO when it is full and this bit set to 1. - * | | |Note 2: Write 1 to clear this bit to 0. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is higher than threshold level. - * | | |1 = Data word(s) in FIFO is equal or lower than threshold level. - * | | |Note: When data word(s) in transmit FIFO is equal or lower than threshold value set in TXTH (I2S_CTL1[11:8]) the TXTHIF bit becomes to 1 - * | | |It keeps at 1 till TXCNT (I2S_STATUS1[12:8]) is higher than TXTH (I2S_CTL1[11:8]) after software write TXFIFO register. - * |[19] |TXFULL |Transmit FIFO Full (Read Only) - * | | |0 = Not full. - * | | |1 = Full. - * | | |Note: This bit reflects data words number in transmit FIFO is 16. - * |[20] |TXEMPTY |Transmit FIFO Empty (Read Only) - * | | |0 = Not empty. - * | | |1 = Empty. - * | | |Note: This bit reflects data words number in transmit FIFO is 0. - * |[21] |TXBUSY |Transmit Busy (Read Only) - * | | |0 = Transmit shift buffer is empty. - * | | |1 = Transmit shift buffer is busy. - * | | |Note: This bit is cleared to 0 when all data in transmit FIFO and shift buffer is shifted out - * | | |And set to 1 when 1st data is load to shift buffer - * @var I2S_T::TXFIFO - * Offset: 0x10 I2S Transmit FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXFIFO |Transmit FIFO Bits - * | | |I2S contains 16 words (16x32 bit) data buffer for data transmit - * | | |Write data to this register to prepare data for transmit - * | | |The remaining word number is indicated by TXCNT (I2S_STATUS1[12:8]). - * @var I2S_T::RXFIFO - * Offset: 0x14 I2S Receive FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXFIFO |Receive FIFO Bits - * | | |I2S contains 16 words (16x32 bit) data buffer for data receive - * | | |Read this register to get data in FIFO - * | | |The remaining data word number is indicated by RXCNT (I2S_STATUS1[20:16]). - * @var I2S_T::CTL1 - * Offset: 0x20 I2S Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCEN |Channel0 Zero-cross Detection Enable Control - * | | |0 = channel0 zero-cross detect Disabled. - * | | |1 = channel0 zero-cross detect Enabled. - * | | |Note 1: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note 2: If this bit is set to 1, when channel0 data sign bit change or next shift data bits are all zero then CH0ZCIF(I2S_STATUS1[0]) flag is set to 1. - * | | |Note 3: If CH0ZCIF Flag is set to 1, the channel0 will be mute. - * |[1] |CH1ZCEN |Channel1 Zero-cross Detect Enable Control - * | | |0 = channel1 zero-cross detect Disabled. - * | | |1 = channel1 zero-cross detect Enabled. - * | | |Note 1: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note 2: If this bit is set to 1, when channel1 data sign bit change or next shift data bits are all zero then CH1ZCIF(I2S_STATUS1[1]) flag is set to 1. - * | | |Note 3: If CH1ZCIF Flag is set to 1, the channel1 will be mute. - * |[2] |CH2ZCEN |Channel2 Zero-cross Detect Enable Control - * | | |0 = channel2 zero-cross detect Disabled. - * | | |1 = channel2 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel2 data sign bit change or next shift data bits are all zero then CH2ZCIF(I2S_STATUS1[2]) flag is set to 1. - * | | |Note 3: If CH2ZCIF Flag is set to 1, the channel2 will be mute. - * |[3] |CH3ZCEN |Channel3 Zero-cross Detect Enable Control - * | | |0 = channel3 zero-cross detect Disabled. - * | | |1 = channel3 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel3 data sign bit change or next shift data bits are all zero then CH3ZCIF(I2S_STATUS1[3]) flag is set to 1. - * | | |Note 3: If CH3ZCIF Flag is set to 1, the channel3 will be mute. - * |[4] |CH4ZCEN |Channel4 Zero-cross Detect Enable Control - * | | |0 = channel4 zero-cross detect Disabled. - * | | |1 = channel4 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel4 data sign bit change or next shift data bits are all zero then CH4ZCIF(I2S_STATUS1[4]) flag is set to 1. - * | | |Note 3: If CH4ZCIF Flag is set to 1, the channel4 will be mute. - * |[5] |CH5ZCEN |Channel5 Zero-cross Detect Enable Control - * | | |0 = channel5 zero-cross detect Disabled. - * | | |1 = channel5 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel5 data sign bit change or next shift data bits are all zero then CH5ZCIF(I2S_STATUS1[5]) flag is set to 1. - * | | |Note 3: If CH5ZCIF Flag is set to 1, the channel5 will be mute. - * |[6] |CH6ZCEN |Channel6 Zero-cross Detect Enable Control - * | | |0 = channel6 zero-cross detect Disabled. - * | | |1 = channel6 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel6 data sign bit change or next shift data bits are all zero then CH6ZCIF(I2S_STATUS1[6]) flag is set to 1. - * | | |Note 3: If CH6ZCIF Flag is set to 1, the channel6 will be mute. - * |[7] |CH7ZCEN |Channel7 Zero-cross Detect Enable Control - * | | |0 = channel7 zero-cross detect Disabled. - * | | |1 = channel7 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel7 data sign bit change or next shift data bits are all zero then CH7ZCIF (I2S_STATUS1[7]) flag is set to 1. - * | | |Note 3: If CH7ZCIF Flag is set to 1, the channel7 will be mute. - * |[11:8] |TXTH |Transmit FIFO Threshold Level - * | | |0000 = 0 data word in transmit FIFO. - * | | |0001 = 1 data word in transmit FIFO. - * | | |0010 = 2 data words in transmit FIFO. - * | | |... - * | | |1110 = 14 data words in transmit FIFO. - * | | |1111 = 15 data words in transmit FIFO. - * | | |Note: If remain data word number in transmit FIFO is the same or less than threshold level then TXTHIF (I2S_STATUS0[18]) flag is set. - * |[19:16] |RXTH |Receive FIFO Threshold Level - * | | |0000 = 1 data word in receive FIFO. - * | | |0001 = 2 data words in receive FIFO. - * | | |0010 = 3 data words in receive FIFO. - * | | |... - * | | |1110 = 15 data words in receive FIFO. - * | | |1111 = 16 data words in receive FIFO. - * | | |Note: When received data word number in receive buffer is greater than threshold level then RXTHIF (I2S_STATUS0[10]) flag is set. - * |[24] |PBWIDTH |Peripheral Bus Data Width Selection - * | | |This bit is used to choice the available data width of APB bus - * | | |It must be set to 1 while PDMA function is enable and it is set to 16-bit transmission mode - * | | |0 = 32 bits data width. - * | | |1 = 16 bits data width. - * | | |Note 1: If PBWIDTH=1, the low 16 bits of 32-bit data bus are available. - * | | |Note 2: If PBWIDTH=1, the transmitting FIFO level will be increased after two FIFO write operations. - * | | |Note 3: If PBWIDTH=1, the receiving FIFO level will be decreased after two FIFO read operations. - * |[25] |PB16ORD |FIFO Read/Write Order in 16-bit Width of Peripheral Bus - * | | |When PBWIDTH = 1, the data FIFO will be increased or decreased by two peripheral bus access - * | | |This bit is used to select the order of FIFO access operations to meet the 32-bit transmitting/receiving FIFO entries. - * | | |0 = Low 16-bit read/write access first. - * | | |1 = High 16-bit read/write access first. - * | | |Note: This bit is available while PBWIDTH = 1. - * @var I2S_T::STATUS1 - * Offset: 0x24 I2S Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCIF |Channel0 Zero-cross Interrupt Flag - * | | |It indicates channel0 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel0. - * | | |1 = Channel0 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[1] |CH1ZCIF |Channel1 Zero-cross Interrupt Flag - * | | |It indicates channel1 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel1. - * | | |1 = Channel1 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[2] |CH2ZCIF |Channel2 Zero-cross Interrupt Flag - * | | |It indicates channel2 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel2. - * | | |1 = Channel2 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[3] |CH3ZCIF |Channel3 Zero-cross Interrupt Flag - * | | |It indicates channel3 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel3. - * | | |1 = Channel3 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[4] |CH4ZCIF |Channel4 Zero-cross Interrupt Flag - * | | |It indicates channel4 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel4. - * | | |1 = Channel4 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[5] |CH5ZCIF |Channel5 Zero-cross Interrupt Flag - * | | |It indicates channel5 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel5. - * | | |1 = Channel5 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[6] |CH6ZCIF |Channel6 Zero-cross Interrupt Flag - * | | |It indicates channel6 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel6. - * | | |1 = Channel6 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[7] |CH7ZCIF |Channel7 Zero-cross Interrupt Flag - * | | |It indicates channel7 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel7. - * | | |1 = Channel7 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[12:8] |TXCNT |Transmit FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in transmit FIFO. - * | | |00000 = No data. - * | | |00001 = 1 word in transmit FIFO. - * | | |00010 = 2 words in transmit FIFO. - * | | |... - * | | |01110 = 14 words in transmit FIFO. - * | | |01111 = 15 words in transmit FIFO. - * | | |10000 = 16 words in transmit FIFO. - * | | |Others are reserved. - * |[20:16] |RXCNT |Receive FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in receive FIFO. - * | | |00000 = No data. - * | | |00001 = 1 word in receive FIFO. - * | | |00010 = 2 words in receive FIFO. - * | | |... - * | | |01110 = 14 words in receive FIFO. - * | | |01111 = 15 words in receive FIFO. - * | | |10000 = 16 words in receive FIFO. - * | | |Others are reserved. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2S Control Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0004] I2S Clock Divider Register */ - __IO uint32_t IEN; /*!< [0x0008] I2S Interrupt Enable Register */ - __IO uint32_t STATUS0; /*!< [0x000c] I2S Status Register 0 */ - __O uint32_t TXFIFO; /*!< [0x0010] I2S Transmit FIFO Register */ - __I uint32_t RXFIFO; /*!< [0x0014] I2S Receive FIFO Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CTL1; /*!< [0x0020] I2S Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0024] I2S Status Register 1 */ - -} I2S_T; - -/** - @addtogroup I2S_CONST I2S Bit Field Definition - Constant Definitions for I2S Controller - @{ -*/ - -#define I2S_CTL0_I2SEN_Pos (0) /*!< I2S_T::CTL0: I2SEN Position */ -#define I2S_CTL0_I2SEN_Msk (0x1ul << I2S_CTL0_I2SEN_Pos) /*!< I2S_T::CTL0: I2SEN Mask */ - -#define I2S_CTL0_TXEN_Pos (1) /*!< I2S_T::CTL0: TXEN Position */ -#define I2S_CTL0_TXEN_Msk (0x1ul << I2S_CTL0_TXEN_Pos) /*!< I2S_T::CTL0: TXEN Mask */ - -#define I2S_CTL0_RXEN_Pos (2) /*!< I2S_T::CTL0: RXEN Position */ -#define I2S_CTL0_RXEN_Msk (0x1ul << I2S_CTL0_RXEN_Pos) /*!< I2S_T::CTL0: RXEN Mask */ - -#define I2S_CTL0_MUTE_Pos (3) /*!< I2S_T::CTL0: MUTE Position */ -#define I2S_CTL0_MUTE_Msk (0x1ul << I2S_CTL0_MUTE_Pos) /*!< I2S_T::CTL0: MUTE Mask */ - -#define I2S_CTL0_DATWIDTH_Pos (4) /*!< I2S_T::CTL0: DATWIDTH Position */ -#define I2S_CTL0_DATWIDTH_Msk (0x3ul << I2S_CTL0_DATWIDTH_Pos) /*!< I2S_T::CTL0: DATWIDTH Mask */ - -#define I2S_CTL0_MONO_Pos (6) /*!< I2S_T::CTL0: MONO Position */ -#define I2S_CTL0_MONO_Msk (0x1ul << I2S_CTL0_MONO_Pos) /*!< I2S_T::CTL0: MONO Mask */ - -#define I2S_CTL0_ORDER_Pos (7) /*!< I2S_T::CTL0: ORDER Position */ -#define I2S_CTL0_ORDER_Msk (0x1ul << I2S_CTL0_ORDER_Pos) /*!< I2S_T::CTL0: ORDER Mask */ - -#define I2S_CTL0_SLAVE_Pos (8) /*!< I2S_T::CTL0: SLAVE Position */ -#define I2S_CTL0_SLAVE_Msk (0x1ul << I2S_CTL0_SLAVE_Pos) /*!< I2S_T::CTL0: SLAVE Mask */ - -#define I2S_CTL0_MCLKEN_Pos (15) /*!< I2S_T::CTL0: MCLKEN Position */ -#define I2S_CTL0_MCLKEN_Msk (0x1ul << I2S_CTL0_MCLKEN_Pos) /*!< I2S_T::CTL0: MCLKEN Mask */ - -#define I2S_CTL0_TXFBCLR_Pos (18) /*!< I2S_T::CTL0: TXFBCLR Position */ -#define I2S_CTL0_TXFBCLR_Msk (0x1ul << I2S_CTL0_TXFBCLR_Pos) /*!< I2S_T::CTL0: TXFBCLR Mask */ - -#define I2S_CTL0_RXFBCLR_Pos (19) /*!< I2S_T::CTL0: RXFBCLR Position */ -#define I2S_CTL0_RXFBCLR_Msk (0x1ul << I2S_CTL0_RXFBCLR_Pos) /*!< I2S_T::CTL0: RXFBCLR Mask */ - -#define I2S_CTL0_TXPDMAEN_Pos (20) /*!< I2S_T::CTL0: TXPDMAEN Position */ -#define I2S_CTL0_TXPDMAEN_Msk (0x1ul << I2S_CTL0_TXPDMAEN_Pos) /*!< I2S_T::CTL0: TXPDMAEN Mask */ - -#define I2S_CTL0_RXPDMAEN_Pos (21) /*!< I2S_T::CTL0: RXPDMAEN Position */ -#define I2S_CTL0_RXPDMAEN_Msk (0x1ul << I2S_CTL0_RXPDMAEN_Pos) /*!< I2S_T::CTL0: RXPDMAEN Mask */ - -#define I2S_CTL0_RXLCH_Pos (23) /*!< I2S_T::CTL0: RXLCH Position */ -#define I2S_CTL0_RXLCH_Msk (0x1ul << I2S_CTL0_RXLCH_Pos) /*!< I2S_T::CTL0: RXLCH Mask */ - -#define I2S_CTL0_FORMAT_Pos (24) /*!< I2S_T::CTL0: FORMAT Position */ -#define I2S_CTL0_FORMAT_Msk (0x7ul << I2S_CTL0_FORMAT_Pos) /*!< I2S_T::CTL0: FORMAT Mask */ - -#define I2S_CTL0_PCMSYNC_Pos (27) /*!< I2S_T::CTL0: PCMSYNC Position */ -#define I2S_CTL0_PCMSYNC_Msk (0x1ul << I2S_CTL0_PCMSYNC_Pos) /*!< I2S_T::CTL0: PCMSYNC Mask */ - -#define I2S_CTL0_CHWIDTH_Pos (28) /*!< I2S_T::CTL0: CHWIDTH Position */ -#define I2S_CTL0_CHWIDTH_Msk (0x3ul << I2S_CTL0_CHWIDTH_Pos) /*!< I2S_T::CTL0: CHWIDTH Mask */ - -#define I2S_CTL0_TDMCHNUM_Pos (30) /*!< I2S_T::CTL0: TDMCHNUM Position */ -#define I2S_CTL0_TDMCHNUM_Msk (0x3ul << I2S_CTL0_TDMCHNUM_Pos) /*!< I2S_T::CTL0: TDMCHNUM Mask */ - -#define I2S_CLKDIV_MCLKDIV_Pos (0) /*!< I2S_T::CLKDIV: MCLKDIV Position */ -#define I2S_CLKDIV_MCLKDIV_Msk (0x3ful << I2S_CLKDIV_MCLKDIV_Pos) /*!< I2S_T::CLKDIV: MCLKDIV Mask */ - -#define I2S_CLKDIV_BCLKDIV_Pos (8) /*!< I2S_T::CLKDIV: BCLKDIV Position */ -#define I2S_CLKDIV_BCLKDIV_Msk (0x1fful << I2S_CLKDIV_BCLKDIV_Pos) /*!< I2S_T::CLKDIV: BCLKDIV Mask */ - -#define I2S_IEN_RXUDFIEN_Pos (0) /*!< I2S_T::IEN: RXUDFIEN Position */ -#define I2S_IEN_RXUDFIEN_Msk (0x1ul << I2S_IEN_RXUDFIEN_Pos) /*!< I2S_T::IEN: RXUDFIEN Mask */ - -#define I2S_IEN_RXOVFIEN_Pos (1) /*!< I2S_T::IEN: RXOVFIEN Position */ -#define I2S_IEN_RXOVFIEN_Msk (0x1ul << I2S_IEN_RXOVFIEN_Pos) /*!< I2S_T::IEN: RXOVFIEN Mask */ - -#define I2S_IEN_RXTHIEN_Pos (2) /*!< I2S_T::IEN: RXTHIEN Position */ -#define I2S_IEN_RXTHIEN_Msk (0x1ul << I2S_IEN_RXTHIEN_Pos) /*!< I2S_T::IEN: RXTHIEN Mask */ - -#define I2S_IEN_TXUDFIEN_Pos (8) /*!< I2S_T::IEN: TXUDFIEN Position */ -#define I2S_IEN_TXUDFIEN_Msk (0x1ul << I2S_IEN_TXUDFIEN_Pos) /*!< I2S_T::IEN: TXUDFIEN Mask */ - -#define I2S_IEN_TXOVFIEN_Pos (9) /*!< I2S_T::IEN: TXOVFIEN Position */ -#define I2S_IEN_TXOVFIEN_Msk (0x1ul << I2S_IEN_TXOVFIEN_Pos) /*!< I2S_T::IEN: TXOVFIEN Mask */ - -#define I2S_IEN_TXTHIEN_Pos (10) /*!< I2S_T::IEN: TXTHIEN Position */ -#define I2S_IEN_TXTHIEN_Msk (0x1ul << I2S_IEN_TXTHIEN_Pos) /*!< I2S_T::IEN: TXTHIEN Mask */ - -#define I2S_IEN_CH0ZCIEN_Pos (16) /*!< I2S_T::IEN: CH0ZCIEN Position */ -#define I2S_IEN_CH0ZCIEN_Msk (0x1ul << I2S_IEN_CH0ZCIEN_Pos) /*!< I2S_T::IEN: CH0ZCIEN Mask */ - -#define I2S_IEN_CH1ZCIEN_Pos (17) /*!< I2S_T::IEN: CH1ZCIEN Position */ -#define I2S_IEN_CH1ZCIEN_Msk (0x1ul << I2S_IEN_CH1ZCIEN_Pos) /*!< I2S_T::IEN: CH1ZCIEN Mask */ - -#define I2S_IEN_CH2ZCIEN_Pos (18) /*!< I2S_T::IEN: CH2ZCIEN Position */ -#define I2S_IEN_CH2ZCIEN_Msk (0x1ul << I2S_IEN_CH2ZCIEN_Pos) /*!< I2S_T::IEN: CH2ZCIEN Mask */ - -#define I2S_IEN_CH3ZCIEN_Pos (19) /*!< I2S_T::IEN: CH3ZCIEN Position */ -#define I2S_IEN_CH3ZCIEN_Msk (0x1ul << I2S_IEN_CH3ZCIEN_Pos) /*!< I2S_T::IEN: CH3ZCIEN Mask */ - -#define I2S_IEN_CH4ZCIEN_Pos (20) /*!< I2S_T::IEN: CH4ZCIEN Position */ -#define I2S_IEN_CH4ZCIEN_Msk (0x1ul << I2S_IEN_CH4ZCIEN_Pos) /*!< I2S_T::IEN: CH4ZCIEN Mask */ - -#define I2S_IEN_CH5ZCIEN_Pos (21) /*!< I2S_T::IEN: CH5ZCIEN Position */ -#define I2S_IEN_CH5ZCIEN_Msk (0x1ul << I2S_IEN_CH5ZCIEN_Pos) /*!< I2S_T::IEN: CH5ZCIEN Mask */ - -#define I2S_IEN_CH6ZCIEN_Pos (22) /*!< I2S_T::IEN: CH6ZCIEN Position */ -#define I2S_IEN_CH6ZCIEN_Msk (0x1ul << I2S_IEN_CH6ZCIEN_Pos) /*!< I2S_T::IEN: CH6ZCIEN Mask */ - -#define I2S_IEN_CH7ZCIEN_Pos (23) /*!< I2S_T::IEN: CH7ZCIEN Position */ -#define I2S_IEN_CH7ZCIEN_Msk (0x1ul << I2S_IEN_CH7ZCIEN_Pos) /*!< I2S_T::IEN: CH7ZCIEN Mask */ - -#define I2S_STATUS0_I2SINT_Pos (0) /*!< I2S_T::STATUS0: I2SINT Position */ -#define I2S_STATUS0_I2SINT_Msk (0x1ul << I2S_STATUS0_I2SINT_Pos) /*!< I2S_T::STATUS0: I2SINT Mask */ - -#define I2S_STATUS0_I2SRXINT_Pos (1) /*!< I2S_T::STATUS0: I2SRXINT Position */ -#define I2S_STATUS0_I2SRXINT_Msk (0x1ul << I2S_STATUS0_I2SRXINT_Pos) /*!< I2S_T::STATUS0: I2SRXINT Mask */ - -#define I2S_STATUS0_I2STXINT_Pos (2) /*!< I2S_T::STATUS0: I2STXINT Position */ -#define I2S_STATUS0_I2STXINT_Msk (0x1ul << I2S_STATUS0_I2STXINT_Pos) /*!< I2S_T::STATUS0: I2STXINT Mask */ - -#define I2S_STATUS0_DATACH_Pos (3) /*!< I2S_T::STATUS0: DATACH Position */ -#define I2S_STATUS0_DATACH_Msk (0x7ul << I2S_STATUS0_DATACH_Pos) /*!< I2S_T::STATUS0: DATACH Mask */ - -#define I2S_STATUS0_RXUDIF_Pos (8) /*!< I2S_T::STATUS0: RXUDIF Position */ -#define I2S_STATUS0_RXUDIF_Msk (0x1ul << I2S_STATUS0_RXUDIF_Pos) /*!< I2S_T::STATUS0: RXUDIF Mask */ - -#define I2S_STATUS0_RXOVIF_Pos (9) /*!< I2S_T::STATUS0: RXOVIF Position */ -#define I2S_STATUS0_RXOVIF_Msk (0x1ul << I2S_STATUS0_RXOVIF_Pos) /*!< I2S_T::STATUS0: RXOVIF Mask */ - -#define I2S_STATUS0_RXTHIF_Pos (10) /*!< I2S_T::STATUS0: RXTHIF Position */ -#define I2S_STATUS0_RXTHIF_Msk (0x1ul << I2S_STATUS0_RXTHIF_Pos) /*!< I2S_T::STATUS0: RXTHIF Mask */ - -#define I2S_STATUS0_RXFULL_Pos (11) /*!< I2S_T::STATUS0: RXFULL Position */ -#define I2S_STATUS0_RXFULL_Msk (0x1ul << I2S_STATUS0_RXFULL_Pos) /*!< I2S_T::STATUS0: RXFULL Mask */ - -#define I2S_STATUS0_RXEMPTY_Pos (12) /*!< I2S_T::STATUS0: RXEMPTY Position */ -#define I2S_STATUS0_RXEMPTY_Msk (0x1ul << I2S_STATUS0_RXEMPTY_Pos) /*!< I2S_T::STATUS0: RXEMPTY Mask */ - -#define I2S_STATUS0_TXUDIF_Pos (16) /*!< I2S_T::STATUS0: TXUDIF Position */ -#define I2S_STATUS0_TXUDIF_Msk (0x1ul << I2S_STATUS0_TXUDIF_Pos) /*!< I2S_T::STATUS0: TXUDIF Mask */ - -#define I2S_STATUS0_TXOVIF_Pos (17) /*!< I2S_T::STATUS0: TXOVIF Position */ -#define I2S_STATUS0_TXOVIF_Msk (0x1ul << I2S_STATUS0_TXOVIF_Pos) /*!< I2S_T::STATUS0: TXOVIF Mask */ - -#define I2S_STATUS0_TXTHIF_Pos (18) /*!< I2S_T::STATUS0: TXTHIF Position */ -#define I2S_STATUS0_TXTHIF_Msk (0x1ul << I2S_STATUS0_TXTHIF_Pos) /*!< I2S_T::STATUS0: TXTHIF Mask */ - -#define I2S_STATUS0_TXFULL_Pos (19) /*!< I2S_T::STATUS0: TXFULL Position */ -#define I2S_STATUS0_TXFULL_Msk (0x1ul << I2S_STATUS0_TXFULL_Pos) /*!< I2S_T::STATUS0: TXFULL Mask */ - -#define I2S_STATUS0_TXEMPTY_Pos (20) /*!< I2S_T::STATUS0: TXEMPTY Position */ -#define I2S_STATUS0_TXEMPTY_Msk (0x1ul << I2S_STATUS0_TXEMPTY_Pos) /*!< I2S_T::STATUS0: TXEMPTY Mask */ - -#define I2S_STATUS0_TXBUSY_Pos (21) /*!< I2S_T::STATUS0: TXBUSY Position */ -#define I2S_STATUS0_TXBUSY_Msk (0x1ul << I2S_STATUS0_TXBUSY_Pos) /*!< I2S_T::STATUS0: TXBUSY Mask */ - -#define I2S_TXFIFO_TXFIFO_Pos (0) /*!< I2S_T::TXFIFO: TXFIFO Position */ -#define I2S_TXFIFO_TXFIFO_Msk (0xfffffffful << I2S_TXFIFO_TXFIFO_Pos) /*!< I2S_T::TXFIFO: TXFIFO Mask */ - -#define I2S_RXFIFO_RXFIFO_Pos (0) /*!< I2S_T::RXFIFO: RXFIFO Position */ -#define I2S_RXFIFO_RXFIFO_Msk (0xfffffffful << I2S_RXFIFO_RXFIFO_Pos) /*!< I2S_T::RXFIFO: RXFIFO Mask */ - -#define I2S_CTL1_CH0ZCEN_Pos (0) /*!< I2S_T::CTL1: CH0ZCEN Position */ -#define I2S_CTL1_CH0ZCEN_Msk (0x1ul << I2S_CTL1_CH0ZCEN_Pos) /*!< I2S_T::CTL1: CH0ZCEN Mask */ - -#define I2S_CTL1_CH1ZCEN_Pos (1) /*!< I2S_T::CTL1: CH1ZCEN Position */ -#define I2S_CTL1_CH1ZCEN_Msk (0x1ul << I2S_CTL1_CH1ZCEN_Pos) /*!< I2S_T::CTL1: CH1ZCEN Mask */ - -#define I2S_CTL1_CH2ZCEN_Pos (2) /*!< I2S_T::CTL1: CH2ZCEN Position */ -#define I2S_CTL1_CH2ZCEN_Msk (0x1ul << I2S_CTL1_CH2ZCEN_Pos) /*!< I2S_T::CTL1: CH2ZCEN Mask */ - -#define I2S_CTL1_CH3ZCEN_Pos (3) /*!< I2S_T::CTL1: CH3ZCEN Position */ -#define I2S_CTL1_CH3ZCEN_Msk (0x1ul << I2S_CTL1_CH3ZCEN_Pos) /*!< I2S_T::CTL1: CH3ZCEN Mask */ - -#define I2S_CTL1_CH4ZCEN_Pos (4) /*!< I2S_T::CTL1: CH4ZCEN Position */ -#define I2S_CTL1_CH4ZCEN_Msk (0x1ul << I2S_CTL1_CH4ZCEN_Pos) /*!< I2S_T::CTL1: CH4ZCEN Mask */ - -#define I2S_CTL1_CH5ZCEN_Pos (5) /*!< I2S_T::CTL1: CH5ZCEN Position */ -#define I2S_CTL1_CH5ZCEN_Msk (0x1ul << I2S_CTL1_CH5ZCEN_Pos) /*!< I2S_T::CTL1: CH5ZCEN Mask */ - -#define I2S_CTL1_CH6ZCEN_Pos (6) /*!< I2S_T::CTL1: CH6ZCEN Position */ -#define I2S_CTL1_CH6ZCEN_Msk (0x1ul << I2S_CTL1_CH6ZCEN_Pos) /*!< I2S_T::CTL1: CH6ZCEN Mask */ - -#define I2S_CTL1_CH7ZCEN_Pos (7) /*!< I2S_T::CTL1: CH7ZCEN Position */ -#define I2S_CTL1_CH7ZCEN_Msk (0x1ul << I2S_CTL1_CH7ZCEN_Pos) /*!< I2S_T::CTL1: CH7ZCEN Mask */ - -#define I2S_CTL1_TXTH_Pos (8) /*!< I2S_T::CTL1: TXTH Position */ -#define I2S_CTL1_TXTH_Msk (0xful << I2S_CTL1_TXTH_Pos) /*!< I2S_T::CTL1: TXTH Mask */ - -#define I2S_CTL1_RXTH_Pos (16) /*!< I2S_T::CTL1: RXTH Position */ -#define I2S_CTL1_RXTH_Msk (0xful << I2S_CTL1_RXTH_Pos) /*!< I2S_T::CTL1: RXTH Mask */ - -#define I2S_CTL1_PBWIDTH_Pos (24) /*!< I2S_T::CTL1: PBWIDTH Position */ -#define I2S_CTL1_PBWIDTH_Msk (0x1ul << I2S_CTL1_PBWIDTH_Pos) /*!< I2S_T::CTL1: PBWIDTH Mask */ - -#define I2S_CTL1_PB16ORD_Pos (25) /*!< I2S_T::CTL1: PB16ORD Position */ -#define I2S_CTL1_PB16ORD_Msk (0x1ul << I2S_CTL1_PB16ORD_Pos) /*!< I2S_T::CTL1: PB16ORD Mask */ - -#define I2S_STATUS1_CH0ZCIF_Pos (0) /*!< I2S_T::STATUS1: CH0ZCIF Position */ -#define I2S_STATUS1_CH0ZCIF_Msk (0x1ul << I2S_STATUS1_CH0ZCIF_Pos) /*!< I2S_T::STATUS1: CH0ZCIF Mask */ - -#define I2S_STATUS1_CH1ZCIF_Pos (1) /*!< I2S_T::STATUS1: CH1ZCIF Position */ -#define I2S_STATUS1_CH1ZCIF_Msk (0x1ul << I2S_STATUS1_CH1ZCIF_Pos) /*!< I2S_T::STATUS1: CH1ZCIF Mask */ - -#define I2S_STATUS1_CH2ZCIF_Pos (2) /*!< I2S_T::STATUS1: CH2ZCIF Position */ -#define I2S_STATUS1_CH2ZCIF_Msk (0x1ul << I2S_STATUS1_CH2ZCIF_Pos) /*!< I2S_T::STATUS1: CH2ZCIF Mask */ - -#define I2S_STATUS1_CH3ZCIF_Pos (3) /*!< I2S_T::STATUS1: CH3ZCIF Position */ -#define I2S_STATUS1_CH3ZCIF_Msk (0x1ul << I2S_STATUS1_CH3ZCIF_Pos) /*!< I2S_T::STATUS1: CH3ZCIF Mask */ - -#define I2S_STATUS1_CH4ZCIF_Pos (4) /*!< I2S_T::STATUS1: CH4ZCIF Position */ -#define I2S_STATUS1_CH4ZCIF_Msk (0x1ul << I2S_STATUS1_CH4ZCIF_Pos) /*!< I2S_T::STATUS1: CH4ZCIF Mask */ - -#define I2S_STATUS1_CH5ZCIF_Pos (5) /*!< I2S_T::STATUS1: CH5ZCIF Position */ -#define I2S_STATUS1_CH5ZCIF_Msk (0x1ul << I2S_STATUS1_CH5ZCIF_Pos) /*!< I2S_T::STATUS1: CH5ZCIF Mask */ - -#define I2S_STATUS1_CH6ZCIF_Pos (6) /*!< I2S_T::STATUS1: CH6ZCIF Position */ -#define I2S_STATUS1_CH6ZCIF_Msk (0x1ul << I2S_STATUS1_CH6ZCIF_Pos) /*!< I2S_T::STATUS1: CH6ZCIF Mask */ - -#define I2S_STATUS1_CH7ZCIF_Pos (7) /*!< I2S_T::STATUS1: CH7ZCIF Position */ -#define I2S_STATUS1_CH7ZCIF_Msk (0x1ul << I2S_STATUS1_CH7ZCIF_Pos) /*!< I2S_T::STATUS1: CH7ZCIF Mask */ - -#define I2S_STATUS1_TXCNT_Pos (8) /*!< I2S_T::STATUS1: TXCNT Position */ -#define I2S_STATUS1_TXCNT_Msk (0x1ful << I2S_STATUS1_TXCNT_Pos) /*!< I2S_T::STATUS1: TXCNT Mask */ - -#define I2S_STATUS1_RXCNT_Pos (16) /*!< I2S_T::STATUS1: RXCNT Position */ -#define I2S_STATUS1_RXCNT_Msk (0x1ful << I2S_STATUS1_RXCNT_Pos) /*!< I2S_T::STATUS1: RXCNT Mask */ - -/**@}*/ /* I2S_CONST */ -/**@}*/ /* end of I2S register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __I2S_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/keystore_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/keystore_reg.h deleted file mode 100644 index f7d20adda59..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/keystore_reg.h +++ /dev/null @@ -1,384 +0,0 @@ -/**************************************************************************//** - * @file keystore_reg.h - * @version V1.00 - * @brief Key store register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __KEYSTORE_REG_H__ -#define __KEYSTORE_REG_H__ - - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Key Store -------------------------*/ -/** - @addtogroup KS Key Store(KS) - Memory Mapped Structure for KS Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var KS_T::CTL - * Offset: 0x00 Key Store Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Key Store Start Control Bit - * | | |0 = No operation. - * | | |1 = Start the setted operation. - * |[3:1] |OPMODE |Key Store Operation Mode - * | | |000 = Read operation. - * | | |001 = Create operation. - * | | |010 = Erase one key operation (only for key is in SRAM). - * | | |011 = Erase all keys operation (only for SRAM and Flash). - * | | |100 = Revoke key operation. - * | | |101 = Data Remanence prevention opertation (only for SRAM). - * | | |Others = reserved. - * |[7] |CONT |Read/Write Key Continue Bit - * | | |0 = Read/Write key operation is not continuous to previous operation. - * | | |1 = Read/Write key operation is continuous to previous operation. - * |[8] |INIT |Key Store Initialization - * | | |User should to check BUSY(KS_STS[2]) is 0, and then write 1 to this bit and START(KS_CTL[0[), the Key Store will start to be initialized. - * | | |After KeyStore is initialized, INIT will be cleared. - * | | |Note: Before executing INIT, user must to checks KS(SYS_SRAMPC1) is 00. - * |[10] |SILENT |Silent Access Enable Bit - * | | |0 = Silent Access Disabled. - * | | |1 = Silent Access Enabled. - * |[11] |SCMB |Data Scramble Enable Bit - * | | |0 = Data Scramble Disabled. - * | | |1 = Data Scramble Enabled. - * |[15] |IEN |Key Store Interrupt Enable Bit - * | | |0 = Key Store Interrupt Disabled. - * | | |1 = Key Store Interrupt Enabled. - * @var KS_T::METADATA - * Offset: 0x04 Key Store Metadata Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SEC |Secure Key Selection Bit - * | | |0 = Set key as the non-secure key. - * | | |1 = Set key as the secure key. - * |[1] |PRIV |Privilege Key Selection Bit - * | | |0 = Set key as the non-privilege key. - * | | |1 = Set key as the privilege key. - * |[2] |READABLE |Key Readable Control Bit - * | | |0 = key is un-readable. - * | | |1 = key is readable. - * |[3] |RVK |Key Revoke Control Bit - * | | |0 = Key current selected will not be changed. - * | | |1 = key current selected will be change to revoked state. - * |[4] |BS |Booting State Selection Bit - * | | |0 = Set key used at all state. - * | | |1 = Set key used at boot loader state 1 (BL1 state). - * |[12:8] |SIZE |Key Size Selection Bits - * | | |00000 = 128 bits. - * | | |00001 = 163 bits. - * | | |00010 = 192 bits. - * | | |00011 = 224 bits. - * | | |00100 = 233 bits. - * | | |00101 = 255 bits. - * | | |00110 = 256 bits. - * | | |00111 = 283 bits. - * | | |01000 = 384 bits. - * | | |01001 = 409 bits. - * | | |01010 = 512 bits. - * | | |01011 = 521 bits. - * | | |01100 = 571 bits. - * | | |10000 = 1024 bits. - * | | |10001 = 1536 bits. - * | | |10010 = 2048 bits. - * | | |10011 = 3072 bits. - * | | |10100 = 4096 bits. - * | | |Others = reserved. - * |[18:16] |OWNER |Key Owner Selection Bits - * | | |000 = Only for AES used. - * | | |001 = Only for HMAC engine used. - * | | |010 = Only for RSA engine exponential used (private key). - * | | |011 = Only for RSA engine middle data used. - * | | |100 = Only for ECC engine used. - * | | |101 = Only for CPU engine use. - * | | |Others = reserved. - * |[25:20] |NUMBER |Key Number - * | | |Before read or erase one key operation starts, user should write the key number to be operated - * | | |When create operation is finished, user can read these bits to get its key number. - * |[31:30] |DST |Key Location Selection Bits - * | | |00 = Key is in SRAM. - * | | |01 = Key is in Flash. - * | | |10 = Key is in OTP. - * | | |Others = reserved. - * @var KS_T::STS - * Offset: 0x08 Key Store Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IF |Key Store Finish Interrupt Flag - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No Key Store interrupt. - * | | |1 = Key Store operation done interrupt. - * |[1] |EIF |Key Store Error Flag - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No Key Store error. - * | | |1 = Key Store error interrupt. - * |[2] |BUSY |Key Store Busy Flag (RO) - * | | |0 = KeyStore is idle or finished. - * | | |1 = KeyStore is busy. - * |[3] |SRAMFULL |Key Storage at SRAM Full Status Bit (RO) - * | | |0 = Key Storage at SRAM is not full. - * | | |1 = Key Storage at SRAM is full. - * |[4] |FLASHFULL |Key Storage at Flash Full Status Bit (RO) - * | | |0 = Key Storage at Flash is not full. - * | | |1 = Key Storage at Flash is full. - * |[7] |INITDONE |Key Store Initialization Done Status (RO) - * | | |0 = Key Store is un-initialized. - * | | |1 = Key Store is initialized. - * |[8] |RAMINV |Key Store SRAM Invert Status (RO) - * | | |0 = Key Store key in SRAM is normal. - * | | |1 = Key Store key in SRAM is inverted. - * @var KS_T::REMAIN - * Offset: 0x0C Key Store Remaining Space Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |RRMNG |Key Store SRAM Remaining Space - * | | |The RRMNG shows the remaining byte count space for SRAM. - * |[27:16] |FRMNG |Key Store Flash Remaining Space - * | | |The FRMNG shows the remaining byte count space for Flash. - * @var KS_T::SCMBKEY - * Offset: 0x10-0x1C Key Store Scramble Key Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCMBKEY |Key Store Scramble Key - * | | |When SCMB(KS_CTL[]) is set to 1, user should write the scramble key in this register before new key stores in Key Store - * | | |If user does not write the scramble key in this register, the Key Store will use previous scramble key to execute data scramble function. - * @var KS_T::KEY - * Offset: 0x20-0x3C Key Store Entry Key Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::OTPSTS - * Offset: 0x40 Key Store OTP Keys Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KEY0 |OTP Key 0 Used Status - * | | |0 = OTP key 0 is unused. - * | | |1 = OTP key 0 is used. - * | | |Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[1] |KEY1 |OTP Key 1 Used Status - * | | |0 = OTP key 1 is unused. - * | | |1 = OTP key 1 is used. - * | | |Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[2] |KEY2 |OTP Key 2 Used Status - * | | |0 = OTP key 2 is unused. - * | | |1 = OTP key 2 is used. - * | | |Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[3] |KEY3 |OTP Key 3 Used Status - * | | |0 = OTP key 3 is unused. - * | | |1 = OTP key 3 is used. - * | | |Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[4] |KEY4 |OTP Key 4 Used Status - * | | |0 = OTP key 4 is unused. - * | | |1 = OTP key 4 is used. - * | | |Note: If chip is changed to RMA stage, existing key will be revoked after initialization. - * |[5] |KEY5 |OTP Key 5 Used Status - * | | |0 = OTP key 5 is unused. - * | | |1 = OTP key 5 is used. - * | | |Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[6] |KEY6 |OTP Key 6 Used Status - * | | |0 = OTP key 6 is unused. - * | | |1 = OTP key 6 is used. - * | | |Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[7] |KEY7 |OTP Key 7 Used Status - * | | |0 = OTP key 7 is unused. - * | | |1 = OTP key 7 is used. - * | | |Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * @var KS_T::REMKCNT - * Offset: 0x44 Key Store Remaining Key Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |RRMKCNT |Key Store SRAM Remaining Key Count - * | | |The RRMKCNT shows the remaining key count for SRAM. - * |[21:16] |FRMKCNT |Key Store Flash Remaining Key Count - * | | |The FRMKCNT shows the remaining key count for Flash. - */ - __IO uint32_t CTL; /*!< [0x0000] Key Store Control Register */ - __IO uint32_t METADATA; /*!< [0x0004] Key Store Metadata Register */ - __IO uint32_t STS; /*!< [0x0008] Key Store Status Register */ - __I uint32_t REMAIN; /*!< [0x000c] Key Store Remaining Space Register */ - __IO uint32_t SCMBKEY[4]; /*!< [0x0010 ~ 0x001c] Key Store Scramble Key Word 0 Register */ - __IO uint32_t KEY[8]; /*!< [0x0020 ~ 0x003c] Key Store Entry Key Word 0 Register */ - __I uint32_t OTPSTS; /*!< [0x0040] Key Store OTP Keys Status Register */ - __I uint32_t REMKCNT; /*!< [0x0044] Key Store Remaining Key Count Register */ - -} KS_T; - -/** - @addtogroup KS_CONST KS Bit Field Definition - Constant Definitions for KS Controller - @{ -*/ - -#define KS_CTL_START_Pos (0) /*!< KS_T::CTL: START Position */ -#define KS_CTL_START_Msk (0x1ul << KS_CTL_START_Pos) /*!< KS_T::CTL: START Mask */ - -#define KS_CTL_OPMODE_Pos (1) /*!< KS_T::CTL: OPMODE Position */ -#define KS_CTL_OPMODE_Msk (0x7ul << KS_CTL_OPMODE_Pos) /*!< KS_T::CTL: OPMODE Mask */ - -#define KS_CTL_CONT_Pos (7) /*!< KS_T::CTL: CONT Position */ -#define KS_CTL_CONT_Msk (0x1ul << KS_CTL_CONT_Pos) /*!< KS_T::CTL: CONT Mask */ - -#define KS_CTL_INIT_Pos (8) /*!< KS_T::CTL: INIT Position */ -#define KS_CTL_INIT_Msk (0x1ul << KS_CTL_INIT_Pos) /*!< KS_T::CTL: INIT Mask */ - -#define KS_CTL_SILENT_Pos (10) /*!< KS_T::CTL: SILENT Position */ -#define KS_CTL_SILENT_Msk (0x1ul << KS_CTL_SILENT_Pos) /*!< KS_T::CTL: SILENT Mask */ - -#define KS_CTL_SCMB_Pos (11) /*!< KS_T::CTL: SCMB Position */ -#define KS_CTL_SCMB_Msk (0x1ul << KS_CTL_SCMB_Pos) /*!< KS_T::CTL: SCMB Mask */ - -#define KS_CTL_IEN_Pos (15) /*!< KS_T::CTL: IEN Position */ -#define KS_CTL_IEN_Msk (0x1ul << KS_CTL_IEN_Pos) /*!< KS_T::CTL: IEN Mask */ - -#define KS_METADATA_SEC_Pos (0) /*!< KS_T::METADATA: SEC Position */ -#define KS_METADATA_SEC_Msk (0x1ul << KS_METADATA_SEC_Pos) /*!< KS_T::METADATA: SEC Mask */ - -#define KS_METADATA_PRIV_Pos (1) /*!< KS_T::METADATA: PRIV Position */ -#define KS_METADATA_PRIV_Msk (0x1ul << KS_METADATA_PRIV_Pos) /*!< KS_T::METADATA: PRIV Mask */ - -#define KS_METADATA_READABLE_Pos (2) /*!< KS_T::METADATA: READABLE Position */ -#define KS_METADATA_READABLE_Msk (0x1ul << KS_METADATA_READABLE_Pos) /*!< KS_T::METADATA: READABLE Mask */ - -#define KS_METADATA_RVK_Pos (3) /*!< KS_T::METADATA: RVK Position */ -#define KS_METADATA_RVK_Msk (0x1ul << KS_METADATA_RVK_Pos) /*!< KS_T::METADATA: RVK Mask */ - -#define KS_METADATA_BS_Pos (4) /*!< KS_T::METADATA: BS Position */ -#define KS_METADATA_BS_Msk (0x1ul << KS_METADATA_BS_Pos) /*!< KS_T::METADATA: BS Mask */ - -#define KS_METADATA_SIZE_Pos (8) /*!< KS_T::METADATA: SIZE Position */ -#define KS_METADATA_SIZE_Msk (0x1ful << KS_METADATA_SIZE_Pos) /*!< KS_T::METADATA: SIZE Mask */ - -#define KS_METADATA_OWNER_Pos (16) /*!< KS_T::METADATA: OWNER Position */ -#define KS_METADATA_OWNER_Msk (0x7ul << KS_METADATA_OWNER_Pos) /*!< KS_T::METADATA: OWNER Mask */ - -#define KS_METADATA_NUMBER_Pos (20) /*!< KS_T::METADATA: NUMBER Position */ -#define KS_METADATA_NUMBER_Msk (0x3ful << KS_METADATA_NUMBER_Pos) /*!< KS_T::METADATA: NUMBER Mask */ - -#define KS_METADATA_DST_Pos (30) /*!< KS_T::METADATA: DST Position */ -#define KS_METADATA_DST_Msk (0x3ul << KS_METADATA_DST_Pos) /*!< KS_T::METADATA: DST Mask */ - -#define KS_STS_IF_Pos (0) /*!< KS_T::STS: IF Position */ -#define KS_STS_IF_Msk (0x1ul << KS_STS_IF_Pos) /*!< KS_T::STS: IF Mask */ - -#define KS_STS_EIF_Pos (1) /*!< KS_T::STS: EIF Position */ -#define KS_STS_EIF_Msk (0x1ul << KS_STS_EIF_Pos) /*!< KS_T::STS: EIF Mask */ - -#define KS_STS_BUSY_Pos (2) /*!< KS_T::STS: BUSY Position */ -#define KS_STS_BUSY_Msk (0x1ul << KS_STS_BUSY_Pos) /*!< KS_T::STS: BUSY Mask */ - -#define KS_STS_SRAMFULL_Pos (3) /*!< KS_T::STS: SRAMFULL Position */ -#define KS_STS_SRAMFULL_Msk (0x1ul << KS_STS_SRAMFULL_Pos) /*!< KS_T::STS: SRAMFULL Mask */ - -#define KS_STS_FLASHFULL_Pos (4) /*!< KS_T::STS: FLASHFULL Position */ -#define KS_STS_FLASHFULL_Msk (0x1ul << KS_STS_FLASHFULL_Pos) /*!< KS_T::STS: FLASHFULL Mask */ - -#define KS_STS_INITDONE_Pos (7) /*!< KS_T::STS: INITDONE Position */ -#define KS_STS_INITDONE_Msk (0x1ul << KS_STS_INITDONE_Pos) /*!< KS_T::STS: INITDONE Mask */ - -#define KS_STS_RAMINV_Pos (8) /*!< KS_T::STS: RAMINV Position */ -#define KS_STS_RAMINV_Msk (0x1ul << KS_STS_RAMINV_Pos) /*!< KS_T::STS: RAMINV Mask */ - -#define KS_REMAIN_RRMNG_Pos (0) /*!< KS_T::REMAIN: RRMNG Position */ -#define KS_REMAIN_RRMNG_Msk (0x1ffful << KS_REMAIN_RRMNG_Pos) /*!< KS_T::REMAIN: RRMNG Mask */ - -#define KS_REMAIN_FRMNG_Pos (16) /*!< KS_T::REMAIN: FRMNG Position */ -#define KS_REMAIN_FRMNG_Msk (0xffful << KS_REMAIN_FRMNG_Pos) /*!< KS_T::REMAIN: FRMNG Mask */ - -#define KS_SCMBKEY0_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY0: SCMBKEY Position */ -#define KS_SCMBKEY0_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY0_SCMBKEY_Pos) /*!< KS_T::SCMBKEY0: SCMBKEY Mask */ - -#define KS_SCMBKEY1_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY1: SCMBKEY Position */ -#define KS_SCMBKEY1_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY1_SCMBKEY_Pos) /*!< KS_T::SCMBKEY1: SCMBKEY Mask */ - -#define KS_SCMBKEY2_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY2: SCMBKEY Position */ -#define KS_SCMBKEY2_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY2_SCMBKEY_Pos) /*!< KS_T::SCMBKEY2: SCMBKEY Mask */ - -#define KS_SCMBKEY3_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY3: SCMBKEY Position */ -#define KS_SCMBKEY3_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY3_SCMBKEY_Pos) /*!< KS_T::SCMBKEY3: SCMBKEY Mask */ - -#define KS_KEY0_KEY_Pos (0) /*!< KS_T::KEY0: KEY Position */ -#define KS_KEY0_KEY_Msk (0xfffffffful << KS_KEY0_KEY_Pos) /*!< KS_T::KEY0: KEY Mask */ - -#define KS_KEY1_KEY_Pos (0) /*!< KS_T::KEY1: KEY Position */ -#define KS_KEY1_KEY_Msk (0xfffffffful << KS_KEY1_KEY_Pos) /*!< KS_T::KEY1: KEY Mask */ - -#define KS_KEY2_KEY_Pos (0) /*!< KS_T::KEY2: KEY Position */ -#define KS_KEY2_KEY_Msk (0xfffffffful << KS_KEY2_KEY_Pos) /*!< KS_T::KEY2: KEY Mask */ - -#define KS_KEY3_KEY_Pos (0) /*!< KS_T::KEY3: KEY Position */ -#define KS_KEY3_KEY_Msk (0xfffffffful << KS_KEY3_KEY_Pos) /*!< KS_T::KEY3: KEY Mask */ - -#define KS_KEY4_KEY_Pos (0) /*!< KS_T::KEY4: KEY Position */ -#define KS_KEY4_KEY_Msk (0xfffffffful << KS_KEY4_KEY_Pos) /*!< KS_T::KEY4: KEY Mask */ - -#define KS_KEY5_KEY_Pos (0) /*!< KS_T::KEY5: KEY Position */ -#define KS_KEY5_KEY_Msk (0xfffffffful << KS_KEY5_KEY_Pos) /*!< KS_T::KEY5: KEY Mask */ - -#define KS_KEY6_KEY_Pos (0) /*!< KS_T::KEY6: KEY Position */ -#define KS_KEY6_KEY_Msk (0xfffffffful << KS_KEY6_KEY_Pos) /*!< KS_T::KEY6: KEY Mask */ - -#define KS_KEY7_KEY_Pos (0) /*!< KS_T::KEY7: KEY Position */ -#define KS_KEY7_KEY_Msk (0xfffffffful << KS_KEY7_KEY_Pos) /*!< KS_T::KEY7: KEY Mask */ - -#define KS_OTPSTS_KEY0_Pos (0) /*!< KS_T::OTPSTS: KEY0 Position */ -#define KS_OTPSTS_KEY0_Msk (0x1ul << KS_OTPSTS_KEY0_Pos) /*!< KS_T::OTPSTS: KEY0 Mask */ - -#define KS_OTPSTS_KEY1_Pos (1) /*!< KS_T::OTPSTS: KEY1 Position */ -#define KS_OTPSTS_KEY1_Msk (0x1ul << KS_OTPSTS_KEY1_Pos) /*!< KS_T::OTPSTS: KEY1 Mask */ - -#define KS_OTPSTS_KEY2_Pos (2) /*!< KS_T::OTPSTS: KEY2 Position */ -#define KS_OTPSTS_KEY2_Msk (0x1ul << KS_OTPSTS_KEY2_Pos) /*!< KS_T::OTPSTS: KEY2 Mask */ - -#define KS_OTPSTS_KEY3_Pos (3) /*!< KS_T::OTPSTS: KEY3 Position */ -#define KS_OTPSTS_KEY3_Msk (0x1ul << KS_OTPSTS_KEY3_Pos) /*!< KS_T::OTPSTS: KEY3 Mask */ - -#define KS_OTPSTS_KEY4_Pos (4) /*!< KS_T::OTPSTS: KEY4 Position */ -#define KS_OTPSTS_KEY4_Msk (0x1ul << KS_OTPSTS_KEY4_Pos) /*!< KS_T::OTPSTS: KEY4 Mask */ - -#define KS_OTPSTS_KEY5_Pos (5) /*!< KS_T::OTPSTS: KEY5 Position */ -#define KS_OTPSTS_KEY5_Msk (0x1ul << KS_OTPSTS_KEY5_Pos) /*!< KS_T::OTPSTS: KEY5 Mask */ - -#define KS_OTPSTS_KEY6_Pos (6) /*!< KS_T::OTPSTS: KEY6 Position */ -#define KS_OTPSTS_KEY6_Msk (0x1ul << KS_OTPSTS_KEY6_Pos) /*!< KS_T::OTPSTS: KEY6 Mask */ - -#define KS_OTPSTS_KEY7_Pos (7) /*!< KS_T::OTPSTS: KEY7 Position */ -#define KS_OTPSTS_KEY7_Msk (0x1ul << KS_OTPSTS_KEY7_Pos) /*!< KS_T::OTPSTS: KEY7 Mask */ - -#define KS_REMKCNT_RRMKCNT_Pos (0) /*!< KS_T::REMKCNT: RRMKCNT Position */ -#define KS_REMKCNT_RRMKCNT_Msk (0x3ful << KS_REMKCNT_RRMKCNT_Pos) /*!< KS_T::REMKCNT: RRMKCNT Mask */ - -#define KS_REMKCNT_FRMKCNT_Pos (16) /*!< KS_T::REMKCNT: FRMKCNT Position */ -#define KS_REMKCNT_FRMKCNT_Msk (0x3ful << KS_REMKCNT_FRMKCNT_Pos) /*!< KS_T::REMKCNT: FRMKCNT Mask */ - - -/**@}*/ /* KS_CONST */ -/**@}*/ /* end of KS register group */ - - -/**@}*/ /* end of REGISTER group */ - -#endif /* __KEYSTORE_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/lcd_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/lcd_reg.h deleted file mode 100644 index 2198e861fde..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/lcd_reg.h +++ /dev/null @@ -1,1050 +0,0 @@ -/**************************************************************************//** - * @file lcd_reg.h - * @version V1.00 - * @brief LCD register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __LCD_REG_H__ -#define __LCD_REG_H__ - - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Liquid-Crystal Display -------------------------*/ -/** - @addtogroup LCD Liquid-Crystal Display(LCD) - Memory Mapped Structure for LCD Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var LCD_T::CTL - * Offset: 0x00 LCD Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |LCD Display Enable Bit - * | | |0 = LCD display function Disabled - * | | |1 = LCD display function Enabled - * | | |Note 1: When software writes 1 to this bit, the LCD Controller needs some synchronizing time to completely enable the LCD display function. Before that, the read value of this bit is still 0. - * | | |Note 2: When software writes 0 to this bit, the LCD Controller needs some synchronizing time to completely disable the LCD display function. Before that, the read value of this bit is still 1. - * |[31] |SYNC |LCD Enable/Disable Synchronizing Indicator (Read Only) - * | | |When software writes 0/1 to EN bit (LCD_CTL[0]), the LCD Controller needs some synchronizing time to completely disable/enable the LCD display function. During this time, this bit keeps at 1. - * | | |0 = LCD display function is completely Disabled/Enabled - * | | |1 = LCD display function is not yet completely Disabled/Enabled - * | | |Note 1: The synchronizing time to enable LCD display function is not constant. It is between one and two cycles of LCD_CLK. - * | | |Note 2: The LCD display function cannot be disabled until the end of a frame. So the maximum synchronizing time to disable LCD display function could be as long as one frame time. - * @var LCD_T::PCTL - * Offset: 0x04 LCD Panel Control Registerr - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |BIAS |LCD Bias Level Selection - * | | |This field is used to select the bias level. - * | | |0 = Reserved - * | | |1 = 1/2 Bias - * | | |2 = 1/3 Bias - * | | |3 = 1/4 Bias - * |[4:2] |DUTY |LCD Duty Ratio Selection - * | | |This field is used to select the duty ratio. - * | | |0 = 1/1 Duty - * | | |1 = 1/2 Duty - * | | |2 = 1/3 Duty - * | | |3 = 1/4 Duty - * | | |4 = 1/5 Duty - * | | |5 = 1/6 Duty - * | | |6 = 1/7 Duty - * | | |7 = 1/8 Duty - * |[5] |TYPE |LCD Waveform Type Selection - * | | |This bit is used to select the waveform type. - * | | |0 = Type A - * | | |1 = Type B - * |[6] |INV |LCD Waveform Inverse - * | | |This bit is used to set the inverse LCD waveform. - * | | |0 = COM/SEG waveform is normal - * | | |1 = COM/SEG waveform is inversed - * |[17:8] |FREQDIV |LCD Operating Frequency Divider - * | | |The field is used to divide LCD_CLK to generate the LCD operating frequency. - * | | |LCD Operating Frequency = (LCD_CLK Frequency) / (FRRQDIV + 1). - * | | |Note 1: FREQDIV can be set from 0 to 1023, therefore, the fastest LCD operating frequency is equal to LCD_CLK frequency, - * | | |and the lowest LCD operating frequency is equal to LCD_CLK frequency divided by 1024. - * | | |Note 2: LCD frame rate is - * | | |(LCD Operating Frequency) x (Duty Ratio) x 1/2 for type A waveform, and - * | | |(LCD Operating Frequency) x (Duty Ratio) for type B waveform. - * | | |Example: Assume LCD operating frequency is 1 kHz, duty ratio is 1/4, then the LCD frame rate is - * | | |1 kHz x (1/4) x (1/2) = 128 Hz for type A waveform, and - * | | |1 kHz x (1/4) = 256 Hz for type B waveform. - * |[20:18] |CPVSEL |LCD Operating Voltage (VLCD) Select (For Charge Pump Only) - * | | |This field is used to select the LCD operating voltage. - * | | |0 = 2.6 V - * | | |1 = 2.8 V - * | | |2 = 3.0 V - * | | |3 = 3.2 V - * | | |4 = 3.4 V - * | | |5 = 3.6 V - * | | |Others = (Reserved) - * | | |Note: This field is meaningful only if the VLCD source is the charge pump. Otherwise, this field is ignored. - * |[27:24] |CPVTUNE |LCD Operating Voltage (VLCD) Fine Tuning (For Charge Pump Only) - * | | |This field is used to fine tune the LCD operating voltage. - * | | |0 = No tuning - * | | |1 = decrease by 1 unit of voltage - * | | |2 = decrease by 2 unit of voltage - * | | |3 = decrease by 3 unit of voltage - * | | |4 = decrease by 4 unit of voltage - * | | |5 = decrease by 5 unit of voltage - * | | |6 = decrease by 6 unit of voltage - * | | |7 = decrease by 7 unit of voltage - * | | |8 = increase by 8 units of voltage - * | | |9 = increase by 7 units of voltage - * | | |10 = increase by 6 units of voltage - * | | |11 = increase by 5 units of voltage - * | | |12 = increase by 4 units of voltage - * | | |13 = increase by 3 units of voltage - * | | |14 = increase by 2 units of voltage - * | | |15 = increase by 1 unit of voltage - * | | |Note 1: A unit of voltage is about 0.03 V. - * | | |Note 2: This field is meaningful only if the VLCD source is the charge pump. Otherwise, this field is ignored. - * @var LCD_T::FCTL - * Offset: 0x08 LCD Frame Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLINK |LCD Blinking Enable Bit - * | | |0 = LCD blinking function Disabled - * | | |1 = LCD blinking function Enabled - * |[17:8] |FCV |Frame Counting Value - * | | |This field indicates the maximum value that the frame counter can reach. - * | | |Note 1: The frame counter automatically increases by 1 at the end of every frame. When the counter reaches FCV, it will recounts from 0 at the end of the next frame. - * | | |At this moment, the hardware sets a dedicated flag to 1, and triggers a dedicated interrupt if it is enabled. - * | | |Note 2: For type B waveform, the frame counter increases at the end of odd frames, not even frames. - * |[27:24] |NFTIME |Null Frame Time - * | | |This field is used to configure the length of a null frame. - * | | |One null frame time is (1 / LCD_FREQ) x NFTIME. - * | | |Note: All COM and SEG output voltages are 0 V during a null frame. - * |[31:28] |NFNUM |Number of Frames Inserted By One Null Frame - * | | |This field is used to specify the number of continuous normal frames inserted by one null frame. - * | | |The number of continuous normal frames is (NFNUM + 1) frames. - * @var LCD_T::DCTL - * Offset: 0x0C LCD Driving Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |VSRC |LCD Operating Voltage (VLCD) Source - * | | |0 = VLCD Power - * | | |1 = AVDD Power - * | | |2 = Built-In Charge Pump - * | | |3 = None - * | | |Note: Whenever the LCD controller is disabled, all VLCD sources are automatically cut off. - * |[2] |RESMODE |Resistive Network Driving Mode - * | | |0 = Low-Drive Mode - * | | |1 = High-Drive Mode - * |[3] |BUFEN |Voltage Buffer Enable Bit - * | | |0 = Voltage Buffer Disabled - * | | |1 = Voltage Buffer Enabled - * | | |Note: When RESMODE = 1, the voltage buffers are automatically disabled. The setting of BUFEN bit is ignored. - * |[4] |PSVEN |Power Saving Mode Enable Bit - * | | |0 = Power Saving Mode Disabled - * | | |1 = Power Saving Mode Enabled - * | | |Note: when RESMODE = 0 and BUFEN = 0, the output drivers consumes the least driving current. In this case, the power saving mode is automatically disabled. The setting of PSVEN bit is ignored. - * |[5] |PSVREV |Power Saving Timing Reverse - * | | |When the timing is reversed, the original powe-saving period becomes no-power-saving, and the original no-power-saving period becomes power-saving. - * | | |0 = Timing of power saving is normal - * | | |1 = Timing of power saving is reversed - * |[11:8] |PSVT1 |Power Saving "Enable Time" Setting - * | | |The "Enable Time" of the power saving mode is calculated as "Enable Time" = 15.26 us x (PSVT1 + 1), - * | | |where 15.26 us is the half-cycle time of LCD_CLK, whose frequency is about 32 kHz. - * | | |PSVT1 can be set as 0, 1, 2, ..., 15, so the minimum "Enable Time" is about 15.26 us, and the maximum "Enable Time" is about 15.26 x 16 = 244.14 us. - * | | |Note: In the following two cases, the power saving mode is disabled. The setting of PSVT1 bits is ignored. - * | | |1. PSVEN = 0 - * | | |2. RESMODE = 0 and BUFEN = 0 - * |[15:12] |PSVT2 |Power Saving "On Time" Setting - * | | |The "On Time" of the power saving mode is calculated as "On Time" = 15.26 us x (PSVT2 + 1), - * | | |where 15.26 us is the half-cycle time of LCD_CLK, whose frequency is about 32 kHz. - * | | |PSVT2 can be set as 0, 1, 2, ..., 15, so the minimum "On Time" is about 15.26 us, and the maximum "On Time" is about 15.26 x 16 = 244.14 us. - * | | |Note: In the following two cases, the power saving mode is disabled. The setting of PSVT2 bits is ignored. - * | | |1. PSVEN = 0 - * |[28:16] |CTOTIME |Charging Timer Timeout Time - * | | |This field is used to specify the timeout value for the charging timer. When the charging timer reaches this timeout value, a status bit or an interrupt will occur. - * | | |The timeout is calculated by the following formula: Timeout = 30.52 us x (CTOTIME + 1), where 30.52 us is the cycle time of LCD_CLK, whose frequency is about 32 kHz. - * | | |CTOTIME can be set as 0, 1, 2, ..., 8191, so the minimum timeout is 30.52 us, and the maximum timeout is 30.52 x 8192 = 256 ms. - * @var LCD_T::PKGSEL - * Offset: 0x10 LCD Package Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PKG |Device Package Type Selection - * | | |0 = 128-Pin Package - * | | |1 = 64-Pin Package - * @var LCD_T::STS - * Offset: 0x14 LCD Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FCEF |End of Frame-Counting Flag - * | | |This flag is automatically set by hardware at the end of a frame, and the frame counter value must be equal to FCV (LCD_FCTL[17:8], Frame Counting Value). - * | | |0 = End of Frame-Counting did not occur - * | | |1 = End of Frame-Counting occurred - * | | |Note 1: User can clear this bit by writing 1 to it. - * | | |Note 2: For type B waveform, this flag is set only at the end of an odd frame. - * |[1] |FEF |End of Frame Flag - * | | |This flag is automatically set by hardware at the end of a frame. - * | | |0 = End of Frame did not occur - * | | |1 = End of Frame occurred - * | | |Note 1: User can clear this bit by writing 1 to it. - * | | |Note 2: For type B waveform, this flag is set only at the end of an odd frame. - * |[2] |CTOF |Charging Timeout Flag - * | | |This flag is automatically set by hardware when the charging timer reaches the timeout value. - * | | |0 = Charging Timeout did not occur - * | | |1 = Charging Timeout occurred - * | | |Note: User can clear this bit by writing 1 to it. - * |[28:16] |CTIME |Charging Timer Value (Read Only) - * | | |The field contains the value of the charging timer. It records the charging time of the charge pump. - * | | |The charging timer stops counting when the charge pump stops charging or a timeout occurs. At this moment, the hardware dumps the current charging timer value into this field. - * | | |Charging Time = 30.52 us x (CTIME + 1), where 30.52 us is the cycle time of LCD_CLK, whose frequency is about 32 kHz. - * @var LCD_T::INTEN - * Offset: 0x18 LCD Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FCEIEN |End of Frame-Counting Interrupt Enable Bit - * | | |An interrupt occurs at the end of a frame, and the frame counter value must be equal to FCV (LCD_FCTL[17:8], Frame Counting Value). - * | | |0 = End of Frame-Counting Interrupt Disabled - * | | |1 = End of Frame-Counting Interrupt Enabled - * | | |Note: For type B waveform, the interrupt occurs only at the end of an odd frame. - * |[1] |FEIEN |End of Frame Interrupt Enable Bit - * | | |An interrupt occurs at the end of a frame. - * | | |0 = End of Frame Interrupt Disabled - * | | |1 = End of Frame Interrupt Enabled - * | | |Note: For type B waveform, the interrupt occurs only at the end of an odd frame. - * |[2] |CTOIEN |Charging Timeout Interrupt Enable Bit - * | | |An interrupt occurs when the charging timer reaches the timeout value. - * | | |0 = Charging Timeout Interrupt Disabled - * | | |1 = Charging Timeout Interrupt Enabled - * @var LCD_T::DATA - * Offset: 0x20 LCD Segment Display Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x24 LCD Segment Display Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x28 LCD Segment Display Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x2C LCD Segment Display Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x30 LCD Segment Display Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x34 LCD Segment Display Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x38 LCD Segment Display Data Register 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x3C LCD Segment Display Data Register 7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x40 LCD Segment Display Data Register 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x44 LCD Segment Display Data Register 9 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - * Offset: 0x48 LCD Segment Display Data Register 10 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DD0 |Display Data of Segments S, where S is (4 x N) + 0, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD0 corresponds to SEG00, SEG04, SEG08, SEG12, SEG16, SEG20, SEG24, SEG28, SEG32, SEG36, and SEG40. - * | | |Note 2: Each bit, DD0[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD0 (= LCD_DATA07[7:0]) = 1001_0110, LCD_DATA07[7:0] corresponds to SEG28 (4 x 7 + 0 = 28), - * | | |the pixel SEG28-COM0 is light (LCD_DATA07[0] = 0), - * | | |the pixel SEG28-COM1 is dark (LCD_DATA07[1] = 1), - * | | |the pixel SEG28-COM2 is dark (LCD_DATA07[2] = 1), - * | | |the pixel SEG28-COM3 is light (LCD_DATA07[3] = 0), - * | | |LCD_DATA07[7:4] are ignored, since COMs from 4 to 7 are not used. - * |[15:8] |DD1 |Display Data of Segments S, where S is (4 x N) + 1, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD1 corresponds to SEG01, SEG05, SEG09, SEG13, SEG17, SEG21, SEG25, SEG29, SEG33, SEG37, and SEG41. - * | | |Note 2: Each bit, DD1[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD1 (= LCD_DATA07[15:8]) = 1001_0110, LCD_DATA07[15:8] corresponds to SEG29 (4 x 7 + 1 = 29), - * | | |the pixel SEG29-COM0 is light (LCD_DATA07[8] = 0), - * | | |the pixel SEG29-COM1 is dark (LCD_DATA07[9] = 1), - * | | |the pixel SEG29-COM2 is dark (LCD_DATA07[10] = 1), - * | | |the pixel SEG29-COM3 is light (LCD_DATA07[11] = 0), - * | | |LCD_DATA07[15:12] are ignored, since COMs from 4 to 7 are not used. - * |[23:16] |DD2 |Display Data of Segments S, where S is (4 x N) + 2, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD2 corresponds to SEG02, SEG06, SEG10, SEG14, SEG18, SEG22, SEG26, SEG30, SEG34, SEG38, and SEG42. - * | | |Note 2: Each bit, DD2[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD2 (= LCD_DATA07[23:16]) = 1001_0110, LCD_DATA07[23:16] corresponds to SEG31 (4 x 7 + 2 = 30), - * | | |the pixel SEG30-COM0 is light (LCD_DATA07[16] = 0), - * | | |the pixel SEG30-COM1 is dark (LCD_DATA07[17] = 1), - * | | |the pixel SEG30-COM2 is dark (LCD_DATA07[18] = 1), - * | | |the pixel SEG30-COM3 is light (LCD_DATA07[19] = 0), - * | | |LCD_DATA07[23:20] are ignored, since COMs from 4 to 7 are not used. - * |[31:24] |DD3 |Display Data of Segments S, where S is (4 x N) + 3, and N is 0, 1, 2, ..., 10 - * | | |Each bit specifies the brightness of each pixel in a segment. - * | | |0 = The pixel is light - * | | |1 = The pixel is dark - * | | |Note 1: DD3 corresponds to SEG03, SEG07, SEG11, SEG15, SEG19, SEG23, SEG27, SEG31, SEG35, SEG39, and SEG43. - * | | |Note 2: Each bit, DD3[n], corresponds to COMn, n= 0 ~ 7. - * | | |[Example] Assume 1/4 Duty, and DD3 (= LCD_DATA07[31:24]) = 1001_0110, LCD_DATA07[31:24] corresponds to SEG31 (4 x 7 + 3 = 31), - * | | |the pixel SEG31-COM0 is light (LCD_DATA07[24] = 0), - * | | |the pixel SEG31-COM1 is dark (LCD_DATA07[25] = 1), - * | | |the pixel SEG31-COM2 is dark (LCD_DATA07[26] = 1), - * | | |the pixel SEG31-COM3 is light (LCD_DATA07[27] = 0), - * | | |LCD_DATA07[31:28] are ignored, since COMs from 4 to 7 are not used. - */ - __IO uint32_t CTL; /*!< [0x0000] LCD Control Register */ - __IO uint32_t PCTL; /*!< [0x0004] LCD Panel Control Register */ - __IO uint32_t FCTL; /*!< [0x0008] LCD Frame Control Register */ - __IO uint32_t DCTL; /*!< [0x000C] LCD Driving Control Register */ - __IO uint32_t PKGSEL; /*!< [0x0010] LCD Package Selection Register */ - __IO uint32_t STS; /*!< [0x0014] LCD Status Register */ - __IO uint32_t INTEN; /*!< [0x0018] LCD Interrupt Enable Register */ - __I uint32_t RESERVED0; /*!< [0x001C] Reserved 0 */ - __IO uint32_t DATA[11]; /*!< [0x0020] ~ [0x0048] LCD Segment Display Data Register 0 ~ 10 */ - -} LCD_T; - -/** - @addtogroup LCD_CONST LCD Bit Field Definition - Constant Definitions for LCD Controller - @{ -*/ - -#define LCD_CTL_EN_Pos (0) /*!< LCD_T::CTL: EN Position */ -#define LCD_CTL_EN_Msk (0x1ul << LCD_CTL_EN_Pos) /*!< LCD_T::CTL: EN Mask */ - -#define LCD_CTL_SYNC_Pos (31) /*!< LCD_T::CTL: SYNC Position */ -#define LCD_CTL_SYNC_Msk (0x1ul << LCD_CTL_SYNC_Pos) /*!< LCD_T::CTL: SYNC Mask */ - -#define LCD_PCTL_BIAS_Pos (0) /*!< LCD_T::PCTL: BIAS Position */ -#define LCD_PCTL_BIAS_Msk (0x3ul << LCD_PCTL_BIAS_Pos) /*!< LCD_T::PCTL: BIAS Mask */ - -#define LCD_PCTL_DUTY_Pos (2) /*!< LCD_T::PCTL: DUTY Position */ -#define LCD_PCTL_DUTY_Msk (0x7ul << LCD_PCTL_DUTY_Pos) /*!< LCD_T::PCTL: DUTY Mask */ - -#define LCD_PCTL_TYPE_Pos (5) /*!< LCD_T::PCTL: TYPE Position */ -#define LCD_PCTL_TYPE_Msk (0x1ul << LCD_PCTL_TYPE_Pos) /*!< LCD_T::PCTL: TYPE Mask */ - -#define LCD_PCTL_INV_Pos (6) /*!< LCD_T::PCTL: INV Position */ -#define LCD_PCTL_INV_Msk (0x1ul << LCD_PCTL_INV_Pos) /*!< LCD_T::PCTL: INV Mask */ - -#define LCD_PCTL_FREQDIV_Pos (8) /*!< LCD_T::PCTL: FREQDIV Position */ -#define LCD_PCTL_FREQDIV_Msk (0x3fful << LCD_PCTL_FREQDIV_Pos) /*!< LCD_T::PCTL: FREQDIV Mask */ - -#define LCD_PCTL_CPVSEL_Pos (18) /*!< LCD_T::PCTL: CPVSEL Position */ -#define LCD_PCTL_CPVSEL_Msk (0x7ul << LCD_PCTL_CPVSEL_Pos) /*!< LCD_T::PCTL: CPVSEL Mask */ - -#define LCD_PCTL_CPVTUNE_Pos (24) /*!< LCD_T::PCTL: CPVTUNE Position */ -#define LCD_PCTL_CPVTUNE_Msk (0xful << LCD_PCTL_CPVTUNE_Pos) /*!< LCD_T::PCTL: CPVTUNE Mask */ - -#define LCD_FCTL_BLINK_Pos (0) /*!< LCD_T::FCTL: BLINK Position */ -#define LCD_FCTL_BLINK_Msk (0x1ul << LCD_FCTL_BLINK_Pos) /*!< LCD_T::FCTL: BLINK Mask */ - -#define LCD_FCTL_FCV_Pos (8) /*!< LCD_T::FCTL: FCV Position */ -#define LCD_FCTL_FCV_Msk (0x3fful << LCD_FCTL_FCV_Pos) /*!< LCD_T::FCTL: FCV Mask */ - -#define LCD_FCTL_NFTIME_Pos (24) /*!< LCD_T::FCTL: NFTIME Position */ -#define LCD_FCTL_NFTIME_Msk (0xful << LCD_FCTL_NFTIME_Pos) /*!< LCD_T::FCTL: NFTIME Mask */ - -#define LCD_FCTL_NFNUM_Pos (28) /*!< LCD_T::FCTL: NFNUM Position */ -#define LCD_FCTL_NFNUM_Msk (0xful << LCD_FCTL_NFNUM_Pos) /*!< LCD_T::FCTL: NFNUM Mask */ - -#define LCD_DCTL_VSRC_Pos (0) /*!< LCD_T::DCTL: VSRC Position */ -#define LCD_DCTL_VSRC_Msk (0x3ul << LCD_DCTL_VSRC_Pos) /*!< LCD_T::DCTL: VSRC Mask */ - -#define LCD_DCTL_RESMODE_Pos (2) /*!< LCD_T::DCTL: RESMODE Position */ -#define LCD_DCTL_RESMODE_Msk (0x1ul << LCD_DCTL_RESMODE_Pos) /*!< LCD_T::DCTL: RESMODE Mask */ - -#define LCD_DCTL_BUFEN_Pos (3) /*!< LCD_T::DCTL: BUFEN Position */ -#define LCD_DCTL_BUFEN_Msk (0x1ul << LCD_DCTL_BUFEN_Pos) /*!< LCD_T::DCTL: BUFEN Mask */ - -#define LCD_DCTL_PSVEN_Pos (4) /*!< LCD_T::DCTL: PSVEN Position */ -#define LCD_DCTL_PSVEN_Msk (0x1ul << LCD_DCTL_PSVEN_Pos) /*!< LCD_T::DCTL: PSVEN Mask */ - -#define LCD_DCTL_PSVREV_Pos (5) /*!< LCD_T::DCTL: PSVREV Position */ -#define LCD_DCTL_PSVREV_Msk (0x1ul << LCD_DCTL_PSVREV_Pos) /*!< LCD_T::DCTL: PSVREV Mask */ - -#define LCD_DCTL_PSVT1_Pos (8) /*!< LCD_T::DCTL: PSVT1 Position */ -#define LCD_DCTL_PSVT1_Msk (0xful << LCD_DCTL_PSVT1_Pos) /*!< LCD_T::DCTL: PSVT1 Mask */ - -#define LCD_DCTL_PSVT2_Pos (12) /*!< LCD_T::DCTL: PSVT2 Position */ -#define LCD_DCTL_PSVT2_Msk (0xful << LCD_DCTL_PSVT2_Pos) /*!< LCD_T::DCTL: PSVT2 Mask */ - -#define LCD_DCTL_CTOTIME_Pos (16) /*!< LCD_T::DCTL: CTOTIME Position */ -#define LCD_DCTL_CTOTIME_Msk (0x1ffful << LCD_DCTL_CTOTIME_Pos) /*!< LCD_T::DCTL: CTOTIME Mask */ - -#define LCD_PKGSEL_PKG_Pos (0) /*!< LCD_T::PKGSEL: PKG Position */ -#define LCD_PKGSEL_PKG_Msk (0x1ul << LCD_PKGSEL_PKG_Pos) /*!< LCD_T::PKGSEL: PKG Mask */ - -#define LCD_STS_FCEF_Pos (0) /*!< LCD_T::STS: FCEF Position */ -#define LCD_STS_FCEF_Msk (0x1ul << LCD_STS_FCEF_Pos) /*!< LCD_T::STS: FCEF Mask */ - -#define LCD_STS_FEF_Pos (1) /*!< LCD_T::STS: FEF Position */ -#define LCD_STS_FEF_Msk (0x1ul << LCD_STS_FEF_Pos) /*!< LCD_T::STS: FEF Mask */ - -#define LCD_STS_CTOF_Pos (2) /*!< LCD_T::STS: CTOF Position */ -#define LCD_STS_CTOF_Msk (0x1ul << LCD_STS_CTOF_Pos) /*!< LCD_T::STS: CTOF Mask */ - -#define LCD_STS_CTIME_Pos (16) /*!< LCD_T::STS: CTIME Position */ -#define LCD_STS_CTIME_Msk (0x1ffful << LCD_STS_CTIME_Pos) /*!< LCD_T::STS: CTIME Mask */ - -#define LCD_INTEN_FCEIEN_Pos (0) /*!< LCD_T::INTEN: FCEIEN Position */ -#define LCD_INTEN_FCEIEN_Msk (0x1ul << LCD_INTEN_FCEIEN_Pos) /*!< LCD_T::INTEN: FCEIEN Mask */ - -#define LCD_INTEN_FEIEN_Pos (1) /*!< LCD_T::INTEN: FEIEN Position */ -#define LCD_INTEN_FEIEN_Msk (0x1ul << LCD_INTEN_FEIEN_Pos) /*!< LCD_T::INTEN: FEIEN Mask */ - -#define LCD_INTEN_CTOIEN_Pos (2) /*!< LCD_T::INTEN: CYOIEN Position */ -#define LCD_INTEN_CTOIEN_Msk (0x1ul << LCD_INTEN_CTOIEN_Pos) /*!< LCD_T::INTEN: CTOIEN Mask */ - -#define LCD_DATA00_DD0_Pos (0) /*!< LCD_T::DATA00: DD0 Position */ -#define LCD_DATA00_DD0_Msk (0xfful << LCD_DATA00_DD0_Pos) /*!< LCD_T::DATA00: DD0 Mask */ - -#define LCD_DATA00_DD1_Pos (8) /*!< LCD_T::DATA00: DD1 Position */ -#define LCD_DATA00_DD1_Msk (0xfful << LCD_DATA00_DD1_Pos) /*!< LCD_T::DATA00: DD1 Mask */ - -#define LCD_DATA00_DD2_Pos (16) /*!< LCD_T::DATA00: DD2 Position */ -#define LCD_DATA00_DD2_Msk (0xfful << LCD_DATA00_DD2_Pos) /*!< LCD_T::DATA00: DD2 Mask */ - -#define LCD_DATA00_DD3_Pos (24) /*!< LCD_T::DATA00: DD3 Position */ -#define LCD_DATA00_DD3_Msk (0xfful << LCD_DATA00_DD3_Pos) /*!< LCD_T::DATA00: DD3 Mask */ - -#define LCD_DATA01_DD0_Pos (0) /*!< LCD_T::DATA01: DD0 Position */ -#define LCD_DATA01_DD0_Msk (0xfful << LCD_DATA01_DD0_Pos) /*!< LCD_T::DATA01: DD0 Mask */ - -#define LCD_DATA01_DD1_Pos (8) /*!< LCD_T::DATA01: DD1 Position */ -#define LCD_DATA01_DD1_Msk (0xfful << LCD_DATA01_DD1_Pos) /*!< LCD_T::DATA01: DD1 Mask */ - -#define LCD_DATA01_DD2_Pos (16) /*!< LCD_T::DATA01: DD2 Position */ -#define LCD_DATA01_DD2_Msk (0xfful << LCD_DATA01_DD2_Pos) /*!< LCD_T::DATA01: DD2 Mask */ - -#define LCD_DATA01_DD3_Pos (24) /*!< LCD_T::DATA01: DD3 Position */ -#define LCD_DATA01_DD3_Msk (0xfful << LCD_DATA01_DD3_Pos) /*!< LCD_T::DATA01: DD3 Mask */ - -#define LCD_DATA02_DD0_Pos (0) /*!< LCD_T::DATA02: DD0 Position */ -#define LCD_DATA02_DD0_Msk (0xfful << LCD_DATA02_DD0_Pos) /*!< LCD_T::DATA02: DD0 Mask */ - -#define LCD_DATA02_DD1_Pos (8) /*!< LCD_T::DATA02: DD1 Position */ -#define LCD_DATA02_DD1_Msk (0xfful << LCD_DATA02_DD1_Pos) /*!< LCD_T::DATA02: DD1 Mask */ - -#define LCD_DATA02_DD2_Pos (16) /*!< LCD_T::DATA02: DD2 Position */ -#define LCD_DATA02_DD2_Msk (0xfful << LCD_DATA02_DD2_Pos) /*!< LCD_T::DATA02: DD2 Mask */ - -#define LCD_DATA02_DD3_Pos (24) /*!< LCD_T::DATA02: DD3 Position */ -#define LCD_DATA02_DD3_Msk (0xfful << LCD_DATA02_DD3_Pos) /*!< LCD_T::DATA02: DD3 Mask */ - -#define LCD_DATA03_DD0_Pos (0) /*!< LCD_T::DATA03: DD0 Position */ -#define LCD_DATA03_DD0_Msk (0xfful << LCD_DATA03_DD0_Pos) /*!< LCD_T::DATA03: DD0 Mask */ - -#define LCD_DATA03_DD1_Pos (8) /*!< LCD_T::DATA03: DD1 Position */ -#define LCD_DATA03_DD1_Msk (0xfful << LCD_DATA03_DD1_Pos) /*!< LCD_T::DATA03: DD1 Mask */ - -#define LCD_DATA03_DD2_Pos (16) /*!< LCD_T::DATA03: DD2 Position */ -#define LCD_DATA03_DD2_Msk (0xfful << LCD_DATA03_DD2_Pos) /*!< LCD_T::DATA03: DD2 Mask */ - -#define LCD_DATA03_DD3_Pos (24) /*!< LCD_T::DATA03: DD3 Position */ -#define LCD_DATA03_DD3_Msk (0xfful << LCD_DATA03_DD3_Pos) /*!< LCD_T::DATA03: DD3 Mask */ - -#define LCD_DATA04_DD0_Pos (0) /*!< LCD_T::DATA04: DD0 Position */ -#define LCD_DATA04_DD0_Msk (0xfful << LCD_DATA04_DD0_Pos) /*!< LCD_T::DATA04: DD0 Mask */ - -#define LCD_DATA04_DD1_Pos (8) /*!< LCD_T::DATA04: DD1 Position */ -#define LCD_DATA04_DD1_Msk (0xfful << LCD_DATA04_DD1_Pos) /*!< LCD_T::DATA04: DD1 Mask */ - -#define LCD_DATA04_DD2_Pos (16) /*!< LCD_T::DATA04: DD2 Position */ -#define LCD_DATA04_DD2_Msk (0xfful << LCD_DATA04_DD2_Pos) /*!< LCD_T::DATA04: DD2 Mask */ - -#define LCD_DATA04_DD3_Pos (24) /*!< LCD_T::DATA04: DD3 Position */ -#define LCD_DATA04_DD3_Msk (0xfful << LCD_DATA04_DD3_Pos) /*!< LCD_T::DATA04: DD3 Mask */ - -#define LCD_DATA05_DD0_Pos (0) /*!< LCD_T::DATA05: DD0 Position */ -#define LCD_DATA05_DD0_Msk (0xfful << LCD_DATA05_DD0_Pos) /*!< LCD_T::DATA05: DD0 Mask */ - -#define LCD_DATA05_DD1_Pos (8) /*!< LCD_T::DATA05: DD1 Position */ -#define LCD_DATA05_DD1_Msk (0xfful << LCD_DATA05_DD1_Pos) /*!< LCD_T::DATA05: DD1 Mask */ - -#define LCD_DATA05_DD2_Pos (16) /*!< LCD_T::DATA05: DD2 Position */ -#define LCD_DATA05_DD2_Msk (0xfful << LCD_DATA05_DD2_Pos) /*!< LCD_T::DATA05: DD2 Mask */ - -#define LCD_DATA05_DD3_Pos (24) /*!< LCD_T::DATA05: DD3 Position */ -#define LCD_DATA05_DD3_Msk (0xfful << LCD_DATA05_DD3_Pos) /*!< LCD_T::DATA05: DD3 Mask */ - -#define LCD_DATA06_DD0_Pos (0) /*!< LCD_T::DATA06: DD0 Position */ -#define LCD_DATA06_DD0_Msk (0xfful << LCD_DATA06_DD0_Pos) /*!< LCD_T::DATA06: DD0 Mask */ - -#define LCD_DATA06_DD1_Pos (8) /*!< LCD_T::DATA06: DD1 Position */ -#define LCD_DATA06_DD1_Msk (0xfful << LCD_DATA06_DD1_Pos) /*!< LCD_T::DATA06: DD1 Mask */ - -#define LCD_DATA06_DD2_Pos (16) /*!< LCD_T::DATA06: DD2 Position */ -#define LCD_DATA06_DD2_Msk (0xfful << LCD_DATA06_DD2_Pos) /*!< LCD_T::DATA06: DD2 Mask */ - -#define LCD_DATA06_DD3_Pos (24) /*!< LCD_T::DATA06: DD3 Position */ -#define LCD_DATA06_DD3_Msk (0xfful << LCD_DATA06_DD3_Pos) /*!< LCD_T::DATA06: DD3 Mask */ - -#define LCD_DATA07_DD0_Pos (0) /*!< LCD_T::DATA07: DD0 Position */ -#define LCD_DATA07_DD0_Msk (0xfful << LCD_DATA07_DD0_Pos) /*!< LCD_T::DATA07: DD0 Mask */ - -#define LCD_DATA07_DD1_Pos (8) /*!< LCD_T::DATA07: DD1 Position */ -#define LCD_DATA07_DD1_Msk (0xfful << LCD_DATA07_DD1_Pos) /*!< LCD_T::DATA07: DD1 Mask */ - -#define LCD_DATA07_DD2_Pos (16) /*!< LCD_T::DATA07: DD2 Position */ -#define LCD_DATA07_DD2_Msk (0xfful << LCD_DATA07_DD2_Pos) /*!< LCD_T::DATA07: DD2 Mask */ - -#define LCD_DATA07_DD3_Pos (24) /*!< LCD_T::DATA07: DD3 Position */ -#define LCD_DATA07_DD3_Msk (0xfful << LCD_DATA07_DD3_Pos) /*!< LCD_T::DATA07: DD3 Mask */ - -#define LCD_DATA08_DD0_Pos (0) /*!< LCD_T::DATA08: DD0 Position */ -#define LCD_DATA08_DD0_Msk (0xfful << LCD_DATA08_DD0_Pos) /*!< LCD_T::DATA08: DD0 Mask */ - -#define LCD_DATA08_DD1_Pos (8) /*!< LCD_T::DATA08: DD1 Position */ -#define LCD_DATA08_DD1_Msk (0xfful << LCD_DATA08_DD1_Pos) /*!< LCD_T::DATA08: DD1 Mask */ - -#define LCD_DATA08_DD2_Pos (16) /*!< LCD_T::DATA08: DD2 Position */ -#define LCD_DATA08_DD2_Msk (0xfful << LCD_DATA08_DD2_Pos) /*!< LCD_T::DATA08: DD2 Mask */ - -#define LCD_DATA08_DD3_Pos (24) /*!< LCD_T::DATA08: DD3 Position */ -#define LCD_DATA08_DD3_Msk (0xfful << LCD_DATA08_DD3_Pos) /*!< LCD_T::DATA08: DD3 Mask */ - -#define LCD_DATA09_DD0_Pos (0) /*!< LCD_T::DATA09: DD0 Position */ -#define LCD_DATA09_DD0_Msk (0xfful << LCD_DATA09_DD0_Pos) /*!< LCD_T::DATA09: DD0 Mask */ - -#define LCD_DATA09_DD1_Pos (8) /*!< LCD_T::DATA09: DD1 Position */ -#define LCD_DATA09_DD1_Msk (0xfful << LCD_DATA09_DD1_Pos) /*!< LCD_T::DATA09: DD1 Mask */ - -#define LCD_DATA09_DD2_Pos (16) /*!< LCD_T::DATA09: DD2 Position */ -#define LCD_DATA09_DD2_Msk (0xfful << LCD_DATA09_DD2_Pos) /*!< LCD_T::DATA09: DD2 Mask */ - -#define LCD_DATA09_DD3_Pos (24) /*!< LCD_T::DATA09: DD3 Position */ -#define LCD_DATA09_DD3_Msk (0xfful << LCD_DATA09_DD3_Pos) /*!< LCD_T::DATA09: DD3 Mask */ - -#define LCD_DATA10_DD0_Pos (0) /*!< LCD_T::DATA10: DD0 Position */ -#define LCD_DATA10_DD0_Msk (0xfful << LCD_DATA10_DD0_Pos) /*!< LCD_T::DATA10: DD0 Mask */ - -#define LCD_DATA10_DD1_Pos (8) /*!< LCD_T::DATA10: DD1 Position */ -#define LCD_DATA10_DD1_Msk (0xfful << LCD_DATA10_DD1_Pos) /*!< LCD_T::DATA10: DD1 Mask */ - -#define LCD_DATA10_DD2_Pos (16) /*!< LCD_T::DATA10: DD2 Position */ -#define LCD_DATA10_DD2_Msk (0xfful << LCD_DATA10_DD2_Pos) /*!< LCD_T::DATA10: DD2 Mask */ - -#define LCD_DATA10_DD3_Pos (24) /*!< LCD_T::DATA10: DD3 Position */ -#define LCD_DATA10_DD3_Msk (0xfful << LCD_DATA10_DD3_Pos) /*!< LCD_T::DATA10: DD3 Mask */ - -/**@}*/ /* LCD_CONST */ -/**@}*/ /* end of LCD register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __LCD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/otg_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/otg_reg.h deleted file mode 100644 index 1c7274bf937..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/otg_reg.h +++ /dev/null @@ -1,394 +0,0 @@ -/**************************************************************************//** - * @file otg_reg.h - * @version V1.00 - * @brief OTG register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __OTG_REG_H__ -#define __OTG_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- USB On-The-Go Controller -------------------------*/ -/** - @addtogroup OTG USB On-The-Go Controller(OTG) - Memory Mapped Structure for OTG Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var OTG_T::CTL - * Offset: 0x00 OTG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDROP |Drop VBUS Control - * | | |If user application running on this OTG A-device wants to conserve power, set this bit to drop VBUS - * | | |BUSREQ (OTG_CTL[1]) will be also cleared no matter A-device or B-device. - * | | |0 = Not drop the VBUS. - * | | |1 = Drop the VBUS. - * |[1] |BUSREQ |OTG Bus Request - * | | |If OTG A-device wants to do data transfers via USB bus, setting this bit will drive VBUS high to detect USB device connection - * | | |If user won't use the bus any more, clearing this bit will drop VBUS to save power - * | | |This bit will be cleared when A-device goes to A_wait_vfall state - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set or IDSTS (OTG_STATUS[1]) changed. - * | | |If user of an OTG-B Device wants to request VBUS, setting this bit will run SRP protocol - * | | |This bit will be cleared if SRP failure (OTG A-device does not provide VBUS after B-device issues SRP in specified interval, defined in OTG specification) - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set or IDSTS (OTG_STATUS[1]) changed. - * | | |0 = Not launch VBUS in OTG A-device or not request SRP in OTG B-device. - * | | |1 = Launch VBUS in OTG A-device or request SRP in OTG B-device. - * |[2] |HNPREQEN |OTG HNP Request Enable Bit - * | | |When USB frame as A-device, set this bit when A-device allows to process HNP protocol -- A-device changes role from Host to Peripheral - * | | |This bit will be cleared when OTG state changes from a_suspend to a_peripheral or goes back to a_idle state - * | | |When USB frame as B-device, set this bit after the OTG A-device successfully sends a SetFeature (b_hnp_enable) command to the OTG B-device to start role change -- B-device changes role from Peripheral to Host - * | | |This bit will be cleared when OTG state changes from b_peripheral to b_wait_acon or goes back to b_idle state. - * | | |0 = HNP request Disabled. - * | | |1 = HNP request Enabled (A-device can change role from Host to Peripheral or B-device can change role from Peripheral to Host). - * | | |Note: Refer to OTG specification to get a_suspend, a_peripheral, a_idle and b_idle state. - * |[4] |OTGEN |OTG Function Enable Bit - * | | |User needs to set this bit to enable OTG function while USB frame configured as OTG device - * | | |When USB frame is not configured as OTG device, this bit must be low. - * | | |0= OTG function Disabled. - * | | |1 = OTG function Enabled. - * |[5] |WKEN |OTG ID Pin Wake-up Enable Bit - * | | |0 = OTG ID pin status change wake-up function Disabled. - * | | |1 = OTG ID pin status change wake-up function Enabled. - * @var OTG_T::PHYCTL - * Offset: 0x04 OTG PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OTGPHYEN |OTG PHY Enable Bit - * | | |When USB frame is configured as OTG device or ID dependent, user needs to set this bit before using OTG function - * | | |If device is not configured as OTG device nor ID dependent , this bit is "don't care". - * | | |0 = OTG PHY Disabled. - * | | |1 = OTG PHY Enabled. - * |[1] |IDDETEN |ID Detection Enable Bit - * | | |0 = Detect ID pin status Disabled. - * | | |1 = Detect ID pin status Enabled. - * |[4] |VBENPOL |Off-chip USB VBUS Power Switch Enable Polarity - * | | |The OTG controller will enable off-chip USB VBUS power switch to provide VBUS power when need - * | | |A USB_VBUS_EN pin is used to control the off-chip USB VBUS power switch. - * | | |The polarity of enabling off-chip USB VBUS power switch (high active or low active) depends on the selected component - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The off-chip USB VBUS power switch enable is active high. - * | | |1 = The off-chip USB VBUS power switch enable is active low. - * |[5] |VBSTSPOL |Off-chip USB VBUS Power Switch Status Polarity - * | | |The polarity of off-chip USB VBUS power switch valid signal depends on the selected component - * | | |A USB_VBUS_ST pin is used to monitor the valid signal of the off-chip USB VBUS power switch - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The polarity of off-chip USB VBUS power switch valid status is high. - * | | |1 = The polarity of off-chip USB VBUS power switch valid status is low. - * @var OTG_T::INTEN - * Offset: 0x08 OTG Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIEN|Role (Host or Peripheral) Changed Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[1] |VBEIEN |VBUS Error Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: VBUS error means going to a_vbus_err state. Please refer to A-device state diagram in OTG specification. - * |[2] |SRPFIEN |SRP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[3] |HNPFIEN |HNP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[4] |GOIDLEIEN |OTG Device Goes to IDLE State Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Going to idle state means going to a_idle or b_idle state - * | | |Please refer to A-device state diagram and B-device state diagram in OTG spec. - * |[5] |IDCHGIEN |IDSTS Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and IDSTS (OTG_STATUS[1]) status is changed from high to low or from low to high, an interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[6] |PDEVIEN |Act As Peripheral Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a peripheral, an interrupt will be asserted. - * | | |0 = This device as a peripheral interrupt Disabled. - * | | |1 = This device as a peripheral interrupt Enabled. - * |[7] |HOSTIEN |Act As Host Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a host, an interrupt will be asserted. - * | | |0 = This device as a host interrupt Disabled. - * | | |1 = This device as a host interrupt Enabled. - * |[8] |BVLDCHGIEN|B-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and BVLD (OTG_STATUS[3]) status is changed from high to low or from low to high, an interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[9] |AVLDCHGIEN|A-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and AVLD (OTG_STATUS[4]) status is changed from high to low or from low to high, an interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[10] |VBCHGIEN |VBUSVLD Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and VBUSVLD (OTG_STATUS[5]) status is changed from high to low or from low to high, an interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[11] |SECHGIEN |SESSEND Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and SESSEND (OTG_STATUS[2]) status is changed from high to low or from low to high, an interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[13] |SRPDETIEN |SRP Detected Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * @var OTG_T::INTSTS - * Offset: 0x0C OTG Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIF |OTG Role Change Interrupt Status - * | | |This flag is set when the role of an OTG device changed from a host to a peripheral, or changed from a peripheral to a host while USB_ID pin status does not change. - * | | |0 = OTG device role not changed. - * | | |1 = OTG device role changed. - * | | |Note: Write 1 to clear this flag. - * |[1] |VBEIF |VBUS Error Interrupt Status - * | | |This bit will be set when voltage on VBUS cannot reach a minimum valid threshold 4.4V within a maximum time of 100ms after OTG A-device starting to drive VBUS high. - * | | |0 = OTG A-device drives VBUS over threshold voltage before this interval expires. - * | | |1 = OTG A-device cannot drive VBUS over threshold voltage before this interval expires. - * | | |Note: Write 1 to clear this flag and recover from the VBUS error state. - * |[2] |SRPFIF |SRP Fail Interrupt Status - * | | |After initiating SRP, an OTG B-device will wait for the OTG A-device to drive VBUS high at least TB_SRP_FAIL minimum, defined in OTG specification - * | | |This flag is set when the OTG B-device does not get VBUS high after this interval. - * | | |0 = OTG B-device gets VBUS high before this interval. - * | | |1 = OTG B-device does not get VBUS high before this interval. - * | | |Note: Write 1 to clear this flag. - * |[3] |HNPFIF |HNP Fail Interrupt Status - * | | |When A-device has granted B-device to be host and USB bus is in SE0 (both USB_D+ and USB_D- low) state, this bit will be set when A-device does not connect after specified interval expires. - * | | |0 = A-device connects to B-device before specified interval expires. - * | | |1 = A-device does not connect to B-device before specified interval expires. - * | | |Note: Write 1 to clear this flag. - * |[4] |GOIDLEIF |OTG Device Goes to IDLE Interrupt Status - * | | |Flag is set if the OTG device transfers from non-idle state to idle state - * | | |The OTG device will be neither a host nor a peripheral. - * | | |0 = OTG device does not go back to idle state (a_idle or b_idle). - * | | |1 = OTG device goes back to idle state(a_idle or b_idle). - * | | |Note 1: Going to idle state means going to a_idle or b_idle state. Please refer to OTG specification. - * | | |Note 2: Write 1 to clear this flag. - * |[5] |IDCHGIF |ID State Change Interrupt Status - * | | |0 = IDSTS (OTG_STATUS[1]) not toggled. - * | | |1 = IDSTS (OTG_STATUS[1]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[6] |PDEVIF |Act As Peripheral Interrupt Status - * | | |0= This device does not act as a peripheral. - * | | |1 = This device acts as a peripheral. - * | | |Note: Write 1 to clear this flag. - * |[7] |HOSTIF |Act As Host Interrupt Status - * | | |0= This device does not act as a host. - * | | |1 = This device acts as a host. - * | | |Note: Write 1 to clear this flag. - * |[8] |BVLDCHGIF |B-device Session Valid State Change Interrupt Status - * | | |0 = BVLD (OTG_STATUS[3]) is not toggled. - * | | |1 = BVLD (OTG_STATUS[3]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[9] |AVLDCHGIF |A-device Session Valid State Change Interrupt Status - * | | |0 = AVLD (OTG_STATUS[4]) not toggled. - * | | |1 = AVLD (OTG_STATUS[4]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[10] |VBCHGIF |VBUSVLD State Change Interrupt Status - * | | |0 = VBUSVLD (OTG_STATUS[5]) not toggled. - * | | |1 = VBUSVLD (OTG_STATUS[5]) from high to low or from low to high. - * | | |Note: Write 1 to clear this status. - * |[11] |SECHGIF |SESSEND State Change Interrupt Status - * | | |0 = SESSEND (OTG_STATUS[2]) not toggled. - * | | |1 = SESSEND (OTG_STATUS[2]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[13] |SRPDETIF |SRP Detected Interrupt Status - * | | |0 = SRP not detected. - * | | |1 = SRP detected. - * | | |Note: Write 1 to clear this status. - * @var OTG_T::STATUS - * Offset: 0x10 OTG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OVERCUR |Over Current Condition - * | | |The voltage on VBUS cannot reach a minimum VBUS valid threshold, 4.4V minimum, within a maximum time of 100ms after OTG A-device drives VBUS high. - * | | |0 = OTG A-device drives VBUS successfully. - * | | |1 = OTG A-device cannot drives VBUS high in this interval. - * |[1] |IDSTS |USB_ID Pin State of Mini-/Micro- Plug - * | | |0 = Mini-A/Micro-A plug is attached. - * | | |1 = Mini-B/Micro-B plug is attached. - * |[2] |SESSEND |Session End Status - * | | |When VBUS voltage is lower than 0.4V, this bit will be set to 1 - * | | |Session end means no meaningful power on VBUS. - * | | |0 = Session is not end. - * | | |1 = Session is end. - * |[3] |BVLD |B-device Session Valid Status - * | | |0 = B-device session is not valid. - * | | |1 = B-device session is valid. - * |[4] |AVLD |A-device Session Valid Status - * | | |0 = A-device session is not valid. - * | | |1 = A-device session is valid. - * |[5] |VBUSVLD |VBUS Valid Status - * | | |When VBUS is larger than 4.7V, this bit will be set to 1. - * | | |0 = VBUS is not valid. - * | | |1 = VBUS is valid. - * |[6] |ASPERI |As Peripheral Status - * | | |When OTG as peripheral, this bit is set. - * | | |0: OTG not as peripheral - * | | |1: OTG as peripheral - * |[7] |ASHOST |As Host Status - * | | |When OTG as Host, this bit is set. - * | | |0: OTG not as Host - * | | |1: OTG as Host - */ - __IO uint32_t CTL; /*!< [0x0000] OTG Control Register */ - __IO uint32_t PHYCTL; /*!< [0x0004] OTG PHY Control Register */ - __IO uint32_t INTEN; /*!< [0x0008] OTG Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x000c] OTG Interrupt Status Register */ - __I uint32_t STATUS; /*!< [0x0010] OTG Status Register */ - -} OTG_T; - -/** - @addtogroup OTG_CONST OTG Bit Field Definition - Constant Definitions for OTG Controller - @{ -*/ - -#define OTG_CTL_VBUSDROP_Pos (0) /*!< OTG_T::CTL: VBUSDROP Position */ -#define OTG_CTL_VBUSDROP_Msk (0x1ul << OTG_CTL_VBUSDROP_Pos) /*!< OTG_T::CTL: VBUSDROP Mask */ - -#define OTG_CTL_BUSREQ_Pos (1) /*!< OTG_T::CTL: BUSREQ Position */ -#define OTG_CTL_BUSREQ_Msk (0x1ul << OTG_CTL_BUSREQ_Pos) /*!< OTG_T::CTL: BUSREQ Mask */ - -#define OTG_CTL_HNPREQEN_Pos (2) /*!< OTG_T::CTL: HNPREQEN Position */ -#define OTG_CTL_HNPREQEN_Msk (0x1ul << OTG_CTL_HNPREQEN_Pos) /*!< OTG_T::CTL: HNPREQEN Mask */ - -#define OTG_CTL_OTGEN_Pos (4) /*!< OTG_T::CTL: OTGEN Position */ -#define OTG_CTL_OTGEN_Msk (0x1ul << OTG_CTL_OTGEN_Pos) /*!< OTG_T::CTL: OTGEN Mask */ - -#define OTG_CTL_WKEN_Pos (5) /*!< OTG_T::CTL: WKEN Position */ -#define OTG_CTL_WKEN_Msk (0x1ul << OTG_CTL_WKEN_Pos) /*!< OTG_T::CTL: WKEN Mask */ - -#define OTG_PHYCTL_OTGPHYEN_Pos (0) /*!< OTG_T::PHYCTL: OTGPHYEN Position */ -#define OTG_PHYCTL_OTGPHYEN_Msk (0x1ul << OTG_PHYCTL_OTGPHYEN_Pos) /*!< OTG_T::PHYCTL: OTGPHYEN Mask */ - -#define OTG_PHYCTL_IDDETEN_Pos (1) /*!< OTG_T::PHYCTL: IDDETEN Position */ -#define OTG_PHYCTL_IDDETEN_Msk (0x1ul << OTG_PHYCTL_IDDETEN_Pos) /*!< OTG_T::PHYCTL: IDDETEN Mask */ - -#define OTG_PHYCTL_VBENPOL_Pos (4) /*!< OTG_T::PHYCTL: VBENPOL Position */ -#define OTG_PHYCTL_VBENPOL_Msk (0x1ul << OTG_PHYCTL_VBENPOL_Pos) /*!< OTG_T::PHYCTL: VBENPOL Mask */ - -#define OTG_PHYCTL_VBSTSPOL_Pos (5) /*!< OTG_T::PHYCTL: VBSTSPOL Position */ -#define OTG_PHYCTL_VBSTSPOL_Msk (0x1ul << OTG_PHYCTL_VBSTSPOL_Pos) /*!< OTG_T::PHYCTL: VBSTSPOL Mask */ - -#define OTG_INTEN_ROLECHGIEN_Pos (0) /*!< OTG_T::INTEN: ROLECHGIEN Position */ -#define OTG_INTEN_ROLECHGIEN_Msk (0x1ul << OTG_INTEN_ROLECHGIEN_Pos) /*!< OTG_T::INTEN: ROLECHGIEN Mask */ - -#define OTG_INTEN_VBEIEN_Pos (1) /*!< OTG_T::INTEN: VBEIEN Position */ -#define OTG_INTEN_VBEIEN_Msk (0x1ul << OTG_INTEN_VBEIEN_Pos) /*!< OTG_T::INTEN: VBEIEN Mask */ - -#define OTG_INTEN_SRPFIEN_Pos (2) /*!< OTG_T::INTEN: SRPFIEN Position */ -#define OTG_INTEN_SRPFIEN_Msk (0x1ul << OTG_INTEN_SRPFIEN_Pos) /*!< OTG_T::INTEN: SRPFIEN Mask */ - -#define OTG_INTEN_HNPFIEN_Pos (3) /*!< OTG_T::INTEN: HNPFIEN Position */ -#define OTG_INTEN_HNPFIEN_Msk (0x1ul << OTG_INTEN_HNPFIEN_Pos) /*!< OTG_T::INTEN: HNPFIEN Mask */ - -#define OTG_INTEN_GOIDLEIEN_Pos (4) /*!< OTG_T::INTEN: GOIDLEIEN Position */ -#define OTG_INTEN_GOIDLEIEN_Msk (0x1ul << OTG_INTEN_GOIDLEIEN_Pos) /*!< OTG_T::INTEN: GOIDLEIEN Mask */ - -#define OTG_INTEN_IDCHGIEN_Pos (5) /*!< OTG_T::INTEN: IDCHGIEN Position */ -#define OTG_INTEN_IDCHGIEN_Msk (0x1ul << OTG_INTEN_IDCHGIEN_Pos) /*!< OTG_T::INTEN: IDCHGIEN Mask */ - -#define OTG_INTEN_PDEVIEN_Pos (6) /*!< OTG_T::INTEN: PDEVIEN Position */ -#define OTG_INTEN_PDEVIEN_Msk (0x1ul << OTG_INTEN_PDEVIEN_Pos) /*!< OTG_T::INTEN: PDEVIEN Mask */ - -#define OTG_INTEN_HOSTIEN_Pos (7) /*!< OTG_T::INTEN: HOSTIEN Position */ -#define OTG_INTEN_HOSTIEN_Msk (0x1ul << OTG_INTEN_HOSTIEN_Pos) /*!< OTG_T::INTEN: HOSTIEN Mask */ - -#define OTG_INTEN_BVLDCHGIEN_Pos (8) /*!< OTG_T::INTEN: BVLDCHGIEN Position */ -#define OTG_INTEN_BVLDCHGIEN_Msk (0x1ul << OTG_INTEN_BVLDCHGIEN_Pos) /*!< OTG_T::INTEN: BVLDCHGIEN Mask */ - -#define OTG_INTEN_AVLDCHGIEN_Pos (9) /*!< OTG_T::INTEN: AVLDCHGIEN Position */ -#define OTG_INTEN_AVLDCHGIEN_Msk (0x1ul << OTG_INTEN_AVLDCHGIEN_Pos) /*!< OTG_T::INTEN: AVLDCHGIEN Mask */ - -#define OTG_INTEN_VBCHGIEN_Pos (10) /*!< OTG_T::INTEN: VBCHGIEN Position */ -#define OTG_INTEN_VBCHGIEN_Msk (0x1ul << OTG_INTEN_VBCHGIEN_Pos) /*!< OTG_T::INTEN: VBCHGIEN Mask */ - -#define OTG_INTEN_SECHGIEN_Pos (11) /*!< OTG_T::INTEN: SECHGIEN Position */ -#define OTG_INTEN_SECHGIEN_Msk (0x1ul << OTG_INTEN_SECHGIEN_Pos) /*!< OTG_T::INTEN: SECHGIEN Mask */ - -#define OTG_INTEN_SRPDETIEN_Pos (13) /*!< OTG_T::INTEN: SRPDETIEN Position */ -#define OTG_INTEN_SRPDETIEN_Msk (0x1ul << OTG_INTEN_SRPDETIEN_Pos) /*!< OTG_T::INTEN: SRPDETIEN Mask */ - -#define OTG_INTSTS_ROLECHGIF_Pos (0) /*!< OTG_T::INTSTS: ROLECHGIF Position */ -#define OTG_INTSTS_ROLECHGIF_Msk (0x1ul << OTG_INTSTS_ROLECHGIF_Pos) /*!< OTG_T::INTSTS: ROLECHGIF Mask */ - -#define OTG_INTSTS_VBEIF_Pos (1) /*!< OTG_T::INTSTS: VBEIF Position */ -#define OTG_INTSTS_VBEIF_Msk (0x1ul << OTG_INTSTS_VBEIF_Pos) /*!< OTG_T::INTSTS: VBEIF Mask */ - -#define OTG_INTSTS_SRPFIF_Pos (2) /*!< OTG_T::INTSTS: SRPFIF Position */ -#define OTG_INTSTS_SRPFIF_Msk (0x1ul << OTG_INTSTS_SRPFIF_Pos) /*!< OTG_T::INTSTS: SRPFIF Mask */ - -#define OTG_INTSTS_HNPFIF_Pos (3) /*!< OTG_T::INTSTS: HNPFIF Position */ -#define OTG_INTSTS_HNPFIF_Msk (0x1ul << OTG_INTSTS_HNPFIF_Pos) /*!< OTG_T::INTSTS: HNPFIF Mask */ - -#define OTG_INTSTS_GOIDLEIF_Pos (4) /*!< OTG_T::INTSTS: GOIDLEIF Position */ -#define OTG_INTSTS_GOIDLEIF_Msk (0x1ul << OTG_INTSTS_GOIDLEIF_Pos) /*!< OTG_T::INTSTS: GOIDLEIF Mask */ - -#define OTG_INTSTS_IDCHGIF_Pos (5) /*!< OTG_T::INTSTS: IDCHGIF Position */ -#define OTG_INTSTS_IDCHGIF_Msk (0x1ul << OTG_INTSTS_IDCHGIF_Pos) /*!< OTG_T::INTSTS: IDCHGIF Mask */ - -#define OTG_INTSTS_PDEVIF_Pos (6) /*!< OTG_T::INTSTS: PDEVIF Position */ -#define OTG_INTSTS_PDEVIF_Msk (0x1ul << OTG_INTSTS_PDEVIF_Pos) /*!< OTG_T::INTSTS: PDEVIF Mask */ - -#define OTG_INTSTS_HOSTIF_Pos (7) /*!< OTG_T::INTSTS: HOSTIF Position */ -#define OTG_INTSTS_HOSTIF_Msk (0x1ul << OTG_INTSTS_HOSTIF_Pos) /*!< OTG_T::INTSTS: HOSTIF Mask */ - -#define OTG_INTSTS_BVLDCHGIF_Pos (8) /*!< OTG_T::INTSTS: BVLDCHGIF Position */ -#define OTG_INTSTS_BVLDCHGIF_Msk (0x1ul << OTG_INTSTS_BVLDCHGIF_Pos) /*!< OTG_T::INTSTS: BVLDCHGIF Mask */ - -#define OTG_INTSTS_AVLDCHGIF_Pos (9) /*!< OTG_T::INTSTS: AVLDCHGIF Position */ -#define OTG_INTSTS_AVLDCHGIF_Msk (0x1ul << OTG_INTSTS_AVLDCHGIF_Pos) /*!< OTG_T::INTSTS: AVLDCHGIF Mask */ - -#define OTG_INTSTS_VBCHGIF_Pos (10) /*!< OTG_T::INTSTS: VBCHGIF Position */ -#define OTG_INTSTS_VBCHGIF_Msk (0x1ul << OTG_INTSTS_VBCHGIF_Pos) /*!< OTG_T::INTSTS: VBCHGIF Mask */ - -#define OTG_INTSTS_SECHGIF_Pos (11) /*!< OTG_T::INTSTS: SECHGIF Position */ -#define OTG_INTSTS_SECHGIF_Msk (0x1ul << OTG_INTSTS_SECHGIF_Pos) /*!< OTG_T::INTSTS: SECHGIF Mask */ - -#define OTG_INTSTS_SRPDETIF_Pos (13) /*!< OTG_T::INTSTS: SRPDETIF Position */ -#define OTG_INTSTS_SRPDETIF_Msk (0x1ul << OTG_INTSTS_SRPDETIF_Pos) /*!< OTG_T::INTSTS: SRPDETIF Mask */ - -#define OTG_STATUS_OVERCUR_Pos (0) /*!< OTG_T::STATUS: OVERCUR Position */ -#define OTG_STATUS_OVERCUR_Msk (0x1ul << OTG_STATUS_OVERCUR_Pos) /*!< OTG_T::STATUS: OVERCUR Mask */ - -#define OTG_STATUS_IDSTS_Pos (1) /*!< OTG_T::STATUS: IDSTS Position */ -#define OTG_STATUS_IDSTS_Msk (0x1ul << OTG_STATUS_IDSTS_Pos) /*!< OTG_T::STATUS: IDSTS Mask */ - -#define OTG_STATUS_SESSEND_Pos (2) /*!< OTG_T::STATUS: SESSEND Position */ -#define OTG_STATUS_SESSEND_Msk (0x1ul << OTG_STATUS_SESSEND_Pos) /*!< OTG_T::STATUS: SESSEND Mask */ - -#define OTG_STATUS_BVLD_Pos (3) /*!< OTG_T::STATUS: BVLD Position */ -#define OTG_STATUS_BVLD_Msk (0x1ul << OTG_STATUS_BVLD_Pos) /*!< OTG_T::STATUS: BVLD Mask */ - -#define OTG_STATUS_AVLD_Pos (4) /*!< OTG_T::STATUS: AVLD Position */ -#define OTG_STATUS_AVLD_Msk (0x1ul << OTG_STATUS_AVLD_Pos) /*!< OTG_T::STATUS: AVLD Mask */ - -#define OTG_STATUS_VBUSVLD_Pos (5) /*!< OTG_T::STATUS: VBUSVLD Position */ -#define OTG_STATUS_VBUSVLD_Msk (0x1ul << OTG_STATUS_VBUSVLD_Pos) /*!< OTG_T::STATUS: VBUSVLD Mask */ - -#define OTG_STATUS_ASPERI_Pos (6) /*!< OTG_T::STATUS: ASPERI Position */ -#define OTG_STATUS_ASPERI_Msk (0x1ul << OTG_STATUS_ASPERI_Pos) /*!< OTG_T::STATUS: ASPERI Mask */ - -#define OTG_STATUS_ASHOST_Pos (7) /*!< OTG_T::STATUS: ASHOST Position */ -#define OTG_STATUS_ASHOST_Msk (0x1ul << OTG_STATUS_ASHOST_Pos) /*!< OTG_T::STATUS: ASHOST Mask */ - -/**@}*/ /* OTG_CONST */ -/**@}*/ /* end of OTG register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __OTG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/pdma_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/pdma_reg.h deleted file mode 100644 index 9ef68cb79d9..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/pdma_reg.h +++ /dev/null @@ -1,814 +0,0 @@ -/**************************************************************************//** - * @file pdma_reg.h - * @version V1.00 - * @brief PDMA register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __PDMA_REG_H__ -#define __PDMA_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Peripheral Direct Memory Access Controller -------------------------*/ -/** - @addtogroup PDMA Peripheral Direct Memory Access Controller(PDMA) - Memory Mapped Structure for PDMA Controller - @{ -*/ - - - -typedef struct -{ - /** - * @var DSCT_T::CTL - * Offset: 0x00/0x10/0x20/0x30/0x40/0x50/0x60/0x70 Descriptor Table Control Register of PDMA Channel 0~7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE |PDMA Operation Mode Selection - * | | |00 = Idle state: Channel is stopped or this table is complete, when PDMA finish channel table task, OPMODE will be cleared to idle state automatically. - * | | |01 = Basic mode: The descriptor table only has one task - * | | |When this task is finished, the TDIF(PDMA_INTSTS[1]) will be asserted. - * | | |10 = Scatter-Gather mode: When operating in this mode, user must give the first descriptor table address in PDMA_DSCT_FIRST register; PDMA controller will ignore this task, then load the next task to execute. - * | | |11 = Reserved. - * | | |Note: Before filling transfer task in the Descriptor Table, user must check if the descriptor table is complete. - * |[2] |TXTYPE |Transfer Type - * | | |0 = Burst transfer type. - * | | |1 = Single transfer type. - * |[6:4] |BURSIZE |Burst Size - * | | |This field is used for peripheral to determine the burst size or used for determine the re-arbitration size. - * | | |000 = 128 Transfers. - * | | |001 = 64 Transfers. - * | | |010 = 32 Transfers. - * | | |011 = 16 Transfers. - * | | |100 = 8 Transfers. - * | | |101 = 4 Transfers. - * | | |110 = 2 Transfers. - * | | |111 = 1 Transfers. - * | | |Note: This field is only useful in burst transfer type. - * |[7] |TBINTDIS |Table Interrupt Disable Bit - * | | |This field can be used to decide whether to enable table interrupt or not - * | | |If the TBINTDIS bit is enabled when PDMA controller finishes transfer task, it will not generates transfer done interrupt. - * | | |0 = Table interrupt Enabled. - * | | |1 = Table interrupt Disabled. - * | | |Note: If this bit set to 1, the TEMPTYF will not be set. - * |[9:8] |SAINC |Source Address Increment - * | | |This field is used to set the source address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * |[11:10] |DAINC |Destination Address Increment - * | | |This field is used to set the destination address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * |[13:12] |TXWIDTH |Transfer Width Selection - * | | |This field is used for transfer width. - * | | |00 = One byte (8 bit) is transferred for every operation. - * | | |01 = One half-word (16 bit) is transferred for every operation. - * | | |10 = One word (32-bit) is transferred for every operation. - * | | |11 = Reserved. - * | | |Note: The PDMA transfer source address (PDMA_DSCT_SA) and PDMA transfer destination address (PDMA_DSCT_DA) should be alignment under the TXWIDTH selection - * | | |For example, if source address is 0x2000_0202, but TXWIDTH is word transfer, the source address is not word alignment - * | | |The source address is aligned when TXWIDTH is byte or half-word transfer. - * |[14] |TXACK |Transfer Acknowledge Selection - * | | |0 = transfer ack when transfer done. - * | | |1 = transfer ack when PDMA get transfer data. - * |[15] |STRIDEEN |Stride Mode Enable Bit - * | | |0 = Stride transfer mode Disabled. - * | | |1 = Stride transfer mode Enabled. - * |[31:16] |TXCNT |Transfer Count - * | | |The TXCNT represents the required number of PDMA transfer, the real transfer count is (TXCNT + 1); The maximum transfer count is 65536, every transfer may be byte, half-word or word that is dependent on TXWIDTH field. - * | | |Note: When PDMA finish each transfer data, this field will be decrease immediately. - * @var DSCT_T::SA - * Offset: 0x04/0x14/0x24/0x34/0x44/0x54/0x64/0x74 Source Address Register of PDMA Channel 0~7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SA |PDMA Transfer Source Address Register - * | | |This field indicates a 32-bit source address of PDMA controller. - * | | |Note: The PDMA transfer source address should be aligned with the TXWIDTH(PDMA_DSCTn_CTL[13:12], n=0,1..7) selection. - * @var DSCT_T::DA - * Offset: 0x08/0x18/0x28/0x38/0x48/0x58/0x68/0x78 Destination Address Register of PDMA Channel 0~7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DA |PDMA Transfer Destination Address Register - * | | |This field indicates a 32-bit destination address of PDMA controller. - * | | |Note: The PDMA transfer destination address should be aligned with the TXWIDTH(PDMA_DSCTn_CTL[13:12], n=0,1..7) selection. - * @var DSCT_T::NEXT - * Offset: 0x0C/0x1C/0x2C/0x3C/0x4C/0x5C/0x6C/0x7C First Scatter-Gather Descriptor Table Offset of PDMA Channel 0~7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FIRST |PDMA First Descriptor Table Offset - * | | |This field indicates the offset of the first descriptor table address in system memory. - * | | |Write Operation: - * | | |If the system memory based address is 0x2000_0000 (PDMA_SCATBA), and the first descriptor table is start from 0x2000_0100, then this field must fill in 0x0100. - * | | |Read Operation: - * | | |When operating in scatter-gather mode, the last two bits FIRST[1:0] will become reserved. - * | | |Note1: The first descriptor table address must be word boundary. - * | | |Note2: Before filled transfer task in the descriptor table, user must check if the descriptor table is complete. - * |[31:16] |NEXT |PDMA Next Descriptor Table Offset - * | | |This field indicates the offset of next descriptor table address in system memory. - * | | |Note: write operation is useless in this field. - */ - - __IO uint32_t CTL; /*!< [0x00/0x10/0x20/0x30/0x40/0x50/0x60/0x70] Descriptor Table Control Register of PDMA Channel 0~7 */ - __IO uint32_t SA; /*!< [0x04/0x14/0x24/0x34/0x44/0x54/0x64/0x74] Source Address Register of PDMA Channel 0~7 */ - __IO uint32_t DA; /*!< [0x08/0x18/0x28/0x38/0x48/0x58/0x68/0x78] Destination Address Register of PDMA Channel 0~7 */ - __IO uint32_t NEXT; /*!< [0x0C/0x1C/0x2C/0x3C/0x4C/0x5C/0x6C/0x7C]Next Scatter-Gather Descriptor Table Offset */ - -} DSCT_T; - -typedef struct -{ - /** - * @var STRIDE_T::STCR - * Offset: 0x500/0x508/0x510/0x518/0x520/0x528 Stride Transfer Count Register of PDMA Channel 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STC |PDMA Stride Transfer Count - * | | |The 16-bit register defines the stride transfer count of each row. - * @var STRIDE_T::ASOCR - * Offset: 0x504/0x50C/0x514/0x51C/0x524/0x52C Address Stride Offset Register of PDMA Channel 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SASOL |VDMA Source Address Stride Offset Length - * | | |The 16-bit register defines the source address stride transfer offset count of each row. - * |[31:16] |DASOL |VDMA Destination Address Stride Offset Length - * | | |The 16-bit register defines the destination address stride transfer offset count of each row. - */ - __IO uint32_t STCR; /*!< [0x0500/0x508/0x510/0x518/0x520/0x528] Stride Transfer Count Register of PDMA Channel 0~7 */ - __IO uint32_t ASOCR; /*!< [0x0504/0x50C/0x514/0x51C/0x524/0x52C] Address Stride Offset Register of PDMA Channel 0 */ -} STRIDE_T; - -typedef struct -{ - /** - * @var REPEAT_T::AICTL - * Offset: 0x600 Address Interval Control Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SAICNT |PDMA Source Address Interval Count - * | | |The 16-bit register defines the source address interval count of each row. - * |[31:16] |DAICNT |PDMA Destination Address Interval Count - * | | |The 16-bit register defines the destination address interval count of each row. - * @var REPEAT_T::RCNT - * Offset: 0x604 Repeat Count Register of PDMA Channe n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCNT |PDMA Repeat Count - * | | |The 16-bit register defines the repeat times of block transfer. - */ - __IO uint32_t AICTL; /*!< [0x0600] Address Interval Control Register of PDMA Channel 0 */ - __IO uint32_t RCNT; /*!< [0x0604] Repeat Count Register of PDMA Channel 0 */ -} REPEAT_T; - -typedef struct -{ - - - /** - * @var PDMA_T::CURSCAT - * Offset: 0x80/0x84/0x88/0x8C/0x90/0x94/0x98/0x9C Current Scatter-Gather Descriptor Table Address of PDMA Channel 0~7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURADDR |PDMA Current Description Address Register (Read Only) - * | | |This field indicates a 32-bit current external description address of PDMA controller. - * | | |Note: This field is read only and only used for Scatter-Gather mode to indicate the current external description address. - * @var PDMA_T::CHCTL - * Offset: 0x400 PDMA Channel Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CHENn |PDMA Channel Enable Bit - * | | |Set this bit to 1 to enable PDMAn operation. Channel cannot be active if it is not set as enabled. - * | | |0 = PDMA channel [n] Disabled. - * | | |1 = PDMA channel [n] Enabled. - * | | |Note: Set corresponding bit of PDMA_PAUSE or PDMA_CHRST register will also clear this bit. - * @var PDMA_T::PAUSE - * Offset: 0x404 PDMA Transfer Pause Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PAUSEn |PDMA Transfer Pause Control Register (Write Only) - * | | |User can set PAUSEn bit field to pause the PDMA transfer - * | | |When user sets PAUSEn bit, the PDMA controller will pause the on-going transfer, then clear the channel enable bit CHEN(PDMA_CHCTL [n], n=0,1..7) and clear request active flag - * | | |If re-enable the paused channel again, the remaining transfers will be processed. - * | | |0 = No effect. - * | | |1 = Pause PDMA channel n transfer. - * @var PDMA_T::SWREQ - * Offset: 0x408 PDMA Software Request Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SWREQn |PDMA Software Request Register (Write Only) - * | | |Set this bit to 1 to generate a software request to PDMA [n]. - * | | |0 = No effect. - * | | |1 = Generate a software request. - * | | |Note1: User can read PDMA_TRGSTS register to know which channel is on active - * | | |Active flag may be triggered by software request or peripheral request. - * | | |Note2: If user does not enable corresponding PDMA channel, the software request will be ignored. - * @var PDMA_T::TRGSTS - * Offset: 0x40C PDMA Channel Request Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |REQSTSn |PDMA Channel Request Status (Read Only) - * | | |This flag indicates whether channel[n] have a request or not, no matter request from software or peripheral - * | | |When PDMA controller finishes channel transfer, this bit will be cleared automatically. - * | | |0 = PDMA Channel n has no request. - * | | |1 = PDMA Channel n has a request. - * | | |Note: If user pauses or resets each PDMA transfer by setting PDMA_PAUSE or PDMA_CHRST register respectively, this bit will be cleared automatically after finishing current transfer. - * @var PDMA_T::PRISET - * Offset: 0x410 PDMA Fixed Priority Setting Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FPRISETn |PDMA Fixed Priority Setting Register - * | | |Set this bit to 1 to enable fixed priority level. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set PDMA channel [n] to fixed priority channel. - * | | |Read Operation: - * | | |0 = Corresponding PDMA channel is round-robin priority. - * | | |1 = Corresponding PDMA channel is fixed priority. - * | | |Note: This field only set to fixed priority, clear fixed priority use PDMA_PRICLR register. - * @var PDMA_T::PRICLR - * Offset: 0x414 PDMA Fixed Priority Clear Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FPRICLRn |PDMA Fixed Priority Clear Register (Write Only) - * | | |Set this bit to 1 to clear fixed priority level. - * | | |0 = No effect. - * | | |1 = Clear PDMA channel [n] fixed priority setting. - * | | |Note: User can read PDMA_PRISET register to know the channel priority. - * @var PDMA_T::INTEN - * Offset: 0x418 PDMA Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |INTENn |PDMA Interrupt Enable Register - * | | |This field is used for enabling PDMA channel[n] interrupt. - * | | |0 = PDMA channel n interrupt Disabled. - * | | |1 = PDMA channel n interrupt Enabled. - * @var PDMA_T::INTSTS - * Offset: 0x41C PDMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABTIF |PDMA Read/Write Target Abort Interrupt Flag (Read Only) - * | | |This bit indicates that PDMA has target abort error; Software can read PDMA_ABTSTS register to find which channel has target abort error. - * | | |0 = No AHB bus ERROR response received. - * | | |1 = AHB bus ERROR response received. - * |[1] |TDIF |Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that PDMA controller has finished transmission; User can read PDMA_TDSTS register to indicate which channel finished transfer. - * | | |0 = Not finished yet. - * | | |1 = PDMA channel has finished transmission. - * |[2] |ALIGNF |Transfer Alignment Interrupt Flag (Read Only) - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * |[8] |REQTOF0 |Request Time-out Flag for Channel 0 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC0, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * |[9] |REQTOF1 |Request Time-out Flag for Channel 1 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC1, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * @var PDMA_T::ABTSTS - * Offset: 0x420 PDMA Channel Read/Write Target Abort Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ABTIFn |PDMA Read/Write Target Abort Interrupt Status Flag - * | | |This bit indicates which PDMA controller has target abort error; User can write 1 to clear these bits. - * | | |0 = No AHB bus ERROR response received when channel n transfer. - * | | |1 = AHB bus ERROR response received when channel n transfer. - * @var PDMA_T::TDSTS - * Offset: 0x424 PDMA Channel Transfer Done Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TDIFn |Transfer Done Flag Register - * | | |This bit indicates whether PDMA controller channel transfer has been finished or not, user can write 1 to clear these bits. - * | | |0 = PDMA channel transfer has not finished. - * | | |1 = PDMA channel has finished transmission. - * @var PDMA_T::ALIGN - * Offset: 0x428 PDMA Transfer Alignment Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ALIGNn |Transfer Alignment Flag Register - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * @var PDMA_T::TACTSTS - * Offset: 0x42C PDMA Transfer Active Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXACTFn |Transfer on Active Flag Register (Read Only) - * | | |This bit indicates which PDMA channel is in active. - * | | |0 = PDMA channel is not finished. - * | | |1 = PDMA channel is active. - * @var PDMA_T::TOUTPSC - * Offset: 0x430 PDMA Time-out Prescaler Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TOUTPSC0 |PDMA Channel 0 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 0 time-out clock source is HCLK/2^8. - * | | |001 = PDMA channel 0 time-out clock source is HCLK/2^9. - * | | |010 = PDMA channel 0 time-out clock source is HCLK/2^10. - * | | |011 = PDMA channel 0 time-out clock source is HCLK/2^11. - * | | |100 = PDMA channel 0 time-out clock source is HCLK/2^12. - * | | |101 = PDMA channel 0 time-out clock source is HCLK/2^13. - * | | |110 = PDMA channel 0 time-out clock source is HCLK/2^14. - * | | |111 = PDMA channel 0 time-out clock source is HCLK/2^15. - * |[6:4] |TOUTPSC1 |PDMA Channel 1 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 1 time-out clock source is HCLK/2^8. - * | | |001 = PDMA channel 1 time-out clock source is HCLK/2^9. - * | | |010 = PDMA channel 1 time-out clock source is HCLK/2^10. - * | | |011 = PDMA channel 1 time-out clock source is HCLK/2^11. - * | | |100 = PDMA channel 1 time-out clock source is HCLK/2^12. - * | | |101 = PDMA channel 1 time-out clock source is HCLK/2^13. - * | | |110 = PDMA channel 1 time-out clock source is HCLK/2^14. - * | | |111 = PDMA channel 1 time-out clock source is HCLK/2^15. - * @var PDMA_T::TOUTEN - * Offset: 0x434 PDMA Time-out Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOUTEN0 |PDMA Channel 0 Time-out Enable Bit - * | | |0 = PDMA Channel 0 time-out function Disable. - * | | |1 = PDMA Channel 0 time-out function Enable. - * |[1] |TOUTEN1 |PDMA Channel 1 Time-out Enable Bit - * | | |0 = PDMA Channel 1 time-out function Disable. - * | | |1 = PDMA Channel 1 time-out function Enable. - * @var PDMA_T::TOUTIEN - * Offset: 0x438 PDMA Time-out Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOUTIEN0 |PDMA Channel 0 Time-out Interrupt Enable Bit - * | | |0 = PDMA Channel 0 time-out interrupt Disable. - * | | |1 = PDMA Channel 0 time-out interrupt Enable. - * |[1] |TOUTIEN1 |PDMA Channel 1 Time-out Interrupt Enable Bit - * | | |0 = PDMA Channel 1 time-out interrupt Disable. - * | | |1 = PDMA Channel 1 time-out interrupt Enable. - * @var PDMA_T::SCATBA - * Offset: 0x43C PDMA Scatter-Gather Descriptor Table Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |SCATBA |PDMA Scatter-gather Descriptor Table Address Register - * | | |In Scatter-Gather mode, this is the base address for calculating the next link - list address - * | | |The next link address equation is - * | | |Next Link Address = PDMA_SCATBA + PDMA_DSCT_NEXT. - * | | |Note: Only useful in Scatter-Gather mode. - * @var PDMA_T::TOC0_1 - * Offset: 0x440 PDMA Channel 0 and Channel 1 Time-out Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TOC0 |Time-out Counter for Channel 0 - * | | |This controls the period of time-out function for channel 0 - * | | |The calculation unit is based on TOUTPSC0 (PDMA_TOUTPSC[2:0]) clock. - * | | |Time-out period = (Period of time-out clock) * (16-bit TOCn),n = 0,1. - * |[31:16] |TOC1 |Time-out Counter for Channel 1 - * | | |This controls the period of time-out function for channel 1 - * | | |The calculation unit is based on TOUTPSC1 (PDMA_TOUTPSC[5:3]) clock - * | | |The example of time-out period can refer TOC0 bit description. - * @var PDMA_T::CHRST - * Offset: 0x460 PDMA Channel Reset Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CHnRST |Channel N Reset - * | | |0 = corresponding channel n not reset. - * | | |1 = corresponding channel n is reset. - * @var PDMA_T::REQSEL0_3 - * Offset: 0x480 PDMA Channel 0 to Channel 3 Request Source Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC0 |Channel 0 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 0 - * | | |User can configure the peripheral by setting REQSRC0. - * | | |0 = Disable PDMA. - * | | |1 = Reserved. - * | | |2 = Channel connects to USB_TX. - * | | |3 = Channel connects to USB_RX. - * | | |4 = Channel connects to UART0_TX. - * | | |5 = Channel connects to UART0_RX. - * | | |6 = Channel connects to UART1_TX. - * | | |7 = Channel connects to UART1_RX. - * | | |8 = Channel connects to UART2_TX. - * | | |9 = Channel connects to UART2_RX. - * | | |10 = Channel connects to UART3_TX. - * | | |11 = Channel connects to UART3_RX. - * | | |12 = Channel connects to UART4_TX. - * | | |13 = Channel connects to UART4_RX. - * | | |14 = Channel connects to UART5_TX. - * | | |15 = Channel connects to UART5_RX. - * | | |16 = Channel connects to USCI0_TX. - * | | |17 = Channel connects to USCI0_RX. - * | | |18 = Channel connects to USCI1_TX. - * | | |19 = Channel connects to USCI1_RX. - * | | |20 = Channel connects to QSPI0_TX. - * | | |21 = Channel connects to QSPI0_RX. - * | | |22 = Channel connects to SPI0_TX. - * | | |23 = Channel connects to SPI0_RX. - * | | |24 = Channel connects to SPI1_TX. - * | | |25 = Channel connects to SPI1_RX. - * | | |26 = Channel connects to SPI2_TX. - * | | |27 = Channel connects to SPI2_RX. - * | | |28 = Channel connects to SPI3_TX. - * | | |29 = Channel connects to SPI3_RX. - * | | |30 = Channel connects to ADC_RX. - * | | |32 = Channel connects to EPWM0_P1_RX. - * | | |33 = Channel connects to EPWM0_P2_RX. - * | | |34 = Channel connects to EPWM0_P3_RX. - * | | |35 = Channel connects to EPWM1_P1_RX. - * | | |36 = Channel connects to EPWM1_P2_RX. - * | | |37 = Channel connects to EPWM1_P3_RX. - * | | |38 = Channel connects to I2C0_TX. - * | | |39 = Channel connects to I2C0_RX. - * | | |40 = Channel connects to I2C1_TX. - * | | |41 = Channel connects to I2C1_RX. - * | | |42 = Channel connects to I2C2_TX. - * | | |43 = Channel connects to I2C2_RX. - * | | |44 = Channel connects to I2S0_TX. - * | | |45 = Channel connects to I2S0_RX. - * | | |46 = Channel connects to TMR0. - * | | |47 = Channel connects to TMR1. - * | | |48 = Channel connects to TMR2. - * | | |49 = Channel connects to TMR3. - * | | |50 = Channel connects to TMR4. - * | | |51 = Channel connects to TMR5. - * | | |52 = Channel connects to DAC0_TX. - * | | |53 = Channel connects to DAC1_TX. - * | | |54 = Channel connects to EPWM0_CH0_TX. - * | | |55 = Channel connects to EPWM0_CH1_TX. - * | | |56 = Channel connects to EPWM0_CH2_TX. - * | | |57 = Channel connects to EPWM0_CH3_TX. - * | | |58 = Channel connects to EPWM0_CH4_TX. - * | | |59 = Channel connects to EPWM0_CH5_TX. - * | | |60 = Channel connects to EPWM1_CH0_TX. - * | | |61 = Channel connects to EPWM1_CH1_TX. - * | | |62 = Channel connects to EPWM1_CH2_TX. - * | | |63 = Channel connects to EPWM1_CH3_TX. - * | | |64 = Channel connects to EPWM1_CH4_TX. - * | | |65 = Channel connects to EPWM1_CH5_TX. - * | | |Others = Reserved. - * | | |Note 1: A request source cannot assign to two channels at the same time. - * | | |Note 2: This field is useless when transfer between memory and memory. - * |[14:8] |REQSRC1 |Channel 1 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 1 - * | | |User can configure the peripheral setting by REQSRC1. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC2 |Channel 2 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 2 - * | | |User can configure the peripheral setting by REQSRC2. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC3 |Channel 3 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 3 - * | | |User can configure the peripheral setting by REQSRC3. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL4_7 - * Offset: 0x484 PDMA Request Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC4 |Channel 4 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 4 - * | | |User can configure the peripheral setting by REQSRC4. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[14:8] |REQSRC5 |Channel 5 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 5 - * | | |User can configure the peripheral setting by REQSRC5. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC6 |Channel 6 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 6 - * | | |User can configure the peripheral setting by REQSRC6. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC7 |Channel 7 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 7 - * | | |User can configure the peripheral setting by REQSRC7. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - */ - - DSCT_T DSCT[8]; /*!< [0x0000 ~ 0x007C] DMA Embedded Description Table 0~7 */ - __I uint32_t CURSCAT[8]; /*!< [0x0080~0x009C] Current Scatter-Gather Descriptor Table Address of PDMA Channel 0~7 */ - __I uint32_t RESERVE0[216]; - __IO uint32_t CHCTL; /*!< [0x0400] PDMA Channel Control Register */ - __O uint32_t PAUSE; /*!< [0x0404] PDMA Transfer Pause Control Register */ - __O uint32_t SWREQ; /*!< [0x0408] PDMA Software Request Register */ - __I uint32_t TRGSTS; /*!< [0x040c] PDMA Channel Request Status Register */ - __IO uint32_t PRISET; /*!< [0x0410] PDMA Fixed Priority Setting Register */ - __O uint32_t PRICLR; /*!< [0x0414] PDMA Fixed Priority Clear Register */ - __IO uint32_t INTEN; /*!< [0x0418] PDMA Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x041c] PDMA Interrupt Status Register */ - __IO uint32_t ABTSTS; /*!< [0x0420] PDMA Channel Read/Write Target Abort Flag Register */ - __IO uint32_t TDSTS; /*!< [0x0424] PDMA Channel Transfer Done Flag Register */ - __IO uint32_t ALIGN; /*!< [0x0428] PDMA Transfer Alignment Status Register */ - __I uint32_t TACTSTS; /*!< [0x042c] PDMA Transfer Active Flag Register */ - __IO uint32_t TOUTPSC; /*!< [0x0430] PDMA Time-out Prescaler Register */ - __IO uint32_t TOUTEN; /*!< [0x0434] PDMA Time-out Enable Register */ - __IO uint32_t TOUTIEN; /*!< [0x0438] PDMA Time-out Interrupt Enable Register */ - __IO uint32_t SCATBA; /*!< [0x043c] PDMA Scatter-Gather Descriptor Table Base Address Register */ - __IO uint32_t TOC0_1; /*!< [0x0440] PDMA Channel 0 and Channel 1 Time-out Counter Register */ - __I uint32_t RESERVE1[7]; - __IO uint32_t CHRST; /*!< [0x0460] PDMA Channel Reset Register */ - __I uint32_t RESERVE2[7]; - __IO uint32_t REQSEL0_3; /*!< [0x0480] PDMA Channel 0 to Channel 3 Request Source Select Register */ - __IO uint32_t REQSEL4_7; /*!< [0x0484] PDMA Channel 4 to Channel 7 Request Source Select Register */ - __I uint32_t RESERVE4[30]; - STRIDE_T STRIDE[6]; /*!< [0x0500 ~ 0x052C] Stride function control register of PDMA Channel 0 ~ 5 */ - __IO uint32_t RESERVE5[52]; - REPEAT_T REPEAT[2]; /*!< [0x0600 ~ 0x060C] Repeat Count Function Control Register of PDMA Channel 0 ~ 1 */ -} PDMA_T; - - - - -/** - @addtogroup PDMA_CONST PDMA Bit Field Definition - Constant Definitions for PDMA Controller - @{ -*/ - -#define PDMA_DSCT_CTL_OPMODE_Pos (0) /*!< PDMA_T::DSCT_CTL: OPMODE Position */ -#define PDMA_DSCT_CTL_OPMODE_Msk (0x3ul << PDMA_DSCT_CTL_OPMODE_Pos) /*!< PDMA_T::DSCT_CTL: OPMODE Mask */ - -#define PDMA_DSCT_CTL_TXTYPE_Pos (2) /*!< PDMA_T::DSCT_CTL: TXTYPE Position */ -#define PDMA_DSCT_CTL_TXTYPE_Msk (0x1ul << PDMA_DSCT_CTL_TXTYPE_Pos) /*!< PDMA_T::DSCT_CTL: TXTYPE Mask */ - -#define PDMA_DSCT_CTL_BURSIZE_Pos (4) /*!< PDMA_T::DSCT_CTL: BURSIZE Position */ -#define PDMA_DSCT_CTL_BURSIZE_Msk (0x7ul << PDMA_DSCT_CTL_BURSIZE_Pos) /*!< PDMA_T::DSCT_CTL: BURSIZE Mask */ - -#define PDMA_DSCT_CTL_TBINTDIS_Pos (7) /*!< PDMA_T::DSCT_CTL: TBINTDIS Position */ -#define PDMA_DSCT_CTL_TBINTDIS_Msk (0x1ul << PDMA_DSCT_CTL_TBINTDIS_Pos) /*!< PDMA_T::DSCT_CTL: TBINTDIS Mask */ - -#define PDMA_DSCT_CTL_SAINC_Pos (8) /*!< PDMA_T::DSCT_CTL: SAINC Position */ -#define PDMA_DSCT_CTL_SAINC_Msk (0x3ul << PDMA_DSCT_CTL_SAINC_Pos) /*!< PDMA_T::DSCT_CTL: SAINC Mask */ - -#define PDMA_DSCT_CTL_DAINC_Pos (10) /*!< PDMA_T::DSCT_CTL: DAINC Position */ -#define PDMA_DSCT_CTL_DAINC_Msk (0x3ul << PDMA_DSCT_CTL_DAINC_Pos) /*!< PDMA_T::DSCT_CTL: DAINC Mask */ - -#define PDMA_DSCT_CTL_TXWIDTH_Pos (12) /*!< PDMA_T::DSCT_CTL: TXWIDTH Position */ -#define PDMA_DSCT_CTL_TXWIDTH_Msk (0x3ul << PDMA_DSCT_CTL_TXWIDTH_Pos) /*!< PDMA_T::DSCT_CTL: TXWIDTH Mask */ - -#define PDMA_DSCT_CTL_TXACK_Pos (14) /*!< PDMA_T::DSCT_CTL: TXACK Position */ -#define PDMA_DSCT_CTL_TXACK_Msk (0x1ul << PDMA_DSCT_CTL_TXACK_Pos) /*!< PDMA_T::DSCT_CTL: TXACK Mask */ - -#define PDMA_DSCT_CTL_STRIDEEN_Pos (15) /*!< PDMA_T::DSCT_CTL: STRIDEEN Position */ -#define PDMA_DSCT_CTL_STRIDEEN_Msk (0x1ul << PDMA_DSCT_CTL_STRIDEEN_Pos) /*!< PDMA_T::DSCT_CTL: STRIDEEN Mask */ - -#define PDMA_DSCT_CTL_TXCNT_Pos (16) /*!< PDMA_T::DSCT_CTL: TXCNT Position */ -#define PDMA_DSCT_CTL_TXCNT_Msk (0xfffful << PDMA_DSCT_CTL_TXCNT_Pos) /*!< PDMA_T::DSCT_CTL: TXCNT Mask */ - -#define PDMA_DSCT_SA_SA_Pos (0) /*!< PDMA_T::DSCT_SA: SA Position */ -#define PDMA_DSCT_SA_SA_Msk (0xfffffffful << PDMA_DSCT_SA_SA_Pos) /*!< PDMA_T::DSCT_SA: SA Mask */ - -#define PDMA_DSCT_DA_DA_Pos (0) /*!< PDMA_T::DSCT_DA: DA Position */ -#define PDMA_DSCT_DA_DA_Msk (0xfffffffful << PDMA_DSCT_DA_DA_Pos) /*!< PDMA_T::DSCT_DA: DA Mask */ - -#define PDMA_DSCT_NEXT_NEXT_Pos (0) /*!< PDMA_T::DSCT_NEXT: NEXT Position */ -#define PDMA_DSCT_NEXT_NEXT_Msk (0xfffful << PDMA_DSCT_NEXT_NEXT_Pos) /*!< PDMA_T::DSCT_NEXT: NEXT Mask */ - -#define PDMA_DSCT_NEXT_EXENEXT_Pos (16) /*!< PDMA_T::DSCT_FIRST: NEXT Position */ -#define PDMA_DSCT_NEXT_EXENEXT_Msk (0xfffful << PDMA_DSCT_NEXT_EXENEXT_Pos) /*!< PDMA_T::DSCT_FIRST: NEXT Mask */ - -#define PDMA_CURSCAT_CURADDR_Pos (0) /*!< PDMA_T::CURSCAT: CURADDR Position */ -#define PDMA_CURSCAT_CURADDR_Msk (0xfffffffful << PDMA_CURSCAT_CURADDR_Pos) /*!< PDMA_T::CURSCAT: CURADDR Mask */ - -#define PDMA_CHCTL_CHENn_Pos (0) /*!< PDMA_T::CHCTL: CHENn Position */ -#define PDMA_CHCTL_CHENn_Msk (0xfffful << PDMA_CHCTL_CHENn_Pos) /*!< PDMA_T::CHCTL: CHENn Mask */ - -#define PDMA_PAUSE_PAUSEn_Pos (0) /*!< PDMA_T::PAUSE: PAUSEn Position */ -#define PDMA_PAUSE_PAUSEn_Msk (0xfffful << PDMA_PAUSE_PAUSEn_Pos) /*!< PDMA_T::PAUSE: PAUSEn Mask */ - -#define PDMA_SWREQ_SWREQn_Pos (0) /*!< PDMA_T::SWREQ: SWREQn Position */ -#define PDMA_SWREQ_SWREQn_Msk (0xfffful << PDMA_SWREQ_SWREQn_Pos) /*!< PDMA_T::SWREQ: SWREQn Mask */ - -#define PDMA_TRGSTS_REQSTSn_Pos (0) /*!< PDMA_T::TRGSTS: REQSTSn Position */ -#define PDMA_TRGSTS_REQSTSn_Msk (0xfffful << PDMA_TRGSTS_REQSTSn_Pos) /*!< PDMA_T::TRGSTS: REQSTSn Mask */ - -#define PDMA_PRISET_FPRISETn_Pos (0) /*!< PDMA_T::PRISET: FPRISETn Position */ -#define PDMA_PRISET_FPRISETn_Msk (0xfffful << PDMA_PRISET_FPRISETn_Pos) /*!< PDMA_T::PRISET: FPRISETn Mask */ - -#define PDMA_PRICLR_FPRICLRn_Pos (0) /*!< PDMA_T::PRICLR: FPRICLRn Position */ -#define PDMA_PRICLR_FPRICLRn_Msk (0xfffful << PDMA_PRICLR_FPRICLRn_Pos) /*!< PDMA_T::PRICLR: FPRICLRn Mask */ - -#define PDMA_INTEN_INTENn_Pos (0) /*!< PDMA_T::INTEN: INTENn Position */ -#define PDMA_INTEN_INTENn_Msk (0xfffful << PDMA_INTEN_INTENn_Pos) /*!< PDMA_T::INTEN: INTENn Mask */ - -#define PDMA_INTSTS_ABTIF_Pos (0) /*!< PDMA_T::INTSTS: ABTIF Position */ -#define PDMA_INTSTS_ABTIF_Msk (0x1ul << PDMA_INTSTS_ABTIF_Pos) /*!< PDMA_T::INTSTS: ABTIF Mask */ - -#define PDMA_INTSTS_TDIF_Pos (1) /*!< PDMA_T::INTSTS: TDIF Position */ -#define PDMA_INTSTS_TDIF_Msk (0x1ul << PDMA_INTSTS_TDIF_Pos) /*!< PDMA_T::INTSTS: TDIF Mask */ - -#define PDMA_INTSTS_ALIGNF_Pos (2) /*!< PDMA_T::INTSTS: ALIGNF Position */ -#define PDMA_INTSTS_ALIGNF_Msk (0x1ul << PDMA_INTSTS_ALIGNF_Pos) /*!< PDMA_T::INTSTS: ALIGNF Mask */ - -#define PDMA_INTSTS_REQTOF0_Pos (8) /*!< PDMA_T::INTSTS: REQTOF0 Position */ -#define PDMA_INTSTS_REQTOF0_Msk (0x1ul << PDMA_INTSTS_REQTOF0_Pos) /*!< PDMA_T::INTSTS: REQTOF0 Mask */ - -#define PDMA_INTSTS_REQTOF1_Pos (9) /*!< PDMA_T::INTSTS: REQTOF1 Position */ -#define PDMA_INTSTS_REQTOF1_Msk (0x1ul << PDMA_INTSTS_REQTOF1_Pos) /*!< PDMA_T::INTSTS: REQTOF1 Mask */ - -#define PDMA_ABTSTS_ABTIF0_Pos (0) /*!< PDMA_T::ABTSTS: ABTIF0 Position */ -#define PDMA_ABTSTS_ABTIF0_Msk (0x1ul << PDMA_ABTSTS_ABTIF0_Pos) /*!< PDMA_T::ABTSTS: ABTIF0 Mask */ - -#define PDMA_ABTSTS_ABTIF1_Pos (1) /*!< PDMA_T::ABTSTS: ABTIF1 Position */ -#define PDMA_ABTSTS_ABTIF1_Msk (0x1ul << PDMA_ABTSTS_ABTIF1_Pos) /*!< PDMA_T::ABTSTS: ABTIF1 Mask */ - -#define PDMA_ABTSTS_ABTIF2_Pos (2) /*!< PDMA_T::ABTSTS: ABTIF2 Position */ -#define PDMA_ABTSTS_ABTIF2_Msk (0x1ul << PDMA_ABTSTS_ABTIF2_Pos) /*!< PDMA_T::ABTSTS: ABTIF2 Mask */ - -#define PDMA_ABTSTS_ABTIF3_Pos (3) /*!< PDMA_T::ABTSTS: ABTIF3 Position */ -#define PDMA_ABTSTS_ABTIF3_Msk (0x1ul << PDMA_ABTSTS_ABTIF3_Pos) /*!< PDMA_T::ABTSTS: ABTIF3 Mask */ - -#define PDMA_ABTSTS_ABTIF4_Pos (4) /*!< PDMA_T::ABTSTS: ABTIF4 Position */ -#define PDMA_ABTSTS_ABTIF4_Msk (0x1ul << PDMA_ABTSTS_ABTIF4_Pos) /*!< PDMA_T::ABTSTS: ABTIF4 Mask */ - -#define PDMA_ABTSTS_ABTIF5_Pos (5) /*!< PDMA_T::ABTSTS: ABTIF5 Position */ -#define PDMA_ABTSTS_ABTIF5_Msk (0x1ul << PDMA_ABTSTS_ABTIF5_Pos) /*!< PDMA_T::ABTSTS: ABTIF5 Mask */ - -#define PDMA_ABTSTS_ABTIF6_Pos (6) /*!< PDMA_T::ABTSTS: ABTIF6 Position */ -#define PDMA_ABTSTS_ABTIF6_Msk (0x1ul << PDMA_ABTSTS_ABTIF6_Pos) /*!< PDMA_T::ABTSTS: ABTIF6 Mask */ - -#define PDMA_ABTSTS_ABTIF7_Pos (7) /*!< PDMA_T::ABTSTS: ABTIF7 Position */ -#define PDMA_ABTSTS_ABTIF7_Msk (0x1ul << PDMA_ABTSTS_ABTIF7_Pos) /*!< PDMA_T::ABTSTS: ABTIF7 Mask */ - -#define PDMA_ABTSTS_ABTIF8_Pos (8) /*!< PDMA_T::ABTSTS: ABTIF8 Position */ -#define PDMA_ABTSTS_ABTIF8_Msk (0x1ul << PDMA_ABTSTS_ABTIF8_Pos) /*!< PDMA_T::ABTSTS: ABTIF8 Mask */ - -#define PDMA_ABTSTS_ABTIF9_Pos (9) /*!< PDMA_T::ABTSTS: ABTIF9 Position */ -#define PDMA_ABTSTS_ABTIF9_Msk (0x1ul << PDMA_ABTSTS_ABTIF9_Pos) /*!< PDMA_T::ABTSTS: ABTIF9 Mask */ - -#define PDMA_ABTSTS_ABTIF10_Pos (10) /*!< PDMA_T::ABTSTS: ABTIF10 Position */ -#define PDMA_ABTSTS_ABTIF10_Msk (0x1ul << PDMA_ABTSTS_ABTIF10_Pos) /*!< PDMA_T::ABTSTS: ABTIF10 Mask */ - -#define PDMA_ABTSTS_ABTIF11_Pos (11) /*!< PDMA_T::ABTSTS: ABTIF11 Position */ -#define PDMA_ABTSTS_ABTIF11_Msk (0x1ul << PDMA_ABTSTS_ABTIF11_Pos) /*!< PDMA_T::ABTSTS: ABTIF11 Mask */ - -#define PDMA_ABTSTS_ABTIF12_Pos (12) /*!< PDMA_T::ABTSTS: ABTIF12 Position */ -#define PDMA_ABTSTS_ABTIF12_Msk (0x1ul << PDMA_ABTSTS_ABTIF12_Pos) /*!< PDMA_T::ABTSTS: ABTIF12 Mask */ - -#define PDMA_ABTSTS_ABTIF13_Pos (13) /*!< PDMA_T::ABTSTS: ABTIF13 Position */ -#define PDMA_ABTSTS_ABTIF13_Msk (0x1ul << PDMA_ABTSTS_ABTIF13_Pos) /*!< PDMA_T::ABTSTS: ABTIF13 Mask */ - -#define PDMA_ABTSTS_ABTIF14_Pos (14) /*!< PDMA_T::ABTSTS: ABTIF14 Position */ -#define PDMA_ABTSTS_ABTIF14_Msk (0x1ul << PDMA_ABTSTS_ABTIF14_Pos) /*!< PDMA_T::ABTSTS: ABTIF14 Mask */ - -#define PDMA_ABTSTS_ABTIF15_Pos (15) /*!< PDMA_T::ABTSTS: ABTIF15 Position */ -#define PDMA_ABTSTS_ABTIF15_Msk (0x1ul << PDMA_ABTSTS_ABTIF15_Pos) /*!< PDMA_T::ABTSTS: ABTIF15 Mask */ - -#define PDMA_TDSTS_TDIF0_Pos (0) /*!< PDMA_T::TDSTS: TDIF0 Position */ -#define PDMA_TDSTS_TDIF0_Msk (0x1ul << PDMA_TDSTS_TDIF0_Pos) /*!< PDMA_T::TDSTS: TDIF0 Mask */ - -#define PDMA_TDSTS_TDIF1_Pos (1) /*!< PDMA_T::TDSTS: TDIF1 Position */ -#define PDMA_TDSTS_TDIF1_Msk (0x1ul << PDMA_TDSTS_TDIF1_Pos) /*!< PDMA_T::TDSTS: TDIF1 Mask */ - -#define PDMA_TDSTS_TDIF2_Pos (2) /*!< PDMA_T::TDSTS: TDIF2 Position */ -#define PDMA_TDSTS_TDIF2_Msk (0x1ul << PDMA_TDSTS_TDIF2_Pos) /*!< PDMA_T::TDSTS: TDIF2 Mask */ - -#define PDMA_TDSTS_TDIF3_Pos (3) /*!< PDMA_T::TDSTS: TDIF3 Position */ -#define PDMA_TDSTS_TDIF3_Msk (0x1ul << PDMA_TDSTS_TDIF3_Pos) /*!< PDMA_T::TDSTS: TDIF3 Mask */ - -#define PDMA_TDSTS_TDIF4_Pos (4) /*!< PDMA_T::TDSTS: TDIF4 Position */ -#define PDMA_TDSTS_TDIF4_Msk (0x1ul << PDMA_TDSTS_TDIF4_Pos) /*!< PDMA_T::TDSTS: TDIF4 Mask */ - -#define PDMA_TDSTS_TDIF5_Pos (5) /*!< PDMA_T::TDSTS: TDIF5 Position */ -#define PDMA_TDSTS_TDIF5_Msk (0x1ul << PDMA_TDSTS_TDIF5_Pos) /*!< PDMA_T::TDSTS: TDIF5 Mask */ - -#define PDMA_TDSTS_TDIF6_Pos (6) /*!< PDMA_T::TDSTS: TDIF6 Position */ -#define PDMA_TDSTS_TDIF6_Msk (0x1ul << PDMA_TDSTS_TDIF6_Pos) /*!< PDMA_T::TDSTS: TDIF6 Mask */ - -#define PDMA_TDSTS_TDIF7_Pos (7) /*!< PDMA_T::TDSTS: TDIF7 Position */ -#define PDMA_TDSTS_TDIF7_Msk (0x1ul << PDMA_TDSTS_TDIF7_Pos) /*!< PDMA_T::TDSTS: TDIF7 Mask */ - -#define PDMA_TDSTS_TDIF8_Pos (8) /*!< PDMA_T::TDSTS: TDIF8 Position */ -#define PDMA_TDSTS_TDIF8_Msk (0x1ul << PDMA_TDSTS_TDIF8_Pos) /*!< PDMA_T::TDSTS: TDIF8 Mask */ - -#define PDMA_TDSTS_TDIF9_Pos (9) /*!< PDMA_T::TDSTS: TDIF9 Position */ -#define PDMA_TDSTS_TDIF9_Msk (0x1ul << PDMA_TDSTS_TDIF9_Pos) /*!< PDMA_T::TDSTS: TDIF9 Mask */ - -#define PDMA_TDSTS_TDIF10_Pos (10) /*!< PDMA_T::TDSTS: TDIF10 Position */ -#define PDMA_TDSTS_TDIF10_Msk (0x1ul << PDMA_TDSTS_TDIF10_Pos) /*!< PDMA_T::TDSTS: TDIF10 Mask */ - -#define PDMA_TDSTS_TDIF11_Pos (11) /*!< PDMA_T::TDSTS: TDIF11 Position */ -#define PDMA_TDSTS_TDIF11_Msk (0x1ul << PDMA_TDSTS_TDIF11_Pos) /*!< PDMA_T::TDSTS: TDIF11 Mask */ - -#define PDMA_TDSTS_TDIF12_Pos (12) /*!< PDMA_T::TDSTS: TDIF12 Position */ -#define PDMA_TDSTS_TDIF12_Msk (0x1ul << PDMA_TDSTS_TDIF12_Pos) /*!< PDMA_T::TDSTS: TDIF12 Mask */ - -#define PDMA_TDSTS_TDIF13_Pos (13) /*!< PDMA_T::TDSTS: TDIF13 Position */ -#define PDMA_TDSTS_TDIF13_Msk (0x1ul << PDMA_TDSTS_TDIF13_Pos) /*!< PDMA_T::TDSTS: TDIF13 Mask */ - -#define PDMA_TDSTS_TDIF14_Pos (14) /*!< PDMA_T::TDSTS: TDIF14 Position */ -#define PDMA_TDSTS_TDIF14_Msk (0x1ul << PDMA_TDSTS_TDIF14_Pos) /*!< PDMA_T::TDSTS: TDIF14 Mask */ - -#define PDMA_TDSTS_TDIF15_Pos (15) /*!< PDMA_T::TDSTS: TDIF15 Position */ -#define PDMA_TDSTS_TDIF15_Msk (0x1ul << PDMA_TDSTS_TDIF15_Pos) /*!< PDMA_T::TDSTS: TDIF15 Mask */ - -#define PDMA_ALIGN_ALIGNn_Pos (0) /*!< PDMA_T::ALIGN: ALIGNn Position */ -#define PDMA_ALIGN_ALIGNn_Msk (0xfffful << PDMA_ALIGN_ALIGNn_Pos) /*!< PDMA_T::ALIGN: ALIGNn Mask */ - -#define PDMA_TACTSTS_TXACTFn_Pos (0) /*!< PDMA_T::TACTSTS: TXACTFn Position */ -#define PDMA_TACTSTS_TXACTFn_Msk (0xfffful << PDMA_TACTSTS_TXACTFn_Pos) /*!< PDMA_T::TACTSTS: TXACTFn Mask */ - -#define PDMA_TOUTPSC_TOUTPSC0_Pos (0) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Position */ -#define PDMA_TOUTPSC_TOUTPSC0_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC0_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Mask */ - -#define PDMA_TOUTPSC_TOUTPSC1_Pos (4) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Position */ -#define PDMA_TOUTPSC_TOUTPSC1_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC1_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Mask */ - -#define PDMA_TOUTEN_TOUTENn_Pos (0) /*!< PDMA_T::TOUTEN: TOUTENn Position */ -#define PDMA_TOUTEN_TOUTENn_Msk (0x3ul << PDMA_TOUTEN_TOUTENn_Pos) /*!< PDMA_T::TOUTEN: TOUTENn Mask */ - -#define PDMA_TOUTIEN_TOUTIENn_Pos (0) /*!< PDMA_T::TOUTIEN: TOUTIENn Position */ -#define PDMA_TOUTIEN_TOUTIENn_Msk (0x3ul << PDMA_TOUTIEN_TOUTIENn_Pos) /*!< PDMA_T::TOUTIEN: TOUTIENn Mask */ - -#define PDMA_SCATBA_SCATBA_Pos (16) /*!< PDMA_T::SCATBA: SCATBA Position */ -#define PDMA_SCATBA_SCATBA_Msk (0xfffful << PDMA_SCATBA_SCATBA_Pos) /*!< PDMA_T::SCATBA: SCATBA Mask */ - -#define PDMA_TOC0_1_TOC0_Pos (0) /*!< PDMA_T::TOC0_1: TOC0 Position */ -#define PDMA_TOC0_1_TOC0_Msk (0xfffful << PDMA_TOC0_1_TOC0_Pos) /*!< PDMA_T::TOC0_1: TOC0 Mask */ - -#define PDMA_TOC0_1_TOC1_Pos (16) /*!< PDMA_T::TOC0_1: TOC1 Position */ -#define PDMA_TOC0_1_TOC1_Msk (0xfffful << PDMA_TOC0_1_TOC1_Pos) /*!< PDMA_T::TOC0_1: TOC1 Mask */ - -#define PDMA_CHRST_CHnRST_Pos (0) /*!< PDMA_T::CHRST: CHnRST Position */ -#define PDMA_CHRST_CHnRST_Msk (0xfffful << PDMA_CHRST_CHnRST_Pos) /*!< PDMA_T::CHRST: CHnRST Mask */ - -#define PDMA_REQSEL0_3_REQSRC0_Pos (0) /*!< PDMA_T::REQSEL0_3: REQSRC0 Position */ -#define PDMA_REQSEL0_3_REQSRC0_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC0_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC0 Mask */ - -#define PDMA_REQSEL0_3_REQSRC1_Pos (8) /*!< PDMA_T::REQSEL0_3: REQSRC1 Position */ -#define PDMA_REQSEL0_3_REQSRC1_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC1_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC1 Mask */ - -#define PDMA_REQSEL0_3_REQSRC2_Pos (16) /*!< PDMA_T::REQSEL0_3: REQSRC2 Position */ -#define PDMA_REQSEL0_3_REQSRC2_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC2_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC2 Mask */ - -#define PDMA_REQSEL0_3_REQSRC3_Pos (24) /*!< PDMA_T::REQSEL0_3: REQSRC3 Position */ -#define PDMA_REQSEL0_3_REQSRC3_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC3_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC3 Mask */ - -#define PDMA_REQSEL4_7_REQSRC4_Pos (0) /*!< PDMA_T::REQSEL4_7: REQSRC4 Position */ -#define PDMA_REQSEL4_7_REQSRC4_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC4_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC4 Mask */ - -#define PDMA_REQSEL4_7_REQSRC5_Pos (8) /*!< PDMA_T::REQSEL4_7: REQSRC5 Position */ -#define PDMA_REQSEL4_7_REQSRC5_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC5_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC5 Mask */ - -#define PDMA_REQSEL4_7_REQSRC6_Pos (16) /*!< PDMA_T::REQSEL4_7: REQSRC6 Position */ -#define PDMA_REQSEL4_7_REQSRC6_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC6_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC6 Mask */ - -#define PDMA_REQSEL4_7_REQSRC7_Pos (24) /*!< PDMA_T::REQSEL4_7: REQSRC7 Position */ -#define PDMA_REQSEL4_7_REQSRC7_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC7_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC7 Mask */ - -#define PDMA_STCRn_STC_Pos (0) /*!< PDMA_T::STCRn: STC Position */ -#define PDMA_STCRn_STC_Msk (0xfffful << PDMA_STCRn_STC_Pos) /*!< PDMA_T::STCRn: STC Mask */ - -#define PDMA_ASOCRn_SASOL_Pos (0) /*!< PDMA_T::ASOCRn: SASOL Position */ -#define PDMA_ASOCRn_SASOL_Msk (0xfffful << PDMA_ASOCRn_SASOL_Pos) /*!< PDMA_T::ASOCRn: SASOL Mask */ - -#define PDMA_ASOCRn_DASOL_Pos (16) /*!< PDMA_T::ASOCRn: DASOL Position */ -#define PDMA_ASOCRn_DASOL_Msk (0xfffful << PDMA_ASOCRn_DASOL_Pos) /*!< PDMA_T::ASOCRn: DASOL Mask */ - -#define PDMA_AICTLn_SAICNT_Pos (0) /*!< PDMA_T::AICTLn: SAICNT Position */ -#define PDMA_AICTLn_SAICNT_Msk (0xfffful << PDMA_ASOCRn_SASOL_Pos) /*!< PDMA_T::AICTLn: SAICNT Mask */ - -#define PDMA_AICTLn_DAICNT_Pos (16) /*!< PDMA_T::AICTLn: DAICNT Position */ -#define PDMA_AICTLn_DAICNT_Msk (0xfffful << PDMA_ASOCRn_DASOL_Pos) /*!< PDMA_T::AICTLn: DAICNT Mask */ - -#define PDMA_RCNTn_RCNT_Pos (0) /*!< PDMA_T::RCNTn: RCNT Position */ -#define PDMA_RCNTn_RCNT_Msk (0xfffful << PDMA_STCRn_RCNT_Pos) /*!< PDMA_T::RCNTn: RCNT Mask */ - -/**@}*/ /* PDMA_CONST */ -/**@}*/ /* end of PDMA register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __PDMA_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qei_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qei_reg.h deleted file mode 100644 index 42a14c9d52f..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qei_reg.h +++ /dev/null @@ -1,308 +0,0 @@ -/**************************************************************************//** - * @file qei_reg.h - * @version V1.00 - * @brief QEI register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __QEI_REG_H__ -#define __QEI_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Quadrature Encoder Interface -------------------------*/ -/** - @addtogroup QEI Quadrature Encoder Interface(QEI) - Memory Mapped Structure for QEI Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var QEI_T::CNT - * Offset: 0x00 QEI Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |Quadrature Encoder Interface Counter - * | | |A 32-bit up/down counter - * | | |When an effective phase pulse is detected, this counter is increased by one if the bit DIRF (QEI_STATUS[8]) is one or decreased by one if the bit DIRF is zero - * | | |This register performs an integrator which count value is proportional to the encoder position - * | | |The pulse counter may be initialized to a predetermined value by one of three events occurs: - * | | |1. Software is written if QEIEN (QEI_CTL[29]) = 0. - * | | |2. Compare-match event if QEIEN=1 and QEI is in compare-counting mode. - * | | |3. Index signal change if QEIEN=1 and IDXRLDEN (QEI_CTL[27])=1. - * @var QEI_T::CNTHOLD - * Offset: 0x04 QEI Counter Hold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTHOLD |Quadrature Encoder Interface Counter Hold - * | | |When bit HOLDCNT (QEI_CTL[24]) goes from low to high, the CNT(QEI_CNT[31:0]) is copied into CNTHOLD (QEI_CNTHOLD[31:0]) register. - * @var QEI_T::CNTLATCH - * Offset: 0x08 QEI Counter Index Latch Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTLATCH |Quadrature Encoder Interface Counter Index Latch - * | | |When the IDXF (QEI_STATUS[0]) bit is set, the CNT(QEI_CNT[31:0]) is copied into CNTLATCH (QEI_CNTLATCH[31:0]) register. - * @var QEI_T::CNTCMP - * Offset: 0x0C QEI Counter Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTCMP |Quadrature Encoder Interface Counter Compare - * | | |If the QEI controller is in the compare-counting mode CMPEN (QEI_CTL[28]) =1, when the value of CNT(QEI_CNT[31:0]) matches CNTCMP(QEI_CNTCMP[31:0]), CMPF will be set - * | | |This register is software writable. - * @var QEI_T::CNTMAX - * Offset: 0x14 QEI Pre-set Maximum Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTMAX |Quadrature Encoder Interface Preset Maximum Count - * | | |This register value determined by user stores the maximum value which may be the number of the QEI counter for the QEI controller compare-counting mode - * @var QEI_T::CTL - * Offset: 0x18 QEI Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection - * | | |To determine the sampling frequency of the Noise Filter clock . - * | | |000 = QEI_CLK. - * | | |001 = QEI_CLK/2. - * | | |010 = QEI_CLK/4. - * | | |011 = QEI_CLK/16. - * | | |100 = QEI_CLK/32. - * | | |101 = QEI_CLK/64. - * |[3] |NFDIS |QEI Controller Input Noise Filter Disable Bit - * | | |0 = The noise filter of QEI controller Enabled. - * | | |1 = The noise filter of QEI controller Disabled. - * |[4] |CHAEN |QEA Input to QEI Controller Enable Bit - * | | |0 = QEA input to QEI Controller Disabled. - * | | |1 = QEA input to QEI Controller Enabled. - * |[5] |CHBEN |QEB Input to QEI Controller Enable Bit - * | | |0 = QEB input to QEI Controller Disabled. - * | | |1 = QEB input to QEI Controller Enabled. - * |[6] |IDXEN |IDX Input to QEI Controller Enable Bit - * | | |0 = IDX input to QEI Controller Disabled. - * | | |1 = IDX input to QEI Controller Enabled. - * |[9:8] |MODE |QEI Counting Mode Selection - * | | |There are four quadrature encoder pulse counter operation modes. - * | | |00 = X4 Free-counting Mode. - * | | |01 = X2 Free-counting Mode. - * | | |10 = X4 Compare-counting Mode. - * | | |11 = X2 Compare-counting Mode. - * |[12] |CHAINV |Inverse QEA Input Polarity - * | | |0 = Not inverse QEA input polarity. - * | | |1 = QEA input polarity is inverse to QEI controller. - * |[13] |CHBINV |Inverse QEB Input Polarity - * | | |0 = Not inverse QEB input polarity. - * | | |1 = QEB input polarity is inverse to QEI controller. - * |[14] |IDXINV |Inverse IDX Input Polarity - * | | |0 = Not inverse IDX input polarity. - * | | |1 = IDX input polarity is inverse to QEI controller. - * |[16] |OVUNIEN |OVUNF Trigger QEI Interrupt Enable Bit - * | | |0 = OVUNF can trigger QEI controller interrupt Disabled. - * | | |1 = OVUNF can trigger QEI controller interrupt Enabled. - * |[17] |DIRIEN |DIRCHGF Trigger QEI Interrupt Enable Bit - * | | |0 = DIRCHGF can trigger QEI controller interrupt Disabled. - * | | |1 = DIRCHGF can trigger QEI controller interrupt Enabled. - * |[18] |CMPIEN |CMPF Trigger QEI Interrupt Enable Bit - * | | |0 = CMPF can trigger QEI controller interrupt Disabled. - * | | |1 = CMPF can trigger QEI controller interrupt Enabled. - * |[19] |IDXIEN |IDXF Trigger QEI Interrupt Enable Bit - * | | |0 = The IDXF can trigger QEI interrupt Disabled. - * | | |1 = The IDXF can trigger QEI interrupt Enabled. - * |[20] |HOLDTMR0 |Hold QEI_CNT by Timer 0 - * | | |0 = TIF (TIMER0_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER0_INTSTS[0]) in timer 0 sets HOLDCNT to 1. - * |[21] |HOLDTMR1 |Hold QEI_CNT by Timer 1 - * | | |0 = TIF(TIMER1_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF (TIMER1_INTSTS[0]) in timer 1 sets HOLDCNT to 1. - * |[22] |HOLDTMR2 |Hold QEI_CNT by Timer 2 - * | | |0 = TIF(TIMER2_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER2_INTSTS[0]) in timer 2 sets HOLDCNT to 1. - * |[23] |HOLDTMR3 |Hold QEI_CNT by Timer 3 - * | | |0 = TIF (TIMER3_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER3_INTSTS[0]) in timer 3 sets HOLDCNT to 1. - * |[24] |HOLDCNT |Hold QEI_CNT Control - * | | |When this bit is set from low to high, the CNT(QEI_CNT[31:0]) is copied into QEI_CNTHOLD - * | | |This bit may be set by writing 1 to it or Timer0~Timer3 interrupt flag TIF (TIMERx_INTSTS[0]). - * | | |0 = No operation. - * | | |1 = QEI_CNT content is captured and stored in QEI_CNTHOLD. - * | | |Note: This bit is automatically cleared after QEI_CNTHOLD holds QEI_CNT value. - * |[25] |IDXLATEN |Index Latch QEI_CNT Enable Bit - * | | |If this bit is set to high, the QEI_CNT content will be latched into QEI_CNTLATCH at every rising on signal CHX. - * | | |0 = The index signal latch QEI counter function Disabled. - * | | |1 = The index signal latch QEI counter function Enabled. - * |[27] |IDXRLDEN |Index Trigger QEI_CNT Reload Enable Bit - * | | |When this bit is high and a rising edge comes on signal CHX, the QEI_CNT will be reset to zero if the counter is in up-counting type (DIRF = 1); while the QEI_CNT will be reloaded with CNTMAX (QEI_CNTMAX[31:0]) content if the counter is in down-counting type (DIRF = 0). - * | | |0 = Reload function Disabled. - * | | |1 = QEI_CNT re-initialized by Index signal Enabled. - * |[28] |CMPEN |the Compare Function Enable Bit - * | | |The compare function in QEI controller is to compare the dynamic counting QEI_CNT with the compare register CNTCMP( QEI_CNTCMP[31:0]), if CNT(QEI_CNT[31:0]) reaches CNTCMP( QEI_CNTCMP[31:0]), the flag CMPF will be set. - * | | |0 = Compare function Disabled. - * | | |1 = Compare function Enabled. - * |[29] |QEIEN |Quadrature Encoder Interface Controller Enable Bit - * | | |0 = QEI controller function Disabled. - * | | |1 = QEI controller function Enabled. - * @var QEI_T::STATUS - * Offset: 0x2C QEI Controller Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IDXF |IDX Detected Flag - * | | |When the QEI controller detects a rising edge on signal CHX it will set flag IDXF to high. - * | | |0 = No rising edge detected on signal CHX. - * | | |1 = A rising edge occurs on signal CHX. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[1] |CMPF |Compare-match Flag - * | | |If the QEI compare function is enabled, the flag is set by hardware while QEI counter up or down counts and reach to the CNTCMP(QEI_CNTCMP[31:0]). - * | | |0 = QEI counter does not match with CNTCMP(QEI_CNTCMP[31:0]). - * | | |1 = QEI counter counts to the same as CNTCMP(QEI_CNTCMP[31:0]). - * | | |Note: This bit is only cleared by writing 1 to it. - * |[2] |OVUNF |QEI Counter Overflow or Underflow Flag - * | | |Flag is set by hardware while QEI_CNT overflows from 0xFFFF_FFFF to zero in free-counting mode or from the CNTMAX (QEI_CNTMAX[31:0]) to zero in compare-counting mode - * | | |Similarly, the flag is set wile QEI counter underflow from zero to 0xFFFF_FFFF or CNTMAX (QEI_CNTMAX[31:0]). - * | | |0 = No overflow or underflow occurs in QEI counter. - * | | |1 = QEI counter occurs counting overflow or underflow. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[3] |DIRCHGF |Direction Change Flag - * | | |Flag is set by hardware while QEI counter counting direction is changed - * | | |Software can clear this bit by writing 1 to it. - * | | |0 = No change in QEI counter counting direction. - * | | |1 = QEI counter counting direction is changed. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[8] |DIRF |QEI Counter Counting Direction Indication - * | | |0 = QEI Counter is in down-counting. - * | | |1 = QEI Counter is in up-counting. - * | | |Note: This bit is set/reset by hardware according to the phase detection between CHA and CHB. - */ - __IO uint32_t CNT; /*!< [0x0000] QEI Counter Register */ - __IO uint32_t CNTHOLD; /*!< [0x0004] QEI Counter Hold Register */ - __IO uint32_t CNTLATCH; /*!< [0x0008] QEI Counter Index Latch Register */ - __IO uint32_t CNTCMP; /*!< [0x000c] QEI Counter Compare Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t CNTMAX; /*!< [0x0014] QEI Pre-set Maximum Count Register */ - __IO uint32_t CTL; /*!< [0x0018] QEI Controller Control Register */ - __I uint32_t RESERVE1[4]; - __IO uint32_t STATUS; /*!< [0x002c] QEI Controller Status Register */ - -} QEI_T; - -/** - @addtogroup QEI_CONST QEI Bit Field Definition - Constant Definitions for QEI Controller - @{ -*/ - -#define QEI_CNT_CNT_Pos (0) /*!< QEI_T::CNT: CNT Position */ -#define QEI_CNT_CNT_Msk (0xfffffffful << QEI_CNT_CNT_Pos) /*!< QEI_T::CNT: CNT Mask */ - -#define QEI_CNTHOLD_CNTHOLD_Pos (0) /*!< QEI_T::CNTHOLD: CNTHOLD Position */ -#define QEI_CNTHOLD_CNTHOLD_Msk (0xfffffffful << QEI_CNTHOLD_CNTHOLD_Pos) /*!< QEI_T::CNTHOLD: CNTHOLD Mask */ - -#define QEI_CNTLATCH_CNTLATCH_Pos (0) /*!< QEI_T::CNTLATCH: CNTLATCH Position */ -#define QEI_CNTLATCH_CNTLATCH_Msk (0xfffffffful << QEI_CNTLATCH_CNTLATCH_Pos) /*!< QEI_T::CNTLATCH: CNTLATCH Mask */ - -#define QEI_CNTCMP_CNTCMP_Pos (0) /*!< QEI_T::CNTCMP: CNTCMP Position */ -#define QEI_CNTCMP_CNTCMP_Msk (0xfffffffful << QEI_CNTCMP_CNTCMP_Pos) /*!< QEI_T::CNTCMP: CNTCMP Mask */ - -#define QEI_CNTMAX_CNTMAX_Pos (0) /*!< QEI_T::CNTMAX: CNTMAX Position */ -#define QEI_CNTMAX_CNTMAX_Msk (0xfffffffful << QEI_CNTMAX_CNTMAX_Pos) /*!< QEI_T::CNTMAX: CNTMAX Mask */ - -#define QEI_CTL_NFCLKSEL_Pos (0) /*!< QEI_T::CTL: NFCLKSEL Position */ -#define QEI_CTL_NFCLKSEL_Msk (0x7ul << QEI_CTL_NFCLKSEL_Pos) /*!< QEI_T::CTL: NFCLKSEL Mask */ - -#define QEI_CTL_NFDIS_Pos (3) /*!< QEI_T::CTL: NFDIS Position */ -#define QEI_CTL_NFDIS_Msk (0x1ul << QEI_CTL_NFDIS_Pos) /*!< QEI_T::CTL: NFDIS Mask */ - -#define QEI_CTL_CHAEN_Pos (4) /*!< QEI_T::CTL: CHAEN Position */ -#define QEI_CTL_CHAEN_Msk (0x1ul << QEI_CTL_CHAEN_Pos) /*!< QEI_T::CTL: CHAEN Mask */ - -#define QEI_CTL_CHBEN_Pos (5) /*!< QEI_T::CTL: CHBEN Position */ -#define QEI_CTL_CHBEN_Msk (0x1ul << QEI_CTL_CHBEN_Pos) /*!< QEI_T::CTL: CHBEN Mask */ - -#define QEI_CTL_IDXEN_Pos (6) /*!< QEI_T::CTL: IDXEN Position */ -#define QEI_CTL_IDXEN_Msk (0x1ul << QEI_CTL_IDXEN_Pos) /*!< QEI_T::CTL: IDXEN Mask */ - -#define QEI_CTL_MODE_Pos (8) /*!< QEI_T::CTL: MODE Position */ -#define QEI_CTL_MODE_Msk (0x3ul << QEI_CTL_MODE_Pos) /*!< QEI_T::CTL: MODE Mask */ - -#define QEI_CTL_CHAINV_Pos (12) /*!< QEI_T::CTL: CHAINV Position */ -#define QEI_CTL_CHAINV_Msk (0x1ul << QEI_CTL_CHAINV_Pos) /*!< QEI_T::CTL: CHAINV Mask */ - -#define QEI_CTL_CHBINV_Pos (13) /*!< QEI_T::CTL: CHBINV Position */ -#define QEI_CTL_CHBINV_Msk (0x1ul << QEI_CTL_CHBINV_Pos) /*!< QEI_T::CTL: CHBINV Mask */ - -#define QEI_CTL_IDXINV_Pos (14) /*!< QEI_T::CTL: IDXINV Position */ -#define QEI_CTL_IDXINV_Msk (0x1ul << QEI_CTL_IDXINV_Pos) /*!< QEI_T::CTL: IDXINV Mask */ - -#define QEI_CTL_OVUNIEN_Pos (16) /*!< QEI_T::CTL: OVUNIEN Position */ -#define QEI_CTL_OVUNIEN_Msk (0x1ul << QEI_CTL_OVUNIEN_Pos) /*!< QEI_T::CTL: OVUNIEN Mask */ - -#define QEI_CTL_DIRIEN_Pos (17) /*!< QEI_T::CTL: DIRIEN Position */ -#define QEI_CTL_DIRIEN_Msk (0x1ul << QEI_CTL_DIRIEN_Pos) /*!< QEI_T::CTL: DIRIEN Mask */ - -#define QEI_CTL_CMPIEN_Pos (18) /*!< QEI_T::CTL: CMPIEN Position */ -#define QEI_CTL_CMPIEN_Msk (0x1ul << QEI_CTL_CMPIEN_Pos) /*!< QEI_T::CTL: CMPIEN Mask */ - -#define QEI_CTL_IDXIEN_Pos (19) /*!< QEI_T::CTL: IDXIEN Position */ -#define QEI_CTL_IDXIEN_Msk (0x1ul << QEI_CTL_IDXIEN_Pos) /*!< QEI_T::CTL: IDXIEN Mask */ - -#define QEI_CTL_HOLDTMR0_Pos (20) /*!< QEI_T::CTL: HOLDTMR0 Position */ -#define QEI_CTL_HOLDTMR0_Msk (0x1ul << QEI_CTL_HOLDTMR0_Pos) /*!< QEI_T::CTL: HOLDTMR0 Mask */ - -#define QEI_CTL_HOLDTMR1_Pos (21) /*!< QEI_T::CTL: HOLDTMR1 Position */ -#define QEI_CTL_HOLDTMR1_Msk (0x1ul << QEI_CTL_HOLDTMR1_Pos) /*!< QEI_T::CTL: HOLDTMR1 Mask */ - -#define QEI_CTL_HOLDTMR2_Pos (22) /*!< QEI_T::CTL: HOLDTMR2 Position */ -#define QEI_CTL_HOLDTMR2_Msk (0x1ul << QEI_CTL_HOLDTMR2_Pos) /*!< QEI_T::CTL: HOLDTMR2 Mask */ - -#define QEI_CTL_HOLDTMR3_Pos (23) /*!< QEI_T::CTL: HOLDTMR3 Position */ -#define QEI_CTL_HOLDTMR3_Msk (0x1ul << QEI_CTL_HOLDTMR3_Pos) /*!< QEI_T::CTL: HOLDTMR3 Mask */ - -#define QEI_CTL_HOLDCNT_Pos (24) /*!< QEI_T::CTL: HOLDCNT Position */ -#define QEI_CTL_HOLDCNT_Msk (0x1ul << QEI_CTL_HOLDCNT_Pos) /*!< QEI_T::CTL: HOLDCNT Mask */ - -#define QEI_CTL_IDXLATEN_Pos (25) /*!< QEI_T::CTL: IDXLATEN Position */ -#define QEI_CTL_IDXLATEN_Msk (0x1ul << QEI_CTL_IDXLATEN_Pos) /*!< QEI_T::CTL: IDXLATEN Mask */ - -#define QEI_CTL_IDXRLDEN_Pos (27) /*!< QEI_T::CTL: IDXRLDEN Position */ -#define QEI_CTL_IDXRLDEN_Msk (0x1ul << QEI_CTL_IDXRLDEN_Pos) /*!< QEI_T::CTL: IDXRLDEN Mask */ - -#define QEI_CTL_CMPEN_Pos (28) /*!< QEI_T::CTL: CMPEN Position */ -#define QEI_CTL_CMPEN_Msk (0x1ul << QEI_CTL_CMPEN_Pos) /*!< QEI_T::CTL: CMPEN Mask */ - -#define QEI_CTL_QEIEN_Pos (29) /*!< QEI_T::CTL: QEIEN Position */ -#define QEI_CTL_QEIEN_Msk (0x1ul << QEI_CTL_QEIEN_Pos) /*!< QEI_T::CTL: QEIEN Mask */ - -#define QEI_STATUS_IDXF_Pos (0) /*!< QEI_T::STATUS: IDXF Position */ -#define QEI_STATUS_IDXF_Msk (0x1ul << QEI_STATUS_IDXF_Pos) /*!< QEI_T::STATUS: IDXF Mask */ - -#define QEI_STATUS_CMPF_Pos (1) /*!< QEI_T::STATUS: CMPF Position */ -#define QEI_STATUS_CMPF_Msk (0x1ul << QEI_STATUS_CMPF_Pos) /*!< QEI_T::STATUS: CMPF Mask */ - -#define QEI_STATUS_OVUNF_Pos (2) /*!< QEI_T::STATUS: OVUNF Position */ -#define QEI_STATUS_OVUNF_Msk (0x1ul << QEI_STATUS_OVUNF_Pos) /*!< QEI_T::STATUS: OVUNF Mask */ - -#define QEI_STATUS_DIRCHGF_Pos (3) /*!< QEI_T::STATUS: DIRCHGF Position */ -#define QEI_STATUS_DIRCHGF_Msk (0x1ul << QEI_STATUS_DIRCHGF_Pos) /*!< QEI_T::STATUS: DIRCHGF Mask */ - -#define QEI_STATUS_DIRF_Pos (8) /*!< QEI_T::STATUS: DIRF Position */ -#define QEI_STATUS_DIRF_Msk (0x1ul << QEI_STATUS_DIRF_Pos) /*!< QEI_T::STATUS: DIRF Mask */ - -/**@}*/ /* QEI_CONST */ -/**@}*/ /* end of QEI register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __QEI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qspi_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qspi_reg.h deleted file mode 100644 index 23e18e0e314..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/qspi_reg.h +++ /dev/null @@ -1,622 +0,0 @@ -/**************************************************************************//** - * @file qspi_reg.h - * @version V1.00 - * @brief QSPI register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __QSPI_REG_H__ -#define __QSPI_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Quad Serial Peripheral Interface Controller -------------------------*/ -/** - @addtogroup QSPI Quad Serial Peripheral Interface Controller(QSPI) - Memory Mapped Structure for QSPI Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var QSPI_T::CTL - * Offset: 0x00 QSPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIEN |QSPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1 - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of QSPIx_CTL, QSPIx_CLKDIV, QSPIx_SSCTL and QSPIx_FIFOCTL registers, user shall clear the SPIEN (QSPIx_CTL[0]) and confirm the SPIENSTS (QSPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of QSPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of QSPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of QSPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of QSPI bus clock. - * | | |Note: In TX DTR mode, TXNEG equals to CLKPOL (QSPIx_CTL[3]). - * |[3] |CLKPOL |Clock Polarity - * | | |0 = QSPI bus clock is idle low. - * | | |1 = QSPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a Master transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of QSPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 .... 0.5 QSPICLK clock cycle. - * | | |SUSPITV = 0x1 .... 1.5 QSPICLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE .... 14.5 QSPICLK clock cycle. - * | | |SUSPITV = 0xF .... 15.5 QSPICLK clock cycle. - * | | |Note: In TX DTR mode, SUSPITV equals to 0x0. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 .... 8 bits. - * | | |DWIDTH = 0x09 .... 9 bits. - * | | |..... - * | | |DWIDTH = 0x1F .... 31 bits. - * | | |DWIDTH = 0x00 .... 32 bits. - * | | |Note: For QSPI0~QSPI3, this bit field will decide the depth of TX/RX FIFO configuration in QSPI mode - * | | |Therefore, changing this bit field will clear TX/RX FIFO by hardware automatically in QSPI0~QSPI3. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the QSPI TX register, is sent first to the QSPI data output pin, and the first bit received from the QSPI data input pin will be put in the LSB position of the RX register (bit 0 of QSPI_RX). - * |[14] |HALFDPX |QSPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for QSPI transfer - * | | |The bit field DATDIR (QSPIx_CTL[20]) can be used to set the data direction in half-duplex transfer. - * | | |0 = QSPI operates in full-duplex transfer. - * | | |1 = QSPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only Mode Enable Bit - * | | |This bit field is only available in Master mode - * | | |In receive-only mode, QSPI Master will generate QSPI bus clock continuously for receiving data bit from QSPI slave device and assert the BUSY status. - * | | |0 = Receive-only mode Disabled. - * | | |1 = Receive-only mode Enabled. - * |[16] |TWOBIT |2-bit Transfer Mode Enable Bit - * | | |0 = 2-Bit Transfer mode Disabled. - * | | |1 = 2-Bit Transfer mode Enabled. - * | | |Note: When 2-Bit Transfer mode is enabled, the first serial transmitted bit data is from the first FIFO buffer data, and the 2nd serial transmitted bit data is from the second FIFO buffer data - * | | |As the same as transmitted function, the first received bit data is stored into the first FIFO buffer and the 2nd received bit data is stored into the second FIFO buffer at the same time. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = QSPI unit transfer interrupt Disabled. - * | | |1 = QSPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled - * | | |A byte suspend interval will be inserted among each byte - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction in half-duplex transfer and Dual/Quad transfer - * | | |0 = QSPI data is input direction. - * | | |1 = QSPI data is output direction. - * |[21] |DUALIOEN |Dual I/O Mode Enable Bit - * | | |0 = Dual I/O mode Disabled. - * | | |1 = Dual I/O mode Enabled. - * |[22] |QUADIOEN |Quad I/O Mode Enable Bit - * | | |0 = Quad I/O mode Disabled. - * | | |1 = Quad I/O mode Enabled. - * |[23] |TXDTREN |Transmit Double Transfer Rate Mode Enable Bit - * | | |0 = TX DTR mode Disabled. - * | | |1 = TX DTR mode Enabled. - * | | |Note: QSPI Master mode supports TXDTR (Transmit Double Transfer Rate) mode, and QSPI Slave mode does not support this mode. - * @var QSPI_T::CLKDIV - * Offset: 0x04 QSPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the QSPI bus clock of QSPI Master - * | | |The frequency is obtained according to the following equation. - * | | |where - * | | |is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * | | |Note: The time interval must be larger than or equal 5 peripheral clock cycles between releasing QSPI IP software reset and setting this clock divider register. - * @var QSPI_T::SSCTL - * Offset: 0x08 QSPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = Set the QSPIx_SS line to inactive state. - * | | |1 = Set the QSPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the QSPIx_SS line at inactive state. - * | | |1 = QSPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time - * | | |The active state of QSPIx_SS is specified in SSACTPOL (QSPIx_SSCTL[2]). - * | | |Note: Master mode only. - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (QSPIx_SS). - * | | |0 = The slave selection signal QSPIx_SS is active low. - * | | |1 = The slave selection signal QSPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit - * | | |0 = Automatic slave selection function Disabled - * | | |Slave selection signal will be asserted/de-asserted according to SS (QSPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * | | |Note: Master mode only. - * |[4] |SLV3WIRE |Slave 3-wire Mode Enable Bit - * | | |In Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPI0_CLK, QSPI0_MISO and QSPI0_MOSI pins. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[5] |SLVTOIEN |Slave Mode Time-out Interrupt Enable Bit - * | | |0 = Slave mode time-out interrupt Disabled. - * | | |1 = Slave mode time-out interrupt Enabled. - * |[6] |SLVTORST |Slave Mode Time-out Reset Control - * | | |0 = When Slave mode time-out event occurs, the TX and RX control circuit will not be reset. - * | | |1 = When Slave mode time-out event occurs, the TX and RX control circuit will be reset by hardware. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * |[31:16] |SLVTOCNT |Slave Mode Time-out Period - * | | |In Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active - * | | |The clock source of the time-out counter is Slave peripheral clock - * | | |If the value is 0, it indicates the slave mode time-out function is disabled. - * @var QSPI_T::PDMACTL - * Offset: 0x0C QSPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In QSPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the QSPI controller. This bit will be automatically cleared to 0. - * @var QSPI_T::FIFOCTL - * Offset: 0x10 QSPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * | | |Note: If TX underflow event occurs in QSPI Slave mode, this bit can be used to make QSPI return to idle state. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The QSPI data out is kept 0 if there is TX underflow event in Slave mode. - * | | |1 = The QSPI data out is kept 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is no any data in TX FIFO when the slave selection signal is active. - * | | |2. When TX underflow event occurs, QSPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward - * | | |Data stored in TX FIFO will be sent through QSPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |When TX underflow event occurs in Slave mode, TXUFIF (QSPIx_STATUS[19]) will be set to 1 - * | | |This bit is used to enable the TX underflow interrupt. - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[10] |SLVBERX |RX FIFO Write Data Enable Bit When Slave Mode Bit Count Error - * | | |0 = Uncompleted RX data will be dropped from RX FIFO when bit count error event happened in QSPI Slave mode. - * | | |1 = Uncompleted RX data will be written into RX FIFO when bit count error event happened in QSPI Slave mode - * | | |User can read SLVBENUM (QSPIx_STATUS2[29:24]) to know that the effective bit number of uncompleted RX data when SPI slave bit count error happened. - * | | |Note: Slave mode only. - * |[26:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0 - * | | |For QSPI0~QSPI3, the MSB of this bit field is only meaningful while QSPI mode 8~16 bits of data length. - * |[30:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0 - * | | |For QSPI0~QSPI3, the MSB of this bit field is only meaningful while QSPI mode 8~16 bits of data length. - * @var QSPI_T::STATUS - * Offset: 0x14 QSPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = QSPI controller is in idle state. - * | | |1 = QSPI controller is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. QSPIx_CTL[0] = 1 and TXEMPTY = 0. - * | | |b - * | | |For QSPI Master mode, QSPIx_CTL[0] = 1 and TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For QSPI Master mode, QSPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d. - * | | |For QSPI Slave mode, the QSPIx_CTL[0] = 1 and there is serial clock input into the QSPI core logic when slave select is active. - * | | |e. - * | | |For QSPI Slave mode, the QSPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * | | |Note: By applications, this QSPI busy flag should be used with other status registers in QSPIx_STATUS such as TXCNT, RXCNT, TXTHIF, TXFULL, TXEMPTY, RXTHIF, RXFULL, RXEMPTY, and UNITIF - * | | |Therefore the QSPI transfer done events of TX/RX operations can be obtained at correct timing point. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = QSPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode - * | | |If SSACTPOL (QSPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the QSPI slave select is in inactive status. - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag - * | | |When the slave select is active and the value of SLVTOCNT is not 0, if the bus clock is detected, the slave time-out counter in QSPI controller logic will be started - * | | |When the value of time-out counter is greater than or equal to the value of SLVTOCNT (QSPI_SSCTL[31:16]) before one transaction is done, the slave time-out interrupt event will be asserted. - * | | |0 = Slave time-out is not active. - * | | |1 = Slave time-out is active. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBEIF also active when the slave select goes to inactive state - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is overrun. - * | | |1 = Receive FIFO is overrun. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 QSPI peripheral clock periods in Master mode or over 576 QSPI peripheral clock periods in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |SPIENSTS |QSPI Enable Status (Read Only) - * | | |0 = The QSPI controller is disabled. - * | | |1 = The QSPI controller is enabled. - * | | |Note: The QSPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the QSPI control logic is disabled, this bit indicates the real status of QSPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slave's transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var QSPI_T::STATUS2 - * Offset: 0x18 QSPI Status2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[29:24] |SLVBENUM |Effective Bit Number of Uncompleted RX Data - * | | |This status register indicates that effective bit number of uncompleted RX data when SLVBERX (QSPIx_FIFOCTL[10]) is enabled and RX bit count error event happen in QSPI Slave mode - * | | |This status register will be fixed to 0x0 when SLVBERX (QSPIx_FIFOCTL[10]) is disabled. - * | | |Note 1: This register will be cleared to 0x0 when user writes 0x1 to SLVBEIF (QSPIx_STATUS[6]). - * | | |Note 2: Slave mode only. - * @var QSPI_T::TX - * Offset: 0x20 QSPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 8-level transmit FIFO buffers - * | | |The number of valid bits depends on the setting of DWIDTH (QSPIx_CTL[12:8]) in QSPI mode. - * | | |In QSPI mode, if DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted. - * | | |If DWIDTH is set to 0x00 , the QSPI controller will perform a 32-bit transfer. - * | | |Note: In Master mode, QSPI controller will start to transfer the QSPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var QSPI_T::RX - * Offset: 0x30 QSPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register (Read Only) - * | | |There are 8-level FIFO buffers in this controller. - * | | |The data receive register holds the data received from QSPI data input pin. - * | | |If the RXEMPTY (QSPIx_STATUS[8]) is not set to 1, the receive FIFO buffers can be accessed through software by reading this register. - */ - __IO uint32_t CTL; /*!< [0x0000] QSPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] QSPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] QSPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] QSPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] QSPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] QSPI Status Register */ - __I uint32_t STATUS2; /*!< [0x0018] QSPI Status2 Register */ - __I uint32_t RESERVE0[1]; - __O uint32_t TX; /*!< [0x0020] QSPI Data Transmit Register */ - __I uint32_t RESERVE1[3]; - __I uint32_t RX; /*!< [0x0030] QSPI Data Receive Register */ - -} QSPI_T; - -/** - @addtogroup QSPI_CONST QSPI Bit Field Definition - Constant Definitions for QSPI Controller - @{ -*/ - -#define QSPI_CTL_SPIEN_Pos (0) /*!< QSPI_T::CTL: SPIEN Position */ -#define QSPI_CTL_SPIEN_Msk (0x1ul << QSPI_CTL_SPIEN_Pos) /*!< QSPI_T::CTL: SPIEN Mask */ - -#define QSPI_CTL_RXNEG_Pos (1) /*!< QSPI_T::CTL: RXNEG Position */ -#define QSPI_CTL_RXNEG_Msk (0x1ul << QSPI_CTL_RXNEG_Pos) /*!< QSPI_T::CTL: RXNEG Mask */ - -#define QSPI_CTL_TXNEG_Pos (2) /*!< QSPI_T::CTL: TXNEG Position */ -#define QSPI_CTL_TXNEG_Msk (0x1ul << QSPI_CTL_TXNEG_Pos) /*!< QSPI_T::CTL: TXNEG Mask */ - -#define QSPI_CTL_CLKPOL_Pos (3) /*!< QSPI_T::CTL: CLKPOL Position */ -#define QSPI_CTL_CLKPOL_Msk (0x1ul << QSPI_CTL_CLKPOL_Pos) /*!< QSPI_T::CTL: CLKPOL Mask */ - -#define QSPI_CTL_SUSPITV_Pos (4) /*!< QSPI_T::CTL: SUSPITV Position */ -#define QSPI_CTL_SUSPITV_Msk (0xful << QSPI_CTL_SUSPITV_Pos) /*!< QSPI_T::CTL: SUSPITV Mask */ - -#define QSPI_CTL_DWIDTH_Pos (8) /*!< QSPI_T::CTL: DWIDTH Position */ -#define QSPI_CTL_DWIDTH_Msk (0x1ful << QSPI_CTL_DWIDTH_Pos) /*!< QSPI_T::CTL: DWIDTH Mask */ - -#define QSPI_CTL_LSB_Pos (13) /*!< QSPI_T::CTL: LSB Position */ -#define QSPI_CTL_LSB_Msk (0x1ul << QSPI_CTL_LSB_Pos) /*!< QSPI_T::CTL: LSB Mask */ - -#define QSPI_CTL_HALFDPX_Pos (14) /*!< QSPI_T::CTL: HALFDPX Position */ -#define QSPI_CTL_HALFDPX_Msk (0x1ul << QSPI_CTL_HALFDPX_Pos) /*!< QSPI_T::CTL: HALFDPX Mask */ - -#define QSPI_CTL_RXONLY_Pos (15) /*!< QSPI_T::CTL: RXONLY Position */ -#define QSPI_CTL_RXONLY_Msk (0x1ul << QSPI_CTL_RXONLY_Pos) /*!< QSPI_T::CTL: RXONLY Mask */ - -#define QSPI_CTL_TWOBIT_Pos (16) /*!< QSPI_T::CTL: TWOBIT Position */ -#define QSPI_CTL_TWOBIT_Msk (0x1ul << QSPI_CTL_TWOBIT_Pos) /*!< QSPI_T::CTL: TWOBIT Mask */ - -#define QSPI_CTL_UNITIEN_Pos (17) /*!< QSPI_T::CTL: UNITIEN Position */ -#define QSPI_CTL_UNITIEN_Msk (0x1ul << QSPI_CTL_UNITIEN_Pos) /*!< QSPI_T::CTL: UNITIEN Mask */ - -#define QSPI_CTL_SLAVE_Pos (18) /*!< QSPI_T::CTL: SLAVE Position */ -#define QSPI_CTL_SLAVE_Msk (0x1ul << QSPI_CTL_SLAVE_Pos) /*!< QSPI_T::CTL: SLAVE Mask */ - -#define QSPI_CTL_REORDER_Pos (19) /*!< QSPI_T::CTL: REORDER Position */ -#define QSPI_CTL_REORDER_Msk (0x1ul << QSPI_CTL_REORDER_Pos) /*!< QSPI_T::CTL: REORDER Mask */ - -#define QSPI_CTL_DATDIR_Pos (20) /*!< QSPI_T::CTL: DATDIR Position */ -#define QSPI_CTL_DATDIR_Msk (0x1ul << QSPI_CTL_DATDIR_Pos) /*!< QSPI_T::CTL: DATDIR Mask */ - -#define QSPI_CTL_DUALIOEN_Pos (21) /*!< QSPI_T::CTL: DUALIOEN Position */ -#define QSPI_CTL_DUALIOEN_Msk (0x1ul << QSPI_CTL_DUALIOEN_Pos) /*!< QSPI_T::CTL: DUALIOEN Mask */ - -#define QSPI_CTL_QUADIOEN_Pos (22) /*!< QSPI_T::CTL: QUADIOEN Position */ -#define QSPI_CTL_QUADIOEN_Msk (0x1ul << QSPI_CTL_QUADIOEN_Pos) /*!< QSPI_T::CTL: QUADIOEN Mask */ - -#define QSPI_CTL_TXDTREN_Pos (23) /*!< QSPI_T::CTL: TXDTREN Position */ -#define QSPI_CTL_TXDTREN_Msk (0x1ul << QSPI_CTL_TXDTREN_Pos) /*!< QSPI_T::CTL: TXDTREN Mask */ - -#define QSPI_CLKDIV_DIVIDER_Pos (0) /*!< QSPI_T::CLKDIV: DIVIDER Position */ -#define QSPI_CLKDIV_DIVIDER_Msk (0x1fful << QSPI_CLKDIV_DIVIDER_Pos) /*!< QSPI_T::CLKDIV: DIVIDER Mask */ - -#define QSPI_SSCTL_SS_Pos (0) /*!< QSPI_T::SSCTL: SS Position */ -#define QSPI_SSCTL_SS_Msk (0x1ul << QSPI_SSCTL_SS_Pos) /*!< QSPI_T::SSCTL: SS Mask */ - -#define QSPI_SSCTL_SSACTPOL_Pos (2) /*!< QSPI_T::SSCTL: SSACTPOL Position */ -#define QSPI_SSCTL_SSACTPOL_Msk (0x1ul << QSPI_SSCTL_SSACTPOL_Pos) /*!< QSPI_T::SSCTL: SSACTPOL Mask */ - -#define QSPI_SSCTL_AUTOSS_Pos (3) /*!< QSPI_T::SSCTL: AUTOSS Position */ -#define QSPI_SSCTL_AUTOSS_Msk (0x1ul << QSPI_SSCTL_AUTOSS_Pos) /*!< QSPI_T::SSCTL: AUTOSS Mask */ - -#define QSPI_SSCTL_SLV3WIRE_Pos (4) /*!< QSPI_T::SSCTL: SLV3WIRE Position */ -#define QSPI_SSCTL_SLV3WIRE_Msk (0x1ul << QSPI_SSCTL_SLV3WIRE_Pos) /*!< QSPI_T::SSCTL: SLV3WIRE Mask */ - -#define QSPI_SSCTL_SLVTOIEN_Pos (5) /*!< QSPI_T::SSCTL: SLVTOIEN Position */ -#define QSPI_SSCTL_SLVTOIEN_Msk (0x1ul << QSPI_SSCTL_SLVTOIEN_Pos) /*!< QSPI_T::SSCTL: SLVTOIEN Mask */ - -#define QSPI_SSCTL_SLVTORST_Pos (6) /*!< QSPI_T::SSCTL: SLVTORST Position */ -#define QSPI_SSCTL_SLVTORST_Msk (0x1ul << QSPI_SSCTL_SLVTORST_Pos) /*!< QSPI_T::SSCTL: SLVTORST Mask */ - -#define QSPI_SSCTL_SLVBEIEN_Pos (8) /*!< QSPI_T::SSCTL: SLVBEIEN Position */ -#define QSPI_SSCTL_SLVBEIEN_Msk (0x1ul << QSPI_SSCTL_SLVBEIEN_Pos) /*!< QSPI_T::SSCTL: SLVBEIEN Mask */ - -#define QSPI_SSCTL_SLVURIEN_Pos (9) /*!< QSPI_T::SSCTL: SLVURIEN Position */ -#define QSPI_SSCTL_SLVURIEN_Msk (0x1ul << QSPI_SSCTL_SLVURIEN_Pos) /*!< QSPI_T::SSCTL: SLVURIEN Mask */ - -#define QSPI_SSCTL_SSACTIEN_Pos (12) /*!< QSPI_T::SSCTL: SSACTIEN Position */ -#define QSPI_SSCTL_SSACTIEN_Msk (0x1ul << QSPI_SSCTL_SSACTIEN_Pos) /*!< QSPI_T::SSCTL: SSACTIEN Mask */ - -#define QSPI_SSCTL_SSINAIEN_Pos (13) /*!< QSPI_T::SSCTL: SSINAIEN Position */ -#define QSPI_SSCTL_SSINAIEN_Msk (0x1ul << QSPI_SSCTL_SSINAIEN_Pos) /*!< QSPI_T::SSCTL: SSINAIEN Mask */ - -#define QSPI_SSCTL_SLVTOCNT_Pos (16) /*!< QSPI_T::SSCTL: SLVTOCNT Position */ -#define QSPI_SSCTL_SLVTOCNT_Msk (0xfffful << QSPI_SSCTL_SLVTOCNT_Pos) /*!< QSPI_T::SSCTL: SLVTOCNT Mask */ - -#define QSPI_PDMACTL_TXPDMAEN_Pos (0) /*!< QSPI_T::PDMACTL: TXPDMAEN Position */ -#define QSPI_PDMACTL_TXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_TXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: TXPDMAEN Mask */ - -#define QSPI_PDMACTL_RXPDMAEN_Pos (1) /*!< QSPI_T::PDMACTL: RXPDMAEN Position */ -#define QSPI_PDMACTL_RXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_RXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: RXPDMAEN Mask */ - -#define QSPI_PDMACTL_PDMARST_Pos (2) /*!< QSPI_T::PDMACTL: PDMARST Position */ -#define QSPI_PDMACTL_PDMARST_Msk (0x1ul << QSPI_PDMACTL_PDMARST_Pos) /*!< QSPI_T::PDMACTL: PDMARST Mask */ - -#define QSPI_FIFOCTL_RXRST_Pos (0) /*!< QSPI_T::FIFOCTL: RXRST Position */ -#define QSPI_FIFOCTL_RXRST_Msk (0x1ul << QSPI_FIFOCTL_RXRST_Pos) /*!< QSPI_T::FIFOCTL: RXRST Mask */ - -#define QSPI_FIFOCTL_TXRST_Pos (1) /*!< QSPI_T::FIFOCTL: TXRST Position */ -#define QSPI_FIFOCTL_TXRST_Msk (0x1ul << QSPI_FIFOCTL_TXRST_Pos) /*!< QSPI_T::FIFOCTL: TXRST Mask */ - -#define QSPI_FIFOCTL_RXTHIEN_Pos (2) /*!< QSPI_T::FIFOCTL: RXTHIEN Position */ -#define QSPI_FIFOCTL_RXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTHIEN Mask */ - -#define QSPI_FIFOCTL_TXTHIEN_Pos (3) /*!< QSPI_T::FIFOCTL: TXTHIEN Position */ -#define QSPI_FIFOCTL_TXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_TXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: TXTHIEN Mask */ - -#define QSPI_FIFOCTL_RXTOIEN_Pos (4) /*!< QSPI_T::FIFOCTL: RXTOIEN Position */ -#define QSPI_FIFOCTL_RXTOIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTOIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTOIEN Mask */ - -#define QSPI_FIFOCTL_RXOVIEN_Pos (5) /*!< QSPI_T::FIFOCTL: RXOVIEN Position */ -#define QSPI_FIFOCTL_RXOVIEN_Msk (0x1ul << QSPI_FIFOCTL_RXOVIEN_Pos) /*!< QSPI_T::FIFOCTL: RXOVIEN Mask */ - -#define QSPI_FIFOCTL_TXUFPOL_Pos (6) /*!< QSPI_T::FIFOCTL: TXUFPOL Position */ -#define QSPI_FIFOCTL_TXUFPOL_Msk (0x1ul << QSPI_FIFOCTL_TXUFPOL_Pos) /*!< QSPI_T::FIFOCTL: TXUFPOL Mask */ - -#define QSPI_FIFOCTL_TXUFIEN_Pos (7) /*!< QSPI_T::FIFOCTL: TXUFIEN Position */ -#define QSPI_FIFOCTL_TXUFIEN_Msk (0x1ul << QSPI_FIFOCTL_TXUFIEN_Pos) /*!< QSPI_T::FIFOCTL: TXUFIEN Mask */ - -#define QSPI_FIFOCTL_RXFBCLR_Pos (8) /*!< QSPI_T::FIFOCTL: RXFBCLR Position */ -#define QSPI_FIFOCTL_RXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_RXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: RXFBCLR Mask */ - -#define QSPI_FIFOCTL_TXFBCLR_Pos (9) /*!< QSPI_T::FIFOCTL: TXFBCLR Position */ -#define QSPI_FIFOCTL_TXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_TXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: TXFBCLR Mask */ - -#define QSPI_FIFOCTL_SLVBERX_Pos (10) /*!< QSPI_T::FIFOCTL: SLVBERX Position */ -#define QSPI_FIFOCTL_SLVBERX_Msk (0x1ul << QSPI_FIFOCTL_SLVBERX_Pos) /*!< QSPI_T::FIFOCTL: SLVBERX Mask */ - -#define QSPI_FIFOCTL_RXTH_Pos (24) /*!< QSPI_T::FIFOCTL: RXTH Position */ -#define QSPI_FIFOCTL_RXTH_Msk (0x7ul << QSPI_FIFOCTL_RXTH_Pos) /*!< QSPI_T::FIFOCTL: RXTH Mask */ - -#define QSPI_FIFOCTL_TXTH_Pos (28) /*!< QSPI_T::FIFOCTL: TXTH Position */ -#define QSPI_FIFOCTL_TXTH_Msk (0x7ul << QSPI_FIFOCTL_TXTH_Pos) /*!< QSPI_T::FIFOCTL: TXTH Mask */ - -#define QSPI_STATUS_BUSY_Pos (0) /*!< QSPI_T::STATUS: BUSY Position */ -#define QSPI_STATUS_BUSY_Msk (0x1ul << QSPI_STATUS_BUSY_Pos) /*!< QSPI_T::STATUS: BUSY Mask */ - -#define QSPI_STATUS_UNITIF_Pos (1) /*!< QSPI_T::STATUS: UNITIF Position */ -#define QSPI_STATUS_UNITIF_Msk (0x1ul << QSPI_STATUS_UNITIF_Pos) /*!< QSPI_T::STATUS: UNITIF Mask */ - -#define QSPI_STATUS_SSACTIF_Pos (2) /*!< QSPI_T::STATUS: SSACTIF Position */ -#define QSPI_STATUS_SSACTIF_Msk (0x1ul << QSPI_STATUS_SSACTIF_Pos) /*!< QSPI_T::STATUS: SSACTIF Mask */ - -#define QSPI_STATUS_SSINAIF_Pos (3) /*!< QSPI_T::STATUS: SSINAIF Position */ -#define QSPI_STATUS_SSINAIF_Msk (0x1ul << QSPI_STATUS_SSINAIF_Pos) /*!< QSPI_T::STATUS: SSINAIF Mask */ - -#define QSPI_STATUS_SSLINE_Pos (4) /*!< QSPI_T::STATUS: SSLINE Position */ -#define QSPI_STATUS_SSLINE_Msk (0x1ul << QSPI_STATUS_SSLINE_Pos) /*!< QSPI_T::STATUS: SSLINE Mask */ - -#define QSPI_STATUS_SLVTOIF_Pos (5) /*!< QSPI_T::STATUS: SLVTOIF Position */ -#define QSPI_STATUS_SLVTOIF_Msk (0x1ul << QSPI_STATUS_SLVTOIF_Pos) /*!< QSPI_T::STATUS: SLVTOIF Mask */ - -#define QSPI_STATUS_SLVBEIF_Pos (6) /*!< QSPI_T::STATUS: SLVBEIF Position */ -#define QSPI_STATUS_SLVBEIF_Msk (0x1ul << QSPI_STATUS_SLVBEIF_Pos) /*!< QSPI_T::STATUS: SLVBEIF Mask */ - -#define QSPI_STATUS_SLVURIF_Pos (7) /*!< QSPI_T::STATUS: SLVURIF Position */ -#define QSPI_STATUS_SLVURIF_Msk (0x1ul << QSPI_STATUS_SLVURIF_Pos) /*!< QSPI_T::STATUS: SLVURIF Mask */ - -#define QSPI_STATUS_RXEMPTY_Pos (8) /*!< QSPI_T::STATUS: RXEMPTY Position */ -#define QSPI_STATUS_RXEMPTY_Msk (0x1ul << QSPI_STATUS_RXEMPTY_Pos) /*!< QSPI_T::STATUS: RXEMPTY Mask */ - -#define QSPI_STATUS_RXFULL_Pos (9) /*!< QSPI_T::STATUS: RXFULL Position */ -#define QSPI_STATUS_RXFULL_Msk (0x1ul << QSPI_STATUS_RXFULL_Pos) /*!< QSPI_T::STATUS: RXFULL Mask */ - -#define QSPI_STATUS_RXTHIF_Pos (10) /*!< QSPI_T::STATUS: RXTHIF Position */ -#define QSPI_STATUS_RXTHIF_Msk (0x1ul << QSPI_STATUS_RXTHIF_Pos) /*!< QSPI_T::STATUS: RXTHIF Mask */ - -#define QSPI_STATUS_RXOVIF_Pos (11) /*!< QSPI_T::STATUS: RXOVIF Position */ -#define QSPI_STATUS_RXOVIF_Msk (0x1ul << QSPI_STATUS_RXOVIF_Pos) /*!< QSPI_T::STATUS: RXOVIF Mask */ - -#define QSPI_STATUS_RXTOIF_Pos (12) /*!< QSPI_T::STATUS: RXTOIF Position */ -#define QSPI_STATUS_RXTOIF_Msk (0x1ul << QSPI_STATUS_RXTOIF_Pos) /*!< QSPI_T::STATUS: RXTOIF Mask */ - -#define QSPI_STATUS_SPIENSTS_Pos (15) /*!< QSPI_T::STATUS: SPIENSTS Position */ -#define QSPI_STATUS_SPIENSTS_Msk (0x1ul << QSPI_STATUS_SPIENSTS_Pos) /*!< QSPI_T::STATUS: SPIENSTS Mask */ - -#define QSPI_STATUS_TXEMPTY_Pos (16) /*!< QSPI_T::STATUS: TXEMPTY Position */ -#define QSPI_STATUS_TXEMPTY_Msk (0x1ul << QSPI_STATUS_TXEMPTY_Pos) /*!< QSPI_T::STATUS: TXEMPTY Mask */ - -#define QSPI_STATUS_TXFULL_Pos (17) /*!< QSPI_T::STATUS: TXFULL Position */ -#define QSPI_STATUS_TXFULL_Msk (0x1ul << QSPI_STATUS_TXFULL_Pos) /*!< QSPI_T::STATUS: TXFULL Mask */ - -#define QSPI_STATUS_TXTHIF_Pos (18) /*!< QSPI_T::STATUS: TXTHIF Position */ -#define QSPI_STATUS_TXTHIF_Msk (0x1ul << QSPI_STATUS_TXTHIF_Pos) /*!< QSPI_T::STATUS: TXTHIF Mask */ - -#define QSPI_STATUS_TXUFIF_Pos (19) /*!< QSPI_T::STATUS: TXUFIF Position */ -#define QSPI_STATUS_TXUFIF_Msk (0x1ul << QSPI_STATUS_TXUFIF_Pos) /*!< QSPI_T::STATUS: TXUFIF Mask */ - -#define QSPI_STATUS_TXRXRST_Pos (23) /*!< QSPI_T::STATUS: TXRXRST Position */ -#define QSPI_STATUS_TXRXRST_Msk (0x1ul << QSPI_STATUS_TXRXRST_Pos) /*!< QSPI_T::STATUS: TXRXRST Mask */ - -#define QSPI_STATUS_RXCNT_Pos (24) /*!< QSPI_T::STATUS: RXCNT Position */ -#define QSPI_STATUS_RXCNT_Msk (0xful << QSPI_STATUS_RXCNT_Pos) /*!< QSPI_T::STATUS: RXCNT Mask */ - -#define QSPI_STATUS_TXCNT_Pos (28) /*!< QSPI_T::STATUS: TXCNT Position */ -#define QSPI_STATUS_TXCNT_Msk (0xful << QSPI_STATUS_TXCNT_Pos) /*!< QSPI_T::STATUS: TXCNT Mask */ - -#define QSPI_STATUS2_SLVBENUM_Pos (24) /*!< QSPI_T::STATUS2: SLVBENUM Position */ -#define QSPI_STATUS2_SLVBENUM_Msk (0x3ful << QSPI_STATUS2_SLVBENUM_Pos) /*!< QSPI_T::STATUS2: SLVBENUM Mask */ - -#define QSPI_TX_TX_Pos (0) /*!< QSPI_T::TX: TX Position */ -#define QSPI_TX_TX_Msk (0xfffffffful << QSPI_TX_TX_Pos) /*!< QSPI_T::TX: TX Mask */ - -#define QSPI_RX_RX_Pos (0) /*!< QSPI_T::RX: RX Position */ -#define QSPI_RX_RX_Msk (0xfffffffful << QSPI_RX_RX_Pos) /*!< QSPI_T::RX: RX Mask */ - -/**@}*/ /* QSPI_CONST */ -/**@}*/ /* end of QSPI register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __QSPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/rtc_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/rtc_reg.h deleted file mode 100644 index 5af6ce5a208..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/rtc_reg.h +++ /dev/null @@ -1,1302 +0,0 @@ -/**************************************************************************//** - * @file rtc_reg.h - * @version V1.00 - * @brief RTC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __RTC_REG_H__ -#define __RTC_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Real Time Clock Controller -------------------------*/ -/** - @addtogroup RTC Real Time Clock Controller(RTC) - Memory Mapped Structure for RTC Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var RTC_T::INIT - * Offset: 0x00 RTC Initiation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INIT_ACTIVE|RTC Active Status (Read Only) - * | | |0 = RTC is at reset state. - * | | |1 = RTC is at normal active state. - * |[31:1] |INIT |RTC Initiation (Write Only) - * | | |When RTC block is powered on, RTC is at reset state. - * | | |User has to write a number (0xa5eb1357) to INIT to make RTC leave reset state. - * | | |Once the INIT is written as 0xa5eb1357, the RTC will be in un-reset state permanently. - * | | |The INIT is a write-only field and read value will be always 0. - * @var RTC_T::FREQADJ - * Offset: 0x08 RTC Frequency Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |FRACTION |Fraction Part - * | | |Formula: FRACTION = (fraction part of detected value) X 64. - * | | |Note: Digit in FCR must be expressed as hexadecimal number. - * |[12:8] |INTEGER |Integer Part - * | | |00000 = Integer part of detected value is 32752. - * | | |00001 = Integer part of detected value is 32753. - * | | |00010 = Integer part of detected value is 32754. - * | | |00011 = Integer part of detected value is 32755. - * | | |00100 = Integer part of detected value is 32756. - * | | |00101 = Integer part of detected value is 32757. - * | | |00110 = Integer part of detected value is 32758. - * | | |00111 = Integer part of detected value is 32759. - * | | |01000 = Integer part of detected value is 32760. - * | | |01001 = Integer part of detected value is 32761. - * | | |01010 = Integer part of detected value is 32762. - * | | |01011 = Integer part of detected value is 32763. - * | | |01100 = Integer part of detected value is 32764. - * | | |01101 = Integer part of detected value is 32765. - * | | |01110 = Integer part of detected value is 32766. - * | | |01111 = Integer part of detected value is 32767. - * | | |10000 = Integer part of detected value is 32768. - * | | |10001 = Integer part of detected value is 32769. - * | | |10010 = Integer part of detected value is 32770. - * | | |10011 = Integer part of detected value is 32771. - * | | |10100 = Integer part of detected value is 32772. - * | | |10101 = Integer part of detected value is 32773. - * | | |10110 = Integer part of detected value is 32774. - * | | |10111 = Integer part of detected value is 32775. - * | | |11000 = Integer part of detected value is 32776. - * | | |11001 = Integer part of detected value is 32777. - * | | |11010 = Integer part of detected value is 32778. - * | | |11011 = Integer part of detected value is 32779. - * | | |11100 = Integer part of detected value is 32780. - * | | |11101 = Integer part of detected value is 32781. - * | | |11110 = Integer part of detected value is 32782. - * | | |11111 = Integer part of detected value is 32783. - * |[31] |FCRBUSY |Frequency Compensation Register Write Operation Busy (Read Only) - * | | |0 = The new register write operation is acceptable. - * | | |1 = The last write operation is in progress and new register write operation prohibited. - * | | |Note: This bit is only used when DCOMPEN(RTC_CLKFMT[16]) is enabled. - * @var RTC_T::TIME - * Offset: 0x0C RTC Time Loading Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit (0~5) - * |[11:8] |MIN |1-Min Time Digit (0~9) - * |[14:12] |TENMIN |10-Min Time Digit (0~5) - * |[19:16] |HR |1-Hour Time Digit (0~9) - * |[21:20] |TENHR |10-Hour Time Digit (0~2) - * | | |When RTC runs as 12-hour time scale mode, RTC_TIME[21] (the high bit of TENHR[1:0]) means AM/PM indication (If RTC_TIME[21] is 1, it indicates PM time message.) - * @var RTC_T::CAL - * Offset: 0x10 RTC Calendar Loading Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit (0~3) - * |[11:8] |MON |1-Month Calendar Digit (0~9) - * |[12] |TENMON |10-Month Calendar Digit (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit (0~9) - * @var RTC_T::CLKFMT - * Offset: 0x14 RTC Time Scale Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |24HEN |24-hour / 12-hour Time Scale Selection - * | | |The RTC_TIME and RTC_TALM are in 24-hour time scale or 12-hour time scale. - * | | |0 = 12-hour time scale with AM and PM indication selected. - * | | |1 = 24-hour time scale selected. - * |[16] |DCOMPEN |Dynamic Compensation Enable Bit - * | | |0 = Dynamic Compensation Disabled. - * | | |1 = Dynamic Compensation Enabled. - * @var RTC_T::WEEKDAY - * Offset: 0x18 RTC Day of the Week Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |WEEKDAY |Day of the Week Register - * | | |000 = Sunday. - * | | |001 = Monday. - * | | |010 = Tuesday. - * | | |011 = Wednesday. - * | | |100 = Thursday. - * | | |101 = Friday. - * | | |110 = Saturday. - * | | |111 = Reserved. - * @var RTC_T::TALM - * Offset: 0x1C RTC Time Alarm Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit of Alarm Setting (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit of Alarm Setting (0~5) - * |[11:8] |MIN |1-Min Time Digit of Alarm Setting (0~9) - * |[14:12] |TENMIN |10-Min Time Digit of Alarm Setting (0~5) - * |[19:16] |HR |1-Hour Time Digit of Alarm Setting (0~9) - * |[21:20] |TENHR |10-Hour Time Digit of Alarm Setting (0~2) - * | | |When RTC runs as 12-hour time scale mode, RTC_TIME[21] (the high bit of TENHR[1:0]) means AM/PM indication (If RTC_TIME[21] is 1, it indicates PM time message.) - * @var RTC_T::CALM - * Offset: 0x20 RTC Calendar Alarm Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit of Alarm Setting (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit of Alarm Setting (0~3) - * |[11:8] |MON |1-Month Calendar Digit of Alarm Setting (0~9) - * |[12] |TENMON |10-Month Calendar Digit of Alarm Setting (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit of Alarm Setting (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit of Alarm Setting (0~9) - * @var RTC_T::LEAPYEAR - * Offset: 0x24 RTC Leap Year Indicator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LEAPYEAR |Leap Year Indication (Read Only) - * | | |0 = This year is not a leap year. - * | | |1 = This year is leap year. - * @var RTC_T::INTEN - * Offset: 0x28 RTC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALMIEN |Alarm Interrupt Enable Bit - * | | |Set ALMIEN to 1 can also enable chip wake-up function when RTC alarm interrupt event is generated. - * | | |0 = RTC Alarm interrupt Disabled. - * | | |1 = RTC Alarm interrupt Enabled. - * |[1] |TICKIEN |Time Tick Interrupt Enable Bit - * | | |Set TICKIEN to 1 can also enable chip wake-up function when RTC tick interrupt event is generated. - * | | |0 = RTC Time Tick interrupt Disabled. - * | | |1 = RTC Time Tick interrupt Enabled. - * |[8] |TAMP0IEN |Tamper 0 Interrupt Enable Bit - * | | |Set TAMP0IEN to 1 can also enable chip wake-up function when tamper 0 interrupt event is generated. - * | | |0 = Tamper 0 interrupt Disabled. - * | | |1 = Tamper 0 interrupt Enabled. - * |[9] |TAMP1IEN |Tamper 1 or Pair 0 Interrupt Enable Bit - * | | |Set TAMP1IEN to 1 can also enable chip wake-up function when tamper 1 interrupt event is generated. - * | | |0 = Tamper 1 or Pair 0 interrupt Disabled. - * | | |1 = Tamper 1 or Pair 0 interrupt Enabled. - * |[10] |TAMP2IEN |Tamper 2 Interrupt Enable Bit - * | | |Set TAMP2IEN to 1 can also enable chip wake-up function when tamper 2 interrupt event is generated. - * | | |0 = Tamper 2 interrupt Disabled. - * | | |1 = Tamper 2 interrupt Enabled. - * |[11] |TAMP3IEN |Tamper 3 or Pair 1 Interrupt Enable Bit - * | | |Set TAMP3IEN to 1 can also enable chip wake-up function when tamper 3 interrupt event is generated. - * | | |0 = Tamper 3 or Pair 1 interrupt Disabled. - * | | |1 = Tamper 3 or Pair 1 interrupt Enabled. - * |[12] |TAMP4IEN |Tamper 4 Interrupt Enable Bit - * | | |Set TAMP4IEN to 1 can also enable chip wake-up function when tamper 4 interrupt event is generated. - * | | |0 = Tamper 4 interrupt Disabled. - * | | |1 = Tamper 4 interrupt Enabled. - * |[13] |TAMP5IEN |Tamper 5 or Pair 2 Interrupt Enable Bit - * | | |Set TAMP5IEN to 1 can also enable chip wake-up function when tamper 5 interrupt event is generated. - * | | |0 = Tamper 5 or Pair 2 interrupt Disabled. - * | | |1 = Tamper 5 or Pair 2 interrupt Enabled. - * |[24] |CLKFIEN |LXT Clock Frequency Monitor Fail Interrupt Enable Bit - * | | |0 = LXT Frequency Fail interrupt Disabled. - * | | |1 = LXT Frequency Fail interrupt Enabled. - * |[25] |CLKSTIEN |LXT Clock Frequency Monitor Stop Interrupt Enable Bit - * | | |0 = LXT Frequency Stop interrupt Disabled. - * | | |1 = LXT Frequency Stop interrupt Enabled. - * @var RTC_T::INTSTS - * Offset: 0x2C RTC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALMIF |RTC Alarm Interrupt Flag - * | | |0 = Alarm condition is not matched. - * | | |1 = Alarm condition is matched. - * | | |Note: Write 1 to clear this bit. - * |[1] |TICKIF |RTC Time Tick Interrupt Flag - * | | |0 = Tick condition does not occur. - * | | |1 = Tick condition occur. - * | | |Note: Write 1 to clear this bit. - * |[8] |TAMP0IF |Tamper 0 Interrupt Flag - * | | |This bit is set when TAMP0_PIN detected level non-equal TAMP0LV (RTC_TAMPCTL[9]). - * | | |0 = No Tamper 0 interrupt flag is generated. - * | | |1 = Tamper 0 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: This interrupt flag will be generated again when Tamper setting condition is not restoration. - * | | |Note3: Need to clear all TAMPxIF, after that, new RTC_TAMPTIME and RTC_TAMPCAL values are loaded while a tamper event occurred. - * |[9] |TAMP1IF |Tamper 1 or Pair 0 Interrupt Flag - * | | |This bit is set when TAMP1_PIN detected level non-equal TAMP1LV (RTC_TAMPCTL[13]) or TAMP0_PIN and TAMP1_PIN disconnected during DYNPR0EN (RTC_TAMPCTL[15]) is activated. - * | | |0 = No Tamper 1 or Pair 0 interrupt flag is generated. - * | | |1 = Tamper 1 or Pair 0 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: This interrupt flag will be generated again when Tamper setting condition is not restoration. - * | | |Note3: Need to clear all TAMPxIF, after that, new RTC_TAMPTIME and RTC_TAMPCAL values are loaded while a tamper event occurred. - * |[10] |TAMP2IF |Tamper 2 Interrupt Flag - * | | |This bit is set when TAMP2_PIN detected level non-equal TAMP2LV (RTC_TAMPCTL[17]). - * | | |0 = No Tamper 2 interrupt flag is generated. - * | | |1 = Tamper 2 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: This interrupt flag will be generated again when Tamper setting condition is not restoration. - * | | |Note3: Need to clear all TAMPxIF, after that, new RTC_TAMPTIME and RTC_TAMPCAL values are loaded while a tamper event occurred. - * |[11] |TAMP3IF |Tamper 3 or Pair 1 Interrupt Flag - * | | |This bit is set when TAMP3_PIN detected level non-equal TAMP3LV (RTC_TAMPCTL[21]) or TAMP2_PIN and TAMP3_PIN disconnected during DYNPR1EN (RTC_TAMPCTL[23]) is activated or - * | | |TAMP0_PIN and TAMP3_PIN disconnected during DYNPR1EN (RTC_TAMPCTL[23]) and DYN1ISS (RTC_TAMPCTL[0]) are activated. - * | | |0 = No Tamper 3 or Pair 1 interrupt flag is generated. - * | | |1 = Tamper 3 or Pair 1 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: This interrupt flag will be generated again when Tamper setting condition is not restoration. - * | | |Note3: Need to clear all TAMPxIF, after that, new RTC_TAMPTIME and RTC_TAMPCAL values are loaded while a tamper event occurred. - * |[12] |TAMP4IF |Tamper 4 Interrupt Flag - * | | |This bit is set when TAMP4_PIN detected level non-equal TAMP4LV (RTC_TAMPCTL[25]). - * | | |0 = No Tamper 4 interrupt flag is generated. - * | | |1 = Tamper 4 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: This interrupt flag will be generated again when Tamper setting condition is not restoration. - * | | |Note3: Need to clear all TAMPxIF, after that, new RTC_TAMPTIME and RTC_TAMPCAL values are loaded while a tamper event occurred. - * |[13] |TAMP5IF |Tamper 5 or Pair 2 Interrupt Flag - * | | |This bit is set when TAMP5_PIN detected level non-equal TAMP5LV (RTC_TAMPCTL[29]) or TAMP4_PIN and TAMP5_PIN disconnected during DYNPR2EN (RTC_TAMPCTL[31]) is activated or - * | | |TAMP0_PIN and TAMP5_PIN disconnected during DYNPR2EN (RTC_TAMPCTL[31]) and DYN2ISS (RTC_TAMPCTL[1]) are activated. - * | | |0 = No Tamper 5 or Pair 2 interrupt flag is generated. - * | | |1 = Tamper 5 or Pair 2 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: This interrupt flag will be generated again when Tamper setting condition is not restoration. - * | | |Note3: Need to clear all TAMPxIF, after that, new RTC_TAMPTIME and RTC_TAMPCAL values are loaded while a tamper event occurred. - * |[24] |CLKFIF |LXT Clock Frequency Monitor Fail Interrupt Flag - * | | |0 = LXT frequency is normal. - * | | |1 = LXT frequency is abnormal. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: LXT detector will automatic disable when Fail/Stop Flag rise, resume after Fail/Stop Flag clear. - * |[25] |CLKSTIF |LXT Clock Frequency Monitor Stop Interrupt Flag - * | | |0 = LXT frequency is normal. - * | | |1 = LXT frequency is almost stop. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: LXT detector will automatic disable when Fail/Stop Flag rise, resume after Fail/Stop Flag clear. - * @var RTC_T::TICK - * Offset: 0x30 RTC Time Tick Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TICK |Time Tick Register - * | | |These bits are used to select RTC time tick period for Periodic Time Tick Interrupt request. - * | | |000 = Time tick is 1 second. - * | | |001 = Time tick is 1/2 second. - * | | |010 = Time tick is 1/4 second. - * | | |011 = Time tick is 1/8 second. - * | | |100 = Time tick is 1/16 second. - * | | |101 = Time tick is 1/32 second. - * | | |110 = Time tick is 1/64 second. - * | | |111 = Time tick is 1/128 second. - * @var RTC_T::TAMSK - * Offset: 0x34 RTC Time Alarm Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSEC |Mask 1-Sec Time Digit of Alarm Setting (0~9) - * |[1] |MTENSEC |Mask 10-Sec Time Digit of Alarm Setting (0~5) - * |[2] |MMIN |Mask 1-Min Time Digit of Alarm Setting (0~9) - * |[3] |MTENMIN |Mask 10-Min Time Digit of Alarm Setting (0~5) - * |[4] |MHR |Mask 1-Hour Time Digit of Alarm Setting (0~9) - * | | |Note: MHR function is only for 24-hour time scale mode. - * |[5] |MTENHR |Mask 10-Hour Time Digit of Alarm Setting (0~2) - * | | |Note: MTENHR function is only for 24-hour time scale mode. - * @var RTC_T::CAMSK - * Offset: 0x38 RTC Calendar Alarm Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MDAY |Mask 1-Day Calendar Digit of Alarm Setting (0~9) - * |[1] |MTENDAY |Mask 10-Day Calendar Digit of Alarm Setting (0~3) - * |[2] |MMON |Mask 1-Month Calendar Digit of Alarm Setting (0~9) - * |[3] |MTENMON |Mask 10-Month Calendar Digit of Alarm Setting (0~1) - * |[4] |MYEAR |Mask 1-Year Calendar Digit of Alarm Setting (0~9) - * |[5] |MTENYEAR |Mask 10-Year Calendar Digit of Alarm Setting (0~9) - * @var RTC_T::SPRCTL - * Offset: 0x3C RTC Spare Functional Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |SPRRWEN |Spare Register Enable Bit - * | | |0 = Spare register Disabled. - * | | |1 = Spare register Enabled. - * | | |Note: When spare register is disabled, RTC_SPR0 ~ RTC_SPR19 cannot be accessed. - * |[5] |SPRCSTS |SPR Clear Flag - * | | |This bit indicates if the RTC_SPR0 ~ RTC_SPR19 content is cleared when specify tamper event is detected. - * | | |0 = Spare register content is not cleared. - * | | |1 = Spare register content is cleared. - * | | |Note 1: Writes 1 to clear this bit. - * | | |Note 2: This bit keep 1 when RTC_INTSTS[13:8] or RTC_INTSTS[25:24] are not equal zero. - * |[16] |LXTFCLR |LXT Clock Fail/Stop to Clear Spare Enable Bit - * | | |0 = LXT Fail/Stop to clear Spare register content Disabled. - * | | |1 = LXT Fail/Stop to clear Spare register content Enabled. - * @var RTC_T::SPR[20] - * Offset: 0x40 ~ 0x8C RTC Spare Register 0 ~ 19 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SPARE |Spare Register - * | | |This field is used to store back-up information defined by user. - * | | |This field will be cleared by hardware automatically in the following conditions, a tamper pin event is detected, - * | | |LXT clock fail/stop event occurs if LXTFCLR(RTC_SPRCTL[16]) is 1, or after Flash mass operation. - * @var RTC_T::LXTCTL - * Offset: 0x100 RTC 32.768 kHz Oscillator Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LIRC32KEN |Enable LIRC32K Source - * | | |0 = LIRC32K Disabled. - * | | |1 = LIRC32K Enabled. - * |[3:1] |GAIN |Oscillator Gain Option - * | | |User can select oscillator gain according to crystal external loading and operating temperature range. - * | | |The larger gain value corresponding to stronger driving capability and higher power consumption. - * | | |000 = L0 mode. - * | | |001 = L1 mode. - * | | |010 = L2 mode. - * | | |011 = L3 mode. - * | | |100 = L4 mode. - * | | |101 = L5 mode. - * | | |110 = L6 mode. - * | | |111 = L7 mode (Default). - * |[6] |C32KSEL |Clock 32K Source Selection - * | | |0 = Clock source from external low speed crystal oscillator (LXT). - * | | |1 = Clock source from internal low speed RC 32K oscillator (LIRC32K). - * |[7] |RTCCKSEL |RTC Clock Source Selection - * | | |0 = Clock source from external low speed crystal oscillator (LXT) or internal low speed RC 32K oscillator (LIRC32K) depended on C32KSEL value. - * | | |1 = Clock source from internal low speed RC oscillator (LIRC). - * |[8] |IOCTLSEL |IO Pin Backup Control Selection - * | | |When low speed 32 kHz oscillator is disabled or TAMPxEN is disabled, - * | | |PF.4 pin (X32KO pin), PF.5 pin (X32KI pin) or PF.6~11 pin (TAMPERx pin) can be used as GPIO function. - * | | |User can program IOCTLSEL to decide PF.4~11 I/O function is controlled by system power domain GPIO module or VBAT power domain RTC_GPIOCTL0/1 control register. - * | | |0 = PF.4~11 pin I/O function is controlled by GPIO module. - * | | |1 = PF.4~11 pin I/O function is controlled by VBAT power domain. - * | | |Note: IOCTLSEL will automatically be set by hardware to 1 when system power is off and any writable RTC registers has been written at RTCCKEN(CLK_APBCLK0[1]) enabled. - * @var RTC_T::GPIOCTL0 - * Offset: 0x104 RTC GPIO Control 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE0 |IO Operation Mode - * | | |00 = PF.4 is input only mode. - * | | |01 = PF.4 is output push pull mode. - * | | |10 = PF.4 is open drain mode. - * | | |11 = PF.4 is quasi-bidirectional mod. - * |[2] |DOUT0 |IO Output Data - * | | |0 = PF.4 output low. - * | | |1 = PF.4 output high. - * |[3] |DINOFF0 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.4 digital input path Enabled. - * | | |1 = PF.4 digital input path Disabled (digital input tied to low). - * |[5:4] |PUSEL0 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.4 I/O pull-up or pull-down. - * | | |00 = PF.4 pull-up and pull-down Disabled. - * | | |01 = PF.4 pull-up Enabled. - * | | |10 = PF.4 pull-down Enabled. - * | | |11 = PF.4 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE0 is set as input tri-state and open-drain mode. - * |[9:8] |OPMODE1 |IO Operation Mode - * | | |00 = PF.5 is input only mode. - * | | |01 = PF.5 is output push pull mode. - * | | |10 = PF.5 is open drain mode. - * | | |11 = PF.5 is quasi-bidirectional mod. - * |[10] |DOUT1 |IO Output Data - * | | |0 = PF.5 output low. - * | | |1 = PF.5 output high. - * |[11 |DINOFF1 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.5 digital input path Enabled. - * | | |1 = PF.5 digital input path Disabled (digital input tied to low). - * |[13:12] |PUSEL1 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.5 I/O pull-up or pull-down. - * | | |00 = PF.5 pull-up and pull-down Disabled. - * | | |01 = PF.5 pull-up Enabled. - * | | |10 = PF.5 pull-down Enabled. - * | | |11 = PF.5 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE1 is set as input tri-state and open-drain mode. - * |[17:16] |OPMODE2 |IO Operation Mode - * | | |00 = PF.6 is input only mode. - * | | |01 = PF.6 is output push pull mode. - * | | |10 = PF.6 is open drain mode. - * | | |11 = PF.6 is quasi-bidirectional mod. - * |[18] |DOUT2 |IO Output Data - * | | |0 = PF.6 output low. - * | | |1 = PF.6 output high. - * |[19 |DINOFF2 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.6 digital input path Enabled. - * | | |1 = PF.6 digital input path Disabled (digital input tied to low). - * |[21:20] |PUSEL2 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.6 I/O pull-up or pull-down. - * | | |00 = PF.6 pull-up and pull-down Disabled. - * | | |01 = PF.6 pull-up Enabled. - * | | |10 = PF.6 pull-down Enabled. - * | | |11 = PF.6 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE2 is set as input tri-state and open-drain mode. - * |[25:24] |OPMODE3 |IO Operation Mode - * | | |00 = PF.7 is input only mode. - * | | |01 = PF.7 is output push pull mode. - * | | |10 = PF.7 is open drain mode. - * | | |11 = PF.7 is quasi-bidirectional mod. - * |[26] |DOUT3 |IO Output Data - * | | |0 = PF.7 output low. - * | | |1 = PF.7 output high. - * |[27 |DINOFF3 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.7 digital input path Enabled. - * | | |1 = PF.7 digital input path Disabled (digital input tied to low). - * |[29:28] |PUSEL3 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.7 I/O pull-up or pull-down. - * | | |00 = PF.7 pull-up and pull-down Disabled. - * | | |01 = PF.7 pull-up Enabled. - * | | |10 = PF.7 pull-down Enabled. - * | | |11 = PF.7 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE3 is set as input tri-state and open-drain mode. - * @var RTC_T::GPIOCTL1 - * Offset: 0x108 RTC GPIO Control 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE4 |IO Operation Mode - * | | |00 = PF.8 is input only mode. - * | | |01 = PF.8 is output push pull mode. - * | | |10 = PF.8 is open drain mode. - * | | |11 = PF.8 is quasi-bidirectional mod. - * |[2] |DOUT4 |IO Output Data - * | | |0 = PF.8 output low. - * | | |1 = PF.8 output high. - * |[3] |DINOFF4 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.8 digital input path Enabled. - * | | |1 = PF.8 digital input path Disabled (digital input tied to low). - * |[5:4] |PUSEL4 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.8 I/O pull-up or pull-down. - * | | |00 = PF.8 pull-up and pull-down Disabled. - * | | |01 = PF.8 pull-up Enabled. - * | | |10 = PF.8 pull-down Enabled. - * | | |11 = PF.8 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE4 is set as input tri-state and open-drain mode. - * |[9:8] |OPMODE5 |IO Operation Mode - * | | |00 = PF.9 is input only mode. - * | | |01 = PF.9 is output push pull mode. - * | | |10 = PF.9 is open drain mode. - * | | |11 = PF.9 is quasi-bidirectional mod. - * |[10] |DOUT5 |IO Output Data - * | | |0 = PF.9 output low. - * | | |1 = PF.9 output high. - * |[11 |DINOFF5 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.9 digital input path Enabled. - * | | |1 = PF.9 digital input path Disabled (digital input tied to low). - * |[13:12] |PUSEL5 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.9 I/O pull-up or pull-down. - * | | |00 = PF.9 pull-up and pull-down Disabled. - * | | |01 = PF.9 pull-up Enabled. - * | | |10 = PF.9 pull-down Enabled. - * | | |11 = PF.9 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE5 is set as input tri-state and open-drain mode. - * |[17:16] |OPMODE6 |IO Operation Mode - * | | |00 = PF.10 is input only mode. - * | | |01 = PF.10 is output push pull mode. - * | | |10 = PF.10 is open drain mode. - * | | |11 = PF.10 is quasi-bidirectional mod. - * |[18] |DOUT6 |IO Output Data - * | | |0 = PF.10 output low. - * | | |1 = PF.10 output high. - * |[19 |DINOFF6 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.10 digital input path Enabled. - * | | |1 = PF.10 digital input path Disabled (digital input tied to low). - * |[21:20] |PUSEL6 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.10 I/O pull-up or pull-down. - * | | |00 = PF.10 pull-up and pull-down Disabled. - * | | |01 = PF.10 pull-up Enabled. - * | | |10 = PF.10 pull-down Enabled. - * | | |11 = PF.10 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE6 is set as input tri-state and open-drain mode. - * |[25:24] |OPMODE7 |IO Operation Mode - * | | |00 = PF.11 is input only mode. - * | | |01 = PF.11 is output push pull mode. - * | | |10 = PF.11 is open drain mode. - * | | |11 = PF.11 is quasi-bidirectional mod. - * |[26] |DOUT7 |IO Output Data - * | | |0 = PF.11 output low. - * | | |1 = PF.11 output high. - * |[27 |DINOFF7 |IO Pin Digital Input Path Disable Bit - * | | |0 = PF.11 digital input path Enabled. - * | | |1 = PF.11 digital input path Disabled (digital input tied to low). - * |[29:28] |PUSEL7 |IO Pull-up and Pull-down Enable Bits - * | | |Determine PF.11 I/O pull-up or pull-down. - * | | |00 = PF.11 pull-up and pull-down Disabled. - * | | |01 = PF.11 pull-up Enabled. - * | | |10 = PF.11 pull-down Enabled. - * | | |11 = PF.11 pull-up and pull-down Disabled. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up/pull-down control register is only valid when OPMODE7 is set as input tri-state and open-drain mode. - * @var RTC_T::DSTCTL - * Offset: 0x110 RTC Daylight Saving Time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADDHR |Add 1 Hour - * | | |0 = No effect. - * | | |1 = Indicates RTC hour digit has been added one hour for summer time change. - * |[1] |SUBHR |Subtract 1 Hour - * | | |0 = No effect. - * | | |1 = Indicates RTC hour digit has been subtracted one hour for winter time change. - * |[2] |DSBAK |Daylight Saving Back - * | | |0 = Daylight Saving Change is not performed. - * | | |1 = Daylight Saving Change is performed. - * @var RTC_T::TAMPCTL - * Offset: 0x120 RTC Tamper Pin Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DYN1ISS |Dynamic Pair 1 Input Source Select - * | | |This bit determine Tamper 3 input is from Tamper 2 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 2. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit is effective only when DYNPR1EN (RTC_TAMPCTL[23]) and DYNPR0EN (RTC_TAMPCTL[15]) are set. - * |[1] |DYN2ISS |Dynamic Pair 2 Input Source Select - * | | |This bit determine Tamper 5 input is from Tamper 4 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 4. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit is effective only when DYNPR2EN (RTC_TAMPCTL[31]) and DYNPR0EN (RTC_TAMPCTL[15]) are set. - * |[3] |DYNSRC |Dynamic Reference Pattern - * | | |This fields determine the new reference pattern when current pattern run out in dynamic pair mode. - * | | |0 = The new reference pattern is generated by random number generator when the reference pattern run out. - * | | |1 = The new reference pattern is repeated from SEED (RTC_TAMPSEED[31:0]) when the reference pattern run out. - * | | |Note: After this bit is modified, the SEEDRLD (RTC_TAMPCTL[4]) should be set. - * |[4] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |Setting this bit, the tamper configuration will be reload. - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * | | |Note 1: Before this bit is set, the tamper configuration should be set to complete and this bit will be auto clear to 0 after reload new seed completed. - * | | |Note 2: The reference is RTC clock. Tamper detector need sync 2 ~ 3 RTC clock. - * |[7:5] |DYNRATE |Dynamic Change Rate - * | | |This item is choice the dynamic tamper output change rate. - * | | |000 = 2^10 * RTC_CLK. - * | | |001 = 2^11 * RTC_CLK. - * | | |010 = 2^12 * RTC_CLK. - * | | |011 = 2^13 * RTC_CLK. - * | | |100 = 2^14 * RTC_CLK. - * | | |101 = 2^15 * RTC_CLK. - * | | |110 = 2^16 * RTC_CLK. - * | | |111 = 2^17 * RTC_CLK. - * | | |Note: After revising this field, set SEEDRLD (RTC_TAMPCTL[4]) can reload change rate immediately. - * |[8] |TAMP0EN |Tamper0 Detect Enable Bit - * | | |0 = Tamper 0 detect Disabled. - * | | |1 = Tamper 0 detect Enabled. - * | | |Note1: The reference is RTC clock. Tamper detector need sync 2 ~ 3 RTC clock. - * |[9] |TAMP0LV |Tamper 0 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[10] |TAMP0DBEN |Tamper 0 De-bounce Enable Bit - * | | |0 = Tamper 0 de-bounce Disabled. - * | | |1 = Tamper 0 de-bounce Enabled. - * |[12] |TAMP1EN |Tamper 1 Detect Enable Bit - * | | |0 = Tamper 1 detect Disabled. - * | | |1 = Tamper 1 detect Enabled. - * | | |Note1: The reference is RTC clock. Tamper detector need sync 2 ~ 3 RTC clock. - * |[13] |TAMP1LV |Tamper 1 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[14] |TAMP1DBEN |Tamper 1 De-bounce Enable Bit - * | | |0 = Tamper 1 de-bounce Disabled. - * | | |1 = Tamper 1 de-bounce Enabled. - * |[15] |DYNPR0EN |Dynamic Pair 0 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * |[16] |TAMP2EN |Tamper 2 Detect Enable Bit - * | | |0 = Tamper 2 detect Disabled. - * | | |1 = Tamper 2 detect Enabled. - * | | |Note1: The reference is RTC clock. Tamper detector need sync 2 ~ 3 RTC clock. - * |[17] |TAMP2LV |Tamper 2 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[18] |TAMP2DBEN |Tamper 2 De-bounce Enable Bit - * | | |0 = Tamper 2 de-bounce Disabled. - * | | |1 = Tamper 2 de-bounce Enabled. - * |[20] |TAMP3EN |Tamper 3 Detect Enable Bit - * | | |0 = Tamper 3 detect Disabled. - * | | |1 = Tamper 3 detect Enabled. - * | | |Note1: The reference is RTC clock. Tamper detector need sync 2 ~ 3 RTC clock. - * |[21] |TAMP3LV |Tamper 3 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[22] |TAMP3DBEN |Tamper 3 De-bounce Enable Bit - * | | |0 = Tamper 3 de-bounce Disabled. - * | | |1 = Tamper 3 de-bounce Enabled. - * |[23] |DYNPR1EN |Dynamic Pair 1 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * |[24] |TAMP4EN |Tamper4 Detect Enable Bit - * | | |0 = Tamper 4 detect Disabled. - * | | |1 = Tamper 4 detect Enabled. - * | | |Note1: The reference is RTC clock. Tamper detector need sync 2 ~ 3 RTC clock. - * |[25] |TAMP4LV |Tamper 4 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[26] |TAMP4DBEN |Tamper 4 De-bounce Enable Bit - * | | |0 = Tamper 4 de-bounce Disabled. - * | | |1 = Tamper 4 de-bounce Enabled. - * |[28] |TAMP5EN |Tamper 5 Detect Enable Bit - * | | |0 = Tamper 5 detect Disabled. - * | | |1 = Tamper 5 detect Enabled. - * | | |Note1: The reference is RTC clock. Tamper detector need sync 2 ~ 3 RTC clock. - * |[29] |TAMP5LV |Tamper 5 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[30] |TAMP5DBEN |Tamper 5 De-bounce Enable Bit - * | | |0 = Tamper 5 de-bounce Disabled. - * | | |1 = Tamper 5 de-bounce Enabled. - * |[31] |DYNPR2EN |Dynamic Pair 2 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * @var RTC_T::TAMPSEED - * Offset: 0x128 RTC Tamper Dynamic Seed Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed Value - * @var RTC_T::TAMPTIME - * Offset: 0x130 RTC Tamper Time Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit of TAMPER Time (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit of TAMPER Time (0~5) - * |[11:8] |MIN |1-Min Time Digit of TAMPER Time (0~9) - * |[14:12] |TENMIN |10-Min Time Digit of TAMPER Time (0~5) - * |[19:16] |HR |1-Hour Time Digit of TAMPER Time (0~9) - * |[21:20] |TENHR |10-Hour Time Digit of TAMPER Time (0~2) - * | | |Note: 24-hour time scale only. - * @var RTC_T::TAMPCAL - * Offset: 0x134 RTC Tamper Calendar Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit of TAMPER Calendar (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit of TAMPER Calendar (0~3) - * |[11:8] |MON |1-Month Calendar Digit of TAMPER Calendar (0~9) - * |[12] |TENMON |10-Month Calendar Digit of TAMPER Calendar (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit of TAMPER Calendar (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit of TAMPER Calendar (0~9) - * @var RTC_T::CLKDCTL - * Offset: 0x140 RTC Clock Fail Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LXTFDEN |LXT Clock Fail/Stop Detector Enable Bit - * | | |0 = LXT clock Fail/Stop detector Disabled. - * | | |1 = LXT clock Fail/Stop detector Enabled. - * | | |Note: LXT detector will automatic disable when Fail/Stop Flag rise, resume after Fail/Stop Flag clear. - * |[1] |LXTFSW |LXT Clock Fail Detector Switch LIRC32K Enable Bit - * | | |0 = LXT clock Fail switch LIRC32K Disabled. - * | | |1 = LXT clock Fail detector rise, RTC clock source switch from LIRC32K. - * | | |If LXT clock fail detector flag CLKFIF (RTC_INTSTS[24]) is generated, RTC clock source will switch to LIRC32K automatically. - * |[2] |LXTSTSW |LXT Clock Stop Detector Switch LIRC32K Enable Bit - * | | |0 = LXT clock Stop switch LIRC32K Disabled. - * | | |1 = LXT clock Stop detector rise, RTC clock source switch from LIRC32K. - * | | |If LXT clock stop detector flag CLKSTIF (RTC_INTSTS[25]) is generated, RTC clock source will switch to LIRC32K automatically - * |[16] |SWLIRCF |LXT Clock Detector Fail/Stop Switch LIRC32K Flag (Read Only) - * | | |0 = Indicate RTC clock source from LXT. - * | | |1 = Indicate RTC clock source from LIRC32K. - * |[17] |LXTSLOWF |LXT Slower Than LIRC32K Flag (Read Only) - * | | |0 = LXT frequency faster than LIRC32K. - * | | |1 = LXT frequency is slowly. - * | | |Note: LXTSLOWF is vaild during CLKSTIF (RTC_INTSTS[25]) or CLKFIF (RTC_INTSTS[24]) rising. - * @var RTC_T::CDBR - * Offset: 0x144 RTC Clock Frequency Detector Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |STOPBD |LXT Clock Stop Frequency Detector Stop Boundary - * | | |These bits define the stop value of frequency monitor window. - * | | |When LXT frequency monitor counter lower than STOPBD, the LXT frequency detect Stop interrupt flag will set to 1. - * | | |Note: The boundary is defined as the maximum value of LXT among 256 LIRC32K clock time. - * |[23:16] |FAILBD |LXT Clock Frequency Detector Fail Boundary - * | | |These bits define the fail value of frequency monitor window. - * | | |When LXT frequency monitor counter lower than FAILBD, the LXT frequency detect fail interrupt flag will set to 1. - * | | |Note: The boundary is defined as the maximum value of LXT among 256 LIRC32K clock time. - */ - __IO uint32_t INIT; /*!< [0x0000] RTC Initiation Register */ - __I uint32_t RESERVE0[1]; /* 0x4 */ - __IO uint32_t FREQADJ; /*!< [0x0008] RTC Frequency Compensation Register */ - __IO uint32_t TIME; /*!< [0x000c] RTC Time Loading Register */ - __IO uint32_t CAL; /*!< [0x0010] RTC Calendar Loading Register */ - __IO uint32_t CLKFMT; /*!< [0x0014] RTC Time Scale Selection Register */ - __IO uint32_t WEEKDAY; /*!< [0x0018] RTC Day of the Week Register */ - __IO uint32_t TALM; /*!< [0x001c] RTC Time Alarm Register */ - __IO uint32_t CALM; /*!< [0x0020] RTC Calendar Alarm Register */ - __I uint32_t LEAPYEAR; /*!< [0x0024] RTC Leap Year Indicator Register */ - __IO uint32_t INTEN; /*!< [0x0028] RTC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x002c] RTC Interrupt Status Register */ - __IO uint32_t TICK; /*!< [0x0030] RTC Time Tick Register */ - __IO uint32_t TAMSK; /*!< [0x0034] RTC Time Alarm Mask Register */ - __IO uint32_t CAMSK; /*!< [0x0038] RTC Calendar Alarm Mask Register */ - __IO uint32_t SPRCTL; /*!< [0x003c] RTC Spare Functional Control Register */ - __IO uint32_t SPR[20]; /*!< [0x0040] ~ [0x008C] RTC Spare Register 0 ~ 19 */ - __I uint32_t RESERVE1[28]; /* 0x90 ~ 0xfc */ - __IO uint32_t LXTCTL; /*!< [0x0100] RTC 32.768 kHz Oscillator Control Register */ - __IO uint32_t GPIOCTL0; /*!< [0x0104] RTC GPIO Control 0 Register */ - __IO uint32_t GPIOCTL1; /*!< [0x0108] RTC GPIO Control 1 Register */ - __I uint32_t RESERVE2[1]; /* 0x10c */ - __IO uint32_t DSTCTL; /*!< [0x0110] RTC Daylight Saving Time Control Register */ - __I uint32_t RESERVE3[3]; /* 0x114 ~ 0x11c */ - __IO uint32_t TAMPCTL; /*!< [0x0120] RTC Tamper Pin Control Register */ - __I uint32_t RESERVE4[1]; /* 0x124 */ - __IO uint32_t TAMPSEED; /*!< [0x0128] RTC Tamper Dynamic Seed Register */ - __I uint32_t RESERVE5[1]; /* 0x12c */ - __I uint32_t TAMPTIME; /*!< [0x0130] RTC Tamper Time Register */ - __I uint32_t TAMPCAL; /*!< [0x0134] RTC Tamper Calendar Register */ - __I uint32_t RESERVE6[2]; /* 0x138 ~ 0x13c */ - __IO uint32_t CLKDCTL; /*!< [0x0140] RTC Clock Fail Detector Control Register */ - __IO uint32_t CDBR; /*!< [0x0144] RTC Clock Frequency Detector Boundary Register */ - -} RTC_T; - -/** - @addtogroup RTC_CONST RTC Bit Field Definition - Constant Definitions for RTC Controller - @{ -*/ - -#define RTC_INIT_ACTIVE_Pos (0) /*!< RTC_T::INIT: ACTIVE Position */ -#define RTC_INIT_ACTIVE_Msk (0x1ul << RTC_INIT_ACTIVE_Pos) /*!< RTC_T::INIT: ACTIVE Mask */ - -#define RTC_INIT_INIT_Pos (1) /*!< RTC_T::INIT: INIT Position */ -#define RTC_INIT_INIT_Msk (0x7ffffffful << RTC_INIT_INIT_Pos) /*!< RTC_T::INIT: INIT Mask */ - -#define RTC_FREQADJ_FRACTION_Pos (0) /*!< RTC_T::FREQADJ: FRACTION Position */ -#define RTC_FREQADJ_FRACTION_Msk (0x3ful << RTC_FREQADJ_FRACTION_Pos) /*!< RTC_T::FREQADJ: FRACTION Mask */ - -#define RTC_FREQADJ_INTEGER_Pos (8) /*!< RTC_T::FREQADJ: INTEGER Position */ -#define RTC_FREQADJ_INTEGER_Msk (0x1ful << RTC_FREQADJ_INTEGER_Pos) /*!< RTC_T::FREQADJ: INTEGER Mask */ - -#define RTC_FREQADJ_FCRBUSY_Pos (31) /*!< RTC_T::FREQADJ: FCRBUSY Position */ -#define RTC_FREQADJ_FCRBUSY_Msk (0x1ul << RTC_FREQADJ_FCRBUSY_Pos) /*!< RTC_T::FREQADJ: FCRBUSY Mask */ - -#define RTC_TIME_SEC_Pos (0) /*!< RTC_T::TIME: SEC Position */ -#define RTC_TIME_SEC_Msk (0xful << RTC_TIME_SEC_Pos) /*!< RTC_T::TIME: SEC Mask */ - -#define RTC_TIME_TENSEC_Pos (4) /*!< RTC_T::TIME: TENSEC Position */ -#define RTC_TIME_TENSEC_Msk (0x7ul << RTC_TIME_TENSEC_Pos) /*!< RTC_T::TIME: TENSEC Mask */ - -#define RTC_TIME_MIN_Pos (8) /*!< RTC_T::TIME: MIN Position */ -#define RTC_TIME_MIN_Msk (0xful << RTC_TIME_MIN_Pos) /*!< RTC_T::TIME: MIN Mask */ - -#define RTC_TIME_TENMIN_Pos (12) /*!< RTC_T::TIME: TENMIN Position */ -#define RTC_TIME_TENMIN_Msk (0x7ul << RTC_TIME_TENMIN_Pos) /*!< RTC_T::TIME: TENMIN Mask */ - -#define RTC_TIME_HR_Pos (16) /*!< RTC_T::TIME: HR Position */ -#define RTC_TIME_HR_Msk (0xful << RTC_TIME_HR_Pos) /*!< RTC_T::TIME: HR Mask */ - -#define RTC_TIME_TENHR_Pos (20) /*!< RTC_T::TIME: TENHR Position */ -#define RTC_TIME_TENHR_Msk (0x3ul << RTC_TIME_TENHR_Pos) /*!< RTC_T::TIME: TENHR Mask */ - -#define RTC_CAL_DAY_Pos (0) /*!< RTC_T::CAL: DAY Position */ -#define RTC_CAL_DAY_Msk (0xful << RTC_CAL_DAY_Pos) /*!< RTC_T::CAL: DAY Mask */ - -#define RTC_CAL_TENDAY_Pos (4) /*!< RTC_T::CAL: TENDAY Position */ -#define RTC_CAL_TENDAY_Msk (0x3ul << RTC_CAL_TENDAY_Pos) /*!< RTC_T::CAL: TENDAY Mask */ - -#define RTC_CAL_MON_Pos (8) /*!< RTC_T::CAL: MON Position */ -#define RTC_CAL_MON_Msk (0xful << RTC_CAL_MON_Pos) /*!< RTC_T::CAL: MON Mask */ - -#define RTC_CAL_TENMON_Pos (12) /*!< RTC_T::CAL: TENMON Position */ -#define RTC_CAL_TENMON_Msk (0x1ul << RTC_CAL_TENMON_Pos) /*!< RTC_T::CAL: TENMON Mask */ - -#define RTC_CAL_YEAR_Pos (16) /*!< RTC_T::CAL: YEAR Position */ -#define RTC_CAL_YEAR_Msk (0xful << RTC_CAL_YEAR_Pos) /*!< RTC_T::CAL: YEAR Mask */ - -#define RTC_CAL_TENYEAR_Pos (20) /*!< RTC_T::CAL: TENYEAR Position */ -#define RTC_CAL_TENYEAR_Msk (0xful << RTC_CAL_TENYEAR_Pos) /*!< RTC_T::CAL: TENYEAR Mask */ - -#define RTC_CLKFMT_24HEN_Pos (0) /*!< RTC_T::CLKFMT: 24HEN Position */ -#define RTC_CLKFMT_24HEN_Msk (0x1ul << RTC_CLKFMT_24HEN_Pos) /*!< RTC_T::CLKFMT: 24HEN Mask */ - -#define RTC_CLKFMT_DCOMPEN_Pos (16) /*!< RTC_T::CLKFMT: DCOMPEN Position */ -#define RTC_CLKFMT_DCOMPEN_Msk (0x1ul << RTC_CLKFMT_DCOMPEN_Pos) /*!< RTC_T::CLKFMT: DCOMPEN Mask */ - -#define RTC_WEEKDAY_WEEKDAY_Pos (0) /*!< RTC_T::WEEKDAY: WEEKDAY Position */ -#define RTC_WEEKDAY_WEEKDAY_Msk (0x7ul << RTC_WEEKDAY_WEEKDAY_Pos) /*!< RTC_T::WEEKDAY: WEEKDAY Mask */ - -#define RTC_TALM_SEC_Pos (0) /*!< RTC_T::TALM: SEC Position */ -#define RTC_TALM_SEC_Msk (0xful << RTC_TALM_SEC_Pos) /*!< RTC_T::TALM: SEC Mask */ - -#define RTC_TALM_TENSEC_Pos (4) /*!< RTC_T::TALM: TENSEC Position */ -#define RTC_TALM_TENSEC_Msk (0x7ul << RTC_TALM_TENSEC_Pos) /*!< RTC_T::TALM: TENSEC Mask */ - -#define RTC_TALM_MIN_Pos (8) /*!< RTC_T::TALM: MIN Position */ -#define RTC_TALM_MIN_Msk (0xful << RTC_TALM_MIN_Pos) /*!< RTC_T::TALM: MIN Mask */ - -#define RTC_TALM_TENMIN_Pos (12) /*!< RTC_T::TALM: TENMIN Position */ -#define RTC_TALM_TENMIN_Msk (0x7ul << RTC_TALM_TENMIN_Pos) /*!< RTC_T::TALM: TENMIN Mask */ - -#define RTC_TALM_HR_Pos (16) /*!< RTC_T::TALM: HR Position */ -#define RTC_TALM_HR_Msk (0xful << RTC_TALM_HR_Pos) /*!< RTC_T::TALM: HR Mask */ - -#define RTC_TALM_TENHR_Pos (20) /*!< RTC_T::TALM: TENHR Position */ -#define RTC_TALM_TENHR_Msk (0x3ul << RTC_TALM_TENHR_Pos) /*!< RTC_T::TALM: TENHR Mask */ - -#define RTC_CALM_DAY_Pos (0) /*!< RTC_T::CALM: DAY Position */ -#define RTC_CALM_DAY_Msk (0xful << RTC_CALM_DAY_Pos) /*!< RTC_T::CALM: DAY Mask */ - -#define RTC_CALM_TENDAY_Pos (4) /*!< RTC_T::CALM: TENDAY Position */ -#define RTC_CALM_TENDAY_Msk (0x3ul << RTC_CALM_TENDAY_Pos) /*!< RTC_T::CALM: TENDAY Mask */ - -#define RTC_CALM_MON_Pos (8) /*!< RTC_T::CALM: MON Position */ -#define RTC_CALM_MON_Msk (0xful << RTC_CALM_MON_Pos) /*!< RTC_T::CALM: MON Mask */ - -#define RTC_CALM_TENMON_Pos (12) /*!< RTC_T::CALM: TENMON Position */ -#define RTC_CALM_TENMON_Msk (0x1ul << RTC_CALM_TENMON_Pos) /*!< RTC_T::CALM: TENMON Mask */ - -#define RTC_CALM_YEAR_Pos (16) /*!< RTC_T::CALM: YEAR Position */ -#define RTC_CALM_YEAR_Msk (0xful << RTC_CALM_YEAR_Pos) /*!< RTC_T::CALM: YEAR Mask */ - -#define RTC_CALM_TENYEAR_Pos (20) /*!< RTC_T::CALM: TENYEAR Position */ -#define RTC_CALM_TENYEAR_Msk (0xful << RTC_CALM_TENYEAR_Pos) /*!< RTC_T::CALM: TENYEAR Mask */ - -#define RTC_LEAPYEAR_LEAPYEAR_Pos (0) /*!< RTC_T::LEAPYEAR: LEAPYEAR Position */ -#define RTC_LEAPYEAR_LEAPYEAR_Msk (0x1ul << RTC_LEAPYEAR_LEAPYEAR_Pos) /*!< RTC_T::LEAPYEAR: LEAPYEAR Mask */ - -#define RTC_INTEN_ALMIEN_Pos (0) /*!< RTC_T::INTEN: ALMIEN Position */ -#define RTC_INTEN_ALMIEN_Msk (0x1ul << RTC_INTEN_ALMIEN_Pos) /*!< RTC_T::INTEN: ALMIEN Mask */ - -#define RTC_INTEN_TICKIEN_Pos (1) /*!< RTC_T::INTEN: TICKIEN Position */ -#define RTC_INTEN_TICKIEN_Msk (0x1ul << RTC_INTEN_TICKIEN_Pos) /*!< RTC_T::INTEN: TICKIEN Mask */ - -#define RTC_INTEN_TAMP0IEN_Pos (8) /*!< RTC_T::INTEN: TAMP0IEN Position */ -#define RTC_INTEN_TAMP0IEN_Msk (0x1ul << RTC_INTEN_TAMP0IEN_Pos) /*!< RTC_T::INTEN: TAMP0IEN Mask */ - -#define RTC_INTEN_TAMP1IEN_Pos (9) /*!< RTC_T::INTEN: TAMP1IEN Position */ -#define RTC_INTEN_TAMP1IEN_Msk (0x1ul << RTC_INTEN_TAMP1IEN_Pos) /*!< RTC_T::INTEN: TAMP1IEN Mask */ - -#define RTC_INTEN_TAMP2IEN_Pos (10) /*!< RTC_T::INTEN: TAMP2IEN Position */ -#define RTC_INTEN_TAMP2IEN_Msk (0x1ul << RTC_INTEN_TAMP2IEN_Pos) /*!< RTC_T::INTEN: TAMP2IEN Mask */ - -#define RTC_INTEN_TAMP3IEN_Pos (11) /*!< RTC_T::INTEN: TAMP3IEN Position */ -#define RTC_INTEN_TAMP3IEN_Msk (0x1ul << RTC_INTEN_TAMP3IEN_Pos) /*!< RTC_T::INTEN: TAMP3IEN Mask */ - -#define RTC_INTEN_TAMP4IEN_Pos (12) /*!< RTC_T::INTEN: TAMP4IEN Position */ -#define RTC_INTEN_TAMP4IEN_Msk (0x1ul << RTC_INTEN_TAMP4IEN_Pos) /*!< RTC_T::INTEN: TAMP4IEN Mask */ - -#define RTC_INTEN_TAMP5IEN_Pos (13) /*!< RTC_T::INTEN: TAMP5IEN Position */ -#define RTC_INTEN_TAMP5IEN_Msk (0x1ul << RTC_INTEN_TAMP5IEN_Pos) /*!< RTC_T::INTEN: TAMP5IEN Mask */ - -#define RTC_INTEN_CLKFIEN_Pos (24) /*!< RTC_T::INTEN: CLKFIEN Position */ -#define RTC_INTEN_CLKFIEN_Msk (0x1ul << RTC_INTEN_CLKFIEN_Pos) /*!< RTC_T::INTEN: CLKFIEN Mask */ - -#define RTC_INTEN_CLKSTIEN_Pos (25) /*!< RTC_T::INTEN: CLKSTIEN Position */ -#define RTC_INTEN_CLKSTIEN_Msk (0x1ul << RTC_INTEN_CLKSTIEN_Pos) /*!< RTC_T::INTEN: CLKSTIEN Mask */ - -#define RTC_INTSTS_ALMIF_Pos (0) /*!< RTC_T::INTSTS: ALMIF Position */ -#define RTC_INTSTS_ALMIF_Msk (0x1ul << RTC_INTSTS_ALMIF_Pos) /*!< RTC_T::INTSTS: ALMIF Mask */ - -#define RTC_INTSTS_TICKIF_Pos (1) /*!< RTC_T::INTSTS: TICKIF Position */ -#define RTC_INTSTS_TICKIF_Msk (0x1ul << RTC_INTSTS_TICKIF_Pos) /*!< RTC_T::INTSTS: TICKIF Mask */ - -#define RTC_INTSTS_TAMP0IF_Pos (8) /*!< RTC_T::INTSTS: TAMP0IF Position */ -#define RTC_INTSTS_TAMP0IF_Msk (0x1ul << RTC_INTSTS_TAMP0IF_Pos) /*!< RTC_T::INTSTS: TAMP0IF Mask */ - -#define RTC_INTSTS_TAMP1IF_Pos (9) /*!< RTC_T::INTSTS: TAMP1IF Position */ -#define RTC_INTSTS_TAMP1IF_Msk (0x1ul << RTC_INTSTS_TAMP1IF_Pos) /*!< RTC_T::INTSTS: TAMP1IF Mask */ - -#define RTC_INTSTS_TAMP2IF_Pos (10) /*!< RTC_T::INTSTS: TAMP2IF Position */ -#define RTC_INTSTS_TAMP2IF_Msk (0x1ul << RTC_INTSTS_TAMP2IF_Pos) /*!< RTC_T::INTSTS: TAMP2IF Mask */ - -#define RTC_INTSTS_TAMP3IF_Pos (11) /*!< RTC_T::INTSTS: TAMP3IF Position */ -#define RTC_INTSTS_TAMP3IF_Msk (0x1ul << RTC_INTSTS_TAMP3IF_Pos) /*!< RTC_T::INTSTS: TAMP3IF Mask */ - -#define RTC_INTSTS_TAMP4IF_Pos (12) /*!< RTC_T::INTSTS: TAMP4IF Position */ -#define RTC_INTSTS_TAMP4IF_Msk (0x1ul << RTC_INTSTS_TAMP4IF_Pos) /*!< RTC_T::INTSTS: TAMP4IF Mask */ - -#define RTC_INTSTS_TAMP5IF_Pos (13) /*!< RTC_T::INTSTS: TAMP5IF Position */ -#define RTC_INTSTS_TAMP5IF_Msk (0x1ul << RTC_INTSTS_TAMP5IF_Pos) /*!< RTC_T::INTSTS: TAMP5IF Mask */ - -#define RTC_INTSTS_CLKFIF_Pos (24) /*!< RTC_T::INTSTS: CLKFIF Position */ -#define RTC_INTSTS_CLKFIF_Msk (0x1ul << RTC_INTSTS_CLKFIF_Pos) /*!< RTC_T::INTSTS: CLKFIF Mask */ - -#define RTC_INTSTS_CLKSTIF_Pos (25) /*!< RTC_T::INTSTS: CLKSTIF Position */ -#define RTC_INTSTS_CLKSTIF_Msk (0x1ul << RTC_INTSTS_CLKSTIF_Pos) /*!< RTC_T::INTSTS: CLKSTIF Mask */ - -#define RTC_TICK_TICK_Pos (0) /*!< RTC_T::TICK: TICK Position */ -#define RTC_TICK_TICK_Msk (0x7ul << RTC_TICK_TICK_Pos) /*!< RTC_T::TICK: TICK Mask */ - -#define RTC_TAMSK_MSEC_Pos (0) /*!< RTC_T::TAMSK: MSEC Position */ -#define RTC_TAMSK_MSEC_Msk (0x1ul << RTC_TAMSK_MSEC_Pos) /*!< RTC_T::TAMSK: MSEC Mask */ - -#define RTC_TAMSK_MTENSEC_Pos (1) /*!< RTC_T::TAMSK: MTENSEC Position */ -#define RTC_TAMSK_MTENSEC_Msk (0x1ul << RTC_TAMSK_MTENSEC_Pos) /*!< RTC_T::TAMSK: MTENSEC Mask */ - -#define RTC_TAMSK_MMIN_Pos (2) /*!< RTC_T::TAMSK: MMIN Position */ -#define RTC_TAMSK_MMIN_Msk (0x1ul << RTC_TAMSK_MMIN_Pos) /*!< RTC_T::TAMSK: MMIN Mask */ - -#define RTC_TAMSK_MTENMIN_Pos (3) /*!< RTC_T::TAMSK: MTENMIN Position */ -#define RTC_TAMSK_MTENMIN_Msk (0x1ul << RTC_TAMSK_MTENMIN_Pos) /*!< RTC_T::TAMSK: MTENMIN Mask */ - -#define RTC_TAMSK_MHR_Pos (4) /*!< RTC_T::TAMSK: MHR Position */ -#define RTC_TAMSK_MHR_Msk (0x1ul << RTC_TAMSK_MHR_Pos) /*!< RTC_T::TAMSK: MHR Mask */ - -#define RTC_TAMSK_MTENHR_Pos (5) /*!< RTC_T::TAMSK: MTENHR Position */ -#define RTC_TAMSK_MTENHR_Msk (0x1ul << RTC_TAMSK_MTENHR_Pos) /*!< RTC_T::TAMSK: MTENHR Mask */ - -#define RTC_CAMSK_MDAY_Pos (0) /*!< RTC_T::CAMSK: MDAY Position */ -#define RTC_CAMSK_MDAY_Msk (0x1ul << RTC_CAMSK_MDAY_Pos) /*!< RTC_T::CAMSK: MDAY Mask */ - -#define RTC_CAMSK_MTENDAY_Pos (1) /*!< RTC_T::CAMSK: MTENDAY Position */ -#define RTC_CAMSK_MTENDAY_Msk (0x1ul << RTC_CAMSK_MTENDAY_Pos) /*!< RTC_T::CAMSK: MTENDAY Mask */ - -#define RTC_CAMSK_MMON_Pos (2) /*!< RTC_T::CAMSK: MMON Position */ -#define RTC_CAMSK_MMON_Msk (0x1ul << RTC_CAMSK_MMON_Pos) /*!< RTC_T::CAMSK: MMON Mask */ - -#define RTC_CAMSK_MTENMON_Pos (3) /*!< RTC_T::CAMSK: MTENMON Position */ -#define RTC_CAMSK_MTENMON_Msk (0x1ul << RTC_CAMSK_MTENMON_Pos) /*!< RTC_T::CAMSK: MTENMON Mask */ - -#define RTC_CAMSK_MYEAR_Pos (4) /*!< RTC_T::CAMSK: MYEAR Position */ -#define RTC_CAMSK_MYEAR_Msk (0x1ul << RTC_CAMSK_MYEAR_Pos) /*!< RTC_T::CAMSK: MYEAR Mask */ - -#define RTC_CAMSK_MTENYEAR_Pos (5) /*!< RTC_T::CAMSK: MTENYEAR Position */ -#define RTC_CAMSK_MTENYEAR_Msk (0x1ul << RTC_CAMSK_MTENYEAR_Pos) /*!< RTC_T::CAMSK: MTENYEAR Mask */ - -#define RTC_SPRCTL_SPRRWEN_Pos (2) /*!< RTC_T::SPRCTL: SPRRWEN Position */ -#define RTC_SPRCTL_SPRRWEN_Msk (0x1ul << RTC_SPRCTL_SPRRWEN_Pos) /*!< RTC_T::SPRCTL: SPRRWEN Mask */ - -#define RTC_SPRCTL_SPRCSTS_Pos (5) /*!< RTC_T::SPRCTL: SPRCSTS Position */ -#define RTC_SPRCTL_SPRCSTS_Msk (0x1ul << RTC_SPRCTL_SPRCSTS_Pos) /*!< RTC_T::SPRCTL: SPRCSTS Mask */ - -#define RTC_SPRCTL_LXTFCLR_Pos (16) /*!< RTC_T::SPRCTL: LXTFCLR Position */ -#define RTC_SPRCTL_LXTFCLR_Msk (0x1ul << RTC_SPRCTL_LXTFCLR_Pos) /*!< RTC_T::SPRCTL: LXTFCLR Mask */ - -#define RTC_SPR0_SPARE_Pos (0) /*!< RTC_T::SPR0: SPARE Position */ -#define RTC_SPR0_SPARE_Msk (0xfffffffful << RTC_SPR0_SPARE_Pos) /*!< RTC_T::SPR0: SPARE Mask */ - -#define RTC_SPR1_SPARE_Pos (0) /*!< RTC_T::SPR1: SPARE Position */ -#define RTC_SPR1_SPARE_Msk (0xfffffffful << RTC_SPR1_SPARE_Pos) /*!< RTC_T::SPR1: SPARE Mask */ - -#define RTC_SPR2_SPARE_Pos (0) /*!< RTC_T::SPR2: SPARE Position */ -#define RTC_SPR2_SPARE_Msk (0xfffffffful << RTC_SPR2_SPARE_Pos) /*!< RTC_T::SPR2: SPARE Mask */ - -#define RTC_SPR3_SPARE_Pos (0) /*!< RTC_T::SPR3: SPARE Position */ -#define RTC_SPR3_SPARE_Msk (0xfffffffful << RTC_SPR3_SPARE_Pos) /*!< RTC_T::SPR3: SPARE Mask */ - -#define RTC_SPR4_SPARE_Pos (0) /*!< RTC_T::SPR4: SPARE Position */ -#define RTC_SPR4_SPARE_Msk (0xfffffffful << RTC_SPR4_SPARE_Pos) /*!< RTC_T::SPR4: SPARE Mask */ - -#define RTC_SPR5_SPARE_Pos (0) /*!< RTC_T::SPR5: SPARE Position */ -#define RTC_SPR5_SPARE_Msk (0xfffffffful << RTC_SPR5_SPARE_Pos) /*!< RTC_T::SPR5: SPARE Mask */ - -#define RTC_SPR6_SPARE_Pos (0) /*!< RTC_T::SPR6: SPARE Position */ -#define RTC_SPR6_SPARE_Msk (0xfffffffful << RTC_SPR6_SPARE_Pos) /*!< RTC_T::SPR6: SPARE Mask */ - -#define RTC_SPR7_SPARE_Pos (0) /*!< RTC_T::SPR7: SPARE Position */ -#define RTC_SPR7_SPARE_Msk (0xfffffffful << RTC_SPR7_SPARE_Pos) /*!< RTC_T::SPR7: SPARE Mask */ - -#define RTC_SPR8_SPARE_Pos (0) /*!< RTC_T::SPR8: SPARE Position */ -#define RTC_SPR8_SPARE_Msk (0xfffffffful << RTC_SPR8_SPARE_Pos) /*!< RTC_T::SPR8: SPARE Mask */ - -#define RTC_SPR9_SPARE_Pos (0) /*!< RTC_T::SPR9: SPARE Position */ -#define RTC_SPR9_SPARE_Msk (0xfffffffful << RTC_SPR9_SPARE_Pos) /*!< RTC_T::SPR9: SPARE Mask */ - -#define RTC_SPR10_SPARE_Pos (0) /*!< RTC_T::SPR10: SPARE Position */ -#define RTC_SPR10_SPARE_Msk (0xfffffffful << RTC_SPR10_SPARE_Pos) /*!< RTC_T::SPR10: SPARE Mask */ - -#define RTC_SPR11_SPARE_Pos (0) /*!< RTC_T::SPR11: SPARE Position */ -#define RTC_SPR11_SPARE_Msk (0xfffffffful << RTC_SPR11_SPARE_Pos) /*!< RTC_T::SPR11: SPARE Mask */ - -#define RTC_SPR12_SPARE_Pos (0) /*!< RTC_T::SPR12: SPARE Position */ -#define RTC_SPR12_SPARE_Msk (0xfffffffful << RTC_SPR12_SPARE_Pos) /*!< RTC_T::SPR12: SPARE Mask */ - -#define RTC_SPR13_SPARE_Pos (0) /*!< RTC_T::SPR13: SPARE Position */ -#define RTC_SPR13_SPARE_Msk (0xfffffffful << RTC_SPR13_SPARE_Pos) /*!< RTC_T::SPR13: SPARE Mask */ - -#define RTC_SPR14_SPARE_Pos (0) /*!< RTC_T::SPR14: SPARE Position */ -#define RTC_SPR14_SPARE_Msk (0xfffffffful << RTC_SPR14_SPARE_Pos) /*!< RTC_T::SPR14: SPARE Mask */ - -#define RTC_SPR15_SPARE_Pos (0) /*!< RTC_T::SPR15: SPARE Position */ -#define RTC_SPR15_SPARE_Msk (0xfffffffful << RTC_SPR15_SPARE_Pos) /*!< RTC_T::SPR15: SPARE Mask */ - -#define RTC_SPR16_SPARE_Pos (0) /*!< RTC_T::SPR16: SPARE Position */ -#define RTC_SPR16_SPARE_Msk (0xfffffffful << RTC_SPR16_SPARE_Pos) /*!< RTC_T::SPR16: SPARE Mask */ - -#define RTC_SPR17_SPARE_Pos (0) /*!< RTC_T::SPR17: SPARE Position */ -#define RTC_SPR17_SPARE_Msk (0xfffffffful << RTC_SPR17_SPARE_Pos) /*!< RTC_T::SPR17: SPARE Mask */ - -#define RTC_SPR18_SPARE_Pos (0) /*!< RTC_T::SPR18: SPARE Position */ -#define RTC_SPR18_SPARE_Msk (0xfffffffful << RTC_SPR18_SPARE_Pos) /*!< RTC_T::SPR18: SPARE Mask */ - -#define RTC_SPR19_SPARE_Pos (0) /*!< RTC_T::SPR19: SPARE Position */ -#define RTC_SPR19_SPARE_Msk (0xfffffffful << RTC_SPR19_SPARE_Pos) /*!< RTC_T::SPR19: SPARE Mask */ - -#define RTC_LXTCTL_LIRC32KEN_Pos (0) /*!< RTC_T::LXTCTL: LIRC32KEN Position */ -#define RTC_LXTCTL_LIRC32KEN_Msk (0x1ul << RTC_LXTCTL_LIRC32KEN_Pos) /*!< RTC_T::LXTCTL: LIRC32KEN Mask */ - -#define RTC_LXTCTL_GAIN_Pos (1) /*!< RTC_T::LXTCTL: GAIN Position */ -#define RTC_LXTCTL_GAIN_Msk (0x7ul << RTC_LXTCTL_GAIN_Pos) /*!< RTC_T::LXTCTL: GAIN Mask */ - -#define RTC_LXTCTL_C32KSEL_Pos (6) /*!< RTC_T::LXTCTL: C32KSEL Position */ -#define RTC_LXTCTL_C32KSEL_Msk (0x1ul << RTC_LXTCTL_C32KSEL_Pos) /*!< RTC_T::LXTCTL: C32KSEL Mask */ - -#define RTC_LXTCTL_RTCCKSEL_Pos (7) /*!< RTC_T::LXTCTL: RTCCKSEL Position */ -#define RTC_LXTCTL_RTCCKSEL_Msk (0x1ul << RTC_LXTCTL_RTCCKSEL_Pos) /*!< RTC_T::LXTCTL: RTCCKSEL Mask */ - -#define RTC_LXTCTL_IOCTLSEL_Pos (8) /*!< RTC_T::LXTCTL: IOCTLSEL Position */ -#define RTC_LXTCTL_IOCTLSEL_Msk (0x1ul << RTC_LXTCTL_IOCTLSEL_Pos) /*!< RTC_T::LXTCTL: IOCTLSEL Mask */ - -#define RTC_GPIOCTL0_OPMODE0_Pos (0) /*!< RTC_T::GPIOCTL0: OPMODE0 Position */ -#define RTC_GPIOCTL0_OPMODE0_Msk (0x3ul << RTC_GPIOCTL0_OPMODE0_Pos) /*!< RTC_T::GPIOCTL0: OPMODE0 Mask */ - -#define RTC_GPIOCTL0_DOUT0_Pos (2) /*!< RTC_T::GPIOCTL0: DOUT0 Position */ -#define RTC_GPIOCTL0_DOUT0_Msk (0x1ul << RTC_GPIOCTL0_DOUT0_Pos) /*!< RTC_T::GPIOCTL0: DOUT0 Mask */ - -#define RTC_GPIOCTL0_DINOFF0_Pos (3) /*!< RTC_T::GPIOCTL0: DINOFF0 Position */ -#define RTC_GPIOCTL0_DINOFF0_Msk (0x1ul << RTC_GPIOCTL0_DINOFF0_Pos) /*!< RTC_T::GPIOCTL0: DINOFF0 Mask */ - -#define RTC_GPIOCTL0_PUSEL0_Pos (4) /*!< RTC_T::GPIOCTL0: PUSEL0 Position */ -#define RTC_GPIOCTL0_PUSEL0_Msk (0x3ul << RTC_GPIOCTL0_PUSEL0_Pos) /*!< RTC_T::GPIOCTL0: PUSEL0 Mask */ - -#define RTC_GPIOCTL0_OPMODE1_Pos (8) /*!< RTC_T::GPIOCTL0: OPMODE1 Position */ -#define RTC_GPIOCTL0_OPMODE1_Msk (0x3ul << RTC_GPIOCTL0_OPMODE1_Pos) /*!< RTC_T::GPIOCTL0: OPMODE1 Mask */ - -#define RTC_GPIOCTL0_DOUT1_Pos (10) /*!< RTC_T::GPIOCTL0: DOUT1 Position */ -#define RTC_GPIOCTL0_DOUT1_Msk (0x1ul << RTC_GPIOCTL0_DOUT1_Pos) /*!< RTC_T::GPIOCTL0: DOUT1 Mask */ - -#define RTC_GPIOCTL0_DINOFF1_Pos (11) /*!< RTC_T::GPIOCTL0: DINOFF1 Position */ -#define RTC_GPIOCTL0_DINOFF1_Msk (0x1ul << RTC_GPIOCTL0_DINOFF1_Pos) /*!< RTC_T::GPIOCTL0: DINOFF1 Mask */ - -#define RTC_GPIOCTL0_PUSEL1_Pos (12) /*!< RTC_T::GPIOCTL0: PUSEL1 Position */ -#define RTC_GPIOCTL0_PUSEL1_Msk (0x3ul << RTC_GPIOCTL0_PUSEL1_Pos) /*!< RTC_T::GPIOCTL0: PUSEL1 Mask */ - -#define RTC_GPIOCTL0_OPMODE2_Pos (16) /*!< RTC_T::GPIOCTL0: OPMODE2 Position */ -#define RTC_GPIOCTL0_OPMODE2_Msk (0x3ul << RTC_GPIOCTL0_OPMODE2_Pos) /*!< RTC_T::GPIOCTL0: OPMODE2 Mask */ - -#define RTC_GPIOCTL0_DOUT2_Pos (18) /*!< RTC_T::GPIOCTL0: DOUT2 Position */ -#define RTC_GPIOCTL0_DOUT2_Msk (0x1ul << RTC_GPIOCTL0_DOUT2_Pos) /*!< RTC_T::GPIOCTL0: DOUT2 Mask */ - -#define RTC_GPIOCTL0_DINOFF2_Pos (19) /*!< RTC_T::GPIOCTL0: DINOFF2 Position */ -#define RTC_GPIOCTL0_DINOFF2_Msk (0x1ul << RTC_GPIOCTL0_DINOFF2_Pos) /*!< RTC_T::GPIOCTL0: DINOFF2 Mask */ - -#define RTC_GPIOCTL0_PUSEL2_Pos (20) /*!< RTC_T::GPIOCTL0: PUSEL2 Position */ -#define RTC_GPIOCTL0_PUSEL2_Msk (0x3ul << RTC_GPIOCTL0_PUSEL2_Pos) /*!< RTC_T::GPIOCTL0: PUSEL2 Mask */ - -#define RTC_GPIOCTL0_OPMODE3_Pos (24) /*!< RTC_T::GPIOCTL0: OPMODE3 Position */ -#define RTC_GPIOCTL0_OPMODE3_Msk (0x3ul << RTC_GPIOCTL0_OPMODE3_Pos) /*!< RTC_T::GPIOCTL0: OPMODE3 Mask */ - -#define RTC_GPIOCTL0_DOUT3_Pos (26) /*!< RTC_T::GPIOCTL0: DOUT3 Position */ -#define RTC_GPIOCTL0_DOUT3_Msk (0x1ul << RTC_GPIOCTL0_DOUT3_Pos) /*!< RTC_T::GPIOCTL0: DOUT3 Mask */ - -#define RTC_GPIOCTL0_DINOFF3_Pos (27) /*!< RTC_T::GPIOCTL0: DINOFF3 Position */ -#define RTC_GPIOCTL0_DINOFF3_Msk (0x1ul << RTC_GPIOCTL0_DINOFF3_Pos) /*!< RTC_T::GPIOCTL0: DINOFF3 Mask */ - -#define RTC_GPIOCTL0_PUSEL3_Pos (28) /*!< RTC_T::GPIOCTL0: PUSEL3 Position */ -#define RTC_GPIOCTL0_PUSEL3_Msk (0x3ul << RTC_GPIOCTL0_PUSEL3_Pos) /*!< RTC_T::GPIOCTL0: PUSEL3 Mask */ - -#define RTC_GPIOCTL1_OPMODE4_Pos (0) /*!< RTC_T::GPIOCTL1: OPMODE4 Position */ -#define RTC_GPIOCTL1_OPMODE4_Msk (0x3ul << RTC_GPIOCTL1_OPMODE4_Pos) /*!< RTC_T::GPIOCTL1: OPMODE4 Mask */ - -#define RTC_GPIOCTL1_DOUT4_Pos (2) /*!< RTC_T::GPIOCTL1: DOUT4 Position */ -#define RTC_GPIOCTL1_DOUT4_Msk (0x1ul << RTC_GPIOCTL1_DOUT4_Pos) /*!< RTC_T::GPIOCTL1: DOUT4 Mask */ - -#define RTC_GPIOCTL0_DINOFF4_Pos (3) /*!< RTC_T::GPIOCTL1: DINOFF4 Position */ -#define RTC_GPIOCTL0_DINOFF4_Msk (0x1ul << RTC_GPIOCTL0_DINOFF4_Pos) /*!< RTC_T::GPIOCTL1: DINOFF4 Mask */ - -#define RTC_GPIOCTL1_PUSEL4_Pos (4) /*!< RTC_T::GPIOCTL1: PUSEL4 Position */ -#define RTC_GPIOCTL1_PUSEL4_Msk (0x3ul << RTC_GPIOCTL1_PUSEL4_Pos) /*!< RTC_T::GPIOCTL1: PUSEL4 Mask */ - -#define RTC_GPIOCTL1_OPMODE5_Pos (8) /*!< RTC_T::GPIOCTL1: OPMODE5 Position */ -#define RTC_GPIOCTL1_OPMODE5_Msk (0x3ul << RTC_GPIOCTL1_OPMODE5_Pos) /*!< RTC_T::GPIOCTL1: OPMODE5 Mask */ - -#define RTC_GPIOCTL1_DOUT5_Pos (10) /*!< RTC_T::GPIOCTL1: DOUT5 Position */ -#define RTC_GPIOCTL1_DOUT5_Msk (0x1ul << RTC_GPIOCTL1_DOUT5_Pos) /*!< RTC_T::GPIOCTL1: DOUT5 Mask */ - -#define RTC_GPIOCTL0_DINOFF5_Pos (11) /*!< RTC_T::GPIOCTL1: DINOFF5 Position */ -#define RTC_GPIOCTL0_DINOFF5_Msk (0x1ul << RTC_GPIOCTL0_DINOFF5_Pos) /*!< RTC_T::GPIOCTL1: DINOFF5 Mask */ - -#define RTC_GPIOCTL1_PUSEL5_Pos (12) /*!< RTC_T::GPIOCTL1: PUSEL5 Position */ -#define RTC_GPIOCTL1_PUSEL5_Msk (0x3ul << RTC_GPIOCTL1_PUSEL5_Pos) /*!< RTC_T::GPIOCTL1: PUSEL5 Mask */ - -#define RTC_GPIOCTL1_OPMODE6_Pos (16) /*!< RTC_T::GPIOCTL1: OPMODE6 Position */ -#define RTC_GPIOCTL1_OPMODE6_Msk (0x3ul << RTC_GPIOCTL1_OPMODE6_Pos) /*!< RTC_T::GPIOCTL1: OPMODE6 Mask */ - -#define RTC_GPIOCTL1_DOUT6_Pos (18) /*!< RTC_T::GPIOCTL1: DOUT6 Position */ -#define RTC_GPIOCTL1_DOUT6_Msk (0x1ul << RTC_GPIOCTL1_DOUT6_Pos) /*!< RTC_T::GPIOCTL1: DOUT6 Mask */ - -#define RTC_GPIOCTL0_DINOFF6_Pos (19) /*!< RTC_T::GPIOCTL1: DINOFF6 Position */ -#define RTC_GPIOCTL0_DINOFF6_Msk (0x1ul << RTC_GPIOCTL0_DINOFF6_Pos) /*!< RTC_T::GPIOCTL1: DINOFF6 Mask */ - -#define RTC_GPIOCTL1_PUSEL6_Pos (20) /*!< RTC_T::GPIOCTL1: PUSEL6 Position */ -#define RTC_GPIOCTL1_PUSEL6_Msk (0x3ul << RTC_GPIOCTL1_PUSEL6_Pos) /*!< RTC_T::GPIOCTL1: PUSEL6 Mask */ - -#define RTC_GPIOCTL1_OPMODE7_Pos (24) /*!< RTC_T::GPIOCTL1: OPMODE7 Position */ -#define RTC_GPIOCTL1_OPMODE7_Msk (0x3ul << RTC_GPIOCTL1_OPMODE7_Pos) /*!< RTC_T::GPIOCTL1: OPMODE7 Mask */ - -#define RTC_GPIOCTL1_DOUT7_Pos (26) /*!< RTC_T::GPIOCTL1: DOUT7 Position */ -#define RTC_GPIOCTL1_DOUT7_Msk (0x1ul << RTC_GPIOCTL1_DOUT7_Pos) /*!< RTC_T::GPIOCTL1: DOUT7 Mask */ - -#define RTC_GPIOCTL0_DINOFF7_Pos (27) /*!< RTC_T::GPIOCTL1: DINOFF7 Position */ -#define RTC_GPIOCTL0_DINOFF7_Msk (0x1ul << RTC_GPIOCTL0_DINOFF7_Pos) /*!< RTC_T::GPIOCTL1: DINOFF7 Mask */ - -#define RTC_GPIOCTL1_PUSEL7_Pos (28) /*!< RTC_T::GPIOCTL1: PUSEL7 Position */ -#define RTC_GPIOCTL1_PUSEL7_Msk (0x3ul << RTC_GPIOCTL1_PUSEL7_Pos) /*!< RTC_T::GPIOCTL1: PUSEL7 Mask */ - -#define RTC_DSTCTL_ADDHR_Pos (0) /*!< RTC_T::DSTCTL: ADDHR Position */ -#define RTC_DSTCTL_ADDHR_Msk (0x1ul << RTC_DSTCTL_ADDHR_Pos) /*!< RTC_T::DSTCTL: ADDHR Mask */ - -#define RTC_DSTCTL_SUBHR_Pos (1) /*!< RTC_T::DSTCTL: SUBHR Position */ -#define RTC_DSTCTL_SUBHR_Msk (0x1ul << RTC_DSTCTL_SUBHR_Pos) /*!< RTC_T::DSTCTL: SUBHR Mask */ - -#define RTC_DSTCTL_DSBAK_Pos (2) /*!< RTC_T::DSTCTL: DSBAK Position */ -#define RTC_DSTCTL_DSBAK_Msk (0x1ul << RTC_DSTCTL_DSBAK_Pos) /*!< RTC_T::DSTCTL: DSBAK Mask */ - -#define RTC_TAMPCTL_DYN1ISS_Pos (0) /*!< RTC_T::TAMPCTL: DYN1ISS Position */ -#define RTC_TAMPCTL_DYN1ISS_Msk (0x1ul << RTC_TAMPCTL_DYN1ISS_Pos) /*!< RTC_T::TAMPCTL: DYN1ISS Mask */ - -#define RTC_TAMPCTL_DYN2ISS_Pos (1) /*!< RTC_T::TAMPCTL: DYN2ISS Position */ -#define RTC_TAMPCTL_DYN2ISS_Msk (0x1ul << RTC_TAMPCTL_DYN2ISS_Pos) /*!< RTC_T::TAMPCTL: DYN2ISS Mask */ - -#define RTC_TAMPCTL_DYNSRC_Pos (3) /*!< RTC_T::TAMPCTL: DYNSRC Position */ -#define RTC_TAMPCTL_DYNSRC_Msk (0x1ul << RTC_TAMPCTL_DYNSRC_Pos) /*!< RTC_T::TAMPCTL: DYNSRC Mask */ - -#define RTC_TAMPCTL_SEEDRLD_Pos (4) /*!< RTC_T::TAMPCTL: SEEDRLD Position */ -#define RTC_TAMPCTL_SEEDRLD_Msk (0x1ul << RTC_TAMPCTL_SEEDRLD_Pos) /*!< RTC_T::TAMPCTL: SEEDRLD Mask */ - -#define RTC_TAMPCTL_DYNRATE_Pos (5) /*!< RTC_T::TAMPCTL: DYNRATE Position */ -#define RTC_TAMPCTL_DYNRATE_Msk (0x7ul << RTC_TAMPCTL_DYNRATE_Pos) /*!< RTC_T::TAMPCTL: DYNRATE Mask */ - -#define RTC_TAMPCTL_TAMP0EN_Pos (8) /*!< RTC_T::TAMPCTL: TAMP0EN Position */ -#define RTC_TAMPCTL_TAMP0EN_Msk (0x1ul << RTC_TAMPCTL_TAMP0EN_Pos) /*!< RTC_T::TAMPCTL: TAMP0EN Mask */ - -#define RTC_TAMPCTL_TAMP0LV_Pos (9) /*!< RTC_T::TAMPCTL: TAMP0LV Position */ -#define RTC_TAMPCTL_TAMP0LV_Msk (0x1ul << RTC_TAMPCTL_TAMP0LV_Pos) /*!< RTC_T::TAMPCTL: TAMP0LV Mask */ - -#define RTC_TAMPCTL_TAMP0DBEN_Pos (10) /*!< RTC_T::TAMPCTL: TAMP0DBEN Position */ -#define RTC_TAMPCTL_TAMP0DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP0DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP0DBEN Mask */ - -#define RTC_TAMPCTL_TAMP1EN_Pos (12) /*!< RTC_T::TAMPCTL: TAMP1EN Position */ -#define RTC_TAMPCTL_TAMP1EN_Msk (0x1ul << RTC_TAMPCTL_TAMP1EN_Pos) /*!< RTC_T::TAMPCTL: TAMP1EN Mask */ - -#define RTC_TAMPCTL_TAMP1LV_Pos (13) /*!< RTC_T::TAMPCTL: TAMP1LV Position */ -#define RTC_TAMPCTL_TAMP1LV_Msk (0x1ul << RTC_TAMPCTL_TAMP1LV_Pos) /*!< RTC_T::TAMPCTL: TAMP1LV Mask */ - -#define RTC_TAMPCTL_TAMP1DBEN_Pos (14) /*!< RTC_T::TAMPCTL: TAMP1DBEN Position */ -#define RTC_TAMPCTL_TAMP1DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP1DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP1DBEN Mask */ - -#define RTC_TAMPCTL_DYNPR0EN_Pos (15) /*!< RTC_T::TAMPCTL: DYNPR0EN Position */ -#define RTC_TAMPCTL_DYNPR0EN_Msk (0x1ul << RTC_TAMPCTL_DYNPR0EN_Pos) /*!< RTC_T::TAMPCTL: DYNPR0EN Mask */ - -#define RTC_TAMPCTL_TAMP2EN_Pos (16) /*!< RTC_T::TAMPCTL: TAMP2EN Position */ -#define RTC_TAMPCTL_TAMP2EN_Msk (0x1ul << RTC_TAMPCTL_TAMP2EN_Pos) /*!< RTC_T::TAMPCTL: TAMP2EN Mask */ - -#define RTC_TAMPCTL_TAMP2LV_Pos (17) /*!< RTC_T::TAMPCTL: TAMP2LV Position */ -#define RTC_TAMPCTL_TAMP2LV_Msk (0x1ul << RTC_TAMPCTL_TAMP2LV_Pos) /*!< RTC_T::TAMPCTL: TAMP2LV Mask */ - -#define RTC_TAMPCTL_TAMP2DBEN_Pos (18) /*!< RTC_T::TAMPCTL: TAMP2DBEN Position */ -#define RTC_TAMPCTL_TAMP2DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP2DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP2DBEN Mask */ - -#define RTC_TAMPCTL_TAMP3EN_Pos (20) /*!< RTC_T::TAMPCTL: TAMP3EN Position */ -#define RTC_TAMPCTL_TAMP3EN_Msk (0x1ul << RTC_TAMPCTL_TAMP3EN_Pos) /*!< RTC_T::TAMPCTL: TAMP3EN Mask */ - -#define RTC_TAMPCTL_TAMP3LV_Pos (21) /*!< RTC_T::TAMPCTL: TAMP3LV Position */ -#define RTC_TAMPCTL_TAMP3LV_Msk (0x1ul << RTC_TAMPCTL_TAMP3LV_Pos) /*!< RTC_T::TAMPCTL: TAMP3LV Mask */ - -#define RTC_TAMPCTL_TAMP3DBEN_Pos (22) /*!< RTC_T::TAMPCTL: TAMP3DBEN Position */ -#define RTC_TAMPCTL_TAMP3DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP3DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP3DBEN Mask */ - -#define RTC_TAMPCTL_DYNPR1EN_Pos (23) /*!< RTC_T::TAMPCTL: DYNPR1EN Position */ -#define RTC_TAMPCTL_DYNPR1EN_Msk (0x1ul << RTC_TAMPCTL_DYNPR1EN_Pos) /*!< RTC_T::TAMPCTL: DYNPR1EN Mask */ - -#define RTC_TAMPCTL_TAMP4EN_Pos (24) /*!< RTC_T::TAMPCTL: TAMP4EN Position */ -#define RTC_TAMPCTL_TAMP4EN_Msk (0x1ul << RTC_TAMPCTL_TAMP4EN_Pos) /*!< RTC_T::TAMPCTL: TAMP4EN Mask */ - -#define RTC_TAMPCTL_TAMP4LV_Pos (25) /*!< RTC_T::TAMPCTL: TAMP4LV Position */ -#define RTC_TAMPCTL_TAMP4LV_Msk (0x1ul << RTC_TAMPCTL_TAMP4LV_Pos) /*!< RTC_T::TAMPCTL: TAMP4LV Mask */ - -#define RTC_TAMPCTL_TAMP4DBEN_Pos (26) /*!< RTC_T::TAMPCTL: TAMP4DBEN Position */ -#define RTC_TAMPCTL_TAMP4DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP4DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP4DBEN Mask */ - -#define RTC_TAMPCTL_TAMP5EN_Pos (28) /*!< RTC_T::TAMPCTL: TAMP5EN Position */ -#define RTC_TAMPCTL_TAMP5EN_Msk (0x1ul << RTC_TAMPCTL_TAMP5EN_Pos) /*!< RTC_T::TAMPCTL: TAMP5EN Mask */ - -#define RTC_TAMPCTL_TAMP5LV_Pos (29) /*!< RTC_T::TAMPCTL: TAMP5LV Position */ -#define RTC_TAMPCTL_TAMP5LV_Msk (0x1ul << RTC_TAMPCTL_TAMP5LV_Pos) /*!< RTC_T::TAMPCTL: TAMP5LV Mask */ - -#define RTC_TAMPCTL_TAMP5DBEN_Pos (30) /*!< RTC_T::TAMPCTL: TAMP5DBEN Position */ -#define RTC_TAMPCTL_TAMP5DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP5DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP5DBEN Mask */ - -#define RTC_TAMPCTL_DYNPR2EN_Pos (31) /*!< RTC_T::TAMPCTL: DYNPR2EN Position */ -#define RTC_TAMPCTL_DYNPR2EN_Msk (0x1ul << RTC_TAMPCTL_DYNPR2EN_Pos) /*!< RTC_T::TAMPCTL: DYNPR2EN Mask */ - -#define RTC_TAMPSEED_SEED_Pos (0) /*!< RTC_T::TAMPSEED: SEED Position */ -#define RTC_TAMPSEED_SEED_Msk (0xfffffffful << RTC_TAMPSEED_SEED_Pos) /*!< RTC_T::TAMPSEED: SEED Mask */ - -#define RTC_TAMPTIME_SEC_Pos (0) /*!< RTC_T::TAMPTIME: SEC Position */ -#define RTC_TAMPTIME_SEC_Msk (0xful << RTC_TAMPTIME_SEC_Pos) /*!< RTC_T::TAMPTIME: SEC Mask */ - -#define RTC_TAMPTIME_TENSEC_Pos (4) /*!< RTC_T::TAMPTIME: TENSEC Position */ -#define RTC_TAMPTIME_TENSEC_Msk (0x7ul << RTC_TAMPTIME_TENSEC_Pos) /*!< RTC_T::TAMPTIME: TENSEC Mask */ - -#define RTC_TAMPTIME_MIN_Pos (8) /*!< RTC_T::TAMPTIME: MIN Position */ -#define RTC_TAMPTIME_MIN_Msk (0xful << RTC_TAMPTIME_MIN_Pos) /*!< RTC_T::TAMPTIME: MIN Mask */ - -#define RTC_TAMPTIME_TENMIN_Pos (12) /*!< RTC_T::TAMPTIME: TENMIN Position */ -#define RTC_TAMPTIME_TENMIN_Msk (0x7ul << RTC_TAMPTIME_TENMIN_Pos) /*!< RTC_T::TAMPTIME: TENMIN Mask */ - -#define RTC_TAMPTIME_HR_Pos (16) /*!< RTC_T::TAMPTIME: HR Position */ -#define RTC_TAMPTIME_HR_Msk (0xful << RTC_TAMPTIME_HR_Pos) /*!< RTC_T::TAMPTIME: HR Mask */ - -#define RTC_TAMPTIME_TENHR_Pos (20) /*!< RTC_T::TAMPTIME: TENHR Position */ -#define RTC_TAMPTIME_TENHR_Msk (0x3ul << RTC_TAMPTIME_TENHR_Pos) /*!< RTC_T::TAMPTIME: TENHR Mask */ - -#define RTC_TAMPCAL_DAY_Pos (0) /*!< RTC_T::TAMPCAL: DAY Position */ -#define RTC_TAMPCAL_DAY_Msk (0xful << RTC_TAMPCAL_DAY_Pos) /*!< RTC_T::TAMPCAL: DAY Mask */ - -#define RTC_TAMPCAL_TENDAY_Pos (4) /*!< RTC_T::TAMPCAL: TENDAY Position */ -#define RTC_TAMPCAL_TENDAY_Msk (0x3ul << RTC_TAMPCAL_TENDAY_Pos) /*!< RTC_T::TAMPCAL: TENDAY Mask */ - -#define RTC_TAMPCAL_MON_Pos (8) /*!< RTC_T::TAMPCAL: MON Position */ -#define RTC_TAMPCAL_MON_Msk (0xful << RTC_TAMPCAL_MON_Pos) /*!< RTC_T::TAMPCAL: MON Mask */ - -#define RTC_TAMPCAL_TENMON_Pos (12) /*!< RTC_T::TAMPCAL: TENMON Position */ -#define RTC_TAMPCAL_TENMON_Msk (0x1ul << RTC_TAMPCAL_TENMON_Pos) /*!< RTC_T::TAMPCAL: TENMON Mask */ - -#define RTC_TAMPCAL_YEAR_Pos (16) /*!< RTC_T::TAMPCAL: YEAR Position */ -#define RTC_TAMPCAL_YEAR_Msk (0xful << RTC_TAMPCAL_YEAR_Pos) /*!< RTC_T::TAMPCAL: YEAR Mask */ - -#define RTC_TAMPCAL_TENYEAR_Pos (20) /*!< RTC_T::TAMPCAL: TENYEAR Position */ -#define RTC_TAMPCAL_TENYEAR_Msk (0xful << RTC_TAMPCAL_TENYEAR_Pos) /*!< RTC_T::TAMPCAL: TENYEAR Mask */ - -#define RTC_CLKDCTL_LXTFDEN_Pos (0) /*!< RTC_T::CLKDCTL: LXTFDEN Position */ -#define RTC_CLKDCTL_LXTFDEN_Msk (0x1ul << RTC_CLKDCTL_LXTFDEN_Pos) /*!< RTC_T::CLKDCTL: LXTFDEN Mask */ - -#define RTC_CLKDCTL_LXTFSW_Pos (1) /*!< RTC_T::CLKDCTL: LXTFSW Position */ -#define RTC_CLKDCTL_LXTFSW_Msk (0x1ul << RTC_CLKDCTL_LXTFSW_Pos) /*!< RTC_T::CLKDCTL: LXTFSW Mask */ - -#define RTC_CLKDCTL_LXTSTSW_Pos (2) /*!< RTC_T::CLKDCTL: LXTSTSW Position */ -#define RTC_CLKDCTL_LXTSTSW_Msk (0x1ul << RTC_CLKDCTL_LXTSTSW_Pos) /*!< RTC_T::CLKDCTL: LXTSTSW Mask */ - -#define RTC_CLKDCTL_SWLIRCF_Pos (16) /*!< RTC_T::CLKDCTL: SWLIRCF Position */ -#define RTC_CLKDCTL_SWLIRCF_Msk (0x1ul << RTC_CLKDCTL_SWLIRCF_Pos) /*!< RTC_T::CLKDCTL: SWLIRCF Mask */ - -#define RTC_CLKDCTL_LXTSLOWF_Pos (17) /*!< RTC_T::CLKDCTL: LXTSLOWF Position */ -#define RTC_CLKDCTL_LXTSLOWF_Msk (0x1ul << RTC_CLKDCTL_LXTSLOWF_Pos) /*!< RTC_T::CLKDCTL: LXTSLOWF Mask */ - -#define RTC_CDBR_STOPBD_Pos (0) /*!< RTC_T::CDBR: STOPBD Position */ -#define RTC_CDBR_STOPBD_Msk (0xfful << RTC_CDBR_STOPBD_Pos) /*!< RTC_T::CDBR: STOPBD Mask */ - -#define RTC_CDBR_FAILBD_Pos (16) /*!< RTC_T::CDBR: FAILBD Position */ -#define RTC_CDBR_FAILBD_Msk (0xfful << RTC_CDBR_FAILBD_Pos) /*!< RTC_T::CDBR: FAILBD Mask */ - -/**@}*/ /* RTC_CONST */ -/**@}*/ /* end of RTC register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __RTC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sc_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sc_reg.h deleted file mode 100644 index 4b69e96fd32..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sc_reg.h +++ /dev/null @@ -1,980 +0,0 @@ -/**************************************************************************//** - * @file sc_reg.h - * @version V1.00 - * @brief SC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SC_REG_H__ -#define __SC_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Smart Card Host Interface Controller -------------------------*/ -/** - @addtogroup SC Smart Card Host Interface Controller(SC) - Memory Mapped Structure for SC Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var SC_T::DAT - * Offset: 0x00 SC Receive/Transmit Holding Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Receive/Transmit Holding Buffer - * | | |Write Operation: - * | | |By writing data to DAT, the SC will send out an 8-bit data. - * | | |Note: If SCEN (SCn_CTL[0]) is not enabled, DAT cannot be programmed. - * | | |Read Operation: - * | | |By reading DAT, the SC will return an 8-bit received data. - * @var SC_T::CTL - * Offset: 0x04 SC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SCEN |SC Controller Enable Bit - * | | |Set this bit to 1 to enable SC operation. - * | | |0 = SC will force all transition to IDLE state. - * | | |1 = SC controller is enabled and all function can work correctly. - * | | |Note1: SCEN must be set to 1 before filling in other SC registers, or smart card will not work properly. - * |[1] |RXOFF |RX Transition Disable Control Bit - * | | |This bit is used for disable Rx transition function. - * | | |0 = The receiver Enabled. - * | | |1 = The receiver Disabled. - * | | |Note1: If AUTOCEN (SCn_CTL[3]) is enabled, this field is ignored. - * |[2] |TXOFF |TX Transition Disable Control Bit - * | | |This bit is used for disable Tx transition function. - * | | |0 = The transceiver Enabled. - * | | |1 = The transceiver Disabled. - * |[3] |AUTOCEN |Auto Convention Enable Bit - * | | |This bit is used for enable auto convention function. - * | | |0 = Auto-convention Disabled. - * | | |1 = Auto-convention Enabled. - * | | |If user enables auto convention function, the setting step must be done before Answer to Reset (ATR) state and the first data must be 0x3B or 0x3F - * | | |After hardware received first data and stored it at buffer, hardware will decided the convention and change the CONSEL (SCn_CTL[5:4]) bits automatically when received first data is 0x3B or 0x3F - * | | |If received first byte is 0x3B, TS is direct convention, CONSEL (SCn_CTL[5:4]) will be set to 00 automatically, otherwise the TS is inverse convention, and CONSEL (SCn_CTL[5:4]) will be set to 11. - * | | |If the first data is not 0x3B or 0x3F, hardware will set ACERRIF (SCn_INTSTS[10]) and generate an interrupt to CPU when ACERRIEN (SCn_INTEN[10]) is enabled. - * |[5:4] |CONSEL |Convention Selection - * | | |00 = Direct convention. - * | | |01 = Reserved. - * | | |10 = Reserved. - * | | |11 = Inverse convention. - * | | |Note: If AUTOCEN (SCn_CTL[3]) is enabled, this field is ignored. - * |[7:6] |RXTRGLV |Rx Buffer Trigger Level - * | | |When the number of bytes in the receiving buffer equals the RXTRGLV, the RDAIF will be set - * | | |If RDAIEN (SCn_INTEN[0]) is enabled, an interrupt will be generated to CPU. - * | | |00 = Rx Buffer Trigger Level with 01 bytes. - * | | |01 = Rx Buffer Trigger Level with 02 bytes. - * | | |10 = Rx Buffer Trigger Level with 03 bytes. - * | | |11 = Reserved. - * |[12:8] |BGT |Block Guard Time (BGT) - * | | |Block guard time means the minimum interval between the leading edges of two consecutive characters between different transfer directions - * | | |This field indicates the counter for the bit length of block guard time - * | | |According to ISO 7816-3, in T = 0 mode, user must fill 15 (real block guard time = 16.5) to this field; in T = 1 mode, user must fill 21 (real block guard time = 22.5) to it. - * | | |Note: The real block guard time is BGT + 1. - * |[14:13] |TMRSEL |Timer Channel Selection - * | | |00 = All internal timer function Disabled. - * | | |. - * | | |11 = Internal 24 bit timer and two 8 bit timers Enabled - * | | |User can configure them by setting SCn_TMRCTL0[23:0], SCn_TMRCTL1[7:0] and SCn_TMRCTL2[7:0]. - * | | |Other configurations are reserve - * |[15] |NSB |Stop Bit Length - * | | |This field indicates the length of stop bit. - * | | |0 = The stop bit length is 2 ETU.(for ISO 7816-3 T=0 mode). - * | | |1= The stop bit length is 1 ETU.(for ISO 7816-3 T=1 mode). - * | | |Note1: The default stop bit length is 2. SC and UART adopts NSB to program the stop bit length. - * | | |Note2: In UART mode, RX can receive the data sequence in 1 stop bit or 2 stop bits with NSB is set to 0. - * |[18:16] |RXRTY |RX Error Retry Count Number - * | | |This field indicates the maximum number of receiver retries that are allowed when parity error has occurred - * | | |Note1: The real retry number is RXRTY + 1, so 8 is the maximum retry number. - * | | |Note2: This field cannot be changed when RXRTYEN enabled - * | | |The change flow is to disable RXRTYEN first and then fill in new retry value. - * |[19] |RXRTYEN |RX Error Retry Enable Bit - * | | |This bit enables receiver retry function when parity error has occurred. - * | | |0 = RX error retry function Disabled. - * | | |1 = RX error retry function Enabled. - * | | |Note: User must fill in the RXRTY value before enabling this bit. - * |[22:20] |TXRTY |TX Error Retry Count Number - * | | |This field indicates the maximum number of transmitter retries that are allowed when parity error has occurred. - * | | |Note1: The real retry number is TXRTY + 1, so 8 is the maximum retry number. - * | | |Note2: This field cannot be changed when TXRTYEN enabled - * | | |The change flow is to disable TXRTYEN first and then fill in new retry value. - * |[23] |TXRTYEN |TX Error Retry Enable Bit - * | | |This bit enables transmitter retry function when parity error has occurred. - * | | |0 = TX error retry function Disabled. - * | | |1 = TX error retry function Enabled. - * |[25:24] |CDDBSEL |Card Detect De-bounce Selection - * | | |This field indicates the card detect de-bounce selection. - * | | |00 = De-bounce sample card insert once per 384 (128 * 3) SC module clocks and de-bounce sample card removal once per 128 SC module clocks. - * | | |Other configurations are reserved. - * |[26] |CDLV |Card Detect Level Selection - * | | |0 = When hardware detects the card detect pin (SCn_CD) from high to low, it indicates a card is detected. - * | | |1 = When hardware detects the card detect pin (SCn_CD) from low to high, it indicates a card is detected. - * | | |Note: User must select card detect level before Smart Card controller enabled. - * |[30] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit before writing a new value to RXRTY and TXRTY fields. - * | | |0 = Synchronizing is completion, user can write new data to RXRTY and TXRTY. - * | | |1 = Last value is synchronizing. - * @var SC_T::ALTCTL - * Offset: 0x08 SC Alternate Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXRST |TX Software Reset - * | | |When TXRST is set, all the bytes in the transmit buffer and TX internal state machine will be cleared. - * | | |0 = No effect. - * | | |1 = Reset the TX internal state machine and pointers. - * | | |Note: This bit will be auto cleared after reset is complete. - * |[1] |RXRST |Rx Software Reset - * | | |When RXRST is set, all the bytes in the receive buffer and Rx internal state machine will be cleared. - * | | |0 = No effect. - * | | |1 = Reset the Rx internal state machine and pointers. - * | | |Note: This bit will be auto cleared after reset is complete. - * |[2] |DACTEN |Deactivation Sequence Generator Enable Bit - * | | |This bit enables SC controller to initiate the card by deactivation sequence. - * | | |0 = No effect. - * | | |1 = Deactivation sequence generator Enabled. - * | | |Note1: When the deactivation sequence completed, this bit will be cleared automatically and the INITIF (SCn_INTSTS[8]) will be set to 1. - * | | |Note2: This field will be cleared by TXRST (SCn_ALTCTL[0]) and RXRST (SCn_ALTCTL[1]) - * | | |Thus, do not fill in this bit DACTEN, TXRST and RXRST at the same time. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * |[3] |ACTEN |Activation Sequence Generator Enable Bit - * | | |This bit enables SC controller to initiate the card by activation sequence. - * | | |0 = No effect. - * | | |1 = Activation sequence generator Enabled. - * | | |Note1: When the activation sequence completed, this bit will be cleared automatically and the INITIF (SCn_INTSTS[8]) will be set to 1. - * | | |Note2: This field will be cleared by TXRST (SCn_ALTCTL[0]) and RXRST (SCn_ALTCTL[1]) - * | | |Thus, do not fill in this bit ACTEN, TXRST and RXRST at the same time. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * | | |Note4: During the activation sequence, RX is disabled automatically and can not receive data - * | | |After the activation sequence completion, RXOFF (SCn_CTL[1]) keeps the state before hardware activation. - * |[4] |WARSTEN |Warm Reset Sequence Generator Enable Bit - * | | |This bit enables SC controller to initiate the card by warm reset sequence. - * | | |0 = No effect. - * | | |1 = Warm reset sequence generator Enabled. - * | | |Note1: When the warm reset sequence completed, this bit will be cleared automatically and the INITIF (SCn_INTSTS[8]) will be set to 1. - * | | |Note2: This field will be cleared by TXRST (SCn_ALTCTL[0]) and RXRST (SCn_ALTCTL[1]) - * | | |Thus, do not fill in this bit WARSTEN, TXRST and RXRST at the same time. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * | | |Note4: During the warm reset sequence, RX is disabled automatically and can not receive data - * | | |After the warm reset sequence completion, RXOFF (SCn_CTL[1]) keeps the state before perform warm reset sequence. - * |[5] |CNTEN0 |Internal Timer0 Start Enable Bit - * | | |This bit enables Timer 0 to start counting - * | | |User can fill 0 to stop it and set 1 to reload and count - * | | |The counter unit is ETU base. - * | | |0 = Stops counting. - * | | |1 = Start counting. - * | | |Note1: This field is used for internal 24 bit timer when TMRSEL (SCn_CTL[14:13]) is 11 only. - * | | |Note2: If the operation mode is not in auto-reload mode (SCn_TMRCTL0[26] = 0), this bit will be auto-cleared by hardware. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed - * |[6] |CNTEN1 |Internal Timer1 Start Enable Bit - * | | |This bit enables Timer 1 to start counting - * | | |User can fill 0 to stop it and set 1 to reload and count - * | | |The counter unit is ETU base. - * | | |0 = Stops counting. - * | | |1 = Start counting. - * | | |Note1: This field is used for internal 8 bit timer when TMRSEL(SCn_CTL[14:13]) is 11 only - * | | |Do not fill CNTEN1 when TMRSEL (SCn_CTL[14:13]) is not equal to 11. - * | | |Note2: If the operation mode is not in auto-reload mode (SCn_TMRCTL1[26] = 0), this bit will be auto-cleared by hardware. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * |[7] |CNTEN2 |Internal Timer2 Start Enable Bit - * | | |This bit enables Timer 2 to start counting - * | | |User can fill 0 to stop it and set 1 to reload and count - * | | |The counter unit is ETU base. - * | | |0 = Stops counting. - * | | |1 = Start counting. - * | | |Note1: This field is used for internal 8 bit timer when TMRSEL (SCn_CTL[14:13]) is 11 only - * | | |Do not fill in CNTEN2 when TMRSEL (SCn_CTL[14:13]) is not equal to 11. - * | | |Note2: If the operation mode is not in auto-reload mode (SCn_TMRCTL2[26] = 0), this bit will be auto-cleared by hardware. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * |[9:8] |INITSEL |Initial Timing Selection - * | | |This fields indicates the initial timing of hardware activation, warm-reset or deactivation. - * | | |The unit of initial timing is SC module clock. - * | | |Activation: refer to SC Activation Sequence in Figure 6.17-4 SC Activation Sequence. - * | | |Warm-reset: refer to Warm-Reset Sequence in Figure 6.17-5 SC Warm Reset Sequence. - * | | |Deactivation: refer to Deactivation Sequence in Figure 6.17-6 SC Deactivation Sequence. - * | | |Note: When set activation and warm reset in Timer0 operation mode 0011, it may have deviation at most 128 SC module clock cycles. - * |[11] |ADACEN |Auto Deactivation When Card Removal - * | | |This bit is used for enable hardware auto deactivation when smart card is removed. - * | | |0 = Auto deactivation Disabled. - * | | |1 = Auto deactivation Enabled. - * | | |Note: When the card is removed, hardware will stop any process and then do deactivation sequence if this bit is set - * | | |If auto deactivation process completes, hardware will set INITIF (SCn_INTSTS[8]) also. - * |[12] |RXBGTEN |Receiver Block Guard Time Function Enable Bit - * | | |This bit enables the receiver block guard time function. - * | | |0 = Receiver block guard time function Disabled. - * | | |1 = Receiver block guard time function Enabled. - * |[13] |ACTSTS0 |Internal Timer0 Active Status (Read Only) - * | | |This bit indicates the timer counter status of timer0. - * | | |0 = Timer0 is not active. - * | | |1 = Timer0 is active. - * | | |Note: Timer0 is active does not always mean timer0 is counting the CNT (SCn_TMRCTL0[23:0]). - * |[14] |ACTSTS1 |Internal Timer1 Active Status (Read Only) - * | | |This bit indicates the timer counter status of timer1. - * | | |0 = Timer1 is not active. - * | | |1 = Timer1 is active. - * | | |Note: Timer1 is active does not always mean timer1 is counting the CNT (SCn_TMRCTL1[7:0]). - * |[15] |ACTSTS2 |Internal Timer2 Active Status (Read Only) - * | | |This bit indicates the timer counter status of timer2. - * | | |0 = Timer2 is not active. - * | | |1 = Timer2 is active. - * | | |Note: Timer2 is active does not always mean timer2 is counting the CNT (SCn_TMRCTL2[7:0]). - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to SCn_ALTCTL register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_ALTCTL register. - * | | |1 = Last value is synchronizing. - * @var SC_T::EGT - * Offset: 0x0C SC Extra Guard Time Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |EGT |Extra Guard Time - * | | |This field indicates the extra guard time value. - * | | |Note: The extra guard time unit is ETU base. - * @var SC_T::RXTOUT - * Offset: 0x10 SC Receive Buffer Time-out Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |RFTM |SC Receiver FIFO Time-out Counter - * | | |The time-out down counter resets and starts counting whenever the RX buffer received a new data - * | | |Once the counter decrease to 1 and no new data is received or CPU does not read data by reading SCn_DAT, a receiver time-out flag RXTOIF (SCn_INTSTS[9]) will be set, and hardware will generate an interrupt to CPU when RXTOIEN (SCn_INTEN[9]) is enabled. - * | | |Note1: The counter unit is ETU based and the interval of time-out is RFTM + 0.5. - * | | |Note2: Filling in all 0 to this field indicates to disable this function. - * @var SC_T::ETUCTL - * Offset: 0x14 SC Element Time Unit Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ETURDIV |ETU Rate Divider - * | | |The field is used for ETU clock rate divider. - * | | |The real ETU is ETURDIV + 1. - * | | |Note: User can configure this field, but this field must be greater than 0x04. - * @var SC_T::INTEN - * Offset: 0x18 SC Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIEN |Receive Data Reach Interrupt Enable Bit - * | | |This field is used to enable received data reaching trigger level RXTRGLV (SCn_CTL[7:6]) interrupt. - * | | |0 = Receive data reach trigger level interrupt Disabled. - * | | |1 = Receive data reach trigger level interrupt Enabled. - * |[1] |TBEIEN |Transmit Buffer Empty Interrupt Enable Bit - * | | |This field is used to enable transmit buffer empty interrupt. - * | | |0 = Transmit buffer empty interrupt Disabled. - * | | |1 = Transmit buffer empty interrupt Enabled. - * |[2] |TERRIEN |Transfer Error Interrupt Enable Bit - * | | |This field is used to enable transfer error interrupt - * | | |The transfer error states is at SCn_STATUS register which includes receiver break error BEF (SCn_STATUS[6]), frame error FEF (SCn_STATUS[5]), parity error PEF (SCn_STATUS[4]), receive buffer overflow error RXOV (SCn_STATUS[0]), transmit buffer overflow error TXOV (SCn_STATUS[8]), receiver retry over limit error RXOVERR (SCn_STATUS[22]) and transmitter retry over limit error TXOVERR (SCn_STATUS[30]). - * | | |0 = Transfer error interrupt Disabled. - * | | |1 = Transfer error interrupt Enabled. - * |[3] |TMR0IEN |Timer0 Interrupt Enable Bit - * | | |This field is used to enable Timer0 interrupt function. - * | | |0 = Timer0 interrupt Disabled. - * | | |1 = Timer0 interrupt Enabled. - * |[4] |TMR1IEN |Timer1 Interrupt Enable Bit - * | | |This field is used to enable the Timer1 interrupt function. - * | | |0 = Timer1 interrupt Disabled. - * | | |1 = Timer1 interrupt Enabled. - * |[5] |TMR2IEN |Timer2 Interrupt Enable Bit - * | | |This field is used to enable Timer2 interrupt function. - * | | |0 = Timer2 interrupt Disabled. - * | | |1 = Timer2 interrupt Enabled. - * |[6] |BGTIEN |Block Guard Time Interrupt Enable Bit - * | | |This field is used to enable block guard time interrupt in receive direction. - * | | |0 = Block guard time interrupt Disabled. - * | | |1 = Block guard time interrupt Enabled. - * | | |Note: This bit is valid only for receive receive direction block guard time. - * |[7] |CDIEN |Card Detect Interrupt Enable Bit - * | | |This field is used to enable card detect interrupt - * | | |The card detect status is CDPINSTS (SCn_STATUS[13]). - * | | |0 = Card detect interrupt Disabled. - * | | |1 = Card detect interrupt Enabled. - * |[8] |INITIEN |Initial End Interrupt Enable Bit - * | | |This field is used to enable activation (ACTEN (SCn_ALTCTL[3] = 1)), deactivation (DACTEN (SCn_ALTCTL[2] = 1)) and warm reset (WARSTEN (SCn_ALTCTL [4])) sequence complete interrupt. - * | | |0 = Initial end interrupt Disabled. - * | | |1 = Initial end interrupt Enabled. - * |[9] |RXTOIEN |Receiver Buffer Time-out Interrupt Enable Bit - * | | |This field is used to enable receiver buffer time-out interrupt. - * | | |0 = Receiver buffer time-out interrupt Disabled. - * | | |1 = Receiver buffer time-out interrupt Enabled. - * |[10] |ACERRIEN |Auto Convention Error Interrupt Enable Bit - * | | |This field is used to enable auto-convention error interrupt. - * | | |0 = Auto-convention error interrupt Disabled. - * | | |1 = Auto-convention error interrupt Enabled. - * @var SC_T::INTSTS - * Offset: 0x1C SC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIF |Receive Data Reach Interrupt Status Flag (Read Only) - * | | |This field is used for received data reaching trigger level RXTRGLV (SCn_CTL[7:6]) interrupt status flag. - * | | |0 = Number of receive buffer is less than RXTRGLV setting. - * | | |1 = Number of receive buffer data equals the RXTRGLV setting. - * | | |Note: This bit is read only - * | | |If user reads data from SCn_DAT and receiver buffer data byte number is less than RXTRGLV, this bit will be cleared automatically. - * |[1] |TBEIF |Transmit Buffer Empty Interrupt Status Flag (Read Only) - * | | |This field is used for transmit buffer empty interrupt status flag. - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty. - * | | |Note: This bit is read only - * | | |If user wants to clear this bit, user must write data to DAT (SCn_DAT[7:0]) and then this bit will be cleared automatically. - * |[2] |TERRIF |Transfer Error Interrupt Status Flag - * | | |This field is used for transfer error interrupt status flag - * | | |The transfer error states is at SCn_STATUS register which includes receiver break error BEF (SCn_STATUS[6]), frame error FEF (SCn_STATUS[5], parity error PEF (SCn_STATUS[4] and receive buffer overflow error RXOV (SCn_STATUS[0]), transmit buffer overflow error TXOV (SCn_STATUS[8]), receiver retry over limit error RXOVERR (SCn_STATUS[22] or transmitter retry over limit error TXOVERR (SCn_STATUS[30]). - * | | |0 = Transfer error interrupt did not occur. - * | | |1 = Transfer error interrupt occurred. - * | | |Note1: This field is the status flag of BEF, FEF, PEF, RXOV, TXOV, RXOVERR or TXOVERR. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[3] |TMR0IF |Timer0 Interrupt Status Flag - * | | |This field is used for Timer0 interrupt status flag. - * | | |0 = Timer0 interrupt did not occur. - * | | |1 = Timer0 interrupt occurred. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[4] |TMR1IF |Timer1 Interrupt Status Flag - * | | |This field is used for Timer1 interrupt status flag. - * | | |0 = Timer1 interrupt did not occur. - * | | |1 = Timer1 interrupt occurred. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[5] |TMR2IF |Timer2 Interrupt Status Flag - * | | |This field is used for Timer2 interrupt status flag. - * | | |0 = Timer2 interrupt did not occur. - * | | |1 = Timer2 interrupt occurred. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[6] |BGTIF |Block Guard Time Interrupt Status Flag - * | | |This field is used for indicate block guard time interrupt status flag in receive direction. - * | | |0 = Block guard time interrupt did not occur. - * | | |1 = Block guard time interrupt occurred. - * | | |Note1: This bit is valid only when RXBGTEN (SCn_ALTCTL[12]) is enabled. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[7] |CDIF |Card Detect Interrupt Status Flag (Read Only) - * | | |This field is used for card detect interrupt status flag - * | | |The card detect status is CINSERT (SCn_STATUS[12]) and CREMOVE (SCn_STATUS[11]). - * | | |0 = Card detect event did not occur. - * | | |1 = Card detect event occurred. - * | | |Note: This bit is read only, user must to clear CINSERT or CREMOVE status to clear it. - * |[8] |INITIF |Initial End Interrupt Status Flag - * | | |This field is used for activation (ACTEN (SCn_ALTCTL[3])), deactivation (DACTEN (SCn_ALTCTL[2])) and warm reset (WARSTEN (SCn_ALTCTL[4])) sequence interrupt status flag. - * | | |0 = Initial sequence is not complete. - * | | |1 = Initial sequence is completed. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[9] |RXTOIF |Receive Buffer Time-out Interrupt Status Flag (Read Only) - * | | |This field is used for indicate receive buffer time-out interrupt status flag. - * | | |0 = Receive buffer time-out interrupt did not occur. - * | | |1 = Receive buffer time-out interrupt occurred. - * | | |Note: This bit is read only, user must read all receive buffer remaining data by reading SCn_DAT register to clear it. - * |[10] |ACERRIF |Auto Convention Error Interrupt Status Flag - * | | |This field indicates auto convention sequence error. - * | | |0 = Received TS at ATR state is 0x3B or 0x3F. - * | | |1 = Received TS at ATR state is neither 0x3B nor 0x3F. - * | | |Note: This bit can be cleared by writing 1 to it. - * @var SC_T::STATUS - * Offset: 0x20 SC Transfer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXOV |Receive Overflow Error Status Flag - * | | |This bit is set when Rx buffer overflow. - * | | |0 = Rx buffer is not overflow. - * | | |1 = Rx buffer is overflow when the number of received bytes is greater than Rx buffer size (4 bytes). - * | | |Note: This bit can be cleared by writing 1 to it. - * |[1] |RXEMPTY |Receive Buffer Empty Status Flag (Read Only) - * | | |This bit indicates Rx buffer empty or not. - * | | |0 = Rx buffer is not empty. - * | | |1 = Rx buffer is empty, it means the last byte of Rx buffer has read from DAT (SCn_DAT[7:0]) by CPU. - * |[2] |RXFULL |Receive Buffer Full Status Flag (Read Only) - * | | |This bit indicates Rx buffer full or not. - * | | |0 = Rx buffer count is less than 4. - * | | |1 = Rx buffer count equals to 4. - * |[4] |PEF |Receiver Parity Error Status Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid parity bit. - * | | |0 = Receiver parity error flag did not occur. - * | | |1 = Receiver parity error flag occurred. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU sets receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not set this flag. - * |[5] |FEF |Receiver Frame Error Status Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid stop bit (that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = Receiver frame error flag did not occur. - * | | |1 = Receiver frame error flag occurred. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU sets receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not set this flag. - * |[6] |BEF |Receiver Break Error Status Flag - * | | |This bit is set to logic 1 whenever the received data input (Rx) held in the spacing state (logic 0) is longer than a full word transmission time (that is, the total time of start bit + data bits + parity bit + stop bits). - * | | |0 = Receiver break error flag did not occur. - * | | |1 = Receiver break error flag occurred. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU sets receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not set this flag. - * |[8] |TXOV |Transmit Overflow Error Interrupt Status Flag - * | | |This bit is set when Tx buffer overflow. - * | | |0 = Tx buffer is not overflow. - * | | |1 = Tx buffer is overflow when Tx buffer is full and an additional write operation to DAT (SCn_DAT[7:0]). - * | | |Note: This bit can be cleared by writing 1 to it. - * |[9] |TXEMPTY |Transmit Buffer Empty Status Flag (Read Only) - * | | |This bit indicates TX buffer empty or not. - * | | |0 = Tx buffer is not empty. - * | | |1 = Tx buffer is empty, it means the last byte of Tx buffer has been transferred to Transmitter Shift Register. - * | | |Note: This bit will be cleared when writing data into DAT (SCn_DAT[7:0]). - * |[10] |TXFULL |Transmit Buffer Full Status Flag (Read Only) - * | | |This bit indicates Tx buffer full or not. - * | | |0 = Tx buffer count is less than 4. - * | | |1 = Tx buffer count equals to 4. - * |[11] |CREMOVE |Card Removal Status of SCn_CD Pin - * | | |This bit is set whenever card has been removal. - * | | |0 = No effect. - * | | |1 = Card removed. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: Card detect function will start after SCEN (SCn_CTL[0]) set. - * |[12] |CINSERT |Card Insert Status of SCn_CD Pin - * | | |This bit is set whenever card has been inserted. - * | | |0 = No effect. - * | | |1 = Card insert. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: The card detect function will start after SCEN (SCn_CTL[0]) set. - * |[13] |CDPINSTS |Card Detect Pin Status (Read Only) - * | | |This bit is the pin status of SCn_CD. - * | | |0 = The SCn_CD pin state at low. - * | | |1 = The SCn_CD pin state at high. - * |[18:16] |RXPOINT |Receive Buffer Pointer Status (Read Only) - * | | |This field indicates the Rx buffer pointer status - * | | |When SC controller receives one byte from external device, RXPOINT increases one - * | | |When one byte of Rx buffer is read by CPU, RXPOINT decreases one. - * |[21] |RXRERR |Receiver Retry Error - * | | |This bit is used for receiver error retry and set by hardware. - * | | |0 = No Rx retry transfer. - * | | |1 = Rx has any error and retries transfer. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2 This bit is a flag and cannot generate any interrupt to CPU. - * | | |Note3: If CPU enables receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not set this flag. - * |[22] |RXOVERR |Receiver over Retry Error - * | | |This bit is used for receiver retry counts over than retry number limitation. - * | | |0 = Receiver retries counts is not over than RXRTY (SCn_CTL[18:16]) + 1. - * | | |1 = Receiver retries counts over than RXRTY (SCn_CTL[18:16]) + 1. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU enables receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not set this flag. - * |[23] |RXACT |Receiver in Active Status Flag (Read Only) - * | | |This bit indicates Rx transfer status. - * | | |0 = This bit is cleared automatically when Rx transfer is finished. - * | | |1 = This bit is set by hardware when Rx transfer is in active. - * | | |Note: This bit is read only. - * | | |Note2: - * |[26:24] |TXPOINT |Transmit Buffer Pointer Status (Read Only) - * | | |This field indicates the Tx buffer pointer status - * | | |When CPU writes data into SCn_DAT, TXPOINT increases one - * | | |When one byte of Tx buffer is transferred to transmitter shift register, TXPOINT decreases one. - * |[29] |TXRERR |Transmitter Retry Error - * | | |This bit is used for indicate transmitter error retry and set by hardware.. - * | | |0 = No Tx retry transfer. - * | | |1 = Tx has any error and retries transfer. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is a flag and cannot generate any interrupt to CPU. - * |[30] |TXOVERR |Transmitter over Retry Error - * | | |This bit is used for transmitter retry counts over than retry number limitation. - * | | |0 = Transmitter retries counts is not over than TXRTY (SCn_CTL[22:20]) + 1. - * | | |1 = Transmitter retries counts over than TXRTY (SCn_CTL[22:20]) + 1. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[31] |TXACT |Transmit in Active Status Flag (Read Only) - * | | |This bit indicates Tx transmit status. - * | | |0 = This bit is cleared automatically when Tx transfer is finished or the last byte transmission has completed. - * | | |1 = Transmit is active and this bit is set by hardware when Tx transfer is in active and the STOP bit of the last byte has not been transmitted. - * | | |Note: This bit is read only. - * @var SC_T::PINCTL - * Offset: 0x24 SC Pin Control State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWREN |SCn_PWR Pin Signal - * | | |User can set PWRINV (SCn_PINCTL[11]) and PWREN (SCn_PINCTL[0]) to decide SCn_PWR pin is in high or low level. - * | | |Write this field to drive SCn_PWR pin - * | | |Refer PWRINV (SCn_PINCTL[11]) description for programming SCn_PWR pin voltage level. - * | | |Read this field to get SCn_PWR signal status. - * | | |0 = SCn_PWR signal status is low. - * | | |1 = SCn_PWR signal status is high. - * | | |Note: When operating at activation, warm reset or deactivation mode, this bit will be changed automatically - * | | |Thus, do not fill in this field when operating in these modes. - * |[1] |RSTEN |SCn_RST Pin Signal - * | | |User can set RSTEN (SCn_PINCTL[1]) to decide SCn_RST pin is in high or low level. - * | | |Write this field to drive SCn_RST pin. - * | | |0 = Drive SCn_RST pin to low. - * | | |1 = Drive SCn_RST pin to high. - * | | |Read this field to get SCn_RST signal status. - * | | |0 = SCn_RST signal status is low. - * | | |1 = SCn_RST signal status is high. - * | | |Note: When operating at activation, warm reset or deactivation mode, this bit will be changed automatically - * | | |Thus, do not fill in this field when operating in these modes. - * |[5] |CSTOPLV |SCn_CLK Pin Stop Level - * | | |This field indicates the SCn_CLK pin status when SC clock in clock stop mode. - * | | |0 = SCn_CLK pin keeps at low when SC clock stopped. - * | | |1 = SCn_CLK pin keeps at high when SC clock stopped. - * |[6] |CLKKEEP |SC Clock Enable Bit - * | | |0 = SC clock generation Disabled. - * | | |1 = SC clock always keeps free running. - * | | |Note: When operating in activation, warm reset or deactivation mode, this bit will be changed automatically - * | | |Thus, do not fill in this field when operating in these modes. - * |[9] |SCDATA |SCn_DATA Pin Signal - * | | |This bit is the signal status of SCn_DATA but user can drive SCn_DATA pin to high or low by setting this bit. - * | | |0 = Drive SCn_DATA pin to low. - * | | |1 = Drive SCn_DATA pin to high. - * | | |Read this field to get SCn_DATA signal status. - * | | |0 = SCn_DATA signal status is low. - * | | |1 = SCn_DATA signal status is high. - * | | |Note: When SC is at activation, warm reset or deactivation mode, this bit will be changed automatically - * | | |Thus, do not fill in this field when SC is in these modes. - * |[11] |PWRINV |SCn_PWR Pin Inverse - * | | |This bit is used for inverse the SCn_PWR pin. - * | | |There are four kinds of combination for SCn_PWR pin setting by PWRINV (SCn_PINCTL[11]) and PWREN (SCn_PINCTL[0]). - * | | |0 = SCn_PWR pin inverse Disabled - * | | |If PWREN is 1, SCn_PWR pin status is 1; if PWREN is 0, SCn_PWR pin status is 0. - * | | |1 = SCn_PWR pin inverse Enabled - * | | |If PWREN is 1, SCn_PWR pin status is 0; if PWREN is 0, SCn_PWR pin status is 1. - * | | |Note: User must select PWRINV (SCn_PINCTL[11]) before smart card is enabled by SCEN (SCn_CTL[0]). - * |[16] |DATASTS |SCn_DATA Pin Status (Read Only) - * | | |This bit is the pin status of SCn_DATA. - * | | |0 = The SCn_DATA pin status is low. - * | | |1 = The SCn_DATA pin status is high. - * | | |Note: - * |[17] |PWRSTS |SCn_PWR Pin Status (Read Only) - * | | |This bit is the pin status of SCn_PWR. - * | | |0 = SCn_PWR pin to low. - * | | |1 = SCn_PWR pin to high. - * |[18] |RSTSTS |SCn_RST Pin Status (Read Only) - * | | |This bit is the pin status of SCn_RST. - * | | |0 = SCn_RST pin is low. - * | | |1 = SCn_RST pin is high. - * |[30] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to SCn_PINCTL register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_PINCTL register. - * | | |1 = Last value is synchronizing. - * @var SC_T::TMRCTL0 - * Offset: 0x28 SC Internal Timer0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Timer0 Counter Value - * | | |This field indicates the internal Timer0 counter values. - * | | |Note: Unit of Timer0 counter is ETU base. - * |[27:24] |OPMODE |Timer0 Operation Mode Selection - * | | |This field indicates the internal 24-bit Timer0 operation selection. - * | | |Refer to Table 6.17-3 Timer0/Timer1/Timer2 Operation Mode for programming Timer0. - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to the SCn_TMRCTL0 register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_TMRCTL0 register. - * | | |1 = Last value is synchronizing. - * @var SC_T::TMRCTL1 - * Offset: 0x2C SC Internal Timer1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNT |Timer 1 Counter Value - * | | |This field indicates the internal Timer1 counter values. - * | | |Note: Unit of Timer1 counter is ETU base. - * |[27:24] |OPMODE |Timer 1 Operation Mode Selection - * | | |This field indicates the internal 8-bit Timer1 operation selection. - * | | |Refer to Table 6.17-3 Timer0/Timer1/Timer2 Operation Mode for programming Timer1. - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, software should check this bit when writing a new value to SCn_TMRCTL1 register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_TMRCTL1 register. - * | | |1 = Last value is synchronizing. - * @var SC_T::TMRCTL2 - * Offset: 0x30 SC Internal Timer2 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNT |Timer 2 Counter Value - * | | |This field indicates the internal Timer2 counter values. - * | | |Note: Unit of Timer2 counter is ETU base. - * |[27:24] |OPMODE |Timer 2 Operation Mode Selection - * | | |This field indicates the internal 8-bit Timer2 operation selection - * | | |Refer to Table 6.17-3 Timer0/Timer1/Timer2 Operation Mode for programming Timer2. - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to SCn_TMRCTL2 register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_TMRCTL2 register. - * | | |1 = Last value is synchronizing. - * @var SC_T::UARTCTL - * Offset: 0x34 SC UART Mode Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |UARTEN |UART Mode Enable Bit - * | | |Sets this bit to enable UART mode function. - * | | |0 = Smart Card mode. - * | | |1 = UART mode. - * | | |Note1: When operating in UART mode, user must set CONSEL (SCn_CTL[5:4]) = 00 and AUTOCEN (SCn_CTL[3]) = 0. - * | | |Note2: When operating in Smart Card mode, user must set UARTEN (SCn_UARTCTL[0]) = 0. - * | | |Note3: When UART mode is enabled, hardware will generate a reset to reset FIFO and internal state machine. - * |[5:4] |WLS |Word Length Selection - * | | |This field is used for select UART data length. - * | | |00 = Word length is 8 bits. - * | | |01 = Word length is 7 bits. - * | | |10 = Word length is 6 bits. - * | | |11 = Word length is 5 bits. - * | | |Note: In smart card mode, this WLS must be u201800'. - * |[6] |PBOFF |Parity Bit Disable Control - * | | |Sets this bit is used for disable parity check function. - * | | |0 = Parity bit is generated or checked between the last data word bit and stop bit of the serial data. - * | | |1 = Parity bit is not generated (transmitting data) or checked (receiving data) during transfer. - * | | |Note: In smart card mode, this field must be u20180' (default setting is with parity bit). - * |[7] |OPE |Odd Parity Enable Bit - * | | |This is used for odd/even parity selection. - * | | |0 = Even number of logic 1's are transmitted or check the data word and parity bits in receiving mode. - * | | |1 = Odd number of logic 1's are transmitted or check the data word and parity bits in receiving mode. - * | | |Note: This bit has effect only when PBOFF bit is u20180'. - * @var SC_T::ACTCTL - * Offset: 0x4C SC Activation Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |T1EXT |T1 Extend Time of Hardware Activation - * | | |This field provide the configurable cycles to extend the activation time T1 period. - * | | |The cycle scaling factor is 2048. - * | | |Extend cycles = (filled value * 2048) cycles. - * | | |Refer to SC activation sequence in Figure 6.17-4 SC Activation Sequence. - * | | |For example, - * | | |SCLK = 4MHz, each cycle = 0.25us,. - * | | |Filled 20 to this field - * | | |Extend time = 20 * 2048 * 0.25us = 10.24 ms. - * | | |Note: Setting 0 to this field conforms to the protocol ISO/IEC 7816-3 - */ - __IO uint32_t DAT; /*!< [0x0000] SC Receive/Transmit Holding Buffer Register */ - __IO uint32_t CTL; /*!< [0x0004] SC Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0008] SC Alternate Control Register */ - __IO uint32_t EGT; /*!< [0x000c] SC Extra Guard Time Register */ - __IO uint32_t RXTOUT; /*!< [0x0010] SC Receive Buffer Time-out Counter Register */ - __IO uint32_t ETUCTL; /*!< [0x0014] SC Element Time Unit Control Register */ - __IO uint32_t INTEN; /*!< [0x0018] SC Interrupt Enable Control Register */ - __IO uint32_t INTSTS; /*!< [0x001c] SC Interrupt Status Register */ - __IO uint32_t STATUS; /*!< [0x0020] SC Transfer Status Register */ - __IO uint32_t PINCTL; /*!< [0x0024] SC Pin Control State Register */ - __IO uint32_t TMRCTL0; /*!< [0x0028] SC Internal Timer0 Control Register */ - __IO uint32_t TMRCTL1; /*!< [0x002c] SC Internal Timer1 Control Register */ - __IO uint32_t TMRCTL2; /*!< [0x0030] SC Internal Timer2 Control Register */ - __IO uint32_t UARTCTL; /*!< [0x0034] SC UART Mode Control Register */ - __I uint32_t RESERVE0[5]; - __IO uint32_t ACTCTL; /*!< [0x004c] SC Activation Control Register */ - -} SC_T; - -/** - @addtogroup SC_CONST SC Bit Field Definition - Constant Definitions for SC Controller - @{ -*/ - -#define SC_DAT_DAT_Pos (0) /*!< SC_T::DAT: DAT Position */ -#define SC_DAT_DAT_Msk (0xfful << SC_DAT_DAT_Pos) /*!< SC_T::DAT: DAT Mask */ - -#define SC_CTL_SCEN_Pos (0) /*!< SC_T::CTL: SCEN Position */ -#define SC_CTL_SCEN_Msk (0x1ul << SC_CTL_SCEN_Pos) /*!< SC_T::CTL: SCEN Mask */ - -#define SC_CTL_RXOFF_Pos (1) /*!< SC_T::CTL: RXOFF Position */ -#define SC_CTL_RXOFF_Msk (0x1ul << SC_CTL_RXOFF_Pos) /*!< SC_T::CTL: RXOFF Mask */ - -#define SC_CTL_TXOFF_Pos (2) /*!< SC_T::CTL: TXOFF Position */ -#define SC_CTL_TXOFF_Msk (0x1ul << SC_CTL_TXOFF_Pos) /*!< SC_T::CTL: TXOFF Mask */ - -#define SC_CTL_AUTOCEN_Pos (3) /*!< SC_T::CTL: AUTOCEN Position */ -#define SC_CTL_AUTOCEN_Msk (0x1ul << SC_CTL_AUTOCEN_Pos) /*!< SC_T::CTL: AUTOCEN Mask */ - -#define SC_CTL_CONSEL_Pos (4) /*!< SC_T::CTL: CONSEL Position */ -#define SC_CTL_CONSEL_Msk (0x3ul << SC_CTL_CONSEL_Pos) /*!< SC_T::CTL: CONSEL Mask */ - -#define SC_CTL_RXTRGLV_Pos (6) /*!< SC_T::CTL: RXTRGLV Position */ -#define SC_CTL_RXTRGLV_Msk (0x3ul << SC_CTL_RXTRGLV_Pos) /*!< SC_T::CTL: RXTRGLV Mask */ - -#define SC_CTL_BGT_Pos (8) /*!< SC_T::CTL: BGT Position */ -#define SC_CTL_BGT_Msk (0x1ful << SC_CTL_BGT_Pos) /*!< SC_T::CTL: BGT Mask */ - -#define SC_CTL_TMRSEL_Pos (13) /*!< SC_T::CTL: TMRSEL Position */ -#define SC_CTL_TMRSEL_Msk (0x3ul << SC_CTL_TMRSEL_Pos) /*!< SC_T::CTL: TMRSEL Mask */ - -#define SC_CTL_NSB_Pos (15) /*!< SC_T::CTL: NSB Position */ -#define SC_CTL_NSB_Msk (0x1ul << SC_CTL_NSB_Pos) /*!< SC_T::CTL: NSB Mask */ - -#define SC_CTL_RXRTY_Pos (16) /*!< SC_T::CTL: RXRTY Position */ -#define SC_CTL_RXRTY_Msk (0x7ul << SC_CTL_RXRTY_Pos) /*!< SC_T::CTL: RXRTY Mask */ - -#define SC_CTL_RXRTYEN_Pos (19) /*!< SC_T::CTL: RXRTYEN Position */ -#define SC_CTL_RXRTYEN_Msk (0x1ul << SC_CTL_RXRTYEN_Pos) /*!< SC_T::CTL: RXRTYEN Mask */ - -#define SC_CTL_TXRTY_Pos (20) /*!< SC_T::CTL: TXRTY Position */ -#define SC_CTL_TXRTY_Msk (0x7ul << SC_CTL_TXRTY_Pos) /*!< SC_T::CTL: TXRTY Mask */ - -#define SC_CTL_TXRTYEN_Pos (23) /*!< SC_T::CTL: TXRTYEN Position */ -#define SC_CTL_TXRTYEN_Msk (0x1ul << SC_CTL_TXRTYEN_Pos) /*!< SC_T::CTL: TXRTYEN Mask */ - -#define SC_CTL_CDDBSEL_Pos (24) /*!< SC_T::CTL: CDDBSEL Position */ -#define SC_CTL_CDDBSEL_Msk (0x3ul << SC_CTL_CDDBSEL_Pos) /*!< SC_T::CTL: CDDBSEL Mask */ - -#define SC_CTL_CDLV_Pos (26) /*!< SC_T::CTL: CDLV Position */ -#define SC_CTL_CDLV_Msk (0x1ul << SC_CTL_CDLV_Pos) /*!< SC_T::CTL: CDLV Mask */ - -#define SC_CTL_SYNC_Pos (30) /*!< SC_T::CTL: SYNC Position */ -#define SC_CTL_SYNC_Msk (0x1ul << SC_CTL_SYNC_Pos) /*!< SC_T::CTL: SYNC Mask */ - -#define SC_ALTCTL_TXRST_Pos (0) /*!< SC_T::ALTCTL: TXRST Position */ -#define SC_ALTCTL_TXRST_Msk (0x1ul << SC_ALTCTL_TXRST_Pos) /*!< SC_T::ALTCTL: TXRST Mask */ - -#define SC_ALTCTL_RXRST_Pos (1) /*!< SC_T::ALTCTL: RXRST Position */ -#define SC_ALTCTL_RXRST_Msk (0x1ul << SC_ALTCTL_RXRST_Pos) /*!< SC_T::ALTCTL: RXRST Mask */ - -#define SC_ALTCTL_DACTEN_Pos (2) /*!< SC_T::ALTCTL: DACTEN Position */ -#define SC_ALTCTL_DACTEN_Msk (0x1ul << SC_ALTCTL_DACTEN_Pos) /*!< SC_T::ALTCTL: DACTEN Mask */ - -#define SC_ALTCTL_ACTEN_Pos (3) /*!< SC_T::ALTCTL: ACTEN Position */ -#define SC_ALTCTL_ACTEN_Msk (0x1ul << SC_ALTCTL_ACTEN_Pos) /*!< SC_T::ALTCTL: ACTEN Mask */ - -#define SC_ALTCTL_WARSTEN_Pos (4) /*!< SC_T::ALTCTL: WARSTEN Position */ -#define SC_ALTCTL_WARSTEN_Msk (0x1ul << SC_ALTCTL_WARSTEN_Pos) /*!< SC_T::ALTCTL: WARSTEN Mask */ - -#define SC_ALTCTL_CNTEN0_Pos (5) /*!< SC_T::ALTCTL: CNTEN0 Position */ -#define SC_ALTCTL_CNTEN0_Msk (0x1ul << SC_ALTCTL_CNTEN0_Pos) /*!< SC_T::ALTCTL: CNTEN0 Mask */ - -#define SC_ALTCTL_CNTEN1_Pos (6) /*!< SC_T::ALTCTL: CNTEN1 Position */ -#define SC_ALTCTL_CNTEN1_Msk (0x1ul << SC_ALTCTL_CNTEN1_Pos) /*!< SC_T::ALTCTL: CNTEN1 Mask */ - -#define SC_ALTCTL_CNTEN2_Pos (7) /*!< SC_T::ALTCTL: CNTEN2 Position */ -#define SC_ALTCTL_CNTEN2_Msk (0x1ul << SC_ALTCTL_CNTEN2_Pos) /*!< SC_T::ALTCTL: CNTEN2 Mask */ - -#define SC_ALTCTL_INITSEL_Pos (8) /*!< SC_T::ALTCTL: INITSEL Position */ -#define SC_ALTCTL_INITSEL_Msk (0x3ul << SC_ALTCTL_INITSEL_Pos) /*!< SC_T::ALTCTL: INITSEL Mask */ - -#define SC_ALTCTL_ADACEN_Pos (11) /*!< SC_T::ALTCTL: ADACEN Position */ -#define SC_ALTCTL_ADACEN_Msk (0x1ul << SC_ALTCTL_ADACEN_Pos) /*!< SC_T::ALTCTL: ADACEN Mask */ - -#define SC_ALTCTL_RXBGTEN_Pos (12) /*!< SC_T::ALTCTL: RXBGTEN Position */ -#define SC_ALTCTL_RXBGTEN_Msk (0x1ul << SC_ALTCTL_RXBGTEN_Pos) /*!< SC_T::ALTCTL: RXBGTEN Mask */ - -#define SC_ALTCTL_ACTSTS0_Pos (13) /*!< SC_T::ALTCTL: ACTSTS0 Position */ -#define SC_ALTCTL_ACTSTS0_Msk (0x1ul << SC_ALTCTL_ACTSTS0_Pos) /*!< SC_T::ALTCTL: ACTSTS0 Mask */ - -#define SC_ALTCTL_ACTSTS1_Pos (14) /*!< SC_T::ALTCTL: ACTSTS1 Position */ -#define SC_ALTCTL_ACTSTS1_Msk (0x1ul << SC_ALTCTL_ACTSTS1_Pos) /*!< SC_T::ALTCTL: ACTSTS1 Mask */ - -#define SC_ALTCTL_ACTSTS2_Pos (15) /*!< SC_T::ALTCTL: ACTSTS2 Position */ -#define SC_ALTCTL_ACTSTS2_Msk (0x1ul << SC_ALTCTL_ACTSTS2_Pos) /*!< SC_T::ALTCTL: ACTSTS2 Mask */ - -#define SC_ALTCTL_SYNC_Pos (31) /*!< SC_T::ALTCTL: SYNC Position */ -#define SC_ALTCTL_SYNC_Msk (0x1ul << SC_ALTCTL_SYNC_Pos) /*!< SC_T::ALTCTL: SYNC Mask */ - -#define SC_EGT_EGT_Pos (0) /*!< SC_T::EGT: EGT Position */ -#define SC_EGT_EGT_Msk (0xfful << SC_EGT_EGT_Pos) /*!< SC_T::EGT: EGT Mask */ - -#define SC_RXTOUT_RFTM_Pos (0) /*!< SC_T::RXTOUT: RFTM Position */ -#define SC_RXTOUT_RFTM_Msk (0x1fful << SC_RXTOUT_RFTM_Pos) /*!< SC_T::RXTOUT: RFTM Mask */ - -#define SC_ETUCTL_ETURDIV_Pos (0) /*!< SC_T::ETUCTL: ETURDIV Position */ -#define SC_ETUCTL_ETURDIV_Msk (0xffful << SC_ETUCTL_ETURDIV_Pos) /*!< SC_T::ETUCTL: ETURDIV Mask */ - -#define SC_INTEN_RDAIEN_Pos (0) /*!< SC_T::INTEN: RDAIEN Position */ -#define SC_INTEN_RDAIEN_Msk (0x1ul << SC_INTEN_RDAIEN_Pos) /*!< SC_T::INTEN: RDAIEN Mask */ - -#define SC_INTEN_TBEIEN_Pos (1) /*!< SC_T::INTEN: TBEIEN Position */ -#define SC_INTEN_TBEIEN_Msk (0x1ul << SC_INTEN_TBEIEN_Pos) /*!< SC_T::INTEN: TBEIEN Mask */ - -#define SC_INTEN_TERRIEN_Pos (2) /*!< SC_T::INTEN: TERRIEN Position */ -#define SC_INTEN_TERRIEN_Msk (0x1ul << SC_INTEN_TERRIEN_Pos) /*!< SC_T::INTEN: TERRIEN Mask */ - -#define SC_INTEN_TMR0IEN_Pos (3) /*!< SC_T::INTEN: TMR0IEN Position */ -#define SC_INTEN_TMR0IEN_Msk (0x1ul << SC_INTEN_TMR0IEN_Pos) /*!< SC_T::INTEN: TMR0IEN Mask */ - -#define SC_INTEN_TMR1IEN_Pos (4) /*!< SC_T::INTEN: TMR1IEN Position */ -#define SC_INTEN_TMR1IEN_Msk (0x1ul << SC_INTEN_TMR1IEN_Pos) /*!< SC_T::INTEN: TMR1IEN Mask */ - -#define SC_INTEN_TMR2IEN_Pos (5) /*!< SC_T::INTEN: TMR2IEN Position */ -#define SC_INTEN_TMR2IEN_Msk (0x1ul << SC_INTEN_TMR2IEN_Pos) /*!< SC_T::INTEN: TMR2IEN Mask */ - -#define SC_INTEN_BGTIEN_Pos (6) /*!< SC_T::INTEN: BGTIEN Position */ -#define SC_INTEN_BGTIEN_Msk (0x1ul << SC_INTEN_BGTIEN_Pos) /*!< SC_T::INTEN: BGTIEN Mask */ - -#define SC_INTEN_CDIEN_Pos (7) /*!< SC_T::INTEN: CDIEN Position */ -#define SC_INTEN_CDIEN_Msk (0x1ul << SC_INTEN_CDIEN_Pos) /*!< SC_T::INTEN: CDIEN Mask */ - -#define SC_INTEN_INITIEN_Pos (8) /*!< SC_T::INTEN: INITIEN Position */ -#define SC_INTEN_INITIEN_Msk (0x1ul << SC_INTEN_INITIEN_Pos) /*!< SC_T::INTEN: INITIEN Mask */ - -#define SC_INTEN_RXTOIEN_Pos (9) /*!< SC_T::INTEN: RXTOIEN Position */ -#define SC_INTEN_RXTOIEN_Msk (0x1ul << SC_INTEN_RXTOIEN_Pos) /*!< SC_T::INTEN: RXTOIEN Mask */ - -#define SC_INTEN_ACERRIEN_Pos (10) /*!< SC_T::INTEN: ACERRIEN Position */ -#define SC_INTEN_ACERRIEN_Msk (0x1ul << SC_INTEN_ACERRIEN_Pos) /*!< SC_T::INTEN: ACERRIEN Mask */ - -#define SC_INTSTS_RDAIF_Pos (0) /*!< SC_T::INTSTS: RDAIF Position */ -#define SC_INTSTS_RDAIF_Msk (0x1ul << SC_INTSTS_RDAIF_Pos) /*!< SC_T::INTSTS: RDAIF Mask */ - -#define SC_INTSTS_TBEIF_Pos (1) /*!< SC_T::INTSTS: TBEIF Position */ -#define SC_INTSTS_TBEIF_Msk (0x1ul << SC_INTSTS_TBEIF_Pos) /*!< SC_T::INTSTS: TBEIF Mask */ - -#define SC_INTSTS_TERRIF_Pos (2) /*!< SC_T::INTSTS: TERRIF Position */ -#define SC_INTSTS_TERRIF_Msk (0x1ul << SC_INTSTS_TERRIF_Pos) /*!< SC_T::INTSTS: TERRIF Mask */ - -#define SC_INTSTS_TMR0IF_Pos (3) /*!< SC_T::INTSTS: TMR0IF Position */ -#define SC_INTSTS_TMR0IF_Msk (0x1ul << SC_INTSTS_TMR0IF_Pos) /*!< SC_T::INTSTS: TMR0IF Mask */ - -#define SC_INTSTS_TMR1IF_Pos (4) /*!< SC_T::INTSTS: TMR1IF Position */ -#define SC_INTSTS_TMR1IF_Msk (0x1ul << SC_INTSTS_TMR1IF_Pos) /*!< SC_T::INTSTS: TMR1IF Mask */ - -#define SC_INTSTS_TMR2IF_Pos (5) /*!< SC_T::INTSTS: TMR2IF Position */ -#define SC_INTSTS_TMR2IF_Msk (0x1ul << SC_INTSTS_TMR2IF_Pos) /*!< SC_T::INTSTS: TMR2IF Mask */ - -#define SC_INTSTS_BGTIF_Pos (6) /*!< SC_T::INTSTS: BGTIF Position */ -#define SC_INTSTS_BGTIF_Msk (0x1ul << SC_INTSTS_BGTIF_Pos) /*!< SC_T::INTSTS: BGTIF Mask */ - -#define SC_INTSTS_CDIF_Pos (7) /*!< SC_T::INTSTS: CDIF Position */ -#define SC_INTSTS_CDIF_Msk (0x1ul << SC_INTSTS_CDIF_Pos) /*!< SC_T::INTSTS: CDIF Mask */ - -#define SC_INTSTS_INITIF_Pos (8) /*!< SC_T::INTSTS: INITIF Position */ -#define SC_INTSTS_INITIF_Msk (0x1ul << SC_INTSTS_INITIF_Pos) /*!< SC_T::INTSTS: INITIF Mask */ - -#define SC_INTSTS_RXTOIF_Pos (9) /*!< SC_T::INTSTS: RXTOIF Position */ -#define SC_INTSTS_RXTOIF_Msk (0x1ul << SC_INTSTS_RXTOIF_Pos) /*!< SC_T::INTSTS: RXTOIF Mask */ - -#define SC_INTSTS_ACERRIF_Pos (10) /*!< SC_T::INTSTS: ACERRIF Position */ -#define SC_INTSTS_ACERRIF_Msk (0x1ul << SC_INTSTS_ACERRIF_Pos) /*!< SC_T::INTSTS: ACERRIF Mask */ - -#define SC_STATUS_RXOV_Pos (0) /*!< SC_T::STATUS: RXOV Position */ -#define SC_STATUS_RXOV_Msk (0x1ul << SC_STATUS_RXOV_Pos) /*!< SC_T::STATUS: RXOV Mask */ - -#define SC_STATUS_RXEMPTY_Pos (1) /*!< SC_T::STATUS: RXEMPTY Position */ -#define SC_STATUS_RXEMPTY_Msk (0x1ul << SC_STATUS_RXEMPTY_Pos) /*!< SC_T::STATUS: RXEMPTY Mask */ - -#define SC_STATUS_RXFULL_Pos (2) /*!< SC_T::STATUS: RXFULL Position */ -#define SC_STATUS_RXFULL_Msk (0x1ul << SC_STATUS_RXFULL_Pos) /*!< SC_T::STATUS: RXFULL Mask */ - -#define SC_STATUS_PEF_Pos (4) /*!< SC_T::STATUS: PEF Position */ -#define SC_STATUS_PEF_Msk (0x1ul << SC_STATUS_PEF_Pos) /*!< SC_T::STATUS: PEF Mask */ - -#define SC_STATUS_FEF_Pos (5) /*!< SC_T::STATUS: FEF Position */ -#define SC_STATUS_FEF_Msk (0x1ul << SC_STATUS_FEF_Pos) /*!< SC_T::STATUS: FEF Mask */ - -#define SC_STATUS_BEF_Pos (6) /*!< SC_T::STATUS: BEF Position */ -#define SC_STATUS_BEF_Msk (0x1ul << SC_STATUS_BEF_Pos) /*!< SC_T::STATUS: BEF Mask */ - -#define SC_STATUS_TXOV_Pos (8) /*!< SC_T::STATUS: TXOV Position */ -#define SC_STATUS_TXOV_Msk (0x1ul << SC_STATUS_TXOV_Pos) /*!< SC_T::STATUS: TXOV Mask */ - -#define SC_STATUS_TXEMPTY_Pos (9) /*!< SC_T::STATUS: TXEMPTY Position */ -#define SC_STATUS_TXEMPTY_Msk (0x1ul << SC_STATUS_TXEMPTY_Pos) /*!< SC_T::STATUS: TXEMPTY Mask */ - -#define SC_STATUS_TXFULL_Pos (10) /*!< SC_T::STATUS: TXFULL Position */ -#define SC_STATUS_TXFULL_Msk (0x1ul << SC_STATUS_TXFULL_Pos) /*!< SC_T::STATUS: TXFULL Mask */ - -#define SC_STATUS_CREMOVE_Pos (11) /*!< SC_T::STATUS: CREMOVE Position */ -#define SC_STATUS_CREMOVE_Msk (0x1ul << SC_STATUS_CREMOVE_Pos) /*!< SC_T::STATUS: CREMOVE Mask */ - -#define SC_STATUS_CINSERT_Pos (12) /*!< SC_T::STATUS: CINSERT Position */ -#define SC_STATUS_CINSERT_Msk (0x1ul << SC_STATUS_CINSERT_Pos) /*!< SC_T::STATUS: CINSERT Mask */ - -#define SC_STATUS_CDPINSTS_Pos (13) /*!< SC_T::STATUS: CDPINSTS Position */ -#define SC_STATUS_CDPINSTS_Msk (0x1ul << SC_STATUS_CDPINSTS_Pos) /*!< SC_T::STATUS: CDPINSTS Mask */ - -#define SC_STATUS_RXPOINT_Pos (16) /*!< SC_T::STATUS: RXPOINT Position */ -#define SC_STATUS_RXPOINT_Msk (0x7ul << SC_STATUS_RXPOINT_Pos) /*!< SC_T::STATUS: RXPOINT Mask */ - -#define SC_STATUS_RXRERR_Pos (21) /*!< SC_T::STATUS: RXRERR Position */ -#define SC_STATUS_RXRERR_Msk (0x1ul << SC_STATUS_RXRERR_Pos) /*!< SC_T::STATUS: RXRERR Mask */ - -#define SC_STATUS_RXOVERR_Pos (22) /*!< SC_T::STATUS: RXOVERR Position */ -#define SC_STATUS_RXOVERR_Msk (0x1ul << SC_STATUS_RXOVERR_Pos) /*!< SC_T::STATUS: RXOVERR Mask */ - -#define SC_STATUS_RXACT_Pos (23) /*!< SC_T::STATUS: RXACT Position */ -#define SC_STATUS_RXACT_Msk (0x1ul << SC_STATUS_RXACT_Pos) /*!< SC_T::STATUS: RXACT Mask */ - -#define SC_STATUS_TXPOINT_Pos (24) /*!< SC_T::STATUS: TXPOINT Position */ -#define SC_STATUS_TXPOINT_Msk (0x7ul << SC_STATUS_TXPOINT_Pos) /*!< SC_T::STATUS: TXPOINT Mask */ - -#define SC_STATUS_TXRERR_Pos (29) /*!< SC_T::STATUS: TXRERR Position */ -#define SC_STATUS_TXRERR_Msk (0x1ul << SC_STATUS_TXRERR_Pos) /*!< SC_T::STATUS: TXRERR Mask */ - -#define SC_STATUS_TXOVERR_Pos (30) /*!< SC_T::STATUS: TXOVERR Position */ -#define SC_STATUS_TXOVERR_Msk (0x1ul << SC_STATUS_TXOVERR_Pos) /*!< SC_T::STATUS: TXOVERR Mask */ - -#define SC_STATUS_TXACT_Pos (31) /*!< SC_T::STATUS: TXACT Position */ -#define SC_STATUS_TXACT_Msk (0x1ul << SC_STATUS_TXACT_Pos) /*!< SC_T::STATUS: TXACT Mask */ - -#define SC_PINCTL_PWREN_Pos (0) /*!< SC_T::PINCTL: PWREN Position */ -#define SC_PINCTL_PWREN_Msk (0x1ul << SC_PINCTL_PWREN_Pos) /*!< SC_T::PINCTL: PWREN Mask */ - -#define SC_PINCTL_RSTEN_Pos (1) /*!< SC_T::PINCTL: RSTEN Position */ -#define SC_PINCTL_RSTEN_Msk (0x1ul << SC_PINCTL_RSTEN_Pos) /*!< SC_T::PINCTL: RSTEN Mask */ - -#define SC_PINCTL_CSTOPLV_Pos (5) /*!< SC_T::PINCTL: CSTOPLV Position */ -#define SC_PINCTL_CSTOPLV_Msk (0x1ul << SC_PINCTL_CSTOPLV_Pos) /*!< SC_T::PINCTL: CSTOPLV Mask */ - -#define SC_PINCTL_CLKKEEP_Pos (6) /*!< SC_T::PINCTL: CLKKEEP Position */ -#define SC_PINCTL_CLKKEEP_Msk (0x1ul << SC_PINCTL_CLKKEEP_Pos) /*!< SC_T::PINCTL: CLKKEEP Mask */ - -#define SC_PINCTL_SCDATA_Pos (9) /*!< SC_T::PINCTL: SCDATA Position */ -#define SC_PINCTL_SCDATA_Msk (0x1ul << SC_PINCTL_SCDATA_Pos) /*!< SC_T::PINCTL: SCDATA Mask */ - -#define SC_PINCTL_PWRINV_Pos (11) /*!< SC_T::PINCTL: PWRINV Position */ -#define SC_PINCTL_PWRINV_Msk (0x1ul << SC_PINCTL_PWRINV_Pos) /*!< SC_T::PINCTL: PWRINV Mask */ - -#define SC_PINCTL_DATASTS_Pos (16) /*!< SC_T::PINCTL: DATASTS Position */ -#define SC_PINCTL_DATASTS_Msk (0x1ul << SC_PINCTL_DATASTS_Pos) /*!< SC_T::PINCTL: DATASTS Mask */ - -#define SC_PINCTL_PWRSTS_Pos (17) /*!< SC_T::PINCTL: PWRSTS Position */ -#define SC_PINCTL_PWRSTS_Msk (0x1ul << SC_PINCTL_PWRSTS_Pos) /*!< SC_T::PINCTL: PWRSTS Mask */ - -#define SC_PINCTL_RSTSTS_Pos (18) /*!< SC_T::PINCTL: RSTSTS Position */ -#define SC_PINCTL_RSTSTS_Msk (0x1ul << SC_PINCTL_RSTSTS_Pos) /*!< SC_T::PINCTL: RSTSTS Mask */ - -#define SC_PINCTL_SYNC_Pos (30) /*!< SC_T::PINCTL: SYNC Position */ -#define SC_PINCTL_SYNC_Msk (0x1ul << SC_PINCTL_SYNC_Pos) /*!< SC_T::PINCTL: SYNC Mask */ - -#define SC_TMRCTL0_CNT_Pos (0) /*!< SC_T::TMRCTL0: CNT Position */ -#define SC_TMRCTL0_CNT_Msk (0xfffffful << SC_TMRCTL0_CNT_Pos) /*!< SC_T::TMRCTL0: CNT Mask */ - -#define SC_TMRCTL0_OPMODE_Pos (24) /*!< SC_T::TMRCTL0: OPMODE Position */ -#define SC_TMRCTL0_OPMODE_Msk (0xful << SC_TMRCTL0_OPMODE_Pos) /*!< SC_T::TMRCTL0: OPMODE Mask */ - -#define SC_TMRCTL0_SYNC_Pos (31) /*!< SC_T::TMRCTL0: SYNC Position */ -#define SC_TMRCTL0_SYNC_Msk (0x1ul << SC_TMRCTL0_SYNC_Pos) /*!< SC_T::TMRCTL0: SYNC Mask */ - -#define SC_TMRCTL1_CNT_Pos (0) /*!< SC_T::TMRCTL1: CNT Position */ -#define SC_TMRCTL1_CNT_Msk (0xfful << SC_TMRCTL1_CNT_Pos) /*!< SC_T::TMRCTL1: CNT Mask */ - -#define SC_TMRCTL1_OPMODE_Pos (24) /*!< SC_T::TMRCTL1: OPMODE Position */ -#define SC_TMRCTL1_OPMODE_Msk (0xful << SC_TMRCTL1_OPMODE_Pos) /*!< SC_T::TMRCTL1: OPMODE Mask */ - -#define SC_TMRCTL1_SYNC_Pos (31) /*!< SC_T::TMRCTL1: SYNC Position */ -#define SC_TMRCTL1_SYNC_Msk (0x1ul << SC_TMRCTL1_SYNC_Pos) /*!< SC_T::TMRCTL1: SYNC Mask */ - -#define SC_TMRCTL2_CNT_Pos (0) /*!< SC_T::TMRCTL2: CNT Position */ -#define SC_TMRCTL2_CNT_Msk (0xfful << SC_TMRCTL2_CNT_Pos) /*!< SC_T::TMRCTL2: CNT Mask */ - -#define SC_TMRCTL2_OPMODE_Pos (24) /*!< SC_T::TMRCTL2: OPMODE Position */ -#define SC_TMRCTL2_OPMODE_Msk (0xful << SC_TMRCTL2_OPMODE_Pos) /*!< SC_T::TMRCTL2: OPMODE Mask */ - -#define SC_TMRCTL2_SYNC_Pos (31) /*!< SC_T::TMRCTL2: SYNC Position */ -#define SC_TMRCTL2_SYNC_Msk (0x1ul << SC_TMRCTL2_SYNC_Pos) /*!< SC_T::TMRCTL2: SYNC Mask */ - -#define SC_UARTCTL_UARTEN_Pos (0) /*!< SC_T::UARTCTL: UARTEN Position */ -#define SC_UARTCTL_UARTEN_Msk (0x1ul << SC_UARTCTL_UARTEN_Pos) /*!< SC_T::UARTCTL: UARTEN Mask */ - -#define SC_UARTCTL_WLS_Pos (4) /*!< SC_T::UARTCTL: WLS Position */ -#define SC_UARTCTL_WLS_Msk (0x3ul << SC_UARTCTL_WLS_Pos) /*!< SC_T::UARTCTL: WLS Mask */ - -#define SC_UARTCTL_PBOFF_Pos (6) /*!< SC_T::UARTCTL: PBOFF Position */ -#define SC_UARTCTL_PBOFF_Msk (0x1ul << SC_UARTCTL_PBOFF_Pos) /*!< SC_T::UARTCTL: PBOFF Mask */ - -#define SC_UARTCTL_OPE_Pos (7) /*!< SC_T::UARTCTL: OPE Position */ -#define SC_UARTCTL_OPE_Msk (0x1ul << SC_UARTCTL_OPE_Pos) /*!< SC_T::UARTCTL: OPE Mask */ - -#define SC_ACTCTL_T1EXT_Pos (0) /*!< SC_T::ACTCTL: T1EXT Position */ -#define SC_ACTCTL_T1EXT_Msk (0x1ful << SC_ACTCTL_T1EXT_Pos) /*!< SC_T::ACTCTL: T1EXT Mask */ - -/**@}*/ /* SC_CONST */ -/**@}*/ /* end of SC register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __SC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/scu_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/scu_reg.h deleted file mode 100644 index 3ba0b96d355..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/scu_reg.h +++ /dev/null @@ -1,2699 +0,0 @@ -/**************************************************************************//** - * @file scu_reg.h - * @version V1.00 - * @brief SCU register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SCU_REG_H__ -#define __SCU_REG_H__ - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Booting Flag -------------------------*/ -/** - @addtogroup BTF Booting Flag - Memory Mapped Structure for BTF Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var BTF_T::BTF - * Offset: 0x00 Booting Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BL2 |BL2 Flag - * | | |Indicating the CPU is running at BL2 - */ - __IO uint32_t BTF; /*!< [0x0000] Booting Flag Register */ - -} BTF_T; - -/** - @addtogroup BTF_CONST BTF Bit Field Definition - Constant Definitions for BTF Controller - @{ -*/ - -#define BTF_BTF_BL2_Pos (0) /*!< BTF_T::BTF: BL2 Position */ -#define BTF_BTF_BL2_Msk (0x1ul << BTF_BTF_BL2_Pos) /*!< BTF_T::BTF: BL2 Mask */ - -/**@}*/ /* BTF_CONST */ -/**@}*/ /* end of BTF register group */ - - -/*---------------------- Debug Protection Mechanism -------------------------*/ -/** - @addtogroup DPM Debug Protection Mechanism(DPM) - Memory Mapped Structure for DPM Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var DPM_T::CTL - * Offset: 0x00 Secure DPM Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DBGDIS |Set Secure DPM Debug Disable Bit - * | | |When this bit is read as zero, it can be write to one to configure the Secure DPM DBGDIS bit (DBGDISS). - * | | |When write: - * | | |0 = No operation. - * | | |1 = Trigger the process to set DBGDISS configuration bit. - * | | |Note: This bit can be set to 1 but cannot be cleared to 0. - * |[1] |LOCK |Set Secure DPM Debug Lock Bit - * | | |When this bit is read as zero, it can be write to one to configure the Secure DPM LOCK bit (LOCKS). - * | | |When write: - * | | |0 = No operation. - * | | |1 = Trigger the process to set LOCKS configuration bit. - * | | |Note: This bit can be set to 1 but cannot be cleared to 0. - * |[2] |PWCMP |Secure DPM Password Compare Bit - * | | |Set to enter the process of compare Secure DPM password. - * | | |0 = No operation. - * | | |1 = Compare Secure DPM password. - * | | |Note: This bit will be cleared after the comparison process is finished. - * |[3] |PWUPD |Secure DPM Password Update Bit - * | | |Set to enter the process of updating Secure DPM password. - * | | |0 = No operation. - * | | |1 = Update Secure DPM password. - * | | |Note 1: This bit should be set with PWCMP equal to 0. - * | | |Note 2: This bit will be cleared after the update process is finished. - * |[8] |INTEN |DPM Interrupt Enable Bit - * | | |0 = DPM interrupt function Enabled. - * | | |1 = DPM interrupt function Disabled. - * |[12] |DACCWDIS |Secure DPM Debug Write Access Disable Bit - * | | |This bit disables the writability of external debugger to Secure DPM registers for debug authentication. - * | | |0 = External debugger can write Secure DPM registers. - * | | |1 = External debugger cannot write Secure DPM registers. - * |[13] |DACCDIS |Debug Access Disable Bit - * | | |This bit disables the accessibility of external debugger to all DPM registers. - * | | |0 = External debugger can read/write DPM registers. - * | | |1 = External debugger cannot read/write DPM registers. - * |[31:24] |WVCODE |Write Verify Code and Read Verify Code - * | |RVCODE |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, 0x5A, is needed to do a valid write to DPM_CTL. - * | | |Others = Invalid write verify code. - * @var DPM_T::STS - * Offset: 0x04 Secure DPM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |DPM Busy Flag (Read Only) - * | | |This bit indicates the DPM is busy. - * | | |0 = DPM is not busy and writing to any register is accepted. - * | | |1 = DPM is busy and other bits in DPM_STS register are not valid and writing to any register is ignored. - * |[1] |INT |DPM Interrupt Flag (Read Only) - * | | |This bit indicates the interrupt is triggered. - * | | |0 = Interrupt is not enabled or no password comparison flag is set. - * | | |1 = Interrupt is enabled and PWCERR flag in either DPM_STS or DPM_NSSTS register is not cleared. - * | | |Note: This bit is cleared automatically when PWCERR flag in both DPM_STS and DPM_NSSTS are zero. - * |[4] |PWCERR |Secure DPM Password Compared Error Flag - * | | |This bit indicates the result of Secure DPM password comparison. - * | | |When read: - * | | |0 = The result of Secure DPM password is correct. - * | | |1 = The result of Seucre DPM password is incorrect. - * | | |Note: This flag is write-one-clear. - * |[5] |PWUOK |Secure DPM Password Updated Flag - * | | |This bit indicates Secure DPM password has been updated successfully. - * | | |When read: - * | | |0 = No successful updating process has happened. - * | | |1 = There is at least one successful updating process since last clearing of this bit. - * | | |Note: This flag is write-one-clear. - * |[6] |PWFMAX |Secure DPM Password Fail Times Maximum Reached Flag (Read Only) - * | | |This bit indicates if the fail times of comparing Secure DPM password reached max times. - * | | |0 = Max time has not reached and Secure DPM password comparison can be triggered. - * | | |1 = Max time reached and Secure DPM password comparison cannot be processed anymore. - * |[10:8] |PWUCNT |Secure DPM Password Updated Times (Read Only) - * | | |This bit indicates how many times of secure password has been updated. - * | | |The max value is 7. If PWUCNT reached the max value, Secure DPM password cannot be updated anymore. - * |[16] |DBGDIS |Secure Debug Disable Flag (Read Only) - * | | |This bit indicates the current value of Secure DPM DBGDIS bit (DBGDISS). - * | | |{PWOK, LOCK, DBGDIS} bits define the current state of DPM. - * | | |x00 = DEFAULT state. - * | | |x1x = LOCKED state. - * | | |001 = CLOSE state. - * | | |101 = OPEN state. - * | | |Others = Unknown. - * |[17] |LOCK |Secure Debug Lock Flag (Read Only) - * | | |This bit indicates the current value of Secure DPM LOCK bit (LOCKS). - * |[18] |PWOK |Secure Password OK Flag (Read Only) - * | | |This bit indicates the Secure DPM password has been checked and is correct. - * | | |0 = The Secure DPM password has not been checked pass, yet. - * | | |1 = The Secure DPM password has been checked pass since last cold reset. - * @var DPM_T::SPW - * Offset: 0x10 Secure DPM Password 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[31:0] to this register to update or compare Secure DPM password. - * | | |It is write-only and always read as 0xFFFFFFFF. - * Offset: 0x14 Secure DPM Password 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[63:32] to this register to update or compare Secure DPM password - * | | |It is write-only and always read as 0xFFFFFFFF. - * Offset: 0x18 Secure DPM Password 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[95:64] to this register to update or compare Secure DPM password. - * | | |It is write-only and always read as 0xFFFFFFFF. - * Offset: 0x1C Secure DPM Password 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[127:96] to this register to update or compare Secure DPM password. - * | | |It is write-only and always read as 0xFFFFFFFF. - * @var DPM_T::NSCTL - * Offset: 0x50 Non-secure DPM Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DBGDIS |Set Non-secure DPM Debug Disable Bit - * | | |When this bit is read as zero, it can be write to one to configure the Non-secure DPM DBGDIS bit (DBGDISNS). - * | | |When write: - * | | |0 = No operation. - * | | |1 = Trigger the process to set DBGDISNS configuration bit. - * | | |Note: This bit can be set to 1 but cannot be cleared to 0. - * |[1] |LOCK |Set Non-secure DPM Debug Lock Bit - * | | |When this bit is read as zero, it can be write to one to configure the Non-secure DPM LOCK bit (LOCKNS). - * | | |When write: - * | | |0 = No operation. - * | | |1 = Trigger the process to set LOCKNS configuration bit. - * | | |Note: This bit can be set to 1 but cannot be cleared to 0. - * |[2] |PWCMP |Non-secure DPM Password Compare Bit - * | | |Set to enter the process of compare Non-secure DPM password. - * | | |0 = No operation. - * | | |1 = Compare Non-secure DPM password. - * | | |Note: This bit will be cleared after the comparison process is finished. - * |[3] |PWUPD |Non-secure DPM Password Update Bit - * | | |Set to enter the process of updating Non-secure DPM password. - * | | |0 = No operation. - * | | |1 = Update Non-secure DPM password. - * | | |Note 1: This bit should be set with PWCMP equal to 0. - * | | |Note 2: This bit will be cleared after the update process is finished. - * |[12] |DACCWDIS |Debug Write Access Disable Bit - * | | |This bit disables the writability of external debugger to Non-secure DPM registers for debug authentication. - * | | |0 = External debugger can write Non-secure DPM registers. - * | | |1 = External debugger cannot write Non-secure DPM registers. - * |[31:24] |WVCODE |Write Verify Code and Read Verify Code - * | |RVCODE |Read operation: - * | | |0xA5 = The read access for DPM_NSCTL is correct. - * | | |Others = The read access for DPM_NSCTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, 0x5A, is needed to do a valid write to DPM_NSCTL. - * | | |Others = Invalid write verify code. - * @var DPM_T::NSSTS - * Offset: 0x54 Non-secure DPM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |DPM Busy Flag (Read Only) - * | | |This bit indicates the DPM is busy. - * | | |0 = DPM is not busy and writing to any register is accepted. - * | | |1 = DPM is busy and other bits in DPM_NSSTS register are not valid and writing to any register is ignored. - * |[4] |PWCERR |Non-secure DPM Password Compared Error Flag - * | | |This bit indicates the result of Non-secure DPM password comparison. - * | | |0 = The result of Non-secure DPM password is correct. - * | | |1 = The result of Non-seucre DPM password is incorrect. - * | | |Note: This flag is write-one-clear. - * |[5] |PWUOK |Non-secure DPM Password Updated Flag - * | | |This bit indicates Non-secure DPM password has been updated correctly. - * | | |When read: - * | | |0 = No successful updating process has happened. - * | | |1 = There is at least one successful updating process since last clearing of this bit. - * | | |Note: This flag is write-one-clear. - * |[6] |PWFMAX |Non-secure DPM Password Fail Times Maximum Reached Flag (Read Only) - * | | |This bit indicates if the fail times of comparing Non-secure DPM password reached max times. - * | | |0 = Max time has not reached and Non-secure DPM password comparison can be triggered. - * | | |1 = Max time reached and Non-secure DPM password comparison cannot be processed anymore. - * |[10:8] |PWUCNT |Non-secure DPM Password Updated Times (Read Only) - * | | |This bit indicates how many times of non-secure password has been updated. - * | | |The max value is 7. If PWUCNT reached the max value, Non-secure DPM password cannot be updated anymore. - * |[16] |DBGDIS |Non-secure Debug Disable Flag (Read Only) - * | | |This bit indicates the current value of of Non-secure DPM DBGDIS bit (DBGDISNS). - * | | |{PWOK, LOCK, DBGDIS} bits define the current state of DPM. - * | | |x00 = DEFAULT state. - * | | |x1x = LOCKED state. - * | | |001 = CLOSE state. - * | | |101 = OPEN state. - * | | |Others = Unknown. - * |[17] |LOCK |Non-secure Debug Lock Flag (Read Only) - * | | |This bit indicates the current value of Non-secure DPM DBGDIS bit (LOCKNS). - * |[18] |PWOK |Non-secure Password OK Flag (Read Only) - * | | |This bit indicates the Non-secure DPM password has been checked and is correct. - * | | |0 = The Non-secure DPM password has not been checked pass, yet. - * | | |1 = The Non-secure DPM password has been checked pass since last cold reset. - * @var DPM_T::NSPW - * Offset: 0x60 Non-secure DPM Password 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[31:0] to this register to update or compare Non-secure DPM password. - * | | |It is write-only and always read as 0xFFFFFFFF. - * Offset: 0x64 Non-secure DPM Password 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[63:32] to this register to update or compare Non-secure DPM password. - * | | |It is write-only and always read as 0xFFFFFFFF. - * Offset: 0x68 Non-secure DPM Password 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[95:64] to this register to update or compare Non-secure DPM password. - * | | |It is write-only and always read as 0xFFFFFFFF. - * Offset: 0x6C Non-secure DPM Password 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PW |Password - * | | |Write password[127:96] to this register to update or compare Non-secure DPM password. - * | | |It is write-only and always read as 0xFFFFFFFF. - */ - __IO uint32_t CTL; /*!< [0x0000] Secure DPM Control Register */ - __IO uint32_t STS; /*!< [0x0004] Secure DPM Status Register */ - __I uint32_t RESERVE0[2]; - __O uint32_t SPW[4]; /*!< [0x0010/0x0014/0x0018/0x001c] Secure DPM Password 0/1/2/3 */ - __I uint32_t RESERVE1[12]; - __IO uint32_t NSCTL; /*!< [0x0050] Non-secure DPM Control Register */ - __IO uint32_t NSSTS; /*!< [0x0054] Non-secure DPM Status Register */ - __I uint32_t RESERVE2[2]; - __O uint32_t NSPW[4]; /*!< [0x00600/0x0064/0x0068/0x006c] Non-secure DPM Password 0/1/2/3 */ - - -} DPM_T; - -/** - @addtogroup DPM_CONST DPM Bit Field Definition - Constant Definitions for DPM Controller - @{ -*/ - -#define DPM_CTL_DBGDIS_Pos (0) /*!< DPM_T::CTL: DBGDIS Position */ -#define DPM_CTL_DBGDIS_Msk (0x1ul << DPM_CTL_DBGDIS_Pos) /*!< DPM_T::CTL: DBGDIS Mask */ - -#define DPM_CTL_LOCK_Pos (1) /*!< DPM_T::CTL: LOCK Position */ -#define DPM_CTL_LOCK_Msk (0x1ul << DPM_CTL_LOCK_Pos) /*!< DPM_T::CTL: LOCK Mask */ - -#define DPM_CTL_PWCMP_Pos (2) /*!< DPM_T::CTL: PWCMP Position */ -#define DPM_CTL_PWCMP_Msk (0x1ul << DPM_CTL_PWCMP_Pos) /*!< DPM_T::CTL: PWCMP Mask */ - -#define DPM_CTL_PWUPD_Pos (3) /*!< DPM_T::CTL: PWUPD Position */ -#define DPM_CTL_PWUPD_Msk (0x1ul << DPM_CTL_PWUPD_Pos) /*!< DPM_T::CTL: PWUPD Mask */ - -#define DPM_CTL_INTEN_Pos (8) /*!< DPM_T::CTL: INTEN Position */ -#define DPM_CTL_INTEN_Msk (0x1ul << DPM_CTL_INTEN_Pos) /*!< DPM_T::CTL: INTEN Mask */ - -#define DPM_CTL_DACCWDIS_Pos (12) /*!< DPM_T::CTL: DACCWDIS Position */ -#define DPM_CTL_DACCWDIS_Msk (0x1ul << DPM_CTL_DACCWDIS_Pos) /*!< DPM_T::CTL: DACCWDIS Mask */ - -#define DPM_CTL_DACCDIS_Pos (13) /*!< DPM_T::CTL: DACCDIS Position */ -#define DPM_CTL_DACCDIS_Msk (0x1ul << DPM_CTL_DACCDIS_Pos) /*!< DPM_T::CTL: DACCDIS Mask */ - -#define DPM_CTL_WVCODE_Pos (24) /*!< DPM_T::CTL: WVCODE Position */ -#define DPM_CTL_WVCODE_Msk (0xfful << DPM_CTL_WVCODE_Pos) /*!< DPM_T::CTL: WVCODE Mask */ - -#define DPM_CTL_RVCODE_Pos (24) /*!< DPM_T::CTL: RVCODE Position */ -#define DPM_CTL_RVCODE_Msk (0xfful << DPM_CTL_RVCODE_Pos) /*!< DPM_T::CTL: RVCODE Mask */ - -#define DPM_STS_BUSY_Pos (0) /*!< DPM_T::STS: BUSY Position */ -#define DPM_STS_BUSY_Msk (0x1ul << DPM_STS_BUSY_Pos) /*!< DPM_T::STS: BUSY Mask */ - -#define DPM_STS_INT_Pos (1) /*!< DPM_T::STS: INT Position */ -#define DPM_STS_INT_Msk (0x1ul << DPM_STS_INT_Pos) /*!< DPM_T::STS: INT Mask */ - -#define DPM_STS_PWCERR_Pos (4) /*!< DPM_T::STS: PWCERR Position */ -#define DPM_STS_PWCERR_Msk (0x1ul << DPM_STS_PWCERR_Pos) /*!< DPM_T::STS: PWCERR Mask */ - -#define DPM_STS_PWUOK_Pos (5) /*!< DPM_T::STS: PWUOK Position */ -#define DPM_STS_PWUOK_Msk (0x1ul << DPM_STS_PWUOK_Pos) /*!< DPM_T::STS: PWUOK Mask */ - -#define DPM_STS_PWFMAX_Pos (6) /*!< DPM_T::STS: PWFMAX Position */ -#define DPM_STS_PWFMAX_Msk (0x1ul << DPM_STS_PWFMAX_Pos) /*!< DPM_T::STS: PWFMAX Mask */ - -#define DPM_STS_PWUCNT_Pos (8) /*!< DPM_T::STS: PWUCNT Position */ -#define DPM_STS_PWUCNT_Msk (0x7ul << DPM_STS_PWUCNT_Pos) /*!< DPM_T::STS: PWUCNT Mask */ - -#define DPM_STS_DBGDIS_Pos (16) /*!< DPM_T::STS: DBGDIS Position */ -#define DPM_STS_DBGDIS_Msk (0x1ul << DPM_STS_DBGDIS_Pos) /*!< DPM_T::STS: DBGDIS Mask */ - -#define DPM_STS_LOCK_Pos (17) /*!< DPM_T::STS: LOCK Position */ -#define DPM_STS_LOCK_Msk (0x1ul << DPM_STS_LOCK_Pos) /*!< DPM_T::STS: LOCK Mask */ - -#define DPM_STS_PWOK_Pos (18) /*!< DPM_T::STS: PWOK Position */ -#define DPM_STS_PWOK_Msk (0x1ul << DPM_STS_PWOK_Pos) /*!< DPM_T::STS: PWOK Mask */ - -#define DPM_SPW0_PW_Pos (0) /*!< DPM_T::SPW0: PW Position */ -#define DPM_SPW0_PW_Msk (0xfffffffful << DPM_SPW0_PW_Pos) /*!< DPM_T::SPW0: PW Mask */ - -#define DPM_SPW1_PW_Pos (0) /*!< DPM_T::SPW1: PW Position */ -#define DPM_SPW1_PW_Msk (0xfffffffful << DPM_SPW1_PW_Pos) /*!< DPM_T::SPW1: PW Mask */ - -#define DPM_SPW2_PW_Pos (0) /*!< DPM_T::SPW2: PW Position */ -#define DPM_SPW2_PW_Msk (0xfffffffful << DPM_SPW2_PW_Pos) /*!< DPM_T::SPW2: PW Mask */ - -#define DPM_SPW3_PW_Pos (0) /*!< DPM_T::SPW3: PW Position */ -#define DPM_SPW3_PW_Msk (0xfffffffful << DPM_SPW3_PW_Pos) /*!< DPM_T::SPW3: PW Mask */ - -#define DPM_NSCTL_DBGDIS_Pos (0) /*!< DPM_T::NSCTL: DBGDIS Position */ -#define DPM_NSCTL_DBGDIS_Msk (0x1ul << DPM_NSCTL_DBGDIS_Pos) /*!< DPM_T::NSCTL: DBGDIS Mask */ - -#define DPM_NSCTL_LOCK_Pos (1) /*!< DPM_T::NSCTL: LOCK Position */ -#define DPM_NSCTL_LOCK_Msk (0x1ul << DPM_NSCTL_LOCK_Pos) /*!< DPM_T::NSCTL: LOCK Mask */ - -#define DPM_NSCTL_PWCMP_Pos (2) /*!< DPM_T::NSCTL: PWCMP Position */ -#define DPM_NSCTL_PWCMP_Msk (0x1ul << DPM_NSCTL_PWCMP_Pos) /*!< DPM_T::NSCTL: PWCMP Mask */ - -#define DPM_NSCTL_PWUPD_Pos (3) /*!< DPM_T::NSCTL: PWUPD Position */ -#define DPM_NSCTL_PWUPD_Msk (0x1ul << DPM_NSCTL_PWUPD_Pos) /*!< DPM_T::NSCTL: PWUPD Mask */ - -#define DPM_NSCTL_DACCWDIS_Pos (12) /*!< DPM_T::NSCTL: DACCWDIS Position */ -#define DPM_NSCTL_DACCWDIS_Msk (0x1ul << DPM_NSCTL_DACCWDIS_Pos) /*!< DPM_T::NSCTL: DACCWDIS Mask */ - -#define DPM_NSCTL_WVCODE_Pos (24) /*!< DPM_T::NSCTL: WVCODE Position */ -#define DPM_NSCTL_WVCODE_Msk (0xfful << DPM_NSCTL_WVCODE_Pos) /*!< DPM_T::NSCTL: WVCODE Mask */ - -#define DPM_NSCTL_RVCODE_Pos (24) /*!< DPM_T::NSCTL: RVCODE Position */ -#define DPM_NSCTL_RVCODE_Msk (0xfful << DPM_NSCTL_RVCODE_Pos) /*!< DPM_T::NSCTL: RVCODE Mask */ - -#define DPM_NSSTS_BUSY_Pos (0) /*!< DPM_T::NSSTS: BUSY Position */ -#define DPM_NSSTS_BUSY_Msk (0x1ul << DPM_NSSTS_BUSY_Pos) /*!< DPM_T::NSSTS: BUSY Mask */ - -#define DPM_NSSTS_PWCERR_Pos (4) /*!< DPM_T::NSSTS: PWCERR Position */ -#define DPM_NSSTS_PWCERR_Msk (0x1ul << DPM_NSSTS_PWCERR_Pos) /*!< DPM_T::NSSTS: PWCERR Mask */ - -#define DPM_NSSTS_PWUOK_Pos (5) /*!< DPM_T::NSSTS: PWUOK Position */ -#define DPM_NSSTS_PWUOK_Msk (0x1ul << DPM_NSSTS_PWUOK_Pos) /*!< DPM_T::NSSTS: PWUOK Mask */ - -#define DPM_NSSTS_PWFMAX_Pos (6) /*!< DPM_T::NSSTS: PWFMAX Position */ -#define DPM_NSSTS_PWFMAX_Msk (0x1ul << DPM_NSSTS_PWFMAX_Pos) /*!< DPM_T::NSSTS: PWFMAX Mask */ - -#define DPM_NSSTS_PWUCNT_Pos (8) /*!< DPM_T::NSSTS: PWUCNT Position */ -#define DPM_NSSTS_PWUCNT_Msk (0x7ul << DPM_NSSTS_PWUCNT_Pos) /*!< DPM_T::NSSTS: PWUCNT Mask */ - -#define DPM_NSSTS_DBGDIS_Pos (16) /*!< DPM_T::NSSTS: DBGDIS Position */ -#define DPM_NSSTS_DBGDIS_Msk (0x1ul << DPM_NSSTS_DBGDIS_Pos) /*!< DPM_T::NSSTS: DBGDIS Mask */ - -#define DPM_NSSTS_LOCK_Pos (17) /*!< DPM_T::NSSTS: LOCK Position */ -#define DPM_NSSTS_LOCK_Msk (0x1ul << DPM_NSSTS_LOCK_Pos) /*!< DPM_T::NSSTS: LOCK Mask */ - -#define DPM_NSSTS_PWOK_Pos (18) /*!< DPM_T::NSSTS: PWOK Position */ -#define DPM_NSSTS_PWOK_Msk (0x1ul << DPM_NSSTS_PWOK_Pos) /*!< DPM_T::NSSTS: PWOK Mask */ - -#define DPM_NSPW0_PW_Pos (0) /*!< DPM_T::NSPW0: PW Position */ -#define DPM_NSPW0_PW_Msk (0xfffffffful << DPM_NSPW0_PW_Pos) /*!< DPM_T::NSPW0: PW Mask */ - -#define DPM_NSPW1_PW_Pos (0) /*!< DPM_T::NSPW1: PW Position */ -#define DPM_NSPW1_PW_Msk (0xfffffffful << DPM_NSPW1_PW_Pos) /*!< DPM_T::NSPW1: PW Mask */ - -#define DPM_NSPW2_PW_Pos (0) /*!< DPM_T::NSPW2: PW Position */ -#define DPM_NSPW2_PW_Msk (0xfffffffful << DPM_NSPW2_PW_Pos) /*!< DPM_T::NSPW2: PW Mask */ - -#define DPM_NSPW3_PW_Pos (0) /*!< DPM_T::NSPW3: PW Position */ -#define DPM_NSPW3_PW_Msk (0xfffffffful << DPM_NSPW3_PW_Pos) /*!< DPM_T::NSPW3: PW Mask */ - - -/**@}*/ /* DPM_CONST */ -/**@}*/ /* end of DPM register group */ - - - -/*---------------------- Firmware Version Counter -------------------------*/ -/** - @addtogroup FVC Firmware Version Counter(FVC) - Memory Mapped Structure for FVC Controller -@{ */ - -typedef struct -{ - - - /** - * @var FVC_T::CTL - * Offset: 0x00 FVC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INIT |FVC Init Bit - * | | |Set to 1 to enable FVC - * | | |This bit is writable when FVC is at Reset state. - * | | |Note: After set to 1, this bit is cleared to 0 automatically when FVC is back to Reset state. - * |[1] |MONOEN |Monotonic Enable Bit - * | | |Set to 1 to enable the monotonic mechanism of FVC. - * | | |Note: This bit can be set to1 but cannot be cleared to 0. - * |[31:16] |WVCODE |Verification Code - * | | |When written, this field must be 0x7710 - * @var FVC_T::STS - * Offset: 0x04 FVC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |FVC Busy Bit - * | | |Indicates the FVC is at busy state. - * |[1] |RDY |FVC Ready Bit - * | | |Indicates the FVC is ready after the initial process. - * @var FVC_T::NVC0 - * Offset: 0x10 Non-volatile Version Counter Control Register0 BL2 Firmware - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FWVER |Firmware Version - * | | |Read: Indicates the current firmware version of FVC0. - * | | |Write: Updates the firmware version of FVC0. - * | | |The maximum value of this field is 63. - * | | |Indicating number of 1 in Fuse OTP or number of 0 in Flash - * |[31:16] |WVCODE |Verification Code - * | | |When written, this field must be the current firmware version number - * @var FVC_T::NVC1 - * Offset: 0x14 Non-volatile Version Counter Control Register1 BL32 Firmware - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FWVER |Firmware Version - * | | |Read: Indicates the current firmware version of NVC1. - * | | |Write: Updates the firmware version of NVC1. - * | | |The maximum value of this field is 63. - * | | |Indicating number of 1 in Fuse OTP or number of 0 in Flash - * |[31:16] |WVCODE |Verification Code - * | | |When written, this field must be the current firmware version number - * @var FVC_T::NVC4 - * Offset: 0x20 Non-volatile Version Counter Control Register4 BL33 Firmware - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FWVER |Firmware Version - * | | |Read: Indicates the current firmware version of NVC4. - * | | |Write: Updates the firmware version of NVC4. - * | | |The maximum value of this field is 255. - * | | |Indicating number of 1 in Fuse OTP or number of 0 in Flash - * |[31:16] |WVCODE |Verification Code - * | | |When written, this field must be the current firmware version number - * @var FVC_T::NVC5 - * Offset: 0x24 Non-volatile Version Counter Control Register5 User-defined Firmware - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FWVER |Firmware Version - * | | |Read: Indicates the current firmware version of NVC5. - * | | |Write: Updates the firmware version of NVC5. - * | | |The maximum value of this field is 255. - * | | |Indicating number of 1 in Fuse OTP or number of 0 in Flash - * |[31:16] |WVCODE |Verification Code - * | | |When written, this field must be the current firmware version number - */ - __IO uint32_t CTL; /*!< [0x0000] FVC Control Register */ - __I uint32_t STS; /*!< [0x0004] FVC Status Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t NVC[6]; /*!< [0x0010-0x24] Non-volatile Version Counter Control Register Firmware. NVC[2], NVC[3] is reserved */ -} FVC_T; - -/** - @addtogroup FVC_CONST FVC Bit Field Definition - Constant Definitions for FVC Controller -@{ */ - -#define FVC_CTL_INIT_Pos (0) /*!< FVC_T::CTL: INIT Position */ -#define FVC_CTL_INIT_Msk (0x1ul << FVC_CTL_INIT_Pos) /*!< FVC_T::CTL: INIT Mask */ - -#define FVC_CTL_MONOEN_Pos (1) /*!< FVC_T::CTL: MONOEN Position */ -#define FVC_CTL_MONOEN_Msk (0x1ul << FVC_CTL_MONOEN_Pos) /*!< FVC_T::CTL: MONOEN Mask */ - -#define FVC_CTL_WVCODE_Pos (16) /*!< FVC_T::CTL: WVCODE Position */ -#define FVC_CTL_WVCODE_Msk (0xfffful << FVC_CTL_WVCODE_Pos) /*!< FVC_T::CTL: WVCODE Mask */ - -#define FVC_STS_BUSY_Pos (0) /*!< FVC_T::STS: BUSY Position */ -#define FVC_STS_BUSY_Msk (0x1ul << FVC_STS_BUSY_Pos) /*!< FVC_T::STS: BUSY Mask */ - -#define FVC_STS_RDY_Pos (1) /*!< FVC_T::STS: RDY Position */ -#define FVC_STS_RDY_Msk (0x1ul << FVC_STS_RDY_Pos) /*!< FVC_T::STS: RDY Mask */ - -#define FVC_NVC_FWVER_Pos (0) /*!< FVC_T::NVC: FWVER Position */ -#define FVC_NVC_FWVER_Msk (0xfffful << FVC_NVC_FWVER_Pos) /*!< FVC_T::NVC: FWVER Mask */ - -/**@}*/ /* FVC_CONST */ -/**@}*/ /* end of FVC register group */ - - -/*---------------------- Product Life-cycle Manager -------------------------*/ -/** - @addtogroup PLM Product Life-cycle Manager(PLM) - Memory Mapped Structure for PLM Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var PLM_T::CTL - * Offset: 0x00 Product Life-cycle Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |STAGE |Life-cycle Stage Update Bits - * | | |Bits to update PLM stage. All bits can be set to one but cannot be cleared to zero. - * | | |001 = progress to OEM stage. - * | | |011 = progress to Deployed stage. - * | | |111 = progress to RMA stage. - * | | |Other value will be ignored. - * |[31:16] |WVCODE |Write Verify Code - * | | |The code is 0x475A for a valid write to this register. - * @var PLM_T::STS - * Offset: 0x04 Product Life-cycle Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |STAGE |Life-cycle Stage (Read Only) - * | | |Indicates the current stage of PLM. - * | | |000 = Vendor Stage. - * | | |001 = OEM Stage. - * | | |011 = Deployed Stage. - * | | |111 = RMA Stage. - * | | |Others = ERROR Stage. - * |[8] |DIRTY |DIRTY Bit (Read Only) - * | | |Indicate the life-cycle stage has been progressed after last cold-reset - * | | |Value of STAGE bits is not Current stage of PLM - * | | |It needs a cold reset to make it work. - */ - __IO uint32_t CTL; /*!< [0x0000] Product Life-cycle Control Register */ - __I uint32_t STS; /*!< [0x0004] Product Life-cycle Status Register */ - -} PLM_T; - -/** - @addtogroup PLM_CONST PLM Bit Field Definition - Constant Definitions for PLM Controller - @{ -*/ - -#define PLM_CTL_STAGE_Pos (0) /*!< PLM_T::CTL: STAGE Position */ -#define PLM_CTL_STAGE_Msk (0x7ul << PLM_CTL_STAGE_Pos) /*!< PLM_T::CTL: STAGE Mask */ - -#define PLM_CTL_WVCODE_Pos (16) /*!< PLM_T::CTL: WVCODE Position */ -#define PLM_CTL_WVCODE_Msk (0xfffful << PLM_CTL_WVCODE_Pos) /*!< PLM_T::CTL: WVCODE Mask */ - -#define PLM_STS_STAGE_Pos (0) /*!< PLM_T::STS: STAGE Position */ -#define PLM_STS_STAGE_Msk (0x7ul << PLM_STS_STAGE_Pos) /*!< PLM_T::STS: STAGE Mask */ - -#define PLM_STS_DIRTY_Pos (8) /*!< PLM_T::STS: DIRTY Position */ -#define PLM_STS_DIRTY_Msk (0x1ul << PLM_STS_DIRTY_Pos) /*!< PLM_T::STS: DIRTY Mask */ - -/**@}*/ /* PLM_CONST */ -/**@}*/ /* end of PLM register group */ - - -/*---------------------- Secure configuration Unit -------------------------*/ -/** - @addtogroup SCU Secure configuration Unit(SCU) - Memory Mapped Structure for SCU Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var SCU_T::PNSSET - * Offset: 0x00 Peripheral Non-secure Attribution Set Register0 (0x4000_0000~0x4001_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9] |USBH |Set USBH to Non-secure State - * | | |Write 1 to set USBH to non-secure state. Write 0 has no effect. - * | | |0 = USBH is a secure module (default). - * | | |1 = USBH is a non-secure module. - * |[13] |SDH0 |Set SDH0 to Non-secure State - * | | |Write 1 to set SDH0 to non-secure state. Write 0 has no effect. - * | | |0 = SDH0 is a secure module (default). - * | | |1 = SDH0 is a non-secure module. - * |[16] |EBI |Set EBI to Non-secure State - * | | |Write 1 to set EBI to non-secure state. Write 0 has no effect. - * | | |0 = EBI is a secure module (default). - * | | |1 = EBI is a non-secure module. - * |[24] |PDMA1 |Set PDMA1 to Non-secure State - * | | |Write 1 to set PDMA1 to non-secure state. Write 0 has no effect. - * | | |0 = PDMA1 is a secure module (default). - * | | |1 = PDMA1 is a non-secure module. - * Offset: 0x04 Peripheral Non-secure Attribution Set Register1 (0x4002_0000~0x4003_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17] |CRC |Set CRC to Non-secure State - * | | |Write 1 to set CRC to non-secure state. Write 0 has no effect. - * | | |0 = CRC is a secure module (default). - * | | |1 = CRC is a non-secure module. - * |[18] |CRPT |Set CRPT to Non-secure State - * | | |0 = CRPT is a secure module (default). - * | | |1 = CRPT is a non-secure module. - * Offset: 0x08 Peripheral Non-secure Attribution Set Register2 (0x4004_0000~0x4005_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |EWDT |Set EWDT to Non-secure State - * | | |Write 1 to set EWDT to non-secure state. Write 0 has no effect. - * | | |0 = EWDT is a secure module (default). - * | | |1 = EWDT is a non-secure module. - * |[3] |EADC |Set EADC to Non-secure State - * | | |Write 1 to set EADC to non-secure state. Write 0 has no effect. - * | | |0 = EADC is a secure module (default). - * | | |1 = EADC is a non-secure module. - * |[5] |ACMP01 |Set ACMP01 to Non-secure State - * | | |Write 1 to set ACMP0, ACMP1 to non-secure state. Write 0 has no effect. - * | | |0 = ACMP0, ACMP1 are secure modules (default). - * | | |1 = ACMP0, ACMP1 are non-secure modules. - * |[7] |DAC |Set DAC to Non-secure State - * | | |Write 1 to set DAC to non-secure state. Write 0 has no effect. - * | | |0 = DAC is a secure module (default). - * | | |1 = DAC is a non-secure module. - * |[8] |I2S0 |Set I2S0 to Non-secure State - * | | |Write 1 to set I2S0 to non-secure state. Write 0 has no effect. - * | | |0 = I2S0 is a secure module (default). - * | | |1 = I2S0 is a non-secure module. - * |[13] |OTG |Set OTG to Non-secure State - * | | |Write 1 to set OTG to non-secure state. Write 0 has no effect. - * | | |0 = OTG is a secure module (default). - * | | |1 = OTG is a non-secure module. - * |[17] |TMR23 |Set TMR23 to Non-secure State - * | | |Write 1 to set TMR23 to non-secure state. Write 0 has no effect. - * | | |0 = TMR23 is a secure module (default). - * | | |1 = TMR23 is a non-secure module. - * |[24] |EPWM0 |Set EPWM0 to Non-secure State - * | | |Write 1 to set EPWM0 to non-secure state. Write 0 has no effect. - * | | |0 = EPWM0 is a secure module (default). - * | | |1 = EPWM0 is a non-secure module. - * |[25] |EPWM1 |Set EPWM1 to Non-secure State - * | | |Write 1 to set EPWM1 to non-secure state. Write 0 has no effect. - * | | |0 = EPWM1 is a secure module (default). - * | | |1 = EPWM1 is a non-secure module. - * |[26] |BPWM0 |Set BPWM0 to Non-secure State - * | | |Write 1 to set BPWM0 to non-secure state. Write 0 has no effect. - * | | |0 = BPWM0 is a secure module (default). - * | | |1 = BPWM0 is a non-secure module. - * |[27] |BPWM1 |Set BPWM1 to Non-secure State - * | | |Write 1 to set BPWM1 to non-secure state. Write 0 has no effect. - * | | |0 = BPWM1 is a secure module (default). - * | | |1 = BPWM1 is a non-secure module. - * Offset: 0x0C Peripheral Non-secure Attribution Set Register3 (0x4006_0000~0x4007_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |QSPI0 |Set QSPI0 to Non-secure State - * | | |Write 1 to set QSPI0 to non-secure state. Write 0 has no effect. - * | | |0 = QSPI0 is a secure module (default). - * | | |1 = QSPI0 is a non-secure module. - * |[1] |SPI0 |Set SPI0 to Non-secure State - * | | |Write 1 to set SPI0 to non-secure state. Write 0 has no effect. - * | | |0 = SPI0 is a secure module (default). - * | | |1 = SPI0 is a non-secure module. - * |[2] |SPI1 |Set SPI1 to Non-secure State - * | | |Write 1 to set SPI1 to non-secure state. Write 0 has no effect. - * | | |0 = SPI1 is a secure module (default). - * | | |1 = SPI1 is a non-secure module. - * |[3] |SPI2 |Set SPI2 to Non-secure State - * | | |Write 1 to set SPI2 to non-secure state. Write 0 has no effect. - * | | |0 = SPI2 is a secure module (default). - * | | |1 = SPI2 is a non-secure module. - * |[4] |SPI3 |Set SPI3 to Non-secure State - * | | |Write 1 to set SPI3 to non-secure state. Write 0 has no effect. - * | | |0 = SPI3 is a secure module (default). - * | | |1 = SPI3 is a non-secure module. - * |[16] |UART0 |Set UART0 to Non-secure State - * | | |Write 1 to set UART0 to non-secure state. Write 0 has no effect. - * | | |0 = UART0 is a secure module (default). - * | | |1 = UART0 is a non-secure module. - * |[17] |UART1 |Set UART1 to Non-secure State - * | | |Write 1 to set UART1 to non-secure state. Write 0 has no effect. - * | | |0 = UART1 is a secure module (default). - * | | |1 = UART1 is a non-secure module. - * |[18] |UART2 |Set UART2 to Non-secure State - * | | |Write 1 to set UART2 to non-secure state. Write 0 has no effect. - * | | |0 = UART2 is a secure module (default). - * | | |1 = UART2 is a non-secure module. - * |[19] |UART3 |Set UART3 to Non-secure State - * | | |Write 1 to set UART3 to non-secure state. Write 0 has no effect. - * | | |0 = UART3 is a secure module (default). - * | | |1 = UART3 is a non-secure module. - * |[20] |UART4 |Set UART4 to Non-secure State - * | | |Write 1 to set UART4 to non-secure state. Write 0 has no effect. - * | | |0 = UART4 is a secure module (default). - * | | |1 = UART4 is a non-secure module. - * |[21] |UART5 |Set UART5 to Non-secure State - * | | |Write 1 to set UART5 to non-secure state. Write 0 has no effect. - * | | |0 = UART5 is a secure module (default). - * | | |1 = UART5 is a non-secure module. - * Offset: 0x10 Peripheral Non-secure Attribution Set Register4 (0x4008_0000~0x4009_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2C0 |Set I2C0 to Non-secure State - * | | |Write 1 to set I2C0 to non-secure state. Write 0 has no effect. - * | | |0 = I2C0 is a secure module (default). - * | | |1 = I2C0 is a non-secure module. - * |[1] |I2C1 |Set I2C1 to Non-secure State - * | | |Write 1 to set I2C1 to non-secure state. Write 0 has no effect. - * | | |0 = I2C1 is a secure module (default). - * | | |1 = I2C1 is a non-secure module. - * |[2] |I2C2 |Set I2C2 to Non-secure State - * | | |Write 1 to set I2C2 to non-secure state. Write 0 has no effect. - * | | |0 = I2C2 is a secure module (default). - * | | |1 = I2C2 is a non-secure module. - * |[16] |SC0 |Set SC0 to Non-secure State - * | | |Write 1 to set SC0 to non-secure state. Write 0 has no effect. - * | | |0 = SC0 is a secure module (default). - * | | |1 = SC0 is a non-secure module. - * |[17] |SC1 |Set SC1 to Non-secure State - * | | |Write 1 to set SC1 to non-secure state. Write 0 has no effect. - * | | |0 = SC1 is a secure module (default). - * | | |1 = SC1 is a non-secure module. - * |[18] |SC2 |Set SC2 to Non-secure State - * | | |Write 1 to set SC2 to non-secure state. Write 0 has no effect. - * | | |0 = SC2 is a secure module (default). - * | | |1 = SC2 is a non-secure module. - * Offset: 0x14 Peripheral Non-secure Attribution Set Register5 (0x400A_0000~0x400B_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAN0 |Set CAN0 to Non-secure State - * | | |Write 1 to set CAN0 to non-secure state. Write 0 has no effect. - * | | |0 = CAN0 is a secure module (default). - * | | |1 = CAN0 is a non-secure module. - * |[16] |QEI0 |Set QEI0 to Non-secure State - * | | |Write 1 to set QEI0 to non-secure state. Write 0 has no effect. - * | | |0 = QEI0 is a secure module (default). - * | | |1 = QEI0 is a non-secure module. - * |[17] |QEI1 |Set QEI1 to Non-secure State - * | | |Write 1 to set QEI1 to non-secure state. Write 0 has no effect. - * | | |0 = QEI1 is a secure module (default). - * | | |1 = QEI1 is a non-secure module. - * |[20] |ECAP0 |Set ECAP0 to Non-secure State - * | | |Write 1 to set ECAP0 to non-secure state. Write 0 has no effect. - * | | |0 = ECAP0 is a secure module (default). - * | | |1 = ECAP0 is a non-secure module. - * |[21] |ECAP1 |Set ECAP1 to Non-secure State - * | | |Write 1 to set ECAP1 to non-secure state. Write 0 has no effect. - * | | |0 = ECAP1 is a secure module (default). - * | | |1 = ECAP1 is a non-secure module. - * |[25] |TRNG |Set TRNG to Non-secure State - * | | |Write 1 to set TRNG to non-secure state. Write 0 has no effect. - * | | |0 = TRNG is a secure module (default). - * | | |1 = TRNG is a non-secure module. - * |[27] |LCD |Set LCD to Non-secure State - * | | |Write 1 to set LCD to non-secure state. Write 0 has no effect. - * | | |0 = LCD is a secure module (default). - * | | |1 = LCD is a non-secure module. - * Offset: 0x18 Peripheral Non-secure Attribution Set Register6 (0x400C_0000~0x400D_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBD |Set USBD to Non-secure State - * | | |Write 1 to set USBD to non-secure state. Write 0 has no effect. - * | | |0 = USBD is a secure module (default). - * | | |1 = USBD is a non-secure module. - * |[16] |USCI0 |Set USCI0 to Non-secure State - * | | |Write 1 to set USCI0 to non-secure state. Write 0 has no effect. - * | | |0 = USCI0 is a secure module (default). - * | | |1 = USCI0 is a non-secure module. - * |[17] |USCI1 |Set USCI1 to Non-secure State - * | | |Write 1 to set USCI1 to non-secure state. Write 0 has no effect. - * | | |0 = USCI1 is a secure module (default). - * | | |1 = USCI1 is a non-secure module. - * @var SCU_T::IONSSET - * Offset: 0x20 IO Non-secure Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PA |Set GPIO Port a to Non-scecure State - * | | |Write 1 to set PA to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port A is secure (default). - * | | |1 = GPIO port A is non-secure. - * |[1] |PB |Set GPIO Port B to Non-scecure State - * | | |Write 1 to set PB to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port B is secure (default). - * | | |1 = GPIO port B is non-secure. - * |[2] |PC |Set GPIO Port C to Non-scecure State - * | | |Write 1 to set PC to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port C is secure (default). - * | | |1 = GPIO port C is non-secure. - * |[3] |PD |Set GPIO Port D to Non-scecure State - * | | |Write 1 to set PD to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port D is secure (default). - * | | |1 = GPIO port D is non-secure. - * |[4] |PE |Set GPIO Port E to Non-scecure State - * | | |Write 1 to set PE to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port E is secure (default). - * | | |1 = GPIO port E is non-secure. - * |[5] |PF |Set GPIO Port F to Non-scecure State - * | | |Write 1 to set PF to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port F is secure (default). - * | | |1 = GPIO port F is non-secure. - * |[6] |PG |Set GPIO Port G to Non-scecure State - * | | |Write 1 to set PG to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port G is secure (default). - * | | |1 = GPIO port G is non-secure. - * |[7] |PH |Set GPIO Port H to Non-scecure State - * | | |Write 1 to set PH to non-secure state. Write 0 has no effect. - * | | |0 = GPIO port H is secure (default). - * | | |1 = GPIO port H is non-secure. - * @var SCU_T::SRAMNSSET - * Offset: 0x24 SRAM Non-secure Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |SECn |Set SRAM Section n to Non-scecure State - * | | |Write 1 to set SRAM section n to non-secure state. Write 0 is ignored. - * | | |0 = SRAM Section n is secure (default). - * | | |1 = SRAM Section n is non-secure. - * | | |Size per section is 16 Kbytes. - * | | |Secure SRAM section n is 0x2000_0000+0x4000*n to 0x2000_0000+0x4000*(n+1)-0x1 - * | | |Non-secure SRAM section n is 0x3000_0000+0x4000*n to 0x3000_0000+0x4000*(n+1)-0x1 - * @var SCU_T::FNSADDR - * Offset: 0x28 Flash Non-secure Boundary Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FNSADDR |Flash Non-secure Boundary Address - * | | |Indicate the base address of Non-secure region set in user configuration - * | | |Refer to FMC section for more details. - * @var SCU_T::SVIOIEN - * Offset: 0x2C Security Violation Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APB0IEN |APB0 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of APB0 Disabled. - * | | |1 = Interrupt triggered from security violation of APB0 Enabled. - * |[1] |APB1IEN |APB1 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of APB1 Disabled. - * | | |1 = Interrupt triggered from security violation of APB1 Enabled. - * |[4] |GPIOIEN |GPIO Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of GPIO Disabled. - * | | |1 = Interrupt triggered from security violation of GPIO Enabled. - * |[5] |EBIIEN |EBI Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of EBI Disabled. - * | | |1 = Interrupt triggered from security violation of EBI Enabled. - * |[6] |USBHIEN |USBH Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of USB host Disabled. - * | | |1 = Interrupt triggered from security violation of USB host Enabled. - * |[7] |CRCIEN |CRC Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of CRC Disabled. - * | | |1 = Interrupt triggered from security violation of CRC Enabled. - * |[8] |SDH0IEN |SDH0 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of SD host 0 Disabled. - * | | |1 = Interrupt triggered from security violation of SD host 0 Enabled. - * |[10] |PDMA0IEN |PDMA0 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of PDMA0 Disabled. - * | | |1 = Interrupt triggered from security violation of PDMA0 Enabled. - * |[11] |PDMA1IEN |PDMA1 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of PDMA1 Disabled. - * | | |1 = Interrupt triggered from security violation of PDMA1 Enabled. - * |[12] |SRAM0IEN |SRAM Bank 0 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of SRAM bank0 Disabled. - * | | |1 = Interrupt triggered from security violation of SRAM bank0 Enabled. - * |[13] |SRAM1IEN |SRAM Bank 1 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of SRAM bank1 Disabled. - * | | |1 = Interrupt triggered from security violation of SRAM bank1 Enabled. - * |[14] |FMCIEN |FMC Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of FMC Disabled. - * | | |1 = Interrupt triggered from security violation of FMC Enabled. - * |[15] |FLASHIEN |FLASH Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of Flash data Disabled. - * | | |1 = Interrupt triggered from security violation of Flash data Enabled. - * |[16] |SCUIEN |SCU Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of SCU Disabled. - * | | |1 = Interrupt triggered from security violation of SCU Enabled. - * |[17] |SYSIEN |SYS Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of system manager Disabled. - * | | |1 = Interrupt triggered from security violation of system manager Enabled. - * |[18] |CRPTIEN |CRPT Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of crypto Disabled. - * | | |1 = Interrupt triggered from security violation of crypto Enabled. - * |[19] |KSIEN |KS Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of keystore Disabled. - * | | |1 = Interrupt triggered from security violation of keystore Enabled. - * @var SCU_T::SVINTSTS - * Offset: 0x30 Security Violation Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APB0IF |APB0 Security Violation Interrupt Status - * | | |0 = No APB0 violation interrupt event. - * | | |1 = There is APB0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[1] |APB1IF |APB1 Security Violation Interrupt Status - * | | |0 = No APB1 violation interrupt event. - * | | |1 = There is APB1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[4] |GPIOIF |GPIO Security Violation Interrupt Status - * | | |0 = No GPIO violation interrupt event. - * | | |1 = There is GPIO violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[5] |EBIIF |EBI Security Violation Interrupt Status - * | | |0 = No EBI violation interrupt event. - * | | |1 = There is EBI violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[6] |USBHIF |USBH Security Violation Interrupt Status - * | | |0 = No USBH violation interrupt event. - * | | |1 = There is USBH violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[7] |CRCIF |CRC Security Violation Interrupt Status - * | | |0 = No CRC violation interrupt event. - * | | |1 = There is CRC violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[8] |SDH0IF |SDH0 Security Violation Interrupt Status - * | | |0 = No SDH0 violation interrupt event. - * | | |1 = There is SDH0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[10] |PDMA0IF |PDMA0 Security Violation Interrupt Status - * | | |0 = No PDMA0 violation interrupt event. - * | | |1 = There is PDMA0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[11] |PDMA1IF |PDMA1 Security Violation Interrupt Status - * | | |0 = No PDMA1 violation interrupt event. - * | | |1 = There is PDMA1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[12] |SRAM0IF |SRAM0 Security Violation Interrupt Status - * | | |0 = No SRAM0 violation interrupt event. - * | | |1 = There is SRAM0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[13] |SRAM1IF |SRAM Bank 1 Security Violation Interrupt Status - * | | |0 = No SRAM1 violation interrupt event. - * | | |1 = There is SRAM1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[14] |FMCIF |FMC Security Violation Interrupt Status - * | | |0 = No FMC violation interrupt event. - * | | |1 = There is FMC violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[15] |FLASHIF |FLASH Security Violation Interrupt Status - * | | |0 = No FLASH violation interrupt event. - * | | |1 = There is FLASH violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[16] |SCUIF |SCU Security Violation Interrupt Status - * | | |0 = No SCU violation interrupt event. - * | | |1 = There is SCU violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[17] |SYSIF |SYS Security Violation Interrupt Status - * | | |0 = No SYS violation interrupt event. - * | | |1 = There is SYS violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[18] |CRPTIF |CRPT Security Violation Interrupt Status - * | | |0 = No CRPT violation interrupt event. - * | | |1 = There is CRPT violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[19] |KSIF |KS Security Violation Interrupt Status - * | | |0 = No KS violation interrupt event. - * | | |1 = There is KS violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * @var SCU_T::APB0VSRC - * Offset: 0x34 APB0 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::APB0VA - * Offset: 0x38 APB0 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::APB1VSRC - * Offset: 0x3C APB1 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::APB1VA - * Offset: 0x40 APB1 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::GPIOVSRC - * Offset: 0x44 GPIO Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::GPIOVA - * Offset: 0x48 GPIO Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::EBIVSRC - * Offset: 0x4C EBI Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::EBIVA - * Offset: 0x50 EBI Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::USBHVSRC - * Offset: 0x54 USBH Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::USBHVA - * Offset: 0x58 USBH Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::CRCVSRC - * Offset: 0x5C CRC Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::CRCVA - * Offset: 0x60 CRC Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::SD0VSRC - * Offset: 0x64 SDH0 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::SD0VA - * Offset: 0x68 SDH0 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::PDMA0VSRC - * Offset: 0x74 PDMA0 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::PDMA0VA - * Offset: 0x78 PDMA0 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::PDMA1VSRC - * Offset: 0x7C PDMA1 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::PDMA1VA - * Offset: 0x80 PDMA1 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::SRAM0VSRC - * Offset: 0x84 SRAM0 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::SRAM0VA - * Offset: 0x88 SRAM0 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::SRAM1VSRC - * Offset: 0x8C SRAM1 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::SRAM1VA - * Offset: 0x90 SRAM1 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::FMCVSRC - * Offset: 0x94 FMC Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::FMCVA - * Offset: 0x98 FMC Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::FLASHVSRC - * Offset: 0x9C Flash Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::FLASHVA - * Offset: 0xA0 Flash Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::SCUVSRC - * Offset: 0xA4 SCU Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::SCUVA - * Offset: 0xA8 SCU Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::SYSVSRC - * Offset: 0xAC System(GMISC) Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::SYSVA - * Offset: 0xB0 System(GMISC) Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::CRPTVSRC - * Offset: 0xB4 Crypto Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::CRPTVA - * Offset: 0xB8 Crypto Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::KSVSRC - * Offset: 0xBC KS Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::KSVA - * Offset: 0xC0 KS Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::SRAM2VSRC - * Offset: 0xC4 SRAM2 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = core processor. - * | | |0x3 = PDMA0. - * | | |0x4 = SDH0. - * | | |0x5 = CRYPTO. - * | | |0x6 = USH. - * | | |0xB = PDMA1. - * | | |Others is undefined. - * @var SCU_T::SRAM2VA - * Offset: 0xC8 SRAM2 Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SCU_T::SINFAEN - * Offset: 0xF0 Shared Information Access Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SCUSIAEN |SCU Shared Information Access Enable Bit - * | | |0 = Non-secure CPU access SCU Shared information Disabled. - * | | |1 = Non-secure CPU access SCU Shared information Enabled. - * |[1] |SYSSIAEN |SYS Shared Information Access Enable Bit - * | | |0 = Non-secure CPU access SYS Shared information Disabled. - * | | |1 = Non-secure CPU access SYS Shared information Enabled. - * | | |Note:Include clock information. - * |[2] |FMCSIAEN |FMC Shared Information Access Enable Bit - * | | |0 = Non-secure CPU access FMC Shared information Disabled. - * | | |1 = Non-secure CPU access FMC Shared information Enabled. - * @var SCU_T::PNPSET - * Offset: 0x100 Peripheral Non-privileged Attribution Set Register0 (0x4000_0000~0x4001_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYS |Set SYS to Non-privileged State - * | | |0 = SYS is a privileged module (default). - * | | |1 = SYS is a non-privileged module. - * |[8] |PDMA0 |Set PDMA0 to Non-privileged State - * | | |0 = PDMA0 is a privileged module (default). - * | | |1 = PDMA0 is a non-privileged module. - * |[9] |USBH |Set USBH to Non-privileged State - * | | |0 = USBH is a privileged module (default). - * | | |1 = USBH is a non-privileged module. - * |[12] |FMC |Set FMC to Non-privileged State - * | | |0 = FMC is a privileged module (default). - * | | |1 = FMC is a non-privileged module. - * |[13] |SDH0 |Set SDH0 to Non-privileged State - * | | |0 = SDH0 is a privileged module (default). - * | | |1 = SDH0 is a non-privileged module. - * |[16] |EBI |Set EBI to Non-privileged State - * | | |0 = EBI is a privileged module (default). - * | | |1 = EBI is a non-privileged module. - * |[24] |PDMA1 |Set PDMA1 to Non-privileged State - * | | |0 = PDMA1 is a privileged module (default). - * | | |1 = PDMA1 is a non-privileged module. - * Offset: 0x104 Peripheral Non-privileged Attribution Set Register1 (0x4002_0000~0x4003_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15] |SCU |Set SCU to Non-privileged State - * | | |0 = SCU is a privileged module (default). - * | | |1 = SCU is a non-privileged module. - * |[17] |CRC |Set CRC to Non-privileged State - * | | |0 = CRC is a privileged module (default). - * | | |1 = CRC is a non-privileged module. - * |[18] |CRPT |Set CRPT to Non-privileged State - * | | |0 = CRPT is a privileged module (default). - * | | |1 = CRPT is a non-privileged module. - * |[21] |KS |Set KS to Non-privileged State - * | | |0 = KS is a privileged module (default). - * | | |1 = KS is a non-privileged module. - * Offset: 0x108 Peripheral Non-privileged Attribution Set Register2 (0x4004_0000~0x4005_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDT |Set WDT to Non-privileged State - * | | |0 = WDT is a privileged module (default). - * | | |1 = WDT is a non-privileged module. - * |[1] |RTC |Set RTC to Non-privileged State - * | | |0 = RTC is a privileged module (default). - * | | |1 = RTC is a non-privileged module. - * |[2] |EWDT |Set EWDT to Non-privileged State - * | | |0 = EWDT is a privileged module (default). - * | | |1 = EWDT is a non-privileged module. - * |[3] |EADC |Set EADC to Non-privileged State - * | | |0 = EADC is a privileged module (default). - * | | |1 = EADC is a non-privileged module. - * |[5] |ACMP01 |Set ACMP01 to Non-privileged State - * | | |0 = ACMP0, ACMP1 are privileged modules (default). - * | | |1 = ACMP0, ACMP1 are non-privileged modules. - * |[7] |DAC |Set DAC to Non-privileged State - * | | |0 = DAC is a privileged module (default). - * | | |1 = DAC is a non-privileged module. - * |[8] |I2S0 |Set I2S0 to Non-privileged State - * | | |0 = I2S0 is a privileged module (default). - * | | |1 = I2S0 is a non-privileged module. - * |[13] |OTG |Set OTG to Non-privileged State - * | | |0 = OTG is a privileged module (default). - * | | |1 = OTG is a non-privileged module. - * |[16:14] |TMR01 |Set TMR01 to Non-privileged State - * | | |0 = TMR01 is a privileged module (default). - * | | |1 = TMR01 is a non-privileged module. - * |[17] |TMR23 |Set TMR23 to Non-privileged State - * | | |0 = TMR23 is a privileged module (default). - * | | |1 = TMR23 is a non-privileged module. - * |[24] |EPWM0 |Set EPWM0 to Non-privileged State - * | | |0 = EPWM0 is a privileged module (default). - * | | |1 = EPWM0 is a non-privileged module. - * |[25] |EPWM1 |Set EPWM1 to Non-privileged State - * | | |0 = EPWM1 is a privileged module (default). - * | | |1 = EPWM1 is a non-privileged module. - * |[26] |BPWM0 |Set BPWM0 to Non-privileged State - * | | |0 = BPWM0 is a privileged module (default). - * | | |1 = BPWM0 is a non-privileged module. - * |[27] |BPWM1 |Set BPWM1 to Non-privileged State - * | | |0 = BPWM1 is a privileged module (default). - * | | |1 = BPWM1 is a non-privileged module. - * Offset: 0x10C Peripheral Non-privileged Attribution Set Register3 (0x4006_0000~0x4007_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |QSPI0 |Set QSPI0 to Non-privileged State - * | | |0 = QSPI0 is a privileged module (default). - * | | |1 = QSPI0 is a non-privileged module. - * |[1] |SPI0 |Set SPI0 to Non-privileged State - * | | |0 = SPI0 is a privileged module (default). - * | | |1 = SPI0 is a non-privileged module. - * |[2] |SPI1 |Set SPI1 to Non-privileged State - * | | |0 = SPI1 is a privileged module (default). - * | | |1 = SPI1 is a non-privileged module. - * |[3] |SPI2 |Set SPI2 to Non-privileged State - * | | |0 = SPI2 is a privileged module (default). - * | | |1 = SPI2 is a non-privileged module. - * |[4] |SPI3 |Set SPI3 to Non-privileged State - * | | |0 = SPI3 is a privileged module (default). - * | | |1 = SPI3 is a non-privileged module. - * |[16] |UART0 |Set UART0 to Non-privileged State - * | | |0 = UART0 is a privileged module (default). - * | | |1 = UART0 is a non-privileged module. - * |[17] |UART1 |Set UART1 to Non-privileged State - * | | |0 = UART1 is a privileged module (default). - * | | |1 = UART1 is a non-privileged module. - * |[18] |UART2 |Set UART2 to Non-privileged State - * | | |0 = UART2 is a privileged module (default). - * | | |1 = UART2 is a non-privileged module. - * |[19] |UART3 |Set UART3 to Non-privileged State - * | | |0 = UART3 is a privileged module (default). - * | | |1 = UART3 is a non-privileged module. - * |[20] |UART4 |Set UART4 to Non-privileged State - * | | |0 = UART4 is a privileged module (default). - * | | |1 = UART4 is a non-privileged module. - * |[21] |UART5 |Set UART5 to Non-privileged State - * | | |0 = UART5 is a privileged module (default). - * | | |1 = UART5 is a non-privileged module. - * Offset: 0x110 Peripheral Non-privileged Attribution Set Register4 (0x4008_0000~0x4009_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2C0 |Set I2C0 to Non-privileged State - * | | |0 = I2C0 is a privileged module (default). - * | | |1 = I2C0 is a non-privileged module. - * |[1] |I2C1 |Set I2C1 to Non-privileged State - * | | |0 = I2C1 is a privileged module (default). - * | | |1 = I2C1 is a non-privileged module. - * |[2] |I2C2 |Set I2C2 to Non-privileged State - * | | |0 = I2C2 is a privileged module (default). - * | | |1 = I2C2 is a non-privileged module. - * |[16] |SC0 |Set SC0 to Non-privileged State - * | | |0 = SC0 is a privileged module (default). - * | | |1 = SC0 is a non-privileged module. - * |[17] |SC1 |Set SC1 to Non-privileged State - * | | |0 = SC1 is a privileged module (default). - * | | |1 = SC1 is a non-privileged module. - * |[18] |SC2 |Set SC2 to Non-privileged State - * | | |0 = SC2 is a privileged module (default). - * | | |1 = SC2 is a non-privileged module. - * Offset: 0x114 Peripheral Non-privileged Attribution Set Register5 (0x400A_0000~0x400B_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAN0 |Set CAN0 to Non-privileged State - * | | |0 = CAN0 is a privileged module (default). - * | | |1 = CAN0 is a non-privileged module. - * |[16] |QEI0 |Set QEI0 to Non-privileged State - * | | |0 = QEI0 is a privileged module (default). - * | | |1 = QEI0 is a non-privileged module. - * |[17] |QEI1 |Set QEI1 to Non-privileged State - * | | |0 = QEI1 is a privileged module (default). - * | | |1 = QEI1 is a non-privileged module. - * |[20] |ECAP0 |Set ECAP0 to Non-privileged State - * | | |0 = ECAP0 is a privileged module (default). - * | | |1 = ECAP0 is a non-privileged module. - * |[21] |ECAP1 |Set ECAP1 to Non-privileged State - * | | |0 = ECAP1 is a privileged module (default). - * | | |1 = ECAP1 is a non-privileged module. - * |[25] |TRNG |Set TRNG to Non-privileged State - * | | |0 = TRNG is a privileged module (default). - * | | |1 = TRNG is a non-privileged module. - * |[27] |LCD |Set LCD to Non-privileged State - * | | |0 = LCD is a privileged module (default). - * | | |1 = LCD is a non-privileged module. - * |[29] |TAMPER |Set TAMPER to Non-privileged State - * | | |0 = TAMPER is a privileged module (default). - * | | |1 = TAMPER is a non-privileged module. - * Offset: 0x118 Peripheral Non-privileged Attribution Set Register6 (0x400C_0000~0x400D_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBD |Set USBD to Non-privileged State - * | | |0 = USBD is a privileged module (default). - * | | |1 = USBD is a non-privileged module. - * |[16] |USCI0 |Set USCI0 to Non-privileged State - * | | |0 = USCI0 is a privileged module (default). - * | | |1 = USCI0 is a non-privileged module. - * |[17] |USCI1 |Set USCI1 to Non-privileged State - * | | |0 = USCI1 is a privileged module (default). - * | | |1 = USCI1 is a non-privileged module. - * @var SCU_T::IONPSET - * Offset: 0x120 IO Non-privileged Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PA |Set GPIO Port a to Non-privileged State - * | | |0 = GPIO port A is privileged (default). - * | | |1 = GPIO port A is non-privileged. - * |[1] |PB |Set GPIO Port B to Non-privileged State - * | | |0 = GPIO port B is privileged (default). - * | | |1 = GPIO port B is non-privileged. - * |[2] |PC |Set GPIO Port C to Non-privileged State - * | | |0 = GPIO port C is privileged (default). - * | | |1 = GPIO port C is non-privileged. - * |[3] |PD |Set GPIO Port D to Non-privileged State - * | | |0 = GPIO port D is privileged (default). - * | | |1 = GPIO port D is non-privileged. - * |[4] |PE |Set GPIO Port E to Nonj-privileged State - * | | |0 = GPIO port E is privileged (default). - * | | |1 = GPIO port E is non-privileged. - * |[5] |PF |Set GPIO Port F to Non-privileged State - * | | |0 = GPIO port F is privileged (default). - * | | |1 = GPIO port F is non-privileged. - * |[6] |PG |Set GPIO Port G to Non-privileged State - * | | |0 = GPIO port G is privileged (default). - * | | |1 = GPIO port G is non-privileged. - * |[7] |PH |Set GPIO Port H to Non-privileged State - * | | |0 = GPIO port H is privileged (default). - * | | |1 = GPIO port H is non-privileged. - * @var SCU_T::SRAMNPSET - * Offset: 0x124 SRAM Non-privileged Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[19:0] |SECn |Set SRAM Section n to Non-privileged State - * | | |0 = SRAM Section n is privileged (default). - * | | |1 = SRAM Section n is non-privileged. - * | | |Size per section is 16 Kbytes. - * | | |Secure SRAM section n is 0x2000_0000+0x4000*n to 0x2000_0000+0x4000*(n+1)-0x1 - * | | |Non-secure SRAM section n is 0x3000_0000+0x4000*n to 0x3000_0000+0x4000*(n+1)-0x1 - * @var SCU_T::MEMNPSET - * Offset: 0x128 Other Memory Non-privileged Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FLASH |Set Flash to Non-privileged State - * | | |Set the privileged state of memory ranging from 0x0000_0000 to 0x1FFF_FFFF. - * | | |0 = Flash is setting to privileged (default). - * | | |1 = Flash is setting to non-privileged. - * |[1] |EXTMEM |Set External Memory (EBI Memory) to Non-privileged State - * | | |Set the privileged state of memory ranging from 0x6000_0000 to 0x7FFF_FFFF. - * | | |0 = External Memory is setting to privileged (default). - * | | |1 = External Memory is setting to non-privileged. - * @var SCU_T::PVIOIEN - * Offset: 0x12C Privileged Violation Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APB0IEN |APB0 Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of APB0 Disabled. - * | | |1 = Interrupt triggered from privileged violation of APB0 Enabled. - * |[1] |APB1IEN |APB1 Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of APB1 Disabled. - * | | |1 = Interrupt triggered from privileged violation of APB1 Enabled. - * |[4] |GPIOIEN |GPIO Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of GPIO Disabled. - * | | |1 = Interrupt triggered from privileged violation of GPIO Enabled. - * |[5] |EBIIEN |EBI Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of EBI Disabled. - * | | |1 = Interrupt triggered from privileged violation of EBI Enabled. - * |[6] |USBHIEN |USBH Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of USB host Disabled. - * | | |1 = Interrupt triggered from privileged violation of USB host Enabled. - * |[7] |CRCIEN |CRC Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of CRC Disabled. - * | | |1 = Interrupt triggered from privileged violation of CRC Enabled. - * |[8] |SDH0IEN |SDH0 Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of SD host 0 Disabled. - * | | |1 = Interrupt triggered from privileged violation of SD host 0 Enabled. - * |[10] |PDMA0IEN |PDMA0 Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of PDMA0 Disabled. - * | | |1 = Interrupt triggered from privileged violation of PDMA0 Enabled. - * |[11] |PDMA1IEN |PDMA1 Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of PDMA1 Disabled. - * | | |1 = Interrupt triggered from privileged violation of PDMA1 Enabled. - * |[12] |SRAM0IEN |SRAM Bank 0 Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of SRAM bank0 Disabled. - * | | |1 = Interrupt triggered from privileged violation of SRAM bank0 Enabled. - * |[13] |SRAM1IEN |SRAM Bank 1 Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of SRAM bank1 Disabled. - * | | |1 = Interrupt triggered from privileged violation of SRAM bank1 Enabled. - * |[14] |FMCIEN |FMC Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of FMC Disabled. - * | | |1 = Interrupt triggered from privileged violation of FMC Enabled. - * |[15] |FLASHIEN |FLASH Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of Flash data Disabled. - * | | |1 = Interrupt triggered from privileged violation of Flash data Enabled. - * |[16] |SCUIEN |SCU Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of SCU Disabled. - * | | |1 = Interrupt triggered from privileged violation of SCU Enabled. - * |[17] |SYSIEN |SYS Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of system manager Disabled. - * | | |1 = Interrupt triggered from privileged violation of system manager Enabled. - * |[18] |CRPTIEN |CRPT Privileged Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from privileged violation of crypto Disabled. - * | | |1 = Interrupt triggered from privileged violation of crypto Enabled. - * |[19] |KSIEN |KS Privileged Violation Interrupt Enale Bit - * | | |0 = Interrupt triggered from privileged violation of keystore Disabled. - * | | |1 = Interrupt triggered from privileged violation of keystore Enabled. - * @var SCU_T::PVINTSTS - * Offset: 0x130 Privileged Violation Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APB0IF |APB0 Privileged Violation Interrupt Status - * | | |0 = No APB0 violation interrupt event. - * | | |1 = There is APB0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[1] |APB1IF |APB1 Privileged Violation Interrupt Status - * | | |0 = No APB1 violation interrupt event. - * | | |1 = There is APB1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[4] |GPIOIF |GPIO Privileged Violation Interrupt Status - * | | |0 = No GPIO violation interrupt event. - * | | |1 = There is GPIO violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[5] |EBIIF |EBI Privileged Violation Interrupt Status - * | | |0 = No EBI violation interrupt event. - * | | |1 = There is EBI violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[6] |USBHIF |USBH Privileged Violation Interrupt Status - * | | |0 = No USBH violation interrupt event. - * | | |1 = There is USBH violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[7] |CRCIF |CRC Privileged Violation Interrupt Status - * | | |0 = No CRC violation interrupt event. - * | | |1 = There is CRC violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[8] |SDH0IF |SDH0 Privileged Violation Interrupt Status - * | | |0 = No SDH0 violation interrupt event. - * | | |1 = There is SDH0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[10] |PDMA0IF |PDMA0 Privileged Violation Interrupt Status - * | | |0 = No PDMA0 violation interrupt event. - * | | |1 = There is PDMA0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[11] |PDMA1IF |PDMA1 Privileged Violation Interrupt Status - * | | |0 = No PDMA1 violation interrupt event. - * | | |1 = There is PDMA1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[12] |SRAM0IF |SRAM0 Privileged Violation Interrupt Status - * | | |0 = No SRAM0 violation interrupt event. - * | | |1 = There is SRAM0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[13] |SRAM1IF |SRAM Bank 1 Privileged Violation Interrupt Status - * | | |0 = No SRAM1 violation interrupt event. - * | | |1 = There is SRAM1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[14] |FMCIF |FMC Privileged Violation Interrupt Status - * | | |0 = No FMC violation interrupt event. - * | | |1 = There is FMC violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[15] |FLASHIF |FLASH Privileged Violation Interrupt Status - * | | |0 = No FLASH violation interrupt event. - * | | |1 = There is FLASH violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[16] |SCUIF |SCU Privileged Violation Interrupt Status - * | | |0 = No SCU violation interrupt event. - * | | |1 = There is SCU violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[17] |SYSIF |SYS Privileged Violation Interrupt Status - * | | |0 = No SYS violation interrupt event. - * | | |1 = There is SYS violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[18] |CRPTIF |CRPT Privileged Violation Interrupt Status - * | | |0 = No CRPT violation interrupt event. - * | | |1 = There is CRPT violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[19] |KSIF |KS Privileged Violation Interrupt Status - * | | |0 = No KS violation interrupt event. - * | | |1 = There is KS violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * @var SCU_T::NSMCTL - * Offset: 0x200 Non-secure State Monitor Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PRESCALE |Pre-scale Value of Non-secure State Monitor Counter - * | | |0 = Counter Disabled. - * | | |Others = Counter Enabled and the counter clock source = HCLK/PRESCALE. - * |[8] |NSMIEN |Non-secure State Monitor Interrupt Enable Bit - * | | |0 = Non-secure state monitor interrupt Disabled. - * | | |1 = Non-secure state monitor interrupt Enabled. - * |[9] |AUTORLD |Auto Reload Non-secure State Monitor Counter When CURRNS Changing to 1 - * | | |0 = Disable clearing non-secure state monitor counter automtically (default). - * | | |1 = Enable clearing non-secure state monitor counter automatically when the core processor changes from secure state to non-secure state - * | | |(i.e.when CURRNS chagned from 0 to 1). - * |[10] |TMRMOD |Non-secure Monitor Mode Enable Bit - * | | |0 = Monitor mode. The counter will count down when the core processor is in non-secure state. (default) - * | | |1 = Free-counting mode - * | | |The counter will keep counting no mater the core processor is in secure or non-secure state. - * |[12] |IDLEON |Monitor Counter Keep Counting When the Chip Is in Idle Mode Enable Bit - * | | |0 = The counter will be halted when the chip is in idle mode. - * | | |1 = The counter will keep counting when the chip is in idle mode. (default) - * | | |Note: In monitor mode, the counter is always halted when the core processor is in secure state. - * |[13] |DBGON |Monitor Counter Keep Counting When the Chip Is in Debug Mode Enable Bit - * | | |0 = The counter will be halted when the core processor is halted by ICE. (default) - * | | |1 = The counter will keep counting when the core processor is halted by ICE. - * @var SCU_T::NSMLOAD - * Offset: 0x204 Non-secure State Monitor Reload Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |RELOAD |Reload Value for Non-secure State Monitor Counter - * | | |The RELOAD value will be reloaded to the counter whenever the counter counts down to 0. - * @var SCU_T::NSMVAL - * Offset: 0x208 Non-secure State Monitor Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |VALUE |Counter Value of Non-secure State Monitor Counter - * | | |Current value of non-secure state monitor counter - * | | |This is down counter and counts down only when CURRNS = 1 - * | | |When counting down to 0, VALUE will automatically be reloaded from NSMLOAD register. - * | | |A write of any value clears the VALUE to 0 and also clears NSMIF. - * @var SCU_T::NSMSTS - * Offset: 0x20C Non-secure State Monitor Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CURRNS |Current Core Processor Secure/Non-secure State (Read Only) - * | | |0 = Core processor is in secure state. - * | | |1 = Core processor is in non-secure state. - * | | |Note: This bit can be used to monitor the current secure/non-secure state of the core processor, even if the non-secure state monitor counter is disabled. - * |[1] |NSMIF |Non-secure State Monitor Interrupt Flag - * | | |0 = Counter doesnu2019t count down to 0 since the last NSMIF has been cleared. - * | | |1 = Counter counts down to 0. - * | | |Note: This bit is cleared by writing 1. - * @var SCU_T::BBE - * Offset: 0x300 Block Bus Error Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BBEEN |Block Bus-error Enable Bit - * | | |0 = Disable Blocking Bus Error to the core processor. - * | | |1 = Enable Blocking Bus Error to the core processor. - * | | |This bit is double write-protected, WRVERY and SYS_REGLCTL register. - * |[31:8] |WVERY |Write Verify Code - * | | |In order to write BBEEN bit, the code should be set as 0x59475A. - * | | |When read access, the return value of this field is always 0. - * @var SCU_T::IDAUANS - * Offset: 0x304 IDAU All Non-secure Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IDAUANSEN |IDAU All Non-secure Enable Bit - * | | |0 = Disable IDAU sets all region Non-secure. - * | | |1 = Enable IDAU sets all region Non-secure. - * | | |This bit is double write-protected, WRVERY and SYS_REGLCTL register. - * |[31:8] |WVERY |Write Verify Code - * | | |In order to write BBEEN bit, the code should be set as 0x59475A. - * | | |When read access, the return value of this field is always 0. - * @var SCU_T::VERSION - * Offset: 0xFFC SCU RTL Design Version Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MINOR |SCU RTL Design Minor Version - * | | |Minor version number is dependent on ECO version control. - * |[23:16] |SUB |SCU RTL Design Sub Version Number - * | | |Major version number is correlated to product line. - * |[31:24] |MAJOR |SCU RTL Design Major Version Number - * | | |Major version number is correlated to product line. - */ - __IO uint32_t PNSSET[7]; /*!< [0x0000:0x0018] Peripheral Non-secure Attribution Set Register0 (0x4000_0000~0x400D_FFFF) */ - __I uint32_t RESERVE0[2]; - __IO uint32_t SRAMNSSET; /*!< [0x0024] SRAM Non-secure Attribution Set Register */ - __I uint32_t FNSADDR; /*!< [0x0028] Flash Non-secure Boundary Address Register */ - __IO uint32_t SVIOIEN; /*!< [0x002c] Security Violation Interrupt Enable Register */ - __IO uint32_t SVINTSTS; /*!< [0x0030] Security Violation Interrupt Status Register */ - __I uint32_t APB0VSRC; /*!< [0x0034] APB0 Security Policy Violation Source */ - __I uint32_t APB0VA; /*!< [0x0038] APB0 Violation Address */ - __I uint32_t APB1VSRC; /*!< [0x003c] APB1 Security Policy Violation Source */ - __I uint32_t APB1VA; /*!< [0x0040] APB1 Violation Address */ - __I uint32_t GPIOVSRC; /*!< [0x0044] GPIO Security Policy Violation Source */ - __I uint32_t GPIOVA; /*!< [0x0048] GPIO Violation Address */ - __I uint32_t EBIVSRC; /*!< [0x004c] EBI Security Policy Violation Source */ - __I uint32_t EBIVA; /*!< [0x0050] EBI Violation Address */ - __I uint32_t USBHVSRC; /*!< [0x0054] USBH Security Policy Violation Source */ - __I uint32_t USBHVA; /*!< [0x0058] USBH Violation Address */ - __I uint32_t CRCVSRC; /*!< [0x005c] CRC Security Policy Violation Source */ - __I uint32_t CRCVA; /*!< [0x0060] CRC Violation Address */ - __I uint32_t SD0VSRC; /*!< [0x0064] SDH0 Security Policy Violation Source */ - __I uint32_t SD0VA; /*!< [0x0068] SDH0 Violation Address */ - __I uint32_t RESERVE1[2]; - __I uint32_t PDMA0VSRC; /*!< [0x0074] PDMA0 Security Policy Violation Source */ - __I uint32_t PDMA0VA; /*!< [0x0078] PDMA0 Violation Address */ - __I uint32_t PDMA1VSRC; /*!< [0x007c] PDMA1 Security Policy Violation Source */ - __I uint32_t PDMA1VA; /*!< [0x0080] PDMA1 Violation Address */ - __I uint32_t SRAM0VSRC; /*!< [0x0084] SRAM0 Security Policy Violation Source */ - __I uint32_t SRAM0VA; /*!< [0x0088] SRAM0 Violation Address */ - __I uint32_t SRAM1VSRC; /*!< [0x008c] SRAM1 Security Policy Violation Source */ - __I uint32_t SRAM1VA; /*!< [0x0090] SRAM1 Violation Address */ - __I uint32_t FMCVSRC; /*!< [0x0094] FMC Security Policy Violation Source */ - __I uint32_t FMCVA; /*!< [0x0098] FMC Violation Address */ - __I uint32_t FLASHVSRC; /*!< [0x009c] Flash Security Policy Violation Source */ - __I uint32_t FLASHVA; /*!< [0x00a0] Flash Violation Address */ - __I uint32_t SCUVSRC; /*!< [0x00a4] SCU Security Policy Violation Source */ - __I uint32_t SCUVA; /*!< [0x00a8] SCU Violation Address */ - __I uint32_t SYSVSRC; /*!< [0x00ac] System(GMISC) Security Policy Violation Source */ - __I uint32_t SYSVA; /*!< [0x00b0] System(GMISC) Violation Address */ - __I uint32_t CRPTVSRC; /*!< [0x00b4] Crypto Security Policy Violation Source */ - __I uint32_t CRPTVA; /*!< [0x00b8] Crypto Violation Address */ - __I uint32_t KSVSRC; /*!< [0x00bc] KS Security Policy Violation Source */ - __I uint32_t KSVA; /*!< [0x00c0] KS Violation Address */ - __I uint32_t SRAM2VSRC; /*!< [0x00c4] SRAM2 Security Policy Violation Source */ - __I uint32_t SRAM2VA; /*!< [0x00c8] SRAM2 Violation Address */ - __I uint32_t RESERVE2[9]; - __IO uint32_t SINFAEN; /*!< [0x00f0] Shared Information Access Enable Register */ - __I uint32_t RESERVE3[3]; - __IO uint32_t PNPSET[7]; /*!< [0x0100:0x0118] Peripheral Non-privileged Attribution Set Register0 (0x4000_0000~0x400D_FFFF) */ - __I uint32_t RESERVE4[1]; - __IO uint32_t IONPSET; /*!< [0x0120] IO Non-privileged Attribution Set Register */ - __IO uint32_t SRAMNPSET; /*!< [0x0124] SRAM Non-privileged Attribution Set Register */ - __IO uint32_t MEMNPSET; /*!< [0x0128] Other Memory Non-privileged Attribution Set Register */ - __IO uint32_t PVIOIEN; /*!< [0x012c] Privileged Violation Interrupt Enable Register */ - __IO uint32_t PVINTSTS; /*!< [0x0130] Privileged Violation Interrupt Status Register */ - __I uint32_t RESERVE5[3]; - __IO uint32_t IONSSET[8]; /*!< [0x0140:0x015C] IO Non-secure Attribution Set Register */ - __I uint32_t RESERVE6[40]; - __IO uint32_t NSMCTL; /*!< [0x0200] Non-secure State Monitor Control Register */ - __IO uint32_t NSMLOAD; /*!< [0x0204] Non-secure State Monitor Reload Value Register */ - __IO uint32_t NSMVAL; /*!< [0x0208] Non-secure State Monitor Counter Value Register */ - __IO uint32_t NSMSTS; /*!< [0x020c] Non-secure State Monitor Status Register */ - __I uint32_t RESERVE7[60]; - __IO uint32_t BBE; /*!< [0x0300] Block Bus Error Register */ - __IO uint32_t IDAUANS; /*!< [0x0304] IDAU All Non-secure Set Register */ - __I uint32_t RESERVE8[829]; - __I uint32_t VERSION; /*!< [0x0ffc] SCU RTL Design Version Register */ - -} SCU_T; - -/** - @addtogroup SCU_CONST SCU Bit Field Definition - Constant Definitions for SCU Controller - @{ -*/ - -#define SCU_PNSSET0_USBH_Pos (9) /*!< SCU_T::PNSSET0: USBH Position */ -#define SCU_PNSSET0_USBH_Msk (0x1ul << SCU_PNSSET0_USBH_Pos) /*!< SCU_T::PNSSET0: USBH Mask */ - -#define SCU_PNSSET0_SDH0_Pos (13) /*!< SCU_T::PNSSET0: SDH0 Position */ -#define SCU_PNSSET0_SDH0_Msk (0x1ul << SCU_PNSSET0_SDH0_Pos) /*!< SCU_T::PNSSET0: SDH0 Mask */ - -#define SCU_PNSSET0_EBI_Pos (16) /*!< SCU_T::PNSSET0: EBI Position */ -#define SCU_PNSSET0_EBI_Msk (0x1ul << SCU_PNSSET0_EBI_Pos) /*!< SCU_T::PNSSET0: EBI Mask */ - -#define SCU_PNSSET0_PDMA1_Pos (24) /*!< SCU_T::PNSSET0: PDMA1 Position */ -#define SCU_PNSSET0_PDMA1_Msk (0x1ul << SCU_PNSSET0_PDMA1_Pos) /*!< SCU_T::PNSSET0: PDMA1 Mask */ - -#define SCU_PNSSET1_CRC_Pos (17) /*!< SCU_T::PNSSET1: CRC Position */ -#define SCU_PNSSET1_CRC_Msk (0x1ul << SCU_PNSSET1_CRC_Pos) /*!< SCU_T::PNSSET1: CRC Mask */ - -#define SCU_PNSSET1_CRPT_Pos (18) /*!< SCU_T::PNSSET1: CRPT Position */ -#define SCU_PNSSET1_CRPT_Msk (0x1ul << SCU_PNSSET1_CRPT_Pos) /*!< SCU_T::PNSSET1: CRPT Mask */ - -#define SCU_PNSSET2_EWDT_Pos (2) /*!< SCU_T::PNSSET2: EWDT Position */ -#define SCU_PNSSET2_EWDT_Msk (0x1ul << SCU_PNSSET2_EWDT_Pos) /*!< SCU_T::PNSSET2: EWDT Mask */ - -#define SCU_PNSSET2_EADC_Pos (3) /*!< SCU_T::PNSSET2: EADC Position */ -#define SCU_PNSSET2_EADC_Msk (0x1ul << SCU_PNSSET2_EADC_Pos) /*!< SCU_T::PNSSET2: EADC Mask */ - -#define SCU_PNSSET2_ACMP01_Pos (5) /*!< SCU_T::PNSSET2: ACMP01 Position */ -#define SCU_PNSSET2_ACMP01_Msk (0x1ul << SCU_PNSSET2_ACMP01_Pos) /*!< SCU_T::PNSSET2: ACMP01 Mask */ - -#define SCU_PNSSET2_DAC_Pos (7) /*!< SCU_T::PNSSET2: DAC Position */ -#define SCU_PNSSET2_DAC_Msk (0x1ul << SCU_PNSSET2_DAC_Pos) /*!< SCU_T::PNSSET2: DAC Mask */ - -#define SCU_PNSSET2_I2S0_Pos (8) /*!< SCU_T::PNSSET2: I2S0 Position */ -#define SCU_PNSSET2_I2S0_Msk (0x1ul << SCU_PNSSET2_I2S0_Pos) /*!< SCU_T::PNSSET2: I2S0 Mask */ - -#define SCU_PNSSET2_OTG_Pos (13) /*!< SCU_T::PNSSET2: OTG Position */ -#define SCU_PNSSET2_OTG_Msk (0x1ul << SCU_PNSSET2_OTG_Pos) /*!< SCU_T::PNSSET2: OTG Mask */ - -#define SCU_PNSSET2_TMR23_Pos (17) /*!< SCU_T::PNSSET2: TMR23 Position */ -#define SCU_PNSSET2_TMR23_Msk (0x1ul << SCU_PNSSET2_TMR23_Pos) /*!< SCU_T::PNSSET2: TMR23 Mask */ - -#define SCU_PNSSET2_EPWM0_Pos (24) /*!< SCU_T::PNSSET2: EPWM0 Position */ -#define SCU_PNSSET2_EPWM0_Msk (0x1ul << SCU_PNSSET2_EPWM0_Pos) /*!< SCU_T::PNSSET2: EPWM0 Mask */ - -#define SCU_PNSSET2_EPWM1_Pos (25) /*!< SCU_T::PNSSET2: EPWM1 Position */ -#define SCU_PNSSET2_EPWM1_Msk (0x1ul << SCU_PNSSET2_EPWM1_Pos) /*!< SCU_T::PNSSET2: EPWM1 Mask */ - -#define SCU_PNSSET2_BPWM0_Pos (26) /*!< SCU_T::PNSSET2: BPWM0 Position */ -#define SCU_PNSSET2_BPWM0_Msk (0x1ul << SCU_PNSSET2_BPWM0_Pos) /*!< SCU_T::PNSSET2: BPWM0 Mask */ - -#define SCU_PNSSET2_BPWM1_Pos (27) /*!< SCU_T::PNSSET2: BPWM1 Position */ -#define SCU_PNSSET2_BPWM1_Msk (0x1ul << SCU_PNSSET2_BPWM1_Pos) /*!< SCU_T::PNSSET2: BPWM1 Mask */ - -#define SCU_PNSSET3_QSPI0_Pos (0) /*!< SCU_T::PNSSET3: QSPI0 Position */ -#define SCU_PNSSET3_QSPI0_Msk (0x1ul << SCU_PNSSET3_QSPI0_Pos) /*!< SCU_T::PNSSET3: QSPI0 Mask */ - -#define SCU_PNSSET3_SPI0_Pos (1) /*!< SCU_T::PNSSET3: SPI0 Position */ -#define SCU_PNSSET3_SPI0_Msk (0x1ul << SCU_PNSSET3_SPI0_Pos) /*!< SCU_T::PNSSET3: SPI0 Mask */ - -#define SCU_PNSSET3_SPI1_Pos (2) /*!< SCU_T::PNSSET3: SPI1 Position */ -#define SCU_PNSSET3_SPI1_Msk (0x1ul << SCU_PNSSET3_SPI1_Pos) /*!< SCU_T::PNSSET3: SPI1 Mask */ - -#define SCU_PNSSET3_SPI2_Pos (3) /*!< SCU_T::PNSSET3: SPI2 Position */ -#define SCU_PNSSET3_SPI2_Msk (0x1ul << SCU_PNSSET3_SPI2_Pos) /*!< SCU_T::PNSSET3: SPI2 Mask */ - -#define SCU_PNSSET3_SPI3_Pos (4) /*!< SCU_T::PNSSET3: SPI3 Position */ -#define SCU_PNSSET3_SPI3_Msk (0x1ul << SCU_PNSSET3_SPI3_Pos) /*!< SCU_T::PNSSET3: SPI3 Mask */ - -#define SCU_PNSSET3_UART0_Pos (16) /*!< SCU_T::PNSSET3: UART0 Position */ -#define SCU_PNSSET3_UART0_Msk (0x1ul << SCU_PNSSET3_UART0_Pos) /*!< SCU_T::PNSSET3: UART0 Mask */ - -#define SCU_PNSSET3_UART1_Pos (17) /*!< SCU_T::PNSSET3: UART1 Position */ -#define SCU_PNSSET3_UART1_Msk (0x1ul << SCU_PNSSET3_UART1_Pos) /*!< SCU_T::PNSSET3: UART1 Mask */ - -#define SCU_PNSSET3_UART2_Pos (18) /*!< SCU_T::PNSSET3: UART2 Position */ -#define SCU_PNSSET3_UART2_Msk (0x1ul << SCU_PNSSET3_UART2_Pos) /*!< SCU_T::PNSSET3: UART2 Mask */ - -#define SCU_PNSSET3_UART3_Pos (19) /*!< SCU_T::PNSSET3: UART3 Position */ -#define SCU_PNSSET3_UART3_Msk (0x1ul << SCU_PNSSET3_UART3_Pos) /*!< SCU_T::PNSSET3: UART3 Mask */ - -#define SCU_PNSSET3_UART4_Pos (20) /*!< SCU_T::PNSSET3: UART4 Position */ -#define SCU_PNSSET3_UART4_Msk (0x1ul << SCU_PNSSET3_UART4_Pos) /*!< SCU_T::PNSSET3: UART4 Mask */ - -#define SCU_PNSSET3_UART5_Pos (21) /*!< SCU_T::PNSSET3: UART5 Position */ -#define SCU_PNSSET3_UART5_Msk (0x1ul << SCU_PNSSET3_UART5_Pos) /*!< SCU_T::PNSSET3: UART5 Mask */ - -#define SCU_PNSSET4_I2C0_Pos (0) /*!< SCU_T::PNSSET4: I2C0 Position */ -#define SCU_PNSSET4_I2C0_Msk (0x1ul << SCU_PNSSET4_I2C0_Pos) /*!< SCU_T::PNSSET4: I2C0 Mask */ - -#define SCU_PNSSET4_I2C1_Pos (1) /*!< SCU_T::PNSSET4: I2C1 Position */ -#define SCU_PNSSET4_I2C1_Msk (0x1ul << SCU_PNSSET4_I2C1_Pos) /*!< SCU_T::PNSSET4: I2C1 Mask */ - -#define SCU_PNSSET4_I2C2_Pos (2) /*!< SCU_T::PNSSET4: I2C2 Position */ -#define SCU_PNSSET4_I2C2_Msk (0x1ul << SCU_PNSSET4_I2C2_Pos) /*!< SCU_T::PNSSET4: I2C2 Mask */ - -#define SCU_PNSSET4_SC0_Pos (16) /*!< SCU_T::PNSSET4: SC0 Position */ -#define SCU_PNSSET4_SC0_Msk (0x1ul << SCU_PNSSET4_SC0_Pos) /*!< SCU_T::PNSSET4: SC0 Mask */ - -#define SCU_PNSSET4_SC1_Pos (17) /*!< SCU_T::PNSSET4: SC1 Position */ -#define SCU_PNSSET4_SC1_Msk (0x1ul << SCU_PNSSET4_SC1_Pos) /*!< SCU_T::PNSSET4: SC1 Mask */ - -#define SCU_PNSSET4_SC2_Pos (18) /*!< SCU_T::PNSSET4: SC2 Position */ -#define SCU_PNSSET4_SC2_Msk (0x1ul << SCU_PNSSET4_SC2_Pos) /*!< SCU_T::PNSSET4: SC2 Mask */ - -#define SCU_PNSSET5_CAN0_Pos (0) /*!< SCU_T::PNSSET5: CAN0 Position */ -#define SCU_PNSSET5_CAN0_Msk (0x1ul << SCU_PNSSET5_CAN0_Pos) /*!< SCU_T::PNSSET5: CAN0 Mask */ - -#define SCU_PNSSET5_QEI0_Pos (16) /*!< SCU_T::PNSSET5: QEI0 Position */ -#define SCU_PNSSET5_QEI0_Msk (0x1ul << SCU_PNSSET5_QEI0_Pos) /*!< SCU_T::PNSSET5: QEI0 Mask */ - -#define SCU_PNSSET5_QEI1_Pos (17) /*!< SCU_T::PNSSET5: QEI1 Position */ -#define SCU_PNSSET5_QEI1_Msk (0x1ul << SCU_PNSSET5_QEI1_Pos) /*!< SCU_T::PNSSET5: QEI1 Mask */ - -#define SCU_PNSSET5_ECAP0_Pos (20) /*!< SCU_T::PNSSET5: ECAP0 Position */ -#define SCU_PNSSET5_ECAP0_Msk (0x1ul << SCU_PNSSET5_ECAP0_Pos) /*!< SCU_T::PNSSET5: ECAP0 Mask */ - -#define SCU_PNSSET5_ECAP1_Pos (21) /*!< SCU_T::PNSSET5: ECAP1 Position */ -#define SCU_PNSSET5_ECAP1_Msk (0x1ul << SCU_PNSSET5_ECAP1_Pos) /*!< SCU_T::PNSSET5: ECAP1 Mask */ - -#define SCU_PNSSET5_TRNG_Pos (25) /*!< SCU_T::PNSSET5: TRNG Position */ -#define SCU_PNSSET5_TRNG_Msk (0x1ul << SCU_PNSSET5_TRNG_Pos) /*!< SCU_T::PNSSET5: TRNG Mask */ - -#define SCU_PNSSET5_LCD_Pos (27) /*!< SCU_T::PNSSET5: LCD Position */ -#define SCU_PNSSET5_LCD_Msk (0x1ul << SCU_PNSSET5_LCD_Pos) /*!< SCU_T::PNSSET5: LCD Mask */ - -#define SCU_PNSSET6_USBD_Pos (0) /*!< SCU_T::PNSSET6: USBD Position */ -#define SCU_PNSSET6_USBD_Msk (0x1ul << SCU_PNSSET6_USBD_Pos) /*!< SCU_T::PNSSET6: USBD Mask */ - -#define SCU_PNSSET6_USCI0_Pos (16) /*!< SCU_T::PNSSET6: USCI0 Position */ -#define SCU_PNSSET6_USCI0_Msk (0x1ul << SCU_PNSSET6_USCI0_Pos) /*!< SCU_T::PNSSET6: USCI0 Mask */ - -#define SCU_PNSSET6_USCI1_Pos (17) /*!< SCU_T::PNSSET6: USCI1 Position */ -#define SCU_PNSSET6_USCI1_Msk (0x1ul << SCU_PNSSET6_USCI1_Pos) /*!< SCU_T::PNSSET6: USCI1 Mask */ - -#define SCU_IONSSET_PA_Pos (0) /*!< SCU_T::IONSSET: PA Position */ -#define SCU_IONSSET_PA_Msk (0x1ul << SCU_IONSSET_PA_Pos) /*!< SCU_T::IONSSET: PA Mask */ - -#define SCU_IONSSET_PB_Pos (1) /*!< SCU_T::IONSSET: PB Position */ -#define SCU_IONSSET_PB_Msk (0x1ul << SCU_IONSSET_PB_Pos) /*!< SCU_T::IONSSET: PB Mask */ - -#define SCU_IONSSET_PC_Pos (2) /*!< SCU_T::IONSSET: PC Position */ -#define SCU_IONSSET_PC_Msk (0x1ul << SCU_IONSSET_PC_Pos) /*!< SCU_T::IONSSET: PC Mask */ - -#define SCU_IONSSET_PD_Pos (3) /*!< SCU_T::IONSSET: PD Position */ -#define SCU_IONSSET_PD_Msk (0x1ul << SCU_IONSSET_PD_Pos) /*!< SCU_T::IONSSET: PD Mask */ - -#define SCU_IONSSET_PE_Pos (4) /*!< SCU_T::IONSSET: PE Position */ -#define SCU_IONSSET_PE_Msk (0x1ul << SCU_IONSSET_PE_Pos) /*!< SCU_T::IONSSET: PE Mask */ - -#define SCU_IONSSET_PF_Pos (5) /*!< SCU_T::IONSSET: PF Position */ -#define SCU_IONSSET_PF_Msk (0x1ul << SCU_IONSSET_PF_Pos) /*!< SCU_T::IONSSET: PF Mask */ - -#define SCU_IONSSET_PG_Pos (6) /*!< SCU_T::IONSSET: PG Position */ -#define SCU_IONSSET_PG_Msk (0x1ul << SCU_IONSSET_PG_Pos) /*!< SCU_T::IONSSET: PG Mask */ - -#define SCU_IONSSET_PH_Pos (7) /*!< SCU_T::IONSSET: PH Position */ -#define SCU_IONSSET_PH_Msk (0x1ul << SCU_IONSSET_PH_Pos) /*!< SCU_T::IONSSET: PH Mask */ - -#define SCU_SRAMNSSET_SECn_Pos (0) /*!< SCU_T::SRAMNSSET: SECn Position */ -#define SCU_SRAMNSSET_SECn_Msk (0xffful << SCU_SRAMNSSET_SECn_Pos) /*!< SCU_T::SRAMNSSET: SECn Mask */ - -#define SCU_FNSADDR_FNSADDR_Pos (0) /*!< SCU_T::FNSADDR: FNSADDR Position */ -#define SCU_FNSADDR_FNSADDR_Msk (0xfffffffful << SCU_FNSADDR_FNSADDR_Pos) /*!< SCU_T::FNSADDR: FNSADDR Mask */ - -#define SCU_SVIOIEN_APB0IEN_Pos (0) /*!< SCU_T::SVIOIEN: APB0IEN Position */ -#define SCU_SVIOIEN_APB0IEN_Msk (0x1ul << SCU_SVIOIEN_APB0IEN_Pos) /*!< SCU_T::SVIOIEN: APB0IEN Mask */ - -#define SCU_SVIOIEN_APB1IEN_Pos (1) /*!< SCU_T::SVIOIEN: APB1IEN Position */ -#define SCU_SVIOIEN_APB1IEN_Msk (0x1ul << SCU_SVIOIEN_APB1IEN_Pos) /*!< SCU_T::SVIOIEN: APB1IEN Mask */ - -#define SCU_SVIOIEN_GPIOIEN_Pos (4) /*!< SCU_T::SVIOIEN: GPIOIEN Position */ -#define SCU_SVIOIEN_GPIOIEN_Msk (0x1ul << SCU_SVIOIEN_GPIOIEN_Pos) /*!< SCU_T::SVIOIEN: GPIOIEN Mask */ - -#define SCU_SVIOIEN_EBIIEN_Pos (5) /*!< SCU_T::SVIOIEN: EBIIEN Position */ -#define SCU_SVIOIEN_EBIIEN_Msk (0x1ul << SCU_SVIOIEN_EBIIEN_Pos) /*!< SCU_T::SVIOIEN: EBIIEN Mask */ - -#define SCU_SVIOIEN_USBHIEN_Pos (6) /*!< SCU_T::SVIOIEN: USBHIEN Position */ -#define SCU_SVIOIEN_USBHIEN_Msk (0x1ul << SCU_SVIOIEN_USBHIEN_Pos) /*!< SCU_T::SVIOIEN: USBHIEN Mask */ - -#define SCU_SVIOIEN_CRCIEN_Pos (7) /*!< SCU_T::SVIOIEN: CRCIEN Position */ -#define SCU_SVIOIEN_CRCIEN_Msk (0x1ul << SCU_SVIOIEN_CRCIEN_Pos) /*!< SCU_T::SVIOIEN: CRCIEN Mask */ - -#define SCU_SVIOIEN_SDH0IEN_Pos (8) /*!< SCU_T::SVIOIEN: SDH0IEN Position */ -#define SCU_SVIOIEN_SDH0IEN_Msk (0x1ul << SCU_SVIOIEN_SDH0IEN_Pos) /*!< SCU_T::SVIOIEN: SDH0IEN Mask */ - -#define SCU_SVIOIEN_PDMA0IEN_Pos (10) /*!< SCU_T::SVIOIEN: PDMA0IEN Position */ -#define SCU_SVIOIEN_PDMA0IEN_Msk (0x1ul << SCU_SVIOIEN_PDMA0IEN_Pos) /*!< SCU_T::SVIOIEN: PDMA0IEN Mask */ - -#define SCU_SVIOIEN_PDMA1IEN_Pos (11) /*!< SCU_T::SVIOIEN: PDMA1IEN Position */ -#define SCU_SVIOIEN_PDMA1IEN_Msk (0x1ul << SCU_SVIOIEN_PDMA1IEN_Pos) /*!< SCU_T::SVIOIEN: PDMA1IEN Mask */ - -#define SCU_SVIOIEN_SRAM0IEN_Pos (12) /*!< SCU_T::SVIOIEN: SRAM0IEN Position */ -#define SCU_SVIOIEN_SRAM0IEN_Msk (0x1ul << SCU_SVIOIEN_SRAM0IEN_Pos) /*!< SCU_T::SVIOIEN: SRAM0IEN Mask */ - -#define SCU_SVIOIEN_SRAM1IEN_Pos (13) /*!< SCU_T::SVIOIEN: SRAM1IEN Position */ -#define SCU_SVIOIEN_SRAM1IEN_Msk (0x1ul << SCU_SVIOIEN_SRAM1IEN_Pos) /*!< SCU_T::SVIOIEN: SRAM1IEN Mask */ - -#define SCU_SVIOIEN_FMCIEN_Pos (14) /*!< SCU_T::SVIOIEN: FMCIEN Position */ -#define SCU_SVIOIEN_FMCIEN_Msk (0x1ul << SCU_SVIOIEN_FMCIEN_Pos) /*!< SCU_T::SVIOIEN: FMCIEN Mask */ - -#define SCU_SVIOIEN_FLASHIEN_Pos (15) /*!< SCU_T::SVIOIEN: FLASHIEN Position */ -#define SCU_SVIOIEN_FLASHIEN_Msk (0x1ul << SCU_SVIOIEN_FLASHIEN_Pos) /*!< SCU_T::SVIOIEN: FLASHIEN Mask */ - -#define SCU_SVIOIEN_SCUIEN_Pos (16) /*!< SCU_T::SVIOIEN: SCUIEN Position */ -#define SCU_SVIOIEN_SCUIEN_Msk (0x1ul << SCU_SVIOIEN_SCUIEN_Pos) /*!< SCU_T::SVIOIEN: SCUIEN Mask */ - -#define SCU_SVIOIEN_SYSIEN_Pos (17) /*!< SCU_T::SVIOIEN: SYSIEN Position */ -#define SCU_SVIOIEN_SYSIEN_Msk (0x1ul << SCU_SVIOIEN_SYSIEN_Pos) /*!< SCU_T::SVIOIEN: SYSIEN Mask */ - -#define SCU_SVIOIEN_CRPTIEN_Pos (18) /*!< SCU_T::SVIOIEN: CRPTIEN Position */ -#define SCU_SVIOIEN_CRPTIEN_Msk (0x1ul << SCU_SVIOIEN_CRPTIEN_Pos) /*!< SCU_T::SVIOIEN: CRPTIEN Mask */ - -#define SCU_SVIOIEN_KSIEN_Pos (19) /*!< SCU_T::SVIOIEN: KSIEN Position */ -#define SCU_SVIOIEN_KSIEN_Msk (0x1ul << SCU_SVIOIEN_KSIEN_Pos) /*!< SCU_T::SVIOIEN: KSIEN Mask */ - -#define SCU_SVINTSTS_APB0IF_Pos (0) /*!< SCU_T::SVINTSTS: APB0IF Position */ -#define SCU_SVINTSTS_APB0IF_Msk (0x1ul << SCU_SVINTSTS_APB0IF_Pos) /*!< SCU_T::SVINTSTS: APB0IF Mask */ - -#define SCU_SVINTSTS_APB1IF_Pos (1) /*!< SCU_T::SVINTSTS: APB1IF Position */ -#define SCU_SVINTSTS_APB1IF_Msk (0x1ul << SCU_SVINTSTS_APB1IF_Pos) /*!< SCU_T::SVINTSTS: APB1IF Mask */ - -#define SCU_SVINTSTS_GPIOIF_Pos (4) /*!< SCU_T::SVINTSTS: GPIOIF Position */ -#define SCU_SVINTSTS_GPIOIF_Msk (0x1ul << SCU_SVINTSTS_GPIOIF_Pos) /*!< SCU_T::SVINTSTS: GPIOIF Mask */ - -#define SCU_SVINTSTS_EBIIF_Pos (5) /*!< SCU_T::SVINTSTS: EBIIF Position */ -#define SCU_SVINTSTS_EBIIF_Msk (0x1ul << SCU_SVINTSTS_EBIIF_Pos) /*!< SCU_T::SVINTSTS: EBIIF Mask */ - -#define SCU_SVINTSTS_USBHIF_Pos (6) /*!< SCU_T::SVINTSTS: USBHIF Position */ -#define SCU_SVINTSTS_USBHIF_Msk (0x1ul << SCU_SVINTSTS_USBHIF_Pos) /*!< SCU_T::SVINTSTS: USBHIF Mask */ - -#define SCU_SVINTSTS_CRCIF_Pos (7) /*!< SCU_T::SVINTSTS: CRCIF Position */ -#define SCU_SVINTSTS_CRCIF_Msk (0x1ul << SCU_SVINTSTS_CRCIF_Pos) /*!< SCU_T::SVINTSTS: CRCIF Mask */ - -#define SCU_SVINTSTS_SDH0IF_Pos (8) /*!< SCU_T::SVINTSTS: SDH0IF Position */ -#define SCU_SVINTSTS_SDH0IF_Msk (0x1ul << SCU_SVINTSTS_SDH0IF_Pos) /*!< SCU_T::SVINTSTS: SDH0IF Mask */ - -#define SCU_SVINTSTS_PDMA0IF_Pos (10) /*!< SCU_T::SVINTSTS: PDMA0IF Position */ -#define SCU_SVINTSTS_PDMA0IF_Msk (0x1ul << SCU_SVINTSTS_PDMA0IF_Pos) /*!< SCU_T::SVINTSTS: PDMA0IF Mask */ - -#define SCU_SVINTSTS_PDMA1IF_Pos (11) /*!< SCU_T::SVINTSTS: PDMA1IF Position */ -#define SCU_SVINTSTS_PDMA1IF_Msk (0x1ul << SCU_SVINTSTS_PDMA1IF_Pos) /*!< SCU_T::SVINTSTS: PDMA1IF Mask */ - -#define SCU_SVINTSTS_SRAM0IF_Pos (12) /*!< SCU_T::SVINTSTS: SRAM0IF Position */ -#define SCU_SVINTSTS_SRAM0IF_Msk (0x1ul << SCU_SVINTSTS_SRAM0IF_Pos) /*!< SCU_T::SVINTSTS: SRAM0IF Mask */ - -#define SCU_SVINTSTS_SRAM1IF_Pos (13) /*!< SCU_T::SVINTSTS: SRAM1IF Position */ -#define SCU_SVINTSTS_SRAM1IF_Msk (0x1ul << SCU_SVINTSTS_SRAM1IF_Pos) /*!< SCU_T::SVINTSTS: SRAM1IF Mask */ - -#define SCU_SVINTSTS_FMCIF_Pos (14) /*!< SCU_T::SVINTSTS: FMCIF Position */ -#define SCU_SVINTSTS_FMCIF_Msk (0x1ul << SCU_SVINTSTS_FMCIF_Pos) /*!< SCU_T::SVINTSTS: FMCIF Mask */ - -#define SCU_SVINTSTS_FLASHIF_Pos (15) /*!< SCU_T::SVINTSTS: FLASHIF Position */ -#define SCU_SVINTSTS_FLASHIF_Msk (0x1ul << SCU_SVINTSTS_FLASHIF_Pos) /*!< SCU_T::SVINTSTS: FLASHIF Mask */ - -#define SCU_SVINTSTS_SCUIF_Pos (16) /*!< SCU_T::SVINTSTS: SCUIF Position */ -#define SCU_SVINTSTS_SCUIF_Msk (0x1ul << SCU_SVINTSTS_SCUIF_Pos) /*!< SCU_T::SVINTSTS: SCUIF Mask */ - -#define SCU_SVINTSTS_SYSIF_Pos (17) /*!< SCU_T::SVINTSTS: SYSIF Position */ -#define SCU_SVINTSTS_SYSIF_Msk (0x1ul << SCU_SVINTSTS_SYSIF_Pos) /*!< SCU_T::SVINTSTS: SYSIF Mask */ - -#define SCU_SVINTSTS_CRPTIF_Pos (18) /*!< SCU_T::SVINTSTS: CRPTIF Position */ -#define SCU_SVINTSTS_CRPTIF_Msk (0x1ul << SCU_SVINTSTS_CRPTIF_Pos) /*!< SCU_T::SVINTSTS: CRPTIF Mask */ - -#define SCU_SVINTSTS_KSIF_Pos (19) /*!< SCU_T::SVINTSTS: KSIF Position */ -#define SCU_SVINTSTS_KSIF_Msk (0x1ul << SCU_SVINTSTS_KSIF_Pos) /*!< SCU_T::SVINTSTS: KSIF Mask */ - -#define SCU_APB0VSRC_MASTER_Pos (0) /*!< SCU_T::APB0VSRC: MASTER Position */ -#define SCU_APB0VSRC_MASTER_Msk (0xful << SCU_APB0VSRC_MASTER_Pos) /*!< SCU_T::APB0VSRC: MASTER Mask */ - -#define SCU_APB0VA_VIOADDR_Pos (0) /*!< SCU_T::APB0VA: VIOADDR Position */ -#define SCU_APB0VA_VIOADDR_Msk (0xfffffffful << SCU_APB0VA_VIOADDR_Pos) /*!< SCU_T::APB0VA: VIOADDR Mask */ - -#define SCU_APB1VSRC_MASTER_Pos (0) /*!< SCU_T::APB1VSRC: MASTER Position */ -#define SCU_APB1VSRC_MASTER_Msk (0xful << SCU_APB1VSRC_MASTER_Pos) /*!< SCU_T::APB1VSRC: MASTER Mask */ - -#define SCU_APB1VA_VIOADDR_Pos (0) /*!< SCU_T::APB1VA: VIOADDR Position */ -#define SCU_APB1VA_VIOADDR_Msk (0xfffffffful << SCU_APB1VA_VIOADDR_Pos) /*!< SCU_T::APB1VA: VIOADDR Mask */ - -#define SCU_GPIOVSRC_MASTER_Pos (0) /*!< SCU_T::GPIOVSRC: MASTER Position */ -#define SCU_GPIOVSRC_MASTER_Msk (0xful << SCU_GPIOVSRC_MASTER_Pos) /*!< SCU_T::GPIOVSRC: MASTER Mask */ - -#define SCU_GPIOVA_VIOADDR_Pos (0) /*!< SCU_T::GPIOVA: VIOADDR Position */ -#define SCU_GPIOVA_VIOADDR_Msk (0xfffffffful << SCU_GPIOVA_VIOADDR_Pos) /*!< SCU_T::GPIOVA: VIOADDR Mask */ - -#define SCU_EBIVSRC_MASTER_Pos (0) /*!< SCU_T::EBIVSRC: MASTER Position */ -#define SCU_EBIVSRC_MASTER_Msk (0xful << SCU_EBIVSRC_MASTER_Pos) /*!< SCU_T::EBIVSRC: MASTER Mask */ - -#define SCU_EBIVA_VIOADDR_Pos (0) /*!< SCU_T::EBIVA: VIOADDR Position */ -#define SCU_EBIVA_VIOADDR_Msk (0xfffffffful << SCU_EBIVA_VIOADDR_Pos) /*!< SCU_T::EBIVA: VIOADDR Mask */ - -#define SCU_USBHVSRC_MASTER_Pos (0) /*!< SCU_T::USBHVSRC: MASTER Position */ -#define SCU_USBHVSRC_MASTER_Msk (0xful << SCU_USBHVSRC_MASTER_Pos) /*!< SCU_T::USBHVSRC: MASTER Mask */ - -#define SCU_USBHVA_VIOADDR_Pos (0) /*!< SCU_T::USBHVA: VIOADDR Position */ -#define SCU_USBHVA_VIOADDR_Msk (0xfffffffful << SCU_USBHVA_VIOADDR_Pos) /*!< SCU_T::USBHVA: VIOADDR Mask */ - -#define SCU_CRCVSRC_MASTER_Pos (0) /*!< SCU_T::CRCVSRC: MASTER Position */ -#define SCU_CRCVSRC_MASTER_Msk (0xful << SCU_CRCVSRC_MASTER_Pos) /*!< SCU_T::CRCVSRC: MASTER Mask */ - -#define SCU_CRCVA_VIOADDR_Pos (0) /*!< SCU_T::CRCVA: VIOADDR Position */ -#define SCU_CRCVA_VIOADDR_Msk (0xfffffffful << SCU_CRCVA_VIOADDR_Pos) /*!< SCU_T::CRCVA: VIOADDR Mask */ - -#define SCU_SD0VSRC_MASTER_Pos (0) /*!< SCU_T::SD0VSRC: MASTER Position */ -#define SCU_SD0VSRC_MASTER_Msk (0xful << SCU_SD0VSRC_MASTER_Pos) /*!< SCU_T::SD0VSRC: MASTER Mask */ - -#define SCU_SD0VA_VIOADDR_Pos (0) /*!< SCU_T::SD0VA: VIOADDR Position */ -#define SCU_SD0VA_VIOADDR_Msk (0xfffffffful << SCU_SD0VA_VIOADDR_Pos) /*!< SCU_T::SD0VA: VIOADDR Mask */ - -#define SCU_PDMA0VSRC_MASTER_Pos (0) /*!< SCU_T::PDMA0VSRC: MASTER Position */ -#define SCU_PDMA0VSRC_MASTER_Msk (0xful << SCU_PDMA0VSRC_MASTER_Pos) /*!< SCU_T::PDMA0VSRC: MASTER Mask */ - -#define SCU_PDMA0VA_VIOADDR_Pos (0) /*!< SCU_T::PDMA0VA: VIOADDR Position */ -#define SCU_PDMA0VA_VIOADDR_Msk (0xfffffffful << SCU_PDMA0VA_VIOADDR_Pos) /*!< SCU_T::PDMA0VA: VIOADDR Mask */ - -#define SCU_PDMA1VSRC_MASTER_Pos (0) /*!< SCU_T::PDMA1VSRC: MASTER Position */ -#define SCU_PDMA1VSRC_MASTER_Msk (0xful << SCU_PDMA1VSRC_MASTER_Pos) /*!< SCU_T::PDMA1VSRC: MASTER Mask */ - -#define SCU_PDMA1VA_VIOADDR_Pos (0) /*!< SCU_T::PDMA1VA: VIOADDR Position */ -#define SCU_PDMA1VA_VIOADDR_Msk (0xfffffffful << SCU_PDMA1VA_VIOADDR_Pos) /*!< SCU_T::PDMA1VA: VIOADDR Mask */ - -#define SCU_SRAM0VSRC_MASTER_Pos (0) /*!< SCU_T::SRAM0VSRC: MASTER Position */ -#define SCU_SRAM0VSRC_MASTER_Msk (0xful << SCU_SRAM0VSRC_MASTER_Pos) /*!< SCU_T::SRAM0VSRC: MASTER Mask */ - -#define SCU_SRAM0VA_VIOADDR_Pos (0) /*!< SCU_T::SRAM0VA: VIOADDR Position */ -#define SCU_SRAM0VA_VIOADDR_Msk (0xfffffffful << SCU_SRAM0VA_VIOADDR_Pos) /*!< SCU_T::SRAM0VA: VIOADDR Mask */ - -#define SCU_SRAM1VSRC_MASTER_Pos (0) /*!< SCU_T::SRAM1VSRC: MASTER Position */ -#define SCU_SRAM1VSRC_MASTER_Msk (0xful << SCU_SRAM1VSRC_MASTER_Pos) /*!< SCU_T::SRAM1VSRC: MASTER Mask */ - -#define SCU_SRAM1VA_VIOADDR_Pos (0) /*!< SCU_T::SRAM1VA: VIOADDR Position */ -#define SCU_SRAM1VA_VIOADDR_Msk (0xfffffffful << SCU_SRAM1VA_VIOADDR_Pos) /*!< SCU_T::SRAM1VA: VIOADDR Mask */ - -#define SCU_FMCVSRC_MASTER_Pos (0) /*!< SCU_T::FMCVSRC: MASTER Position */ -#define SCU_FMCVSRC_MASTER_Msk (0xful << SCU_FMCVSRC_MASTER_Pos) /*!< SCU_T::FMCVSRC: MASTER Mask */ - -#define SCU_FMCVA_VIOADDR_Pos (0) /*!< SCU_T::FMCVA: VIOADDR Position */ -#define SCU_FMCVA_VIOADDR_Msk (0xfffffffful << SCU_FMCVA_VIOADDR_Pos) /*!< SCU_T::FMCVA: VIOADDR Mask */ - -#define SCU_FLASHVSRC_MASTER_Pos (0) /*!< SCU_T::FLASHVSRC: MASTER Position */ -#define SCU_FLASHVSRC_MASTER_Msk (0xful << SCU_FLASHVSRC_MASTER_Pos) /*!< SCU_T::FLASHVSRC: MASTER Mask */ - -#define SCU_FLASHVA_VIOADDR_Pos (0) /*!< SCU_T::FLASHVA: VIOADDR Position */ -#define SCU_FLASHVA_VIOADDR_Msk (0xfffffffful << SCU_FLASHVA_VIOADDR_Pos) /*!< SCU_T::FLASHVA: VIOADDR Mask */ - -#define SCU_SCUVSRC_MASTER_Pos (0) /*!< SCU_T::SCUVSRC: MASTER Position */ -#define SCU_SCUVSRC_MASTER_Msk (0xful << SCU_SCUVSRC_MASTER_Pos) /*!< SCU_T::SCUVSRC: MASTER Mask */ - -#define SCU_SCUVA_VIOADDR_Pos (0) /*!< SCU_T::SCUVA: VIOADDR Position */ -#define SCU_SCUVA_VIOADDR_Msk (0xfffffffful << SCU_SCUVA_VIOADDR_Pos) /*!< SCU_T::SCUVA: VIOADDR Mask */ - -#define SCU_SYSVSRC_MASTER_Pos (0) /*!< SCU_T::SYSVSRC: MASTER Position */ -#define SCU_SYSVSRC_MASTER_Msk (0xful << SCU_SYSVSRC_MASTER_Pos) /*!< SCU_T::SYSVSRC: MASTER Mask */ - -#define SCU_SYSVA_VIOADDR_Pos (0) /*!< SCU_T::SYSVA: VIOADDR Position */ -#define SCU_SYSVA_VIOADDR_Msk (0xfffffffful << SCU_SYSVA_VIOADDR_Pos) /*!< SCU_T::SYSVA: VIOADDR Mask */ - -#define SCU_CRPTVSRC_MASTER_Pos (0) /*!< SCU_T::CRPTVSRC: MASTER Position */ -#define SCU_CRPTVSRC_MASTER_Msk (0xful << SCU_CRPTVSRC_MASTER_Pos) /*!< SCU_T::CRPTVSRC: MASTER Mask */ - -#define SCU_CRPTVA_VIOADDR_Pos (0) /*!< SCU_T::CRPTVA: VIOADDR Position */ -#define SCU_CRPTVA_VIOADDR_Msk (0xfffffffful << SCU_CRPTVA_VIOADDR_Pos) /*!< SCU_T::CRPTVA: VIOADDR Mask */ - -#define SCU_KSVSRC_MASTER_Pos (0) /*!< SCU_T::KSVSRC: MASTER Position */ -#define SCU_KSVSRC_MASTER_Msk (0xful << SCU_KSVSRC_MASTER_Pos) /*!< SCU_T::KSVSRC: MASTER Mask */ - -#define SCU_KSVA_VIOADDR_Pos (0) /*!< SCU_T::KSVA: VIOADDR Position */ -#define SCU_KSVA_VIOADDR_Msk (0xfffffffful << SCU_KSVA_VIOADDR_Pos) /*!< SCU_T::KSVA: VIOADDR Mask */ - -#define SCU_SRAM2VSRC_MASTER_Pos (0) /*!< SCU_T::SRAM2VSRC: MASTER Position */ -#define SCU_SRAM2VSRC_MASTER_Msk (0xful << SCU_SRAM2VSRC_MASTER_Pos) /*!< SCU_T::SRAM2VSRC: MASTER Mask */ - -#define SCU_SRAM2VA_VIOADDR_Pos (0) /*!< SCU_T::SRAM2VA: VIOADDR Position */ -#define SCU_SRAM2VA_VIOADDR_Msk (0xfffffffful << SCU_SRAM2VA_VIOADDR_Pos) /*!< SCU_T::SRAM2VA: VIOADDR Mask */ - -#define SCU_SINFAEN_SCUSIAEN_Pos (0) /*!< SCU_T::SINFAEN: SCUSIAEN Position */ -#define SCU_SINFAEN_SCUSIAEN_Msk (0x1ul << SCU_SINFAEN_SCUSIAEN_Pos) /*!< SCU_T::SINFAEN: SCUSIAEN Mask */ - -#define SCU_SINFAEN_SYSSIAEN_Pos (1) /*!< SCU_T::SINFAEN: SYSSIAEN Position */ -#define SCU_SINFAEN_SYSSIAEN_Msk (0x1ul << SCU_SINFAEN_SYSSIAEN_Pos) /*!< SCU_T::SINFAEN: SYSSIAEN Mask */ - -#define SCU_SINFAEN_FMCSIAEN_Pos (2) /*!< SCU_T::SINFAEN: FMCSIAEN Position */ -#define SCU_SINFAEN_FMCSIAEN_Msk (0x1ul << SCU_SINFAEN_FMCSIAEN_Pos) /*!< SCU_T::SINFAEN: FMCSIAEN Mask */ - -#define SCU_PNPSET0_SYS_Pos (0) /*!< SCU_T::PNPSET0: SYS Position */ -#define SCU_PNPSET0_SYS_Msk (0x1ul << SCU_PNPSET0_SYS_Pos) /*!< SCU_T::PNPSET0: SYS Mask */ - -#define SCU_PNPSET0_PDMA0_Pos (8) /*!< SCU_T::PNPSET0: PDMA0 Position */ -#define SCU_PNPSET0_PDMA0_Msk (0x1ul << SCU_PNPSET0_PDMA0_Pos) /*!< SCU_T::PNPSET0: PDMA0 Mask */ - -#define SCU_PNPSET0_USBH_Pos (9) /*!< SCU_T::PNPSET0: USBH Position */ -#define SCU_PNPSET0_USBH_Msk (0x1ul << SCU_PNPSET0_USBH_Pos) /*!< SCU_T::PNPSET0: USBH Mask */ - -#define SCU_PNPSET0_FMC_Pos (12) /*!< SCU_T::PNPSET0: FMC Position */ -#define SCU_PNPSET0_FMC_Msk (0x1ul << SCU_PNPSET0_FMC_Pos) /*!< SCU_T::PNPSET0: FMC Mask */ - -#define SCU_PNPSET0_SDH0_Pos (13) /*!< SCU_T::PNPSET0: SDH0 Position */ -#define SCU_PNPSET0_SDH0_Msk (0x1ul << SCU_PNPSET0_SDH0_Pos) /*!< SCU_T::PNPSET0: SDH0 Mask */ - -#define SCU_PNPSET0_EBI_Pos (16) /*!< SCU_T::PNPSET0: EBI Position */ -#define SCU_PNPSET0_EBI_Msk (0x1ul << SCU_PNPSET0_EBI_Pos) /*!< SCU_T::PNPSET0: EBI Mask */ - -#define SCU_PNPSET0_PDMA1_Pos (24) /*!< SCU_T::PNPSET0: PDMA1 Position */ -#define SCU_PNPSET0_PDMA1_Msk (0x1ul << SCU_PNPSET0_PDMA1_Pos) /*!< SCU_T::PNPSET0: PDMA1 Mask */ - -#define SCU_PNPSET1_SCU_Pos (15) /*!< SCU_T::PNPSET1: SCU Position */ -#define SCU_PNPSET1_SCU_Msk (0x1ul << SCU_PNPSET1_SCU_Pos) /*!< SCU_T::PNPSET1: SCU Mask */ - -#define SCU_PNPSET1_CRC_Pos (17) /*!< SCU_T::PNPSET1: CRC Position */ -#define SCU_PNPSET1_CRC_Msk (0x1ul << SCU_PNPSET1_CRC_Pos) /*!< SCU_T::PNPSET1: CRC Mask */ - -#define SCU_PNPSET1_CRPT_Pos (18) /*!< SCU_T::PNPSET1: CRPT Position */ -#define SCU_PNPSET1_CRPT_Msk (0x1ul << SCU_PNPSET1_CRPT_Pos) /*!< SCU_T::PNPSET1: CRPT Mask */ - -#define SCU_PNPSET1_KS_Pos (21) /*!< SCU_T::PNPSET1: KS Position */ -#define SCU_PNPSET1_KS_Msk (0x1ul << SCU_PNPSET1_KS_Pos) /*!< SCU_T::PNPSET1: KS Mask */ - -#define SCU_PNPSET2_WDT_Pos (0) /*!< SCU_T::PNPSET2: WDT Position */ -#define SCU_PNPSET2_WDT_Msk (0x1ul << SCU_PNPSET2_WDT_Pos) /*!< SCU_T::PNPSET2: WDT Mask */ - -#define SCU_PNPSET2_RTC_Pos (1) /*!< SCU_T::PNPSET2: RTC Position */ -#define SCU_PNPSET2_RTC_Msk (0x1ul << SCU_PNPSET2_RTC_Pos) /*!< SCU_T::PNPSET2: RTC Mask */ - -#define SCU_PNPSET2_EWDT_Pos (2) /*!< SCU_T::PNPSET2: EWDT Position */ -#define SCU_PNPSET2_EWDT_Msk (0x1ul << SCU_PNPSET2_EWDT_Pos) /*!< SCU_T::PNPSET2: EWDT Mask */ - -#define SCU_PNPSET2_EADC_Pos (3) /*!< SCU_T::PNPSET2: EADC Position */ -#define SCU_PNPSET2_EADC_Msk (0x1ul << SCU_PNPSET2_EADC_Pos) /*!< SCU_T::PNPSET2: EADC Mask */ - -#define SCU_PNPSET2_ACMP01_Pos (5) /*!< SCU_T::PNPSET2: ACMP01 Position */ -#define SCU_PNPSET2_ACMP01_Msk (0x1ul << SCU_PNPSET2_ACMP01_Pos) /*!< SCU_T::PNPSET2: ACMP01 Mask */ - -#define SCU_PNPSET2_DAC_Pos (7) /*!< SCU_T::PNPSET2: DAC Position */ -#define SCU_PNPSET2_DAC_Msk (0x1ul << SCU_PNPSET2_DAC_Pos) /*!< SCU_T::PNPSET2: DAC Mask */ - -#define SCU_PNPSET2_I2S0_Pos (8) /*!< SCU_T::PNPSET2: I2S0 Position */ -#define SCU_PNPSET2_I2S0_Msk (0x1ul << SCU_PNPSET2_I2S0_Pos) /*!< SCU_T::PNPSET2: I2S0 Mask */ - -#define SCU_PNPSET2_OTG_Pos (13) /*!< SCU_T::PNPSET2: OTG Position */ -#define SCU_PNPSET2_OTG_Msk (0x1ul << SCU_PNPSET2_OTG_Pos) /*!< SCU_T::PNPSET2: OTG Mask */ - -#define SCU_PNPSET2_TMR01_Pos (14) /*!< SCU_T::PNPSET2: TMR01 Position */ -#define SCU_PNPSET2_TMR01_Msk (0x7ul << SCU_PNPSET2_TMR01_Pos) /*!< SCU_T::PNPSET2: TMR01 Mask */ - -#define SCU_PNPSET2_TMR23_Pos (17) /*!< SCU_T::PNPSET2: TMR23 Position */ -#define SCU_PNPSET2_TMR23_Msk (0x1ul << SCU_PNPSET2_TMR23_Pos) /*!< SCU_T::PNPSET2: TMR23 Mask */ - -#define SCU_PNPSET2_EPWM0_Pos (24) /*!< SCU_T::PNPSET2: EPWM0 Position */ -#define SCU_PNPSET2_EPWM0_Msk (0x1ul << SCU_PNPSET2_EPWM0_Pos) /*!< SCU_T::PNPSET2: EPWM0 Mask */ - -#define SCU_PNPSET2_EPWM1_Pos (25) /*!< SCU_T::PNPSET2: EPWM1 Position */ -#define SCU_PNPSET2_EPWM1_Msk (0x1ul << SCU_PNPSET2_EPWM1_Pos) /*!< SCU_T::PNPSET2: EPWM1 Mask */ - -#define SCU_PNPSET2_BPWM0_Pos (26) /*!< SCU_T::PNPSET2: BPWM0 Position */ -#define SCU_PNPSET2_BPWM0_Msk (0x1ul << SCU_PNPSET2_BPWM0_Pos) /*!< SCU_T::PNPSET2: BPWM0 Mask */ - -#define SCU_PNPSET2_BPWM1_Pos (27) /*!< SCU_T::PNPSET2: BPWM1 Position */ -#define SCU_PNPSET2_BPWM1_Msk (0x1ul << SCU_PNPSET2_BPWM1_Pos) /*!< SCU_T::PNPSET2: BPWM1 Mask */ - -#define SCU_PNPSET3_QSPI0_Pos (0) /*!< SCU_T::PNPSET3: QSPI0 Position */ -#define SCU_PNPSET3_QSPI0_Msk (0x1ul << SCU_PNPSET3_QSPI0_Pos) /*!< SCU_T::PNPSET3: QSPI0 Mask */ - -#define SCU_PNPSET3_SPI0_Pos (1) /*!< SCU_T::PNPSET3: SPI0 Position */ -#define SCU_PNPSET3_SPI0_Msk (0x1ul << SCU_PNPSET3_SPI0_Pos) /*!< SCU_T::PNPSET3: SPI0 Mask */ - -#define SCU_PNPSET3_SPI1_Pos (2) /*!< SCU_T::PNPSET3: SPI1 Position */ -#define SCU_PNPSET3_SPI1_Msk (0x1ul << SCU_PNPSET3_SPI1_Pos) /*!< SCU_T::PNPSET3: SPI1 Mask */ - -#define SCU_PNPSET3_SPI2_Pos (3) /*!< SCU_T::PNPSET3: SPI2 Position */ -#define SCU_PNPSET3_SPI2_Msk (0x1ul << SCU_PNPSET3_SPI2_Pos) /*!< SCU_T::PNPSET3: SPI2 Mask */ - -#define SCU_PNPSET3_SPI3_Pos (4) /*!< SCU_T::PNPSET3: SPI3 Position */ -#define SCU_PNPSET3_SPI3_Msk (0x1ul << SCU_PNPSET3_SPI3_Pos) /*!< SCU_T::PNPSET3: SPI3 Mask */ - -#define SCU_PNPSET3_UART0_Pos (16) /*!< SCU_T::PNPSET3: UART0 Position */ -#define SCU_PNPSET3_UART0_Msk (0x1ul << SCU_PNPSET3_UART0_Pos) /*!< SCU_T::PNPSET3: UART0 Mask */ - -#define SCU_PNPSET3_UART1_Pos (17) /*!< SCU_T::PNPSET3: UART1 Position */ -#define SCU_PNPSET3_UART1_Msk (0x1ul << SCU_PNPSET3_UART1_Pos) /*!< SCU_T::PNPSET3: UART1 Mask */ - -#define SCU_PNPSET3_UART2_Pos (18) /*!< SCU_T::PNPSET3: UART2 Position */ -#define SCU_PNPSET3_UART2_Msk (0x1ul << SCU_PNPSET3_UART2_Pos) /*!< SCU_T::PNPSET3: UART2 Mask */ - -#define SCU_PNPSET3_UART3_Pos (19) /*!< SCU_T::PNPSET3: UART3 Position */ -#define SCU_PNPSET3_UART3_Msk (0x1ul << SCU_PNPSET3_UART3_Pos) /*!< SCU_T::PNPSET3: UART3 Mask */ - -#define SCU_PNPSET3_UART4_Pos (20) /*!< SCU_T::PNPSET3: UART4 Position */ -#define SCU_PNPSET3_UART4_Msk (0x1ul << SCU_PNPSET3_UART4_Pos) /*!< SCU_T::PNPSET3: UART4 Mask */ - -#define SCU_PNPSET3_UART5_Pos (21) /*!< SCU_T::PNPSET3: UART5 Position */ -#define SCU_PNPSET3_UART5_Msk (0x1ul << SCU_PNPSET3_UART5_Pos) /*!< SCU_T::PNPSET3: UART5 Mask */ - -#define SCU_PNPSET4_I2C0_Pos (0) /*!< SCU_T::PNPSET4: I2C0 Position */ -#define SCU_PNPSET4_I2C0_Msk (0x1ul << SCU_PNPSET4_I2C0_Pos) /*!< SCU_T::PNPSET4: I2C0 Mask */ - -#define SCU_PNPSET4_I2C1_Pos (1) /*!< SCU_T::PNPSET4: I2C1 Position */ -#define SCU_PNPSET4_I2C1_Msk (0x1ul << SCU_PNPSET4_I2C1_Pos) /*!< SCU_T::PNPSET4: I2C1 Mask */ - -#define SCU_PNPSET4_I2C2_Pos (2) /*!< SCU_T::PNPSET4: I2C2 Position */ -#define SCU_PNPSET4_I2C2_Msk (0x1ul << SCU_PNPSET4_I2C2_Pos) /*!< SCU_T::PNPSET4: I2C2 Mask */ - -#define SCU_PNPSET4_SC0_Pos (16) /*!< SCU_T::PNPSET4: SC0 Position */ -#define SCU_PNPSET4_SC0_Msk (0x1ul << SCU_PNPSET4_SC0_Pos) /*!< SCU_T::PNPSET4: SC0 Mask */ - -#define SCU_PNPSET4_SC1_Pos (17) /*!< SCU_T::PNPSET4: SC1 Position */ -#define SCU_PNPSET4_SC1_Msk (0x1ul << SCU_PNPSET4_SC1_Pos) /*!< SCU_T::PNPSET4: SC1 Mask */ - -#define SCU_PNPSET4_SC2_Pos (18) /*!< SCU_T::PNPSET4: SC2 Position */ -#define SCU_PNPSET4_SC2_Msk (0x1ul << SCU_PNPSET4_SC2_Pos) /*!< SCU_T::PNPSET4: SC2 Mask */ - -#define SCU_PNPSET5_CAN0_Pos (0) /*!< SCU_T::PNPSET5: CAN0 Position */ -#define SCU_PNPSET5_CAN0_Msk (0x1ul << SCU_PNPSET5_CAN0_Pos) /*!< SCU_T::PNPSET5: CAN0 Mask */ - -#define SCU_PNPSET5_QEI0_Pos (16) /*!< SCU_T::PNPSET5: QEI0 Position */ -#define SCU_PNPSET5_QEI0_Msk (0x1ul << SCU_PNPSET5_QEI0_Pos) /*!< SCU_T::PNPSET5: QEI0 Mask */ - -#define SCU_PNPSET5_QEI1_Pos (17) /*!< SCU_T::PNPSET5: QEI1 Position */ -#define SCU_PNPSET5_QEI1_Msk (0x1ul << SCU_PNPSET5_QEI1_Pos) /*!< SCU_T::PNPSET5: QEI1 Mask */ - -#define SCU_PNPSET5_ECAP0_Pos (20) /*!< SCU_T::PNPSET5: ECAP0 Position */ -#define SCU_PNPSET5_ECAP0_Msk (0x1ul << SCU_PNPSET5_ECAP0_Pos) /*!< SCU_T::PNPSET5: ECAP0 Mask */ - -#define SCU_PNPSET5_ECAP1_Pos (21) /*!< SCU_T::PNPSET5: ECAP1 Position */ -#define SCU_PNPSET5_ECAP1_Msk (0x1ul << SCU_PNPSET5_ECAP1_Pos) /*!< SCU_T::PNPSET5: ECAP1 Mask */ - -#define SCU_PNPSET5_TRNG_Pos (25) /*!< SCU_T::PNPSET5: TRNG Position */ -#define SCU_PNPSET5_TRNG_Msk (0x1ul << SCU_PNPSET5_TRNG_Pos) /*!< SCU_T::PNPSET5: TRNG Mask */ - -#define SCU_PNPSET5_LCD_Pos (27) /*!< SCU_T::PNPSET5: LCD Position */ -#define SCU_PNPSET5_LCD_Msk (0x1ul << SCU_PNPSET5_LCD_Pos) /*!< SCU_T::PNPSET5: LCD Mask */ - -#define SCU_PNPSET5_TAMPER_Pos (29) /*!< SCU_T::PNPSET5: TAMPER Position */ -#define SCU_PNPSET5_TAMPER_Msk (0x1ul << SCU_PNPSET5_TAMPER_Pos) /*!< SCU_T::PNPSET5: TAMPER Mask */ - -#define SCU_PNPSET6_USBD_Pos (0) /*!< SCU_T::PNPSET6: USBD Position */ -#define SCU_PNPSET6_USBD_Msk (0x1ul << SCU_PNPSET6_USBD_Pos) /*!< SCU_T::PNPSET6: USBD Mask */ - -#define SCU_PNPSET6_USCI0_Pos (16) /*!< SCU_T::PNPSET6: USCI0 Position */ -#define SCU_PNPSET6_USCI0_Msk (0x1ul << SCU_PNPSET6_USCI0_Pos) /*!< SCU_T::PNPSET6: USCI0 Mask */ - -#define SCU_PNPSET6_USCI1_Pos (17) /*!< SCU_T::PNPSET6: USCI1 Position */ -#define SCU_PNPSET6_USCI1_Msk (0x1ul << SCU_PNPSET6_USCI1_Pos) /*!< SCU_T::PNPSET6: USCI1 Mask */ - -#define SCU_IONPSET_PA_Pos (0) /*!< SCU_T::IONPSET: PA Position */ -#define SCU_IONPSET_PA_Msk (0x1ul << SCU_IONPSET_PA_Pos) /*!< SCU_T::IONPSET: PA Mask */ - -#define SCU_IONPSET_PB_Pos (1) /*!< SCU_T::IONPSET: PB Position */ -#define SCU_IONPSET_PB_Msk (0x1ul << SCU_IONPSET_PB_Pos) /*!< SCU_T::IONPSET: PB Mask */ - -#define SCU_IONPSET_PC_Pos (2) /*!< SCU_T::IONPSET: PC Position */ -#define SCU_IONPSET_PC_Msk (0x1ul << SCU_IONPSET_PC_Pos) /*!< SCU_T::IONPSET: PC Mask */ - -#define SCU_IONPSET_PD_Pos (3) /*!< SCU_T::IONPSET: PD Position */ -#define SCU_IONPSET_PD_Msk (0x1ul << SCU_IONPSET_PD_Pos) /*!< SCU_T::IONPSET: PD Mask */ - -#define SCU_IONPSET_PE_Pos (4) /*!< SCU_T::IONPSET: PE Position */ -#define SCU_IONPSET_PE_Msk (0x1ul << SCU_IONPSET_PE_Pos) /*!< SCU_T::IONPSET: PE Mask */ - -#define SCU_IONPSET_PF_Pos (5) /*!< SCU_T::IONPSET: PF Position */ -#define SCU_IONPSET_PF_Msk (0x1ul << SCU_IONPSET_PF_Pos) /*!< SCU_T::IONPSET: PF Mask */ - -#define SCU_IONPSET_PG_Pos (6) /*!< SCU_T::IONPSET: PG Position */ -#define SCU_IONPSET_PG_Msk (0x1ul << SCU_IONPSET_PG_Pos) /*!< SCU_T::IONPSET: PG Mask */ - -#define SCU_IONPSET_PH_Pos (7) /*!< SCU_T::IONPSET: PH Position */ -#define SCU_IONPSET_PH_Msk (0x1ul << SCU_IONPSET_PH_Pos) /*!< SCU_T::IONPSET: PH Mask */ - -#define SCU_SRAMNPSET_SECn_Pos (0) /*!< SCU_T::SRAMNPSET: SECn Position */ -#define SCU_SRAMNPSET_SECn_Msk (0xffffful << SCU_SRAMNPSET_SECn_Pos) /*!< SCU_T::SRAMNPSET: SECn Mask */ - -#define SCU_MEMNPSET_FLASH_Pos (0) /*!< SCU_T::MEMNPSET: FLASH Position */ -#define SCU_MEMNPSET_FLASH_Msk (0x1ul << SCU_MEMNPSET_FLASH_Pos) /*!< SCU_T::MEMNPSET: FLASH Mask */ - -#define SCU_MEMNPSET_EXTMEM_Pos (1) /*!< SCU_T::MEMNPSET: EXTMEM Position */ -#define SCU_MEMNPSET_EXTMEM_Msk (0x1ul << SCU_MEMNPSET_EXTMEM_Pos) /*!< SCU_T::MEMNPSET: EXTMEM Mask */ - -#define SCU_PVIOIEN_APB0IEN_Pos (0) /*!< SCU_T::PVIOIEN: APB0IEN Position */ -#define SCU_PVIOIEN_APB0IEN_Msk (0x1ul << SCU_PVIOIEN_APB0IEN_Pos) /*!< SCU_T::PVIOIEN: APB0IEN Mask */ - -#define SCU_PVIOIEN_APB1IEN_Pos (1) /*!< SCU_T::PVIOIEN: APB1IEN Position */ -#define SCU_PVIOIEN_APB1IEN_Msk (0x1ul << SCU_PVIOIEN_APB1IEN_Pos) /*!< SCU_T::PVIOIEN: APB1IEN Mask */ - -#define SCU_PVIOIEN_GPIOIEN_Pos (4) /*!< SCU_T::PVIOIEN: GPIOIEN Position */ -#define SCU_PVIOIEN_GPIOIEN_Msk (0x1ul << SCU_PVIOIEN_GPIOIEN_Pos) /*!< SCU_T::PVIOIEN: GPIOIEN Mask */ - -#define SCU_PVIOIEN_EBIIEN_Pos (5) /*!< SCU_T::PVIOIEN: EBIIEN Position */ -#define SCU_PVIOIEN_EBIIEN_Msk (0x1ul << SCU_PVIOIEN_EBIIEN_Pos) /*!< SCU_T::PVIOIEN: EBIIEN Mask */ - -#define SCU_PVIOIEN_USBHIEN_Pos (6) /*!< SCU_T::PVIOIEN: USBHIEN Position */ -#define SCU_PVIOIEN_USBHIEN_Msk (0x1ul << SCU_PVIOIEN_USBHIEN_Pos) /*!< SCU_T::PVIOIEN: USBHIEN Mask */ - -#define SCU_PVIOIEN_CRCIEN_Pos (7) /*!< SCU_T::PVIOIEN: CRCIEN Position */ -#define SCU_PVIOIEN_CRCIEN_Msk (0x1ul << SCU_PVIOIEN_CRCIEN_Pos) /*!< SCU_T::PVIOIEN: CRCIEN Mask */ - -#define SCU_PVIOIEN_SDH0IEN_Pos (8) /*!< SCU_T::PVIOIEN: SDH0IEN Position */ -#define SCU_PVIOIEN_SDH0IEN_Msk (0x1ul << SCU_PVIOIEN_SDH0IEN_Pos) /*!< SCU_T::PVIOIEN: SDH0IEN Mask */ - -#define SCU_PVIOIEN_PDMA0IEN_Pos (10) /*!< SCU_T::PVIOIEN: PDMA0IEN Position */ -#define SCU_PVIOIEN_PDMA0IEN_Msk (0x1ul << SCU_PVIOIEN_PDMA0IEN_Pos) /*!< SCU_T::PVIOIEN: PDMA0IEN Mask */ - -#define SCU_PVIOIEN_PDMA1IEN_Pos (11) /*!< SCU_T::PVIOIEN: PDMA1IEN Position */ -#define SCU_PVIOIEN_PDMA1IEN_Msk (0x1ul << SCU_PVIOIEN_PDMA1IEN_Pos) /*!< SCU_T::PVIOIEN: PDMA1IEN Mask */ - -#define SCU_PVIOIEN_SRAM0IEN_Pos (12) /*!< SCU_T::PVIOIEN: SRAM0IEN Position */ -#define SCU_PVIOIEN_SRAM0IEN_Msk (0x1ul << SCU_PVIOIEN_SRAM0IEN_Pos) /*!< SCU_T::PVIOIEN: SRAM0IEN Mask */ - -#define SCU_PVIOIEN_SRAM1IEN_Pos (13) /*!< SCU_T::PVIOIEN: SRAM1IEN Position */ -#define SCU_PVIOIEN_SRAM1IEN_Msk (0x1ul << SCU_PVIOIEN_SRAM1IEN_Pos) /*!< SCU_T::PVIOIEN: SRAM1IEN Mask */ - -#define SCU_PVIOIEN_FMCIEN_Pos (14) /*!< SCU_T::PVIOIEN: FMCIEN Position */ -#define SCU_PVIOIEN_FMCIEN_Msk (0x1ul << SCU_PVIOIEN_FMCIEN_Pos) /*!< SCU_T::PVIOIEN: FMCIEN Mask */ - -#define SCU_PVIOIEN_FLASHIEN_Pos (15) /*!< SCU_T::PVIOIEN: FLASHIEN Position */ -#define SCU_PVIOIEN_FLASHIEN_Msk (0x1ul << SCU_PVIOIEN_FLASHIEN_Pos) /*!< SCU_T::PVIOIEN: FLASHIEN Mask */ - -#define SCU_PVIOIEN_SCUIEN_Pos (16) /*!< SCU_T::PVIOIEN: SCUIEN Position */ -#define SCU_PVIOIEN_SCUIEN_Msk (0x1ul << SCU_PVIOIEN_SCUIEN_Pos) /*!< SCU_T::PVIOIEN: SCUIEN Mask */ - -#define SCU_PVIOIEN_SYSIEN_Pos (17) /*!< SCU_T::PVIOIEN: SYSIEN Position */ -#define SCU_PVIOIEN_SYSIEN_Msk (0x1ul << SCU_PVIOIEN_SYSIEN_Pos) /*!< SCU_T::PVIOIEN: SYSIEN Mask */ - -#define SCU_PVIOIEN_CRPTIEN_Pos (18) /*!< SCU_T::PVIOIEN: CRPTIEN Position */ -#define SCU_PVIOIEN_CRPTIEN_Msk (0x1ul << SCU_PVIOIEN_CRPTIEN_Pos) /*!< SCU_T::PVIOIEN: CRPTIEN Mask */ - -#define SCU_PVIOIEN_KSIEN_Pos (19) /*!< SCU_T::PVIOIEN: KSIEN Position */ -#define SCU_PVIOIEN_KSIEN_Msk (0x1ul << SCU_PVIOIEN_KSIEN_Pos) /*!< SCU_T::PVIOIEN: KSIEN Mask */ - -#define SCU_PVINTSTS_APB0IF_Pos (0) /*!< SCU_T::PVINTSTS: APB0IF Position */ -#define SCU_PVINTSTS_APB0IF_Msk (0x1ul << SCU_PVINTSTS_APB0IF_Pos) /*!< SCU_T::PVINTSTS: APB0IF Mask */ - -#define SCU_PVINTSTS_APB1IF_Pos (1) /*!< SCU_T::PVINTSTS: APB1IF Position */ -#define SCU_PVINTSTS_APB1IF_Msk (0x1ul << SCU_PVINTSTS_APB1IF_Pos) /*!< SCU_T::PVINTSTS: APB1IF Mask */ - -#define SCU_PVINTSTS_GPIOIF_Pos (4) /*!< SCU_T::PVINTSTS: GPIOIF Position */ -#define SCU_PVINTSTS_GPIOIF_Msk (0x1ul << SCU_PVINTSTS_GPIOIF_Pos) /*!< SCU_T::PVINTSTS: GPIOIF Mask */ - -#define SCU_PVINTSTS_EBIIF_Pos (5) /*!< SCU_T::PVINTSTS: EBIIF Position */ -#define SCU_PVINTSTS_EBIIF_Msk (0x1ul << SCU_PVINTSTS_EBIIF_Pos) /*!< SCU_T::PVINTSTS: EBIIF Mask */ - -#define SCU_PVINTSTS_USBHIF_Pos (6) /*!< SCU_T::PVINTSTS: USBHIF Position */ -#define SCU_PVINTSTS_USBHIF_Msk (0x1ul << SCU_PVINTSTS_USBHIF_Pos) /*!< SCU_T::PVINTSTS: USBHIF Mask */ - -#define SCU_PVINTSTS_CRCIF_Pos (7) /*!< SCU_T::PVINTSTS: CRCIF Position */ -#define SCU_PVINTSTS_CRCIF_Msk (0x1ul << SCU_PVINTSTS_CRCIF_Pos) /*!< SCU_T::PVINTSTS: CRCIF Mask */ - -#define SCU_PVINTSTS_SDH0IF_Pos (8) /*!< SCU_T::PVINTSTS: SDH0IF Position */ -#define SCU_PVINTSTS_SDH0IF_Msk (0x1ul << SCU_PVINTSTS_SDH0IF_Pos) /*!< SCU_T::PVINTSTS: SDH0IF Mask */ - -#define SCU_PVINTSTS_PDMA0IF_Pos (10) /*!< SCU_T::PVINTSTS: PDMA0IF Position */ -#define SCU_PVINTSTS_PDMA0IF_Msk (0x1ul << SCU_PVINTSTS_PDMA0IF_Pos) /*!< SCU_T::PVINTSTS: PDMA0IF Mask */ - -#define SCU_PVINTSTS_PDMA1IF_Pos (11) /*!< SCU_T::PVINTSTS: PDMA1IF Position */ -#define SCU_PVINTSTS_PDMA1IF_Msk (0x1ul << SCU_PVINTSTS_PDMA1IF_Pos) /*!< SCU_T::PVINTSTS: PDMA1IF Mask */ - -#define SCU_PVINTSTS_SRAM0IF_Pos (12) /*!< SCU_T::PVINTSTS: SRAM0IF Position */ -#define SCU_PVINTSTS_SRAM0IF_Msk (0x1ul << SCU_PVINTSTS_SRAM0IF_Pos) /*!< SCU_T::PVINTSTS: SRAM0IF Mask */ - -#define SCU_PVINTSTS_SRAM1IF_Pos (13) /*!< SCU_T::PVINTSTS: SRAM1IF Position */ -#define SCU_PVINTSTS_SRAM1IF_Msk (0x1ul << SCU_PVINTSTS_SRAM1IF_Pos) /*!< SCU_T::PVINTSTS: SRAM1IF Mask */ - -#define SCU_PVINTSTS_FMCIF_Pos (14) /*!< SCU_T::PVINTSTS: FMCIF Position */ -#define SCU_PVINTSTS_FMCIF_Msk (0x1ul << SCU_PVINTSTS_FMCIF_Pos) /*!< SCU_T::PVINTSTS: FMCIF Mask */ - -#define SCU_PVINTSTS_FLASHIF_Pos (15) /*!< SCU_T::PVINTSTS: FLASHIF Position */ -#define SCU_PVINTSTS_FLASHIF_Msk (0x1ul << SCU_PVINTSTS_FLASHIF_Pos) /*!< SCU_T::PVINTSTS: FLASHIF Mask */ - -#define SCU_PVINTSTS_SCUIF_Pos (16) /*!< SCU_T::PVINTSTS: SCUIF Position */ -#define SCU_PVINTSTS_SCUIF_Msk (0x1ul << SCU_PVINTSTS_SCUIF_Pos) /*!< SCU_T::PVINTSTS: SCUIF Mask */ - -#define SCU_PVINTSTS_SYSIF_Pos (17) /*!< SCU_T::PVINTSTS: SYSIF Position */ -#define SCU_PVINTSTS_SYSIF_Msk (0x1ul << SCU_PVINTSTS_SYSIF_Pos) /*!< SCU_T::PVINTSTS: SYSIF Mask */ - -#define SCU_PVINTSTS_CRPTIF_Pos (18) /*!< SCU_T::PVINTSTS: CRPTIF Position */ -#define SCU_PVINTSTS_CRPTIF_Msk (0x1ul << SCU_PVINTSTS_CRPTIF_Pos) /*!< SCU_T::PVINTSTS: CRPTIF Mask */ - -#define SCU_PVINTSTS_KSIF_Pos (19) /*!< SCU_T::PVINTSTS: KSIF Position */ -#define SCU_PVINTSTS_KSIF_Msk (0x1ul << SCU_PVINTSTS_KSIF_Pos) /*!< SCU_T::PVINTSTS: KSIF Mask */ - -#define SCU_NSMCTL_PRESCALE_Pos (0) /*!< SCU_T::NSMCTL: PRESCALE Position */ -#define SCU_NSMCTL_PRESCALE_Msk (0xfful << SCU_NSMCTL_PRESCALE_Pos) /*!< SCU_T::NSMCTL: PRESCALE Mask */ - -#define SCU_NSMCTL_NSMIEN_Pos (8) /*!< SCU_T::NSMCTL: NSMIEN Position */ -#define SCU_NSMCTL_NSMIEN_Msk (0x1ul << SCU_NSMCTL_NSMIEN_Pos) /*!< SCU_T::NSMCTL: NSMIEN Mask */ - -#define SCU_NSMCTL_AUTORLD_Pos (9) /*!< SCU_T::NSMCTL: AUTORLD Position */ -#define SCU_NSMCTL_AUTORLD_Msk (0x1ul << SCU_NSMCTL_AUTORLD_Pos) /*!< SCU_T::NSMCTL: AUTORLD Mask */ - -#define SCU_NSMCTL_TMRMOD_Pos (10) /*!< SCU_T::NSMCTL: TMRMOD Position */ -#define SCU_NSMCTL_TMRMOD_Msk (0x1ul << SCU_NSMCTL_TMRMOD_Pos) /*!< SCU_T::NSMCTL: TMRMOD Mask */ - -#define SCU_NSMCTL_IDLEON_Pos (12) /*!< SCU_T::NSMCTL: IDLEON Position */ -#define SCU_NSMCTL_IDLEON_Msk (0x1ul << SCU_NSMCTL_IDLEON_Pos) /*!< SCU_T::NSMCTL: IDLEON Mask */ - -#define SCU_NSMCTL_DBGON_Pos (13) /*!< SCU_T::NSMCTL: DBGON Position */ -#define SCU_NSMCTL_DBGON_Msk (0x1ul << SCU_NSMCTL_DBGON_Pos) /*!< SCU_T::NSMCTL: DBGON Mask */ - -#define SCU_NSMLOAD_RELOAD_Pos (0) /*!< SCU_T::NSMLOAD: RELOAD Position */ -#define SCU_NSMLOAD_RELOAD_Msk (0xfffffful << SCU_NSMLOAD_RELOAD_Pos) /*!< SCU_T::NSMLOAD: RELOAD Mask */ - -#define SCU_NSMVAL_VALUE_Pos (0) /*!< SCU_T::NSMVAL: VALUE Position */ -#define SCU_NSMVAL_VALUE_Msk (0xfffffful << SCU_NSMVAL_VALUE_Pos) /*!< SCU_T::NSMVAL: VALUE Mask */ - -#define SCU_NSMSTS_CURRNS_Pos (0) /*!< SCU_T::NSMSTS: CURRNS Position */ -#define SCU_NSMSTS_CURRNS_Msk (0x1ul << SCU_NSMSTS_CURRNS_Pos) /*!< SCU_T::NSMSTS: CURRNS Mask */ - -#define SCU_NSMSTS_NSMIF_Pos (1) /*!< SCU_T::NSMSTS: NSMIF Position */ -#define SCU_NSMSTS_NSMIF_Msk (0x1ul << SCU_NSMSTS_NSMIF_Pos) /*!< SCU_T::NSMSTS: NSMIF Mask */ - -#define SCU_BBE_BBEEN_Pos (0) /*!< SCU_T::BBE: BBEEN Position */ -#define SCU_BBE_BBEEN_Msk (0x1ul << SCU_BBE_BBEEN_Pos) /*!< SCU_T::BBE: BBEEN Mask */ - -#define SCU_BBE_WVERY_Pos (8) /*!< SCU_T::BBE: WVERY Position */ -#define SCU_BBE_WVERY_Msk (0xfffffful << SCU_BBE_WVERY_Pos) /*!< SCU_T::BBE: WVERY Mask */ - -#define SCU_IDAUANS_IDAUANSEN_Pos (0) /*!< SCU_T::IDAUANS: IDAUANSEN Position */ -#define SCU_IDAUANS_IDAUANSEN_Msk (0x1ul << SCU_IDAUANS_IDAUANSEN_Pos) /*!< SCU_T::IDAUANS: IDAUANSEN Mask */ - -#define SCU_IDAUANS_WVERY_Pos (8) /*!< SCU_T::IDAUANS: WVERY Position */ -#define SCU_IDAUANS_WVERY_Msk (0xfffffful << SCU_IDAUANS_WVERY_Pos) /*!< SCU_T::IDAUANS: WVERY Mask */ - -#define SCU_VERSION_MINOR_Pos (0) /*!< SCU_T::VERSION: MINOR Position */ -#define SCU_VERSION_MINOR_Msk (0xfffful << SCU_VERSION_MINOR_Pos) /*!< SCU_T::VERSION: MINOR Mask */ - -#define SCU_VERSION_SUB_Pos (16) /*!< SCU_T::VERSION: SUB Position */ -#define SCU_VERSION_SUB_Msk (0xfful << SCU_VERSION_SUB_Pos) /*!< SCU_T::VERSION: SUB Mask */ - -#define SCU_VERSION_MAJOR_Pos (24) /*!< SCU_T::VERSION: MAJOR Position */ -#define SCU_VERSION_MAJOR_Msk (0xfful << SCU_VERSION_MAJOR_Pos) /*!< SCU_T::VERSION: MAJOR Mask */ - -/**@}*/ /* SCU_CONST */ -/**@}*/ /* end of SCU register group */ - - -/**@}*/ /* end of REGISTER group */ -#endif /* __SCU_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sdh_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sdh_reg.h deleted file mode 100644 index 2ce64f3c52a..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sdh_reg.h +++ /dev/null @@ -1,528 +0,0 @@ -/**************************************************************************//** - * @file sdh_reg.h - * @version V1.00 - * @brief SDH register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SDH_REG_H__ -#define __SDH_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- SD Card Host Interface -------------------------*/ -/** - @addtogroup SDH SD Card Host Interface(SDH) - Memory Mapped Structure for SDH Controller - @{ -*/ - -typedef struct -{ - - /** - * @var SDH_T::FB - * Offset: 0x00~0x7C Shared Buffer (FIFO) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |BUFFER |Shared Buffer - * | | |Buffer for DMA transfer - * @var SDH_T::DMACTL - * Offset: 0x400 DMA Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMAEN |DMA Engine Enable Bit - * | | |If this bit is cleared, DMA will ignore all requests from SD host and force bus master into IDLE state. - * | | |0 = DMA Disabled. - * | | |1 = DMA Enabled. - * | | |Note: If target abort is occurred, DMAEN will be cleared. - * |[1] |DMARST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset internal state machine and pointers - * | | |The contents of control register will not be cleared - * | | |This bit will auto be cleared after few clock cycles. - * | | |Note: The software reset DMA related registers. - * |[3] |SGEN |Scatter-gather Function Enable Bit - * | | |0 = Scatter-gather function Disabled (DMA will treat the starting address in DMASAR as starting pointer of a single block memory). - * | | |1 = Scatter-gather function Enabled (DMA will treat the starting address in DMASAR as a starting address of Physical Address Descriptor (PAD) table - * | | |The format of these Pads' will be described later). - * |[9] |DMABUSY |DMA Transfer Is in Progress - * | | |This bit indicates if SD Host is granted and doing DMA transfer or not. - * | | |0 = DMA transfer is not in progress. - * | | |1 = DMA transfer is in progress. - * @var SDH_T::DMASA - * Offset: 0x408 DMA Transfer Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ORDER |Determined to the PAD Table Fetching Is in Order or Out of Order - * | | |0 = PAD table is fetched in order. - * | | |1 = PAD table is fetched out of order. - * | | |Note: the bit0 is valid in scatter-gather mode when SGEN = 1. - * |[31:1] |DMASA |DMA Transfer Starting Address - * | | |This field pads 0 as least significant bit indicates a 32-bit starting address of system memory (SRAM) for DMA to retrieve or fill in data. - * | | |If DMA is not in normal mode, this field will be interpreted as a starting address of Physical Address Descriptor (PAD) table. - * | | |Note: Starting address of the SRAM must be word aligned, for example, 0x0000_0000, 0x0000_0004. - * @var SDH_T::DMABCNT - * Offset: 0x40C DMA Transfer Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[25:0] |BCNT |DMA Transfer Byte Count (Read Only) - * | | |This field indicates the remained byte count of DMA transfer - * | | |The value of this field is valid only when DMA is busy; otherwise, it is 0. - * @var SDH_T::DMAINTEN - * Offset: 0x410 DMA Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIEN |DMA Read/Write Target Abort Interrupt Enable Bit - * | | |0 = Target abort interrupt generation Disabled during DMA transfer. - * | | |1 = Target abort interrupt generation Enabled during DMA transfer. - * |[1] |WEOTIEN |Wrong EOT Encountered Interrupt Enable Bit - * | | |0 = Interrupt generation Disabled when wrong EOT is encountered. - * | | |1 = Interrupt generation Enabled when wrong EOT is encountered. - * @var SDH_T::DMAINTSTS - * Offset: 0x414 DMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIF |DMA Read/Write Target Abort Interrupt Flag - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note1: This bit is read only, but can be cleared by writing '1' to it. - * | | |Note2: When DMA's bus master received ERROR response, it means that target abort is happened - * | | |DMA will stop transfer and respond this event and then go to IDLE state - * | | |When target abort occurred or WEOTIF is set, software must reset DMA and SD host, and then transfer those data again. - * |[1] |WEOTIF |Wrong EOT Encountered Interrupt Flag - * | | |When DMA Scatter-Gather function is enabled, and EOT of the descriptor is encountered before DMA transfer finished (that means the total sector count of all PAD is less than the sector count of SD host), this bit will be set. - * | | |0 = No EOT encountered before DMA transfer finished. - * | | |1 = EOT encountered before DMA transfer finished. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::GCTL - * Offset: 0x800 Global Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset SD host - * | | |The contents of control register will not be cleared - * | | |This bit will auto cleared after reset complete. - * |[1] |SDEN |Secure Digital Functionality Enable Bit - * | | |0 = SD functionality disabled. - * | | |1 = SD functionality enabled. - * @var SDH_T::GINTEN - * Offset: 0x804 Global Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIEN |DMA READ/WRITE Target Abort Interrupt Enable Bit - * | | |0 = DMA READ/WRITE target abort interrupt generation disabled. - * | | |1 = DMA READ/WRITE target abort interrupt generation enabled. - * @var SDH_T::GINTSTS - * Offset: 0x808 Global Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIF |DMA READ/WRITE Target Abort Interrupt Flag (Read Only) - * | | |This bit indicates DMA received an ERROR response from internal AHB bus during DMA read/write operation - * | | |When Target Abort is occurred, please reset all engine. - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::CTL - * Offset: 0x820 SD Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |COEN |Command Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output a command to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[1] |RIEN |Response Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[2] |DIEN |Data Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive block data and the CRC16 value from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[3] |DOEN |Data Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will transfer block data and the CRC16 value to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[4] |R2EN |Response R2 Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response R2 from SD card and store the response data into DMC's flash buffer (exclude CRC7). - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[5] |CLK74OEN |Initial 74 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 74 clock cycles to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[6] |CLK8OEN |Generating 8 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 8 clock cycles. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[7] |CLKKEEP0 |SD Clock Enable Control for Port 0 - * | | |0 = SD host decided when to output clock and when to disable clock output automatically. - * | | |1 = SD clock always keeps free running. - * |[13:8] |CMDCODE |SD Command Code - * | | |This register contains the SD command code (0x00 ~ 0x3F). - * |[14] |CTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset the internal state machine and counters - * | | |The contents of control register will not be cleared (but RIEN, DIEN, DOEN and R2EN will be cleared) - * | | |This bit will be auto cleared after few clock cycles. - * |[15] |DBW |SD Data Bus Width (for 1-bit / 4-bit Selection) - * | | |0 = Data bus width is 1-bit. - * | | |1 = Data bus width is 4-bit. - * |[23:16] |BLKCNT |Block Counts to Be Transferred or Received - * | | |This field contains the block counts for data-in and data-out transfer - * | | |For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, software can use this function to accelerate data transfer and improve performance - * | | |Don't fill 0x0 to this field. - * | | |Note: For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, the actual total length is BLKCNT * (BLKLEN +1). - * |[27:24] |SDNWR |NWR Parameter for Block Write Operation - * | | |This value indicates the NWR parameter for data block write operation in SD clock counts - * | | |The actual clock cycle will be SDNWR+1. - * @var SDH_T::CMDARG - * Offset: 0x824 SD Command Argument Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ARGUMENT |SD Command Argument - * | | |This register contains a 32-bit value specifies the argument of SD command from host controller to SD card - * | | |Before trigger COEN (SDH_CTL [0]), software should fill argument in this field. - * @var SDH_T::INTEN - * Offset: 0x828 SD Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIEN |Block Transfer Done Interrupt Enable Bit - * | | |0 = SD host will not generate interrupt when data-in (out) transfer done. - * | | |1 = SD host will generate interrupt when data-in (out) transfer done. - * |[1] |CRCIEN |CRC7, CRC16 and CRC Status Error Interrupt Enable Bit - * | | |0 = SD host will not generate interrupt when CRC7, CRC16 and CRC status is error. - * | | |1 = SD host will generate interrupt when CRC7, CRC16 and CRC status is error. - * |[8] |CDIEN0 |SD0 Card Detection Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when card 0 is inserted or removed. - * | | |0 = SD card detection interrupt Disabled. - * | | |1 = SD card detection interrupt Enabled. - * |[12] |RTOIEN |Response Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when receiving response or R2 time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = Response time-out interrupt Disabled. - * | | |1 = Response time-out interrupt Enabled. - * |[13] |DITOIEN |Data Input Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when data input time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = Data input time-out interrupt Disabled. - * | | |1 = Data input time-out interrupt Enabled. - * |[14] |WKIEN |Wake-up Signal Generating Enable Bit - * | | |Enable/Disable wake-up signal generating of SD host when current using SD card issues an interrupt (wake-up) via DAT [1] to host. - * | | |0 = Wake-up signal generating Disabled. - * | | |1 = Wake-up signal generating Enabled. - * |[30] |CDSRC0 |SD0 Card Detect Source Selection - * | | |0 = From SD0 card's DAT3 pin. - * | | |Host need clock to got data on pin DAT3 - * | | |Please make sure CLKKEEP0 (SDH_CTL[7]) is 1 in order to generate free running clock for DAT3 pin. - * | | |1 = From GPIO pin. - * @var SDH_T::INTSTS - * Offset: 0x82C SD Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIF |Block Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has finished all data-in or data-out block transfer - * | | |If there is a CRC16 error or incorrect CRC status during multiple block data transfer, the transfer will be broken and this bit will also be set. - * | | |0 = Not finished yet. - * | | |1 = Done. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[1] |CRCIF |CRC7, CRC16 and CRC Status Error Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has occurred CRC error during response in, data-in or data-out (CRC status error) transfer - * | | |When CRC error is occurred, software should reset SD engine - * | | |Some response (ex - * | | |R3) doesn't have CRC7 information with it; SD host will still calculate CRC7, get CRC error and set this flag - * | | |In this condition, software should ignore CRC error and clears this bit manually. - * | | |0 = No CRC error is occurred. - * | | |1 = CRC error is occurred. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[2] |CRC7 |CRC7 Check Status (Read Only) - * | | |SD host will check CRC7 correctness during each response in - * | | |If that response does not contain CRC7 information (ex - * | | |R3), then software should turn off CRCIEN (SDH_INTEN[1]) and ignore this bit. - * | | |0 = Fault. - * | | |1 = OK. - * |[3] |CRC16 |CRC16 Check Status of Data-in Transfer (Read Only) - * | | |SD host will check CRC16 correctness after data-in transfer. - * | | |0 = Fault. - * | | |1 = OK. - * |[6:4] |CRCSTS |CRC Status Value of Data-out Transfer (Read Only) - * | | |SD host will record CRC status of data-out transfer - * | | |Software could use this value to identify what type of error is during data-out transfer. - * | | |010 = Positive CRC status. - * | | |101 = Negative CRC status. - * | | |111 = SD card programming error occurs. - * |[7] |DAT0STS |DAT0 Pin Status of Current Selected SD Port (Read Only) - * | | |This bit is the DAT0 pin status of current selected SD port. - * |[8] |CDIF0 |SD0 Card Detection Interrupt Flag (Read Only) - * | | |This bit indicates that SD card 0 is inserted or removed - * | | |Only when CDIEN0 (SDH_INTEN[8]) is set to 1, this bit is active. - * | | |0 = No card is inserted or removed. - * | | |1 = There is a card inserted in or removed from SD0. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[12] |RTOIF |Response Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving response or R2 (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Response time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[13] |DITOIF |Data Input Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving data (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Data input time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[16] |CDSTS0 |Card Detect Status of SD0 (Read Only) - * | | |This bit indicates the card detect pin status of SD0, and is used for card detection - * | | |When there is a card inserted in or removed from SD0, software should check this bit to confirm if there is really a card insertion or removal. - * | | |If CDSRC0 (SDH_INTEN[30]) = 0, to select DAT3 for card detection:. - * | | |0 = Card removed. - * | | |1 = Card inserted. - * | | |If CDSRC0 (SDH_INTEN[30]) = 1, to select GPIO for card detection:. - * | | |0 = Card inserted. - * | | |1 = Card removed. - * |[18] |DAT1STS |DAT1 Pin Status of SD Port (Read Only) - * | | |This bit indicates the DAT1 pin status of SD port. - * @var SDH_T::RESP0 - * Offset: 0x830 SD Receiving Response Token Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RESPTK0 |SD Receiving Response Token 0 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This field contains response bit 47-16 of the response token. - * @var SDH_T::RESP1 - * Offset: 0x834 SD Receiving Response Token Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RESPTK1 |SD Receiving Response Token 1 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This register contains the bit 15-8 of the response token. - * @var SDH_T::BLEN - * Offset: 0x838 SD Block Length Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |BLKLEN |SD BLOCK LENGTH in Byte Unit - * | | |An 11-bit value specifies the SD transfer byte count of a block - * | | |The actual byte count is equal to BLKLEN+1. - * | | |Note: The default SD block length is 512 bytes - * @var SDH_T::TOUT - * Offset: 0x83C SD Response/Data-in Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |TOUT |SD Response/Data-in Time-out Value - * | | |A 24-bit value specifies the time-out counts of response and data input - * | | |SD host controller will wait start bit of response or data-in until this value reached - * | | |The time period depends on SD engine clock frequency - * | | |Do not write a small number into this field, or you may never get response or data due to time-out. - * | | |Note: Filling 0x0 into this field will disable hardware time-out function. - */ - - __IO uint32_t FB[32]; /*!< Shared Buffer (FIFO) */ - __I uint32_t RESERVE0[224]; - __IO uint32_t DMACTL; /*!< [0x0400] DMA Control and Status Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t DMASA; /*!< [0x0408] DMA Transfer Starting Address Register */ - __I uint32_t DMABCNT; /*!< [0x040c] DMA Transfer Byte Count Register */ - __IO uint32_t DMAINTEN; /*!< [0x0410] DMA Interrupt Enable Control Register */ - __IO uint32_t DMAINTSTS; /*!< [0x0414] DMA Interrupt Status Register */ - __I uint32_t RESERVE2[250]; - __IO uint32_t GCTL; /*!< [0x0800] Global Control and Status Register */ - __IO uint32_t GINTEN; /*!< [0x0804] Global Interrupt Control Register */ - __IO uint32_t GINTSTS; /*!< [0x0808] Global Interrupt Status Register */ - __I uint32_t RESERVE3[5]; - __IO uint32_t CTL; /*!< [0x0820] SD Control and Status Register */ - __IO uint32_t CMDARG; /*!< [0x0824] SD Command Argument Register */ - __IO uint32_t INTEN; /*!< [0x0828] SD Interrupt Control Register */ - __IO uint32_t INTSTS; /*!< [0x082c] SD Interrupt Status Register */ - __I uint32_t RESP0; /*!< [0x0830] SD Receiving Response Token Register 0 */ - __I uint32_t RESP1; /*!< [0x0834] SD Receiving Response Token Register 1 */ - __IO uint32_t BLEN; /*!< [0x0838] SD Block Length Register */ - __IO uint32_t TOUT; /*!< [0x083c] SD Response/Data-in Time-out Register */ - -} SDH_T; - -/** - @addtogroup SDH_CONST SDH Bit Field Definition - Constant Definitions for SDH Controller - @{ -*/ - -#define SDH_DMACTL_DMAEN_Pos (0) /*!< SDH_T::DMACTL: DMAEN Position */ -#define SDH_DMACTL_DMAEN_Msk (0x1ul << SDH_DMACTL_DMAEN_Pos) /*!< SDH_T::DMACTL: DMAEN Mask */ - -#define SDH_DMACTL_DMARST_Pos (1) /*!< SDH_T::DMACTL: DMARST Position */ -#define SDH_DMACTL_DMARST_Msk (0x1ul << SDH_DMACTL_DMARST_Pos) /*!< SDH_T::DMACTL: DMARST Mask */ - -#define SDH_DMACTL_SGEN_Pos (3) /*!< SDH_T::DMACTL: SGEN Position */ -#define SDH_DMACTL_SGEN_Msk (0x1ul << SDH_DMACTL_SGEN_Pos) /*!< SDH_T::DMACTL: SGEN Mask */ - -#define SDH_DMACTL_DMABUSY_Pos (9) /*!< SDH_T::DMACTL: DMABUSY Position */ -#define SDH_DMACTL_DMABUSY_Msk (0x1ul << SDH_DMACTL_DMABUSY_Pos) /*!< SDH_T::DMACTL: DMABUSY Mask */ - -#define SDH_DMASA_ORDER_Pos (0) /*!< SDH_T::DMASA: ORDER Position */ -#define SDH_DMASA_ORDER_Msk (0x1ul << SDH_DMASA_ORDER_Pos) /*!< SDH_T::DMASA: ORDER Mask */ - -#define SDH_DMASA_DMASA_Pos (1) /*!< SDH_T::DMASA: DMASA Position */ -#define SDH_DMASA_DMASA_Msk (0x7ffffffful << SDH_DMASA_DMASA_Pos) /*!< SDH_T::DMASA: DMASA Mask */ - -#define SDH_DMABCNT_BCNT_Pos (0) /*!< SDH_T::DMABCNT: BCNT Position */ -#define SDH_DMABCNT_BCNT_Msk (0x3fffffful << SDH_DMABCNT_BCNT_Pos) /*!< SDH_T::DMABCNT: BCNT Mask */ - -#define SDH_DMAINTEN_ABORTIEN_Pos (0) /*!< SDH_T::DMAINTEN: ABORTIEN Position */ -#define SDH_DMAINTEN_ABORTIEN_Msk (0x1ul << SDH_DMAINTEN_ABORTIEN_Pos) /*!< SDH_T::DMAINTEN: ABORTIEN Mask */ - -#define SDH_DMAINTEN_WEOTIEN_Pos (1) /*!< SDH_T::DMAINTEN: WEOTIEN Position */ -#define SDH_DMAINTEN_WEOTIEN_Msk (0x1ul << SDH_DMAINTEN_WEOTIEN_Pos) /*!< SDH_T::DMAINTEN: WEOTIEN Mask */ - -#define SDH_DMAINTSTS_ABORTIF_Pos (0) /*!< SDH_T::DMAINTSTS: ABORTIF Position */ -#define SDH_DMAINTSTS_ABORTIF_Msk (0x1ul << SDH_DMAINTSTS_ABORTIF_Pos) /*!< SDH_T::DMAINTSTS: ABORTIF Mask */ - -#define SDH_DMAINTSTS_WEOTIF_Pos (1) /*!< SDH_T::DMAINTSTS: WEOTIF Position */ -#define SDH_DMAINTSTS_WEOTIF_Msk (0x1ul << SDH_DMAINTSTS_WEOTIF_Pos) /*!< SDH_T::DMAINTSTS: WEOTIF Mask */ - -#define SDH_GCTL_GCTLRST_Pos (0) /*!< SDH_T::GCTL: GCTLRST Position */ -#define SDH_GCTL_GCTLRST_Msk (0x1ul << SDH_GCTL_GCTLRST_Pos) /*!< SDH_T::GCTL: GCTLRST Mask */ - -#define SDH_GCTL_SDEN_Pos (1) /*!< SDH_T::GCTL: SDEN Position */ -#define SDH_GCTL_SDEN_Msk (0x1ul << SDH_GCTL_SDEN_Pos) /*!< SDH_T::GCTL: SDEN Mask */ - -#define SDH_GINTEN_DTAIEN_Pos (0) /*!< SDH_T::GINTEN: DTAIEN Position */ -#define SDH_GINTEN_DTAIEN_Msk (0x1ul << SDH_GINTEN_DTAIEN_Pos) /*!< SDH_T::GINTEN: DTAIEN Mask */ - -#define SDH_GINTSTS_DTAIF_Pos (0) /*!< SDH_T::GINTSTS: DTAIF Position */ -#define SDH_GINTSTS_DTAIF_Msk (0x1ul << SDH_GINTSTS_DTAIF_Pos) /*!< SDH_T::GINTSTS: DTAIF Mask */ - -#define SDH_CTL_COEN_Pos (0) /*!< SDH_T::CTL: COEN Position */ -#define SDH_CTL_COEN_Msk (0x1ul << SDH_CTL_COEN_Pos) /*!< SDH_T::CTL: COEN Mask */ - -#define SDH_CTL_RIEN_Pos (1) /*!< SDH_T::CTL: RIEN Position */ -#define SDH_CTL_RIEN_Msk (0x1ul << SDH_CTL_RIEN_Pos) /*!< SDH_T::CTL: RIEN Mask */ - -#define SDH_CTL_DIEN_Pos (2) /*!< SDH_T::CTL: DIEN Position */ -#define SDH_CTL_DIEN_Msk (0x1ul << SDH_CTL_DIEN_Pos) /*!< SDH_T::CTL: DIEN Mask */ - -#define SDH_CTL_DOEN_Pos (3) /*!< SDH_T::CTL: DOEN Position */ -#define SDH_CTL_DOEN_Msk (0x1ul << SDH_CTL_DOEN_Pos) /*!< SDH_T::CTL: DOEN Mask */ - -#define SDH_CTL_R2EN_Pos (4) /*!< SDH_T::CTL: R2EN Position */ -#define SDH_CTL_R2EN_Msk (0x1ul << SDH_CTL_R2EN_Pos) /*!< SDH_T::CTL: R2EN Mask */ - -#define SDH_CTL_CLK74OEN_Pos (5) /*!< SDH_T::CTL: CLK74OEN Position */ -#define SDH_CTL_CLK74OEN_Msk (0x1ul << SDH_CTL_CLK74OEN_Pos) /*!< SDH_T::CTL: CLK74OEN Mask */ - -#define SDH_CTL_CLK8OEN_Pos (6) /*!< SDH_T::CTL: CLK8OEN Position */ -#define SDH_CTL_CLK8OEN_Msk (0x1ul << SDH_CTL_CLK8OEN_Pos) /*!< SDH_T::CTL: CLK8OEN Mask */ - -#define SDH_CTL_CLKKEEP_Pos (7) /*!< SDH_T::CTL: CLKKEEP Position */ -#define SDH_CTL_CLKKEEP_Msk (0x1ul << SDH_CTL_CLKKEEP_Pos) /*!< SDH_T::CTL: CLKKEEP Mask */ - -#define SDH_CTL_CMDCODE_Pos (8) /*!< SDH_T::CTL: CMDCODE Position */ -#define SDH_CTL_CMDCODE_Msk (0x3ful << SDH_CTL_CMDCODE_Pos) /*!< SDH_T::CTL: CMDCODE Mask */ - -#define SDH_CTL_CTLRST_Pos (14) /*!< SDH_T::CTL: CTLRST Position */ -#define SDH_CTL_CTLRST_Msk (0x1ul << SDH_CTL_CTLRST_Pos) /*!< SDH_T::CTL: CTLRST Mask */ - -#define SDH_CTL_DBW_Pos (15) /*!< SDH_T::CTL: DBW Position */ -#define SDH_CTL_DBW_Msk (0x1ul << SDH_CTL_DBW_Pos) /*!< SDH_T::CTL: DBW Mask */ - -#define SDH_CTL_BLKCNT_Pos (16) /*!< SDH_T::CTL: BLKCNT Position */ -#define SDH_CTL_BLKCNT_Msk (0xfful << SDH_CTL_BLKCNT_Pos) /*!< SDH_T::CTL: BLKCNT Mask */ - -#define SDH_CTL_SDNWR_Pos (24) /*!< SDH_T::CTL: SDNWR Position */ -#define SDH_CTL_SDNWR_Msk (0xful << SDH_CTL_SDNWR_Pos) /*!< SDH_T::CTL: SDNWR Mask */ - -#define SDH_CMDARG_ARGUMENT_Pos (0) /*!< SDH_T::CMDARG: ARGUMENT Position */ -#define SDH_CMDARG_ARGUMENT_Msk (0xfffffffful << SDH_CMDARG_ARGUMENT_Pos) /*!< SDH_T::CMDARG: ARGUMENT Mask */ - -#define SDH_INTEN_BLKDIEN_Pos (0) /*!< SDH_T::INTEN: BLKDIEN Position */ -#define SDH_INTEN_BLKDIEN_Msk (0x1ul << SDH_INTEN_BLKDIEN_Pos) /*!< SDH_T::INTEN: BLKDIEN Mask */ - -#define SDH_INTEN_CRCIEN_Pos (1) /*!< SDH_T::INTEN: CRCIEN Position */ -#define SDH_INTEN_CRCIEN_Msk (0x1ul << SDH_INTEN_CRCIEN_Pos) /*!< SDH_T::INTEN: CRCIEN Mask */ - -#define SDH_INTEN_CDIEN_Pos (8) /*!< SDH_T::INTEN: CDIEN Position */ -#define SDH_INTEN_CDIEN_Msk (0x1ul << SDH_INTEN_CDIEN_Pos) /*!< SDH_T::INTEN: CDIEN Mask */ - -#define SDH_INTEN_RTOIEN_Pos (12) /*!< SDH_T::INTEN: RTOIEN Position */ -#define SDH_INTEN_RTOIEN_Msk (0x1ul << SDH_INTEN_RTOIEN_Pos) /*!< SDH_T::INTEN: RTOIEN Mask */ - -#define SDH_INTEN_DITOIEN_Pos (13) /*!< SDH_T::INTEN: DITOIEN Position */ -#define SDH_INTEN_DITOIEN_Msk (0x1ul << SDH_INTEN_DITOIEN_Pos) /*!< SDH_T::INTEN: DITOIEN Mask */ - -#define SDH_INTEN_WKIEN_Pos (14) /*!< SDH_T::INTEN: WKIEN Position */ -#define SDH_INTEN_WKIEN_Msk (0x1ul << SDH_INTEN_WKIEN_Pos) /*!< SDH_T::INTEN: WKIEN Mask */ - -#define SDH_INTEN_CDSRC_Pos (30) /*!< SDH_T::INTEN: CDSRC Position */ -#define SDH_INTEN_CDSRC_Msk (0x1ul << SDH_INTEN_CDSRC_Pos) /*!< SDH_T::INTEN: CDSRC Mask */ - -#define SDH_INTSTS_BLKDIF_Pos (0) /*!< SDH_T::INTSTS: BLKDIF Position */ -#define SDH_INTSTS_BLKDIF_Msk (0x1ul << SDH_INTSTS_BLKDIF_Pos) /*!< SDH_T::INTSTS: BLKDIF Mask */ - -#define SDH_INTSTS_CRCIF_Pos (1) /*!< SDH_T::INTSTS: CRCIF Position */ -#define SDH_INTSTS_CRCIF_Msk (0x1ul << SDH_INTSTS_CRCIF_Pos) /*!< SDH_T::INTSTS: CRCIF Mask */ - -#define SDH_INTSTS_CRC7_Pos (2) /*!< SDH_T::INTSTS: CRC7 Position */ -#define SDH_INTSTS_CRC7_Msk (0x1ul << SDH_INTSTS_CRC7_Pos) /*!< SDH_T::INTSTS: CRC7 Mask */ - -#define SDH_INTSTS_CRC16_Pos (3) /*!< SDH_T::INTSTS: CRC16 Position */ -#define SDH_INTSTS_CRC16_Msk (0x1ul << SDH_INTSTS_CRC16_Pos) /*!< SDH_T::INTSTS: CRC16 Mask */ - -#define SDH_INTSTS_CRCSTS_Pos (4) /*!< SDH_T::INTSTS: CRCSTS Position */ -#define SDH_INTSTS_CRCSTS_Msk (0x7ul << SDH_INTSTS_CRCSTS_Pos) /*!< SDH_T::INTSTS: CRCSTS Mask */ - -#define SDH_INTSTS_DAT0STS_Pos (7) /*!< SDH_T::INTSTS: DAT0STS Position */ -#define SDH_INTSTS_DAT0STS_Msk (0x1ul << SDH_INTSTS_DAT0STS_Pos) /*!< SDH_T::INTSTS: DAT0STS Mask */ - -#define SDH_INTSTS_CDIF_Pos (8) /*!< SDH_T::INTSTS: CDIF Position */ -#define SDH_INTSTS_CDIF_Msk (0x1ul << SDH_INTSTS_CDIF_Pos) /*!< SDH_T::INTSTS: CDIF Mask */ - -#define SDH_INTSTS_RTOIF_Pos (12) /*!< SDH_T::INTSTS: RTOIF Position */ -#define SDH_INTSTS_RTOIF_Msk (0x1ul << SDH_INTSTS_RTOIF_Pos) /*!< SDH_T::INTSTS: RTOIF Mask */ - -#define SDH_INTSTS_DITOIF_Pos (13) /*!< SDH_T::INTSTS: DITOIF Position */ -#define SDH_INTSTS_DITOIF_Msk (0x1ul << SDH_INTSTS_DITOIF_Pos) /*!< SDH_T::INTSTS: DITOIF Mask */ - -#define SDH_INTSTS_CDSTS_Pos (16) /*!< SDH_T::INTSTS: CDSTS Position */ -#define SDH_INTSTS_CDSTS_Msk (0x1ul << SDH_INTSTS_CDSTS_Pos) /*!< SDH_T::INTSTS: CDSTS Mask */ - -#define SDH_INTSTS_DAT1STS_Pos (18) /*!< SDH_T::INTSTS: DAT1STS Position */ -#define SDH_INTSTS_DAT1STS_Msk (0x1ul << SDH_INTSTS_DAT1STS_Pos) /*!< SDH_T::INTSTS: DAT1STS Mask */ - -#define SDH_RESP0_RESPTK0_Pos (0) /*!< SDH_T::RESP0: RESPTK0 Position */ -#define SDH_RESP0_RESPTK0_Msk (0xfffffffful << SDH_RESP0_RESPTK0_Pos) /*!< SDH_T::RESP0: RESPTK0 Mask */ - -#define SDH_RESP1_RESPTK1_Pos (0) /*!< SDH_T::RESP1: RESPTK1 Position */ -#define SDH_RESP1_RESPTK1_Msk (0xfful << SDH_RESP1_RESPTK1_Pos) /*!< SDH_T::RESP1: RESPTK1 Mask */ - -#define SDH_BLEN_BLKLEN_Pos (0) /*!< SDH_T::BLEN: BLKLEN Position */ -#define SDH_BLEN_BLKLEN_Msk (0x7fful << SDH_BLEN_BLKLEN_Pos) /*!< SDH_T::BLEN: BLKLEN Mask */ - -#define SDH_TOUT_TOUT_Pos (0) /*!< SDH_T::TOUT: TOUT Position */ -#define SDH_TOUT_TOUT_Msk (0xfffffful << SDH_TOUT_TOUT_Pos) /*!< SDH_T::TOUT: TOUT Mask */ - -/**@}*/ /* SDH_CONST */ -/**@}*/ /* end of SDH register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __SDH_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/spi_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/spi_reg.h deleted file mode 100644 index 343b6239e49..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/spi_reg.h +++ /dev/null @@ -1,854 +0,0 @@ -/**************************************************************************//** - * @file spi_reg.h - * @version V1.00 - * @brief SPI register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SPI_REG_H__ -#define __SPI_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Serial Peripheral Interface Controller -------------------------*/ -/** - @addtogroup SPI Serial Peripheral Interface Controller(SPI) - Memory Mapped Structure for SPI Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var SPI_T::CTL - * Offset: 0x00 SPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIEN |SPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1 - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of SPIx_CTL, SPIx_CLKDIV, SPIx_SSCTL and SPIx_FIFOCTL registers, user shall clear the SPIEN (SPIx_CTL[0]) and confirm the SPIENSTS (SPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of SPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of SPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of SPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of SPI bus clock. - * |[3] |CLKPOL |Clock Polarity - * | | |0 = SPI bus clock is idle low. - * | | |1 = SPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval (Master Only) - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 .... 0.5 SPICLK clock cycle. - * | | |SUSPITV = 0x1 .... 1.5 SPICLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE .... 14.5 SPICLK clock cycle. - * | | |SUSPITV = 0xF .... 15.5 SPICLK clock cycle. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 .... 8 bits. - * | | |DWIDTH = 0x09 .... 9 bits. - * | | |..... - * | | |DWIDTH = 0x1F .... 31 bits. - * | | |DWIDTH = 0x00 .... 32 bits. - * | | |Note: For SPI0~SPI3, this bit field will decide the depth of TX/RX FIFO configuration in SPI mode - * | | |Therefore, changing this bit field will clear TX/RX FIFO by hardware automatically in SPI0~SPI3. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the SPI TX register, is sent first to the SPI data output pin, and the first bit received from the SPI data input pin will be put in the LSB position of the RX register (bit 0 of SPI_RX). - * |[14] |HALFDPX |SPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for SPI transfer - * | | |The bit field DATDIR (SPIx_CTL[20]) can be used to set the data direction in half-duplex transfer. - * | | |0 = SPI operates in full-duplex transfer. - * | | |1 = SPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only Mode Enable Bit (Master Only) - * | | |This bit field is only available in Master mode - * | | |In receive-only mode, SPI Master will generate SPI bus clock continuously for receiving data bit from SPI slave device and assert the BUSY status. - * | | |0 = Receive-only mode Disabled. - * | | |1 = Receive-only mode Enabled. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = SPI unit transfer interrupt Disabled. - * | | |1 = SPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled - * | | |A byte suspend interval will be inserted among each byte - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction in half-duplex transfer and Dual/Quad transfer - * | | |0 = SPI data is input direction. - * | | |1 = SPI data is output direction. - * @var SPI_T::CLKDIV - * Offset: 0x04 SPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the SPI bus clock of SPI Master - * | | |The frequency is obtained according to the following equation. - * | | |where - * | | |is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * | | |Note 1: Not supported in I2S mode. - * | | |Note 2: The time interval must be larger than or equal 5 peripheral clock cycles between releasing SPI IP software reset and setting this clock divider register. - * @var SPI_T::SSCTL - * Offset: 0x08 SPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = set the SPIx_SS line to inactive state. - * | | |1 = set the SPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the SPIx_SS line at inactive state. - * | | |1 = SPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time - * | | |The active state of SPIx_SS is specified in SSACTPOL (SPIx_SSCTL[2]). - * | | |Note: Master mode only. - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (SPIx_SS). - * | | |0 = The slave selection signal SPIx_SS is active low. - * | | |1 = The slave selection signal SPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit (Master Only) - * | | |0 = Automatic slave selection function Disabled - * | | |Slave selection signal will be asserted/de-asserted according to SS (SPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * | | |Note: Master mode only. - * |[4] |SLV3WIRE |Slave 3-wire Mode Enable Bit - * | | |In Slave 3-wire mode, the SPI controller can work with 3-wire interface including SPIx_CLK, SPIx_MISO and SPIx_MOSI pins. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * | | |Note: The value of this register equals to control register SLAVE (SPIx_I2SCTL[8]) when I2S mode is enabled. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * @var SPI_T::PDMACTL - * Offset: 0x0C SPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In SPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the SPI controller. This bit will be automatically cleared to 0. - * @var SPI_T::FIFOCTL - * Offset: 0x10 SPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * | | |Note: If TX underflow event occurs in SPI Slave mode, this bit can be used to make SPI return to idle state. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The SPI data out is keep 0 if there is TX underflow event in Slave mode. - * | | |1 = The SPI data out is keep 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is no any data in TX FIFO when the slave selection signal is active. - * | | |2. This bit should be set as 0 in I2S mode. - * | | |3. When TX underflow event occurs, SPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward - * | | |Data stored in TX FIFO will be sent through SPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |When TX underflow event occurs in Slave mode, TXUFIF (SPIx_STATUS[19]) will be set to 1 - * | | |This bit is used to enable the TX underflow interrupt. - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[10] |SLVBERX |RX FIFO Write Data Enable Bit When Slave Mode Bit Count Error - * | | |0 = Uncompleted RX data will be dropped from RX FIFO when bit count error event happened in SPI Slave mode. - * | | |1 = Uncompleted RX data will be written into RX FIFO when bit count error event happened in SPI Slave mode - * | | |User can read SLVBENUM (SPIx_STATUS2[29:24]) to know that the effective bit number of uncompleted RX data when SPI slave bit count error happened. - * | | |Note: Slave mode only. - * |[26:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0 - * | | |For SPI0~SPI3, the MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length. - * |[30:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0 - * | | |For SPI0~SPI3, the MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length. - * @var SPI_T::STATUS - * Offset: 0x14 SPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = SPI controller is in idle state. - * | | |1 = SPI controller is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. SPIx_CTL[0] = 1 and TXEMPTY = 0. - * | | |b - * | | |For SPI Master mode, SPIx_CTL[0] = 1 and TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Master mode, SPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d. - * | | |For SPI Slave mode, the SPIx_CTL[0] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |e. - * | | |For SPI Slave mode, the SPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * | | |Note: By applications, this SPI busy flag should be used with other status registers in SPIx_STATUS such as TXCNT, RXCNT, TXTHIF, TXFULL, TXEMPTY, RXTHIF, RXFULL, RXEMPTY, and UNITIF - * | | |Therefore the SPI transfer done events of TX/RX operations can be obtained at correct timing point. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = SPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode - * | | |If SSACTPOL (SPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the SPI slave select is in inactive status. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBEIF also active when the slave select goes to inactive state - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is overrun. - * | | |1 = Receive FIFO is overrun. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock periods in Master mode or over 576 SPI peripheral clock periods in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |SPIENSTS |SPI Enable Status (Read Only) - * | | |0 = The SPI controller is disabled. - * | | |1 = The SPI controller is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI control logic is disabled, this bit indicates the real status of SPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slave's transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var SPI_T::STATUS2 - * Offset: 0x18 SPI Status2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[29:24] |SLVBENUM |Effective Bit Number of Uncompleted RX Data - * | | |This status register indicates that effective bit number of uncompleted RX data when SLVBERX (SPIx_FIFOCTL[10]) is enabled and RX bit count error event happen in SPI Slave mode - * | | |This status register will be fixed to 0x0 when SLVBERX (SPIx_FIFOCTL[10]) is disabled. - * | | |Note 1: This register will be cleared to 0x0 when user writes 0x1 to SLVBEIF (SPIx_STATUS[6]). - * | | |Note 2: Slave mode only. - * @var SPI_T::TX - * Offset: 0x20 SPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 4-level transmit FIFO buffers - * | | |The number of valid bits depends on the setting of DWIDTH (SPIx_CTL[12:8]) in SPI mode or WDWIDTH (SPIx_I2SCTL[5:4]) in I2S mode. - * | | |In SPI mode, if DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted - * | | |If DWIDTH is set to 0x00 , the SPI controller will perform a 32-bit transfer. - * | | |In I2S mode, if WDWIDTH (SPIx_I2SCTL[5:4]) is set to 0x2, the data width of audio channel is 24-bit and corresponding to TX[23:0] - * | | |If WDWIDTH is set as 0x0, 0x1, or 0x3, all bits of this field are valid and referred to the data arrangement in I2S mode FIFO operation section - * | | |Note: In Master mode, SPI controller will start to transfer the SPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var SPI_T::RX - * Offset: 0x30 SPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register (Read Only) - * | | |There are 4-level FIFO buffers in this controller. - * | | |The data receive register holds the data received from SPI data input pin. - * | | |If the RXEMPTY (SPIx_STATUS[8] or SPIx_I2SSTS[8]) is not set to 1, the receive FIFO buffers can be accessed through software by reading this register. - * @var SPI_T::I2SCTL - * Offset: 0x60 I2S Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SEN |I2S Controller Enable Bit - * | | |0 = Disabled I2S mode. - * | | |1 = Enabled I2S mode. - * | | |Note: - * | | |1. If enable this bit, I2Sx_BCLK will start to output in Master mode. - * | | |2 - * | | |Before changing the configurations of SPIx_I2SCTL, SPIx_I2SCLK, and SPIx_FIFOCTL registers, user shall clear the I2SEN (SPIx_I2SCTL[0]) and confirm the I2SENSTS (SPIx_I2SSTS[15]) is 0. - * |[1] |TXEN |Transmit Enable Bit - * | | |0 = Data transmit Disabled. - * | | |1 = Data transmit Enabled. - * |[2] |RXEN |Receive Enable Bit - * | | |0 = Data receive Disabled. - * | | |1 = Data receive Enabled. - * |[3] |MUTE |Transmit Mute Enable Bit - * | | |0 = Transmit data is shifted from buffer. - * | | |1 = Transmit channel zero. - * |[5:4] |WDWIDTH |Word Width - * | | |00 = data size is 8-bit. - * | | |01 = data size is 16-bit. - * | | |10 = data size is 24-bit. - * | | |11 = data size is 32-bit. - * |[6] |MONO |Monaural Data - * | | |0 = Data is stereo format. - * | | |1 = Data is monaural format. - * |[7] |ORDER |Stereo Data Order in FIFO - * | | |0 = Left channel data at high byte. - * | | |1 = Left channel data at low byte. - * |[8] |SLAVE |Slave Mode - * | | |I2S can operate as master or slave - * | | |For Master mode, I2Sx_BCLK and I2Sx_LRCLK pins are output mode and send bit clock from NuMicro M2354 series to audio CODEC chip - * | | |In Slave mode, I2Sx_BCLK and I2Sx_LRCLK pins are input mode and I2Sx_BCLK and I2Sx_LRCLK signals are received from outer audio CODEC chip. - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[15] |MCLKEN |Master Clock Enable Bit - * | | |If MCLKEN is set to 1, I2S controller will generate master clock on SPIx_I2SMCLK pin for external audio devices. - * | | |0 = Master clock Disabled. - * | | |1 = Master clock Enabled. - * |[16] |RZCEN |Right Channel Zero Cross Detection Enable Bit - * | | |If this bit is set to 1, when right channel data sign bit change or next shift data bits are all 0 then RZCIF flag in SPIx_I2SSTS register is set to 1 - * | | |This function is only available in transmit operation. - * | | |0 = Right channel zero cross detection Disabled. - * | | |1 = Right channel zero cross detection Enabled. - * |[17] |LZCEN |Left Channel Zero Cross Detection Enable Bit - * | | |If this bit is set to 1, when left channel data sign bit changes or next shift data bits are all 0 then LZCIF flag in SPIx_I2SSTS register is set to 1 - * | | |This function is only available in transmit operation. - * | | |0 = Left channel zero cross detection Disabled. - * | | |1 = Left channel zero cross detection Enabled. - * |[23] |RXLCH |Receive Left Channel Enable Bit - * | | |When monaural format is selected (MONO = 1), I2S controller will receive right channel data if RXLCH is set to 0, and receive left channel data if RXLCH is set to 1. - * | | |0 = Receive right channel data in Mono mode. - * | | |1 = Receive left channel data in Mono mode. - * |[24] |RZCIEN |Right Channel Zero Cross Interrupt Enable Bit - * | | |Interrupt occurs if this bit is set to 1 and right channel zero cross event occurs. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[25] |LZCIEN |Left Channel Zero Cross Interrupt Enable Bit - * | | |Interrupt occurs if this bit is set to 1 and left channel zero cross event occurs. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[29:28] |FORMAT |Data Format Selection - * | | |00 = I2S data format. - * | | |01 = MSB justified data format. - * | | |10 = PCM mode A. - * | | |11 = PCM mode B. - * |[31] |SLVERRIEN |Bit Clock Loss Interrupt Enable Bit for Slave Mode - * | | |Interrupt occurs if this bit is set to 1 and bit clock loss event occurs. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * @var SPI_T::I2SCLK - * Offset: 0x64 I2S Clock Divider Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |MCLKDIV |Master Clock Divider - * | | |If MCLKEN is set to 1, I2S controller will generate master clock for external audio devices. - * | | |The frequency of master clock, F_MCLK, is determined by the following expressions: - * | | |If MCLKDIV >= 1, F_MCLK = F_I2SCLK/(2x(MCLKDIV)). - * | | |If MCLKDIV = 0, F_MCLK = F_I2SCLK. - * | | |where - * | | |is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL2. - * | | |F_I2SCLK is the frequency of I2S peripheral clock. - * | | |In general, the master clock rate is 256 times sampling clock rate. - * |[17:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode. - * | | |The clock frequency of bit clock, F_BCLK, is determined by the following expression: - * | | |F_BCLK = F_I2SCLK/(2x(BCLKDIV + 1)), - * | | |where - * | | |F_I2SCLK is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL2. - * | | |In I2S Slave mode, this field is used to define the frequency of peripheral clock and it's determined by F_I2SCLK/(BCLKDIV/2 + 1). - * | | |The peripheral clock frequency in I2S Slave mode must be equal to or faster than 6 times of input bit clock. - * |[24] |I2SMODE |I2S Clock Divider Number Selection for I2S Mode and SPI Mode - * | | |User sets I2SMODE to set frequency of peripheral clock of I2S mode or SPI mode when BCLKDIV (SPIx_I2SCLK[17:8]) or DIVIDER (SPIx_CLKDIV[8:0]) is set. - * | | |User needs to set I2SMODE before I2SEN (SPIx_I2SCTL[0]) or SPIEN (SPIx_CTL[0]) is enabled. - * | | |0 = The frequency of peripheral clock is set to SPI mode. - * | | |1 = The frequency of peripheral clock is set to I2S mode. - * |[25] |I2SSLAVE |I2S Clock Divider Number Selection for I2S Slave Mode and I2S Master Mode - * | | |User sets I2SSLAVE to set frequency of peripheral clock of I2S master mode and I2S slave mode when BCLKDIV (SPIx_I2SCLK[17:8]) is set. - * | | |I2SSLAVE needs to set before I2SEN (SPIx_I2SCTL[0]) is enabled. - * | | |0 = The frequency of peripheral clock is set to I2S Master mode. - * | | |1 = The frequency of peripheral clock is set to I2S Slave mode. - * @var SPI_T::I2SSTS - * Offset: 0x68 I2S Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |RIGHT |Right Channel (Read Only) - * | | |This bit indicates the current transmit data is belong to which channel. - * | | |0 = Left channel. - * | | |1 = Right channel. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * | | |Note: If RXTHIEN = 1 and RXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock period in Master mode or over 576 SPI peripheral clock period in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |I2SENSTS |I2S Enable Status (Read Only) - * | | |0 = The SPI/I2S control logic is disabled. - * | | |1 = The SPI/I2S control logic is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI/I2S control logic is disabled, this bit indicates the real status of SPI/I2S control logic for user. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * | | |Note: If TXTHIEN = 1 and TXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[19] |TXUFIF |Transmit FIFO Underflow Interrupt Flag - * | | |When the transmit FIFO buffer is empty and there is no datum written into the FIFO buffer, if there is more bus clock input, this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[20] |RZCIF |Right Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on right channel. - * | | |1 = Zero cross event occurred on right channel. - * |[21] |LZCIF |Left Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on left channel. - * | | |1 = Zero cross event occurred on left channel. - * |[22] |SLVERRIF |Bit Clock Loss Interrupt Flag for Slave Mode - * | | |0 = No bit clock loss event occurred. - * | | |1 = Bit clock loss event occurred. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[26:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[30:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - */ - __IO uint32_t CTL; /*!< [0x0000] SPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] SPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] SPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] SPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] SPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] SPI Status Register */ - __I uint32_t STATUS2; /*!< [0x0018] SPI Status2 Register */ - __I uint32_t RESERVE0[1]; - __O uint32_t TX; /*!< [0x0020] SPI Data Transmit Register */ - __I uint32_t RESERVE1[3]; - __I uint32_t RX; /*!< [0x0030] SPI Data Receive Register */ - __I uint32_t RESERVE2[11]; - __IO uint32_t I2SCTL; /*!< [0x0060] I2S Control Register */ - __IO uint32_t I2SCLK; /*!< [0x0064] I2S Clock Divider Control Register */ - __IO uint32_t I2SSTS; /*!< [0x0068] I2S Status Register */ - -} SPI_T; - -/** - @addtogroup SPI_CONST SPI Bit Field Definition - Constant Definitions for SPI Controller - @{ -*/ - -#define SPI_CTL_SPIEN_Pos (0) /*!< SPI_T::CTL: SPIEN Position */ -#define SPI_CTL_SPIEN_Msk (0x1ul << SPI_CTL_SPIEN_Pos) /*!< SPI_T::CTL: SPIEN Mask */ - -#define SPI_CTL_RXNEG_Pos (1) /*!< SPI_T::CTL: RXNEG Position */ -#define SPI_CTL_RXNEG_Msk (0x1ul << SPI_CTL_RXNEG_Pos) /*!< SPI_T::CTL: RXNEG Mask */ - -#define SPI_CTL_TXNEG_Pos (2) /*!< SPI_T::CTL: TXNEG Position */ -#define SPI_CTL_TXNEG_Msk (0x1ul << SPI_CTL_TXNEG_Pos) /*!< SPI_T::CTL: TXNEG Mask */ - -#define SPI_CTL_CLKPOL_Pos (3) /*!< SPI_T::CTL: CLKPOL Position */ -#define SPI_CTL_CLKPOL_Msk (0x1ul << SPI_CTL_CLKPOL_Pos) /*!< SPI_T::CTL: CLKPOL Mask */ - -#define SPI_CTL_SUSPITV_Pos (4) /*!< SPI_T::CTL: SUSPITV Position */ -#define SPI_CTL_SUSPITV_Msk (0xful << SPI_CTL_SUSPITV_Pos) /*!< SPI_T::CTL: SUSPITV Mask */ - -#define SPI_CTL_DWIDTH_Pos (8) /*!< SPI_T::CTL: DWIDTH Position */ -#define SPI_CTL_DWIDTH_Msk (0x1ful << SPI_CTL_DWIDTH_Pos) /*!< SPI_T::CTL: DWIDTH Mask */ - -#define SPI_CTL_LSB_Pos (13) /*!< SPI_T::CTL: LSB Position */ -#define SPI_CTL_LSB_Msk (0x1ul << SPI_CTL_LSB_Pos) /*!< SPI_T::CTL: LSB Mask */ - -#define SPI_CTL_HALFDPX_Pos (14) /*!< SPI_T::CTL: HALFDPX Position */ -#define SPI_CTL_HALFDPX_Msk (0x1ul << SPI_CTL_HALFDPX_Pos) /*!< SPI_T::CTL: HALFDPX Mask */ - -#define SPI_CTL_RXONLY_Pos (15) /*!< SPI_T::CTL: RXONLY Position */ -#define SPI_CTL_RXONLY_Msk (0x1ul << SPI_CTL_RXONLY_Pos) /*!< SPI_T::CTL: RXONLY Mask */ - -#define SPI_CTL_UNITIEN_Pos (17) /*!< SPI_T::CTL: UNITIEN Position */ -#define SPI_CTL_UNITIEN_Msk (0x1ul << SPI_CTL_UNITIEN_Pos) /*!< SPI_T::CTL: UNITIEN Mask */ - -#define SPI_CTL_SLAVE_Pos (18) /*!< SPI_T::CTL: SLAVE Position */ -#define SPI_CTL_SLAVE_Msk (0x1ul << SPI_CTL_SLAVE_Pos) /*!< SPI_T::CTL: SLAVE Mask */ - -#define SPI_CTL_REORDER_Pos (19) /*!< SPI_T::CTL: REORDER Position */ -#define SPI_CTL_REORDER_Msk (0x1ul << SPI_CTL_REORDER_Pos) /*!< SPI_T::CTL: REORDER Mask */ - -#define SPI_CTL_DATDIR_Pos (20) /*!< SPI_T::CTL: DATDIR Position */ -#define SPI_CTL_DATDIR_Msk (0x1ul << SPI_CTL_DATDIR_Pos) /*!< SPI_T::CTL: DATDIR Mask */ - -#define SPI_CLKDIV_DIVIDER_Pos (0) /*!< SPI_T::CLKDIV: DIVIDER Position */ -#define SPI_CLKDIV_DIVIDER_Msk (0x1fful << SPI_CLKDIV_DIVIDER_Pos) /*!< SPI_T::CLKDIV: DIVIDER Mask */ - -#define SPI_SSCTL_SS_Pos (0) /*!< SPI_T::SSCTL: SS Position */ -#define SPI_SSCTL_SS_Msk (0x1ul << SPI_SSCTL_SS_Pos) /*!< SPI_T::SSCTL: SS Mask */ - -#define SPI_SSCTL_SSACTPOL_Pos (2) /*!< SPI_T::SSCTL: SSACTPOL Position */ -#define SPI_SSCTL_SSACTPOL_Msk (0x1ul << SPI_SSCTL_SSACTPOL_Pos) /*!< SPI_T::SSCTL: SSACTPOL Mask */ - -#define SPI_SSCTL_AUTOSS_Pos (3) /*!< SPI_T::SSCTL: AUTOSS Position */ -#define SPI_SSCTL_AUTOSS_Msk (0x1ul << SPI_SSCTL_AUTOSS_Pos) /*!< SPI_T::SSCTL: AUTOSS Mask */ - -#define SPI_SSCTL_SLV3WIRE_Pos (4) /*!< SPI_T::SSCTL: SLV3WIRE Position */ -#define SPI_SSCTL_SLV3WIRE_Msk (0x1ul << SPI_SSCTL_SLV3WIRE_Pos) /*!< SPI_T::SSCTL: SLV3WIRE Mask */ - -#define SPI_SSCTL_SLVBEIEN_Pos (8) /*!< SPI_T::SSCTL: SLVBEIEN Position */ -#define SPI_SSCTL_SLVBEIEN_Msk (0x1ul << SPI_SSCTL_SLVBEIEN_Pos) /*!< SPI_T::SSCTL: SLVBEIEN Mask */ - -#define SPI_SSCTL_SLVURIEN_Pos (9) /*!< SPI_T::SSCTL: SLVURIEN Position */ -#define SPI_SSCTL_SLVURIEN_Msk (0x1ul << SPI_SSCTL_SLVURIEN_Pos) /*!< SPI_T::SSCTL: SLVURIEN Mask */ - -#define SPI_SSCTL_SSACTIEN_Pos (12) /*!< SPI_T::SSCTL: SSACTIEN Position */ -#define SPI_SSCTL_SSACTIEN_Msk (0x1ul << SPI_SSCTL_SSACTIEN_Pos) /*!< SPI_T::SSCTL: SSACTIEN Mask */ - -#define SPI_SSCTL_SSINAIEN_Pos (13) /*!< SPI_T::SSCTL: SSINAIEN Position */ -#define SPI_SSCTL_SSINAIEN_Msk (0x1ul << SPI_SSCTL_SSINAIEN_Pos) /*!< SPI_T::SSCTL: SSINAIEN Mask */ - -#define SPI_PDMACTL_TXPDMAEN_Pos (0) /*!< SPI_T::PDMACTL: TXPDMAEN Position */ -#define SPI_PDMACTL_TXPDMAEN_Msk (0x1ul << SPI_PDMACTL_TXPDMAEN_Pos) /*!< SPI_T::PDMACTL: TXPDMAEN Mask */ - -#define SPI_PDMACTL_RXPDMAEN_Pos (1) /*!< SPI_T::PDMACTL: RXPDMAEN Position */ -#define SPI_PDMACTL_RXPDMAEN_Msk (0x1ul << SPI_PDMACTL_RXPDMAEN_Pos) /*!< SPI_T::PDMACTL: RXPDMAEN Mask */ - -#define SPI_PDMACTL_PDMARST_Pos (2) /*!< SPI_T::PDMACTL: PDMARST Position */ -#define SPI_PDMACTL_PDMARST_Msk (0x1ul << SPI_PDMACTL_PDMARST_Pos) /*!< SPI_T::PDMACTL: PDMARST Mask */ - -#define SPI_FIFOCTL_RXRST_Pos (0) /*!< SPI_T::FIFOCTL: RXRST Position */ -#define SPI_FIFOCTL_RXRST_Msk (0x1ul << SPI_FIFOCTL_RXRST_Pos) /*!< SPI_T::FIFOCTL: RXRST Mask */ - -#define SPI_FIFOCTL_TXRST_Pos (1) /*!< SPI_T::FIFOCTL: TXRST Position */ -#define SPI_FIFOCTL_TXRST_Msk (0x1ul << SPI_FIFOCTL_TXRST_Pos) /*!< SPI_T::FIFOCTL: TXRST Mask */ - -#define SPI_FIFOCTL_RXTHIEN_Pos (2) /*!< SPI_T::FIFOCTL: RXTHIEN Position */ -#define SPI_FIFOCTL_RXTHIEN_Msk (0x1ul << SPI_FIFOCTL_RXTHIEN_Pos) /*!< SPI_T::FIFOCTL: RXTHIEN Mask */ - -#define SPI_FIFOCTL_TXTHIEN_Pos (3) /*!< SPI_T::FIFOCTL: TXTHIEN Position */ -#define SPI_FIFOCTL_TXTHIEN_Msk (0x1ul << SPI_FIFOCTL_TXTHIEN_Pos) /*!< SPI_T::FIFOCTL: TXTHIEN Mask */ - -#define SPI_FIFOCTL_RXTOIEN_Pos (4) /*!< SPI_T::FIFOCTL: RXTOIEN Position */ -#define SPI_FIFOCTL_RXTOIEN_Msk (0x1ul << SPI_FIFOCTL_RXTOIEN_Pos) /*!< SPI_T::FIFOCTL: RXTOIEN Mask */ - -#define SPI_FIFOCTL_RXOVIEN_Pos (5) /*!< SPI_T::FIFOCTL: RXOVIEN Position */ -#define SPI_FIFOCTL_RXOVIEN_Msk (0x1ul << SPI_FIFOCTL_RXOVIEN_Pos) /*!< SPI_T::FIFOCTL: RXOVIEN Mask */ - -#define SPI_FIFOCTL_TXUFPOL_Pos (6) /*!< SPI_T::FIFOCTL: TXUFPOL Position */ -#define SPI_FIFOCTL_TXUFPOL_Msk (0x1ul << SPI_FIFOCTL_TXUFPOL_Pos) /*!< SPI_T::FIFOCTL: TXUFPOL Mask */ - -#define SPI_FIFOCTL_TXUFIEN_Pos (7) /*!< SPI_T::FIFOCTL: TXUFIEN Position */ -#define SPI_FIFOCTL_TXUFIEN_Msk (0x1ul << SPI_FIFOCTL_TXUFIEN_Pos) /*!< SPI_T::FIFOCTL: TXUFIEN Mask */ - -#define SPI_FIFOCTL_RXFBCLR_Pos (8) /*!< SPI_T::FIFOCTL: RXFBCLR Position */ -#define SPI_FIFOCTL_RXFBCLR_Msk (0x1ul << SPI_FIFOCTL_RXFBCLR_Pos) /*!< SPI_T::FIFOCTL: RXFBCLR Mask */ - -#define SPI_FIFOCTL_TXFBCLR_Pos (9) /*!< SPI_T::FIFOCTL: TXFBCLR Position */ -#define SPI_FIFOCTL_TXFBCLR_Msk (0x1ul << SPI_FIFOCTL_TXFBCLR_Pos) /*!< SPI_T::FIFOCTL: TXFBCLR Mask */ - -#define SPI_FIFOCTL_SLVBERX_Pos (10) /*!< SPI_T::FIFOCTL: SLVBERX Position */ -#define SPI_FIFOCTL_SLVBERX_Msk (0x1ul << SPI_FIFOCTL_SLVBERX_Pos) /*!< SPI_T::FIFOCTL: SLVBERX Mask */ - -#define SPI_FIFOCTL_RXTH_Pos (24) /*!< SPI_T::FIFOCTL: RXTH Position */ -#define SPI_FIFOCTL_RXTH_Msk (0x7ul << SPI_FIFOCTL_RXTH_Pos) /*!< SPI_T::FIFOCTL: RXTH Mask */ - -#define SPI_FIFOCTL_TXTH_Pos (28) /*!< SPI_T::FIFOCTL: TXTH Position */ -#define SPI_FIFOCTL_TXTH_Msk (0x7ul << SPI_FIFOCTL_TXTH_Pos) /*!< SPI_T::FIFOCTL: TXTH Mask */ - -#define SPI_STATUS_BUSY_Pos (0) /*!< SPI_T::STATUS: BUSY Position */ -#define SPI_STATUS_BUSY_Msk (0x1ul << SPI_STATUS_BUSY_Pos) /*!< SPI_T::STATUS: BUSY Mask */ - -#define SPI_STATUS_UNITIF_Pos (1) /*!< SPI_T::STATUS: UNITIF Position */ -#define SPI_STATUS_UNITIF_Msk (0x1ul << SPI_STATUS_UNITIF_Pos) /*!< SPI_T::STATUS: UNITIF Mask */ - -#define SPI_STATUS_SSACTIF_Pos (2) /*!< SPI_T::STATUS: SSACTIF Position */ -#define SPI_STATUS_SSACTIF_Msk (0x1ul << SPI_STATUS_SSACTIF_Pos) /*!< SPI_T::STATUS: SSACTIF Mask */ - -#define SPI_STATUS_SSINAIF_Pos (3) /*!< SPI_T::STATUS: SSINAIF Position */ -#define SPI_STATUS_SSINAIF_Msk (0x1ul << SPI_STATUS_SSINAIF_Pos) /*!< SPI_T::STATUS: SSINAIF Mask */ - -#define SPI_STATUS_SSLINE_Pos (4) /*!< SPI_T::STATUS: SSLINE Position */ -#define SPI_STATUS_SSLINE_Msk (0x1ul << SPI_STATUS_SSLINE_Pos) /*!< SPI_T::STATUS: SSLINE Mask */ - -#define SPI_STATUS_SLVBEIF_Pos (6) /*!< SPI_T::STATUS: SLVBEIF Position */ -#define SPI_STATUS_SLVBEIF_Msk (0x1ul << SPI_STATUS_SLVBEIF_Pos) /*!< SPI_T::STATUS: SLVBEIF Mask */ - -#define SPI_STATUS_SLVURIF_Pos (7) /*!< SPI_T::STATUS: SLVURIF Position */ -#define SPI_STATUS_SLVURIF_Msk (0x1ul << SPI_STATUS_SLVURIF_Pos) /*!< SPI_T::STATUS: SLVURIF Mask */ - -#define SPI_STATUS_RXEMPTY_Pos (8) /*!< SPI_T::STATUS: RXEMPTY Position */ -#define SPI_STATUS_RXEMPTY_Msk (0x1ul << SPI_STATUS_RXEMPTY_Pos) /*!< SPI_T::STATUS: RXEMPTY Mask */ - -#define SPI_STATUS_RXFULL_Pos (9) /*!< SPI_T::STATUS: RXFULL Position */ -#define SPI_STATUS_RXFULL_Msk (0x1ul << SPI_STATUS_RXFULL_Pos) /*!< SPI_T::STATUS: RXFULL Mask */ - -#define SPI_STATUS_RXTHIF_Pos (10) /*!< SPI_T::STATUS: RXTHIF Position */ -#define SPI_STATUS_RXTHIF_Msk (0x1ul << SPI_STATUS_RXTHIF_Pos) /*!< SPI_T::STATUS: RXTHIF Mask */ - -#define SPI_STATUS_RXOVIF_Pos (11) /*!< SPI_T::STATUS: RXOVIF Position */ -#define SPI_STATUS_RXOVIF_Msk (0x1ul << SPI_STATUS_RXOVIF_Pos) /*!< SPI_T::STATUS: RXOVIF Mask */ - -#define SPI_STATUS_RXTOIF_Pos (12) /*!< SPI_T::STATUS: RXTOIF Position */ -#define SPI_STATUS_RXTOIF_Msk (0x1ul << SPI_STATUS_RXTOIF_Pos) /*!< SPI_T::STATUS: RXTOIF Mask */ - -#define SPI_STATUS_SPIENSTS_Pos (15) /*!< SPI_T::STATUS: SPIENSTS Position */ -#define SPI_STATUS_SPIENSTS_Msk (0x1ul << SPI_STATUS_SPIENSTS_Pos) /*!< SPI_T::STATUS: SPIENSTS Mask */ - -#define SPI_STATUS_TXEMPTY_Pos (16) /*!< SPI_T::STATUS: TXEMPTY Position */ -#define SPI_STATUS_TXEMPTY_Msk (0x1ul << SPI_STATUS_TXEMPTY_Pos) /*!< SPI_T::STATUS: TXEMPTY Mask */ - -#define SPI_STATUS_TXFULL_Pos (17) /*!< SPI_T::STATUS: TXFULL Position */ -#define SPI_STATUS_TXFULL_Msk (0x1ul << SPI_STATUS_TXFULL_Pos) /*!< SPI_T::STATUS: TXFULL Mask */ - -#define SPI_STATUS_TXTHIF_Pos (18) /*!< SPI_T::STATUS: TXTHIF Position */ -#define SPI_STATUS_TXTHIF_Msk (0x1ul << SPI_STATUS_TXTHIF_Pos) /*!< SPI_T::STATUS: TXTHIF Mask */ - -#define SPI_STATUS_TXUFIF_Pos (19) /*!< SPI_T::STATUS: TXUFIF Position */ -#define SPI_STATUS_TXUFIF_Msk (0x1ul << SPI_STATUS_TXUFIF_Pos) /*!< SPI_T::STATUS: TXUFIF Mask */ - -#define SPI_STATUS_TXRXRST_Pos (23) /*!< SPI_T::STATUS: TXRXRST Position */ -#define SPI_STATUS_TXRXRST_Msk (0x1ul << SPI_STATUS_TXRXRST_Pos) /*!< SPI_T::STATUS: TXRXRST Mask */ - -#define SPI_STATUS_RXCNT_Pos (24) /*!< SPI_T::STATUS: RXCNT Position */ -#define SPI_STATUS_RXCNT_Msk (0xful << SPI_STATUS_RXCNT_Pos) /*!< SPI_T::STATUS: RXCNT Mask */ - -#define SPI_STATUS_TXCNT_Pos (28) /*!< SPI_T::STATUS: TXCNT Position */ -#define SPI_STATUS_TXCNT_Msk (0xful << SPI_STATUS_TXCNT_Pos) /*!< SPI_T::STATUS: TXCNT Mask */ - -#define SPI_STATUS2_SLVBENUM_Pos (24) /*!< SPI_T::STATUS2: SLVBENUM Position */ -#define SPI_STATUS2_SLVBENUM_Msk (0x3ful << SPI_STATUS2_SLVBENUM_Pos) /*!< SPI_T::STATUS2: SLVBENUM Mask */ - -#define SPI_TX_TX_Pos (0) /*!< SPI_T::TX: TX Position */ -#define SPI_TX_TX_Msk (0xfffffffful << SPI_TX_TX_Pos) /*!< SPI_T::TX: TX Mask */ - -#define SPI_RX_RX_Pos (0) /*!< SPI_T::RX: RX Position */ -#define SPI_RX_RX_Msk (0xfffffffful << SPI_RX_RX_Pos) /*!< SPI_T::RX: RX Mask */ - -#define SPI_I2SCTL_I2SEN_Pos (0) /*!< SPI_T::I2SCTL: I2SEN Position */ -#define SPI_I2SCTL_I2SEN_Msk (0x1ul << SPI_I2SCTL_I2SEN_Pos) /*!< SPI_T::I2SCTL: I2SEN Mask */ - -#define SPI_I2SCTL_TXEN_Pos (1) /*!< SPI_T::I2SCTL: TXEN Position */ -#define SPI_I2SCTL_TXEN_Msk (0x1ul << SPI_I2SCTL_TXEN_Pos) /*!< SPI_T::I2SCTL: TXEN Mask */ - -#define SPI_I2SCTL_RXEN_Pos (2) /*!< SPI_T::I2SCTL: RXEN Position */ -#define SPI_I2SCTL_RXEN_Msk (0x1ul << SPI_I2SCTL_RXEN_Pos) /*!< SPI_T::I2SCTL: RXEN Mask */ - -#define SPI_I2SCTL_MUTE_Pos (3) /*!< SPI_T::I2SCTL: MUTE Position */ -#define SPI_I2SCTL_MUTE_Msk (0x1ul << SPI_I2SCTL_MUTE_Pos) /*!< SPI_T::I2SCTL: MUTE Mask */ - -#define SPI_I2SCTL_WDWIDTH_Pos (4) /*!< SPI_T::I2SCTL: WDWIDTH Position */ -#define SPI_I2SCTL_WDWIDTH_Msk (0x3ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPI_T::I2SCTL: WDWIDTH Mask */ - -#define SPI_I2SCTL_MONO_Pos (6) /*!< SPI_T::I2SCTL: MONO Position */ -#define SPI_I2SCTL_MONO_Msk (0x1ul << SPI_I2SCTL_MONO_Pos) /*!< SPI_T::I2SCTL: MONO Mask */ - -#define SPI_I2SCTL_ORDER_Pos (7) /*!< SPI_T::I2SCTL: ORDER Position */ -#define SPI_I2SCTL_ORDER_Msk (0x1ul << SPI_I2SCTL_ORDER_Pos) /*!< SPI_T::I2SCTL: ORDER Mask */ - -#define SPI_I2SCTL_SLAVE_Pos (8) /*!< SPI_T::I2SCTL: SLAVE Position */ -#define SPI_I2SCTL_SLAVE_Msk (0x1ul << SPI_I2SCTL_SLAVE_Pos) /*!< SPI_T::I2SCTL: SLAVE Mask */ - -#define SPI_I2SCTL_MCLKEN_Pos (15) /*!< SPI_T::I2SCTL: MCLKEN Position */ -#define SPI_I2SCTL_MCLKEN_Msk (0x1ul << SPI_I2SCTL_MCLKEN_Pos) /*!< SPI_T::I2SCTL: MCLKEN Mask */ - -#define SPI_I2SCTL_RZCEN_Pos (16) /*!< SPI_T::I2SCTL: RZCEN Position */ -#define SPI_I2SCTL_RZCEN_Msk (0x1ul << SPI_I2SCTL_RZCEN_Pos) /*!< SPI_T::I2SCTL: RZCEN Mask */ - -#define SPI_I2SCTL_LZCEN_Pos (17) /*!< SPI_T::I2SCTL: LZCEN Position */ -#define SPI_I2SCTL_LZCEN_Msk (0x1ul << SPI_I2SCTL_LZCEN_Pos) /*!< SPI_T::I2SCTL: LZCEN Mask */ - -#define SPI_I2SCTL_RXLCH_Pos (23) /*!< SPI_T::I2SCTL: RXLCH Position */ -#define SPI_I2SCTL_RXLCH_Msk (0x1ul << SPI_I2SCTL_RXLCH_Pos) /*!< SPI_T::I2SCTL: RXLCH Mask */ - -#define SPI_I2SCTL_RZCIEN_Pos (24) /*!< SPI_T::I2SCTL: RZCIEN Position */ -#define SPI_I2SCTL_RZCIEN_Msk (0x1ul << SPI_I2SCTL_RZCIEN_Pos) /*!< SPI_T::I2SCTL: RZCIEN Mask */ - -#define SPI_I2SCTL_LZCIEN_Pos (25) /*!< SPI_T::I2SCTL: LZCIEN Position */ -#define SPI_I2SCTL_LZCIEN_Msk (0x1ul << SPI_I2SCTL_LZCIEN_Pos) /*!< SPI_T::I2SCTL: LZCIEN Mask */ - -#define SPI_I2SCTL_FORMAT_Pos (28) /*!< SPI_T::I2SCTL: FORMAT Position */ -#define SPI_I2SCTL_FORMAT_Msk (0x3ul << SPI_I2SCTL_FORMAT_Pos) /*!< SPI_T::I2SCTL: FORMAT Mask */ - -#define SPI_I2SCTL_SLVERRIEN_Pos (31) /*!< SPI_T::I2SCTL: SLVERRIEN Position */ -#define SPI_I2SCTL_SLVERRIEN_Msk (0x1ul << SPI_I2SCTL_SLVERRIEN_Pos) /*!< SPI_T::I2SCTL: SLVERRIEN Mask */ - -#define SPI_I2SCLK_MCLKDIV_Pos (0) /*!< SPI_T::I2SCLK: MCLKDIV Position */ -#define SPI_I2SCLK_MCLKDIV_Msk (0x7ful << SPI_I2SCLK_MCLKDIV_Pos) /*!< SPI_T::I2SCLK: MCLKDIV Mask */ - -#define SPI_I2SCLK_BCLKDIV_Pos (8) /*!< SPI_T::I2SCLK: BCLKDIV Position */ -#define SPI_I2SCLK_BCLKDIV_Msk (0x3fful << SPI_I2SCLK_BCLKDIV_Pos) /*!< SPI_T::I2SCLK: BCLKDIV Mask */ - -#define SPI_I2SCLK_I2SMODE_Pos (24) /*!< SPI_T::I2SCLK: I2SMODE Position */ -#define SPI_I2SCLK_I2SMODE_Msk (0x1ul << SPI_I2SCLK_I2SMODE_Pos) /*!< SPI_T::I2SCLK: I2SMODE Mask */ - -#define SPI_I2SCLK_I2SSLAVE_Pos (25) /*!< SPI_T::I2SCLK: I2SSLAVE Position */ -#define SPI_I2SCLK_I2SSLAVE_Msk (0x1ul << SPI_I2SCLK_I2SSLAVE_Pos) /*!< SPI_T::I2SCLK: I2SSLAVE Mask */ - -#define SPI_I2SSTS_RIGHT_Pos (4) /*!< SPI_T::I2SSTS: RIGHT Position */ -#define SPI_I2SSTS_RIGHT_Msk (0x1ul << SPI_I2SSTS_RIGHT_Pos) /*!< SPI_T::I2SSTS: RIGHT Mask */ - -#define SPI_I2SSTS_RXEMPTY_Pos (8) /*!< SPI_T::I2SSTS: RXEMPTY Position */ -#define SPI_I2SSTS_RXEMPTY_Msk (0x1ul << SPI_I2SSTS_RXEMPTY_Pos) /*!< SPI_T::I2SSTS: RXEMPTY Mask */ - -#define SPI_I2SSTS_RXFULL_Pos (9) /*!< SPI_T::I2SSTS: RXFULL Position */ -#define SPI_I2SSTS_RXFULL_Msk (0x1ul << SPI_I2SSTS_RXFULL_Pos) /*!< SPI_T::I2SSTS: RXFULL Mask */ - -#define SPI_I2SSTS_RXTHIF_Pos (10) /*!< SPI_T::I2SSTS: RXTHIF Position */ -#define SPI_I2SSTS_RXTHIF_Msk (0x1ul << SPI_I2SSTS_RXTHIF_Pos) /*!< SPI_T::I2SSTS: RXTHIF Mask */ - -#define SPI_I2SSTS_RXOVIF_Pos (11) /*!< SPI_T::I2SSTS: RXOVIF Position */ -#define SPI_I2SSTS_RXOVIF_Msk (0x1ul << SPI_I2SSTS_RXOVIF_Pos) /*!< SPI_T::I2SSTS: RXOVIF Mask */ - -#define SPI_I2SSTS_RXTOIF_Pos (12) /*!< SPI_T::I2SSTS: RXTOIF Position */ -#define SPI_I2SSTS_RXTOIF_Msk (0x1ul << SPI_I2SSTS_RXTOIF_Pos) /*!< SPI_T::I2SSTS: RXTOIF Mask */ - -#define SPI_I2SSTS_I2SENSTS_Pos (15) /*!< SPI_T::I2SSTS: I2SENSTS Position */ -#define SPI_I2SSTS_I2SENSTS_Msk (0x1ul << SPI_I2SSTS_I2SENSTS_Pos) /*!< SPI_T::I2SSTS: I2SENSTS Mask */ - -#define SPI_I2SSTS_TXEMPTY_Pos (16) /*!< SPI_T::I2SSTS: TXEMPTY Position */ -#define SPI_I2SSTS_TXEMPTY_Msk (0x1ul << SPI_I2SSTS_TXEMPTY_Pos) /*!< SPI_T::I2SSTS: TXEMPTY Mask */ - -#define SPI_I2SSTS_TXFULL_Pos (17) /*!< SPI_T::I2SSTS: TXFULL Position */ -#define SPI_I2SSTS_TXFULL_Msk (0x1ul << SPI_I2SSTS_TXFULL_Pos) /*!< SPI_T::I2SSTS: TXFULL Mask */ - -#define SPI_I2SSTS_TXTHIF_Pos (18) /*!< SPI_T::I2SSTS: TXTHIF Position */ -#define SPI_I2SSTS_TXTHIF_Msk (0x1ul << SPI_I2SSTS_TXTHIF_Pos) /*!< SPI_T::I2SSTS: TXTHIF Mask */ - -#define SPI_I2SSTS_TXUFIF_Pos (19) /*!< SPI_T::I2SSTS: TXUFIF Position */ -#define SPI_I2SSTS_TXUFIF_Msk (0x1ul << SPI_I2SSTS_TXUFIF_Pos) /*!< SPI_T::I2SSTS: TXUFIF Mask */ - -#define SPI_I2SSTS_RZCIF_Pos (20) /*!< SPI_T::I2SSTS: RZCIF Position */ -#define SPI_I2SSTS_RZCIF_Msk (0x1ul << SPI_I2SSTS_RZCIF_Pos) /*!< SPI_T::I2SSTS: RZCIF Mask */ - -#define SPI_I2SSTS_LZCIF_Pos (21) /*!< SPI_T::I2SSTS: LZCIF Position */ -#define SPI_I2SSTS_LZCIF_Msk (0x1ul << SPI_I2SSTS_LZCIF_Pos) /*!< SPI_T::I2SSTS: LZCIF Mask */ - -#define SPI_I2SSTS_SLVERRIF_Pos (22) /*!< SPI_T::I2SSTS: SLVERRIF Position */ -#define SPI_I2SSTS_SLVERRIF_Msk (0x1ul << SPI_I2SSTS_SLVERRIF_Pos) /*!< SPI_T::I2SSTS: SLVERRIF Mask */ - -#define SPI_I2SSTS_TXRXRST_Pos (23) /*!< SPI_T::I2SSTS: TXRXRST Position */ -#define SPI_I2SSTS_TXRXRST_Msk (0x1ul << SPI_I2SSTS_TXRXRST_Pos) /*!< SPI_T::I2SSTS: TXRXRST Mask */ - -#define SPI_I2SSTS_RXCNT_Pos (24) /*!< SPI_T::I2SSTS: RXCNT Position */ -#define SPI_I2SSTS_RXCNT_Msk (0x7ul << SPI_I2SSTS_RXCNT_Pos) /*!< SPI_T::I2SSTS: RXCNT Mask */ - -#define SPI_I2SSTS_TXCNT_Pos (28) /*!< SPI_T::I2SSTS: TXCNT Position */ -#define SPI_I2SSTS_TXCNT_Msk (0x7ul << SPI_I2SSTS_TXCNT_Pos) /*!< SPI_T::I2SSTS: TXCNT Mask */ - -/**@}*/ /* SPI_CONST */ -/**@}*/ /* end of SPI register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __SPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sys_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sys_reg.h deleted file mode 100644 index 4dfc39f4a14..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/sys_reg.h +++ /dev/null @@ -1,2617 +0,0 @@ -/**************************************************************************//** - * @file sys_reg.h - * @version V1.00 - * @brief SYS register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SYS_REG_H__ -#define __SYS_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- System Manger Controller -------------------------*/ -/** - @addtogroup SYS System Manger Controller(SYS) - Memory Mapped Structure for SYS Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var SYS_T::PDID - * Offset: 0x00 Part Device Identification Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PDID |Part Device Identification Number (Read Only) - * | | |This register reflects device part number code. - * | | |Software can read this register to identify which device is used. - * @var SYS_T::RSTSTS - * Offset: 0x04 System Reset Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PORF |POR Reset Flag - * | | |The POR reset flag is set by the "Reset Signal" from the Power-on Reset (POR) Controller or bit CHIPRST (SYS_IPRST0[0]) to indicate the previous reset source. - * | | |0 = No reset from POR or CHIPRST. - * | | |1 = Power-on Reset (POR) or CHIPRST had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |PINRF |nRESET Pin Reset Flag - * | | |The nRESET pin reset flag is set by the "Reset Signal" from the nRESET Pin to indicate the previous reset source. - * | | |0 = No reset from nRESET pin. - * | | |1 = Pin nRESET had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |WDTRF |WDT Reset Flag - * | | |The WDT reset flag is set by the "Reset Signal" from the Watchdog Timer or Window Watchdog Timer to indicate the previous reset source. - * | | |0 = No reset from watchdog timer or window watchdog timer. - * | | |1 = The watchdog timer or window watchdog timer had issued the reset signal to reset the system. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer register RSTF(WDT_CTL[2]) bit is set if the system has been reset by WDT time-out reset. - * | | |Window Watchdog Timer register WWDTRF(WWDT_STATUS[1]) bit is set if the system has been reset by WWDT time-out reset. - * | | |Note 3: Extra Watchdog Timer register RSTF(EWDT_CTL[2]) bit is set if the system has been reset by EWDT time-out reset. - * | | |Extra Window Watchdog Timer register WWDTRF(EWWDT_STATUS[1]) bit is set if the system has been reset by EWWDT time-out reset. - * |[3] |LVRF |LVR Reset Flag - * | | |The LVR reset flag is set by the "Reset Signal" from the Low Voltage Reset Controller to indicate the previous reset source. - * | | |0 = No reset from LVR. - * | | |1 = LVR controller had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |BODRF |BOD Reset Flag - * | | |The BOD reset flag is set by the "Reset Signal" from the Brown-out Detector to indicate the previous reset source. - * | | |0 = No reset from BOD. - * | | |1 = The BOD had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |SYSRF |System Reset Flag - * | | |The system reset flag is set by the "Reset Signal" from the Cortex-M23 Core to indicate the previous reset source. - * | | |0 = No reset from Cortex-M23. - * | | |1 = The Cortex-M23 had issued the reset signal to reset the system by writing 1 to the bit SYSRESETREQ(AIRCR[2], Application Interrupt and Reset Control Register, address = 0xE000ED0C) in system control registers of Cortex-M23 core. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |CPURF |CPU Reset Flag - * | | |The CPU reset flag is set by hardware if software writes CPURST (SYS_IPRST0[1]) 1 to reset Cortex-M23 Core and Flash Memory Controller (FMC). - * | | |0 = No reset from CPU. - * | | |1 = The Cortex-M23 Core and FMC are reset by software setting CPURST to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |CPULKRF |CPU Lockup Reset Flag - * | | |The CPULK reset flag is set by hardware if Cortex-M23 lockup happened. - * | | |0 = No reset from CPU lockup happened. - * | | |1 = The Cortex-M23 lockup happened and chip is reset. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: When CPU lockup happened under ICE is connected, This flag will set to 1 but chip will not reset. - * @var SYS_T::IPRST0 - * Offset: 0x08 Peripheral Reset Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHIPRST |Chip One-shot Reset (Write Protect) - * | | |Setting this bit will reset the whole chip, including Processor core and all peripherals, and this bit will automatically return to 0 after the 2 clock cycles. - * | | |The CHIPRST is same as the POR reset, all the chip controllers is reset and the chip setting from flash are also reload. - * | | |0 = Chip normal operation. - * | | |1 = Chip one-shot reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |CPURST |Processor Core One-shot Reset (Write Protect) - * | | |Setting this bit will only reset the processor core and Flash Memory Controller(FMC), and this bit will automatically return to 0 after the 2 clock cycles. - * | | |0 = Processor core normal operation. - * | | |1 = Processor core one-shot reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PDMA0RST |PDMA0 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the PDMA0 (always secure). - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = PDMA0 controller normal operation. - * | | |1 = PDMA0 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |EBIRST |EBI Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the EBI - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = EBI controller normal operation. - * | | |1 = EBI controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |USBHRST |USB Host Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the USB Host. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = USB Host controller normal operation. - * | | |1 = USB Host controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |SDH0RST |SDHOST0 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the SDHOST0 controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = SDHOST0 controller normal operation. - * | | |1 = SDHOST0 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |CRCRST |CRC Calculation Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the CRC calculation controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CRC calculation controller normal operation. - * | | |1 = CRC calculation controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |CRPTRST |CRYPTO Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CRYPTO controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CRYPTO controller normal operation. - * | | |1 = CRYPTO controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |KSRST |Key Store Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CRYPTO controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = Key Store controller normal operation. - * | | |1 = Key Store controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[29] |PDMA1RST |PDMA1 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the PDMA1. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = PDMA1 controller normal operation. - * | | |1 = PDMA1 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::IPRST1 - * Offset: 0x0C Peripheral Reset Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |GPIORST |GPIO Controller Reset - * | | |0 = GPIO controller normal operation. - * | | |1 = GPIO controller reset. - * |[2] |TMR0RST |Timer0 Controller Reset - * | | |0 = Timer0 controller normal operation. - * | | |1 = Timer0 controller reset. - * |[3] |TMR1RST |Timer1 Controller Reset - * | | |0 = Timer1 controller normal operation. - * | | |1 = Timer1 controller reset. - * |[4] |TMR2RST |Timer2 Controller Reset - * | | |0 = Timer2 controller normal operation. - * | | |1 = Timer2 controller reset. - * |[5] |TMR3RST |Timer3 Controller Reset - * | | |0 = Timer3 controller normal operation. - * | | |1 = Timer3 controller reset. - * |[7] |ACMP01RST |Analog Comparator 0/1 Controller Reset - * | | |0 = Analog Comparator 0/1 controller normal operation. - * | | |1 = Analog Comparator 0/1 controller reset. - * |[8] |I2C0RST |I2C0 Controller Reset - * | | |0 = I2C0 controller normal operation. - * | | |1 = I2C0 controller reset. - * |[9] |I2C1RST |I2C1 Controller Reset - * | | |0 = I2C1 controller normal operation. - * | | |1 = I2C1 controller reset. - * |[10] |I2C2RST |I2C2 Controller Reset - * | | |0 = I2C2 controller normal operation. - * | | |1 = I2C2 controller reset. - * |[12] |QSPI0RST |QSPI0 Controller Reset - * | | |0 = QSPI0 controller normal operation. - * | | |1 = QSPI0 controller reset. - * |[13] |SPI0RST |SPI0 Controller Reset - * | | |0 = SPI0 controller normal operation. - * | | |1 = SPI0 controller reset. - * |[14] |SPI1RST |SPI1 Controller Reset - * | | |0 = SPI1 controller normal operation. - * | | |1 = SPI1 controller reset. - * |[15] |SPI2RST |SPI2 Controller Reset - * | | |0 = SPI2 controller normal operation. - * | | |1 = SPI2 controller reset. - * |[16] |UART0RST |UART0 Controller Reset - * | | |0 = UART0 controller normal operation. - * | | |1 = UART0 controller reset. - * |[17] |UART1RST |UART1 Controller Reset - * | | |0 = UART1 controller normal operation. - * | | |1 = UART1 controller reset. - * |[18] |UART2RST |UART2 Controller Reset - * | | |0 = UART2 controller normal operation. - * | | |1 = UART2 controller reset. - * |[19] |UART3RST |UART3 Controller Reset - * | | |0 = UART3 controller normal operation. - * | | |1 = UART3 controller reset. - * |[20] |UART4RST |UART4 Controller Reset - * | | |0 = UART4 controller normal operation. - * | | |1 = UART4 controller reset. - * |[21] |UART5RST |UART5 Controller Reset - * | | |0 = UART5 controller normal operation. - * | | |1 = UART5 controller reset. - * |[24] |CAN0RST |CAN0 Controller Reset - * | | |0 = CAN0 controller normal operation. - * | | |1 = CAN0 controller reset. - * |[26] |OTGRST |OTG Controller Reset - * | | |0 = OTG controller normal operation. - * | | |1 = OTG controller reset. - * |[27] |USBDRST |USBD Controller Reset - * | | |0 = USBD controller normal operation. - * | | |1 = USBD controller reset. - * |[28] |EADCRST |EADC Controller Reset - * | | |0 = EADC controller normal operation. - * | | |1 = EADC controller reset. - * |[29] |I2S0RST |I2S0 Controller Reset - * | | |0 = I2S0 controller normal operation. - * | | |1 = I2S0 controller reset. - * |[30] |LCDRST |LCD Controller Reset - * | | |0 = LCD controller normal operation. - * | | |1 = LCD controller reset. - * |[31] |TRNGRST |TRNG Controller Reset - * | | |0 = TRNG controller normal operation. - * | | |1 = TRNG controller reset. - * @var SYS_T::IPRST2 - * Offset: 0x10 Peripheral Reset Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SC0RST |SC0 Controller Reset - * | | |0 = SC0 controller normal operation. - * | | |1 = SC0 controller reset. - * |[1] |SC1RST |SC1 Controller Reset - * | | |0 = SC1 controller normal operation. - * | | |1 = SC1 controller reset. - * |[2] |SC2RST |SC2 Controller Reset - * | | |0 = SC2 controller normal operation. - * | | |1 = SC2 controller reset. - * |[6] |SPI3RST |SPI3 Controller Reset - * | | |0 = SPI3 controller normal operation. - * | | |1 = SPI3 controller reset. - * |[8] |USCI0RST |USCI0 Controller Reset - * | | |0 = USCI0 controller normal operation. - * | | |1 = USCI0 controller reset. - * |[9] |USCI1RST |USCI1 Controller Reset - * | | |0 = USCI1 controller normal operation. - * | | |1 = USCI1 controller reset. - * |[12] |DACRST |DAC Controller Reset - * | | |0 = DAC controller normal operation. - * | | |1 = DAC controller reset. - * |[16] |EPWM0RST |EPWM0 Controller Reset - * | | |0 = EPWM0 controller normal operation. - * | | |1 = EPWM0 controller reset. - * |[17] |EPWM1RST |EPWM1 Controller Reset - * | | |0 = EPWM1 controller normal operation. - * | | |1 = EPWM1 controller reset. - * |[18] |BPWM0RST |BPWM0 Controller Reset - * | | |0 = BPWM0 controller normal operation. - * | | |1 = BPWM0 controller reset. - * |[19] |BPWM1RST |BPWM1 Controller Reset - * | | |0 = BPWM1 controller normal operation. - * | | |1 = BPWM1 controller reset. - * |[20] |TMR4RST |Timer4 Controller Reset - * | | |0 = Timer4 controller normal operation. - * | | |1 = Timer4 controller reset. - * |[21] |TMR5RST |Timer5 Controller Reset - * | | |0 = Timer5 controller normal operation. - * | | |1 = Timer5 controller reset. - * |[22] |QEI0RST |QEI0 Controller Reset - * | | |0 = QEI0 controller normal operation. - * | | |1 = QEI0 controller reset. - * |[23] |QEI1RST |QEI1 Controller Reset - * | | |0 = QEI1 controller normal operation. - * | | |1 = QEI1 controller reset. - * |[26] |ECAP0RST |ECAP0 Controller Reset - * | | |0 = ECAP0 controller normal operation. - * | | |1 = ECAP0 controller reset. - * |[27] |ECAP1RST |ECAP1 Controller Reset - * | | |0 = ECAP1 controller normal operation. - * | | |1 = ECAP1 controller reset. - * @var SYS_T::BODCTL - * Offset: 0x18 Brown-out Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODEN |Brown-out Detector Enable Bit (Write Protect) - * | | |The default value is set by flash controller user configuration register CBODEN (CONFIG0 [23]). - * | | |0 = Brown-out Detector function Disabled. - * | | |1 = Brown-out Detector function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |BODRSTEN |Brown-out Reset Enable Bit (Write Protect) - * | | |The default value is set by flash controller user configuration register CBORST(CONFIG0[20]) bit . - * | | |0 = Brown-out INTERRUPT function Enabled. - * | | |1 = Brown-out RESET function Enabled. - * | | |Note1: - * | | |While the Brown-out Detector function is enabled (BODEN high) and BOD reset function is enabled (BODRSTEN high), BOD will assert a signal to reset chip when the detected voltage is lower than the threshold (BODOUT high). - * | | |While the BOD function is enabled (BODEN high) and BOD interrupt function is enabled (BODRSTEN low), BOD will assert an interrupt if AVDD high.than BODVL, BOD interrupt will keep till to the BODIF set to 0. - * | | |BOD interrupt can be blocked by disabling the NVIC BOD interrupt or disabling BOD function (set BODEN low). - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |BODIF |Brown-out Detector Interrupt Flag - * | | |0 = Brown-out Detector does not detect any voltage draft at VDD down through or up through the voltage of BODVL setting. - * | | |1 = When Brown-out Detector detects the VDD is dropped down through the voltage of BODVL setting or the VDD is raised up through the voltage of BODVL setting, this bit is set to 1 and the brown-out interrupt is requested if brown-out interrupt is enabled. - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |BODOUT |Brown-out Detector Output Status - * | | |0 = Brown-out Detector output status is 0. - * | | |It means the detected voltage is higher than BODVL setting or BODEN is 0. - * | | |1 = Brown-out Detector output status is 1. - * | | |It means the detected voltage is lower than BODVL setting. - * | | |If the BODEN is 0, BOD function disabled , this bit always responds 0. - * |[7] |LVREN |Low Voltage Reset Enable Bit (Write Protect) - * | | |The LVR function resets the chip when the input power voltage is lower than LVR circuit setting. - * | | |LVR function is enabled by default. - * | | |0 = Low Voltage Reset function Disabled. - * | | |1 = Low Voltage Reset function Enabled. - * | | |Note1: After enabling the bit, the LVR function will be active with 200us delay for LVR output stable (default). - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10:8] |BODDGSEL |Brown-out Detector Output De-glitch Time Select (Write Protect) - * | | |000 = BOD output is sampled by LIRC clock. - * | | |001 = 4 system clock (HCLK). - * | | |010 = 8 system clock (HCLK). - * | | |011 = 16 system clock (HCLK). - * | | |100 = 32 system clock (HCLK). - * | | |101 = 64 system clock (HCLK). - * | | |110 = 128 system clock (HCLK). - * | | |111 = 256 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[14:12] |LVRDGSEL |LVR Output De-glitch Time Select (Write Protect) - * | | |000 = Without de-glitch function. - * | | |001 = 4 system clock (HCLK). - * | | |010 = 8 system clock (HCLK). - * | | |011 = 16 system clock (HCLK). - * | | |100 = 32 system clock (HCLK). - * | | |101 = 64 system clock (HCLK). - * | | |110 = 128 system clock (HCLK). - * | | |111 = 256 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[23] |STB |Circuit Stable Flag (Read Only) - * | | |This bit indicates LVR and BOD already stable, system cannot detect LVR and BOD event when this bit is not set. - * | | |0 = LVR and BOD is not stable. - * | | |1 = LVR and BOD already stable. - * |[18:16] |BODVL |Brown-out Detector Threshold Voltage Selection (Write Protect) - * | | |The default value is set by flash controller user configuration register CBOV (CONFIG0 [23:21]). - * | | |000 = Brown-out Detector threshold voltage is 1.6V. - * | | |001 = Brown-out Detector threshold voltage is 1.8V. - * | | |010 = Brown-out Detector threshold voltage is 2.0V. - * | | |011 = Brown-out Detector threshold voltage is 2.2V. - * | | |100 = Brown-out Detector threshold voltage is 2.4V. - * | | |101 = Brown-out Detector threshold voltage is 2.6V. - * | | |110 = Brown-out Detector threshold voltage is 2.8V. - * | | |111 = Brown-out Detector threshold voltage is 3.0V. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[31] |WRBUSY |Write Busy Flag (Read Only) - * | | |If SYS_BODCTL is written, this bit is asserted automatically by hardware, and is de-asserted when write procedure is finished. - * | | |0 = SYS_BODCTL register is ready for write operation. - * | | |1 = SYS_BODCTL register is busy on the last write operation. Other write operations are ignored. - * @var SYS_T::IVSCTL - * Offset: 0x1C Internal Voltage Source Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VTEMPEN |Temperature Sensor Enable Bit - * | | |This bit is used to enable/disable temperature sensor function. - * | | |0 = Temperature sensor function Disabled (default). - * | | |1 = Temperature sensor function Enabled. - * | | |Note: After this bit is set to 1, the value of temperature sensor output can be obtained through GPC.9. - * |[1] |VBATUGEN |VBAT Unity Gain Buffer Enable Bit - * | | |This bit is used to enable/disable VBAT unity gain buffer function. - * | | |0 = VBAT unity gain buffer function Disabled (default). - * | | |1 = VBAT unity gain buffer function Enabled. - * | | |Note: After this bit is set to 1, the value of VBAT unity gain buffer output voltage can be obtained from ADC conversion result. - * @var SYS_T::PORCTL0 - * Offset: 0x24 Power-on Reset Controller Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PORMASK |Power-on Reset Mask Enable Bit (Write Protect) - * | | |When powered on, the POR circuit generates a reset signal to reset the whole chip function, but noise on the power may cause the POR active again. - * | | |User can mask internal POR signal to avoid unpredictable noise to cause chip reset by writing 0x5AA5 to this field. - * | | |The POR function will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::VREFCTL - * Offset: 0x28 VREF Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |VREFCTL |VREF Control Bits (Write Protect) - * | | |00000 = VREF is from external pin. - * | | |00011 = VREF is internal 1.6V. - * | | |00111 = VREF is internal 2.0V. - * | | |01011 = VREF is internal 2.5V. - * | | |01111 = VREF is internal 3.0V. - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[5] |IBIASSEL |VREF Bias Current Selection (Write Protect) - * | | |0 = Bias current from MEGBIAS. - * | | |1 = Bias current from internal. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7:6] |PRELOADSEL|Pre-load Timing Selection (Write Protect) - * | | |00 = pre-load time is 60us for 0.1uF Capacitor. - * | | |01 = pre-load time is 310us for 1uF Capacitor. - * | | |10 = pre-load time is 1270us for 4.7uF Capacitor. - * | | |11 = pre-load time is 2650us for 10uF Capacitor. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::USBPHY - * Offset: 0x2C USB PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |USBROLE |USB Role Option (Write Protect) - * | | |These two bits are used to select the role of USB. - * | | |00 = Standard USB Device mode. - * | | |01 = Standard USB Host mode. - * | | |10 = ID dependent mode. - * | | |11 = On-The-Go device mode (default). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[2] |SBO |Note: This bit must always be kept 1. If set to 0, the result is unpredictable. - * |[8] |OTGPHYEN |USB OTG PHY Enable - * | | |This bit is used to enable/disable OTG PHY function. - * | | |0 = OTG PHY function Disabled (default). - * | | |1 = OTG PHY function Enabled. - * @var SYS_T::GPA_MFPL - * Offset: 0x30 GPIOA Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA0MFP |PA.0 Multi-function Pin Selection - * |[7:4] |PA1MFP |PA.1 Multi-function Pin Selection - * |[11:8] |PA2MFP |PA.2 Multi-function Pin Selection - * |[15:12] |PA3MFP |PA.3 Multi-function Pin Selection - * |[19:16] |PA4MFP |PA.4 Multi-function Pin Selection - * |[23:20] |PA5MFP |PA.5 Multi-function Pin Selection - * |[27:24] |PA6MFP |PA.6 Multi-function Pin Selection - * |[31:28] |PA7MFP |PA.7 Multi-function Pin Selection - * @var SYS_T::GPA_MFPH - * Offset: 0x34 GPIOA High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA8MFP |PA.8 Multi-function Pin Selection - * |[7:4] |PA9MFP |PA.9 Multi-function Pin Selection - * |[11:8] |PA10MFP |PA.10 Multi-function Pin Selection - * |[15:12] |PA11MFP |PA.11 Multi-function Pin Selection - * |[19:16] |PA12MFP |PA.12 Multi-function Pin Selection - * |[23:20] |PA13MFP |PA.13 Multi-function Pin Selection - * |[27:24] |PA14MFP |PA.14 Multi-function Pin Selection - * |[31:28] |PA15MFP |PA.15 Multi-function Pin Selection - * @var SYS_T::GPB_MFPL - * Offset: 0x38 GPIOB Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB0MFP |PB.0 Multi-function Pin Selection - * |[7:4] |PB1MFP |PB.1 Multi-function Pin Selection - * |[11:8] |PB2MFP |PB.2 Multi-function Pin Selection - * |[15:12] |PB3MFP |PB.3 Multi-function Pin Selection - * |[19:16] |PB4MFP |PB.4 Multi-function Pin Selection - * |[23:20] |PB5MFP |PB.5 Multi-function Pin Selection - * |[27:24] |PB6MFP |PB.6 Multi-function Pin Selection - * |[31:28] |PB7MFP |PB.7 Multi-function Pin Selection - * @var SYS_T::GPB_MFPH - * Offset: 0x3C GPIOB High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB8MFP |PB.8 Multi-function Pin Selection - * |[7:4] |PB9MFP |PB.9 Multi-function Pin Selection - * |[11:8] |PB10MFP |PB.10 Multi-function Pin Selection - * |[15:12] |PB11MFP |PB.11 Multi-function Pin Selection - * |[19:16] |PB12MFP |PB.12 Multi-function Pin Selection - * |[23:20] |PB13MFP |PB.13 Multi-function Pin Selection - * |[27:24] |PB14MFP |PB.14 Multi-function Pin Selection - * |[31:28] |PB15MFP |PB.15 Multi-function Pin Selection - * @var SYS_T::GPC_MFPL - * Offset: 0x40 GPIOC Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC0MFP |PC.0 Multi-function Pin Selection - * |[7:4] |PC1MFP |PC.1 Multi-function Pin Selection - * |[11:8] |PC2MFP |PC.2 Multi-function Pin Selection - * |[15:12] |PC3MFP |PC.3 Multi-function Pin Selection - * |[19:16] |PC4MFP |PC.4 Multi-function Pin Selection - * |[23:20] |PC5MFP |PC.5 Multi-function Pin Selection - * |[27:24] |PC6MFP |PC.6 Multi-function Pin Selection - * |[31:28] |PC7MFP |PC.7 Multi-function Pin Selection - * @var SYS_T::GPC_MFPH - * Offset: 0x44 GPIOC High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC8MFP |PC.8 Multi-function Pin Selection - * |[7:4] |PC9MFP |PC.9 Multi-function Pin Selection - * |[11:8] |PC10MFP |PC.10 Multi-function Pin Selection - * |[15:12] |PC11MFP |PC.11 Multi-function Pin Selection - * |[19:16] |PC12MFP |PC.12 Multi-function Pin Selection - * |[23:20] |PC13MFP |PC.13 Multi-function Pin Selection - * @var SYS_T::GPD_MFPL - * Offset: 0x48 GPIOD Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD0MFP |PD.0 Multi-function Pin Selection - * |[7:4] |PD1MFP |PD.1 Multi-function Pin Selection - * |[11:8] |PD2MFP |PD.2 Multi-function Pin Selection - * |[15:12] |PD3MFP |PD.3 Multi-function Pin Selection - * |[19:16] |PD4MFP |PD.4 Multi-function Pin Selection - * |[23:20] |PD5MFP |PD.5 Multi-function Pin Selection - * |[27:24] |PD6MFP |PD.6 Multi-function Pin Selection - * |[31:28] |PD7MFP |PD.7 Multi-function Pin Selection - * @var SYS_T::GPD_MFPH - * Offset: 0x4C GPIOD High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD8MFP |PD.8 Multi-function Pin Selection - * |[7:4] |PD9MFP |PD.9 Multi-function Pin Selection - * |[11:8] |PD10MFP |PD.10 Multi-function Pin Selection - * |[15:12] |PD11MFP |PD.11 Multi-function Pin Selection - * |[19:16] |PD12MFP |PD.12 Multi-function Pin Selection - * |[27:24] |PD14MFP |PD.14 Multi-function Pin Selection - * @var SYS_T::GPE_MFPL - * Offset: 0x50 GPIOE Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PE0MFP |PE.0 Multi-function Pin Selection - * |[7:4] |PE1MFP |PE.1 Multi-function Pin Selection - * |[11:8] |PE2MFP |PE.2 Multi-function Pin Selection - * |[15:12] |PE3MFP |PE.3 Multi-function Pin Selection - * |[19:16] |PE4MFP |PE.4 Multi-function Pin Selection - * |[23:20] |PE5MFP |PE.5 Multi-function Pin Selection - * |[27:24] |PE6MFP |PE.6 Multi-function Pin Selection - * |[31:28] |PE7MFP |PE.7 Multi-function Pin Selection - * @var SYS_T::GPE_MFPH - * Offset: 0x54 GPIOE High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PE8MFP |PE.8 Multi-function Pin Selection - * |[7:4] |PE9MFP |PE.9 Multi-function Pin Selection - * |[11:8] |PE10MFP |PE.10 Multi-function Pin Selection - * |[15:12] |PE11MFP |PE.11 Multi-function Pin Selection - * |[19:16] |PE12MFP |PE.12 Multi-function Pin Selection - * |[23:20] |PE13MFP |PE.13 Multi-function Pin Selection - * |[27:24] |PE14MFP |PE.14 Multi-function Pin Selection - * |[31:28] |PE15MFP |PE.15 Multi-function Pin Selection - * @var SYS_T::GPF_MFPL - * Offset: 0x58 GPIOF Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF0MFP |PF.0 Multi-function Pin Selection - * |[7:4] |PF1MFP |PF.1 Multi-function Pin Selection - * |[11:8] |PF2MFP |PF.2 Multi-function Pin Selection - * |[15:12] |PF3MFP |PF.3 Multi-function Pin Selection - * |[19:16] |PF4MFP |PF.4 Multi-function Pin Selection - * |[23:20] |PF5MFP |PF.5 Multi-function Pin Selection - * |[27:24] |PF6MFP |PF.6 Multi-function Pin Selection - * |[31:28] |PF7MFP |PF.7 Multi-function Pin Selection - * @var SYS_T::GPF_MFPH - * Offset: 0x5C GPIOF High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF8MFP |PF.8 Multi-function Pin Selection - * |[7:4] |PF9MFP |PF.9 Multi-function Pin Selection - * |[11:8] |PF10MFP |PF.10 Multi-function Pin Selection - * |[15:12] |PF11MFP |PF.11 Multi-function Pin Selection - * @var SYS_T::GPG_MFPL - * Offset: 0x60 GPIOG Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:8] |PG2MFP |PG.2 Multi-function Pin Selection - * |[15:12] |PG3MFP |PG.3 Multi-function Pin Selection - * |[19:16] |PG4MFP |PG.4 Multi-function Pin Selection - * @var SYS_T::GPG_MFPH - * Offset: 0x64 GPIOG High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:4] |PG9MFP |PG.9 Multi-function Pin Selection - * |[11:8] |PG10MFP |PG.10 Multi-function Pin Selection - * |[15:12] |PG11MFP |PG.11 Multi-function Pin Selection - * |[19:16] |PG12MFP |PG.12 Multi-function Pin Selection - * |[23:20] |PG13MFP |PG.13 Multi-function Pin Selection - * |[27:24] |PG14MFP |PG.14 Multi-function Pin Selection - * |[31:28] |PG15MFP |PG.15 Multi-function Pin Selection - * @var SYS_T::GPH_MFPL - * Offset: 0x68 GPIOH Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[19:16] |PH4MFP |PH.4 Multi-function Pin Selection - * |[23:20] |PH5MFP |PH.5 Multi-function Pin Selection - * |[27:24] |PH6MFP |PH.6 Multi-function Pin Selection - * |[31:28] |PH7MFP |PH.7 Multi-function Pin Selection - * @var SYS_T::GPH_MFPH - * Offset: 0x6C GPIOH High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PH8MFP |PH.8 Multi-function Pin Selection - * |[7:4] |PH9MFP |PH.9 Multi-function Pin Selection - * |[11:8] |PH10MFP |PH.10 Multi-function Pin Selection - * |[15:12] |PH11MFP |PH.11 Multi-function Pin Selection - * @var SYS_T::VTORSET - * Offset: 0xA0 VTOR Setting Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VTORSET |VTOR Setting After SPD Wakeup (Write Protect) - * | | |This is the register to set the address of vector table after chip is waked up from SPD Power-down mode. - * | | |The value will be loaded to Vector Table Offset Register, which is at the address 0xE000ED08, when chip wake up from SPD mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::SRAMICTL - * Offset: 0xC0 System SRAM Parity Error Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PERRIEN |SRAM Parity Check Error Interrupt Enable Bit - * | | |0 = SRAM parity check error interrupt Disabled. - * | | |1 = SRAM parity check error interrupt Enabled. - * @var SYS_T::SRAMSTS - * Offset: 0xC4 System SRAM Parity Check Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PERRIF |SRAM Parity Check Error Flag - * | | |This bit indicates the System SRAM parity error occurred. Write 1 to clear this to 0. - * | | |0 = No System SRAM parity error. - * | | |1 = System SRAM parity error occur. - * @var SYS_T::SRAMEADR - * Offset: 0xC8 System SRAM Parity Check Error Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ERRADDR |System SRAM Parity Error Address - * | | |This register shows system SRAM parity error byte address. - * @var SYS_T::SRAMPC0 - * Offset: 0xDC SRAM Power Mode Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SRAM0PM0 |Bank0 SRAM Power Mode Select 0 (Write Protect) - * | | |This field can control SRAM bank0 selection 0 (4k) power mode for range 0x2000_0000 - 0x2000_0FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[3:2] |SRAM0PM1 |Bank0 SRAM Power Mode Select 1 (Write Protect) - * | | |This field can control SRAM bank0 selection 1 power mode for range 0x2000_1000 - 0x2000_1FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[5:4] |SRAM0PM2 |Bank0 SRAM Power Mode Select 2 (Write Protect) - * | | |This field can control SRAM bank0 selection 2 (8k) power mode for range 0x2000_2000 - 0x2000_3FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[7:6] |SRAM0PM3 |Bank0 SRAM Power Mode Select 3 (Write Protect) - * | | |This field can control SRAM bank0 selection 3 (8k) power mode for range 0x2000_4000 - 0x2000_5FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[9:8] |SRAM0PM4 |Bank0 SRAM Power Mode Select 4 (Write Protect) - * | | |This field can control SRAM0 bank0 selection 4 (8k) power mode for range 0x2000_6000 - 0x2000_7FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[11:10] |SRAM1PM0 |Bank1 SRAM Power Mode Select 0 (Write Protect) - * | | |This field can control SRAM bank1 selection 0 (16k) power mode for range 0x2000_8000 - 0x2000_BFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[13:12] |SRAM1PM1 |Bank1 SRAM Power Mode Select 1 (Write Protect) - * | | |This field can control SRAM bank1 selection 1 (16k) power mode for range 0x2000_C000 - 0x2000_FFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[15:14] |SRAM1PM2 |Bank1 SRAM Power Mode Select 2 (Write Protect) - * | | |This field can control SRAM bank1 selection 2 (16k) power mode for range 0x2001_0000 - 0x2001_3FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[17:16] |SRAM1PM3 |Bank1 SRAM Power Mode Select 3 (Write Protect) - * | | |This field can control SRAM bank1 selection 3 (16k) power mode for range 0x2001_4000 - 0x2001_7FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[19:18] |SRAM1PM4 |Bank1 SRAM Power Mode Select 4 (Write Protect) - * | | |This field can control SRAM bank1 selection 4 (16k) power mode for range 0x2001_8000 - 0x2001_BFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[21:20] |SRAM1PM5 |Bank1 SRAM Power Mode Select 5 (Write Protect) - * | | |This field can control SRAM bank1 selection 5 (16k) power mode for range 0x2001_C000 - 0x2001_FFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[23:22] |SRAM1PM6 |Bank1 SRAM Power Mode Select 6 (Write Protect) - * | | |This field can control SRAM bank1 selection 6 (16k) power mode for range 0x2002_0000 - 0x2002_3FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[25:24] |SRAM1PM7 |Bank1 SRAM Power Mode Select 7 (Write Protect) - * | | |This field can control SRAM bank1 selection 7 (16k) power mode for range 0x2002_4000 - 0x2002_7FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[27:26] |SRAM2PM0 |Bank2 SRAM Power Mode Select 0 (Write Protect) - * | | |This field can control SRAM bank2 selection 0 (16k) power mode for range 0x2002_8000 - 0x2002_BFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[29:28] |SRAM2PM1 |Bank2 SRAM Power Mode Select 1 (Write Protect) - * | | |This field can control SRAM bank2 selection 1 (16k) power mode for range 0x2002_C000 - 0x2002_FFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[31] |PCBUSY |Power Changing Busy Flag (Read Only) - * | | |This bit indicate SRAM power changing. - * | | |0 = SRAM power change finish. - * | | |1 = SRAM power changing. - * @var SYS_T::SRAMPC1 - * Offset: 0xE0 SRAM Power Mode Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SRAM2PM2 |Bank2 SRAM Power Mode Select 2 (Write Protect) - * | | |This field can control SRAM bank2 selection 2 (16k) power mode for range 0x2003_0000 - 0x2003_3FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[3:2] |SRAM2PM3 |Bank2 SRAM Power Mode Select 3 (Write Protect) - * | | |This field can control bank2 sram3 (16k) power mode for range 0x2003_4000 - 0x2003_7FFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[5:4] |SRAM2PM4 |Bank2 SRAM Power Mode Select 4 (Write Protect) - * | | |This field can control SRAM bank2 selection 4 (16k) power mode for range 0x2003_8000 - 0x2003_BFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[7:6] |SRAM2PM5 |Bank2 SRAM Power Mode Select 5 (Write Protect) - * | | |This field can control SRAM bank2 selection 5 (16k) power mode for range 0x2003_C000 - 0x2003_FFFF. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[17:16] |CAN |CAN SRAM Power Mode Select (Write Protect) - * | | |This field can control CAN sram power mode. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved. - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[19:18] |USBD |USB Device SRAM Power Mode Select (Write Protect) - * | | |This field can control USB device sram power mode. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[21:20] |PDMA0 |PDMA SRAM Power Mode Select (Write Protect) - * | | |This field can control PDMA0 (always secure) sram power mode. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[23:22] |PDMA1 |PDMA SRAM Power Mode Select (Write Protect) - * | | |This field can control PDMA1 sram power mode. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[25:24] |FMCCACHE |FMC Cache SRAM Power Mode Select (Write Protect) - * | | |This field can control FMC cache sram power mode. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[27:26] |RSA |RSA SRAM Power Mode Select (Write Protect) - * | | |This field can control RSA sram power mode. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * | | |Note 3: If CRPTPWREN of SYS_PSWCTL is set to 1, RSA SRAM is auto set to normal mode by hardware. - * |[29:28] |KS |Key Store SRAM Power Mode Select (Write Protect) - * | | |This field can control Key Store sram power mode. - * | | |00 = Normal mode. - * | | |01 = Retention mode. - * | | |10 = Power shut down mode. - * | | |11 = Reserved (Write Ignore). - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Write ignore when PCBUSY is 1. - * |[31] |PCBUSY |Power Changing Busy Flag (Read Only) - * | | |This bit indicate SRAM power changing. - * | | |0 = SRAM power change finish. - * | | |1 = SRAM power changing. - * @var SYS_T::TCTL48M - * Offset: 0xE4 HIRC 48M Trim Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FREQSEL |Trim Frequency Selection - * | | |This field indicates the target frequency of 48 MHz internal high speed RC oscillator (HIRC48) auto trim. - * | | |During auto trim operation, if clock error detected with CESTOPEN is set to 1 or trim retry limitation count reached, this field will be cleared to 00 automatically. - * | | |00 = Disable HIRC auto trim function. - * | | |01 = Enable HIRC auto trim function and trim HIRC to 48 MHz. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[5:4] |LOOPSEL |Trim Calculation Loop Selection - * | | |This field defines that trim value calculation is based on how many reference clocks. - * | | |00 = Trim value calculation is based on average difference in 4 clocks of reference clock. - * | | |01 = Trim value calculation is based on average difference in 8 clocks of reference clock. - * | | |10 = Trim value calculation is based on average difference in 16 clocks of reference clock. - * | | |11 = Trim value calculation is based on average difference in 32 clocks of reference clock. - * | | |Note: For example, if LOOPSEL is set as 00, auto trim circuit will calculate trim value based on the average frequency difference in 4 clocks of reference clock. - * |[7:6] |RETRYCNT |Trim Value Update Limitation Count - * | | |This field defines that how many times the auto trim circuit will try to update the HIRC trim value before the frequency of HIRC locked. - * | | |Once the HIRC locked, the internal trim value update counter will be reset. - * | | |If the trim value update counter reached this limitation value and frequency of HIRC still doesn't lock, the auto trim operation will be disabled and FREQSEL will be cleared to 00. - * | | |00 = Trim retry count limitation is 64 loops. - * | | |01 = Trim retry count limitation is 128 loops. - * | | |10 = Trim retry count limitation is 256 loops. - * | | |11 = Trim retry count limitation is 512 loops. - * |[9] |BOUNDEN |Boundary Enable Bit - * | | |0 = Boundary function is disable. - * | | |1 = Boundary function is enable. - * |[8] |CESTOPEN |Clock Error Stop Enable Bit - * | | |0 = The trim operation is keep going if clock is inaccuracy. - * | | |1 = The trim operation is stopped if clock is inaccuracy. - * |[10] |REFCKSEL |Reference Clock Selection - * | | |0 = HIRC trim 48M reference clock is from external 32.768 kHz crystal oscillator. - * | | |1 = HIRC trim 48M reference clock is from internal USB synchronous mode. - * |[20:16] |BOUNDARY |Boundary Selection - * | | |Fill the boundary range from 0x1 to 0x31, 0x0 is reserved. - * | | |Note: This field is effective only when the BOUNDEN(SYS_TCTL48M [9]) is enable. - * @var SYS_T::TIEN48M - * Offset: 0xE8 HIRC 48M Trim Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TFAILIEN |Trim Failure Interrupt Enable Bit - * | | |This bit controls if an interrupt will be triggered while HIRC trim value update limitation count reached and HIRC frequency still not locked on target frequency set by FREQSEL(SYS_TCTL48M[1:0]). - * | | |If this bit is high and TFAILIF(SYS_TISTS48M[1]) is set during auto trim operation, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |0 = Disable TFAILIF(SYS_TISTS48M[1]) status to trigger an interrupt to CPU. - * | | |1 = Enable TFAILIF(SYS_TISTS48MM[1]) status to trigger an interrupt to CPU. - * |[2] |CLKEIEN |Clock Error Interrupt Enable Bit - * | | |This bit controls if CPU would get an interrupt while clock is inaccuracy during auto trim operation. - * | | |If this bit is set to1, and CLKERRIF(SYS_TISTS48M[2]) is set during auto trim operation, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |0 = Disable CLKERRIF(SYS_TISTS48M[2]) status to trigger an interrupt to CPU. - * | | |1 = Enable CLKERRIF(SYS_TISTS48M[2]) status to trigger an interrupt to CPU. - * @var SYS_T::TISTS48M - * Offset: 0xEC HIRC 48M Trim Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FREQLOCK |HIRC Frequency Lock Status - * | | |This bit indicates the HIRC frequency is locked. - * | | |This is a status bit and doesn't trigger any interrupt. - * | | |Write 1 to clear this to 0. - * | | |This bit will be set automatically, if the frequency is lock and the RC_TRIM is enabled. - * | | |0 = The internal high-speed oscillator frequency doesn't lock at 48 MHz yet. - * | | |1 = The internal high-speed oscillator frequency locked at 48 MHz. - * |[1] |TFAILIF |Trim Failure Interrupt Status - * | | |This bit indicates that HIRC trim value update limitation count reached and the HIRC clock frequency still doesn't be locked. - * | | |Once this bit is set, the auto trim operation stopped and FREQSEL(SYS_TCTL48M[1:0]) will be cleared to 00 by hardware automatically. - * | | |If this bit is set and TFAILIEN(SYS_TIEN48M[1]) is high, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |Write 1 to clear this to 0. - * | | |0 = Trim value update limitation count does not reach. - * | | |1 = Trim value update limitation count reached and HIRC frequency still not locked. - * |[2] |CLKERRIF |Clock Error Interrupt Status - * | | |When the frequency of 32.768 kHz external low speed crystal oscillator (LXT) or 48MHz internal high speed RC oscillator (HIRC48) is shift larger to unreasonable value, this bit will be set and to be an indicate that clock frequency is inaccuracy - * | | |Once this bit is set to 1, the auto trim operation stopped and FREQSEL(SYS_TICTL48M[1:0]) will be cleared to 00 by hardware automatically if CESTOPEN(SYS_TCTL48M[8]) is set to 1. - * | | |If this bit is set and CLKEIEN(SYS_TIEN48M[2]) is high, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |Write 1 to clear this to 0. - * | | |0 = Clock frequency is accuracy. - * | | |1 = Clock frequency is inaccuracy. - * |[3] |OVBDIF |Over Boundary Status - * | | |When the over boundary function is set, if there occurs the over boundary condition, this flag will be set. - * | | |0 = Over boundary condition did not occur. - * | | |1 = Over boundary condition occurred. - * | | |Note: Write 1 to clear this flag. - * @var SYS_T::TCTL12M - * Offset: 0xF0 HIRC 12M Trim Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FREQSEL |Trim Frequency Selection - * | | |This field indicates the target frequency of 12 MHz internal high speed RC oscillator (HIRC) auto trim. - * | | |During auto trim operation, if clock error detected with CESTOPEN is set to 1 or trim retry limitation count reached, this field will be cleared to 00 automatically. - * | | |00 = Disable HIRC auto trim function. - * | | |01 = Enable HIRC auto trim function and trim HIRC to 12 MHz. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[5:4] |LOOPSEL |Trim Calculation Loop Selection - * | | |This field defines that trim value calculation is based on how many reference clocks. - * | | |00 = Trim value calculation is based on average difference in 4 clocks of reference clock. - * | | |01 = Trim value calculation is based on average difference in 8 clocks of reference clock. - * | | |10 = Trim value calculation is based on average difference in 16 clocks of reference clock. - * | | |11 = Trim value calculation is based on average difference in 32 clocks of reference clock. - * | | |Note: For example, if LOOPSEL is set as 00, auto trim circuit will calculate trim value based on the average frequency difference in 4 clocks of reference clock. - * |[7:6] |RETRYCNT |Trim Value Update Limitation Count - * | | |This field defines that how many times the auto trim circuit will try to update the HIRC trim value before the frequency of HIRC locked. - * | | |Once the HIRC locked, the internal trim value update counter will be reset. - * | | |If the trim value update counter reached this limitation value and frequency of HIRC still doesn't lock, the auto trim operation will be disabled and FREQSEL will be cleared to 00. - * | | |00 = Trim retry count limitation is 64 loops. - * | | |01 = Trim retry count limitation is 128 loops. - * | | |10 = Trim retry count limitation is 256 loops. - * | | |11 = Trim retry count limitation is 512 loops. - * |[9] |BOUNDEN |Boundary Enable Bit - * | | |0 = Boundary function is disable. - * | | |1 = Boundary function is enable. - * |[8] |CESTOPEN |Clock Error Stop Enable Bit - * | | |0 = The trim operation is keep going if clock is inaccuracy. - * | | |1 = The trim operation is stopped if clock is inaccuracy. - * |[10] |REFCKSEL |Reference Clock Selection - * | | |0 = HIRC trim reference clock is from external 32.768 kHz crystal oscillator. - * | | |1 = HIRC trim reference clock is from internal USB synchronous mode. - * |[20:16] |BOUNDARY |Boundary Selection - * | | |Fill the boundary range from 0x1 to 0x31, 0x0 is reserved. - * | | |Note: This field is effective only when the BOUNDEN(SYS_TCTL12M[9]) is enabled. - * @var SYS_T::TIEN12M - * Offset: 0xF4 HIRC 12M Trim Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TFAILIEN |Trim Failure Interrupt Enable Bit - * | | |This bit controls if an interrupt will be triggered while HIRC trim value update limitation count reached and HIRC frequency still not locked on target frequency set by FREQSEL(SYS_TCTL12M[1:0]). - * | | |If this bit is high and TFAILIF(SYS_TISTS12M[1]) is set during auto trim operation, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |0 = Disable TFAILIF(SYS_TISTS12M[1]) status to trigger an interrupt to CPU. - * | | |1 = Enable TFAILIF(SYS_TISTS12M[1]) status to trigger an interrupt to CPU. - * |[2] |CLKEIEN |Clock Error Interrupt Enable Bit - * | | |This bit controls if CPU would get an interrupt while clock is inaccuracy during auto trim operation. - * | | |If this bit is set to1, and CLKERRIF(SYS_TISTS12M[2]) is set during auto trim operation, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |0 = Disable CLKERRIF(SYS_TISTS12M[2]) status to trigger an interrupt to CPU. - * | | |1 = Enable CLKERRIF(SYS_TISTS12M[2]) status to trigger an interrupt to CPU. - * @var SYS_T::TISTS12M - * Offset: 0xF8 HIRC 12M Trim Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FREQLOCK |HIRC Frequency Lock Status - * | | |This bit indicates the HIRC frequency is locked. - * | | |This is a status bit and doesn't trigger any interrupt. - * | | |Write 1 to clear this to 0. - * | | |This bit will be set automatically, if the frequency is lock and the RC_TRIM is enabled. - * | | |0 = The internal high-speed oscillator frequency doesn't lock at 12 MHz yet. - * | | |1 = The internal high-speed oscillator frequency locked at 12 MHz. - * |[1] |TFAILIF |Trim Failure Interrupt Status - * | | |This bit indicates that HIRC trim value update limitation count reached and the HIRC clock frequency still doesn't be locked. - * | | |Once this bit is set, the auto trim operation stopped and FREQSEL(SYS_TCTL12M[1:0]) will be cleared to 00 by hardware automatically. - * | | |If this bit is set and TFAILIEN(SYS_TIEN12M[1]) is high, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |Write 1 to clear this to 0. - * | | |0 = Trim value update limitation count does not reach. - * | | |1 = Trim value update limitation count reached and HIRC frequency still not locked. - * |[2] |CLKERRIF |Clock Error Interrupt Status - * | | |When the frequency of 32.768 kHz external low speed crystal oscillator (LXT) or 12MHz internal high speed RC oscillator (HIRC) is shift larger to unreasonable value, this bit will be set and to be an indicate that clock frequency is inaccuracy - * | | |Once this bit is set to 1, the auto trim operation stopped and FREQSEL(SYS_TICTL12M[1:0]) will be cleared to 00 by hardware automatically if CESTOPEN(SYS_TCTL12M[8]) is set to 1. - * | | |If this bit is set and CLKEIEN(SYS_TIEN12M[2]) is high, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |Write 1 to clear this to 0. - * | | |0 = Clock frequency is accuracy. - * | | |1 = Clock frequency is inaccuracy. - * |[3] |OVBDIF |Over Boundary Status - * | | |When the over boundary function is set, if there occurs the over boundary condition, this flag will be set. - * | | |0 = Over boundary condition did not occur. - * | | |1 = Over boundary condition occurred. - * | | |Note: Write 1 to clear this flag. - * @var SYS_T::REGLCTL - * Offset: 0x100 Register Lock Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REGLCTL |Register Lock Control Code (Write Only) - * | | |Some registers have write-protection function - * | | |Writing these registers have to disable the protected function by writing the sequence value 59h, 16h, 88h to this field. - * | | |After this sequence is completed, the REGLCTL bit will be set to 1 and write-protection registers can be normal write. - * |[0] |REGLCTL[0]|Register Lock Control Disable Index (Read Only) - * | | |0 = Write-protection Enabled for writing protected registers. - * | | |Any write to the protected register is ignored. - * | | |1 = Write-protection Disabled for writing protected registers. - * @var SYS_T::CPUCFG - * Offset: 0x1D8 CPU General Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INTRTEN |CPU Interrupt Realtime Enable Bit - * | | |When this bit is 0, the latency of CPU entering interrupt service routine (ISR) will be various but shorter. - * | | |When this bit is 1, the latency of CPU entering ISR will be kept constant. - * | | |0 = CPU Interrupt Realtime Disabled. - * | | |1 = CPU Interrupt Realtime Enabled. - * @var SYS_T::PORCTL1 - * Offset: 0x1EC Power-on Reset Controller Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |POROFF |Power-on Reset Enable Bit (Write Protect) - * | | |When powered on, the POR circuit generates a reset signal to reset the whole chip function, but noise on the power may cause the POR active again. - * | | |User can disable internal POR circuit to avoid unpredictable noise to cause chip reset by writing 0x5AA5 to this field. - * | | |The POR function will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::PSWCTL - * Offset: 0x1F4 Power Switch Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12] |CRPTPWREN |Cryptographic Accelerator Power Switch Enable Bit (Write Protect) - * | | |0 = Cryptographic accelerator power supply Disabled. - * | | |1 = Cryptographic accelerator power supply Enabled. - * | | |Note 1: If this bit is set 1, RSA of SYS_SRAMPC1 is set to normal mode by hardware. - * | | |Note 2: Write ignored when PCBUSY(SYS_SRAMPC1[31]) is 1. - * | | |Note 3: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::PLCTL - * Offset: 0x1F8 Power Level Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PLSEL |Power Level Select (Write Protect) - * | | |00 = Set to Power level 0 (PL0). Support system clock up to 96MHz. - * | | |01 = Set to Power level 1 (PL1). Support system clock up to 84MHz. - * | | |10 = Set to Power level 2 (PL2). Support system clock up to 64MHz. - * | | |11 = Set to Power level 3 (PL3). Support system clock up to 4MHz. - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: These bits not be reset when wake-up from Standby Power-down mode(SPD). - * |[4] |MVRS |Main Voltage Regulator Type Select (Write Protect) - * | | |This bit filed sets main voltage regulator type. - * | | |After setting main voltage regulator type to DCDC (MVRS (SYS_PLCTL[4]) = 1) system will set main voltage regulator type change busy flag MVRCBUSY(SYS_PLSTS[1]), detect inductor connection and update inductor connection status LCONS (SYS_PLSTS[3]). - * | | |If inductor exist LCONS will be cleared and main voltage regulator type can switch to DCDC (CURMVRS (SYS_PLSTS[12])=1). - * | | |0 = Set main voltage regulator to LDO. - * | | |1 = Set main voltage regulator to DCDC. - * | | |Note 1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: This bit not be reset when wake-up from Standby Power-down mode(SPD). - * |[7] |WRBUSY |Write Busy Flag - * | | |If SYS_PLCTL be written, this bit be asserted automatic by hardware, and be de-asserted when write procedure finish. - * | | |0 = SYS_PLCTL register is ready for write operation. - * | | |1 = SYS_PLCTL register is busy on the last write operation. Other write operations are ignored. - * |[21:16] |LVSSTEP |LDO Voltage Scaling Step (Write Protect) - * | | |The LVSSTEP value is LDO voltage rising step. - * | | |LDO voltage scaling step = (LVSSTEP + 1) * 10mV. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[31:24] |LVSPRD |LDO Voltage Scaling Period (Write Protect) - * | | |The LVSPRD value is the period of each LDO voltage rising step. - * | | |LDO voltage scaling period = (LVSPRD + 1) * 1us. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::PLSTS - * Offset: 0x1FC Power Level Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PLCBUSY |Power Level Change Busy Bit (Read Only) - * | | |This bit is set by hardware when power level is changing. - * | | |After power level change is completed, this bit will be cleared automatically by hardware. - * | | |0 = Power level change is completed. - * | | |1 = Power level change is ongoing. - * |[1] |MVRCBUSY |Main Voltage Regulator Type Change Busy Bit (Read Only) - * | | |This bit is set by hardware when main voltage regulator type is changing. - * | | |After main voltage regulator type change is completed, this bit will be cleared automatically by hardware. - * | | |0 = Main voltage regulator type change is completed. - * | | |1 = Main voltage regulator type change is ongoing. - * |[2] |MVRCERR |Main Voltage Regulator Type Change Error Bit (Write Protect) - * | | |This bit is set to 1 when main voltage regulator type change from LDO to DCDC error, the following conditions will cause change errors: - * | | |1.System change to DC-DC mode but LDO change voltage process not finish. - * | | |2.Detect inductor fail. - * | | |Read: - * | | |0 = No main voltage regulator type change error. - * | | |1 = Main voltage regulator type change to DCDC error occurred. - * | | |Write: - * | | |0 = No effect. - * | | |1 = Clears MVRCERR to 0. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |LCONS |Inductor for DC-DC Connect Status (Read Only) - * | | |0 = Inductor connect between Vsw and LDO_CAP pin. - * | | |This bit is valid when current main voltage regulator type is DCDC (CURMVRS (SYS_PLSTS[12])=1). - * | | |If current main voltage regulator type is LDO (CURMVRS (SYS_PLSTS[12])=0), this bit is set to 1. - * | | |0 = Inductor connect between Vsw and LDO_CAP pin. - * | | |1 = No Inductor connect between Vsw and LDO_CAP pin. - * | | |Note: This bit is 1 when main voltage regulator is LDO. - * |[9:8] |PLSTATUS |Power Level Status (Read Only) - * | | |This bit field reflect the current power level. - * | | |00 = Power level is PL0. Support system clock up to 96MHz. - * | | |01 = Power level is PL1. Support system clock up to 84MHz. - * | | |10 = Power level is PL2. Support system clock up to 48MHz. - * | | |11 = Power level is PL3. Support system clock up to 4MHz. - * |[12] |CURMVR |Current Main Voltage Regulator Type (Read Only) - * | | |This bit field reflects current main voltage regulator type. - * | | |0 = Current main voltage regulator in active and Idle mode is LDO. - * | | |1 = Current main voltage regulator in active and Idle mode is DCDC. - * @var SYS_T::AHBMCTL - * Offset: 0x400 AHB Bus Matrix Priority Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INTACTEN |Highest AHB Bus Priority of Cortex-M23 Core Enable Bit (Write Protect) - * | | |Enable Cortex-M23 core with highest AHB bus priority in AHB bus matrix. - * | | |0 = Run robin mode. - * | | |1 = Cortex-M23 CPU with highest bus priority when interrupt occurs. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - */ - - __I uint32_t PDID; /*!< [0x0000] Part Device Identification Number Register */ - __IO uint32_t RSTSTS; /*!< [0x0004] System Reset Status Register */ - __IO uint32_t IPRST0; /*!< [0x0008] Peripheral Reset Control Register 0 */ - __IO uint32_t IPRST1; /*!< [0x000c] Peripheral Reset Control Register 1 */ - __IO uint32_t IPRST2; /*!< [0x0010] Peripheral Reset Control Register 2 */ - __I uint32_t RESERVE0[1]; - __IO uint32_t BODCTL; /*!< [0x0018] Brown-out Detector Control Register */ - __IO uint32_t IVSCTL; /*!< [0x001c] Internal Voltage Source Control Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t PORCTL0; /*!< [0x0024] Power-on Reset Controller Register 0 */ - __IO uint32_t VREFCTL; /*!< [0x0028] VREF Control Register */ - __IO uint32_t USBPHY; /*!< [0x002C] USB PHY Control Register */ - __IO uint32_t GPA_MFPL; /*!< [0x0030] GPIOA Low Byte Multiple Function Control Register */ - __IO uint32_t GPA_MFPH; /*!< [0x0034] GPIOA High Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPL; /*!< [0x0038] GPIOB Low Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPH; /*!< [0x003c] GPIOB High Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPL; /*!< [0x0040] GPIOC Low Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPH; /*!< [0x0044] GPIOC High Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPL; /*!< [0x0048] GPIOD Low Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPH; /*!< [0x004c] GPIOD High Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPL; /*!< [0x0050] GPIOE Low Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPH; /*!< [0x0054] GPIOE High Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPL; /*!< [0x0058] GPIOF Low Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPH; /*!< [0x005C] GPIOF High Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPL; /*!< [0x0060] GPIOG Low Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPH; /*!< [0x0064] GPIOG High Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPL; /*!< [0x0068] GPIOH Low Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPH; /*!< [0x006C] GPIOH High Byte Multiple Function Control Register */ - __I uint32_t RESERVE2[4]; - __IO uint32_t GPA_MFOS; /*!< [0x0080] GPIOA Multiple Function Output Select Register */ - __IO uint32_t GPB_MFOS; /*!< [0x0084] GPIOB Multiple Function Output Select Register */ - __IO uint32_t GPC_MFOS; /*!< [0x0088] GPIOC Multiple Function Output Select Register */ - __IO uint32_t GPD_MFOS; /*!< [0x008c] GPIOD Multiple Function Output Select Register */ - __IO uint32_t GPE_MFOS; /*!< [0x0090] GPIOE Multiple Function Output Select Register */ - __IO uint32_t GPF_MFOS; /*!< [0x0094] GPIOF Multiple Function Output Select Register */ - __IO uint32_t GPG_MFOS; /*!< [0x0098] GPIOG Multiple Function Output Select Register */ - __IO uint32_t GPH_MFOS; /*!< [0x009c] GPIOH Multiple Function Output Select Register */ - __IO uint32_t VTORSET; /*!< [0x00A0] VTOR Setting Register */ - __I uint32_t RESERVE3[7]; - __IO uint32_t SRAMICTL; /*!< [0x00C0] System SRAM Interrupt Enable Control Register */ - __I uint32_t SRAMSTS; /*!< [0x00C4] System SRAM Parity Error Status Register */ - __I uint32_t SRAMEADR; /*!< [0x00C8] System SRAM Parity Check Error Address Register */ - __IO uint32_t RESERVE4[4]; - __IO uint32_t SRAMPC0; /*!< [0x00DC] SRAM Power Mode Control Register 0 */ - __IO uint32_t SRAMPC1; /*!< [0x00E0] SRAM Power Mode Control Register 1 */ - __IO uint32_t TCTL48M; /*!< [0x00E4] HIRC 48M Trim Control Register */ - __IO uint32_t TIEN48M; /*!< [0x00E8] HIRC 48M Trim Interrupt Enable Register */ - __IO uint32_t TISTS48M; /*!< [0x00EC] HIRC 48M Trim Interrupt Status Register */ - __IO uint32_t TCTL12M; /*!< [0x00F0] HIRC 12M Trim Control Register */ - __IO uint32_t TIEN12M; /*!< [0x00F4] HIRC 12M Trim Interrupt Enable Register */ - __IO uint32_t TISTS12M; /*!< [0x00F8] HIRC 12M Trim Interrupt Status Register */ - __I uint32_t RESERVE6[1]; - __IO uint32_t REGLCTL; /*!< [0x0100] Register Lock Control Register */ - __I uint32_t RESERVE7[53]; - __IO uint32_t CPUCFG; /*!< [0x01D8] CPU General Configuration Register */ - __IO uint32_t BATLDCTL; /*!< [0x01DC] Battery Loss Detector Control Register */ - __IO uint32_t OVDCTL; /*!< [0x01E0] Over Voltage Detector Control Register */ - __I uint32_t RESERVE8[2]; - __IO uint32_t PORCTL1; /*!< [0x01EC] Power-on Reset Controller Register 1 */ - __I uint32_t RESERVE9[1]; - __IO uint32_t PSWCTL; /*!< [0x01F4] Power Switch Control Register */ - __IO uint32_t PLCTL; /*!< [0x01F8] Power Level Control Register */ - __IO uint32_t PLSTS; /*!< [0x01FC] Power Level Status Register */ - __I uint32_t RESERVE10[128]; - __IO uint32_t AHBMCTL; /*!< [0x0400] AHB Bus Matrix Priority Control Register */ - - -} SYS_T; - -/** - @addtogroup SYS_CONST SYS Bit Field Definition - Constant Definitions for SYS Controller - @{ -*/ - -#define SYS_PDID_PDID_Pos (0) /*!< SYS_T::PDID: PDID Position */ -#define SYS_PDID_PDID_Msk (0xfffffffful << SYS_PDID_PDID_Pos) /*!< SYS_T::PDID: PDID Mask */ - -#define SYS_RSTSTS_PORF_Pos (0) /*!< SYS_T::RSTSTS: PORF Position */ -#define SYS_RSTSTS_PORF_Msk (0x1ul << SYS_RSTSTS_PORF_Pos) /*!< SYS_T::RSTSTS: PORF Mask */ - -#define SYS_RSTSTS_PINRF_Pos (1) /*!< SYS_T::RSTSTS: PINRF Position */ -#define SYS_RSTSTS_PINRF_Msk (0x1ul << SYS_RSTSTS_PINRF_Pos) /*!< SYS_T::RSTSTS: PINRF Mask */ - -#define SYS_RSTSTS_WDTRF_Pos (2) /*!< SYS_T::RSTSTS: WDTRF Position */ -#define SYS_RSTSTS_WDTRF_Msk (0x1ul << SYS_RSTSTS_WDTRF_Pos) /*!< SYS_T::RSTSTS: WDTRF Mask */ - -#define SYS_RSTSTS_LVRF_Pos (3) /*!< SYS_T::RSTSTS: LVRF Position */ -#define SYS_RSTSTS_LVRF_Msk (0x1ul << SYS_RSTSTS_LVRF_Pos) /*!< SYS_T::RSTSTS: LVRF Mask */ - -#define SYS_RSTSTS_BODRF_Pos (4) /*!< SYS_T::RSTSTS: BODRF Position */ -#define SYS_RSTSTS_BODRF_Msk (0x1ul << SYS_RSTSTS_BODRF_Pos) /*!< SYS_T::RSTSTS: BODRF Mask */ - -#define SYS_RSTSTS_SYSRF_Pos (5) /*!< SYS_T::RSTSTS: SYSRF Position */ -#define SYS_RSTSTS_SYSRF_Msk (0x1ul << SYS_RSTSTS_SYSRF_Pos) /*!< SYS_T::RSTSTS: SYSRF Mask */ - -#define SYS_RSTSTS_CPURF_Pos (7) /*!< SYS_T::RSTSTS: CPURF Position */ -#define SYS_RSTSTS_CPURF_Msk (0x1ul << SYS_RSTSTS_CPURF_Pos) /*!< SYS_T::RSTSTS: CPURF Mask */ - -#define SYS_RSTSTS_CPULKRF_Pos (8) /*!< SYS_T::RSTSTS: CPULKRF Position */ -#define SYS_RSTSTS_CPULKRF_Msk (0x1ul << SYS_RSTSTS_CPULKRF_Pos) /*!< SYS_T::RSTSTS: CPULKRF Mask */ - -#define SYS_IPRST0_CHIPRST_Pos (0) /*!< SYS_T::IPRST0: CHIPRST Position */ -#define SYS_IPRST0_CHIPRST_Msk (0x1ul << SYS_IPRST0_CHIPRST_Pos) /*!< SYS_T::IPRST0: CHIPRST Mask */ - -#define SYS_IPRST0_CPURST_Pos (1) /*!< SYS_T::IPRST0: CPURST Position */ -#define SYS_IPRST0_CPURST_Msk (0x1ul << SYS_IPRST0_CPURST_Pos) /*!< SYS_T::IPRST0: CPURST Mask */ - -#define SYS_IPRST0_PDMA0RST_Pos (2) /*!< SYS_T::IPRST0: PDMA0RST Position */ -#define SYS_IPRST0_PDMA0RST_Msk (0x1ul << SYS_IPRST0_PDMA0RST_Pos) /*!< SYS_T::IPRST0: PDMA0RST Mask */ - -#define SYS_IPRST0_EBIRST_Pos (3) /*!< SYS_T::IPRST0: EBIRST Position */ -#define SYS_IPRST0_EBIRST_Msk (0x1ul << SYS_IPRST0_EBIRST_Pos) /*!< SYS_T::IPRST0: EBIRST Mask */ - -#define SYS_IPRST0_USBHRST_Pos (4) /*!< SYS_T::IPRST0: USBHRST Position */ -#define SYS_IPRST0_USBHRST_Msk (0x1ul << SYS_IPRST0_USBHRST_Pos) /*!< SYS_T::IPRST0: USBHRST Mask */ - -#define SYS_IPRST0_SDH0RST_Pos (6) /*!< SYS_T::IPRST0: SDH0RST Position */ -#define SYS_IPRST0_SDH0RST_Msk (0x1ul << SYS_IPRST0_SDH0RST_Pos) /*!< SYS_T::IPRST0: SDH0RST Mask */ - -#define SYS_IPRST0_CRCRST_Pos (7) /*!< SYS_T::IPRST0: CRCRST Position */ -#define SYS_IPRST0_CRCRST_Msk (0x1ul << SYS_IPRST0_CRCRST_Pos) /*!< SYS_T::IPRST0: CRCRST Mask */ - -#define SYS_IPRST0_CRPTRST_Pos (12) /*!< SYS_T::IPRST0: CRPTRST Position */ -#define SYS_IPRST0_CRPTRST_Msk (0x1ul << SYS_IPRST0_CRPTRST_Pos) /*!< SYS_T::IPRST0: CRPTRST Mask */ - -#define SYS_IPRST0_KSRST_Pos (13) /*!< SYS_T::IPRST0: KSRST Position */ -#define SYS_IPRST0_KSRST_Msk (0x1ul << SYS_IPRST0_KSRST_Pos) /*!< SYS_T::IPRST0: KSRST Mask */ - -#define SYS_IPRST0_PDMA1RST_Pos (29) /*!< SYS_T::IPRST0: PDMA1RST Position */ -#define SYS_IPRST0_PDMA1RST_Msk (0x1ul << SYS_IPRST0_PDMA1RST_Pos) /*!< SYS_T::IPRST0: PDMA1RST Mask */ - -#define SYS_IPRST1_GPIORST_Pos (1) /*!< SYS_T::IPRST1: GPIORST Position */ -#define SYS_IPRST1_GPIORST_Msk (0x1ul << SYS_IPRST1_GPIORST_Pos) /*!< SYS_T::IPRST1: GPIORST Mask */ - -#define SYS_IPRST1_TMR0RST_Pos (2) /*!< SYS_T::IPRST1: TMR0RST Position */ -#define SYS_IPRST1_TMR0RST_Msk (0x1ul << SYS_IPRST1_TMR0RST_Pos) /*!< SYS_T::IPRST1: TMR0RST Mask */ - -#define SYS_IPRST1_TMR1RST_Pos (3) /*!< SYS_T::IPRST1: TMR1RST Position */ -#define SYS_IPRST1_TMR1RST_Msk (0x1ul << SYS_IPRST1_TMR1RST_Pos) /*!< SYS_T::IPRST1: TMR1RST Mask */ - -#define SYS_IPRST1_TMR2RST_Pos (4) /*!< SYS_T::IPRST1: TMR2RST Position */ -#define SYS_IPRST1_TMR2RST_Msk (0x1ul << SYS_IPRST1_TMR2RST_Pos) /*!< SYS_T::IPRST1: TMR2RST Mask */ - -#define SYS_IPRST1_TMR3RST_Pos (5) /*!< SYS_T::IPRST1: TMR3RST Position */ -#define SYS_IPRST1_TMR3RST_Msk (0x1ul << SYS_IPRST1_TMR3RST_Pos) /*!< SYS_T::IPRST1: TMR3RST Mask */ - -#define SYS_IPRST1_ACMP01RST_Pos (7) /*!< SYS_T::IPRST1: ACMP01RST Position */ -#define SYS_IPRST1_ACMP01RST_Msk (0x1ul << SYS_IPRST1_ACMP01RST_Pos) /*!< SYS_T::IPRST1: ACMP01RST Mask */ - -#define SYS_IPRST1_I2C0RST_Pos (8) /*!< SYS_T::IPRST1: I2C0RST Position */ -#define SYS_IPRST1_I2C0RST_Msk (0x1ul << SYS_IPRST1_I2C0RST_Pos) /*!< SYS_T::IPRST1: I2C0RST Mask */ - -#define SYS_IPRST1_I2C1RST_Pos (9) /*!< SYS_T::IPRST1: I2C1RST Position */ -#define SYS_IPRST1_I2C1RST_Msk (0x1ul << SYS_IPRST1_I2C1RST_Pos) /*!< SYS_T::IPRST1: I2C1RST Mask */ - -#define SYS_IPRST1_I2C2RST_Pos (10) /*!< SYS_T::IPRST1: I2C2RST Position */ -#define SYS_IPRST1_I2C2RST_Msk (0x1ul << SYS_IPRST1_I2C2RST_Pos) /*!< SYS_T::IPRST1: I2C2RST Mask */ - -#define SYS_IPRST1_QSPI0RST_Pos (12) /*!< SYS_T::IPRST1: QSPI0RST Position */ -#define SYS_IPRST1_QSPI0RST_Msk (0x1ul << SYS_IPRST1_QSPI0RST_Pos) /*!< SYS_T::IPRST1: QSPI0RST Mask */ - -#define SYS_IPRST1_SPI0RST_Pos (13) /*!< SYS_T::IPRST1: SPI0RST Position */ -#define SYS_IPRST1_SPI0RST_Msk (0x1ul << SYS_IPRST1_SPI0RST_Pos) /*!< SYS_T::IPRST1: SPI0RST Mask */ - -#define SYS_IPRST1_SPI1RST_Pos (14) /*!< SYS_T::IPRST1: SPI1RST Position */ -#define SYS_IPRST1_SPI1RST_Msk (0x1ul << SYS_IPRST1_SPI1RST_Pos) /*!< SYS_T::IPRST1: SPI1RST Mask */ - -#define SYS_IPRST1_SPI2RST_Pos (15) /*!< SYS_T::IPRST1: SPI2RST Position */ -#define SYS_IPRST1_SPI2RST_Msk (0x1ul << SYS_IPRST1_SPI2RST_Pos) /*!< SYS_T::IPRST1: SPI2RST Mask */ - -#define SYS_IPRST1_UART0RST_Pos (16) /*!< SYS_T::IPRST1: UART0RST Position */ -#define SYS_IPRST1_UART0RST_Msk (0x1ul << SYS_IPRST1_UART0RST_Pos) /*!< SYS_T::IPRST1: UART0RST Mask */ - -#define SYS_IPRST1_UART1RST_Pos (17) /*!< SYS_T::IPRST1: UART1RST Position */ -#define SYS_IPRST1_UART1RST_Msk (0x1ul << SYS_IPRST1_UART1RST_Pos) /*!< SYS_T::IPRST1: UART1RST Mask */ - -#define SYS_IPRST1_UART2RST_Pos (18) /*!< SYS_T::IPRST1: UART2RST Position */ -#define SYS_IPRST1_UART2RST_Msk (0x1ul << SYS_IPRST1_UART2RST_Pos) /*!< SYS_T::IPRST1: UART2RST Mask */ - -#define SYS_IPRST1_UART3RST_Pos (19) /*!< SYS_T::IPRST1: UART3RST Position */ -#define SYS_IPRST1_UART3RST_Msk (0x1ul << SYS_IPRST1_UART3RST_Pos) /*!< SYS_T::IPRST1: UART3RST Mask */ - -#define SYS_IPRST1_UART4RST_Pos (20) /*!< SYS_T::IPRST1: UART4RST Position */ -#define SYS_IPRST1_UART4RST_Msk (0x1ul << SYS_IPRST1_UART4RST_Pos) /*!< SYS_T::IPRST1: UART4RST Mask */ - -#define SYS_IPRST1_UART5RST_Pos (21) /*!< SYS_T::IPRST1: UART5RST Position */ -#define SYS_IPRST1_UART5RST_Msk (0x1ul << SYS_IPRST1_UART5RST_Pos) /*!< SYS_T::IPRST1: UART5RST Mask */ - -#define SYS_IPRST1_CAN0RST_Pos (24) /*!< SYS_T::IPRST1: CAN0RST Position */ -#define SYS_IPRST1_CAN0RST_Msk (0x1ul << SYS_IPRST1_CAN0RST_Pos) /*!< SYS_T::IPRST1: CAN0RST Mask */ - -#define SYS_IPRST1_OTGRST_Pos (26) /*!< SYS_T::IPRST1: OTGRST Position */ -#define SYS_IPRST1_OTGRST_Msk (0x1ul << SYS_IPRST1_OTGRST_Pos) /*!< SYS_T::IPRST1: OTGRST Mask */ - -#define SYS_IPRST1_USBDRST_Pos (27) /*!< SYS_T::IPRST1: USBDRST Position */ -#define SYS_IPRST1_USBDRST_Msk (0x1ul << SYS_IPRST1_USBDRST_Pos) /*!< SYS_T::IPRST1: USBDRST Mask */ - -#define SYS_IPRST1_EADCRST_Pos (28) /*!< SYS_T::IPRST1: EADCRST Position */ -#define SYS_IPRST1_EADCRST_Msk (0x1ul << SYS_IPRST1_EADCRST_Pos) /*!< SYS_T::IPRST1: EADCRST Mask */ - -#define SYS_IPRST1_I2S0RST_Pos (29) /*!< SYS_T::IPRST1: I2S0RST Position */ -#define SYS_IPRST1_I2S0RST_Msk (0x1ul << SYS_IPRST1_I2S0RST_Pos) /*!< SYS_T::IPRST1: I2S0RST Mask */ - -#define SYS_IPRST1_LCDRST_Pos (30) /*!< SYS_T::IPRST1: LCDRST Position */ -#define SYS_IPRST1_LCDRST_Msk (0x1ul << SYS_IPRST1_LCDRST_Pos) /*!< SYS_T::IPRST1: LCDRST Mask */ - -#define SYS_IPRST1_TRNGRST_Pos (31) /*!< SYS_T::IPRST1: TRNGRST Position */ -#define SYS_IPRST1_TRNGRST_Msk (0x1ul << SYS_IPRST1_TRNGRST_Pos) /*!< SYS_T::IPRST1: TRNGRST Mask */ - -#define SYS_IPRST2_SC0RST_Pos (0) /*!< SYS_T::IPRST2: SC0RST Position */ -#define SYS_IPRST2_SC0RST_Msk (0x1ul << SYS_IPRST2_SC0RST_Pos) /*!< SYS_T::IPRST2: SC0RST Mask */ - -#define SYS_IPRST2_SC1RST_Pos (1) /*!< SYS_T::IPRST2: SC1RST Position */ -#define SYS_IPRST2_SC1RST_Msk (0x1ul << SYS_IPRST2_SC1RST_Pos) /*!< SYS_T::IPRST2: SC1RST Mask */ - -#define SYS_IPRST2_SC2RST_Pos (2) /*!< SYS_T::IPRST2: SC2RST Position */ -#define SYS_IPRST2_SC2RST_Msk (0x1ul << SYS_IPRST2_SC2RST_Pos) /*!< SYS_T::IPRST2: SC2RST Mask */ - -#define SYS_IPRST2_SPI3RST_Pos (6) /*!< SYS_T::IPRST2: SPI3RST Position */ -#define SYS_IPRST2_SPI3RST_Msk (0x1ul << SYS_IPRST2_SPI3RST_Pos) /*!< SYS_T::IPRST2: SPI3RST Mask */ - -#define SYS_IPRST2_USCI0RST_Pos (8) /*!< SYS_T::IPRST2: USCI0RST Position */ -#define SYS_IPRST2_USCI0RST_Msk (0x1ul << SYS_IPRST2_USCI0RST_Pos) /*!< SYS_T::IPRST2: USCI0RST Mask */ - -#define SYS_IPRST2_USCI1RST_Pos (9) /*!< SYS_T::IPRST2: USCI1RST Position */ -#define SYS_IPRST2_USCI1RST_Msk (0x1ul << SYS_IPRST2_USCI1RST_Pos) /*!< SYS_T::IPRST2: USCI1RST Mask */ - -#define SYS_IPRST2_DACRST_Pos (12) /*!< SYS_T::IPRST2: DACRST Position */ -#define SYS_IPRST2_DACRST_Msk (0x1ul << SYS_IPRST2_DACRST_Pos) /*!< SYS_T::IPRST2: DACRST Mask */ - -#define SYS_IPRST2_EPWM0RST_Pos (16) /*!< SYS_T::IPRST2: EPWM0RST Position */ -#define SYS_IPRST2_EPWM0RST_Msk (0x1ul << SYS_IPRST2_EPWM0RST_Pos) /*!< SYS_T::IPRST2: EPWM0RST Mask */ - -#define SYS_IPRST2_EPWM1RST_Pos (17) /*!< SYS_T::IPRST2: EPWM1RST Position */ -#define SYS_IPRST2_EPWM1RST_Msk (0x1ul << SYS_IPRST2_EPWM1RST_Pos) /*!< SYS_T::IPRST2: EPWM1RST Mask */ - -#define SYS_IPRST2_BPWM0RST_Pos (18) /*!< SYS_T::IPRST2: BPWM0RST Position */ -#define SYS_IPRST2_BPWM0RST_Msk (0x1ul << SYS_IPRST2_BPWM0RST_Pos) /*!< SYS_T::IPRST2: BPWM0RST Mask */ - -#define SYS_IPRST2_BPWM1RST_Pos (19) /*!< SYS_T::IPRST2: BPWM1RST Position */ -#define SYS_IPRST2_BPWM1RST_Msk (0x1ul << SYS_IPRST2_BPWM1RST_Pos) /*!< SYS_T::IPRST2: BPWM1RST Mask */ - -#define SYS_IPRST2_TMR4RST_Pos (20) /*!< SYS_T::IPRST2: TMR4RST Position */ -#define SYS_IPRST2_TMR4RST_Msk (0x1ul << SYS_IPRST2_TMR4RST_Pos) /*!< SYS_T::IPRST2: TMR4RST Mask */ - -#define SYS_IPRST2_TMR5RST_Pos (21) /*!< SYS_T::IPRST2: TMR5RST Position */ -#define SYS_IPRST2_TMR5RST_Msk (0x1ul << SYS_IPRST2_TMR5RST_Pos) /*!< SYS_T::IPRST2: TMR5RST Mask */ - -#define SYS_IPRST2_QEI0RST_Pos (22) /*!< SYS_T::IPRST2: QEI0RST Position */ -#define SYS_IPRST2_QEI0RST_Msk (0x1ul << SYS_IPRST2_QEI0RST_Pos) /*!< SYS_T::IPRST2: QEI0RST Mask */ - -#define SYS_IPRST2_QEI1RST_Pos (23) /*!< SYS_T::IPRST2: QEI1RST Position */ -#define SYS_IPRST2_QEI1RST_Msk (0x1ul << SYS_IPRST2_QEI1RST_Pos) /*!< SYS_T::IPRST2: QEI1RST Mask */ - -#define SYS_IPRST2_ECAP0RST_Pos (26) /*!< SYS_T::IPRST2: ECAP0RST Position */ -#define SYS_IPRST2_ECAP0RST_Msk (0x1ul << SYS_IPRST2_ECAP0RST_Pos) /*!< SYS_T::IPRST2: ECAP0RST Mask */ - -#define SYS_IPRST2_ECAP1RST_Pos (27) /*!< SYS_T::IPRST2: ECAP1RST Position */ -#define SYS_IPRST2_ECAP1RST_Msk (0x1ul << SYS_IPRST2_ECAP1RST_Pos) /*!< SYS_T::IPRST2: ECAP1RST Mask */ - -#define SYS_BODCTL_BODEN_Pos (0) /*!< SYS_T::BODCTL: BODEN Position */ -#define SYS_BODCTL_BODEN_Msk (0x1ul << SYS_BODCTL_BODEN_Pos) /*!< SYS_T::BODCTL: BODEN Mask */ - -#define SYS_BODCTL_BODRSTEN_Pos (3) /*!< SYS_T::BODCTL: BODRSTEN Position */ -#define SYS_BODCTL_BODRSTEN_Msk (0x1ul << SYS_BODCTL_BODRSTEN_Pos) /*!< SYS_T::BODCTL: BODRSTEN Mask */ - -#define SYS_BODCTL_BODIF_Pos (4) /*!< SYS_T::BODCTL: BODIF Position */ -#define SYS_BODCTL_BODIF_Msk (0x1ul << SYS_BODCTL_BODIF_Pos) /*!< SYS_T::BODCTL: BODIF Mask */ - -#define SYS_BODCTL_BODOUT_Pos (6) /*!< SYS_T::BODCTL: BODOUT Position */ -#define SYS_BODCTL_BODOUT_Msk (0x1ul << SYS_BODCTL_BODOUT_Pos) /*!< SYS_T::BODCTL: BODOUT Mask */ - -#define SYS_BODCTL_LVREN_Pos (7) /*!< SYS_T::BODCTL: LVREN Position */ -#define SYS_BODCTL_LVREN_Msk (0x1ul << SYS_BODCTL_LVREN_Pos) /*!< SYS_T::BODCTL: LVREN Mask */ - -#define SYS_BODCTL_BODDGSEL_Pos (8) /*!< SYS_T::BODCTL: BODDGSEL Position */ -#define SYS_BODCTL_BODDGSEL_Msk (0x7ul << SYS_BODCTL_BODDGSEL_Pos) /*!< SYS_T::BODCTL: BODDGSEL Mask */ - -#define SYS_BODCTL_LVRDGSEL_Pos (12) /*!< SYS_T::BODCTL: LVRDGSEL Position */ -#define SYS_BODCTL_LVRDGSEL_Msk (0x7ul << SYS_BODCTL_LVRDGSEL_Pos) /*!< SYS_T::BODCTL: LVRDGSEL Mask */ - -#define SYS_BODCTL_BODVL_Pos (16) /*!< SYS_T::BODCTL: BODVL Position */ -#define SYS_BODCTL_BODVL_Msk (0x7ul << SYS_BODCTL_BODVL_Pos) /*!< SYS_T::BODCTL: BODVL Mask */ - -#define SYS_BODCTL_STB_Pos (23) /*!< SYS_T::BODCTL: STB Position */ -#define SYS_BODCTL_STB_Msk (0x1ul << SYS_BODCTL_STB_Pos) /*!< SYS_T::BODCTL: STB Mask */ - -#define SYS_BODCTL_WRBUSY_Pos (31) /*!< SYS_T::BODCTL: WRBUSY Position */ -#define SYS_BODCTL_WRBUSY_Msk (0x1ul << SYS_BODCTL_WRBUSY_Pos) /*!< SYS_T::BODCTL: WRBUSY Mask */ - -#define SYS_IVSCTL_VTEMPEN_Pos (0) /*!< SYS_T::IVSCTL: VTEMPEN Position */ -#define SYS_IVSCTL_VTEMPEN_Msk (0x1ul << SYS_IVSCTL_VTEMPEN_Pos) /*!< SYS_T::IVSCTL: VTEMPEN Mask */ - -#define SYS_IVSCTL_VBATUGEN_Pos (1) /*!< SYS_T::IVSCTL: VBATUGEN Position */ -#define SYS_IVSCTL_VBATUGEN_Msk (0x1ul << SYS_IVSCTL_VBATUGEN_Pos) /*!< SYS_T::IVSCTL: VBATUGEN Mask */ - -#define SYS_PORCTL0_PORMASK_Pos (0) /*!< SYS_T::PORCTL0: PORMASK Position */ -#define SYS_PORCTL0_PORMASK_Msk (0xfffful << SYS_PORCTL0_PORMASK_Pos) /*!< SYS_T::PORCTL0: PORMASK Mask */ - -#define SYS_VREFCTL_VREFCTL_Pos (0) /*!< SYS_T::VREFCTL: VREFCTL Position */ -#define SYS_VREFCTL_VREFCTL_Msk (0x1ful << SYS_VREFCTL_VREFCTL_Pos) /*!< SYS_T::VREFCTL: VREFCTL Mask */ - -#define SYS_VREFCTL_IBIASSEL_Pos (5) /*!< SYS_T::VREFCTL: IBIASSEL Position */ -#define SYS_VREFCTL_IBIASSEL_Msk (0x1ul << SYS_VREFCTL_IBIASSEL_Pos) /*!< SYS_T::VREFCTL: IBIASSEL Mask */ - -#define SYS_VREFCTL_PRELOADSEL_Pos (6) /*!< SYS_T::VREFCTL: PRELOADSEL Position */ -#define SYS_VREFCTL_PRELOADSEL_Msk (0x3ul << SYS_VREFCTL_PRELOADSEL_Pos) /*!< SYS_T::VREFCTL: PRELOADSEL Mask */ - -#define SYS_USBPHY_USBROLE_Pos (0) /*!< SYS_T::USBPHY: USBROLE Position */ -#define SYS_USBPHY_USBROLE_Msk (0x3ul << SYS_USBPHY_USBROLE_Pos) /*!< SYS_T::USBPHY: USBROLE Mask */ - -#define SYS_USBPHY_SBO_Pos (2) /*!< SYS_T::USBPHY: SBO Position */ -#define SYS_USBPHY_SBO_Msk (0x1ul << SYS_USBPHY_SBO_Pos) /*!< SYS_T::USBPHY: SBO Mask */ - -#define SYS_USBPHY_OTGPHYEN_Pos (8) /*!< SYS_T::USBPHY: OTGPHYEN Position */ -#define SYS_USBPHY_OTGPHYEN_Msk (0x1ul << SYS_USBPHY_OTGPHYEN_Pos) /*!< SYS_T::USBPHY: OTGPHYEN Mask */ - -#define SYS_GPA_MFPL_PA0MFP_Pos (0) /*!< SYS_T::GPA_MFPL: PA0MFP Position */ -#define SYS_GPA_MFPL_PA0MFP_Msk (0xful << SYS_GPA_MFPL_PA0MFP_Pos) /*!< SYS_T::GPA_MFPL: PA0MFP Mask */ - -#define SYS_GPA_MFPL_PA1MFP_Pos (4) /*!< SYS_T::GPA_MFPL: PA1MFP Position */ -#define SYS_GPA_MFPL_PA1MFP_Msk (0xful << SYS_GPA_MFPL_PA1MFP_Pos) /*!< SYS_T::GPA_MFPL: PA1MFP Mask */ - -#define SYS_GPA_MFPL_PA2MFP_Pos (8) /*!< SYS_T::GPA_MFPL: PA2MFP Position */ -#define SYS_GPA_MFPL_PA2MFP_Msk (0xful << SYS_GPA_MFPL_PA2MFP_Pos) /*!< SYS_T::GPA_MFPL: PA2MFP Mask */ - -#define SYS_GPA_MFPL_PA3MFP_Pos (12) /*!< SYS_T::GPA_MFPL: PA3MFP Position */ -#define SYS_GPA_MFPL_PA3MFP_Msk (0xful << SYS_GPA_MFPL_PA3MFP_Pos) /*!< SYS_T::GPA_MFPL: PA3MFP Mask */ - -#define SYS_GPA_MFPL_PA4MFP_Pos (16) /*!< SYS_T::GPA_MFPL: PA4MFP Position */ -#define SYS_GPA_MFPL_PA4MFP_Msk (0xful << SYS_GPA_MFPL_PA4MFP_Pos) /*!< SYS_T::GPA_MFPL: PA4MFP Mask */ - -#define SYS_GPA_MFPL_PA5MFP_Pos (20) /*!< SYS_T::GPA_MFPL: PA5MFP Position */ -#define SYS_GPA_MFPL_PA5MFP_Msk (0xful << SYS_GPA_MFPL_PA5MFP_Pos) /*!< SYS_T::GPA_MFPL: PA5MFP Mask */ - -#define SYS_GPA_MFPL_PA6MFP_Pos (24) /*!< SYS_T::GPA_MFPL: PA6MFP Position */ -#define SYS_GPA_MFPL_PA6MFP_Msk (0xful << SYS_GPA_MFPL_PA6MFP_Pos) /*!< SYS_T::GPA_MFPL: PA6MFP Mask */ - -#define SYS_GPA_MFPL_PA7MFP_Pos (28) /*!< SYS_T::GPA_MFPL: PA7MFP Position */ -#define SYS_GPA_MFPL_PA7MFP_Msk (0xful << SYS_GPA_MFPL_PA7MFP_Pos) /*!< SYS_T::GPA_MFPL: PA7MFP Mask */ - -#define SYS_GPA_MFPH_PA8MFP_Pos (0) /*!< SYS_T::GPA_MFPH: PA8MFP Position */ -#define SYS_GPA_MFPH_PA8MFP_Msk (0xful << SYS_GPA_MFPH_PA8MFP_Pos) /*!< SYS_T::GPA_MFPH: PA8MFP Mask */ - -#define SYS_GPA_MFPH_PA9MFP_Pos (4) /*!< SYS_T::GPA_MFPH: PA9MFP Position */ -#define SYS_GPA_MFPH_PA9MFP_Msk (0xful << SYS_GPA_MFPH_PA9MFP_Pos) /*!< SYS_T::GPA_MFPH: PA9MFP Mask */ - -#define SYS_GPA_MFPH_PA10MFP_Pos (8) /*!< SYS_T::GPA_MFPH: PA10MFP Position */ -#define SYS_GPA_MFPH_PA10MFP_Msk (0xful << SYS_GPA_MFPH_PA10MFP_Pos) /*!< SYS_T::GPA_MFPH: PA10MFP Mask */ - -#define SYS_GPA_MFPH_PA11MFP_Pos (12) /*!< SYS_T::GPA_MFPH: PA11MFP Position */ -#define SYS_GPA_MFPH_PA11MFP_Msk (0xful << SYS_GPA_MFPH_PA11MFP_Pos) /*!< SYS_T::GPA_MFPH: PA11MFP Mask */ - -#define SYS_GPA_MFPH_PA12MFP_Pos (16) /*!< SYS_T::GPA_MFPH: PA12MFP Position */ -#define SYS_GPA_MFPH_PA12MFP_Msk (0xful << SYS_GPA_MFPH_PA12MFP_Pos) /*!< SYS_T::GPA_MFPH: PA12MFP Mask */ - -#define SYS_GPA_MFPH_PA13MFP_Pos (20) /*!< SYS_T::GPA_MFPH: PA13MFP Position */ -#define SYS_GPA_MFPH_PA13MFP_Msk (0xful << SYS_GPA_MFPH_PA13MFP_Pos) /*!< SYS_T::GPA_MFPH: PA13MFP Mask */ - -#define SYS_GPA_MFPH_PA14MFP_Pos (24) /*!< SYS_T::GPA_MFPH: PA14MFP Position */ -#define SYS_GPA_MFPH_PA14MFP_Msk (0xful << SYS_GPA_MFPH_PA14MFP_Pos) /*!< SYS_T::GPA_MFPH: PA14MFP Mask */ - -#define SYS_GPA_MFPH_PA15MFP_Pos (28) /*!< SYS_T::GPA_MFPH: PA15MFP Position */ -#define SYS_GPA_MFPH_PA15MFP_Msk (0xful << SYS_GPA_MFPH_PA15MFP_Pos) /*!< SYS_T::GPA_MFPH: PA15MFP Mask */ - -#define SYS_GPB_MFPL_PB0MFP_Pos (0) /*!< SYS_T::GPB_MFPL: PB0MFP Position */ -#define SYS_GPB_MFPL_PB0MFP_Msk (0xful << SYS_GPB_MFPL_PB0MFP_Pos) /*!< SYS_T::GPB_MFPL: PB0MFP Mask */ - -#define SYS_GPB_MFPL_PB1MFP_Pos (4) /*!< SYS_T::GPB_MFPL: PB1MFP Position */ -#define SYS_GPB_MFPL_PB1MFP_Msk (0xful << SYS_GPB_MFPL_PB1MFP_Pos) /*!< SYS_T::GPB_MFPL: PB1MFP Mask */ - -#define SYS_GPB_MFPL_PB2MFP_Pos (8) /*!< SYS_T::GPB_MFPL: PB2MFP Position */ -#define SYS_GPB_MFPL_PB2MFP_Msk (0xful << SYS_GPB_MFPL_PB2MFP_Pos) /*!< SYS_T::GPB_MFPL: PB2MFP Mask */ - -#define SYS_GPB_MFPL_PB3MFP_Pos (12) /*!< SYS_T::GPB_MFPL: PB3MFP Position */ -#define SYS_GPB_MFPL_PB3MFP_Msk (0xful << SYS_GPB_MFPL_PB3MFP_Pos) /*!< SYS_T::GPB_MFPL: PB3MFP Mask */ - -#define SYS_GPB_MFPL_PB4MFP_Pos (16) /*!< SYS_T::GPB_MFPL: PB4MFP Position */ -#define SYS_GPB_MFPL_PB4MFP_Msk (0xful << SYS_GPB_MFPL_PB4MFP_Pos) /*!< SYS_T::GPB_MFPL: PB4MFP Mask */ - -#define SYS_GPB_MFPL_PB5MFP_Pos (20) /*!< SYS_T::GPB_MFPL: PB5MFP Position */ -#define SYS_GPB_MFPL_PB5MFP_Msk (0xful << SYS_GPB_MFPL_PB5MFP_Pos) /*!< SYS_T::GPB_MFPL: PB5MFP Mask */ - -#define SYS_GPB_MFPL_PB6MFP_Pos (24) /*!< SYS_T::GPB_MFPL: PB6MFP Position */ -#define SYS_GPB_MFPL_PB6MFP_Msk (0xful << SYS_GPB_MFPL_PB6MFP_Pos) /*!< SYS_T::GPB_MFPL: PB6MFP Mask */ - -#define SYS_GPB_MFPL_PB7MFP_Pos (28) /*!< SYS_T::GPB_MFPL: PB7MFP Position */ -#define SYS_GPB_MFPL_PB7MFP_Msk (0xful << SYS_GPB_MFPL_PB7MFP_Pos) /*!< SYS_T::GPB_MFPL: PB7MFP Mask */ - -#define SYS_GPB_MFPH_PB8MFP_Pos (0) /*!< SYS_T::GPB_MFPH: PB8MFP Position */ -#define SYS_GPB_MFPH_PB8MFP_Msk (0xful << SYS_GPB_MFPH_PB8MFP_Pos) /*!< SYS_T::GPB_MFPH: PB8MFP Mask */ - -#define SYS_GPB_MFPH_PB9MFP_Pos (4) /*!< SYS_T::GPB_MFPH: PB9MFP Position */ -#define SYS_GPB_MFPH_PB9MFP_Msk (0xful << SYS_GPB_MFPH_PB9MFP_Pos) /*!< SYS_T::GPB_MFPH: PB9MFP Mask */ - -#define SYS_GPB_MFPH_PB10MFP_Pos (8) /*!< SYS_T::GPB_MFPH: PB10MFP Position */ -#define SYS_GPB_MFPH_PB10MFP_Msk (0xful << SYS_GPB_MFPH_PB10MFP_Pos) /*!< SYS_T::GPB_MFPH: PB10MFP Mask */ - -#define SYS_GPB_MFPH_PB11MFP_Pos (12) /*!< SYS_T::GPB_MFPH: PB11MFP Position */ -#define SYS_GPB_MFPH_PB11MFP_Msk (0xful << SYS_GPB_MFPH_PB11MFP_Pos) /*!< SYS_T::GPB_MFPH: PB11MFP Mask */ - -#define SYS_GPB_MFPH_PB12MFP_Pos (16) /*!< SYS_T::GPB_MFPH: PB12MFP Position */ -#define SYS_GPB_MFPH_PB12MFP_Msk (0xful << SYS_GPB_MFPH_PB12MFP_Pos) /*!< SYS_T::GPB_MFPH: PB12MFP Mask */ - -#define SYS_GPB_MFPH_PB13MFP_Pos (20) /*!< SYS_T::GPB_MFPH: PB13MFP Position */ -#define SYS_GPB_MFPH_PB13MFP_Msk (0xful << SYS_GPB_MFPH_PB13MFP_Pos) /*!< SYS_T::GPB_MFPH: PB13MFP Mask */ - -#define SYS_GPB_MFPH_PB14MFP_Pos (24) /*!< SYS_T::GPB_MFPH: PB14MFP Position */ -#define SYS_GPB_MFPH_PB14MFP_Msk (0xful << SYS_GPB_MFPH_PB14MFP_Pos) /*!< SYS_T::GPB_MFPH: PB14MFP Mask */ - -#define SYS_GPB_MFPH_PB15MFP_Pos (28) /*!< SYS_T::GPB_MFPH: PB15MFP Position */ -#define SYS_GPB_MFPH_PB15MFP_Msk (0xful << SYS_GPB_MFPH_PB15MFP_Pos) /*!< SYS_T::GPB_MFPH: PB15MFP Mask */ - -#define SYS_GPC_MFPL_PC0MFP_Pos (0) /*!< SYS_T::GPC_MFPL: PC0MFP Position */ -#define SYS_GPC_MFPL_PC0MFP_Msk (0xful << SYS_GPC_MFPL_PC0MFP_Pos) /*!< SYS_T::GPC_MFPL: PC0MFP Mask */ - -#define SYS_GPC_MFPL_PC1MFP_Pos (4) /*!< SYS_T::GPC_MFPL: PC1MFP Position */ -#define SYS_GPC_MFPL_PC1MFP_Msk (0xful << SYS_GPC_MFPL_PC1MFP_Pos) /*!< SYS_T::GPC_MFPL: PC1MFP Mask */ - -#define SYS_GPC_MFPL_PC2MFP_Pos (8) /*!< SYS_T::GPC_MFPL: PC2MFP Position */ -#define SYS_GPC_MFPL_PC2MFP_Msk (0xful << SYS_GPC_MFPL_PC2MFP_Pos) /*!< SYS_T::GPC_MFPL: PC2MFP Mask */ - -#define SYS_GPC_MFPL_PC3MFP_Pos (12) /*!< SYS_T::GPC_MFPL: PC3MFP Position */ -#define SYS_GPC_MFPL_PC3MFP_Msk (0xful << SYS_GPC_MFPL_PC3MFP_Pos) /*!< SYS_T::GPC_MFPL: PC3MFP Mask */ - -#define SYS_GPC_MFPL_PC4MFP_Pos (16) /*!< SYS_T::GPC_MFPL: PC4MFP Position */ -#define SYS_GPC_MFPL_PC4MFP_Msk (0xful << SYS_GPC_MFPL_PC4MFP_Pos) /*!< SYS_T::GPC_MFPL: PC4MFP Mask */ - -#define SYS_GPC_MFPL_PC5MFP_Pos (20) /*!< SYS_T::GPC_MFPL: PC5MFP Position */ -#define SYS_GPC_MFPL_PC5MFP_Msk (0xful << SYS_GPC_MFPL_PC5MFP_Pos) /*!< SYS_T::GPC_MFPL: PC5MFP Mask */ - -#define SYS_GPC_MFPL_PC6MFP_Pos (24) /*!< SYS_T::GPC_MFPL: PC6MFP Position */ -#define SYS_GPC_MFPL_PC6MFP_Msk (0xful << SYS_GPC_MFPL_PC6MFP_Pos) /*!< SYS_T::GPC_MFPL: PC6MFP Mask */ - -#define SYS_GPC_MFPL_PC7MFP_Pos (28) /*!< SYS_T::GPC_MFPL: PC7MFP Position */ -#define SYS_GPC_MFPL_PC7MFP_Msk (0xful << SYS_GPC_MFPL_PC7MFP_Pos) /*!< SYS_T::GPC_MFPL: PC7MFP Mask */ - -#define SYS_GPC_MFPH_PC8MFP_Pos (0) /*!< SYS_T::GPC_MFPH: PC8MFP Position */ -#define SYS_GPC_MFPH_PC8MFP_Msk (0xful << SYS_GPC_MFPH_PC8MFP_Pos) /*!< SYS_T::GPC_MFPH: PC8MFP Mask */ - -#define SYS_GPC_MFPH_PC9MFP_Pos (4) /*!< SYS_T::GPC_MFPH: PC9MFP Position */ -#define SYS_GPC_MFPH_PC9MFP_Msk (0xful << SYS_GPC_MFPH_PC9MFP_Pos) /*!< SYS_T::GPC_MFPH: PC9MFP Mask */ - -#define SYS_GPC_MFPH_PC10MFP_Pos (8) /*!< SYS_T::GPC_MFPH: PC10MFP Position */ -#define SYS_GPC_MFPH_PC10MFP_Msk (0xful << SYS_GPC_MFPH_PC10MFP_Pos) /*!< SYS_T::GPC_MFPH: PC10MFP Mask */ - -#define SYS_GPC_MFPH_PC11MFP_Pos (12) /*!< SYS_T::GPC_MFPH: PC11MFP Position */ -#define SYS_GPC_MFPH_PC11MFP_Msk (0xful << SYS_GPC_MFPH_PC11MFP_Pos) /*!< SYS_T::GPC_MFPH: PC11MFP Mask */ - -#define SYS_GPC_MFPH_PC12MFP_Pos (16) /*!< SYS_T::GPC_MFPH: PC12MFP Position */ -#define SYS_GPC_MFPH_PC12MFP_Msk (0xful << SYS_GPC_MFPH_PC12MFP_Pos) /*!< SYS_T::GPC_MFPH: PC12MFP Mask */ - -#define SYS_GPC_MFPH_PC13MFP_Pos (20) /*!< SYS_T::GPC_MFPH: PC13MFP Position */ -#define SYS_GPC_MFPH_PC13MFP_Msk (0xful << SYS_GPC_MFPH_PC13MFP_Pos) /*!< SYS_T::GPC_MFPH: PC13MFP Mask */ - -#define SYS_GPD_MFPL_PD0MFP_Pos (0) /*!< SYS_T::GPD_MFPL: PD0MFP Position */ -#define SYS_GPD_MFPL_PD0MFP_Msk (0xful << SYS_GPD_MFPL_PD0MFP_Pos) /*!< SYS_T::GPD_MFPL: PD0MFP Mask */ - -#define SYS_GPD_MFPL_PD1MFP_Pos (4) /*!< SYS_T::GPD_MFPL: PD1MFP Position */ -#define SYS_GPD_MFPL_PD1MFP_Msk (0xful << SYS_GPD_MFPL_PD1MFP_Pos) /*!< SYS_T::GPD_MFPL: PD1MFP Mask */ - -#define SYS_GPD_MFPL_PD2MFP_Pos (8) /*!< SYS_T::GPD_MFPL: PD2MFP Position */ -#define SYS_GPD_MFPL_PD2MFP_Msk (0xful << SYS_GPD_MFPL_PD2MFP_Pos) /*!< SYS_T::GPD_MFPL: PD2MFP Mask */ - -#define SYS_GPD_MFPL_PD3MFP_Pos (12) /*!< SYS_T::GPD_MFPL: PD3MFP Position */ -#define SYS_GPD_MFPL_PD3MFP_Msk (0xful << SYS_GPD_MFPL_PD3MFP_Pos) /*!< SYS_T::GPD_MFPL: PD3MFP Mask */ - -#define SYS_GPD_MFPL_PD4MFP_Pos (16) /*!< SYS_T::GPD_MFPL: PD4MFP Position */ -#define SYS_GPD_MFPL_PD4MFP_Msk (0xful << SYS_GPD_MFPL_PD4MFP_Pos) /*!< SYS_T::GPD_MFPL: PD4MFP Mask */ - -#define SYS_GPD_MFPL_PD5MFP_Pos (20) /*!< SYS_T::GPD_MFPL: PD5MFP Position */ -#define SYS_GPD_MFPL_PD5MFP_Msk (0xful << SYS_GPD_MFPL_PD5MFP_Pos) /*!< SYS_T::GPD_MFPL: PD5MFP Mask */ - -#define SYS_GPD_MFPL_PD6MFP_Pos (24) /*!< SYS_T::GPD_MFPL: PD6MFP Position */ -#define SYS_GPD_MFPL_PD6MFP_Msk (0xful << SYS_GPD_MFPL_PD6MFP_Pos) /*!< SYS_T::GPD_MFPL: PD6MFP Mask */ - -#define SYS_GPD_MFPL_PD7MFP_Pos (28) /*!< SYS_T::GPD_MFPL: PD7MFP Position */ -#define SYS_GPD_MFPL_PD7MFP_Msk (0xful << SYS_GPD_MFPL_PD7MFP_Pos) /*!< SYS_T::GPD_MFPL: PD7MFP Mask */ - -#define SYS_GPD_MFPH_PD8MFP_Pos (0) /*!< SYS_T::GPD_MFPH: PD8MFP Position */ -#define SYS_GPD_MFPH_PD8MFP_Msk (0xful << SYS_GPD_MFPH_PD8MFP_Pos) /*!< SYS_T::GPD_MFPH: PD8MFP Mask */ - -#define SYS_GPD_MFPH_PD9MFP_Pos (4) /*!< SYS_T::GPD_MFPH: PD9MFP Position */ -#define SYS_GPD_MFPH_PD9MFP_Msk (0xful << SYS_GPD_MFPH_PD9MFP_Pos) /*!< SYS_T::GPD_MFPH: PD9MFP Mask */ - -#define SYS_GPD_MFPH_PD10MFP_Pos (8) /*!< SYS_T::GPD_MFPH: PD10MFP Position */ -#define SYS_GPD_MFPH_PD10MFP_Msk (0xful << SYS_GPD_MFPH_PD10MFP_Pos) /*!< SYS_T::GPD_MFPH: PD10MFP Mask */ - -#define SYS_GPD_MFPH_PD11MFP_Pos (12) /*!< SYS_T::GPD_MFPH: PD11MFP Position */ -#define SYS_GPD_MFPH_PD11MFP_Msk (0xful << SYS_GPD_MFPH_PD11MFP_Pos) /*!< SYS_T::GPD_MFPH: PD11MFP Mask */ - -#define SYS_GPD_MFPH_PD12MFP_Pos (16) /*!< SYS_T::GPD_MFPH: PD12MFP Position */ -#define SYS_GPD_MFPH_PD12MFP_Msk (0xful << SYS_GPD_MFPH_PD12MFP_Pos) /*!< SYS_T::GPD_MFPH: PD12MFP Mask */ - -#define SYS_GPD_MFPH_PD14MFP_Pos (24) /*!< SYS_T::GPD_MFPH: PD14MFP Position */ -#define SYS_GPD_MFPH_PD14MFP_Msk (0xful << SYS_GPD_MFPH_PD14MFP_Pos) /*!< SYS_T::GPD_MFPH: PD14MFP Mask */ - -#define SYS_GPE_MFPL_PE0MFP_Pos (0) /*!< SYS_T::GPE_MFPL: PE0MFP Position */ -#define SYS_GPE_MFPL_PE0MFP_Msk (0xful << SYS_GPE_MFPL_PE0MFP_Pos) /*!< SYS_T::GPE_MFPL: PE0MFP Mask */ - -#define SYS_GPE_MFPL_PE1MFP_Pos (4) /*!< SYS_T::GPE_MFPL: PE1MFP Position */ -#define SYS_GPE_MFPL_PE1MFP_Msk (0xful << SYS_GPE_MFPL_PE1MFP_Pos) /*!< SYS_T::GPE_MFPL: PE1MFP Mask */ - -#define SYS_GPE_MFPL_PE2MFP_Pos (8) /*!< SYS_T::GPE_MFPL: PE2MFP Position */ -#define SYS_GPE_MFPL_PE2MFP_Msk (0xful << SYS_GPE_MFPL_PE2MFP_Pos) /*!< SYS_T::GPE_MFPL: PE2MFP Mask */ - -#define SYS_GPE_MFPL_PE3MFP_Pos (12) /*!< SYS_T::GPE_MFPL: PE3MFP Position */ -#define SYS_GPE_MFPL_PE3MFP_Msk (0xful << SYS_GPE_MFPL_PE3MFP_Pos) /*!< SYS_T::GPE_MFPL: PE3MFP Mask */ - -#define SYS_GPE_MFPL_PE4MFP_Pos (16) /*!< SYS_T::GPE_MFPL: PE4MFP Position */ -#define SYS_GPE_MFPL_PE4MFP_Msk (0xful << SYS_GPE_MFPL_PE4MFP_Pos) /*!< SYS_T::GPE_MFPL: PE4MFP Mask */ - -#define SYS_GPE_MFPL_PE5MFP_Pos (20) /*!< SYS_T::GPE_MFPL: PE5MFP Position */ -#define SYS_GPE_MFPL_PE5MFP_Msk (0xful << SYS_GPE_MFPL_PE5MFP_Pos) /*!< SYS_T::GPE_MFPL: PE5MFP Mask */ - -#define SYS_GPE_MFPL_PE6MFP_Pos (24) /*!< SYS_T::GPE_MFPL: PE6MFP Position */ -#define SYS_GPE_MFPL_PE6MFP_Msk (0xful << SYS_GPE_MFPL_PE6MFP_Pos) /*!< SYS_T::GPE_MFPL: PE6MFP Mask */ - -#define SYS_GPE_MFPL_PE7MFP_Pos (28) /*!< SYS_T::GPE_MFPL: PE7MFP Position */ -#define SYS_GPE_MFPL_PE7MFP_Msk (0xful << SYS_GPE_MFPL_PE7MFP_Pos) /*!< SYS_T::GPE_MFPL: PE7MFP Mask */ - -#define SYS_GPE_MFPH_PE8MFP_Pos (0) /*!< SYS_T::GPE_MFPH: PE8MFP Position */ -#define SYS_GPE_MFPH_PE8MFP_Msk (0xful << SYS_GPE_MFPH_PE8MFP_Pos) /*!< SYS_T::GPE_MFPH: PE8MFP Mask */ - -#define SYS_GPE_MFPH_PE9MFP_Pos (4) /*!< SYS_T::GPE_MFPH: PE9MFP Position */ -#define SYS_GPE_MFPH_PE9MFP_Msk (0xful << SYS_GPE_MFPH_PE9MFP_Pos) /*!< SYS_T::GPE_MFPH: PE9MFP Mask */ - -#define SYS_GPE_MFPH_PE10MFP_Pos (8) /*!< SYS_T::GPE_MFPH: PE10MFP Position */ -#define SYS_GPE_MFPH_PE10MFP_Msk (0xful << SYS_GPE_MFPH_PE10MFP_Pos) /*!< SYS_T::GPE_MFPH: PE10MFP Mask */ - -#define SYS_GPE_MFPH_PE11MFP_Pos (12) /*!< SYS_T::GPE_MFPH: PE11MFP Position */ -#define SYS_GPE_MFPH_PE11MFP_Msk (0xful << SYS_GPE_MFPH_PE11MFP_Pos) /*!< SYS_T::GPE_MFPH: PE11MFP Mask */ - -#define SYS_GPE_MFPH_PE12MFP_Pos (16) /*!< SYS_T::GPE_MFPH: PE12MFP Position */ -#define SYS_GPE_MFPH_PE12MFP_Msk (0xful << SYS_GPE_MFPH_PE12MFP_Pos) /*!< SYS_T::GPE_MFPH: PE12MFP Mask */ - -#define SYS_GPE_MFPH_PE13MFP_Pos (20) /*!< SYS_T::GPE_MFPH: PE13MFP Position */ -#define SYS_GPE_MFPH_PE13MFP_Msk (0xful << SYS_GPE_MFPH_PE13MFP_Pos) /*!< SYS_T::GPE_MFPH: PE13MFP Mask */ - -#define SYS_GPE_MFPH_PE14MFP_Pos (24) /*!< SYS_T::GPE_MFPH: PE14MFP Position */ -#define SYS_GPE_MFPH_PE14MFP_Msk (0xful << SYS_GPE_MFPH_PE14MFP_Pos) /*!< SYS_T::GPE_MFPH: PE14MFP Mask */ - -#define SYS_GPE_MFPH_PE15MFP_Pos (28) /*!< SYS_T::GPE_MFPH: PE15MFP Position */ -#define SYS_GPE_MFPH_PE15MFP_Msk (0xful << SYS_GPE_MFPH_PE15MFP_Pos) /*!< SYS_T::GPE_MFPH: PE15MFP Mask */ - -#define SYS_GPF_MFPL_PF0MFP_Pos (0) /*!< SYS_T::GPF_MFPL: PF0MFP Position */ -#define SYS_GPF_MFPL_PF0MFP_Msk (0xful << SYS_GPF_MFPL_PF0MFP_Pos) /*!< SYS_T::GPF_MFPL: PF0MFP Mask */ - -#define SYS_GPF_MFPL_PF1MFP_Pos (4) /*!< SYS_T::GPF_MFPL: PF1MFP Position */ -#define SYS_GPF_MFPL_PF1MFP_Msk (0xful << SYS_GPF_MFPL_PF1MFP_Pos) /*!< SYS_T::GPF_MFPL: PF1MFP Mask */ - -#define SYS_GPF_MFPL_PF2MFP_Pos (8) /*!< SYS_T::GPF_MFPL: PF2MFP Position */ -#define SYS_GPF_MFPL_PF2MFP_Msk (0xful << SYS_GPF_MFPL_PF2MFP_Pos) /*!< SYS_T::GPF_MFPL: PF2MFP Mask */ - -#define SYS_GPF_MFPL_PF3MFP_Pos (12) /*!< SYS_T::GPF_MFPL: PF3MFP Position */ -#define SYS_GPF_MFPL_PF3MFP_Msk (0xful << SYS_GPF_MFPL_PF3MFP_Pos) /*!< SYS_T::GPF_MFPL: PF3MFP Mask */ - -#define SYS_GPF_MFPL_PF4MFP_Pos (16) /*!< SYS_T::GPF_MFPL: PF4MFP Position */ -#define SYS_GPF_MFPL_PF4MFP_Msk (0xful << SYS_GPF_MFPL_PF4MFP_Pos) /*!< SYS_T::GPF_MFPL: PF4MFP Mask */ - -#define SYS_GPF_MFPL_PF5MFP_Pos (20) /*!< SYS_T::GPF_MFPL: PF5MFP Position */ -#define SYS_GPF_MFPL_PF5MFP_Msk (0xful << SYS_GPF_MFPL_PF5MFP_Pos) /*!< SYS_T::GPF_MFPL: PF5MFP Mask */ - -#define SYS_GPF_MFPL_PF6MFP_Pos (24) /*!< SYS_T::GPF_MFPL: PF6MFP Position */ -#define SYS_GPF_MFPL_PF6MFP_Msk (0xful << SYS_GPF_MFPL_PF6MFP_Pos) /*!< SYS_T::GPF_MFPL: PF6MFP Mask */ - -#define SYS_GPF_MFPL_PF7MFP_Pos (28) /*!< SYS_T::GPF_MFPL: PF7MFP Position */ -#define SYS_GPF_MFPL_PF7MFP_Msk (0xful << SYS_GPF_MFPL_PF7MFP_Pos) /*!< SYS_T::GPF_MFPL: PF7MFP Mask */ - -#define SYS_GPF_MFPH_PF8MFP_Pos (0) /*!< SYS_T::GPF_MFPH: PF8MFP Position */ -#define SYS_GPF_MFPH_PF8MFP_Msk (0xful << SYS_GPF_MFPH_PF8MFP_Pos) /*!< SYS_T::GPF_MFPH: PF8MFP Mask */ - -#define SYS_GPF_MFPH_PF9MFP_Pos (4) /*!< SYS_T::GPF_MFPH: PF9MFP Position */ -#define SYS_GPF_MFPH_PF9MFP_Msk (0xful << SYS_GPF_MFPH_PF9MFP_Pos) /*!< SYS_T::GPF_MFPH: PF9MFP Mask */ - -#define SYS_GPF_MFPH_PF10MFP_Pos (8) /*!< SYS_T::GPF_MFPH: PF10MFP Position */ -#define SYS_GPF_MFPH_PF10MFP_Msk (0xful << SYS_GPF_MFPH_PF10MFP_Pos) /*!< SYS_T::GPF_MFPH: PF10MFP Mask */ - -#define SYS_GPF_MFPH_PF11MFP_Pos (12) /*!< SYS_T::GPF_MFPH: PF11MFP Position */ -#define SYS_GPF_MFPH_PF11MFP_Msk (0xful << SYS_GPF_MFPH_PF11MFP_Pos) /*!< SYS_T::GPF_MFPH: PF11MFP Mask */ - -#define SYS_GPG_MFPL_PG2MFP_Pos (8) /*!< SYS_T::GPG_MFPL: PG2MFP Position */ -#define SYS_GPG_MFPL_PG2MFP_Msk (0xful << SYS_GPG_MFPL_PG2MFP_Pos) /*!< SYS_T::GPG_MFPL: PG2MFP Mask */ - -#define SYS_GPG_MFPL_PG3MFP_Pos (12) /*!< SYS_T::GPG_MFPL: PG3MFP Position */ -#define SYS_GPG_MFPL_PG3MFP_Msk (0xful << SYS_GPG_MFPL_PG3MFP_Pos) /*!< SYS_T::GPG_MFPL: PG3MFP Mask */ - -#define SYS_GPG_MFPL_PG4MFP_Pos (16) /*!< SYS_T::GPG_MFPL: PG4MFP Position */ -#define SYS_GPG_MFPL_PG4MFP_Msk (0xful << SYS_GPG_MFPL_PG4MFP_Pos) /*!< SYS_T::GPG_MFPL: PG4MFP Mask */ - -#define SYS_GPG_MFPH_PG9MFP_Pos (4) /*!< SYS_T::GPG_MFPH: PG9MFP Position */ -#define SYS_GPG_MFPH_PG9MFP_Msk (0xful << SYS_GPG_MFPH_PG9MFP_Pos) /*!< SYS_T::GPG_MFPH: PG9MFP Mask */ - -#define SYS_GPG_MFPH_PG10MFP_Pos (8) /*!< SYS_T::GPG_MFPH: PG10MFP Position */ -#define SYS_GPG_MFPH_PG10MFP_Msk (0xful << SYS_GPG_MFPH_PG10MFP_Pos) /*!< SYS_T::GPG_MFPH: PG10MFP Mask */ - -#define SYS_GPG_MFPH_PG11MFP_Pos (12) /*!< SYS_T::GPG_MFPH: PG11MFP Position */ -#define SYS_GPG_MFPH_PG11MFP_Msk (0xful << SYS_GPG_MFPH_PG11MFP_Pos) /*!< SYS_T::GPG_MFPH: PG11MFP Mask */ - -#define SYS_GPG_MFPH_PG12MFP_Pos (16) /*!< SYS_T::GPG_MFPH: PG12MFP Position */ -#define SYS_GPG_MFPH_PG12MFP_Msk (0xful << SYS_GPG_MFPH_PG12MFP_Pos) /*!< SYS_T::GPG_MFPH: PG12MFP Mask */ - -#define SYS_GPG_MFPH_PG13MFP_Pos (20) /*!< SYS_T::GPG_MFPH: PG13MFP Position */ -#define SYS_GPG_MFPH_PG13MFP_Msk (0xful << SYS_GPG_MFPH_PG13MFP_Pos) /*!< SYS_T::GPG_MFPH: PG13MFP Mask */ - -#define SYS_GPG_MFPH_PG14MFP_Pos (24) /*!< SYS_T::GPG_MFPH: PG14MFP Position */ -#define SYS_GPG_MFPH_PG14MFP_Msk (0xful << SYS_GPG_MFPH_PG14MFP_Pos) /*!< SYS_T::GPG_MFPH: PG14MFP Mask */ - -#define SYS_GPG_MFPH_PG15MFP_Pos (28) /*!< SYS_T::GPG_MFPH: PG15MFP Position */ -#define SYS_GPG_MFPH_PG15MFP_Msk (0xful << SYS_GPG_MFPH_PG15MFP_Pos) /*!< SYS_T::GPG_MFPH: PG15MFP Mask */ - -#define SYS_GPH_MFPL_PH4MFP_Pos (16) /*!< SYS_T::GPH_MFPL: PH4MFP Position */ -#define SYS_GPH_MFPL_PH4MFP_Msk (0xful << SYS_GPH_MFPL_PH4MFP_Pos) /*!< SYS_T::GPH_MFPL: PH4MFP Mask */ - -#define SYS_GPH_MFPL_PH5MFP_Pos (20) /*!< SYS_T::GPH_MFPL: PH5MFP Position */ -#define SYS_GPH_MFPL_PH5MFP_Msk (0xful << SYS_GPH_MFPL_PH5MFP_Pos) /*!< SYS_T::GPH_MFPL: PH5MFP Mask */ - -#define SYS_GPH_MFPL_PH6MFP_Pos (24) /*!< SYS_T::GPH_MFPL: PH6MFP Position */ -#define SYS_GPH_MFPL_PH6MFP_Msk (0xful << SYS_GPH_MFPL_PH6MFP_Pos) /*!< SYS_T::GPH_MFPL: PH6MFP Mask */ - -#define SYS_GPH_MFPL_PH7MFP_Pos (28) /*!< SYS_T::GPH_MFPL: PH7MFP Position */ -#define SYS_GPH_MFPL_PH7MFP_Msk (0xful << SYS_GPH_MFPL_PH7MFP_Pos) /*!< SYS_T::GPH_MFPL: PH7MFP Mask */ - -#define SYS_GPH_MFPH_PH8MFP_Pos (0) /*!< SYS_T::GPH_MFPH: PH8MFP Position */ -#define SYS_GPH_MFPH_PH8MFP_Msk (0xful << SYS_GPH_MFPH_PH8MFP_Pos) /*!< SYS_T::GPH_MFPH: PH8MFP Mask */ - -#define SYS_GPH_MFPH_PH9MFP_Pos (4) /*!< SYS_T::GPH_MFPH: PH9MFP Position */ -#define SYS_GPH_MFPH_PH9MFP_Msk (0xful << SYS_GPH_MFPH_PH9MFP_Pos) /*!< SYS_T::GPH_MFPH: PH9MFP Mask */ - -#define SYS_GPH_MFPH_PH10MFP_Pos (8) /*!< SYS_T::GPH_MFPH: PH10MFP Position */ -#define SYS_GPH_MFPH_PH10MFP_Msk (0xful << SYS_GPH_MFPH_PH10MFP_Pos) /*!< SYS_T::GPH_MFPH: PH10MFP Mask */ - -#define SYS_GPH_MFPH_PH11MFP_Pos (12) /*!< SYS_T::GPH_MFPH: PH11MFP Position */ -#define SYS_GPH_MFPH_PH11MFP_Msk (0xful << SYS_GPH_MFPH_PH11MFP_Pos) /*!< SYS_T::GPH_MFPH: PH11MFP Mask */ - -#define SYS_GPA_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPA_MFOS: MFOS0 Position */ -#define SYS_GPA_MFOS_MFOS0_Msk (0x1ul << SYS_GPA_MFOS_MFOS0_Pos) /*!< SYS_T::GPA_MFOS: MFOS0 Mask */ - -#define SYS_GPA_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPA_MFOS: MFOS1 Position */ -#define SYS_GPA_MFOS_MFOS1_Msk (0x1ul << SYS_GPA_MFOS_MFOS1_Pos) /*!< SYS_T::GPA_MFOS: MFOS1 Mask */ - -#define SYS_GPA_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPA_MFOS: MFOS2 Position */ -#define SYS_GPA_MFOS_MFOS2_Msk (0x1ul << SYS_GPA_MFOS_MFOS2_Pos) /*!< SYS_T::GPA_MFOS: MFOS2 Mask */ - -#define SYS_GPA_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPA_MFOS: MFOS3 Position */ -#define SYS_GPA_MFOS_MFOS3_Msk (0x1ul << SYS_GPA_MFOS_MFOS3_Pos) /*!< SYS_T::GPA_MFOS: MFOS3 Mask */ - -#define SYS_GPA_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPA_MFOS: MFOS4 Position */ -#define SYS_GPA_MFOS_MFOS4_Msk (0x1ul << SYS_GPA_MFOS_MFOS4_Pos) /*!< SYS_T::GPA_MFOS: MFOS4 Mask */ - -#define SYS_GPA_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPA_MFOS: MFOS5 Position */ -#define SYS_GPA_MFOS_MFOS5_Msk (0x1ul << SYS_GPA_MFOS_MFOS5_Pos) /*!< SYS_T::GPA_MFOS: MFOS5 Mask */ - -#define SYS_GPA_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPA_MFOS: MFOS6 Position */ -#define SYS_GPA_MFOS_MFOS6_Msk (0x1ul << SYS_GPA_MFOS_MFOS6_Pos) /*!< SYS_T::GPA_MFOS: MFOS6 Mask */ - -#define SYS_GPA_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPA_MFOS: MFOS7 Position */ -#define SYS_GPA_MFOS_MFOS7_Msk (0x1ul << SYS_GPA_MFOS_MFOS7_Pos) /*!< SYS_T::GPA_MFOS: MFOS7 Mask */ - -#define SYS_GPA_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPA_MFOS: MFOS8 Position */ -#define SYS_GPA_MFOS_MFOS8_Msk (0x1ul << SYS_GPA_MFOS_MFOS8_Pos) /*!< SYS_T::GPA_MFOS: MFOS8 Mask */ - -#define SYS_GPA_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPA_MFOS: MFOS9 Position */ -#define SYS_GPA_MFOS_MFOS9_Msk (0x1ul << SYS_GPA_MFOS_MFOS9_Pos) /*!< SYS_T::GPA_MFOS: MFOS9 Mask */ - -#define SYS_GPA_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPA_MFOS: MFOS10 Position */ -#define SYS_GPA_MFOS_MFOS10_Msk (0x1ul << SYS_GPA_MFOS_MFOS10_Pos) /*!< SYS_T::GPA_MFOS: MFOS10 Mask */ - -#define SYS_GPA_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPA_MFOS: MFOS11 Position */ -#define SYS_GPA_MFOS_MFOS11_Msk (0x1ul << SYS_GPA_MFOS_MFOS11_Pos) /*!< SYS_T::GPA_MFOS: MFOS11 Mask */ - -#define SYS_GPA_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPA_MFOS: MFOS12 Position */ -#define SYS_GPA_MFOS_MFOS12_Msk (0x1ul << SYS_GPA_MFOS_MFOS12_Pos) /*!< SYS_T::GPA_MFOS: MFOS12 Mask */ - -#define SYS_GPA_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPA_MFOS: MFOS13 Position */ -#define SYS_GPA_MFOS_MFOS13_Msk (0x1ul << SYS_GPA_MFOS_MFOS13_Pos) /*!< SYS_T::GPA_MFOS: MFOS13 Mask */ - -#define SYS_GPA_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPA_MFOS: MFOS14 Position */ -#define SYS_GPA_MFOS_MFOS14_Msk (0x1ul << SYS_GPA_MFOS_MFOS14_Pos) /*!< SYS_T::GPA_MFOS: MFOS14 Mask */ - -#define SYS_GPA_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPA_MFOS: MFOS15 Position */ -#define SYS_GPA_MFOS_MFOS15_Msk (0x1ul << SYS_GPA_MFOS_MFOS15_Pos) /*!< SYS_T::GPA_MFOS: MFOS15 Mask */ - -#define SYS_GPB_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPB_MFOS: MFOS0 Position */ -#define SYS_GPB_MFOS_MFOS0_Msk (0x1ul << SYS_GPB_MFOS_MFOS0_Pos) /*!< SYS_T::GPB_MFOS: MFOS0 Mask */ - -#define SYS_GPB_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPB_MFOS: MFOS1 Position */ -#define SYS_GPB_MFOS_MFOS1_Msk (0x1ul << SYS_GPB_MFOS_MFOS1_Pos) /*!< SYS_T::GPB_MFOS: MFOS1 Mask */ - -#define SYS_GPB_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPB_MFOS: MFOS2 Position */ -#define SYS_GPB_MFOS_MFOS2_Msk (0x1ul << SYS_GPB_MFOS_MFOS2_Pos) /*!< SYS_T::GPB_MFOS: MFOS2 Mask */ - -#define SYS_GPB_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPB_MFOS: MFOS3 Position */ -#define SYS_GPB_MFOS_MFOS3_Msk (0x1ul << SYS_GPB_MFOS_MFOS3_Pos) /*!< SYS_T::GPB_MFOS: MFOS3 Mask */ - -#define SYS_GPB_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPB_MFOS: MFOS4 Position */ -#define SYS_GPB_MFOS_MFOS4_Msk (0x1ul << SYS_GPB_MFOS_MFOS4_Pos) /*!< SYS_T::GPB_MFOS: MFOS4 Mask */ - -#define SYS_GPB_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPB_MFOS: MFOS5 Position */ -#define SYS_GPB_MFOS_MFOS5_Msk (0x1ul << SYS_GPB_MFOS_MFOS5_Pos) /*!< SYS_T::GPB_MFOS: MFOS5 Mask */ - -#define SYS_GPB_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPB_MFOS: MFOS6 Position */ -#define SYS_GPB_MFOS_MFOS6_Msk (0x1ul << SYS_GPB_MFOS_MFOS6_Pos) /*!< SYS_T::GPB_MFOS: MFOS6 Mask */ - -#define SYS_GPB_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPB_MFOS: MFOS7 Position */ -#define SYS_GPB_MFOS_MFOS7_Msk (0x1ul << SYS_GPB_MFOS_MFOS7_Pos) /*!< SYS_T::GPB_MFOS: MFOS7 Mask */ - -#define SYS_GPB_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPB_MFOS: MFOS8 Position */ -#define SYS_GPB_MFOS_MFOS8_Msk (0x1ul << SYS_GPB_MFOS_MFOS8_Pos) /*!< SYS_T::GPB_MFOS: MFOS8 Mask */ - -#define SYS_GPB_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPB_MFOS: MFOS9 Position */ -#define SYS_GPB_MFOS_MFOS9_Msk (0x1ul << SYS_GPB_MFOS_MFOS9_Pos) /*!< SYS_T::GPB_MFOS: MFOS9 Mask */ - -#define SYS_GPB_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPB_MFOS: MFOS10 Position */ -#define SYS_GPB_MFOS_MFOS10_Msk (0x1ul << SYS_GPB_MFOS_MFOS10_Pos) /*!< SYS_T::GPB_MFOS: MFOS10 Mask */ - -#define SYS_GPB_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPB_MFOS: MFOS11 Position */ -#define SYS_GPB_MFOS_MFOS11_Msk (0x1ul << SYS_GPB_MFOS_MFOS11_Pos) /*!< SYS_T::GPB_MFOS: MFOS11 Mask */ - -#define SYS_GPB_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPB_MFOS: MFOS12 Position */ -#define SYS_GPB_MFOS_MFOS12_Msk (0x1ul << SYS_GPB_MFOS_MFOS12_Pos) /*!< SYS_T::GPB_MFOS: MFOS12 Mask */ - -#define SYS_GPB_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPB_MFOS: MFOS13 Position */ -#define SYS_GPB_MFOS_MFOS13_Msk (0x1ul << SYS_GPB_MFOS_MFOS13_Pos) /*!< SYS_T::GPB_MFOS: MFOS13 Mask */ - -#define SYS_GPB_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPB_MFOS: MFOS14 Position */ -#define SYS_GPB_MFOS_MFOS14_Msk (0x1ul << SYS_GPB_MFOS_MFOS14_Pos) /*!< SYS_T::GPB_MFOS: MFOS14 Mask */ - -#define SYS_GPB_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPB_MFOS: MFOS15 Position */ -#define SYS_GPB_MFOS_MFOS15_Msk (0x1ul << SYS_GPB_MFOS_MFOS15_Pos) /*!< SYS_T::GPB_MFOS: MFOS15 Mask */ - -#define SYS_GPC_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPC_MFOS: MFOS0 Position */ -#define SYS_GPC_MFOS_MFOS0_Msk (0x1ul << SYS_GPC_MFOS_MFOS0_Pos) /*!< SYS_T::GPC_MFOS: MFOS0 Mask */ - -#define SYS_GPC_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPC_MFOS: MFOS1 Position */ -#define SYS_GPC_MFOS_MFOS1_Msk (0x1ul << SYS_GPC_MFOS_MFOS1_Pos) /*!< SYS_T::GPC_MFOS: MFOS1 Mask */ - -#define SYS_GPC_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPC_MFOS: MFOS2 Position */ -#define SYS_GPC_MFOS_MFOS2_Msk (0x1ul << SYS_GPC_MFOS_MFOS2_Pos) /*!< SYS_T::GPC_MFOS: MFOS2 Mask */ - -#define SYS_GPC_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPC_MFOS: MFOS3 Position */ -#define SYS_GPC_MFOS_MFOS3_Msk (0x1ul << SYS_GPC_MFOS_MFOS3_Pos) /*!< SYS_T::GPC_MFOS: MFOS3 Mask */ - -#define SYS_GPC_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPC_MFOS: MFOS4 Position */ -#define SYS_GPC_MFOS_MFOS4_Msk (0x1ul << SYS_GPC_MFOS_MFOS4_Pos) /*!< SYS_T::GPC_MFOS: MFOS4 Mask */ - -#define SYS_GPC_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPC_MFOS: MFOS5 Position */ -#define SYS_GPC_MFOS_MFOS5_Msk (0x1ul << SYS_GPC_MFOS_MFOS5_Pos) /*!< SYS_T::GPC_MFOS: MFOS5 Mask */ - -#define SYS_GPC_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPC_MFOS: MFOS6 Position */ -#define SYS_GPC_MFOS_MFOS6_Msk (0x1ul << SYS_GPC_MFOS_MFOS6_Pos) /*!< SYS_T::GPC_MFOS: MFOS6 Mask */ - -#define SYS_GPC_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPC_MFOS: MFOS7 Position */ -#define SYS_GPC_MFOS_MFOS7_Msk (0x1ul << SYS_GPC_MFOS_MFOS7_Pos) /*!< SYS_T::GPC_MFOS: MFOS7 Mask */ - -#define SYS_GPC_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPC_MFOS: MFOS8 Position */ -#define SYS_GPC_MFOS_MFOS8_Msk (0x1ul << SYS_GPC_MFOS_MFOS8_Pos) /*!< SYS_T::GPC_MFOS: MFOS8 Mask */ - -#define SYS_GPC_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPC_MFOS: MFOS9 Position */ -#define SYS_GPC_MFOS_MFOS9_Msk (0x1ul << SYS_GPC_MFOS_MFOS9_Pos) /*!< SYS_T::GPC_MFOS: MFOS9 Mask */ - -#define SYS_GPC_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPC_MFOS: MFOS10 Position */ -#define SYS_GPC_MFOS_MFOS10_Msk (0x1ul << SYS_GPC_MFOS_MFOS10_Pos) /*!< SYS_T::GPC_MFOS: MFOS10 Mask */ - -#define SYS_GPC_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPC_MFOS: MFOS11 Position */ -#define SYS_GPC_MFOS_MFOS11_Msk (0x1ul << SYS_GPC_MFOS_MFOS11_Pos) /*!< SYS_T::GPC_MFOS: MFOS11 Mask */ - -#define SYS_GPC_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPC_MFOS: MFOS12 Position */ -#define SYS_GPC_MFOS_MFOS12_Msk (0x1ul << SYS_GPC_MFOS_MFOS12_Pos) /*!< SYS_T::GPC_MFOS: MFOS12 Mask */ - -#define SYS_GPC_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPC_MFOS: MFOS13 Position */ -#define SYS_GPC_MFOS_MFOS13_Msk (0x1ul << SYS_GPC_MFOS_MFOS13_Pos) /*!< SYS_T::GPC_MFOS: MFOS13 Mask */ - -#define SYS_GPD_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPD_MFOS: MFOS0 Position */ -#define SYS_GPD_MFOS_MFOS0_Msk (0x1ul << SYS_GPD_MFOS_MFOS0_Pos) /*!< SYS_T::GPD_MFOS: MFOS0 Mask */ - -#define SYS_GPD_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPD_MFOS: MFOS1 Position */ -#define SYS_GPD_MFOS_MFOS1_Msk (0x1ul << SYS_GPD_MFOS_MFOS1_Pos) /*!< SYS_T::GPD_MFOS: MFOS1 Mask */ - -#define SYS_GPD_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPD_MFOS: MFOS2 Position */ -#define SYS_GPD_MFOS_MFOS2_Msk (0x1ul << SYS_GPD_MFOS_MFOS2_Pos) /*!< SYS_T::GPD_MFOS: MFOS2 Mask */ - -#define SYS_GPD_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPD_MFOS: MFOS3 Position */ -#define SYS_GPD_MFOS_MFOS3_Msk (0x1ul << SYS_GPD_MFOS_MFOS3_Pos) /*!< SYS_T::GPD_MFOS: MFOS3 Mask */ - -#define SYS_GPD_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPD_MFOS: MFOS4 Position */ -#define SYS_GPD_MFOS_MFOS4_Msk (0x1ul << SYS_GPD_MFOS_MFOS4_Pos) /*!< SYS_T::GPD_MFOS: MFOS4 Mask */ - -#define SYS_GPD_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPD_MFOS: MFOS5 Position */ -#define SYS_GPD_MFOS_MFOS5_Msk (0x1ul << SYS_GPD_MFOS_MFOS5_Pos) /*!< SYS_T::GPD_MFOS: MFOS5 Mask */ - -#define SYS_GPD_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPD_MFOS: MFOS6 Position */ -#define SYS_GPD_MFOS_MFOS6_Msk (0x1ul << SYS_GPD_MFOS_MFOS6_Pos) /*!< SYS_T::GPD_MFOS: MFOS6 Mask */ - -#define SYS_GPD_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPD_MFOS: MFOS7 Position */ -#define SYS_GPD_MFOS_MFOS7_Msk (0x1ul << SYS_GPD_MFOS_MFOS7_Pos) /*!< SYS_T::GPD_MFOS: MFOS7 Mask */ - -#define SYS_GPD_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPD_MFOS: MFOS8 Position */ -#define SYS_GPD_MFOS_MFOS8_Msk (0x1ul << SYS_GPD_MFOS_MFOS8_Pos) /*!< SYS_T::GPD_MFOS: MFOS8 Mask */ - -#define SYS_GPD_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPD_MFOS: MFOS9 Position */ -#define SYS_GPD_MFOS_MFOS9_Msk (0x1ul << SYS_GPD_MFOS_MFOS9_Pos) /*!< SYS_T::GPD_MFOS: MFOS9 Mask */ - -#define SYS_GPD_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPD_MFOS: MFOS10 Position */ -#define SYS_GPD_MFOS_MFOS10_Msk (0x1ul << SYS_GPD_MFOS_MFOS10_Pos) /*!< SYS_T::GPD_MFOS: MFOS10 Mask */ - -#define SYS_GPD_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPD_MFOS: MFOS11 Position */ -#define SYS_GPD_MFOS_MFOS11_Msk (0x1ul << SYS_GPD_MFOS_MFOS11_Pos) /*!< SYS_T::GPD_MFOS: MFOS11 Mask */ - -#define SYS_GPD_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPD_MFOS: MFOS12 Position */ -#define SYS_GPD_MFOS_MFOS12_Msk (0x1ul << SYS_GPD_MFOS_MFOS12_Pos) /*!< SYS_T::GPD_MFOS: MFOS12 Mask */ - -#define SYS_GPD_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPD_MFOS: MFOS14 Position */ -#define SYS_GPD_MFOS_MFOS14_Msk (0x1ul << SYS_GPD_MFOS_MFOS14_Pos) /*!< SYS_T::GPD_MFOS: MFOS14 Mask */ - -#define SYS_GPE_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPE_MFOS: MFOS0 Position */ -#define SYS_GPE_MFOS_MFOS0_Msk (0x1ul << SYS_GPE_MFOS_MFOS0_Pos) /*!< SYS_T::GPE_MFOS: MFOS0 Mask */ - -#define SYS_GPE_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPE_MFOS: MFOS1 Position */ -#define SYS_GPE_MFOS_MFOS1_Msk (0x1ul << SYS_GPE_MFOS_MFOS1_Pos) /*!< SYS_T::GPE_MFOS: MFOS1 Mask */ - -#define SYS_GPE_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPE_MFOS: MFOS2 Position */ -#define SYS_GPE_MFOS_MFOS2_Msk (0x1ul << SYS_GPE_MFOS_MFOS2_Pos) /*!< SYS_T::GPE_MFOS: MFOS2 Mask */ - -#define SYS_GPE_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPE_MFOS: MFOS3 Position */ -#define SYS_GPE_MFOS_MFOS3_Msk (0x1ul << SYS_GPE_MFOS_MFOS3_Pos) /*!< SYS_T::GPE_MFOS: MFOS3 Mask */ - -#define SYS_GPE_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPE_MFOS: MFOS4 Position */ -#define SYS_GPE_MFOS_MFOS4_Msk (0x1ul << SYS_GPE_MFOS_MFOS4_Pos) /*!< SYS_T::GPE_MFOS: MFOS4 Mask */ - -#define SYS_GPE_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPE_MFOS: MFOS5 Position */ -#define SYS_GPE_MFOS_MFOS5_Msk (0x1ul << SYS_GPE_MFOS_MFOS5_Pos) /*!< SYS_T::GPE_MFOS: MFOS5 Mask */ - -#define SYS_GPE_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPE_MFOS: MFOS6 Position */ -#define SYS_GPE_MFOS_MFOS6_Msk (0x1ul << SYS_GPE_MFOS_MFOS6_Pos) /*!< SYS_T::GPE_MFOS: MFOS6 Mask */ - -#define SYS_GPE_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPE_MFOS: MFOS7 Position */ -#define SYS_GPE_MFOS_MFOS7_Msk (0x1ul << SYS_GPE_MFOS_MFOS7_Pos) /*!< SYS_T::GPE_MFOS: MFOS7 Mask */ - -#define SYS_GPE_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPE_MFOS: MFOS8 Position */ -#define SYS_GPE_MFOS_MFOS8_Msk (0x1ul << SYS_GPE_MFOS_MFOS8_Pos) /*!< SYS_T::GPE_MFOS: MFOS8 Mask */ - -#define SYS_GPE_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPE_MFOS: MFOS9 Position */ -#define SYS_GPE_MFOS_MFOS9_Msk (0x1ul << SYS_GPE_MFOS_MFOS9_Pos) /*!< SYS_T::GPE_MFOS: MFOS9 Mask */ - -#define SYS_GPE_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPE_MFOS: MFOS10 Position */ -#define SYS_GPE_MFOS_MFOS10_Msk (0x1ul << SYS_GPE_MFOS_MFOS10_Pos) /*!< SYS_T::GPE_MFOS: MFOS10 Mask */ - -#define SYS_GPE_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPE_MFOS: MFOS11 Position */ -#define SYS_GPE_MFOS_MFOS11_Msk (0x1ul << SYS_GPE_MFOS_MFOS11_Pos) /*!< SYS_T::GPE_MFOS: MFOS11 Mask */ - -#define SYS_GPE_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPE_MFOS: MFOS12 Position */ -#define SYS_GPE_MFOS_MFOS12_Msk (0x1ul << SYS_GPE_MFOS_MFOS12_Pos) /*!< SYS_T::GPE_MFOS: MFOS12 Mask */ - -#define SYS_GPE_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPE_MFOS: MFOS13 Position */ -#define SYS_GPE_MFOS_MFOS13_Msk (0x1ul << SYS_GPE_MFOS_MFOS13_Pos) /*!< SYS_T::GPE_MFOS: MFOS13 Mask */ - -#define SYS_GPE_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPE_MFOS: MFOS14 Position */ -#define SYS_GPE_MFOS_MFOS14_Msk (0x1ul << SYS_GPE_MFOS_MFOS14_Pos) /*!< SYS_T::GPE_MFOS: MFOS14 Mask */ - -#define SYS_GPE_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPE_MFOS: MFOS15 Position */ -#define SYS_GPE_MFOS_MFOS15_Msk (0x1ul << SYS_GPE_MFOS_MFOS15_Pos) /*!< SYS_T::GPE_MFOS: MFOS15 Mask */ - -#define SYS_GPF_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPF_MFOS: MFOS0 Position */ -#define SYS_GPF_MFOS_MFOS0_Msk (0x1ul << SYS_GPF_MFOS_MFOS0_Pos) /*!< SYS_T::GPF_MFOS: MFOS0 Mask */ - -#define SYS_GPF_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPF_MFOS: MFOS1 Position */ -#define SYS_GPF_MFOS_MFOS1_Msk (0x1ul << SYS_GPF_MFOS_MFOS1_Pos) /*!< SYS_T::GPF_MFOS: MFOS1 Mask */ - -#define SYS_GPF_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPF_MFOS: MFOS2 Position */ -#define SYS_GPF_MFOS_MFOS2_Msk (0x1ul << SYS_GPF_MFOS_MFOS2_Pos) /*!< SYS_T::GPF_MFOS: MFOS2 Mask */ - -#define SYS_GPF_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPF_MFOS: MFOS3 Position */ -#define SYS_GPF_MFOS_MFOS3_Msk (0x1ul << SYS_GPF_MFOS_MFOS3_Pos) /*!< SYS_T::GPF_MFOS: MFOS3 Mask */ - -#define SYS_GPF_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPF_MFOS: MFOS4 Position */ -#define SYS_GPF_MFOS_MFOS4_Msk (0x1ul << SYS_GPF_MFOS_MFOS4_Pos) /*!< SYS_T::GPF_MFOS: MFOS4 Mask */ - -#define SYS_GPF_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPF_MFOS: MFOS5 Position */ -#define SYS_GPF_MFOS_MFOS5_Msk (0x1ul << SYS_GPF_MFOS_MFOS5_Pos) /*!< SYS_T::GPF_MFOS: MFOS5 Mask */ - -#define SYS_GPF_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPF_MFOS: MFOS6 Position */ -#define SYS_GPF_MFOS_MFOS6_Msk (0x1ul << SYS_GPF_MFOS_MFOS6_Pos) /*!< SYS_T::GPF_MFOS: MFOS6 Mask */ - -#define SYS_GPF_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPF_MFOS: MFOS7 Position */ -#define SYS_GPF_MFOS_MFOS7_Msk (0x1ul << SYS_GPF_MFOS_MFOS7_Pos) /*!< SYS_T::GPF_MFOS: MFOS7 Mask */ - -#define SYS_GPF_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPF_MFOS: MFOS8 Position */ -#define SYS_GPF_MFOS_MFOS8_Msk (0x1ul << SYS_GPF_MFOS_MFOS8_Pos) /*!< SYS_T::GPF_MFOS: MFOS8 Mask */ - -#define SYS_GPF_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPF_MFOS: MFOS9 Position */ -#define SYS_GPF_MFOS_MFOS9_Msk (0x1ul << SYS_GPF_MFOS_MFOS9_Pos) /*!< SYS_T::GPF_MFOS: MFOS9 Mask */ - -#define SYS_GPF_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPF_MFOS: MFOS10 Position */ -#define SYS_GPF_MFOS_MFOS10_Msk (0x1ul << SYS_GPF_MFOS_MFOS10_Pos) /*!< SYS_T::GPF_MFOS: MFOS10 Mask */ - -#define SYS_GPF_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPF_MFOS: MFOS11 Position */ -#define SYS_GPF_MFOS_MFOS11_Msk (0x1ul << SYS_GPF_MFOS_MFOS11_Pos) /*!< SYS_T::GPF_MFOS: MFOS11 Mask */ - -#define SYS_GPG_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPG_MFOS: MFOS2 Position */ -#define SYS_GPG_MFOS_MFOS2_Msk (0x1ul << SYS_GPG_MFOS_MFOS2_Pos) /*!< SYS_T::GPG_MFOS: MFOS2 Mask */ - -#define SYS_GPG_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPG_MFOS: MFOS3 Position */ -#define SYS_GPG_MFOS_MFOS3_Msk (0x1ul << SYS_GPG_MFOS_MFOS3_Pos) /*!< SYS_T::GPG_MFOS: MFOS3 Mask */ - -#define SYS_GPG_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPG_MFOS: MFOS4 Position */ -#define SYS_GPG_MFOS_MFOS4_Msk (0x1ul << SYS_GPG_MFOS_MFOS4_Pos) /*!< SYS_T::GPG_MFOS: MFOS4 Mask */ - -#define SYS_GPG_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPG_MFOS: MFOS9 Position */ -#define SYS_GPG_MFOS_MFOS9_Msk (0x1ul << SYS_GPG_MFOS_MFOS9_Pos) /*!< SYS_T::GPG_MFOS: MFOS9 Mask */ - -#define SYS_GPG_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPG_MFOS: MFOS10 Position */ -#define SYS_GPG_MFOS_MFOS10_Msk (0x1ul << SYS_GPG_MFOS_MFOS10_Pos) /*!< SYS_T::GPG_MFOS: MFOS10 Mask */ - -#define SYS_GPG_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPG_MFOS: MFOS11 Position */ -#define SYS_GPG_MFOS_MFOS11_Msk (0x1ul << SYS_GPG_MFOS_MFOS11_Pos) /*!< SYS_T::GPG_MFOS: MFOS11 Mask */ - -#define SYS_GPG_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPG_MFOS: MFOS12 Position */ -#define SYS_GPG_MFOS_MFOS12_Msk (0x1ul << SYS_GPG_MFOS_MFOS12_Pos) /*!< SYS_T::GPG_MFOS: MFOS12 Mask */ - -#define SYS_GPG_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPG_MFOS: MFOS13 Position */ -#define SYS_GPG_MFOS_MFOS13_Msk (0x1ul << SYS_GPG_MFOS_MFOS13_Pos) /*!< SYS_T::GPG_MFOS: MFOS13 Mask */ - -#define SYS_GPG_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPG_MFOS: MFOS14 Position */ -#define SYS_GPG_MFOS_MFOS14_Msk (0x1ul << SYS_GPG_MFOS_MFOS14_Pos) /*!< SYS_T::GPG_MFOS: MFOS14 Mask */ - -#define SYS_GPG_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPG_MFOS: MFOS15 Position */ -#define SYS_GPG_MFOS_MFOS15_Msk (0x1ul << SYS_GPG_MFOS_MFOS15_Pos) /*!< SYS_T::GPG_MFOS: MFOS15 Mask */ - -#define SYS_GPH_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPH_MFOS: MFOS4 Position */ -#define SYS_GPH_MFOS_MFOS4_Msk (0x1ul << SYS_GPH_MFOS_MFOS4_Pos) /*!< SYS_T::GPH_MFOS: MFOS4 Mask */ - -#define SYS_GPH_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPH_MFOS: MFOS5 Position */ -#define SYS_GPH_MFOS_MFOS5_Msk (0x1ul << SYS_GPH_MFOS_MFOS5_Pos) /*!< SYS_T::GPH_MFOS: MFOS5 Mask */ - -#define SYS_GPH_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPH_MFOS: MFOS6 Position */ -#define SYS_GPH_MFOS_MFOS6_Msk (0x1ul << SYS_GPH_MFOS_MFOS6_Pos) /*!< SYS_T::GPH_MFOS: MFOS6 Mask */ - -#define SYS_GPH_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPH_MFOS: MFOS7 Position */ -#define SYS_GPH_MFOS_MFOS7_Msk (0x1ul << SYS_GPH_MFOS_MFOS7_Pos) /*!< SYS_T::GPH_MFOS: MFOS7 Mask */ - -#define SYS_GPH_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPH_MFOS: MFOS8 Position */ -#define SYS_GPH_MFOS_MFOS8_Msk (0x1ul << SYS_GPH_MFOS_MFOS8_Pos) /*!< SYS_T::GPH_MFOS: MFOS8 Mask */ - -#define SYS_GPH_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPH_MFOS: MFOS9 Position */ -#define SYS_GPH_MFOS_MFOS9_Msk (0x1ul << SYS_GPH_MFOS_MFOS9_Pos) /*!< SYS_T::GPH_MFOS: MFOS9 Mask */ - -#define SYS_GPH_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPH_MFOS: MFOS10 Position */ -#define SYS_GPH_MFOS_MFOS10_Msk (0x1ul << SYS_GPH_MFOS_MFOS10_Pos) /*!< SYS_T::GPH_MFOS: MFOS10 Mask */ - -#define SYS_GPH_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPH_MFOS: MFOS11 Position */ -#define SYS_GPH_MFOS_MFOS11_Msk (0x1ul << SYS_GPH_MFOS_MFOS11_Pos) /*!< SYS_T::GPH_MFOS: MFOS11 Mask */ - -#define SYS_VTORSET_VTORSET_Pos (11) /*!< SYS_T::VTORSET: VTORSET Position */ -#define SYS_VTORSET_VTORSET_Msk (0x3fffful << SYS_VTORSET_VTORSET_Pos) /*!< SYS_T::VTORSET: VTORSET Mask */ - -#define SYS_SRAMICTL_PERRIEN_Pos (0) /*!< SYS_T::SRAMICTL: PERRIEN Position */ -#define SYS_SRAMICTL_PERRIEN_Msk (0x1ul << SYS_SRAMICTL_PERRIEN_Pos) /*!< SYS_T::SRAMICTL: PERRIEN Mask */ - -#define SYS_SRAMSTS_PERRIF_Pos (0) /*!< SYS_T::SRAMSTS: PERRIF Position */ -#define SYS_SRAMSTS_PERRIF_Msk (0x1ul << SYS_SRAMSTS_PERRIF_Pos) /*!< SYS_T::SRAMSTS: PERRIF Mask */ - -#define SYS_SRAMEADR_ERRADDR_Pos (0) /*!< SYS_T::SRAMEADR: ERRADDR Position */ -#define SYS_SRAMEADR_ERRADDR_Msk (0xfffffffful << SYS_SRAMEADR_ERRADDR_Pos) /*!< SYS_T::SRAMEADR: ERRADDR Mask */ - -#define SYS_SRAMPC0_SRAM0PM0_Pos (0) /*!< SYS_T::SRAMPC0: SRAM0PM0 Position */ -#define SYS_SRAMPC0_SRAM0PM0_Msk (0x3ul << SYS_SRAMPC0_SRAM0PM0_Pos) /*!< SYS_T::SRAMPC0: SRAM0PM0 Mask */ - -#define SYS_SRAMPC0_SRAM0PM1_Pos (2) /*!< SYS_T::SRAMPC0: SRAM0PM1 Position */ -#define SYS_SRAMPC0_SRAM0PM1_Msk (0x3ul << SYS_SRAMPC0_SRAM0PM1_Pos) /*!< SYS_T::SRAMPC0: SRAM0PM1 Mask */ - -#define SYS_SRAMPC0_SRAM0PM2_Pos (4) /*!< SYS_T::SRAMPC0: SRAM0PM2 Position */ -#define SYS_SRAMPC0_SRAM0PM2_Msk (0x3ul << SYS_SRAMPC0_SRAM0PM2_Pos) /*!< SYS_T::SRAMPC0: SRAM0PM2 Mask */ - -#define SYS_SRAMPC0_SRAM0PM3_Pos (6) /*!< SYS_T::SRAMPC0: SRAM0PM3 Position */ -#define SYS_SRAMPC0_SRAM0PM3_Msk (0x3ul << SYS_SRAMPC0_SRAM0PM3_Pos) /*!< SYS_T::SRAMPC0: SRAM0PM3 Mask */ - -#define SYS_SRAMPC0_SRAM0PM4_Pos (8) /*!< SYS_T::SRAMPC0: SRAM0PM4 Position */ -#define SYS_SRAMPC0_SRAM0PM4_Msk (0x3ul << SYS_SRAMPC0_SRAM0PM4_Pos) /*!< SYS_T::SRAMPC0: SRAM0PM4 Mask */ - -#define SYS_SRAMPC0_SRAM1PM0_Pos (10) /*!< SYS_T::SRAMPC0: SRAM1PM0 Position */ -#define SYS_SRAMPC0_SRAM1PM0_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM0_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM0 Mask */ - -#define SYS_SRAMPC0_SRAM1PM1_Pos (12) /*!< SYS_T::SRAMPC0: SRAM1PM1 Position */ -#define SYS_SRAMPC0_SRAM1PM1_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM1_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM1 Mask */ - -#define SYS_SRAMPC0_SRAM1PM2_Pos (14) /*!< SYS_T::SRAMPC0: SRAM1PM2 Position */ -#define SYS_SRAMPC0_SRAM1PM2_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM2_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM2 Mask */ - -#define SYS_SRAMPC0_SRAM1PM3_Pos (16) /*!< SYS_T::SRAMPC0: SRAM1PM3 Position */ -#define SYS_SRAMPC0_SRAM1PM3_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM3_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM3 Mask */ - -#define SYS_SRAMPC0_SRAM1PM4_Pos (18) /*!< SYS_T::SRAMPC0: SRAM1PM4 Position */ -#define SYS_SRAMPC0_SRAM1PM4_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM4_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM4 Mask */ - -#define SYS_SRAMPC0_SRAM1PM5_Pos (20) /*!< SYS_T::SRAMPC0: SRAM1PM5 Position */ -#define SYS_SRAMPC0_SRAM1PM5_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM5_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM5 Mask */ - -#define SYS_SRAMPC0_SRAM1PM6_Pos (22) /*!< SYS_T::SRAMPC0: SRAM1PM6 Position */ -#define SYS_SRAMPC0_SRAM1PM6_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM6_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM6 Mask */ - -#define SYS_SRAMPC0_SRAM1PM7_Pos (24) /*!< SYS_T::SRAMPC0: SRAM1PM7 Position */ -#define SYS_SRAMPC0_SRAM1PM7_Msk (0x3ul << SYS_SRAMPC0_SRAM1PM7_Pos) /*!< SYS_T::SRAMPC0: SRAM1PM7 Mask */ - -#define SYS_SRAMPC0_SRAM2PM0_Pos (26) /*!< SYS_T::SRAMPC0: SRAM2PM0 Position */ -#define SYS_SRAMPC0_SRAM2PM0_Msk (0x3ul << SYS_SRAMPC0_SRAM2PM0_Pos) /*!< SYS_T::SRAMPC0: SRAM2PM0 Mask */ - -#define SYS_SRAMPC0_SRAM2PM1_Pos (28) /*!< SYS_T::SRAMPC0: SRAM2PM1 Position */ -#define SYS_SRAMPC0_SRAM2PM1_Msk (0x3ul << SYS_SRAMPC0_SRAM2PM1_Pos) /*!< SYS_T::SRAMPC0: SRAM2PM1 Mask */ - -#define SYS_SRAMPC0_PCBUSY_Pos (31) /*!< SYS_T::SRAMPC0: PCBUSY Position */ -#define SYS_SRAMPC0_PCBUSY_Msk (0x1ul << SYS_SRAMPC0_PCBUSY_Pos) /*!< SYS_T::SRAMPC0: PCBUSY Mask */ - -#define SYS_SRAMPC1_SRAM2PM2_Pos (0) /*!< SYS_T::SRAMPC1: SRAM2PM2 Position */ -#define SYS_SRAMPC1_SRAM2PM2_Msk (0x3ul << SYS_SRAMPC1_SRAM2PM2_Pos) /*!< SYS_T::SRAMPC1: SRAM2PM2 Mask */ - -#define SYS_SRAMPC1_SRAM2PM3_Pos (2) /*!< SYS_T::SRAMPC1: SRAM2PM3 Position */ -#define SYS_SRAMPC1_SRAM2PM3_Msk (0x3ul << SYS_SRAMPC1_SRAM2PM3_Pos) /*!< SYS_T::SRAMPC1: SRAM2PM3 Mask */ - -#define SYS_SRAMPC1_SRAM2PM4_Pos (4) /*!< SYS_T::SRAMPC1: SRAM2PM4 Position */ -#define SYS_SRAMPC1_SRAM2PM4_Msk (0x3ul << SYS_SRAMPC1_SRAM2PM4_Pos) /*!< SYS_T::SRAMPC1: SRAM2PM4 Mask */ - -#define SYS_SRAMPC1_SRAM2PM5_Pos (6) /*!< SYS_T::SRAMPC1: SRAM2PM5 Position */ -#define SYS_SRAMPC1_SRAM2PM5_Msk (0x3ul << SYS_SRAMPC1_SRAM2PM5_Pos) /*!< SYS_T::SRAMPC1: SRAM2PM5 Mask */ - -#define SYS_SRAMPC1_CAN_Pos (16) /*!< SYS_T::SRAMPC1: CAN Position */ -#define SYS_SRAMPC1_CAN_Msk (0x3ul << SYS_SRAMPC1_CAN_Pos) /*!< SYS_T::SRAMPC1: CAN Mask */ - -#define SYS_SRAMPC1_USBD_Pos (18) /*!< SYS_T::SRAMPC1: USBD Position */ -#define SYS_SRAMPC1_USBD_Msk (0x3ul << SYS_SRAMPC1_USBD_Pos) /*!< SYS_T::SRAMPC1: USBD Mask */ - -#define SYS_SRAMPC1_PDMA0_Pos (20) /*!< SYS_T::SRAMPC1: PDMA0 Position */ -#define SYS_SRAMPC1_PDMA0_Msk (0x3ul << SYS_SRAMPC1_PDMA0_Pos) /*!< SYS_T::SRAMPC1: PDMA0 Mask */ - -#define SYS_SRAMPC1_PDMA1_Pos (22) /*!< SYS_T::SRAMPC1: PDMA1 Position */ -#define SYS_SRAMPC1_PDMA1_Msk (0x3ul << SYS_SRAMPC1_PDMA1_Pos) /*!< SYS_T::SRAMPC1: PDMA1 Mask */ - -#define SYS_SRAMPC1_FMCCACHE_Pos (24) /*!< SYS_T::SRAMPC1: FMCCACHE Position */ -#define SYS_SRAMPC1_FMCCACHE_Msk (0x3ul << SYS_SRAMPC1_FMCCACHE_Pos) /*!< SYS_T::SRAMPC1: FMCCACHE Mask */ - -#define SYS_SRAMPC1_RSA_Pos (26) /*!< SYS_T::SRAMPC1: RSA Position */ -#define SYS_SRAMPC1_RSA_Msk (0x3ul << SYS_SRAMPC1_RSA_Pos) /*!< SYS_T::SRAMPC1: RSA Mask */ - -#define SYS_SRAMPC1_KS_Pos (28) /*!< SYS_T::SRAMPC1: KS Position */ -#define SYS_SRAMPC1_KS_Msk (0x3ul << SYS_SRAMPC1_KS_Pos) /*!< SYS_T::SRAMPC1: KS Mask */ - -#define SYS_SRAMPC1_PCBUSY_Pos (31) /*!< SYS_T::SRAMPC1: PCBUSY Position */ -#define SYS_SRAMPC1_PCBUSY_Msk (0x1ul << SYS_SRAMPC1_PCBUSY_Pos) /*!< SYS_T::SRAMPC1: PCBUSY Mask */ - -#define SYS_TCTL48M_FREQSEL_Pos (0) /*!< SYS_T::TCTL48M: FREQSEL Position */ -#define SYS_TCTL48M_FREQSEL_Msk (0x3ul << SYS_TCTL48M_FREQSEL_Pos) /*!< SYS_T::TCTL48M: FREQSEL Mask */ - -#define SYS_TCTL48M_LOOPSEL_Pos (4) /*!< SYS_T::TCTL48M: LOOPSEL Position */ -#define SYS_TCTL48M_LOOPSEL_Msk (0x3ul << SYS_TCTL48M_LOOPSEL_Pos) /*!< SYS_T::TCTL48M: LOOPSEL Mask */ - -#define SYS_TCTL48M_RETRYCNT_Pos (6) /*!< SYS_T::TCTL48M: RETRYCNT Position */ -#define SYS_TCTL48M_RETRYCNT_Msk (0x3ul << SYS_TCTL48M_RETRYCNT_Pos) /*!< SYS_T::TCTL48M: RETRYCNT Mask */ - -#define SYS_TCTL48M_CESTOPEN_Pos (8) /*!< SYS_T::TCTL48M: CESTOPEN Position */ -#define SYS_TCTL48M_CESTOPEN_Msk (0x1ul << SYS_TCTL48M_CESTOPEN_Pos) /*!< SYS_T::TCTL48M: CESTOPEN Mask */ - -#define SYS_TCTL48M_BOUNDEN_Pos (9) /*!< SYS_T::TCTL48M: BOUNDEN Position */ -#define SYS_TCTL48M_BOUNDEN_Msk (0x1ul << SYS_TCTL48M_BOUNDEN_Pos) /*!< SYS_T::TCTL48M: BOUNDEN Mask */ - -#define SYS_TCTL48M_REFCKSEL_Pos (10) /*!< SYS_T::TCTL48M: REFCKSEL Position */ -#define SYS_TCTL48M_REFCKSEL_Msk (0x1ul << SYS_TCTL48M_REFCKSEL_Pos) /*!< SYS_T::TCTL48M: REFCKSEL Mask */ - -#define SYS_TCTL48M_BOUNDARY_Pos (16) /*!< SYS_T::TCTL48M: BOUNDARY Position */ -#define SYS_TCTL48M_BOUNDARY_Msk (0x1ful << SYS_TCTL48M_BOUNDARY_Pos) /*!< SYS_T::TCTL48M: BOUNDARY Mask */ - -#define SYS_TIEN48M_TFAILIEN_Pos (1) /*!< SYS_T::TIEN48M: TFAILIEN Position */ -#define SYS_TIEN48M_TFAILIEN_Msk (0x1ul << SYS_TIEN48M_TFAILIEN_Pos) /*!< SYS_T::TIEN48M: TFAILIEN Mask */ - -#define SYS_TIEN48M_CLKEIEN_Pos (2) /*!< SYS_T::TIEN48M: CLKEIEN Position */ -#define SYS_TIEN48M_CLKEIEN_Msk (0x1ul << SYS_TIEN48M_CLKEIEN_Pos) /*!< SYS_T::TIEN48M: CLKEIEN Mask */ - -#define SYS_TISTS48M_FREQLOCK_Pos (0) /*!< SYS_T::TISTS48M: FREQLOCK Position */ -#define SYS_TISTS48M_FREQLOCK_Msk (0x1ul << SYS_TISTS48M_FREQLOCK_Pos) /*!< SYS_T::TISTS48M: FREQLOCK Mask */ - -#define SYS_TISTS48M_TFAILIF_Pos (1) /*!< SYS_T::TISTS48M: TFAILIF Position */ -#define SYS_TISTS48M_TFAILIF_Msk (0x1ul << SYS_TISTS48M_TFAILIF_Pos) /*!< SYS_T::TISTS48M: TFAILIF Mask */ - -#define SYS_TISTS48M_CLKERRIF_Pos (2) /*!< SYS_T::TISTS48M: CLKERRIF Position */ -#define SYS_TISTS48M_CLKERRIF_Msk (0x1ul << SYS_TISTS48M_CLKERRIF_Pos) /*!< SYS_T::TISTS48M: CLKERRIF Mask */ - -#define SYS_TISTS48M_OVBDIF_Pos (3) /*!< SYS_T::TISTS48M: OVBDIF Position */ -#define SYS_TISTS48M_OVBDIF_Msk (0x1ul << SYS_TISTS48M_OVBDIF_Pos) /*!< SYS_T::TISTS48M: OVBDIF Mask */ - -#define SYS_TCTL12M_FREQSEL_Pos (0) /*!< SYS_T::TCTL12M: FREQSEL Position */ -#define SYS_TCTL12M_FREQSEL_Msk (0x3ul << SYS_TCTL12M_FREQSEL_Pos) /*!< SYS_T::TCTL12M: FREQSEL Mask */ - -#define SYS_TCTL12M_LOOPSEL_Pos (4) /*!< SYS_T::TCTL12M: LOOPSEL Position */ -#define SYS_TCTL12M_LOOPSEL_Msk (0x3ul << SYS_TCTL12M_LOOPSEL_Pos) /*!< SYS_T::TCTL12M: LOOPSEL Mask */ - -#define SYS_TCTL12M_RETRYCNT_Pos (6) /*!< SYS_T::TCTL12M: RETRYCNT Position */ -#define SYS_TCTL12M_RETRYCNT_Msk (0x3ul << SYS_TCTL12M_RETRYCNT_Pos) /*!< SYS_T::TCTL12M: RETRYCNT Mask */ - -#define SYS_TCTL12M_CESTOPEN_Pos (8) /*!< SYS_T::TCTL12M: CESTOPEN Position */ -#define SYS_TCTL12M_CESTOPEN_Msk (0x1ul << SYS_TCTL12M_CESTOPEN_Pos) /*!< SYS_T::TCTL12M: CESTOPEN Mask */ - -#define SYS_TCTL12M_BOUNDEN_Pos (9) /*!< SYS_T::TCTL12M: BOUNDEN Position */ -#define SYS_TCTL12M_BOUNDEN_Msk (0x1ul << SYS_TCTL12M_BOUNDEN_Pos) /*!< SYS_T::TCTL12M: BOUNDEN Mask */ - -#define SYS_TCTL12M_REFCKSEL_Pos (10) /*!< SYS_T::TCTL12M: REFCKSEL Position */ -#define SYS_TCTL12M_REFCKSEL_Msk (0x1ul << SYS_TCTL12M_REFCKSEL_Pos) /*!< SYS_T::TCTL12M: REFCKSEL Mask */ - -#define SYS_TCTL12M_BOUNDARY_Pos (16) /*!< SYS_T::TCTL12M: BOUNDARY Position */ -#define SYS_TCTL12M_BOUNDARY_Msk (0x1ful << SYS_TCTL12M_BOUNDARY_Pos) /*!< SYS_T::TCTL12M: BOUNDARY Mask */ - -#define SYS_TIEN12M_TFAILIEN_Pos (1) /*!< SYS_T::TIEN12M: TFAILIEN Position */ -#define SYS_TIEN12M_TFAILIEN_Msk (0x1ul << SYS_TIEN12M_TFAILIEN_Pos) /*!< SYS_T::TIEN12M: TFAILIEN Mask */ - -#define SYS_TIEN12M_CLKEIEN_Pos (2) /*!< SYS_T::TIEN12M: CLKEIEN Position */ -#define SYS_TIEN12M_CLKEIEN_Msk (0x1ul << SYS_TIEN12M_CLKEIEN_Pos) /*!< SYS_T::TIEN12M: CLKEIEN Mask */ - -#define SYS_TISTS12M_FREQLOCK_Pos (0) /*!< SYS_T::TISTS12M: FREQLOCK Position */ -#define SYS_TISTS12M_FREQLOCK_Msk (0x1ul << SYS_TISTS12M_FREQLOCK_Pos) /*!< SYS_T::TISTS12M: FREQLOCK Mask */ - -#define SYS_TISTS12M_TFAILIF_Pos (1) /*!< SYS_T::TISTS12M: TFAILIF Position */ -#define SYS_TISTS12M_TFAILIF_Msk (0x1ul << SYS_TISTS12M_TFAILIF_Pos) /*!< SYS_T::TISTS12M: TFAILIF Mask */ - -#define SYS_TISTS12M_CLKERRIF_Pos (2) /*!< SYS_T::TISTS12M: CLKERRIF Position */ -#define SYS_TISTS12M_CLKERRIF_Msk (0x1ul << SYS_TISTS12M_CLKERRIF_Pos) /*!< SYS_T::TISTS12M: CLKERRIF Mask */ - -#define SYS_TISTS12M_OVBDIF_Pos (3) /*!< SYS_T::TISTS12M: OVBDIF Position */ -#define SYS_TISTS12M_OVBDIF_Msk (0x1ul << SYS_TISTS12M_OVBDIF_Pos) /*!< SYS_T::TISTS12M: OVBDIF Mask */ - -#define SYS_REGLCTL_REGLCTL_Pos (0) /*!< SYS_T::REGLCTL: REGLCTL Position */ -#define SYS_REGLCTL_REGLCTL_Msk (0xfful << SYS_REGLCTL_REGLCTL_Pos) /*!< SYS_T::REGLCTL: REGLCTL Mask */ - -#define SYS_CPUCFG_INTRTEN_Pos (0) /*!< SYS_T::CPUCFG: INTRTEN Position */ -#define SYS_CPUCFG_INTRTEN_Msk (0x1ul << SYS_CPUCFG_INTRTEN_Pos) /*!< SYS_T::CPUCFG: INTRTEN Mask */ - -#define SYS_OVDCTL_OVDEN_Pos (0) /*!< SYS_T::OVDCTL: OVDEN Position */ -#define SYS_OVDCTL_OVDEN_Msk (0x1ul << SYS_OVDCTL_OVDEN_Pos) /*!< SYS_T::OVDCTL: OVDEN Mask */ - -#define SYS_OVDCTL_OVDSTB_Pos (31) /*!< SYS_T::OVDCTL: OVDSTB Position */ -#define SYS_OVDCTL_OVDSTB_Msk (0x1ul << SYS_OVDCTL_OVDSTB_Pos) /*!< SYS_T::OVDCTL: OVDSTB Mask */ - -#define SYS_PORCTL1_POROFF_Pos (0) /*!< SYS_T::PORCTL1: POROFF Position */ -#define SYS_PORCTL1_POROFF_Msk (0xfffful << SYS_PORCTL1_POROFF_Pos) /*!< SYS_T::PORCTL1: POROFF Mask */ - -#define SYS_PSWCTL_CRPTPWREN_Pos (12) /*!< SYS_T::PSWCTL: CRPTPWREN Position */ -#define SYS_PSWCTL_CRPTPWREN_Msk (0x1ul << SYS_PSWCTL_CRPTPWREN_Pos) /*!< SYS_T::PSWCTL: CRPTPWREN Mask */ - -#define SYS_PLCTL_PLSEL_Pos (0) /*!< SYS_T::PLCTL: PLSEL Position */ -#define SYS_PLCTL_PLSEL_Msk (0x3ul << SYS_PLCTL_PLSEL_Pos) /*!< SYS_T::PLCTL: PLSEL Mask */ - -#define SYS_PLCTL_MVRS_Pos (4) /*!< SYS_T::PLCTL: MVRS Position */ -#define SYS_PLCTL_MVRS_Msk (0x1ul << SYS_PLCTL_MVRS_Pos) /*!< SYS_T::PLCTL: MVRS Mask */ - -#define SYS_PLCTL_WRBUSY_Pos (7) /*!< SYS_T::PLCTL: WRBUSY Position */ -#define SYS_PLCTL_WRBUSY_Msk (0x1ul << SYS_PLCTL_WRBUSY_Pos) /*!< SYS_T::PLCTL: WRBUSY Mask */ - -#define SYS_PLCTL_LVSSTEP_Pos (16) /*!< SYS_T::PLCTL: LVSSTEP Position */ -#define SYS_PLCTL_LVSSTEP_Msk (0x3ful << SYS_PLCTL_LVSSTP_Pos) /*!< SYS_T::PLCTL: LVSSTEP Mask */ - -#define SYS_PLCTL_LVSPRD_Pos (24) /*!< SYS_T::PLCTL: LVSPRD Position */ -#define SYS_PLCTL_LVSPRD_Msk (0xfful << SYS_PLCTL_LVSPRD_Pos) /*!< SYS_T::PLCTL: LVSPRD Mask */ - -#define SYS_PLSTS_PLCBUSY_Pos (0) /*!< SYS_T::PLSTS: PLCBUSY Position */ -#define SYS_PLSTS_PLCBUSY_Msk (0x1ul << SYS_PLSTS_PLCBUSY_Pos) /*!< SYS_T::PLSTS: PLCBUSY Mask */ - -#define SYS_PLSTS_MVRCBUSY_Pos (1) /*!< SYS_T::PLSTS: MVRCBUSY Position */ -#define SYS_PLSTS_MVRCBUSY_Msk (0x1ul << SYS_PLSTS_MVRCBUSY_Pos) /*!< SYS_T::PLSTS: MVRCBUSY Mask */ - -#define SYS_PLSTS_MVRCERR_Pos (2) /*!< SYS_T::PLSTS: MVRCERR Position */ -#define SYS_PLSTS_MVRCERR_Msk (0x1ul << SYS_PLSTS_MVRCERR_Pos) /*!< SYS_T::PLSTS: MVRCERR Mask */ - -#define SYS_PLSTS_LCONS_Pos (3) /*!< SYS_T::PLSTS: LCONS Position */ -#define SYS_PLSTS_LCONS_Msk (0x1ul << SYS_PLSTS_LCONS_Pos) /*!< SYS_T::PLSTS: LCONS Mask */ - -#define SYS_PLSTS_PLSTATUS_Pos (8) /*!< SYS_T::PLSTS: PLSTATUS Position */ -#define SYS_PLSTS_PLSTATUS_Msk (0x3ul << SYS_PLSTS_PLSTATUS_Pos) /*!< SYS_T::PLSTS: PLSTATUS Mask */ - -#define SYS_PLSTS_CURMVR_Pos (12) /*!< SYS_T::PLSTS: CURMVR Position */ -#define SYS_PLSTS_CURMVR_Msk (0x1ul << SYS_PLSTS_CURMVR_Pos) /*!< SYS_T::PLSTS: CURMVR Mask */ - -#define SYS_AHBMCTL_INTACTEN_Pos (0) /*!< SYS_T::AHBMCTL: INTACTEN Position */ -#define SYS_AHBMCTL_INTACTEN_Msk (0x1ul << SYS_AHBMCTL_INTACTEN_Pos) /*!< SYS_T::AHBMCTL: INTACTEN Mask */ - - -/**@}*/ /* SYS_CONST */ -typedef struct -{ - - /** - * @var SYS_INT_T::NMIEN - * Offset: 0x00 NMI Source Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD NMI Source Enable (Write Protect) - * | | |0 = BOD NMI source Disabled. - * | | |1 = BOD NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |IRCINT |IRC TRIM NMI Source Enable (Write Protect) - * | | |0 = IRC TRIM NMI source Disabled. - * | | |1 = IRC TRIM NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PWRWUINT |Power-down Mode Wake-up NMI Source Enable (Write Protect) - * | | |0 = Power-down mode wake-up NMI source Disabled. - * | | |1 = Power-down mode wake-up NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |SRAMPERR |SRAM Parity Check Error NMI Source Enable (Write Protect) - * | | |0 = SRAM parity check error NMI source Disabled. - * | | |1 = SRAM parity check error NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |CLKFAIL |Clock Fail Detected NMI Source Enable (Write Protect) - * | | |0 = Clock fail detected interrupt NMI source Disabled. - * | | |1 = Clock fail detected interrupt NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |RTCINT |RTC NMI Source Enable (Write Protect) - * | | |0 = RTC NMI source Disabled. - * | | |1 = RTC NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |TAMPERINT |Tamper Interrupt NMI Source Enable (Write Protect) - * | | |0 = Backup register tamper detected interrupt NMI source Disabled. - * | | |1 = Backup register tamper detected interrupt NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |EINT0 |External Interrupt From PA.6, or PB.5 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.6, or PB.5 pin NMI source Disabled. - * | | |1 = External interrupt from PA.6, or PB.5 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[9] |EINT1 |External Interrupt From PA.7 or PB.4 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.7 or PB.4 pin NMI source Disabled. - * | | |1 = External interrupt from PA.7 or P4.4 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10] |EINT2 |External Interrupt From PB.3 or PC.6 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.3 or PC.6 pin NMI source Disabled. - * | | |1 = External interrupt from PB.3 or PC.6 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11] |EINT3 |External Interrupt From PB.2 or PC.7 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.2 or PC.7pin NMI source Disabled. - * | | |1 = External interrupt from PB.2 or PC.7 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |EINT4 |External Interrupt From PA.8 or PB.6 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.8 or PB.6 pin NMI source Disabled. - * | | |1 = External interrupt from PA.8 or PB.6 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |EINT5 |External Interrupt From PB.7 or PD.12 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.7 or PD.12 pin NMI source Disabled. - * | | |1 = External interrupt from PB.7 or PD.12 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[14] |UART0INT |UART0 NMI Source Enable (Write Protect) - * | | |0 = UART0 NMI source Disabled. - * | | |1 = UART0 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[15] |UART1INT |UART1 NMI Source Enable (Write Protect) - * | | |0 = UART1 NMI source Disabled. - * | | |1 = UART1 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |EINT6 |External Interrupt From PB.8 or PD.11 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.8 or PD.11 pin NMI source Disabled. - * | | |1 = External interrupt from PB.8 or PD.11 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17] |EINT7 |External Interrupt From PB.9 or PD.10 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.9 or PD.10 pin NMI source Disabled. - * | | |1 = External interrupt from PB.9 or PD.10 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_INT_T::NMISTS - * Offset: 0x04 NMI source interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD Interrupt Flag (Read Only) - * | | |0 = BOD interrupt is de-asserted. - * | | |1 = BOD interrupt is asserted. - * |[1] |IRCINT |IRC TRIM Interrupt Flag (Read Only) - * | | |0 = HIRC TRIM interrupt is de-asserted. - * | | |1 = HIRC TRIM interrupt is asserted. - * |[2] |PWRWUINT |Power-down Mode Wake-up Interrupt Flag (Read Only) - * | | |0 = Power-down mode wake-up interrupt is de-asserted. - * | | |1 = Power-down mode wake-up interrupt is asserted. - * |[3] |SRAMPERR |SRAM Parity Check Error Interrupt Flag (Read Only) - * | | |0 = SRAM parity check error interrupt is de-asserted. - * | | |1 = SRAM parity check error interrupt is asserted. - * |[4] |CLKFAIL |Clock Fail Detected Interrupt Flag (Read Only) - * | | |0 = Clock fail detected interrupt is de-asserted. - * | | |1 = Clock fail detected interrupt is asserted. - * |[6] |RTCINT |RTC Interrupt Flag (Read Only) - * | | |0 = RTC interrupt is de-asserted. - * | | |1 = RTC interrupt is asserted. - * |[7] |TAMPERINT |Tamper Interrupt Flag (Read Only) - * | | |0 = Backup register tamper detected interrupt is de-asserted. - * | | |1 = Backup register tamper detected interrupt is asserted. - * |[8] |EINT0 |External Interrupt From PA.6, or PB.5 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.6, or PB.5 interrupt is deasserted. - * | | |1 = External Interrupt from PA.6, or PB.5 interrupt is asserted. - * |[9] |EINT1 |External Interrupt From PA.7, or PB.4 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.7, or PB.4 interrupt is deasserted. - * | | |1 = External Interrupt from PA.7, or PB.4 interrupt is asserted. - * |[10] |EINT2 |External Interrupt From PB.3 or PC.6 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.3 or PC.6 interrupt is deasserted. - * | | |1 = External Interrupt from PB.3 or PC.6 interrupt is asserted. - * |[11] |EINT3 |External Interrupt From PB.2 or PC.7 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.2 or PC.7 interrupt is deasserted. - * | | |1 = External Interrupt from PB.2 or PC.7 interrupt is asserted. - * |[12] |EINT4 |External Interrupt From PA.8 or PB.6 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.8 or PB.6 interrupt is deasserted. - * | | |1 = External Interrupt from PA.8 or PB.6 interrupt is asserted. - * |[13] |EINT5 |External Interrupt From PB.7 or PD.12 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.7 or PD.12 interrupt is deasserted. - * | | |1 = External Interrupt from PB.7 or PD.12 interrupt is asserted. - * |[14] |UART0INT |UART0 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is de-asserted. - * | | |1 = UART1 interrupt is asserted. - * |[15] |UART1INT |UART1 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is de-asserted. - * | | |1 = UART1 interrupt is asserted. - * |[16] |EINT6 |External Interrupt From PB.8 or PD.11 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.8 or PD.11 interrupt is deasserted. - * | | |1 = External Interrupt from PB.8 or PD.11 interrupt is asserted. - * |[17] |EINT7 |External Interrupt From PB.9 or PD.10 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.9 or PD.10 interrupt is deasserted. - * | | |1 = External Interrupt from PB.9 or PD.10 interrupt is asserted. - */ - - __IO uint32_t NMIEN; /* Offset: 0x00 NMI Source Interrupt Enable Register */ - __I uint32_t NMISTS; /* Offset: 0x04 NMI source interrupt Status Register */ - -} SYS_INT_T; -/** - @addtogroup INT_CONST INT Bit Field Definition - Constant Definitions for INT Controller - @{ -*/ - -#define SYS_NMIEN_BODOUT_Pos (0) /*!< SYS_INT_T::NMIEN: BODOUT Position */ -#define SYS_NMIEN_BODOUT_Msk (0x1ul << SYS_NMIEN_BODOUT_Pos ) /*!< SYS_INT_T::NMIEN: BODOUT Mask */ - -#define SYS_NMIEN_IRCINT_Pos (1) /*!< SYS_INT_T::NMIEN: IRCINT Position */ -#define SYS_NMIEN_IRCINT_Msk (0x1ul << SYS_NMIEN_IRCINT_Pos ) /*!< SYS_INT_T::NMIEN: IRCINT Mask */ - -#define SYS_NMIEN_PWRWUINT_Pos (2) /*!< SYS_INT_T::NMIEN: PWRWUINT Position */ -#define SYS_NMIEN_PWRWUINT_Msk (0x1ul << SYS_NMIEN_PWRWUINT_Pos ) /*!< SYS_INT_T::NMIEN: PWRWUINT Mask */ - -#define SYS_NMIEN_SRAMPERR_Pos (3) /*!< SYS_INT_T::NMIEN: SRAMPERR Position */ -#define SYS_NMIEN_SRAMPERR_Msk (0x1ul << SYS_NMIEN_SRAMPERR_Pos ) /*!< SYS_INT_T::NMIEN: SRAMPERR Mask */ - -#define SYS_NMIEN_CLKFAIL_Pos (4) /*!< SYS_INT_T::NMIEN: CLKFAIL Position */ -#define SYS_NMIEN_CLKFAIL_Msk (0x1ul << SYS_NMIEN_CLKFAIL_Pos ) /*!< SYS_INT_T::NMIEN: CLKFAIL Mask */ - -#define SYS_NMIEN_RTCINT_Pos (6) /*!< SYS_INT_T::NMIEN: RTCINT Position */ -#define SYS_NMIEN_RTCINT_Msk (0x1ul << SYS_NMIEN_RTCINT_Pos ) /*!< SYS_INT_T::NMIEN: RTCINT Mask */ - -#define SYS_NMIEN_TAMPERINT_Pos (7) /*!< SYS_INT_T::NMIEN: TAMPERINT Position */ -#define SYS_NMIEN_TAMPERINT_Msk (0x1ul << SYS_NMIEN_TAMPERINT_Pos ) /*!< SYS_INT_T::NMIEN: TAMPERINT Mask */ - -#define SYS_NMIEN_EINT0_Pos (8) /*!< SYS_INT_T::NMIEN: EINT0 Position */ -#define SYS_NMIEN_EINT0_Msk (0x1ul << SYS_NMIEN_EINT0_Pos ) /*!< SYS_INT_T::NMIEN: EINT0 Mask */ - -#define SYS_NMIEN_EINT1_Pos (9) /*!< SYS_INT_T::NMIEN: EINT1 Position */ -#define SYS_NMIEN_EINT1_Msk (0x1ul << SYS_NMIEN_EINT1_Pos ) /*!< SYS_INT_T::NMIEN: EINT1 Mask */ - -#define SYS_NMIEN_EINT2_Pos (10) /*!< SYS_INT_T::NMIEN: EINT2 Position */ -#define SYS_NMIEN_EINT2_Msk (0x1ul << SYS_NMIEN_EINT2_Pos ) /*!< SYS_INT_T::NMIEN: EINT2 Mask */ - -#define SYS_NMIEN_EINT3_Pos (11) /*!< SYS_INT_T::NMIEN: EINT3 Position */ -#define SYS_NMIEN_EINT3_Msk (0x1ul << SYS_NMIEN_EINT3_Pos ) /*!< SYS_INT_T::NMIEN: EINT3 Mask */ - -#define SYS_NMIEN_EINT4_Pos (12) /*!< SYS_INT_T::NMIEN: EINT4 Position */ -#define SYS_NMIEN_EINT4_Msk (0x1ul << SYS_NMIEN_EINT4_Pos ) /*!< SYS_INT_T::NMIEN: EINT4 Mask */ - -#define SYS_NMIEN_EINT5_Pos (13) /*!< SYS_INT_T::NMIEN: EINT5 Position */ -#define SYS_NMIEN_EINT5_Msk (0x1ul << SYS_NMIEN_EINT5_Pos ) /*!< SYS_INT_T::NMIEN: EINT5 Mask */ - -#define SYS_NMIEN_UART0INT_Pos (14) /*!< SYS_INT_T::NMIEN: UART0INT Position */ -#define SYS_NMIEN_UART0INT_Msk (0x1ul << SYS_NMIEN_UART0INT_Pos ) /*!< SYS_INT_T::NMIEN: UART0INT Mask */ - -#define SYS_NMIEN_UART1INT_Pos (15) /*!< SYS_INT_T::NMIEN: UART1INT Position */ -#define SYS_NMIEN_UART1INT_Msk (0x1ul << SYS_NMIEN_UART1INT_Pos ) /*!< SYS_INT_T::NMIEN: UART1INT Mask */ - -#define SYS_NMIEN_EINT6_Pos (16) /*!< SYS_INT_T::NMIEN: EINT6 Position */ -#define SYS_NMIEN_EINT6_Msk (0x1ul << SYS_NMIEN_EINT6_Pos ) /*!< SYS_INT_T::NMIEN: EINT6 Mask */ - -#define SYS_NMIEN_EINT7_Pos (17) /*!< SYS_INT_T::NMIEN: EINT7 Position */ -#define SYS_NMIEN_EINT7_Msk (0x1ul << SYS_NMIEN_EINT7_Pos ) /*!< SYS_INT_T::NMIEN: EINT7 Mask */ - -#define SYS_NMISTS_BODOUT_Pos (0) /*!< SYS_INT_T::NMISTS: BODOUT Position */ -#define SYS_NMISTS_BODOUT_Msk (0x1ul << SYS_NMISTS_BODOUT_Pos ) /*!< SYS_INT_T::NMISTS: BODOUT Mask */ - -#define SYS_NMISTS_IRCINT_Pos (1) /*!< SYS_INT_T::NMISTS: IRCINT Position */ -#define SYS_NMISTS_IRCINT_Msk (0x1ul << SYS_NMISTS_IRCINT_Pos ) /*!< SYS_INT_T::NMISTS: IRCINT Mask */ - -#define SYS_NMISTS_PWRWUINT_Pos (2) /*!< SYS_INT_T::NMISTS: PWRWUINT Position */ -#define SYS_NMISTS_PWRWUINT_Msk (0x1ul << SYS_NMISTS_PWRWUINT_Pos ) /*!< SYS_INT_T::NMISTS: PWRWUINT Mask */ - -#define SYS_NMISTS_SRAMPERR_Pos (3) /*!< SYS_INT_T::NMISTS: SRAMPERR Position */ -#define SYS_NMISTS_SRAMPERR_Msk (0x1ul << SYS_NMISTS_SRAMPERR_Pos ) /*!< SYS_INT_T::NMISTS: SRAMPERR Mask */ - -#define SYS_NMISTS_CLKFAIL_Pos (4) /*!< SYS_INT_T::NMISTS: CLKFAIL Position */ -#define SYS_NMISTS_CLKFAIL_Msk (0x1ul << SYS_NMISTS_CLKFAIL_Pos ) /*!< SYS_INT_T::NMISTS: CLKFAIL Mask */ - -#define SYS_NMISTS_RTCINT_Pos (6) /*!< SYS_INT_T::NMISTS: RTCINT Position */ -#define SYS_NMISTS_RTCINT_Msk (0x1ul << SYS_NMISTS_RTCINT_Pos ) /*!< SYS_INT_T::NMISTS: RTCINT Mask */ - -#define SYS_NMISTS_TAMPERINT_Pos (7) /*!< SYS_INT_T::NMISTS: TAMPERINT Position */ -#define SYS_NMISTS_TAMPERINT_Msk (0x1ul << SYS_NMISTS_TAMPERINT_Pos ) /*!< SYS_INT_T::NMISTS: TAMPERINT Mask */ - -#define SYS_NMISTS_EINT0_Pos (8) /*!< SYS_INT_T::NMISTS: EINT0 Position */ -#define SYS_NMISTS_EINT0_Msk (0x1ul << SYS_NMISTS_EINT0_Pos ) /*!< SYS_INT_T::NMISTS: EINT0 Mask */ - -#define SYS_NMISTS_EINT1_Pos (9) /*!< SYS_INT_T::NMISTS: EINT1 Position */ -#define SYS_NMISTS_EINT1_Msk (0x1ul << SYS_NMISTS_EINT1_Pos ) /*!< SYS_INT_T::NMISTS: EINT1 Mask */ - -#define SYS_NMISTS_EINT2_Pos (10) /*!< SYS_INT_T::NMISTS: EINT2 Position */ -#define SYS_NMISTS_EINT2_Msk (0x1ul << SYS_NMISTS_EINT2_Pos ) /*!< SYS_INT_T::NMISTS: EINT2 Mask */ - -#define SYS_NMISTS_EINT3_Pos (11) /*!< SYS_INT_T::NMISTS: EINT3 Position */ -#define SYS_NMISTS_EINT3_Msk (0x1ul << SYS_NMISTS_EINT3_Pos ) /*!< SYS_INT_T::NMISTS: EINT3 Mask */ - -#define SYS_NMISTS_EINT4_Pos (12) /*!< SYS_INT_T::NMISTS: EINT4 Position */ -#define SYS_NMISTS_EINT4_Msk (0x1ul << SYS_NMISTS_EINT4_Pos ) /*!< SYS_INT_T::NMISTS: EINT4 Mask */ - -#define SYS_NMISTS_EINT5_Pos (13) /*!< SYS_INT_T::NMISTS: EINT5 Position */ -#define SYS_NMISTS_EINT5_Msk (0x1ul << SYS_NMISTS_EINT5_Pos ) /*!< SYS_INT_T::NMISTS: EINT5 Mask */ - -#define SYS_NMISTS_UART0INT_Pos (14) /*!< SYS_INT_T::NMISTS: UART0_INT Position */ -#define SYS_NMISTS_UART0INT_Msk (0x1ul << SYS_NMISTS_UART0INT_Pos ) /*!< SYS_INT_T::NMISTS: UART0_INT Mask */ - -#define SYS_NMISTS_UART1INT_Pos (15) /*!< SYS_INT_T::NMISTS: UART1_INT Position */ -#define SYS_NMISTS_UART1INT_Msk (0x1ul << SYS_NMISTS_UART1INT_Pos ) /*!< SYS_INT_T::NMISTS: UART1_INT Mask */ - -#define SYS_NMISTS_EINT6_Pos (16) /*!< SYS_INT_T::NMISTS: EINT6 Position */ -#define SYS_NMISTS_EINT6_Msk (0x1ul << SYS_NMISTS_EINT6_Pos ) /*!< SYS_INT_T::NMISTS: EINT6 Mask */ - -#define SYS_NMISTS_EINT7_Pos (17) /*!< SYS_INT_T::NMISTS: EINT7 Position */ -#define SYS_NMISTS_EINT7_Msk (0x1ul << SYS_NMISTS_EINT7_Pos ) /*!< SYS_INT_T::NMISTS: EINT7 Mask */ - - -/**@}*/ /* INT_CONST */ -/**@}*/ /* end of SYS register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __SYS_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h deleted file mode 100644 index edf1e3e6e5f..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************//** - * @file system_M2354.h - * @version V3.00 - * @brief System Setting Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __SYSTEM_M2354_H__ -#define __SYSTEM_M2354_H__ - -#ifdef __cplusplus -extern "C" { -#endif -/*---------------------------------------------------------------------------------------------------------*/ -/* Macro Definition */ -/*---------------------------------------------------------------------------------------------------------*/ -#ifndef DEBUG_PORT -# define DEBUG_PORT UART0 /*!< Select Debug Port which is used for retarget.c to output debug message to UART */ -#endif - - -/* Init ETM Interface Multi-function Pins */ -#define ETM_INIT() { \ - SYS->GPC_MFPL &= ~(SYS_GPC_MFPL_PC0MFP_ETM_TRACE_Msk | SYS_GPC_MFPL_PC1MFP_ETM_TRACE_Msk | \ - SYS_GPC_MFPL_PC2MFP_ETM_TRACE_Msk | SYS_GPC_MFPL_PC3MFP_ETM_TRACE_Msk | \ - SYS_GPC_MFPL_PC4MFP_ETM_TRACE_Msk); \ - SYS->GPC_MFPL |= SYS_GPC_MFPL_PC0MFP_ETM_TRACE_CLK | SYS_GPC_MFPL_PC1MFP_ETM_TRACE_DATA0 | \ - SYS_GPC_MFPL_PC2MFP_ETM_TRACE_DATA1 | SYS_GPC_MFPL_PC3MFP_ETM_TRACE_DATA2 | \ - SYS_GPC_MFPL_PC4MFP_ETM_TRACE_DATA3;} - - - - - -/** - * - * @details This is used to enable PLL to speed up booting at startup. Remove it will cause system using - * default clock source (External crystal or internal 22.1184MHz IRC). - * Enable this option will cause system booting in 72MHz(By XTAL) or 71.8848MHz(By IRC22M) according to - * user configuration setting in CONFIG0 - * - */ - -/* -#define INIT_SYSCLK_AT_BOOTING -*/ - -/*---------------------------------------------------------------------------- - Define SYSCLK - *----------------------------------------------------------------------------*/ -#ifndef __HXT -#define __HXT (12000000UL) /*!< External Crystal Clock Frequency */ -#endif - -#define __LIRC (32000UL) /*!< Internal 32K RC Oscillator Frequency */ -#define __HIRC (12000000UL) /*!< Internal 12M RC Oscillator Frequency */ - -#ifndef __LXT -#define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */ -#endif - -#ifndef __HSI -#define __HSI (48000000UL) /*!< PLL Output Clock Frequency */ -#endif - -#define __HIRC48 (48000000UL) /*!< Internal 48M RC Oscillator Frequency */ -#define __LIRC32 (32000UL) /*!< Internal 32K RC Oscillator Frequency */ -#define __MIRC (4000000UL) /*!< Internal 4M RC Oscillator Frequency */ - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3L) -# if defined (__ICCARM__) -# define __NONSECURE_ENTRY __cmse_nonsecure_entry -# define __NONSECURE_ENTRY_WEAK __cmse_nonsecure_entry //__weak -# define __NONSECURE_CALL __cmse_nonsecure_call -# else -# define __NONSECURE_ENTRY __attribute__((cmse_nonsecure_entry)) -# define __NONSECURE_ENTRY_WEAK __attribute__((cmse_nonsecure_entry,weak)) -# define __NONSECURE_CALL __attribute__((cmse_nonsecure_call)) -# endif -#else -# define __NONSECURE_ENTRY -# define __NONSECURE_ENTRY_WEAK -# define __NONSECURE_CALL -#endif - - - -extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ -extern uint32_t CyclesPerUs; /*!< Cycles per micro second */ -extern uint32_t PllClock; /*!< PLL Output Clock Frequency */ -extern uint32_t __PC(void); /*!< Return the current program counter value */ - -#if USE_ASSERT -/** - * @brief Assert Function - * - * @param[in] expr Expression to be evaluated - * - * @details If the expression is false, an error message will be printed out - * from debug port (UART0 or UART1). - */ -#define ASSERT_PARAM(expr) { if (!(expr)) { AssertError((uint8_t*)__FILE__, __LINE__); } } - -void AssertError(uint8_t *file, uint32_t line); -#else -#define ASSERT_PARAM(expr) -#endif - -#define assert_param(expr) ASSERT_PARAM(expr) - - -/** - * @brief System Initialization - * - * @details The necessary initialization of system. - */ -extern void SystemInit(void); - - -/** - * @brief Update the Variable SystemCoreClock - * - * @details This function is used to update the variable SystemCoreClock - * and must be called whenever the core clock is changed. - */ -extern void SystemCoreClockUpdate(void); - - - - -#if (defined(__ICCARM__) && (__VER__ >= 7080000) && (__VER__ < 8020000)) -uint32_t __TZ_get_PSP_NS(void); -void __TZ_set_PSP_NS(uint32_t topOfProcStack); -int32_t __TZ_get_MSP_NS(void); -void __TZ_set_MSP_NS(uint32_t topOfMainStack); -uint32_t __TZ_get_PRIMASK_NS(void); -void __TZ_set_PRIMASK_NS(uint32_t priMask); -#endif - - - -#ifdef __cplusplus -} -#endif - -#endif /* __SYSTEM_M2354_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/tamper_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/tamper_reg.h deleted file mode 100644 index 147bef87c26..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/tamper_reg.h +++ /dev/null @@ -1,1042 +0,0 @@ -/**************************************************************************//** - * @file tamper_reg.h - * @version V1.00 - * @brief Tamper register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TAMPER_REG_H__ -#define __TAMPER_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------------- Tamper Controller ----------------------------*/ -/** - @addtogroup Tamper Controller(TAMPER) - Memory Mapped Structure for Tamper Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var TAMPER_T::INIT - * Offset: 0x00 Tamper Function Initiation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TCORERST |Tamper Core Reset - * | | |0 = Write 0x5500; the Tamper core block reset will be released. - * | | |1 = Write 0x55AA; the Tamper core block will be reset. - * |[31] |TLDORDY |Voltage Regulator Power Ready (Read Only) - * | | |0 = The power status of voltage regulator is not ready. - * | | |1 = The power status of voltage regulator is ready. - * @var TAMPER_T::FUNEN - * Offset: 0x04 Tamper Block Function Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LXTDETEN |LXT Clock Detection Enable Bit - * | | |0 = Write 0x40; the LXT clock detection Disabled. - * | | |1 = Write 0x44; the LXT clock detection Enabled. - * |[13:8] |TMPIOSEL |Tamper I/O Detection Selection Bit - * | | |0 = Write 0x90/0xA0/0xB0/0xC0/0xD0/0xE0 for tamper I/O 0~5; the I/O tamper function is detected through RTC block. - * | | |1 = Write 0x94/0xA4/0xB4/0xC4/0xD4/0xE4 for tamper I/O 0~5; the I/O tamper function is detected through Tamper block. - * |[23:16] |HIRC48MEN |HIRC48M Enable Bit - * | | |The HIRC48M is disabled when these bits equal 0x5A, otherwise it will be enabled with any other values. - * |[24] |VGCHEN0 |Voltage Glitch Channel 0 Enable Bit - * | | |0 = Voltage glitch channel 0 Disabled. - * | | |1 = Voltage glitch channel 0 Enabled. - * | | |Note: To avoid the voltage glitch when the voltage channel is enabled, it is better to detect the voltage glitch about 150us after the channel is enabled. - * |[25] |VGCHEN1 |Voltage Glitch Channel 1 Enable Bit - * | | |0 = Voltage glitch channel 1 Disabled. - * | | |1 = Voltage glitch channel 1 Enabled. - * | | |Note: To avoid the voltage glitch when the voltage channel is enabled, it is better to detect the voltage glitch about 150us after the channel is enabled. - * |[26] |VGCHEN2 |Voltage Glitch Channel 2 Enable Bit - * | | |0 = Voltage glitch channel 2 Disabled. - * | | |1 = Voltage glitch channel 2 Enabled. - * | | |Note: To avoid the voltage glitch when the voltage channel is enabled, it is better to detect the voltage glitch about 150us after the channel is enabled. - * |[27] |VGCHEN3 |Voltage Glitch Channel 3 Enable Bit - * | | |0 = Voltage glitch channel 3 Disabled. - * | | |1 = Voltage glitch channel 3 Enabled. - * | | |Note: To avoid the voltage glitch when the voltage channel is enabled, it is better to detect the voltage glitch about 150us after the channel is enabled. - * @var TAMPER_T::TRIEN - * Offset: 0x08 Tamper Trigger Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |KSTRIGEN |Key Store Trigger Enable Bit - * | | |0 = Tamper event is detected and to trigger Key Store Disabled. - * | | |1 = Tamper event is detected and to trigger Key Store Enabled. - * |[2] |WAKEUPEN |Wakeup Enable Bit - * | | |0 = Tamper wakeup event Disabled. - * | | |1 = Tamper wakeup event Enabled. - * |[3] |CRYPTOEN |Crypto Enable Bit - * | | |0 = Tamper event clear Crypto Disabled. - * | | |1 = Tamper event clear Crypto Enabled. - * |[4] |CHIPRSTEN |Chip Reset Enable Bit - * | | |0 = Tamper event trigger chip reset Disabled. - * | | |1 = Tamper event trigger chip reset Enabled. - * |[5] |RTCSPCLREN|RTC Spare Register Clear Enable Bit - * | | |0 = Tamper event trigger RTC spare register reset Disabled. - * | | |1 = Tamper event trigger RTC spare register reset Enabled. - * @var TAMPER_T::INTEN - * Offset: 0x0C Tamper Event Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TAMP0IEN |Tamper 0 Event Interrupt Enable Bit - * | | |0 = Tamper 0 event interrupt Disabled. - * | | |1 = Tamper 0 event interrupt Enabled. - * |[1] |TAMP1IEN |Tamper 1 or Pair 0 Event Interrupt Enable Bit - * | | |0 = Tamper 1 or Pair 0 event interrupt Disabled. - * | | |1 = Tamper 1 or Pair 0 event interrupt Enabled. - * |[2] |TAMP2IEN |Tamper 2 Event Interrupt Enable Bit - * | | |0 = Tamper 2 event interrupt Disabled. - * | | |1 = Tamper 2 event interrupt Enabled. - * |[3] |TAMP3IEN |Tamper 3 or Pair 1 Event Interrupt Enable Bit - * | | |0 = Tamper 3 or Pair 1 event interrupt Disabled. - * | | |1 = Tamper 3 or Pair 1 event interrupt Enabled. - * |[4] |TAMP4IEN |Tamper 4 Event Interrupt Enable Bit - * | | |0 = Tamper 4 event interrupt Disabled. - * | | |1 = Tamper 4 event interrupt Enabled. - * |[5] |TAMP5IEN |Tamper 5 or Pair 2 Event Interrupt Enable Bit - * | | |0 = Tamper 5 or Pair 2 event interrupt Disabled. - * | | |1 = Tamper 5 or Pair 2 event interrupt Enabled. - * |[6] |CLKFIEN |LXT Clock Frequency Monitor Fail Event Interrupt Enable Bit - * | | |0 = LXT frequency fail event interrupt Disabled. - * | | |1 = LXT frequency fail event interrupt Enabled. - * |[7] |CLKSTOPIEN|LXT Clock Frequency Monitor Stop Event Interrupt Enable Bit - * | | |0 = LXT frequency stop event interrupt Disabled. - * | | |1 = LXT frequency stop event interrupt Enabled. - * |[8] |OVPIEN |VDD Over Voltage Protect Detection Interrupt Enable Bit - * | | |0 = Detect VDD over voltage protect detection interrupt Disabled. - * | | |1 = Detect VDD over voltage protect detection interrupt Enabled. - * | | |Note: The function enable of the over voltage detection is defined in system manager. - * |[9] |VGPIEN |Voltage Glitch Positive Detection Event Interrupt Enable Bit - * | | |0 = LDO_CAP positive glitch event interrupt Disabled. - * | | |1 = LDO_CAP positive glitch event interrupt Enabled. - * |[10] |VGNIEN |Voltage Glitch Negative Detection Event Interrupt Enable Bit - * | | |0 = LDO_CAP negative glitch event interrupt Disabled. - * | | |1 = LDO_CAP negative glitch event interrupt Enabled. - * |[11] |ACTSIEN |Active Shield Event Interrupt Enable Bit - * | | |0 = Active shield event interrupt Disabled. - * | | |1 = Active shield event interrupt Enabled. - * |[16] |RTCLVRIEN |RTC Low Voltage Detection Event Interrupt Enable Bit - * | | |0 = VBAT low voltage detection event interrupt Disabled. - * | | |1 = VBAT low voltage detection event interrupt Enabled. - * |[17] |RTCIOIEN |RTC Tamper I/O Event Interrupt Enable Bit - * | | |0 = RTC tamper I/O detection event interrupt Disabled. - * | | |1 = RTC tamper I/O detection event interrupt Enabled. - * |[18] |RTCLKIEN |RTC Clock Monitor Detection Event Interrupt Enable Bit - * | | |0 = RTC clock monitor event interrupt Disabled. - * | | |1 = RTC clock monitor event interrupt Enabled. - * |[22] |BODIEN |BOD Event Interrupt Enable Bit - * | | |0 = Brown-out event interrupt Disabled. - * | | |1 = Brown-out event interrupt Enabled. - * @var TAMPER_T::INTSTS - * Offset: 0x10 Tamper Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TAMP0IF |Tamper 0 Event Interrupt Flag - * | | |0 = No Tamper 0 event interrupt flag is generated. - * | | |1 = Tamper 0 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[1] |TAMP1IF |Tamper 1 Event Interrupt Flag - * | | |0 = No Tamper 1 event interrupt flag is generated. - * | | |1 = Tamper 1 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[2] |TAMP2IF |Tamper 2 Event Interrupt Flag - * | | |0 = No Tamper 2 event interrupt flag is generated. - * | | |1 = Tamper 2 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[3] |TAMP3IF |Tamper 3 Event Interrupt Flag - * | | |0 = No Tamper 3 event interrupt flag is generated. - * | | |1 = Tamper 3 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[4] |TAMP4IF |Tamper 4 Event Interrupt Flag - * | | |0 = No Tamper 4 event interrupt flag is generated. - * | | |1 = Tamper 4 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[5] |TAMP5IF |Tamper 5 Event Interrupt Flag - * | | |0 = No Tamper 5 event interrupt flag is generated. - * | | |1 = Tamper 5 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[6] |CLKFAILIF |LXT Clock Frequency Monitor Fail Event Interrupt Flag - * | | |0 = LXT frequency is normal. - * | | |1 = LXT frequency is abnormal. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: LXT detector will be automatically disabled when Fail/Stop flag rises, and resumes after Fail/Stop flag is cleared. - * |[7] |CLKSTOPIF |LXT Clock Frequency Monitor Stop Event Interrupt Flag - * | | |0 = LXT frequency is normal. - * | | |1 = LXT frequency is almost stopped. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: LXT detector will be automatically disabled when Fail/Stop flag rises, and resumes after Fail/Stop flag is cleared. - * |[8] |OVPOUTIF |VDD Over Voltage Event Interrupt Flag - * | | |0 = VDD no over voltage is detected. - * | | |1 = VDD over voltage is detected. - * | | |Note: Write 1 to clear this bit. - * |[9] |VGPEVIF |Voltage Glitch Positive Detection Interrupt Flag - * | | |0 = LDO_CAP positive glitch is not detected. - * | | |1 = LDO_CAP positive glitch is detected. - * | | |Note: It can be written 1 to clear only (No clear by TCORERST) - * |[10] |VGNEVIF |Voltage Glitch Negative Detection Interrupt Flag - * | | |0 = LDO_CAP negative glitch is not detected. - * | | |1 = LDO_CAP negative glitch is detected. - * | | |Note: It can be written 1 to clear only (No clear by TCORERST) - * |[11] |ACTSEIF |Active Shield Event Detection Interrupt Flag - * | | |0 = Active shield event interrupt flag is not detected. - * | | |1 = Active shield event interrupt flag is detected including the voltage of voltage regulator and GND attack. - * | | |Note: Write 1 to clear this bit after all of ACTSTxIF bits have been cleaned. - * |[13] |ACTST5IF |Active Shield Tamper 5 Event Interrupt Flag - * | | |0 = No Active shield Tamper 5 event interrupt flag is generated. - * | | |1 = Active shield Tamper 5 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[15] |ACTST25IF |Active Shield Tamper 5 Event Interrupt Flag - * | | |0 = No Active shield Tamper 5 event interrupt flag is generated. - * | | |1 = 2th Active shield Tamper 5 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[16] |RTCLVRIF |RTC Low Voltage Detection Event Interrupt Flag - * | | |0 = VBAT low voltage detection event interrupt flag is not detected. - * | | |1 = VBAT low voltage detection event interrupt flag is detected. - * |[17] |RIOTRIGIF |RTC Tamper I/O Event Interrupt Flag - * | | |0 = There is no RTC tamper I/O detection event interrupt flag. - * | | |1 = There is RTC tamper I/O detection event interrupt flag. - * |[18] |RCLKTRIGIF|RTC Clock Monitor Detection Event Interrupt Flag - * | | |0 = There is no RTC clock monitor detection event interrupt flag. - * | | |1 = There is RTC clock monitor detection event interrupt flag. - * |[22] |BODIF |BOD Event Interrupt Flag - * | | |0 = Brown-out event interrupt flag is no detected. - * | | |1 = Brown-out interrupt flag is detected. - * | | |Note: It is used to detect the LDO_CAP. Write 1 to clear this bit. - * |[25] |ACTST1IF |Active Shield Tamper 1 Event Interrupt Flag - * | | |0 = No Active shield Tamper 1 event interrupt flag is generated. - * | | |1 = Active shield Tamper 1 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[27] |ACTST3IF |Active Shield Tamper 3 Event Interrupt Flag - * | | |0 = No Active shield Tamper 3 event interrupt flag is generated. - * | | |1 = Active shield Tamper 3 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[29] |ACTST21IF |2th Active Shield Tamper 1 Event Interrupt Flag - * | | |0 = No Active shield Tamper 1 event interrupt flag is generated. - * | | |1 = 2th Active shield Tamper 1 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * |[31] |ACTST23IF |2th Active Shield Tamper 3 Event Interrupt Flag - * | | |0 = No Active shield Tamper 3 event interrupt flag is generated. - * | | |1 = 2th Active shield Tamper 3 event interrupt flag is generated. - * | | |Note: Write 1 to clear this bit. - * @var TAMPER_T::LIRCTL - * Offset: 0x14 Tamper LIRC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |TLRCTRIM |Tamper TLIRC32K Trim Value - * | | |TLIRC32K trim value setting - * |[10:9] |TRIMMOS |Tamper TLIRC32K Trim MOS Value - * | | |TLIRC32K trim MOS value setting - * @var TAMPER_T::TIOCTL - * Offset: 0x18 Tamper I/O Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DYN1ISS |Dynamic Pair 1 Input Source Select - * | | |This bit determines Tamper 3 input is from Tamper 2 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 2. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit is effective only when DYNPR1EN (TAMPER_TIOCTL[23]) and DYNPR0EN (TAMPER_TIOCTL[15]) are set. - * |[1] |DYN2ISS |Dynamic Pair 2 Input Source Select - * | | |This bit determines Tamper 5 input is from Tamper 4 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 4. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit has effect only when DYNPR2EN (TAMPER_TIOCTL[31]) and DYNPR0EN (TAMPER_TIOCTL[15]) are set. - * |[3] |DYNSRC |Dynamic Reference Pattern - * | | |This field determines the new reference pattern when current pattern run out in dynamic pair mode. - * | | |0 = The new reference pattern is generated by random number generator when the reference pattern run out. - * | | |1 = The new reference pattern is repeated from SEED (TAMPER_SEED[31:0]) when the reference pattern run out. - * | | |Note: After this bit is modified, the SEEDRLD (TAMPER_TIOCTL[4]) should be set. - * |[4] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |Setting this bit, the tamper configuration will be reloaded. - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * | | |Note 1: Before this bit is set, the tamper configuration should be set to complete and this bit will be auto clear to 0 after reload new seed completed. - * | | |Note 2: The reference is RTC-clock. Tamper detector needs sync 2 ~ 3 RTC-clock. - * |[7:5] |DYNRATE |Dynamic Change Rate - * | | |This item is choice the dynamic tamper output change rate. - * | | |000 = 26 * RTC_CLK. - * | | |001 = 27 * RTC_CLK. - * | | |010 = 28 * RTC_CLK. - * | | |011 = 29 * RTC_CLK. - * | | |100 = 210 * RTC_CLK. - * | | |101 = 211 * RTC_CLK. - * | | |110 = 212 * RTC_CLK. - * | | |111 = 213 * RTC_CLK. - * | | |Note: After revising this field, setting SEEDRLD (TAMPER_TIOCTL[4]) can reload change rate immediately. - * |[8] |TAMP0EN |Tamper0 Detect Enable Bit - * | | |0 = Tamper 0 detect Disabled. - * | | |1 = Tamper 0 detect Enabled. - * | | |Note: The reference is RTC-clock. Tamper detector needs sync 2 ~ 3 RTC-clock. - * |[9] |TAMP0LV |Tamper 0 Level - * | | |This bit depends on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[10] |TAMP0DBEN |Tamper 0 De-bounce Enable Bit - * | | |0 = Tamper 0 de-bounce Disabled. - * | | |1 = Tamper 0 de-bounce Enabled. Tamper detection pin will sync 1 RTC clock. - * |[12] |TAMP1EN |Tamper 1 Detect Enable Bit - * | | |0 = Tamper 1 detect Disabled. - * | | |1 = Tamper 1 detect Enabled. - * | | |Note: The reference is RTC-clock. Tamper detector needs sync 2 ~ 3 RTC-clock. - * |[13] |TAMP1LV |Tamper 1 Level - * | | |This bit depends on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[14] |TAMP1DBEN |Tamper 1 De-bounce Enable Bit - * | | |0 = Tamper 1 de-bounce Disabled. - * | | |1 = Tamper 1 de-bounce Enabled, tamper detection pin will sync 1 RTC clock. - * |[15] |DYNPR0EN |Dynamic Pair 0 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * |[16] |TAMP2EN |Tamper 2 Detect Enable Bit - * | | |0 = Tamper 2 detect Disabled. - * | | |1 = Tamper 2 detect Enabled. - * | | |Note: The reference is RTC-clock. Tamper detector need sync 2 ~ 3 RTC-clock. - * |[17] |TAMP2LV |Tamper 2 Level - * | | |This bit depends on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[18] |TAMP2DBEN |Tamper 2 De-bounce Enable Bit - * | | |0 = Tamper 2 de-bounce Disabled. - * | | |1 = Tamper 2 de-bounce Enabled. Tamper detection pin will sync 1 RTC clock. - * |[20] |TAMP3EN |Tamper 3 Detect Enable Bit - * | | |0 = Tamper 3 detect Disabled. - * | | |1 = Tamper 3 detect Enabled. - * | | |Note: The reference is RTC-clock. Tamper detector needs sync 2 ~ 3 RTC-clock. - * |[21] |TAMP3LV |Tamper 3 Level - * | | |This bit depends on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[22] |TAMP3DBEN |Tamper 3 De-bounce Enable Bit - * | | |0 = Tamper 3 de-bounce Disabled. - * | | |1 = Tamper 3 de-bounce Enabled. Tamper detection pin will sync 1 RTC clock. - * |[23] |DYNPR1EN |Dynamic Pair 1 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * |[24] |TAMP4EN |Tamper4 Detect Enable Bit - * | | |0 = Tamper 4 detect Disabled. - * | | |1 = Tamper 4 detect Enabled. - * | | |Note: The reference is RTC-clock. Tamper detector needs sync 2 ~ 3 RTC-clock. - * |[25] |TAMP4LV |Tamper 4 Level - * | | |This bit depends on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[26] |TAMP4DBEN |Tamper 4 De-bounce Enable Bit - * | | |0 = Tamper 4 de-bounce Disabled. - * | | |1 = Tamper 4 de-bounce Enabled. Tamper detection pin will sync 1 RTC clock. - * |[28] |TAMP5EN |Tamper 5 Detect Enable Bit - * | | |0 = Tamper 5 detect Disabled. - * | | |1 = Tamper 5 detect Enabled. - * | | |Note: The reference is RTC-clock. Tamper detector needs sync 2 ~ 3 RTC-clock. - * |[29] |TAMP5LV |Tamper 5 Level - * | | |This bit depends on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[30] |TAMP5DBEN |Tamper 5 De-bounce Enable Bit - * | | |0 = Tamper 5 de-bounce Disabled. - * | | |1 = Tamper 5 de-bounce Enabled. Tamper detection pin will sync 1 RTC clock. - * |[31] |DYNPR2EN |Dynamic Pair 2 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * @var TAMPER_T::SEED - * Offset: 0x1C Tamper Seed Value Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed value. - * @var TAMPER_T::SEED2 - * Offset: 0x20 Tamper 2nd Seed Value Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED2 |Seed value. These seed value are used for 2nd active shield I/O. - * @var TAMPER_T::ACTSTIOCTL1 - * Offset: 0x24 Tamper Active Shield Tamper I/O Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADYN1ISS |Active Shied Dynamic Pair 1 Input Source Select - * | | |This bit determines Tamper 3 input is from Tamper 2 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 2. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit is effective only when ADYNPR1EN (TAMPER_ACTSTIOCTL1[23]) and ADYNPR0EN (TAMPER_ACTSTIOCTL1[15]) are set. - * |[3] |ADYNSRC |Active Shied Dynamic Reference Pattern - * | | |This field determines the new reference pattern when current pattern run out in dynamic pair mode. - * | | |0 = The new reference pattern is generated by random number generator when the reference pattern run out. - * | | |1 = The new reference pattern is repeated from SEED (TAMPER_SEED[31:0]) when the reference pattern run out. - * | | |Note: After this bit is modified, the SEEDRLD (TAMPER_TIOCTL[4]) should be set. - * |[7:5] |ADYNRATE |Active Shied Dynamic Change Rate - * | | |Use the bits to choose the dynamic tamper output change rate. - * | | |000 = 210 * TLIRC32K. - * | | |001 = 211 * TLIRC32K. - * | | |010 = 212 * TLIRC32K. - * | | |011 = 213 * TLIRC32K. - * | | |100 = 214 * TLIRC32K. - * | | |101 = 215 * TLIRC32K. - * | | |110 = 216 * TLIRC32K. - * | | |111 = 217 * TLIRC32K. - * | | |Note: After this field is modified, setting SEEDRLD (TAMPER_TIOCTL[4]) can reload the change rate immediately. - * |[8] |ATAMP0EN |Active Shied Tamper0 Detect Enable Bit - * | | |0 = Tamper 0 detect Disabled. - * | | |1 = Tamper 0 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector need sync 2 ~ 3 TLIRC 32K-clock. - * |[12] |ATAMP1EN |Active Shied Tamper 1 Detect Enable Bit - * | | |0 = Tamper 1 detect Disabled. - * | | |1 = Tamper 1 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[15] |ADYNPR0EN |Active Shied Dynamic Pair 0 Enable Bit - * | | |0 = Static detect (Not supported). - * | | |1 = Dynamic detect. - * |[16] |ATAMP2EN |Active Shied Tamper 2 Detect Enable Bit - * | | |0 = Tamper 2 detect Disabled. - * | | |1 = Tamper 2 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[20] |ATAMP3EN |Active Shied Tamper 3 Detect Enable Bit - * | | |0 = Tamper 3 detect Disabled. - * | | |1 = Tamper 3 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[23] |ADYNPR1EN |Active Shied Dynamic Pair 1 Enable Bit - * | | |0 = Static detect (Not supported). - * | | |1 = Dynamic detect. - * |[24] |ATAMP4EN |Active Tamper4 Detect Enable Bit - * | | |0 = Tamper 4 detect Disabled. - * | | |1 = Tamper 4 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector need sync 2 ~ 3 TLIRC 32K-clock. - * |[28] |ATAMP5EN |Active Tamper 5 Detect Enable Bit - * | | |0 = Tamper 5 detect Disabled. - * | | |1 = Tamper 5 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector need sync 2 ~ 3 TLIRC 32K-clock. - * |[31] |ADYNPR2EN |Active Shied Dynamic Pair 2 Enable Bit - * | | |0 = Static detect (Not supported). - * | | |1 = Dynamic detect. - * @var TAMPER_T::ACTSTIOCTL2 - * Offset: 0x28 Tamper Active Shield Tamper I/O Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADYN1ISS2 |Active Shied Dynamic Pair 1 Input Source Select 2 - * | | |This bit determines if Tamper 3 input is from Tamper 2 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 2. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit is effective only when ADYNPR1EN2 (TAMPER_ACTSTIOCTL2[23]) and ADYNPR0EN2 (TAMPER_ACTSTIOCTL2[15]) are set. - * |[3] |ADYNSRC2 |Active Shied Dynamic Reference Pattern 2 - * | | |This field determines the new reference pattern when current pattern run out in dynamic pair mode. - * | | |0 = The new reference pattern is generated by random number generator when the reference pattern run out. - * | | |1 = The new reference pattern is repeated from SEED2 (TAMPER_SEED2[31:0]) when the reference pattern run out. - * | | |Note: After this bit is modified, the SEEDRLD2 (TAMPER_ACTSTIOCTL2[4]) should be set. - * |[4] |SEEDRLD2 |Reload New Seed for PRNG Engine 2 - * | | |Setting this bit, the tamper configuration will be reloaded. - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * | | |Note 1: Before this bit is set, the tamper configuration should be set to complete and this bit will be auto clear to 0 after reload new seed completed. - * | | |Note 2: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[7:5] |ADYNRATE2 |Active Shied Dynamic Change Rate 2 - * | | |Use the bits to choose the dynamic tamper output change rate. - * | | |000 = 210 * TLIRC32K. - * | | |001 = 211 * TLIRC32K. - * | | |010 = 212 * TLIRC32K. - * | | |011 = 213 * TLIRC32K. - * | | |100 = 214 * TLIRC32K. - * | | |101 = 215 * TLIRC32K. - * | | |110 = 216 * TLIRC32K. - * | | |111 = 217 * TLIRC32K. - * | | |Note: After this field is modified, setting SEEDRLD2 (TAMPER_ACTSTIOCTL2[4]) can reload change rate immediately. - * |[8] |ATAMP0EN2 |Active Shied Tamper0 Detect Enable Bit 2 - * | | |0 = Tamper 0 detect Disabled. - * | | |1 = Tamper 0 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[12] |ATAMP1EN2 |Active Shied Tamper 1 Detect Enable Bit 2 - * | | |0 = Tamper 1 detect Disabled. - * | | |1 = Tamper 1 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[15] |ADYNPR0EN2|Active Shied Dynamic Pair 0 Enable Bit 2 - * | | |0 = Static detect (Not supported). - * | | |1 = Dynamic detect. - * |[16] |ATAMP2EN2 |Active Shied Tamper 2 Detect Enable Bit 2 - * | | |0 = Tamper 2 detect Disabled. - * | | |1 = Tamper 2 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[20] |ATAMP3EN2 |Active Shied Tamper 3 Detect Enable Bit 2 - * | | |0 = Tamper 3 detect Disabled. - * | | |1 = Tamper 3 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector needs sync 2 ~ 3 TLIRC 32K-clock. - * |[23] |ADYNPR1EN2|Active Shied Dynamic Pair 1 Enable Bit 2 - * | | |0 = Static detect (Not supported). - * | | |1 = Dynamic detect. - * |[24] |ATAMP4EN2 |Active Shied Tamper4 Detect Enable Bit 2 - * | | |0 = Tamper 4 detect Disabled. - * | | |1 = Tamper 4 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector need sync 2 ~ 3 TLIRC 32K-clock. - * |[28] |ATAMP5EN2 |Active Tamper 5 Detect Enable Bit 2 - * | | |0 = Tamper 5 detect Disabled. - * | | |1 = Tamper 5 detect Enabled. - * | | |Note: The reference is TLIRC 32K-clock. Tamper detector need sync 2 ~ 3 TLIRC 32K-clock. - * |[31] |ADYNPR2EN2|Active Shied Dynamic Pair 2 Enable Bit 2 - * | | |0 = Static detect (Not supported). - * | | |1 = Dynamic detect. - * @var TAMPER_T::CDBR - * Offset: 0x2C Tamper Clock Frequency Detector Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |STOPBD |LXT Clock Frequency Detector Stop Boundary - * | | |The bits define the stop value of frequency monitor window. - * | | |When LXT frequency monitor counter lower than Clock Frequency Detector Stop Boundary, the LXT frequency detect stop interrupt flag will set to 1. - * | | |Note: The boundary is defined as the maximum value of LXT among 256 Tamper clock time. - * |[23:16] |FAILBD |LXT Clock Frequency Detector Fail Boundary - * | | |The bits define the fail value of frequency monitor window. - * | | |When LXT frequency monitor counter lower than Clock Frequency Detector Fail Boundary, the LXT frequency detect fail interrupt flag will set to 1. - * | | |Note: The boundary is defined as the minimum value of LXT among 256 Tamper clock time. - * @var TAMPER_T::VG - * Offset: 0x30 Tamper Voltage Glitch Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PCLKSEL0 |PL0 Positive Clock Trim Range - * | | |The setting value of the positive clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * | | |Note: PL0 means the power level is 1.26V - * | | |The power level is controlled in system manager - * |[7:4] |NCLKSEL0 |PL0 Negative Clock Trim Range - * | | |The setting value of the negative clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[11:8] |PDATSEL0 |PL0 Positive Data Trim Range - * | | |The setting value of the positive data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[15:12] |NDATSEL0 |PL0 Negative Data Trim Range - * | | |The setting value of the negative data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[19:16] |PCLKSEL1 |PL1 Positive Clock Trim Range - * | | |The setting value of the positive clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * | | |Note: PL1 means the power level is 1.2V - * |[23:20] |NCLKSEL1 |PL1 Negative Clock Trim Range - * | | |The setting value of the negative clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[27:24] |PDATSEL1 |PL1 Positive Data Trim Range - * | | |The setting value of the positive data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[31:28] |NDATSEL1 |PL1 Negative Data Trim Range - * | | |The setting value of the negative data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * @var TAMPER_T::VGEV - * Offset: 0x34 Tamper Voltage Glitch Event Tolerance Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |VGECNTP |Positive Voltage Glitch Error Tolerance - * | | |The value indicates the tolerance count for positive voltage glitch event. - * |[15:8] |VGECNTN |Negative Voltage Glitch Error Tolerance - * | | |The value indicates the tolerance count for negative voltage glitch event. - * @var TAMPER_T::LDOTRIM - * Offset: 0x38 Tamper LDO Trim Value Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TLDOTRIM |Voltage Regulator Output Voltage Trim - * | | |The value indicates the trim value of the voltage regulator output voltage. - * |[9:8] |TLDOIQSEL |Voltage Regulator Qu Current Selection - * | | |Indicates the Qu current selection of voltage regulator. - * @var TAMPER_T::LBSTRIM - * Offset: 0x3C Tamper LDO BIAS Trim Value Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TLVDSEL |Under-shoot Detect Level Trim Bits - * | | |The value indicates the trim value of the under-shoot detection level - * |[4] |TOVDSEL |Over-shoot Detect Level Trim Bits - * | | |The value indicates the trim value of the over-shoot detection level - * |[9:8] |BSCMPLV |Under-shoot Detect Comparator Current Trim Bits - * | | |The value indicates the trim value of the under-shoot detection comparator current trim level - * |[11:10] |BSCMPOV |Over-shoot Detect Comparator Current Trim Bits - * | | |The value indicates the trim value of the over-shoot detection comparator current trim level - * |[13:12] |HYSCMPLV |Under-shoot Detect Comparator Hysteresis Trim Bits - * | | |The value indicates the trim value of the under-shoot detection comparator of hysteresis trim level - * |[15:14] |HYSCMPOV |Over-shoot Detect Comparator Hysteresis Trim Bits - * | | |The value indicates the trim value of the over-shoot detection comparator of hysteresis trim level - * @var TAMPER_T::VG2 - * Offset: 0x40 Tamper Voltage Glitch Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PCLKSEL2 |PL2 Positive Clock Trim Range - * | | |The setting value of the positive clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * | | |Note: PL2 means the power level is 1.1V - * | | |The power level is controlled in system manager. - * |[7:4] |NCLKSEL2 |PL2 Negative Clock Trim Range - * | | |The setting value of the negative clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[11:8] |PDATSEL2 |PL2 Positive Data Trim Range - * | | |The setting value of the positive data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[15:12] |NDATSEL2 |PL2 Negative Data Trim Range - * | | |The setting value of the negative data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[19:16] |PCLKSEL3 |PL3 Positive Clock Trim Range - * | | |The setting value of the positive clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * | | |Note: PL3 means the power level is 0.9V - * |[23:20] |NCLKSEL3 |PL3 Negative Clock Trim Range - * | | |The setting value of the negative clock tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[27:24] |PDATSEL3 |PL3 Positive Data Trim Range - * | | |The setting value of the positive data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - * |[31:28] |NDATSEL3 |PL3 Negative Data Trim Range - * | | |The setting value of the negative data tolerance. - * | | |One step is about 2.5% tolerance. The maximum tolerance is 20%. - */ - __IO uint32_t INIT; /*!< [0x0000] Tamper Function Initiation Register */ - __IO uint32_t FUNEN; /*!< [0x0004] Tamper Block Function Enable Register */ - __IO uint32_t TRIEN; /*!< [0x0008] Tamper Trigger Enable Register */ - __IO uint32_t INTEN; /*!< [0x000c] Tamper Event Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0010] Tamper Interrupt Status Register */ - __IO uint32_t LIRCTL; /*!< [0x0014] Tamper LIRC Control Register */ - __IO uint32_t TIOCTL; /*!< [0x0018] Tamper I/O Function Control Register */ - __IO uint32_t SEED; /*!< [0x001c] Tamper Seed Value Control Register */ - __IO uint32_t SEED2; /*!< [0x0020] Tamper 2nd Seed Value Control Register */ - __IO uint32_t ACTSTIOCTL1; /*!< [0x0024] Tamper Active Shield Tamper I/O Function Control Register 1 */ - __IO uint32_t ACTSTIOCTL2; /*!< [0x0028] Tamper Active Shield Tamper I/O Function Control Register 2 */ - __IO uint32_t CDBR; /*!< [0x002c] Tamper Clock Frequency Detector Boundary Register */ - __IO uint32_t VG; /*!< [0x0030] Tamper Voltage Glitch Control Register */ - __IO uint32_t VGEV; /*!< [0x0034] Tamper Voltage Glitch Event Tolerance Control Register */ - __IO uint32_t LDOTRIM; /*!< [0x0038] Tamper LDO Trim Value Control Register */ - __IO uint32_t LBSTRIM; /*!< [0x003c] Tamper LDO BIAS Trim Value Control Register */ - __IO uint32_t VG2; /*!< [0x0040] Tamper Voltage Glitch Control Register 2 */ - -} TAMPER_T; - -/** - @addtogroup TAMPER_CONST Tamper Bit Field Definition - Constant Definitions for Tamper Controller - @{ -*/ - -#define TAMPER_INIT_TCORERST_Pos (0) /*!< TAMPER_T::INIT: TCORERST Position */ -#define TAMPER_INIT_TCORERST_Msk (0x1ul << TAMPER_INIT_TCORERST_Pos) /*!< TAMPER_T::INIT: TCORERST Mask */ - -#define TAMPER_INIT_TLDORDY_Pos (31) /*!< TAMPER_T::INIT: TLDORDY Position */ -#define TAMPER_INIT_TLDORDY_Msk (0x1ul << TAMPER_INIT_TLDORDY_Pos) /*!< TAMPER_T::INIT: TLDORDY Mask */ - -#define TAMPER_FUNEN_LXTDETEN_Pos (0) /*!< TAMPER_T::FUNEN: LXTDETEN Position */ -#define TAMPER_FUNEN_LXTDETEN_Msk (0x1ul << TAMPER_FUNEN_LXTDETEN_Pos) /*!< TAMPER_T::FUNEN: LXTDETEN Mask */ - -#define TAMPER_FUNEN_TMPIOSEL_Pos (8) /*!< TAMPER_T::FUNEN: TMPIOSEL Position */ -#define TAMPER_FUNEN_TMPIOSEL_Msk (0x3ful << TAMPER_FUNEN_TMPIOSEL_Pos) /*!< TAMPER_T::FUNEN: TMPIOSEL Mask */ - -#define TAMPER_FUNEN_HIRC48MEN_Pos (16) /*!< TAMPER_T::FUNEN: HIRC48MEN Position */ -#define TAMPER_FUNEN_HIRC48MEN_Msk (0xfful << TAMPER_FUNEN_HIRC48MEN_Pos) /*!< TAMPER_T::FUNEN: HIRC48MEN Mask */ - -#define TAMPER_FUNEN_VGCHEN0_Pos (24) /*!< TAMPER_T::FUNEN: VGCHEN0 Position */ -#define TAMPER_FUNEN_VGCHEN0_Msk (0x1ul << TAMPER_FUNEN_VGCHEN0_Pos) /*!< TAMPER_T::FUNEN: VGCHEN0 Mask */ - -#define TAMPER_FUNEN_VGCHEN1_Pos (25) /*!< TAMPER_T::FUNEN: VGCHEN1 Position */ -#define TAMPER_FUNEN_VGCHEN1_Msk (0x1ul << TAMPER_FUNEN_VGCHEN1_Pos) /*!< TAMPER_T::FUNEN: VGCHEN1 Mask */ - -#define TAMPER_FUNEN_VGCHEN2_Pos (26) /*!< TAMPER_T::FUNEN: VGCHEN2 Position */ -#define TAMPER_FUNEN_VGCHEN2_Msk (0x1ul << TAMPER_FUNEN_VGCHEN2_Pos) /*!< TAMPER_T::FUNEN: VGCHEN2 Mask */ - -#define TAMPER_FUNEN_VGCHEN3_Pos (27) /*!< TAMPER_T::FUNEN: VGCHEN3 Position */ -#define TAMPER_FUNEN_VGCHEN3_Msk (0x1ul << TAMPER_FUNEN_VGCHEN3_Pos) /*!< TAMPER_T::FUNEN: VGCHEN3 Mask */ - -#define TAMPER_TRIEN_KSTRIGEN_Pos (1) /*!< TAMPER_T::TRIEN: KSTRIGEN Position */ -#define TAMPER_TRIEN_KSTRIGEN_Msk (0x1ul << TAMPER_TRIEN_KSTRIGEN_Pos) /*!< TAMPER_T::TRIEN: KSTRIGEN Mask */ - -#define TAMPER_TRIEN_WAKEUPEN_Pos (2) /*!< TAMPER_T::TRIEN: WAKEUPEN Position */ -#define TAMPER_TRIEN_WAKEUPEN_Msk (0x1ul << TAMPER_TRIEN_WAKEUPEN_Pos) /*!< TAMPER_T::TRIEN: WAKEUPEN Mask */ - -#define TAMPER_TRIEN_CRYPTOEN_Pos (3) /*!< TAMPER_T::TRIEN: CRYPTOEN Position */ -#define TAMPER_TRIEN_CRYPTOEN_Msk (0x1ul << TAMPER_TRIEN_CRYPTOEN_Pos) /*!< TAMPER_T::TRIEN: CRYPTOEN Mask */ - -#define TAMPER_TRIEN_CHIPRSTEN_Pos (4) /*!< TAMPER_T::TRIEN: CHIPRSTEN Position */ -#define TAMPER_TRIEN_CHIPRSTEN_Msk (0x1ul << TAMPER_TRIEN_CHIPRSTEN_Pos) /*!< TAMPER_T::TRIEN: CHIPRSTEN Mask */ - -#define TAMPER_TRIEN_RTCSPCLREN_Pos (5) /*!< TAMPER_T::TRIEN: RTCSPCLREN Position */ -#define TAMPER_TRIEN_RTCSPCLREN_Msk (0x1ul << TAMPER_TRIEN_RTCSPCLREN_Pos) /*!< TAMPER_T::TRIEN: RTCSPCLREN Mask */ - -#define TAMPER_INTEN_TAMP0IEN_Pos (0) /*!< TAMPER_T::INTEN: TAMP0IEN Position */ -#define TAMPER_INTEN_TAMP0IEN_Msk (0x1ul << TAMPER_INTEN_TAMP0IEN_Pos) /*!< TAMPER_T::INTEN: TAMP0IEN Mask */ - -#define TAMPER_INTEN_TAMP1IEN_Pos (1) /*!< TAMPER_T::INTEN: TAMP1IEN Position */ -#define TAMPER_INTEN_TAMP1IEN_Msk (0x1ul << TAMPER_INTEN_TAMP1IEN_Pos) /*!< TAMPER_T::INTEN: TAMP1IEN Mask */ - -#define TAMPER_INTEN_TAMP2IEN_Pos (2) /*!< TAMPER_T::INTEN: TAMP2IEN Position */ -#define TAMPER_INTEN_TAMP2IEN_Msk (0x1ul << TAMPER_INTEN_TAMP2IEN_Pos) /*!< TAMPER_T::INTEN: TAMP2IEN Mask */ - -#define TAMPER_INTEN_TAMP3IEN_Pos (3) /*!< TAMPER_T::INTEN: TAMP3IEN Position */ -#define TAMPER_INTEN_TAMP3IEN_Msk (0x1ul << TAMPER_INTEN_TAMP3IEN_Pos) /*!< TAMPER_T::INTEN: TAMP3IEN Mask */ - -#define TAMPER_INTEN_TAMP4IEN_Pos (4) /*!< TAMPER_T::INTEN: TAMP4IEN Position */ -#define TAMPER_INTEN_TAMP4IEN_Msk (0x1ul << TAMPER_INTEN_TAMP4IEN_Pos) /*!< TAMPER_T::INTEN: TAMP4IEN Mask */ - -#define TAMPER_INTEN_TAMP5IEN_Pos (5) /*!< TAMPER_T::INTEN: TAMP5IEN Position */ -#define TAMPER_INTEN_TAMP5IEN_Msk (0x1ul << TAMPER_INTEN_TAMP5IEN_Pos) /*!< TAMPER_T::INTEN: TAMP5IEN Mask */ - -#define TAMPER_INTEN_CLKFIEN_Pos (6) /*!< TAMPER_T::INTEN: CLKFIEN Position */ -#define TAMPER_INTEN_CLKFIEN_Msk (0x1ul << TAMPER_INTEN_CLKFIEN_Pos) /*!< TAMPER_T::INTEN: CLKFIEN Mask */ - -#define TAMPER_INTEN_CLKSTOPIEN_Pos (7) /*!< TAMPER_T::INTEN: CLKSTOPIEN Position */ -#define TAMPER_INTEN_CLKSTOPIEN_Msk (0x1ul << TAMPER_INTEN_CLKSTOPIEN_Pos) /*!< TAMPER_T::INTEN: CLKSTOPIEN Mask */ - -#define TAMPER_INTEN_OVPIEN_Pos (8) /*!< TAMPER_T::INTEN: OVPIEN Position */ -#define TAMPER_INTEN_OVPIEN_Msk (0x1ul << TAMPER_INTEN_OVPIEN_Pos) /*!< TAMPER_T::INTEN: OVPIEN Mask */ - -#define TAMPER_INTEN_VGPIEN_Pos (9) /*!< TAMPER_T::INTEN: VGPIEN Position */ -#define TAMPER_INTEN_VGPIEN_Msk (0x1ul << TAMPER_INTEN_VGPIEN_Pos) /*!< TAMPER_T::INTEN: VGPIEN Mask */ - -#define TAMPER_INTEN_VGNIEN_Pos (10) /*!< TAMPER_T::INTEN: VGNIEN Position */ -#define TAMPER_INTEN_VGNIEN_Msk (0x1ul << TAMPER_INTEN_VGNIEN_Pos) /*!< TAMPER_T::INTEN: VGNIEN Mask */ - -#define TAMPER_INTEN_ACTSIEN_Pos (11) /*!< TAMPER_T::INTEN: ACTSIEN Position */ -#define TAMPER_INTEN_ACTSIEN_Msk (0x1ul << TAMPER_INTEN_ACTSIEN_Pos) /*!< TAMPER_T::INTEN: ACTSIEN Mask */ - -#define TAMPER_INTEN_RTCLVRIEN_Pos (16) /*!< TAMPER_T::INTEN: RTCLVRIEN Position */ -#define TAMPER_INTEN_RTCLVRIEN_Msk (0x1ul << TAMPER_INTEN_RTCLVRIEN_Pos) /*!< TAMPER_T::INTEN: RTCLVRIEN Mask */ - -#define TAMPER_INTEN_RTCIOIEN_Pos (17) /*!< TAMPER_T::INTEN: RTCIOIEN Position */ -#define TAMPER_INTEN_RTCIOIEN_Msk (0x1ul << TAMPER_INTEN_RTCIOIEN_Pos) /*!< TAMPER_T::INTEN: RTCIOIEN Mask */ - -#define TAMPER_INTEN_RTCLKIEN_Pos (18) /*!< TAMPER_T::INTEN: RTCLKIEN Position */ -#define TAMPER_INTEN_RTCLKIEN_Msk (0x1ul << TAMPER_INTEN_RTCLKIEN_Pos) /*!< TAMPER_T::INTEN: RTCLKIEN Mask */ - -#define TAMPER_INTEN_BODIEN_Pos (22) /*!< TAMPER_T::INTEN: BODIEN Position */ -#define TAMPER_INTEN_BODIEN_Msk (0x1ul << TAMPER_INTEN_BODIEN_Pos) /*!< TAMPER_T::INTEN: BODIEN Mask */ - -#define TAMPER_INTSTS_TAMP0IF_Pos (0) /*!< TAMPER_T::INTSTS: TAMP0IF Position */ -#define TAMPER_INTSTS_TAMP0IF_Msk (0x1ul << TAMPER_INTSTS_TAMP0IF_Pos) /*!< TAMPER_T::INTSTS: TAMP0IF Mask */ - -#define TAMPER_INTSTS_TAMP1IF_Pos (1) /*!< TAMPER_T::INTSTS: TAMP1IF Position */ -#define TAMPER_INTSTS_TAMP1IF_Msk (0x1ul << TAMPER_INTSTS_TAMP1IF_Pos) /*!< TAMPER_T::INTSTS: TAMP1IF Mask */ - -#define TAMPER_INTSTS_TAMP2IF_Pos (2) /*!< TAMPER_T::INTSTS: TAMP2IF Position */ -#define TAMPER_INTSTS_TAMP2IF_Msk (0x1ul << TAMPER_INTSTS_TAMP2IF_Pos) /*!< TAMPER_T::INTSTS: TAMP2IF Mask */ - -#define TAMPER_INTSTS_TAMP3IF_Pos (3) /*!< TAMPER_T::INTSTS: TAMP3IF Position */ -#define TAMPER_INTSTS_TAMP3IF_Msk (0x1ul << TAMPER_INTSTS_TAMP3IF_Pos) /*!< TAMPER_T::INTSTS: TAMP3IF Mask */ - -#define TAMPER_INTSTS_TAMP4IF_Pos (4) /*!< TAMPER_T::INTSTS: TAMP4IF Position */ -#define TAMPER_INTSTS_TAMP4IF_Msk (0x1ul << TAMPER_INTSTS_TAMP4IF_Pos) /*!< TAMPER_T::INTSTS: TAMP4IF Mask */ - -#define TAMPER_INTSTS_TAMP5IF_Pos (5) /*!< TAMPER_T::INTSTS: TAMP5IF Position */ -#define TAMPER_INTSTS_TAMP5IF_Msk (0x1ul << TAMPER_INTSTS_TAMP5IF_Pos) /*!< TAMPER_T::INTSTS: TAMP5IF Mask */ - -#define TAMPER_INTSTS_CLKFAILIF_Pos (6) /*!< TAMPER_T::INTSTS: CLKFAILIF Position */ -#define TAMPER_INTSTS_CLKFAILIF_Msk (0x1ul << TAMPER_INTSTS_CLKFAILIF_Pos) /*!< TAMPER_T::INTSTS: CLKFAILIF Mask */ - -#define TAMPER_INTSTS_CLKSTOPIF_Pos (7) /*!< TAMPER_T::INTSTS: CLKSTOPIF Position */ -#define TAMPER_INTSTS_CLKSTOPIF_Msk (0x1ul << TAMPER_INTSTS_CLKSTOPIF_Pos) /*!< TAMPER_T::INTSTS: CLKSTOPIF Mask */ - -#define TAMPER_INTSTS_OVPOUTIF_Pos (8) /*!< TAMPER_T::INTSTS: OVPOUTIF Position */ -#define TAMPER_INTSTS_OVPOUTIF_Msk (0x1ul << TAMPER_INTSTS_OVPOUTIF_Pos) /*!< TAMPER_T::INTSTS: OVPOUTIF Mask */ - -#define TAMPER_INTSTS_VGPEVIF_Pos (9) /*!< TAMPER_T::INTSTS: VGPEVIF Position */ -#define TAMPER_INTSTS_VGPEVIF_Msk (0x1ul << TAMPER_INTSTS_VGPEVIF_Pos) /*!< TAMPER_T::INTSTS: VGPEVIF Mask */ - -#define TAMPER_INTSTS_VGNEVIF_Pos (10) /*!< TAMPER_T::INTSTS: VGNEVIF Position */ -#define TAMPER_INTSTS_VGNEVIF_Msk (0x1ul << TAMPER_INTSTS_VGNEVIF_Pos) /*!< TAMPER_T::INTSTS: VGNEVIF Mask */ - -#define TAMPER_INTSTS_ACTSEIF_Pos (11) /*!< TAMPER_T::INTSTS: ACTSEIF Position */ -#define TAMPER_INTSTS_ACTSEIF_Msk (0x1ul << TAMPER_INTSTS_ACTSEIF_Pos) /*!< TAMPER_T::INTSTS: ACTSEIF Mask */ - -#define TAMPER_INTSTS_ACTST5IF_Pos (13) /*!< TAMPER_T::INTSTS: ACTST5IF Position */ -#define TAMPER_INTSTS_ACTST5IF_Msk (0x1ul << TAMPER_INTSTS_ACTST5IF_Pos) /*!< TAMPER_T::INTSTS: ACTST5IF Mask */ - -#define TAMPER_INTSTS_ACTST25IF_Pos (15) /*!< TAMPER_T::INTSTS: ACTST25IF Position */ -#define TAMPER_INTSTS_ACTST25IF_Msk (0x1ul << TAMPER_INTSTS_ACTST25IF_Pos) /*!< TAMPER_T::INTSTS: ACTST25IF Mask */ - -#define TAMPER_INTSTS_RTCLVRIF_Pos (16) /*!< TAMPER_T::INTSTS: RTCLVRIF Position */ -#define TAMPER_INTSTS_RTCLVRIF_Msk (0x1ul << TAMPER_INTSTS_RTCLVRIF_Pos) /*!< TAMPER_T::INTSTS: RTCLVRIF Mask */ - -#define TAMPER_INTSTS_RIOTRIGIF_Pos (17) /*!< TAMPER_T::INTSTS: RIOTRIGIF Position */ -#define TAMPER_INTSTS_RIOTRIGIF_Msk (0x1ul << TAMPER_INTSTS_RIOTRIGIF_Pos) /*!< TAMPER_T::INTSTS: RIOTRIGIF Mask */ - -#define TAMPER_INTSTS_RCLKTRIGIF_Pos (18) /*!< TAMPER_T::INTSTS: RCLKTRIGIF Position */ -#define TAMPER_INTSTS_RCLKTRIGIF_Msk (0x1ul << TAMPER_INTSTS_RCLKTRIGIF_Pos) /*!< TAMPER_T::INTSTS: RCLKTRIGIF Mask */ - -#define TAMPER_INTSTS_BODIF_Pos (22) /*!< TAMPER_T::INTSTS: BODIF Position */ -#define TAMPER_INTSTS_BODIF_Msk (0x1ul << TAMPER_INTSTS_BODIF_Pos) /*!< TAMPER_T::INTSTS: BODIF Mask */ - -#define TAMPER_INTSTS_ACTST1IF_Pos (25) /*!< TAMPER_T::INTSTS: ACTST1IF Position */ -#define TAMPER_INTSTS_ACTST1IF_Msk (0x1ul << TAMPER_INTSTS_ACTST1IF_Pos) /*!< TAMPER_T::INTSTS: ACTST1IF Mask */ - -#define TAMPER_INTSTS_ACTST3IF_Pos (27) /*!< TAMPER_T::INTSTS: ACTST3IF Position */ -#define TAMPER_INTSTS_ACTST3IF_Msk (0x1ul << TAMPER_INTSTS_ACTST3IF_Pos) /*!< TAMPER_T::INTSTS: ACTST3IF Mask */ - -#define TAMPER_INTSTS_ACTST21IF_Pos (29) /*!< TAMPER_T::INTSTS: ACTST21IF Position */ -#define TAMPER_INTSTS_ACTST21IF_Msk (0x1ul << TAMPER_INTSTS_ACTST21IF_Pos) /*!< TAMPER_T::INTSTS: ACTST21IF Mask */ - -#define TAMPER_INTSTS_ACTST23IF_Pos (31) /*!< TAMPER_T::INTSTS: ACTST23IF Position */ -#define TAMPER_INTSTS_ACTST23IF_Msk (0x1ul << TAMPER_INTSTS_ACTST23IF_Pos) /*!< TAMPER_T::INTSTS: ACTST23IF Mask */ - -#define TAMPER_LIRCTL_TLRCTRIM_Pos (0) /*!< TAMPER_T::LIRCTL: TLRCTRIM Position */ -#define TAMPER_LIRCTL_TLRCTRIM_Msk (0x1fful << TAMPER_LIRCTL_TLRCTRIM_Pos) /*!< TAMPER_T::LIRCTL: TLRCTRIM Mask */ - -#define TAMPER_LIRCTL_TRIMMOS_Pos (9) /*!< TAMPER_T::LIRCTL: TRIMMOS Position */ -#define TAMPER_LIRCTL_TRIMMOS_Msk (0x3ul << TAMPER_LIRCTL_TRIMMOS_Pos) /*!< TAMPER_T::LIRCTL: TRIMMOS Mask */ - -#define TAMPER_TIOCTL_DYN1ISS_Pos (0) /*!< TAMPER_T::TIOCTL: DYN1ISS Position */ -#define TAMPER_TIOCTL_DYN1ISS_Msk (0x1ul << TAMPER_TIOCTL_DYN1ISS_Pos) /*!< TAMPER_T::TIOCTL: DYN1ISS Mask */ - -#define TAMPER_TIOCTL_DYN2ISS_Pos (1) /*!< TAMPER_T::TIOCTL: DYN2ISS Position */ -#define TAMPER_TIOCTL_DYN2ISS_Msk (0x1ul << TAMPER_TIOCTL_DYN2ISS_Pos) /*!< TAMPER_T::TIOCTL: DYN2ISS Mask */ - -#define TAMPER_TIOCTL_DYNSRC_Pos (3) /*!< TAMPER_T::TIOCTL: DYNSRC Position */ -#define TAMPER_TIOCTL_DYNSRC_Msk (0x1ul << TAMPER_TIOCTL_DYNSRC_Pos) /*!< TAMPER_T::TIOCTL: DYNSRC Mask */ - -#define TAMPER_TIOCTL_SEEDRLD_Pos (4) /*!< TAMPER_T::TIOCTL: SEEDRLD Position */ -#define TAMPER_TIOCTL_SEEDRLD_Msk (0x1ul << TAMPER_TIOCTL_SEEDRLD_Pos) /*!< TAMPER_T::TIOCTL: SEEDRLD Mask */ - -#define TAMPER_TIOCTL_DYNRATE_Pos (5) /*!< TAMPER_T::TIOCTL: DYNRATE Position */ -#define TAMPER_TIOCTL_DYNRATE_Msk (0x7ul << TAMPER_TIOCTL_DYNRATE_Pos) /*!< TAMPER_T::TIOCTL: DYNRATE Mask */ - -#define TAMPER_TIOCTL_TAMP0EN_Pos (8) /*!< TAMPER_T::TIOCTL: TAMP0EN Position */ -#define TAMPER_TIOCTL_TAMP0EN_Msk (0x1ul << TAMPER_TIOCTL_TAMP0EN_Pos) /*!< TAMPER_T::TIOCTL: TAMP0EN Mask */ - -#define TAMPER_TIOCTL_TAMP0LV_Pos (9) /*!< TAMPER_T::TIOCTL: TAMP0LV Position */ -#define TAMPER_TIOCTL_TAMP0LV_Msk (0x1ul << TAMPER_TIOCTL_TAMP0LV_Pos) /*!< TAMPER_T::TIOCTL: TAMP0LV Mask */ - -#define TAMPER_TIOCTL_TAMP0DBEN_Pos (10) /*!< TAMPER_T::TIOCTL: TAMP0DBEN Position */ -#define TAMPER_TIOCTL_TAMP0DBEN_Msk (0x1ul << TAMPER_TIOCTL_TAMP0DBEN_Pos) /*!< TAMPER_T::TIOCTL: TAMP0DBEN Mask */ - -#define TAMPER_TIOCTL_TAMP1EN_Pos (12) /*!< TAMPER_T::TIOCTL: TAMP1EN Position */ -#define TAMPER_TIOCTL_TAMP1EN_Msk (0x1ul << TAMPER_TIOCTL_TAMP1EN_Pos) /*!< TAMPER_T::TIOCTL: TAMP1EN Mask */ - -#define TAMPER_TIOCTL_TAMP1LV_Pos (13) /*!< TAMPER_T::TIOCTL: TAMP1LV Position */ -#define TAMPER_TIOCTL_TAMP1LV_Msk (0x1ul << TAMPER_TIOCTL_TAMP1LV_Pos) /*!< TAMPER_T::TIOCTL: TAMP1LV Mask */ - -#define TAMPER_TIOCTL_TAMP1DBEN_Pos (14) /*!< TAMPER_T::TIOCTL: TAMP1DBEN Position */ -#define TAMPER_TIOCTL_TAMP1DBEN_Msk (0x1ul << TAMPER_TIOCTL_TAMP1DBEN_Pos) /*!< TAMPER_T::TIOCTL: TAMP1DBEN Mask */ - -#define TAMPER_TIOCTL_DYNPR0EN_Pos (15) /*!< TAMPER_T::TIOCTL: DYNPR0EN Position */ -#define TAMPER_TIOCTL_DYNPR0EN_Msk (0x1ul << TAMPER_TIOCTL_DYNPR0EN_Pos) /*!< TAMPER_T::TIOCTL: DYNPR0EN Mask */ - -#define TAMPER_TIOCTL_TAMP2EN_Pos (16) /*!< TAMPER_T::TIOCTL: TAMP2EN Position */ -#define TAMPER_TIOCTL_TAMP2EN_Msk (0x1ul << TAMPER_TIOCTL_TAMP2EN_Pos) /*!< TAMPER_T::TIOCTL: TAMP2EN Mask */ - -#define TAMPER_TIOCTL_TAMP2LV_Pos (17) /*!< TAMPER_T::TIOCTL: TAMP2LV Position */ -#define TAMPER_TIOCTL_TAMP2LV_Msk (0x1ul << TAMPER_TIOCTL_TAMP2LV_Pos) /*!< TAMPER_T::TIOCTL: TAMP2LV Mask */ - -#define TAMPER_TIOCTL_TAMP2DBEN_Pos (18) /*!< TAMPER_T::TIOCTL: TAMP2DBEN Position */ -#define TAMPER_TIOCTL_TAMP2DBEN_Msk (0x1ul << TAMPER_TIOCTL_TAMP2DBEN_Pos) /*!< TAMPER_T::TIOCTL: TAMP2DBEN Mask */ - -#define TAMPER_TIOCTL_TAMP3EN_Pos (20) /*!< TAMPER_T::TIOCTL: TAMP3EN Position */ -#define TAMPER_TIOCTL_TAMP3EN_Msk (0x1ul << TAMPER_TIOCTL_TAMP3EN_Pos) /*!< TAMPER_T::TIOCTL: TAMP3EN Mask */ - -#define TAMPER_TIOCTL_TAMP3LV_Pos (21) /*!< TAMPER_T::TIOCTL: TAMP3LV Position */ -#define TAMPER_TIOCTL_TAMP3LV_Msk (0x1ul << TAMPER_TIOCTL_TAMP3LV_Pos) /*!< TAMPER_T::TIOCTL: TAMP3LV Mask */ - -#define TAMPER_TIOCTL_TAMP3DBEN_Pos (22) /*!< TAMPER_T::TIOCTL: TAMP3DBEN Position */ -#define TAMPER_TIOCTL_TAMP3DBEN_Msk (0x1ul << TAMPER_TIOCTL_TAMP3DBEN_Pos) /*!< TAMPER_T::TIOCTL: TAMP3DBEN Mask */ - -#define TAMPER_TIOCTL_DYNPR1EN_Pos (23) /*!< TAMPER_T::TIOCTL: DYNPR1EN Position */ -#define TAMPER_TIOCTL_DYNPR1EN_Msk (0x1ul << TAMPER_TIOCTL_DYNPR1EN_Pos) /*!< TAMPER_T::TIOCTL: DYNPR1EN Mask */ - -#define TAMPER_TIOCTL_TAMP4EN_Pos (24) /*!< TAMPER_T::TIOCTL: TAMP4EN Position */ -#define TAMPER_TIOCTL_TAMP4EN_Msk (0x1ul << TAMPER_TIOCTL_TAMP4EN_Pos) /*!< TAMPER_T::TIOCTL: TAMP4EN Mask */ - -#define TAMPER_TIOCTL_TAMP4LV_Pos (25) /*!< TAMPER_T::TIOCTL: TAMP4LV Position */ -#define TAMPER_TIOCTL_TAMP4LV_Msk (0x1ul << TAMPER_TIOCTL_TAMP4LV_Pos) /*!< TAMPER_T::TIOCTL: TAMP4LV Mask */ - -#define TAMPER_TIOCTL_TAMP4DBEN_Pos (26) /*!< TAMPER_T::TIOCTL: TAMP4DBEN Position */ -#define TAMPER_TIOCTL_TAMP4DBEN_Msk (0x1ul << TAMPER_TIOCTL_TAMP4DBEN_Pos) /*!< TAMPER_T::TIOCTL: TAMP4DBEN Mask */ - -#define TAMPER_TIOCTL_TAMP5EN_Pos (28) /*!< TAMPER_T::TIOCTL: TAMP5EN Position */ -#define TAMPER_TIOCTL_TAMP5EN_Msk (0x1ul << TAMPER_TIOCTL_TAMP5EN_Pos) /*!< TAMPER_T::TIOCTL: TAMP5EN Mask */ - -#define TAMPER_TIOCTL_TAMP5LV_Pos (29) /*!< TAMPER_T::TIOCTL: TAMP5LV Position */ -#define TAMPER_TIOCTL_TAMP5LV_Msk (0x1ul << TAMPER_TIOCTL_TAMP5LV_Pos) /*!< TAMPER_T::TIOCTL: TAMP5LV Mask */ - -#define TAMPER_TIOCTL_TAMP5DBEN_Pos (30) /*!< TAMPER_T::TIOCTL: TAMP5DBEN Position */ -#define TAMPER_TIOCTL_TAMP5DBEN_Msk (0x1ul << TAMPER_TIOCTL_TAMP5DBEN_Pos) /*!< TAMPER_T::TIOCTL: TAMP5DBEN Mask */ - -#define TAMPER_TIOCTL_DYNPR2EN_Pos (31) /*!< TAMPER_T::TIOCTL: DYNPR2EN Position */ -#define TAMPER_TIOCTL_DYNPR2EN_Msk (0x1ul << TAMPER_TIOCTL_DYNPR2EN_Pos) /*!< TAMPER_T::TIOCTL: DYNPR2EN Mask */ - -#define TAMPER_SEED_SEED_Pos (0) /*!< TAMPER_T::SEED: SEED Position */ -#define TAMPER_SEED_SEED_Msk (0xfffffffful << TAMPER_SEED_SEED_Pos) /*!< TAMPER_T::SEED: SEED Mask */ - -#define TAMPER_SEED2_SEED2_Pos (0) /*!< TAMPER_T::SEED2: SEED2 Position */ -#define TAMPER_SEED2_SEED2_Msk (0xfffffffful << TAMPER_SEED2_SEED2_Pos) /*!< TAMPER_T::SEED2: SEED2 Mask */ - -#define TAMPER_ACTSTIOCTL1_ADYN1ISS_Pos (0) /*!< TAMPER_T::ACTSTIOCTL1: ADYN1ISS Position*/ -#define TAMPER_ACTSTIOCTL1_ADYN1ISS_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ADYN1ISS_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ADYN1ISS Mask */ - -#define TAMPER_ACTSTIOCTL1_ADYNSRC_Pos (3) /*!< TAMPER_T::ACTSTIOCTL1: ADYNSRC Position*/ -#define TAMPER_ACTSTIOCTL1_ADYNSRC_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ADYNSRC_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ADYNSRC Mask */ - -#define TAMPER_ACTSTIOCTL1_ADYNRATE_Pos (5) /*!< TAMPER_T::ACTSTIOCTL1: ADYNRATE Position*/ -#define TAMPER_ACTSTIOCTL1_ADYNRATE_Msk (0x7ul << TAMPER_ACTSTIOCTL1_ADYNRATE_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ADYNRATE Mask */ - -#define TAMPER_ACTSTIOCTL1_ATAMP0EN_Pos (8) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP0EN Position*/ -#define TAMPER_ACTSTIOCTL1_ATAMP0EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ATAMP0EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP0EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ATAMP1EN_Pos (12) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP1EN Position*/ -#define TAMPER_ACTSTIOCTL1_ATAMP1EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ATAMP1EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP1EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ADYNPR0EN_Pos (15) /*!< TAMPER_T::ACTSTIOCTL1: ADYNPR0EN Position*/ -#define TAMPER_ACTSTIOCTL1_ADYNPR0EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ADYNPR0EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ADYNPR0EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ATAMP2EN_Pos (16) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP2EN Position*/ -#define TAMPER_ACTSTIOCTL1_ATAMP2EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ATAMP2EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP2EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ATAMP3EN_Pos (20) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP3EN Position*/ -#define TAMPER_ACTSTIOCTL1_ATAMP3EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ATAMP3EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP3EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ADYNPR1EN_Pos (23) /*!< TAMPER_T::ACTSTIOCTL1: ADYNPR1EN Position*/ -#define TAMPER_ACTSTIOCTL1_ADYNPR1EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ADYNPR1EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ADYNPR1EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ATAMP4EN_Pos (24) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP4EN Position*/ -#define TAMPER_ACTSTIOCTL1_ATAMP4EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ATAMP4EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP4EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ATAMP5EN_Pos (28) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP5EN Position*/ -#define TAMPER_ACTSTIOCTL1_ATAMP5EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ATAMP5EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ATAMP5EN Mask */ - -#define TAMPER_ACTSTIOCTL1_ADYNPR2EN_Pos (31) /*!< TAMPER_T::ACTSTIOCTL1: ADYNPR2EN Position*/ -#define TAMPER_ACTSTIOCTL1_ADYNPR2EN_Msk (0x1ul << TAMPER_ACTSTIOCTL1_ADYNPR2EN_Pos) /*!< TAMPER_T::ACTSTIOCTL1: ADYNPR2EN Mask */ - -#define TAMPER_ACTSTIOCTL2_ADYN1ISS2_Pos (0) /*!< TAMPER_T::ACTSTIOCTL2: ADYN1ISS2 Position*/ -#define TAMPER_ACTSTIOCTL2_ADYN1ISS2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ADYN1ISS2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ADYN1ISS2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ADYNSRC2_Pos (3) /*!< TAMPER_T::ACTSTIOCTL2: ADYNSRC2 Position*/ -#define TAMPER_ACTSTIOCTL2_ADYNSRC2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ADYNSRC2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ADYNSRC2 Mask */ - -#define TAMPER_ACTSTIOCTL2_SEEDRLD2_Pos (4) /*!< TAMPER_T::ACTSTIOCTL2: SEEDRLD2 Position*/ -#define TAMPER_ACTSTIOCTL2_SEEDRLD2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_SEEDRLD2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: SEEDRLD2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ADYNRATE2_Pos (5) /*!< TAMPER_T::ACTSTIOCTL2: ADYNRATE2 Position*/ -#define TAMPER_ACTSTIOCTL2_ADYNRATE2_Msk (0x7ul << TAMPER_ACTSTIOCTL2_ADYNRATE2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ADYNRATE2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ATAMP0EN2_Pos (8) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP0EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ATAMP0EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ATAMP0EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP0EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ATAMP1EN2_Pos (12) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP1EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ATAMP1EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ATAMP1EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP1EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ADYNPR0EN2_Pos (15) /*!< TAMPER_T::ACTSTIOCTL2: ADYNPR0EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ADYNPR0EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ADYNPR0EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ADYNPR0EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ATAMP2EN2_Pos (16) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP2EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ATAMP2EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ATAMP2EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP2EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ATAMP3EN2_Pos (20) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP3EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ATAMP3EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ATAMP3EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP3EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ADYNPR1EN2_Pos (23) /*!< TAMPER_T::ACTSTIOCTL2: ADYNPR1EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ADYNPR1EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ADYNPR1EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ADYNPR1EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ATAMP4EN2_Pos (24) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP4EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ATAMP4EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ATAMP4EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP4EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ATAMP5EN2_Pos (28) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP5EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ATAMP5EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ATAMP5EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ATAMP5EN2 Mask */ - -#define TAMPER_ACTSTIOCTL2_ADYNPR2EN2_Pos (31) /*!< TAMPER_T::ACTSTIOCTL2: ADYNPR2EN2 Position*/ -#define TAMPER_ACTSTIOCTL2_ADYNPR2EN2_Msk (0x1ul << TAMPER_ACTSTIOCTL2_ADYNPR2EN2_Pos) /*!< TAMPER_T::ACTSTIOCTL2: ADYNPR2EN2 Mask */ - -#define TAMPER_CDBR_STOPBD_Pos (0) /*!< TAMPER_T::CDBR: STOPBD Position */ -#define TAMPER_CDBR_STOPBD_Msk (0xfful << TAMPER_CDBR_STOPBD_Pos) /*!< TAMPER_T::CDBR: STOPBD Mask */ - -#define TAMPER_CDBR_FAILBD_Pos (16) /*!< TAMPER_T::CDBR: FAILBD Position */ -#define TAMPER_CDBR_FAILBD_Msk (0xfful << TAMPER_CDBR_FAILBD_Pos) /*!< TAMPER_T::CDBR: FAILBD Mask */ - -#define TAMPER_VG_PCLKSEL0_Pos (0) /*!< TAMPER_T::VG: PCLKSEL0 Position */ -#define TAMPER_VG_PCLKSEL0_Msk (0xful << TAMPER_VG_PCLKSEL0_Pos) /*!< TAMPER_T::VG: PCLKSEL0 Mask */ - -#define TAMPER_VG_NCLKSEL0_Pos (4) /*!< TAMPER_T::VG: NCLKSEL0 Position */ -#define TAMPER_VG_NCLKSEL0_Msk (0xful << TAMPER_VG_NCLKSEL0_Pos) /*!< TAMPER_T::VG: NCLKSEL0 Mask */ - -#define TAMPER_VG_PDATSEL0_Pos (8) /*!< TAMPER_T::VG: PDATSEL0 Position */ -#define TAMPER_VG_PDATSEL0_Msk (0xful << TAMPER_VG_PDATSEL0_Pos) /*!< TAMPER_T::VG: PDATSEL0 Mask */ - -#define TAMPER_VG_NDATSEL0_Pos (12) /*!< TAMPER_T::VG: NDATSEL0 Position */ -#define TAMPER_VG_NDATSEL0_Msk (0xful << TAMPER_VG_NDATSEL0_Pos) /*!< TAMPER_T::VG: NDATSEL0 Mask */ - -#define TAMPER_VG_PCLKSEL1_Pos (16) /*!< TAMPER_T::VG: PCLKSEL1 Position */ -#define TAMPER_VG_PCLKSEL1_Msk (0xful << TAMPER_VG_PCLKSEL1_Pos) /*!< TAMPER_T::VG: PCLKSEL1 Mask */ - -#define TAMPER_VG_NCLKSEL1_Pos (20) /*!< TAMPER_T::VG: NCLKSEL1 Position */ -#define TAMPER_VG_NCLKSEL1_Msk (0xful << TAMPER_VG_NCLKSEL1_Pos) /*!< TAMPER_T::VG: NCLKSEL1 Mask */ - -#define TAMPER_VG_PDATSEL1_Pos (24) /*!< TAMPER_T::VG: PDATSEL1 Position */ -#define TAMPER_VG_PDATSEL1_Msk (0xful << TAMPER_VG_PDATSEL1_Pos) /*!< TAMPER_T::VG: PDATSEL1 Mask */ - -#define TAMPER_VG_NDATSEL1_Pos (28) /*!< TAMPER_T::VG: NDATSEL1 Position */ -#define TAMPER_VG_NDATSEL1_Msk (0xful << TAMPER_VG_NDATSEL1_Pos) /*!< TAMPER_T::VG: NDATSEL1 Mask */ - -#define TAMPER_VGEV_VGECNTP_Pos (0) /*!< TAMPER_T::VGEV: VGECNTP Position */ -#define TAMPER_VGEV_VGECNTP_Msk (0xfful << TAMPER_VGEV_VGECNTP_Pos) /*!< TAMPER_T::VGEV: VGECNTP Mask */ - -#define TAMPER_VGEV_VGECNTN_Pos (8) /*!< TAMPER_T::VGEV: VGECNTN Position */ -#define TAMPER_VGEV_VGECNTN_Msk (0xfful << TAMPER_VGEV_VGECNTN_Pos) /*!< TAMPER_T::VGEV: VGECNTN Mask */ - -#define TAMPER_LDOTRIM_TLDOTRIM_Pos (0) /*!< TAMPER_T::LDOTRIM: TLDOTRIM Position */ -#define TAMPER_LDOTRIM_TLDOTRIM_Msk (0xful << TAMPER_LDOTRIM_TLDOTRIM_Pos) /*!< TAMPER_T::LDOTRIM: TLDOTRIM Mask */ - -#define TAMPER_LDOTRIM_TLDOIQSEL_Pos (8) /*!< TAMPER_T::LDOTRIM: TLDOIQSEL Position */ -#define TAMPER_LDOTRIM_TLDOIQSEL_Msk (0x3ul << TAMPER_LDOTRIM_TLDOIQSEL_Pos) /*!< TAMPER_T::LDOTRIM: TLDOIQSEL Mask */ - -#define TAMPER_LBSTRIM_TLVDSEL_Pos (0) /*!< TAMPER_T::LBSTRIM: TLVDSEL Position */ -#define TAMPER_LBSTRIM_TLVDSEL_Msk (0x7ul << TAMPER_LBSTRIM_TLVDSEL_Pos) /*!< TAMPER_T::LBSTRIM: TLVDSEL Mask */ - -#define TAMPER_LBSTRIM_TOVDSEL_Pos (4) /*!< TAMPER_T::LBSTRIM: TOVDSEL Position */ -#define TAMPER_LBSTRIM_TOVDSEL_Msk (0x1ul << TAMPER_LBSTRIM_TOVDSEL_Pos) /*!< TAMPER_T::LBSTRIM: TOVDSEL Mask */ - -#define TAMPER_LBSTRIM_BSCMPLV_Pos (8) /*!< TAMPER_T::LBSTRIM: BSCMPLV Position */ -#define TAMPER_LBSTRIM_BSCMPLV_Msk (0x3ul << TAMPER_LBSTRIM_BSCMPLV_Pos) /*!< TAMPER_T::LBSTRIM: BSCMPLV Mask */ - -#define TAMPER_LBSTRIM_BSCMPOV_Pos (10) /*!< TAMPER_T::LBSTRIM: BSCMPOV Position */ -#define TAMPER_LBSTRIM_BSCMPOV_Msk (0x3ul << TAMPER_LBSTRIM_BSCMPOV_Pos) /*!< TAMPER_T::LBSTRIM: BSCMPOV Mask */ - -#define TAMPER_LBSTRIM_HYSCMPLV_Pos (12) /*!< TAMPER_T::LBSTRIM: HYSCMPLV Position */ -#define TAMPER_LBSTRIM_HYSCMPLV_Msk (0x3ul << TAMPER_LBSTRIM_HYSCMPLV_Pos) /*!< TAMPER_T::LBSTRIM: HYSCMPLV Mask */ - -#define TAMPER_LBSTRIM_HYSCMPOV_Pos (14) /*!< TAMPER_T::LBSTRIM: HYSCMPOV Position */ -#define TAMPER_LBSTRIM_HYSCMPOV_Msk (0x3ul << TAMPER_LBSTRIM_HYSCMPOV_Pos) /*!< TAMPER_T::LBSTRIM: HYSCMPOV Mask */ - -#define TAMPER_VG2_PCLKSEL2_Pos (0) /*!< TAMPER_T::VG2: PCLKSEL2 Position */ -#define TAMPER_VG2_PCLKSEL2_Msk (0xful << TAMPER_VG2_PCLKSEL2_Pos) /*!< TAMPER_T::VG2: PCLKSEL2 Mask */ - -#define TAMPER_VG2_NCLKSEL2_Pos (4) /*!< TAMPER_T::VG2: NCLKSEL2 Position */ -#define TAMPER_VG2_NCLKSEL2_Msk (0xful << TAMPER_VG2_NCLKSEL2_Pos) /*!< TAMPER_T::VG2: NCLKSEL2 Mask */ - -#define TAMPER_VG2_PDATSEL2_Pos (8) /*!< TAMPER_T::VG2: PDATSEL2 Position */ -#define TAMPER_VG2_PDATSEL2_Msk (0xful << TAMPER_VG2_PDATSEL2_Pos) /*!< TAMPER_T::VG2: PDATSEL2 Mask */ - -#define TAMPER_VG2_NDATSEL2_Pos (12) /*!< TAMPER_T::VG2: NDATSEL2 Position */ -#define TAMPER_VG2_NDATSEL2_Msk (0xful << TAMPER_VG2_NDATSEL2_Pos) /*!< TAMPER_T::VG2: NDATSEL2 Mask */ - -#define TAMPER_VG2_PCLKSEL3_Pos (16) /*!< TAMPER_T::VG2: PCLKSEL3 Position */ -#define TAMPER_VG2_PCLKSEL3_Msk (0xful << TAMPER_VG2_PCLKSEL3_Pos) /*!< TAMPER_T::VG2: PCLKSEL3 Mask */ - -#define TAMPER_VG2_NCLKSEL3_Pos (20) /*!< TAMPER_T::VG2: NCLKSEL3 Position */ -#define TAMPER_VG2_NCLKSEL3_Msk (0xful << TAMPER_VG2_NCLKSEL3_Pos) /*!< TAMPER_T::VG2: NCLKSEL3 Mask */ - -#define TAMPER_VG2_PDATSEL3_Pos (24) /*!< TAMPER_T::VG2: PDATSEL3 Position */ -#define TAMPER_VG2_PDATSEL3_Msk (0xful << TAMPER_VG2_PDATSEL3_Pos) /*!< TAMPER_T::VG2: PDATSEL3 Mask */ - -#define TAMPER_VG2_NDATSEL3_Pos (28) /*!< TAMPER_T::VG2: NDATSEL3 Position */ -#define TAMPER_VG2_NDATSEL3_Msk (0xful << TAMPER_VG2_NDATSEL3_Pos) /*!< TAMPER_T::VG2: NDATSEL3 Mask */ - -/**@}*/ /* TAMPER_CONST */ -/**@}*/ /* end of TAMPER register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __TAMPER_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/timer_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/timer_reg.h deleted file mode 100644 index 39cf4fa450f..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/timer_reg.h +++ /dev/null @@ -1,1168 +0,0 @@ -/**************************************************************************//** - * @file timer_reg.h - * @version V1.00 - * @brief TIMER register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TIMER_REG_H__ -#define __TIMER_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- Timer Controller -------------------------*/ -/** - @addtogroup TIMER Timer Controller(TIMER) - Memory Mapped Structure for TIMER Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var TIMER_T::CTL - * Offset: 0x00 Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PSC |Prescale Counter - * | | |Timer input clock or event source is divided by (PSC+1) before it is fed to the timer up counter - * | | |If this field is 0 (PSC = 0), then there is no scaling. - * | | |Note: Update prescale counter value will reset internal 8-bit prescale counter and 24-bit up counter value. - * |[15] |FUNCSEL |Function Selection - * | | |This bit sets the operation mode of Timer4 and Timer5 to PWM function. - * | | |0 = Timer controller is used as timer function. - * | | |1 = Timer controller is used as PWM function. - * | | |Note: The Timer0 ~ Timer3 function selection is controlled in TIMERx_ALTCTL[0], x= 0~3. - * |[19] |INTRGEN |Inter-timer Trigger Mode Enable Control - * | | |Setting this bit will enable the inter-timer trigger capture function. - * | | |The Timer0/2/4 will be in event counter mode and counting with external clock source or event - * | | |Also, Timer1/3/5 will be in trigger-counting mode of capture function. - * | | |0 = Inter-Timer Trigger Capture mode Disabled. - * | | |1 = Inter-Timer Trigger Capture mode Enabled. - * | | |Note: For Timer1/3/5, this bit is ignored and the read back value is always 0. - * |[20] |PERIOSEL |Periodic Mode Behavior Selection Enable Bit - * | | |0 = The behavior selection in periodic mode is Disabled. - * | | |When user updates CMPDAT while timer is running in periodic mode, CNT will be reset to default value. - * | | |1 = The behavior selection in periodic mode is Enabled. - * | | |When user update CMPDAT while timer is running in periodic mode, the limitations as bellows list, - * | | |If updated CMPDAT value > CNT, CMPDAT will be updated and CNT keep running continually. - * | | |If updated CMPDAT value = CNT, timer time-out interrupt will be asserted immediately. - * | | |If updated CMPDAT value < CNT, CNT will be reset to default value. - * |[21] |TGLPINSEL |Toggle-output Pin Select - * | | |0 = Toggle mode output to TMx (Timer Event Counter Pin). - * | | |1 = Toggle mode output to TMx_EXT (Timer External Capture Pin). - * |[22] |CAPSRC |Capture Pin Source Selection - * | | |0 = Capture Function source is from TMx_EXT (x= 0~5) pin. - * | | |1 = Capture Function source is from internal ACMP output signal, internal clock source (HIRC, LIRC, MIRC) or external clock (HXT, LXT). - * | | |Note1: When CAPSRC = 1, user can set INTERCAPSEL (TIMERx_EXTCTL[10:8]) to decide which internal ACMP output signal or which clock is as timer capture source. - * | | |Note2: MIRC clock source is only available in Timer4 ~ Timer5. - * |[23] |WKEN |Wake-up Function Enable Bit - * | | |If this bit is set to 1, while timer interrupt flag TIF (TIMERx_INTSTS[0]) is 1 and INTEN (TIMERx_CTL[29]) is enabled, the timer interrupt signal will generate a wake-up trigger event to CPU. - * | | |0 = Wake-up function Disabled if timer interrupt signal generated. - * | | |1 = Wake-up function Enabled if timer interrupt signal generated. - * |[24] |EXTCNTEN |Event Counter Mode Enable Bit - * | | |This bit is for external counting pin function enabled. - * | | |0 = Event counter mode Disabled. - * | | |1 = Event counter mode Enabled. - * | | |Note: When timer is used as an event counter, this bit should be set to 1 and select PCLK as timer clock source. - * |[25] |ACTSTS |Timer Active Status Bit (Read Only) - * | | |This bit indicates the 24-bit up counter status. - * | | |0 = 24-bit up counter is not active. - * | | |1 = 24-bit up counter is active. - * | | |Note: This bit may active when CNT 0 transition to CNT 1. - * |[28:27] |OPMODE |Timer Counting Mode Select - * | | |00 = The Timer controller is operated in One-shot mode. - * | | |01 = The Timer controller is operated in Periodic mode. - * | | |10 = The Timer controller is operated in Toggle-output mode. - * | | |11 = The Timer controller is operated in Continuous Counting mode. - * |[29] |INTEN |Timer Interrupt Enable Bit - * | | |0 = Timer time-out interrupt Disabled. - * | | |1 = Timer time-out interrupt Enabled. - * | | |Note: If this bit is enabled, when the timer time-out interrupt flag TIF is set to 1, the timer interrupt signal is generated and inform to CPU. - * |[30] |CNTEN |Timer Counting Enable Bit - * | | |0 = Stops/Suspends counting. - * | | |1 = Starts counting. - * | | |Note1: In stop status, and then set CNTEN to 1 will enable the 24-bit up counter to keep counting from the last stop counting value. - * | | |Note2: This bit is auto-cleared by hardware in one-shot mode (TIMER_CTL[28:27] = 00) when the timer time-out interrupt flag TIF (TIMERx_INTSTS[0]) is generated. - * | | |Note3: Set enable/disable this bit needs 2 * TMR_CLK period to become active, user can read ACTSTS (TIMERx_CTL[25]) to check enable/disable command is completed or not. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect) - * | | |0 = ICE debug mode acknowledgment effects TIMER counting. - * | | |TIMER counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgment Disabled. - * | | |TIMER counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var TIMER_T::CMP - * Offset: 0x04 Timer Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CMPDAT |Timer Comparator Value - * | | |CMPDAT is a 24-bit compared value register. - * | | |When the internal 24-bit up counter value is equal to CMPDAT value, the TIF (TIMERx_INTSTS[0] Timer Interrupt Flag) will set to 1. - * | | |Time-out period = (Period of timer clock input) * (8-bit PSC + 1) * (24-bit CMPDAT). - * | | |Note1: Never write 0x0 or 0x1 in CMPDAT field, or the core will run into unknown state. - * | | |Note2: When timer is operating at continuous counting mode, the 24-bit up counter will keep counting continuously even if user writes a new value into CMPDAT field. - * | | |But if timer is operating at other modes, the 24-bit up counter will restart counting from 0 and using newest CMPDAT value to be the timer compared value while user writes a new value into CMPDAT field. - * @var TIMER_T::INTSTS - * Offset: 0x08 Timer Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TIF |Timer Interrupt Flag - * | | |This bit indicates the interrupt flag status of Timer while 24-bit timer up counter CNT (TIMERx_CNT[23:0]) value reaches to CMPDAT (TIMERx_CMP[23:0]) value. - * | | |0 = No effect. - * | | |1 = CNT value matches the CMPDAT value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |TWKF |Timer Wake-up Flag - * | | |This bit indicates the interrupt wake-up flag status of timer. - * | | |0 = Timer does not cause CPU wake-up. - * | | |1 = CPU wake-up from Idle or Power-down mode if timer time-out interrupt signal generated. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::CNT - * Offset: 0x0C Timer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Timer Data Register - * | | |Read operation. - * | | |Read this register to get CNT value. For example: - * | | |If EXTCNTEN (TIMERx_CTL[24]) is 0, user can read CNT value for getting current 24-bit counter value. - * | | |If EXTCNTEN (TIMERx_CTL[24]) is 1, user can read CNT value for getting current 24-bit event input counter value. - * | | |Write operation. - * | | |Writing any value to this register will reset current CNT value to 0 and reload internal 8-bit prescale counter. - * |[31] |RSTACT |Timer Data Register Reset Active (Read Only) - * | | |This bit indicates if the counter reset operation active. - * | | |When user writes this CNT register, timer starts to reset its internal 24-bit timer up-counter to 0 and reload 8-bit pre-scale counter. - * | | |At the same time, timer set this flag to 1 to indicate the counter reset operation is in progress. - * | | |Once the counter reset operation done, timer clear this bit to 0 automatically. - * | | |0 = Reset operation is done. - * | | |1 = Reset operation triggered by writing TIMERx_CNT is in progress. - * | | |Note: This bit is read only. - * @var TIMER_T::CAP - * Offset: 0x10 Timer Capture Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CAPDAT |Timer Capture Data Register - * | | |When CAPEN (TIMERx_EXTCTL[3]) bit is set, the transition on the capture source matches the CAPEDGE (TIMERx_EXTCTL[14:12]) setting, - * | | |CAPIF (TIMERx_EINTSTS[0]) will set to 1 and the current timer counter value CNT (TIMERx_CNT[23:0]) will be auto-loaded into this CAPDAT field. - * @var TIMER_T::EXTCTL - * Offset: 0x14 Timer External Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTPHASE |Timer External Count Phase - * | | |This bit indicates the detection phase of external counting pin TMx (x= 0~5). - * | | |0 = A falling edge of external counting pin will be counted. - * | | |1 = A rising edge of external counting pin will be counted. - * |[3] |CAPEN |Timer Capture Function Enable Bit - * | | |This bit enables the capture input function. - * | | |0 = Timer capture function Disabled. - * | | |1 = Timer capture function Enabled. - * |[4] |CAPFUNCS |Capture Function Selection - * | | |0 = Capture Mode Enabled. - * | | |1 = Reset Mode Enabled. - * | | |Note1: When CAPFUNCS is 0 and CAPIF becomes 1, the current 24-bit timer counter value (CNT value) will be saved to CAPDAT field. - * | | |Note2: When CAPFUNCS is 1 and CAPIF becomes 1, the current 24-bit timer counter value (CNT value) will be saved to CAPDAT field then CNT value will be reset immediately. - * |[5] |CAPIEN |Timer Capture Interrupt Enable Bit - * | | |0 = TMx_EXT (x= 0~5), ACMP, internal clock, or external clock detection Interrupt Disabled. - * | | |1 = TMx_EXT (x= 0~5), ACMP, internal clock, or external clock detection Interrupt Enabled. - * | | |Note: CAPIEN is used to enable timer capture interrupt. - * | | |If CAPIEN enabled, timer will rise an interrupt when CAPIF (TIMERx_EINTSTS[0]) is 1. - * | | |For example, while CAPIEN = 1, CAPEN = 1, and CAPEDGE = 00, a 1 to 0 transition on the TMx_EXT pin, ACMP, internal clock, or external clock - * | | |will cause the CAPIF to be set then the interrupt signal is generated and sent to NVIC to inform CPU. - * |[6] |CAPDBEN |Timer Capture De-bounce Enable Bit - * | | |0 = TMx_EXT (x= 0~5) pin de-bounce or ACMP output de-bounce Disabled. - * | | |1 = TMx_EXT (x= 0~5) pin de-bounce or ACMP output de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx_EXT pin or ACMP output is detected with de-bounce circuit. - * |[7] |CNTDBEN |Timer External Counter Pin De-bounce Enable Bit - * | | |0 = TMx (x= 0~5) pin de-bounce Disabled. - * | | |1 = TMx (x= 0~5) pin de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx pin is detected with de-bounce circuit. - * |[10:8] |INTERCAPSEL|Internal Capture Source Select - * | | |000 = Capture Function source is from internal ACMP0 output signal. - * | | |001 = Capture Function source is from internal ACMP1 output signal. - * | | |010 = Capture Function source is from HXT. - * | | |011 = Capture Function source is from LXT. - * | | |100 = Capture Function source is from HIRC. - * | | |101 = Capture Function source is from LIRC. - * | | |101 = Capture Function source is from LIRC. - * | | |110 = Capture Function source is from MIRC, only available in Timer4 and Timer5. - * | | |111 = Reserved. - * | | |Note: These bits only available when CAPSRC (TIMERx_CTL[22]) is 1. - * |[14:12] |CAPEDGE |Timer Capture Edge Detect - * | | |When first capture event is generated, the CNT (TIMERx_CNT[23:0]) will be reset to 0 and first CAPDAT (TIMERx_CAP[23:0]) should be to 0. - * | | |000 = Capture event occurred when detect falling edge transfer on capture source. - * | | |001 = Capture event occurred when detect rising edge transfer on capture source. - * | | |010 = Capture event occurred when detect both falling and rising edge transfer on capture source, and the first capture event occurred at falling edge transfer. - * | | |011 = Capture event occurred when detect both rising and falling edge transfer on capture source, and the first capture event occurred at rising edge transfer. - * | | |110 = First capture event occurred at falling edge, follows capture events are at rising edge transfer on capture source. - * | | |111 = First capture event occurred at rising edge, follows capture events are at falling edge transfer on capture source. - * | | |100, 101 = Reserved. - * | | |Note: Set CAPSRC (TIMERx_CTL[22]) and INTERCAPSEL (TIMERx_EXTCTL[10:8]) to select capture source. - * |[16] |ECNTSSEL |Event Counter Source Selection to Trigger Event Counter Function - * | | |0 = Event Counter input source is from TMx (x= 0~5) pin. - * | | |1 = Event Counter input source is from USB internal SOF output signal. - * |[31:28] |CAPDIVSCL |Timer Capture Source Divider Scale - * | | |This bits indicate the divide scale for capture source divider. - * | | |0000 = Capture source/1. - * | | |0001 = Capture source/2. - * | | |0010 = Capture source/4. - * | | |0011 = Capture source/8. - * | | |0100 = Capture source/16. - * | | |0101 = Capture source/32. - * | | |0110 = Capture source/64. - * | | |0111 = Capture source/128. - * | | |1000 = Capture source/256. - * | | |1001~1111 = Reserved. - * | | |Note: Sets INTERCAPSEL (TIMERx_EXTCTL[10:8]) and CAPSRC (TIMERx_CTL[22]) to select capture source. - * @var TIMER_T::EINTSTS - * Offset: 0x18 Timer External Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPIF |Timer Capture Interrupt Flag - * | | |This bit indicates the timer capture interrupt flag status. - * | | |0 = TMx_EXT (x= 0~5) pin, ACMP, internal clock, or external clock capture interrupt did not occur. - * | | |1 = TMx_EXT (x= 0~5) pin, ACMP, internal clock, or external clock capture interrupt occurred. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: When CAPEN (TIMERx_EXTCTL[3]) bit is set, the transition on the capture source matches the CAPEDGE (TIMERx_EXTCTL[14:12]) setting, this bit will set to 1 by hardware. - * | | |Note3: There is a new incoming capture event detected before CPU clearing the CAPIF status. - * | | |If the above condition occurred, the timer will keep register TIMERx_CAP unchanged and drop the new capture value. - * @var TIMER_T::TRGCTL - * Offset: 0x1C Timer Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRGSSEL |Trigger Source Select Bit - * | | |This bit is used to select internal trigger source is form timer time-out interrupt signal or capture interrupt signal. - * | | |0 = Time-out interrupt signal is used to internal trigger EPWM/BPWM, PDMA, DAC, and EADC. - * | | |1 = Capture interrupt signal is used to internal trigger EPWM/BPWM, PDMA, DAC, and EADC. - * |[1] |TRGPWM |Trigger EPWM and BPWM Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be as EPWM and BPWM counter clock source. - * | | |0 = Timer interrupt trigger EPWM and BPWM Disabled. - * | | |1 = Timer interrupt trigger EPWM and BPWM Enabled. - * | | |Note1: This bit is not available in Timer4 and Timer5. - * | | |Note2: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal as EPWM and BPWM counter clock source. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal as EPWM and BPWM counter clock source. - * |[2] |TRGEADC |Trigger EADC Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered EADC conversion. - * | | |0 = Timer interrupt trigger EADC Disabled. - * | | |1 = Timer interrupt trigger EADC Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger EADC conversion. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger EADC conversion. - * |[3] |TRGDAC |Trigger DAC Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered DAC. - * | | |0 = Timer interrupt trigger DAC Disabled. - * | | |1 = Timer interrupt trigger DAC Enabled. - * | | |Note1: This bit is not available in Timer4 and Timer5. - * | | |Note2: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger DAC. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger DAC. - * |[4] |TRGPDMA |Trigger PDMA Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered PDMA transfer. - * | | |0 = Timer interrupt trigger PDMA Disabled. - * | | |1 = Timer interrupt trigger PDMA Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger PDMA transfer. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger PDMA transfer. - * @var TIMER_T::ALTCTL - * Offset: 0x20 Timer Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FUNCSEL |Function Selection - * | | |This bit sets the operation mode of Timer0 ~ Timer3 to PWM function. - * | | |0 = Timer controller is used as timer function. - * | | |1 = Timer controller is used as PWM function. - * | | |Note1: The Timer4 and Timer5 function selection is controlled in TIMERx_CTL[15], x= 4~5. - * | | |Note2: When timer is used as PWM, the clock source of time controller will be forced to PCLKx automatically. - * @var TIMER_T::PWMCTL - * Offset: 0x40 Timer PWM Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN |PWM Counter Enable Bit - * | | |0 = PWM counter and clock prescale Stop Running. - * | | |1 = PWM counter and clock prescale Start Running. - * |[2:1] |CNTTYPE |PWM Counter Behavior Type - * | | |These bits are used to set the count type of Timer0 ~ Timer3. The count type of Timer4 and Timer5 is fixed as the up count type. - * | | |00 = Up count type. - * | | |01 = Down count type. - * | | |10 = Up-down count type. - * | | |11 = Reserved. - * | | |Note: These bits are not available in Timer4 and Timer5. - * |[3] |CNTMODE |PWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[8] |CTRLD |Center Re-load - * | | |In up-down count type, PERIOD will load to PBUF when current PWM period is completed always and CMP will load to CMPBUF at the center point of current period. - * | | |Note: This bit is not available in Timer4 and Timer5. - * |[9] |IMMLDEN |Immediately Load Enable Bit - * | | |0 = PERIOD will load to PBUF when current PWM period is completed no matter CTRLD is enabled/disabled. - * | | |If CTRLD is disabled, CMP will load to CMPBUF when current PWM period is completed; if CTRLD is enabled in up-down count type, CMP will load to CMPBUF at the center point of current period. - * | | |1 = PERIOD/CMP will load to PBUF/CMPBUF immediately when user update PERIOD/CMP. - * | | |Note1: This bit is not available in Timer4 and Timer5. - * | | |Note2: If IMMLDEN is enabled, CTRLD will be invalid. - * |[12] |WKEN |PWM Wake-up Enable Bit - * | | |If this bit is set to 1, the Timer4 and Timer5 PWM interrupt eventl will generate a wake-up trigger event to CPU. - * | | |0 = PWM interrupt wake-up Disabled. - * | | |1 = PWM interrupt wake-up Enabled. - * | | |Note: This bit is only available in Timer4 and Timer5. - * |[16] |OUTMODE |PWM Output Mode - * | | |This bit controls the output mode of corresponding PWM channel. - * | | |0 = PWM independent mode. - * | | |1 = PWM complementary mode. - * | | |Note: This bit is not available in Timer4 and Timer5. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If debug mode counter halt is enabled, PWM counter will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt disable. - * | | |1 = ICE debug mode counter halt enable. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgment effects PWM output. - * | | |PWM output pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgment disabled. - * | | |PWM output pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var TIMER_T::PWMCLKSRC - * Offset: 0x44 Timer PWM Counter Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |CLKSRC |PWM Counter Clock Source Select - * | | |The PWM counter clock source can be selected from TMRx_CLK or internal timer time-out or capture event in Timer0 ~ Timer3. - * | | |000 = TMRx_CLK. - * | | |001 = Internal TIMER0 time-out or capture event. - * | | |010 = Internal TIMER1 time-out or capture event. - * | | |011 = Internal TIMER2 time-out or capture event. - * | | |100 = Internal TIMER3 time-out or capture event. - * | | |Others = Reserved. - * | | |Note1: These bits are not available in Timer4 and Timer5. - * | | |Note2: If TIMER0 PWM function is enabled, the PWM counter clock source can be selected from TMR0_CLK, TIMER1 interrupt events, TIMER2 interrupt events, or TIMER3 interrupt events. - * @var TIMER_T::PWMCLKPSC - * Offset: 0x48 Timer PWM Counter Clock Pre-scale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |PWM Counter Clock Pre-scale - * | | |The active clock of PWM counter is decided by counter clock prescale and divided by (CLKPSC + 1). - * | | |If CLKPSC is 0, then there is no scaling in PWM counter clock source. - * | | |Note: The valid value is 12-bit TIMERx_PWMCLKPSC[11:0] in Timer0 ~ Timer3, and 8-bit TIMERx_PWMCLKPSC[7:0] in Timer4 and Timer5. - * @var TIMER_T::PWMCNTCLR - * Offset: 0x4C Timer PWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR |Clear PWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = In Timer0 ~ Timer3, clears 16-bit PWM counter to 0x10000 in up and up-down count type and reset counter value to PERIOD in down count type. - * | | |In Timer4 and Timer5, clears 16-bit PWM counter to 0x0 in up count type. - * @var TIMER_T::PWMPERIOD - * Offset: 0x50 Timer PWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |PWM Period Register - * | | |In up count type: PWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |In down count type: PWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |In up-down count type: PWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |In up and down count type: - * | | |PWM period time = (PERIOD + 1) * (CLKPSC + 1) * TMRx_PWMCLK. - * | | |In up-down count type: - * | | |PWM period time = 2 * PERIOD * (CLKPSC+ 1) * TMRx_PWMCLK. - * | | |Note1: The count type of Timer4 and Timer5 is fixed as up count type. - * | | |Note2: User should take care DIRF (TIMERx_PWMCNT[16]) bit in up/down/up-down count type to monitor current counter direction in each count type in Timer0 ~ Timer3. - * @var TIMER_T::PWMCMPDAT - * Offset: 0x54 Timer PWM Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |PWM Comparator Register - * | | |PWM CMP is used to compare with PWM CNT to generate PWM output waveform, interrupt events and trigger EADC and PDMA to start conversion. - * @var TIMER_T::PWMDTCTL - * Offset: 0x58 Timer PWM Dead-Time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following two formulas: - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK, if DTCKSEL is 0. - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK * (CLKPSC + 1), if DTCKSEL is 1. - * | | |Note: These bits are write protected. Refer to SYS_REGLCTL register. - * |[16] |DTEN |Enable Dead-time Insertion for PWMx_CH0 and PWMx_CH1 (Write Protect) - * | | |Dead-time insertion function is only active when PWM complementary mode is enabled. - * | | |If dead-time insertion is inactive, the outputs of PWMx_CH0 and PWMx_CH1 are complementary without any delay. - * | | |0 = Dead-time insertion Disabled on the pin pair. - * | | |1 = Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from TMRx_PWMCLK without counter clock prescale. - * | | |1 = Dead-time clock source from TMRx_PWMCLK with counter clock prescale. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var TIMER_T::PWMCNT - * Offset: 0x5C Timer PWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |PWM Counter Value Register (Read Only) - * | | |User can monitor CNT to know the current counter value in 16-bit period counter. - * |[16] |DIRF |PWM Counter Direction Indicator Flag (Read Only) - * | | |0 = Counter is active in down count. - * | | |1 = Counter is active up count. - * | | |Note1: This indicator flag is used for Timer0 ~ Timer3 only. - * | | |Note2: Since the count type of Timer4 ~ Timer5 is fixed as up count, this bit is fixed 0 in Timer4 and Timer5. - * @var TIMER_T::PWMMSKEN - * Offset: 0x60 Timer PWM Output Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |PWMx_CH0 Output Mask Enable Bit - * | | |The PWMx_CH0 output signal will be masked when this bit is enabled. - * | | |The PWMx_CH0 will output MSKDAT0 (TIMERx_PWMMSK[0]) data. - * | | |0 = PWMx_CH0 output signal is non-masked. - * | | |1 = PWMx_CH0 output signal is masked and output MSKDAT0 data. - * |[1] |MSKEN1 |PWMx_CH1 Output Mask Enable Bit - * | | |The PWMx_CH1 output signal will be masked when this bit is enabled. - * | | |The PWMx_CH1 will output MSKDAT1 (TIMERx_PWMMSK[1]) data. - * | | |0 = PWMx_CH1 output signal is non-masked. - * | | |1 = PWMx_CH1 output signal is masked and output MSKDAT1 data. - * @var TIMER_T::PWMMSK - * Offset: 0x64 Timer PWM Output Mask Data Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |PWMx_CH0 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH0 pin when PWMx_CH0 output mask function is enabled (MSKEN0 = 1). - * | | |0 = Output logic Low to PWMx_CH0. - * | | |1 = Output logic High to PWMx_CH0. - * |[1] |MSKDAT1 |PWMx_CH1 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH1 pin when PWMx_CH1 output mask function is enabled (MSKEN1 = 1). - * | | |0 = Output logic Low to PWMx_CH1. - * | | |1 = Output logic High to PWMx_CH1. - * @var TIMER_T::PWMBNF - * Offset: 0x68 Timer PWM Brake Pin Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKNFEN |Brake Pin Noise Filter Enable Bit - * | | |0 = Pin noise filter detect of PWMx_BRAKEy Disabled. - * | | |1 = Pin noise filter detect of PWMx_BRAKEy Enabled. - * |[3:1] |BRKNFSEL |Brake Pin Noise Filter Clock Selection - * | | |000 = Noise filter clock is PCLKx. - * | | |001 = Noise filter clock is PCLKx/2. - * | | |010 = Noise filter clock is PCLKx/4. - * | | |011 = Noise filter clock is PCLKx/8. - * | | |100 = Noise filter clock is PCLKx/16. - * | | |101 = Noise filter clock is PCLKx/32. - * | | |110 = Noise filter clock is PCLKx/64. - * | | |111 = Noise filter clock is PCLKx/128. - * |[6:4] |BRKFCNT |Brake Pin Noise Filter Count - * | | |The fields is used to control the active noise filter sample time. - * | | |Once noise filter sample time = (Period time of BRKNFSEL) * (BRKFCNT + 1). - * |[7] |BRKPINV |Brake Pin Detection Control Bit - * | | |0 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from high to low in edge-detect, or pin status is low in level-detect . - * |[17:16] |BKPINSRC |Brake Pin Source Select - * | | |00 = Brake pin source comes from PWM0_BRAKE0 pin. - * | | |01 = Brake pin source comes from PWM0_BRAKE1 pin. - * | | |10 = Brake pin source comes from PWM1_BRAKE0 pin. - * | | |11 = Brake pin source comes from PWM1_BRAKE1 pin. - * @var TIMER_T::PWMFAILBRK - * Offset: 0x6C Timer PWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by clock fail detection Disabled. - * | | |1 = Brake Function triggered by clock fail detection Enabled. - * |[1] |BODBRKEN |Brown-out Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by BOD event Disabled. - * | | |1 = Brake Function triggered by BOD event Enabled. - * |[2] |RAMBRKEN |SRAM Parity Error Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by SRAM parity error detection Disabled. - * | | |1 = Brake Function triggered by SRAM parity error detection Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by core lockup event Disabled. - * | | |1 = Brake Function triggered by core lockup event Enabled. - * @var TIMER_T::PWMBRKCTL - * Offset: 0x70 Timer PWM Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CPO0EBEN |Enable Internal ACMP0_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP0_O signal as edge-detect brake source Disabled. - * | | |1 = Internal ACMP0_O signal as edge-detect brake source Enabled. - * | | |Note1: Only internal ACMP0_O signal from low to high will be detected as brake event. - * | | |Note2: This bit is write protected. Refer to SYS_REGLCTL register. - * |[1] |CPO1EBEN |Enable Internal ACMP1_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP1_O signal as edge-detect brake source Disabled. - * | | |1 = Internal ACMP1_O signal as edge-detect brake source Enabled. - * | | |Note1: Only internal ACMP1_O signal from low to high will be detected as brake event. - * | | |Note2: This bit is write protected. Refer to SYS_REGLCTL register. - * |[4] |BRKPEEN |Enable TM_BRAKEx Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as edge-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System fail condition as edge-detect brake source Disabled. - * | | |1 = System fail condition as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[8] |CPO0LBEN |Enable Internal ACMP0_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP0_O signal as level-detect brake source Disabled. - * | | |1 = Internal ACMP0_O signal as level-detect brake source Enabled. - * | | |Note1: Only internal ACMP0_O signal from low to high will be detected as brake event. - * | | |Note2: This bit is write protected. Refer to SYS_REGLCTL register. - * |[9] |CPO1LBEN |Enable Internal ACMP1_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP1_O signal as level-detect brake source Disabled. - * | | |1 = Internal ACMP1_O signal as level-detect brake source Enabled. - * | | |Note1: Only internal ACMP1_O signal from low to high will be detected as brake event. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[12] |BRKPLEN |Enable TM_BRAKEx Pin As Level-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as level-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System fail condition as level-detect brake source Disabled. - * | | |1 = System fail condition as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[17:16] |BRKAEVEN |PWM Brake Action Select for PWMx_CH0 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH0 output. - * | | |01 = PWMx_CH0 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH0 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH0 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: These bits are write protected. Refer to SYS_REGLCTL register. - * |[19:18] |BRKAODD |PWM Brake Action Select for PWMx_CH1 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH1 output. - * | | |01 = PWMx_CH1 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH1 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH1 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: These bits are write protected. Refer to SYS_REGLCTL register. - * @var TIMER_T::PWMPOLCTL - * Offset: 0x74 Timer PWM Pin Output Polar Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |PWMx_CH0 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH0 output pin. - * | | |0 = PWMx_CH0 output pin polar inverse Disabled. - * | | |1 = PWMx_CH0 output pin polar inverse Enabled. - * | | |Note: In Timer4 and Timer5, the PWMx_CH0 output pin can be selected as TMx or TMx_EXT pin by POSEL (TIMERx_PWMPOEN[8]), x= 4~5. - * |[1] |PINV1 |PWMx_CH1 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH1 output pin. - * | | |0 = PWMx_CH1 output pin polar inverse Disabled. - * | | |1 = PWMx_CH1 output pin polar inverse Enabled. - * | | |Note: This bit is not available in Timer4 and Timer5. - * @var TIMER_T::PWMPOEN - * Offset: 0x78 Timer PWM Pin Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |PWMx_CH0 Output Pin Enable Bit - * | | |0 = PWMx_CH0 pin at tri-state mode. - * | | |1 = PWMx_CH0 pin in output mode. - * | | |Note: In Timer4 and Timer5, the PWMx_CH0 output pin can be selected as TMx or TMx_EXT pin by POSEL (TIMERx_PWMPOEN[8]), x= 4~5. - * |[1] |POEN1 |PWMx_CH1 Output Pin Enable Bit - * | | |0 = PWMx_CH1 pin at tri-state mode. - * | | |1 = PWMx_CH1 pin in output mode. - * | | |Note: This bit is not available in Timer4 and Timer5. - * |[8] |POSEL |PWMx_CH0 Output Pin Select - * | | |This bit is used to select the output channel of Timer4 and Timer5 PWM. - * | | |0 = PWMx_CH0 pin is TMx. - * | | |1 = PWMx_CH0 pin is TMx_EXT. - * | | |Note: This bit is only available in Timer4 and Timer5. - * @var TIMER_T::PWMSWBRK - * Offset: 0x7C Timer PWM Software Trigger Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG |Software Trigger Edge-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM edge-detect brake source, then BRKEIF0 and BRKEIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[8] |BRKLTRG |Software Trigger Level-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM level-detect brake source, then BRKLIF0 and BRKLIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var TIMER_T::PWMINTEN0 - * Offset: 0x80 Timer PWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN |PWM Zero Point Interrupt Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: This bit is not available in Timer4 and Timer5. - * |[1] |PIEN |PWM Period Point Interrupt Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: In up-down count type, period point means the center point of current PWM period. - * |[2] |CMPUIEN |PWM Compare Up Count Interrupt Enable Bit - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[3] |CMPDIEN |PWM Compare Down Count Interrupt Enable Bit - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: This bit is not available in Timer4 and Timer5. - * @var TIMER_T::PWMINTEN1 - * Offset: 0x84 Timer PWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN |PWM Edge-detect Brake Interrupt Enable (Write Protect) - * | | |0 = PWM edge-detect brake interrupt Disabled. - * | | |1 = PWM edge-detect brake interrupt Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[8] |BRKLIEN |PWM Level-detect Brake Interrupt Enable (Write Protect) - * | | |0 = PWM level-detect brake interrupt Disabled. - * | | |1 = PWM level-detect brake interrupt Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var TIMER_T::PWMINTSTS0 - * Offset: 0x88 Timer PWM Interrupt Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF |PWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches zero. - * | | |Note1: This bit is not available in Timer4 and Timer5. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[1] |PIF |PWM Period Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches PERIOD. - * | | |Note1: In up-down count type, PIF flag means the center point flag of current PWM period. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[2] |CMPUIF |PWM Compare Up Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in up count direction and reaches CMP. - * | | |Note1: If CMP equal to PERIOD, there is no CMPUIF flag in up count type and up-down count type.. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[3] |CMPDIF |PWM Compare Down Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in down count direction and reaches CMP. - * | | |Note1: This bit is not available in Timer4 and Timer5. - * | | |Note2: If CMP equal to PERIOD, there is no CMPDIF flag in down count type. - * | | |Note3: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMINTSTS1 - * Offset: 0x8C Timer PWM Interrupt Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |Edge-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 edge-detect brake event do not happened. - * | | |1 = PWMx_CH0 edge-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This bit is write protected. Refer to SYS_REGLCTL register. - * |[1] |BRKEIF1 |Edge-detect Brake Interrupt Flag PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 edge-detect brake event do not happened. - * | | |1 = PWMx_CH1 edge-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This bit is write protected. Refer to SYS_REGLCTL register. - * |[8] |BRKLIF0 |Level-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 level-detect brake event do not happened. - * | | |1 = PWMx_CH0 level-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This bit is write protected. Refer to SYS_REGLCTL register. - * |[9] |BRKLIF1 |Level-detect Brake Interrupt Flag on PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 level-detect brake event do not happened. - * | | |1 = PWMx_CH1 level-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This bit is write protected. Refer to SYS_REGLCTL register. - * |[16] |BRKESTS0 |Edge -detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 edge-detect brake state is released. - * | | |1 = PWMx_CH0 at edge-detect brake state. - * | | |Note: User can set BRKEIF0 1 to clear BRKEIF0 flag and PWMx_CH0 will release brake state when current PWM period finished and resume PWMx_CH0 output waveform start from next full PWM period. - * |[17] |BRKESTS1 |Edge-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 edge-detect brake state is released. - * | | |1 = PWMx_CH1 at edge-detect brake state. - * | | |Note: User can set BRKEIF1 1 to clear BRKEIF1 flag and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH1 output waveform start from next full PWM period. - * |[24] |BRKLSTS0 |Level-detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 level-detect brake state is released. - * | | |1 = PWMx_CH0 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * |[25] |BRKLSTS1 |Level-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 level-detect brake state is released. - * | | |1 = PWMx_CH1 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * @var TIMER_T::PWMTRGCTL - * Offset: 0x90 Timer PWM Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TRGSEL |PWM Counter Event Source Select to Trigger Conversion - * | | |In Timer0 ~ Timer3, - * | | |000 = Trigger conversion at zero point (ZIF). - * | | |001 = Trigger conversion at period point (PIF). - * | | |010 = Trigger conversion at zero or period point (ZIF or PIF). - * | | |011 = Trigger conversion at compare up count point (CMPUIF). - * | | |100 = Trigger conversion at compare down count point (CMPDIF). - * | | |In Timer4 and Timer5, - * | | |001 = Trigger conversion at period point (PIF). - * | | |011 = Trigger conversion at compare up count point (CMPUIF). - * | | |101 = Trigger conversion at period or compare up count point (PIF or CMPUIF). - * | | |Others = Reserved. - * |[7] |TRGEADC |PWM Counter Event Trigger EADC Conversion Enable Bit - * | | |0 = PWM counter event trigger EADC conversion Disabled. - * | | |1 = PWM counter event trigger EADC conversion Enabled. - * | | |Note: Set TRGSEL (TIMERx_PWMTRGCTL[2:0]) to select PWM trigger conversion source. - * |[9] |TRGPDMA |PWM Counter Event Trigger PDMA Conversion Enable Bit - * | | |0 = PWM counter event trigger PDMA conversion Disabled. - * | | |1 = PWM counter event trigger PDMA conversion Enabled. - * | | |Note: Set TRGSEL (TIMERx_PWMTRGCTL[2:0]) to select PWM trigger conversion source. - * @var TIMER_T::PWMSCTL - * Offset: 0x94 Timer PWM Synchronous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SYNCMODE |PWM Synchronous Mode Enable Select - * | | |00 = PWM synchronous function Disabled. - * | | |01 = PWM synchronous counter start function Enabled. - * | | |10 = Reserved. - * | | |11 = PWM synchronous counter clear function Enabled. - * |[8] |SYNCSRC |PWM Synchronous Counter Start/Clear Source Select - * | | |0 = Counter synchronous start/clear by trigger TIMER0_PWMSTRG STRGEN. - * | | |1 = Counter synchronous start/clear by trigger TIMER2_PWMSTRG STRGEN. - * | | |Note1: If TIMER0/1/2/3 PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8], TIMER1_PWMSCTL[8], TIMER2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be 0. - * | | |Note2: If TIMER0/1/ PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8] and TIMER1_PWMSCTL[8] should be set 0, and TIMER2/3/ PWM counter synchronous source are from TIMER2, TIME2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be set 1. - * @var TIMER_T::PWMSTRG - * Offset: 0x98 Timer PWM Synchronous Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STRGEN |PWM Counter Synchronous Trigger Enable Bit (Write Only) - * | | |PMW counter synchronous function is used to make selected PWM channels (include TIMER0/1/2/3 PWM, TIMER0/1 PWM and TIMER2/3 PWM) start counting or clear counter at the same time according to TIMERx_PWMSCTL setting. - * | | |Note: This bit is only available in TIMER0 and TIMER2. - * @var TIMER_T::PWMSTATUS - * Offset: 0x9C Timer PWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF |PWM Counter Equal to 0xFFFF Flag - * | | |0 = The PWM counter value never reached its maximum value 0xFFFF. - * | | |1 = The PWM counter value has reached its maximum value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[8] |WKF |PWM Wake-up Flag - * | | |0 = PWM interrupt wake-up has not occurred. - * | | |1 = PWM interrupt wake-up has occurred. - * | | |Note1: This bit is only available in Timer4 and Timer5. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[16] |EADCTRGF |Trigger EADC Start Conversion Flag - * | | |0 = PWM counter event trigger EADC start conversion is not occurred. - * | | |1 = PWM counter event trigger EADC start conversion has occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[19] |PDMATRGF |Trigger PDMA Start Conversion Flag - * | | |0 = PWM counter event trigger PDMA start conversion is not occurred. - * | | |1 = PWM counter event trigger PDMA start conversion has occurred. - * | | |Note1: This bit is only available in Timer4 and Timer5. - * | | |Note2: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMPBUF - * Offset: 0xA0 Timer PWM Period Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |PWM Period Buffer Register (Read Only) - * | | |Used as PERIOD active register. - * @var TIMER_T::PWMCMPBUF - * Offset: 0xA4 Timer PWM Comparator Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |PWM Comparator Buffer Register (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL; /*!< [0x0000] Timer Control Register */ - __IO uint32_t CMP; /*!< [0x0004] Timer Comparator Register */ - __IO uint32_t INTSTS; /*!< [0x0008] Timer Interrupt Status Register */ - __IO uint32_t CNT; /*!< [0x000c] Timer Data Register */ - __I uint32_t CAP; /*!< [0x0010] Timer Capture Data Register */ - __IO uint32_t EXTCTL; /*!< [0x0014] Timer External Control Register */ - __IO uint32_t EINTSTS; /*!< [0x0018] Timer External Interrupt Status Register */ - __IO uint32_t TRGCTL; /*!< [0x001c] Timer Trigger Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0020] Timer Alternative Control Register */ - __I uint32_t RESERVE0[7]; - __IO uint32_t PWMCTL; /*!< [0x0040] Timer PWM Control Register */ - __IO uint32_t PWMCLKSRC; /*!< [0x0044] Timer PWM Counter Clock Source Register */ - __IO uint32_t PWMCLKPSC; /*!< [0x0048] Timer PWM Counter Clock Pre-scale Register */ - __IO uint32_t PWMCNTCLR; /*!< [0x004c] Timer PWM Clear Counter Register */ - __IO uint32_t PWMPERIOD; /*!< [0x0050] Timer PWM Period Register */ - __IO uint32_t PWMCMPDAT; /*!< [0x0054] Timer PWM Comparator Register */ - __IO uint32_t PWMDTCTL; /*!< [0x0058] Timer PWM Dead-Time Control Register */ - __I uint32_t PWMCNT; /*!< [0x005c] Timer PWM Counter Register */ - __IO uint32_t PWMMSKEN; /*!< [0x0060] Timer PWM Output Mask Enable Register */ - __IO uint32_t PWMMSK; /*!< [0x0064] Timer PWM Output Mask Data Control Register */ - __IO uint32_t PWMBNF; /*!< [0x0068] Timer PWM Brake Pin Noise Filter Register */ - __IO uint32_t PWMFAILBRK; /*!< [0x006c] Timer PWM System Fail Brake Control Register */ - __IO uint32_t PWMBRKCTL; /*!< [0x0070] Timer PWM Brake Control Register */ - __IO uint32_t PWMPOLCTL; /*!< [0x0074] Timer PWM Pin Output Polar Control Register */ - __IO uint32_t PWMPOEN; /*!< [0x0078] Timer PWM Pin Output Enable Register */ - __O uint32_t PWMSWBRK; /*!< [0x007c] Timer PWM Software Trigger Brake Control Register */ - __IO uint32_t PWMINTEN0; /*!< [0x0080] Timer PWM Interrupt Enable Register 0 */ - __IO uint32_t PWMINTEN1; /*!< [0x0084] Timer PWM Interrupt Enable Register 1 */ - __IO uint32_t PWMINTSTS0; /*!< [0x0088] Timer PWM Interrupt Status Register 0 */ - __IO uint32_t PWMINTSTS1; /*!< [0x008c] Timer PWM Interrupt Status Register 1 */ - __IO uint32_t PWMTRGCTL; /*!< [0x0090] Timer PWM Trigger Control Register */ - __IO uint32_t PWMSCTL; /*!< [0x0094] Timer PWM Synchronous Control Register */ - __O uint32_t PWMSTRG; /*!< [0x0098] Timer PWM Synchronous Trigger Register */ - __IO uint32_t PWMSTATUS; /*!< [0x009c] Timer PWM Status Register */ - __I uint32_t PWMPBUF; /*!< [0x00a0] Timer PWM Period Buffer Register */ - __I uint32_t PWMCMPBUF; /*!< [0x00a4] Timer PWM Comparator Buffer Register */ - -} TIMER_T; - -/** - @addtogroup TIMER_CONST TIMER Bit Field Definition - Constant Definitions for TIMER Controller - @{ -*/ - -#define TIMER_CTL_PSC_Pos (0) /*!< TIMER_T::CTL: PSC Position */ -#define TIMER_CTL_PSC_Msk (0xfful << TIMER_CTL_PSC_Pos) /*!< TIMER_T::CTL: PSC Mask */ - -#define TIMER_CTL_FUNCSEL_Pos (15) /*!< TIMER_T::CTL: FUNCSEL Position */ -#define TIMER_CTL_FUNCSEL_Msk (0x1ul << TIMER_CTL_FUNCSEL_Pos) /*!< TIMER_T::CTL: FUNCSEL Mask */ - -#define TIMER_CTL_INTRGEN_Pos (19) /*!< TIMER_T::CTL: INTRGEN Position */ -#define TIMER_CTL_INTRGEN_Msk (0x1ul << TIMER_CTL_INTRGEN_Pos) /*!< TIMER_T::CTL: INTRGEN Mask */ - -#define TIMER_CTL_PERIOSEL_Pos (20) /*!< TIMER_T::CTL: PERIOSEL Position */ -#define TIMER_CTL_PERIOSEL_Msk (0x1ul << TIMER_CTL_PERIOSEL_Pos) /*!< TIMER_T::CTL: PERIOSEL Mask */ - -#define TIMER_CTL_TGLPINSEL_Pos (21) /*!< TIMER_T::CTL: TGLPINSEL Position */ -#define TIMER_CTL_TGLPINSEL_Msk (0x1ul << TIMER_CTL_TGLPINSEL_Pos) /*!< TIMER_T::CTL: TGLPINSEL Mask */ - -#define TIMER_CTL_CAPSRC_Pos (22) /*!< TIMER_T::CTL: CAPSRC Position */ -#define TIMER_CTL_CAPSRC_Msk (0x1ul << TIMER_CTL_CAPSRC_Pos) /*!< TIMER_T::CTL: CAPSRC Mask */ - -#define TIMER_CTL_WKEN_Pos (23) /*!< TIMER_T::CTL: WKEN Position */ -#define TIMER_CTL_WKEN_Msk (0x1ul << TIMER_CTL_WKEN_Pos) /*!< TIMER_T::CTL: WKEN Mask */ - -#define TIMER_CTL_EXTCNTEN_Pos (24) /*!< TIMER_T::CTL: EXTCNTEN Position */ -#define TIMER_CTL_EXTCNTEN_Msk (0x1ul << TIMER_CTL_EXTCNTEN_Pos) /*!< TIMER_T::CTL: EXTCNTEN Mask */ - -#define TIMER_CTL_ACTSTS_Pos (25) /*!< TIMER_T::CTL: ACTSTS Position */ -#define TIMER_CTL_ACTSTS_Msk (0x1ul << TIMER_CTL_ACTSTS_Pos) /*!< TIMER_T::CTL: ACTSTS Mask */ - -#define TIMER_CTL_OPMODE_Pos (27) /*!< TIMER_T::CTL: OPMODE Position */ -#define TIMER_CTL_OPMODE_Msk (0x3ul << TIMER_CTL_OPMODE_Pos) /*!< TIMER_T::CTL: OPMODE Mask */ - -#define TIMER_CTL_INTEN_Pos (29) /*!< TIMER_T::CTL: INTEN Position */ -#define TIMER_CTL_INTEN_Msk (0x1ul << TIMER_CTL_INTEN_Pos) /*!< TIMER_T::CTL: INTEN Mask */ - -#define TIMER_CTL_CNTEN_Pos (30) /*!< TIMER_T::CTL: CNTEN Position */ -#define TIMER_CTL_CNTEN_Msk (0x1ul << TIMER_CTL_CNTEN_Pos) /*!< TIMER_T::CTL: CNTEN Mask */ - -#define TIMER_CTL_ICEDEBUG_Pos (31) /*!< TIMER_T::CTL: ICEDEBUG Position */ -#define TIMER_CTL_ICEDEBUG_Msk (0x1ul << TIMER_CTL_ICEDEBUG_Pos) /*!< TIMER_T::CTL: ICEDEBUG Mask */ - -#define TIMER_CMP_CMPDAT_Pos (0) /*!< TIMER_T::CMP: CMPDAT Position */ -#define TIMER_CMP_CMPDAT_Msk (0xfffffful << TIMER_CMP_CMPDAT_Pos) /*!< TIMER_T::CMP: CMPDAT Mask */ - -#define TIMER_INTSTS_TIF_Pos (0) /*!< TIMER_T::INTSTS: TIF Position */ -#define TIMER_INTSTS_TIF_Msk (0x1ul << TIMER_INTSTS_TIF_Pos) /*!< TIMER_T::INTSTS: TIF Mask */ - -#define TIMER_INTSTS_TWKF_Pos (1) /*!< TIMER_T::INTSTS: TWKF Position */ -#define TIMER_INTSTS_TWKF_Msk (0x1ul << TIMER_INTSTS_TWKF_Pos) /*!< TIMER_T::INTSTS: TWKF Mask */ - -#define TIMER_CNT_CNT_Pos (0) /*!< TIMER_T::CNT: CNT Position */ -#define TIMER_CNT_CNT_Msk (0xfffffful << TIMER_CNT_CNT_Pos) /*!< TIMER_T::CNT: CNT Mask */ - -#define TIMER_CNT_RSTACT_Pos (31) /*!< TIMER_T::CNT: RSTACT Position */ -#define TIMER_CNT_RSTACT_Msk (0x1ul << TIMER_CNT_RSTACT_Pos) /*!< TIMER_T::CNT: RSTACT Mask */ - -#define TIMER_CAP_CAPDAT_Pos (0) /*!< TIMER_T::CAP: CAPDAT Position */ -#define TIMER_CAP_CAPDAT_Msk (0xfffffful << TIMER_CAP_CAPDAT_Pos) /*!< TIMER_T::CAP: CAPDAT Mask */ - -#define TIMER_EXTCTL_CNTPHASE_Pos (0) /*!< TIMER_T::EXTCTL: CNTPHASE Position */ -#define TIMER_EXTCTL_CNTPHASE_Msk (0x1ul << TIMER_EXTCTL_CNTPHASE_Pos) /*!< TIMER_T::EXTCTL: CNTPHASE Mask */ - -#define TIMER_EXTCTL_CAPEN_Pos (3) /*!< TIMER_T::EXTCTL: CAPEN Position */ -#define TIMER_EXTCTL_CAPEN_Msk (0x1ul << TIMER_EXTCTL_CAPEN_Pos) /*!< TIMER_T::EXTCTL: CAPEN Mask */ - -#define TIMER_EXTCTL_CAPFUNCS_Pos (4) /*!< TIMER_T::EXTCTL: CAPFUNCS Position */ -#define TIMER_EXTCTL_CAPFUNCS_Msk (0x1ul << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< TIMER_T::EXTCTL: CAPFUNCS Mask */ - -#define TIMER_EXTCTL_CAPIEN_Pos (5) /*!< TIMER_T::EXTCTL: CAPIEN Position */ -#define TIMER_EXTCTL_CAPIEN_Msk (0x1ul << TIMER_EXTCTL_CAPIEN_Pos) /*!< TIMER_T::EXTCTL: CAPIEN Mask */ - -#define TIMER_EXTCTL_CAPDBEN_Pos (6) /*!< TIMER_T::EXTCTL: CAPDBEN Position */ -#define TIMER_EXTCTL_CAPDBEN_Msk (0x1ul << TIMER_EXTCTL_CAPDBEN_Pos) /*!< TIMER_T::EXTCTL: CAPDBEN Mask */ - -#define TIMER_EXTCTL_CNTDBEN_Pos (7) /*!< TIMER_T::EXTCTL: CNTDBEN Position */ -#define TIMER_EXTCTL_CNTDBEN_Msk (0x1ul << TIMER_EXTCTL_CNTDBEN_Pos) /*!< TIMER_T::EXTCTL: CNTDBEN Mask */ - -#define TIMER_EXTCTL_INTERCAPSEL_Pos (8) /*!< TIMER_T::EXTCTL: INTERCAPSEL Position */ -#define TIMER_EXTCTL_INTERCAPSEL_Msk (0x7ul << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< TIMER_T::EXTCTL: INTERCAPSEL Mask */ - -#define TIMER_EXTCTL_CAPEDGE_Pos (12) /*!< TIMER_T::EXTCTL: CAPEDGE Position */ -#define TIMER_EXTCTL_CAPEDGE_Msk (0x7ul << TIMER_EXTCTL_CAPEDGE_Pos) /*!< TIMER_T::EXTCTL: CAPEDGE Mask */ - -#define TIMER_EXTCTL_ECNTSSEL_Pos (16) /*!< TIMER_T::EXTCTL: ECNTSSEL Position */ -#define TIMER_EXTCTL_ECNTSSEL_Msk (0x1ul << TIMER_EXTCTL_ECNTSSEL_Pos) /*!< TIMER_T::EXTCTL: ECNTSSEL Mask */ - -#define TIMER_EXTCTL_CAPDIVSCL_Pos (28) /*!< TIMER_T::EXTCTL: CAPDIVSCL Position */ -#define TIMER_EXTCTL_CAPDIVSCL_Msk (0xful << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< TIMER_T::EXTCTL: CAPDIVSCL Mask */ - -#define TIMER_EINTSTS_CAPIF_Pos (0) /*!< TIMER_T::EINTSTS: CAPIF Position */ -#define TIMER_EINTSTS_CAPIF_Msk (0x1ul << TIMER_EINTSTS_CAPIF_Pos) /*!< TIMER_T::EINTSTS: CAPIF Mask */ - -#define TIMER_TRGCTL_TRGSSEL_Pos (0) /*!< TIMER_T::TRGCTL: TRGSSEL Position */ -#define TIMER_TRGCTL_TRGSSEL_Msk (0x1ul << TIMER_TRGCTL_TRGSSEL_Pos) /*!< TIMER_T::TRGCTL: TRGSSEL Mask */ - -#define TIMER_TRGCTL_TRGPWM_Pos (1) /*!< TIMER_T::TRGCTL: TRGPWM Position */ -#define TIMER_TRGCTL_TRGPWM_Msk (0x1ul << TIMER_TRGCTL_TRGPWM_Pos) /*!< TIMER_T::TRGCTL: TRGPWM Mask */ - -#define TIMER_TRGCTL_TRGEADC_Pos (2) /*!< TIMER_T::TRGCTL: TRGEADC Position */ -#define TIMER_TRGCTL_TRGEADC_Msk (0x1ul << TIMER_TRGCTL_TRGEADC_Pos) /*!< TIMER_T::TRGCTL: TRGEADC Mask */ - -#define TIMER_TRGCTL_TRGDAC_Pos (3) /*!< TIMER_T::TRGCTL: TRGDAC Position */ -#define TIMER_TRGCTL_TRGDAC_Msk (0x1ul << TIMER_TRGCTL_TRGDAC_Pos) /*!< TIMER_T::TRGCTL: TRGDAC Mask */ - -#define TIMER_TRGCTL_TRGPDMA_Pos (4) /*!< TIMER_T::TRGCTL: TRGPDMA Position */ -#define TIMER_TRGCTL_TRGPDMA_Msk (0x1ul << TIMER_TRGCTL_TRGPDMA_Pos) /*!< TIMER_T::TRGCTL: TRGPDMA Mask */ - -#define TIMER_ALTCTL_FUNCSEL_Pos (0) /*!< TIMER_T::ALTCTL: FUNCSEL Position */ -#define TIMER_ALTCTL_FUNCSEL_Msk (0x1ul << TIMER_ALTCTL_FUNCSEL_Pos) /*!< TIMER_T::ALTCTL: FUNCSEL Mask */ - -#define TIMER_PWMCTL_CNTEN_Pos (0) /*!< TIMER_T::PWMCTL: CNTEN Position */ -#define TIMER_PWMCTL_CNTEN_Msk (0x1ul << TIMER_PWMCTL_CNTEN_Pos) /*!< TIMER_T::PWMCTL: CNTEN Mask */ - -#define TIMER_PWMCTL_CNTTYPE_Pos (1) /*!< TIMER_T::PWMCTL: CNTTYPE Position */ -#define TIMER_PWMCTL_CNTTYPE_Msk (0x3ul << TIMER_PWMCTL_CNTTYPE_Pos) /*!< TIMER_T::PWMCTL: CNTTYPE Mask */ - -#define TIMER_PWMCTL_CNTMODE_Pos (3) /*!< TIMER_T::PWMCTL: CNTMODE Position */ -#define TIMER_PWMCTL_CNTMODE_Msk (0x1ul << TIMER_PWMCTL_CNTMODE_Pos) /*!< TIMER_T::PWMCTL: CNTMODE Mask */ - -#define TIMER_PWMCTL_CTRLD_Pos (8) /*!< TIMER_T::PWMCTL: CTRLD Position */ -#define TIMER_PWMCTL_CTRLD_Msk (0x1ul << TIMER_PWMCTL_CTRLD_Pos) /*!< TIMER_T::PWMCTL: CTRLD Mask */ - -#define TIMER_PWMCTL_IMMLDEN_Pos (9) /*!< TIMER_T::PWMCTL: IMMLDEN Position */ -#define TIMER_PWMCTL_IMMLDEN_Msk (0x1ul << TIMER_PWMCTL_IMMLDEN_Pos) /*!< TIMER_T::PWMCTL: IMMLDEN Mask */ - -#define TIMER_PWMCTL_WKEN_Pos (12) /*!< TIMER_T::PWMCTL: WKEN Position */ -#define TIMER_PWMCTL_WKEN_Msk (0x1ul << TIMER_PWMCTL_WKEN_Pos) /*!< TIMER_T::PWMCTL: WKEN Mask */ - -#define TIMER_PWMCTL_OUTMODE_Pos (16) /*!< TIMER_T::PWMCTL: OUTMODE Position */ -#define TIMER_PWMCTL_OUTMODE_Msk (0x1ul << TIMER_PWMCTL_OUTMODE_Pos) /*!< TIMER_T::PWMCTL: OUTMODE Mask */ - -#define TIMER_PWMCTL_DBGHALT_Pos (30) /*!< TIMER_T::PWMCTL: DBGHALT Position */ -#define TIMER_PWMCTL_DBGHALT_Msk (0x1ul << TIMER_PWMCTL_DBGHALT_Pos) /*!< TIMER_T::PWMCTL: DBGHALT Mask */ - -#define TIMER_PWMCTL_DBGTRIOFF_Pos (31) /*!< TIMER_T::PWMCTL: DBGTRIOFF Position */ -#define TIMER_PWMCTL_DBGTRIOFF_Msk (0x1ul << TIMER_PWMCTL_DBGTRIOFF_Pos) /*!< TIMER_T::PWMCTL: DBGTRIOFF Mask */ - -#define TIMER_PWMCLKSRC_CLKSRC_Pos (0) /*!< TIMER_T::PWMCLKSRC: CLKSRC Position */ -#define TIMER_PWMCLKSRC_CLKSRC_Msk (0x7ul << TIMER_PWMCLKSRC_CLKSRC_Pos) /*!< TIMER_T::PWMCLKSRC: CLKSRC Mask */ - -#define TIMER_PWMCLKPSC_CLKPSC_Pos (0) /*!< TIMER_T::PWMCLKPSC: CLKPSC Position */ -#define TIMER_PWMCLKPSC_CLKPSC_Msk (0xffful << TIMER_PWMCLKPSC_CLKPSC_Pos) /*!< TIMER_T::PWMCLKPSC: CLKPSC Mask */ - -#define TIMER_PWMCNTCLR_CNTCLR_Pos (0) /*!< TIMER_T::PWMCNTCLR: CNTCLR Position */ -#define TIMER_PWMCNTCLR_CNTCLR_Msk (0x1ul << TIMER_PWMCNTCLR_CNTCLR_Pos) /*!< TIMER_T::PWMCNTCLR: CNTCLR Mask */ - -#define TIMER_PWMPERIOD_PERIOD_Pos (0) /*!< TIMER_T::PWMPERIOD: PERIOD Position */ -#define TIMER_PWMPERIOD_PERIOD_Msk (0xfffful << TIMER_PWMPERIOD_PERIOD_Pos) /*!< TIMER_T::PWMPERIOD: PERIOD Mask */ - -#define TIMER_PWMCMPDAT_CMP_Pos (0) /*!< TIMER_T::PWMCMPDAT: CMP Position */ -#define TIMER_PWMCMPDAT_CMP_Msk (0xfffful << TIMER_PWMCMPDAT_CMP_Pos) /*!< TIMER_T::PWMCMPDAT: CMP Mask */ - -#define TIMER_PWMDTCTL_DTCNT_Pos (0) /*!< TIMER_T::PWMDTCTL: DTCNT Position */ -#define TIMER_PWMDTCTL_DTCNT_Msk (0xffful << TIMER_PWMDTCTL_DTCNT_Pos) /*!< TIMER_T::PWMDTCTL: DTCNT Mask */ - -#define TIMER_PWMDTCTL_DTEN_Pos (16) /*!< TIMER_T::PWMDTCTL: DTEN Position */ -#define TIMER_PWMDTCTL_DTEN_Msk (0x1ul << TIMER_PWMDTCTL_DTEN_Pos) /*!< TIMER_T::PWMDTCTL: DTEN Mask */ - -#define TIMER_PWMDTCTL_DTCKSEL_Pos (24) /*!< TIMER_T::PWMDTCTL: DTCKSEL Position */ -#define TIMER_PWMDTCTL_DTCKSEL_Msk (0x1ul << TIMER_PWMDTCTL_DTCKSEL_Pos) /*!< TIMER_T::PWMDTCTL: DTCKSEL Mask */ - -#define TIMER_PWMCNT_CNT_Pos (0) /*!< TIMER_T::PWMCNT: CNT Position */ -#define TIMER_PWMCNT_CNT_Msk (0xfffful << TIMER_PWMCNT_CNT_Pos) /*!< TIMER_T::PWMCNT: CNT Mask */ - -#define TIMER_PWMCNT_DIRF_Pos (16) /*!< TIMER_T::PWMCNT: DIRF Position */ -#define TIMER_PWMCNT_DIRF_Msk (0x1ul << TIMER_PWMCNT_DIRF_Pos) /*!< TIMER_T::PWMCNT: DIRF Mask */ - -#define TIMER_PWMMSKEN_MSKEN0_Pos (0) /*!< TIMER_T::PWMMSKEN: MSKEN0 Position */ -#define TIMER_PWMMSKEN_MSKEN0_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN0_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN0 Mask */ - -#define TIMER_PWMMSKEN_MSKEN1_Pos (1) /*!< TIMER_T::PWMMSKEN: MSKEN1 Position */ -#define TIMER_PWMMSKEN_MSKEN1_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN1_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN1 Mask */ - -#define TIMER_PWMMSK_MSKDAT0_Pos (0) /*!< TIMER_T::PWMMSK: MSKDAT0 Position */ -#define TIMER_PWMMSK_MSKDAT0_Msk (0x1ul << TIMER_PWMMSK_MSKDAT0_Pos) /*!< TIMER_T::PWMMSK: MSKDAT0 Mask */ - -#define TIMER_PWMMSK_MSKDAT1_Pos (1) /*!< TIMER_T::PWMMSK: MSKDAT1 Position */ -#define TIMER_PWMMSK_MSKDAT1_Msk (0x1ul << TIMER_PWMMSK_MSKDAT1_Pos) /*!< TIMER_T::PWMMSK: MSKDAT1 Mask */ - -#define TIMER_PWMBNF_BRKNFEN_Pos (0) /*!< TIMER_T::PWMBNF: BRKNFEN Position */ -#define TIMER_PWMBNF_BRKNFEN_Msk (0x1ul << TIMER_PWMBNF_BRKNFEN_Pos) /*!< TIMER_T::PWMBNF: BRKNFEN Mask */ - -#define TIMER_PWMBNF_BRKNFSEL_Pos (1) /*!< TIMER_T::PWMBNF: BRKNFSEL Position */ -#define TIMER_PWMBNF_BRKNFSEL_Msk (0x7ul << TIMER_PWMBNF_BRKNFSEL_Pos) /*!< TIMER_T::PWMBNF: BRKNFSEL Mask */ - -#define TIMER_PWMBNF_BRKFCNT_Pos (4) /*!< TIMER_T::PWMBNF: BRKFCNT Position */ -#define TIMER_PWMBNF_BRKFCNT_Msk (0x7ul << TIMER_PWMBNF_BRKFCNT_Pos) /*!< TIMER_T::PWMBNF: BRKFCNT Mask */ - -#define TIMER_PWMBNF_BRKPINV_Pos (7) /*!< TIMER_T::PWMBNF: BRKPINV Position */ -#define TIMER_PWMBNF_BRKPINV_Msk (0x1ul << TIMER_PWMBNF_BRKPINV_Pos) /*!< TIMER_T::PWMBNF: BRKPINV Mask */ - -#define TIMER_PWMBNF_BKPINSRC_Pos (16) /*!< TIMER_T::PWMBNF: BKPINSRC Position */ -#define TIMER_PWMBNF_BKPINSRC_Msk (0x3ul << TIMER_PWMBNF_BKPINSRC_Pos) /*!< TIMER_T::PWMBNF: BKPINSRC Mask */ - -#define TIMER_PWMFAILBRK_CSSBRKEN_Pos (0) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Position */ -#define TIMER_PWMFAILBRK_CSSBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CSSBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Mask */ - -#define TIMER_PWMFAILBRK_BODBRKEN_Pos (1) /*!< TIMER_T::PWMFAILBRK: BODBRKEN Position */ -#define TIMER_PWMFAILBRK_BODBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_BODBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: BODBRKEN Mask */ - -#define TIMER_PWMFAILBRK_RAMBRKEN_Pos (2) /*!< TIMER_T::PWMFAILBRK: RAMBRKEN Position */ -#define TIMER_PWMFAILBRK_RAMBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_RAMBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: RAMBRKEN Mask */ - -#define TIMER_PWMFAILBRK_CORBRKEN_Pos (3) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Position */ -#define TIMER_PWMFAILBRK_CORBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CORBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Mask */ - -#define TIMER_PWMBRKCTL_CPO0EBEN_Pos (0) /*!< TIMER_T::PWMBRKCTL: CPO0EBEN Position */ -#define TIMER_PWMBRKCTL_CPO0EBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO0EBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO0EBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO1EBEN_Pos (1) /*!< TIMER_T::PWMBRKCTL: CPO1EBEN Position */ -#define TIMER_PWMBRKCTL_CPO1EBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO1EBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO1EBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPEEN_Pos (4) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Position */ -#define TIMER_PWMBRKCTL_BRKPEEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPEEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Mask */ - -#define TIMER_PWMBRKCTL_SYSEBEN_Pos (7) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Position */ -#define TIMER_PWMBRKCTL_SYSEBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSEBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO0LBEN_Pos (8) /*!< TIMER_T::PWMBRKCTL: CPO0LBEN Position */ -#define TIMER_PWMBRKCTL_CPO0LBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO0LBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO0LBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO1LBEN_Pos (9) /*!< TIMER_T::PWMBRKCTL: CPO1LBEN Position */ -#define TIMER_PWMBRKCTL_CPO1LBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO1LBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO1LBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPLEN_Pos (12) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Position */ -#define TIMER_PWMBRKCTL_BRKPLEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPLEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Mask */ - -#define TIMER_PWMBRKCTL_SYSLBEN_Pos (15) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Position */ -#define TIMER_PWMBRKCTL_SYSLBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSLBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAEVEN_Pos (16) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Position */ -#define TIMER_PWMBRKCTL_BRKAEVEN_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAEVEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAODD_Pos (18) /*!< TIMER_T::PWMBRKCTL: BRKAODD Position */ -#define TIMER_PWMBRKCTL_BRKAODD_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAODD_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAODD Mask */ - -#define TIMER_PWMPOLCTL_PINV0_Pos (0) /*!< TIMER_T::PWMPOLCTL: PINV0 Position */ -#define TIMER_PWMPOLCTL_PINV0_Msk (0x1ul << TIMER_PWMPOLCTL_PINV0_Pos) /*!< TIMER_T::PWMPOLCTL: PINV0 Mask */ - -#define TIMER_PWMPOLCTL_PINV1_Pos (1) /*!< TIMER_T::PWMPOLCTL: PINV1 Position */ -#define TIMER_PWMPOLCTL_PINV1_Msk (0x1ul << TIMER_PWMPOLCTL_PINV1_Pos) /*!< TIMER_T::PWMPOLCTL: PINV1 Mask */ - -#define TIMER_PWMPOEN_POEN0_Pos (0) /*!< TIMER_T::PWMPOEN: POEN0 Position */ -#define TIMER_PWMPOEN_POEN0_Msk (0x1ul << TIMER_PWMPOEN_POEN0_Pos) /*!< TIMER_T::PWMPOEN: POEN0 Mask */ - -#define TIMER_PWMPOEN_POEN1_Pos (1) /*!< TIMER_T::PWMPOEN: POEN1 Position */ -#define TIMER_PWMPOEN_POEN1_Msk (0x1ul << TIMER_PWMPOEN_POEN1_Pos) /*!< TIMER_T::PWMPOEN: POEN1 Mask */ - -#define TIMER_PWMPOEN_POSEL_Pos (8) /*!< TIMER_T::PWMPOEN: POSEL Position */ -#define TIMER_PWMPOEN_POSEL_Msk (0x1ul << TIMER_PWMPOEN_POSEL_Pos) /*!< TIMER_T::PWMPOEN: POSEL Mask */ - -#define TIMER_PWMSWBRK_BRKETRG_Pos (0) /*!< TIMER_T::PWMSWBRK: BRKETRG Position */ -#define TIMER_PWMSWBRK_BRKETRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKETRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKETRG Mask */ - -#define TIMER_PWMSWBRK_BRKLTRG_Pos (8) /*!< TIMER_T::PWMSWBRK: BRKLTRG Position */ -#define TIMER_PWMSWBRK_BRKLTRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKLTRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKLTRG Mask */ - -#define TIMER_PWMINTEN0_ZIEN_Pos (0) /*!< TIMER_T::PWMINTEN0: ZIEN Position */ -#define TIMER_PWMINTEN0_ZIEN_Msk (0x1ul << TIMER_PWMINTEN0_ZIEN_Pos) /*!< TIMER_T::PWMINTEN0: ZIEN Mask */ - -#define TIMER_PWMINTEN0_PIEN_Pos (1) /*!< TIMER_T::PWMINTEN0: PIEN Position */ -#define TIMER_PWMINTEN0_PIEN_Msk (0x1ul << TIMER_PWMINTEN0_PIEN_Pos) /*!< TIMER_T::PWMINTEN0: PIEN Mask */ - -#define TIMER_PWMINTEN0_CMPUIEN_Pos (2) /*!< TIMER_T::PWMINTEN0: CMPUIEN Position */ -#define TIMER_PWMINTEN0_CMPUIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPUIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPUIEN Mask */ - -#define TIMER_PWMINTEN0_CMPDIEN_Pos (3) /*!< TIMER_T::PWMINTEN0: CMPDIEN Position */ -#define TIMER_PWMINTEN0_CMPDIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPDIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPDIEN Mask */ - -#define TIMER_PWMINTEN1_BRKEIEN_Pos (0) /*!< TIMER_T::PWMINTEN1: BRKEIEN Position */ -#define TIMER_PWMINTEN1_BRKEIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKEIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKEIEN Mask */ - -#define TIMER_PWMINTEN1_BRKLIEN_Pos (8) /*!< TIMER_T::PWMINTEN1: BRKLIEN Position */ -#define TIMER_PWMINTEN1_BRKLIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKLIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKLIEN Mask */ - -#define TIMER_PWMINTSTS0_ZIF_Pos (0) /*!< TIMER_T::PWMINTSTS0: ZIF Position */ -#define TIMER_PWMINTSTS0_ZIF_Msk (0x1ul << TIMER_PWMINTSTS0_ZIF_Pos) /*!< TIMER_T::PWMINTSTS0: ZIF Mask */ - -#define TIMER_PWMINTSTS0_PIF_Pos (1) /*!< TIMER_T::PWMINTSTS0: PIF Position */ -#define TIMER_PWMINTSTS0_PIF_Msk (0x1ul << TIMER_PWMINTSTS0_PIF_Pos) /*!< TIMER_T::PWMINTSTS0: PIF Mask */ - -#define TIMER_PWMINTSTS0_CMPUIF_Pos (2) /*!< TIMER_T::PWMINTSTS0: CMPUIF Position */ -#define TIMER_PWMINTSTS0_CMPUIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPUIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPUIF Mask */ - -#define TIMER_PWMINTSTS0_CMPDIF_Pos (3) /*!< TIMER_T::PWMINTSTS0: CMPDIF Position */ -#define TIMER_PWMINTSTS0_CMPDIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPDIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPDIF Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF0_Pos (0) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Position */ -#define TIMER_PWMINTSTS1_BRKEIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF1_Pos (1) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Position */ -#define TIMER_PWMINTSTS1_BRKEIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF0_Pos (8) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Position */ -#define TIMER_PWMINTSTS1_BRKLIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF1_Pos (9) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Position */ -#define TIMER_PWMINTSTS1_BRKLIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS0_Pos (16) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Position */ -#define TIMER_PWMINTSTS1_BRKESTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS1_Pos (17) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Position */ -#define TIMER_PWMINTSTS1_BRKESTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS0_Pos (24) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS1_Pos (25) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Mask */ - -#define TIMER_PWMTRGCTL_TRGSEL_Pos (0) /*!< TIMER_T::PWMTRGCTL: TRGSEL Position */ -#define TIMER_PWMTRGCTL_TRGSEL_Msk (0x7ul << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< TIMER_T::PWMTRGCTL: TRGSEL Mask */ - -#define TIMER_PWMTRGCTL_TRGEADC_Pos (7) /*!< TIMER_T::PWMTRGCTL: TRGEADC Position */ -#define TIMER_PWMTRGCTL_TRGEADC_Msk (0x1ul << TIMER_PWMTRGCTL_TRGEADC_Pos) /*!< TIMER_T::PWMTRGCTL: TRGEADC Mask */ - -#define TIMER_PWMTRGCTL_TRGPDMA_Pos (9) /*!< TIMER_T::PWMTRGCTL: TRGPDMA Position */ -#define TIMER_PWMTRGCTL_TRGPDMA_Msk (0x1ul << TIMER_PWMTRGCTL_TRGPDMA_Pos) /*!< TIMER_T::PWMTRGCTL: TRGPDMA Mask */ - -#define TIMER_PWMSCTL_SYNCMODE_Pos (0) /*!< TIMER_T::PWMSCTL: SYNCMODE Position */ -#define TIMER_PWMSCTL_SYNCMODE_Msk (0x3ul << TIMER_PWMSCTL_SYNCMODE_Pos) /*!< TIMER_T::PWMSCTL: SYNCMODE Mask */ - -#define TIMER_PWMSCTL_SYNCSRC_Pos (8) /*!< TIMER_T::PWMSCTL: SYNCSRC Position */ -#define TIMER_PWMSCTL_SYNCSRC_Msk (0x1ul << TIMER_PWMSCTL_SYNCSRC_Pos) /*!< TIMER_T::PWMSCTL: SYNCSRC Mask */ - -#define TIMER_PWMSTRG_STRGEN_Pos (0) /*!< TIMER_T::PWMSTRG: STRGEN Position */ -#define TIMER_PWMSTRG_STRGEN_Msk (0x1ul << TIMER_PWMSTRG_STRGEN_Pos) /*!< TIMER_T::PWMSTRG: STRGEN Mask */ - -#define TIMER_PWMSTATUS_CNTMAXF_Pos (0) /*!< TIMER_T::PWMSTATUS: CNTMAXF Position */ -#define TIMER_PWMSTATUS_CNTMAXF_Msk (0x1ul << TIMER_PWMSTATUS_CNTMAXF_Pos) /*!< TIMER_T::PWMSTATUS: CNTMAXF Mask */ - -#define TIMER_PWMSTATUS_WKF_Pos (8) /*!< TIMER_T::PWMSTATUS: WKF Position */ -#define TIMER_PWMSTATUS_WKF_Msk (0x1ul << TIMER_PWMSTATUS_WKF_Pos) /*!< TIMER_T::PWMSTATUS: WKF Mask */ - -#define TIMER_PWMSTATUS_EADCTRGF_Pos (16) /*!< TIMER_T::PWMSTATUS: EADCTRGF Position */ -#define TIMER_PWMSTATUS_EADCTRGF_Msk (0x1ul << TIMER_PWMSTATUS_EADCTRGF_Pos) /*!< TIMER_T::PWMSTATUS: EADCTRGF Mask */ - -#define TIMER_PWMSTATUS_PDMATRGF_Pos (18) /*!< TIMER_T::PWMSTATUS: PDMATRGF Position */ -#define TIMER_PWMSTATUS_PDMATRGF_Msk (0x1ul << TIMER_PWMSTATUS_PDMATRGF_Pos) /*!< TIMER_T::PWMSTATUS: PDMATRGF Mask */ - -#define TIMER_PWMPBUF_PBUF_Pos (0) /*!< TIMER_T::PWMPBUF: PBUF Position */ -#define TIMER_PWMPBUF_PBUF_Msk (0xfffful << TIMER_PWMPBUF_PBUF_Pos) /*!< TIMER_T::PWMPBUF: PBUF Mask */ - -#define TIMER_PWMCMPBUF_CMPBUF_Pos (0) /*!< TIMER_T::PWMCMPBUF: CMPBUF Position */ -#define TIMER_PWMCMPBUF_CMPBUF_Msk (0xfffful << TIMER_PWMCMPBUF_CMPBUF_Pos) /*!< TIMER_T::PWMCMPBUF: CMPBUF Mask */ - -/**@}*/ /* TIMER_CONST */ -/**@}*/ /* end of TIMER register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __TIMER_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/trng_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/trng_reg.h deleted file mode 100644 index a10ecfc3181..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/trng_reg.h +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************//** - * @file trng_reg.h - * @version V1.00 - * @brief TRNG register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TRNG_REG_H__ -#define __TRNG_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- True Random Number Generator -------------------------*/ -/** - @addtogroup TRNG True Random Number Generator(TRNG) - Memory Mapped Structure for TRNG Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var TRNG_T::CTL - * Offset: 0x00 TRNG Control Register and Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRNGEN |Random Number Generator Enable Bit - * | | |This bit can be set to 1 only after ACT (TRNG_ACT[7]) bit was set to 1 and READY (TRNG_CTL[7]) bit became to 1. - * | | |0 = TRNG Disabled. - * | | |1 = TRNG Enabled. - * | | |Note: TRNGEN is an enable bit of digital part - * | | |When TRNG is not required to generate random number, TRNGEN bit and ACT (TRNG_ACT[7]) bit should be set to 0 to reduce power consumption. - * |[1] |DVIF |Data Valid (Read Only) - * | | |0 = Data is not valid. Reading from RNGD returns 0x00000000. - * | | |1 = Data is valid. A valid random number can be read form RNGD. - * | | |This bit is cleared to u20180u2019 by read TRNG_DATA. - * |[5:2] |CLKPSC |Clock Prescaler - * | | |The CLKP is the peripheral clock frequency range for the selected value , the CLKP must higher than or equal to the actual peripheral clock frequency (for correct random bit generation) - * | | |To change the CLKP contents, first set TRNGEN bit to 0 and then change CLKP; finally, set TRNGEN bit to 1 to re-enable the TRNG module. - * | | |0000 = 80 ~ 100 MHz. - * | | |0001 = 60 ~ 80 MHz. - * | | |0010 = 50 ~60 MHz. - * | | |0011 = 40 ~50 MHz. - * | | |0100 = 30 ~40 MHz. - * | | |0101 = 25 ~30 MHz. - * | | |0110 = 20 ~25 MHz. - * | | |0111 = 15 ~20 MHz. - * | | |1000 = 12 ~15 MHz. - * | | |1001 = 9 ~12 MHz. - * | | |1010 = 7 ~9 MHz. - * | | |1011 = 6 ~7 MHz. - * | | |1100 = 5 ~6 MHz. - * | | |1101 = 4 ~5 MHz. - * | | |1111 = Reserved. - * |[6] |DVIEN |Data Valid Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[7] |READY |Random Number Generator Ready (Read Only) - * | | |After ACT (TRNG_ACT[7]) bit is set, the READY bit become to 1 after a delay of 90us~120us. - * | | |0 = RNG is not ready or was not activated. - * | | |1 = RNG is ready to be enabled.. - * |[8] |SEEDGEN |Random Number Seed Generator Enable Bit [for TRNG+PRNG] - * | | |This bit can be set to 1 only after ACT (TRNG_ACT[7]) bit was set to 1 and READY (TRNG_CTL[7]) bit became to 1. - * | | |0 = Seed generator disabled. - * | | |1 = Seed generator enabled. - * | | |Note: If users want to execute TRNG+PRNG mode, they should set SEEDGEN to 1 - * | | |When SEEDGEN was set to 1, users canu2019t read the data from TRNG Data Register. - * |[9] |SEEDRDY |Random Number Seed Ready (Read Only) [for TRNG+PRNG] - * | | |0 = Seed is not ready or was not activated. - * | | |1 = Seed is ready for PRNG. - * | | |Note 1:This bit is cleared to u20180u2019 when SEEDGEN is 1. - * | | |Note 2: If SEEDRDY become to 1, then SEEDGEN will be cleared to 0. - * |[31:10] |Reversed |Reversed - * @var TRNG_T::DATA - * Offset: 0x04 TRNG Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DATA |Random Number Generator Data (Read Only) - * | | |The DATA store the random number generated by TRNG and can be read only once. - * @var TRNG_T::ACT - * Offset: 0x0C TRNG Activation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |VER |TRNG Version - * | | |TRNG version number is dependent on TRNG module. - * | | |0x02:(Current Version Number) - * |[7] |ACT |Random Number Generator Activation - * | | |After enabling the ACT bit, it will active the TRNG module and wait the READY (TRNG_CTL[7]) bit to become 1. - * | | |0 = TRNG inactive. - * | | |1 = TRNG active. - * | | |Note: ACT is an enable bit of analog part - * | | |When TRNG is not required to generate random number, TRNGEN (TRNG_CTL[0]) bit and ACT bit should be set to 0 to reduce power consumption. - */ - __IO uint32_t CTL; /*!< [0x0000] TRNG Control Register and Status */ - __I uint32_t DATA; /*!< [0x0004] TRNG Data Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t ACT; /*!< [0x000c] TRNG Activation Register */ - -} TRNG_T; - -/** - @addtogroup TRNG_CONST TRNG Bit Field Definition - Constant Definitions for TRNG Controller - @{ -*/ - -#define TRNG_CTL_TRNGEN_Pos (0) /*!< TRNG_T::CTL: TRNGEN Position */ -#define TRNG_CTL_TRNGEN_Msk (0x1ul << TRNG_CTL_TRNGEN_Pos) /*!< TRNG_T::CTL: TRNGEN Mask */ - -#define TRNG_CTL_DVIF_Pos (1) /*!< TRNG_T::CTL: DVIF Position */ -#define TRNG_CTL_DVIF_Msk (0x1ul << TRNG_CTL_DVIF_Pos) /*!< TRNG_T::CTL: DVIF Mask */ - -#define TRNG_CTL_CLKPSC_Pos (2) /*!< TRNG_T::CTL: CLKPSC Position */ -#define TRNG_CTL_CLKPSC_Msk (0xful << TRNG_CTL_CLKPSC_Pos) /*!< TRNG_T::CTL: CLKPSC Mask */ - -#define TRNG_CTL_DVIEN_Pos (6) /*!< TRNG_T::CTL: DVIEN Position */ -#define TRNG_CTL_DVIEN_Msk (0x1ul << TRNG_CTL_DVIEN_Pos) /*!< TRNG_T::CTL: DVIEN Mask */ - -#define TRNG_CTL_READY_Pos (7) /*!< TRNG_T::CTL: READY Position */ -#define TRNG_CTL_READY_Msk (0x1ul << TRNG_CTL_READY_Pos) /*!< TRNG_T::CTL: READY Mask */ - -#define TRNG_CTL_SEEDGEN_Pos (8) /*!< TRNG_T::CTL: SEEDGEN Position */ -#define TRNG_CTL_SEEDGEN_Msk (0x1ul << TRNG_CTL_SEEDGEN_Pos) /*!< TRNG_T::CTL: SEEDGEN Mask */ - -#define TRNG_CTL_SEEDRDY_Pos (9) /*!< TRNG_T::CTL: SEEDRDY Position */ -#define TRNG_CTL_SEEDRDY_Msk (0x1ul << TRNG_CTL_SEEDRDY_Pos) /*!< TRNG_T::CTL: SEEDRDY Mask */ - -#define TRNG_CTL_Reversed_Pos (10) /*!< TRNG_T::CTL: Reversed Position */ -#define TRNG_CTL_Reversed_Msk (0x3ffffful << TRNG_CTL_Reversed_Pos) /*!< TRNG_T::CTL: Reversed Mask */ - -#define TRNG_DATA_DATA_Pos (0) /*!< TRNG_T::DATA: DATA Position */ -#define TRNG_DATA_DATA_Msk (0xfful << TRNG_DATA_DATA_Pos) /*!< TRNG_T::DATA: DATA Mask */ - -#define TRNG_ACT_VER_Pos (0) /*!< TRNG_T::ACT: VER Position */ -#define TRNG_ACT_VER_Msk (0x7ful << TRNG_ACT_VER_Pos) /*!< TRNG_T::ACT: VER Mask */ - -#define TRNG_ACT_ACT_Pos (7) /*!< TRNG_T::ACT: ACT Position */ -#define TRNG_ACT_ACT_Msk (0x1ul << TRNG_ACT_ACT_Pos) /*!< TRNG_T::ACT: ACT Mask */ - -/**@}*/ /* TRNG_CONST */ -/**@}*/ /* end of TRNG register group */ - -/**@}*/ /* end of REGISTER group */ - - -#endif /* __TRNG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uart_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uart_reg.h deleted file mode 100644 index 0db25a10648..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uart_reg.h +++ /dev/null @@ -1,1284 +0,0 @@ -/**************************************************************************//** - * @file uart_reg.h - * @version V1.00 - * @brief UART register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UART_REG_H__ -#define __UART_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Universal Asynchronous Receiver/Transmitter Controller -------------------------*/ -/** - @addtogroup UART Universal Asynchronous Receiver/Transmitter Controller(UART) - Memory Mapped Structure for UART Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var UART_T::DAT - * Offset: 0x00 UART Receive/Transmit Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Data Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing one byte to this register, the data byte will be stored in transmitter FIFO. - * | | |The UART controller will send out the data stored in transmitter FIFO top location through the UART_TXD. - * | | |Read Operation: - * | | |By reading this register, the UART controller will return an 8-bit data received from receiver FIFO. - * |[8] |PARITY |Parity Bit Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing to this bit, the parity bit will be stored in transmitter FIFO. - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set, the UART controller will send out this bit follow the DAT (UART_DAT[7:0]) through the UART_TXD. - * | | |Read Operation: - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are enabled, the parity bit can be read by this bit. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set. - * @var UART_T::INTEN - * Offset: 0x04 UART Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIEN |Receive Data Available Interrupt Enable Bit - * | | |0 = Receive data available interrupt Disabled. - * | | |1 = Receive data available interrupt Enabled. - * |[1] |THREIEN |Transmit Holding Register Empty Interrupt Enable Bit - * | | |0 = Transmit holding register empty interrupt Disabled. - * | | |1 = Transmit holding register empty interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive Line Status interrupt Disabled. - * | | |1 = Receive Line Status interrupt Enabled. - * |[3] |MODEMIEN |Modem Status Interrupt Enable Bit - * | | |0 = Modem status interrupt Disabled. - * | | |1 = Modem status interrupt Enabled. - * |[4] |RXTOIEN |RX Time-out Interrupt Enable Bit - * | | |0 = RX time-out interrupt Disabled. - * | | |1 = RX time-out interrupt Enabled. - * |[5] |BUFERRIEN |Buffer Error Interrupt Enable Bit - * | | |0 = Buffer error interrupt Disabled. - * | | |1 = Buffer error interrupt Enabled. - * |[6] |WKIEN |Wake-up Interrupt Enable Bit - * | | |0 = Wake-up Interrupt Disabled. - * | | |1 = Wake-up Interrupt Enabled. - * |[8] |LINIEN |LIN Bus Interrupt Enable Bit - * | | |0 = LIN bus interrupt Disabled. - * | | |1 = LIN bus interrupt Enabled. - * | | |Note: This bit is used for LIN function mode. - * |[11] |TOCNTEN |Receive Buffer Time-out Counter Enable Bit - * | | |0 = Receive Buffer Time-out counter Disabled. - * | | |1 = Receive Buffer Time-out counter Enabled. - * |[12] |ATORTSEN |nRTS Auto-flow Control Enable Bit - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: When nRTS auto-flow is enabled, if the number of bytes in the RX FIFO equals the RTSTRGLV (UART_FIFO[19:16]), the UART will de-assert nRTS signal. - * |[13] |ATOCTSEN |nCTS Auto-flow Control Enable Bit - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * | | |Note: When nCTS auto-flow is enabled, the UART will send data to external device if nCTS input assert (UART will not send data to device until nCTS is asserted). - * |[14] |TXPDMAEN |TX PDMA Enable Bit - * | | |This bit can enable or disable TX PDMA service. - * | | |0 = TX PDMA Disabled. - * | | |1 = TX PDMA Enabled. - * |[15] |RXPDMAEN |RX PDMA Enable Bit - * | | |This bit can enable or disable RX PDMA service. - * | | |0 = RX PDMA Disabled. - * | | |1 = RX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused. - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]), UART PDMA receive request operation is stop. - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing 1 to corresponding BIF, FEF and PEF to make UART PDMA receive request operation continue. - * |[16] |SWBEIEN |Single-wire Bit Error Detection Interrupt Enable Bit - * | | |Set this bit, the Single-wire Half Duplex Bit Error Detection Interrupt SWBEINT(UART_INTSTS[24]) is generated when Single-wire Bit Error Detection SWBEIF(UART_INTSTS[16]) is set. - * | | |0 = Single-wire Bit Error Detect Interrupt Disabled. - * | | |1 = Single-wire Bit Error Detect Interrupt Enabled. - * | | |Note: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * |[18] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[22] |TXENDIEN |Transmitter Empty Interrupt Enable Bit - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt TXENDINT (UART_INTSTS[30]) will be generated when TXENDIF (UART_INTSTS[22]) is set (TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted). - * | | |0 = Transmitter empty interrupt Disabled. - * | | |1 = Transmitter empty interrupt Enabled. - * @var UART_T::FIFO - * Offset: 0x08 UART FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RXRST |RX Field Software Reset - * | | |When RXRST (UART_FIFO[1]) is set, all the byte in the receiver FIFO and RX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the RX internal state machine and pointers. - * | | |Note1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note2: Before setting this bit, it should wait for the RXIDLE (UART_FIFOSTS[29]) be set. - * |[2] |TXRST |TX Field Software Reset - * | | |When TXRST (UART_FIFO[2]) is set, all the byte in the transmit FIFO and TX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the TX internal state machine and pointers. - * | | |Note1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note2: Before setting this bit, it should wait for the TXEMPTYF (UART_FIFOSTS[28]) be set. - * |[7:4] |RFITL |RX FIFO Interrupt Trigger Level - * | | |When the number of bytes in the receive FIFO equals the RFITL, the RDAIF (UART_INTSTS[0]) will be set (if RDAIEN (UART_INTEN [0]) enabled, and an interrupt will be generated). - * | | |0000 = RX FIFO Interrupt Trigger Level is 1 byte. - * | | |0001 = RX FIFO Interrupt Trigger Level is 4 bytes. - * | | |0010 = RX FIFO Interrupt Trigger Level is 8 bytes. - * | | |0011 = RX FIFO Interrupt Trigger Level is 14 bytes. - * | | |Others = Reserved. - * |[8] |RXOFF |Receiver Disable Bit - * | | |The receiver is disabled or not (set 1 to disable receiver). - * | | |0 = Receiver Enabled. - * | | |1 = Receiver Disabled. - * | | |Note: This bit is used for RS-485 Normal Multi-drop mode. - * | | |It should be programmed before RS485NMM (UART_ALTCTL [8]) is programmed. - * |[19:16] |RTSTRGLV |nRTS Trigger Level for Auto-flow Control Use - * | | |0000 = nRTS Trigger Level is 1 byte. - * | | |0001 = nRTS Trigger Level is 4 bytes. - * | | |0010 = nRTS Trigger Level is 8 bytes. - * | | |0011 = nRTS Trigger Level is 14 bytes. - * | | |Others = Reserved. - * | | |Note: This field is used for auto nRTS flow control. - * @var UART_T::LINE - * Offset: 0x0C UART Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WLS |Word Length Selection - * | | |This field sets UART word length. - * | | |00 = 5 bits. - * | | |01 = 6 bits. - * | | |10 = 7 bits. - * | | |11 = 8 bits. - * |[2] |NSB |Number of STOP Bit - * | | |0 = One STOP bit is generated in the transmitted data. - * | | |1 = When select 5-bit word length, 1.5 STOP bit is generated in the transmitted data. - * | | |When select 6-, 7- and 8-bit word length, 2 STOP bit is generated in the transmitted data. - * |[3] |PBE |Parity Bit Enable Bit - * | | |0 = Parity bit generated Disabled. - * | | |1 = Parity bit generated Enabled. - * | | |Note: Parity bit is generated on each outgoing character and is checked on each incoming data. - * |[4] |EPE |Even Parity Enable Bit - * | | |0 = Odd number of logic 1's is transmitted and checked in each word. - * | | |1 = Even number of logic 1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) is set. - * |[5] |SPE |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: If PBE (UART_LINE[3]) and EPE (UART_LINE[4]) are logic 1, the parity bit is transmitted and checked as logic 0. - * | | |If PBE (UART_LINE[3]) is 1 and EPE (UART_LINE[4]) is 0 then the parity bit is transmitted and checked as 1. - * |[6] |BCB |Break Control Bit - * | | |0 = Break Control Disabled. - * | | |1 = Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the transmitted serial data output (TX) is forced to the Spacing State (logic 0) - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[7] |PSS |Parity Bit Source Selection - * | | |The parity bit can be selected to be generated and checked automatically or by software. - * | | |0 = Parity bit is generated by EPE (UART_LINE[4]) and SPE (UART_LINE[5]) setting and checked automatically. - * | | |1 = Parity bit generated and checked by software. - * | | |Note1: This bit has effect only when PBE (UART_LINE[3]) is set. - * | | |Note2: If PSS is 0, the parity bit is transmitted and checked automatically. - * | | |If PSS is 1, the transmitted parity bit value can be determined by writing PARITY (UART_DAT[8]) and the parity bit can be read by reading PARITY (UART_DAT[8]). - * |[8] |TXDINV |TX Data Inverted - * | | |0 = Transmitted data signal inverted Disabled. - * | | |1 = Transmitted data signal inverted Enabled. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select UART, LIN or RS485 function. - * |[9] |RXDINV |RX Data Inverted - * | | |0 = Received data signal inverted Disabled. - * | | |1 = Received data signal inverted Enabled. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select UART, LIN or RS485 function. - * @var UART_T::MODEM - * Offset: 0x10 UART Modem Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RTS |nRTS (Request-to-send) Signal Control - * | | |This bit is direct control internal nRTS signal active or not, and then drive the nRTS pin output with RTSACTLV bit configuration. - * | | |0 = nRTS signal is active. - * | | |1 = nRTS signal is inactive. - * | | |Note1: This nRTS signal control bit is not effective when nRTS auto-flow control is enabled in UART function mode. - * | | |Note2: This nRTS signal control bit is not effective when RS-485 auto direction mode (AUD) is enabled in RS-485 function mode. - * |[9] |RTSACTLV |nRTS Pin Active Level - * | | |This bit defines the active level state of nRTS pin output. - * | | |0 = nRTS pin output is high level active. - * | | |1 = nRTS pin output is low level active. (Default) - * | | |Note: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * |[13] |RTSSTS |nRTS Pin Status (Read Only) - * | | |This bit mirror from nRTS pin output of voltage logic status. - * | | |0 = nRTS pin output is low level voltage logic state. - * | | |1 = nRTS pin output is high level voltage logic state. - * @var UART_T::MODEMSTS - * Offset: 0x14 UART Modem Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSDETF |Detect nCTS State Change Flag - * | | |This bit is set whenever nCTS input has change state, and it will generate Modem interrupt to CPU when MODEMIEN (UART_INTEN [3]) is set to 1. - * | | |0 = nCTS input has not change state. - * | | |1 = nCTS input has change state. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[4] |CTSSTS |nCTS Pin Status (Read Only) - * | | |This bit mirror from nCTS pin input of voltage logic status. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - * | | |Note: This bit echoes when UART controller peripheral clock is enabled, and nCTS multi-function port is selected. - * |[8] |CTSACTLV |nCTS Pin Active Level - * | | |This bit defines the active level state of nCTS pin input. - * | | |0 = nCTS pin input is high level active. - * | | |1 = nCTS pin input is low level active. (Default) - * | | |Note: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * @var UART_T::FIFOSTS - * Offset: 0x18 UART FIFO Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXOVIF |RX Overflow Error Interrupt Flag - * | | |This bit is set when RX FIFO overflow. - * | | |If the number of bytes of received data is greater than RX_FIFO (UART_DAT) size 16 bytes, this bit will be set. - * | | |0 = RX FIFO is not overflow. - * | | |1 = RX FIFO is overflow. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[1] |ABRDIF |Auto-baud Rate Detect Interrupt Flag - * | | |This bit is set to logic 1 when auto-baud rate detect function is finished. - * | | |0 = Auto-baud rate detect function is not finished. - * | | |1 = Auto-baud rate detect function is finished. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[2] |ABRDTOIF |Auto-baud Rate Detect Time-out Interrupt Flag - * | | |This bit is set to logic 1 in Auto-baud Rate Detect mode when the baud rate counter is overflow. - * | | |0 = Auto-baud rate counter is underflow. - * | | |1 = Auto-baud rate counter is overflow. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[3] |ADDRDETF |RS-485 Address Byte Detect Flag - * | | |0 = Receiver detects a data that is not an address bit (bit 9 ='0'). - * | | |1 = Receiver detects a data that is an address bit (bit 9 ='1'). - * | | |Note1: This field is used for RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1 to enable Address detection mode. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[4] |PEF |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid parity bit. - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[5] |FEF |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid stop bit (that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[6] |BIF |Break Interrupt Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the spacing state (logic 0) for longer than a full word transmission time (that is, the total time of start bit + data bits + parity + stop bits). - * | | |0 = No Break interrupt is generated. - * | | |1 = Break interrupt is generated. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[13:8] |RXPTR |RX FIFO Pointer (Read Only) - * | | |This field indicates the RX FIFO Buffer Pointer. - * | | |When UART receives one byte from external device, RXPTR increases one. - * | | |When one byte of RX FIFO is read by CPU, RXPTR decreases one. - * | | |The Maximum value shown in RXPTR is 15 - * | | |When the using level of RX FIFO Buffer equal to 16, the RXFULL bit is set to 1 and RXPTR will show 0. - * | | |As one byte of RX FIFO is read by CPU, the RXFULL bit is cleared to 0 and RXPTR will show 15. - * |[14] |RXEMPTY |Receiver FIFO Empty (Read Only) - * | | |This bit initiate RX FIFO empty or not. - * | | |0 = RX FIFO is not empty. - * | | |1 = RX FIFO is empty. - * | | |Note: When the last byte of RX FIFO has been read by CPU, hardware sets this bit high. - * | | |It will be cleared when UART receives any new data. - * |[15] |RXFULL |Receiver FIFO Full (Read Only) - * | | |This bit initiates RX FIFO full or not. - * | | |0 = RX FIFO is not full. - * | | |1 = RX FIFO is full. - * | | |Note: This bit is set when the number of usage in RX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[21:16] |TXPTR |TX FIFO Pointer (Read Only) - * | | |This field indicates the TX FIFO Buffer Pointer. - * | | |When CPU writes one byte into UART_DAT, TXPTR increases one. - * | | |When one byte of TX FIFO is transferred to Transmitter Shift Register, TXPTR decreases one. - * | | |The Maximum value shown in TXPTR is 15. - * | | |When the using level of TX FIFO Buffer equal to 16, the TXFULL bit is set to 1 and TXPTR will show 0. - * | | |As one byte of TX FIFO is transferred to Transmitter Shift Register, the TXFULL bit is cleared to 0 and TXPTR will show 15. - * |[22] |TXEMPTY |Transmitter FIFO Empty (Read Only) - * | | |This bit indicates TX FIFO empty or not. - * | | |0 = TX FIFO is not empty. - * | | |1 = TX FIFO is empty. - * | | |Note: When the last byte of TX FIFO has been transferred to Transmitter Shift Register, hardware sets this bit high. - * | | |It will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[23] |TXFULL |Transmitter FIFO Full (Read Only) - * | | |This bit indicates TX FIFO full or not. - * | | |0 = TX FIFO is not full. - * | | |1 = TX FIFO is full. - * | | |Note: This bit is set when the number of usage in TX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[24] |TXOVIF |TX Overflow Error Interrupt Flag - * | | |If TX FIFO (UART_DAT) is full, an additional write to UART_DAT will cause this bit to logic 1. - * | | |0 = TX FIFO is not overflow. - * | | |1 = TX FIFO is overflow. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[28] |TXEMPTYF |Transmitter Empty Flag (Read Only) - * | | |This bit is set by hardware when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted. - * | | |0 = TX FIFO is not empty or the STOP bit of the last byte has been not transmitted. - * | | |1 = TX FIFO is empty and the STOP bit of the last byte has been transmitted. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[29] |RXIDLE |RX Idle Status (Read Only) - * | | |This bit is set by hardware when RX is idle. - * | | |0 = RX is busy. - * | | |1 = RX is idle. (Default) - * |[31] |TXRXACT |TX and RX Active Status (Read Only) - * | | |This bit indicates TX and RX are active or inactive. - * | | |0 = TX and RX are inactive. - * | | |1 = TX and RX are active. (Default) - * | | |Note: When TXRXDIS (UART_FUNCSEL[3]) is set and both TX and RX are in idle state, this bit is cleared. - * | | |The UART controller can not transmit or receive data at this moment. - * | | |Otherwise this bit is set. - * @var UART_T::INTSTS - * Offset: 0x1C UART Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIF |Receive Data Available Interrupt Flag - * | | |When the number of bytes in the RX FIFO equals the RFITL then the RDAIF(UART_INTSTS[0]) will be set. - * | | |If RDAIEN (UART_INTEN [0]) is enabled, the RDA interrupt will be generated. - * | | |0 = No RDA interrupt flag is generated. - * | | |1 = RDA interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when the number of unread bytes of RX FIFO drops below the threshold level (RFITL(UART_FIFO[7:4]). - * |[1] |THREIF |Transmit Holding Register Empty Interrupt Flag - * | | |This bit is set when the last data of TX FIFO is transferred to Transmitter Shift Register. - * | | |If THREIEN (UART_INTEN[1]) is enabled, the THRE interrupt will be generated. - * | | |0 = No THRE interrupt flag is generated. - * | | |1 = THRE interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[2] |RLSIF |Receive Line Interrupt Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]), is set). - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated. - * | | |1 = RLS interrupt flag is generated. - * | | |Note1: In RS-485 function mode, this field is set include receiver detect and received address byte character (bit9 = 1) bit. - * | | |At the same time, the bit of ADDRDETF (UART_FIFOSTS[3]) is also set. - * | | |Note2: This bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]) , FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[3] |MODEMIF |MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS[0]) = 1). - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated. - * | | |1 = Modem interrupt flag is generated. - * | | |Note: This bit is read only and reset to 0 when bit CTSDETF is cleared by a write 1 on CTSDETF(UART_MODEMSTS[0]). - * |[4] |RXTOIF |RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]). - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated. - * | | |0 = No RX time-out interrupt flag is generated. - * | | |1 = RX time-out interrupt flag is generated. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[5] |BUFERRIF |Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX FIFO or RX FIFO overflows (TXOVIF (UART_FIFOSTS[24]) or RXOVIF (UART_FIFOSTS[0]) is set). - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer is not correct. - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated. - * | | |1 = Buffer error interrupt flag is generated. - * | | |Note: This bit is cleared if both of RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]) are cleared to 0 by writing 1 to RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]). - * |[6] |WKIF |UART Wake-up Interrupt Flag (Read Only) - * | | |This bit is set when TOUTWKF (UART_WKSTS[4]), RS485WKF (UART_WKSTS[3]), RFRTWKF (UART_WKSTS[2]), DATWKF (UART_WKSTS[1]) or CTSWKF(UART_WKSTS[0]) is set to 1. - * | | |0 = No UART wake-up interrupt flag is generated. - * | | |1 = UART wake-up interrupt flag is generated. - * | | |Note: This bit is cleared if all of TOUTWKF, RS485WKF, RFRTWKF, DATWKF and CTSWKF are cleared to 0 by writing 1 to the corresponding interrupt flag. - * |[7] |LINIF |LIN Bus Interrupt Flag - * | | |This bit is set when LIN slave header detect (SLVHDETF (UART_LINSTS[0]=1)), LIN break detect (BRKDETF(UART_LINSTS[8]=1)), bit error detect (BITEF(UART_LINSTS[9]=1)), LIN slave ID parity error (SLVIDPEF(UART_LINSTS[2] = 1)) or LIN slave header error detect (SLVHEF (UART_LINSTS[1])) - * | | |If LINIEN (UART_INTEN [8]) is enabled the LIN interrupt will be generated. - * | | |0 = None of SLVHDETF, BRKDETF, BITEF, SLVIDPEF and SLVHEF is generated. - * | | |1 = At least one of SLVHDETF, BRKDETF, BITEF, SLVIDPEF and SLVHEF is generated. - * | | |Note: This bit is cleared when SLVHDETF(UART_LINSTS[0]), BRKDETF(UART_LINSTS[8]), BITEF(UART_LINSTS[9]), SLVIDPEF (UART_LINSTS[2]) and SLVHEF(UART_LINSTS[1]) all are cleared and software writing 1 to LINIF(UART_INTSTS[7]). - * |[8] |RDAINT |Receive Data Available Interrupt Indicator (Read Only) - * | | |This bit is set if RDAIEN (UART_INTEN[0]) and RDAIF (UART_INTSTS[0]) are both set to 1. - * | | |0 = No RDA interrupt is generated. - * | | |1 = RDA interrupt is generated. - * |[9] |THREINT |Transmit Holding Register Empty Interrupt Indicator (Read Only) - * | | |This bit is set if THREIEN (UART_INTEN[1]) and THREIF(UART_INTSTS[1]) are both set to 1. - * | | |0 = No THRE interrupt is generated. - * | | |1 = THRE interrupt is generated. - * |[10] |RLSINT |Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and RLSIF(UART_INTSTS[2]) are both set to 1. - * | | |0 = No RLS interrupt is generated. - * | | |1 = RLS interrupt is generated. - * |[11] |MODEMINT |MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN(UART_INTEN[3]) and MODEMIF(UART_INTSTS[3]) are both set to 1 - * | | |0 = No Modem interrupt is generated. - * | | |1 = Modem interrupt is generated.. - * |[12] |RXTOINT |RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and RXTOIF(UART_INTSTS[4]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated. - * | | |1 = RX time-out interrupt is generated. - * |[13] |BUFERRINT |Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN(UART_INTEN[5]) and BUFERRIF(UART_ INTSTS[5]) are both set to 1. - * | | |0 = No buffer error interrupt is generated. - * | | |1 = Buffer error interrupt is generated. - * |[14] |WKINT |UART Wake-up Interrupt Indicator (Read Only) - * | | |This bit is set if WKIEN (UART_INTEN[6]) and WKIF (UART_INTSTS[6]) are both set to 1. - * | | |0 = No UART wake-up interrupt is generated. - * | | |1 = UART wake-up interrupt is generated. - * |[15] |LININT |LIN Bus Interrupt Indicator (Read Only) - * | | |This bit is set if LINIEN (UART_INTEN[8]) and LINIF(UART_INTSTS[7]) are both set to 1. - * | | |0 = No LIN Bus interrupt is generated. - * | | |1 = The LIN Bus interrupt is generated. - * |[16] |SWBEIF |Single-wire Bit Error Detection Interrupt Flag - * | | |This bit is set when the single wire bus state not equals to UART controller TX state in Single-wire mode. - * | | |0 = No single-wire bit error detection interrupt flag is generated. - * | | |1 = Single-wire bit error detection interrupt flag is generated. - * | | |Note 1: This bit is active when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * | | |Note 2: This bit can be cleared by writing "1" to it. - * |[18] |HWRLSIF |PDMA Mode Receive Line Status Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF (UART_FIFOSTS[6]), FEF (UART_FIFOSTS[5]) and PEF (UART_FIFOSTS[4]) is set). - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated in PDMA mode. - * | | |1 = RLS interrupt flag is generated in PDMA mode. - * | | |Note1: In RS-485 function mode, this field include receiver detect any address byte received address byte character (bit9 = 1) bit. - * | | |Note2: In UART function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]) , FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[19] |HWMODIF |PDMA Mode MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS[0]=1)). - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated in PDMA mode. - * | | |1 = Modem interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and reset to 0 when the bit CTSDETF (UART_MODEMSTS[0]) is cleared by writing 1 on CTSDETF (UART_MODEMSTS [0]). - * |[20] |HWTOIF |PDMA Mode RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]). - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated. - * | | |0 = No RX time-out interrupt flag is generated in PDMA mode. - * | | |1 = RX time-out interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[21] |HWBUFEIF |PDMA Mode Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX or RX FIFO overflows (TXOVIF (UART_FIFOSTS [24]) or RXOVIF (UART_FIFOSTS[0]) is set). - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer maybe is not correct. - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated in PDMA mode. - * | | |1 = Buffer error interrupt flag is generated in PDMA mode. - * | | |Note: This bit is cleared when both TXOVIF (UART_FIFOSTS[24]]) and RXOVIF (UART_FIFOSTS[0]) are cleared. - * |[22] |TXENDIF |Transmitter Empty Interrupt Flag - * | | |This bit is set when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted (TXEMPTYF (UART_FIFOSTS[28]) is set). - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt will be generated. - * | | |0 = No transmitter empty interrupt flag is generated. - * | | |1 = Transmitter empty interrupt flag is generated. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[24] |SWBEINT |Single-wire Bit Error Detect Interrupt Indicator (Read Only) - * | | |This bit is set if SWBEIEN (UART_INTEN[16]) and SWBEIF (UART_INTSTS[16]) are both set to 1. - * | | |0 = No Single-wire Bit Error Detection Interrupt generated. - * | | |1 = Single-wire Bit Error Detection Interrupt generated. - * |[26] |HWRLSINT |PDMA Mode Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and HWRLSIF(UART_INTSTS[18]) are both set to 1. - * | | |0 = No RLS interrupt is generated in PDMA mode. - * | | |1 = RLS interrupt is generated in PDMA mode. - * |[27] |HWMODINT |PDMA Mode MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN (UART_INTEN[3]) and HWMODIF(UART_INTSTS[19]) are both set to 1. - * | | |0 = No Modem interrupt is generated in PDMA mode. - * | | |1 = Modem interrupt is generated in PDMA mode. - * |[28] |HWTOINT |PDMA Mode RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and HWTOIF(UART_INTSTS[20]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated in PDMA mode. - * | | |1 = RX time-out interrupt is generated in PDMA mode. - * |[29] |HWBUFEINT |PDMA Mode Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN (UART_INTEN[5]) and HWBUFEIF (UART_INTSTS[21]) are both set to 1. - * | | |0 = No buffer error interrupt is generated in PDMA mode. - * | | |1 = Buffer error interrupt is generated in PDMA mode. - * |[30] |TXENDINT |Transmitter Empty Interrupt Indicator (Read Only) - * | | |This bit is set if TXENDIEN (UART_INTEN[22]) and TXENDIF(UART_INTSTS[22]) are both set to 1. - * | | |0 = No Transmitter Empty interrupt is generated. - * | | |1 = Transmitter Empty interrupt is generated. - * |[31] |ABRINT |Auto-baud Rate Interrupt Indicator (Read Only) - * | | |This bit is set if ABRIEN (UART_INTEN[18]) and ABRIF (UART_ALTCTL[17]) are both set to 1. - * | | |0 = No Auto-baud Rate interrupt is generated. - * | | |1 = The Auto-baud Rate interrupt is generated. - * @var UART_T::TOUT - * Offset: 0x20 UART Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TOIC |Time-out Interrupt Comparator - * | | |The time-out counter resets and starts counting (the counting clock = baud rate) whenever the RX FIFO receives a new data word if time out counter is enabled by setting TOCNTEN (UART_INTEN[11]). - * | | |Once the content of time-out counter is equal to that of time-out interrupt comparator (TOIC (UART_TOUT[7:0])), a receiver time-out interrupt (RXTOINT(UART_INTSTS[12])) is generated if RXTOIEN (UART_INTEN [4]) enabled. - * | | |A new incoming data word or RX FIFO empty will clear RXTOIF (UART_INTSTS[4]). - * | | |In order to avoid receiver time-out interrupt generation immediately during one character is being received, TOIC value should be set between 40 and 255. - * | | |So, for example, if TOIC is set with 40, the time-out interrupt is generated after four characters are not received when 1 stop bit and no parity check is set for UART transfer. - * |[15:8] |DLY |TX Delay Time Value - * | | |This field is used to programming the transfer delay time between the last stop bit and next start bit. - * | | |The unit is bit time. - * @var UART_T::BAUD - * Offset: 0x24 UART Baud Rate Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |BRD |Baud Rate Divider - * | | |The field indicates the baud rate divider. - * | | |This filed is used in baud rate calculation. - * |[27:24] |EDIVM1 |Extra Divider for BAUD Rate Mode 1 - * | | |This field is used for baud rate calculation in mode 1 and has no effect for baud rate calculation in mode 0 and mode 2. - * |[28] |BAUDM0 |BAUD Rate Mode Selection Bit 0 - * | | |This bit is baud rate mode selection bit 0 - * | | |UART provides three baud rate calculation modes. - * | | |This bit combines with BAUDM1 (UART_BAUD[29]) to select baud rate calculation mode. - * |[29] |BAUDM1 |BAUD Rate Mode Selection Bit 1 - * | | |This bit is baud rate mode selection bit 1. - * | | |UART provides three baud rate calculation modes. - * | | |This bit combines with BAUDM0 (UART_BAUD[28]) to select baud rate calculation mode. - * | | |Note: In IrDA mode must be operated in mode 0. - * @var UART_T::IRDA - * Offset: 0x28 UART IrDA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXEN |IrDA Receiver/Transmitter Selection Enable Bit - * | | |0 = IrDA Transmitter Disabled and Receiver Enabled. (Default) - * | | |1 = IrDA Transmitter Enabled and Receiver Disabled. - * |[5] |TXINV |IrDA Inverse Transmitting Output Signal - * | | |0 = None inverse transmitting signal. (Default). - * | | |1 = Inverse transmitting output signal. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select IrDA function. - * |[6] |RXINV |IrDA Inverse Receive Input Signal - * | | |0 = None inverse receiving input signal. - * | | |1 = Inverse receiving input signal. (Default) - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select IrDA function. - * @var UART_T::ALTCTL - * Offset: 0x2C UART Alternate Control/Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |BRKFL |UART LIN Break Field Length - * | | |This field indicates a 4-bit LIN TX break field count. - * | | |Note1: This break field length is BRKFL + 1. - * | | |Note2: According to LIN spec, the reset value is 0xC (break field length = 13). - * |[6] |LINRXEN |LIN RX Enable Bit - * | | |0 = LIN RX mode Disabled. - * | | |1 = LIN RX mode Enabled. - * |[7] |LINTXEN |LIN TX Break Mode Enable Bit - * | | |0 = LIN TX Break mode Disabled. - * | | |1 = LIN TX Break mode Enabled. - * | | |Note: When TX break field transfer operation finished, this bit will be cleared automatically. - * |[8] |RS485NMM |RS-485 Normal Multi-drop Operation Mode (NMM) - * | | |0 = RS-485 Normal Multi-drop Operation mode (NMM) Disabled. - * | | |1 = RS-485 Normal Multi-drop Operation mode (NMM) Enabled. - * | | |Note: It cannot be active with RS-485_AAD operation mode. - * |[9] |RS485AAD |RS-485 Auto Address Detection Operation Mode (AAD) - * | | |0 = RS-485 Auto Address Detection Operation mode (AAD) Disabled. - * | | |1 = RS-485 Auto Address Detection Operation mode (AAD) Enabled. - * | | |Note: It cannot be active with RS-485_NMM operation mode. - * |[10] |RS485AUD |RS-485 Auto Direction Function (AUD) - * | | |0 = RS-485 Auto Direction Operation function (AUD) Disabled. - * | | |1 = RS-485 Auto Direction Operation function (AUD) Enabled. - * | | |Note: It can be active with RS-485_AAD or RS-485_NMM operation mode. - * |[15] |ADDRDEN |RS-485 Address Detection Enable Bit - * | | |This bit is used to enable RS-485 Address Detection mode. - * | | |0 = Address detection mode Disabled. - * | | |1 = Address detection mode Enabled. - * | | |Note: This bit is used for RS-485 any operation mode. - * |[17] |ABRIF |Auto-baud Rate Interrupt Flag (Read Only) - * | | |This bit is set when auto-baud rate detection function finished or the auto-baud rate counter was overflow and if ABRIEN(UART_INTEN [18]) is set then the auto-baud rate interrupt will be generated. - * | | |0 = No auto-baud rate interrupt flag is generated. - * | | |1 = Auto-baud rate interrupt flag is generated. - * | | |Note: This bit is read only, but it can be cleared by writing 1 to ABRDTOIF (UART_FIFOSTS[2]) and ABRDIF(UART_FIFOSTS[1]). - * |[18] |ABRDEN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note : This bit is cleared automatically after auto-baud detection is finished. - * |[20:19] |ABRDBITS |Auto-baud Rate Detect Bit Length - * | | |00 = 1-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x01. - * | | |01 = 2-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x02. - * | | |10 = 4-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x08. - * | | |11 = 8-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x80. - * | | |Note : The calculation of bit number includes the START bit. - * |[31:24] |ADDRMV |Address Match Value - * | | |This field contains the RS-485 address match values. - * | | |Note: This field is used for RS-485 auto address detection mode. - * @var UART_T::FUNCSEL - * Offset: 0x30 UART Function Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNCSEL |Function Select - * | | |000 = UART function. - * | | |001 = LIN function. - * | | |010 = IrDA function. - * | | |011 = RS-485 function. - * | | |100 = UART Single-wire function. - * | | |Others = Reserved. - * |[3] |TXRXDIS |TX and RX Disable Bit - * | | |Setting this bit can disable TX and RX. - * | | |0 = TX and RX Enabled. - * | | |1 = TX and RX Disabled. - * | | |Note: The TX and RX will not disable immediately when this bit is set. - * | | |The TX and RX complete current task before disable TX and RX. - * | | |When TX and RX disable, the TXRXACT (UART_FIFOSTS[31]) is cleared. - * |[6] |DGE |Deglitch Enable Bit - * | | |0 = Deglitch Disabled. - * | | |1 = Deglitch Enabled. - * | | |Note: When this bit is set to logic 1, any pulse width less than about 300 ns will be considered a glitch and will be removed in the serial data input (RX). - * | | |This bit acts only on RX line and has no effect on the transmitter logic. - * @var UART_T::LINCTL - * Offset: 0x34 UART LIN Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLVEN |LIN Slave Mode Enable Bit - * | | |0 = LIN slave mode Disabled. - * | | |1 = LIN slave mode Enabled. - * |[1] |SLVHDEN |LIN Slave Header Detection Enable Bit - * | | |0 = LIN slave header detection Disabled. - * | | |1 = LIN slave header detection Enabled. - * | | |Note1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note2: In LIN function mode, when detect header field (break + sync + frame ID), SLVHDETF (UART_LINSTS [0]) flag will be asserted. - * | | |If the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * |[2] |SLVAREN |LIN Slave Automatic Resynchronization Mode Enable Bit - * | | |0 = LIN automatic resynchronization Disabled. - * | | |1 = LIN automatic resynchronization Enabled. - * | | |Note1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note2: When operation in Automatic Resynchronization mode, the baud rate setting must be mode2 (BAUDM1 (UART_BAUD [29]) and BAUDM0 (UART_BAUD [28]) must be 1). - * |[3] |SLVDUEN |LIN Slave Divider Update Method Enable Bit - * | | |0 = UART_BAUD updated is written by software (if no automatic resynchronization update occurs at the same time). - * | | |1 = UART_BAUD is updated at the next received character - * | | |User must set the bit before checksum reception. - * | | |Note1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note2: This bit used for LIN Slave Automatic Resynchronization mode. (for Non-Automatic Resynchronization mode, this bit should be kept cleared) - * |[4] |MUTE |LIN Mute Mode Enable Bit - * | | |0 = LIN mute mode Disabled. - * | | |1 = LIN mute mode Enabled. - * | | |Note: The exit from mute mode condition and each control and interactions of this field are explained in 6.16.5.10 (LIN slave mode). - * |[8] |SENDH |LIN TX Send Header Enable Bit - * | | |The LIN TX header can be break field or break and sync field or break, sync and frame ID field, it is depend on setting HSEL (UART_LINCTL[23:22]). - * | | |0 = Send LIN TX header Disabled. - * | | |1 = Send LIN TX header Enabled. - * | | |Note1: This bit is shadow bit of LINTXEN (UART_ALTCTL [7]); user can read/write it by setting LINTXEN (UART_ALTCTL [7]) or SENDH (UART_LINCTL [8]). - * | | |Note2: When transmitter header field (it may be break or break + sync or break + sync + frame ID selected by HSEL (UART_LINCTL[23:22]) field) transfer operation finished, this bit will be cleared automatically. - * |[9] |IDPEN |LIN ID Parity Enable Bit - * | | |0 = LIN frame ID parity Disabled. - * | | |1 = LIN frame ID parity Enabled. - * | | |Note1: This bit can be used for LIN master to sending header field (SENDH (UART_LINCTL[8])) = 1 and HSEL (UART_LINCTL[23:22]) = 10 or be used for enable LIN slave received frame ID parity checked. - * | | |Note2: This bit is only used when the operation header transmitter is in HSEL (UART_LINCTL[23:22]) = 10. - * |[10] |BRKDETEN |LIN Break Detection Enable Bit - * | | |When detect consecutive dominant greater than 11 bits, and are followed by a delimiter character, the BRKDETF (UART_LINSTS[8]) flag is set at the end of break field. - * | | |If the LINIEN (UART_INTEN [8])=1, an interrupt will be generated. - * | | |0 = LIN break detection Disabled . - * | | |1 = LIN break detection Enabled. - * |[11] |LINRXOFF |LIN Receiver Disable Bit - * | | |If the receiver is enabled (RXOFF (UART_LINCTL[11] ) = 0), all received byte data will be accepted and stored in the RX FIFO, and if the receiver is disabled (RXOFF (UART_LINCTL[11] = 1), all received byte data will be ignore. - * | | |0 = LIN receiver Enabled. - * | | |1 = LIN receiver Disabled. - * | | |Note: This bit is only valid when operating in LIN function mode (FUNCSEL (UART_FUNCSEL[1:0]) = 01). - * |[12] |BITERREN |Bit Error Detect Enable Bit - * | | |0 = Bit error detection function Disabled. - * | | |1 = Bit error detection function Enabled. - * | | |Note: In LIN function mode, when occur bit error, the BITEF (UART_LINSTS[9]) flag will be asserted. - * | | |If the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * |[19:16] |BRKFL |LIN Break Field Length - * | | |This field indicates a 4-bit LIN TX break field count. - * | | |Note1: These registers are shadow registers of BRKFL (UART_ALTCTL[3:0]), User can read/write it by setting BRKFL (UART_ALTCTL[3:0]) or BRKFL (UART_LINCTL[19:16]). - * | | |Note2: This break field length is BRKFL + 1. - * | | |Note3: According to LIN spec, the reset value is 12 (break field length = 13). - * |[21:20] |BSL |LIN Break/Sync Delimiter Length - * | | |00 = The LIN break/sync delimiter length is 1-bit time. - * | | |01 = The LIN break/sync delimiter length is 2-bit time. - * | | |10 = The LIN break/sync delimiter length is 3-bit time. - * | | |11 = The LIN break/sync delimiter length is 4-bit time. - * | | |Note: This bit used for LIN master to sending header field. - * |[23:22] |HSEL |LIN Header Select - * | | |00 = The LIN header includes break field. - * | | |01 = The LIN header includes break field and sync field. - * | | |10 = The LIN header includes break field, sync field and frame ID field. - * | | |11 = Reserved. - * | | |Note: This bit is used to master mode for LIN to send header field (SENDH (UART_LINCTL [8]) = 1) or used to slave to indicates exit from mute mode condition (MUTE (UART_LINCTL[4] = 1). - * |[31:24] |PID |LIN PID Bits - * | | |This field contains the LIN frame ID value when in LIN function mode, the frame ID parity can be generated by software or hardware depends on IDPEN (UART_LINCTL[9]) = 1. - * | | |If the parity generated by hardware, user fill ID0~ID5 (PID [29:24] ), hardware will calculate P0 (PID[30]) and P1 (PID[31]), otherwise user must filled frame ID and parity in this field. - * | | |Note1: User can fill any 8-bit value to this field and the bit 24 indicates ID0 (LSB first). - * | | |Note2: This field can be used for LIN master mode or slave mode. - * @var UART_T::LINSTS - * Offset: 0x38 UART LIN Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLVHDETF |LIN Slave Header Detection Flag - * | | |This bit is set by hardware when a LIN header is detected in LIN slave mode and be cleared by writing 1 to it. - * | | |0 = LIN header not detected. - * | | |1 = LIN header detected (break + sync + frame ID). - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when in LIN slave mode (SLVEN (UART_LINCTL [0]) = 1) and enable LIN slave header detection function (SLVHDEN (UART_LINCTL [1])). - * | | |Note3: When enable ID parity check IDPEN (UART_LINCTL [9]), if hardware detect complete header (break + sync + frame ID), the SLVHDETF will be set whether the frame ID correct or not. - * |[1] |SLVHEF |LIN Slave Header Error Flag - * | | |This bit is set by hardware when a LIN header error is detected in LIN slave mode and be cleared by writing 1 to it - * | | |The header errors include break delimiter is too short (less than 0.5 bit time), frame error in sync field or Identifier field, sync field data is not 0x55 in Non-Automatic Resynchronization mode, sync field deviation error with Automatic Resynchronization mode, sync field measure time-out with Automatic Resynchronization mode and LIN header reception time-out. - * | | |0 = LIN header error not detected. - * | | |1 = LIN header error detected. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when UART is operated in LIN slave mode (SLVEN (UART_LINCTL [0]) = 1) and enables LIN slave header detection function (SLVHDEN (UART_LINCTL [1])). - * |[2] |SLVIDPEF |LIN Slave ID Parity Error Flag - * | | |This bit is set by hardware when receipted frame ID parity is not correct. - * | | |0 = No active. - * | | |1 = Receipted frame ID parity is not correct. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when in LIN slave mode (SLVEN (UART_LINCTL [0]) = 1) and enable LIN frame ID parity check function IDPEN (UART_LINCTL [9]). - * |[3] |SLVSYNCF |LIN Slave Sync Field - * | | |This bit indicates that the LIN sync field is being analyzed in Automatic Resynchronization mode. - * | | |When the receiver header have some error been detect, user must reset the internal circuit to re-search new frame header by writing 1 to this bit. - * | | |0 = The current character is not at LIN sync state. - * | | |1 = The current character is at LIN sync state. - * | | |Note1: This bit is only valid when in LIN Slave mode (SLVEN(UART_LINCTL[0]) = 1). - * | | |Note2: This bit can be cleared by writing 1 to it. - * | | |Note3: When writing 1 to it, hardware will reload the initial baud rate and re-search a new frame header. - * |[8] |BRKDETF |LIN Break Detection Flag - * | | |This bit is set by hardware when a break is detected and be cleared by writing 1 to it through software. - * | | |0 = LIN break not detected. - * | | |1 = LIN break detected. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when LIN break detection function is enabled (BRKDETEN (UART_LINCTL[10]) = 1). - * |[9] |BITEF |Bit Error Detect Status Flag - * | | |At TX transfer state, hardware will monitor the bus state, if the input pin (UART_RXD) state not equals to the output pin (UART_TXD) state, BITEF (UART_LINSTS[9]) will be set. - * | | |When occur bit error, if the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * | | |0 = Bit error not detected. - * | | |1 = Bit error detected. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when enable bit error detection function (BITERREN (UART_LINCTL [12]) = 1). - * @var UART_T::BRCOMP - * Offset: 0x3C UART Baud Rate Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |BRCOMP |Baud Rate Compensation Patten - * | | |These 9-bits are used to define the relative bit is compensated or not. - * | | |BRCOMP[7:0] is used to define the compensation of UART_DAT[7:0] and BRCOMP[8] is used to define the parity bit. - * |[31] |BRCOMPDEC |Baud Rate Compensation Decrease - * | | |0 = Positive (increase one module clock) compensation for each compensated bit. - * | | |1 = Negative (decrease one module clock) compensation for each compensated bit. - * @var UART_T::WKCTL - * Offset: 0x40 UART Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKCTSEN |nCTS Wake-up Enable Bit - * | | |0 = nCTS Wake-up system function Disabled. - * | | |1 = nCTS Wake-up system function Enabled, when the system is in Power-down mode, an external. - * | | |nCTS change will wake-up system from Power-down mode. - * |[1] |WKDATEN |Incoming Data Wake-up Enable Bit - * | | |0 = Incoming data wake-up system function Disabled. - * | | |1 = Incoming data wake-up system function Enabled, when the system is in Power-down mode,. - * | | |incoming data will wake-up system from Power-down mode. - * |[2] |WKRFRTEN |Received Data FIFO Reached Threshold Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold wake-up system function Enabled, when the system is. - * | | |in Power-down mode, Received Data FIFO reached threshold will wake-up system from - * | | |Power-down mode. - * |[3] |WKRS485EN |RS-485 Address Match (AAD Mode) Wake-up Enable Bit - * | | |0 = RS-485 Address Match (AAD mode) wake-up system function Disabled. - * | | |1 = RS-485 Address Match (AAD mode) wake-up system function Enabled, when the system is in Power-down mode, RS-485 Address Match will wake-up system from Power-down mode. - * | | |Note: This bit is used for RS-485 Auto Address Detection (AAD) mode in RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1. - * |[4] |WKTOUTEN |Received Data FIFO Reached Threshold Time-out Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold time-out wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold time-out wake-up system function Enabled, when the system is in Power-down mode, Received Data FIFO reached threshold time-out will wake-up system from Power-down mode. - * | | |Note: It is suggest the function is enabled when the WKRFRTEN (UART_WKCTL[2]) is set to 1. - * @var UART_T::WKSTS - * Offset: 0x44 UART Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSWKF |nCTS Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by nCTS wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by nCTS wake-up. - * | | |Note1: If WKCTSEN (UART_WKCTL[0]) is enabled, the nCTS wake-up cause this bit is set to 1. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[1] |DATWKF |Incoming Data Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by data wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Incoming Data wake-up. - * | | |Note1: If WKDATEN (UART_WKCTL[1]) is enabled, the Incoming Data wake-up cause this bit is set to 1. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[2] |RFRTWKF |Received Data FIFO Reached Threshold Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO reached threshold wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO Reached Threshold wake-up. - * | | |Note1: If WKRFRTEN (UART_WKCTL[2]) is enabled, the Received Data FIFO Reached Threshold wake-up cause this bit is set to 1. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[3] |RS485WKF |RS-485 Address Match (AAD Mode) Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by RS-485 Address Match (AAD mode). - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by RS-485 Address Match (AAD mode) wake-up. - * | | |Note1: If WKRS485EN (UART_WKCTL[3]) is enabled, the RS-485 Address Match (AAD mode) wake-up cause this bit is set to 1. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[4] |TOUTWKF |Received Data FIFO Threshold Time-out Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO Threshold Time-out wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO reached threshold time-out wake-up. - * | | |Note1: If WKTOUTEN (UART_WKCTL[4]) is enabled, the Received Data FIFO reached threshold time-out wake-up cause this bit is set to 1. - * | | |Note2: This bit can be cleared by writing 1 to it. - * @var UART_T::DWKCOMP - * Offset: 0x48 UART Incoming Data Wake-up Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STCOMP |Start Bit Compensation Value - * | | |These bits field indicate how many clock cycle selected by UART_CLK do the UART controller can get the 1st bit (start bit) when the device is wake-up from power-down mode. - * | | |Note: It is valid only when WKDATEN (UART_WKCTL[1]) is set. - */ - - - __IO uint32_t DAT; /*!< [0x0000] UART Receive/Transmit Buffer Register */ - __IO uint32_t INTEN; /*!< [0x0004] UART Interrupt Enable Register */ - __IO uint32_t FIFO; /*!< [0x0008] UART FIFO Control Register */ - __IO uint32_t LINE; /*!< [0x000c] UART Line Control Register */ - __IO uint32_t MODEM; /*!< [0x0010] UART Modem Control Register */ - __IO uint32_t MODEMSTS; /*!< [0x0014] UART Modem Status Register */ - __IO uint32_t FIFOSTS; /*!< [0x0018] UART FIFO Status Register */ - __IO uint32_t INTSTS; /*!< [0x001c] UART Interrupt Status Register */ - __IO uint32_t TOUT; /*!< [0x0020] UART Time-out Register */ - __IO uint32_t BAUD; /*!< [0x0024] UART Baud Rate Divider Register */ - __IO uint32_t IRDA; /*!< [0x0028] UART IrDA Control Register */ - __IO uint32_t ALTCTL; /*!< [0x002c] UART Alternate Control/Status Register */ - __IO uint32_t FUNCSEL; /*!< [0x0030] UART Function Select Register */ - __IO uint32_t LINCTL; /*!< [0x0034] UART LIN Control Register */ - __IO uint32_t LINSTS; /*!< [0x0038] UART LIN Status Register */ - __IO uint32_t BRCOMP; /*!< [0x003c] UART Baud Rate Compensation Register */ - __IO uint32_t WKCTL; /*!< [0x0040] UART Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0044] UART Wake-up Status Register */ - __IO uint32_t DWKCOMP; /*!< [0x0048] UART Incoming Data Wake-up Compensation Register */ - - -} UART_T; - -/** - @addtogroup UART_CONST UART Bit Field Definition - Constant Definitions for UART Controller - @{ -*/ - -#define UART_DAT_DAT_Pos (0) /*!< UART_T::DAT: DAT Position */ -#define UART_DAT_DAT_Msk (0xfful << UART_DAT_DAT_Pos) /*!< UART_T::DAT: DAT Mask */ - -#define UART_DAT_PARITY_Pos (8) /*!< UART_T::DAT: PARITY Position */ -#define UART_DAT_PARITY_Msk (0x1ul << UART_DAT_PARITY_Pos) /*!< UART_T::DAT: PARITY Mask */ - -#define UART_INTEN_RDAIEN_Pos (0) /*!< UART_T::INTEN: RDAIEN Position */ -#define UART_INTEN_RDAIEN_Msk (0x1ul << UART_INTEN_RDAIEN_Pos) /*!< UART_T::INTEN: RDAIEN Mask */ - -#define UART_INTEN_THREIEN_Pos (1) /*!< UART_T::INTEN: THREIEN Position */ -#define UART_INTEN_THREIEN_Msk (0x1ul << UART_INTEN_THREIEN_Pos) /*!< UART_T::INTEN: THREIEN Mask */ - -#define UART_INTEN_RLSIEN_Pos (2) /*!< UART_T::INTEN: RLSIEN Position */ -#define UART_INTEN_RLSIEN_Msk (0x1ul << UART_INTEN_RLSIEN_Pos) /*!< UART_T::INTEN: RLSIEN Mask */ - -#define UART_INTEN_MODEMIEN_Pos (3) /*!< UART_T::INTEN: MODEMIEN Position */ -#define UART_INTEN_MODEMIEN_Msk (0x1ul << UART_INTEN_MODEMIEN_Pos) /*!< UART_T::INTEN: MODEMIEN Mask */ - -#define UART_INTEN_RXTOIEN_Pos (4) /*!< UART_T::INTEN: RXTOIEN Position */ -#define UART_INTEN_RXTOIEN_Msk (0x1ul << UART_INTEN_RXTOIEN_Pos) /*!< UART_T::INTEN: RXTOIEN Mask */ - -#define UART_INTEN_BUFERRIEN_Pos (5) /*!< UART_T::INTEN: BUFERRIEN Position */ -#define UART_INTEN_BUFERRIEN_Msk (0x1ul << UART_INTEN_BUFERRIEN_Pos) /*!< UART_T::INTEN: BUFERRIEN Mask */ - -#define UART_INTEN_WKIEN_Pos (6) /*!< UART_T::INTEN: WKIEN Position */ -#define UART_INTEN_WKIEN_Msk (0x1ul << UART_INTEN_WKIEN_Pos) /*!< UART_T::INTEN: WKIEN Mask */ - -#define UART_INTEN_LINIEN_Pos (8) /*!< UART_T::INTEN: LINIEN Position */ -#define UART_INTEN_LINIEN_Msk (0x1ul << UART_INTEN_LINIEN_Pos) /*!< UART_T::INTEN: LINIEN Mask */ - -#define UART_INTEN_TOCNTEN_Pos (11) /*!< UART_T::INTEN: TOCNTEN Position */ -#define UART_INTEN_TOCNTEN_Msk (0x1ul << UART_INTEN_TOCNTEN_Pos) /*!< UART_T::INTEN: TOCNTEN Mask */ - -#define UART_INTEN_ATORTSEN_Pos (12) /*!< UART_T::INTEN: ATORTSEN Position */ -#define UART_INTEN_ATORTSEN_Msk (0x1ul << UART_INTEN_ATORTSEN_Pos) /*!< UART_T::INTEN: ATORTSEN Mask */ - -#define UART_INTEN_ATOCTSEN_Pos (13) /*!< UART_T::INTEN: ATOCTSEN Position */ -#define UART_INTEN_ATOCTSEN_Msk (0x1ul << UART_INTEN_ATOCTSEN_Pos) /*!< UART_T::INTEN: ATOCTSEN Mask */ - -#define UART_INTEN_TXPDMAEN_Pos (14) /*!< UART_T::INTEN: TXPDMAEN Position */ -#define UART_INTEN_TXPDMAEN_Msk (0x1ul << UART_INTEN_TXPDMAEN_Pos) /*!< UART_T::INTEN: TXPDMAEN Mask */ - -#define UART_INTEN_RXPDMAEN_Pos (15) /*!< UART_T::INTEN: RXPDMAEN Position */ -#define UART_INTEN_RXPDMAEN_Msk (0x1ul << UART_INTEN_RXPDMAEN_Pos) /*!< UART_T::INTEN: RXPDMAEN Mask */ - -#define UART_INTEN_SWBEIEN_Pos (16) /*!< UART_T::INTEN: SWBEIEN Position */ -#define UART_INTEN_SWBEIEN_Msk (0x1ul << UART_INTEN_SWBEIEN_Pos) /*!< UART_T::INTEN: SWBEIEN Mask */ - -#define UART_INTEN_ABRIEN_Pos (18) /*!< UART_T::INTEN: ABRIEN Position */ -#define UART_INTEN_ABRIEN_Msk (0x1ul << UART_INTEN_ABRIEN_Pos) /*!< UART_T::INTEN: ABRIEN Mask */ - -#define UART_INTEN_TXENDIEN_Pos (22) /*!< UART_T::INTEN: TXENDIEN Position */ -#define UART_INTEN_TXENDIEN_Msk (0x1ul << UART_INTEN_TXENDIEN_Pos) /*!< UART_T::INTEN: TXENDIEN Mask */ - -#define UART_FIFO_RXRST_Pos (1) /*!< UART_T::FIFO: RXRST Position */ -#define UART_FIFO_RXRST_Msk (0x1ul << UART_FIFO_RXRST_Pos) /*!< UART_T::FIFO: RXRST Mask */ - -#define UART_FIFO_TXRST_Pos (2) /*!< UART_T::FIFO: TXRST Position */ -#define UART_FIFO_TXRST_Msk (0x1ul << UART_FIFO_TXRST_Pos) /*!< UART_T::FIFO: TXRST Mask */ - -#define UART_FIFO_RFITL_Pos (4) /*!< UART_T::FIFO: RFITL Position */ -#define UART_FIFO_RFITL_Msk (0xful << UART_FIFO_RFITL_Pos) /*!< UART_T::FIFO: RFITL Mask */ - -#define UART_FIFO_RXOFF_Pos (8) /*!< UART_T::FIFO: RXOFF Position */ -#define UART_FIFO_RXOFF_Msk (0x1ul << UART_FIFO_RXOFF_Pos) /*!< UART_T::FIFO: RXOFF Mask */ - -#define UART_FIFO_RTSTRGLV_Pos (16) /*!< UART_T::FIFO: RTSTRGLV Position */ -#define UART_FIFO_RTSTRGLV_Msk (0xful << UART_FIFO_RTSTRGLV_Pos) /*!< UART_T::FIFO: RTSTRGLV Mask */ - -#define UART_LINE_WLS_Pos (0) /*!< UART_T::LINE: WLS Position */ -#define UART_LINE_WLS_Msk (0x3ul << UART_LINE_WLS_Pos) /*!< UART_T::LINE: WLS Mask */ - -#define UART_LINE_NSB_Pos (2) /*!< UART_T::LINE: NSB Position */ -#define UART_LINE_NSB_Msk (0x1ul << UART_LINE_NSB_Pos) /*!< UART_T::LINE: NSB Mask */ - -#define UART_LINE_PBE_Pos (3) /*!< UART_T::LINE: PBE Position */ -#define UART_LINE_PBE_Msk (0x1ul << UART_LINE_PBE_Pos) /*!< UART_T::LINE: PBE Mask */ - -#define UART_LINE_EPE_Pos (4) /*!< UART_T::LINE: EPE Position */ -#define UART_LINE_EPE_Msk (0x1ul << UART_LINE_EPE_Pos) /*!< UART_T::LINE: EPE Mask */ - -#define UART_LINE_SPE_Pos (5) /*!< UART_T::LINE: SPE Position */ -#define UART_LINE_SPE_Msk (0x1ul << UART_LINE_SPE_Pos) /*!< UART_T::LINE: SPE Mask */ - -#define UART_LINE_BCB_Pos (6) /*!< UART_T::LINE: BCB Position */ -#define UART_LINE_BCB_Msk (0x1ul << UART_LINE_BCB_Pos) /*!< UART_T::LINE: BCB Mask */ - -#define UART_LINE_PSS_Pos (7) /*!< UART_T::LINE: PSS Position */ -#define UART_LINE_PSS_Msk (0x1ul << UART_LINE_PSS_Pos) /*!< UART_T::LINE: PSS Mask */ - -#define UART_LINE_TXDINV_Pos (8) /*!< UART_T::LINE: TXDINV Position */ -#define UART_LINE_TXDINV_Msk (0x1ul << UART_LINE_TXDINV_Pos) /*!< UART_T::LINE: TXDINV Mask */ - -#define UART_LINE_RXDINV_Pos (9) /*!< UART_T::LINE: RXDINV Position */ -#define UART_LINE_RXDINV_Msk (0x1ul << UART_LINE_RXDINV_Pos) /*!< UART_T::LINE: RXDINV Mask */ - -#define UART_MODEM_RTS_Pos (1) /*!< UART_T::MODEM: RTS Position */ -#define UART_MODEM_RTS_Msk (0x1ul << UART_MODEM_RTS_Pos) /*!< UART_T::MODEM: RTS Mask */ - -#define UART_MODEM_RTSACTLV_Pos (9) /*!< UART_T::MODEM: RTSACTLV Position */ -#define UART_MODEM_RTSACTLV_Msk (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< UART_T::MODEM: RTSACTLV Mask */ - -#define UART_MODEM_RTSSTS_Pos (13) /*!< UART_T::MODEM: RTSSTS Position */ -#define UART_MODEM_RTSSTS_Msk (0x1ul << UART_MODEM_RTSSTS_Pos) /*!< UART_T::MODEM: RTSSTS Mask */ - -#define UART_MODEMSTS_CTSDETF_Pos (0) /*!< UART_T::MODEMSTS: CTSDETF Position */ -#define UART_MODEMSTS_CTSDETF_Msk (0x1ul << UART_MODEMSTS_CTSDETF_Pos) /*!< UART_T::MODEMSTS: CTSDETF Mask */ - -#define UART_MODEMSTS_CTSSTS_Pos (4) /*!< UART_T::MODEMSTS: CTSSTS Position */ -#define UART_MODEMSTS_CTSSTS_Msk (0x1ul << UART_MODEMSTS_CTSSTS_Pos) /*!< UART_T::MODEMSTS: CTSSTS Mask */ - -#define UART_MODEMSTS_CTSACTLV_Pos (8) /*!< UART_T::MODEMSTS: CTSACTLV Position */ -#define UART_MODEMSTS_CTSACTLV_Msk (0x1ul << UART_MODEMSTS_CTSACTLV_Pos) /*!< UART_T::MODEMSTS: CTSACTLV Mask */ - -#define UART_FIFOSTS_RXOVIF_Pos (0) /*!< UART_T::FIFOSTS: RXOVIF Position */ -#define UART_FIFOSTS_RXOVIF_Msk (0x1ul << UART_FIFOSTS_RXOVIF_Pos) /*!< UART_T::FIFOSTS: RXOVIF Mask */ - -#define UART_FIFOSTS_ABRDIF_Pos (1) /*!< UART_T::FIFOSTS: ABRDIF Position */ -#define UART_FIFOSTS_ABRDIF_Msk (0x1ul << UART_FIFOSTS_ABRDIF_Pos) /*!< UART_T::FIFOSTS: ABRDIF Mask */ - -#define UART_FIFOSTS_ABRDTOIF_Pos (2) /*!< UART_T::FIFOSTS: ABRDTOIF Position */ -#define UART_FIFOSTS_ABRDTOIF_Msk (0x1ul << UART_FIFOSTS_ABRDTOIF_Pos) /*!< UART_T::FIFOSTS: ABRDTOIF Mask */ - -#define UART_FIFOSTS_ADDRDETF_Pos (3) /*!< UART_T::FIFOSTS: ADDRDETF Position */ -#define UART_FIFOSTS_ADDRDETF_Msk (0x1ul << UART_FIFOSTS_ADDRDETF_Pos) /*!< UART_T::FIFOSTS: ADDRDETF Mask */ - -#define UART_FIFOSTS_PEF_Pos (4) /*!< UART_T::FIFOSTS: PEF Position */ -#define UART_FIFOSTS_PEF_Msk (0x1ul << UART_FIFOSTS_PEF_Pos) /*!< UART_T::FIFOSTS: PEF Mask */ - -#define UART_FIFOSTS_FEF_Pos (5) /*!< UART_T::FIFOSTS: FEF Position */ -#define UART_FIFOSTS_FEF_Msk (0x1ul << UART_FIFOSTS_FEF_Pos) /*!< UART_T::FIFOSTS: FEF Mask */ - -#define UART_FIFOSTS_BIF_Pos (6) /*!< UART_T::FIFOSTS: BIF Position */ -#define UART_FIFOSTS_BIF_Msk (0x1ul << UART_FIFOSTS_BIF_Pos) /*!< UART_T::FIFOSTS: BIF Mask */ - -#define UART_FIFOSTS_RXPTR_Pos (8) /*!< UART_T::FIFOSTS: RXPTR Position */ -#define UART_FIFOSTS_RXPTR_Msk (0x3ful << UART_FIFOSTS_RXPTR_Pos) /*!< UART_T::FIFOSTS: RXPTR Mask */ - -#define UART_FIFOSTS_RXEMPTY_Pos (14) /*!< UART_T::FIFOSTS: RXEMPTY Position */ -#define UART_FIFOSTS_RXEMPTY_Msk (0x1ul << UART_FIFOSTS_RXEMPTY_Pos) /*!< UART_T::FIFOSTS: RXEMPTY Mask */ - -#define UART_FIFOSTS_RXFULL_Pos (15) /*!< UART_T::FIFOSTS: RXFULL Position */ -#define UART_FIFOSTS_RXFULL_Msk (0x1ul << UART_FIFOSTS_RXFULL_Pos) /*!< UART_T::FIFOSTS: RXFULL Mask */ - -#define UART_FIFOSTS_TXPTR_Pos (16) /*!< UART_T::FIFOSTS: TXPTR Position */ -#define UART_FIFOSTS_TXPTR_Msk (0x3ful << UART_FIFOSTS_TXPTR_Pos) /*!< UART_T::FIFOSTS: TXPTR Mask */ - -#define UART_FIFOSTS_TXEMPTY_Pos (22) /*!< UART_T::FIFOSTS: TXEMPTY Position */ -#define UART_FIFOSTS_TXEMPTY_Msk (0x1ul << UART_FIFOSTS_TXEMPTY_Pos) /*!< UART_T::FIFOSTS: TXEMPTY Mask */ - -#define UART_FIFOSTS_TXFULL_Pos (23) /*!< UART_T::FIFOSTS: TXFULL Position */ -#define UART_FIFOSTS_TXFULL_Msk (0x1ul << UART_FIFOSTS_TXFULL_Pos) /*!< UART_T::FIFOSTS: TXFULL Mask */ - -#define UART_FIFOSTS_TXOVIF_Pos (24) /*!< UART_T::FIFOSTS: TXOVIF Position */ -#define UART_FIFOSTS_TXOVIF_Msk (0x1ul << UART_FIFOSTS_TXOVIF_Pos) /*!< UART_T::FIFOSTS: TXOVIF Mask */ - -#define UART_FIFOSTS_TXEMPTYF_Pos (28) /*!< UART_T::FIFOSTS: TXEMPTYF Position */ -#define UART_FIFOSTS_TXEMPTYF_Msk (0x1ul << UART_FIFOSTS_TXEMPTYF_Pos) /*!< UART_T::FIFOSTS: TXEMPTYF Mask */ - -#define UART_FIFOSTS_RXIDLE_Pos (29) /*!< UART_T::FIFOSTS: RXIDLE Position */ -#define UART_FIFOSTS_RXIDLE_Msk (0x1ul << UART_FIFOSTS_RXIDLE_Pos) /*!< UART_T::FIFOSTS: RXIDLE Mask */ - -#define UART_FIFOSTS_TXRXACT_Pos (31) /*!< UART_T::FIFOSTS: TXRXACT Position */ -#define UART_FIFOSTS_TXRXACT_Msk (0x1ul << UART_FIFOSTS_TXRXACT_Pos) /*!< UART_T::FIFOSTS: TXRXACT Mask */ - -#define UART_INTSTS_RDAIF_Pos (0) /*!< UART_T::INTSTS: RDAIF Position */ -#define UART_INTSTS_RDAIF_Msk (0x1ul << UART_INTSTS_RDAIF_Pos) /*!< UART_T::INTSTS: RDAIF Mask */ - -#define UART_INTSTS_THREIF_Pos (1) /*!< UART_T::INTSTS: THREIF Position */ -#define UART_INTSTS_THREIF_Msk (0x1ul << UART_INTSTS_THREIF_Pos) /*!< UART_T::INTSTS: THREIF Mask */ - -#define UART_INTSTS_RLSIF_Pos (2) /*!< UART_T::INTSTS: RLSIF Position */ -#define UART_INTSTS_RLSIF_Msk (0x1ul << UART_INTSTS_RLSIF_Pos) /*!< UART_T::INTSTS: RLSIF Mask */ - -#define UART_INTSTS_MODEMIF_Pos (3) /*!< UART_T::INTSTS: MODEMIF Position */ -#define UART_INTSTS_MODEMIF_Msk (0x1ul << UART_INTSTS_MODEMIF_Pos) /*!< UART_T::INTSTS: MODEMIF Mask */ - -#define UART_INTSTS_RXTOIF_Pos (4) /*!< UART_T::INTSTS: RXTOIF Position */ -#define UART_INTSTS_RXTOIF_Msk (0x1ul << UART_INTSTS_RXTOIF_Pos) /*!< UART_T::INTSTS: RXTOIF Mask */ - -#define UART_INTSTS_BUFERRIF_Pos (5) /*!< UART_T::INTSTS: BUFERRIF Position */ -#define UART_INTSTS_BUFERRIF_Msk (0x1ul << UART_INTSTS_BUFERRIF_Pos) /*!< UART_T::INTSTS: BUFERRIF Mask */ - -#define UART_INTSTS_WKIF_Pos (6) /*!< UART_T::INTSTS: WKIF Position */ -#define UART_INTSTS_WKIF_Msk (0x1ul << UART_INTSTS_WKIF_Pos) /*!< UART_T::INTSTS: WKIF Mask */ - -#define UART_INTSTS_LINIF_Pos (7) /*!< UART_T::INTSTS: LINIF Position */ -#define UART_INTSTS_LINIF_Msk (0x1ul << UART_INTSTS_LINIF_Pos) /*!< UART_T::INTSTS: LINIF Mask */ - -#define UART_INTSTS_RDAINT_Pos (8) /*!< UART_T::INTSTS: RDAINT Position */ -#define UART_INTSTS_RDAINT_Msk (0x1ul << UART_INTSTS_RDAINT_Pos) /*!< UART_T::INTSTS: RDAINT Mask */ - -#define UART_INTSTS_THREINT_Pos (9) /*!< UART_T::INTSTS: THREINT Position */ -#define UART_INTSTS_THREINT_Msk (0x1ul << UART_INTSTS_THREINT_Pos) /*!< UART_T::INTSTS: THREINT Mask */ - -#define UART_INTSTS_RLSINT_Pos (10) /*!< UART_T::INTSTS: RLSINT Position */ -#define UART_INTSTS_RLSINT_Msk (0x1ul << UART_INTSTS_RLSINT_Pos) /*!< UART_T::INTSTS: RLSINT Mask */ - -#define UART_INTSTS_MODEMINT_Pos (11) /*!< UART_T::INTSTS: MODEMINT Position */ -#define UART_INTSTS_MODEMINT_Msk (0x1ul << UART_INTSTS_MODEMINT_Pos) /*!< UART_T::INTSTS: MODEMINT Mask */ - -#define UART_INTSTS_RXTOINT_Pos (12) /*!< UART_T::INTSTS: RXTOINT Position */ -#define UART_INTSTS_RXTOINT_Msk (0x1ul << UART_INTSTS_RXTOINT_Pos) /*!< UART_T::INTSTS: RXTOINT Mask */ - -#define UART_INTSTS_BUFERRINT_Pos (13) /*!< UART_T::INTSTS: BUFERRINT Position */ -#define UART_INTSTS_BUFERRINT_Msk (0x1ul << UART_INTSTS_BUFERRINT_Pos) /*!< UART_T::INTSTS: BUFERRINT Mask */ - -#define UART_INTSTS_WKINT_Pos (14) /*!< UART_T::INTSTS: WKINT Position */ -#define UART_INTSTS_WKINT_Msk (0x1ul << UART_INTSTS_WKINT_Pos) /*!< UART_T::INTSTS: WKINT Mask */ - -#define UART_INTSTS_LININT_Pos (15) /*!< UART_T::INTSTS: LININT Position */ -#define UART_INTSTS_LININT_Msk (0x1ul << UART_INTSTS_LININT_Pos) /*!< UART_T::INTSTS: LININT Mask */ - -#define UART_INTSTS_SWBEIF_Pos (16) /*!< UART_T::INTSTS: SWBEIF Position */ -#define UART_INTSTS_SWBEIF_Msk (0x1ul << UART_INTSTS_SWBEIF_Pos) /*!< UART_T::INTSTS: SWBEIF Mask */ - -#define UART_INTSTS_HWRLSIF_Pos (18) /*!< UART_T::INTSTS: HWRLSIF Position */ -#define UART_INTSTS_HWRLSIF_Msk (0x1ul << UART_INTSTS_HWRLSIF_Pos) /*!< UART_T::INTSTS: HWRLSIF Mask */ - -#define UART_INTSTS_HWMODIF_Pos (19) /*!< UART_T::INTSTS: HWMODIF Position */ -#define UART_INTSTS_HWMODIF_Msk (0x1ul << UART_INTSTS_HWMODIF_Pos) /*!< UART_T::INTSTS: HWMODIF Mask */ - -#define UART_INTSTS_HWTOIF_Pos (20) /*!< UART_T::INTSTS: HWTOIF Position */ -#define UART_INTSTS_HWTOIF_Msk (0x1ul << UART_INTSTS_HWTOIF_Pos) /*!< UART_T::INTSTS: HWTOIF Mask */ - -#define UART_INTSTS_HWBUFEIF_Pos (21) /*!< UART_T::INTSTS: HWBUFEIF Position */ -#define UART_INTSTS_HWBUFEIF_Msk (0x1ul << UART_INTSTS_HWBUFEIF_Pos) /*!< UART_T::INTSTS: HWBUFEIF Mask */ - -#define UART_INTSTS_TXENDIF_Pos (22) /*!< UART_T::INTSTS: TXENDIF Position */ -#define UART_INTSTS_TXENDIF_Msk (0x1ul << UART_INTSTS_TXENDIF_Pos) /*!< UART_T::INTSTS: TXENDIF Mask */ - -#define UART_INTSTS_SWBEINT_Pos (24) /*!< UART_T::INTSTS: SWBEINT Position */ -#define UART_INTSTS_SWBEINT_Msk (0x1ul << UART_INTSTS_SWBEINT_Pos) /*!< UART_T::INTSTS: SWBEINT Mask */ - -#define UART_INTSTS_HWRLSINT_Pos (26) /*!< UART_T::INTSTS: HWRLSINT Position */ -#define UART_INTSTS_HWRLSINT_Msk (0x1ul << UART_INTSTS_HWRLSINT_Pos) /*!< UART_T::INTSTS: HWRLSINT Mask */ - -#define UART_INTSTS_HWMODINT_Pos (27) /*!< UART_T::INTSTS: HWMODINT Position */ -#define UART_INTSTS_HWMODINT_Msk (0x1ul << UART_INTSTS_HWMODINT_Pos) /*!< UART_T::INTSTS: HWMODINT Mask */ - -#define UART_INTSTS_HWTOINT_Pos (28) /*!< UART_T::INTSTS: HWTOINT Position */ -#define UART_INTSTS_HWTOINT_Msk (0x1ul << UART_INTSTS_HWTOINT_Pos) /*!< UART_T::INTSTS: HWTOINT Mask */ - -#define UART_INTSTS_HWBUFEINT_Pos (29) /*!< UART_T::INTSTS: HWBUFEINT Position */ -#define UART_INTSTS_HWBUFEINT_Msk (0x1ul << UART_INTSTS_HWBUFEINT_Pos) /*!< UART_T::INTSTS: HWBUFEINT Mask */ - -#define UART_INTSTS_TXENDINT_Pos (30) /*!< UART_T::INTSTS: TXENDINT Position */ -#define UART_INTSTS_TXENDINT_Msk (0x1ul << UART_INTSTS_TXENDINT_Pos) /*!< UART_T::INTSTS: TXENDINT Mask */ - -#define UART_INTSTS_ABRINT_Pos (31) /*!< UART_T::INTSTS: ABRINT Position */ -#define UART_INTSTS_ABRINT_Msk (0x1ul << UART_INTSTS_ABRINT_Pos) /*!< UART_T::INTSTS: ABRINT Mask */ - -#define UART_TOUT_TOIC_Pos (0) /*!< UART_T::TOUT: TOIC Position */ -#define UART_TOUT_TOIC_Msk (0xfful << UART_TOUT_TOIC_Pos) /*!< UART_T::TOUT: TOIC Mask */ - -#define UART_TOUT_DLY_Pos (8) /*!< UART_T::TOUT: DLY Position */ -#define UART_TOUT_DLY_Msk (0xfful << UART_TOUT_DLY_Pos) /*!< UART_T::TOUT: DLY Mask */ - -#define UART_BAUD_BRD_Pos (0) /*!< UART_T::BAUD: BRD Position */ -#define UART_BAUD_BRD_Msk (0xfffful << UART_BAUD_BRD_Pos) /*!< UART_T::BAUD: BRD Mask */ - -#define UART_BAUD_EDIVM1_Pos (24) /*!< UART_T::BAUD: EDIVM1 Position */ -#define UART_BAUD_EDIVM1_Msk (0xful << UART_BAUD_EDIVM1_Pos) /*!< UART_T::BAUD: EDIVM1 Mask */ - -#define UART_BAUD_BAUDM0_Pos (28) /*!< UART_T::BAUD: BAUDM0 Position */ -#define UART_BAUD_BAUDM0_Msk (0x1ul << UART_BAUD_BAUDM0_Pos) /*!< UART_T::BAUD: BAUDM0 Mask */ - -#define UART_BAUD_BAUDM1_Pos (29) /*!< UART_T::BAUD: BAUDM1 Position */ -#define UART_BAUD_BAUDM1_Msk (0x1ul << UART_BAUD_BAUDM1_Pos) /*!< UART_T::BAUD: BAUDM1 Mask */ - -#define UART_IRDA_TXEN_Pos (1) /*!< UART_T::IRDA: TXEN Position */ -#define UART_IRDA_TXEN_Msk (0x1ul << UART_IRDA_TXEN_Pos) /*!< UART_T::IRDA: TXEN Mask */ - -#define UART_IRDA_TXINV_Pos (5) /*!< UART_T::IRDA: TXINV Position */ -#define UART_IRDA_TXINV_Msk (0x1ul << UART_IRDA_TXINV_Pos) /*!< UART_T::IRDA: TXINV Mask */ - -#define UART_IRDA_RXINV_Pos (6) /*!< UART_T::IRDA: RXINV Position */ -#define UART_IRDA_RXINV_Msk (0x1ul << UART_IRDA_RXINV_Pos) /*!< UART_T::IRDA: RXINV Mask */ - -#define UART_ALTCTL_BRKFL_Pos (0) /*!< UART_T::ALTCTL: BRKFL Position */ -#define UART_ALTCTL_BRKFL_Msk (0xful << UART_ALTCTL_BRKFL_Pos) /*!< UART_T::ALTCTL: BRKFL Mask */ - -#define UART_ALTCTL_LINRXEN_Pos (6) /*!< UART_T::ALTCTL: LINRXEN Position */ -#define UART_ALTCTL_LINRXEN_Msk (0x1ul << UART_ALTCTL_LINRXEN_Pos) /*!< UART_T::ALTCTL: LINRXEN Mask */ - -#define UART_ALTCTL_LINTXEN_Pos (7) /*!< UART_T::ALTCTL: LINTXEN Position */ -#define UART_ALTCTL_LINTXEN_Msk (0x1ul << UART_ALTCTL_LINTXEN_Pos) /*!< UART_T::ALTCTL: LINTXEN Mask */ - -#define UART_ALTCTL_RS485NMM_Pos (8) /*!< UART_T::ALTCTL: RS485NMM Position */ -#define UART_ALTCTL_RS485NMM_Msk (0x1ul << UART_ALTCTL_RS485NMM_Pos) /*!< UART_T::ALTCTL: RS485NMM Mask */ - -#define UART_ALTCTL_RS485AAD_Pos (9) /*!< UART_T::ALTCTL: RS485AAD Position */ -#define UART_ALTCTL_RS485AAD_Msk (0x1ul << UART_ALTCTL_RS485AAD_Pos) /*!< UART_T::ALTCTL: RS485AAD Mask */ - -#define UART_ALTCTL_RS485AUD_Pos (10) /*!< UART_T::ALTCTL: RS485AUD Position */ -#define UART_ALTCTL_RS485AUD_Msk (0x1ul << UART_ALTCTL_RS485AUD_Pos) /*!< UART_T::ALTCTL: RS485AUD Mask */ - -#define UART_ALTCTL_ADDRDEN_Pos (15) /*!< UART_T::ALTCTL: ADDRDEN Position */ -#define UART_ALTCTL_ADDRDEN_Msk (0x1ul << UART_ALTCTL_ADDRDEN_Pos) /*!< UART_T::ALTCTL: ADDRDEN Mask */ - -#define UART_ALTCTL_ABRIF_Pos (17) /*!< UART_T::ALTCTL: ABRIF Position */ -#define UART_ALTCTL_ABRIF_Msk (0x1ul << UART_ALTCTL_ABRIF_Pos) /*!< UART_T::ALTCTL: ABRIF Mask */ - -#define UART_ALTCTL_ABRDEN_Pos (18) /*!< UART_T::ALTCTL: ABRDEN Position */ -#define UART_ALTCTL_ABRDEN_Msk (0x1ul << UART_ALTCTL_ABRDEN_Pos) /*!< UART_T::ALTCTL: ABRDEN Mask */ - -#define UART_ALTCTL_ABRDBITS_Pos (19) /*!< UART_T::ALTCTL: ABRDBITS Position */ -#define UART_ALTCTL_ABRDBITS_Msk (0x3ul << UART_ALTCTL_ABRDBITS_Pos) /*!< UART_T::ALTCTL: ABRDBITS Mask */ - -#define UART_ALTCTL_ADDRMV_Pos (24) /*!< UART_T::ALTCTL: ADDRMV Position */ -#define UART_ALTCTL_ADDRMV_Msk (0xfful << UART_ALTCTL_ADDRMV_Pos) /*!< UART_T::ALTCTL: ADDRMV Mask */ - -#define UART_FUNCSEL_FUNCSEL_Pos (0) /*!< UART_T::FUNCSEL: FUNCSEL Position */ -#define UART_FUNCSEL_FUNCSEL_Msk (0x7ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_T::FUNCSEL: FUNCSEL Mask */ - -#define UART_FUNCSEL_TXRXDIS_Pos (3) /*!< UART_T::FUNCSEL: TXRXDIS Position */ -#define UART_FUNCSEL_TXRXDIS_Msk (0x1ul << UART_FUNCSEL_TXRXDIS_Pos) /*!< UART_T::FUNCSEL: TXRXDIS Mask */ - -#define UART_FUNCSEL_DGE_Pos (6) /*!< UART_T::FUNCSEL: DGE Position */ -#define UART_FUNCSEL_DGE_Msk (0x1ul << UART_FUNCSEL_DGE_Pos) /*!< UART_T::FUNCSEL: DGE Mask */ - -#define UART_LINCTL_SLVEN_Pos (0) /*!< UART_T::LINCTL: SLVEN Position */ -#define UART_LINCTL_SLVEN_Msk (0x1ul << UART_LINCTL_SLVEN_Pos) /*!< UART_T::LINCTL: SLVEN Mask */ - -#define UART_LINCTL_SLVHDEN_Pos (1) /*!< UART_T::LINCTL: SLVHDEN Position */ -#define UART_LINCTL_SLVHDEN_Msk (0x1ul << UART_LINCTL_SLVHDEN_Pos) /*!< UART_T::LINCTL: SLVHDEN Mask */ - -#define UART_LINCTL_SLVAREN_Pos (2) /*!< UART_T::LINCTL: SLVAREN Position */ -#define UART_LINCTL_SLVAREN_Msk (0x1ul << UART_LINCTL_SLVAREN_Pos) /*!< UART_T::LINCTL: SLVAREN Mask */ - -#define UART_LINCTL_SLVDUEN_Pos (3) /*!< UART_T::LINCTL: SLVDUEN Position */ -#define UART_LINCTL_SLVDUEN_Msk (0x1ul << UART_LINCTL_SLVDUEN_Pos) /*!< UART_T::LINCTL: SLVDUEN Mask */ - -#define UART_LINCTL_MUTE_Pos (4) /*!< UART_T::LINCTL: MUTE Position */ -#define UART_LINCTL_MUTE_Msk (0x1ul << UART_LINCTL_MUTE_Pos) /*!< UART_T::LINCTL: MUTE Mask */ - -#define UART_LINCTL_SENDH_Pos (8) /*!< UART_T::LINCTL: SENDH Position */ -#define UART_LINCTL_SENDH_Msk (0x1ul << UART_LINCTL_SENDH_Pos) /*!< UART_T::LINCTL: SENDH Mask */ - -#define UART_LINCTL_IDPEN_Pos (9) /*!< UART_T::LINCTL: IDPEN Position */ -#define UART_LINCTL_IDPEN_Msk (0x1ul << UART_LINCTL_IDPEN_Pos) /*!< UART_T::LINCTL: IDPEN Mask */ - -#define UART_LINCTL_BRKDETEN_Pos (10) /*!< UART_T::LINCTL: BRKDETEN Position */ -#define UART_LINCTL_BRKDETEN_Msk (0x1ul << UART_LINCTL_BRKDETEN_Pos) /*!< UART_T::LINCTL: BRKDETEN Mask */ - -#define UART_LINCTL_LINRXOFF_Pos (11) /*!< UART_T::LINCTL: LINRXOFF Position */ -#define UART_LINCTL_LINRXOFF_Msk (0x1ul << UART_LINCTL_LINRXOFF_Pos) /*!< UART_T::LINCTL: LINRXOFF Mask */ - -#define UART_LINCTL_BITERREN_Pos (12) /*!< UART_T::LINCTL: BITERREN Position */ -#define UART_LINCTL_BITERREN_Msk (0x1ul << UART_LINCTL_BITERREN_Pos) /*!< UART_T::LINCTL: BITERREN Mask */ - -#define UART_LINCTL_BRKFL_Pos (16) /*!< UART_T::LINCTL: BRKFL Position */ -#define UART_LINCTL_BRKFL_Msk (0xful << UART_LINCTL_BRKFL_Pos) /*!< UART_T::LINCTL: BRKFL Mask */ - -#define UART_LINCTL_BSL_Pos (20) /*!< UART_T::LINCTL: BSL Position */ -#define UART_LINCTL_BSL_Msk (0x3ul << UART_LINCTL_BSL_Pos) /*!< UART_T::LINCTL: BSL Mask */ - -#define UART_LINCTL_HSEL_Pos (22) /*!< UART_T::LINCTL: HSEL Position */ -#define UART_LINCTL_HSEL_Msk (0x3ul << UART_LINCTL_HSEL_Pos) /*!< UART_T::LINCTL: HSEL Mask */ - -#define UART_LINCTL_PID_Pos (24) /*!< UART_T::LINCTL: PID Position */ -#define UART_LINCTL_PID_Msk (0xfful << UART_LINCTL_PID_Pos) /*!< UART_T::LINCTL: PID Mask */ - -#define UART_LINSTS_SLVHDETF_Pos (0) /*!< UART_T::LINSTS: SLVHDETF Position */ -#define UART_LINSTS_SLVHDETF_Msk (0x1ul << UART_LINSTS_SLVHDETF_Pos) /*!< UART_T::LINSTS: SLVHDETF Mask */ - -#define UART_LINSTS_SLVHEF_Pos (1) /*!< UART_T::LINSTS: SLVHEF Position */ -#define UART_LINSTS_SLVHEF_Msk (0x1ul << UART_LINSTS_SLVHEF_Pos) /*!< UART_T::LINSTS: SLVHEF Mask */ - -#define UART_LINSTS_SLVIDPEF_Pos (2) /*!< UART_T::LINSTS: SLVIDPEF Position */ -#define UART_LINSTS_SLVIDPEF_Msk (0x1ul << UART_LINSTS_SLVIDPEF_Pos) /*!< UART_T::LINSTS: SLVIDPEF Mask */ - -#define UART_LINSTS_SLVSYNCF_Pos (3) /*!< UART_T::LINSTS: SLVSYNCF Position */ -#define UART_LINSTS_SLVSYNCF_Msk (0x1ul << UART_LINSTS_SLVSYNCF_Pos) /*!< UART_T::LINSTS: SLVSYNCF Mask */ - -#define UART_LINSTS_BRKDETF_Pos (8) /*!< UART_T::LINSTS: BRKDETF Position */ -#define UART_LINSTS_BRKDETF_Msk (0x1ul << UART_LINSTS_BRKDETF_Pos) /*!< UART_T::LINSTS: BRKDETF Mask */ - -#define UART_LINSTS_BITEF_Pos (9) /*!< UART_T::LINSTS: BITEF Position */ -#define UART_LINSTS_BITEF_Msk (0x1ul << UART_LINSTS_BITEF_Pos) /*!< UART_T::LINSTS: BITEF Mask */ - -#define UART_BRCOMP_BRCOMP_Pos (0) /*!< UART_T::BRCOMP: BRCOMP Position */ -#define UART_BRCOMP_BRCOMP_Msk (0x1fful << UART_BRCOMP_BRCOMP_Pos) /*!< UART_T::BRCOMP: BRCOMP Mask */ - -#define UART_BRCOMP_BRCOMPDEC_Pos (31) /*!< UART_T::BRCOMP: BRCOMPDEC Position */ -#define UART_BRCOMP_BRCOMPDEC_Msk (0x1ul << UART_BRCOMP_BRCOMPDEC_Pos) /*!< UART_T::BRCOMP: BRCOMPDEC Mask */ - -#define UART_WKCTL_WKCTSEN_Pos (0) /*!< UART_T::WKCTL: WKCTSEN Position */ -#define UART_WKCTL_WKCTSEN_Msk (0x1ul << UART_WKCTL_WKCTSEN_Pos) /*!< UART_T::WKCTL: WKCTSEN Mask */ - -#define UART_WKCTL_WKDATEN_Pos (1) /*!< UART_T::WKCTL: WKDATEN Position */ -#define UART_WKCTL_WKDATEN_Msk (0x1ul << UART_WKCTL_WKDATEN_Pos) /*!< UART_T::WKCTL: WKDATEN Mask */ - -#define UART_WKCTL_WKRFRTEN_Pos (2) /*!< UART_T::WKCTL: WKRFRTEN Position */ -#define UART_WKCTL_WKRFRTEN_Msk (0x1ul << UART_WKCTL_WKRFRTEN_Pos) /*!< UART_T::WKCTL: WKRFRTEN Mask */ - -#define UART_WKCTL_WKRS485EN_Pos (3) /*!< UART_T::WKCTL: WKRS485EN Position */ -#define UART_WKCTL_WKRS485EN_Msk (0x1ul << UART_WKCTL_WKRS485EN_Pos) /*!< UART_T::WKCTL: WKRS485EN Mask */ - -#define UART_WKCTL_WKTOUTEN_Pos (4) /*!< UART_T::WKCTL: WKTOUTEN Position */ -#define UART_WKCTL_WKTOUTEN_Msk (0x1ul << UART_WKCTL_WKTOUTEN_Pos) /*!< UART_T::WKCTL: WKTOUTEN Mask */ - -#define UART_WKSTS_CTSWKF_Pos (0) /*!< UART_T::WKSTS: CTSWKF Position */ -#define UART_WKSTS_CTSWKF_Msk (0x1ul << UART_WKSTS_CTSWKF_Pos) /*!< UART_T::WKSTS: CTSWKF Mask */ - -#define UART_WKSTS_DATWKF_Pos (1) /*!< UART_T::WKSTS: DATWKF Position */ -#define UART_WKSTS_DATWKF_Msk (0x1ul << UART_WKSTS_DATWKF_Pos) /*!< UART_T::WKSTS: DATWKF Mask */ - -#define UART_WKSTS_RFRTWKF_Pos (2) /*!< UART_T::WKSTS: RFRTWKF Position */ -#define UART_WKSTS_RFRTWKF_Msk (0x1ul << UART_WKSTS_RFRTWKF_Pos) /*!< UART_T::WKSTS: RFRTWKF Mask */ - -#define UART_WKSTS_RS485WKF_Pos (3) /*!< UART_T::WKSTS: RS485WKF Position */ -#define UART_WKSTS_RS485WKF_Msk (0x1ul << UART_WKSTS_RS485WKF_Pos) /*!< UART_T::WKSTS: RS485WKF Mask */ - -#define UART_WKSTS_TOUTWKF_Pos (4) /*!< UART_T::WKSTS: TOUTWKF Position */ -#define UART_WKSTS_TOUTWKF_Msk (0x1ul << UART_WKSTS_TOUTWKF_Pos) /*!< UART_T::WKSTS: TOUTWKF Mask */ - -#define UART_DWKCOMP_STCOMP_Pos (0) /*!< UART_T::DWKCOMP: STCOMP Position */ -#define UART_DWKCOMP_STCOMP_Msk (0xfffful << UART_DWKCOMP_STCOMP_Pos) /*!< UART_T::DWKCOMP: STCOMP Mask */ - -/**@}*/ /* UART_CONST */ -/**@}*/ /* end of UART register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __UART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ui2c_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ui2c_reg.h deleted file mode 100644 index a2728bfc02c..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/ui2c_reg.h +++ /dev/null @@ -1,568 +0,0 @@ -/**************************************************************************//** - * @file ui2c_reg.h - * @version V1.00 - * @brief UI2C register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UI2C_REG_H__ -#define __UI2C_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- I2C Mode of USCI Controller -------------------------*/ -/** - @addtogroup UI2C I2C Mode of USCI Controller(UI2C) - Memory Mapped Structure for UI2C Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var UI2C_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var UI2C_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK = fDIV_CLK. - * | | |01 = fSAMP_CLK = fPROT_CLK. - * | | |10 = fSAMP_CLK = fSCLK. - * | | |11 = fSAMP_CLK = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter is Disabled. - * | | |1 = Time measurement counter is Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * | | |Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(UI2C_PROTCTL[6])) is enabled - * | | |The revised value is the average bit time between bit 5 and bit 6 - * | | |The user can use revised CLKDIV and new BRDETITV (UI2C_PROTCTL[24:16]) to calculate the precise baud rate. - * @var UI2C_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * | | |Note: In UART protocol, the length can be configured as 6~13 bits. - * @var UI2C_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UI2C_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note 1: In I2C protocol, RXDAT[12:8] indicate the different transmission conditions which defined in I2C. - * | | |Note 2: In UART protocol, RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (UI2C_PROTSTS[7:5]). - * @var UI2C_T::DEVADDR0 - * Offset: 0x44 USCI Device Address Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note: The DEVADDR [9:7] must be set 3'b000 when I2C operating in 7-bit address mode. - * @var UI2C_T::DEVADDR1 - * Offset: 0x48 USCI Device Address Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note: The DEVADDR [9:7] must be set 3'b000 when I2C operating in 7-bit address mode. - * @var UI2C_T::ADDRMSK0 - * Offset: 0x4C USCI Device Address Mask Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |USCI support multiple address recognition with two address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not set address mask. - * @var UI2C_T::ADDRMSK1 - * Offset: 0x50 USCI Device Address Mask Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |USCI support multiple address recognition with two address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not set address mask. - * @var UI2C_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[1] |WKADDREN |Wake-up Address Match Enable Bit - * | | |0 = The chip is woken up according data toggle. - * | | |1 = The chip is woken up according address match. - * @var UI2C_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var UI2C_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCFUNC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[1] |AA |Assert Acknowledge Control - * | | |When AA =1 prior to address or data received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line. - * |[2] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C hardware will check the bus condition if a STOP condition is detected this bit will be cleared by hardware automatically - * | | |In a slave mode, setting STO resets I2C hardware to the defined not addressed slave mode when bus error (UI2C_PROTSTS.ERRIF = 1). - * |[3] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[4] |ADDR10EN |Address 10-bit Function Enable Bit - * | | |0 = Address match 10 bit function is disabled. - * | | |1 = Address match 10 bit function is enabled. - * |[5] |PTRG |I2C Protocol Trigger (Write Only) - * | | |When a new state is present in the UI2C_PROTSTS register, if the related interrupt enable bits are set, the I2C interrupt is requested - * | | |It must write one by software to this bit after the related interrupt flags are set to 1 and the I2C protocol function will go ahead until the STOP is active or the PROTEN is disabled. - * | | |0 = I2C's stretch disabled and the I2C protocol function will go ahead. - * | | |1 = I2C's stretch active. - * |[8] |SCLOUTEN |SCL Output Enable Bit - * | | |This bit enables monitor pulling SCL to low - * | | |This monitor will pull SCL to low until it has had time to respond to an I2C interrupt. - * | | |0 = SCL output will be forced high due to open drain mechanism. - * | | |1 = I2C module may act as a slave peripheral just like in normal operation, the I2C holds the clock line low until it has had time to clear I2C interrupt. - * |[9] |MONEN |Monitor Mode Enable Bit - * | | |This bit enables monitor mode - * | | |In monitor mode the SDA output will be put in high impedance mode - * | | |This prevents the I2C module from outputting data of any kind (including ACK) onto the I2C data bus. - * | | |0 = The monitor mode is disabled. - * | | |1 = The monitor mode is enabled. - * | | |Note: Depending on the state of the SCLOUTEN bit, the SCL output may be also forced high, preventing the module from having control over the I2C clock line. - * |[25:16] |TOCNT |Time-out Clock Cycle - * | | |This bit field indicates how many clock cycle selected by TMCNTSRC (UI2C_BRGEN [5]) when each interrupt flags are clear - * | | |The time-out is enable when TOCNT bigger than 0. - * | | |Note: The TMCNTSRC (UI2C_BRGEN [5]) must be set zero on I2C mode. - * |[31] |PROTEN |I2C Protocol Enable Bit - * | | |0 = I2C Protocol disable. - * | | |1 = I2C Protocol enable. - * @var UI2C_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIEN |Time-out Interrupt Enable Control - * | | |In I2C protocol, this bit enables the interrupt generation in case of a time-out event. - * | | |0 = The time-out interrupt is disabled. - * | | |1 = The time-out interrupt is enabled. - * |[1] |STARIEN |Start Condition Received Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a start condition is detected. - * | | |0 = The start condition interrupt is disabled. - * | | |1 = The start condition interrupt is enabled. - * |[2] |STORIEN |Stop Condition Received Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a stop condition is detected. - * | | |0 = The stop condition interrupt is disabled. - * | | |1 = The stop condition interrupt is enabled. - * |[3] |NACKIEN |Non - Acknowledge Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a non - acknowledge is detected by a master. - * | | |0 = The non - acknowledge interrupt is disabled. - * | | |1 = The non - acknowledge interrupt is enabled. - * |[4] |ARBLOIEN |Arbitration Lost Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an arbitration lost event is detected. - * | | |0 = The arbitration lost interrupt is disabled. - * | | |1 = The arbitration lost interrupt is enabled. - * |[5] |ERRIEN |Error Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an I2C error condition is detected (indicated by ERR (UI2C_PROTSTS [16])). - * | | |0 = The error interrupt is disabled. - * | | |1 = The error interrupt is enabled. - * |[6] |ACKIEN |Acknowledge Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an acknowledge is detected by a master. - * | | |0 = The acknowledge interrupt is disabled. - * | | |1 = The acknowledge interrupt is enabled. - * @var UI2C_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5] |TOIF |Time-out Interrupt Flag - * | | |0 = A time-out interrupt status has not occurred. - * | | |1 = A time-out interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit - * |[6] |ONBUSY |On Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * |[8] |STARIF |Start Condition Received Interrupt Flag - * | | |This bit indicates that a start condition or repeated start condition has been detected on master mode - * | | |However, this bit also indicates that a repeated start condition has been detected on slave mode. - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.STARIEN = 1. - * | | |0 = A start condition has not yet been detected. - * | | |1 = A start condition has been detected. - * | | |It is cleared by software writing one into this bit - * |[9] |STORIF |Stop Condition Received Interrupt Flag - * | | |This bit indicates that a stop condition has been detected on the I2C bus lines - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.STORIEN = 1. - * | | |0 = A stop condition has not yet been detected. - * | | |1 = A stop condition has been detected. - * | | |It is cleared by software writing one into this bit - * | | |Note: This bit is set when slave RX mode. - * |[10] |NACKIF |Non - Acknowledge Received Interrupt Flag - * | | |This bit indicates that a non - acknowledge has been received in master mode - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.NACKIEN = 1. - * | | |0 = A non - acknowledge has not been received. - * | | |1 = A non - acknowledge has been received. - * | | |It is cleared by software writing one into this bit - * |[11] |ARBLOIF |Arbitration Lost Interrupt Flag - * | | |This bit indicates that an arbitration has been lost - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.ARBLOIEN = 1. - * | | |0 = An arbitration has not been lost. - * | | |1 = An arbitration has been lost. - * | | |It is cleared by software writing one into this bit - * |[12] |ERRIF |Error Interrupt Flag - * | | |This bit indicates that a Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.ERRIEN = 1. - * | | |0 = An I2C error has not been detected. - * | | |1 = An I2C error has been detected. - * | | |It is cleared by software writing one into this bit - * | | |Note: This bit is set when slave mode, user must write one into STO register to the defined not addressed slave mode. - * |[13] |ACKIF |Acknowledge Received Interrupt Flag - * | | |This bit indicates that an acknowledge has been received in master mode - * | | |A protocol interrupt can be generated if UI2C_PROTCTL.ACKIEN = 1. - * | | |0 = An acknowledge has not been received. - * | | |1 = An acknowledge has been received. - * | | |It is cleared by software writing one into this bit - * |[14] |SLASEL |Slave Select Status - * | | |This bit indicates that this device has been selected as slave. - * | | |0 = The device is not selected as slave. - * | | |1 = The device is selected as slave. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[15] |SLAREAD |Slave Read Request Status - * | | |This bit indicates that a slave read request has been detected. - * | | |0 = A slave R/W bit is 1 has not been detected. - * | | |1 = A slave R/W bit is 1 has been detected. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[16] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release when WKUPIF is set. - * |[17] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame - * | | |0 = Write command be record on the address match wakeup frame. - * | | |1 = Read command be record on the address match wakeup frame. - * |[18] |BUSHANG |Bus Hang-up - * | | |This bit indicates bus hang-up status - * | | |There is 4-bit counter count when SCL hold high and refer fSAMP_CLK - * | | |The hang-up counter will count to overflow and set this bit when SDA is low - * | | |The counter will be reset by falling edge of SCL signal. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is hang-up status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * |[19] |ERRARBLO |Error Arbitration Lost - * | | |This bit indicates bus arbitration lost due to bigger noise which is can't be filtered by input processor - * | | |The I2C can send start condition when ERRARBLO is set - * | | |Thus this bit doesn't be cared on slave mode. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is error arbitration lost status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * @var UI2C_T::ADMAT - * Offset: 0x88 I2C Slave Match Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADMAT0 |USCI Address 0 Match Status Register - * | | |When address 0 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[1] |ADMAT1 |USCI Address 1 Match Status Register - * | | |When address 1 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * @var UI2C_T::TMCTL - * Offset: 0x8C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control Register - * | | |This field is used to generate a delay timing between SDA edge and SCL rising edge in transmission mode.. - * | | |The delay setup time is numbers of peripheral clock = STCTL x fPCLK. - * |[24:16] |HTCTL |Hold Time Configure Control Register - * | | |This field is used to generate the delay timing between SCL falling edge SDA edge in - * | | |transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x fPCLK. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - __I uint32_t RESERVE1[8]; - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __I uint32_t RESERVE2[3]; - __IO uint32_t DEVADDR0; /*!< [0x0044] USCI Device Address Register 0 */ - __IO uint32_t DEVADDR1; /*!< [0x0048] USCI Device Address Register 1 */ - __IO uint32_t ADDRMSK0; /*!< [0x004c] USCI Device Address Mask Register 0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0050] USCI Device Address Mask Register 1 */ - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - __I uint32_t RESERVE3[8]; - __IO uint32_t ADMAT; /*!< [0x0088] I2C Slave Match Address Register */ - __IO uint32_t TMCTL; /*!< [0x008c] I2C Timing Configure Control Register */ - -} UI2C_T; - -/** - @addtogroup UI2C_CONST UI2C Bit Field Definition - Constant Definitions for UI2C Controller - @{ -*/ - -#define UI2C_CTL_FUNMODE_Pos (0) /*!< UI2C_T::CTL: FUNMODE Position */ -#define UI2C_CTL_FUNMODE_Msk (0x7ul << UI2C_CTL_FUNMODE_Pos) /*!< UI2C_T::CTL: FUNMODE Mask */ - -#define UI2C_BRGEN_RCLKSEL_Pos (0) /*!< UI2C_T::BRGEN: RCLKSEL Position */ -#define UI2C_BRGEN_RCLKSEL_Msk (0x1ul << UI2C_BRGEN_RCLKSEL_Pos) /*!< UI2C_T::BRGEN: RCLKSEL Mask */ - -#define UI2C_BRGEN_PTCLKSEL_Pos (1) /*!< UI2C_T::BRGEN: PTCLKSEL Position */ -#define UI2C_BRGEN_PTCLKSEL_Msk (0x1ul << UI2C_BRGEN_PTCLKSEL_Pos) /*!< UI2C_T::BRGEN: PTCLKSEL Mask */ - -#define UI2C_BRGEN_SPCLKSEL_Pos (2) /*!< UI2C_T::BRGEN: SPCLKSEL Position */ -#define UI2C_BRGEN_SPCLKSEL_Msk (0x3ul << UI2C_BRGEN_SPCLKSEL_Pos) /*!< UI2C_T::BRGEN: SPCLKSEL Mask */ - -#define UI2C_BRGEN_TMCNTEN_Pos (4) /*!< UI2C_T::BRGEN: TMCNTEN Position */ -#define UI2C_BRGEN_TMCNTEN_Msk (0x1ul << UI2C_BRGEN_TMCNTEN_Pos) /*!< UI2C_T::BRGEN: TMCNTEN Mask */ - -#define UI2C_BRGEN_TMCNTSRC_Pos (5) /*!< UI2C_T::BRGEN: TMCNTSRC Position */ -#define UI2C_BRGEN_TMCNTSRC_Msk (0x1ul << UI2C_BRGEN_TMCNTSRC_Pos) /*!< UI2C_T::BRGEN: TMCNTSRC Mask */ - -#define UI2C_BRGEN_PDSCNT_Pos (8) /*!< UI2C_T::BRGEN: PDSCNT Position */ -#define UI2C_BRGEN_PDSCNT_Msk (0x3ul << UI2C_BRGEN_PDSCNT_Pos) /*!< UI2C_T::BRGEN: PDSCNT Mask */ - -#define UI2C_BRGEN_DSCNT_Pos (10) /*!< UI2C_T::BRGEN: DSCNT Position */ -#define UI2C_BRGEN_DSCNT_Msk (0x1ful << UI2C_BRGEN_DSCNT_Pos) /*!< UI2C_T::BRGEN: DSCNT Mask */ - -#define UI2C_BRGEN_CLKDIV_Pos (16) /*!< UI2C_T::BRGEN: CLKDIV Position */ -#define UI2C_BRGEN_CLKDIV_Msk (0x3fful << UI2C_BRGEN_CLKDIV_Pos) /*!< UI2C_T::BRGEN: CLKDIV Mask */ - -#define UI2C_LINECTL_LSB_Pos (0) /*!< UI2C_T::LINECTL: LSB Position */ -#define UI2C_LINECTL_LSB_Msk (0x1ul << UI2C_LINECTL_LSB_Pos) /*!< UI2C_T::LINECTL: LSB Mask */ - -#define UI2C_LINECTL_DWIDTH_Pos (8) /*!< UI2C_T::LINECTL: DWIDTH Position */ -#define UI2C_LINECTL_DWIDTH_Msk (0xful << UI2C_LINECTL_DWIDTH_Pos) /*!< UI2C_T::LINECTL: DWIDTH Mask */ - -#define UI2C_TXDAT_TXDAT_Pos (0) /*!< UI2C_T::TXDAT: TXDAT Position */ -#define UI2C_TXDAT_TXDAT_Msk (0xfffful << UI2C_TXDAT_TXDAT_Pos) /*!< UI2C_T::TXDAT: TXDAT Mask */ - -#define UI2C_RXDAT_RXDAT_Pos (0) /*!< UI2C_T::RXDAT: RXDAT Position */ -#define UI2C_RXDAT_RXDAT_Msk (0xfffful << UI2C_RXDAT_RXDAT_Pos) /*!< UI2C_T::RXDAT: RXDAT Mask */ - -#define UI2C_DEVADDR0_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR0: DEVADDR Position */ -#define UI2C_DEVADDR0_DEVADDR_Msk (0x3fful << UI2C_DEVADDR0_DEVADDR_Pos) /*!< UI2C_T::DEVADDR0: DEVADDR Mask */ - -#define UI2C_DEVADDR1_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR1: DEVADDR Position */ -#define UI2C_DEVADDR1_DEVADDR_Msk (0x3fful << UI2C_DEVADDR1_DEVADDR_Pos) /*!< UI2C_T::DEVADDR1: DEVADDR Mask */ - -#define UI2C_ADDRMSK0_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK0: ADDRMSK Position */ -#define UI2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK0_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define UI2C_ADDRMSK1_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK1: ADDRMSK Position */ -#define UI2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK1_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define UI2C_WKCTL_WKEN_Pos (0) /*!< UI2C_T::WKCTL: WKEN Position */ -#define UI2C_WKCTL_WKEN_Msk (0x1ul << UI2C_WKCTL_WKEN_Pos) /*!< UI2C_T::WKCTL: WKEN Mask */ - -#define UI2C_WKCTL_WKADDREN_Pos (1) /*!< UI2C_T::WKCTL: WKADDREN Position */ -#define UI2C_WKCTL_WKADDREN_Msk (0x1ul << UI2C_WKCTL_WKADDREN_Pos) /*!< UI2C_T::WKCTL: WKADDREN Mask */ - -#define UI2C_WKSTS_WKF_Pos (0) /*!< UI2C_T::WKSTS: WKF Position */ -#define UI2C_WKSTS_WKF_Msk (0x1ul << UI2C_WKSTS_WKF_Pos) /*!< UI2C_T::WKSTS: WKF Mask */ - -#define UI2C_PROTCTL_GCFUNC_Pos (0) /*!< UI2C_T::PROTCTL: GCFUNC Position */ -#define UI2C_PROTCTL_GCFUNC_Msk (0x1ul << UI2C_PROTCTL_GCFUNC_Pos) /*!< UI2C_T::PROTCTL: GCFUNC Mask */ - -#define UI2C_PROTCTL_AA_Pos (1) /*!< UI2C_T::PROTCTL: AA Position */ -#define UI2C_PROTCTL_AA_Msk (0x1ul << UI2C_PROTCTL_AA_Pos) /*!< UI2C_T::PROTCTL: AA Mask */ - -#define UI2C_PROTCTL_STO_Pos (2) /*!< UI2C_T::PROTCTL: STO Position */ -#define UI2C_PROTCTL_STO_Msk (0x1ul << UI2C_PROTCTL_STO_Pos) /*!< UI2C_T::PROTCTL: STO Mask */ - -#define UI2C_PROTCTL_STA_Pos (3) /*!< UI2C_T::PROTCTL: STA Position */ -#define UI2C_PROTCTL_STA_Msk (0x1ul << UI2C_PROTCTL_STA_Pos) /*!< UI2C_T::PROTCTL: STA Mask */ - -#define UI2C_PROTCTL_ADDR10EN_Pos (4) /*!< UI2C_T::PROTCTL: ADDR10EN Position */ -#define UI2C_PROTCTL_ADDR10EN_Msk (0x1ul << UI2C_PROTCTL_ADDR10EN_Pos) /*!< UI2C_T::PROTCTL: ADDR10EN Mask */ - -#define UI2C_PROTCTL_PTRG_Pos (5) /*!< UI2C_T::PROTCTL: PTRG Position */ -#define UI2C_PROTCTL_PTRG_Msk (0x1ul << UI2C_PROTCTL_PTRG_Pos) /*!< UI2C_T::PROTCTL: PTRG Mask */ - -#define UI2C_PROTCTL_SCLOUTEN_Pos (8) /*!< UI2C_T::PROTCTL: SCLOUTEN Position */ -#define UI2C_PROTCTL_SCLOUTEN_Msk (0x1ul << UI2C_PROTCTL_SCLOUTEN_Pos) /*!< UI2C_T::PROTCTL: SCLOUTEN Mask */ - -#define UI2C_PROTCTL_MONEN_Pos (9) /*!< UI2C_T::PROTCTL: MONEN Position */ -#define UI2C_PROTCTL_MONEN_Msk (0x1ul << UI2C_PROTCTL_MONEN_Pos) /*!< UI2C_T::PROTCTL: MONEN Mask */ - -#define UI2C_PROTCTL_TOCNT_Pos (16) /*!< UI2C_T::PROTCTL: TOCNT Position */ -#define UI2C_PROTCTL_TOCNT_Msk (0x3fful << UI2C_PROTCTL_TOCNT_Pos) /*!< UI2C_T::PROTCTL: TOCNT Mask */ - -#define UI2C_PROTCTL_PROTEN_Pos (31) /*!< UI2C_T::PROTCTL: PROTEN Position */ -#define UI2C_PROTCTL_PROTEN_Msk (0x1ul << UI2C_PROTCTL_PROTEN_Pos) /*!< UI2C_T::PROTCTL: PROTEN Mask */ - -#define UI2C_PROTIEN_TOIEN_Pos (0) /*!< UI2C_T::PROTIEN: TOIEN Position */ -#define UI2C_PROTIEN_TOIEN_Msk (0x1ul << UI2C_PROTIEN_TOIEN_Pos) /*!< UI2C_T::PROTIEN: TOIEN Mask */ - -#define UI2C_PROTIEN_STARIEN_Pos (1) /*!< UI2C_T::PROTIEN: STARIEN Position */ -#define UI2C_PROTIEN_STARIEN_Msk (0x1ul << UI2C_PROTIEN_STARIEN_Pos) /*!< UI2C_T::PROTIEN: STARIEN Mask */ - -#define UI2C_PROTIEN_STORIEN_Pos (2) /*!< UI2C_T::PROTIEN: STORIEN Position */ -#define UI2C_PROTIEN_STORIEN_Msk (0x1ul << UI2C_PROTIEN_STORIEN_Pos) /*!< UI2C_T::PROTIEN: STORIEN Mask */ - -#define UI2C_PROTIEN_NACKIEN_Pos (3) /*!< UI2C_T::PROTIEN: NACKIEN Position */ -#define UI2C_PROTIEN_NACKIEN_Msk (0x1ul << UI2C_PROTIEN_NACKIEN_Pos) /*!< UI2C_T::PROTIEN: NACKIEN Mask */ - -#define UI2C_PROTIEN_ARBLOIEN_Pos (4) /*!< UI2C_T::PROTIEN: ARBLOIEN Position */ -#define UI2C_PROTIEN_ARBLOIEN_Msk (0x1ul << UI2C_PROTIEN_ARBLOIEN_Pos) /*!< UI2C_T::PROTIEN: ARBLOIEN Mask */ - -#define UI2C_PROTIEN_ERRIEN_Pos (5) /*!< UI2C_T::PROTIEN: ERRIEN Position */ -#define UI2C_PROTIEN_ERRIEN_Msk (0x1ul << UI2C_PROTIEN_ERRIEN_Pos) /*!< UI2C_T::PROTIEN: ERRIEN Mask */ - -#define UI2C_PROTIEN_ACKIEN_Pos (6) /*!< UI2C_T::PROTIEN: ACKIEN Position */ -#define UI2C_PROTIEN_ACKIEN_Msk (0x1ul << UI2C_PROTIEN_ACKIEN_Pos) /*!< UI2C_T::PROTIEN: ACKIEN Mask */ - -#define UI2C_PROTSTS_TOIF_Pos (5) /*!< UI2C_T::PROTSTS: TOIF Position */ -#define UI2C_PROTSTS_TOIF_Msk (0x1ul << UI2C_PROTSTS_TOIF_Pos) /*!< UI2C_T::PROTSTS: TOIF Mask */ - -#define UI2C_PROTSTS_ONBUSY_Pos (6) /*!< UI2C_T::PROTSTS: ONBUSY Position */ -#define UI2C_PROTSTS_ONBUSY_Msk (0x1ul << UI2C_PROTSTS_ONBUSY_Pos) /*!< UI2C_T::PROTSTS: ONBUSY Mask */ - -#define UI2C_PROTSTS_STARIF_Pos (8) /*!< UI2C_T::PROTSTS: STARIF Position */ -#define UI2C_PROTSTS_STARIF_Msk (0x1ul << UI2C_PROTSTS_STARIF_Pos) /*!< UI2C_T::PROTSTS: STARIF Mask */ - -#define UI2C_PROTSTS_STORIF_Pos (9) /*!< UI2C_T::PROTSTS: STORIF Position */ -#define UI2C_PROTSTS_STORIF_Msk (0x1ul << UI2C_PROTSTS_STORIF_Pos) /*!< UI2C_T::PROTSTS: STORIF Mask */ - -#define UI2C_PROTSTS_NACKIF_Pos (10) /*!< UI2C_T::PROTSTS: NACKIF Position */ -#define UI2C_PROTSTS_NACKIF_Msk (0x1ul << UI2C_PROTSTS_NACKIF_Pos) /*!< UI2C_T::PROTSTS: NACKIF Mask */ - -#define UI2C_PROTSTS_ARBLOIF_Pos (11) /*!< UI2C_T::PROTSTS: ARBLOIF Position */ -#define UI2C_PROTSTS_ARBLOIF_Msk (0x1ul << UI2C_PROTSTS_ARBLOIF_Pos) /*!< UI2C_T::PROTSTS: ARBLOIF Mask */ - -#define UI2C_PROTSTS_ERRIF_Pos (12) /*!< UI2C_T::PROTSTS: ERRIF Position */ -#define UI2C_PROTSTS_ERRIF_Msk (0x1ul << UI2C_PROTSTS_ERRIF_Pos) /*!< UI2C_T::PROTSTS: ERRIF Mask */ - -#define UI2C_PROTSTS_ACKIF_Pos (13) /*!< UI2C_T::PROTSTS: ACKIF Position */ -#define UI2C_PROTSTS_ACKIF_Msk (0x1ul << UI2C_PROTSTS_ACKIF_Pos) /*!< UI2C_T::PROTSTS: ACKIF Mask */ - -#define UI2C_PROTSTS_SLASEL_Pos (14) /*!< UI2C_T::PROTSTS: SLASEL Position */ -#define UI2C_PROTSTS_SLASEL_Msk (0x1ul << UI2C_PROTSTS_SLASEL_Pos) /*!< UI2C_T::PROTSTS: SLASEL Mask */ - -#define UI2C_PROTSTS_SLAREAD_Pos (15) /*!< UI2C_T::PROTSTS: SLAREAD Position */ -#define UI2C_PROTSTS_SLAREAD_Msk (0x1ul << UI2C_PROTSTS_SLAREAD_Pos) /*!< UI2C_T::PROTSTS: SLAREAD Mask */ - -#define UI2C_PROTSTS_WKAKDONE_Pos (16) /*!< UI2C_T::PROTSTS: WKAKDONE Position */ -#define UI2C_PROTSTS_WKAKDONE_Msk (0x1ul << UI2C_PROTSTS_WKAKDONE_Pos) /*!< UI2C_T::PROTSTS: WKAKDONE Mask */ - -#define UI2C_PROTSTS_WRSTSWK_Pos (17) /*!< UI2C_T::PROTSTS: WRSTSWK Position */ -#define UI2C_PROTSTS_WRSTSWK_Msk (0x1ul << UI2C_PROTSTS_WRSTSWK_Pos) /*!< UI2C_T::PROTSTS: WRSTSWK Mask */ - -#define UI2C_PROTSTS_BUSHANG_Pos (18) /*!< UI2C_T::PROTSTS: BUSHANG Position */ -#define UI2C_PROTSTS_BUSHANG_Msk (0x1ul << UI2C_PROTSTS_BUSHANG_Pos) /*!< UI2C_T::PROTSTS: BUSHANG Mask */ - -#define UI2C_PROTSTS_ERRARBLO_Pos (19) /*!< UI2C_T::PROTSTS: ERRARBLO Position */ -#define UI2C_PROTSTS_ERRARBLO_Msk (0x1ul << UI2C_PROTSTS_ERRARBLO_Pos) /*!< UI2C_T::PROTSTS: ERRARBLO Mask */ - -#define UI2C_ADMAT_ADMAT0_Pos (0) /*!< UI2C_T::ADMAT: ADMAT0 Position */ -#define UI2C_ADMAT_ADMAT0_Msk (0x1ul << UI2C_ADMAT_ADMAT0_Pos) /*!< UI2C_T::ADMAT: ADMAT0 Mask */ - -#define UI2C_ADMAT_ADMAT1_Pos (1) /*!< UI2C_T::ADMAT: ADMAT1 Position */ -#define UI2C_ADMAT_ADMAT1_Msk (0x1ul << UI2C_ADMAT_ADMAT1_Pos) /*!< UI2C_T::ADMAT: ADMAT1 Mask */ - -#define UI2C_TMCTL_STCTL_Pos (0) /*!< UI2C_T::TMCTL: STCTL Position */ -#define UI2C_TMCTL_STCTL_Msk (0x1fful << UI2C_TMCTL_STCTL_Pos) /*!< UI2C_T::TMCTL: STCTL Mask */ - -#define UI2C_TMCTL_HTCTL_Pos (16) /*!< UI2C_T::TMCTL: HTCTL Position */ -#define UI2C_TMCTL_HTCTL_Msk (0x1fful << UI2C_TMCTL_HTCTL_Pos) /*!< UI2C_T::TMCTL: HTCTL Mask */ - -/**@}*/ /* UI2C_CONST */ -/**@}*/ /* end of UI2C register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __UI2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbd_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbd_reg.h deleted file mode 100644 index e544931a2b0..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbd_reg.h +++ /dev/null @@ -1,658 +0,0 @@ -/**************************************************************************//** - * @file usbd_reg.h - * @version V1.00 - * @brief USBD register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBD_REG_H__ -#define __USBD_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- USB Device Controller -------------------------*/ -/** - @addtogroup USBD USB Device Controller(USBD) - Memory Mapped Structure for USBD Controller - @{ -*/ - - - -/** - * @brief USBD endpoints register - */ -typedef struct -{ - /** - * @var USBD_EP_T::BUFSEG - * Offset: 0x500/0x510/0x520/0x530/0x540/0x550/0x560/0x570/0x580/0x590/0x5A0/0x5B0 Endpoint Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |BUFSEG |Endpoint Buffer Segmentation - * | | |It is used to indicate the offset address for each endpoint with the USB SRAM starting address The effective starting address of the endpoint is - * | | |USBD_SRAM address + {BUFSEG, 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Refer to the section 6.32.5.7 for the endpoint SRAM structure and its description. - * @var USBD_EP_T::MXPLD - * Offset: 0x504/0x514/0x524/0x534/0x544/0x554/0x564/0x574/0x584/0x594/0x5A4/0x5B4 Endpoint Maximal Payload Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |MXPLD |Maximal Payload - * | | |Define the data length which is transmitted to host (IN token) or the actual data length which is received from the host (OUT token) - * | | |It also used to indicate that the endpoint is ready to be transmitted in IN token or received in OUT token. - * | | |(1) When the register is written by CPU, - * | | |For IN token, the value of MXPLD is used to define the data length to be transmitted and indicate the data buffer is ready. - * | | |For OUT token, it means that the controller is ready to receive data from the host and the value of MXPLD is the maximal data length comes from host. - * | | |(2) When the register is read by CPU, - * | | |For IN token, the value of MXPLD is indicated by the data length be transmitted to host. - * | | |For OUT token, the value of MXPLD is indicated the actual data length receiving from host. - * | | |Note: Once MXPLD is written, the data packets will be transmitted/received immediately after IN/OUT token arrived. - * @var USBD_EP_T::CFG - * Offset: 0x508/0x518/0x528/0x538/0x548/0x558/0x568/0x578/0x588/0x598/0x5A8/0x5B8 Endpoint Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNUM |Endpoint Number - * | | |These bits are used to define the endpoint number of the current endpoint. - * |[4] |ISOCH |Isochronous Endpoint - * | | |This bit is used to set the endpoint as Isochronous endpoint, no handshake. - * | | |0 = No Isochronous endpoint. - * | | |1 = Isochronous endpoint. - * |[6:5] |STATE |Endpoint State - * | | |00 = Endpoint Disabled. - * | | |01 = Out endpoint. - * | | |10 = IN endpoint. - * | | |11 = Undefined. - * |[7] |DSQSYNC |Data Sequence Synchronization - * | | |0 = DATA0 PID. - * | | |1 = DATA1 PID. - * | | |For IN token, DSQSYNC specify DATA0 or DATA1 PID in transfer data packet. - * | | |For OUT token, DSQSYNC specify DATA0 or DATA1 PID in received data packet. - * | | |DSQSYNC will be toggled automatically by hardware when IN or OUT token transfer successfully in single buffer mode, but won’t be toggled in double buffer mode. - * | | |Note 1: When double buffer is enabled, hardware will automatically write 0 to DSQSYNC with active double buffer and write 1 to DSQSYNC with inactive double buffer. - * | | |Note 2: It won’t be toggled by hardware when DBEN = 1. USB data toggle will be guaranteed by changing endpoint. - * |[9] |CSTALL |Clear STALL Response - * | | |0 = Disable the device to clear the STALL handshake in setup stage. - * | | |1 = Clear the device to response STALL handshake in setup stage. - * |[10] |DBTGACTIVE|Double Buffer Toggle Active Bit - * | | |0 = Inactive in double buffer mode. - * | | |1 = Active in double buffer mode. - * | | |When DBEN = 1 and endpoint successful transfer, DBTGACTIVE of each double buffer will be toggled automatically by hardware. - * |[11] |DBEN |Double Buffer Enable - * | | |0 = Single buffer mode. - * | | |1 = Double buffer mode. - * @var USBD_EP_T::CFGP - * Offset: 0x50C/0x51C/0x52C/0x53C/0x54C/0x55C/0x56C/0x57C/0x58C/0x59C/0x5AC/0x5BC Endpoint Set Stall and Clear In/Out Ready Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CLRRDY |Clear Ready - * | | |When the USBD_MXPLDx register is set by user, it means that the endpoint is ready to transmit or receive data - * | | |If the user wants to disable this transaction before the transaction start, users can set this bit to 1 to disable it and it is automatically cleared to 0. - * | | |For IN token, write '1' to clear the IN token had ready to transmit the data to USB. - * | | |For OUT token, write '1' to clear the OUT token had ready to receive the data from USB. - * | | |This bit is written 1 only and is always 0 when it is read back. - * |[1] |SSTALL |Set STALL - * | | |0 = Disable the device to response STALL. - * | | |1 = Set the device to respond STALL automatically. - */ - __IO uint32_t BUFSEG; /*!< [0x0000] Endpoint Buffer Segmentation Register */ - __IO uint32_t MXPLD; /*!< [0x0004] Endpoint Maximal Payload Register */ - __IO uint32_t CFG; /*!< [0x0008] Endpoint Configuration Register */ - __IO uint32_t CFGP; /*!< [0x000c] Endpoint Set Stall and Clear In/Out Ready Control Register */ - -} USBD_EP_T; - -typedef struct -{ - - - /** - * @var USBD_T::INTEN - * Offset: 0x00 USB Device Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIEN |Bus Event Interrupt Enable Bit - * | | |0 = BUS event interrupt Disabled. - * | | |1 = BUS event interrupt Enabled. - * |[1] |USBIEN |USB Event Interrupt Enable Bit - * | | |0 = USB event interrupt Disabled. - * | | |1 = USB event interrupt Enabled. - * |[2] |VBDETIEN |VBUS Detection Interrupt Enable Bit - * | | |0 = VBUS detection Interrupt Disabled. - * | | |1 = VBUS detection Interrupt Enabled. - * |[3] |NEVWKIEN |USB No-event-wake-up Interrupt Enable Bit - * | | |0 = No-event-wake-up Interrupt Disabled. - * | | |1 = No-event-wake-up Interrupt Enabled. - * |[4] |SOFIEN |Start of Frame Interrupt Enable Bit - * | | |0 = SOF Interrupt Disabled. - * | | |1 = SOF Interrupt Enabled. - * |[8] |WKEN |Wake-up Function Enable Bit - * | | |0 = USB wake-up function Disabled. - * | | |1 = USB wake-up function Enabled. - * |[15] |INNAKEN |Active NAK Function and Its Status in IN Token - * | | |0 = When device responds NAK after receiving IN token, IN NAK status will not be updated to USBD_EPSTS0 and USBD_EPSTS1register, so that the USB interrupt event will not be asserted. - * | | |1 = IN NAK status will be updated to USBD_EPSTS0 and USBD_EPSTS1 register and the USB interrupt event will be asserted, when the device responds NAK after receiving IN token. - * @var USBD_T::INTSTS - * Offset: 0x04 USB Device Interrupt Event Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIF |BUS Interrupt Status - * | | |The BUS event means that there is one of the suspense or the resume function in the bus. - * | | |0 = No BUS event occurred. - * | | |1 = Bus event occurred. Check USBD_ATTR[3:0] to know which kind of bus event was occurred, cleared by writing 1 to USBD_INTSTS[0]. - * |[1] |USBIF |USB Event Interrupt Status - * | | |The USB event includes the SETUP Token, IN Token, OUT ACK, ISO IN, or ISO OUT events in the bus. - * | | |0 = No USB event occurred. - * | | |1 = USB event occurred. Check EPSTS0~11[3:0] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[1] or EPSTS0~11 and SETUP (USBD_INTSTS[31]). - * |[2] |VBDETIF |VBUS Detection Interrupt Status - * | | |0 = There is no attached/detached event in the USB. - * | | |1 = There is attached/detached event in the USB bus and it is cleared by writing 1 to USBD_INTSTS[2]. - * |[3] |NEVWKIF |No-event-wake-up Interrupt Status - * | | |0 = NEVWK event did not occur. - * | | |1 = No-event-wake-up event occurred, cleared by writing 1 to USBD_INTSTS[3]. - * |[4] |SOFIF |Start of Frame Interrupt Status - * | | |0 = SOF event did not occur. - * | | |1 = SOF event occurred, cleared by writing 1 to USBD_INTSTS[4]. - * |[16] |EPEVT0 |Endpoint 0's USB Event Status - * | | |0 = No event occurred in endpoint 0. - * | | |1 = USB event occurred on Endpoint 0. Check USBD_EPSTS0[3:0] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[16] or USBD_INTSTS[1]. - * |[17] |EPEVT1 |Endpoint 1's USB Event Status - * | | |0 = No event occurred in endpoint 1. - * | | |1 = USB event occurred on Endpoint 1. Check USBD_EPSTS0[7:4] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[17] or USBD_INTSTS[1]. - * |[18] |EPEVT2 |Endpoint 2's USB Event Status - * | | |0 = No event occurred in endpoint 2. - * | | |1 = USB event occurred on Endpoint 2. Check USBD_EPSTS0[11:8] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[18] or USBD_INTSTS[1]. - * |[19] |EPEVT3 |Endpoint 3's USB Event Status - * | | |0 = No event occurred in endpoint 3. - * | | |1 = USB event occurred on Endpoint 3. Check USBD_EPSTS0[15:12] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[19] or USBD_INTSTS[1]. - * |[20] |EPEVT4 |Endpoint 4's USB Event Status - * | | |0 = No event occurred in endpoint 4. - * | | |1 = USB event occurred on Endpoint 4. Check USBD_EPSTS0[19:16] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[20] or USBD_INTSTS[1]. - * |[21] |EPEVT5 |Endpoint 5's USB Event Status - * | | |0 = No event occurred in endpoint 5. - * | | |1 = USB event occurred on Endpoint 5. Check USBD_EPSTS0[23:20] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[21] or USBD_INTSTS[1]. - * |[22] |EPEVT6 |Endpoint 6's USB Event Status - * | | |0 = No event occurred in endpoint 6. - * | | |1 = USB event occurred on Endpoint 6. Check USBD_EPSTS0[27:24] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[22] or USBD_INTSTS[1]. - * |[23] |EPEVT7 |Endpoint 7's USB Event Status - * | | |0 = No event occurred in endpoint 7. - * | | |1 = USB event occurred on Endpoint 7. Check USBD_EPSTS0[31:28] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[23] or USBD_INTSTS[1]. - * |[24] |EPEVT8 |Endpoint 8's USB Event Status - * | | |0 = No event occurred in endpoint 8. - * | | |1 = USB event occurred on Endpoint 8. Check USBD_EPSTS1[3:0] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[24] or USBD_INTSTS[1]. - * |[25] |EPEVT9 |Endpoint 9's USB Event Status - * | | |0 = No event occurred in endpoint 9. - * | | |1 = USB event occurred on Endpoint 9. Check USBD_EPSTS1[7:4] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[25] or USBD_INTSTS[1]. - * |[26] |EPEVT10 |Endpoint 10's USB Event Status - * | | |0 = No event occurred in endpoint 10. - * | | |1 = USB event occurred on Endpoint 10. Check USBD_EPSTS1[11:8] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[26] or USBD_INTSTS[1]. - * |[27] |EPEVT11 |Endpoint 11's USB Event Status - * | | |0 = No event occurred in endpoint 11. - * | | |1 = USB event occurred on Endpoint 11. Check USBD_EPSTS1[15:12] to know which kind of USB event was occurred, cleared by writing 1 to USBD_INTSTS[27] or USBD_INTSTS[1]. - * |[31] |SETUP |Setup Event Status - * | | |0 = No Setup event. - * | | |1 = Setup event occurred, cleared by writing 1 to USBD_INTSTS[31]. - * @var USBD_T::FADDR - * Offset: 0x08 USB Device Function Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |FADDR |USB Device Function Address - * @var USBD_T::EPSTS - * Offset: 0x0C USB Device Endpoint Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |OV |Overrun - * | | |It indicates that the received data is over the maximum payload number or not. - * | | |0 = No overrun. - * | | |1 = Out Data is more than the Max Payload in MXPLD register or the Setup Data is more than 8 bytes. - * @var USBD_T::ATTR - * Offset: 0x10 USB Device Bus Status and Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBRST |USB Reset Status (Read Only) - * | | |0 = Bus no reset. - * | | |1 = Bus reset when SE0 (single-ended 0) more than 2.5us. - * |[1] |SUSPEND |Suspend Status (Read Only) - * | | |0 = Bus no suspend. - * | | |1 = Bus idle more than 3ms, either cable is plugged-out or host is sleeping. - * |[2] |RESUME |Resume Status (Read Only) - * | | |0 = No bus resume. - * | | |1 = Resume from suspend. - * |[3] |TOUT |Time-out Status (Read Only) - * | | |0 = No time-out. - * | | |1 = No Bus response more than 18 bits time. - * |[4] |PHYEN |PHY Transceiver Function Enable Bit - * | | |0 = PHY transceiver function Disabled. - * | | |1 = PHY transceiver function Enabled. - * |[5] |RWAKEUP |Remote Wake-up - * | | |0 = Release the USB bus from K state. - * | | |1 = Force USB bus to K (USB_D+ low, USB_D-: high) state, used for remote wake-up. - * |[7] |USBEN |USB Controller Enable Bit - * | | |0 = USB Controller Disabled. - * | | |1 = USB Controller Enabled. - * |[8] |DPPUEN |Pull-up Resistor on USB_DP Enable Bit - * | | |0 = Pull-up resistor in USB_D+ bus Disabled. - * | | |1 = Pull-up resistor in USB_D+ bus Active. - * |[10] |BYTEM |CPU Access USB SRAM Size Mode Selection - * | | |0 = Word mode: The size of the transfer from CPU to USB SRAM can be Word only. - * | | |1 = Byte mode: The size of the transfer from CPU to USB SRAM can be Byte only. - * |[11] |LPMACK |LPM Token Acknowledge Enable Bit - * | | |The NYET/ACK will be returned only on a successful LPM transaction if no errors in both the EXT token and the LPM token and a valid bLinkState = 0001 (L1) is received, else ERROR and STALL will be returned automatically, respectively. - * | | |0= The valid LPM Token will be NYET. - * | | |1= The valid LPM Token will be ACK. - * |[12] |L1SUSPEND |LPM L1 Suspend (Read Only) - * | | |0 = Bus no L1 state suspend. - * | | |1 = This bit is set by the hardware when LPM command to enter the L1 state is successfully received and acknowledged. - * |[13] |L1RESUME |LPM L1 Resume (Read Only) - * | | |0 = Bus no LPM L1 state resume. - * | | |1 = LPM L1 state resume from LPM L1 state suspend. - * @var USBD_T::VBUSDET - * Offset: 0x14 USB Device VBUS Detection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDET |Device VBUS Detection - * | | |0 = Controller is not attached to the USB host. - * | | |1 = Controller is attached to the USB host. - * @var USBD_T::STBUFSEG - * Offset: 0x18 SETUP Token Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |STBUFSEG |SETUP Token Buffer Segmentation - * | | |It is used to indicate the offset address for the SETUP token with the USB Device SRAM starting address The effective starting address is - * | | |USBD_SRAM address + {STBUFSEG, 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Note: It is used for SETUP token only. - * @var USBD_T::EPSTS0 - * Offset: 0x20 USB Device Endpoint Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPSTS0 |Endpoint 0 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[7:4] |EPSTS1 |Endpoint 1 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[11:8] |EPSTS2 |Endpoint 2 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[15:12] |EPSTS3 |Endpoint 3 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[19:16] |EPSTS4 |Endpoint 4 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[23:20] |EPSTS5 |Endpoint 5 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[27:24] |EPSTS6 |Endpoint 6 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[31:28] |EPSTS7 |Endpoint 7 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * @var USBD_T::EPSTS1 - * Offset: 0x24 USB Device Endpoint Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPSTS8 |Endpoint 8 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[7:4] |EPSTS9 |Endpoint 9 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[11:8] |EPSTS10 |Endpoint 10 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[15:12] |EPSTS11 |Endpoint 11 Status - * | | |These bits are used to indicate the current status of this endpoint. - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * @var USBD_T::LPMATTR - * Offset: 0x88 USB LPM Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |LPMLINKSTS|LPM Link State - * | | |These bits contain the bLinkState received with last ACK LPM Token. - * | | |0000 = Reserve. - * | | |0001 = L1 (Sleep). - * | | |0010 - 1111 = Reserve. - * |[7:4] |LPMBESL |LPM Best Effort Service Latency - * | | |These bits contain the BESL value received with last ACK LPM Token. - * | | |0000 = 125us. - * | | |0001 = 150us. - * | | |0010 = 200us. - * | | |0011 = 300us. - * | | |0100 = 400us. - * | | |0101 = 500us. - * | | |0110 = 1000us. - * | | |0111 = 2000us. - * | | |1000 = 3000us. - * | | |1001 = 4000us. - * | | |1010 = 5000us. - * | | |1011 = 6000us. - * | | |1100 = 7000us. - * | | |1101 = 8000us. - * | | |1110 = 9000us. - * | | |1111 = 10000us. - * |[8] |LPMRWAKUP |LPM Remote Wakeup - * | | |This bit contains the bRemoteWake value received with last ACK LPM Token. - * @var USBD_T::FN - * Offset: 0x8C USB Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FN |Frame Number - * | | |These bits contain the 11-bits frame number in the last received SOF packet. - * @var USBD_T::SE0 - * Offset: 0x90 USB Device Drive SE0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SE0 |Drive Single Ended Zero in USB Bus - * | | |The Single Ended Zero (SE0) is when both lines (USB_D+ and USB_D-) are being pulled low. - * | | |0 = Normal operation. - * | | |1 = Force USB PHY transceiver to drive SE0. - */ - __IO uint32_t INTEN; /*!< [0x0000] USB Device Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0004] USB Device Interrupt Event Status Register */ - __IO uint32_t FADDR; /*!< [0x0008] USB Device Function Address Register */ - __I uint32_t EPSTS; /*!< [0x000c] USB Device Endpoint Status Register */ - __IO uint32_t ATTR; /*!< [0x0010] USB Device Bus Status and Attribution Register */ - __I uint32_t VBUSDET; /*!< [0x0014] USB Device VBUS Detection Register */ - __IO uint32_t STBUFSEG; /*!< [0x0018] SETUP Token Buffer Segmentation Register */ - __I uint32_t RESERVE0[1]; - __I uint32_t EPSTS0; /*!< [0x0020] USB Device Endpoint Status Register 0 */ - __I uint32_t EPSTS1; /*!< [0x0024] USB Device Endpoint Status Register 1 */ - __I uint32_t RESERVE1[24]; - __I uint32_t LPMATTR; /*!< [0x0088] USB LPM Attribution Register */ - __I uint32_t FN; /*!< [0x008c] USB Frame Number Register */ - __IO uint32_t SE0; /*!< [0x0090] USB Device Drive SE0 Control Register */ - __I uint32_t RESERVE2[283]; - USBD_EP_T EP[12]; /*!< [0x500~0x5bc] USB End Point 0 ~ 11 Configuration Register */ - -} USBD_T; - -/** - @addtogroup USBD_CONST USBD Bit Field Definition - Constant Definitions for USBD Controller - @{ -*/ - -#define USBD_INTEN_BUSIEN_Pos (0) /*!< USBD_T::INTEN: BUSIEN Position */ -#define USBD_INTEN_BUSIEN_Msk (0x1ul << USBD_INTEN_BUSIEN_Pos) /*!< USBD_T::INTEN: BUSIEN Mask */ - -#define USBD_INTEN_USBIEN_Pos (1) /*!< USBD_T::INTEN: USBIEN Position */ -#define USBD_INTEN_USBIEN_Msk (0x1ul << USBD_INTEN_USBIEN_Pos) /*!< USBD_T::INTEN: USBIEN Mask */ - -#define USBD_INTEN_VBDETIEN_Pos (2) /*!< USBD_T::INTEN: VBDETIEN Position */ -#define USBD_INTEN_VBDETIEN_Msk (0x1ul << USBD_INTEN_VBDETIEN_Pos) /*!< USBD_T::INTEN: VBDETIEN Mask */ - -#define USBD_INTEN_NEVWKIEN_Pos (3) /*!< USBD_T::INTEN: NEVWKIEN Position */ -#define USBD_INTEN_NEVWKIEN_Msk (0x1ul << USBD_INTEN_NEVWKIEN_Pos) /*!< USBD_T::INTEN: NEVWKIEN Mask */ - -#define USBD_INTEN_SOFIEN_Pos (4) /*!< USBD_T::INTEN: SOFIEN Position */ -#define USBD_INTEN_SOFIEN_Msk (0x1ul << USBD_INTEN_SOFIEN_Pos) /*!< USBD_T::INTEN: SOFIEN Mask */ - -#define USBD_INTEN_WKEN_Pos (8) /*!< USBD_T::INTEN: WKEN Position */ -#define USBD_INTEN_WKEN_Msk (0x1ul << USBD_INTEN_WKEN_Pos) /*!< USBD_T::INTEN: WKEN Mask */ - -#define USBD_INTEN_INNAKEN_Pos (15) /*!< USBD_T::INTEN: INNAKEN Position */ -#define USBD_INTEN_INNAKEN_Msk (0x1ul << USBD_INTEN_INNAKEN_Pos) /*!< USBD_T::INTEN: INNAKEN Mask */ - -#define USBD_INTSTS_BUSIF_Pos (0) /*!< USBD_T::INTSTS: BUSIF Position */ -#define USBD_INTSTS_BUSIF_Msk (0x1ul << USBD_INTSTS_BUSIF_Pos) /*!< USBD_T::INTSTS: BUSIF Mask */ - -#define USBD_INTSTS_USBIF_Pos (1) /*!< USBD_T::INTSTS: USBIF Position */ -#define USBD_INTSTS_USBIF_Msk (0x1ul << USBD_INTSTS_USBIF_Pos) /*!< USBD_T::INTSTS: USBIF Mask */ - -#define USBD_INTSTS_VBDETIF_Pos (2) /*!< USBD_T::INTSTS: VBDETIF Position */ -#define USBD_INTSTS_VBDETIF_Msk (0x1ul << USBD_INTSTS_VBDETIF_Pos) /*!< USBD_T::INTSTS: VBDETIF Mask */ - -#define USBD_INTSTS_NEVWKIF_Pos (3) /*!< USBD_T::INTSTS: NEVWKIF Position */ -#define USBD_INTSTS_NEVWKIF_Msk (0x1ul << USBD_INTSTS_NEVWKIF_Pos) /*!< USBD_T::INTSTS: NEVWKIF Mask */ - -#define USBD_INTSTS_SOFIF_Pos (4) /*!< USBD_T::INTSTS: SOFIF Position */ -#define USBD_INTSTS_SOFIF_Msk (0x1ul << USBD_INTSTS_SOFIF_Pos) /*!< USBD_T::INTSTS: SOFIF Mask */ - -#define USBD_INTSTS_EPEVT0_Pos (16) /*!< USBD_T::INTSTS: EPEVT0 Position */ -#define USBD_INTSTS_EPEVT0_Msk (0x1ul << USBD_INTSTS_EPEVT0_Pos) /*!< USBD_T::INTSTS: EPEVT0 Mask */ - -#define USBD_INTSTS_EPEVT1_Pos (17) /*!< USBD_T::INTSTS: EPEVT1 Position */ -#define USBD_INTSTS_EPEVT1_Msk (0x1ul << USBD_INTSTS_EPEVT1_Pos) /*!< USBD_T::INTSTS: EPEVT1 Mask */ - -#define USBD_INTSTS_EPEVT2_Pos (18) /*!< USBD_T::INTSTS: EPEVT2 Position */ -#define USBD_INTSTS_EPEVT2_Msk (0x1ul << USBD_INTSTS_EPEVT2_Pos) /*!< USBD_T::INTSTS: EPEVT2 Mask */ - -#define USBD_INTSTS_EPEVT3_Pos (19) /*!< USBD_T::INTSTS: EPEVT3 Position */ -#define USBD_INTSTS_EPEVT3_Msk (0x1ul << USBD_INTSTS_EPEVT3_Pos) /*!< USBD_T::INTSTS: EPEVT3 Mask */ - -#define USBD_INTSTS_EPEVT4_Pos (20) /*!< USBD_T::INTSTS: EPEVT4 Position */ -#define USBD_INTSTS_EPEVT4_Msk (0x1ul << USBD_INTSTS_EPEVT4_Pos) /*!< USBD_T::INTSTS: EPEVT4 Mask */ - -#define USBD_INTSTS_EPEVT5_Pos (21) /*!< USBD_T::INTSTS: EPEVT5 Position */ -#define USBD_INTSTS_EPEVT5_Msk (0x1ul << USBD_INTSTS_EPEVT5_Pos) /*!< USBD_T::INTSTS: EPEVT5 Mask */ - -#define USBD_INTSTS_EPEVT6_Pos (22) /*!< USBD_T::INTSTS: EPEVT6 Position */ -#define USBD_INTSTS_EPEVT6_Msk (0x1ul << USBD_INTSTS_EPEVT6_Pos) /*!< USBD_T::INTSTS: EPEVT6 Mask */ - -#define USBD_INTSTS_EPEVT7_Pos (23) /*!< USBD_T::INTSTS: EPEVT7 Position */ -#define USBD_INTSTS_EPEVT7_Msk (0x1ul << USBD_INTSTS_EPEVT7_Pos) /*!< USBD_T::INTSTS: EPEVT7 Mask */ - -#define USBD_INTSTS_EPEVT8_Pos (24) /*!< USBD_T::INTSTS: EPEVT8 Position */ -#define USBD_INTSTS_EPEVT8_Msk (0x1ul << USBD_INTSTS_EPEVT8_Pos) /*!< USBD_T::INTSTS: EPEVT8 Mask */ - -#define USBD_INTSTS_EPEVT9_Pos (25) /*!< USBD_T::INTSTS: EPEVT9 Position */ -#define USBD_INTSTS_EPEVT9_Msk (0x1ul << USBD_INTSTS_EPEVT9_Pos) /*!< USBD_T::INTSTS: EPEVT9 Mask */ - -#define USBD_INTSTS_EPEVT10_Pos (26) /*!< USBD_T::INTSTS: EPEVT10 Position */ -#define USBD_INTSTS_EPEVT10_Msk (0x1ul << USBD_INTSTS_EPEVT10_Pos) /*!< USBD_T::INTSTS: EPEVT10 Mask */ - -#define USBD_INTSTS_EPEVT11_Pos (27) /*!< USBD_T::INTSTS: EPEVT11 Position */ -#define USBD_INTSTS_EPEVT11_Msk (0x1ul << USBD_INTSTS_EPEVT11_Pos) /*!< USBD_T::INTSTS: EPEVT11 Mask */ - -#define USBD_INTSTS_SETUP_Pos (31) /*!< USBD_T::INTSTS: SETUP Position */ -#define USBD_INTSTS_SETUP_Msk (0x1ul << USBD_INTSTS_SETUP_Pos) /*!< USBD_T::INTSTS: SETUP Mask */ - -#define USBD_FADDR_FADDR_Pos (0) /*!< USBD_T::FADDR: FADDR Position */ -#define USBD_FADDR_FADDR_Msk (0x7ful << USBD_FADDR_FADDR_Pos) /*!< USBD_T::FADDR: FADDR Mask */ - -#define USBD_EPSTS_OV_Pos (7) /*!< USBD_T::EPSTS: OV Position */ -#define USBD_EPSTS_OV_Msk (0x1ul << USBD_EPSTS_OV_Pos) /*!< USBD_T::EPSTS: OV Mask */ - -#define USBD_ATTR_USBRST_Pos (0) /*!< USBD_T::ATTR: USBRST Position */ -#define USBD_ATTR_USBRST_Msk (0x1ul << USBD_ATTR_USBRST_Pos) /*!< USBD_T::ATTR: USBRST Mask */ - -#define USBD_ATTR_SUSPEND_Pos (1) /*!< USBD_T::ATTR: SUSPEND Position */ -#define USBD_ATTR_SUSPEND_Msk (0x1ul << USBD_ATTR_SUSPEND_Pos) /*!< USBD_T::ATTR: SUSPEND Mask */ - -#define USBD_ATTR_RESUME_Pos (2) /*!< USBD_T::ATTR: RESUME Position */ -#define USBD_ATTR_RESUME_Msk (0x1ul << USBD_ATTR_RESUME_Pos) /*!< USBD_T::ATTR: RESUME Mask */ - -#define USBD_ATTR_TOUT_Pos (3) /*!< USBD_T::ATTR: TOUT Position */ -#define USBD_ATTR_TOUT_Msk (0x1ul << USBD_ATTR_TOUT_Pos) /*!< USBD_T::ATTR: TOUT Mask */ - -#define USBD_ATTR_PHYEN_Pos (4) /*!< USBD_T::ATTR: PHYEN Position */ -#define USBD_ATTR_PHYEN_Msk (0x1ul << USBD_ATTR_PHYEN_Pos) /*!< USBD_T::ATTR: PHYEN Mask */ - -#define USBD_ATTR_RWAKEUP_Pos (5) /*!< USBD_T::ATTR: RWAKEUP Position */ -#define USBD_ATTR_RWAKEUP_Msk (0x1ul << USBD_ATTR_RWAKEUP_Pos) /*!< USBD_T::ATTR: RWAKEUP Mask */ - -#define USBD_ATTR_USBEN_Pos (7) /*!< USBD_T::ATTR: USBEN Position */ -#define USBD_ATTR_USBEN_Msk (0x1ul << USBD_ATTR_USBEN_Pos) /*!< USBD_T::ATTR: USBEN Mask */ - -#define USBD_ATTR_DPPUEN_Pos (8) /*!< USBD_T::ATTR: DPPUEN Position */ -#define USBD_ATTR_DPPUEN_Msk (0x1ul << USBD_ATTR_DPPUEN_Pos) /*!< USBD_T::ATTR: DPPUEN Mask */ - -#define USBD_ATTR_BYTEM_Pos (10) /*!< USBD_T::ATTR: BYTEM Position */ -#define USBD_ATTR_BYTEM_Msk (0x1ul << USBD_ATTR_BYTEM_Pos) /*!< USBD_T::ATTR: BYTEM Mask */ - -#define USBD_ATTR_LPMACK_Pos (11) /*!< USBD_T::ATTR: LPMACK Position */ -#define USBD_ATTR_LPMACK_Msk (0x1ul << USBD_ATTR_LPMACK_Pos) /*!< USBD_T::ATTR: LPMACK Mask */ - -#define USBD_ATTR_L1SUSPEND_Pos (12) /*!< USBD_T::ATTR: L1SUSPEND Position */ -#define USBD_ATTR_L1SUSPEND_Msk (0x1ul << USBD_ATTR_L1SUSPEND_Pos) /*!< USBD_T::ATTR: L1SUSPEND Mask */ - -#define USBD_ATTR_L1RESUME_Pos (13) /*!< USBD_T::ATTR: L1RESUME Position */ -#define USBD_ATTR_L1RESUME_Msk (0x1ul << USBD_ATTR_L1RESUME_Pos) /*!< USBD_T::ATTR: L1RESUME Mask */ - -#define USBD_VBUSDET_VBUSDET_Pos (0) /*!< USBD_T::VBUSDET: VBUSDET Position */ -#define USBD_VBUSDET_VBUSDET_Msk (0x1ul << USBD_VBUSDET_VBUSDET_Pos) /*!< USBD_T::VBUSDET: VBUSDET Mask */ - -#define USBD_STBUFSEG_STBUFSEG_Pos (3) /*!< USBD_T::STBUFSEG: STBUFSEG Position */ -#define USBD_STBUFSEG_STBUFSEG_Msk (0x3ful << USBD_STBUFSEG_STBUFSEG_Pos) /*!< USBD_T::STBUFSEG: STBUFSEG Mask */ - -#define USBD_EPSTS0_EPSTS0_Pos (0) /*!< USBD_T::EPSTS0: EPSTS0 Position */ -#define USBD_EPSTS0_EPSTS0_Msk (0xful << USBD_EPSTS0_EPSTS0_Pos) /*!< USBD_T::EPSTS0: EPSTS0 Mask */ - -#define USBD_EPSTS0_EPSTS1_Pos (4) /*!< USBD_T::EPSTS0: EPSTS1 Position */ -#define USBD_EPSTS0_EPSTS1_Msk (0xful << USBD_EPSTS0_EPSTS1_Pos) /*!< USBD_T::EPSTS0: EPSTS1 Mask */ - -#define USBD_EPSTS0_EPSTS2_Pos (8) /*!< USBD_T::EPSTS0: EPSTS2 Position */ -#define USBD_EPSTS0_EPSTS2_Msk (0xful << USBD_EPSTS0_EPSTS2_Pos) /*!< USBD_T::EPSTS0: EPSTS2 Mask */ - -#define USBD_EPSTS0_EPSTS3_Pos (12) /*!< USBD_T::EPSTS0: EPSTS3 Position */ -#define USBD_EPSTS0_EPSTS3_Msk (0xful << USBD_EPSTS0_EPSTS3_Pos) /*!< USBD_T::EPSTS0: EPSTS3 Mask */ - -#define USBD_EPSTS0_EPSTS4_Pos (16) /*!< USBD_T::EPSTS0: EPSTS4 Position */ -#define USBD_EPSTS0_EPSTS4_Msk (0xful << USBD_EPSTS0_EPSTS4_Pos) /*!< USBD_T::EPSTS0: EPSTS4 Mask */ - -#define USBD_EPSTS0_EPSTS5_Pos (20) /*!< USBD_T::EPSTS0: EPSTS5 Position */ -#define USBD_EPSTS0_EPSTS5_Msk (0xful << USBD_EPSTS0_EPSTS5_Pos) /*!< USBD_T::EPSTS0: EPSTS5 Mask */ - -#define USBD_EPSTS0_EPSTS6_Pos (24) /*!< USBD_T::EPSTS0: EPSTS6 Position */ -#define USBD_EPSTS0_EPSTS6_Msk (0xful << USBD_EPSTS0_EPSTS6_Pos) /*!< USBD_T::EPSTS0: EPSTS6 Mask */ - -#define USBD_EPSTS0_EPSTS7_Pos (28) /*!< USBD_T::EPSTS0: EPSTS7 Position */ -#define USBD_EPSTS0_EPSTS7_Msk (0xful << USBD_EPSTS0_EPSTS7_Pos) /*!< USBD_T::EPSTS0: EPSTS7 Mask */ - -#define USBD_EPSTS1_EPSTS8_Pos (0) /*!< USBD_T::EPSTS1: EPSTS8 Position */ -#define USBD_EPSTS1_EPSTS8_Msk (0xful << USBD_EPSTS1_EPSTS8_Pos) /*!< USBD_T::EPSTS1: EPSTS8 Mask */ - -#define USBD_EPSTS1_EPSTS9_Pos (4) /*!< USBD_T::EPSTS1: EPSTS9 Position */ -#define USBD_EPSTS1_EPSTS9_Msk (0xful << USBD_EPSTS1_EPSTS9_Pos) /*!< USBD_T::EPSTS1: EPSTS9 Mask */ - -#define USBD_EPSTS1_EPSTS10_Pos (8) /*!< USBD_T::EPSTS1: EPSTS10 Position */ -#define USBD_EPSTS1_EPSTS10_Msk (0xful << USBD_EPSTS1_EPSTS10_Pos) /*!< USBD_T::EPSTS1: EPSTS10 Mask */ - -#define USBD_EPSTS1_EPSTS11_Pos (12) /*!< USBD_T::EPSTS1: EPSTS11 Position */ -#define USBD_EPSTS1_EPSTS11_Msk (0xful << USBD_EPSTS1_EPSTS11_Pos) /*!< USBD_T::EPSTS1: EPSTS11 Mask */ - -#define USBD_LPMATTR_LPMLINKSTS_Pos (0) /*!< USBD_T::LPMATTR: LPMLINKSTS Position */ -#define USBD_LPMATTR_LPMLINKSTS_Msk (0xful << USBD_LPMATTR_LPMLINKSTS_Pos) /*!< USBD_T::LPMATTR: LPMLINKSTS Mask */ - -#define USBD_LPMATTR_LPMBESL_Pos (4) /*!< USBD_T::LPMATTR: LPMBESL Position */ -#define USBD_LPMATTR_LPMBESL_Msk (0xful << USBD_LPMATTR_LPMBESL_Pos) /*!< USBD_T::LPMATTR: LPMBESL Mask */ - -#define USBD_LPMATTR_LPMRWAKUP_Pos (8) /*!< USBD_T::LPMATTR: LPMRWAKUP Position */ -#define USBD_LPMATTR_LPMRWAKUP_Msk (0x1ul << USBD_LPMATTR_LPMRWAKUP_Pos) /*!< USBD_T::LPMATTR: LPMRWAKUP Mask */ - -#define USBD_FN_FN_Pos (0) /*!< USBD_T::FN: FN Position */ -#define USBD_FN_FN_Msk (0x7fful << USBD_FN_FN_Pos) /*!< USBD_T::FN: FN Mask */ - -#define USBD_SE0_SE0_Pos (0) /*!< USBD_T::SE0: SE0 Position */ -#define USBD_SE0_SE0_Msk (0x1ul << USBD_SE0_SE0_Pos) /*!< USBD_T::SE0: SE0 Mask */ - -#define USBD_BUFSEG_BUFSEG_Pos (3) /*!< USBD_EP_T::BUFSEG: BUFSEG Position */ -#define USBD_BUFSEG_BUFSEG_Msk (0x3ful << USBD_BUFSEG_BUFSEG_Pos) /*!< USBD_EP_T::BUFSEG: BUFSEG Mask */ - -#define USBD_MXPLD_MXPLD_Pos (0) /*!< USBD_EP_T::MXPLD: MXPLD Position */ -#define USBD_MXPLD_MXPLD_Msk (0x1fful << USBD_MXPLD_MXPLD_Pos) /*!< USBD_EP_T::MXPLD: MXPLD Mask */ - -#define USBD_CFG_EPNUM_Pos (0) /*!< USBD_EP_T::CFG: EPNUM Position */ -#define USBD_CFG_EPNUM_Msk (0xful << USBD_CFG_EPNUM_Pos) /*!< USBD_EP_T::CFG: EPNUM Mask */ - -#define USBD_CFG_ISOCH_Pos (4) /*!< USBD_EP_T::CFG: ISOCH Position */ -#define USBD_CFG_ISOCH_Msk (0x1ul << USBD_CFG_ISOCH_Pos) /*!< USBD_EP_T::CFG: ISOCH Mask */ - -#define USBD_CFG_STATE_Pos (5) /*!< USBD_EP_T::CFG: STATE Position */ -#define USBD_CFG_STATE_Msk (0x3ul << USBD_CFG_STATE_Pos) /*!< USBD_EP_T::CFG: STATE Mask */ - -#define USBD_CFG_DSQSYNC_Pos (7) /*!< USBD_EP_T::CFG: DSQSYNC Position */ -#define USBD_CFG_DSQSYNC_Msk (0x1ul << USBD_CFG_DSQSYNC_Pos) /*!< USBD_EP_T::CFG: DSQSYNC Mask */ - -#define USBD_CFG_CSTALL_Pos (9) /*!< USBD_EP_T::CFG: CSTALL Position */ -#define USBD_CFG_CSTALL_Msk (0x1ul << USBD_CFG_CSTALL_Pos) /*!< USBD_EP_T::CFG: CSTALL Mask */ - -#define USBD_CFG_DBTGACTIVE_Pos (10) /*!< USBD_EP_T::CFG: DBTGACTIVE Position */ -#define USBD_CFG_DBTGACTIVE_Msk (0x1ul << USBD_CFG_DBTGACTIVE_Pos) /*!< USBD_EP_T::CFG: DBTGACTIVE Mask */ - -#define USBD_CFG_DBEN_Pos (11) /*!< USBD_EP_T::CFG: DBEN Position */ -#define USBD_CFG_DBEN_Msk (0x1ul << USBD_CFG_DBEN_Pos) /*!< USBD_EP_T::CFG: DBEN Mask */ - -#define USBD_CFGP_CLRRDY_Pos (0) /*!< USBD_EP_T::CFGP: CLRRDY Position */ -#define USBD_CFGP_CLRRDY_Msk (0x1ul << USBD_CFGP_CLRRDY_Pos) /*!< USBD_EP_T::CFGP: CLRRDY Mask */ - -#define USBD_CFGP_SSTALL_Pos (1) /*!< USBD_EP_T::CFGP: SSTALL Position */ -#define USBD_CFGP_SSTALL_Msk (0x1ul << USBD_CFGP_SSTALL_Pos) /*!< USBD_EP_T::CFGP: SSTALL Mask */ - -/**@}*/ /* USBD_CONST */ -/**@}*/ /* end of USBD register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __USBD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbh_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbh_reg.h deleted file mode 100644 index 38df8f48b5b..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/usbh_reg.h +++ /dev/null @@ -1,799 +0,0 @@ -/**************************************************************************//** - * @file usbh_reg.h - * @version V1.00 - * @brief USBH register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBH_REG_H__ -#define __USBH_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- USB Host Controller -------------------------*/ -/** - @addtogroup USBH USB Host Controller(USBH) - Memory Mapped Structure for USBH Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var USBH_T::HcRevision - * Offset: 0x00 Host Controller Revision Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REV |Revision Number - * | | |Indicates the Open HCI Specification revision number implemented by the Hardware - * | | |Host Controller supports 1.1 specification. - * | | |(X.Y = XYh). - * @var USBH_T::HcControl - * Offset: 0x04 Host Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CBSR |Control Bulk Service Ratio - * | | |This specifies the service ratio between Control and Bulk EDs - * | | |Before processing any of the non-periodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs - * | | |The internal count will be retained when crossing the frame boundary - * | | |In case of reset, HCD is responsible for restoring this value. - * | | |00 = Number of Control EDs over Bulk EDs served is 1:1. - * | | |01 = Number of Control EDs over Bulk EDs served is 2:1. - * | | |10 = Number of Control EDs over Bulk EDs served is 3:1. - * | | |11 = Number of Control EDs over Bulk EDs served is 4:1. - * |[2] |PLE |Periodic List Enable Bit - * | | |When set, this bit enables processing of the Periodic (interrupt and isochronous) list - * | | |The Host Controller checks this bit prior to attempting any periodic transfers in a frame. - * | | |0 = Processing of the Periodic (Interrupt and Isochronous) list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Periodic (Interrupt and Isochronous) list in the next frame Enabled. - * | | |Note: To enable the processing of the Isochronous list, user has to set both PLE and IE (HcControl[3]) high. - * |[3] |IE |Isochronous List Enable Bit - * | | |Both IE and PLE (HcControl[2]) high enables Host Controller to process the Isochronous list - * | | |Either IE or PLE (HcControl[2]) is low disables Host Controller to process the Isochronous list. - * | | |0 = Processing of the Isochronous list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Isochronous list in the next frame Enabled, if the PLE (HcControl[2]) is high, too. - * |[4] |CLE |Control List Enable Bit - * | | |0 = Processing of the Control list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Control list in the next frame Enabled. - * |[5] |BLE |Bulk List Enable Bit - * | | |0 = Processing of the Bulk list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Bulk list in the next frame Enabled. - * |[7:6] |HCFS |Host Controller Functional State - * | | |This field sets the Host Controller state - * | | |The Controller may force a state change from USBSUSPEND to USBRESUME after detecting resume signaling from a downstream port - * | | |States are: - * | | |00 = USBRESET. - * | | |01 = USBRESUME. - * | | |10 = USBOPERATIONAL. - * | | |11 = USBSUSPEND. - * @var USBH_T::HcCommandStatus - * Offset: 0x08 Host Controller Command Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HCR |Host Controller Reset - * | | |This bit is set to initiate the software reset of Host Controller - * | | |This bit is cleared by the Host Controller, upon completed of the reset operation. - * | | |This bit, when set, didn't reset the Root Hub and no subsequent reset signaling be asserted to its downstream ports. - * | | |0 = Host Controller is not in software reset state. - * | | |1 = Host Controller is in software reset state. - * |[1] |CLF |Control List Filled - * | | |Set high to indicate there is an active TD on the Control List - * | | |It may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Control List. - * | | |0 = No active TD found or Host Controller begins to process the head of the Control list. - * | | |1 = An active TD added or found on the Control list. - * |[2] |BLF |Bulk List Filled - * | | |Set high to indicate there is an active TD on the Bulk list - * | | |This bit may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Bulk list. - * | | |0 = No active TD found or Host Controller begins to process the head of the Bulk list. - * | | |1 = An active TD added or found on the Bulk list. - * |[17:16] |SOC |Schedule Overrun Count (Read-Only) - * | | |These bits are incremented on each scheduling overrun error - * | | |It is initialized to 00b and wraps around at 11b - * | | |This will be incremented when a scheduling overrun is detected even if SO (HcInterruptStatus[0]) has already been set. - * @var USBH_T::HcInterruptStatus - * Offset: 0x0C Host Controller Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun - * | | |Set when the List Processor determines a Schedule Overrun has occurred. - * | | |0 = Schedule Overrun didn't occur. - * | | |1 = Schedule Overrun has occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WDH |Write Back Done Head - * | | |Set after the Host Controller has written HcDoneHead to HccaDoneHead - * | | |Further updates of the HccaDoneHead will not occur until this bit has been cleared. - * | | |0 = Host Controller didn't update HccaDoneHead. - * | | |1 = Host Controller has written HcDoneHead to HccaDoneHead. - * | | |Note: This bit is cleared by writing 1 to it. - * |[2] |SF |Start of Frame - * | | |Set when the Frame Management functional block signals a u2018Start of Frame' event - * | | |Host Control generates a SOF token at the same time. - * | | |0 = Not the start of a frame. - * | | |1 = Indicate the start of a frame and Host Controller generates a SOF token. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |RD |Resume Detected - * | | |Set when Host Controller detects resume signaling on a downstream port. - * | | |0 = No resume signaling detected on a downstream port. - * | | |1 = Resume signaling detected on a downstream port. - * | | |Note: This bit is cleared by writing 1 to it. - * |[5] |FNO |Frame Number Overflow - * | | |This bit is set when bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |0 = The bit 15 of Frame Number didn't change. - * | | |1 = The bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |RHSC |Root Hub Status Change - * | | |This bit is set when the content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |0 = The content of HcRhStatus and the content of HcRhPortStatus register didn't change. - * | | |1 = The content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |Note: This bit is cleared by writing ‘1Fh’ to HcRhPortStatus1[20:16]. - * @var USBH_T::HcInterruptEnable - * Offset: 0x10 Host Controller Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Enable Bit - * | | |This bit is a global interrupt enable - * | | |A write of u20181' allows interrupts to be enabled via the specific enable bits listed above. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcInterruptDisable - * Offset: 0x14 Host Controller Interrupt Disable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Disable Bit - * | | |Global interrupt disable. Writing u20181' to disable all interrupts. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcHCCA - * Offset: 0x18 Host Controller Communication Area Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:8] |HCCA |Host Controller Communication Area - * | | |Pointer to indicate the base address of the Host Controller Communication Area (HCCA). - * @var USBH_T::HcPeriodCurrentED - * Offset: 0x1C Host Controller Period Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |PCED |Periodic Current ED - * | | |Pointer to indicate the physical address of the current Isochronous or Interrupt Endpoint Descriptor. - * @var USBH_T::HcControlHeadED - * Offset: 0x20 Host Controller Control ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CHED |Control Head ED - * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Control list. - * @var USBH_T::HcControlCurrentED - * Offset: 0x24 Host Controller Control Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CCED |Control Current Head ED - * | | |Pointer to indicate the physical address of the current Endpoint Descriptor of the Control list. - * @var USBH_T::HcBulkHeadED - * Offset: 0x28 Host Controller Bulk Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BHED |Bulk Head ED - * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Bulk list. - * @var USBH_T::HcBulkCurrentED - * Offset: 0x2C Host Controller Bulk Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BCED |Bulk Current Head ED - * | | |Pointer to indicate the physical address of the current endpoint of the Bulk list. - * @var USBH_T::HcDoneHead - * Offset: 0x30 Host Controller Done Head Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |DH |Done Head - * | | |Pointer to indicate the physical address of the last completed Transfer Descriptor that was added to the Done queue. - * @var USBH_T::HcFmInterval - * Offset: 0x34 Host Controller Frame Interval Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Interval - * | | |This field specifies the length of a frame as (bit times - 1) - * | | |For 12,000 bit times in a frame, a value of 11,999 is stored here. - * |[29:16] |FSMPS |FS Largest Data Packet - * | | |This field specifies a value that is loaded into the Largest Data Packet Counter at the beginning of each frame. - * |[31] |FIT |Frame Interval Toggle - * | | |This bit is toggled by Host Controller Driver when it loads a new value into FI (HcFmInterval[13:0]). - * | | |0 = Host Controller Driver didn't load new value into FI (HcFmInterval[13:0]). - * | | |1 = Host Controller Driver loads a new value into FI (HcFmInterval[13:0]). - * @var USBH_T::HcFmRemaining - * Offset: 0x38 Host Controller Frame Remaining Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FR |Frame Remaining - * | | |When the Host Controller is in the USBOPERATIONAL state, this 14-bit field decrements each 12 MHz clock period - * | | |When the count reaches 0, (end of frame) the counter reloads with Frame Interval - * | | |In addition, the counter loads when the Host Controller transitions into USBOPERATIONAL. - * |[31] |FRT |Frame Remaining Toggle - * | | |This bit is loaded from the FIT (HcFmInterval[31]) whenever FR (HcFmRemaining[13:0]) reaches 0. - * @var USBH_T::HcFmNumber - * Offset: 0x3C Host Controller Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FN |Frame Number - * | | |This 16-bit incrementing counter field is incremented coincident with the re-load of FR (HcFmRemaining[13:0]) - * | | |The count rolls over from u2018FFFFh' to u20180h.' - * @var USBH_T::HcPeriodicStart - * Offset: 0x40 Host Controller Periodic Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PS |Periodic Start - * | | |This field contains a value used by the List Processor to determine where in a frame the Periodic List processing must begin. - * @var USBH_T::HcLSThreshold - * Offset: 0x44 Host Controller Low-speed Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |LST |Low-speed Threshold - * | | |This field contains a value which is compared to the FR (HcFmRemaining[13:0]) field prior to initiating a Low-speed transaction - * | | |The transaction is started only if FR (HcFmRemaining[13:0]) >= this field - * | | |The value is calculated by Host Controller Driver with the consideration of transmission and setup overhead. - * @var USBH_T::HcRhDescriptorA - * Offset: 0x48 Host Controller Root Hub Descriptor A Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |NDP |Number Downstream Ports - * | | |USB host control supports two downstream ports and only one port is available in this series of chip. - * | | |Note: NDP = 1 in this series of chip. - * |[8] |PSM |Power Switching Mode - * | | |This bit is used to specify how the power switching of the Root Hub ports is controlled. - * | | |0 = Global switching. - * | | |1 = Individual switching. - * |[11] |OCPM |Over Current Protection Mode - * | | |This bit describes how the over current status for the Root Hub ports reported - * | | |This bit is only valid when NOCP (HcRhDescriptorA[12]) is cleared. - * | | |0 = Global over current. - * | | |1 = Individual over current. - * |[12] |NOCP |No Over Current Protection - * | | |This bit describes how the over current status for the Root Hub ports reported. - * | | |0 = Over current status is reported. - * | | |1 = Over current status is not reported. - * @var USBH_T::HcRhDescriptorB - * Offset: 0x4C Host Controller Root Hub Descriptor B Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |PPCM |Port Power Control Mask - * | | |Global power switching - * | | |This field is only valid if Power Switching Mode is set (individual port switching) - * | | |When set, the port only responds to individual port power switching commands (Set/Clear Port Power) - * | | |When cleared, the port only responds to global power switching commands (Set/Clear Global Power). - * | | |0 = Port power controlled by global power switching. - * | | |1 = Port power controlled by port power switching. - * | | |Note: PPCM[15:2] and PPCM[0] are reserved. - * @var USBH_T::HcRhStatus - * Offset: 0x50 Host Controller Root Hub Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPS |Clear Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to clear all ports' power. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear global power. - * |[1] |OCI |Over Current Indicator (Read-Only) - * | | |This bit reflects the state of the over current status pin - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) and OCPM (HcRhDescriptorA[11]) are cleared. - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[15] |DRWE |Device Remote Wakeup Enable Bit - * | | |This bit controls if port's Connect Status Change as a remote wake-up event. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * | | |Read Operation: - * | | |0 = Connect Status Change as a remote wake-up event Disabled. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * |[16] |LPSC |Set Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to enable power to all ports. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set global power. - * |[17] |OCIC |Over Current Indicator Change - * | | |This bit is set by hardware when a change has occurred in OCI (HcRhStatus[1]). - * | | |Write 1 to clear this bit to zero. - * | | |0 = OCI (HcRhStatus[1]) didn't change. - * | | |1 = OCI (HcRhStatus[1]) change. - * |[31] |CRWE |Clear Remote Wake-up Enable Bit - * | | |This bit is use to clear DRWE (HcRhStatus[15]). - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear DRWE (HcRhStatus[15]). - * @var USBH_T::HcRhPortStatus[2] - * Offset: 0x54 Host Controller Root Hub Port Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |Current Connect Status (Read) or Clear Port Enable (Write) - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port enable. - * | | |Read Operation: - * | | |0 = No device connected. - * | | |1 = Device connected. - * |[1] |PES |Port Enable Status (Read) or Set Port Enable (Write) - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port enable. - * | | |Read Operation: - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[2] |PSS |Port Suspend Status (Read) or Set Port Suspend (Write) - * | | |This bit indicates the port is suspended - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port suspend. - * | | |Read Operation: - * | | |0 = Port is not suspended. - * | | |1 = Port is selectively suspended. - * |[3] |POCI |Port Over Current Indicator (Read) or Clear Port Suspend (Write) - * | | |This bit reflects the state of the over current status pin dedicated to this port - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) is cleared and OCPM (HcRhDescriptorA[11]) is set. - * | | |This bit is also used to initiate the selective result sequence for the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port suspend. - * | | |Read Operation: - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[4] |PRS |Port Reset Status (Read) or Set Port Reset (Write) - * | | |This bit reflects the reset state of the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port reset. - * | | |Read Operation - * | | |0 = Port reset signal is not active. - * | | |1 = Port reset signal is active. - * |[8] |PPS |Port Power Status (Read) or Set Port Power (Write) - * | | |This bit reflects the power state of the port regardless of the power switching mode. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Port Power Enabled. - * | | |Read Operation: - * | | |0 = Port power is Disabled. - * | | |1 = Port power is Enabled. - * |[9] |LSDA |Low Speed Device Attached (Read) or Clear Port Power (Write) - * | | |This bit defines the speed (and bus idle) of the attached device - * | | |It is only valid when CCS (HcRhPortStatus[0]) is set. - * | | |This bit is also used to clear port power. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear PPS (HcRhPortStatus[8]). - * | | |Read Operation: - * | | |0 = Full Speed device. - * | | |1 = Low-speed device. - * |[16] |CSC |Connect Status Change - * | | |This bit indicates connect or disconnect event has been detected (CCS (HcRhPortStatus[0]) changed). - * | | |Write 1 to clear this bit to zero. - * | | |0 = No connect/disconnect event (CCS (HcRhPortStatus[0]) didn't change). - * | | |1 = Hardware detection of connect/disconnect event (CCS (HcRhPortStatus[0]) changed). - * |[17] |PESC |Port Enable Status Change - * | | |This bit indicates that the port has been disabled (PES (HcRhPortStatus[1]) cleared) due to a hardware event. - * | | |Write 1 to clear this bit to zero. - * | | |0 = PES (HcRhPortStatus[1]) didn't change. - * | | |1 = PES (HcRhPortStatus[1]) changed. - * |[18] |PSSC |Port Suspend Status Change - * | | |This bit indicates the completion of the selective resume sequence for the port. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port resume is not complete. - * | | |1 = Port resume complete. - * |[19] |OCIC |Port Over Current Indicator Change - * | | |This bit is set when POCI (HcRhPortStatus[3]) changes. - * | | |Write 1 to clear this bit to zero. - * | | |0 = POCI (HcRhPortStatus[3]) didn't change. - * | | |1 = POCI (HcRhPortStatus[3]) changes. - * |[20] |PRSC |Port Reset Status Change - * | | |This bit indicates that the port reset signal has completed. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port reset is not complete. - * | | |1 = Port reset is complete. - * @var USBH_T::HcPhyControl - * Offset: 0x200 Host Controller PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27] |STBYEN |USB Transceiver Standby Enable Bit - * | | |This bit controls if USB transceiver could enter the standby mode to reduce power consumption. - * | | |0 = The USB transceiver would never enter the standby mode. - * | | |1 = The USB transceiver will enter standby mode while port is in power off state (port power is inactive). - * @var USBH_T::HcMiscControl - * Offset: 0x204 Host Controller Miscellaneous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABORT |AHB Bus Error Response - * | | |This bit indicates there is an Error response received in AHB bus. - * | | |0 = No Error response received. - * | | |1 = Error response received. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |OCAL |over Current Active Low - * | | |This bit controls the polarity of over current flag from external power IC. - * | | |0 = Over current flag is high active. - * | | |1 = Over current flag is low active. - * |[16] |DPRT1 |Disable Port 1 - * | | |This bit controls if the connection between USB host controller and transceiver of port 1 is disabled - * | | |If the connection is disabled, the USB host controller will not recognize any event of USB bus. - * | | |Set this bit high, the transceiver of port 1 will also be forced into the standby mode no matter what USB host controller operation is. - * | | |0 = The connection between USB host controller and transceiver of port 1 Enabled. - * | | |1 = The connection between USB host controller and transceiver of port 1 Disabled and the transceiver of port 1 will also be forced into the standby mode. - */ - __I uint32_t HcRevision; /*!< [0x0000] Host Controller Revision Register */ - __IO uint32_t HcControl; /*!< [0x0004] Host Controller Control Register */ - __IO uint32_t HcCommandStatus; /*!< [0x0008] Host Controller Command Status Register */ - __IO uint32_t HcInterruptStatus; /*!< [0x000c] Host Controller Interrupt Status Register */ - __IO uint32_t HcInterruptEnable; /*!< [0x0010] Host Controller Interrupt Enable Register */ - __IO uint32_t HcInterruptDisable; /*!< [0x0014] Host Controller Interrupt Disable Register */ - __IO uint32_t HcHCCA; /*!< [0x0018] Host Controller Communication Area Register */ - __IO uint32_t HcPeriodCurrentED; /*!< [0x001c] Host Controller Period Current ED Register */ - __IO uint32_t HcControlHeadED; /*!< [0x0020] Host Controller Control Head ED Register */ - __IO uint32_t HcControlCurrentED; /*!< [0x0024] Host Controller Control Current ED Register */ - __IO uint32_t HcBulkHeadED; /*!< [0x0028] Host Controller Bulk Head ED Register */ - __IO uint32_t HcBulkCurrentED; /*!< [0x002c] Host Controller Bulk Current ED Register */ - __IO uint32_t HcDoneHead; /*!< [0x0030] Host Controller Done Head Register */ - __IO uint32_t HcFmInterval; /*!< [0x0034] Host Controller Frame Interval Register */ - __I uint32_t HcFmRemaining; /*!< [0x0038] Host Controller Frame Remaining Register */ - __I uint32_t HcFmNumber; /*!< [0x003c] Host Controller Frame Number Register */ - __IO uint32_t HcPeriodicStart; /*!< [0x0040] Host Controller Periodic Start Register */ - __IO uint32_t HcLSThreshold; /*!< [0x0044] Host Controller Low-speed Threshold Register */ - __IO uint32_t HcRhDescriptorA; /*!< [0x0048] Host Controller Root Hub Descriptor A Register */ - __IO uint32_t HcRhDescriptorB; /*!< [0x004c] Host Controller Root Hub Descriptor B Register */ - __IO uint32_t HcRhStatus; /*!< [0x0050] Host Controller Root Hub Status Register */ - __IO uint32_t HcRhPortStatus[2]; /*!< [0x0054] Host Controller Root Hub Port Status */ - __I uint32_t RESERVE0[105]; - __IO uint32_t HcPhyControl; /*!< [0x0200] Host Controller PHY Control Register */ - __IO uint32_t HcMiscControl; /*!< [0x0204] Host Controller Miscellaneous Control Register */ - -} USBH_T; - -/** - @addtogroup USBH_CONST USBH Bit Field Definition - Constant Definitions for USBH Controller - @{ -*/ - -#define USBH_HcRevision_REV_Pos (0) /*!< USBH_T::HcRevision: REV Position */ -#define USBH_HcRevision_REV_Msk (0xfful << USBH_HcRevision_REV_Pos) /*!< USBH_T::HcRevision: REV Mask */ - -#define USBH_HcControl_CBSR_Pos (0) /*!< USBH_T::HcControl: CBSR Position */ -#define USBH_HcControl_CBSR_Msk (0x3ul << USBH_HcControl_CBSR_Pos) /*!< USBH_T::HcControl: CBSR Mask */ - -#define USBH_HcControl_PLE_Pos (2) /*!< USBH_T::HcControl: PLE Position */ -#define USBH_HcControl_PLE_Msk (0x1ul << USBH_HcControl_PLE_Pos) /*!< USBH_T::HcControl: PLE Mask */ - -#define USBH_HcControl_IE_Pos (3) /*!< USBH_T::HcControl: IE Position */ -#define USBH_HcControl_IE_Msk (0x1ul << USBH_HcControl_IE_Pos) /*!< USBH_T::HcControl: IE Mask */ - -#define USBH_HcControl_CLE_Pos (4) /*!< USBH_T::HcControl: CLE Position */ -#define USBH_HcControl_CLE_Msk (0x1ul << USBH_HcControl_CLE_Pos) /*!< USBH_T::HcControl: CLE Mask */ - -#define USBH_HcControl_BLE_Pos (5) /*!< USBH_T::HcControl: BLE Position */ -#define USBH_HcControl_BLE_Msk (0x1ul << USBH_HcControl_BLE_Pos) /*!< USBH_T::HcControl: BLE Mask */ - -#define USBH_HcControl_HCFS_Pos (6) /*!< USBH_T::HcControl: HCFS Position */ -#define USBH_HcControl_HCFS_Msk (0x3ul << USBH_HcControl_HCFS_Pos) /*!< USBH_T::HcControl: HCFS Mask */ - -#define USBH_HcCommandStatus_HCR_Pos (0) /*!< USBH_T::HcCommandStatus: HCR Position */ -#define USBH_HcCommandStatus_HCR_Msk (0x1ul << USBH_HcCommandStatus_HCR_Pos) /*!< USBH_T::HcCommandStatus: HCR Mask */ - -#define USBH_HcCommandStatus_CLF_Pos (1) /*!< USBH_T::HcCommandStatus: CLF Position */ -#define USBH_HcCommandStatus_CLF_Msk (0x1ul << USBH_HcCommandStatus_CLF_Pos) /*!< USBH_T::HcCommandStatus: CLF Mask */ - -#define USBH_HcCommandStatus_BLF_Pos (2) /*!< USBH_T::HcCommandStatus: BLF Position */ -#define USBH_HcCommandStatus_BLF_Msk (0x1ul << USBH_HcCommandStatus_BLF_Pos) /*!< USBH_T::HcCommandStatus: BLF Mask */ - -#define USBH_HcCommandStatus_SOC_Pos (16) /*!< USBH_T::HcCommandStatus: SOC Position */ -#define USBH_HcCommandStatus_SOC_Msk (0x3ul << USBH_HcCommandStatus_SOC_Pos) /*!< USBH_T::HcCommandStatus: SOC Mask */ - -#define USBH_HcInterruptStatus_SO_Pos (0) /*!< USBH_T::HcInterruptStatus: SO Position */ -#define USBH_HcInterruptStatus_SO_Msk (0x1ul << USBH_HcInterruptStatus_SO_Pos) /*!< USBH_T::HcInterruptStatus: SO Mask */ - -#define USBH_HcInterruptStatus_WDH_Pos (1) /*!< USBH_T::HcInterruptStatus: WDH Position*/ -#define USBH_HcInterruptStatus_WDH_Msk (0x1ul << USBH_HcInterruptStatus_WDH_Pos) /*!< USBH_T::HcInterruptStatus: WDH Mask */ - -#define USBH_HcInterruptStatus_SF_Pos (2) /*!< USBH_T::HcInterruptStatus: SF Position */ -#define USBH_HcInterruptStatus_SF_Msk (0x1ul << USBH_HcInterruptStatus_SF_Pos) /*!< USBH_T::HcInterruptStatus: SF Mask */ - -#define USBH_HcInterruptStatus_RD_Pos (3) /*!< USBH_T::HcInterruptStatus: RD Position */ -#define USBH_HcInterruptStatus_RD_Msk (0x1ul << USBH_HcInterruptStatus_RD_Pos) /*!< USBH_T::HcInterruptStatus: RD Mask */ - -#define USBH_HcInterruptStatus_FNO_Pos (5) /*!< USBH_T::HcInterruptStatus: FNO Position*/ -#define USBH_HcInterruptStatus_FNO_Msk (0x1ul << USBH_HcInterruptStatus_FNO_Pos) /*!< USBH_T::HcInterruptStatus: FNO Mask */ - -#define USBH_HcInterruptStatus_RHSC_Pos (6) /*!< USBH_T::HcInterruptStatus: RHSC Position*/ -#define USBH_HcInterruptStatus_RHSC_Msk (0x1ul << USBH_HcInterruptStatus_RHSC_Pos) /*!< USBH_T::HcInterruptStatus: RHSC Mask */ - -#define USBH_HcInterruptEnable_SO_Pos (0) /*!< USBH_T::HcInterruptEnable: SO Position */ -#define USBH_HcInterruptEnable_SO_Msk (0x1ul << USBH_HcInterruptEnable_SO_Pos) /*!< USBH_T::HcInterruptEnable: SO Mask */ - -#define USBH_HcInterruptEnable_WDH_Pos (1) /*!< USBH_T::HcInterruptEnable: WDH Position*/ -#define USBH_HcInterruptEnable_WDH_Msk (0x1ul << USBH_HcInterruptEnable_WDH_Pos) /*!< USBH_T::HcInterruptEnable: WDH Mask */ - -#define USBH_HcInterruptEnable_SF_Pos (2) /*!< USBH_T::HcInterruptEnable: SF Position */ -#define USBH_HcInterruptEnable_SF_Msk (0x1ul << USBH_HcInterruptEnable_SF_Pos) /*!< USBH_T::HcInterruptEnable: SF Mask */ - -#define USBH_HcInterruptEnable_RD_Pos (3) /*!< USBH_T::HcInterruptEnable: RD Position */ -#define USBH_HcInterruptEnable_RD_Msk (0x1ul << USBH_HcInterruptEnable_RD_Pos) /*!< USBH_T::HcInterruptEnable: RD Mask */ - -#define USBH_HcInterruptEnable_FNO_Pos (5) /*!< USBH_T::HcInterruptEnable: FNO Position*/ -#define USBH_HcInterruptEnable_FNO_Msk (0x1ul << USBH_HcInterruptEnable_FNO_Pos) /*!< USBH_T::HcInterruptEnable: FNO Mask */ - -#define USBH_HcInterruptEnable_RHSC_Pos (6) /*!< USBH_T::HcInterruptEnable: RHSC Position*/ -#define USBH_HcInterruptEnable_RHSC_Msk (0x1ul << USBH_HcInterruptEnable_RHSC_Pos) /*!< USBH_T::HcInterruptEnable: RHSC Mask */ - -#define USBH_HcInterruptEnable_MIE_Pos (31) /*!< USBH_T::HcInterruptEnable: MIE Position*/ -#define USBH_HcInterruptEnable_MIE_Msk (0x1ul << USBH_HcInterruptEnable_MIE_Pos) /*!< USBH_T::HcInterruptEnable: MIE Mask */ - -#define USBH_HcInterruptDisable_SO_Pos (0) /*!< USBH_T::HcInterruptDisable: SO Position*/ -#define USBH_HcInterruptDisable_SO_Msk (0x1ul << USBH_HcInterruptDisable_SO_Pos) /*!< USBH_T::HcInterruptDisable: SO Mask */ - -#define USBH_HcInterruptDisable_WDH_Pos (1) /*!< USBH_T::HcInterruptDisable: WDH Position*/ -#define USBH_HcInterruptDisable_WDH_Msk (0x1ul << USBH_HcInterruptDisable_WDH_Pos) /*!< USBH_T::HcInterruptDisable: WDH Mask */ - -#define USBH_HcInterruptDisable_SF_Pos (2) /*!< USBH_T::HcInterruptDisable: SF Position*/ -#define USBH_HcInterruptDisable_SF_Msk (0x1ul << USBH_HcInterruptDisable_SF_Pos) /*!< USBH_T::HcInterruptDisable: SF Mask */ - -#define USBH_HcInterruptDisable_RD_Pos (3) /*!< USBH_T::HcInterruptDisable: RD Position*/ -#define USBH_HcInterruptDisable_RD_Msk (0x1ul << USBH_HcInterruptDisable_RD_Pos) /*!< USBH_T::HcInterruptDisable: RD Mask */ - -#define USBH_HcInterruptDisable_FNO_Pos (5) /*!< USBH_T::HcInterruptDisable: FNO Position*/ -#define USBH_HcInterruptDisable_FNO_Msk (0x1ul << USBH_HcInterruptDisable_FNO_Pos) /*!< USBH_T::HcInterruptDisable: FNO Mask */ - -#define USBH_HcInterruptDisable_RHSC_Pos (6) /*!< USBH_T::HcInterruptDisable: RHSC Position*/ -#define USBH_HcInterruptDisable_RHSC_Msk (0x1ul << USBH_HcInterruptDisable_RHSC_Pos) /*!< USBH_T::HcInterruptDisable: RHSC Mask */ - -#define USBH_HcInterruptDisable_MIE_Pos (31) /*!< USBH_T::HcInterruptDisable: MIE Position*/ -#define USBH_HcInterruptDisable_MIE_Msk (0x1ul << USBH_HcInterruptDisable_MIE_Pos) /*!< USBH_T::HcInterruptDisable: MIE Mask */ - -#define USBH_HcHCCA_HCCA_Pos (8) /*!< USBH_T::HcHCCA: HCCA Position */ -#define USBH_HcHCCA_HCCA_Msk (0xfffffful << USBH_HcHCCA_HCCA_Pos) /*!< USBH_T::HcHCCA: HCCA Mask */ - -#define USBH_HcPeriodCurrentED_PCED_Pos (4) /*!< USBH_T::HcPeriodCurrentED: PCED Position*/ -#define USBH_HcPeriodCurrentED_PCED_Msk (0xffffffful << USBH_HcPeriodCurrentED_PCED_Pos) /*!< USBH_T::HcPeriodCurrentED: PCED Mask */ - -#define USBH_HcControlHeadED_CHED_Pos (4) /*!< USBH_T::HcControlHeadED: CHED Position */ -#define USBH_HcControlHeadED_CHED_Msk (0xffffffful << USBH_HcControlHeadED_CHED_Pos) /*!< USBH_T::HcControlHeadED: CHED Mask */ - -#define USBH_HcControlCurrentED_CCED_Pos (4) /*!< USBH_T::HcControlCurrentED: CCED Position*/ -#define USBH_HcControlCurrentED_CCED_Msk (0xffffffful << USBH_HcControlCurrentED_CCED_Pos) /*!< USBH_T::HcControlCurrentED: CCED Mask */ - -#define USBH_HcBulkHeadED_BHED_Pos (4) /*!< USBH_T::HcBulkHeadED: BHED Position */ -#define USBH_HcBulkHeadED_BHED_Msk (0xffffffful << USBH_HcBulkHeadED_BHED_Pos) /*!< USBH_T::HcBulkHeadED: BHED Mask */ - -#define USBH_HcBulkCurrentED_BCED_Pos (4) /*!< USBH_T::HcBulkCurrentED: BCED Position */ -#define USBH_HcBulkCurrentED_BCED_Msk (0xffffffful << USBH_HcBulkCurrentED_BCED_Pos) /*!< USBH_T::HcBulkCurrentED: BCED Mask */ - -#define USBH_HcDoneHead_DH_Pos (4) /*!< USBH_T::HcDoneHead: DH Position */ -#define USBH_HcDoneHead_DH_Msk (0xffffffful << USBH_HcDoneHead_DH_Pos) /*!< USBH_T::HcDoneHead: DH Mask */ - -#define USBH_HcFmInterval_FI_Pos (0) /*!< USBH_T::HcFmInterval: FI Position */ -#define USBH_HcFmInterval_FI_Msk (0x3ffful << USBH_HcFmInterval_FI_Pos) /*!< USBH_T::HcFmInterval: FI Mask */ - -#define USBH_HcFmInterval_FSMPS_Pos (16) /*!< USBH_T::HcFmInterval: FSMPS Position */ -#define USBH_HcFmInterval_FSMPS_Msk (0x3ffful << USBH_HcFmInterval_FSMPS_Pos) /*!< USBH_T::HcFmInterval: FSMPS Mask */ - -#define USBH_HcFmInterval_FIT_Pos (31) /*!< USBH_T::HcFmInterval: FIT Position */ -#define USBH_HcFmInterval_FIT_Msk (0x1ul << USBH_HcFmInterval_FIT_Pos) /*!< USBH_T::HcFmInterval: FIT Mask */ - -#define USBH_HcFmRemaining_FR_Pos (0) /*!< USBH_T::HcFmRemaining: FR Position */ -#define USBH_HcFmRemaining_FR_Msk (0x3ffful << USBH_HcFmRemaining_FR_Pos) /*!< USBH_T::HcFmRemaining: FR Mask */ - -#define USBH_HcFmRemaining_FRT_Pos (31) /*!< USBH_T::HcFmRemaining: FRT Position */ -#define USBH_HcFmRemaining_FRT_Msk (0x1ul << USBH_HcFmRemaining_FRT_Pos) /*!< USBH_T::HcFmRemaining: FRT Mask */ - -#define USBH_HcFmNumber_FN_Pos (0) /*!< USBH_T::HcFmNumber: FN Position */ -#define USBH_HcFmNumber_FN_Msk (0xfffful << USBH_HcFmNumber_FN_Pos) /*!< USBH_T::HcFmNumber: FN Mask */ - -#define USBH_HcPeriodicStart_PS_Pos (0) /*!< USBH_T::HcPeriodicStart: PS Position */ -#define USBH_HcPeriodicStart_PS_Msk (0x3ffful << USBH_HcPeriodicStart_PS_Pos) /*!< USBH_T::HcPeriodicStart: PS Mask */ - -#define USBH_HcLSThreshold_LST_Pos (0) /*!< USBH_T::HcLSThreshold: LST Position */ -#define USBH_HcLSThreshold_LST_Msk (0xffful << USBH_HcLSThreshold_LST_Pos) /*!< USBH_T::HcLSThreshold: LST Mask */ - -#define USBH_HcRhDescriptorA_NDP_Pos (0) /*!< USBH_T::HcRhDescriptorA: NDP Position */ -#define USBH_HcRhDescriptorA_NDP_Msk (0xfful << USBH_HcRhDescriptorA_NDP_Pos) /*!< USBH_T::HcRhDescriptorA: NDP Mask */ - -#define USBH_HcRhDescriptorA_PSM_Pos (8) /*!< USBH_T::HcRhDescriptorA: PSM Position */ -#define USBH_HcRhDescriptorA_PSM_Msk (0x1ul << USBH_HcRhDescriptorA_PSM_Pos) /*!< USBH_T::HcRhDescriptorA: PSM Mask */ - -#define USBH_HcRhDescriptorA_OCPM_Pos (11) /*!< USBH_T::HcRhDescriptorA: OCPM Position */ -#define USBH_HcRhDescriptorA_OCPM_Msk (0x1ul << USBH_HcRhDescriptorA_OCPM_Pos) /*!< USBH_T::HcRhDescriptorA: OCPM Mask */ - -#define USBH_HcRhDescriptorA_NOCP_Pos (12) /*!< USBH_T::HcRhDescriptorA: NOCP Position */ -#define USBH_HcRhDescriptorA_NOCP_Msk (0x1ul << USBH_HcRhDescriptorA_NOCP_Pos) /*!< USBH_T::HcRhDescriptorA: NOCP Mask */ - -#define USBH_HcRhDescriptorB_PPCM_Pos (16) /*!< USBH_T::HcRhDescriptorB: PPCM Position */ -#define USBH_HcRhDescriptorB_PPCM_Msk (0xfffful << USBH_HcRhDescriptorB_PPCM_Pos) /*!< USBH_T::HcRhDescriptorB: PPCM Mask */ - -#define USBH_HcRhStatus_LPS_Pos (0) /*!< USBH_T::HcRhStatus: LPS Position */ -#define USBH_HcRhStatus_LPS_Msk (0x1ul << USBH_HcRhStatus_LPS_Pos) /*!< USBH_T::HcRhStatus: LPS Mask */ - -#define USBH_HcRhStatus_OCI_Pos (1) /*!< USBH_T::HcRhStatus: OCI Position */ -#define USBH_HcRhStatus_OCI_Msk (0x1ul << USBH_HcRhStatus_OCI_Pos) /*!< USBH_T::HcRhStatus: OCI Mask */ - -#define USBH_HcRhStatus_DRWE_Pos (15) /*!< USBH_T::HcRhStatus: DRWE Position */ -#define USBH_HcRhStatus_DRWE_Msk (0x1ul << USBH_HcRhStatus_DRWE_Pos) /*!< USBH_T::HcRhStatus: DRWE Mask */ - -#define USBH_HcRhStatus_LPSC_Pos (16) /*!< USBH_T::HcRhStatus: LPSC Position */ -#define USBH_HcRhStatus_LPSC_Msk (0x1ul << USBH_HcRhStatus_LPSC_Pos) /*!< USBH_T::HcRhStatus: LPSC Mask */ - -#define USBH_HcRhStatus_OCIC_Pos (17) /*!< USBH_T::HcRhStatus: OCIC Position */ -#define USBH_HcRhStatus_OCIC_Msk (0x1ul << USBH_HcRhStatus_OCIC_Pos) /*!< USBH_T::HcRhStatus: OCIC Mask */ - -#define USBH_HcRhStatus_CRWE_Pos (31) /*!< USBH_T::HcRhStatus: CRWE Position */ -#define USBH_HcRhStatus_CRWE_Msk (0x1ul << USBH_HcRhStatus_CRWE_Pos) /*!< USBH_T::HcRhStatus: CRWE Mask */ - -#define USBH_HcRhPortStatus_CCS_Pos (0) /*!< USBH_T::HcRhPortStatus: CCS Position */ -#define USBH_HcRhPortStatus_CCS_Msk (0x1ul << USBH_HcRhPortStatus_CCS_Pos) /*!< USBH_T::HcRhPortStatus: CCS Mask */ - -#define USBH_HcRhPortStatus_PES_Pos (1) /*!< USBH_T::HcRhPortStatus: PES Position */ -#define USBH_HcRhPortStatus_PES_Msk (0x1ul << USBH_HcRhPortStatus_PES_Pos) /*!< USBH_T::HcRhPortStatus: PES Mask */ - -#define USBH_HcRhPortStatus_PSS_Pos (2) /*!< USBH_T::HcRhPortStatus: PSS Position */ -#define USBH_HcRhPortStatus_PSS_Msk (0x1ul << USBH_HcRhPortStatus_PSS_Pos) /*!< USBH_T::HcRhPortStatus: PSS Mask */ - -#define USBH_HcRhPortStatus_POCI_Pos (3) /*!< USBH_T::HcRhPortStatus: POCI Position */ -#define USBH_HcRhPortStatus_POCI_Msk (0x1ul << USBH_HcRhPortStatus_POCI_Pos) /*!< USBH_T::HcRhPortStatus: POCI Mask */ - -#define USBH_HcRhPortStatus_PRS_Pos (4) /*!< USBH_T::HcRhPortStatus: PRS Position */ -#define USBH_HcRhPortStatus_PRS_Msk (0x1ul << USBH_HcRhPortStatus_PRS_Pos) /*!< USBH_T::HcRhPortStatus: PRS Mask */ - -#define USBH_HcRhPortStatus_PPS_Pos (8) /*!< USBH_T::HcRhPortStatus: PPS Position */ -#define USBH_HcRhPortStatus_PPS_Msk (0x1ul << USBH_HcRhPortStatus_PPS_Pos) /*!< USBH_T::HcRhPortStatus: PPS Mask */ - -#define USBH_HcRhPortStatus_LSDA_Pos (9) /*!< USBH_T::HcRhPortStatus: LSDA Position */ -#define USBH_HcRhPortStatus_LSDA_Msk (0x1ul << USBH_HcRhPortStatus_LSDA_Pos) /*!< USBH_T::HcRhPortStatus: LSDA Mask */ - -#define USBH_HcRhPortStatus_CSC_Pos (16) /*!< USBH_T::HcRhPortStatus: CSC Position */ -#define USBH_HcRhPortStatus_CSC_Msk (0x1ul << USBH_HcRhPortStatus_CSC_Pos) /*!< USBH_T::HcRhPortStatus: CSC Mask */ - -#define USBH_HcRhPortStatus_PESC_Pos (17) /*!< USBH_T::HcRhPortStatus: PESC Position */ -#define USBH_HcRhPortStatus_PESC_Msk (0x1ul << USBH_HcRhPortStatus_PESC_Pos) /*!< USBH_T::HcRhPortStatus: PESC Mask */ - -#define USBH_HcRhPortStatus_PSSC_Pos (18) /*!< USBH_T::HcRhPortStatus: PSSC Position */ -#define USBH_HcRhPortStatus_PSSC_Msk (0x1ul << USBH_HcRhPortStatus_PSSC_Pos) /*!< USBH_T::HcRhPortStatus: PSSC Mask */ - -#define USBH_HcRhPortStatus_OCIC_Pos (19) /*!< USBH_T::HcRhPortStatus: OCIC Position */ -#define USBH_HcRhPortStatus_OCIC_Msk (0x1ul << USBH_HcRhPortStatus_OCIC_Pos) /*!< USBH_T::HcRhPortStatus: OCIC Mask */ - -#define USBH_HcRhPortStatus_PRSC_Pos (20) /*!< USBH_T::HcRhPortStatus: PRSC Position */ -#define USBH_HcRhPortStatus_PRSC_Msk (0x1ul << USBH_HcRhPortStatus_PRSC_Pos) /*!< USBH_T::HcRhPortStatus: PRSC Mask */ - -#define USBH_HcPhyControl_STBYEN_Pos (27) /*!< USBH_T::HcPhyControl: STBYEN Position */ -#define USBH_HcPhyControl_STBYEN_Msk (0x1ul << USBH_HcPhyControl_STBYEN_Pos) /*!< USBH_T::HcPhyControl: STBYEN Mask */ - -#define USBH_HcMiscControl_ABORT_Pos (1) /*!< USBH_T::HcMiscControl: ABORT Position */ -#define USBH_HcMiscControl_ABORT_Msk (0x1ul << USBH_HcMiscControl_ABORT_Pos) /*!< USBH_T::HcMiscControl: ABORT Mask */ - -#define USBH_HcMiscControl_OCAL_Pos (3) /*!< USBH_T::HcMiscControl: OCAL Position */ -#define USBH_HcMiscControl_OCAL_Msk (0x1ul << USBH_HcMiscControl_OCAL_Pos) /*!< USBH_T::HcMiscControl: OCAL Mask */ - -#define USBH_HcMiscControl_DPRT1_Pos (16) /*!< USBH_T::HcMiscControl: DPRT1 Position */ -#define USBH_HcMiscControl_DPRT1_Msk (0x1ul << USBH_HcMiscControl_DPRT1_Pos) /*!< USBH_T::HcMiscControl: DPRT1 Mask */ - -/**@}*/ /* USBH_CONST */ -/**@}*/ /* end of USBH register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __USBH_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uspi_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uspi_reg.h deleted file mode 100644 index 2d3d5307b2b..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uspi_reg.h +++ /dev/null @@ -1,666 +0,0 @@ -/**************************************************************************//** - * @file uspi_reg.h - * @version V1.00 - * @brief USPI register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USPI_REG_H__ -#define __USPI_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- SPI Mode of USCI Controller -------------------------*/ -/** - @addtogroup USPI SPI Mode of USCI Controller(USPI) - Memory Mapped Structure for USPI Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var USPI_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var USPI_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt is disabled. - * | | |1 = The transmit start interrupt is enabled. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt is disabled. - * | | |1 = The transmit finish interrupt is enabled. - * |[3] |RXSTIEN |Receive Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt is disabled. - * | | |1 = The receive start interrupt is enabled. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt is disabled. - * | | |1 = The receive end interrupt is enabled. - * @var USPI_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fDIV_CLK. - * | | |01 = fPROT_CLK. - * | | |10 = fSCLK. - * | | |11 = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter is Disabled. - * | | |1 = Time measurement counter is Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(USPI_PROTCTL[6])) is enabled - * | | |The revised value is the average bit time between bit 5 and bit 6 - * | | |The user can use revised CLKDIV and new BRDETITV (USPI_PROTCTL[24:16]) to calculate the precise baud rate. - * @var USPI_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * @var USPI_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var USPI_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, it is suggested this bit should be set as 0. - * @var USPI_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT0/1 pin. - * | | |0 = Data output level is not inverted. - * | | |1 = Data output level is inverted. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: The control signal has different definitions in different protocol - * | | |In SPI protocol, the control signal means slave select signal - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * @var USPI_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission - * | | |In order to avoid overwriting the transmit data, user have to check TXEMPTY (USPI_BUFSTS[8]) status before writing transmit data into this bit field. - * |[16] |PORTDIR |Port Direction Control - * | | |This bit field is only available while USCI operates in SPI protocol (FUNMODE = 0x1) with half-duplex transfer - * | | |It is used to define the direction of the data port pin - * | | |When software writes USPI_TXDAT register, the transmit data and its port direction are settled simultaneously. - * | | |0 = The data pin is configured as output mode. - * | | |1 = The data pin is configured as input mode. - * @var USPI_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * @var USPI_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6] |TXUDRIEN |Slave Transmit Under-run Interrupt Enable Bit - * | | |0 = Transmit under-run interrupt Disabled. - * | | |1 = Transmit under-run interrupt Enabled. - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Interrupt Enable Bit - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note 1: It is cleared automatically after one PCLK cycle. - * | | |Note 2: Write 1 to this bit will set the output data pin to zero if USPI_PROTCTL[28]=0. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * @var USPI_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator (Read Only) - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator (Read Only) - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Overrun Interrupt Status - * | | |This bit indicates that a receive buffer overrun event has been detected - * | | |If RXOVIEN (USPI_BUFCTL[14]) is enabled, the corresponding interrupt request is activated - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun event has not been detected. - * | | |1 = A receive buffer overrun event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator (Read Only) - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty and available for the next transmission datum. - * |[9] |TXFULL |Transmit Buffer Full Indicator (Read Only) - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * |[11] |TXUDRIF |Transmit Buffer Under-run Interrupt Status - * | | |This bit indicates that a transmit buffer under-run event has been detected - * | | |If enabled by TXUDRIEN (USPI_BUFCTL[6]), the corresponding interrupt request is activated - * | | |It is cleared by software writes 1 to this bit - * | | |0 = A transmit buffer under-run event has not been detected. - * | | |1 = A transmit buffer under-run event has been detected. - * @var USPI_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * | | |Note: The I2C is not supporting PDMA function. - * @var USPI_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[1] |WKADDREN |Wake-up Address Match Enable Bit - * | | |0 = The chip is woken up according data toggle. - * | | |1 = The chip is woken up according address match. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var USPI_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var USPI_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLAVE |Slave Mode Selection - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[1] |SLV3WIRE |Slave 3-wire Mode Selection (Slave Only) - * | | |The SPI protocol can work with 3-wire interface (without slave select signal) in Slave mode. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[2] |SS |Slave Select Control (Master Only) - * | | |If AUTOSS bit is cleared, setting this bit to 1 will set the slave select signal to active state, and setting this bit to 0 will set the slave select signal back to inactive state. - * | | |If the AUTOSS function is enabled (AUTOSS = 1), the setting value of this bit will not affect the current state of slave select signal. - * | | |Note: In SPI protocol, the internal slave select signal is active high. - * |[3] |AUTOSS |Automatic Slave Select Function Enable (Master Only) - * | | |0 = Slave select signal will be controlled by the setting value of SS (USPI_PROTCTL[2]) bit. - * | | |1 = Slave select signal will be generated automatically - * | | |The slave select signal will be asserted by the SPI controller when transmit/receive is started, and will be de-asserted after each transmit/receive is finished. - * |[7:6] |SCLKMODE |Serial Bus Clock Mode - * | | |This bit field defines the SCLK idle status, data transmit, and data receive edge. - * | | |00 = MODE0. The idle state of SPI clock is low level. - * | | |Data is transmitted with falling edge and received with rising edge. - * | | |01 = MODE1. The idle state of SPI clock is low level. - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |10 = MODE2. The idle state of SPI clock is high level. - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |11 = MODE3. The idle state of SPI clock is high level. - * | | |Data is transmitted with falling edge and received with rising edge. - * |[11:8] |SUSPITV |Suspend Interval (Master Only) - * | | |This bit field provides the configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPI_CLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 ... 0.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0x1 ... 1.5 SPI_CLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE ... 14.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0xF ... 15.5 SPI_CLK clock cycle. - * |[14:12] |TSMSEL |Transmit Data Mode Selection - * | | |This bit field describes how receive and transmit data is shifted in and out. - * | | |TSMSEL = 000b: Full-duplex SPI. - * | | |TSMSEL = 100b: Half-duplex SPI. - * | | |Others = Reserved. - * | | |Note: Changing the value of this bit field will produce the TXRST and RXRST to clear the TX/RX data buffer automatically. - * |[25:16] |SLVTOCNT |Slave Mode Time-out Period (Slave Only) - * | | |In Slave mode, this bit field is used for Slave time-out period - * | | |This bit field indicates how many clock periods (selected by TMCNTSRC, USPI_BRGEN[5]) between the two edges of input SCLK will assert the Slave time-out event - * | | |Writing 0x0 into this bit field will disable the Slave time-out function. - * | | |Example: Assume SLVTOCNT is 0x0A and TMCNTSRC (USPI_BRGEN[5]) is 1, it means the time-out event will occur if the state of SPI bus clock pin is not changed more than (10+1) periods of fDIV_CLK. - * |[28] |TXUDRPOL |Transmit Under-run Data Polarity (Slave Only) - * | | |This bit defines the transmitting data level when no data is available for transferring. - * | | |0 = The output data level is 0 if TX under-run event occurs. - * | | |1 = The output data level is 1 if TX under-run event occurs. - * |[31] |PROTEN |SPI Protocol Enable Bit - * | | |0 = SPI Protocol Disabled. - * | | |1 = SPI Protocol Enabled. - * @var USPI_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to inactive. - * | | |0 = Slave select inactive interrupt generation Disabled. - * | | |1 = Slave select inactive interrupt generation Enabled. - * |[1] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to active. - * | | |0 = Slave select active interrupt generation Disabled. - * | | |1 = Slave select active interrupt generation Enabled. - * |[2] |SLVTOIEN |Slave Time-out Interrupt Enable Bit - * | | |In SPI protocol, this bit enables the interrupt generation in case of a Slave time-out event. - * | | |0 = The Slave time-out interrupt Disabled. - * | | |1 = The Slave time-out interrupt Enabled. - * |[3] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |If data transfer is terminated by slave time-out or slave select inactive event in Slave mode, so that the transmit/receive data bit count does not match the setting of DWIDTH (USPI_LINECTL[11:8]) - * | | |Bit count error event occurs. - * | | |0 = The Slave mode bit count error interrupt Disabled. - * | | |1 = The Slave mode bit count error interrupt Enabled. - * @var USPI_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = Transmit start event did not occur. - * | | |1 = Transmit start event occurred. - * | | |Note: It is cleared by software write 1 to this bit - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = Transmit end event did not occur. - * | | |1 = Transmit end event occurred. - * | | |Note: It is cleared by software write 1 to this bit - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = Receive start event did not occur. - * | | |1 = Receive start event occurred. - * | | |Note: It is cleared by software write 1 to this bit - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = Receive end event did not occur. - * | | |1 = Receive end event occurred. - * | | |Note: It is cleared by software write 1 to this bit - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag (Slave Only) - * | | |0 = Slave time-out event did not occur. - * | | |1 = Slave time-out event occurred. - * | | |Note: It is cleared by software write 1 to this bit - * |[6] |SLVBEIF |Slave Bit Count Error Interrupt Flag (Slave Only) - * | | |0 = Slave bit count error event did not occur. - * | | |1 = Slave bit count error event occurred. - * | | |Note: It is cleared by software write 1 to this bit. - * |[8] |SSINAIF |Slave Select Inactive Interrupt Flag (Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to inactive - * | | |It is cleared by software writes 1 to this bit - * | | |0 = The slave select signal has not changed to inactive. - * | | |1 = The slave select signal has changed to inactive. - * | | |Note: The internal slave select signal is active high. - * |[9] |SSACTIF |Slave Select Active Interrupt Flag (Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to active - * | | |It is cleared by software writes one to this bit - * | | |0 = The slave select signal has not changed to active. - * | | |1 = The slave select signal has changed to active. - * | | |Note: The internal slave select signal is active high. - * |[16] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |This bit is only available in Slave mode - * | | |It used to monitor the current status of the input slave select signal on the bus. - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * |[17] |BUSY |Busy Status (Read Only) - * | | |0 = SPI is in idle state. - * | | |1 = SPI is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. USPI_PROTCTL[31] = 1 and the TXEMPTY = 0. - * | | |b. For SPI Master mode, the TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |d. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[18] |SLVUDR |Slave Mode Transmit Under-run Status (Read Only) - * | | |In Slave mode, if there is no available transmit data in buffer while transmit data shift out caused by input serial bus clock, this status flag will be set to 1 - * | | |This bit indicates whether the current shift-out data of word transmission is switched to TXUDRPOL (USPI_PROTCTL[28]) or not. - * | | |0 = Slave transmit under-run event did not occur. - * | | |1 = Slave transmit under-run event occurred. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - __I uint32_t RESERVE1[3]; - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - __I uint32_t RESERVE2[1]; - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - __I uint32_t RESERVE3[4]; - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} USPI_T; - -/** - @addtogroup USPI_CONST USPI Bit Field Definition - Constant Definitions for USPI Controller - @{ -*/ - -#define USPI_CTL_FUNMODE_Pos (0) /*!< USPI_T::CTL: FUNMODE Position */ -#define USPI_CTL_FUNMODE_Msk (0x7ul << USPI_CTL_FUNMODE_Pos) /*!< USPI_T::CTL: FUNMODE Mask */ - -#define USPI_INTEN_TXSTIEN_Pos (1) /*!< USPI_T::INTEN: TXSTIEN Position */ -#define USPI_INTEN_TXSTIEN_Msk (0x1ul << USPI_INTEN_TXSTIEN_Pos) /*!< USPI_T::INTEN: TXSTIEN Mask */ - -#define USPI_INTEN_TXENDIEN_Pos (2) /*!< USPI_T::INTEN: TXENDIEN Position */ -#define USPI_INTEN_TXENDIEN_Msk (0x1ul << USPI_INTEN_TXENDIEN_Pos) /*!< USPI_T::INTEN: TXENDIEN Mask */ - -#define USPI_INTEN_RXSTIEN_Pos (3) /*!< USPI_T::INTEN: RXSTIEN Position */ -#define USPI_INTEN_RXSTIEN_Msk (0x1ul << USPI_INTEN_RXSTIEN_Pos) /*!< USPI_T::INTEN: RXSTIEN Mask */ - -#define USPI_INTEN_RXENDIEN_Pos (4) /*!< USPI_T::INTEN: RXENDIEN Position */ -#define USPI_INTEN_RXENDIEN_Msk (0x1ul << USPI_INTEN_RXENDIEN_Pos) /*!< USPI_T::INTEN: RXENDIEN Mask */ - -#define USPI_BRGEN_RCLKSEL_Pos (0) /*!< USPI_T::BRGEN: RCLKSEL Position */ -#define USPI_BRGEN_RCLKSEL_Msk (0x1ul << USPI_BRGEN_RCLKSEL_Pos) /*!< USPI_T::BRGEN: RCLKSEL Mask */ - -#define USPI_BRGEN_PTCLKSEL_Pos (1) /*!< USPI_T::BRGEN: PTCLKSEL Position */ -#define USPI_BRGEN_PTCLKSEL_Msk (0x1ul << USPI_BRGEN_PTCLKSEL_Pos) /*!< USPI_T::BRGEN: PTCLKSEL Mask */ - -#define USPI_BRGEN_SPCLKSEL_Pos (2) /*!< USPI_T::BRGEN: SPCLKSEL Position */ -#define USPI_BRGEN_SPCLKSEL_Msk (0x3ul << USPI_BRGEN_SPCLKSEL_Pos) /*!< USPI_T::BRGEN: SPCLKSEL Mask */ - -#define USPI_BRGEN_TMCNTEN_Pos (4) /*!< USPI_T::BRGEN: TMCNTEN Position */ -#define USPI_BRGEN_TMCNTEN_Msk (0x1ul << USPI_BRGEN_TMCNTEN_Pos) /*!< USPI_T::BRGEN: TMCNTEN Mask */ - -#define USPI_BRGEN_TMCNTSRC_Pos (5) /*!< USPI_T::BRGEN: TMCNTSRC Position */ -#define USPI_BRGEN_TMCNTSRC_Msk (0x1ul << USPI_BRGEN_TMCNTSRC_Pos) /*!< USPI_T::BRGEN: TMCNTSRC Mask */ - -#define USPI_BRGEN_CLKDIV_Pos (16) /*!< USPI_T::BRGEN: CLKDIV Position */ -#define USPI_BRGEN_CLKDIV_Msk (0x3fful << USPI_BRGEN_CLKDIV_Pos) /*!< USPI_T::BRGEN: CLKDIV Mask */ - -#define USPI_DATIN0_SYNCSEL_Pos (0) /*!< USPI_T::DATIN0: SYNCSEL Position */ -#define USPI_DATIN0_SYNCSEL_Msk (0x1ul << USPI_DATIN0_SYNCSEL_Pos) /*!< USPI_T::DATIN0: SYNCSEL Mask */ - -#define USPI_DATIN0_ININV_Pos (2) /*!< USPI_T::DATIN0: ININV Position */ -#define USPI_DATIN0_ININV_Msk (0x1ul << USPI_DATIN0_ININV_Pos) /*!< USPI_T::DATIN0: ININV Mask */ - -#define USPI_CTLIN0_SYNCSEL_Pos (0) /*!< USPI_T::CTLIN0: SYNCSEL Position */ -#define USPI_CTLIN0_SYNCSEL_Msk (0x1ul << USPI_CTLIN0_SYNCSEL_Pos) /*!< USPI_T::CTLIN0: SYNCSEL Mask */ - -#define USPI_CTLIN0_ININV_Pos (2) /*!< USPI_T::CTLIN0: ININV Position */ -#define USPI_CTLIN0_ININV_Msk (0x1ul << USPI_CTLIN0_ININV_Pos) /*!< USPI_T::CTLIN0: ININV Mask */ - -#define USPI_CLKIN_SYNCSEL_Pos (0) /*!< USPI_T::CLKIN: SYNCSEL Position */ -#define USPI_CLKIN_SYNCSEL_Msk (0x1ul << USPI_CLKIN_SYNCSEL_Pos) /*!< USPI_T::CLKIN: SYNCSEL Mask */ - -#define USPI_LINECTL_LSB_Pos (0) /*!< USPI_T::LINECTL: LSB Position */ -#define USPI_LINECTL_LSB_Msk (0x1ul << USPI_LINECTL_LSB_Pos) /*!< USPI_T::LINECTL: LSB Mask */ - -#define USPI_LINECTL_DATOINV_Pos (5) /*!< USPI_T::LINECTL: DATOINV Position */ -#define USPI_LINECTL_DATOINV_Msk (0x1ul << USPI_LINECTL_DATOINV_Pos) /*!< USPI_T::LINECTL: DATOINV Mask */ - -#define USPI_LINECTL_CTLOINV_Pos (7) /*!< USPI_T::LINECTL: CTLOINV Position */ -#define USPI_LINECTL_CTLOINV_Msk (0x1ul << USPI_LINECTL_CTLOINV_Pos) /*!< USPI_T::LINECTL: CTLOINV Mask */ - -#define USPI_LINECTL_DWIDTH_Pos (8) /*!< USPI_T::LINECTL: DWIDTH Position */ -#define USPI_LINECTL_DWIDTH_Msk (0xful << USPI_LINECTL_DWIDTH_Pos) /*!< USPI_T::LINECTL: DWIDTH Mask */ - -#define USPI_TXDAT_TXDAT_Pos (0) /*!< USPI_T::TXDAT: TXDAT Position */ -#define USPI_TXDAT_TXDAT_Msk (0xfffful << USPI_TXDAT_TXDAT_Pos) /*!< USPI_T::TXDAT: TXDAT Mask */ - -#define USPI_TXDAT_PORTDIR_Pos (16) /*!< USPI_T::TXDAT: PORTDIR Position */ -#define USPI_TXDAT_PORTDIR_Msk (0x1ul << USPI_TXDAT_PORTDIR_Pos) /*!< USPI_T::TXDAT: PORTDIR Mask */ - -#define USPI_RXDAT_RXDAT_Pos (0) /*!< USPI_T::RXDAT: RXDAT Position */ -#define USPI_RXDAT_RXDAT_Msk (0xfffful << USPI_RXDAT_RXDAT_Pos) /*!< USPI_T::RXDAT: RXDAT Mask */ - -#define USPI_BUFCTL_TXUDRIEN_Pos (6) /*!< USPI_T::BUFCTL: TXUDRIEN Position */ -#define USPI_BUFCTL_TXUDRIEN_Msk (0x1ul << USPI_BUFCTL_TXUDRIEN_Pos) /*!< USPI_T::BUFCTL: TXUDRIEN Mask */ - -#define USPI_BUFCTL_TXCLR_Pos (7) /*!< USPI_T::BUFCTL: TXCLR Position */ -#define USPI_BUFCTL_TXCLR_Msk (0x1ul << USPI_BUFCTL_TXCLR_Pos) /*!< USPI_T::BUFCTL: TXCLR Mask */ - -#define USPI_BUFCTL_RXOVIEN_Pos (14) /*!< USPI_T::BUFCTL: RXOVIEN Position */ -#define USPI_BUFCTL_RXOVIEN_Msk (0x1ul << USPI_BUFCTL_RXOVIEN_Pos) /*!< USPI_T::BUFCTL: RXOVIEN Mask */ - -#define USPI_BUFCTL_RXCLR_Pos (15) /*!< USPI_T::BUFCTL: RXCLR Position */ -#define USPI_BUFCTL_RXCLR_Msk (0x1ul << USPI_BUFCTL_RXCLR_Pos) /*!< USPI_T::BUFCTL: RXCLR Mask */ - -#define USPI_BUFCTL_TXRST_Pos (16) /*!< USPI_T::BUFCTL: TXRST Position */ -#define USPI_BUFCTL_TXRST_Msk (0x1ul << USPI_BUFCTL_TXRST_Pos) /*!< USPI_T::BUFCTL: TXRST Mask */ - -#define USPI_BUFCTL_RXRST_Pos (17) /*!< USPI_T::BUFCTL: RXRST Position */ -#define USPI_BUFCTL_RXRST_Msk (0x1ul << USPI_BUFCTL_RXRST_Pos) /*!< USPI_T::BUFCTL: RXRST Mask */ - -#define USPI_BUFSTS_RXEMPTY_Pos (0) /*!< USPI_T::BUFSTS: RXEMPTY Position */ -#define USPI_BUFSTS_RXEMPTY_Msk (0x1ul << USPI_BUFSTS_RXEMPTY_Pos) /*!< USPI_T::BUFSTS: RXEMPTY Mask */ - -#define USPI_BUFSTS_RXFULL_Pos (1) /*!< USPI_T::BUFSTS: RXFULL Position */ -#define USPI_BUFSTS_RXFULL_Msk (0x1ul << USPI_BUFSTS_RXFULL_Pos) /*!< USPI_T::BUFSTS: RXFULL Mask */ - -#define USPI_BUFSTS_RXOVIF_Pos (3) /*!< USPI_T::BUFSTS: RXOVIF Position */ -#define USPI_BUFSTS_RXOVIF_Msk (0x1ul << USPI_BUFSTS_RXOVIF_Pos) /*!< USPI_T::BUFSTS: RXOVIF Mask */ - -#define USPI_BUFSTS_TXEMPTY_Pos (8) /*!< USPI_T::BUFSTS: TXEMPTY Position */ -#define USPI_BUFSTS_TXEMPTY_Msk (0x1ul << USPI_BUFSTS_TXEMPTY_Pos) /*!< USPI_T::BUFSTS: TXEMPTY Mask */ - -#define USPI_BUFSTS_TXFULL_Pos (9) /*!< USPI_T::BUFSTS: TXFULL Position */ -#define USPI_BUFSTS_TXFULL_Msk (0x1ul << USPI_BUFSTS_TXFULL_Pos) /*!< USPI_T::BUFSTS: TXFULL Mask */ - -#define USPI_BUFSTS_TXUDRIF_Pos (11) /*!< USPI_T::BUFSTS: TXUDRIF Position */ -#define USPI_BUFSTS_TXUDRIF_Msk (0x1ul << USPI_BUFSTS_TXUDRIF_Pos) /*!< USPI_T::BUFSTS: TXUDRIF Mask */ - -#define USPI_PDMACTL_PDMARST_Pos (0) /*!< USPI_T::PDMACTL: PDMARST Position */ -#define USPI_PDMACTL_PDMARST_Msk (0x1ul << USPI_PDMACTL_PDMARST_Pos) /*!< USPI_T::PDMACTL: PDMARST Mask */ - -#define USPI_PDMACTL_TXPDMAEN_Pos (1) /*!< USPI_T::PDMACTL: TXPDMAEN Position */ -#define USPI_PDMACTL_TXPDMAEN_Msk (0x1ul << USPI_PDMACTL_TXPDMAEN_Pos) /*!< USPI_T::PDMACTL: TXPDMAEN Mask */ - -#define USPI_PDMACTL_RXPDMAEN_Pos (2) /*!< USPI_T::PDMACTL: RXPDMAEN Position */ -#define USPI_PDMACTL_RXPDMAEN_Msk (0x1ul << USPI_PDMACTL_RXPDMAEN_Pos) /*!< USPI_T::PDMACTL: RXPDMAEN Mask */ - -#define USPI_PDMACTL_PDMAEN_Pos (3) /*!< USPI_T::PDMACTL: PDMAEN Position */ -#define USPI_PDMACTL_PDMAEN_Msk (0x1ul << USPI_PDMACTL_PDMAEN_Pos) /*!< USPI_T::PDMACTL: PDMAEN Mask */ - -#define USPI_WKCTL_WKEN_Pos (0) /*!< USPI_T::WKCTL: WKEN Position */ -#define USPI_WKCTL_WKEN_Msk (0x1ul << USPI_WKCTL_WKEN_Pos) /*!< USPI_T::WKCTL: WKEN Mask */ - -#define USPI_WKCTL_WKADDREN_Pos (1) /*!< USPI_T::WKCTL: WKADDREN Position */ -#define USPI_WKCTL_WKADDREN_Msk (0x1ul << USPI_WKCTL_WKADDREN_Pos) /*!< USPI_T::WKCTL: WKADDREN Mask */ - -#define USPI_WKCTL_PDBOPT_Pos (2) /*!< USPI_T::WKCTL: PDBOPT Position */ -#define USPI_WKCTL_PDBOPT_Msk (0x1ul << USPI_WKCTL_PDBOPT_Pos) /*!< USPI_T::WKCTL: PDBOPT Mask */ - -#define USPI_WKSTS_WKF_Pos (0) /*!< USPI_T::WKSTS: WKF Position */ -#define USPI_WKSTS_WKF_Msk (0x1ul << USPI_WKSTS_WKF_Pos) /*!< USPI_T::WKSTS: WKF Mask */ - -#define USPI_PROTCTL_SLAVE_Pos (0) /*!< USPI_T::PROTCTL: SLAVE Position */ -#define USPI_PROTCTL_SLAVE_Msk (0x1ul << USPI_PROTCTL_SLAVE_Pos) /*!< USPI_T::PROTCTL: SLAVE Mask */ - -#define USPI_PROTCTL_SLV3WIRE_Pos (1) /*!< USPI_T::PROTCTL: SLV3WIRE Position */ -#define USPI_PROTCTL_SLV3WIRE_Msk (0x1ul << USPI_PROTCTL_SLV3WIRE_Pos) /*!< USPI_T::PROTCTL: SLV3WIRE Mask */ - -#define USPI_PROTCTL_SS_Pos (2) /*!< USPI_T::PROTCTL: SS Position */ -#define USPI_PROTCTL_SS_Msk (0x1ul << USPI_PROTCTL_SS_Pos) /*!< USPI_T::PROTCTL: SS Mask */ - -#define USPI_PROTCTL_AUTOSS_Pos (3) /*!< USPI_T::PROTCTL: AUTOSS Position */ -#define USPI_PROTCTL_AUTOSS_Msk (0x1ul << USPI_PROTCTL_AUTOSS_Pos) /*!< USPI_T::PROTCTL: AUTOSS Mask */ - -#define USPI_PROTCTL_SCLKMODE_Pos (6) /*!< USPI_T::PROTCTL: SCLKMODE Position */ -#define USPI_PROTCTL_SCLKMODE_Msk (0x3ul << USPI_PROTCTL_SCLKMODE_Pos) /*!< USPI_T::PROTCTL: SCLKMODE Mask */ - -#define USPI_PROTCTL_SUSPITV_Pos (8) /*!< USPI_T::PROTCTL: SUSPITV Position */ -#define USPI_PROTCTL_SUSPITV_Msk (0xful << USPI_PROTCTL_SUSPITV_Pos) /*!< USPI_T::PROTCTL: SUSPITV Mask */ - -#define USPI_PROTCTL_TSMSEL_Pos (12) /*!< USPI_T::PROTCTL: TSMSEL Position */ -#define USPI_PROTCTL_TSMSEL_Msk (0x7ul << USPI_PROTCTL_TSMSEL_Pos) /*!< USPI_T::PROTCTL: TSMSEL Mask */ - -#define USPI_PROTCTL_SLVTOCNT_Pos (16) /*!< USPI_T::PROTCTL: SLVTOCNT Position */ -#define USPI_PROTCTL_SLVTOCNT_Msk (0x3fful << USPI_PROTCTL_SLVTOCNT_Pos) /*!< USPI_T::PROTCTL: SLVTOCNT Mask */ - -#define USPI_PROTCTL_TXUDRPOL_Pos (28) /*!< USPI_T::PROTCTL: TXUDRPOL Position */ -#define USPI_PROTCTL_TXUDRPOL_Msk (0x1ul << USPI_PROTCTL_TXUDRPOL_Pos) /*!< USPI_T::PROTCTL: TXUDRPOL Mask */ - -#define USPI_PROTCTL_PROTEN_Pos (31) /*!< USPI_T::PROTCTL: PROTEN Position */ -#define USPI_PROTCTL_PROTEN_Msk (0x1ul << USPI_PROTCTL_PROTEN_Pos) /*!< USPI_T::PROTCTL: PROTEN Mask */ - -#define USPI_PROTIEN_SSINAIEN_Pos (0) /*!< USPI_T::PROTIEN: SSINAIEN Position */ -#define USPI_PROTIEN_SSINAIEN_Msk (0x1ul << USPI_PROTIEN_SSINAIEN_Pos) /*!< USPI_T::PROTIEN: SSINAIEN Mask */ - -#define USPI_PROTIEN_SSACTIEN_Pos (1) /*!< USPI_T::PROTIEN: SSACTIEN Position */ -#define USPI_PROTIEN_SSACTIEN_Msk (0x1ul << USPI_PROTIEN_SSACTIEN_Pos) /*!< USPI_T::PROTIEN: SSACTIEN Mask */ - -#define USPI_PROTIEN_SLVTOIEN_Pos (2) /*!< USPI_T::PROTIEN: SLVTOIEN Position */ -#define USPI_PROTIEN_SLVTOIEN_Msk (0x1ul << USPI_PROTIEN_SLVTOIEN_Pos) /*!< USPI_T::PROTIEN: SLVTOIEN Mask */ - -#define USPI_PROTIEN_SLVBEIEN_Pos (3) /*!< USPI_T::PROTIEN: SLVBEIEN Position */ -#define USPI_PROTIEN_SLVBEIEN_Msk (0x1ul << USPI_PROTIEN_SLVBEIEN_Pos) /*!< USPI_T::PROTIEN: SLVBEIEN Mask */ - -#define USPI_PROTSTS_TXSTIF_Pos (1) /*!< USPI_T::PROTSTS: TXSTIF Position */ -#define USPI_PROTSTS_TXSTIF_Msk (0x1ul << USPI_PROTSTS_TXSTIF_Pos) /*!< USPI_T::PROTSTS: TXSTIF Mask */ - -#define USPI_PROTSTS_TXENDIF_Pos (2) /*!< USPI_T::PROTSTS: TXENDIF Position */ -#define USPI_PROTSTS_TXENDIF_Msk (0x1ul << USPI_PROTSTS_TXENDIF_Pos) /*!< USPI_T::PROTSTS: TXENDIF Mask */ - -#define USPI_PROTSTS_RXSTIF_Pos (3) /*!< USPI_T::PROTSTS: RXSTIF Position */ -#define USPI_PROTSTS_RXSTIF_Msk (0x1ul << USPI_PROTSTS_RXSTIF_Pos) /*!< USPI_T::PROTSTS: RXSTIF Mask */ - -#define USPI_PROTSTS_RXENDIF_Pos (4) /*!< USPI_T::PROTSTS: RXENDIF Position */ -#define USPI_PROTSTS_RXENDIF_Msk (0x1ul << USPI_PROTSTS_RXENDIF_Pos) /*!< USPI_T::PROTSTS: RXENDIF Mask */ - -#define USPI_PROTSTS_SLVTOIF_Pos (5) /*!< USPI_T::PROTSTS: SLVTOIF Position */ -#define USPI_PROTSTS_SLVTOIF_Msk (0x1ul << USPI_PROTSTS_SLVTOIF_Pos) /*!< USPI_T::PROTSTS: SLVTOIF Mask */ - -#define USPI_PROTSTS_SLVBEIF_Pos (6) /*!< USPI_T::PROTSTS: SLVBEIF Position */ -#define USPI_PROTSTS_SLVBEIF_Msk (0x1ul << USPI_PROTSTS_SLVBEIF_Pos) /*!< USPI_T::PROTSTS: SLVBEIF Mask */ - -#define USPI_PROTSTS_SSINAIF_Pos (8) /*!< USPI_T::PROTSTS: SSINAIF Position */ -#define USPI_PROTSTS_SSINAIF_Msk (0x1ul << USPI_PROTSTS_SSINAIF_Pos) /*!< USPI_T::PROTSTS: SSINAIF Mask */ - -#define USPI_PROTSTS_SSACTIF_Pos (9) /*!< USPI_T::PROTSTS: SSACTIF Position */ -#define USPI_PROTSTS_SSACTIF_Msk (0x1ul << USPI_PROTSTS_SSACTIF_Pos) /*!< USPI_T::PROTSTS: SSACTIF Mask */ - -#define USPI_PROTSTS_SSLINE_Pos (16) /*!< USPI_T::PROTSTS: SSLINE Position */ -#define USPI_PROTSTS_SSLINE_Msk (0x1ul << USPI_PROTSTS_SSLINE_Pos) /*!< USPI_T::PROTSTS: SSLINE Mask */ - -#define USPI_PROTSTS_BUSY_Pos (17) /*!< USPI_T::PROTSTS: BUSY Position */ -#define USPI_PROTSTS_BUSY_Msk (0x1ul << USPI_PROTSTS_BUSY_Pos) /*!< USPI_T::PROTSTS: BUSY Mask */ - -#define USPI_PROTSTS_SLVUDR_Pos (18) /*!< USPI_T::PROTSTS: SLVUDR Position */ -#define USPI_PROTSTS_SLVUDR_Msk (0x1ul << USPI_PROTSTS_SLVUDR_Pos) /*!< USPI_T::PROTSTS: SLVUDR Mask */ - -/**@}*/ /* USPI_CONST */ -/**@}*/ /* end of USPI register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __USPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uuart_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uuart_reg.h deleted file mode 100644 index 75a14cfbccd..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/uuart_reg.h +++ /dev/null @@ -1,670 +0,0 @@ -/**************************************************************************//** - * @file uuart_reg.h - * @version V1.00 - * @brief UUART register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UUART_REG_H__ -#define __UUART_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- UART Mode of USCI Controller -------------------------*/ -/** - @addtogroup UUART UART Mode of USCI Controller(UUART) - Memory Mapped Structure for UUART Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var UUART_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller. - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI. - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol. - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Others = Reserved. - * @var UUART_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt is disabled. - * | | |1 = The transmit start interrupt is enabled. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt is disabled. - * | | |1 = The transmit finish interrupt is enabled. - * |[3] |RXSTIEN |Receive Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt is disabled. - * | | |1 = The receive start interrupt is enabled. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt is disabled. - * | | |1 = The receive end interrupt is enabled. - * @var UUART_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK frequency is fDIV_CLK. - * | | |01 = fSAMP_CLK frequency is from fPROT_CLK. - * | | |10 = fSAMP_CLK frequency is from fSCLK. - * | | |11 = fSAMP_CLK frequency is from fREF_CLK. - * |[4] |TMCNTEN |Timing Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Timing measurement counter is Disabled. - * | | |1 = Timing measurement counter is Enabled. - * |[5] |TMCNTSRC |Timing Measurement Counter Clock Source Selection - * | | |0 = Timing measurement counter with fPROT_CLK. - * | | |1 = Timing measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK. - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * | | |Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value. - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(UUART_PROTCTL[6])) is enabled. - * | | |The revised value is the average bit time between bit 5 and bit 6. - * | | |The user can use revised CLKDIV and new BRDETITV (UUART_PROTCTL[24:16]) to calculate the precise baud rate. - * @var UUART_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * |[4:3] |EDGEDET |Input Signal Edge Detection Mode - * | | |This bit field selects which edge actives the trigger event of input data signal. - * | | |00 = The trigger event activation is disabled. - * | | |01 = A rising edge activates the trigger event of input data signal. - * | | |10 = A falling edge activates the trigger event of input data signal. - * | | |11 = Both edges activate the trigger event of input data signal. - * | | |Note: In UART function mode, it is suggested to set this bit field as 10. - * @var UUART_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var UUART_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * @var UUART_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT1 pin. - * | | |0 = The value of USCIx_DAT1 is equal to the data shift register. - * | | |1 = The value of USCIx_DAT1 is the inversion of data shift register. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: In UART protocol, the control signal means nRTS signal. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0 = The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1 = Reserved. - * | | |0x2 = Reserved. - * | | |0x3 = Reserved. - * | | |0x4 = The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5 = The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF = The data word contains 15 bits located at bit positions [14:0]. - * | | |Note: In UART protocol, the length can be configured as 6~13 bits. - * @var UUART_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UUART_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note: RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (UUART_PROTSTS[7:5]). - * @var UUART_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared (filling level is cleared and output pointer is set to input pointer value). - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Error Interrupt Enable Control - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared (filling level is cleared and output pointer is set to input pointer value). - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note1: It is cleared automatically after one PCLK cycle. - * | | |Note2: It is suggest to check the RXBUSY (UUART_PROTSTS[10]) before this bit will be set to 1. - * @var UUART_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Over-run Error Interrupt Status - * | | |This bit indicates that a receive buffer overrun error event has been detected. - * | | |If RXOVIEN (UUART_BUFCTL[14]) is enabled, the corresponding interrupt request is activated. - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun error event has not been detected. - * | | |1 = A receive buffer overrun error event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty. - * |[9] |TXFULL |Transmit Buffer Full Indicator - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * @var UUART_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * @var UUART_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var UUART_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var UUART_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STOPB |Stop Bits - * | | |This bit defines the number of stop bits in an UART frame. - * | | |0 = The number of stop bits is 1. - * | | |1 = The number of stop bits is 2. - * |[1] |PARITYEN |Parity Enable Bit - * | | |This bit defines the parity bit is enabled in an UART frame. - * | | |0 = The parity bit Disabled. - * | | |1 = The parity bit Enabled. - * |[2] |EVENPARITY|Even Parity Enable Bit - * | | |0 = Odd number of logic 1's is transmitted and checked in each word. - * | | |1 = Even number of logic 1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PARITYEN is set. - * |[3] |RTSAUTOEN |nRTS Auto-flow Control Enable Bit - * | | |When nRTS auto-flow is enabled, if the receiver buffer is full (RXFULL (UUART_BUFSTS[1] = 1)), the UART will de-assert nRTS signal. - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: This bit has effect only when the RTSAUDIREN is not set. - * |[4] |CTSAUTOEN |nCTS Auto-flow Control Enable Bit - * | | |When nCTS auto-flow is enabled, the UART will send data to external device when nCTS input assert (UART will not send data to device if nCTS input is dis-asserted). - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * |[5] |RTSAUDIREN|nRTS Auto Direction Enable Bit - * | | |When nRTS auto direction is enabled, if the transmitted bytes in the TX buffer is empty, the nRTS signal is inactive. - * | | |0 = nRTS auto direction control Disabled. - * | | |1 = nRTS auto direction control Enabled. - * | | |Note1: This bit is used for nRTS auto direction control for RS485. - * | | |Note2: This bit has effect only when the RTSAUTOEN is not set. - * |[6] |ABREN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note: When the auto - baud rate detect operation finishes, hardware will clear this bit. - * | | |The associated interrupt ABRDETIF (UUART_PROTSTS[9]) will be generated (If ARBIEN (UUART_PROTIEN [1]) is enabled). - * |[9] |DATWKEN |Data Wake-up Mode Enable Bit - * | | |0 = Data wake-up mode Disabled. - * | | |1 = Data wake-up mode Enabled. - * |[10] |CTSWKEN |nCTS Wake-up Mode Enable Bit - * | | |0 = nCTS wake-up mode Disabled. - * | | |1 = nCTS wake-up mode Enabled. - * |[14:11] |WAKECNT |Wake-up Counter - * | | |These bits field indicate how many clock cycle selected by fPDS_CNT do the slave can get the 1st bit (start bit) when the device is wake-up from Power-down mode. - * |[24:16] |BRDETITV |Baud Rate Detection Interval - * | | |This bit fields indicate how many clock cycle selected by TMCNTSRC (UUART_BRGEN [5]) does the slave calculates the baud rate in one bits. - * | | |The order of the bus shall be 1 and 0 step by step (e.g - * | | |the input data pattern shall be 0x55) - * | | |The user can read the value to know the current input baud rate of the bus whenever the ABRDETIF (UUART_PROTCTL[9]) is set. - * | | |Note: This bit can be cleared to 0 by software writing 1 to the BRDETITV. - * |[26] |STICKEN |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: Refer to RS-485 Support section for detail information. - * |[29] |BCEN |Transmit Break Control Enable Bit - * | | |0 = Transmit Break Control Disabled. - * | | |1 = Transmit Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the serial data output (TX) is forced to the Spacing State (logic 0). - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[30] |DGE |Deglitch Enable Bit - * | | |0 = Deglitch Disabled. - * | | |1 = Deglitch Enabled. - * | | |Note: When this bit is set to logic 1, any pulse width less than about 300 ns will be considered a glitch and will be removed in the serial data input (RX). - * | | |This bit acts only on RX line and has no effect on the transmitter logic. - * |[31] |PROTEN |UART Protocol Enable Bit - * | | |0 = UART Protocol Disabled. - * | | |1 = UART Protocol Enabled. - * @var UUART_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive line status interrupt Disabled. - * | | |1 = Receive line status interrupt Enabled. - * | | |Note: UUART_PROTSTS[7:5] indicates the current interrupt event for receive line status interrupt. - * @var UUART_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = A transmit start interrupt status has not occurred. - * | | |1 = A transmit start interrupt status has occurred. - * | | |Note1: It is cleared by software writing one into this bit. - * | | |Note2: Used for user to load next transmit data when there is no data in transmit buffer. - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = A transmit end interrupt status has not occurred. - * | | |1 = A transmit end interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = A receive start interrupt status has not occurred. - * | | |1 = A receive start interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = A receive finish interrupt status has not occurred. - * | | |1 = A receive finish interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[5] |PARITYERR |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid parity bit. - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by write 1 among the BREAK, FRMERR and PARITYERR bits. - * |[6] |FRMERR |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid stop bit (that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by write 1 among the BREAK, FRMERR and PARITYERR bits. - * |[7] |BREAK |Break Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the spacing state (logic 0) for longer than a full word transmission time (that is, the total time of start bit + data bits + parity + stop bits). - * | | |0 = No Break is generated. - * | | |1 = Break is generated in the receiver bus. - * | | |Note: This bit can be cleared by write 1 among the BREAK, FRMERR and PARITYERR bits. - * |[9] |ABRDETIF |Auto-baud Rate Interrupt Flag - * | | |This bit is set when auto-baud rate detection is done among the falling edge of the input data. - * | | |If the ABRIEN (UUART_PROTCTL[6]) is set, the auto-baud rate interrupt will be generated. - * | | |This bit can be set 4 times when the input data pattern is 0x55 and it is cleared before the next falling edge of the input bus. - * | | |0 = Auto-baud rate detect function is not done. - * | | |1 = One Bit auto-baud rate detect function is done. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[10] |RXBUSY |RX Bus Status Flag (Read Only) - * | | |This bit indicates the busy status of the receiver. - * | | |0 = The receiver is Idle. - * | | |1 = The receiver is BUSY. - * |[11] |ABERRSTS |Auto-baud Rate Error Status - * | | |This bit is set when auto-baud rate detection counter overrun. - * | | |When the auto-baud rate counter overrun, the user shall revise the CLKDIV (UUART_BRGEN[25:16]) value and enable ABREN (UUART_PROTCTL[6]) to detect the correct baud rate again. - * | | |0 = Auto-baud rate detect counter is not overrun. - * | | |1 = Auto-baud rate detect counter is overrun. - * | | |Note1: This bit is set at the same time of ABRDETIF. - * | | |Note2: This bit can be cleared by writing 1 to ABRDETIF or ABERRSTS. - * |[16] |CTSSYNCLV |nCTS Synchronized Level Status (Read Only) - * | | |This bit used to indicate the current status of the internal synchronized nCTS signal. - * | | |0 = The internal synchronized nCTS is low. - * | | |1 = The internal synchronized nCTS is high. - * |[17] |CTSLV |nCTS Pin Status (Read Only) - * | | |This bit used to monitor the current status of nCTS pin input. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - */ - - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - __I uint32_t RESERVE1[3]; - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - __I uint32_t RESERVE2[1]; - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - __I uint32_t RESERVE3[4]; - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} UUART_T; - -/** - @addtogroup UUART_CONST UUART Bit Field Definition - Constant Definitions for UUART Controller - @{ -*/ - -#define UUART_CTL_FUNMODE_Pos (0) /*!< UUART_T::CTL: FUNMODE Position */ -#define UUART_CTL_FUNMODE_Msk (0x7ul << UUART_CTL_FUNMODE_Pos) /*!< UUART_T::CTL: FUNMODE Mask */ - -#define UUART_INTEN_TXSTIEN_Pos (1) /*!< UUART_T::INTEN: TXSTIEN Position */ -#define UUART_INTEN_TXSTIEN_Msk (0x1ul << UUART_INTEN_TXSTIEN_Pos) /*!< UUART_T::INTEN: TXSTIEN Mask */ - -#define UUART_INTEN_TXENDIEN_Pos (2) /*!< UUART_T::INTEN: TXENDIEN Position */ -#define UUART_INTEN_TXENDIEN_Msk (0x1ul << UUART_INTEN_TXENDIEN_Pos) /*!< UUART_T::INTEN: TXENDIEN Mask */ - -#define UUART_INTEN_RXSTIEN_Pos (3) /*!< UUART_T::INTEN: RXSTIEN Position */ -#define UUART_INTEN_RXSTIEN_Msk (0x1ul << UUART_INTEN_RXSTIEN_Pos) /*!< UUART_T::INTEN: RXSTIEN Mask */ - -#define UUART_INTEN_RXENDIEN_Pos (4) /*!< UUART_T::INTEN: RXENDIEN Position */ -#define UUART_INTEN_RXENDIEN_Msk (0x1ul << UUART_INTEN_RXENDIEN_Pos) /*!< UUART_T::INTEN: RXENDIEN Mask */ - -#define UUART_BRGEN_RCLKSEL_Pos (0) /*!< UUART_T::BRGEN: RCLKSEL Position */ -#define UUART_BRGEN_RCLKSEL_Msk (0x1ul << UUART_BRGEN_RCLKSEL_Pos) /*!< UUART_T::BRGEN: RCLKSEL Mask */ - -#define UUART_BRGEN_PTCLKSEL_Pos (1) /*!< UUART_T::BRGEN: PTCLKSEL Position */ -#define UUART_BRGEN_PTCLKSEL_Msk (0x1ul << UUART_BRGEN_PTCLKSEL_Pos) /*!< UUART_T::BRGEN: PTCLKSEL Mask */ - -#define UUART_BRGEN_SPCLKSEL_Pos (2) /*!< UUART_T::BRGEN: SPCLKSEL Position */ -#define UUART_BRGEN_SPCLKSEL_Msk (0x3ul << UUART_BRGEN_SPCLKSEL_Pos) /*!< UUART_T::BRGEN: SPCLKSEL Mask */ - -#define UUART_BRGEN_TMCNTEN_Pos (4) /*!< UUART_T::BRGEN: TMCNTEN Position */ -#define UUART_BRGEN_TMCNTEN_Msk (0x1ul << UUART_BRGEN_TMCNTEN_Pos) /*!< UUART_T::BRGEN: TMCNTEN Mask */ - -#define UUART_BRGEN_TMCNTSRC_Pos (5) /*!< UUART_T::BRGEN: TMCNTSRC Position */ -#define UUART_BRGEN_TMCNTSRC_Msk (0x1ul << UUART_BRGEN_TMCNTSRC_Pos) /*!< UUART_T::BRGEN: TMCNTSRC Mask */ - -#define UUART_BRGEN_PDSCNT_Pos (8) /*!< UUART_T::BRGEN: PDSCNT Position */ -#define UUART_BRGEN_PDSCNT_Msk (0x3ul << UUART_BRGEN_PDSCNT_Pos) /*!< UUART_T::BRGEN: PDSCNT Mask */ - -#define UUART_BRGEN_DSCNT_Pos (10) /*!< UUART_T::BRGEN: DSCNT Position */ -#define UUART_BRGEN_DSCNT_Msk (0x1ful << UUART_BRGEN_DSCNT_Pos) /*!< UUART_T::BRGEN: DSCNT Mask */ - -#define UUART_BRGEN_CLKDIV_Pos (16) /*!< UUART_T::BRGEN: CLKDIV Position */ -#define UUART_BRGEN_CLKDIV_Msk (0x3fful << UUART_BRGEN_CLKDIV_Pos) /*!< UUART_T::BRGEN: CLKDIV Mask */ - -#define UUART_DATIN0_SYNCSEL_Pos (0) /*!< UUART_T::DATIN0: SYNCSEL Position */ -#define UUART_DATIN0_SYNCSEL_Msk (0x1ul << UUART_DATIN0_SYNCSEL_Pos) /*!< UUART_T::DATIN0: SYNCSEL Mask */ - -#define UUART_DATIN0_ININV_Pos (2) /*!< UUART_T::DATIN0: ININV Position */ -#define UUART_DATIN0_ININV_Msk (0x1ul << UUART_DATIN0_ININV_Pos) /*!< UUART_T::DATIN0: ININV Mask */ - -#define UUART_DATIN0_EDGEDET_Pos (3) /*!< UUART_T::DATIN0: EDGEDET Position */ -#define UUART_DATIN0_EDGEDET_Msk (0x3ul << UUART_DATIN0_EDGEDET_Pos) /*!< UUART_T::DATIN0: EDGEDET Mask */ - -#define UUART_CTLIN0_SYNCSEL_Pos (0) /*!< UUART_T::CTLIN0: SYNCSEL Position */ -#define UUART_CTLIN0_SYNCSEL_Msk (0x1ul << UUART_CTLIN0_SYNCSEL_Pos) /*!< UUART_T::CTLIN0: SYNCSEL Mask */ - -#define UUART_CTLIN0_ININV_Pos (2) /*!< UUART_T::CTLIN0: ININV Position */ -#define UUART_CTLIN0_ININV_Msk (0x1ul << UUART_CTLIN0_ININV_Pos) /*!< UUART_T::CTLIN0: ININV Mask */ - -#define UUART_CLKIN_SYNCSEL_Pos (0) /*!< UUART_T::CLKIN: SYNCSEL Position */ -#define UUART_CLKIN_SYNCSEL_Msk (0x1ul << UUART_CLKIN_SYNCSEL_Pos) /*!< UUART_T::CLKIN: SYNCSEL Mask */ - -#define UUART_LINECTL_LSB_Pos (0) /*!< UUART_T::LINECTL: LSB Position */ -#define UUART_LINECTL_LSB_Msk (0x1ul << UUART_LINECTL_LSB_Pos) /*!< UUART_T::LINECTL: LSB Mask */ - -#define UUART_LINECTL_DATOINV_Pos (5) /*!< UUART_T::LINECTL: DATOINV Position */ -#define UUART_LINECTL_DATOINV_Msk (0x1ul << UUART_LINECTL_DATOINV_Pos) /*!< UUART_T::LINECTL: DATOINV Mask */ - -#define UUART_LINECTL_CTLOINV_Pos (7) /*!< UUART_T::LINECTL: CTLOINV Position */ -#define UUART_LINECTL_CTLOINV_Msk (0x1ul << UUART_LINECTL_CTLOINV_Pos) /*!< UUART_T::LINECTL: CTLOINV Mask */ - -#define UUART_LINECTL_DWIDTH_Pos (8) /*!< UUART_T::LINECTL: DWIDTH Position */ -#define UUART_LINECTL_DWIDTH_Msk (0xful << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_T::LINECTL: DWIDTH Mask */ - -#define UUART_TXDAT_TXDAT_Pos (0) /*!< UUART_T::TXDAT: TXDAT Position */ -#define UUART_TXDAT_TXDAT_Msk (0xfffful << UUART_TXDAT_TXDAT_Pos) /*!< UUART_T::TXDAT: TXDAT Mask */ - -#define UUART_RXDAT_RXDAT_Pos (0) /*!< UUART_T::RXDAT: RXDAT Position */ -#define UUART_RXDAT_RXDAT_Msk (0xfffful << UUART_RXDAT_RXDAT_Pos) /*!< UUART_T::RXDAT: RXDAT Mask */ - -#define UUART_BUFCTL_TXCLR_Pos (7) /*!< UUART_T::BUFCTL: TXCLR Position */ -#define UUART_BUFCTL_TXCLR_Msk (0x1ul << UUART_BUFCTL_TXCLR_Pos) /*!< UUART_T::BUFCTL: TXCLR Mask */ - -#define UUART_BUFCTL_RXOVIEN_Pos (14) /*!< UUART_T::BUFCTL: RXOVIEN Position */ -#define UUART_BUFCTL_RXOVIEN_Msk (0x1ul << UUART_BUFCTL_RXOVIEN_Pos) /*!< UUART_T::BUFCTL: RXOVIEN Mask */ - -#define UUART_BUFCTL_RXCLR_Pos (15) /*!< UUART_T::BUFCTL: RXCLR Position */ -#define UUART_BUFCTL_RXCLR_Msk (0x1ul << UUART_BUFCTL_RXCLR_Pos) /*!< UUART_T::BUFCTL: RXCLR Mask */ - -#define UUART_BUFCTL_TXRST_Pos (16) /*!< UUART_T::BUFCTL: TXRST Position */ -#define UUART_BUFCTL_TXRST_Msk (0x1ul << UUART_BUFCTL_TXRST_Pos) /*!< UUART_T::BUFCTL: TXRST Mask */ - -#define UUART_BUFCTL_RXRST_Pos (17) /*!< UUART_T::BUFCTL: RXRST Position */ -#define UUART_BUFCTL_RXRST_Msk (0x1ul << UUART_BUFCTL_RXRST_Pos) /*!< UUART_T::BUFCTL: RXRST Mask */ - -#define UUART_BUFSTS_RXEMPTY_Pos (0) /*!< UUART_T::BUFSTS: RXEMPTY Position */ -#define UUART_BUFSTS_RXEMPTY_Msk (0x1ul << UUART_BUFSTS_RXEMPTY_Pos) /*!< UUART_T::BUFSTS: RXEMPTY Mask */ - -#define UUART_BUFSTS_RXFULL_Pos (1) /*!< UUART_T::BUFSTS: RXFULL Position */ -#define UUART_BUFSTS_RXFULL_Msk (0x1ul << UUART_BUFSTS_RXFULL_Pos) /*!< UUART_T::BUFSTS: RXFULL Mask */ - -#define UUART_BUFSTS_RXOVIF_Pos (3) /*!< UUART_T::BUFSTS: RXOVIF Position */ -#define UUART_BUFSTS_RXOVIF_Msk (0x1ul << UUART_BUFSTS_RXOVIF_Pos) /*!< UUART_T::BUFSTS: RXOVIF Mask */ - -#define UUART_BUFSTS_TXEMPTY_Pos (8) /*!< UUART_T::BUFSTS: TXEMPTY Position */ -#define UUART_BUFSTS_TXEMPTY_Msk (0x1ul << UUART_BUFSTS_TXEMPTY_Pos) /*!< UUART_T::BUFSTS: TXEMPTY Mask */ - -#define UUART_BUFSTS_TXFULL_Pos (9) /*!< UUART_T::BUFSTS: TXFULL Position */ -#define UUART_BUFSTS_TXFULL_Msk (0x1ul << UUART_BUFSTS_TXFULL_Pos) /*!< UUART_T::BUFSTS: TXFULL Mask */ - -#define UUART_PDMACTL_PDMARST_Pos (0) /*!< UUART_T::PDMACTL: PDMARST Position */ -#define UUART_PDMACTL_PDMARST_Msk (0x1ul << UUART_PDMACTL_PDMARST_Pos) /*!< UUART_T::PDMACTL: PDMARST Mask */ - -#define UUART_PDMACTL_TXPDMAEN_Pos (1) /*!< UUART_T::PDMACTL: TXPDMAEN Position */ -#define UUART_PDMACTL_TXPDMAEN_Msk (0x1ul << UUART_PDMACTL_TXPDMAEN_Pos) /*!< UUART_T::PDMACTL: TXPDMAEN Mask */ - -#define UUART_PDMACTL_RXPDMAEN_Pos (2) /*!< UUART_T::PDMACTL: RXPDMAEN Position */ -#define UUART_PDMACTL_RXPDMAEN_Msk (0x1ul << UUART_PDMACTL_RXPDMAEN_Pos) /*!< UUART_T::PDMACTL: RXPDMAEN Mask */ - -#define UUART_PDMACTL_PDMAEN_Pos (3) /*!< UUART_T::PDMACTL: PDMAEN Position */ -#define UUART_PDMACTL_PDMAEN_Msk (0x1ul << UUART_PDMACTL_PDMAEN_Pos) /*!< UUART_T::PDMACTL: PDMAEN Mask */ - -#define UUART_WKCTL_WKEN_Pos (0) /*!< UUART_T::WKCTL: WKEN Position */ -#define UUART_WKCTL_WKEN_Msk (0x1ul << UUART_WKCTL_WKEN_Pos) /*!< UUART_T::WKCTL: WKEN Mask */ - -#define UUART_WKCTL_PDBOPT_Pos (2) /*!< UUART_T::WKCTL: PDBOPT Position */ -#define UUART_WKCTL_PDBOPT_Msk (0x1ul << UUART_WKCTL_PDBOPT_Pos) /*!< UUART_T::WKCTL: PDBOPT Mask */ - -#define UUART_WKSTS_WKF_Pos (0) /*!< UUART_T::WKSTS: WKF Position */ -#define UUART_WKSTS_WKF_Msk (0x1ul << UUART_WKSTS_WKF_Pos) /*!< UUART_T::WKSTS: WKF Mask */ - -#define UUART_PROTCTL_STOPB_Pos (0) /*!< UUART_T::PROTCTL: STOPB Position */ -#define UUART_PROTCTL_STOPB_Msk (0x1ul << UUART_PROTCTL_STOPB_Pos) /*!< UUART_T::PROTCTL: STOPB Mask */ - -#define UUART_PROTCTL_PARITYEN_Pos (1) /*!< UUART_T::PROTCTL: PARITYEN Position */ -#define UUART_PROTCTL_PARITYEN_Msk (0x1ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_T::PROTCTL: PARITYEN Mask */ - -#define UUART_PROTCTL_EVENPARITY_Pos (2) /*!< UUART_T::PROTCTL: EVENPARITY Position */ -#define UUART_PROTCTL_EVENPARITY_Msk (0x1ul << UUART_PROTCTL_EVENPARITY_Pos) /*!< UUART_T::PROTCTL: EVENPARITY Mask */ - -#define UUART_PROTCTL_RTSAUTOEN_Pos (3) /*!< UUART_T::PROTCTL: RTSAUTOEN Position */ -#define UUART_PROTCTL_RTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_RTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: RTSAUTOEN Mask */ - -#define UUART_PROTCTL_CTSAUTOEN_Pos (4) /*!< UUART_T::PROTCTL: CTSAUTOEN Position */ -#define UUART_PROTCTL_CTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_CTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: CTSAUTOEN Mask */ - -#define UUART_PROTCTL_RTSAUDIREN_Pos (5) /*!< UUART_T::PROTCTL: RTSAUDIREN Position */ -#define UUART_PROTCTL_RTSAUDIREN_Msk (0x1ul << UUART_PROTCTL_RTSAUDIREN_Pos) /*!< UUART_T::PROTCTL: RTSAUDIREN Mask */ - -#define UUART_PROTCTL_ABREN_Pos (6) /*!< UUART_T::PROTCTL: ABREN Position */ -#define UUART_PROTCTL_ABREN_Msk (0x1ul << UUART_PROTCTL_ABREN_Pos) /*!< UUART_T::PROTCTL: ABREN Mask */ - -#define UUART_PROTCTL_DATWKEN_Pos (9) /*!< UUART_T::PROTCTL: DATWKEN Position */ -#define UUART_PROTCTL_DATWKEN_Msk (0x1ul << UUART_PROTCTL_DATWKEN_Pos) /*!< UUART_T::PROTCTL: DATWKEN Mask */ - -#define UUART_PROTCTL_CTSWKEN_Pos (10) /*!< UUART_T::PROTCTL: CTSWKEN Position */ -#define UUART_PROTCTL_CTSWKEN_Msk (0x1ul << UUART_PROTCTL_CTSWKEN_Pos) /*!< UUART_T::PROTCTL: CTSWKEN Mask */ - -#define UUART_PROTCTL_WAKECNT_Pos (11) /*!< UUART_T::PROTCTL: WAKECNT Position */ -#define UUART_PROTCTL_WAKECNT_Msk (0xful << UUART_PROTCTL_WAKECNT_Pos) /*!< UUART_T::PROTCTL: WAKECNT Mask */ - -#define UUART_PROTCTL_BRDETITV_Pos (16) /*!< UUART_T::PROTCTL: BRDETITV Position */ -#define UUART_PROTCTL_BRDETITV_Msk (0x1fful << UUART_PROTCTL_BRDETITV_Pos) /*!< UUART_T::PROTCTL: BRDETITV Mask */ - -#define UUART_PROTCTL_STICKEN_Pos (26) /*!< UUART_T::PROTCTL: STICKEN Position */ -#define UUART_PROTCTL_STICKEN_Msk (0x1ul << UUART_PROTCTL_STICKEN_Pos) /*!< UUART_T::PROTCTL: STICKEN Mask */ - -#define UUART_PROTCTL_BCEN_Pos (29) /*!< UUART_T::PROTCTL: BCEN Position */ -#define UUART_PROTCTL_BCEN_Msk (0x1ul << UUART_PROTCTL_BCEN_Pos) /*!< UUART_T::PROTCTL: BCEN Mask */ - -#define UUART_PROTCTL_DGE_Pos (30) /*!< UUART_T::PROTCTL: DGE Position */ -#define UUART_PROTCTL_DGE_Msk (0x1ul << UUART_PROTCTL_DGE_Pos) /*!< UUART_T::PROTCTL: DGE Mask */ - -#define UUART_PROTCTL_PROTEN_Pos (31) /*!< UUART_T::PROTCTL: PROTEN Position */ -#define UUART_PROTCTL_PROTEN_Msk (0x1ul << UUART_PROTCTL_PROTEN_Pos) /*!< UUART_T::PROTCTL: PROTEN Mask */ - -#define UUART_PROTIEN_ABRIEN_Pos (1) /*!< UUART_T::PROTIEN: ABRIEN Position */ -#define UUART_PROTIEN_ABRIEN_Msk (0x1ul << UUART_PROTIEN_ABRIEN_Pos) /*!< UUART_T::PROTIEN: ABRIEN Mask */ - -#define UUART_PROTIEN_RLSIEN_Pos (2) /*!< UUART_T::PROTIEN: RLSIEN Position */ -#define UUART_PROTIEN_RLSIEN_Msk (0x1ul << UUART_PROTIEN_RLSIEN_Pos) /*!< UUART_T::PROTIEN: RLSIEN Mask */ - -#define UUART_PROTSTS_TXSTIF_Pos (1) /*!< UUART_T::PROTSTS: TXSTIF Position */ -#define UUART_PROTSTS_TXSTIF_Msk (0x1ul << UUART_PROTSTS_TXSTIF_Pos) /*!< UUART_T::PROTSTS: TXSTIF Mask */ - -#define UUART_PROTSTS_TXENDIF_Pos (2) /*!< UUART_T::PROTSTS: TXENDIF Position */ -#define UUART_PROTSTS_TXENDIF_Msk (0x1ul << UUART_PROTSTS_TXENDIF_Pos) /*!< UUART_T::PROTSTS: TXENDIF Mask */ - -#define UUART_PROTSTS_RXSTIF_Pos (3) /*!< UUART_T::PROTSTS: RXSTIF Position */ -#define UUART_PROTSTS_RXSTIF_Msk (0x1ul << UUART_PROTSTS_RXSTIF_Pos) /*!< UUART_T::PROTSTS: RXSTIF Mask */ - -#define UUART_PROTSTS_RXENDIF_Pos (4) /*!< UUART_T::PROTSTS: RXENDIF Position */ -#define UUART_PROTSTS_RXENDIF_Msk (0x1ul << UUART_PROTSTS_RXENDIF_Pos) /*!< UUART_T::PROTSTS: RXENDIF Mask */ - -#define UUART_PROTSTS_PARITYERR_Pos (5) /*!< UUART_T::PROTSTS: PARITYERR Position */ -#define UUART_PROTSTS_PARITYERR_Msk (0x1ul << UUART_PROTSTS_PARITYERR_Pos) /*!< UUART_T::PROTSTS: PARITYERR Mask */ - -#define UUART_PROTSTS_FRMERR_Pos (6) /*!< UUART_T::PROTSTS: FRMERR Position */ -#define UUART_PROTSTS_FRMERR_Msk (0x1ul << UUART_PROTSTS_FRMERR_Pos) /*!< UUART_T::PROTSTS: FRMERR Mask */ - -#define UUART_PROTSTS_BREAK_Pos (7) /*!< UUART_T::PROTSTS: BREAK Position */ -#define UUART_PROTSTS_BREAK_Msk (0x1ul << UUART_PROTSTS_BREAK_Pos) /*!< UUART_T::PROTSTS: BREAK Mask */ - -#define UUART_PROTSTS_ABRDETIF_Pos (9) /*!< UUART_T::PROTSTS: ABRDETIF Position */ -#define UUART_PROTSTS_ABRDETIF_Msk (0x1ul << UUART_PROTSTS_ABRDETIF_Pos) /*!< UUART_T::PROTSTS: ABRDETIF Mask */ - -#define UUART_PROTSTS_RXBUSY_Pos (10) /*!< UUART_T::PROTSTS: RXBUSY Position */ -#define UUART_PROTSTS_RXBUSY_Msk (0x1ul << UUART_PROTSTS_RXBUSY_Pos) /*!< UUART_T::PROTSTS: RXBUSY Mask */ - -#define UUART_PROTSTS_ABERRSTS_Pos (11) /*!< UUART_T::PROTSTS: ABERRSTS Position */ -#define UUART_PROTSTS_ABERRSTS_Msk (0x1ul << UUART_PROTSTS_ABERRSTS_Pos) /*!< UUART_T::PROTSTS: ABERRSTS Mask */ - -#define UUART_PROTSTS_CTSSYNCLV_Pos (16) /*!< UUART_T::PROTSTS: CTSSYNCLV Position */ -#define UUART_PROTSTS_CTSSYNCLV_Msk (0x1ul << UUART_PROTSTS_CTSSYNCLV_Pos) /*!< UUART_T::PROTSTS: CTSSYNCLV Mask */ - -#define UUART_PROTSTS_CTSLV_Pos (17) /*!< UUART_T::PROTSTS: CTSLV Position */ -#define UUART_PROTSTS_CTSLV_Msk (0x1ul << UUART_PROTSTS_CTSLV_Pos) /*!< UUART_T::PROTSTS: CTSLV Mask */ - -/**@}*/ /* UUART_CONST */ -/**@}*/ /* end of UUART register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __UUART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wdt_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wdt_reg.h deleted file mode 100644 index 4d4b79cd4a1..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wdt_reg.h +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************//** - * @file wdt_reg.h - * @version V1.00 - * @brief WDT register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WDT_REG_H__ -#define __WDT_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Watch Dog Timer Controller -------------------------*/ -/** - @addtogroup WDT Watch Dog Timer Controller(WDT) - Memory Mapped Structure for WDT Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var WDT_T::CTL - * Offset: 0x00 WDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RSTEN |WDT Time-out Reset Enable Control (Write Protect) - * | | |Setting this bit will enable the WDT time-out reset system function If the WDT up counter value has not been cleared after the specific WDT reset delay period expires. - * | | |0 = WDT time-out reset system function Disabled. - * | | |1 = WDT time-out reset system function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |RSTF |WDT Time-out Reset Flag - * | | |This bit indicates the system has been reset by WDT time-out reset system event or not. - * | | |0 = WDT time-out reset system event did not occur. - * | | |1 = WDT time-out reset system event has been occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |IF |WDT Time-out Interrupt Flag - * | | |This bit will set to 1 while WDT up counter value reaches the selected WDT time-out interval - * | | |0 = WDT time-out interrupt event interrupt did not occur. - * | | |1 = WDT time-out interrupt interrupt event occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[4] |WKEN |WDT Time-out Wake-up Function Control (Write Protect) - * | | |If this bit is set to 1, while WDT time-out interrupt flag IF (WDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (WDT_CTL[6]) is enabled, the WDT time-out interrupt signal will generate a event to trigger CPU wake-up trigger event to chip. - * | | |0 = Trigger wWake-up trigger event function Disabled if WDT time-out interrupt signal generated. - * | | |1 = Trigger Wake-up trigger event function Enabled if WDT time-out interrupt signal generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Chip can be woken-up by while WDT time-out interrupt signal generated only if WDT clock source is selected to LIRC or LXT (32 kHz). - * |[5] |WKF |WDT Time-out Wake-up Flag (Write Protect) - * | | |This bit indicates the WDT time-out event has triggered interrupt chip wake-up or not.flag status of WDT - * | | |0 = WDT does not cause chip wake-up. - * | | |1 = Chip wake-up from Idle or Power-down mode if when WDT time-out interrupt signal is generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[6] |INTEN |WDT Time-out Interrupt Enable Control (Write Protect) - * | | |If this bit is enabled, when WDT time-out event occurs, the IF (WDT_CTL[3]) will be set to 1 and the WDT time-out interrupt signal is generated and inform to CPU. - * | | |0 = WDT time-out interrupt Disabled. - * | | |1 = WDT time-out interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |WDTEN |WDT Enable Control (Write Protect) - * | | |0 = Set WDT counter stop Disabled, and (This action will reset the internal up counter value will be reset also). - * | | |1 = Set WDT counter start Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Perform enable or disable WDTEN bit needs 2 * WDT_CLK period to become active, user can read SYNC (WDT_CTL[30]) to check enable/disable command is completed or not. - * | | |Note32: If CWDTEN[2:0] (combined by with Config0[31] and Config0[4:3]) bits is not configure to 0x111, this bit is forced as 1 and user cannot change this bit to 0. - * | | |Note3: This bit disabled needs 2 * WDT_CLK. - * |[11:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect) - * | | |These three bits select the time-out interval period after for the WDT starts counting. - * | | |000 = 2^4 * WDT_CLK. - * | | |001 = 2^6 * WDT_CLK. - * | | |010 = 2^8 * WDT_CLK. - * | | |011 = 2^10 * WDT_CLK. - * | | |100 = 2^12 * WDT_CLK. - * | | |101 = 2^14 * WDT_CLK. - * | | |110 = 2^16 * WDT_CLK. - * | | |111 = 2^18 * WDT_CLK. - * | | |111 = 2^20 * WDT_CLK. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[30] |SYNC |WDT Enable Control SYNC SYNC Flag Indicator (Read Only) - * | | |If use to synchronization, software er can check execute enable/disable this flag after enable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is become completed or not active or not.. - * | | |SYNC delay is - * | | |0 = Set WDTEN bit is WDT enable control synccompletedhronizing is completion. - * | | |1 = Set WDTEN bit WDT enable control is synchronizing and not become active yet.. - * | | |Note: Perform enable or disable WDTEN bit - * | | |This bit enabled needs 2 * WDT_CLK period to become active. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect) - * | | |0 = ICE debug mode acknowledgment affects WDT counting. - * | | |WDT up counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgment Disabled. - * | | |WDT up counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var WDT_T::ALTCTL - * Offset: 0x04 WDT Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RSTDSEL |WDT Reset Delay Period Selection (Write Protect) - * | | |When WDT time-out event happened, user has a time named WDT Reset Delay Period to clear execute WDT counter by setting RSTCNT (WDT_CTL[0]) reset to prevent WDT time-out reset system occurred happened - * | | |User can select a suitable setting of RSTDSEL for different application program WDT Reset Delay Period. - * | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK. - * | | |01 = WDT Reset Delay Period is 130 * WDT_CLK. - * | | |10 = WDT Reset Delay Period is 18 * WDT_CLK. - * | | |11 = WDT Reset Delay Period is 3 * WDT_CLK. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This register will be reset to 0 if WDT time-out reset system event occurred happened. - * @var WDT_T::RSTCNT - * Offset: 0x08 WDT Reset Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RSTCNT |WDT Reset Counter Register - * | | |Writing 0x00005AA5 to this register field will reset the internal 18-bit WDT up counter value to 0. - * | | |Note: This WDT_RSTCNT is not write protected, but this RSTCNT (WDT_CTL[0]) is write protected. - * | | |Note: Perform RSTCNT to reset counter needs 2 * WDT_CLK period to become active. - */ - __IO uint32_t CTL; /*!< [0x0000] WDT Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0004] WDT Alternative Control Register */ - __O uint32_t RSTCNT; /*!< [0x0008] WDT Reset Counter Register */ - -} WDT_T; - -/** - @addtogroup WDT_CONST WDT Bit Field Definition - Constant Definitions for WDT Controller - @{ -*/ - -#define WDT_CTL_RSTEN_Pos (1) /*!< WDT_T::CTL: RSTEN Position */ -#define WDT_CTL_RSTEN_Msk (0x1ul << WDT_CTL_RSTEN_Pos) /*!< WDT_T::CTL: RSTEN Mask */ - -#define WDT_CTL_RSTF_Pos (2) /*!< WDT_T::CTL: RSTF Position */ -#define WDT_CTL_RSTF_Msk (0x1ul << WDT_CTL_RSTF_Pos) /*!< WDT_T::CTL: RSTF Mask */ - -#define WDT_CTL_IF_Pos (3) /*!< WDT_T::CTL: IF Position */ -#define WDT_CTL_IF_Msk (0x1ul << WDT_CTL_IF_Pos) /*!< WDT_T::CTL: IF Mask */ - -#define WDT_CTL_WKEN_Pos (4) /*!< WDT_T::CTL: WKEN Position */ -#define WDT_CTL_WKEN_Msk (0x1ul << WDT_CTL_WKEN_Pos) /*!< WDT_T::CTL: WKEN Mask */ - -#define WDT_CTL_WKF_Pos (5) /*!< WDT_T::CTL: WKF Position */ -#define WDT_CTL_WKF_Msk (0x1ul << WDT_CTL_WKF_Pos) /*!< WDT_T::CTL: WKF Mask */ - -#define WDT_CTL_INTEN_Pos (6) /*!< WDT_T::CTL: INTEN Position */ -#define WDT_CTL_INTEN_Msk (0x1ul << WDT_CTL_INTEN_Pos) /*!< WDT_T::CTL: INTEN Mask */ - -#define WDT_CTL_WDTEN_Pos (7) /*!< WDT_T::CTL: WDTEN Position */ -#define WDT_CTL_WDTEN_Msk (0x1ul << WDT_CTL_WDTEN_Pos) /*!< WDT_T::CTL: WDTEN Mask */ - -#define WDT_CTL_TOUTSEL_Pos (8) /*!< WDT_T::CTL: TOUTSEL Position */ -#define WDT_CTL_TOUTSEL_Msk (0xful << WDT_CTL_TOUTSEL_Pos) /*!< WDT_T::CTL: TOUTSEL Mask */ - -#define WDT_CTL_SYNC_Pos (30) /*!< WDT_T::CTL: SYNC Position */ -#define WDT_CTL_SYNC_Msk (0x1ul << WDT_CTL_SYNC_Pos) /*!< WDT_T::CTL: SYNC Mask */ - -#define WDT_CTL_ICEDEBUG_Pos (31) /*!< WDT_T::CTL: ICEDEBUG Position */ -#define WDT_CTL_ICEDEBUG_Msk (0x1ul << WDT_CTL_ICEDEBUG_Pos) /*!< WDT_T::CTL: ICEDEBUG Mask */ - -#define WDT_ALTCTL_RSTDSEL_Pos (0) /*!< WDT_T::ALTCTL: RSTDSEL Position */ -#define WDT_ALTCTL_RSTDSEL_Msk (0x3ul << WDT_ALTCTL_RSTDSEL_Pos) /*!< WDT_T::ALTCTL: RSTDSEL Mask */ - -#define WDT_RSTCNT_RSTCNT_Pos (0) /*!< WDT_T::RSTCNT: RSTCNT Position */ -#define WDT_RSTCNT_RSTCNT_Msk (0xfffffffful << WDT_RSTCNT_RSTCNT_Pos) /*!< WDT_T::RSTCNT: RSTCNT Mask */ - - -/**@}*/ /* WDT_CONST */ -/**@}*/ /* end of WDT register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __WDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wwdt_reg.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wwdt_reg.h deleted file mode 100644 index 048fea14c1f..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/wwdt_reg.h +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************//** - * @file wwdt_reg.h - * @version V1.00 - * @brief WWDT register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WWDT_REG_H__ -#define __WWDT_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Window Watchdog Timer -------------------------*/ -/** - @addtogroup WWDT Window Watchdog Timer(WWDT) - Memory Mapped Structure for WWDT Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var WWDT_T::RLDCNT - * Offset: 0x00 WWDT Reload Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RLDCNT |WWDT Reload Counter Register - * | | |Writing only 0x00005AA5 to this register will reload the WWDT counter value to 0x3F. - * | | |Note1: User can only write execute WWDT_RLDCNT register to the reload WWDT counter value command when current current WWDT counter value CNTDAT (WWDT_CNT[5:0]) is between 10 and CMPDAT (WWDT_CTL[21:16]) - * | | |If user writes 0x00005AA5 in WWDT_RLDCNT register when current current CNTDATWWDT counter value is larger than CMPDAT, WWDT reset signal system event will be generated immediately. - * | | |Note2: Execute WWDT counter reload always needs (WWDT_CLK *3) period to reload CNTDAT to 0x3F and internal prescale counter will be reset also. - * @var WWDT_T::CTL - * Offset: 0x04 WWDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTEN |WWDT Enable Control Bit - * | | |Set this bit to enable start WWDT counter counting. - * | | |0 = WWDT counter is stopped. - * | | |1 = WWDT counter is starting counting. - * |[1] |INTEN |WWDT Interrupt Enable Control Bit - * | | |If this bit is enabled, when WWDTIF (WWDT_STATUS[0]) is set to 1, the WWDT counter compare match interrupt signal is generated and inform to CPU. - * | | |0 = WWDT counter compare match interrupt Disabled. - * | | |1 = WWDT counter compare match interrupt Enabled. - * |[11:8] |PSCSEL |WWDT Counter Prescale Period Selection - * | | |0000 = Pre-scale is 1; Max time-out period is 1 * 64 * WWDT_CLK. - * | | |0001 = Pre-scale is 2; Max time-out period is 2 * 64 * WWDT_CLK. - * | | |0010 = Pre-scale is 4; Max time-out period is 4 * 64 * WWDT_CLK. - * | | |0011 = Pre-scale is 8; Max time-out period is 8 * 64 * WWDT_CLK. - * | | |0100 = Pre-scale is 16; Max time-out period is 16 * 64 * WWDT_CLK. - * | | |0101 = Pre-scale is 32; Max time-out period is 32 * 64 * WWDT_CLK. - * | | |0110 = Pre-scale is 64; Max time-out period is 64 * 64 * WWDT_CLK. - * | | |0111 = Pre-scale is 128; Max time-out period is 128 * 64 * WWDT_CLK. - * | | |1000 = Pre-scale is 192; Max time-out period is 192 * 64 * WWDT_CLK. - * | | |1001 = Pre-scale is 256; Max time-out period is 256 * 64 * WWDT_CLK. - * | | |1010 = Pre-scale is 384; Max time-out period is 384 * 64 * WWDT_CLK. - * | | |1011 = Pre-scale is 512; Max time-out period is 512 * 64 * WWDT_CLK. - * | | |1100 = Pre-scale is 768; Max time-out period is 768 * 64 * WWDT_CLK. - * | | |1101 = Pre-scale is 1024; Max time-out period is 1024 * 64 * WWDT_CLK. - * | | |1110 = Pre-scale is 1536; Max time-out period is 1536 * 64 * WWDT_CLK. - * | | |1111 = Pre-scale is 2048; Max time-out period is 2048 * 64 * WWDT_CLK. - * |[21:16] |CMPDAT |WWDT Window Compare Register Value - * | | |Set this register field to adjust the valid reload window interval when WWDTIF (WWDT_STATUS[0]) is generated.. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT CNTDAT (WWDT_CNT[5:]) is counter value between 10 and CMPDAT - * | | |If user writes 0x00005AA5 in WWDT_RLDCNT register when current WWDT counter value CNTDAT is larger than CMPDAT, WWDT reset system event signal will be generated immediately. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control - * | | |0 = ICE debug mode acknowledgment effects WWDT counter counting. - * | | |WWDT down counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgment Disabled. - * | | |WWDT down counter will keep going counting no matter CPU is held by ICE or not. - * @var WWDT_T::STATUS - * Offset: 0x08 WWDT Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTIF |WWDT Compare Match Interrupt Flag - * | | |This bit indicates the that current CNTDAT (WWDT_CNT[5:0]) matches the CMPDAT (WWDT_CTL[21:16])interrupt flag status of WWDT while WWDT counter value matches CMPDAT (WWDT_CTL[21:16]). - * | | |0 = No effect. - * | | |1 = WWDT WWDT CNTDAT counter value matches the CMPDAT. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WWDTRF |WWDT Timer-out Reset System Flag - * | | |If this bit is set to 1, it This bit indicates the that system has been reset by WWDT counter time-out reset system event.or not. - * | | |0 = WWDT time-out reset system event did not occur. - * | | |1 = WWDT time-out reset system event occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var WWDT_T::CNT - * Offset: 0x0C WWDT Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CNTDAT |WWDT Counter Value - * | | |CNTDAT will be updated continuously to monitor 6-bit WWDT down counter value. - */ - __O uint32_t RLDCNT; /*!< [0x0000] WWDT Reload Counter Register */ - __IO uint32_t CTL; /*!< [0x0004] WWDT Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] WWDT Status Register */ - __I uint32_t CNT; /*!< [0x000c] WWDT Counter Value Register */ - -} WWDT_T; - - -/** - @addtogroup WWDT_CONST WWDT Bit Field Definition - Constant Definitions for WWDT Controller - @{ -*/ - -#define WWDT_RLDCNT_RLDCNT_Pos (0) /*!< WWDT_T::RLDCNT: RLDCNT Position */ -#define WWDT_RLDCNT_RLDCNT_Msk (0xfffffffful << WWDT_RLDCNT_RLDCNT_Pos) /*!< WWDT_T::RLDCNT: RLDCNT Mask */ - -#define WWDT_CTL_WWDTEN_Pos (0) /*!< WWDT_T::CTL: WWDTEN Position */ -#define WWDT_CTL_WWDTEN_Msk (0x1ul << WWDT_CTL_WWDTEN_Pos) /*!< WWDT_T::CTL: WWDTEN Mask */ - -#define WWDT_CTL_INTEN_Pos (1) /*!< WWDT_T::CTL: INTEN Position */ -#define WWDT_CTL_INTEN_Msk (0x1ul << WWDT_CTL_INTEN_Pos) /*!< WWDT_T::CTL: INTEN Mask */ - -#define WWDT_CTL_PSCSEL_Pos (8) /*!< WWDT_T::CTL: PSCSEL Position */ -#define WWDT_CTL_PSCSEL_Msk (0xful << WWDT_CTL_PSCSEL_Pos) /*!< WWDT_T::CTL: PSCSEL Mask */ - -#define WWDT_CTL_CMPDAT_Pos (16) /*!< WWDT_T::CTL: CMPDAT Position */ -#define WWDT_CTL_CMPDAT_Msk (0x3ful << WWDT_CTL_CMPDAT_Pos) /*!< WWDT_T::CTL: CMPDAT Mask */ - -#define WWDT_CTL_ICEDEBUG_Pos (31) /*!< WWDT_T::CTL: ICEDEBUG Position */ -#define WWDT_CTL_ICEDEBUG_Msk (0x1ul << WWDT_CTL_ICEDEBUG_Pos) /*!< WWDT_T::CTL: ICEDEBUG Mask */ - -#define WWDT_STATUS_WWDTIF_Pos (0) /*!< WWDT_T::STATUS: WWDTIF Position */ -#define WWDT_STATUS_WWDTIF_Msk (0x1ul << WWDT_STATUS_WWDTIF_Pos) /*!< WWDT_T::STATUS: WWDTIF Mask */ - -#define WWDT_STATUS_WWDTRF_Pos (1) /*!< WWDT_T::STATUS: WWDTRF Position */ -#define WWDT_STATUS_WWDTRF_Msk (0x1ul << WWDT_STATUS_WWDTRF_Pos) /*!< WWDT_T::STATUS: WWDTRF Mask */ - -#define WWDT_CNT_CNTDAT_Pos (0) /*!< WWDT_T::CNT: CNTDAT Position */ -#define WWDT_CNT_CNTDAT_Msk (0x3ful << WWDT_CNT_CNTDAT_Pos) /*!< WWDT_T::CNT: CNTDAT Mask */ - -/**@}*/ /* WWDT_CONST */ -/**@}*/ /* end of WWDT register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __WWDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/ARM/startup_M2354.s b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/ARM/startup_M2354.s deleted file mode 100644 index bc8c1182962..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/ARM/startup_M2354.s +++ /dev/null @@ -1,582 +0,0 @@ -;/**************************************************************************//** -; * @file startup_M2354.s -; * @version V2.00 -; * $Revision: 9 $ -; * $Date: 16/08/27 12:33p $ -; * @brief Startup Source File -; * -; * @note -; * SPDX-License-Identifier: Apache-2.0 -; * Copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -; * -; ******************************************************************************/ - - -;/* -;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ -;*/ -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Stack_Size -Stack_Size EQU 0x00002000 - ENDIF - - AREA |.STACK|, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Heap_Size -Heap_Size EQU 0x00001000 - ENDIF - - 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 g_pfnVectors - EXPORT g_pfnVectors_End - EXPORT g_pfnVectors_Size -;Wayne IMPORT SendChar_ToUART - IMPORT SCU_IRQHandler - -g_pfnVectors DCD __initial_sp ; Top of Stack - DCD Reset_Handler ; Reset Handler - DCD NMI_Handler ; NMI Handler - DCD HardFault_Handler ; Hard Fault Handler - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD SVC_Handler ; SVCall Handler - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD PendSV_Handler ; PendSV Handler - DCD SysTick_Handler ; SysTick Handler - - ; External Interrupts - ; maximum of 32 External Interrupts are possible - DCD BOD_IRQHandler ; 0 - DCD IRC_IRQHandler ; 1 - DCD PWRWU_IRQHandler ; 2 - DCD SRAM_IRQHandler ; 3 - DCD CLKFAIL_IRQHandler ; 4 - DCD DEFAULT_IRQHandler ; 5 - DCD RTC_IRQHandler ; 6 - DCD RTC_TAMPER_IRQHandler ; 7 - DCD WDT_IRQHandler ; 8 - DCD WWDT_IRQHandler ; 9 - DCD EINT0_IRQHandler ; 10 - DCD EINT1_IRQHandler ; 11 - DCD EINT2_IRQHandler ; 12 - DCD EINT3_IRQHandler ; 13 - DCD EINT4_IRQHandler ; 14 - DCD EINT5_IRQHandler ; 15 - DCD GPA_IRQHandler ; 16 - DCD GPB_IRQHandler ; 17 - DCD GPC_IRQHandler ; 18 - DCD GPD_IRQHandler ; 19 - DCD GPE_IRQHandler ; 20 - DCD GPF_IRQHandler ; 21 - DCD QSPI0_IRQHandler ; 22 - DCD SPI0_IRQHandler ; 23 - DCD BRAKE0_IRQHandler ; 24 - DCD EPWM0_P0_IRQHandler ; 25 - DCD EPWM0_P1_IRQHandler ; 26 - DCD EPWM0_P2_IRQHandler ; 27 - DCD BRAKE1_IRQHandler ; 28 - DCD EPWM1_P0_IRQHandler ; 29 - DCD EPWM1_P1_IRQHandler ; 30 - DCD EPWM1_P2_IRQHandler ; 31 - DCD TMR0_IRQHandler ; 32 - DCD TMR1_IRQHandler ; 33 - DCD TMR2_IRQHandler ; 34 - DCD TMR3_IRQHandler ; 35 - DCD UART0_IRQHandler ; 36 - DCD UART1_IRQHandler ; 37 - DCD I2C0_IRQHandler ; 38 - DCD I2C1_IRQHandler ; 39 - DCD PDMA0_IRQHandler ; 40 - DCD DAC_IRQHandler ; 41 - DCD EADC0_IRQHandler ; 42 - DCD EADC1_IRQHandler ; 43 - DCD ACMP01_IRQHandler ; 44 - DCD DEFAULT_IRQHandler ; 45 - DCD EADC2_IRQHandler ; 46 - DCD EADC3_IRQHandler ; 47 - DCD UART2_IRQHandler ; 48 - DCD UART3_IRQHandler ; 49 - DCD DEFAULT_IRQHandler ; 50 - DCD SPI1_IRQHandler ; 51 - DCD SPI2_IRQHandler ; 52 - DCD USBD_IRQHandler ; 53 - DCD USBH_IRQHandler ; 54 - DCD USBOTG_IRQHandler ; 55 - DCD CAN0_IRQHandler ; 56 - DCD DEFAULT_IRQHandler ; 57 - DCD SC0_IRQHandler ; 58 - DCD SC1_IRQHandler ; 59 - DCD SC2_IRQHandler ; 60 - DCD DEFAULT_IRQHandler ; 61 - DCD SPI3_IRQHandler ; 62 - DCD DEFAULT_IRQHandler ; 63 - DCD SDH0_IRQHandler ; 64 - DCD DEFAULT_IRQHandler ; 65 - DCD DEFAULT_IRQHandler ; 66 - DCD DEFAULT_IRQHandler ; 67 - DCD I2S0_IRQHandler ; 68 - DCD DEFAULT_IRQHandler ; 69 - DCD OPA0_IRQHandler ; 70 - DCD CRPT_IRQHandler ; 71 - DCD GPG_IRQHandler ; 72 - DCD EINT6_IRQHandler ; 73 - DCD UART4_IRQHandler ; 74 - DCD UART5_IRQHandler ; 75 - DCD USCI0_IRQHandler ; 76 - DCD USCI1_IRQHandler ; 77 - DCD BPWM0_IRQHandler ; 78 - DCD BPWM1_IRQHandler ; 79 - DCD DEFAULT_IRQHandler ; 80 - DCD DEFAULT_IRQHandler ; 81 - DCD I2C2_IRQHandler ; 82 - DCD DEFAULT_IRQHandler ; 83 - DCD QEI0_IRQHandler ; 84 - DCD QEI1_IRQHandler ; 85 - DCD ECAP0_IRQHandler ; 86 - DCD ECAP1_IRQHandler ; 87 - DCD GPH_IRQHandler ; 88 - DCD EINT7_IRQHandler ; 89 - DCD DEFAULT_IRQHandler ; 90 - DCD DEFAULT_IRQHandler ; 91 - DCD DEFAULT_IRQHandler ; 92 - DCD DEFAULT_IRQHandler ; 93 - DCD DEFAULT_IRQHandler ; 94 - DCD DEFAULT_IRQHandler ; 95 - DCD DEFAULT_IRQHandler ; 96 - DCD DEFAULT_IRQHandler ; 97 - DCD PDMA1_IRQHandler ; 98 - DCD SCU_IRQHandler ; 99 - DCD LCD_IRQHandler ; 100 - DCD TRNG_IRQHandler ; 101 - DCD DEFAULT_IRQHandler ; 102 - DCD DEFAULT_IRQHandler ; 103 - DCD DEFAULT_IRQHandler ; 104 - DCD DEFAULT_IRQHandler ; 105 - DCD DEFAULT_IRQHandler ; 106 - DCD DEFAULT_IRQHandler ; 107 - DCD DEFAULT_IRQHandler ; 108 - DCD KS_IRQHandler ; 109 - DCD TAMPER_IRQHandler ; 110 - DCD EWDT_IRQHandler ; 111 - DCD EWWDT_IRQHandler ; 112 - DCD NS_ISP_IRQHandler ; 113 - DCD TMR4_IRQHandler ; 114 - DCD TMR5_IRQHandler ; 115 - - -g_pfnVectors_End - -g_pfnVectors_Size EQU g_pfnVectors_End - g_pfnVectors - - AREA |.text|, CODE, READONLY - - -; Reset Handler - -Reset_Handler PROC - EXPORT Reset_Handler [WEAK] - IMPORT SystemInit - IMPORT __main - - MOV R0, R15 - LSLS R0, R0, #3 - BMI GotoSystemInit - - LDR R0, =0x40000100 - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - LDR R0, =0x400001f4 - LDR R1, =0xffffffff - STR R1, [R0] - - LDR R0, =0x400000dC - LDR R1, =0x0 - STR R1, [R0] - - LDR R0, =0x40000200 - LDR R1, [R0,#0x4] - - LDR R2, =0xfff02000 - - ORRS R1, R1, R2 - STR R1, [R0,#0x4] - -GotoSystemInit - - LDR R0, =0x40000100 - MOVS R1, #0 - STR R1, [R0] - - 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 -ProcessHardFaultx\ - PROC - EXPORT ProcessHardFaultx [WEAK] - B . - ENDP -SVC_Handler PROC - EXPORT SVC_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 BOD_IRQHandler [WEAK] ; 0 - EXPORT IRC_IRQHandler [WEAK] ; 1 - EXPORT PWRWU_IRQHandler [WEAK] ; 2 - EXPORT SRAM_IRQHandler [WEAK] ; 3 - EXPORT CLKFAIL_IRQHandler [WEAK] ; 4 - ;EXPORT 0 [WEAK] ; 5 - EXPORT RTC_IRQHandler [WEAK] ; 6 - EXPORT RTC_TAMPER_IRQHandler [WEAK] ; 7 - EXPORT WDT_IRQHandler [WEAK] ; 8 - EXPORT WWDT_IRQHandler [WEAK] ; 9 - EXPORT EINT0_IRQHandler [WEAK] ; 10 - EXPORT EINT1_IRQHandler [WEAK] ; 11 - EXPORT EINT2_IRQHandler [WEAK] ; 12 - EXPORT EINT3_IRQHandler [WEAK] ; 13 - EXPORT EINT4_IRQHandler [WEAK] ; 14 - EXPORT EINT5_IRQHandler [WEAK] ; 15 - EXPORT GPA_IRQHandler [WEAK] ; 16 - EXPORT GPB_IRQHandler [WEAK] ; 17 - EXPORT GPC_IRQHandler [WEAK] ; 18 - EXPORT GPD_IRQHandler [WEAK] ; 19 - EXPORT GPE_IRQHandler [WEAK] ; 20 - EXPORT GPF_IRQHandler [WEAK] ; 21 - EXPORT QSPI0_IRQHandler [WEAK] ; 22 - EXPORT SPI0_IRQHandler [WEAK] ; 23 - EXPORT BRAKE0_IRQHandler [WEAK] ; 24 - EXPORT EPWM0_P0_IRQHandler [WEAK] ; 25 - EXPORT EPWM0_P1_IRQHandler [WEAK] ; 26 - EXPORT EPWM0_P2_IRQHandler [WEAK] ; 27 - EXPORT BRAKE1_IRQHandler [WEAK] ; 28 - EXPORT EPWM1_P0_IRQHandler [WEAK] ; 29 - EXPORT EPWM1_P1_IRQHandler [WEAK] ; 30 - EXPORT EPWM1_P2_IRQHandler [WEAK] ; 31 - EXPORT TMR0_IRQHandler [WEAK] ; 32 - EXPORT TMR1_IRQHandler [WEAK] ; 33 - EXPORT TMR2_IRQHandler [WEAK] ; 34 - EXPORT TMR3_IRQHandler [WEAK] ; 35 - EXPORT UART0_IRQHandler [WEAK] ; 36 - EXPORT UART1_IRQHandler [WEAK] ; 37 - EXPORT I2C0_IRQHandler [WEAK] ; 38 - EXPORT I2C1_IRQHandler [WEAK] ; 39 - EXPORT PDMA0_IRQHandler [WEAK] ; 40 - EXPORT DAC_IRQHandler [WEAK] ; 41 - EXPORT EADC0_IRQHandler [WEAK] ; 42 - EXPORT EADC1_IRQHandler [WEAK] ; 43 - EXPORT ACMP01_IRQHandler [WEAK] ; 44 - ;EXPORT 0 [WEAK] ; 45 - EXPORT EADC2_IRQHandler [WEAK] ; 46 - EXPORT EADC3_IRQHandler [WEAK] ; 47 - EXPORT UART2_IRQHandler [WEAK] ; 48 - EXPORT UART3_IRQHandler [WEAK] ; 49 - ;EXPORT 0 [WEAK] ; 50 - EXPORT SPI1_IRQHandler [WEAK] ; 51 - EXPORT SPI2_IRQHandler [WEAK] ; 52 - EXPORT USBD_IRQHandler [WEAK] ; 53 - EXPORT USBH_IRQHandler [WEAK] ; 54 - EXPORT USBOTG_IRQHandler [WEAK] ; 55 - EXPORT CAN0_IRQHandler [WEAK] ; 56 - EXPORT CAN1_IRQHandler [WEAK] ; 57 - EXPORT SC0_IRQHandler [WEAK] ; 58 - EXPORT SC1_IRQHandler [WEAK] ; 59 - EXPORT SC2_IRQHandler [WEAK] ; 60 - EXPORT SC3_IRQHandler [WEAK] ; 61 - EXPORT SPI3_IRQHandler [WEAK] ; 62 - ;EXPORT 0 [WEAK] ; 63 - EXPORT SDH0_IRQHandler [WEAK] ; 64 - ;EXPORT 0 [WEAK] ; 65 - ;EXPORT 0 [WEAK] ; 66 - ;EXPORT 0 [WEAK] ; 67 - EXPORT I2S0_IRQHandler [WEAK] ; 68 - ;EXPORT 0 [WEAK] ; 69 - EXPORT OPA0_IRQHandler [WEAK] ; 70 - EXPORT CRPT_IRQHandler [WEAK] ; 71 - EXPORT GPG_IRQHandler [WEAK] ; 72 - EXPORT EINT6_IRQHandler [WEAK] ; 73 - EXPORT UART4_IRQHandler [WEAK] ; 74 - EXPORT UART5_IRQHandler [WEAK] ; 75 - EXPORT USCI0_IRQHandler [WEAK] ; 76 - EXPORT USCI1_IRQHandler [WEAK] ; 77 - EXPORT BPWM0_IRQHandler [WEAK] ; 78 - EXPORT BPWM1_IRQHandler [WEAK] ; 79 - ;EXPORT 0 [WEAK] ; 80 - ;EXPORT 0 [WEAK] ; 81 - EXPORT I2C2_IRQHandler [WEAK] ; 82 - ;EXPORT 0 [WEAK] ; 83 - EXPORT QEI0_IRQHandler [WEAK] ; 84 - EXPORT QEI1_IRQHandler [WEAK] ; 85 - EXPORT ECAP0_IRQHandler [WEAK] ; 86 - EXPORT ECAP1_IRQHandler [WEAK] ; 87 - EXPORT GPH_IRQHandler [WEAK] ; 88 - EXPORT EINT7_IRQHandler [WEAK] ; 89 - EXPORT SDH1_IRQHandler [WEAK] ; 90 - ;EXPORT 0 [WEAK] ; 91 - ;EXPORT USBH_IRQHandler [WEAK] ; 92 - ;EXPORT 0 [WEAK] ; 93 - ;EXPORT 0 [WEAK] ; 94 - ;EXPORT 0 [WEAK] ; 95 - ;EXPORT 0 [WEAK] ; 96 - ;EXPORT 0 [WEAK] ; 97 - EXPORT PDMA1_IRQHandler [WEAK] ; 98 - ;EXPORT SCU_IRQHandler [WEAK] ; 99 - EXPORT LCD_IRQHandler [WEAK] ; 100 - EXPORT TRNG_IRQHandler [WEAK] ; 101 - ;EXPORT 0 [WEAK] ; 102 - ;EXPORT 0 [WEAK] ; 103 - ;EXPORT 0 [WEAK] ; 104 - ;EXPORT 0 [WEAK] ; 105 - ;EXPORT 0 [WEAK] ; 106 - ;EXPORT 0 [WEAK] ; 107 - ;EXPORT 0 [WEAK] ; 108 - EXPORT KS_IRQHandler [WEAK] ; 109 - EXPORT TAMPER_IRQHandler [WEAK] ; 110 - EXPORT EWDT_IRQHandler [WEAK] ; 111 - EXPORT EWWDT_IRQHandler [WEAK] ; 112 - EXPORT NS_ISP_IRQHandler [WEAK] ; 113 - EXPORT TMR4_IRQHandler [WEAK] ; 114 - EXPORT TMR5_IRQHandler [WEAK] ; 115 - - - EXPORT DEFAULT_IRQHandler [WEAK] - -BOD_IRQHandler ; 0 -IRC_IRQHandler ; 1 -PWRWU_IRQHandler ; 2 -SRAM_IRQHandler ; 3 -CLKFAIL_IRQHandler ; 4 -;0 ; 5 -RTC_IRQHandler ; 6 -RTC_TAMPER_IRQHandler ; 7 -WDT_IRQHandler ; 8 -WWDT_IRQHandler ; 9 -EINT0_IRQHandler ; 10 -EINT1_IRQHandler ; 11 -EINT2_IRQHandler ; 12 -EINT3_IRQHandler ; 13 -EINT4_IRQHandler ; 14 -EINT5_IRQHandler ; 15 -GPA_IRQHandler ; 16 -GPB_IRQHandler ; 17 -GPC_IRQHandler ; 18 -GPD_IRQHandler ; 19 -GPE_IRQHandler ; 20 -GPF_IRQHandler ; 21 -QSPI0_IRQHandler ; 22 -SPI0_IRQHandler ; 23 -BRAKE0_IRQHandler ; 24 -EPWM0_P0_IRQHandler ; 25 -EPWM0_P1_IRQHandler ; 26 -EPWM0_P2_IRQHandler ; 27 -BRAKE1_IRQHandler ; 28 -EPWM1_P0_IRQHandler ; 29 -EPWM1_P1_IRQHandler ; 30 -EPWM1_P2_IRQHandler ; 31 -TMR0_IRQHandler ; 32 -TMR1_IRQHandler ; 33 -TMR2_IRQHandler ; 34 -TMR3_IRQHandler ; 35 -UART0_IRQHandler ; 36 -UART1_IRQHandler ; 37 -I2C0_IRQHandler ; 38 -I2C1_IRQHandler ; 39 -PDMA0_IRQHandler ; 40 -DAC_IRQHandler ; 41 -EADC0_IRQHandler ; 42 -EADC1_IRQHandler ; 43 -ACMP01_IRQHandler ; 44 -;0 ; 45 -EADC2_IRQHandler ; 46 -EADC3_IRQHandler ; 47 -UART2_IRQHandler ; 48 -UART3_IRQHandler ; 49 -;0 ; 50 -SPI1_IRQHandler ; 51 -SPI2_IRQHandler ; 52 -USBD_IRQHandler ; 53 -USBH_IRQHandler ; 54 -USBOTG_IRQHandler ; 55 -CAN0_IRQHandler ; 56 -CAN1_IRQHandler ; 57 -SC0_IRQHandler ; 58 -SC1_IRQHandler ; 59 -SC2_IRQHandler ; 60 -SC3_IRQHandler ; 61 -SPI3_IRQHandler ; 62 -;0 ; 63 -SDH0_IRQHandler ; 64 -;0 ; 65 -;0 ; 66 -;0 ; 67 -I2S0_IRQHandler ; 68 -;0 ; 69 -OPA0_IRQHandler ; 70 -CRPT_IRQHandler ; 71 -GPG_IRQHandler ; 72 -EINT6_IRQHandler ; 73 -UART4_IRQHandler ; 74 -UART5_IRQHandler ; 75 -USCI0_IRQHandler ; 76 -USCI1_IRQHandler ; 77 -BPWM0_IRQHandler ; 78 -BPWM1_IRQHandler ; 79 -;0 ; 80 -;0 ; 81 -I2C2_IRQHandler ; 82 -;0 ; 83 -QEI0_IRQHandler ; 84 -QEI1_IRQHandler ; 85 -ECAP0_IRQHandler ; 86 -ECAP1_IRQHandler ; 87 -GPH_IRQHandler ; 88 -EINT7_IRQHandler ; 89 -SDH1_IRQHandler ; 90 -;0 ; 91 -;USBH_IRQHandler ; 92 -;0 ; 93 -;0 ; 94 -;0 ; 95 -;0 ; 96 -;0 ; 97 -PDMA1_IRQHandler ; 98 -;SCU_IRQHandler ; 99 -LCD_IRQHandler ; 100 -TRNG_IRQHandler ; 101 -;0 ; 102 -;0 ; 103 -;0 ; 104 -;0 ; 105 -;0 ; 106 -;0 ; 107 -;0 ; 108 -KS_IRQHandler ; 109 -TAMPER_IRQHandler ; 110 -EWDT_IRQHandler ; 111 -EWWDT_IRQHandler ; 112 -NS_ISP_IRQHandler ; 113 -TMR4_IRQHandler ; 114 -TMR5_IRQHandler ; 115 - -DEFAULT_IRQHandler - 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 PROC - LDR R0, = Heap_Mem - LDR R1, = (Stack_Mem + Stack_Size) - LDR R2, = (Heap_Mem + Heap_Size) - LDR R3, = Stack_Mem - BX LR - ENDP - - - ALIGN - - ENDIF - - -__PC PROC - EXPORT __PC - - MOV r0, lr - BLX lr - ALIGN - - ENDP - -SPD_Return PROC - EXPORT SPD_Return - - LDR r0, =0x400002c0 ; SPD_VTOR - LDR r1, =0x20010000 ; New VTOR - STR r1, [r0] - MOV r0, sp - STR r0, [r1] - LDR r0, =SPD_Next - STR r0, [r1,#4] - WFI - B . - ;LDR SPD_Next -SPD_Next - NOP - NOP - NOP - - ENDP - - - END diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/GCC/startup_M2354.S b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/GCC/startup_M2354.S deleted file mode 100644 index 9b27236c829..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/GCC/startup_M2354.S +++ /dev/null @@ -1,418 +0,0 @@ -/****************************************************************************//** - * @file startup_M2354.S - * @version V1.00 - * @brief CMSIS Device Startup File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - - - - .syntax unified - .arch armv8 - m.base - .fpu softvfp - .thumb - - .global g_pfnVectors - .global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function - -Reset_Handler: - - /* Check SecureWorld */ - MOV R0, R15 - LSLS R0, R0, #3 - BMI.N GotoSystemInit - - /* Unlock Register */ - LDR R0, =0x40000100 - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - /* power gating */ - /* M32(0x400001f4) = 0xfffffffful; */ - LDR R0, =0x400001f4 - LDR R1, =0xffffffff - STR R1, [R0] - - /* M32(0x400000dC) = 0ul; */ - LDR R0, =0x400000dC - LDR R1, =0x0 - STR R1, [R0] - - /* Enable GPIO clks, SRAM clks, Trace clk */ - /* CLK->AHBCLK |= (0xffful << 20) | (1ul << 14); */ - - LDR R0, =0x40000200 - LDR R1, [R0,#0x4] - - LDR R2, =0xfff02000 - - ORRS R1, R1, R2 - STR R1, [R0,#0x4] - -GotoSystemInit: - - /* Lock register */ - LDR R0, =0x40000100 - MOVS R1, #0 - STR R1, [R0] - - /* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss - -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2, #4] - adds r2, r2, #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - /* Call the clock system intitialization function.*/ - bl SystemInit - -/* Call the application's entry point.*/ - bl entry - bx lr -.size Reset_Handler, .-Reset_Handler - - - .pool - .size Reset_Handler, . - Reset_Handler - - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler - - /* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, Default_Handler - .endm - - def_irq_handler NMI_Handler - def_irq_handler HardFault_Handler - def_irq_handler SVC_Handler - def_irq_handler PendSV_Handler - def_irq_handler SysTick_Handler - - def_irq_handler BOD_IRQHandler - def_irq_handler IRC_IRQHandler - def_irq_handler PWRWU_IRQHandler - def_irq_handler SRAM_IRQHandler - def_irq_handler CLKFAIL_IRQHandler - - def_irq_handler RTC_IRQHandler - def_irq_handler RTC_TAMPER_IRQHandler - def_irq_handler WDT_IRQHandler - def_irq_handler WWDT_IRQHandler - def_irq_handler EINT0_IRQHandler - def_irq_handler EINT1_IRQHandler - def_irq_handler EINT2_IRQHandler - def_irq_handler EINT3_IRQHandler - def_irq_handler EINT4_IRQHandler - def_irq_handler EINT5_IRQHandler - def_irq_handler GPA_IRQHandler - def_irq_handler GPB_IRQHandler - def_irq_handler GPC_IRQHandler - def_irq_handler GPD_IRQHandler - def_irq_handler GPE_IRQHandler - def_irq_handler GPF_IRQHandler - def_irq_handler QSPI0_IRQHandler - def_irq_handler SPI0_IRQHandler - def_irq_handler BRAKE0_IRQHandler - def_irq_handler EPWM0_P0_IRQHandler - def_irq_handler EPWM0_P1_IRQHandler - def_irq_handler EPWM0_P2_IRQHandler - def_irq_handler BRAKE1_IRQHandler - def_irq_handler EPWM1_P0_IRQHandler - def_irq_handler EPWM1_P1_IRQHandler - def_irq_handler EPWM1_P2_IRQHandler - def_irq_handler TMR0_IRQHandler - def_irq_handler TMR1_IRQHandler - def_irq_handler TMR2_IRQHandler - def_irq_handler TMR3_IRQHandler - def_irq_handler UART0_IRQHandler - def_irq_handler UART1_IRQHandler - def_irq_handler I2C0_IRQHandler - def_irq_handler I2C1_IRQHandler - def_irq_handler PDMA0_IRQHandler - def_irq_handler DAC_IRQHandler - def_irq_handler EADC0_IRQHandler - def_irq_handler EADC1_IRQHandler - def_irq_handler ACMP01_IRQHandler - - def_irq_handler EADC2_IRQHandler - def_irq_handler EADC3_IRQHandler - def_irq_handler UART2_IRQHandler - def_irq_handler UART3_IRQHandler - - def_irq_handler SPI1_IRQHandler - def_irq_handler SPI2_IRQHandler - def_irq_handler USBD_IRQHandler - def_irq_handler USBH_IRQHandler - def_irq_handler USBOTG_IRQHandler - def_irq_handler CAN0_IRQHandler - - def_irq_handler SC0_IRQHandler - def_irq_handler SC1_IRQHandler - def_irq_handler SC2_IRQHandler - - def_irq_handler SPI3_IRQHandler - - def_irq_handler SDH0_IRQHandler - - - - def_irq_handler I2S0_IRQHandler - - def_irq_handler OPA0_IRQHandler - def_irq_handler CRPT_IRQHandler - def_irq_handler GPG_IRQHandler - def_irq_handler EINT6_IRQHandler - def_irq_handler UART4_IRQHandler - def_irq_handler UART5_IRQHandler - def_irq_handler USCI0_IRQHandler - def_irq_handler USCI1_IRQHandler - def_irq_handler BPWM0_IRQHandler - def_irq_handler BPWM1_IRQHandler - - - def_irq_handler I2C2_IRQHandler - - def_irq_handler QEI0_IRQHandler - def_irq_handler QEI1_IRQHandler - def_irq_handler ECAP0_IRQHandler - def_irq_handler ECAP1_IRQHandler - def_irq_handler GPH_IRQHandler - def_irq_handler EINT7_IRQHandler - - - - - - - - - def_irq_handler PDMA1_IRQHandler - def_irq_handler SCU_IRQHandler - def_irq_handler LCD_IRQHandler - def_irq_handler TRNG_IRQHandler - - - - - - - - def_irq_handler KS_IRQHandler - def_irq_handler TAMPER_IRQHandler - def_irq_handler EWDT_IRQHandler - def_irq_handler EWWDT_IRQHandler - def_irq_handler NS_ISP_IRQHandler - def_irq_handler TMR4_IRQHandler - def_irq_handler TMR5_IRQHandler - - - .align 2 - .thumb_func - .global __PC - .type __PC, % function - -__PC: - MOV r0, lr - BLX lr - .size __PC, . - __PC - -/******************************************************************************* -* -* The minimal vector table for a Cortex M23. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -*******************************************************************************/ - - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, . - g_pfnVectors - -g_pfnVectors: - .long _estack /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler */ - .long HardFault_Handler /* Hard Fault Handler */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long SVC_Handler /* SVCall Handler */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long PendSV_Handler /* PendSV Handler */ - .long SysTick_Handler /* SysTick Handler */ - - /* External interrupts */ - .long BOD_IRQHandler /* 0 */ - .long IRC_IRQHandler /* 1 */ - .long PWRWU_IRQHandler /* 2 */ - .long SRAM_IRQHandler /* 3 */ - .long CLKFAIL_IRQHandler /* 4 */ - .long Default_Handler /* 5 */ - .long RTC_IRQHandler /* 6 */ - .long RTC_TAMPER_IRQHandler /* 7 */ - .long WDT_IRQHandler /* 8 */ - .long WWDT_IRQHandler /* 9 */ - .long EINT0_IRQHandler /* 10 */ - .long EINT1_IRQHandler /* 11 */ - .long EINT2_IRQHandler /* 12 */ - .long EINT3_IRQHandler /* 13 */ - .long EINT4_IRQHandler /* 14 */ - .long EINT5_IRQHandler /* 15 */ - .long GPA_IRQHandler /* 16 */ - .long GPB_IRQHandler /* 17 */ - .long GPC_IRQHandler /* 18 */ - .long GPD_IRQHandler /* 19 */ - .long GPE_IRQHandler /* 20 */ - .long GPF_IRQHandler /* 21 */ - .long QSPI0_IRQHandler /* 22 */ - .long SPI0_IRQHandler /* 23 */ - .long BRAKE0_IRQHandler /* 24 */ - .long EPWM0_P0_IRQHandler /* 25 */ - .long EPWM0_P1_IRQHandler /* 26 */ - .long EPWM0_P2_IRQHandler /* 27 */ - .long BRAKE1_IRQHandler /* 28 */ - .long EPWM1_P0_IRQHandler /* 29 */ - .long EPWM1_P1_IRQHandler /* 30 */ - .long EPWM1_P2_IRQHandler /* 31 */ - .long TMR0_IRQHandler /* 32 */ - .long TMR1_IRQHandler /* 33 */ - .long TMR2_IRQHandler /* 34 */ - .long TMR3_IRQHandler /* 35 */ - .long UART0_IRQHandler /* 36 */ - .long UART1_IRQHandler /* 37 */ - .long I2C0_IRQHandler /* 38 */ - .long I2C1_IRQHandler /* 39 */ - .long PDMA0_IRQHandler /* 40 */ - .long DAC_IRQHandler /* 41 */ - .long EADC0_IRQHandler /* 42 */ - .long EADC1_IRQHandler /* 43 */ - .long ACMP01_IRQHandler /* 44 */ - .long Default_Handler /* 45 */ - .long EADC2_IRQHandler /* 46 */ - .long EADC3_IRQHandler /* 47 */ - .long UART2_IRQHandler /* 48 */ - .long UART3_IRQHandler /* 49 */ - .long Default_Handler /* 50 */ - .long SPI1_IRQHandler /* 51 */ - .long SPI2_IRQHandler /* 52 */ - .long USBD_IRQHandler /* 53 */ - .long USBH_IRQHandler /* 54 */ - .long USBOTG_IRQHandler /* 55 */ - .long CAN0_IRQHandler /* 56 */ - .long Default_Handler /* 57 */ - .long SC0_IRQHandler /* 58 */ - .long SC1_IRQHandler /* 59 */ - .long SC2_IRQHandler /* 60 */ - .long Default_Handler /* 61 */ - .long SPI3_IRQHandler /* 62 */ - .long Default_Handler /* 63 */ - .long SDH0_IRQHandler /* 64 */ - .long Default_Handler /* 65 */ - .long Default_Handler /* 66 */ - .long Default_Handler /* 67 */ - .long I2S0_IRQHandler /* 68 */ - .long Default_Handler /* 69 */ - .long OPA0_IRQHandler /* 70 */ - .long CRPT_IRQHandler /* 71 */ - .long GPG_IRQHandler /* 72 */ - .long EINT6_IRQHandler /* 73 */ - .long UART4_IRQHandler /* 74 */ - .long UART5_IRQHandler /* 75 */ - .long USCI0_IRQHandler /* 76 */ - .long USCI1_IRQHandler /* 77 */ - .long BPWM0_IRQHandler /* 78 */ - .long BPWM1_IRQHandler /* 79 */ - .long Default_Handler /* 80 */ - .long Default_Handler /* 81 */ - .long I2C2_IRQHandler /* 82 */ - .long Default_Handler /* 83 */ - .long QEI0_IRQHandler /* 84 */ - .long QEI1_IRQHandler /* 85 */ - .long ECAP0_IRQHandler /* 86 */ - .long ECAP1_IRQHandler /* 87 */ - .long GPH_IRQHandler /* 88 */ - .long EINT7_IRQHandler /* 89 */ - .long Default_Handler /* 90 */ - .long Default_Handler /* 91 */ - .long Default_Handler /* 92 */ - .long Default_Handler /* 93 */ - .long Default_Handler /* 94 */ - .long Default_Handler /* 95 */ - .long Default_Handler /* 96 */ - .long Default_Handler /* 97 */ - .long PDMA1_IRQHandler /* 98 */ - .long SCU_IRQHandler /* 99 */ - .long LCD_IRQHandler /* 100 */ - .long TRNG_IRQHandler /* 101 */ - .long Default_Handler /* 102 */ - .long Default_Handler /* 103 */ - .long Default_Handler /* 104 */ - .long Default_Handler /* 105 */ - .long Default_Handler /* 106 */ - .long Default_Handler /* 107 */ - .long Default_Handler /* 108 */ - .long KS_IRQHandler /* 109 */ - .long TAMPER_IRQHandler /* 110 */ - .long EWDT_IRQHandler /* 111 */ - .long EWWDT_IRQHandler /* 112 */ - .long NS_ISP_IRQHandler /* 113 */ - .long TMR4_IRQHandler /* 114 */ - .long TMR5_IRQHandler /* 115 */ - - .end diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/IAR/startup_M2354.s b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/IAR/startup_M2354.s deleted file mode 100644 index fe0b86da107..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/IAR/startup_M2354.s +++ /dev/null @@ -1,504 +0,0 @@ -/****************************************************************************//** - * @file startup_M2354.s - * @version V1.00 - * @brief CMSIS Device Startup File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) ;; 8 bytes alignment - - SECTION .intvec:CODE:NOROOT(2);; 4 bytes alignment - - EXTERN SystemInit - EXTERN __iar_program_start - PUBLIC __vector_table - PUBLIC g_pfnVectors - - DATA -g_pfnVectors -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler - DCD HardFault_Handler - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD SVC_Handler - DCD 0 - DCD 0 - DCD PendSV_Handler - DCD SysTick_Handler - - ; External Interrupts - ; maximum of 32 External Interrupts are possible - DCD BOD_IRQHandler ; 0 - DCD IRC_IRQHandler ; 1 - DCD PWRWU_IRQHandler ; 2 - DCD SRAM_IRQHandler ; 3 - DCD CLKFAIL_IRQHandler ; 4 - DCD DEFAULT_IRQHandler ; 5 - DCD RTC_IRQHandler ; 6 - DCD RTC_TAMPER_IRQHandler ; 7 - DCD WDT_IRQHandler ; 8 - DCD WWDT_IRQHandler ; 9 - DCD EINT0_IRQHandler ; 10 - DCD EINT1_IRQHandler ; 11 - DCD EINT2_IRQHandler ; 12 - DCD EINT3_IRQHandler ; 13 - DCD EINT4_IRQHandler ; 14 - DCD EINT5_IRQHandler ; 15 - DCD GPA_IRQHandler ; 16 - DCD GPB_IRQHandler ; 17 - DCD GPC_IRQHandler ; 18 - DCD GPD_IRQHandler ; 19 - DCD GPE_IRQHandler ; 20 - DCD GPF_IRQHandler ; 21 - DCD QSPI0_IRQHandler ; 22 - DCD SPI0_IRQHandler ; 23 - DCD BRAKE0_IRQHandler ; 24 - DCD EPWM0_P0_IRQHandler ; 25 - DCD EPWM0_P1_IRQHandler ; 26 - DCD EPWM0_P2_IRQHandler ; 27 - DCD BRAKE1_IRQHandler ; 28 - DCD EPWM1_P0_IRQHandler ; 29 - DCD EPWM1_P1_IRQHandler ; 30 - DCD EPWM1_P2_IRQHandler ; 31 - DCD TMR0_IRQHandler ; 32 - DCD TMR1_IRQHandler ; 33 - DCD TMR2_IRQHandler ; 34 - DCD TMR3_IRQHandler ; 35 - DCD UART0_IRQHandler ; 36 - DCD UART1_IRQHandler ; 37 - DCD I2C0_IRQHandler ; 38 - DCD I2C1_IRQHandler ; 39 - DCD PDMA0_IRQHandler ; 40 - DCD DAC_IRQHandler ; 41 - DCD EADC0_IRQHandler ; 42 - DCD EADC1_IRQHandler ; 43 - DCD ACMP01_IRQHandler ; 44 - DCD DEFAULT_IRQHandler ; 45 - DCD EADC2_IRQHandler ; 46 - DCD EADC3_IRQHandler ; 47 - DCD UART2_IRQHandler ; 48 - DCD UART3_IRQHandler ; 49 - DCD DEFAULT_IRQHandler ; 50 - DCD SPI1_IRQHandler ; 51 - DCD SPI2_IRQHandler ; 52 - DCD USBD_IRQHandler ; 53 - DCD USBH_IRQHandler ; 54 - DCD USBOTG_IRQHandler ; 55 - DCD CAN0_IRQHandler ; 56 - DCD DEFAULT_IRQHandler ; 57 - DCD SC0_IRQHandler ; 58 - DCD SC1_IRQHandler ; 59 - DCD SC2_IRQHandler ; 60 - DCD DEFAULT_IRQHandler ; 61 - DCD SPI3_IRQHandler ; 62 - DCD DEFAULT_IRQHandler ; 63 - DCD SDH0_IRQHandler ; 64 - DCD DEFAULT_IRQHandler ; 65 - DCD DEFAULT_IRQHandler ; 66 - DCD DEFAULT_IRQHandler ; 67 - DCD I2S0_IRQHandler ; 68 - DCD DEFAULT_IRQHandler ; 69 - DCD OPA0_IRQHandler ; 70 - DCD CRPT_IRQHandler ; 71 - DCD GPG_IRQHandler ; 72 - DCD EINT6_IRQHandler ; 73 - DCD UART4_IRQHandler ; 74 - DCD UART5_IRQHandler ; 75 - DCD USCI0_IRQHandler ; 76 - DCD USCI1_IRQHandler ; 77 - DCD BPWM0_IRQHandler ; 78 - DCD BPWM1_IRQHandler ; 79 - DCD DEFAULT_IRQHandler ; 80 - DCD DEFAULT_IRQHandler ; 81 - DCD I2C2_IRQHandler ; 82 - DCD DEFAULT_IRQHandler ; 83 - DCD QEI0_IRQHandler ; 84 - DCD QEI1_IRQHandler ; 85 - DCD ECAP0_IRQHandler ; 86 - DCD ECAP1_IRQHandler ; 87 - DCD GPH_IRQHandler ; 88 - DCD EINT7_IRQHandler ; 89 - DCD SDH1_IRQHandler ; 90 - DCD DEFAULT_IRQHandler ; 91 - DCD DEFAULT_IRQHandler ; 92 - DCD DEFAULT_IRQHandler ; 93 - DCD DEFAULT_IRQHandler ; 94 - DCD DEFAULT_IRQHandler ; 95 - DCD DEFAULT_IRQHandler ; 96 - DCD DEFAULT_IRQHandler ; 97 - DCD PDMA1_IRQHandler ; 98 - DCD SCU_IRQHandler ; 99 - DCD LCD_IRQHandler ; 100 - DCD TRNG_IRQHandler ; 101 - DCD DEFAULT_IRQHandler ; 102 - DCD DEFAULT_IRQHandler ; 103 - DCD DEFAULT_IRQHandler ; 104 - DCD DEFAULT_IRQHandler ; 105 - DCD DEFAULT_IRQHandler ; 106 - DCD DEFAULT_IRQHandler ; 107 - DCD DEFAULT_IRQHandler ; 108 - DCD KS_IRQHandler ; 109 - DCD TAMPER_IRQHandler ; 110 - DCD EWDT_IRQHandler ; 111 - DCD EWWDT_IRQHandler ; 112 - DCD NS_ISP_IRQHandler ; 113 - DCD TMR4_IRQHandler ; 114 - DCD TMR5_IRQHandler ; 115 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - PUBWEAK Reset_Handler - SECTION .text:CODE:NOROOT:REORDER(2) ; 4 bytes alignment -Reset_Handler - - ; Check SecureWorld - MOV R0, R15 - LSLS R0, R0, #3 - BMI.N GotoSystemInit - - ; Unlock Register - LDR R0, =0x40000100 - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - ; power gating - ; M32(0x400001f4) = 0xfffffffful; - LDR R0, =0x400001f4 - LDR R1, =0xffffffff - STR R1, [R0] - - ; M32(0x400000dC) = 0ul; - LDR R0, =0x400000dC - LDR R1, =0x0 - STR R1, [R0] - - ; Enable GPIO clks, SRAM clks, Trace clk - ; CLK->AHBCLK |= (0xffful << 20) | (1ul << 14); - - LDR R0, =0x40000200 ; R0 = Clock Controller Register Base Address - LDR R1, [R0,#0x4] ; R1 = 0x40000204 (AHBCLK) - - LDR R2, =0xfff02000 - - ORRS R1, R1, R2 ; (0xffful << 20) | (1ul << 14); - STR R1, [R0,#0x4] ; CLK->AHBCLK |= (0xffful << 20) | (1ul << 14); ; - -GotoSystemInit: - LDR R0, =SystemInit - BLX R0 - - ; Lock register - LDR R0, =0x40000100 - MOVS R1, #0 - STR R1, [R0] - - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK HardFault_Handler - PUBWEAK NMI_Handler - PUBWEAK SVC_Handler - PUBWEAK PendSV_Handler - PUBWEAK SysTick_Handler - - PUBWEAK BOD_IRQHandler ; 0 - PUBWEAK IRC_IRQHandler ; 1 - PUBWEAK PWRWU_IRQHandler ; 2 - PUBWEAK SRAM_IRQHandler ; 3 - PUBWEAK CLKFAIL_IRQHandler ; 4 - ;PUBWEAK 0 ; 5 - PUBWEAK RTC_IRQHandler ; 6 - PUBWEAK RTC_TAMPER_IRQHandler ; 7 - PUBWEAK WDT_IRQHandler ; 8 - PUBWEAK WWDT_IRQHandler ; 9 - PUBWEAK EINT0_IRQHandler ; 10 - PUBWEAK EINT1_IRQHandler ; 11 - PUBWEAK EINT2_IRQHandler ; 12 - PUBWEAK EINT3_IRQHandler ; 13 - PUBWEAK EINT4_IRQHandler ; 14 - PUBWEAK EINT5_IRQHandler ; 15 - PUBWEAK GPA_IRQHandler ; 16 - PUBWEAK GPB_IRQHandler ; 17 - PUBWEAK GPC_IRQHandler ; 18 - PUBWEAK GPD_IRQHandler ; 19 - PUBWEAK GPE_IRQHandler ; 20 - PUBWEAK GPF_IRQHandler ; 21 - PUBWEAK QSPI0_IRQHandler ; 22 - PUBWEAK SPI0_IRQHandler ; 23 - PUBWEAK BRAKE0_IRQHandler ; 24 - PUBWEAK EPWM0_P0_IRQHandler ; 25 - PUBWEAK EPWM0_P1_IRQHandler ; 26 - PUBWEAK EPWM0_P2_IRQHandler ; 27 - PUBWEAK BRAKE1_IRQHandler ; 28 - PUBWEAK EPWM1_P0_IRQHandler ; 29 - PUBWEAK EPWM1_P1_IRQHandler ; 30 - PUBWEAK EPWM1_P2_IRQHandler ; 31 - PUBWEAK TMR0_IRQHandler ; 32 - PUBWEAK TMR1_IRQHandler ; 33 - PUBWEAK TMR2_IRQHandler ; 34 - PUBWEAK TMR3_IRQHandler ; 35 - PUBWEAK UART0_IRQHandler ; 36 - PUBWEAK UART1_IRQHandler ; 37 - PUBWEAK I2C0_IRQHandler ; 38 - PUBWEAK I2C1_IRQHandler ; 39 - PUBWEAK PDMA0_IRQHandler ; 40 - PUBWEAK DAC_IRQHandler ; 41 - PUBWEAK EADC0_IRQHandler ; 42 - PUBWEAK EADC1_IRQHandler ; 43 - PUBWEAK ACMP01_IRQHandler ; 44 - ;PUBWEAK 0 ; 45 - PUBWEAK EADC2_IRQHandler ; 46 - PUBWEAK EADC3_IRQHandler ; 47 - PUBWEAK UART2_IRQHandler ; 48 - PUBWEAK UART3_IRQHandler ; 49 - ;PUBWEAK 0 ; 50 - PUBWEAK SPI1_IRQHandler ; 51 - PUBWEAK SPI2_IRQHandler ; 52 - PUBWEAK USBD_IRQHandler ; 53 - PUBWEAK USBH_IRQHandler ; 54 - PUBWEAK USBOTG_IRQHandler ; 55 - PUBWEAK CAN0_IRQHandler ; 56 - PUBWEAK CAN1_IRQHandler ; 57 - PUBWEAK SC0_IRQHandler ; 58 - PUBWEAK SC1_IRQHandler ; 59 - PUBWEAK SC2_IRQHandler ; 60 - PUBWEAK SC3_IRQHandler ; 61 - PUBWEAK SPI3_IRQHandler ; 62 - ;PUBWEAK 0 ; 63 - PUBWEAK SDH0_IRQHandler ; 64 - ;PUBWEAK 0 ; 65 - ;PUBWEAK 0 ; 66 - ;PUBWEAK 0 ; 67 - PUBWEAK I2S0_IRQHandler ; 68 - ;PUBWEAK 0 ; 69 - PUBWEAK OPA0_IRQHandler ; 70 - PUBWEAK CRPT_IRQHandler ; 71 - PUBWEAK GPG_IRQHandler ; 72 - PUBWEAK EINT6_IRQHandler ; 73 - PUBWEAK UART4_IRQHandler ; 74 - PUBWEAK UART5_IRQHandler ; 75 - PUBWEAK USCI0_IRQHandler ; 76 - PUBWEAK USCI1_IRQHandler ; 77 - PUBWEAK BPWM0_IRQHandler ; 78 - PUBWEAK BPWM1_IRQHandler ; 79 - ;PUBWEAK 0 ; 80 - ;PUBWEAK 0 ; 81 - PUBWEAK I2C2_IRQHandler ; 82 - ;PUBWEAK 0 ; 83 - PUBWEAK QEI0_IRQHandler ; 84 - PUBWEAK QEI1_IRQHandler ; 85 - PUBWEAK ECAP0_IRQHandler ; 86 - PUBWEAK ECAP1_IRQHandler ; 87 - PUBWEAK GPH_IRQHandler ; 88 - PUBWEAK EINT7_IRQHandler ; 89 - PUBWEAK SDH1_IRQHandler ; 90 - ;PUBWEAK 0 ; 91 - ;PUBWEAK USBH_IRQHandler ; 92 - ;PUBWEAK 0 ; 93 - ;PUBWEAK 0 ; 94 - ;PUBWEAK 0 ; 95 - ;PUBWEAK 0 ; 96 - ;PUBWEAK 0 ; 97 - PUBWEAK PDMA1_IRQHandler ; 98 - PUBWEAK SCU_IRQHandler ; 99 - PUBWEAK LCD_IRQHandler ; 100 - PUBWEAK TRNG_IRQHandler ; 101 - ;PUBWEAK 0 ; 102 - ;PUBWEAK 0 ; 103 - ;PUBWEAK 0 ; 104 - ;PUBWEAK 0 ; 105 - ;PUBWEAK 0 ; 106 - ;PUBWEAK 0 ; 107 - ;PUBWEAK 0 ; 108 - PUBWEAK KS_IRQHandler ; 109 - PUBWEAK TAMPER_IRQHandler ; 110 - PUBWEAK EWDT_IRQHandler ; 111 - PUBWEAK EWWDT_IRQHandler ; 112 - PUBWEAK NS_ISP_IRQHandler ; 113 - PUBWEAK TMR4_IRQHandler ; 114 - PUBWEAK TMR5_IRQHandler ; 115 - - PUBWEAK DEFAULT_IRQHandler - - SECTION .text:CODE:NOROOT:REORDER(2) - -HardFault_Handler -NMI_Handler -SVC_Handler -PendSV_Handler -SysTick_Handler - -BOD_IRQHandler ; 0 -IRC_IRQHandler ; 1 -PWRWU_IRQHandler ; 2 -SRAM_IRQHandler ; 3 -CLKFAIL_IRQHandler ; 4 -;0 ; 5 -RTC_IRQHandler ; 6 -RTC_TAMPER_IRQHandler ; 7 -WDT_IRQHandler ; 8 -WWDT_IRQHandler ; 9 -EINT0_IRQHandler ; 10 -EINT1_IRQHandler ; 11 -EINT2_IRQHandler ; 12 -EINT3_IRQHandler ; 13 -EINT4_IRQHandler ; 14 -EINT5_IRQHandler ; 15 -GPA_IRQHandler ; 16 -GPB_IRQHandler ; 17 -GPC_IRQHandler ; 18 -GPD_IRQHandler ; 19 -GPE_IRQHandler ; 20 -GPF_IRQHandler ; 21 -QSPI0_IRQHandler ; 22 -SPI0_IRQHandler ; 23 -BRAKE0_IRQHandler ; 24 -EPWM0_P0_IRQHandler ; 25 -EPWM0_P1_IRQHandler ; 26 -EPWM0_P2_IRQHandler ; 27 -BRAKE1_IRQHandler ; 28 -EPWM1_P0_IRQHandler ; 29 -EPWM1_P1_IRQHandler ; 30 -EPWM1_P2_IRQHandler ; 31 -TMR0_IRQHandler ; 32 -TMR1_IRQHandler ; 33 -TMR2_IRQHandler ; 34 -TMR3_IRQHandler ; 35 -UART0_IRQHandler ; 36 -UART1_IRQHandler ; 37 -I2C0_IRQHandler ; 38 -I2C1_IRQHandler ; 39 -PDMA0_IRQHandler ; 40 -DAC_IRQHandler ; 41 -EADC0_IRQHandler ; 42 -EADC1_IRQHandler ; 43 -ACMP01_IRQHandler ; 44 -;0 ; 45 -EADC2_IRQHandler ; 46 -EADC3_IRQHandler ; 47 -UART2_IRQHandler ; 48 -UART3_IRQHandler ; 49 -;0 ; 50 -SPI1_IRQHandler ; 51 -SPI2_IRQHandler ; 52 -USBD_IRQHandler ; 53 -USBH_IRQHandler ; 54 -USBOTG_IRQHandler ; 55 -CAN0_IRQHandler ; 56 -CAN1_IRQHandler ; 57 -SC0_IRQHandler ; 58 -SC1_IRQHandler ; 59 -SC2_IRQHandler ; 60 -SC3_IRQHandler ; 61 -SPI3_IRQHandler ; 62 -;0 ; 63 -SDH0_IRQHandler ; 64 -;0 ; 65 -;0 ; 66 -;0 ; 67 -I2S0_IRQHandler ; 68 -;0 ; 69 -OPA0_IRQHandler ; 70 -CRPT_IRQHandler ; 71 -GPG_IRQHandler ; 72 -EINT6_IRQHandler ; 73 -UART4_IRQHandler ; 74 -UART5_IRQHandler ; 75 -USCI0_IRQHandler ; 76 -USCI1_IRQHandler ; 77 -BPWM0_IRQHandler ; 78 -BPWM1_IRQHandler ; 79 -;0 ; 80 -;0 ; 81 -I2C2_IRQHandler ; 82 -;0 ; 83 -QEI0_IRQHandler ; 84 -QEI1_IRQHandler ; 85 -ECAP0_IRQHandler ; 86 -ECAP1_IRQHandler ; 87 -GPH_IRQHandler ; 88 -EINT7_IRQHandler ; 89 -SDH1_IRQHandler ; 90 -;0 ; 91 -;USBH_IRQHandler ; 92 -;0 ; 93 -;0 ; 94 -;0 ; 95 -;0 ; 96 -;0 ; 97 -PDMA1_IRQHandler ; 98 -SCU_IRQHandler ; 99 -LCD_IRQHandler ; 100 -TRNG_IRQHandler ; 101 -;0 ; 102 -;0 ; 103 -;0 ; 104 -;0 ; 105 -;0 ; 106 -;0 ; 107 -;0 ; 108 -KS_IRQHandler ; 109 -TAMPER_IRQHandler ; 110 -EWDT_IRQHandler ; 111 -EWWDT_IRQHandler ; 112 -NS_ISP_IRQHandler ; 113 -TMR4_IRQHandler ; 114 -TMR5_IRQHandler ; 115 -DEFAULT_IRQHandler - B DEFAULT_IRQHandler - - -;void SH_ICE(void) - PUBLIC SH_ICE -SH_ICE - CMP R2,#0 - BEQ SH_End - STR R0,[R2] ; Save the return value to *pn32Out_R0 - -;void SH_End(void) - PUBLIC SH_End -SH_End - MOVS R0,#1 ; Set return value to 1 - BX lr ; Return - - -;int32_t SH_DoCommand(int32_t n32In_R0, int32_t n32In_R1, int32_t *pn32Out_R0) - PUBLIC SH_DoCommand -SH_DoCommand - BKPT 0xAB ; This instruction will cause ICE trap or system HardFault - B SH_ICE -SH_HardFault ; Captured by HardFault - MOVS R0,#0 ; Set return value to 0 - BX lr ; Return - - - PUBLIC __PC -__PC - MOV r0, lr - BLX lr - - END - diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/system_M2354.c b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/system_M2354.c deleted file mode 100644 index 4f69903830e..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Source/system_M2354.c +++ /dev/null @@ -1,567 +0,0 @@ -/**************************************************************************//** - * @file system_M2354.c - * @version V2.00 - * @brief System Setting Source File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler 6 */ -#include -#endif - -#include -#include -#include "NuMicro.h" - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#include "nu_partition_M2354.h" -#endif -extern void *g_pfnVectors; /* see startup file */ - - -/*---------------------------------------------------------------------------- - Clock Variable definitions - *----------------------------------------------------------------------------*/ -uint32_t SystemCoreClock = __HSI; /*!< System Clock Frequency (Core Clock) */ -uint32_t CyclesPerUs = (__HSI / 1000000UL);/*!< Cycles per micro second */ -uint32_t PllClock = __HSI; /*!< PLL Output Clock Frequency */ - -void FMC_NSBA_Setup(void); -void SCU_Setup(void); -void NSC_Init(void); -void TZ_SAU_Setup(void); - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -extern void SCU_IRQHandler(void); -#else -extern void SCU_IRQHandler(void)__attribute__((noreturn)); -#endif - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - -/** - * @brief Setup Non-secure boundary - * - * @details This function is used to set Non-secure boundary according to - * the configuration of partition header file - */ -void FMC_NSBA_Setup(void) -{ - /* Skip NSBA Setupt according config */ - if(FMC_INIT_NSBA == 0) - return; - - /* Check if NSBA value with current active NSBA */ - if(SCU->FNSADDR != FMC_SECURE_ROM_SIZE) - { - /* Unlock Protected Register */ - SYS_UnlockReg(); - - /* Enable ISP and config update */ - FMC->ISPCTL = FMC_ISPCTL_ISPEN_Msk | FMC_ISPCTL_CFGUEN_Msk; - - /* Config Base of NSBA */ - FMC->ISPADDR = FMC_NSCBA_BASE ; - - /* Read Non-secure base address config */ - FMC->ISPCMD = FMC_ISPCMD_READ; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC->ISPTRG); - - //while(PA0); - - /* Setting NSBA when it is empty */ - if(FMC->ISPDAT != 0xfffffffful) - { - /* Erase old setting */ - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC->ISPTRG); - } - - /* Set new base */ - FMC->ISPDAT = FMC_SECURE_ROM_SIZE; - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC->ISPTRG); - - /* Force Chip Reset to valid new setting */ - SYS->IPRST0 = SYS_IPRST0_CHIPRST_Msk; - - - } - -} - - -/** - \brief Setup SCU Configuration Unit - \details - - */ -void SCU_Setup(void) -{ - int32_t i; - - SCU->PNSSET[0] = SCU_INIT_PNSSET0_VAL; - SCU->PNSSET[1] = SCU_INIT_PNSSET1_VAL; - SCU->PNSSET[2] = SCU_INIT_PNSSET2_VAL; - SCU->PNSSET[3] = SCU_INIT_PNSSET3_VAL; - SCU->PNSSET[4] = SCU_INIT_PNSSET4_VAL; - SCU->PNSSET[5] = SCU_INIT_PNSSET5_VAL; - SCU->PNSSET[6] = SCU_INIT_PNSSET6_VAL; - - - SCU->IONSSET[0] = SCU_INIT_IONSSET0_VAL; - SCU->IONSSET[1] = SCU_INIT_IONSSET1_VAL; - SCU->IONSSET[2] = SCU_INIT_IONSSET2_VAL; - SCU->IONSSET[3] = SCU_INIT_IONSSET3_VAL; - SCU->IONSSET[4] = SCU_INIT_IONSSET4_VAL; - SCU->IONSSET[5] = SCU_INIT_IONSSET5_VAL; - SCU->IONSSET[6] = SCU_INIT_IONSSET6_VAL; - SCU->IONSSET[7] = SCU_INIT_IONSSET7_VAL; - - /* Set Non-secure SRAM */ - for(i = 15; i >= SCU_SECURE_SRAM_SIZE / 16384; i--) - { - SCU->SRAMNSSET |= (1U << i); - } - - /* Set interrupt to non-secure according to PNNSET settings */ - if(SCU_INIT_PNSSET0_VAL & BIT9) NVIC->ITNS[1] |= BIT22; /* Int of USBH_INT */ - if(SCU_INIT_PNSSET0_VAL & BIT13) NVIC->ITNS[2] |= BIT0 ; /* Int of SDHOST0_INT */ - if(SCU_INIT_PNSSET0_VAL & BIT24) NVIC->ITNS[3] |= BIT2 ; /* Int of PDMA1_INT */ - if(SCU_INIT_PNSSET1_VAL & BIT18) NVIC->ITNS[2] |= BIT7 ; /* Int of CRYPTO */ - if(SCU_INIT_PNSSET2_VAL & BIT2) NVIC->ITNS[3] |= BIT15; /* Int of EWDT_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT2) NVIC->ITNS[3] |= BIT16; /* Int of EWWDT_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT3) NVIC->ITNS[1] |= BIT10; /* Int of EADC0_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT3) NVIC->ITNS[1] |= BIT11; /* Int of EADC1_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT3) NVIC->ITNS[1] |= BIT14; /* Int of EADC2_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT3) NVIC->ITNS[1] |= BIT15; /* Int of EADC3_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT5) NVIC->ITNS[1] |= BIT12; /* Int of ACMP01_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT7) NVIC->ITNS[1] |= BIT9 ; /* Int of DAC_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT8) NVIC->ITNS[2] |= BIT4 ; /* Int of I2S0_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT13) NVIC->ITNS[1] |= BIT23; /* Int of USBOTG_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT17) NVIC->ITNS[1] |= BIT2 ; /* Int of TMR2_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT17) NVIC->ITNS[1] |= BIT3 ; /* Int of TMR3_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT18) NVIC->ITNS[3] |= BIT18; /* Int of TMR4_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT18) NVIC->ITNS[3] |= BIT19; /* Int of TMR5_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT24) NVIC->ITNS[0] |= BIT25; /* Int of EPWM0_P0_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT24) NVIC->ITNS[0] |= BIT26; /* Int of EPWM0_P1_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT24) NVIC->ITNS[0] |= BIT27; /* Int of EPWM0_P2_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT25) NVIC->ITNS[0] |= BIT29; /* Int of EPWM1_P0_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT25) NVIC->ITNS[0] |= BIT30; /* Int of EPWM1_P1_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT25) NVIC->ITNS[0] |= BIT31; /* Int of EPWM1_P2_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT26) NVIC->ITNS[2] |= BIT14; /* Int of BPWM0_INT */ - if(SCU_INIT_PNSSET2_VAL & BIT27) NVIC->ITNS[2] |= BIT15; /* Int of BPWM1_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT0) NVIC->ITNS[0] |= BIT22; /* Int of QSPI0_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT1) NVIC->ITNS[0] |= BIT23; /* Int of SPI0_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT2) NVIC->ITNS[1] |= BIT19; /* Int of SPI1_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT3) NVIC->ITNS[1] |= BIT20; /* Int of SPI2_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT4) NVIC->ITNS[1] |= BIT30; /* Int of SPI3_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT16) NVIC->ITNS[1] |= BIT4 ; /* Int of UART0_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT17) NVIC->ITNS[1] |= BIT5 ; /* Int of UART1_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT18) NVIC->ITNS[1] |= BIT16; /* Int of UART2_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT19) NVIC->ITNS[1] |= BIT17; /* Int of UART3_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT20) NVIC->ITNS[2] |= BIT10; /* Int of UART4_INT */ - if(SCU_INIT_PNSSET3_VAL & BIT21) NVIC->ITNS[2] |= BIT11; /* Int of UART5_INT */ - if(SCU_INIT_PNSSET4_VAL & BIT0) NVIC->ITNS[1] |= BIT6 ; /* Int of I2C0_INT */ - if(SCU_INIT_PNSSET4_VAL & BIT1) NVIC->ITNS[1] |= BIT7 ; /* Int of I2C1_INT */ - if(SCU_INIT_PNSSET4_VAL & BIT2) NVIC->ITNS[2] |= BIT18; /* Int of I2C2_INT */ - if(SCU_INIT_PNSSET4_VAL & BIT16) NVIC->ITNS[1] |= BIT26; /* Int of SC0_INT */ - if(SCU_INIT_PNSSET4_VAL & BIT17) NVIC->ITNS[1] |= BIT27; /* Int of SC1_INT */ - if(SCU_INIT_PNSSET4_VAL & BIT18) NVIC->ITNS[1] |= BIT28; /* Int of SC2_INT */ - if(SCU_INIT_PNSSET5_VAL & BIT0) NVIC->ITNS[1] |= BIT24; /* Int of CAN0_INT */ - if(SCU_INIT_PNSSET5_VAL & BIT16) NVIC->ITNS[2] |= BIT20; /* Int of QEI0_INT */ - if(SCU_INIT_PNSSET5_VAL & BIT17) NVIC->ITNS[2] |= BIT21; /* Int of QEI1_INT */ - if(SCU_INIT_PNSSET5_VAL & BIT20) NVIC->ITNS[2] |= BIT22; /* Int of ECAP0_INT */ - if(SCU_INIT_PNSSET5_VAL & BIT21) NVIC->ITNS[2] |= BIT23; /* Int of ECAP1_INT */ - if(SCU_INIT_PNSSET5_VAL & BIT25) NVIC->ITNS[3] |= BIT5 ; /* Int of TRNG_INT */ - if(SCU_INIT_PNSSET5_VAL & BIT27) NVIC->ITNS[3] |= BIT4 ; /* Int of LCD_INT */ - if(SCU_INIT_PNSSET6_VAL & BIT0) NVIC->ITNS[1] |= BIT21; /* Int of USBD_INT */ - if(SCU_INIT_PNSSET6_VAL & BIT16) NVIC->ITNS[2] |= BIT12; /* Int of USCI0_INT */ - if(SCU_INIT_PNSSET6_VAL & BIT17) NVIC->ITNS[2] |= BIT13; /* Int of USCI1_INT */ - if(SCU_INIT_IONSSET_VAL & BIT0) NVIC->ITNS[0] |= BIT16; /* Int of PA */ - if(SCU_INIT_IONSSET_VAL & BIT1) NVIC->ITNS[0] |= BIT17; /* Int of PB */ - if(SCU_INIT_IONSSET_VAL & BIT2) NVIC->ITNS[0] |= BIT18; /* Int of PC */ - if(SCU_INIT_IONSSET_VAL & BIT3) NVIC->ITNS[0] |= BIT19; /* Int of PD */ - if(SCU_INIT_IONSSET_VAL & BIT4) NVIC->ITNS[0] |= BIT20; /* Int of PE */ - if(SCU_INIT_IONSSET_VAL & BIT5) NVIC->ITNS[0] |= BIT21; /* Int of PF */ - if(SCU_INIT_IONSSET_VAL & BIT6) NVIC->ITNS[2] |= BIT8 ; /* Int of PG */ - if(SCU_INIT_IONSSET_VAL & BIT7) NVIC->ITNS[2] |= BIT24; /* Int of PH */ - if(SCU_INIT_IONSSET_VAL & BIT8) NVIC->ITNS[0] |= BIT10; /* Int of EINT0 */ - if(SCU_INIT_IONSSET_VAL & BIT9) NVIC->ITNS[0] |= BIT11; /* Int of EINT1 */ - if(SCU_INIT_IONSSET_VAL & BIT10) NVIC->ITNS[0] |= BIT12; /* Int of EINT2 */ - if(SCU_INIT_IONSSET_VAL & BIT11) NVIC->ITNS[0] |= BIT13; /* Int of EINT3 */ - if(SCU_INIT_IONSSET_VAL & BIT12) NVIC->ITNS[0] |= BIT14; /* Int of EINT4 */ - if(SCU_INIT_IONSSET_VAL & BIT13) NVIC->ITNS[0] |= BIT15; /* Int of EINT5 */ - if(SCU_INIT_IONSSET_VAL & BIT14) NVIC->ITNS[2] |= BIT9; /* Int of EINT6 */ - if(SCU_INIT_IONSSET_VAL & BIT15) NVIC->ITNS[2] |= BIT25; /* Int of EINT7 */ - - /* Enable SCU Int status */ - SCU->SVIOIEN = (uint32_t)(-1); - SCU->PVIOIEN = (uint32_t)(-1); - NVIC_EnableIRQ(SCU_IRQn); - -} - - -#if defined( __ICCARM__ ) -__WEAK -#else -__attribute__((weak)) -#endif -void SCU_IRQHandler(void) -{ - char const *master[] = {"CPU", 0, 0, "PDMA0", "SDH0", "CRPT", "USBH", 0, 0, 0, 0, "PDMA1"}; - char const *ipname[] = {"APB0", "APB1", 0, 0, "GPIO", "EBI", "USBH", "CRC", "SDH0", 0, "PDMA0", "PDMA1" - , "SRAM0", "SRAM1", "FMC", "FLASH", "SCU", "SYS", "CRPT", "KS", "SIORAM" - }; - const uint8_t info[] = {0x34, 0x3C, 0, 0, 0x44, 0x4C, 0x54, 0x5C, 0x64, 0, 0x74, 0x7C, 0x84, 0x8C, 0x94, 0x9C, 0xA4, 0xAC, 0xB4, 0xBC, 0xC4}; - uint32_t u32Reg, u32Addr; - uint32_t i; - - /* TrustZone access policy */ - u32Reg = SCU->SVINTSTS; - if(u32Reg) - { - - /* Get violation address and source */ - for(i = 0; i < sizeof(ipname); i++) - { - if(u32Reg & (1 << i)) - { - u32Addr = M32(SCU_BASE + info[i] + 4); - printf(" %s(0x%08x) Alarm! illegal access by %s\n", ipname[i], u32Addr, master[M32(SCU_BASE + info[i])]); - SCU->SVINTSTS = (1 << i); - break; - } - - } - } - - /* Privilege */ - u32Reg = SCU->PVINTSTS; - if(u32Reg) - { - /* Get violation address and source */ - for(i = 0; i < sizeof(ipname); i++) - { - if(u32Reg & (1 << i)) - { - printf("\n%s Alarm! Caused by unprivilege access\n\n", ipname[i]); - SCU->PVINTSTS = (1 << i); - break; - } - } - } - -} - - -/** - \brief Setup a Nonsecure callable Region - \details The base and limit of Nonsecure callable region is dependent on the - application code size. - */ -void NSC_Init(void) -{ - uint32_t u32Region; - uint32_t u32Base, u32Limit; - -#if defined (__ICCARM__) -# pragma section = "NSC" - u32Base = (uint32_t)__section_begin("NSC"); - u32Limit = (uint32_t)__section_end("NSC"); -#elif defined(__ARMCC_VERSION) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" - extern uint32_t Image$$NSC_ROM$$XO$$Base[]; - extern uint32_t Image$$NSC_ROM$$XO$$Limit[]; - u32Base = (uint32_t)Image$$NSC_ROM$$XO$$Base; - u32Limit = (uint32_t)Image$$NSC_ROM$$XO$$Limit; -#pragma clang diagnostic pop -#else - extern uint32_t __start_NSC[]; - extern uint32_t __end_NSC[]; - u32Base = (uint32_t)__start_NSC; - u32Limit = (uint32_t)__end_NSC; -#endif - - /* SAU region 3 is dedicated for NSC */ - u32Region = 3; - SAU->RNR = (u32Region & SAU_RNR_REGION_Msk); - SAU->RBAR = (u32Base & SAU_RBAR_BADDR_Msk); - SAU->RLAR = (u32Limit & SAU_RLAR_LADDR_Msk) | - ((1ul << SAU_RLAR_NSC_Pos) & SAU_RLAR_NSC_Msk) | 1ul; - -} - -/** - \brief Setup a SAU Region - \details Writes the region information contained in SAU_Region to the - registers SAU_RNR, SAU_RBAR, and SAU_RLAR - */ -void TZ_SAU_Setup(void) -{ - -#if defined (__SAU_PRESENT) && (__SAU_PRESENT == 1U) - -#if defined (SAU_INIT_REGION0) && (SAU_INIT_REGION0 == 1U) - SAU_INIT_REGION(0); -#endif - -#if defined (SAU_INIT_REGION1) && (SAU_INIT_REGION1 == 1U) - SAU_INIT_REGION(1); -#endif - -#if defined (SAU_INIT_REGION2) && (SAU_INIT_REGION2 == 1U) - SAU_INIT_REGION(2); -#endif - -#if defined (SAU_INIT_REGION3) && (SAU_INIT_REGION3 == 1U) - SAU_INIT_REGION(3); -#endif - -#if defined (SAU_INIT_REGION4) && (SAU_INIT_REGION4 == 1U) - SAU_INIT_REGION(4); -#endif - -#if defined (SAU_INIT_REGION5) && (SAU_INIT_REGION5 == 1U) - SAU_INIT_REGION(5); -#endif - -#if defined (SAU_INIT_REGION6) && (SAU_INIT_REGION6 == 1U) - SAU_INIT_REGION(6); -#endif - -#if defined (SAU_INIT_REGION7) && (SAU_INIT_REGION7 == 1U) - SAU_INIT_REGION(7); -#endif - - /* repeat this for all possible SAU regions */ - - -#if defined (SAU_INIT_CTRL) && (SAU_INIT_CTRL == 1U) - SAU->CTRL = ((SAU_INIT_CTRL_ENABLE << SAU_CTRL_ENABLE_Pos) & SAU_CTRL_ENABLE_Msk) | - ((SAU_INIT_CTRL_ALLNS << SAU_CTRL_ALLNS_Pos) & SAU_CTRL_ALLNS_Msk) ; -#endif - -#endif /* defined (__SAU_PRESENT) && (__SAU_PRESENT == 1U) */ - -#if defined (SCB_CSR_AIRCR_INIT) && (SCB_CSR_AIRCR_INIT == 1U) - SCB->SCR = (SCB->SCR & ~(SCB_SCR_SLEEPDEEPS_Msk)) | - ((SCB_CSR_DEEPSLEEPS_VAL << SCB_SCR_SLEEPDEEPS_Pos) & SCB_SCR_SLEEPDEEPS_Msk); - - SCB->AIRCR = (0x05FA << 16) | - ((SCB_AIRCR_SYSRESETREQS_VAL << SCB_AIRCR_SYSRESETREQS_Pos) & SCB_AIRCR_SYSRESETREQS_Msk) | - ((SCB_AIRCR_BFHFNMINS_VAL << SCB_AIRCR_BFHFNMINS_Pos) & SCB_AIRCR_BFHFNMINS_Msk) | - ((SCB_AIRCR_PRIS_VAL << SCB_AIRCR_PRIS_Pos) & SCB_AIRCR_PRIS_Msk); - - - -#endif /* defined (SCB_CSR_AIRCR_INIT) && (SCB_CSR_AIRCR_INIT == 1U) */ - -#if defined (SCB_ICSR_INIT) && (SCB_ICSR_INIT == 1U) - SCB->ICSR = (SCB->ICSR & ~(SCB_ICSR_STTNS_Msk)) | - ((SCB_ICSR_STTNS_VAL << SCB_ICSR_STTNS_Pos) & SCB_ICSR_STTNS_Msk); -#endif /* defined (SCB_ICSR_INIT) && (SCB_ICSR_INIT == 1U) */ - - /* repeat this for all possible ITNS elements */ - - /* Initial Nonsecure callable region */ - NSC_Init(); -} -#else -#if defined( __ICCARM__ ) -__WEAK -#else -__attribute__((weak)) -#endif -void SCU_IRQHandler(void) -{ - while(1); -} -#endif - - -/** - * @brief Update the Variable SystemCoreClock - * - * @details This function is used to update the variable SystemCoreClock - * and must be called whenever the core clock is changed. - */ -void SystemCoreClockUpdate(void) -{ - /* Update PLL Clock */ - PllClock = CLK_GetPLLClockFreq(); - - /* Update System Core Clock */ - SystemCoreClock = CLK_GetCPUFreq(); - - /* Update Cycles per micro second */ - CyclesPerUs = (SystemCoreClock + 500000UL) / 1000000UL; -} - - - -/** - * @brief System Initialization - * - * @details The necessary initialization of system. Global variables are forbidden here. - */ -void SystemInit(void) -{ -#if 0 -/* Move the scope into Reset_Handler to avoid invalid memory access. */ -/* When push LR to RAM region is not enabled, it will get hardware after exit SystemInit.*/ - if((__PC() & NS_OFFSET) == 0) - { - /* Unlock protected registers */ - do - { - SYS->REGLCTL = 0x59; - SYS->REGLCTL = 0x16; - SYS->REGLCTL = 0x88; - } - while(!SYS->REGLCTL); - - /* Enable Crypto power switch */ - SYS->PSWCTL = SYS_PSWCTL_CRPTPWREN_Msk; - - /* Enable all GPIO, SRAM and Trace clock */ - CLK->AHBCLK |= (0xffful << 20) | (1ul << 14); - } -#endif - -#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) - SCB->VTOR = (uint32_t) &g_pfnVectors; -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3) - TZ_SAU_Setup(); - SCU_Setup(); - FMC_NSBA_Setup(); -#endif - -#ifdef INIT_SYSCLK_AT_BOOTING - -#endif - -} - - -#if USE_ASSERT - -/** - * @brief Assert Error Message - * - * @param[in] file the source file name - * @param[in] line line number - * - * @details The function prints the source file name and line number where - * the ASSERT_PARAM() error occurs, and then stops in an infinite loop. - */ -void AssertError(uint8_t * file, uint32_t line) -{ - - printf("[%s] line %d : wrong parameters.\r\n", file, line); - - /* Infinite loop */ - while(1) ; -} -#endif - - -#if (defined(__ICCARM__) && (__VER__ >= 7080000) && (__VER__ < 8020000)) - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -uint32_t __TZ_get_PSP_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psp_ns" : "=r"(result)); - return(result); -} - - -/** - \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 - */ -void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp_ns, %0" : : "r"(topOfProcStack)); -} - - - -/** - \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 - */ -int32_t __TZ_get_MSP_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msp_ns" : "=r"(result)); - return(result); -} - - - -/** - \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 - */ -void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp_ns, %0" : : "r"(topOfMainStack)); -} - - - -/** - \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 - */ -uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, primask_ns" : "=r"(result)); - return(result); -} - - - -/** - \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 - */ -void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile("MSR primask_ns, %0" : : "r"(priMask) : "memory"); -} - - -#endif - - -#endif - - - diff --git a/bsp/nuvoton/libraries/m2354/Device/SConscript b/bsp/nuvoton/libraries/m2354/Device/SConscript deleted file mode 100644 index 39a6e290722..00000000000 --- a/bsp/nuvoton/libraries/m2354/Device/SConscript +++ /dev/null @@ -1,25 +0,0 @@ -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(""" -Nuvoton/M2354/Source/system_M2354.c -""") - -# add for startup script -if rtconfig.PLATFORM in ['gcc']: - src = src + ['Nuvoton/M2354/Source/GCC/startup_M2354.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src = src + ['Nuvoton/M2354/Source/ARM/startup_M2354.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src = src + ['Nuvoton/M2354/Source/IAR/startup_M2354.s'] - -path = [cwd + '/Nuvoton/M2354/Include',] - -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/SConscript b/bsp/nuvoton/libraries/m2354/StdDriver/SConscript deleted file mode 100644 index b8c471cad1a..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/SConscript +++ /dev/null @@ -1,28 +0,0 @@ -# RT-Thread building script for component -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -libs = [] -src = Glob('*src/*.c') + Glob('src/*.cpp') -cpppath = [cwd + '/inc'] -libpath = [cwd + '/lib'] - -if not GetDepend('BSP_USE_STDDRIVER_SOURCE'): - if rtconfig.PLATFORM in ['armcc', 'armclang']: - if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'): - libs += ['libstddriver_keil'] - elif GetOption('target') == 'mdk4' and os.path.isfile('./lib/libstddriver_keil4.lib'): - libs += ['libstddriver_keil4'] - elif rtconfig.PLATFORM in ['gcc'] and os.path.isfile('./lib/libstddriver_gcc.a'): - libs += ['libstddriver_gcc'] - elif os.path.isfile('./lib/libstddriver_iar.a'): - libs += ['libstddriver_iar'] - -if not libs: - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath) -else: - src = [] - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath) - -Return('group') diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_acmp.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_acmp.h deleted file mode 100644 index 234e98145d4..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_acmp.h +++ /dev/null @@ -1,382 +0,0 @@ -/**************************************************************************//** - * @file nu_acmp.h - * @version V3.00 - * @brief ACMP Driver Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_ACMP_H__ -#define __NU_ACMP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_CONSTANTS ACMP Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_CTL_FILTSEL_OFF (0UL << 13) /*!< ACMP_CTL setting for filter function disabled. */ -#define ACMP_CTL_FILTSEL_1PCLK (1UL << 13) /*!< ACMP_CTL setting for 1 PCLK filter count. */ -#define ACMP_CTL_FILTSEL_2PCLK (2UL << 13) /*!< ACMP_CTL setting for 2 PCLK filter count. */ -#define ACMP_CTL_FILTSEL_4PCLK (3UL << 13) /*!< ACMP_CTL setting for 4 PCLK filter count. */ -#define ACMP_CTL_FILTSEL_8PCLK (4UL << 13) /*!< ACMP_CTL setting for 8 PCLK filter count. */ -#define ACMP_CTL_FILTSEL_16PCLK (5UL << 13) /*!< ACMP_CTL setting for 16 PCLK filter count. */ -#define ACMP_CTL_FILTSEL_32PCLK (6UL << 13) /*!< ACMP_CTL setting for 32 PCLK filter count. */ -#define ACMP_CTL_FILTSEL_64PCLK (7UL << 13) /*!< ACMP_CTL setting for 64 PCLK filter count. */ -#define ACMP_CTL_INTPOL_RF (0UL << 8) /*!< ACMP_CTL setting for selecting rising edge and falling edge as interrupt condition. */ -#define ACMP_CTL_INTPOL_R (1UL << 8) /*!< ACMP_CTL setting for selecting rising edge as interrupt condition. */ -#define ACMP_CTL_INTPOL_F (2UL << 8) /*!< ACMP_CTL setting for selecting falling edge as interrupt condition. */ -#define ACMP_CTL_POSSEL_P0 (0UL << 6) /*!< ACMP_CTL setting for selecting ACMPx_P0 pin as the source of ACMP V+. */ -#define ACMP_CTL_POSSEL_P1 (1UL << 6) /*!< ACMP_CTL setting for selecting ACMPx_P1 pin as the source of ACMP V+. */ -#define ACMP_CTL_POSSEL_P2 (2UL << 6) /*!< ACMP_CTL setting for selecting ACMPx_P2 pin as the source of ACMP V+. */ -#define ACMP_CTL_POSSEL_P3 (3UL << 6) /*!< ACMP_CTL setting for selecting ACMPx_P3 pin as the source of ACMP V+. */ -#define ACMP_CTL_NEGSEL_PIN (0UL << 4) /*!< ACMP_CTL setting for selecting the voltage of ACMP negative input pin as the source of ACMP V-. */ -#define ACMP_CTL_NEGSEL_CRV (1UL << 4) /*!< ACMP_CTL setting for selecting internal comparator reference voltage as the source of ACMP V-. */ -#define ACMP_CTL_NEGSEL_VBG (2UL << 4) /*!< ACMP_CTL setting for selecting internal Band-gap voltage as the source of ACMP V-. */ -#define ACMP_CTL_NEGSEL_DAC (3UL << 4) /*!< ACMP_CTL setting for selecting DAC output voltage as the source of ACMP V-. */ -#define ACMP_CTL_HYSTERESIS_30MV (3UL << 24) /*!< ACMP_CTL setting for enabling the hysteresis function at 30mV. */ -#define ACMP_CTL_HYSTERESIS_20MV (2UL << 24) /*!< ACMP_CTL setting for enabling the hysteresis function at 20mV. */ -#define ACMP_CTL_HYSTERESIS_10MV (1UL << 24) /*!< ACMP_CTL setting for enabling the hysteresis function at 10mV. */ -#define ACMP_CTL_HYSTERESIS_DISABLE (0UL << 2) /*!< ACMP_CTL setting for disabling the hysteresis function. */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_VREF constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_VREF_CRVSSEL_VDDA (0UL << 6) /*!< ACMP_VREF setting for selecting analog supply voltage VDDA as the CRV source voltage */ -#define ACMP_VREF_CRVSSEL_INTVREF (1UL << 6) /*!< ACMP_VREF setting for selecting internal reference voltage as the CRV source voltage */ - - -/**@}*/ /* end of group ACMP_EXPORTED_CONSTANTS */ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPOINV bit of ACMP_CTL register to enable output inverse function. - */ -#define ACMP_ENABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to disable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPOINV bit of ACMP_CTL register to disable output inverse function. - */ -#define ACMP_DISABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to select ACMP negative input source - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Src is comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * - \ref ACMP_CTL_NEGSEL_DAC - * @return None - * @details This macro will set NEGSEL (ACMP_CTL[5:4]) to determine the source of negative input. - */ -#define ACMP_SET_NEG_SRC(acmp, u32ChNum, u32Src) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_NEGSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to enable hysteresis function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - */ -#define ACMP_ENABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_HYSTERESIS_30MV) - -/** - * @brief This macro is used to disable hysteresis function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set HYSSEL of ACMP_CTL register to disable hysteresis function. - */ -#define ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_HYSSEL_Msk) - -/** - * @brief This macro is used to select hysteresis level - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32HysSel The hysteresis function option. Including: - * - \ref ACMP_CTL_HYSTERESIS_30MV - * - \ref ACMP_CTL_HYSTERESIS_20MV - * - \ref ACMP_CTL_HYSTERESIS_10MV - * - \ref ACMP_CTL_HYSTERESIS_DISABLE - * @return None - */ -#define ACMP_CONFIG_HYSTERESIS(acmp, u32ChNum, u32HysSel) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_HYSSEL_Msk) | (u32HysSel)) - -/** - * @brief This macro is used to enable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPIE bit of ACMP_CTL register to enable interrupt function. - * If wake-up function is enabled, the wake-up interrupt will be enabled as well. - */ -#define ACMP_ENABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to disable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPIE bit of ACMP_CTL register to disable interrupt function. - */ -#define ACMP_DISABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to enable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPEN bit of ACMP_CTL register to enable analog comparator. - */ -#define ACMP_ENABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to disable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - */ -#define ACMP_DISABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to get ACMP output value - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP output value - * @details This macro will return the ACMP output value. - */ -#define ACMP_GET_OUTPUT(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPO0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to get ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP interrupt occurred (1) or not (0) - * @details This macro will return the ACMP interrupt flag. - */ -#define ACMP_GET_INT_FLAG(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to clear ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to ACMPIFn bit of ACMP_STATUS register to clear interrupt flag. - */ -#define ACMP_CLR_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to clear ACMP wake-up interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to WKIFn bit of ACMP_STATUS register to clear interrupt flag. - */ -#define ACMP_CLR_WAKEUP_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_WKIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to enable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WKEN (ACMP_CTL[16]) to enable ACMP wake-up function. - */ -#define ACMP_ENABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WKEN (ACMP_CTL[16]) to disable ACMP wake-up function. - */ -#define ACMP_DISABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to select ACMP positive input pin - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Pin Comparator positive pin selection. Including: - * - \ref ACMP_CTL_POSSEL_P0 - * - \ref ACMP_CTL_POSSEL_P1 - * - \ref ACMP_CTL_POSSEL_P2 - * - \ref ACMP_CTL_POSSEL_P3 - * @return None - * @details This macro will set POSSEL (ACMP_CTL[7:6]) to determine the comparator positive input pin. - */ -#define ACMP_SELECT_P(acmp, u32ChNum, u32Pin) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_POSSEL_Msk) | (u32Pin)) - -/** - * @brief This macro is used to enable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set OUTSEL (ACMP_CTL[12]) to enable output filter function. - */ -#define ACMP_ENABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to disable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear OUTSEL (ACMP_CTL[12]) to disable output filter function. - */ -#define ACMP_DISABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to set ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cnt is comparator filter count setting. - * - \ref ACMP_CTL_FILTSEL_OFF - * - \ref ACMP_CTL_FILTSEL_1PCLK - * - \ref ACMP_CTL_FILTSEL_2PCLK - * - \ref ACMP_CTL_FILTSEL_4PCLK - * - \ref ACMP_CTL_FILTSEL_8PCLK - * - \ref ACMP_CTL_FILTSEL_16PCLK - * - \ref ACMP_CTL_FILTSEL_32PCLK - * - \ref ACMP_CTL_FILTSEL_64PCLK - * @return None - * @details When ACMP output filter function is enabled, the output sampling count is determined by FILTSEL (ACMP_CTL[15:13]). - */ -#define ACMP_SET_FILTER(acmp, u32ChNum, u32Cnt) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_FILTSEL_Msk) | (u32Cnt)) - -/** - * @brief This macro is used to select comparator reference voltage - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32Level The comparator reference voltage setting. - * The formula is: - * comparator reference voltage = CRV source voltage x (1/6 + u32Level/24) - * The range of u32Level is 0 ~ 15. - * @return None - * @details When CRV is selected as ACMP negative input source, the CRV level is determined by CRVCTL (ACMP_VREF[3:0]). - */ -#define ACMP_CRV_SEL(acmp, u32Level) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRVCTL_Msk) | ((u32Level)<VREF = ((acmp)->VREF & ~ACMP_VREF_CRVSSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to select ACMP interrupt condition - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cond Comparator interrupt condition selection. Including: - * - \ref ACMP_CTL_INTPOL_RF - * - \ref ACMP_CTL_INTPOL_R - * - \ref ACMP_CTL_INTPOL_F - * @return None - * @details The ACMP output interrupt condition can be rising edge, falling edge or any edge. - */ -#define ACMP_SELECT_INT_COND(acmp, u32ChNum, u32Cond) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_INTPOL_Msk) | (u32Cond)) - -/** - * @brief This macro is used to enable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WLATEN (ACMP_CTL[17]) to enable ACMP window latch mode. - * When ACMP0/1_WLAT pin is at high level, ACMPO0/1 passes through window latch - * block; when ACMP0/1_WLAT pin is at low level, the output of window latch block, - * WLATOUT, is frozen. - */ -#define ACMP_ENABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to disable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WLATEN (ACMP_CTL[17]) to disable ACMP window latch mode. - */ -#define ACMP_DISABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to enable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WCMPSEL (ACMP_CTL[18]) to enable ACMP window compare mode. - * When window compare mode is enabled, user can connect the specific analog voltage - * source to either the positive inputs of both comparators or the negative inputs of - * both comparators. The upper bound and lower bound of the designated range are - * determined by the voltages applied to the other inputs of both comparators. If the - * output of a comparator is low and the other comparator outputs high, which means two - * comparators implies the upper and lower bound. User can directly monitor a specific - * analog voltage source via ACMPWO (ACMP_STATUS[16]). - */ -#define ACMP_ENABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WCMPSEL_Msk) - -/** - * @brief This macro is used to disable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WCMPSEL (ACMP_CTL[18]) to disable ACMP window compare mode. - */ -#define ACMP_DISABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WCMPSEL_Msk) - - - - -/* Function prototype declaration */ -void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel); -void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum); - - -/**@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ -/**@}*/ /* end of group ACMP_Driver */ -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_ACMP_H__ */ - - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_bpwm.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_bpwm.h deleted file mode 100644 index 7708a437597..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_bpwm.h +++ /dev/null @@ -1,360 +0,0 @@ -/**************************************************************************//** - * @file nu_bpwm.h - * @version V1.00 - * @brief M2354 series BPWM driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_BPWM_H__ -#define __NU_BPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - -/** @addtogroup BPWM_EXPORTED_CONSTANTS BPWM Exported Constants - @{ -*/ -#define BPWM_CHANNEL_NUM (6UL) /*!< BPWM channel number */ -#define BPWM_CH_0_MASK (0x1UL) /*!< BPWM channel 0 mask \hideinitializer */ -#define BPWM_CH_1_MASK (0x2UL) /*!< BPWM channel 1 mask \hideinitializer */ -#define BPWM_CH_2_MASK (0x4UL) /*!< BPWM channel 2 mask \hideinitializer */ -#define BPWM_CH_3_MASK (0x8UL) /*!< BPWM channel 3 mask \hideinitializer */ -#define BPWM_CH_4_MASK (0x10UL) /*!< BPWM channel 4 mask \hideinitializer */ -#define BPWM_CH_5_MASK (0x20UL) /*!< BPWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_UP_COUNTER (0UL) /*!< Up counter type */ -#define BPWM_DOWN_COUNTER (1UL) /*!< Down counter type */ -#define BPWM_UP_DOWN_COUNTER (2UL) /*!< Up-Down counter type */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_EDGE_ALIGNED (1UL) /*!< BPWM working in edge aligned type(down count) */ -#define BPWM_CENTER_ALIGNED (2UL) /*!< BPWM working in center aligned type */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_OUTPUT_NOTHING (0UL) /*!< BPWM output nothing */ -#define BPWM_OUTPUT_LOW (1UL) /*!< BPWM output low */ -#define BPWM_OUTPUT_HIGH (2UL) /*!< BPWM output high */ -#define BPWM_OUTPUT_TOGGLE (3UL) /*!< BPWM output toggle */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_SSCTL_SSRC_PWM0 (0UL<SSCTL = ((bpwm)->SSCTL & ~BPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_DISABLE_TIMER_SYNC(bpwm, u32ChannelMask) ((bpwm)->SSCTL &= ~BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief This macro enable BPWM counter synchronous start counting function. - * @param[in] bpwm The pointer of the specified BPWM module - * @return None - * @details This macro is used to make selected BPWM0 and BPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by BPWM_ENABLE_TIMER_SYNC() and BPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define BPWM_TRIGGER_SYNC_START(bpwm) ((bpwm)->SSTRG = BPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * \hideinitializer - */ -#define BPWM_ENABLE_OUTPUT_INVERTER(bpwm, u32ChannelMask) ((bpwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_RISING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_FALLING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define BPWM_MASK_OUTPUT(bpwm, u32ChannelMask, u32LevelMask) \ - { \ - (bpwm)->MSKEN = (u32ChannelMask); \ - (bpwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 1 ~ 0xFFF - * @return None - * \hideinitializer - */ -#define BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescaler) ((bpwm)->CLKPSC = (u32Prescaler)) - -/** - * @brief This macro set the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Duty of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * \hideinitializer - */ -#define BPWM_SET_CMR(bpwm, u32ChannelNum, u32CMR) ((bpwm)->CMPDAT[(u32ChannelNum)] = (u32CMR)) - -/** - * @brief This macro get the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return Return the comparator of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the comparator of specified channel. - * \hideinitializer - */ -#define BPWM_GET_CMR(bpwm, u32ChannelNum) ((bpwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * @note BPWM counter will stop if period length set to 0 - * \hideinitializer - */ -#define BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR) ((bpwm)->PERIOD = (u32CNR)) - -/** - * @brief This macro get the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * \hideinitializer - */ -#define BPWM_GET_CNR(bpwm, u32ChannelNum) ((bpwm)->PERIOD) - -/** - * @brief This macro set the BPWM aligned type - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @param[in] u32AlignedType BPWM aligned type, valid values are: - * - \ref BPWM_EDGE_ALIGNED - * - \ref BPWM_CENTER_ALIGNED - * @return None - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_SET_ALIGNED_TYPE(bpwm, u32ChannelMask, u32AlignedType) ((bpwm)->CTL1 = (u32AlignedType)) - -/** - * @brief Clear counter of channel 0 - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to clear counter of channel 0 - * \hideinitializer - */ -#define BPWM_CLR_COUNTER(bpwm, u32ChannelMask) ((bpwm)->CNTCLR = (BPWM_CNTCLR_CNTCLR0_Msk)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * \hideinitializer - */ -#define BPWM_SET_OUTPUT_LEVEL(bpwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - uint32_t i; \ - for(i = 0UL; i < 6UL; i++) { \ - if((u32ChannelMask) & (1UL << i)) { \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (i << 1))) | ((u32ZeroLevel) << (i << 1))); \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (BPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))) | ((u32PeriodLevel) << (BPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (i << 1))) | ((u32CmpUpLevel) << (i << 1))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (BPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))) | ((u32CmpDownLevel) << (BPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))); \ - } \ - } \ - }while(0) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define BPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); - -/**@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group BPWM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_BPWM_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_can.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_can.h deleted file mode 100644 index 32ee78023ea..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_can.h +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************//** - * @file nu_can.h - * @version V3.00 - * @brief CAN Driver Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CAN_H__ -#define __NU_CAN_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CAN_Driver CAN Driver - @{ -*/ - -/** @addtogroup CAN_EXPORTED_CONSTANTS CAN Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* CAN Test Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAN_NORMAL_MODE 0U /*!< CAN select normal mode */ -#define CAN_BASIC_MODE 1U /*!< CAN select basic mode */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Message ID Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAN_STD_ID 0UL /*!< CAN select standard ID */ -#define CAN_EXT_ID 1UL /*!< CAN select extended ID */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Message Frame Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAN_REMOTE_FRAME 0 /*!< CAN frame select remote frame */ -#define CAN_DATA_FRAME 1 /*!< CAN frame select data frame */ - -/**@}*/ /* end of group CAN_EXPORTED_CONSTANTS */ - - -/** @addtogroup CAN_EXPORTED_STRUCTS CAN Exported Structs - @{ -*/ -/** - * @details CAN message structure - */ -typedef struct -{ - uint32_t IdType; /*!< ID type */ - uint32_t FrameType; /*!< Frame type */ - uint32_t Id; /*!< Message ID */ - uint8_t DLC; /*!< Data length */ - uint8_t Data[8]; /*!< Data */ - uint8_t padding[3]; /*!< Just for padding for memory alignment*/ -} STR_CANMSG_T; - -/** - * @details CAN mask message structure - */ -typedef struct -{ - uint8_t u8Xtd; /*!< Extended ID */ - uint8_t u8Dir; /*!< Direction */ - uint32_t u32Id; /*!< Message ID */ - uint8_t u8IdType; /*!< ID type*/ -} STR_CANMASK_T; - -/**@}*/ /* end of group CAN_EXPORTED_STRUCTS */ - -/** @cond HIDDEN_SYMBOLS */ -#define MSG(id) (id) -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup CAN_EXPORTED_FUNCTIONS CAN Exported Functions - @{ -*/ - -/** - * @brief Get interrupt status. - * - * @param[in] can The base address of can module. - * - * @return CAN module status register value. - * - * @details Status Interrupt is generated by bits BOff (CAN_STATUS[7]), EWarn (CAN_STATUS[6]), - * EPass (CAN_STATUS[5]), RxOk (CAN_STATUS[4]), TxOk (CAN_STATUS[3]), and LEC (CAN_STATUS[2:0]). - */ -#define CAN_GET_INT_STATUS(can) ((can)->STATUS) - -/** - * @brief Get specified interrupt pending status. - * - * @param[in] can The base address of can module. - * - * @return The source of the interrupt. - * - * @details If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt - * with the highest priority, disregarding their chronological order. - */ -#define CAN_GET_INT_PENDING_STATUS(can) ((can)->IIDR) - -/** - * @brief Disable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details The macro is used to disable wake-up function. - */ -#define CAN_DISABLE_WAKEUP(can) ((can)->WU_EN = 0) - -/** - * @brief Enable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details User can wake-up system when there is a falling edge in the CAN_Rx pin. - */ -#define CAN_ENABLE_WAKEUP(can) ((can)->WU_EN = CAN_WU_EN_WAKUP_EN_Msk) - -/** - * @brief Get specified Message Object new data into bit value. - * - * @param[in] can The base address of can module. - * @param[in] u32MsgNum Specified Message Object number, valid value are from 0 to 31. - * - * @return Specified Message Object new data into bit value. - * - * @details The NewDat bit (CAN_IFn_MCON[15]) of a specific Message Object can be set/reset by the software through the IFn Message Interface Registers - * or by the Message Handler after reception of a Data Frame or after a successful transmission. - */ -#define CAN_GET_NEW_DATA_IN_BIT(can, u32MsgNum) ((u32MsgNum) < 16 ? (can)->NDAT1 & (1 << (u32MsgNum)) : (can)->NDAT2 & (1 << ((u32MsgNum)-16))) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define CAN functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate); -void CAN_Close(CAN_T *tCAN); -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode); -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum); -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask); -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask); -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg); -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg); -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask); -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg); -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum); -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask); -void CAN_LeaveInitMode(CAN_T *tCAN); -void CAN_WaitMsg(CAN_T *tCAN); -uint32_t CAN_GetCANBitRate(CAN_T *tCAN); -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask); -void CAN_LeaveTestMode(CAN_T *tCAN); -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj); -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg); -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg); -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast); -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast); -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T* pCanMsg); - - -/**@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CAN_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CAN_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_clk.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_clk.h deleted file mode 100644 index ff9fd8b262d..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_clk.h +++ /dev/null @@ -1,1070 +0,0 @@ -/**************************************************************************//** - * @file nu_clk.h - * @version V3.0 - * @brief Clock Controller (CLK) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CLK_H__ -#define __NU_CLK_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_CONSTANTS CLK Exported Constants - @{ -*/ - - -#define FREQ_2MHZ 2000000UL -#define FREQ_4MHZ 4000000UL -#define FREQ_8MHZ 8000000UL -#define FREQ_12MHZ 12000000UL -#define FREQ_24MHZ 24000000UL -#define FREQ_25MHZ 25000000UL -#define FREQ_48MHZ 48000000UL -#define FREQ_50MHZ 50000000UL -#define FREQ_64MHZ 64000000UL -#define FREQ_75MHZ 75000000UL -#define FREQ_84MHZ 84000000UL -#define FREQ_96MHZ 96000000UL -#define FREQ_144MHZ 144000000UL -#define FREQ_200MHZ 200000000UL - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL0 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL0_HCLKSEL_HXT (0x00UL<>30) & 0x3UL) /*!< Calculate AHBCLK/APBCLK offset on MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 */ -#define MODULE_CLKSEL(x) (((x) >>28) & 0x3UL) /*!< Calculate CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3 */ -#define MODULE_CLKSEL_Msk(x) (((x) >>25) & 0x7UL) /*!< Calculate CLKSEL mask offset on MODULE index */ -#define MODULE_CLKSEL_Pos(x) (((x) >>20) & 0x1fUL) /*!< Calculate CLKSEL position offset on MODULE index */ -#define MODULE_CLKDIV(x) (((x) >>18) & 0x3UL) /*!< Calculate APBCLK CLKDIV on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x4:CLKDIV4 */ -#define MODULE_CLKDIV_Msk(x) (((x) >>10) & 0xffUL) /*!< Calculate CLKDIV mask offset on MODULE index */ -#define MODULE_CLKDIV_Pos(x) (((x) >>5 ) & 0x1fUL) /*!< Calculate CLKDIV position offset on MODULE index */ -#define MODULE_IP_EN_Pos(x) (((x) >>0 ) & 0x1fUL) /*!< Calculate APBCLK offset on MODULE index */ -#define MODULE_NoMsk 0x0UL /*!< Not mask on MODULE index */ -#define NA MODULE_NoMsk /*!< Not Available */ - -#define MODULE_APBCLK_ENC(x) (((x) & 0x03UL) << 30) /*!< MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 */ -#define MODULE_CLKSEL_ENC(x) (((x) & 0x03UL) << 28) /*!< CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3 */ -#define MODULE_CLKSEL_Msk_ENC(x) (((x) & 0x07UL) << 25) /*!< CLKSEL mask offset on MODULE index */ -#define MODULE_CLKSEL_Pos_ENC(x) (((x) & 0x1fUL) << 20) /*!< CLKSEL position offset on MODULE index */ -#define MODULE_CLKDIV_ENC(x) (((x) & 0x03UL) << 18) /*!< APBCLK CLKDIV on MODULE index, 0x0:CLKDIV, 0x1:CLKDIV1, 0x4:CLKDIV4 */ -#define MODULE_CLKDIV_Msk_ENC(x) (((x) & 0xffUL) << 10) /*!< CLKDIV mask offset on MODULE index */ -#define MODULE_CLKDIV_Pos_ENC(x) (((x) & 0x1fUL) << 5) /*!< CLKDIV position offset on MODULE index */ -#define MODULE_IP_EN_Pos_ENC(x) (((x) & 0x1fUL) << 0) /*!< AHBCLK/APBCLK offset on MODULE index */ - - -/* AHBCLK */ -#define PDMA0_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_PDMA0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< PDMA Module */ - -#define PDMA1_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_PDMA1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< PDMA Module */ - -#define ISP_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_ISPCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ISP Module */ - -#define EBI_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_EBICKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EBI Module */ - -#define EXST_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_EXSTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EXST Module */ - -#define SDH0_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_SDH0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0xFFUL)|MODULE_CLKDIV_Pos_ENC(24UL))/*!< SDH0 Module */ - -#define CRC_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_CRCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CRC Module */ - -#define CRPT_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_CRPTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CRPT Module */ - -#define KS_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_KSCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< KS Module */ - -#define TRACE_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_TRACECKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TRACE Module */ - -#define FMCIDLE_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_FMCIDLE_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< FMCIDLE Module */ - -#define USBH_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_USBHCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0xFUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< USBH Module */ - -#define SRAM0_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_SRAM0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SRAM0 Module */ - -#define SRAM1_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_SRAM1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SRAM1 Module */ - -#define SRAM2_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_SRAM2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SRAM2 Module */ - -#define GPA_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPACKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPA Module */ - -#define GPB_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPBCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPB Module */ - -#define GPC_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPC Module */ - -#define GPD_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPDCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPD Module */ - -#define GPE_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPECKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPE Module */ - -#define GPF_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPFCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPF Module */ - -#define GPG_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPGCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPG Module */ - -#define GPH_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK_GPHCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPH Module */ - -/* APBCLK0 */ -#define WDT_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_WDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 0UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< WDT Module */ - -#define WWDT_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_WDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(30UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< WWDT Module */ - -#define RTC_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_RTCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC( NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< RTC Module */ - -#define TMR0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR0 Module */ - -#define TMR1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR1 Module */ - -#define TMR2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR2 Module */ - -#define TMR3_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR3CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR3 Module */ - -#define TMR4_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_TMR4CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(8UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR4 Module */ - -#define TMR5_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_TMR5CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR5 Module */ - -#define CLKO_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_CLKOCKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC(3UL)|MODULE_CLKSEL_Pos_ENC(28UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< CLKO Module */ - -#define ACMP01_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_ACMP01CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ACMP01 Module */ - -#define I2C0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2C0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C0 Module */ - -#define I2C1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2C1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C1 Module */ - -#define I2C2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2C2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C2 Module */ - -#define QSPI0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_QSPI0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 2UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< QSPI0 Module */ - -#define SPI0_MODULE (MODULE_APBCLK_ENC(1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_SPI0CKEN_Pos) |\ - MODULE_CLKSEL_ENC(2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 4UL)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< SPI0 Module */ - -#define SPI1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_SPI1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 6UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< SPI1 Module */ - -#define SPI2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_SPI2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(10UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< SPI2 Module */ - -#define UART0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< UART0 Module */ - -#define UART1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(12UL)) /*!< UART1 Module */ - -#define UART2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(24UL)|\ - MODULE_CLKDIV_ENC( 3UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 0UL)) /*!< UART2 Module */ - -#define UART3_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART3CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(28UL)|\ - MODULE_CLKDIV_ENC( 3UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< UART3 Module */ - -#define UART4_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART4CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(24UL)|\ - MODULE_CLKDIV_ENC( 3UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< UART4 Module */ - -#define UART5_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART5CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(28UL)|\ - MODULE_CLKDIV_ENC( 3UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(12UL)) /*!< UART5 Module */ - -#define TAMPER_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TAMPERCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC( NA)|MODULE_CLKSEL_Pos_ENC( NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TAMPER Module */ - -#define CAN0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_CAN0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CAN0 Module */ - -#define OTG_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_OTGCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< OTG Module */ - -#define USBD_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_USBDCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(4UL)) /*!< USBD Module */ - -#define EADC_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_EADCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC( NA)|MODULE_CLKSEL_Pos_ENC( NA)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0xFFUL)|MODULE_CLKDIV_Pos_ENC(16UL)) /*!< EADC Module */ - -#define I2S0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2S0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< I2S0 Module */ - -#define EWDT_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_EWDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 4UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< EWDT Module */ - -#define EWWDT_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_EWDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 6UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EWWDT Module */ - - -/* APBCLK1 */ -#define SC0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SC0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 0UL)|\ - MODULE_CLKDIV_ENC( 1UL)|MODULE_CLKDIV_Msk_ENC(0xFFUL)|MODULE_CLKDIV_Pos_ENC( 0UL)) /*!< SC0 Module */ - -#define SC1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SC1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 2UL)|\ - MODULE_CLKDIV_ENC( 1UL)|MODULE_CLKDIV_Msk_ENC(0xFFUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< SC1 Module */ - -#define SC2_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SC2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 4UL)|\ - MODULE_CLKDIV_ENC( 1UL)|MODULE_CLKDIV_Msk_ENC(0xFFUL)|MODULE_CLKDIV_Pos_ENC(16UL)) /*!< SC2 Module */ - -#define SPI3_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SPI3CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI3 Module */ - -#define USCI0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_USCI0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< USCI0 Module */ - -#define USCI1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_USCI1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< USCI1 Module */ - -#define DAC_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_DACCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< DAC Module */ - -#define EPWM0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EPWM0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EPWM0 Module */ - -#define EPWM1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EPWM1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EPWM1 Module */ - -#define BPWM0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_BPWM0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< BPWM0 Module */ - -#define BPWM1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_BPWM1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< BPWM1 Module */ - -#define QEI0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_QEI0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< QEI0 Module */ - -#define QEI1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_QEI1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< QEI1 Module */ - -#define LCD_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_LCDCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC(1UL)|MODULE_CLKSEL_Pos_ENC(2UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< LCD Module */ - -#define LCDCP_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_LCDCPCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC(1UL)|MODULE_CLKSEL_Pos_ENC(3UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< LCDCP Module */ - -#define TRNG_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_TRNGCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TRNG Module */ - -#define ECAP0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_ECAP0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ECAP0 Module */ - -#define ECAP1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_ECAP1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ECAP1 Module */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* PDMSEL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PMUCTL_PDMSEL_PD (0x0UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select Power-down mode is Power-down mode */ -#define CLK_PMUCTL_PDMSEL_LLPD (0x1UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select Power-down mode is Low leakage Power-down mode */ -#define CLK_PMUCTL_PDMSEL_FWPD (0x2UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select Power-down mode is Fast Wake-up Power-down mode */ -#define CLK_PMUCTL_PDMSEL_ULLPD (0x3UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select Power-down mode is Ultra Low leakage Power-down mode */ -#define CLK_PMUCTL_PDMSEL_SPD (0x4UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select Power-down mode is Standby Power-down mode */ -#define CLK_PMUCTL_PDMSEL_DPD (0x6UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select Power-down mode is Deep Power-down mode */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WKTMRIS constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PMUCTL_WKTMRIS_410 (0x0UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 410 LIRC clocks (12.8 ms) */ -#define CLK_PMUCTL_WKTMRIS_819 (0x1UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 819 LIRC clocks (25.6 ms) */ -#define CLK_PMUCTL_WKTMRIS_1638 (0x2UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 1638 LIRC clocks (51.2 ms) */ -#define CLK_PMUCTL_WKTMRIS_3277 (0x3UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 3277 LIRC clocks (102.4ms) */ -#define CLK_PMUCTL_WKTMRIS_13107 (0x4UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 13107 LIRC clocks (409.6ms) */ -#define CLK_PMUCTL_WKTMRIS_26214 (0x5UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 26214 LIRC clocks (819.2ms) */ -#define CLK_PMUCTL_WKTMRIS_52429 (0x6UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 52429 LIRC clocks (1638.4ms) */ -#define CLK_PMUCTL_WKTMRIS_209715 (0x7UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 209715 LIRC clocks (6553.6ms) */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SWKDBCLKSEL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_SWKDBCTL_SWKDBCLKSEL_1 (0x0UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 1 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_2 (0x1UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 2 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_4 (0x2UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 4 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_8 (0x3UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 8 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_16 (0x4UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 16 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_32 (0x5UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 32 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_64 (0x6UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 64 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_128 (0x7UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 128 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_256 (0x8UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 256 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_2x256 (0x9UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 2x256 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_4x256 (0xaUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 4x256 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_8x256 (0xbUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 8x256 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_16x256 (0xcUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 16x256 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_32x256 (0xdUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 32x256 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_64x256 (0xeUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 64x256 clocks */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_128x256 (0xfUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 128x256 clocks */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* DPD Pin Rising/Falling Edge Wake-up Enable constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_DPDWKPIN_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Disable Wake-up pin (GPC.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN_RISING (0x1UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin (GPC.0) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN_FALLING (0x2UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin (GPC.0) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin (GPC.0) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN0_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Disable Wake-up pin0 (GPC.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_RISING (0x1UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin0 (GPC.0) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_FALLING (0x2UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin0 (GPC.0) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin0 (GPC.0) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN1_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Disable Wake-up pin1 (GPB.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_RISING (0x1UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_FALLING (0x2UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN2_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Disable Wake-up pin2 (GPB.2) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_RISING (0x1UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_FALLING (0x2UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN3_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Disable Wake-up pin3 (GPB.12) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_RISING (0x1UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_FALLING (0x2UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN4_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Disable Wake-up pin4 (GPF.6) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_RISING (0x1UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_FALLING (0x2UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) both edge at Deep Power-down mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SPD Pin Rising/Falling Edge Wake-up Enable constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_SPDWKPIN_ENABLE (0x1UL << 0) /*!< Enable Standby Power-down Pin Wake-up */ -#define CLK_SPDWKPIN_RISING (0x1UL << 1) /*!< Standby Power-down Wake-up on Standby Power-down Pin rising edge */ -#define CLK_SPDWKPIN_FALLING (0x1UL << 2) /*!< Standby Power-down Wake-up on Standby Power-down Pin falling edge */ -#define CLK_SPDWKPIN_DEBOUNCEEN (0x1UL << 8) /*!< Enable Standby power-down pin De-bounce function */ -#define CLK_SPDWKPIN_DEBOUNCEDIS (0x0UL << 8) /*!< Disable Standby power-down pin De-bounce function */ - - -/**@}*/ /* end of group CLK_EXPORTED_CONSTANTS */ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - -/** - * @brief Disable Wake-up Timer - * @param None - * @return None - * @details This macro disables Wake-up timer at Standby or Deep Power-down mode. - */ -#define CLK_DISABLE_WKTMR() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_WKTMREN_Msk; \ - }while(0) - -/** - * @brief Enable Wake-up Timer - * @param None - * @return None - * @details This macro enables Wake-up timer at Standby or Deep Power-down mode. - */ -#define CLK_ENABLE_WKTMR() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL |= CLK_PMUCTL_WKTMREN_Msk; \ - }while(0) - -/** - * @brief Disable DPD Mode Wake-up Pin - * @param None - * @return None - * @details This macro disables Wake-up pin at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN_Msk; \ - }while(0) - -/** - * @brief Disable DPD Mode Wake-up Pin 0 - * @param None - * @return None - * @details This macro disables Wake-up pin 0 (GPC.0) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN0() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_WKPIN0EN_Msk; \ - }while(0) - -/** - * @brief Disable DPD Mode Wake-up Pin 1 - * @param None - * @return None - * @details This macro disables Wake-up pin 1 (GPB.0) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN1() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_WKPIN1EN_Msk; \ - }while(0) - -/** - * @brief Disable DPD Mode Wake-up Pin 2 - * @param None - * @return None - * @details This macro disables Wake-up pin 2 (GPB.2) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN2() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_WKPIN2EN_Msk; \ - }while(0) - -/** - * @brief Disable DPD Mode Wake-up Pin 3 - * @param None - * @return None - * @details This macro disables Wake-up pin 3 (GPB.12) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN3() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_WKPIN3EN_Msk; \ - }while(0) - -/** - * @brief Disable DPD Mode Wake-up Pin 4 - * @param None - * @return None - * @details This macro disables Wake-up pin 4 (GPF.6) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN4() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_WKPIN4EN_Msk; \ - }while(0) - -/** - * @brief Disable SPD Mode ACMP Wake-up - * @param None - * @return None - * @details This macro disables ACMP wake-up at Standby Power-down mode. - */ -#define CLK_DISABLE_SPDACMP() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_ACMPSPWK_Msk; \ - }while(0) - -/** - * @brief Enable SPD Mode ACMP Wake-up - * @param None - * @return None - * @details This macro enables ACMP wake-up at Standby Power-down mode. - */ -#define CLK_ENABLE_SPDACMP() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL |= CLK_PMUCTL_ACMPSPWK_Msk; \ - }while(0) - -/** - * @brief Disable SPD and DPD Mode RTC Wake-up - * @param None - * @return None - * @details This macro disables RTC Wake-up at Standby or Deep Power-down mode. - */ -#define CLK_DISABLE_RTCWK() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_RTCWKEN_Msk; \ - }while(0) - -/** - * @brief Enable SPD and DPD Mode RTC Wake-up - * @param None - * @return None - * @details This macro enables RTC Wake-up at Standby or Deep Power-down mode. - */ -#define CLK_ENABLE_RTCWK() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL |= CLK_PMUCTL_RTCWKEN_Msk; \ - }while(0) - -/** - * @brief Set Wake-up Timer Time-out Interval - * - * @param[in] u32Interval The Wake-up Timer Time-out Interval selection. It could be - * - \ref CLK_PMUCTL_WKTMRIS_410 - * - \ref CLK_PMUCTL_WKTMRIS_819 - * - \ref CLK_PMUCTL_WKTMRIS_1638 - * - \ref CLK_PMUCTL_WKTMRIS_3277 - * - \ref CLK_PMUCTL_WKTMRIS_13107 - * - \ref CLK_PMUCTL_WKTMRIS_26214 - * - \ref CLK_PMUCTL_WKTMRIS_52429 - * - \ref CLK_PMUCTL_WKTMRIS_209715 - * - * @return None - * - * @details This function set Wake-up Timer Time-out Interval. - * - * - */ -#define CLK_SET_WKTMR_INTERVAL(u32Interval) \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL = (CLK->PMUCTL & (~CLK_PMUCTL_WKTMRIS_Msk)) | (u32Interval); \ - }while(0) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] u32CycleSel The de-bounce sampling cycle selection. It could be - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_1 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_2 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_4 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_8 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_16 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_32 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_64 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_128 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_2x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_4x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_8x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_16x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_32x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_64x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_128x256 - * - * @return None - * - * @details This function set Set De-bounce Sampling Cycle Time for Standby Power-down pin wake-up. - * - * - */ -#define CLK_SET_SPDDEBOUNCETIME(u32CycleSel) (CLK->SWKDBCTL = (u32CycleSel)) - -/** - * @brief Disable SPD Mode Tamper Wake-up - * @param None - * @return None - * @details This macro disables tamper Wake-up at Standby Power-down mode. - */ -#define CLK_DISABLE_SPDTAMPER() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL &= ~CLK_PMUCTL_TAMPERWK_Msk; \ - }while(0) - -/** - * @brief Enable SPD and DPD Mode RTC Wake-up - * @param None - * @return None - * @details This macro enables tamper Wake-up at Standby Power-down mode. - */ -#define CLK_ENABLE_SPDTAMPER() \ - do{ \ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); \ - CLK->PMUCTL |= CLK_PMUCTL_TAMPERWK_Msk; \ - }while(0) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void CLK_SysTickDelay(uint32_t us); -__STATIC_INLINE void CLK_SysTickLongDelay(uint32_t us); - - -/** - * @brief This function execute delay function. - * @param[in] us Delay time. The Max value is (2^24-1) / CPU Clock(MHz). Ex: - * 96MHz => 174762us, 84MHz => 199728us, - * 64MHz => 262143us, 48MHz => 349525us ... - * @return None - * @details Use the SysTick to generate the delay time and the UNIT is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - * User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function. - */ -__STATIC_INLINE void CLK_SysTickDelay(uint32_t us) -{ - SysTick->LOAD = us * CyclesPerUs; - SysTick->VAL = (0x0UL); - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0UL) - { - } - - /* Disable SysTick counter */ - SysTick->CTRL = 0UL; -} - -/** - * @brief This function execute long delay function. - * @param[in] us Delay time. - * @return None - * @details Use the SysTick to generate the long delay time and the UNIT is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - * User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function. - */ -__STATIC_INLINE void CLK_SysTickLongDelay(uint32_t us) -{ - uint32_t u32Delay; - - /* It should <= 65536us for each delay loop */ - u32Delay = 65536UL; - - do - { - if(us > u32Delay) - { - us -= u32Delay; - } - else - { - u32Delay = us; - us = 0UL; - } - - SysTick->LOAD = u32Delay * CyclesPerUs; - SysTick->VAL = (0x0UL); - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0UL); - - /* Disable SysTick counter */ - SysTick->CTRL = 0UL; - - } - while(us > 0UL); - -} - - -void CLK_DisableCKO(void); -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En); -void CLK_PowerDown(void); -void CLK_Idle(void); -uint32_t CLK_GetHXTFreq(void); -uint32_t CLK_GetLXTFreq(void); -uint32_t CLK_GetHCLKFreq(void); -uint32_t CLK_GetPCLK0Freq(void); -uint32_t CLK_GetPCLK1Freq(void); -uint32_t CLK_GetCPUFreq(void); -uint32_t CLK_SetCoreClock(uint32_t u32Hclk); -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc); -void CLK_EnableXtalRC(uint32_t u32ClkMask); -void CLK_DisableXtalRC(uint32_t u32ClkMask); -void CLK_EnableModuleClock(uint32_t u32ModuleIdx); -void CLK_DisableModuleClock(uint32_t u32ModuleIdx); -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq); -void CLK_DisablePLL(void); -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask); -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count); -void CLK_DisableSysTick(void); -void CLK_SetPowerDownMode(uint32_t u32PDMode); -void CLK_EnableDPDWKPin(uint32_t u32TriggerType); -uint32_t CLK_GetPMUWKSrc(void); -void CLK_EnableSPDWKPin(uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerType, uint32_t u32DebounceEn); -uint32_t CLK_GetPLLClockFreq(void); -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx); -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx); - - -/**@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CLK_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - - -#endif /* __NU_CLK_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crc.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crc.h deleted file mode 100644 index 7a00089e1a5..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crc.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************//** - * @file nu_crc.h - * @version V3.00 - * @brief Cyclic Redundancy Check(CRC) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_CRC_H__ -#define __NU_CRC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_CONSTANTS CRC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* CRC Polynomial Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CRC_CCITT (0UL << CRC_CTL_CRCMODE_Pos) /*!SEED = (u32Seed); (crc)->CTL |= CRC_CTL_CHKSINIT_Msk; } while(0) - -/** - * @brief Get CRC Seed Value - * - * @param[in] crc The pointer of CRC module. - * - * @return CRC seed value - * - * @details This macro gets the current CRC seed value. - * \hideinitializer - */ -#define CRC_GET_SEED(crc) ((crc)->SEED) - -/** - * @brief CRC Write Data - * - * @param[in] crc The pointer of CRC module. - * @param[in] u32Data Write data - * - * @return None - * - * @details User can write data directly to CRC Write Data Register(CRC_DAT) by this macro to perform CRC operation. - * \hideinitializer - */ -#define CRC_WRITE_DATA(crc, u32Data) ((crc)->DAT = (u32Data)) - - -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen); -uint32_t CRC_GetChecksum(void); - -/**@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CRC_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crypto.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crypto.h deleted file mode 100644 index eebd671d6eb..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_crypto.h +++ /dev/null @@ -1,559 +0,0 @@ -/**************************************************************************//** - * @file nu_crypto.h - * @version V3.00 - * @brief Cryptographic Accelerator driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CRYPTO_H__ -#define __NU_CRYPTO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup CRYPTO_EXPORTED_CONSTANTS CRYPTO Exported Constants - @{ -*/ - - -#define PRNG_KEY_SIZE_128 ( 0UL) /*!< Select to generate 128-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_163 ( 1UL) /*!< Select to generate 163-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_192 ( 2UL) /*!< Select to generate 192-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_224 ( 3UL) /*!< Select to generate 224-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_255 ( 4UL) /*!< Select to generate 255-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_256 ( 6UL) /*!< Select to generate 256-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_283 ( 7UL) /*!< Select to generate 283-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_384 ( 8UL) /*!< Select to generate 384-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_409 ( 9UL) /*!< Select to generate 409-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_512 (10UL) /*!< Select to generate 512-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_521 (11UL) /*!< Select to generate 521-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_571 (12UL) /*!< Select to generate 571-bit random key (Key Store Only) \hideinitializer */ - -#define PRNG_SEED_CONT (0UL) /*!< PRNG using current seed \hideinitializer */ -#define PRNG_SEED_RELOAD (1UL) /*!< PRNG reload new seed \hideinitializer */ - -#define AES_KEY_SIZE_128 (0UL) /*!< AES select 128-bit key length \hideinitializer */ -#define AES_KEY_SIZE_192 (1UL) /*!< AES select 192-bit key length \hideinitializer */ -#define AES_KEY_SIZE_256 (2UL) /*!< AES select 256-bit key length \hideinitializer */ - -#define AES_MODE_ECB (0UL) /*!< AES select ECB mode \hideinitializer */ -#define AES_MODE_CBC (1UL) /*!< AES select CBC mode \hideinitializer */ -#define AES_MODE_CFB (2UL) /*!< AES select CFB mode \hideinitializer */ -#define AES_MODE_OFB (3UL) /*!< AES select OFB mode \hideinitializer */ -#define AES_MODE_CTR (4UL) /*!< AES select CTR mode \hideinitializer */ -#define AES_MODE_CBC_CS1 (0x10UL) /*!< AES select CBC CS1 mode \hideinitializer */ -#define AES_MODE_CBC_CS2 (0x11UL) /*!< AES select CBC CS2 mode \hideinitializer */ -#define AES_MODE_CBC_CS3 (0x12UL) /*!< AES select CBC CS3 mode \hideinitializer */ -#define AES_MODE_GCM (0x20UL) -#define AES_MODE_GHASH (0x21UL) -#define AES_MODE_CCM (0x22UL) - -#define SM4_MODE_ECB (0x200UL) /*!< SM4 select ECB mode \hideinitializer */ -#define SM4_MODE_CBC (0x201UL) /*!< SM4 select CBC mode \hideinitializer */ -#define SM4_MODE_CFB (0x202UL) /*!< SM4 select CFB mode \hideinitializer */ -#define SM4_MODE_OFB (0x203UL) /*!< SM4 select OFB mode \hideinitializer */ -#define SM4_MODE_CTR (0x204UL) /*!< SM4 select CTR mode \hideinitializer */ -#define SM4_MODE_CBC_CS1 (0x210UL) /*!< SM4 select CBC CS1 mode \hideinitializer */ -#define SM4_MODE_CBC_CS2 (0x211UL) /*!< SM4 select CBC CS2 mode \hideinitializer */ -#define SM4_MODE_CBC_CS3 (0x212UL) /*!< SM4 select CBC CS3 mode \hideinitializer */ -#define SM4_MODE_GCM (0x220UL) -#define SM4_MODE_GHASH (0x221UL) -#define SM4_MODE_CCM (0x222UL) - - -#define AES_NO_SWAP (0UL) /*!< AES do not swap input and output data \hideinitializer */ -#define AES_OUT_SWAP (1UL) /*!< AES swap output data \hideinitializer */ -#define AES_IN_SWAP (2UL) /*!< AES swap input data \hideinitializer */ -#define AES_IN_OUT_SWAP (3UL) /*!< AES swap both input and output data \hideinitializer */ - -#define DES_MODE_ECB (0x000UL) /*!< DES select ECB mode \hideinitializer */ -#define DES_MODE_CBC (0x100UL) /*!< DES select CBC mode \hideinitializer */ -#define DES_MODE_CFB (0x200UL) /*!< DES select CFB mode \hideinitializer */ -#define DES_MODE_OFB (0x300UL) /*!< DES select OFB mode \hideinitializer */ -#define DES_MODE_CTR (0x400UL) /*!< DES select CTR mode \hideinitializer */ -#define TDES_MODE_ECB (0x004UL) /*!< TDES select ECB mode \hideinitializer */ -#define TDES_MODE_CBC (0x104UL) /*!< TDES select CBC mode \hideinitializer */ -#define TDES_MODE_CFB (0x204UL) /*!< TDES select CFB mode \hideinitializer */ -#define TDES_MODE_OFB (0x304UL) /*!< TDES select OFB mode \hideinitializer */ -#define TDES_MODE_CTR (0x404UL) /*!< TDES select CTR mode \hideinitializer */ - -#define TDES_NO_SWAP (0UL) /*!< TDES do not swap data \hideinitializer */ -#define TDES_WHL_SWAP (1UL) /*!< TDES swap high-low word \hideinitializer */ -#define TDES_OUT_SWAP (2UL) /*!< TDES swap output data \hideinitializer */ -#define TDES_OUT_WHL_SWAP (3UL) /*!< TDES swap output data and high-low word \hideinitializer */ -#define TDES_IN_SWAP (4UL) /*!< TDES swap input data \hideinitializer */ -#define TDES_IN_WHL_SWAP (5UL) /*!< TDES swap input data and high-low word \hideinitializer */ -#define TDES_IN_OUT_SWAP (6UL) /*!< TDES swap both input and output data \hideinitializer */ -#define TDES_IN_OUT_WHL_SWAP (7UL) /*!< TDES swap input, output and high-low word \hideinitializer */ - -#define SHA_MODE_SHA1 (0UL) /*!< SHA select SHA-1 160-bit \hideinitializer */ -#define SHA_MODE_SHA224 (5UL) /*!< SHA select SHA-224 224-bit \hideinitializer */ -#define SHA_MODE_SHA256 (4UL) /*!< SHA select SHA-256 256-bit \hideinitializer */ -#define SHA_MODE_SHA384 (7UL) /*!< SHA select SHA-384 384-bit \hideinitializer */ -#define SHA_MODE_SHA512 (6UL) /*!< SHA select SHA-512 512-bit \hideinitializer */ - -#define HMAC_MODE_SHA1 (8UL) /*!< HMAC select SHA-1 160-bit \hideinitializer */ -#define HMAC_MODE_SHA224 (13UL) /*!< HMAC select SHA-224 224-bit \hideinitializer */ -#define HMAC_MODE_SHA256 (12UL) /*!< HMAC select SHA-256 256-bit \hideinitializer */ -#define HMAC_MODE_SHA384 (15UL) /*!< HMAC select SHA-384 384-bit \hideinitializer */ -#define HMAC_MODE_SHA512 (14UL) /*!< HMAC select SHA-512 512-bit \hideinitializer */ - - -#define SHA_NO_SWAP (0UL) /*!< SHA do not swap input and output data \hideinitializer */ -#define SHA_OUT_SWAP (1UL) /*!< SHA swap output data \hideinitializer */ -#define SHA_IN_SWAP (2UL) /*!< SHA swap input data \hideinitializer */ -#define SHA_IN_OUT_SWAP (3UL) /*!< SHA swap both input and output data \hideinitializer */ - -#define CRYPTO_DMA_FIRST (0x4UL) /*!< Do first encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_ONE_SHOT (0x5UL) /*!< Do one shot encrypt/decrypt with DMA \hideinitializer */ -#define CRYPTO_DMA_CONTINUE (0x6UL) /*!< Do continuous encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_LAST (0x7UL) /*!< Do last encrypt/decrypt in DMA cascade \hideinitializer */ - -//--------------------------------------------------- - -#define RSA_MAX_KLEN (4096) -#define RSA_KBUF_HLEN (RSA_MAX_KLEN/4 + 8) -#define RSA_KBUF_BLEN (RSA_MAX_KLEN + 32) - -#define RSA_KEY_SIZE_1024 (0UL) /*!< RSA select 1024-bit key length \hideinitializer */ -#define RSA_KEY_SIZE_2048 (1UL) /*!< RSA select 2048-bit key length \hideinitializer */ -#define RSA_KEY_SIZE_3072 (2UL) /*!< RSA select 3072-bit key length \hideinitializer */ -#define RSA_KEY_SIZE_4096 (3UL) /*!< RSA select 4096-bit key length \hideinitializer */ - -#define RSA_MODE_NORMAL (0x000UL) /*!< RSA select normal mode \hideinitializer */ -#define RSA_MODE_CRT (0x004UL) /*!< RSA select CRT mode \hideinitializer */ -#define RSA_MODE_CRTBYPASS (0x00CUL) /*!< RSA select CRT bypass mode \hideinitializer */ -#define RSA_MODE_SCAP (0x100UL) /*!< RSA select SCAP mode \hideinitializer */ -#define RSA_MODE_CRT_SCAP (0x104UL) /*!< RSA select CRT SCAP mode \hideinitializer */ -#define RSA_MODE_CRTBYPASS_SCAP (0x10CUL) /*!< RSA select CRT bypass SCAP mode \hideinitializer */ - - -typedef enum -{ - /*!< ECC curve \hideinitializer */ - CURVE_P_192, /*!< ECC curve P-192 \hideinitializer */ - CURVE_P_224, /*!< ECC curve P-224 \hideinitializer */ - CURVE_P_256, /*!< ECC curve P-256 \hideinitializer */ - CURVE_P_384, /*!< ECC curve P-384 \hideinitializer */ - CURVE_P_521, /*!< ECC curve P-521 \hideinitializer */ - CURVE_K_163, /*!< ECC curve K-163 \hideinitializer */ - CURVE_K_233, /*!< ECC curve K-233 \hideinitializer */ - CURVE_K_283, /*!< ECC curve K-283 \hideinitializer */ - CURVE_K_409, /*!< ECC curve K-409 \hideinitializer */ - CURVE_K_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_B_163, /*!< ECC curve B-163 \hideinitializer */ - CURVE_B_233, /*!< ECC curve B-233 \hideinitializer */ - CURVE_B_283, /*!< ECC curve B-283 \hideinitializer */ - CURVE_B_409, /*!< ECC curve B-409 \hideinitializer */ - CURVE_B_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_KO_192, /*!< ECC 192-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_224, /*!< ECC 224-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_256, /*!< ECC 256-bits "Koblitz" curve \hideinitializer */ - CURVE_BP_256, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_384, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_512, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_25519, /*!< ECC curve-25519 \hideinitializer */ - CURVE_SM2_256, /*!< SM2 \hideinitializer */ - CURVE_UNDEF = -0x7fffffff, /*!< Invalid curve \hideinitializer */ -} -E_ECC_CURVE; - - - -typedef struct e_curve_t -{ - E_ECC_CURVE curve_id; - int32_t Echar; - char Ea[144]; - char Eb[144]; - char Px[144]; - char Py[144]; - int32_t Epl; - char Pp[176]; - int32_t Eol; - char Eorder[176]; - int32_t key_len; - int32_t irreducible_k1; - int32_t irreducible_k2; - int32_t irreducible_k3; - int32_t GF; -} ECC_CURVE; - - -/* RSA working buffer for normal mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ -} RSA_BUF_NORMAL_T; - -/* RSA working buffer for CRT ( + CRT bypass) mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ - uint32_t au32RsaP[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaQ[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaTmpCp[128]; /* The Temporary Value(Cp) of RSA CRT. */ - uint32_t au32RsaTmpCq[128]; /* The Temporary Value(Cq) of RSA CRT. */ - uint32_t au32RsaTmpDp[128]; /* The Temporary Value(Dp) of RSA CRT. */ - uint32_t au32RsaTmpDq[128]; /* The Temporary Value(Dq) of RSA CRT. */ - uint32_t au32RsaTmpRp[128]; /* The Temporary Value(Rp) of RSA CRT. */ - uint32_t au32RsaTmpRq[128]; /* The Temporary Value(Rq) of RSA CRT. */ -} RSA_BUF_CRT_T; - -/* RSA working buffer for SCAP mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ - uint32_t au32RsaP[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaQ[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaTmpBlindKey[128]; /* The Temporary Value(blind key) of RSA SCAP. */ -} RSA_BUF_SCAP_T; - -/* RSA working buffer for CRT ( + CRT bypass ) + SCAP mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ - uint32_t au32RsaP[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaQ[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaTmpCp[128]; /* The Temporary Value(Cp) of RSA CRT. */ - uint32_t au32RsaTmpCq[128]; /* The Temporary Value(Cq) of RSA CRT. */ - uint32_t au32RsaTmpDp[128]; /* The Temporary Value(Dp) of RSA CRT. */ - uint32_t au32RsaTmpDq[128]; /* The Temporary Value(Dq) of RSA CRT. */ - uint32_t au32RsaTmpRp[128]; /* The Temporary Value(Rp) of RSA CRT. */ - uint32_t au32RsaTmpRq[128]; /* The Temporary Value(Rq) of RSA CRT. */ - uint32_t au32RsaTmpBlindKey[128]; /* The Temporary Value(blind key) of RSA SCAP. */ -} RSA_BUF_CRT_SCAP_T; - -/* RSA working buffer for using key store */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ -} RSA_BUF_KS_T; - -/**@}*/ /* end of group CRYPTO_EXPORTED_CONSTANTS */ - - -/** @addtogroup CRYPTO_EXPORTED_MACROS CRYPTO Exported Macros - @{ -*/ - -/*----------------------------------------------------------------------------------------------*/ -/* Macros */ -/*----------------------------------------------------------------------------------------------*/ - -/** - * @brief This macro enables PRNG interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define PRNG_ENABLE_INT(crpt) ((crpt)->INTEN |= CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro disables PRNG interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define PRNG_DISABLE_INT(crpt) ((crpt)->INTEN &= ~CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro gets PRNG interrupt flag. - * @param crpt Specified crypto module - * @return PRNG interrupt flag. - * \hideinitializer - */ -#define PRNG_GET_INT_FLAG(crpt) ((crpt)->INTSTS & CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro clears PRNG interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define PRNG_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro enables AES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro disables AES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro gets AES interrupt flag. - * @param crpt Specified crypto module - * @return AES interrupt flag. - * \hideinitializer - */ -#define AES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro clears AES interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro enables AES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL |= CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables AES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL = ((crpt)->AES_CTL & ~CRPT_AES_CTL_KEYPRT_Msk) | (0x16UL<AES_CTL &= ~CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro enables TDES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESEIEN_Msk)) - -/** - * @brief This macro disables TDES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESEIEN_Msk)) - -/** - * @brief This macro gets TDES interrupt flag. - * @param crpt Specified crypto module - * @return TDES interrupt flag. - * \hideinitializer - */ -#define TDES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESEIF_Msk)) - -/** - * @brief This macro clears TDES interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESEIF_Msk)) - -/** - * @brief This macro enables TDES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_ENABLE_KEY_PROTECT(crpt) ((crpt)->TDES_CTL |= CRPT_TDES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables TDES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_KEY_PROTECT(crpt) ((crpt)->TDES_CTL = ((crpt)->TDES_CTL & ~CRPT_TDES_CTL_KEYPRT_Msk) | (0x16UL<TDES_CTL &= ~CRPT_TDES_CTL_KEYPRT_Msk) - -/** - * @brief This macro enables SHA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define SHA_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro disables SHA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define SHA_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro gets SHA interrupt flag. - * @param crpt Specified crypto module - * @return SHA interrupt flag. - * \hideinitializer - */ -#define SHA_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro clears SHA interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define SHA_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro enables ECC interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define ECC_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro disables ECC interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define ECC_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro gets ECC interrupt flag. - * @param crpt Specified crypto module - * @return ECC interrupt flag. - * \hideinitializer - */ -#define ECC_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - -/** - * @brief This macro clears ECC interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define ECC_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - -/** - * @brief This macro enables RSA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define RSA_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_RSAIEN_Msk|CRPT_INTEN_RSAEIEN_Msk)) - -/** - * @brief This macro disables RSA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define RSA_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_RSAIEN_Msk|CRPT_INTEN_RSAEIEN_Msk)) - -/** - * @brief This macro gets RSA interrupt flag. - * @param crpt Specified crypto module - * @return ECC interrupt flag. - * \hideinitializer - */ -#define RSA_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_RSAIF_Msk|CRPT_INTSTS_RSAEIF_Msk)) - -/** - * @brief This macro clears RSA interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define RSA_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_RSAIF_Msk|CRPT_INTSTS_RSAEIF_Msk)) - - -/**@}*/ /* end of group CRYPTO_EXPORTED_MACROS */ - - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed); -void PRNG_Start(CRPT_T *crpt); -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]); -void AES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType); -void AES_Start(CRPT_T *crpt, int32_t u32Channel, uint32_t u32DMAMode); -void AES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize); -void AES_SetKey_KS(CRPT_T *crpt, KS_MEM_Type mem, int32_t i32KeyIdx); -void AES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32IV[]); -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt); -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len); -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode); -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt); -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]); -void ECC_DriverISR(CRPT_T *crpt); -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]); -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]); -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]); -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *d, char *k, char *R, char *S); -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *public_k1, char *public_k2, char *R, char *S); - - -int32_t RSA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32KeySize, void *psRSA_Buf, uint32_t u32BufSize, uint32_t u32UseKS); -int32_t RSA_SetKey(CRPT_T *crpt, char *Key); -int32_t RSA_SetDMATransfer(CRPT_T *crpt, char *Src, char *n, char *P, char *Q); -void RSA_Start(CRPT_T *crpt); -int32_t RSA_Read(CRPT_T *crpt, char * Output); -int32_t RSA_SetKey_KS(CRPT_T *crpt, uint32_t u32KeyNum, uint32_t u32KSMemType, uint32_t u32BlindKeyNum); -int32_t RSA_SetDMATransfer_KS(CRPT_T *crpt, char *Src, char *n, uint32_t u32PNum, - uint32_t u32QNum, uint32_t u32CpNum, uint32_t u32CqNum, uint32_t u32DpNum, - uint32_t u32DqNum, uint32_t u32RpNum, uint32_t u32RqNum); -int32_t ECC_GeneratePublicKey_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[], uint32_t u32ExtraOp); -int32_t ECC_GenerateSignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_d, int32_t i32KeyIdx_d, KS_MEM_Type mem_k, int32_t i32KeyIdx_k, char *R, char *S); -int32_t ECC_VerifySignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_pk1, int32_t i32KeyIdx_pk1, KS_MEM_Type mem_pk2, int32_t i32KeyIdx_pk2, char *R, char *S); -int32_t ECC_GenerateSecretZ_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[]); - -void CRPT_Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]); -void CRPT_Hex2Reg(char input[], uint32_t volatile reg[]); -int32_t ECC_GetCurve(CRPT_T *crpt, E_ECC_CURVE ecc_curve, ECC_CURVE *curve); - -/**@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRYPTO_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CRYPTO_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dac.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dac.h deleted file mode 100644 index f8de627d11b..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dac.h +++ /dev/null @@ -1,255 +0,0 @@ -/****************************************************************************** - * @file nu_dac.h - * @version V1.00 - * @brief M2354 series DAC driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_DAC_H__ -#define __NU_DAC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DAC_Driver DAC Driver - @{ -*/ - - -/** @addtogroup DAC_EXPORTED_CONSTANTS DAC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* DAC_CTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define DAC_CTL_LALIGN_RIGHT_ALIGN (0UL<SWTRG = DAC_SWTRG_SWTRG_Msk) - -/** - * @brief Enable DAC data left-aligned. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details User has to load data into DAC_DAT[15:4] bits. DAC_DAT[31:16] and DAC_DAT[3:0] are ignored in DAC conversion. - */ -#define DAC_ENABLE_LEFT_ALIGN(dac) ((dac)->CTL |= DAC_CTL_LALIGN_Msk) - -/** - * @brief Enable DAC data right-aligned. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details User has to load data into DAC_DAT[11:0] bits, DAC_DAT[31:12] are ignored in DAC conversion. - */ -#define DAC_ENABLE_RIGHT_ALIGN(dac) ((dac)->CTL &= ~DAC_CTL_LALIGN_Msk) - -/** - * @brief Enable output voltage buffer. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details The DAC integrates a voltage output buffer that can be used to reduce output impedance and - * drive external loads directly without having to add an external operational amplifier. - */ -#define DAC_ENABLE_BYPASS_BUFFER(dac) ((dac)->CTL |= DAC_CTL_BYPASS_Msk) - -/** - * @brief Disable output voltage buffer. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to disable output voltage buffer. - */ -#define DAC_DISABLE_BYPASS_BUFFER(dac) ((dac)->CTL &= ~DAC_CTL_BYPASS_Msk) - -/** - * @brief Enable the interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2355 Series DAC. - * @return None - * @details This macro is used to enable DAC interrupt. - */ -#define DAC_ENABLE_INT(dac, u32Ch) ((dac)->CTL |= DAC_CTL_DACIEN_Msk) - -/** - * @brief Disable the interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2355 Series DAC. - * @return None - * @details This macro is used to disable DAC interrupt. - */ -#define DAC_DISABLE_INT(dac, u32Ch) ((dac)->CTL &= ~DAC_CTL_DACIEN_Msk) - -/** - * @brief Enable DMA under-run interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to enable DMA under-run interrupt. - */ -#define DAC_ENABLE_DMAUDR_INT(dac) ((dac)->CTL |= DAC_CTL_DMAURIEN_Msk) - -/** - * @brief Disable DMA under-run interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to disable DMA under-run interrupt. - */ -#define DAC_DISABLE_DMAUDR_INT(dac) ((dac)->CTL &= ~DAC_CTL_DMAURIEN_Msk) - -/** - * @brief Enable PDMA mode. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details DAC DMA request is generated when a hardware trigger event occurs while DMAEN (DAC_CTL[2]) is set. - */ -#define DAC_ENABLE_PDMA(dac) ((dac)->CTL |= DAC_CTL_DMAEN_Msk) - -/** - * @brief Disable PDMA mode. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to disable DMA mode. - */ -#define DAC_DISABLE_PDMA(dac) ((dac)->CTL &= ~DAC_CTL_DMAEN_Msk) - -/** - * @brief Write data for conversion. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2355 Series DAC. - * @param[in] u32Data Decides the data for conversion, valid range are between 0~0xFFF. - * @return None - * @details 12 bit left alignment: user has to load data into DAC_DAT[15:4] bits. - * 12 bit right alignment: user has to load data into DAC_DAT[11:0] bits. - */ -#define DAC_WRITE_DATA(dac, u32Ch, u32Data) ((dac)->DAT = (u32Data)) - -/** - * @brief Read DAC 12-bit holding data. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2355 Series DAC. - * @return Return DAC 12-bit holding data. - * @details This macro is used to read DAC_DAT register. - */ -#define DAC_READ_DATA(dac, u32Ch) ((dac)->DAT) - -/** - * @brief Get the busy state of DAC. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2355 Series DAC. - * @retval 0 Idle state. - * @retval 1 Busy state. - * @details This macro is used to read BUSY bit (DAC_STATUS[8]) to get busy state. - */ -#define DAC_IS_BUSY(dac, u32Ch) (((dac)->STATUS & DAC_STATUS_BUSY_Msk) >> DAC_STATUS_BUSY_Pos) - -/** - * @brief Get the interrupt flag. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2355 Series DAC. - * @retval 0 DAC is in conversion state. - * @retval 1 DAC conversion finish. - * @details This macro is used to read FINISH bit (DAC_STATUS[0]) to get DAC conversion complete finish flag. - */ -#define DAC_GET_INT_FLAG(dac, u32Ch) ((dac)->STATUS & DAC_STATUS_FINISH_Msk) - -/** - * @brief Get the DMA under-run flag. - * @param[in] dac The pointer of the specified DAC module. - * @retval 0 No DMA under-run error condition occurred. - * @retval 1 DMA under-run error condition occurred. - * @details This macro is used to read DMAUDR bit (DAC_STATUS[1]) to get DMA under-run state. - */ -#define DAC_GET_DMAUDR_FLAG(dac) (((dac)->STATUS & DAC_STATUS_DMAUDR_Msk) >> DAC_STATUS_DMAUDR_Pos) - -/** - * @brief This macro clear the interrupt status bit. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2355 Series DAC. - * @return None - * @details User writes FINISH bit (DAC_STATUS[0]) to clear DAC conversion complete finish flag. - */ -#define DAC_CLR_INT_FLAG(dac, u32Ch) ((dac)->STATUS = DAC_STATUS_FINISH_Msk) - -/** - * @brief This macro clear the DMA under-run flag. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details User writes DMAUDR bit (DAC_STATUS[1]) to clear DMA under-run flag. - */ -#define DAC_CLR_DMAUDR_FLAG(dac) ((dac)->STATUS = DAC_STATUS_DMAUDR_Msk) - - -/** - * @brief Enable DAC group mode - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @note Only DAC0 has this control bit. - * \hideinitializer - */ -#define DAC_ENABLE_GROUP_MODE(dac) ((dac)->CTL |= DAC_CTL_GRPEN_Msk) - -/** - * @brief Disable DAC group mode - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @note Only DAC0 has this control bit. - * \hideinitializer - */ -#define DAC_DISABLE_GROUP_MODE(dac) ((dac)->CTL &= ~DAC_CTL_GRPEN_Msk) - -void DAC_Open(DAC_T *dac, uint32_t u32Ch, uint32_t u32TrgSrc); -void DAC_Close(DAC_T *dac, uint32_t u32Ch); -uint32_t DAC_SetDelayTime(DAC_T *dac, uint32_t u32Delay); - -/**@}*/ /* end of group DAC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group DAC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_DAC_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dpm.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dpm.h deleted file mode 100644 index 879b23ab4e8..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_dpm.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************//** - * @file nu_dpm.h - * @version V3.00 - * @brief Debug Protection Mechanism (DPM) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_DPM_H__ -#define __NU_DPM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DPM_Driver DPM Driver - @{ -*/ - -/** @addtogroup DPM_EXPORTED_CONSTANTS DPM Exported Constants - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* DPM Control Register Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SECURE_DPM 0 /*!< Secure DPM module */ -#define NONSECURE_DPM 1 /*!< Non-secure DPM module */ - - -#define DPM_CTL_WVCODE (0x5AUL<STS & DPM_STS_BUSY_Msk); \ - DPM->CTL = (DPM->CTL & (~DPM_CTL_WVCODE_Msk)) | (DPM_CTL_WVCODE|DPM_CTL_INTEN_Msk); \ - }while(0) - -/** - * @brief Disable DPM Interrupt - * @param None - * @return None - * @details This macro disables DPM interrupt. - * This macro is for Secure DPM and Secure region only. - */ -#define DPM_DISABLE_INT() \ - do{ \ - while(DPM->STS & DPM_STS_BUSY_Msk); \ - DPM->CTL = (DPM->CTL & (~(DPM_CTL_WVCODE_Msk|DPM_CTL_INTEN_Msk))) | (DPM_CTL_WVCODE); \ - }while(0) - -/** - * @brief Enable Debugger to Access DPM Registers - * @param None - * @return None - * @details This macro enables debugger to access Secure and Non-secure DPM registers. - * This macro is for Secure DPM and Secure region only. - */ -#define DPM_ENABLE_DBG_ACCESS() \ - do{ \ - while(DPM->STS & DPM_STS_BUSY_Msk); \ - DPM->CTL = (DPM->CTL & (~(DPM_CTL_WVCODE_Msk|DPM_CTL_DACCDIS_Msk))) | (DPM_CTL_WVCODE); \ - }while(0) - -/** - * @brief Disable Debugger to Access DPM Registers - * @param None - * @return None - * @details This macro disables debugger to access Secure and Non-secure DPM registers. - * This macro is for Secure DPM and Secure region only. - */ -#define DPM_DISABLE_DBG_ACCESS() \ - do{ \ - while(DPM->STS & DPM_STS_BUSY_Msk); \ - DPM->CTL = (DPM->CTL & (~DPM_CTL_WVCODE_Msk)) | (DPM_CTL_WVCODE|DPM_CTL_DACCDIS_Msk); \ - }while(0) - - -void DPM_SetDebugDisable(uint32_t u32dpm); -void DPM_SetDebugLock(uint32_t u32dpm); -uint32_t DPM_GetDebugDisable(uint32_t u32dpm); -uint32_t DPM_GetDebugLock(uint32_t u32dpm); -uint32_t DPM_SetPasswordUpdate(uint32_t u32dpm, uint32_t au32Pwd[]); -uint32_t DPM_SetPasswordCompare(uint32_t u32dpm, uint32_t au32Pwd[]); -uint32_t DPM_GetPasswordErrorFlag(uint32_t u32dpm); -uint32_t DPM_GetIntFlag(void); -void DPM_ClearPasswordErrorFlag(uint32_t u32dpm); -void DPM_EnableDebuggerWriteAccess(uint32_t u32dpm); -void DPM_DisableDebuggerWriteAccess(uint32_t u32dpm); - - - -/**@}*/ /* end of group DPM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group DPM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_DPM_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_eadc.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_eadc.h deleted file mode 100644 index c94a2821afa..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_eadc.h +++ /dev/null @@ -1,560 +0,0 @@ -/****************************************************************************** - * @file nu_eadc.h - * @version V0.10 - * @brief M2354 series EADC driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_EADC_H__ -#define __NU_EADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_CONSTANTS EADC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EADC_CTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EADC_CTL_DIFFEN_SINGLE_END (0UL<CTL |= EADC_CTL_ADCRST_Msk) - -/** - * @brief Enable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details When A/D conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, - * user can enable this bit to generate a PDMA data transfer request. - * \hideinitializer - */ -#define EADC_ENABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL |= u32ModuleMask) - -/** - * @brief Disable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details This macro is used to disable sample module PDMA transfer. - * \hideinitializer - */ -#define EADC_DISABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL &= (~u32ModuleMask)) - -/** - * @brief Enable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details The ADC controller supports a double buffer mode in sample module 0~3. - * If user enable DBMEN (EADC_SCTLn[23], n=0~3), the double buffer mode will enable. - */ -#define EADC_ENABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_DBMEN_Msk) - -/** - * @brief Disable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details Sample has one sample result register. - */ -#define EADC_DISABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_DBMEN_Msk) - -/** - * @brief Set ADIFn at A/D end of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the start of conversion. - */ -#define EADC_ENABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_INTPOS_Msk) - -/** - * @brief Set ADIFn at A/D start of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the end of conversion. - */ -#define EADC_DISABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_INTPOS_Msk) - -/** - * @brief Enable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be enabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details The A/D converter generates a conversion end ADIFn (EADC_STATUS2[n]) upon the end of specific sample module A/D conversion. - * If ADCIENn bit (EADC_CTL[n+2]) is set then conversion end interrupt request ADINTn is generated (n=0~3). - */ -#define EADC_ENABLE_INT(eadc, u32Mask) ((eadc)->CTL |= ((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Disable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be disabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details Specific sample module A/D ADINT0 interrupt function Disabled. - */ -#define EADC_DISABLE_INT(eadc, u32Mask) ((eadc)->CTL &= ~((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Enable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be enabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 ADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - */ -#define EADC_ENABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] |= (u32ModuleMask)) - -/** - * @brief Disable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 ADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - */ -#define EADC_DISABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] &= (uint32_t)(~(u32ModuleMask))) - -/** - * @brief Set the input mode output format. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Format Decides the output format. Valid values are: - * - \ref EADC_CTL_DMOF_STRAIGHT_BINARY :Select the straight binary format as the output format of the conversion result. - * - \ref EADC_CTL_DMOF_TWOS_COMPLEMENT :Select the 2's complement format as the output format of the conversion result. - * @return None - * @details The macro is used to set A/D input mode output format. - */ -#define EADC_SET_DMOF(eadc, u32Format) ((eadc)->CTL = ((eadc)->CTL & ~EADC_CTL_DMOF_Msk) | (u32Format)) - -/** - * @brief Start the A/D conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will be conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module 18. - * @return None - * @details After write EADC_SWTRG register to start ADC conversion, the EADC_PENDSTS register will show which SAMPLE will conversion. - */ -#define EADC_START_CONV(eadc, u32ModuleMask) ((eadc)->SWTRG = (u32ModuleMask)) - -/** - * @brief Cancel the conversion for sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will stop the conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module18. - * @return None - * @details If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - */ -#define EADC_STOP_CONV(eadc, u32ModuleMask) ((eadc)->PENDSTS = (u32ModuleMask)) - -/** - * @brief Get the conversion pending flag. - * @param[in] eadc The pointer of the specified EADC module. - * @return Return the conversion pending sample module. - * @details This STPFn(EADC_PENDSTS[18:0]) bit remains 1 during pending state, when the respective ADC conversion is end, - * the STPFn (n=0~18) bit is automatically cleared to 0. - */ -#define EADC_GET_PENDING_CONV(eadc) ((eadc)->PENDSTS) - -/** - * @brief Get the conversion data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the conversion data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DATn[15:0], n=0~18) field to get conversion data. - */ -#define EADC_GET_CONV_DATA(eadc, u32ModuleNum) ((eadc)->DAT[(u32ModuleNum)] & EADC_DAT_RESULT_Msk) - -/** - * @brief Get the data overrun flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data overrun status bits. Each bit corresponds to a data overrun status, valid range are between 1~0x7FFFF. - * @return Return the data overrun flag of the user-specified sample module. - * @details This macro is used to read OV bit (EADC_STATUS0[31:16], EADC_STATUS1[18:16]) field to get data overrun status. - */ -#define EADC_GET_DATA_OVERRUN_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 >> EADC_STATUS0_OV_Pos) | ((eadc)->STATUS1 & EADC_STATUS1_OV_Msk)) & (u32ModuleMask)) - -/** - * @brief Get the data valid flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data valid status bits. Each bit corresponds to a data valid status, valid range are between 1~0x7FFFF. - * @return Return the data valid flag of the user-specified sample module. - * @details This macro is used to read VALID bit (EADC_STATUS0[15:0], EADC_STATUS1[2:0]) field to get data valid status. - */ -#define EADC_GET_DATA_VALID_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 & EADC_STATUS0_VALID_Msk) | (((eadc)->STATUS1 & EADC_STATUS1_VALID_Msk) << 16)) & (u32ModuleMask)) - -/** - * @brief Get the double data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the double data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DDATn[15:0], n=0~3) field to get conversion data. - */ -#define EADC_GET_DOUBLE_DATA(eadc, u32ModuleNum) ((eadc)->DDAT[(u32ModuleNum)] & EADC_DDAT0_RESULT_Msk) - -/** - * @brief Get the user-specified interrupt flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of interrupt status bits. Each bit corresponds to a interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return Return the user-specified interrupt flags. - * @details This macro is used to get the user-specified interrupt flags. - */ -#define EADC_GET_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 & (u32Mask)) - -/** - * @brief Get the user-specified sample module overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status, valid range are between 1~0x7FFFF. - * @return Return the user-specified sample module overrun flags. - * @details This macro is used to get the user-specified sample module overrun flags. - */ -#define EADC_GET_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS & (u32ModuleMask)) - -/** - * @brief Clear the selected interrupt status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of compare interrupt status bits. Each bit corresponds to a compare interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return None - * @details This macro is used to clear clear the selected interrupt status bits. - */ -#define EADC_CLR_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 = (u32Mask)) - -/** - * @brief Clear the selected sample module overrun status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status. - * Bit 0 is SPOVF0, bit 1 is SPOVF1..., bit 18 is SPOVF18. - * @return None - * @details This macro is used to clear the selected sample module overrun status bits. - */ -#define EADC_CLR_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS = (u32ModuleMask)) - -/** - * @brief Check all sample module A/D result data register overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register overrun flag is set to 1. - * @retval 1 Any one of sample module data register overrun flag is set to 1. - * @details The AOV bit (EADC_STATUS2[27]) will keep 1 when any one of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - */ -#define EADC_IS_DATA_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AOV_Msk) >> EADC_STATUS2_AOV_Pos) - -/** - * @brief Check all sample module A/D result data register valid flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register valid flag is set to 1. - * @retval 1 Any one of sample module data register valid flag is set to 1. - * @details The AVALID bit (EADC_STATUS2[26]) will keep 1 when any one of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - */ -#define EADC_IS_DATA_VALID(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AVALID_Msk) >> EADC_STATUS2_AVALID_Pos) - -/** - * @brief Check all A/D sample module start of conversion overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module event overrun flag is set to 1. - * @retval 1 Any one of sample module event overrun flag is set to 1. - * @details The STOVF bit (EADC_STATUS2[25]) will keep 1 when any one of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - */ -#define EADC_IS_SAMPLE_MODULE_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_STOVF_Msk) >> EADC_STATUS2_STOVF_Pos) - -/** - * @brief Check all A/D interrupt flag overrun bits. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of ADINT interrupt flag is overwritten to 1. - * @retval 1 Any one of ADINT interrupt flag is overwritten to 1. - * @details The ADOVIF bit (EADC_STATUS2[24]) will keep 1 when any one of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - */ -#define EADC_IS_INT_FLAG_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_ADOVIF_Msk) >> EADC_STATUS2_ADOVIF_Pos) - -/** - * @brief Get the busy state of EADC. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 Idle state. - * @retval 1 Busy state. - * @details This macro is used to read BUSY bit (EADC_STATUS2[23]) to get busy state. - */ -#define EADC_IS_BUSY(eadc) (((eadc)->STATUS2 & EADC_STATUS2_BUSY_Msk) >> EADC_STATUS2_BUSY_Pos) - -/** - * @brief Configure the comparator 0 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP0(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 0 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - */ -#define EADC_ENABLE_CMP0(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[0] |=(((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1UL) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk)) - -/** - * @brief Configure the comparator 1 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP1(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 1 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - */ -#define EADC_ENABLE_CMP1(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[1] |=(((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1UL) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk)) - -/** - * @brief Configure the comparator 2 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP2(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 2 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - */ -#define EADC_ENABLE_CMP2(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[2] |=(((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1UL) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk)) - -/** - * @brief Configure the comparator 3 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 1~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP3(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 3 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - */ -#define EADC_ENABLE_CMP3(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[3] |=(((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1UL) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk)) - -/** - * @brief Enable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched. - */ -#define EADC_ENABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_CMPWEN_Msk) - -/** - * @brief Disable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - */ -#define EADC_DISABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_CMPWEN_Msk) - -/** - * @brief Enable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) - * and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, - * if ADCMPIE is set to 1, a compare interrupt request is generated. - */ -#define EADC_ENABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details This macro is used to disable the compare interrupt. - */ -#define EADC_DISABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable comparator 0. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 0. - */ -#define EADC_DISABLE_CMP0(eadc) ((eadc)->CMP[0] = 0UL) - -/** - * @brief Disable comparator 1. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 1. - */ -#define EADC_DISABLE_CMP1(eadc) ((eadc)->CMP[1] = 0UL) - -/** - * @brief Disable comparator 2. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 2. - */ -#define EADC_DISABLE_CMP2(eadc) ((eadc)->CMP[2] = 0UL) - -/** - * @brief Disable comparator 3. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 3. - */ -#define EADC_DISABLE_CMP3(eadc) ((eadc)->CMP[3] = 0UL) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EADC functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode); -void EADC_Close(EADC_T *eadc); -void EADC_ConfigSampleModule(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerSrc, uint32_t u32Channel); -void EADC_SetTriggerDelayTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerDelayTime, uint32_t u32DelayClockDivider); -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime); - -/**@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EADC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EADC_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ebi.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ebi.h deleted file mode 100644 index 77c928b8696..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ebi.h +++ /dev/null @@ -1,369 +0,0 @@ -/**************************************************************************//** - * @file nu_ebi.h - * @version V3.00 - * @brief External Bus Interface(EBI) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EBI_H__ -#define __NU_EBI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_CONSTANTS EBI Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0_BASE_ADDR 0x60000000UL /*!< EBI bank0 base address \hideinitializer */ -#define EBI_BANK1_BASE_ADDR 0x60100000UL /*!< EBI bank1 base address \hideinitializer */ -#define EBI_BANK2_BASE_ADDR 0x60200000UL /*!< EBI bank2 base address \hideinitializer */ -#define EBI_BANK0_BASE_ADDR_NS 0x70000000UL /*!< EBI bank0 base address for Non-Secure \hideinitializer */ -#define EBI_BANK1_BASE_ADDR_NS 0x70100000UL /*!< EBI bank1 base address for Non-Secure \hideinitializer */ -#define EBI_BANK2_BASE_ADDR_NS 0x70200000UL /*!< EBI bank2 base address for Non-Secure \hideinitializer */ -#define EBI_MAX_SIZE 0x00100000UL /*!< Maximum EBI size for each bank is 1 MB \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI bank number */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0 0UL /*!< EBI bank 0 \hideinitializer */ -#define EBI_BANK1 1UL /*!< EBI bank 1 \hideinitializer */ -#define EBI_BANK2 2UL /*!< EBI bank 2 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI data bus width */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BUSWIDTH_8BIT 8UL /*!< EBI bus width is 8-bit \hideinitializer */ -#define EBI_BUSWIDTH_16BIT 16UL /*!< EBI bus width is 16-bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI CS Active Level */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_CS_ACTIVE_LOW 0UL /*!< EBI CS active level is low \hideinitializer */ -#define EBI_CS_ACTIVE_HIGH 1UL /*!< EBI CS active level is high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI MCLK divider and Timing */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_MCLKDIV_1 0x0UL /*!< EBI output clock(MCLK) is HCLK/1 \hideinitializer */ -#define EBI_MCLKDIV_2 0x1UL /*!< EBI output clock(MCLK) is HCLK/2 \hideinitializer */ -#define EBI_MCLKDIV_4 0x2UL /*!< EBI output clock(MCLK) is HCLK/4 \hideinitializer */ -#define EBI_MCLKDIV_8 0x3UL /*!< EBI output clock(MCLK) is HCLK/8 \hideinitializer */ -#define EBI_MCLKDIV_16 0x4UL /*!< EBI output clock(MCLK) is HCLK/16 \hideinitializer */ -#define EBI_MCLKDIV_32 0x5UL /*!< EBI output clock(MCLK) is HCLK/32 \hideinitializer */ -#define EBI_MCLKDIV_64 0x6UL /*!< EBI output clock(MCLK) is HCLK/64 \hideinitializer */ -#define EBI_MCLKDIV_128 0x7UL /*!< EBI output clock(MCLK) is HCLK/128 \hideinitializer */ - -#define EBI_TIMING_FASTEST 0x0UL /*!< EBI timing is the fastest \hideinitializer */ -#define EBI_TIMING_VERYFAST 0x1UL /*!< EBI timing is very fast \hideinitializer */ -#define EBI_TIMING_FAST 0x2UL /*!< EBI timing is fast \hideinitializer */ -#define EBI_TIMING_NORMAL 0x3UL /*!< EBI timing is normal \hideinitializer */ -#define EBI_TIMING_SLOW 0x4UL /*!< EBI timing is slow \hideinitializer */ -#define EBI_TIMING_VERYSLOW 0x5UL /*!< EBI timing is very slow \hideinitializer */ -#define EBI_TIMING_SLOWEST 0x6UL /*!< EBI timing is the slowest \hideinitializer */ - -#define EBI_OPMODE_NORMAL 0x0UL /*!< EBI bus operate in normal mode \hideinitializer */ -#define EBI_OPMODE_CACCESS (EBI_CTL_CACCESS_Msk) /*!< EBI bus operate in Continuous Data Access mode \hideinitializer */ -#define EBI_OPMODE_ADSEPARATE (EBI_CTL_ADSEPEN_Msk) /*!< EBI bus operate in AD Separate mode \hideinitializer */ - -/**@}*/ /* end of group EBI_EXPORTED_CONSTANTS */ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Read 8-bit data on EBI bank0 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA8(ebi, u32Addr) (*((volatile unsigned char *)((((ebi)==EBI_S)? EBI_BANK0_BASE_ADDR:EBI_BANK0_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank0 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA8(ebi, u32Addr, u32Data) (*((volatile unsigned char *)((((ebi)==EBI_S)? EBI_BANK0_BASE_ADDR:EBI_BANK0_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank0 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA16(ebi, u32Addr) (*((volatile unsigned short *)((((ebi)==EBI_S)? EBI_BANK0_BASE_ADDR:EBI_BANK0_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank0 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA16(ebi, u32Addr, u32Data) (*((volatile unsigned short *)((((ebi)==EBI_S)? EBI_BANK0_BASE_ADDR:EBI_BANK0_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank0 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA32(ebi, u32Addr) (*((volatile unsigned int *)((((ebi)==EBI_S)? EBI_BANK0_BASE_ADDR:EBI_BANK0_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank0 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA32(ebi, u32Addr, u32Data) (*((volatile unsigned int *)((((ebi)==EBI_S)? EBI_BANK0_BASE_ADDR:EBI_BANK0_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank1 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA8(ebi, u32Addr) (*((volatile unsigned char *)((((ebi)==EBI_S)? EBI_BANK1_BASE_ADDR:EBI_BANK1_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank1 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA8(ebi, u32Addr, u32Data) (*((volatile unsigned char *)((((ebi)==EBI_S)? EBI_BANK1_BASE_ADDR:EBI_BANK1_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank1 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA16(ebi, u32Addr) (*((volatile unsigned short *)((((ebi)==EBI_S)? EBI_BANK1_BASE_ADDR:EBI_BANK1_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank1 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA16(ebi, u32Addr, u32Data) (*((volatile unsigned short *)((((ebi)==EBI_S)? EBI_BANK1_BASE_ADDR:EBI_BANK1_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank1 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA32(ebi, u32Addr) (*((volatile unsigned int *)((((ebi)==EBI_S)? EBI_BANK1_BASE_ADDR:EBI_BANK1_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank1 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA32(ebi, u32Addr, u32Data) (*((volatile unsigned int *)((((ebi)==EBI_S)? EBI_BANK1_BASE_ADDR:EBI_BANK1_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank2 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA8(ebi, u32Addr) (*((volatile unsigned char *)((((ebi)==EBI_S)? EBI_BANK2_BASE_ADDR:EBI_BANK2_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank2 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA8(ebi, u32Addr, u32Data) (*((volatile unsigned char *)((((ebi)==EBI_S)? EBI_BANK2_BASE_ADDR:EBI_BANK2_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank2 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank2. - */ -#define EBI2_READ_DATA16(ebi, u32Addr) (*((volatile unsigned short *)((((ebi)==EBI_S)? EBI_BANK2_BASE_ADDR:EBI_BANK2_BASE_ADDR_NS)+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank2 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA16(ebi, u32Addr, u32Data) (*((volatile unsigned short *)((((ebi)==EBI_S)? EBI_BANK2_BASE_ADDR:EBI_BANK2_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank2 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA32(ebi, u32Addr) (*((volatile unsigned int *)((((ebi)==EBI_S)? EBI_BANK2_BASE_ADDR:EBI_BANK2_BASE_ADDR_NS)+(u32Addr)))) -/** - * @brief Write 32-bit data to EBI bank2 - * - * @param[in] ebi The pointer of EBI module. - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA32(ebi, u32Addr, u32Data) (*((volatile unsigned int *)((((ebi)==EBI_S)? EBI_BANK2_BASE_ADDR:EBI_BANK2_BASE_ADDR_NS)+(u32Addr))) = (u32Data)) - -/** - * @brief Enable EBI Write Buffer - * - * @param[in] ebi The pointer of EBI module. - * - * @return None - * - * @details This macro is used to improve EBI write operation for all EBI banks. - * \hideinitializer - */ -#define EBI_ENABLE_WRITE_BUFFER(ebi) ((ebi)->CTL0 |= EBI_CTL_WBUFEN_Msk) - -/** - * @brief Disable EBI Write Buffer - * - * @param[in] ebi The pointer of EBI module. - * - * @return None - * - * @details This macro is used to disable EBI write buffer function. - * \hideinitializer - */ -#define EBI_DISABLE_WRITE_BUFFER(ebi) ((ebi)->CTL0 &= ~EBI_CTL_WBUFEN_Msk) - -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel); -void EBI_Close(uint32_t u32Bank); -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv); - -/**@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EBI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EBI_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ecap.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ecap.h deleted file mode 100644 index 16abdae8328..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ecap.h +++ /dev/null @@ -1,458 +0,0 @@ -/**************************************************************************//** - * @file nu_ecap.h - * @version V3.00 - - * @brief EnHanced Input Capture Timer(ECAP) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_ECAP_H__ -#define __NU_ECAP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_CONSTANTS ECAP Exported Constants - @{ -*/ - -#define ECAP_IC0 (0UL) /*!< ECAP IC0 Unit \hideinitializer */ -#define ECAP_IC1 (1UL) /*!< ECAP IC1 Unit \hideinitializer */ -#define ECAP_IC2 (2UL) /*!< ECAP IC2 Unit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ECAP CTL0 constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ECAP_NOISE_FILTER_CLKDIV_1 (0UL<CTL0 = ((ecap)->CTL0 & ~ECAP_CTL0_NFCLKSEL_Msk)|(u32ClkSel)) - -/** - * @brief This macro is used to disable noise filter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the noise filter of input capture. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_DISABLE(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPNFDIS_Msk) - -/** - * @brief This macro is used to enable noise filter - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSel Select noise filter clock divide number - * - \ref ECAP_NOISE_FILTER_CLKDIV_1 - * - \ref ECAP_NOISE_FILTER_CLKDIV_2 - * - \ref ECAP_NOISE_FILTER_CLKDIV_4 - * - \ref ECAP_NOISE_FILTER_CLKDIV_16 - * - \ref ECAP_NOISE_FILTER_CLKDIV_32 - * - \ref ECAP_NOISE_FILTER_CLKDIV_64 - * @return None - * @details This macro will enable the noise filter of input capture and set noise filter clock divide. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_ENABLE(ecap, u32ClkSel) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPNFDIS_Msk|ECAP_CTL0_NFCLKSEL_Msk))|(u32ClkSel)) - -/** - * @brief This macro is used to enable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will enable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_ENABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will disable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_DISABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to select input channel source - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Src The input source - * - \ref ECAP_CAP_INPUT_SRC_FROM_IC - * - \ref ECAP_CAP_INPUT_SRC_FROM_CH - * @return None - * @details This macro will select the input source from ICx, CHx. - * \hideinitializer - */ -#define ECAP_SEL_INPUT_SRC(ecap, u32Index, u32Src) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPSEL0_Msk<<((u32Index)<<1)))|(((u32Src)<CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return None - * @details This macro will disable the input channel_n interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_INT(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to enable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_OVF_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to disable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_OVF_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to enable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to disable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to start capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will start capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_START(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to stop capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will stop capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_STOP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to set event to clear capture counter - * @param[in] ecap Specify ECAP port - * @param[in] u32Event The input channel number - * - \ref ECAP_CTL0_CMPCLREN_Msk - * - \ref ECAP_CTL1_CAP0RLDEN_Msk - * - \ref ECAP_CTL1_CAP1RLDEN_Msk - * - \ref ECAP_CTL1_CAP2RLDEN_Msk - * - \ref ECAP_CTL1_OVRLDEN_Msk - - * @return None - * @details This macro will enable and select compare or capture event that can clear capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CLEAR_EVENT(ecap, u32Event) do{ \ - if((u32Event) & ECAP_CTL0_CMPCLREN_Msk) \ - (ecap)->CTL0 |= ECAP_CTL0_CMPCLREN_Msk; \ - else \ - (ecap)->CTL0 &= ~ECAP_CTL0_CMPCLREN_Msk; \ - (ecap)->CTL1 = ((ecap)->CTL1 &(uint32_t)(~0xF00)) | ((u32Event) & 0xF00); \ - }while(0); - -/** - * @brief This macro is used to enable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the compare function. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to disable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the compare function. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to enable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_ENABLE_CNT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to disable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_DISABLE_CNT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to select input channel edge detection - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Edge The input source - * - \ref ECAP_RISING_EDGE - * - \ref ECAP_FALLING_EDGE - * - \ref ECAP_RISING_FALLING_EDGE - * @return None - * @details This macro will select input capture can detect falling edge, rising edge or either rising or falling edge change. - * \hideinitializer - */ -#define ECAP_SEL_CAPTURE_EDGE(ecap, u32Index, u32Edge) ((ecap)->CTL1 = ((ecap)->CTL1 & ~(ECAP_CTL1_EDGESEL0_Msk<<((u32Index)<<1)))|((u32Edge)<<((u32Index)<<1))) - -/** - * @brief This macro is used to select ECAP counter reload trigger source - * @param[in] ecap Specify ECAP port - * @param[in] u32TrigSrc The input source - * - \ref ECAP_CTL1_CAP0RLDEN_Msk - * - \ref ECAP_CTL1_CAP1RLDEN_Msk - * - \ref ECAP_CTL1_CAP2RLDEN_Msk - * - \ref ECAP_CTL1_OVRLDEN_Msk - * @return None - * @details This macro will select capture counter reload trigger source. - * \hideinitializer - */ -#define ECAP_SEL_RELOAD_TRIG_SRC(ecap, u32TrigSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~0xF00)|(u32TrigSrc)) - -/** - * @brief This macro is used to select capture timer clock divide. - * @param[in] ecap Specify ECAP port - * @param[in] u32Clkdiv The input source - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_1 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_4 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_16 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_32 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_64 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_96 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_112 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_128 - * @return None - * @details This macro will select capture timer clock has a pre-divider with eight divided option. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_DIV(ecap, u32Clkdiv) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CLKSEL_Msk)|(u32Clkdiv)) - -/** - * @brief This macro is used to select capture timer/counter clock source - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSrc The input source - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP_CLK - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP0 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP1 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP2 - * @return None - * @details This macro will select capture timer/clock clock source. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_SRC(ecap, u32ClkSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CNTSRCSEL_Msk)|(u32ClkSrc)) - -/** - * @brief This macro is used to read input capture status - * @param[in] ecap Specify ECAP port - * @return Input capture status flags - * @details This macro will get the input capture interrupt status. - * \hideinitializer - */ -#define ECAP_GET_INT_STATUS(ecap) ((ecap)->STATUS) - -/** - * @brief This macro is used to get input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to get the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_GET_CAPTURE_FLAG(ecap, u32Mask) (((ecap)->STATUS & (u32Mask))?1:0) - -/** - * @brief This macro is used to clear input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to clear the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_CLR_CAPTURE_FLAG(ecap, u32Mask) ((ecap)->STATUS = (u32Mask)) - -/** - * @brief This macro is used to set input capture counter value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Counter value - * @return None - * @details This macro will set a counter value of input capture. - * \hideinitializer - */ -#define ECAP_SET_CNT_VALUE(ecap, u32Val) ((ecap)->CNT = (u32Val)) - -/** - * @brief This macro is used to get input capture counter value - * @param[in] ecap Specify ECAP port - * @return Capture counter value - * @details This macro will get a counter value of input capture. - * \hideinitializer - */ -#define ECAP_GET_CNT_VALUE(ecap) ((ecap)->CNT) - -/** - * @brief This macro is used to get input capture counter hold value - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return Capture counter hold value - * @details This macro will get a hold value of input capture channel_n. - * \hideinitializer - */ -#define ECAP_GET_CNT_HOLD_VALUE(ecap, u32Index) (*(__IO uint32_t *) (&((ecap)->HLD0) + (u32Index))) - -/** - * @brief This macro is used to set input capture counter compare value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Input capture compare value - * @return None - * @details This macro will set a compare value of input capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CMP(ecap, u32Val) ((ecap)->CNTCMP = (u32Val)) - -void ECAP_Open(ECAP_T* ecap, uint32_t u32FuncMask); -void ECAP_Close(ECAP_T* ecap); -void ECAP_EnableINT(ECAP_T* ecap, uint32_t u32Mask); -void ECAP_DisableINT(ECAP_T* ecap, uint32_t u32Mask); -/**@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group ECAP_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_ECAP_H__*/ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_epwm.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_epwm.h deleted file mode 100644 index 5d7d7a3e2de..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_epwm.h +++ /dev/null @@ -1,650 +0,0 @@ -/**************************************************************************//** - * @file nu_epwm.h - * @version V3.00 - * @brief M2354 series EPWM driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EPWM_H__ -#define __NU_EPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - -/** @addtogroup EPWM_EXPORTED_CONSTANTS EPWM Exported Constants - @{ -*/ -#define EPWM_CHANNEL_NUM (6UL) /*!< EPWM channel number */ -#define EPWM_CH_0_MASK (0x1UL) /*!< EPWM channel 0 mask \hideinitializer */ -#define EPWM_CH_1_MASK (0x2UL) /*!< EPWM channel 1 mask \hideinitializer */ -#define EPWM_CH_2_MASK (0x4UL) /*!< EPWM channel 2 mask \hideinitializer */ -#define EPWM_CH_3_MASK (0x8UL) /*!< EPWM channel 3 mask \hideinitializer */ -#define EPWM_CH_4_MASK (0x10UL) /*!< EPWM channel 4 mask \hideinitializer */ -#define EPWM_CH_5_MASK (0x20UL) /*!< EPWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_UP_COUNTER (0UL) /*!< Up counter type */ -#define EPWM_DOWN_COUNTER (1UL) /*!< Down counter type */ -#define EPWM_UP_DOWN_COUNTER (2UL) /*!< Up-Down counter type */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_EDGE_ALIGNED (1UL) /*!< EPWM working in edge aligned type(down count) */ -#define EPWM_CENTER_ALIGNED (2UL) /*!< EPWM working in center aligned type */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_OUTPUT_NOTHING (0UL) /*!< EPWM output nothing */ -#define EPWM_OUTPUT_LOW (1UL) /*!< EPWM output low */ -#define EPWM_OUTPUT_HIGH (2UL) /*!< EPWM output high */ -#define EPWM_OUTPUT_TOGGLE (3UL) /*!< EPWM output toggle */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_SSCTL_SSRC_EPWM0 (0UL<CTL1 = (epwm)->CTL1 | (0x7ul<CTL1 = (epwm)->CTL1 & ~(0x7ul<CTL0 = (epwm)->CTL0 | EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief This macro disable group mode - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to disable group mode of EPWM module. - * \hideinitializer - */ -#define EPWM_DISABLE_GROUP_MODE(epwm) ((epwm)->CTL0 = (epwm)->CTL0 & ~EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief Enable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32SyncSrc Synchronous start source selection, valid values are: - * - \ref EPWM_SSCTL_SSRC_EPWM0 - * - \ref EPWM_SSCTL_SSRC_EPWM1 - * - \ref EPWM_SSCTL_SSRC_BPWM0 - * - \ref EPWM_SSCTL_SSRC_BPWM1 - * @return None - * @details This macro is used to enable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_TIMER_SYNC(epwm, u32ChannelMask, u32SyncSrc) ((epwm)->SSCTL = ((epwm)->SSCTL & ~EPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | (u32ChannelMask)) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_DISABLE_TIMER_SYNC(epwm, u32ChannelMask) \ - do{ \ - int i;\ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1UL << i)) \ - { \ - (epwm)->SSCTL &= ~(1UL << i); \ - } \ - } \ - }while(0) - -/** - * @brief This macro enable EPWM counter synchronous start counting function. - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to make selected EPWM0 and EPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by EPWM_ENABLE_TIMER_SYNC() and EPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC_START(epwm) ((epwm)->SSTRG = EPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to enable output inverter of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_OUTPUT_INVERTER(epwm, u32ChannelMask) ((epwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured rising data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_RISING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured falling data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_FALLING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define EPWM_MASK_OUTPUT(epwm, u32ChannelMask, u32LevelMask) \ - do{ \ - (epwm)->MSKEN = (u32ChannelMask); \ - (epwm)->MSK = (u32LevelMask); \ - }while(0) - -/** - * @brief This macro set the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @return None - * @details This macro is used to set the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescaler) ((epwm)->CLKPSC[(u32ChannelNum) >> 1] = (u32Prescaler)) - -/** - * @brief This macro get the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @details This macro is used to get the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_GET_PRESCALER(epwm, u32ChannelNum) ((epwm)->CLKPSC[(u32ChannelNum) >> 1U]) - -/** - * @brief This macro set the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_CMR(epwm, u32ChannelNum, u32CMR) ((epwm)->CMPDAT[(u32ChannelNum)]= (u32CMR)) - -/** - * @brief This macro get the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the comparator of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the comparator of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CMR(epwm, u32ChannelNum) ((epwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the free trigger comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32FTCMR Free trigger comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the free trigger comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_FTCMR(epwm, u32ChannelNum, u32FTCMR) (((epwm)->FTCMPDAT[((u32ChannelNum) >> 1U)]) = (u32FTCMR)) - -/** - * @brief This macro set the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the period of specified channel. - * @note This new setting will take effect on next EPWM period. - * @note EPWM counter will stop if period length set to 0. - * \hideinitializer - */ -#define EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR) ((epwm)->PERIOD[(u32ChannelNum)] = (u32CNR)) - -/** - * @brief This macro get the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the period of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the period of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CNR(epwm, u32ChannelNum) ((epwm)->PERIOD[(u32ChannelNum)]) - -/** - * @brief This macro set the EPWM aligned type - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32AlignedType EPWM aligned type, valid values are: - * - \ref EPWM_EDGE_ALIGNED - * - \ref EPWM_CENTER_ALIGNED - * @return None - * @details This macro is used to set the EPWM aligned type of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_ALIGNED_TYPE(epwm, u32ChannelMask, u32AlignedType) \ - do{ \ - uint32_t i; \ - for(i = 0UL; i < 6UL; i++) { \ - if((u32ChannelMask) & (1UL << i)) \ - { \ - (epwm)->CTL1 = (((epwm)->CTL1 & ~(3UL << (i << 1))) | ((u32AlignedType) << (i << 1))); \ - } \ - } \ - }while(0) - -/** - * @brief Set load window of window loading mode for specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to set load window of window loading mode for specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_LOAD_WINDOW(epwm, u32ChannelMask) ((epwm)->LOAD |= (u32ChannelMask)) - -/** - * @brief Trigger synchronous event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are 0, 2, 4 - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @return None - * @details This macro is used to trigger synchronous event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC(epwm, u32ChannelNum) ((epwm)->SWSYNC |= (1U << ((u32ChannelNum) >> 1))) - -/** - * @brief Clear counter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to clear counter of specified channel(s). - * \hideinitializer - */ -#define EPWM_CLR_COUNTER(epwm, u32ChannelMask) ((epwm)->CNTCLR |= (u32ChannelMask)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_OUTPUT_LEVEL(epwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - uint32_t i; \ - for(i = 0UL; i < 6UL; i++) { \ - if((u32ChannelMask) & (1UL << i)) { \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (i << 1))) | ((u32ZeroLevel) << (i << 1))); \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))) | ((u32PeriodLevel) << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (i << 1))) | ((u32CmpUpLevel) << (i << 1))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))) | ((u32CmpDownLevel) << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))); \ - } \ - } \ - }while(0) - -/** - * @brief Trigger brake event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @param[in] u32BrakeType Type of brake trigger. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This macro is used to trigger brake event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_BRAKE(epwm, u32ChannelMask, u32BrakeType) ((epwm)->SWBRK |= ((u32ChannelMask) << (u32BrakeType))) - -/** - * @brief Set Dead zone clock source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32AfterPrescaler Dead zone clock source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @return None - * @details This macro is used to set Dead zone clock source. Every two channels share the same setting. - * @note The write-protection function should be disabled before using this function. - * \hideinitializer - */ -#define EPWM_SET_DEADZONE_CLK_SRC(epwm, u32ChannelNum, u32AfterPrescaler) \ - (((epwm)->DTCTL[(u32ChannelNum) >> 1]) = ((epwm)->DTCTL[(u32ChannelNum) >> 1] & ~EPWM_DTCTL0_1_DTCKSEL_Msk) | \ - ((u32AfterPrescaler) << EPWM_DTCTL0_1_DTCKSEL_Pos)) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt); -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource); -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode); -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration); -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc); -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase); -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm); -void EPWM_EnableSyncPinInverse(EPWM_T *epwm); -void EPWM_DisableSyncPinInverse(EPWM_T *epwm); -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule); -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable); -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel); -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle); -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt); -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); - - -/**@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EPWM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EPWM_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewdt.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewdt.h deleted file mode 100644 index 6e07dd6a330..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewdt.h +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************//** - * @file nu_ewdt.h - * @version V3.00 - * @brief Extra Watchdog Timer(EWDT) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EWDT_H__ -#define __NU_EWDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EWDT_Driver EWDT Driver - @{ -*/ - -/** @addtogroup EWDT_EXPORTED_CONSTANTS EWDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* EWDT Time-out Interval Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EWDT_TIMEOUT_2POW4 (0UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^4 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW6 (1UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^6 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW8 (2UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^8 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW10 (3UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^10 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW12 (4UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^12 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW14 (5UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^14 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW16 (6UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^16 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW18 (7UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^18 * EWDT clocks \hideinitializer */ -#define EWDT_TIMEOUT_2POW20 (8UL << EWDT_CTL_TOUTSEL_Pos) /*!< Setting EWDT time-out interval to 2^20 * EWDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EWDT Reset Delay Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EWDT_RESET_DELAY_1026CLK (0UL << EWDT_ALTCTL_RSTDSEL_Pos) /*!< Setting EWDT reset delay period to 1026 * EWDT clocks \hideinitializer */ -#define EWDT_RESET_DELAY_130CLK (1UL << EWDT_ALTCTL_RSTDSEL_Pos) /*!< Setting EWDT reset delay period to 130 * EWDT clocks \hideinitializer */ -#define EWDT_RESET_DELAY_18CLK (2UL << EWDT_ALTCTL_RSTDSEL_Pos) /*!< Setting EWDT reset delay period to 18 * EWDT clocks \hideinitializer */ -#define EWDT_RESET_DELAY_3CLK (3UL << EWDT_ALTCTL_RSTDSEL_Pos) /*!< Setting EWDT reset delay period to 3 * EWDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EWDT Free Reset Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EWDT_RESET_COUNTER_KEYWORD (0x00005AA5UL) /*!< Fill this value to EWDT_RSTCNT register to free reset EWDT counter \hideinitializer */ - -/**@}*/ /* end of group EWDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup EWDT_EXPORTED_FUNCTIONS EWDT Exported Functions - @{ -*/ - -/** - * @brief Clear EWDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro clears EWDT time-out reset system flag. - * \hideinitializer - */ -#define EWDT_CLEAR_RESET_FLAG() (EWDT->CTL = (EWDT->CTL & ~(EWDT_CTL_IF_Msk | EWDT_CTL_WKF_Msk)) | EWDT_CTL_RSTF_Msk) - -/** - * @brief Clear EWDT Time-out Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro clears EWDT time-out interrupt flag. - * \hideinitializer - */ -#define EWDT_CLEAR_TIMEOUT_INT_FLAG() (EWDT->CTL = (EWDT->CTL & ~(EWDT_CTL_RSTF_Msk | EWDT_CTL_WKF_Msk)) | EWDT_CTL_IF_Msk) - -/** - * @brief Clear EWDT Wake-up Flag - * - * @param None - * - * @return None - * - * @details This macro clears EWDT time-out wake-up system flag. - * \hideinitializer - */ -#define EWDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (EWDT->CTL = (EWDT->CTL & ~(EWDT_CTL_RSTF_Msk | EWDT_CTL_IF_Msk)) | EWDT_CTL_WKF_Msk) - -/** - * @brief Get EWDT Time-out Reset Flag - * - * @param None - * - * @retval 0 EWDT time-out reset system did not occur - * @retval 1 EWDT time-out reset system occurred - * - * @details This macro indicates system has been reset by EWDT time-out reset or not. - * \hideinitializer - */ -#define EWDT_GET_RESET_FLAG() ((EWDT->CTL & EWDT_CTL_RSTF_Msk)? 1UL : 0UL) - -/** - * @brief Get EWDT Time-out Interrupt Flag - * - * @param None - * - * @retval 0 EWDT time-out interrupt did not occur - * @retval 1 EWDT time-out interrupt occurred - * - * @details This macro indicates EWDT time-out interrupt occurred or not. - * \hideinitializer - */ -#define EWDT_GET_TIMEOUT_INT_FLAG() ((EWDT->CTL & EWDT_CTL_IF_Msk)? 1UL : 0UL) - -/** - * @brief Get EWDT Time-out Wake-up Flag - * - * @param None - * - * @retval 0 EWDT time-out interrupt does not cause CPU wake-up - * @retval 1 EWDT time-out interrupt event cause CPU wake-up - * - * @details This macro indicates EWDT time-out interrupt event has waked up system or not. - * \hideinitializer - */ -#define EWDT_GET_TIMEOUT_WAKEUP_FLAG() ((EWDT->CTL & EWDT_CTL_WKF_Msk)? 1UL : 0UL) - -/** - * @brief Reset EWDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reset the internal 20-bit EWDT up counter value. - * @note If EWDT is activated and time-out reset system function is enabled also, user should \n - * reset the 20-bit EWDT up counter value to avoid generate EWDT time-out reset signal to \n - * reset system before the EWDT time-out reset delay period expires. - * \hideinitializer - */ -#define EWDT_RESET_COUNTER() (EWDT->RSTCNT = EWDT_RESET_COUNTER_KEYWORD) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void EWDT_Close(void); -__STATIC_INLINE void EWDT_EnableInt(void); -__STATIC_INLINE void EWDT_DisableInt(void); - -/** - * @brief Stop EWDT Counting - * - * @param None - * - * @return None - * - * @details This function will stop EWDT counting and disable EWDT module. - */ -__STATIC_INLINE void EWDT_Close(void) -{ - EWDT->CTL = 0UL; - while((EWDT->CTL & EWDT_CTL_SYNC_Msk) == EWDT_CTL_SYNC_Msk) {} /* Wait disable WDTEN bit completed, it needs 2 * EWDT_CLK. */ -} - -/** - * @brief Enable EWDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will enable the EWDT time-out interrupt function. - */ -__STATIC_INLINE void EWDT_EnableInt(void) -{ - EWDT->CTL |= EWDT_CTL_INTEN_Msk; -} - -/** - * @brief Disable EWDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will disable the EWDT time-out interrupt function. - */ -__STATIC_INLINE void EWDT_DisableInt(void) -{ - /* Do not touch another write 1 clear bits */ - EWDT->CTL &= ~(EWDT_CTL_INTEN_Msk | EWDT_CTL_RSTF_Msk | EWDT_CTL_IF_Msk | EWDT_CTL_WKF_Msk); -} - -void EWDT_Open(uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup); - -/**@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EWDT_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewwdt.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewwdt.h deleted file mode 100644 index a453e8094a0..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_ewwdt.h +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************//** - * @file nu_ewwdt.h - * @version V3.00 - * @brief Extra Window Watchdog Timer(EWWDT) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EWWDT_H__ -#define __NU_EWWDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EWWDT_Driver EWWDT Driver - @{ -*/ - -/** @addtogroup EWWDT_EXPORTED_CONSTANTS EWWDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* EWWDT Prescale Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EWWDT_PRESCALER_1 (0 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_2 (1 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_4 (2 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 4 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_8 (3 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 8 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_16 (4 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 16 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_32 (5 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 32 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_64 (6 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 64 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_128 (7 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 128 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_192 (8 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 192 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_256 (9 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 256 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_384 (10 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 384 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_512 (11 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 512 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_768 (12 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 768 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_1024 (13 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1024 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_1536 (14 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1536 * (64*EWWDT_CLK) \hideinitializer */ -#define EWWDT_PRESCALER_2048 (15 << EWWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2048 * (64*EWWDT_CLK) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EWWDT Reload Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EWWDT_RELOAD_WORD (0x00005AA5UL) /*!< Fill this value to EWWDT_RLDCNT register to reload EWWDT counter \hideinitializer */ - -/**@}*/ /* end of group EWWDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup EWWDT_EXPORTED_FUNCTIONS EWWDT Exported Functions - @{ -*/ - -/** - * @brief Clear EWWDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear EWWDT time-out reset system flag. - * \hideinitializer - */ -#define EWWDT_CLEAR_RESET_FLAG() (EWWDT->STATUS = EWWDT_STATUS_WWDTRF_Msk) - -/** - * @brief Clear EWWDT Compared Match Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear EWWDT compared match interrupt flag. - * \hideinitializer - */ -#define EWWDT_CLEAR_INT_FLAG() (EWWDT->STATUS = EWWDT_STATUS_WWDTIF_Msk) - -/** - * @brief Get EWWDT Reset System Flag - * - * @param None - * - * @retval 0 EWWDT time-out reset system did not occur - * @retval 1 EWWDT time-out reset system occurred - * - * @details This macro is used to indicate system has been reset by EWWDT time-out reset or not. - * \hideinitializer - */ -#define EWWDT_GET_RESET_FLAG() ((EWWDT->STATUS & EWWDT_STATUS_WWDTRF_Msk)? 1 : 0) - -/** - * @brief Get EWWDT Compared Match Interrupt Flag - * - * @param None - * - * @retval 0 EWWDT compare match interrupt did not occur - * @retval 1 EWWDT compare match interrupt occurred - * - * @details This macro is used to indicate EWWDT counter value matches CMPDAT value or not. - * \hideinitializer - */ -#define EWWDT_GET_INT_FLAG() ((EWWDT->STATUS & EWWDT_STATUS_WWDTIF_Msk)? 1 : 0) - -/** - * @brief Get EWWDT Counter - * - * @param None - * - * @return EWWDT Counter Value - * - * @details This macro reflects the current EWWDT counter value. - * \hideinitializer - */ -#define EWWDT_GET_COUNTER() (EWWDT->CNT) - -/** - * @brief Reload EWWDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reload the EWWDT counter value to 0x3F. - * @note User can only write EWWDT_RLDCNT register to reload EWWDT counter value when current EWWDT counter value \n - * between 0 and CMPDAT value. If user writes EWWDT_RLDCNT when current EWWDT counter value is larger than CMPDAT, \n - * EWWDT reset signal will generate immediately to reset system. - * \hideinitializer - */ -#define EWWDT_RELOAD_COUNTER() (EWWDT->RLDCNT = EWWDT_RELOAD_WORD) - -void EWWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt); - -/**@}*/ /* end of group EWWDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EWWDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EWWDT_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fmc.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fmc.h deleted file mode 100644 index 98700d318ca..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fmc.h +++ /dev/null @@ -1,588 +0,0 @@ -/**************************************************************************//** - * @file nu_fmc.h - * @version V3.0 - * $Revision: 2 $ - * $Date: 19/11/27 3:11p $ - * @brief M2355 Series Flash Memory Controller(FMC) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_FMC_H__ -#define __NU_FMC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - -/** @addtogroup FMC_EXPORTED_CONSTANTS FMC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Global constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ISBEN 0UL -#define FMC_ISP ( (__PC() & 0x10000000) ? FMC_NS : FMC) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Base Address */ -/*---------------------------------------------------------------------------------------------------------*/ -#define FMC_APROM_BASE 0x00000000UL /*!< APROM Base Address */ -#define FMC_APROM_END 0x00100000UL /*!< APROM end address */ -#define FMC_APROM_BANK0_END (FMC_APROM_END/2UL) /*!< APROM bank0 end address */ -#define FMC_LDROM_BASE 0x00100000UL /*!< LDROM Base Address */ -#define FMC_LDROM_END 0x00104000UL /*!< LDROM end address */ -#define FMC_DTFSH_BASE 0x00110000UL /*!< LDROM Base Address */ -#define FMC_DTFSH_END 0x00112000UL /*!< LDROM end address */ -#define FMC_XOM_BASE 0x00200000UL /*!< XOM Base Address */ -#define FMC_XOMR0_BASE 0x00200000UL /*!< XOMR 0 Base Address */ -#define FMC_XOMR1_BASE 0x00200010UL /*!< XOMR 1 Base Address */ -#define FMC_XOMR2_BASE 0x00200020UL /*!< XOMR 2 Base Address */ -#define FMC_XOMR3_BASE 0x00200030UL /*!< XOMR 3 Base Address */ -#define FMC_NSCBA_BASE 0x00210800UL /*!< Non-Secure base address */ -#define FMC_SCRLOCK_BASE 0x00610000UL /*!< Secure Region Lock base address */ -#define FMC_ARLOCK_BASE 0x00610008UL /*!< All Region Lock base address */ -#define FMC_CONFIG_BASE 0x00300000UL /*!< CONFIG Base Address */ -#define FMC_USER_CONFIG_0 0x00300000UL /*!< CONFIG 0 Address */ -#define FMC_USER_CONFIG_1 0x00300004UL /*!< CONFIG 1 Address */ -#define FMC_USER_CONFIG_2 0x00300008UL /*!< CONFIG 2 Address */ -#define FMC_USER_CONFIG_3 0x0030000CUL /*!< CONFIG 3 Address */ -#define FMC_OTP_BASE 0x00310000UL /*!< OTP flash base address */ - -#define FMC_FLASH_PAGE_SIZE 0x800UL /*!< Flash Page Size (2048 Bytes) */ -#define FMC_PAGE_ADDR_MASK 0xFFFFF800UL /*!< Flash page address mask */ -#define FMC_MULTI_WORD_PROG_LEN 512UL /*!< The maximum length of a multi-word program. */ - -#define FMC_APROM_SIZE FMC_APROM_END /*!< APROM Size */ -#define FMC_BANK_SIZE (FMC_APROM_SIZE/2UL) /*!< APROM Bank Size */ -#define FMC_LDROM_SIZE 0x4000UL /*!< LDROM Size (4 Kbytes) */ -#define FMC_OTP_ENTRY_CNT 256UL /*!< OTP entry number */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* XOM region number constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define XOMR0 0UL /*!< XOM region 0 */ -#define XOMR1 1UL /*!< XOM region 1 */ -#define XOMR2 2UL /*!< XOM region 2 */ -#define XOMR3 3UL /*!< XOM region 3 */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ISPCTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define IS_BOOT_FROM_LDROM 0x1UL /*!< ISPCTL setting to select to boot from LDROM */ -#define IS_BOOT_FROM_APROM 0x0UL /*!< ISPCTL setting to select to boot from APROM */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ISPCMD constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define FMC_ISPCMD_READ 0x00UL /*!< ISP Command: Read Flash */ -#define FMC_ISPCMD_READ_UID 0x04UL /*!< ISP Command: Read Unique ID */ -#define FMC_ISPCMD_READ_ALL1 0x08UL /*!< ISP Command: Read all-one result */ -#define FMC_ISPCMD_READ_CID 0x0BUL /*!< ISP Command: Read Company ID */ -#define FMC_ISPCMD_READ_DID 0x0CUL /*!< ISP Command: Read Device ID */ -#define FMC_ISPCMD_READ_CKS 0x0DUL /*!< ISP Command: Read Checksum */ -#define FMC_ISPCMD_PROGRAM 0x21UL /*!< ISP Command: 32-bit Program Flash */ -#define FMC_ISPCMD_PAGE_ERASE 0x22UL /*!< ISP Command: Page Erase Flash */ -#define FMC_ISPCMD_BANK_ERASE 0x23UL /*!< ISP Command: Erase Flash bank 0 or 1 */ -#define FMC_ISPCMD_PROGRAM_MUL 0x27UL /*!< ISP Command: Flash Multi-Word Program */ -#define FMC_ISPCMD_RUN_ALL1 0x28UL /*!< ISP Command: Run all-one verification */ -#define FMC_ISPCMD_BANK_REMAP 0x2CUL /*!< ISP Command: Bank Remap */ -#define FMC_ISPCMD_RUN_CKS 0x2DUL /*!< ISP Command: Run Check Calculation */ -#define FMC_ISPCMD_VECMAP 0x2EUL /*!< ISP Command: Set vector mapping */ -#define FMC_ISPCMD_READ_64 0x40UL /*!< ISP Command: 64-bit read Flash */ -#define FMC_ISPCMD_PROGRAM_64 0x61UL /*!< ISP Command: 64-bit program Flash */ - -#define READ_ALLONE_YES 0xA11FFFFFUL /*!< Check-all-one result is all one. */ -#define READ_ALLONE_NOT 0xA1100000UL /*!< Check-all-one result is not all one. */ -#define READ_ALLONE_CMD_FAIL 0xFFFFFFFFUL /*!< Check-all-one command failed. */ - -/**@}*/ /* end of group FMC_EXPORTED_CONSTANTS */ - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* FMC Macro Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -/** - * @brief Enable ISP Function - * - * @param None - * - * @return None - * - * @details This function will set ISPEN bit of ISPCTL control register to enable ISP function. - * - */ -#define FMC_ENABLE_ISP() (FMC_ISP->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) /*!< Enable ISP Function */ - -/** - * @brief Disable ISP Function - * - * @param None - * - * @return None - * - * @details This function will clear ISPEN bit of ISPCTL control register to disable ISP function. - * - */ -#define FMC_DISABLE_ISP() (FMC_ISP->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk) /*!< Disable ISP Function */ - -/** - * @brief Disable Non Secure ISP Function - * - * @param None - * - * @return None - * - * @details This function will clear ISPEN bit of ISPCTL control register to disable Non Secure ISP function. - * - */ - -#define FMC_ENABLE_LD_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) /*!< Enable LDROM Update Function */ - -/** - * @brief Disable LDROM Update Function - * - * @param None - * - * @return None - * - * @details This function will set ISPEN bit of ISPCTL control register to disable LDROM update function. - * - */ -#define FMC_DISABLE_LD_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk) /*!< Disable LDROM Update Function */ - -/** - * @brief Enable User Configuration Update Function - * - * @param None - * - * @return None - * - * @details This function will set CFGUEN bit of ISPCTL control register to enable User Configuration update function. - * User needs to set CFGUEN bit before they can update User Configuration area. - * - */ -#define FMC_ENABLE_CFG_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) /*!< Enable CONFIG Update Function */ - -/** - * @brief Disable User Configuration Update Function - * - * @param None - * - * @return None - * - * @details This function will clear CFGUEN bit of ISPCTL control register to disable User Configuration update function. - * - */ -#define FMC_DISABLE_CFG_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk) /*!< Disable CONFIG Update Function */ - - -/** - * @brief Enable APROM Update Function - * - * @param None - * - * @return None - * - * @details This function will set APUEN bit of ISPCTL control register to enable APROM update function. - * User needs to set APUEN bit before they can update APROM in APROM boot mode. - * - */ -#define FMC_ENABLE_AP_UPDATE() (FMC_ISP->ISPCTL |= FMC_ISPCTL_APUEN_Msk) /*!< Enable APROM Update Function */ - -/** - * @brief Disable APROM Update Function - * - * @param None - * - * @return None - * - * @details This function will clear APUEN bit of ISPCTL control register to disable APROM update function. - * - */ -#define FMC_DISABLE_AP_UPDATE() (FMC_ISP->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk) /*!< Disable APROM Update Function */ - -/** - * @brief Get ISP Fail Flag - * - * @param None - * - * @return None - * - * @details This function is used to get ISP fail flag when do ISP actoin. - * - */ -#define FMC_GET_FAIL_FLAG() ((FMC_ISP->ISPCTL & FMC_ISPCTL_ISPFF_Msk) ? 1UL : 0UL) /*!< Get ISP fail flag */ - -/** - * @brief Clear ISP Fail Flag - * - * @param None - * - * @return None - * - * @details This function is used to clear ISP fail flag when ISP fail flag set. - * - */ -#define FMC_CLR_FAIL_FLAG() (FMC_ISP->ISPCTL |= FMC_ISPCTL_ISPFF_Msk) /*!< Clear ISP fail flag */ - -/** - * @brief Enable ISP Interrupt - * - * @param None - * - * @return None - * - * @details This function will enable ISP action interrupt. - * - */ -#define FMC_ENABLE_ISP_INT() (FMC_ISP->ISPCTL |= FMC_ISPCTL_INTEN_Msk) /*!< Enable ISP interrupt */ - -/** - * @brief Disable ISP Interrupt - * - * @param None - * - * @return None - * - * @details This function will disable ISP action interrupt. - * - */ -#define FMC_DISABLE_ISP_INT() (FMC_ISP->ISPCTL &= ~FMC_ISPCTL_INTEN_Msk) /*!< Disable ISP interrupt */ - -/** - * @brief Get ISP Interrupt Flag - * - * @param None - * - * @return None - * - * @details This function will get ISP action interrupt status - * - */ -#define FMC_GET_ISP_INT_FLAG() ((FMC_ISP->ISPSTS & FMC_ISPSTS_INTFLAG_Msk) ? 1UL : 0UL) /*!< Get ISP interrupt flag Status */ - -/** - * @brief Clear ISP Interrupt Flag - * - * @param None - * - * @return None - * - * @details This function will clear ISP interrupt flag - * - */ -#define FMC_CLEAR_ISP_INT_FLAG() (FMC_ISP->ISPSTS = FMC_ISPSTS_INTFLAG_Msk) /*!< Clear ISP interrupt flag*/ - -/** - * @brief Enable Data Flash Scrambling Function - * - * @param None - * - * @return None - * - * @details This function will set SCRAMEN bit of DFCTL control register to enable Data Flash Scrambling Function. - * - */ -#define FMC_ENABLE_SCRAMBLE() (FMC->DFCTL |= FMC_DFCTL_SCRAMEN_Msk) /*!< Enable Data Flash Scrambling Function */ - -/** - * @brief Disable Data Flash Scrambling Function - * - * @param None - * - * @return None - * - * @details This function will clear SCRAMEN bit of DFCTL control register to disable Data Flash Scrambling Function. - * - */ -#define FMC_DISABLE_SCRAMBLE() (FMC->DFCTL &= ~FMC_DFCTL_SCRAMEN_Msk) /*!< Disable Data Flash Scrambling Function */ - -/** - * @brief Enable Data Flash Silent Access Function - * - * @param None - * - * @return None - * - * @details This function will set SILENTEN bit of DFCTL control register to enable Data Flash Silent Access Function. - * - */ -#define FMC_ENABLE_SILENT() (FMC->DFCTL |= FMC_DFCTL_SILENTEN_Msk) /*!< Enable Data Flash Silent Access Function */ - -/** - * @brief Disable Data Flash Silent Access Function - * - * @param None - * - * @return None - * - * @details This function will clear SILENTEN bit of DFCTL control register to disable Data Flash Silent Access Function. - * - */ -#define FMC_DISABLE_SILENT() (FMC->DFCTL &= ~FMC_DFCTL_SILENTEN_Msk) /*!< Disable Data Flash Silent Access Function */ - -/** - * @brief Enable Data Flash Temper Attack Program Function - * - * @param None - * - * @return None - * - * @details This function will set TMPCLR bit of DFCTL control register to enable Data Flash Temper Attack Program Function. - * - */ -#define FMC_ENABLE_TMPCLR() (FMC->DFCTL |= FMC_DFCTL_TMPCLR_Msk) /*!< Enable Data Flash Temper Attack Program Function */ - -/** - * @brief Disable Data Flash Temper Attack Program Function - * - * @param None - * - * @return None - * - * @details This function will clear TMPCLR bit of DFCTL control register to disable Data Flash Temper Attack Program Function. - * - */ -#define FMC_DISABLE_TMPCLR() (FMC->DFCTL &= ~FMC_DFCTL_TMPCLR_Msk) /*!< Disable Data Flash Temper Attack Program Function */ - -/** - * @brief Get Data Flash Temper Attack Programming Done Flag - * - * @param None - * - * @return None - * - * @details This function will get Data Flash Temper Attack Programming Done flag - * - */ -#define FMC_GET_TMPCLRDONE_FLAG() ((FMC->DFSTS & FMC_DFSTS_TMPCLRDONE_Msk) ? 1UL : 0UL) /*!< Get Data Flash Temper Attack Programming Done Flag */ - -/** - * @brief Get Data Flash Temper Attack Programming Busy Flag - * - * @param None - * - * @return None - * - * @details This function will get Data Flash Temper Attack Programming Busy flag - * - */ -#define FMC_GET_TMPCLRBUSY_FLAG() ((FMC->DFSTS & FMC_DFSTS_TMPCLRBUSY_Msk) ? 1UL : 0UL) /*!< Get Data Flash Temper Attack Programming Busy Flag */ - -/** - * @brief Clear Data Flash Temper Attack Programming Done Flag - * - * @param None - * - * @return None - * - * @details This function will clear Data Flash Temper Attack Programming Done flag - * - */ -#define FMC_CLEAR_TMPCLRDONE_FLAG() (FMC->DFSTS |= FMC_DFSTS_TMPCLRDONE_Msk) /*!< Clear Data Flash Temper Attack Programming Done Flag */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -__STATIC_INLINE uint32_t FMC_ReadCID(void); -__STATIC_INLINE uint32_t FMC_ReadPID(void); -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index); -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index); -__STATIC_INLINE void FMC_SetVectorPageAddr(uint32_t u32PageAddr); -__STATIC_INLINE uint32_t FMC_GetVECMAP(void); -__STATIC_INLINE void FMC_SetScrambleKey(uint32_t u32ScrambleKey); - -/** - * @brief Get current vector mapping address. - * - * @param None - * - * @return The current vector mapping address. - * - * @details To get VECMAP value which is the page address for remapping to vector page (0x0). - * - */ -__STATIC_INLINE uint32_t FMC_GetVECMAP(void) -{ - return (FMC->ISPSTS & FMC_ISPSTS_VECMAP_Msk); -} - -/** - * @brief Read company ID - * - * @param None - * - * @return The company ID (32-bit) - * - * @details The company ID of Nuvoton is fixed to be 0xDA - */ -__STATIC_INLINE uint32_t FMC_ReadCID(void) -{ - FMC_ISP->ISPCMD = FMC_ISPCMD_READ_CID; /* Set ISP Command Code */ - FMC_ISP->ISPADDR = 0x0u; /* Must keep 0x0 when read CID */ - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC_ISP->ISPDAT; -} - -/** - * @brief Read product ID - * - * @param None - * - * @return The product ID (32-bit) - * - * @details This function is used to read product ID. - */ -__STATIC_INLINE uint32_t FMC_ReadPID(void) -{ - FMC_ISP->ISPCMD = FMC_ISPCMD_READ_DID; /* Set ISP Command Code */ - FMC_ISP->ISPADDR = 0x04u; /* Must keep 0x4 when read PID */ - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC_ISP->ISPDAT; -} - - -/** - * @brief Read Unique ID - * - * @param[in] u8Index UID index. 0 = UID[31:0], 1 = UID[63:32], 2 = UID[95:64] - * - * @return The 32-bit unique ID data of specified UID index. - * - * @details To read out 96-bit Unique ID. - */ -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index) -{ - FMC_ISP->ISPCMD = FMC_ISPCMD_READ_UID; - FMC_ISP->ISPADDR = ((uint32_t)u8Index << 2u); - FMC_ISP->ISPDAT = 0u; - FMC_ISP->ISPTRG = 0x1u; -#if ISBEN - __ISB(); -#endif - while(FMC_ISP->ISPTRG) {} - - return FMC_ISP->ISPDAT; -} - -/** - * @brief To read UCID - * - * @param[in] u32Index Index of the UCID to read. u32Index must be 0, 1, 2, or 3. - * - * @return The UCID of specified index - * - * @details This function is used to read unique chip ID (UCID). - */ -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index) -{ - FMC_ISP->ISPCMD = FMC_ISPCMD_READ_UID; /* Set ISP Command Code */ - FMC_ISP->ISPADDR = (0x04u * u32Index) + 0x10u; /* The UCID is at offset 0x10 with word alignment. */ - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC_ISP->ISPDAT; -} - - -/** - * @brief Set vector mapping address - * - * @param[in] u32PageAddr The page address to remap to address 0x0. The address must be page alignment. - * - * @return To set VECMAP to remap specified page address to 0x0. - * - * @details This function is used to set VECMAP to map specified page to vector page (0x0). - */ -__STATIC_INLINE void FMC_SetVectorPageAddr(uint32_t u32PageAddr) -{ - FMC->ISPCMD = FMC_ISPCMD_VECMAP; /* Set ISP Command Code */ - FMC->ISPADDR = u32PageAddr; /* The address of specified page which will be map to address 0x0. It must be page alignment. */ - FMC->ISPTRG = 0x1u; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC->ISPTRG) {} /* Waiting for ISP Done */ -} - -/** - * @brief Set Data Flash scrambling key - * - * @param[in] u32ScramKey The value of scrambling key. - * - * @return NULL - * - * @details This function is used to set Data Flash scrambling key. - */ -__STATIC_INLINE void FMC_SetScrambleKey(uint32_t u32ScrambleKey) -{ - FMC->SCRKEY = u32ScrambleKey; -} - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -extern uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count); -extern void FMC_Close(void); -extern int32_t FMC_ConfigXOM(uint32_t xom_num, uint32_t xom_base, uint8_t xom_page); -extern int32_t FMC_Erase(uint32_t u32PageAddr); -extern int32_t FMC_EraseBank(uint32_t u32BankAddr); -extern int32_t FMC_EraseXOM(uint32_t xom_num); -extern uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count); -extern int32_t FMC_IsOTPLocked(uint32_t otp_num); -extern int32_t FMC_GetXOMState(uint32_t xom_num); -extern int32_t FMC_LockOTP(uint32_t otp_num); -extern void FMC_Open(void); -extern uint32_t FMC_Read(uint32_t u32Addr); -extern int32_t FMC_Read64(uint32_t u32addr, uint32_t * u32data0, uint32_t * u32data1); -extern int32_t FMC_ReadOTP(uint32_t otp_num, uint32_t *low_word, uint32_t *high_word); -extern int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count); -extern void FMC_Write(uint32_t u32Addr, uint32_t u32Data); -extern int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1); -extern int32_t FMC_WriteConfig(uint32_t au32Config[], uint32_t u32Count); -extern int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len); -extern int32_t FMC_WriteOTP(uint32_t otp_num, uint32_t low_word, uint32_t high_word); -extern int32_t FMC_WriteMultipleA(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len); -extern int32_t FMC_RemapBank(uint32_t u32Bank); - -/**@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group FMC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_FMC_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fvc.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fvc.h deleted file mode 100644 index 858ccd3fa1b..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_fvc.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************//** - * @file nu_fvc.h - * @version V3.00 - * @brief Firmware Version Counter Driver Header - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_FVC_H__ -#define __NU_FVC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FVC_Driver FVC Driver - @{ -*/ - -/** @addtogroup FVC_EXPORTED_CONSTANTS FVC Exported Constants - @{ -*/ - -#define FVC_VCODE (0x77100000ul) /*!< The key code for FVC_CTL write. */ - -/**@}*/ /* end of group FVC_EXPORTED_CONSTANTS */ - - -/** @addtogroup FVC_EXPORTED_FUNCTIONS FVC Exported Functions - @{ -*/ - -int32_t FVC_Open(void); -void FVC_EnableMonotone(void); -int32_t FVC_SetNVC(uint32_t u32NvcIdx, uint32_t u32Cnt); -int32_t FVC_GetNVC(uint32_t u32NvcIdx); - - -/**@}*/ /* end of group FVC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group FVC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_FVC_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_gpio.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_gpio.h deleted file mode 100644 index 3a8f8724524..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_gpio.h +++ /dev/null @@ -1,1155 +0,0 @@ -/**************************************************************************//** - * @file nu_gpio.h - * @version V3.0 - * @brief M2354 series General Purpose I/O (GPIO) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_GPIO_H__ -#define __NU_GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_CONSTANTS GPIO Exported Constants - @{ -*/ - -#define GPIO_PIN_MAX 16UL /*!< Specify Maximum Pins of Each GPIO Port */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_MODE_INPUT 0x0UL /*!< Input Mode */ -#define GPIO_MODE_OUTPUT 0x1UL /*!< Output Mode */ -#define GPIO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode */ -#define GPIO_MODE_QUASI 0x3UL /*!< Quasi-bidirectional Mode */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Interrupt Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INT_RISING 0x00010000UL /*!< Interrupt enable by Input Rising Edge */ -#define GPIO_INT_FALLING 0x00000001UL /*!< Interrupt enable by Input Falling Edge */ -#define GPIO_INT_BOTH_EDGE 0x00010001UL /*!< Interrupt enable by both Rising Edge and Falling Edge */ -#define GPIO_INT_HIGH 0x01010000UL /*!< Interrupt enable by Level-High */ -#define GPIO_INT_LOW 0x01000001UL /*!< Interrupt enable by Level-Level */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_INTTYPE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INTTYPE_EDGE 0UL /*!< GPIO_INTTYPE Setting for Edge Trigger Mode */ -#define GPIO_INTTYPE_LEVEL 1UL /*!< GPIO_INTTYPE Setting for Edge Level Mode */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Slew Rate Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_SLEWCTL_NORMAL 0x0UL /*!< GPIO slew setting for normal Mode */ -#define GPIO_SLEWCTL_HIGH 0x1UL /*!< GPIO slew setting for high Mode */ -#define GPIO_SLEWCTL_FAST 0x2UL /*!< GPIO slew setting for fast Mode */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Pull-up And Pull-down Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_PUSEL_DISABLE 0x0UL /*!< GPIO PUSEL setting for Disable Mode */ -#define GPIO_PUSEL_PULL_UP 0x1UL /*!< GPIO PUSEL setting for Pull-up Mode */ -#define GPIO_PUSEL_PULL_DOWN 0x2UL /*!< GPIO PUSEL setting for Pull-down Mode */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_DBCTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_DBCTL_ICLK_ON 0x00000020UL /*!< GPIO_DBCTL setting for all IO pins edge detection circuit is always active after reset */ -#define GPIO_DBCTL_ICLK_OFF 0x00000000UL /*!< GPIO_DBCTL setting for edge detection circuit is active only if IO pin corresponding GPIOx_IEN bit is set to 1 */ - -#define GPIO_DBCTL_DBCLKSRC_LIRC 0x00000010UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the internal 10 kHz */ -#define GPIO_DBCTL_DBCLKSRC_HCLK 0x00000000UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the HCLK */ - -#define GPIO_DBCTL_DBCLKSEL_1 0x00000000UL /*!< GPIO_DBCTL setting for sampling cycle = 1 clocks */ -#define GPIO_DBCTL_DBCLKSEL_2 0x00000001UL /*!< GPIO_DBCTL setting for sampling cycle = 2 clocks */ -#define GPIO_DBCTL_DBCLKSEL_4 0x00000002UL /*!< GPIO_DBCTL setting for sampling cycle = 4 clocks */ -#define GPIO_DBCTL_DBCLKSEL_8 0x00000003UL /*!< GPIO_DBCTL setting for sampling cycle = 8 clocks */ -#define GPIO_DBCTL_DBCLKSEL_16 0x00000004UL /*!< GPIO_DBCTL setting for sampling cycle = 16 clocks */ -#define GPIO_DBCTL_DBCLKSEL_32 0x00000005UL /*!< GPIO_DBCTL setting for sampling cycle = 32 clocks */ -#define GPIO_DBCTL_DBCLKSEL_64 0x00000006UL /*!< GPIO_DBCTL setting for sampling cycle = 64 clocks */ -#define GPIO_DBCTL_DBCLKSEL_128 0x00000007UL /*!< GPIO_DBCTL setting for sampling cycle = 128 clocks */ -#define GPIO_DBCTL_DBCLKSEL_256 0x00000008UL /*!< GPIO_DBCTL setting for sampling cycle = 256 clocks */ -#define GPIO_DBCTL_DBCLKSEL_512 0x00000009UL /*!< GPIO_DBCTL setting for sampling cycle = 512 clocks */ -#define GPIO_DBCTL_DBCLKSEL_1024 0x0000000AUL /*!< GPIO_DBCTL setting for sampling cycle = 1024 clocks */ -#define GPIO_DBCTL_DBCLKSEL_2048 0x0000000BUL /*!< GPIO_DBCTL setting for sampling cycle = 2048 clocks */ -#define GPIO_DBCTL_DBCLKSEL_4096 0x0000000CUL /*!< GPIO_DBCTL setting for sampling cycle = 4096 clocks */ -#define GPIO_DBCTL_DBCLKSEL_8192 0x0000000DUL /*!< GPIO_DBCTL setting for sampling cycle = 8192 clocks */ -#define GPIO_DBCTL_DBCLKSEL_16384 0x0000000EUL /*!< GPIO_DBCTL setting for sampling cycle = 16384 clocks */ -#define GPIO_DBCTL_DBCLKSEL_32768 0x0000000FUL /*!< GPIO_DBCTL setting for sampling cycle = 32768 clocks */ - - -/** Define GPIO Pin Data Input/Output. It could be used to control each I/O pin by pin address mapping. - * Example 1: - * - * PA0 = 1; - * - * It is used to set PA.0 to high; - * - * Example 2: - * - * if (PA0) - * PA0 = 0; - * - * If PA.0 pin status is high, then set PA.0 data output to low. - */ - - -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT0 ) -#define PA0 PA0_NS /*!< Specify PA.0 Pin Data Input/Output */ -#else -#define PA0 PA0_S /*!< Specify PA.0 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT1 ) -#define PA1 PA1_NS /*!< Specify PA.1 Pin Data Input/Output */ -#else -#define PA1 PA1_S /*!< Specify PA.1 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT2 ) -#define PA2 PA2_NS /*!< Specify PA.2 Pin Data Input/Output */ -#else -#define PA2 PA2_S /*!< Specify PA.2 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT3 ) -#define PA3 PA3_NS /*!< Specify PA.3 Pin Data Input/Output */ -#else -#define PA3 PA3_S /*!< Specify PA.3 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT4 ) -#define PA4 PA4_NS /*!< Specify PA.4 Pin Data Input/Output */ -#else -#define PA4 PA4_S /*!< Specify PA.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT5 ) -#define PA5 PA5_NS /*!< Specify PA.5 Pin Data Input/Output */ -#else -#define PA5 PA5_S /*!< Specify PA.5 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT6 ) -#define PA6 PA6_NS /*!< Specify PA.6 Pin Data Input/Output */ -#else -#define PA6 PA6_S /*!< Specify PA.6 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT7 ) -#define PA7 PA7_NS /*!< Specify PA.7 Pin Data Input/Output */ -#else -#define PA7 PA7_S /*!< Specify PA.7 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT8 ) -#define PA8 PA8_NS /*!< Specify PA.8 Pin Data Input/Output */ -#else -#define PA8 PA8_S /*!< Specify PA.8 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT9 ) -#define PA9 PA9_NS /*!< Specify PA.9 Pin Data Input/Output */ -#else -#define PA9 PA9_S /*!< Specify PA.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT10 ) -#define PA10 PA10_NS /*!< Specify PA.10 Pin Data Input/Output */ -#else -#define PA10 PA10_S /*!< Specify PA.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT11 ) -#define PA11 PA11_NS /*!< Specify PA.11 Pin Data Input/Output */ -#else -#define PA11 PA11_S /*!< Specify PA.11 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT12 ) -#define PA12 PA12_NS /*!< Specify PA.12 Pin Data Input/Output */ -#else -#define PA12 PA12_S /*!< Specify PA.12 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT13 ) -#define PA13 PA13_NS /*!< Specify PA.13 Pin Data Input/Output */ -#else -#define PA13 PA13_S /*!< Specify PA.13 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT14 ) -#define PA14 PA14_NS /*!< Specify PA.14 Pin Data Input/Output */ -#else -#define PA14 PA14_S /*!< Specify PA.14 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET0_VAL) && (SCU_INIT_IONSSET0_VAL & BIT15 ) -#define PA15 PA15_NS /*!< Specify PA.15 Pin Data Input/Output */ -#else -#define PA15 PA15_S /*!< Specify PA.15 Pin Data Input/Output */ -#endif - -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT0 ) -#define PB0 PB0_NS /*!< Specify PB.0 Pin Data Input/Output */ -#else -#define PB0 PB0_S /*!< Specify PB.0 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT1 ) -#define PB1 PB1_NS /*!< Specify PB.1 Pin Data Input/Output */ -#else -#define PB1 PB1_S /*!< Specify PB.1 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT2 ) -#define PB2 PB2_NS /*!< Specify PB.2 Pin Data Input/Output */ -#else -#define PB2 PB2_S /*!< Specify PB.2 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT3 ) -#define PB3 PB3_NS /*!< Specify PB.3 Pin Data Input/Output */ -#else -#define PB3 PB3_S /*!< Specify PB.3 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT4 ) -#define PB4 PB4_NS /*!< Specify PB.4 Pin Data Input/Output */ -#else -#define PB4 PB4_S /*!< Specify PB.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT5 ) -#define PB5 PB5_NS /*!< Specify PB.5 Pin Data Input/Output */ -#else -#define PB5 PB5_S /*!< Specify PB.5 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT6 ) -#define PB6 PB6_NS /*!< Specify PB.6 Pin Data Input/Output */ -#else -#define PB6 PB6_S /*!< Specify PB.6 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT7 ) -#define PB7 PB7_NS /*!< Specify PB.7 Pin Data Input/Output */ -#else -#define PB7 PB7_S /*!< Specify PB.7 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT8 ) -#define PB8 PB8_NS /*!< Specify PB.8 Pin Data Input/Output */ -#else -#define PB8 PB8_S /*!< Specify PB.8 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT9 ) -#define PB9 PB9_NS /*!< Specify PB.9 Pin Data Input/Output */ -#else -#define PB9 PB9_S /*!< Specify PB.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT10 ) -#define PB10 PB10_NS /*!< Specify PB.10 Pin Data Input/Output */ -#else -#define PB10 PB10_S /*!< Specify PB.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT11 ) -#define PB11 PB11_NS /*!< Specify PB.11 Pin Data Input/Output */ -#else -#define PB11 PB11_S /*!< Specify PB.11 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT12 ) -#define PB12 PB12_NS /*!< Specify PB.12 Pin Data Input/Output */ -#else -#define PB12 PB12_S /*!< Specify PB.12 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT13 ) -#define PB13 PB13_NS /*!< Specify PB.13 Pin Data Input/Output */ -#else -#define PB13 PB13_S /*!< Specify PB.13 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT14 ) -#define PB14 PB14_NS /*!< Specify PB.14 Pin Data Input/Output */ -#else -#define PB14 PB14_S /*!< Specify PB.14 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET1_VAL) && (SCU_INIT_IONSSET1_VAL & BIT15 ) -#define PB15 PB15_NS /*!< Specify PB.15 Pin Data Input/Output */ -#else -#define PB15 PB15_S /*!< Specify PB.15 Pin Data Input/Output */ -#endif - -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT0 ) -#define PC0 PC0_NS /*!< Specify PC.0 Pin Data Input/Output */ -#else -#define PC0 PC0_S /*!< Specify PC.0 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT1 ) -#define PC1 PC1_NS /*!< Specify PC.1 Pin Data Input/Output */ -#else -#define PC1 PC1_S /*!< Specify PC.1 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT2 ) -#define PC2 PC2_NS /*!< Specify PC.2 Pin Data Input/Output */ -#else -#define PC2 PC2_S /*!< Specify PC.2 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT3 ) -#define PC3 PC3_NS /*!< Specify PC.3 Pin Data Input/Output */ -#else -#define PC3 PC3_S /*!< Specify PC.3 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT4 ) -#define PC4 PC4_NS /*!< Specify PC.4 Pin Data Input/Output */ -#else -#define PC4 PC4_S /*!< Specify PC.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT5 ) -#define PC5 PC5_NS /*!< Specify PC.5 Pin Data Input/Output */ -#else -#define PC5 PC5_S /*!< Specify PC.5 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT6 ) -#define PC6 PC6_NS /*!< Specify PC.6 Pin Data Input/Output */ -#else -#define PC6 PC6_S /*!< Specify PC.6 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT7 ) -#define PC7 PC7_NS /*!< Specify PC.7 Pin Data Input/Output */ -#else -#define PC7 PC7_S /*!< Specify PC.7 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT8 ) -#define PC8 PC8_NS /*!< Specify PC.8 Pin Data Input/Output */ -#else -#define PC8 PC8_S /*!< Specify PC.8 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT9 ) -#define PC9 PC9_NS /*!< Specify PC.9 Pin Data Input/Output */ -#else -#define PC9 PC9_S /*!< Specify PC.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT10 ) -#define PC10 PC10_NS /*!< Specify PC.10 Pin Data Input/Output */ -#else -#define PC10 PC10_S /*!< Specify PC.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT11 ) -#define PC11 PC11_NS /*!< Specify PC.11 Pin Data Input/Output */ -#else -#define PC11 PC11_S /*!< Specify PC.11 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT12 ) -#define PC12 PC12_NS /*!< Specify PC.12 Pin Data Input/Output */ -#else -#define PC12 PC12_S /*!< Specify PC.12 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET2_VAL) && (SCU_INIT_IONSSET2_VAL & BIT13 ) -#define PC13 PC13_NS /*!< Specify PC.13 Pin Data Input/Output */ -#else -#define PC13 PC13_S /*!< Specify PC.13 Pin Data Input/Output */ -#endif - -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT0 ) -#define PD0 PD0_NS /*!< Specify PD.0 Pin Data Input/Output */ -#else -#define PD0 PD0_S /*!< Specify PD.0 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT1 ) -#define PD1 PD1_NS /*!< Specify PD.1 Pin Data Input/Output */ -#else -#define PD1 PD1_S /*!< Specify PD.1 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT2 ) -#define PD2 PD2_NS /*!< Specify PD.2 Pin Data Input/Output */ -#else -#define PD2 PD2_S /*!< Specify PD.2 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT3 ) -#define PD3 PD3_NS /*!< Specify PD.3 Pin Data Input/Output */ -#else -#define PD3 PD3_S /*!< Specify PD.3 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT4 ) -#define PD4 PD4_NS /*!< Specify PD.4 Pin Data Input/Output */ -#else -#define PD4 PD4_S /*!< Specify PD.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT5 ) -#define PD5 PD5_NS /*!< Specify PD.5 Pin Data Input/Output */ -#else -#define PD5 PD5_S /*!< Specify PD.5 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT6 ) -#define PD6 PD6_NS /*!< Specify PD.6 Pin Data Input/Output */ -#else -#define PD6 PD6_S /*!< Specify PD.6 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT7 ) -#define PD7 PD7_NS /*!< Specify PD.7 Pin Data Input/Output */ -#else -#define PD7 PD7_S /*!< Specify PD.7 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT8 ) -#define PD8 PD8_NS /*!< Specify PD.8 Pin Data Input/Output */ -#else -#define PD8 PD8_S /*!< Specify PD.8 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT9 ) -#define PD9 PD9_NS /*!< Specify PD.9 Pin Data Input/Output */ -#else -#define PD9 PD9_S /*!< Specify PD.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT10 ) -#define PD10 PD10_NS /*!< Specify PD.10 Pin Data Input/Output */ -#else -#define PD10 PD10_S /*!< Specify PD.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT11 ) -#define PD11 PD11_NS /*!< Specify PD.11 Pin Data Input/Output */ -#else -#define PD11 PD11_S /*!< Specify PD.11 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT12 ) -#define PD12 PD12_NS /*!< Specify PD.12 Pin Data Input/Output */ -#else -#define PD12 PD12_S /*!< Specify PD.12 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET3_VAL) && (SCU_INIT_IONSSET3_VAL & BIT14 ) -#define PD14 PD14_NS /*!< Specify PD.14 Pin Data Input/Output */ -#else -#define PD14 PD14_S /*!< Specify PD.14 Pin Data Input/Output */ -#endif - -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT0 ) -#define PE0 PE0_NS /*!< Specify PE.0 Pin Data Input/Output */ -#else -#define PE0 PE0_S /*!< Specify PE.0 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT1 ) -#define PE1 PE1_NS /*!< Specify PE.1 Pin Data Input/Output */ -#else -#define PE1 PE1_S /*!< Specify PE.1 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT2 ) -#define PE2 PE2_NS /*!< Specify PE.2 Pin Data Input/Output */ -#else -#define PE2 PE2_S /*!< Specify PE.2 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT3 ) -#define PE3 PE3_NS /*!< Specify PE.3 Pin Data Input/Output */ -#else -#define PE3 PE3_S /*!< Specify PE.3 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT4 ) -#define PE4 PE4_NS /*!< Specify PE.4 Pin Data Input/Output */ -#else -#define PE4 PE4_S /*!< Specify PE.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT5 ) -#define PE5 PE5_NS /*!< Specify PE.5 Pin Data Input/Output */ -#else -#define PE5 PE5_S /*!< Specify PE.5 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT6 ) -#define PE6 PE6_NS /*!< Specify PE.6 Pin Data Input/Output */ -#else -#define PE6 PE6_S /*!< Specify PE.6 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT7 ) -#define PE7 PE7_NS /*!< Specify PE.7 Pin Data Input/Output */ -#else -#define PE7 PE7_S /*!< Specify PE.7 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT8 ) -#define PE8 PE8_NS /*!< Specify PE.8 Pin Data Input/Output */ -#else -#define PE8 PE8_S /*!< Specify PE.8 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT9 ) -#define PE9 PE9_NS /*!< Specify PE.9 Pin Data Input/Output */ -#else -#define PE9 PE9_S /*!< Specify PE.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT10 ) -#define PE10 PE10_NS /*!< Specify PE.10 Pin Data Input/Output */ -#else -#define PE10 PE10_S /*!< Specify PE.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT11 ) -#define PE11 PE11_NS /*!< Specify PE.11 Pin Data Input/Output */ -#else -#define PE11 PE11_S /*!< Specify PE.11 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT12 ) -#define PE12 PE12_NS /*!< Specify PE.12 Pin Data Input/Output */ -#else -#define PE12 PE12_S /*!< Specify PE.12 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT13 ) -#define PE13 PE13_NS /*!< Specify PE.13 Pin Data Input/Output */ -#else -#define PE13 PE13_S /*!< Specify PE.13 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT14 ) -#define PE14 PE14_NS /*!< Specify PE.14 Pin Data Input/Output */ -#else -#define PE14 PE14_S /*!< Specify PE.14 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET4_VAL) && (SCU_INIT_IONSSET4_VAL & BIT15 ) -#define PE15 PE15_NS /*!< Specify PE.15 Pin Data Input/Output */ -#else -#define PE15 PE15_S /*!< Specify PE.15 Pin Data Input/Output */ -#endif - -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT0 ) -#define PF0 PF0_NS /*!< Specify PF.0 Pin Data Input/Output */ -#else -#define PF0 PF0_S /*!< Specify PF.0 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT1 ) -#define PF1 PF1_NS /*!< Specify PF.1 Pin Data Input/Output */ -#else -#define PF1 PF1_S /*!< Specify PF.1 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT2 ) -#define PF2 PF2_NS /*!< Specify PF.2 Pin Data Input/Output */ -#else -#define PF2 PF2_S /*!< Specify PF.2 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT3 ) -#define PF3 PF3_NS /*!< Specify PF.3 Pin Data Input/Output */ -#else -#define PF3 PF3_S /*!< Specify PF.3 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT4 ) -#define PF4 PF4_NS /*!< Specify PF.4 Pin Data Input/Output */ -#else -#define PF4 PF4_S /*!< Specify PF.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT5 ) -#define PF5 PF5_NS /*!< Specify PF.5 Pin Data Input/Output */ -#else -#define PF5 PF5_S /*!< Specify PF.5 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT6 ) -#define PF6 PF6_NS /*!< Specify PF.6 Pin Data Input/Output */ -#else -#define PF6 PF6_S /*!< Specify PF.6 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT7 ) -#define PF7 PF7_NS /*!< Specify PF.7 Pin Data Input/Output */ -#else -#define PF7 PF7_S /*!< Specify PF.7 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT8 ) -#define PF8 PF8_NS /*!< Specify PF.8 Pin Data Input/Output */ -#else -#define PF8 PF8_S /*!< Specify PF.8 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT9 ) -#define PF9 PF9_NS /*!< Specify PF.9 Pin Data Input/Output */ -#else -#define PF9 PF9_S /*!< Specify PF.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT10 ) -#define PF10 PF10_NS /*!< Specify PF.10 Pin Data Input/Output */ -#else -#define PF10 PF10_S /*!< Specify PF.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET5_VAL) && (SCU_INIT_IONSSET5_VAL & BIT11 ) -#define PF11 PF11_NS /*!< Specify PF.11 Pin Data Input/Output */ -#else -#define PF11 PF11_S /*!< Specify PF.11 Pin Data Input/Output */ -#endif - -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT2 ) -#define PG2 PG2_NS /*!< Specify PG.2 Pin Data Input/Output */ -#else -#define PG2 PG2_S /*!< Specify PG.2 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT3 ) -#define PG3 PG3_NS /*!< Specify PG.3 Pin Data Input/Output */ -#else -#define PG3 PG3_S /*!< Specify PG.3 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT4 ) -#define PG4 PG4_NS /*!< Specify PG.4 Pin Data Input/Output */ -#else -#define PG4 PG4_S /*!< Specify PG.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT9 ) -#define PG9 PG9_NS /*!< Specify PG.9 Pin Data Input/Output */ -#else -#define PG9 PG9_S /*!< Specify PG.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT10 ) -#define PG10 PG10_NS /*!< Specify PG.10 Pin Data Input/Output */ -#else -#define PG10 PG10_S /*!< Specify PG.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT11 ) -#define PG11 PG11_NS /*!< Specify PG.11 Pin Data Input/Output */ -#else -#define PG11 PG11_S /*!< Specify PG.11 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT12 ) -#define PG12 PG12_NS /*!< Specify PG.12 Pin Data Input/Output */ -#else -#define PG12 PG12_S /*!< Specify PG.12 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT13 ) -#define PG13 PG13_NS /*!< Specify PG.13 Pin Data Input/Output */ -#else -#define PG13 PG13_S /*!< Specify PG.13 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT14 ) -#define PG14 PG14_NS /*!< Specify PG.14 Pin Data Input/Output */ -#else -#define PG14 PG14_S /*!< Specify PG.14 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET6_VAL) && (SCU_INIT_IONSSET6_VAL & BIT15 ) -#define PG15 PG15_NS /*!< Specify PG.15 Pin Data Input/Output */ -#else -#define PG15 PG15_S /*!< Specify PG.15 Pin Data Input/Output */ -#endif - -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT4 ) -#define PH4 PH4_NS /*!< Specify PH.4 Pin Data Input/Output */ -#else -#define PH4 PH4_S /*!< Specify PH.4 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT5 ) -#define PH5 PH5_NS /*!< Specify PH.5 Pin Data Input/Output */ -#else -#define PH5 PH5_S /*!< Specify PH.5 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT6 ) -#define PH6 PH6_NS /*!< Specify PH.6 Pin Data Input/Output */ -#else -#define PH6 PH6_S /*!< Specify PH.6 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT7 ) -#define PH7 PH7_NS /*!< Specify PH.7 Pin Data Input/Output */ -#else -#define PH7 PH7_S /*!< Specify PH.7 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT8 ) -#define PH8 PH8_NS /*!< Specify PH.8 Pin Data Input/Output */ -#else -#define PH8 PH8_S /*!< Specify PH.8 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT9 ) -#define PH9 PH9_NS /*!< Specify PH.9 Pin Data Input/Output */ -#else -#define PH9 PH9_S /*!< Specify PH.9 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT10 ) -#define PH10 PH10_NS /*!< Specify PH.10 Pin Data Input/Output */ -#else -#define PH10 PH10_S /*!< Specify PH.10 Pin Data Input/Output */ -#endif -#if defined (SCU_INIT_IONSSET7_VAL) && (SCU_INIT_IONSSET7_VAL & BIT11 ) -#define PH11 PH11_NS /*!< Specify PH.11 Pin Data Input/Output */ -#else -#define PH11 PH11_S /*!< Specify PH.11 Pin Data Input/Output */ -#endif - - -/* GPIO bit definitions for secure */ -#define GPIO_PIN_DATA_S(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2)))) -#define PA0_S GPIO_PIN_DATA_S(0, 0 ) /*!< Specify PA.0 Pin Data Input/Output */ -#define PA1_S GPIO_PIN_DATA_S(0, 1 ) /*!< Specify PA.1 Pin Data Input/Output */ -#define PA2_S GPIO_PIN_DATA_S(0, 2 ) /*!< Specify PA.2 Pin Data Input/Output */ -#define PA3_S GPIO_PIN_DATA_S(0, 3 ) /*!< Specify PA.3 Pin Data Input/Output */ -#define PA4_S GPIO_PIN_DATA_S(0, 4 ) /*!< Specify PA.4 Pin Data Input/Output */ -#define PA5_S GPIO_PIN_DATA_S(0, 5 ) /*!< Specify PA.5 Pin Data Input/Output */ -#define PA6_S GPIO_PIN_DATA_S(0, 6 ) /*!< Specify PA.6 Pin Data Input/Output */ -#define PA7_S GPIO_PIN_DATA_S(0, 7 ) /*!< Specify PA.7 Pin Data Input/Output */ -#define PA8_S GPIO_PIN_DATA_S(0, 8 ) /*!< Specify PA.8 Pin Data Input/Output */ -#define PA9_S GPIO_PIN_DATA_S(0, 9 ) /*!< Specify PA.9 Pin Data Input/Output */ -#define PA10_S GPIO_PIN_DATA_S(0, 10) /*!< Specify PA.10 Pin Data Input/Output */ -#define PA11_S GPIO_PIN_DATA_S(0, 11) /*!< Specify PA.11 Pin Data Input/Output */ -#define PA12_S GPIO_PIN_DATA_S(0, 12) /*!< Specify PA.12 Pin Data Input/Output */ -#define PA13_S GPIO_PIN_DATA_S(0, 13) /*!< Specify PA.13 Pin Data Input/Output */ -#define PA14_S GPIO_PIN_DATA_S(0, 14) /*!< Specify PA.14 Pin Data Input/Output */ -#define PA15_S GPIO_PIN_DATA_S(0, 15) /*!< Specify PA.15 Pin Data Input/Output */ -#define PB0_S GPIO_PIN_DATA_S(1, 0 ) /*!< Specify PB.0 Pin Data Input/Output */ -#define PB1_S GPIO_PIN_DATA_S(1, 1 ) /*!< Specify PB.1 Pin Data Input/Output */ -#define PB2_S GPIO_PIN_DATA_S(1, 2 ) /*!< Specify PB.2 Pin Data Input/Output */ -#define PB3_S GPIO_PIN_DATA_S(1, 3 ) /*!< Specify PB.3 Pin Data Input/Output */ -#define PB4_S GPIO_PIN_DATA_S(1, 4 ) /*!< Specify PB.4 Pin Data Input/Output */ -#define PB5_S GPIO_PIN_DATA_S(1, 5 ) /*!< Specify PB.5 Pin Data Input/Output */ -#define PB6_S GPIO_PIN_DATA_S(1, 6 ) /*!< Specify PB.6 Pin Data Input/Output */ -#define PB7_S GPIO_PIN_DATA_S(1, 7 ) /*!< Specify PB.7 Pin Data Input/Output */ -#define PB8_S GPIO_PIN_DATA_S(1, 8 ) /*!< Specify PB.8 Pin Data Input/Output */ -#define PB9_S GPIO_PIN_DATA_S(1, 9 ) /*!< Specify PB.9 Pin Data Input/Output */ -#define PB10_S GPIO_PIN_DATA_S(1, 10) /*!< Specify PB.10 Pin Data Input/Output */ -#define PB11_S GPIO_PIN_DATA_S(1, 11) /*!< Specify PB.11 Pin Data Input/Output */ -#define PB12_S GPIO_PIN_DATA_S(1, 12) /*!< Specify PB.12 Pin Data Input/Output */ -#define PB13_S GPIO_PIN_DATA_S(1, 13) /*!< Specify PB.13 Pin Data Input/Output */ -#define PB14_S GPIO_PIN_DATA_S(1, 14) /*!< Specify PB.14 Pin Data Input/Output */ -#define PB15_S GPIO_PIN_DATA_S(1, 15) /*!< Specify PB.15 Pin Data Input/Output */ -#define PC0_S GPIO_PIN_DATA_S(2, 0 ) /*!< Specify PC.0 Pin Data Input/Output */ -#define PC1_S GPIO_PIN_DATA_S(2, 1 ) /*!< Specify PC.1 Pin Data Input/Output */ -#define PC2_S GPIO_PIN_DATA_S(2, 2 ) /*!< Specify PC.2 Pin Data Input/Output */ -#define PC3_S GPIO_PIN_DATA_S(2, 3 ) /*!< Specify PC.3 Pin Data Input/Output */ -#define PC4_S GPIO_PIN_DATA_S(2, 4 ) /*!< Specify PC.4 Pin Data Input/Output */ -#define PC5_S GPIO_PIN_DATA_S(2, 5 ) /*!< Specify PC.5 Pin Data Input/Output */ -#define PC6_S GPIO_PIN_DATA_S(2, 6 ) /*!< Specify PC.6 Pin Data Input/Output */ -#define PC7_S GPIO_PIN_DATA_S(2, 7 ) /*!< Specify PC.7 Pin Data Input/Output */ -#define PC8_S GPIO_PIN_DATA_S(2, 8 ) /*!< Specify PC.8 Pin Data Input/Output */ -#define PC9_S GPIO_PIN_DATA_S(2, 9 ) /*!< Specify PC.9 Pin Data Input/Output */ -#define PC10_S GPIO_PIN_DATA_S(2, 10) /*!< Specify PC.10 Pin Data Input/Output */ -#define PC11_S GPIO_PIN_DATA_S(2, 11) /*!< Specify PC.11 Pin Data Input/Output */ -#define PC12_S GPIO_PIN_DATA_S(2, 12) /*!< Specify PC.12 Pin Data Input/Output */ -#define PC13_S GPIO_PIN_DATA_S(2, 13) /*!< Specify PC.13 Pin Data Input/Output */ -#define PD0_S GPIO_PIN_DATA_S(3, 0 ) /*!< Specify PD.0 Pin Data Input/Output */ -#define PD1_S GPIO_PIN_DATA_S(3, 1 ) /*!< Specify PD.1 Pin Data Input/Output */ -#define PD2_S GPIO_PIN_DATA_S(3, 2 ) /*!< Specify PD.2 Pin Data Input/Output */ -#define PD3_S GPIO_PIN_DATA_S(3, 3 ) /*!< Specify PD.3 Pin Data Input/Output */ -#define PD4_S GPIO_PIN_DATA_S(3, 4 ) /*!< Specify PD.4 Pin Data Input/Output */ -#define PD5_S GPIO_PIN_DATA_S(3, 5 ) /*!< Specify PD.5 Pin Data Input/Output */ -#define PD6_S GPIO_PIN_DATA_S(3, 6 ) /*!< Specify PD.6 Pin Data Input/Output */ -#define PD7_S GPIO_PIN_DATA_S(3, 7 ) /*!< Specify PD.7 Pin Data Input/Output */ -#define PD8_S GPIO_PIN_DATA_S(3, 8 ) /*!< Specify PD.8 Pin Data Input/Output */ -#define PD9_S GPIO_PIN_DATA_S(3, 9 ) /*!< Specify PD.9 Pin Data Input/Output */ -#define PD10_S GPIO_PIN_DATA_S(3, 10) /*!< Specify PD.10 Pin Data Input/Output */ -#define PD11_S GPIO_PIN_DATA_S(3, 11) /*!< Specify PD.11 Pin Data Input/Output */ -#define PD12_S GPIO_PIN_DATA_S(3, 12) /*!< Specify PD.12 Pin Data Input/Output */ -#define PD14_S GPIO_PIN_DATA_S(3, 14) /*!< Specify PD.14 Pin Data Input/Output */ -#define PE0_S GPIO_PIN_DATA_S(4, 0 ) /*!< Specify PE.0 Pin Data Input/Output */ -#define PE1_S GPIO_PIN_DATA_S(4, 1 ) /*!< Specify PE.1 Pin Data Input/Output */ -#define PE2_S GPIO_PIN_DATA_S(4, 2 ) /*!< Specify PE.2 Pin Data Input/Output */ -#define PE3_S GPIO_PIN_DATA_S(4, 3 ) /*!< Specify PE.3 Pin Data Input/Output */ -#define PE4_S GPIO_PIN_DATA_S(4, 4 ) /*!< Specify PE.4 Pin Data Input/Output */ -#define PE5_S GPIO_PIN_DATA_S(4, 5 ) /*!< Specify PE.5 Pin Data Input/Output */ -#define PE6_S GPIO_PIN_DATA_S(4, 6 ) /*!< Specify PE.6 Pin Data Input/Output */ -#define PE7_S GPIO_PIN_DATA_S(4, 7 ) /*!< Specify PE.7 Pin Data Input/Output */ -#define PE8_S GPIO_PIN_DATA_S(4, 8 ) /*!< Specify PE.8 Pin Data Input/Output */ -#define PE9_S GPIO_PIN_DATA_S(4, 9 ) /*!< Specify PE.9 Pin Data Input/Output */ -#define PE10_S GPIO_PIN_DATA_S(4, 10) /*!< Specify PE.10 Pin Data Input/Output */ -#define PE11_S GPIO_PIN_DATA_S(4, 11) /*!< Specify PE.11 Pin Data Input/Output */ -#define PE12_S GPIO_PIN_DATA_S(4, 12) /*!< Specify PE.12 Pin Data Input/Output */ -#define PE13_S GPIO_PIN_DATA_S(4, 13) /*!< Specify PE.13 Pin Data Input/Output */ -#define PE14_S GPIO_PIN_DATA_S(4, 14) /*!< Specify PE.14 Pin Data Input/Output */ -#define PE15_S GPIO_PIN_DATA_S(4, 15) /*!< Specify PE.15 Pin Data Input/Output */ -#define PF0_S GPIO_PIN_DATA_S(5, 0 ) /*!< Specify PF.0 Pin Data Input/Output */ -#define PF1_S GPIO_PIN_DATA_S(5, 1 ) /*!< Specify PF.1 Pin Data Input/Output */ -#define PF2_S GPIO_PIN_DATA_S(5, 2 ) /*!< Specify PF.2 Pin Data Input/Output */ -#define PF3_S GPIO_PIN_DATA_S(5, 3 ) /*!< Specify PF.3 Pin Data Input/Output */ -#define PF4_S GPIO_PIN_DATA_S(5, 4 ) /*!< Specify PF.4 Pin Data Input/Output */ -#define PF5_S GPIO_PIN_DATA_S(5, 5 ) /*!< Specify PF.5 Pin Data Input/Output */ -#define PF6_S GPIO_PIN_DATA_S(5, 6 ) /*!< Specify PF.6 Pin Data Input/Output */ -#define PF7_S GPIO_PIN_DATA_S(5, 7 ) /*!< Specify PF.7 Pin Data Input/Output */ -#define PF8_S GPIO_PIN_DATA_S(5, 8 ) /*!< Specify PF.8 Pin Data Input/Output */ -#define PF9_S GPIO_PIN_DATA_S(5, 9 ) /*!< Specify PF.9 Pin Data Input/Output */ -#define PF10_S GPIO_PIN_DATA_S(5, 10) /*!< Specify PF.10 Pin Data Input/Output */ -#define PF11_S GPIO_PIN_DATA_S(5, 11) /*!< Specify PF.11 Pin Data Input/Output */ -#define PG2_S GPIO_PIN_DATA_S(6, 2 ) /*!< Specify PG.2 Pin Data Input/Output */ -#define PG3_S GPIO_PIN_DATA_S(6, 3 ) /*!< Specify PG.3 Pin Data Input/Output */ -#define PG4_S GPIO_PIN_DATA_S(6, 4 ) /*!< Specify PG.4 Pin Data Input/Output */ -#define PG9_S GPIO_PIN_DATA_S(6, 9 ) /*!< Specify PG.9 Pin Data Input/Output */ -#define PG10_S GPIO_PIN_DATA_S(6, 10) /*!< Specify PG.10 Pin Data Input/Output */ -#define PG11_S GPIO_PIN_DATA_S(6, 11) /*!< Specify PG.11 Pin Data Input/Output */ -#define PG12_S GPIO_PIN_DATA_S(6, 12) /*!< Specify PG.12 Pin Data Input/Output */ -#define PG13_S GPIO_PIN_DATA_S(6, 13) /*!< Specify PG.13 Pin Data Input/Output */ -#define PG14_S GPIO_PIN_DATA_S(6, 14) /*!< Specify PG.14 Pin Data Input/Output */ -#define PG15_S GPIO_PIN_DATA_S(6, 15) /*!< Specify PG.15 Pin Data Input/Output */ -#define PH4_S GPIO_PIN_DATA_S(7, 4 ) /*!< Specify PH.4 Pin Data Input/Output */ -#define PH5_S GPIO_PIN_DATA_S(7, 5 ) /*!< Specify PH.5 Pin Data Input/Output */ -#define PH6_S GPIO_PIN_DATA_S(7, 6 ) /*!< Specify PH.6 Pin Data Input/Output */ -#define PH7_S GPIO_PIN_DATA_S(7, 7 ) /*!< Specify PH.7 Pin Data Input/Output */ -#define PH8_S GPIO_PIN_DATA_S(7, 8 ) /*!< Specify PH.8 Pin Data Input/Output */ -#define PH9_S GPIO_PIN_DATA_S(7, 9 ) /*!< Specify PH.9 Pin Data Input/Output */ -#define PH10_S GPIO_PIN_DATA_S(7, 10) /*!< Specify PH.10 Pin Data Input/Output */ -#define PH11_S GPIO_PIN_DATA_S(7, 11) /*!< Specify PH.11 Pin Data Input/Output */ - -/* GPIO bit definitions for non-secure */ -#define GPIO_PIN_DATA_NS(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+NS_OFFSET+(0x40*(port))) + ((pin)<<2)))) -#define PA0_NS GPIO_PIN_DATA_NS(0, 0 ) /*!< Specify PA.0 Pin Data Input/Output */ -#define PA1_NS GPIO_PIN_DATA_NS(0, 1 ) /*!< Specify PA.1 Pin Data Input/Output */ -#define PA2_NS GPIO_PIN_DATA_NS(0, 2 ) /*!< Specify PA.2 Pin Data Input/Output */ -#define PA3_NS GPIO_PIN_DATA_NS(0, 3 ) /*!< Specify PA.3 Pin Data Input/Output */ -#define PA4_NS GPIO_PIN_DATA_NS(0, 4 ) /*!< Specify PA.4 Pin Data Input/Output */ -#define PA5_NS GPIO_PIN_DATA_NS(0, 5 ) /*!< Specify PA.5 Pin Data Input/Output */ -#define PA6_NS GPIO_PIN_DATA_NS(0, 6 ) /*!< Specify PA.6 Pin Data Input/Output */ -#define PA7_NS GPIO_PIN_DATA_NS(0, 7 ) /*!< Specify PA.7 Pin Data Input/Output */ -#define PA8_NS GPIO_PIN_DATA_NS(0, 8 ) /*!< Specify PA.8 Pin Data Input/Output */ -#define PA9_NS GPIO_PIN_DATA_NS(0, 9 ) /*!< Specify PA.9 Pin Data Input/Output */ -#define PA10_NS GPIO_PIN_DATA_NS(0, 10) /*!< Specify PA.10 Pin Data Input/Output */ -#define PA11_NS GPIO_PIN_DATA_NS(0, 11) /*!< Specify PA.11 Pin Data Input/Output */ -#define PA12_NS GPIO_PIN_DATA_NS(0, 12) /*!< Specify PA.12 Pin Data Input/Output */ -#define PA13_NS GPIO_PIN_DATA_NS(0, 13) /*!< Specify PA.13 Pin Data Input/Output */ -#define PA14_NS GPIO_PIN_DATA_NS(0, 14) /*!< Specify PA.14 Pin Data Input/Output */ -#define PA15_NS GPIO_PIN_DATA_NS(0, 15) /*!< Specify PA.15 Pin Data Input/Output */ -#define PB0_NS GPIO_PIN_DATA_NS(1, 0 ) /*!< Specify PB.0 Pin Data Input/Output */ -#define PB1_NS GPIO_PIN_DATA_NS(1, 1 ) /*!< Specify PB.1 Pin Data Input/Output */ -#define PB2_NS GPIO_PIN_DATA_NS(1, 2 ) /*!< Specify PB.2 Pin Data Input/Output */ -#define PB3_NS GPIO_PIN_DATA_NS(1, 3 ) /*!< Specify PB.3 Pin Data Input/Output */ -#define PB4_NS GPIO_PIN_DATA_NS(1, 4 ) /*!< Specify PB.4 Pin Data Input/Output */ -#define PB5_NS GPIO_PIN_DATA_NS(1, 5 ) /*!< Specify PB.5 Pin Data Input/Output */ -#define PB6_NS GPIO_PIN_DATA_NS(1, 6 ) /*!< Specify PB.6 Pin Data Input/Output */ -#define PB7_NS GPIO_PIN_DATA_NS(1, 7 ) /*!< Specify PB.7 Pin Data Input/Output */ -#define PB8_NS GPIO_PIN_DATA_NS(1, 8 ) /*!< Specify PB.8 Pin Data Input/Output */ -#define PB9_NS GPIO_PIN_DATA_NS(1, 9 ) /*!< Specify PB.9 Pin Data Input/Output */ -#define PB10_NS GPIO_PIN_DATA_NS(1, 10) /*!< Specify PB.10 Pin Data Input/Output */ -#define PB11_NS GPIO_PIN_DATA_NS(1, 11) /*!< Specify PB.11 Pin Data Input/Output */ -#define PB12_NS GPIO_PIN_DATA_NS(1, 12) /*!< Specify PB.12 Pin Data Input/Output */ -#define PB13_NS GPIO_PIN_DATA_NS(1, 13) /*!< Specify PB.13 Pin Data Input/Output */ -#define PB14_NS GPIO_PIN_DATA_NS(1, 14) /*!< Specify PB.14 Pin Data Input/Output */ -#define PB15_NS GPIO_PIN_DATA_NS(1, 15) /*!< Specify PB.15 Pin Data Input/Output */ -#define PC0_NS GPIO_PIN_DATA_NS(2, 0 ) /*!< Specify PC.0 Pin Data Input/Output */ -#define PC1_NS GPIO_PIN_DATA_NS(2, 1 ) /*!< Specify PC.1 Pin Data Input/Output */ -#define PC2_NS GPIO_PIN_DATA_NS(2, 2 ) /*!< Specify PC.2 Pin Data Input/Output */ -#define PC3_NS GPIO_PIN_DATA_NS(2, 3 ) /*!< Specify PC.3 Pin Data Input/Output */ -#define PC4_NS GPIO_PIN_DATA_NS(2, 4 ) /*!< Specify PC.4 Pin Data Input/Output */ -#define PC5_NS GPIO_PIN_DATA_NS(2, 5 ) /*!< Specify PC.5 Pin Data Input/Output */ -#define PC6_NS GPIO_PIN_DATA_NS(2, 6 ) /*!< Specify PC.6 Pin Data Input/Output */ -#define PC7_NS GPIO_PIN_DATA_NS(2, 7 ) /*!< Specify PC.7 Pin Data Input/Output */ -#define PC8_NS GPIO_PIN_DATA_NS(2, 8 ) /*!< Specify PC.8 Pin Data Input/Output */ -#define PC9_NS GPIO_PIN_DATA_NS(2, 9 ) /*!< Specify PC.9 Pin Data Input/Output */ -#define PC10_NS GPIO_PIN_DATA_NS(2, 10) /*!< Specify PC.10 Pin Data Input/Output */ -#define PC11_NS GPIO_PIN_DATA_NS(2, 11) /*!< Specify PC.11 Pin Data Input/Output */ -#define PC12_NS GPIO_PIN_DATA_NS(2, 12) /*!< Specify PC.12 Pin Data Input/Output */ -#define PC13_NS GPIO_PIN_DATA_NS(2, 13) /*!< Specify PC.13 Pin Data Input/Output */ -#define PD0_NS GPIO_PIN_DATA_NS(3, 0 ) /*!< Specify PD.0 Pin Data Input/Output */ -#define PD1_NS GPIO_PIN_DATA_NS(3, 1 ) /*!< Specify PD.1 Pin Data Input/Output */ -#define PD2_NS GPIO_PIN_DATA_NS(3, 2 ) /*!< Specify PD.2 Pin Data Input/Output */ -#define PD3_NS GPIO_PIN_DATA_NS(3, 3 ) /*!< Specify PD.3 Pin Data Input/Output */ -#define PD4_NS GPIO_PIN_DATA_NS(3, 4 ) /*!< Specify PD.4 Pin Data Input/Output */ -#define PD5_NS GPIO_PIN_DATA_NS(3, 5 ) /*!< Specify PD.5 Pin Data Input/Output */ -#define PD6_NS GPIO_PIN_DATA_NS(3, 6 ) /*!< Specify PD.6 Pin Data Input/Output */ -#define PD7_NS GPIO_PIN_DATA_NS(3, 7 ) /*!< Specify PD.7 Pin Data Input/Output */ -#define PD8_NS GPIO_PIN_DATA_NS(3, 8 ) /*!< Specify PD.8 Pin Data Input/Output */ -#define PD9_NS GPIO_PIN_DATA_NS(3, 9 ) /*!< Specify PD.9 Pin Data Input/Output */ -#define PD10_NS GPIO_PIN_DATA_NS(3, 10) /*!< Specify PD.10 Pin Data Input/Output */ -#define PD11_NS GPIO_PIN_DATA_NS(3, 11) /*!< Specify PD.11 Pin Data Input/Output */ -#define PD12_NS GPIO_PIN_DATA_NS(3, 12) /*!< Specify PD.12 Pin Data Input/Output */ -#define PD14_NS GPIO_PIN_DATA_NS(3, 14) /*!< Specify PD.14 Pin Data Input/Output */ -#define PE0_NS GPIO_PIN_DATA_NS(4, 0 ) /*!< Specify PE.0 Pin Data Input/Output */ -#define PE1_NS GPIO_PIN_DATA_NS(4, 1 ) /*!< Specify PE.1 Pin Data Input/Output */ -#define PE2_NS GPIO_PIN_DATA_NS(4, 2 ) /*!< Specify PE.2 Pin Data Input/Output */ -#define PE3_NS GPIO_PIN_DATA_NS(4, 3 ) /*!< Specify PE.3 Pin Data Input/Output */ -#define PE4_NS GPIO_PIN_DATA_NS(4, 4 ) /*!< Specify PE.4 Pin Data Input/Output */ -#define PE5_NS GPIO_PIN_DATA_NS(4, 5 ) /*!< Specify PE.5 Pin Data Input/Output */ -#define PE6_NS GPIO_PIN_DATA_NS(4, 6 ) /*!< Specify PE.6 Pin Data Input/Output */ -#define PE7_NS GPIO_PIN_DATA_NS(4, 7 ) /*!< Specify PE.7 Pin Data Input/Output */ -#define PE8_NS GPIO_PIN_DATA_NS(4, 8 ) /*!< Specify PE.8 Pin Data Input/Output */ -#define PE9_NS GPIO_PIN_DATA_NS(4, 9 ) /*!< Specify PE.9 Pin Data Input/Output */ -#define PE10_NS GPIO_PIN_DATA_NS(4, 10) /*!< Specify PE.10 Pin Data Input/Output */ -#define PE11_NS GPIO_PIN_DATA_NS(4, 11) /*!< Specify PE.11 Pin Data Input/Output */ -#define PE12_NS GPIO_PIN_DATA_NS(4, 12) /*!< Specify PE.12 Pin Data Input/Output */ -#define PE13_NS GPIO_PIN_DATA_NS(4, 13) /*!< Specify PE.13 Pin Data Input/Output */ -#define PE14_NS GPIO_PIN_DATA_NS(4, 14) /*!< Specify PE.14 Pin Data Input/Output */ -#define PE15_NS GPIO_PIN_DATA_NS(4, 15) /*!< Specify PE.15 Pin Data Input/Output */ -#define PF0_NS GPIO_PIN_DATA_NS(5, 0 ) /*!< Specify PF.0 Pin Data Input/Output */ -#define PF1_NS GPIO_PIN_DATA_NS(5, 1 ) /*!< Specify PF.1 Pin Data Input/Output */ -#define PF2_NS GPIO_PIN_DATA_NS(5, 2 ) /*!< Specify PF.2 Pin Data Input/Output */ -#define PF3_NS GPIO_PIN_DATA_NS(5, 3 ) /*!< Specify PF.3 Pin Data Input/Output */ -#define PF4_NS GPIO_PIN_DATA_NS(5, 4 ) /*!< Specify PF.4 Pin Data Input/Output */ -#define PF5_NS GPIO_PIN_DATA_NS(5, 5 ) /*!< Specify PF.5 Pin Data Input/Output */ -#define PF6_NS GPIO_PIN_DATA_NS(5, 6 ) /*!< Specify PF.6 Pin Data Input/Output */ -#define PF7_NS GPIO_PIN_DATA_NS(5, 7 ) /*!< Specify PF.7 Pin Data Input/Output */ -#define PF8_NS GPIO_PIN_DATA_NS(5, 8 ) /*!< Specify PF.8 Pin Data Input/Output */ -#define PF9_NS GPIO_PIN_DATA_NS(5, 9 ) /*!< Specify PF.9 Pin Data Input/Output */ -#define PF10_NS GPIO_PIN_DATA_NS(5, 10) /*!< Specify PF.10 Pin Data Input/Output */ -#define PF11_NS GPIO_PIN_DATA_NS(5, 11) /*!< Specify PF.11 Pin Data Input/Output */ -#define PG2_NS GPIO_PIN_DATA_NS(6, 2 ) /*!< Specify PG.2 Pin Data Input/Output */ -#define PG3_NS GPIO_PIN_DATA_NS(6, 3 ) /*!< Specify PG.3 Pin Data Input/Output */ -#define PG4_NS GPIO_PIN_DATA_NS(6, 4 ) /*!< Specify PG.4 Pin Data Input/Output */ -#define PG9_NS GPIO_PIN_DATA_NS(6, 9 ) /*!< Specify PG.9 Pin Data Input/Output */ -#define PG10_NS GPIO_PIN_DATA_NS(6, 10) /*!< Specify PG.10 Pin Data Input/Output */ -#define PG11_NS GPIO_PIN_DATA_NS(6, 11) /*!< Specify PG.11 Pin Data Input/Output */ -#define PG12_NS GPIO_PIN_DATA_NS(6, 12) /*!< Specify PG.12 Pin Data Input/Output */ -#define PG13_NS GPIO_PIN_DATA_NS(6, 13) /*!< Specify PG.13 Pin Data Input/Output */ -#define PG14_NS GPIO_PIN_DATA_NS(6, 14) /*!< Specify PG.14 Pin Data Input/Output */ -#define PG15_NS GPIO_PIN_DATA_NS(6, 15) /*!< Specify PG.15 Pin Data Input/Output */ -#define PH4_NS GPIO_PIN_DATA_NS(7, 4 ) /*!< Specify PH.4 Pin Data Input/Output */ -#define PH5_NS GPIO_PIN_DATA_NS(7, 5 ) /*!< Specify PH.5 Pin Data Input/Output */ -#define PH6_NS GPIO_PIN_DATA_NS(7, 6 ) /*!< Specify PH.6 Pin Data Input/Output */ -#define PH7_NS GPIO_PIN_DATA_NS(7, 7 ) /*!< Specify PH.7 Pin Data Input/Output */ -#define PH8_NS GPIO_PIN_DATA_NS(7, 8 ) /*!< Specify PH.8 Pin Data Input/Output */ -#define PH9_NS GPIO_PIN_DATA_NS(7, 9 ) /*!< Specify PH.9 Pin Data Input/Output */ -#define PH10_NS GPIO_PIN_DATA_NS(7, 10) /*!< Specify PH.10 Pin Data Input/Output */ -#define PH11_NS GPIO_PIN_DATA_NS(7, 11) /*!< Specify PH.11 Pin Data Input/Output */ - - -/**@}*/ /* end of group GPIO_EXPORTED_CONSTANTS */ - - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Clear GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * - * @return None - * - * @details Clear the interrupt status of specified GPIO pin. - */ -#define GPIO_CLR_INT_FLAG(port, u32PinMask) ((port)->INTSRC = (u32PinMask)) - -/** - * @brief Disable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * - * @return None - * - * @details Disable the interrupt de-bounce function of specified GPIO pin. - */ -#define GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask)) - -/** - * @brief Enable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * @return None - * - * @details Enable the interrupt de-bounce function of specified GPIO pin. - */ -#define GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask)) - -/** - * @brief Disable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * - * @return None - * - * @details Disable I/O digital input path of specified GPIO pin. - */ -#define GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16)) - -/** - * @brief Enable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * - * @return None - * - * @details Enable I/O digital input path of specified GPIO pin. - */ -#define GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16)) - -/** - * @brief Disable I/O DOUT mask - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * - * @return None - * - * @details Disable I/O DOUT mask of specified GPIO pin. - */ -#define GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask)) - -/** - * @brief Enable I/O DOUT mask - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * - * @return None - * - * @details Enable I/O DOUT mask of specified GPIO pin. - */ -#define GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask)) - -/** - * @brief Get GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * - * @retval 0 No interrupt at specified GPIO pin - * @retval 1 The specified GPIO pin generate an interrupt - * - * @details Get the interrupt status of specified GPIO pin. - */ -#define GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask)) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32ClkSrc The de-bounce counter clock source. It could be GPIO_DBCTL_DBCLKSRC_HCLK or GPIO_DBCTL_DBCLKSRC_LIRC. - * @param[in] u32ClkSel The de-bounce sampling cycle selection. It could be - * - \ref GPIO_DBCTL_DBCLKSEL_1 - * - \ref GPIO_DBCTL_DBCLKSEL_2 - * - \ref GPIO_DBCTL_DBCLKSEL_4 - * - \ref GPIO_DBCTL_DBCLKSEL_8 - * - \ref GPIO_DBCTL_DBCLKSEL_16 - * - \ref GPIO_DBCTL_DBCLKSEL_32 - * - \ref GPIO_DBCTL_DBCLKSEL_64 - * - \ref GPIO_DBCTL_DBCLKSEL_128 - * - \ref GPIO_DBCTL_DBCLKSEL_256 - * - \ref GPIO_DBCTL_DBCLKSEL_512 - * - \ref GPIO_DBCTL_DBCLKSEL_1024 - * - \ref GPIO_DBCTL_DBCLKSEL_2048 - * - \ref GPIO_DBCTL_DBCLKSEL_4096 - * - \ref GPIO_DBCTL_DBCLKSEL_8192 - * - \ref GPIO_DBCTL_DBCLKSEL_16384 - * - \ref GPIO_DBCTL_DBCLKSEL_32768 - * - * @return None - * - * @details Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source. \n - * Example: _GPIO_SET_DEBOUNCE_TIME(PA, GPIO_DBCTL_DBCLKSRC_LIRC, GPIO_DBCTL_DBCLKSEL_4). \n - * It's meaning the De-debounce counter clock source is internal 10 KHz and sampling cycle selection is 4. \n - * Then the target de-bounce sampling cycle time is (4)*(1/(10*1000)) s = 4*0.0001 s = 400 us, - * and system will sampling interrupt input once per 400 us. - */ -#define GPIO_SET_DEBOUNCE_TIME(port, u32ClkSrc, u32ClkSel) ((port)->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) - -/** - * @brief Get GPIO Port IN Data - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * - * @return The specified port data - * - * @details Get the PIN register of specified GPIO port. - */ -#define GPIO_GET_IN_DATA(port) ((port)->PIN) - -/** - * @brief Set GPIO Port OUT Data - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Data GPIO port data. - * - * @return None - * - * @details Set the Data into specified GPIO port. - */ -#define GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data)) - -/** - * @brief Toggle Specified GPIO pin - * - * @param[in] u32Pin Pxy - * - * @return None - * - * @details Toggle the specified GPIO pint. - */ -#define GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1) - - -/** - * @brief Enable External GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB and PE. \n - * It could be 0 ~ 13 for PC GPIO port. \n - * It could be 0 ~ 12, 14 for PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 2 ~ 4, 9 ~ 15 for PG GPIO port. \n - * It could be 4 ~ 11 for PH GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be - * - \ref GPIO_INT_RISING - * - \ref GPIO_INT_FALLING - * - \ref GPIO_INT_BOTH_EDGE - * - \ref GPIO_INT_HIGH - * - \ref GPIO_INT_LOW - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -#define GPIO_EnableEINT GPIO_EnableInt - -/** - * @brief Disable External GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB and PE. \n - * It could be 0 ~ 13 for PC GPIO port. \n - * It could be 0 ~ 12, 14 for PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 2 ~ 4, 9 ~ 15 for PG GPIO port. \n - * It could be 4 ~ 11 for PH GPIO port. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -#define GPIO_DisableEINT GPIO_DisableInt - - -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs); -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin); -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); - - -/**@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group GPIO_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_GPIO_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2c.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2c.h deleted file mode 100644 index 4ea5a45748f..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2c.h +++ /dev/null @@ -1,523 +0,0 @@ -/**************************************************************************//** - * @file nu_i2c.h - * @version V3.0 - * $Revision: 1 $ - * $Date: 16/07/07 7:50p $ - * @brief M2355 series I2C Serial Interface Controller(I2C) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_I2C_H__ -#define __NU_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - -/** @addtogroup I2C_EXPORTED_CONSTANTS I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_CTL_STA_SI (0x28U) /*!< I2C_CTL setting for I2C control bits. It would set STA and SI bits */ -#define I2C_CTL_STA_SI_AA (0x2CU) /*!< I2C_CTL setting for I2C control bits. It would set STA, SI and AA bits */ -#define I2C_CTL_STO_SI (0x18U) /*!< I2C_CTL setting for I2C control bits. It would set STO and SI bits */ -#define I2C_CTL_STO_SI_AA (0x1CU) /*!< I2C_CTL setting for I2C control bits. It would set STO, SI and AA bits */ -#define I2C_CTL_SI (0x08U) /*!< I2C_CTL setting for I2C control bits. It would set SI bit */ -#define I2C_CTL_SI_AA (0x0CU) /*!< I2C_CTL setting for I2C control bits. It would set SI and AA bits */ -#define I2C_CTL_STA (0x20U) /*!< I2C_CTL setting for I2C control bits. It would set STA bit */ -#define I2C_CTL_STO (0x10U) /*!< I2C_CTL setting for I2C control bits. It would set STO bit */ -#define I2C_CTL_AA (0x04U) /*!< I2C_CTL setting for I2C control bits. It would set AA bit */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_GCMODE_ENABLE (1U) /*!< Enable I2C GC Mode */ -#define I2C_GCMODE_DISABLE (0U) /*!< Disable I2C GC Mode */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C SMBUS constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_SMBH_ENABLE (1U) /*!< Enable SMBus Host Mode enable */ -#define I2C_SMBD_ENABLE (0U) /*!< Enable SMBus Device Mode enable */ -#define I2C_PECTX_ENABLE (1U) /*!< Enable SMBus Packet Error Check Transmit function */ -#define I2C_PECTX_DISABLE (0U) /*!< Disable SMBus Packet Error Check Transmit function */ - -/**@}*/ /* end of group I2C_EXPORTED_CONSTANTS */ - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ -/** - * @brief The macro is used to set I2C bus condition at One Time - * - * @param[in] i2c Specify I2C port - * @param[in] u8Ctrl A byte writes to I2C control register - * - * @return None - * - * @details Set I2C_CTL register to control I2C bus conditions of START, STOP, SI, ACK. - */ -#define I2C_SET_CONTROL_REG(i2c, u8Ctrl) ((i2c)->CTL0 = ((i2c)->CTL0 & ~0x3Cu) | (u8Ctrl)) - -/** - * @brief The macro is used to set START condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus START condition in I2C_CTL register. - */ -#define I2C_START(i2c) ((i2c)->CTL0 = ((i2c)->CTL0 | I2C_CTL0_SI_Msk) | I2C_CTL0_STA_Msk) - -/** - * @brief The macro is used to wait I2C bus status get ready - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When a new status is presented of I2C bus, the SI flag will be set in I2C_CTL register. - */ -#define I2C_WAIT_READY(i2c) while(!((i2c)->CTL0 & I2C_CTL0_SI_Msk)) - -/** - * @brief The macro is used to Read I2C Bus Data Register - * - * @param[in] i2c Specify I2C port - * - * @return A byte of I2C data register - * - * @details I2C controller read data from bus and save it in I2CDAT register. - */ -#define I2C_GET_DATA(i2c) ((i2c)->DAT) - -/** - * @brief Write a Data to I2C Data Register - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data A byte that writes to data register - * - * @return None - * - * @details When write a data to I2C_DAT register, the I2C controller will shift it to I2C bus. - */ -#define I2C_SET_DATA(i2c, u8Data) ((i2c)->DAT = (u8Data)) - -/** - * @brief Get I2C Bus status code - * - * @param[in] i2c Specify I2C port - * - * @return I2C status code - * - * @details To get this status code to monitor I2C bus event. - */ -#define I2C_GET_STATUS(i2c) ((i2c)->STATUS0) - -/** - * @brief Get Time-out flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 I2C Bus time-out is not happened - * @retval 1 I2C Bus time-out is happened - * - * @details When I2C bus occurs time-out event, the time-out flag will be set. - */ -#define I2C_GET_TIMEOUT_FLAG(i2c) ( ((i2c)->TOCTL & I2C_TOCTL_TOIF_Msk) == I2C_TOCTL_TOIF_Msk ? 1u : 0u) - -/** - * @brief To get wake-up flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details I2C bus occurs wake-up event, wake-up flag will be set. - */ -#define I2C_GET_WAKEUP_FLAG(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKIF_Msk) == I2C_WKSTS_WKIF_Msk ? 1u : 0u) - -/** - * @brief To clear wake-up flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up flag is set, use this macro to clear it. - */ -#define I2C_CLEAR_WAKEUP_FLAG(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKIF_Msk) - -/** - * @brief To get wake-up address frame ACK done flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 The ACK bit cycle of address match frame is not done - * @retval 1 The ACK bit cycle of address match frame is done in power-down - * - * @details I2C bus occurs wake-up event and address frame ACK is done, this flag will be set. - * - * \hideinitializer - */ -#define I2C_GET_WAKEUP_DONE(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKAKDONE_Msk) == I2C_WKSTS_WKAKDONE_Msk ? 1u : 0u) - -/** - * @brief To clear address frame ACK done flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up done is set, use this macro to clear it. - * - * \hideinitializer - */ -#define I2C_CLEAR_WAKEUP_DONE(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKAKDONE_Msk) - -/** - * @brief To get read/write status bit in address wakeup frame - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Write command be record on the address match wakeup frame - * @retval 1 Read command be record on the address match wakeup frame. - * - * @details I2C bus occurs wake-up event and address frame is received, this bit will record read/write status. - * - * \hideinitializer -*/ -#define I2C_GET_WAKEUP_WR_STATUS(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WRSTSWK_Msk) == I2C_WKSTS_WRSTSWK_Msk ? 1u : 0u) - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * - */ -#define I2C_SMBUS_GET_STATUS(i2c) ((i2c)->BUSSTS) - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return Packet error check byte value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * - */ -#define I2C_SMBUS_GET_PEC_VALUE(i2c) ((i2c)->PKTCRC) - -/** - * @brief Set SMBus Bytes number of Transmission or reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * - */ -#define I2C_SMBUS_SET_PACKET_BYTE_COUNT(i2c, u32PktSize) ((i2c)->PKTSIZE = (u32PktSize)) - -/** - * @brief Enable SMBus Alert function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin will pull lo, and reply ACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin is supported to receive alert state(Lo trigger) - * - */ -#define I2C_SMBUS_ENABLE_ALERT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Disable SMBus Alert pin function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin will pull hi, and reply NACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin is not supported to receive alert state(Lo trigger) - * - */ -#define I2C_SMBUS_DISABLE_ALERT(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is output mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output mode. - * - * - */ -#define I2C_SMBUS_SET_SUSCON_OUT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is input mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is input mode. - * - * - */ -#define I2C_SMBUS_SET_SUSCON_IN(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin output high state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output hi state. - * - */ -#define I2C_SMBUS_SET_SUSCON_HIGH(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOSTS_Msk) - - -/** - * @brief Set SMBus SUSCON pin output low state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output lo state. - * - */ -#define I2C_SMBUS_SET_SUSCON_LOW(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOSTS_Msk) - -/** - * @brief Enable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The 9th bit can response the ACK or NACK according the received data by user. When the byte is received, SCLK line stretching to low between the 8th and 9th SCLK pulse. - * - */ -#define I2C_SMBUS_ACK_MANUAL(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Disable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable acknowledge response control by user. - * - */ -#define I2C_SMBUS_ACK_AUTO(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Enable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * - */ -#define I2C_SMBUS_9THBIT_INT_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Disable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * - */ -#define I2C_SMBUS_9THBIT_INT_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Enable SMBus PEC clear at REPEAT START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable the condition of REAEAT START can clear the PEC calculation. - * - */ -#define I2C_SMBUS_RST_PEC_AT_START_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Disable SMBus PEC clear at Repeat START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable the condition of Repeat START can clear the PEC calculation. - * - */ -#define I2C_SMBUS_RST_PEC_AT_START_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Enable RX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set RXPDMAEN bit of I2C_CTL1 register to enable RX PDMA transfer function. - */ -#define I2C_ENABLE_RX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Enable TX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set TXPDMAEN bit of I2C_CTL1 register to enable TX PDMA transfer function. - */ -#define I2C_ENABLE_TX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear RXPDMAEN bit of I2C_CTL1 register to disable RX PDMA transfer function. - */ -#define I2C_DISABLE_RX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear TXPDMAEN bit of I2C_CTL1 register to disable TX PDMA transfer function. - */ -#define I2C_DISABLE_TX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Enable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Enable this function is to stretch bus by hardware after PDMA transfer is done if SI is not cleared. - */ -#define I2C_ENABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Disable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C wil send STOP after PDMA transfers done automatically. - */ -#define I2C_DISABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Reset PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C PDMA engine will be reset after this function is called. - */ -#define I2C_DISABLE_RST_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMARST_Msk) - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -static __INLINE void I2C_STOP(I2C_T *i2c); - -/** - * @brief The macro is used to set STOP condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus STOP condition in I2C_CTL register. - */ -static __INLINE void I2C_STOP(I2C_T *i2c) -{ - - (i2c)->CTL0 |= (I2C_CTL0_SI_Msk | I2C_CTL0_STO_Msk); - while(i2c->CTL0 & I2C_CTL0_STO_Msk) {} -} - - -void I2C_ClearTimeoutFlag(I2C_T *i2c); -void I2C_Close(I2C_T *i2c); -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack); -void I2C_DisableInt(I2C_T *i2c); -void I2C_EnableInt(I2C_T *i2c); -uint32_t I2C_GetBusClockFreq(I2C_T *i2c); -uint32_t I2C_GetIntFlag(I2C_T *i2c); -uint32_t I2C_GetStatus(I2C_T *i2c); -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock); -uint8_t I2C_GetData(I2C_T *i2c); -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode); -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask); -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock); -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout); -void I2C_DisableTimeout(I2C_T *i2c); -void I2C_EnableWakeup(I2C_T *i2c); -void I2C_DisableWakeup(I2C_T *i2c); -void I2C_SetData(I2C_T *i2c, uint8_t u8Data); -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8Data); -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t au8Data[], uint32_t u32wLen); -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t u8Data); -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t au8Data[], uint32_t u32wLen); -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t u8Data); -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t au8Data[], uint32_t u32wLen); -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr); -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t au8Rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t au8Rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t au8Rdata[], uint32_t u32rLen); -uint32_t I2C_SMBusGetStatus(I2C_T *i2c); -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8ClrSMBusIntFlag); -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize); -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice); -void I2C_SMBusClose(I2C_T *i2c); -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn); -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c); -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t u32Us, uint32_t u32Hclk); -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); - -/**@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group I2C_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2s.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2s.h deleted file mode 100644 index b3ebe0c5def..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_i2s.h +++ /dev/null @@ -1,355 +0,0 @@ -/****************************************************************************//** - * @file nu_i2s.h - * @version V3.00 - * @brief M2354 series I2S driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_I2S_H__ -#define __NU_I2S_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ - -#define I2S_DATABIT_8 (0UL << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 8-bit \hideinitializer */ -#define I2S_DATABIT_16 (1UL << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 16-bit \hideinitializer */ -#define I2S_DATABIT_24 (2UL << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 24-bit \hideinitializer */ -#define I2S_DATABIT_32 (3UL << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 32-bit \hideinitializer */ - -/* Audio Format */ -#define I2S_MONO I2S_CTL0_MONO_Msk /*!< Mono channel \hideinitializer */ -#define I2S_STEREO (0UL) /*!< Stereo channel \hideinitializer */ -#define I2S_ENABLE_MONO I2S_MONO -#define I2S_DISABLE_MONO I2S_STEREO - -/* I2S Data Format */ -#define I2S_FORMAT_I2S (0UL << I2S_CTL0_FORMAT_Pos) /*!< I2S data format \hideinitializer */ -#define I2S_FORMAT_I2S_MSB (1UL << I2S_CTL0_FORMAT_Pos) /*!< I2S MSB data format \hideinitializer */ -#define I2S_FORMAT_I2S_LSB (2UL << I2S_CTL0_FORMAT_Pos) /*!< I2S LSB data format \hideinitializer */ -#define I2S_FORMAT_PCM (4UL << I2S_CTL0_FORMAT_Pos) /*!< PCM data format \hideinitializer */ -#define I2S_FORMAT_PCM_MSB (5UL << I2S_CTL0_FORMAT_Pos) /*!< PCM MSB data format \hideinitializer */ -#define I2S_FORMAT_PCM_LSB (6UL << I2S_CTL0_FORMAT_Pos) /*!< PCM LSB data format \hideinitializer */ - -/* I2S Data Format */ -#define I2S_ORDER_AT_MSB 0UL /*!< Channel data is at MSB \hideinitializer */ -#define I2S_ORDER_AT_LSB I2S_CTL0_ORDER_Msk /*!< Channel data is at LSB \hideinitializer */ - -/* I2S TDM Channel Number */ -#define I2S_TDM_2CH 0UL /*!< Use TDM 2 channel \hideinitializer */ -#define I2S_TDM_4CH 1UL /*!< Use TDM 4 channel \hideinitializer */ -#define I2S_TDM_6CH 2UL /*!< Use TDM 6 channel \hideinitializer */ -#define I2S_TDM_8CH 3UL /*!< Use TDM 8 channel \hideinitializer */ - -/* I2S TDM Channel Width */ -#define I2S_TDM_WIDTH_8BIT 0UL /*!< TDM channel witch is 8-bit \hideinitializer */ -#define I2S_TDM_WIDTH_16BIT 1UL /*!< TDM channel witch is 16-bit \hideinitializer */ -#define I2S_TDM_WIDTH_24BIT 2UL /*!< TDM channel witch is 24-bit \hideinitializer */ -#define I2S_TDM_WIDTH_32BIT 3UL /*!< TDM channel witch is 32-bit \hideinitializer */ - -/* I2S TDM Sync Width */ -#define I2S_TDM_SYNC_ONE_BCLK 0UL /*!< TDM sync widht is one BLCK period \hideinitializer */ -#define I2S_TDM_SYNC_ONE_CHANNEL 1UL /*!< TDM sync widht is one channel period \hideinitializer */ - -/* I2S Operation mode */ -#define I2S_MODE_SLAVE I2S_CTL0_SLAVE_Msk /*!< As slave mode \hideinitializer */ -#define I2S_MODE_MASTER 0UL /*!< As master mode \hideinitializer */ - -/* I2S FIFO Threshold */ -#define I2S_FIFO_TX_LEVEL_WORD_0 0UL /*!< TX threshold is 0 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_1 (1UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_2 (2UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_3 (3UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_4 (4UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_5 (5UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_6 (6UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_7 (7UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_8 (8UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_9 (9UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_10 (10UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_11 (11UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_12 (12UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_13 (13UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_14 (14UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_15 (15UL << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 15 words \hideinitializer */ - -#define I2S_FIFO_RX_LEVEL_WORD_1 0UL /*!< RX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_2 (1UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_3 (2UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_4 (3UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_5 (4UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_6 (5UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_7 (6UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_8 (7UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_9 (8UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_10 (9UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_11 (10UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_12 (11UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_13 (12UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_14 (13UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_15 (14UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 15 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_16 (15UL << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 16 words \hideinitializer */ - -/* I2S Record Channel */ -#define I2S_MONO_RIGHT 0UL /*!< Record mono right channel \hideinitializer */ -#define I2S_MONO_LEFT I2S_CTL0_RXLCH_Msk /*!< Record mono left channel \hideinitializer */ - -/* I2S Channel */ -#define I2S_RIGHT 0UL /*!< Select right channel \hideinitializer */ -#define I2S_LEFT 1UL /*!< Select left channel \hideinitializer */ - -/**@}*/ /* end of group I2S_EXPORTED_CONSTANTS */ - - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - - -/** - * @brief Enable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_ENABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if((u32ChMask > 0UL) && (u32ChMask < 9UL)) - { - i2s->CTL1 |= (1UL << (u32ChMask - 1UL)); - } -} - -/** - * @brief Disable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_DISABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if((u32ChMask > 0UL) && (u32ChMask < 9UL)) - { - i2s->CTL1 &= ~(1UL << (u32ChMask - 1UL)); - } -} - -/** - * @brief Enable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXEN_Msk ) - -/** - * @brief Disable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXEN_Msk ) - -/** - * @brief Enable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXEN_Msk ) - -/** - * @brief Disable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXEN_Msk ) - -/** - * @brief Enable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX_MUTE(i2s) ( (i2s)->CTL0 |= I2S_CTL0_MUTE_Msk ) - -/** - * @brief Disable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX_MUTE(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_MUTE_Msk ) - -/** - * @brief Clear Tx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_TX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXFBCLR_Msk ) - -/** - * @brief Clear Rx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_RX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref I2S_MONO_LEFT - * - \ref I2S_MONO_RIGHT - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_SET_MONO_RX_CHANNEL(I2S_T *i2s, uint32_t u32Ch) -{ - u32Ch == I2S_MONO_LEFT ? - (i2s->CTL0 |= I2S_CTL0_RXLCH_Msk) : - (i2s->CTL0 &= ~I2S_CTL0_RXLCH_Msk); -} - -/** - * @brief Write data to I2S Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Data: The data written to FIFO. - * @return none - * \hideinitializer - */ -#define I2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TXFIFO = (u32Data) ) - -/** - * @brief Read Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return Data in Rx FIFO. - * \hideinitializer - */ -#define I2S_READ_RX_FIFO(i2s) ( (i2s)->RXFIFO ) - -/** - * @brief This function gets the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 & (u32Mask) ) - -/** - * @brief This function clears the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 |= (u32Mask) ) - -/** - * @brief This function gets the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 & (u32Mask) ) - -/** - * @brief This function clears the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 |= (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_TX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_TXCNT_Msk) >> I2S_STATUS1_TXCNT_Pos) & 0xF ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_RX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_RXCNT_Msk) >> I2S_STATUS1_RXCNT_Pos) & 0xF ) - -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat); -void I2S_Close(I2S_T *i2s); -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask); -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask); -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock); -void I2S_DisableMCLK(I2S_T *i2s); -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth); - - -/**@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group I2S_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_I2S_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_keystore.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_keystore.h deleted file mode 100644 index eb055a35230..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_keystore.h +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************//** - * @file nu_keystore.h - * @version V3.00 - * @brief Key Store Driver Header - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_KEYSTORE_H__ -#define __NU_KEYSTORE_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KS_Driver Key Store Driver - @{ -*/ - -/** @addtogroup KS_EXPORTED_CONSTANTS Key Store Exported Constants - @{ -*/ - -#define KS_TOMETAKEY(x) (((uint32_t)(x) << KS_METADATA_NUMBER_Pos) & KS_METADATA_NUMBER_Msk) -#define KS_TOKEYIDX(x) (((uint32_t)(x) & KS_METADATA_NUMBER_Msk) >> KS_METADATA_NUMBER_Pos) - -typedef enum KSMEM -{ - KS_SRAM = 0, /*!< Volatile Memory */ - KS_FLASH = 1, /*!< Non-volatile Memory */ - KS_OTP = 2 /*!< One-Time Programming Memory */ -} KS_MEM_Type; - -#define KS_OP_READ (0 << KS_CTL_OPMODE_Pos) -#define KS_OP_WRITE (1 << KS_CTL_OPMODE_Pos) -#define KS_OP_ERASE (2 << KS_CTL_OPMODE_Pos) -#define KS_OP_ERASE_ALL (3 << KS_CTL_OPMODE_Pos) -#define KS_OP_REVOKE (4 << KS_CTL_OPMODE_Pos) -#define KS_OP_REMAN (5 << KS_CTL_OPMODE_Pos) - -#define KS_OWNER_AES (0ul) -#define KS_OWNER_HMAC (1ul) -#define KS_OWNER_RSA_EXP (2ul) -#define KS_OWNER_RSA_MID (3ul) -#define KS_OWNER_ECC (4ul) -#define KS_OWNER_CPU (5ul) - -#define KS_META_AES (0ul << KS_METADATA_OWNER_Pos) /*!< AES Access Only */ -#define KS_META_HMAC (1ul << KS_METADATA_OWNER_Pos) /*!< HMAC Access Only */ -#define KS_META_RSA_EXP (2ul << KS_METADATA_OWNER_Pos) /*!< RSA_EXP Access Only */ -#define KS_META_RSA_MID (3ul << KS_METADATA_OWNER_Pos) /*!< RSA_MID Access Only */ -#define KS_META_ECC (4ul << KS_METADATA_OWNER_Pos) /*!< ECC Access Only */ -#define KS_META_CPU (5ul << KS_METADATA_OWNER_Pos) /*!< CPU Access Only */ - -#define KS_META_128 ( 0ul << KS_METADATA_SIZE_Pos) /*!< Key size 128 bits */ -#define KS_META_163 ( 1ul << KS_METADATA_SIZE_Pos) /*!< Key size 163 bits */ -#define KS_META_192 ( 2ul << KS_METADATA_SIZE_Pos) /*!< Key size 192 bits */ -#define KS_META_224 ( 3ul << KS_METADATA_SIZE_Pos) /*!< Key size 224 bits */ -#define KS_META_233 ( 4ul << KS_METADATA_SIZE_Pos) /*!< Key size 233 bits */ -#define KS_META_255 ( 5ul << KS_METADATA_SIZE_Pos) /*!< Key size 255 bits */ -#define KS_META_256 ( 6ul << KS_METADATA_SIZE_Pos) /*!< Key size 256 bits */ -#define KS_META_283 ( 7ul << KS_METADATA_SIZE_Pos) /*!< Key size 283 bits */ -#define KS_META_384 ( 8ul << KS_METADATA_SIZE_Pos) /*!< Key size 384 bits */ -#define KS_META_409 ( 9ul << KS_METADATA_SIZE_Pos) /*!< Key size 409 bits */ -#define KS_META_512 (10ul << KS_METADATA_SIZE_Pos) /*!< Key size 512 bits */ -#define KS_META_521 (11ul << KS_METADATA_SIZE_Pos) /*!< Key size 521 bits */ -#define KS_META_571 (12ul << KS_METADATA_SIZE_Pos) /*!< Key size 571 bits */ -#define KS_META_1024 (16ul << KS_METADATA_SIZE_Pos) /*!< Key size 1024 bits */ -#define KS_META_1536 (17ul << KS_METADATA_SIZE_Pos) /*!< Key size 1024 bits */ -#define KS_META_2048 (18ul << KS_METADATA_SIZE_Pos) /*!< Key size 2048 bits */ -#define KS_META_3072 (19ul << KS_METADATA_SIZE_Pos) /*!< Key size 1024 bits */ -#define KS_META_4096 (20ul << KS_METADATA_SIZE_Pos) /*!< Key size 4096 bits */ - -#define KS_META_BOOT ( 1ul << KS_METADATA_BS_Pos) /*!< Key only used for boot ROM only */ - -#define KS_META_READABLE (1ul << KS_METADATA_READABLE_Pos) /*!< Allow the key to be read by software */ - -#define KS_META_PRIV (1ul << KS_METADATA_PRIV_Pos) /*!< Privilege key */ -#define KS_META_NONPRIV (0ul << KS_METADATA_PRIV_Pos) /*!< Non-privilege key */ - -#define KS_META_SECURE (1ul << KS_METADATA_SEC_Pos) /*!< Secure key */ -#define KS_META_NONSECURE (0ul << KS_METADATA_SEC_Pos) /*!< Non-secure key */ - - -/** - * @brief Enable scramble function - * @details This function is used to enable scramle function of Key Store. - */ - -#define KS_SCRAMBLING() KS->CTL |= KS_CTL_SCMB_Msk - - - - -/**@}*/ /* end of group KS_EXPORTED_CONSTANTS */ - - -/** @addtogroup KS_EXPORTED_FUNCTIONS Key Store Exported Functions - @{ -*/ - -void KS_Open(void); -int32_t KS_Read(KS_MEM_Type type, int32_t i32KeyIdx, uint32_t au32Key[], uint32_t u32WordCnt); -int32_t KS_Write(KS_MEM_Type eType, uint32_t u32Meta, uint32_t au32Key[]); -int32_t KS_WriteOTP(int32_t i32KeyIdx, uint32_t u32Meta, uint32_t au32Key[]); -int32_t KS_EraseKey(int32_t i32KeyIdx); -int32_t KS_EraseAll(KS_MEM_Type eType); -int32_t KS_RevokeKey(KS_MEM_Type eType, int32_t i32KeyIdx); -uint32_t KS_GetRemainSize(KS_MEM_Type eType); -int32_t KS_ToggleSRAM(void); -uint32_t KS_GetKeyWordCnt(uint32_t u32Meta); -uint32_t KS_GetRemainKeyCount(KS_MEM_Type mem); - -/**@}*/ /* end of group KS_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group KS_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_KEYSTORE_H__ */ - - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_lcd.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_lcd.h deleted file mode 100644 index 02613ec21db..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_lcd.h +++ /dev/null @@ -1,531 +0,0 @@ -/**************************************************************************//** - * @file nu_lcd.h - * @version V3.00 - * @brief Liquid-Crystal Display(LCD) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_LCD_H__ -#define __NU_LCD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup LCD_Driver LCD Driver - @{ -*/ - -/** @addtogroup LCD_EXPORTED_CONSTANTS LCD Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD Bias Voltage Level Selection Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_BIAS_LV_1_2 (1ul << LCD_PCTL_BIAS_Pos) /*!< LCD bias voltage level selection - 1/2 Bias \hideinitializer */ -#define LCD_BIAS_LV_1_3 (2ul << LCD_PCTL_BIAS_Pos) /*!< LCD bias voltage level selection - 1/3 Bias \hideinitializer */ -#define LCD_BIAS_LV_1_4 (3ul << LCD_PCTL_BIAS_Pos) /*!< LCD bias voltage level selection - 1/4 Bias \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD COM Duty Ratio Selection Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_COM_DUTY_1_1 (0ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/1 Duty \hideinitializer */ -#define LCD_COM_DUTY_1_2 (1ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/2 Duty \hideinitializer */ -#define LCD_COM_DUTY_1_3 (2ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/3 Duty \hideinitializer */ -#define LCD_COM_DUTY_1_4 (3ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/4 Duty \hideinitializer */ -#define LCD_COM_DUTY_1_5 (4ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/5 Duty \hideinitializer */ -#define LCD_COM_DUTY_1_6 (5ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/6 Duty \hideinitializer */ -#define LCD_COM_DUTY_1_7 (6ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/7 Duty \hideinitializer */ -#define LCD_COM_DUTY_1_8 (7ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/8 Duty \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD Waveform Attribute Selection Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_WAVEFORM_TYPE_A_NORMAL (0ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-A, no inverse \hideinitializer */ -#define LCD_WAVEFORM_TYPE_B_NORMAL (1ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-B, no inverse \hideinitializer */ -#define LCD_WAVEFORM_TYPE_A_INVERSE (2ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-A and inverse \hideinitializer */ -#define LCD_WAVEFORM_TYPE_B_INVERSE (3ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-B and inverse \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD Charge Pump Voltage Selection Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_CP_VOLTAGE_LV_0 (0ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 2.6 V \hideinitializer */ -#define LCD_CP_VOLTAGE_LV_1 (1ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 2.8 V \hideinitializer */ -#define LCD_CP_VOLTAGE_LV_2 (2ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.0 V \hideinitializer */ -#define LCD_CP_VOLTAGE_LV_3 (3ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.2 V \hideinitializer */ -#define LCD_CP_VOLTAGE_LV_4 (4ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.4 V \hideinitializer */ -#define LCD_CP_VOLTAGE_LV_5 (5ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.6 V \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD Interrupt Source Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_DISABLE_ALL_INT (0ul << LCD_INTEN_FCEIEN_Pos) /*!< Disable all LCD interrupt sources \hideinitializer */ -#define LCD_FRAME_COUNTING_END_INT (1ul << LCD_INTEN_FCEIEN_Pos) /*!< Indicate frame count end interrupt \hideinitializer */ -#define LCD_FRAME_END_INT (1ul << LCD_INTEN_FEIEN_Pos) /*!< Indicate frame end interrupt \hideinitializer */ -#define LCD_CPTOUT_INT (1ul << LCD_INTEN_CTOIEN_Pos) /*!< Indicate charge pump charging timeout interrupt \hideinitializer */ -#define LCD_ENABLE_ALL_INT (7ul << LCD_INTEN_FCEIEN_Pos) /*!< Enable all LCD interrupt sources \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD Operation Voltage Source Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_VOLTAGE_SOURCE_VLCD (0ul << LCD_DCTL_VSRC_Pos) /*!< LCD voltage source from external VLCD power \hideinitializer */ -#define LCD_VOLTAGE_SOURCE_AVDD (1ul << LCD_DCTL_VSRC_Pos) /*!< LCD voltage source from internal VDD \hideinitializer */ -#define LCD_VOLTAGE_SOURCE_CP (2ul << LCD_DCTL_VSRC_Pos) /*!< LCD voltage source from built-in charge pump \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD Driving Mode Selection Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_LOW_DRIVING_AND_BUF_OFF (0ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with low-drive and voltage buffer disabled \hideinitializer */ -#define LCD_HIGH_DRIVING_AND_BUF_OFF (1ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with high-drive and voltage buffer disabled \hideinitializer */ -#define LCD_LOW_DRIVING_AND_BUF_ON (2ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with low-drive and voltage buffer enabled \hideinitializer */ -#define LCD_HIGH_DRIVING_AND_BUF_OFF_AND_PWR_SAVING (5ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with high-drive, voltage buffer disabled and power saving \hideinitializer */ -#define LCD_LOW_DRIVING_AND_BUF_ON_AND_PWR_SAVING (6ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with low-drive, voltage buffer enabled and power saving \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* LCD Power Saving Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define LCD_PWR_SAVING_NORMAL_MODE (0ul << LCD_DCTL_PSVREV_Pos) /*!< The timing of LCD power saving is normal \hideinitializer */ -#define LCD_PWR_SAVING_REVERSE_MODE (1ul << LCD_DCTL_PSVREV_Pos) /*!< The timing of LCD power saving is reverse \hideinitializer */ - -/**@}*/ /* end of group LCD_EXPORTED_CONSTANTS */ - - -/** @addtogroup LCD_EXPORTED_STRUCTS LCD Exported Structs - @{ -*/ -/** - * @details LCD Configuration Data Struct - */ -typedef struct -{ - uint32_t u32SrcFreq; /*!< LCD clock source frequency */ - uint32_t u32ComDuty; /*!< COM duty */ - uint32_t u32BiasLevel; /*!< Bias level */ - uint32_t u32Framerate; /*!< Operation frame rate */ - uint32_t u32WaveformType; /*!< Waveform type */ - uint32_t u32IntSrc; /*!< Interrupt source */ - uint32_t u32DrivingMode; /*!< Driving mode */ - uint32_t u32VSrc; /*!< Voltage source */ -} S_LCD_CFG_T; - -/**@}*/ /* end of group LCD_EXPORTED_STRUCTS */ - - -/** @addtogroup LCD_EXPORTED_FUNCTIONS LCD Exported Functions - @{ -*/ - -/** - * @brief Enable LCD Display - * - * @param None - * - * @return None - * - * @details This macro is used to enable LCD display. - */ -#define LCD_ENABLE_DISPLAY() do{ LCD->CTL |= LCD_CTL_EN_Msk; while(LCD->CTL & LCD_CTL_SYNC_Msk) {} }while(0) - -/** - * @brief Disable LCD Display - * - * @param None - * - * @return None - * - * @details This macro is used to disable LCD display. - */ -#define LCD_DISABLE_DISPLAY() do{ LCD->CTL &= ~LCD_CTL_EN_Msk; while(LCD->CTL & LCD_CTL_SYNC_Msk) {} }while(0) - -/** - * @brief Set LCD Waveform Type - * - * @param[in] type The LCD waveform type. It could be one of the following type - * - \ref LCD_WAVEFORM_TYPE_A_NORMAL - * - \ref LCD_WAVEFORM_TYPE_B_NORMAL - * - \ref LCD_WAVEFORM_TYPE_A_INVERSE - * - \ref LCD_WAVEFORM_TYPE_B_INVERSE - * - * @return None - * - * @details This macro is used to set the attribute of LCD output waveform. - */ -#define LCD_WAVEFORM_TYPE(type) (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_TYPE_Msk) | (type)) - -/** - * @brief Set LCD Source Clock Divider - * - * @param[in] div The frequency divider, valid value is between 1 to 1024. - * - * @return None - * - * @details This macro is used to set the LCD operarion frequency is (LCD source frequency / div). - */ -#define LCD_SET_FREQDIV(div) (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_FREQDIV_Msk) | (((div)-1) << LCD_PCTL_FREQDIV_Pos)) - -/** - * @brief Set Charge Pump Voltage - * - * @param[in] voltage The target charge pump voltage. It could be one of the following voltage level - * - \ref LCD_CP_VOLTAGE_LV_0, 2.6 V - * - \ref LCD_CP_VOLTAGE_LV_1, 2.8 V - * - \ref LCD_CP_VOLTAGE_LV_2, 3.0 V - * - \ref LCD_CP_VOLTAGE_LV_3, 3.2 V - * - \ref LCD_CP_VOLTAGE_LV_4, 3.4 V - * - \ref LCD_CP_VOLTAGE_LV_5, 3.6 V - * - * @return None - * - * @details This macro is used to set charge pump voltage for VLCD. - */ -#define LCD_SET_CP_VOLTAGE(voltage) (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_CPVSEL_Msk) | (voltage)) - -/** - * @brief Decrease Charge Pump Voltage - * - * @param[in] unit The tuning units, valid value is between 0 to 7. - * One unit of voltage is about 0.03V, and the charge pump voltage is decreased (unit * 0.03)V. - * - * @return None - * - * @details This macro is used to decrease charge pump voltage by specific units. - */ -#define LCD_CP_VOLTAGE_DECREASE(unit) (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_CPVTUNE_Msk) | ((unit) << LCD_PCTL_CPVTUNE_Pos)) - -/** - * @brief Increase Charge Pump Voltage - * - * @param[in] unit The tuning units, valid value is between 1 to 8. - * One unit of voltage is about 0.03V, and the charge pump voltage is increased (unit * 0.03)V. - * - * @return None - * - * @details This macro is used to increase charge pump voltage by specific units. - */ -#define LCD_CP_VOLTAGE_INCREASE(unit) (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_CPVTUNE_Msk) | ((16-(unit)) << LCD_PCTL_CPVTUNE_Pos)) - -/** - * @brief Set LCD Blinking ON - * - * @param None - * - * @return None - * - * @details This macro is used to enable LCD blinking. - */ -#define LCD_BLINKING_ON() (LCD->FCTL |= LCD_FCTL_BLINK_Msk) - -/** - * @brief Set LCD Blinking OFF - * - * @param None - * - * @return None - * - * @details This macro is used to disable LCD blinking. - */ -#define LCD_BLINKING_OFF() (LCD->FCTL &= ~LCD_FCTL_BLINK_Msk) - -/** - * @brief Set LCD Frame Counting Value - * - * @param[in] value Frame counting value. Valid value is between 1 to 1024. - * - * @return None - * - * @details This macro is used to set the LCD frame counting value to configure the blink interval. - * @note For type-B waveform, the frame counter increases at the end of odd frames, not even frames. - */ -#define LCD_SET_FRAME_COUNTING_VALUE(value) (LCD->FCTL = (LCD->FCTL & ~LCD_FCTL_FCV_Msk) | (((value)-1) << LCD_FCTL_FCV_Pos)) - -/** - * @brief Set Null Frame Time - * - * @param[in] unit The unit parameter is used to determine the null frame time, valid value is between 0 to 15. - * And one unit time is one LCD operation clock period. - * - * @return None - * - * @details This macro is used to set the one null frame time. - * @note All COM and SEG output voltages will keep at 0V during a null frame. - */ -#define LCD_SET_NULL_FRAME_TIME(unit) (LCD->FCTL = (LCD->FCTL & ~LCD_FCTL_NFTIME_Msk) | ((unit) << LCD_FCTL_NFTIME_Pos)) - -/** - * @brief Set Continuous Frames - * - * @param[in] frame The continuous frames, valid setting is between 1 to 16 frames. - * - * @return None - * - * @details This macro is used to specify the number of continuous frames reached to insert one null frame. - */ -#define LCD_SET_CONTINUOUS_FRAME(frame) (LCD->FCTL = (LCD->FCTL & ~LCD_FCTL_NFNUM_Msk) | (((frame)-1) << LCD_FCTL_NFNUM_Pos)) - -/** - * @brief Select LCD Voltage Source - * - * @param[in] mode The LCD operation voltage source. It could be one of the following source - * - \ref LCD_VOLTAGE_SOURCE_VLCD - * - \ref LCD_VOLTAGE_SOURCE_AVDD - * - \ref LCD_VOLTAGE_SOURCE_CP - * - * @return None - * - * @details This macro is used to select LCD operation voltage source. - */ -#define LCD_VOLTAGE_SOURCE(source) (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_VSRC_Msk) | (source)) - -/** - * @brief Set LCD Driving Mode - * - * @param[in] mode The LCD operation driving mode. It could be one of the following mode - * - \ref LCD_LOW_DRIVING_AND_BUF_OFF - * - \ref LCD_HIGH_DRIVING_AND_BUF_OFF - * - \ref LCD_LOW_DRIVING_AND_BUF_ON - * - \ref LCD_HIGH_DRIVING_AND_BUF_OFF_AND_PWR_SAVING - * - \ref LCD_LOW_DRIVING_AND_BUF_ON_AND_PWR_SAVING - * - * @return None - * - * @details This macro is used to set LCD operation drivig mode. - */ -#define LCD_DRIVING_MODE(mode) (LCD->DCTL = (LCD->DCTL & ~(LCD_DCTL_RESMODE_Msk | LCD_DCTL_BUFEN_Msk | LCD_DCTL_PSVEN_Msk)) | (mode)) - -/** - * @brief Select Power Saving Mode - * - * @param[in] mode The LCD power saving mode selection. It could be one of the following constant definition - * - \ref LCD_PWR_SAVING_NORMAL_MODE - * - \ref LCD_PWR_SAVING_REVERSE_MODE - * - * @return None - * - * @details This macro is used to set the LCD power saving mode. - * When the timing of power saving mode is reversed, the original power saving period becomes no power saving, - * and the original no power saving period becomes power saving. - */ -#define LCD_PWR_SAVING_MODE(mode) (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_PSVREV_Msk) | (mode)) - -/** - * @brief Set Power Saving T1 Period - * - * @param[in] t1 The number of t1 to determine T1 period, valid value is between 1 to 16. - * And one unit of t1 period is half of LCD operation clock period. - * - * @return None - * - * @details This macro is used to configure the T1 (Enable Time) period of power saving. - */ -#define LCD_PWR_SAVING_T1_PERIOD(t1) (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_PSVT1_Msk) | (((t1)-1) << LCD_DCTL_PSVT1_Pos)) - -/** - * @brief Set Power Saving T2 Period - * - * @param[in] t2 The number of t2 to determine T2 period, valid value is between 1 to 16. - * And one unit of t1 period is half of LCD operation clock period. - * - * @return None - * - * @details This macro is used to configure the T2 (On Time) period of power saving. - */ -#define LCD_PWR_SAVING_T2_PERIOD(t2) (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_PSVT2_Msk) | (((t2)-1) << LCD_DCTL_PSVT2_Pos)) - -/** - * @brief Set Charging Timeout Time - * - * @param[in] value The maximum timeout value, valid value is between 1 to 8192. - * And one unit of timeout value is one LCD operation clock period. - * - * @return None - * - * @details This macro is used to set maximum timeout time of charge pump charging timer. - */ -#define LCD_SET_CHARGE_TIMEOUT_TIME(value) (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_CTOTIME_Msk) | (((value)-1) << LCD_DCTL_CTOTIME_Pos)) - -/** - * @brief Select Device Package Type - * - * @param[in] pak Select device package type. - * 0 for 128-pin package, and 1 for 64-pin package. - * - * @return None - * - * @details This macro is used to select device output pins for LCD controller with different package type. - */ -#define LCD_SELECT_PACKAGE_TYPE(pkg) (LCD->PKGSEL = (LCD->PKGSEL & ~LCD_PKGSEL_PKG_Msk) | ((pkg) << LCD_PKGSEL_PKG_Pos)) - -/** - * @brief Enable LCD Frame Counting End Interrupt - * - * @param None - * - * @return None - * - * @details This macro is used to enable frame count end interrupt function. - */ -#define LCD_ENABLE_FRAME_COUNTING_END_INT() (LCD->INTEN |= LCD_INTEN_FCEIEN_Msk) - -/** - * @brief Disable LCD Frame Counting End Interrupt - * - * @param None - * - * @return None - * - * @details This macro is used to disable frame count end interrupt function. - */ -#define LCD_DISABLE_FRAME_COUNTING_END_INT() (LCD->INTEN &= ~LCD_INTEN_FCEIEN_Msk) - -/** - * @brief Enable LCD Frame End Interrupt - * - * @param None - * - * @return None - * - * @details This macro is used to enable frame end interrupt function. - */ -#define LCD_ENABLE_FRAME_END_INT() (LCD->INTEN |= LCD_INTEN_FEIEN_Msk) - -/** - * @brief Disable LCD Frame End Interrupt - * - * @param None - * - * @return None - * - * @details This macro is used to disable frame end interrupt function. - */ -#define LCD_DISABLE_FRAME_END_INT() (LCD->INTEN &= ~LCD_INTEN_FEIEN_Msk) - -/** - * @brief Enable Charging Timeout Interrupt - * - * @param None - * - * @return None - * - * @details This macro is used to enable charge pump charging timeout interrupt function. - */ -#define LCD_ENABLE_CHARGE_TIMEOUT_INT() (LCD->INTEN |= LCD_INTEN_CTOIEN_Msk) - -/** - * @brief Disable Charging Timeout Interrupt - * - * @param None - * - * @return None - * - * @details This macro is used to disable charge pump charging timeout interrupt function. - */ -#define LCD_DISABLE_CHARGE_TIMEOUT_INT() (LCD->INTEN &= ~LCD_INTEN_CTOIEN_Msk) - -/** - * @brief Get LCD Frame Counting End Flag - * - * @param None - * - * @retval 0 Frame count end flag did not occur - * @retval 1 Frame count end flag occurred - * - * @details This macro gets frame count end flag. - */ -#define LCD_GET_FRAME_COUNTING_END_FLAG() ((LCD->STS & LCD_STS_FCEF_Msk)? 1UL : 0UL) - -/** - * @brief Clear LCD Frame Counting End Flag - * - * @param None - * - * @return None - * - * @details This macro clears frame count end flag. - */ -#define LCD_CLEAR_FRAME_COUNTING_END_FLAG() (LCD->STS = LCD_STS_FCEF_Msk) - -/** - * @brief Get LCD Frame End Flag - * - * @param None - * - * @retval 0 Frame end flag did not occur - * @retval 1 Frame end flag occurred - * - * @details This macro gets frame end flag. - */ -#define LCD_GET_FRAME_END_FLAG() ((LCD->STS & LCD_STS_FEF_Msk)? 1UL : 0UL) - -/** - * @brief Clear LCD Frame End Flag - * - * @param None - * - * @return None - * - * @details This macro clears frame end flag. - */ -#define LCD_CLEAR_FRAME_END_FLAG() (LCD->STS = LCD_STS_FEF_Msk) - -/** - * @brief Get Charging Timeout Flag - * - * @param None - * - * @retval 0 Charge pump timer timeout flag did not occur - * @retval 1 Charge pump timer timeout flag occurred - * - * @details This macro gets charge pump charging timeout flag. - */ -#define LCD_GET_CHARGE_TIMEOUT_FLAG() ((LCD->STS & LCD_STS_CTOF_Msk)? 1UL : 0UL) - -/** - * @brief Clear Charging Timeout Flag - * - * @param None - * - * @return None - * - * @details This macro clears charge pump charging timeout flag. - */ -#define LCD_CLEAR_CHARGE_TIMEOUT_FLAG() (LCD->STS = LCD_STS_CTOF_Msk) - -/** - * @brief Get Charging Time - * - * @param None - * - * @return Current 13-bit charging timer value - * - * @details This macro gets charging timer value while stops charge pump charging. - */ -#define LCD_GET_CHARGE_TIME() ((LCD->STS & LCD_STS_CTIME_Msk) >> 16) - - -uint32_t LCD_Open(S_LCD_CFG_T *pLCDCfg); -void LCD_Close(void); -void LCD_SetPixel(uint32_t u32Com, uint32_t u32Seg, uint32_t u32OnFlag); -void LCD_SetAllPixels(uint32_t u32OnOff); -uint32_t LCD_EnableBlink(uint32_t u32ms); -void LCD_DisableBlink(void); -void LCD_EnableInt(uint32_t u32IntSrc); -void LCD_DisableInt(uint32_t u32IntSrc); - -/**@}*/ /* end of group LCD_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group LCD_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_LCD_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_otg.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_otg.h deleted file mode 100644 index 79a9af8b586..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_otg.h +++ /dev/null @@ -1,256 +0,0 @@ -/**************************************************************************//** - * @file nu_otg.h - * @version V3.00 - * @brief M2354 series OTG driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_OTG_H__ -#define __NU_OTG_H__ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Include related headers */ -/*---------------------------------------------------------------------------------------------------------*/ -#include "M2354.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup OTG_Driver OTG Driver - @{ -*/ - - -/** @addtogroup OTG_EXPORTED_CONSTANTS OTG Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* OTG constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define OTG_VBUS_EN_ACTIVE_HIGH (0UL) /*!< USB VBUS power switch enable signal is active high. */ -#define OTG_VBUS_EN_ACTIVE_LOW (1UL) /*!< USB VBUS power switch enable signal is active low. */ -#define OTG_VBUS_ST_VALID_HIGH (0UL) /*!< USB VBUS power switch valid status is high. */ -#define OTG_VBUS_ST_VALID_LOW (1UL) /*!< USB VBUS power switch valid status is low. */ - - -/**@}*/ /* end of group OTG_EXPORTED_CONSTANTS */ - - -/** @addtogroup OTG_EXPORTED_FUNCTIONS OTG Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable OTG function - * @param None - * @return None - * @details This macro will set OTGEN bit of OTG_CTL register to enable OTG function. - */ -#define OTG_ENABLE() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->CTL |= OTG_CTL_OTGEN_Msk):(OTG->CTL |= OTG_CTL_OTGEN_Msk)) - -/** - * @brief This macro is used to disable OTG function - * @param None - * @return None - * @details This macro will clear OTGEN bit of OTG_CTL register to disable OTG function. - */ -#define OTG_DISABLE() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->CTL &= ~OTG_CTL_OTGEN_Msk):(OTG->CTL &= ~OTG_CTL_OTGEN_Msk)) - -/** - * @brief This macro is used to enable USB PHY - * @param None - * @return None - * @details When the USB role is selected as OTG device, use this macro to enable USB PHY. - * This macro will set OTGPHYEN bit of OTG_PHYCTL register to enable USB PHY. - */ -#define OTG_ENABLE_PHY() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->PHYCTL |= OTG_PHYCTL_OTGPHYEN_Msk):(OTG->PHYCTL |= OTG_PHYCTL_OTGPHYEN_Msk)) - -/** - * @brief This macro is used to disable USB PHY - * @param None - * @return None - * @details This macro will clear OTGPHYEN bit of OTG_PHYCTL register to disable USB PHY. - */ -#define OTG_DISABLE_PHY() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->PHYCTL &= ~OTG_PHYCTL_OTGPHYEN_Msk):(OTG->PHYCTL &= ~OTG_PHYCTL_OTGPHYEN_Msk)) - -/** - * @brief This macro is used to enable ID detection function - * @param None - * @return None - * @details This macro will set IDDETEN bit of OTG_PHYCTL register to enable ID detection function. - */ -#define OTG_ENABLE_ID_DETECT() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->PHYCTL |= OTG_PHYCTL_IDDETEN_Msk):(OTG->PHYCTL |= OTG_PHYCTL_IDDETEN_Msk)) - -/** - * @brief This macro is used to disable ID detection function - * @param None - * @return None - * @details This macro will clear IDDETEN bit of OTG_PHYCTL register to disable ID detection function. - */ -#define OTG_DISABLE_ID_DETECT() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->PHYCTL &= ~OTG_PHYCTL_IDDETEN_Msk):(OTG->PHYCTL &= ~OTG_PHYCTL_IDDETEN_Msk)) - -/** - * @brief This macro is used to enable OTG wake-up function - * @param None - * @return None - * @details This macro will set WKEN bit of OTG_CTL register to enable OTG wake-up function. - */ -#define OTG_ENABLE_WAKEUP() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->CTL |= OTG_CTL_WKEN_Msk):(OTG->CTL |= OTG_CTL_WKEN_Msk)) - -/** - * @brief This macro is used to disable OTG wake-up function - * @param None - * @return None - * @details This macro will clear WKEN bit of OTG_CTL register to disable OTG wake-up function. - */ -#define OTG_DISABLE_WAKEUP() (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->CTL &= ~OTG_CTL_WKEN_Msk):(OTG->CTL &= ~OTG_CTL_WKEN_Msk)) - -/** - * @brief This macro is used to set the polarity of USB_VBUS_EN pin - * @param[in] u32Pol The polarity selection. Valid values are listed below. - * - \ref OTG_VBUS_EN_ACTIVE_HIGH - * - \ref OTG_VBUS_EN_ACTIVE_LOW - * @return None - * @details This macro is used to set the polarity of external USB VBUS power switch enable signal. - */ -#define OTG_SET_VBUS_EN_POL(u32Pol) (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->PHYCTL = (OTG_NS->PHYCTL & (~OTG_PHYCTL_VBENPOL_Msk)) | ((u32Pol)<PHYCTL = (OTG->PHYCTL & (~OTG_PHYCTL_VBENPOL_Msk)) | ((u32Pol)<PHYCTL = (OTG_NS->PHYCTL & (~OTG_PHYCTL_VBSTSPOL_Msk)) | ((u32Pol)<PHYCTL = (OTG->PHYCTL & (~OTG_PHYCTL_VBSTSPOL_Msk)) | ((u32Pol)<INTEN |= (u32Mask)):(OTG->INTEN |= (u32Mask))) - -/** - * @brief This macro is used to disable OTG related interrupts - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTEN_ROLECHGIEN_Msk - * - \ref OTG_INTEN_VBEIEN_Msk - * - \ref OTG_INTEN_SRPFIEN_Msk - * - \ref OTG_INTEN_HNPFIEN_Msk - * - \ref OTG_INTEN_GOIDLEIEN_Msk - * - \ref OTG_INTEN_IDCHGIEN_Msk - * - \ref OTG_INTEN_PDEVIEN_Msk - * - \ref OTG_INTEN_HOSTIEN_Msk - * - \ref OTG_INTEN_BVLDCHGIEN_Msk - * - \ref OTG_INTEN_AVLDCHGIEN_Msk - * - \ref OTG_INTEN_VBCHGIEN_Msk - * - \ref OTG_INTEN_SECHGIEN_Msk - * - \ref OTG_INTEN_SRPDETIEN_Msk - * @return None - * @details This macro will disable OTG related interrupts specified by u32Mask parameter. - */ -#define OTG_DISABLE_INT(u32Mask) (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->INTEN &= ~(u32Mask)):(OTG->INTEN &= ~(u32Mask))) - -/** - * @brief This macro is used to get OTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTSTS_ROLECHGIF_Msk - * - \ref OTG_INTSTS_VBEIF_Msk - * - \ref OTG_INTSTS_SRPFIF_Msk - * - \ref OTG_INTSTS_HNPFIF_Msk - * - \ref OTG_INTSTS_GOIDLEIF_Msk - * - \ref OTG_INTSTS_IDCHGIF_Msk - * - \ref OTG_INTSTS_PDEVIF_Msk - * - \ref OTG_INTSTS_HOSTIF_Msk - * - \ref OTG_INTSTS_BVLDCHGIF_Msk - * - \ref OTG_INTSTS_AVLDCHGIF_Msk - * - \ref OTG_INTSTS_VBCHGIF_Msk - * - \ref OTG_INTSTS_SECHGIF_Msk - * - \ref OTG_INTSTS_SRPDETIF_Msk - * @return Interrupt flags of selected sources. - * @details This macro will return OTG related interrupt flags specified by u32Mask parameter. - */ -#define OTG_GET_INT_FLAG(u32Mask) (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->INTSTS & (u32Mask)):(OTG->INTSTS & (u32Mask))) - -/** - * @brief This macro is used to clear OTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTSTS_ROLECHGIF_Msk - * - \ref OTG_INTSTS_VBEIF_Msk - * - \ref OTG_INTSTS_SRPFIF_Msk - * - \ref OTG_INTSTS_HNPFIF_Msk - * - \ref OTG_INTSTS_GOIDLEIF_Msk - * - \ref OTG_INTSTS_IDCHGIF_Msk - * - \ref OTG_INTSTS_PDEVIF_Msk - * - \ref OTG_INTSTS_HOSTIF_Msk - * - \ref OTG_INTSTS_BVLDCHGIF_Msk - * - \ref OTG_INTSTS_AVLDCHGIF_Msk - * - \ref OTG_INTSTS_VBCHGIF_Msk - * - \ref OTG_INTSTS_SECHGIF_Msk - * - \ref OTG_INTSTS_SRPDETIF_Msk - * @return None - * @details This macro will clear OTG related interrupt flags specified by u32Mask parameter. - */ -#define OTG_CLR_INT_FLAG(u32Mask) (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->INTSTS = (u32Mask)):(OTG->INTSTS = (u32Mask))) - -/** - * @brief This macro is used to get OTG related status - * @param[in] u32Mask The combination of user specified source. Valid values are listed below. - * - \ref OTG_STATUS_OVERCUR_Msk - * - \ref OTG_STATUS_IDSTS_Msk - * - \ref OTG_STATUS_SESSEND_Msk - * - \ref OTG_STATUS_BVLD_Msk - * - \ref OTG_STATUS_AVLD_Msk - * - \ref OTG_STATUS_VBUSVLD_Msk - * @return The user specified status. - * @details This macro will return OTG related status specified by u32Mask parameter. - */ -#define OTG_GET_STATUS(u32Mask) (((__PC() & NS_OFFSET) == NS_OFFSET)? (OTG_NS->STATUS & (u32Mask)):(OTG->STATUS & (u32Mask))) - - - -/**@}*/ /* end of group OTG_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group OTG_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - - -#endif /* __NU_OTG_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_partition_M2354.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_partition_M2354.h deleted file mode 100644 index 4de1664620a..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_partition_M2354.h +++ /dev/null @@ -1,697 +0,0 @@ -/**************************************************************************//** - * @file nu_partition_M2354.h - * @version V3.00 - * @brief TrustZone partition file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ - -#ifndef PARTITION_M2354 -#define PARTITION_M2354 - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - -/* - Default M2354 pritition configuration file is for non-TrustZone sample code only. - If user wants to use TrurstZone, they should have their partition_m2354.h. - For TrustZone projects, path of local partition_m2354.h should be in the - front of the include path list to make sure local partition_m2354.h is used. - - It also apply to non-secure project of the TrustZone projects. - -*/ -# error "Link to default nu_partition_M2354.h in secure mode. Please check your include path." - -#endif - -/* -//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- -*/ - - -/* - SRAMNSSET -*/ -/* -// Bit 0..18 -// Secure SRAM Size <0=> 0 KB -// <0x4000=> 16KB -// <0x8000=> 32KB -// <0xc000=> 48KB -// <0x10000=> 64KB -// <0x14000=> 80KB -// <0x18000=> 96KB -// <0x1C000=> 112KB -// <0x20000=> 128KB -// <0x24000=> 144KB -// <0x28000=> 160KB -// <0x2C000=> 176KB -// <0x30000=> 192KB -// <0x34000=> 208KB -// <0x38000=> 224KB -// <0x3C000=> 240KB -// <0x40000=> 256KB -*/ -#define SCU_SECURE_SRAM_SIZE 0x18000 -#define NON_SECURE_SRAM_BASE (0x30000000 + SCU_SECURE_SRAM_SIZE) - - - -/*--------------------------------------------------------------------------------------------------------*/ - -/* - NSBA -*/ -#define FMC_INIT_NSBA 1 -/* -// Secure Flash ROM Size <0x800-0x80000:0x800> -*/ - -#define FMC_SECURE_ROM_SIZE 0x80000 - -#define FMC_NON_SECURE_BASE (0x10000000 + FMC_SECURE_ROM_SIZE) - -/*--------------------------------------------------------------------------------------------------------*/ - - -/* -// Peripheral Secure Attribution Configuration -*/ - -/* - PNSSET0 -*/ -/* -// Module 0..31 -// USBH <0=> Secure <1=> Non-Secure -// SD0 <0=> Secure <1=> Non-Secure -// EBI <0=> Secure <1=> Non-Secure -// PDMA1 <0=> Secure <1=> Non-Secure -*/ -#define SCU_INIT_PNSSET0_VAL 0x0 -/* - PNSSET1 -*/ -/* -// Module 0..31 -// CRC <0=> Secure <1=> Non-Secure -// CRPT <0=> Secure <1=> Non-Secure -*/ -#define SCU_INIT_PNSSET1_VAL 0x00000 -/* - PNSSET2 -*/ -/* -// Module 0..31 -// EWDT <0=> Secure <1=> Non-Secure -// EADC <0=> Secure <1=> Non-Secure -// ACMP01 <0=> Secure <1=> Non-Secure -// -// DAC <0=> Secure <1=> Non-Secure -// I2S0 <0=> Secure <1=> Non-Secure -// OTG <0=> Secure <1=> Non-Secure -// TIMER -// TMR23 <0=> Secure <1=> Non-Secure -// TMR45 <0=> Secure <1=> Non-Secure -// EPWM -// EPWM0 <0=> Secure <1=> Non-Secure -// EPWM1 <0=> Secure <1=> Non-Secure -// -// BPWM -// BPWM0 <0=> Secure <1=> Non-Secure -// BPWM1 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_PNSSET2_VAL 0x0 -/* - PNSSET3 -*/ -/* -// Module 0..31 -// SPI -// QSPI0 <0=> Secure <1=> Non-Secure -// SPI0 <0=> Secure <1=> Non-Secure -// SPI1 <0=> Secure <1=> Non-Secure -// SPI2 <0=> Secure <1=> Non-Secure -// SPI3 <0=> Secure <1=> Non-Secure -// -// UART -// UART0 <0=> Secure <1=> Non-Secure -// UART1 <0=> Secure <1=> Non-Secure -// UART2 <0=> Secure <1=> Non-Secure -// UART3 <0=> Secure <1=> Non-Secure -// UART4 <0=> Secure <1=> Non-Secure -// UART5 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_PNSSET3_VAL 0x00000 -/* - PNSSET4 -*/ -/* -// Module 0..31 -// I2C -// I2C0 <0=> Secure <1=> Non-Secure -// I2C1 <0=> Secure <1=> Non-Secure -// I2C2 <0=> Secure <1=> Non-Secure -// -// Smart Card -// SC0 <0=> Secure <1=> Non-Secure -// SC1 <0=> Secure <1=> Non-Secure -// SC2 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_PNSSET4_VAL 0x0 -/* - PNSSET5 -*/ -/* -// Module 0..31 -// CAN0 <0=> Secure <1=> Non-Secure -// QEI -// QEI0 <0=> Secure <1=> Non-Secure -// QEI1 <0=> Secure <1=> Non-Secure -// -// ECAP -// ECAP0 <0=> Secure <1=> Non-Secure -// ECAP1 <0=> Secure <1=> Non-Secure -// -// TRNG <0=> Secure <1=> Non-Secure -// LCD <0=> Secure <1=> Non-Secure -*/ -#define SCU_INIT_PNSSET5_VAL 0x0 -/* - PNSSET6 -*/ -/* -// Module 0..31 -// USBD <0=> Secure <1=> Non-Secure -// USCI -// USCI0 <0=> Secure <1=> Non-Secure -// USCI1 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_PNSSET6_VAL 0x0 -/* -// -*/ - - -/* -// GPIO Secure Attribution Configuration -*/ - -/* - IONSSET -*/ - -/* -// Bit 0..31 -// PA -// PA0 <0=> Secure <1=> Non-Secure -// PA1 <0=> Secure <1=> Non-Secure -// PA2 <0=> Secure <1=> Non-Secure -// PA3 <0=> Secure <1=> Non-Secure -// PA4 <0=> Secure <1=> Non-Secure -// PA5 <0=> Secure <1=> Non-Secure -// PA6 <0=> Secure <1=> Non-Secure -// PA7 <0=> Secure <1=> Non-Secure -// PA8 <0=> Secure <1=> Non-Secure -// PA9 <0=> Secure <1=> Non-Secure -// PA10 <0=> Secure <1=> Non-Secure -// PA11 <0=> Secure <1=> Non-Secure -// PA12 <0=> Secure <1=> Non-Secure -// PA13 <0=> Secure <1=> Non-Secure -// PA14 <0=> Secure <1=> Non-Secure -// PA15 <0=> Secure <1=> Non-Secure -// - -*/ -#define SCU_INIT_IONSSET0_VAL 0x00000000 - -/* -// Bit 0..31 -// PB -// PB0 <0=> Secure <1=> Non-Secure -// PB1 <0=> Secure <1=> Non-Secure -// PB2 <0=> Secure <1=> Non-Secure -// PB3 <0=> Secure <1=> Non-Secure -// PB4 <0=> Secure <1=> Non-Secure -// PB5 <0=> Secure <1=> Non-Secure -// PB6 <0=> Secure <1=> Non-Secure -// PB7 <0=> Secure <1=> Non-Secure -// PB8 <0=> Secure <1=> Non-Secure -// PB9 <0=> Secure <1=> Non-Secure -// PB10 <0=> Secure <1=> Non-Secure -// PB11 <0=> Secure <1=> Non-Secure -// PB12 <0=> Secure <1=> Non-Secure -// PB13 <0=> Secure <1=> Non-Secure -// PB14 <0=> Secure <1=> Non-Secure -// PB15 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_IONSSET1_VAL 0x00000000 - - -/* -// Bit 0..31 -// PC -// PC0 <0=> Secure <1=> Non-Secure -// PC1 <0=> Secure <1=> Non-Secure -// PC2 <0=> Secure <1=> Non-Secure -// PC3 <0=> Secure <1=> Non-Secure -// PC4 <0=> Secure <1=> Non-Secure -// PC5 <0=> Secure <1=> Non-Secure -// PC6 <0=> Secure <1=> Non-Secure -// PC7 <0=> Secure <1=> Non-Secure -// PC8 <0=> Secure <1=> Non-Secure -// PC9 <0=> Secure <1=> Non-Secure -// PC10 <0=> Secure <1=> Non-Secure -// PC11 <0=> Secure <1=> Non-Secure -// PC12 <0=> Secure <1=> Non-Secure -// PC13 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_IONSSET2_VAL 0x00000000 - -/* -// Bit 0..31 -// PD -// PD0 <0=> Secure <1=> Non-Secure -// PD1 <0=> Secure <1=> Non-Secure -// PD2 <0=> Secure <1=> Non-Secure -// PD3 <0=> Secure <1=> Non-Secure -// PD4 <0=> Secure <1=> Non-Secure -// PD5 <0=> Secure <1=> Non-Secure -// PD6 <0=> Secure <1=> Non-Secure -// PD7 <0=> Secure <1=> Non-Secure -// PD8 <0=> Secure <1=> Non-Secure -// PD9 <0=> Secure <1=> Non-Secure -// PD10 <0=> Secure <1=> Non-Secure -// PD11 <0=> Secure <1=> Non-Secure -// PD12 <0=> Secure <1=> Non-Secure -// PD14 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_IONSSET3_VAL 0x00000000 - - -/* -// Bit 0..31 -// PE -// PE0 <0=> Secure <1=> Non-Secure -// PE1 <0=> Secure <1=> Non-Secure -// PE2 <0=> Secure <1=> Non-Secure -// PE3 <0=> Secure <1=> Non-Secure -// PE4 <0=> Secure <1=> Non-Secure -// PE5 <0=> Secure <1=> Non-Secure -// PE6 <0=> Secure <1=> Non-Secure -// PE7 <0=> Secure <1=> Non-Secure -// PE8 <0=> Secure <1=> Non-Secure -// PE9 <0=> Secure <1=> Non-Secure -// PE10 <0=> Secure <1=> Non-Secure -// PE11 <0=> Secure <1=> Non-Secure -// PE12 <0=> Secure <1=> Non-Secure -// PE13 <0=> Secure <1=> Non-Secure -// PE14 <0=> Secure <1=> Non-Secure -// PE15 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_IONSSET4_VAL 0x00000000 - - -/* -// Bit 0..31 -// PF -// PF0 <0=> Secure <1=> Non-Secure -// PF1 <0=> Secure <1=> Non-Secure -// PF2 <0=> Secure <1=> Non-Secure -// PF3 <0=> Secure <1=> Non-Secure -// PF4 <0=> Secure <1=> Non-Secure -// PF5 <0=> Secure <1=> Non-Secure -// PF6 <0=> Secure <1=> Non-Secure -// PF7 <0=> Secure <1=> Non-Secure -// PF8 <0=> Secure <1=> Non-Secure -// PF9 <0=> Secure <1=> Non-Secure -// PF10 <0=> Secure <1=> Non-Secure -// PF11 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_IONSSET5_VAL 0x00000000 - - -/* -// Bit 0..31 -// PG -// PG2 <0=> Secure <1=> Non-Secure -// PG3 <0=> Secure <1=> Non-Secure -// PG4 <0=> Secure <1=> Non-Secure -// PG9 <0=> Secure <1=> Non-Secure -// PG10 <0=> Secure <1=> Non-Secure -// PG11 <0=> Secure <1=> Non-Secure -// PG12 <0=> Secure <1=> Non-Secure -// PG13 <0=> Secure <1=> Non-Secure -// PG14 <0=> Secure <1=> Non-Secure -// PG15 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_IONSSET6_VAL 0x00000000 - -/* -// Bit 0..31 -// PH -// PH4 <0=> Secure <1=> Non-Secure -// PH5 <0=> Secure <1=> Non-Secure -// PH6 <0=> Secure <1=> Non-Secure -// PH7 <0=> Secure <1=> Non-Secure -// PH8 <0=> Secure <1=> Non-Secure -// PH9 <0=> Secure <1=> Non-Secure -// PH10 <0=> Secure <1=> Non-Secure -// PH11 <0=> Secure <1=> Non-Secure -// -*/ -#define SCU_INIT_IONSSET7_VAL 0x00000000 - -/* -// -*/ - - - -/* -// Assign GPIO Interrupt to Secure or Non-secure Vector -*/ - - -/* - Initialize GPIO ITNS (Interrupts 0..31) -*/ - -/* -// Bit 0..31 -// GPA <0=> Secure <1=> Non-Secure -// GPB <0=> Secure <1=> Non-Secure -// GPC <0=> Secure <1=> Non-Secure -// GPD <0=> Secure <1=> Non-Secure -// GPE <0=> Secure <1=> Non-Secure -// GPF <0=> Secure <1=> Non-Secure -// GPG <0=> Secure <1=> Non-Secure -// GPH <0=> Secure <1=> Non-Secure -// EINT0 <0=> Secure <1=> Non-Secure -// EINT1 <0=> Secure <1=> Non-Secure -// EINT2 <0=> Secure <1=> Non-Secure -// EINT3 <0=> Secure <1=> Non-Secure -// EINT4 <0=> Secure <1=> Non-Secure -// EINT5 <0=> Secure <1=> Non-Secure -// EINT6 <0=> Secure <1=> Non-Secure -// EINT7 <0=> Secure <1=> Non-Secure -*/ -#define SCU_INIT_IONSSET_VAL 0x0000 -/* -// -*/ - - - -/* ---------------------------------------------------------------------------------------------------- */ - -/* -// Secure Attribute Unit (SAU) Control -*/ -#define SAU_INIT_CTRL 0 - -/* -// Enable SAU -// To enable Secure Attribute Unit (SAU). -*/ -#define SAU_INIT_CTRL_ENABLE 1 - -/* -// All Memory Attribute When SAU is disabled -// <0=> All Memory is Secure -// <1=> All Memory is Non-Secure -// To set the ALLNS bit in SAU CTRL. -// When all Memory is Non-Secure (ALLNS is 1), IDAU can override memory map configuration. -*/ -#define SAU_INIT_CTRL_ALLNS 0 - -/* -// -*/ - - -/* -// Enable and Set Secure/Non-Secure region -*/ -#define SAU_REGIONS_MAX 8 /* Max. number of SAU regions */ - -/* -// SAU Region 0 -// Setup SAU Region 0 -*/ -#define SAU_INIT_REGION0 0 -/* -// Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START0 0x0003F000 /* start address of SAU region 0 */ -/* -// End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END0 0x0003FFFF /* end address of SAU region 0 */ -/* -// Region is -// <0=>Non-Secure -// <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC0 1 -/* -// -*/ - -/* -// SAU Region 1 -// Setup SAU Region 1 -*/ -#define SAU_INIT_REGION1 0 -/* -// Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START1 0x10040000 -/* -// End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END1 0x1007FFFF -/* -// Region is -// <0=>Non-Secure -// <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC1 0 -/* -// -*/ - -/* -// SAU Region 2 -// Setup SAU Region 2 -*/ -#define SAU_INIT_REGION2 0 -/* -// Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START2 0x2000F000 -/* -// End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END2 0x2000FFFF -/* -// Region is -// <0=>Non-Secure -// <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC2 1 -/* -// -*/ - -/* -// SAU Region 3 -// Setup SAU Region 3 -*/ -#define SAU_INIT_REGION3 0 -/* -// Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START3 0x3f000 -/* -// End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END3 0x3f7ff -/* -// Region is -// <0=>Non-Secure -// <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC3 1 -/* -// -*/ - -/* - SAU Region 4 - Setup SAU Region 4 -*/ -#define SAU_INIT_REGION4 1 -/* - Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START4 FMC_NON_SECURE_BASE /* start address of SAU region 4 */ - -/* - End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END4 0x1007FFFF /* end address of SAU region 4 */ - -/* - Region is - <0=>Non-Secure - <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC4 0 -/* - -*/ - -/* - SAU Region 5 - Setup SAU Region 5 -*/ -#define SAU_INIT_REGION5 1 - -/* - Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START5 0x00807E00 - -/* - End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END5 0x00807FFF - -/* - Region is - <0=>Non-Secure - <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC5 1 -/* - -*/ - -/* - SAU Region 6 - Setup SAU Region 6 -*/ -#define SAU_INIT_REGION6 1 - -/* - Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START6 NON_SECURE_SRAM_BASE - -/* - End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END6 0x30017FFF - -/* - Region is - <0=>Non-Secure - <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC6 0 -/* - -*/ - -/* - SAU Region 7 - Setup SAU Region 7 -*/ -#define SAU_INIT_REGION7 1 - -/* - Start Address <0-0xFFFFFFE0> -*/ -#define SAU_INIT_START7 0x50000000 - -/* - End Address <0x1F-0xFFFFFFFF> -*/ -#define SAU_INIT_END7 0x5FFFFFFF - -/* - Region is - <0=>Non-Secure - <1=>Secure, Non-Secure Callable -*/ -#define SAU_INIT_NSC7 0 -/* - -*/ - -/* -// -*/ - -/* -// Setup behavior of Sleep and Exception Handling -*/ -#define SCB_CSR_AIRCR_INIT 1 - -/* -// Deep Sleep can be enabled by -// <0=>Secure and Non-Secure state -// <1=>Secure state only -// Value for SCB->CSR register bit DEEPSLEEPS -*/ -#define SCB_CSR_DEEPSLEEPS_VAL 0 - -/* -// System reset request accessible from -// <0=> Secure and Non-Secure state -// <1=> Secure state only -// Value for SCB->AIRCR register bit SYSRESETREQS -*/ -#define SCB_AIRCR_SYSRESETREQS_VAL 0 - -/* -// Priority of Non-Secure exceptions is -// <0=> Not altered -// <1=> Lowered to 0x80-0xFF -// Value for SCB->AIRCR register bit PRIS -*/ -#define SCB_AIRCR_PRIS_VAL 0 - -/* Assign HardFault to be always secure for safe */ -#define SCB_AIRCR_BFHFNMINS_VAL 0 - -/* -// -*/ - -/* - max 128 SAU regions. - SAU regions are defined in partition.h - */ - -#define SAU_INIT_REGION(n) \ - SAU->RNR = (n & SAU_RNR_REGION_Msk); \ - SAU->RBAR = (SAU_INIT_START##n & SAU_RBAR_BADDR_Msk); \ - SAU->RLAR = (SAU_INIT_END##n & SAU_RLAR_LADDR_Msk) | \ - ((SAU_INIT_NSC##n << SAU_RLAR_NSC_Pos) & SAU_RLAR_NSC_Msk) | 1U - - -#endif /* PARTITION_M2354 */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_pdma.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_pdma.h deleted file mode 100644 index 0d4947e783f..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_pdma.h +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************//** - * @file nu_pdma.h - * @version V3.00 - * @brief M2354 series PDMA driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PDMA_H__ -#define __NU_PDMA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - -/** @addtogroup PDMA_EXPORTED_CONSTANTS PDMA Exported Constants - @{ -*/ -#define PDMA_CH_MAX 8UL /*!< Specify Maximum Channels of PDMA \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Operation Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_OP_STOP 0x00000000UL /*!INTSTS)) - -/** - * @brief Get Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the transfer done Interrupt status. - */ -#define PDMA_GET_TD_STS(pdma) ((uint32_t)((pdma)->TDSTS)) - -/** - * @brief Clear Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the transfer done Interrupt status. - */ -#define PDMA_CLR_TD_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->TDSTS = (u32Mask))) - -/** - * @brief Get Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the target abort Interrupt status. - */ -#define PDMA_GET_ABORT_STS(pdma) ((uint32_t)((pdma)->ABTSTS)) - -/** - * @brief Clear Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the target abort Interrupt status. - */ -#define PDMA_CLR_ABORT_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->ABTSTS = (u32Mask))) - -/** - * @brief Get PDMA Transfer Alignment Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the PDMA transfer alignment status. - */ -#define PDMA_GET_ALIGN_STS(pdma) ((uint32_t)((pdma)->ALIGN)) - -/** - * @brief Clear PDMA Transfer Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the PDMA transfer alignment Interrupt status. - */ -#define PDMA_CLR_ALIGN_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->ALIGN = (u32Mask))) - -/** - * @brief Clear Timeout Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details Clear the selected channel timeout interrupt status. - * @note This function is only supported in channel 0 and channel 1. - */ -#define PDMA_CLR_TMOUT_FLAG(pdma, u32Ch) ((uint32_t)((pdma)->INTSTS = (1UL << ((u32Ch) + 8UL)))) - -/** - * @brief Check Channel Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @retval 0 Idle state - * @retval 1 Busy state - * - * @details Check the selected channel is busy or not. - */ -#define PDMA_IS_CH_BUSY(pdma, u32Ch) ((uint32_t)((pdma)->TRGSTS & (1UL << (u32Ch)))? 1 : 0) - -/** - * @brief Set Source Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel source address. - */ -#define PDMA_SET_SRC_ADDR(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].SA = (u32Addr))) - -/** - * @brief Set Destination Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel destination address. - */ -#define PDMA_SET_DST_ADDR(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].DA = (u32Addr))) - -/** - * @brief Set Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32TransCount Transfer Count - * - * @return None - * - * @details This macro set the selected channel transfer count. - */ -#define PDMA_SET_TRANS_CNT(pdma, u32Ch, u32TransCount) ((uint32_t)((pdma)->DSCT[(u32Ch)].CTL=((pdma)->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1UL) << PDMA_DSCT_CTL_TXCNT_Pos))) - -/** - * @brief Set Scatter-gather descriptor Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The descriptor address - * - * @return None - * - * @details This macro set the selected channel scatter-gather descriptor address. - */ -#define PDMA_SET_SCATTER_DESC(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].NEXT = (u32Addr) - ((pdma)->SCATBA))) - -/** - * @brief Stop the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro stop the selected channel. - */ -#define PDMA_STOP(pdma, u32Ch) ((uint32_t)((pdma)->PAUSE = (1UL << (u32Ch)))) - -/** - * @brief Pause the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro pause the selected channel. - */ -#define PDMA_PAUSE(pdma, u32Ch) ((uint32_t)((pdma)->PAUSE = (1UL << (u32Ch)))) - -/** - * @brief Reset the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro reset the selected channel. - */ -#define PDMA_RESET(pdma, u32Ch) ((uint32_t)((pdma)->CHRST = (1UL << (u32Ch)))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define PWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_Close(PDMA_T *pdma); -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount); -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount); -void PDMA_SetRepeat(PDMA_T * pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount); -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl); -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr); -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize); -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt); -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch); -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); - - -/**@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group PDMA_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_PDMA_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_plm.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_plm.h deleted file mode 100644 index e1320d37e4d..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_plm.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************//** - * @file nu_plm.h - * @version V3.00 - * @brief Product life cycle management - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PLM_H__ -#define __NU_PLM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PLM_Driver PLM Driver - @{ -*/ - -/** @addtogroup PLM_EXPORTED_CONSTANTS PLM Exported Constants - @{ -*/ - -typedef enum -{ - PLM_VENDOR = 0, - PLM_OEM = 1, - PLM_DEPLOYED = 3, - PLM_RMA = 7 -} PLM_STAGE_T; - -#define PLM_VCODE (0x475A0000ul) /*!< The key code for PLM_CTL write. */ - -/**@}*/ /* end of group FVC_EXPORTED_CONSTANTS */ - - -/** @addtogroup FVC_EXPORTED_FUNCTIONS FVC Exported Functions - @{ -*/ - - -/** - * @brief Get product life-cycle stage - * @return Current stage of PLM - * @details This function is used to Get PLM stage. - */ -#define PLM_GetStage() (PLM->STS & PLM_STS_STAGE_Msk) - - -/** - * @brief Set product life-cycle stage - * @param[in] stage Product life-cycle stage. It could be: - * \ref PLM_VENDOR - * \ref PLM_OEM - * \ref PLM_DEPLOYED - * \ref PLM_RMA - * @retval 0 Successful - * @retval -1 Failed - * @details This function is used to set PLM stage. It could be only be VENDOR, OEM, DEPLOYED and RMA. - * The setting of PLM cannot be rollback. - */ -__STATIC_INLINE int32_t PLM_SetStage(PLM_STAGE_T stage) -{ - - /* Do nothing when stage is not changed */ - if(PLM_GetStage() == stage) - return 0; - - PLM->CTL = PLM_VCODE | (stage); - - /* The dirty flag should be set when PLM stage set successfully. */ - if(PLM->STS & PLM_STS_DIRTY_Msk) - return -1; - - return 0; -} - -/**@}*/ /* end of group PLM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group PLM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_PLM_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qei.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qei.h deleted file mode 100644 index c8a16d340b7..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qei.h +++ /dev/null @@ -1,388 +0,0 @@ -/**************************************************************************//** - * @file nu_qei.h - * @version V3.00 - * @brief Quadrature Encoder Interface (QEI) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_QEI_H__ -#define __NU_QEI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QEI_Driver QEI Driver - @{ -*/ - -/** @addtogroup QEI_EXPORTED_CONSTANTS QEI Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* QEI counting mode selection constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define QEI_CTL_X4_FREE_COUNTING_MODE (0x0<CTL &= (~QEI_CTL_CMPEN_Msk)) - -/** - * @brief Enable QEI compare function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI counter compare function. - * \hideinitializer - */ -#define QEI_ENABLE_CNT_CMP(qei) ((qei)->CTL |= QEI_CTL_CMPEN_Msk) - -/** - * @brief Disable QEI index latch function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI index trigger counter latch function. - * \hideinitializer - */ -#define QEI_DISABLE_INDEX_LATCH(qei) ((qei)->CTL &= (~QEI_CTL_IDXLATEN_Msk)) - -/** - * @brief Enable QEI index latch function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI index trigger counter latch function. - * \hideinitializer - */ -#define QEI_ENABLE_INDEX_LATCH(qei) ((qei)->CTL |= QEI_CTL_IDXLATEN_Msk) - -/** - * @brief Disable QEI index reload function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI index trigger counter reload function. - * \hideinitializer - */ -#define QEI_DISABLE_INDEX_RELOAD(qei) ((qei)->CTL &= (~QEI_CTL_IDXRLDEN_Msk)) - -/** - * @brief Enable QEI index reload function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI index trigger counter reload function. - * \hideinitializer - */ -#define QEI_ENABLE_INDEX_RELOAD(qei) ((qei)->CTL |= QEI_CTL_IDXRLDEN_Msk) - -/** - * @brief Disable QEI input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type. - * - \ref QEI_CTL_CHAEN_Msk : QEA input - * - \ref QEI_CTL_CHAEN_Msk : QEB input - * - \ref QEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro disable specified QEI signal input. - * \hideinitializer - */ -#define QEI_DISABLE_INPUT(qei, u32InputType) ((qei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable QEI input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type . - * - \ref QEI_CTL_CHAEN_Msk : QEA input - * - \ref QEI_CTL_CHBEN_Msk : QEB input - * - \ref QEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro enable specified QEI signal input. - * \hideinitializer - */ -#define QEI_ENABLE_INPUT(qei, u32InputType) ((qei)->CTL |= (u32InputType)) - -/** - * @brief Disable inverted input polarity - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type . - * - \ref QEI_CTL_CHAINV_Msk : QEA Input - * - \ref QEI_CTL_CHBINV_Msk : QEB Input - * - \ref QEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro disable specified QEI signal inverted input polarity. - * \hideinitializer - */ -#define QEI_DISABLE_INPUT_INV(qei, u32InputType) ((qei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable inverted input polarity - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type. - * - \ref QEI_CTL_CHAINV_Msk : QEA Input - * - \ref QEI_CTL_CHBINV_Msk : QEB Input - * - \ref QEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro inverse specified QEI signal input polarity. - * \hideinitializer - */ -#define QEI_ENABLE_INPUT_INV(qei, u32InputType) ((qei)->CTL |= (u32InputType)) - -/** - * @brief Disable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro disable specified QEI interrupt. - * \hideinitializer - */ -#define QEI_DISABLE_INT(qei, u32IntSel) ((qei)->CTL &= ~(u32IntSel)) - -/** - * @brief Enable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro enable specified QEI interrupt. - * \hideinitializer - */ -#define QEI_ENABLE_INT(qei, u32IntSel) ((qei)->CTL |= (u32IntSel)) - -/** - * @brief Disable QEI noise filter - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI noise filter function. - * \hideinitializer - */ -#define QEI_DISABLE_NOISE_FILTER(qei) ((qei)->CTL |= QEI_CTL_NFDIS_Msk) - -/** - * @brief Enable QEI noise filter - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32ClkSel The sampling frequency of the noise filter clock. - * - \ref QEI_CTL_NFCLKSEL_DIV1 - * - \ref QEI_CTL_NFCLKSEL_DIV2 - * - \ref QEI_CTL_NFCLKSEL_DIV4 - * - \ref QEI_CTL_NFCLKSEL_DIV16 - * - \ref QEI_CTL_NFCLKSEL_DIV32 - * - \ref QEI_CTL_NFCLKSEL_DIV64 - * @return None - * @details This macro enable QEI noise filter function and select noise filter clock. - * \hideinitializer - */ -#define QEI_ENABLE_NOISE_FILTER(qei, u32ClkSel) ((qei)->CTL = ((qei)->CTL & (~(QEI_CTL_NFDIS_Msk|QEI_CTL_NFCLKSEL_Msk))) | (u32ClkSel)) - -/** - * @brief Get QEI counter value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter register value. - * @details This macro get QEI pulse counter value. - * \hideinitializer - */ -#define QEI_GET_CNT_VALUE(qei) ((qei)->CNT) - -/** - * @brief Get QEI counting direction - * @param[in] qei The pointer of the specified QEI module. - * @retval 0 QEI counter is in down-counting. - * @retval 1 QEI counter is in up-counting. - * @details This macro get QEI counting direction. - * \hideinitializer - */ -#define QEI_GET_DIR(qei) (((qei)->STATUS & (QEI_STATUS_DIRF_Msk))?1:0) - -/** - * @brief Get QEI counter hold value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter hold register value. - * @details This macro get QEI pulse counter hold value, which is updated with counter value in hold counter value control. - * \hideinitializer - */ -#define QEI_GET_HOLD_VALUE(qei) ((qei)->CNTHOLD) - -/** - * @brief Get QEI counter index latch value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter index latch value - * @details This macro get QEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define QEI_GET_INDEX_LATCH_VALUE(qei) ((qei)->CNTLATCH) - -/** - * @brief Set QEI counter index latch value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Val The latch value. - * @return QEI pulse counter index latch value - * @details This macro set QEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define QEI_SET_INDEX_LATCH_VALUE(qei,u32Val) ((qei)->CNTLATCH = (u32Val)) - -/** - * @brief Get QEI interrupt flag status - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. -* - \ref QEI_STATUS_DIRF_Msk : Counting direction flag - * - \ref QEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref QEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref QEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref QEI_STATUS_IDXF_Msk : Index detected flag - * @retval 0 QEI specified interrupt flag is not set. - * @retval 1 QEI specified interrupt flag is set. - * @details This macro get QEI specified interrupt flag status. - * \hideinitializer - */ -#define QEI_GET_INT_FLAG(qei, u32IntSel) (((qei)->STATUS & (u32IntSel))?1:0) - - -/** - * @brief Clear QEI interrupt flag - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref QEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref QEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref QEI_STATUS_IDXF_Msk : Index detected flag - * @return None - * @details This macro clear QEI specified interrupt flag. - * \hideinitializer - */ -#define QEI_CLR_INT_FLAG(qei, u32IntSel) ((qei)->STATUS = (u32IntSel)) - -/** - * @brief Set QEI counter compare value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set QEI pulse counter compare value. - * \hideinitializer - */ -#define QEI_SET_CNT_CMP(qei, u32Value) ((qei)->CNTCMP = (u32Value)) - -/** - * @brief Set QEI counter value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set QEI pulse counter value. - * \hideinitializer - */ -#define QEI_SET_CNT_VALUE(qei, u32Value) ((qei)->CNT = (u32Value)) - -/** - * @brief Enable QEI counter hold mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Type The triggered type. - * - \ref QEI_CTL_HOLDCNT_Msk : Hold QEI_CNT control - * - \ref QEI_CTL_HOLDTMR0_Msk : Hold QEI_CNT by Timer0 - * - \ref QEI_CTL_HOLDTMR1_Msk : Hold QEI_CNT by Timer1 - * - \ref QEI_CTL_HOLDTMR2_Msk : Hold QEI_CNT by Timer2 - * - \ref QEI_CTL_HOLDTMR3_Msk : Hold QEI_CNT by Timer3 - * @return None - * @details This macro enable QEI counter hold mode. - * \hideinitializer - */ -#define QEI_ENABLE_HOLD_TRG_SRC(qei, u32Type) ((qei)->CTL |= (u32Type)) - -/** - * @brief Disable QEI counter hold mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Type The triggered type. - * - \ref QEI_CTL_HOLDCNT_Msk : Hold QEI_CNT control - * - \ref QEI_CTL_HOLDTMR0_Msk : Hold QEI_CNT by Timer0 - * - \ref QEI_CTL_HOLDTMR1_Msk : Hold QEI_CNT by Timer1 - * - \ref QEI_CTL_HOLDTMR2_Msk : Hold QEI_CNT by Timer2 - * - \ref QEI_CTL_HOLDTMR3_Msk : Hold QEI_CNT by Timer3 - * @return None - * @details This macro disable QEI counter hold mode. - * \hideinitializer - */ -#define QEI_DISABLE_HOLD_TRG_SRC(qei, u32Type) ((qei)->CTL &= ~(u32Type)) - -/** - * @brief Set QEI maximum count value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter maximum value. - * @return QEI maximum count value - * @details This macro set QEI maximum count value. - * \hideinitializer - */ -#define QEI_SET_CNT_MAX(qei, u32Value) ((qei)->CNTMAX = (u32Value)) - -/** - * @brief Set QEI counting mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Mode QEI counting mode. - * - \ref QEI_CTL_X4_FREE_COUNTING_MODE - * - \ref QEI_CTL_X2_FREE_COUNTING_MODE - * - \ref QEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref QEI_CTL_X2_COMPARE_COUNTING_MODE - * @return None - * @details This macro set QEI counting mode. - * \hideinitializer - */ -#define QEI_SET_CNT_MODE(qei, u32Mode) ((qei)->CTL = ((qei)->CTL & (~QEI_CTL_MODE_Msk)) | (u32Mode)) - - -void QEI_Close(QEI_T* qei); -void QEI_DisableInt(QEI_T* qei, uint32_t u32IntSel); -void QEI_EnableInt(QEI_T* qei, uint32_t u32IntSel); -void QEI_Open(QEI_T* qei, uint32_t u32Mode, uint32_t u32Value); -void QEI_Start(QEI_T* qei); -void QEI_Stop(QEI_T* qei); - - -/**@}*/ /* end of group QEI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group QEI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_QEI_H__*/ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qspi.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qspi.h deleted file mode 100644 index cff6014861e..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_qspi.h +++ /dev/null @@ -1,399 +0,0 @@ -/****************************************************************************** - * @file nu_qspi.h - * @version V3.00 - * @brief M2354 series QSPI driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_QSPI_H__ -#define __NU_QSPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - -/** @addtogroup QSPI_EXPORTED_CONSTANTS QSPI Exported Constants - @{ -*/ - -#define QSPI_MODE_0 (QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 */ -#define QSPI_MODE_1 (QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 */ -#define QSPI_MODE_2 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 */ -#define QSPI_MODE_3 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 */ - -#define QSPI_SLAVE (QSPI_CTL_SLAVE_Msk) /*!< Set as slave */ -#define QSPI_MASTER (0x0UL) /*!< Set as master */ - -#define QSPI_SS (QSPI_SSCTL_SS_Msk) /*!< Set SS */ -#define QSPI_SS_ACTIVE_HIGH (QSPI_SSCTL_SSACTPOL_Msk) /*!< SS active high */ -#define QSPI_SS_ACTIVE_LOW (0x0UL) /*!< SS active low */ - -/* QSPI Interrupt Mask */ -#define QSPI_UNIT_INT_MASK (0x001UL) /*!< Unit transfer interrupt mask */ -#define QSPI_SSACT_INT_MASK (0x002UL) /*!< Slave selection signal active interrupt mask */ -#define QSPI_SSINACT_INT_MASK (0x004UL) /*!< Slave selection signal inactive interrupt mask */ -#define QSPI_SLVUR_INT_MASK (0x008UL) /*!< Slave under run interrupt mask */ -#define QSPI_SLVBE_INT_MASK (0x010UL) /*!< Slave bit count error interrupt mask */ -#define QSPI_SLVTO_INT_MASK (0x020UL) /*!< Slave Mode Time-out interrupt mask */ -#define QSPI_TXUF_INT_MASK (0x040UL) /*!< Slave TX underflow interrupt mask */ -#define QSPI_FIFO_TXTH_INT_MASK (0x080UL) /*!< FIFO TX threshold interrupt mask */ -#define QSPI_FIFO_RXTH_INT_MASK (0x100UL) /*!< FIFO RX threshold interrupt mask */ -#define QSPI_FIFO_RXOV_INT_MASK (0x200UL) /*!< FIFO RX overrun interrupt mask */ -#define QSPI_FIFO_RXTO_INT_MASK (0x400UL) /*!< FIFO RX time-out interrupt mask */ - -/* QSPI Status Mask */ -#define QSPI_BUSY_MASK (0x01UL) /*!< Busy status mask */ -#define QSPI_RX_EMPTY_MASK (0x02UL) /*!< RX empty status mask */ -#define QSPI_RX_FULL_MASK (0x04UL) /*!< RX full status mask */ -#define QSPI_TX_EMPTY_MASK (0x08UL) /*!< TX empty status mask */ -#define QSPI_TX_FULL_MASK (0x10UL) /*!< TX full status mask */ -#define QSPI_TXRX_RESET_MASK (0x20UL) /*!< TX or RX reset status mask */ -#define QSPI_SPIEN_STS_MASK (0x40UL) /*!< SPIEN status mask */ -#define QSPI_SSLINE_STS_MASK (0x80UL) /*!< QSPIx_SS line status mask */ - -/* QSPI Status2 Mask */ -#define QSPI_SLVBENUM_MASK (0x01UL) /*!< Effective bit number of uncompleted RX data status mask */ - -/**@}*/ /* end of group QSPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Write 1 to UNITIF bit of QSPI_STATUS register to clear the unit transfer interrupt flag. - */ -#define QSPI_CLR_UNIT_TRANS_INT_FLAG(qspi) ( (qspi)->STATUS = QSPI_STATUS_UNITIF_Msk ) - -/** - * @brief Disable 2-bit Transfer mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TWOBIT bit of QSPI_CTL register to disable 2-bit Transfer mode. - */ -#define QSPI_DISABLE_2BIT_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_TWOBIT_Msk ) - -/** - * @brief Disable Slave 3-wire mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear SLV3WIRE bit of QSPI_SSCTL register to disable Slave 3-wire mode. - */ -#define QSPI_DISABLE_3WIRE_MODE(qspi) ( (qspi)->SSCTL &= ~QSPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Disable Dual I/O mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear DUALIOEN bit of QSPI_CTL register to disable Dual I/O mode. - */ -#define QSPI_DISABLE_DUAL_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Disable Quad I/O mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear QUADIOEN bit of QSPI_CTL register to disable Quad I/O mode. - */ -#define QSPI_DISABLE_QUAD_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Disable TX DTR mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXDTREN bit of QSPI_CTL register to disable TX DTR mode. - */ -#define QSPI_DISABLE_TXDTR_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_TXDTREN_Msk ) - -/** - * @brief Enable 2-bit Transfer mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TWOBIT bit of QSPI_CTL register to enable 2-bit Transfer mode. - */ -#define QSPI_ENABLE_2BIT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_TWOBIT_Msk ) - -/** - * @brief Enable Slave 3-wire mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set SLV3WIRE bit of QSPI_SSCTL register to enable Slave 3-wire mode. - */ -#define QSPI_ENABLE_3WIRE_MODE(qspi) ( (qspi)->SSCTL |= QSPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable Dual input mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear DATDIR bit and set DUALIOEN bit of QSPI_CTL register to enable Dual input mode. - */ -#define QSPI_ENABLE_DUAL_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & (~QSPI_CTL_DATDIR_Msk)) | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual output mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set DATDIR bit and DUALIOEN bit of QSPI_CTL register to enable Dual output mode. - */ -#define QSPI_ENABLE_DUAL_OUTPUT_MODE(qspi) ( (qspi)->CTL |= (QSPI_CTL_DATDIR_Msk | QSPI_CTL_DUALIOEN_Msk) ) - -/** - * @brief Enable Quad input mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear DATDIR bit and set QUADIOEN bit of QSPI_CTL register to enable Quad input mode. - */ -#define QSPI_ENABLE_QUAD_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & (~QSPI_CTL_DATDIR_Msk)) | QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Enable Quad output mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set DATDIR bit and QUADIOEN bit of QSPI_CTL register to enable Quad output mode. - */ -#define QSPI_ENABLE_QUAD_OUTPUT_MODE(qspi) ( (qspi)->CTL |= (QSPI_CTL_DATDIR_Msk | QSPI_CTL_QUADIOEN_Msk) ) - -/** - * @brief Enable TX DTR mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXDTREN bit of QSPI_CTL register to enable TX DTR mode. - */ -#define QSPI_ENABLE_TXDTR_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_TXDTREN_Msk ) - -/** - * @brief Trigger RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set RXPDMAEN bit of QSPI_PDMACTL register to enable RX PDMA transfer function. - */ -#define QSPI_TRIGGER_RX_PDMA(qspi) ( (qspi)->PDMACTL |= QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Trigger TX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit of QSPI_PDMACTL register to enable TX PDMA transfer function. - */ -#define QSPI_TRIGGER_TX_PDMA(qspi) ( (qspi)->PDMACTL |= QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to enable TX and RX PDMA transfer function. - */ -#define QSPI_TRIGGER_TX_RX_PDMA(qspi) ( (qspi)->PDMACTL |= (QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear RXPDMAEN bit of QSPI_PDMACTL register to disable RX PDMA transfer function. - */ -#define QSPI_DISABLE_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit of QSPI_PDMACTL register to disable TX PDMA transfer function. - */ -#define QSPI_DISABLE_TX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to disable TX and RX PDMA transfer function. - */ -#define QSPI_DISABLE_TX_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~(QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] qspi The pointer of the specified QSPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (QSPI_STATUS[27:24]) to get the count of available data in RX FIFO. - */ -#define QSPI_GET_RX_FIFO_COUNT(qspi) ( ((qspi)->STATUS & QSPI_STATUS_RXCNT_Msk) >> QSPI_STATUS_RXCNT_Pos ) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of QSPI_STATUS register to get the RX FIFO empty flag. - */ -#define QSPI_GET_RX_FIFO_EMPTY_FLAG(qspi) ( ((qspi)->STATUS & QSPI_STATUS_RXEMPTY_Msk) >> QSPI_STATUS_RXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of QSPI_STATUS register to get the TX FIFO empty flag. - */ -#define QSPI_GET_TX_FIFO_EMPTY_FLAG(qspi) ( ((qspi)->STATUS & QSPI_STATUS_TXEMPTY_Msk) >> QSPI_STATUS_TXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of QSPI_STATUS register to get the TX FIFO full flag. - */ -#define QSPI_GET_TX_FIFO_FULL_FLAG(qspi) ( ((qspi)->STATUS & QSPI_STATUS_TXFULL_Msk) >> QSPI_STATUS_TXFULL_Pos ) - -/** - * @brief Get the datum read from RX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Data in RX register. - * @details Read QSPI_RX register to get the received datum. - */ -#define QSPI_READ_RX(qspi) ( (qspi)->RX ) - -/** - * @brief Write datum to TX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxData The datum which user attempt to transfer through QSPI bus. - * @return None. - * @details Write u32TxData to QSPI_TX register. - */ -#define QSPI_WRITE_TX(qspi, u32TxData) ( (qspi)->TX = (u32TxData) ) - -/** - * @brief Set QSPIx_SS pin to high state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to high state. - */ -#define QSPI_SET_SS_HIGH(qspi) ( (qspi)->SSCTL = ((qspi)->SSCTL & (~QSPI_SSCTL_AUTOSS_Msk)) | (QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk) ) - -/** - * @brief Set QSPIx_SS pin to low state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to low state. - */ -#define QSPI_SET_SS_LOW(qspi) ( (qspi)->SSCTL = ((qspi)->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk))) | QSPI_SSCTL_SS_Msk ) - -/** - * @brief Enable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (QSPI_CTL[7:4]). - */ -#define QSPI_ENABLE_BYTE_REORDER(qspi) ( (qspi)->CTL |= QSPI_CTL_REORDER_Msk ) - -/** - * @brief Disable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear REORDER bit field of QSPI_CTL register to disable Byte Reorder function. - */ -#define QSPI_DISABLE_BYTE_REORDER(qspi) ( (qspi)->CTL &= ~QSPI_CTL_REORDER_Msk ) - -/** - * @brief Set the length of suspend interval. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one QSPI bus clock cycle). - */ -#define QSPI_SET_SUSPEND_CYCLE(qspi, u32SuspCycle) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << QSPI_CTL_SUSPITV_Pos) ) - -/** - * @brief Set the QSPI transfer sequence with LSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set LSB bit of QSPI_CTL register to set the QSPI transfer sequence with LSB first. - */ -#define QSPI_SET_LSB_FIRST(qspi) ( (qspi)->CTL |= QSPI_CTL_LSB_Msk ) - -/** - * @brief Set the QSPI transfer sequence with MSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear LSB bit of QSPI_CTL register to set the QSPI transfer sequence with MSB first. - */ -#define QSPI_SET_MSB_FIRST(qspi) ( (qspi)->CTL &= ~QSPI_CTL_LSB_Msk ) - -/** - * @brief Set the data width of a QSPI transaction. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - */ -#define QSPI_SET_DATA_WIDTH(qspi, u32Width) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DWIDTH_Msk) | (((u32Width) & 0x1F) << QSPI_CTL_DWIDTH_Pos) ) - -/** - * @brief Get the QSPI busy state. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 QSPI controller is not busy. - * @retval 1 QSPI controller is busy. - * @details This macro will return the busy state of QSPI controller. - */ -#define QSPI_IS_BUSY(qspi) ( ((qspi)->STATUS & QSPI_STATUS_BUSY_Msk) >> QSPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set SPIEN (QSPI_CTL[0]) to enable QSPI controller. - */ -#define QSPI_ENABLE(qspi) ( (qspi)->CTL |= QSPI_CTL_SPIEN_Msk ) - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear SPIEN (QSPI_CTL[0]) to disable QSPI controller. - */ -#define QSPI_DISABLE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_SPIEN_Msk ) - -/* Function prototype declaration */ -uint32_t QSPI_Open(QSPI_T *qspi, uint32_t u32MasterSlave, uint32_t u32QSPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void QSPI_Close(QSPI_T *qspi); -void QSPI_ClearRxFIFO(QSPI_T *qspi); -void QSPI_ClearTxFIFO(QSPI_T *qspi); -void QSPI_DisableAutoSS(QSPI_T *qspi); -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock); -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t QSPI_GetBusClock(QSPI_T *qspi); -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetStatus2(QSPI_T *qspi, uint32_t u32Mask); - - -/**@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group QSPI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_QSPI_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rng.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rng.h deleted file mode 100644 index a30251ed48c..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rng.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************//** - * @file nu_rng.h - * @version V3.00 - * @brief Random Number Generator Interface Controller (rng) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_RNG_H__ -#define __NU_RNG_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RNG_Driver RNG Driver - @{ -*/ - -/** @addtogroup RNG_EXPORTED_CONSTANTS RNG Exported Constants - @{ -*/ - -/**@}*/ /* end of group RNG_EXPORTED_CONSTANTS */ - - -/** @addtogroup RNG_EXPORTED_FUNCTIONS RNG Exported Functions - @{ -*/ - -int32_t RNG_Open(void); -int32_t RNG_Random(uint32_t *pu32Buf, int32_t nWords); - -int32_t RNG_ECDSA_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]); -int32_t RNG_ECDSA(uint32_t u32KeySize); -int32_t RNG_ECDH_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]); -int32_t RNG_ECDH(uint32_t u32KeySize); - -/**@}*/ /* end of group RNG_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RNG_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RNG_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rtc.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rtc.h deleted file mode 100644 index 6854643e7f9..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_rtc.h +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************//** - * @file nu_rtc.h - * @version V3.00 - * @brief Real Time Clock(RTC) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_RTC_H__ -#define __NU_RTC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_CONSTANTS RTC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Initial Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_INIT_KEY 0xA5EB1357UL /*!< RTC Initiation Key to make RTC leaving reset state \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Time Attribute Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_12 0UL /*!< RTC as 12-hour time scale with AM and PM indication \hideinitializer */ -#define RTC_CLOCK_24 1UL /*!< RTC as 24-hour time scale \hideinitializer */ -#define RTC_AM 1UL /*!< RTC as AM indication \hideinitializer */ -#define RTC_PM 2UL /*!< RTC as PM indication \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tick Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TICK_1_SEC 0x0UL /*!< RTC time tick period is 1 second \hideinitializer */ -#define RTC_TICK_1_2_SEC 0x1UL /*!< RTC time tick period is 1/2 second \hideinitializer */ -#define RTC_TICK_1_4_SEC 0x2UL /*!< RTC time tick period is 1/4 second \hideinitializer */ -#define RTC_TICK_1_8_SEC 0x3UL /*!< RTC time tick period is 1/8 second \hideinitializer */ -#define RTC_TICK_1_16_SEC 0x4UL /*!< RTC time tick period is 1/16 second \hideinitializer */ -#define RTC_TICK_1_32_SEC 0x5UL /*!< RTC time tick period is 1/32 second \hideinitializer */ -#define RTC_TICK_1_64_SEC 0x6UL /*!< RTC time tick period is 1/64 second \hideinitializer */ -#define RTC_TICK_1_128_SEC 0x7UL /*!< RTC time tick period is 1/128 second \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Day of Week Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_SUNDAY 0x0UL /*!< Day of the Week is Sunday \hideinitializer */ -#define RTC_MONDAY 0x1UL /*!< Day of the Week is Monday \hideinitializer */ -#define RTC_TUESDAY 0x2UL /*!< Day of the Week is Tuesday \hideinitializer */ -#define RTC_WEDNESDAY 0x3UL /*!< Day of the Week is Wednesday \hideinitializer */ -#define RTC_THURSDAY 0x4UL /*!< Day of the Week is Thursday \hideinitializer */ -#define RTC_FRIDAY 0x5UL /*!< Day of the Week is Friday \hideinitializer */ -#define RTC_SATURDAY 0x6UL /*!< Day of the Week is Saturday \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_YEAR2000 2000UL /*!< RTC Reference for compute year data \hideinitializer */ -#define RTC_FCR_REFERENCE 32752 /*!< RTC Reference for frequency compensation */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tamper Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TAMPER0_SELECT (0x1UL << 0) /*!< Select Tamper 0 \hideinitializer */ -#define RTC_TAMPER1_SELECT (0x1UL << 1) /*!< Select Tamper 1 \hideinitializer */ -#define RTC_TAMPER2_SELECT (0x1UL << 2) /*!< Select Tamper 2 \hideinitializer */ -#define RTC_TAMPER3_SELECT (0x1UL << 3) /*!< Select Tamper 3 \hideinitializer */ -#define RTC_TAMPER4_SELECT (0x1UL << 4) /*!< Select Tamper 4 \hideinitializer */ -#define RTC_TAMPER5_SELECT (0x1UL << 5) /*!< Select Tamper 5 \hideinitializer */ -#define RTC_MAX_TAMPER_PIN_NUM 6UL /*!< Tamper Pin number \hideinitializer */ - -#define RTC_TAMPER_LOW_LEVEL_DETECT 0UL /*!< Tamper pin detect voltage level is low \hideinitializer */ -#define RTC_TAMPER_HIGH_LEVEL_DETECT 1UL /*!< Tamper pin detect voltage level is high \hideinitializer */ - -#define RTC_TAMPER_DEBOUNCE_DISABLE 0UL /*!< Disable RTC tamper pin de-bounce function \hideinitializer */ -#define RTC_TAMPER_DEBOUNCE_ENABLE 1UL /*!< Enable RTC tamper pin de-bounce function \hideinitializer */ - -#define RTC_PAIR0_SELECT (0x1UL << 0) /*!< Select Pair 0 \hideinitializer */ -#define RTC_PAIR1_SELECT (0x1UL << 1) /*!< Select Pair 1 \hideinitializer */ -#define RTC_PAIR2_SELECT (0x1UL << 2) /*!< Select Pair 2 \hideinitializer */ -#define RTC_MAX_PAIR_NUM 3UL /*!< Pair number \hideinitializer */ - -#define RTC_2POW10_CLK (0x0UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 RTC clock cycles \hideinitializer */ -#define RTC_2POW11_CLK (0x1UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 2 RTC clock cycles \hideinitializer */ -#define RTC_2POW12_CLK (0x2UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 4 RTC clock cycles \hideinitializer */ -#define RTC_2POW13_CLK (0x3UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 6 RTC clock cycles \hideinitializer */ -#define RTC_2POW14_CLK (0x4UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 8 RTC clock cycles \hideinitializer */ -#define RTC_2POW15_CLK (0x5UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 16 RTC clock cycles \hideinitializer */ -#define RTC_2POW16_CLK (0x6UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 32 RTC clock cycles \hideinitializer */ -#define RTC_2POW17_CLK (0x7UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 64 RTC clock cycles \hideinitializer */ - -#define RTC_REF_RANDOM_PATTERN 0x0UL /*!< The new reference pattern is generated by random number generator when the reference pattern run out \hideinitializer */ -#define RTC_REF_SEED_VALUE 0x1UL /*!< The new reference pattern is repeated from SEED (RTC_TAMPSEED[31:0]) when the reference pattern run out \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Clock Source Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_SOURCE_LXT 0UL /*!< Set RTC clock source as external LXT \hideinitializer */ -#define RTC_CLOCK_SOURCE_LIRC 1UL /*!< Set RTC clock source as LIRC \hideinitializer */ -#define RTC_CLOCK_SOURCE_LIRC32K 2UL /*!< Set RTC clock source as LIRC32K \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_IO_MODE_INPUT 0x0UL /*!< Input Mode */ -#define RTC_IO_MODE_OUTPUT 0x1UL /*!< Output Mode */ -#define RTC_IO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode */ -#define RTC_IO_MODE_QUASI 0x3UL /*!< Quasi-bidirectional Mode */ - -#define RTC_IO_DIGITAL_ENABLE 0UL /*!< I/O digital path is enabled */ -#define RTC_IO_DIGITAL_DISABLE 1UL /*!< I/O digital path is disabled */ - -#define RTC_IO_PULL_UP_DOWN_DISABLE 0x0UL /*!< I/O pull-up and pull-down is disabled */ -#define RTC_IO_PULL_UP_ENABLE 0x1UL /*!< I/O pull-up is enabled */ -#define RTC_IO_PULL_DOWN_ENABLE 0x2UL /*!< I/O pull-down is enabled */ - - -/**@}*/ /* end of group RTC_EXPORTED_CONSTANTS */ - - -/** @addtogroup RTC_EXPORTED_STRUCTS RTC Exported Structs - @{ -*/ -/** - * @details RTC define Time Data Struct - */ -typedef struct -{ - uint32_t u32Year; /*!< Year value */ - uint32_t u32Month; /*!< Month value */ - uint32_t u32Day; /*!< Day value */ - uint32_t u32DayOfWeek; /*!< Day of week value */ - uint32_t u32Hour; /*!< Hour value */ - uint32_t u32Minute; /*!< Minute value */ - uint32_t u32Second; /*!< Second value */ - uint32_t u32TimeScale; /*!< 12-Hour, 24-Hour */ - uint32_t u32AmPm; /*!< Only Time Scale select 12-hr used */ -} S_RTC_TIME_DATA_T; - -/**@}*/ /* end of group RTC_EXPORTED_STRUCTS */ - - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Indicate is Leap Year or not - * - * @param[in] rtc The pointer of RTC module. - * - * @retval 0 This year is not a leap year - * @retval 1 This year is a leap year - * - * @details According to current date, return this year is leap year or not. - * \hideinitializer - */ -#define RTC_IS_LEAP_YEAR(rtc) (((rtc)->LEAPYEAR & RTC_LEAPYEAR_LEAPYEAR_Msk)? 1:0) - -/** - * @brief Clear RTC Alarm Interrupt Flag - * - * @param[in] rtc The pointer of RTC module. - * - * @return None - * - * @details This macro is used to clear RTC alarm interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_ALARM_INT_FLAG(rtc) ((rtc)->INTSTS = RTC_INTSTS_ALMIF_Msk) - -/** - * @brief Clear RTC Tick Interrupt Flag - * - * @param[in] rtc The pointer of RTC module. - * - * @return None - * - * @details This macro is used to clear RTC tick interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TICK_INT_FLAG(rtc) ((rtc)->INTSTS = RTC_INTSTS_TICKIF_Msk) - -/** - * @brief Clear RTC Tamper Interrupt Flag - * - * @param[in] rtc The pointer of RTC module. - * @param[in] u32TamperFlag Tamper interrupt flag. It consists of: \n - * - \ref RTC_INTSTS_TAMP0IF_Msk \n - * - \ref RTC_INTSTS_TAMP1IF_Msk \n - * - \ref RTC_INTSTS_TAMP2IF_Msk \n - * - \ref RTC_INTSTS_TAMP3IF_Msk \n - * - \ref RTC_INTSTS_TAMP4IF_Msk \n - * - \ref RTC_INTSTS_TAMP5IF_Msk - * - * @return None - * - * @details This macro is used to clear RTC tamper pin interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TAMPER_INT_FLAG(rtc, u32TamperFlag) ((rtc)->INTSTS = (u32TamperFlag)) - -/** - * @brief Get RTC Alarm Interrupt Flag - * - * @param[in] rtc The pointer of RTC module. - * - * @retval 0 RTC alarm interrupt did not occur - * @retval 1 RTC alarm interrupt occurred - * - * @details This macro indicates RTC alarm interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_ALARM_INT_FLAG(rtc) (((rtc)->INTSTS & RTC_INTSTS_ALMIF_Msk)? 1:0) - -/** - * @brief Get RTC Time Tick Interrupt Flag - * - * @param[in] rtc The pointer of RTC module. - * - * @retval 0 RTC time tick interrupt did not occur - * @retval 1 RTC time tick interrupt occurred - * - * @details This macro indicates RTC time tick interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TICK_INT_FLAG(rtc) (((rtc)->INTSTS & RTC_INTSTS_TICKIF_Msk)? 1:0) - -/** - * @brief Set I/O Control By GPIO - * - * @param[in] rtc The pointer of RTC module. - * - * @return None - * - * @details This macro sets the PF.4~11 pin I/O is controlled by GPIO module. - * \hideinitializer - */ -#define RTC_SET_IOCTL_BY_GPIO(rtc) ((rtc)->LXTCTL &= ~RTC_LXTCTL_IOCTLSEL_Msk) - -/** - * @brief Set I/O Control By RTC - * - * @param[in] rtc The pointer of RTC module. - * - * @return None - * - * @details This macro sets the PF.4~11 pin I/O is controlled by RTC module. - * \hideinitializer - */ -#define RTC_SET_IOCTL_BY_RTC(rtc) ((rtc)->LXTCTL |= RTC_LXTCTL_IOCTLSEL_Msk) - -/** - * @brief Get I/O Control Property - * - * @param[in] rtc The pointer of RTC module. - * - * @retval 0 PF.4~11 pin I/O is controlled by GPIO module - * @retval 1 PF.4~11 pin I/O is controlled by RTC module - * - * @details This macro indicates the PF.4~11 pin I/O control property. - * \hideinitializer - */ -#define RTC_GET_IOCTL_PROPERTY(rtc) (((rtc)->LXTCTL & RTC_LXTCTL_IOCTLSEL_Msk)? 1:0) - -/** - * @brief Get RTC Tamper Interrupt Flag - * - * @param[in] rtc The pointer of RTC module. - * - * @retval 0 RTC tamper event interrupt did not occur - * @retval 1 RTC tamper event interrupt occurred - * - * @details This macro indicates RTC tamper event occurred or not. - * \hideinitializer - */ -#define RTC_GET_TAMPER_INT_FLAG(rtc) (((rtc)->INTSTS & (0x3F00))? 1:0) - -/** - * @brief Get RTC Tamper Interrupt Status - * - * @param[in] rtc The pointer of RTC module. - * - * @retval RTC_INTSTS_TAMP0IF_Msk Tamper 0 interrupt flag is generated - * @retval RTC_INTSTS_TAMP1IF_Msk Tamper 1 interrupt flag is generated - * @retval RTC_INTSTS_TAMP2IF_Msk Tamper 2 interrupt flag is generated - * @retval RTC_INTSTS_TAMP3IF_Msk Tamper 3 interrupt flag is generated - * @retval RTC_INTSTS_TAMP4IF_Msk Tamper 4 interrupt flag is generated - * @retval RTC_INTSTS_TAMP5IF_Msk Tamper 5 interrupt flag is generated - * - * @details This macro indicates RTC tamper interrupt status. - * \hideinitializer - */ -#define RTC_GET_TAMPER_INT_STATUS(rtc) (((rtc)->INTSTS & (0x3F00))) - -/** - * @brief Enable RTC Tick Wake-up Function - * - * @param[in] rtc The pointer of RTC module. - * - * @return None - * - * @details This macro is used to enable RTC tick interrupt wake-up function. - * \hideinitializer - */ -#define RTC_ENABLE_TICK_WAKEUP(rtc) ((rtc)->INTEN |= RTC_INTEN_TICKIEN_Msk); - -/** - * @brief Disable RTC Tick Wake-up Function - * - * @param[in] rtc The pointer of RTC module. - * - * @return None - * - * @details This macro is used to disable RTC tick interrupt wake-up function. - * \hideinitializer - */ -#define RTC_DISABLE_TICK_WAKEUP(rtc) ((rtc)->INTEN &= ~RTC_INTEN_TICKIEN_Msk); - -/** - * @brief Read Spare Register - * - * @param[in] rtc The pointer of RTC module. - * @param[in] u32RegNum The spare register number, 0~19. - * - * @return Spare register content - * - * @details Read the specify spare register content. - * \hideinitializer - */ -#define RTC_READ_SPARE_REGISTER(rtc, u32RegNum) ((rtc)->SPR[(u32RegNum)]) - -/** - * @brief Write Spare Register - * - * @param[in] rtc The pointer of RTC module. - * @param[in] u32RegNum The spare register number, 0~19. - * @param[in] u32RegValue The spare register value. - * - * @return None - * - * @details Write specify data to spare register. - * \hideinitializer - */ -#define RTC_WRITE_SPARE_REGISTER(rtc, u32RegNum, u32RegValue) ((rtc)->SPR[(u32RegNum)] = (u32RegValue)) - - -void RTC_Open(S_RTC_TIME_DATA_T *sPt); -void RTC_Close(void); -void RTC_32KCalibration(int32_t i32FrequencyX10000); -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek); -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day); -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk); -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk); -uint32_t RTC_GetDayOfWeek(void); -void RTC_SetTickPeriod(uint32_t u32TickSelection); -void RTC_EnableInt(uint32_t u32IntFlagMask); -void RTC_DisableInt(uint32_t u32IntFlagMask); -void RTC_EnableSpareAccess(void); -void RTC_DisableSpareRegister(void); -void RTC_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn); -void RTC_StaticTamperDisable(uint32_t u32TamperSelect); -void RTC_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source); -void RTC_DynamicTamperDisable(uint32_t u32PairSel); -void RTC_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed); -uint32_t RTC_SetClockSource(uint32_t u32ClkSrc); -void RTC_SetGPIOMode(uint32_t u32PFPin, uint32_t u32Mode, uint32_t u32DigitalCtl, uint32_t u32PullCtl, uint32_t u32OutputLevel); -void RTC_SetGPIOLevel(uint32_t u32PFPin, uint32_t u32OutputLevel); - -/**@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RTC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RTC_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sc.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sc.h deleted file mode 100644 index 5a853e74cae..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sc.h +++ /dev/null @@ -1,305 +0,0 @@ -/**************************************************************************//** - * @file nu_sc.h - * @version V3.00 - * @brief Smartcard(SC) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SC_H__ -#define __NU_SC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_CONSTANTS SC Exported Constants - @{ -*/ -#define SC_INTERFACE_NUM (3UL) /*!< Smartcard interface numbers \hideinitializer */ -#define SC_PIN_STATE_HIGH (1UL) /*!< Smartcard pin status high \hideinitializer */ -#define SC_PIN_STATE_LOW (0UL) /*!< Smartcard pin status low \hideinitializer */ -#define SC_PIN_STATE_IGNORE (0xFFFFFFFFUL) /*!< Ignore pin status \hideinitializer */ -#define SC_CLK_ON (1UL) /*!< Smartcard clock on \hideinitializer */ -#define SC_CLK_OFF (0UL) /*!< Smartcard clock off \hideinitializer */ - -#define SC_TMR_MODE_0 (0UL << SC_TMRCTL0_OPMODE_Pos) /*!INTEN |= (u32Mask)) - -/** - * @brief This macro disable smartcard interrupt - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Interrupt mask to be disabled. A combination of - * - \ref SC_INTEN_ACERRIEN_Msk - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_INITIEN_Msk - * - \ref SC_INTEN_CDIEN_Msk - * - \ref SC_INTEN_BGTIEN_Msk - * - \ref SC_INTEN_TMR2IEN_Msk - * - \ref SC_INTEN_TMR1IEN_Msk - * - \ref SC_INTEN_TMR0IEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * - * @return None - * - * @details The macro is used to disable Auto-convention error interrupt, Receiver buffer time-out interrupt, Initial end interrupt, - * Card detect interrupt, Block guard time interrupt, Timer2 interrupt, Timer1 interrupt, Timer0 interrupt, - * Transfer error interrupt, Transmit buffer empty interrupt or Receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SC_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief This macro set VCC pin state of smartcard interface - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32State Pin state of VCC pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW. - * - * @return None - * - * @details User can set PWREN (SC_PINCTL[0]) and PWRINV (SC_PINCTL[11]) to decide SC_PWR pin is in high or low level. - * \hideinitializer - */ -#define SC_SET_VCC_PIN(sc, u32State) \ - do {\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_PWREN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_PWREN_Msk;\ - }while(0) - - -/** - * @brief This macro turns CLK output on or off - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32OnOff Clock on or off for selected smartcard module, valid values are \ref SC_CLK_ON and \ref SC_CLK_OFF. - * - * @return None - * - * @details User can set CLKKEEP (SC_PINCTL[6]) to decide SC_CLK pin always keeps free running or not. - * \hideinitializer - */ -#define SC_SET_CLK_PIN(sc, u32OnOff)\ - do {\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk);\ - if(u32OnOff)\ - (sc)->PINCTL |= SC_PINCTL_CLKKEEP_Msk;\ - else\ - (sc)->PINCTL &= ~(SC_PINCTL_CLKKEEP_Msk);\ - }while(0) - -/** - * @brief This macro set I/O pin state of smartcard interface - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32State Pin state of I/O pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW. - * - * @return None - * - * @details User can set SCDATA (SC_PINCTL[9]) to decide SC_DATA pin to high or low. - * \hideinitializer - */ -#define SC_SET_IO_PIN(sc, u32State)\ - do {\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_SCDATA_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_SCDATA_Msk;\ - }while(0) - -/** - * @brief This macro set RST pin state of smartcard interface - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32State Pin state of RST pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW. - * - * @return None - * - * @details User can set SCRST (SC_PINCTL[1]) to decide SC_RST pin to high or low. - * \hideinitializer - */ -#define SC_SET_RST_PIN(sc, u32State)\ - do {\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_RSTEN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_RSTEN_Msk;\ - }while(0) - -/** - * @brief This macro read one byte from smartcard module receive FIFO - * - * @param[in] sc The pointer of smartcard module. - * - * @return One byte read from receive FIFO - * - * @details By reading DAT register, the SC will return an 8-bit received data. - * \hideinitializer - */ -#define SC_READ(sc) ((char)((sc)->DAT)) - -/** - * @brief This macro write one byte to smartcard module transmit FIFO - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u8Data Data to write to transmit FIFO. - * - * @return None - * - * @details By writing data to DAT register, the SC will send out an 8-bit data. - * \hideinitializer - */ -#define SC_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief This macro set smartcard stop bit length - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Len Stop bit length, ether 1 or 2. - * - * @return None - * - * @details Stop bit length must be 1 for T = 1 protocol and 2 for T = 0 protocol. - * \hideinitializer - */ -#define SC_SET_STOP_BIT_LEN(sc, u32Len) ((sc)->CTL = ((sc)->CTL & ~SC_CTL_NSB_Msk) | (((u32Len) == 1)? SC_CTL_NSB_Msk : 0)) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count); -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count); - - -/** - * @brief Enable/Disable Tx error retry, and set Tx error retry count - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Count The number of times of Tx error retry count, between 0~8. 0 means disable Tx error retry. - * - * @return None - * - * @details This function is used to enable/disable transmitter retry function when parity error has occurred, and set error retry count. - */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count) -{ - while(((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_TXRTY_Msk | SC_CTL_TXRTYEN_Msk); - - if((u32Count) != 0UL) - { - while(((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_TXRTY_Pos) | SC_CTL_TXRTYEN_Msk; - } -} - -/** - * @brief Enable/Disable Rx error retry, and set Rx error retry count - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Count The number of times of Rx error retry count, between 0~8. 0 means disable Rx error retry. - * - * @return None - * - * @details This function is used to enable/disable receiver retry function when parity error has occurred, and set error retry count. - */ -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count) -{ - while(((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_RXRTY_Msk | SC_CTL_RXRTYEN_Msk); - - if((u32Count) != 0UL) - { - while(((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_RXRTY_Pos) | SC_CTL_RXRTYEN_Msk; - } -} - - -uint32_t SC_IsCardInserted(SC_T *sc); -void SC_ClearFIFO(SC_T *sc); -void SC_Close(SC_T *sc); -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR); -void SC_ResetReader(SC_T *sc); -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT); -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT); -void SC_StopAllTimer(SC_T *sc); -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount); -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum); -uint32_t SC_GetInterfaceClock(SC_T *sc); - -/**@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SC_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scu.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scu.h deleted file mode 100644 index 5079c6d1757..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scu.h +++ /dev/null @@ -1,358 +0,0 @@ -/**************************************************************************//** - * @file nu_scu.h - * @version V3.00 - * @brief Secure Configuration Unit Driver Header - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SCU_H__ -#define __NU_SCU_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCU_Driver SCU Driver - @{ -*/ - -/** @addtogroup SCU_EXPORTED_CONSTANTS SCU Exported Constants - @{ -*/ - - - - -/** - * @details Non-secure Attribution Definition. - */ -typedef enum NSATTR -{ - /****** PNNSET0 **********************************************************************************/ - USBH_Attr = 9, - SDH0_Attr = 13, - EBI_Attr = 16, - PDMA1_Attr = 24, - - /****** PNNSET1 **********************************************************************************/ - CRC_Attr = 32 + 17, - CRPT_Attr = 32 + 18, - - /****** PNNSET2 **********************************************************************************/ - EWDT_Attr = 64 + 2, - EADC_Attr = 64 + 3, - ACMP01_Attr = 64 + 5, - DAC_Attr = 64 + 7, - I2S0_Attr = 64 + 8, - OTG_Attr = 64 + 13, - TMR23_Attr = 64 + 17, - TMR45_Attr = 64 + 18, - EPWM0_Attr = 64 + 24, - EPWM1_Attr = 64 + 25, - BPWM0_Attr = 64 + 26, - BPWM1_Attr = 64 + 27, - /****** PNNSET3 **********************************************************************************/ - QSPI0_Attr = 96 + 0, - SPI0_Attr = 96 + 1, - SPI1_Attr = 96 + 2, - SPI2_Attr = 96 + 3, - SPI3_Attr = 96 + 4, - UART0_Attr = 96 + 16, - UART1_Attr = 96 + 17, - UART2_Attr = 96 + 18, - UART3_Attr = 96 + 19, - UART4_Attr = 96 + 20, - UART5_Attr = 96 + 21, - /****** PNNSET4 **********************************************************************************/ - I2C0_Attr = 128 + 0, - I2C1_Attr = 128 + 1, - I2C2_Attr = 128 + 2, - SC0_Attr = 128 + 16, - SC1_Attr = 128 + 17, - SC2_Attr = 128 + 18, - - - /****** PNNSET5 **********************************************************************************/ - CAN0_Attr = 160 + 0, - QEI0_Attr = 160 + 16, - QEI1_Attr = 160 + 17, - ECAP0_Attr = 160 + 20, - ECAP1_Attr = 160 + 21, - TRNG_Attr = 160 + 25, - LCD_Attr = 160 + 27, - - /****** PNNSET6 **********************************************************************************/ - USBD_Attr = 192 + 0, - USCI0_Attr = 192 + 16, - USCI1_Attr = 192 + 17 - - -} NSATTR_T; - - -/**@}*/ /* end of group SCU_EXPORTED_CONSTANTS */ - - -/** @addtogroup SCU_EXPORTED_FUNCTIONS SCU Exported Functions - @{ -*/ - -/** - * @brief Set peripheral non-secure attribution - * - * @param[in] nsattr The secure/non-secure attribution of specified module. - The possible value could be refer to \ref NSATTR. - * - * @return None - * - * @details This macro is used to set a peripheral to be non-secure peripheral. - * - */ -#define SCU_SET_PNSSET(nsattr) { SCU->PNSSET[(nsattr)/32] |= (1 << ((nsattr) & 0x1ful)); } - -/** - * @brief Get peripheral secure/non-secure attribution - * - * @param[in] nsattr The secure/non-secure attribution of specified module. - The possible value could be refer to \ref NSATTR. - * - * @return The secure/non-secure attribution of specified peripheral. - * @retval 0 The peripheral is secure - * @retval 1 The peripheral is non-secure - * - * @details This macro gets the peripheral secure/non-secure attribution. - */ -#define SCU_GET_PNSSET(nsattr) ((SCU->PNSSET[(nsattr)/32] >> ((nsattr) & 0x1ful)) & 1ul) - - -/** - * @brief Set secure/non-secure attribution of specified GPIO pin - * - * @param[in] port GPIO Port. It could be PA, PB, PC, PD, PE, PF, PG and PH. - * @param[in] bitmask Bit mask of each bit. 0 is secure. 1 is non-secure. - * - * @return None - * - * @details This macro sets GPIO pin secure/non-secure attribution. - */ -#define SCU_SET_IONSSET(port, mask) (SCU->IONSSET[((uint32_t)(port)-(GPIOA_BASE))/0x40] = (mask)) - - -/** - * @brief Get secure/non-secure attribution of specified GPIO port - * - * @param[in] port GPIO Port. It could be PA, PB, PC, PD, PE, PF, PG and PH. - * - * @return The secure/non-secure attribution of the port. - * @retval 0 The relative bit of specified IO port is secure - * @retval 1 The relative bit of specified IO port is non-secure - * - * @details This macro gets IO secure/non-secure attribution of specified IO port. - */ -#define SCU_GET_IONSSET(port) (SCU->IONSSET[((uint32_t)(port) - (GPIOA_BASE))/0x40]) - - -/** - * @brief Enable sercure violation interrupts - * - * @param[in] mask The mask of each secure violation interrupt source - * - \ref SCU_SVIOIEN_APB0IEN_Msk - * - \ref SCU_SVIOIEN_APB1IEN_Msk - * - \ref SCU_SVIOIEN_GPIOIEN_Msk - * - \ref SCU_SVIOIEN_EBIIEN_Msk - * - \ref SCU_SVIOIEN_USBHIEN_Msk - * - \ref SCU_SVIOIEN_CRCIEN_Msk - * - \ref SCU_SVIOIEN_SDH0IEN_Msk - * - \ref SCU_SVIOIEN_PDMA0IEN_Msk - * - \ref SCU_SVIOIEN_PDMA1IEN_Msk - * - \ref SCU_SVIOIEN_SRAM0IEN_Msk - * - \ref SCU_SVIOIEN_SRAM1IEN_Msk - * - \ref SCU_SVIOIEN_FMCIEN_Msk - * - \ref SCU_SVIOIEN_FLASHIEN_Msk - * - \ref SCU_SVIOIEN_SCUIEN_Msk - * - \ref SCU_SVIOIEN_SYSIEN_Msk - * - \ref SCU_SVIOIEN_CRPTIEN_Msk - * - * @return None - * - * @details This macro is used to enable secure violation interrupt of SCU. - * The secure violation interrupt could be used to detect attack of secure elements. - */ -#define SCU_ENABLE_INT(mask) (SCU->SVIOIEN |= (mask)) - - -/** - * @brief Disable sercure violation interrupts - * - * @param[in] mask The mask of each secure violation interrupt source - * - \ref SCU_SVIOIEN_APB0IEN_Msk - * - \ref SCU_SVIOIEN_APB1IEN_Msk - * - \ref SCU_SVIOIEN_GPIOIEN_Msk - * - \ref SCU_SVIOIEN_EBIIEN_Msk - * - \ref SCU_SVIOIEN_USBHIEN_Msk - * - \ref SCU_SVIOIEN_CRCIEN_Msk - * - \ref SCU_SVIOIEN_SDH0IEN_Msk - * - \ref SCU_SVIOIEN_PDMA0IEN_Msk - * - \ref SCU_SVIOIEN_PDMA1IEN_Msk - * - \ref SCU_SVIOIEN_SRAM0IEN_Msk - * - \ref SCU_SVIOIEN_SRAM1IEN_Msk - * - \ref SCU_SVIOIEN_FMCIEN_Msk - * - \ref SCU_SVIOIEN_FLASHIEN_Msk - * - \ref SCU_SVIOIEN_SCUIEN_Msk - * - \ref SCU_SVIOIEN_SYSIEN_Msk - * - \ref SCU_SVIOIEN_CRPTIEN_Msk - * - * @return None - * - * @details This macro is used to disable secure violation interrupt of SCU. - * - */ -#define SCU_DISABLE_INT(mask) (SCU->SVIOIEN &= (~(mask))) - - -/** - * @brief Get secure violation interrupt status - * - * @param mask The interrupt flag mask bit - * - * @return The value of SCU_SVINTSTS register - * - * @details Return interrupt flag of SCU_SVINTSTS register. - * - */ -#define SCU_GET_INT_FLAG(mask) (SCU->SVINTSTS&(mask)) - -/** - * @brief Clear secure violation interrupt flag - * - * @param[in] flag The combination of the specified interrupt flags. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. - * - \ref SCU_SVINTSTS_APB0IF_Msk - * - \ref SCU_SVINTSTS_APB1IF_Msk - * - \ref SCU_SVINTSTS_GPIOIF_Msk - * - \ref SCU_SVINTSTS_EBIIF_Msk - * - \ref SCU_SVINTSTS_USBHIF_Msk - * - \ref SCU_SVINTSTS_CRCIF_Msk - * - \ref SCU_SVINTSTS_SDH0IF_Msk - * - \ref SCU_SVINTSTS_PDMA0IF_Msk - * - \ref SCU_SVINTSTS_PDMA1IF_Msk - * - \ref SCU_SVINTSTS_SRAM0IF_Msk - * - \ref SCU_SVINTSTS_SRAM1IF_Msk - * - \ref SCU_SVINTSTS_FMCIF_Msk - * - \ref SCU_SVINTSTS_FLASHIF_Msk - * - \ref SCU_SVINTSTS_SCUIF_Msk - * - \ref SCU_SVINTSTS_SYSIF_Msk - * - \ref SCU_SVINTSTS_CRPTIF_Msk - * - * @return None - * - * @details Clear SCU related interrupt flags specified by flag parameter. - * - */ -#define SCU_CLR_INT_FLAG(flag) (SCU->SVINTSTS = (flag)) - - - -/** - * @brief Control the behavior of non-secure monitor when CPU is in idle state. - * - * @param[in] opt Option for behavior control of non-secure monitor when CPU in idle. - * - true The counter keeps counting when CPU is in idle. - - false The counter will stop when CPU is in idle. - * - * @return None - * - * @details To control non-secure monitor counter when CPU is in idle. - * - */ -#define SCU_NSM_IDLE_ON(opt) ((opt)?(SCU->NSMCTL |= SCU_NSMCTL_IDLEON_Msk):(SCU->NSMCTL &= ~SCU_NSMCTL_IDLEON_Msk)) - -/** - * @brief Control the behavior of non-secure monitor when CPU is in debug state. - * - * @param[in] opt Option for behavior control of non-secure monitor when CPU in debug. - * - true The counter keeps counting when CPU is in debug. - - false The counter will stop when CPU is in debug. - * - * @return None - * - * @details To control non-secure monitor counter when CPU is in debug. - * - */ -#define SCU_NSM_DBG_ON(opt) ((opt)?(SCU->NSMCTL |= SCU_NSMCTL_DBGON_Msk):(SCU->NSMCTL &= ~SCU_NSMCTL_DBGON_Msk)) - - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SCU_NSMConfig(uint32_t u32Ticks, uint32_t u32Prescale); -__STATIC_INLINE void SCU_TimerConfig(uint32_t u32Ticks, uint32_t u32Prescale); - - -/** - * @brief Config non-secure monitor to detect timeout in non-secure state. - * - * @param[in] u32Ticks A specified period for timeout in non-secure state - * @param[in] u32Prescale A pre-scale divider to non-secure monitor clock - - * - * @return None - * - * @details This function is used to configure non-secure monitor. If the CPU state stay in non-secure state for - * a specified period. The non-secure monitor will timeout and assert an interrupt. Otherwise, the - * non-secure monitor will auto clear whenever returning to secure state. This could be used to avoid - * CPU state in non-secure state too long time for security purpose. User must enable SCU_IRQn if interrupt - * is necessary. - * - */ -__STATIC_INLINE void SCU_NSMConfig(uint32_t u32Ticks, uint32_t u32Prescale) -{ - - SCU->NSMLOAD = u32Ticks; - SCU->NSMVAL = 0ul; - SCU->NSMCTL = SCU_NSMCTL_AUTORLD_Msk | SCU_NSMCTL_NSMIEN_Msk | (u32Prescale & 0xfful); -} - - -/** - * @brief Config non-secure monitor to be a timer. - * - * @param[in] u32Ticks A specified period for timer interrupt. - * @param[in] u32Prescale A pre-scale divider to timer clock source. - - * - * @return None - * - * @details This function is used to configure non-secure monitor as a timer. In other words, the timer counter - * keeps counting even CPU is in secure state. - * - */ -__STATIC_INLINE void SCU_TimerConfig(uint32_t u32Ticks, uint32_t u32Prescale) -{ - - SCU->NSMLOAD = u32Ticks; - SCU->NSMVAL = 0ul; - SCU->NSMCTL = SCU_NSMCTL_AUTORLD_Msk | SCU_NSMCTL_NSMIEN_Msk | SCU_NSMCTL_TMRMOD_Msk | (u32Prescale & 0xfful); -} - - - - -/**@}*/ /* end of group SCU_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SCU_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SCU_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scuart.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scuart.h deleted file mode 100644 index d9a3756b149..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_scuart.h +++ /dev/null @@ -1,353 +0,0 @@ -/**************************************************************************//** - * @file nu_scuart.h - * @version V3.00 - * @brief Smartcard UART mode (SCUART) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SCUART_H__ -#define __NU_SCUART_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - -/** @addtogroup SCUART_EXPORTED_CONSTANTS SCUART Exported Constants - @{ -*/ -#define SCUART_CHAR_LEN_5 (0x3UL << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 5 bits \hideinitializer */ -#define SCUART_CHAR_LEN_6 (0x2UL << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 6 bits \hideinitializer */ -#define SCUART_CHAR_LEN_7 (0x1UL << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 7 bits \hideinitializer */ -#define SCUART_CHAR_LEN_8 (0UL) /*!< Set SCUART word length to 8 bits \hideinitializer */ - -#define SCUART_PARITY_NONE (SC_UARTCTL_PBOFF_Msk) /*!< Set SCUART transfer with no parity \hideinitializer */ -#define SCUART_PARITY_ODD (SC_UARTCTL_OPE_Msk) /*!< Set SCUART transfer with odd parity \hideinitializer */ -#define SCUART_PARITY_EVEN (0UL) /*!< Set SCUART transfer with even parity \hideinitializer */ - -#define SCUART_STOP_BIT_1 (SC_CTL_NSB_Msk) /*!< Set SCUART transfer with one stop bit \hideinitializer */ -#define SCUART_STOP_BIT_2 (0UL) /*!< Set SCUART transfer with two stop bits \hideinitializer */ - -/**@}*/ /* end of group SCUART_EXPORTED_CONSTANTS */ - - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/* TX Macros */ -/** - * @brief Write Data to Tx data register - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details By writing data to DAT register, the SC will send out an 8-bit data. - * \hideinitializer - */ -#define SCUART_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief Get Tx FIFO empty flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO empty status - * @retval 0 Transmit FIFO is not empty - * @retval SC_STATUS_TXEMPTY_Msk Transmit FIFO is empty - * - * @details When the last byte of Tx buffer has been transferred to Transmitter Shift Register, hardware sets TXEMPTY (SC_STATUS[9]) high. - * It will be cleared when writing data into DAT (SC_DAT[7:0]). - * \hideinitializer - */ -#define SCUART_GET_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXEMPTY_Msk) - -/** - * @brief Get Tx FIFO full flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval SC_STATUS_TXFULL_Msk Transmit FIFO is full - * - * @details TXFULL (SC_STATUS[10]) is set when Tx buffer counts equals to 4, otherwise is cleared by hardware. - * \hideinitializer - */ -#define SCUART_GET_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk) - -/** - * @brief Wait specified smartcard port transmission complete - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details TXACT (SC_STATUS[31]) is cleared automatically when Tx transfer is finished or the last byte transmission has completed. - * - * @note This macro blocks until transmit complete. - * \hideinitializer - */ -#define SCUART_WAIT_TX_EMPTY(sc) while(((sc)->STATUS & SC_STATUS_TXACT_Msk) == SC_STATUS_TXACT_Msk) - -/** - * @brief Check specified smartcard port transmit FIFO is full or not - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval 1 Transmit FIFO is full - * - * @details TXFULL (SC_STATUS[10]) indicates Tx buffer full or not. - * This bit is set when Tx buffer counts equals to 4, otherwise is cleared by hardware. - * \hideinitializer - */ -#define SCUART_IS_TX_FULL(sc) (((sc)->STATUS & SC_STATUS_TXFULL_Msk)? 1 : 0) - -/** - * @brief Check specified smartcard port transmission is over - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit complete status - * @retval 0 Transmit is not complete - * @retval 1 Transmit complete - * - * @details TXACT (SC_STATUS[31]) indicates Tx Transmit is complete or not. - * \hideinitializer - */ -#define SCUART_IS_TX_EMPTY(sc) (((sc)->STATUS & SC_STATUS_TXACT_Msk)? 0 : 1) - -/** - * @brief Check specified smartcard port transmit FIFO empty status - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO empty status - * @retval 0 Transmit FIFO is not empty - * @retval 1 Transmit FIFO is empty - * - * @details TXEMPTY (SC_STATUS[9]) is set by hardware when the last byte of Tx buffer has been transferred to Transmitter Shift Register. - * \hideinitializer - */ -#define SCUART_IS_TX_FIFO_EMPTY(sc) (((sc)->STATUS & SC_STATUS_TXEMPTY_Msk)? 1 : 0) - -/** - * @brief Check specified Smartcard port Transmission Status - * - * @param[in] sc The pointer of smartcard module. - * - * @retval 0 Transmit is completed - * @retval 1 Transmit is active - * - * @details TXACT (SC_STATUS[31]) is set by hardware when Tx transfer is in active and the STOP bit of the last byte has been transmitted. - * \hideinitializer - */ -#define SCUART_IS_TX_ACTIVE(sc) (((sc)->STATUS & SC_STATUS_TXACT_Msk)? 1 : 0) - - -/* RX Macros */ -/** - * @brief Read Rx data register - * - * @param[in] sc The pointer of smartcard module. - * - * @return The oldest data byte in RX FIFO - * - * @details By reading DAT register, the SC will return an 8-bit received data. - * \hideinitializer - */ -#define SCUART_READ(sc) ((sc)->DAT) - -/** - * @brief Get Rx FIFO empty flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO empty status - * @retval 0 Receive FIFO is not empty - * @retval SC_STATUS_RXEMPTY_Msk Receive FIFO is empty - * - * @details When the last byte of Rx buffer has been read by CPU, hardware sets RXEMPTY (SC_STATUS[1]) high. - * It will be cleared when SC receives any new data. - * \hideinitializer - */ -#define SCUART_GET_RX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_RXEMPTY_Msk) - -/** - * @brief Get Rx FIFO full flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval SC_STATUS_TXFULL_Msk Receive FIFO is full - * - * @details RXFULL (SC_STATUS[2]) is set when Rx buffer counts equals to 4, otherwise it is cleared by hardware. - * \hideinitializer - */ -#define SCUART_GET_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk) - -/** - * @brief Check if receive data number in FIFO reach FIFO trigger level or not - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO data status - * @retval 0 The number of bytes in receive FIFO is less than trigger level - * @retval 1 The number of bytes in receive FIFO equals or larger than trigger level - * - * @details RDAIF (SC_INTSTS[0]) is used for received data reaching trigger level RXTRGLV (SC_CTL[7:6]) interrupt status flag. - * - * @note If receive trigger level is \b not 1 byte, this macro return 0 does not necessary indicates there is no data in FIFO. - * \hideinitializer - */ -#define SCUART_IS_RX_READY(sc) (((sc)->INTSTS & SC_INTSTS_RDAIF_Msk)? 1 : 0) - -/** - * @brief Check specified smartcard port receive FIFO is full or not - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval 1 Receive FIFO is full - * - * @details RXFULLF( SC_STATUS[2]) is set when Rx buffer counts equals to 4, otherwise it is cleared by hardware. - * \hideinitializer - */ -#define SCUART_IS_RX_FULL(sc) (((sc)->STATUS & SC_STATUS_RXFULL_Msk)? 1 : 0) - - -/* Interrupt Macros */ -/** - * @brief Enable specified interrupts - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Interrupt masks to enable, a combination of following bits, - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * - * @return None - * - * @details The macro is used to enable receiver buffer time-out interrupt, transfer error interrupt, - * transmit buffer empty interrupt or receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SCUART_ENABLE_INT(sc, u32Mask) ((sc)->INTEN |= (u32Mask)) - -/** - * @brief Disable specified interrupts - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Interrupt masks to disable, a combination of following bits, - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * - * @return None - * - * @details The macro is used to disable receiver buffer time-out interrupt, transfer error interrupt, - * transmit buffer empty interrupt or receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SCUART_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Type Interrupt flag/status to check, could be one of following value - * - \ref SC_INTSTS_RXTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * - \ref SC_INTSTS_RDAIF_Msk - * - * @return The status of specified interrupt - * @retval 0 Specified interrupt does not happened - * @retval 1 Specified interrupt happened - * - * @details The macro is used to get receiver buffer time-out interrupt status, transfer error interrupt status, - * transmit buffer empty interrupt status or receive data reach interrupt status. - * \hideinitializer - */ -#define SCUART_GET_INT_FLAG(sc, u32Type) (((sc)->INTSTS & (u32Type))? 1 : 0) - -/** - * @brief Clear specified interrupt flag/status - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Type Interrupt flag/status to clear, only \ref SC_INTSTS_TERRIF_Msk valid for this macro. - * - * @return None - * - * @details The macro is used to clear transfer error interrupt flag. - * \hideinitializer - */ -#define SCUART_CLR_INT_FLAG(sc, u32Type) ((sc)->INTSTS = (u32Type)) - -/** - * @brief Get receive error flag/status - * - * @param[in] sc The pointer of smartcard module. - * - * @return Current receive error status, could one of following errors: - * @retval SC_STATUS_PEF_Msk Parity error - * @retval SC_STATUS_FEF_Msk Frame error - * @retval SC_STATUS_BEF_Msk Break error - * - * @details The macro is used to get receiver parity error status, frame error status or break error status. - * \hideinitializer - */ -#define SCUART_GET_ERR_FLAG(sc) ((sc)->STATUS & (SC_STATUS_PEF_Msk | SC_STATUS_FEF_Msk | SC_STATUS_BEF_Msk)) - -/** - * @brief Clear specified receive error flag/status - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Receive error flag/status to clear, combination following values - * - \ref SC_STATUS_PEF_Msk - * - \ref SC_STATUS_FEF_Msk - * - \ref SC_STATUS_BEF_Msk - * - * @return None - * - * @details The macro is used to clear receiver parity error flag, frame error flag or break error flag. - * \hideinitializer - */ -#define SCUART_CLR_ERR_FLAG(sc, u32Mask) ((sc)->STATUS = (u32Mask)) - -void SCUART_Close(SC_T* sc); -uint32_t SCUART_Open(SC_T* sc, uint32_t u32Baudrate); -uint32_t SCUART_Read(SC_T* sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t SCUART_SetLineConfig(SC_T* sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits); -void SCUART_SetTimeoutCnt(SC_T* sc, uint32_t u32TOC); -void SCUART_Write(SC_T* sc, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); - -/**@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SCUART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SCUART_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sdh.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sdh.h deleted file mode 100644 index 40640de9b0c..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sdh.h +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************//** - * @file nu_sdh.h - * @version V1.00 - * @brief M2354 SDH driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SDH_H__ -#define __NU_SDH_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup SDH_EXPORTED_CONSTANTS SDH Exported Constants - @{ -*/ - -#define SDH_ERR_ID 0xFFFF0100UL /*!< SDH error ID \hideinitializer */ - -#define SDH_TIMEOUT (SDH_ERR_ID|0x01UL) /*!< Timeout \hideinitializer */ -#define SDH_NO_MEMORY (SDH_ERR_ID|0x02UL) /*!< OOM \hideinitializer */ - -/* -- function return value */ -#define Successful 0U /*!< Success \hideinitializer */ -#define Fail 1U /*!< Failed \hideinitializer */ - -/* --- define type of SD card or MMC */ -#define SDH_TYPE_UNKNOWN 0UL /*!< Unknown card type \hideinitializer */ -#define SDH_TYPE_SD_HIGH 1UL /*!< SDHC card \hideinitializer */ -#define SDH_TYPE_SD_LOW 2UL /*!< SD card \hideinitializer */ -#define SDH_TYPE_MMC 3UL /*!< MMC card \hideinitializer */ -#define SDH_TYPE_EMMC 4UL /*!< eMMC card \hideinitializer */ - -/* SD error */ -#define SDH_NO_SD_CARD (SDH_ERR_ID|0x10UL) /*!< Card removed \hideinitializer */ -#define SDH_ERR_DEVICE (SDH_ERR_ID|0x11UL) /*!< Device error \hideinitializer */ -#define SDH_INIT_TIMEOUT (SDH_ERR_ID|0x12UL) /*!< Card init timeout \hideinitializer */ -#define SDH_SELECT_ERROR (SDH_ERR_ID|0x13UL) /*!< Card select error \hideinitializer */ -#define SDH_WRITE_PROTECT (SDH_ERR_ID|0x14UL) /*!< Card write protect \hideinitializer */ -#define SDH_INIT_ERROR (SDH_ERR_ID|0x15UL) /*!< Card init error \hideinitializer */ -#define SDH_CRC7_ERROR (SDH_ERR_ID|0x16UL) /*!< CRC 7 error \hideinitializer */ -#define SDH_CRC16_ERROR (SDH_ERR_ID|0x17UL) /*!< CRC 16 error \hideinitializer */ -#define SDH_CRC_ERROR (SDH_ERR_ID|0x18UL) /*!< CRC error \hideinitializer */ -#define SDH_CMD8_ERROR (SDH_ERR_ID|0x19UL) /*!< Command 8 error \hideinitializer */ - -#define MMC_FREQ 20000UL /*!< output 20MHz to MMC \hideinitializer */ -#define SD_FREQ 25000UL /*!< output 25MHz to SD \hideinitializer */ -#define SDHC_FREQ 50000UL /*!< output 50MHz to SDH \hideinitializer */ - -#define CardDetect_From_GPIO (1UL << 8) /*!< Card detection pin is GPIO \hideinitializer */ -#define CardDetect_From_DAT3 (1UL << 9) /*!< Card detection pin is DAT3 \hideinitializer */ - -/**@}*/ /* end of group SDH_EXPORTED_CONSTANTS */ - -/** @addtogroup SDH_EXPORTED_TYPEDEF SDH Exported Type Defines - @{ -*/ -#if defined ( __ARMCC_VERSION ) -#pragma pack(push) -#pragma pack(1) -#endif -typedef struct SDH_info_t -{ - unsigned int CardType; /*!< SDHC, SD, or MMC */ - unsigned int RCA; /*!< Relative card address */ - unsigned char IsCardInsert; /*!< Card insert state */ - unsigned int totalSectorN; /*!< Total sector number */ - unsigned int diskSize; /*!< Disk size in K bytes */ - int sectorSize; /*!< Sector size in bytes */ -} SDH_INFO_T; /*!< Structure holds SD card info */ -#if defined ( __ARMCC_VERSION ) -#pragma pack(pop) -#endif -/**@}*/ /* end of group SDH_EXPORTED_TYPEDEF */ - -/** @cond HIDDEN_SYMBOLS */ -extern SDH_INFO_T SD0; -extern uint8_t volatile g_u8SDDataReadyFlag; -extern uint8_t g_u8R3Flag; - -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ - -/** - * @brief Enable specified interrupt. - * - * @param[in] sdh The pointer of the specified SDH module. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_CDSRC_Msk / \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / - * \ref SDH_INTEN_WKIEN_Msk - * - * @return None. - * \hideinitializer - */ -#define SDH_ENABLE_INT(sdh, u32IntMask) ((sdh)->INTEN |= (u32IntMask)) - -/** - * @brief Disable specified interrupt. - * - * @param[in] sdh The pointer of the specified SDH module. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / \ref SDH_INTEN_WKIEN_Msk / \ref SDH_INTEN_CDSRC_Msk / - * - * @return None. - * \hideinitializer - */ -#define SDH_DISABLE_INT(sdh, u32IntMask) ((sdh)->INTEN &= ~(u32IntMask)) - -/** - * @brief Get specified interrupt flag/status. - * - * @param[in] sdh The pointer of the specified SDH module. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CRC7_Msk / - * \ref SDH_INTSTS_CRC16_Msk / \ref SDH_INTSTS_CRCSTS_Msk / \ref SDH_INTSTS_DAT0STS_Msk / - * \ref SDH_INTSTS_CDIF_Msk / \ref SDH_INTSTS_RTOIF_Msk / - * \ref SDH_INTSTS_DITOIF_Msk / \ref SDH_INTSTS_CDSTS_Msk / - * \ref SDH_INTSTS_DAT1STS_Msk - * - * - * @return 0 = The specified interrupt is not happened. - * 1 = The specified interrupt is happened. - * \hideinitializer - */ -#define SDH_GET_INT_FLAG(sdh, u32IntMask) (((sdh)->INTSTS & (u32IntMask))?1:0) - - -/** - * @brief Clear specified interrupt flag/status. - * - * @param[in] sdh The pointer of the specified SDH module. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CDIF_Msk / - * \ref SDH_INTSTS_RTOIF_Msk / \ref SDH_INTSTS_DITOIF_Msk - * - * - * @return None. - * \hideinitializer - */ -#define SDH_CLR_INT_FLAG(sdh, u32IntMask) ((sdh)->INTSTS = (u32IntMask)) - - -/** - * @brief Check SD Card inserted or removed. - * - * @param[in] sdh The pointer of the specified SDH module. - * - * @return 1: Card inserted. - * 0: Card removed. - * \hideinitializer - */ -#define SDH_IS_CARD_PRESENT(sdh) ((((sdh) == SDH0)||((sdh) == SDH0_NS))? SD0.IsCardInsert : 0) - -/** - * @brief Get SD Card capacity. - * - * @param[in] sdh The pointer of the specified SDH module. - * - * @return SD Card capacity. (unit: KByte) - * \hideinitializer - */ -#define SDH_GET_CARD_CAPACITY(sdh) ((((sdh) == SDH0)||((sdh) == SDH0_NS))? SD0.diskSize : 0) - - -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc); -uint32_t SDH_Probe(SDH_T *sdh); -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -void SDH_Set_clock(SDH_T *sdh, uint32_t u32SDClockKhz); -uint32_t SDH_CardDetection(SDH_T *sdh); -void SDH_Open_Disk(SDH_T *sdh, uint32_t u32CardDetSrc); -void SDH_Close_Disk(SDH_T *sdh); - -/**@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SDH_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* end of __NU_SDH_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_spi.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_spi.h deleted file mode 100644 index 067a56f6eb7..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_spi.h +++ /dev/null @@ -1,582 +0,0 @@ -/****************************************************************************** - * @file nu_spi.h - * @version V3.00 - * @brief M2354 series SPI driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SPI_H__ -#define __NU_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ - -#define SPI_MODE_0 (SPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 */ -#define SPI_MODE_1 (SPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 */ -#define SPI_MODE_2 (SPI_CTL_CLKPOL_Msk | SPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 */ -#define SPI_MODE_3 (SPI_CTL_CLKPOL_Msk | SPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 */ - -#define SPI_SLAVE (SPI_CTL_SLAVE_Msk) /*!< Set as slave */ -#define SPI_MASTER (0x0UL) /*!< Set as master */ - -#define SPI_SS (SPI_SSCTL_SS_Msk) /*!< Set SS */ -#define SPI_SS_ACTIVE_HIGH (SPI_SSCTL_SSACTPOL_Msk) /*!< SS active high */ -#define SPI_SS_ACTIVE_LOW (0x0UL) /*!< SS active low */ - -/* SPI Interrupt Mask */ -#define SPI_UNIT_INT_MASK (0x001UL) /*!< Unit transfer interrupt mask */ -#define SPI_SSACT_INT_MASK (0x002UL) /*!< Slave selection signal active interrupt mask */ -#define SPI_SSINACT_INT_MASK (0x004UL) /*!< Slave selection signal inactive interrupt mask */ -#define SPI_SLVUR_INT_MASK (0x008UL) /*!< Slave under run interrupt mask */ -#define SPI_SLVBE_INT_MASK (0x010UL) /*!< Slave bit count error interrupt mask */ -#define SPI_TXUF_INT_MASK (0x040UL) /*!< Slave TX underflow interrupt mask */ -#define SPI_FIFO_TXTH_INT_MASK (0x080UL) /*!< FIFO TX threshold interrupt mask */ -#define SPI_FIFO_RXTH_INT_MASK (0x100UL) /*!< FIFO RX threshold interrupt mask */ -#define SPI_FIFO_RXOV_INT_MASK (0x200UL) /*!< FIFO RX overrun interrupt mask */ -#define SPI_FIFO_RXTO_INT_MASK (0x400UL) /*!< FIFO RX time-out interrupt mask */ - -/* SPI Status Mask */ -#define SPI_BUSY_MASK (0x01UL) /*!< Busy status mask */ -#define SPI_RX_EMPTY_MASK (0x02UL) /*!< RX empty status mask */ -#define SPI_RX_FULL_MASK (0x04UL) /*!< RX full status mask */ -#define SPI_TX_EMPTY_MASK (0x08UL) /*!< TX empty status mask */ -#define SPI_TX_FULL_MASK (0x10UL) /*!< TX full status mask */ -#define SPI_TXRX_RESET_MASK (0x20UL) /*!< TX or RX reset status mask */ -#define SPI_SPIEN_STS_MASK (0x40UL) /*!< SPIEN status mask */ -#define SPI_SSLINE_STS_MASK (0x80UL) /*!< SPIx_SS line status mask */ - -/* SPI Status2 Mask */ -#define SPI_SLVBENUM_MASK (0x01UL) /*!< Effective bit number of uncompleted RX data status mask */ - - -/* I2S Data Width */ -#define SPII2S_DATABIT_8 (0UL << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 8-bit */ -#define SPII2S_DATABIT_16 (1UL << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 16-bit */ -#define SPII2S_DATABIT_24 (2UL << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 24-bit */ -#define SPII2S_DATABIT_32 (3UL << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 32-bit */ - -/* I2S Audio Format */ -#define SPII2S_MONO SPI_I2SCTL_MONO_Msk /*!< Monaural channel */ -#define SPII2S_STEREO (0UL) /*!< Stereo channel */ - -/* I2S Data Format */ -#define SPII2S_FORMAT_I2S (0UL << SPI_I2SCTL_FORMAT_Pos) /*!< I2S data format */ -#define SPII2S_FORMAT_MSB (1UL << SPI_I2SCTL_FORMAT_Pos) /*!< MSB justified data format */ -#define SPII2S_FORMAT_PCMA (2UL << SPI_I2SCTL_FORMAT_Pos) /*!< PCM mode A data format */ -#define SPII2S_FORMAT_PCMB (3UL << SPI_I2SCTL_FORMAT_Pos) /*!< PCM mode B data format */ - -/* I2S Operation mode */ -#define SPII2S_MODE_SLAVE SPI_I2SCTL_SLAVE_Msk /*!< As slave mode */ -#define SPII2S_MODE_MASTER (0UL) /*!< As master mode */ - -/* I2S TX FIFO Threshold */ -#define SPII2S_FIFO_TX_LEVEL_WORD_0 (0UL) /*!< TX threshold is 0 word */ -#define SPII2S_FIFO_TX_LEVEL_WORD_1 (1UL << SPI_FIFOCTL_TXTH_Pos) /*!< TX threshold is 1 word */ -#define SPII2S_FIFO_TX_LEVEL_WORD_2 (2UL << SPI_FIFOCTL_TXTH_Pos) /*!< TX threshold is 2 words */ -#define SPII2S_FIFO_TX_LEVEL_WORD_3 (3UL << SPI_FIFOCTL_TXTH_Pos) /*!< TX threshold is 3 words */ -/* I2S RX FIFO Threshold */ -#define SPII2S_FIFO_RX_LEVEL_WORD_1 (0UL) /*!< RX threshold is 1 word */ -#define SPII2S_FIFO_RX_LEVEL_WORD_2 (1UL << SPI_FIFOCTL_RXTH_Pos) /*!< RX threshold is 2 words */ -#define SPII2S_FIFO_RX_LEVEL_WORD_3 (2UL << SPI_FIFOCTL_RXTH_Pos) /*!< RX threshold is 3 words */ -#define SPII2S_FIFO_RX_LEVEL_WORD_4 (3UL << SPI_FIFOCTL_RXTH_Pos) /*!< RX threshold is 4 words */ - -/* I2S Record Channel */ -#define SPII2S_MONO_RIGHT (0UL) /*!< Record mono right channel */ -#define SPII2S_MONO_LEFT SPI_I2SCTL_RXLCH_Msk /*!< Record mono left channel */ - -/* I2S Channel */ -#define SPII2S_RIGHT (0UL) /*!< Select right channel */ -#define SPII2S_LEFT (1UL) /*!< Select left channel */ - -/* I2S Interrupt Mask */ -#define SPII2S_FIFO_TXTH_INT_MASK (0x01UL) /*!< TX FIFO threshold interrupt mask */ -#define SPII2S_FIFO_RXTH_INT_MASK (0x02UL) /*!< RX FIFO threshold interrupt mask */ -#define SPII2S_FIFO_RXOV_INT_MASK (0x04UL) /*!< RX FIFO overrun interrupt mask */ -#define SPII2S_FIFO_RXTO_INT_MASK (0x08UL) /*!< RX FIFO time-out interrupt mask */ -#define SPII2S_TXUF_INT_MASK (0x10UL) /*!< TX FIFO underflow interrupt mask */ -#define SPII2S_RIGHT_ZC_INT_MASK (0x20UL) /*!< Right channel zero cross interrupt mask */ -#define SPII2S_LEFT_ZC_INT_MASK (0x40UL) /*!< Left channel zero cross interrupt mask */ -#define SPII2S_SLAVE_ERR_INT_MASK (0x80UL) /*!< Bit clock loss interrupt mask */ - -/**@}*/ /* end of group SPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Write 1 to UNITIF bit of SPI_STATUS register to clear the unit transfer interrupt flag. - */ -#define SPI_CLR_UNIT_TRANS_INT_FLAG(spi) ( (spi)->STATUS = SPI_STATUS_UNITIF_Msk ) - -/** - * @brief Disable Slave 3-wire mode. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SLV3WIRE bit of SPI_SSCTL register to disable Slave 3-wire mode. - */ -#define SPI_DISABLE_3WIRE_MODE(spi) ( (spi)->SSCTL &= ~SPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable Slave 3-wire mode. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SLV3WIRE bit of SPI_SSCTL register to enable Slave 3-wire mode. - */ -#define SPI_ENABLE_3WIRE_MODE(spi) ( (spi)->SSCTL |= SPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Trigger RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set RXPDMAEN bit of SPI_PDMACTL register to enable RX PDMA transfer function. - */ -#define SPI_TRIGGER_RX_PDMA(spi) ( (spi)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Trigger TX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit of SPI_PDMACTL register to enable TX PDMA transfer function. - */ -#define SPI_TRIGGER_TX_PDMA(spi) ( (spi)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to enable TX and RX PDMA transfer function. - */ -#define SPI_TRIGGER_TX_RX_PDMA(spi) ( (spi)->PDMACTL |= (SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear RXPDMAEN bit of SPI_PDMACTL register to disable RX PDMA transfer function. - */ -#define SPI_DISABLE_RX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit of SPI_PDMACTL register to disable TX PDMA transfer function. - */ -#define SPI_DISABLE_TX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to disable TX and RX PDMA transfer function. - */ -#define SPI_DISABLE_TX_RX_PDMA(spi) ( (spi)->PDMACTL &= ~(SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] spi The pointer of the specified SPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (SPI_STATUS[27:24]) to get the count of available data in RX FIFO. - */ -#define SPI_GET_RX_FIFO_COUNT(spi) ( ((spi)->STATUS & SPI_STATUS_RXCNT_Msk) >> SPI_STATUS_RXCNT_Pos ) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of SPI_STATUS register to get the RX FIFO empty flag. - */ -#define SPI_GET_RX_FIFO_EMPTY_FLAG(spi) ( ((spi)->STATUS & SPI_STATUS_RXEMPTY_Msk) >> SPI_STATUS_RXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of SPI_STATUS register to get the TX FIFO empty flag. - */ -#define SPI_GET_TX_FIFO_EMPTY_FLAG(spi) ( ((spi)->STATUS & SPI_STATUS_TXEMPTY_Msk) >> SPI_STATUS_TXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of SPI_STATUS register to get the TX FIFO full flag. - */ -#define SPI_GET_TX_FIFO_FULL_FLAG(spi) ( ((spi)->STATUS & SPI_STATUS_TXFULL_Msk) >> SPI_STATUS_TXFULL_Pos ) - -/** - * @brief Get the datum read from RX register. - * @param[in] spi The pointer of the specified SPI module. - * @return Data in RX register. - * @details Read SPI_RX register to get the received datum. - */ -#define SPI_READ_RX(spi) ( (spi)->RX ) - -/** - * @brief Write datum to TX register. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through SPI bus. - * @return None. - * @details Write u32TxData to SPI_TX register. - */ -#define SPI_WRITE_TX(spi, u32TxData) ( (spi)->TX = (u32TxData) ) - -/** - * @brief Set SPIx_SS pin to high state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to high state. - */ -#define SPI_SET_SS_HIGH(spi) ( (spi)->SSCTL = ((spi)->SSCTL & (~SPI_SSCTL_AUTOSS_Msk)) | (SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk) ) - -/** - * @brief Set SPIx_SS pin to low state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to low state. - */ -#define SPI_SET_SS_LOW(spi) ( (spi)->SSCTL = ((spi)->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk))) | SPI_SSCTL_SS_Msk ) - -/** - * @brief Enable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (SPI_CTL[7:4]). - */ -#define SPI_ENABLE_BYTE_REORDER(spi) ( (spi)->CTL |= SPI_CTL_REORDER_Msk ) - -/** - * @brief Disable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear REORDER bit field of SPI_CTL register to disable Byte Reorder function. - */ -#define SPI_DISABLE_BYTE_REORDER(spi) ( (spi)->CTL &= ~SPI_CTL_REORDER_Msk ) - -/** - * @brief Set the length of suspend interval. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one SPI bus clock cycle). - */ -#define SPI_SET_SUSPEND_CYCLE(spi, u32SuspCycle) ( (spi)->CTL = ((spi)->CTL & ~SPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << SPI_CTL_SUSPITV_Pos) ) - -/** - * @brief Set the SPI transfer sequence with LSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set LSB bit of SPI_CTL register to set the SPI transfer sequence with LSB first. - */ -#define SPI_SET_LSB_FIRST(spi) ( (spi)->CTL |= SPI_CTL_LSB_Msk ) - -/** - * @brief Set the SPI transfer sequence with MSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of SPI_CTL register to set the SPI transfer sequence with MSB first. - */ -#define SPI_SET_MSB_FIRST(spi) ( (spi)->CTL &= ~SPI_CTL_LSB_Msk ) - -/** - * @brief Set the data width of a SPI transaction. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - */ -#define SPI_SET_DATA_WIDTH(spi, u32Width) ( (spi)->CTL = ((spi)->CTL & ~SPI_CTL_DWIDTH_Msk) | (((u32Width) & 0x1F) << SPI_CTL_DWIDTH_Pos) ) - -/** - * @brief Get the SPI busy state. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 SPI controller is not busy. - * @retval 1 SPI controller is busy. - * @details This macro will return the busy state of SPI controller. - */ -#define SPI_IS_BUSY(spi) ( ((spi)->STATUS & SPI_STATUS_BUSY_Msk) >> SPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SPIEN (SPI_CTL[0]) to enable SPI controller. - */ -#define SPI_ENABLE(spi) ( (spi)->CTL |= SPI_CTL_SPIEN_Msk ) - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SPIEN (SPI_CTL[0]) to disable SPI controller. - */ -#define SPI_DISABLE(spi) ( (spi)->CTL &= ~SPI_CTL_SPIEN_Msk ) - -/** - * @brief Enable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will set RZCEN or LZCEN bit of SPI_I2SCTL register to enable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_ENABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if(u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL |= SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Disable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will clear RZCEN or LZCEN bit of SPI_I2SCTL register to disable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_DISABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if(u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Enable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXPDMAEN bit of SPI_PDMACTL register to transmit data with PDMA. - */ -#define SPII2S_ENABLE_TXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXPDMAEN bit of SPI_PDMACTL register to disable TX DMA function. - */ -#define SPII2S_DISABLE_TXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXPDMAEN bit of SPI_PDMACTL register to receive data with PDMA. - */ -#define SPII2S_ENABLE_RXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXPDMAEN bit of SPI_PDMACTL register to disable RX DMA function. - */ -#define SPII2S_DISABLE_RXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXEN bit of SPI_I2SCTL register to enable I2S TX function. - */ -#define SPII2S_ENABLE_TX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Disable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXEN bit of SPI_I2SCTL register to disable I2S TX function. - */ -#define SPII2S_DISABLE_TX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Enable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXEN bit of SPI_I2SCTL register to enable I2S RX function. - */ -#define SPII2S_ENABLE_RX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Disable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXEN bit of SPI_I2SCTL register to disable I2S RX function. - */ -#define SPII2S_DISABLE_RX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Enable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set MUTE bit of SPI_I2SCTL register to enable I2S TX mute function. - */ -#define SPII2S_ENABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Disable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear MUTE bit of SPI_I2SCTL register to disable I2S TX mute function. - */ -#define SPII2S_DISABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Clear TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TX FIFO. The internal TX FIFO pointer will be reset to FIFO start point. - */ -#define SPII2S_CLR_TX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk ) - -/** - * @brief Clear RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RX FIFO. The internal RX FIFO pointer will be reset to FIFO start point. - */ -#define SPII2S_CLR_RX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref SPII2S_MONO_LEFT - * - \ref SPII2S_MONO_RIGHT - * @return None - * @details This function selects the recording source channel of monaural mode. - */ -__STATIC_INLINE void SPII2S_SET_MONO_RX_CHANNEL(SPI_T *i2s, uint32_t u32Ch) -{ - u32Ch == SPII2S_MONO_LEFT ? - (i2s->I2SCTL |= SPI_I2SCTL_RXLCH_Msk) : - (i2s->I2SCTL &= ~SPI_I2SCTL_RXLCH_Msk); -} - -/** - * @brief Write data to I2S TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Data The value written to TX FIFO. - * @return None - * @details This macro will write a value to TX FIFO. - */ -#define SPII2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TX = (u32Data) ) - -/** - * @brief Read RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return The value read from RX FIFO. - * @details This function will return a value read from RX FIFO. - */ -#define SPII2S_READ_RX_FIFO(i2s) ( (i2s)->RX ) - -/** - * @brief Get the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return The interrupt flags specified by the u32mask parameter. - * @details This macro will return the combination interrupt flags of SPI_I2SSTS register. The flags are specified by the u32mask parameter. - */ -#define SPII2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS & (u32Mask) ) - -/** - * @brief Clear the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return None - * @details This macro will clear the interrupt flags specified by the u32mask parameter. - * @note Except TX and RX FIFO threshold interrupt flags, the other interrupt flags can be cleared by writing 1 to itself. - */ -#define SPII2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS = (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return TX FIFO level - * @details This macro will return the number of available words in TX FIFO. - */ -#define SPII2S_GET_TX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_TXCNT_Msk) >> SPI_I2SSTS_TXCNT_Pos ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return RX FIFO level - * @details This macro will return the number of available words in RX FIFO. - */ -#define SPII2S_GET_RX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_RXCNT_Msk) >> SPI_I2SSTS_RXCNT_Pos ) - -/* Function prototype declaration */ -uint32_t SPI_Open(SPI_T *spi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void SPI_Close(SPI_T *spi); -void SPI_ClearRxFIFO(SPI_T *spi); -void SPI_ClearTxFIFO(SPI_T *spi); -void SPI_DisableAutoSS(SPI_T *spi); -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock); -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t SPI_GetBusClock(SPI_T *spi); -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask); -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask); -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetStatus2(SPI_T *spi, uint32_t u32Mask); - -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat); -void SPII2S_Close(SPI_T *i2s); -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask); -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask); -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock); -void SPII2S_DisableMCLK(SPI_T *i2s); -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); - - -/**@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SPI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SPI_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sys.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sys.h deleted file mode 100644 index 08c6246c7a6..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_sys.h +++ /dev/null @@ -1,4313 +0,0 @@ -/**************************************************************************//** - * @file nu_sys.h - * @version V3 - * @brief M2354 series System Manager (SYS) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_SYS_H__ -#define __NU_SYS_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - -/** @addtogroup SYS_EXPORTED_CONSTANTS SYS Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Module Reset Control Resister constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA0_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_PDMA0RST_Pos) /*!< PDMA0 reset is one of the SYS_ResetModule parameter */ -#define EBI_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_EBIRST_Pos) /*!< EBI reset is one of the SYS_ResetModule parameter */ -#define USBH_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_USBHRST_Pos) /*!< USBH reset is one of the SYS_ResetModule parameter */ -#define SDH0_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_SDH0RST_Pos) /*!< SDH0 reset is one of the SYS_ResetModule parameter */ -#define CRC_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_CRCRST_Pos) /*!< CRC reset is one of the SYS_ResetModule parameter */ -#define CRPT_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_CRPTRST_Pos) /*!< CRPT reset is one of the SYS_ResetModule parameter */ -#define KS_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_KSRST_Pos) /*!< KS reset is one of the SYS_ResetModule parameter */ -#define PDMA1_RST ((0x0UL<<24)|(uint32_t)SYS_IPRST0_PDMA1RST_Pos) /*!< PDMA1 reset is one of the SYS_ResetModule parameter */ - -#define GPIO_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_GPIORST_Pos) /*!< GPIO reset is one of the SYS_ResetModule parameter */ -#define TMR0_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_TMR0RST_Pos) /*!< TMR0 reset is one of the SYS_ResetModule parameter */ -#define TMR1_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_TMR1RST_Pos) /*!< TMR1 reset is one of the SYS_ResetModule parameter */ -#define TMR2_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_TMR2RST_Pos) /*!< TMR2 reset is one of the SYS_ResetModule parameter */ -#define TMR3_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_TMR3RST_Pos) /*!< TMR3 reset is one of the SYS_ResetModule parameter */ -#define TMR4_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_TMR4RST_Pos) /*!< TMR4 reset is one of the SYS_ResetModule parameter */ -#define TMR5_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_TMR5RST_Pos) /*!< TMR5 reset is one of the SYS_ResetModule parameter */ - -#define ACMP01_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_ACMP01RST_Pos) /*!< ACMP01 reset is one of the SYS_ResetModule parameter */ -#define I2C0_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_I2C0RST_Pos) /*!< I2C0 reset is one of the SYS_ResetModule parameter */ -#define I2C1_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_I2C1RST_Pos) /*!< I2C1 reset is one of the SYS_ResetModule parameter */ -#define I2C2_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_I2C2RST_Pos) /*!< I2C2 reset is one of the SYS_ResetModule parameter */ -#define QSPI0_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_QSPI0RST_Pos) /*!< QSPI0 reset is one of the SYS_ResetModule parameter */ -#define SPI0_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_SPI0RST_Pos) /*!< SPI0 reset is one of the SYS_ResetModule parameter */ -#define SPI1_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_SPI1RST_Pos) /*!< SPI1 reset is one of the SYS_ResetModule parameter */ -#define SPI2_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_SPI2RST_Pos) /*!< SPI2 reset is one of the SYS_ResetModule parameter */ -#define UART0_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_UART0RST_Pos) /*!< UART0 reset is one of the SYS_ResetModule parameter */ -#define UART1_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_UART1RST_Pos) /*!< UART1 reset is one of the SYS_ResetModule parameter */ -#define UART2_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_UART2RST_Pos) /*!< UART2 reset is one of the SYS_ResetModule parameter */ -#define UART3_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_UART3RST_Pos) /*!< UART3 reset is one of the SYS_ResetModule parameter */ -#define UART4_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_UART4RST_Pos) /*!< UART4 reset is one of the SYS_ResetModule parameter */ -#define UART5_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_UART5RST_Pos) /*!< UART5 reset is one of the SYS_ResetModule parameter */ -#define CAN0_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_CAN0RST_Pos) /*!< CAN0 reset is one of the SYS_ResetModule parameter */ -#define OTG_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_OTGRST_Pos) /*!< OTG reset is one of the SYS_ResetModule parameter */ -#define USBD_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_USBDRST_Pos) /*!< USBD reset is one of the SYS_ResetModule parameter */ -#define EADC_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_EADCRST_Pos) /*!< EADC reset is one of the SYS_ResetModule parameter */ -#define I2S0_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_I2S0RST_Pos) /*!< I2S0 reset is one of the SYS_ResetModule parameter */ -#define LCD_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_LCDRST_Pos) /*!< LCD reset is one of the SYS_ResetModule parameter */ -#define TRNG_RST ((0x4UL<<24)|(uint32_t)SYS_IPRST1_TRNGRST_Pos) /*!< TRNG reset is one of the SYS_ResetModule parameter */ - -#define SC0_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_SC0RST_Pos) /*!< SC0 reset is one of the SYS_ResetModule parameter */ -#define SC1_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_SC1RST_Pos) /*!< SC1 reset is one of the SYS_ResetModule parameter */ -#define SC2_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_SC2RST_Pos) /*!< SC2 reset is one of the SYS_ResetModule parameter */ -#define SPI3_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_SPI3RST_Pos) /*!< SPI3 reset is one of the SYS_ResetModule parameter */ -#define USCI0_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_USCI0RST_Pos) /*!< USCI0 reset is one of the SYS_ResetModule parameter */ -#define USCI1_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_USCI1RST_Pos) /*!< USCI1 reset is one of the SYS_ResetModule parameter */ -#define DAC_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_DACRST_Pos) /*!< DAC reset is one of the SYS_ResetModule parameter */ -#define EPWM0_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_EPWM0RST_Pos) /*!< EPWM0 reset is one of the SYS_ResetModule parameter */ -#define EPWM1_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_EPWM1RST_Pos) /*!< EPWM1 reset is one of the SYS_ResetModule parameter */ -#define BPWM0_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_BPWM0RST_Pos) /*!< BPWM0 reset is one of the SYS_ResetModule parameter */ -#define BPWM1_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_BPWM1RST_Pos) /*!< BPWM1 reset is one of the SYS_ResetModule parameter */ -#define QEI0_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_QEI0RST_Pos) /*!< QEI0 reset is one of the SYS_ResetModule parameter */ -#define QEI1_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_QEI1RST_Pos) /*!< QEI1 reset is one of the SYS_ResetModule parameter */ -#define ECAP0_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_ECAP0RST_Pos) /*!< ECAP0 reset is one of the SYS_ResetModule parameter */ -#define ECAP1_RST ((0x8UL<<24)|(uint32_t)SYS_IPRST2_ECAP1RST_Pos) /*!< ECAP1 reset is one of the SYS_ResetModule parameter */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brown Out Detector Threshold Voltage Selection constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_BODCTL_BOD_RST_EN (1UL<GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA0MFP_Msk)) | SYS_GPA_MFPL_PA0MFP_UART0_RXD; - SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA1MFP_Msk)) | SYS_GPA_MFPL_PA1MFP_UART0_TXD; -*/ - - -/* PA.0 MFP */ -#define SYS_GPA_MFPL_PA0MFP_GPIO (0x0UL<GPB_MFPL = (SYS->GPB_MFPL & (~ACMP0_N_PB3_Msk)) | ACMP0_N_PB3 /*!< Set PB3 function to ACMP0_N */ -#define SET_ACMP0_O_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~ACMP0_O_PB7_Msk)) | ACMP0_O_PB7 /*!< Set PB7 function to ACMP0_O */ -#define SET_ACMP0_O_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~ACMP0_O_PC1_Msk)) | ACMP0_O_PC1 /*!< Set PC1 function to ACMP0_O */ -#define SET_ACMP0_O_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~ACMP0_O_PC12_Msk)) | ACMP0_O_PC12 /*!< Set PC12 function to ACMP0_O */ -#define SET_ACMP0_P0_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~ACMP0_P0_PA11_Msk)) | ACMP0_P0_PA11 /*!< Set PA11 function to ACMP0_P0 */ -#define SET_ACMP0_P1_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~ACMP0_P1_PB2_Msk)) | ACMP0_P1_PB2 /*!< Set PB2 function to ACMP0_P1 */ -#define SET_ACMP0_P2_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~ACMP0_P2_PB12_Msk)) | ACMP0_P2_PB12 /*!< Set PB12 function to ACMP0_P2 */ -#define SET_ACMP0_P3_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~ACMP0_P3_PB13_Msk)) | ACMP0_P3_PB13 /*!< Set PB13 function to ACMP0_P3 */ -#define SET_ACMP0_WLAT_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~ACMP0_WLAT_PA7_Msk)) | ACMP0_WLAT_PA7 /*!< Set PA7 function to ACMP0_WLAT */ -#define SET_ACMP1_N_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~ACMP1_N_PB5_Msk)) | ACMP1_N_PB5 /*!< Set PB5 function to ACMP1_N */ -#define SET_ACMP1_O_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~ACMP1_O_PB6_Msk)) | ACMP1_O_PB6 /*!< Set PB6 function to ACMP1_O */ -#define SET_ACMP1_O_PC11() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~ACMP1_O_PC11_Msk)) | ACMP1_O_PC11 /*!< Set PC11 function to ACMP1_O */ -#define SET_ACMP1_O_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~ACMP1_O_PC0_Msk)) | ACMP1_O_PC0 /*!< Set PC0 function to ACMP1_O */ -#define SET_ACMP1_P0_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~ACMP1_P0_PA10_Msk)) | ACMP1_P0_PA10 /*!< Set PA10 function to ACMP1_P0 */ -#define SET_ACMP1_P1_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~ACMP1_P1_PB4_Msk)) | ACMP1_P1_PB4 /*!< Set PB4 function to ACMP1_P1 */ -#define SET_ACMP1_P2_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~ACMP1_P2_PB12_Msk)) | ACMP1_P2_PB12 /*!< Set PB12 function to ACMP1_P2 */ -#define SET_ACMP1_P3_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~ACMP1_P3_PB13_Msk)) | ACMP1_P3_PB13 /*!< Set PB13 function to ACMP1_P3 */ -#define SET_ACMP1_WLAT_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~ACMP1_WLAT_PA6_Msk)) | ACMP1_WLAT_PA6 /*!< Set PA6 function to ACMP1_WLAT */ -#define SET_BPWM0_CH0_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM0_CH0_PA0_Msk)) | BPWM0_CH0_PA0 /*!< Set PA0 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM0_CH0_PA11_Msk)) | BPWM0_CH0_PA11 /*!< Set PA11 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~BPWM0_CH0_PE2_Msk)) | BPWM0_CH0_PE2 /*!< Set PE2 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PG14() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~BPWM0_CH0_PG14_Msk)) | BPWM0_CH0_PG14 /*!< Set PG14 function to BPWM0_CH0 */ -#define SET_BPWM0_CH1_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM0_CH1_PA1_Msk)) | BPWM0_CH1_PA1 /*!< Set PA1 function to BPWM0_CH1 */ -#define SET_BPWM0_CH1_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~BPWM0_CH1_PE3_Msk)) | BPWM0_CH1_PE3 /*!< Set PE3 function to BPWM0_CH1 */ -#define SET_BPWM0_CH1_PG13() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~BPWM0_CH1_PG13_Msk)) | BPWM0_CH1_PG13 /*!< Set PG13 function to BPWM0_CH1 */ -#define SET_BPWM0_CH1_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM0_CH1_PA10_Msk)) | BPWM0_CH1_PA10 /*!< Set PA10 function to BPWM0_CH1 */ -#define SET_BPWM0_CH2_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~BPWM0_CH2_PE4_Msk)) | BPWM0_CH2_PE4 /*!< Set PE4 function to BPWM0_CH2 */ -#define SET_BPWM0_CH2_PG12() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~BPWM0_CH2_PG12_Msk)) | BPWM0_CH2_PG12 /*!< Set PG12 function to BPWM0_CH2 */ -#define SET_BPWM0_CH2_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM0_CH2_PA2_Msk)) | BPWM0_CH2_PA2 /*!< Set PA2 function to BPWM0_CH2 */ -#define SET_BPWM0_CH2_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM0_CH2_PA9_Msk)) | BPWM0_CH2_PA9 /*!< Set PA9 function to BPWM0_CH2 */ -#define SET_BPWM0_CH3_PG11() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~BPWM0_CH3_PG11_Msk)) | BPWM0_CH3_PG11 /*!< Set PG11 function to BPWM0_CH3 */ -#define SET_BPWM0_CH3_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM0_CH3_PA3_Msk)) | BPWM0_CH3_PA3 /*!< Set PA3 function to BPWM0_CH3 */ -#define SET_BPWM0_CH3_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM0_CH3_PA8_Msk)) | BPWM0_CH3_PA8 /*!< Set PA8 function to BPWM0_CH3 */ -#define SET_BPWM0_CH3_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~BPWM0_CH3_PE5_Msk)) | BPWM0_CH3_PE5 /*!< Set PE5 function to BPWM0_CH3 */ -#define SET_BPWM0_CH4_PG10() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~BPWM0_CH4_PG10_Msk)) | BPWM0_CH4_PG10 /*!< Set PG10 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM0_CH4_PA4_Msk)) | BPWM0_CH4_PA4 /*!< Set PA4 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~BPWM0_CH4_PC13_Msk)) | BPWM0_CH4_PC13 /*!< Set PC13 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~BPWM0_CH4_PE6_Msk)) | BPWM0_CH4_PE6 /*!< Set PE6 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PF5() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~BPWM0_CH4_PF5_Msk)) | BPWM0_CH4_PF5 /*!< Set PF5 function to BPWM0_CH4 */ -#define SET_BPWM0_CH5_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM0_CH5_PA5_Msk)) | BPWM0_CH5_PA5 /*!< Set PA5 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PE7() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~BPWM0_CH5_PE7_Msk)) | BPWM0_CH5_PE7 /*!< Set PE7 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PF4() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~BPWM0_CH5_PF4_Msk)) | BPWM0_CH5_PF4 /*!< Set PF4 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PD12() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~BPWM0_CH5_PD12_Msk)) | BPWM0_CH5_PD12 /*!< Set PD12 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PG9() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~BPWM0_CH5_PG9_Msk)) | BPWM0_CH5_PG9 /*!< Set PG9 function to BPWM0_CH5 */ -#define SET_BPWM1_CH0_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~BPWM1_CH0_PB11_Msk)) | BPWM1_CH0_PB11 /*!< Set PB11 function to BPWM1_CH0 */ -#define SET_BPWM1_CH0_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~BPWM1_CH0_PC7_Msk)) | BPWM1_CH0_PC7 /*!< Set PC7 function to BPWM1_CH0 */ -#define SET_BPWM1_CH0_PF0() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~BPWM1_CH0_PF0_Msk)) | BPWM1_CH0_PF0 /*!< Set PF0 function to BPWM1_CH0 */ -#define SET_BPWM1_CH0_PF3() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~BPWM1_CH0_PF3_Msk)) | BPWM1_CH0_PF3 /*!< Set PF3 function to BPWM1_CH0 */ -#define SET_BPWM1_CH1_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~BPWM1_CH1_PC6_Msk)) | BPWM1_CH1_PC6 /*!< Set PC6 function to BPWM1_CH1 */ -#define SET_BPWM1_CH1_PF1() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~BPWM1_CH1_PF1_Msk)) | BPWM1_CH1_PF1 /*!< Set PF1 function to BPWM1_CH1 */ -#define SET_BPWM1_CH1_PF2() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~BPWM1_CH1_PF2_Msk)) | BPWM1_CH1_PF2 /*!< Set PF2 function to BPWM1_CH1 */ -#define SET_BPWM1_CH1_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~BPWM1_CH1_PB10_Msk)) | BPWM1_CH1_PB10 /*!< Set PB10 function to BPWM1_CH1 */ -#define SET_BPWM1_CH2_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~BPWM1_CH2_PB9_Msk)) | BPWM1_CH2_PB9 /*!< Set PB9 function to BPWM1_CH2 */ -#define SET_BPWM1_CH2_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM1_CH2_PA7_Msk)) | BPWM1_CH2_PA7 /*!< Set PA7 function to BPWM1_CH2 */ -#define SET_BPWM1_CH2_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM1_CH2_PA12_Msk)) | BPWM1_CH2_PA12 /*!< Set PA12 function to BPWM1_CH2 */ -#define SET_BPWM1_CH3_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~BPWM1_CH3_PA6_Msk)) | BPWM1_CH3_PA6 /*!< Set PA6 function to BPWM1_CH3 */ -#define SET_BPWM1_CH3_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM1_CH3_PA13_Msk)) | BPWM1_CH3_PA13 /*!< Set PA13 function to BPWM1_CH3 */ -#define SET_BPWM1_CH3_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~BPWM1_CH3_PB8_Msk)) | BPWM1_CH3_PB8 /*!< Set PB8 function to BPWM1_CH3 */ -#define SET_BPWM1_CH4_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM1_CH4_PA14_Msk)) | BPWM1_CH4_PA14 /*!< Set PA14 function to BPWM1_CH4 */ -#define SET_BPWM1_CH4_PC8() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~BPWM1_CH4_PC8_Msk)) | BPWM1_CH4_PC8 /*!< Set PC8 function to BPWM1_CH4 */ -#define SET_BPWM1_CH4_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~BPWM1_CH4_PB7_Msk)) | BPWM1_CH4_PB7 /*!< Set PB7 function to BPWM1_CH4 */ -#define SET_BPWM1_CH5_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~BPWM1_CH5_PA15_Msk)) | BPWM1_CH5_PA15 /*!< Set PA15 function to BPWM1_CH5 */ -#define SET_BPWM1_CH5_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~BPWM1_CH5_PB6_Msk)) | BPWM1_CH5_PB6 /*!< Set PB6 function to BPWM1_CH5 */ -#define SET_BPWM1_CH5_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~BPWM1_CH5_PE13_Msk)) | BPWM1_CH5_PE13 /*!< Set PE13 function to BPWM1_CH5 */ -#define SET_CAN0_RXD_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~CAN0_RXD_PA13_Msk)) | CAN0_RXD_PA13 /*!< Set PA13 function to CAN0_RXD */ -#define SET_CAN0_RXD_PD10() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~CAN0_RXD_PD10_Msk)) | CAN0_RXD_PD10 /*!< Set PD10 function to CAN0_RXD */ -#define SET_CAN0_RXD_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~CAN0_RXD_PA4_Msk)) | CAN0_RXD_PA4 /*!< Set PA4 function to CAN0_RXD */ -#define SET_CAN0_RXD_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~CAN0_RXD_PC4_Msk)) | CAN0_RXD_PC4 /*!< Set PC4 function to CAN0_RXD */ -#define SET_CAN0_RXD_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~CAN0_RXD_PB10_Msk)) | CAN0_RXD_PB10 /*!< Set PB10 function to CAN0_RXD */ -#define SET_CAN0_RXD_PE15() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~CAN0_RXD_PE15_Msk)) | CAN0_RXD_PE15 /*!< Set PE15 function to CAN0_RXD */ -#define SET_CAN0_TXD_PD11() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~CAN0_TXD_PD11_Msk)) | CAN0_TXD_PD11 /*!< Set PD11 function to CAN0_TXD */ -#define SET_CAN0_TXD_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~CAN0_TXD_PC5_Msk)) | CAN0_TXD_PC5 /*!< Set PC5 function to CAN0_TXD */ -#define SET_CAN0_TXD_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~CAN0_TXD_PB11_Msk)) | CAN0_TXD_PB11 /*!< Set PB11 function to CAN0_TXD */ -#define SET_CAN0_TXD_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~CAN0_TXD_PA12_Msk)) | CAN0_TXD_PA12 /*!< Set PA12 function to CAN0_TXD */ -#define SET_CAN0_TXD_PE14() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~CAN0_TXD_PE14_Msk)) | CAN0_TXD_PE14 /*!< Set PE14 function to CAN0_TXD */ -#define SET_CAN0_TXD_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~CAN0_TXD_PA5_Msk)) | CAN0_TXD_PA5 /*!< Set PA5 function to CAN0_TXD */ -#define SET_CLKO_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~CLKO_PC13_Msk)) | CLKO_PC13 /*!< Set PC13 function to CLKO */ -#define SET_CLKO_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~CLKO_PB14_Msk)) | CLKO_PB14 /*!< Set PB14 function to CLKO */ -#define SET_CLKO_PD12() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~CLKO_PD12_Msk)) | CLKO_PD12 /*!< Set PD12 function to CLKO */ -#define SET_CLKO_PG15() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~CLKO_PG15_Msk)) | CLKO_PG15 /*!< Set PG15 function to CLKO */ -#define SET_DAC0_OUT_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~DAC0_OUT_PB12_Msk)) | DAC0_OUT_PB12 /*!< Set PB12 function to DAC0_OUT */ -#define SET_DAC0_OUT_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~DAC0_OUT_PB12_Msk)) | DAC0_OUT_PB12 /*!< Set PB12 function to DAC0_OUT */ -#define SET_DAC0_ST_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~DAC0_ST_PA0_Msk)) | DAC0_ST_PA0 /*!< Set PA0 function to DAC0_ST */ -#define SET_DAC0_ST_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~DAC0_ST_PA10_Msk)) | DAC0_ST_PA10 /*!< Set PA10 function to DAC0_ST */ -#define SET_DAC1_OUT_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~DAC1_OUT_PB13_Msk)) | DAC1_OUT_PB13 /*!< Set PB13 function to DAC1_OUT */ -#define SET_DAC1_OUT_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~DAC1_OUT_PB13_Msk)) | DAC1_OUT_PB13 /*!< Set PB13 function to DAC1_OUT */ -#define SET_DAC1_ST_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~DAC1_ST_PA1_Msk)) | DAC1_ST_PA1 /*!< Set PA1 function to DAC1_ST */ -#define SET_DAC1_ST_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~DAC1_ST_PA11_Msk)) | DAC1_ST_PA11 /*!< Set PA11 function to DAC1_ST */ -#define SET_EADC0_CH0_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH0_PB0_Msk)) | EADC0_CH0_PB0 /*!< Set PB0 function to EADC0_CH0 */ -#define SET_EADC0_CH1_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH1_PB1_Msk)) | EADC0_CH1_PB1 /*!< Set PB1 function to EADC0_CH1 */ -#define SET_EADC0_CH10_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH10_PB10_Msk)) | EADC0_CH10_PB10 /*!< Set PB10 function to EADC0_CH10 */ -#define SET_EADC0_CH11_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH11_PB11_Msk)) | EADC0_CH11_PB11 /*!< Set PB11 function to EADC0_CH11 */ -#define SET_EADC0_CH12_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH12_PB12_Msk)) | EADC0_CH12_PB12 /*!< Set PB12 function to EADC0_CH12 */ -#define SET_EADC0_CH13_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH13_PB13_Msk)) | EADC0_CH13_PB13 /*!< Set PB13 function to EADC0_CH13 */ -#define SET_EADC0_CH14_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH14_PB14_Msk)) | EADC0_CH14_PB14 /*!< Set PB14 function to EADC0_CH14 */ -#define SET_EADC0_CH15_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH15_PB15_Msk)) | EADC0_CH15_PB15 /*!< Set PB15 function to EADC0_CH15 */ -#define SET_EADC0_CH15_PD10() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EADC0_CH15_PD10_Msk)) | EADC0_CH15_PD10 /*!< Set PD10 function to EADC0_CH15 */ -#define SET_EADC0_CH2_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH2_PB2_Msk)) | EADC0_CH2_PB2 /*!< Set PB2 function to EADC0_CH2 */ -#define SET_EADC0_CH3_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH3_PB3_Msk)) | EADC0_CH3_PB3 /*!< Set PB3 function to EADC0_CH3 */ -#define SET_EADC0_CH4_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH4_PB4_Msk)) | EADC0_CH4_PB4 /*!< Set PB4 function to EADC0_CH4 */ -#define SET_EADC0_CH5_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH5_PB5_Msk)) | EADC0_CH5_PB5 /*!< Set PB5 function to EADC0_CH5 */ -#define SET_EADC0_CH6_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH6_PB6_Msk)) | EADC0_CH6_PB6 /*!< Set PB6 function to EADC0_CH6 */ -#define SET_EADC0_CH7_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EADC0_CH7_PB7_Msk)) | EADC0_CH7_PB7 /*!< Set PB7 function to EADC0_CH7 */ -#define SET_EADC0_CH8_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH8_PB8_Msk)) | EADC0_CH8_PB8 /*!< Set PB8 function to EADC0_CH8 */ -#define SET_EADC0_CH9_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EADC0_CH9_PB9_Msk)) | EADC0_CH9_PB9 /*!< Set PB9 function to EADC0_CH9 */ -#define SET_EADC0_ST_PF5() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EADC0_ST_PF5_Msk)) | EADC0_ST_PF5 /*!< Set PF5 function to EADC0_ST */ -#define SET_EADC0_ST_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EADC0_ST_PC13_Msk)) | EADC0_ST_PC13 /*!< Set PC13 function to EADC0_ST */ -#define SET_EADC0_ST_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EADC0_ST_PC1_Msk)) | EADC0_ST_PC1 /*!< Set PC1 function to EADC0_ST */ -#define SET_EADC0_ST_PD12() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EADC0_ST_PD12_Msk)) | EADC0_ST_PD12 /*!< Set PD12 function to EADC0_ST */ -#define SET_EADC0_ST_PG15() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~EADC0_ST_PG15_Msk)) | EADC0_ST_PG15 /*!< Set PG15 function to EADC0_ST */ -#define SET_EBI_AD0_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD0_PC0_Msk)) | EBI_AD0_PC0 /*!< Set PC0 function to EBI_AD0 */ -#define SET_EBI_AD0_PG9() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~EBI_AD0_PG9_Msk)) | EBI_AD0_PG9 /*!< Set PG9 function to EBI_AD0 */ -#define SET_EBI_AD1_PG10() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~EBI_AD1_PG10_Msk)) | EBI_AD1_PG10 /*!< Set PG10 function to EBI_AD1 */ -#define SET_EBI_AD1_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD1_PC1_Msk)) | EBI_AD1_PC1 /*!< Set PC1 function to EBI_AD1 */ -#define SET_EBI_AD10_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EBI_AD10_PE1_Msk)) | EBI_AD10_PE1 /*!< Set PE1 function to EBI_AD10 */ -#define SET_EBI_AD10_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~EBI_AD10_PD3_Msk)) | EBI_AD10_PD3 /*!< Set PD3 function to EBI_AD10 */ -#define SET_EBI_AD10_PD13() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EBI_AD10_PD13_Msk)) | EBI_AD10_PD13 /*!< Set PD13 function to EBI_AD10 */ -#define SET_EBI_AD11_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EBI_AD11_PE0_Msk)) | EBI_AD11_PE0 /*!< Set PE0 function to EBI_AD11 */ -#define SET_EBI_AD11_PD2() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~EBI_AD11_PD2_Msk)) | EBI_AD11_PD2 /*!< Set PD2 function to EBI_AD11 */ -#define SET_EBI_AD12_PD1() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~EBI_AD12_PD1_Msk)) | EBI_AD12_PD1 /*!< Set PD1 function to EBI_AD12 */ -#define SET_EBI_AD12_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_AD12_PB15_Msk)) | EBI_AD12_PB15 /*!< Set PB15 function to EBI_AD12 */ -#define SET_EBI_AD12_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~EBI_AD12_PH8_Msk)) | EBI_AD12_PH8 /*!< Set PH8 function to EBI_AD12 */ -#define SET_EBI_AD13_PD0() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~EBI_AD13_PD0_Msk)) | EBI_AD13_PD0 /*!< Set PD0 function to EBI_AD13 */ -#define SET_EBI_AD13_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_AD13_PB14_Msk)) | EBI_AD13_PB14 /*!< Set PB14 function to EBI_AD13 */ -#define SET_EBI_AD13_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~EBI_AD13_PH9_Msk)) | EBI_AD13_PH9 /*!< Set PH9 function to EBI_AD13 */ -#define SET_EBI_AD14_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_AD14_PB13_Msk)) | EBI_AD14_PB13 /*!< Set PB13 function to EBI_AD14 */ -#define SET_EBI_AD14_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~EBI_AD14_PH10_Msk)) | EBI_AD14_PH10 /*!< Set PH10 function to EBI_AD14 */ -#define SET_EBI_AD15_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_AD15_PB12_Msk)) | EBI_AD15_PB12 /*!< Set PB12 function to EBI_AD15 */ -#define SET_EBI_AD15_PH11() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~EBI_AD15_PH11_Msk)) | EBI_AD15_PH11 /*!< Set PH11 function to EBI_AD15 */ -#define SET_EBI_AD2_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD2_PC2_Msk)) | EBI_AD2_PC2 /*!< Set PC2 function to EBI_AD2 */ -#define SET_EBI_AD2_PG11() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~EBI_AD2_PG11_Msk)) | EBI_AD2_PG11 /*!< Set PG11 function to EBI_AD2 */ -#define SET_EBI_AD3_PG12() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~EBI_AD3_PG12_Msk)) | EBI_AD3_PG12 /*!< Set PG12 function to EBI_AD3 */ -#define SET_EBI_AD3_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD3_PC3_Msk)) | EBI_AD3_PC3 /*!< Set PC3 function to EBI_AD3 */ -#define SET_EBI_AD4_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD4_PC4_Msk)) | EBI_AD4_PC4 /*!< Set PC4 function to EBI_AD4 */ -#define SET_EBI_AD4_PG13() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~EBI_AD4_PG13_Msk)) | EBI_AD4_PG13 /*!< Set PG13 function to EBI_AD4 */ -#define SET_EBI_AD5_PG14() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~EBI_AD5_PG14_Msk)) | EBI_AD5_PG14 /*!< Set PG14 function to EBI_AD5 */ -#define SET_EBI_AD5_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD5_PC5_Msk)) | EBI_AD5_PC5 /*!< Set PC5 function to EBI_AD5 */ -#define SET_EBI_AD6_PD8() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EBI_AD6_PD8_Msk)) | EBI_AD6_PD8 /*!< Set PD8 function to EBI_AD6 */ -#define SET_EBI_AD6_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EBI_AD6_PA6_Msk)) | EBI_AD6_PA6 /*!< Set PA6 function to EBI_AD6 */ -#define SET_EBI_AD7_PD9() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EBI_AD7_PD9_Msk)) | EBI_AD7_PD9 /*!< Set PD9 function to EBI_AD7 */ -#define SET_EBI_AD7_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EBI_AD7_PA7_Msk)) | EBI_AD7_PA7 /*!< Set PA7 function to EBI_AD7 */ -#define SET_EBI_AD8_PE14() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_AD8_PE14_Msk)) | EBI_AD8_PE14 /*!< Set PE14 function to EBI_AD8 */ -#define SET_EBI_AD8_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD8_PC6_Msk)) | EBI_AD8_PC6 /*!< Set PC6 function to EBI_AD8 */ -#define SET_EBI_AD9_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EBI_AD9_PC7_Msk)) | EBI_AD9_PC7 /*!< Set PC7 function to EBI_AD9 */ -#define SET_EBI_AD9_PE15() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_AD9_PE15_Msk)) | EBI_AD9_PE15 /*!< Set PE15 function to EBI_AD9 */ -#define SET_EBI_ADR0_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_ADR0_PB5_Msk)) | EBI_ADR0_PB5 /*!< Set PB5 function to EBI_ADR0 */ -#define SET_EBI_ADR0_PH7() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~EBI_ADR0_PH7_Msk)) | EBI_ADR0_PH7 /*!< Set PH7 function to EBI_ADR0 */ -#define SET_EBI_ADR1_PH6() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~EBI_ADR1_PH6_Msk)) | EBI_ADR1_PH6 /*!< Set PH6 function to EBI_ADR1 */ -#define SET_EBI_ADR1_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_ADR1_PB4_Msk)) | EBI_ADR1_PB4 /*!< Set PB4 function to EBI_ADR1 */ -#define SET_EBI_ADR10_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EBI_ADR10_PC13_Msk)) | EBI_ADR10_PC13 /*!< Set PC13 function to EBI_ADR10 */ -#define SET_EBI_ADR10_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_ADR10_PE8_Msk)) | EBI_ADR10_PE8 /*!< Set PE8 function to EBI_ADR10 */ -#define SET_EBI_ADR11_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_ADR11_PE9_Msk)) | EBI_ADR11_PE9 /*!< Set PE9 function to EBI_ADR11 */ -#define SET_EBI_ADR11_PG2() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~EBI_ADR11_PG2_Msk)) | EBI_ADR11_PG2 /*!< Set PG2 function to EBI_ADR11 */ -#define SET_EBI_ADR12_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_ADR12_PE10_Msk)) | EBI_ADR12_PE10 /*!< Set PE10 function to EBI_ADR12 */ -#define SET_EBI_ADR12_PG3() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~EBI_ADR12_PG3_Msk)) | EBI_ADR12_PG3 /*!< Set PG3 function to EBI_ADR12 */ -#define SET_EBI_ADR13_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_ADR13_PE11_Msk)) | EBI_ADR13_PE11 /*!< Set PE11 function to EBI_ADR13 */ -#define SET_EBI_ADR13_PG4() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~EBI_ADR13_PG4_Msk)) | EBI_ADR13_PG4 /*!< Set PG4 function to EBI_ADR13 */ -#define SET_EBI_ADR14_PF11() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~EBI_ADR14_PF11_Msk)) | EBI_ADR14_PF11 /*!< Set PF11 function to EBI_ADR14 */ -#define SET_EBI_ADR14_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_ADR14_PE12_Msk)) | EBI_ADR14_PE12 /*!< Set PE12 function to EBI_ADR14 */ -#define SET_EBI_ADR15_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EBI_ADR15_PE13_Msk)) | EBI_ADR15_PE13 /*!< Set PE13 function to EBI_ADR15 */ -#define SET_EBI_ADR15_PF10() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~EBI_ADR15_PF10_Msk)) | EBI_ADR15_PF10 /*!< Set PF10 function to EBI_ADR15 */ -#define SET_EBI_ADR16_PC8() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EBI_ADR16_PC8_Msk)) | EBI_ADR16_PC8 /*!< Set PC8 function to EBI_ADR16 */ -#define SET_EBI_ADR16_PF9() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~EBI_ADR16_PF9_Msk)) | EBI_ADR16_PF9 /*!< Set PF9 function to EBI_ADR16 */ -#define SET_EBI_ADR16_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_ADR16_PB11_Msk)) | EBI_ADR16_PB11 /*!< Set PB11 function to EBI_ADR16 */ -#define SET_EBI_ADR17_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_ADR17_PB10_Msk)) | EBI_ADR17_PB10 /*!< Set PB10 function to EBI_ADR17 */ -#define SET_EBI_ADR17_PF8() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~EBI_ADR17_PF8_Msk)) | EBI_ADR17_PF8 /*!< Set PF8 function to EBI_ADR17 */ -#define SET_EBI_ADR18_PF7() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EBI_ADR18_PF7_Msk)) | EBI_ADR18_PF7 /*!< Set PF7 function to EBI_ADR18 */ -#define SET_EBI_ADR18_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_ADR18_PB9_Msk)) | EBI_ADR18_PB9 /*!< Set PB9 function to EBI_ADR18 */ -#define SET_EBI_ADR19_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EBI_ADR19_PB8_Msk)) | EBI_ADR19_PB8 /*!< Set PB8 function to EBI_ADR19 */ -#define SET_EBI_ADR19_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EBI_ADR19_PF6_Msk)) | EBI_ADR19_PF6 /*!< Set PF6 function to EBI_ADR19 */ -#define SET_EBI_ADR2_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_ADR2_PB3_Msk)) | EBI_ADR2_PB3 /*!< Set PB3 function to EBI_ADR2 */ -#define SET_EBI_ADR2_PH5() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~EBI_ADR2_PH5_Msk)) | EBI_ADR2_PH5 /*!< Set PH5 function to EBI_ADR2 */ -#define SET_EBI_ADR3_PH4() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~EBI_ADR3_PH4_Msk)) | EBI_ADR3_PH4 /*!< Set PH4 function to EBI_ADR3 */ -#define SET_EBI_ADR3_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_ADR3_PB2_Msk)) | EBI_ADR3_PB2 /*!< Set PB2 function to EBI_ADR3 */ -#define SET_EBI_ADR4_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EBI_ADR4_PC12_Msk)) | EBI_ADR4_PC12 /*!< Set PC12 function to EBI_ADR4 */ -#define SET_EBI_ADR5_PC11() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EBI_ADR5_PC11_Msk)) | EBI_ADR5_PC11 /*!< Set PC11 function to EBI_ADR5 */ -#define SET_EBI_ADR6_PC10() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EBI_ADR6_PC10_Msk)) | EBI_ADR6_PC10 /*!< Set PC10 function to EBI_ADR6 */ -#define SET_EBI_ADR7_PC9() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EBI_ADR7_PC9_Msk)) | EBI_ADR7_PC9 /*!< Set PC9 function to EBI_ADR7 */ -#define SET_EBI_ADR8_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_ADR8_PB1_Msk)) | EBI_ADR8_PB1 /*!< Set PB1 function to EBI_ADR8 */ -#define SET_EBI_ADR9_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_ADR9_PB0_Msk)) | EBI_ADR9_PB0 /*!< Set PB0 function to EBI_ADR9 */ -#define SET_EBI_ALE_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EBI_ALE_PE2_Msk)) | EBI_ALE_PE2 /*!< Set PE2 function to EBI_ALE */ -#define SET_EBI_ALE_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~EBI_ALE_PA8_Msk)) | EBI_ALE_PA8 /*!< Set PA8 function to EBI_ALE */ -#define SET_EBI_MCLK_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~EBI_MCLK_PA9_Msk)) | EBI_MCLK_PA9 /*!< Set PA9 function to EBI_MCLK */ -#define SET_EBI_MCLK_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EBI_MCLK_PE3_Msk)) | EBI_MCLK_PE3 /*!< Set PE3 function to EBI_MCLK */ -#define SET_EBI_nCS0_PD12() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EBI_nCS0_PD12_Msk)) | EBI_nCS0_PD12 /*!< Set PD12 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PD14() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EBI_nCS0_PD14_Msk)) | EBI_nCS0_PD14 /*!< Set PD14 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PF3() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EBI_nCS0_PF3_Msk)) | EBI_nCS0_PF3 /*!< Set PF3 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_nCS0_PB7_Msk)) | EBI_nCS0_PB7 /*!< Set PB7 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EBI_nCS0_PF6_Msk)) | EBI_nCS0_PF6 /*!< Set PF6 function to EBI_nCS0 */ -#define SET_EBI_nCS1_PF2() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EBI_nCS1_PF2_Msk)) | EBI_nCS1_PF2 /*!< Set PF2 function to EBI_nCS1 */ -#define SET_EBI_nCS1_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_nCS1_PB6_Msk)) | EBI_nCS1_PB6 /*!< Set PB6 function to EBI_nCS1 */ -#define SET_EBI_nCS1_PD11() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EBI_nCS1_PD11_Msk)) | EBI_nCS1_PD11 /*!< Set PD11 function to EBI_nCS1 */ -#define SET_EBI_nCS2_PD10() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EBI_nCS2_PD10_Msk)) | EBI_nCS2_PD10 /*!< Set PD10 function to EBI_nCS2 */ -#define SET_EBI_nRD_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EBI_nRD_PE5_Msk)) | EBI_nRD_PE5 /*!< Set PE5 function to EBI_nRD */ -#define SET_EBI_nRD_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~EBI_nRD_PA11_Msk)) | EBI_nRD_PA11 /*!< Set PA11 function to EBI_nRD */ -#define SET_EBI_nWR_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EBI_nWR_PE4_Msk)) | EBI_nWR_PE4 /*!< Set PE4 function to EBI_nWR */ -#define SET_EBI_nWR_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~EBI_nWR_PA10_Msk)) | EBI_nWR_PA10 /*!< Set PA10 function to EBI_nWR */ -#define SET_EBI_nWRH_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_nWRH_PB6_Msk)) | EBI_nWRH_PB6 /*!< Set PB6 function to EBI_nWRH */ -#define SET_EBI_nWRL_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EBI_nWRL_PB7_Msk)) | EBI_nWRL_PB7 /*!< Set PB7 function to EBI_nWRL */ -#define SET_ECAP0_IC0_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~ECAP0_IC0_PE8_Msk)) | ECAP0_IC0_PE8 /*!< Set PE8 function to ECAP0_IC0 */ -#define SET_ECAP0_IC0_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~ECAP0_IC0_PA10_Msk)) | ECAP0_IC0_PA10 /*!< Set PA10 function to ECAP0_IC0 */ -#define SET_ECAP0_IC1_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~ECAP0_IC1_PA9_Msk)) | ECAP0_IC1_PA9 /*!< Set PA9 function to ECAP0_IC1 */ -#define SET_ECAP0_IC1_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~ECAP0_IC1_PE9_Msk)) | ECAP0_IC1_PE9 /*!< Set PE9 function to ECAP0_IC1 */ -#define SET_ECAP0_IC2_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~ECAP0_IC2_PE10_Msk)) | ECAP0_IC2_PE10 /*!< Set PE10 function to ECAP0_IC2 */ -#define SET_ECAP0_IC2_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~ECAP0_IC2_PA8_Msk)) | ECAP0_IC2_PA8 /*!< Set PA8 function to ECAP0_IC2 */ -#define SET_ECAP1_IC0_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~ECAP1_IC0_PE13_Msk)) | ECAP1_IC0_PE13 /*!< Set PE13 function to ECAP1_IC0 */ -#define SET_ECAP1_IC0_PC10() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~ECAP1_IC0_PC10_Msk)) | ECAP1_IC0_PC10 /*!< Set PC10 function to ECAP1_IC0 */ -#define SET_ECAP1_IC1_PC11() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~ECAP1_IC1_PC11_Msk)) | ECAP1_IC1_PC11 /*!< Set PC11 function to ECAP1_IC1 */ -#define SET_ECAP1_IC1_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~ECAP1_IC1_PE12_Msk)) | ECAP1_IC1_PE12 /*!< Set PE12 function to ECAP1_IC1 */ -#define SET_ECAP1_IC2_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~ECAP1_IC2_PC12_Msk)) | ECAP1_IC2_PC12 /*!< Set PC12 function to ECAP1_IC2 */ -#define SET_ECAP1_IC2_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~ECAP1_IC2_PE11_Msk)) | ECAP1_IC2_PE11 /*!< Set PE11 function to ECAP1_IC2 */ -#define SET_EPWM0_BRAKE0_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_BRAKE0_PE8_Msk)) | EPWM0_BRAKE0_PE8 /*!< Set PE8 function to EPWM0_BRAKE0 */ -#define SET_EPWM0_BRAKE0_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_BRAKE0_PB1_Msk)) | EPWM0_BRAKE0_PB1 /*!< Set PB1 function to EPWM0_BRAKE0 */ -#define SET_EPWM0_BRAKE1_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EPWM0_BRAKE1_PB14_Msk)) | EPWM0_BRAKE1_PB14 /*!< Set PB14 function to EPWM0_BRAKE1 */ -#define SET_EPWM0_BRAKE1_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_BRAKE1_PE9_Msk)) | EPWM0_BRAKE1_PE9 /*!< Set PE9 function to EPWM0_BRAKE1 */ -#define SET_EPWM0_BRAKE1_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_BRAKE1_PB0_Msk)) | EPWM0_BRAKE1_PB0 /*!< Set PB0 function to EPWM0_BRAKE1 */ -#define SET_EPWM0_CH0_PF5() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EPWM0_CH0_PF5_Msk)) | EPWM0_CH0_PF5 /*!< Set PF5 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM0_CH0_PA5_Msk)) | EPWM0_CH0_PA5 /*!< Set PA5 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_CH0_PB5_Msk)) | EPWM0_CH0_PB5 /*!< Set PB5 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_CH0_PE8_Msk)) | EPWM0_CH0_PE8 /*!< Set PE8 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PE7() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EPWM0_CH0_PE7_Msk)) | EPWM0_CH0_PE7 /*!< Set PE7 function to EPWM0_CH0 */ -#define SET_EPWM0_CH1_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM0_CH1_PA4_Msk)) | EPWM0_CH1_PA4 /*!< Set PA4 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_CH1_PE9_Msk)) | EPWM0_CH1_PE9 /*!< Set PE9 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EPWM0_CH1_PE6_Msk)) | EPWM0_CH1_PE6 /*!< Set PE6 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PF4() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EPWM0_CH1_PF4_Msk)) | EPWM0_CH1_PF4 /*!< Set PF4 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_CH1_PB4_Msk)) | EPWM0_CH1_PB4 /*!< Set PB4 function to EPWM0_CH1 */ -#define SET_EPWM0_CH2_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_CH2_PE10_Msk)) | EPWM0_CH2_PE10 /*!< Set PE10 function to EPWM0_CH2 */ -#define SET_EPWM0_CH2_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EPWM0_CH2_PE5_Msk)) | EPWM0_CH2_PE5 /*!< Set PE5 function to EPWM0_CH2 */ -#define SET_EPWM0_CH2_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM0_CH2_PA3_Msk)) | EPWM0_CH2_PA3 /*!< Set PA3 function to EPWM0_CH2 */ -#define SET_EPWM0_CH2_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_CH2_PB3_Msk)) | EPWM0_CH2_PB3 /*!< Set PB3 function to EPWM0_CH2 */ -#define SET_EPWM0_CH3_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM0_CH3_PA2_Msk)) | EPWM0_CH3_PA2 /*!< Set PA2 function to EPWM0_CH3 */ -#define SET_EPWM0_CH3_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_CH3_PB2_Msk)) | EPWM0_CH3_PB2 /*!< Set PB2 function to EPWM0_CH3 */ -#define SET_EPWM0_CH3_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_CH3_PE11_Msk)) | EPWM0_CH3_PE11 /*!< Set PE11 function to EPWM0_CH3 */ -#define SET_EPWM0_CH3_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EPWM0_CH3_PE4_Msk)) | EPWM0_CH3_PE4 /*!< Set PE4 function to EPWM0_CH3 */ -#define SET_EPWM0_CH4_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EPWM0_CH4_PE3_Msk)) | EPWM0_CH4_PE3 /*!< Set PE3 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PD14() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~EPWM0_CH4_PD14_Msk)) | EPWM0_CH4_PD14 /*!< Set PD14 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM0_CH4_PA1_Msk)) | EPWM0_CH4_PA1 /*!< Set PA1 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_CH4_PE12_Msk)) | EPWM0_CH4_PE12 /*!< Set PE12 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_CH4_PB1_Msk)) | EPWM0_CH4_PB1 /*!< Set PB1 function to EPWM0_CH4 */ -#define SET_EPWM0_CH5_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM0_CH5_PA0_Msk)) | EPWM0_CH5_PA0 /*!< Set PA0 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM0_CH5_PB0_Msk)) | EPWM0_CH5_PB0 /*!< Set PB0 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM0_CH5_PE13_Msk)) | EPWM0_CH5_PE13 /*!< Set PE13 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~EPWM0_CH5_PE2_Msk)) | EPWM0_CH5_PE2 /*!< Set PE2 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PH11() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~EPWM0_CH5_PH11_Msk)) | EPWM0_CH5_PH11 /*!< Set PH11 function to EPWM0_CH5 */ -#define SET_EPWM0_SYNC_IN_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~EPWM0_SYNC_IN_PA15_Msk)) | EPWM0_SYNC_IN_PA15/*!< Set PA15 function to EPWM0_SYNC_IN */ -#define SET_EPWM0_SYNC_OUT_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~EPWM0_SYNC_OUT_PA11_Msk)) | EPWM0_SYNC_OUT_PA11/*!< Set PA11 function to EPWM0_SYNC_OUT */ -#define SET_EPWM0_SYNC_OUT_PF5() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~EPWM0_SYNC_OUT_PF5_Msk)) | EPWM0_SYNC_OUT_PF5/*!< Set PF5 function to EPWM0_SYNC_OUT */ -#define SET_EPWM1_BRAKE0_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM1_BRAKE0_PB7_Msk)) | EPWM1_BRAKE0_PB7 /*!< Set PB7 function to EPWM1_BRAKE0 */ -#define SET_EPWM1_BRAKE0_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM1_BRAKE0_PE10_Msk)) | EPWM1_BRAKE0_PE10 /*!< Set PE10 function to EPWM1_BRAKE0 */ -#define SET_EPWM1_BRAKE1_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM1_BRAKE1_PB6_Msk)) | EPWM1_BRAKE1_PB6 /*!< Set PB6 function to EPWM1_BRAKE1 */ -#define SET_EPWM1_BRAKE1_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM1_BRAKE1_PA3_Msk)) | EPWM1_BRAKE1_PA3 /*!< Set PA3 function to EPWM1_BRAKE1 */ -#define SET_EPWM1_BRAKE1_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM1_BRAKE1_PE11_Msk)) | EPWM1_BRAKE1_PE11 /*!< Set PE11 function to EPWM1_BRAKE1 */ -#define SET_EPWM1_CH0_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~EPWM1_CH0_PE13_Msk)) | EPWM1_CH0_PE13 /*!< Set PE13 function to EPWM1_CH0 */ -#define SET_EPWM1_CH0_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EPWM1_CH0_PC12_Msk)) | EPWM1_CH0_PC12 /*!< Set PC12 function to EPWM1_CH0 */ -#define SET_EPWM1_CH0_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EPWM1_CH0_PB15_Msk)) | EPWM1_CH0_PB15 /*!< Set PB15 function to EPWM1_CH0 */ -#define SET_EPWM1_CH0_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH0_PC5_Msk)) | EPWM1_CH0_PC5 /*!< Set PC5 function to EPWM1_CH0 */ -#define SET_EPWM1_CH1_PC8() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EPWM1_CH1_PC8_Msk)) | EPWM1_CH1_PC8 /*!< Set PC8 function to EPWM1_CH1 */ -#define SET_EPWM1_CH1_PC11() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EPWM1_CH1_PC11_Msk)) | EPWM1_CH1_PC11 /*!< Set PC11 function to EPWM1_CH1 */ -#define SET_EPWM1_CH1_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EPWM1_CH1_PB14_Msk)) | EPWM1_CH1_PB14 /*!< Set PB14 function to EPWM1_CH1 */ -#define SET_EPWM1_CH1_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH1_PC4_Msk)) | EPWM1_CH1_PC4 /*!< Set PC4 function to EPWM1_CH1 */ -#define SET_EPWM1_CH2_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH2_PC7_Msk)) | EPWM1_CH2_PC7 /*!< Set PC7 function to EPWM1_CH2 */ -#define SET_EPWM1_CH2_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH2_PC3_Msk)) | EPWM1_CH2_PC3 /*!< Set PC3 function to EPWM1_CH2 */ -#define SET_EPWM1_CH2_PC10() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EPWM1_CH2_PC10_Msk)) | EPWM1_CH2_PC10 /*!< Set PC10 function to EPWM1_CH2 */ -#define SET_EPWM1_CH2_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EPWM1_CH2_PB13_Msk)) | EPWM1_CH2_PB13 /*!< Set PB13 function to EPWM1_CH2 */ -#define SET_EPWM1_CH3_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH3_PC6_Msk)) | EPWM1_CH3_PC6 /*!< Set PC6 function to EPWM1_CH3 */ -#define SET_EPWM1_CH3_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH3_PC2_Msk)) | EPWM1_CH3_PC2 /*!< Set PC2 function to EPWM1_CH3 */ -#define SET_EPWM1_CH3_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~EPWM1_CH3_PB12_Msk)) | EPWM1_CH3_PB12 /*!< Set PB12 function to EPWM1_CH3 */ -#define SET_EPWM1_CH3_PC9() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~EPWM1_CH3_PC9_Msk)) | EPWM1_CH3_PC9 /*!< Set PC9 function to EPWM1_CH3 */ -#define SET_EPWM1_CH4_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH4_PC1_Msk)) | EPWM1_CH4_PC1 /*!< Set PC1 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM1_CH4_PB1_Msk)) | EPWM1_CH4_PB1 /*!< Set PB1 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM1_CH4_PB7_Msk)) | EPWM1_CH4_PB7 /*!< Set PB7 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM1_CH4_PA7_Msk)) | EPWM1_CH4_PA7 /*!< Set PA7 function to EPWM1_CH4 */ -#define SET_EPWM1_CH5_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM1_CH5_PB6_Msk)) | EPWM1_CH5_PB6 /*!< Set PB6 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~EPWM1_CH5_PC0_Msk)) | EPWM1_CH5_PC0 /*!< Set PC0 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~EPWM1_CH5_PB0_Msk)) | EPWM1_CH5_PB0 /*!< Set PB0 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~EPWM1_CH5_PA6_Msk)) | EPWM1_CH5_PA6 /*!< Set PA6 function to EPWM1_CH5 */ -#define SET_I2C0_SCL_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~I2C0_SCL_PE13_Msk)) | I2C0_SCL_PE13 /*!< Set PE13 function to I2C0_SCL */ -#define SET_I2C0_SCL_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C0_SCL_PB9_Msk)) | I2C0_SCL_PB9 /*!< Set PB9 function to I2C0_SCL */ -#define SET_I2C0_SCL_PD7() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~I2C0_SCL_PD7_Msk)) | I2C0_SCL_PD7 /*!< Set PD7 function to I2C0_SCL */ -#define SET_I2C0_SCL_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C0_SCL_PA5_Msk)) | I2C0_SCL_PA5 /*!< Set PA5 function to I2C0_SCL */ -#define SET_I2C0_SCL_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2C0_SCL_PB5_Msk)) | I2C0_SCL_PB5 /*!< Set PB5 function to I2C0_SCL */ -#define SET_I2C0_SCL_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C0_SCL_PC1_Msk)) | I2C0_SCL_PC1 /*!< Set PC1 function to I2C0_SCL */ -#define SET_I2C0_SCL_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~I2C0_SCL_PC12_Msk)) | I2C0_SCL_PC12 /*!< Set PC12 function to I2C0_SCL */ -#define SET_I2C0_SCL_PF3() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~I2C0_SCL_PF3_Msk)) | I2C0_SCL_PF3 /*!< Set PF3 function to I2C0_SCL */ -#define SET_I2C0_SDA_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2C0_SDA_PB4_Msk)) | I2C0_SDA_PB4 /*!< Set PB4 function to I2C0_SDA */ -#define SET_I2C0_SDA_PD6() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~I2C0_SDA_PD6_Msk)) | I2C0_SDA_PD6 /*!< Set PD6 function to I2C0_SDA */ -#define SET_I2C0_SDA_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C0_SDA_PB8_Msk)) | I2C0_SDA_PB8 /*!< Set PB8 function to I2C0_SDA */ -#define SET_I2C0_SDA_PC11() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~I2C0_SDA_PC11_Msk)) | I2C0_SDA_PC11 /*!< Set PC11 function to I2C0_SDA */ -#define SET_I2C0_SDA_PF2() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~I2C0_SDA_PF2_Msk)) | I2C0_SDA_PF2 /*!< Set PF2 function to I2C0_SDA */ -#define SET_I2C0_SDA_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C0_SDA_PC0_Msk)) | I2C0_SDA_PC0 /*!< Set PC0 function to I2C0_SDA */ -#define SET_I2C0_SDA_PC8() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~I2C0_SDA_PC8_Msk)) | I2C0_SDA_PC8 /*!< Set PC8 function to I2C0_SDA */ -#define SET_I2C0_SDA_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C0_SDA_PA4_Msk)) | I2C0_SDA_PA4 /*!< Set PA4 function to I2C0_SDA */ -#define SET_I2C0_SMBAL_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C0_SMBAL_PA3_Msk)) | I2C0_SMBAL_PA3 /*!< Set PA3 function to I2C0_SMBAL */ -#define SET_I2C0_SMBAL_PG2() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~I2C0_SMBAL_PG2_Msk)) | I2C0_SMBAL_PG2 /*!< Set PG2 function to I2C0_SMBAL */ -#define SET_I2C0_SMBAL_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C0_SMBAL_PC3_Msk)) | I2C0_SMBAL_PC3 /*!< Set PC3 function to I2C0_SMBAL */ -#define SET_I2C0_SMBSUS_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C0_SMBSUS_PA2_Msk)) | I2C0_SMBSUS_PA2 /*!< Set PA2 function to I2C0_SMBSUS */ -#define SET_I2C0_SMBSUS_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C0_SMBSUS_PC2_Msk)) | I2C0_SMBSUS_PC2 /*!< Set PC2 function to I2C0_SMBSUS */ -#define SET_I2C0_SMBSUS_PG3() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~I2C0_SMBSUS_PG3_Msk)) | I2C0_SMBSUS_PG3 /*!< Set PG3 function to I2C0_SMBSUS */ -#define SET_I2C1_SCL_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2C1_SCL_PB1_Msk)) | I2C1_SCL_PB1 /*!< Set PB1 function to I2C1_SCL */ -#define SET_I2C1_SCL_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~I2C1_SCL_PE1_Msk)) | I2C1_SCL_PE1 /*!< Set PE1 function to I2C1_SCL */ -#define SET_I2C1_SCL_PF0() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~I2C1_SCL_PF0_Msk)) | I2C1_SCL_PF0 /*!< Set PF0 function to I2C1_SCL */ -#define SET_I2C1_SCL_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2C1_SCL_PA12_Msk)) | I2C1_SCL_PA12 /*!< Set PA12 function to I2C1_SCL */ -#define SET_I2C1_SCL_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C1_SCL_PA7_Msk)) | I2C1_SCL_PA7 /*!< Set PA7 function to I2C1_SCL */ -#define SET_I2C1_SCL_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C1_SCL_PB11_Msk)) | I2C1_SCL_PB11 /*!< Set PB11 function to I2C1_SCL */ -#define SET_I2C1_SCL_PG2() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~I2C1_SCL_PG2_Msk)) | I2C1_SCL_PG2 /*!< Set PG2 function to I2C1_SCL */ -#define SET_I2C1_SCL_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C1_SCL_PA3_Msk)) | I2C1_SCL_PA3 /*!< Set PA3 function to I2C1_SCL */ -#define SET_I2C1_SCL_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C1_SCL_PC5_Msk)) | I2C1_SCL_PC5 /*!< Set PC5 function to I2C1_SCL */ -#define SET_I2C1_SCL_PD5() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~I2C1_SCL_PD5_Msk)) | I2C1_SCL_PD5 /*!< Set PD5 function to I2C1_SCL */ -#define SET_I2C1_SCL_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2C1_SCL_PB3_Msk)) | I2C1_SCL_PB3 /*!< Set PB3 function to I2C1_SCL */ -#define SET_I2C1_SDA_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C1_SDA_PA2_Msk)) | I2C1_SDA_PA2 /*!< Set PA2 function to I2C1_SDA */ -#define SET_I2C1_SDA_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C1_SDA_PB10_Msk)) | I2C1_SDA_PB10 /*!< Set PB10 function to I2C1_SDA */ -#define SET_I2C1_SDA_PF1() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~I2C1_SDA_PF1_Msk)) | I2C1_SDA_PF1 /*!< Set PF1 function to I2C1_SDA */ -#define SET_I2C1_SDA_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2C1_SDA_PB2_Msk)) | I2C1_SDA_PB2 /*!< Set PB2 function to I2C1_SDA */ -#define SET_I2C1_SDA_PD4() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~I2C1_SDA_PD4_Msk)) | I2C1_SDA_PD4 /*!< Set PD4 function to I2C1_SDA */ -#define SET_I2C1_SDA_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2C1_SDA_PA13_Msk)) | I2C1_SDA_PA13 /*!< Set PA13 function to I2C1_SDA */ -#define SET_I2C1_SDA_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C1_SDA_PA6_Msk)) | I2C1_SDA_PA6 /*!< Set PA6 function to I2C1_SDA */ -#define SET_I2C1_SDA_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~I2C1_SDA_PE0_Msk)) | I2C1_SDA_PE0 /*!< Set PE0 function to I2C1_SDA */ -#define SET_I2C1_SDA_PG3() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~I2C1_SDA_PG3_Msk)) | I2C1_SDA_PG3 /*!< Set PG3 function to I2C1_SDA */ -#define SET_I2C1_SDA_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C1_SDA_PC4_Msk)) | I2C1_SDA_PC4 /*!< Set PC4 function to I2C1_SDA */ -#define SET_I2C1_SDA_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2C1_SDA_PB0_Msk)) | I2C1_SDA_PB0 /*!< Set PB0 function to I2C1_SDA */ -#define SET_I2C1_SMBAL_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C1_SMBAL_PB9_Msk)) | I2C1_SMBAL_PB9 /*!< Set PB9 function to I2C1_SMBAL */ -#define SET_I2C1_SMBAL_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~I2C1_SMBAL_PH8_Msk)) | I2C1_SMBAL_PH8 /*!< Set PH8 function to I2C1_SMBAL */ -#define SET_I2C1_SMBAL_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C1_SMBAL_PC7_Msk)) | I2C1_SMBAL_PC7 /*!< Set PC7 function to I2C1_SMBAL */ -#define SET_I2C1_SMBSUS_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2C1_SMBSUS_PC6_Msk)) | I2C1_SMBSUS_PC6 /*!< Set PC6 function to I2C1_SMBSUS */ -#define SET_I2C1_SMBSUS_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C1_SMBSUS_PB8_Msk)) | I2C1_SMBSUS_PB8 /*!< Set PB8 function to I2C1_SMBSUS */ -#define SET_I2C1_SMBSUS_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~I2C1_SMBSUS_PH9_Msk)) | I2C1_SMBSUS_PH9 /*!< Set PH9 function to I2C1_SMBSUS */ -#define SET_I2C2_SCL_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2C2_SCL_PA14_Msk)) | I2C2_SCL_PA14 /*!< Set PA14 function to I2C2_SCL */ -#define SET_I2C2_SCL_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~I2C2_SCL_PH8_Msk)) | I2C2_SCL_PH8 /*!< Set PH8 function to I2C2_SCL */ -#define SET_I2C2_SCL_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2C2_SCL_PA11_Msk)) | I2C2_SCL_PA11 /*!< Set PA11 function to I2C2_SCL */ -#define SET_I2C2_SCL_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C2_SCL_PB13_Msk)) | I2C2_SCL_PB13 /*!< Set PB13 function to I2C2_SCL */ -#define SET_I2C2_SCL_PD9() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~I2C2_SCL_PD9_Msk)) | I2C2_SCL_PD9 /*!< Set PD9 function to I2C2_SCL */ -#define SET_I2C2_SCL_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C2_SCL_PA1_Msk)) | I2C2_SCL_PA1 /*!< Set PA1 function to I2C2_SCL */ -#define SET_I2C2_SCL_PD1() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~I2C2_SCL_PD1_Msk)) | I2C2_SCL_PD1 /*!< Set PD1 function to I2C2_SCL */ -#define SET_I2C2_SDA_PD8() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~I2C2_SDA_PD8_Msk)) | I2C2_SDA_PD8 /*!< Set PD8 function to I2C2_SDA */ -#define SET_I2C2_SDA_PD0() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~I2C2_SDA_PD0_Msk)) | I2C2_SDA_PD0 /*!< Set PD0 function to I2C2_SDA */ -#define SET_I2C2_SDA_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2C2_SDA_PA15_Msk)) | I2C2_SDA_PA15 /*!< Set PA15 function to I2C2_SDA */ -#define SET_I2C2_SDA_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~I2C2_SDA_PH9_Msk)) | I2C2_SDA_PH9 /*!< Set PH9 function to I2C2_SDA */ -#define SET_I2C2_SDA_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2C2_SDA_PA10_Msk)) | I2C2_SDA_PA10 /*!< Set PA10 function to I2C2_SDA */ -#define SET_I2C2_SDA_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~I2C2_SDA_PA0_Msk)) | I2C2_SDA_PA0 /*!< Set PA0 function to I2C2_SDA */ -#define SET_I2C2_SDA_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C2_SDA_PB12_Msk)) | I2C2_SDA_PB12 /*!< Set PB12 function to I2C2_SDA */ -#define SET_I2C2_SMBAL_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C2_SMBAL_PB15_Msk)) | I2C2_SMBAL_PB15 /*!< Set PB15 function to I2C2_SMBAL */ -#define SET_I2C2_SMBSUS_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~I2C2_SMBSUS_PB14_Msk)) | I2C2_SMBSUS_PB14 /*!< Set PB14 function to I2C2_SMBSUS */ -#define SET_I2S0_BCLK_PF10() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~I2S0_BCLK_PF10_Msk)) | I2S0_BCLK_PF10 /*!< Set PF10 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2S0_BCLK_PB5_Msk)) | I2S0_BCLK_PB5 /*!< Set PB5 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~I2S0_BCLK_PE1_Msk)) | I2S0_BCLK_PE1 /*!< Set PE1 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2S0_BCLK_PA12_Msk)) | I2S0_BCLK_PA12 /*!< Set PA12 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2S0_BCLK_PC4_Msk)) | I2S0_BCLK_PC4 /*!< Set PC4 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~I2S0_BCLK_PE8_Msk)) | I2S0_BCLK_PE8 /*!< Set PE8 function to I2S0_BCLK */ -#define SET_I2S0_DI_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2S0_DI_PC2_Msk)) | I2S0_DI_PC2 /*!< Set PC2 function to I2S0_DI */ -#define SET_I2S0_DI_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~I2S0_DI_PE10_Msk)) | I2S0_DI_PE10 /*!< Set PE10 function to I2S0_DI */ -#define SET_I2S0_DI_PF8() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~I2S0_DI_PF8_Msk)) | I2S0_DI_PF8 /*!< Set PF8 function to I2S0_DI */ -#define SET_I2S0_DI_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~I2S0_DI_PH8_Msk)) | I2S0_DI_PH8 /*!< Set PH8 function to I2S0_DI */ -#define SET_I2S0_DI_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2S0_DI_PB3_Msk)) | I2S0_DI_PB3 /*!< Set PB3 function to I2S0_DI */ -#define SET_I2S0_DI_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2S0_DI_PA14_Msk)) | I2S0_DI_PA14 /*!< Set PA14 function to I2S0_DI */ -#define SET_I2S0_DO_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~I2S0_DO_PH9_Msk)) | I2S0_DO_PH9 /*!< Set PH9 function to I2S0_DO */ -#define SET_I2S0_DO_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2S0_DO_PC1_Msk)) | I2S0_DO_PC1 /*!< Set PC1 function to I2S0_DO */ -#define SET_I2S0_DO_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2S0_DO_PA15_Msk)) | I2S0_DO_PA15 /*!< Set PA15 function to I2S0_DO */ -#define SET_I2S0_DO_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2S0_DO_PB2_Msk)) | I2S0_DO_PB2 /*!< Set PB2 function to I2S0_DO */ -#define SET_I2S0_DO_PF7() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~I2S0_DO_PF7_Msk)) | I2S0_DO_PF7 /*!< Set PF7 function to I2S0_DO */ -#define SET_I2S0_DO_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~I2S0_DO_PE11_Msk)) | I2S0_DO_PE11 /*!< Set PE11 function to I2S0_DO */ -#define SET_I2S0_LRCK_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2S0_LRCK_PC0_Msk)) | I2S0_LRCK_PC0 /*!< Set PC0 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2S0_LRCK_PB1_Msk)) | I2S0_LRCK_PB1 /*!< Set PB1 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~I2S0_LRCK_PH10_Msk)) | I2S0_LRCK_PH10 /*!< Set PH10 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~I2S0_LRCK_PF6_Msk)) | I2S0_LRCK_PF6 /*!< Set PF6 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~I2S0_LRCK_PE12_Msk)) | I2S0_LRCK_PE12 /*!< Set PE12 function to I2S0_LRCK */ -#define SET_I2S0_MCLK_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~I2S0_MCLK_PC3_Msk)) | I2S0_MCLK_PC3 /*!< Set PC3 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PF9() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~I2S0_MCLK_PF9_Msk)) | I2S0_MCLK_PF9 /*!< Set PF9 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~I2S0_MCLK_PE0_Msk)) | I2S0_MCLK_PE0 /*!< Set PE0 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~I2S0_MCLK_PB4_Msk)) | I2S0_MCLK_PB4 /*!< Set PB4 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~I2S0_MCLK_PA13_Msk)) | I2S0_MCLK_PA13 /*!< Set PA13 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~I2S0_MCLK_PE9_Msk)) | I2S0_MCLK_PE9 /*!< Set PE9 function to I2S0_MCLK */ -#define SET_ICE_CLK_PF1() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~ICE_CLK_PF1_Msk)) | ICE_CLK_PF1 /*!< Set PF1 function to ICE_CLK */ -#define SET_ICE_DAT_PF0() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~ICE_DAT_PF0_Msk)) | ICE_DAT_PF0 /*!< Set PF0 function to ICE_DAT */ -#define SET_INT0_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~INT0_PA6_Msk)) | INT0_PA6 /*!< Set PA6 function to INT0 */ -#define SET_INT0_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~INT0_PB5_Msk)) | INT0_PB5 /*!< Set PB5 function to INT0 */ -#define SET_INT1_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~INT1_PB4_Msk)) | INT1_PB4 /*!< Set PB4 function to INT1 */ -#define SET_INT1_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~INT1_PA7_Msk)) | INT1_PA7 /*!< Set PA7 function to INT1 */ -#define SET_INT2_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~INT2_PB3_Msk)) | INT2_PB3 /*!< Set PB3 function to INT2 */ -#define SET_INT2_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~INT2_PC6_Msk)) | INT2_PC6 /*!< Set PC6 function to INT2 */ -#define SET_INT3_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~INT3_PB2_Msk)) | INT3_PB2 /*!< Set PB2 function to INT3 */ -#define SET_INT3_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~INT3_PC7_Msk)) | INT3_PC7 /*!< Set PC7 function to INT3 */ -#define SET_INT4_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~INT4_PA8_Msk)) | INT4_PA8 /*!< Set PA8 function to INT4 */ -#define SET_INT4_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~INT4_PB6_Msk)) | INT4_PB6 /*!< Set PB6 function to INT4 */ -#define SET_INT5_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~INT5_PB7_Msk)) | INT5_PB7 /*!< Set PB7 function to INT5 */ -#define SET_INT5_PD12() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~INT5_PD12_Msk)) | INT5_PD12 /*!< Set PD12 function to INT5 */ -#define SET_INT6_PD11() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~INT6_PD11_Msk)) | INT6_PD11 /*!< Set PD11 function to INT6 */ -#define SET_INT6_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~INT6_PB8_Msk)) | INT6_PB8 /*!< Set PB8 function to INT6 */ -#define SET_INT7_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~INT7_PB9_Msk)) | INT7_PB9 /*!< Set PB9 function to INT7 */ -#define SET_INT7_PD10() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~INT7_PD10_Msk)) | INT7_PD10 /*!< Set PD10 function to INT7 */ -#define SET_LCD_COM0_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_COM0_PC0_Msk)) | LCD_COM0_PC0 /*!< Set PC0 function to LCD_COM0 */ -#define SET_LCD_COM1_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_COM1_PC1_Msk)) | LCD_COM1_PC1 /*!< Set PC1 function to LCD_COM1 */ -#define SET_LCD_COM2_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_COM2_PC2_Msk)) | LCD_COM2_PC2 /*!< Set PC2 function to LCD_COM2 */ -#define SET_LCD_COM3_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_COM3_PC3_Msk)) | LCD_COM3_PC3 /*!< Set PC3 function to LCD_COM3 */ -#define SET_LCD_COM4_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_COM4_PC4_Msk)) | LCD_COM4_PC4 /*!< Set PC4 function to LCD_COM4 */ -#define SET_LCD_COM5_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_COM5_PC5_Msk)) | LCD_COM5_PC5 /*!< Set PC5 function to LCD_COM5 */ -#define SET_LCD_COM6_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_COM6_PA0_Msk)) | LCD_COM6_PA0 /*!< Set PA0 function to LCD_COM6 */ -#define SET_LCD_COM6_PD8() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~LCD_COM6_PD8_Msk)) | LCD_COM6_PD8 /*!< Set PD8 function to LCD_SEG41 */ -#define SET_LCD_COM7_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_COM7_PA1_Msk)) | LCD_COM7_PA1 /*!< Set PA1 function to LCD_COM7 */ -#define SET_LCD_COM7_PD9() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~LCD_COM7_PD9_Msk)) | LCD_COM7_PD9 /*!< Set PD9 function to LCD_COM7 */ -#define SET_LCD_SEG0_PD14() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~LCD_SEG0_PD14_Msk)) | LCD_SEG0_PD14 /*!< Set PD14 function to LCD_SEG0 */ -#define SET_LCD_SEG0_PD1() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~LCD_SEG0_PD1_Msk)) | LCD_SEG0_PD1 /*!< Set PD1 function to LCD_SEG0 */ -#define SET_LCD_SEG1_PD2() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~LCD_SEG1_PD2_Msk)) | LCD_SEG1_PD2 /*!< Set PD2 function to LCD_SEG1 */ -#define SET_LCD_SEG1_PH11() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~LCD_SEG1_PH11_Msk)) | LCD_SEG1_PH11 /*!< Set PH11 function to LCD_SEG1 */ -#define SET_LCD_SEG10_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_SEG10_PC7_Msk)) | LCD_SEG10_PC7 /*!< Set PC7 function to LCD_SEG10 */ -#define SET_LCD_SEG10_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG10_PE5_Msk)) | LCD_SEG10_PE5 /*!< Set PE5 function to LCD_SEG10 */ -#define SET_LCD_SEG11_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~LCD_SEG11_PA8_Msk)) | LCD_SEG11_PA8 /*!< Set PA8 function to LCD_SEG11 */ -#define SET_LCD_SEG11_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG11_PE6_Msk)) | LCD_SEG11_PE6 /*!< Set PE6 function to LCD_SEG11 */ -#define SET_LCD_SEG12_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~LCD_SEG12_PA9_Msk)) | LCD_SEG12_PA9 /*!< Set PA9 function to LCD_SEG12 */ -#define SET_LCD_SEG12_PE7() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG12_PE7_Msk)) | LCD_SEG12_PE7 /*!< Set PE7 function to LCD_SEG12 */ -#define SET_LCD_SEG13_PD6() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~LCD_SEG13_PD6_Msk)) | LCD_SEG13_PD6 /*!< Set PD6 function to LCD_SEG13 */ -#define SET_LCD_SEG13_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG13_PA1_Msk)) | LCD_SEG13_PA1 /*!< Set PA1 function to LCD_SEG13 */ -#define SET_LCD_SEG14_PD7() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~LCD_SEG14_PD7_Msk)) | LCD_SEG14_PD7 /*!< Set PD7 function to LCD_SEG14 */ -#define SET_LCD_SEG14_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG14_PA0_Msk)) | LCD_SEG14_PA0 /*!< Set PA0 function to LCD_SEG14 */ -#define SET_LCD_SEG15_PG15() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~LCD_SEG15_PG15_Msk)) | LCD_SEG15_PG15 /*!< Set PG15 function to LCD_SEG15 */ -#define SET_LCD_SEG16_PG14() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~LCD_SEG16_PG14_Msk)) | LCD_SEG16_PG14 /*!< Set PG14 function to LCD_SEG16 */ -#define SET_LCD_SEG17_PG13() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~LCD_SEG17_PG13_Msk)) | LCD_SEG17_PG13 /*!< Set PG13 function to LCD_SEG17 */ -#define SET_LCD_SEG18_PG12() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~LCD_SEG18_PG12_Msk)) | LCD_SEG18_PG12 /*!< Set PG12 function to LCD_SEG18 */ -#define SET_LCD_SEG19_PG11() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~LCD_SEG19_PG11_Msk)) | LCD_SEG19_PG11 /*!< Set PG11 function to LCD_SEG19 */ -#define SET_LCD_SEG2_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~LCD_SEG2_PH10_Msk)) | LCD_SEG2_PH10 /*!< Set PH10 function to LCD_SEG2 */ -#define SET_LCD_SEG2_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~LCD_SEG2_PD3_Msk)) | LCD_SEG2_PD3 /*!< Set PD3 function to LCD_SEG2 */ -#define SET_LCD_SEG20_PG10() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~LCD_SEG20_PG10_Msk)) | LCD_SEG20_PG10 /*!< Set PG10 function to LCD_SEG20 */ -#define SET_LCD_SEG21_PG9() SYS->GPG_MFPH = (SYS->GPG_MFPH & (~LCD_SEG21_PG9_Msk)) | LCD_SEG21_PG9 /*!< Set PG9 function to LCD_SEG21 */ -#define SET_LCD_SEG22_PE15() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~LCD_SEG22_PE15_Msk)) | LCD_SEG22_PE15 /*!< Set PE15 function to LCD_SEG22 */ -#define SET_LCD_SEG23_PE14() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~LCD_SEG23_PE14_Msk)) | LCD_SEG23_PE14 /*!< Set PE14 function to LCD_SEG23 */ -#define SET_LCD_SEG24_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG24_PA0_Msk)) | LCD_SEG24_PA0 /*!< Set PA0 function to LCD_SEG24 */ -#define SET_LCD_SEG25_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG25_PA1_Msk)) | LCD_SEG25_PA1 /*!< Set PA1 function to LCD_SEG25 */ -#define SET_LCD_SEG26_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG26_PA2_Msk)) | LCD_SEG26_PA2 /*!< Set PA2 function to LCD_SEG26 */ -#define SET_LCD_SEG27_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG27_PA3_Msk)) | LCD_SEG27_PA3 /*!< Set PA3 function to LCD_SEG27 */ -#define SET_LCD_SEG28_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG28_PA4_Msk)) | LCD_SEG28_PA4 /*!< Set PA4 function to LCD_SEG28 */ -#define SET_LCD_SEG29_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG29_PA5_Msk)) | LCD_SEG29_PA5 /*!< Set PA5 function to LCD_SEG29 */ -#define SET_LCD_SEG3_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG3_PA2_Msk)) | LCD_SEG3_PA2 /*!< Set PA2 function to LCD_SEG3 */ -#define SET_LCD_SEG3_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~LCD_SEG3_PH9_Msk)) | LCD_SEG3_PH9 /*!< Set PH9 function to LCD_SEG3 */ -#define SET_LCD_SEG30_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~LCD_SEG30_PE10_Msk)) | LCD_SEG30_PE10 /*!< Set PE10 function to LCD_SEG30 */ -#define SET_LCD_SEG31_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~LCD_SEG31_PE9_Msk)) | LCD_SEG31_PE9 /*!< Set PE9 function to LCD_SEG31 */ -#define SET_LCD_SEG32_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~LCD_SEG32_PE8_Msk)) | LCD_SEG32_PE8 /*!< Set PE8 function to LCD_SEG32 */ -#define SET_LCD_SEG33_PH7() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~LCD_SEG33_PH7_Msk)) | LCD_SEG33_PH7 /*!< Set PH7 function to LCD_SEG33 */ -#define SET_LCD_SEG34_PH6() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~LCD_SEG34_PH6_Msk)) | LCD_SEG34_PH6 /*!< Set PH6 function to LCD_SEG34 */ -#define SET_LCD_SEG35_PH5() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~LCD_SEG35_PH5_Msk)) | LCD_SEG35_PH5 /*!< Set PH5 function to LCD_SEG35 */ -#define SET_LCD_SEG36_PH4() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~LCD_SEG36_PH4_Msk)) | LCD_SEG36_PH4 /*!< Set PH4 function to LCD_SEG36 */ -#define SET_LCD_SEG37_PG4() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~LCD_SEG37_PG4_Msk)) | LCD_SEG37_PG4 /*!< Set PG4 function to LCD_SEG37 */ -#define SET_LCD_SEG38_PG3() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~LCD_SEG38_PG3_Msk)) | LCD_SEG38_PG3 /*!< Set PG3 function to LCD_SEG38 */ -#define SET_LCD_SEG39_PG2() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~LCD_SEG39_PG2_Msk)) | LCD_SEG39_PG2 /*!< Set PG2 function to LCD_SEG39 */ -#define SET_LCD_SEG4_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~LCD_SEG4_PH8_Msk)) | LCD_SEG4_PH8 /*!< Set PH8 function to LCD_SEG4 */ -#define SET_LCD_SEG4_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG4_PA3_Msk)) | LCD_SEG4_PA3 /*!< Set PA3 function to LCD_SEG4 */ -#define SET_LCD_SEG40_PD9() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~LCD_SEG40_PD9_Msk)) | LCD_SEG40_PD9 /*!< Set PD9 function to LCD_SEG40 */ -#define SET_LCD_SEG41_PD8() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~LCD_SEG41_PD8_Msk)) | LCD_SEG41_PD8 /*!< Set PD8 function to LCD_SEG41 */ -#define SET_LCD_SEG42_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_SEG42_PC5_Msk)) | LCD_SEG42_PC5 /*!< Set PC5 function to LCD_SEG42 */ -#define SET_LCD_SEG43_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_SEG43_PC4_Msk)) | LCD_SEG43_PC4 /*!< Set PC4 function to LCD_SEG43 */ -#define SET_LCD_SEG5_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG5_PA4_Msk)) | LCD_SEG5_PA4 /*!< Set PA4 function to LCD_SEG5 */ -#define SET_LCD_SEG5_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG5_PE0_Msk)) | LCD_SEG5_PE0 /*!< Set PE0 function to LCD_SEG5 */ -#define SET_LCD_SEG6_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG6_PE1_Msk)) | LCD_SEG6_PE1 /*!< Set PE1 function to LCD_SEG6 */ -#define SET_LCD_SEG6_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG6_PA5_Msk)) | LCD_SEG6_PA5 /*!< Set PA5 function to LCD_SEG6 */ -#define SET_LCD_SEG7_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG7_PA6_Msk)) | LCD_SEG7_PA6 /*!< Set PA6 function to LCD_SEG7 */ -#define SET_LCD_SEG7_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG7_PE2_Msk)) | LCD_SEG7_PE2 /*!< Set PE2 function to LCD_SEG7 */ -#define SET_LCD_SEG8_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG8_PE3_Msk)) | LCD_SEG8_PE3 /*!< Set PE3 function to LCD_SEG8 */ -#define SET_LCD_SEG8_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~LCD_SEG8_PA7_Msk)) | LCD_SEG8_PA7 /*!< Set PA7 function to LCD_SEG8 */ -#define SET_LCD_SEG9_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~LCD_SEG9_PC6_Msk)) | LCD_SEG9_PC6 /*!< Set PC6 function to LCD_SEG9 */ -#define SET_LCD_SEG9_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~LCD_SEG9_PE4_Msk)) | LCD_SEG9_PE4 /*!< Set PE4 function to LCD_SEG9 */ -#define SET_QEI0_A_PD11() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~QEI0_A_PD11_Msk)) | QEI0_A_PD11 /*!< Set PD11 function to QEI0_A */ -#define SET_QEI0_A_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QEI0_A_PA4_Msk)) | QEI0_A_PA4 /*!< Set PA4 function to QEI0_A */ -#define SET_QEI0_A_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QEI0_A_PE3_Msk)) | QEI0_A_PE3 /*!< Set PE3 function to QEI0_A */ -#define SET_QEI0_B_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QEI0_B_PE2_Msk)) | QEI0_B_PE2 /*!< Set PE2 function to QEI0_B */ -#define SET_QEI0_B_PD10() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~QEI0_B_PD10_Msk)) | QEI0_B_PD10 /*!< Set PD10 function to QEI0_B */ -#define SET_QEI0_B_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QEI0_B_PA3_Msk)) | QEI0_B_PA3 /*!< Set PA3 function to QEI0_B */ -#define SET_QEI0_INDEX_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QEI0_INDEX_PE4_Msk)) | QEI0_INDEX_PE4 /*!< Set PE4 function to QEI0_INDEX */ -#define SET_QEI0_INDEX_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QEI0_INDEX_PA5_Msk)) | QEI0_INDEX_PA5 /*!< Set PA5 function to QEI0_INDEX */ -#define SET_QEI0_INDEX_PD12() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~QEI0_INDEX_PD12_Msk)) | QEI0_INDEX_PD12 /*!< Set PD12 function to QEI0_INDEX */ -#define SET_QEI1_A_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~QEI1_A_PA13_Msk)) | QEI1_A_PA13 /*!< Set PA13 function to QEI1_A */ -#define SET_QEI1_A_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QEI1_A_PE6_Msk)) | QEI1_A_PE6 /*!< Set PE6 function to QEI1_A */ -#define SET_QEI1_A_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~QEI1_A_PA9_Msk)) | QEI1_A_PA9 /*!< Set PA9 function to QEI1_A */ -#define SET_QEI1_B_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QEI1_B_PE5_Msk)) | QEI1_B_PE5 /*!< Set PE5 function to QEI1_B */ -#define SET_QEI1_B_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~QEI1_B_PA8_Msk)) | QEI1_B_PA8 /*!< Set PA8 function to QEI1_B */ -#define SET_QEI1_B_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~QEI1_B_PA14_Msk)) | QEI1_B_PA14 /*!< Set PA14 function to QEI1_B */ -#define SET_QEI1_INDEX_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~QEI1_INDEX_PA10_Msk)) | QEI1_INDEX_PA10 /*!< Set PA10 function to QEI1_INDEX */ -#define SET_QEI1_INDEX_PE7() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QEI1_INDEX_PE7_Msk)) | QEI1_INDEX_PE7 /*!< Set PE7 function to QEI1_INDEX */ -#define SET_QEI1_INDEX_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~QEI1_INDEX_PA12_Msk)) | QEI1_INDEX_PA12 /*!< Set PA12 function to QEI1_INDEX */ -#define SET_QSPI0_CLK_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~QSPI0_CLK_PH8_Msk)) | QSPI0_CLK_PH8 /*!< Set PH8 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PF2() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~QSPI0_CLK_PF2_Msk)) | QSPI0_CLK_PF2 /*!< Set PF2 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QSPI0_CLK_PA2_Msk)) | QSPI0_CLK_PA2 /*!< Set PA2 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~QSPI0_CLK_PC2_Msk)) | QSPI0_CLK_PC2 /*!< Set PC2 function to QSPI0_CLK */ -#define SET_QSPI0_MISO0_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~QSPI0_MISO0_PC1_Msk)) | QSPI0_MISO0_PC1 /*!< Set PC1 function to QSPI0_MISO0 */ -#define SET_QSPI0_MISO0_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QSPI0_MISO0_PE1_Msk)) | QSPI0_MISO0_PE1 /*!< Set PE1 function to QSPI0_MISO0 */ -#define SET_QSPI0_MISO0_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QSPI0_MISO0_PA1_Msk)) | QSPI0_MISO0_PA1 /*!< Set PA1 function to QSPI0_MISO0 */ -#define SET_QSPI0_MISO1_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~QSPI0_MISO1_PB1_Msk)) | QSPI0_MISO1_PB1 /*!< Set PB1 function to QSPI0_MISO1 */ -#define SET_QSPI0_MISO1_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~QSPI0_MISO1_PC5_Msk)) | QSPI0_MISO1_PC5 /*!< Set PC5 function to QSPI0_MISO1 */ -#define SET_QSPI0_MISO1_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~QSPI0_MISO1_PH10_Msk)) | QSPI0_MISO1_PH10 /*!< Set PH10 function to QSPI0_MISO1 */ -#define SET_QSPI0_MISO1_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QSPI0_MISO1_PA5_Msk)) | QSPI0_MISO1_PA5 /*!< Set PA5 function to QSPI0_MISO1 */ -#define SET_QSPI0_MOSI0_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~QSPI0_MOSI0_PC0_Msk)) | QSPI0_MOSI0_PC0 /*!< Set PC0 function to QSPI0_MOSI0 */ -#define SET_QSPI0_MOSI0_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~QSPI0_MOSI0_PE0_Msk)) | QSPI0_MOSI0_PE0 /*!< Set PE0 function to QSPI0_MOSI0 */ -#define SET_QSPI0_MOSI0_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QSPI0_MOSI0_PA0_Msk)) | QSPI0_MOSI0_PA0 /*!< Set PA0 function to QSPI0_MOSI0 */ -#define SET_QSPI0_MOSI1_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~QSPI0_MOSI1_PC4_Msk)) | QSPI0_MOSI1_PC4 /*!< Set PC4 function to QSPI0_MOSI1 */ -#define SET_QSPI0_MOSI1_PH11() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~QSPI0_MOSI1_PH11_Msk)) | QSPI0_MOSI1_PH11 /*!< Set PH11 function to QSPI0_MOSI1 */ -#define SET_QSPI0_MOSI1_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~QSPI0_MOSI1_PB0_Msk)) | QSPI0_MOSI1_PB0 /*!< Set PB0 function to QSPI0_MOSI1 */ -#define SET_QSPI0_MOSI1_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QSPI0_MOSI1_PA4_Msk)) | QSPI0_MOSI1_PA4 /*!< Set PA4 function to QSPI0_MOSI1 */ -#define SET_QSPI0_SS_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~QSPI0_SS_PA3_Msk)) | QSPI0_SS_PA3 /*!< Set PA3 function to QSPI0_SS */ -#define SET_QSPI0_SS_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~QSPI0_SS_PC3_Msk)) | QSPI0_SS_PC3 /*!< Set PC3 function to QSPI0_SS */ -#define SET_QSPI0_SS_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~QSPI0_SS_PH9_Msk)) | QSPI0_SS_PH9 /*!< Set PH9 function to QSPI0_SS */ -#define SET_SC0_CLK_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC0_CLK_PA0_Msk)) | SC0_CLK_PA0 /*!< Set PA0 function to SC0_CLK */ -#define SET_SC0_CLK_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~SC0_CLK_PF6_Msk)) | SC0_CLK_PF6 /*!< Set PF6 function to SC0_CLK */ -#define SET_SC0_CLK_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SC0_CLK_PE2_Msk)) | SC0_CLK_PE2 /*!< Set PE2 function to SC0_CLK */ -#define SET_SC0_CLK_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SC0_CLK_PB5_Msk)) | SC0_CLK_PB5 /*!< Set PB5 function to SC0_CLK */ -#define SET_SC0_DAT_PF7() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~SC0_DAT_PF7_Msk)) | SC0_DAT_PF7 /*!< Set PF7 function to SC0_DAT */ -#define SET_SC0_DAT_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC0_DAT_PA1_Msk)) | SC0_DAT_PA1 /*!< Set PA1 function to SC0_DAT */ -#define SET_SC0_DAT_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SC0_DAT_PE3_Msk)) | SC0_DAT_PE3 /*!< Set PE3 function to SC0_DAT */ -#define SET_SC0_DAT_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SC0_DAT_PB4_Msk)) | SC0_DAT_PB4 /*!< Set PB4 function to SC0_DAT */ -#define SET_SC0_PWR_PF9() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~SC0_PWR_PF9_Msk)) | SC0_PWR_PF9 /*!< Set PF9 function to SC0_PWR */ -#define SET_SC0_PWR_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SC0_PWR_PE5_Msk)) | SC0_PWR_PE5 /*!< Set PE5 function to SC0_PWR */ -#define SET_SC0_PWR_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC0_PWR_PA3_Msk)) | SC0_PWR_PA3 /*!< Set PA3 function to SC0_PWR */ -#define SET_SC0_PWR_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SC0_PWR_PB2_Msk)) | SC0_PWR_PB2 /*!< Set PB2 function to SC0_PWR */ -#define SET_SC0_RST_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SC0_RST_PE4_Msk)) | SC0_RST_PE4 /*!< Set PE4 function to SC0_RST */ -#define SET_SC0_RST_PF8() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~SC0_RST_PF8_Msk)) | SC0_RST_PF8 /*!< Set PF8 function to SC0_RST */ -#define SET_SC0_RST_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC0_RST_PA2_Msk)) | SC0_RST_PA2 /*!< Set PA2 function to SC0_RST */ -#define SET_SC0_RST_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SC0_RST_PB3_Msk)) | SC0_RST_PB3 /*!< Set PB3 function to SC0_RST */ -#define SET_SC0_nCD_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~SC0_nCD_PC12_Msk)) | SC0_nCD_PC12 /*!< Set PC12 function to SC0_nCD */ -#define SET_SC0_nCD_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC0_nCD_PA4_Msk)) | SC0_nCD_PA4 /*!< Set PA4 function to SC0_nCD */ -#define SET_SC0_nCD_PF10() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~SC0_nCD_PF10_Msk)) | SC0_nCD_PF10 /*!< Set PF10 function to SC0_nCD */ -#define SET_SC0_nCD_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SC0_nCD_PE6_Msk)) | SC0_nCD_PE6 /*!< Set PE6 function to SC0_nCD */ -#define SET_SC1_CLK_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SC1_CLK_PB12_Msk)) | SC1_CLK_PB12 /*!< Set PB12 function to SC1_CLK */ -#define SET_SC1_CLK_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SC1_CLK_PC0_Msk)) | SC1_CLK_PC0 /*!< Set PC0 function to SC1_CLK */ -#define SET_SC1_CLK_PD4() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC1_CLK_PD4_Msk)) | SC1_CLK_PD4 /*!< Set PD4 function to SC1_CLK */ -#define SET_SC1_DAT_PD5() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC1_DAT_PD5_Msk)) | SC1_DAT_PD5 /*!< Set PD5 function to SC1_DAT */ -#define SET_SC1_DAT_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SC1_DAT_PC1_Msk)) | SC1_DAT_PC1 /*!< Set PC1 function to SC1_DAT */ -#define SET_SC1_DAT_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SC1_DAT_PB13_Msk)) | SC1_DAT_PB13 /*!< Set PB13 function to SC1_DAT */ -#define SET_SC1_PWR_PD7() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC1_PWR_PD7_Msk)) | SC1_PWR_PD7 /*!< Set PD7 function to SC1_PWR */ -#define SET_SC1_PWR_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SC1_PWR_PC3_Msk)) | SC1_PWR_PC3 /*!< Set PC3 function to SC1_PWR */ -#define SET_SC1_PWR_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SC1_PWR_PB15_Msk)) | SC1_PWR_PB15 /*!< Set PB15 function to SC1_PWR */ -#define SET_SC1_RST_PD6() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC1_RST_PD6_Msk)) | SC1_RST_PD6 /*!< Set PD6 function to SC1_RST */ -#define SET_SC1_RST_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SC1_RST_PB14_Msk)) | SC1_RST_PB14 /*!< Set PB14 function to SC1_RST */ -#define SET_SC1_RST_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SC1_RST_PC2_Msk)) | SC1_RST_PC2 /*!< Set PC2 function to SC1_RST */ -#define SET_SC1_nCD_PD14() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~SC1_nCD_PD14_Msk)) | SC1_nCD_PD14 /*!< Set PD14 function to SC1_nCD */ -#define SET_SC1_nCD_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SC1_nCD_PC4_Msk)) | SC1_nCD_PC4 /*!< Set PC4 function to SC1_nCD */ -#define SET_SC1_nCD_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC1_nCD_PD3_Msk)) | SC1_nCD_PD3 /*!< Set PD3 function to SC1_nCD */ -#define SET_SC2_CLK_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC2_CLK_PA6_Msk)) | SC2_CLK_PA6 /*!< Set PA6 function to SC2_CLK */ -#define SET_SC2_CLK_PD0() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC2_CLK_PD0_Msk)) | SC2_CLK_PD0 /*!< Set PD0 function to SC2_CLK */ -#define SET_SC2_CLK_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_CLK_PA15_Msk)) | SC2_CLK_PA15 /*!< Set PA15 function to SC2_CLK */ -#define SET_SC2_CLK_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_CLK_PA8_Msk)) | SC2_CLK_PA8 /*!< Set PA8 function to SC2_CLK */ -#define SET_SC2_CLK_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SC2_CLK_PE0_Msk)) | SC2_CLK_PE0 /*!< Set PE0 function to SC2_CLK */ -#define SET_SC2_DAT_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_DAT_PA9_Msk)) | SC2_DAT_PA9 /*!< Set PA9 function to SC2_DAT */ -#define SET_SC2_DAT_PD1() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC2_DAT_PD1_Msk)) | SC2_DAT_PD1 /*!< Set PD1 function to SC2_DAT */ -#define SET_SC2_DAT_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC2_DAT_PA7_Msk)) | SC2_DAT_PA7 /*!< Set PA7 function to SC2_DAT */ -#define SET_SC2_DAT_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_DAT_PA14_Msk)) | SC2_DAT_PA14 /*!< Set PA14 function to SC2_DAT */ -#define SET_SC2_DAT_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SC2_DAT_PE1_Msk)) | SC2_DAT_PE1 /*!< Set PE1 function to SC2_DAT */ -#define SET_SC2_PWR_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SC2_PWR_PC7_Msk)) | SC2_PWR_PC7 /*!< Set PC7 function to SC2_PWR */ -#define SET_SC2_PWR_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~SC2_PWR_PH8_Msk)) | SC2_PWR_PH8 /*!< Set PH8 function to SC2_PWR */ -#define SET_SC2_PWR_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC2_PWR_PD3_Msk)) | SC2_PWR_PD3 /*!< Set PD3 function to SC2_PWR */ -#define SET_SC2_PWR_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_PWR_PA11_Msk)) | SC2_PWR_PA11 /*!< Set PA11 function to SC2_PWR */ -#define SET_SC2_PWR_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_PWR_PA12_Msk)) | SC2_PWR_PA12 /*!< Set PA12 function to SC2_PWR */ -#define SET_SC2_RST_PD2() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SC2_RST_PD2_Msk)) | SC2_RST_PD2 /*!< Set PD2 function to SC2_RST */ -#define SET_SC2_RST_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SC2_RST_PC6_Msk)) | SC2_RST_PC6 /*!< Set PC6 function to SC2_RST */ -#define SET_SC2_RST_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~SC2_RST_PH9_Msk)) | SC2_RST_PH9 /*!< Set PH9 function to SC2_RST */ -#define SET_SC2_RST_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_RST_PA13_Msk)) | SC2_RST_PA13 /*!< Set PA13 function to SC2_RST */ -#define SET_SC2_RST_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SC2_RST_PA10_Msk)) | SC2_RST_PA10 /*!< Set PA10 function to SC2_RST */ -#define SET_SC2_nCD_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SC2_nCD_PA5_Msk)) | SC2_nCD_PA5 /*!< Set PA5 function to SC2_nCD */ -#define SET_SC2_nCD_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~SC2_nCD_PH10_Msk)) | SC2_nCD_PH10 /*!< Set PH10 function to SC2_nCD */ -#define SET_SC2_nCD_PD13() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~SC2_nCD_PD13_Msk)) | SC2_nCD_PD13 /*!< Set PD13 function to SC2_nCD */ -#define SET_SC2_nCD_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~SC2_nCD_PC13_Msk)) | SC2_nCD_PC13 /*!< Set PC13 function to SC2_nCD */ -#define SET_SD0_CLK_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SD0_CLK_PB1_Msk)) | SD0_CLK_PB1 /*!< Set PB1 function to SD0_CLK */ -#define SET_SD0_CLK_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SD0_CLK_PE6_Msk)) | SD0_CLK_PE6 /*!< Set PE6 function to SD0_CLK */ -#define SET_SD0_CMD_PE7() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SD0_CMD_PE7_Msk)) | SD0_CMD_PE7 /*!< Set PE7 function to SD0_CMD */ -#define SET_SD0_CMD_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SD0_CMD_PB0_Msk)) | SD0_CMD_PB0 /*!< Set PB0 function to SD0_CMD */ -#define SET_SD0_DAT0_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SD0_DAT0_PE2_Msk)) | SD0_DAT0_PE2 /*!< Set PE2 function to SD0_DAT0 */ -#define SET_SD0_DAT0_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SD0_DAT0_PB2_Msk)) | SD0_DAT0_PB2 /*!< Set PB2 function to SD0_DAT0 */ -#define SET_SD0_DAT1_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SD0_DAT1_PE3_Msk)) | SD0_DAT1_PE3 /*!< Set PE3 function to SD0_DAT1 */ -#define SET_SD0_DAT1_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SD0_DAT1_PB3_Msk)) | SD0_DAT1_PB3 /*!< Set PB3 function to SD0_DAT1 */ -#define SET_SD0_DAT2_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SD0_DAT2_PE4_Msk)) | SD0_DAT2_PE4 /*!< Set PE4 function to SD0_DAT2 */ -#define SET_SD0_DAT2_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SD0_DAT2_PB4_Msk)) | SD0_DAT2_PB4 /*!< Set PB4 function to SD0_DAT2 */ -#define SET_SD0_DAT3_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SD0_DAT3_PE5_Msk)) | SD0_DAT3_PE5 /*!< Set PE5 function to SD0_DAT3 */ -#define SET_SD0_DAT3_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SD0_DAT3_PB5_Msk)) | SD0_DAT3_PB5 /*!< Set PB5 function to SD0_DAT3 */ -#define SET_SD0_nCD_PD13() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~SD0_nCD_PD13_Msk)) | SD0_nCD_PD13 /*!< Set PD13 function to SD0_nCD */ -#define SET_SD0_nCD_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SD0_nCD_PB12_Msk)) | SD0_nCD_PB12 /*!< Set PB12 function to SD0_nCD */ -#define SET_SEG15_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SEG15_PC5_Msk)) | SEG15_PC5 /*!< Set PC5 function to SEG15 */ -#define SET_SEG16_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SEG16_PC4_Msk)) | SEG16_PC4 /*!< Set PC4 function to SEG16 */ -#define SET_SPI0_CLK_PD2() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI0_CLK_PD2_Msk)) | SPI0_CLK_PD2 /*!< Set PD2 function to SPI0_CLK */ -#define SET_SPI0_CLK_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI0_CLK_PB14_Msk)) | SPI0_CLK_PB14 /*!< Set PB14 function to SPI0_CLK */ -#define SET_SPI0_CLK_PF8() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~SPI0_CLK_PF8_Msk)) | SPI0_CLK_PF8 /*!< Set PF8 function to SPI0_CLK */ -#define SET_SPI0_CLK_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI0_CLK_PA2_Msk)) | SPI0_CLK_PA2 /*!< Set PA2 function to SPI0_CLK */ -#define SET_SPI0_I2SMCLK_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI0_I2SMCLK_PB11_Msk)) | SPI0_I2SMCLK_PB11 /*!< Set PB11 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI0_I2SMCLK_PB0_Msk)) | SPI0_I2SMCLK_PB0 /*!< Set PB0 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PF10() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~SPI0_I2SMCLK_PF10_Msk)) | SPI0_I2SMCLK_PF10 /*!< Set PF10 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI0_I2SMCLK_PA4_Msk)) | SPI0_I2SMCLK_PA4 /*!< Set PA4 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PD14() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~SPI0_I2SMCLK_PD14_Msk)) | SPI0_I2SMCLK_PD14 /*!< Set PD14 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PD13() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~SPI0_I2SMCLK_PD13_Msk)) | SPI0_I2SMCLK_PD13 /*!< Set PD13 function to SPI0_I2SMCLK */ -#define SET_SPI0_MISO_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI0_MISO_PA1_Msk)) | SPI0_MISO_PA1 /*!< Set PA1 function to SPI0_MISO */ -#define SET_SPI0_MISO_PF7() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~SPI0_MISO_PF7_Msk)) | SPI0_MISO_PF7 /*!< Set PF7 function to SPI0_MISO */ -#define SET_SPI0_MISO_PD1() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI0_MISO_PD1_Msk)) | SPI0_MISO_PD1 /*!< Set PD1 function to SPI0_MISO */ -#define SET_SPI0_MISO_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI0_MISO_PB13_Msk)) | SPI0_MISO_PB13 /*!< Set PB13 function to SPI0_MISO */ -#define SET_SPI0_MOSI_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~SPI0_MOSI_PF6_Msk)) | SPI0_MOSI_PF6 /*!< Set PF6 function to SPI0_MOSI */ -#define SET_SPI0_MOSI_PD0() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI0_MOSI_PD0_Msk)) | SPI0_MOSI_PD0 /*!< Set PD0 function to SPI0_MOSI */ -#define SET_SPI0_MOSI_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI0_MOSI_PB12_Msk)) | SPI0_MOSI_PB12 /*!< Set PB12 function to SPI0_MOSI */ -#define SET_SPI0_MOSI_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI0_MOSI_PA0_Msk)) | SPI0_MOSI_PA0 /*!< Set PA0 function to SPI0_MOSI */ -#define SET_SPI0_SS_PF9() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~SPI0_SS_PF9_Msk)) | SPI0_SS_PF9 /*!< Set PF9 function to SPI0_SS */ -#define SET_SPI0_SS_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI0_SS_PA3_Msk)) | SPI0_SS_PA3 /*!< Set PA3 function to SPI0_SS */ -#define SET_SPI0_SS_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI0_SS_PB15_Msk)) | SPI0_SS_PB15 /*!< Set PB15 function to SPI0_SS */ -#define SET_SPI0_SS_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI0_SS_PD3_Msk)) | SPI0_SS_PD3 /*!< Set PD3 function to SPI0_SS */ -#define SET_SPI1_CLK_PD5() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI1_CLK_PD5_Msk)) | SPI1_CLK_PD5 /*!< Set PD5 function to SPI1_CLK */ -#define SET_SPI1_CLK_PH6() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~SPI1_CLK_PH6_Msk)) | SPI1_CLK_PH6 /*!< Set PH6 function to SPI1_CLK */ -#define SET_SPI1_CLK_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SPI1_CLK_PC1_Msk)) | SPI1_CLK_PC1 /*!< Set PC1 function to SPI1_CLK */ -#define SET_SPI1_CLK_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI1_CLK_PB3_Msk)) | SPI1_CLK_PB3 /*!< Set PB3 function to SPI1_CLK */ -#define SET_SPI1_CLK_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~SPI1_CLK_PH8_Msk)) | SPI1_CLK_PH8 /*!< Set PH8 function to SPI1_CLK */ -#define SET_SPI1_CLK_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI1_CLK_PA7_Msk)) | SPI1_CLK_PA7 /*!< Set PA7 function to SPI1_CLK */ -#define SET_SPI1_I2SMCLK_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SPI1_I2SMCLK_PC4_Msk)) | SPI1_I2SMCLK_PC4 /*!< Set PC4 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI1_I2SMCLK_PB1_Msk)) | SPI1_I2SMCLK_PB1 /*!< Set PB1 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI1_I2SMCLK_PA5_Msk)) | SPI1_I2SMCLK_PA5 /*!< Set PA5 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PD13() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~SPI1_I2SMCLK_PD13_Msk)) | SPI1_I2SMCLK_PD13 /*!< Set PD13 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~SPI1_I2SMCLK_PH10_Msk)) | SPI1_I2SMCLK_PH10 /*!< Set PH10 function to SPI1_I2SMCLK */ -#define SET_SPI1_MISO_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SPI1_MISO_PC3_Msk)) | SPI1_MISO_PC3 /*!< Set PC3 function to SPI1_MISO */ -#define SET_SPI1_MISO_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SPI1_MISO_PC7_Msk)) | SPI1_MISO_PC7 /*!< Set PC7 function to SPI1_MISO */ -#define SET_SPI1_MISO_PH4() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~SPI1_MISO_PH4_Msk)) | SPI1_MISO_PH4 /*!< Set PH4 function to SPI1_MISO */ -#define SET_SPI1_MISO_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI1_MISO_PB5_Msk)) | SPI1_MISO_PB5 /*!< Set PB5 function to SPI1_MISO */ -#define SET_SPI1_MISO_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SPI1_MISO_PE1_Msk)) | SPI1_MISO_PE1 /*!< Set PE1 function to SPI1_MISO */ -#define SET_SPI1_MISO_PD7() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI1_MISO_PD7_Msk)) | SPI1_MISO_PD7 /*!< Set PD7 function to SPI1_MISO */ -#define SET_SPI1_MOSI_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SPI1_MOSI_PE0_Msk)) | SPI1_MOSI_PE0 /*!< Set PE0 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI1_MOSI_PB4_Msk)) | SPI1_MOSI_PB4 /*!< Set PB4 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SPI1_MOSI_PC6_Msk)) | SPI1_MOSI_PC6 /*!< Set PC6 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PD6() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI1_MOSI_PD6_Msk)) | SPI1_MOSI_PD6 /*!< Set PD6 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PH5() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~SPI1_MOSI_PH5_Msk)) | SPI1_MOSI_PH5 /*!< Set PH5 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SPI1_MOSI_PC2_Msk)) | SPI1_MOSI_PC2 /*!< Set PC2 function to SPI1_MOSI */ -#define SET_SPI1_SS_PH7() SYS->GPH_MFPL = (SYS->GPH_MFPL & (~SPI1_SS_PH7_Msk)) | SPI1_SS_PH7 /*!< Set PH7 function to SPI1_SS */ -#define SET_SPI1_SS_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI1_SS_PB2_Msk)) | SPI1_SS_PB2 /*!< Set PB2 function to SPI1_SS */ -#define SET_SPI1_SS_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SPI1_SS_PA6_Msk)) | SPI1_SS_PA6 /*!< Set PA6 function to SPI1_SS */ -#define SET_SPI1_SS_PD4() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~SPI1_SS_PD4_Msk)) | SPI1_SS_PD4 /*!< Set PD4 function to SPI1_SS */ -#define SET_SPI1_SS_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~SPI1_SS_PH9_Msk)) | SPI1_SS_PH9 /*!< Set PH9 function to SPI1_SS */ -#define SET_SPI1_SS_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~SPI1_SS_PC0_Msk)) | SPI1_SS_PC0 /*!< Set PC0 function to SPI1_SS */ -#define SET_SPI2_CLK_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~SPI2_CLK_PE8_Msk)) | SPI2_CLK_PE8 /*!< Set PE8 function to SPI2_CLK */ -#define SET_SPI2_CLK_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_CLK_PA10_Msk)) | SPI2_CLK_PA10 /*!< Set PA10 function to SPI2_CLK */ -#define SET_SPI2_CLK_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_CLK_PA13_Msk)) | SPI2_CLK_PA13 /*!< Set PA13 function to SPI2_CLK */ -#define SET_SPI2_CLK_PG3() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~SPI2_CLK_PG3_Msk)) | SPI2_CLK_PG3 /*!< Set PG3 function to SPI2_CLK */ -#define SET_SPI2_I2SMCLK_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~SPI2_I2SMCLK_PE12_Msk)) | SPI2_I2SMCLK_PE12 /*!< Set PE12 function to SPI2_I2SMCLK */ -#define SET_SPI2_I2SMCLK_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~SPI2_I2SMCLK_PC13_Msk)) | SPI2_I2SMCLK_PC13 /*!< Set PC13 function to SPI2_I2SMCLK */ -#define SET_SPI2_I2SMCLK_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI2_I2SMCLK_PB0_Msk)) | SPI2_I2SMCLK_PB0 /*!< Set PB0 function to SPI2_I2SMCLK */ -#define SET_SPI2_MISO_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~SPI2_MISO_PE9_Msk)) | SPI2_MISO_PE9 /*!< Set PE9 function to SPI2_MISO */ -#define SET_SPI2_MISO_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_MISO_PA9_Msk)) | SPI2_MISO_PA9 /*!< Set PA9 function to SPI2_MISO */ -#define SET_SPI2_MISO_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_MISO_PA14_Msk)) | SPI2_MISO_PA14 /*!< Set PA14 function to SPI2_MISO */ -#define SET_SPI2_MISO_PG4() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~SPI2_MISO_PG4_Msk)) | SPI2_MISO_PG4 /*!< Set PG4 function to SPI2_MISO */ -#define SET_SPI2_MOSI_PF11() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~SPI2_MOSI_PF11_Msk)) | SPI2_MOSI_PF11 /*!< Set PF11 function to SPI2_MOSI */ -#define SET_SPI2_MOSI_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_MOSI_PA15_Msk)) | SPI2_MOSI_PA15 /*!< Set PA15 function to SPI2_MOSI */ -#define SET_SPI2_MOSI_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~SPI2_MOSI_PE10_Msk)) | SPI2_MOSI_PE10 /*!< Set PE10 function to SPI2_MOSI */ -#define SET_SPI2_MOSI_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_MOSI_PA8_Msk)) | SPI2_MOSI_PA8 /*!< Set PA8 function to SPI2_MOSI */ -#define SET_SPI2_SS_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~SPI2_SS_PE11_Msk)) | SPI2_SS_PE11 /*!< Set PE11 function to SPI2_SS */ -#define SET_SPI2_SS_PG2() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~SPI2_SS_PG2_Msk)) | SPI2_SS_PG2 /*!< Set PG2 function to SPI2_SS */ -#define SET_SPI2_SS_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_SS_PA11_Msk)) | SPI2_SS_PA11 /*!< Set PA11 function to SPI2_SS */ -#define SET_SPI2_SS_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~SPI2_SS_PA12_Msk)) | SPI2_SS_PA12 /*!< Set PA12 function to SPI2_SS */ -#define SET_SPI3_CLK_PC10() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~SPI3_CLK_PC10_Msk)) | SPI3_CLK_PC10 /*!< Set PC10 function to SPI3_CLK */ -#define SET_SPI3_CLK_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SPI3_CLK_PE4_Msk)) | SPI3_CLK_PE4 /*!< Set PE4 function to SPI3_CLK */ -#define SET_SPI3_CLK_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI3_CLK_PB11_Msk)) | SPI3_CLK_PB11 /*!< Set PB11 function to SPI3_CLK */ -#define SET_SPI3_I2SMCLK_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SPI3_I2SMCLK_PE6_Msk)) | SPI3_I2SMCLK_PE6 /*!< Set PE6 function to SPI3_I2SMCLK */ -#define SET_SPI3_I2SMCLK_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~SPI3_I2SMCLK_PF6_Msk)) | SPI3_I2SMCLK_PF6 /*!< Set PF6 function to SPI3_I2SMCLK */ -#define SET_SPI3_I2SMCLK_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~SPI3_I2SMCLK_PB1_Msk)) | SPI3_I2SMCLK_PB1 /*!< Set PB1 function to SPI3_I2SMCLK */ -#define SET_SPI3_I2SMCLK_PD14() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~SPI3_I2SMCLK_PD14_Msk)) | SPI3_I2SMCLK_PD14 /*!< Set PD14 function to SPI3_I2SMCLK */ -#define SET_SPI3_MISO_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SPI3_MISO_PE3_Msk)) | SPI3_MISO_PE3 /*!< Set PE3 function to SPI3_MISO */ -#define SET_SPI3_MISO_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~SPI3_MISO_PC12_Msk)) | SPI3_MISO_PC12 /*!< Set PC12 function to SPI3_MISO */ -#define SET_SPI3_MISO_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI3_MISO_PB9_Msk)) | SPI3_MISO_PB9 /*!< Set PB9 function to SPI3_MISO */ -#define SET_SPI3_MOSI_PC11() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~SPI3_MOSI_PC11_Msk)) | SPI3_MOSI_PC11 /*!< Set PC11 function to SPI3_MOSI */ -#define SET_SPI3_MOSI_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SPI3_MOSI_PE2_Msk)) | SPI3_MOSI_PE2 /*!< Set PE2 function to SPI3_MOSI */ -#define SET_SPI3_MOSI_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI3_MOSI_PB8_Msk)) | SPI3_MOSI_PB8 /*!< Set PB8 function to SPI3_MOSI */ -#define SET_SPI3_SS_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~SPI3_SS_PE5_Msk)) | SPI3_SS_PE5 /*!< Set PE5 function to SPI3_SS */ -#define SET_SPI3_SS_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~SPI3_SS_PB10_Msk)) | SPI3_SS_PB10 /*!< Set PB10 function to SPI3_SS */ -#define SET_SPI3_SS_PC9() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~SPI3_SS_PC9_Msk)) | SPI3_SS_PC9 /*!< Set PC9 function to SPI3_SS */ -#define SET_TAMPER0_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~TAMPER0_PF6_Msk)) | TAMPER0_PF6 /*!< Set PF6 function to TAMPER0 */ -#define SET_TAMPER1_PF7() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~TAMPER1_PF7_Msk)) | TAMPER1_PF7 /*!< Set PF7 function to TAMPER1 */ -#define SET_TAMPER2_PF8() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~TAMPER2_PF8_Msk)) | TAMPER2_PF8 /*!< Set PF8 function to TAMPER2 */ -#define SET_TAMPER3_PF9() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~TAMPER3_PF9_Msk)) | TAMPER3_PF9 /*!< Set PF9 function to TAMPER3 */ -#define SET_TAMPER4_PF10() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~TAMPER4_PF10_Msk)) | TAMPER4_PF10 /*!< Set PF10 function to TAMPER4 */ -#define SET_TAMPER5_PF11() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~TAMPER5_PF11_Msk)) | TAMPER5_PF11 /*!< Set PF11 function to TAMPER5 */ -#define SET_TM0_PG2() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~TM0_PG2_Msk)) | TM0_PG2 /*!< Set PG2 function to TM0 */ -#define SET_TM0_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~TM0_PB5_Msk)) | TM0_PB5 /*!< Set PB5 function to TM0 */ -#define SET_TM0_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~TM0_PC7_Msk)) | TM0_PC7 /*!< Set PC7 function to TM0 */ -#define SET_TM0_EXT_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~TM0_EXT_PB15_Msk)) | TM0_EXT_PB15 /*!< Set PB15 function to TM0_EXT */ -#define SET_TM0_EXT_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~TM0_EXT_PA11_Msk)) | TM0_EXT_PA11 /*!< Set PA11 function to TM0_EXT */ -#define SET_TM1_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~TM1_PC6_Msk)) | TM1_PC6 /*!< Set PC6 function to TM1 */ -#define SET_TM1_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~TM1_PB4_Msk)) | TM1_PB4 /*!< Set PB4 function to TM1 */ -#define SET_TM1_PG3() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~TM1_PG3_Msk)) | TM1_PG3 /*!< Set PG3 function to TM1 */ -#define SET_TM1_EXT_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~TM1_EXT_PB14_Msk)) | TM1_EXT_PB14 /*!< Set PB14 function to TM1_EXT */ -#define SET_TM1_EXT_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~TM1_EXT_PA10_Msk)) | TM1_EXT_PA10 /*!< Set PA10 function to TM1_EXT */ -#define SET_TM2_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~TM2_PB3_Msk)) | TM2_PB3 /*!< Set PB3 function to TM2 */ -#define SET_TM2_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~TM2_PA7_Msk)) | TM2_PA7 /*!< Set PA7 function to TM2 */ -#define SET_TM2_PD0() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~TM2_PD0_Msk)) | TM2_PD0 /*!< Set PD0 function to TM2 */ -#define SET_TM2_PG4() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~TM2_PG4_Msk)) | TM2_PG4 /*!< Set PG4 function to TM2 */ -#define SET_TM2_EXT_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~TM2_EXT_PB13_Msk)) | TM2_EXT_PB13 /*!< Set PB13 function to TM2_EXT */ -#define SET_TM2_EXT_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~TM2_EXT_PA9_Msk)) | TM2_EXT_PA9 /*!< Set PA9 function to TM2_EXT */ -#define SET_TM3_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~TM3_PB2_Msk)) | TM3_PB2 /*!< Set PB2 function to TM3 */ -#define SET_TM3_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~TM3_PA6_Msk)) | TM3_PA6 /*!< Set PA6 function to TM3 */ -#define SET_TM3_PF11() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~TM3_PF11_Msk)) | TM3_PF11 /*!< Set PF11 function to TM3 */ -#define SET_TM3_EXT_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~TM3_EXT_PB12_Msk)) | TM3_EXT_PB12 /*!< Set PB12 function to TM3_EXT */ -#define SET_TM3_EXT_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~TM3_EXT_PA8_Msk)) | TM3_EXT_PA8 /*!< Set PA8 function to TM3_EXT */ -#define SET_TM4_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~TM4_PA7_Msk)) | TM4_PA7 /*!< Set PA7 function to TM4 */ -#define SET_TM4_PG4() SYS->GPG_MFPL = (SYS->GPG_MFPL & (~TM4_PG4_Msk)) | TM4_PG4 /*!< Set PG4 function to TM4 */ -#define SET_TM4_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~TM4_PB3_Msk)) | TM4_PB3 /*!< Set PB3 function to TM4 */ -#define SET_TM4_EXT_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~TM4_EXT_PB13_Msk)) | TM4_EXT_PB13 /*!< Set PB13 function to TM4_EXT */ -#define SET_TM4_EXT_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~TM4_EXT_PA9_Msk)) | TM4_EXT_PA9 /*!< Set PA9 function to TM4_EXT */ -#define SET_TM5_PF11() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~TM5_PF11_Msk)) | TM5_PF11 /*!< Set PF11 function to TM5 */ -#define SET_TM5_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~TM5_PB2_Msk)) | TM5_PB2 /*!< Set PB2 function to TM5 */ -#define SET_TM5_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~TM5_PA6_Msk)) | TM5_PA6 /*!< Set PA6 function to TM5 */ -#define SET_TM5_EXT_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~TM5_EXT_PA8_Msk)) | TM5_EXT_PA8 /*!< Set PA8 function to TM5_EXT */ -#define SET_TM5_EXT_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~TM5_EXT_PB12_Msk)) | TM5_EXT_PB12 /*!< Set PB12 function to TM5_EXT */ -#define SET_TRACE_CLK_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~TRACE_CLK_PE12_Msk)) | TRACE_CLK_PE12 /*!< Set PE12 function to TRACE_CLK */ -#define SET_TRACE_DATA0_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~TRACE_DATA0_PE11_Msk)) | TRACE_DATA0_PE11 /*!< Set PE11 function to TRACE_DATA0 */ -#define SET_TRACE_DATA1_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~TRACE_DATA1_PE10_Msk)) | TRACE_DATA1_PE10 /*!< Set PE10 function to TRACE_DATA1 */ -#define SET_TRACE_DATA2_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~TRACE_DATA2_PE9_Msk)) | TRACE_DATA2_PE9 /*!< Set PE9 function to TRACE_DATA2 */ -#define SET_TRACE_DATA3_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~TRACE_DATA3_PE8_Msk)) | TRACE_DATA3_PE8 /*!< Set PE8 function to TRACE_DATA3 */ -#define SET_UART0_RXD_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~UART0_RXD_PA15_Msk)) | UART0_RXD_PA15 /*!< Set PA15 function to UART0_RXD */ -#define SET_UART0_RXD_PD2() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART0_RXD_PD2_Msk)) | UART0_RXD_PD2 /*!< Set PD2 function to UART0_RXD */ -#define SET_UART0_RXD_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_RXD_PA4_Msk)) | UART0_RXD_PA4 /*!< Set PA4 function to UART0_RXD */ -#define SET_UART0_RXD_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_RXD_PB12_Msk)) | UART0_RXD_PB12 /*!< Set PB12 function to UART0_RXD */ -#define SET_UART0_RXD_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_RXD_PA0_Msk)) | UART0_RXD_PA0 /*!< Set PA0 function to UART0_RXD */ -#define SET_UART0_RXD_PF1() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART0_RXD_PF1_Msk)) | UART0_RXD_PF1 /*!< Set PF1 function to UART0_RXD */ -#define SET_UART0_RXD_PC11() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~UART0_RXD_PC11_Msk)) | UART0_RXD_PC11 /*!< Set PC11 function to UART0_RXD */ -#define SET_UART0_RXD_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_RXD_PB8_Msk)) | UART0_RXD_PB8 /*!< Set PB8 function to UART0_RXD */ -#define SET_UART0_RXD_PH11() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART0_RXD_PH11_Msk)) | UART0_RXD_PH11 /*!< Set PH11 function to UART0_RXD */ -#define SET_UART0_RXD_PA6() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_RXD_PA6_Msk)) | UART0_RXD_PA6 /*!< Set PA6 function to UART0_RXD */ -#define SET_UART0_RXD_PF2() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART0_RXD_PF2_Msk)) | UART0_RXD_PF2 /*!< Set PF2 function to UART0_RXD */ -#define SET_UART0_TXD_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_TXD_PA5_Msk)) | UART0_TXD_PA5 /*!< Set PA5 function to UART0_TXD */ -#define SET_UART0_TXD_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~UART0_TXD_PA14_Msk)) | UART0_TXD_PA14 /*!< Set PA14 function to UART0_TXD */ -#define SET_UART0_TXD_PF3() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART0_TXD_PF3_Msk)) | UART0_TXD_PF3 /*!< Set PF3 function to UART0_TXD */ -#define SET_UART0_TXD_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_TXD_PA1_Msk)) | UART0_TXD_PA1 /*!< Set PA1 function to UART0_TXD */ -#define SET_UART0_TXD_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART0_TXD_PH10_Msk)) | UART0_TXD_PH10 /*!< Set PH10 function to UART0_TXD */ -#define SET_UART0_TXD_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART0_TXD_PD3_Msk)) | UART0_TXD_PD3 /*!< Set PD3 function to UART0_TXD */ -#define SET_UART0_TXD_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_TXD_PB9_Msk)) | UART0_TXD_PB9 /*!< Set PB9 function to UART0_TXD */ -#define SET_UART0_TXD_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_TXD_PB13_Msk)) | UART0_TXD_PB13 /*!< Set PB13 function to UART0_TXD */ -#define SET_UART0_TXD_PA7() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_TXD_PA7_Msk)) | UART0_TXD_PA7 /*!< Set PA7 function to UART0_TXD */ -#define SET_UART0_TXD_PF0() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART0_TXD_PF0_Msk)) | UART0_TXD_PF0 /*!< Set PF0 function to UART0_TXD */ -#define SET_UART0_TXD_PC12() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~UART0_TXD_PC12_Msk)) | UART0_TXD_PC12 /*!< Set PC12 function to UART0_TXD */ -#define SET_UART0_nCTS_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_nCTS_PB15_Msk)) | UART0_nCTS_PB15 /*!< Set PB15 function to UART0_nCTS */ -#define SET_UART0_nCTS_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_nCTS_PB11_Msk)) | UART0_nCTS_PB11 /*!< Set PB11 function to UART0_nCTS */ -#define SET_UART0_nCTS_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART0_nCTS_PC7_Msk)) | UART0_nCTS_PC7 /*!< Set PC7 function to UART0_nCTS */ -#define SET_UART0_nCTS_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_nCTS_PA5_Msk)) | UART0_nCTS_PA5 /*!< Set PA5 function to UART0_nCTS */ -#define SET_UART0_nRTS_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART0_nRTS_PC6_Msk)) | UART0_nRTS_PC6 /*!< Set PC6 function to UART0_nRTS */ -#define SET_UART0_nRTS_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_nRTS_PB14_Msk)) | UART0_nRTS_PB14 /*!< Set PB14 function to UART0_nRTS */ -#define SET_UART0_nRTS_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART0_nRTS_PB10_Msk)) | UART0_nRTS_PB10 /*!< Set PB10 function to UART0_nRTS */ -#define SET_UART0_nRTS_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART0_nRTS_PA4_Msk)) | UART0_nRTS_PA4 /*!< Set PA4 function to UART0_nRTS */ -#define SET_UART1_RXD_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~UART1_RXD_PA8_Msk)) | UART1_RXD_PA8 /*!< Set PA8 function to UART1_RXD */ -#define SET_UART1_RXD_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART1_RXD_PB6_Msk)) | UART1_RXD_PB6 /*!< Set PB6 function to UART1_RXD */ -#define SET_UART1_RXD_PC8() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~UART1_RXD_PC8_Msk)) | UART1_RXD_PC8 /*!< Set PC8 function to UART1_RXD */ -#define SET_UART1_RXD_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART1_RXD_PA2_Msk)) | UART1_RXD_PA2 /*!< Set PA2 function to UART1_RXD */ -#define SET_UART1_RXD_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART1_RXD_PH9_Msk)) | UART1_RXD_PH9 /*!< Set PH9 function to UART1_RXD */ -#define SET_UART1_RXD_PD10() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~UART1_RXD_PD10_Msk)) | UART1_RXD_PD10 /*!< Set PD10 function to UART1_RXD */ -#define SET_UART1_RXD_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART1_RXD_PB2_Msk)) | UART1_RXD_PB2 /*!< Set PB2 function to UART1_RXD */ -#define SET_UART1_RXD_PD6() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART1_RXD_PD6_Msk)) | UART1_RXD_PD6 /*!< Set PD6 function to UART1_RXD */ -#define SET_UART1_RXD_PF1() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART1_RXD_PF1_Msk)) | UART1_RXD_PF1 /*!< Set PF1 function to UART1_RXD */ -#define SET_UART1_TXD_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~UART1_TXD_PA9_Msk)) | UART1_TXD_PA9 /*!< Set PA9 function to UART1_TXD */ -#define SET_UART1_TXD_PD11() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~UART1_TXD_PD11_Msk)) | UART1_TXD_PD11 /*!< Set PD11 function to UART1_TXD */ -#define SET_UART1_TXD_PF0() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART1_TXD_PF0_Msk)) | UART1_TXD_PF0 /*!< Set PF0 function to UART1_TXD */ -#define SET_UART1_TXD_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART1_TXD_PB3_Msk)) | UART1_TXD_PB3 /*!< Set PB3 function to UART1_TXD */ -#define SET_UART1_TXD_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART1_TXD_PH8_Msk)) | UART1_TXD_PH8 /*!< Set PH8 function to UART1_TXD */ -#define SET_UART1_TXD_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART1_TXD_PA3_Msk)) | UART1_TXD_PA3 /*!< Set PA3 function to UART1_TXD */ -#define SET_UART1_TXD_PD7() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART1_TXD_PD7_Msk)) | UART1_TXD_PD7 /*!< Set PD7 function to UART1_TXD */ -#define SET_UART1_TXD_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART1_TXD_PE13_Msk)) | UART1_TXD_PE13 /*!< Set PE13 function to UART1_TXD */ -#define SET_UART1_TXD_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART1_TXD_PB7_Msk)) | UART1_TXD_PB7 /*!< Set PB7 function to UART1_TXD */ -#define SET_UART1_nCTS_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART1_nCTS_PB9_Msk)) | UART1_nCTS_PB9 /*!< Set PB9 function to UART1_nCTS */ -#define SET_UART1_nCTS_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART1_nCTS_PE11_Msk)) | UART1_nCTS_PE11 /*!< Set PE11 function to UART1_nCTS */ -#define SET_UART1_nCTS_PA1() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART1_nCTS_PA1_Msk)) | UART1_nCTS_PA1 /*!< Set PA1 function to UART1_nCTS */ -#define SET_UART1_nRTS_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART1_nRTS_PB8_Msk)) | UART1_nRTS_PB8 /*!< Set PB8 function to UART1_nRTS */ -#define SET_UART1_nRTS_PA0() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART1_nRTS_PA0_Msk)) | UART1_nRTS_PA0 /*!< Set PA0 function to UART1_nRTS */ -#define SET_UART1_nRTS_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART1_nRTS_PE12_Msk)) | UART1_nRTS_PE12 /*!< Set PE12 function to UART1_nRTS */ -#define SET_UART2_RXD_PE15() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART2_RXD_PE15_Msk)) | UART2_RXD_PE15 /*!< Set PE15 function to UART2_RXD */ -#define SET_UART2_RXD_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART2_RXD_PC4_Msk)) | UART2_RXD_PC4 /*!< Set PC4 function to UART2_RXD */ -#define SET_UART2_RXD_PD12() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~UART2_RXD_PD12_Msk)) | UART2_RXD_PD12 /*!< Set PD12 function to UART2_RXD */ -#define SET_UART2_RXD_PF5() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART2_RXD_PF5_Msk)) | UART2_RXD_PF5 /*!< Set PF5 function to UART2_RXD */ -#define SET_UART2_RXD_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART2_RXD_PE9_Msk)) | UART2_RXD_PE9 /*!< Set PE9 function to UART2_RXD */ -#define SET_UART2_RXD_PC0() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART2_RXD_PC0_Msk)) | UART2_RXD_PC0 /*!< Set PC0 function to UART2_RXD */ -#define SET_UART2_RXD_PB0() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART2_RXD_PB0_Msk)) | UART2_RXD_PB0 /*!< Set PB0 function to UART2_RXD */ -#define SET_UART2_RXD_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART2_RXD_PB4_Msk)) | UART2_RXD_PB4 /*!< Set PB4 function to UART2_RXD */ -#define SET_UART2_TXD_PF4() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART2_TXD_PF4_Msk)) | UART2_TXD_PF4 /*!< Set PF4 function to UART2_TXD */ -#define SET_UART2_TXD_PC1() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART2_TXD_PC1_Msk)) | UART2_TXD_PC1 /*!< Set PC1 function to UART2_TXD */ -#define SET_UART2_TXD_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART2_TXD_PB5_Msk)) | UART2_TXD_PB5 /*!< Set PB5 function to UART2_TXD */ -#define SET_UART2_TXD_PE14() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART2_TXD_PE14_Msk)) | UART2_TXD_PE14 /*!< Set PE14 function to UART2_TXD */ -#define SET_UART2_TXD_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~UART2_TXD_PC13_Msk)) | UART2_TXD_PC13 /*!< Set PC13 function to UART2_TXD */ -#define SET_UART2_TXD_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART2_TXD_PC5_Msk)) | UART2_TXD_PC5 /*!< Set PC5 function to UART2_TXD */ -#define SET_UART2_TXD_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART2_TXD_PE8_Msk)) | UART2_TXD_PE8 /*!< Set PE8 function to UART2_TXD */ -#define SET_UART2_TXD_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART2_TXD_PB1_Msk)) | UART2_TXD_PB1 /*!< Set PB1 function to UART2_TXD */ -#define SET_UART2_nCTS_PF5() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART2_nCTS_PF5_Msk)) | UART2_nCTS_PF5 /*!< Set PF5 function to UART2_nCTS */ -#define SET_UART2_nCTS_PD9() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~UART2_nCTS_PD9_Msk)) | UART2_nCTS_PD9 /*!< Set PD9 function to UART2_nCTS */ -#define SET_UART2_nCTS_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART2_nCTS_PC2_Msk)) | UART2_nCTS_PC2 /*!< Set PC2 function to UART2_nCTS */ -#define SET_UART2_nRTS_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART2_nRTS_PC3_Msk)) | UART2_nRTS_PC3 /*!< Set PC3 function to UART2_nRTS */ -#define SET_UART2_nRTS_PD8() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~UART2_nRTS_PD8_Msk)) | UART2_nRTS_PD8 /*!< Set PD8 function to UART2_nRTS */ -#define SET_UART2_nRTS_PF4() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART2_nRTS_PF4_Msk)) | UART2_nRTS_PF4 /*!< Set PF4 function to UART2_nRTS */ -#define SET_UART3_RXD_PD0() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART3_RXD_PD0_Msk)) | UART3_RXD_PD0 /*!< Set PD0 function to UART3_RXD */ -#define SET_UART3_RXD_PC9() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~UART3_RXD_PC9_Msk)) | UART3_RXD_PC9 /*!< Set PC9 function to UART3_RXD */ -#define SET_UART3_RXD_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~UART3_RXD_PE0_Msk)) | UART3_RXD_PE0 /*!< Set PE0 function to UART3_RXD */ -#define SET_UART3_RXD_PC2() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART3_RXD_PC2_Msk)) | UART3_RXD_PC2 /*!< Set PC2 function to UART3_RXD */ -#define SET_UART3_RXD_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART3_RXD_PB14_Msk)) | UART3_RXD_PB14 /*!< Set PB14 function to UART3_RXD */ -#define SET_UART3_RXD_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART3_RXD_PE11_Msk)) | UART3_RXD_PE11 /*!< Set PE11 function to UART3_RXD */ -#define SET_UART3_TXD_PC10() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~UART3_TXD_PC10_Msk)) | UART3_TXD_PC10 /*!< Set PC10 function to UART3_TXD */ -#define SET_UART3_TXD_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART3_TXD_PB15_Msk)) | UART3_TXD_PB15 /*!< Set PB15 function to UART3_TXD */ -#define SET_UART3_TXD_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART3_TXD_PE10_Msk)) | UART3_TXD_PE10 /*!< Set PE10 function to UART3_TXD */ -#define SET_UART3_TXD_PC3() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART3_TXD_PC3_Msk)) | UART3_TXD_PC3 /*!< Set PC3 function to UART3_TXD */ -#define SET_UART3_TXD_PD1() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART3_TXD_PD1_Msk)) | UART3_TXD_PD1 /*!< Set PD1 function to UART3_TXD */ -#define SET_UART3_TXD_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~UART3_TXD_PE1_Msk)) | UART3_TXD_PE1 /*!< Set PE1 function to UART3_TXD */ -#define SET_UART3_nCTS_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART3_nCTS_PB12_Msk)) | UART3_nCTS_PB12 /*!< Set PB12 function to UART3_nCTS */ -#define SET_UART3_nCTS_PH9() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART3_nCTS_PH9_Msk)) | UART3_nCTS_PH9 /*!< Set PH9 function to UART3_nCTS */ -#define SET_UART3_nCTS_PD2() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART3_nCTS_PD2_Msk)) | UART3_nCTS_PD2 /*!< Set PD2 function to UART3_nCTS */ -#define SET_UART3_nRTS_PH8() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART3_nRTS_PH8_Msk)) | UART3_nRTS_PH8 /*!< Set PH8 function to UART3_nRTS */ -#define SET_UART3_nRTS_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~UART3_nRTS_PD3_Msk)) | UART3_nRTS_PD3 /*!< Set PD3 function to UART3_nRTS */ -#define SET_UART3_nRTS_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART3_nRTS_PB13_Msk)) | UART3_nRTS_PB13 /*!< Set PB13 function to UART3_nRTS */ -#define SET_UART4_RXD_PA2() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART4_RXD_PA2_Msk)) | UART4_RXD_PA2 /*!< Set PA2 function to UART4_RXD */ -#define SET_UART4_RXD_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~UART4_RXD_PA13_Msk)) | UART4_RXD_PA13 /*!< Set PA13 function to UART4_RXD */ -#define SET_UART4_RXD_PC4() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART4_RXD_PC4_Msk)) | UART4_RXD_PC4 /*!< Set PC4 function to UART4_RXD */ -#define SET_UART4_RXD_PH11() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART4_RXD_PH11_Msk)) | UART4_RXD_PH11 /*!< Set PH11 function to UART4_RXD */ -#define SET_UART4_RXD_PF6() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART4_RXD_PF6_Msk)) | UART4_RXD_PF6 /*!< Set PF6 function to UART4_RXD */ -#define SET_UART4_RXD_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART4_RXD_PB10_Msk)) | UART4_RXD_PB10 /*!< Set PB10 function to UART4_RXD */ -#define SET_UART4_RXD_PC6() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART4_RXD_PC6_Msk)) | UART4_RXD_PC6 /*!< Set PC6 function to UART4_RXD */ -#define SET_UART4_TXD_PA3() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART4_TXD_PA3_Msk)) | UART4_TXD_PA3 /*!< Set PA3 function to UART4_TXD */ -#define SET_UART4_TXD_PC5() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART4_TXD_PC5_Msk)) | UART4_TXD_PC5 /*!< Set PC5 function to UART4_TXD */ -#define SET_UART4_TXD_PC7() SYS->GPC_MFPL = (SYS->GPC_MFPL & (~UART4_TXD_PC7_Msk)) | UART4_TXD_PC7 /*!< Set PC7 function to UART4_TXD */ -#define SET_UART4_TXD_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~UART4_TXD_PA12_Msk)) | UART4_TXD_PA12 /*!< Set PA12 function to UART4_TXD */ -#define SET_UART4_TXD_PF7() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~UART4_TXD_PF7_Msk)) | UART4_TXD_PF7 /*!< Set PF7 function to UART4_TXD */ -#define SET_UART4_TXD_PH10() SYS->GPH_MFPH = (SYS->GPH_MFPH & (~UART4_TXD_PH10_Msk)) | UART4_TXD_PH10 /*!< Set PH10 function to UART4_TXD */ -#define SET_UART4_TXD_PB11() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~UART4_TXD_PB11_Msk)) | UART4_TXD_PB11 /*!< Set PB11 function to UART4_TXD */ -#define SET_UART4_nCTS_PC8() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~UART4_nCTS_PC8_Msk)) | UART4_nCTS_PC8 /*!< Set PC8 function to UART4_nCTS */ -#define SET_UART4_nCTS_PE1() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~UART4_nCTS_PE1_Msk)) | UART4_nCTS_PE1 /*!< Set PE1 function to UART4_nCTS */ -#define SET_UART4_nRTS_PE0() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~UART4_nRTS_PE0_Msk)) | UART4_nRTS_PE0 /*!< Set PE0 function to UART4_nRTS */ -#define SET_UART4_nRTS_PE13() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~UART4_nRTS_PE13_Msk)) | UART4_nRTS_PE13 /*!< Set PE13 function to UART4_nRTS */ -#define SET_UART5_RXD_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART5_RXD_PB4_Msk)) | UART5_RXD_PB4 /*!< Set PB4 function to UART5_RXD */ -#define SET_UART5_RXD_PF10() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~UART5_RXD_PF10_Msk)) | UART5_RXD_PF10 /*!< Set PF10 function to UART5_RXD */ -#define SET_UART5_RXD_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~UART5_RXD_PE6_Msk)) | UART5_RXD_PE6 /*!< Set PE6 function to UART5_RXD */ -#define SET_UART5_RXD_PA4() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART5_RXD_PA4_Msk)) | UART5_RXD_PA4 /*!< Set PA4 function to UART5_RXD */ -#define SET_UART5_TXD_PF11() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~UART5_TXD_PF11_Msk)) | UART5_TXD_PF11 /*!< Set PF11 function to UART5_TXD */ -#define SET_UART5_TXD_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART5_TXD_PB5_Msk)) | UART5_TXD_PB5 /*!< Set PB5 function to UART5_TXD */ -#define SET_UART5_TXD_PE7() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~UART5_TXD_PE7_Msk)) | UART5_TXD_PE7 /*!< Set PE7 function to UART5_TXD */ -#define SET_UART5_TXD_PA5() SYS->GPA_MFPL = (SYS->GPA_MFPL & (~UART5_TXD_PA5_Msk)) | UART5_TXD_PA5 /*!< Set PA5 function to UART5_TXD */ -#define SET_UART5_nCTS_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART5_nCTS_PB2_Msk)) | UART5_nCTS_PB2 /*!< Set PB2 function to UART5_nCTS */ -#define SET_UART5_nCTS_PF8() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~UART5_nCTS_PF8_Msk)) | UART5_nCTS_PF8 /*!< Set PF8 function to UART5_nCTS */ -#define SET_UART5_nRTS_PF9() SYS->GPF_MFPH = (SYS->GPF_MFPH & (~UART5_nRTS_PF9_Msk)) | UART5_nRTS_PF9 /*!< Set PF9 function to UART5_nRTS */ -#define SET_UART5_nRTS_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~UART5_nRTS_PB3_Msk)) | UART5_nRTS_PB3 /*!< Set PB3 function to UART5_nRTS */ -#define SET_USB_D_P_PA14() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USB_D_P_PA14_Msk)) | USB_D_P_PA14 /*!< Set PA14 function to USB_D_P */ -#define SET_USB_D_N_PA13() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USB_D_N_PA13_Msk)) | USB_D_N_PA13 /*!< Set PA13 function to USB_D_N */ -#define SET_USB_OTG_ID_PA15() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USB_OTG_ID_PA15_Msk)) | USB_OTG_ID_PA15 /*!< Set PA15 function to USB_OTG_ID */ -#define SET_USB_VBUS_PA12() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USB_VBUS_PA12_Msk)) | USB_VBUS_PA12 /*!< Set PA12 function to USB_VBUS */ -#define SET_USB_VBUS_EN_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USB_VBUS_EN_PB15_Msk)) | USB_VBUS_EN_PB15 /*!< Set PB15 function to USB_VBUS_EN */ -#define SET_USB_VBUS_EN_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USB_VBUS_EN_PB6_Msk)) | USB_VBUS_EN_PB6 /*!< Set PB6 function to USB_VBUS_EN */ -#define SET_USB_VBUS_ST_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USB_VBUS_ST_PB14_Msk)) | USB_VBUS_ST_PB14 /*!< Set PB14 function to USB_VBUS_ST */ -#define SET_USB_VBUS_ST_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USB_VBUS_ST_PB7_Msk)) | USB_VBUS_ST_PB7 /*!< Set PB7 function to USB_VBUS_ST */ -#define SET_USB_VBUS_ST_PD4() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USB_VBUS_ST_PD4_Msk)) | USB_VBUS_ST_PD4 /*!< Set PD4 function to USB_VBUS_ST */ -#define SET_USCI0_CLK_PA11() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USCI0_CLK_PA11_Msk)) | USCI0_CLK_PA11 /*!< Set PA11 function to USCI0_CLK */ -#define SET_USCI0_CLK_PD0() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI0_CLK_PD0_Msk)) | USCI0_CLK_PD0 /*!< Set PD0 function to USCI0_CLK */ -#define SET_USCI0_CLK_PB12() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USCI0_CLK_PB12_Msk)) | USCI0_CLK_PB12 /*!< Set PB12 function to USCI0_CLK */ -#define SET_USCI0_CLK_PE2() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~USCI0_CLK_PE2_Msk)) | USCI0_CLK_PE2 /*!< Set PE2 function to USCI0_CLK */ -#define SET_USCI0_CTL0_PC13() SYS->GPC_MFPH = (SYS->GPC_MFPH & (~USCI0_CTL0_PC13_Msk)) | USCI0_CTL0_PC13 /*!< Set PC13 function to USCI0_CTL0 */ -#define SET_USCI0_CTL0_PD14() SYS->GPD_MFPH = (SYS->GPD_MFPH & (~USCI0_CTL0_PD14_Msk)) | USCI0_CTL0_PD14 /*!< Set PD14 function to USCI0_CTL0 */ -#define SET_USCI0_CTL0_PE6() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~USCI0_CTL0_PE6_Msk)) | USCI0_CTL0_PE6 /*!< Set PE6 function to USCI0_CTL0 */ -#define SET_USCI0_CTL0_PD4() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI0_CTL0_PD4_Msk)) | USCI0_CTL0_PD4 /*!< Set PD4 function to USCI0_CTL0 */ -#define SET_USCI0_CTL1_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI0_CTL1_PD3_Msk)) | USCI0_CTL1_PD3 /*!< Set PD3 function to USCI0_CTL1 */ -#define SET_USCI0_CTL1_PA8() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USCI0_CTL1_PA8_Msk)) | USCI0_CTL1_PA8 /*!< Set PA8 function to USCI0_CTL1 */ -#define SET_USCI0_CTL1_PE5() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~USCI0_CTL1_PE5_Msk)) | USCI0_CTL1_PE5 /*!< Set PE5 function to USCI0_CTL1 */ -#define SET_USCI0_CTL1_PB15() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USCI0_CTL1_PB15_Msk)) | USCI0_CTL1_PB15 /*!< Set PB15 function to USCI0_CTL1 */ -#define SET_USCI0_DAT0_PB13() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USCI0_DAT0_PB13_Msk)) | USCI0_DAT0_PB13 /*!< Set PB13 function to USCI0_DAT0 */ -#define SET_USCI0_DAT0_PE3() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~USCI0_DAT0_PE3_Msk)) | USCI0_DAT0_PE3 /*!< Set PE3 function to USCI0_DAT0 */ -#define SET_USCI0_DAT0_PA10() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USCI0_DAT0_PA10_Msk)) | USCI0_DAT0_PA10 /*!< Set PA10 function to USCI0_DAT0 */ -#define SET_USCI0_DAT0_PD1() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI0_DAT0_PD1_Msk)) | USCI0_DAT0_PD1 /*!< Set PD1 function to USCI0_DAT0 */ -#define SET_USCI0_DAT1_PA9() SYS->GPA_MFPH = (SYS->GPA_MFPH & (~USCI0_DAT1_PA9_Msk)) | USCI0_DAT1_PA9 /*!< Set PA9 function to USCI0_DAT1 */ -#define SET_USCI0_DAT1_PE4() SYS->GPE_MFPL = (SYS->GPE_MFPL & (~USCI0_DAT1_PE4_Msk)) | USCI0_DAT1_PE4 /*!< Set PE4 function to USCI0_DAT1 */ -#define SET_USCI0_DAT1_PB14() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USCI0_DAT1_PB14_Msk)) | USCI0_DAT1_PB14 /*!< Set PB14 function to USCI0_DAT1 */ -#define SET_USCI0_DAT1_PD2() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI0_DAT1_PD2_Msk)) | USCI0_DAT1_PD2 /*!< Set PD2 function to USCI0_DAT1 */ -#define SET_USCI1_CLK_PE12() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~USCI1_CLK_PE12_Msk)) | USCI1_CLK_PE12 /*!< Set PE12 function to USCI1_CLK */ -#define SET_USCI1_CLK_PB1() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USCI1_CLK_PB1_Msk)) | USCI1_CLK_PB1 /*!< Set PB1 function to USCI1_CLK */ -#define SET_USCI1_CLK_PD7() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI1_CLK_PD7_Msk)) | USCI1_CLK_PD7 /*!< Set PD7 function to USCI1_CLK */ -#define SET_USCI1_CLK_PB8() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USCI1_CLK_PB8_Msk)) | USCI1_CLK_PB8 /*!< Set PB8 function to USCI1_CLK */ -#define SET_USCI1_CTL0_PE9() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~USCI1_CTL0_PE9_Msk)) | USCI1_CTL0_PE9 /*!< Set PE9 function to USCI1_CTL0 */ -#define SET_USCI1_CTL0_PB5() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USCI1_CTL0_PB5_Msk)) | USCI1_CTL0_PB5 /*!< Set PB5 function to USCI1_CTL0 */ -#define SET_USCI1_CTL0_PD3() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI1_CTL0_PD3_Msk)) | USCI1_CTL0_PD3 /*!< Set PD3 function to USCI1_CTL0 */ -#define SET_USCI1_CTL0_PB10() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USCI1_CTL0_PB10_Msk)) | USCI1_CTL0_PB10 /*!< Set PB10 function to USCI1_CTL0 */ -#define SET_USCI1_CTL1_PB4() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USCI1_CTL1_PB4_Msk)) | USCI1_CTL1_PB4 /*!< Set PB4 function to USCI1_CTL1 */ -#define SET_USCI1_CTL1_PD4() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI1_CTL1_PD4_Msk)) | USCI1_CTL1_PD4 /*!< Set PD4 function to USCI1_CTL1 */ -#define SET_USCI1_CTL1_PE8() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~USCI1_CTL1_PE8_Msk)) | USCI1_CTL1_PE8 /*!< Set PE8 function to USCI1_CTL1 */ -#define SET_USCI1_CTL1_PB9() SYS->GPB_MFPH = (SYS->GPB_MFPH & (~USCI1_CTL1_PB9_Msk)) | USCI1_CTL1_PB9 /*!< Set PB9 function to USCI1_CTL1 */ -#define SET_USCI1_DAT0_PB7() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USCI1_DAT0_PB7_Msk)) | USCI1_DAT0_PB7 /*!< Set PB7 function to USCI1_DAT0 */ -#define SET_USCI1_DAT0_PE10() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~USCI1_DAT0_PE10_Msk)) | USCI1_DAT0_PE10 /*!< Set PE10 function to USCI1_DAT0 */ -#define SET_USCI1_DAT0_PB2() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USCI1_DAT0_PB2_Msk)) | USCI1_DAT0_PB2 /*!< Set PB2 function to USCI1_DAT0 */ -#define SET_USCI1_DAT0_PD5() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI1_DAT0_PD5_Msk)) | USCI1_DAT0_PD5 /*!< Set PD5 function to USCI1_DAT0 */ -#define SET_USCI1_DAT1_PD6() SYS->GPD_MFPL = (SYS->GPD_MFPL & (~USCI1_DAT1_PD6_Msk)) | USCI1_DAT1_PD6 /*!< Set PD6 function to USCI1_DAT1 */ -#define SET_USCI1_DAT1_PB6() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USCI1_DAT1_PB6_Msk)) | USCI1_DAT1_PB6 /*!< Set PB6 function to USCI1_DAT1 */ -#define SET_USCI1_DAT1_PE11() SYS->GPE_MFPH = (SYS->GPE_MFPH & (~USCI1_DAT1_PE11_Msk)) | USCI1_DAT1_PE11 /*!< Set PE11 function to USCI1_DAT1 */ -#define SET_USCI1_DAT1_PB3() SYS->GPB_MFPL = (SYS->GPB_MFPL & (~USCI1_DAT1_PB3_Msk)) | USCI1_DAT1_PB3 /*!< Set PB3 function to USCI1_DAT1 */ -#define SET_X32_IN_PF5() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~X32_IN_PF5_Msk)) | X32_IN_PF5 /*!< Set PF5 function to X32_IN */ -#define SET_X32_OUT_PF4() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~X32_OUT_PF4_Msk)) | X32_OUT_PF4 /*!< Set PF4 function to X32_OUT */ -#define SET_XT1_IN_PF3() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~XT1_IN_PF3_Msk)) | XT1_IN_PF3 /*!< Set PF3 function to XT1_IN */ -#define SET_XT1_OUT_PF2() SYS->GPF_MFPL = (SYS->GPF_MFPL & (~XT1_OUT_PF2_Msk)) | XT1_OUT_PF2 /*!< Set PF2 function to XT1_OUT */ - - -/** - * @brief Clear Brown-out detector interrupt flag - * @param None - * @return None - * @details This macro clear Brown-out detector interrupt flag. - */ -#define SYS_CLEAR_BOD_INT_FLAG() \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL |= SYS_BODCTL_BODIF_Msk; \ - }while(0) - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This macro disable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_DISABLE_BOD() \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk; \ - }while(0) - -/** - * @brief Enable Brown-out detector function - * @param None - * @return None - * @details This macro enable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_ENABLE_BOD() \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL |= SYS_BODCTL_BODEN_Msk; \ - }while(0) - -/** - * @brief Get Brown-out detector interrupt flag - * @param None - * @retval 0 Brown-out detect interrupt flag is not set. - * @retval >=1 Brown-out detect interrupt flag is set. - * @details This macro get Brown-out detector interrupt flag. - */ -#define SYS_GET_BOD_INT_FLAG() (SYS->BODCTL & SYS_BODCTL_BODIF_Msk) - -/** - * @brief Get Brown-out detector status - * @param None - * @retval 0 System voltage is higher than BOD threshold voltage setting or BOD function is disabled. - * @retval >=1 System voltage is lower than BOD threshold voltage setting. - * @details This macro get Brown-out detector output status. - * If the BOD function is disabled, this function always return 0. - */ -#define SYS_GET_BOD_OUTPUT() (SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) - -/** - * @brief Enable Brown-out detector interrupt function - * @param None - * @return None - * @details This macro enable Brown-out detector interrupt function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_DISABLE_BOD_RST() \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL &= ~SYS_BODCTL_BODRSTEN_Msk; \ - }while(0) - -/** - * @brief Enable Brown-out detector reset function - * @param None - * @return None - * @details This macro enable Brown-out detect reset function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_ENABLE_BOD_RST() \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL |= SYS_BODCTL_BODRSTEN_Msk; \ - }while(0) - -/** - * @brief Set Brown-out detector voltage level - * @param[in] u32Level is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_1_6V - * - \ref SYS_BODCTL_BODVL_1_8V - * - \ref SYS_BODCTL_BODVL_2_0V - * - \ref SYS_BODCTL_BODVL_2_2V - * - \ref SYS_BODCTL_BODVL_2_4V - * - \ref SYS_BODCTL_BODVL_2_6V - * - \ref SYS_BODCTL_BODVL_2_8V - * - \ref SYS_BODCTL_BODVL_3_0V - * @return None - * @details This macro set Brown-out detector voltage level. - * The write-protection function should be disabled before using this macro. - */ -#define SYS_SET_BOD_LEVEL(u32Level) \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | (u32Level); \ - }while(0) - -/** - * @brief Get reset source is from Brown-out detector reset - * @param None - * @retval 0 Previous reset source is not from Brown-out detector reset - * @retval >=1 Previous reset source is from Brown-out detector reset - * @details This macro get previous reset source is from Brown-out detect reset or not. - */ -#define SYS_IS_BOD_RST() (SYS->RSTSTS & SYS_RSTSTS_BODRF_Msk) - -/** - * @brief Get reset source is from CPU reset - * @param None - * @retval 0 Previous reset source is not from CPU reset - * @retval >=1 Previous reset source is from CPU reset - * @details This macro get previous reset source is from CPU reset. - */ -#define SYS_IS_CPU_RST() (SYS->RSTSTS & SYS_RSTSTS_CPURF_Msk) - -/** - * @brief Get reset source is from LVR Reset - * @param None - * @retval 0 Previous reset source is not from Low-Voltage-Reset - * @retval >=1 Previous reset source is from Low-Voltage-Reset - * @details This macro get previous reset source is from Low-Voltage-Reset. - */ -#define SYS_IS_LVR_RST() (SYS->RSTSTS & SYS_RSTSTS_LVRF_Msk) - -/** - * @brief Get reset source is from Power-on Reset - * @param None - * @retval 0 Previous reset source is not from Power-on Reset - * @retval >=1 Previous reset source is from Power-on Reset - * @details This macro get previous reset source is from Power-on Reset. - */ -#define SYS_IS_POR_RST() (SYS->RSTSTS & SYS_RSTSTS_PORF_Msk) - -/** - * @brief Get reset source is from reset pin reset - * @param None - * @retval 0 Previous reset source is not from reset pin reset - * @retval >=1 Previous reset source is from reset pin reset - * @details This macro get previous reset source is from reset pin reset. - */ -#define SYS_IS_RSTPIN_RST() (SYS->RSTSTS & SYS_RSTSTS_PINRF_Msk) - -/** - * @brief Get reset source is from system reset - * @param None - * @retval 0 Previous reset source is not from system reset - * @retval >=1 Previous reset source is from system reset - * @details This macro get previous reset source is from system reset. - */ -#define SYS_IS_SYSTEM_RST() (SYS->RSTSTS & SYS_RSTSTS_SYSRF_Msk) - -/** - * @brief Get reset source is from window watch dog reset - * @param None - * @retval 0 Previous reset source is not from window watch dog reset - * @retval >=1 Previous reset source is from window watch dog reset - * @details This macro get previous reset source is from window watch dog reset. - */ -#define SYS_IS_WDT_RST() (SYS->RSTSTS & SYS_RSTSTS_WDTRF_Msk) - -/** - * @brief Disable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro disable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_DISABLE_LVR() \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL &= ~SYS_BODCTL_LVREN_Msk; \ - }while(0) - -/** - * @brief Enable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro enable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_ENABLE_LVR() \ - do{ \ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); \ - SYS->BODCTL |= SYS_BODCTL_LVREN_Msk; \ - }while(0) - -/** - * @brief Disable Power-on Reset function - * @param None - * @return None - * @details This macro disable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_DISABLE_POR() (SYS->PORCTL0 = 0x5AA5) - -/** - * @brief Enable Power-on Reset function - * @param None - * @return None - * @details This macro enable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - */ -#define SYS_ENABLE_POR() (SYS->PORCTL0 = 0) - -/** - * @brief Clear reset source flag - * @param[in] u32RstSrc is reset source. Including : - * - \ref SYS_RSTSTS_PORF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_SYSRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_CPULKRF_Msk - * @return None - * @details This macro clear reset source flag. - */ -#define SYS_CLEAR_RST_SOURCE(u32RstSrc) ((SYS->RSTSTS) = (u32RstSrc) ) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SYS_UnlockReg(void); -__STATIC_INLINE void SYS_LockReg(void); - - -/** - * @brief Disable register write-protection function - * @param None - * @return None - * @details This function disable register write-protection function. - * To unlock the protected register to allow write access. - */ -__STATIC_INLINE void SYS_UnlockReg(void) -{ - do - { - SYS->REGLCTL = 0x59UL; - SYS->REGLCTL = 0x16UL; - SYS->REGLCTL = 0x88UL; - } - while(SYS->REGLCTL == 0UL); -} - -/** - * @brief Enable register write-protection function - * @param None - * @return None - * @details This function is used to enable register write-protection function. - * To lock the protected register to forbid write access. - */ -__STATIC_INLINE void SYS_LockReg(void) -{ - SYS->REGLCTL = 0UL; -} - - -void SYS_ClearResetSrc(uint32_t u32Src); -uint32_t SYS_GetBODStatus(void); -uint32_t SYS_GetResetSrc(void); -uint32_t SYS_IsRegLocked(void); -uint32_t SYS_ReadPDID(void); -void SYS_ResetChip(void); -void SYS_ResetCPU(void); -void SYS_ResetModule(uint32_t u32ModuleIndex); -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel); -void SYS_DisableBOD(void); -void SYS_SetPowerLevel(uint32_t u32PowerLevel); -uint32_t SYS_SetPowerRegulator(uint32_t u32PowerRegulator); -void SYS_SetSSRAMPowerMode(uint32_t u32SRAMSel, uint32_t u32PowerMode); -void SYS_SetPSRAMPowerMode(uint32_t u32SRAMSel, uint32_t u32PowerMode); -void SYS_SetVRef(uint32_t u32VRefCTL); - - -/**@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SYS_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SYS_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_tamper.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_tamper.h deleted file mode 100644 index 4edf9459cf8..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_tamper.h +++ /dev/null @@ -1,464 +0,0 @@ -/**************************************************************************//** - * @file nu_tamper.h - * @version V3.00 - * @brief M2354 series TAMPER driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TAMPER_H__ -#define __NU_TAMPER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TAMPER_Driver Tamper Driver - @{ -*/ - -/** @addtogroup TAMPER_EXPORTED_CONSTANTS Tamper Exported Constants - @{ -*/ - -#define TAMPER_TAMPER0_SELECT (0x1UL << 0) /*!< Select Tamper 0 */ -#define TAMPER_TAMPER1_SELECT (0x1UL << 1) /*!< Select Tamper 1 */ -#define TAMPER_TAMPER2_SELECT (0x1UL << 2) /*!< Select Tamper 2 */ -#define TAMPER_TAMPER3_SELECT (0x1UL << 3) /*!< Select Tamper 3 */ -#define TAMPER_TAMPER4_SELECT (0x1UL << 4) /*!< Select Tamper 4 */ -#define TAMPER_TAMPER5_SELECT (0x1UL << 5) /*!< Select Tamper 5 */ -#define TAMPER_MAX_TAMPER_PIN_NUM 6UL /*!< Tamper Pin number */ - -#define TAMPER_TAMPER_HIGH_LEVEL_DETECT 1UL /*!< Tamper pin detect voltage level is high */ -#define TAMPER_TAMPER_LOW_LEVEL_DETECT 0UL /*!< Tamper pin detect voltage level is low */ - -#define TAMPER_TAMPER_DEBOUNCE_ENABLE 1UL /*!< Enable tamper pin de-bounce function */ -#define TAMPER_TAMPER_DEBOUNCE_DISABLE 0UL /*!< Disable tamper pin de-bounce function */ - -#define TAMPER_PAIR0_SELECT (0x1UL << 0) /*!< Select Pair 0 */ -#define TAMPER_PAIR1_SELECT (0x1UL << 1) /*!< Select Pair 1 */ -#define TAMPER_PAIR2_SELECT (0x1UL << 2) /*!< Select Pair 2 */ -#define TAMPER_MAX_PAIR_NUM 3UL /*!< Pair number */ - -#define TAMPER_2POW6_CLK (0x0UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 RTC clock cycles */ -#define TAMPER_2POW7_CLK (0x1UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 x 2 RTC clock cycles */ -#define TAMPER_2POW8_CLK (0x2UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 x 4 RTC clock cycles */ -#define TAMPER_2POW9_CLK (0x3UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 x 6 RTC clock cycles */ -#define TAMPER_2POW10_CLK (0x4UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 x 8 RTC clock cycles */ -#define TAMPER_2POW11_CLK (0x5UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 x 10 RTC clock cycles */ -#define TAMPER_2POW12_CLK (0x6UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 x 12 RTC clock cycles */ -#define TAMPER_2POW13_CLK (0x7UL << TAMPER_TIOCTL_DYNRATE_Pos) /*!< 64 x 14 RTC clock cycles */ - -#define TAMPER_ACTS_2POW10_CLK (0x0UL << 5) /*!< 1024 LIRC32K clock cycles */ -#define TAMPER_ACTS_2POW11_CLK (0x1UL << 5) /*!< 1024 x 2 LIRC32K clock cycles */ -#define TAMPER_ACTS_2POW12_CLK (0x2UL << 5) /*!< 1024 x 4 LIRC32K clock cycles */ -#define TAMPER_ACTS_2POW13_CLK (0x3UL << 5) /*!< 1024 x 6 LIRC32K clock cycles */ -#define TAMPER_ACTS_2POW14_CLK (0x4UL << 5) /*!< 1024 x 8 LIRC32K clock cycles */ -#define TAMPER_ACTS_2POW15_CLK (0x5UL << 5) /*!< 1024 x 16 LIRC32K clock cycles */ -#define TAMPER_ACTS_2POW16_CLK (0x6UL << 5) /*!< 1024 x 32 LIRC32K clock cycles */ -#define TAMPER_ACTS_2POW17_CLK (0x7UL << 5) /*!< 1024 x 64 LIRC32K clock cycles */ - -#define TAMPER_REF_RANDOM_PATTERN 0x0UL /*!< The new reference pattern is generated by random number generator when the reference pattern run out */ -#define TAMPER_REF_SEED 0x1UL /*!< The new reference pattern is repeated from SEED (TAMPER_SEED[31:0]) when the reference pattern run out */ - -#define TAMPER_VG_192M_SAMPLE 0x0UL /*!< Select voltage glitch 192M sampleing rate */ - -/**@}*/ /* end of group TAMPER_EXPORTED_CONSTANTS */ - - -/** @addtogroup TAMPER_EXPORTED_FUNCTIONS Tamper Exported Functions - @{ -*/ - -/** - * @brief Reset Tamper Coreblock - * - * @param None - * - * @return None - * - * @details To set TAMPER INIT control register to reset the tamper coreblock. - * - */ -#define TAMPER_CORE_RESET() ((uint32_t)(TAMPER->INIT = 0x55AA)) - -/** - * @brief Release Tamper Coreblock - * - * @param None - * - * @return None - * - * @details To set TAMPER INIT control register to release the tamper coreblock. - * - */ -#define TAMPER_CORE_RELEASE() ((uint32_t)(TAMPER->INIT = 0x5500)) - -/** - * @brief Get the Voltage Regulator Power Ready Status - * - * @param None - * - * @retval 0 The power status of voltage regulator is not ready. - * @retval 1 The power status of voltage regulator is ready. - * - * @details This macro will return the power status of voltage regulator. - * - */ -#define TAMPER_TLDO_IS_READY() (TAMPER->INIT & TAMPER_INIT_TLDORDY_Msk ? 1:0) - -/** - * @brief Enable LXT Clock Detection - * - * @param None - * - * @return None - * - * @details To set TAMPER FUNEN control register to enable LXT clock detection. - * - */ -#define TAMPER_ENABLE_LXTDET() ((uint32_t)(TAMPER->FUNEN = (TAMPER->FUNEN & ~0xFFUL) | 0x44)) - -/** - * @brief Disable LXT Clock Detection - * - * @param None - * - * @return None - * - * @details To set TAMPER FUNEN control register to disable LXT clock detection. - * - */ -#define TAMPER_DISABLE_LXTDET() ((uint32_t)(TAMPER->FUNEN = (TAMPER->FUNEN & ~0xFFUL) | 0x40)) - -/** - * @brief Tamper I/O TAMPER Block Detection Selection - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref TAMPER_TAMPER0_SELECT - * - \ref TAMPER_TAMPER1_SELECT - * - \ref TAMPER_TAMPER2_SELECT - * - \ref TAMPER_TAMPER3_SELECT - * - \ref TAMPER_TAMPER4_SELECT - * - \ref TAMPER_TAMPER5_SELECT - * - * @return None - * - * @details To set TAMPER FUNEN control register to select tamper I/O 0~5 and its function is detected through TAMPER block. - * - */ -__STATIC_INLINE void TAMPER_IOSEL_TAMPER(uint32_t u32TamperSelect) -{ - uint32_t i; - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_TAMPER_PIN_NUM; i++) - { - if(u32TamperSelect & (0x1UL << i)) - { - TAMPER->FUNEN = (TAMPER->FUNEN & ~0xFFUL) | (0x94 + i * 0x10UL); - } - } -} - -/** - * @brief Tamper I/O RTC Block Detection Selection - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref TAMPER_TAMPER0_SELECT - * - \ref TAMPER_TAMPER1_SELECT - * - \ref TAMPER_TAMPER2_SELECT - * - \ref TAMPER_TAMPER3_SELECT - * - \ref TAMPER_TAMPER4_SELECT - * - \ref TAMPER_TAMPER5_SELECT - * - * @return None - * - * @details To set TAMPER FUNEN control register to select tamper I/O 0~5 and its function is detected through RTC block. - * - */ -__STATIC_INLINE void TAMPER_IOSEL_RTC(uint32_t u32TamperSelect) -{ - uint32_t i; - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_TAMPER_PIN_NUM; i++) - { - if(u32TamperSelect & (0x1UL << i)) - { - TAMPER->FUNEN = (TAMPER->FUNEN & ~0xFFUL) | (0x90 + i * 0x10UL); - } - } -} - -/** - * @brief Enable HIRC48M - * - * @param None - * - * @return None - * - * @details To set TAMPER FUNEN control register to enable HIRC48M. - * - */ -#define TAMPER_ENABLE_HIRC48M() ((uint32_t)(TAMPER->FUNEN &= (~TAMPER_FUNEN_HIRC48MEN_Msk))) - -/** - * @brief Disable HIRC48M - * - * @param None - * - * @return None - * - * @details To set TAMPER FUNEN control register to disable HIRC48M. - * - */ -#define TAMPER_DISABLE_HIRC48M() ((uint32_t)(TAMPER->FUNEN = (TAMPER->FUNEN & (~TAMPER_FUNEN_HIRC48MEN_Msk)) | (0x5A << TAMPER_FUNEN_HIRC48MEN_Pos))) - -/** - * @brief Voltage Glitch Sampling Rate Selection - * - * @param[in] u32VGSampleRate Voltage Glitch sampling rate select. Possible option is - * - \ref TAMPER_VG_192M_SAMPLE - * - * @return None - * - * @details To set TAMPER FUNEN control register to enable voltage glitch channel 0~3 to select voltage glitch sampling rate. - * - */ -__STATIC_INLINE void TAMPER_VG_SAMPLE_SEL(uint32_t u32VGSampleRate) -{ - TAMPER->FUNEN &= ~0xF000000UL; - - if(u32VGSampleRate == TAMPER_VG_192M_SAMPLE) - { - TAMPER->FUNEN |= TAMPER_FUNEN_VGCHEN0_Msk | TAMPER_FUNEN_VGCHEN1_Msk | TAMPER_FUNEN_VGCHEN2_Msk | TAMPER_FUNEN_VGCHEN3_Msk; - } -} - -/** - * @brief Enable to Trigger Key Store - * - * @param None - * - * @return None - * - * @details Set KSTRIGEN bit of TAMPER TRIEN control register to trigger Key Store when Tamper event is detected. - * - */ -#define TAMPER_ENABLE_KS_TRIG() ((uint32_t)(TAMPER->TRIEN |= TAMPER_TRIEN_KSTRIGEN_Msk)) - -/** - * @brief Disable to Trigger Key Store - * - * @param None - * - * @return None - * - * @details Clear KSTRIGEN bit of TAMPER TRIEN control register to not trigger Key Store when Tamper event is detected. - * - */ -#define TAMPER_DISABLE_KS_TRIG() ((uint32_t)(TAMPER->TRIEN &= (~TAMPER_TRIEN_KSTRIGEN_Msk))) - -/** - * @brief Enable Wake-up Function - * - * @param None - * - * @return None - * - * @details Set WAKEUPEN bit of TAMPER TRIEN control register to wake-up the system when Tamper event is detected. - * - */ -#define TAMPER_ENABLE_WAKEUP() ((uint32_t)(TAMPER->TRIEN |= TAMPER_TRIEN_WAKEUPEN_Msk)) - -/** - * @brief Disable Wake-up Function - * - * @param None - * - * @return None - * - * @details Clear WAKEUPEN bit of TAMPER TRIEN control register to not wake-up the system when Tamper event is detected. - * - */ -#define TAMPER_DISABLE_WAKEUP() ((uint32_t)(TAMPER->TRIEN &= (~TAMPER_TRIEN_WAKEUPEN_Msk))) - -/** - * @brief Enable to Clear Crypto Function - * - * @param None - * - * @return None - * - * @details Set CRYPTOEN bit of TAMPER TRIEN control register to reset Crypto when Tamper event is detected. - * - */ -#define TAMPER_ENABLE_CRYPTO() ((uint32_t)(TAMPER->TRIEN |= TAMPER_TRIEN_CRYPTOEN_Msk)) - -/** - * @brief Disable to Clear Crypto Function - * - * @param None - * - * @return None - * - * @details Clear CRYPTOEN bit of TAMPER TRIEN control register to not reset Crypto when Tamper event is detected. - * - */ -#define TAMPER_DISABLE_CRYPTO() ((uint32_t)(TAMPER->TRIEN &= (~TAMPER_TRIEN_CRYPTOEN_Msk))) - -/** - * @brief Enable to Trigger Chip Reset - * - * @param None - * - * @return None - * - * @details Set CHIPRSTEN bit of TAMPER TRIEN control register to reset the system when Tamper event is detected. - * - */ -#define TAMPER_ENABLE_CHIPRST() ((uint32_t)(TAMPER->TRIEN |= TAMPER_TRIEN_CHIPRSTEN_Msk)) - -/** - * @brief Disable to Trigger Chip Reset - * - * @param None - * - * @return None - * - * @details Clear CHIPRSTEN bit of TAMPER TRIEN control register to not reset the system when Tamper event is detected. - * - */ -#define TAMPER_DISABLE_CHIPRST() ((uint32_t)(TAMPER->TRIEN &= (~TAMPER_TRIEN_CHIPRSTEN_Msk))) - -/** - * @brief Enable to Clear RTC Spare Register - * - * @param None - * - * @return None - * - * @details Set RTCSPCLREN bit of TAMPER TRIEN control register to reset RTC spare register when Tamper event is detected. - * - */ -#define TAMPER_ENABLE_RTCSPCLR() ((uint32_t)(TAMPER->TRIEN |= TAMPER_TRIEN_RTCSPCLREN_Msk)) - -/** - * @brief Disable to Clear RTC Spare Register - * - * @param None - * - * @return None - * - * @details Clear RTCSPCLREN bit of TAMPER TRIEN control register to not reset RTC spare register when Tamper event is detected. - * - */ -#define TAMPER_DISABLE_RTCSPCLR() ((uint32_t)(TAMPER->TRIEN &= (~TAMPER_TRIEN_RTCSPCLREN_Msk))) - -/** - * @brief Get Tamper Interrupt Flag - * - * @param None - * - * @retval 0 Tamper event Interrupt did not occur - * @retval 1 Tamper event Interrupt occurred - * - * @details This macro indicates Tamper event intertupt occurred or not. - * - */ -#define TAMPER_GET_INT_FLAG() ((TAMPER->INTSTS & (0xAA7FAFFF))? 1:0) - -/** - * @brief Clear Tamper Interrupt Status - * - * @param[in] u32TamperFlag Tamper event interrupt flag. It consists of: - * - \ref TAMPER_INTSTS_TAMP0IF_Msk - * - \ref TAMPER_INTSTS_TAMP1IF_Msk - * - \ref TAMPER_INTSTS_TAMP2IF_Msk - * - \ref TAMPER_INTSTS_TAMP3IF_Msk - * - \ref TAMPER_INTSTS_TAMP4IF_Msk - * - \ref TAMPER_INTSTS_TAMP5IF_Msk - * - \ref TAMPER_INTSTS_CLKFAILIF_Msk - * - \ref TAMPER_INTSTS_CLKSTOPIF_Msk - * - \ref TAMPER_INTSTS_OVPOUTIF_Msk - * - \ref TAMPER_INTSTS_VGPEVIF_Msk - * - \ref TAMPER_INTSTS_VGNEVIF_Msk - * - \ref TAMPER_INTSTS_ACTSEIF_Msk - * - \ref TAMPER_INTSTS_ACTST5IF_Msk - * - \ref TAMPER_INTSTS_ACTST25IF_Msk - * - \ref TAMPER_INTSTS_BODIF_Msk - * - \ref TAMPER_INTSTS_ACTST1IF_Msk - * - \ref TAMPER_INTSTS_ACTST3IF_Msk - * - \ref TAMPER_INTSTS_ACTST21IF_Msk - * - \ref TAMPER_INTSTS_ACTST23IF_Msk - * - * @return None - * - * @details This macro is used to clear Tamper event flag. - * - */ -#define TAMPER_CLR_INT_STATUS(u32TamperFlag) (TAMPER->INTSTS = (u32TamperFlag)) - -/** - * @brief Get Tamper Interrupt Status - * - * @param None - * - * @retval TAMPER_INTSTS_TAMP0IF_Msk - * @retval TAMPER_INTSTS_TAMP1IF_Msk - * @retval TAMPER_INTSTS_TAMP2IF_Msk - * @retval TAMPER_INTSTS_TAMP3IF_Msk - * @retval TAMPER_INTSTS_TAMP4IF_Msk - * @retval TAMPER_INTSTS_TAMP5IF_Msk - * @retval TAMPER_INTSTS_CLKFAILIF_Msk - * @retval TAMPER_INTSTS_CLKSTOPIF_Msk - * @retval TAMPER_INTSTS_OVPOUTIF_Msk - * @retval TAMPER_INTSTS_VGPEVIF_Msk - * @retval TAMPER_INTSTS_VGNEVIF_Msk - * @retval TAMPER_INTSTS_ACTSEFIF_Msk - * @retval TAMPER_INTSTS_ACTST5IF_Msk - * @retval TAMPER_INTSTS_ACTST25IF_Msk - * @retval TAMPER_INTSTS_RTCLVRIF_Msk - * @retval TAMPER_INTSTS_RIOTRIGIF_Msk - * @retval TAMPER_INTSTS_RCLKTRIGIF_Msk - * @retval TAMPER_INTSTS_BODIF_Msk - * @retval TAMPER_INTSTS_ACTST1IF_Msk - * @retval TAMPER_INTSTS_ACTST3IF_Msk - * @retval TAMPER_INTSTS_ACTST21IF_Msk - * @retval TAMPER_INTSTS_ACTST23IF_Msk - * - * @details This macro indicates Tamper event status. - * - */ -#define TAMPER_GET_INT_STATUS() ((TAMPER->INTSTS & (0xAA7FAFFF))) - -void TAMPER_EnableInt(uint32_t u32IntFlagMask); -void TAMPER_DisableInt(uint32_t u32IntFlagMask); -void TAMPER_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn); -void TAMPER_StaticTamperDisable(uint32_t u32TamperSelect); -void TAMPER_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source); -void TAMPER_DynamicTamperDisable(uint32_t u32PairSel); -void TAMPER_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed); -void TAMPER_ActiveShieldDynamicTamperEnable(uint32_t u32PairSel1, uint32_t u32Pair1Source1, uint32_t u32PairSel2, uint32_t u32Pair1Source2); -void TAMPER_ActiveShieldDynamicTamperDisable(uint32_t u32PairSel1, uint32_t u32PairSe2); -void TAMPER_ActiveShieldDynamicTamperConfig(uint32_t u32ChangeRate1, uint32_t u32SeedReload1, uint32_t u32RefPattern1, uint32_t u32Seed, - uint32_t u32ChangeRate2, uint32_t u32SeedReload2, uint32_t u32RefPattern2, uint32_t u32Seed2); - - -/**@}*/ /* end of group TAMPER_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group TAMPER_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_TAMPER_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer.h deleted file mode 100644 index 21bd179d7ec..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer.h +++ /dev/null @@ -1,541 +0,0 @@ -/**************************************************************************//** - * @file nu_timer.h - * @version V3.00 - * @brief Timer Controller(Timer) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_H__ -#define __NU_TIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_CONSTANTS TIMER Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* TIMER Operation Mode, External Counter and Capture Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TIMER_ONESHOT_MODE (0UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in one-shot mode \hideinitializer */ -#define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in periodic mode \hideinitializer */ -#define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in toggle-output mode \hideinitializer */ -#define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in continuous counting mode \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX (0UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx pin \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX_EXT (1UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx_EXT pin \hideinitializer */ - -#define TIMER_COUNTER_EVENT_FALLING (0UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on falling edge detection \hideinitializer */ -#define TIMER_COUNTER_EVENT_RISING (1UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on rising edge detection \hideinitializer */ -#define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to get timer counter value \hideinitializer */ -#define TIMER_CAPTURE_COUNTER_RESET_MODE (1UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to reset timer counter \hideinitializer */ - -#define TIMER_CAPTURE_EVENT_FALLING (0UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Falling edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING (1UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Rising edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_FALLING_RISING (2UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both falling and rising edge detection to trigger capture event, and first event at falling edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING_FALLING (3UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both rising and falling edge detection to trigger capture event, and first event at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_LOW_PERIOD (6UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at falling edge, follows are at at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_HIGH_PERIOD (7UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at rising edge, follows are at at falling edge \hideinitializer */ - -#define TIMER_CAPTURE_SOURCE_FROM_PIN (0UL << TIMER_CTL_CAPSRC_Pos) /*!< The capture source is from TMx_EXT pin \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_FROM_INTERNAL (1UL << TIMER_CTL_CAPSRC_Pos) /*!< The capture source is from internal ACMPx signal or clock source \hideinitializer */ - -#define TIMER_CAPTURE_SOURCE_DIV_1 (0UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 1 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_2 (1UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 2 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_4 (2UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 4 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_8 (3UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 8 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_16 (4UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 16 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_32 (5UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 32 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_64 (6UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 64 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_128 (7UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 128 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_256 (8UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 256 \hideinitializer */ - -#define TIMER_INTER_CAPTURE_SOURCE_ACMP0 (0UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from internal ACMP0 output signal \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_ACMP1 (1UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from internal ACMP1 output signal \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_HXT (2UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from HXT \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_LXT (3UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from LXT \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_HIRC (4UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from HIRC \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_LIRC (5UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from LIRC \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_MIRC (6UL << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< Capture source from MIRC. Only available on TIMER4 and TIMER5 \hideinitializer */ - -#define TIMER_TRGSRC_TIMEOUT_EVENT (0UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer time-out event \hideinitializer */ -#define TIMER_TRGSRC_CAPTURE_EVENT (1UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer capture event \hideinitializer */ -#define TIMER_TRG_TO_PWM (TIMER_TRGCTL_TRGPWM_Msk) /*!< Each timer event as EPWM and BPWM counter clock source. NOT supported on TIMER4 and TIMER5 \hideinitializer */ -#define TIMER_TRG_TO_EADC (TIMER_TRGCTL_TRGEADC_Msk) /*!< Each timer event to start ADC conversion \hideinitializer */ -#define TIMER_TRG_TO_DAC (TIMER_TRGCTL_TRGDAC_Msk) /*!< Each timer event to start DAC conversion. NOT supported on TIMER4 and TIMER5 \hideinitializer */ -#define TIMER_TRG_TO_PDMA (TIMER_TRGCTL_TRGPDMA_Msk) /*!< Each timer event to trigger PDMA transfer \hideinitializer */ - -/**@}*/ /* end of group TIMER_EXPORTED_CONSTANTS */ - - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Set Timer Compared Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Value Timer compare value. Valid values are between 2 to 0xFFFFFF. - * - * @return None - * - * @details This macro is used to set timer compared value to adjust timer time-out interval. - * @note 1. Never write 0x0 or 0x1 in this field, or the core will run into unknown state. \n - * 2. If update timer compared value in continuous counting mode, timer counter value will keep counting continuously. \n - * But if timer is operating at other modes, the timer up counter will restart counting and start from 0. - * \hideinitializer - */ -#define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMP = (u32Value)) - -/** - * @brief Set Timer Prescale Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Value Timer prescale value. Valid values are between 0 to 0xFF. - * - * @return None - * - * @details This macro is used to set timer prescale value and timer source clock will be divided by (prescale + 1) \n - * before it is fed into timer. - * \hideinitializer - */ -#define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_PSC_Msk) | (u32Value)) - -/** - * @brief Check specify Timer Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Timer 24-bit up counter is inactive - * @retval 1 Timer 24-bit up counter is active - * - * @details This macro is used to check if specify Timer counter is inactive or active. - * \hideinitializer - */ -#define TIMER_IS_ACTIVE(timer) ((((timer)->CTL & TIMER_CTL_ACTSTS_Msk) == TIMER_CTL_ACTSTS_Msk)? 1 : 0) - -/** - * @brief Select Toggle-output Pin - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32ToutSel Toggle-output pin selection, valid values are: - * - \ref TIMER_TOUT_PIN_FROM_TMX - * - \ref TIMER_TOUT_PIN_FROM_TMX_EXT - * - * @return None - * - * @details This macro is used to select timer toggle-output pin is output on TMx or TMx_EXT pin. - * \hideinitializer - */ -#define TIMER_SELECT_TOUT_PIN(timer, u32ToutSel) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_TGLPINSEL_Msk) | (u32ToutSel)) - -/** - * @brief Set Timer Operating Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32OpMode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * - * @return None - * \hideinitializer - */ -#define TIMER_SET_OPMODE(timer, u32OpMode) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_OPMODE_Msk) | (u32OpMode)) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer); -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer); -__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer); - - -/** - * @brief Start Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to start Timer counting. - */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to stop/suspend Timer counting. - */ -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Enable Timer Interrupt Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to enable the timer interrupt wake-up function and interrupt source could be time-out interrupt, \n - * counter event interrupt or capture trigger interrupt. - * @note To wake the system from Power-down mode, timer clock source must be ether LXT or LIRC. - */ -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Disable Timer Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to disable the timer interrupt wake-up function. - */ -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Start Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to start Timer capture function. - */ -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Stop Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to stop Timer capture function. - */ -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Disable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Enable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Disable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Enable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to enable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Disable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to disable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Enable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to enable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Disable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to disable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Get Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Timer time-out interrupt did not occur - * @retval 1 Timer time-out interrupt occurred - * - * @details This function indicates timer time-out interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer) -{ - return (((timer->INTSTS & TIMER_INTSTS_TIF_Msk) == TIMER_INTSTS_TIF_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function clears timer time-out interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TIF_Msk; -} - -/** - * @brief Get Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Timer capture interrupt did not occur - * @retval 1 Timer capture interrupt occurred - * - * @details This function indicates timer capture trigger interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer) -{ - return timer->EINTSTS; -} - -/** - * @brief Clear Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function clears timer capture trigger interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer) -{ - timer->EINTSTS = TIMER_EINTSTS_CAPIF_Msk; -} - -/** - * @brief Get Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Timer does not cause CPU wake-up - * @retval 1 Timer interrupt event cause CPU wake-up - * - * @details This function indicates timer interrupt event has waked up system or not. - */ -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer) -{ - return (((timer->INTSTS & TIMER_INTSTS_TWKF_Msk) == TIMER_INTSTS_TWKF_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function clears the timer wake-up system flag to 0. - */ -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TWKF_Msk; -} - -/** - * @brief Get Capture value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return 24-bit Capture Value - * - * @details This function reports the current 24-bit timer capture value. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer) -{ - return timer->CAP; -} - -/** - * @brief Get Counter value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return 24-bit Counter Value - * - * @details This function reports the current 24-bit timer counter value. - */ -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer) -{ - return timer->CNT; -} - -/** - * @brief Reset Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to reset current counter value and internal prescale counter value. - */ -__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer) -{ - timer->CNT = 0UL; - while((timer->CNT & TIMER_CNT_RSTACT_Msk) == TIMER_CNT_RSTACT_Msk) {} -} - - -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq); -void TIMER_Close(TIMER_T *timer); -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec); -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge); -void TIMER_DisableCapture(TIMER_T *timer); -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge); -void TIMER_DisableEventCounter(TIMER_T *timer); -uint32_t TIMER_GetModuleClock(TIMER_T *timer); -void TIMER_EnableFreqCounter(TIMER_T *timer, uint32_t u32DropCount, uint32_t u32Timeout, uint32_t u32EnableInt); -void TIMER_DisableFreqCounter(TIMER_T *timer); -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src); -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask); - -/**@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group TIMER_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_TIMER_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer_pwm.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer_pwm.h deleted file mode 100644 index 5627fb9851d..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_timer_pwm.h +++ /dev/null @@ -1,877 +0,0 @@ -/**************************************************************************//** - * @file timer.h - * @version V3.00 - * @brief Timer PWM Controller(Timer PWM) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_PWM_H__ -#define __NU_TIMER_PWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_CONSTANTS TIMER PWM Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Channel Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CH0 (BIT0) /*!< Indicate PWMx_CH0 \hideinitializer */ -#define TPWM_CH1 (BIT1) /*!< Indicate PWMx_CH1 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_UP_COUNT (0UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up count type \hideinitializer */ -#define TPWM_DOWN_COUNT (1UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Down count type \hideinitializer */ -#define TPWM_UP_DOWN_COUNT (2UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up-Down count type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_AUTO_RELOAD_MODE (0UL) /*!< Auto-reload mode \hideinitializer */ -#define TPWM_ONE_SHOT_MODE (TIMER_PWMCTL_CNTMODE_Msk) /*!< One-shot mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_OUTPUT_TOGGLE (0UL) /*!< Timer PWM output toggle \hideinitializer */ -#define TPWM_OUTPUT_NOTHING (1UL) /*!< Timer PWM output nothing \hideinitializer */ -#define TPWM_OUTPUT_LOW (2UL) /*!< Timer PWM output low \hideinitializer */ -#define TPWM_OUTPUT_HIGH (3UL) /*!< Timer PWM output high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Trigger Event Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TRIGGER_EVENT_AT_ZERO_POINT (0UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger event while counter zero point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EVENT_AT_PERIOD_POINT (1UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger event while counter period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EVENT_AT_ZERO_OR_PERIOD_POINT (2UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger event while counter zero or period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EVENT_AT_COMPARE_UP_POINT (3UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger event while counter up count compare point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EVENT_AT_COMPARE_DOWN_POINT (4UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger event while counter down count compare point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EVENT_AT_PERIOD_OR_COMPARE_UP_POINT (5UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger event while counter period or up count compare point event occurred \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP0 (TIMER_PWMBRKCTL_CPO0EBEN_Msk) /*!< Comparator 0 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP1 (TIMER_PWMBRKCTL_CPO1EBEN_Msk) /*!< Comparator 1 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_BKPIN (TIMER_PWMBRKCTL_BRKPEEN_Msk) /*!< Brake pin as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_CSS (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_BOD (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_COR (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_RAM (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as edge-detect fault brake source \hideinitializer */ - -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP0 (TIMER_PWMBRKCTL_CPO0LBEN_Msk) /*!< Comparator 0 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP1 (TIMER_PWMBRKCTL_CPO1LBEN_Msk) /*!< Comparator 1 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_BKPIN (TIMER_PWMBRKCTL_BRKPLEN_Msk) /*!< Brake pin as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_COR (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as level-detect fault brake source \hideinitializer */ - -#define TPWM_BRAKE_EDGE (TIMER_PWMSWBRK_BRKETRG_Msk) /*!< Edge-detect fault brake \hideinitializer */ -#define TPWM_BRAKE_LEVEL (TIMER_PWMSWBRK_BRKLTRG_Msk) /*!< Level-detect fault brake \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Load Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_LOAD_MODE_PERIOD (0UL) /*!< Timer PWM period load mode \hideinitializer */ -#define TPWM_LOAD_MODE_IMMEDIATE (TIMER_PWMCTL_IMMLDEN_Msk) /*!< Timer PWM immediately load mode \hideinitializer */ -#define TPWM_LOAD_MODE_CENTER (TIMER_PWMCTL_CTRLD_Msk) /*!< Timer PWM center load mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin De-bounce Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BKP_DBCLK_PCLK_DIV_1 (0UL) /*!< De-bounce clock is PCLK divide by 1 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_2 (1UL) /*!< De-bounce clock is PCLK divide by 2 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_4 (2UL) /*!< De-bounce clock is PCLK divide by 4 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_8 (3UL) /*!< De-bounce clock is PCLK divide by 8 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_16 (4UL) /*!< De-bounce clock is PCLK divide by 16 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_32 (5UL) /*!< De-bounce clock is PCLK divide by 32 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_64 (6UL) /*!< De-bounce clock is PCLK divide by 64 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_128 (7UL) /*!< De-bounce clock is PCLK divide by 128 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TM_BRAKE0 (0UL) /*!< Brake pin source comes from TM_BRAKE0 \hideinitializer */ -#define TPWM_TM_BRAKE1 (1UL) /*!< Brake pin source comes from TM_BRAKE1 \hideinitializer */ -#define TPWM_TM_BRAKE2 (2UL) /*!< Brake pin source comes from TM_BRAKE2 \hideinitializer */ -#define TPWM_TM_BRAKE3 (3UL) /*!< Brake pin source comes from TM_BRAKE3 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_CLKSRC_TMR_CLK (0UL) /*!< Timer PWM Clock source selects to TMR_CLK \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER0_INT (1UL) /*!< Timer PWM Clock source selects to TIMER0 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER1_INT (2UL) /*!< Timer PWM Clock source selects to TIMER1 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER2_INT (3UL) /*!< Timer PWM Clock source selects to TIMER2 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER3_INT (4UL) /*!< Timer PWM Clock source selects to TIMER3 interrupt event \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Synchronous Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_SYNC_DISABLE (0UL) /*!< Disable TIMER PWM synchronous function \hideinitializer */ -#define TPWM_CNTR_SYNC_START_BY_TIMER0 ((0<PWMCTL) & TMR45_BASE) == TMR45_BASE) { \ - (timer)->CTL |= TIMER_CTL_FUNCSEL_Msk; \ - while(((timer)->CTL & TIMER_CTL_FUNCSEL_Msk) == 0) {} \ - } else { \ - (timer)->ALTCTL = TIMER_ALTCTL_FUNCSEL_Msk; \ - while(((timer)->ALTCTL & TIMER_ALTCTL_FUNCSEL_Msk) == 0) {} \ - } \ - }while(0) - -/** - * @brief Disable PWM Counter Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to disable specified Timer channel as PWM counter mode, then timer counter mode is available. - * @note All registers about PWM counter function will be cleared to 0 after executing this macro. - * \hideinitializer - */ -#define TPWM_DISABLE_PWM_MODE(timer) \ - do{ \ - if(((uint32_t)&((timer)->PWMCTL) & TMR45_BASE) == TMR45_BASE) { \ - (timer)->CTL &= ~TIMER_CTL_FUNCSEL_Msk; \ - while(((timer)->CTL & TIMER_CTL_FUNCSEL_Msk) == TIMER_CTL_FUNCSEL_Msk) {} \ - } else { \ - (timer)->ALTCTL &= ~TIMER_ALTCTL_FUNCSEL_Msk; \ - while(((timer)->ALTCTL & TIMER_ALTCTL_FUNCSEL_Msk) == TIMER_ALTCTL_FUNCSEL_Msk) {} \ - } \ - }while(0) - - -/** - * @brief Enable Independent Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable independent mode of TIMER PWM module and complementary mode will be disabled. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_ENABLE_INDEPENDENT_MODE(timer) ((timer)->PWMCTL &= ~(1ul << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Enable Complementary Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable complementary mode of Timer PWM module and independent mode will be disabled. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_ENABLE_COMPLEMENTARY_MODE(timer) ((timer)->PWMCTL |= (1 << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Set Counter Type - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] type Timer PWM count type, could be one of the following type - * - \ref TPWM_UP_COUNT - * - \ref TPWM_DOWN_COUNT - * - \ref TPWM_UP_DOWN_COUNT - * - * @return None - * - * @details This macro is used to set Timer PWM counter type. - * @note NOT available on TIMER4 and TIMER5. Both TIMER4 and TIMER5 are only support count up. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_TYPE(timer, type) ((timer)->PWMCTL = ((timer)->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (type)) - -/** - * @brief Start PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to enable PWM generator and start counter counting. - * \hideinitializer - */ -#define TPWM_START_COUNTER(timer) ((timer)->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk) - -/** - * @brief Stop PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to stop PWM counter after current period is completed. - * \hideinitializer - */ -#define TPWM_STOP_COUNTER(timer) ((timer)->PWMPERIOD = 0x0) - -/** - * @brief Set Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @param[in] prescaler Clock prescaler of specified channel. - * Valid values are between 0x0~0xFFF for TIMER0, TIMER1, TIMER2, TIMER3, and - * valid values are between 0x0~0xFF for TIMER4 and TIMER5. - * - * @return None - * - * @details This macro is used to set the prescaler of specified TIMER PWM. - * @note If prescaler is 0, then there is no scaling in counter clock source. - * \hideinitializer - */ -#define TPWM_SET_PRESCALER(timer, prescaler) ((timer)->PWMCLKPSC = (prescaler)) - -/** - * @brief Get Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return Target prescaler setting, CLKPSC (TIMERx_PWMCLKPSC[11:0]) - * - * @details Get the prescaler setting, the target counter clock divider is (CLKPSC + 1). - * \hideinitializer - */ -#define TPWM_GET_PRESCALER(timer) ((timer)->PWMCLKPSC) - -/** - * @brief Set Couner Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @param[in] period Period of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_PERIOD(timer, period) ((timer)->PWMPERIOD = (period)) - -/** - * @brief Get Couner Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return Target period setting, PERIOD (TIMERx_PWMPERIOD[15:0]) - * - * @details This macro is used to get the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_PERIOD(timer) ((timer)->PWMPERIOD) - -/** - * @brief Set Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @param[in] cmp Comparator of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_CMPDAT(timer, cmp) ((timer)->PWMCMPDAT = (cmp)) - -/** - * @brief Get Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return Target comparator setting, CMPDAT (TIMERx_PWMCMPDAT[15:0]) - * - * @details This macro is used to get the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_CMPDAT(timer) ((timer)->PWMCMPDAT) - -/** - * @brief Clear Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to clear counter of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_CLEAR_COUNTER(timer) ((timer)->PWMCNTCLR = TIMER_PWMCNTCLR_CNTCLR_Msk) - -/** - * @brief Software Trigger Brake Event - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] type Type of brake trigger. Valid values are: - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This macro is used to trigger brake event by writing PWMSWBRK register. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_SW_TRIGGER_BRAKE(timer, type) ((timer)->PWMSWBRK = (type)) - -/** - * @brief Enable Output Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @param[in] ch Enable specified channel output function. Valid values are: - * For TIMER0 ~ TIMER3, the valid value could be a combination of \ref TPWM_CH0 and \ref TPWM_CH1. - * For TIMER4, TIMER5, the valid value could be \ref TPWM_CH0 or \ref TPWM_CH1. - * - * @return None - * - * @details This macro is used to enable output function of specified output pins. - * \hideinitializer - */ -#define TPWM_ENABLE_OUTPUT(timer, ch) \ - do{ \ - if(((uint32_t)&((timer)->PWMCTL) & TMR45_BASE) == TMR45_BASE) { \ - if((ch) == BIT0) \ - (timer)->PWMPOEN = BIT0; \ - else \ - (timer)->PWMPOEN = (BIT0 | BIT8); \ - } else { \ - (timer)->PWMPOEN = (ch); \ - } \ - }while(0) - -/** - * @brief Set Output Inverse - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @param[in] ch Set specified channel output is inversed or not. - * For TIMER0 ~ TIMER3, the valid value could be a combination of \ref TPWM_CH0 and \ref TPWM_CH1. - * But this parameter is no effect on TIMER4 and TIMER5. - * - * @return None - * - * @details This macro is used to enable output inverse of specified output pins. - * \hideinitializer - */ -#define TPWM_SET_OUTPUT_INVERSE(timer, ch) \ - do{ \ - if(((uint32_t)&((timer)->PWMCTL) & TMR45_BASE) == TMR45_BASE) { \ - (timer)->PWMPOLCTL = BIT0; \ - } else { \ - (timer)->PWMPOLCTL = (ch); \ - } \ - }while(0) - -/** - * @brief Enable Output Mask Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Enable specified channel output mask function. Valid value could be a combination of \ref TPWM_CH0 and \ref TPWM_CH1. - * - * @param[in] level Output to high or low on specified mask channel. - * - * @return None - * - * @details This macro is used to enable output mask function of specified output pins. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_SET_MASK_OUTPUT(timer, ch, level) do {(timer)->PWMMSKEN = (ch); (timer)->PWMMSK = (level); }while(0) - -/** - * @brief Set Counter Synchronous Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] mode Synchronous mode. Possible options are: - * - \ref TPWM_CNTR_SYNC_DISABLE - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER2 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER2 - * - * @return None - * - * @details This macro is used to set counter synchronous mode of specified Timer PWM module. - * @note Only support all PWM counters are synchronous by TIMER0 PWM or TIMER0~1 PWM counter synchronous by TIMER0 PWM and - * TIMER2~3 PWM counter synchronous by TIMER2 PWM. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_SYNC_MODE(timer, mode) ((timer)->PWMSCTL = (mode)) - -/** - * @brief Trigger Counter Synchronous - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to trigger synchronous event by specified TIMER PWM. - * @note 1. This macro is only available for TIMER0 PWM and TIMER2 PWM. \n - * 2. STRGEN (PWMSTRG[0]) is write only and always read as 0. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_TRIGGER_COUNTER_SYNC(timer) ((timer)->PWMSTRG = TIMER_PWMSTRG_STRGEN_Msk) - -/** - * @brief Enable Timer PWM Interrupt Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 or TIMER5. - * - * @return None - * - * @details This macro is used to enable the timer pwm interrupt wake-up function. - * @note Only available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_ENABLE_PWMINT_WAKEUP(timer) ((timer)->PWMCTL |= TIMER_PWMCTL_WKEN_Msk) - -/** - * @brief Disable Timer PWM Interrupt Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 or TIMER5. - * - * @return None - * - * @details This macro is used to disable the timer pwm interrupt wake-up function. - * @note Only available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_DISABLE_PWMINT_WAKEUP(timer) ((timer)->PWMCTL &= ~TIMER_PWMCTL_WKEN_Msk) - -/** - * @brief Enable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the zero event interrupt function. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_ENABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Disable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the zero event interrupt function. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_DISABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Get Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Zero event interrupt did not occur - * @retval 1 Zero event interrupt occurred - * - * @details This macro indicates zero event occurred or not. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_GET_ZERO_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_ZIF_Msk)? 1 : 0) - -/** - * @brief Clear Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears zero event interrupt flag. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_CLEAR_ZERO_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_ZIF_Msk) - -/** - * @brief Enable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to enable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Disable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to disable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Get Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Period event interrupt did not occur - * @retval 1 Period event interrupt occurred - * - * @details This macro indicates period event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_PERIOD_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_PIF_Msk)? 1 : 0) - -/** - * @brief Clear Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro clears period event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_PERIOD_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_PIF_Msk) - -/** - * @brief Enable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to enable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Disable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to disable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Get Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Compare up event interrupt did not occur - * @retval 1 Compare up event interrupt occurred - * - * @details This macro indicates compare up event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_CMP_UP_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPUIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro clears compare up event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_UP_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPUIF_Msk) - -/** - * @brief Enable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the compare down event interrupt function. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Disable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the compare down event interrupt function. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Get Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Compare down event interrupt did not occur - * @retval 1 Compare down event interrupt occurred - * - * @details This macro indicates compare down event occurred or not. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_GET_CMP_DOWN_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPDIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears compare down event interrupt flag. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_DOWN_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPDIF_Msk) - -/** - * @brief Get Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Timer PWM counter never counts to maximum value - * @retval 1 Timer PWM counter counts to maximum value, 0xFFFF - * - * @details This macro indicates Timer PWM counter has count to 0xFFFF or not. - * \hideinitializer - */ -#define TPWM_GET_REACH_MAX_CNT_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_CNTMAXF_Msk)? 1 : 0) - -/** - * @brief Clear Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro clears reach maximum count status. - * \hideinitializer - */ -#define TPWM_CLEAR_REACH_MAX_CNT_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_CNTMAXF_Msk) - -/** - * @brief Get Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @retval 0 Trigger ADC start conversion is not occur - * @retval 1 Specified counter compare event has trigger ADC start conversion - * - * @details This macro is used to indicate PWM counter compare event has triggered ADC start conversion. - * \hideinitializer - */ -#define TPWM_GET_TRG_ADC_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_EADCTRGF_Msk)? 1 : 0) - -/** - * @brief Clear Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This macro is used to clear PWM counter compare event trigger ADC status. - * \hideinitializer - */ -#define TPWM_CLEAR_TRG_ADC_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_EADCTRGF_Msk) - -/** - * @brief Get Trigger PDMA Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 ~ TIMER5. - * - * @retval 0 Trigger PDMA transfer data is not occur - * @retval 1 Specified counter compare event has trigger PDMA transfer data - * - * @details This macro is used to indicate PWM counter compare event has triggered PDMA start transfer data. - * @note Only available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_GET_TRG_PDMA_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_PDMATRGF_Msk)? 1 : 0) - -/** - * @brief Clear Trigger PDMA Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 ~ TIMER5. - * - * @return None - * - * @details This macro is used to clear PWM counter compare event trigger PDMA status. - * @note Only available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_CLEAR_TRG_PDMA_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_PDMATRGF_Msk) - -/** - * @brief Get PWM Interrupt Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 ~ TIMER5. - * - * @retval 0 PWM does not cause CPU wake-up - * @retval 1 PWM interrupt event cause CPU wake-up - * - * @details This function indicates PWM interrupt event has waked up system or not. - * @note Only available on TIMER4 and TIMER5. - */ -#define TPWM_GET_PWMINT_WAKEUP_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_WKF_Msk)? 1 : 0) - -/** - * @brief Clear PWM Interrupt Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 ~ TIMER5. - * - * @return None - * - * @details This macro is used to clear PWM interrupt wakeup status. - * @note Only available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_CLEAR_PWMINT_WAKEUP_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_WKF_Msk) - -/** - * @brief Set Brake Event at Brake Pin High or Low-to-High - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * @note The default brake pin detection is high level or from low to high. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_HIGH_DETECT(timer) ((timer)->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set Brake Event at Brake Pin Low or High-to-Low - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at low level or transfer from high to low. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_LOW_DETECT(timer) ((timer)->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set External Brake Pin Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] pin The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * @note NOT available on TIMER4 and TIMER5. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_SOURCE(timer, pin) ((timer)->PWMBNF = ((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | ((pin)<CTL = (TRNG->CTL&~TRNG_CTL_CLKP_Msk)|((clkpsc & 0xf)<> 4ul)-2ul) - - -/** - * @brief Calculate UART baudrate mode2 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode2 divider - * - * @details This macro calculate UART baudrate mode2 divider. - */ -#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)/2ul)) / (u32BaudRate))-2ul) - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - */ -#define UART_WRITE(uart, u8Data) ((uart)->DAT = (u8Data)) - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module - * - * @return The oldest data byte in RX FIFO. - * - * @details This macro read Rx data register. - */ -#define UART_READ(uart) ((uart)->DAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not empty - * @retval >=1 Tx FIFO is empty - * - * @details This macro get Transmitter FIFO empty register value. - */ -#define UART_GET_TX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not empty - * @retval >=1 Rx FIFO is empty - * - * @details This macro get Receiver FIFO empty register value. - */ -#define UART_GET_RX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified uart port transmission is over. - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. - * It indicates if specified uart port transmission is over nor not. - */ -#define UART_IS_TX_EMPTY(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos) - - -/** - * @brief Wait specified uart port transmission is over - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro wait specified uart port transmission is over. - */ -#define UART_WAIT_TX_EMPTY(uart) while(!((((uart)->FIFOSTS) & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos)) - - -/** - * @brief Check RX is ready or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 The number of bytes in the RX FIFO is less than the RFITL - * @retval 1 The number of bytes in the RX FIFO equals or larger than RFITL - * - * @details This macro check receive data available interrupt flag is set or not. - */ -#define UART_IS_RX_READY(uart) (((uart)->INTSTS & UART_INTSTS_RDAIF_Msk)>>UART_INTSTS_RDAIF_Pos) - - -/** - * @brief Check TX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 TX FIFO is full - * @retval 0 TX FIFO is not full - * - * @details This macro check TX FIFO is full or not. - */ -#define UART_IS_TX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk)>>UART_FIFOSTS_TXFULL_Pos) - - -/** - * @brief Check RX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 RX FIFO is full - * @retval 0 RX FIFO is not full - * - * @details This macro check RX FIFO is full or not. - */ -#define UART_IS_RX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk)>>UART_FIFOSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not full. - * @retval >=1 Tx FIFO is full. - * - * @details This macro get Tx full register value. - */ -#define UART_GET_TX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not full. - * @retval >=1 Rx FIFO is full. - * - * @details This macro get Rx full register value. - */ -#define UART_GET_RX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk) - -/** - * @brief Rx Idle Status register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx is busy. - * @retval 1 Rx is Idle(Default) - * - * @details This macro get Rx Idle Status register value. - * \hideinitializer - */ -#define UART_RX_IDLE(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXIDLE_Msk )>> UART_FIFOSTS_RXIDLE_Pos) - - -/** - * @brief Enable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter empty interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - */ -#define UART_ENABLE_INT(uart, u32eIntSel) ((uart)->INTEN |= (u32eIntSel)) - - -/** - * @brief Disable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty Interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto-baud Rate Interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin Bus interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx Time-out Interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : MODEM Status Interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line Status Interrupt - * - \ref UART_INTEN_THREIEN_Msk : Transmit Holding Register Empty Interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Receive Data Available Interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - */ -#define UART_DISABLE_INT(uart, u32eIntSel) ((uart)->INTEN &= ~ (u32eIntSel)) - - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref UART_INTSTS_ABRINT_Msk : Auto-baud Rate Interrupt Indicator - * - \ref UART_INTSTS_HWBUFEINT_Msk : PDMA Mode Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_HWTOINT_Msk : PDMA Mode Rx Time-out Interrupt Indicator - * - \ref UART_INTSTS_HWMODINT_Msk : PDMA Mode MODEM Status Interrupt Indicator - * - \ref UART_INTSTS_HWRLSINT_Msk : PDMA Mode Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_SWBEINT_Msk : Single-wire Bit Error Detect Interrupt Indicator - * - \ref UART_INTSTS_HWBUFEIF_Msk : PDMA Mode Buffer Error Interrupt Flag - * - \ref UART_INTSTS_HWTOIF_Msk : PDMA Mode Time-out Interrupt Flag - * - \ref UART_INTSTS_HWMODIF_Msk : PDMA Mode MODEM Status Interrupt Flag - * - \ref UART_INTSTS_HWRLSIF_Msk : PDMA Mode Receive Line Status Flag - * - \ref UART_INTSTS_SWBEIF_Msk : Single-wire Bit Error Detect Interrupt Flag - * - \ref UART_INTSTS_TXENDINT_Msk : Transmitter Empty Interrupt Indicator - * - \ref UART_INTSTS_LININT_Msk : LIN Bus Interrupt Indicator - * - \ref UART_INTSTS_WKINT_Msk : Wake-up Interrupt Indicator - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_RXTOINT_Msk : Rx Time-out Interrupt Indicator - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status Interrupt Indicator - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_THREINT_Msk : Transmit Holding Register Empty Interrupt Indicator - * - \ref UART_INTSTS_RDAINT_Msk : Receive Data Available Interrupt Indicator - * - \ref UART_INTSTS_TXENDIF_Msk : Transmitter Empty Interrupt Flag - * - \ref UART_INTSTS_LINIF_Msk : LIN Bus Interrupt Flag - * - \ref UART_INTSTS_WKIF_Msk : Wake-up Interrupt Flag - * - \ref UART_INTSTS_BUFERRIF_Msk : Buffer Error Interrupt Flag - * - \ref UART_INTSTS_RXTOIF_Msk : Rx Time-out Interrupt Flag - * - \ref UART_INTSTS_MODEMIF_Msk : MODEM Status Interrupt Flag - * - \ref UART_INTSTS_RLSIF_Msk : Receive Line Status Interrupt Flag - * - \ref UART_INTSTS_THREIF_Msk : Transmit Holding Register Empty Interrupt Flag - * - \ref UART_INTSTS_RDAIF_Msk : Receive Data Available Interrupt Flag - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro get specified interrupt flag or interrupt indicator status. - */ -#define UART_GET_INT_FLAG(uart,u32eIntTypeFlag) (((uart)->INTSTS & (u32eIntTypeFlag))?1:0) - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -static __INLINE void UART_CLEAR_RTS(UART_T* uart); -static __INLINE void UART_SET_RTS(UART_T* uart); - - -/** - * @brief Set RTS pin to low - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to low. - */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T* uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - uart->MODEM &= ~UART_MODEM_RTS_Msk; -} - - -/** - * @brief Set RTS pin to high - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to high. - */ -__STATIC_INLINE void UART_SET_RTS(UART_T* uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk | UART_MODEM_RTS_Msk; -} - - -/** - * @brief Clear RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro clear RS-485 address byte detection flag. - */ -#define UART_RS485_CLEAR_ADDR_FLAG(uart) ((uart)->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk) - - -/** - * @brief Get RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Receiver detects a data that is not an address bit. - * @retval 1 Receiver detects a data that is an address bit. - * - * @details This macro get RS-485 address byte detection flag. - */ -#define UART_RS485_GET_ADDR_FLAG(uart) (((uart)->FIFOSTS & UART_FIFOSTS_ADDRDETF_Msk) >> UART_FIFOSTS_ADDRDETF_Pos) - - -/** - * @brief Enable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * @details This macro enable specified UART PDMA function. - */ -#define UART_PDMA_ENABLE(uart, u32FuncSel) ((uart)->INTEN |= (u32FuncSel)) - - -/** - * @brief Disable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * @details This macro disable specified UART PDMA function. - */ -#define UART_PDMA_DISABLE(uart, u32FuncSel) ((uart)->INTEN &= ~(u32FuncSel)) - - -void UART_ClearIntFlag(UART_T* uart, uint32_t u32InterruptFlag); -void UART_Close(UART_T* uart); -void UART_DisableFlowCtrl(UART_T* uart); -void UART_DisableInt(UART_T* uart, uint32_t u32InterruptFlag); -void UART_EnableFlowCtrl(UART_T* uart); -void UART_EnableInt(UART_T* uart, uint32_t u32InterruptFlag); -void UART_Open(UART_T* uart, uint32_t u32baudrate); -uint32_t UART_Read(UART_T* uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -void UART_SetLineConfig(UART_T* uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -void UART_SetTimeoutCnt(UART_T* uart, uint32_t u32TOC); -void UART_SelectIrDAMode(UART_T* uart, uint32_t u32Buadrate, uint32_t u32Direction); -void UART_SelectRS485Mode(UART_T* uart, uint32_t u32Mode, uint32_t u32Addr); -void UART_SelectLINMode(UART_T* uart, uint32_t u32Mode, uint32_t u32BreakLength); -uint32_t UART_Write(UART_T* uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); -void UART_SelectSingleWireMode(UART_T *uart); - - -/**@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group UART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_UART_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usbd.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usbd.h deleted file mode 100644 index d0a7c0f1308..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usbd.h +++ /dev/null @@ -1,796 +0,0 @@ -/****************************************************************************** - * @file nu_usbd.h - * @version V3.00 - * @brief M2354 series USBD driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_USBD_H__ -#define __NU_USBD_H__ - -#define SUPPORT_LPM // define to support LPM - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - -/** @addtogroup USBD_EXPORTED_STRUCTS USBD Exported Structs - @{ -*/ - -typedef struct s_usbd_info -{ - uint8_t *gu8DevDesc; /*!< Pointer for USB Device Descriptor */ - uint8_t *gu8ConfigDesc; /*!< Pointer for USB Configuration Descriptor */ - uint8_t **gu8StringDesc; /*!< Pointer for USB String Descriptor pointers */ - uint8_t **gu8HidReportDesc; /*!< Pointer for USB HID Report Descriptor */ - uint8_t *gu8BosDesc; /*!< Pointer for USB BOS Descriptor */ - uint32_t *gu32HidReportSize; /*!< Pointer for HID Report descriptor Size */ - uint32_t *gu32ConfigHidDescIdx; /*!< Pointer for HID Descriptor start index */ - -} S_USBD_INFO_T; /*!< Device description structure */ - -extern const S_USBD_INFO_T gsInfo; - -/**@}*/ /* end of group USBD_EXPORTED_STRUCTS */ - - -/** @addtogroup USBD_EXPORTED_CONSTANTS USBD Exported Constants - @{ -*/ - -#define USBD_BUF_BASE (uint32_t)(((__PC() & NS_OFFSET) == NS_OFFSET)? (USBD_BASE+NS_OFFSET+0x100UL):(USBD_BASE+0x100UL)) /*!< USBD buffer base address */ -#define USBD_MAX_EP 12UL /*!< Total EP number */ - -#define EP0 0UL /*!< Endpoint 0 */ -#define EP1 1UL /*!< Endpoint 1 */ -#define EP2 2UL /*!< Endpoint 2 */ -#define EP3 3UL /*!< Endpoint 3 */ -#define EP4 4UL /*!< Endpoint 4 */ -#define EP5 5UL /*!< Endpoint 5 */ -#define EP6 6UL /*!< Endpoint 6 */ -#define EP7 7UL /*!< Endpoint 7 */ -#define EP8 8UL /*!< Endpoint 8 */ -#define EP9 9UL /*!< Endpoint 9 */ -#define EP10 10UL /*!< Endpoint 10 */ -#define EP11 11UL /*!< Endpoint 11 */ - -/** @cond HIDDEN_SYMBOLS */ -/* USB Request Type */ -#define REQ_STANDARD 0x00UL -#define REQ_CLASS 0x20UL -#define REQ_VENDOR 0x40UL - -/* USB Standard Request */ -#define GET_STATUS 0x00UL -#define CLEAR_FEATURE 0x01UL -#define SET_FEATURE 0x03UL -#define SET_ADDRESS 0x05UL -#define GET_DESCRIPTOR 0x06UL -#define SET_DESCRIPTOR 0x07UL -#define GET_CONFIGURATION 0x08UL -#define SET_CONFIGURATION 0x09UL -#define GET_INTERFACE 0x0AUL -#define SET_INTERFACE 0x0BUL -#define SYNC_FRAME 0x0CUL - -/* USB Descriptor Type */ -#define DESC_DEVICE 0x01UL -#define DESC_CONFIG 0x02UL -#define DESC_STRING 0x03UL -#define DESC_INTERFACE 0x04UL -#define DESC_ENDPOINT 0x05UL -#define DESC_QUALIFIER 0x06UL -#define DESC_OTHERSPEED 0x07UL -#define DESC_IFPOWER 0x08UL -#define DESC_OTG 0x09UL -#define DESC_BOS 0x0FUL -#define DESC_CAPABILITY 0x10UL - -/* USB Device Capability Type */ -#define CAP_WIRELESS 0x01UL -#define CAP_USB20_EXT 0x02UL - -/*! b, then return a. Otherwise, return b. - */ -#define USBD_Maximum(a,b) ((a)>(b) ? (a) : (b)) - -/** - * @brief Compare two input numbers and return minimum one - * - * @param[in] a First number to be compared - * @param[in] b Second number to be compared - * - * @return Minimum value between a and b - * - * @details If a < b, then return a. Otherwise, return b. - */ -#define USBD_Minimum(a,b) ((a)<(b) ? (a) : (b)) - -/** - * @brief Enable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB and PHY. - * - */ -#define USBD_ENABLE_USB() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->ATTR |= 0x7D0)):((uint32_t)(USBD->ATTR |= 0x7D0))) - -/** - * @brief Disable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB. - * - */ -#define USBD_DISABLE_USB() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->ATTR &= ~USBD_USB_EN)):((uint32_t)(USBD->ATTR &= ~USBD_USB_EN))) - -/** - * @brief Enable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB PHY. - * - */ -#define USBD_ENABLE_PHY() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->ATTR |= USBD_PHY_EN)):((uint32_t)(USBD->ATTR |= USBD_PHY_EN))) - -/** - * @brief Disable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB PHY. - * - */ -#define USBD_DISABLE_PHY() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->ATTR &= ~USBD_PHY_EN)):((uint32_t)(USBD->ATTR &= ~USBD_PHY_EN))) - -/** - * @brief Enable SE0. Force USB PHY transceiver to drive SE0. - * - * @param None - * - * @return None - * - * @details Set DRVSE0 bit of USB_DRVSE0 register to enable software-disconnect function. Force USB PHY transceiver to drive SE0 to bus. - * - */ -#define USBD_SET_SE0() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->SE0 |= USBD_DRVSE0)):((uint32_t)(USBD->SE0 |= USBD_DRVSE0))) - -/** - * @brief Disable SE0 - * - * @param None - * - * @return None - * - * @details Clear DRVSE0 bit of USB_DRVSE0 register to disable software-disconnect function. - * - */ -#define USBD_CLR_SE0() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->SE0 &= ~USBD_DRVSE0)):((uint32_t)(USBD->SE0 &= ~USBD_DRVSE0))) - -/** - * @brief Set USB device address - * - * @param[in] addr The USB device address. - * - * @return None - * - * @details Write USB device address to USB_FADDR register. - * - */ -#define USBD_SET_ADDR(addr) (((__PC() & NS_OFFSET) == NS_OFFSET)? (USBD_NS->FADDR = (addr)):(USBD->FADDR = (addr))) - -/** - * @brief Get USB device address - * - * @param None - * - * @return USB device address - * - * @details Read USB_FADDR register to get USB device address. - * - */ -#define USBD_GET_ADDR() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->FADDR)):((uint32_t)(USBD->FADDR))) - -/** - * @brief Enable USB interrupt function - * - * @param[in] intr The combination of the specified interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. - * (USBD_INT_WAKEUP, USBD_INT_FLDET, USBD_INT_USB, USBD_INT_BUS) - * - * @return None - * - * @details Enable USB related interrupt functions specified by intr parameter. - * - */ -#define USBD_ENABLE_INT(intr) (((__PC() & NS_OFFSET) == NS_OFFSET)? (USBD_NS->INTEN |= (intr)):(USBD->INTEN |= (intr))) - -/** - * @brief Get interrupt status - * - * @param None - * - * @return The value of USB_INTSTS register - * - * @details Return all interrupt flags of USB_INTSTS register. - * - */ -#define USBD_GET_INT_FLAG() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->INTSTS)):((uint32_t)(USBD->INTSTS))) - -/** - * @brief Clear USB interrupt flag - * - * @param[in] flag The combination of the specified interrupt flags. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. - * (USBD_INTSTS_WAKEUP, USBD_INTSTS_FLDET, USBD_INTSTS_BUS, USBD_INTSTS_USB) - * - * @return None - * - * @details Clear USB related interrupt flags specified by flag parameter. - * - */ -#define USBD_CLR_INT_FLAG(flag) (((__PC() & NS_OFFSET) == NS_OFFSET)? (USBD_NS->INTSTS = (flag)):(USBD->INTSTS = (flag))) - -/** - * @brief Get endpoint status - * - * @param None - * - * @return The value of USB_EPSTS register. - * - * @details Return all endpoint status. - * - */ -#define USBD_GET_EP_FLAG() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->EPSTS)):((uint32_t)(USBD->EPSTS))) - -/** - * @brief Get USB bus state - * - * @param None - * - * @return The value of USB_ATTR[13:12] and USB_ATTR[3:0]. - * Bit 0 indicates USB bus reset status. - * Bit 1 indicates USB bus suspend status. - * Bit 2 indicates USB bus resume status. - * Bit 3 indicates USB bus time-out status. - * Bit 12 indicates USB bus LPM L1 suspend status. - * Bit 13 indicates USB bus LPM L1 resume status. - * - * @details Return USB_ATTR[13:12] and USB_ATTR[3:0] for USB bus events. - * - */ -#define USBD_GET_BUS_STATE() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->ATTR & 0x300F)):((uint32_t)(USBD->ATTR & 0x300F))) - -/** - * @brief Check cable connection state - * - * @param None - * - * @retval 0 USB cable is not attached. - * @retval 1 USB cable is attached. - * - * @details Check the connection state by FLDET bit of USB_FLDET register. - * - */ -#define USBD_IS_ATTACHED() (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)(USBD_NS->VBUSDET & USBD_VBUSDET_VBUSDET_Msk)):((uint32_t)(USBD->VBUSDET & USBD_VBUSDET_VBUSDET_Msk))) - -/** - * @brief Stop USB transaction of the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Write 1 to CLRRDY bit of USB_CFGPx register to stop USB transaction of the specified endpoint ID. - * - */ -#define USBD_STOP_TRANSACTION(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_CLRRDY_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_CLRRDY_Msk)) - -/** - * @brief Set USB DATA1 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Set DSQ_SYNC bit of USB_CFGx register to specify the DATA1 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions in single buffer mode. - * - */ -#define USBD_SET_DATA1(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DSQSYNC_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DSQSYNC_Msk)) - -/** - * @brief Set USB DATA0 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Clear DSQ_SYNC bit of USB_CFGx register to specify the DATA0 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions in single buffer mode. - * - */ -#define USBD_SET_DATA0(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DSQSYNC_Msk)):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DSQSYNC_Msk))) - -/** - * @brief Set USB payload size (IN data) - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @param[in] size The transfer length. - * - * @return None - * - * @details This macro will write the transfer length to USB_MXPLDx register for IN data transaction. - * - */ -#define USBD_SET_PAYLOAD_LEN(ep, size) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].MXPLD + (uint32_t)((ep) << 4))) = (size)):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4))) = (size))) - -/** - * @brief Get USB payload size (OUT data) - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return The value of USB_MXPLDx register. - * - * @details Get the data length of OUT data transaction by reading USB_MXPLDx register. - * - */ -#define USBD_GET_PAYLOAD_LEN(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].MXPLD + (uint32_t)((ep) << 4)))):((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4))))) - -/** - * @brief Configure endpoint - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @param[in] config The USB configuration. - * - * @return None - * - * @details This macro will write config parameter to USB_CFGx register of specified endpoint ID. - * - */ -#define USBD_CONFIG_EP(ep, config) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) = (config)):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) = (config))) - -/** - * @brief Set USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @param[in] offset The SRAM offset. - * - * @return None - * - * @details This macro will set the SRAM offset for the specified endpoint ID. - * - */ -#define USBD_SET_EP_BUF_ADDR(ep, offset) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].BUFSEG + (uint32_t)((ep) << 4))) = (offset)):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4))) = (offset))) - -/** - * @brief Get the offset of the specified USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return The offset of the specified endpoint buffer. - * - * @details This macro will return the SRAM offset of the specified endpoint ID. - * - */ -#define USBD_GET_EP_BUF_ADDR(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].BUFSEG + (uint32_t)((ep) << 4)))):((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4))))) - -/** - * @brief Set USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - * - */ -#define USBD_SET_EP_STALL(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_SSTALL_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_SSTALL_Msk)) - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - * - */ -#define USBD_CLR_EP_STALL(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFGP + (uint32_t)((ep) << 4))) &= ~USBD_CFGP_SSTALL_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) &= ~USBD_CFGP_SSTALL_Msk)) - -/** - * @brief Get USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state of the specified endpoint ID. - * - */ -#define USBD_GET_EP_STALL(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFGP + (uint32_t)((ep) << 4))) & USBD_CFGP_SSTALL_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) & USBD_CFGP_SSTALL_Msk)) - -/** - * @brief Set USB double buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Set DBEN bit of USB_CFGx register to enable the double buffer mode of the specified endpoint ID. - * - */ -#define USBD_SET_DB_MODE(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DBEN_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DBEN_Msk)) - -/** - * @brief Set USB single buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Clear DBEN bit of USB_CFGx register to enable the single buffer mode of the specified endpoint ID. - * - */ -#define USBD_SET_SB_MODE(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DBEN_Msk)):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DBEN_Msk))) - -/** - * @brief Get the buffer mode of the specified USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @retval 0 USB is single buffer mode. - * @retval 1 USB is double buffer mode. - * - * @details This macro will return the buffer mode of the specified endpoint ID. - * - */ -#define USBD_IS_DB_MODE(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) & USBD_CFG_DBEN_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) & USBD_CFG_DBEN_Msk)) - -/** - * @brief Set to active in USB double buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Set DBTGACTIVE bit of USB_CFGx register for toggle active in the double buffer mode of the specified endpoint ID. - * - */ -#define USBD_SET_DB_ACTIVE(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DBTGACTIVE_Msk):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DBTGACTIVE_Msk)) - -/** - * @brief Set to inactive in USB double buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M2354 Series supports 12 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Clear DBTGACTIVE bit of USB_CFGx register for toggle inactive in the double buffer mode of the specified endpoint ID. - * - */ -#define USBD_SET_DB_INACTIVE(ep) (((__PC() & NS_OFFSET) == NS_OFFSET)? (*((__IO uint32_t *) ((uint32_t)&USBD_NS->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DBTGACTIVE_Msk)):(*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DBTGACTIVE_Msk))) - -/** - * @brief To support byte access between USB SRAM and system SRAM - * - * @param[in] dest Destination pointer. - * - * @param[in] src Source pointer. - * - * @param[in] size Byte count. - * - * @return None - * - * @details This function will copy the number of data specified by size and src parameters to the address specified by dest parameter. - * - */ -__STATIC_INLINE void USBD_MemCopy(uint8_t dest[], uint8_t src[], uint32_t size) -{ - uint32_t volatile i = 0UL; - - while(size--) - { - dest[i] = src[i]; - i++; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Set USB endpoint stall state. Endpoint will respond STALL token automatically. - * - */ -__STATIC_INLINE void USBD_SetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - USBD_T *pUSBD; - - if((__PC() & NS_OFFSET) == NS_OFFSET) - { - pUSBD = USBD_NS; - } - else - { - pUSBD = USBD; - } - - for(i = 0UL; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&pUSBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if((u32Cfg & 0xFUL) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&pUSBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg | USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Clear USB endpoint stall state. Endpoint will respond ACK/NAK token. - */ -__STATIC_INLINE void USBD_ClearStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - USBD_T *pUSBD; - - if((__PC() & NS_OFFSET) == NS_OFFSET) - { - pUSBD = USBD_NS; - } - else - { - pUSBD = USBD; - } - - for(i = 0UL; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&pUSBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if((u32Cfg & 0xFUL) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&pUSBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg & ~USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - * - */ -__STATIC_INLINE uint32_t USBD_GetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr = 0UL; - uint32_t u32Cfg; - uint32_t i; - USBD_T *pUSBD; - - if((__PC() & NS_OFFSET) == NS_OFFSET) - { - pUSBD = USBD_NS; - } - else - { - pUSBD = USBD; - } - - for(i = 0UL; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&pUSBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if((u32Cfg & 0xFUL) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&pUSBD->EP[0].CFGP; /* USBD_CFGP0 */ - break; - } - } - - return ((*((__IO uint32_t *)(u32CfgAddr))) & USBD_CFGP_SSTALL); -} - -extern uint8_t g_USBD_au8SetupPacket[8]; -extern volatile uint8_t g_USBD_u8RemoteWakeupEn; - -typedef void (*VENDOR_REQ)(void); /*!< Functional pointer type definition for Vendor class */ -typedef void (*CLASS_REQ)(void); /*!< Functional pointer type declaration for USB class request callback handler */ -typedef void (*SET_INTERFACE_REQ)(uint32_t u32AltInterface); /*!< Functional pointer type declaration for USB set interface request callback handler */ -typedef void (*SET_CONFIG_CB)(void); /*!< Functional pointer type declaration for USB set configuration request callback handler */ - -extern const S_USBD_INFO_T *g_USBD_sInfo; - -extern VENDOR_REQ g_USBD_pfnVendorRequest; -extern CLASS_REQ g_USBD_pfnClassRequest; -extern SET_INTERFACE_REQ g_USBD_pfnSetInterface; -extern SET_CONFIG_CB g_USBD_pfnSetConfigCallback; -extern uint32_t g_USBD_u32EpStallLock; - -/*--------------------------------------------------------------------*/ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface); -void USBD_Start(void); -void USBD_GetSetupPacket(uint8_t *buf); -void USBD_ProcessSetupPacket(void); -void USBD_GetDescriptor(void); -void USBD_StandardRequest(void); -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size); -void USBD_CtrlIn(void); -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size); -void USBD_CtrlOut(void); -void USBD_SwReset(void); -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq); -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback); -void USBD_LockEpStall(uint32_t u32EpBitmap); - - -/**@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USBD_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USBD_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_i2c.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_i2c.h deleted file mode 100644 index e62975971e4..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_i2c.h +++ /dev/null @@ -1,318 +0,0 @@ -/**************************************************************************//** - * @file nu_usci_i2c.h - * @version V3.0 - * $Revision: 1 $ - * $Date: 16/07/07 7:50p $ - * @brief M2355 series USCI I2C(UI2C) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_USCI_I2C_H__ -#define __NU_USCI_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - -/** @addtogroup USCI_I2C_EXPORTED_CONSTANTS USCI_I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C master event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_MASTER_EVENT -{ - MASTER_SEND_ADDRESS = 10u, /*!< Master send address to Slave */ - MASTER_SEND_H_WR_ADDRESS, /*!< Master send High address to Slave */ - MASTER_SEND_H_RD_ADDRESS, /*!< Master send address to Slave (Read ADDR) */ - MASTER_SEND_L_ADDRESS, /*!< Master send Low address to Slave */ - MASTER_SEND_DATA, /*!< Master Send Data to Slave */ - MASTER_SEND_REPEAT_START, /*!< Master send repeat start to Slave */ - MASTER_READ_DATA, /*!< Master Get Data from Slave */ - MASTER_STOP, /*!< Master send stop to Slave */ - MASTER_SEND_START /*!< Master send start to Slave */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C slave event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_SLAVE_EVENT -{ - SLAVE_ADDRESS_ACK = 100u, /*!< Slave send address ACK */ - SLAVE_H_WR_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_WR_ADDRESS_ACK, /*!< Slave send Low address ACK */ - SLAVE_GET_DATA, /*!< Slave Get Data from Master (Write CMD) */ - SLAVE_SEND_DATA, /*!< Slave Send Data to Master (Read CMD) */ - SLAVE_H_RD_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_RD_ADDRESS_ACK /*!< Slave send Low address ACK */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_CTL_PTRG (0x20U) /*!< USCI_CTL setting for I2C control bits. It would set PTRG bit */ -#define UI2C_CTL_STA (0x08U) /*!< USCI_CTL setting for I2C control bits. It would set STA bit */ -#define UI2C_CTL_STO (0x04U) /*!< USCI_CTL setting for I2C control bits. It would set STO bit */ -#define UI2C_CTL_AA (0x02U) /*!< USCI_CTL setting for I2C control bits. It would set AA bit */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_GCMODE_ENABLE (1U) /*!< Enable USCI_I2C GC Mode */ -#define UI2C_GCMODE_DISABLE (0U) /*!< Disable USCI_I2C GC Mode */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C Wakeup Mode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_DATA_TOGGLE_WK (0x0U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according data toggle */ -#define UI2C_ADDR_MATCH_WK (0x1U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according address match */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_TO_INT_MASK (0x001U) /*!< Time-out interrupt mask */ -#define UI2C_STAR_INT_MASK (0x002U) /*!< Start condition received interrupt mask */ -#define UI2C_STOR_INT_MASK (0x004U) /*!< Stop condition received interrupt mask */ -#define UI2C_NACK_INT_MASK (0x008U) /*!< Non-acknowledge interrupt mask */ -#define UI2C_ARBLO_INT_MASK (0x010U) /*!< Arbitration lost interrupt mask */ -#define UI2C_ERR_INT_MASK (0x020U) /*!< Error interrupt mask */ -#define UI2C_ACK_INT_MASK (0x040U) /*!< Acknowledge interrupt mask */ - -/**@}*/ /* end of group USCI_I2C_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This macro sets the USCI_I2C protocol control register at one time - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Ctrl Set the register value of USCI_I2C control register. - * - * @return None - * - * @details Set UI2C_PROTCTL register to control USCI_I2C bus conditions of START, STOP, PTRG, ACK. - */ -#define UI2C_SET_CONTROL_REG(ui2c, u8Ctrl) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2EU) | (u8Ctrl)) - -/** - * @brief This macro only set START bit to protocol control register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus START condition in UI2C_PROTCTL register. - */ -#define UI2C_START(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~UI2C_PROTCTL_PTRG_Msk) | UI2C_PROTCTL_STA_Msk) - -/** - * @brief This macro only set STOP bit to the control register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus STOP condition in UI2C_PROTCTL register. - */ -#define UI2C_STOP(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2E) | (UI2C_PROTCTL_PTRG_Msk | UI2C_PROTCTL_STO_Msk)) - -/** - * @brief This macro returns the data stored in data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Data - * - * @details Read a byte data value of UI2C_RXDAT register from USCI_I2C bus - */ -#define UI2C_GET_DATA(ui2c) ((ui2c)->RXDAT) - -/** - * @brief This macro writes the data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details Write a byte data value of UI2C_TXDAT register, then sends address or data to USCI I2C bus - */ -#define UI2C_SET_DATA(ui2c, u8Data) ((ui2c)->TXDAT = (u8Data)) - -/** - * @brief This macro returns time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 USCI_I2C bus time-out is not happened - * @retval 1 USCI_I2C bus time-out is happened - * - * @details USCI_I2C bus occurs time-out event, the time-out flag will be set. If not occurs time-out event, this bit is cleared. - */ -#define UI2C_GET_TIMEOUT_FLAG(ui2c) (((ui2c)->PROTSTS & UI2C_PROTSTS_TOIF_Msk) == UI2C_PROTSTS_TOIF_Msk ? 1:0) - -/** - * @brief This macro returns wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details USCI_I2C controller wake-up flag will be set when USCI_I2C bus occurs wake-up from deep-sleep. - */ -#define UI2C_GET_WAKEUP_FLAG(ui2c) (((ui2c)->WKSTS & UI2C_WKSTS_WKF_Msk) == UI2C_WKSTS_WKF_Msk ? 1:0) - -/** - * @brief This macro is used to clear USCI_I2C wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details If USCI_I2C wake-up flag is set, use this macro to clear it. - */ -#define UI2C_CLR_WAKEUP_FLAG(ui2c) ((ui2c)->WKSTS = UI2C_WKSTS_WKF_Msk) - -/** - * @brief This macro disables the USCI_I2C 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details The UI2C_I2C is 7-bit address mode, when disable USCI_I2C 10-bit address match function. - */ -#define UI2C_DISABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL &= ~(UI2C_PROTCTL_ADDR10EN_Msk)) - -/** - * @brief This macro enables the 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To enable USCI_I2C 10-bit address match function. - */ -#define UI2C_ENABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL |= UI2C_PROTCTL_ADDR10EN_Msk) - -/** - * @brief This macro gets USCI_I2C protocol interrupt flag or bus status - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return A word data of USCI_I2C_PROTSTS register - * - * @details Read a word data of USCI_I2C PROTSTS register to get USCI_I2C bus Interrupt flags or status. - */ -#define UI2C_GET_PROT_STATUS(ui2c) ((ui2c)->PROTSTS) - -/** - * @brief This macro clears specified protocol interrupt flag - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UI2C_PROTSTS_ACKIF_Msk - * - \ref UI2C_PROTSTS_ERRIF_Msk - * - \ref UI2C_PROTSTS_ARBLOIF_Msk - * - \ref UI2C_PROTSTS_NACKIF_Msk - * - \ref UI2C_PROTSTS_STORIF_Msk - * - \ref UI2C_PROTSTS_STARIF_Msk - * - \ref UI2C_PROTSTS_TOIF_Msk - * @return None - * - * @details To clear interrupt flag when USCI_I2C occurs interrupt and set interrupt flag. - */ -#define UI2C_CLR_PROT_INT_FLAG(ui2c,u32IntTypeFlag) ((ui2c)->PROTSTS = (u32IntTypeFlag)) - -/** - * @brief This macro enables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Set specified USCI_I2C protocol interrupt bits to enable interrupt function. - */ -#define UI2C_ENABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN |= (u32IntSel)) - -/** - * @brief This macro disables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Clear specified USCI_I2C protocol interrupt bits to disable interrupt funtion. - */ -#define UI2C_DISABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN &= ~ (u32IntSel)) - - -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock); -void UI2C_Close(UI2C_T *ui2c); -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c); -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack); -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask); -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c); -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock); -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_ClearIntFlag(UI2C_T* ui2c, uint32_t u32Mask); -uint32_t UI2C_GetData(UI2C_T *ui2c); -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data); -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode); -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask); -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt); -void UI2C_DisableTimeout(UI2C_T *ui2c); -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode); -void UI2C_DisableWakeup(UI2C_T *ui2c); -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen); -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr); -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen); -/**@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USCI_I2C_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_spi.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_spi.h deleted file mode 100644 index 6689bd31d7d..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_spi.h +++ /dev/null @@ -1,420 +0,0 @@ -/****************************************************************************//** - * @file nu_usci_spi.h - * @version V3.00 - * @brief M2354 series USCI_SPI driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_USCI_SPI_H__ -#define __NU_USCI_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - -/** @addtogroup USCI_SPI_EXPORTED_CONSTANTS USCI_SPI Exported Constants - @{ -*/ - -#define USPI_MODE_0 (0x0UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with falling edge and receive with rising edge */ -#define USPI_MODE_1 (0x1UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with rising edge and receive with falling edge */ -#define USPI_MODE_2 (0x2UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with rising edge and receive with falling edge */ -#define USPI_MODE_3 (0x3UL << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with falling edge and receive with rising edge */ - -#define USPI_SLAVE (USPI_PROTCTL_SLAVE_Msk) /*!< Set as slave */ -#define USPI_MASTER (0x0UL) /*!< Set as master */ - -#define USPI_SS (USPI_PROTCTL_SS_Msk) /*!< Set SS */ -#define USPI_SS_ACTIVE_HIGH (0x0UL) /*!< SS active high */ -#define USPI_SS_ACTIVE_LOW (USPI_LINECTL_CTLOINV_Msk) /*!< SS active low */ - -/* USCI_SPI Interrupt Mask */ -#define USPI_SSINACT_INT_MASK (0x001UL) /*!< Slave Slave Inactive interrupt mask */ -#define USPI_SSACT_INT_MASK (0x002UL) /*!< Slave Slave Active interrupt mask */ -#define USPI_SLVTO_INT_MASK (0x004UL) /*!< Slave Mode Time-out interrupt mask */ -#define USPI_SLVBE_INT_MASK (0x008UL) /*!< Slave Mode Bit Count Error interrupt mask */ -#define USPI_TXUDR_INT_MASK (0x010UL) /*!< Slave Transmit Under Run interrupt mask */ -#define USPI_RXOV_INT_MASK (0x020UL) /*!< Receive Buffer Overrun interrupt mask */ -#define USPI_TXST_INT_MASK (0x040UL) /*!< Transmit Start interrupt mask */ -#define USPI_TXEND_INT_MASK (0x080UL) /*!< Transmit End interrupt mask */ -#define USPI_RXST_INT_MASK (0x100UL) /*!< Receive Start interrupt mask */ -#define USPI_RXEND_INT_MASK (0x200UL) /*!< Receive End interrupt mask */ - -/* USCI_SPI Status Mask */ -#define USPI_BUSY_MASK (0x01UL) /*!< Busy status mask */ -#define USPI_RX_EMPTY_MASK (0x02UL) /*!< RX empty status mask */ -#define USPI_RX_FULL_MASK (0x04UL) /*!< RX full status mask */ -#define USPI_TX_EMPTY_MASK (0x08UL) /*!< TX empty status mask */ -#define USPI_TX_FULL_MASK (0x10UL) /*!< TX full status mask */ -#define USPI_SSLINE_STS_MASK (0x20UL) /*!< USCI_SPI_SS line status mask */ - -/**@}*/ /* end of group USCI_SPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief Disable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL &= ~USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL |= USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Get the Rx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Rx buffer flag - * @retval 0: Rx buffer is not empty - * @retval 1: Rx buffer is empty - * \hideinitializer - */ -#define USPI_GET_RX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_RXEMPTY_Msk) == USPI_BUFSTS_RXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not empty - * @retval 1: Tx buffer is empty - * \hideinitializer - */ -#define USPI_GET_TX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXEMPTY_Msk) == USPI_BUFSTS_TXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer full flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not full - * @retval 1: Tx buffer is full - * \hideinitializer - */ -#define USPI_GET_TX_FULL_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXFULL_Msk) == USPI_BUFSTS_TXFULL_Msk ? 1:0 ) - -/** - * @brief Get the datum read from RX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return data in Rx register - * \hideinitializer - */ -#define USPI_READ_RX(uspi) ( (uspi)->RXDAT ) - -/** - * @brief Write datum to TX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through USCI_SPI bus. - * @return None - * \hideinitializer - */ -#define USPI_WRITE_TX(uspi, u32TxData) ( (uspi)->TXDAT = (u32TxData) ) - -/** - * @brief Set USCI_SPI_SS pin to high state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to high state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_HIGH(uspi) \ - do{ \ - (uspi)->LINECTL &= ~USPI_LINECTL_CTLOINV_Msk; \ - (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \ - }while(0) - -/** - * @brief Set USCI_SPI_SS pin to low state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to low state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_LOW(uspi) \ - do{ \ - (uspi)->LINECTL |= USPI_LINECTL_CTLOINV_Msk; \ - (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \ - }while(0) - -/** - * @brief Set the length of suspend interval. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SuspCycle Decide the length of suspend interval. - * @return None - * \hideinitializer - */ -#define USPI_SET_SUSPEND_CYCLE(uspi, u32SuspCycle) ( (uspi)->PROTCTL = ((uspi)->PROTCTL & ~USPI_PROTCTL_SUSPITV_Msk) | ((u32SuspCycle) << USPI_PROTCTL_SUSPITV_Pos) ) - -/** - * @brief Set the USCI_SPI transfer sequence with LSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_LSB_FIRST(uspi) ( (uspi)->LINECTL |= USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the USCI_SPI transfer sequence with MSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_MSB_FIRST(uspi) ( (uspi)->LINECTL &= ~USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the data width of a USCI_SPI transaction. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Width The data width - * @return None - * \hideinitializer - */ -#define USPI_SET_DATA_WIDTH(uspi, u32Width) \ - do{ \ - if((u32Width) == 16ul){ \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | (0 << USPI_LINECTL_DWIDTH_Pos); \ - }else { \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | ((u32Width) << USPI_LINECTL_DWIDTH_Pos); \ - } \ - }while(0) - -/** - * @brief Get the USCI_SPI busy state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return USCI_SPI busy status - * @retval 0: USCI_SPI module is not busy - * @retval 1: USCI_SPI module is busy - * \hideinitializer - */ -#define USPI_IS_BUSY(uspi) ( ((uspi)->PROTSTS & USPI_PROTSTS_BUSY_Msk) == USPI_PROTSTS_BUSY_Msk ? 1:0 ) - -/** - * @brief Get the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Wakeup status. - * @retval 0 Flag is not set. - * @retval 1 Flag is set. - * \hideinitializer - */ -#define USPI_GET_WAKEUP_FLAG(uspi) ( ((uspi)->WKSTS & USPI_WKSTS_WKF_Msk) == USPI_WKSTS_WKF_Msk ? 1:0 ) - -/** - * @brief Clear the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_CLR_WAKEUP_FLAG(uspi) ( (uspi)->WKSTS |= USPI_WKSTS_WKF_Msk ) - -/** - * @brief Get protocol interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of protocol status register. - * \hideinitializer - */ -#define USPI_GET_PROT_STATUS(uspi) ( (uspi)->PROTSTS ) - -/** - * @brief Clear specified protocol interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_PROTSTS_SSACTIF_Msk - * - \ref USPI_PROTSTS_SSINAIF_Msk - * - \ref USPI_PROTSTS_SLVBEIF_Msk - * - \ref USPI_PROTSTS_SLVTOIF_Msk - * - \ref USPI_PROTSTS_RXENDIF_Msk - * - \ref USPI_PROTSTS_RXSTIF_Msk - * - \ref USPI_PROTSTS_TXENDIF_Msk - * - \ref USPI_PROTSTS_TXSTIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_PROT_INT_FLAG(uspi, u32IntTypeFlag) ( (uspi)->PROTSTS = (u32IntTypeFlag) ) - -/** - * @brief Get buffer interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of buffer status register. - * \hideinitializer - */ -#define USPI_GET_BUF_STATUS(uspi) ( (uspi)->BUFSTS ) - -/** - * @brief Clear specified buffer interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_BUFSTS_TXUDRIF_Msk - * - \ref USPI_BUFSTS_RXOVIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_BUF_INT_FLAG(uspi, u32IntTypeFlag) ( (uspi)->BUFSTS = (u32IntTypeFlag) ) - -/** - * @brief Enable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_PROT_INT(uspi, u32IntSel) ( (uspi)->PROTIEN |= (u32IntSel) ) - -/** - * @brief Disable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_PROT_INT(uspi, u32IntSel) ( (uspi)->PROTIEN &= ~ (u32IntSel) ) - -/** - * @brief Enable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_BUF_INT(uspi, u32IntSel) ( (uspi)->BUFCTL |= (u32IntSel) ) - -/** - * @brief Disable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_BUF_INT(uspi, u32IntSel) ( (uspi)->BUFCTL &= ~ (u32IntSel) ) - -/** - * @brief Enable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_TRANS_INT(uspi, u32IntSel) ( (uspi)->INTEN |= (u32IntSel) ) - -/** - * @brief Disable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_TRANS_INT(uspi, u32IntSel) ( (uspi)->INTEN &= ~ (u32IntSel) ) - -/** - * @brief Trigger RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set RXPDMAEN bit of USPI_PDMACTL register to enable RX PDMA transfer function. - */ -#define USPI_TRIGGER_RX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_RXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Trigger TX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit of USPI_PDMACTL register to enable TX PDMA transfer function. - */ -#define USPI_TRIGGER_TX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to enable TX and RX PDMA transfer function. - */ -#define USPI_TRIGGER_TX_RX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_RXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear RXPDMAEN bit of USPI_PDMACTL register to disable RX PDMA transfer function. - */ -#define USPI_DISABLE_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit of USPI_PDMACTL register to disable TX PDMA transfer function. - */ -#define USPI_DISABLE_TX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to disable TX and RX PDMA transfer function. - */ -#define USPI_DISABLE_TX_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~(USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_RXPDMAEN_Msk) ) - -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void USPI_Close(USPI_T *uspi); -void USPI_ClearRxBuf(USPI_T *uspi); -void USPI_ClearTxBuf(USPI_T *uspi); -void USPI_DisableAutoSS(USPI_T *uspi); -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock); -uint32_t USPI_GetBusClock(USPI_T *uspi); -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask); -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask); -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask); -void USPI_EnableWakeup(USPI_T *uspi); -void USPI_DisableWakeup(USPI_T *uspi); - - -/**@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USCI_SPI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_SPI_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_uart.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_uart.h deleted file mode 100644 index 550955c2526..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_usci_uart.h +++ /dev/null @@ -1,445 +0,0 @@ -/****************************************************************************** - * @file nu_usci_uart.h - * @version V3.00 - * @brief M2354 series USCI UART (UUART) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_USCI_UART_H__ -#define __NU_USCI_UART_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_CONSTANTS USCI_UART Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_LINECTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_WORD_LEN_6 (6UL << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 6 bits */ -#define UUART_WORD_LEN_7 (7UL << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 7 bits */ -#define UUART_WORD_LEN_8 (8UL << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 8 bits */ -#define UUART_WORD_LEN_9 (9UL << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 9 bits */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_PROTCTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_PARITY_NONE (0x0UL << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as no parity */ -#define UUART_PARITY_ODD (0x1UL << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as odd parity */ -#define UUART_PARITY_EVEN (0x3UL << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as even parity */ - -#define UUART_STOP_BIT_1 (0x0UL) /*!< UUART_PROTCTL setting for one stop bit */ -#define UUART_STOP_BIT_2 (0x1UL) /*!< UUART_PROTCTL setting for two stop bit */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI UART interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_ABR_INT_MASK (0x002UL) /*!< Auto-baud rate interrupt mask */ -#define UUART_RLS_INT_MASK (0x004UL) /*!< Receive line status interrupt mask */ -#define UUART_BUF_RXOV_INT_MASK (0x008UL) /*!< Buffer RX overrun interrupt mask */ -#define UUART_TXST_INT_MASK (0x010UL) /*!< TX start interrupt mask */ -#define UUART_TXEND_INT_MASK (0x020UL) /*!< Tx end interrupt mask */ -#define UUART_RXST_INT_MASK (0x040UL) /*!< RX start interrupt mask */ -#define UUART_RXEND_INT_MASK (0x080UL) /*!< RX end interrupt mask */ - - -/**@}*/ /* end of group USCI_UART_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - */ -#define UUART_WRITE(uuart, u8Data) ((uuart)->TXDAT = (u8Data)) - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The oldest data byte in RX buffer. - * - * @details This macro read Rx data register. - */ -#define UUART_READ(uuart) ((uuart)->RXDAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not empty - * @retval >=1 Tx buffer is empty - * - * @details This macro get Transmitter buffer empty register value. - */ -#define UUART_GET_TX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not empty - * @retval >=1 Rx buffer is empty - * - * @details This macro get Receiver buffer empty register value. - */ -#define UUART_GET_RX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified usci_uart port transmission is over. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. \n - * It indicates if specified usci_uart port transmission is over nor not. - */ -#define UUART_IS_TX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos) - - -/** - * @brief Check specified usci_uart port receiver is empty. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx receiver is not empty - * @retval 1 Rx receiver is empty - * - * @details This macro return Receive Empty Flag register bit value. \n - * It indicates if specified usci_uart port receiver is empty nor not. - */ -#define UUART_IS_RX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) >> UUART_BUFSTS_RXEMPTY_Pos) - - -/** - * @brief Wait specified usci_uart port transmission is over - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro wait specified usci_uart port transmission is over. - */ -#define UUART_WAIT_TX_EMPTY(uuart) while(!((((uuart)->BUFSTS) & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos)) - - -/** - * @brief Check TX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 TX buffer is full - * @retval 0 TX buffer is not full - * - * @details This macro check TX buffer is full or not. - */ -#define UUART_IS_TX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk)>>UUART_BUFSTS_TXFULL_Pos) - - -/** - * @brief Check RX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 RX buffer is full - * @retval 0 RX buffer is not full - * - * @details This macro check RX buffer is full or not. - */ -#define UUART_IS_RX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk)>>UUART_BUFSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not full. - * @retval >=1 Tx buffer is full. - * - * @details This macro get Tx full register value. - */ -#define UUART_GET_TX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not full. - * @retval >=1 Rx buffer is full. - * - * @details This macro get Rx full register value. - */ -#define UUART_GET_RX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk) - - -/** - * @brief Enable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART protocol interrupt. - */ -#define UUART_ENABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART protocol interrupt. - */ -#define UUART_DISABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN &= ~(u32IntSel)) - - -/** - * @brief Enable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART buffer interrupt. - */ -#define UUART_ENABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART buffer interrupt. - */ -#define UUART_DISABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL &= ~ (u32IntSel)) - - -/** - * @brief Enable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART transfer interrupt. - */ -#define UUART_ENABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART transfer interrupt. - */ -#define UUART_DISABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN &= ~(u32IntSel)) - - -/** - * @brief Get protocol interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of protocol status register. - * - * @details This macro get protocol status register value. - */ -#define UUART_GET_PROT_STATUS(uuart) ((uuart)->PROTSTS) - - -/** - * @brief Clear specified protocol interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_PROTSTS_ABERRSTS_Msk : Auto-baud Rate Error Interrupt Indicator - * - \ref UUART_PROTSTS_ABRDETIF_Msk : Auto-baud Rate Detected Interrupt Flag - * - \ref UUART_PROTSTS_BREAK_Msk : Break Flag - * - \ref UUART_PROTSTS_FRMERR_Msk : Framing Error Flag - * - \ref UUART_PROTSTS_PARITYERR_Msk : Parity Error Flag - * - \ref UUART_PROTSTS_RXENDIF_Msk : Receive End Interrupt Flag - * - \ref UUART_PROTSTS_RXSTIF_Msk : Receive Start Interrupt Flag - * - \ref UUART_PROTSTS_TXENDIF_Msk : Transmit End Interrupt Flag - * - \ref UUART_PROTSTS_TXSTIF_Msk : Transmit Start Interrupt Flag - * - * @return None - * - * @details This macro clear specified protocol interrupt flag. - */ -#define UUART_CLR_PROT_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->PROTSTS = (u32IntTypeFlag)) - - -/** - * @brief Get transmit/receive buffer interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of buffer status register. - * - * @details This macro get buffer status register value. - */ -#define UUART_GET_BUF_STATUS(uuart) ((uuart)->BUFSTS) - - -/** - * @brief Clear specified buffer interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_BUFSTS_RXOVIF_Msk : Receive Buffer Over-run Error Interrupt Indicator - * - * @return None - * - * @details This macro clear specified buffer interrupt flag. - */ -#define UUART_CLR_BUF_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->BUFSTS = (u32IntTypeFlag)) - - -/** - * @brief Get wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Chip did not wake up from power-down mode. - * @retval 1 Chip waked up from power-down mode. - * - * @details This macro get wakeup flag. - */ -#define UUART_GET_WAKEUP_FLAG(uuart) ((uuart)->WKSTS & UUART_WKSTS_WKF_Msk ? 1: 0 ) - - -/** - * @brief Clear wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro clear wakeup flag. - */ -#define UUART_CLR_WAKEUP_FLAG(uuart) ((uuart)->WKSTS = UUART_WKSTS_WKF_Msk) - - -/** - * @brief Enable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * @details This macro enable specified USCI_UART PDMA function. - */ -#define UUART_PDMA_ENABLE(uuart, u32FuncSel) ((uuart)->PDMACTL |= (u32FuncSel)) - -/** - * @brief Disable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * @details This macro disable specified USCI_UART PDMA function. - */ -#define UUART_PDMA_DISABLE(uuart, u32FuncSel) ((uuart)->PDMACTL &= ~(u32FuncSel)) - - -void UUART_ClearIntFlag(UUART_T* uuart, uint32_t u32Mask); -uint32_t UUART_GetIntFlag(UUART_T* uuart, uint32_t u32Mask); -void UUART_Close(UUART_T* uuart); -void UUART_DisableInt(UUART_T* uuart, uint32_t u32Mask); -void UUART_EnableInt(UUART_T* uuart, uint32_t u32Mask); -uint32_t UUART_Open(UUART_T* uuart, uint32_t u32baudrate); -uint32_t UUART_Read(UUART_T* uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t UUART_SetLine_Config(UUART_T* uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -uint32_t UUART_Write(UUART_T* uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); -void UUART_EnableWakeup(UUART_T* uuart, uint32_t u32WakeupMode); -void UUART_DisableWakeup(UUART_T* uuart); -void UUART_EnableFlowCtrl(UUART_T* uuart); -void UUART_DisableFlowCtrl(UUART_T* uuart); - - -/**@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USCI_UART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_UART_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wdt.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wdt.h deleted file mode 100644 index d85fa241ba3..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wdt.h +++ /dev/null @@ -1,217 +0,0 @@ -/**************************************************************************//** - * @file nu_wdt.h - * @version V3.00 - * @brief Watchdog Timer(WDT) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WDT_H__ -#define __NU_WDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_CONSTANTS WDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Time-out Interval Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_TIMEOUT_2POW4 (0UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^4 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW6 (1UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^6 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW8 (2UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^8 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW10 (3UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^10 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW12 (4UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^12 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW14 (5UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^14 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW16 (6UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^16 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW18 (7UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^18 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW20 (8UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^20 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Reset Delay Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_DELAY_1026CLK (0UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 1026 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_130CLK (1UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 130 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_18CLK (2UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 18 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_3CLK (3UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 3 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Free Reset Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_COUNTER_KEYWORD (0x00005AA5UL) /*!< Fill this value to WDT_RSTCNT register to free reset WDT counter \hideinitializer */ - -/**@}*/ /* end of group WDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Clear WDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out reset system flag. - * \hideinitializer - */ -#define WDT_CLEAR_RESET_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_RSTF_Msk) - -/** - * @brief Clear WDT Time-out Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out interrupt flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_INT_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_IF_Msk) - -/** - * @brief Clear WDT Wake-up Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out wake-up system flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk)) | WDT_CTL_WKF_Msk) - -/** - * @brief Get WDT Time-out Reset Flag - * - * @param None - * - * @retval 0 WDT time-out reset system did not occur - * @retval 1 WDT time-out reset system occurred - * - * @details This macro indicates system has been reset by WDT time-out reset or not. - * \hideinitializer - */ -#define WDT_GET_RESET_FLAG() ((WDT->CTL & WDT_CTL_RSTF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Interrupt Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt did not occur - * @retval 1 WDT time-out interrupt occurred - * - * @details This macro indicates WDT time-out interrupt occurred or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_INT_FLAG() ((WDT->CTL & WDT_CTL_IF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Wake-up Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt does not cause CPU wake-up - * @retval 1 WDT time-out interrupt event cause CPU wake-up - * - * @details This macro indicates WDT time-out interrupt event has waked up system or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_WAKEUP_FLAG() ((WDT->CTL & WDT_CTL_WKF_Msk)? 1UL : 0UL) - -/** - * @brief Reset WDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reset the internal 20-bit WDT up counter value. - * @note If WDT is activated and time-out reset system function is enabled also, user should \n - * reset the 20-bit WDT up counter value to avoid generate WDT time-out reset signal to \n - * reset system before the WDT time-out reset delay period expires. - * \hideinitializer - */ -#define WDT_RESET_COUNTER() (WDT->RSTCNT = WDT_RESET_COUNTER_KEYWORD) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void WDT_Close(void); -__STATIC_INLINE void WDT_EnableInt(void); -__STATIC_INLINE void WDT_DisableInt(void); - -/** - * @brief Stop WDT Counting - * - * @param None - * - * @return None - * - * @details This function will stop WDT counting and disable WDT module. - */ -__STATIC_INLINE void WDT_Close(void) -{ - WDT->CTL = 0UL; - while(WDT->CTL & WDT_CTL_SYNC_Msk) {} /* Wait disable WDTEN bit completed, it needs 2 * WDT_CLK. */ -} - -/** - * @brief Enable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will enable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_EnableInt(void) -{ - WDT->CTL |= WDT_CTL_INTEN_Msk; -} - -/** - * @brief Disable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will disable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_DisableInt(void) -{ - /* Do not touch another write 1 clear bits */ - WDT->CTL &= ~(WDT_CTL_INTEN_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk); -} - -void WDT_Open(uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup); - -/**@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WDT_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wwdt.h b/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wwdt.h deleted file mode 100644 index da861382024..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/inc/nu_wwdt.h +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************//** - * @file nu_wwdt.h - * @version V3.00 - * @brief Window Watchdog Timer(WWDT) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WWDT_H__ -#define __NU_WWDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_CONSTANTS WWDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Prescale Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_PRESCALER_1 (0 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2 (1 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_4 (2 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 4 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_8 (3 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 8 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_16 (4 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 16 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_32 (5 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 32 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_64 (6 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 64 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_128 (7 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 128 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_192 (8 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 192 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_256 (9 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 256 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_384 (10 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 384 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_512 (11 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 512 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_768 (12 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 768 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1024 (13 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1024 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1536 (14 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1536 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2048 (15 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2048 * (64*WWDT_CLK) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Reload Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_RELOAD_WORD (0x00005AA5) /*!< Fill this value to WWDT_RLDCNT register to reload WWDT counter \hideinitializer */ - -/**@}*/ /* end of group WWDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Clear WWDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT time-out reset system flag. - * \hideinitializer - */ -#define WWDT_CLEAR_RESET_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTRF_Msk) - -/** - * @brief Clear WWDT Compared Match Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT compared match interrupt flag. - * \hideinitializer - */ -#define WWDT_CLEAR_INT_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTIF_Msk) - -/** - * @brief Get WWDT Reset System Flag - * - * @param None - * - * @retval 0 WWDT time-out reset system did not occur - * @retval 1 WWDT time-out reset system occurred - * - * @details This macro is used to indicate system has been reset by WWDT time-out reset or not. - * \hideinitializer - */ -#define WWDT_GET_RESET_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTRF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Compared Match Interrupt Flag - * - * @param None - * - * @retval 0 WWDT compare match interrupt did not occur - * @retval 1 WWDT compare match interrupt occurred - * - * @details This macro is used to indicate WWDT counter value matches CMPDAT value or not. - * \hideinitializer - */ -#define WWDT_GET_INT_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTIF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Counter - * - * @param None - * - * @return WWDT Counter Value - * - * @details This macro reflects the current WWDT counter value. - * \hideinitializer - */ -#define WWDT_GET_COUNTER() (WWDT->CNT) - -/** - * @brief Reload WWDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reload the WWDT counter value to 0x3F. - * @note User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value \n - * between 0 and CMPDAT value. If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, \n - * WWDT reset signal will generate immediately to reset system. - * \hideinitializer - */ -#define WWDT_RELOAD_COUNTER() (WWDT->RLDCNT = WWDT_RELOAD_WORD) - -void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt); - -/**@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WWDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WWDT_H__ */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewd b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewd deleted file mode 100644 index 4990af44b47..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewd +++ /dev/null @@ -1,3285 +0,0 @@ - - - - 2 - - Debug - - ARM - - 1 - - C-SPY - 2 - - 28 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 1 - 1 - 1 - - - - - - - - ANGEL_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - CADI_ID - 2 - - 0 - 1 - 1 - - - - - - - - - CMSISDAP_ID - 2 - - 4 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GDBSERVER_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - IARROM_ID - 2 - - 1 - 1 - 1 - - - - - - - - - IJET_ID - 2 - - 8 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JLINK_ID - 2 - - 16 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 2 - 1 - 1 - - - - - - - - - - MACRAIGOR_ID - 2 - - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - PEMICRO_ID - 2 - - 3 - 1 - 1 - - - - - - - - RDI_ID - 2 - - 2 - 1 - 1 - - - - - - - - - - - - - - - - STLINK_ID - 2 - - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - TIFET_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - - - XDS100_ID - 2 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $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 - - - - - 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 - - 6 - 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/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp deleted file mode 100644 index 5c7f5c6b2cb..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp +++ /dev/null @@ -1,2209 +0,0 @@ - - - 3 - - Debug - - ARM - - 1 - - General - 3 - - 31 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 35 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 10 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 1 - - - - - - - - - CUSTOM - 3 - - - - 0 - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 22 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - Release - - ARM - - 0 - - General - 3 - - 31 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 35 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 10 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 0 - - - - - - - - - CUSTOM - 3 - - - - 0 - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 22 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 0 - - - - - - - BILINK - 0 - - - - - src - - $PROJ_DIR$\..\src\nu_acmp.c - - - $PROJ_DIR$\..\src\nu_bpwm.c - - - $PROJ_DIR$\..\src\nu_can.c - - - $PROJ_DIR$\..\src\nu_clk.c - - - $PROJ_DIR$\..\src\nu_crc.c - - - $PROJ_DIR$\..\src\nu_crypto.c - - - $PROJ_DIR$\..\src\nu_dac.c - - - $PROJ_DIR$\..\src\nu_dpm.c - - - $PROJ_DIR$\..\src\nu_eadc.c - - - $PROJ_DIR$\..\src\nu_ebi.c - - - $PROJ_DIR$\..\src\nu_ecap.c - - - $PROJ_DIR$\..\src\nu_epwm.c - - - $PROJ_DIR$\..\src\nu_ewdt.c - - - $PROJ_DIR$\..\src\nu_ewwdt.c - - - $PROJ_DIR$\..\src\nu_fmc.c - - - $PROJ_DIR$\..\src\nu_fvc.c - - - $PROJ_DIR$\..\src\nu_gpio.c - - - $PROJ_DIR$\..\src\nu_i2c.c - - - $PROJ_DIR$\..\src\nu_i2s.c - - - $PROJ_DIR$\..\src\nu_keystore.c - - - $PROJ_DIR$\..\src\nu_lcd.c - - - $PROJ_DIR$\..\src\nu_pdma.c - - - $PROJ_DIR$\..\src\nu_qei.c - - - $PROJ_DIR$\..\src\nu_qspi.c - - - $PROJ_DIR$\..\src\nu_rng.c - - - $PROJ_DIR$\..\src\nu_rtc.c - - - $PROJ_DIR$\..\src\nu_sc.c - - - $PROJ_DIR$\..\src\nu_scuart.c - - - $PROJ_DIR$\..\src\nu_sdh.c - - - $PROJ_DIR$\..\src\nu_spi.c - - - $PROJ_DIR$\..\src\nu_sys.c - - - $PROJ_DIR$\..\src\nu_tamper.c - - - $PROJ_DIR$\..\src\nu_timer.c - - - $PROJ_DIR$\..\src\nu_timer_pwm.c - - - $PROJ_DIR$\..\src\nu_trng.c - - - $PROJ_DIR$\..\src\nu_uart.c - - - $PROJ_DIR$\..\src\nu_usbd.c - - - $PROJ_DIR$\..\src\nu_usci_i2c.c - - - $PROJ_DIR$\..\src\nu_usci_spi.c - - - $PROJ_DIR$\..\src\nu_usci_uart.c - - - $PROJ_DIR$\..\src\nu_wdt.c - - - $PROJ_DIR$\..\src\nu_wwdt.c - - - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.eww b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.eww deleted file mode 100644 index fcdfcdfe308..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.eww +++ /dev/null @@ -1,10 +0,0 @@ - - - - - $WS_DIR$\libStdDriver.ewp - - - - - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx deleted file mode 100644 index 83c6f46860b..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx +++ /dev/null @@ -1,607 +0,0 @@ - - - - 2.1 - -
### uVision Project, (C) Keil Software
- - - - libstddriver-m2354 - 0x4 - ARM-ADS - 6130001::V6.13.1::.\ARMCLANG - 1 - - - M2354ES - Nuvoton - Nuvoton.NuMicro_DFP.1.3.13 - https://github.com/OpenNuvoton/cmsis-packs/raw/master/ - IRAM(0x20000000,0x8000) IRAM2(0x30008000,0x10000) IROM(0x00000000,0x40000) IROM2(0x10040000,0x40000) CPUTYPE("Cortex-M23") TZ CLOCK(12000000) ESEL ELITTLE - - - UL2V8M(-S0 -C0 -P0 -FD20000000 -FC1200 -FN1 -FF0M2354_AP_1M -FS00 -FL0100000 -FP0($$Device:M2354ES$Flash\M2354_AP_1M.FLM)) - 0 - $$Device:M2354ES$Device\M2354\Include\M2354.h - - - - - - - - - - $$Device:M2354ES$SVD\Nuvoton\M2354_v1.svd - 0 - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - .\build\keil5\ - libstddriver_keil - 0 - 1 - 1 - 1 - 1 - .\build\keil5\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 1 - 0 - xcopy /y ".\build\keil5\@L.lib" "." - - 0 - 0 - 0 - 0 - - 1 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - 1 - - - - - - - SARMV8M.DLL - -MPU - TCM.DLL - -pCM23 - - - - 1 - 0 - 0 - 0 - 16 - - - - - 1 - 0 - 0 - 1 - 1 - 4100 - - 1 - BIN\UL2V8M.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-M23" - - 0 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 1 - 1 - 8 - 1 - 1 - 0 - 0 - 4 - 4 - 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 - 0x20000000 - 0x8000 - - - 1 - 0x0 - 0x40000 - - - 0 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x40000 - - - 1 - 0x10040000 - 0x40000 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x20000000 - 0x8000 - - - 0 - 0x30008000 - 0x10000 - - - - - - 1 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 5 - 3 - 0 - 0 - 0 - 1 - 0 - - - - - ..\inc;..\..\CMSIS\Include;..\..\Device\Nuvoton\M2354\Include;. - - - - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - 0 - 1 - 0 - 0x00000000 - 0x20000000 - - .\linking_scripts\m2354_flash.sct - - - --map --first='startup_M2354.o(RESET)' --datacompressor=off --info=inline --entry Reset_Handler - - - - - - - - src - - - nu_acmp.c - 1 - ..\src\nu_acmp.c - - - nu_bpwm.c - 1 - ..\src\nu_bpwm.c - - - nu_can.c - 1 - ..\src\nu_can.c - - - nu_clk.c - 1 - ..\src\nu_clk.c - - - nu_crc.c - 1 - ..\src\nu_crc.c - - - nu_crypto.c - 1 - ..\src\nu_crypto.c - - - nu_dac.c - 1 - ..\src\nu_dac.c - - - nu_dpm.c - 1 - ..\src\nu_dpm.c - - - nu_eadc.c - 1 - ..\src\nu_eadc.c - - - nu_ebi.c - 1 - ..\src\nu_ebi.c - - - nu_ecap.c - 1 - ..\src\nu_ecap.c - - - nu_epwm.c - 1 - ..\src\nu_epwm.c - - - nu_ewdt.c - 1 - ..\src\nu_ewdt.c - - - nu_ewwdt.c - 1 - ..\src\nu_ewwdt.c - - - nu_fmc.c - 1 - ..\src\nu_fmc.c - - - nu_fvc.c - 1 - ..\src\nu_fvc.c - - - nu_gpio.c - 1 - ..\src\nu_gpio.c - - - nu_i2c.c - 1 - ..\src\nu_i2c.c - - - nu_i2s.c - 1 - ..\src\nu_i2s.c - - - nu_keystore.c - 1 - ..\src\nu_keystore.c - - - nu_lcd.c - 1 - ..\src\nu_lcd.c - - - nu_pdma.c - 1 - ..\src\nu_pdma.c - - - nu_qei.c - 1 - ..\src\nu_qei.c - - - nu_qspi.c - 1 - ..\src\nu_qspi.c - - - nu_rng.c - 1 - ..\src\nu_rng.c - - - nu_rtc.c - 1 - ..\src\nu_rtc.c - - - nu_sc.c - 1 - ..\src\nu_sc.c - - - nu_scuart.c - 1 - ..\src\nu_scuart.c - - - nu_sdh.c - 1 - ..\src\nu_sdh.c - - - nu_spi.c - 1 - ..\src\nu_spi.c - - - nu_sys.c - 1 - ..\src\nu_sys.c - - - nu_tamper.c - 1 - ..\src\nu_tamper.c - - - nu_timer.c - 1 - ..\src\nu_timer.c - - - nu_timer_pwm.c - 1 - ..\src\nu_timer_pwm.c - - - nu_uart.c - 1 - ..\src\nu_uart.c - - - nu_usbd.c - 1 - ..\src\nu_usbd.c - - - nu_usci_i2c.c - 1 - ..\src\nu_usci_i2c.c - - - nu_usci_spi.c - 1 - ..\src\nu_usci_spi.c - - - nu_usci_uart.c - 1 - ..\src\nu_usci_uart.c - - - nu_wdt.c - 1 - ..\src\nu_wdt.c - - - nu_wwdt.c - 1 - ..\src\nu_wwdt.c - - - nu_trng.c - 1 - ..\src\nu_trng.c - - - - - - - - - - - - - -
diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/lib/nutool_clkcfg.h b/bsp/nuvoton/libraries/m2354/StdDriver/lib/nutool_clkcfg.h deleted file mode 100644 index 950b09946e2..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/nutool_clkcfg.h +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************************** - * @file nutool_clkcfg.h - * @version V1.05 - * @Date 2020/04/15-11:28:38 - * @brief NuMicro generated code file - * - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2013-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NUTOOL_CLKCFG_H__ -#define __NUTOOL_CLKCFG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif -#undef __HXT -#define __HXT (12000000UL) /*!< High Speed External Crystal Clock Frequency */ - -#ifdef __cplusplus -} -#endif -#endif /*__NUTOOL_CLKCFG_H__*/ - -/*** (C) COPYRIGHT 2013-2020 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_acmp.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_acmp.c deleted file mode 100644 index 73d9bbb5eb9..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_acmp.c +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************//** - * @file acmp.c - * @version V3.00 - * @brief Analog Comparator(ACMP) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - - -/** - * @brief Configure the specified ACMP module - * - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * @param[in] u32NegSrc Comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * - \ref ACMP_CTL_NEGSEL_DAC - * @param[in] u32HysSel The hysteresis function option. Including: - * - \ref ACMP_CTL_HYSTERESIS_30MV - * - \ref ACMP_CTL_HYSTERESIS_20MV - * - \ref ACMP_CTL_HYSTERESIS_10MV - * - \ref ACMP_CTL_HYSTERESIS_DISABLE - * - * @return None - * - * @details Configure hysteresis function, select the source of negative input and enable analog comparator. - */ -void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel) -{ - acmp->CTL[u32ChNum] = (acmp->CTL[u32ChNum] & (~(ACMP_CTL_NEGSEL_Msk | ACMP_CTL_HYSSEL_Msk))) | (u32NegSrc | u32HysSel | ACMP_CTL_ACMPEN_Msk); -} - -/** - * @brief Close analog comparator - * - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * - * @return None - * - * @details This function will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - */ -void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum) -{ - acmp->CTL[u32ChNum] &= (~ACMP_CTL_ACMPEN_Msk); -} - - - -/**@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group ACMP_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_bpwm.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_bpwm.c deleted file mode 100644 index 52065381f42..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_bpwm.c +++ /dev/null @@ -1,713 +0,0 @@ -/**************************************************************************//** - * @file bpwm.c - * @version V1.00 - * @brief M2354 series BPWM driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - - -/** @addtogroup BPWM_EXPORTED_FUNCTIONS BPWM Exported Functions - @{ -*/ - -/** - * @brief Configure BPWM capture and get the nearest unit time. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure BPWM capture and get the nearest unit time. - */ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32PWMClockSrc; - uint32_t u32NearestUnitTimeNsec = 0U; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - uint8_t u8BreakLoop = 0U; - - (void)u32ChannelNum; - (void)u32CaptureEdge; - - /* clock source is from PCLK */ - if((((uint32_t)bpwm) == BPWM0_BASE) || (((uint32_t)bpwm) == BPWM0_BASE + NS_OFFSET)) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else/* if((bpwm == BPWM1)||(bpwm == BPWM1_NS)) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - - u32PWMClockSrc /= 1000UL; - for(u32Prescale = 1U; u32Prescale <= 0x1000UL; u32Prescale++) - { - u32NearestUnitTimeNsec = (1000000UL * u32Prescale) / u32PWMClockSrc; - if(u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if(u32Prescale == 0x1000U) - { - /* limit to the maximum unit time(nano second) */ - u8BreakLoop = 1U; - } - if(!((1000000UL * (u32Prescale + 1UL) > (u32NearestUnitTimeNsec * u32PWMClockSrc)))) - { - u8BreakLoop = 1U; - } - } - else - { - u8BreakLoop = 1U; - } - if(u8BreakLoop) - { - break; - } - } - - /* convert to real register value */ - u32Prescale = u32Prescale - 1U; - /* all channels share a prescaler */ - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); - - /* set BPWM to down count type(edge aligned) */ - (bpwm)->CTL1 = (1UL); - - BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure BPWM generator and get the nearest frequency in edge aligned(up counter type) auto-reload mode - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since all channels shares a prescaler. Call this API to configure BPWM frequency may affect - * existing frequency of other channel. - * @note This function is used for initial stage. - * To change duty cycle later, it should get the configured period value and calculate the new comparator value. - */ -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32PWMClockSrc; - uint32_t i; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - /* clock source is from PCLK */ - if(((uint32_t)bpwm == BPWM0_BASE) || ((uint32_t)bpwm == BPWM0_BASE + NS_OFFSET)) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else/* if((bpwm == BPWM1)||(bpwm == BPWM1_NS)) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - - for(u32Prescale = 1U; u32Prescale < 0xFFFU; u32Prescale++)/* prescale could be 0~0xFFF */ - { - i = (u32PWMClockSrc / u32Frequency) / u32Prescale; - /* If target value is larger than CNR, need to use a larger prescaler */ - if(i <= (0x10000U)) - { - u32CNR = i; - break; - } - } - /* Store return value here 'cos we're gonna change u32Prescale & u32CNR to the real value to fill into register */ - i = u32PWMClockSrc / (u32Prescale * u32CNR); - - /* convert to real register value */ - u32Prescale = u32Prescale - 1U; - /* all channels share a prescaler */ - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); - /* set BPWM to up counter type(edge aligned) */ - (bpwm)->CTL1 = BPWM_UP_COUNTER; - - u32CNR = u32CNR - 1U; - BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); - BPWM_SET_CMR(bpwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1UL) / 100UL); - - - (bpwm)->WGCTL0 = ((bpwm)->WGCTL0 & ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1))) | \ - (BPWM_OUTPUT_HIGH << (u32ChannelNum << 1UL << BPWM_WGCTL0_ZPCTL0_Pos)); - (bpwm)->WGCTL1 = ((bpwm)->WGCTL1 & ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1))) | \ - (BPWM_OUTPUT_LOW << (u32ChannelNum << 1UL << BPWM_WGCTL1_CMPUCTL0_Pos)); - - return(i); -} - -/** - * @brief Start BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to start BPWM module. - * @note All channels share one counter. - */ -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (void)u32ChannelMask; - (bpwm)->CNTEN = BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Stop BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM module. - * @note All channels share one period. - */ -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (void)u32ChannelMask; - (bpwm)->PERIOD = 0UL; -} - -/** - * @brief Stop BPWM generation immediately by clear channel enable bit - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM generation immediately by clear channel enable bit. - * @note All channels share one counter. - */ -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (void)u32ChannelMask; - (bpwm)->CNTEN &= ~BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_OR_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_DOWN_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable selected channel to trigger ADC - */ -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if(u32ChannelNum < 4UL) - { - (bpwm)->EADCTS0 &= ~((BPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3)); - (bpwm)->EADCTS0 |= ((BPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3)); - } - else - { - (bpwm)->EADCTS1 &= ~((BPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4UL) << 3)); - (bpwm)->EADCTS1 |= ((BPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4UL) << 3)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~3 - * @return None - * @details This function is used to disable selected channel to trigger ADC - */ -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - if(u32ChannelNum < 4UL) - { - (bpwm)->EADCTS0 &= ~(BPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3)); - } - else - { - (bpwm)->EADCTS1 &= ~(BPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4UL) << 3)); - } -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag - */ -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (void)u32Condition; - (bpwm)->STATUS = (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get BPWM trigger ADC to start of conversion flag for specified channel - */ -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->STATUS & (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s) - */ -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN |= u32ChannelMask; - (bpwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s) - */ -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN &= ~u32ChannelMask; - (bpwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enables BPWM output generation of selected channel(s) - */ -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disables BPWM output generation of selected channel(s) - */ -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - uint32_t u32CapIf = 0UL; - - u32CapIf = ((((bpwm)->CAPIF & (BPWM_CAPIF_CAPFIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1); - u32CapIf |= (((bpwm)->CAPIF & (BPWM_CAPIF_CAPRIF0_Msk << u32ChannelNum)) ? 1UL : 0UL); - return u32CapIf; -} - -/** - * @brief Enable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref BPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (bpwm)->INTEN |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel - */ -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN &= (uint32_t)(~((BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | BPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum)); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel - */ -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = (BPWM_INTSTS_CMPUIF0_Msk | BPWM_INTSTS_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel - */ -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return ((((bpwm)->INTSTS & ((BPWM_INTSTS_CMPDIF0_Msk | BPWM_INTSTS_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (void)u32ChannelNum; - (void)u32IntPeriodType; - (bpwm)->INTEN |= BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTEN &= ~BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTSTS = BPWM_INTSTS_PIF0_Msk; -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - return (((bpwm)->INTSTS & BPWM_INTSTS_PIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to enable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTEN |= BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTEN &= ~BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTSTS = BPWM_INTSTS_ZIF0_Msk; -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return zero interrupt flag of specified channel - * @retval 0 zero interrupt did not occur - * @retval 1 zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - return (((bpwm)->INTSTS & BPWM_INTSTS_ZIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode BPWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode BPWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Set BPWM clock source - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32ClkSrcSel BPWM external clock source. - * - \ref BPWM_CLKSRC_BPWM_CLK - * - \ref BPWM_CLKSRC_TIMER0 - * - \ref BPWM_CLKSRC_TIMER1 - * - \ref BPWM_CLKSRC_TIMER2 - * - \ref BPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set BPWM clock source. - * @note All channels share channel 0's setting. - */ -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (void)u32ChannelNum; - (bpwm)->CLKSRC = (u32ClkSrcSel); -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - return (((bpwm)->STATUS & BPWM_STATUS_CNTMAX0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->STATUS = BPWM_STATUS_CNTMAX0_Msk; -} - - -/**@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group BPWM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_can.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_can.c deleted file mode 100644 index 1f368044963..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_can.c +++ /dev/null @@ -1,1191 +0,0 @@ -/**************************************************************************//** - * @file can.c - * @version V3.00 - * @brief CAN driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -#if defined(__ICCARM__) -# pragma diag_suppress=Pm073, Pm143 /* Misra C rule 14.7 */ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CAN_Driver CAN Driver - @{ -*/ - -/** @addtogroup CAN_EXPORTED_FUNCTIONS CAN Exported Functions - @{ -*/ - -/** @cond HIDDEN_SYMBOLS */ - -#if defined(CAN1) -static uint8_t gu8LockCanIf[2][2] = {{0U}}; /* The chip has two CANs. */ -#elif defined(CAN0) || defined(CAN) -static uint8_t gu8LockCanIf[1][2] = {{0U}}; /* The chip only has one CAN. */ -#endif - -#define RETRY_COUNTS (0x10000000UL) - -#define TSEG1_MIN 2 -#define TSEG1_MAX 16 -#define TSEG2_MIN 1 -#define TSEG2_MAX 8 -#define BRP_MIN 1 -#define BRP_MAX 1024 /* 6-bit BRP field + 4-bit BRPE field*/ -#define SJW_MAX 4UL -#define BRP_INC 1 - -/* #define DEBUG_PRINTF printf */ -#define DEBUG_PRINTF(...) - - -static uint32_t LockIF(CAN_T *tCAN); -static uint32_t LockIF_TL(CAN_T *tCAN); -static void ReleaseIF(CAN_T *tCAN, uint32_t u32IfNo); -static int can_update_spt(int sampl_pt, int tseg, int *tseg1, int *tseg2); - -/** - * @brief Check if any interface is available then lock it for usage. - * @param[in] tCAN The pointer to CAN module base address. - * @retval 0 IF0 is free - * @retval 1 IF1 is free - * @retval 2 No IF is free - * @details Search the first free message interface, starting from 0. If a interface is - * available, set a flag to lock the interface. - */ -static uint32_t LockIF(CAN_T *tCAN) -{ - uint32_t u32CanNo; - uint32_t u32FreeIfNo; - uint32_t u32IntMask; - -#if defined(CAN1) - u32CanNo = (tCAN == CAN1) ? 1 : 0; -#else // defined(CAN0) || defined(CAN) - u32CanNo = 0U; -#endif - - u32FreeIfNo = 2U; - - /* Disable CAN interrupt */ - u32IntMask = tCAN->CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - /* Check interface 1 is available or not */ - if((tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0U) - { - if(gu8LockCanIf[u32CanNo][0] == (uint8_t)FALSE) - { - gu8LockCanIf[u32CanNo][0] = (uint8_t)TRUE; - u32FreeIfNo = 0U; - } - } - - /* Or check interface 2 is available or not */ - if(u32FreeIfNo == 2U) - { - if((tCAN->IF[1].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0U) - { - if(gu8LockCanIf[u32CanNo][1] == (uint8_t)FALSE) - { - gu8LockCanIf[u32CanNo][1] = (uint8_t)TRUE; - u32FreeIfNo = 1U; - } - } - } - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - - return u32FreeIfNo; -} - -/** - * @brief Check if any interface is available in a time limitation then lock it for usage. - * @param[in] tCAN The pointer to CAN module base address. - * @retval 0 IF0 is free - * @retval 1 IF1 is free - * @retval 2 No IF is free - * @details Search the first free message interface, starting from 0. If no interface is - * it will try again until time out. If a interface is available, set a flag to - * lock the interface. - */ -static uint32_t LockIF_TL(CAN_T *tCAN) -{ - uint32_t u32Count; - uint32_t u32FreeIfNo = 0; - - for(u32Count = 0U; u32Count < (uint32_t)RETRY_COUNTS; u32Count++) - { - if((u32FreeIfNo = LockIF(tCAN)) != 2U) - { - break; - } - } - - return u32FreeIfNo; -} - -/** - * @brief Release locked interface. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Info The interface number, 0 or 1. - * @return none - * @details Release the locked interface. - */ -static void ReleaseIF(CAN_T *tCAN, uint32_t u32IfNo) -{ - uint32_t u32IntMask; - uint32_t u32CanNo; - - if(u32IfNo < 2U) - { - -#if defined(CAN1) - u32CanNo = (tCAN == CAN1) ? 1U : 0U; -#else // defined(CAN0) || defined(CAN) - u32CanNo = 0U; -#endif - - /* Disable CAN interrupt */ - u32IntMask = tCAN->CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - gu8LockCanIf[u32CanNo][u32IfNo] = (uint8_t)FALSE; - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - } -} - -/** - * @brief Enter initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] Following values can be used. - * \ref CAN_CON_DAR_Msk Disable automatic retransmission. - * \ref CAN_CON_EIE_Msk Enable error interrupt. - * \ref CAN_CON_SIE_Msk Enable status interrupt. - * \ref CAN_CON_IE_Msk CAN interrupt. - * @return None - * @details This function is used to set CAN to enter initialization mode and enable access bit timing - * register. After bit timing configuration ready, user must call CAN_LeaveInitMode() - * to leave initialization mode and lock bit timing register to let new configuration - * take effect. - */ -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask) -{ - tCAN->CON = u8Mask | (CAN_CON_INIT_Msk | CAN_CON_CCE_Msk); -} - - -/** - * @brief Leave initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to set CAN to leave initialization mode to let - * bit timing configuration take effect after configuration ready. - */ -void CAN_LeaveInitMode(CAN_T *tCAN) -{ - tCAN->CON &= (~(CAN_CON_INIT_Msk | CAN_CON_CCE_Msk)); - while(tCAN->CON & CAN_CON_INIT_Msk) {} /* Check INIT bit is released */ -} - -/** - * @brief Wait message into message buffer in basic mode. - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to wait message into message buffer in basic mode. Please notice the - * function is polling NEWDAT bit of MCON register by while loop and it is used in basic mode. - */ -void CAN_WaitMsg(CAN_T *tCAN) -{ - tCAN->STATUS = 0x0U; /* clr status */ - - while(1) - { - if(tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) /* check new data */ - { - /* DEBUG_PRINTF("New Data IN\n"); */ - break; - } - - if(tCAN->STATUS & CAN_STATUS_RXOK_Msk) - { - /* DEBUG_PRINTF("Rx OK\n"); */ - } - - if(tCAN->STATUS & CAN_STATUS_LEC_Msk) - { - /* DEBUG_PRINTF("Error\n"); */ - } - } -} - -/** - * @brief Get current bit rate - * @param[in] tCAN The pointer to CAN module base address. - * @return Current Bit-Rate (kilo bit per second) - * @details Return current CAN bit rate according to the user bit-timing parameter settings - */ -uint32_t CAN_GetCANBitRate(CAN_T *tCAN) -{ - uint8_t u8Tseg1, u8Tseg2; - uint32_t u32Bpr; - - u8Tseg1 = (uint8_t)((tCAN->BTIME & CAN_BTIME_TSEG1_Msk) >> CAN_BTIME_TSEG1_Pos); - u8Tseg2 = (uint8_t)((tCAN->BTIME & CAN_BTIME_TSEG2_Msk) >> CAN_BTIME_TSEG2_Pos); - u32Bpr = (tCAN->BTIME & CAN_BTIME_BRP_Msk); - u32Bpr |= (tCAN->BRPE << 6); - - - return (SystemCoreClock / (u32Bpr + 1U) / ((uint32_t)u8Tseg1 + (uint32_t)u8Tseg2 + 3U)); -} - -/** - * @brief Switch the CAN into test mode. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8TestMask Specifies the configuration in test modes - * \ref CAN_TEST_BASIC_Msk Enable basic mode of test mode - * \ref CAN_TEST_SILENT_Msk Enable silent mode of test mode - * \ref CAN_TEST_LBACK_Msk Enable Loop Back Mode of test mode - * \ref CAN_TEST_TX0_Msk / \ref CAN_TEST_TX1_Msk Control CAN_TX pin bit field - * @return None - * @details Switch the CAN into test mode. There are four test mode (BASIC/SILENT/LOOPBACK/ - * LOOPBACK combined SILENT/CONTROL_TX_PIN)could be selected. After setting test mode,user - * must call CAN_LeaveInitMode() to let the setting take effect. - */ -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST = u8TestMask; -} - - -/** - * @brief Leave the test mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to Leave the test mode (switch into normal mode). - */ -void CAN_LeaveTestMode(CAN_T *tCAN) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST &= ~(CAN_TEST_LBACK_Msk | CAN_TEST_SILENT_Msk | CAN_TEST_BASIC_Msk); - tCAN->CON &= (~CAN_CON_TEST_Msk); -} - -/** - * @brief Get the waiting status of a received message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @retval non-zero The corresponding message object has a new data bit is set. - * @retval 0 No message object has new data. - * @details This function is used to get the waiting status of a received message. - */ -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj) -{ - uint32_t ret; - - if((uint32_t)u8MsgObj < 16U) - { - ret = tCAN->NDAT1 & (1UL << u8MsgObj); - } - else - { - ret = tCAN->NDAT2 & (1UL << (u8MsgObj - 16U)); - } - - return ret; -} - - -/** - * @brief Send CAN message in BASIC mode of test mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure containing data to transmit. - * @return TRUE: Transmission OK - * FALSE: Check busy flag of interface 0 is timeout - * @details The function is used to send CAN message in BASIC mode of test mode. Before call the API, - * the user should be call CAN_EnterTestMode(CAN_TEST_BASIC) and let CAN controller enter - * basic mode of test mode. Please notice IF1 Registers used as Tx Buffer in basic mode. - */ -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg) -{ - uint32_t i = 0UL; - while(tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) {} - - - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - if(pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[0].ARB1 = 0UL; - tCAN->IF[0].ARB2 = (((pCanMsg->Id) & 0x7FFUL) << 2) ; - } - else - { - /* extended ID*/ - tCAN->IF[0].ARB1 = (pCanMsg->Id) & 0xFFFFUL; - tCAN->IF[0].ARB2 = (((pCanMsg->Id) & 0x1FFF0000UL) >> 16) | CAN_IF_ARB2_XTD_Msk; - - } - - if(pCanMsg->FrameType) - { - tCAN->IF[0].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[0].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - tCAN->IF[0].MCON = (tCAN->IF[0].MCON & (~CAN_IF_MCON_DLC_Msk)) | pCanMsg->DLC; - tCAN->IF[0].DAT_A1 = ((uint32_t)pCanMsg->Data[1] << 8) | pCanMsg->Data[0]; - tCAN->IF[0].DAT_A2 = ((uint32_t)pCanMsg->Data[3] << 8) | pCanMsg->Data[2]; - tCAN->IF[0].DAT_B1 = ((uint32_t)pCanMsg->Data[5] << 8) | pCanMsg->Data[4]; - tCAN->IF[0].DAT_B2 = ((uint32_t)pCanMsg->Data[7] << 8) | pCanMsg->Data[6]; - - /* request transmission*/ - tCAN->IF[0].CREQ &= (~CAN_IF_CREQ_BUSY_Msk); - if(tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /* DEBUG_PRINTF("Cannot clear busy for sending ...\n"); */ - return (int32_t)FALSE; - } - - tCAN->IF[0].CREQ |= CAN_IF_CREQ_BUSY_Msk; /* sending */ - - for(i = 0UL; i < 0xFFFFFUL; i++) - { - if((tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0UL) - { - break; - } - } - - if(i >= 0xFFFFFUL) - { - /* DEBUG_PRINTF("Cannot send out...\n"); */ - return (int32_t)FALSE; - } - - - return (int32_t)TRUE; -} - -/** - * @brief Get a message information in BASIC mode. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @return FALSE No any message received. - * TRUE Receive a message success. - * - */ -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg) -{ - - if((tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) == 0UL) /* In basic mode, receive data always save in IF2 */ - { - return (int32_t)FALSE; - } - - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - tCAN->IF[1].CMASK = CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - if((tCAN->IF[1].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0UL) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 >> 2) & 0x07FFUL; - - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 & 0x1FFFUL) << 16; - pCanMsg->Id |= (uint32_t)tCAN->IF[1].ARB1; - } - - /* - pCanMsg->FrameType = (uint32_t)(!(uint32_t)((tCAN->IF[1].ARB2 & (uint32_t)CAN_IF_ARB2_DIR_Msk) >> (uint32_t)CAN_IF_ARB2_DIR_Pos)); - */ - - pCanMsg->FrameType = (tCAN->IF[1].ARB2 & CAN_IF_ARB2_DIR_Msk) ? 0UL : 1UL; - - pCanMsg->DLC = (uint8_t)(tCAN->IF[1].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - - return (int32_t)TRUE; -} - -/** - * @brief Set Rx message object, include ID mask. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast) -{ - uint8_t u8MsgIfNum; - - /* Get and lock a free interface */ - if((u8MsgIfNum = (uint8_t)LockIF_TL(tCAN)) == 2U) - { - return (int32_t)FALSE; - } - - /* Command Setting */ - tCAN->IF[u8MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if(u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u8MsgIfNum].ARB1 = 0U; - tCAN->IF[u8MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFUL) << 2; - } - else - { - tCAN->IF[u8MsgIfNum].ARB1 = u32id & 0xFFFFUL; - tCAN->IF[u8MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000UL) >> 16; - } - - tCAN->IF[u8MsgIfNum].MASK1 = (u32idmask & 0xFFFFUL); - tCAN->IF[u8MsgIfNum].MASK2 = (u32idmask >> 16) & 0xFFFFUL; - - - tCAN->IF[u8MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if(u8singleOrFifoLast) - { - tCAN->IF[u8MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u8MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u8MsgIfNum].DAT_A1 = 0U; - tCAN->IF[u8MsgIfNum].DAT_A2 = 0U; - tCAN->IF[u8MsgIfNum].DAT_B1 = 0U; - tCAN->IF[u8MsgIfNum].DAT_B2 = 0U; - - tCAN->IF[u8MsgIfNum].CREQ = 1UL + u8MsgObj; - ReleaseIF(tCAN, (uint32_t)u8MsgIfNum); - - return (int32_t)TRUE; -} - -/** - * @brief Set Rx message object - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast) -{ - uint8_t u8MsgIfNum; - - /* Get and lock a free interface */ - if((u8MsgIfNum = (uint8_t)LockIF_TL(tCAN)) == 2U) - { - return (int32_t)FALSE; - } - - /* Command Setting */ - tCAN->IF[u8MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if(u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u8MsgIfNum].ARB1 = 0U; - tCAN->IF[u8MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFUL) << 2; - } - else - { - tCAN->IF[u8MsgIfNum].ARB1 = u32id & 0xFFFFUL; - tCAN->IF[u8MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000UL) >> 16; - } - - - tCAN->IF[u8MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if(u8singleOrFifoLast) - { - tCAN->IF[u8MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u8MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u8MsgIfNum].DAT_A1 = 0U; - tCAN->IF[u8MsgIfNum].DAT_A2 = 0U; - tCAN->IF[u8MsgIfNum].DAT_B1 = 0U; - tCAN->IF[u8MsgIfNum].DAT_B2 = 0U; - - tCAN->IF[u8MsgIfNum].CREQ = 1UL + u8MsgObj; - ReleaseIF(tCAN, (uint32_t)u8MsgIfNum); - - return (int32_t)TRUE; -} - -/** - * @brief Gets the message - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8Release Specifies the message release indicator. - * This parameter can be one of the following values: - * TRUE: the message object is released when getting the data. - * FALSE:the message object is not released. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * @retval TRUE Success - * @retval FALSE No any message received - * @details Gets the message, if received. - */ -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T* pCanMsg) -{ - uint8_t u8MsgIfNum; - uint32_t u32Tmp; - - if(!CAN_IsNewDataReceived(tCAN, u8MsgObj)) - { - return (int32_t)FALSE; - } - - /* Get and lock a free interface */ - if((u8MsgIfNum = (uint8_t)LockIF_TL(tCAN)) == 2U) - { - return (int32_t)FALSE; - } - - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u8MsgIfNum].CMASK = CAN_IF_CMASK_MASK_Msk - | CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_CLRINTPND_Msk - | (u8Release ? CAN_IF_CMASK_TXRQSTNEWDAT_Msk : 0UL) - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - tCAN->IF[u8MsgIfNum].CREQ = 1UL + u8MsgObj; - - while(tCAN->IF[u8MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - - if((tCAN->IF[u8MsgIfNum].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0U) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[u8MsgIfNum].ARB2 & CAN_IF_ARB2_ID_Msk) >> 2; - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - - u32Tmp = (((tCAN->IF[u8MsgIfNum].ARB2) & 0x1FFFUL) << 16); - u32Tmp |= tCAN->IF[u8MsgIfNum].ARB1; - - pCanMsg->Id = u32Tmp; - } - - pCanMsg->DLC = (uint8_t)(tCAN->IF[u8MsgIfNum].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[u8MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[u8MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[u8MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[u8MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[u8MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[u8MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[u8MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[u8MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - - ReleaseIF(tCAN, (uint32_t)u8MsgIfNum); - return (int32_t)TRUE; -} - -static int can_update_spt(int sampl_pt, int tseg, int *tseg1, int *tseg2) -{ - *tseg2 = tseg + 1 - (sampl_pt * (tseg + 1)) / 1000; - if(*tseg2 < TSEG2_MIN) - { - *tseg2 = TSEG2_MIN; - } - if(*tseg2 > TSEG2_MAX) - { - *tseg2 = TSEG2_MAX; - } - - *tseg1 = tseg - *tseg2; - - if(*tseg1 > TSEG1_MAX) - { - *tseg1 = TSEG1_MAX; - *tseg2 = tseg - *tseg1; - } - return 1000 * (tseg + 1 - *tseg2) / (tseg + 1); -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Set bus baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * - * @return u32CurrentBitRate Real baud-rate value. - * - * @details The function is used to set bus timing parameter according current clock and target baud-rate. - */ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate) -{ - long rate; - long best_error = 1000000000, error = 0; - int best_tseg = 0, best_brp = 0, brp = 0; - int tsegall, tseg = 0, tseg1 = 0, tseg2 = 0; - int spt_error = 1000, spt = 0, sampl_pt; - int64_t clock_freq = 0; - uint32_t sjw = 1UL; - - CAN_EnterInitMode(tCAN, 0U); - - clock_freq = (int64_t)CLK_GetPCLK0Freq(); - - if(u32BaudRate >= 1000000UL) - { - u32BaudRate = 1000000UL; - } - - /* Use CIA recommended sample points */ - if(u32BaudRate > 800000UL) - { - sampl_pt = 750; - } - else if(u32BaudRate > 500000UL) - { - sampl_pt = 800; - } - else - { - sampl_pt = 875; - } - - /* tseg even = round down, odd = round up */ - for(tseg = (TSEG1_MAX + TSEG2_MAX) * 2 + 1; tseg >= (TSEG1_MIN + TSEG2_MIN) * 2; tseg--) - { - tsegall = 1 + tseg / 2; - /* Compute all possible tseg choices (tseg=tseg1+tseg2) */ - - /* brp = (int32_t)(clock_freq / (tsegall * u32BaudRate)) + (tseg % 2); */ - brp = (int32_t)(clock_freq / ((int64_t)tsegall * (int32_t)u32BaudRate)) + (tseg % 2); - - - /* chose brp step which is possible in system */ - brp = (brp / BRP_INC) * BRP_INC; - - if((brp >= BRP_MIN) && (brp <= BRP_MAX)) - { - rate = (int32_t)(clock_freq / ((int64_t)brp * tsegall)); - - error = (int32_t)u32BaudRate - rate; - - /* tseg brp biterror */ - if(error < 0) - { - error = -error; - } - - if(error <= best_error) - { - best_error = error; - if(error == 0) - { - spt = can_update_spt(sampl_pt, tseg / 2, &tseg1, &tseg2); - error = sampl_pt - spt; - if(error < 0) - { - error = -error; - } - if(error <= spt_error) - { - spt_error = error; - best_tseg = tseg / 2; - best_brp = brp; - if(error == 0) - { - break; - } - } - } - else - { - best_tseg = tseg / 2; - best_brp = brp; - } - } - } - } - - spt = can_update_spt(sampl_pt, best_tseg, &tseg1, &tseg2); - - /* check for sjw user settings */ - /* bt->sjw is at least 1 -> sanitize upper bound to sjw_max */ - if(sjw > SJW_MAX) - { - sjw = SJW_MAX; - } - /* bt->sjw must not be higher than tseg2 */ - if(tseg2 < (int32_t)sjw) - { - sjw = (uint32_t)tseg2; - } - - /* real bit-rate */ - u32BaudRate = (uint32_t)(int32_t)(clock_freq / (int32_t)(best_brp * (tseg1 + tseg2 + 1))); - - tCAN->BTIME = (((uint32_t)tseg2 - 1UL) << CAN_BTIME_TSEG2_Pos) | (((uint32_t)tseg1 - 1UL) << CAN_BTIME_TSEG1_Pos) | - (((uint32_t)best_brp - 1UL) & CAN_BTIME_BRP_Msk) | (sjw << CAN_BTIME_SJW_Pos); - - - tCAN->BRPE = (((uint32_t)best_brp - 1UL) >> 6) & 0x0FUL; - - /* DEBUG_PRINTF("\n bitrate = %d \n", CAN_GetCANBitRate(tCAN)); */ - - CAN_LeaveInitMode(tCAN); - - return u32BaudRate; -} - -/** - * @brief The function is used to disable all CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * - * @return None - * - * @details No Status Change Interrupt and Error Status Interrupt will be generated. - */ - - -void CAN_Close(CAN_T *tCAN) -{ - CAN_DisableInt(tCAN, (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - - - -/** - * @brief Set CAN operation mode and target baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * @param[in] u32Mode The CAN operation mode. Valid values are: - * - \ref CAN_NORMAL_MODE Normal operation. - * - \ref CAN_BASIC_MODE Basic mode. - * @return u32CurrentBitRate Real baud-rate value. - * - * @details Set bus timing parameter according current clock and target baud-rate. - * In Basic mode, IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer. - */ -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode) -{ - uint32_t u32CurrentBitRate; - - u32CurrentBitRate = CAN_SetBaudRate(tCAN, u32BaudRate); - - if(u32Mode == CAN_BASIC_MODE) - { - CAN_EnterTestMode(tCAN, (uint8_t)CAN_TEST_BASIC_Msk); - } - - return u32CurrentBitRate; -} - -/** - * @brief The function is used to configure a transmit object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No useful interface. - * @retval TRUE Config message object success. - * - * @details The two sets of interface registers (IF1 and IF2) control the software access to the Message RAM. - * They buffer the data to be transferred to and from the RAM, avoiding conflicts between software accesses and message reception/transmission. - */ -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg) -{ - uint8_t u8MsgIfNum; - - if((u8MsgIfNum = (uint8_t)LockIF_TL(tCAN)) == 2U) - { - return (int32_t)FALSE; - } - - /* update the contents needed for transmission*/ - tCAN->IF[u8MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if(pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[u8MsgIfNum].ARB1 = 0UL; - tCAN->IF[u8MsgIfNum].ARB2 = (((pCanMsg->Id) & 0x7FFUL) << 2) | CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - else - { - /* extended ID*/ - tCAN->IF[u8MsgIfNum].ARB1 = (pCanMsg->Id) & 0xFFFFUL; - tCAN->IF[u8MsgIfNum].ARB2 = (((pCanMsg->Id) & 0x1FFF0000UL) >> 16) | CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_XTD_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - - if(pCanMsg->FrameType) - { - tCAN->IF[u8MsgIfNum].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[u8MsgIfNum].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - - tCAN->IF[u8MsgIfNum].DAT_A1 = ((uint32_t)pCanMsg->Data[1] << 8) | (uint32_t)pCanMsg->Data[0]; - tCAN->IF[u8MsgIfNum].DAT_A2 = ((uint32_t)pCanMsg->Data[3] << 8) | (uint32_t)pCanMsg->Data[2]; - tCAN->IF[u8MsgIfNum].DAT_B1 = ((uint32_t)pCanMsg->Data[5] << 8) | pCanMsg->Data[4]; - tCAN->IF[u8MsgIfNum].DAT_B2 = ((uint32_t)pCanMsg->Data[7] << 8) | pCanMsg->Data[6]; - - tCAN->IF[u8MsgIfNum].MCON = CAN_IF_MCON_NEWDAT_Msk | pCanMsg->DLC | CAN_IF_MCON_TXIE_Msk | CAN_IF_MCON_EOB_Msk; - tCAN->IF[u8MsgIfNum].CREQ = 1UL + u32MsgNum; - - ReleaseIF(tCAN, (uint32_t)u8MsgIfNum); - - return (int32_t)TRUE; -} - -/** - * @brief Set transmit request bit. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return TRUE: Start transmit message. - * - * @details If a transmission is requested by programming bit TxRqst/NewDat (IFn_CMASK[2]), the TxRqst (IFn_MCON[8]) will be ignored. - */ -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum) -{ - uint8_t u8MsgIfNum; - - if((u8MsgIfNum = (uint8_t)LockIF_TL(tCAN)) == 2U) - { - return (int32_t)FALSE; - } - - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u8MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk - | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - - tCAN->IF[u8MsgIfNum].CREQ = 1UL + u32MsgNum; - - while(tCAN->IF[u8MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - tCAN->IF[u8MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u8MsgIfNum].CREQ = 1UL + u32MsgNum; - - ReleaseIF(tCAN, (uint32_t)u8MsgIfNum); - - return (int32_t)TRUE; -} - -/** - * @brief Enable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. Valid values are: - * - \ref CAN_CON_IE_Msk Module interrupt enable. - * - \ref CAN_CON_SIE_Msk Status change interrupt enable. - * - \ref CAN_CON_EIE_Msk Error interrupt enable. - * - * @return None - * - * @details The application software has two possibilities to follow the source of a message interrupt. - * First, it can follow the IntId in the Interrupt Register and second it can poll the Interrupt Pending Register. - */ -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = (tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)) | - (u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - -/** - * @brief Disable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. (CAN_CON_IE_Msk / CAN_CON_SIE_Msk / CAN_CON_EIE_Msk). - * - * @return None - * - * @details The interrupt remains active until the Interrupt Register is back to value zero (the cause of the interrupt is reset) or until IE is reset. - */ -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = tCAN->CON & ~((u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk))); -} - - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID) -{ - uint32_t u32TimeOutCount = 0UL; - - while(CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)TRUE) == (int32_t)FALSE) - { - if(++u32TimeOutCount >= RETRY_COUNTS) - { - return (int32_t)FALSE; - } - } - - return (int32_t)TRUE; -} - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * @param[in] u32IDMask Specifies the identifier mask used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask) -{ - uint32_t u32TimeOutCount = 0UL; - - while(CAN_SetRxMsgObjAndMsk(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, u32IDMask, (uint8_t)TRUE) == (int32_t)FALSE) - { - if(++u32TimeOutCount >= RETRY_COUNTS) - { - return (int32_t)FALSE; - } - } - - return (int32_t)TRUE; -} - -/** - * @brief The function is used to configure several receive message objects. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum The starting MSG RAM number(0 ~ 31). - * @param[in] u32MsgCount the number of MSG RAM of the FIFO. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure receive message objects success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID) -{ - uint32_t i; - uint32_t u32TimeOutCount; - uint32_t u32EOB_Flag = 0UL; - - for(i = 1UL; i <= u32MsgCount; i++) - { - u32TimeOutCount = 0UL; - - u32MsgNum += (i - 1UL); - - if(i == u32MsgCount) - { - u32EOB_Flag = 1UL; - } - - while(CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)u32EOB_Flag) == (int32_t)FALSE) - { - if(++u32TimeOutCount >= RETRY_COUNTS) - { - return (int32_t)FALSE; - } - } - } - - return (int32_t)TRUE; -} - - -/** - * @brief Send CAN message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE 1. When operation in basic mode: Transmit message time out. \n - * 2. When operation in normal mode: No useful interface. \n - * @retval TRUE Transmit Message success. - * - * @details The receive/transmit priority for the Message Objects is attached to the message number. - * Message Object 1 has the highest priority, while Message Object 32 has the lowest priority. - */ -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg) -{ - uint32_t cond0, cond1; - - cond0 = tCAN->CON & CAN_CON_TEST_Msk; - cond1 = tCAN->TEST & CAN_TEST_BASIC_Msk; - if(cond0 && cond1) - { - return (CAN_BasicSendMsg(tCAN, pCanMsg)); - } - else - { - if(CAN_SetTxMsg(tCAN, u32MsgNum, pCanMsg) == (int32_t)FALSE) - { - return (int32_t)FALSE; - } - CAN_TriggerTxMsg(tCAN, u32MsgNum); - } - - return (int32_t)TRUE; -} - - -/** - * @brief Gets the message, if received. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No any message received. - * @retval TRUE Receive Message success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg) -{ - uint32_t cond0, cond1; - - cond0 = tCAN->CON & CAN_CON_TEST_Msk; - cond1 = tCAN->TEST & CAN_TEST_BASIC_Msk; - - if(cond0 && cond1) - { - return (CAN_BasicReceiveMsg(tCAN, pCanMsg)); - } - else - { - return CAN_ReadMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)TRUE, pCanMsg); - } -} - -/** - * @brief Clear interrupt pending bit. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return None - * - * @details An interrupt remains pending until the application software has cleared it. - */ -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum) -{ - uint32_t u32MsgIfNum; - - if((u32MsgIfNum = LockIF_TL(tCAN)) == 2UL) - { - u32MsgIfNum = 0UL; - } - - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1UL + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); -} - -/**@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CAN_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_clk.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_clk.c deleted file mode 100644 index 00129c15b9d..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_clk.c +++ /dev/null @@ -1,1406 +0,0 @@ -/**************************************************************************//** - * @file clk.c - * @version V3.00 - * @brief M2354 series Clock Controller (CLK) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - - -/** - * @brief Disable frequency output function - * @param None - * @return None - * @details This function disable frequency output function. - */ -void CLK_DisableCKO(void) -{ - /* Disable CKO clock source */ - CLK->APBCLK0 &= (~CLK_APBCLK0_CLKOCKEN_Msk); -} - - -/** - * @brief This function enable frequency divider module clock. - * enable frequency divider clock function and configure frequency divider. - * @param[in] u32ClkSrc is frequency divider function clock source. Including : - * - \ref CLK_CLKSEL1_CLKOSEL_HXT - * - \ref CLK_CLKSEL1_CLKOSEL_LXT - * - \ref CLK_CLKSEL1_CLKOSEL_HCLK - * - \ref CLK_CLKSEL1_CLKOSEL_HIRC - * @param[in] u32ClkDiv is divider output frequency selection. - * @param[in] u32ClkDivBy1En is frequency divided by one enable. - * @return None - * - * @details Output selected clock to CKO. The output clock frequency is divided by u32ClkDiv. - * The formula is: - * CKO frequency = (Clock source frequency) / 2^(u32ClkDiv + 1) - * This function is just used to set CKO clock. - * User must enable I/O for CKO clock output pin by themselves. - */ -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) -{ - /* CKO = clock source / 2^(u32ClkDiv + 1) */ - CLK->CLKOCTL = CLK_CLKOCTL_CLKOEN_Msk | u32ClkDiv | (u32ClkDivBy1En << CLK_CLKOCTL_DIV1EN_Pos); - - /* Enable CKO clock source */ - CLK->APBCLK0 |= CLK_APBCLK0_CLKOCKEN_Msk; - - /* Select CKO clock source */ - CLK->CLKSEL1 = (CLK->CLKSEL1 & (~CLK_CLKSEL1_CLKOSEL_Msk)) | (u32ClkSrc); - -} - -/** - * @brief Enter to Power-down mode - * @param None - * @return None - * @details This function is used to let system enter to Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_PowerDown(void) -{ - volatile uint32_t u32SysTickTICKINT = 0; /* Backup Systick interrupt enable bit */ - - /* Set the processor uses deep sleep as its low power mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* Set system Power-down enabled */ - CLK->PWRCTL |= CLK_PWRCTL_PDEN_Msk; - - /* Backup systick interrupt setting */ - u32SysTickTICKINT = SysTick->CTRL & SysTick_CTRL_TICKINT_Msk; - - /* Disable systick interrupt */ - SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; - - /* Chip enter Power-down mode after CPU run WFI instruction */ - __WFI(); - - /* Restore systick interrupt setting */ - if(u32SysTickTICKINT) SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; -} - - -/** - * @brief Enter to Idle mode - * @param None - * @return None - * @details This function let system enter to Idle mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_Idle(void) -{ - /* Set the processor uses sleep as its low power mode */ - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - - /* Set chip in idle mode because of WFI command */ - CLK->PWRCTL &= ~CLK_PWRCTL_PDEN_Msk; - - /* Chip enter idle mode after CPU run WFI instruction */ - __WFI(); -} - - -/** - * @brief Get external high speed crystal clock frequency - * @param None - * @return External high frequency crystal frequency - * @details This function get external high frequency crystal frequency. The frequency unit is Hz. - */ -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetHXTFreq(void) -{ - uint32_t u32Freq = 0UL; - uint32_t u32HXTEN = CLK->PWRCTL & CLK_PWRCTL_HXTEN_Msk; - - if(u32HXTEN) - { - u32Freq = __HXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - -/** - * @brief Get external low speed crystal clock frequency - * @param None - * @return External low speed crystal clock frequency - * @details This function get external low frequency crystal frequency. The frequency unit is Hz. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetLXTFreq(void) -{ - uint32_t u32Freq = 0UL; - uint32_t u32LXTEN = CLK->PWRCTL & CLK_PWRCTL_LXTEN_Msk; - - if(u32LXTEN) - { - u32Freq = __LXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - -/** - * @brief Get HCLK frequency - * @param None - * @return HCLK frequency - * @details This function get HCLK frequency. The frequency unit is Hz. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetHCLKFreq(void) -{ - SystemCoreClockUpdate(); - return SystemCoreClock; -} - -/** - * @brief Get PCLK0 frequency - * @param None - * @return PCLK0 frequency - * @details This function get PCLK0 frequency. The frequency unit is Hz. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetPCLK0Freq(void) -{ - SystemCoreClockUpdate(); - return (SystemCoreClock); -} - -/** - * @brief Get PCLK1 frequency - * @param None - * @return PCLK1 frequency - * @details This function get PCLK1 frequency. The frequency unit is Hz. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetPCLK1Freq(void) -{ - SystemCoreClockUpdate(); - return (SystemCoreClock); -} - -/** - * @brief Get CPU frequency - * @param None - * @return CPU frequency - * @details This function get CPU frequency. The frequency unit is Hz. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetCPUFreq(void) -{ - uint32_t u32Freq, u32HclkSrc, u32HclkDiv; - uint32_t au32ClkTbl[] = {__HXT, __LXT, 0UL, __LIRC, 0UL, __HIRC48, __MIRC, __HIRC}; - uint32_t u32PllReg, u32FIN, u32NF, u32NR, u32NO; - uint8_t au8NoTbl[4] = {1U, 2U, 2U, 4U}; - uint32_t u32RTCCKEN = CLK->APBCLK0 & CLK_APBCLK0_RTCCKEN_Msk; - - /* Update PLL Clock */ - u32PllReg = CLK->PLLCTL; - - if(u32PllReg & CLK_PLLCTL_PD_Msk) - { - PllClock = 0UL; /* PLL is in power down mode */ - } - else /* PLL is in normal mode */ - { - - /* PLL source clock */ - if(u32PllReg & CLK_PLLCTL_PLLSRC_Msk) - { - u32FIN = __HIRC; /* PLL source clock from HIRC */ - } - else - { - u32FIN = __HXT; /* PLL source clock from HXT */ - } - - /* Calculate PLL frequency */ - if(u32PllReg & CLK_PLLCTL_BP_Msk) - { - PllClock = u32FIN; /* PLL is in bypass mode */ - } - else - { - /* PLL is output enabled in normal work mode */ - u32NO = au8NoTbl[((u32PllReg & CLK_PLLCTL_OUTDIV_Msk) >> CLK_PLLCTL_OUTDIV_Pos)]; - u32NF = ((u32PllReg & CLK_PLLCTL_FBDIV_Msk) >> CLK_PLLCTL_FBDIV_Pos) + 2UL; - u32NR = ((u32PllReg & CLK_PLLCTL_INDIV_Msk) >> CLK_PLLCTL_INDIV_Pos) + 1UL; - - /* u32FIN is shifted 2 bits to avoid overflow */ - PllClock = (((u32FIN >> 2) * (u32NF << 1)) / (u32NR * u32NO) << 2); - } - } - - /* HCLK clock source */ - u32HclkSrc = CLK->CLKSEL0 & CLK_CLKSEL0_HCLKSEL_Msk; - - if(u32HclkSrc == CLK_CLKSEL0_HCLKSEL_LXT) - { - - if(u32RTCCKEN == 0UL) - { - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; /* Enable RTC clock to get LXT clock source */ - } - - if(RTC->LXTCTL & RTC_LXTCTL_C32KSEL_Msk) - { - u32Freq = __LIRC32; /* LXT clock source is LIRC32 */ - } - else - { - u32Freq = __LXT; /* LXT clock source is external LXT */ - } - - if(u32RTCCKEN == 0UL) - { - CLK->APBCLK0 &= (~CLK_APBCLK0_RTCCKEN_Msk); /* Disable RTC clock if it is disabled before */ - } - - } - else if(u32HclkSrc == CLK_CLKSEL0_HCLKSEL_PLL) - { - u32Freq = PllClock;/* Use PLL clock */ - } - else - { - u32Freq = au32ClkTbl[u32HclkSrc]; /* Use the clock sources directly */ - } - - /* HCLK clock source divider */ - u32HclkDiv = (CLK->CLKDIV0 & CLK_CLKDIV0_HCLKDIV_Msk) + 1UL; - - /* Update System Core Clock */ - SystemCoreClock = u32Freq / u32HclkDiv; - - /* Update Cycles per micro second */ - CyclesPerUs = (SystemCoreClock + 500000UL) / 1000000UL; - - return SystemCoreClock; -} - -/** - * @brief Set HCLK frequency - * @param[in] u32Hclk is HCLK frequency. - * The range of u32Hclk is 24 MHz ~ 96 MHz. - * @return HCLK frequency - * @details This function is used to set HCLK frequency by using PLL. \n - * Power level is also set according to HCLK frequency. The frequency unit is Hz. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_SetCoreClock(uint32_t u32Hclk) -{ - uint32_t u32HIRCSTB; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* Check HCLK frequency range */ - if(u32Hclk > FREQ_96MHZ) - { - u32Hclk = FREQ_96MHZ; - } - else if(u32Hclk < FREQ_24MHZ) - { - u32Hclk = FREQ_24MHZ; - } - - /* Switch HCLK clock source to HIRC clock for safe */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_Msk; - CLK->CLKDIV0 &= (~CLK_CLKDIV0_HCLKDIV_Msk); - - /* Configure PLL setting if HXT clock is stable */ - if(CLK->STATUS & CLK_STATUS_HXTSTB_Msk) - { - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HXT, u32Hclk); - } - /* Configure PLL setting if HXT clock is not stable */ - else - { - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HIRC, u32Hclk); - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - } - - /* Select HCLK clock source to PLL, - select HCLK clock source divider as 1, - adjust power level and update system core clock - */ - CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_PLL, CLK_CLKDIV0_HCLK(1UL)); - - /* Disable HIRC if HIRC is disabled before setting core clock */ - if(u32HIRCSTB == 0UL) - { - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; - } - - /* Return actually HCLK frequency is PLL frequency divide 1 */ - return u32Hclk; -} - - -/** - * @brief Set HCLK clock source and HCLK clock divider - * @param[in] u32ClkSrc is HCLK clock source. Including : - * - \ref CLK_CLKSEL0_HCLKSEL_HXT - * - \ref CLK_CLKSEL0_HCLKSEL_LXT - * - \ref CLK_CLKSEL0_HCLKSEL_PLL - * - \ref CLK_CLKSEL0_HCLKSEL_LIRC - * - \ref CLK_CLKSEL0_HCLKSEL_HIRC48 - * - \ref CLK_CLKSEL0_HCLKSEL_MIRC - * - \ref CLK_CLKSEL0_HCLKSEL_HIRC - * @param[in] u32ClkDiv is HCLK clock divider. Including : - * - \ref CLK_CLKDIV0_HCLK(x) - * @return None - * @details This function set HCLK clock source and HCLK clock divider. \n - * Power level and flash access cycle are also set according to HCLK operation frequency. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32HIRCSTB; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* Switch to HIRC for safe. Avoid HCLK too high when applying new divider. */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_Msk; - - /* Switch to power level 0 for safe */ - while(SYS->PLCTL & SYS_PLCTL_WRBUSY_Msk); - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | SYS_PLCTL_PLSEL_PL0; - while(SYS->PLSTS & SYS_PLSTS_PLCBUSY_Msk); - - /* Set Flash Access Cycle to 4 for safe */ - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (4); - - /* Apply new Divider */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & (~CLK_CLKDIV0_HCLKDIV_Msk)) | u32ClkDiv; - - /* Switch HCLK to new HCLK source */ - CLK->CLKSEL0 = (CLK->CLKSEL0 & (~CLK_CLKSEL0_HCLKSEL_Msk)) | u32ClkSrc; - - /* Update System Core Clock */ - SystemCoreClockUpdate(); - - /* Set power level according to new HCLK source */ - while(SYS->PLCTL & SYS_PLCTL_WRBUSY_Msk); - if((SystemCoreClock > FREQ_48MHZ) && SystemCoreClock <= FREQ_84MHZ) - { - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | SYS_PLCTL_PLSEL_PL1; - } - else if((SystemCoreClock > FREQ_4MHZ) && SystemCoreClock <= FREQ_48MHZ) - { - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | SYS_PLCTL_PLSEL_PL2; - } - if(SystemCoreClock <= FREQ_4MHZ) - { - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | SYS_PLCTL_PLSEL_PL3; - } - while(SYS->PLSTS & SYS_PLSTS_PLCBUSY_Msk); - - /* Set Flash Access Cycle */ - if((SystemCoreClock >= FREQ_50MHZ) && SystemCoreClock < FREQ_75MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (3); - } - else if((SystemCoreClock >= FREQ_25MHZ) && SystemCoreClock < FREQ_50MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (2); - } - if(SystemCoreClock < FREQ_25MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (1); - } - - /* Disable HIRC if HIRC is disabled before switching HCLK source */ - if(u32HIRCSTB == 0UL) - { - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; - } -} -/** - * @brief This function set selected module clock source and module clock divider - * @param[in] u32ModuleIdx is module index. - * @param[in] u32ClkSrc is module clock source. - * @param[in] u32ClkDiv is module clock divider. - * @return None - * @details Valid parameter combinations listed in following table: - * - * |Module index |Clock source |Divider | - * | :---------------- | :------------------------------------ | :----------------------- | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HXT |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_PLL |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HCLK |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HIRC |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LXT | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_HCLK_DIV2048 | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LIRC | x | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_HCLK_DIV2048 | x | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_LIRC | x | - * |\ref LCD_MODULE |\ref CLK_CLKSEL1_LCDSEL_LIRC | x | - * |\ref LCD_MODULE |\ref CLK_CLKSEL1_LCDSEL_LXT | x | - * |\ref LCDCP_MODULE |\ref CLK_CLKSEL1_LCDCPSEL_MIRC1P2M | x | - * |\ref LCDCP_MODULE |\ref CLK_CLKSEL1_LCDCPSEL_MIRC | x | - * |\ref EWDT_MODULE |\ref CLK_CLKSEL1_EWDTSEL_LXT | x | - * |\ref EWDT_MODULE |\ref CLK_CLKSEL1_EWDTSEL_HCLK_DIV2048 | x | - * |\ref EWDT_MODULE |\ref CLK_CLKSEL1_EWDTSEL_LIRC | x | - * |\ref EWWDT_MODULE |\ref CLK_CLKSEL1_EWWDTSEL_HCLK_DIV2048 | x | - * |\ref EWWDT_MODULE |\ref CLK_CLKSEL1_EWWDTSEL_LIRC | x | - * |\ref EADC_MODULE | x |\ref CLK_CLKDIV0_EADC(x) | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_PCLK0 | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_EXT_TRG | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LIRC | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_PCLK0 | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_EXT_TRG | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_PCLK1 | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_EXT_TRG | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_PCLK1 | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_EXT_TRG | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HIRC | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL3_TMR4SEL_HXT | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL3_TMR4SEL_LXT | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL3_TMR4SEL_PCLK0 | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL3_TMR4SEL_EXT_TRG | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL3_TMR4SEL_MIRC | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL3_TMR4SEL_LIRC | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL3_TMR4SEL_HIRC | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL3_TMR5SEL_HXT | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL3_TMR5SEL_LXT | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL3_TMR5SEL_PCLK0 | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL3_TMR5SEL_EXT_TRG | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL3_TMR5SEL_MIRC | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL3_TMR5SEL_LIRC | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL3_TMR5SEL_HIRC | x | - * |\ref UART0_MODULE |\ref CLK_CLKSEL2_UART0SEL_HXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL2_UART0SEL_PLL |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL2_UART0SEL_LXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL2_UART0SEL_HIRC |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL2_UART0SEL_PCLK0 |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL2_UART1SEL_HXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL2_UART1SEL_PLL |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL2_UART1SEL_LXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL2_UART1SEL_HIRC |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL2_UART1SEL_PCLK1 |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL2_UART2SEL_HXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL2_UART2SEL_PLL |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL2_UART2SEL_LXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL2_UART2SEL_HIRC |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL2_UART2SEL_PCLK0 |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL2_UART3SEL_HXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL2_UART3SEL_PLL |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL2_UART3SEL_LXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL2_UART3SEL_HIRC |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL2_UART3SEL_PCLK1 |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_PLL |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_LXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HIRC |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_PCLK0 |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_PLL |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_LXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HIRC |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_PCLK1 |\ref CLK_CLKDIV4_UART5(x) | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_LXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HCLK | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HIRC | x | - * |\ref RTC_MODULE |\ref RTC_LXTCTL_RTCCKSEL_LXT | x | - * |\ref RTC_MODULE |\ref RTC_LXTCTL_RTCCKSEL_LIRC | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_HXT | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_PLL | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_PCLK0 | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_HIRC | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HXT | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PLL | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PCLK0 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HIRC | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HXT | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PLL | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PCLK1 | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HIRC | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_HXT | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_PLL | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_PCLK0 | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_HIRC | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_HXT | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_PLL | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_PCLK1 | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_HIRC | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_HXT | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_PLL | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_PCLK0 | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_HIRC | x | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_HXT |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_PLL |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_PCLK0 |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_HIRC |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_HXT |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_PLL |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_PCLK1 |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_HIRC |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_HXT |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_PLL |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_PCLK0 |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_HIRC |\ref CLK_CLKDIV1_SC2(x) | - * |\ref USBH_MODULE |\ref CLK_CLKSEL0_USBSEL_HIRC48 |\ref CLK_CLKDIV0_USB(x) | - * |\ref USBH_MODULE |\ref CLK_CLKSEL0_USBSEL_PLL |\ref CLK_CLKDIV0_USB(x) | - * |\ref OTG_MODULE |\ref CLK_CLKSEL0_USBSEL_HIRC48 |\ref CLK_CLKDIV0_USB(x) | - * |\ref OTG_MODULE |\ref CLK_CLKSEL0_USBSEL_PLL |\ref CLK_CLKDIV0_USB(x) | - * |\ref USBD_MODULE |\ref CLK_CLKSEL0_USBSEL_HIRC48 |\ref CLK_CLKDIV0_USB(x) | - * |\ref USBD_MODULE |\ref CLK_CLKSEL0_USBSEL_PLL |\ref CLK_CLKDIV0_USB(x) | - */ -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32Sel = 0UL, u32Div = 0UL; - uint32_t au32SelTbl[4] = {0x0UL, 0x4UL, 0x8UL, 0xCUL}; - uint32_t au32DivTbl[4] = {0x0UL, 0x4UL, 0x8UL, 0x10UL}; - uint32_t u32RTCCKEN = CLK->APBCLK0 & CLK_APBCLK0_RTCCKEN_Msk; - - if(u32ModuleIdx == RTC_MODULE) /* RTC clock source configuration */ - { - if(u32RTCCKEN == 0UL) - { - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; /* Enable RTC clock to get LXT clock source */ - } - - /* Select RTC clock source */ - RTC->LXTCTL = (RTC->LXTCTL & (~RTC_LXTCTL_RTCCKSEL_Msk)) | (u32ClkSrc); - - if(u32RTCCKEN == 0UL) - { - CLK->APBCLK0 &= (~CLK_APBCLK0_RTCCKEN_Msk); /* Disable RTC clock if it is disabled before */ - } - - } - else /* Others clock source configuration */ - { - if(MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock divider control register address */ - u32Div = (uint32_t)&CLK->CLKDIV0 + (au32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); - /* Apply new divider */ - M32(u32Div) = (M32(u32Div) & (~(MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx)))) | u32ClkDiv; - } - - if(MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32Sel = (uint32_t)&CLK->CLKSEL0 + (au32SelTbl[MODULE_CLKSEL(u32ModuleIdx)]); - /* Set new clock selection setting */ - M32(u32Sel) = (M32(u32Sel) & (~(MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx)))) | u32ClkSrc; - } - } -} - -/** - * @brief Set SysTick clock source - * @param[in] u32ClkSrc is module clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * @return None - * @details This function set SysTick clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc) -{ - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; -} - -/** - * @brief Enable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * - \ref CLK_PWRCTL_HIRC48EN_Msk - * - \ref CLK_PWRCTL_MIRC1P2MEN_Msk - * - \ref CLK_PWRCTL_MIRCEN_Msk - * @return None - * @details This function enable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL |= u32ClkMask; -} - -/** - * @brief Disable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * - \ref CLK_PWRCTL_HIRC48EN_Msk - * - \ref CLK_PWRCTL_MIRC1P2MEN_Msk - * - \ref CLK_PWRCTL_MIRCEN_Msk - * @return None - * @details This function disable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL &= ~u32ClkMask; -} - -/** - * @brief Enable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref SDH0_MODULE - * - \ref CRC_MODULE - * - \ref CRPT_MODULE - * - \ref KS_MODULE - * - \ref TRACE_MODULE - * - \ref USBH_MODULE - * - \ref SRAM0_MODULE - * - \ref SRAM1_MODULE - * - \ref SRAM2_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref EWDT_MODULE - * - \ref EWWDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref TMR4_MODULE - * - \ref TMR5_MODULE - * - \ref CLKO_MODULE - * - \ref ACMP01_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref QSPI0_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref TAMPER_MODULE - * - \ref CAN0_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref EADC_MODULE - * - \ref I2S0_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref USCI0_MODULE - * - \ref USCI1_MODULE - * - \ref DAC_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref QEI0_MODULE - * - \ref LCD_MODULE - * - \ref LCDCP_MODULE - * - \ref TRNG_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * @return None - * @details This function is used to enable module clock. - */ -void CLK_EnableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - - u32TmpVal = (1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32TmpAddr = (uint32_t)&CLK->AHBCLK; - u32TmpAddr += ((MODULE_APBCLK(u32ModuleIdx) * 4UL)); - - *(volatile uint32_t *)u32TmpAddr |= u32TmpVal; -} - -/** - * @brief Disable module clock - * @param[in] u32ModuleIdx is module index - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref SDH0_MODULE - * - \ref CRC_MODULE - * - \ref CRPT_MODULE - * - \ref KS_MODULE - * - \ref TRACE_MODULE - * - \ref USBH_MODULE - * - \ref SRAM0_MODULE - * - \ref SRAM1_MODULE - * - \ref SRAM2_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref EWDT_MODULE - * - \ref EWWDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref TMR4_MODULE - * - \ref TMR5_MODULE - * - \ref CLKO_MODULE - * - \ref ACMP01_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref QSPI0_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref TAMPER_MODULE - * - \ref CAN0_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref EADC_MODULE - * - \ref I2S0_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref USCI0_MODULE - * - \ref USCI1_MODULE - * - \ref DAC_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref QEI0_MODULE - * - \ref LCD_MODULE - * - \ref LCDCP_MODULE - * - \ref TRNG_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * @return None - * @details This function is used to disable module clock. - */ -void CLK_DisableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - - u32TmpVal = ~(1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32TmpAddr = (uint32_t)&CLK->AHBCLK; - u32TmpAddr += ((MODULE_APBCLK(u32ModuleIdx) * 4UL)); - - *(uint32_t *)u32TmpAddr &= u32TmpVal; -} - - -/** - * @brief Set PLL frequency - * @param[in] u32PllClkSrc is PLL clock source. Including : - * - \ref CLK_PLLCTL_PLLSRC_HXT - * - \ref CLK_PLLCTL_PLLSRC_HIRC - * @param[in] u32PllFreq is PLL frequency. The range of u32PllFreq is 24 MHz ~ 200 MHz. - * @return PLL frequency - * @details This function is used to configure PLLCTL register to set specified PLL frequency. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq) -{ - uint32_t u32PllSrcClk, u32NR, u32NF, u32NO, u32PllClk; - uint32_t u32Tmp, u32Tmp2, u32Tmp3, u32Min, u32MinNF, u32MinNR; - - /* Disable PLL first to avoid unstable when setting PLL */ - CLK->PLLCTL |= CLK_PLLCTL_PD_Msk; - - /* PLL source clock is from HXT */ - if(u32PllClkSrc == CLK_PLLCTL_PLLSRC_HXT) - { - /* Enable HXT clock */ - CLK->PWRCTL |= CLK_PWRCTL_HXTEN_Msk; - - /* Wait for HXT clock ready */ - CLK_WaitClockReady(CLK_STATUS_HXTSTB_Msk); - - /* Select PLL source clock from HXT */ - u32PllSrcClk = __HXT; - } - - /* PLL source clock is from HIRC */ - else - { - /* Enable HIRC clock */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - - /* Wait for HIRC clock ready */ - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - - /* Select PLL source clock from HIRC */ - u32PllSrcClk = __HIRC; - } - - /* Check PLL frequency range */ - /* Constraint 1: 24MHz < FOUT < 200MHz */ - if((u32PllFreq <= FREQ_200MHZ) && (u32PllFreq >= FREQ_24MHZ)) - { - - /* Select "NO" according to request frequency */ - if((u32PllFreq < FREQ_48MHZ) && (u32PllFreq >= FREQ_24MHZ)) - { - u32NO = 3UL; - u32PllFreq = u32PllFreq << 2; - } - else if((u32PllFreq < FREQ_96MHZ) && (u32PllFreq >= FREQ_48MHZ)) - { - u32NO = 1UL; - u32PllFreq = u32PllFreq << 1; - } - else - { - u32NO = 0UL; - } - - /* u32NR start from 3 to avoid calculation overflow */ - u32NR = 3UL; - - /* Find best solution */ - u32Min = (uint32_t) - 1; /* initial u32Min to max value of uint32_t (0xFFFFFFFF) */ - u32MinNR = 0UL; - u32MinNF = 0UL; - - for(; u32NR <= 32UL; u32NR++) /* max NR = 32 since NR = INDIV+1 and INDIV = 0~31 */ - { - u32Tmp = u32PllSrcClk / u32NR; /* FREF = FIN/NR */ - if((u32Tmp >= FREQ_2MHZ) && (u32Tmp <= FREQ_8MHZ)) /* Constraint 2: 2MHz < FREF < 8MHz. */ - { - for(u32NF = 2UL; u32NF <= 513UL; u32NF++) /* NF = 2~513 since NF = FBDIV+2 and FBDIV = 0~511 */ - { - u32Tmp2 = (u32Tmp * u32NF) << 1; /* FVCO = FREF*2*NF */ - if((u32Tmp2 >= FREQ_96MHZ) && (u32Tmp2 <= FREQ_200MHZ)) /* Constraint 3: 96MHz < FVCO < 200MHz */ - { - u32Tmp3 = (u32Tmp2 > u32PllFreq) ? u32Tmp2 - u32PllFreq : u32PllFreq - u32Tmp2; - if(u32Tmp3 < u32Min) - { - u32Min = u32Tmp3; - u32MinNR = u32NR; - u32MinNF = u32NF; - - /* Break when get good results */ - if(u32Min == 0UL) - { - break; - } - } - } - } - } - } - - /* Enable and apply new PLL setting. */ - CLK->PLLCTL = u32PllClkSrc | - (u32NO << CLK_PLLCTL_OUTDIV_Pos) | - ((u32MinNR - 1UL) << CLK_PLLCTL_INDIV_Pos) | - ((u32MinNF - 2UL) << CLK_PLLCTL_FBDIV_Pos); - - /* Actual PLL output clock frequency. FOUT = (FIN/NR)*2*NF*(1/NO) */ - u32PllClk = u32PllSrcClk / ((u32NO + 1UL) * u32MinNR) * (u32MinNF << 1); - - } - else - { - /* Apply default PLL setting and return */ - CLK->PLLCTL = u32PllClkSrc | CLK_PLLCTL_48MHz_HXT; - - /* Actual PLL output clock frequency */ - u32PllClk = FREQ_48MHZ; - } - - /* Wait for PLL clock stable */ - CLK_WaitClockReady(CLK_STATUS_PLLSTB_Msk); - - /* Return actual PLL output clock frequency */ - return u32PllClk; -} - -/** - * @brief Disable PLL - * @param None - * @return None - * @details This function set PLL in Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisablePLL(void) -{ - CLK->PLLCTL |= CLK_PLLCTL_PD_Msk; -} - -/** - * @brief This function check selected clock source status - * @param[in] u32ClkMask is selected clock source. Including : - * - \ref CLK_STATUS_HXTSTB_Msk - * - \ref CLK_STATUS_LXTSTB_Msk - * - \ref CLK_STATUS_HIRCSTB_Msk - * - \ref CLK_STATUS_LIRCSTB_Msk - * - \ref CLK_STATUS_PLLSTB_Msk - * - \ref CLK_STATUS_HIRC48STB_Msk - * - \ref CLK_STATUS_EXTLXTSTB_Msk - * - \ref CLK_STATUS_LIRC32STB_Msk - * - \ref CLK_STATUS_MIRCSTB_Msk - * @retval 0 clock is not stable - * @retval 1 clock is stable - * @details To wait for clock ready by specified clock source stable flag or timeout (~500ms) - */ -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask) -{ - int32_t i32TimeOutCnt = 2400000; - uint32_t u32Ret = 1U; - - while((CLK->STATUS & u32ClkMask) != u32ClkMask) - { - if(i32TimeOutCnt-- <= 0) - { - u32Ret = 0U; - break; - } - } - return u32Ret; -} - -/** - * @brief Enable System Tick counter - * @param[in] u32ClkSrc is System Tick clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK - * @param[in] u32Count is System Tick reload value. It could be 0~0xFFFFFF. - * @return None - * @details This function set System Tick clock source, reload value, enable System Tick counter and interrupt. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; - - /* Set System Tick clock source */ - if(u32ClkSrc == CLK_CLKSEL0_STCLKSEL_HCLK) - { - SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk; - } - else - { - CLK->AHBCLK |= CLK_AHBCLK_EXSTCKEN_Msk; - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; - } - - /* Set System Tick reload value */ - SysTick->LOAD = u32Count; - - /* Clear System Tick current value and counter flag */ - SysTick->VAL = 0UL; - - /* Set System Tick interrupt enabled and counter enabled */ - SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk; -} - -/** - * @brief Disable System Tick counter - * @param None - * @return None - * @details This function disable System Tick counter. - */ -void CLK_DisableSysTick(void) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; -} - -/** - * @brief Power-down mode selected - * @param[in] u32PDMode is power down mode index. Including : - * - \ref CLK_PMUCTL_PDMSEL_PD - * - \ref CLK_PMUCTL_PDMSEL_LLPD - * - \ref CLK_PMUCTL_PDMSEL_FWPD - * - \ref CLK_PMUCTL_PDMSEL_ULLPD - * - \ref CLK_PMUCTL_PDMSEL_SPD - * - \ref CLK_PMUCTL_PDMSEL_DPD - * @return None - * @details This function is used to set power-down mode. - */ -void CLK_SetPowerDownMode(uint32_t u32PDMode) -{ - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); - CLK->PMUCTL = (CLK->PMUCTL & (~CLK_PMUCTL_PDMSEL_Msk)) | (u32PDMode); -} - -/** - * @brief Set Wake-up pin trigger type at Deep Power down mode - * @param[in] u32TriggerType Wake-up pin trigger type - * - \ref CLK_DPDWKPIN_RISING - * - \ref CLK_DPDWKPIN_FALLING - * - \ref CLK_DPDWKPIN_BOTHEDGE - * - \ref CLK_DPDWKPIN1_RISING - * - \ref CLK_DPDWKPIN1_FALLING - * - \ref CLK_DPDWKPIN1_BOTHEDGE - * - \ref CLK_DPDWKPIN2_RISING - * - \ref CLK_DPDWKPIN2_FALLING - * - \ref CLK_DPDWKPIN2_BOTHEDGE - * - \ref CLK_DPDWKPIN3_RISING - * - \ref CLK_DPDWKPIN3_FALLING - * - \ref CLK_DPDWKPIN3_BOTHEDGE - * - \ref CLK_DPDWKPIN4_RISING - * - \ref CLK_DPDWKPIN4_FALLING - * - \ref CLK_DPDWKPIN4_BOTHEDGE - * @return None - * @details This function is used to enable Wake-up pin trigger type. - */ - -void CLK_EnableDPDWKPin(uint32_t u32TriggerType) -{ - uint32_t u32Pin1, u32Pin2, u32Pin3, u32Pin4; - - u32Pin1 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN1_Pos); - u32Pin2 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN2_Pos); - u32Pin3 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN3_Pos); - u32Pin4 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN4_Pos); - - while(CLK->PMUCTL & CLK_PMUCTL_WRBUSY_Msk); - - if(u32Pin1) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN1_Msk)) | u32TriggerType; - } - else if(u32Pin2) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN2_Msk)) | u32TriggerType; - } - else if(u32Pin3) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN3_Msk)) | u32TriggerType; - } - else if(u32Pin4) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN4_Msk)) | u32TriggerType; - } - else - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN_Msk)) | u32TriggerType; - } -} - -/** - * @brief Get power manager wake up source - * @param[in] None - * @return None - * @details This function get power manager wake up source. - */ - -uint32_t CLK_GetPMUWKSrc(void) -{ - return (CLK->PMUSTS); -} - -/** - * @brief Set specified GPIO as wake up source at Standby Power-down mode - * @param[in] u32Port GPIO port. It could be 0~3. - * @param[in] u32Pin The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32TriggerType Wake-up pin trigger type - * - \ref CLK_SPDWKPIN_RISING - * - \ref CLK_SPDWKPIN_FALLING - * @param[in] u32DebounceEn Standby Power-down mode wake-up pin de-bounce function - * - \ref CLK_SPDWKPIN_DEBOUNCEEN - * - \ref CLK_SPDWKPIN_DEBOUNCEDIS - * @return None - * @details This function is used to set specified GPIO as wake up source at Standby Power-down mode. - */ - -void CLK_EnableSPDWKPin(uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerType, uint32_t u32DebounceEn) -{ - uint32_t u32TmpAddr = 0UL; - uint32_t u32TmpVal = 0UL; - - /* GPx Stand-by Power-down Wake-up Pin Select */ - u32TmpAddr = (uint32_t)&CLK->PASWKCTL; - u32TmpAddr += (0x4UL * u32Port); - - u32TmpVal = inpw((uint32_t *)u32TmpAddr); - u32TmpVal = (u32TmpVal & ~(CLK_PASWKCTL_WKPSEL_Msk | CLK_PASWKCTL_PRWKEN_Msk | CLK_PASWKCTL_PFWKEN_Msk | CLK_PASWKCTL_DBEN_Msk | CLK_PASWKCTL_WKEN_Msk)) | - (u32Pin << CLK_PASWKCTL_WKPSEL_Pos) | u32TriggerType | u32DebounceEn | CLK_SPDWKPIN_ENABLE; - outpw((uint32_t *)u32TmpAddr, u32TmpVal); -} - -/** - * @brief Get PLL clock frequency - * @param None - * @return PLL frequency - * @details This function get PLL frequency. The frequency unit is Hz. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetPLLClockFreq(void) -{ - uint32_t u32PllFreq = 0UL, u32PllReg; - uint32_t u32FIN, u32NF, u32NR, u32NO; - uint8_t au8NoTbl[4] = {1U, 2U, 2U, 4U}; - - u32PllReg = CLK->PLLCTL; - - if(u32PllReg & CLK_PLLCTL_PD_Msk) - { - u32PllFreq = 0UL; /* PLL is in power down mode or fix low */ - } - else /* PLL is in normal mode */ - { - /* PLL source clock */ - if(u32PllReg & CLK_PLLCTL_PLLSRC_Msk) - { - u32FIN = __HIRC; /* PLL source clock from HIRC */ - } - else - { - u32FIN = __HXT; /* PLL source clock from HXT */ - } - - /* Calculate PLL frequency */ - if(u32PllReg & CLK_PLLCTL_BP_Msk) - { - u32PllFreq = u32FIN; /* PLL is in bypass mode */ - } - else - { - /* PLL is output enabled in normal work mode */ - u32NO = au8NoTbl[((u32PllReg & CLK_PLLCTL_OUTDIV_Msk) >> CLK_PLLCTL_OUTDIV_Pos)]; - u32NF = ((u32PllReg & CLK_PLLCTL_FBDIV_Msk) >> CLK_PLLCTL_FBDIV_Pos) + 2UL; - u32NR = ((u32PllReg & CLK_PLLCTL_INDIV_Msk) >> CLK_PLLCTL_INDIV_Pos) + 1UL; - - /* u32FIN is shifted 2 bits to avoid overflow */ - u32PllFreq = (((u32FIN >> 2) * (u32NF << 1)) / (u32NR * u32NO) << 2); - } - } - - return u32PllFreq; -} - -/** - * @brief Get selected module clock source - * @param[in] u32ModuleIdx is module index. - * - \ref SDH0_MODULE - * - \ref USBH_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref EWDT_MODULE - * - \ref EWWDT_MODULE - * - \ref LCD_MODULE - * - \ref LCDCP_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref TMR4_MODULE - * - \ref TMR5_MODULE - * - \ref CLKO_MODULE - * - \ref QSPI0_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref I2S0_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * @return Selected module clock source setting - * @details This function get selected module clock source. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - uint32_t au32SelTbl[4] = {0x0UL, 0x4UL, 0x8UL, 0xCUL}; - uint32_t u32RTCCKEN = CLK->APBCLK0 & CLK_APBCLK0_RTCCKEN_Msk; - - /* Get clock source selection setting */ - if(u32ModuleIdx == RTC_MODULE) - { - if(u32RTCCKEN == 0UL) - { - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; /* Enable RTC clock to get LXT clock source */ - } - - u32TmpVal = ((RTC->LXTCTL & RTC_LXTCTL_RTCCKSEL_Msk) >> RTC_LXTCTL_RTCCKSEL_Pos); - - if(u32RTCCKEN == 0UL) - { - CLK->APBCLK0 &= (~CLK_APBCLK0_RTCCKEN_Msk); /* Disable RTC clock if it is disabled before */ - } - - } - else if(u32ModuleIdx == EPWM0_MODULE) - { - u32TmpVal = ((CLK->CLKSEL2 & CLK_CLKSEL2_EPWM0SEL_Msk) >> CLK_CLKSEL2_EPWM0SEL_Pos); - } - else if(u32ModuleIdx == EPWM1_MODULE) - { - u32TmpVal = ((CLK->CLKSEL2 & CLK_CLKSEL2_EPWM1SEL_Msk) >> CLK_CLKSEL2_EPWM1SEL_Pos); - } - else if(u32ModuleIdx == BPWM0_MODULE) - { - u32TmpVal = ((CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk) >> CLK_CLKSEL2_BPWM0SEL_Pos); - } - else if(u32ModuleIdx == BPWM1_MODULE) - { - u32TmpVal = ((CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk) >> CLK_CLKSEL2_BPWM1SEL_Pos); - } - else if(MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32TmpAddr = (uint32_t)&CLK->CLKSEL0 + (au32SelTbl[MODULE_CLKSEL(u32ModuleIdx)]); - - /* Get clock source selection setting */ - u32TmpVal = ((inpw((uint32_t *)u32TmpAddr) & (MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx))) >> MODULE_CLKSEL_Pos(u32ModuleIdx)); - } - - return u32TmpVal; -} - -/** - * @brief Get selected module clock divider number - * @param[in] u32ModuleIdx is module index. - * - \ref SDH0_MODULE - * - \ref USBH_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref EADC_MODULE - * @return Selected module clock divider number setting - * @details This function get selected module clock divider number. - */ - -__NONSECURE_ENTRY_WEAK -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - uint32_t au32DivTbl[4] = {0x0UL, 0x4UL, 0x8UL, 0x10UL}; - - if(MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock divider control register address */ - u32TmpAddr = (uint32_t)&CLK->CLKDIV0 + (au32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); - /* Get clock divider number setting */ - u32TmpVal = ((inpw((uint32_t *)u32TmpAddr) & (MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx))) >> MODULE_CLKDIV_Pos(u32ModuleIdx)); - } - - return u32TmpVal; -} - - -/**@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CLK_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crc.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crc.c deleted file mode 100644 index e3c9a4b1bfc..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crc.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file crc.c - * @version V3.00 - * @brief Cyclic Redundancy Check(CRC) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_FUNCTIONS CRC Exported Functions - @{ -*/ - -/** - * @brief CRC Open - * - * @param[in] u32Mode CRC operation polynomial mode. Valid values are: - * - \ref CRC_CCITT - * - \ref CRC_8 - * - \ref CRC_16 - * - \ref CRC_32 - * @param[in] u32Attribute CRC operation data attribute. Valid values are combined with: - * - \ref CRC_CHECKSUM_COM - * - \ref CRC_CHECKSUM_RVS - * - \ref CRC_WDATA_COM - * - \ref CRC_WDATA_RVS - * @param[in] u32Seed Seed value. - * @param[in] u32DataLen CPU Write Data Length. Valid values are: - * - \ref CRC_CPU_WDATA_8 - * - \ref CRC_CPU_WDATA_16 - * - \ref CRC_CPU_WDATA_32 - * - * @return None - * - * @details This function will enable the CRC controller by specify CRC operation mode, attribute, initial seed and write data length. \n - * After that, user can start to perform CRC calculate by calling CRC_WRITE_DATA macro or CRC_DAT register directly. - */ -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen) -{ - CRC->SEED = u32Seed; - CRC->CTL = u32Mode | u32Attribute | u32DataLen | CRC_CTL_CRCEN_Msk; - - /* Setting CHKSINIT bit will reload the initial seed value(CRC_SEED register) to CRC controller */ - CRC->CTL |= CRC_CTL_CHKSINIT_Msk; -} - -/** - * @brief Get CRC Checksum - * - * @param[in] None - * - * @return Checksum Result - * - * @details This function gets the CRC checksum result by current CRC polynomial mode. - */ -uint32_t CRC_GetChecksum(void) -{ - uint32_t u32Checksum = 0UL; - - switch(CRC->CTL & CRC_CTL_CRCMODE_Msk) - { - case CRC_CCITT: - case CRC_16: - u32Checksum = (CRC->CHECKSUM & 0xFFFFUL); - break; - - case CRC_32: - u32Checksum = CRC->CHECKSUM; - break; - - case CRC_8: - u32Checksum = (CRC->CHECKSUM & 0xFFUL); - break; - - default: - break; - } - - return u32Checksum; -} - -/**@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crypto.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crypto.c deleted file mode 100644 index c7db7a504df..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_crypto.c +++ /dev/null @@ -1,2978 +0,0 @@ -/**************************************************************************//** - * @file crypto.c - * @version V3.00 - * @brief Cryptographic Accelerator driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include -#ifdef __has_include - #if __has_include("strings.h") - #include - #endif -#endif -#include "NuMicro.h" - -#define ENABLE_DEBUG 0 - -#define ECC_SCA_PROTECT 1 // Enable Side-Channel Protecton - -#if ENABLE_DEBUG -#define CRPT_DBGMSG printf -#else -#define CRPT_DBGMSG(...) do { } while (0) /* disable debug */ -#endif - -#if defined(__ICCARM__) -# pragma diag_suppress=Pm073, Pm143 /* Misra C rule 14.7 */ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - -/* // @cond HIDDEN_SYMBOLS */ - - -static char hex_char_tbl[] = "0123456789abcdef"; - -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count); -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx); -static void Hex2Reg(char input[], uint32_t volatile reg[]); -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]); -static char ch2hex(char ch); -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift); -static int get_nibble_value(char c); -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]); -void ECC_Complete(CRPT_T *crpt); - - -/* // @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Open PRNG function - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32KeySize it is PRNG key size, including: - * - \ref PRNG_KEY_SIZE_64 - * - \ref PRNG_KEY_SIZE_128 - * - \ref PRNG_KEY_SIZE_192 - * - \ref PRNG_KEY_SIZE_256 - * @param[in] u32SeedReload is PRNG seed reload or not, including: - * - \ref PRNG_SEED_CONT - * - \ref PRNG_SEED_RELOAD - * @param[in] u32Seed The new seed. Only valid when u32SeedReload is PRNG_SEED_RELOAD. - * @return None - */ -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed) -{ - if(u32SeedReload) - { - crpt->PRNG_SEED = u32Seed; - } - - crpt->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - (u32SeedReload << CRPT_PRNG_CTL_SEEDRLD_Pos); -} - -/** - * @brief Start to generate one PRNG key. - * @param[in] crpt The pointer of CRYPTO module - * @return None - */ -void PRNG_Start(CRPT_T *crpt) -{ - crpt->PRNG_CTL |= CRPT_PRNG_CTL_START_Msk; - - /* Waiting for PRNG Busy */ - while(crpt->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) {} - -} - -/** - * @brief Read the PRNG key. - * @param[in] crpt The pointer of CRYPTO module - * @param[out] u32RandKey The key buffer to store newly generated PRNG key. - * @return None - */ -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]) -{ - uint32_t i, wcnt; - - wcnt = (((crpt->PRNG_CTL & CRPT_PRNG_CTL_KEYSZ_Msk) >> CRPT_PRNG_CTL_KEYSZ_Pos) + 1U) * 2U; - - for(i = 0U; i < wcnt; i++) - { - u32RandKey[i] = crpt->PRNG_KEY[i]; - } - - crpt->PRNG_CTL &= ~CRPT_PRNG_CTL_SEEDRLD_Msk; -} - - -/** - * @brief Open AES encrypt/decrypt function. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32EncDec 1: AES encode; 0: AES decode - * @param[in] u32OpMode AES operation mode, including: - * - \ref AES_MODE_ECB - * - \ref AES_MODE_CBC - * - \ref AES_MODE_CFB - * - \ref AES_MODE_OFB - * - \ref AES_MODE_CTR - * - \ref AES_MODE_CBC_CS1 - * - \ref AES_MODE_CBC_CS2 - * - \ref AES_MODE_CBC_CS3 - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @param[in] u32SwapType is AES input/output data swap control, including: - * - \ref AES_NO_SWAP - * - \ref AES_OUT_SWAP - * - \ref AES_IN_SWAP - * - \ref AES_IN_OUT_SWAP - * @return None - */ -void AES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, - uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType) -{ - (void)u32Channel; - - crpt->AES_CTL = (u32EncDec << CRPT_AES_CTL_ENCRPT_Pos) | - (u32OpMode << CRPT_AES_CTL_OPMODE_Pos) | - (u32KeySize << CRPT_AES_CTL_KEYSZ_Pos) | - (u32SwapType << CRPT_AES_CTL_OUTSWAP_Pos); - -} - -/** - * @brief Start AES encrypt/decrypt - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32DMAMode AES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shot AES encrypt/decrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous AES encrypt/decrypt. - * - \ref CRYPTO_DMA_LAST Last AES encrypt/decrypt of a series of AES_Start. - * @return None - */ -void AES_Start(CRPT_T *crpt, int32_t u32Channel, uint32_t u32DMAMode) -{ - (void)u32Channel; - - crpt->AES_CTL |= CRPT_AES_CTL_START_Msk | (u32DMAMode << CRPT_AES_CTL_DMALAST_Pos); -} - -/** - * @brief Set AES keys - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32Keys An word array contains AES keys. - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @return None - */ -void AES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize) -{ - uint32_t i, wcnt, key_reg_addr; - - (void) u32Channel; - - key_reg_addr = (uint32_t)&crpt->AES_KEY[0]; - wcnt = 4UL + u32KeySize * 2UL; - - for(i = 0U; i < wcnt; i++) - { - outpw(key_reg_addr, au32Keys[i]); - key_reg_addr += 4UL; - } -} - - - -/** - * @brief Set AES keys index of Key Store - * @param[in] crpt The pointer of CRYPTO module - * @param[in] mem Memory type of Key Store key. it could be: - * - \ref KS_SRAM - * - \ref KS_FLASH - * - \ref KS_OTP - * @param[in] i32KeyIdx Index of the key in Key Store. - * @details AES could use the key in Key Store. This function is used to set the key index of Key Store. - */ -void AES_SetKey_KS(CRPT_T *crpt, KS_MEM_Type mem, int32_t i32KeyIdx) -{ - /* Use key in key store */ - crpt->AES_KSCTL = CRPT_AES_KSCTL_RSRC_Msk /* use KS */ | - (uint32_t)((int)mem << CRPT_AES_KSCTL_RSSRC_Pos) /* KS Memory type */ | - (uint32_t)i32KeyIdx /* key num */ ; - -} - - -/** - * @brief Set AES initial vectors - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32IV A four entry word array contains AES initial vectors. - * @return None - */ -void AES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32IV[]) -{ - uint32_t i, key_reg_addr; - - (void) u32Channel; - - key_reg_addr = (uint32_t)&crpt->AES_IV[0]; - - for(i = 0U; i < 4U; i++) - { - outpw(key_reg_addr, au32IV[i]); - key_reg_addr += 4UL; - } -} - -/** - * @brief Set AES DMA transfer configuration. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32SrcAddr AES DMA source address - * @param[in] u32DstAddr AES DMA destination address - * @param[in] u32TransCnt AES DMA transfer byte count - * @return None - */ -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, - uint32_t u32DstAddr, uint32_t u32TransCnt) -{ - (void) u32Channel; - - crpt->AES_SADDR = u32SrcAddr; - crpt->AES_DADDR = u32DstAddr; - crpt->AES_CNT = u32TransCnt; - -} - -/** - * @brief Open SHA encrypt function. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32OpMode SHA operation mode, including: - * - \ref SHA_MODE_SHA1 - * - \ref SHA_MODE_SHA224 - * - \ref SHA_MODE_SHA256 - * @param[in] u32SwapType is SHA input/output data swap control, including: - * - \ref SHA_NO_SWAP - * - \ref SHA_OUT_SWAP - * - \ref SHA_IN_SWAP - * - \ref SHA_IN_OUT_SWAP - * @param[in] hmac_key_len HMAC key byte count - * @return None - */ -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len) -{ - crpt->HMAC_CTL = (u32OpMode << CRPT_HMAC_CTL_OPMODE_Pos) | - (u32SwapType << CRPT_HMAC_CTL_OUTSWAP_Pos); - - if(hmac_key_len != 0UL) - { - crpt->HMAC_KEYCNT = hmac_key_len; - } -} - -/** - * @brief Start SHA encrypt - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32DMAMode TDES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop SHA encrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous SHA encrypt. - * - \ref CRYPTO_DMA_LAST Last SHA encrypt of a series of SHA_Start. - * @return None - */ -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode) -{ - crpt->HMAC_CTL &= ~(0x7UL << CRPT_HMAC_CTL_DMALAST_Pos); - crpt->HMAC_CTL |= CRPT_HMAC_CTL_START_Msk | (u32DMAMode << CRPT_HMAC_CTL_DMALAST_Pos); -} - -/** - * @brief Set SHA DMA transfer - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32SrcAddr SHA DMA source address - * @param[in] u32TransCnt SHA DMA transfer byte count - * @return None - */ -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt) -{ - crpt->HMAC_SADDR = u32SrcAddr; - crpt->HMAC_DMACNT = u32TransCnt; -} - -/** - * @brief Read the SHA digest. - * @param[in] crpt The pointer of CRYPTO module - * @param[out] u32Digest The SHA encrypt output digest. - * @return None - */ -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]) -{ - uint32_t i, wcnt, reg_addr; - - i = (crpt->HMAC_CTL & CRPT_HMAC_CTL_OPMODE_Msk) >> CRPT_HMAC_CTL_OPMODE_Pos; - - if(i == SHA_MODE_SHA1) - { - wcnt = 5UL; - } - else if(i == SHA_MODE_SHA224) - { - wcnt = 7UL; - } - else if(i == SHA_MODE_SHA256) - { - wcnt = 8UL; - } - else if(i == SHA_MODE_SHA384) - { - wcnt = 12UL; - } - else - { - /* SHA_MODE_SHA512 */ - wcnt = 16UL; - } - - reg_addr = (uint32_t) & (crpt->HMAC_DGST[0]); - for(i = 0UL; i < wcnt; i++) - { - u32Digest[i] = inpw(reg_addr); - reg_addr += 4UL; - } -} - - -/*-----------------------------------------------------------------------------------------------*/ -/* */ -/* ECC */ -/* */ -/*-----------------------------------------------------------------------------------------------*/ - -#define ECCOP_POINT_MUL (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_MODULE (0x1UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_ADD (0x2UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_DOUBLE (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) - -#define MODOP_DIV (0x0UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_MUL (0x1UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_ADD (0x2UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_SUB (0x3UL << CRPT_ECC_CTL_MODOP_Pos) - -#define OP_ECDSAS (0x1UL << CRPT_ECC_CTL_ECDSAS_Pos) -#define OP_ECDSAR (0x1UL << CRPT_ECC_CTL_ECDSAR_Pos) - -enum -{ - CURVE_GF_P, - CURVE_GF_2M, -}; - -/*-----------------------------------------------------*/ -/* Define elliptic curve (EC): */ -/*-----------------------------------------------------*/ -static const ECC_CURVE _Curve[] = -{ - { - /* NIST: Curve P-192 : y^2=x^3-ax+b (mod p) */ - CURVE_P_192, - 48, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", /* "000000000000000000000000000000000000000000000003" */ - "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", - "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012", - "07192b95ffc8da78631011ed6b24cdd573f977a11e794811", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", /* "6277101735386680763835789423207666416083908700390324961279" */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", /* "6277101735386680763835789423176059013767194773182842284081" */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* NIST: Curve P-224 : y^2=x^3-ax+b (mod p) */ - CURVE_P_224, - 56, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", /* "00000000000000000000000000000000000000000000000000000003" */ - "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", - "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", - "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "0026959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", /* "0026959946667150639794667015087019625940457807714424391721682722368061" */ - 224, /* key_len */ - 9, - 8, - 3, - CURVE_GF_P - }, - { - /* NIST: Curve P-256 : y^2=x^3-ax+b (mod p) */ - CURVE_P_256, - 64, /* Echar */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", /* "0000000000000000000000000000000000000000000000000000000000000003" */ - "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", - "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", - "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", - 78, /* Epl */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", /* "115792089210356248762697446949407573530086143415290314195533631308867097853951" */ - 78, /* Eol */ - "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", /* "115792089210356248762697446949407573529996955224135760342422259061068512044369" */ - 256, /* key_len */ - 10, - 5, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-384 : y^2=x^3-ax+b (mod p) */ - CURVE_P_384, - 96, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", /* "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", - "aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", - "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", - 116, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", /* "39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319" */ - 116, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", /* "39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643" */ - 384, /* key_len */ - 12, - 3, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-521 : y^2=x^3-ax+b (mod p)*/ - CURVE_P_521, - 131, /* Echar */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", /* "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", - "0c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", - "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", - 157, /* Epl */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151" */ - 157, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449" */ - 521, /* key_len */ - 32, - 32, - 32, - CURVE_GF_P - }, - { - /* NIST: Curve B-163 : y^2+xy=x^3+ax^2+b */ - CURVE_B_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "20a601907b8c953ca1481eb10512f78744a3205fd", - "3f0eba16286a2d57ea0991168d4994637e8343e36", - "0d51fbc6c71a0094fa2cdd545b11c5c0c797324f1", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "40000000000000000000292FE77E70C12A4234C33", /* "5846006549323611672814742442876390689256843201587" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve B-233 : y^2+xy=x^3+ax^2+b */ - CURVE_B_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000001", - "066647ede6c332c7f8c0923bb58213b333b20e9ce4281fe115f7d8f90ad", - "0fac9dfcbac8313bb2139f1bb755fef65bc391f8b36f8f8eb7371fd558b", - "1006a08a41903350678e58528bebf8a0beff867a7ca36716f7e01f81052", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "1000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", /* "6901746346790563787434755862277025555839812737345013555379383634485463" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve B-283 : y^2+xy=x^3+ax^2+b */ - CURVE_B_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000001", - "27b680ac8b8596da5a4af8a19a0303fca97fd7645309fa2a581485af6263e313b79a2f5", - "5f939258db7dd90e1934f8c70b0dfec2eed25b8557eac9c80e2e198f8cdbecd86b12053", - "3676854fe24141cb98fe6d4b20d02b4516ff702350eddb0826779c813f0df45be8112f4", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", /* "7770675568902916283677847627294075626569625924376904889109196526770044277787378692871" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve B-409 : y^2+xy=x^3+ax^2+b */ - CURVE_B_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "021a5c2c8ee9feb5c4b9a753b7b476b7fd6422ef1f3dd674761fa99d6ac27c8a9a197b272822f6cd57a55aa4f50ae317b13545f", - "15d4860d088ddb3496b0c6064756260441cde4af1771d4db01ffe5b34e59703dc255a868a1180515603aeab60794e54bb7996a7", - "061b1cfab6be5f32bbfa78324ed106a7636b9c5a7bd198d0158aa4f5488d08f38514f1fdf4b4f40d2181b3681c364ba0273c706", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "10000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", /* "661055968790248598951915308032771039828404682964281219284648798304157774827374805208143723762179110965979867288366567526771" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve B-571 : y^2+xy=x^3+ax^2+b */ - CURVE_B_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a", - "303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19", - "37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", /* "3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* NIST: Curve K-163 : y^2+xy=x^3+ax^2+b */ - CURVE_K_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "00000000000000000000000000000000000000001", - "2fe13c0537bbc11acaa07d793de4e6d5e5c94eee8", - "289070fb05d38ff58321f2e800536d538ccdaa3d9", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "4000000000000000000020108A2E0CC0D99F8A5EF", /* "5846006549323611672814741753598448348329118574063" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve K-233 : y^2+xy=x^3+ax^2+b */ - CURVE_K_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000001", - "17232ba853a7e731af129f22ff4149563a419c26bf50a4c9d6eefad6126", - "1db537dece819b7f70f555a67c427a8cd9bf18aeb9b56e0c11056fae6a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", /* "3450873173395281893717377931138512760570940988862252126328087024741343" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve K-283 : y^2+xy=x^3+ax^2+b */ - CURVE_K_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000001", - "503213f78ca44883f1a3b8162f188e553cd265f23c1567a16876913b0c2ac2458492836", - "1ccda380f1c9e318d90f95d07e5426fe87e45c0e8184698e45962364e34116177dd2259", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", /* "3885337784451458141838923813647037813284811733793061324295874997529815829704422603873" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve K-409 : y^2+xy=x^3+ax^2+b */ - CURVE_K_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746", - "1e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", /* "330527984395124299475957654016385519914202341482140609642324395022880711289249191050673258457777458014096366590617731358671" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve K-571 : y^2+xy=x^3+ax^2+b */ - CURVE_K_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "26eb7a859923fbc82189631f8103fe4ac9ca2970012d5d46024804801841ca44370958493b205e647da304db4ceb08cbbd1ba39494776fb988b47174dca88c7e2945283a01c8972", - "349dc807f4fbf374f4aeade3bca95314dd58cec9f307a54ffc61efc006d8a2c9d4979c0ac44aea74fbebbb9f772aedcb620b01a7ba7af1b320430c8591984f601cd4c143ef1c7a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "20000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", /* "1932268761508629172347675945465993672149463664853217499328617625725759571144780212268133978522706711834706712800825351461273674974066617311929682421617092503555733685276673" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* Koblitz: Curve secp192k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_192, - 48, /* Echar */ - "00000000000000000000000000000000000000000", - "00000000000000000000000000000000000000003", - "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", - "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", /* p */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", /* n */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp224k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_224, - 56, /* Echar */ - "00000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000005", - "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", - "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", /* p */ - 70, /* Eol */ - "0000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", /* n */ - 224, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp256k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_256, - 64, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000007", - "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", - "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", - 78, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", /* p */ - 78, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", /* n */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP256r1 */ - CURVE_BP_256, - 64, /* Echar */ - "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", /* A */ - "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", /* B */ - "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", /* x */ - "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", /* y */ - 78, /* Epl */ - "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", /* p */ - 78, /* Eol */ - "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", /* q */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP384r1 */ - CURVE_BP_384, - 96, /* Echar */ - "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", /* A */ - "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", /* B */ - "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", /* x */ - "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", /* y */ - 116, /* Epl */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", /* p */ - 116, /* Eol */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", /* q */ - 384, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP512r1 */ - CURVE_BP_512, - 128, /* Echar */ - "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", /* A */ - "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", /* B */ - "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", /* x */ - "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", /* y */ - 156, /* Epl */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", /* p */ - 156, /* Eol */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", /* q */ - 512, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - CURVE_25519, - 64, // Echar - "0000000000000000000000000000000000000000000000000000000000076D06", // "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000009", - "20ae19a1b8a086b4e01edd2c7748d14c923d4d7e6d7c61b229e9c5a27eced3d9", - 78, // Epl - "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed", // "115792089210356248762697446949407573530086143415290314195533631308867097853951", - 78, // Eol - "1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed", // "115792089210356248762697446949407573529996955224135760342422259061068512044369", - 255, // key_len - 10, - 5, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-256 : y^2=x^3-ax+b (mod p) */ - CURVE_SM2_256, - 64, /* Echar */ - "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC", /* a */ - "28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93", /* b */ - "32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7", /* x */ - "BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0", /* y */ - 78, /* Epl */ - "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF", /* p */ - 78, /* Eol */ - "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", /* n */ - 256, /* key_len */ - 10, - 5, - 2, - CURVE_GF_P - }, - -}; - - -static ECC_CURVE *pCurve; -static ECC_CURVE Curve_Copy; - -static ECC_CURVE * get_curve(E_ECC_CURVE ecc_curve); -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve); -static void run_ecc_codec(CRPT_T *crpt, uint32_t mode); - -static char temp_hex_str[160]; - -static volatile uint32_t g_ECC_done, g_ECCERR_done; - -void ECC_DriverISR(CRPT_T *crpt) -{ - if(crpt->INTSTS & CRPT_INTSTS_ECCIF_Msk) - { - g_ECC_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCIF_Msk; - /* printf("ECC done IRQ.\n"); */ - } - - if(crpt->INTSTS & CRPT_INTSTS_ECCEIF_Msk) - { - g_ECCERR_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCEIF_Msk; - /* printf("ECCERRIF is set!!\n"); */ - } -} - - -#if ENABLE_DEBUG -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ - int32_t i; - - printf("%s => ", str); - for(i = 0; i < count; i++) - { - printf("0x%08x ", regs[i]); - } - printf("\n"); -} -#else -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ - (void)str; - (void)regs; - (void)count; -} -#endif -static char ch2hex(char ch) -{ - if(ch <= '9') - { - return ch - '0'; - } - else if((ch <= 'z') && (ch >= 'a')) - { - return ch - 'a' + 10U; - } - else - { - return ch - 'A' + 10U; - } -} - -static void Hex2Reg(char input[], uint32_t volatile reg[]) -{ - char hex; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0; - - while(si >= 0) - { - val32 = 0UL; - for(i = 0UL; (i < 8UL) && (si >= 0); i++) - { - hex = ch2hex(input[si]); - val32 |= (uint32_t)hex << (i * 4UL); - si--; - } - reg[ri++] = val32; - } -} - -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift) -{ - uint32_t hex, carry; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0; - carry = 0U; - while(si >= 0) - { - val32 = 0UL; - for(i = 0UL; (i < 8UL) && (si >= 0); i++) - { - hex = (uint32_t)ch2hex(input[si]); - hex <<= shift; - - val32 |= (uint32_t)((hex & 0xFU) | carry) << (i * 4UL); - carry = (hex >> 4) & 0xFU; - si--; - } - reg[ri++] = val32; - } - if(carry != 0U) - { - reg[ri] = carry; - } -} - -/** - * @brief Extract specified nibble from an unsigned word in character format. - * For example: - * Suppose val32 is 0x786543210, get_Nth_nibble_char(val32, 3) will return a '3'. - * @param[in] val32 The input unsigned word - * @param[in] idx The Nth nibble to be extracted. - * @return The nibble in character format. - */ -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx) -{ - return hex_char_tbl[(val32 >> (idx * 4U)) & 0xfU ]; -} - - -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]) -{ - int32_t idx, ri; - uint32_t i; - - output[count] = 0U; - idx = count - 1; - - for(ri = 0; idx >= 0; ri++) - { - for(i = 0UL; (i < 8UL) && (idx >= 0); i++) - { - output[idx] = get_Nth_nibble_char(reg[ri], i); - idx--; - } - } -} - -/** - * @brief Translate registers value into hex string - * @param[in] count The string length of ouptut hex string. - * @param[in] reg Register array. - * @param[in] output String buffer for output hex string. - */ -void CRPT_Reg2Hex(int32_t count, volatile uint32_t reg[], char output[]) -{ - Reg2Hex(count, reg, output); -} - -/** - * @brief Translate hex string to registers value - * @param[in] input hex string. - * @param[in] reg Register array. - */ -void CRPT_Hex2Reg(char input[], uint32_t volatile reg[]) -{ - Hex2Reg(input, reg); -} - - -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve) -{ - int32_t i, ret = 0; - - pCurve = get_curve(ecc_curve); - if(pCurve == NULL) - { - CRPT_DBGMSG("Cannot find curve %d!!\n", ecc_curve); - ret = -1; - } - - if(ret == 0) - { - for(i = 0; i < 18; i++) - { - crpt->ECC_A[i] = 0UL; - crpt->ECC_B[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_N[i] = 0UL; - } - - Hex2Reg(pCurve->Ea, crpt->ECC_A); - Hex2Reg(pCurve->Eb, crpt->ECC_B); - Hex2Reg(pCurve->Px, crpt->ECC_X1); - Hex2Reg(pCurve->Py, crpt->ECC_Y1); - - CRPT_DBGMSG("Key length = %d\n", pCurve->key_len); - dump_ecc_reg("CRPT_ECC_CURVE_A", crpt->ECC_A, 10); - dump_ecc_reg("CRPT_ECC_CURVE_B", crpt->ECC_B, 10); - dump_ecc_reg("CRPT_ECC_POINT_X1", crpt->ECC_X1, 10); - dump_ecc_reg("CRPT_ECC_POINT_Y1", crpt->ECC_Y1, 10); - - if(pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_N[0] = 0x1UL; - crpt->ECC_N[(pCurve->key_len) / 32] |= (1UL << ((pCurve->key_len) % 32)); - crpt->ECC_N[(pCurve->irreducible_k1) / 32] |= (1UL << ((pCurve->irreducible_k1) % 32)); - crpt->ECC_N[(pCurve->irreducible_k2) / 32] |= (1UL << ((pCurve->irreducible_k2) % 32)); - crpt->ECC_N[(pCurve->irreducible_k3) / 32] |= (1UL << ((pCurve->irreducible_k3) % 32)); - } - else - { - Hex2Reg(pCurve->Pp, crpt->ECC_N); - } - } - dump_ecc_reg("CRPT_ECC_CURVE_N", crpt->ECC_N, 10); - return ret; -} - - -static int get_nibble_value(char c) -{ - char ch; - - if((c >= '0') && (c <= '9')) - { - ch = '0'; - return ((int)c - (int)ch); - } - - if((c >= 'a') && (c <= 'f')) - { - ch = 'a'; - return ((int)c - (int)ch + 10); - } - - if((c >= 'A') && (c <= 'F')) - { - ch = 'A'; - return ((int)c - (int)ch + 10); - } - return 0; -} - - -/** - * @brief Check if the private key is located in valid range of curve. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k The input private key. - * @return 1 Is valid. - * @return 0 Is not valid. - * @return -1 Invalid curve. - */ -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]) -{ - uint32_t i; - - (void)crpt; - pCurve = get_curve(ecc_curve); - if(pCurve == NULL) - { - return -1; - } - - if(strlen(private_k) < strlen(pCurve->Eorder)) - { - return 1; - } - - if(strlen(private_k) > strlen(pCurve->Eorder)) - { - return 0; - } - - for(i = 0U; i < strlen(private_k); i++) - { - if(get_nibble_value(private_k[i]) < get_nibble_value(pCurve->Eorder[i])) - { - return 1; - } - - if(get_nibble_value(private_k[i]) > get_nibble_value(pCurve->Eorder[i])) - { - return 0; - } - } - return 0; -} - - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] private_k The input private key. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] public_k1 The output publick key 1. - * @param[out] public_k2 The output publick key 2. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]) -{ - int32_t ret = 0, i; - uint32_t u32Tmp; - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - CRPT->ECC_KSCTL = 0; - - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - - Hex2Reg(private_k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if(pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - do - { - u32Tmp = g_ECC_done; - u32Tmp |= g_ECCERR_done; - } - while(u32Tmp == 0UL); - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, public_k1); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, public_k2); - } - - return ret; -} - - - - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] mem Memory type of Key Store. It could be KS_SRAM, KS_FLASH or KS_OTP. - * @param[in] i32KeyIdx Index of the key in Key Store. - * @param[out] public_k1 The output publick key 1. - * @param[out] public_k2 The output publick key 2. - * @param[in] u32ExtraOp Extra options for ECC_KSCTL register. - - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GeneratePublicKey_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[], uint32_t u32ExtraOp) -{ - int32_t ret = 0; - uint32_t u32Tmp; - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - - // key from key store - crpt->ECC_KSCTL = (uint32_t)(mem << 6)/* KS Memory Type */ | - (CRPT_ECC_KSCTL_RSRCK_Msk)/* Key from KS */ | - u32ExtraOp | - (uint32_t)i32KeyIdx; - - /* set FSEL (Field selection) */ - if(pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - do - { - u32Tmp = g_ECC_done; - u32Tmp |= g_ECCERR_done; - } - while(u32Tmp == 0UL); - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, public_k1); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, public_k2); - } - - return ret; -} - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt Reference to Crypto module. - * @param[out] x1 The x-coordinate of input point. - * @param[out] y1 The y-coordinate of input point. - * @param[in] k The private key - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] x2 The x-coordinate of output point. - * @param[out] y2 The y-coordinate of output point. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]) -{ - int32_t i, ret = 0; - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - for(i = 0; i < 9; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_K[i] = 0UL; - } - - Hex2Reg(x1, crpt->ECC_X1); - Hex2Reg(y1, crpt->ECC_Y1); - Hex2Reg(k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if(pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - - if(ecc_curve == CURVE_25519) - { - printf("!! Is curve-25519 !!\n"); - crpt->ECC_CTL |= CRPT_ECC_CTL_SCAP_Msk; - crpt->ECC_CTL |= CRPT_ECC_CTL_CSEL_Msk; - - /* If SCAP enabled, the curve order must be written to ECC_X2 */ - if(crpt->ECC_CTL & CRPT_ECC_CTL_SCAP_Msk) - { - Hex2Reg(pCurve->Eorder, crpt->ECC_X2); - } - } - - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - while((g_ECC_done == 0UL) && (g_ECCERR_done == 0UL)) - { - } - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, x2); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, y2); - - } - - return ret; -} - - -/** - * @brief Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k One's own private key. - * @param[in] public_k1 The other party's publick key 1. - * @param[in] public_k2 The other party's publick key 2. - * @param[out] secret_z The ECC CDH secret Z. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]) -{ - int32_t i, ret = 0; - uint32_t u32Tmp; - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - if((ecc_curve == CURVE_B_163) || (ecc_curve == CURVE_B_233) || (ecc_curve == CURVE_B_283) || - (ecc_curve == CURVE_B_409) || (ecc_curve == CURVE_B_571) || (ecc_curve == CURVE_K_163)) - { - Hex2RegEx(private_k, crpt->ECC_K, 1); - } - else if((ecc_curve == CURVE_K_233) || (ecc_curve == CURVE_K_283) || - (ecc_curve == CURVE_K_409) || (ecc_curve == CURVE_K_571)) - { - Hex2RegEx(private_k, crpt->ECC_K, 2); - } - else - { - Hex2Reg(private_k, crpt->ECC_K); - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* set FSEL (Field selection) */ - if(pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - do - { - u32Tmp = g_ECC_done; - u32Tmp |= g_ECCERR_done; - } - while(u32Tmp == 0UL); - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, secret_z); - } - - return ret; -} - - -/** - * @brief Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k One's own private key. - * @param[in] public_k1 The other party's publick key 1. - * @param[in] public_k2 The other party's publick key 2. - * @param[out] secret_z The ECC CDH secret Z. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSecretZ_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[]) -{ - int32_t i; - uint32_t u32Tmp; - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - return -1; - } - - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - crpt->ECC_KSCTL = CRPT_ECC_KSCTL_ECDH_Msk | CRPT_ECC_KSCTL_RSRCK_Msk | - (uint32_t)(mem << CRPT_ECC_KSCTL_RSSRCK_Pos)/* KS Memory Type */ | - (uint32_t)i32KeyIdx; - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* set FSEL (Field selection) */ - if(pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - do - { - u32Tmp = g_ECC_done; - u32Tmp |= g_ECCERR_done; - } - while(u32Tmp == 0UL); - - if(g_ECCERR_done) - return -1; - - return (crpt->ECC_KSSTS & 0x1f); - -} - - -static void run_ecc_codec(CRPT_T *crpt, uint32_t mode) -{ - uint32_t u32Tmp; - uint32_t eccop; - - eccop = mode & CRPT_ECC_CTL_ECCOP_Msk; - if(eccop == ECCOP_MODULE) - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - else - { - if(pCurve->GF == (int)CURVE_GF_2M) - { - /* point */ - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - -#ifdef ECC_SCA_PROTECT - if(eccop == ECCOP_POINT_MUL) - { - /* Enable side-channel protection in some operation */ - crpt->ECC_CTL |= CRPT_ECC_CTL_SCAP_Msk; - /* If SCAP enabled, the curve order must be written to ECC_X2 */ - Hex2Reg(pCurve->Eorder, crpt->ECC_X2); - } -#endif - - } - - g_ECC_done = g_ECCERR_done = 0UL; - - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | mode | CRPT_ECC_CTL_START_Msk; - - do - { - u32Tmp = g_ECC_done; - u32Tmp |= g_ECCERR_done; - } - while(u32Tmp == 0UL); - - while(crpt->ECC_STS & CRPT_ECC_STS_BUSY_Msk) { } -} - -/** - * @brief ECDSA digital signature generation. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] d The private key. - * @param[in] k The selected random integer. - * @param[out] R R of the (R,S) pair digital signature - * @param[out] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *d, char *k, char *R, char *S) -{ - uint32_t volatile temp_result1[18], temp_result2[18]; - int32_t i, ret = 0; - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - CRPT->ECC_KSCTL = 0; - - /* - * 1. Calculate e = HASH(m), where HASH is a cryptographic hashing algorithm, (i.e. SHA-1) - * (1) Use SHA to calculate e - */ - - /* 2. Select a random integer k form [1, n-1] - * (1) Notice that n is order, not prime modulus or irreducible polynomial function - */ - - /* - * 3. Compute r = x1 (mod n), where (x1, y1) = k * G. If r = 0, go to step 2 - * (1) Write the curve parameter A, B, and curve length M to corresponding registers - * (2) Write the prime modulus or irreducible polynomial function to N registers according - * (3) Write the point G(x, y) to X1, Y1 registers - * (4) Write the random integer k to K register - * (5) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Write the curve order and curve length to N ,M registers according - * (10) Write 0x0 to Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 * - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Read X1 registers to get r - */ - - /* 3-(4) Write the random integer k to K register */ - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_K); - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* 3-(9) Write the curve order to N registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(10) Write 0x0 to Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* 3-(15) Read X1 registers to get r */ - for(i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result1, R); - - /* - * 4. Compute s = k^-1 * (e + d * r)(mod n). If s = 0, go to step 2 - * (1) Write the curve order to N registers according - * (2) Write 0x1 to Y1 registers - * (3) Write the random integer k to X1 registers according - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set START(CRPT_ECC_CTL[0]) to 1 - * (7) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (8) Read X1 registers to get k^-1 - * (9) Write the curve order and curve length to N ,M registers - * (10) Write r, d to X1, Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Write the curve order to N registers - * (16) Write e to Y1 registers - * (17) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (18) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (19) Set START(CRPT_ECC_CTL[0]) to 1 - * (20) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (21) Write the curve order and curve length to N ,M registers - * (22) Write k^-1 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get s - */ - - /* S/W: GFp_add_mod_order(pCurve->key_len+2, 0, x1, a, R); */ - - /* 4-(1) Write the curve order to N registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write 0x1 to Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 4-(3) Write the random integer k to X1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(7) output = %s\n", temp_hex_str); -#endif - - /* 4-(8) Read X1 registers to get k^-1 */ - - for(i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("k^-1 = %s\n", temp_hex_str); -#endif - - /* 4-(9) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(10) Write r, d to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - } - - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - Hex2Reg(d, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(14) output = %s\n", temp_hex_str); -#endif - - /* 4-(15) Write the curve order to N registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(16) Write e to Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - Hex2Reg(message, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(20) output = %s\n", temp_hex_str); -#endif - - /* 4-(21) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(22) Write k^-1 to Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(27) Read X1 registers to get s */ - for(i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result2, S); - - } /* ret == 0 */ - - return ret; -} - - - -/** - * @brief ECDSA digital signature generation. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] d The private key. - * @param[in] k The selected random integer. - * @param[out] R R of the (R,S) pair digital signature - * @param[out] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_d, int32_t i32KeyIdx_d, KS_MEM_Type mem_k, int32_t i32KeyIdx_k, char *R, char *S) -{ - uint32_t volatile temp_result1[18], temp_result2[18]; - int32_t i, ret = 0; - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - CRPT->ECC_KSCTL = 0; - CRPT->ECC_KSXY = 0; - - /* - * 1. Calculate e = HASH(m), where HASH is a cryptographic hashing algorithm, (i.e. SHA-1) - * (1) Use SHA to calculate e - */ - - /* 2. Select a random integer k form [1, n-1] - * (1) Notice that n is order, not prime modulus or irreducible polynomial function - */ - - /* - * 3. Compute r = x1 (mod n), where (x1, y1) = k * G. If r = 0, go to step 2 - * (1) Write the curve parameter A, B, and curve length M to corresponding registers - * (2) Write the prime modulus or irreducible polynomial function to N registers according - * (3) Write the point G(x, y) to X1, Y1 registers - * (4) Write the random integer k to K register - * (5) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Write the curve order and curve length to N ,M registers according - * (10) Write 0x0 to Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 * - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Read X1 registers to get r - */ - - /* 3-(4) Use k in Key Store */ - crpt->ECC_KSCTL = (uint32_t)(mem_k << CRPT_ECC_KSCTL_RSSRCK_Pos)/* KS Memory Type */ | - CRPT_ECC_KSCTL_RSRCK_Msk/* Key from KS */ | - (uint32_t)i32KeyIdx_k; - - run_ecc_codec(crpt, ECCOP_POINT_MUL | OP_ECDSAR); - - /* 3-(9) Write the curve order to N registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(10) Write 0x0 to Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* 3-(15) Read X1 registers to get r */ - for(i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result1, R); - - - /* - * 4. Compute s = k ^-1 * (e + d * r)(mod n). If s = 0, go to step 2 - * (1) Write the curve order to N registers according - * (2) Write 0x1 to Y1 registers - * (3) Write the random integer k to X1 registers according - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set START(CRPT_ECC_CTL[0]) to 1 - * (7) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (8) Read X1 registers to get k^-1 - * (9) Write the curve order and curve length to N ,M registers - * (10) Write r, d to X1, Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Write the curve order to N registers - * (16) Write e to Y1 registers - * (17) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (18) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (19) Set START(CRPT_ECC_CTL[0]) to 1 - * (20) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (21) Write the curve order and curve length to N ,M registers - * (22) Write k^-1 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get s - */ - - /* S/W: GFp_add_mod_order(pCurve->key_len+2, 0, x1, a, R); */ - - /* 4-(1) Write the curve order to N registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2)(3)(4)(5) Use d, k in Key Store */ - crpt->ECC_CTL = 0; - crpt->ECC_KSXY = CRPT_ECC_KSXY_RSRCXY_Msk | - (uint32_t)(mem_k << CRPT_ECC_KSXY_RSSRCX_Pos) | ((uint32_t)i32KeyIdx_k << CRPT_ECC_KSXY_NUMX_Pos) | // Key Store index of k - (uint32_t)(mem_d << CRPT_ECC_KSXY_RSSRCY_Pos) | ((uint32_t)i32KeyIdx_d << CRPT_ECC_KSXY_NUMY_Pos); // Key Store index of d - - // 4-5 - for(i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_result1[i]; - crpt->ECC_Y2[i] = 0; - } - Hex2Reg(message, crpt->ECC_Y2); - - run_ecc_codec(crpt, ECCOP_MODULE | OP_ECDSAS); - - /* 4-11 Read X1 registers to get s */ - for(i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - Reg2Hex(pCurve->Echar, temp_result2, S); - - /* Clear KS Control */ - CRPT->ECC_KSCTL = 0; - CRPT->ECC_KSXY = 0; - - } /* ret == 0 */ - - return ret; -} - - -/** - * @brief ECDSA dogotal signature verification. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] public_k1 The public key 1. - * @param[in] public_k2 The public key 2. - * @param[in] R R of the (R,S) pair digital signature - * @param[in] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - * @return -2 Verification failed. - */ -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *public_k1, char *public_k2, char *R, char *S) -{ - uint32_t temp_result1[18], temp_result2[18]; - uint32_t temp_x[18], temp_y[18]; - int32_t i, ret = 0; - - /* - * 1. Verify that r and s are integers in the interval [1, n-1]. If not, the signature is invalid - * 2. Compute e = HASH (m), where HASH is the hashing algorithm in signature generation - * (1) Use SHA to calculate e - */ - - /* - * 3. Compute w = s^-1 (mod n) - * (1) Write the curve order to N registers - * (2) Write 0x1 to Y1 registers - * (3) Write s to X1 registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Read X1 registers to get w - */ - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - - /* 3-(1) Write the curve order to N registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(2) Write 0x1 to Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 3-(3) Write s to X1 registers */ - for(i = 0; i < 18; i++) - { - CRPT->ECC_X1[i] = 0UL; - } - Hex2Reg(S, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - - /* 3-(9) Read X1 registers to get w */ - for(i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - CRPT_DBGMSG("e = %s\n", message); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("w = %s\n", temp_hex_str); - CRPT_DBGMSG("o = %s (order)\n", pCurve->Eorder); -#endif - - /* - * 4. Compute u1 = e * w (mod n) and u2 = r * w (mod n) - * (1) Write the curve order and curve length to N ,M registers - * (2) Write e, w to X1, Y1 registers - * (3) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (4) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1 registers to get u1 - * (8) Write the curve order and curve length to N ,M registers - * (9) Write r, w to X1, Y1 registers - * (10) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (11) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Read X1 registers to get u2 - */ - - /* 4-(1) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write e, w to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_X1); - - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(7) Read X1 registers to get u1 */ - for(i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("u1 = %s\n", temp_hex_str); -#endif - - /* 4-(8) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(9) Write r, w to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(R, crpt->ECC_X1); - - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(14) Read X1 registers to get u2 */ - for(i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("u2 = %s\n", temp_hex_str); -#endif - - /* - * 5. Compute X * (x1', y1') = u1 * G + u2 * Q - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - * (3) Write u1 to K registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1, Y1 registers to get u1*G - * (8) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (9) Write the public key Q(x,y) to X1, Y1 registers - * (10) Write u2 to K registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (15) Write the result data u1*G to X2, Y2 registers - * (16) Set ECCOP(CRPT_ECC_CTL[10:9]) to 10 - * (17) Set START(CRPT_ECC_CTL[0]) to 1 - * (18) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (19) Read X1, Y1 registers to get X *(x1', y1') - * (20) Write the curve order and curve length to N ,M registers - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get x1 * (mod n) - * - * 6. The signature is valid if x1 * = r, otherwise it is invalid - */ - - /* - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - */ - ecc_init_curve(crpt, ecc_curve); - - /* (3) Write u1 to K registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result1[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* (7) Read X1, Y1 registers to get u1*G */ - for(i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, y = %s\n", temp_hex_str); -#endif - - /* (8) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* (9) Write the public key Q(x,y) to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* (10) Write u2 to K registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - for(i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - temp_result2[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, y = %s\n", temp_hex_str); -#endif - - /* (14) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* Write the result data u2*Q to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - crpt->ECC_Y1[i] = temp_result2[i]; - } - - /* (15) Write the result data u1*G to X2, Y2 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_x[i]; - crpt->ECC_Y2[i] = temp_y[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_ADD); - - /* (19) Read X1, Y1 registers to get X * (x1', y1') */ - for(i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(19) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(19) y' = %s\n", temp_hex_str); -#endif - - /* (20) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_x[i]; - crpt->ECC_Y1[i] = 0UL; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(21) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, temp_hex_str); - CRPT_DBGMSG("5-(22) y' = %s\n", temp_hex_str); -#endif - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* (27) Read X1 registers to get x1 * (mod n) */ - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(27) x1' (mod n) = %s\n", temp_hex_str); - - /* 6. The signature is valid if x1 * = r, otherwise it is invalid */ - - /* Compare with test pattern to check if r is correct or not */ - if(strcasecmp(temp_hex_str, R) != 0) - { - CRPT_DBGMSG("x1' (mod n) != R Test filed!!\n"); - CRPT_DBGMSG("Signature R [%s] is not matched with expected R [%s]!\n", temp_hex_str, R); - ret = -2; - } - } /* ret == 0 */ - - return ret; -} - - - -/** - * @brief ECDSA signature verification with Key Store - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] public_k1 The public key 1. - * @param[in] public_k2 The public key 2. - * @param[in] R R of the (R,S) pair digital signature - * @param[in] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - * @return -2 Verification failed. - */ -int32_t ECC_VerifySignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_pk1, int32_t i32KeyIdx_pk1, KS_MEM_Type mem_pk2, int32_t i32KeyIdx_pk2, char *R, char *S) -{ - uint32_t temp_result1[18], temp_result2[18]; - uint32_t temp_x[18], temp_y[18]; - int32_t i, ret = 0; - - /* - * 1. Verify that r and s are integers in the interval [1, n-1]. If not, the signature is invalid - * 2. Compute e = HASH (m), where HASH is the hashing algorithm in signature generation - * (1) Use SHA to calculate e - */ - - /* - * 3. Compute w = s^-1 (mod n) - * (1) Write the curve order to N registers - * (2) Write 0x1 to Y1 registers - * (3) Write s to X1 registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Read X1 registers to get w - */ - - if(ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if(ret == 0) - { - crpt->ECC_KSCTL = 0; - crpt->ECC_KSXY = 0; - - /* 3-(1) Write the curve order to N registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(2) Write 0x1 to Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 3-(3) Write s to X1 registers */ - for(i = 0; i < 18; i++) - { - CRPT->ECC_X1[i] = 0UL; - } - Hex2Reg(S, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - - /* 3-(9) Read X1 registers to get w */ - for(i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - CRPT_DBGMSG("e = %s\n", message); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("w = %s\n", temp_hex_str); - CRPT_DBGMSG("o = %s (order)\n", pCurve->Eorder); -#endif - - /* - * 4. Compute u1 = e * w (mod n) and u2 = r * w (mod n) - * (1) Write the curve order and curve length to N ,M registers - * (2) Write e, w to X1, Y1 registers - * (3) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (4) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1 registers to get u1 - * (8) Write the curve order and curve length to N ,M registers - * (9) Write r, w to X1, Y1 registers - * (10) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (11) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Read X1 registers to get u2 - */ - - /* 4-(1) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write e, w to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_X1); - - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(7) Read X1 registers to get u1 */ - for(i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("u1 = %s\n", temp_hex_str); -#endif - - /* 4-(8) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(9) Write r, w to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(R, crpt->ECC_X1); - - for(i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(14) Read X1 registers to get u2 */ - for(i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("u2 = %s\n", temp_hex_str); -#endif - - /* - * 5. Compute X * (x1', y1') = u1 * G + u2 * Q - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - * (3) Write u1 to K registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1, Y1 registers to get u1*G - * (8) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (9) Write the public key Q(x,y) to X1, Y1 registers - * (10) Write u2 to K registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (15) Write the result data u1*G to X2, Y2 registers - * (16) Set ECCOP(CRPT_ECC_CTL[10:9]) to 10 - * (17) Set START(CRPT_ECC_CTL[0]) to 1 - * (18) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (19) Read X1, Y1 registers to get X * (x1', y1') - * (20) Write the curve order and curve length to N ,M registers - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get x1 * (mod n) - * - * 6. The signature is valid if x1 * = r, otherwise it is invalid - */ - - /* - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - */ - ecc_init_curve(crpt, ecc_curve); - - /* (3) Write u1 to K registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result1[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* (7) Read X1, Y1 registers to get u1*G */ - for(i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, y = %s\n", temp_hex_str); -#endif - - /* (8) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* (9) Write the public key Q(x,y) to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - -#if 0 - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); -#else - - /* 5-(2) Get the public key from key store */ - crpt->ECC_KSCTL = 0ul; - crpt->ECC_KSXY = CRPT_ECC_KSXY_RSRCXY_Msk | - (uint32_t)(mem_pk1 << CRPT_ECC_KSXY_RSSRCX_Pos) | ((uint32_t)i32KeyIdx_pk1 << CRPT_ECC_KSXY_NUMX_Pos) | // Key Store index of pk1 - (uint32_t)(mem_pk2 << CRPT_ECC_KSXY_RSSRCY_Pos) | ((uint32_t)i32KeyIdx_pk2 << CRPT_ECC_KSXY_NUMY_Pos); // Key Store index of pk2 - -#endif - - /* (10) Write u2 to K registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - for(i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - temp_result2[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, y = %s\n", temp_hex_str); -#endif - - /* (14) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* Write the result data u2*Q to X1, Y1 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - crpt->ECC_Y1[i] = temp_result2[i]; - } - - /* (15) Write the result data u1*G to X2, Y2 registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_x[i]; - crpt->ECC_Y2[i] = temp_y[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_ADD); - - /* (19) Read X1, Y1 registers to get X * (x1', y1') */ - for(i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(19) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(19) y' = %s\n", temp_hex_str); -#endif - - /* (20) Write the curve order and curve length to N ,M registers */ - for(i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - */ - for(i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_x[i]; - crpt->ECC_Y1[i] = 0UL; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(21) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, temp_hex_str); - CRPT_DBGMSG("5-(22) y' = %s\n", temp_hex_str); -#endif - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* (27) Read X1 registers to get x1 * (mod n) */ - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(27) x1' (mod n) = %s\n", temp_hex_str); - - /* 6. The signature is valid if x1 * = r, otherwise it is invalid */ - - /* Compare with test pattern to check if r is correct or not */ - if(strcasecmp(temp_hex_str, R) != 0) - { - CRPT_DBGMSG("x1' (mod n) != R Test filed!!\n"); - CRPT_DBGMSG("Signature R [%s] is not matched with expected R [%s]!\n", temp_hex_str, R); - ret = -2; - } - } /* ret == 0 */ - - return ret; -} - - -static ECC_CURVE * get_curve(E_ECC_CURVE ecc_curve) -{ - uint32_t i; - ECC_CURVE *ret = NULL; - - for(i = 0UL; i < sizeof(_Curve) / sizeof(ECC_CURVE); i++) - { - if(ecc_curve == _Curve[i].curve_id) - { - memcpy((char *)&Curve_Copy, &_Curve[i], sizeof(ECC_CURVE)); - ret = &Curve_Copy; /* (ECC_CURVE *)&_Curve[i]; */ - } - if(ret != NULL) - { - break; - } - } - return ret; -} - - -/** - * @brief ECC interrupt service routine. User application must invoke this function in - * his CRYPTO_IRQHandler() to let Crypto driver know ECC processing was done. - * @param[in] crpt Reference to Crypto module. - * @return none - */ -void ECC_Complete(CRPT_T *crpt) -{ - if(crpt->INTSTS & CRPT_INTSTS_ECCIF_Msk) - { - g_ECC_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCIF_Msk; - /* printf("ECC done IRQ.\n"); */ - } - - if(crpt->INTSTS & CRPT_INTSTS_ECCEIF_Msk) - { - g_ECCERR_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCEIF_Msk; - printf("ECCEIF flag is set!!\n"); - } -} - - -int32_t ECC_GetCurve(CRPT_T *crpt, E_ECC_CURVE ecc_curve, ECC_CURVE *curve) -{ - int32_t err; - - /* Update pCurve pointer */ - err = ecc_init_curve(crpt, ecc_curve); - if(err == 0) - { - /* get curve */ - memcpy(curve, pCurve, sizeof(ECC_CURVE)); - } - - return err; -} - - -/*-----------------------------------------------------------------------------------------------*/ -/* */ -/* RSA */ -/* */ -/*-----------------------------------------------------------------------------------------------*/ - -/** @cond HIDDEN_SYMBOLS */ - -static void *s_pRSABuf; -static uint32_t s_u32RsaOpMode; - -typedef enum -{ - BUF_NORMAL, - BUF_CRT, - BUF_CRTBYPASS, - BUF_SCAP, - BUF_CRT_SCAP, - BUF_CRTBYPASS_SCAP, - BUF_KS -} E_RSA_BUF_SEL; - -static int32_t CheckRsaBufferSize(uint32_t u32OpMode, uint32_t u32BufSize, uint32_t u32UseKS); - -/** @endcond HIDDEN_SYMBOLS */ - -/* Check the allocated buffer size for RSA operation. */ -static int32_t CheckRsaBufferSize(uint32_t u32OpMode, uint32_t u32BufSize, uint32_t u32UseKS) -{ - /* RSA buffer size for MODE_NORMAL, MODE_CRT, MODE_CRTBYPASS, MODE_SCAP, MODE_CRT_SCAP, MODE_CRTBYPASS_SCAP */ - uint32_t s_au32RsaBufSizeTbl[] = {sizeof(RSA_BUF_NORMAL_T), sizeof(RSA_BUF_CRT_T), sizeof(RSA_BUF_CRT_T), \ - sizeof(RSA_BUF_SCAP_T), sizeof(RSA_BUF_CRT_SCAP_T), sizeof(RSA_BUF_CRT_SCAP_T), \ - sizeof(RSA_BUF_KS_T) - }; - - if(u32UseKS) - { - if(u32BufSize != s_au32RsaBufSizeTbl[BUF_KS]) - return (-1); - } - else - { - switch(u32OpMode) - { - case RSA_MODE_NORMAL: - if(u32BufSize != s_au32RsaBufSizeTbl[BUF_NORMAL]) - return (-1); - break; - case RSA_MODE_CRT: - if(u32BufSize != s_au32RsaBufSizeTbl[BUF_CRT]) - return (-1); - break; - case RSA_MODE_CRTBYPASS: - if(u32BufSize != s_au32RsaBufSizeTbl[BUF_CRTBYPASS]) - return (-1); - break; - case RSA_MODE_SCAP: - if(u32BufSize != s_au32RsaBufSizeTbl[BUF_SCAP]) - return (-1); - break; - case RSA_MODE_CRT_SCAP: - if(u32BufSize != s_au32RsaBufSizeTbl[BUF_CRT_SCAP]) - return (-1); - break; - case RSA_MODE_CRTBYPASS_SCAP: - if(u32BufSize != s_au32RsaBufSizeTbl[BUF_CRTBYPASS_SCAP]) - return (-1); - break; - default: - return (-1); - } - } - - return 0; -} - -/** - * @brief Open RSA encrypt/decrypt function. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32OpMode RSA operation mode, including: - * - \ref RSA_MODE_NORMAL - * - \ref RSA_MODE_CRT - * - \ref RSA_MODE_CRTBYPASS - * - \ref RSA_MODE_SCAP - * - \ref RSA_MODE_CRT_SCAP - * - \ref RSA_MODE_CRTBYPASS_SCAP - * @param[in] u32KeySize is RSA key size, including: - * - \ref RSA_KEY_SIZE_1024 - * - \ref RSA_KEY_SIZE_2048 - * - \ref RSA_KEY_SIZE_3072 - * - \ref RSA_KEY_SIZE_4096 - * @param[in] psRSA_Buf The pointer of RSA buffer struct. User should declare correct RSA buffer for specific operation mode first. - * - \ref RSA_BUF_NORMAL_T The struct for normal mode - * - \ref RSA_BUF_CRT_T The struct for CRT ( + CRT bypass) mode - * - \ref RSA_BUF_SCAP_T The struct for SCAP mode - * - \ref RSA_BUF_CRT_SCAP_T The struct for CRT ( + CRT bypass) +SCAP mode - * - \ref RSA_BUF_KS_T The struct for using key store - * @param[in] u32BufSize is RSA buffer size. - * @param[in] u32UseKS is use key store function. - * - \ref 0 No use key store function - * - \ref 1 Use key store function - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32KeySize, \ - void *psRSA_Buf, uint32_t u32BufSize, uint32_t u32UseKS) -{ - if(psRSA_Buf == 0) - { - return (-1); - } - if(CheckRsaBufferSize(u32OpMode, u32BufSize, u32UseKS) != 0) - { - return (-1); - } - - s_u32RsaOpMode = u32OpMode; - s_pRSABuf = psRSA_Buf; - crpt->RSA_CTL = (u32OpMode) | (u32KeySize << CRPT_RSA_CTL_KEYLENG_Pos); - - return 0; -} - -/** - * @brief Set the RSA key - * @param[in] crpt The pointer of CRYPTO module - * @param[in] Key The private or public key. - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_SetKey(CRPT_T *crpt, char *Key) -{ - if(s_pRSABuf == 0) - { - return (-1); - } - Hex2Reg(Key, ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaE); - crpt->RSA_SADDR[2] = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaE; /* the public key or private key */ - - return 0; -} - -/** - * @brief Set RSA DMA transfer configuration. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] Src RSA DMA source data - * @param[in] n The modulus for both the public and private keys - * @param[in] P The factor of modulus operation(P) for CRT/SCAP mode - * @param[in] Q The factor of modulus operation(Q) for CRT/SCAP mode - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_SetDMATransfer(CRPT_T *crpt, char *Src, char *n, char *P, char *Q) -{ - if(s_pRSABuf == 0) - { - return (-1); - } - Hex2Reg(Src, ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaM); - Hex2Reg(n, ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaN); - - /* Assign the data to DMA */ - crpt->RSA_SADDR[0] = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaM; /* plaintext / encrypt data */ - crpt->RSA_SADDR[1] = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaN; /* the base of modulus operation */ - crpt->RSA_DADDR = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaOutput; /* encrypt data / decrypt data */ - - if((s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) && (s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk)) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - Hex2Reg(P, ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaP); - Hex2Reg(Q, ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaQ); - - crpt->RSA_SADDR[3] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaP; /* prime P */ - crpt->RSA_SADDR[4] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaQ; /* prime Q */ - - crpt->RSA_MADDR[0] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpCp; /* for storing the intermediate temporary value(Cp) */ - crpt->RSA_MADDR[1] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpCq; /* for storing the intermediate temporary value(Cq) */ - crpt->RSA_MADDR[2] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpDp; /* for storing the intermediate temporary value(Dp) */ - crpt->RSA_MADDR[3] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpDq; /* for storing the intermediate temporary value(Dq) */ - crpt->RSA_MADDR[4] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpRp; /* for storing the intermediate temporary value(Rp) */ - crpt->RSA_MADDR[5] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpRq; /* for storing the intermediate temporary value(Rq) */ - - /* For SCAP mode to store the intermediate temporary value(blind key) */ - crpt->RSA_MADDR[6] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpBlindKey; - } - else if(s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - Hex2Reg(P, ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaP); - Hex2Reg(Q, ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaQ); - - crpt->RSA_SADDR[3] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaP; /* prime P */ - crpt->RSA_SADDR[4] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaQ; /* prime Q */ - - crpt->RSA_MADDR[0] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpCp; /* for storing the intermediate temporary value(Cp) */ - crpt->RSA_MADDR[1] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpCq; /* for storing the intermediate temporary value(Cq) */ - crpt->RSA_MADDR[2] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpDp; /* for storing the intermediate temporary value(Dp) */ - crpt->RSA_MADDR[3] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpDq; /* for storing the intermediate temporary value(Dq) */ - crpt->RSA_MADDR[4] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpRp; /* for storing the intermediate temporary value(Rp) */ - crpt->RSA_MADDR[5] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpRq; /* for storing the intermediate temporary value(Rq) */ - } - else if(s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - Hex2Reg(P, ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaP); - Hex2Reg(Q, ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaQ); - - crpt->RSA_SADDR[3] = (uint32_t) & ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaP; /* prime P */ - crpt->RSA_SADDR[4] = (uint32_t) & ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaQ; /* prime Q */ - - /* For SCAP mode to store the intermediate temporary value(blind key) */ - crpt->RSA_MADDR[6] = (uint32_t) & ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaTmpBlindKey; - } - - return 0; -} - -/** - * @brief Start RSA encrypt/decrypt - * @param[in] crpt The pointer of CRYPTO module - * @return None - */ -void RSA_Start(CRPT_T *crpt) -{ - crpt->RSA_CTL |= CRPT_RSA_CTL_START_Msk; -} - -/** - * @brief Read the RSA output. - * @param[in] crpt The pointer of CRYPTO module - * @param[out] Output The RSA operation output data. - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_Read(CRPT_T *crpt, char *Output) -{ - if(s_pRSABuf == 0) - { - return (-1); - } - uint32_t au32CntTbl[4] = {256, 512, 768, 1024}; /* count is key length divided by 4 */ - uint32_t u32CntIdx = 0; - - u32CntIdx = (crpt->RSA_CTL & CRPT_RSA_CTL_KEYLENG_Msk) >> CRPT_RSA_CTL_KEYLENG_Pos; - Reg2Hex((int32_t)au32CntTbl[u32CntIdx], ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaOutput, Output); - - return 0; -} - -/** - * @brief Set the RSA key is read from key store - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32KeyNum The number of private or public key in key store. - * @param[in] u32KSMemType The key is read from selected memory type of key store. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] u32BlindKeyNum The number of blind key in SRAM of key store for SCAP mode. This key is un-readable. - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_SetKey_KS(CRPT_T *crpt, uint32_t u32KeyNum, uint32_t u32KSMemType, uint32_t u32BlindKeyNum) -{ - if(s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk) - { - crpt->RSA_KSCTL = (u32BlindKeyNum << 8) | (u32KSMemType << CRPT_RSA_KSCTL_RSSRC_Pos) | CRPT_RSA_KSCTL_RSRC_Msk | u32KeyNum; - } - else - { - crpt->RSA_KSCTL = (u32KSMemType << CRPT_RSA_KSCTL_RSSRC_Pos) | CRPT_RSA_KSCTL_RSRC_Msk | u32KeyNum; - } - return 0; -} - -/** - * @brief Set RSA DMA transfer configuration while using key store. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32OpMode RSA operation mode, including: - * - \ref RSA_MODE_NORMAL - * - \ref RSA_MODE_CRT - * - \ref RSA_MODE_CRTBYPASS - * - \ref RSA_MODE_SCAP - * - \ref RSA_MODE_CRT_SCAP - * - \ref RSA_MODE_CRTBYPASS_SCAP - * @param[in] Src RSA DMA source data - * @param[in] n The modulus for both the public and private keys - * @param[in] u32PNum The number of the factor of modulus operation(P) in SRAM of key store for CRT/SCAP mode - * @param[in] u32QNum The number of the factor of modulus operation(Q) in SRAM of key store for CRT/SCAP mode - * @param[in] u32CpNum The number of Cp in SRAM of key store for CRT mode - * @param[in] u32CqNum The number of Cq in SRAM of key store for CRT mode - * @param[in] u32DpNum The number of Dp in SRAM of key store for CRT mode - * @param[in] u32DqNum The number of Dq in SRAM of key store for CRT mode - * @param[in] u32RpNum The number of Rp in SRAM of key store for CRT mode - * @param[in] u32RqNum The number of Rq in SRAM of key store for CRT mode - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - * @note P, Q, Dp, Dq are equal to half key length. Cp, Cq, Rp, Rq, Blind key are equal to key length. - */ -int32_t RSA_SetDMATransfer_KS(CRPT_T *crpt, char *Src, char *n, uint32_t u32PNum, - uint32_t u32QNum, uint32_t u32CpNum, uint32_t u32CqNum, uint32_t u32DpNum, - uint32_t u32DqNum, uint32_t u32RpNum, uint32_t u32RqNum) -{ - if(s_pRSABuf == 0) - { - return (-1); - } - Hex2Reg(Src, ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaM); - Hex2Reg(n, ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaN); - - /* Assign the data to DMA */ - crpt->RSA_SADDR[0] = (uint32_t) & ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaM; /* plaintext / encrypt data */ - crpt->RSA_SADDR[1] = (uint32_t) & ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaN; /* the base of modulus operation */ - crpt->RSA_DADDR = (uint32_t) & ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaOutput; /* encrypt data / decrypt data */ - - if((s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) || (s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk)) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - crpt->RSA_KSSTS[0] = (crpt->RSA_KSSTS[0] & (~(CRPT_RSA_KSSTS0_NUM0_Msk | CRPT_RSA_KSSTS0_NUM1_Msk))) | \ - (u32PNum << CRPT_RSA_KSSTS0_NUM0_Pos) | (u32QNum << CRPT_RSA_KSSTS0_NUM1_Pos); - - } - if(s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) - { - /* For RSA CRT mode, Cp, Cq, Dp, Dq, Rp, Rq */ - crpt->RSA_KSSTS[0] = (crpt->RSA_KSSTS[0] & (~(CRPT_RSA_KSSTS0_NUM2_Msk | CRPT_RSA_KSSTS0_NUM3_Msk))) | \ - (u32CpNum << CRPT_RSA_KSSTS0_NUM2_Pos) | (u32CqNum << CRPT_RSA_KSSTS0_NUM3_Pos); - crpt->RSA_KSSTS[1] = (u32DpNum << CRPT_RSA_KSSTS1_NUM4_Pos) | (u32DqNum << CRPT_RSA_KSSTS1_NUM5_Pos) | \ - (u32RpNum << CRPT_RSA_KSSTS1_NUM6_Pos) | (u32RqNum << CRPT_RSA_KSSTS1_NUM7_Pos); - } - - return 0; -} - - -/**@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRYPTO_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dac.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dac.c deleted file mode 100644 index 0f12b935bc3..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dac.c +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************//** - * @file dac.c - * @version V1.00 - * @brief M2354 series DAC driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DAC_Driver DAC Driver - @{ -*/ - -/** @addtogroup DAC_EXPORTED_FUNCTIONS DAC Exported Functions - @{ -*/ - -/** - * @brief This function make DAC module be ready to convert. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2354 Series DAC. - * @param[in] u32TrgSrc Decides the trigger source. Valid values are: - * - \ref DAC_WRITE_DAT_TRIGGER :Write DAC_DAT trigger - * - \ref DAC_SOFTWARE_TRIGGER :Software trigger - * - \ref DAC_LOW_LEVEL_TRIGGER :STDAC pin low level trigger - * - \ref DAC_HIGH_LEVEL_TRIGGER :STDAC pin high level trigger - * - \ref DAC_FALLING_EDGE_TRIGGER :STDAC pin falling edge trigger - * - \ref DAC_RISING_EDGE_TRIGGER :STDAC pin rising edge trigger - * - \ref DAC_TIMER0_TRIGGER :Timer 0 trigger - * - \ref DAC_TIMER1_TRIGGER :Timer 1 trigger - * - \ref DAC_TIMER2_TRIGGER :Timer 2 trigger - * - \ref DAC_TIMER3_TRIGGER :Timer 3 trigger - * - \ref DAC_EPWM0_TRIGGER :EPWM0 trigger - * - \ref DAC_EPWM1_TRIGGER :EPWM1 trigger - * @return None - * @details The DAC conversion can be started by writing DAC_DAT, software trigger or hardware trigger. - * When TRGEN (DAC_CTL[4]) is 0, the data conversion is started by writing DAC_DAT register. - * When TRGEN (DAC_CTL[4]) is 1, the data conversion is started by SWTRG (DAC_SWTRG[0]) is set to 1, - * external STDAC pin, timer event, or EPWM event. - */ -void DAC_Open(DAC_T *dac, - uint32_t u32Ch, - uint32_t u32TrgSrc) -{ - (void)u32Ch; - dac->CTL &= ~(DAC_CTL_ETRGSEL_Msk | DAC_CTL_TRGSEL_Msk | DAC_CTL_TRGEN_Msk); - - dac->CTL |= (u32TrgSrc | DAC_CTL_DACEN_Msk); -} - -/** - * @brief Disable DAC analog power. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used in M2354 Series DAC. - * @return None - * @details Disable DAC analog power for saving power consumption. - */ -void DAC_Close(DAC_T *dac, uint32_t u32Ch) -{ - (void)u32Ch; - dac->CTL &= (~DAC_CTL_DACEN_Msk); -} - -/** - * @brief Set delay time for DAC to become stable. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Delay Decides the DAC conversion settling time, the range is from 0~(1023/PCLK1*1000000) micro seconds. - * @return Real DAC conversion settling time (micro second). - * @details For example, DAC controller clock speed is 64MHz and DAC conversion setting time is 1 us, SETTLET (DAC_TCTL[9:0]) value must be greater than 0x40. - * @note User needs to write appropriate value to meet DAC conversion settling time base on PCLK (APB clock) speed. - */ -uint32_t DAC_SetDelayTime(DAC_T *dac, uint32_t u32Delay) -{ - - dac->TCTL = ((CLK_GetPCLK1Freq() * u32Delay / 1000000UL) & 0x3FFUL); - - return ((dac->TCTL) * 1000000UL / CLK_GetPCLK1Freq()); -} - - - -/**@}*/ /* end of group DAC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group DAC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dpm.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dpm.c deleted file mode 100644 index 568140e1aae..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_dpm.c +++ /dev/null @@ -1,409 +0,0 @@ -/**************************************************************************//** - * @file dpm.c - * @version V3.00 - * @brief Debug Protection Mechanism (DPM) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DPM_Driver DPM Driver - @{ -*/ - -/** @addtogroup DPM_EXPORTED_FUNCTIONS DPM Exported Functions - @{ -*/ - -/** - * @brief Set Debug Disable - * @param[in] u32dpm The pointer of the specified DPM module - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @return None - * @details This macro sets Secure or Non-secure DPM debug disable. - * The debug disable function works after reset (chip reset or pin reset). - */ -void DPM_SetDebugDisable(uint32_t u32dpm) -{ - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->CTL = (DPM->CTL & (~DPM_CTL_WVCODE_Msk)) | (DPM_CTL_WVCODE | DPM_CTL_DBGDIS_Msk); - } - else /* Non-secure DPM */ - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSCTL = (dpm->NSCTL & (~DPM_NSCTL_WVCODE_Msk)) | (DPM_NSCTL_WVCODE | DPM_NSCTL_DBGDIS_Msk); - } -} - -/** - * @brief Set Debug Lock - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @return None - * @details This macro sets Secure or Non-secure DPM debug lock. - * The debug lock function works after reset (chip reset or pin reset). - */ -void DPM_SetDebugLock(uint32_t u32dpm) -{ - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->CTL = (dpm->CTL & (~DPM_CTL_WVCODE_Msk)) | (DPM_CTL_WVCODE | DPM_CTL_LOCK_Msk); - } - else /* Non-secure DPM */ - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSCTL = (dpm->NSCTL & (~DPM_NSCTL_WVCODE_Msk)) | (DPM_NSCTL_WVCODE | DPM_NSCTL_LOCK_Msk); - } -} - -/** - * @brief Get Debug Disable - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @retval 0 Debug is not in disable status - * @retval 1 Debug is in disable status - * @details This macro gets Secure or Non-secure DPM debug disable status. - * If Secure debug is disabled, debugger cannot access Secure region and can access Non-secure region only. - * If Non-secure debug is disabled, debugger cannot access all Secure and Non-secure region. - */ -uint32_t DPM_GetDebugDisable(uint32_t u32dpm) -{ - uint32_t u32RetVal = 0; - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - while(dpm->STS & DPM_STS_BUSY_Msk); - u32RetVal = (dpm->STS & DPM_STS_DBGDIS_Msk) >> DPM_STS_DBGDIS_Pos; - } - else /* Non-secure DPM */ - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - u32RetVal = (dpm->NSSTS & DPM_NSSTS_DBGDIS_Msk) >> DPM_NSSTS_DBGDIS_Pos; - } - - return u32RetVal; -} - -/** - * @brief Get Debug Lock - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @retval 0 Debug is not in lock status - * @retval 1 Debug is in lock status - * @details This macro gets Secure or Non-secure DPM debug disable status. - * If Secure debug is locked, debugger cannot access Secure region and can access Non-secure region only. - * If Non-secure debug is locked, debugger cannot access all Secure and Non-secure region. - */ -uint32_t DPM_GetDebugLock(uint32_t u32dpm) -{ - uint32_t u32RetVal = 0; - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - while(dpm->STS & DPM_STS_BUSY_Msk); - u32RetVal = (dpm->STS & DPM_STS_LOCK_Msk) >> DPM_STS_LOCK_Pos; - } - else /* Non-secure DPM */ - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - u32RetVal = (dpm->NSSTS & DPM_NSSTS_LOCK_Msk) >> DPM_NSSTS_LOCK_Pos; - } - - return u32RetVal; -} - -/** - * @brief Update DPM Password - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @param[in] au32Password Password length is 256 bits. - * @retval 0 No password is updated. The password update count has reached the maximum value. - * @retval 1 Password update is successful. - * @details This macro updates Secure or Non-secure DPM password. - */ -uint32_t DPM_SetPasswordUpdate(uint32_t u32dpm, uint32_t au32Pwd[]) -{ - uint32_t u32i, u32RetVal = 0; - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - /* Set Secure DPM password */ - for(u32i = 0; u32i < 4; u32i++) - { - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->SPW[u32i] = au32Pwd[u32i]; - } - - /* Set Secure DPM password update */ - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->CTL = (dpm->CTL & (~DPM_CTL_WVCODE_Msk)) | (DPM_CTL_WVCODE | DPM_CTL_PWUPD_Msk); - - /* Check Secure DPM password update flag */ - while(dpm->STS & DPM_STS_BUSY_Msk); - u32RetVal = (dpm->STS & DPM_STS_PWUOK_Msk) >> DPM_STS_PWUOK_Pos; - - /* Clear Secure DPM password update flag */ - if(u32RetVal) dpm->STS = DPM_STS_PWUOK_Msk; - } - else /* Non-secure DPM */ - { - /* Set Non-secure DPM password */ - for(u32i = 0; u32i < 4; u32i++) - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSPW[u32i] = au32Pwd[u32i]; - } - - /* Set Non-secure DPM password update */ - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSCTL = (dpm->NSCTL & (~DPM_CTL_WVCODE_Msk)) | (DPM_CTL_WVCODE | DPM_NSCTL_PWUPD_Msk); - - /* Check Non-secure DPM password update flag */ - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - u32RetVal = (dpm->NSSTS & DPM_NSSTS_PWUOK_Msk) >> DPM_NSSTS_PWUOK_Pos; - - /* Clear Non-secure DPM password update flag */ - if(u32RetVal) dpm->NSSTS = DPM_NSSTS_PWUOK_Msk; - } - - return u32RetVal; -} - -/** - * @brief Compare DPM Password - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @retval 0 The password comparison can be proccessed. - * @retval 1 No more password comparison can be proccessed. \n - * The password comparison fail times has reached the maximum value. - * @details This macro sets Secure or Non-secure DPM password comparison. \n - * The comparison result is checked by DPM_GetPasswordErrorFlag(). - */ -uint32_t DPM_SetPasswordCompare(uint32_t u32dpm, uint32_t au32Pwd[]) -{ - uint32_t u32i, u32RetVal = 0; - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - /* Check Secure DPM password compare fail times maximum flag */ - while(dpm->STS & DPM_STS_BUSY_Msk); - if(dpm->STS & DPM_STS_PWFMAX_Msk) - { - u32RetVal = 1; - } - else - { - /* Set Secure DPM password */ - for(u32i = 0; u32i < 4; u32i++) - { - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->SPW[u32i] = au32Pwd[u32i]; - } - - /* Set Secure DPM password cpmpare */ - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->CTL = (dpm->CTL & (~DPM_CTL_WVCODE_Msk)) | (DPM_CTL_WVCODE | DPM_CTL_PWCMP_Msk); - } - } - else /* Non-secure DPM */ - { - /* Check Non-secure DPM password compare fail times maximum flag */ - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - if(dpm->NSSTS & DPM_NSSTS_PWFMAX_Msk) - { - u32RetVal = 1; - } - else - { - /* Set Non-secure DPM password */ - for(u32i = 0; u32i < 4; u32i++) - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSPW[u32i] = au32Pwd[u32i]; - } - - /* Set Non-secure DPM password compare */ - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSCTL = (dpm->NSCTL & (~DPM_NSCTL_WVCODE_Msk)) | (DPM_NSCTL_WVCODE | DPM_NSCTL_PWCMP_Msk); - } - } - - return u32RetVal; -} - -/** - * @brief Get DPM Password Error Flag - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @return Specified DPM module password compare error flag. - * @details This macro returns Secure or Non-secure DPM password compare error flag. - */ -uint32_t DPM_GetPasswordErrorFlag(uint32_t u32dpm) -{ - uint32_t u32RetVal = 0; - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - /* Check Secure DPM password compare error flag */ - while(dpm->STS & DPM_STS_BUSY_Msk); - u32RetVal = (dpm->STS & DPM_STS_PWCERR_Msk) >> DPM_STS_PWCERR_Pos; - } - else /* Non-secure DPM */ - { - /* Check Non-secure DPM password compare error flag */ - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - u32RetVal = (dpm->NSSTS & DPM_NSSTS_PWCERR_Msk) >> DPM_NSSTS_PWCERR_Pos; - } - - return u32RetVal; -} - -/** - * @brief Get DPM Interrupt Flag - * @param None - * @return Secure DPM interrupt flag. - * @details This macro returns Secure DPM interrupt flag. - * Secure DPM interrupt flag includes Secure and Non-secure DPM password compare error flag. - * This macro is for Secure DPM and Secure region only. - */ -uint32_t DPM_GetIntFlag(void) -{ - while(DPM->STS & DPM_STS_BUSY_Msk); - return (DPM->STS & DPM_STS_INT_Msk) >> DPM_STS_INT_Pos; -} - - -/** - * @brief Clear DPM Password Error Flag - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @return Specified DPM module interrupt flag. - * @details This macro clears Secure or Non-secure DPM password compare error flag. - */ -void DPM_ClearPasswordErrorFlag(uint32_t u32dpm) -{ - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->STS = DPM_STS_PWCERR_Msk; - } - else /* Non-secure DPM */ - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSSTS = DPM_NSSTS_PWCERR_Msk; - } -} - -/** - * @brief Enable Debugger Write Access - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @return None. - * @details This macro enables external debugger to write Secure or Non-secure DPM registers. - */ -void DPM_EnableDebuggerWriteAccess(uint32_t u32dpm) -{ - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->CTL = (dpm->CTL & (~(DPM_CTL_RVCODE_Msk | DPM_CTL_DACCWDIS_Msk))) | DPM_CTL_WVCODE; - } - else /* Non-secure DPM */ - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSCTL = (dpm->NSCTL & (~(DPM_NSCTL_RVCODE_Msk | DPM_NSCTL_DACCWDIS_Msk))) | DPM_NSCTL_WVCODE; - } -} - -/** - * @brief Disable Debugger Write Access - * @param[in] u32dpm Select DPM module. Valid values are: - * - \ref SECURE_DPM - * - \ref NONSECURE_DPM - * @return None. - * @details This macro disables external debugger to write Secure or Non-secure DPM registers. - */ -void DPM_DisableDebuggerWriteAccess(uint32_t u32dpm) -{ - DPM_T *dpm; - - if(__PC()&NS_OFFSET) dpm = DPM_NS; - else dpm = DPM; - - if(u32dpm == SECURE_DPM) /* Secure DPM */ - { - while(dpm->STS & DPM_STS_BUSY_Msk); - dpm->CTL = (dpm->CTL & (~DPM_CTL_RVCODE_Msk)) | (DPM_CTL_WVCODE | DPM_CTL_DACCWDIS_Msk); - } - else /* Non-secure DPM */ - { - while(dpm->NSSTS & DPM_NSSTS_BUSY_Msk); - dpm->NSCTL = (dpm->NSCTL & (~DPM_NSCTL_RVCODE_Msk)) | (DPM_NSCTL_WVCODE | DPM_NSCTL_DACCWDIS_Msk); - } -} - - -/**@}*/ /* end of group DPM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group DPM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_eadc.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_eadc.c deleted file mode 100644 index dcdc816327c..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_eadc.c +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************//** - * @file eadc.c - * @version V2.00 - * @brief M2354 series EADC driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_FUNCTIONS EADC Exported Functions - @{ -*/ - -/** - * @brief This function make EADC_module be ready to convert. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32InputMode Decides the input mode. - * - \ref EADC_CTL_DIFFEN_SINGLE_END :Single end input mode. - * - \ref EADC_CTL_DIFFEN_DIFFERENTIAL :Differential input type. - * @return None - * @details This function is used to set analog input mode and enable A/D Converter. - * Before starting A/D conversion function, ADCEN bit (EADC_CTL[0]) should be set to 1. - * @note - */ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode) -{ - eadc->CTL &= (~(EADC_CTL_DIFFEN_Msk)); - - eadc->CTL |= (u32InputMode | EADC_CTL_ADCEN_Msk); - - while(!(eadc->PWRM & EADC_PWRM_PWUPRDY_Msk)) {} -} - -/** - * @brief Disable EADC_module. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details Clear ADCEN bit (EADC_CTL[0]) to disable A/D converter analog circuit power consumption. - */ -void EADC_Close(EADC_T *eadc) -{ - eadc->CTL &= ~EADC_CTL_ADCEN_Msk; -} - -/** - * @brief Configure the sample control logic module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerSrc Decides the trigger source. Valid values are: - * - \ref EADC_SOFTWARE_TRIGGER : Disable trigger - * - \ref EADC_FALLING_EDGE_TRIGGER : STADC pin falling edge trigger - * - \ref EADC_RISING_EDGE_TRIGGER : STADC pin rising edge trigger - * - \ref EADC_FALLING_RISING_EDGE_TRIGGER : STADC pin both falling and rising edge trigger - * - \ref EADC_ADINT0_TRIGGER : ADC ADINT0 interrupt EOC pulse trigger - * - \ref EADC_ADINT1_TRIGGER : ADC ADINT1 interrupt EOC pulse trigger - * - \ref EADC_TIMER0_TRIGGER : Timer0 overflow pulse trigger - * - \ref EADC_TIMER1_TRIGGER : Timer1 overflow pulse trigger - * - \ref EADC_TIMER2_TRIGGER : Timer2 overflow pulse trigger - * - \ref EADC_TIMER3_TRIGGER : Timer3 overflow pulse trigger - * - \ref EADC_PWM0TG0_TRIGGER : EPWM0TG0 trigger - * - \ref EADC_PWM0TG1_TRIGGER : EPWM0TG1 trigger - * - \ref EADC_PWM0TG2_TRIGGER : EPWM0TG2 trigger - * - \ref EADC_PWM0TG3_TRIGGER : EPWM0TG3 trigger - * - \ref EADC_PWM0TG4_TRIGGER : EPWM0TG4 trigger - * - \ref EADC_PWM0TG5_TRIGGER : EPWM0TG5 trigger - * - \ref EADC_PWM1TG0_TRIGGER : EPWM1TG0 trigger - * - \ref EADC_PWM1TG1_TRIGGER : EPWM1TG1 trigger - * - \ref EADC_PWM1TG2_TRIGGER : EPWM1TG2 trigger - * - \ref EADC_PWM1TG3_TRIGGER : EPWM1TG3 trigger - * - \ref EADC_PWM1TG4_TRIGGER : EPWM1TG4 trigger - * - \ref EADC_PWM1TG5_TRIGGER : EPWM1TG5 trigger - * - \ref EADC_BPWM0TG_TRIGGER : BPWM0TG trigger - * - \ref EADC_BPWM1TG_TRIGGER : BPWM1TG trigger - * @param[in] u32Channel Specifies the sample module channel, valid value are from 0 to 15. - * @return None - * @details Each of ADC control logic modules 0~15 which is configurable for ADC converter channel EADC_CH0~15 and trigger source. - * sample module 16~18 is fixed for ADC channel 16, 17, 18 input sources as band-gap voltage, temperature sensor, and battery power (VBAT). - */ -void EADC_ConfigSampleModule(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerSrc, \ - uint32_t u32Channel) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_EXTFEN_Msk | EADC_SCTL_EXTREN_Msk | EADC_SCTL_TRGSEL_Msk | EADC_SCTL_CHSEL_Msk); - eadc->SCTL[u32ModuleNum] |= (u32TriggerSrc | u32Channel); -} - - -/** - * @brief Set trigger delay time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerDelayTime Decides the trigger delay time, valid range are between 0~0xFF. - * @param[in] u32DelayClockDivider Decides the trigger delay clock divider. Valid values are: - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_1 : Trigger delay clock frequency is ADC_CLK/1 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_2 : Trigger delay clock frequency is ADC_CLK/2 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_4 : Trigger delay clock frequency is ADC_CLK/4 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_16 : Trigger delay clock frequency is ADC_CLK/16 - * @return None - * @details User can configure the trigger delay time by setting TRGDLYCNT (EADC_SCTLn[15:8], n=0~15) and TRGDLYDIV (EADC_SCTLn[7:6], n=0~15). - * Trigger delay time = (u32TriggerDelayTime) x Trigger delay clock period. - */ -void EADC_SetTriggerDelayTime(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerDelayTime, \ - uint32_t u32DelayClockDivider) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_TRGDLYDIV_Msk | EADC_SCTL_TRGDLYCNT_Msk); - eadc->SCTL[u32ModuleNum] |= ((u32TriggerDelayTime << EADC_SCTL_TRGDLYCNT_Pos) | u32DelayClockDivider); -} - -/** - * @brief Set ADC extend sample time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @param[in] u32ExtendSampleTime Decides the extend sampling time, the range is from 0~255 ADC clock. Valid value are from 0 to 0xFF. - * @return None - * @details When A/D converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, - * user can extend A/D sampling time after trigger source is coming to get enough sampling time. - */ -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime) -{ - eadc->SCTL[u32ModuleNum] &= ~EADC_SCTL_EXTSMPT_Msk; - - eadc->SCTL[u32ModuleNum] |= (u32ExtendSampleTime << EADC_SCTL_EXTSMPT_Pos); - -} - -/**@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EADC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ebi.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ebi.c deleted file mode 100644 index e6dd92cfbe0..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ebi.c +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************//** - * @file ebi.c - * @version V3.00 - * @brief External Bus Interface(EBI) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Initialize EBI for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32DataWidth Data bus width. Valid values are: - * - \ref EBI_BUSWIDTH_8BIT - * - \ref EBI_BUSWIDTH_16BIT - * @param[in] u32TimingClass Default timing configuration. Valid values are: - * - \ref EBI_TIMING_FASTEST - * - \ref EBI_TIMING_VERYFAST - * - \ref EBI_TIMING_FAST - * - \ref EBI_TIMING_NORMAL - * - \ref EBI_TIMING_SLOW - * - \ref EBI_TIMING_VERYSLOW - * - \ref EBI_TIMING_SLOWEST - * @param[in] u32BusMode Set EBI bus operate mode. Valid values are: - * - \ref EBI_OPMODE_NORMAL - * - \ref EBI_OPMODE_CACCESS - * - \ref EBI_OPMODE_ADSEPARATE - * @param[in] u32CSActiveLevel CS is active High/Low. Valid values are: - * - \ref EBI_CS_ACTIVE_HIGH - * - \ref EBI_CS_ACTIVE_LOW - * - * @return None - * - * @details This function is used to open specify EBI bank with different bus width, timing setting and \n - * active level of CS pin to access EBI device. - * @note Write Buffer Enable(WBUFEN) and Extend Time Of ALE(TALE) are only available in EBI bank0 control register. - */ -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (u32Bank * 0x10UL); - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (u32Bank * 0x10UL); - volatile uint32_t *pu32EBICTL, *pu32EBITCTL; - uint32_t pu32Index0, pu32Index1; - - if((__PC()&NS_OFFSET) == NS_OFFSET) - { - pu32Index0 = (u32Index0 | NS_OFFSET); - pu32Index1 = (u32Index1 | NS_OFFSET); - } - else - { - pu32Index0 = u32Index0; - pu32Index1 = u32Index1; - } - - pu32EBICTL = (uint32_t *)(pu32Index0); - pu32EBITCTL = (uint32_t *)(pu32Index1); - - if(u32DataWidth == EBI_BUSWIDTH_8BIT) - { - *pu32EBICTL &= ~EBI_CTL_DW16_Msk; - } - else - { - *pu32EBICTL |= EBI_CTL_DW16_Msk; - } - - *pu32EBICTL |= u32BusMode; - - switch(u32TimingClass) - { - case EBI_TIMING_FASTEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0UL; - break; - - case EBI_TIMING_VERYFAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318UL; - break; - - case EBI_TIMING_FAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0UL; - break; - - case EBI_TIMING_NORMAL: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318UL; - break; - - case EBI_TIMING_SLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738UL; - break; - - case EBI_TIMING_VERYSLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_4 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738UL; - break; - - case EBI_TIMING_SLOWEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_8 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738UL; - break; - - default: - *pu32EBICTL &= ~EBI_CTL_EN_Msk; - break; - } -} - -/** - * @brief Disable EBI on specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * - * @return None - * - * @details This function is used to close specify EBI function. - */ -void EBI_Close(uint32_t u32Bank) -{ - uint32_t u32Index = (uint32_t)&EBI->CTL0 + (u32Bank * 0x10UL); - volatile uint32_t *pu32EBICTL; - uint32_t pu32Index; - - if((__PC()&NS_OFFSET) == NS_OFFSET) - { - pu32Index = (u32Index | NS_OFFSET); - } - else - { - pu32Index = u32Index; - } - - pu32EBICTL = (uint32_t *)(pu32Index); - - *pu32EBICTL &= ~EBI_CTL_EN_Msk; -} - -/** - * @brief Set EBI Bus Timing for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32TimingConfig Configure EBI timing settings, includes TACC, TAHD, W2X and R2R setting. - * @param[in] u32MclkDiv Divider for MCLK. Valid values are: - * - \ref EBI_MCLKDIV_1 - * - \ref EBI_MCLKDIV_2 - * - \ref EBI_MCLKDIV_4 - * - \ref EBI_MCLKDIV_8 - * - \ref EBI_MCLKDIV_16 - * - \ref EBI_MCLKDIV_32 - * - \ref EBI_MCLKDIV_64 - * - \ref EBI_MCLKDIV_128 - * - * @return None - * - * @details This function is used to configure specify EBI bus timing for access EBI device. - */ -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (u32Bank * 0x10UL); - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (u32Bank * 0x10UL); - volatile uint32_t *pu32EBICTL, *pu32EBITCTL; - uint32_t pu32Index0, pu32Index1; - - if((__PC()&NS_OFFSET) == NS_OFFSET) - { - pu32Index0 = (u32Index0 | NS_OFFSET); - pu32Index1 = (u32Index1 | NS_OFFSET); - } - else - { - pu32Index0 = u32Index0; - pu32Index1 = u32Index1; - } - - pu32EBICTL = (uint32_t *)(pu32Index0); - pu32EBITCTL = (uint32_t *)(pu32Index1); - - *pu32EBICTL = (*pu32EBICTL & ~EBI_CTL_MCLKDIV_Msk) | (u32MclkDiv << EBI_CTL_MCLKDIV_Pos); - *pu32EBITCTL = u32TimingConfig; -} - -/**@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EBI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ecap.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ecap.c deleted file mode 100644 index 1a9d31618eb..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ecap.c +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************//** - * @file ecap.c - * @version V3.00 - - * @brief Enhanced Input Capture Timer (ECAP) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_FUNCTIONS ECAP Exported Functions - @{ -*/ - -/** - * @brief Enable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @param[in] u32FuncMask Input capture function select - * - \ref ECAP_DISABLE_COMPARE - * - \ref ECAP_COMPARE_FUNCTION - * @return None - * @details This macro enable input capture function and select compare and reload function. - */ -void ECAP_Open(ECAP_T* ecap, uint32_t u32FuncMask) -{ - /* Clear Input capture mode*/ - ecap->CTL0 = ecap->CTL0 & ~(ECAP_CTL0_CMPEN_Msk); - - /* Enable Input Capture and set mode */ - ecap->CTL0 |= ECAP_CTL0_CAPEN_Msk | (u32FuncMask); -} - - - -/** - * @brief Disable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @return None - * @details This macro disable input capture function. - */ -void ECAP_Close(ECAP_T* ecap) -{ - /* Disable Input Capture*/ - ecap->CTL0 &= ~ECAP_CTL0_CAPEN_Msk; -} - -/** - * @brief This macro is used to enable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel Mask - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will enable the input channel_n interrupt. - */ -void ECAP_EnableINT(ECAP_T* ecap, uint32_t u32Mask) -{ - /* Enable input channel interrupt */ - ecap->CTL0 |= (u32Mask); - - /* Enable NVIC ECAP IRQ */ - if((ecap == ECAP0) || (ecap == ECAP0_NS)) - { - NVIC_EnableIRQ(ECAP0_IRQn); - } - else - { - NVIC_EnableIRQ(ECAP1_IRQn); - } -} - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel number - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will disable the input channel_n interrupt. - */ -void ECAP_DisableINT(ECAP_T* ecap, uint32_t u32Mask) -{ - /* Disable input channel interrupt */ - (ecap->CTL0) &= ~(u32Mask); - - /* Disable NVIC ECAP IRQ */ - if((ecap == ECAP0) || (ecap == ECAP0_NS)) - { - NVIC_DisableIRQ(ECAP0_IRQn); - } - else - { - NVIC_DisableIRQ(ECAP1_IRQn); - } -} - -/**@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group ECAP_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_epwm.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_epwm.c deleted file mode 100644 index e9050e1de7b..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_epwm.c +++ /dev/null @@ -1,1659 +0,0 @@ -/**************************************************************************//** - * @file epwm.c - * @version V3.00 - * @brief M2354 series EPWM driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - - -/** @addtogroup EPWM_EXPORTED_FUNCTIONS EPWM Exported Functions - @{ -*/ - -/** - * @brief Configure EPWM capture and get the nearest unit time. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure EPWM capture and get the nearest unit time. - */ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32PWMClockSrc; - uint32_t u32NearestUnitTimeNsec = 0; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - uint8_t u8BreakLoop = 0U; - - (void)u32CaptureEdge; - - /* clock source is from PCLK */ - if((epwm == EPWM0) || (epwm == EPWM0_NS)) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* if((epwm == EPWM1)||(epwm == EPWM1_NS)) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - - u32PWMClockSrc /= 1000UL; - for(u32Prescale = 1U; u32Prescale <= 0x1000U; u32Prescale++) - { - u32NearestUnitTimeNsec = (1000000UL * u32Prescale) / u32PWMClockSrc; - if(u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if(u32Prescale == 0x1000U) /* limit to the maximum unit time(nano second) */ - { - u8BreakLoop = 1U; - } - if(!((1000000UL * (u32Prescale + 1UL) > (u32NearestUnitTimeNsec * u32PWMClockSrc)))) - { - u8BreakLoop = 1U; - } - } - else - { - u8BreakLoop = 1U; - } - if(u8BreakLoop) - { - break; - } - } - - /* convert to real register value */ - u32Prescale = u32Prescale - 1U; - /* every two channels share a prescaler */ - EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescale); - - /* set EPWM to down count type(edge aligned) */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~(EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1))) | (1UL << (u32ChannelNum << 1)); - /* set EPWM to auto-reload mode */ - (epwm)->CTL1 &= ~(EPWM_CTL1_CNTMODE0_Msk << u32ChannelNum); - EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure EPWM generator and get the nearest frequency in edge aligned(up counter type) auto-reload mode - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since every two channels, (0 & 1), (2 & 3), shares a prescaler. Call this API to configure EPWM frequency may affect - * existing frequency of other channel. - * @note This function is used for initial stage. - * To change duty cycle later, it should get the configured period value and calculate the new comparator value. - */ -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32PWMClockSrc; - uint32_t i; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - /* clock source is from PCLK */ - if((epwm == EPWM0) || (epwm == EPWM0_NS)) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* if((epwm == EPWM1)||(epwm == EPWM1_NS)) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - - for(u32Prescale = 1U; u32Prescale < 0xFFFU; u32Prescale++)/* prescale could be 0~0xFFF */ - { - i = (u32PWMClockSrc / u32Frequency) / u32Prescale; - /* If target value is larger than CNR, need to use a larger prescaler */ - if(i <= (0x10000U)) - { - u32CNR = i; - break; - } - } - /* Store return value here 'cos we're gonna change u32Prescale & u32CNR to the real value to fill into register */ - i = u32PWMClockSrc / (u32Prescale * u32CNR); - - /* convert to real register value */ - u32Prescale = u32Prescale - 1U; - /* every two channels share a prescaler */ - EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescale); - /* set EPWM to up counter type(edge aligned) and auto-reload mode */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~((EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1)) | (EPWM_CTL1_CNTMODE0_Msk << u32ChannelNum))); - - u32CNR = u32CNR - 1U; - EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR); - EPWM_SET_CMR(epwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1UL) / 100UL); - - (epwm)->WGCTL0 = ((epwm)->WGCTL0 & ~((EPWM_WGCTL0_PRDPCTL0_Msk | EPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1))) | \ - (EPWM_OUTPUT_HIGH << (u32ChannelNum << 1UL << EPWM_WGCTL0_ZPCTL0_Pos)); - (epwm)->WGCTL1 = ((epwm)->WGCTL1 & ~((EPWM_WGCTL1_CMPDCTL0_Msk | EPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1))) | \ - (EPWM_OUTPUT_LOW << (u32ChannelNum << 1UL << EPWM_WGCTL1_CMPUCTL0_Pos)); - - return(i); -} - -/** - * @brief Start EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to start EPWM module. - */ -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN |= u32ChannelMask; -} - -/** - * @brief Stop EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM module. - */ -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for(i = 0UL; i < EPWM_CHANNEL_NUM; i ++) - { - if(u32ChannelMask & (1UL << i)) - { - (epwm)->PERIOD[i] = 0UL; - } - } -} - -/** - * @brief Stop EPWM generation immediately by clear channel enable bit - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM generation immediately by clear channel enable bit. - */ -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN &= ~u32ChannelMask; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref EPWM_TRG_ADC_EVEN_ZERO - * - \ref EPWM_TRG_ADC_EVEN_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_UP - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_ODD_ZERO - * - \ref EPWM_TRG_ADC_ODD_PERIOD - * - \ref EPWM_TRG_ADC_ODD_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_ODD_COMPARE_UP - * - \ref EPWM_TRG_ADC_ODD_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_DOWN - * @return None - * @details This function is used to enable selected channel to trigger ADC. - */ -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if(u32ChannelNum < 4UL) - { - (epwm)->EADCTS0 &= ~((EPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3)); - (epwm)->EADCTS0 |= ((EPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCTS1 &= ~((EPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4UL) << 3)); - (epwm)->EADCTS1 |= ((EPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4UL) << 3)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger ADC. - */ -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - if(u32ChannelNum < 4UL) - { - (epwm)->EADCTS0 &= ~(EPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCTS1 &= ~(EPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4UL) << 3)); - } -} - -/** - * @brief Enable and configure trigger ADC prescale - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32Prescale ADC prescale. Valid values are between 0 to 0xF. - * @param[in] u32PrescaleCnt ADC prescale counter. Valid values are between 0 to 0xF. - * @retval 0 Success. - * @retval -1 Failed. - * @details This function is used to enable and configure trigger ADC prescale. - * @note User can configure only when ADC trigger prescale is disabled. - * @note ADC prescale counter must less than ADC prescale. - */ -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt) -{ - /* User can write only when PSCENn(n = 0 ~ 5) is 0 */ - if((epwm)->EADCPSCCTL & (1UL << u32ChannelNum)) - return (-1); - - if(u32ChannelNum < 4UL) - { - (epwm)->EADCPSC0 = ((epwm)->EADCPSC0 & ~((EPWM_EADCPSC0_EADCPSC0_Msk) << (u32ChannelNum << 3))) | \ - (u32Prescale << (u32ChannelNum << 3)); - (epwm)->EADCPSCNT0 = ((epwm)->EADCPSCNT0 & ~((EPWM_EADCPSCNT0_PSCNT0_Msk) << (u32ChannelNum << 3))) | \ - (u32PrescaleCnt << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCPSC1 = ((epwm)->EADCPSC1 & ~((EPWM_EADCPSC1_EADCPSC4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32Prescale << ((u32ChannelNum - 4UL) << 3)); - (epwm)->EADCPSCNT1 = ((epwm)->EADCPSCNT1 & ~((EPWM_EADCPSCNT1_PSCNT4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32PrescaleCnt << ((u32ChannelNum - 4UL) << 3)); - } - - (epwm)->EADCPSCCTL |= EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum; - - return 0; -} - -/** - * @brief Disable Trigger ADC prescale function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable trigger ADC prescale. - */ -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->EADCPSCCTL &= ~(EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum); -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag. - */ -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (void)u32Condition; - (epwm)->STATUS = (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get EPWM trigger ADC to start of conversion flag for specified channel. - */ -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Enable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger DAC. Combination of following conditions: - * - \ref EPWM_TRIGGER_DAC_ZERO - * - \ref EPWM_TRIGGER_DAC_PERIOD - * - \ref EPWM_TRIGGER_DAC_COMPARE_UP - * - \ref EPWM_TRIGGER_DAC_COMPARE_DOWN - * @return None - * @details This function is used to enable selected channel to trigger DAC. - */ -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->DACTRGEN |= (u32Condition << u32ChannelNum); -} - -/** - * @brief Disable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger DAC. - */ -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->DACTRGEN &= ~((EPWM_TRIGGER_DAC_ZERO | EPWM_TRIGGER_DAC_PERIOD | EPWM_TRIGGER_DAC_COMPARE_UP | EPWM_TRIGGER_DAC_COMPARE_DOWN) << u32ChannelNum); -} - -/** - * @brief Clear selected channel trigger DAC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. This parameter is not used - * @param[in] u32Condition The condition to trigger DAC. This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger DAC flag. - */ -void EPWM_ClearDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (void)u32ChannelNum; - (void)u32Condition; - (epwm)->STATUS = EPWM_STATUS_DACTRGF_Msk; -} - -/** - * @brief Get selected channel trigger DAC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. This parameter is not used - * @retval 0 The specified channel trigger DAC to start of conversion flag is not set - * @retval 1 The specified channel trigger DAC to start of conversion flag is set - * @details This function is used to get selected channel trigger DAC flag. - */ -uint32_t EPWM_GetDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - return (((epwm)->STATUS & EPWM_STATUS_DACTRGF_Msk) ? 1UL : 0UL); -} - -/** - * @brief This function enable fault brake of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * @param[in] u32LevelMask Output high or low while fault brake occurs, each bit represent the level of a channel - * while fault brake occurs. Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32BrakeSource Fault brake source, could be one of following source - * - \ref EPWM_FB_EDGE_ADCRM - * - \ref EPWM_FB_EDGE_ACMP0 - * - \ref EPWM_FB_EDGE_ACMP1 - * - \ref EPWM_FB_EDGE_BKP0 - * - \ref EPWM_FB_EDGE_BKP1 - * - \ref EPWM_FB_EDGE_SYS_CSS - * - \ref EPWM_FB_EDGE_SYS_BOD - * - \ref EPWM_FB_EDGE_SYS_RAM - * - \ref EPWM_FB_EDGE_SYS_COR - * - \ref EPWM_FB_LEVEL_ADCRM - * - \ref EPWM_FB_LEVEL_ACMP0 - * - \ref EPWM_FB_LEVEL_ACMP1 - * - \ref EPWM_FB_LEVEL_BKP0 - * - \ref EPWM_FB_LEVEL_BKP1 - * - \ref EPWM_FB_LEVEL_SYS_CSS - * - \ref EPWM_FB_LEVEL_SYS_BOD - * - \ref EPWM_FB_LEVEL_SYS_RAM - * - \ref EPWM_FB_LEVEL_SYS_COR - * @return None - * @details This function is used to enable fault brake of selected channel(s). - * The write-protection function should be disabled before using this function. - */ -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource) -{ - uint32_t i; - - for(i = 0UL; i < EPWM_CHANNEL_NUM; i++) - { - if(u32ChannelMask & (1UL << i)) - { - if((u32BrakeSource == EPWM_FB_EDGE_SYS_CSS) || (u32BrakeSource == EPWM_FB_EDGE_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_EDGE_SYS_RAM) || (u32BrakeSource == EPWM_FB_EDGE_SYS_COR) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_CSS) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_RAM) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_COR)) - { - (epwm)->BRKCTL[i >> 1] |= (u32BrakeSource & (EPWM_BRKCTL0_1_SYSEBEN_Msk | EPWM_BRKCTL0_1_SYSLBEN_Msk)); - (epwm)->FAILBRK |= (u32BrakeSource & 0xFUL); - } - else - { - (epwm)->BRKCTL[i >> 1] |= u32BrakeSource; - } - } - - if(u32LevelMask & (1UL << i)) - { - if((i & 0x1UL) == 0UL) - { - /* set brake action as high level for even channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3UL) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as high level for odd channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3UL) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - else - { - if((i & 0x1UL) == 0UL) - { - /* set brake action as low level for even channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1] |= ((2UL) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as low level for odd channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1] |= ((2UL) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - } -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s). - */ -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN |= u32ChannelMask; - (epwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s). - */ -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN &= ~u32ChannelMask; - (epwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enable EPWM output generation of selected channel(s). - */ -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disable EPWM output generation of selected channel(s). - */ -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @param[in] u32RisingFirst The capture order is rising, falling first. Every two channels share the same setting. Valid values are TRUE and FALSE. - * @param[in] u32Mode Captured data transferred by PDMA interrupt type. It could be either - * - \ref EPWM_CAPTURE_PDMA_RISING_LATCH - * - \ref EPWM_CAPTURE_PDMA_FALLING_LATCH - * - \ref EPWM_CAPTURE_PDMA_RISING_FALLING_LATCH - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - * @note This function can only selects even or odd channel of pairs to do PDMA transfer. - */ -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode) -{ - uint32_t u32IsOddCh; - u32IsOddCh = u32ChannelNum & 0x1UL; - (epwm)->PDMACTL = ((epwm)->PDMACTL & ~((EPWM_PDMACTL_CHSEL0_1_Msk | EPWM_PDMACTL_CAPORD0_1_Msk | EPWM_PDMACTL_CAPMOD0_1_Msk) << ((u32ChannelNum >> 1) << 3))) | \ - (((u32IsOddCh << EPWM_PDMACTL_CHSEL0_1_Pos) | (u32RisingFirst << EPWM_PDMACTL_CAPORD0_1_Pos) | \ - u32Mode | EPWM_PDMACTL_CHEN0_1_Msk) << ((u32ChannelNum >> 1) << 3)); -} - -/** - * @brief Disables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - */ -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->PDMACTL &= ~(EPWM_PDMACTL_CHEN0_1_Msk << ((u32ChannelNum >> 1) << 3)); -} - -/** - * @brief Enable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Duration Dead zone length in EPWM clock count, valid values are between 0~0xFFF, but 0 means there is no Dead zone. - * @return None - * @details This function is used to enable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration) -{ - /* every two channels share the same setting */ - (epwm)->DTCTL[(u32ChannelNum) >> 1] &= ~EPWM_DTCTL0_1_DTCNT_Msk; - (epwm)->DTCTL[(u32ChannelNum) >> 1] |= EPWM_DTCTL0_1_DTEN_Msk | u32Duration; -} - -/** - * @brief Disable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - */ -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - /* every two channels shares the same setting */ - (epwm)->DTCTL[(u32ChannelNum) >> 1] &= ~EPWM_DTCTL0_1_DTEN_Msk; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - uint32_t u32CapIf = 0UL; - - u32CapIf = ((((epwm)->CAPIF & (EPWM_CAPIF_CFLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1); - u32CapIf |= (((epwm)->CAPIF & (EPWM_CAPIF_CRLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL); - return u32CapIf; -} -/** - * @brief Enable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref EPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (epwm)->INTEN0 |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel. - */ -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | EPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel. - */ -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = (EPWM_INTSTS0_CMPUIF0_Msk | EPWM_INTSTS0_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((EPWM_INTSTS0_CMPDIF0_Msk | EPWM_INTSTS0_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief This function enable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to enable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 |= (0x7UL << u32BrakeSource); -} - -/** - * @brief This function disable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to disable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 &= ~(0x7UL << u32BrakeSource); -} - -/** - * @brief This function clear fault brake interrupt of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to clear fault brake interrupt of selected source. - * The write-protection function should be disabled before using this function. - */ -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTSTS1 = (0x3fUL << u32BrakeSource); -} - -/** - * @brief This function get fault brake interrupt flag of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source, could be either - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * @details This function is used to get fault brake interrupt flag of selected source. - */ -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - return (((epwm)->INTSTS1 & (0x3fUL << u32BrakeSource)) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - */ -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (void)u32IntPeriodType; - (epwm)->INTEN0 |= (EPWM_INTEN0_PIEN0_Msk << u32ChannelNum); -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable period interrupt of selected channel. - */ -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~(EPWM_INTEN0_PIEN0_Msk << u32ChannelNum); -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear period interrupt of selected channel. - */ -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = (EPWM_INTSTS0_PIF0_Msk << u32ChannelNum); -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel. - */ -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & (EPWM_INTSTS0_PIF0_Msk << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable zero interrupt of selected channel. - */ -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 |= (EPWM_INTEN0_ZIEN0_Msk << u32ChannelNum); -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable zero interrupt of selected channel. - */ -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~(EPWM_INTEN0_ZIEN0_Msk << u32ChannelNum); -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear zero interrupt of selected channel. - */ -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = (EPWM_INTSTS0_ZIF0_Msk << u32ChannelNum); -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Zero interrupt flag of specified channel - * @retval 0 Zero interrupt did not occur - * @retval 1 Zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - */ -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & (EPWM_INTSTS0_ZIF0_Msk << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntFlagCnt Interrupt flag counter. Valid values are between 0~65535. - * @param[in] u32IntAccSrc Interrupt flag accumulator source selection. - * - \ref EPWM_IFA_ZERO_POINT - * - \ref EPWM_IFA_PERIOD_POINT - * - \ref EPWM_IFA_COMPARE_UP_COUNT_POINT - * - \ref EPWM_IFA_COMPARE_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable interrupt flag accumulator of selected channel. - */ -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc) -{ - (epwm)->IFA[u32ChannelNum] = (((epwm)->IFA[u32ChannelNum] & ~((EPWM_IFA0_IFACNT_Msk | EPWM_IFA0_IFASEL_Msk))) | \ - (EPWM_IFA0_IFAEN_Msk | (u32IntAccSrc << EPWM_IFA0_IFASEL_Pos) | u32IntFlagCnt)); -} - -/** - * @brief Disable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to Disable interrupt flag accumulator of selected channel. - */ -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] = ((epwm)->IFA[u32ChannelNum] & ~(EPWM_IFA0_IFAEN_Msk)); -} - -/** - * @brief Enable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Clear interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTSTS = (1UL << (u32ChannelNum)); -} - -/** - * @brief Get interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 Accumulator interrupt did not occur - * @retval 1 Accumulator interrupt occurred - * @details This function is used to Get interrupt flag accumulator interrupt of selected channel. - */ -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->AINTSTS & (1UL << (u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Enable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] |= EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Disable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] &= ~EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Clear free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear free trigger duty interrupt flag of selected channel. - */ -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FTCI = ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1)); -} - -/** - * @brief Get free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Free trigger duty interrupt did not occur - * @retval 1 Free trigger duty interrupt occurred - * @details This function is used to get free trigger duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FTCI & ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1))) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Configure synchronization phase of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32SyncSrc EPWM synchronize source selection. - * - \ref EPWM_SYNC_OUT_FROM_SYNCIN_SWSYNC - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_ZERO - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_COMPARATOR - * - \ref EPWM_SYNC_OUT_DISABLE - * @param[in] u32Direction Phase direction. Control EPWM counter count decrement or increment after synchronizing. - * - \ref EPWM_PHS_DIR_DECREMENT - * - \ref EPWM_PHS_DIR_INCREMENT - * @param[in] u32StartPhase Synchronous start phase value. Valid values are between 0~65535. - * @return None - * @details This function is used to configure synchronization phase of selected channel. - * @note Every two channels share the same setting. - */ -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase) -{ - /* every two channels shares the same setting */ - u32ChannelNum >>= 1; - (epwm)->SYNC = (((epwm)->SYNC & ~((EPWM_SYNC_SINSRC0_Msk << (u32ChannelNum << 1)) | (EPWM_SYNC_PHSDIR0_Msk << u32ChannelNum))) | \ - (u32Direction << EPWM_SYNC_PHSDIR0_Pos << u32ChannelNum) | (u32SyncSrc << EPWM_SYNC_SINSRC0_Pos) << (u32ChannelNum << 1)); - (epwm)->PHS[(u32ChannelNum)] = u32StartPhase; -} - - -/** - * @brief Enable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for(i = 0UL; i < EPWM_CHANNEL_NUM; i ++) - { - if(u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC |= (EPWM_SYNC_PHSEN0_Msk << (i >> 1)); - } - } -} - -/** - * @brief Disable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for(i = 0UL; i < EPWM_CHANNEL_NUM; i ++) - { - if(u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC &= ~(EPWM_SYNC_PHSEN0_Msk << (i >> 1)); - } - } -} - -/** - * @brief Enable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector. - * The valid value is 0~7. - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM SYNC_IN noise filter function. - */ -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->SYNC = ((epwm)->SYNC & ~(EPWM_SYNC_SFLTCNT_Msk | EPWM_SYNC_SFLTCSEL_Msk)) | \ - ((u32ClkCnt << EPWM_SYNC_SFLTCNT_Pos) | (u32ClkDivSel << EPWM_SYNC_SFLTCSEL_Pos) | EPWM_SYNC_SNFLTEN_Msk); -} - -/** - * @brief Disable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC_IN noise filter function. - */ -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm) -{ - (epwm)->SYNC &= ~EPWM_SYNC_SNFLTEN_Msk; -} - -/** - * @brief Enable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to enable EPWM SYNC input pin inverse function. - */ -void EPWM_EnableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC |= EPWM_SYNC_SINPINV_Msk; -} - -/** - * @brief Disable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC input pin inverse function. - */ -void EPWM_DisableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC &= (~EPWM_SYNC_SINPINV_Msk); -} - -/** - * @brief Set EPWM clock source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32ClkSrcSel EPWM external clock source. - * - \ref EPWM_CLKSRC_EPWM_CLK - * - \ref EPWM_CLKSRC_TIMER0 - * - \ref EPWM_CLKSRC_TIMER1 - * - \ref EPWM_CLKSRC_TIMER2 - * - \ref EPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set EPWM clock source. - * @note Every two channels share the same setting. - * @note If the clock source of EPWM counter is selected from TIMERn interrupt events, the TRGEPWM(TIMERn_TRGCTL[1], n=0,1..3) bit must be set as 1. - */ -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (epwm)->CLKSRC = ((epwm)->CLKSRC & ~(EPWM_CLKSRC_ECLKSRC0_Msk << ((u32ChannelNum >> 1) << 3))) | \ - (u32ClkSrcSel << ((u32ChannelNum >> 1) << 3)); -} - -/** - * @brief Enable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM brake noise filter function. - */ -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->BNF = ((epwm)->BNF & ~((EPWM_BNF_BRK0FCNT_Msk | EPWM_BNF_BRK0NFSEL_Msk) << (u32BrakePinNum << 3))) | \ - (((u32ClkCnt << EPWM_BNF_BRK0FCNT_Pos) | (u32ClkDivSel << EPWM_BNF_BRK0NFSEL_Pos) | EPWM_BNF_BRK0NFEN_Msk) << (u32BrakePinNum << 3)); -} - -/** - * @brief Disable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake noise filter function. - */ -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0NFEN_Msk << (u32BrakePinNum << 3)); -} - -/** - * @brief Enable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to enable EPWM brake pin inverse function. - */ -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF |= (EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum << 3)); -} - -/** - * @brief Disable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake pin inverse function. - */ -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum * (uint32_t)EPWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Set EPWM brake pin source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32SelAnotherModule Select to another module. Valid values are TRUE or FALSE. - * @return None - * @details This function is used to set EPWM brake pin source. - */ -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule) -{ - (epwm)->BNF = ((epwm)->BNF & ~(EPWM_BNF_BK0SRC_Msk << (u32BrakePinNum << 3))) | (u32SelAnotherModule << ((uint32_t)EPWM_BNF_BK0SRC_Pos + (u32BrakePinNum << 3))); -} - -/** - * @brief Set EPWM leading edge blanking function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32TrigSrcSel Leading edge blanking source selection. - * - \ref EPWM_LEBCTL_SRCEN0 - * - \ref EPWM_LEBCTL_SRCEN2 - * - \ref EPWM_LEBCTL_SRCEN4 - * - \ref EPWM_LEBCTL_SRCEN0_2 - * - \ref EPWM_LEBCTL_SRCEN0_4 - * - \ref EPWM_LEBCTL_SRCEN2_4 - * - \ref EPWM_LEBCTL_SRCEN0_2_4 - * @param[in] u32TrigType Leading edge blanking trigger type. - * - \ref EPWM_LEBCTL_TRGTYPE_RISING - * - \ref EPWM_LEBCTL_TRGTYPE_FALLING - * - \ref EPWM_LEBCTL_TRGTYPE_RISING_OR_FALLING - * @param[in] u32BlankingCnt Leading Edge Blanking Counter. Valid values are between 1~512. - This counter value decides leading edge blanking window size, and this counter clock base is ECLK. - * @param[in] u32BlankingEnable Enable EPWM leading edge blanking function. Valid values are TRUE (ENABLE) or FALSE (DISABLE). - * - \ref FALSE - * - \ref TRUE - * @return None - * @details This function is used to configure EPWM leading edge blanking function that blank the false trigger from ACMP brake source which may cause by EPWM output transition. - * @note EPWM leading edge blanking function is only used for brake source from ACMP. - */ -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable) -{ - (epwm)->LEBCTL = (u32TrigType) | (u32TrigSrcSel) | (u32BlankingEnable); - /* Blanking window size = LEBCNT + 1, so LEBCNT = u32BlankingCnt - 1 */ - (epwm)->LEBCNT = (u32BlankingCnt) - 1UL; -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - */ -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - */ -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->STATUS = (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum); -} - -/** - * @brief Enable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32AfterPrescaler Fault Detect Clock Source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @param[in] u32ClkSel Fault Detect Clock Select. - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_1 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_2 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_4 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_8 - * @return None - * @details This function is used to enable fault detect of selected channel. - */ -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel) -{ - (epwm)->FDEN = ((epwm)->FDEN & ~(EPWM_FDEN_FDCKS0_Msk << (u32ChannelNum))) | \ - ((EPWM_FDEN_FDEN0_Msk | ((u32AfterPrescaler) << EPWM_FDEN_FDCKS0_Pos)) << (u32ChannelNum)); - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & ~EPWM_FDCTL0_FDCKSEL_Msk) | (u32ClkSel); -} - -/** - * @brief Disable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect of selected channel. - */ -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect output of selected channel. - */ -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect output of selected channel. - */ -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN |= (EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32DeglitchSmpCycle Deglitch Sampling Cycle. Valid values are between 0~7. - * @return None - * @details This function is used to enable fault detect deglitch function of selected channel. - */ -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_DGSMPCYC_Msk)) | \ - (EPWM_FDCTL0_FDDGEN_Msk | ((u32DeglitchSmpCycle) << EPWM_FDCTL0_DGSMPCYC_Pos)); -} - -/** - * @brief Disable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect deglitch function of selected channel. - */ -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDDGEN_Msk; -} - -/** - * @brief Enable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32MaskCnt Transition mask counter. Valid values are between 0~0x7F. - * @return None - * @details This function is used to enable fault detect mask function of selected channel. - */ -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_TRMSKCNT_Msk)) | (EPWM_FDCTL0_FDMSKEN_Msk | (u32MaskCnt)); -} - -/** - * @brief Disable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect mask function of selected channel. - */ -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDMSKEN_Msk; -} - -/** - * @brief Enable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect interrupt of selected channel. - */ -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN |= (EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect interrupt of selected channel. - */ -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN &= ~(EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Clear fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to clear fault detect interrupt of selected channel. - */ -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDSTS = (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum)); -} - -/** - * @brief Get fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @retval 0 Fault detect interrupt did not occur. - * @retval 1 Fault detect interrupt occurred. - * @details This function is used to Get fault detect interrupt of selected channel. - */ -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FDSTS & (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum))) ? 1UL : 0UL); -} - -/**@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EPWM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewdt.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewdt.c deleted file mode 100644 index 7b97e96525f..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewdt.c +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************//** - * @file ewdt.c - * @version V3.00 - * @brief Extra Watchdog Timer(EWDT) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EWDT_Driver EWDT Driver - @{ -*/ - -/** @addtogroup EWDT_EXPORTED_FUNCTIONS EWDT Exported Functions - @{ -*/ - -/** - * @brief Initialize EWDT and start counting - * - * @param[in] u32TimeoutInterval Time-out interval period of EWDT module. Valid values are: - * - \ref EWDT_TIMEOUT_2POW4 - * - \ref EWDT_TIMEOUT_2POW6 - * - \ref EWDT_TIMEOUT_2POW8 - * - \ref EWDT_TIMEOUT_2POW10 - * - \ref EWDT_TIMEOUT_2POW12 - * - \ref EWDT_TIMEOUT_2POW14 - * - \ref EWDT_TIMEOUT_2POW16 - * - \ref EWDT_TIMEOUT_2POW18 - * - \ref EWDT_TIMEOUT_2POW20 - * @param[in] u32ResetDelay Configure EWDT time-out reset delay period. Valid values are: - * - \ref EWDT_RESET_DELAY_1026CLK - * - \ref EWDT_RESET_DELAY_130CLK - * - \ref EWDT_RESET_DELAY_18CLK - * - \ref EWDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable EWDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable EWDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes EWDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable EWDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - */ -void EWDT_Open(uint32_t u32TimeoutInterval, - uint32_t u32ResetDelay, - uint32_t u32EnableReset, - uint32_t u32EnableWakeup) -{ - EWDT->ALTCTL = u32ResetDelay; - - EWDT->CTL = u32TimeoutInterval | EWDT_CTL_WDTEN_Msk | - (u32EnableReset << EWDT_CTL_RSTEN_Pos) | - (u32EnableWakeup << EWDT_CTL_WKEN_Pos); - - while((EWDT->CTL & EWDT_CTL_SYNC_Msk) == EWDT_CTL_SYNC_Msk) {} /* Wait enable WDTEN bit completed, it needs 2 * EWDT_CLK. */ -} - -/**@}*/ /* end of group EWDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EWDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewwdt.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewwdt.c deleted file mode 100644 index 25896280105..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_ewwdt.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************//** - * @file ewwdt.c - * @version V3.00 - * @brief Extra Window Watchdog Timer(EWWDT) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EWWDT_Driver EWWDT Driver - @{ -*/ - -/** @addtogroup EWWDT_EXPORTED_FUNCTIONS EWWDT Exported Functions - @{ -*/ - -/** - * @brief Open EWWDT and start counting - * - * @param[in] u32PreScale Pre-scale setting of EWWDT counter. Valid values are: - * - \ref EWWDT_PRESCALER_1 - * - \ref EWWDT_PRESCALER_2 - * - \ref EWWDT_PRESCALER_4 - * - \ref EWWDT_PRESCALER_8 - * - \ref EWWDT_PRESCALER_16 - * - \ref EWWDT_PRESCALER_32 - * - \ref EWWDT_PRESCALER_64 - * - \ref EWWDT_PRESCALER_128 - * - \ref EWWDT_PRESCALER_192 - * - \ref EWWDT_PRESCALER_256 - * - \ref EWWDT_PRESCALER_384 - * - \ref EWWDT_PRESCALER_512 - * - \ref EWWDT_PRESCALER_768 - * - \ref EWWDT_PRESCALER_1024 - * - \ref EWWDT_PRESCALER_1536 - * - \ref EWWDT_PRESCALER_2048 - * @param[in] u32CmpValue Setting the window compared value. Valid values are between 0x0 to 0x3F. - * @param[in] u32EnableInt Enable WWDT time-out interrupt function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes EWWDT module start counting with different counter period by pre-scale setting and compared window value. - * @note Application can call this function only once after boot up. - */ -void EWWDT_Open(uint32_t u32PreScale, - uint32_t u32CmpValue, - uint32_t u32EnableInt) -{ - EWWDT->CTL = u32PreScale | - (u32CmpValue << EWWDT_CTL_CMPDAT_Pos) | - ((u32EnableInt == (uint32_t)TRUE) ? EWWDT_CTL_INTEN_Msk : 0UL) | - EWWDT_CTL_WWDTEN_Msk; -} - -/**@}*/ /* end of group EWWDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EWWDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fmc.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fmc.c deleted file mode 100644 index e5cd41614d6..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fmc.c +++ /dev/null @@ -1,861 +0,0 @@ -/**************************************************************************//** - * @file fmc.c - * @version V3.00 - * $Revision: 1 $ - * $Date: 19/11/27 7:50p $ - * @brief M2355 Series Flash Memory Controller(FMC) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - -/** - * @brief Run flash all one verification and get result. - * - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 512 bytes. - * - * @retval READ_ALLONE_YES The contents of verified flash area are 0xA11FFFFF. - * @retval READ_ALLONE_NOT Some contents of verified flash area are not 0xA1100000. - * @retval READ_ALLONE_CMD_FAIL Unexpected error occurred. - * - * @details Run ISP check all one command to check specify area is all one or not. - */ -uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret = READ_ALLONE_CMD_FAIL; - - FMC_ISP->ISPSTS = 0x80UL; /* clear check all one bit */ - - FMC_ISP->ISPCMD = FMC_ISPCMD_RUN_ALL1; - FMC_ISP->ISPADDR = u32addr; - FMC_ISP->ISPDAT = u32count; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC_ISP->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - do - { - FMC_ISP->ISPCMD = FMC_ISPCMD_READ_ALL1; - FMC_ISP->ISPADDR = u32addr; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC_ISP->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - } - while(FMC_ISP->ISPDAT == 0UL); - - if(FMC_ISP->ISPDAT == READ_ALLONE_YES) - { - ret = FMC_ISP->ISPDAT; - } - - if(FMC_ISP->ISPDAT == READ_ALLONE_NOT) - { - ret = FMC_ISP->ISPDAT; - } - - return ret; -} - - -/** - * @brief Disable ISP Functions - * - * @param None - * - * @return None - * - * @details This function will clear ISPEN bit of ISPCON to disable ISP function - * - */ -void FMC_Close(void) -{ - FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk; -} - -/** - * @brief Config XOM Region - * @param[in] u32XomNum The XOM number(0~3) - * @param[in] u32XomBase The XOM region base address. - * @param[in] u8XomPage The XOM page number of region size. - * - * @retval 0 Success - * @retval 1 XOM is has already actived. - * @retval -1 Program failed. - * @retval -2 Invalid XOM number. - * - * @details Program XOM base address and XOM size(page) - */ -int32_t FMC_ConfigXOM(uint32_t u32XomNum, uint32_t u32XomBase, uint8_t u8XomPage) -{ - int32_t ret = 0; - - if(u32XomNum >= 4UL) - { - ret = -2; - } - - if(ret == 0) - { - ret = FMC_GetXOMState(u32XomNum); - } - - if(ret == 0) - { - FMC_ISP->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC_ISP->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u); - FMC_ISP->ISPDAT = u32XomBase; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} - - if(FMC_ISP->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC_ISP->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - if(ret == 0) - { - FMC_ISP->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC_ISP->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u + 0x04u); - FMC_ISP->ISPDAT = u8XomPage; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} - - if(FMC_ISP->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC_ISP->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - if(ret == 0) - { - FMC_ISP->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC_ISP->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u + 0x08u); - FMC_ISP->ISPDAT = 0u; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} - - if(FMC_ISP->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC_ISP->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - return ret; -} - -/** - * @brief Execute Flash Page erase - * - * @param[in] u32PageAddr Address of the flash page to be erased. - * It must be a 2048 bytes aligned address. - * - * @return ISP page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * - * @details Execute FMC_ISPCMD_PAGE_ERASE command to erase a flash page. The page size is 2048 bytes. - */ -int32_t FMC_Erase(uint32_t u32PageAddr) -{ - int32_t ret = 0; - - if(ret == 0) - { - FMC_ISP->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC_ISP->ISPADDR = u32PageAddr; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if(FMC_ISP->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC_ISP->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - } - return ret; -} - -/** - * @brief Execute Flash Bank erase - * - * @param[in] u32BankAddr Base address of the flash bank to be erased. - * - * @return ISP bank erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * - * @details Execute FMC_ISPCMD_BANK_ERASE command to erase a flash block. - */ -int32_t FMC_EraseBank(uint32_t u32BankAddr) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_BANK_ERASE; - FMC->ISPADDR = u32BankAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} - - if(FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - - -/** - * @brief Execute Erase XOM Region - * - * @param[in] u32XomNum The XOMRn(n=0~3) - * - * @return XOM erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * @retval -2 Invalid XOM number. - * - * @details Execute FMC_ISPCMD_PAGE_ERASE command to erase XOM. - */ -int32_t FMC_EraseXOM(uint32_t u32XomNum) -{ - uint32_t u32Addr; - int32_t i32Active, err = 0; - - if(u32XomNum >= 4UL) - { - err = -2; - } - - if(err == 0) - { - i32Active = FMC_GetXOMState(u32XomNum); - - if(i32Active) - { - u32Addr = (((uint32_t)(&FMC->XOMR0STS)[u32XomNum]) & 0xFFFFFF00u) >> 8u; - - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = u32Addr; - FMC->ISPDAT = 0x55aa03u; - FMC->ISPTRG = 0x1u; -#if ISBEN - __ISB(); -#endif - while(FMC->ISPTRG) {} - - /* Check ISPFF flag to know whether erase OK or fail. */ - if(FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - err = -1; - } - } - else - { - err = -1; - } - } - return err; -} - -/** - * @brief Run CRC32 checksum calculation and get result. - * - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 2048bytes. - * - * @return Success or not. - * @retval 0 Success. - * @retval 0xFFFFFFFF Invalid parameter. - * - * @details Run ISP CRC32 checksum command to calculate checksum then get and return checksum data. - */ -uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret; - - if((u32addr % 2048UL) || (u32count % 2048UL)) - { - ret = 0xFFFFFFFF; - } - else - { - FMC_ISP->ISPCMD = FMC_ISPCMD_RUN_CKS; - FMC_ISP->ISPADDR = u32addr; - FMC_ISP->ISPDAT = u32count; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - FMC_ISP->ISPCMD = FMC_ISPCMD_READ_CKS; - FMC_ISP->ISPADDR = u32addr; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC_ISP->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - ret = FMC_ISP->ISPDAT; - } - - return ret; -} - -/** - * @brief Check the OTP is locked or not. - * - * @param[in] u32OtpNum The OTP number. - * - * @retval 1 OTP is locked. - * @retval 0 OTP is not locked. - * @retval -1 Failed to read OTP lock bits. - * @retval -2 Invalid OTP number. - * - * @details To get specify OTP lock status - */ -int32_t FMC_IsOTPLocked(uint32_t u32OtpNum) -{ - int32_t ret = 0; - - if(u32OtpNum > 255UL) - { - ret = -2; - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_READ; - FMC->ISPADDR = FMC_OTP_BASE + 0x800UL + u32OtpNum * 4UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - else - { - if(FMC->ISPDAT != 0xFFFFFFFFUL) - { - ret = 1; /* Lock work was progrmmed. OTP was locked. */ - } - } - } - return ret; -} - -/** - * @brief Check the XOM is actived or not. - * - * @param[in] u32XomNum The xom number(0~3). - * - * @retval 1 XOM is actived. - * @retval 0 XOM is not actived. - * @retval -2 Invalid XOM number. - * - * @details To get specify XOMRn(n=0~3) active status - */ -int32_t FMC_GetXOMState(uint32_t u32XomNum) -{ - uint32_t u32act; - int32_t ret = 0; - - if(u32XomNum >= 4UL) - { - ret = -2; - } - - if(ret >= 0) - { - u32act = (((FMC_ISP->XOMSTS) & 0xful) & (1ul << u32XomNum)) >> u32XomNum; - ret = (int32_t)u32act; - } - return ret; -} - -/** - * @brief Lock the specified OTP. - * - * @param[in] u32OtpNum The OTP number. - * - * @retval 0 Success - * @retval -1 Failed to write OTP lock bits. - * @retval -2 Invalid OTP number. - * - * @details To lock specified OTP number - */ -int32_t FMC_LockOTP(uint32_t u32OtpNum) -{ - int32_t ret = 0; - - if(u32OtpNum > 255UL) - { - ret = -2; - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + 0x800UL + u32OtpNum * 4UL; - FMC->ISPDAT = 0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - return ret; -} - -/** - * @brief Enable FMC ISP function - * - * @param None - * - * @return None - * - * @details ISPEN bit of ISPCON must be set before we can use ISP commands. - * Therefore, To use all FMC function APIs, user needs to call FMC_Open() first to enable ISP functions. - * - * @note ISP functions are write-protected. user also needs to unlock it by calling SYS_UnlockReg() before using all ISP functions. - * - */ -void FMC_Open(void) -{ - FMC_ISP->ISPCTL |= FMC_ISPCTL_ISPEN_Msk; -} - - -/** - * @brief Read a word bytes from flash - * - * @param[in] u32Addr Address of the flash location to be read. - * It must be a word aligned address. - * - * @return The word data read from specified flash address. - * - * @details Execute FMC_ISPCMD_READ command to read a word from flash. - */ -uint32_t FMC_Read(uint32_t u32Addr) -{ - FMC_ISP->ISPCMD = FMC_ISPCMD_READ; - FMC_ISP->ISPADDR = u32Addr; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - return FMC_ISP->ISPDAT; -} - -/** - * @brief Read a double-word bytes from flash - * - * @param[in] u32addr Address of the flash location to be read. - * It must be a double-word aligned address. - * - * @param[out] u32data0 Place holder of word 0 read from flash address u32addr. - * @param[out] u32data1 Place holder of word 0 read from flash address u32addr+4. - * - * @return 0 Success - * @return -1 Failed - * - * @details Execute FMC_ISPCMD_READ_64 command to read a double-word from flash. - */ -int32_t FMC_Read64(uint32_t u32addr, uint32_t * u32data0, uint32_t * u32data1) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_READ_64; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = 0x0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - else - { - *u32data0 = FMC->MPDAT0; - *u32data1 = FMC->MPDAT1; - } - return ret; -} - -/** - * @brief Read data from OTP - * - * @param[in] u32OtpNum The OTP number(0~255). - * @param[in] u32LowWord Low word of the 64-bits data. - * @param[in] u32HighWord High word of the 64-bits data. - * - * @retval 0 Success - * @retval -1 Read failed. - * @retval -2 Invalid OTP number. - * - * @details Read the 64-bits data from the specified OTP. - */ -int32_t FMC_ReadOTP(uint32_t u32OtpNum, uint32_t *u32LowWord, uint32_t *u32HighWord) -{ - int32_t ret = 0; - - if(u32OtpNum > 255UL) - { - ret = -2; - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_READ_64; - FMC->ISPADDR = FMC_OTP_BASE + u32OtpNum * 8UL ; - FMC->ISPDAT = 0x0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) {} - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - else - { - *u32LowWord = FMC->MPDAT0; - *u32HighWord = FMC->MPDAT1; - } - } - return ret; -} - -/** - * @brief Read the User Configuration words. - * - * @param[out] u32Config[] The word buffer to store the User Configuration data. - * @param[in] u32Count The word count to be read. - * - * @return Success or not. - * @retval 0 Success - * @retval -1 Failed - * - * @details This function is used to read the settings of user configuration. - * if u32Count = 1, Only CONFIG0 will be returned to the buffer specified by u32Config. - * if u32Count = 2, Both CONFIG0 and CONFIG1 will be returned. - */ -int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count) -{ - uint32_t i; - - for(i = 0u; i < u32Count; i++) - { - u32Config[i] = FMC_Read(FMC_CONFIG_BASE + i * 4u); - } - return 0; -} - -/** - * @brief Write a word bytes to flash. - * - * @param[in] u32Addr Address of the flash location to be programmed. - * It must be a word aligned address. - * @param[in] u32Data The word data to be programmed. - * - * @return None - * - * @ details Execute ISP FMC_ISPCMD_PROGRAM to program a word to flash. - */ -void FMC_Write(uint32_t u32Addr, uint32_t u32Data) -{ - FMC_ISP->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC_ISP->ISPADDR = u32Addr; - FMC_ISP->ISPDAT = u32Data; - FMC_ISP->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC_ISP->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } -} - -/** - * @brief Write a double-word bytes to flash - * - * @param[in] u32addr Address of the flash location to be programmed. - * It must be a double-word aligned address. - * @param[in] u32data0 The word data to be programmed to flash address u32addr. - * @param[in] u32data1 The word data to be programmed to flash address u32addr+4. - * - * @return 0 Success - * @return -1 Failed - * - * @ details Execute ISP FMC_ISPCMD_PROGRAM_64 to program a double-word to flash. - */ -int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_PROGRAM_64; - FMC->ISPADDR = u32addr; - FMC->MPDAT0 = u32data0; - FMC->MPDAT1 = u32data1; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Write User Configuration - * - * @param[in] au32Config[] The word buffer to store the User Configuration data. - * @param[in] u32Count The word count to program to User Configuration. - * - * @retval 0 Success - * @retval -1 Failed - * - * @details User must enable User Configuration update before writing it. - * User must erase User Configuration before writing it. - * User Configuration is also be page erase. User needs to backup necessary data - * before erase User Configuration. - */ -int32_t FMC_WriteConfig(uint32_t au32Config[], uint32_t u32Count) -{ - int32_t ret = 0; - uint32_t i; - - FMC_ENABLE_CFG_UPDATE(); - for(i = 0u; i < u32Count; i++) - { - FMC_Write(FMC_CONFIG_BASE + i * 4u, au32Config[i]); - if(FMC_Read(FMC_CONFIG_BASE + i * 4u) != au32Config[i]) - { - ret = -1; - } - } - FMC_DISABLE_CFG_UPDATE(); - return ret; -} - -/** - * @brief Write Multi-Word bytes to flash - * - * @param[in] u32Addr Start flash address in APROM where the data chunk to be programmed into. - * This address must be 8-bytes aligned to flash address. - * @param[in] pu32Buf Buffer that carry the data chunk. - * @param[in] u32Len Length of the data chunk in bytes. - * - * @retval >=0 Number of data bytes were programmed. - * @return -1 Invalid address. - * - * @details Program Multi-Word data into specified address of flash. - */ - -int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len) -{ - - uint32_t i, idx, u32OnProg; - int32_t err, retval = 0; - - if((u32Addr >= FMC_APROM_END) || ((u32Addr % 8) != 0)) - { - return -1; - } - - idx = 0u; - FMC->ISPCMD = FMC_ISPCMD_PROGRAM_MUL; - FMC->ISPADDR = u32Addr; - retval += 16; - do - { - err = 0; - u32OnProg = 1u; - FMC->MPDAT0 = pu32Buf[idx + 0u]; - FMC->MPDAT1 = pu32Buf[idx + 1u]; - FMC->MPDAT2 = pu32Buf[idx + 2u]; - FMC->MPDAT3 = pu32Buf[idx + 3u]; - FMC->ISPTRG = 0x1u; - idx += 4u; - - for(i = idx; i < (u32Len / 4u); i += 4u) /* Max data length is 256 bytes (512/4 words)*/ - { - __set_PRIMASK(1u); /* Mask interrupt to avoid status check coherence error*/ - do - { - if((FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk) == 0u) - { - __set_PRIMASK(0u); - - FMC->ISPADDR = FMC->MPADDR & (~0xful); - idx = (FMC->ISPADDR - u32Addr) / 4u; - err = -1; - } - } - while((FMC->MPSTS & (3u << FMC_MPSTS_D0_Pos)) && (err == 0)); - - if(err == 0) - { - retval += 8; - - /* Update new data for D0 */ - FMC->MPDAT0 = pu32Buf[i]; - FMC->MPDAT1 = pu32Buf[i + 1u]; - do - { - if((FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk) == 0u) - { - __set_PRIMASK(0u); - FMC->ISPADDR = FMC->MPADDR & (~0xful); - idx = (FMC->ISPADDR - u32Addr) / 4u; - err = -1; - } - } - while((FMC->MPSTS & (3u << FMC_MPSTS_D2_Pos)) && (err == 0)); - - if(err == 0) - { - retval += 8; - - /* Update new data for D2*/ - FMC->MPDAT2 = pu32Buf[i + 2u]; - FMC->MPDAT3 = pu32Buf[i + 3u]; - __set_PRIMASK(0u); - } - } - - if(err < 0) - { - break; - } - } - if(err == 0) - { - u32OnProg = 0u; - while(FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) {} - } - } - while(u32OnProg); - - return retval; -} - -/** - * @brief Write data to OTP - * - * @param[in] u32OtpNum The OTP number(0~255). - * @param[in] u32LowWord Low word of the 64-bits data. - * @param[in] u32HighWord High word of the 64-bits data. - * - * @retval 0 Success - * @retval -1 Program failed. - * @retval -2 Invalid OTP number. - * - * @details Program a 64-bits data to the specified OTP. - */ -int32_t FMC_WriteOTP(uint32_t u32OtpNum, uint32_t u32LowWord, uint32_t u32HighWord) -{ - int32_t ret = 0; - - if(u32OtpNum > 255UL) - { - ret = -2; - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + u32OtpNum * 8UL; - FMC->ISPDAT = u32LowWord; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + u32OtpNum * 8UL + 4UL; - FMC->ISPDAT = u32HighWord; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - return ret; -} - -/** - * @brief Remap Bank0/Bank1 - * - * @param[in] u32Bank Bank Num which will remap to. - * - * @retval 0 Success - * @retval -1 Program failed. - * - * @details Remap Bank0/Bank1 - */ -int32_t FMC_RemapBank(uint32_t u32Bank) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_BANK_REMAP; - FMC->ISPADDR = u32Bank; - FMC->ISPDAT = 0x5AA55AA5UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if(FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/**@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group FMC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - - - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fvc.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fvc.c deleted file mode 100644 index e6a028f1702..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_fvc.c +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************//** - * @file fvc.c - * @version V3.00 - * @brief FVC driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FVC_Driver FVC Driver - @{ -*/ - - -/** @addtogroup FVC_EXPORTED_FUNCTIONS FVC Exported Functions - @{ -*/ - - -/** - * @brief Initial firmware version counter - * @param None - * @retval 0 Successful - * @retval -1 Failed - * @details FVC needs to be initialed before using it. This function is used to initial the FVC. - * - */ -int32_t FVC_Open(void) -{ - int32_t timeout; - - /* Just return when it is ready */ - if(FVC->STS & FVC_STS_RDY_Msk) - return 0; - - /* Init FVC */ - FVC->CTL = FVC_VCODE | FVC_CTL_INIT_Msk; - - /* Waiting for ready */ - timeout = 0x100000; - while((FVC->STS & FVC_STS_RDY_Msk) == 0) - { - if(timeout-- < 0) - { - /* Init timeout. */ - return -1; - } - } - - return 0; -} - - - -/** - * @brief Enable anti version rollback - * @details FVC can limit the version number to be increased only to avoid version rollback. - * This function is used to enable it. - * - */ -void FVC_EnableMonotone(void) -{ - FVC->CTL = FVC_VCODE | FVC_CTL_MONOEN_Msk; - /* Waiting if FVC is in busy */ - while(FVC->STS & FVC->STS & FVC_STS_BUSY_Msk) {} -} - -/** - * @brief Set non-volatile version counter - * @param[in] u32NvcIdx Index number of non-volatile version counter. It could be 0, 1, 4, 5. - * @param[in] u32Cnt Version Number. It could be 0~63 for u32NvcIdx=0, 1, and 0~255 for u32NvcIdx=4, 5 - * @retval 0 Successful - * @retval -1 Failed - * @details Set non-volatile version counter - * - */ -int32_t FVC_SetNVC(uint32_t u32NvcIdx, uint32_t u32Cnt) -{ - if(u32NvcIdx < 2) - { - if(u32Cnt >= 64) - /* The counter value is out of range */ - return -1; - } - else if(u32NvcIdx < 4) - return -1; - else if(u32NvcIdx < 6) - { - /* The counter value is out of range */ - if(u32Cnt >= 256) - /* The counter value is out of range */ - return -1; - } - else - return -1; - - FVC->NVC[u32NvcIdx] = (FVC->NVC[u32NvcIdx] << 16) | (u32Cnt & 0x3ful); - while(FVC->STS & FVC_STS_BUSY_Msk) {} - if(FVC->NVC[u32NvcIdx] != u32Cnt) - return -1; - - return 0; -} - - -/** - * @brief Get non-volatile version counter - * @param[in] u32NvcIdx Index number of non-volatile version counter. It could be 0, 1, 4, 5. - * @retval the version counter - * @retval -1 Failed - * @details Get non-volatile version counter - * - */ -int32_t FVC_GetNVC(uint32_t u32NvcIdx) -{ - if((u32NvcIdx == 2) || (u32NvcIdx == 3) || (u32NvcIdx > 5)) - return -1; - - return FVC->NVC[u32NvcIdx]; -} - -/**@}*/ /* end of group FVC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group FVC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_gpio.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_gpio.c deleted file mode 100644 index 56513fc1a45..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_gpio.c +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************//** - * @file gpio.c - * @version V3.00 - * @brief M2354 series General Purpose I/O (GPIO) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Set GPIO operation mode - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * @param[in] u32Mode Operation mode. It could be - * - \ref GPIO_MODE_INPUT - * - \ref GPIO_MODE_OUTPUT - * - \ref GPIO_MODE_OPEN_DRAIN - * - \ref GPIO_MODE_QUASI - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t u32Idx; - - for(u32Idx = 0ul; u32Idx < GPIO_PIN_MAX; u32Idx++) - { - if((u32PinMask & (1ul << u32Idx)) == (1ul << u32Idx)) - { - port->MODE = (port->MODE & ~(0x3ul << (u32Idx << 1))) | (u32Mode << (u32Idx << 1)); - } - } -} - -/** - * @brief Enable GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB and PE. \n - * It could be 0 ~ 13 for PC GPIO port. \n - * It could be 0 ~ 12, 14 for PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 2 ~ 4, 9 ~ 15 for PG GPIO port. \n - * It could be 4 ~ 11 for PH GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be - * - \ref GPIO_INT_RISING - * - \ref GPIO_INT_FALLING - * - \ref GPIO_INT_BOTH_EDGE - * - \ref GPIO_INT_HIGH - * - \ref GPIO_INT_LOW - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs) -{ - /* Configure interrupt mode of specified pin */ - port->INTTYPE = (port->INTTYPE & ~(1ul << u32Pin)) | (((u32IntAttribs >> 24) & 0xFFUL) << u32Pin); - - /* Enable interrupt function of specified pin */ - port->INTEN = (port->INTEN & ~(0x00010001ul << u32Pin)) | ((u32IntAttribs & 0xFFFFFFUL) << u32Pin); -} - - -/** - * @brief Disable GPIO interrupt - * - - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB and PE. \n - * It could be 0 ~ 13 for PC GPIO port. \n - * It could be 0 ~ 12, 14 for PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 2 ~ 4, 9 ~ 15 for PG GPIO port. \n - * It could be 4 ~ 11 for PH GPIO port. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin) -{ - /* Configure interrupt mode of specified pin */ - port->INTTYPE &= ~(1UL << u32Pin); - - /* Disable interrupt function of specified pin */ - port->INTEN &= ~((0x00010001UL) << u32Pin); -} - -/** - * @brief Set GPIO slew rate control - * - - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * @param[in] u32Mode Slew rate mode. It could be - * - \ref GPIO_SLEWCTL_NORMAL (maximum 40 MHz at 2.7V) - * - \ref GPIO_SLEWCTL_HIGH (maximum 80 MHz at 2.7V) - * - \ref GPIO_SLEWCTL_FAST (maximum 100 MHz at 2.7V) - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t u32Idx; - - for(u32Idx = 0ul; u32Idx < GPIO_PIN_MAX; u32Idx++) - { - if(u32PinMask & (1ul << u32Idx)) - { - port->SLEWCTL = (port->SLEWCTL & ~(0x3ul << (u32Idx << 1))) | (u32Mode << (u32Idx << 1)); - } - } -} - -/** - * @brief Set GPIO Pull-up and Pull-down control - * - - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB and PE. \n - * It could be BIT0 ~ BIT13 for PC. \n - * It could be BIT0 ~ BIT12, BIT14 for PD. \n - * It could be BIT0 ~ BIT11 for PF. \n - * It could be BIT2 ~ BIT3, BIT9 ~ BIT15 for PG. \n - * It could be BIT4 ~ BIT11 for PH. - * @param[in] u32Mode The pin mode of specified GPIO pin. It could be - * - \ref GPIO_PUSEL_DISABLE - * - \ref GPIO_PUSEL_PULL_UP - * - \ref GPIO_PUSEL_PULL_DOWN - * - * @return None - * - * @details Set the pin mode of specified GPIO pin. - */ -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t u32Idx; - - for(u32Idx = 0ul; u32Idx < GPIO_PIN_MAX; u32Idx++) - { - if(u32PinMask & (1ul << u32Idx)) - { - port->PUSEL = (port->PUSEL & ~(0x3ul << (u32Idx << 1))) | (u32Mode << (u32Idx << 1)); - } - } -} - -/**@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group GPIO_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2c.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2c.c deleted file mode 100644 index b2454775921..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2c.c +++ /dev/null @@ -1,1442 +0,0 @@ -/**************************************************************************//** - * @file i2c.c - * @version V3.00 - * $Revision: 2 $ - * $Date: 16/08/02 6:02p $ - * @brief M2355 series I2C Serial Interface Controller(I2C) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ - -/** - * @brief Enable specify I2C Controller and set Clock Divider - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C bus clock in Hz - * - * @return Actual I2C bus clock frequency - * - * @details The function enable the specify I2C Controller and set proper Clock Divider - * in I2C CLOCK DIVIDED REGISTER (I2CLK) according to the target I2C Bus clock. - * I2C Bus clock = PCLK / (4*(divider+1). - * - */ -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if((i2c == I2C1) || (i2c == I2C1_NS)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10u) / (u32BusClock * 4u) + 5u) / 10u - 1u); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - /* Enable I2C */ - i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; - - return (u32Pclk / ((u32Div + 1u) << 2u)); -} - -/** - * @brief Disable specify I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Reset I2C Controller and disable specify I2C port. - * - */ - -void I2C_Close(I2C_T *i2c) -{ - /* Disable I2C */ - i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; -} - -/** - * @brief Clear Time-out Counter flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When Time-out flag will be set, use this function to clear I2C Bus Time-out counter flag . - * - */ -void I2C_ClearTimeoutFlag(I2C_T *i2c) -{ - i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; -} - -/** - * @brief Set Control bit of I2C Controller - * - * @param[in] i2c Specify I2C port - * @param[in] u8Start Set I2C START condition - * @param[in] u8Stop Set I2C STOP condition - * @param[in] u8Si Clear SI flag - * @param[in] u8Ack Set I2C ACK bit - * - * @return None - * - * @details The function set I2C Control bit of I2C Bus protocol. - * - */ -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) -{ - uint32_t u32Reg = 0u; - - if(u8Start) - { - u32Reg |= I2C_CTL_STA; - } - if(u8Stop) - { - u32Reg |= I2C_CTL_STO; - } - if(u8Si) - { - u32Reg |= I2C_CTL_SI; - } - if(u8Ack) - { - u32Reg |= I2C_CTL_AA; - } - - i2c->CTL0 = (i2c->CTL0 & ~0x3Cu) | u32Reg; -} - -/** - * @brief Disable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for disable I2C interrupt - * - */ -void I2C_DisableInt(I2C_T *i2c) -{ - i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Enable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for enable I2C interrupt - * - */ -void I2C_EnableInt(I2C_T *i2c) -{ - i2c->CTL0 |= I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Get I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * - * @return The actual I2C Bus clock in Hz - * - * @details To get the actual I2C Bus Clock frequency. - */ -uint32_t I2C_GetBusClockFreq(I2C_T *i2c) -{ - uint32_t u32Divider = i2c->CLKDIV; - uint32_t u32Pclk; - - if((i2c == I2C1) || (i2c == I2C1_NS)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - return (u32Pclk / ((u32Divider + 1u) << 2u)); -} - -/** - * @brief Set I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C Bus Clock in Hz - * - * @return The actual I2C Bus Clock in Hz - * - * @details To set the actual I2C Bus Clock frequency. - */ -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if((i2c == I2C1) || (i2c == I2C1_NS)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10u) / (u32BusClock * 4u) + 5u) / 10u - 1u); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - return (u32Pclk / ((u32Div + 1u) << 2u)); -} - -/** - * @brief Get Interrupt Flag - * - * @param[in] i2c Specify I2C port - * - * @return I2C interrupt flag status - * - * @details To get I2C Bus interrupt flag. - */ -uint32_t I2C_GetIntFlag(I2C_T *i2c) -{ - return ((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk ? 1ul : 0ul); -} - -/** - * @brief Get I2C Bus Status Code - * - * @param[in] i2c Specify I2C port - * - * @return I2C Status Code - * - * @details To get I2C Bus Status Code. - */ -uint32_t I2C_GetStatus(I2C_T *i2c) -{ - return (i2c->STATUS0); -} - -/** - * @brief Read a Byte from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return I2C Data - * - * @details To read a bytes data from specify I2C port. - */ -uint8_t I2C_GetData(I2C_T *i2c) -{ - return (uint8_t)(i2c->DAT); -} - -/** - * @brief Send a byte to I2C Bus - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data The data to send to I2C bus - * - * @return None - * - * @details This function is used to write a byte to specified I2C port - */ -void I2C_SetData(I2C_T *i2c, uint8_t u8Data) -{ - i2c->DAT = u8Data; -} - -/** - * @brief Set 7-bit Slave Address and GC Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address register (0~3) - * @param[in] u8SlaveAddr 7-bit slave address - * @param[in] u8GCMode Enable/Disable GC mode (I2C_GCMODE_ENABLE / I2C_GCMODE_DISABLE) - * - * @return None - * - * @details This function is used to set 7-bit slave addresses in I2C SLAVE ADDRESS REGISTER (I2CADDR0~3) - * and enable GC Mode. - * - */ -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) -{ - switch(u8SlaveNo) - { - case 1: - i2c->ADDR1 = ((uint32_t)u8SlaveAddr << 1) | u8GCMode; - break; - case 2: - i2c->ADDR2 = ((uint32_t)u8SlaveAddr << 1) | u8GCMode; - break; - case 3: - i2c->ADDR3 = ((uint32_t)u8SlaveAddr << 1) | u8GCMode; - break; - case 0: - default: - i2c->ADDR0 = ((uint32_t)u8SlaveAddr << 1) | u8GCMode; - break; - } -} - -/** - * @brief Configure the mask bits of 7-bit Slave Address - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address mask register (0~3) - * @param[in] u8SlaveAddrMask A byte for slave address mask - * - * @return None - * - * @details This function is used to set 7-bit slave addresses. - * - */ -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) -{ - switch(u8SlaveNo) - { - case 1: - i2c->ADDRMSK1 = (uint32_t)u8SlaveAddrMask << 1; - break; - case 2: - i2c->ADDRMSK2 = (uint32_t)u8SlaveAddrMask << 1; - break; - case 3: - i2c->ADDRMSK3 = (uint32_t)u8SlaveAddrMask << 1; - break; - case 0: - default: - i2c->ADDRMSK0 = (uint32_t)u8SlaveAddrMask << 1; - break; - } -} - -/** - * @brief Enable Time-out Counter Function and support Long Time-out - * - * @param[in] i2c Specify I2C port - * @param[in] u8LongTimeout Configure DIV4 to enable Long Time-out (0/1) - * - * @return None - * - * @details This function enable Time-out Counter function and configure DIV4 to support Long - * Time-out. - * - */ -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) -{ - if(u8LongTimeout) - { - i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; - } - else - { - i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; - } - - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Disable Time-out Counter Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Time-out Counter function in I2CTOC register. - * - */ -void I2C_DisableTimeout(I2C_T *i2c) -{ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Enable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To enable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_EnableWakeup(I2C_T *i2c) -{ - i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_DisableWakeup(I2C_T *i2c) -{ - i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * - */ -uint32_t I2C_SMBusGetStatus(I2C_T *i2c) -{ - return (i2c->BUSSTS); -} - -/** - * @brief Clear SMBus Interrupt Flag - * - * @param[in] i2c Specify I2C port - * @param[in] u8SMBusIntFlag Specify SMBus interrupt flag - * - * @return None - * - * @details To clear flags of I2C_BUSSTS status register if interrupt set. - * - */ -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag) -{ - i2c->BUSSTS = u8SMBusIntFlag; -} - -/** - * @brief Set SMBus Bytes Counts of Transmission or Reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * - */ -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize) -{ - i2c->PKTSIZE = u32PktSize; -} - -/** - * @brief Init SMBus Host/Device Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8HostDevice Init SMBus port mode(I2C_SMBH_ENABLE(1)/I2C_SMBD_ENABLE(0)) - * - * @return None - * - * @details Using SMBus communication must specify the port is a Host or a Device. - * - */ -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice) -{ - /* Clear BMHEN, BMDEN of BUSCTL Register */ - i2c->BUSCTL &= ~(I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BMDEN_Msk); - - /* Set SMBus Host/Device Mode, and enable Bus Management*/ - if(u8HostDevice == (uint8_t)I2C_SMBH_ENABLE) - { - i2c->BUSCTL |= (I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } - else - { - i2c->BUSCTL |= (I2C_BUSCTL_BMDEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } -} - -/** - * @brief Disable SMBus function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable all SMBus function include Bus disable, CRC check, Acknowledge by manual, Host/Device Mode. - * - */ -void I2C_SMBusClose(I2C_T *i2c) -{ - - i2c->BUSCTL = 0x00U; -} - -/** - * @brief Enable SMBus PEC Transmit Function - * - * @param[in] i2c Specify I2C port - * @param[in] u8PECTxEn CRC transmit enable(PECTX_ENABLE) or disable(PECTX_DISABLE) - * - * @return None - * - * @details When enable CRC check function, the Host or Device needs to transmit CRC byte. - * - */ -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn) -{ - i2c->BUSCTL &= ~I2C_BUSCTL_PECTXEN_Msk; - - if(u8PECTxEn) - { - i2c->BUSCTL |= (I2C_BUSCTL_PECEN_Msk | I2C_BUSCTL_PECTXEN_Msk); - } - else - { - i2c->BUSCTL |= I2C_BUSCTL_PECEN_Msk; - } -} - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return A byte is packet error check value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * - */ -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c) -{ - return (uint8_t)i2c->PKTCRC; -} - -/** - * @brief Calculate Time-out of SMBus idle period - * - * @param[in] i2c Specify I2C port - * @param[in] u32Us Time-out length(us) - * @param[in] u32Hclk I2C peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Idle state. - * - */ - -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t u32Us, uint32_t u32Hclk) -{ - uint32_t u32Div, u32HclkKHz; - - i2c->BUSCTL |= I2C_BUSCTL_TIDLE_Msk; - u32HclkKHz = u32Hclk / 1000U; - u32Div = (((u32Us * u32HclkKHz) / 1000U) >> 2U) - 1U; - if(u32Div > 255U) - { - i2c->BUSTOUT = 0xFFU; - } - else - { - i2c->BUSTOUT = u32Div; - } - -} - -/** - * @brief Calculate Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in active state. - * Time-out length is calculate the SCL line "one clock" pull low timing. - * - */ - -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if(u32Div <= 0xFFU) - { - i2c->BUSTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->BUSTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - -/** - * @brief Calculate Cumulative Clock low Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Active state. - * Time-out length is calculate the SCL line "clocks" low cumulative timing. - * - */ - -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if(u32Div <= 0xFFU) - { - i2c->CLKTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->CLKTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - -/** - * @brief Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8Data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master write a byte data to Slave. - * - */ - -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8Data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - - I2C_START(i2c); - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint32_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8Data); /* Write data to I2CDAT */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *au8Data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master write multi bytes data to Slave. - * - */ - -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t au8Data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - case 0x28u: - if(u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, au8Data[u32txLen++]); /* Write Data to I2CDAT */ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] u8Data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t u8Data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Send Slave address with write bit */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u32txLen < 1u) - { - I2C_SET_DATA(i2c, u8Data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *au8Data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t au8Data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, au8Data[u32txLen++]); - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] u8Data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t u8Data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if((u32txLen < 1u) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, u8Data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] au8Data[] A data array for write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t au8Data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if((u32txLen < u32wLen) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, au8Data[u32txLen++]); /* Write data to Register I2CDAT*/ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master to read a byte data from Slave. - * - */ -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | (uint8_t)0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if(u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] au8Rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t au8Rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | (uint8_t)0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - au8Rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if(u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - au8Rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | (uint8_t)0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - u8Rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if(u8Err) - { - u8Rdata = 0u; /* If occurs error, return 0 */ - } - return u8Rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] au8Rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t au8Rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | (uint8_t)0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - au8Rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - if(u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - au8Rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify an address(2 bytes) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Rdata = 0u, u8Addr = 1u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | (uint8_t)0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - u8Rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if(u8Err) - { - u8Rdata = 0u; /* If occurs error, return 0 */ - } - return u8Rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] au8Rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t au8Rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | (uint8_t)0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | (uint8_t)0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - au8Rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if(u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - au8Rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - -/**@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group I2C_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2s.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2s.c deleted file mode 100644 index 3aa4e4c8f41..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_i2s.c +++ /dev/null @@ -1,264 +0,0 @@ -/**************************************************************************//** - * @file i2s.c - * @version V3.00 - * @brief M2354 series I2S driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s); - -/** - * @brief This function is used to get I2S source clock frequency. - * @param[in] i2s The base address of I2S module. - * @return I2S source clock frequency (Hz). - * @details Return the source clock frequency according to the setting of I2S0SEL (CLK_CLKSEL3[17:16]). - */ -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s) -{ - (void)i2s; - uint32_t u32Freq, u32ClkSrcSel; - - u32ClkSrcSel = CLK_GetModuleClockSource(I2S0_MODULE) << CLK_CLKSEL3_I2S0SEL_Pos; - - switch(u32ClkSrcSel) - { - case CLK_CLKSEL3_I2S0SEL_HXT: - u32Freq = __HXT; - break; - - case CLK_CLKSEL3_I2S0SEL_PLL: - u32Freq = CLK_GetPLLClockFreq(); - break; - - case CLK_CLKSEL3_I2S0SEL_HIRC: - u32Freq = __HIRC; - break; - - case CLK_CLKSEL3_I2S0SEL_PCLK0: - u32Freq = CLK_GetPCLK0Freq(); - break; - - default: - u32Freq = CLK_GetPCLK0Freq(); - break; - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * @param[in] i2s The base address of I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are: - * - \ref I2S_MODE_MASTER - * - \ref I2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are: - * - \ref I2S_DATABIT_8 - * - \ref I2S_DATABIT_16 - * - \ref I2S_DATABIT_24 - * - \ref I2S_DATABIT_32 - * @param[in] u32MonoData Set audio data to mono or not. Valid values are: - * - \ref I2S_ENABLE_MONO - * - \ref I2S_DISABLE_MONO - * @param[in] u32DataFormat Data format. This is also used to select I2S or PCM(TDM) function. Valid values are: - * - \ref I2S_FORMAT_I2S - * - \ref I2S_FORMAT_I2S_MSB - * - \ref I2S_FORMAT_I2S_LSB - * - \ref I2S_FORMAT_PCM - * - \ref I2S_FORMAT_PCM_MSB - * - \ref I2S_FORMAT_PCM_LSB - * @return Real sample rate. - * @details Set TX and RX FIFO threshold to middle value. - * The sample rate may not be used from the parameter, it depends on system's clock settings, - * but real sample rate used by system will be returned for reference. - * @note I2S will be reset in initialization only for Secure. - */ -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat) -{ - uint16_t u16Divider; - uint32_t u32BitRate, u32SrcClk; - - if(!(__PC() & NS_OFFSET)) - { - /* Reset I2S */ - SYS->IPRST1 |= SYS_IPRST1_I2S0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2S0RST_Msk; - } - - /* Configure I2S controller according to input parameters. */ - i2s->CTL0 = u32MasterSlave | u32WordWidth | u32MonoData | u32DataFormat; - i2s->CTL1 = I2S_FIFO_TX_LEVEL_WORD_8 | I2S_FIFO_RX_LEVEL_WORD_8; - - /* Get I2S source clock frequency */ - u32SrcClk = I2S_GetSourceClockFreq(i2s); - - /* Calculate bit clock rate */ - u32BitRate = u32SampleRate * (((u32WordWidth >> 4UL) & 0x3UL) + 1UL) * 16UL; - u16Divider = (uint16_t)((((((u32SrcClk * 10UL) / u32BitRate) >> 1UL) + 5UL) / 10UL) - 1UL); /* Round to the nearest integer */ - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_BCLKDIV_Msk) | ((uint32_t)u16Divider << 8UL); - - /* Calculate real sample rate */ - u32BitRate = u32SrcClk / (((uint32_t)u16Divider + 1UL) * 2UL); - u32SampleRate = u32BitRate / ((((u32WordWidth >> 4UL) & 0x3UL) + 1UL) * 16UL); - - /* Enable I2S controller */ - i2s->CTL0 |= I2S_CTL0_I2SEN_Msk; - - return u32SampleRate; -} - -/** - * @brief Disable I2S function. - * @param[in] i2s The base address of I2S module. - * @return None - * @details Clear I2SEN (I2S_CTL0[0]) to disable I2S function. - */ -void I2S_Close(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_I2SEN_Msk; -} - -/** - * @brief Enable interrupt function. - * @param[in] i2s The base address of I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return None - * @details This function enables the interrupt according to the mask parameter. - */ -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN |= u32Mask; -} - -/** - * @brief Disable interrupt function. - * @param[in] i2s The base address of I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return None - * @details This function disables the interrupt according to the mask parameter. - */ -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN &= ~u32Mask; -} - -/** - * @brief Enable master clock (MCLK). - * @param[in] i2s The base address of I2S module. - * @param[in] u32BusClock The target MCLK clock. - * @return Actual MCLK clock - * @details Set the master clock rate according to u32BusClock parameter and enable master clock output. - * The actual master clock rate may be different from the target master clock rate. The real master clock rate will be returned for reference. - */ -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock) -{ - uint8_t u8Divider; - uint32_t u32SrcClk, u32Reg, u32Clock; - - u32SrcClk = I2S_GetSourceClockFreq(i2s); - if(u32BusClock == u32SrcClk) - { - u8Divider = (uint8_t)0UL; - } - else - { - u8Divider = (uint8_t)(u32SrcClk / u32BusClock) >> 1UL; - } - - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_MCLKDIV_Msk) | u8Divider; - - i2s->CTL0 |= I2S_CTL0_MCLKEN_Msk; - - u32Reg = i2s->CLKDIV & I2S_CLKDIV_MCLKDIV_Msk; - - if(u32Reg == 0UL) - { - u32Clock = u32SrcClk; - } - else - { - u32Clock = ((u32SrcClk >> 1UL) / u32Reg); - } - - return u32Clock; -} - -/** - * @brief Disable master clock (MCLK). - * @param[in] i2s The base address of I2S module. - * @return None - * @details Disable master clock output. - */ -void I2S_DisableMCLK(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 15. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 15. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->CTL1 = (i2s->CTL1 & ~(I2S_CTL1_TXTH_Msk | I2S_CTL1_RXTH_Msk)) | - (u32TxThreshold << I2S_CTL1_TXTH_Pos) | - (u32RxThreshold << I2S_CTL1_RXTH_Pos); -} - -/** - * @brief Configure PCM(TDM) function parameters, such as channel width, channel number and sync pulse width - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChannelWidth Channel width. Valid values are: - * - \ref I2S_TDM_WIDTH_8BIT - * - \ref I2S_TDM_WIDTH_16BIT - * - \ref I2S_TDM_WIDTH_24BIT - * - \ref I2S_TDM_WIDTH_32BIT - * @param[in] u32ChannelNum Channel number. Valid values are: - * - \ref I2S_TDM_2CH - * - \ref I2S_TDM_4CH - * - \ref I2S_TDM_6CH - * - \ref I2S_TDM_8CH - * @param[in] u32SyncWidth Width for sync pulse. Valid values are: - * - \ref I2S_TDM_SYNC_ONE_BCLK - * - \ref I2S_TDM_SYNC_ONE_CHANNEL - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth) -{ - i2s->CTL0 = (i2s->CTL0 & ~(I2S_CTL0_TDMCHNUM_Msk | I2S_CTL0_CHWIDTH_Msk | I2S_CTL0_PCMSYNC_Msk)) | - (u32ChannelWidth << I2S_CTL0_CHWIDTH_Pos) | - (u32ChannelNum << I2S_CTL0_TDMCHNUM_Pos) | - (u32SyncWidth << I2S_CTL0_PCMSYNC_Pos); -} - -/**@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group I2S_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_keystore.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_keystore.c deleted file mode 100644 index 7238571be53..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_keystore.c +++ /dev/null @@ -1,561 +0,0 @@ -/**************************************************************************//** - * @file keystore.c - * @version V3.00 - * @brief Key store driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KS_Driver Key Store Driver - @{ -*/ - - -/** @addtogroup KS_EXPORTED_FUNCTIONS Key Store Exported Functions - @{ -*/ - -/** - * @brief Initial key store - * @return None - * @details This function is used to initial the key store. - * It is necessary to be called before using other APIs of Key Store. - */ -void KS_Open(void) -{ - if((KS->STS & KS_STS_INITDONE_Msk) == 0) - { - /* Waiting for busy */ - while(KS->STS & KS_STS_BUSY_Msk) {} - - /* Start Key Store Initial */ - KS->CTL = KS_CTL_INIT_Msk | KS_CTL_START_Msk; - - /* Waiting for initilization */ - while((KS->STS & KS_STS_INITDONE_Msk) == 0); - - } - - /* Waiting busy to make sure KS is ready. */ - while(KS->STS & KS_STS_BUSY_Msk); - -} - - -/** - * @brief Read key from key store - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] i32KeyIdx The key index to read - * @param[out] au32Key The buffer to store the key - * @param[in] u32WordCnt The word (32-bit) count of the key buffer size - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to read the key. - */ - -int32_t KS_Read(KS_MEM_Type eType, int32_t i32KeyIdx, uint32_t au32Key[], uint32_t u32WordCnt) -{ - int32_t i32Cnt; - uint32_t u32Cont; - int32_t offset, i, cnt; - - /* Just return when key store is in busy */ - if(KS->STS & KS_STS_BUSY_Msk) - return -1; - - /* Specify the key address */ - KS->METADATA = ((uint32_t)eType << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - offset = 0; - u32Cont = 0; - i32Cnt = (int32_t)u32WordCnt; - do - { - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Trigger to read the key */ - KS->CTL = u32Cont | KS_OP_READ | KS_CTL_START_Msk | (KS->CTL & (KS_CTL_SILENT_Msk | KS_CTL_SCMB_Msk)); - /* Waiting for key store processing */ - while(KS->STS & KS_STS_BUSY_Msk); - - /* Read the key to key buffer */ - cnt = i32Cnt; - if(cnt > 8) - cnt = 8; - for(i = 0; i < cnt; i++) - { - au32Key[offset + i] = KS->KEY[i]; - //printf("R[%d]:0x%08x\n", i, au32Key[offset+i]); - } - - u32Cont = KS_CTL_CONT_Msk; - i32Cnt -= 8; - offset += 8; - } - while(i32Cnt > 0); - - /* Check error flag */ - if(KS->STS & KS_STS_EIF_Msk) - return -1; - - - return 0; -} - -/** - * @brief Get the word count of the specified Metadata key length - * @param[in] u32Meta The metadata define of the key length. It could be - \ref KS_META_128 - \ref KS_META_163 - \ref KS_META_192 - \ref KS_META_224 - \ref KS_META_233 - \ref KS_META_255 - \ref KS_META_256 - \ref KS_META_283 - \ref KS_META_384 - \ref KS_META_409 - \ref KS_META_512 - \ref KS_META_521 - \ref KS_META_571 - \ref KS_META_1024 - \ref KS_META_2048 - \ref KS_META_4096 - * @return The word (32-bit) count of the key - * @details This function is used to get word counts of the specified metadata key length. - * It could be used to know how may words needs to allocate for the key. - */ - -uint32_t KS_GetKeyWordCnt(uint32_t u32Meta) -{ - const uint16_t au8CntTbl[21] = { 4, 6, 6, 7, 8, 8, 8, 9, 12, 13, 16, 17, 18, 0, 0, 0, 32, 48, 64, 96, 128 }; - return au8CntTbl[((u32Meta & KS_METADATA_SIZE_Msk) >> KS_METADATA_SIZE_Pos)]; -} - -/** - * @brief Write key to key store -* @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - * @param[in] u32Meta The metadata of the key. It could be the combine of - \ref KS_META_AES - \ref KS_META_HMAC - \ref KS_META_RSA_EXP - \ref KS_META_RSA_MID - \ref KS_META_ECC - \ref KS_META_CPU - \ref KS_META_128 - \ref KS_META_163 - \ref KS_META_192 - \ref KS_META_224 - \ref KS_META_233 - \ref KS_META_255 - \ref KS_META_256 - \ref KS_META_283 - \ref KS_META_384 - \ref KS_META_409 - \ref KS_META_512 - \ref KS_META_521 - \ref KS_META_571 - \ref KS_META_1024 - \ref KS_META_2048 - \ref KS_META_4096 - \ref KS_META_BOOT - \ref KS_META_READABLE - \ref KS_META_PRIV - \ref KS_META_NONPRIV - \ref KS_META_SECURE - \ref KS_META_NONSECUR - - * @param[out] au32Key The buffer to store the key - * @param[in] u32WordCnt The word (32-bit) count of the key buffer size - * @return Index of the key. Failed when index < 0. - * @details This function is used to write a key to key store. - */ - -int32_t KS_Write(KS_MEM_Type eType, uint32_t u32Meta, uint32_t au32Key[]) -{ - int32_t i32Cnt; - uint32_t u32Cont; - int32_t offset, i, cnt; - - - /* Just return when key store is in busy */ - if(KS->STS & KS_STS_BUSY_Msk) - return -1; - - /* Specify the key address */ - KS->METADATA = (eType << KS_METADATA_DST_Pos) | u32Meta; - - /* Get size index */ - i32Cnt = (int32_t)KS_GetKeyWordCnt(u32Meta); - - /* Invalid key length */ - if(i32Cnt == 0) - return -1; - - /* OTP only support maximum 256 bits */ - if((eType == KS_OTP) && (i32Cnt > 8)) - return -1; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - offset = 0; - u32Cont = 0; - do - { - /* Prepare the key to write */ - cnt = i32Cnt; - if(cnt > 8) - cnt = 8; - for(i = 0; i < cnt; i++) - { - KS->KEY[i] = au32Key[offset + i]; - } - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Write the key */ - KS->CTL = u32Cont | KS_OP_WRITE | KS_CTL_START_Msk | (KS->CTL & (KS_CTL_SILENT_Msk | KS_CTL_SCMB_Msk)); - - u32Cont = KS_CTL_CONT_Msk; - i32Cnt -= 8; - offset += 8; - - /* Waiting for key store processing */ - while(KS->STS & KS_STS_BUSY_Msk); - - } - while(i32Cnt > 0); - - /* Check error flag */ - if(KS->STS & KS_STS_EIF_Msk) - { - //printf("KS_Write. EIF!\n"); - return -1; - } - - return KS_TOKEYIDX(KS->METADATA); -} - -/** - * @brief Erase a key from key store - * @param[in] i32KeyIdx The key index to read - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to erase a key from SRAM of key store. - */ -int32_t KS_EraseKey(int32_t i32KeyIdx) -{ - /* Just return when key store is in busy */ - if(KS->STS & KS_STS_BUSY_Msk) - return -1; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = (KS_SRAM << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_ERASE | KS_CTL_START_Msk | (KS->CTL & (KS_CTL_SILENT_Msk | KS_CTL_SCMB_Msk)); - - /* Waiting for processing */ - while(KS->STS & KS_STS_BUSY_Msk); - - /* Check error flag */ - if(KS->STS & KS_STS_EIF_Msk) - return -1; - - return 0; - -} - - -/** - * @brief Erase all keys from key store - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] i32KeyIdx The key index to read - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to erase all keys in SRAM or Flash of key store. - */ -int32_t KS_EraseAll(KS_MEM_Type eType) -{ - /* Just return when key store is in busy */ - if(KS->STS & KS_STS_BUSY_Msk) - return -1; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = (eType << KS_METADATA_DST_Pos); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_ERASE_ALL | KS_CTL_START_Msk | (KS->CTL & (KS_CTL_SILENT_Msk | KS_CTL_SCMB_Msk)); - - /* Waiting for processing */ - while(KS->STS & KS_STS_BUSY_Msk); - - /* Check error flag */ - if(KS->STS & KS_STS_EIF_Msk) - return -1; - - return 0; - -} - - - -/** - * @brief Revoke a key in key store - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] i32KeyIdx The key index to read - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to revoke a key in key store. - */ -int32_t KS_RevokeKey(KS_MEM_Type eType, int32_t i32KeyIdx) -{ - /* Just return when key store is in busy */ - if(KS->STS & KS_STS_BUSY_Msk) - return -1; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = (eType << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_REVOKE | KS_CTL_START_Msk | (KS->CTL & (KS_CTL_SILENT_Msk | KS_CTL_SCMB_Msk)); - - /* Waiting for processing */ - while(KS->STS & KS_STS_BUSY_Msk); - - /* Check error flag */ - if(KS->STS & KS_STS_EIF_Msk) - return -1; - - return 0; - -} - - -/** - * @brief Get remain size of specified Key Store memory - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - * @retval remain size of specified Key Store memory - * @details This function is used to get remain size of Key Store. - */ -uint32_t KS_GetRemainSize(KS_MEM_Type mem) -{ - uint32_t u32Reg; - uint32_t u32SramRemain, u32FlashRemain; - - u32Reg = KS->REMAIN; - //printf("KS Remain 0x%08x\n", u32Reg); - //printf("SRAM remain %lu bytes, Flash remain %lu bytes\n",(u32Reg&KS_REMAIN_RRMNG_Msk) >> KS_REMAIN_RRMNG_Pos, (u32Reg&KS_REMAIN_FRMNG_Msk) >> KS_REMAIN_FRMNG_Pos); - u32SramRemain = (u32Reg & KS_REMAIN_RRMNG_Msk) >> KS_REMAIN_RRMNG_Pos; - u32FlashRemain = (u32Reg & KS_REMAIN_FRMNG_Msk) >> KS_REMAIN_FRMNG_Pos; - - if(mem == KS_SRAM) - return u32SramRemain; - else - return u32FlashRemain; -} - - - -/** - * @brief Get remain key count of specified Key Store memory - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - * @retval Remain key count in the specified key store memory - * @details This function is used to get remain key count in specified key store memory. - */ -uint32_t KS_GetRemainKeyCount(KS_MEM_Type mem) -{ - uint32_t u32Reg; - uint32_t u32SramRemain, u32FlashRemain; - - u32Reg = KS->REMKCNT; - u32SramRemain = (u32Reg & KS_REMKCNT_RRMKCNT_Msk) >> KS_REMKCNT_RRMKCNT_Pos; - u32FlashRemain = (u32Reg & KS_REMKCNT_FRMKCNT_Msk) >> KS_REMKCNT_FRMKCNT_Pos; - - if(mem == KS_SRAM) - return u32SramRemain; - else - return u32FlashRemain; -} - - - -/** - * @brief Write OTP key to key store - * @param[in] i32KeyIdx The OTP key index to store the key. It could be 0~7. - OTP key index 0 is default for ROTPK. - * @param[in] u32Meta The metadata of the key. It could be the combine of - \ref KS_META_AES - \ref KS_META_HMAC - \ref KS_META_RSA_EXP - \ref KS_META_RSA_MID - \ref KS_META_ECC - \ref KS_META_CPU - \ref KS_META_128 - \ref KS_META_163 - \ref KS_META_192 - \ref KS_META_224 - \ref KS_META_233 - \ref KS_META_255 - \ref KS_META_256 - \ref KS_META_BOOT - \ref KS_META_READABLE - \ref KS_META_PRIV - \ref KS_META_NONPRIV - \ref KS_META_SECURE - \ref KS_META_NONSECUR - - * @param[out] au32Key The buffer to store the key - * @param[in] u32WordCnt The word (32-bit) count of the key buffer size - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to write a key to OTP key store. - */ -int32_t KS_WriteOTP(int32_t i32KeyIdx, uint32_t u32Meta, uint32_t au32Key[]) -{ - const uint16_t au8CntTbl[7] = {4, 6, 6, 7, 8, 8, 8}; - int32_t i32Cnt; - uint32_t u32Cont; - int32_t offset, i, cnt, sidx; - - - /* Just return when key store is in busy */ - if(KS->STS & KS_STS_BUSY_Msk) - return -1; - - /* Specify the key address */ - KS->METADATA = ((uint32_t)KS_OTP << KS_METADATA_DST_Pos) | u32Meta | KS_TOMETAKEY(i32KeyIdx); - - /* Get size index */ - sidx = (u32Meta >> KS_METADATA_SIZE_Pos) & 0xful; - - /* OTP only support maximum 256 bits */ - if(sidx >= 7) - return -1; - - i32Cnt = au8CntTbl[sidx]; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - offset = 0; - u32Cont = 0; - do - { - /* Prepare the key to write */ - cnt = i32Cnt; - if(cnt > 8) - cnt = 8; - for(i = 0; i < cnt; i++) - { - KS->KEY[i] = au32Key[offset + i]; - } - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Write the key */ - KS->CTL = u32Cont | KS_OP_WRITE | KS_CTL_START_Msk | (KS->CTL & (KS_CTL_SILENT_Msk | KS_CTL_SCMB_Msk)); - - u32Cont = KS_CTL_CONT_Msk; - i32Cnt -= 8; - offset += 8; - - /* Waiting for key store processing */ - while(KS->STS & KS_STS_BUSY_Msk); - - } - while(i32Cnt > 0); - - /* Check error flag */ - if(KS->STS & KS_STS_EIF_Msk) - { - //printf("KS_WriteOTP. EIF!\n"); - return -1; - } - - return i32KeyIdx; -} - - -/** - * @brief Trigger to inverse the date in KS_SRAM. - * @retval 1 The data in KS SRAM is inverted. - * @retval 0 The data in KS SRAM is non-inverted. - * @retval -1 Fail to invert the date in KS SRAM. - * @details This function is used to trigger anti-remanence procedure by inverse the data in SRAM. - * This won't change the reading key. - */ - -int32_t KS_ToggleSRAM(void) -{ - /* Just return when key store is in busy */ - if(KS->STS & KS_STS_BUSY_Msk) - return -1; - - - /* Specify the key address */ - KS->METADATA = ((uint32_t)KS_SRAM << KS_METADATA_DST_Pos); - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - /* Trigger to do anti-remanence procedure */ - KS->CTL = KS_OP_REMAN | KS_CTL_START_Msk; - - /* Waiting for key store processing */ - while(KS->STS & KS_STS_BUSY_Msk); - - /* Check error flag */ - if(KS->STS & KS_STS_EIF_Msk) - return -1; - - return ((KS->STS & KS_STS_RAMINV_Msk) > 0); -} - - -/**@}*/ /* end of group KS_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group KS_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_lcd.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_lcd.c deleted file mode 100644 index cccb4df5a4d..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_lcd.c +++ /dev/null @@ -1,338 +0,0 @@ -/**************************************************************************//** - * @file lcd.c - * @version V3.00 - * @brief Liquid-Crystal Display(LCD) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup LCD_Driver LCD Driver - @{ -*/ - - -/// @cond HIDDEN_SYMBOLS - -/** @addtogroup LCD_EXPORTED_VARIABLES LCD Exported Variables - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Global file scope (static) variables */ -/*---------------------------------------------------------------------------------------------------------*/ -static uint32_t g_LCDFrameRate; - -/**@}*/ /* end of group LCD_EXPORTED_VARIABLES */ - -/// @endcond /* HIDDEN_SYMBOLS */ - - -/** @addtogroup LCD_EXPORTED_FUNCTIONS LCD Exported Functions - @{ -*/ - -/** - * @brief LCD Initialization routine - * - * @param[in] pLCDCfg Specify the LCD property. It includes: - * u32SrcFreq: Clock source frequency of LCD controller. - * u32ComDuty: LCD COM duty ratio selection. Valid values are: - * - \ref LCD_COM_DUTY_1_1 - * - \ref LCD_COM_DUTY_1_2 - * - \ref LCD_COM_DUTY_1_3 - * - \ref LCD_COM_DUTY_1_4 - * - \ref LCD_COM_DUTY_1_5 - * - \ref LCD_COM_DUTY_1_6 - * - \ref LCD_COM_DUTY_1_7 - * - \ref LCD_COM_DUTY_1_8 - * u32BiasLevel: LCD Bias level selection. Valid values are: - * - \ref LCD_BIAS_LV_1_2 - * - \ref LCD_BIAS_LV_1_3 - * - \ref LCD_BIAS_LV_1_4 - * u32Framerate: Specify the target LCD operating frame rate (Hz). - * u32WaveformType: Specify the LCD waveform type. Valid values are: - * - \ref LCD_WAVEFORM_TYPE_A_NORMAL - * - \ref LCD_WAVEFORM_TYPE_B_NORMAL - * - \ref LCD_WAVEFORM_TYPE_A_INVERSE - * - \ref LCD_WAVEFORM_TYPE_B_INVERSE - * u32IntSrc: Interrupt source selection. Valid values are: - * - \ref LCD_DISABLE_ALL_INT - * - \ref LCD_FRAME_COUNTING_END_INT - * - \ref LCD_FRAME_END_INT - * - \ref LCD_CPTOUT_INT - * - \ref LCD_ENABLE_ALL_INT - * u32DrivingMode: LCD operation driving mode selection. Valid values are: - * - \ref LCD_LOW_DRIVING_AND_BUF_OFF - * - \ref LCD_HIGH_DRIVING_AND_BUF_OFF - * - \ref LCD_HIGH_DRIVING_AND_BUF_OFF_AND_PWR_SAVING - * - \ref LCD_HIGH_DRIVING_AND_BUF_OFF_AND_PWR_SAVING - * - \ref LCD_LOW_DRIVING_AND_BUF_ON_AND_PWR_SAVING - * u32VSrc: Voltage source selection. Valid values are: - * - \ref LCD_VOLTAGE_SOURCE_VLCD - * - \ref LCD_VOLTAGE_SOURCE_AVDD - * - \ref LCD_VOLTAGE_SOURCE_CP - * - * @return The real LCD operating frame rate. Or 0 means LCD_Open failed. - * - * @details This function will configure the LCD properties for driving the LCD display well. - * After that, user can perform \ref LCD_ENABLE_DISPLAY() to enable LCD controller for LCD display. - */ -uint32_t LCD_Open(S_LCD_CFG_T *pLCDCfg) -{ - uint32_t u32ComNum, u32FreqLCD, u32FreqDiv; - - /* Display LCD display first */ - LCD_DISABLE_DISPLAY(); - - /* Turn all segments off */ - LCD_SetAllPixels(0); - - /* Set com and bias */ - LCD->PCTL = (pLCDCfg->u32ComDuty | pLCDCfg->u32BiasLevel); - - /* Set waveform type */ - LCD_WAVEFORM_TYPE(pLCDCfg->u32WaveformType); - - /* Configure interrupt source */ - LCD->INTEN = pLCDCfg->u32IntSrc; - - /* Set driving mode */ - LCD_DRIVING_MODE(pLCDCfg->u32DrivingMode); - - /* Select voltage source */ - LCD_VOLTAGE_SOURCE(pLCDCfg->u32VSrc); - - /* - An example for specify frame rate. - If LCD source clock is 32768Hz, COM duty 4. - In type-A: - One frame rate 32Hz, frame end event rate 32Hz. - 32 = (1/4) * F_LCD * (1/2) - F_LCD = 32 * 4 * 2 = 256 = (32768 / F_Div) - F_Div = (32768 / F_LCD) = 128 - In type-B: - Each even/odd frame rate 32Hz, frame end event rate 16Hz. - 32 = (1/4) * F_LCD - F_LCD = 32 * 4 = (32768 / F_Div) - F_Div = (32768 / F_LCD) = 256 - */ - u32ComNum = ((pLCDCfg->u32ComDuty & LCD_PCTL_DUTY_Msk) >> LCD_PCTL_DUTY_Pos) + 1; - if((pLCDCfg->u32WaveformType & LCD_PCTL_TYPE_Msk) == LCD_PCTL_TYPE_Msk) - { - /* In type-B */ - - /* Calculate LCD operation frequency */ - u32FreqLCD = (pLCDCfg->u32Framerate * u32ComNum); - - /* Calculate possible freq. divider */ - u32FreqDiv = (pLCDCfg->u32SrcFreq / u32FreqLCD); - - if(u32FreqDiv > 1024) - { - /* Invalid frame rate */ - g_LCDFrameRate = 0ul; - } - else - { - /* Set freq. divider */ - LCD_SET_FREQDIV(u32FreqDiv); - - /* Calculate target frame rate */ - g_LCDFrameRate = pLCDCfg->u32SrcFreq / (u32ComNum * u32FreqDiv); - } - } - else - { - /* In type-A */ - - /* Calculate LCD operation frequency */ - u32FreqLCD = (pLCDCfg->u32Framerate * u32ComNum) * 2; - - /* Calculate possible freq. divider */ - u32FreqDiv = (pLCDCfg->u32SrcFreq / u32FreqLCD); - - if(u32FreqDiv > 1024) - { - /* Invalid frame rate */ - g_LCDFrameRate = 0ul; - } - else - { - /* Set freq. divider */ - LCD_SET_FREQDIV(u32FreqDiv); - - /* Calculate target frame rate */ - g_LCDFrameRate = (pLCDCfg->u32SrcFreq / (u32ComNum * u32FreqDiv)) / 2; - } - } - - return g_LCDFrameRate; -} - -/** - * @brief Disable LCD Display - * - * @param[in] None - * - * @return None - * - * @details This function is used to disable LCD display. - */ -void LCD_Close(void) -{ - LCD_DISABLE_DISPLAY(); -} - -/** - * @brief Enables a Segment Display - * - * @param[in] u32Com Specify COM number. Valid values are from 0~7. - * @param[in] u32Seg Specify Segment number. Valid values are from 0~43. - * @param[in] u32OnFlag 0 : Segment not display - * 1 : Segment display - * - * @return None - * - * @details This function is used to enable specified segment display on the LCD. - */ -void LCD_SetPixel(uint32_t u32Com, uint32_t u32Seg, uint32_t u32OnFlag) -{ - uint32_t seg_num = (u32Seg / 4); - uint32_t seg_shift = (8 * (u32Seg - (4 * seg_num))); - - if(seg_num < 11) - { - if(u32OnFlag) - { - LCD->DATA[seg_num] |= ((uint32_t)(1 << u32Com) << seg_shift); - } - else - { - LCD->DATA[seg_num] &= (~((uint32_t)(1 << u32Com) << seg_shift)); - } - } -} - -/** - * @brief Enable/Disable all LCD segments - * - * @param[in] u32OnOff 0 : Disable all segments display - * 1 : Enable all segments display - * - * @return None - * - * @details This function is used to enable/disable all LCD segments display. - */ -void LCD_SetAllPixels(uint32_t u32OnOff) -{ - uint32_t i, u32Value; - - if(u32OnOff == 1ul) - { - u32Value = 0xFFFFFFFFul; - } - else - { - u32Value = 0x00000000ul; - } - - for(i = 0; i < 11; i++) - LCD->DATA[i] = u32Value; -} - -/** - * @brief Enable LCD Blinking - * - * @param[in] u32ms Blinking period time(unit: ms) - * - * @return Real blinking period time(ms) - * - * @details This function is used to enable blink display with specified period. - */ -uint32_t LCD_EnableBlink(uint32_t u32ms) -{ - uint32_t u32OneCountPeriod, u32TargetCounts; - - if((LCD->PCTL & LCD_PCTL_TYPE_Msk) == LCD_PCTL_TYPE_Msk) - { - /* In type-B */ - u32OneCountPeriod = (1000 * 2) / g_LCDFrameRate; // ms - } - else - { - /* In type-A */ - u32OneCountPeriod = 1000 / g_LCDFrameRate; // ms - } - - u32TargetCounts = (u32ms / u32OneCountPeriod); - if(u32TargetCounts == 0) - u32TargetCounts = 1; - if(u32TargetCounts > 1024) - u32TargetCounts = 1024; - - LCD_SET_FRAME_COUNTING_VALUE(u32TargetCounts); - - /* Enable blink display */ - LCD_BLINKING_ON(); - - return (u32OneCountPeriod * u32TargetCounts); -} - -/** - * @brief Disable LCD Blinking - * - * @param[in] None - * - * @return None - * - * @details This function is used to disable LCD blink display. - */ -void LCD_DisableBlink(void) -{ - /* Disable blink display */ - LCD_BLINKING_OFF(); -} - -/** - * @brief Enable LCD Interrupt - * - * @param[in] IntSrc Interrupt Source. It could be a combination of - * \ref LCD_FRAME_COUNTING_END_INT, \ref LCD_FRAME_END_INT and \ref LCD_CPTOUT_INT. - * - * @return None - * - * @details This function is used to enable the specific LCD interrupt. - */ -void LCD_EnableInt(uint32_t u32IntSrc) -{ - LCD->INTEN |= (u32IntSrc); -} - -/** - * @brief Disable LCD Interrupt - * - * @param[in] IntSrc Interrupt Source. It could be a combination of - * \ref LCD_FRAME_COUNTING_END_INT, \ref LCD_FRAME_END_INT and \ref LCD_CPTOUT_INT. - * - * @return None - * - * @details This function is used to disable the specific LCD interrupt. - */ -void LCD_DisableInt(uint32_t u32IntSrc) -{ - LCD->INTEN &= ~(u32IntSrc); -} - - -/**@}*/ /* end of group LCD_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group LCD_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_pdma.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_pdma.c deleted file mode 100644 index c9bcdf7988c..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_pdma.c +++ /dev/null @@ -1,448 +0,0 @@ -/**************************************************************************//** - * @file pdma.c - * @version V3.00 - * @brief M2354 series PDMA driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - - -/** @addtogroup PDMA_EXPORTED_FUNCTIONS PDMA Exported Functions - @{ -*/ - -/** - * @brief PDMA Open - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable the PDMA channels. - */ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask) -{ - uint32_t i; - - for (i = 0UL; i < PDMA_CH_MAX; i++) - { - if ((1 << i) & u32Mask) - { - pdma->DSCT[i].CTL = 0UL; - } - } - - pdma->CHCTL |= u32Mask; -} - -/** - * @brief PDMA Close - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details This function disable all PDMA channels. - */ -void PDMA_Close(PDMA_T *pdma) -{ - pdma->CHCTL = 0UL; -} - -/** - * @brief Set PDMA Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Width Data width. Valid values are - * - \ref PDMA_WIDTH_8 - * - \ref PDMA_WIDTH_16 - * - \ref PDMA_WIDTH_32 - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected channel data width and transfer count. - */ -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXCNT_Msk | PDMA_DSCT_CTL_TXWIDTH_Msk); - pdma->DSCT[u32Ch].CTL |= (u32Width | ((u32TransCount - 1UL) << PDMA_DSCT_CTL_TXCNT_Pos)); -} - -/** - * @brief Set PDMA Stride Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestLen Destination stride count - * @param[in] u32SrcLen Source stride count - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected stride mode. - */ -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount) -{ - (pdma)->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - (pdma)->STRIDE[u32Ch].ASOCR = (u32DestLen << 16) | u32SrcLen; - (pdma)->STRIDE[u32Ch].STCR = u32TransCount; -} - -/** - * @brief Set PDMA Repeat - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestInterval Destination address interval count - * @param[in] u32SrcInterval Source address interval count - * @param[in] u32RepeatCount Repeat count - * - * @return None - * - * @details This function set the selected repeat. - */ -void PDMA_SetRepeat(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount) -{ - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - pdma->REPEAT[u32Ch].AICTL = ((u32DestInterval) << 16) | (u32SrcInterval); - pdma->REPEAT[u32Ch].RCNT = u32RepeatCount; -} - -/** - * @brief Set PDMA Transfer Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32SrcAddr Source address - * @param[in] u32SrcCtrl Source control attribute. Valid values are - * - \ref PDMA_SAR_INC - * - \ref PDMA_SAR_FIX - * @param[in] u32DstAddr Destination address - * @param[in] u32DstCtrl Destination control attribute. Valid values are - * - \ref PDMA_DAR_INC - * - \ref PDMA_DAR_FIX - * - * @return None - * - * @details This function set the selected channel source/destination address and attribute. - */ -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl) -{ - pdma->DSCT[u32Ch].SA = u32SrcAddr; - pdma->DSCT[u32Ch].DA = u32DstAddr; - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_SAINC_Msk | PDMA_DSCT_CTL_DAINC_Msk); - pdma->DSCT[u32Ch].CTL |= (u32SrcCtrl | u32DstCtrl); -} - -/** - * @brief Set PDMA Transfer Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Peripheral The selected peripheral. Valid values are - * - \ref PDMA_MEM - * - \ref PDMA_USB_TX - * - \ref PDMA_USB_RX - * - \ref PDMA_UART0_TX - * - \ref PDMA_UART0_RX - * - \ref PDMA_UART1_TX - * - \ref PDMA_UART1_RX - * - \ref PDMA_UART2_TX - * - \ref PDMA_UART2_RX - * - \ref PDMA_UART3_TX - * - \ref PDMA_UART3_RX - * - \ref PDMA_UART4_TX - * - \ref PDMA_UART4_RX - * - \ref PDMA_UART5_TX - * - \ref PDMA_UART5_RX - * - \ref PDMA_USCI0_TX - * - \ref PDMA_USCI0_RX - * - \ref PDMA_USCI1_TX - * - \ref PDMA_USCI1_RX - * - \ref PDMA_QSPI0_TX - * - \ref PDMA_QSPI0_RX - * - \ref PDMA_SPI0_TX - * - \ref PDMA_SPI0_RX - * - \ref PDMA_SPI1_TX - * - \ref PDMA_SPI1_RX - * - \ref PDMA_SPI2_TX - * - \ref PDMA_SPI2_RX - * - \ref PDMA_SPI3_TX - * - \ref PDMA_SPI3_RX - * - \ref PDMA_EPWM0_P1_RX - * - \ref PDMA_EPWM0_P2_RX - * - \ref PDMA_EPWM0_P3_RX - * - \ref PDMA_EPWM1_P1_RX - * - \ref PDMA_EPWM1_P2_RX - * - \ref PDMA_EPWM1_P3_RX - * - \ref PDMA_I2C0_TX - * - \ref PDMA_I2C0_RX - * - \ref PDMA_I2C1_TX - * - \ref PDMA_I2C1_RX - * - \ref PDMA_I2C2_TX - * - \ref PDMA_I2C2_RX - * - \ref PDMA_I2S0_TX - * - \ref PDMA_I2S0_RX - * - \ref PDMA_TMR0 - * - \ref PDMA_TMR1 - * - \ref PDMA_TMR2 - * - \ref PDMA_TMR3 - * - \ref PDMA_ADC_RX - * - \ref PDMA_DAC0_TX - * - \ref PDMA_DAC1_TX - * - \ref PDMA_EPWM0_CH0_TX - * - \ref PDMA_EPWM0_CH1_TX - * - \ref PDMA_EPWM0_CH2_TX - * - \ref PDMA_EPWM0_CH3_TX - * - \ref PDMA_EPWM0_CH4_TX - * - \ref PDMA_EPWM0_CH5_TX - * - \ref PDMA_EPWM1_CH0_TX - * - \ref PDMA_EPWM1_CH1_TX - * - \ref PDMA_EPWM1_CH2_TX - * - \ref PDMA_EPWM1_CH3_TX - * - \ref PDMA_EPWM1_CH4_TX - * - \ref PDMA_EPWM1_CH5_TX - * @param[in] u32ScatterEn Scatter-gather mode enable - * @param[in] u32DescAddr Scatter-gather descriptor address - * - * @return None - * - * @details This function set the selected channel transfer mode. Include peripheral setting. - */ -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - pau32REQSEL[u32Ch / 4] = (pau32REQSEL[u32Ch / 4] & ~u32REQSEL_Msk) | (u32Peripheral << u32REQSEL_Pos); - - if (u32ScatterEn) - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_SCATTER; - pdma->DSCT[u32Ch].NEXT = u32DescAddr - (pdma->SCATBA); - } - else - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_BASIC; - } - } - else {} -} - -/** - * @brief Set PDMA Burst Type and Size - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32BurstType Burst mode or single mode. Valid values are - * - \ref PDMA_REQ_SINGLE - * - \ref PDMA_REQ_BURST - * @param[in] u32BurstSize Set the size of burst mode. Valid values are - * - \ref PDMA_BURST_128 - * - \ref PDMA_BURST_64 - * - \ref PDMA_BURST_32 - * - \ref PDMA_BURST_16 - * - \ref PDMA_BURST_8 - * - \ref PDMA_BURST_4 - * - \ref PDMA_BURST_2 - * - \ref PDMA_BURST_1 - * - * @return None - * - * @details This function set the selected channel burst type and size. - */ -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXTYPE_Msk | PDMA_DSCT_CTL_BURSIZE_Msk); - pdma->DSCT[u32Ch].CTL |= (u32BurstType | u32BurstSize); -} - -/** - * @brief Enable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable timeout function of the selected channel(s). - */ -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN |= u32Mask; -} - -/** - * @brief Disable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function disable timeout function of the selected channel(s). - * @note This function is only supported in channel 0 and channel 1. - */ -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN &= ~u32Mask; -} - -/** - * @brief Set PDMA Timeout Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32OnOff Enable/disable time out function - * @param[in] u32TimeOutCnt Timeout count - * - * @return None - * - * @details This function set the timeout count. - * @note This function is only supported in channel 0 and channel 1. - */ -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt) -{ - if (u32Ch < 2) - { - __IO uint32_t *pau32TOC = (__IO uint32_t *)&pdma->TOC0_1; - uint32_t u32TOC_Pos, u32TOC_Msk; - - u32TOC_Pos = (u32Ch % 2) * 16 ; - u32TOC_Msk = PDMA_TOC0_1_TOC0_Msk << u32TOC_Pos; - pau32TOC[u32Ch / 2] = (pau32TOC[u32Ch / 2] & ~u32TOC_Msk) | (u32TimeOutCnt << u32TOC_Pos); - - if (u32OnOff) - pdma->TOUTEN |= (1 << u32Ch); - else - pdma->TOUTEN &= ~(1 << u32Ch); - } - else {} -} - -/** - * @brief Trigger PDMA - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This function trigger the selected channel. - */ -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch) -{ - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk, u32ChReq; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - - u32ChReq = (pau32REQSEL[u32Ch / 4] & u32REQSEL_Msk) >> u32REQSEL_Pos; - - if (u32ChReq == PDMA_MEM) - { - pdma->SWREQ = (1ul << u32Ch); - } - else {} -} - -/** - * @brief Enable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TABLE - * - \ref PDMA_INT_TIMEOUT - * - \ref PDMA_INT_ALIGN - * - * @return None - * - * @details This function enable the selected channel interrupt. - * @note PDMA_INT_TIMEOUT is only supported in channel 0 and channel 1. - */ -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - case PDMA_INT_ALIGN: - (pdma)->INTEN |= (1UL << u32Ch); - break; - case PDMA_INT_TABLE: - (pdma)->DSCT[u32Ch].CTL &= ~PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - (pdma)->TOUTIEN |= (1UL << u32Ch); - break; - - default: - break; - } -} - -/** - * @brief Disable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TABLE - * - \ref PDMA_INT_TIMEOUT - * - \ref PDMA_INT_ALIGN - * - * @return None - * - * @details This function disable the selected channel interrupt. - * @note PDMA_INT_TIMEOUT is only supported in channel 0 and channel 1. - * @note The transfer done interrupt is disabled when table empty interrupt is disabled(PDMA_INT_TEMPTY). - */ -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - case PDMA_INT_ALIGN: - (pdma)->INTEN &= ~(1UL << u32Ch); - break; - case PDMA_INT_TABLE: - (pdma)->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - (pdma)->TOUTIEN &= ~(1UL << u32Ch); - break; - - default: - break; - } -} - -/**@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group PDMA_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qei.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qei.c deleted file mode 100644 index cb4f4ecd44d..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qei.c +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************//** - * @file qei.c - * @version V3.00 - * $Revision: 2 $ - * $Date: 17/09/20 9:33a $ - * @brief Quadrature Encoder Interface (QEI) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QEI_Driver QEI Driver - @{ -*/ - -/** @addtogroup QEI_EXPORTED_FUNCTIONS QEI Exported Functions - @{ -*/ - -/** - * @brief Close QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function reset QEI configuration and stop QEI counting. - */ -void QEI_Close(QEI_T* qei) -{ - /* Reset QEI configuration */ - qei->CTL = 0UL; -} - -/** - * @brief Disable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function disable QEI specified interrupt. - */ -void QEI_DisableInt(QEI_T* qei, uint32_t u32IntSel) -{ - /* Disable QEI specified interrupt */ - QEI_DISABLE_INT(qei, u32IntSel); - - /* Disable NVIC QEI IRQ */ - if((qei == QEI0) || (qei == QEI0_NS)) - { - NVIC_DisableIRQ(QEI0_IRQn); - } - else - { - NVIC_DisableIRQ(QEI1_IRQn); - } -} - -/** - * @brief Enable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function enable QEI specified interrupt. - */ -void QEI_EnableInt(QEI_T* qei, uint32_t u32IntSel) -{ - /* Enable QEI specified interrupt */ - QEI_ENABLE_INT(qei, u32IntSel); - - /* Enable NVIC QEI IRQ */ - if((qei == QEI0) || (qei == QEI0_NS)) - { - NVIC_EnableIRQ(QEI0_IRQn); - } - else - { - NVIC_EnableIRQ(QEI1_IRQn); - } -} - -/** - * @brief Open QEI in specified mode and enable input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Mode QEI counting mode. - * - \ref QEI_CTL_X4_FREE_COUNTING_MODE - * - \ref QEI_CTL_X2_FREE_COUNTING_MODE - * - \ref QEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref QEI_CTL_X2_COMPARE_COUNTING_MODE - * @param[in] u32Value The counter maximum value in compare-counting mode. - * @return None - * @details This function set QEI in specified mode and enable input. - */ -void QEI_Open(QEI_T* qei, uint32_t u32Mode, uint32_t u32Value) -{ - /* Set QEI function configuration */ - /* Set QEI counting mode */ - /* Enable IDX, QEA and QEB input to QEI controller */ - qei->CTL = (qei->CTL & (~QEI_CTL_MODE_Msk)) | ((u32Mode) | QEI_CTL_CHAEN_Msk | QEI_CTL_CHBEN_Msk | QEI_CTL_IDXEN_Msk); - - /* Set QEI maximum count value in in compare-counting mode */ - qei->CNTMAX = u32Value; -} - -/** - * @brief Start QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function enable QEI function and start QEI counting. - */ -void QEI_Start(QEI_T* qei) -{ - /* Enable QEI controller function */ - qei->CTL |= QEI_CTL_QEIEN_Msk; -} - -/** - * @brief Stop QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function disable QEI function and stop QEI counting. - */ -void QEI_Stop(QEI_T* qei) -{ - /* Disable QEI controller function */ - qei->CTL &= (~QEI_CTL_QEIEN_Msk); -} - - -/**@}*/ /* end of group QEI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group QEI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qspi.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qspi.c deleted file mode 100644 index 5e366d50191..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_qspi.c +++ /dev/null @@ -1,857 +0,0 @@ -/**************************************************************************//** - * @file qspi.c - * @version V3.00 - * @brief M2354 series QSPI driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32MasterSlave Decides the QSPI module is operating in master mode or in slave mode. (QSPI_SLAVE, QSPI_MASTER) - * @param[in] u32QSPIMode Decides the transfer timing. (QSPI_MODE_0, QSPI_MODE_1, QSPI_MODE_2, QSPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a QSPI transaction. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI peripheral clock. - * @details By default, the QSPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the QSPI clock divider setting will be 0. - * The actual clock rate may be different from the target QSPI clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the - * actual QSPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency for Secure, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= system clock frequency for Non-Secure, this function does not do anything to avoid the situation that the frequency of - * QSPI bus clock cannot be faster than the system clock rate. User should set up carefully. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode for Secure, the QSPI peripheral clock rate will equal to APB clock rate. - * @note In slave mode for Non-Secure, the QSPI peripheral clock rate will equal to the clock rate set in secure mode. - */ -uint32_t QSPI_Open(QSPI_T *qspi, - uint32_t u32MasterSlave, - uint32_t u32QSPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0UL, u32Div, u32HCLKFreq, u32PCLK0Freq, u32RetValue = 0UL; - - if(u32DataWidth == 32UL) - { - u32DataWidth = 0UL; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - /* Get APB0 clock frequency */ - u32PCLK0Freq = CLK_GetPCLK0Freq(); - - if(u32MasterSlave == QSPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - if(u32BusClock >= u32HCLKFreq) - { - if(!(__PC() & NS_OFFSET)) - { - /* Select PCLK as the clock source of QSPI */ - if((qspi == QSPI0) || (qspi == QSPI0_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - } - } - } - - /* Check clock source of QSPI */ - if((qspi == QSPI0) || (qspi == QSPI0_NS)) - { - if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if(u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock == 0UL) - { - /* Set DIVIDER to the maximum value 0x1FF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer */ - if(u32Div > 0x1FFUL) - { - u32Div = 0x1FFUL; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1UL)); - } - } - } - else /* For slave mode, force the QSPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - - if(!(__PC() & NS_OFFSET)) - { - /* Select PCLK as the clock source of QSPI */ - if((qspi == QSPI0) || (qspi == QSPI0_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK0Freq; - } - } - else - { - /* Check clock source of QSPI */ - if((qspi == QSPI0) || (qspi == QSPI0_NS)) - { - if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - u32RetValue = u32PCLK0Freq; /* Clock source is PCLK0 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - } - } - - return u32RetValue; -} - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details Clear SPIEN bit of QSPI_CTL register to disable QSPI transfer control. - */ -void QSPI_Close(QSPI_T *qspi) -{ - qspi->CTL &= ~QSPI_CTL_SPIEN_Msk; -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI RX FIFO buffer. The RXEMPTY (QSPI_STATUS[8]) will be set to 1. - */ -void QSPI_ClearRxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI TX FIFO buffer. The TXEMPTY (QSPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void QSPI_ClearTxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void QSPI_DisableAutoSS(QSPI_T *qspi) -{ - qspi->SSCTL &= ~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (QSPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (QSPI_SS_ACTIVE_HIGH, QSPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - qspi->SSCTL = (qspi->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | QSPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the QSPI bus clock. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target QSPI bus clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency for Secure, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= system clock frequency for Non-Secure, this function does not do anything to avoid the situation that the frequency of - * QSPI bus clock cannot be faster than the system clock rate. User should set up carefully. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Check if valid QSPI exist */ - if(!((qspi == QSPI0) || (qspi == QSPI0_NS))) - { - return 0UL; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if(u32BusClock >= u32HCLKFreq) - { - if(!(__PC() & NS_OFFSET)) - { - /* Select PCLK as the clock source of QSPI */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - } - } - - /* Check clock source of QSPI */ - if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - - if(u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock == 0UL) - { - /* Set DIVIDER to the maximum value 0x1FF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer */ - if(u32Div > 0x1FFUL) - { - u32Div = 0x1FFUL; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1UL)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - qspi->FIFOCTL = (qspi->FIFOCTL & ~(QSPI_FIFOCTL_TXTH_Msk | QSPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << QSPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << QSPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of QSPI bus clock. Only available in Master mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Actual QSPI bus clock frequency in Hz. - * @details This function will calculate the actual QSPI bus clock rate according to the QQSPISEL/QSPIxSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t QSPI_GetBusClock(QSPI_T *qspi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc; - - /* Check if valid QSPI exist */ - if(!((qspi == QSPI0) || (qspi == QSPI0_NS))) - { - return 0UL; - } - - /* Get DIVIDER setting */ - u32Div = (qspi->CLKDIV & QSPI_CLKDIV_DIVIDER_Msk) >> QSPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of QSPI */ - if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(QSPI0_MODULE) << CLK_CLKSEL2_QSPI0SEL_Pos) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - - /* Return QSPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1UL)); -} - -/** - * @brief Enable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL |= QSPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave mode time-out interrupt flag */ - if((u32Mask & QSPI_SLVTO_INT_MASK) == QSPI_SLVTO_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVTOIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL &= ~QSPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave mode time-out interrupt flag */ - if((u32Mask & QSPI_SLVTO_INT_MASK) == QSPI_SLVTO_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVTOIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get QSPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32IntStatus; - uint32_t u32IntFlag = 0UL; - - u32IntStatus = qspi->STATUS; - - /* Check unit transfer interrupt flag */ - if((u32Mask & QSPI_UNIT_INT_MASK) && (u32IntStatus & QSPI_STATUS_UNITIF_Msk)) - { - u32IntFlag |= QSPI_UNIT_INT_MASK; - } - - /* Check slave selection signal active interrupt flag */ - if((u32Mask & QSPI_SSACT_INT_MASK) && (u32IntStatus & QSPI_STATUS_SSACTIF_Msk)) - { - u32IntFlag |= QSPI_SSACT_INT_MASK; - } - - /* Check slave selection signal inactive interrupt flag */ - if((u32Mask & QSPI_SSINACT_INT_MASK) && (u32IntStatus & QSPI_STATUS_SSINAIF_Msk)) - { - u32IntFlag |= QSPI_SSINACT_INT_MASK; - } - - /* Check slave TX under run interrupt flag */ - if((u32Mask & QSPI_SLVUR_INT_MASK) && (u32IntStatus & QSPI_STATUS_SLVURIF_Msk)) - { - u32IntFlag |= QSPI_SLVUR_INT_MASK; - } - - /* Check slave bit count error interrupt flag */ - if((u32Mask & QSPI_SLVBE_INT_MASK) && (u32IntStatus & QSPI_STATUS_SLVBEIF_Msk)) - { - u32IntFlag |= QSPI_SLVBE_INT_MASK; - } - - /* Check slave mode time-out interrupt flag */ - if((u32Mask & QSPI_SLVTO_INT_MASK) && (u32IntStatus & QSPI_STATUS_SLVTOIF_Msk)) - { - u32IntFlag |= QSPI_SLVTO_INT_MASK; - } - - /* Check slave TX underflow interrupt flag */ - if((u32Mask & QSPI_TXUF_INT_MASK) && (u32IntStatus & QSPI_STATUS_TXUFIF_Msk)) - { - u32IntFlag |= QSPI_TXUF_INT_MASK; - } - - /* Check TX threshold interrupt flag */ - if((u32Mask & QSPI_FIFO_TXTH_INT_MASK) && (u32IntStatus & QSPI_STATUS_TXTHIF_Msk)) - { - u32IntFlag |= QSPI_FIFO_TXTH_INT_MASK; - } - - /* Check RX threshold interrupt flag */ - if((u32Mask & QSPI_FIFO_RXTH_INT_MASK) && (u32IntStatus & QSPI_STATUS_RXTHIF_Msk)) - { - u32IntFlag |= QSPI_FIFO_RXTH_INT_MASK; - } - - /* Check RX overrun interrupt flag */ - if((u32Mask & QSPI_FIFO_RXOV_INT_MASK) && (u32IntStatus & QSPI_STATUS_RXOVIF_Msk)) - { - u32IntFlag |= QSPI_FIFO_RXOV_INT_MASK; - } - - /* Check RX time-out interrupt flag */ - if((u32Mask & QSPI_FIFO_RXTO_INT_MASK) && (u32IntStatus & QSPI_STATUS_RXTOIF_Msk)) - { - u32IntFlag |= QSPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear QSPI related interrupt flags specified by u32Mask parameter. - */ -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - if(u32Mask & QSPI_UNIT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if(u32Mask & QSPI_SSACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if(u32Mask & QSPI_SSINACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if(u32Mask & QSPI_SLVUR_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if(u32Mask & QSPI_SLVBE_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if(u32Mask & QSPI_SLVTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVTOIF_Msk; /* Clear slave mode time-out interrupt flag */ - } - - if(u32Mask & QSPI_TXUF_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if(u32Mask & QSPI_FIFO_RXOV_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if(u32Mask & QSPI_FIFO_RXTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get QSPI status. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_BUSY_MASK - * - \ref QSPI_RX_EMPTY_MASK - * - \ref QSPI_RX_FULL_MASK - * - \ref QSPI_TX_EMPTY_MASK - * - \ref QSPI_TX_FULL_MASK - * - \ref QSPI_TXRX_RESET_MASK - * - \ref QSPI_SPIEN_STS_MASK - * - \ref QSPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32TmpStatus; - uint32_t u32Flag = 0UL; - - u32TmpStatus = qspi->STATUS; - - /* Check busy status */ - if((u32Mask & QSPI_BUSY_MASK) && (u32TmpStatus & QSPI_STATUS_BUSY_Msk)) - { - u32Flag |= QSPI_BUSY_MASK; - } - - /* Check RX empty flag */ - if((u32Mask & QSPI_RX_EMPTY_MASK) && (u32TmpStatus & QSPI_STATUS_RXEMPTY_Msk)) - { - u32Flag |= QSPI_RX_EMPTY_MASK; - } - - /* Check RX full flag */ - if((u32Mask & QSPI_RX_FULL_MASK) && (u32TmpStatus & QSPI_STATUS_RXFULL_Msk)) - { - u32Flag |= QSPI_RX_FULL_MASK; - } - - /* Check TX empty flag */ - if((u32Mask & QSPI_TX_EMPTY_MASK) && (u32TmpStatus & QSPI_STATUS_TXEMPTY_Msk)) - { - u32Flag |= QSPI_TX_EMPTY_MASK; - } - - /* Check TX full flag */ - if((u32Mask & QSPI_TX_FULL_MASK) && (u32TmpStatus & QSPI_STATUS_TXFULL_Msk)) - { - u32Flag |= QSPI_TX_FULL_MASK; - } - - /* Check TX/RX reset flag */ - if((u32Mask & QSPI_TXRX_RESET_MASK) && (u32TmpStatus & QSPI_STATUS_TXRXRST_Msk)) - { - u32Flag |= QSPI_TXRX_RESET_MASK; - } - - /* Check SPIEN flag */ - if((u32Mask & QSPI_SPIEN_STS_MASK) && (u32TmpStatus & QSPI_STATUS_SPIENSTS_Msk)) - { - u32Flag |= QSPI_SPIEN_STS_MASK; - } - - /* Check QSPIx_SS line status */ - if((u32Mask & QSPI_SSLINE_STS_MASK) && (u32TmpStatus & QSPI_STATUS_SSLINE_Msk)) - { - u32Flag |= QSPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - -/** - * @brief Get QSPI status2. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_SLVBENUM_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus2(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32TmpStatus; - uint32_t u32Number = 0UL; - - u32TmpStatus = qspi->STATUS2; - - /* Check effective bit number of uncompleted RX data status */ - if(u32Mask & QSPI_SLVBENUM_MASK) - { - u32Number = (u32TmpStatus & QSPI_STATUS2_SLVBENUM_Msk) >> QSPI_STATUS2_SLVBENUM_Pos; - } - - return u32Number; -} - -/**@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group QSPI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rng.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rng.c deleted file mode 100644 index c2210c942d6..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rng.c +++ /dev/null @@ -1,475 +0,0 @@ -/**************************************************************************//** - * @file rng.c - * @version V3.00 - * @brief Show how to get true random number. - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RNG_Driver RNG Driver - @{ -*/ - - -/** @addtogroup RNG_EXPORTED_FUNCTIONS RNG Exported Functions - @{ -*/ - -typedef enum _RNG_KEY_SIZE -{ - KEY_128 = 0, - KEY_192 = 2, - KEY_224 = 3, - KEY_233 = 4, - KEY_255 = 5, - KEY_256 = 6, - KEY_283 = 7, - KEY_384 = 8, - KEY_409 = 9, - KEY_512 = 10, - KEY_521 = 11, - KEY_571 = 12 - -} eRNG_SZ; - - -/** - * @brief Open random number generator - * - * @return 0 Successful - * -1 Failed - * - * @details The function is used to disable rng interrupt. - */ -int32_t RNG_Open(void) -{ - int32_t i; - int32_t timeout = 0x1000000; - - /* Basic Configuration */ - CLK->AHBCLK |= CLK_AHBCLK_CRPTCKEN_Msk; - CLK->APBCLK1 |= CLK_APBCLK1_TRNGCKEN_Msk; - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; - - RTC->LXTCTL |= (RTC_LXTCTL_C32KSEL_Msk | RTC_LXTCTL_LIRC32KEN_Msk); //To use LIRC32K - - TRNG->ACT |= TRNG_ACT_ACT_Msk; - /* Waiting for ready */ - i = 0; - while((TRNG->CTL & TRNG_CTL_READY_Msk) == 0) - { - if(i++ > timeout) - { - /* TRNG ready timeout */ - return -1; - } - } - - TRNG->CTL = (0 << TRNG_CTL_CLKPSC_Pos); - - - /* Enable SEEDGEN */ - TRNG->CTL |= (1 << 8); - - /* Waiting for seed ready */ - i = 0; - while((TRNG->CTL & (1 << 9)) == 0) - { - if(i++ > timeout) - { - /* seed ready timeout */ - return -1; - } - } - - // Waiting for PRNG busy - i = 0; - while(CRPT->PRNG_CTL & (1 << 8)) - { - if(i++ > timeout) - { - /* PRNG busy timeout */ - return -1; - } - } - - /* Set seed select to TRNG */ - CRPT->PRNG_CTL = CRPT_PRNG_CTL_SEEDSEL_Msk; - - /* Waiting for seed src ok */ - i = 0; - while((CRPT->PRNG_CTL & CRPT_PRNG_CTL_SEEDSRC_Msk) == 0) - { - if(i++ > timeout) - { - /* PRNG src timeout */ - return -1; // Timeout - } - } - - /* Reload seed only at first time */ - CRPT->PRNG_CTL |= (PRNG_KEY_SIZE_256 << CRPT_PRNG_CTL_KEYSZ_Pos) | CRPT_PRNG_CTL_START_Msk | CRPT_PRNG_CTL_SEEDRLD_Msk; - - i = 0; - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if(i++ > timeout) - { - /* busy timeout */ - return -1; - } - } - - return 0; -} - - -/** - * @brief Get random words - * - * @param[in] pu32Buf Buffer pointer to store the random number - * - * @param[in] nWords Buffer size in word count. nWords must <= 8 - * - * @return Word count of random number in buffer - * - * @details The function is used to generate random numbers - */ -int32_t RNG_Random(uint32_t *pu32Buf, int32_t nWords) -{ - int32_t i; - int32_t timeout = 0x10000; - - /* Waiting for Busy */ - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) {} - - if(nWords > 8) - nWords = 8; - - /* Trig to generate seed 256 bits random number */ - CRPT->PRNG_CTL = (6 << CRPT_PRNG_CTL_KEYSZ_Pos) | CRPT_PRNG_CTL_START_Msk; - - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if(timeout-- < 0) - return 0; - } - - for(i = 0; i < nWords; i++) - { - pu32Buf[i] = CRPT->PRNG_KEY[i]; - } - - return nWords; -} - - - -/** - * @brief To generate a key to KS SRAM for ECDSA. - * - * @param[in] u32KeySize It could be PRNG_KEY_SIZE_128 ~ PRNG_KEY_SIZE_571 - * - * @param[in] au32ECC_N The N value of specified ECC curve. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is used to generate a key to KS SRAM for ECDSA. - * This key is necessary for ECDSA+Key Store function of ECC. - */ -int32_t RNG_ECDSA_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]) -{ - int32_t i; - int32_t timeout = 0x1000000; - - /* Basic Configuration */ - CLK->AHBCLK |= CLK_AHBCLK_CRPTCKEN_Msk; - CLK->APBCLK1 |= CLK_APBCLK1_TRNGCKEN_Msk; - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; - - RTC->LXTCTL |= (RTC_LXTCTL_C32KSEL_Msk | RTC_LXTCTL_LIRC32KEN_Msk); //To use LIRC32K - - TRNG->ACT |= TRNG_ACT_ACT_Msk; - /* Waiting for ready */ - i = 0; - while((TRNG->CTL & TRNG_CTL_READY_Msk) == 0) - { - if(i++ > timeout) - { - return -1; // Timeout - } - } - - TRNG->CTL = (0 << TRNG_CTL_CLKPSC_Pos); - - /* Reset seed select of PRNG */ - CRPT->PRNG_CTL = 0; - - - /* Enable SEEDGEN */ - TRNG->CTL |= TRNG_CTL_SEEDGEN_Msk; - - /* Waiting for seed ready */ - i = 0; - while((TRNG->CTL & TRNG_CTL_SEEDRDY_Msk) == 0) - { - if(i++ > timeout) - { - return -1; // Timeout - } - } - - // Waiting for PRNG busy - i = 0; - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if(i++ > timeout) - { - return -1; // Timeout - } - } - - - // Set seed select to TRNG - CRPT->PRNG_CTL = 1 << CRPT_PRNG_CTL_SEEDSEL_Pos; - - // Waiting for seed src ok - i = 0; - while((CRPT->PRNG_CTL & CRPT_PRNG_CTL_SEEDSRC_Msk) == 0) - { - if(i++ > timeout) - { - return -1; // Timeout - } - } - - /* It is necessary to set ECC_N for ECDSA */ - for(i = 0; i < 18; i++) - CRPT->ECC_N[i] = au32ECC_N[i]; - - CRPT->PRNG_KSCTL = 0; - - /* Reload seed only at first time */ - CRPT->PRNG_CTL |= (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - CRPT_PRNG_CTL_START_Msk | CRPT_PRNG_CTL_SEEDRLD_Msk; - - - i = 0; - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if(i++ > timeout) - { - return -1; // Timeout - } - } - - - CRPT->PRNG_KSCTL = (KS_OWNER_ECC << CRPT_PRNG_KSCTL_OWNER_Pos) | - CRPT_PRNG_KSCTL_ECDSA_Msk | - (CRPT_PRNG_KSCTL_WDST_Msk) | - (KS_SRAM << CRPT_PRNG_KSCTL_WSDST_Pos); - - return 0; -} - - -/** - * @brief To generate a key to KS SRAM for ECDSA. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is used to generate a key to KS SRAM for ECDSA. - * This key is necessary for ECDSA+Key Store function of ECC. - */ -int32_t RNG_ECDSA(uint32_t u32KeySize) -{ - int32_t timeout; - int32_t i; - - /* Reload seed only at first time */ - CRPT->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - 0xc0 | - CRPT_PRNG_CTL_START_Msk; - - timeout = 0x10000; - i = 0; - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if(i++ > timeout) - { - //printf("busy timeout\n"); - return -1; // Timeout - } - } - - if(CRPT->PRNG_KSSTS & CRPT_PRNG_KSSTS_KCTLERR_Msk) - { - //printf("KCTLERR!\n"); - return -1; - } - - return (CRPT->PRNG_KSSTS & CRPT_PRNG_KSCTL_NUM_Msk); -} - - - -/** - * @brief To generate a key to KS SRAM for ECDH. - * - * @param[in] u32KeySize It could be PRNG_KEY_SIZE_128 ~ PRNG_KEY_SIZE_571 - * - * @param[in] au32ECC_N The N value of specified ECC curve. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is used to generate a key to KS SRAM for ECDH. - * This key is necessary for ECDH+Key Store function of ECC. - */ -int32_t RNG_ECDH_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]) -{ - int32_t i; - int32_t timeout = 0x1000000; - - /* Basic Configuration */ - CLK->AHBCLK |= CLK_AHBCLK_CRPTCKEN_Msk; - CLK->APBCLK1 |= CLK_APBCLK1_TRNGCKEN_Msk; - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; - - RTC->LXTCTL |= (RTC_LXTCTL_C32KSEL_Msk | RTC_LXTCTL_LIRC32KEN_Msk); //To use LIRC32K - - TRNG->ACT |= TRNG_ACT_ACT_Msk; - /* Waiting for ready */ - i = 0; - while((TRNG->CTL & TRNG_CTL_READY_Msk) == 0) - { - if(i++ > timeout) - { - /* TRNG ready timeout */ - return -1; - } - } - - TRNG->CTL = (0 << TRNG_CTL_CLKPSC_Pos); - - - /* Enable SEEDGEN */ - TRNG->CTL |= TRNG_CTL_SEEDGEN_Msk; - - /* Waiting for seed ready */ - i = 0; - while((TRNG->CTL & TRNG_CTL_SEEDRDY_Msk) == 0) - { - if(i++ > timeout) - { - /* seed ready timeout */ - return -1; - } - } - - /* Waiting for PRNG busy */ - i = 0; - while(CRPT->PRNG_CTL & TRNG_CTL_SEEDGEN_Msk) - { - if(i++ > timeout) - { - /* PRNG busy timeout */ - return -1; - } - } - - - - /* Set seed select to TRNG */ - CRPT->PRNG_CTL = (1 << 6); - - // Waiting for seed src ok - i = 0; - while((CRPT->PRNG_CTL & (1 << 7)) == 0) - { - if(i++ > timeout) - { - /* PRNG src timeout */ - return -1; - } - } - - /* It is necessary to set ECC_N for ECDSA */ - for(i = 0; i < 18; i++) - CRPT->ECC_N[i] = au32ECC_N[i]; - - CRPT->PRNG_KSCTL = 0; - - /* Reload seed only at first time */ - CRPT->PRNG_CTL |= (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - CRPT_PRNG_CTL_START_Msk | CRPT_PRNG_CTL_SEEDRLD_Msk; - - - i = 0; - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if(i++ > timeout) - { - /* busy timeout */ - return -1; - } - } - - CRPT->PRNG_KSCTL = (KS_OWNER_ECC << CRPT_PRNG_KSCTL_OWNER_Pos) | - (CRPT_PRNG_KSCTL_ECDH_Msk) | - (CRPT_PRNG_KSCTL_WDST_Msk) | - (KS_SRAM << CRPT_PRNG_KSCTL_WSDST_Pos); - - return 0; -} - - -/** - * @brief To generate a key to KS SRAM for ECDH. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is used to generate a key to KS SRAM for ECDH. - * This key is necessary for ECDH+Key Store function of ECC. - */ -int32_t RNG_ECDH(uint32_t u32KeySize) -{ - int32_t timeout; - int32_t i; - - /* Reload seed only at first time */ - CRPT->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - 0xc0 | - CRPT_PRNG_CTL_START_Msk; - - timeout = 0x10000; - i = 0; - while(CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if(i++ > timeout) - return -1; - } - - if(CRPT->PRNG_KSSTS & CRPT_PRNG_KSSTS_KCTLERR_Msk) - return -1; - - return (CRPT->PRNG_KSSTS & CRPT_PRNG_KSCTL_NUM_Msk); -} - -/**@}*/ /* end of group RNG_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RNG_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rtc.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rtc.c deleted file mode 100644 index 904958c4151..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_rtc.c +++ /dev/null @@ -1,1174 +0,0 @@ -/**************************************************************************//** - * @file rtc.c - * @version V3.00 - * @brief Real Time Clock(RTC) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @cond HIDDEN_SYMBOLS */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Global file scope (static) variables */ -/*---------------------------------------------------------------------------------------------------------*/ -static volatile uint32_t g_u32hiYear, g_u32loYear, g_u32hiMonth, g_u32loMonth, g_u32hiDay, g_u32loDay; -static volatile uint32_t g_u32hiHour, g_u32loHour, g_u32hiMin, g_u32loMin, g_u32hiSec, g_u32loSec; - -/** @endcond HIDDEN_SYMBOLS */ - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Initialize RTC module and start counting - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This function is used to: \n - * 1. Write initial key to let RTC start count. \n - * 2. Input parameter indicates start date/time. \n - * 3. User has to make sure that parameters of RTC date/time are reasonable. \n - * 4. Enable frequency dynamic compensation function. \n - * @note Null pointer for using default starting date/time. - */ -void RTC_Open(S_RTC_TIME_DATA_T *sPt) -{ - RTC->INIT = RTC_INIT_KEY; - - if(RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - RTC->INIT = RTC_INIT_KEY; - while(RTC->INIT != RTC_INIT_ACTIVE_Msk) {} - } - - if(sPt != 0) - { - /* Enable frequency dynamic compensation function */ - RTC->CLKFMT |= RTC_CLKFMT_DCOMPEN_Msk; - - /* Set RTC date and time */ - RTC_SetDateAndTime(sPt); - } -} - -/** - * @brief Disable RTC Clock - * - * @param None - * - * @return None - * - * @details This API will disable RTC peripheral clock. - */ -void RTC_Close(void) -{ - if((__PC()&NS_OFFSET) != NS_OFFSET) - { - /* Only available in Secure code */ - CLK->APBCLK0 &= ~CLK_APBCLK0_RTCCKEN_Msk; - } -} - -/** - * @brief Set 32K Frequency Compensation Data - * - * @param[in] i32FrequencyX10000 Specify the RTC clock X10000, ex: 327736512 means 32773.6512. - * - * @return None - * - * @details This API is used to compensate the 32 kHz frequency by current LXT frequency for RTC application. - */ -void RTC_32KCalibration(int32_t i32FrequencyX10000) -{ - int32_t i32RegInt, i32RegFra; - - /* Compute integer and fraction for RTC FCR register */ - i32RegInt = (i32FrequencyX10000 / 10000) - RTC_FCR_REFERENCE; - i32RegFra = ((((i32FrequencyX10000 % 10000)) * 64) + 5000) / 10000; - - if(i32RegFra >= 0x40) - { - i32RegFra = 0x0; - i32RegInt++; - } - - /* Judge Integer part is reasonable */ - if((i32RegInt >= 0) && (i32RegInt <= 31)) - { - while((RTC->FREQADJ & RTC_FREQADJ_FCRBUSY_Msk) == RTC_FREQADJ_FCRBUSY_Msk) {} - RTC->FREQADJ = (uint32_t)((i32RegInt << 8) | i32RegFra); - while((RTC->FREQADJ & RTC_FREQADJ_FCRBUSY_Msk) == RTC_FREQADJ_FCRBUSY_Msk) {} - } -} - -/** - * @brief Get Current RTC Date and Time - * - * @param[out] sPt The returned pointer is specified the current RTC value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the current RTC date and time value. - */ -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get [Date digit] data */ - g_u32hiYear = (RTC->CAL & RTC_CAL_TENYEAR_Msk) >> RTC_CAL_TENYEAR_Pos; - g_u32loYear = (RTC->CAL & RTC_CAL_YEAR_Msk) >> RTC_CAL_YEAR_Pos; - g_u32hiMonth = (RTC->CAL & RTC_CAL_TENMON_Msk) >> RTC_CAL_TENMON_Pos; - g_u32loMonth = (RTC->CAL & RTC_CAL_MON_Msk) >> RTC_CAL_MON_Pos; - g_u32hiDay = (RTC->CAL & RTC_CAL_TENDAY_Msk) >> RTC_CAL_TENDAY_Pos; - g_u32loDay = (RTC->CAL & RTC_CAL_DAY_Msk) >> RTC_CAL_DAY_Pos; - - /* Get [Time digit] data */ - g_u32hiHour = (RTC->TIME & RTC_TIME_TENHR_Msk) >> RTC_TIME_TENHR_Pos; - g_u32loHour = (RTC->TIME & RTC_TIME_HR_Msk) >> RTC_TIME_HR_Pos; - g_u32hiMin = (RTC->TIME & RTC_TIME_TENMIN_Msk) >> RTC_TIME_TENMIN_Pos; - g_u32loMin = (RTC->TIME & RTC_TIME_MIN_Msk) >> RTC_TIME_MIN_Pos; - g_u32hiSec = (RTC->TIME & RTC_TIME_TENSEC_Msk) >> RTC_TIME_TENSEC_Pos; - g_u32loSec = (RTC->TIME & RTC_TIME_SEC_Msk) >> RTC_TIME_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10UL); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + (uint32_t)RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10UL); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10UL); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if(sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if(sPt->u32Hour >= 21UL) - { - sPt->u32AmPm = (uint32_t)RTC_PM; - sPt->u32Hour -= 20UL; - } - else - { - sPt->u32AmPm = (uint32_t)RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Get RTC Alarm Date and Time - * - * @param[out] sPt The returned pointer is specified the RTC alarm value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the RTC alarm date and time setting. - */ -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get alarm [Date digit] data */ - g_u32hiYear = (RTC->CALM & RTC_CALM_TENYEAR_Msk) >> RTC_CALM_TENYEAR_Pos; - g_u32loYear = (RTC->CALM & RTC_CALM_YEAR_Msk) >> RTC_CALM_YEAR_Pos; - g_u32hiMonth = (RTC->CALM & RTC_CALM_TENMON_Msk) >> RTC_CALM_TENMON_Pos; - g_u32loMonth = (RTC->CALM & RTC_CALM_MON_Msk) >> RTC_CALM_MON_Pos; - g_u32hiDay = (RTC->CALM & RTC_CALM_TENDAY_Msk) >> RTC_CALM_TENDAY_Pos; - g_u32loDay = (RTC->CALM & RTC_CALM_DAY_Msk) >> RTC_CALM_DAY_Pos; - - /* Get alarm [Time digit] data */ - g_u32hiHour = (RTC->TALM & RTC_TALM_TENHR_Msk) >> RTC_TALM_TENHR_Pos; - g_u32loHour = (RTC->TALM & RTC_TALM_HR_Msk) >> RTC_TALM_HR_Pos; - g_u32hiMin = (RTC->TALM & RTC_TALM_TENMIN_Msk) >> RTC_TALM_TENMIN_Pos; - g_u32loMin = (RTC->TALM & RTC_TALM_MIN_Msk) >> RTC_TALM_MIN_Pos; - g_u32hiSec = (RTC->TALM & RTC_TALM_TENSEC_Msk) >> RTC_TALM_TENSEC_Pos; - g_u32loSec = (RTC->TALM & RTC_TALM_SEC_Msk) >> RTC_TALM_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10UL); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + (uint32_t)RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10UL); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10UL); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if(sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if(sPt->u32Hour >= 21UL) - { - sPt->u32AmPm = (uint32_t)RTC_PM; - sPt->u32Hour -= 20UL; - } - else - { - sPt->u32AmPm = (uint32_t)RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Update Current RTC Date and Time - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update current date and time to RTC. - */ -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCAL, u32RegTIME; - - if(sPt != 0) - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if(sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if(sPt->u32AmPm == (uint32_t)RTC_PM) - { - sPt->u32Hour += 20UL; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set Day of the Week */ - RTC->WEEKDAY = sPt->u32DayOfWeek; - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Current Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCAL = ((sPt->u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCAL |= (((sPt->u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCAL |= ((sPt->u32Month / 10UL) << 12); - u32RegCAL |= ((sPt->u32Month % 10UL) << 8); - u32RegCAL |= ((sPt->u32Day / 10UL) << 4); - u32RegCAL |= (sPt->u32Day % 10UL); - - u32RegTIME = ((sPt->u32Hour / 10UL) << 20); - u32RegTIME |= ((sPt->u32Hour % 10UL) << 16); - u32RegTIME |= ((sPt->u32Minute / 10UL) << 12); - u32RegTIME |= ((sPt->u32Minute % 10UL) << 8); - u32RegTIME |= ((sPt->u32Second / 10UL) << 4); - u32RegTIME |= (sPt->u32Second % 10UL); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Calender and Time Loading */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC->CAL = (uint32_t)u32RegCAL; - RTC->TIME = (uint32_t)u32RegTIME; - } -} - -/** - * @brief Update RTC Alarm Date and Time - * - * @param[in] sPt Specify the time property and alarm date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update alarm date and time setting to RTC. - */ -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCALM, u32RegTALM; - - if(sPt != 0) - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if(sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if(sPt->u32AmPm == (uint32_t)RTC_PM) - { - sPt->u32Hour += 20UL; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Alarm Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCALM = ((sPt->u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCALM |= (((sPt->u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCALM |= ((sPt->u32Month / 10UL) << 12); - u32RegCALM |= ((sPt->u32Month % 10UL) << 8); - u32RegCALM |= ((sPt->u32Day / 10UL) << 4); - u32RegCALM |= (sPt->u32Day % 10UL); - - u32RegTALM = ((sPt->u32Hour / 10UL) << 20); - u32RegTALM |= ((sPt->u32Hour % 10UL) << 16); - u32RegTALM |= ((sPt->u32Minute / 10UL) << 12); - u32RegTALM |= ((sPt->u32Minute % 10UL) << 8); - u32RegTALM |= ((sPt->u32Second / 10UL) << 4); - u32RegTALM |= (sPt->u32Second % 10UL); - - RTC->CALM = (uint32_t)u32RegCALM; - RTC->TALM = (uint32_t)u32RegTALM; - } -} - -/** - * @brief Update RTC Current Date - * - * @param[in] u32Year The year calendar digit of current RTC setting. - * @param[in] u32Month The month calendar digit of current RTC setting. - * @param[in] u32Day The day calendar digit of current RTC setting. - * @param[in] u32DayOfWeek The Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] - * - * @return None - * - * @details This API is used to update current date to RTC. - */ -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek) -{ - uint32_t u32RegCAL; - - u32RegCAL = ((u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCAL |= (((u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCAL |= ((u32Month / 10UL) << 12); - u32RegCAL |= ((u32Month % 10UL) << 8); - u32RegCAL |= ((u32Day / 10UL) << 4); - u32RegCAL |= (u32Day % 10UL); - - - /* Set Day of the Week */ - RTC->WEEKDAY = u32DayOfWeek & RTC_WEEKDAY_WEEKDAY_Msk; - - /* Set RTC Calender Loading */ - RTC->CAL = (uint32_t)u32RegCAL; -} - -/** - * @brief Update RTC Current Time - * - * @param[in] u32Hour The hour time digit of current RTC setting. - * @param[in] u32Minute The minute time digit of current RTC setting. - * @param[in] u32Second The second time digit of current RTC setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update current time to RTC. - */ -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTIME; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if((u32TimeMode == (uint32_t)RTC_CLOCK_12) && (u32AmPm == (uint32_t)RTC_PM)) - { - u32Hour += 20UL; - } - - u32RegTIME = ((u32Hour / 10UL) << 20); - u32RegTIME |= ((u32Hour % 10UL) << 16); - u32RegTIME |= ((u32Minute / 10UL) << 12); - u32RegTIME |= ((u32Minute % 10UL) << 8); - u32RegTIME |= ((u32Second / 10UL) << 4); - u32RegTIME |= (u32Second % 10UL); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if(u32TimeMode == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - RTC->TIME = (uint32_t)u32RegTIME; -} - -/** - * @brief Update RTC Alarm Date - * - * @param[in] u32Year The year calendar digit of RTC alarm setting. - * @param[in] u32Month The month calendar digit of RTC alarm setting. - * @param[in] u32Day The day calendar digit of RTC alarm setting. - * - * @return None - * - * @details This API is used to update alarm date setting to RTC. - */ -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day) -{ - uint32_t u32RegCALM; - - u32RegCALM = ((u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCALM |= (((u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCALM |= ((u32Month / 10UL) << 12); - u32RegCALM |= ((u32Month % 10UL) << 8); - u32RegCALM |= ((u32Day / 10UL) << 4); - u32RegCALM |= (u32Day % 10UL); - - - /* Set RTC Alarm Date */ - RTC->CALM = (uint32_t)u32RegCALM; -} - -/** - * @brief Update RTC Alarm Time - * - * @param[in] u32Hour The hour time digit of RTC alarm setting. - * @param[in] u32Minute The minute time digit of RTC alarm setting. - * @param[in] u32Second The second time digit of RTC alarm setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update alarm time setting to RTC. - */ -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTALM; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if((u32TimeMode == (uint32_t)RTC_CLOCK_12) && (u32AmPm == (uint32_t)RTC_PM)) - { - u32Hour += 20UL; - } - - u32RegTALM = ((u32Hour / 10UL) << 20); - u32RegTALM |= ((u32Hour % 10UL) << 16); - u32RegTALM |= ((u32Minute / 10UL) << 12); - u32RegTALM |= ((u32Minute % 10UL) << 8); - u32RegTALM |= ((u32Second / 10UL) << 4); - u32RegTALM |= (u32Second % 10UL); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if(u32TimeMode == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set RTC Alarm Time */ - RTC->TALM = (uint32_t)u32RegTALM; -} - -/** - * @brief Set RTC Alarm Date Mask Function - * - * @param[in] u8IsTenYMsk 1: enable 10-Year digit alarm mask; 0: disabled. - * @param[in] u8IsYMsk 1: enable 1-Year digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsTenDMsk 1: enable 10-Day digit alarm mask; 0: disabled. - * @param[in] u8IsDMsk 1: enable 1-Day digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm date mask function. - */ -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk) -{ - RTC->CAMSK = ((uint32_t)u8IsTenYMsk << RTC_CAMSK_MTENYEAR_Pos) | - ((uint32_t)u8IsYMsk << RTC_CAMSK_MYEAR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_CAMSK_MTENMON_Pos) | - ((uint32_t)u8IsMMsk << RTC_CAMSK_MMON_Pos) | - ((uint32_t)u8IsTenDMsk << RTC_CAMSK_MTENDAY_Pos) | - ((uint32_t)u8IsDMsk << RTC_CAMSK_MDAY_Pos); -} - -/** - * @brief Set RTC Alarm Time Mask Function - * - * @param[in] u8IsTenHMsk 1: enable 10-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsHMsk 1: enable 1-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Min digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Min digit alarm mask; 0: disabled. - * @param[in] u8IsTenSMsk 1: enable 10-Sec digit alarm mask; 0: disabled. - * @param[in] u8IsSMsk 1: enable 1-Sec digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm time mask function. - */ -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk) -{ - RTC->TAMSK = ((uint32_t)u8IsTenHMsk << RTC_TAMSK_MTENHR_Pos) | - ((uint32_t)u8IsHMsk << RTC_TAMSK_MHR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_TAMSK_MTENMIN_Pos) | - ((uint32_t)u8IsMMsk << RTC_TAMSK_MMIN_Pos) | - ((uint32_t)u8IsTenSMsk << RTC_TAMSK_MTENSEC_Pos) | - ((uint32_t)u8IsSMsk << RTC_TAMSK_MSEC_Pos); -} - -/** - * @brief Get Day of the Week - * - * @param None - * - * @retval 0 Sunday - * @retval 1 Monday - * @retval 2 Tuesday - * @retval 3 Wednesday - * @retval 4 Thursday - * @retval 5 Friday - * @retval 6 Saturday - * - * @details This API is used to get day of the week of current RTC date. - */ -uint32_t RTC_GetDayOfWeek(void) -{ - return (RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk); -} - -/** - * @brief Set RTC Tick Period Time - * - * @param[in] u32TickSelection It is used to set the RTC tick period time for Periodic Time Tick request. \n - * It consists of: - * - \ref RTC_TICK_1_SEC : Time tick is 1 second - * - \ref RTC_TICK_1_2_SEC : Time tick is 1/2 second - * - \ref RTC_TICK_1_4_SEC : Time tick is 1/4 second - * - \ref RTC_TICK_1_8_SEC : Time tick is 1/8 second - * - \ref RTC_TICK_1_16_SEC : Time tick is 1/16 second - * - \ref RTC_TICK_1_32_SEC : Time tick is 1/32 second - * - \ref RTC_TICK_1_64_SEC : Time tick is 1/64 second - * - \ref RTC_TICK_1_128_SEC : Time tick is 1/128 second - * - * @return None - * - * @details This API is used to set RTC tick period time for each tick interrupt. - */ -void RTC_SetTickPeriod(uint32_t u32TickSelection) -{ - RTC->TICK = (RTC->TICK & ~RTC_TICK_TICK_Msk) | u32TickSelection; -} - -/** - * @brief Enable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - \ref RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP1IEN_Msk : Tamper 1 or Pair 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP3IEN_Msk : Tamper 3 or Pair 1 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP5IEN_Msk : Tamper 5 or Pair 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_CLKFIEN_Msk : LXT Clock Frequency Monitor Fail interrupt - * - \ref RTC_INTEN_CLKSTIEN_Msk : LXT Clock Frequency Monitor Stop interrupt - * - * @return None - * - * @details This API is used to enable the specify RTC interrupt function. - */ -void RTC_EnableInt(uint32_t u32IntFlagMask) -{ - RTC->INTEN |= u32IntFlagMask; -} - -/** - * @brief Disable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - \ref RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP1IEN_Msk : Tamper 1 or Pair 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP3IEN_Msk : Tamper 3 or Pair 1 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP5IEN_Msk : Tamper 5 or Pair 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_CLKFIEN_Msk : LXT Clock Frequency Monitor Fail interrupt - * - \ref RTC_INTEN_CLKSTIEN_Msk : LXT Clock Frequency Monitor Stop interrupt - * - * @return None - * - * @details This API is used to disable the specify RTC interrupt function. - */ -void RTC_DisableInt(uint32_t u32IntFlagMask) -{ - RTC->INTEN &= ~u32IntFlagMask; - RTC->INTSTS = u32IntFlagMask; -} - -/** - * @brief Enable Spare Registers Access - * - * @param None - * - * @return None - * - * @details This API is used to enable the spare registers 0~19 can be accessed. - */ -void RTC_EnableSpareAccess(void) -{ - RTC->SPRCTL |= RTC_SPRCTL_SPRRWEN_Msk; -} - -/** - * @brief Disable Spare Register - * - * @param None - * - * @return None - * - * @details This API is used to disable the spare register 0~19 cannot be accessed. - */ -void RTC_DisableSpareRegister(void) -{ - RTC->SPRCTL &= ~RTC_SPRCTL_SPRRWEN_Msk; -} - -/** - * @brief Static Tamper Detect - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref RTC_TAMPER5_SELECT - * - \ref RTC_TAMPER4_SELECT - * - \ref RTC_TAMPER3_SELECT - * - \ref RTC_TAMPER2_SELECT - * - \ref RTC_TAMPER1_SELECT - * - \ref RTC_TAMPER0_SELECT - * - * @param[in] u32DetecLevel Tamper pin detection level select. Possible options are - * - \ref RTC_TAMPER_HIGH_LEVEL_DETECT - * - \ref RTC_TAMPER_LOW_LEVEL_DETECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref RTC_TAMPER_DEBOUNCE_ENABLE - * - \ref RTC_TAMPER_DEBOUNCE_DISABLE - * - * @return None - * - * @details This API is used to enable the tamper pin detect function with specify trigger condition. - * User need disable dynamic tamper function before use this API. - */ -void RTC_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - u32Reg = RTC->TAMPCTL; - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | (u32DetecLevel << RTC_TAMPCTL_TAMP0LV_Pos) | - (u32DebounceEn << RTC_TAMPCTL_TAMP0DBEN_Pos)); - - for(i = 0UL; i < (uint32_t)RTC_MAX_TAMPER_PIN_NUM; i++) - { - if(u32TamperSelect & (0x1UL << i)) - { - u32Reg &= ~((RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP0LV_Msk | RTC_TAMPCTL_TAMP0DBEN_Msk) << (i * 4UL)); - u32Reg |= (u32TmpReg << (i * 4UL)); - } - } - - RTC->TAMPCTL = u32Reg; - -} - -/** - * @brief Static Tamper Disable - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref RTC_TAMPER5_SELECT - * - \ref RTC_TAMPER4_SELECT - * - \ref RTC_TAMPER3_SELECT - * - \ref RTC_TAMPER2_SELECT - * - \ref RTC_TAMPER1_SELECT - * - \ref RTC_TAMPER0_SELECT - * - * @return None - * - * @details This API is used to disable the static tamper pin detect. - */ -void RTC_StaticTamperDisable(uint32_t u32TamperSelect) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - u32Reg = RTC->TAMPCTL; - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk); - - for(i = 0UL; i < (uint32_t)RTC_MAX_TAMPER_PIN_NUM; i++) - { - if(u32TamperSelect & (0x1UL << i)) - { - u32Reg &= ~(u32TmpReg << (i * 4UL)); - } - } - - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Detect - * - * @param[in] u32PairSel Tamper pin detection enable. Possible options are - * - \ref RTC_PAIR0_SELECT - * - \ref RTC_PAIR1_SELECT - * - \ref RTC_PAIR2_SELECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref RTC_TAMPER_DEBOUNCE_ENABLE - * - \ref RTC_TAMPER_DEBOUNCE_DISABLE - * - * @param[in] u32Pair1Source Dynamic Pair 1 Input Source Select - * 0: Pair 1 source select tamper 2 - * 1: Pair 1 source select tamper 0 - * - * @param[in] u32Pair2Source Dynamic Pair 2 Input Source Select - * 0: Pair 2 source select tamper 4 - * 1: Pair 2 source select tamper 0 - * - * @return None - * - * @details This API is used to enable the dynamic tamper. - */ -void RTC_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2Debounce, u32Tamper4Debounce; - - u32Reg = RTC->TAMPCTL; - u32Reg &= ~(RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_TAMP2EN_Msk | - RTC_TAMPCTL_TAMP3EN_Msk | RTC_TAMPCTL_TAMP4EN_Msk | RTC_TAMPCTL_TAMP5EN_Msk); - - u32Tamper2Debounce = u32Reg & RTC_TAMPCTL_TAMP2DBEN_Msk; - u32Tamper4Debounce = u32Reg & RTC_TAMPCTL_TAMP4DBEN_Msk; - - u32Reg &= ~(RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_TAMP2EN_Msk | - RTC_TAMPCTL_TAMP3EN_Msk | RTC_TAMPCTL_TAMP4EN_Msk | RTC_TAMPCTL_TAMP5EN_Msk); - u32Reg &= ~(RTC_TAMPCTL_DYN1ISS_Msk | RTC_TAMPCTL_DYN2ISS_Msk); - u32Reg |= ((u32Pair1Source & 0x1UL) << RTC_TAMPCTL_DYN1ISS_Pos) | ((u32Pair2Source & 0x1UL) << RTC_TAMPCTL_DYN2ISS_Pos); - - if(u32DebounceEn) - { - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | - RTC_TAMPCTL_TAMP0DBEN_Msk | RTC_TAMPCTL_TAMP1DBEN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - } - else - { - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - } - - for(i = 0UL; i < (uint32_t)RTC_MAX_PAIR_NUM; i++) - { - if(u32PairSel & (0x1UL << i)) - { - u32Reg &= ~((RTC_TAMPCTL_TAMP0DBEN_Msk | RTC_TAMPCTL_TAMP1DBEN_Msk) << (i * 8UL)); - u32Reg |= (u32TmpReg << (i * 8UL)); - } - } - - if((u32Pair1Source) && (u32PairSel & (uint32_t)RTC_PAIR1_SELECT)) - { - u32Reg &= ~RTC_TAMPCTL_TAMP2EN_Msk; - u32Reg |= u32Tamper2Debounce; - } - - if((u32Pair2Source) && (u32PairSel & (uint32_t)RTC_PAIR2_SELECT)) - { - u32Reg &= ~RTC_TAMPCTL_TAMP4EN_Msk; - u32Reg |= u32Tamper4Debounce; - } - - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Disable - * - * @param[in] u32PairSel Tamper pin detection enable. Possible options are - * - \ref RTC_PAIR0_SELECT - * - \ref RTC_PAIR1_SELECT - * - \ref RTC_PAIR2_SELECT - * - * @return None - * - * @details This API is used to disable the dynamic tamper. - */ -void RTC_DynamicTamperDisable(uint32_t u32PairSel) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2En = 0UL, u32Tamper4En = 0UL; - - u32Reg = RTC->TAMPCTL; - - if((u32Reg & (uint32_t)RTC_TAMPCTL_DYN1ISS_Msk) && (u32PairSel & (uint32_t)RTC_PAIR1_SELECT)) - { - u32Tamper2En = u32Reg & RTC_TAMPCTL_TAMP2EN_Msk; - } - - if((u32Reg & (uint32_t)RTC_TAMPCTL_DYN2ISS_Msk) && (u32PairSel & (uint32_t)RTC_PAIR2_SELECT)) - { - u32Tamper4En = u32Reg & RTC_TAMPCTL_TAMP4EN_Msk; - } - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - - for(i = 0UL; i < (uint32_t)RTC_MAX_PAIR_NUM; i++) - { - if(u32PairSel & (0x1UL << i)) - { - u32Reg &= ~(u32TmpReg << ((i * 8UL))); - } - } - - u32Reg |= (u32Tamper2En | u32Tamper4En); - - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Config Dynamic Tamper - * - * @param[in] u32ChangeRate The dynamic tamper output change rate - * - \ref RTC_2POW10_CLK - * - \ref RTC_2POW11_CLK - * - \ref RTC_2POW12_CLK - * - \ref RTC_2POW13_CLK - * - \ref RTC_2POW14_CLK - * - \ref RTC_2POW15_CLK - * - \ref RTC_2POW16_CLK - * - \ref RTC_2POW17_CLK - * - * @param[in] u32SeedReload Reload new seed or not - * 0: not reload new seed - * 1: reload new seed - * - * @param[in] u32RefPattern Reference pattern - * - \ref RTC_REF_RANDOM_PATTERN - * - \ref RTC_REF_SEED_VALUE - * - * @param[in] u32Seed Seed Value (0x0 ~ 0xFFFFFFFF) - * - * @return None - * - * @details This API is used to config dynamic tamper setting. - */ -void RTC_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed) -{ - uint32_t u32Reg; - - u32Reg = RTC->TAMPCTL; - - u32Reg &= ~(RTC_TAMPCTL_DYNSRC_Msk | RTC_TAMPCTL_SEEDRLD_Msk | RTC_TAMPCTL_DYNRATE_Msk); - - u32Reg |= (u32ChangeRate) | ((u32SeedReload & 0x1UL) << RTC_TAMPCTL_SEEDRLD_Pos) | - (u32RefPattern << RTC_TAMPCTL_DYNSRC_Pos); - - RTC->TAMPSEED = u32Seed; /* need set seed value before re-loade seed */ - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Set RTC Clock Source - * - * @param[in] u32ClkSrc u32ClkSrc is the RTC clock source. It could be - * - \ref RTC_CLOCK_SOURCE_LXT - * - \ref RTC_CLOCK_SOURCE_LIRC - * - \ref RTC_CLOCK_SOURCE_LIRC32K - * - * @retval RTC_CLOCK_SOURCE_LXT - * @retval RTC_CLOCK_SOURCE_LIRC - * @retval RTC_CLOCK_SOURCE_LIRC32K - * - * @details This API is used to get the setting of RTC clock source. - * User must to enable the selected clock source by themselves executing perform this API. - */ -uint32_t RTC_SetClockSource(uint32_t u32ClkSrc) -{ - uint32_t u32TrimDefault = inpw(SYS_BASE + 0x14Cul); - - if(u32ClkSrc == RTC_CLOCK_SOURCE_LXT) - { - /* RTC clock source is external LXT */ - RTC->LXTCTL &= ~RTC_LXTCTL_RTCCKSEL_Msk; - RTC->LXTCTL &= ~RTC_LXTCTL_C32KSEL_Msk; - - return RTC_CLOCK_SOURCE_LXT; - } - else if(u32ClkSrc == RTC_CLOCK_SOURCE_LIRC32K) - { - /* Load LIRC32 trim setting */ - RTC->LXTCTL = ((RTC->LXTCTL & ~(0x1FFul << 16)) | ((u32TrimDefault & 0x1FFul) << 16)); - - /* RTC clock source is LIRC32K */ - RTC->LXTCTL |= RTC_LXTCTL_LIRC32KEN_Msk; - RTC->LXTCTL &= ~RTC_LXTCTL_RTCCKSEL_Msk; - RTC->LXTCTL |= RTC_LXTCTL_C32KSEL_Msk; - - return RTC_CLOCK_SOURCE_LIRC32K; - } - else if(u32ClkSrc == RTC_CLOCK_SOURCE_LIRC) - { - /* RTC clock source is LIRC */ - RTC->LXTCTL |= RTC_LXTCTL_RTCCKSEL_Msk; - - return RTC_CLOCK_SOURCE_LIRC; - } - else - { - /* Set the default RTC clock source is LIRC */ - RTC->LXTCTL |= RTC_LXTCTL_RTCCKSEL_Msk; - - return RTC_CLOCK_SOURCE_LIRC; - } -} - -/** - * @brief Set RTC GPIO Operation Mode - * - * @param[in] u32Pin The single pin of GPIO-F port. - * It could be 4~11, which means PF.4~PF.11. - * @param[in] u32Mode Operation mode. It could be - * - \ref RTC_IO_MODE_INPUT - * - \ref RTC_IO_MODE_OUTPUT - * - \ref RTC_IO_MODE_OPEN_DRAIN - * - \ref RTC_IO_MODE_QUASI - * @param[in] u32DigitalCtl The digital input path control of specified pin. It could be - * - \ref RTC_IO_DIGITAL_ENABLE - * - \ref RTC_IO_DIGITAL_DISABLE - * @param[in] u32PullCtl The pull-up or pull-down control of specified pin. It could be - * - \ref RTC_IO_PULL_UP_DOWN_DISABLE - * - \ref RTC_IO_PULL_UP_ENABLE - * - \ref RTC_IO_PULL_DOWN_ENABLE - * @param[in] u32OutputLevel The I/O output level. 0: output low; 1: output high. - * - * @return None - * - * @details This function is used to set specified GPIO operation mode controlled by RTC module. - */ -void RTC_SetGPIOMode(uint32_t u32PFPin, uint32_t u32Mode, uint32_t u32DigitalCtl, uint32_t u32PullCtl, uint32_t u32OutputLevel) -{ - uint32_t u32Offset; - - if((u32PFPin == 4) || (u32PFPin == 5) || (u32PFPin == 6) || (u32PFPin == 7)) - { - u32Offset = u32PFPin - 4; - - RTC_SET_IOCTL_BY_RTC(RTC); - - RTC->GPIOCTL0 = (RTC->GPIOCTL0 & ~(0x3FUL << (u32Offset * 8))) | - (u32Mode << (u32Offset * 8)) | - (u32OutputLevel << ((u32Offset * 8) + 2)) | - (u32DigitalCtl << ((u32Offset * 8) + 3)) | - (u32PullCtl << ((u32Offset * 8) + 4)); - } - - if((u32PFPin == 8) || (u32PFPin == 9) || (u32PFPin == 10) || (u32PFPin == 11)) - { - u32Offset = u32PFPin - 8; - - RTC_SET_IOCTL_BY_RTC(RTC); - - RTC->GPIOCTL1 = (RTC->GPIOCTL1 & ~(0x3FUL << (u32Offset * 8))) | - (u32Mode << (u32Offset * 8)) | - (u32OutputLevel << ((u32Offset * 8) + 2)) | - (u32DigitalCtl << ((u32Offset * 8) + 3)) | - (u32PullCtl << ((u32Offset * 8) + 4)); - } -} - -/** - * @brief Set RTC GPIO Output Level - * - * @param[in] u32Pin The single pin of GPIO-F port. - * It could be 4~11, which means PF.4~PF.11. - * @param[in] u32OutputLevel The I/O output level. 0: output low; 1: output high. - * - * @return None - * - * @details This function is used to set GPIO output level by RTC module. - */ -void RTC_SetGPIOLevel(uint32_t u32PFPin, uint32_t u32OutputLevel) -{ - uint32_t u32Offset; - - if((u32PFPin == 4) || (u32PFPin == 5) || (u32PFPin == 6) || (u32PFPin == 7)) - { - u32Offset = u32PFPin - 4; - - RTC->GPIOCTL0 = (RTC->GPIOCTL0 & ~(0x4UL << (u32Offset * 8))) | - (u32OutputLevel << ((u32Offset * 8) + 2)); - } - - if((u32PFPin == 8) || (u32PFPin == 9) || (u32PFPin == 10) || (u32PFPin == 11)) - { - u32Offset = u32PFPin - 8; - - RTC->GPIOCTL1 = (RTC->GPIOCTL1 & ~(0x4UL << (u32Offset * 8))) | - (u32OutputLevel << ((u32Offset * 8) + 2)); - } -} - -/**@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RTC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sc.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sc.c deleted file mode 100644 index 285fedcc8c2..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sc.c +++ /dev/null @@ -1,425 +0,0 @@ -/**************************************************************************//** - * @file sc.c - * @version V3.00 - * @brief Smartcard(SC) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/* Below are variables used locally by SC driver and does not want to parse by doxygen unless HIDDEN_SYMBOLS is defined */ -/** @cond HIDDEN_SYMBOLS */ -static uint32_t g_u32CardStateIgnore[SC_INTERFACE_NUM] = {0UL, 0UL, 0UL}; - -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_FUNCTIONS SC Exported Functions - @{ -*/ - -/** - * @brief Indicates specified smartcard slot status - * - * @param[in] sc The pointer of smartcard module. - * - * @return Card insert status - * @retval TRUE Card insert - * @retval FALSE Card remove - * - * @details This function is used to check if specified smartcard slot is presented. - */ -uint32_t SC_IsCardInserted(SC_T *sc) -{ - uint32_t u32Ret; - - /* put conditions into two variable to remove IAR compilation warning */ - uint32_t cond1 = ((sc->STATUS & SC_STATUS_CDPINSTS_Msk) >> SC_STATUS_CDPINSTS_Pos); - uint32_t cond2 = ((sc->CTL & SC_CTL_CDLV_Msk) >> SC_CTL_CDLV_Pos); - - if(((sc == SC0) || (sc == SC0_NS)) && (g_u32CardStateIgnore[0] == 1UL)) - { - u32Ret = (uint32_t)TRUE; - } - else if(((sc == SC1) || (sc == SC1_NS)) && (g_u32CardStateIgnore[1] == 1UL)) - { - u32Ret = (uint32_t)TRUE; - } - else if(((sc == SC2) || (sc == SC2_NS)) && (g_u32CardStateIgnore[2] == 1UL)) - { - u32Ret = (uint32_t)TRUE; - } - else if(cond1 != cond2) - { - u32Ret = (uint32_t)FALSE; - } - else - { - u32Ret = (uint32_t)TRUE; - } - - return u32Ret; -} - -/* - * @brief Reset the Tx and Rx FIFO of smartcard module - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details This function reset both transmit and receive FIFO of specified smartcard module. - */ -void SC_ClearFIFO(SC_T *sc) -{ - while((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk) {} - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk); -} - -/** - * @brief Disable specified smartcard module - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details This function disable specified smartcard module, and force all transition to IDLE state. - */ -void SC_Close(SC_T *sc) -{ - sc->INTEN = 0UL; - - while((sc->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk) {} - sc->PINCTL = 0UL; - sc->ALTCTL = 0UL; - - while((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - sc->CTL = 0UL; -} - -/** - * @brief Initialized smartcard module - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32CardDet Card detect polarity, select the SC_CD pin state which indicates card absent. Could be: - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * -\ref SC_PIN_STATE_IGNORE, no card detect pin, always assumes card present. - * @param[in] u32PWR Power off polarity, select the SC_PWR pin state which could set smartcard VCC to high level. Could be: - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * - * @return None - * - * @details This function initialized smartcard module. - */ -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR) -{ - uint32_t u32Reg = 0UL, u32Intf; - - if((sc == SC0) || (sc == SC0_NS)) - { - u32Intf = 0UL; - } - else if((sc == SC1) || (sc == SC1_NS)) - { - u32Intf = 1UL; - } - else - { - u32Intf = 2UL; - } - - if(u32CardDet != SC_PIN_STATE_IGNORE) - { - u32Reg = u32CardDet ? 0UL : SC_CTL_CDLV_Msk; - g_u32CardStateIgnore[u32Intf] = 0UL; - } - else - { - g_u32CardStateIgnore[u32Intf] = 1UL; - } - sc->PINCTL = u32PWR ? 0UL : SC_PINCTL_PWRINV_Msk; - - while((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_TMRSEL_Msk | u32Reg; -} - -/** - * @brief Reset specified smartcard module - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details This function reset specified smartcard module to its default state for activate smartcard. - */ -void SC_ResetReader(SC_T *sc) -{ - uint32_t u32Intf; - - if((sc == SC0) || (sc == SC0_NS)) - { - u32Intf = 0UL; - } - else if((sc == SC1) || (sc == SC1_NS)) - { - u32Intf = 1UL; - } - else - { - u32Intf = 2UL; - } - - /* Reset FIFO, enable auto de-activation while card removal */ - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk | SC_ALTCTL_ADACEN_Msk); - /* Set Rx trigger level to 1 character, longest card detect debounce period, disable error retry (EMV ATR does not use error retry) */ - while((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - sc->CTL &= ~(SC_CTL_RXTRGLV_Msk | - SC_CTL_CDDBSEL_Msk | - SC_CTL_TXRTY_Msk | - SC_CTL_TXRTYEN_Msk | - SC_CTL_RXRTY_Msk | - SC_CTL_RXRTYEN_Msk); - while((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) {} - /* Enable auto convention, and all three smartcard internal timers */ - sc->CTL |= SC_CTL_AUTOCEN_Msk | SC_CTL_TMRSEL_Msk; - /* Disable Rx timeout */ - sc->RXTOUT = 0UL; - /* 372 clocks per ETU by default */ - sc->ETUCTL = 371UL; - - /* Enable necessary interrupt for smartcard operation */ - if(g_u32CardStateIgnore[u32Intf]) /* Do not enable card detect interrupt if card present state ignore */ - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_ACERRIEN_Msk); - } - else - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_ACERRIEN_Msk | - SC_INTEN_CDIEN_Msk); - } - - return; -} - -/** - * @brief Set Block Guard Time (BGT) - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32BGT Block guard time using ETU as unit, valid range are between 1 ~ 32. - * - * @return None - * - * @details This function is used to configure block guard time (BGT) of specified smartcard module. - */ -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT) -{ - sc->CTL = (sc->CTL & ~SC_CTL_BGT_Msk) | ((u32BGT - 1UL) << SC_CTL_BGT_Pos); -} - -/** - * @brief Set Character Guard Time (CGT) - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32CGT Character guard time using ETU as unit, valid range are between 11 ~ 267. - * - * @return None - * - * @details This function is used to configure character guard time (CGT) of specified smartcard module. - * @note Before using this API, user should set the correct stop bit length first. - */ -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT) -{ - /* CGT is "START bit" + "8-bits" + "Parity bit" + "STOP bit(s)" + "EGT counts" */ - u32CGT -= ((sc->CTL & SC_CTL_NSB_Msk) == SC_CTL_NSB_Msk) ? 11UL : 12UL; - sc->EGT = u32CGT; -} - -/** - * @brief Stop all smartcard timer - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @note This function stop the timers within specified smartcard module, \b not timer module. - */ -void SC_StopAllTimer(SC_T *sc) -{ - while((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk) {} - sc->ALTCTL &= ~(SC_ALTCTL_CNTEN0_Msk | SC_ALTCTL_CNTEN1_Msk | SC_ALTCTL_CNTEN2_Msk); -} - -/** - * @brief Configure and start smartcard timer - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32TimerNum Timer to start. Valid values are 0, 1, 2. - * @param[in] u32Mode Timer operating mode, valid values are: - * - \ref SC_TMR_MODE_0 - * - \ref SC_TMR_MODE_1 - * - \ref SC_TMR_MODE_2 - * - \ref SC_TMR_MODE_3 - * - \ref SC_TMR_MODE_4 - * - \ref SC_TMR_MODE_5 - * - \ref SC_TMR_MODE_6 - * - \ref SC_TMR_MODE_7 - * - \ref SC_TMR_MODE_8 - * - \ref SC_TMR_MODE_F - * @param[in] u32ETUCount Timer timeout duration, ETU based. For timer 0, valid range are between 1 ~ 0x1000000 ETUs. - * For timer 1 and timer 2, valid range are between 1 ~ 0x100 ETUs. - * - * @return None - * - * @note This function start the timer within specified smartcard module, \b not timer module. - * @note Depend on the timer operating mode, timer may not start counting immediately and starts when condition match. - */ -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount) -{ - uint32_t u32Reg = u32Mode | (SC_TMRCTL0_CNT_Msk & (u32ETUCount - 1UL)); - while((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk) {} - if(u32TimerNum == 0UL) - { - while((sc->TMRCTL0 & SC_TMRCTL0_SYNC_Msk) == SC_TMRCTL0_SYNC_Msk) {} - sc->TMRCTL0 = u32Reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN0_Msk; - } - else if(u32TimerNum == 1UL) - { - while((sc->TMRCTL1 & SC_TMRCTL1_SYNC_Msk) == SC_TMRCTL1_SYNC_Msk) {} - sc->TMRCTL1 = u32Reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - while((sc->TMRCTL2 & SC_TMRCTL2_SYNC_Msk) == SC_TMRCTL2_SYNC_Msk) {} - sc->TMRCTL2 = u32Reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief Stop a smartcard timer - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32TimerNum Timer to stop. Valid values are 0, 1, 2. - * - * @return None - * - * @note This function stop the timer within specified smartcard module, \b not timer module. - */ -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum) -{ - while(sc->ALTCTL & SC_ALTCTL_SYNC_Msk) {} - - if(u32TimerNum == 0UL) /* timer 0 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN0_Msk; - } - else if(u32TimerNum == 1UL) /* timer 1 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief Get smartcard clock frequency - * - * @param[in] sc The pointer of smartcard module. - * - * @return Smartcard frequency in kHZ - * - * @details This function is used to get specified smartcard module clock frequency in kHz. - */ -uint32_t SC_GetInterfaceClock(SC_T *sc) -{ - uint32_t u32ClkSrc = 0, u32Num = 0, u32ClkFreq = __HIRC, u32Div = 0; - - /* Get smartcard module clock source and divider */ - if((sc == SC0) || (sc == SC0_NS)) - { - u32Num = 0UL; - u32ClkSrc = CLK_GetModuleClockSource(SC0_MODULE); - u32Div = CLK_GetModuleClockDivider(SC0_MODULE); - } - else if((sc == SC1) || (sc == SC1_NS)) - { - u32Num = 1UL; - u32ClkSrc = CLK_GetModuleClockSource(SC1_MODULE); - u32Div = CLK_GetModuleClockDivider(SC1_MODULE); - } - else if((sc == SC2) || (sc == SC2_NS)) - { - u32Num = 2UL; - u32ClkSrc = CLK_GetModuleClockSource(SC2_MODULE); - u32Div = CLK_GetModuleClockDivider(SC2_MODULE); - } - else - { - u32ClkFreq = 0UL; - } - - if(u32ClkFreq != 0UL) - { - /* Get smartcard module clock */ - if(u32ClkSrc == 0UL) - { - u32ClkFreq = __HXT; - } - else if(u32ClkSrc == 1UL) - { - u32ClkFreq = CLK_GetPLLClockFreq(); - } - else if(u32ClkSrc == 2UL) - { - if(u32Num == 1UL) - { - u32ClkFreq = CLK_GetPCLK1Freq(); - } - else - { - u32ClkFreq = CLK_GetPCLK0Freq(); - } - } - else - { - u32ClkFreq = __HIRC; - } - - u32ClkFreq /= (u32Div + 1UL) * 1000UL; - } - - return u32ClkFreq; -} - -/**@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_scuart.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_scuart.c deleted file mode 100644 index 363ebdd6daa..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_scuart.c +++ /dev/null @@ -1,272 +0,0 @@ -/**************************************************************************//** - * @file scuart.c - * @version V3.00 - * @brief Smartcard UART mode (SCUART) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/** - * @brief Disable smartcard interface - * - * @param sc The pointer of smartcard module. - * - * @return None - * - * @details The function is used to disable smartcard interface UART mode. - */ -void SCUART_Close(SC_T* sc) -{ - sc->INTEN = 0UL; - sc->UARTCTL = 0UL; - sc->CTL = 0UL; -} - -/** @cond HIDDEN_SYMBOLS */ -/** - * @brief Returns module clock of specified SC interface - * - * @param[in] sc The pointer of smartcard module. - * - * @return Module clock of specified SC interface. - */ -static uint32_t SCUART_GetClock(SC_T *sc) -{ - uint32_t u32ClkSrc = 0, u32Num = 0, u32ClkFreq = __HIRC, u32Div = 0; - - /* Get smartcard module clock source and divider */ - if((sc == SC0) || (sc == SC0_NS)) - { - u32Num = 0UL; - u32ClkSrc = CLK_GetModuleClockSource(SC0_MODULE); - u32Div = CLK_GetModuleClockDivider(SC0_MODULE); - } - else if((sc == SC1) || (sc == SC1_NS)) - { - u32Num = 1UL; - u32ClkSrc = CLK_GetModuleClockSource(SC1_MODULE); - u32Div = CLK_GetModuleClockDivider(SC1_MODULE); - } - else if((sc == SC2) || (sc == SC2_NS)) - { - u32Num = 2UL; - u32ClkSrc = CLK_GetModuleClockSource(SC2_MODULE); - u32Div = CLK_GetModuleClockDivider(SC2_MODULE); - } - else - { - u32ClkFreq = 0UL; - } - - if(u32ClkFreq != 0UL) - { - /* Get smartcard module clock */ - if(u32ClkSrc == 0UL) - { - u32ClkFreq = __HXT; - } - else if(u32ClkSrc == 1UL) - { - u32ClkFreq = CLK_GetPLLClockFreq(); - } - else if(u32ClkSrc == 2UL) - { - if(u32Num == 1UL) - { - u32ClkFreq = CLK_GetPCLK1Freq(); - } - else - { - u32ClkFreq = CLK_GetPCLK0Freq(); - } - } - else - { - u32ClkFreq = __HIRC; - } - - u32ClkFreq /= (u32Div + 1UL); - } - - return u32ClkFreq; -} -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Enable smartcard module UART mode and set baudrate - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Baudrate Target baudrate of smartcard UART module. - * - * @return Actual baudrate of smartcard UART mode - * - * @details This function use to enable smartcard module UART mode and set baudrate. - * - * @note This function configures character width to 8 bits, 1 stop bit, and no parity. - * And can use \ref SCUART_SetLineConfig function to update these settings. - * The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_Open(SC_T* sc, uint32_t u32Baudrate) -{ - uint32_t u32ClkFreq = SCUART_GetClock(sc), u32Div; - - /* Calculate divider for target baudrate */ - u32Div = (u32ClkFreq + (u32Baudrate >> 1) - 1UL) / u32Baudrate - 1UL; - - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk; /* Enable smartcard interface and stop bit = 1 */ - sc->UARTCTL = SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk; /* Enable UART mode, disable parity and 8 bit per character */ - sc->ETUCTL = u32Div; - - return (u32ClkFreq / (u32Div + 1UL)); -} - -/** - * @brief Read Rx data from Rx FIFO - * - * @param[in] sc The pointer of smartcard module. - * @param[in] pu8RxBuf The buffer to store receive the data. - * @param[in] u32ReadBytes Target number of characters to receive - * - * @return Actual character number reads to buffer - * - * @details The function is used to read data from Rx FIFO. - * - * @note This function does not block and return immediately if there's no data available. - */ -uint32_t SCUART_Read(SC_T* sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count; - - for(u32Count = 0UL; u32Count < u32ReadBytes; u32Count++) - { - if(SCUART_GET_RX_EMPTY(sc) == SC_STATUS_RXEMPTY_Msk) - { - /* No data available */ - break; - } - /* Get data from FIFO */ - pu8RxBuf[u32Count] = (uint8_t)SCUART_READ(sc); - } - - return u32Count; -} - -/** - * @brief Configure smartcard UART mode line setting - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Baudrate Target baudrate of smartcard UART mode. If this value is 0, SC UART baudrate will not change. - * @param[in] u32DataWidth The data length, could be: - * - \ref SCUART_CHAR_LEN_5 - * - \ref SCUART_CHAR_LEN_6 - * - \ref SCUART_CHAR_LEN_7 - * - \ref SCUART_CHAR_LEN_8 - * @param[in] u32Parity The parity setting, could be: - * - \ref SCUART_PARITY_NONE - * - \ref SCUART_PARITY_ODD - * - \ref SCUART_PARITY_EVEN - * @param[in] u32StopBits The stop bit length, could be: - * - \ref SCUART_STOP_BIT_1 - * - \ref SCUART_STOP_BIT_2 - * - * @return Actual baudrate of smartcard UART mode - * - * @details The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_SetLineConfig(SC_T* sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits) -{ - uint32_t u32ClkFreq = SCUART_GetClock(sc), u32Div; - - if(u32Baudrate == 0UL) - { - /* Keep original baudrate setting */ - u32Div = sc->ETUCTL & SC_ETUCTL_ETURDIV_Msk; - } - else - { - /* Calculate divider for target baudrate */ - u32Div = ((u32ClkFreq + (u32Baudrate >> 1) - 1UL) / u32Baudrate) - 1UL; - sc->ETUCTL = u32Div; - } - - sc->CTL = u32StopBits | SC_CTL_SCEN_Msk; /* Set stop bit */ - sc->UARTCTL = u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk; /* Set character width and parity */ - - return (u32ClkFreq / (u32Div + 1UL)); -} - -/** - * @brief Set receive timeout count - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32TOC Rx time-out counter, using baudrate as counter unit. Valid range are 0~0x1FF, - * set this value to 0 will disable time-out counter. - * - * @return None - * - * @details The time-out counter resets and starts counting whenever the Rx buffer received a - * new data word. Once the counter decrease to 1 and no new data is received or CPU - * does not read any data from FIFO, a receiver time-out interrupt will be generated. - */ -void SCUART_SetTimeoutCnt(SC_T* sc, uint32_t u32TOC) -{ - sc->RXTOUT = u32TOC; -} - -/** - * @brief Write data into transmit FIFO to send data out - * - * @param[in] sc The pointer of smartcard module. - * @param[in] pu8TxBuf The buffer containing data to send to transmit FIFO. - * @param[in] u32WriteBytes Number of data to send. - * - * @return None - * - * @details This function is used to write data into Tx FIFO to send data out. - * - * @note This function blocks until all data write into FIFO. - */ -void SCUART_Write(SC_T* sc, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count; - - for(u32Count = 0UL; u32Count != u32WriteBytes; u32Count++) - { - /* Wait 'til FIFO not full */ - while(SCUART_GET_TX_FULL(sc) == SC_STATUS_TXFULL_Msk) {} - - /* Write 1 byte to FIFO */ - sc->DAT = pu8TxBuf[u32Count]; /* Write 1 byte to FIFO */ - } -} - - -/**@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SCUART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sdh.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sdh.c deleted file mode 100644 index 6c580cb246e..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sdh.c +++ /dev/null @@ -1,1138 +0,0 @@ -/**************************************************************************//** - * @file sdh.c - * @version V1.00 - * @brief M2354 SDH driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include -#include -#include -#include "NuMicro.h" - -#if defined (__ICCARM__) - #pragma diag_suppress=Pm073, Pm143 /* Misra C 2004 rule 14.7 */ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ - -#define SDH_BLOCK_SIZE 512UL - -/* #define DEBUG_PRINTF printf */ -#define DEBUG_PRINTF(...) - -/** @cond HIDDEN_SYMBOLS */ - -/* global variables */ -/* For response R3 (such as ACMD41, CRC-7 is invalid; but SD controller will still */ -/* calculate CRC-7 and get an error result, software should ignore this error and clear SDISR [CRC_IF] flag */ -/* _sd_uR3_CMD is the flag for it. 1 means software should ignore CRC-7 error */ -uint8_t g_u8R3Flag = 0UL; -uint8_t volatile g_u8SDDataReadyFlag = (uint8_t)FALSE; - -static uint32_t _SDH_uR7_CMD = 0UL; -static uint32_t _SDH_ReferenceClock; - -#if defined ( __ICCARM__ ) /*!< IAR Compiler */ - #pragma data_alignment = 4 - static uint8_t _SDH_ucSDHCBuffer[512]; -#else - static __attribute__((aligned)) uint8_t _SDH_ucSDHCBuffer[512]; -#endif - -/* Declare these functions here to avoid MISRA C 2004 rule 8.1 error */ -void SDH_CheckRB(SDH_T *sdh); -uint32_t SDH_SDCommand(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg); -uint32_t SDH_SDCmdAndRsp(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg, uint32_t u32TickCount); -uint32_t SDH_Swap32(uint32_t u32Val); -uint32_t SDH_SDCmdAndRsp2(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg, uint32_t pu32R2ptr[]); -uint32_t SDH_SDCmdAndRspDataIn(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg); -void SDH_Set_clock(SDH_T *sdh, uint32_t u32SDClockKhz); -uint32_t SDH_CardDetection(SDH_T *sdh); -uint32_t SDH_Init(SDH_T *sdh); -uint32_t SDH_SwitchToHighSpeed(SDH_T *sdh, SDH_INFO_T *pSD); -uint32_t SDH_SelectCardType(SDH_T *sdh); -void SDH_Get_SD_info(SDH_T *sdh); - -SDH_INFO_T SD0; - -void SDH_CheckRB(SDH_T *sdh) -{ - while (1) - { - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while (sdh->CTL & SDH_CTL_CLK8OEN_Msk) {} - if (sdh->INTSTS & SDH_INTSTS_DAT0STS_Msk) - { - break; - } - } -} - - -uint32_t SDH_SDCommand(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg) -{ - SDH_INFO_T *pSD; - volatile uint32_t u32Status = Successful; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - sdh->CMDARG = u32Arg; - sdh->CTL = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (u32Cmd << 8) | (SDH_CTL_COEN_Msk); - - while (sdh->CTL & SDH_CTL_COEN_Msk) - { - if (pSD->IsCardInsert == (uint32_t)FALSE) - { - u32Status = SDH_NO_SD_CARD; - } - } - return u32Status; -} - - -uint32_t SDH_SDCmdAndRsp(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg, uint32_t u32TickCount) -{ - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - sdh->CMDARG = u32Arg; - sdh->CTL = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (u32Cmd << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk); - - if (u32TickCount > 0UL) - { - while (sdh->CTL & SDH_CTL_RIEN_Msk) - { - if (u32TickCount-- == 0UL) - { - sdh->CTL |= SDH_CTL_CTLRST_Msk; /* reset SD engine */ - return 2UL; - } - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - else - { - while (sdh->CTL & SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - - if (_SDH_uR7_CMD) - { - if ((sdh->RESP1 & 0xffUL) != 0x55UL) - { - if ((sdh->RESP0 & 0xfUL) != 0x01UL) - { - _SDH_uR7_CMD = 0UL; - return SDH_CMD8_ERROR; - } - } - } - - if (!g_u8R3Flag) - { - if (sdh->INTSTS & SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return Successful; - } - else - { - return SDH_CRC7_ERROR; - } - } - else /* ignore CRC error for R3 case */ - { - g_u8R3Flag = 0UL; - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return Successful; - } -} - - -uint32_t SDH_Swap32(uint32_t u32Val) -{ - uint32_t u32Buf; - - u32Buf = u32Val; - u32Val <<= 24; - u32Val |= (u32Buf << 8) & 0xff0000UL; - u32Val |= (u32Buf >> 8) & 0xff00UL; - u32Val |= (u32Buf >> 24) & 0xffUL; - return u32Val; -} - -/* Get 16 bytes CID or CSD */ -uint32_t SDH_SDCmdAndRsp2(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg, uint32_t pu32R2ptr[]) -{ - uint32_t i; - uint32_t au32TmpBuf[5]; - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - sdh->CMDARG = u32Arg; - sdh->CTL = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (u32Cmd << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_R2EN_Msk); - - while (sdh->CTL & SDH_CTL_R2EN_Msk) - { - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if (sdh->INTSTS & SDH_INTSTS_CRC7_Msk) - { - for (i = 0UL; i < 5UL; i++) - { - au32TmpBuf[i] = SDH_Swap32(sdh->FB[i]); - } - for (i = 0UL; i < 4UL; i++) - { - pu32R2ptr[i] = ((au32TmpBuf[i] & 0x00ffffffUL) << 8) | ((au32TmpBuf[i + 1UL] & 0xff000000UL) >> 24); - } - return Successful; - } - else - { - return SDH_CRC7_ERROR; - } -} - - -uint32_t SDH_SDCmdAndRspDataIn(SDH_T *sdh, uint32_t u32Cmd, uint32_t u32Arg) -{ - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - sdh->CMDARG = u32Arg; - sdh->CTL = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | ((uint32_t)u32Cmd << 8) | - (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - - while (sdh->CTL & SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == (uint32_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - while (sdh->CTL & SDH_CTL_DIEN_Msk) - { - if (pSD->IsCardInsert == (uint32_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if (!(sdh->INTSTS & SDH_INTSTS_CRC7_Msk)) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if (!(sdh->INTSTS & SDH_INTSTS_CRC16_Msk)) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - - return Successful; -} - -/* there are 8 bits for divider0, maximum is 256 */ -#define SDH_CLK_DIV0_MAX 256UL - -void SDH_Set_clock(SDH_T *sdh, uint32_t u32SDClockKhz) -{ - (void)sdh; - if (!(__PC() & (1UL << 28))) - { - uint32_t u32Rate, u32Div1; - static uint32_t u32SDClkSrc = 0UL; - - SYS_UnlockReg(); - /* M2354 is only support SDH0 */ - u32SDClkSrc = (CLK->CLKSEL0 & CLK_CLKSEL0_SDH0SEL_Msk); - if (u32SDClkSrc == CLK_CLKSEL0_SDH0SEL_HXT) - { - _SDH_ReferenceClock = (CLK_GetHXTFreq() / 1000UL); - } - else if (u32SDClkSrc == CLK_CLKSEL0_SDH0SEL_HIRC) - { - _SDH_ReferenceClock = (__HIRC / 1000UL); - } - else if (u32SDClkSrc == CLK_CLKSEL0_SDH0SEL_PLL) - { - _SDH_ReferenceClock = (CLK_GetPLLClockFreq() / 1000UL); - } - else if (u32SDClkSrc == CLK_CLKSEL0_SDH0SEL_HCLK) - { - _SDH_ReferenceClock = (CLK_GetHCLKFreq() / 1000UL); - } - - if (u32SDClockKhz >= 50000UL) - { - u32SDClockKhz = 50000UL; - } - u32Rate = _SDH_ReferenceClock / u32SDClockKhz; - - /* choose slower clock if system clock cannot divisible by wanted clock */ - if (_SDH_ReferenceClock % u32SDClockKhz != 0UL) - { - u32Rate++; - } - - if (u32Rate >= SDH_CLK_DIV0_MAX) - { - u32Rate = SDH_CLK_DIV0_MAX; - } - - /* --- calculate the second divider CLKDIV0[SDHOST_N] */ - if (u32Rate == 0UL) - { - u32Div1 = 0UL; - } - else - { - u32Div1 = ((u32Rate - 1UL) & 0xFFUL); - } - - /* --- setup register */ - /* M2354 is only support SDH0 */ - CLK->CLKDIV0 &= ~CLK_CLKDIV0_SDH0DIV_Msk; - CLK->CLKDIV0 |= (u32Div1 << CLK_CLKDIV0_SDH0DIV_Pos); - } -} - -uint32_t SDH_CardDetection(SDH_T *sdh) -{ - uint32_t i, u32Status = (uint32_t)TRUE; - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - if (sdh->INTEN & SDH_INTEN_CDSRC_Msk) /* Card detect pin from GPIO */ - { - if (sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) /* Card remove */ - { - pSD->IsCardInsert = (uint8_t)FALSE; - u32Status = (uint32_t)FALSE; - } - else - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - } - else if (!(sdh->INTEN & SDH_INTEN_CDSRC_Msk)) - { - sdh->CTL |= SDH_CTL_CLKKEEP_Msk; - for (i = 0UL; i < 5000UL; i++) {} - - if (sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) /* Card insert */ - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - else - { - pSD->IsCardInsert = (uint8_t)FALSE; - u32Status = (uint32_t)FALSE; - } - - sdh->CTL &= ~SDH_CTL_CLKKEEP_Msk; - } - - return u32Status; -} - - -/* Initial */ -uint32_t SDH_Init(SDH_T *sdh) -{ - uint32_t volatile i, u32Status; - uint32_t u32Resp; - uint32_t au32CIDBuffer[4]; - uint32_t volatile u32CmdTimeOut; - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - /* set the clock to 300KHz */ - SDH_Set_clock(sdh, 300UL); - - /* power ON 74 clock */ - sdh->CTL |= SDH_CTL_CLK74OEN_Msk; - - while (sdh->CTL & SDH_CTL_CLK74OEN_Msk) - { - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - SDH_SDCommand(sdh, 0UL, 0UL); /* reset all cards */ - for (i = 0x1000UL; i > 0UL; i--) {} - - /* initial SDHC */ - _SDH_uR7_CMD = 1UL; - u32CmdTimeOut = 0xFFFFFUL; - - i = SDH_SDCmdAndRsp(sdh, 8UL, 0x00000155UL, u32CmdTimeOut); - if (i == Successful) - { - /* SD 2.0 */ - SDH_SDCmdAndRsp(sdh, 55UL, 0x00UL, u32CmdTimeOut); - g_u8R3Flag = 1UL; - SDH_SDCmdAndRsp(sdh, 41UL, 0x40ff8000UL, u32CmdTimeOut); /* 2.7v-3.6v */ - u32Resp = sdh->RESP0; - - while (!(u32Resp & 0x00800000UL)) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55UL, 0x00UL, u32CmdTimeOut); - g_u8R3Flag = 1UL; - SDH_SDCmdAndRsp(sdh, 41UL, 0x40ff8000UL, u32CmdTimeOut); /* 3.0v-3.4v */ - u32Resp = sdh->RESP0; - } - if (u32Resp & 0x00400000UL) - { - pSD->CardType = SDH_TYPE_SD_HIGH; - } - else - { - pSD->CardType = SDH_TYPE_SD_LOW; - } - } - else - { - /* SD 1.1 */ - SDH_SDCommand(sdh, 0UL, 0UL); /* reset all cards */ - for (i = 0x100UL; i > 0UL; i--) {} - - i = SDH_SDCmdAndRsp(sdh, 55UL, 0x00UL, u32CmdTimeOut); - if (i == 2UL) /* MMC memory */ - { - SDH_SDCommand(sdh, 0UL, 0UL); /* reset */ - for (i = 0x100UL; i > 0UL; i--) {} - - g_u8R3Flag = 1UL; - - if (SDH_SDCmdAndRsp(sdh, 1UL, 0x40ff8000UL, u32CmdTimeOut) != 2UL) /* eMMC memory */ - { - u32Resp = sdh->RESP0; - while (!(u32Resp & 0x00800000UL)) /* check if card is ready */ - { - g_u8R3Flag = 1UL; - - SDH_SDCmdAndRsp(sdh, 1UL, 0x40ff8000UL, u32CmdTimeOut); /* high voltage */ - u32Resp = sdh->RESP0; - } - - if (u32Resp & 0x00400000UL) - { - pSD->CardType = SDH_TYPE_EMMC; - } - else - { - pSD->CardType = SDH_TYPE_MMC; - } - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_ERR_DEVICE; - } - } - else if (i == 0UL) /* SD Memory */ - { - g_u8R3Flag = 1UL; - SDH_SDCmdAndRsp(sdh, 41UL, 0x00ff8000UL, u32CmdTimeOut); /* 3.0v-3.4v */ - u32Resp = sdh->RESP0; - while (!(u32Resp & 0x00800000UL)) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55UL, 0x00UL, u32CmdTimeOut); - g_u8R3Flag = 1UL; - SDH_SDCmdAndRsp(sdh, 41UL, 0x00ff8000UL, u32CmdTimeOut); /* 3.0v-3.4v */ - u32Resp = sdh->RESP0; - } - pSD->CardType = SDH_TYPE_SD_LOW; - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_INIT_ERROR; - } - } - - /* CMD2, CMD3 */ - if (pSD->CardType != SDH_TYPE_UNKNOWN) - { - SDH_SDCmdAndRsp2(sdh, 2UL, 0x00UL, au32CIDBuffer); - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - if ((u32Status = SDH_SDCmdAndRsp(sdh, 3UL, 0x10000UL, 0UL)) != Successful) /* set RCA */ - { - return u32Status; - } - pSD->RCA = 0x10000UL; - } - else - { - if ((u32Status = SDH_SDCmdAndRsp(sdh, 3UL, 0x00UL, 0UL)) != Successful) /* get RCA */ - { - return u32Status; - } - else - { - pSD->RCA = (sdh->RESP0 << 8) & 0xffff0000UL; - } - } - } - - return Successful; -} - - -uint32_t SDH_SwitchToHighSpeed(SDH_T *sdh, SDH_INFO_T *pSD) -{ - uint32_t volatile u32Status = 0UL; - uint16_t u16CurrentComsumption, u16BusyStatus0; - - (void)pSD; - sdh->DMASA = (uint32_t)_SDH_ucSDHCBuffer; /* set DMA transfer starting address */ - sdh->BLEN = 63UL; /* 512 bit */ - - if ((u32Status = SDH_SDCmdAndRspDataIn(sdh, 6UL, 0x00ffff01UL)) != Successful) - { - return Fail; - } - - u16CurrentComsumption = (uint16_t)(_SDH_ucSDHCBuffer[0] << 8); - u16CurrentComsumption |= (uint16_t)_SDH_ucSDHCBuffer[1]; - if (!u16CurrentComsumption) - { - return Fail; - } - - u16BusyStatus0 = (uint16_t)(_SDH_ucSDHCBuffer[28] << 8); - u16BusyStatus0 |= (uint16_t)_SDH_ucSDHCBuffer[29]; - - if (!u16BusyStatus0) /* function ready */ - { - sdh->DMASA = (uint32_t)_SDH_ucSDHCBuffer; /* set DMA transfer starting address */ - sdh->BLEN = 63UL; /* 512 bit */ - - if ((u32Status = SDH_SDCmdAndRspDataIn(sdh, 6UL, 0x80ffff01UL)) != Successful) - { - return Fail; - } - - /* function change timing: 8 clocks */ - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while (sdh->CTL & SDH_CTL_CLK8OEN_Msk) {} - - u16CurrentComsumption = (uint16_t)(_SDH_ucSDHCBuffer[0] << 8); - u16CurrentComsumption |= (uint16_t)_SDH_ucSDHCBuffer[1]; - if (!u16CurrentComsumption) - { - return Fail; - } - - return Successful; - } - else - { - return Fail; - } -} - - -uint32_t SDH_SelectCardType(SDH_T *sdh) -{ - uint32_t volatile u32Status = 0UL; - uint32_t u32Param; - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 7UL, pSD->RCA, 0UL)) != Successful) - { - return u32Status; - } - - SDH_CheckRB(sdh); - - /* if SD card set 4bit */ - if (pSD->CardType == SDH_TYPE_SD_HIGH) - { - sdh->DMASA = (uint32_t)_SDH_ucSDHCBuffer; /* set DMA transfer starting address */ - sdh->BLEN = 0x07UL; /* 64 bit */ - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 55UL, pSD->RCA, 0UL)) != Successful) - { - return u32Status; - } - - sdh->DMACTL |= 0x2; - while (sdh->DMACTL & 0x2) {} - - if ((u32Status = SDH_SDCmdAndRspDataIn(sdh, 51UL, 0x00UL)) != Successful) - { - return u32Status; - } - - if ((_SDH_ucSDHCBuffer[0] & 0xfUL) == 0xfUL) - { - u32Status = SDH_SwitchToHighSpeed(sdh, pSD); - if (u32Status == Successful) - { - /* divider */ - SDH_Set_clock(sdh, SDHC_FREQ); - } - } - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 55UL, pSD->RCA, 0UL)) != Successful) - { - return u32Status; - } - if ((u32Status = SDH_SDCmdAndRsp(sdh, 6UL, 0x02UL, 0UL)) != Successful) /* set bus width */ - { - return u32Status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if (pSD->CardType == SDH_TYPE_SD_LOW) - { - sdh->DMASA = (uint32_t) _SDH_ucSDHCBuffer; /* set DMA transfer starting address */ - sdh->BLEN = 0x07UL; /* 64 bit */ - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 55UL, pSD->RCA, 0UL)) != Successful) - { - return u32Status; - } - if ((u32Status = SDH_SDCmdAndRspDataIn(sdh, 51UL, 0x00UL)) != Successful) - { - return u32Status; - } - - /* set data bus width. ACMD6 for SD card, SDCR_DBW for host. */ - if ((u32Status = SDH_SDCmdAndRsp(sdh, 55UL, pSD->RCA, 0UL)) != Successful) - { - return u32Status; - } - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 6UL, 0x02UL, 0UL)) != Successful) /* set bus width */ - { - return u32Status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - - if (pSD->CardType == SDH_TYPE_MMC) - { - sdh->CTL &= ~SDH_CTL_DBW_Msk; - } - - /* --- sent CMD6 to MMC card to set bus width to 4 bits mode */ - /* set CMD6 argument Access field to 3, Index to 183, Value to 1 (4-bit mode) */ - u32Param = (3UL << 24) | (183UL << 16) | (1UL << 8); - if ((u32Status = SDH_SDCmdAndRsp(sdh, 6UL, u32Param, 0UL)) != Successful) - { - return u32Status; - } - SDH_CheckRB(sdh); - - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - } - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 16UL, SDH_BLOCK_SIZE, 0UL)) != Successful) /* set block length */ - { - return u32Status; - } - sdh->BLEN = SDH_BLOCK_SIZE - 1UL; /* set the block size */ - - SDH_SDCommand(sdh, 7UL, 0UL); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while (sdh->CTL & SDH_CTL_CLK8OEN_Msk) {} - - sdh->INTEN |= SDH_INTEN_BLKDIEN_Msk; - - return Successful; -} - -void SDH_Get_SD_info(SDH_T *sdh) -{ - uint32_t u32RLen, u32CSize, u32Mult, u32Size; - uint32_t au32Buffer[4]; - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - SDH_SDCmdAndRsp2(sdh, 9UL, pSD->RCA, au32Buffer); - - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - /* for MMC/eMMC card */ - if ((au32Buffer[0] & 0xc0000000UL) == 0xc0000000UL) - { - /* CSD_STRUCTURE [127:126] is 3 */ - /* CSD version depend on EXT_CSD register in eMMC v4.4 for card size > 2GB */ - SDH_SDCmdAndRsp(sdh, 7UL, pSD->RCA, 0UL); - - sdh->DMASA = (uint32_t)_SDH_ucSDHCBuffer; /* set DMA transfer starting address */ - sdh->BLEN = 511UL; /* read 512 bytes for EXT_CSD */ - - if (SDH_SDCmdAndRspDataIn(sdh, 8UL, 0x00UL) != Successful) - { - return; - } - - SDH_SDCommand(sdh, 7UL, 0UL); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while (sdh->CTL & SDH_CTL_CLK8OEN_Msk) {} - - pSD->totalSectorN = (uint32_t)_SDH_ucSDHCBuffer[215] << 24; - pSD->totalSectorN |= (uint32_t)_SDH_ucSDHCBuffer[214] << 16; - pSD->totalSectorN |= (uint32_t)_SDH_ucSDHCBuffer[213] << 8; - pSD->totalSectorN |= (uint32_t)_SDH_ucSDHCBuffer[212]; - pSD->diskSize = pSD->totalSectorN / 2UL; - } - else - { - /* CSD version v1.0/1.1/1.2 in eMMC v4.4 spec for card size <= 2GB */ - u32RLen = (au32Buffer[1] & 0x000f0000UL) >> 16; - u32CSize = ((au32Buffer[1] & 0x000003ffUL) << 2) | ((au32Buffer[2] & 0xc0000000UL) >> 30); - u32Mult = (au32Buffer[2] & 0x00038000UL) >> 15; - u32Size = (u32CSize + 1UL) * (1UL << (u32Mult + 2UL)) * (1UL << u32RLen); - - pSD->diskSize = u32Size / 1024UL; - pSD->totalSectorN = u32Size / 512UL; - } - } - else - { - if (au32Buffer[0] & 0xc0000000UL) - { - u32CSize = ((au32Buffer[1] & 0x0000003fUL) << 16) | ((au32Buffer[2] & 0xffff0000UL) >> 16); - u32Size = (u32CSize + 1UL) * 512UL; /* Kbytes */ - - pSD->diskSize = u32Size; - pSD->totalSectorN = u32Size << 1; - } - else - { - u32RLen = (au32Buffer[1] & 0x000f0000UL) >> 16; - u32CSize = ((au32Buffer[1] & 0x000003ffUL) << 2) | ((au32Buffer[2] & 0xc0000000UL) >> 30); - u32Mult = (au32Buffer[2] & 0x00038000UL) >> 15; - u32Size = (u32CSize + 1UL) * (1UL << (u32Mult + 2UL)) * (1UL << u32RLen); - - pSD->diskSize = u32Size / 1024UL; - pSD->totalSectorN = u32Size / 512UL; - } - } - pSD->sectorSize = (int)512UL; -} - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief This function use to reset SD function and select card detection source and pin. - * - * @param[in] sdh The pointer of the specified SDH module. - * @param[in] u32CardDetSrc Select card detection pin from GPIO or DAT3 pin. ( \ref CardDetect_From_GPIO / \ref CardDetect_From_DAT3) - * - * @return None - */ -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc) -{ - /* enable DMAC */ - sdh->DMACTL = SDH_DMACTL_DMARST_Msk; - while (sdh->DMACTL & SDH_DMACTL_DMARST_Msk) {} - - sdh->DMACTL = SDH_DMACTL_DMAEN_Msk; - - /* Reset FMI */ - sdh->GCTL = SDH_GCTL_GCTLRST_Msk | SDH_GCTL_SDEN_Msk; /* Start reset FMI controller. */ - while (sdh->GCTL & SDH_GCTL_GCTLRST_Msk) {} - - memset(&SD0, 0, sizeof(SDH_INFO_T)); - - /* enable SD */ - sdh->GCTL = SDH_GCTL_SDEN_Msk; - - if (u32CardDetSrc & CardDetect_From_DAT3) - { - sdh->INTEN &= ~SDH_INTEN_CDSRC_Msk; - } - else - { - sdh->INTEN |= SDH_INTEN_CDSRC_Msk; - } - sdh->INTEN |= SDH_INTEN_CDIEN_Msk; - - sdh->CTL |= SDH_CTL_CTLRST_Msk; /* SD software reset */ - while (sdh->CTL & SDH_CTL_CTLRST_Msk) {} - -} - -/** - * @brief This function use to initial SD card. - * - * @param[in] sdh The pointer of the specified SDH module. - * - * @return None - * - * @details This function is used to initial SD card. - * SD initial state needs 400KHz clock output, driver will use HIRC for SD initial clock source. - * And then switch back to the user's setting. - */ -uint32_t SDH_Probe(SDH_T *sdh) -{ - uint32_t u32Val; - - /* Disable FMI/SD host interrupt */ - sdh->GINTEN = 0UL; - - sdh->CTL &= ~SDH_CTL_SDNWR_Msk; - sdh->CTL |= 0x09UL << SDH_CTL_SDNWR_Pos; /* set SDNWR = 9 */ - sdh->CTL &= ~SDH_CTL_BLKCNT_Msk; - sdh->CTL |= 0x01UL << SDH_CTL_BLKCNT_Pos; /* set BLKCNT = 1 */ - sdh->CTL &= ~SDH_CTL_DBW_Msk; /* SD 1-bit data bus */ - - if (!(SDH_CardDetection(sdh))) - { - return SDH_NO_SD_CARD; - } - - if ((u32Val = SDH_Init(sdh)) != 0UL) - { - return u32Val; - } - - /* divider */ - if (SD0.CardType == SDH_TYPE_MMC) - { - SDH_Set_clock(sdh, MMC_FREQ); - } - else - { - SDH_Set_clock(sdh, SD_FREQ); - } - SDH_Get_SD_info(sdh); - - if ((u32Val = SDH_SelectCardType(sdh)) != 0UL) - { - return u32Val; - } - - return 0UL; -} - -/** - * @brief This function use to read data from SD card. - * - * @param[in] sdh The pointer of the specified SDH module. - * @param[out] pu8BufAddr The buffer to receive the data from SD card. - * @param[in] u32StartSec The start read sector address. - * @param[in] u32SecCount The the read sector number of data - * - * @return None - */ -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile u32IsSendCmd = (uint32_t)FALSE; - uint32_t volatile u32Reg; - uint32_t volatile u32Loop, u32Status; - uint32_t u32BlkSize = SDH_BLOCK_SIZE; - - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - /* --- check input parameters */ - if (u32SecCount == 0UL) - { - return SDH_SELECT_ERROR; - } - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 7UL, pSD->RCA, 0UL)) != Successful) - { - return u32Status; - } - SDH_CheckRB(sdh); - - sdh->BLEN = u32BlkSize - 1UL; /* the actual byte count is equal to (SDBLEN+1) */ - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * u32BlkSize; - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - - u32Loop = u32SecCount / 255UL; - while (u32Loop > 0UL) - { - g_u8SDDataReadyFlag = (uint8_t)FALSE; - u32Reg = sdh->CTL & ~SDH_CTL_CMDCODE_Msk; - u32Reg = u32Reg | 0xff0000UL; /* set BLK_CNT to 255 */ - if (u32IsSendCmd == (uint32_t)FALSE) - { - sdh->CTL = u32Reg | (18UL << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - u32IsSendCmd = (uint32_t)TRUE; - } - else - { - sdh->CTL = u32Reg | SDH_CTL_DIEN_Msk; - } - - while (!g_u8SDDataReadyFlag) - { - if (g_u8SDDataReadyFlag) - { - break; - } - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if (!(sdh->INTSTS & SDH_INTSTS_CRC7_Msk)) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if (!(sdh->INTSTS & SDH_INTSTS_CRC16_Msk)) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - u32Loop--; - } - - u32Loop = u32SecCount % 255UL; - if (u32Loop != 0UL) - { - uint32_t u32RegTmp; - g_u8SDDataReadyFlag = (uint8_t)FALSE; - u32Reg = sdh->CTL & (~SDH_CTL_CMDCODE_Msk); - u32Reg = u32Reg & (~SDH_CTL_BLKCNT_Msk); - u32RegTmp = (u32Loop << 16); - u32Reg |= u32RegTmp; /* setup SDCR_BLKCNT */ - - if (u32IsSendCmd == (uint32_t)FALSE) - { - sdh->CTL = u32Reg | (18UL << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - u32IsSendCmd = (uint32_t)TRUE; - } - else - { - sdh->CTL = u32Reg | SDH_CTL_DIEN_Msk; - } - - while (!g_u8SDDataReadyFlag) - { - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if (!(sdh->INTSTS & SDH_INTSTS_CRC7_Msk)) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if (!(sdh->INTSTS & SDH_INTSTS_CRC16_Msk)) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - if (SDH_SDCmdAndRsp(sdh, 12UL, 0UL, 0UL)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7UL, 0UL); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while (sdh->CTL & SDH_CTL_CLK8OEN_Msk) {} - - return Successful; -} - -/** - * @brief This function use to write data to SD card. - * - * @param[in] sdh The pointer of the specified SDH module. - * @param[in] pu8BufAddr The buffer to send the data to SD card. - * @param[in] u32StartSec The start write sector address. - * @param[in] u32SecCount The the write sector number of data. - * - * @return \ref SDH_SELECT_ERROR : u32SecCount is zero. \n - * \ref SDH_NO_SD_CARD : SD card be removed. \n - * \ref SDH_CRC_ERROR : CRC error happen. \n - * \ref SDH_CRC7_ERROR : CRC7 error happen. \n - * \ref Successful : Write data to SD card success. - */ -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile u32IsSendCmd = (uint32_t)FALSE; - uint32_t volatile u32Reg; - uint32_t volatile u32Loop, u32Status; - - SDH_INFO_T *pSD; - - /* M2354 is only support SDH0 */ - pSD = &SD0; - - /* --- check input parameters */ - if (u32SecCount == 0UL) - { - return SDH_SELECT_ERROR; - } - - if ((u32Status = SDH_SDCmdAndRsp(sdh, 7UL, pSD->RCA, 0UL)) != Successful) - { - return u32Status; - } - - SDH_CheckRB(sdh); - - /* According to SD Spec v2.0, the write CMD block size MUST be 512, and the start address MUST be 512*n. */ - sdh->BLEN = SDH_BLOCK_SIZE - 1UL; /* set the block size */ - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * SDH_BLOCK_SIZE; /* set start address for SD CMD */ - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - u32Loop = u32SecCount / 255UL; /* the maximum block count is 0xFF=255 for register SDCR[BLK_CNT] */ - while (u32Loop > 0UL) - { - g_u8SDDataReadyFlag = (uint8_t)FALSE; - u32Reg = sdh->CTL & 0xff00c080UL; - u32Reg = u32Reg | 0xff0000UL; /* set BLK_CNT to 0xFF=255 */ - if (!u32IsSendCmd) - { - sdh->CTL = u32Reg | (25UL << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - u32IsSendCmd = (uint32_t)TRUE; - } - else - { - sdh->CTL = u32Reg | SDH_CTL_DOEN_Msk; - } - - while (!g_u8SDDataReadyFlag) - { - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0UL) /* check CRC */ - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - u32Loop--; - } - - u32Loop = u32SecCount % 255UL; - if (u32Loop != 0UL) - { - uint32_t u32RegTmp; - g_u8SDDataReadyFlag = (uint8_t)FALSE; - u32RegTmp = (u32Loop << 16); - u32Reg = (sdh->CTL & 0xff00c080UL) | u32RegTmp; - if (!u32IsSendCmd) - { - sdh->CTL = u32Reg | (25UL << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - u32IsSendCmd = (uint32_t)TRUE; - } - else - { - sdh->CTL = u32Reg | SDH_CTL_DOEN_Msk; - } - - while (!g_u8SDDataReadyFlag) - { - if (pSD->IsCardInsert == (uint8_t)FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0UL) /* check CRC */ - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - - if (SDH_SDCmdAndRsp(sdh, 12UL, 0UL, 0UL)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7UL, 0UL); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while (sdh->CTL & SDH_CTL_CLK8OEN_Msk) {} - - return Successful; -} - - -/**@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SDH_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_spi.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_spi.c deleted file mode 100644 index d079697b2af..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_spi.c +++ /dev/null @@ -1,1650 +0,0 @@ -/**************************************************************************//** - * @file spi.c - * @version V3.00 - * @brief M2354 series SPI driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ - -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s); - -/** - * @brief This function make SPI module be ready to transfer. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32MasterSlave Decides the SPI module is operating in master mode or in slave mode. (SPI_SLAVE, SPI_MASTER) - * @param[in] u32SPIMode Decides the transfer timing. (SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a SPI transaction. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI peripheral clock. - * @details By default, the SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the SPI clock divider setting will be 0. - * The actual clock rate may be different from the target SPI clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the - * actual SPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency for Secure, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= system clock frequency for Non-Secure, this function does not do anything to avoid the situation that the frequency of - * SPI bus clock cannot be faster than the system clock rate. User should set up carefully. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode for Secure, the SPI peripheral clock rate will equal to APB clock rate. - * @note In slave mode for Non-Secure, the SPI peripheral clock rate will equal to the clock rate set in secure mode. - */ -uint32_t SPI_Open(SPI_T *spi, - uint32_t u32MasterSlave, - uint32_t u32SPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0UL, u32Div, u32HCLKFreq, u32PCLK0Freq, u32PCLK1Freq, u32RetValue = 0UL; - - /* Disable I2S mode */ - spi->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; - - if(u32DataWidth == 32UL) - { - u32DataWidth = 0UL; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - /* Get APB0 clock frequency */ - u32PCLK0Freq = CLK_GetPCLK0Freq(); - /* Get APB1 clock frequency */ - u32PCLK1Freq = CLK_GetPCLK1Freq(); - - if(u32MasterSlave == SPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - if(u32BusClock >= u32HCLKFreq) - { - if(!(__PC() & NS_OFFSET)) - { - /* Select PCLK as the clock source of SPI */ - if((spi == SPI0) || (spi == SPI0_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - } - else if((spi == SPI1) || (spi == SPI1_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - } - else if((spi == SPI2) || (spi == SPI2_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - } - else - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - } - } - } - - /* Check clock source of SPI */ - if((spi == SPI0) || (spi == SPI0_NS)) - { - if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI1) || (spi == SPI1_NS)) - { - if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI2) || (spi == SPI2_NS)) - { - if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if(u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock == 0UL) - { - /* Set DIVIDER to the maximum value 0x1FF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer */ - if(u32Div > 0x1FFUL) - { - u32Div = 0x1FFUL; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1UL)); - } - } - } - else /* For slave mode, force the SPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0UL; - - if(!(__PC() & NS_OFFSET)) - { - /* Select PCLK as the clock source of SPI */ - if((spi == SPI0) || (spi == SPI0_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK1Freq; - } - else if((spi == SPI1) || (spi == SPI1_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK0Freq; - } - else if((spi == SPI2) || (spi == SPI2_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK1Freq; - } - else - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK0Freq; - } - } - else - { - /* Check clock source of SPI */ - if((spi == SPI0) || (spi == SPI0_NS)) - { - if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32RetValue = u32PCLK1Freq; /* Clock source is PCLK1 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI1) || (spi == SPI1_NS)) - { - if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32RetValue = u32PCLK0Freq; /* Clock source is PCLK0 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI2) || (spi == SPI2_NS)) - { - if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - u32RetValue = u32PCLK1Freq; /* Clock source is PCLK1 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - u32RetValue = u32PCLK0Freq; /* Clock source is PCLK0 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - } - } - - return u32RetValue; -} - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details Clear SPIEN bit of SPI_CTL register to disable SPI transfer control. - */ -void SPI_Close(SPI_T *spi) -{ - spi->CTL &= ~SPI_CTL_SPIEN_Msk; -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI RX FIFO buffer. The RXEMPTY (SPI_STATUS[8]) will be set to 1. - */ -void SPI_ClearRxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI TX FIFO buffer. The TXEMPTY (SPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void SPI_ClearTxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void SPI_DisableAutoSS(SPI_T *spi) -{ - spi->SSCTL &= ~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (SPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (SPI_SS_ACTIVE_HIGH, SPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - spi->SSCTL = (spi->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | SPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the SPI bus clock. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target SPI bus clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the actual SPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency for Secure, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= system clock frequency for Non-Secure, this function does not do anything to avoid the situation that the frequency of - * SPI bus clock cannot be faster than the system clock rate. User should set up carefully. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if(u32BusClock >= u32HCLKFreq) - { - if(!(__PC() & NS_OFFSET)) - { - /* Select PCLK as the clock source of SPI */ - if((spi == SPI0) || (spi == SPI0_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - } - else if((spi == SPI1) || (spi == SPI1_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - } - else if((spi == SPI2) || (spi == SPI2_NS)) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - } - else - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - } - } - } - - /* Check clock source of SPI */ - if((spi == SPI0) || (spi == SPI0_NS)) - { - if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI1) || (spi == SPI1_NS)) - { - if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI2) || (spi == SPI2_NS)) - { - if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if(u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0UL; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock == 0UL) - { - /* Set DIVIDER to the maximum value 0x1FF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer */ - if(u32Div > 0x1FFUL) - { - u32Div = 0x1FFUL; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFUL + 1UL)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1UL)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. If data width is 8 ~ 16 bits, it could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. If data width is 8 ~ 16 bits, it could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - spi->FIFOCTL = (spi->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of SPI bus clock. Only available in Master mode. - * @param[in] spi The pointer of the specified SPI module. - * @return Actual SPI bus clock frequency in Hz. - * @details This function will calculate the actual SPI bus clock rate according to the SPIxSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t SPI_GetBusClock(SPI_T *spi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc; - - /* Get DIVIDER setting */ - u32Div = (spi->CLKDIV & SPI_CLKDIV_DIVIDER_Msk) >> SPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of SPI */ - if((spi == SPI0) || (spi == SPI0_NS)) - { - if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI1) || (spi == SPI1_NS)) - { - if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if((spi == SPI2) || (spi == SPI2_NS)) - { - if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - /* Return SPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1UL)); -} - -/** - * @brief Enable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL |= SPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL &= ~SPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get SPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32IntStatus; - uint32_t u32IntFlag = 0UL; - - u32IntStatus = spi->STATUS; - - /* Check unit transfer interrupt flag */ - if((u32Mask & SPI_UNIT_INT_MASK) && (u32IntStatus & SPI_STATUS_UNITIF_Msk)) - { - u32IntFlag |= SPI_UNIT_INT_MASK; - } - - /* Check slave selection signal active interrupt flag */ - if((u32Mask & SPI_SSACT_INT_MASK) && (u32IntStatus & SPI_STATUS_SSACTIF_Msk)) - { - u32IntFlag |= SPI_SSACT_INT_MASK; - } - - /* Check slave selection signal inactive interrupt flag */ - if((u32Mask & SPI_SSINACT_INT_MASK) && (u32IntStatus & SPI_STATUS_SSINAIF_Msk)) - { - u32IntFlag |= SPI_SSINACT_INT_MASK; - } - - /* Check slave TX under run interrupt flag */ - if((u32Mask & SPI_SLVUR_INT_MASK) && (u32IntStatus & SPI_STATUS_SLVURIF_Msk)) - { - u32IntFlag |= SPI_SLVUR_INT_MASK; - } - - /* Check slave bit count error interrupt flag */ - if((u32Mask & SPI_SLVBE_INT_MASK) && (u32IntStatus & SPI_STATUS_SLVBEIF_Msk)) - { - u32IntFlag |= SPI_SLVBE_INT_MASK; - } - - /* Check slave TX underflow interrupt flag */ - if((u32Mask & SPI_TXUF_INT_MASK) && (u32IntStatus & SPI_STATUS_TXUFIF_Msk)) - { - u32IntFlag |= SPI_TXUF_INT_MASK; - } - - /* Check TX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_TXTH_INT_MASK) && (u32IntStatus & SPI_STATUS_TXTHIF_Msk)) - { - u32IntFlag |= SPI_FIFO_TXTH_INT_MASK; - } - - /* Check RX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_RXTH_INT_MASK) && (u32IntStatus & SPI_STATUS_RXTHIF_Msk)) - { - u32IntFlag |= SPI_FIFO_RXTH_INT_MASK; - } - - /* Check RX overrun interrupt flag */ - if((u32Mask & SPI_FIFO_RXOV_INT_MASK) && (u32IntStatus & SPI_STATUS_RXOVIF_Msk)) - { - u32IntFlag |= SPI_FIFO_RXOV_INT_MASK; - } - - /* Check RX time-out interrupt flag */ - if((u32Mask & SPI_FIFO_RXTO_INT_MASK) && (u32IntStatus & SPI_STATUS_RXTOIF_Msk)) - { - u32IntFlag |= SPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear SPI related interrupt flags specified by u32Mask parameter. - */ -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - if(u32Mask & SPI_UNIT_INT_MASK) - { - spi->STATUS = SPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if(u32Mask & SPI_SSACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if(u32Mask & SPI_SSINACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if(u32Mask & SPI_SLVUR_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if(u32Mask & SPI_SLVBE_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if(u32Mask & SPI_TXUF_INT_MASK) - { - spi->STATUS = SPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if(u32Mask & SPI_FIFO_RXOV_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if(u32Mask & SPI_FIFO_RXTO_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get SPI status. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_BUSY_MASK - * - \ref SPI_RX_EMPTY_MASK - * - \ref SPI_RX_FULL_MASK - * - \ref SPI_TX_EMPTY_MASK - * - \ref SPI_TX_FULL_MASK - * - \ref SPI_TXRX_RESET_MASK - * - \ref SPI_SPIEN_STS_MASK - * - \ref SPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32TmpStatus; - uint32_t u32Flag = 0UL; - - u32TmpStatus = spi->STATUS; - - /* Check busy status */ - if((u32Mask & SPI_BUSY_MASK) && (u32TmpStatus & SPI_STATUS_BUSY_Msk)) - { - u32Flag |= SPI_BUSY_MASK; - } - - /* Check RX empty flag */ - if((u32Mask & SPI_RX_EMPTY_MASK) && (u32TmpStatus & SPI_STATUS_RXEMPTY_Msk)) - { - u32Flag |= SPI_RX_EMPTY_MASK; - } - - /* Check RX full flag */ - if((u32Mask & SPI_RX_FULL_MASK) && (u32TmpStatus & SPI_STATUS_RXFULL_Msk)) - { - u32Flag |= SPI_RX_FULL_MASK; - } - - /* Check TX empty flag */ - if((u32Mask & SPI_TX_EMPTY_MASK) && (u32TmpStatus & SPI_STATUS_TXEMPTY_Msk)) - { - u32Flag |= SPI_TX_EMPTY_MASK; - } - - /* Check TX full flag */ - if((u32Mask & SPI_TX_FULL_MASK) && (u32TmpStatus & SPI_STATUS_TXFULL_Msk)) - { - u32Flag |= SPI_TX_FULL_MASK; - } - - /* Check TX/RX reset flag */ - if((u32Mask & SPI_TXRX_RESET_MASK) && (u32TmpStatus & SPI_STATUS_TXRXRST_Msk)) - { - u32Flag |= SPI_TXRX_RESET_MASK; - } - - /* Check SPIEN flag */ - if((u32Mask & SPI_SPIEN_STS_MASK) && (u32TmpStatus & SPI_STATUS_SPIENSTS_Msk)) - { - u32Flag |= SPI_SPIEN_STS_MASK; - } - - /* Check SPIx_SS line status */ - if((u32Mask & SPI_SSLINE_STS_MASK) && (u32TmpStatus & SPI_STATUS_SSLINE_Msk)) - { - u32Flag |= SPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - -/** - * @brief Get SPI status2. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_SLVBENUM_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus2(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32TmpStatus; - uint32_t u32Number = 0UL; - - u32TmpStatus = spi->STATUS2; - - /* Check effective bit number of uncompleted RX data status */ - if(u32Mask & SPI_SLVBENUM_MASK) - { - u32Number = (u32TmpStatus & SPI_STATUS2_SLVBENUM_Msk) >> SPI_STATUS2_SLVBENUM_Pos; - } - - return u32Number; -} - - -/** - * @brief This function is used to get I2S source clock frequency. - * @param[in] i2s The pointer of the specified I2S module. - * @return I2S source clock frequency (Hz). - * @details Return the source clock frequency according to the setting of SPI0SEL (CLK_CLKSEL2[5:4]) or SPI1SEL (CLK_CLKSEL2[7:6]) or SPI2SEL (CLK_CLKSEL2[11:10]) or SPI3SEL (CLK_CLKSEL2[13:12]). - */ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s) -{ - uint32_t u32Freq; - - if((i2s == SPI0) || (i2s == SPI0_NS)) - { - if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32Freq = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - else if((i2s == SPI1) || (i2s == SPI1_NS)) - { - if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32Freq = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - else if((i2s == SPI2) || (i2s == SPI2_NS)) - { - if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - u32Freq = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - u32Freq = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are listed below. - * - \ref SPII2S_MODE_MASTER - * - \ref SPII2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are listed below. - * - \ref SPII2S_DATABIT_8 - * - \ref SPII2S_DATABIT_16 - * - \ref SPII2S_DATABIT_24 - * - \ref SPII2S_DATABIT_32 - * @param[in] u32Channels Audio format. Valid values are listed below. - * - \ref SPII2S_MONO - * - \ref SPII2S_STEREO - * @param[in] u32DataFormat Data format. Valid values are listed below. - * - \ref SPII2S_FORMAT_I2S - * - \ref SPII2S_FORMAT_MSB - * - \ref SPII2S_FORMAT_PCMA - * - \ref SPII2S_FORMAT_PCMB - * @return Real sample rate of master mode or peripheral clock rate of slave mode. - * @details This function will reset SPI/I2S controller and configure I2S controller according to the input parameters. - * Set TX FIFO threshold to 2 and RX FIFO threshold to 1. Both the TX and RX functions will be enabled. - * The actual sample rate may be different from the target sample rate. The real sample rate will be returned for reference. - * @note In slave mode for Secure, the SPI peripheral clock rate will equal to APB clock rate. - * @note In slave mode for Non-Secure, the SPI peripheral clock rate will equal to the clock rate set in secure mode. - */ -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat) -{ - uint32_t u32Divider; - uint32_t u32BitRate, u32SrcClk, u32RetValue; - uint32_t u32PCLK0Freq, u32PCLK1Freq; - - if(!(__PC() & NS_OFFSET)) - { - /* Reset SPI/I2S */ - if((i2s == SPI0) || (i2s == SPI0_NS)) - { - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - else if((i2s == SPI1) || (i2s == SPI1_NS)) - { - SYS->IPRST1 |= SYS_IPRST1_SPI1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI1RST_Msk; - } - else if((i2s == SPI2) || (i2s == SPI2_NS)) - { - SYS->IPRST1 |= SYS_IPRST1_SPI2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI2RST_Msk; - } - else - { - SYS->IPRST2 |= SYS_IPRST2_SPI3RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI3RST_Msk; - } - } - - /* Configure I2S controller */ - i2s->I2SCTL = u32MasterSlave | u32WordWidth | u32Channels | u32DataFormat; - /* Set TX FIFO threshold to 2 and RX FIFO threshold to 1 */ - i2s->FIFOCTL = SPII2S_FIFO_TX_LEVEL_WORD_2 | SPII2S_FIFO_RX_LEVEL_WORD_2; - - if(u32MasterSlave == SPII2S_MODE_MASTER) - { - /* Get the source clock rate */ - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - - /* Calculate the bit clock rate */ - u32BitRate = u32SampleRate * ((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1UL) * 16UL; - u32Divider = (((((u32SrcClk * 10UL) / u32BitRate) >> 1UL) + 5UL) / 10UL) - 1UL; /* Round to the nearest integer */ - /* Set BCLKDIV setting */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_BCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_BCLKDIV_Pos); - /* Enable I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= SPI_I2SCLK_I2SMODE_Msk; - - /* Calculate bit clock rate */ - u32BitRate = u32SrcClk / ((u32Divider + 1UL) * 2UL); - /* Calculate real sample rate */ - u32SampleRate = u32BitRate / (((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1UL) * 16UL); - - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - - /* Return the real sample rate */ - u32RetValue = u32SampleRate; - } - else - { - /* Set BCLKDIV = 0 */ - i2s->I2SCLK &= ~SPI_I2SCLK_BCLKDIV_Msk; - /* Get APB0 clock frequency */ - u32PCLK0Freq = CLK_GetPCLK0Freq(); - /* Get APB1 clock frequency */ - u32PCLK1Freq = CLK_GetPCLK1Freq(); - - if((i2s == SPI0) || (i2s == SPI0_NS)) - { - if(!(__PC() & NS_OFFSET)) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK1Freq; - } - else - { - /* Check clock source of I2S */ - if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI0_MODULE) << CLK_CLKSEL2_SPI0SEL_Pos) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32RetValue = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - } - else if((i2s == SPI1) || (i2s == SPI1_NS)) - { - if(!(__PC() & NS_OFFSET)) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK0Freq; - } - else - { - /* Check clock source of I2S */ - if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI1_MODULE) << CLK_CLKSEL2_SPI1SEL_Pos) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32RetValue = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - } - else if((i2s == SPI2) || (i2s == SPI2_NS)) - { - if(!(__PC() & NS_OFFSET)) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK1Freq; - } - else - { - /* Check clock source of I2S */ - if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI2_MODULE) << CLK_CLKSEL2_SPI2SEL_Pos) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - u32RetValue = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - } - else - { - if(!(__PC() & NS_OFFSET)) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = u32PCLK0Freq; - } - else - { - /* Check clock source of I2S */ - if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32RetValue = __HXT; /* Clock source is HXT */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32RetValue = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK_GetModuleClockSource(SPI3_MODULE) << CLK_CLKSEL2_SPI3SEL_Pos) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - u32RetValue = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32RetValue = __HIRC; /* Clock source is HIRC */ - } - } - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - } - } - - return u32RetValue; -} - -/** - * @brief Disable I2S function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Disable I2S function. - */ -void SPII2S_Close(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; -} - -/** - * @brief Enable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * - \ref SPII2S_SLAVE_ERR_INT_MASK - * @return None - * @details This function enables the interrupt according to the u32Mask parameter. - */ -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Enable TX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Enable TX underflow interrupt flag */ - if((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable right channel zero cross interrupt flag */ - if((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCIEN_Msk; - } - - /* Enable left channel zero cross interrupt flag */ - if((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_LZCIEN_Msk; - } - - /* Enable bit clock loss interrupt flag */ - if((u32Mask & SPII2S_SLAVE_ERR_INT_MASK) == SPII2S_SLAVE_ERR_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_SLVERRIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * - \ref SPII2S_SLAVE_ERR_INT_MASK - * @return None - * @details This function disables the interrupt according to the u32Mask parameter. - */ -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Disable TX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Disable TX underflow interrupt flag */ - if((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable right channel zero cross interrupt flag */ - if((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCIEN_Msk; - } - - /* Disable left channel zero cross interrupt flag */ - if((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCIEN_Msk; - } - - /* Disable bit clock loss interrupt flag */ - if((u32Mask & SPII2S_SLAVE_ERR_INT_MASK) == SPII2S_SLAVE_ERR_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_SLVERRIEN_Msk; - } -} - -/** - * @brief Enable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32BusClock The target MCLK clock rate. - * @return Actual MCLK clock rate - * @details Set the master clock rate according to u32BusClock parameter and enable master clock output. - * The actual master clock rate may be different from the target master clock rate. The real master clock rate will be returned for reference. - */ -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock) -{ - uint32_t u32Divider; - uint32_t u32SrcClk, u32RetValue; - - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - if(u32BusClock == u32SrcClk) - { - u32Divider = 0UL; - } - else - { - u32Divider = (u32SrcClk / u32BusClock) >> 1UL; - /* MCLKDIV is a 7-bit width configuration. The maximum value is 0x7F. */ - if(u32Divider > 0x7FUL) - { - u32Divider = 0x7FUL; - } - } - - /* Write u32Divider to MCLKDIV (SPI_I2SCLK[6:0]) */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_MCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_MCLKDIV_Pos); - - /* Enable MCLK output */ - i2s->I2SCTL |= SPI_I2SCTL_MCLKEN_Msk; - - if(u32Divider == 0UL) - { - u32RetValue = u32SrcClk; /* If MCLKDIV=0, master clock rate is equal to the source clock rate. */ - } - else - { - u32RetValue = ((u32SrcClk >> 1UL) / u32Divider); /* If MCLKDIV>0, master clock rate = source clock rate / (MCLKDIV * 2) */ - } - - return u32RetValue; -} - -/** - * @brief Disable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Clear MCLKEN bit of SPI_I2SCTL register to disable master clock output. - */ -void SPII2S_DisableMCLK(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->FIFOCTL = (i2s->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/**@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SPI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sys.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sys.c deleted file mode 100644 index 8d383ca5f90..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_sys.c +++ /dev/null @@ -1,441 +0,0 @@ -/**************************************************************************//** - * @file sys.c - * @version V3.00 - * @brief M2354 series System Manager (SYS) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - - -/** @addtogroup SYS_EXPORTED_FUNCTIONS SYS Exported Functions - @{ -*/ - -/** - * @brief Clear reset source - * @param[in] u32Src is system reset source. Including : - * - \ref SYS_RSTSTS_CPULKRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_SYSRF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_PORF_Msk - * @return None - * @details This function clear the selected system reset source. - */ -void SYS_ClearResetSrc(uint32_t u32Src) -{ - SYS->RSTSTS = u32Src; -} - -/** - * @brief Get Brown-out detector output status - * @param None - * @retval 0 System voltage is higher than BODVL setting or BODEN is 0. - * @retval 1 System voltage is lower than BODVL setting. - * @details This function get Brown-out detector output status. - */ -uint32_t SYS_GetBODStatus(void) -{ - return ((SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) >> SYS_BODCTL_BODOUT_Pos); -} - -/** - * @brief Get reset status register value - * @param None - * @return Reset source - * @details This function get the system reset status register value. - */ -uint32_t SYS_GetResetSrc(void) -{ - return (SYS->RSTSTS); -} - -/** - * @brief Check if register is locked nor not - * @param None - * @retval 0 Write-protection function is disabled. - * 1 Write-protection function is enabled. - * @details This function check register write-protection bit setting. - */ -uint32_t SYS_IsRegLocked(void) -{ - return SYS->REGLCTL & 1UL ? 0UL : 1UL; -} - -/** - * @brief Get product ID - * @param None - * @return Product ID - * @details This function get product ID. - */ -uint32_t SYS_ReadPDID(void) -{ - return SYS->PDID; -} - -/** - * @brief Reset chip with chip reset - * @param None - * @return None - * @details This function reset chip with chip reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetChip(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk; -} - -/** - * @brief Reset chip with CPU reset - * @param None - * @return None - * @details This function reset CPU with CPU reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetCPU(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CPURST_Msk; -} - -/** - * @brief Reset selected module - * @param[in] u32ModuleIndex is module index. Including : - * - \ref PDMA0_RST - * - \ref PDMA1_RST - * - \ref EBI_RST - * - \ref USBH_RST - * - \ref SDH0_RST - * - \ref CRC_RST - * - \ref CRPT_RST - * - \ref KS_RST - * - \ref GPIO_RST - * - \ref TMR0_RST - * - \ref TMR1_RST - * - \ref TMR2_RST - * - \ref TMR3_RST - * - \ref TMR4_RST - * - \ref TMR5_RST - * - \ref ACMP01_RST - * - \ref I2C0_RST - * - \ref I2C1_RST - * - \ref I2C2_RST - * - \ref QSPI0_RST - * - \ref SPI0_RST - * - \ref SPI1_RST - * - \ref SPI2_RST - * - \ref SPI3_RST - * - \ref UART0_RST - * - \ref UART1_RST - * - \ref UART2_RST - * - \ref UART3_RST - * - \ref UART4_RST - * - \ref UART5_RST - * - \ref CAN0_RST - * - \ref OTG_RST - * - \ref USBD_RST - * - \ref EADC_RST - * - \ref I2S0_RST - * - \ref LCD_RST - * - \ref TRNG_RST - * - \ref SC0_RST - * - \ref SC1_RST - * - \ref SC2_RST - * - \ref USCI0_RST - * - \ref USCI1_RST - * - \ref DAC_RST - * - \ref EPWM0_RST - * - \ref EPWM1_RST - * - \ref BPWM0_RST - * - \ref BPWM1_RST - * - \ref QEI0_RST - * - \ref QEI1_RST - * - \ref ECAP0_RST - * - \ref ECAP1_RST - * @return None - * @details This function reset selected module. - */ -void SYS_ResetModule(uint32_t u32ModuleIndex) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - - /* Generate reset signal to the corresponding module */ - u32TmpVal = (1UL << (u32ModuleIndex & 0x00ffffffUL)); - u32TmpAddr = (uint32_t)&SYS->IPRST0 + ((u32ModuleIndex >> 24UL)); - *(uint32_t *)u32TmpAddr |= u32TmpVal; - - /* Release corresponding module from reset state */ - u32TmpVal = ~(1UL << (u32ModuleIndex & 0x00ffffffUL)); - *(uint32_t *)u32TmpAddr &= u32TmpVal; -} - -/** - * @brief Enable and configure Brown-out detector function - * @param[in] i32Mode is reset or interrupt mode. Including : - * - \ref SYS_BODCTL_BOD_RST_EN - * - \ref SYS_BODCTL_BOD_INTERRUPT_EN - * @param[in] u32BODLevel is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_1_6V - * - \ref SYS_BODCTL_BODVL_1_8V - * - \ref SYS_BODCTL_BODVL_2_0V - * - \ref SYS_BODCTL_BODVL_2_2V - * - \ref SYS_BODCTL_BODVL_2_4V - * - \ref SYS_BODCTL_BODVL_2_6V - * - \ref SYS_BODCTL_BODVL_2_8V - * - \ref SYS_BODCTL_BODVL_3_0V - * @return None - * @details This function configure Brown-out detector reset or interrupt mode, enable Brown-out function and set Brown-out voltage level. - * The register write-protection function should be disabled before using this function. - */ -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel) -{ - /* Enable Brown-out Detector function */ - /* Enable Brown-out interrupt or reset function */ - /* Select Brown-out Detector threshold voltage */ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); - SYS->BODCTL = (SYS->BODCTL & ~(SYS_BODCTL_BODRSTEN_Msk | SYS_BODCTL_BODVL_Msk)) | - ((uint32_t)i32Mode) | (u32BODLevel) | (SYS_BODCTL_BODEN_Msk); -} - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This function disable Brown-out detector function. - * The register write-protection function should be disabled before using this function. - */ -void SYS_DisableBOD(void) -{ - while(SYS->BODCTL & SYS_BODCTL_WRBUSY_Msk); - SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk; -} - - -/** - * @brief Set Power Level - * @param[in] u32PowerLevel is power level setting. Including : - * - \ref SYS_PLCTL_PLSEL_PL0 : Supports system clock up to 96MHz. - * - \ref SYS_PLCTL_PLSEL_PL1 : Supports system clock up to 84MHz. - * - \ref SYS_PLCTL_PLSEL_PL2 : Supports system clock up to 48MHz. - * - \ref SYS_PLCTL_PLSEL_PL3 : Supports system clock up to 4MHz. - * @return None - * @details This function select power level. - * The register write-protection function should be disabled before using this function. - */ -void SYS_SetPowerLevel(uint32_t u32PowerLevel) -{ - /* Set power voltage level */ - while(SYS->PLCTL & SYS_PLCTL_WRBUSY_Msk); - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | (u32PowerLevel); - while(SYS->PLSTS & SYS_PLSTS_PLCBUSY_Msk); -} - - -/** - * @brief Set Main Voltage Regulator Type - * @param[in] u32PowerRegulator is main voltage regulator type. Including : - * - \ref SYS_PLCTL_MVRS_LDO - * - \ref SYS_PLCTL_MVRS_DCDC - * @retval 0 main voltage regulator type setting is not finished - * @retval 1 main voltage regulator type setting is finished - * @details This function set main voltage regulator type. - * The main voltage regulator type setting to DCDC cannot finished if the inductor is not detected. - * The register write-protection function should be disabled before using this function. - */ -uint32_t SYS_SetPowerRegulator(uint32_t u32PowerRegulator) -{ - int32_t i32TimeOutCnt = 400; - uint32_t u32Ret = 1U; - uint32_t u32PowerRegStatus; - - /* Get main voltage regulator type status */ - u32PowerRegStatus = SYS->PLSTS & SYS_PLSTS_CURMVR_Msk; - - /* Set main voltage regulator type */ - if((u32PowerRegulator == SYS_PLCTL_MVRS_DCDC) && (u32PowerRegStatus == SYS_PLSTS_CURMVR_LDO)) - { - - /* Set main voltage regulator type to DCDC if status is LDO */ - while(SYS->PLCTL & SYS_PLCTL_WRBUSY_Msk); - SYS->PLCTL |= SYS_PLCTL_MVRS_Msk; - - /* Wait inductor detection and main voltage regulator type change ready */ - while((SYS->PLSTS & SYS_PLSTS_CURMVR_Msk) != SYS_PLSTS_CURMVR_DCDC) - { - if(i32TimeOutCnt-- <= 0) - { - u32Ret = 0U; /* Main voltage regulator type change time-out */ - break; - } - } - - } - else if(u32PowerRegulator == SYS_PLCTL_MVRS_LDO) - { - - /* Set main voltage regulator type to LDO if status is DCDC */ - while(SYS->PLCTL & SYS_PLCTL_WRBUSY_Msk); - SYS->PLCTL &= (~SYS_PLCTL_MVRS_Msk); - - /* Wait main voltage regulator type change ready */ - while((SYS->PLSTS & SYS_PLSTS_CURMVR_Msk) != SYS_PLSTS_CURMVR_LDO) - { - if(i32TimeOutCnt-- <= 0) - { - u32Ret = 0U; /* Main voltage regulator type change time-out */ - break; - } - } - - } - - /* Clear main voltage regulator type change error flag */ - if(SYS->PLSTS & SYS_PLSTS_MVRCERR_Msk) - { - SYS->PLSTS = SYS_PLSTS_MVRCERR_Msk; - u32Ret = 0U; - } - - return u32Ret; -} - -/** - * @brief Set System SRAM Power Mode - * @param[in] u32SRAMSel is SRAM region selection. Including : - * - \ref SYS_SRAMPC0_SRAM0PM0_Msk : 0x2000_0000 - 0x2000_0FFF - * - \ref SYS_SRAMPC0_SRAM0PM1_Msk : 0x2000_1000 - 0x2000_1FFF - * - \ref SYS_SRAMPC0_SRAM0PM2_Msk : 0x2000_2000 - 0x2000_3FFF - * - \ref SYS_SRAMPC0_SRAM0PM3_Msk : 0x2000_4000 - 0x2000_5FFF - * - \ref SYS_SRAMPC0_SRAM0PM4_Msk : 0x2000_6000 - 0x2000_7FFF - * - \ref SYS_SRAMPC0_SRAM1PM0_Msk : 0x2000_8000 - 0x2000_BFFF - * - \ref SYS_SRAMPC0_SRAM1PM1_Msk : 0x2000_C000 - 0x2000_FFFF - * - \ref SYS_SRAMPC0_SRAM1PM2_Msk : 0x2001_0000 - 0x2001_3FFF - * - \ref SYS_SRAMPC0_SRAM1PM3_Msk : 0x2001_4000 - 0x2001_7FFF - * - \ref SYS_SRAMPC0_SRAM1PM4_Msk : 0x2001_8000 - 0x2001_BFFF - * - \ref SYS_SRAMPC0_SRAM1PM5_Msk : 0x2001_C000 - 0x2001_FFFF - * - \ref SYS_SRAMPC0_SRAM1PM6_Msk : 0x2002_0000 - 0x2002_3FFF - * - \ref SYS_SRAMPC0_SRAM1PM7_Msk : 0x2002_4000 - 0x2002_7FFF - * - \ref SYS_SRAMPC0_SRAM2PM0_Msk : 0x2002_8000 - 0x2002_BFFF - * - \ref SYS_SRAMPC0_SRAM2PM1_Msk : 0x2002_C000 - 0x2002_FFFF - * - \ref SYS_SRAMPC1_SRAM2PM2_Msk : 0x2003_0000 - 0x2003_3FFF - * - \ref SYS_SRAMPC1_SRAM2PM3_Msk : 0x2003_4000 - 0x2003_7FFF - * - \ref SYS_SRAMPC1_SRAM2PM4_Msk : 0x2003_8000 - 0x2003_BFFF - * - \ref SYS_SRAMPC1_SRAM2PM5_Msk : 0x2003_C000 - 0x2003_FFFF - * @param[in] u32PowerMode is SRAM power mode. Including : - * - \ref SYS_SRAMPC0_SRAM_NORMAL - * - \ref SYS_SRAMPC0_SRAM_RETENTION - * - \ref SYS_SRAMPC0_SRAM_POWER_SHUT_DOWN - * - \ref SYS_SRAMPC1_SRAM_NORMAL - * - \ref SYS_SRAMPC1_SRAM_RETENTION - * - \ref SYS_SRAMPC1_SRAM_POWER_SHUT_DOWN - * @return None - * @details This function set system SRAM power mode. - * The register write-protection function should be disabled before using this function. - */ -void SYS_SetSSRAMPowerMode(uint32_t u32SRAMSel, uint32_t u32PowerMode) -{ - uint32_t u32SRAMSelPos = 0UL; - - /* Get system SRAM power mode setting position */ - while(u32SRAMSelPos < 30UL) - { - if(u32SRAMSel & (1 << u32SRAMSelPos)) - { - break; - } - else - { - u32SRAMSelPos++; - } - } - - /* Set system SRAM power mode setting */ - if(u32PowerMode & BIT31) - { - while(SYS->SRAMPC1 & SYS_SRAMPC1_PCBUSY_Msk); - SYS->SRAMPC1 = (SYS->SRAMPC1 & (~u32SRAMSel)) | (u32PowerMode << u32SRAMSelPos); - } - else - { - while(SYS->SRAMPC0 & SYS_SRAMPC0_PCBUSY_Msk); - SYS->SRAMPC0 = (SYS->SRAMPC0 & (~u32SRAMSel)) | (u32PowerMode << u32SRAMSelPos); - - } -} - -/** - * @brief Set Peripheral SRAM Power Mode - * @param[in] u32SRAMSel is SRAM region selection. Including : - * - \ref SYS_SRAMPC1_CAN_Msk - * - \ref SYS_SRAMPC1_USBD_Msk - * - \ref SYS_SRAMPC1_PDMA0_Msk - * - \ref SYS_SRAMPC1_PDMA1_Msk - * - \ref SYS_SRAMPC1_FMCCACHE_Msk - * - \ref SYS_SRAMPC1_RSA_Msk - * - \ref SYS_SRAMPC1_KS_Msk - * @param[in] u32PowerMode is SRAM power mode. Including : - * - \ref SYS_SRAMPC1_SRAM_NORMAL - * - \ref SYS_SRAMPC1_SRAM_RETENTION - * - \ref SYS_SRAMPC1_SRAM_POWER_SHUT_DOWN - * @return None - * @details This function set peripheral SRAM power mode. - * The register write-protection function should be disabled before using this function. - */ -void SYS_SetPSRAMPowerMode(uint32_t u32SRAMSel, uint32_t u32PowerMode) -{ - uint32_t u32SRAMSelPos = 16UL; - - /* Get peripheral SRAM power mode setting position */ - while(u32SRAMSelPos < 30UL) - { - if(u32SRAMSel & (1 << u32SRAMSelPos)) - { - break; - } - else - { - u32SRAMSelPos++; - } - } - - /* Set peripheral SRAM power mode setting */ - while(SYS->SRAMPC1 & SYS_SRAMPC1_PCBUSY_Msk); - SYS->SRAMPC1 = (SYS->SRAMPC1 & (~u32SRAMSel)) | (u32PowerMode << u32SRAMSelPos); -} - -/** - * @brief Set Reference Voltage - * @param[in] u32VRefCTL is reference voltage setting. Including : - * - \ref SYS_VREFCTL_VREF_PIN - * - \ref SYS_VREFCTL_VREF_1_6V - * - \ref SYS_VREFCTL_VREF_2_0V - * - \ref SYS_VREFCTL_VREF_2_5V - * - \ref SYS_VREFCTL_VREF_3_0V - * - \ref SYS_VREFCTL_VREF_AVDD - * @return None - * @details This function select reference voltage. - * The register write-protection function should be disabled before using this function. - */ -void SYS_SetVRef(uint32_t u32VRefCTL) -{ - /* Set reference voltage */ - SYS->VREFCTL = (SYS->VREFCTL & (~SYS_VREFCTL_VREFCTL_Msk)) | (u32VRefCTL); -} - - -/**@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SYS_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_tamper.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_tamper.c deleted file mode 100644 index a704728920f..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_tamper.c +++ /dev/null @@ -1,505 +0,0 @@ -/**************************************************************************//** - * @file tamper.c - * @version V3.00 - * @brief M2354 series TAMPER driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TAMPER_Driver Tamper Driver - @{ -*/ - -/** @addtogroup TAMPER_EXPORTED_FUNCTIONS Tamper Exported Functions - @{ -*/ - -/** - * @brief Enable Tamper Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref TAMPER_INTEN_TAMP0IEN_Msk - * - \ref TAMPER_INTEN_TAMP1IEN_Msk - * - \ref TAMPER_INTEN_TAMP2IEN_Msk - * - \ref TAMPER_INTEN_TAMP3IEN_Msk - * - \ref TAMPER_INTEN_TAMP4IEN_Msk - * - \ref TAMPER_INTEN_TAMP5IEN_Msk - * - \ref TAMPER_INTEN_CLKFIEN_Msk - * - \ref TAMPER_INTEN_CLKSTOPIEN_Msk - * - \ref TAMPER_INTEN_OVPIEN_Msk - * - \ref TAMPER_INTEN_VGPIEN_Msk - * - \ref TAMPER_INTEN_VGNIEN_Msk - * - \ref TAMPER_INTEN_ACTSIEN_Msk - * - \ref TAMPER_INTEN_RTCLVRIEN_Msk - * - \ref TAMPER_INTEN_RTCIOIEN_Msk - * - \ref TAMPER_INTEN_RTCLKIEN_Msk - * - \ref TAMPER_INTEN_BODIEN_Msk - * - * @return None - * - * @details This API is used to enable the specify tamper interrupt function. - */ -void TAMPER_EnableInt(uint32_t u32IntFlagMask) -{ - TAMPER->INTEN |= u32IntFlagMask; -} - -/** - * @brief Disable Tamper Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref TAMPER_INTEN_TAMP0IEN_Msk - * - \ref TAMPER_INTEN_TAMP1IEN_Msk - * - \ref TAMPER_INTEN_TAMP2IEN_Msk - * - \ref TAMPER_INTEN_TAMP3IEN_Msk - * - \ref TAMPER_INTEN_TAMP4IEN_Msk - * - \ref TAMPER_INTEN_TAMP5IEN_Msk - * - \ref TAMPER_INTEN_CLKFIEN_Msk - * - \ref TAMPER_INTEN_CLKSTOPIEN_Msk - * - \ref TAMPER_INTEN_OVPIEN_Msk - * - \ref TAMPER_INTEN_VGPIEN_Msk - * - \ref TAMPER_INTEN_VGNIEN_Msk - * - \ref TAMPER_INTEN_ACTSIEN_Msk - * - \ref TAMPER_INTEN_RTCLVRIEN_Msk - * - \ref TAMPER_INTEN_RTCIOIEN_Msk - * - \ref TAMPER_INTEN_RTCLKIEN_Msk - * - \ref TAMPER_INTEN_BODIEN_Msk - * - * @return None - * - * @details This API is used to disable the specify tamper interrupt function. - */ -void TAMPER_DisableInt(uint32_t u32IntFlagMask) -{ - TAMPER->INTEN &= ~u32IntFlagMask; -} - -/** - * @brief Static Tamper Detect - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref TAMPER_TAMPER0_SELECT - * - \ref TAMPER_TAMPER1_SELECT - * - \ref TAMPER_TAMPER2_SELECT - * - \ref TAMPER_TAMPER3_SELECT - * - \ref TAMPER_TAMPER4_SELECT - * - \ref TAMPER_TAMPER5_SELECT - * - * @param[in] u32DetecLevel Tamper pin detection level select. Possible options are - * - \ref TAMPER_TAMPER_HIGH_LEVEL_DETECT - * - \ref TAMPER_TAMPER_LOW_LEVEL_DETECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref TAMPER_TAMPER_DEBOUNCE_ENABLE - * - \ref TAMPER_TAMPER_DEBOUNCE_DISABLE - * - * @return None - * - * @details This API is used to enable the tamper pin detect function with specify trigger condition. - * User needs to disable dynamic tamper function before use this API. - */ -void TAMPER_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - u32Reg = TAMPER->TIOCTL; - - u32TmpReg = (TAMPER_TIOCTL_TAMP0EN_Msk | (u32DetecLevel << TAMPER_TIOCTL_TAMP0LV_Pos) | - (u32DebounceEn << TAMPER_TIOCTL_TAMP0DBEN_Pos)); - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_TAMPER_PIN_NUM; i++) - { - if(u32TamperSelect & (0x1UL << i)) - { - u32Reg &= ~((TAMPER_TIOCTL_TAMP0EN_Msk | TAMPER_TIOCTL_TAMP0LV_Msk | TAMPER_TIOCTL_TAMP0DBEN_Msk) << (i * 4UL)); - u32Reg |= (u32TmpReg << (i * 4UL)); - } - } - - TAMPER->TIOCTL = u32Reg; -} - -/** - * @brief Static Tamper Disable - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref TAMPER_TAMPER0_SELECT - * - \ref TAMPER_TAMPER1_SELECT - * - \ref TAMPER_TAMPER2_SELECT - * - \ref TAMPER_TAMPER3_SELECT - * - \ref TAMPER_TAMPER4_SELECT - * - \ref TAMPER_TAMPER5_SELECT - * - * @return None - * - * @details This API is used to disable the static tamper pin detect. - */ -void TAMPER_StaticTamperDisable(uint32_t u32TamperSelect) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - u32Reg = TAMPER->TIOCTL; - - u32TmpReg = TAMPER_TIOCTL_TAMP0EN_Msk; - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_TAMPER_PIN_NUM; i++) - { - if(u32TamperSelect & (0x1UL << i)) - { - u32Reg &= ~(u32TmpReg << (i * 4UL)); - } - } - - TAMPER->TIOCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Detect - * - * @param[in] u32PairSel Tamper pin detection enable. Possible options are - * - \ref TAMPER_PAIR0_SELECT - * - \ref TAMPER_PAIR1_SELECT - * - \ref TAMPER_PAIR2_SELECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref TAMPER_TAMPER_DEBOUNCE_ENABLE - * - \ref TAMPER_TAMPER_DEBOUNCE_DISABLE - * - * @param[in] u32Pair1Source Dynamic pair 1 input source select - * 0: Pair 1 source select tamper 2 - * 1: Pair 1 source select tamper 0 - * - * @param[in] u32Pair2Source Dynamic pair 2 input source select - * 0: Pair 2 source select tamper 4 - * 1: Pair 2 source select tamper 0 - * - * @return None - * - * @details This API is used to enable the dynamic tamper. - */ -void TAMPER_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2Debounce, u32Tamper4Debounce; - - u32Reg = TAMPER->TIOCTL; - u32Reg &= ~(TAMPER_TIOCTL_TAMP0EN_Msk | TAMPER_TIOCTL_TAMP1EN_Msk | TAMPER_TIOCTL_TAMP2EN_Msk | - TAMPER_TIOCTL_TAMP3EN_Msk | TAMPER_TIOCTL_TAMP4EN_Msk | TAMPER_TIOCTL_TAMP5EN_Msk); - - u32Tamper2Debounce = u32Reg & TAMPER_TIOCTL_TAMP2DBEN_Msk; - u32Tamper4Debounce = u32Reg & TAMPER_TIOCTL_TAMP4DBEN_Msk; - - u32Reg &= ~(TAMPER_TIOCTL_TAMP0EN_Msk | TAMPER_TIOCTL_TAMP1EN_Msk | TAMPER_TIOCTL_TAMP2EN_Msk | - TAMPER_TIOCTL_TAMP3EN_Msk | TAMPER_TIOCTL_TAMP4EN_Msk | TAMPER_TIOCTL_TAMP5EN_Msk); - u32Reg &= ~(TAMPER_TIOCTL_DYN1ISS_Msk | TAMPER_TIOCTL_DYN2ISS_Msk); - u32Reg |= ((u32Pair1Source & 0x1UL) << TAMPER_TIOCTL_DYN1ISS_Pos) | ((u32Pair2Source & 0x1UL) << TAMPER_TIOCTL_DYN2ISS_Pos); - - if(u32DebounceEn) - { - u32TmpReg = (TAMPER_TIOCTL_TAMP0EN_Msk | TAMPER_TIOCTL_TAMP1EN_Msk | - TAMPER_TIOCTL_TAMP0DBEN_Msk | TAMPER_TIOCTL_TAMP1DBEN_Msk | TAMPER_TIOCTL_DYNPR0EN_Msk); - } - else - { - u32TmpReg = (TAMPER_TIOCTL_TAMP0EN_Msk | TAMPER_TIOCTL_TAMP1EN_Msk | TAMPER_TIOCTL_DYNPR0EN_Msk); - } - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_PAIR_NUM; i++) - { - if(u32PairSel & (0x1UL << i)) - { - u32Reg &= ~((TAMPER_TIOCTL_TAMP0DBEN_Msk | TAMPER_TIOCTL_TAMP1DBEN_Msk) << (i * 8UL)); - u32Reg |= (u32TmpReg << (i * 8UL)); - } - } - - if((u32Pair1Source) && (u32PairSel & (uint32_t)TAMPER_PAIR1_SELECT)) - { - u32Reg &= ~TAMPER_TIOCTL_TAMP2EN_Msk; - u32Reg |= u32Tamper2Debounce; - } - - if((u32Pair2Source) && (u32PairSel & (uint32_t)TAMPER_PAIR2_SELECT)) - { - u32Reg &= ~TAMPER_TIOCTL_TAMP4EN_Msk; - u32Reg |= u32Tamper4Debounce; - } - - TAMPER->TIOCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Disable - * - * @param[in] u32PairSel Tamper pin detection disable. Possible options are - * - \ref TAMPER_PAIR0_SELECT - * - \ref TAMPER_PAIR1_SELECT - * - \ref TAMPER_PAIR2_SELECT - * - * @return None - * - * @details This API is used to disable the dynamic tamper. - */ -void TAMPER_DynamicTamperDisable(uint32_t u32PairSel) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2En = 0UL, u32Tamper4En = 0UL; - - u32Reg = TAMPER->TIOCTL; - - if((u32Reg & (uint32_t)TAMPER_TIOCTL_DYN1ISS_Msk) && (u32PairSel & (uint32_t)TAMPER_PAIR1_SELECT)) - { - u32Tamper2En = u32Reg & TAMPER_TIOCTL_TAMP2EN_Msk; - } - - if((u32Reg & (uint32_t)TAMPER_TIOCTL_DYN2ISS_Msk) && (u32PairSel & (uint32_t)TAMPER_PAIR2_SELECT)) - { - u32Tamper4En = u32Reg & TAMPER_TIOCTL_TAMP4EN_Msk; - } - - u32TmpReg = (TAMPER_TIOCTL_TAMP0EN_Msk | TAMPER_TIOCTL_TAMP1EN_Msk | TAMPER_TIOCTL_DYNPR0EN_Msk); - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_PAIR_NUM; i++) - { - if(u32PairSel & (0x1UL << i)) - { - u32Reg &= ~(u32TmpReg << ((i * 8UL))); - } - } - - u32Reg |= (u32Tamper2En | u32Tamper4En); - - TAMPER->TIOCTL = u32Reg; -} - -/** - * @brief Config Dynamic Tamper - * - * @param[in] u32ChangeRate The dynamic tamper output change rate - * - \ref TAMPER_2POW6_CLK - * - \ref TAMPER_2POW7_CLK - * - \ref TAMPER_2POW8_CLK - * - \ref TAMPER_2POW9_CLK - * - \ref TAMPER_2POW10_CLK - * - \ref TAMPER_2POW11_CLK - * - \ref TAMPER_2POW12_CLK - * - \ref TAMPER_2POW13_CLK - * - * @param[in] u32SeedReload Reload new seed or not - * 0: not reload new seed - * 1: reload new seed - * - * @param[in] u32RefPattern Reference pattern - * - \ref TAMPER_REF_RANDOM_PATTERN - * - \ref TAMPER_REF_SEED - * - * @param[in] u32Seed Seed Value (0x0 ~ 0xFFFFFFFF) - * - * @return None - * - * @details This API is used to config dynamic tamper setting. - */ -void TAMPER_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed) -{ - uint32_t u32Reg; - - u32Reg = TAMPER->TIOCTL; - - u32Reg &= ~(TAMPER_TIOCTL_DYNSRC_Msk | TAMPER_TIOCTL_SEEDRLD_Msk | TAMPER_TIOCTL_DYNRATE_Msk); - - u32Reg |= (u32ChangeRate) | ((u32SeedReload & 0x1UL) << TAMPER_TIOCTL_SEEDRLD_Pos) | - ((u32RefPattern & 0x1UL) << TAMPER_TIOCTL_DYNSRC_Pos); - - TAMPER->SEED = u32Seed; /* Need to set seed value before reloaded seed */ - TAMPER->TIOCTL = u32Reg; -} - -/** - * @brief Active Shield Dynamic Tamper Detect - * - * @param[in] u32PairSel1/2 Active shield 1/2 tamper pin detection enable. Possible options are - * - \ref TAMPER_PAIR0_SELECT - * - \ref TAMPER_PAIR1_SELECT - * - \ref TAMPER_PAIR2_SELECT - * - * @param[in] u32Pair1Source1/2 Active shield 1/2 dynamic pair 1 input source select - * 0: Pair 1 source select tamper 2 - * 1: Pair 1 source select tamper 0 - * - * @return None - * - * @details This API is used to enable the active shield dynamic tamper. - */ -void TAMPER_ActiveShieldDynamicTamperEnable(uint32_t u32PairSel1, uint32_t u32Pair1Source1, uint32_t u32PairSel2, uint32_t u32Pair1Source2) -{ - uint32_t i; - uint32_t u32Reg1, u32Reg2; - uint32_t u32TmpReg1, u32TmpReg2; - - u32Reg1 = TAMPER->ACTSTIOCTL1; - u32Reg1 &= ~(TAMPER_ACTSTIOCTL1_ATAMP0EN_Msk | TAMPER_ACTSTIOCTL1_ATAMP1EN_Msk | TAMPER_ACTSTIOCTL1_ATAMP2EN_Msk | - TAMPER_ACTSTIOCTL1_ATAMP3EN_Msk | TAMPER_ACTSTIOCTL1_ATAMP4EN_Msk | TAMPER_ACTSTIOCTL1_ATAMP5EN_Msk); - u32Reg2 = TAMPER->ACTSTIOCTL2; - u32Reg2 &= ~(TAMPER_ACTSTIOCTL2_ATAMP0EN2_Msk | TAMPER_ACTSTIOCTL2_ATAMP1EN2_Msk | TAMPER_ACTSTIOCTL2_ATAMP2EN2_Msk | - TAMPER_ACTSTIOCTL2_ATAMP3EN2_Msk | TAMPER_ACTSTIOCTL2_ATAMP4EN2_Msk | TAMPER_ACTSTIOCTL2_ATAMP5EN2_Msk); - - u32Reg1 &= ~(TAMPER_ACTSTIOCTL1_ADYN1ISS_Msk); - u32Reg1 |= ((u32Pair1Source1 & 0x1UL) << TAMPER_ACTSTIOCTL1_ADYN1ISS_Pos); - u32Reg2 &= ~(TAMPER_ACTSTIOCTL2_ADYN1ISS2_Msk); - u32Reg2 |= ((u32Pair1Source2 & 0x1UL) << TAMPER_ACTSTIOCTL2_ADYN1ISS2_Pos); - - u32TmpReg1 = (TAMPER_ACTSTIOCTL1_ATAMP0EN_Msk | TAMPER_ACTSTIOCTL1_ATAMP1EN_Msk | TAMPER_ACTSTIOCTL1_ADYNPR0EN_Msk); - u32TmpReg2 = (TAMPER_ACTSTIOCTL2_ATAMP0EN2_Msk | TAMPER_ACTSTIOCTL2_ATAMP1EN2_Msk | TAMPER_ACTSTIOCTL2_ADYNPR0EN2_Msk); - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_PAIR_NUM; i++) - { - if(u32PairSel1 & (0x1UL << i)) - { - u32Reg1 |= (u32TmpReg1 << (i * 8UL)); - } - - if(u32PairSel2 & (0x1UL << i)) - { - u32Reg2 |= (u32TmpReg2 << (i * 8UL)); - } - } - - if((u32Pair1Source1) && (u32PairSel1 & (uint32_t)TAMPER_PAIR1_SELECT)) - { - u32Reg1 &= ~TAMPER_ACTSTIOCTL1_ATAMP2EN_Msk; - } - - if((u32Pair1Source2) && (u32PairSel2 & (uint32_t)TAMPER_PAIR1_SELECT)) - { - u32Reg2 &= ~TAMPER_ACTSTIOCTL2_ATAMP2EN2_Msk; - } - - TAMPER->ACTSTIOCTL1 = u32Reg1; - TAMPER->ACTSTIOCTL2 = u32Reg2; -} - -/** - * @brief Active Shield Dynamic Tamper Disable - * - * @param[in] u32PairSel1/2 Active shield 1/2 tamper pin detection disable. Possible options are - * - \ref TAMPER_PAIR0_SELECT - * - \ref TAMPER_PAIR1_SELECT - * - \ref TAMPER_PAIR2_SELECT - * - * @return None - * - * @details This API is used to disable the active shield dynamic tamper. - */ -void TAMPER_ActiveShieldDynamicTamperDisable(uint32_t u32PairSel1, uint32_t u32PairSel2) -{ - uint32_t i; - uint32_t u32Reg1, u32Reg2; - uint32_t u32TmpReg1, u32TmpReg2; - uint32_t u32Tamper2En1 = 0UL, u32Tamper2En2 = 0UL; - - u32Reg1 = TAMPER->ACTSTIOCTL1; - u32Reg2 = TAMPER->ACTSTIOCTL2; - - if((u32Reg1 & (uint32_t)TAMPER_ACTSTIOCTL1_ADYN1ISS_Msk) && (u32PairSel1 & (uint32_t)TAMPER_PAIR1_SELECT)) - { - u32Tamper2En1 = u32Reg1 & TAMPER_ACTSTIOCTL1_ATAMP2EN_Msk; - } - - if((u32Reg2 & (uint32_t)TAMPER_ACTSTIOCTL2_ADYN1ISS2_Msk) && (u32PairSel2 & (uint32_t)TAMPER_PAIR1_SELECT)) - { - u32Tamper2En2 = u32Reg2 & TAMPER_ACTSTIOCTL2_ATAMP2EN2_Msk; - } - - u32TmpReg1 = (TAMPER_ACTSTIOCTL1_ATAMP0EN_Msk | TAMPER_ACTSTIOCTL1_ATAMP1EN_Msk | TAMPER_ACTSTIOCTL1_ADYNPR0EN_Msk); - u32TmpReg2 = (TAMPER_ACTSTIOCTL2_ATAMP0EN2_Msk | TAMPER_ACTSTIOCTL2_ATAMP1EN2_Msk | TAMPER_ACTSTIOCTL2_ADYNPR0EN2_Msk); - - for(i = 0UL; i < (uint32_t)TAMPER_MAX_PAIR_NUM; i++) - { - if(u32PairSel1 & (0x1UL << i)) - { - u32Reg1 &= ~(u32TmpReg1 << ((i * 8UL))); - } - - if(u32PairSel2 & (0x1UL << i)) - { - u32Reg2 &= ~(u32TmpReg2 << ((i * 8UL))); - } - } - - u32Reg1 |= u32Tamper2En1; - u32Reg2 |= u32Tamper2En2; - - TAMPER->ACTSTIOCTL1 = u32Reg1; - TAMPER->ACTSTIOCTL2 = u32Reg2; -} - -/** - * @brief Config Active Shield Dynamic Tamper - * - * @param[in] u32ChangeRate1/2 The dynamic tamper output change rate - * - \ref TAMPER_ACTS_2POW10_CLK - * - \ref TAMPER_ACTS_2POW11_CLK - * - \ref TAMPER_ACTS_2POW12_CLK - * - \ref TAMPER_ACTS_2POW13_CLK - * - \ref TAMPER_ACTS_2POW14_CLK - * - \ref TAMPER_ACTS_2POW15_CLK - * - \ref TAMPER_ACTS_2POW16_CLK - * - \ref TAMPER_ACTS_2POW17_CLK - * - * @param[in] u32SeedReload1/2 Reload new seed or not - * 0: not reload new seed - * 1: reload new seed - * - * @param[in] u32RefPattern1/2 Reference pattern - * - \ref TAMPER_REF_RANDOM_PATTERN - * - \ref TAMPER_REF_SEED - * - * @param[in] u32Seed/2 Seed Value (0x0 ~ 0xFFFFFFFF) - * - * @return None - * - * @details This API is used to config active shield dynamic tamper setting. - */ -void TAMPER_ActiveShieldDynamicTamperConfig(uint32_t u32ChangeRate1, uint32_t u32SeedReload1, uint32_t u32RefPattern1, uint32_t u32Seed, - uint32_t u32ChangeRate2, uint32_t u32SeedReload2, uint32_t u32RefPattern2, uint32_t u32Seed2) -{ - uint32_t u32Reg1, u32Reg2; - - u32Reg1 = TAMPER->ACTSTIOCTL1; - u32Reg2 = TAMPER->ACTSTIOCTL2; - - u32Reg1 &= ~(TAMPER_ACTSTIOCTL1_ADYNSRC_Msk | TAMPER_ACTSTIOCTL1_ADYNRATE_Msk); - u32Reg2 &= ~(TAMPER_ACTSTIOCTL2_ADYNSRC2_Msk | TAMPER_ACTSTIOCTL2_SEEDRLD2_Msk | TAMPER_ACTSTIOCTL2_ADYNRATE2_Msk); - - u32Reg1 |= (u32ChangeRate1) | ((u32RefPattern1 & 0x1UL) << TAMPER_ACTSTIOCTL1_ADYNSRC_Pos); - u32Reg2 |= (u32ChangeRate2) | ((u32SeedReload2 & 0x1UL) << TAMPER_ACTSTIOCTL2_SEEDRLD2_Pos) | - ((u32RefPattern2 & 0x1UL) << TAMPER_ACTSTIOCTL2_ADYNSRC2_Pos); - - TAMPER->SEED = u32Seed; /* Need to set seed value before reloaded seed */ - TAMPER->SEED2 = u32Seed2; /* Need to set seed value before reloaded seed */ - - TAMPER->ACTSTIOCTL1 = u32Reg1; - TAMPER->TIOCTL |= ((u32SeedReload1 & 0x1UL) << TAMPER_TIOCTL_SEEDRLD_Pos); - TAMPER->ACTSTIOCTL2 = u32Reg2; -} - -/**@}*/ /* end of group TAMPER_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group TAMPER_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer.c deleted file mode 100644 index ba35aff78a3..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer.c +++ /dev/null @@ -1,409 +0,0 @@ -/**************************************************************************//** - * @file timer.c - * @version V3.00 - * @brief Timer Controller(Timer) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Open Timer with Operate Mode and Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Mode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * @param[in] u32Freq Target working frequency - * - * @return Real timer working frequency - * - * @details This API is used to configure timer to operate in specified mode and frequency. - * If timer cannot work in target frequency, a closest frequency will be chose and returned. - * @note After calling this API, Timer is \b NOT running yet. But could start timer running be calling - * \ref TIMER_Start macro or program registers directly. - */ -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq) -{ - uint32_t u32ClkFreq = TIMER_GetModuleClock(timer); - uint32_t u32Cmpr = 0UL, u32Prescale = 0UL; - - /* Fastest possible timer working freq is (u32Clk / 2). While cmpr = 2, prescaler = 0. */ - if(u32Freq > (u32ClkFreq / 2UL)) - { - u32Cmpr = 2UL; - } - else - { - u32Cmpr = u32ClkFreq / u32Freq; - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if(u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CTL = u32Mode | u32Prescale; - timer->CMP = u32Cmpr; - - return (u32ClkFreq / (u32Cmpr * (u32Prescale + 1UL))); -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This API stops timer counting and disable all timer interrupt function. - */ -void TIMER_Close(TIMER_T *timer) -{ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; -} - -/** - * @brief Create a specify Delay Time - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Usec Delay period in micro seconds. Valid values are between 100~1000000 (100 micro second ~ 1 second). - * - * @return None - * - * @details This API is used to create a delay loop for u32usec micro seconds by using timer one-shot mode. - * @note This API overwrites the register setting of the timer used to count the delay time. - * @note This API use polling mode. So there is no need to enable interrupt for the timer module used to generate delay. - */ -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec) -{ - uint32_t u32ClkFreq = TIMER_GetModuleClock(timer); - uint32_t u32Prescale = 0UL, u32Delay = (SystemCoreClock / u32ClkFreq) + 1UL; - uint32_t u32Cmpr, u32NsecPerTick; - - /* Clear current timer configuration */ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; - - if(u32ClkFreq <= 1000000UL) /* min delay is 1000 us if timer clock source is <= 1 MHz */ - { - if(u32Usec < 1000UL) - { - u32Usec = 1000UL; - } - if(u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - else - { - if(u32Usec < 100UL) - { - u32Usec = 100UL; - } - if(u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - - if(u32ClkFreq <= 1000000UL) - { - u32Prescale = 0UL; - u32NsecPerTick = 1000000000UL / u32ClkFreq; - u32Cmpr = (u32Usec * 1000UL) / u32NsecPerTick; - } - else - { - u32Cmpr = u32Usec * (u32ClkFreq / 1000000UL); - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if(u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CMP = u32Cmpr; - timer->CTL = TIMER_CTL_CNTEN_Msk | TIMER_ONESHOT_MODE | u32Prescale; - - /* - When system clock is faster than timer clock, it is possible timer active bit cannot set in time while we check it. - And the while loop below return immediately, so put a tiny delay here allowing timer start counting and raise active flag. - */ - for(; u32Delay > 0UL; u32Delay--) - { - __NOP(); - } - - while((timer->CTL & TIMER_CTL_ACTSTS_Msk) == TIMER_CTL_ACTSTS_Msk) {} -} - -/** - * @brief Enable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32CapMode Timer capture mode. Could be - * - \ref TIMER_CAPTURE_FREE_COUNTING_MODE - * - \ref TIMER_CAPTURE_COUNTER_RESET_MODE - * @param[in] u32Edge Timer capture trigger edge. Possible values are - * - \ref TIMER_CAPTURE_EVENT_FALLING - * - \ref TIMER_CAPTURE_EVENT_RISING - * - \ref TIMER_CAPTURE_EVENT_FALLING_RISING - * - \ref TIMER_CAPTURE_EVENT_RISING_FALLING - * - \ref TIMER_CAPTURE_EVENT_GET_LOW_PERIOD - * - \ref TIMER_CAPTURE_EVENT_GET_HIGH_PERIOD - * - * @return None - * - * @details This API is used to enable timer capture function with specify capture trigger edge \n - * to get current counter value or reset counter value to 0. - * @note Timer frequency should be configured separately by using \ref TIMER_Open API, or program registers directly. - */ -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~(TIMER_EXTCTL_CAPFUNCS_Msk | TIMER_EXTCTL_CAPEDGE_Msk)) | - u32CapMode | u32Edge | TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Disable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This API is used to disable the timer capture function. - */ -void TIMER_DisableCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Edge Detection edge of counter pin. Could be ether - * - \ref TIMER_COUNTER_EVENT_FALLING, or - * - \ref TIMER_COUNTER_EVENT_RISING - * - * @return None - * - * @details This function is used to enable the timer counter function with specify detection edge. - * @note Timer compare value should be configured separately by using \ref TIMER_SET_CMP_VALUE macro or program registers directly. - * @note While using event counter function, \ref TIMER_TOGGLE_MODE cannot set as timer operation mode. - */ -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~TIMER_EXTCTL_CNTPHASE_Msk) | u32Edge; - timer->CTL |= TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Disable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This API is used to disable the timer event counter function. - */ -void TIMER_DisableEventCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Get Timer Clock Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return Timer clock frequency - * - * @details This API is used to get the timer clock frequency. - * @note This API cannot return correct clock rate if timer source is from external clock input. - */ -uint32_t TIMER_GetModuleClock(TIMER_T *timer) -{ - uint32_t u32Src, u32ClkFreq = __HIRC; - const uint32_t au32Clk[] = {__HXT, __LXT, 0UL, 0UL, __MIRC, __LIRC, 0UL, __HIRC}; - - if(timer == TIMER0) - { - u32Src = CLK_GetModuleClockSource(TMR0_MODULE); - } - else if(timer == TIMER1) - { - u32Src = CLK_GetModuleClockSource(TMR1_MODULE); - } - else if((timer == TIMER2) || (timer == TIMER2_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR2_MODULE); - } - else if((timer == TIMER3) || (timer == TIMER3_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR3_MODULE); - } - else if((timer == TIMER4) || (timer == TIMER4_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR4_MODULE); - } - else if((timer == TIMER5) || (timer == TIMER5_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR5_MODULE); - } - else - { - return 0UL; - } - - if(u32Src == 2UL) - { - if((timer == TIMER0) || (timer == TIMER1) || - (timer == TIMER4) || (timer == TIMER4_NS) || (timer == TIMER5) || (timer == TIMER5_NS)) - { - u32ClkFreq = CLK_GetPCLK0Freq(); - } - else - { - u32ClkFreq = CLK_GetPCLK1Freq(); - } - } - else - { - u32ClkFreq = au32Clk[u32Src]; - } - - return u32ClkFreq; -} - -/** - * @brief Enable Timer Frequency Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER2, TIMER4. - * @param[in] u32DropCount This parameter has no effect in this BSP - * @param[in] u32Timeout This parameter has no effect in this BSP - * @param[in] u32EnableInt Enable interrupt assertion after capture complete or not. Valid values are TRUE and FALSE - * - * @return None - * - * @details This function is used to calculate input event frequency. After enable - * this function, a pair of timers, TIMER0 and TIMER1, TIMER2 and TIMER3, or TIMER4 and TIMER5 - * will be configured for this function. The mode used to calculate input - * event frequency is mentioned as "Inter Timer Trigger Mode" in Technical - * Reference Manual. - */ -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt) -{ - TIMER_T *t; /* store the timer base to configure compare value */ - - (void)u32DropCount; - (void)u32Timeout; - - if(timer == TIMER0) - { - t = TIMER1; - } - else if(timer == TIMER2) - { - t = TIMER3; - } - else if(timer == TIMER2_NS) - { - t = TIMER3_NS; - } - else if(timer == TIMER4) - { - t = TIMER5; - } - else if(timer == TIMER4_NS) - { - t = TIMER5_NS; - } - else - { - t = 0; - } - - if(t != 0) - { - t->CMP = 0xFFFFFFUL; - t->EXTCTL = u32EnableInt ? TIMER_EXTCTL_CAPIEN_Msk : 0UL; - timer->CTL = TIMER_CTL_INTRGEN_Msk | TIMER_CTL_CNTEN_Msk; - } -} - -/** - * @brief Disable Timer Frequency Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @brief This function is used to disable the Timer frequency counter function. - */ -void TIMER_DisableFreqCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTRGEN_Msk; -} - -/** - * @brief Select Interrupt Source to Trigger others Module - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Src Selects the interrupt source to trigger other modules. Could be: - * - \ref TIMER_TRGSRC_TIMEOUT_EVENT - * - \ref TIMER_TRGSRC_CAPTURE_EVENT - * - * @return None - * - * @brief This function is used to select the interrupt source used to trigger other modules. - */ -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src) -{ - timer->TRGCTL = (timer->TRGCTL & ~TIMER_TRGCTL_TRGSSEL_Msk) | u32Src; -} - -/** - * @brief Set Modules Trigger by Timer Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Mask The mask of modules (EPWM, EADC, DAC and PDMA) trigger by timer. It could the combination of - * - \ref TIMER_TRG_TO_PWM, - * - \ref TIMER_TRG_TO_EADC, - * - \ref TIMER_TRG_TO_DAC and - * - \ref TIMER_TRG_TO_PDMA - * - * @return None - * - * @details This function is used to set EPWM, EADC, DAC and PDMA module triggered by timer interrupt event. - * @note The \ref TIMER_TRG_TO_PWM and \ref TIMER_TRG_TO_DAC are only available on TIMER0 ~ TIMER3. - */ -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask) -{ - timer->TRGCTL = (timer->TRGCTL & ~(TIMER_TRGCTL_TRGPWM_Msk | TIMER_TRGCTL_TRGDAC_Msk | TIMER_TRGCTL_TRGEADC_Msk | TIMER_TRGCTL_TRGPDMA_Msk)) | u32Mask; -} - -/**@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group TIMER_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer_pwm.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer_pwm.c deleted file mode 100644 index c5b0ac475be..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_timer_pwm.c +++ /dev/null @@ -1,577 +0,0 @@ -/**************************************************************************//** - * @file timer.c - * @version V3.00 - * @brief Timer PWM Controller(Timer PWM) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_FUNCTIONS TIMER PWM Exported Functions - @{ -*/ - -/** - * @brief Set PWM Counter Clock Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CntClkSrc PWM counter clock source, could be one of following source - * - \ref TPWM_CNTR_CLKSRC_TMR_CLK - * - \ref TPWM_CNTR_CLKSRC_TIMER0_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER1_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER2_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER3_INT - * - * @return None - * - * @details This function is used to set PWM counter clock source. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_SetCounterClockSource(TIMER_T *timer, uint32_t u32CntClkSrc) -{ - (timer)->PWMCLKSRC = ((timer)->PWMCLKSRC & ~TIMER_PWMCLKSRC_CLKSRC_Msk) | u32CntClkSrc; -} - -/** @cond HIDDEN_SYMBOLS */ -/** - * @brief Get Timer PWM Clock Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return Timer clock frequency - * - * @details This API is used to get the timer pwm clock frequency. - * @note This API cannot return correct clock rate if timer source is from external clock input. - */ -static uint32_t TPWM_GetModuleClockFreq(TIMER_T *timer) -{ - uint32_t u32Src, u32ClkFreq = __HIRC; - const uint32_t au32Clk[] = {__HXT, __LXT, 0UL, 0UL, __MIRC, __LIRC, 0UL, __HIRC}; - - if(timer == TIMER0) - { - u32Src = CLK_GetModuleClockSource(TMR0_MODULE); - } - else if(timer == TIMER1) - { - u32Src = CLK_GetModuleClockSource(TMR1_MODULE); - } - else if((timer == TIMER2) || (timer == TIMER2_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR2_MODULE); - } - else if((timer == TIMER3) || (timer == TIMER3_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR3_MODULE); - } - else if((timer == TIMER4) || (timer == TIMER4_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR4_MODULE); - } - else if((timer == TIMER5) || (timer == TIMER5_NS)) - { - u32Src = CLK_GetModuleClockSource(TMR5_MODULE); - } - else - { - return 0UL; - } - - if(u32Src == 2UL) - { - if((timer == TIMER0) || (timer == TIMER1) || - (timer == TIMER4) || (timer == TIMER4_NS) || (timer == TIMER5) || (timer == TIMER5_NS)) - { - u32ClkFreq = CLK_GetPCLK0Freq(); - } - else - { - u32ClkFreq = CLK_GetPCLK1Freq(); - } - } - else - { - u32ClkFreq = au32Clk[u32Src]; - } - - return u32ClkFreq; -} -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Configure PWM Output Frequency and Duty Cycle - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Frequency Target generator frequency. - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0~100. 10 means 10%, 20 means 20%... - * - * @return Nearest frequency clock in nano second - * - * @details This API is used to configure PWM output frequency and duty cycle in up count type and auto-reload operation mode. - * @note This API is only available if Timer PWM counter clock source is from TMRx_CLK. - */ -uint32_t TPWM_ConfigOutputFreqAndDuty(TIMER_T *timer, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32PWMClockFreq, u32TargetFreq; - uint32_t u32Prescaler = 0x1000UL, u32Period = 1UL, u32CMP, u32MaxCLKPSC = 0x1000UL; - - if((timer == TIMER0) || (timer == TIMER1)) - { - u32PWMClockFreq = CLK_GetPCLK0Freq(); - } - else if((timer == TIMER4) || (timer == TIMER4_NS) || (timer == TIMER5) || (timer == TIMER5_NS)) - { - u32PWMClockFreq = TPWM_GetModuleClockFreq(timer); - } - else - { - u32PWMClockFreq = CLK_GetPCLK1Freq(); - } - - if((timer == TIMER4) || (timer == TIMER4_NS) || (timer == TIMER5) || (timer == TIMER5_NS)) - u32MaxCLKPSC = 0x100UL; // 8-bit clock prescale on TIMER4 and TIMER5 PWM - else - u32MaxCLKPSC = 0x1000UL; // 12-bit clock prescale on TIMER0 ~ TIMER3 PWM - - /* Calculate u16PERIOD and u16PSC */ - for(u32Prescaler = 1UL; u32Prescaler <= u32MaxCLKPSC; u32Prescaler++) - { - u32Period = (u32PWMClockFreq / u32Prescaler) / u32Frequency; - - /* If target u32Period is larger than 0x10000, need to use a larger prescaler */ - if(u32Period <= 0x10000UL) - { - break; - } - } - /* Store return value here 'cos we're gonna change u32Prescaler & u32Period to the real value to fill into register */ - u32TargetFreq = (u32PWMClockFreq / u32Prescaler) / u32Period; - - /* Set PWM to up count type */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (TPWM_UP_COUNT << TIMER_PWMCTL_CNTTYPE_Pos); - - /* Set PWM to auto-reload mode */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTMODE_Msk) | (TPWM_AUTO_RELOAD_MODE << TIMER_PWMCTL_CNTMODE_Pos); - - /* Convert to real register value */ - TPWM_SET_PERIOD(timer, (u32Period - 1UL)); - if(u32DutyCycle) - { - u32CMP = (u32DutyCycle * u32Period) / 100UL; - } - else - { - u32CMP = 0UL; - } - - TPWM_SET_CMPDAT(timer, u32CMP); - - TPWM_SET_PRESCALER(timer, (u32Prescaler - 1UL)); - - return (u32TargetFreq); -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the same as Timer PWM clock source. - * @note The register write-protection function should be disabled before using this function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_EnableDeadTime(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the Timer PWM clock source with prescale. - * @note The register write-protection function should be disabled before using this function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_EnableDeadTimeWithPrescale(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTCKSEL_Msk | TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Disable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable Dead-time of selected channel. - * @note The register write-protection function should be disabled before using this function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_DisableDeadTime(TIMER_T *timer) -{ - timer->PWMDTCTL = 0x0UL; -} - -/** - * @brief Enable PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to enable PWM generator and start counter counting. - */ -void TPWM_EnableCounter(TIMER_T *timer) -{ - timer->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Disable PWM Generator - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to disable PWM counter immediately by clear CNTEN (TIMERx_PWMCTL[0]) bit. - */ -void TPWM_DisableCounter(TIMER_T *timer) -{ - timer->PWMCTL &= ~TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Enable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * @param[in] u32Condition The condition to trigger ADC. It could be one of following conditions: - * - \ref TPWM_TRIGGER_EVENT_AT_ZERO_POINT - * - \ref TPWM_TRIGGER_EVENT_AT_PERIOD_POINT - * - \ref TPWM_TRIGGER_EVENT_AT_ZERO_OR_PERIOD_POINT - * - \ref TPWM_TRIGGER_EVENT_AT_COMPARE_UP_POINT - * - \ref TPWM_TRIGGER_EVENT_AT_COMPARE_DOWN_POINT - * - \ref TPWM_TRIGGER_EVENT_AT_PERIOD_OR_COMPARE_UP_POINT - * - * @return None - * - * @details This function is used to enable specified counter compare event to trigger ADC. - * @note TIMER4 and TIMER5 only supports \ref TPWM_TRIGGER_EVENT_AT_PERIOD_POINT, \ref TPWM_TRIGGER_EVENT_AT_COMPARE_UP_POINT, - * and \ref TPWM_TRIGGER_EVENT_AT_PERIOD_OR_COMPARE_UP_POINT. - */ -void TPWM_EnableTriggerADC(TIMER_T *timer, uint32_t u32Condition) -{ - timer->PWMTRGCTL = ((timer->PWMTRGCTL & ~TIMER_PWMTRGCTL_TRGSEL_Msk) | (u32Condition)) | TIMER_PWMTRGCTL_TRGEADC_Msk; -} - -/** - * @brief Disable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0 ~ TIMER5. - * - * @return None - * - * @details This function is used to disable counter compare event to trigger ADC. - */ -void TPWM_DisableTriggerADC(TIMER_T *timer) -{ - timer->PWMTRGCTL &= ~TIMER_PWMTRGCTL_TRGEADC_Msk; -} - -/** - * @brief Enable Trigger PDMA - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 or TIMER5. - * @param[in] u32Condition The condition to trigger PDMA. It could be one of following conditions: - * - \ref TPWM_TRIGGER_EVENT_AT_PERIOD_POINT - * - \ref TPWM_TRIGGER_EVENT_AT_COMPARE_UP_POINT - * - \ref TPWM_TRIGGER_EVENT_AT_PERIOD_OR_COMPARE_UP_POINT - * - * @return None - * - * @details This function is used to enable specified counter compare event to trigger PDMA. - * @note Only available on TIMER4 and TIMER5. - */ -void TPWM_EnableTriggerPDMA(TIMER_T *timer, uint32_t u32Condition) -{ - timer->PWMTRGCTL = ((timer->PWMTRGCTL & ~TIMER_PWMTRGCTL_TRGSEL_Msk) | (u32Condition)) | TIMER_PWMTRGCTL_TRGPDMA_Msk; -} - -/** - * @brief Disable Trigger PDMA - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER4 or TIMER5. - * - * @return None - * - * @details This function is used to disable counter compare event to trigger ADC. - * @note Only available on TIMER4 and TIMER5. - */ -void TPWM_DisableTriggerPDMA(TIMER_T *timer) -{ - timer->PWMTRGCTL &= ~TIMER_PWMTRGCTL_TRGPDMA_Msk; -} - -/** - * @brief Enable Fault Brake Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CH0Level PWMx_CH0 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32CH1Level PWMx_CH1 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32BrakeSource Fault brake source, combination of following source - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_EDGE_BKPIN - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_RAM - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_BKPIN - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM - * - * @return None - * - * @details This function is used to enable fault brake function. - * @note The register write-protection function should be disabled before using this function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_EnableFaultBrake(TIMER_T *timer, uint32_t u32CH0Level, uint32_t u32CH1Level, uint32_t u32BrakeSource) -{ - timer->PWMFAILBRK |= ((u32BrakeSource >> 16) & 0xFUL); - timer->PWMBRKCTL = (timer->PWMBRKCTL & ~(TIMER_PWMBRKCTL_BRKAEVEN_Msk | TIMER_PWMBRKCTL_BRKAODD_Msk)) | - (u32BrakeSource & 0xFFFFUL) | (u32CH0Level << TIMER_PWMBRKCTL_BRKAEVEN_Pos) | (u32CH1Level << TIMER_PWMBRKCTL_BRKAODD_Pos); -} - -/** - * @brief Enable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to enable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_EnableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 |= u32IntSource; -} - -/** - * @brief Disable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to disable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_DisableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 &= ~u32IntSource; -} - -/** - * @brief Indicate Fault Brake Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * - * @details This function is used to indicate fault brake interrupt flag occurred or not of selected source. - * @note NOT available on TIMER4 and TIMER5. - */ -uint32_t TPWM_GetFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - return ((timer->PWMINTSTS1 & (0x3UL << u32IntSource)) ? 1UL : 0UL); -} - -/** - * @brief Clear Fault Brake Interrupt Flags - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to clear fault brake interrupt flags of selected source. - * @note The register write-protection function should be disabled before using this function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_ClearFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTSTS1 = (0x3UL << u32IntSource); -} - -/** - * @brief Enable Load Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32LoadMode Timer PWM counter loading mode, could be one of following mode - * - \ref TPWM_LOAD_MODE_PERIOD - * - \ref TPWM_LOAD_MODE_IMMEDIATE - * - \ref TPWM_LOAD_MODE_CENTER - * - * @return None - * - * @details This function is used to enable load mode of selected channel. - * @note The default loading mode is period loading mode. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_SetLoadMode(TIMER_T *timer, uint32_t u32LoadMode) -{ - timer->PWMCTL = (timer->PWMCTL & ~(TIMER_PWMCTL_IMMLDEN_Msk | TIMER_PWMCTL_CTRLD_Msk)) | u32LoadMode; -} - -/** - * @brief Enable Brake Pin Noise Filter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32BrakePinSrc The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * @param[in] u32DebounceCnt This value controls the real debounce sample time. - * The target debounce sample time is (debounce sample clock period) * (u32DebounceCnt). - * @param[in] u32ClkSrcSel Brake pin detector debounce clock source, could be one of following source - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_1 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_2 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_4 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_8 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_16 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_32 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_64 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_128 - * - * @return None - * - * @details This function is used to enable external brake pin detector noise filter function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_EnableBrakePinDebounce(TIMER_T *timer, uint32_t u32BrakePinSrc, uint32_t u32DebounceCnt, uint32_t u32ClkSrcSel) -{ - timer->PWMBNF = (timer->PWMBNF & ~(TIMER_PWMBNF_BKPINSRC_Msk | TIMER_PWMBNF_BRKFCNT_Msk | TIMER_PWMBNF_BRKNFSEL_Msk)) | - (u32BrakePinSrc << TIMER_PWMBNF_BKPINSRC_Pos) | - (u32DebounceCnt << TIMER_PWMBNF_BRKFCNT_Pos) | - (u32ClkSrcSel << TIMER_PWMBNF_BRKNFSEL_Pos) | TIMER_PWMBNF_BRKNFEN_Msk; -} - -/** - * @brief Disable Brake Pin Noise Filter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable external brake pin detector noise filter function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_DisableBrakePinDebounce(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKNFEN_Msk; -} - -/** - * @brief Enable Brake Pin Inverse Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable PWM brake pin inverse function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_EnableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Disable Brake Pin Inverse Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable PWM brake pin inverse function. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_DisableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Set Brake Pin Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32BrakePinNum Brake pin selection. One of the following: - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * - * @return None - * - * @details This function is used to set PWM brake pin source. - * @note NOT available on TIMER4 and TIMER5. - */ -void TPWM_SetBrakePinSource(TIMER_T *timer, uint32_t u32BrakePinNum) -{ - timer->PWMBNF = (((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | (u32BrakePinNum << TIMER_PWMBNF_BKPINSRC_Pos)); -} - - -/**@}*/ /* end of group TIMER_PWM_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group TIMER_PWM_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_trng.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_trng.c deleted file mode 100644 index 56318b9447f..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_trng.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************//** - * @file trng.c - * @version V3.00 - * @brief M460 series TRNG driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include - -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TRNG_Driver TRNG Driver - @{ -*/ - - -/** @addtogroup TRNG_EXPORTED_FUNCTIONS TRNG Exported Functions - @{ -*/ - - -/** - * @brief Initialize TRNG hardware. - * @return TRNG hardware enable success or failed. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_Open(void) -{ - uint32_t u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - - SYS->IPRST1 |= SYS_IPRST1_TRNGRST_Msk; - SYS->IPRST1 ^= SYS_IPRST1_TRNGRST_Msk; - - TRNG->CTL |= TRNG_CTL_TRNGEN_Msk; - - TRNG->ACT |= TRNG_ACT_ACT_Msk; - - /* Waiting for ready */ - while ((TRNG->CTL & TRNG_CTL_READY_Msk) == 0) - { - if (--u32TimeOutCount == 0) return -1; /* Time-out error */ - } - - return 0; -} - - -/** - * @brief Generate a 32-bits random number word. - * @param[out] u32RndNum The output 32-bits word random number. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenWord(uint32_t *u32RndNum) -{ - uint32_t i, u32Reg, timeout; - - *u32RndNum = 0; - u32Reg = TRNG->CTL; - - for (i = 0; i < 4; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - *u32RndNum |= ((TRNG->DATA & 0xff) << i * 8); - - } - return 0; -} - -/** - * @brief Generate a big number in binary format. - * @param[out] u8BigNum The output big number. - * @param[in] i32Len Request bit length of the output big number. It must be multiple of 8. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenBignum(uint8_t u8BigNum[], int32_t i32Len) -{ - uint32_t i, u32Reg, timeout; - - u32Reg = TRNG->CTL; - - for (i = 0; i < i32Len / 8; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - u8BigNum[i] = (TRNG->DATA & 0xff); - } - return 0; -} - -/** - * @brief Generate a big number in hex format. - * @param[out] cBigNumHex The output hex format big number. - * @param[in] i32Len Request bit length of the output big number. It must be multiple of 8. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenBignumHex(char cBigNumHex[], int32_t i32Len) -{ - uint32_t i, idx, u32Reg, timeout; - uint32_t data; - - u32Reg = TRNG->CTL; - idx = 0; - for (i = 0; i < i32Len / 8; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - data = (TRNG->DATA & 0xff); - - if (data >= 0xA0) - cBigNumHex[idx++] = ((data >> 4) & 0xf) - 10 + 'A'; - else - cBigNumHex[idx++] = ((data >> 4) & 0xf) + '0'; - - data &= 0xf; - if (data >= 0xA) - cBigNumHex[idx++] = data - 10 + 'A'; - else - cBigNumHex[idx++] = data + '0'; - } - cBigNumHex[idx] = 0; - return 0; -} - - -/*@}*/ /* end of group TRNG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TRNG_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_uart.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_uart.c deleted file mode 100644 index 20832506f23..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_uart.c +++ /dev/null @@ -1,687 +0,0 @@ -/**************************************************************************//** - * @file uart.c - * @version V3.00 - * @brief M2354 series UART Interface Controller (UART) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -/** - * @brief Clear UART specified interrupt flag - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTSTS_SWBEINT_Msk : Single-wire Bit Error Detect Interrupt - * - \ref UART_INTSTS_LININT_Msk : LIN Bus interrupt - * - \ref UART_INTSTS_WKINT_Msk : Wake-up interrupt - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error interrupt - * - \ref UART_INTSTS_MODEMINT_Msk : MODEM Status Interrupt - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status interrupt - * - * @return None - * - * @details The function is used to clear UART specified interrupt flag. - */ -void UART_ClearIntFlag(UART_T* uart, uint32_t u32InterruptFlag) -{ - if(u32InterruptFlag & UART_INTSTS_SWBEINT_Msk) /* Clear Bit Error Detection Interrupt */ - { - uart->FIFOSTS = UART_INTSTS_SWBEIF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_RLSINT_Msk) /* Clear Receive Line Status Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_BIF_Msk | UART_FIFOSTS_FEF_Msk | UART_FIFOSTS_FEF_Msk | UART_FIFOSTS_ADDRDETF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_MODEMINT_Msk) /* Clear MODEM Status Interrupt */ - { - uart->MODEMSTS |= UART_MODEMSTS_CTSDETF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_BUFERRINT_Msk) /* Clear Buffer Error Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_RXOVIF_Msk | UART_FIFOSTS_TXOVIF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_WKINT_Msk) /* Clear Wake-up Interrupt */ - { - uart->WKSTS = UART_WKSTS_CTSWKF_Msk | UART_WKSTS_DATWKF_Msk | - UART_WKSTS_RFRTWKF_Msk | UART_WKSTS_RS485WKF_Msk | - UART_WKSTS_TOUTWKF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_LININT_Msk) /* Clear LIN Bus Interrupt */ - { - uart->INTSTS = UART_INTSTS_LINIF_Msk; - uart->LINSTS = UART_LINSTS_BITEF_Msk | UART_LINSTS_BRKDETF_Msk | - UART_LINSTS_SLVSYNCF_Msk | UART_LINSTS_SLVIDPEF_Msk | - UART_LINSTS_SLVHEF_Msk | UART_LINSTS_SLVHDETF_Msk ; - } - -} - - -/** - * @brief Disable UART interrupt - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART interrupt. - */ -void UART_Close(UART_T* uart) -{ - uart->INTEN = 0ul; -} - - -/** - * @brief Disable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART auto flow control. - */ -void UART_DisableFlowCtrl(UART_T* uart) -{ - uart->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk); -} - - -/** - * @brief Disable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty Interrupt - * - \ref UART_INTEN_SWBEIEN_Msk : Single-wire Bit Error Detect Interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto-baud Rate Interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin Bus interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx Time-out Interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : MODEM Status Interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line Status Interrupt - * - \ref UART_INTEN_THREIEN_Msk : Transmit Holding Register Empty Interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Receive Data Available Interrupt - * - * @return None - * - * @details The function is used to disable UART specified interrupt and disable NVIC UART IRQ. - */ -void UART_DisableInt(UART_T* uart, uint32_t u32InterruptFlag) -{ - /* Disable UART specified interrupt */ - UART_DISABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Enable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to Enable UART auto flow control. - */ -/** - * @brief Enable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to Enable UART auto flow control. - */ -void UART_EnableFlowCtrl(UART_T* uart) -{ - /* Set RTS pin output is low level active */ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - - /* Set CTS pin input is low level active */ - uart->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk; - - /* Set RTS and CTS auto flow control enable */ - uart->INTEN |= UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk; -} - - -/** - * @brief Enable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module: - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty Interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto-baud Rate Interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin Bus interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx Time-out Interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : MODEM Status Interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line Status Interrupt - * - \ref UART_INTEN_THREIEN_Msk : Transmit Holding Register Empty Interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Receive Data Available Interrupt - * - * @return None - * - * @details The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - */ -void UART_EnableInt(UART_T* uart, uint32_t u32InterruptFlag) -{ - - /* Enable UART specified interrupt */ - UART_ENABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Open and set UART function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The baudrate of UART module. - * - * @return None - * - * @details This function use to enable UART function and set baud-rate. - */ -void UART_Open(UART_T* uart, uint32_t u32baudrate) -{ - uint32_t u32UartClkSrcSel, u32UartClkDivNum; - uint32_t au32ClkTbl[8] = { __HXT, 0ul, __LXT, __HIRC, 0ul, 0ul, 0ul, 0ul}; - uint32_t u32BaudDiv = 0ul; - - /* Get UART clock source selection and UART clock divider number */ - switch((uint32_t)uart) - { - case UART0_BASE: - case UART0_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART0_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART0_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART1_BASE: - case UART1_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART1_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART1_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - case UART2_BASE: - case UART2_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART2_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART2_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART3_BASE: - case UART3_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART3_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART3_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - case UART4_BASE: - case UART4_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART4_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART4_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART5_BASE: - case UART5_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART5_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART5_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - default: - return; - } - - /* Select UART function */ - uart->FUNCSEL = UART_FUNCSEL_UART; - - /* Set UART line configuration */ - uart->LINE = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1; - - /* Set UART Rx and RTS trigger level */ - uart->FIFO &= ~(UART_FIFO_RFITL_Msk | UART_FIFO_RTSTRGLV_Msk); - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if(u32UartClkSrcSel == 1ul) - { - au32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Set UART baud rate */ - if(u32baudrate != 0ul) - { - u32BaudDiv = UART_BAUD_MODE2_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if(u32BaudDiv > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32BaudDiv); - } - } -} - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive FIFO. - * @param[in] u32ReadBytes The the read bytes number of data. - * - * @return u32Count Receive byte count - * - * @details The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf. - */ -uint32_t UART_Read(UART_T* uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for(u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while(uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if(u32Exit == 1ul) - { - break; - } - else - { - pu8RxBuf[u32Count] = (uint8_t)uart->DAT; /* Get Data from UART RX */ - } - } - - return u32Count; -} - - -/** - * @brief Set UART line configuration - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The register value of baudrate of UART module. - * If u32baudrate = 0, UART baudrate will not change. - * @param[in] u32data_width The data length of UART module. - * - \ref UART_WORD_LEN_5 - * - \ref UART_WORD_LEN_6 - * - \ref UART_WORD_LEN_7 - * - \ref UART_WORD_LEN_8 - * @param[in] u32parity The parity setting (none/odd/even/mark/space) of UART module. - * - \ref UART_PARITY_NONE - * - \ref UART_PARITY_ODD - * - \ref UART_PARITY_EVEN - * - \ref UART_PARITY_MARK - * - \ref UART_PARITY_SPACE - * @param[in] u32stop_bits The stop bit length (1/1.5/2 bit) of UART module. - * - \ref UART_STOP_BIT_1 - * - \ref UART_STOP_BIT_1_5 - * - \ref UART_STOP_BIT_2 - * - * @return None - * - * @details This function use to config UART line setting. - */ -void UART_SetLineConfig(UART_T* uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32UartClkSrcSel, u32UartClkDivNum; - uint32_t au32ClkTbl[8] = { __HXT, 0ul, __LXT, __HIRC, 0ul, 0ul, 0ul, 0ul}; - uint32_t u32BaudDiv = 0ul; - - /* Get UART clock source selection and UART clock divider number */ - switch((uint32_t)uart) - { - case UART0_BASE: - case UART0_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART0_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART0_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART1_BASE: - case UART1_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART1_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART1_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - case UART2_BASE: - case UART2_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART2_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART2_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART3_BASE: - case UART3_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART3_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART3_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - case UART4_BASE: - case UART4_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART4_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART4_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART5_BASE: - case UART5_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART5_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART5_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - default: - return; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if(u32UartClkSrcSel == 1ul) - { - au32ClkTbl[1] = CLK_GetPLLClockFreq(); - } - - /* Set UART baud rate */ - if(u32baudrate != 0ul) - { - u32BaudDiv = UART_BAUD_MODE2_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if(u32BaudDiv > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32BaudDiv); - } - } - - /* Set UART line configuration */ - uart->LINE = u32data_width | u32parity | u32stop_bits; -} - - -/** - * @brief Set Rx timeout count - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32TOC Rx timeout counter. - * - * @return None - * - * @details This function use to set Rx timeout count. - */ -void UART_SetTimeoutCnt(UART_T* uart, uint32_t u32TOC) -{ - /* Set time-out interrupt comparator */ - uart->TOUT = (uart->TOUT & ~UART_TOUT_TOIC_Msk) | (u32TOC); - - /* Set time-out counter enable */ - uart->INTEN |= UART_INTEN_TOCNTEN_Msk; -} - - -/** - * @brief Select and configure IrDA function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Buadrate The baudrate of UART module. - * @param[in] u32Direction The direction of UART module in IrDA mode: - * - \ref UART_IRDA_TXEN - * - \ref UART_IRDA_RXEN - * - * @return None - * - * @details The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate. - */ -void UART_SelectIrDAMode(UART_T* uart, uint32_t u32Buadrate, uint32_t u32Direction) -{ - uint32_t u32UartClkSrcSel = 0UL, u32UartClkDivNum = 1UL; - uint32_t au32ClkTbl[8] = { __HXT, 0ul, __LXT, __HIRC, 0ul, 0ul, 0ul, 0ul}; - uint32_t u32BaudDiv; - - /* Select IrDA function mode */ - uart->FUNCSEL = UART_FUNCSEL_IrDA; - - /* Get UART clock source selection and UART clock divider number */ - switch((uint32_t)uart) - { - case UART0_BASE: - case UART0_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART0_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART0_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART1_BASE: - case UART1_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART1_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART1_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - case UART2_BASE: - case UART2_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART2_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART2_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART3_BASE: - case UART3_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART3_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART3_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - case UART4_BASE: - case UART4_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART4_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART4_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK0Freq(); - break; - case UART5_BASE: - case UART5_BASE+NS_OFFSET: - u32UartClkSrcSel = CLK_GetModuleClockSource(UART5_MODULE); - u32UartClkDivNum = CLK_GetModuleClockDivider(UART5_MODULE); - if(u32UartClkSrcSel == 4ul) - au32ClkTbl[4] = CLK_GetPCLK1Freq(); - break; - default: - return; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if(u32UartClkSrcSel == 1ul) - { - au32ClkTbl[1] = CLK_GetPLLClockFreq(); - } - - /* Set UART IrDA baud rate in mode 0 */ - if(u32Buadrate != 0ul) - { - u32BaudDiv = UART_BAUD_MODE0_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32Buadrate); - - if(u32BaudDiv < 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | u32BaudDiv); - } - } - - /* Configure IrDA relative settings */ - if(u32Direction == UART_IRDA_RXEN) - { - uart->IRDA |= UART_IRDA_RXINV_Msk; /* Rx signal is inverse */ - uart->IRDA &= ~UART_IRDA_TXEN_Msk; - } - else - { - uart->IRDA &= ~UART_IRDA_TXINV_Msk; /* Tx signal is not inverse */ - uart->IRDA |= UART_IRDA_TXEN_Msk; - } - -} - - -/** - * @brief Select and configure RS485 function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The operation mode(NMM/AUD/AAD). - * - \ref UART_ALTCTL_RS485NMM_Msk - * - \ref UART_ALTCTL_RS485AUD_Msk - * - \ref UART_ALTCTL_RS485AAD_Msk - * @param[in] u32Addr The RS485 address. - * - * @return None - * - * @details The function is used to set RS485 relative setting. - */ -void UART_SelectRS485Mode(UART_T* uart, uint32_t u32Mode, uint32_t u32Addr) -{ - /* Select UART RS485 function mode */ - uart->FUNCSEL = UART_FUNCSEL_RS485; - - /* Set RS585 configuration */ - uart->ALTCTL &= ~(UART_ALTCTL_RS485NMM_Msk | UART_ALTCTL_RS485AUD_Msk | UART_ALTCTL_RS485AAD_Msk | UART_ALTCTL_ADDRMV_Msk); - uart->ALTCTL |= (u32Mode | (u32Addr << UART_ALTCTL_ADDRMV_Pos)); -} - - -/** - * @brief Select and configure LIN function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The LIN direction : - * - \ref UART_ALTCTL_LINTXEN_Msk - * - \ref UART_ALTCTL_LINRXEN_Msk - * @param[in] u32BreakLength The breakfield length. - * - * @return None - * - * @details The function is used to set LIN relative setting. - */ -void UART_SelectLINMode(UART_T* uart, uint32_t u32Mode, uint32_t u32BreakLength) -{ - /* Select LIN function mode */ - uart->FUNCSEL = UART_FUNCSEL_LIN; - - /* Select LIN function setting : Tx enable, Rx enable and break field length */ - uart->ALTCTL &= ~(UART_ALTCTL_LINTXEN_Msk | UART_ALTCTL_LINRXEN_Msk | UART_ALTCTL_BRKFL_Msk); - uart->ALTCTL |= (u32Mode | (u32BreakLength << UART_ALTCTL_BRKFL_Pos)); -} - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8TxBuf The buffer to send the data to UART transmission FIFO. - * @param[out] u32WriteBytes The byte number of data. - * - * @return u32Count transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by UART. - */ -uint32_t UART_Write(UART_T* uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for(u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while(UART_IS_TX_FULL(uart)) /* Wait Tx not full and Time-out manner */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if(u32Exit == 1ul) - { - break; - } - else - { - uart->DAT = pu8TxBuf[u32Count]; /* Send UART Data from buffer */ - } - } - - return u32Count; -} - -/** - * @brief Select Single Wire mode function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to select Single Wire mode. - */ -void UART_SelectSingleWireMode(UART_T *uart) -{ - /* Select UART SingleWire function mode */ - uart->FUNCSEL = ((uart->FUNCSEL & (~UART_FUNCSEL_FUNCSEL_Msk)) | UART_FUNCSEL_SINGLE_WIRE); -} - - -/**@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group UART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usbd.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usbd.c deleted file mode 100644 index e0e098a9ed0..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usbd.c +++ /dev/null @@ -1,778 +0,0 @@ -/**************************************************************************//** - * @file usbd.c - * @version V3.00 - * @brief M2354 series USBD driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - - -/** @addtogroup USBD_EXPORTED_FUNCTIONS USBD Exported Functions - @{ -*/ - -/* Global variables for Control Pipe */ -uint8_t g_USBD_au8SetupPacket[8] = {0UL}; /*!< Setup packet buffer */ -volatile uint8_t g_USBD_u8RemoteWakeupEn = 0UL; /*!< Remote wake up function enable flag */ - -/** - * @cond HIDDEN_SYMBOLS - */ -static uint8_t *s_USBD_pu8CtrlInPointer = 0; -static uint8_t *s_USBD_pu8CtrlOutPointer = 0; -static volatile uint32_t s_USBD_u32CtrlInSize = 0UL; -static volatile uint32_t s_USBD_u32CtrlOutSize = 0UL; -static volatile uint32_t s_USBD_u32CtrlOutSizeLimit = 0UL; -static volatile uint32_t s_USBD_u32UsbAddr = 0UL; -static volatile uint32_t s_USBD_u32UsbConfig = 0UL; -static volatile uint32_t s_USBD_u32CtrlMaxPktSize = 8UL; -static volatile uint32_t s_USBD_u32UsbAltInterface = 0UL; -static volatile uint8_t s_USBD_u8CtrlInZeroFlag = 0UL; -/** - * @endcond - */ - -const S_USBD_INFO_T *g_USBD_sInfo; /*!< A pointer for USB information structure */ - -VENDOR_REQ g_USBD_pfnVendorRequest = NULL; /*!< USB Vendor Request Functional Pointer */ -CLASS_REQ g_USBD_pfnClassRequest = NULL; /*!< USB Class Request Functional Pointer */ -SET_INTERFACE_REQ g_USBD_pfnSetInterface = NULL; /*!< USB Set Interface Functional Pointer */ -SET_CONFIG_CB g_USBD_pfnSetConfigCallback = NULL; /*!< USB Set configuration callback function pointer */ -uint32_t g_USBD_u32EpStallLock = 0UL; /*!< Bit map flag to lock specified EP when SET_FEATURE */ - -/** - * @brief This function makes USBD module to be ready to use - * - * @param[in] param The structure of USBD information. - * @param[in] pfnClassReq USB Class request callback function. - * @param[in] pfnSetInterface USB Set Interface request callback function. - * - * @return None - * - * @details This function will enable USB controller, USB PHY transceiver and pull-up resistor of USB_D+ pin. USB PHY will drive SE0 to bus. - */ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface) -{ - USBD_T *pUSBD; - - if((__PC() & NS_OFFSET) == NS_OFFSET) - { - pUSBD = USBD_NS; - } - else - { - pUSBD = USBD; - } - - g_USBD_sInfo = param; - g_USBD_pfnClassRequest = pfnClassReq; - g_USBD_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - s_USBD_u32CtrlMaxPktSize = g_USBD_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ -#ifdef SUPPORT_LPM - pUSBD->ATTR = 0x7D0UL | USBD_LPMACK; -#else - pUSBD->ATTR = 0x7D0UL; -#endif - /* Force SE0 */ - USBD_SET_SE0(); -} - -/** - * @brief This function makes USB host to recognize the device - * - * @param None - * - * @return None - * - * @details Enable WAKEUP, FLDET, USB and BUS interrupts. Disable software-disconnect function after 100ms delay with SysTick timer. - */ -void USBD_Start(void) -{ - /* Disable software-disconnect function */ - USBD_CLR_SE0(); - - /* Clear USB-related interrupts before enable interrupt */ - USBD_CLR_INT_FLAG(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); - - /* Enable USB-related interrupts. */ - USBD_ENABLE_INT(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); -} - -/** - * @brief Get the received SETUP packet - * - * @param[in] buf A buffer pointer used to store 8-byte SETUP packet. - * - * @return None - * - * @details Store SETUP packet to a user-specified buffer. - * - */ -void USBD_GetSetupPacket(uint8_t *buf) -{ - USBD_MemCopy(buf, g_USBD_au8SetupPacket, 8UL); -} - -/** - * @brief Process SETUP packet - * - * @param None - * - * @return None - * - * @details Parse SETUP packet and perform the corresponding action. - * - */ -void USBD_ProcessSetupPacket(void) -{ - /* Get SETUP packet from USB buffer */ - USBD_MemCopy(g_USBD_au8SetupPacket, (uint8_t *)USBD_BUF_BASE, 8UL); - - /* Check the request type */ - switch(g_USBD_au8SetupPacket[0] & 0x60UL) - { - case REQ_STANDARD: /* Standard */ - { - USBD_StandardRequest(); - break; - } - case REQ_CLASS: /* Class */ - { - if(g_USBD_pfnClassRequest != NULL) - { - g_USBD_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: /* Vendor */ - { - if(g_USBD_pfnVendorRequest != NULL) - { - g_USBD_pfnVendorRequest(); - } - break; - } - default: /* reserved */ - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } -} - -/** - * @brief Process GetDescriptor request - * - * @param None - * - * @return None - * - * @details Parse GetDescriptor request and perform the corresponding action. - * - */ -void USBD_GetDescriptor(void) -{ - uint32_t u32Len; - - s_USBD_u8CtrlInZeroFlag = (uint8_t)0UL; - u32Len = 0UL; - u32Len = g_USBD_au8SetupPacket[7]; - u32Len <<= 8UL; - u32Len += g_USBD_au8SetupPacket[6]; - - switch(g_USBD_au8SetupPacket[3]) - { - /* Get Device Descriptor */ - case DESC_DEVICE: - { - u32Len = USBD_Minimum(u32Len, (uint32_t)LEN_DEVICE); - USBD_PrepareCtrlIn((uint8_t *)g_USBD_sInfo->gu8DevDesc, u32Len); - break; - } - /* Get Configuration Descriptor */ - case DESC_CONFIG: - { - uint32_t u32TotalLen; - - u32TotalLen = g_USBD_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_USBD_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8UL); - - if(u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if((u32Len % s_USBD_u32CtrlMaxPktSize) == 0UL) - { - s_USBD_u8CtrlInZeroFlag = (uint8_t)1UL; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_USBD_sInfo->gu8ConfigDesc, u32Len); - break; - } - /* Get BOS Descriptor */ - case DESC_BOS: - { - if(g_USBD_sInfo->gu8BosDesc == 0) - { - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - } - else - { - u32Len = USBD_Minimum(u32Len, LEN_BOS + LEN_BOSCAP); - USBD_PrepareCtrlIn((uint8_t *)g_USBD_sInfo->gu8BosDesc, u32Len); - } - break; - } - /* Get HID Descriptor */ - case DESC_HID: - { - /* CV3.0 HID Class Descriptor Test, - Need to indicate index of the HID Descriptor within gu8ConfigDescriptor, specifically HID Composite device. */ - uint32_t u32ConfigDescOffset; /* u32ConfigDescOffset is configuration descriptor offset (HID descriptor start index) */ - u32Len = USBD_Minimum(u32Len, LEN_HID); - u32ConfigDescOffset = g_USBD_sInfo->gu32ConfigHidDescIdx[g_USBD_au8SetupPacket[4]]; - USBD_PrepareCtrlIn((uint8_t *)&g_USBD_sInfo->gu8ConfigDesc[u32ConfigDescOffset], u32Len); - break; - } - /* Get Report Descriptor */ - case DESC_HID_RPT: - { - if(u32Len > g_USBD_sInfo->gu32HidReportSize[g_USBD_au8SetupPacket[4]]) - { - u32Len = g_USBD_sInfo->gu32HidReportSize[g_USBD_au8SetupPacket[4]]; - if((u32Len % s_USBD_u32CtrlMaxPktSize) == 0UL) - { - s_USBD_u8CtrlInZeroFlag = (uint8_t)1UL; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_USBD_sInfo->gu8HidReportDesc[g_USBD_au8SetupPacket[4]], u32Len); - break; - } - /* Get String Descriptor */ - case DESC_STRING: - { - /* Get String Descriptor */ - if(g_USBD_au8SetupPacket[2] < 4UL) - { - if(u32Len > g_USBD_sInfo->gu8StringDesc[g_USBD_au8SetupPacket[2]][0]) - { - u32Len = g_USBD_sInfo->gu8StringDesc[g_USBD_au8SetupPacket[2]][0]; - if((u32Len % s_USBD_u32CtrlMaxPktSize) == 0UL) - { - s_USBD_u8CtrlInZeroFlag = (uint8_t)1UL; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_USBD_sInfo->gu8StringDesc[g_USBD_au8SetupPacket[2]], u32Len); - break; - } - else - { - /* Not support. Reply STALL. */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - default: - /* Not support. Reply STALL. */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } -} - -/** - * @brief Process standard request - * - * @param None - * - * @return None - * - * @details Parse standard request and perform the corresponding action. - * - */ -void USBD_StandardRequest(void) -{ - uint32_t u32Addr; - USBD_T *pUSBD; - OTG_T *pOTG; - - if((__PC() & NS_OFFSET) == NS_OFFSET) - { - pUSBD = USBD_NS; - pOTG = OTG_NS; - } - else - { - pUSBD = USBD; - pOTG = OTG; - } - - /* clear global variables for new request */ - s_USBD_pu8CtrlInPointer = 0; - s_USBD_u32CtrlInSize = 0UL; - - if((g_USBD_au8SetupPacket[0] & 0x80UL) == 0x80UL) /* request data transfer direction */ - { - /* Device to host */ - switch(g_USBD_au8SetupPacket[1]) - { - case GET_CONFIGURATION: - { - /* Return current configuration setting */ - /* Data stage */ - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(u32Addr) = (uint8_t)s_USBD_u32UsbConfig; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1UL); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0UL); - break; - } - case GET_DESCRIPTOR: - { - USBD_GetDescriptor(); - USBD_PrepareCtrlOut(0, 0UL); /* For status stage */ - break; - } - case GET_INTERFACE: - { - /* Return current interface setting */ - /* Data stage */ - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(u32Addr) = (uint8_t)s_USBD_u32UsbAltInterface; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1UL); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0UL); - break; - } - case GET_STATUS: - { - /* Device */ - if(g_USBD_au8SetupPacket[0] == 0x80UL) - { - uint8_t u8Tmp; - - u8Tmp = (uint8_t)0UL; - if((g_USBD_sInfo->gu8ConfigDesc[7] & 0x40UL) == 0x40UL) - { - u8Tmp |= (uint8_t)1UL; /* Self-Powered/Bus-Powered. */ - } - if((g_USBD_sInfo->gu8ConfigDesc[7] & 0x20UL) == 0x20UL) - { - u8Tmp |= (uint8_t)(g_USBD_u8RemoteWakeupEn << 1UL); /* Remote wake up */ - } - - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(u32Addr) = u8Tmp; - - } - /* Interface */ - else if(g_USBD_au8SetupPacket[0] == 0x81UL) - { - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(u32Addr) = (uint8_t)0UL; - } - /* Endpoint */ - else if(g_USBD_au8SetupPacket[0] == 0x82UL) - { - uint8_t ep = (uint8_t)(g_USBD_au8SetupPacket[4] & 0xFUL); - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(u32Addr) = (uint8_t)(USBD_GetStall(ep) ? 1UL : 0UL); - } - - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0) + 1UL; - M8(u32Addr) = (uint8_t)0UL; - /* Data stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 2UL); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0UL); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } - else - { - /* Host to device */ - switch(g_USBD_au8SetupPacket[1]) - { - case CLEAR_FEATURE: - { - if(g_USBD_au8SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - uint32_t epNum, i; - - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_USBD_u32EpStallLock is added to support it */ - epNum = (uint8_t)(g_USBD_au8SetupPacket[4] & 0xFUL); - for(i = 0UL; i < USBD_MAX_EP; i++) - { - if(((pUSBD->EP[i].CFG & 0xFUL) == epNum) && ((g_USBD_u32EpStallLock & (1UL << i)) == 0UL)) - { - pUSBD->EP[i].CFGP &= ~USBD_CFGP_SSTALL_Msk; - pUSBD->EP[i].CFG &= ~USBD_CFG_DSQSYNC_Msk; - } - } - } - else if(g_USBD_au8SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_USBD_u8RemoteWakeupEn = (uint8_t)0UL; - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0UL); - break; - } - case SET_ADDRESS: - { - s_USBD_u32UsbAddr = g_USBD_au8SetupPacket[2]; - - /* DATA IN for end of setup */ - /* Status Stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0UL); - break; - } - case SET_CONFIGURATION: - { - s_USBD_u32UsbConfig = g_USBD_au8SetupPacket[2]; - - if(g_USBD_pfnSetConfigCallback) - { - g_USBD_pfnSetConfigCallback(); - } - - /* DATA IN for end of setup */ - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0UL); - break; - } - case SET_FEATURE: - { - if((g_USBD_au8SetupPacket[0] & 0xFUL) == 0UL) /* 0: device */ - { - if((g_USBD_au8SetupPacket[2] == 3UL) && (g_USBD_au8SetupPacket[3] == 0UL)) /* 3: HNP enable */ - { - pOTG->CTL |= (OTG_CTL_HNPREQEN_Msk | OTG_CTL_BUSREQ_Msk); - } - } - if(g_USBD_au8SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - USBD_SetStall((uint8_t)(g_USBD_au8SetupPacket[4] & 0xFUL)); - } - else if(g_USBD_au8SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_USBD_u8RemoteWakeupEn = (uint8_t)1UL; - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0UL); - break; - } - case SET_INTERFACE: - { - s_USBD_u32UsbAltInterface = g_USBD_au8SetupPacket[2]; - if(g_USBD_pfnSetInterface != NULL) - { - g_USBD_pfnSetInterface(s_USBD_u32UsbAltInterface); - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0UL); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } -} - -/** - * @brief Prepare the first Control IN pipe - * - * @param[in] pu8Buf The pointer of data sent to USB host. - * @param[in] u32Size The IN transfer size. - * - * @return None - * - * @details Prepare data for Control IN transfer. - * - */ -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size) -{ - uint32_t u32Addr; - - if(u32Size > s_USBD_u32CtrlMaxPktSize) - { - /* Data size > MXPLD */ - s_USBD_pu8CtrlInPointer = pu8Buf + s_USBD_u32CtrlMaxPktSize; - s_USBD_u32CtrlInSize = u32Size - s_USBD_u32CtrlMaxPktSize; - USBD_SET_DATA1(EP0); - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)u32Addr, pu8Buf, s_USBD_u32CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, s_USBD_u32CtrlMaxPktSize); - } - else - { - /* Data size <= MXPLD */ - s_USBD_pu8CtrlInPointer = 0; - s_USBD_u32CtrlInSize = 0UL; - USBD_SET_DATA1(EP0); - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)u32Addr, pu8Buf, u32Size); - USBD_SET_PAYLOAD_LEN(EP0, u32Size); - } -} - -/** - * @brief Repeat Control IN pipe - * - * @param None - * - * @return None - * - * @details This function processes the remained data of Control IN transfer. - * - */ -void USBD_CtrlIn(void) -{ - uint32_t u32Addr; - - if(s_USBD_u32CtrlInSize) - { - /* Process remained data */ - if(s_USBD_u32CtrlInSize > s_USBD_u32CtrlMaxPktSize) - { - /* Data size > MXPLD */ - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)u32Addr, (uint8_t *)s_USBD_pu8CtrlInPointer, s_USBD_u32CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, s_USBD_u32CtrlMaxPktSize); - s_USBD_pu8CtrlInPointer += s_USBD_u32CtrlMaxPktSize; - s_USBD_u32CtrlInSize -= s_USBD_u32CtrlMaxPktSize; - } - else - { - /* Data size <= MXPLD */ - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)u32Addr, (uint8_t *)s_USBD_pu8CtrlInPointer, s_USBD_u32CtrlInSize); - USBD_SET_PAYLOAD_LEN(EP0, s_USBD_u32CtrlInSize); - s_USBD_pu8CtrlInPointer = 0; - s_USBD_u32CtrlInSize = 0UL; - } - } - else /* No more data for IN token */ - { - /* In ACK for Set address */ - if((g_USBD_au8SetupPacket[0] == REQ_STANDARD) && (g_USBD_au8SetupPacket[1] == SET_ADDRESS)) - { - u32Addr = USBD_GET_ADDR(); - if((u32Addr != s_USBD_u32UsbAddr) && (u32Addr == 0UL)) - { - USBD_SET_ADDR(s_USBD_u32UsbAddr); - } - } - - /* For the case of data size is integral times maximum packet size */ - if(s_USBD_u8CtrlInZeroFlag) - { - USBD_SET_PAYLOAD_LEN(EP0, 0UL); - s_USBD_u8CtrlInZeroFlag = (uint8_t)0UL; - } - } -} - -/** - * @brief Prepare the first Control OUT pipe - * - * @param[in] pu8Buf The pointer of data received from USB host. - * @param[in] u32Size The OUT transfer size. - * - * @return None - * - * @details This function is used to prepare the first Control OUT transfer. - * - */ -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size) -{ - s_USBD_pu8CtrlOutPointer = pu8Buf; - s_USBD_u32CtrlOutSize = 0UL; - s_USBD_u32CtrlOutSizeLimit = u32Size; - USBD_SET_PAYLOAD_LEN(EP1, s_USBD_u32CtrlMaxPktSize); -} - -/** - * @brief Repeat Control OUT pipe - * - * @param None - * - * @return None - * - * @details This function processes the successive Control OUT transfer. - * - */ -void USBD_CtrlOut(void) -{ - uint32_t u32Size; - uint32_t u32Addr; - - if(s_USBD_u32CtrlOutSize < s_USBD_u32CtrlOutSizeLimit) - { - u32Size = USBD_GET_PAYLOAD_LEN(EP1); - u32Addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP1); - USBD_MemCopy((uint8_t *)s_USBD_pu8CtrlOutPointer, (uint8_t *)u32Addr, u32Size); - s_USBD_pu8CtrlOutPointer += u32Size; - s_USBD_u32CtrlOutSize += u32Size; - - if(s_USBD_u32CtrlOutSize < s_USBD_u32CtrlOutSizeLimit) - { - USBD_SET_PAYLOAD_LEN(EP1, s_USBD_u32CtrlMaxPktSize); - } - } -} - -/** - * @brief Reset software flags - * - * @param None - * - * @return None - * - * @details This function resets all variables for protocol and resets USB device address to 0. - * - */ -void USBD_SwReset(void) -{ - uint32_t i, u32CFG; - USBD_T *pUSBD; - - if((__PC() & NS_OFFSET) == NS_OFFSET) - { - pUSBD = USBD_NS; - } - else - { - pUSBD = USBD; - } - - /* Reset all variables for protocol */ - s_USBD_pu8CtrlInPointer = 0; - s_USBD_u32CtrlInSize = 0UL; - s_USBD_pu8CtrlOutPointer = 0; - s_USBD_u32CtrlOutSize = 0UL; - s_USBD_u32CtrlOutSizeLimit = 0UL; - g_USBD_u32EpStallLock = 0UL; - memset(g_USBD_au8SetupPacket, 0, 8UL); - - for(i = 0UL; i < USBD_MAX_EP; i++) - { - if(!USBD_IS_DB_MODE(i)) - { - /* Reset PID DATA0 */ - pUSBD->EP[i].CFG &= ~USBD_CFG_DSQSYNC_Msk; - } - else - { - /* Reset double buffer setting */ - u32CFG = pUSBD->EP[i].CFG; - pUSBD->EP[i].CFG = u32CFG; - } - } - - /* Reset USB device address */ - USBD_SET_ADDR(0UL); -} - -/** - * @brief USBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set USBD vendor request callback function - */ -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq) -{ - g_USBD_pfnVendorRequest = pfnVendorReq; -} - -/** - * @brief The callback function which called when get SET CONFIGURATION request - * - * @param[in] pfnSetConfigCallback Callback function pointer for SET CONFIGURATION request - * - * @return None - * - * @details This function is used to set the callback function which will be called at SET CONFIGURATION request. - */ -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback) -{ - g_USBD_pfnSetConfigCallback = pfnSetConfigCallback; -} - - -/** - * @brief EP stall lock function to avoid stall clear by USB SET FEATURE request. - * - * @param[in] u32EpBitmap Use bitmap to select which endpoints will be locked - * - * @return None - * - * @details This function is used to lock relative endpoint to avoid stall clear by SET FEATURE request. - * If ep stall locked, user needs to reset USB device or re-configure device to clear it. - */ -void USBD_LockEpStall(uint32_t u32EpBitmap) -{ - g_USBD_u32EpStallLock = u32EpBitmap; -} - -/**@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USBD_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_i2c.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_i2c.c deleted file mode 100644 index f45c055227e..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_i2c.c +++ /dev/null @@ -1,1659 +0,0 @@ -/****************************************************************************//** - * @file usci_i2c.c - * @version V3.00 - * $Revision: 1 $ - * $Date: 16/07/07 7:50p $ - * @brief M2355 series USCI I2C(UI2C) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This function makes USCI_I2C module be ready and set the wanted bus clock - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Enable USCI_I2C module and configure USCI_I2C module(bus clock, data format). - */ -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if((ui2c == UI2C1) || (ui2c == UI2C1_NS)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32ClkDiv = (uint32_t)((((((u32Pclk / 2u) * 10u) / (u32BusClock)) + 5u) / 10u) - 1u); /* Compute proper divider for USCI_I2C clock */ - - /* Enable USCI_I2C protocol */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; - ui2c->CTL = 4u << UI2C_CTL_FUNMODE_Pos; - - /* Data format configuration */ - /* 8 bit data length */ - ui2c->LINECTL &= ~UI2C_LINECTL_DWIDTH_Msk; - ui2c->LINECTL |= 8u << UI2C_LINECTL_DWIDTH_Pos; - - /* MSB data format */ - ui2c->LINECTL &= ~UI2C_LINECTL_LSB_Msk; - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - ui2c->PROTCTL |= UI2C_PROTCTL_PROTEN_Msk; - - return (u32Pclk / ((u32ClkDiv + 1u) << 1u)); -} - -/** - * @brief This function closes the USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Close USCI_I2C protocol function. - */ -void UI2C_Close(UI2C_T *ui2c) -{ - /* Disable USCI_I2C function */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; -} - -/** - * @brief This function clears the time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Clear time-out flag when time-out flag is set. - */ -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c) -{ - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; -} - -/** - * @brief This function sets the control bit of the USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Start Set START bit to USCI_I2C module. - * @param[in] u8Stop Set STOP bit to USCI_I2C module. - * @param[in] u8Ptrg Set PTRG bit to USCI_I2C module. - * @param[in] u8Ack Set ACK bit to USCI_I2C module. - * - * @return None - * - * @details The function set USCI_I2C control bit of USCI_I2C bus protocol. - */ -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack) -{ - uint32_t u32Reg = 0u; - uint32_t u32Val = ui2c->PROTCTL & ~(UI2C_PROTCTL_STA_Msk | UI2C_PROTCTL_STO_Msk | UI2C_PROTCTL_AA_Msk); - - if(u8Start) - { - u32Reg |= UI2C_PROTCTL_STA_Msk; - } - if(u8Stop) - { - u32Reg |= UI2C_PROTCTL_STO_Msk; - } - if(u8Ptrg) - { - u32Reg |= UI2C_PROTCTL_PTRG_Msk; - } - if(u8Ack) - { - u32Reg |= UI2C_PROTCTL_AA_Msk; - } - ui2c->PROTCTL = u32Val | u32Reg; -} - -/** - * @brief This function disables the interrupt of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to an interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details The function is used to disable USCI_I2C bus interrupt events. - */ -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Disable time-out interrupt flag */ - if((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_TOIEN_Msk; - } - /* Disable start condition received interrupt flag */ - if((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STARIEN_Msk; - } - /* Disable stop condition received interrupt flag */ - if((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STORIEN_Msk; - } - /* Disable non-acknowledge interrupt flag */ - if((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_NACKIEN_Msk; - } - /* Disable arbitration lost interrupt flag */ - if((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ARBLOIEN_Msk; - } - - /* Disable error interrupt flag */ - if((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ERRIEN_Msk; - } - /* Disable acknowledge interrupt flag */ - if((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function enables the interrupt of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * @return None - * - * @details The function is used to enable USCI_I2C bus interrupt events. - */ -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Enable time-out interrupt flag */ - if((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_TOIEN_Msk; - } - /* Enable start condition received interrupt flag */ - if((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STARIEN_Msk; - } - /* Enable stop condition received interrupt flag */ - if((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STORIEN_Msk; - } - /* Enable non-acknowledge interrupt flag */ - if((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_NACKIEN_Msk; - } - /* Enable arbitration lost interrupt flag */ - if((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ARBLOIEN_Msk; - } - /* Enable error interrupt flag */ - if((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ERRIEN_Msk; - } - /* Enable acknowledge interrupt flag */ - if((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function returns the real bus clock of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details The function returns the actual USCI_I2C module bus clock. - */ -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c) -{ - uint32_t u32Divider; - uint32_t u32Pclk; - - if((ui2c == UI2C1) || (ui2c == UI2C1_NS)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - u32Divider = (ui2c->BRGEN & UI2C_BRGEN_CLKDIV_Msk) >> UI2C_BRGEN_CLKDIV_Pos; - - return (u32Pclk / ((u32Divider + 1u) << 1u)); -} - -/** - * @brief This function sets bus clock frequency of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Use this function set USCI_I2C bus clock frequency and return actual bus clock. - */ -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if((ui2c == UI2C1) || (ui2c == UI2C1_NS)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - u32ClkDiv = (uint32_t)((((((u32Pclk / 2u) * 10u) / (u32BusClock)) + 5u) / 10u) - 1u); /* Compute proper divider for USCI_I2C clock */ - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - - return (u32Pclk / ((u32ClkDiv + 1u) << 1u)); -} - -/** - * @brief This function gets the interrupt flag of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details Use this function to get USCI_I2C interrupt flag when module occurs interrupt event. - */ -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U; - uint32_t u32TmpValue; - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_TOIF_Msk; - /* Check Time-out Interrupt Flag */ - if((u32Mask & UI2C_TO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_TO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STARIF_Msk; - /* Check Start Condition Received Interrupt Flag */ - if((u32Mask & UI2C_STAR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STAR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STORIF_Msk; - /* Check Stop Condition Received Interrupt Flag */ - if((u32Mask & UI2C_STOR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STOR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_NACKIF_Msk; - /* Check Non-Acknowledge Interrupt Flag */ - if((u32Mask & UI2C_NACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_NACK_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ARBLOIF_Msk; - /* Check Arbitration Lost Interrupt Flag */ - if((u32Mask & UI2C_ARBLO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ARBLO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ERRIF_Msk; - /* Check Error Interrupt Flag */ - if((u32Mask & UI2C_ERR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ERR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ACKIF_Msk; - /* Check Acknowledge Interrupt Flag */ - if((u32Mask & UI2C_ACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ACK_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief This function clears the interrupt flag of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details Use this function to clear USCI_I2C interrupt flag when module occurs interrupt event and set flag. - */ -void UI2C_ClearIntFlag(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Clear Time-out Interrupt Flag */ - if(u32Mask & UI2C_TO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; - } - /* Clear Start Condition Received Interrupt Flag */ - if(u32Mask & UI2C_STAR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STARIF_Msk; - } - /* Clear Stop Condition Received Interrupt Flag */ - if(u32Mask & UI2C_STOR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STORIF_Msk; - } - /* Clear Non-Acknowledge Interrupt Flag */ - if(u32Mask & UI2C_NACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_NACKIF_Msk; - } - /* Clear Arbitration Lost Interrupt Flag */ - if(u32Mask & UI2C_ARBLO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ARBLOIF_Msk; - } - /* Clear Error Interrupt Flag */ - if(u32Mask & UI2C_ERR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ERRIF_Msk; - } - /* Clear Acknowledge Interrupt Flag */ - if(u32Mask & UI2C_ACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ACKIF_Msk; - } -} - -/** - * @brief This function returns the data stored in data register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return USCI_I2C data. - * - * @details To read a byte data from USCI_I2C module receive data register. - */ -uint32_t UI2C_GetData(UI2C_T *ui2c) -{ - return (ui2c->RXDAT); -} - -/** - * @brief This function writes a byte data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details To write a byte data to transmit data register to transmit data. - */ -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data) -{ - ui2c->TXDAT = u8Data; -} - -/** - * @brief Configure slave address and enable GC mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channel number [0/1] - * @param[in] u16SlaveAddr The slave address. - * @param[in] u8GCMode GC mode enable or not. Valid values are: - * - \ref UI2C_GCMODE_ENABLE - * - \ref UI2C_GCMODE_DISABLE - * - * @return None - * - * @details To configure USCI_I2C module slave address and GC mode. - */ -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) -{ - if(u8SlaveNo) - { - ui2c->DEVADDR1 = u16SlaveAddr; - } - else - { - ui2c->DEVADDR0 = u16SlaveAddr; - } - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_GCFUNC_Msk) | u8GCMode; -} - -/** - * @brief Configure the mask bit of slave address. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channle number [0/1] - * @param[in] u16SlaveAddrMask The slave address mask. - * - * @return None - * - * @details To configure USCI_I2C module slave address mask bit. - * @note The corresponding address bit is "Don't Care". - */ -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) -{ - if(u8SlaveNo) - { - ui2c->ADDRMSK1 = u16SlaveAddrMask; - } - else - { - ui2c->ADDRMSK0 = u16SlaveAddrMask; - } -} - -/** - * @brief This function enables time-out function and configures timeout counter - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32TimeoutCnt Timeout counter. Valid values are between 0~0x3FF. - * - * @return None - * - * @details To enable USCI_I2C bus time-out function and set time-out counter. - */ -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt) -{ - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_TOCNT_Msk) | (u32TimeoutCnt << UI2C_PROTCTL_TOCNT_Pos); - ui2c->BRGEN = (ui2c->BRGEN & ~UI2C_BRGEN_TMCNTSRC_Msk) | UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function disables time-out function - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C bus time-out function. - */ -void UI2C_DisableTimeout(UI2C_T *ui2c) -{ - ui2c->PROTCTL &= ~UI2C_PROTCTL_TOCNT_Msk; - ui2c->BRGEN &= ~UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function enables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8WakeupMode The wake-up mode selection. Valid values are: - * - \ref UI2C_DATA_TOGGLE_WK - * - \ref UI2C_ADDR_MATCH_WK - * - * @return None - * - * @details To enable USCI_I2C module wake-up function. - */ -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode) -{ - ui2c->WKCTL = (ui2c->WKCTL & ~UI2C_WKCTL_WKADDREN_Msk) | (u8WakeupMode | UI2C_WKCTL_WKEN_Msk); -} - -/** - * @brief This function disables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C module wake-up function. - */ -void UI2C_DisableWakeup(UI2C_T *ui2c) -{ - ui2c->WKCTL &= ~UI2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master write a byte data to Slave. - * - */ - -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master write multi bytes data to Slave. - * - */ - -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - u32txLen++; - } - else if(u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - if(u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFF00U) >> 8U); /* Write Hi byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if(u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if(u32txLen == 2U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data write to in Slave. - * - */ - -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFF00U) >> 8U); /* Write Hi byte data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else if(eEvent == MASTER_SEND_DATA) - { - if(u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u8Addr = 0; - } - else - { - if(u32txLen < u32wLen) - { - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master to read a byte data from Slave. - * - */ -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - eEvent = MASTER_READ_DATA; - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if(eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Err = 1U; - } - else - { - rdata = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if(u8Err) - rdata = 0U; - - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if(u32rxLen < (u32rLen - 1U)) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if(eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if(eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if(eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if(eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if(eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if(u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if(eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if(eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if(eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else if(eEvent == MASTER_SEND_H_RD_ADDRESS) - { - /* SLA+R ACK */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if(u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if(eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address(2 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Addr = 1U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if(eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if(eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFF00U) >> 8U); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if(eEvent == MASTER_SEND_DATA) - { - if(u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if(eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if(u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while(u8Xfering) - { - while(!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if(eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if(eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (uint16_t)(u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if(eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFF00U) >> 8U); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if(eEvent == MASTER_SEND_DATA) - { - if(u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else if(eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if(u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if(eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/**@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USCI_I2C_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_spi.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_spi.c deleted file mode 100644 index 0908e9cb4d6..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_spi.c +++ /dev/null @@ -1,635 +0,0 @@ -/****************************************************************************//** - * @file usci_spi.c - * @version V3.00 - * @brief M2354 series USCI_SPI driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief This function make USCI_SPI module be ready to transfer. - * By default, the USCI_SPI transfer sequence is MSB first, the slave selection - * signal is active low and the automatic slave select function is disabled. In - * Slave mode, the u32BusClock must be NULL and the USCI_SPI clock - * divider setting will be 0. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32MasterSlave Decide the USCI_SPI module is operating in master mode or in slave mode. Valid values are: - * - \ref USPI_SLAVE - * - \ref USPI_MASTER - * @param[in] u32SPIMode Decide the transfer timing. Valid values are: - * - \ref USPI_MODE_0 - * - \ref USPI_MODE_1 - * - \ref USPI_MODE_2 - * - \ref USPI_MODE_3 - * @param[in] u32DataWidth The data width of a USCI_SPI transaction. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock in Hz. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv = 0UL; - uint32_t u32Pclk; - uint32_t u32RetValue = 0UL; - - if((uspi == USPI0) || (uspi == USPI0_NS)) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - if(u32BusClock != 0UL) - { - u32ClkDiv = (uint32_t)((((((u32Pclk / 2UL) * 10UL) / (u32BusClock)) + 5UL) / 10UL) - 1UL); /* Compute proper divider for USCI_SPI clock */ - } - - /* Enable USCI_SPI protocol */ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; - uspi->CTL = 1UL << USPI_CTL_FUNMODE_Pos; - - /* Data format configuration */ - if(u32DataWidth == 16UL) - { - u32DataWidth = 0UL; - } - uspi->LINECTL &= ~USPI_LINECTL_DWIDTH_Msk; - uspi->LINECTL |= (u32DataWidth << USPI_LINECTL_DWIDTH_Pos); - - /* MSB data format */ - uspi->LINECTL &= ~USPI_LINECTL_LSB_Msk; - - /* Set slave selection signal active low */ - if(u32MasterSlave == USPI_MASTER) - { - uspi->LINECTL |= USPI_LINECTL_CTLOINV_Msk; - } - else - { - uspi->CTLIN0 |= USPI_CTLIN0_ININV_Msk; - } - - /* Set operating mode and transfer timing */ - uspi->PROTCTL &= ~(USPI_PROTCTL_SCLKMODE_Msk | USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SLAVE_Msk); - uspi->PROTCTL |= (u32MasterSlave | u32SPIMode); - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - uspi->PROTCTL |= USPI_PROTCTL_PROTEN_Msk; - - if(u32BusClock != 0UL) - { - u32RetValue = (u32Pclk / ((u32ClkDiv + 1UL) << 1UL)); - } - else - { - u32RetValue = 0UL; - } - - return u32RetValue; -} - -/** - * @brief Disable USCI_SPI function mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_Close(USPI_T *uspi) -{ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; -} - -/** - * @brief Clear Rx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearRxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_RXCLR_Msk; -} - -/** - * @brief Clear Tx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearTxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_TXCLR_Msk; -} - -/** - * @brief Disable the automatic slave select function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableAutoSS(USPI_T *uspi) -{ - uspi->PROTCTL &= ~(USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave select function. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SSPinMask This parameter is not used. - * @param[in] u32ActiveLevel The active level of slave select signal. Valid values are: - * - \ref USPI_SS_ACTIVE_HIGH - * - \ref USPI_SS_ACTIVE_LOW - * @return None - */ -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - (void)u32SSPinMask; - uspi->LINECTL = (uspi->LINECTL & ~USPI_LINECTL_CTLOINV_Msk) | u32ActiveLevel; - uspi->PROTCTL |= USPI_PROTCTL_AUTOSS_Msk; -} - -/** - * @brief Set the USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if((uspi == USPI0) || (uspi == USPI0_NS)) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32ClkDiv = (uint32_t)((((((u32Pclk / 2UL) * 10UL) / (u32BusClock)) + 5UL) / 10UL) - 1UL); /* Compute proper divider for USCI_SPI clock */ - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - - return (u32Pclk / ((u32ClkDiv + 1UL) << 1UL)); -} - -/** - * @brief Get the actual frequency of USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Actual USCI_SPI bus clock frequency. - */ -uint32_t USPI_GetBusClock(USPI_T *uspi) -{ - uint32_t u32ClkDiv, u32BusClk; - - u32ClkDiv = (uspi->BRGEN & USPI_BRGEN_CLKDIV_Msk) >> USPI_BRGEN_CLKDIV_Pos; - - if((uspi == USPI0) || (uspi == USPI0_NS)) - { - u32BusClk = (CLK_GetPCLK0Freq() / ((u32ClkDiv + 1UL) << 1UL)); - } - else - { - u32BusClk = (CLK_GetPCLK1Freq() / ((u32ClkDiv + 1UL) << 1UL)); - } - - return u32BusClk; -} - -/** - * @brief Enable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be enabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Enable slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSINAIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSACTIEN_Msk; - } - - /* Enable slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVTOIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVBEIEN_Msk; - } - - /* Enable TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_TXUDRIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_RXOVIEN_Msk; - } - - /* Enable TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXSTIEN_Msk; - } - - /* Enable TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXENDIEN_Msk; - } - - /* Enable RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXSTIEN_Msk; - } - - /* Enable RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXENDIEN_Msk; - } -} - -/** - * @brief Disable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Disable slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSINAIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSACTIEN_Msk; - } - - /* Disable slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVTOIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVBEIEN_Msk; - } - - /* Disable TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_TXUDRIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_RXOVIEN_Msk; - } - - /* Disable TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXSTIEN_Msk; - } - - /* Disable TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXENDIEN_Msk; - } - - /* Disable RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXSTIEN_Msk; - } - - /* Disable RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXENDIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return Interrupt flags of selected sources. - */ -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32ProtStatus, u32BufStatus; - uint32_t u32IntFlag = 0UL; - - u32ProtStatus = uspi->PROTSTS; - u32BufStatus = uspi->BUFSTS; - - /* Check slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SSINAIF_Msk)) - { - u32IntFlag |= USPI_SSINACT_INT_MASK; - } - - /* Check slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SSACTIF_Msk)) - { - u32IntFlag |= USPI_SSACT_INT_MASK; - } - - /* Check slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SLVTOIF_Msk)) - { - u32IntFlag |= USPI_SLVTO_INT_MASK; - } - - /* Check slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_SLVBEIF_Msk)) - { - u32IntFlag |= USPI_SLVBE_INT_MASK; - } - - /* Check TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) && (u32BufStatus & USPI_BUFSTS_TXUDRIF_Msk)) - { - u32IntFlag |= USPI_TXUDR_INT_MASK; - } - - /* Check RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) && (u32BufStatus & USPI_BUFSTS_RXOVIF_Msk)) - { - u32IntFlag |= USPI_RXOV_INT_MASK; - } - - /* Check TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_TXSTIF_Msk)) - { - u32IntFlag |= USPI_TXST_INT_MASK; - } - - /* Check TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_TXENDIF_Msk)) - { - u32IntFlag |= USPI_TXEND_INT_MASK; - } - - /* Check RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_RXSTIF_Msk)) - { - u32IntFlag |= USPI_RXST_INT_MASK; - } - - /* Check RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) && (u32ProtStatus & USPI_PROTSTS_RXENDIF_Msk)) - { - u32IntFlag |= USPI_RXEND_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - /* Clear slave selection signal inactive interrupt flag */ - if(u32Mask & USPI_SSINACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSINAIF_Msk; - } - - /* Clear slave selection signal active interrupt flag */ - if(u32Mask & USPI_SSACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSACTIF_Msk; - } - - /* Clear slave time-out interrupt flag */ - if(u32Mask & USPI_SLVTO_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVTOIF_Msk; - } - - /* Clear slave bit count error interrupt flag */ - if(u32Mask & USPI_SLVBE_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVBEIF_Msk; - } - - /* Clear TX under run interrupt flag */ - if(u32Mask & USPI_TXUDR_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_TXUDRIF_Msk; - } - - /* Clear RX overrun interrupt flag */ - if(u32Mask & USPI_RXOV_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_RXOVIF_Msk; - } - - /* Clear TX start interrupt flag */ - if(u32Mask & USPI_TXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXSTIF_Msk; - } - - /* Clear TX end interrupt flag */ - if(u32Mask & USPI_TXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXENDIF_Msk; - } - - /* Clear RX start interrupt flag */ - if(u32Mask & USPI_RXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXSTIF_Msk; - } - - /* Clear RX end interrupt flag */ - if(u32Mask & USPI_RXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXENDIF_Msk; - } -} - -/** - * @brief Get USCI_SPI status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref USPI_BUSY_MASK - * - \ref USPI_RX_EMPTY_MASK - * - \ref USPI_RX_FULL_MASK - * - \ref USPI_TX_EMPTY_MASK - * - \ref USPI_TX_FULL_MASK - * - \ref USPI_SSLINE_STS_MASK - * @return Flags of selected sources. - */ -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32ProtStatus, u32BufStatus; - uint32_t u32Flag = 0UL; - - u32ProtStatus = uspi->PROTSTS; - u32BufStatus = uspi->BUFSTS; - - /* Check busy status */ - if((u32Mask & USPI_BUSY_MASK) && (u32ProtStatus & USPI_PROTSTS_BUSY_Msk)) - { - u32Flag |= USPI_BUSY_MASK; - } - - /* Check RX empty flag */ - if((u32Mask & USPI_RX_EMPTY_MASK) && (u32BufStatus & USPI_BUFSTS_RXEMPTY_Msk)) - { - u32Flag |= USPI_RX_EMPTY_MASK; - } - - /* Check RX full flag */ - if((u32Mask & USPI_RX_FULL_MASK) && (u32BufStatus & USPI_BUFSTS_RXFULL_Msk)) - { - u32Flag |= USPI_RX_FULL_MASK; - } - - /* Check TX empty flag */ - if((u32Mask & USPI_TX_EMPTY_MASK) && (u32BufStatus & USPI_BUFSTS_TXEMPTY_Msk)) - { - u32Flag |= USPI_TX_EMPTY_MASK; - } - - /* Check TX full flag */ - if((u32Mask & USPI_TX_FULL_MASK) && (u32BufStatus & USPI_BUFSTS_TXFULL_Msk)) - { - u32Flag |= USPI_TX_FULL_MASK; - } - - /* Check USCI_SPI_SS line status */ - if((u32Mask & USPI_SSLINE_STS_MASK) && (u32ProtStatus & USPI_PROTSTS_SSLINE_Msk)) - { - u32Flag |= USPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - -/** - * @brief Enable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_EnableWakeup(USPI_T *uspi) -{ - uspi->WKCTL |= USPI_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableWakeup(USPI_T *uspi) -{ - uspi->WKCTL &= ~USPI_WKCTL_WKEN_Msk; -} - -/**@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USCI_SPI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_uart.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_uart.c deleted file mode 100644 index f4c25910b40..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_usci_uart.c +++ /dev/null @@ -1,729 +0,0 @@ -/**************************************************************************//** - * @file usci_uart.c - * @version V3.00 - * @brief M2354 series USCI UART (UUART) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - -/** - * @brief Clear USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to clear USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -void UUART_ClearIntFlag(UUART_T* uuart, uint32_t u32Mask) -{ - - if(u32Mask & UUART_ABR_INT_MASK) /* Clear Auto-baud Rate Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_ABRDETIF_Msk; - } - - if(u32Mask & UUART_RLS_INT_MASK) /* Clear Receive Line Status Interrupt */ - { - uuart->PROTSTS = (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk); - } - - if(u32Mask & UUART_BUF_RXOV_INT_MASK) /* Clear Receive Buffer Over-run Error Interrupt */ - { - uuart->BUFSTS = UUART_BUFSTS_RXOVIF_Msk; - } - - if(u32Mask & UUART_TXST_INT_MASK) /* Clear Transmit Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXSTIF_Msk; - } - - if(u32Mask & UUART_TXEND_INT_MASK) /* Clear Transmit End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXENDIF_Msk; - } - - if(u32Mask & UUART_RXST_INT_MASK) /* Clear Receive Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXSTIF_Msk; - } - - if(u32Mask & UUART_RXEND_INT_MASK) /* Clear Receive End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXENDIF_Msk; - } - -} - - -/** - * @brief Get USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details The function is used to get USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -uint32_t UUART_GetIntFlag(UUART_T* uuart, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0ul; - uint32_t u32Tmp1, u32Tmp2; - - /* Check Auto-baud Rate Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_ABR_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_ABRDETIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_ABR_INT_MASK; - } - - /* Check Receive Line Status Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RLS_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk)); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RLS_INT_MASK; - } - - /* Check Receive Buffer Over-run Error Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_BUF_RXOV_INT_MASK); - u32Tmp2 = (uuart->BUFSTS & UUART_BUFSTS_RXOVIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_BUF_RXOV_INT_MASK; - } - - /* Check Transmit Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXSTIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXST_INT_MASK; - } - - /* Check Transmit End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXENDIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXEND_INT_MASK; - } - - /* Check Receive Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXSTIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXST_INT_MASK; - } - - /* Check Receive End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXENDIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXEND_INT_MASK; - } - - return u32IntFlag; -} - - -/** - * @brief Disable USCI_UART function mode - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART function mode. - */ -void UUART_Close(UUART_T* uuart) -{ - uuart->CTL = 0UL; -} - - -/** - * @brief Disable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to disabled USCI_UART related interrupts specified by u32Mask parameter. - */ -void UUART_DisableInt(UUART_T* uuart, uint32_t u32Mask) -{ - - /* Disable Auto-baud rate interrupt flag */ - if((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_ABRIEN_Msk; - } - - /* Disable receive line status interrupt flag */ - if((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_RLSIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL &= ~UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Disable TX start interrupt flag */ - if((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXSTIEN_Msk; - } - - /* Disable TX end interrupt flag */ - if((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXENDIEN_Msk; - } - - /* Disable RX start interrupt flag */ - if((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXSTIEN_Msk; - } - - /* Disable RX end interrupt flag */ - if((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Enable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to enable USCI_UART related interrupts specified by u32Mask parameter.. - */ -void UUART_EnableInt(UUART_T* uuart, uint32_t u32Mask) -{ - /* Enable Auto-baud rate interrupt flag */ - if((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_ABRIEN_Msk; - } - - /* Enable receive line status interrupt flag */ - if((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_RLSIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL |= UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Enable TX start interrupt flag */ - if((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXSTIEN_Msk; - } - - /* Enable TX end interrupt flag */ - if((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXENDIEN_Msk; - } - - /* Enable RX start interrupt flag */ - if((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXSTIEN_Msk; - } - - /* Enable RX end interrupt flag */ - if((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Open and set USCI_UART function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The baud rate of USCI_UART module. - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to enable USCI_UART function and set baud-rate. - */ -uint32_t UUART_Open(UUART_T* uuart, uint32_t u32baudrate) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - if((uuart == UUART0) || (uuart == UUART0_NS)) - { - u32PCLKFreq = CLK_GetPCLK0Freq(); - } - else - { - u32PCLKFreq = CLK_GetPCLK1Freq(); - } - - /* Calculate baud rate divider */ - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div + 1ul)); - - if(u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - if(u32Div >= 65536ul) - { - - /* Set the smallest baud rate that USCI_UART can generate */ - u32PDSCnt = 0x4ul; - u32MinDSCnt = 0x10ul; - u32MinClkDiv = 0x400ul; - - } - else - { - - u32Tmp = 0x400ul * 0x10ul; - for(u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if(u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if(u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - u32Tmp = 0ul; - - for(u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - - u32ClkDiv = u32Div / u32DSCnt; - - if(u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv + 1ul) * u32DSCnt) - u32Div; - } - - if(u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if(u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if(u32Min == 0ul) - { - break; - } - } - } - - } - - /* Enable USCI_UART protocol */ - uuart->CTL &= ~UUART_CTL_FUNMODE_Msk; - uuart->CTL = 2ul << UUART_CTL_FUNMODE_Pos; - - /* Set USCI_UART line configuration */ - uuart->LINECTL = UUART_WORD_LEN_8 | UUART_LINECTL_LSB_Msk; - uuart->DATIN0 = (2ul << UUART_DATIN0_EDGEDET_Pos); /* Set falling edge detection */ - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv - 1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt - 1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt - 1ul) << UUART_BRGEN_PDSCNT_Pos); - - uuart->PROTCTL |= UUART_PROTCTL_PROTEN_Msk; - - return (u32PCLKFreq / u32PDSCnt / u32MinDSCnt / u32MinClkDiv); -} - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive buffer. - * @param[in] u32ReadBytes The read bytes number of data. - * - * @return Receive byte count - * - * @details The function is used to read Rx data from RX buffer and the data will be stored in pu8RxBuf. - */ -uint32_t UUART_Read(UUART_T* uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - - for(u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while(uuart->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - break; - } - } - - if(u32delayno >= 0x40000000ul) - { - break; - } - - pu8RxBuf[u32Count] = (uint8_t)uuart->RXDAT; /* Get Data from USCI RX */ - } - - return u32Count; - -} - - -/** - * @brief Set USCI_UART line configuration - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The register value of baud rate of USCI_UART module. - * If u32baudrate = 0, USCI_UART baud rate will not change. - * @param[in] u32data_width The data length of USCI_UART module. - * - \ref UUART_WORD_LEN_6 - * - \ref UUART_WORD_LEN_7 - * - \ref UUART_WORD_LEN_8 - * - \ref UUART_WORD_LEN_9 - * @param[in] u32parity The parity setting (none/odd/even) of USCI_UART module. - * - \ref UUART_PARITY_NONE - * - \ref UUART_PARITY_ODD - * - \ref UUART_PARITY_EVEN - * @param[in] u32stop_bits The stop bit length (1/2 bit) of USCI_UART module. - * - \ref UUART_STOP_BIT_1 - * - \ref UUART_STOP_BIT_2 - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to config USCI_UART line setting. - */ -uint32_t UUART_SetLine_Config(UUART_T* uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - if((uuart == UUART0) || (uuart == UUART0_NS)) - { - u32PCLKFreq = CLK_GetPCLK0Freq(); - } - else /* UUART1 */ - { - u32PCLKFreq = CLK_GetPCLK1Freq(); - } - - if(u32baudrate != 0ul) - { - - /* Calculate baud rate divider */ - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div + 1ul)); - - if(u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - if(u32Div >= 65536ul) - { - - /* Set the smallest baud rate that USCI_UART can generate */ - u32PDSCnt = 0x4ul; - u32MinDSCnt = 0x10ul; - u32MinClkDiv = 0x400ul; - - } - else - { - - u32Tmp = 0x400ul * 0x10ul; - for(u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if(u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if(u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - - for(u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - u32ClkDiv = u32Div / u32DSCnt; - - if(u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv + 1ul) * u32DSCnt) - u32Div; - } - - if(u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if(u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if(u32Min == 0ul) - { - break; - } - } - } - - } - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv - 1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt - 1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt - 1ul) << UUART_BRGEN_PDSCNT_Pos); - } - else - { - u32PDSCnt = ((uuart->BRGEN & UUART_BRGEN_PDSCNT_Msk) >> UUART_BRGEN_PDSCNT_Pos) + 1ul; - u32MinDSCnt = ((uuart->BRGEN & UUART_BRGEN_DSCNT_Msk) >> UUART_BRGEN_DSCNT_Pos) + 1ul; - u32MinClkDiv = ((uuart->BRGEN & UUART_BRGEN_CLKDIV_Msk) >> UUART_BRGEN_CLKDIV_Pos) + 1ul; - } - - /* Set USCI_UART line configuration */ - uuart->LINECTL = (uuart->LINECTL & ~UUART_LINECTL_DWIDTH_Msk) | u32data_width; - uuart->PROTCTL = (uuart->PROTCTL & ~(UUART_PROTCTL_STICKEN_Msk | UUART_PROTCTL_EVENPARITY_Msk | - UUART_PROTCTL_PARITYEN_Msk)) | u32parity; - uuart->PROTCTL = (uuart->PROTCTL & ~UUART_PROTCTL_STOPB_Msk) | u32stop_bits; - - return (u32PCLKFreq / u32PDSCnt / u32MinDSCnt / u32MinClkDiv); -} - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8TxBuf The buffer to send the data to USCI transmission buffer. - * @param[out] u32WriteBytes The byte number of data. - * - * @return Transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by USCI_UART. - */ -uint32_t UUART_Write(UUART_T* uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - - for(u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while((uuart->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) == 0ul) /* Wait Tx empty */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - break; - } - } - - if(u32delayno >= 0x40000000ul) - { - break; - } - - uuart->TXDAT = (uint8_t)pu8TxBuf[u32Count]; /* Send USCI_UART Data to buffer */ - } - - return u32Count; -} - - -/** - * @brief Enable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32WakeupMode The wakeup mode of USCI_UART module. -* - \ref UUART_PROTCTL_DATWKEN_Msk : Data wake-up Mode -* - \ref UUART_PROTCTL_CTSWKEN_Msk : nCTS wake-up Mode - * - * @return None - * - * @details The function is used to enable Wake-up function of USCI_UART. - */ -void UUART_EnableWakeup(UUART_T* uuart, uint32_t u32WakeupMode) -{ - uuart->PROTCTL |= u32WakeupMode; - uuart->WKCTL |= UUART_WKCTL_WKEN_Msk; -} - - -/** - * @brief Disable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable Wake-up function of USCI_UART. - */ -void UUART_DisableWakeup(UUART_T* uuart) -{ - uuart->PROTCTL &= ~(UUART_PROTCTL_DATWKEN_Msk | UUART_PROTCTL_CTSWKEN_Msk); - uuart->WKCTL &= ~UUART_WKCTL_WKEN_Msk; -} - -/** - * @brief Enable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to enable USCI_UART auto flow control. - */ -void UUART_EnableFlowCtrl(UUART_T* uuart) -{ - /* Set RTS signal is low level active */ - uuart->LINECTL &= ~UUART_LINECTL_CTLOINV_Msk; - - /* Set CTS signal is low level active */ - uuart->CTLIN0 &= ~UUART_CTLIN0_ININV_Msk; - - /* Enable CTS and RTS auto flow control function */ - uuart->PROTCTL |= UUART_PROTCTL_RTSAUTOEN_Msk | UUART_PROTCTL_CTSAUTOEN_Msk; -} - -/** - * @brief Disable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART auto flow control. - */ -void UUART_DisableFlowCtrl(UUART_T* uuart) -{ - /* Disable CTS and RTS auto flow control function */ - uuart->PROTCTL &= ~(UUART_PROTCTL_RTSAUTOEN_Msk | UUART_PROTCTL_CTSAUTOEN_Msk); -} - - - - -/**@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group USCI_UART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wdt.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wdt.c deleted file mode 100644 index 6faa0701962..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wdt.c +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************//** - * @file wdt.c - * @version V3.00 - * @brief Watchdog Timer(WDT) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Initialize WDT and start counting - * - * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: - * - \ref WDT_TIMEOUT_2POW4 - * - \ref WDT_TIMEOUT_2POW6 - * - \ref WDT_TIMEOUT_2POW8 - * - \ref WDT_TIMEOUT_2POW10 - * - \ref WDT_TIMEOUT_2POW12 - * - \ref WDT_TIMEOUT_2POW14 - * - \ref WDT_TIMEOUT_2POW16 - * - \ref WDT_TIMEOUT_2POW18 - * - \ref WDT_TIMEOUT_2POW20 - * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: - * - \ref WDT_RESET_DELAY_1026CLK - * - \ref WDT_RESET_DELAY_130CLK - * - \ref WDT_RESET_DELAY_18CLK - * - \ref WDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable WDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - */ -void WDT_Open(uint32_t u32TimeoutInterval, - uint32_t u32ResetDelay, - uint32_t u32EnableReset, - uint32_t u32EnableWakeup) -{ - WDT->ALTCTL = u32ResetDelay; - - WDT->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk | - (u32EnableReset << WDT_CTL_RSTEN_Pos) | - (u32EnableWakeup << WDT_CTL_WKEN_Pos); - - while((WDT->CTL & WDT_CTL_SYNC_Msk) == WDT_CTL_SYNC_Msk) {} /* Wait enable WDTEN bit completed, it needs 2 * WDT_CLK. */ -} - -/**@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wwdt.c b/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wwdt.c deleted file mode 100644 index cdd9c774472..00000000000 --- a/bsp/nuvoton/libraries/m2354/StdDriver/src/nu_wwdt.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************//** - * @file wwdt.c - * @version V3.00 - * @brief Window Watchdog Timer(WWDT) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Open WWDT and start counting - * - * @param[in] u32PreScale Pre-scale setting of WWDT counter. Valid values are: - * - \ref WWDT_PRESCALER_1 - * - \ref WWDT_PRESCALER_2 - * - \ref WWDT_PRESCALER_4 - * - \ref WWDT_PRESCALER_8 - * - \ref WWDT_PRESCALER_16 - * - \ref WWDT_PRESCALER_32 - * - \ref WWDT_PRESCALER_64 - * - \ref WWDT_PRESCALER_128 - * - \ref WWDT_PRESCALER_192 - * - \ref WWDT_PRESCALER_256 - * - \ref WWDT_PRESCALER_384 - * - \ref WWDT_PRESCALER_512 - * - \ref WWDT_PRESCALER_768 - * - \ref WWDT_PRESCALER_1024 - * - \ref WWDT_PRESCALER_1536 - * - \ref WWDT_PRESCALER_2048 - * @param[in] u32CmpValue Setting the window compared value. Valid values are between 0x0 to 0x3F. - * @param[in] u32EnableInt Enable WWDT time-out interrupt function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WWDT module start counting with different counter period by pre-scale setting and compared window value. - * @note Application can call this function only once after boot up. - */ -void WWDT_Open(uint32_t u32PreScale, - uint32_t u32CmpValue, - uint32_t u32EnableInt) -{ - WWDT->CTL = u32PreScale | - (u32CmpValue << WWDT_CTL_CMPDAT_Pos) | - ((u32EnableInt == (uint32_t)TRUE) ? WWDT_CTL_INTEN_Msk : 0UL) | - WWDT_CTL_WWDTEN_Msk; -} - -/**@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WWDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/SConscript b/bsp/nuvoton/libraries/m2354/USBHostLib/SConscript deleted file mode 100644 index 18b78e6e3d3..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -group = [] -if GetDepend('BSP_USING_USBH'): - src = Glob('*src/*.c') + Glob('src/*.cpp') - CPPPATH = [cwd + '/inc'] - group = DefineGroup('m2354_usbhostlib', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/config.h b/bsp/nuvoton/libraries/m2354/USBHostLib/inc/config.h deleted file mode 100644 index 47ca7d9d2aa..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/config.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file config.h - * @version V1.00 - * @brief This header file defines the configuration of USB Host library. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_CONFIG_H_ -#define _USBH_CONFIG_H_ - -/// @cond HIDDEN_SYMBOLS - -#include -#include -/*----------------------------------------------------------------------------------------*/ -/* Hardware settings */ -/*----------------------------------------------------------------------------------------*/ -#define HCLK_MHZ 192 /* used for loop-delay. must be larger than - true HCLK clock MHz */ - -#define ENABLE_OHCI_IRQ() NVIC_EnableIRQ(USBH_IRQn) -#define DISABLE_OHCI_IRQ() NVIC_DisableIRQ(USBH_IRQn) - -#define ENABLE_OHCI /* Enable OHCI host controller */ - -#define OHCI_ISO_DELAY 4 /* preserved number frames while scheduling - OHCI isochronous transfer */ - -#define MAX_DESC_BUFF_SIZE 512 /* To hold the configuration descriptor, USB - core will allocate a buffer with this size - for each connected device. USB core does - not release it until device disconnected. */ - -/*----------------------------------------------------------------------------------------*/ -/* Memory allocation settings */ -/*----------------------------------------------------------------------------------------*/ - -#define STATIC_MEMORY_ALLOC 0 /* pre-allocate static memory blocks. No dynamic memory aloocation. - But the maximum number of connected devices and transfers are - limited. */ - -#define MAX_UDEV_DRIVER 8 /*!< Maximum number of registered drivers */ -#define MAX_ALT_PER_IFACE 8 /*!< maximum number of alternative interfaces per interface */ -#define MAX_EP_PER_IFACE 6 /*!< maximum number of endpoints per interface */ -#define MAX_HUB_DEVICE 8 /*!< Maximum number of hub devices */ - -/* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI - are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE. - May allocate one or more units depend on hardware descriptor type. */ - -#define MEM_POOL_UNIT_SIZE 64 /*!< A fixed hard coding setting. Do not change it! */ -#define MEM_POOL_UNIT_NUM 256 /*!< Increase this or heap size if memory allocate failed. */ - -/*----------------------------------------------------------------------------------------*/ -/* Re-defined staff for various compiler */ -/*----------------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ - #define __inline inline -#endif - - -/*----------------------------------------------------------------------------------------*/ -/* Debug settings */ -/*----------------------------------------------------------------------------------------*/ -#define ENABLE_ERROR_MSG /* enable debug messages */ -#define ENABLE_DEBUG_MSG /* enable debug messages */ -//#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */ -//#define DUMP_DESCRIPTOR /* dump descriptors */ - -#ifdef ENABLE_ERROR_MSG - #define USB_error rt_kprintf -#else - #define USB_error(...) -#endif - -#ifdef ENABLE_DEBUG_MSG - #define USB_debug rt_kprintf - #ifdef ENABLE_VERBOSE_DEBUG - #define USB_vdebug rt_kprintf - #else - #define USB_vdebug(...) - #endif -#else - #define USB_debug(...) - #define USB_vdebug(...) -#endif - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_CONFIG_H_ */ - -/*** (C) COPYRIGHT 2019-2020 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/hub.h b/bsp/nuvoton/libraries/m2354/USBHostLib/inc/hub.h deleted file mode 100644 index 11a83dd09eb..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/hub.h +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************//** - * @file hub.h - * @version V1.00 - * @brief USB Host hub class driver header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_HUB_H_ -#define _USBH_HUB_H_ - - -/// @cond HIDDEN_SYMBOLS - - -/*--------------------------------------------------------------------------*/ -/* Hub class feature selectors (Table 11-17) */ -/*--------------------------------------------------------------------------*/ -#define FS_C_HUB_LOCAL_POWER 0 -#define FS_C_HUB_OVER_CURRENT 1 - -#define FS_PORT_CONNECTION 0 -#define FS_PORT_ENABLE 1 -#define FS_PORT_SUSPEND 2 -#define FS_PORT_OVER_CURRENT 3 -#define FS_PORT_RESET 4 -#define FS_PORT_POWER 8 -#define FS_C_PORT_CONNECTION 16 -#define FS_C_PORT_ENABLE 17 -#define FS_C_PORT_SUSPEND 18 -#define FS_C_PORT_OVER_CURRENT 19 -#define FS_C_PORT_RESET 20 - -/*--------------------------------------------------------------------------*/ -/* Hub/Port staus and change bits */ -/*--------------------------------------------------------------------------*/ -#define HUB_S_LOCAL_POWER (1UL << 0) -#define HUB_S_OVERCURRENT (1UL << 1) - -#define HUB_C_LOCAL_POWER (1UL << 0) -#define HUB_C_OVERCURRENT (1UL << 1) - -#define PORT_S_CONNECTION (1UL << 0) -#define PORT_S_ENABLE (1UL << 1) -#define PORT_S_SUSPEND (1UL << 2) -#define PORT_S_OVERCURRENT (1UL << 3) -#define PORT_S_RESET (1UL << 4) -#define PORT_S_PORT_POWER (1UL << 8) -#define PORT_S_LOW_SPEED (1UL << 9) -#define PORT_S_HIGH_SPEED (1UL << 10) -#define PORT_S_TEST (1UL << 11) -#define PORT_S_INDICATOR (1UL << 12) - -#define PORT_C_CONNECTION (1UL << 0) -#define PORT_C_ENABLE (1UL << 1) -#define PORT_C_SUSPEND (1UL << 2) -#define PORT_C_OVERCURRENT (1UL << 3) -#define PORT_C_RESET (1UL << 4) - - -/*--------------------------------------------------------------------------*/ -/* Hub descriptor */ -/*--------------------------------------------------------------------------*/ -#ifdef __ICCARM__ -typedef struct -{ - __packed uint8_t bDescLength; - __packed uint8_t bDescriptorType; - __packed uint8_t bNbrPorts; - __packed uint16_t wHubCharacteristics; - __packed uint8_t bPwrOn2PwrGood; - __packed uint8_t bHubContrCurrent; - __packed uint8_t bDeviceRemovble; - __packed uint8_t PortPwrCtrlMask[16]; -} DESC_HUB_T; -#else -typedef struct __attribute__((__packed__)) -{ - uint8_t bDescLength; - uint8_t bDescriptorType; - uint8_t bNbrPorts; - uint16_t wHubCharacteristics; - uint8_t bPwrOn2PwrGood; - uint8_t bHubContrCurrent; - uint8_t bDeviceRemovble; - uint8_t PortPwrCtrlMask[16]; -} DESC_HUB_T; -#endif - -/* - * wHubCharacteristics bit field mask - */ -#define HUB_CHAR_LPSM 0x0003 /* 00b: global port power, 01b: per port power, 1x: reserved */ -#define HUB_CHAR_COMPOUND 0x0004 /* 1: is part of a compond device, 0: is not. */ -#define HUB_CHAR_OCPM 0x0018 /* 00b: global over-current protection, 01b: per port, 1x: reserved */ -#define HUB_CHAR_TTTT 0x0060 /* TT think time. 00b: 8FS, 01b: 16FS, 10b: 24FS, 11b: 32FS */ -#define HUB_CHAR_PORTIND 0x0080 /* 1: port indicator (LED) supported, 0: not */ - -/* port indicator status selectors */ -#define HUB_LED_AUTO 0 -#define HUB_LED_AMBER 1 -#define HUB_LED_GREEN 2 -#define HUB_LED_OFF 3 - - -/*--------------------------------------------------------------------------*/ -/* Port reset retry and time-out settings */ -/*--------------------------------------------------------------------------*/ -#define PORT_RESET_RETRY 3 /* port reset retry times */ -#define PORT_RESET_TIME_MS 50 /* port reset time (ms) */ -#define PORT_RESET_RETRY_INC_MS 250 /* increased reset time (ms) after reset failed */ - - -#define HUB_STATUS_MAX_BYTE 2 /* maximum number of interrupt-in status bytes */ -/* 2 can support up to 16 port hubs */ -/* 4 can support up to 32 port hubs */ -/* Note!! If modeifed to 4, "uint16_t sc_bitmap" */ -/* MUST be changed as "uint32_t sc_bitmap" */ -typedef struct hub_dev_t -{ - IFACE_T *iface; /*!< Interface device of this hub \hideinitializer */ - UTR_T *utr; /*!< Interrupt in UTR of this hub \hideinitializer */ - uint8_t buff[HUB_STATUS_MAX_BYTE]; /*!< Interrupt in buffer \hideinitializer */ - uint16_t sc_bitmap; /*!< Hub and Port Status Change Bitmap \hideinitializer */ - uint8_t bNbrPorts; /*!< Number of ports \hideinitializer */ - uint8_t bPwrOn2PwrGood; /*!< Hub power on to power good time \hideinitializer */ - char pos_id[MAX_HUB_DEVICE+1]; /*!< Hub position identifier \hideinitializer */ - int (*port_reset)(struct hub_dev_t *hub, int port);/*!< Port reset function \hideinitializer */ - UDEV_T *children; /*!< Child device list. \hideinitializer */ -} HUB_DEV_T; - - -/// @endcond - -#endif /* _USBH_HUB_H_ */ diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/ohci.h b/bsp/nuvoton/libraries/m2354/USBHostLib/inc/ohci.h deleted file mode 100644 index d39d9359022..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/ohci.h +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************//** - * @file ohci.h - * @version V1.00 - * @brief USB OHCI host controller driver header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_OHCI_H_ -#define _USBH_OHCI_H_ - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; - -/* OHCI CONTROL AND STATUS REGISTER MASKS */ - -/* - * Host controller functional state. - * for HCFS(HcControl[7:6]) - */ -#define HCFS_RESET (0UL << USBH_HcControl_HCFS_Pos) -#define HCFS_RESUME (1UL << USBH_HcControl_HCFS_Pos) -#define HCFS_OPER (2UL << USBH_HcControl_HCFS_Pos) -#define HCFS_SUSPEND (3UL << USBH_HcControl_HCFS_Pos) - - -/*----------------------------------------------------------------------------------------*/ -/* Endpoint descriptor */ -/*----------------------------------------------------------------------------------------*/ -typedef struct ed_t -{ - /* OHCI spec. Endpoint descriptor */ - uint32_t Info; - uint32_t TailP; - uint32_t HeadP; - uint32_t NextED; - /* The following members are used by USB Host libary. */ - uint8_t bInterval; - uint16_t next_sf; /* for isochronous transfer, recording the next SF */ - struct ed_t * next; /* point to the next ED in remove list */ -} ED_T; - -#define ED_CTRL_FA_Pos 0 /* Info[6:0] - Function address */ -#define ED_CTRL_EN_Pos 7 /* Info[10:7] - Endpoint number */ -#define ED_CTRL_DIR_Pos 11 /* Info[12:11] - Direction */ -#define ED_CTRL_MPS_Pos 16 /* Info[26:16] - Maximum packet size */ - -#define ED_FUNC_ADDR_Msk (0x7f) -#define ED_EP_ADDR_Msk (0xf<<7) -#define ED_DIR_Msk (0x3<<11) -#define ED_SPEED_Msk (1<<13) -#define ED_MAX_PK_SIZE_Msk (0x7ff<<16) - -#define ED_DIR_BY_TD (0<>28) & 0x0F) -#define TD_CC_SET(td, cc) (td) = ((td) & 0x0FFFFFFF) | (((cc) & 0x0F) << 28) -#define TD_T_DATA0 0x02000000 -#define TD_T_DATA1 0x03000000 -#define TD_R 0x00040000 -#define TD_DP 0x00180000 -#define TD_DP_IN 0x00100000 -#define TD_DP_OUT 0x00080000 -#define MAXPSW 8 -/* steel TD reserved bits to keep driver data */ -#define TD_TYPE_Msk (0x3<<16) -#define TD_TYPE_CTRL (0x0<<16) -#define TD_TYPE_BULK (0x1<<16) -#define TD_TYPE_INT (0x2<<16) -#define TD_TYPE_ISO (0x3<<16) -#define TD_CTRL_Msk (0x7<<15) -#define TD_CTRL_DATA (1<<15) - - -/* - * The HCCA (Host Controller Communications Area) is a 256 byte - * structure defined in the OHCI spec. that the host controller is - * told the base address of. It must be 256-byte aligned. - */ -typedef struct -{ - uint32_t int_table[32]; /* Interrupt ED table */ - uint16_t frame_no; /* current frame number */ - uint16_t pad1; /* set to 0 on each frame_no change */ - uint32_t done_head; /* info returned for an interrupt */ - uint8_t reserved_for_hc[116]; -} HCCA_T; - - -/// @endcond - -#endif /* _USBH_OHCI_H_ */ diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/usb.h b/bsp/nuvoton/libraries/m2354/USBHostLib/inc/usb.h deleted file mode 100644 index b64eacd33cf..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/usb.h +++ /dev/null @@ -1,470 +0,0 @@ -/**************************************************************************//** - * @file usb.h - * @version V1.00 - * @brief USB Host library header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_H_ -#define _USBH_H_ - -#include "config.h" -#include "usbh_lib.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct hub_dev_t; -struct iface_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------*/ -/* USB device request setup packet */ -/*----------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ -typedef struct -{ - __packed uint8_t bmRequestType; - __packed uint8_t bRequest; - __packed uint16_t wValue; - __packed uint16_t wIndex; - __packed uint16_t wLength; -} DEV_REQ_T; -#else -typedef struct __attribute__((__packed__)) -{ - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} -DEV_REQ_T; -#endif - -/* - * bmRequestType[7] - Data transfer direction - */ -#define REQ_TYPE_OUT 0x00 -#define REQ_TYPE_IN 0x80 -/* - * bmRequestType[6:5] - Type - */ -#define REQ_TYPE_STD_DEV 0x00 -#define REQ_TYPE_CLASS_DEV 0x20 -#define REQ_TYPE_VENDOR_DEV 0x40 -/* - * bmRequestType[4:0] - Recipient - */ -#define REQ_TYPE_TO_DEV 0x00 -#define REQ_TYPE_TO_IFACE 0x01 -#define REQ_TYPE_TO_EP 0x02 -#define REQ_TYPE_TO_OTHER 0x03 -/* - * Standard Requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_SET_INTERFACE 0x0B -/* - * Descriptor Types - */ -#define USB_DT_STANDARD 0x00 -#define USB_DT_CLASS 0x20 -#define USB_DT_VENDOR 0x40 - -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIGURATION 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 -#define USB_DT_DEVICE_QUALIFIER 0x06 -#define USB_DT_OTHER_SPEED_CONF 0x07 -#define USB_DT_IFACE_POWER 0x08 - - - -/*----------------------------------------------------------------------------------*/ -/* USB standard descriptors */ -/*----------------------------------------------------------------------------------*/ - -/* Descriptor header */ -#ifdef __ICCARM__ -typedef struct -{ - __packed uint8_t bLength; - __packed uint8_t bDescriptorType; -} DESC_HDR_T; -#else -typedef struct __attribute__((__packed__)) -{ - uint8_t bLength; - uint8_t bDescriptorType; -} -DESC_HDR_T; -#endif - -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ -typedef struct /*!< device descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of device descriptor */ - __packed uint8_t bDescriptorType; /*!< Device descriptor type */ - __packed uint16_t bcdUSB; /*!< USB version number */ - __packed uint8_t bDeviceClass; /*!< Device class code */ - __packed uint8_t bDeviceSubClass; /*!< Device subclass code */ - __packed uint8_t bDeviceProtocol; /*!< Device protocol code */ - __packed uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - __packed uint16_t idVendor; /*!< Vendor ID */ - __packed uint16_t idProduct; /*!< Product ID */ - __packed uint16_t bcdDevice; /*!< Device ID */ - __packed uint8_t iManufacturer; /*!< Manufacture description string ID */ - __packed uint8_t iProduct; /*!< Product description string ID */ - __packed uint8_t iSerialNumber; /*!< Serial number description string ID */ - __packed uint8_t bNumConfigurations; /*!< Total number of configurations */ -} DESC_DEV_T; /*!< device descriptor structure */ -#else -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) /*!< device descriptor structure */ -{ - uint8_t bLength; /*!< Length of device descriptor */ - uint8_t bDescriptorType; /*!< Device descriptor type */ - uint16_t bcdUSB; /*!< USB version number */ - uint8_t bDeviceClass; /*!< Device class code */ - uint8_t bDeviceSubClass; /*!< Device subclass code */ - uint8_t bDeviceProtocol; /*!< Device protocol code */ - uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - uint16_t idVendor; /*!< Vendor ID */ - uint16_t idProduct; /*!< Product ID */ - uint16_t bcdDevice; /*!< Device ID */ - uint8_t iManufacturer; /*!< Manufacture description string ID */ - uint8_t iProduct; /*!< Product description string ID */ - uint8_t iSerialNumber; /*!< Serial number description string ID */ - uint8_t bNumConfigurations; /*!< Total number of configurations */ -} -DESC_DEV_T; /*!< device descriptor structure */ -#endif - -/* - * Configuration Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_config_descriptor /*!< Configuration descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of configuration descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint16_t wTotalLength; /*!< Total length of this configuration */ - __packed uint8_t bNumInterfaces; /*!< Total number of interfaces */ - __packed uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - __packed uint8_t iConfiguration; /*!< String descriptor ID */ - __packed uint8_t bmAttributes; /*!< Configuration characteristics */ - __packed uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_config_descriptor /*!< Configuration descriptor structure */ -{ - uint8_t bLength; /*!< Length of configuration descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint16_t wTotalLength; /*!< Total length of this configuration */ - uint8_t bNumInterfaces; /*!< Total number of interfaces */ - uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - uint8_t iConfiguration; /*!< String descriptor ID */ - uint8_t bmAttributes; /*!< Configuration characteristics */ - uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ -#endif - -/* - * Interface Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_interface_descriptor /*!< Interface descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of interface descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint8_t bInterfaceNumber; /*!< Interface number */ - __packed uint8_t bAlternateSetting;/*!< Alternate setting number */ - __packed uint8_t bNumEndpoints; /*!< Number of endpoints */ - __packed uint8_t bInterfaceClass; /*!< Interface class code */ - __packed uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - __packed uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - __packed uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_interface_descriptor /*!< Interface descriptor structure */ -{ - uint8_t bLength; /*!< Length of interface descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bInterfaceNumber; /*!< Interface number */ - uint8_t bAlternateSetting; /*!< Alternate setting number */ - uint8_t bNumEndpoints; /*!< Number of endpoints */ - uint8_t bInterfaceClass; /*!< Interface class code */ - uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ -#endif - -/* - * Interface descriptor bInterfaceClass[7:0] - */ -#if 0 -#define USB_CLASS_AUDIO 0x01 -#define USB_CLASS_COMM 0x02 -#define USB_CLASS_HID 0x03 -#define USB_CLASS_PRINTER 0x07 -#define USB_CLASS_MASS_STORAGE 0x08 -#define USB_CLASS_HUB 0x09 -#define USB_CLASS_DATA 0x0A -#define USB_CLASS_VIDEO 0x0E -#endif -/* - * Endpoint Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of endpoint descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint8_t bEndpointAddress; /*!< Endpoint address */ - __packed uint8_t bmAttributes; /*!< Endpoint attribute */ - __packed uint16_t wMaxPacketSize; /*!< Maximum packet size */ - __packed uint8_t bInterval; /*!< Synchronous transfer interval */ - __packed uint8_t bRefresh; /*!< Refresh */ - __packed uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - uint8_t bLength; /*!< Length of endpoint descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bEndpointAddress; /*!< Endpoint address */ - uint8_t bmAttributes; /*!< Endpoint attribute */ - uint16_t wMaxPacketSize; /*!< Maximum packet size */ - uint8_t bInterval; /*!< Synchronous transfer interval */ - uint8_t bRefresh; /*!< Refresh */ - uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ -#endif - -/* - * Endpoint descriptor bEndpointAddress[7] - direction - */ -#define EP_ADDR_DIR_MASK 0x80 -#define EP_ADDR_DIR_IN 0x80 -#define EP_ADDR_DIR_OUT 0x00 - -/* - * Endpoint descriptor bmAttributes[1:0] - transfer type - */ -#define EP_ATTR_TT_MASK 0x03 -#define EP_ATTR_TT_CTRL 0x00 -#define EP_ATTR_TT_ISO 0x01 -#define EP_ATTR_TT_BULK 0x02 -#define EP_ATTR_TT_INT 0x03 - - -/*----------------------------------------------------------------------------------*/ -/* USB Host controller driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*init) (void); - void (*shutdown) (void); - void (*suspend) (void); - void (*resume) (void); - int (*ctrl_xfer)(struct utr_t *utr); - int (*bulk_xfer)(struct utr_t *utr); - int (*int_xfer)(struct utr_t *utr); - int (*iso_xfer)(struct utr_t *utr); - int (*quit_xfer)(struct utr_t *utr, struct ep_info_t *ep); - - /* root hub support */ - int (*rthub_port_reset)(int port); - int (*rthub_polling) (void); -} HC_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*probe) (struct iface_t *iface); - void (*disconnect) (struct iface_t *iface); - void (*suspend) (struct iface_t *iface); - void (*resume) (struct iface_t *iface); -} UDEV_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device */ -/*----------------------------------------------------------------------------------*/ - -typedef enum -{ - SPEED_LOW, - SPEED_FULL, - SPEED_HIGH -} SPEED_E; - -typedef struct ep_info_t -{ - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint8_t bInterval; - uint8_t bToggle; - uint16_t wMaxPacketSize; - void *hw_pipe; /*!< point to the HC assocaied endpoint \hideinitializer */ -} EP_INFO_T; - -typedef struct udev_t -{ - DESC_DEV_T descriptor; /*!< Device descriptor. \hideinitializer */ - struct hub_dev_t *parent; /*!< parent hub device \hideinitializer */ - uint8_t port_num; /*!< The hub port this device connected on \hideinitializer */ - uint8_t dev_num; /*!< device number \hideinitializer */ - int8_t cur_conf; /*!< Currentll selected configuration \hideinitializer */ - SPEED_E speed; /*!< device speed (low/full/high) \hideinitializer */ - /* - * The followings are lightweight USB stack internal used . - */ - uint8_t *cfd_buff; /*!< Configuration descriptor buffer. \hideinitializer */ - EP_INFO_T ep0; /*!< Endpoint 0 \hideinitializer */ - HC_DRV_T *hc_driver; /*!< host controller driver \hideinitializer */ - struct iface_t *iface_list; /*!< Working interface list \hideinitializer */ - struct udev_t *next; /*!< link for global usb device list \hideinitializer */ -} UDEV_T; - -typedef struct alt_iface_t -{ - DESC_IF_T *ifd; /*!< point to the location of this alternative interface descriptor in UDEV_T->cfd_buff */ - EP_INFO_T ep[MAX_EP_PER_IFACE]; /*!< endpoints of this alternative interface */ -} ALT_IFACE_T; - -typedef struct iface_t -{ - UDEV_T *udev; /*!< USB device \hideinitializer */ - uint8_t if_num; /*!< Interface number \hideinitializer */ - uint8_t num_alt; /*!< Number of alternative interface \hideinitializer */ - ALT_IFACE_T *aif; /*!< Point to the active alternative interface */ - ALT_IFACE_T alt[MAX_ALT_PER_IFACE]; /*!< List of alternative interface \hideinitializer */ - UDEV_DRV_T *driver; /*!< Interface associated driver \hideinitializer */ - void *context; /*!< Reference to device context \hideinitializer */ - struct iface_t *next; /*!< Point to next interface of the same device. Started from UDEV_T->iface_list \hideinitializer */ -} IFACE_T; - - -/*----------------------------------------------------------------------------------*/ -/* URB (USB Request Block) */ -/*----------------------------------------------------------------------------------*/ - -#define IF_PER_UTR 8 /* number of frames per UTR isochronous transfer (DO NOT modify it!) */ - -typedef void (*FUNC_UTR_T)(struct utr_t *); - -typedef struct utr_t -{ - UDEV_T *udev; /*!< point to associated USB device \hideinitializer */ - DEV_REQ_T setup; /*!< buffer for setup packet \hideinitializer */ - EP_INFO_T *ep; /*!< associated endpoint \hideinitializer */ - uint8_t *buff; /*!< transfer buffer \hideinitializer */ - uint8_t bIsTransferDone; /*!< tansfer done? \hideinitializer */ - uint32_t data_len; /*!< length of data to be transferred \hideinitializer */ - uint32_t xfer_len; /*!< length of transferred data \hideinitializer */ - uint8_t bIsoNewSched; /*!< New schedule isochronous transfer \hideinitializer */ - uint16_t iso_sf; /*!< Isochronous start frame number \hideinitializer */ - uint16_t iso_xlen[IF_PER_UTR]; /*!< transfer length of isochronous frames \hideinitializer */ - uint8_t * iso_buff[IF_PER_UTR]; /*!< transfer buffer address of isochronous frames \hideinitializer */ - int iso_status[IF_PER_UTR]; /*!< transfer status of isochronous frames \hideinitializer */ - int td_cnt; /*!< number of transfer descriptors \hideinitializer */ - int status; /*!< return status \hideinitializer */ - int interval; /*!< interrupt/isochronous interval \hideinitializer */ - void *context; /*!< point to deivce proprietary data area \hideinitializer */ - FUNC_UTR_T func; /*!< tansfer done call-back function \hideinitializer */ - struct utr_t *next; /* point to the next UTR of the same endpoint. \hideinitializer */ -} UTR_T; - - -/*----------------------------------------------------------------------------------*/ -/* Global variables */ -/*----------------------------------------------------------------------------------*/ -extern USBH_T *_ohci; - -extern HC_DRV_T ohci_driver; - -extern UDEV_T * g_udev_list; - -/*----------------------------------------------------------------------------------*/ -/* USB stack exported functions */ -/*----------------------------------------------------------------------------------*/ -extern void usbh_delay_ms(int msec); - -extern void dump_ohci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ohci_int_table(void); -extern void usbh_dump_buff_bytes(uint8_t *buff, int nSize); -extern void usbh_dump_interface_descriptor(DESC_IF_T *if_desc); -extern void usbh_dump_endpoint_descriptor(DESC_EP_T *ep_desc); -extern void usbh_dump_iface(IFACE_T *iface); -extern void usbh_dump_ep_info(EP_INFO_T *ep); - -/* - * Memory management functions - */ -extern void usbh_memory_init(void); -extern uint32_t usbh_memory_used(void); -extern void * usbh_alloc_mem(int size); -extern void usbh_free_mem(void *p, int size); -extern int alloc_dev_address(void); -extern void free_dev_address(int dev_addr); -extern UDEV_T * alloc_device(void); -extern void free_device(UDEV_T *udev); -extern UTR_T * alloc_utr(UDEV_T *udev); -extern void free_utr(UTR_T *utr); -extern ED_T * alloc_ohci_ED(void); -extern void free_ohci_ED(ED_T *ed); -extern TD_T * alloc_ohci_TD(UTR_T *utr); -extern void free_ohci_TD(TD_T *td); - - -extern void usbh_hub_init(void); -extern int usbh_connect_device(UDEV_T *); -extern void usbh_disconnect_device(UDEV_T *); -extern int usbh_register_driver(UDEV_DRV_T *driver); -extern EP_INFO_T * usbh_iface_find_ep(IFACE_T *iface, uint8_t ep_addr, uint8_t dir_type); -extern int usbh_reset_device(UDEV_T *); -extern int usbh_reset_port(UDEV_T *); - -/* - * USB Standard Request functions - */ -extern int usbh_get_device_descriptor(UDEV_T *udev, DESC_DEV_T *desc_buff); -extern int usbh_get_config_descriptor(UDEV_T *udev, uint8_t *desc_buff, int buff_len); -extern int usbh_set_configuration(UDEV_T *udev, uint8_t conf_val); -extern int usbh_set_interface(IFACE_T *iface, uint16_t alt_setting); -extern int usbh_clear_halt(UDEV_T *udev, uint16_t ep_addr); - -extern int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout); -extern int usbh_bulk_xfer(UTR_T *utr); -extern int usbh_int_xfer(UTR_T *utr); -extern int usbh_iso_xfer(UTR_T *utr); -extern int usbh_quit_utr(UTR_T *utr); -extern int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep); - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_H_ */ diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/usbh_lib.h b/bsp/nuvoton/libraries/m2354/USBHostLib/inc/usbh_lib.h deleted file mode 100644 index 9597e14ba8f..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/inc/usbh_lib.h +++ /dev/null @@ -1,254 +0,0 @@ -/**************************************************************************//** - * @file usbh_lib.h - * @version V1.10 - * @brief USB Host library exported header file. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef _USBH_LIB_H_ -#define _USBH_LIB_H_ - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup LIBRARY Library - @{ -*/ - -/** @addtogroup USBH_Library USB Host Library - @{ -*/ - -/** @addtogroup USBH_EXPORTED_CONSTANTS USB Host Exported Constants - @{ -*/ - -#define USBH_OK 0 /*!< No error. */ -#define USBH_ERR_MEMORY_OUT -10 /*!< Out of memory. */ -#define USBH_ERR_IF_ALT_LIMIT -11 /*!< Number of alternative interface > MAX_ALT_PER_IFACE */ -#define USBH_ERR_IF_EP_LIMIT -15 /*!< Number of endpoints > MAX_EP_PER_IFACE */ -#define USBH_ERR_NOT_SUPPORTED -101 /*!< Device/Class/Transfer not supported */ -#define USBH_ERR_NOT_MATCHED -103 /*!< Not macthed */ -#define USBH_ERR_NOT_EXPECTED -104 /*!< Unknown or unexpected */ -#define USBH_ERR_INVALID_PARAM -105 /*!< Invalid parameter */ -#define USBH_ERR_NOT_FOUND -106 /*!< Device or interface not found */ -#define USBH_ERR_EP_NOT_FOUND -107 /*!< Endpoint not found */ -#define USBH_ERR_DESCRIPTOR -137 /*!< Failed to parse USB descriptors */ -#define USBH_ERR_SET_DEV_ADDR -139 /*!< Failed to set device address */ -#define USBH_ERR_SET_CONFIG -151 /*!< Failed to set device configuration */ - -#define USBH_ERR_TRANSFER -201 /*!< USB transfer error */ -#define USBH_ERR_TIMEOUT -203 /*!< USB transfer time-out */ -#define USBH_ERR_ABORT -205 /*!< USB transfer aborted due to disconnect or reset */ -#define USBH_ERR_PORT_RESET -255 /*!< Hub port reset failed */ -#define USBH_ERR_SCH_OVERRUN -257 /*!< USB isochronous schedule overrun */ -#define USBH_ERR_DISCONNECTED -259 /*!< USB device was disconnected */ - -#define USBH_ERR_TRANSACTION -271 /*!< USB transaction timeout, CRC, Bad PID, etc. */ -#define USBH_ERR_BABBLE_DETECTED -272 /*!< A 'babble' is detected during the transaction */ -#define USBH_ERR_DATA_BUFF -274 /*!< Data buffer overrun or underrun */ - -#define USBH_ERR_CC_NO_ERR -280 /*!< OHCI CC code - no error */ -#define USBH_ERR_CRC -281 /*!< USB trasfer CRC error */ -#define USBH_ERR_BIT_STUFF -282 /*!< USB transfer bit stuffing error */ -#define USBH_ERR_DATA_TOGGLE -283 /*!< USB trasfer data toggle error */ -#define USBH_ERR_STALL -284 /*!< USB trasfer STALL error */ -#define USBH_ERR_DEV_NO_RESP -285 /*!< USB trasfer device no response error */ -#define USBH_ERR_PID_CHECK -286 /*!< USB trasfer PID check failure */ -#define USBH_ERR_UNEXPECT_PID -287 /*!< USB trasfer unexpected PID error */ -#define USBH_ERR_DATA_OVERRUN -288 /*!< USB trasfer data overrun error */ -#define USBH_ERR_DATA_UNDERRUN -289 /*!< USB trasfer data underrun error */ -#define USBH_ERR_BUFF_OVERRUN -292 /*!< USB trasfer buffer overrun error */ -#define USBH_ERR_BUFF_UNDERRUN -293 /*!< USB trasfer buffer underrun error */ -#define USBH_ERR_NOT_ACCESS0 -294 /*!< USB trasfer not accessed error */ -#define USBH_ERR_NOT_ACCESS1 -295 /*!< USB trasfer not accessed error */ - -#define USBH_ERR_OHCI_INIT -301 /*!< Failed to initialize OHIC controller. */ -#define USBH_ERR_OHCI_EP_BUSY -303 /*!< The endpoint is under transfer. */ - -#define USBH_ERR_EHCI_INIT -501 /*!< Failed to initialize EHCI controller. */ -#define USBH_ERR_EHCI_QH_BUSY -503 /*!< the Queue Head is busy. */ - -#define UMAS_OK 0 /*!< No error. */ -#define UMAS_ERR_NO_DEVICE -1031 /*!< No Mass Stroage Device found. */ -#define UMAS_ERR_IO -1033 /*!< Device read/write failed. */ -#define UMAS_ERR_INIT_DEVICE -1035 /*!< failed to init MSC device */ -#define UMAS_ERR_CMD_STATUS -1037 /*!< SCSI command status failed */ -#define UMAS_ERR_IVALID_PARM -1038 /*!< Invalid parameter. */ -#define UMAS_ERR_DRIVE_NOT_FOUND -1039 /*!< drive not found */ - -#define HID_RET_OK 0 /*!< Return with no errors. */ -#define HID_RET_DEV_NOT_FOUND -1081 /*!< HID device not found or removed. */ -#define HID_RET_IO_ERR -1082 /*!< USB transfer failed. */ -#define HID_RET_INVALID_PARAMETER -1083 /*!< Invalid parameter. */ -#define HID_RET_OUT_OF_MEMORY -1084 /*!< Out of memory. */ -#define HID_RET_NOT_SUPPORTED -1085 /*!< Function not supported. */ -#define HID_RET_EP_NOT_FOUND -1086 /*!< Endpoint not found. */ -#define HID_RET_PARSING -1087 /*!< Failed to parse HID descriptor */ -#define HID_RET_XFER_IS_RUNNING -1089 /*!< The transfer has been enabled. */ -#define HID_RET_REPORT_NOT_FOUND -1090 /*!< The transfer has been enabled. */ - -#define UAC_RET_OK 0 /*!< Return with no errors. */ -#define UAC_RET_DEV_NOT_FOUND -2001 /*!< Audio Class device not found or removed. */ -#define UAC_RET_FUNC_NOT_FOUND -2002 /*!< Audio device has no this function. */ -#define UAC_RET_IO_ERR -2003 /*!< USB transfer failed. */ -#define UAC_RET_DATA_LEN -2004 /*!< Unexpected transfer length */ -#define UAC_RET_INVALID -2005 /*!< Invalid parameter or usage. */ -#define UAC_RET_OUT_OF_MEMORY -2007 /*!< Out of memory. */ -#define UAC_RET_DRV_NOT_SUPPORTED -2009 /*!< Function not supported by this UAC driver. */ -#define UAC_RET_DEV_NOT_SUPPORTED -2011 /*!< Function not supported by the UAC device. */ -#define UAC_RET_PARSER -2013 /*!< Failed to parse UAC descriptor */ -#define UAC_RET_IS_STREAMING -2015 /*!< Audio pipe is on streaming. */ - - -/*@}*/ /* end of group USBH_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBH_EXPORTED_TYPEDEF USB Host Typedef - @{ -*/ -struct udev_t; -typedef void (CONN_FUNC)(struct udev_t *udev, int param); - -struct line_coding_t; -struct cdc_dev_t; -typedef void (CDC_CB_FUNC)(struct cdc_dev_t *cdev, uint8_t *rdata, int data_len); - -struct usbhid_dev; -typedef void (HID_IR_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *rdata, uint32_t data_len); /*!< interrupt in callback function \hideinitializer */ -typedef void (HID_IW_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *wbuff, uint32_t *data_len); /*!< interrupt out callback function \hideinitializer */ - -struct uac_dev_t; -typedef int (UAC_CB_FUNC)(struct uac_dev_t *dev, uint8_t *data, int len); /*!< audio in callback function \hideinitializer */ - -/*@}*/ /* end of group USBH_EXPORTED_STRUCT */ - - - -/** @addtogroup USBH_EXPORTED_FUNCTIONS USB Host Exported Functions - @{ -*/ - -/*------------------------------------------------------------------*/ -/* */ -/* USB Core Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_core_init(void); -extern int usbh_polling_root_hubs(void); -extern void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func); -extern void usbh_suspend(void); -extern void usbh_resume(void); -extern struct udev_t *usbh_find_device(char *hub_id, int port); -/** - * @brief A function return current tick count. - * @return Current tick. - * @details User application must provide this function to return current tick. - * The tick should increase by 1 for every 10 ms. - */ -extern uint32_t usbh_get_ticks(void); /* This function must be provided by user application. */ -extern uint32_t usbh_tick_from_millisecond(uint32_t msec); /* This function must be provided by user application. */ - -/*------------------------------------------------------------------*/ -/* */ -/* USB Communication Device Class Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_cdc_init(void); -extern struct cdc_dev_t *usbh_cdc_get_device_list(void); -/// @cond HIDDEN_SYMBOLS -extern int32_t usbh_cdc_get_line_coding(struct cdc_dev_t *cdev, struct line_coding_t *line_code); -extern int32_t usbh_cdc_set_line_coding(struct cdc_dev_t *cdev, struct line_coding_t *line_code); -/// @endcond HIDDEN_SYMBOLS -extern int32_t usbh_cdc_set_control_line_state(struct cdc_dev_t *cdev, int active_carrier, int DTE_present); -extern int32_t usbh_cdc_start_polling_status(struct cdc_dev_t *cdev, CDC_CB_FUNC *func); -extern int32_t usbh_cdc_start_to_receive_data(struct cdc_dev_t *cdev, CDC_CB_FUNC *func); -extern int32_t usbh_cdc_send_data(struct cdc_dev_t *cdev, uint8_t *buff, int buff_len); - - -/*------------------------------------------------------------------*/ -/* */ -/* USB Human Interface Class Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_hid_init(void); -extern struct usbhid_dev *usbh_hid_get_device_list(void); -extern int32_t usbh_hid_get_report_descriptor(struct usbhid_dev *hdev, uint8_t *desc_buf, int buf_max_len); -extern int32_t usbh_hid_get_report(struct usbhid_dev *hdev, int rtp_typ, int rtp_id, uint8_t *data, int len); -extern int32_t usbh_hid_set_report(struct usbhid_dev *hdev, int rtp_typ, int rtp_id, uint8_t *data, int len); -extern int32_t usbh_hid_get_idle(struct usbhid_dev *hdev, int rtp_id, uint8_t *idle_rate); -extern int32_t usbh_hid_set_idle(struct usbhid_dev *hdev, int rtp_id, uint8_t idle_rate); -extern int32_t usbh_hid_get_protocol(struct usbhid_dev *hdev, uint8_t *protocol); -extern int32_t usbh_hid_set_protocol(struct usbhid_dev *hdev, uint8_t protocol); -extern int32_t usbh_hid_start_int_read(struct usbhid_dev *hdev, uint8_t ep_addr, HID_IR_FUNC *func); -extern int32_t usbh_hid_stop_int_read(struct usbhid_dev *hdev, uint8_t ep_addr); -extern int32_t usbh_hid_start_int_write(struct usbhid_dev *hdev, uint8_t ep_addr, HID_IW_FUNC *func); -extern int32_t usbh_hid_stop_int_write(struct usbhid_dev *hdev, uint8_t ep_addr); - -/*------------------------------------------------------------------*/ -/* */ -/* USB Mass Storage Class Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern int usbh_umas_init(void); -extern int usbh_umas_disk_status(int drv_no); -extern int usbh_umas_read(int drv_no, uint32_t sec_no, int sec_cnt, uint8_t *buff); -extern int usbh_umas_write(int drv_no, uint32_t sec_no, int sec_cnt, uint8_t *buff); -extern int usbh_umas_ioctl(int drv_no, int cmd, void *buff); -/// @cond HIDDEN_SYMBOLS -extern int usbh_umas_reset_disk(int drv_no); -/// @endcond HIDDEN_SYMBOLS -/*------------------------------------------------------------------*/ -/* */ -/* USB Audio Class Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_uac_init(void); -extern int usbh_uac_open(struct uac_dev_t *audev); -extern struct uac_dev_t *usbh_uac_get_device_list(void); -extern int usbh_uac_get_channel_number(struct uac_dev_t *audev, uint8_t target); -extern int usbh_uac_get_bit_resolution(struct uac_dev_t *audev, uint8_t target, uint8_t *byte_cnt); -extern int usbh_uac_get_sampling_rate(struct uac_dev_t *audev, uint8_t target, uint32_t *srate_list, int max_cnt, uint8_t *type); -extern int usbh_uac_sampling_rate_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint32_t *srate); -extern int usbh_uac_mute_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint16_t chn, uint8_t *mute); -extern int usbh_uac_vol_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint16_t chn, uint16_t *volume); -extern int usbh_uac_auto_gain_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint16_t chn, uint8_t *bAGC); -extern int usbh_uac_start_audio_in(struct uac_dev_t *uac, UAC_CB_FUNC *func); -extern int usbh_uac_stop_audio_in(struct uac_dev_t *audev); -extern int usbh_uac_start_audio_out(struct uac_dev_t *uac, UAC_CB_FUNC *func); -extern int usbh_uac_stop_audio_out(struct uac_dev_t *audev); - - -/// @cond HIDDEN_SYMBOLS - -extern void dump_ohci_regs(void); -extern void dump_ehci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ehci_ports(void); -extern uint32_t usbh_memory_used(void); - -/// @endcond HIDDEN_SYMBOLS - - -/*@}*/ /* end of group USBH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBH_Library */ - -/*@}*/ /* end of group LIBRARY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _USBH_LIB_H_ */ - -/*** (C) COPYRIGHT 2019-2020 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/src/mem_alloc.c b/bsp/nuvoton/libraries/m2354/USBHostLib/src/mem_alloc.c deleted file mode 100644 index 97d41ef1303..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/src/mem_alloc.c +++ /dev/null @@ -1,316 +0,0 @@ -/**************************************************************************//** - * @file mem_alloc.c - * @version V1.10 - * @brief USB host library memory allocation functions. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" - - -/// @cond HIDDEN_SYMBOLS - -//#define MEM_DEBUG - -#ifdef MEM_DEBUG -#define mem_debug rt_kprintf -#else -#define mem_debug(...) -#endif - -#ifdef __ICCARM__ -#pragma data_alignment=32 -static uint8_t _mem_pool[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE]; -#else -static uint8_t _mem_pool[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE] __attribute__((aligned(32))); -#endif -static uint8_t _unit_used[MEM_POOL_UNIT_NUM]; - -static volatile int _usbh_mem_used; -static volatile int _usbh_max_mem_used; -static volatile int _mem_pool_used; - - -UDEV_T * g_udev_list; - -uint8_t _dev_addr_pool[128]; -static volatile int _device_addr; - -/*--------------------------------------------------------------------------*/ -/* Memory alloc/free recording */ -/*--------------------------------------------------------------------------*/ - -void usbh_memory_init(void) -{ - if(sizeof(TD_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("TD_T - MEM_POOL_UNIT_SIZE too small!\n"); - while(1); - } - - if(sizeof(ED_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("ED_T - MEM_POOL_UNIT_SIZE too small!\n"); - while(1); - } - - _usbh_mem_used = 0L; - _usbh_max_mem_used = 0L; - - memset(_unit_used, 0, sizeof(_unit_used)); - _mem_pool_used = 0; - - g_udev_list = NULL; - - memset(_dev_addr_pool, 0, sizeof(_dev_addr_pool)); - _device_addr = 1; -} - -uint32_t usbh_memory_used(void) -{ - rt_kprintf("USB static memory: %d/%d, heap used: %d\n", _mem_pool_used, MEM_POOL_UNIT_NUM, _usbh_mem_used); - return _usbh_mem_used; -} - -static void memory_counter(int size) -{ - _usbh_mem_used += size; - if (_usbh_mem_used > _usbh_max_mem_used) - _usbh_max_mem_used = _usbh_mem_used; -} - -void * usbh_alloc_mem(int size) -{ - void *p; - - p = malloc(size); - if (p == NULL) - { - USB_error("usbh_alloc_mem failed! %d\n", size); - return NULL; - } - - memset(p, 0, size); - memory_counter(size); - return p; -} - -void usbh_free_mem(void *p, int size) -{ - free(p); - memory_counter(0-size); -} - - -/*--------------------------------------------------------------------------*/ -/* USB device allocate/free */ -/*--------------------------------------------------------------------------*/ - -UDEV_T * alloc_device(void) -{ - UDEV_T *udev; - - udev = malloc(sizeof(*udev)); - if (udev == NULL) - { - USB_error("alloc_device failed!\n"); - return NULL; - } - memset(udev, 0, sizeof(*udev)); - memory_counter(sizeof(*udev)); - udev->cur_conf = -1; /* must! used to identify the first SET CONFIGURATION */ - udev->next = g_udev_list; /* chain to global device list */ - g_udev_list = udev; - return udev; -} - -void free_device(UDEV_T *udev) -{ - UDEV_T *d; - - if (udev == NULL) - return; - - if (udev->cfd_buff != NULL) - usbh_free_mem(udev->cfd_buff, MAX_DESC_BUFF_SIZE); - - /* - * Remove it from the global device list - */ - if (g_udev_list == udev) - { - g_udev_list = g_udev_list->next; - } - else - { - d = g_udev_list; - while (d != NULL) - { - if (d->next == udev) - { - d->next = udev->next; - break; - } - d = d->next; - } - } - - free(udev); - memory_counter(-sizeof(*udev)); -} - -int alloc_dev_address(void) -{ - _device_addr++; - - if (_device_addr >= 128) - _device_addr = 1; - - while (1) - { - if (_dev_addr_pool[_device_addr] == 0) - { - _dev_addr_pool[_device_addr] = 1; - return _device_addr; - } - _device_addr++; - if (_device_addr >= 128) - _device_addr = 1; - } -} - -void free_dev_address(int dev_addr) -{ - if (dev_addr < 128) - _dev_addr_pool[dev_addr] = 0; -} - -/*--------------------------------------------------------------------------*/ -/* UTR (USB Transfer Request) allocate/free */ -/*--------------------------------------------------------------------------*/ - -UTR_T * alloc_utr(UDEV_T *udev) -{ - UTR_T *utr; - - utr = malloc(sizeof(*utr)); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - memory_counter(sizeof(*utr)); - memset(utr, 0, sizeof(*utr)); - utr->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr); - return utr; -} - -void free_utr(UTR_T *utr) -{ - if (utr == NULL) - return; - - mem_debug("[FREE] [UTR] - 0x%x\n", (int)utr); - free(utr); - memory_counter(0-(int)sizeof(*utr)); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI ED allocate/free */ -/*--------------------------------------------------------------------------*/ - -ED_T * alloc_ohci_ED(void) -{ - int i; - ED_T *ed; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - ed = (ED_T *)&_mem_pool[i]; - memset(ed, 0, sizeof(*ed)); - mem_debug("[ALLOC] [ED] - 0x%x\n", (int)ed); - return ed; - } - } - USB_error("alloc_ohci_ED failed!\n"); - return NULL; -} - -void free_ohci_ED(ED_T *ed) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)ed) - { - mem_debug("[FREE] [ED] - 0x%x\n", (int)ed); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ohci_ED - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI TD allocate/free */ -/*--------------------------------------------------------------------------*/ -TD_T * alloc_ohci_TD(UTR_T *utr) -{ - int i; - TD_T *td; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - td = (TD_T *)&_mem_pool[i]; - - memset(td, 0, sizeof(*td)); - td->utr = utr; - mem_debug("[ALLOC] [TD] - 0x%x\n", (int)td); - return td; - } - } - USB_error("alloc_ohci_TD failed!\n"); - return NULL; -} - -void free_ohci_TD(TD_T *td) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)td) - { - mem_debug("[FREE] [TD] - 0x%x\n", (int)td); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ohci_TD - not found!\n"); -} - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2019-2020 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/src/ohci.c b/bsp/nuvoton/libraries/m2354/USBHostLib/src/ohci.c deleted file mode 100644 index 5aa7c4ffe5d..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/src/ohci.c +++ /dev/null @@ -1,1289 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -//#define TD_debug printf -#define TD_debug(...) - -//#define ED_debug printf -#define ED_debug(...) - -#ifdef __ICCARM__ -#pragma data_alignment=256 -HCCA_T _hcca; -#else -HCCA_T _hcca __attribute__((aligned(256))); -#endif - -ED_T * _Ied[6]; - - -static ED_T *ed_remove_list; - -static void add_to_ED_remove_list(ED_T *ed) -{ - ED_T *p; - - ED_debug("add_to_ED_remove_list - 0x%x (0x%x)\n", (int)ed, ed->Info); - DISABLE_OHCI_IRQ(); - - /* check if this ED found in ed_remove_list */ - p = ed_remove_list; - while (p) - { - if (p == ed) - { - ENABLE_OHCI_IRQ(); /* This ED found in ed_remove_list */ - return; /* do nothing */ - } - p = p->next; - } - - ed->Info |= ED_SKIP; /* ask OHCI controller skip this ED */ - ed->next = ed_remove_list; - ed_remove_list = ed; /* insert to the head of ed_remove_list */ - ENABLE_OHCI_IRQ(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_SF_Msk; - usbh_delay_ms(2); /* Full speed wait 2 ms is enough */ -} - -static int ohci_reset(void) -{ - volatile int t0; - - /* Disable HC interrupts */ - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_MIE_Msk; - - /* HC Reset requires max 10 ms delay */ - _ohci->HcControl = 0; - _ohci->HcCommandStatus = USBH_HcCommandStatus_HCR_Msk; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if((_ohci->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB OHCI reset timed out!\n"); - return -1; - } - - _ohci->HcRhStatus = USBH_HcRhStatus_OCI_Msk | USBH_HcRhStatus_LPS_Msk; - - _ohci->HcControl = HCFS_RESET; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if((_ohci->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB HC reset timed out!\n"); - return -1; - } - return 0; -} - -static void init_hcca_int_table() -{ - ED_T *ed_p; - int i, idx, interval; - - memset(_hcca.int_table, 0, sizeof(_hcca.int_table)); - - for (i = 5; i >= 0; i--) /* interval = i^2 */ - { - _Ied[i] = alloc_ohci_ED(); - _Ied[i]->Info = ED_SKIP; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < 32; idx += interval) - { - if (_hcca.int_table[idx] == 0) /* is empty list, insert directly */ - { - _hcca.int_table[idx] = (uint32_t)_Ied[i]; - } - else - { - ed_p = (ED_T *)_hcca.int_table[idx]; - - while (1) - { - if (ed_p == _Ied[i]) - break; /* already chained by previous visit */ - - if (ed_p->NextED == 0) /* reach end of list? */ - { - ed_p->NextED = (uint32_t)_Ied[i]; - break; - } - ed_p = (ED_T *)ed_p->NextED; - } - } - } - } -} - -static ED_T * get_int_tree_head_node(int interval) -{ - int i; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return _Ied[i]; - } - return _Ied[5]; /* for interval >= 32 */ -} - -static int get_ohci_interval(int interval) -{ - int i, bInterval = 1; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return bInterval; - bInterval *= 2; - } - return 32; /* for interval >= 32 */ -} - - -static int ohci_init(void) -{ - uint32_t fminterval; - volatile int i; - - if (ohci_reset() < 0) - return -1; - - ed_remove_list = NULL; - - init_hcca_int_table(); - - /* Tell the controller where the control and bulk lists are - * The lists are empty now. */ - _ohci->HcControlHeadED = 0; /* control ED list head */ - _ohci->HcBulkHeadED = 0; /* bulk ED list head */ - - _ohci->HcHCCA = (uint32_t)&_hcca; /* HCCA area */ - - /* periodic start 90% of frame interval */ - fminterval = 0x2edf; /* 11,999 */ - _ohci->HcPeriodicStart = (fminterval*9)/10; - - /* set FSLargestDataPacket, 10,104 for 0x2edf frame interval */ - fminterval |= ((((fminterval - 210) * 6) / 7) << 16); - _ohci->HcFmInterval = fminterval; - - _ohci->HcLSThreshold = 0x628; - - /* start controller operations */ - _ohci->HcControl = HCFS_OPER | (0x3 << USBH_HcControl_CBSR_Pos); - - _ohci->HcRhDescriptorA = (_ohci->HcRhDescriptorA | (1 << 9)) & ~USBH_HcRhDescriptorA_PSM_Msk; - _ohci->HcRhStatus = USBH_HcRhStatus_LPSC_Msk; - - _ohci->HcInterruptEnable = USBH_HcInterruptEnable_MIE_Msk | USBH_HcInterruptEnable_WDH_Msk | USBH_HcInterruptEnable_SF_Msk; - - /* POTPGT delay is bits 24-31, in 20 ms units. */ - usbh_delay_ms(20); - return 0; -} - -static void ohci_suspend(void) -{ - /* set port suspend if connected */ - if (_ohci->HcRhPortStatus[0] & 0x1) - _ohci->HcRhPortStatus[0] = 0x4; - - if (_ohci->HcRhPortStatus[1] & 0x1) - _ohci->HcRhPortStatus[1] = 0x4; - - /* enable Device Remote Wakeup */ - _ohci->HcRhStatus |= USBH_HcRhStatus_DRWE_Msk; - - /* enable USBH RHSC interrupt for system wakeup */ - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_RHSC_Msk | USBH_HcInterruptEnable_RD_Msk; - - /* set Host Controller enter suspend state */ - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (3 << USBH_HcControl_HCFS_Pos); -} - -static void ohci_resume(void) -{ - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (1 << USBH_HcControl_HCFS_Pos); - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (2 << USBH_HcControl_HCFS_Pos); - - if (_ohci->HcRhPortStatus[0] & 0x4) - _ohci->HcRhPortStatus[0] = 0x8; - if (_ohci->HcRhPortStatus[1] & 0x4) - _ohci->HcRhPortStatus[1] = 0x8; -} - -static void ohci_shutdown(void) -{ - ohci_suspend(); - DISABLE_OHCI_IRQ(); - _ohci->HcRhStatus = USBH_HcRhStatus_LPS_Msk; -} - - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ohci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ED_T *ed; - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ed = (ED_T *)(utr->ep->hw_pipe); - - if (!ed) - return USBH_ERR_NOT_FOUND; - - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - ed = (ED_T *)(ep->hw_pipe); - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - ep->hw_pipe = NULL; - } - - return 0; -} - -uint32_t ed_make_info(UDEV_T *udev, EP_INFO_T *ep) -{ - uint32_t info; - - if (ep == NULL) /* is a control endpoint */ - { - /* control endpoint direction is from TD */ - if (udev->descriptor.bMaxPacketSize0 == 0) /* is 0 if device descriptor still not obtained. */ - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - info = (udev->descriptor.bMaxPacketSize0 << 16) /* Control endpoint Maximum Packet Size from device descriptor */ - | ED_DIR_BY_TD /* Direction (Get direction From TD) */ - | ED_FORMAT_GENERAL /* General format */ - | (0 << ED_CTRL_EN_Pos); /* Endpoint address 0 */ - } - else /* Other endpoint direction is from endpoint descriptor */ - { - info = (ep->wMaxPacketSize << 16); /* Maximum Packet Size from endpoint */ - - info |= ((ep->bEndpointAddress & 0xf) << ED_CTRL_EN_Pos); /* Endpoint Number */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) - info |= ED_DIR_IN; - else - info |= ED_DIR_OUT; - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) == EP_ATTR_TT_ISO) - info |= ED_FORMAT_ISO; - else - info |= ED_FORMAT_GENERAL; - } - - info |= ((udev->speed == SPEED_LOW) ? ED_SPEED_LOW : ED_SPEED_FULL); /* Speed */ - info |= (udev->dev_num); /* Function Address */ - - return info; -} - -static void write_td(TD_T *td, uint32_t info, uint8_t *buff, uint32_t data_len) -{ - td->Info = info; - td->CBP = (uint32_t)((!buff || !data_len) ? 0 : buff); - td->BE = (uint32_t)((!buff || !data_len ) ? 0 : (uint32_t)buff + data_len - 1); - td->buff_start = td->CBP; - // TD_debug("TD [0x%x]: 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->BE); -} - -static int ohci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - ED_T *ed; - TD_T *td_setup, *td_data, *td_status; - uint32_t info; - - udev = utr->udev; - - /*------------------------------------------------------------------------------------*/ - /* Allocate ED and TDs */ - /*------------------------------------------------------------------------------------*/ - td_setup = alloc_ohci_TD(utr); - - if (utr->data_len > 0) - td_data = alloc_ohci_TD(utr); - else - td_data = NULL; - - td_status = alloc_ohci_TD(utr); - - if (td_status == NULL) - { - free_ohci_TD(td_setup); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - - /* Check if there's any transfer pending on this endpoint... */ - if (udev->ep0.hw_pipe == NULL) - { - ed = alloc_ohci_ED(); - if (ed == NULL) - { - free_ohci_TD(td_setup); - free_ohci_TD(td_status); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - } - else - ed = (ED_T *)udev->ep0.hw_pipe; - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage TD */ - /*------------------------------------------------------------------------------------*/ - info = TD_CC | TD_T_DATA0 | TD_TYPE_CTRL; - write_td(td_setup, info, (uint8_t *)&utr->setup, 8); - td_setup->ed = ed; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage TD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - - write_td(td_data, info, utr->buff, utr->data_len); - td_data->ed = ed; - td_setup->NextTD = (uint32_t)td_data; - td_setup->next = td_data; - td_data->NextTD = (uint32_t)td_status; - td_data->next = td_status; - } - else - { - td_setup->NextTD = (uint32_t)td_status; - td_setup->next = td_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare STATUS stage TD */ - /*------------------------------------------------------------------------------------*/ - ed->Info = ed_make_info(udev, NULL); - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL); - else - info = (TD_CC | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL); - - write_td(td_status, info, NULL, 0); - td_status->ed = ed; - td_status->NextTD = 0; - td_status->next = 0; - - /*------------------------------------------------------------------------------------*/ - /* prepare ED */ - /*------------------------------------------------------------------------------------*/ - ed->TailP = 0; - ed->HeadP = (uint32_t)td_setup; - ed->Info = ed_make_info(udev, NULL); - ed->NextED = 0; - - //TD_debug("TD SETUP [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_setup, td_setup->Info, td_setup->CBP, td_setup->BE, td_setup->NextTD); - //if (td_data) - // TD_debug("TD DATA [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_data, td_data->Info, td_data->CBP, td_data->BE, td_data->NextTD); - //TD_debug("TD STATUS [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_status, td_status->Info, td_status->CBP, td_status->BE, td_status->NextTD); - ED_debug("Xfer ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - if (utr->data_len > 0) - utr->td_cnt = 3; - else - utr->td_cnt = 2; - - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - udev->ep0.hw_pipe = (void *)ed; /* driver can find ED from EP */ - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - _ohci->HcControlHeadED = (uint32_t)ed; /* Link ED to OHCI */ - _ohci->HcControl |= USBH_HcControl_CLE_Msk; /* enable control list */ - ENABLE_OHCI_IRQ(); - _ohci->HcCommandStatus = USBH_HcCommandStatus_CLF_Msk; /* start Control list */ - - return 0; -} - -static int ohci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed; - TD_T *td, *td_p, *td_list = NULL; - uint32_t info; - uint32_t data_len, xfer_len; - int8_t bIsNewED = 0; - uint8_t *buff; - - /*------------------------------------------------------------------------------------*/ - /* Check if there's uncompleted transfer on this endpoint... */ - /* Prepare ED */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - - /* Check if there's any transfer pending on this endpoint... */ - ed = (ED_T *)_ohci->HcBulkHeadED; /* get the head of bulk endpoint list */ - while (ed != NULL) - { - if (ed->Info == info) /* have transfer of this EP not completed? */ - { - if ((ed->HeadP & 0xFFFFFFF0) != (ed->TailP & 0xFFFFFFF0)) - return USBH_ERR_OHCI_EP_BUSY; /* endpoint is busy */ - else - break; /* ED already there... */ - } - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ED_debug("Link BULK ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - } - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - utr->td_cnt = 0; - data_len = utr->data_len; - buff = utr->buff; - - do - { - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_BULK); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_BULK); - - info &= ~(1 << 25); /* Data toggle from ED toggleCarry bit */ - - if (data_len > 4096) /* maximum transfer length is 4K for each TD */ - xfer_len = 4096; - else - xfer_len = data_len; /* remaining data length < 4K */ - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - write_td(td, info, buff, xfer_len); - td->ed = ed; - - utr->td_cnt++; /* increase TD count, for recalim counter */ - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - /* chain to end of TD list */ - if (td_list == NULL) - { - td_list = td; - } - else - { - td_p = td_list; - while (td_p->NextTD != 0) - td_p = (TD_T *)td_p->NextTD; - td_p->NextTD = (uint32_t)td; - } - - } - while (data_len > 0); - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - if (bIsNewED) - { - ed->HeadP = (uint32_t)td_list; - /* Link ED to OHCI Bulk List */ - ed->NextED = _ohci->HcBulkHeadED; - _ohci->HcBulkHeadED = (uint32_t)ed; - } - ENABLE_OHCI_IRQ(); - _ohci->HcControl |= USBH_HcControl_BLE_Msk; /* enable bulk list */ - _ohci->HcCommandStatus = USBH_HcCommandStatus_BLF_Msk; /* start bulk list */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static int ohci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_new; - uint32_t info; - int8_t bIsNewED = 0; - - if (utr->data_len > 64) /* USB 1.1 interrupt transfer maximum packet size is 64 */ - return USBH_ERR_INVALID_PARAM; - - td_new = alloc_ohci_TD(utr); /* allocate a TD for dummy TD */ - if (td_new == NULL) - return USBH_ERR_MEMORY_OUT; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - - td = alloc_ohci_TD(NULL); /* allocate the initial dummy TD for ED */ - if (td == NULL) - { - free_ohci_ED(ed); - free_ohci_TD(td_new); - return USBH_ERR_MEMORY_OUT; - } - ed->HeadP = (uint32_t)td; /* Let both HeadP and TailP point to dummy TD */ - ed->TailP = ed->HeadP; - } - else - { - td = (TD_T *)(ed->TailP & ~0xf); /* TailP always point to the dummy TD */ - } - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TD */ - /*------------------------------------------------------------------------------------*/ - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_INT); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_INT); - - /* Keep data toggle */ - info = (info & ~(1<<25)) | (td->Info & (1<<25)); - - /* fill this TD */ - write_td(td, info, utr->buff, utr->data_len); - td->ed = ed; - td->NextTD = (uint32_t)td_new; - td->utr = utr; - utr->td_cnt = 1; /* increase TD count, for recalim counter */ - utr->status = 0; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - - ed->TailP = (uint32_t)td_new; - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - - //printf("Link INT ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - _ohci->HcControl |= USBH_HcControl_PLE_Msk; /* periodic list enable */ - return 0; -} - -static int ohci_iso_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_list, *last_td; - int i; - uint32_t info; - uint32_t buff_addr; - int8_t bIsNewED = 0; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - } - else - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - if (utr->bIsoNewSched) /* Is the starting of isochronous streaming? */ - ed->next_sf = _hcca.frame_no + OHCI_ISO_DELAY; - - utr->td_cnt = 0; - utr->iso_sf = ed->next_sf; - - last_td = NULL; - td_list = NULL; - - for (i = 0; i < IF_PER_UTR; i++) - { - utr->iso_status[i] = USBH_ERR_NOT_ACCESS1; - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - buff_addr = (uint32_t)(utr->iso_buff[i]); - td->Info = (TD_CC | TD_TYPE_ISO) | ed->next_sf; - ed->next_sf += get_ohci_interval(ed->bInterval); - td->CBP = buff_addr & ~0xFFF; - td->BE = buff_addr + utr->iso_xlen[i] - 1; - td->PSW[0] = 0xE000 | (buff_addr & 0xFFF); - - td->ed = ed; - utr->td_cnt++; /* increase TD count, for reclaim counter */ - - /* chain to end of TD list */ - if (td_list == NULL) - td_list = td; - else - last_td->NextTD = (uint32_t)td; - - last_td = td; - }; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - - if ((ed->HeadP & ~0x3) == 0) - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - else - { - /* find the tail of TDs under this ED */ - td = (TD_T *)(ed->HeadP & ~0x3); - while (td->NextTD != 0) - { - td = (TD_T *)td->NextTD; - } - td->NextTD = (uint32_t)td_list; - } - - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - ED_debug("Link ISO ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - _ohci->HcControl |= USBH_HcControl_PLE_Msk | USBH_HcControl_IE_Msk; /* enable periodic list and isochronous transfer */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static UDEV_T * ohci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && - ((udev->speed == SPEED_LOW) || (udev->speed == SPEED_FULL))) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ohci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_PRS_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time)+1) - { - /* - * If device is disconnected or port enabled, we can stop port reset. - */ - if (((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) || - ((_ohci->HcRhPortStatus[port] & (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk)) == (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("OHCI port %d - port reset failed!\n", port+1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - return USBH_OK; /* port reset success */ -} - -static int ohci_rh_polling(void) -{ - int i, change = 0; - UDEV_T *udev; - int ret; - - for (i = 0; i < 2; i++) - { - - /* clear unwanted port change status */ - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_OCIC_Msk | USBH_HcRhPortStatus_PRSC_Msk | - USBH_HcRhPortStatus_PSSC_Msk | USBH_HcRhPortStatus_PESC_Msk; - - if ((_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CSC_Msk) == 0) - continue; - - /*--------------------------------------------------------------------------------*/ - /* connect status change */ - /*--------------------------------------------------------------------------------*/ - - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* First of all, check if there's any previously connected device. */ - /*----------------------------------------------------------------------------*/ - while (1) - { - udev = ohci_find_device_by_port(i+1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - if (ohci_rh_port_reset(i) != USBH_OK) - continue; - - /* - * Port reset success... - */ - udev = alloc_device(); - if (udev == NULL) - continue; - - udev->parent = NULL; - udev->port_num = i+1; - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_LSDA_Msk) - udev->speed = SPEED_LOW; - else - udev->speed = SPEED_FULL; - udev->hc_driver = &ohci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - - change = 1; - } - else - { - /* - * Device disconnected - */ - while (1) - { - udev = ohci_find_device_by_port(i+1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - change = 1; - } - } - return change; -} - -void td_done(TD_T *td) -{ - UTR_T *utr = td->utr; - uint32_t info; - int cc; - - info = td->Info; - - TD_debug("td_done: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->NextTD, td->BE); - - /* ISO ... drivers see per-TD length/status */ - if ((info & TD_TYPE_Msk) == TD_TYPE_ISO) - { - uint16_t sf; - int idx; - - sf = info & 0xFFFF; - idx = ((sf + 0x10000 - utr->iso_sf) & 0xFFFF) / get_ohci_interval(td->ed->bInterval); - if (idx >= IF_PER_UTR) - { - USB_error("ISO invalid index!! %d, %d\n", sf, utr->iso_sf); - goto td_out; - } - - cc = (td->PSW[0] >> 12) & 0xF; - if (cc == 0xF) /* this frame was not transferred */ - { - USB_debug("ISO F %d N/A!\n", sf); - utr->iso_status[idx] = USBH_ERR_SCH_OVERRUN; - goto td_out; - } - if ((cc != 0) && (cc != CC_DATA_UNDERRUN)) - { - utr->iso_status[idx] = USBH_ERR_CC_NO_ERR - cc; - goto td_out; - } - utr->iso_status[idx] = 0; - utr->iso_xlen[idx] = td->PSW[0] & 0x7FF; - } - else - { - cc = TD_CC_GET(info); - - /* short packet is fine */ - if ((cc != CC_NOERROR) && (cc != CC_DATA_UNDERRUN)) - { - USB_error("TD error, CC = 0x%x\n", cc); - if (cc == CC_STALL) - utr->status = USBH_ERR_STALL; - else - utr->status = USBH_ERR_TRANSFER; - } - - switch (info & TD_TYPE_Msk) - { - case TD_TYPE_CTRL: - if (info & TD_CTRL_DATA) - { - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - } - break; - - case TD_TYPE_BULK: - case TD_TYPE_INT: - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - break; - } - } - -td_out: - - utr->td_cnt--; - - /* If all TDs are done, call-back to requester. */ - if (utr->td_cnt == 0) - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } -} - -/* in IRQ context */ -static void remove_ed() -{ - ED_T *ed, *ed_p, *ied; - TD_T *td, *td_next; - UTR_T *utr; - int found; - - while (ed_remove_list != NULL) - { - ED_debug("Remove ED: 0x%x, %d\n", (int)ed_remove_list, ed_remove_list->bInterval); - ed_p = ed_remove_list; - found = 0; - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Control List if found */ - /*--------------------------------------------------------------------------------*/ - if ((ed_p->Info & ED_EP_ADDR_Msk) == 0) - { - if (_ohci->HcControlHeadED == (uint32_t)ed_p) - { - _ohci->HcControlHeadED = (uint32_t)ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcControlHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove INT or ISO endpoint from HCCA interrupt table */ - /*--------------------------------------------------------------------------------*/ - else if (ed_p->bInterval > 0) - { - ied = get_int_tree_head_node(ed_p->bInterval); - - ed = ied; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - break; - } - ed = (ED_T *)ed->NextED; - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Bulk List if found */ - /*--------------------------------------------------------------------------------*/ - else - { - if (_ohci->HcBulkHeadED == (uint32_t)ed_p) - { - ed = (ED_T *)ed_p; - _ohci->HcBulkHeadED = ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcBulkHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove and free all TDs under this endpoint */ - /*--------------------------------------------------------------------------------*/ - if (found) - { - td = (TD_T *)(ed_p->HeadP & ~0x3); - if (td != NULL) - { - while (td != NULL) - { - utr = td->utr; - td_next = (TD_T *)td->NextTD; - free_ohci_TD(td); - td = td_next; - - utr->td_cnt--; - if (utr->td_cnt == 0) - { - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - } - } - } - - /* - * Done. Remove this ED from [ed_remove_list] and free it. - */ - ed_remove_list = ed_p->next; - free_ohci_ED(ed_p); - } -} - - -//static irqreturn_t ohci_irq (struct usb_hcd *hcd) -void USBH_IRQHandler(void) -{ - TD_T *td, *td_prev, *td_next; - uint32_t int_sts; - - /* enter interrupt */ - rt_interrupt_enter(); - - int_sts = _ohci->HcInterruptStatus; - - //USB_debug("ohci int_sts = 0x%x\n", int_sts); - - if ((_ohci->HcInterruptEnable & USBH_HcInterruptEnable_SF_Msk) && - (int_sts & USBH_HcInterruptStatus_SF_Msk)) - { - int_sts &= ~USBH_HcInterruptStatus_SF_Msk; - - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_SF_Msk; - remove_ed(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - } - - if (int_sts & USBH_HcInterruptStatus_WDH_Msk) - { - //printf("!%02x\n", _ohci->HcFmNumber & 0xff); - int_sts &= ~USBH_HcInterruptStatus_WDH_Msk; - /* - * reverse done list - */ - td = (TD_T *)(_hcca.done_head & TD_ADDR_MASK); - _hcca.done_head = 0; - td_prev = NULL; - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_WDH_Msk; - - while (td != NULL) - { - //TD_debug("Done list TD 0x%x => 0x%x\n", (int)td, (int)td->NextTD); - td_next = (TD_T *)(td->NextTD & TD_ADDR_MASK); - td->NextTD = (uint32_t)td_prev; - td_prev = td; - td = td_next; - } - td = td_prev; /* first TD of the reversed done list */ - - /* - * reclaim TDs - */ - while (td != NULL) - { - TD_debug("Reclaim TD 0x%x, next 0x%x\n", (int)td, td->NextTD); - td_next = (TD_T *)td->NextTD; - td_done(td); - free_ohci_TD(td); - td = td_next; - } - } - - if (int_sts & USBH_HcInterruptStatus_RHSC_Msk) - { - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_RHSC_Msk; - } - - _ohci->HcInterruptStatus = int_sts; - - /* leave interrupt */ - rt_interrupt_leave(); - -} - -#ifdef ENABLE_DEBUG_MSG - -void dump_ohci_int_table() -{ - int i; - ED_T *ed; - - for (i = 0; i < 32; i++) -// for (i = 0; i < 1; i++) - - { - USB_debug("%02d: ", i); - - ed = (ED_T *)_hcca.int_table[i]; - - while (ed != NULL) - { - USB_debug("0x%x (0x%x) => ", (int)ed, ed->HeadP); - ed = (ED_T *)ed->NextED; - } - rt_kprintf("0\n"); - } -} - -void dump_ohci_regs() -{ - USB_debug("Dump OCHI registers:\n"); - USB_debug(" HcRevision = 0x%x\n", _ohci->HcRevision); - USB_debug(" HcControl = 0x%x\n", _ohci->HcControl); - USB_debug(" HcCommandStatus = 0x%x\n", _ohci->HcCommandStatus); - USB_debug(" HcInterruptStatus = 0x%x\n", _ohci->HcInterruptStatus); - USB_debug(" HcInterruptEnable = 0x%x\n", _ohci->HcInterruptEnable); - USB_debug(" HcInterruptDisable = 0x%x\n", _ohci->HcInterruptDisable); - USB_debug(" HcHCCA = 0x%x\n", _ohci->HcHCCA); - USB_debug(" HcPeriodCurrentED = 0x%x\n", _ohci->HcPeriodCurrentED); - USB_debug(" HcControlHeadED = 0x%x\n", _ohci->HcControlHeadED); - USB_debug(" HcControlCurrentED = 0x%x\n", _ohci->HcControlCurrentED); - USB_debug(" HcBulkHeadED = 0x%x\n", _ohci->HcBulkHeadED); - USB_debug(" HcBulkCurrentED = 0x%x\n", _ohci->HcBulkCurrentED); - USB_debug(" HcDoneHead = 0x%x\n", _ohci->HcDoneHead); - USB_debug(" HcFmInterval = 0x%x\n", _ohci->HcFmInterval); - USB_debug(" HcFmRemaining = 0x%x\n", _ohci->HcFmRemaining); - USB_debug(" HcFmNumber = 0x%x\n", _ohci->HcFmNumber); - USB_debug(" HcPeriodicStart = 0x%x\n", _ohci->HcPeriodicStart); - USB_debug(" HcLSThreshold = 0x%x\n", _ohci->HcLSThreshold); - USB_debug(" HcRhDescriptorA = 0x%x\n", _ohci->HcRhDescriptorA); - USB_debug(" HcRhDescriptorB = 0x%x\n", _ohci->HcRhDescriptorB); - USB_debug(" HcRhStatus = 0x%x\n", _ohci->HcRhStatus); - USB_debug(" HcRhPortStatus0 = 0x%x\n", _ohci->HcRhPortStatus[0]); - USB_debug(" HcRhPortStatus1 = 0x%x\n", _ohci->HcRhPortStatus[1]); - USB_debug(" HcPhyControl = 0x%x\n", _ohci->HcPhyControl); - USB_debug(" HcMiscControl = 0x%x\n", _ohci->HcMiscControl); -} - -void dump_ohci_ports() -{ - USB_debug("_ohci port0=0x%x, port1=0x%x\n", _ohci->HcRhPortStatus[0], _ohci->HcRhPortStatus[1]); -} - -#endif // ENABLE_DEBUG_MSG - -HC_DRV_T ohci_driver = -{ - ohci_init, /* init */ - ohci_shutdown, /* shutdown */ - ohci_suspend, /* suspend */ - ohci_resume, /* resume */ - ohci_ctrl_xfer, /* ctrl_xfer */ - ohci_bulk_xfer, /* bulk_xfer */ - ohci_int_xfer, /* int_xfer */ - ohci_iso_xfer, /* iso_xfer */ - ohci_quit_xfer, /* quit_xfer */ - ohci_rh_port_reset, /* rthub_port_reset */ - ohci_rh_polling /* rthub_polling */ -}; - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2019-2020 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m2354/USBHostLib/src/usb_core.c b/bsp/nuvoton/libraries/m2354/USBHostLib/src/usb_core.c deleted file mode 100644 index b72f8d6ab88..00000000000 --- a/bsp/nuvoton/libraries/m2354/USBHostLib/src/usb_core.c +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************//** - * @file usb_core.c - * @version V1.10 - * @brief USB Host library core. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -USBH_T *_ohci; - -static UDEV_DRV_T *_drivers[MAX_UDEV_DRIVER]; -static CONN_FUNC *g_conn_func, *g_disconn_func; - -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief Initialize M2354 USB Host controller and USB stack. - * - * @return None. - */ -void usbh_core_init() -{ - if ((__PC() & NS_OFFSET) == NS_OFFSET) - { - _ohci = USBH_NS; - } - else - { - _ohci = USBH; - } - - DISABLE_OHCI_IRQ(); - - memset(_drivers, 0, sizeof(_drivers)); - - g_conn_func = NULL; - g_disconn_func = NULL; - -// usbh_hub_init(); - - usbh_memory_init(); - - _ohci->HcPhyControl &= ~USBH_HcPhyControl_STBYEN_Msk; /* Never enter the standby mode */ - - _ohci->HcMiscControl |= USBH_HcMiscControl_OCAL_Msk; /* Over-current active low */ - //_ohci->HcMiscControl &= ~USBH_HcMiscControl_OCAL_Msk; /* Over-current active high */ - -#ifdef ENABLE_OHCI - ohci_driver.init(); - ENABLE_OHCI_IRQ(); -#endif -} - -/** - * @brief Let USB stack polls all root hubs. If there's any hub port - * change found, USB stack will manage the hub events in this function call. - * In this function, USB stack enumerates newly connected devices and remove staff - * of disconnected devices. User's application should periodically invoke this - * function. - * @return There's hub port change or not. - * @retval 0 No any hub port status changes found. - * @retval 1 There's hub port status changes. - */ -int usbh_polling_root_hubs(void) -{ - int ret, change = 0; - -#ifdef ENABLE_OHCI - do - { - ret = ohci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - - return change; -} - - -/** - * @brief Force to quit an endpoint transfer. - * @param[in] udev The USB device. - * @param[in] ep The endpoint to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep) -{ - return udev->hc_driver->quit_xfer(NULL, ep); -} - -int usbh_connect_device(UDEV_T *udev) -{ - usbh_delay_ms(100); /* initially, give 100 ms delay */ - - if (g_conn_func) - g_conn_func(udev, 0); - - return 0; -} - - -void usbh_disconnect_device(UDEV_T *udev) -{ - USB_debug("disconnect device...\n"); - - if (g_disconn_func) - g_disconn_func(udev, 0); - - -#if 1 //CHECK: Maybe create a new API to quit_xfer and free udev for application - usbh_quit_xfer(udev, &(udev->ep0)); /* Quit control transfer if hw_pipe is not NULL. */ - - /* remove device from global device list */ -// free_dev_address(udev->dev_num); - free_device(udev); - -// usbh_memory_used(); -#endif -} - -/** - * @brief Install device connect and disconnect callback function. - * - * @param[in] conn_func Device connect callback function. - * @param[in] disconn_func Device disconnect callback function. - * @return None. - */ -void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func) -{ - g_conn_func = conn_func; - g_disconn_func = disconn_func; -} - -int usbh_reset_port(UDEV_T *udev) -{ - if (udev->parent == NULL) - { - if (udev->hc_driver) - return udev->hc_driver->rthub_port_reset(udev->port_num - 1); - else - return USBH_ERR_NOT_FOUND; - } - else - { - return udev->parent->port_reset(udev->parent, udev->port_num); - } -} - -/** - * @brief Force to quit an UTR transfer. - * @param[in] utr The UTR transfer to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_utr(UTR_T *utr) -{ - if (!utr || !utr->udev) - return USBH_ERR_NOT_FOUND; - - return utr->udev->hc_driver->quit_xfer(utr, NULL); -} - -/** - * @brief Execute an USB request in control transfer. This function returns after the request - * was done or aborted. - * @param[in] udev The target USB device. - * @param[in] bmRequestType Characteristics of request - * @param[in] bRequest Specific request - * @param[in] wValue Word-sized field that varies according to request - * @param[in] wIndex Word-sized field that varies according to request - * @param[in] wLength Number of bytes to transfer if there is a Data stage - * @param[in] buff Data buffer used in data stage - * @param[out] xfer_len Transmitted/received length of data - * @param[in] timeout Time-out limit (in 10ms - timer tick) of this transfer - * @retval 0 Transfer success - * @retval < 0 Transfer failed. Refer to error code definitions. - */ -int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, - uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout) -{ - UTR_T *utr; - uint32_t t0, timeout_tick; - int status; - - *xfer_len = 0; - - //if (check_device(udev)) - // return USBH_ERR_INVALID_PARAM; - - utr = alloc_utr(udev); - if (utr == NULL) - return USBH_ERR_MEMORY_OUT; - - utr->setup.bmRequestType = bmRequestType; - utr->setup.bRequest = bRequest; - utr->setup.wValue = wValue; - utr->setup.wIndex = wIndex; - utr->setup.wLength = wLength; - - utr->buff = buff; - utr->data_len = wLength; - utr->bIsTransferDone = 0; - status = udev->hc_driver->ctrl_xfer(utr); - if (status < 0) - { - udev->ep0.hw_pipe = NULL; - free_utr(utr); - return status; - } - - timeout_tick = usbh_tick_from_millisecond(timeout); - t0 = usbh_get_ticks(); - while (utr->bIsTransferDone == 0) - { - if (usbh_get_ticks() - t0 > timeout_tick) - { - usbh_quit_utr(utr); - free_utr(utr); - udev->ep0.hw_pipe = NULL; - return USBH_ERR_TIMEOUT; - } - } - - status = utr->status; - - if (status == 0) - { - *xfer_len = utr->xfer_len; - } - free_utr(utr); - - return status; -} - -/** - * @brief Execute a bulk transfer request. This function will return immediately after - * issued the bulk transfer. USB stack will later call back utr->func() once the bulk - * transfer was done or aborted. - * @param[in] utr The bulk transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_bulk_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->bulk_xfer(utr); -} - -/** - * @brief Execute an interrupt transfer request. This function will return immediately after - * issued the interrupt transfer. USB stack will later call back utr->func() once the - * interrupt transfer was done or aborted. - * @param[in] utr The interrupt transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_int_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->int_xfer(utr); -} - - diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/Kconfig b/bsp/nuvoton/libraries/m2354/rtt_port/Kconfig index bc72205ebf7..e37055919f1 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/Kconfig +++ b/bsp/nuvoton/libraries/m2354/rtt_port/Kconfig @@ -4,6 +4,7 @@ config SOC_SERIES_M2354 select SOC_FAMILY_NUMICRO select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN + select PKG_USING_NUVOTON_SERIES_DRIVER default y config BSP_USE_STDDRIVER_SOURCE diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_common_tables.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_common_tables.h deleted file mode 100644 index dfea7460e9a..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_common_tables.h +++ /dev/null @@ -1,121 +0,0 @@ -/* ---------------------------------------------------------------------- - * Project: CMSIS DSP Library - * Title: arm_common_tables.h - * Description: Extern declaration for common tables - * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ -/* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. 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 _ARM_COMMON_TABLES_H -#define _ARM_COMMON_TABLES_H - -#include "arm_math.h" - -extern const uint16_t armBitRevTable[1024]; -extern const q15_t armRecipTableQ15[64]; -extern const q31_t armRecipTableQ31[64]; -extern const float32_t twiddleCoef_16[32]; -extern const float32_t twiddleCoef_32[64]; -extern const float32_t twiddleCoef_64[128]; -extern const float32_t twiddleCoef_128[256]; -extern const float32_t twiddleCoef_256[512]; -extern const float32_t twiddleCoef_512[1024]; -extern const float32_t twiddleCoef_1024[2048]; -extern const float32_t twiddleCoef_2048[4096]; -extern const float32_t twiddleCoef_4096[8192]; -#define twiddleCoef twiddleCoef_4096 -extern const q31_t twiddleCoef_16_q31[24]; -extern const q31_t twiddleCoef_32_q31[48]; -extern const q31_t twiddleCoef_64_q31[96]; -extern const q31_t twiddleCoef_128_q31[192]; -extern const q31_t twiddleCoef_256_q31[384]; -extern const q31_t twiddleCoef_512_q31[768]; -extern const q31_t twiddleCoef_1024_q31[1536]; -extern const q31_t twiddleCoef_2048_q31[3072]; -extern const q31_t twiddleCoef_4096_q31[6144]; -extern const q15_t twiddleCoef_16_q15[24]; -extern const q15_t twiddleCoef_32_q15[48]; -extern const q15_t twiddleCoef_64_q15[96]; -extern const q15_t twiddleCoef_128_q15[192]; -extern const q15_t twiddleCoef_256_q15[384]; -extern const q15_t twiddleCoef_512_q15[768]; -extern const q15_t twiddleCoef_1024_q15[1536]; -extern const q15_t twiddleCoef_2048_q15[3072]; -extern const q15_t twiddleCoef_4096_q15[6144]; -extern const float32_t twiddleCoef_rfft_32[32]; -extern const float32_t twiddleCoef_rfft_64[64]; -extern const float32_t twiddleCoef_rfft_128[128]; -extern const float32_t twiddleCoef_rfft_256[256]; -extern const float32_t twiddleCoef_rfft_512[512]; -extern const float32_t twiddleCoef_rfft_1024[1024]; -extern const float32_t twiddleCoef_rfft_2048[2048]; -extern const float32_t twiddleCoef_rfft_4096[4096]; - -/* floating-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_16_TABLE_LENGTH ((uint16_t)20) -#define ARMBITREVINDEXTABLE_32_TABLE_LENGTH ((uint16_t)48) -#define ARMBITREVINDEXTABLE_64_TABLE_LENGTH ((uint16_t)56) -#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208) -#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440) -#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448) -#define ARMBITREVINDEXTABLE_1024_TABLE_LENGTH ((uint16_t)1800) -#define ARMBITREVINDEXTABLE_2048_TABLE_LENGTH ((uint16_t)3808) -#define ARMBITREVINDEXTABLE_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE_16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE_32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE_64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE_4096_TABLE_LENGTH]; - -/* fixed-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH ((uint16_t)12) -#define ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH ((uint16_t)24) -#define ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH ((uint16_t)56) -#define ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH ((uint16_t)112) -#define ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH ((uint16_t)240) -#define ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH ((uint16_t)480) -#define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992) -#define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) -#define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; - -/* Tables for Fast Math Sine and Cosine */ -extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; -extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; -extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; - -#endif /* ARM_COMMON_TABLES_H */ diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_const_structs.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_const_structs.h deleted file mode 100644 index 84ffe8b858d..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_const_structs.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ---------------------------------------------------------------------- - * Project: CMSIS DSP Library - * Title: arm_const_structs.h - * Description: Constant structs that are initialized for user convenience. - * For example, some can be given as arguments to the arm_cfft_f32() function. - * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ -/* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. 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 _ARM_CONST_STRUCTS_H -#define _ARM_CONST_STRUCTS_H - -#include "arm_math.h" -#include "arm_common_tables.h" - -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; - -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; - -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; - -#endif diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_math.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_math.h deleted file mode 100644 index a489ab614de..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/arm_math.h +++ /dev/null @@ -1,7257 +0,0 @@ -/* ---------------------------------------------------------------------- - * Project: CMSIS DSP Library - * Title: arm_math.h - * Description: Public header file for CMSIS DSP Library - * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ -/* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. 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. - */ - -/** - \mainpage CMSIS DSP Software Library - * - * Introduction - * ------------ - * - * This user manual describes the CMSIS DSP software library, - * a suite of common signal processing functions for use on Cortex-M processor based devices. - * - * The library is divided into a number of functions each covering a specific category: - * - Basic math functions - * - Fast math functions - * - Complex math functions - * - Filters - * - Matrix functions - * - Transforms - * - Motor control functions - * - Statistical functions - * - Support functions - * - Interpolation functions - * - * The library has separate functions for operating on 8-bit integers, 16-bit integers, - * 32-bit integer and 32-bit floating-point values. - * - * Using the Library - * ------------ - * - * The library installer contains prebuilt versions of the libraries in the Lib folder. - * - arm_cortexM7lfdp_math.lib (Cortex-M7, Little endian, Double Precision Floating Point Unit) - * - arm_cortexM7bfdp_math.lib (Cortex-M7, Big endian, Double Precision Floating Point Unit) - * - arm_cortexM7lfsp_math.lib (Cortex-M7, Little endian, Single Precision Floating Point Unit) - * - arm_cortexM7bfsp_math.lib (Cortex-M7, Big endian and Single Precision Floating Point Unit on) - * - arm_cortexM7l_math.lib (Cortex-M7, Little endian) - * - arm_cortexM7b_math.lib (Cortex-M7, Big endian) - * - arm_cortexM4lf_math.lib (Cortex-M4, Little endian, Floating Point Unit) - * - arm_cortexM4bf_math.lib (Cortex-M4, Big endian, Floating Point Unit) - * - arm_cortexM4l_math.lib (Cortex-M4, Little endian) - * - arm_cortexM4b_math.lib (Cortex-M4, Big endian) - * - arm_cortexM3l_math.lib (Cortex-M3, Little endian) - * - arm_cortexM3b_math.lib (Cortex-M3, Big endian) - * - arm_cortexM0l_math.lib (Cortex-M0 / Cortex-M0+, Little endian) - * - arm_cortexM0b_math.lib (Cortex-M0 / Cortex-M0+, Big endian) - * - arm_ARMv8MBLl_math.lib (ARMv8M Baseline, Little endian) - * - arm_ARMv8MMLl_math.lib (ARMv8M Mainline, Little endian) - * - arm_ARMv8MMLlfsp_math.lib (ARMv8M Mainline, Little endian, Single Precision Floating Point Unit) - * - arm_ARMv8MMLld_math.lib (ARMv8M Mainline, Little endian, DSP instructions) - * - arm_ARMv8MMLldfsp_math.lib (ARMv8M Mainline, Little endian, DSP instructions, Single Precision Floating Point Unit) - * - * The library functions are declared in the public file arm_math.h which is placed in the Include folder. - * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single - * public header file arm_math.h for Cortex-M cores with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. - * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or - * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. - * For ARMv8M cores define pre processor MACRO ARM_MATH_ARMV8MBL or ARM_MATH_ARMV8MML. - * Set Pre processor MACRO __DSP_PRESENT if ARMv8M Mainline core supports DSP instructions. - * - * - * Examples - * -------- - * - * The library ships with a number of examples which demonstrate how to use the library functions. - * - * Toolchain Support - * ------------ - * - * The library has been developed and tested with MDK-ARM version 5.14.0.0 - * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. - * - * Building the Library - * ------------ - * - * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. - * - arm_cortexM_math.uvprojx - * - * - * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above. - * - * Pre-processor Macros - * ------------ - * - * Each library project have differant pre-processor macros. - * - * - UNALIGNED_SUPPORT_DISABLE: - * - * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access - * - * - ARM_MATH_BIG_ENDIAN: - * - * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. - * - * - ARM_MATH_MATRIX_CHECK: - * - * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices - * - * - ARM_MATH_ROUNDING: - * - * Define macro ARM_MATH_ROUNDING for rounding on support functions - * - * - ARM_MATH_CMx: - * - * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target - * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and - * ARM_MATH_CM7 for building the library on cortex-M7. - * - * - ARM_MATH_ARMV8MxL: - * - * Define macro ARM_MATH_ARMV8MBL for building the library on ARMv8M Baseline target, ARM_MATH_ARMV8MBL for building library - * on ARMv8M Mainline target. - * - * - __FPU_PRESENT: - * - * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for floating point libraries. - * - * - __DSP_PRESENT: - * - * Initialize macro __DSP_PRESENT = 1 when ARMv8M Mainline core supports DSP instructions. - * - *
- * CMSIS-DSP in ARM::CMSIS Pack - * ----------------------------- - * - * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: - * |File/Folder |Content | - * |------------------------------|------------------------------------------------------------------------| - * |\b CMSIS\\Documentation\\DSP | This documentation | - * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | - * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | - * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | - * - *
- * Revision History of CMSIS-DSP - * ------------ - * Please refer to \ref ChangeLog_pg. - * - * Copyright Notice - * ------------ - * - * Copyright (C) 2010-2015 ARM Limited. All rights reserved. - */ - - -/** - * @defgroup groupMath Basic Math Functions - */ - -/** - * @defgroup groupFastMath Fast Math Functions - * This set of functions provides a fast approximation to sine, cosine, and square root. - * As compared to most of the other functions in the CMSIS math library, the fast math functions - * operate on individual values and not arrays. - * There are separate functions for Q15, Q31, and floating-point data. - * - */ - -/** - * @defgroup groupCmplxMath Complex Math Functions - * This set of functions operates on complex data vectors. - * The data in the complex arrays is stored in an interleaved fashion - * (real, imag, real, imag, ...). - * In the API functions, the number of samples in a complex array refers - * to the number of complex values; the array contains twice this number of - * real values. - */ - -/** - * @defgroup groupFilters Filtering Functions - */ - -/** - * @defgroup groupMatrix Matrix Functions - * - * This set of functions provides basic matrix math operations. - * The functions operate on matrix data structures. For example, - * the type - * definition for the floating-point matrix structure is shown - * below: - *
- *     typedef struct
- *     {
- *       uint16_t numRows;     // number of rows of the matrix.
- *       uint16_t numCols;     // number of columns of the matrix.
- *       float32_t *pData;     // points to the data of the matrix.
- *     } arm_matrix_instance_f32;
- * 
- * There are similar definitions for Q15 and Q31 data types. - * - * The structure specifies the size of the matrix and then points to - * an array of data. The array is of size numRows X numCols - * and the values are arranged in row order. That is, the - * matrix element (i, j) is stored at: - *
- *     pData[i*numCols + j]
- * 
- * - * \par Init Functions - * There is an associated initialization function for each type of matrix - * data structure. - * The initialization function sets the values of the internal structure fields. - * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() - * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. - * - * \par - * Use of the initialization function is optional. However, if initialization function is used - * then the instance structure cannot be placed into a const data section. - * To place the instance structure in a const data - * section, manually initialize the data structure. For example: - *
- * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
- * 
- * where nRows specifies the number of rows, nColumns - * specifies the number of columns, and pData points to the - * data array. - * - * \par Size Checking - * By default all of the matrix functions perform size checking on the input and - * output matrices. For example, the matrix addition function verifies that the - * two input matrices and the output matrix all have the same number of rows and - * columns. If the size check fails the functions return: - *
- *     ARM_MATH_SIZE_MISMATCH
- * 
- * Otherwise the functions return - *
- *     ARM_MATH_SUCCESS
- * 
- * There is some overhead associated with this matrix size checking. - * The matrix size checking is enabled via the \#define - *
- *     ARM_MATH_MATRIX_CHECK
- * 
- * within the library project settings. By default this macro is defined - * and size checking is enabled. By changing the project settings and - * undefining this macro size checking is eliminated and the functions - * run a bit faster. With size checking disabled the functions always - * return ARM_MATH_SUCCESS. - */ - -/** - * @defgroup groupTransforms Transform Functions - */ - -/** - * @defgroup groupController Controller Functions - */ - -/** - * @defgroup groupStats Statistics Functions - */ -/** - * @defgroup groupSupport Support Functions - */ - -/** - * @defgroup groupInterpolation Interpolation Functions - * These functions perform 1- and 2-dimensional interpolation of data. - * Linear interpolation is used for 1-dimensional data and - * bilinear interpolation is used for 2-dimensional data. - */ - -/** - * @defgroup groupExamples Examples - */ -#ifndef _ARM_MATH_H -#define _ARM_MATH_H - -/* Compiler specific diagnostic adjustment */ -#if defined ( __CC_ARM ) - -#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) - -#elif defined ( __GNUC__ ) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wunused-parameter" - -#elif defined ( __ICCARM__ ) - -#elif defined ( __TI_ARM__ ) - -#elif defined ( __CSMC__ ) - -#elif defined ( __TASKING__ ) - -#else - #error Unknown compiler -#endif - - -#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ - -#if defined(ARM_MATH_CM7) - #include "core_cm7.h" - #define ARM_MATH_DSP -#elif defined (ARM_MATH_CM4) - #include "core_cm4.h" - #define ARM_MATH_DSP -#elif defined (ARM_MATH_CM3) - #include "core_cm3.h" -#elif defined (ARM_MATH_CM0) - #include "core_cm0.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_CM0PLUS) - #include "core_cm0plus.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_ARMV8MBL) - #include "core_armv8mbl.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_ARMV8MML) - #include "core_armv8mml.h" - #if (defined (__DSP_PRESENT) && (__DSP_PRESENT == 1)) - #define ARM_MATH_DSP - #endif -#else - #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS, ARM_MATH_CM0, ARM_MATH_ARMV8MBL, ARM_MATH_ARMV8MML" -#endif - -#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ -#include "string.h" -#include "math.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** - * @brief Macros required for reciprocal calculation in Normalized LMS - */ - -#define DELTA_Q31 (0x100) -#define DELTA_Q15 0x5 -#define INDEX_MASK 0x0000003F -#ifndef PI -#define PI 3.14159265358979f -#endif - -/** - * @brief Macros required for SINE and COSINE Fast math approximations - */ - -#define FAST_MATH_TABLE_SIZE 512 -#define FAST_MATH_Q31_SHIFT (32 - 10) -#define FAST_MATH_Q15_SHIFT (16 - 10) -#define CONTROLLER_Q31_SHIFT (32 - 9) -#define TABLE_SPACING_Q31 0x400000 -#define TABLE_SPACING_Q15 0x80 - -/** - * @brief Macros required for SINE and COSINE Controller functions - */ -/* 1.31(q31) Fixed value of 2/360 */ -/* -1 to +1 is divided into 360 values so total spacing is (2/360) */ -#define INPUT_SPACING 0xB60B61 - -/** - * @brief Macro for Unaligned Support - */ -#ifndef UNALIGNED_SUPPORT_DISABLE -#define ALIGN4 -#else -#if defined (__GNUC__) -#define ALIGN4 __attribute__((aligned(4))) -#else -#define ALIGN4 __align(4) -#endif -#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ - -/** - * @brief Error status returned by some functions in the library. - */ - -typedef enum -{ - ARM_MATH_SUCCESS = 0, /**< No error */ - ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ - ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ - ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ - ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ - ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ - ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ -} arm_status; - -/** - * @brief 8-bit fractional data type in 1.7 format. - */ -typedef int8_t q7_t; - -/** - * @brief 16-bit fractional data type in 1.15 format. - */ -typedef int16_t q15_t; - -/** - * @brief 32-bit fractional data type in 1.31 format. - */ -typedef int32_t q31_t; - -/** - * @brief 64-bit fractional data type in 1.63 format. - */ -typedef int64_t q63_t; - -/** - * @brief 32-bit floating-point type definition. - */ -typedef float float32_t; - -/** - * @brief 64-bit floating-point type definition. - */ -typedef double float64_t; - -/** - * @brief definition to read/write two 16 bit values. - */ -#if defined ( __CC_ARM ) -#define __SIMD32_TYPE int32_t __packed -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE __attribute__((always_inline)) - -#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE __attribute__((always_inline)) - -#elif defined ( __GNUC__ ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE __attribute__((always_inline)) - -#elif defined ( __ICCARM__ ) -#define __SIMD32_TYPE int32_t __packed -#define CMSIS_UNUSED -#define CMSIS_INLINE - -#elif defined ( __TI_ARM__ ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) -#define CMSIS_INLINE - -#elif defined ( __CSMC__ ) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED -#define CMSIS_INLINE - -#elif defined ( __TASKING__ ) -#define __SIMD32_TYPE __unaligned int32_t -#define CMSIS_UNUSED -#define CMSIS_INLINE - -#else -#error Unknown compiler -#endif - -#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) -#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) -#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) -#define __SIMD64(addr) (*(int64_t **) & (addr)) - -/* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#if !defined (ARM_MATH_DSP) -/** - * @brief definition to pack two 16 bit values. - */ -#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ - (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) -#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ - (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) - -/* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#endif /* !defined (ARM_MATH_DSP) */ - -/** -* @brief definition to pack four 8 bit values. -*/ -#ifndef ARM_MATH_BIG_ENDIAN - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) -#else - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) - -#endif - - -/** - * @brief Clips Q63 to Q31 values. - */ -CMSIS_INLINE __STATIC_INLINE q31_t clip_q63_to_q31( - q63_t x) -{ - return ((q31_t)(x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFFFFFF ^ ((q31_t)(x >> 63)))) : (q31_t) x; -} - -/** - * @brief Clips Q63 to Q15 values. - */ -CMSIS_INLINE __STATIC_INLINE q15_t clip_q63_to_q15( - q63_t x) -{ - return ((q31_t)(x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFF ^ ((q15_t)(x >> 63)))) : (q15_t)(x >> 15); -} - -/** - * @brief Clips Q31 to Q7 values. - */ -CMSIS_INLINE __STATIC_INLINE q7_t clip_q31_to_q7( - q31_t x) -{ - return ((q31_t)(x >> 24) != ((q31_t) x >> 23)) ? - ((0x7F ^ ((q7_t)(x >> 31)))) : (q7_t) x; -} - -/** - * @brief Clips Q31 to Q15 values. - */ -CMSIS_INLINE __STATIC_INLINE q15_t clip_q31_to_q15( - q31_t x) -{ - return ((q31_t)(x >> 16) != ((q31_t) x >> 15)) ? - ((0x7FFF ^ ((q15_t)(x >> 31)))) : (q15_t) x; -} - -/** - * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. - */ - -CMSIS_INLINE __STATIC_INLINE q63_t mult32x64( - q63_t x, - q31_t y) -{ - return ((((q63_t)(x & 0x00000000FFFFFFFF) * y) >> 32) + - (((q63_t)(x >> 32) * y))); -} - -/* - #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) - #define __CLZ __clz - #endif - */ -/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ -#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) -CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( - q31_t data); - -CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( - q31_t data) -{ - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while ((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); -} -#endif - -/** - * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. - */ - -CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q31( - q31_t in, - q31_t *dst, - q31_t *pRecipTable) -{ - q31_t out; - uint32_t tempVal; - uint32_t index, i; - uint32_t signBits; - - if (in > 0) - { - signBits = ((uint32_t)(__CLZ(in) - 1)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 1)); - } - - /* Convert input sample to 1.31 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 24); - index = (index & INDEX_MASK); - - /* 1.31 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t)(((q63_t) in * out) >> 31); - tempVal = 0x7FFFFFFFu - tempVal; - /* 1.31 with exp 1 */ - /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ - out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1u); -} - - -/** - * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. - */ -CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q15( - q15_t in, - q15_t *dst, - q15_t *pRecipTable) -{ - q15_t out = 0; - uint32_t tempVal = 0; - uint32_t index = 0, i = 0; - uint32_t signBits = 0; - - if (in > 0) - { - signBits = ((uint32_t)(__CLZ(in) - 17)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 17)); - } - - /* Convert input sample to 1.15 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 8); - index = (index & INDEX_MASK); - - /* 1.15 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t)(((q31_t) in * out) >> 15); - tempVal = 0x7FFFu - tempVal; - /* 1.15 with exp 1 */ - out = (q15_t)(((q31_t) out * tempVal) >> 14); - /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1); -} - - -/* - * @brief C custom defined intrinisic function for only M0 processors - */ -#if defined(ARM_MATH_CM0_FAMILY) -CMSIS_INLINE __STATIC_INLINE q31_t __SSAT( - q31_t x, - uint32_t y) -{ - int32_t posMax, negMin; - uint32_t i; - - posMax = 1; - for (i = 0; i < (y - 1); i++) - { - posMax = posMax * 2; - } - - if (x > 0) - { - posMax = (posMax - 1); - - if (x > posMax) - { - x = posMax; - } - } - else - { - negMin = -posMax; - - if (x < negMin) - { - x = negMin; - } - } - return (x); -} -#endif /* end of ARM_MATH_CM0_FAMILY */ - - -/* - * @brief C custom defined intrinsic function for M3 and M0 processors - */ -/* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#if !defined (ARM_MATH_DSP) - -/* - * @brief C custom defined QADD8 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QADD8( - uint32_t x, - uint32_t y) -{ - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x) >> 24) + (((q31_t)y) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r))); -} - - -/* - * @brief C custom defined QSUB8 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB8( - uint32_t x, - uint32_t y) -{ - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x) >> 24) - (((q31_t)y) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r))); -} - - -/* - * @brief C custom defined QADD16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QADD16( - uint32_t x, - uint32_t y) -{ - /* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ - q31_t r = 0, s = 0; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) + (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHADD16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHADD16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) + (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QSUB16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) - (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHSUB16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHSUB16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) - (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QASX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QASX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHASX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHASX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QSAX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __QSAX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHSAX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SHSAX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SMUSDX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSDX( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)))); -} - -/* - * @brief C custom defined SMUADX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUADX( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)))); -} - - -/* - * @brief C custom defined QADD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE int32_t __QADD( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); -} - - -/* - * @brief C custom defined QSUB for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE int32_t __QSUB( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); -} - - -/* - * @brief C custom defined SMLAD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMLAD( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLADX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMLADX( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLSDX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMLSDX( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLALD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALD( - uint32_t x, - uint32_t y, - uint64_t sum) -{ - /* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)) + - (((q63_t)sum)))); -} - - -/* - * @brief C custom defined SMLALDX for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALDX( - uint32_t x, - uint32_t y, - uint64_t sum) -{ - /* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q63_t)sum)))); -} - - -/* - * @brief C custom defined SMUAD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUAD( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)))); -} - - -/* - * @brief C custom defined SMUSD for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSD( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)))); -} - - -/* - * @brief C custom defined SXTB16 for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __SXTB16( - uint32_t x) -{ - return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | - ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000))); -} - -/* - * @brief C custom defined SMMLA for M3 and M0 processors - */ -CMSIS_INLINE __STATIC_INLINE int32_t __SMMLA( - int32_t x, - int32_t y, - int32_t sum) -{ - return (sum + (int32_t)(((int64_t) x * y) >> 32)); -} - -#if 0 -/* - * @brief C custom defined PKHBT for unavailable DSP extension - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __PKHBT( - uint32_t x, - uint32_t y, - uint32_t leftshift) -{ - return (((x) & 0x0000FFFFUL) | - ((y << leftshift) & 0xFFFF0000UL)); -} - -/* - * @brief C custom defined PKHTB for unavailable DSP extension - */ -CMSIS_INLINE __STATIC_INLINE uint32_t __PKHTB( - uint32_t x, - uint32_t y, - uint32_t rightshift) -{ - return (((x) & 0xFFFF0000UL) | - ((y >> rightshift) & 0x0000FFFFUL)); -} -#endif - -/* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ -#endif /* !defined (ARM_MATH_DSP) */ - - -/** - * @brief Instance structure for the Q7 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ -} arm_fir_instance_q7; - -/** - * @brief Instance structure for the Q15 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ -} arm_fir_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ -} arm_fir_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ -} arm_fir_instance_f32; - - -/** - * @brief Processing function for the Q7 FIR filter. - * @param[in] S points to an instance of the Q7 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q7( - const arm_fir_instance_q7 *S, - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q7 FIR filter. - * @param[in,out] S points to an instance of the Q7 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed. - */ -void arm_fir_init_q7( - arm_fir_instance_q7 *S, - uint16_t numTaps, - q7_t *pCoeffs, - q7_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR filter. - * @param[in] S points to an instance of the Q15 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q15( - const arm_fir_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_fast_q15( - const arm_fir_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR filter. - * @param[in,out] S points to an instance of the Q15 FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if - * numTaps is not a supported value. - */ -arm_status arm_fir_init_q15( - arm_fir_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR filter. - * @param[in] S points to an instance of the Q31 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q31( - const arm_fir_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_fast_q31( - const arm_fir_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR filter. - * @param[in,out] S points to an instance of the Q31 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ -void arm_fir_init_q31( - arm_fir_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point FIR filter. - * @param[in] S points to an instance of the floating-point FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_f32( - const arm_fir_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR filter. - * @param[in,out] S points to an instance of the floating-point FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ -void arm_fir_init_f32( - arm_fir_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 Biquad cascade filter. - */ -typedef struct -{ - int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ -} arm_biquad_casd_df1_inst_q15; - -/** - * @brief Instance structure for the Q31 Biquad cascade filter. - */ -typedef struct -{ - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ -} arm_biquad_casd_df1_inst_q31; - -/** - * @brief Instance structure for the floating-point Biquad cascade filter. - */ -typedef struct -{ - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_casd_df1_inst_f32; - - -/** - * @brief Processing function for the Q15 Biquad cascade filter. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_q15( - const arm_biquad_casd_df1_inst_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cascade_df1_init_q15( - arm_biquad_casd_df1_inst_q15 *S, - uint8_t numStages, - q15_t *pCoeffs, - q15_t *pState, - int8_t postShift); - - -/** - * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_fast_q15( - const arm_biquad_casd_df1_inst_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 Biquad cascade filter - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_q31( - const arm_biquad_casd_df1_inst_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_fast_q31( - const arm_biquad_casd_df1_inst_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cascade_df1_init_q31( - arm_biquad_casd_df1_inst_q31 *S, - uint8_t numStages, - q31_t *pCoeffs, - q31_t *pState, - int8_t postShift); - - -/** - * @brief Processing function for the floating-point Biquad cascade filter. - * @param[in] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_f32( - const arm_biquad_casd_df1_inst_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point Biquad cascade filter. - * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df1_init_f32( - arm_biquad_casd_df1_inst_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Instance structure for the floating-point matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float32_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_f32; - - -/** - * @brief Instance structure for the floating-point matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float64_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_f64; - -/** - * @brief Instance structure for the Q15 matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q15_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_q15; - -/** - * @brief Instance structure for the Q31 matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q31_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_q31; - - -/** - * @brief Floating-point matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pScratch); - - -/** - * @brief Q31, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_f32( - const arm_matrix_instance_f32 *pSrc, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_q15( - const arm_matrix_instance_q15 *pSrc, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_q31( - const arm_matrix_instance_q31 *pSrc, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pState); - - -/** - * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_fast_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pState); - - -/** - * @brief Q31 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_fast_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix scaling. - * @param[in] pSrc points to the input matrix - * @param[in] scale scale factor - * @param[out] pDst points to the output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_f32( - const arm_matrix_instance_f32 *pSrc, - float32_t scale, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_q15( - const arm_matrix_instance_q15 *pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_q31( - const arm_matrix_instance_q31 *pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Q31 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_q31( - arm_matrix_instance_q31 *S, - uint16_t nRows, - uint16_t nColumns, - q31_t *pData); - - -/** - * @brief Q15 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_q15( - arm_matrix_instance_q15 *S, - uint16_t nRows, - uint16_t nColumns, - q15_t *pData); - - -/** - * @brief Floating-point matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_f32( - arm_matrix_instance_f32 *S, - uint16_t nRows, - uint16_t nColumns, - float32_t *pData); - - - -/** - * @brief Instance structure for the Q15 PID Control. - */ -typedef struct -{ - q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ -#if !defined (ARM_MATH_DSP) - q15_t A1; - q15_t A2; -#else - q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ -#endif - q15_t state[3]; /**< The state array of length 3. */ - q15_t Kp; /**< The proportional gain. */ - q15_t Ki; /**< The integral gain. */ - q15_t Kd; /**< The derivative gain. */ -} arm_pid_instance_q15; - -/** - * @brief Instance structure for the Q31 PID Control. - */ -typedef struct -{ - q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - q31_t A2; /**< The derived gain, A2 = Kd . */ - q31_t state[3]; /**< The state array of length 3. */ - q31_t Kp; /**< The proportional gain. */ - q31_t Ki; /**< The integral gain. */ - q31_t Kd; /**< The derivative gain. */ -} arm_pid_instance_q31; - -/** - * @brief Instance structure for the floating-point PID Control. - */ -typedef struct -{ - float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - float32_t A2; /**< The derived gain, A2 = Kd . */ - float32_t state[3]; /**< The state array of length 3. */ - float32_t Kp; /**< The proportional gain. */ - float32_t Ki; /**< The integral gain. */ - float32_t Kd; /**< The derivative gain. */ -} arm_pid_instance_f32; - - - -/** - * @brief Initialization function for the floating-point PID Control. - * @param[in,out] S points to an instance of the PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_f32( - arm_pid_instance_f32 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - */ -void arm_pid_reset_f32( - arm_pid_instance_f32 *S); - - -/** - * @brief Initialization function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_q31( - arm_pid_instance_q31 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - */ - -void arm_pid_reset_q31( - arm_pid_instance_q31 *S); - - -/** - * @brief Initialization function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_q15( - arm_pid_instance_q15 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the Q15 PID Control. - * @param[in,out] S points to an instance of the q15 PID Control structure - */ -void arm_pid_reset_q15( - arm_pid_instance_q15 *S); - - -/** - * @brief Instance structure for the floating-point Linear Interpolate function. - */ -typedef struct -{ - uint32_t nValues; /**< nValues */ - float32_t x1; /**< x1 */ - float32_t xSpacing; /**< xSpacing */ - float32_t *pYData; /**< pointer to the table of Y values */ -} arm_linear_interp_instance_f32; - -/** - * @brief Instance structure for the floating-point bilinear interpolation function. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - float32_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_f32; - -/** -* @brief Instance structure for the Q31 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q31_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q31; - -/** -* @brief Instance structure for the Q15 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q15_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q15; - -/** -* @brief Instance structure for the Q15 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q7_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q7; - - -/** - * @brief Q7 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix2_instance_q15; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_q15( - arm_cfft_radix2_instance_q15 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_q15( - const arm_cfft_radix2_instance_q15 *S, - q15_t *pSrc); - - -/** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix4_instance_q15; - -/* Deprecated */ -arm_status arm_cfft_radix4_init_q15( - arm_cfft_radix4_instance_q15 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix4_q15( - const arm_cfft_radix4_instance_q15 *S, - q15_t *pSrc); - -/** - * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix2_instance_q31; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_q31( - arm_cfft_radix2_instance_q31 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_q31( - const arm_cfft_radix2_instance_q31 *S, - q31_t *pSrc); - -/** - * @brief Instance structure for the Q31 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix4_instance_q31; - -/* Deprecated */ -void arm_cfft_radix4_q31( - const arm_cfft_radix4_instance_q31 *S, - q31_t *pSrc); - -/* Deprecated */ -arm_status arm_cfft_radix4_init_q31( - arm_cfft_radix4_instance_q31 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ -} arm_cfft_radix2_instance_f32; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_f32( - arm_cfft_radix2_instance_f32 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_f32( - const arm_cfft_radix2_instance_f32 *S, - float32_t *pSrc); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ -} arm_cfft_radix4_instance_f32; - -/* Deprecated */ -arm_status arm_cfft_radix4_init_f32( - arm_cfft_radix4_instance_f32 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix4_f32( - const arm_cfft_radix4_instance_f32 *S, - float32_t *pSrc); - -/** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_q15; - -void arm_cfft_q15( - const arm_cfft_instance_q15 *S, - q15_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_q31; - -void arm_cfft_q31( - const arm_cfft_instance_q31 *S, - q31_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_f32; - -void arm_cfft_f32( - const arm_cfft_instance_f32 *S, - float32_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the Q15 RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_q15; - -arm_status arm_rfft_init_q15( - arm_rfft_instance_q15 *S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_q15( - const arm_rfft_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst); - -/** - * @brief Instance structure for the Q31 RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_q31; - -arm_status arm_rfft_init_q31( - arm_rfft_instance_q31 *S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_q31( - const arm_rfft_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst); - -/** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint16_t fftLenBy2; /**< length of the complex FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_f32; - -arm_status arm_rfft_init_f32( - arm_rfft_instance_f32 *S, - arm_cfft_radix4_instance_f32 *S_CFFT, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_f32( - const arm_rfft_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst); - -/** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct -{ - arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ - uint16_t fftLenRFFT; /**< length of the real sequence */ - float32_t *pTwiddleRFFT; /**< Twiddle factors real stage */ -} arm_rfft_fast_instance_f32 ; - -arm_status arm_rfft_fast_init_f32( - arm_rfft_fast_instance_f32 *S, - uint16_t fftLen); - -void arm_rfft_fast_f32( - arm_rfft_fast_instance_f32 *S, - float32_t *p, float32_t *pOut, - uint8_t ifftFlag); - -/** - * @brief Instance structure for the floating-point DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - float32_t normalize; /**< normalizing factor. */ - float32_t *pTwiddle; /**< points to the twiddle factor table. */ - float32_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_f32; - - -/** - * @brief Initialization function for the floating-point DCT4/IDCT4. - * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. - */ -arm_status arm_dct4_init_f32( - arm_dct4_instance_f32 *S, - arm_rfft_instance_f32 *S_RFFT, - arm_cfft_radix4_instance_f32 *S_CFFT, - uint16_t N, - uint16_t Nby2, - float32_t normalize); - - -/** - * @brief Processing function for the floating-point DCT4/IDCT4. - * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_f32( - const arm_dct4_instance_f32 *S, - float32_t *pState, - float32_t *pInlineBuffer); - - -/** - * @brief Instance structure for the Q31 DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q31_t normalize; /**< normalizing factor. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - q31_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_q31; - - -/** - * @brief Initialization function for the Q31 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure - * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ -arm_status arm_dct4_init_q31( - arm_dct4_instance_q31 *S, - arm_rfft_instance_q31 *S_RFFT, - arm_cfft_radix4_instance_q31 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize); - - -/** - * @brief Processing function for the Q31 DCT4/IDCT4. - * @param[in] S points to an instance of the Q31 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_q31( - const arm_dct4_instance_q31 *S, - q31_t *pState, - q31_t *pInlineBuffer); - - -/** - * @brief Instance structure for the Q15 DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q15_t normalize; /**< normalizing factor. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - q15_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_q15; - - -/** - * @brief Initialization function for the Q15 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ -arm_status arm_dct4_init_q15( - arm_dct4_instance_q15 *S, - arm_rfft_instance_q15 *S_RFFT, - arm_cfft_radix4_instance_q15 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize); - - -/** - * @brief Processing function for the Q15 DCT4/IDCT4. - * @param[in] S points to an instance of the Q15 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_q15( - const arm_dct4_instance_q15 *S, - q15_t *pState, - q15_t *pInlineBuffer); - - -/** - * @brief Floating-point vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a floating-point vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scale scale factor to be applied - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_f32( - float32_t *pSrc, - float32_t scale, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q7 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q7( - q7_t *pSrc, - q7_t scaleFract, - int8_t shift, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q15 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q15( - q15_t *pSrc, - q15_t scaleFract, - int8_t shift, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q31 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q31( - q31_t *pSrc, - q31_t scaleFract, - int8_t shift, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Dot product of floating-point vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_f32( - float32_t *pSrcA, - float32_t *pSrcB, - uint32_t blockSize, - float32_t *result); - - -/** - * @brief Dot product of Q7 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q7( - q7_t *pSrcA, - q7_t *pSrcB, - uint32_t blockSize, - q31_t *result); - - -/** - * @brief Dot product of Q15 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q15( - q15_t *pSrcA, - q15_t *pSrcB, - uint32_t blockSize, - q63_t *result); - - -/** - * @brief Dot product of Q31 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q31( - q31_t *pSrcA, - q31_t *pSrcB, - uint32_t blockSize, - q63_t *result); - - -/** - * @brief Shifts the elements of a Q7 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q7( - q7_t *pSrc, - int8_t shiftBits, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Shifts the elements of a Q15 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q15( - q15_t *pSrc, - int8_t shiftBits, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Shifts the elements of a Q31 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q31( - q31_t *pSrc, - int8_t shiftBits, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_f32( - float32_t *pSrc, - float32_t offset, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q7( - q7_t *pSrc, - q7_t offset, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q15( - q15_t *pSrc, - q15_t offset, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q31( - q31_t *pSrc, - q31_t offset, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a floating-point vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q7 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a floating-point vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_f32( - float32_t value, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q7 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q7( - q7_t value, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q15 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q15( - q15_t value, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q31 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q31( - q31_t value, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ -void arm_conv_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ -void arm_conv_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ -void arm_conv_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ -void arm_conv_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** -* @brief Convolution of Q7 sequences. -* @param[in] pSrcA points to the first input sequence. -* @param[in] srcALen length of the first input sequence. -* @param[in] pSrcB points to the second input sequence. -* @param[in] srcBLen length of the second input sequence. -* @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. -* @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. -* @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). -*/ -void arm_conv_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst); - - -/** - * @brief Partial convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q7 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Instance structure for the Q15 FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_f32; - - -/** - * @brief Processing function for the floating-point FIR decimator. - * @param[in] S points to an instance of the floating-point FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_f32( - const arm_fir_decimate_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR decimator. - * @param[in,out] S points to an instance of the floating-point FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_f32( - arm_fir_decimate_instance_f32 *S, - uint16_t numTaps, - uint8_t M, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR decimator. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_q15( - const arm_fir_decimate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_fast_q15( - const arm_fir_decimate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR decimator. - * @param[in,out] S points to an instance of the Q15 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_q15( - arm_fir_decimate_instance_q15 *S, - uint16_t numTaps, - uint8_t M, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR decimator. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_q31( - const arm_fir_decimate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - -/** - * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_fast_q31( - arm_fir_decimate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR decimator. - * @param[in,out] S points to an instance of the Q31 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_q31( - arm_fir_decimate_instance_q31 *S, - uint16_t numTaps, - uint8_t M, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ -} arm_fir_interpolate_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ -} arm_fir_interpolate_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ -} arm_fir_interpolate_instance_f32; - - -/** - * @brief Processing function for the Q15 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_q15( - const arm_fir_interpolate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR interpolator. - * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_q15( - arm_fir_interpolate_instance_q15 *S, - uint8_t L, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_q31( - const arm_fir_interpolate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR interpolator. - * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_q31( - arm_fir_interpolate_instance_q31 *S, - uint8_t L, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point FIR interpolator. - * @param[in] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_f32( - const arm_fir_interpolate_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR interpolator. - * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_f32( - arm_fir_interpolate_instance_f32 *S, - uint8_t L, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the high precision Q31 Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ -} arm_biquad_cas_df1_32x64_ins_q31; - - -/** - * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cas_df1_32x64_q31( - const arm_biquad_cas_df1_32x64_ins_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cas_df1_32x64_init_q31( - arm_biquad_cas_df1_32x64_ins_q31 *S, - uint8_t numStages, - q31_t *pCoeffs, - q63_t *pState, - uint8_t postShift); - - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_df2T_instance_f32; - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_stereo_df2T_instance_f32; - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_df2T_instance_f64; - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df2T_f32( - const arm_biquad_cascade_df2T_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_stereo_df2T_f32( - const arm_biquad_cascade_stereo_df2T_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df2T_f64( - const arm_biquad_cascade_df2T_instance_f64 *S, - float64_t *pSrc, - float64_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df2T_init_f32( - arm_biquad_cascade_df2T_instance_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_stereo_df2T_init_f32( - arm_biquad_cascade_stereo_df2T_instance_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df2T_init_f64( - arm_biquad_cascade_df2T_instance_f64 *S, - uint8_t numStages, - float64_t *pCoeffs, - float64_t *pState); - - -/** - * @brief Instance structure for the Q15 FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_f32; - - -/** - * @brief Initialization function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_q15( - arm_fir_lattice_instance_q15 *S, - uint16_t numStages, - q15_t *pCoeffs, - q15_t *pState); - - -/** - * @brief Processing function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_q15( - const arm_fir_lattice_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_q31( - arm_fir_lattice_instance_q31 *S, - uint16_t numStages, - q31_t *pCoeffs, - q31_t *pState); - - -/** - * @brief Processing function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_q31( - const arm_fir_lattice_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_f32( - arm_fir_lattice_instance_f32 *S, - uint16_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Processing function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_f32( - const arm_fir_lattice_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_q15; - -/** - * @brief Instance structure for the Q31 IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_q31; - -/** - * @brief Instance structure for the floating-point IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_f32; - - -/** - * @brief Processing function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_f32( - const arm_iir_lattice_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_init_f32( - arm_iir_lattice_instance_f32 *S, - uint16_t numStages, - float32_t *pkCoeffs, - float32_t *pvCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_q31( - const arm_iir_lattice_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_init_q31( - arm_iir_lattice_instance_q31 *S, - uint16_t numStages, - q31_t *pkCoeffs, - q31_t *pvCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the Q15 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_q15( - const arm_iir_lattice_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process per call. - */ -void arm_iir_lattice_init_q15( - arm_iir_lattice_instance_q15 *S, - uint16_t numStages, - q15_t *pkCoeffs, - q15_t *pvCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the floating-point LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that controls filter coefficient updates. */ -} arm_lms_instance_f32; - - -/** - * @brief Processing function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_f32( - const arm_lms_instance_f32 *S, - float32_t *pSrc, - float32_t *pRef, - float32_t *pOut, - float32_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_init_f32( - arm_lms_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - float32_t mu, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ -} arm_lms_instance_q15; - - -/** - * @brief Initialization function for the Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_init_q15( - arm_lms_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - q15_t mu, - uint32_t blockSize, - uint32_t postShift); - - -/** - * @brief Processing function for Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_q15( - const arm_lms_instance_q15 *S, - q15_t *pSrc, - q15_t *pRef, - q15_t *pOut, - q15_t *pErr, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q31 LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ -} arm_lms_instance_q31; - - -/** - * @brief Processing function for Q31 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_q31( - const arm_lms_instance_q31 *S, - q31_t *pSrc, - q31_t *pRef, - q31_t *pOut, - q31_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q31 LMS filter. - * @param[in] S points to an instance of the Q31 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_init_q31( - arm_lms_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - q31_t mu, - uint32_t blockSize, - uint32_t postShift); - - -/** - * @brief Instance structure for the floating-point normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that control filter coefficient updates. */ - float32_t energy; /**< saves previous frame energy. */ - float32_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_f32; - - -/** - * @brief Processing function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_f32( - arm_lms_norm_instance_f32 *S, - float32_t *pSrc, - float32_t *pRef, - float32_t *pOut, - float32_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_init_f32( - arm_lms_norm_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - float32_t mu, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q31 normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q31_t *recipTable; /**< points to the reciprocal initial value table. */ - q31_t energy; /**< saves previous frame energy. */ - q31_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_q31; - - -/** - * @brief Processing function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_q31( - arm_lms_norm_instance_q31 *S, - q31_t *pSrc, - q31_t *pRef, - q31_t *pOut, - q31_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_norm_init_q31( - arm_lms_norm_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - q31_t mu, - uint32_t blockSize, - uint8_t postShift); - - -/** - * @brief Instance structure for the Q15 normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< Number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q15_t *recipTable; /**< Points to the reciprocal initial value table. */ - q15_t energy; /**< saves previous frame energy. */ - q15_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_q15; - - -/** - * @brief Processing function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_q15( - arm_lms_norm_instance_q15 *S, - q15_t *pSrc, - q15_t *pRef, - q15_t *pOut, - q15_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_norm_init_q15( - arm_lms_norm_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - q15_t mu, - uint32_t blockSize, - uint8_t postShift); - - -/** - * @brief Correlation of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst); - - -/** -* @brief Correlation of Q15 sequences -* @param[in] pSrcA points to the first input sequence. -* @param[in] srcALen length of the first input sequence. -* @param[in] pSrcB points to the second input sequence. -* @param[in] srcBLen length of the second input sequence. -* @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. -* @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. -*/ -void arm_correlate_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch); - - -/** - * @brief Correlation of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - -void arm_correlate_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - -void arm_correlate_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ -void arm_correlate_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch); - - -/** - * @brief Correlation of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ -void arm_correlate_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst); - - -/** - * @brief Instance structure for the floating-point sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_f32; - -/** - * @brief Instance structure for the Q31 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q31; - -/** - * @brief Instance structure for the Q15 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q15; - -/** - * @brief Instance structure for the Q7 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q7; - - -/** - * @brief Processing function for the floating-point sparse FIR filter. - * @param[in] S points to an instance of the floating-point sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_f32( - arm_fir_sparse_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - float32_t *pScratchIn, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point sparse FIR filter. - * @param[in,out] S points to an instance of the floating-point sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_f32( - arm_fir_sparse_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 sparse FIR filter. - * @param[in] S points to an instance of the Q31 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q31( - arm_fir_sparse_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - q31_t *pScratchIn, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 sparse FIR filter. - * @param[in,out] S points to an instance of the Q31 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q31( - arm_fir_sparse_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 sparse FIR filter. - * @param[in] S points to an instance of the Q15 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q15( - arm_fir_sparse_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - q15_t *pScratchIn, - q31_t *pScratchOut, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 sparse FIR filter. - * @param[in,out] S points to an instance of the Q15 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q15( - arm_fir_sparse_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q7 sparse FIR filter. - * @param[in] S points to an instance of the Q7 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q7( - arm_fir_sparse_instance_q7 *S, - q7_t *pSrc, - q7_t *pDst, - q7_t *pScratchIn, - q31_t *pScratchOut, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q7 sparse FIR filter. - * @param[in,out] S points to an instance of the Q7 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q7( - arm_fir_sparse_instance_q7 *S, - uint16_t numTaps, - q7_t *pCoeffs, - q7_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Floating-point sin_cos function. - * @param[in] theta input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cos output. - */ -void arm_sin_cos_f32( - float32_t theta, - float32_t *pSinVal, - float32_t *pCosVal); - - -/** - * @brief Q31 sin_cos function. - * @param[in] theta scaled input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cosine output. - */ -void arm_sin_cos_q31( - q31_t theta, - q31_t *pSinVal, - q31_t *pCosVal); - - -/** - * @brief Floating-point complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - -/** - * @brief Q31 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @ingroup groupController - */ - -/** - * @defgroup PID PID Motor Control - * - * A Proportional Integral Derivative (PID) controller is a generic feedback control - * loop mechanism widely used in industrial control systems. - * A PID controller is the most commonly used type of feedback controller. - * - * This set of functions implements (PID) controllers - * for Q15, Q31, and floating-point data types. The functions operate on a single sample - * of data and each call to the function returns a single processed value. - * S points to an instance of the PID control data structure. in - * is the input sample value. The functions return the output value. - * - * \par Algorithm: - *
- *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
- *    A0 = Kp + Ki + Kd
- *    A1 = (-Kp ) - (2 * Kd )
- *    A2 = Kd  
- * - * \par - * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant - * - * \par - * \image html PID.gif "Proportional Integral Derivative Controller" - * - * \par - * The PID controller calculates an "error" value as the difference between - * the measured output and the reference input. - * The controller attempts to minimize the error by adjusting the process control inputs. - * The proportional value determines the reaction to the current error, - * the integral value determines the reaction based on the sum of recent errors, - * and the derivative value determines the reaction based on the rate at which the error has been changing. - * - * \par Instance Structure - * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. - * A separate instance structure must be defined for each PID Controller. - * There are separate instance structure declarations for each of the 3 supported data types. - * - * \par Reset Functions - * There is also an associated reset function for each data type which clears the state array. - * - * \par Initialization Functions - * There is also an associated initialization function for each data type. - * The initialization function performs the following operations: - * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. - * - Zeros out the values in the state buffer. - * - * \par - * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. - * - * \par Fixed-Point Behavior - * Care must be taken when using the fixed-point versions of the PID Controller functions. - * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup PID - * @{ - */ - -/** - * @brief Process function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - */ -CMSIS_INLINE __STATIC_INLINE float32_t arm_pid_f32( - arm_pid_instance_f32 *S, - float32_t in) -{ - float32_t out; - - /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ - out = (S->A0 * in) + - (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - -} - -/** - * @brief Process function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 64-bit accumulator. - * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. - * Thus, if the accumulator result overflows it wraps around rather than clip. - * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. - * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. - */ -CMSIS_INLINE __STATIC_INLINE q31_t arm_pid_q31( - arm_pid_instance_q31 *S, - q31_t in) -{ - q63_t acc; - q31_t out; - - /* acc = A0 * x[n] */ - acc = (q63_t) S->A0 * in; - - /* acc += A1 * x[n-1] */ - acc += (q63_t) S->A1 * S->state[0]; - - /* acc += A2 * x[n-2] */ - acc += (q63_t) S->A2 * S->state[1]; - - /* convert output to 1.31 format to add y[n-1] */ - out = (q31_t)(acc >> 31u); - - /* out += y[n-1] */ - out += S->state[2]; - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); -} - - -/** - * @brief Process function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using a 64-bit internal accumulator. - * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. - * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. - * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. - * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. - * Lastly, the accumulator is saturated to yield a result in 1.15 format. - */ -CMSIS_INLINE __STATIC_INLINE q15_t arm_pid_q15( - arm_pid_instance_q15 *S, - q15_t in) -{ - q63_t acc; - q15_t out; - -#if defined (ARM_MATH_DSP) - __SIMD32_TYPE *vstate; - - /* Implementation of PID controller */ - - /* acc = A0 * x[n] */ - acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - vstate = __SIMD32_CONST(S->state); - acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t) * vstate, (uint64_t)acc); -#else - /* acc = A0 * x[n] */ - acc = ((q31_t) S->A0) * in; - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - acc += (q31_t) S->A1 * S->state[0]; - acc += (q31_t) S->A2 * S->state[1]; -#endif - - /* acc += y[n-1] */ - acc += (q31_t) S->state[2] << 15; - - /* saturate the output */ - out = (q15_t)(__SSAT((acc >> 15), 16)); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); -} - -/** - * @} end of PID group - */ - - -/** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ -arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 *src, - arm_matrix_instance_f32 *dst); - - -/** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ -arm_status arm_mat_inverse_f64( - const arm_matrix_instance_f64 *src, - arm_matrix_instance_f64 *dst); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup clarke Vector Clarke Transform - * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. - * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents - * in the two-phase orthogonal stator axis Ialpha and Ibeta. - * When Ialpha is superposed with Ia as shown in the figure below - * \image html clarke.gif Stator current space vector and its components in (a,b). - * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta - * can be calculated using only Ia and Ib. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeFormula.gif - * where Ia and Ib are the instantaneous stator phases and - * pIalpha and pIbeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup clarke - * @{ - */ - -/** - * - * @brief Floating-point Clarke transform - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - */ -CMSIS_INLINE __STATIC_INLINE void arm_clarke_f32( - float32_t Ia, - float32_t Ib, - float32_t *pIalpha, - float32_t *pIbeta) -{ - /* Calculate pIalpha using the equation, pIalpha = Ia */ - *pIalpha = Ia; - - /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ - *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); -} - - -/** - * @brief Clarke transform for Q31 version - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_clarke_q31( - q31_t Ia, - q31_t Ib, - q31_t *pIalpha, - q31_t *pIbeta) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIalpha from Ia by equation pIalpha = Ia */ - *pIalpha = Ia; - - /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ - product1 = (q31_t)(((q63_t) Ia * 0x24F34E8B) >> 30); - - /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ - product2 = (q31_t)(((q63_t) Ib * 0x49E69D16) >> 30); - - /* pIbeta is calculated by adding the intermediate products */ - *pIbeta = __QADD(product1, product2); -} - -/** - * @} end of clarke group - */ - -/** - * @brief Converts the elements of the Q7 vector to Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_q7_to_q31( - q7_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup inv_clarke Vector Inverse Clarke Transform - * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeInvFormula.gif - * where pIa and pIb are the instantaneous stator phases and - * Ialpha and Ibeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup inv_clarke - * @{ - */ - -/** -* @brief Floating-point Inverse Clarke transform -* @param[in] Ialpha input two-phase orthogonal vector axis alpha -* @param[in] Ibeta input two-phase orthogonal vector axis beta -* @param[out] pIa points to output three-phase coordinate a -* @param[out] pIb points to output three-phase coordinate b -*/ -CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t *pIa, - float32_t *pIb) -{ - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ - *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; -} - - -/** - * @brief Inverse Clarke transform for Q31 version - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the subtraction, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t *pIa, - q31_t *pIb) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ - product1 = (q31_t)(((q63_t)(Ialpha) * (0x40000000)) >> 31); - - /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ - product2 = (q31_t)(((q63_t)(Ibeta) * (0x6ED9EBA1)) >> 31); - - /* pIb is calculated by subtracting the products */ - *pIb = __QSUB(product2, product1); -} - -/** - * @} end of inv_clarke group - */ - -/** - * @brief Converts the elements of the Q7 vector to Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_q7_to_q15( - q7_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup park Vector Park Transform - * - * Forward Park transform converts the input two-coordinate vector to flux and torque components. - * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents - * from the stationary to the moving reference frame and control the spatial relationship between - * the stator vector current and rotor flux vector. - * If we consider the d axis aligned with the rotor flux, the diagram below shows the - * current vector and the relationship from the two reference frames: - * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkFormula.gif - * where Ialpha and Ibeta are the stator vector components, - * pId and pIq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup park - * @{ - */ - -/** - * @brief Floating-point Park transform - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * The function implements the forward Park transform. - * - */ -CMSIS_INLINE __STATIC_INLINE void arm_park_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t *pId, - float32_t *pIq, - float32_t sinVal, - float32_t cosVal) -{ - /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ - *pId = Ialpha * cosVal + Ibeta * sinVal; - - /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ - *pIq = -Ialpha * sinVal + Ibeta * cosVal; -} - - -/** - * @brief Park transform for Q31 version - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition and subtraction, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_park_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t *pId, - q31_t *pIq, - q31_t sinVal, - q31_t cosVal) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Ialpha * cosVal) */ - product1 = (q31_t)(((q63_t)(Ialpha) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * sinVal) */ - product2 = (q31_t)(((q63_t)(Ibeta) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Ialpha * sinVal) */ - product3 = (q31_t)(((q63_t)(Ialpha) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * cosVal) */ - product4 = (q31_t)(((q63_t)(Ibeta) * (cosVal)) >> 31); - - /* Calculate pId by adding the two intermediate products 1 and 2 */ - *pId = __QADD(product1, product2); - - /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ - *pIq = __QSUB(product4, product3); -} - -/** - * @} end of park group - */ - -/** - * @brief Converts the elements of the Q7 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q7_to_float( - q7_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @ingroup groupController - */ - -/** - * @defgroup inv_park Vector Inverse Park transform - * Inverse Park transform converts the input flux and torque components to two-coordinate vector. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkInvFormula.gif - * where pIalpha and pIbeta are the stator vector components, - * Id and Iq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup inv_park - * @{ - */ - -/** -* @brief Floating-point Inverse Park transform -* @param[in] Id input coordinate of rotor reference frame d -* @param[in] Iq input coordinate of rotor reference frame q -* @param[out] pIalpha points to output two-phase orthogonal vector axis alpha -* @param[out] pIbeta points to output two-phase orthogonal vector axis beta -* @param[in] sinVal sine value of rotation angle theta -* @param[in] cosVal cosine value of rotation angle theta -*/ -CMSIS_INLINE __STATIC_INLINE void arm_inv_park_f32( - float32_t Id, - float32_t Iq, - float32_t *pIalpha, - float32_t *pIbeta, - float32_t sinVal, - float32_t cosVal) -{ - /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ - *pIalpha = Id * cosVal - Iq * sinVal; - - /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ - *pIbeta = Id * sinVal + Iq * cosVal; -} - - -/** - * @brief Inverse Park transform for Q31 version - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ -CMSIS_INLINE __STATIC_INLINE void arm_inv_park_q31( - q31_t Id, - q31_t Iq, - q31_t *pIalpha, - q31_t *pIbeta, - q31_t sinVal, - q31_t cosVal) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Id * cosVal) */ - product1 = (q31_t)(((q63_t)(Id) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Iq * sinVal) */ - product2 = (q31_t)(((q63_t)(Iq) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Id * sinVal) */ - product3 = (q31_t)(((q63_t)(Id) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Iq * cosVal) */ - product4 = (q31_t)(((q63_t)(Iq) * (cosVal)) >> 31); - - /* Calculate pIalpha by using the two intermediate products 1 and 2 */ - *pIalpha = __QSUB(product1, product2); - - /* Calculate pIbeta by using the two intermediate products 3 and 4 */ - *pIbeta = __QADD(product4, product3); -} - -/** - * @} end of Inverse park group - */ - - -/** - * @brief Converts the elements of the Q31 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_float( - q31_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - -/** - * @ingroup groupInterpolation - */ - -/** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
- *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
- *       where x0, x1 are nearest values of input x
- *             y0, y1 are nearest values to output y
- * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ - -/** - * @addtogroup LinearInterpolate - * @{ - */ - -/** - * @brief Process function for the floating-point Linear Interpolation Function. - * @param[in,out] S is an instance of the floating-point Linear Interpolation structure - * @param[in] x input sample to process - * @return y processed output sample. - * - */ -CMSIS_INLINE __STATIC_INLINE float32_t arm_linear_interp_f32( - arm_linear_interp_instance_f32 *S, - float32_t x) -{ - float32_t y; - float32_t x0, x1; /* Nearest input values */ - float32_t y0, y1; /* Nearest output values */ - float32_t xSpacing = S->xSpacing; /* spacing between input values */ - int32_t i; /* Index variable */ - float32_t *pYData = S->pYData; /* pointer to output table */ - - /* Calculation of index */ - i = (int32_t)((x - S->x1) / xSpacing); - - if (i < 0) - { - /* Iniatilize output for below specified range as least output value of table */ - y = pYData[0]; - } - else if ((uint32_t)i >= S->nValues) - { - /* Iniatilize output for above specified range as last output value of table */ - y = pYData[S->nValues - 1]; - } - else - { - /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; - - /* Read of nearest output values */ - y0 = pYData[i]; - y1 = pYData[i + 1]; - - /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); - - } - - /* returns output value */ - return (y); -} - - -/** -* -* @brief Process function for the Q31 Linear Interpolation Function. -* @param[in] pYData pointer to Q31 Linear Interpolation table -* @param[in] x input sample to process -* @param[in] nValues number of table values -* @return y processed output sample. -* -* \par -* Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. -* This function can support maximum of table size 2^12. -* -*/ -CMSIS_INLINE __STATIC_INLINE q31_t arm_linear_interp_q31( - q31_t *pYData, - q31_t x, - uint32_t nValues) -{ - q31_t y; /* output */ - q31_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (q31_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* shift left by 11 to keep fract in 1.31 format */ - fract = (x & 0x000FFFFF) << 11; - - /* Read two nearest output values from the index in 1.31(q31) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 2.30 format */ - y = ((q31_t)((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); - - /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ - y += ((q31_t)(((q63_t) y1 * fract) >> 32)); - - /* Convert y to 1.31 format */ - return (y << 1u); - } -} - - -/** - * - * @brief Process function for the Q15 Linear Interpolation Function. - * @param[in] pYData pointer to Q15 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ -CMSIS_INLINE __STATIC_INLINE q15_t arm_linear_interp_q15( - q15_t *pYData, - q31_t x, - uint32_t nValues) -{ - q63_t y; /* output */ - q15_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (int32_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 13.35 format */ - y = ((q63_t) y0 * (0xFFFFF - fract)); - - /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ - y += ((q63_t) y1 * (fract)); - - /* convert y to 1.15 format */ - return (q15_t)(y >> 20); - } -} - - -/** - * - * @brief Process function for the Q7 Linear Interpolation Function. - * @param[in] pYData pointer to Q7 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - */ -CMSIS_INLINE __STATIC_INLINE q7_t arm_linear_interp_q7( - q7_t *pYData, - q31_t x, - uint32_t nValues) -{ - q31_t y; /* output */ - q7_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - uint32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - if (x < 0) - { - return (pYData[0]); - } - index = (x >> 20) & 0xfff; - - if (index >= (nValues - 1)) - { - return (pYData[nValues - 1]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index and are in 1.7(q7) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ - y = ((y0 * (0xFFFFF - fract))); - - /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ - y += (y1 * fract); - - /* convert y to 1.7(q7) format */ - return (q7_t)(y >> 20); - } -} - -/** - * @} end of LinearInterpolate group - */ - -/** - * @brief Fast approximation to the trigonometric sine function for floating-point data. - * @param[in] x input value in radians. - * @return sin(x). - */ -float32_t arm_sin_f32( - float32_t x); - - -/** - * @brief Fast approximation to the trigonometric sine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ -q31_t arm_sin_q31( - q31_t x); - - -/** - * @brief Fast approximation to the trigonometric sine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ -q15_t arm_sin_q15( - q15_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for floating-point data. - * @param[in] x input value in radians. - * @return cos(x). - */ -float32_t arm_cos_f32( - float32_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ -q31_t arm_cos_q31( - q31_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ -q15_t arm_cos_q15( - q15_t x); - - -/** - * @ingroup groupFastMath - */ - - -/** - * @defgroup SQRT Square Root - * - * Computes the square root of a number. - * There are separate functions for Q15, Q31, and floating-point data types. - * The square root function is computed using the Newton-Raphson algorithm. - * This is an iterative algorithm of the form: - *
- *      x1 = x0 - f(x0)/f'(x0)
- * 
- * where x1 is the current estimate, - * x0 is the previous estimate, and - * f'(x0) is the derivative of f() evaluated at x0. - * For the square root function, the algorithm reduces to: - *
- *     x0 = in/2                         [initial guess]
- *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
- * 
- */ - - -/** - * @addtogroup SQRT - * @{ - */ - -/** - * @brief Floating-point square root function. - * @param[in] in input value. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -CMSIS_INLINE __STATIC_INLINE arm_status arm_sqrt_f32( - float32_t in, - float32_t *pOut) -{ - if (in >= 0.0f) - { - -#if (__FPU_USED == 1) && defined ( __CC_ARM ) - *pOut = __sqrtf(in); -#elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined(__GNUC__) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) - __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); -#else - *pOut = sqrtf(in); -#endif - - return (ARM_MATH_SUCCESS); - } - else - { - *pOut = 0.0f; - return (ARM_MATH_ARGUMENT_ERROR); - } -} - - -/** - * @brief Q31 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -arm_status arm_sqrt_q31( - q31_t in, - q31_t *pOut); - - -/** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -arm_status arm_sqrt_q15( - q15_t in, - q15_t *pOut); - -/** - * @} end of SQRT group - */ - - -/** - * @brief floating-point Circular write function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_f32( - int32_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const int32_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - - -/** - * @brief floating-point Circular Read function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularRead_f32( - int32_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - int32_t *dst, - int32_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (int32_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Q15 Circular write function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q15( - q15_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const q15_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - -/** - * @brief Q15 Circular Read function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q15( - q15_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - q15_t *dst, - q15_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q15_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update wOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Q7 Circular write function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q7( - q7_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const q7_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - -/** - * @brief Q7 Circular Read function. - */ -CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q7( - q7_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - q7_t *dst, - q7_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q7_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Sum of the squares of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q31( - q31_t *pSrc, - uint32_t blockSize, - q63_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q15( - q15_t *pSrc, - uint32_t blockSize, - q63_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q7( - q7_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Mean value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *pResult); - - -/** - * @brief Mean value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Mean value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Mean value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Variance of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Variance of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Variance of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Standard deviation of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Standard deviation of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Standard deviation of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Floating-point complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_q15( - q15_t *pSrcA, - q15_t *pSrcB, - uint32_t numSamples, - q31_t *realResult, - q31_t *imagResult); - - -/** - * @brief Q31 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_q31( - q31_t *pSrcA, - q31_t *pSrcB, - uint32_t numSamples, - q63_t *realResult, - q63_t *imagResult); - - -/** - * @brief Floating-point complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_f32( - float32_t *pSrcA, - float32_t *pSrcB, - uint32_t numSamples, - float32_t *realResult, - float32_t *imagResult); - - -/** - * @brief Q15 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_q15( - q15_t *pSrcCmplx, - q15_t *pSrcReal, - q15_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_q31( - q31_t *pSrcCmplx, - q31_t *pSrcReal, - q31_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_f32( - float32_t *pSrcCmplx, - float32_t *pSrcReal, - float32_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Minimum value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] result is output pointer - * @param[in] index is the array index of the minimum value in the input buffer. - */ -void arm_min_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *result, - uint32_t *index); - - -/** - * @brief Minimum value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[in] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Minimum value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Minimum value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q7 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q15 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q31 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a floating-point vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Q15 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Converts the elements of the floating-point vector to Q31 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q31 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q31( - float32_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the floating-point vector to Q15 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q15( - float32_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the floating-point vector to Q7 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q7 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q7( - float32_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q31 vector to Q15 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_q15( - q31_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q31 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_q7( - q31_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_float( - q15_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to Q31 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_q31( - q15_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_q7( - q15_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @ingroup groupInterpolation - */ - -/** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
- *   typedef struct
- *   {
- *     uint16_t numRows;
- *     uint16_t numCols;
- *     float32_t *pData;
- * } arm_bilinear_interp_instance_f32;
- * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
- *     XF = floor(x)
- *     YF = floor(y)
- * 
- * \par - * The interpolated output point is computed as: - *
- *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
- *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
- *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
- *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
- * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ - -/** - * @addtogroup BilinearInterpolate - * @{ - */ - - -/** -* -* @brief Floating-point bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate. -* @param[in] Y interpolation coordinate. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE float32_t arm_bilinear_interp_f32( - const arm_bilinear_interp_instance_f32 *S, - float32_t X, - float32_t Y) -{ - float32_t out; - float32_t f00, f01, f10, f11; - float32_t *pData = S->pData; - int32_t xIndex, yIndex, index; - float32_t xdiff, ydiff; - float32_t b1, b2, b3, b4; - - xIndex = (int32_t) X; - yIndex = (int32_t) Y; - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) - { - return (0); - } - - /* Calculation of index for two nearest points in X-direction */ - index = (xIndex - 1) + (yIndex - 1) * S->numCols; - - - /* Read two nearest points in X-direction */ - f00 = pData[index]; - f01 = pData[index + 1]; - - /* Calculation of index for two nearest points in Y-direction */ - index = (xIndex - 1) + (yIndex) * S->numCols; - - - /* Read two nearest points in Y-direction */ - f10 = pData[index]; - f11 = pData[index + 1]; - - /* Calculation of intermediate values */ - b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; - - /* Calculation of fractional part in X */ - xdiff = X - xIndex; - - /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; - - /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; - - /* return to application */ - return (out); -} - - -/** -* -* @brief Q31 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE q31_t arm_bilinear_interp_q31( - arm_bilinear_interp_instance_q31 *S, - q31_t X, - q31_t Y) -{ - q31_t out; /* Temporary output */ - q31_t acc = 0; /* output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q31_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q31_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* shift left xfract by 11 to keep 1.31 format */ - xfract = (X & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; - x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; - - /* 20 bits for the fractional part */ - /* shift left yfract by 11 to keep 1.31 format */ - yfract = (Y & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; - y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ - out = ((q31_t)(((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); - acc = ((q31_t)(((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); - - /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); - acc += ((q31_t)((q63_t) out * (xfract) >> 32)); - - /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); - acc += ((q31_t)((q63_t) out * (yfract) >> 32)); - - /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) y2 * (xfract) >> 32)); - acc += ((q31_t)((q63_t) out * (yfract) >> 32)); - - /* Convert acc to 1.31(q31) format */ - return ((q31_t)(acc << 2)); -} - - -/** -* @brief Q15 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15( - arm_bilinear_interp_instance_q15 *S, - q31_t X, - q31_t Y) -{ - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q15_t x1, x2, y1, y2; /* Nearest output values */ - q31_t xfract, yfract; /* X, Y fractional parts */ - int32_t rI, cI; /* Row and column indices */ - q15_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ - - /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ - /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ - out = (q31_t)(((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); - acc = ((q63_t) out * (0xFFFFF - yfract)); - - /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); - acc += ((q63_t) out * (xfract)); - - /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) y2 * (xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* acc is in 13.51 format and down shift acc by 36 times */ - /* Convert out to 1.15 format */ - return ((q15_t)(acc >> 36)); -} - - -/** -* @brief Q7 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7( - arm_bilinear_interp_instance_q7 *S, - q31_t X, - q31_t Y) -{ - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q7_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q7_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ - out = ((x1 * (0xFFFFF - xfract))); - acc = (((q63_t) out * (0xFFFFF - yfract))); - - /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ - out = ((x2 * (0xFFFFF - yfract))); - acc += (((q63_t) out * (xfract))); - - /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y1 * (0xFFFFF - xfract))); - acc += (((q63_t) out * (yfract))); - - /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y2 * (yfract))); - acc += (((q63_t) out * (xfract))); - - /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ - return ((q7_t)(acc >> 40)); -} - -/** - * @} end of BilinearInterpolate group - */ - - -/* SMMLAR */ -#define multAcc_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMLSR */ -#define multSub_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMULR */ -#define mult_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) - -/* SMMLA */ -#define multAcc_32x32_keep32(a, x, y) \ - a += (q31_t) (((q63_t) x * y) >> 32) - -/* SMMLS */ -#define multSub_32x32_keep32(a, x, y) \ - a -= (q31_t) (((q63_t) x * y) >> 32) - -/* SMMUL */ -#define mult_32x32_keep32(a, x, y) \ - a = (q31_t) (((q63_t) x * y ) >> 32) - - -#if defined ( __CC_ARM ) -/* Enter low optimization region - place directly above function definition */ -#if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) -#define LOW_OPTIMIZATION_ENTER \ - _Pragma ("push") \ - _Pragma ("O1") -#else -#define LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) -#define LOW_OPTIMIZATION_EXIT \ - _Pragma ("pop") -#else -#define LOW_OPTIMIZATION_EXIT -#endif - -/* Enter low optimization region - place directly above function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER - -/* Exit low optimization region - place directly after end of function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined (__ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __GNUC__ ) -#define LOW_OPTIMIZATION_ENTER \ - __attribute__(( optimize("-O1") )) -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __ICCARM__ ) -/* Enter low optimization region - place directly above function definition */ -#if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) -#define LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") -#else -#define LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#define LOW_OPTIMIZATION_EXIT - -/* Enter low optimization region - place directly above function definition */ -#if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") -#else -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __TI_ARM__ ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __CSMC__ ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined ( __TASKING__ ) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#endif - - -#ifdef __cplusplus -} -#endif - -/* Compiler specific diagnostic adjustment */ -#if defined ( __CC_ARM ) - -#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) - -#elif defined ( __GNUC__ ) - #pragma GCC diagnostic pop - -#elif defined ( __ICCARM__ ) - -#elif defined ( __TI_ARM__ ) - -#elif defined ( __CSMC__ ) - -#elif defined ( __TASKING__ ) - -#else - #error Unknown compiler -#endif - -#endif /* _ARM_MATH_H */ - -/** - * - * End of file. - */ diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc.h deleted file mode 100644 index 0e11c37d430..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc.h +++ /dev/null @@ -1,814 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc.h - * @brief CMSIS compiler ARMCC (ARM compiler V5) header file - * @version V5.0.2 - * @date 13. February 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#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 - -/* ########################### 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)) ) */ - - -#if ((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 -} - -#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __rev - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_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; - int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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) - -#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/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc_V6.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc_V6.h deleted file mode 100644 index 6d8f998d84f..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armcc_V6.h +++ /dev/null @@ -1,1804 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc_V6.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_ARMCC_V6_H -#define __CMSIS_ARMCC_V6_H - - -/* ########################### 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, control" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile("MSR control, %0" : : "r"(control) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get IPSR Register (non-secure) - \details Returns the content of the non-secure IPSR Register when in secure state. - \return IPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_IPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get APSR Register (non-secure) - \details Returns the content of the non-secure APSR Register when in secure state. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_APSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get xPSR Register (non-secure) - \details Returns the content of the non-secure xPSR Register when in secure state. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_xPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp, %0" : : "r"(topOfProcStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp_ns, %0" : : "r"(topOfProcStack) : "sp"); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp, %0" : : "r"(topOfMainStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp_ns, %0" : : "r"(topOfMainStack) : "sp"); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, primask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile("MSR primask, %0" : : "r"(priMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile("MSR primask_ns, %0" : : "r"(priMask) : "memory"); -} -#endif - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, basepri" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile("MSR basepri, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_ns, %0" : : "r"(value) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile("MSR basepri_max, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Base Priority with condition (non_secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_MAX_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_max_ns, %0" : : "r"(value) : "memory"); -} -#endif - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, faultmask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask, %0" : : "r"(faultMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask_ns, %0" : : "r"(faultMask) : "memory"); -} -#endif - - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \brief Get Process Stack Pointer Limit - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim, %0" : : "r"(ProcStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim_ns, %0\n" : : "r"(ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim" : "=r"(result)); - - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim, %0" : : "r"(MainStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim_ns, %0" : : "r"(MainStackPtrLimit)); -} -#endif - -#endif /* (__ARM_ARCH_8M__ == 1U) */ - - -#if ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=4 */ - -/** - \brief Get FPSCR - \details eturns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#define __get_FPSCR __builtin_arm_get_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get FPSCR (non-secure) - \details Returns the current value of the non-secure Floating Point Status/Control register when in secure state. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FPSCR_NS(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr_ns" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#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 - */ -#define __set_FPSCR __builtin_arm_set_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set FPSCR (non-secure) - \details Assigns the given value to the non-secure Floating Point Status/Control register when in secure state. - \param [in] fpscr Floating Point Status/Control value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FPSCR_NS(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr_ns, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#endif /* ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __builtin_bswap32 - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16 __builtin_bswap16 /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -#if 0 -__attribute__((always_inline)) __STATIC_INLINE 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); -} -#endif - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -/* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ - int32_t result; - - __ASM volatile("revsh %0, %1" : __CMSIS_GCC_OUT_REG(result) : __CMSIS_GCC_USE_REG(value)); - return (result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -/* ToDo: ARMCC_V6: check if __builtin_arm_rbit is supported */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - __ASM volatile("rbit %0, %1" : "=r"(result) : "r"(value)); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \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 - - -/** - \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*/ -#define __SSAT(ARG1,ARG2) \ -({ \ - 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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat -#if 0 -#define __USAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) -#endif - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile("strt %1, %0" : "=Q"(*ptr) : "r"(value)); -} - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 /* (__ARM_ARCH_8M__ == 1U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__ARM_FEATURE_DSP == 1U) /* ToDo: ARMCC_V6: This should be ARCH >= ARMv7-M + SIMD */ - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) \ -({ \ - uint32_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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("uxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("sxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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 __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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_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 == 1U) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_V6_H */ diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armclang.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armclang.h deleted file mode 100644 index c32e8531106..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_armclang.h +++ /dev/null @@ -1,1809 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang.h - * @brief CMSIS compiler ARMCLANG (ARM compiler V6) header file - * @version V5.0.3 - * @date 27. March 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 - -#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 __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 - - -/* ########################### 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_SP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim" : "=r"(result)); - return (result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim, %0" : : "r"(ProcStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim_ns, %0\n" : : "r"(ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim" : "=r"(result)); - - return (result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim, %0" : : "r"(MainStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim_ns, %0" : : "r"(MainStackPtrLimit)); -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -/* #define __get_FPSCR __builtin_arm_get_fpscr */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - uint32_t result; - - __ASM volatile("VMRS %0, fpscr" : "=r"(result)); - return (result); -#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 - */ -/* #define __set_FPSCR __builtin_arm_set_fpscr */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - __ASM volatile("VMSR fpscr, %0" : : "r"(fpscr) : "memory"); -#else - (void)fpscr; -#endif -} - -#endif /* ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __builtin_bswap32 - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16 __builtin_bswap16 /* ToDo ARMCLANG: check if __builtin_bswap16 could be used */ -#if 0 -__attribute__((always_inline)) __STATIC_INLINE 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); -} -#endif - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -/* ToDo ARMCLANG: check if __builtin_bswap16 could be used */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ - int32_t result; - - __ASM volatile("revsh %0, %1" : __CMSIS_GCC_OUT_REG(result) : __CMSIS_GCC_USE_REG(value)); - return (result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -/* ToDo ARMCLANG: check if __builtin_arm_rbit is supported */ -__attribute__((always_inline)) __STATIC_INLINE 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 - int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile("strt %1, %0" : "=Q"(*ptr) : "r"(value)); -} - -#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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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)) - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("uxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("sxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) ) - -__attribute__((always_inline)) __STATIC_INLINE 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/nuvoton/libraries/m460/CMSIS/Include/cmsis_compiler.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_compiler.h deleted file mode 100644 index 971380b7d1e..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_compiler.h +++ /dev/null @@ -1,368 +0,0 @@ -/**************************************************************************//** - * @file cmsis_compiler.h - * @brief CMSIS compiler generic header file - * @version V5.0.2 - * @date 13. February 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#include "cmsis_armclang.h" - - -/* - * GNU Compiler - */ -#elif defined ( __GNUC__ ) -#include "cmsis_gcc.h" - - -/* - * IAR Compiler - */ -#elif defined ( __ICCARM__ ) - - -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif - -#include - -/* CMSIS compiler control architecture macros */ -#if (__CORE__ == __ARM6M__) || (__CORE__ == __ARM6SM__) - #ifndef __ARM_ARCH_6M__ - #define __ARM_ARCH_6M__ 1 - #endif -#elif (__CORE__ == __ARM7M__) - #ifndef __ARM_ARCH_7M__ - #define __ARM_ARCH_7M__ 1 - #endif -#elif (__CORE__ == __ARM7EM__) - #ifndef __ARM_ARCH_7EM__ - #define __ARM_ARCH_7EM__ 1 - #endif -#endif - -#ifndef __NO_RETURN - #define __NO_RETURN __noreturn -#endif -#ifndef __USED - #define __USED __root -#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 - -// Workaround for missing __CLZ intrinsic in -// various versions of the IAR compilers. -// __IAR_FEATURE_CLZ__ should be defined by -// the compiler that supports __CLZ internally. -#if (defined (__ARM_ARCH_6M__)) && (__ARM_ARCH_6M__ == 1) && (!defined (__IAR_FEATURE_CLZ__)) -__STATIC_INLINE uint32_t __CLZ(uint32_t data) -{ - if (data == 0u) - { - return 32u; - } - - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while ((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); -} -#endif - - -/* - * 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 __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 - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT -#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 __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 - - -/* - * 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 __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 - - -#else -#error Unknown compiler. -#endif - - -#endif /* __CMSIS_COMPILER_H */ - diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_gcc.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_gcc.h deleted file mode 100644 index 3f0ad4bf52e..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_gcc.h +++ /dev/null @@ -1,1986 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS compiler GCC header file - * @version V5.0.2 - * @date 13. February 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 __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 - - -/* ########################### 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_SP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim" : "=r"(result)); - return (result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim, %0" : : "r"(ProcStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim_ns, %0\n" : : "r"(ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim" : "=r"(result)); - - return (result); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim, %0" : : "r"(MainStackPtrLimit)); -} - - -#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ - (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim_ns, %0" : : "r"(MainStackPtrLimit)); -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE 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) || (__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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) || (__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 -} - -#endif /* ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - - -/*@} 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. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) -//{ -// __ASM volatile ("nop"); -//} -#define __NOP() __ASM volatile ("nop") /* This implementation generates debug information */ - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) -//{ -// __ASM volatile ("wfi"); -//} -#define __WFI() __ASM volatile ("wfi") /* This implementation generates debug information */ - - -/** - \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. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) -//{ -// __ASM volatile ("wfe"); -//} -#define __WFE() __ASM volatile ("wfe") /* This implementation generates debug information */ - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -//__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) -//{ -// __ASM volatile ("sev"); -//} -#define __SEV() __ASM volatile ("sev") /* This implementation generates debug information */ - - -/** - \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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) -{ - __ASM volatile("dmb 0xF"::: "memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (short)__builtin_bswap16(value); -#else - int32_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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT(ARG1,ARG2) \ -({ \ - 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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1,ARG2) \ -({ \ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile("strt %1, %0" : "=Q"(*ptr) : "r"(value)); -} - -#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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 (__ARM_FEATURE_DSP == 1) /* ToDo ARMCLANG: This should be ARCH >= ARMv7-M + SIMD */ - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("uxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("sxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) ) - -__attribute__((always_inline)) __STATIC_INLINE 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/nuvoton/libraries/m460/CMSIS/Include/cmsis_version.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_version.h deleted file mode 100644 index ec46136a646..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/cmsis_version.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************//** - * @file cmsis_version.h - * @brief CMSIS Core(M) Version definitions - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 ( 0U) /*!< [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/nuvoton/libraries/m460/CMSIS/Include/core_armv8mbl.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_armv8mbl.h deleted file mode 100644 index f37a244eda8..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_armv8mbl.h +++ /dev/null @@ -1,1878 +0,0 @@ -/**************************************************************************//** - * @file core_armv8mbl.h - * @brief CMSIS ARMv8MBL Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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_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 -{ - __IOM 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 */ - __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 */ - uint32_t RESERVED0[7U]; - __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; - -/* 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 ARMv8-M Baseline */ -/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for ARMv8-M Baseline */ -#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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } -} - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 */ - - -/* ########################## 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/nuvoton/libraries/m460/CMSIS/Include/core_armv8mml.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_armv8mml.h deleted file mode 100644 index 060d81e3237..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_armv8mml.h +++ /dev/null @@ -1,2902 +0,0 @@ -/**************************************************************************//** - * @file core_armv8mml.h - * @brief CMSIS ARMv8MML Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#if defined __ARM_PCS_VFP -#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_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 */ - 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_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 -{ - __IOM 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 */ - __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]; - __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; - -/* 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_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHPR[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB_NS->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB_NS->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ - -/*@} 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) -{ - 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/nuvoton/libraries/m460/CMSIS/Include/core_cm0.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm0.h deleted file mode 100644 index f78676fbb4f..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm0.h +++ /dev/null @@ -1,888 +0,0 @@ -/**************************************************************************//** - * @file core_cm0.h - * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 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_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 not available for Cortex-M0 */ -/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for Cortex-M0 */ -#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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_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[0U] & (1UL << (((uint32_t)(int32_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)(int32_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)(int32_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)(int32_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)(int32_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. - 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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m460/CMSIS/Include/core_cm0plus.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm0plus.h deleted file mode 100644 index d301f0437a6..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm0plus.h +++ /dev/null @@ -1,1021 +0,0 @@ -/**************************************************************************//** - * @file core_cm0plus.h - * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 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 */ -#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; - -/* 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 not available for Cortex-M0+ */ -/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for Cortex-M0+ */ -#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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_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[0U] & (1UL << (((uint32_t)(int32_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)(int32_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)(int32_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)(int32_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)(int32_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. - 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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m460/CMSIS/Include/core_cm23.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm23.h deleted file mode 100644 index fabf1bff2e1..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm23.h +++ /dev/null @@ -1,1878 +0,0 @@ -/**************************************************************************//** - * @file core_cm23.h - * @brief CMSIS Cortex-M23 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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_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 -{ - __IOM 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 */ - __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 */ - uint32_t RESERVED0[7U]; - __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; - -/* 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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } -} - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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 */ - - -/* ########################## 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/nuvoton/libraries/m460/CMSIS/Include/core_cm3.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm3.h deleted file mode 100644 index d2761ceb16d..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm3.h +++ /dev/null @@ -1,1928 +0,0 @@ -/**************************************************************************//** - * @file core_cm3.h - * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 RSERVED1[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 */ - -#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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHP[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHP[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m460/CMSIS/Include/core_cm33.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm33.h deleted file mode 100644 index 9753b3e993e..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm33.h +++ /dev/null @@ -1,2898 +0,0 @@ -/**************************************************************************//** - * @file core_cm33.h - * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#if defined __ARM_PCS_VFP -#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_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 */ - 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_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 -{ - __IOM 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 */ - __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]; - __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; - -/* 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_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); - return ((uint32_t)(((NVIC->ITNS[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHPR[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } -} - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB_NS->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB_NS->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ - -/*@} 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) -{ - 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/nuvoton/libraries/m460/CMSIS/Include/core_cm4.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm4.h deleted file mode 100644 index 56e9e82b92e..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm4.h +++ /dev/null @@ -1,2113 +0,0 @@ -/**************************************************************************//** - * @file core_cm4.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 RSERVED1[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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 /* 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 */ -} 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 */ - -/*@} 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHP[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHP[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m460/CMSIS/Include/core_cm7.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm7.h deleted file mode 100644 index 6a24c7977e3..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cm7.h +++ /dev/null @@ -1,2678 +0,0 @@ -/**************************************************************************//** - * @file core_cm7.h - * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 RSERVED1[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_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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 /* 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 */ - -/*@} 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHPR[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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 ) - - -/** - \brief Enable I-Cache - \details Turns on I-Cache - */ -__STATIC_INLINE void SCB_EnableICache(void) -{ -#if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) - __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_INLINE 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_INLINE void SCB_InvalidateICache(void) -{ -#if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; - __DSB(); - __ISB(); -#endif -} - - -/** - \brief Enable D-Cache - \details Turns on D-Cache - */ -__STATIC_INLINE void SCB_EnableDCache(void) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_DisableDCache(void) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - register uint32_t ccsidr; - register uint32_t sets; - register uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_InvalidateDCache(void) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_CleanDCache(void) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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_INLINE void SCB_CleanInvalidateDCache(void) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* 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 - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_InvalidateDCache_by_Addr(uint32_t *addr, int32_t dsize) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t)addr; - int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) - { - SCB->DCIMVAC = op_addr; - op_addr += (uint32_t)linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief D-Cache Clean by address - \details Cleans D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanDCache_by_Addr(uint32_t *addr, int32_t dsize) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) - { - SCB->DCCMVAC = op_addr; - op_addr += (uint32_t)linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief D-Cache Clean and Invalidate by address - \details Cleans and invalidates D_Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr(uint32_t *addr, int32_t dsize) -{ -#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) - { - SCB->DCCIMVAC = op_addr; - op_addr += (uint32_t)linesize; - op_size -= linesize; - } - - __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/nuvoton/libraries/m460/CMSIS/Include/core_cmFunc.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmFunc.h deleted file mode 100644 index ed3c1901074..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmFunc.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmFunc.h - * @brief CMSIS Cortex-M Core Function Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMFUNC_H - #define __CORE_CMFUNC_H - - - /* ########################### Core Function Access ########################### */ - /** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - - /*------------------ RealView Compiler -----------------*/ - #if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - - /*------------------ ARM Compiler V6 -------------------*/ - #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - - /*------------------ GNU Compiler ----------------------*/ - #elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - - /*------------------ ICC Compiler ----------------------*/ - #elif defined ( __ICCARM__ ) - #include - - /*------------------ TI CCS Compiler -------------------*/ - #elif defined ( __TMS470__ ) - #include - - /*------------------ 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. - */ - - /*------------------ COSMIC Compiler -------------------*/ - #elif defined ( __CSMC__ ) - #include - - #endif - - /*@} end of CMSIS_Core_RegAccFunctions */ - -#endif /* __CORE_CMFUNC_H */ diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmInstr.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmInstr.h deleted file mode 100644 index a334984f5dd..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmInstr.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmInstr.h - * @brief CMSIS Cortex-M Core Instruction Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMINSTR_H - #define __CORE_CMINSTR_H - - - /* ########################## Core Instruction Access ######################### */ - /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ - */ - - /*------------------ RealView Compiler -----------------*/ - #if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - - /*------------------ ARM Compiler V6 -------------------*/ - #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - - /*------------------ GNU Compiler ----------------------*/ - #elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - - /*------------------ ICC Compiler ----------------------*/ - #elif defined ( __ICCARM__ ) - #include - - /*------------------ TI CCS Compiler -------------------*/ - #elif defined ( __TMS470__ ) - #include - - /*------------------ 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. - */ - - /*------------------ COSMIC Compiler -------------------*/ - #elif defined ( __CSMC__ ) - #include - - #endif - - /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - -#endif /* __CORE_CMINSTR_H */ diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmSimd.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmSimd.h deleted file mode 100644 index 590ebee9d5d..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_cmSimd.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file core_cmSimd.h - * @brief CMSIS Cortex-M SIMD Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMSIMD_H -#define __CORE_CMSIMD_H - -#ifdef __cplusplus -extern "C" { -#endif - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) -#include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) -#include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) -#include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) -#include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) -#include - -#endif - -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CMSIMD_H */ diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_sc000.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_sc000.h deleted file mode 100644 index b8f0abb35d3..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_sc000.h +++ /dev/null @@ -1,1016 +0,0 @@ -/**************************************************************************//** - * @file core_sc000.h - * @brief CMSIS SC000 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 - - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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) - { - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_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[0U] & (1UL << (((uint32_t)(int32_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)(int32_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)(int32_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)(int32_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)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m460/CMSIS/Include/core_sc300.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/core_sc300.h deleted file mode 100644 index b23a4cff9e9..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/core_sc300.h +++ /dev/null @@ -1,1903 +0,0 @@ -/**************************************************************************//** - * @file core_sc300.h - * @brief CMSIS SC300 Core Peripheral Access Layer Header File - * @version V5.0.2 - * @date 19. April 2017 - ******************************************************************************/ -/* - * Copyright (c) 2009-2017 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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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_PCS_VFP -#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 RSERVED1[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 */ - uint32_t RESERVED1[1U]; -} 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[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 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 */ - __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 -{ - __IOM 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 */ - __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 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 - - - -/** - \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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_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)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_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)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHP[(((uint32_t)(int32_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)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)SCB->SHP[(((uint32_t)(int32_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; -} - - -/** - \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. - */ -__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/nuvoton/libraries/m460/CMSIS/Include/mpu_armv7.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/mpu_armv7.h deleted file mode 100644 index d678faa98df..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/mpu_armv7.h +++ /dev/null @@ -1,183 +0,0 @@ -/****************************************************************************** - * @file mpu_armv7.h - * @brief CMSIS MPU API for ARMv7 MPU - * @version V5.0.2 - * @date 09. June 2017 - ******************************************************************************/ -/* - * Copyright (c) 2017 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 ARM_MPU_ARMV7_H -#define ARM_MPU_ARMV7_H - -#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) -#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) -#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) -#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) -#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) -#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) -#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) -#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) -#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) -#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) -#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) -#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) -#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) -#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) -#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) -#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) -#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) -#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) -#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) -#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) -#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) -#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) -#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) -#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) -#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) -#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) -#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) -#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) - -#define ARM_MPU_AP_NONE 0u -#define ARM_MPU_AP_PRIV 1u -#define ARM_MPU_AP_URO 2u -#define ARM_MPU_AP_FULL 3u -#define ARM_MPU_AP_PRO 5u -#define ARM_MPU_AP_RO 6u - -/** 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) | (1UL << MPU_RBAR_VALID_Pos)) - -/** -* MPU Region Attribut 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) \ - ((DisableExec << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \ - ((AccessPermission << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \ - ((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) | \ - ((SubRegionDisable << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \ - ((Size << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \ - ((1UL << MPU_RASR_ENABLE_Pos) & MPU_RASR_ENABLE_Msk) - - -/** -* Struct for a single MPU Region -*/ -typedef struct _ARM_MPU_Region_t -{ - 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) -{ - __DSB(); - __ISB(); - MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; -#endif -} - -/** Disable the MPU. -*/ -__STATIC_INLINE void ARM_MPU_Disable() -{ - __DSB(); - __ISB(); -#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 orderedCpy(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) -{ - orderedCpy(&(MPU->RBAR), &(table->RBAR), cnt * sizeof(ARM_MPU_Region_t) / 4u); -} - -#endif diff --git a/bsp/nuvoton/libraries/m460/CMSIS/Include/tz_context.h b/bsp/nuvoton/libraries/m460/CMSIS/Include/tz_context.h deleted file mode 100644 index ecc24c079f3..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/Include/tz_context.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2015-2016 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. - * - * ---------------------------------------------------------------------------- - * - * $Date: 21. September 2016 - * $Revision: V1.0 - * - * Project: TrustZone for ARMv8-M - * Title: Context Management for ARMv8-M TrustZone - * - * Version 1.0 - * Initial Release - *---------------------------------------------------------------------------*/ - -#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/nuvoton/libraries/m460/CMSIS/SConscript b/bsp/nuvoton/libraries/m460/CMSIS/SConscript deleted file mode 100644 index 904fca41463..00000000000 --- a/bsp/nuvoton/libraries/m460/CMSIS/SConscript +++ /dev/null @@ -1,16 +0,0 @@ -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(""" -""") - -path = [cwd + '/Include',] - -group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/NuMicro.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/NuMicro.h deleted file mode 100644 index 30d4547c235..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/NuMicro.h +++ /dev/null @@ -1,16 +0,0 @@ -/**************************************************************************//** - * @file NuMicro.h - * @version V1.00 - * @brief NuMicro peripheral access layer header file. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NUMICRO_H__ -#define __NUMICRO_H__ - -#include "m460.h" - -#endif /* __NUMICRO_H__ */ - - diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/acmp_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/acmp_reg.h deleted file mode 100644 index 1674d78092a..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/acmp_reg.h +++ /dev/null @@ -1,617 +0,0 @@ -/**************************************************************************//** - * @file acmp_reg.h - * @version V1.00 - * @brief ACMP register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ACMP_REG_H__ -#define __ACMP_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Analog Comparator Controller -------------------------*/ -/** - @addtogroup ACMP Analog Comparator Controller(ACMP) - Memory Mapped Structure for ACMP Controller -@{ */ - -typedef struct -{ - - - /** - * @var ACMP_T::CTL0 - * Offset: 0x00 Analog Comparator 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPEN |Comparator Enable Bit - * | | |0 = Comparator 0 Disabled. - * | | |1 = Comparator 0 Enabled. - * |[1] |ACMPIE |Comparator Interrupt Enable Bit - * | | |0 = Comparator 0 interrupt Disabled. - * | | |1 = Comparator 0 interrupt Enabled - * | | |If WKEN (ACMP_CTL0[16]) is set to 1, the wake-up interrupt function will be enabled as well. - * |[2] |HYSEN |Comparator Hysteresis Enable Bit - * | | |0 = Comparator 0 hysteresis Disabled. - * | | |1 = Comparator 0 hysteresis Enabled. - * | | |Note: If HYSEN = 0, user can adjust HYS by HYSSEL. - * | | |Note: If HYSEN = 1, HYSSEL is invalid. The Hysterresis is fixed to 30mV. - * |[3] |ACMPOINV |Comparator Output Inverse - * | | |0 = Comparator 0 output inverse Disabled. - * | | |1 = Comparator 0 output inverse Enabled. - * |[5:4] |NEGSEL |Comparator Negative Input Selection - * | | |00 = ACMP0_N pin. - * | | |01 = Internal comparator reference voltage (CRV0). - * | | |10 = Band-gap voltage. - * | | |11 = DAC0 output. - * | | |Note: NEGSEL must select 2u2019b01 in calibration mode. - * |[7:6] |POSSEL |Comparator Positive Input Selection - * | | |00 = Input from ACMP0_P0. - * | | |01 = Input from ACMP0_P1. - * | | |10 = Input from ACMP0_P2. - * | | |11 = Input from ACMP0_P3. - * |[9:8] |INTPOL |Interrupt Condition Polarity Selection - * | | |ACMPIF0 will be set to 1 when comparator output edge condition is detected. - * | | |00 = Rising edge or falling edge. - * | | |01 = Rising edge. - * | | |10 = Falling edge. - * | | |11 = Reserved. - * |[12] |OUTSEL |Comparator Output Select - * | | |0 = Comparator 0 output to ACMP0_O pin is unfiltered comparator output. - * | | |1 = Comparator 0 output to ACMP0_O pin is from filter output. - * |[15:13] |FILTSEL |Comparator Output Filter Count Selection - * | | |000 = Filter function is Disabled. - * | | |001 = ACMP0 output is sampled 1 consecutive PCLK. - * | | |010 = ACMP0 output is sampled 2 consecutive PCLKs. - * | | |011 = ACMP0 output is sampled 4 consecutive PCLKs. - * | | |100 = ACMP0 output is sampled 8 consecutive PCLKs. - * | | |101 = ACMP0 output is sampled 16 consecutive PCLKs. - * | | |110 = ACMP0 output is sampled 32 consecutive PCLKs. - * | | |111 = ACMP0 output is sampled 64 consecutive PCLKs. - * |[16] |WKEN |Power-down Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[17] |WLATEN |Window Latch Mode Enable Bit - * | | |0 = Window Latch Mode Disabled. - * | | |1 = Window Latch Mode Enabled. - * |[18] |WCMPSEL |Window Compare Mode Selection - * | | |0 = Window Compare Mode Disabled. - * | | |1 = Window Compare Mode is Selected. - * |[21:20] |FCLKDIV |Comparator Output Filter Clock Divider - * | | |00 = cComparator output filter clock = PCLK - * | | |01 = cComparator output filter clock = PCLK/2 - * | | |10 = cComparator output filter clock = PCLK/4 - * | | |11 = Reserved - * | | |Note: uUse FCLKDIV must under the condition fof FILTSEL = 3u2019h7, then set FCLKDIV canto get the effect of filtering 128,256 consecutive PCLKs. - * |[26:24] |HYSSEL |Hysteresis Mode Selection - * | | |000 = Hysteresis is 0mV. - * | | |001 = Hysteresis is 10mV. - * | | |010 = Hysteresis is 20mV. - * | | |011 = Hysteresis is 30mV. - * | | |100 = Hysteresis is 40mV - * | | |101 = Hysteresis is 50mV - * | | |Others = rReserved - * |[29:28] |MODESEL |Comparator Power Mode Selection - * | | |00 = low power mode comparator AVDD current 1uA - * | | |01 = low power mode comparator AVDD current 2uA - * | | |10 = active mode comparator AVDD current 35uA - * | | |11 = active mode comparator AVDD current 70uA - * @var ACMP_T::CTL1 - * Offset: 0x04 Analog Comparator 1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPEN |Comparator Enable Bit - * | | |0 = Comparator 1 Disabled. - * | | |1 = Comparator 1 Enabled. - * |[1] |ACMPIE |Comparator Interrupt Enable Bit - * | | |0 = Comparator 1 interrupt Disabled. - * | | |1 = Comparator 1 interrupt Enabled - * | | |If WKEN (ACMP_CTL1[16]) is set to 1, the wake-up interrupt function will be enabled as well. - * |[2] |HYSEN |Comparator Hysteresis Enable Bit - * | | |0 = Comparator 1 hysteresis Disabled. - * | | |1 = Comparator 1 hysteresis Enabled. - * | | |Note: If HYSEN = 0, user can adjust HYS by HYSSEL. - * | | |Note: If HYSEN = 1, HYSSEL is invalid. The Hysterresis is fixed to 30mV. - * |[3] |ACMPOINV |Comparator Output Inverse Control - * | | |0 = Comparator 1 output inverse Disabled. - * | | |1 = Comparator 1 output inverse Enabled. - * |[5:4] |NEGSEL |Comparator Negative Input Selection - * | | |00 = ACMP1_N pin. - * | | |01 = Internal comparator reference voltage (CRV1). - * | | |10 = Band-gap voltage. - * | | |11 = DAC0 output. - * | | |Note: NEGSEL must select 2u2019b01 in calibration mode. - * |[7:6] |POSSEL |Comparator Positive Input Selection - * | | |00 = Input from ACMP1_P0. - * | | |01 = Input from ACMP1_P1. - * | | |10 = Input from ACMP1_P2. - * | | |11 = Input from ACMP1_P3. - * |[9:8] |INTPOL |Interrupt Condition Polarity Selection - * | | |ACMPIF1 will be set to 1 when comparator output edge condition is detected. - * | | |00 = Rising edge or falling edge. - * | | |01 = Rising edge. - * | | |10 = Falling edge. - * | | |11 = Reserved. - * |[12] |OUTSEL |Comparator Output Select - * | | |0 = Comparator 1 output to ACMP1_O pin is unfiltered comparator output. - * | | |1 = Comparator 1 output to ACMP1_O pin is from filter output. - * |[15:13] |FILTSEL |Comparator Output Filter Count Selection - * | | |000 = Filter function is Disabled. - * | | |001 = ACMP1 output is sampled 1 consecutive PCLK. - * | | |010 = ACMP1 output is sampled 2 consecutive PCLKs. - * | | |011 = ACMP1 output is sampled 4 consecutive PCLKs. - * | | |100 = ACMP1 output is sampled 8 consecutive PCLKs. - * | | |101 = ACMP1 output is sampled 16 consecutive PCLKs. - * | | |110 = ACMP1 output is sampled 32 consecutive PCLKs. - * | | |111 = ACMP1 output is sampled 64 consecutive PCLKs. - * |[16] |WKEN |Power-down Wakeup Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[17] |WLATEN |Window Latch Mode Enable Bit - * | | |0 = Window Latch Mode Disabled. - * | | |1 = Window Latch Mode Enabled. - * |[18] |WCMPSEL |Window Compare Mode Selection - * | | |0 = Window Compare Mode Disabled. - * | | |1 = Window Compare Mode is Selected. - * |[21:20] |FCLKDIV |Comparator Output Filter Clock Divider - * | | |00 = comparator output filter clock = PCLK - * | | |01 = comparator output filter clock = PCLK/2 - * | | |10 = comparator output filter clock = PCLK/4 - * | | |11 = Reserved - * |[26:24] |HYSSEL |Hysteresis Mode Selection - * | | |000 = Hysteresis is 0mV. - * | | |001 = Hysteresis is 10mV. - * | | |010 = Hysteresis is 20mV. - * | | |011 = Hysteresis is 30mV. - * | | |100 = Hysteresis is 40mV - * | | |101 = Hysteresis is 50mV - * | | |Others = rReserved00 = Hysteresis is 0mV. - * | | |01 = Hysteresis is 10mV. - * | | |10 = Hysteresis is 20mV. - * | | |11 = Hysteresis is 30mV. - * |[29:28] |MODESEL |Comparator Power Mode Selection - * | | |00 = low power mode comparator AVDD current 1uA - * | | |01 = low power mode comparator AVDD current 2uA - * | | |10 = active mode comparator AVDD current 35uA - * | | |11 = active mode comparator AVDD current 70uA - * @var ACMP_T::STATUS - * Offset: 0x08 Analog Comparator Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPIF0 |Comparator 0 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL0[9:8]) is detected on comparator 0 output - * | | |This will generate an interrupt if ACMPIE (ACMP_CTL0[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |ACMPIF1 |Comparator 1 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL1[9:8]) is detected on comparator 1 output - * | | |This will cause an interrupt if ACMPIE (ACMP_CTL1[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |ACMPO0 |Comparator 0 Output - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 0 is disabled, i.e - * | | |ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[5] |ACMPO1 |Comparator 1 Output - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 1 is disabled, i.e - * | | |ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[8] |WKIF0 |Comparator 0 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP0 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |WKIF1 |Comparator 1 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP1 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |ACMPS0 |Comparator 0 Status - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 0 is disabled, i.e - * | | |ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[13] |ACMPS1 |Comparator 1 Status - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 1 is disabled, i.e - * | | |ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[16] |ACMPWO |Comparator Window Output - * | | |This bit shows the output status of window compare mode - * | | |0 = The positive input voltage is outside the window. - * | | |1 = The positive input voltage is in the window. - * @var ACMP_T::VREF - * Offset: 0x0C Analog Comparator Reference Voltage Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CRV0SEL |Comparator0Comparator 0 Reference Voltage Setting - * | | |CRV0 = CRV0 source voltage * (ACMP_VREF01[5:0] )/ 631/6+CRVCTL/24). - * |[6] |CRV0SSEL |CRV0 Source Voltage Selection - * | | |0 = AVDD is selected as CRV0 source voltage. - * | | |1 = The reference voltage defined by SYS_VREFCTL register is selected as CRV0 source voltage. - * |[8] |CRV0EN |CRV0 Enable Bit - * | | |0 = CRV0 is dDisabled. - * | | |1 = CRV0 is eEnabled. - * |[21:16] |CRV1SEL |Comparator1Comparator 1 Reference Voltage Setting - * | | |CRV1 = CRV1 source voltage * (ACMP_VREF01[21:16] )/ 63. - * |[22] |CRV1SSEL |CRV1 Source Voltage Selection - * | | |0 = AVDD is selected as CRV1 source voltage. - * | | |1 = The reference voltage defined by SYS_VREFCTL register is selected as CRV1 source voltage. - * |[24] |CRV1EN |CRV1 Enable Bit - * | | |0 = CRV1 is dDisabled. - * | | |1 = CRV1 Eis enabled. - * |[31] |CLAMPEN |Current Level Control Selection under Speed Up Function - * | | |0 = ACMP run on high SPEED mode with high quiescent current - * | | |1 = ACMP run on low SPEED mode with high quiescent current - * | | |Note: Comparator speed up function only support SPEED[1:0]=2bu201911 & 2bu201910 - * @var ACMP_T::CALCTL - * Offset: 0x10 Analog Comparator Calibration Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CALTRG0 |Comparator0Comparator 0 Calibration Trigger Bit - * | | |0 = Calibration is stopped. - * | | |1 = Calibration is triggered. - * | | |Note 1: Before this bit is enabled, ACMPEN(ACMP_CTL0[0]) should be set and the internal high speed RC oscillator (HIRC) should be enabled in advance. - * | | |Note 2: Hardware will auto clear this bit when the next calibration is triggered by software. - * | | |Note 3: If user must trigger calibration twice or more times, the second trigger haves to wait at least 300us after the previous calibration is done. - * |[1] |CALTRG1 |Comparator1Comparator 1 Calibration Trigger Bit - * | | |0 = Calibration is stopped. - * | | |1 = Calibration is triggered. - * | | |Note 1: Before this bit is enabled, ACMPEN(ACMP_CTL1[0]) should be set and the internal high speed RC oscillator (HIRC) should be enabled in advance. - * | | |Note 2: Hardware will auto clear this bit when the next calibration is triggered by software. - * | | |Note 3: If user must trigger calibration twice or more times, the second trigger haves to wait at least 300us after the previous calibration is done. - * |[5:4] |CALCLK0 |Comparator0Comparator 0 Calibration Clock Rate Selection - * | | |00 = 1.5 kHz. - * | | |01 = 6 kHz. - * | | |10 = 24kHz. - * | | |11 = 95 kHz. - * |[7:6] |CALCLK1 |Comparator1Comparator 1 Calibration Clock Rate Selection - * | | |00 = 1.5 kHz. - * | | |01 = 6 kHz. - * | | |10 = 24kHz. - * | | |11 = 95 kHz. - * |[8] |OFFSETSEL |Comparator Trim Code Selection - * | | |0 = calibration trim code will not minus 1 when calibrated done. - * | | |1 = calibration trim code will not minus 1 when calibrated done. - * |[17:16] |CALRVS |Calibration Reference Voltage Selection - * | | |00 = option0 (N-pair calibration: 5V - 80mV, P-pair calibration: 80mV) - * | | |01 = option1 - * | | |10 = option2 (N-pair calibration: 5V - 160mV, P-pair calibration: 160mV) - * | | |11 = Reserved - * | | |Note: CRV0 and CRV1 must be the same setting in calibration - * | | |Note: The details refer to Analog ACMP SPEC - * @var ACMP_T::CALSTS - * Offset: 0x14 Analog Comparator Calibration Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DONE0 |Comparator 0 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Ddone. - * | | |NOTE: this bit is write 1 clear - * |[4] |DONE1 |Comparator 1 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Ddone. - * | | |NOTE: this bit is write 1 clear - * @var ACMP_T::COFF - * Offset: 0xFF0 Analog Comparator Calibration Offset Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |NCODE0 |Comparator0Comparator 0 Offset of NMOS - * | | |ACMP0 offset canceling trim code of NMOS - * | | |Note: 1. Once ACMP0 is enabled, reading these bits will gets initial value from ROMMAP46[19:16] - * | | |2. write MODESEL ACMP_CTL0[29:28] will decide NCODE0 load from which ROMMAP - * | | | MODESEL = 2u2019b00, NCODE0 load from ROMMAP46[3:0] - * | | | MODESEL = 2u2019b01, NCODE0 load from ROMMAP46[19:16] - * | | | MODESEL = 2u2019b10, NCODE0 load from ROMMAP47[3:0] - * | | | MODESEL = 2u2019b11, NCODE0 load from ROMMAP47[19:16] - * |[7] |NSEL0 |Comparator0Comparator 0 Offset of NMOS - * | | |0 = trim NMOS negative offset - * | | |1 = trim NMOS positive offset - * | | |Note: 1. Once ACMP0 is enabled, reading this bit default will get initial value from ROMMAP46[20] - * | | | 2. write MODESEL ACMP_CTL0[29:28] will decide NSEL0 load from which ROMMAP - * | | | MODESEL = 2u2019b00, NSEL0 load from ROMMAP46[4] - * | | | MODESEL = 2u2019b01, NSEL0 load from ROMMAP46[20] - * | | | MODESEL = 2u2019b10, NSEL0 load from ROMMAP47[4] - * | | | MODESEL = 2u2019b11, NSEL0 load from ROMMAP47[20] - * | | |2 - * | | |If ACMP0 is enabled and CALTRG0 (ACMP_CALCTL01[0]]) is set, after calibration done DONE0(ACMP_CALSRTS01[0]) will get NSEL0 value - * |[11:8] |PCODE0 |Comparator0Comparator 0 Offset of PMOS - * | | |ACMP0 offset canceling trim code of PMOS - * | | |Note: 1. Once ACMP0 is enabled, reading these bits default will get initial value from ROMMAP46[27:24] - * | | |2. write MODESEL ACMP_CTL0[29:28] will decide PCODE0 load from which ROMMAP - * | | | MODESEL = 2u2019b00, PCODE0 load from ROMMAP46[11:8] - * | | | MODESEL = 2u2019b01, PCODE0 load from ROMMAP46[27:24] - * | | | MODESEL = 2u2019b10, PCODE0 load from ROMMAP47[11:8] - * | | | MODESEL = 2u2019b11, PCODE0 load from ROMMAP47[27:24] - * |[15] |PSEL0 |Comparator0Comparator 0 Offset of PMOS - * | | |0 = trim PMOS negative offset - * | | |1 = trim PMOS positive offset - * | | |Note: 1. Once ACMP0 is enabled, reading this bit default will get initial value from ROMMAP46[28]. - * | | |2. write MODESEL ACMP_CTL0[29:28] will decide PSEL0 load from which ROMMAP - * | | | MODESEL = 2u2019b00, PSEL0 load from ROMMAP46[12] - * | | | MODESEL = 2u2019b01, PSEL0 load from ROMMAP48[28] - * | | | MODESEL = 2u2019b10, PSEL0 load from ROMMAP47[12] - * | | | MODESEL = 2u2019b11, PSEL0 load from ROMMAP47[28] - * | | |3 - * | | |If ACMP0 is enabled and CALTRG0 (ACMP_CALCTL01[0]]) is set, after calibration done DONE0(ACMP_CALSACMP_CALSTS01R[0]) will get PSEL0 value - * |[19:16] |NCODE1 |Comparator 1 Offset of NMOS - * | | |ACMP1 offset canceling trim code of PMOS - * | | |Note: 1. Once ACMP1 is enabled, reading these bits default will get initial value from ROMMAP48[19:16] - * | | |2. write MODESEL ACMP_CTL1[29:28] will decide NCODE1 load from which ROMMAP - * | | | MODESEL = 2u2019b00, NCODE1load from ROMMAP48[3:0] - * | | | MODESEL = 2u2019b01, NCODE1 load from ROMMAP48[19:16] - * | | | MODESEL = 2u2019b10, NCODE1 load from ROMMAP49[3:0] - * | | | MODESEL = 2u2019b11, NCODE1 load from ROMMAP49[19:16] - * |[23] |NSEL1 |Comparator 1 Offset of NMOS - * | | |0 = trim NMOS negative offset - * | | |1 = trim NMOS positive offset - * | | |Note: 1. Once ACMP1 is enabled, reading this bit default will get initial value from ROMMAP48[20] - * | | | 2. write MODESEL ACMP_CTL1[29:28] will decide NSEL1 load from which ROMMAP - * | | | MODESEL = 2u2019b00, NSEL1 load from ROMMAP48[4] - * | | | MODESEL = 2u2019b01, NSEL1 load from ROMMAP48[20] - * | | | MODESEL = 2u2019b10, NSEL1 load from ROMMAP49[4] - * | | | MODESEL = 2u2019b11, NSEL1 load from ROMMAP49[20] - * | | |3 - * | | |If ACMP1 is enabled and CALTRG1 (ACMP_CALCTL01[1]]) is set, after calibration done DONE1(ACMP_CALSRTS01[4]) will get NSEL1 value - * |[27:24] |PCODE1 |Comparator 1 Offset of PMOS - * | | |ACMP1 offset canceling trim code of PMOS - * | | |Note: 1. Once ACMP1 is enabled, reading these bits default will get initial value from ROMMAP48[27:24] - * | | |2. write MODESEL ACMP_CTL1[29:28] will decide PCODE1 load from which ROMMAP - * | | | MODESEL = 2u2019b00, PCODE1 load from ROMMAP48[11:8] - * | | | MODESEL = 2u2019b01, PCODE1 load from ROMMAP48[27:24] - * | | | MODESEL = 2u2019b10, PCODE1 load from ROMMAP49[11:8] - * | | | MODESEL = 2u2019b11, PCODE1 load from ROMMAP49[27:24] - * |[31] |PSEL1 |Comparator 1 Offset of PMOS - * | | |0 = trim PMOS negative offset - * | | |1 = trim PMOS positive offset - * | | |Note: 1. Once ACMP1 is enabled, reading this bit default will get initial value from ROMMAP48[28] - * | | | 2. write MODESEL ACMP_CTL1[29:28] will decide PSEL1 load from which ROMMAP - * | | | MODESEL = 2u2019b00, PSEL1 load from ROMMAP48[12] - * | | | MODESEL = 2u2019b01, PSEL1 load from ROMMAP48[28] - * | | | MODESEL = 2u2019b10, PSEL1 load from ROMMAP49[12] - * | | | MODESEL = 2u2019b11, PSEL1 load from ROMMAP49[28] - * | | |3 - * | | |If ACMP1 is enabled and CALTRG1 (ACMP_CALCTL01[1]]) is set, after calibration done DONE1(ACMP_CALSRTS01[4]) will get PSEL1 value - * @var ACMP_T::TEST - * Offset: 0xFF8 Analog Comparator Test Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRV0TEST |CRV0 Test Mode Enable Bit (Write Protect) - * | | |0 = No effect. - * | | |1 = CRV voltage output to ACMP0_N pin for voltage measure. - * | | |This bit is designed for Nuvoton Lab use only. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: NEGSEL (ACMP_CTL0[5:4]) or NEGSEL (ACMP_CTL1[5:4]) must select to 2u2019b01 in CRV test mode - * |[1] |CRV1TEST |CRV1 Test Mode Enable Bit (Write Protect) - * | | |0 = No effect. - * | | |1 = CRV voltage output to ACMP0_N pin for voltage measure. - * | | |This bit is designed for Nuvoton Lab use only. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: NEGSEL (ACMP_CTL0[5:4]) or NEGSEL (ACMP_CTL1[5:4]) must select to 2u2019b01 in CRV test mode - * |[4] |OUTSEL |Comparator CRV Output Source Selection - * | | |0 = CRV output from resistor string - * | | |1 = CRV output from bandgap voltage - * |[8] |HYSBYPASS |Hysteresis Adjust Function Selection - * | | |0 = Enable adjust function - * | | |1 = Bypass adjust function - * @var ACMP_T::VERSION - * Offset: 0xFFC Analog Comparator RTL Design Version Number - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MINOR |Comp RTL Design MINOR Version Number - * | | |Minor version number is dependent on module ECO version control. - * |[23:16] |SUB |Comp RTL Design SUB Version Number - * | | |Major version number is correlated to Product Line. - * |[31:24] |MAJOR |Comp RTL Design MAJOR Version Number - * | | |Major version number is correlated to Product Line. - */ - __IO uint32_t CTL[2]; /*!< [0x0000-0x0004] Analog Comparator 0/1 Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] Analog Comparator Status Register */ - __IO uint32_t VREF; /*!< [0x000c] Analog Comparator Reference Voltage Control Register */ - __IO uint32_t CALCTL; /*!< [0x0010] Analog Comparator Calibration Control Register */ - __IO uint32_t CALSTS; /*!< [0x0014] Analog Comparator Calibration Status Register */ - __I uint32_t RESERVE0[1014]; - __IO uint32_t COFF; /*!< [0x0ff0] Analog Comparator Calibration Offset Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t TEST; /*!< [0x0ff8] Analog Comparator Test Control Register */ - __I uint32_t VERSION; /*!< [0x0ffc] Analog Comparator RTL Design Version Number */ - -} ACMP_T; - -/** - @addtogroup ACMP_CONST ACMP Bit Field Definition - Constant Definitions for ACMP Controller -@{ */ - -#define ACMP_CTL_ACMPEN_Pos (0) /*!< ACMP_T::CTL0: ACMPEN Position */ -#define ACMP_CTL_ACMPEN_Msk (0x1ul << ACMP_CTL_ACMPEN_Pos) /*!< ACMP_T::CTL0: ACMPEN Mask */ - -#define ACMP_CTL_ACMPIE_Pos (1) /*!< ACMP_T::CTL0: ACMPIE Position */ -#define ACMP_CTL_ACMPIE_Msk (0x1ul << ACMP_CTL_ACMPIE_Pos) /*!< ACMP_T::CTL0: ACMPIE Mask */ - -#define ACMP_CTL_HYSEN_Pos (2) /*!< ACMP_T::CTL0: HYSEN Position */ -#define ACMP_CTL_HYSEN_Msk (0x1ul << ACMP_CTL_HYSEN_Pos) /*!< ACMP_T::CTL0: HYSEN Mask */ - -#define ACMP_CTL_ACMPOINV_Pos (3) /*!< ACMP_T::CTL0: ACMPOINV Position */ -#define ACMP_CTL_ACMPOINV_Msk (0x1ul << ACMP_CTL_ACMPOINV_Pos) /*!< ACMP_T::CTL0: ACMPOINV Mask */ - -#define ACMP_CTL_NEGSEL_Pos (4) /*!< ACMP_T::CTL0: NEGSEL Position */ -#define ACMP_CTL_NEGSEL_Msk (0x3ul << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_T::CTL0: NEGSEL Mask */ - -#define ACMP_CTL_POSSEL_Pos (6) /*!< ACMP_T::CTL0: POSSEL Position */ -#define ACMP_CTL_POSSEL_Msk (0x3ul << ACMP_CTL_POSSEL_Pos) /*!< ACMP_T::CTL0: POSSEL Mask */ - -#define ACMP_CTL_INTPOL_Pos (8) /*!< ACMP_T::CTL0: INTPOL Position */ -#define ACMP_CTL_INTPOL_Msk (0x3ul << ACMP_CTL_INTPOL_Pos) /*!< ACMP_T::CTL0: INTPOL Mask */ - -#define ACMP_CTL_OUTSEL_Pos (12) /*!< ACMP_T::CTL0: OUTSEL Position */ -#define ACMP_CTL_OUTSEL_Msk (0x1ul << ACMP_CTL_OUTSEL_Pos) /*!< ACMP_T::CTL0: OUTSEL Mask */ - -#define ACMP_CTL_FILTSEL_Pos (13) /*!< ACMP_T::CTL0: FILTSEL Position */ -#define ACMP_CTL_FILTSEL_Msk (0x7ul << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_T::CTL0: FILTSEL Mask */ - -#define ACMP_CTL_WKEN_Pos (16) /*!< ACMP_T::CTL0: WKEN Position */ -#define ACMP_CTL_WKEN_Msk (0x1ul << ACMP_CTL_WKEN_Pos) /*!< ACMP_T::CTL0: WKEN Mask */ - -#define ACMP_CTL_WLATEN_Pos (17) /*!< ACMP_T::CTL0: WLATEN Position */ -#define ACMP_CTL_WLATEN_Msk (0x1ul << ACMP_CTL_WLATEN_Pos) /*!< ACMP_T::CTL0: WLATEN Mask */ - -#define ACMP_CTL_WCMPSEL_Pos (18) /*!< ACMP_T::CTL0: WCMPSEL Position */ -#define ACMP_CTL_WCMPSEL_Msk (0x1ul << ACMP_CTL_WCMPSEL_Pos) /*!< ACMP_T::CTL0: WCMPSEL Mask */ - -#define ACMP_CTL_FCLKDIV_Pos (20) /*!< ACMP_T::CTL0: FCLKDIV Position */ -#define ACMP_CTL_FCLKDIV_Msk (0x3ul << ACMP_CTL_FCLKDIV_Pos) /*!< ACMP_T::CTL0: FCLKDIV Mask */ - -#define ACMP_CTL_HYSSEL_Pos (24) /*!< ACMP_T::CTL0: HYSSEL Position */ -#define ACMP_CTL_HYSSEL_Msk (0x7ul << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_T::CTL0: HYSSEL Mask */ - -#define ACMP_CTL_MODESEL_Pos (28) /*!< ACMP_T::CTL0: MODESEL Position */ -#define ACMP_CTL_MODESEL_Msk (0x3ul << ACMP_CTL_MODESEL_Pos) /*!< ACMP_T::CTL0: MODESEL Mask */ - -#define ACMP_STATUS_ACMPIF0_Pos (0) /*!< ACMP_T::STATUS: ACMPIF0 Position */ -#define ACMP_STATUS_ACMPIF0_Msk (0x1ul << ACMP_STATUS_ACMPIF0_Pos) /*!< ACMP_T::STATUS: ACMPIF0 Mask */ - -#define ACMP_STATUS_ACMPIF1_Pos (1) /*!< ACMP_T::STATUS: ACMPIF1 Position */ -#define ACMP_STATUS_ACMPIF1_Msk (0x1ul << ACMP_STATUS_ACMPIF1_Pos) /*!< ACMP_T::STATUS: ACMPIF1 Mask */ - -#define ACMP_STATUS_ACMPO0_Pos (4) /*!< ACMP_T::STATUS: ACMPO0 Position */ -#define ACMP_STATUS_ACMPO0_Msk (0x1ul << ACMP_STATUS_ACMPO0_Pos) /*!< ACMP_T::STATUS: ACMPO0 Mask */ - -#define ACMP_STATUS_ACMPO1_Pos (5) /*!< ACMP_T::STATUS: ACMPO1 Position */ -#define ACMP_STATUS_ACMPO1_Msk (0x1ul << ACMP_STATUS_ACMPO1_Pos) /*!< ACMP_T::STATUS: ACMPO1 Mask */ - -#define ACMP_STATUS_WKIF0_Pos (8) /*!< ACMP_T::STATUS: WKIF0 Position */ -#define ACMP_STATUS_WKIF0_Msk (0x1ul << ACMP_STATUS_WKIF0_Pos) /*!< ACMP_T::STATUS: WKIF0 Mask */ - -#define ACMP_STATUS_WKIF1_Pos (9) /*!< ACMP_T::STATUS: WKIF1 Position */ -#define ACMP_STATUS_WKIF1_Msk (0x1ul << ACMP_STATUS_WKIF1_Pos) /*!< ACMP_T::STATUS: WKIF1 Mask */ - -#define ACMP_STATUS_ACMPS0_Pos (12) /*!< ACMP_T::STATUS: ACMPS0 Position */ -#define ACMP_STATUS_ACMPS0_Msk (0x1ul << ACMP_STATUS_ACMPS0_Pos) /*!< ACMP_T::STATUS: ACMPS0 Mask */ - -#define ACMP_STATUS_ACMPS1_Pos (13) /*!< ACMP_T::STATUS: ACMPS1 Position */ -#define ACMP_STATUS_ACMPS1_Msk (0x1ul << ACMP_STATUS_ACMPS1_Pos) /*!< ACMP_T::STATUS: ACMPS1 Mask */ - -#define ACMP_STATUS_ACMPWO_Pos (16) /*!< ACMP_T::STATUS: ACMPWO Position */ -#define ACMP_STATUS_ACMPWO_Msk (0x1ul << ACMP_STATUS_ACMPWO_Pos) /*!< ACMP_T::STATUS: ACMPWO Mask */ - -#define ACMP_VREF_CRV0SEL_Pos (0) /*!< ACMP_T::VREF: CRV0SEL Position */ -#define ACMP_VREF_CRV0SEL_Msk (0x3ful << ACMP_VREF_CRV0SEL_Pos) /*!< ACMP_T::VREF: CRV0SEL Mask */ - -#define ACMP_VREF_CRV0SSEL_Pos (6) /*!< ACMP_T::VREF: CRV0SSEL Position */ -#define ACMP_VREF_CRV0SSEL_Msk (0x1ul << ACMP_VREF_CRV0SSEL_Pos) /*!< ACMP_T::VREF: CRV0SSEL Mask */ - -#define ACMP_VREF_CRV0EN_Pos (8) /*!< ACMP_T::VREF: CRV0EN Position */ -#define ACMP_VREF_CRV0EN_Msk (0x1ul << ACMP_VREF_CRV0EN_Pos) /*!< ACMP_T::VREF: CRV0EN Mask */ - -#define ACMP_VREF_CRV1SEL_Pos (16) /*!< ACMP_T::VREF: CRV1SEL Position */ -#define ACMP_VREF_CRV1SEL_Msk (0x3ful << ACMP_VREF_CRV1SEL_Pos) /*!< ACMP_T::VREF: CRV1SEL Mask */ - -#define ACMP_VREF_CRV1SSEL_Pos (22) /*!< ACMP_T::VREF: CRV1SSEL Position */ -#define ACMP_VREF_CRV1SSEL_Msk (0x1ul << ACMP_VREF_CRV1SSEL_Pos) /*!< ACMP_T::VREF: CRV1SSEL Mask */ - -#define ACMP_VREF_CRV1EN_Pos (24) /*!< ACMP_T::VREF: CRV1EN Position */ -#define ACMP_VREF_CRV1EN_Msk (0x1ul << ACMP_VREF_CRV1EN_Pos) /*!< ACMP_T::VREF: CRV1EN Mask */ - -#define ACMP_VREF_CLAMPEN_Pos (31) /*!< ACMP_T::VREF: CLAMPEN Position */ -#define ACMP_VREF_CLAMPEN_Msk (0x1ul << ACMP_VREF_CLAMPEN_Pos) /*!< ACMP_T::VREF: CLAMPEN Mask */ - -#define ACMP_CALCTL_CALTRG0_Pos (0) /*!< ACMP_T::CALCTL: CALTRG0 Position */ -#define ACMP_CALCTL_CALTRG0_Msk (0x1ul << ACMP_CALCTL_CALTRG0_Pos) /*!< ACMP_T::CALCTL: CALTRG0 Mask */ - -#define ACMP_CALCTL_CALTRG1_Pos (1) /*!< ACMP_T::CALCTL: CALTRG1 Position */ -#define ACMP_CALCTL_CALTRG1_Msk (0x1ul << ACMP_CALCTL_CALTRG1_Pos) /*!< ACMP_T::CALCTL: CALTRG1 Mask */ - -#define ACMP_CALCTL_CALCLK0_Pos (4) /*!< ACMP_T::CALCTL: CALCLK0 Position */ -#define ACMP_CALCTL_CALCLK0_Msk (0x3ul << ACMP_CALCTL_CALCLK0_Pos) /*!< ACMP_T::CALCTL: CALCLK0 Mask */ - -#define ACMP_CALCTL_CALCLK1_Pos (6) /*!< ACMP_T::CALCTL: CALCLK1 Position */ -#define ACMP_CALCTL_CALCLK1_Msk (0x3ul << ACMP_CALCTL_CALCLK1_Pos) /*!< ACMP_T::CALCTL: CALCLK1 Mask */ - -#define ACMP_CALCTL_OFFSETSEL_Pos (8) /*!< ACMP_T::CALCTL: OFFSETSEL Position */ -#define ACMP_CALCTL_OFFSETSEL_Msk (0x1ul << ACMP_CALCTL_OFFSETSEL_Pos) /*!< ACMP_T::CALCTL: OFFSETSEL Mask */ - -#define ACMP_CALCTL_CALRVS_Pos (16) /*!< ACMP_T::CALCTL: CALRVS Position */ -#define ACMP_CALCTL_CALRVS_Msk (0x3ul << ACMP_CALCTL_CALRVS_Pos) /*!< ACMP_T::CALCTL: CALRVS Mask */ - -#define ACMP_CALSTS_DONE0_Pos (0) /*!< ACMP_T::CALSTS: DONE0 Position */ -#define ACMP_CALSTS_DONE0_Msk (0x1ul << ACMP_CALSTS_DONE0_Pos) /*!< ACMP_T::CALSTS: DONE0 Mask */ - -#define ACMP_CALSTS_DONE1_Pos (4) /*!< ACMP_T::CALSTS: DONE1 Position */ -#define ACMP_CALSTS_DONE1_Msk (0x1ul << ACMP_CALSTS_DONE1_Pos) /*!< ACMP_T::CALSTS: DONE1 Mask */ - -#define ACMP_COFF_NCODE0_Pos (0) /*!< ACMP_T::COFF: NCODE0 Position */ -#define ACMP_COFF_NCODE0_Msk (0xful << ACMP_COFF_NCODE0_Pos) /*!< ACMP_T::COFF: NCODE0 Mask */ - -#define ACMP_COFF_NSEL0_Pos (7) /*!< ACMP_T::COFF: NSEL0 Position */ -#define ACMP_COFF_NSEL0_Msk (0x1ul << ACMP_COFF_NSEL0_Pos) /*!< ACMP_T::COFF: NSEL0 Mask */ - -#define ACMP_COFF_PCODE0_Pos (8) /*!< ACMP_T::COFF: PCODE0 Position */ -#define ACMP_COFF_PCODE0_Msk (0xful << ACMP_COFF_PCODE0_Pos) /*!< ACMP_T::COFF: PCODE0 Mask */ - -#define ACMP_COFF_PSEL0_Pos (15) /*!< ACMP_T::COFF: PSEL0 Position */ -#define ACMP_COFF_PSEL0_Msk (0x1ul << ACMP_COFF_PSEL0_Pos) /*!< ACMP_T::COFF: PSEL0 Mask */ - -#define ACMP_COFF_NCODE1_Pos (16) /*!< ACMP_T::COFF: NCODE1 Position */ -#define ACMP_COFF_NCODE1_Msk (0xful << ACMP_COFF_NCODE1_Pos) /*!< ACMP_T::COFF: NCODE1 Mask */ - -#define ACMP_COFF_NSEL1_Pos (23) /*!< ACMP_T::COFF: NSEL1 Position */ -#define ACMP_COFF_NSEL1_Msk (0x1ul << ACMP_COFF_NSEL1_Pos) /*!< ACMP_T::COFF: NSEL1 Mask */ - -#define ACMP_COFF_PCODE1_Pos (24) /*!< ACMP_T::COFF: PCODE1 Position */ -#define ACMP_COFF_PCODE1_Msk (0xful << ACMP_COFF_PCODE1_Pos) /*!< ACMP_T::COFF: PCODE1 Mask */ - -#define ACMP_COFF_PSEL1_Pos (31) /*!< ACMP_T::COFF: PSEL1 Position */ -#define ACMP_COFF_PSEL1_Msk (0x1ul << ACMP_COFF_PSEL1_Pos) /*!< ACMP_T::COFF: PSEL1 Mask */ - -#define ACMP_TEST_CRV0TEST_Pos (0) /*!< ACMP_T::TEST: CRV0TEST Position */ -#define ACMP_TEST_CRV0TEST_Msk (0x1ul << ACMP_TEST_CRV0TEST_Pos) /*!< ACMP_T::TEST: CRV0TEST Mask */ - -#define ACMP_TEST_CRV1TEST_Pos (1) /*!< ACMP_T::TEST: CRV1TEST Position */ -#define ACMP_TEST_CRV1TEST_Msk (0x1ul << ACMP_TEST_CRV1TEST_Pos) /*!< ACMP_T::TEST: CRV1TEST Mask */ - -#define ACMP_TEST_OUTSEL_Pos (4) /*!< ACMP_T::TEST: OUTSEL Position */ -#define ACMP_TEST_OUTSEL_Msk (0x1ul << ACMP_TEST_OUTSEL_Pos) /*!< ACMP_T::TEST: OUTSEL Mask */ - -#define ACMP_TEST_HYSBYPASS_Pos (8) /*!< ACMP_T::TEST: HYSBYPASS Position */ -#define ACMP_TEST_HYSBYPASS_Msk (0x1ul << ACMP_TEST_HYSBYPASS_Pos) /*!< ACMP_T::TEST: HYSBYPASS Mask */ - -#define ACMP_VERSION_MINOR_Pos (0) /*!< ACMP_T::VERSION: MINOR Position */ -#define ACMP_VERSION_MINOR_Msk (0xfffful << ACMP_VERSION_MINOR_Pos) /*!< ACMP_T::VERSION: MINOR Mask */ - -#define ACMP_VERSION_SUB_Pos (16) /*!< ACMP_T::VERSION: SUB Position */ -#define ACMP_VERSION_SUB_Msk (0xfful << ACMP_VERSION_SUB_Pos) /*!< ACMP_T::VERSION: SUB Mask */ - -#define ACMP_VERSION_MAJOR_Pos (24) /*!< ACMP_T::VERSION: MAJOR Position */ -#define ACMP_VERSION_MAJOR_Msk (0xfful << ACMP_VERSION_MAJOR_Pos) /*!< ACMP_T::VERSION: MAJOR Mask */ - -/**@}*/ /* ACMP_CONST */ -/**@}*/ /* end of ACMP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __ACMP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bmc_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bmc_reg.h deleted file mode 100644 index f4e491a4a31..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bmc_reg.h +++ /dev/null @@ -1,725 +0,0 @@ -/**************************************************************************//** - * @file bmc_reg.h - * @version V3.00 - * @brief BMC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __BMC_REG_H__ -#define __BMC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup BMC Controller - Memory Mapped Structure for BMC Controller -@{ */ - -typedef struct -{ - - - /** - * @var BMC_T::CTL - * Offset: 0x00 Biphase Mask Coding Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BMCEN |Biphase Mask Coding Enable - * | | |0 = Biphase Mask Coding function is Disabled. It is cleared after current frame data transfer done. - * | | |1 = Biphase Mask Coding function is Enabled. - * |[1] |BWADJ |Bit Width Adjustment 1.5 Time - * | | |0 = The bit time period of Logic '0' is same as Logic '1'. - * | | |1 = The bit time period of Logic '0' is 1.5 times as Logic '1'. - * | | |Note: When this bit is set, the PDMA - * |[2] |PREAM32 |Preamble Bit Number 32 - * | | |0 = The bit number of Preamble is 64 bits. - * | | |1 = The bit number of Preamble is 32 bits. - * |[3] |DUMLVL |Dummy Bit Level - * | | |0 = The logic level of dummy bit is LOW. - * | | |1 = The logic level of dummy bit is HIGH. - * |[4] |DMAEN |PDMA Channel Enable - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * |[8] |G0CHEN |BMC Group 0 Channel Enable - * | | |0 = BMC Channel 0~3 Disabled. - * | | |1 = BMC Channel 0~3 Enabled. - * |[9] |G1CHEN |BMC Group 1 Channel Enable - * | | |0 = BMC Channel 4~7 Disabled. - * | | |1 = BMC Channel 4~7 Enabled. - * |[10] |G2CHEN |BMC Group 2 Channel Enable - * | | |0 = BMC Channel 8~11 Disabled. - * | | |1 = BMC Channel 8~11 Enabled. - * |[11] |G3CHEN |BMC Group 3 Channel Enable - * | | |0 = BMC Channel 12~15 Disabled. - * | | |1 = BMC Channel 12~15 Enabled. - * |[12] |G4CHEN |BMC Group 4 Channel Enable - * | | |0 = BMC Channel 16~19 Disabled. - * | | |1 = BMC Channel 16~19 Enabled. - * |[13] |G5CHEN |BMC Group 5 Channel Enable - * | | |0 = BMC Channel 20~23 Disabled. - * | | |1 = BMC Channel 20~23 Enabled. - * |[14] |G6CHEN |BMC Group 6 Channel Enable - * | | |0 = BMC Channel 24~27 Disabled. - * | | |1 = BMC Channel 24~27 Enabled. - * |[15] |G7CHEN |BMC Group 7 Channel Enable - * | | |0 = BMC Channel 28~31 Disabled. - * | | |1 = BMC Channel 28~31 Enabled. - * |[24:16] |BTDIV |Bit Time Divider - * | | |These bit field indicates the half bit time divider for Biphase Mask Coding bit. - * | | |For example, if the HCLK is 200 MHz, the divider can be set as 0x64 - * | | |It will generate 2 MHz reference clock and the Biphase Mask Coding transmitting data is sent according the reference divided clock. - * @var BMC_T::DNUM0 - * Offset: 0x04 Biphase Mask Coding Dummy Bit Number Channel Group 0~3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DNUMG0 |Dummy Number for Channel 0~3 - * | | |These bit field defines the dummy bit number for the group of channel 0~3 - * | | |Each dummy bit equal 8 bit data period. - * |[15:8] |DNUMG1 |Dummy Number for Channel 4~7 - * | | |These bit field defines the dummy bit number for the group of channel 4~7 - * | | |Each dummy bit equal 8 bit data period. - * |[23:16] |DNUMG2 |Dummy Number for Channel 8~11 - * | | |These bit field defines the dummy bit number for the group of channel 8~11 - * | | |Each dummy bit equal 8 bit data period. - * |[31:24] |DNUMG3 |Dummy Number for Channel 12~15 - * | | |These bit field defines the dummy bit number for the group of channel 12~15 - * | | |Each dummy bit equal 8 bit data period. - * @var BMC_T::DNUM1 - * Offset: 0x08 Biphase Mask Coding Dummy Bit Number Channel Group 4~7 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DNUMG4 |Dummy Number for Channel 16~19 - * | | |These bit field defines the dummy bit number for the group of channel 16~19 - * | | |Each dummy bit equal 8 bit data period. - * |[15:8] |DNUMG5 |Dummy Number for Channel 20~23 - * | | |These bit field defines the dummy bit number for the group of channel 20~23 - * | | |Each dummy bit equal 8 bit data period. - * |[23:16] |DNUMG6 |Dummy Number for Channel 24~27 - * | | |These bit field defines the dummy bit number for the group of channel 24~27 - * | | |Each dummy bit equal 8 bit data period. - * |[31:24] |DNUMG7 |Dummy Number for Channel 28~31 - * | | |These bit field defines the dummy bit number for the group of channel 28~31 - * | | |Each dummy bit equal 8 bit data period. - * @var BMC_T::INTEN - * Offset: 0x0C Biphase Mask Coding Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FTXDIEN |Frame Transmit Done Interrupt Enable Bit - * | | |0 = Frame transmit done interrupt Disabled. - * | | |1 = Frame transmit done interrupt Enabled. - * |[1] |TXUNDIEN |Transmit Data Under Run Interrupt Enable Bit - * | | |0 = Transmit data register under run interrupt Disabled. - * | | |1 = Transmit data register under run interrupt Enabled. - * @var BMC_T::INTSTS - * Offset: 0x10 Biphase Mask Coding Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FTXDIF |Frame Transmit Done Interrupt Flag - * | | |0 = No frame transmit done interrupt flag. - * | | |1 = Frame transmit done interrupt flag. Write 1 to clear. - * |[1] |TXUNDIF |Transmit Data Register Under Run Interrupt Flag - * | | |0 = No transmit data register under run interrupt flag. - * | | |1 = Transmit data register under interrupt flag. This bit is the OR function of BMC_INTSTS[15:8]. - * |[8] |G0TXUND |Channel 0~3 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 0~3. - * | | |1 = Transmit data under run active in one of channel 0~3. Write 1 to clear. - - * |[9] |G1TXUND |Channel 4~7 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 4~7. - * | | |1 = Transmit data under run active in one of channel 4~7. Write 1 to clear. - * |[10] |G2TXUND |Channel 8~11 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 8~11. - * | | |1 = Transmit data under run active in one of channel 8~11. Write 1 to clear. - * |[10] |G3TXUND |Channel 12~15 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 12~15. - * | | |1 = Transmit data under run active in one of channel 12~15. Write 1 to clear. - * |[12] |G4TXUND |Channel 16~19 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 16~19. - * | | |1 = Transmit data under run active in one of channel 16~19. Write 1 to clear. - * |[13] |G5TXUND |Channel 20~23 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 20~23. - * | | |1 = Transmit data under run active in one of channel 20~23. Write 1 to clear. - * |[14] |G6TXUND |Channel 24~27 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 24~27. - * | | |1 = Transmit data under run active in one of channel 24~27. Write 1 to clear. - * |[15] |G7TXUND |Channel 28~31 Transmit Data Under Run - * | | |0 = No Transmit data under run active in one of channel 28~31. - * | | |1 = Transmit data under run active in one of channel 28~31. Write 1 to clear. - * @var BMC_T::CHEMPTY - * Offset: 0x14 Biphase Mask Coding Channel Done Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0EPT |BMC Channel 0 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[1] |CH1EPT |BMC Channel 1 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[2] |CH2EPT |BMC Channel 2 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[3] |CH3EPT |BMC Channel 3 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[4] |CH4EPT |BMC Channel 4 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[5] |CH5EPT |BMC Channel 5 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[6] |CH6EPT |BMC Channel 6 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[7] |CH7EPT |BMC Channel 7 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[8] |CH8EPT |BMC Channel 8 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[9] |CH9EPT |BMC Channel 9 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[10] |CH10EPT |BMC Channel 10 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[11] |CH11EPT |BMC Channel 11 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[12] |CH12EPT |BMC Channel 12 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[13] |CH13EPT |BMC Channel 13 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[14] |CH14EPT |BMC Channel 14 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[15] |CH15EPT |BMC Channel 15 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[16] |CH16EPT |BMC Channel 16 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[17] |CH17EPT |BMC Channel 17 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[18] |CH18EPT |BMC Channel 18 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[19] |CH19EPT |BMC Channel 19 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[20] |CH20EPT |BMC Channel 20 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[21] |CH21EPT |BMC Channel 21 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[22] |CH22EPT |BMC Channel 22 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[23] |CH23EPT |BMC Channel 23 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[24] |CH24EPT |BMC Channel 24 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[25] |CH25EPT |BMC Channel 25 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[26] |CH26EPT |BMC Channel 26 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[27] |CH27EPT |BMC Channel 27 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[28] |CH28EPT |BMC Channel 28 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[29] |CH29EPT |BMC Channel 29 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[30] |CH30EPT |BMC Channel 30 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * |[31] |CH31EPT |BMC Channel 31 Current FIFO Empty - * | | |0 = The current transmitted FIFO no empty. - * | | |1 = The current transmitted FIFO empty. - * | | |Note: This bit be clear automatically by writing the relative channel data (byte). - * @var BMC_T::TXDATG0 - * Offset: 0x18 Biphase Mask Coding Transmit Data Group 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH0_TXDAT |Biphase Mask Coding Channel 0 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 0. - * |[12:8] |CH1_TXDAT |Biphase Mask Coding Channel 1 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 1. - * |[20:16] |CH2_TXDAT |Biphase Mask Coding Channel 2 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 2. - * |[28:24] |CH3_TXDAT |Biphase Mask Coding Channel 3 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 3. - * @var BMC_T::TXDATG1 - * Offset: 0x1C Biphase Mask Coding Transmit Data Group 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH4_TXDAT |Biphase Mask Coding Channel 4 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 4. - * |[12:8] |CH5_TXDAT |Biphase Mask Coding Channel 5 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 5. - * |[20:16] |CH6_TXDAT |Biphase Mask Coding Channel 6 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 6. - * |[28:24] |CH7_TXDAT |Biphase Mask Coding Channel 7 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 7. - * @var BMC_T::TXDATG2 - * Offset: 0x20 Biphase Mask Coding Transmit Data Group 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH8_TXDAT |Biphase Mask Coding Channel 8 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 8. - * |[12:8] |CH9_TXDAT |Biphase Mask Coding Channel 9 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 9. - * |[20:16] |CH10_TXDAT|Biphase Mask Coding Channel 10 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 10. - * |[28:24] |CH11_TXDAT|Biphase Mask Coding Channel 11 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 11. - * @var BMC_T::TXDATG3 - * Offset: 0x24 Biphase Mask Coding Transmit Data Group 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH12_TXDAT|Biphase Mask Coding Channel 12 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 12. - * |[12:8] |CH13_TXDAT|Biphase Mask Coding Channel 13 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 13. - * |[20:16] |CH14_TXDAT|Biphase Mask Coding Channel 14 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 14. - * |[28:24] |CH15_TXDAT|Biphase Mask Coding Channel 15 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 15. - * @var BMC_T::TXDATG4 - * Offset: 0x28 Biphase Mask Coding Transmit Data Group 4 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH16_TXDAT|Biphase Mask Coding Channel 16 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 16. - * |[12:8] |CH17_TXDAT|Biphase Mask Coding Channel 17 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 17. - * |[20:16] |CH18_TXDAT|Biphase Mask Coding Channel 18 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 18. - * |[28:24] |CH19_TXDAT|Biphase Mask Coding Channel 19 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 19. - * @var BMC_T::TXDATG5 - * Offset: 0x2C Biphase Mask Coding Transmit Data Group 5 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH20_TXDAT|Biphase Mask Coding Channel 20 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 20. - * |[12:8] |CH21_TXDAT|Biphase Mask Coding Channel 21 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 21. - * |[20:16] |CH22_TXDAT|Biphase Mask Coding Channel 22 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 22. - * |[28:24] |CH23_TXDAT|Biphase Mask Coding Channel 23 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 23. - * @var BMC_T::TXDATG6 - * Offset: 0x30 Biphase Mask Coding Transmit Data Group 6 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH24_TXDAT|Biphase Mask Coding Channel 24 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 24. - * |[12:8] |CH25_TXDAT|Biphase Mask Coding Channel 25 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 25. - * |[20:16] |CH26_TXDAT|Biphase Mask Coding Channel 26 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 26. - * |[28:24] |CH27_TXDAT|Biphase Mask Coding Channel 27 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 27. - * @var BMC_T::TXDATG7 - * Offset: 0x34 Biphase Mask Coding Transmit Data Group 7 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CH28_TXDAT|Biphase Mask Coding Channel 28 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 28. - * |[12:8] |CH29_TXDAT|Biphase Mask Coding Channel 29 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 29. - * |[20:16] |CH30_TXDAT|Biphase Mask Coding Channel 30 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 30. - * |[28:24] |CH31_TXDAT|Biphase Mask Coding Channel 31 Transmit Data - * | | |The bits field indicates the transmit data buffer for channel 31. - */ - __IO uint32_t CTL; /*!< [0x0000] Biphase Mask Coding Control Register */ - __IO uint32_t DNUM0; /*!< [0x0004] Biphase Mask Coding Dummy Bit Number Channel Group 0~3 Register */ - __IO uint32_t DNUM1; /*!< [0x0008] Biphase Mask Coding Dummy Bit Number Channel Group 4~7 Register */ - __IO uint32_t INTEN; /*!< [0x000c] Biphase Mask Coding Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0010] Biphase Mask Coding Interrupt Status Register */ - __IO uint32_t CHEMPTY; /*!< [0x0014] Biphase Mask Coding Channel Done Status Register */ - __O uint32_t TXDATG0; /*!< [0x0018] Biphase Mask Coding Transmit Data Group 0 Register */ - __O uint32_t TXDATG1; /*!< [0x001c] Biphase Mask Coding Transmit Data Group 1 Register */ - __O uint32_t TXDATG2; /*!< [0x0020] Biphase Mask Coding Transmit Data Group 2 Register */ - __O uint32_t TXDATG3; /*!< [0x0024] Biphase Mask Coding Transmit Data Group 3 Register */ - __O uint32_t TXDATG4; /*!< [0x0028] Biphase Mask Coding Transmit Data Group 4 Register */ - __O uint32_t TXDATG5; /*!< [0x002c] Biphase Mask Coding Transmit Data Group 5 Register */ - __O uint32_t TXDATG6; /*!< [0x0030] Biphase Mask Coding Transmit Data Group 6 Register */ - __O uint32_t TXDATG7; /*!< [0x0034] Biphase Mask Coding Transmit Data Group 7 Register */ - -} BMC_T; - -/** - @addtogroup BMC_CONST BMC Bit Field Definition - Constant Definitions for BMC Controller -@{ */ - -#define BMC_CTL_BMCEN_Pos (0) /*!< BMC_T::CTL: BMCEN Position */ -#define BMC_CTL_BMCEN_Msk (0x1ul << BMC_CTL_BMCEN_Pos) /*!< BMC_T::CTL: BMCEN Mask */ - -#define BMC_CTL_BWADJ_Pos (1) /*!< BMC_T::CTL: BWADJ Position */ -#define BMC_CTL_BWADJ_Msk (0x1ul << BMC_CTL_BWADJ_Pos) /*!< BMC_T::CTL: BWADJ Mask */ - -#define BMC_CTL_PREAM32_Pos (2) /*!< BMC_T::CTL: PREAM32 Position */ -#define BMC_CTL_PREAM32_Msk (0x1ul << BMC_CTL_PREAM32_Pos) /*!< BMC_T::CTL: PREAM32 Mask */ - -#define BMC_CTL_DUMLVL_Pos (3) /*!< BMC_T::CTL: DUMLVL Position */ -#define BMC_CTL_DUMLVL_Msk (0x1ul << BMC_CTL_DUMLVL_Pos) /*!< BMC_T::CTL: DUMLVL Mask */ - -#define BMC_CTL_DMAEN_Pos (4) /*!< BMC_T::CTL: DMAEN Position */ -#define BMC_CTL_DMAEN_Msk (0x1ul << BMC_CTL_DMAEN_Pos) /*!< BMC_T::CTL: DMAEN Mask */ - -#define BMC_CTL_G0CHEN_Pos (8) /*!< BMC_T::CTL: G0CHEN Position */ -#define BMC_CTL_G0CHEN_Msk (0x1ul << BMC_CTL_G0CHEN_Pos) /*!< BMC_T::CTL: G0CHEN Mask */ - -#define BMC_CTL_G1CHEN_Pos (9) /*!< BMC_T::CTL: G1CHEN Position */ -#define BMC_CTL_G1CHEN_Msk (0x1ul << BMC_CTL_G1CHEN_Pos) /*!< BMC_T::CTL: G1CHEN Mask */ - -#define BMC_CTL_G2CHEN_Pos (10) /*!< BMC_T::CTL: G2CHEN Position */ -#define BMC_CTL_G2CHEN_Msk (0x1ul << BMC_CTL_G2CHEN_Pos) /*!< BMC_T::CTL: G2CHEN Mask */ - -#define BMC_CTL_G3CHEN_Pos (11) /*!< BMC_T::CTL: G3CHEN Position */ -#define BMC_CTL_G3CHEN_Msk (0x1ul << BMC_CTL_G3CHEN_Pos) /*!< BMC_T::CTL: G3CHEN Mask */ - -#define BMC_CTL_G4CHEN_Pos (12) /*!< BMC_T::CTL: G4CHEN Position */ -#define BMC_CTL_G4CHEN_Msk (0x1ul << BMC_CTL_G4CHEN_Pos) /*!< BMC_T::CTL: G4CHEN Mask */ - -#define BMC_CTL_G5CHEN_Pos (13) /*!< BMC_T::CTL: G5CHEN Position */ -#define BMC_CTL_G5CHEN_Msk (0x1ul << BMC_CTL_G5CHEN_Pos) /*!< BMC_T::CTL: G5CHEN Mask */ - -#define BMC_CTL_G6CHEN_Pos (14) /*!< BMC_T::CTL: G6CHEN Position */ -#define BMC_CTL_G6CHEN_Msk (0x1ul << BMC_CTL_G6CHEN_Pos) /*!< BMC_T::CTL: G6CHEN Mask */ - -#define BMC_CTL_G7CHEN_Pos (15) /*!< BMC_T::CTL: G7CHEN Position */ -#define BMC_CTL_G7CHEN_Msk (0x1ul << BMC_CTL_G7CHEN_Pos) /*!< BMC_T::CTL: G7CHEN Mask */ - -#define BMC_CTL_BTDIV_Pos (16) /*!< BMC_T::CTL: BTDIV Position */ -#define BMC_CTL_BTDIV_Msk (0x1fful << BMC_CTL_BTDIV_Pos) /*!< BMC_T::CTL: BTDIV Mask */ - -#define BMC_DNUM0_DNUMG0_Pos (0) /*!< BMC_T::DNUM0: DNUMG0 Position */ -#define BMC_DNUM0_DNUMG0_Msk (0xfful << BMC_DNUM0_DNUMG0_Pos) /*!< BMC_T::DNUM0: DNUMG0 Mask */ - -#define BMC_DNUM0_DNUMG1_Pos (8) /*!< BMC_T::DNUM0: DNUMG1 Position */ -#define BMC_DNUM0_DNUMG1_Msk (0xfful << BMC_DNUM0_DNUMG1_Pos) /*!< BMC_T::DNUM0: DNUMG1 Mask */ - -#define BMC_DNUM0_DNUMG2_Pos (16) /*!< BMC_T::DNUM0: DNUMG2 Position */ -#define BMC_DNUM0_DNUMG2_Msk (0xfful << BMC_DNUM0_DNUMG2_Pos) /*!< BMC_T::DNUM0: DNUMG2 Mask */ - -#define BMC_DNUM0_DNUMG3_Pos (24) /*!< BMC_T::DNUM0: DNUMG3 Position */ -#define BMC_DNUM0_DNUMG3_Msk (0xfful << BMC_DNUM0_DNUMG3_Pos) /*!< BMC_T::DNUM0: DNUMG3 Mask */ - -#define BMC_DNUM1_DNUMG4_Pos (0) /*!< BMC_T::DNUM1: DNUMG4 Position */ -#define BMC_DNUM1_DNUMG4_Msk (0xfful << BMC_DNUM1_DNUMG4_Pos) /*!< BMC_T::DNUM1: DNUMG4 Mask */ - -#define BMC_DNUM1_DNUMG5_Pos (8) /*!< BMC_T::DNUM1: DNUMG5 Position */ -#define BMC_DNUM1_DNUMG5_Msk (0xfful << BMC_DNUM1_DNUMG5_Pos) /*!< BMC_T::DNUM1: DNUMG5 Mask */ - -#define BMC_DNUM1_DNUMG6_Pos (16) /*!< BMC_T::DNUM1: DNUMG6 Position */ -#define BMC_DNUM1_DNUMG6_Msk (0xfful << BMC_DNUM1_DNUMG6_Pos) /*!< BMC_T::DNUM1: DNUMG6 Mask */ - -#define BMC_DNUM1_DNUMG7_Pos (24) /*!< BMC_T::DNUM1: DNUMG7 Position */ -#define BMC_DNUM1_DNUMG7_Msk (0xfful << BMC_DNUM1_DNUMG7_Pos) /*!< BMC_T::DNUM1: DNUMG7 Mask */ - -#define BMC_INTEN_FTXDIEN_Pos (0) /*!< BMC_T::INTEN: FTXDIEN Position */ -#define BMC_INTEN_FTXDIEN_Msk (0x1ul << BMC_INTEN_FTXDIEN_Pos) /*!< BMC_T::INTEN: FTXDIEN Mask */ - -#define BMC_INTEN_TXUNDIEN_Pos (1) /*!< BMC_T::INTEN: TXUNDIEN Position */ -#define BMC_INTEN_TXUNDIEN_Msk (0x1ul << BMC_INTEN_TXUNDIEN_Pos) /*!< BMC_T::INTEN: TXUNDIEN Mask */ - -#define BMC_INTSTS_FTXDIF_Pos (0) /*!< BMC_T::INTSTS: FTXDIF Position */ -#define BMC_INTSTS_FTXDIF_Msk (0x1ul << BMC_INTSTS_FTXDIF_Pos) /*!< BMC_T::INTSTS: FTXDIF Mask */ - -#define BMC_INTSTS_TXUNDIF_Pos (1) /*!< BMC_T::INTSTS: TXUNDIF Position */ -#define BMC_INTSTS_TXUNDIF_Msk (0x1ul << BMC_INTSTS_TXUNDIF_Pos) /*!< BMC_T::INTSTS: TXUNDIF Mask */ - -#define BMC_INTSTS_G0TXUND_Pos (8) /*!< BMC_T::INTSTS: G0TXUND Position */ -#define BMC_INTSTS_G0TXUND_Msk (0x1ul << BMC_INTSTS_G0TXUND_Pos) /*!< BMC_T::INTSTS: G0TXUND Mask */ - -#define BMC_INTSTS_G1TXUND_Pos (9) /*!< BMC_T::INTSTS: G1TXUND Position */ -#define BMC_INTSTS_G1TXUND_Msk (0x1ul << BMC_INTSTS_G1TXUND_Pos) /*!< BMC_T::INTSTS: G1TXUND Mask */ - -#define BMC_INTSTS_G2TXUND_Pos (10) /*!< BMC_T::INTSTS: G2TXUND Position */ -#define BMC_INTSTS_G2TXUND_Msk (0x1ul << BMC_INTSTS_G2TXUND_Pos) /*!< BMC_T::INTSTS: G2TXUND Mask */ - -#define BMC_INTSTS_G3TXUND_Pos (11) /*!< BMC_T::INTSTS: G3TXUND Position */ -#define BMC_INTSTS_G3TXUND_Msk (0x1ul << BMC_INTSTS_G3TXUND_Pos) /*!< BMC_T::INTSTS: G3TXUND Mask */ - -#define BMC_INTSTS_G4TXUND_Pos (12) /*!< BMC_T::INTSTS: G4TXUND Position */ -#define BMC_INTSTS_G4TXUND_Msk (0x1ul << BMC_INTSTS_G4TXUND_Pos) /*!< BMC_T::INTSTS: G4TXUND Mask */ - -#define BMC_INTSTS_G5TXUND_Pos (13) /*!< BMC_T::INTSTS: G5TXUND Position */ -#define BMC_INTSTS_G5TXUND_Msk (0x1ul << BMC_INTSTS_G5TXUND_Pos) /*!< BMC_T::INTSTS: G5TXUND Mask */ - -#define BMC_INTSTS_G6TXUND_Pos (14) /*!< BMC_T::INTSTS: G6TXUND Position */ -#define BMC_INTSTS_G6TXUND_Msk (0x1ul << BMC_INTSTS_G6TXUND_Pos) /*!< BMC_T::INTSTS: G6TXUND Mask */ - -#define BMC_INTSTS_G7TXUND_Pos (15) /*!< BMC_T::INTSTS: G7TXUND Position */ -#define BMC_INTSTS_G7TXUND_Msk (0x1ul << BMC_INTSTS_G7TXUND_Pos) /*!< BMC_T::INTSTS: G7TXUND Mask */ - -#define BMC_CHEMPTY_CH0EPT_Pos (0) /*!< BMC_T::CHEMPTY: CH0EPT Position */ -#define BMC_CHEMPTY_CH0EPT_Msk (0x1ul << BMC_CHEMPTY_CH0EPT_Pos) /*!< BMC_T::CHEMPTY: CH0EPT Mask */ - -#define BMC_CHEMPTY_CH1EPT_Pos (1) /*!< BMC_T::CHEMPTY: CH1EPT Position */ -#define BMC_CHEMPTY_CH1EPT_Msk (0x1ul << BMC_CHEMPTY_CH1EPT_Pos) /*!< BMC_T::CHEMPTY: CH1EPT Mask */ - -#define BMC_CHEMPTY_CH2EPT_Pos (2) /*!< BMC_T::CHEMPTY: CH2EPT Position */ -#define BMC_CHEMPTY_CH2EPT_Msk (0x1ul << BMC_CHEMPTY_CH2EPT_Pos) /*!< BMC_T::CHEMPTY: CH2EPT Mask */ - -#define BMC_CHEMPTY_CH3EPT_Pos (3) /*!< BMC_T::CHEMPTY: CH3EPT Position */ -#define BMC_CHEMPTY_CH3EPT_Msk (0x1ul << BMC_CHEMPTY_CH3EPT_Pos) /*!< BMC_T::CHEMPTY: CH3EPT Mask */ - -#define BMC_CHEMPTY_CH4EPT_Pos (4) /*!< BMC_T::CHEMPTY: CH4EPT Position */ -#define BMC_CHEMPTY_CH4EPT_Msk (0x1ul << BMC_CHEMPTY_CH4EPT_Pos) /*!< BMC_T::CHEMPTY: CH4EPT Mask */ - -#define BMC_CHEMPTY_CH5EPT_Pos (5) /*!< BMC_T::CHEMPTY: CH5EPT Position */ -#define BMC_CHEMPTY_CH5EPT_Msk (0x1ul << BMC_CHEMPTY_CH5EPT_Pos) /*!< BMC_T::CHEMPTY: CH5EPT Mask */ - -#define BMC_CHEMPTY_CH6EPT_Pos (6) /*!< BMC_T::CHEMPTY: CH6EPT Position */ -#define BMC_CHEMPTY_CH6EPT_Msk (0x1ul << BMC_CHEMPTY_CH6EPT_Pos) /*!< BMC_T::CHEMPTY: CH6EPT Mask */ - -#define BMC_CHEMPTY_CH7EPT_Pos (7) /*!< BMC_T::CHEMPTY: CH7EPT Position */ -#define BMC_CHEMPTY_CH7EPT_Msk (0x1ul << BMC_CHEMPTY_CH7EPT_Pos) /*!< BMC_T::CHEMPTY: CH7EPT Mask */ - -#define BMC_CHEMPTY_CH8EPT_Pos (8) /*!< BMC_T::CHEMPTY: CH8EPT Position */ -#define BMC_CHEMPTY_CH8EPT_Msk (0x1ul << BMC_CHEMPTY_CH8EPT_Pos) /*!< BMC_T::CHEMPTY: CH8EPT Mask */ - -#define BMC_CHEMPTY_CH9EPT_Pos (9) /*!< BMC_T::CHEMPTY: CH9EPT Position */ -#define BMC_CHEMPTY_CH9EPT_Msk (0x1ul << BMC_CHEMPTY_CH9EPT_Pos) /*!< BMC_T::CHEMPTY: CH9EPT Mask */ - -#define BMC_CHEMPTY_CH10EPT_Pos (10) /*!< BMC_T::CHEMPTY: CH10EPT Position */ -#define BMC_CHEMPTY_CH10EPT_Msk (0x1ul << BMC_CHEMPTY_CH10EPT_Pos) /*!< BMC_T::CHEMPTY: CH10EPT Mask */ - -#define BMC_CHEMPTY_CH11EPT_Pos (11) /*!< BMC_T::CHEMPTY: CH11EPT Position */ -#define BMC_CHEMPTY_CH11EPT_Msk (0x1ul << BMC_CHEMPTY_CH11EPT_Pos) /*!< BMC_T::CHEMPTY: CH11EPT Mask */ - -#define BMC_CHEMPTY_CH12EPT_Pos (12) /*!< BMC_T::CHEMPTY: CH12EPT Position */ -#define BMC_CHEMPTY_CH12EPT_Msk (0x1ul << BMC_CHEMPTY_CH12EPT_Pos) /*!< BMC_T::CHEMPTY: CH12EPT Mask */ - -#define BMC_CHEMPTY_CH13EPT_Pos (13) /*!< BMC_T::CHEMPTY: CH13EPT Position */ -#define BMC_CHEMPTY_CH13EPT_Msk (0x1ul << BMC_CHEMPTY_CH13EPT_Pos) /*!< BMC_T::CHEMPTY: CH13EPT Mask */ - -#define BMC_CHEMPTY_CH14EPT_Pos (14) /*!< BMC_T::CHEMPTY: CH14EPT Position */ -#define BMC_CHEMPTY_CH14EPT_Msk (0x1ul << BMC_CHEMPTY_CH14EPT_Pos) /*!< BMC_T::CHEMPTY: CH14EPT Mask */ - -#define BMC_CHEMPTY_CH15EPT_Pos (15) /*!< BMC_T::CHEMPTY: CH15EPT Position */ -#define BMC_CHEMPTY_CH15EPT_Msk (0x1ul << BMC_CHEMPTY_CH15EPT_Pos) /*!< BMC_T::CHEMPTY: CH15EPT Mask */ - -#define BMC_CHEMPTY_CH16EPT_Pos (16) /*!< BMC_T::CHEMPTY: CH16EPT Position */ -#define BMC_CHEMPTY_CH16EPT_Msk (0x1ul << BMC_CHEMPTY_CH16EPT_Pos) /*!< BMC_T::CHEMPTY: CH16EPT Mask */ - -#define BMC_CHEMPTY_CH17EPT_Pos (17) /*!< BMC_T::CHEMPTY: CH17EPT Position */ -#define BMC_CHEMPTY_CH17EPT_Msk (0x1ul << BMC_CHEMPTY_CH17EPT_Pos) /*!< BMC_T::CHEMPTY: CH17EPT Mask */ - -#define BMC_CHEMPTY_CH18EPT_Pos (18) /*!< BMC_T::CHEMPTY: CH18EPT Position */ -#define BMC_CHEMPTY_CH18EPT_Msk (0x1ul << BMC_CHEMPTY_CH18EPT_Pos) /*!< BMC_T::CHEMPTY: CH18EPT Mask */ - -#define BMC_CHEMPTY_CH19EPT_Pos (19) /*!< BMC_T::CHEMPTY: CH19EPT Position */ -#define BMC_CHEMPTY_CH19EPT_Msk (0x1ul << BMC_CHEMPTY_CH19EPT_Pos) /*!< BMC_T::CHEMPTY: CH19EPT Mask */ - -#define BMC_CHEMPTY_CH20EPT_Pos (20) /*!< BMC_T::CHEMPTY: CH20EPT Position */ -#define BMC_CHEMPTY_CH20EPT_Msk (0x1ul << BMC_CHEMPTY_CH20EPT_Pos) /*!< BMC_T::CHEMPTY: CH20EPT Mask */ - -#define BMC_CHEMPTY_CH21EPT_Pos (21) /*!< BMC_T::CHEMPTY: CH21EPT Position */ -#define BMC_CHEMPTY_CH21EPT_Msk (0x1ul << BMC_CHEMPTY_CH21EPT_Pos) /*!< BMC_T::CHEMPTY: CH21EPT Mask */ - -#define BMC_CHEMPTY_CH22EPT_Pos (22) /*!< BMC_T::CHEMPTY: CH22EPT Position */ -#define BMC_CHEMPTY_CH22EPT_Msk (0x1ul << BMC_CHEMPTY_CH22EPT_Pos) /*!< BMC_T::CHEMPTY: CH22EPT Mask */ - -#define BMC_CHEMPTY_CH23EPT_Pos (23) /*!< BMC_T::CHEMPTY: CH23EPT Position */ -#define BMC_CHEMPTY_CH23EPT_Msk (0x1ul << BMC_CHEMPTY_CH23EPT_Pos) /*!< BMC_T::CHEMPTY: CH23EPT Mask */ - -#define BMC_CHEMPTY_CH24EPT_Pos (24) /*!< BMC_T::CHEMPTY: CH24EPT Position */ -#define BMC_CHEMPTY_CH24EPT_Msk (0x1ul << BMC_CHEMPTY_CH24EPT_Pos) /*!< BMC_T::CHEMPTY: CH24EPT Mask */ - -#define BMC_CHEMPTY_CH25EPT_Pos (25) /*!< BMC_T::CHEMPTY: CH25EPT Position */ -#define BMC_CHEMPTY_CH25EPT_Msk (0x1ul << BMC_CHEMPTY_CH25EPT_Pos) /*!< BMC_T::CHEMPTY: CH25EPT Mask */ - -#define BMC_CHEMPTY_CH26EPT_Pos (26) /*!< BMC_T::CHEMPTY: CH26EPT Position */ -#define BMC_CHEMPTY_CH26EPT_Msk (0x1ul << BMC_CHEMPTY_CH26EPT_Pos) /*!< BMC_T::CHEMPTY: CH26EPT Mask */ - -#define BMC_CHEMPTY_CH27EPT_Pos (27) /*!< BMC_T::CHEMPTY: CH27EPT Position */ -#define BMC_CHEMPTY_CH27EPT_Msk (0x1ul << BMC_CHEMPTY_CH27EPT_Pos) /*!< BMC_T::CHEMPTY: CH27EPT Mask */ - -#define BMC_CHEMPTY_CH28EPT_Pos (28) /*!< BMC_T::CHEMPTY: CH28EPT Position */ -#define BMC_CHEMPTY_CH28EPT_Msk (0x1ul << BMC_CHEMPTY_CH28EPT_Pos) /*!< BMC_T::CHEMPTY: CH28EPT Mask */ - -#define BMC_CHEMPTY_CH29EPT_Pos (29) /*!< BMC_T::CHEMPTY: CH29EPT Position */ -#define BMC_CHEMPTY_CH29EPT_Msk (0x1ul << BMC_CHEMPTY_CH29EPT_Pos) /*!< BMC_T::CHEMPTY: CH29EPT Mask */ - -#define BMC_CHEMPTY_CH30EPT_Pos (30) /*!< BMC_T::CHEMPTY: CH30EPT Position */ -#define BMC_CHEMPTY_CH30EPT_Msk (0x1ul << BMC_CHEMPTY_CH30EPT_Pos) /*!< BMC_T::CHEMPTY: CH30EPT Mask */ - -#define BMC_CHEMPTY_CH31EPT_Pos (31) /*!< BMC_T::CHEMPTY: CH31EPT Position */ -#define BMC_CHEMPTY_CH31EPT_Msk (0x1ul << BMC_CHEMPTY_CH31EPT_Pos) /*!< BMC_T::CHEMPTY: CH31EPT Mask */ - -#define BMC_TXDATG0_CH0_TXDAT_Pos (0) /*!< BMC_T::TXDATG0: CH0_TXDAT Position */ -#define BMC_TXDATG0_CH0_TXDAT_Msk (0x1ful << BMC_TXDATG0_CH0_TXDAT_Pos) /*!< BMC_T::TXDATG0: CH0_TXDAT Mask */ - -#define BMC_TXDATG0_CH1_TXDAT_Pos (8) /*!< BMC_T::TXDATG0: CH1_TXDAT Position */ -#define BMC_TXDATG0_CH1_TXDAT_Msk (0x1ful << BMC_TXDATG0_CH1_TXDAT_Pos) /*!< BMC_T::TXDATG0: CH1_TXDAT Mask */ - -#define BMC_TXDATG0_CH2_TXDAT_Pos (16) /*!< BMC_T::TXDATG0: CH2_TXDAT Position */ -#define BMC_TXDATG0_CH2_TXDAT_Msk (0x1ful << BMC_TXDATG0_CH2_TXDAT_Pos) /*!< BMC_T::TXDATG0: CH2_TXDAT Mask */ - -#define BMC_TXDATG0_CH3_TXDAT_Pos (24) /*!< BMC_T::TXDATG0: CH3_TXDAT Position */ -#define BMC_TXDATG0_CH3_TXDAT_Msk (0x1ful << BMC_TXDATG0_CH3_TXDAT_Pos) /*!< BMC_T::TXDATG0: CH3_TXDAT Mask */ - -#define BMC_TXDATG1_CH4_TXDAT_Pos (0) /*!< BMC_T::TXDATG1: CH4_TXDAT Position */ -#define BMC_TXDATG1_CH4_TXDAT_Msk (0x1ful << BMC_TXDATG1_CH4_TXDAT_Pos) /*!< BMC_T::TXDATG1: CH4_TXDAT Mask */ - -#define BMC_TXDATG1_CH5_TXDAT_Pos (8) /*!< BMC_T::TXDATG1: CH5_TXDAT Position */ -#define BMC_TXDATG1_CH5_TXDAT_Msk (0x1ful << BMC_TXDATG1_CH5_TXDAT_Pos) /*!< BMC_T::TXDATG1: CH5_TXDAT Mask */ - -#define BMC_TXDATG1_CH6_TXDAT_Pos (16) /*!< BMC_T::TXDATG1: CH6_TXDAT Position */ -#define BMC_TXDATG1_CH6_TXDAT_Msk (0x1ful << BMC_TXDATG1_CH6_TXDAT_Pos) /*!< BMC_T::TXDATG1: CH6_TXDAT Mask */ - -#define BMC_TXDATG1_CH7_TXDAT_Pos (24) /*!< BMC_T::TXDATG1: CH7_TXDAT Position */ -#define BMC_TXDATG1_CH7_TXDAT_Msk (0x1ful << BMC_TXDATG1_CH7_TXDAT_Pos) /*!< BMC_T::TXDATG1: CH7_TXDAT Mask */ - -#define BMC_TXDATG2_CH8_TXDAT_Pos (0) /*!< BMC_T::TXDATG2: CH8_TXDAT Position */ -#define BMC_TXDATG2_CH8_TXDAT_Msk (0x1ful << BMC_TXDATG2_CH8_TXDAT_Pos) /*!< BMC_T::TXDATG2: CH8_TXDAT Mask */ - -#define BMC_TXDATG2_CH9_TXDAT_Pos (8) /*!< BMC_T::TXDATG2: CH9_TXDAT Position */ -#define BMC_TXDATG2_CH9_TXDAT_Msk (0x1ful << BMC_TXDATG2_CH9_TXDAT_Pos) /*!< BMC_T::TXDATG2: CH9_TXDAT Mask */ - -#define BMC_TXDATG2_CH10_TXDAT_Pos (16) /*!< BMC_T::TXDATG2: CH10_TXDAT Position */ -#define BMC_TXDATG2_CH10_TXDAT_Msk (0x1ful << BMC_TXDATG2_CH10_TXDAT_Pos) /*!< BMC_T::TXDATG2: CH10_TXDAT Mask */ - -#define BMC_TXDATG2_CH11_TXDAT_Pos (24) /*!< BMC_T::TXDATG2: CH11_TXDAT Position */ -#define BMC_TXDATG2_CH11_TXDAT_Msk (0x1ful << BMC_TXDATG2_CH11_TXDAT_Pos) /*!< BMC_T::TXDATG2: CH11_TXDAT Mask */ - -#define BMC_TXDATG3_CH12_TXDAT_Pos (0) /*!< BMC_T::TXDATG3: CH12_TXDAT Position */ -#define BMC_TXDATG3_CH12_TXDAT_Msk (0x1ful << BMC_TXDATG3_CH12_TXDAT_Pos) /*!< BMC_T::TXDATG3: CH12_TXDAT Mask */ - -#define BMC_TXDATG3_CH13_TXDAT_Pos (8) /*!< BMC_T::TXDATG3: CH13_TXDAT Position */ -#define BMC_TXDATG3_CH13_TXDAT_Msk (0x1ful << BMC_TXDATG3_CH13_TXDAT_Pos) /*!< BMC_T::TXDATG3: CH13_TXDAT Mask */ - -#define BMC_TXDATG3_CH14_TXDAT_Pos (16) /*!< BMC_T::TXDATG3: CH14_TXDAT Position */ -#define BMC_TXDATG3_CH14_TXDAT_Msk (0x1ful << BMC_TXDATG3_CH14_TXDAT_Pos) /*!< BMC_T::TXDATG3: CH14_TXDAT Mask */ - -#define BMC_TXDATG3_CH15_TXDAT_Pos (24) /*!< BMC_T::TXDATG3: CH15_TXDAT Position */ -#define BMC_TXDATG3_CH15_TXDAT_Msk (0x1ful << BMC_TXDATG3_CH15_TXDAT_Pos) /*!< BMC_T::TXDATG3: CH15_TXDAT Mask */ - -#define BMC_TXDATG4_CH16_TXDAT_Pos (0) /*!< BMC_T::TXDATG4: CH16_TXDAT Position */ -#define BMC_TXDATG4_CH16_TXDAT_Msk (0x1ful << BMC_TXDATG4_CH16_TXDAT_Pos) /*!< BMC_T::TXDATG4: CH16_TXDAT Mask */ - -#define BMC_TXDATG4_CH17_TXDAT_Pos (8) /*!< BMC_T::TXDATG4: CH17_TXDAT Position */ -#define BMC_TXDATG4_CH17_TXDAT_Msk (0x1ful << BMC_TXDATG4_CH17_TXDAT_Pos) /*!< BMC_T::TXDATG4: CH17_TXDAT Mask */ - -#define BMC_TXDATG4_CH18_TXDAT_Pos (16) /*!< BMC_T::TXDATG4: CH18_TXDAT Position */ -#define BMC_TXDATG4_CH18_TXDAT_Msk (0x1ful << BMC_TXDATG4_CH18_TXDAT_Pos) /*!< BMC_T::TXDATG4: CH18_TXDAT Mask */ - -#define BMC_TXDATG4_CH19_TXDAT_Pos (24) /*!< BMC_T::TXDATG4: CH19_TXDAT Position */ -#define BMC_TXDATG4_CH19_TXDAT_Msk (0x1ful << BMC_TXDATG4_CH19_TXDAT_Pos) /*!< BMC_T::TXDATG4: CH19_TXDAT Mask */ - -#define BMC_TXDATG5_CH20_TXDAT_Pos (0) /*!< BMC_T::TXDATG5: CH20_TXDAT Position */ -#define BMC_TXDATG5_CH20_TXDAT_Msk (0x1ful << BMC_TXDATG5_CH20_TXDAT_Pos) /*!< BMC_T::TXDATG5: CH20_TXDAT Mask */ - -#define BMC_TXDATG5_CH21_TXDAT_Pos (8) /*!< BMC_T::TXDATG5: CH21_TXDAT Position */ -#define BMC_TXDATG5_CH21_TXDAT_Msk (0x1ful << BMC_TXDATG5_CH21_TXDAT_Pos) /*!< BMC_T::TXDATG5: CH21_TXDAT Mask */ - -#define BMC_TXDATG5_CH22_TXDAT_Pos (16) /*!< BMC_T::TXDATG5: CH22_TXDAT Position */ -#define BMC_TXDATG5_CH22_TXDAT_Msk (0x1ful << BMC_TXDATG5_CH22_TXDAT_Pos) /*!< BMC_T::TXDATG5: CH22_TXDAT Mask */ - -#define BMC_TXDATG5_CH23_TXDAT_Pos (24) /*!< BMC_T::TXDATG5: CH23_TXDAT Position */ -#define BMC_TXDATG5_CH23_TXDAT_Msk (0x1ful << BMC_TXDATG5_CH23_TXDAT_Pos) /*!< BMC_T::TXDATG5: CH23_TXDAT Mask */ - -#define BMC_TXDATG6_CH24_TXDAT_Pos (0) /*!< BMC_T::TXDATG6: CH24_TXDAT Position */ -#define BMC_TXDATG6_CH24_TXDAT_Msk (0x1ful << BMC_TXDATG6_CH24_TXDAT_Pos) /*!< BMC_T::TXDATG6: CH24_TXDAT Mask */ - -#define BMC_TXDATG6_CH25_TXDAT_Pos (8) /*!< BMC_T::TXDATG6: CH25_TXDAT Position */ -#define BMC_TXDATG6_CH25_TXDAT_Msk (0x1ful << BMC_TXDATG6_CH25_TXDAT_Pos) /*!< BMC_T::TXDATG6: CH25_TXDAT Mask */ - -#define BMC_TXDATG6_CH26_TXDAT_Pos (16) /*!< BMC_T::TXDATG6: CH26_TXDAT Position */ -#define BMC_TXDATG6_CH26_TXDAT_Msk (0x1ful << BMC_TXDATG6_CH26_TXDAT_Pos) /*!< BMC_T::TXDATG6: CH26_TXDAT Mask */ - -#define BMC_TXDATG6_CH27_TXDAT_Pos (24) /*!< BMC_T::TXDATG6: CH27_TXDAT Position */ -#define BMC_TXDATG6_CH27_TXDAT_Msk (0x1ful << BMC_TXDATG6_CH27_TXDAT_Pos) /*!< BMC_T::TXDATG6: CH27_TXDAT Mask */ - -#define BMC_TXDATG7_CH28_TXDAT_Pos (0) /*!< BMC_T::TXDATG7: CH28_TXDAT Position */ -#define BMC_TXDATG7_CH28_TXDAT_Msk (0x1ful << BMC_TXDATG7_CH28_TXDAT_Pos) /*!< BMC_T::TXDATG7: CH28_TXDAT Mask */ - -#define BMC_TXDATG7_CH29_TXDAT_Pos (8) /*!< BMC_T::TXDATG7: CH29_TXDAT Position */ -#define BMC_TXDATG7_CH29_TXDAT_Msk (0x1ful << BMC_TXDATG7_CH29_TXDAT_Pos) /*!< BMC_T::TXDATG7: CH29_TXDAT Mask */ - -#define BMC_TXDATG7_CH30_TXDAT_Pos (16) /*!< BMC_T::TXDATG7: CH30_TXDAT Position */ -#define BMC_TXDATG7_CH30_TXDAT_Msk (0x1ful << BMC_TXDATG7_CH30_TXDAT_Pos) /*!< BMC_T::TXDATG7: CH30_TXDAT Mask */ - -#define BMC_TXDATG7_CH31_TXDAT_Pos (24) /*!< BMC_T::TXDATG7: CH31_TXDAT Position */ -#define BMC_TXDATG7_CH31_TXDAT_Msk (0x1ful << BMC_TXDATG7_CH31_TXDAT_Pos) /*!< BMC_T::TXDATG7: CH31_TXDAT Mask */ - - -/**@}*/ /* BMC_CONST */ -/**@}*/ /* end of BMC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __BMC_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bpwm_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bpwm_reg.h deleted file mode 100644 index d817fe69c57..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/bpwm_reg.h +++ /dev/null @@ -1,1835 +0,0 @@ -/**************************************************************************//** - * @file bpwm_reg.h - * @version V1.00 - * @brief BPWM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __BPWM_REG_H__ -#define __BPWM_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup BPWM Basic Pulse Width Modulation Controller(BPWM) - Memory Mapped Structure for BPWM Controller -@{ */ - -typedef struct -{ - /** - * @var BCAPDAT_T::RCAPDAT - * Offset: 0x20C BPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |BPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the BPWM counter value will be saved in this register. - * @var BCAPDAT_T::FCAPDAT - * Offset: 0x210 BPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |BPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the BPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] BPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] BPWM Falling Capture Data Register 0~5 */ -} BCAPDAT_T; - -typedef struct -{ - - - /** - * @var BPWM_T::CTL0 - * Offset: 0x00 BPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[1] |CTRLD1 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[2] |CTRLD2 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[3] |CTRLD3 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[4] |CTRLD4 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[5] |CTRLD5 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[16] |IMMLDEN0 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, BPWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt Disabled. - * | | |1 = ICE debug mode counter halt Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects BPWM output. - * | | |BPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |BPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var BPWM_T::CTL1 - * Offset: 0x04 BPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |BPWM Counter Behavior Type 0 - * | | |Each bit n controls corresponding BPWM channel n. - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * @var BPWM_T::CLKSRC - * Offset: 0x10 BPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |BPWM_CH01 External Clock Source Select - * | | |000 = BPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var BPWM_T::CLKPSC - * Offset: 0x14 BPWM Clock Prescale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |BPWM Counter Clock Prescale - * | | |The clock of BPWM counter is decided by clock prescaler - * | | |Each BPWM pair share one BPWM counter clock prescaler - * | | |The clock of BPWM counter is divided by (CLKPSC+ 1) - * @var BPWM_T::CNTEN - * Offset: 0x20 BPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |BPWM Counter 0 Enable Bit - * | | |0 = BPWM Counter and clock prescaler stop running. - * | | |1 = BPWM Counter and clock prescaler start running. - * @var BPWM_T::CNTCLR - * Offset: 0x24 BPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear BPWM Counter Control Bit 0 - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit BPWM counter to 0000H. - * @var BPWM_T::PERIOD - * Offset: 0x30 BPWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |BPWM Period Register - * | | |Up-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |Down-Count mode: In this mode, BPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |BPWM period time = (PERIOD+1) * BPWM_CLK period. - * | | |Up-Down-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |BPWM period time = 2 * PERIOD * BPWM_CLK period. - * @var BPWM_T::CMPDAT[6] - * Offset: 0x50 BPWM Comparator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPDAT |BPWM Comparator Register - * | | |CMPDAT use to compare with CNTR to generate BPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 denote as 6 independent BPWM_CH0~5 compared point. - * @var BPWM_T::CNT - * Offset: 0x90 BPWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |BPWM Data Register (Read Only) - * | | |User can monitor CNTR to know the current value in 16-bit period counter. - * |[16] |DIRF |BPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is Down count. - * | | |1 = Counter is UP count. - * @var BPWM_T::WGCTL0 - * Offset: 0xB0 BPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[3:2] |ZPCTL1 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[5:4] |ZPCTL2 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[7:6] |ZPCTL3 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[9:8] |ZPCTL4 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[11:10] |ZPCTL5 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[17:16] |PRDPCTL0 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * @var BPWM_T::WGCTL1 - * Offset: 0xB4 BPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[3:2] |CMPUCTL1 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[5:4] |CMPUCTL2 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[7:6] |CMPUCTL3 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[9:8] |CMPUCTL4 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[11:10] |CMPUCTL5 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[17:16] |CMPDCTL0 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[19:18] |CMPDCTL1 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[21:20] |CMPDCTL2 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[23:22] |CMPDCTL3 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[25:24] |CMPDCTL4 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[27:26] |CMPDCTL5 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * @var BPWM_T::MSKEN - * Offset: 0xB8 BPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[1] |MSKEN1 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[2] |MSKEN2 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[3] |MSKEN3 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[4] |MSKEN4 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[5] |MSKEN5 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * @var BPWM_T::MSK - * Offset: 0xBC BPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[1] |MSKDAT1 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[2] |MSKDAT2 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[3] |MSKDAT3 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[4] |MSKDAT4 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[5] |MSKDAT5 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * @var BPWM_T::POLCTL - * Offset: 0xD4 BPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[1] |PINV1 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[2] |PINV2 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[3] |PINV3 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[4] |PINV4 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[5] |PINV5 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * @var BPWM_T::POEN - * Offset: 0xD8 BPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[1] |POEN1 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[2] |POEN2 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[3] |POEN3 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[4] |POEN4 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[5] |POEN5 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * @var BPWM_T::INTEN - * Offset: 0xE0 BPWM Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |BPWM Zero Point Interrupt 0 Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * |[8] |PIEN0 |BPWM Period Point Interrupt 0 Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When up-down counter type period point means center point. - * |[16] |CMPUIEN0 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[17] |CMPUIEN1 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[18] |CMPUIEN2 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[19] |CMPUIEN3 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[20] |CMPUIEN4 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[21] |CMPUIEN5 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[24] |CMPDIEN0 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[25] |CMPDIEN1 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[26] |CMPDIEN2 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[27] |CMPDIEN3 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[28] |CMPDIEN4 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[29] |CMPDIEN5 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * @var BPWM_T::INTSTS - * Offset: 0xE8 BPWM Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |BPWM Zero Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches zero, software can write 1 to clear this bit to zero. - * |[8] |PIF0 |BPWM Period Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches BPWM_PERIOD0, software can write 1 to clear this bit to zero. - * |[16] |CMPUIF0 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[17] |CMPUIF1 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[18] |CMPUIF2 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[19] |CMPUIF3 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[20] |CMPUIF4 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[21] |CMPUIF5 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[24] |CMPDIF0 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[25] |CMPDIF1 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[26] |CMPDIF2 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[27] |CMPDIF3 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[28] |CMPDIF4 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[29] |CMPDIF5 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * @var BPWM_T::EADCTS0 - * Offset: 0xF8 BPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |BPWM_CH0 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN0 |BPWM_CH0 Trigger EADC Enable Bit - * |[11:8] |TRGSEL1 |BPWM_CH1 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN1 |BPWM_CH1 Trigger EADC Enable Bit - * |[19:16] |TRGSEL2 |BPWM_CH2 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved - * |[23] |TRGEN2 |BPWM_CH2 Trigger EADC Enable Bit - * |[27:24] |TRGSEL3 |BPWM_CH3 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved. - * |[31] |TRGEN3 |BPWM_CH3 Trigger EADC Enable Bit - * @var BPWM_T::EADCTS1 - * Offset: 0xFC BPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |BPWM_CH4 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN4 |BPWM_CH4 Trigger EADC Enable Bit - * |[11:8] |TRGSEL5 |BPWM_CH5 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN5 |BPWM_CH5 Trigger EADC Enable Bit - * @var BPWM_T::SSCTL - * Offset: 0x110 BPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |BPWM Synchronous Start Function 0 Enable Bit - * | | |When synchronous start function is enabled, the BPWM_CH0 counter enable bit (CNTEN0) can be enabled by writing BPWM synchronous start trigger bit (CNTSEN). - * | | |0 = BPWM synchronous start function Disabled. - * | | |1 = BPWM synchronous start function Enabled. - * |[9:8] |SSRC |BPWM Synchronous Start Source Select - * | | |00 = Synchronous start source come from PWM0. - * | | |01 = Synchronous start source come from PWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var BPWM_T::SSTRG - * Offset: 0x114 BPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |BPWM Counter Synchronous Start Enable Bit(Write Only) - * | | |BPMW counter synchronous enable function is used to make PWM or BPWM channels start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit if correlated BPWM channel counter synchronous start function is enabled. - * @var BPWM_T::STATUS - * Offset: 0x120 BPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAX0 |Time-base Counter 0 Equal to 0xFFFF Latched Status - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[16] |EADCTRG0 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[17] |EADCTRG1 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[18] |EADCTRG2 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[19] |EADCTRG3 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[20] |EADCTRG4 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[21] |EADCTRG5 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * @var BPWM_T::CAPINEN - * Offset: 0x200 BPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * @var BPWM_T::CAPCTL - * Offset: 0x204 BPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var BPWM_T::CAPSTS - * Offset: 0x208 BPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRIFOV0 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[1] |CRIFOV1 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[2] |CRIFOV2 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[3] |CRIFOV3 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[4] |CRIFOV4 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[5] |CRIFOV5 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[8] |CFIFOV0 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[9] |CFIFOV1 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[10] |CFIFOV2 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[11] |CFIFOV3 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[12] |CFIFOV4 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[13] |CFIFOV5 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * @var BPWM_T::CAPIEN - * Offset: 0x250 BPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CAPRIENn |BPWM Capture Rising Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[13:8] |CAPFIENn |BPWM Capture Falling Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var BPWM_T::CAPIF - * Offset: 0x254 BPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIF0 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[1] |CAPRIF1 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[2] |CAPRIF2 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[3] |CAPRIF3 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[4] |CAPRIF4 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[5] |CAPRIF5 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[8] |CAPFIF0 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[9] |CAPFIF1 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[10] |CAPFIF2 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[11] |CAPFIF3 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[12] |CAPFIF4 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[13] |CAPFIF5 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * @var BPWM_T::PBUF - * Offset: 0x304 BPWM PERIOD Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |BPWM Period Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var BPWM_T::CMPBUF[6] - * Offset: 0x31C BPWM CMPDAT 0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |BPWM Comparator Buffer (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL0; /*!< [0x0000] BPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] BPWM Control Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CLKSRC; /*!< [0x0010] BPWM Clock Source Register */ - __IO uint32_t CLKPSC; /*!< [0x0014] BPWM Clock Prescale Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CNTEN; /*!< [0x0020] BPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] BPWM Clear Counter Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PERIOD; /*!< [0x0030] BPWM Period Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[7]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CMPDAT[6]; /*!< [0x0050] BPWM Comparator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[10]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t CNT; /*!< [0x0090] BPWM Counter Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[7]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WGCTL0; /*!< [0x00b0] BPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] BPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] BPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] BPWM Mask Data Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE6[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t POLCTL; /*!< [0x00d4] BPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] BPWM Output Enable Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE7[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t INTEN; /*!< [0x00e0] BPWM Interrupt Enable Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE8[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t INTSTS; /*!< [0x00e8] BPWM Interrupt Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE9[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t EADCTS0; /*!< [0x00f8] BPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] BPWM Trigger EADC Source Select Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE10[4]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SSCTL; /*!< [0x0110] BPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] BPWM Synchronous Start Trigger Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE11[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t STATUS; /*!< [0x0120] BPWM Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE12[55]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPINEN; /*!< [0x0200] BPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] BPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] BPWM Capture Status Register */ - BCAPDAT_T CAPDAT[6]; /*!< [0x020C] BPWM Rising and Falling Capture Data Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE13[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPIEN; /*!< [0x0250] BPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] BPWM Capture Interrupt Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE14[43]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t PBUF; /*!< [0x0304] BPWM PERIOD Buffer */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE15[5]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t CMPBUF[6]; /*!< [0x031c] BPWM CMPDAT 0~5 Buffer */ - -} BPWM_T; - -/** - @addtogroup BPWM_CONST BPWM Bit Field Definition - Constant Definitions for BPWM Controller -@{ */ - -#define BPWM_CTL0_CTRLD0_Pos (0) /*!< BPWM_T::CTL0: CTRLD0 Position */ -#define BPWM_CTL0_CTRLD0_Msk (0x1ul << BPWM_CTL0_CTRLD0_Pos) /*!< BPWM_T::CTL0: CTRLD0 Mask */ - -#define BPWM_CTL0_CTRLD1_Pos (1) /*!< BPWM_T::CTL0: CTRLD1 Position */ -#define BPWM_CTL0_CTRLD1_Msk (0x1ul << BPWM_CTL0_CTRLD1_Pos) /*!< BPWM_T::CTL0: CTRLD1 Mask */ - -#define BPWM_CTL0_CTRLD2_Pos (2) /*!< BPWM_T::CTL0: CTRLD2 Position */ -#define BPWM_CTL0_CTRLD2_Msk (0x1ul << BPWM_CTL0_CTRLD2_Pos) /*!< BPWM_T::CTL0: CTRLD2 Mask */ - -#define BPWM_CTL0_CTRLD3_Pos (3) /*!< BPWM_T::CTL0: CTRLD3 Position */ -#define BPWM_CTL0_CTRLD3_Msk (0x1ul << BPWM_CTL0_CTRLD3_Pos) /*!< BPWM_T::CTL0: CTRLD3 Mask */ - -#define BPWM_CTL0_CTRLD4_Pos (4) /*!< BPWM_T::CTL0: CTRLD4 Position */ -#define BPWM_CTL0_CTRLD4_Msk (0x1ul << BPWM_CTL0_CTRLD4_Pos) /*!< BPWM_T::CTL0: CTRLD4 Mask */ - -#define BPWM_CTL0_CTRLD5_Pos (5) /*!< BPWM_T::CTL0: CTRLD5 Position */ -#define BPWM_CTL0_CTRLD5_Msk (0x1ul << BPWM_CTL0_CTRLD5_Pos) /*!< BPWM_T::CTL0: CTRLD5 Mask */ - -#define BPWM_CTL0_IMMLDEN0_Pos (16) /*!< BPWM_T::CTL0: IMMLDEN0 Position */ -#define BPWM_CTL0_IMMLDEN0_Msk (0x1ul << BPWM_CTL0_IMMLDEN0_Pos) /*!< BPWM_T::CTL0: IMMLDEN0 Mask */ - -#define BPWM_CTL0_IMMLDEN1_Pos (17) /*!< BPWM_T::CTL0: IMMLDEN1 Position */ -#define BPWM_CTL0_IMMLDEN1_Msk (0x1ul << BPWM_CTL0_IMMLDEN1_Pos) /*!< BPWM_T::CTL0: IMMLDEN1 Mask */ - -#define BPWM_CTL0_IMMLDEN2_Pos (18) /*!< BPWM_T::CTL0: IMMLDEN2 Position */ -#define BPWM_CTL0_IMMLDEN2_Msk (0x1ul << BPWM_CTL0_IMMLDEN2_Pos) /*!< BPWM_T::CTL0: IMMLDEN2 Mask */ - -#define BPWM_CTL0_IMMLDEN3_Pos (19) /*!< BPWM_T::CTL0: IMMLDEN3 Position */ -#define BPWM_CTL0_IMMLDEN3_Msk (0x1ul << BPWM_CTL0_IMMLDEN3_Pos) /*!< BPWM_T::CTL0: IMMLDEN3 Mask */ - -#define BPWM_CTL0_IMMLDEN4_Pos (20) /*!< BPWM_T::CTL0: IMMLDEN4 Position */ -#define BPWM_CTL0_IMMLDEN4_Msk (0x1ul << BPWM_CTL0_IMMLDEN4_Pos) /*!< BPWM_T::CTL0: IMMLDEN4 Mask */ - -#define BPWM_CTL0_IMMLDEN5_Pos (21) /*!< BPWM_T::CTL0: IMMLDEN5 Position */ -#define BPWM_CTL0_IMMLDEN5_Msk (0x1ul << BPWM_CTL0_IMMLDEN5_Pos) /*!< BPWM_T::CTL0: IMMLDEN5 Mask */ - -#define BPWM_CTL0_DBGHALT_Pos (30) /*!< BPWM_T::CTL0: DBGHALT Position */ -#define BPWM_CTL0_DBGHALT_Msk (0x1ul << BPWM_CTL0_DBGHALT_Pos) /*!< BPWM_T::CTL0: DBGHALT Mask */ - -#define BPWM_CTL0_DBGTRIOFF_Pos (31) /*!< BPWM_T::CTL0: DBGTRIOFF Position */ -#define BPWM_CTL0_DBGTRIOFF_Msk (0x1ul << BPWM_CTL0_DBGTRIOFF_Pos) /*!< BPWM_T::CTL0: DBGTRIOFF Mask */ - -#define BPWM_CTL1_CNTTYPE0_Pos (0) /*!< BPWM_T::CTL1: CNTTYPE0 Position */ -#define BPWM_CTL1_CNTTYPE0_Msk (0x3ul << BPWM_CTL1_CNTTYPE0_Pos) /*!< BPWM_T::CTL1: CNTTYPE0 Mask */ - -#define BPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< BPWM_T::CLKSRC: ECLKSRC0 Position */ -#define BPWM_CLKSRC_ECLKSRC0_Msk (0x7ul << BPWM_CLKSRC_ECLKSRC0_Pos) /*!< BPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define BPWM_CLKPSC_CLKPSC_Pos (0) /*!< BPWM_T::CLKPSC: CLKPSC Position */ -#define BPWM_CLKPSC_CLKPSC_Msk (0xffful << BPWM_CLKPSC_CLKPSC_Pos) /*!< BPWM_T::CLKPSC: CLKPSC Mask */ - -#define BPWM_CNTEN_CNTEN0_Pos (0) /*!< BPWM_T::CNTEN: CNTEN0 Position */ -#define BPWM_CNTEN_CNTEN0_Msk (0x1ul << BPWM_CNTEN_CNTEN0_Pos) /*!< BPWM_T::CNTEN: CNTEN0 Mask */ - -#define BPWM_CNTCLR_CNTCLR0_Pos (0) /*!< BPWM_T::CNTCLR: CNTCLR0 Position */ -#define BPWM_CNTCLR_CNTCLR0_Msk (0x1ul << BPWM_CNTCLR_CNTCLR0_Pos) /*!< BPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define BPWM_PERIOD_PERIOD_Pos (0) /*!< BPWM_T::PERIOD: PERIOD Position */ -#define BPWM_PERIOD_PERIOD_Msk (0xfffful << BPWM_PERIOD_PERIOD_Pos) /*!< BPWM_T::PERIOD: PERIOD Mask */ - -#define BPWM_CMPDAT0_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT0: CMPDAT Position */ -#define BPWM_CMPDAT0_CMPDAT_Msk (0xfffful << BPWM_CMPDAT0_CMPDAT_Pos) /*!< BPWM_T::CMPDAT0: CMPDAT Mask */ - -#define BPWM_CMPDAT1_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT1: CMPDAT Position */ -#define BPWM_CMPDAT1_CMPDAT_Msk (0xfffful << BPWM_CMPDAT1_CMPDAT_Pos) /*!< BPWM_T::CMPDAT1: CMPDAT Mask */ - -#define BPWM_CMPDAT2_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT2: CMPDAT Position */ -#define BPWM_CMPDAT2_CMPDAT_Msk (0xfffful << BPWM_CMPDAT2_CMPDAT_Pos) /*!< BPWM_T::CMPDAT2: CMPDAT Mask */ - -#define BPWM_CMPDAT3_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT3: CMPDAT Position */ -#define BPWM_CMPDAT3_CMPDAT_Msk (0xfffful << BPWM_CMPDAT3_CMPDAT_Pos) /*!< BPWM_T::CMPDAT3: CMPDAT Mask */ - -#define BPWM_CMPDAT4_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT4: CMPDAT Position */ -#define BPWM_CMPDAT4_CMPDAT_Msk (0xfffful << BPWM_CMPDAT4_CMPDAT_Pos) /*!< BPWM_T::CMPDAT4: CMPDAT Mask */ - -#define BPWM_CMPDAT5_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT5: CMPDAT Position */ -#define BPWM_CMPDAT5_CMPDAT_Msk (0xfffful << BPWM_CMPDAT5_CMPDAT_Pos) /*!< BPWM_T::CMPDAT5: CMPDAT Mask */ - -#define BPWM_CNT_CNT_Pos (0) /*!< BPWM_T::CNT: CNT Position */ -#define BPWM_CNT_CNT_Msk (0xfffful << BPWM_CNT_CNT_Pos) /*!< BPWM_T::CNT: CNT Mask */ - -#define BPWM_CNT_DIRF_Pos (16) /*!< BPWM_T::CNT: DIRF Position */ -#define BPWM_CNT_DIRF_Msk (0x1ul << BPWM_CNT_DIRF_Pos) /*!< BPWM_T::CNT: DIRF Mask */ - -#define BPWM_WGCTL0_ZPCTL0_Pos (0) /*!< BPWM_T::WGCTL0: ZPCTL0 Position */ -#define BPWM_WGCTL0_ZPCTL0_Msk (0x3ul << BPWM_WGCTL0_ZPCTL0_Pos) /*!< BPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define BPWM_WGCTL0_ZPCTL1_Pos (2) /*!< BPWM_T::WGCTL0: ZPCTL1 Position */ -#define BPWM_WGCTL0_ZPCTL1_Msk (0x3ul << BPWM_WGCTL0_ZPCTL1_Pos) /*!< BPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define BPWM_WGCTL0_ZPCTL2_Pos (4) /*!< BPWM_T::WGCTL0: ZPCTL2 Position */ -#define BPWM_WGCTL0_ZPCTL2_Msk (0x3ul << BPWM_WGCTL0_ZPCTL2_Pos) /*!< BPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define BPWM_WGCTL0_ZPCTL3_Pos (6) /*!< BPWM_T::WGCTL0: ZPCTL3 Position */ -#define BPWM_WGCTL0_ZPCTL3_Msk (0x3ul << BPWM_WGCTL0_ZPCTL3_Pos) /*!< BPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define BPWM_WGCTL0_ZPCTL4_Pos (8) /*!< BPWM_T::WGCTL0: ZPCTL4 Position */ -#define BPWM_WGCTL0_ZPCTL4_Msk (0x3ul << BPWM_WGCTL0_ZPCTL4_Pos) /*!< BPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define BPWM_WGCTL0_ZPCTL5_Pos (10) /*!< BPWM_T::WGCTL0: ZPCTL5 Position */ -#define BPWM_WGCTL0_ZPCTL5_Msk (0x3ul << BPWM_WGCTL0_ZPCTL5_Pos) /*!< BPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define BPWM_WGCTL0_ZPCTLn_Pos (0) /*!< BPWM_T::WGCTL0: ZPCTLn Position */ -#define BPWM_WGCTL0_ZPCTLn_Msk (0xffful << BPWM_WGCTL0_ZPCTLn_Pos) /*!< BPWM_T::WGCTL0: ZPCTLn Mask */ - -#define BPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< BPWM_T::WGCTL0: PRDPCTL0 Position */ -#define BPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL0_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define BPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< BPWM_T::WGCTL0: PRDPCTL1 Position */ -#define BPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL1_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define BPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< BPWM_T::WGCTL0: PRDPCTL2 Position */ -#define BPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL2_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define BPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< BPWM_T::WGCTL0: PRDPCTL3 Position */ -#define BPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL3_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define BPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< BPWM_T::WGCTL0: PRDPCTL4 Position */ -#define BPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL4_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define BPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< BPWM_T::WGCTL0: PRDPCTL5 Position */ -#define BPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL5_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define BPWM_WGCTL0_PRDPCTLn_Pos (16) /*!< BPWM_T::WGCTL0: PRDPCTLn Position */ -#define BPWM_WGCTL0_PRDPCTLn_Msk (0xffful << BPWM_WGCTL0_PRDPCTLn_Pos) /*!< BPWM_T::WGCTL0: PRDPCTLn Mask */ - -#define BPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< BPWM_T::WGCTL1: CMPUCTL0 Position */ -#define BPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define BPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< BPWM_T::WGCTL1: CMPUCTL1 Position */ -#define BPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define BPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< BPWM_T::WGCTL1: CMPUCTL2 Position */ -#define BPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define BPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< BPWM_T::WGCTL1: CMPUCTL3 Position */ -#define BPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define BPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< BPWM_T::WGCTL1: CMPUCTL4 Position */ -#define BPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define BPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< BPWM_T::WGCTL1: CMPUCTL5 Position */ -#define BPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define BPWM_WGCTL1_CMPUCTLn_Pos (0) /*!< BPWM_T::WGCTL1: CMPUCTLn Position */ -#define BPWM_WGCTL1_CMPUCTLn_Msk (0xffful << BPWM_WGCTL1_CMPUCTLn_Pos) /*!< BPWM_T::WGCTL1: CMPUCTLn Mask */ - -#define BPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< BPWM_T::WGCTL1: CMPDCTL0 Position */ -#define BPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define BPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< BPWM_T::WGCTL1: CMPDCTL1 Position */ -#define BPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define BPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< BPWM_T::WGCTL1: CMPDCTL2 Position */ -#define BPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define BPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< BPWM_T::WGCTL1: CMPDCTL3 Position */ -#define BPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define BPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< BPWM_T::WGCTL1: CMPDCTL4 Position */ -#define BPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define BPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< BPWM_T::WGCTL1: CMPDCTL5 Position */ -#define BPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define BPWM_WGCTL1_CMPDCTLn_Pos (16) /*!< BPWM_T::WGCTL1: CMPDCTLn Position */ -#define BPWM_WGCTL1_CMPDCTLn_Msk (0xffful << BPWM_WGCTL1_CMPDCTLn_Pos) /*!< BPWM_T::WGCTL1: CMPDCTLn Mask */ - -#define BPWM_MSKEN_MSKEN0_Pos (0) /*!< BPWM_T::MSKEN: MSKEN0 Position */ -#define BPWM_MSKEN_MSKEN0_Msk (0x1ul << BPWM_MSKEN_MSKEN0_Pos) /*!< BPWM_T::MSKEN: MSKEN0 Mask */ - -#define BPWM_MSKEN_MSKEN1_Pos (1) /*!< BPWM_T::MSKEN: MSKEN1 Position */ -#define BPWM_MSKEN_MSKEN1_Msk (0x1ul << BPWM_MSKEN_MSKEN1_Pos) /*!< BPWM_T::MSKEN: MSKEN1 Mask */ - -#define BPWM_MSKEN_MSKEN2_Pos (2) /*!< BPWM_T::MSKEN: MSKEN2 Position */ -#define BPWM_MSKEN_MSKEN2_Msk (0x1ul << BPWM_MSKEN_MSKEN2_Pos) /*!< BPWM_T::MSKEN: MSKEN2 Mask */ - -#define BPWM_MSKEN_MSKEN3_Pos (3) /*!< BPWM_T::MSKEN: MSKEN3 Position */ -#define BPWM_MSKEN_MSKEN3_Msk (0x1ul << BPWM_MSKEN_MSKEN3_Pos) /*!< BPWM_T::MSKEN: MSKEN3 Mask */ - -#define BPWM_MSKEN_MSKEN4_Pos (4) /*!< BPWM_T::MSKEN: MSKEN4 Position */ -#define BPWM_MSKEN_MSKEN4_Msk (0x1ul << BPWM_MSKEN_MSKEN4_Pos) /*!< BPWM_T::MSKEN: MSKEN4 Mask */ - -#define BPWM_MSKEN_MSKEN5_Pos (5) /*!< BPWM_T::MSKEN: MSKEN5 Position */ -#define BPWM_MSKEN_MSKEN5_Msk (0x1ul << BPWM_MSKEN_MSKEN5_Pos) /*!< BPWM_T::MSKEN: MSKEN5 Mask */ - -#define BPWM_MSKEN_MSKENn_Pos (0) /*!< BPWM_T::MSKEN: MSKENn Position */ -#define BPWM_MSKEN_MSKENn_Msk (0x3ful << BPWM_MSKEN_MSKENn_Pos) /*!< BPWM_T::MSKEN: MSKENn Mask */ - -#define BPWM_MSK_MSKDAT0_Pos (0) /*!< BPWM_T::MSK: MSKDAT0 Position */ -#define BPWM_MSK_MSKDAT0_Msk (0x1ul << BPWM_MSK_MSKDAT0_Pos) /*!< BPWM_T::MSK: MSKDAT0 Mask */ - -#define BPWM_MSK_MSKDAT1_Pos (1) /*!< BPWM_T::MSK: MSKDAT1 Position */ -#define BPWM_MSK_MSKDAT1_Msk (0x1ul << BPWM_MSK_MSKDAT1_Pos) /*!< BPWM_T::MSK: MSKDAT1 Mask */ - -#define BPWM_MSK_MSKDAT2_Pos (2) /*!< BPWM_T::MSK: MSKDAT2 Position */ -#define BPWM_MSK_MSKDAT2_Msk (0x1ul << BPWM_MSK_MSKDAT2_Pos) /*!< BPWM_T::MSK: MSKDAT2 Mask */ - -#define BPWM_MSK_MSKDAT3_Pos (3) /*!< BPWM_T::MSK: MSKDAT3 Position */ -#define BPWM_MSK_MSKDAT3_Msk (0x1ul << BPWM_MSK_MSKDAT3_Pos) /*!< BPWM_T::MSK: MSKDAT3 Mask */ - -#define BPWM_MSK_MSKDAT4_Pos (4) /*!< BPWM_T::MSK: MSKDAT4 Position */ -#define BPWM_MSK_MSKDAT4_Msk (0x1ul << BPWM_MSK_MSKDAT4_Pos) /*!< BPWM_T::MSK: MSKDAT4 Mask */ - -#define BPWM_MSK_MSKDAT5_Pos (5) /*!< BPWM_T::MSK: MSKDAT5 Position */ -#define BPWM_MSK_MSKDAT5_Msk (0x1ul << BPWM_MSK_MSKDAT5_Pos) /*!< BPWM_T::MSK: MSKDAT5 Mask */ - -#define BPWM_MSK_MSKDATn_Pos (0) /*!< BPWM_T::MSK: MSKDATn Position */ -#define BPWM_MSK_MSKDATn_Msk (0x3ful << BPWM_MSK_MSKDATn_Pos) /*!< BPWM_T::MSK: MSKDATn Mask */ - -#define BPWM_POLCTL_PINV0_Pos (0) /*!< BPWM_T::POLCTL: PINV0 Position */ -#define BPWM_POLCTL_PINV0_Msk (0x1ul << BPWM_POLCTL_PINV0_Pos) /*!< BPWM_T::POLCTL: PINV0 Mask */ - -#define BPWM_POLCTL_PINV1_Pos (1) /*!< BPWM_T::POLCTL: PINV1 Position */ -#define BPWM_POLCTL_PINV1_Msk (0x1ul << BPWM_POLCTL_PINV1_Pos) /*!< BPWM_T::POLCTL: PINV1 Mask */ - -#define BPWM_POLCTL_PINV2_Pos (2) /*!< BPWM_T::POLCTL: PINV2 Position */ -#define BPWM_POLCTL_PINV2_Msk (0x1ul << BPWM_POLCTL_PINV2_Pos) /*!< BPWM_T::POLCTL: PINV2 Mask */ - -#define BPWM_POLCTL_PINV3_Pos (3) /*!< BPWM_T::POLCTL: PINV3 Position */ -#define BPWM_POLCTL_PINV3_Msk (0x1ul << BPWM_POLCTL_PINV3_Pos) /*!< BPWM_T::POLCTL: PINV3 Mask */ - -#define BPWM_POLCTL_PINV4_Pos (4) /*!< BPWM_T::POLCTL: PINV4 Position */ -#define BPWM_POLCTL_PINV4_Msk (0x1ul << BPWM_POLCTL_PINV4_Pos) /*!< BPWM_T::POLCTL: PINV4 Mask */ - -#define BPWM_POLCTL_PINV5_Pos (5) /*!< BPWM_T::POLCTL: PINV5 Position */ -#define BPWM_POLCTL_PINV5_Msk (0x1ul << BPWM_POLCTL_PINV5_Pos) /*!< BPWM_T::POLCTL: PINV5 Mask */ - -#define BPWM_POLCTL_PINVn_Pos (0) /*!< BPWM_T::POLCTL: PINVn Position */ -#define BPWM_POLCTL_PINVn_Msk (0x3ful << BPWM_POLCTL_PINVn_Pos) /*!< BPWM_T::POLCTL: PINVn Mask */ - -#define BPWM_POEN_POEN0_Pos (0) /*!< BPWM_T::POEN: POEN0 Position */ -#define BPWM_POEN_POEN0_Msk (0x1ul << BPWM_POEN_POEN0_Pos) /*!< BPWM_T::POEN: POEN0 Mask */ - -#define BPWM_POEN_POEN1_Pos (1) /*!< BPWM_T::POEN: POEN1 Position */ -#define BPWM_POEN_POEN1_Msk (0x1ul << BPWM_POEN_POEN1_Pos) /*!< BPWM_T::POEN: POEN1 Mask */ - -#define BPWM_POEN_POEN2_Pos (2) /*!< BPWM_T::POEN: POEN2 Position */ -#define BPWM_POEN_POEN2_Msk (0x1ul << BPWM_POEN_POEN2_Pos) /*!< BPWM_T::POEN: POEN2 Mask */ - -#define BPWM_POEN_POEN3_Pos (3) /*!< BPWM_T::POEN: POEN3 Position */ -#define BPWM_POEN_POEN3_Msk (0x1ul << BPWM_POEN_POEN3_Pos) /*!< BPWM_T::POEN: POEN3 Mask */ - -#define BPWM_POEN_POEN4_Pos (4) /*!< BPWM_T::POEN: POEN4 Position */ -#define BPWM_POEN_POEN4_Msk (0x1ul << BPWM_POEN_POEN4_Pos) /*!< BPWM_T::POEN: POEN4 Mask */ - -#define BPWM_POEN_POEN5_Pos (5) /*!< BPWM_T::POEN: POEN5 Position */ -#define BPWM_POEN_POEN5_Msk (0x1ul << BPWM_POEN_POEN5_Pos) /*!< BPWM_T::POEN: POEN5 Mask */ - -#define BPWM_POEN_POENn_Pos (0) /*!< BPWM_T::POEN: POENn Position */ -#define BPWM_POEN_POENn_Msk (0x3ful << BPWM_POEN_POENn_Pos) /*!< BPWM_T::POEN: POENn Mask */ - -#define BPWM_INTEN_ZIEN0_Pos (0) /*!< BPWM_T::INTEN: ZIEN0 Position */ -#define BPWM_INTEN_ZIEN0_Msk (0x1ul << BPWM_INTEN_ZIEN0_Pos) /*!< BPWM_T::INTEN: ZIEN0 Mask */ - -#define BPWM_INTEN_PIEN0_Pos (8) /*!< BPWM_T::INTEN: PIEN0 Position */ -#define BPWM_INTEN_PIEN0_Msk (0x1ul << BPWM_INTEN_PIEN0_Pos) /*!< BPWM_T::INTEN: PIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN0_Pos (16) /*!< BPWM_T::INTEN: CMPUIEN0 Position */ -#define BPWM_INTEN_CMPUIEN0_Msk (0x1ul << BPWM_INTEN_CMPUIEN0_Pos) /*!< BPWM_T::INTEN: CMPUIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN1_Pos (17) /*!< BPWM_T::INTEN: CMPUIEN1 Position */ -#define BPWM_INTEN_CMPUIEN1_Msk (0x1ul << BPWM_INTEN_CMPUIEN1_Pos) /*!< BPWM_T::INTEN: CMPUIEN1 Mask */ - -#define BPWM_INTEN_CMPUIEN2_Pos (18) /*!< BPWM_T::INTEN: CMPUIEN2 Position */ -#define BPWM_INTEN_CMPUIEN2_Msk (0x1ul << BPWM_INTEN_CMPUIEN2_Pos) /*!< BPWM_T::INTEN: CMPUIEN2 Mask */ - -#define BPWM_INTEN_CMPUIEN3_Pos (19) /*!< BPWM_T::INTEN: CMPUIEN3 Position */ -#define BPWM_INTEN_CMPUIEN3_Msk (0x1ul << BPWM_INTEN_CMPUIEN3_Pos) /*!< BPWM_T::INTEN: CMPUIEN3 Mask */ - -#define BPWM_INTEN_CMPUIEN4_Pos (20) /*!< BPWM_T::INTEN: CMPUIEN4 Position */ -#define BPWM_INTEN_CMPUIEN4_Msk (0x1ul << BPWM_INTEN_CMPUIEN4_Pos) /*!< BPWM_T::INTEN: CMPUIEN4 Mask */ - -#define BPWM_INTEN_CMPUIEN5_Pos (21) /*!< BPWM_T::INTEN: CMPUIEN5 Position */ -#define BPWM_INTEN_CMPUIEN5_Msk (0x1ul << BPWM_INTEN_CMPUIEN5_Pos) /*!< BPWM_T::INTEN: CMPUIEN5 Mask */ - -#define BPWM_INTEN_CMPUIENn_Pos (16) /*!< BPWM_T::INTEN: CMPUIENn Position */ -#define BPWM_INTEN_CMPUIENn_Msk (0x3ful << BPWM_INTEN_CMPUIENn_Pos) /*!< BPWM_T::INTEN: CMPUIENn Mask */ - -#define BPWM_INTEN_CMPDIEN0_Pos (24) /*!< BPWM_T::INTEN: CMPDIEN0 Position */ -#define BPWM_INTEN_CMPDIEN0_Msk (0x1ul << BPWM_INTEN_CMPDIEN0_Pos) /*!< BPWM_T::INTEN: CMPDIEN0 Mask */ - -#define BPWM_INTEN_CMPDIEN1_Pos (25) /*!< BPWM_T::INTEN: CMPDIEN1 Position */ -#define BPWM_INTEN_CMPDIEN1_Msk (0x1ul << BPWM_INTEN_CMPDIEN1_Pos) /*!< BPWM_T::INTEN: CMPDIEN1 Mask */ - -#define BPWM_INTEN_CMPDIEN2_Pos (26) /*!< BPWM_T::INTEN: CMPDIEN2 Position */ -#define BPWM_INTEN_CMPDIEN2_Msk (0x1ul << BPWM_INTEN_CMPDIEN2_Pos) /*!< BPWM_T::INTEN: CMPDIEN2 Mask */ - -#define BPWM_INTEN_CMPDIEN3_Pos (27) /*!< BPWM_T::INTEN: CMPDIEN3 Position */ -#define BPWM_INTEN_CMPDIEN3_Msk (0x1ul << BPWM_INTEN_CMPDIEN3_Pos) /*!< BPWM_T::INTEN: CMPDIEN3 Mask */ - -#define BPWM_INTEN_CMPDIEN4_Pos (28) /*!< BPWM_T::INTEN: CMPDIEN4 Position */ -#define BPWM_INTEN_CMPDIEN4_Msk (0x1ul << BPWM_INTEN_CMPDIEN4_Pos) /*!< BPWM_T::INTEN: CMPDIEN4 Mask */ - -#define BPWM_INTEN_CMPDIEN5_Pos (29) /*!< BPWM_T::INTEN: CMPDIEN5 Position */ -#define BPWM_INTEN_CMPDIEN5_Msk (0x1ul << BPWM_INTEN_CMPDIEN5_Pos) /*!< BPWM_T::INTEN: CMPDIEN5 Mask */ - -#define BPWM_INTEN_CMPDIENn_Pos (24) /*!< BPWM_T::INTEN: CMPDIENn Position */ -#define BPWM_INTEN_CMPDIENn_Msk (0x3ful << BPWM_INTEN_CMPDIENn_Pos) /*!< BPWM_T::INTEN: CMPDIENn Mask */ - -#define BPWM_INTSTS_ZIF0_Pos (0) /*!< BPWM_T::INTSTS: ZIF0 Position */ -#define BPWM_INTSTS_ZIF0_Msk (0x1ul << BPWM_INTSTS_ZIF0_Pos) /*!< BPWM_T::INTSTS: ZIF0 Mask */ - -#define BPWM_INTSTS_PIF0_Pos (8) /*!< BPWM_T::INTSTS: PIF0 Position */ -#define BPWM_INTSTS_PIF0_Msk (0x1ul << BPWM_INTSTS_PIF0_Pos) /*!< BPWM_T::INTSTS: PIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF0_Pos (16) /*!< BPWM_T::INTSTS: CMPUIF0 Position */ -#define BPWM_INTSTS_CMPUIF0_Msk (0x1ul << BPWM_INTSTS_CMPUIF0_Pos) /*!< BPWM_T::INTSTS: CMPUIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF1_Pos (17) /*!< BPWM_T::INTSTS: CMPUIF1 Position */ -#define BPWM_INTSTS_CMPUIF1_Msk (0x1ul << BPWM_INTSTS_CMPUIF1_Pos) /*!< BPWM_T::INTSTS: CMPUIF1 Mask */ - -#define BPWM_INTSTS_CMPUIF2_Pos (18) /*!< BPWM_T::INTSTS: CMPUIF2 Position */ -#define BPWM_INTSTS_CMPUIF2_Msk (0x1ul << BPWM_INTSTS_CMPUIF2_Pos) /*!< BPWM_T::INTSTS: CMPUIF2 Mask */ - -#define BPWM_INTSTS_CMPUIF3_Pos (19) /*!< BPWM_T::INTSTS: CMPUIF3 Position */ -#define BPWM_INTSTS_CMPUIF3_Msk (0x1ul << BPWM_INTSTS_CMPUIF3_Pos) /*!< BPWM_T::INTSTS: CMPUIF3 Mask */ - -#define BPWM_INTSTS_CMPUIF4_Pos (20) /*!< BPWM_T::INTSTS: CMPUIF4 Position */ -#define BPWM_INTSTS_CMPUIF4_Msk (0x1ul << BPWM_INTSTS_CMPUIF4_Pos) /*!< BPWM_T::INTSTS: CMPUIF4 Mask */ - -#define BPWM_INTSTS_CMPUIF5_Pos (21) /*!< BPWM_T::INTSTS: CMPUIF5 Position */ -#define BPWM_INTSTS_CMPUIF5_Msk (0x1ul << BPWM_INTSTS_CMPUIF5_Pos) /*!< BPWM_T::INTSTS: CMPUIF5 Mask */ - -#define BPWM_INTSTS_CMPUIFn_Pos (16) /*!< BPWM_T::INTSTS: CMPUIFn Position */ -#define BPWM_INTSTS_CMPUIFn_Msk (0x3ful << BPWM_INTSTS_CMPUIFn_Pos) /*!< BPWM_T::INTSTS: CMPUIFn Mask */ - -#define BPWM_INTSTS_CMPDIF0_Pos (24) /*!< BPWM_T::INTSTS: CMPDIF0 Position */ -#define BPWM_INTSTS_CMPDIF0_Msk (0x1ul << BPWM_INTSTS_CMPDIF0_Pos) /*!< BPWM_T::INTSTS: CMPDIF0 Mask */ - -#define BPWM_INTSTS_CMPDIF1_Pos (25) /*!< BPWM_T::INTSTS: CMPDIF1 Position */ -#define BPWM_INTSTS_CMPDIF1_Msk (0x1ul << BPWM_INTSTS_CMPDIF1_Pos) /*!< BPWM_T::INTSTS: CMPDIF1 Mask */ - -#define BPWM_INTSTS_CMPDIF2_Pos (26) /*!< BPWM_T::INTSTS: CMPDIF2 Position */ -#define BPWM_INTSTS_CMPDIF2_Msk (0x1ul << BPWM_INTSTS_CMPDIF2_Pos) /*!< BPWM_T::INTSTS: CMPDIF2 Mask */ - -#define BPWM_INTSTS_CMPDIF3_Pos (27) /*!< BPWM_T::INTSTS: CMPDIF3 Position */ -#define BPWM_INTSTS_CMPDIF3_Msk (0x1ul << BPWM_INTSTS_CMPDIF3_Pos) /*!< BPWM_T::INTSTS: CMPDIF3 Mask */ - -#define BPWM_INTSTS_CMPDIF4_Pos (28) /*!< BPWM_T::INTSTS: CMPDIF4 Position */ -#define BPWM_INTSTS_CMPDIF4_Msk (0x1ul << BPWM_INTSTS_CMPDIF4_Pos) /*!< BPWM_T::INTSTS: CMPDIF4 Mask */ - -#define BPWM_INTSTS_CMPDIF5_Pos (29) /*!< BPWM_T::INTSTS: CMPDIF5 Position */ -#define BPWM_INTSTS_CMPDIF5_Msk (0x1ul << BPWM_INTSTS_CMPDIF5_Pos) /*!< BPWM_T::INTSTS: CMPDIF5 Mask */ - -#define BPWM_INTSTS_CMPDIFn_Pos (24) /*!< BPWM_T::INTSTS: CMPDIFn Position */ -#define BPWM_INTSTS_CMPDIFn_Msk (0x3ful << BPWM_INTSTS_CMPDIFn_Pos) /*!< BPWM_T::INTSTS: CMPDIFn Mask */ - -#define BPWM_EADCTS0_TRGSEL0_Pos (0) /*!< BPWM_T::EADCTS0: TRGSEL0 Position */ -#define BPWM_EADCTS0_TRGSEL0_Msk (0xful << BPWM_EADCTS0_TRGSEL0_Pos) /*!< BPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define BPWM_EADCTS0_TRGEN0_Pos (7) /*!< BPWM_T::EADCTS0: TRGEN0 Position */ -#define BPWM_EADCTS0_TRGEN0_Msk (0x1ul << BPWM_EADCTS0_TRGEN0_Pos) /*!< BPWM_T::EADCTS0: TRGEN0 Mask */ - -#define BPWM_EADCTS0_TRGSEL1_Pos (8) /*!< BPWM_T::EADCTS0: TRGSEL1 Position */ -#define BPWM_EADCTS0_TRGSEL1_Msk (0xful << BPWM_EADCTS0_TRGSEL1_Pos) /*!< BPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define BPWM_EADCTS0_TRGEN1_Pos (15) /*!< BPWM_T::EADCTS0: TRGEN1 Position */ -#define BPWM_EADCTS0_TRGEN1_Msk (0x1ul << BPWM_EADCTS0_TRGEN1_Pos) /*!< BPWM_T::EADCTS0: TRGEN1 Mask */ - -#define BPWM_EADCTS0_TRGSEL2_Pos (16) /*!< BPWM_T::EADCTS0: TRGSEL2 Position */ -#define BPWM_EADCTS0_TRGSEL2_Msk (0xful << BPWM_EADCTS0_TRGSEL2_Pos) /*!< BPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define BPWM_EADCTS0_TRGEN2_Pos (23) /*!< BPWM_T::EADCTS0: TRGEN2 Position */ -#define BPWM_EADCTS0_TRGEN2_Msk (0x1ul << BPWM_EADCTS0_TRGEN2_Pos) /*!< BPWM_T::EADCTS0: TRGEN2 Mask */ - -#define BPWM_EADCTS0_TRGSEL3_Pos (24) /*!< BPWM_T::EADCTS0: TRGSEL3 Position */ -#define BPWM_EADCTS0_TRGSEL3_Msk (0xful << BPWM_EADCTS0_TRGSEL3_Pos) /*!< BPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define BPWM_EADCTS0_TRGEN3_Pos (31) /*!< BPWM_T::EADCTS0: TRGEN3 Position */ -#define BPWM_EADCTS0_TRGEN3_Msk (0x1ul << BPWM_EADCTS0_TRGEN3_Pos) /*!< BPWM_T::EADCTS0: TRGEN3 Mask */ - -#define BPWM_EADCTS1_TRGSEL4_Pos (0) /*!< BPWM_T::EADCTS1: TRGSEL4 Position */ -#define BPWM_EADCTS1_TRGSEL4_Msk (0xful << BPWM_EADCTS1_TRGSEL4_Pos) /*!< BPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define BPWM_EADCTS1_TRGEN4_Pos (7) /*!< BPWM_T::EADCTS1: TRGEN4 Position */ -#define BPWM_EADCTS1_TRGEN4_Msk (0x1ul << BPWM_EADCTS1_TRGEN4_Pos) /*!< BPWM_T::EADCTS1: TRGEN4 Mask */ - -#define BPWM_EADCTS1_TRGSEL5_Pos (8) /*!< BPWM_T::EADCTS1: TRGSEL5 Position */ -#define BPWM_EADCTS1_TRGSEL5_Msk (0xful << BPWM_EADCTS1_TRGSEL5_Pos) /*!< BPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define BPWM_EADCTS1_TRGEN5_Pos (15) /*!< BPWM_T::EADCTS1: TRGEN5 Position */ -#define BPWM_EADCTS1_TRGEN5_Msk (0x1ul << BPWM_EADCTS1_TRGEN5_Pos) /*!< BPWM_T::EADCTS1: TRGEN5 Mask */ - -#define BPWM_SSCTL_SSEN0_Pos (0) /*!< BPWM_T::SSCTL: SSEN0 Position */ -#define BPWM_SSCTL_SSEN0_Msk (0x1ul << BPWM_SSCTL_SSEN0_Pos) /*!< BPWM_T::SSCTL: SSEN0 Mask */ - -#define BPWM_SSCTL_SSRC_Pos (8) /*!< BPWM_T::SSCTL: SSRC Position */ -#define BPWM_SSCTL_SSRC_Msk (0x3ul << BPWM_SSCTL_SSRC_Pos) /*!< BPWM_T::SSCTL: SSRC Mask */ - -#define BPWM_SSTRG_CNTSEN_Pos (0) /*!< BPWM_T::SSTRG: CNTSEN Position */ -#define BPWM_SSTRG_CNTSEN_Msk (0x1ul << BPWM_SSTRG_CNTSEN_Pos) /*!< BPWM_T::SSTRG: CNTSEN Mask */ - -#define BPWM_STATUS_CNTMAX0_Pos (0) /*!< BPWM_T::STATUS: CNTMAX0 Position */ -#define BPWM_STATUS_CNTMAX0_Msk (0x1ul << BPWM_STATUS_CNTMAX0_Pos) /*!< BPWM_T::STATUS: CNTMAX0 Mask */ - -#define BPWM_STATUS_EADCTRG0_Pos (16) /*!< BPWM_T::STATUS: EADCTRG0 Position */ -#define BPWM_STATUS_EADCTRG0_Msk (0x1ul << BPWM_STATUS_EADCTRG0_Pos) /*!< BPWM_T::STATUS: EADCTRG0 Mask */ - -#define BPWM_STATUS_EADCTRG1_Pos (17) /*!< BPWM_T::STATUS: EADCTRG1 Position */ -#define BPWM_STATUS_EADCTRG1_Msk (0x1ul << BPWM_STATUS_EADCTRG1_Pos) /*!< BPWM_T::STATUS: EADCTRG1 Mask */ - -#define BPWM_STATUS_EADCTRG2_Pos (18) /*!< BPWM_T::STATUS: EADCTRG2 Position */ -#define BPWM_STATUS_EADCTRG2_Msk (0x1ul << BPWM_STATUS_EADCTRG2_Pos) /*!< BPWM_T::STATUS: EADCTRG2 Mask */ - -#define BPWM_STATUS_EADCTRG3_Pos (19) /*!< BPWM_T::STATUS: EADCTRG3 Position */ -#define BPWM_STATUS_EADCTRG3_Msk (0x1ul << BPWM_STATUS_EADCTRG3_Pos) /*!< BPWM_T::STATUS: EADCTRG3 Mask */ - -#define BPWM_STATUS_EADCTRG4_Pos (20) /*!< BPWM_T::STATUS: EADCTRG4 Position */ -#define BPWM_STATUS_EADCTRG4_Msk (0x1ul << BPWM_STATUS_EADCTRG4_Pos) /*!< BPWM_T::STATUS: EADCTRG4 Mask */ - -#define BPWM_STATUS_EADCTRG5_Pos (21) /*!< BPWM_T::STATUS: EADCTRG5 Position */ -#define BPWM_STATUS_EADCTRG5_Msk (0x1ul << BPWM_STATUS_EADCTRG5_Pos) /*!< BPWM_T::STATUS: EADCTRG5 Mask */ - -#define BPWM_STATUS_EADCTRGn_Pos (16) /*!< BPWM_T::STATUS: EADCTRGn Position */ -#define BPWM_STATUS_EADCTRGn_Msk (0x3ful << BPWM_STATUS_EADCTRGn_Pos) /*!< BPWM_T::STATUS: EADCTRGn Mask */ - -#define BPWM_CAPINEN_CAPINEN0_Pos (0) /*!< BPWM_T::CAPINEN: CAPINEN0 Position */ -#define BPWM_CAPINEN_CAPINEN0_Msk (0x1ul << BPWM_CAPINEN_CAPINEN0_Pos) /*!< BPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define BPWM_CAPINEN_CAPINEN1_Pos (1) /*!< BPWM_T::CAPINEN: CAPINEN1 Position */ -#define BPWM_CAPINEN_CAPINEN1_Msk (0x1ul << BPWM_CAPINEN_CAPINEN1_Pos) /*!< BPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define BPWM_CAPINEN_CAPINEN2_Pos (2) /*!< BPWM_T::CAPINEN: CAPINEN2 Position */ -#define BPWM_CAPINEN_CAPINEN2_Msk (0x1ul << BPWM_CAPINEN_CAPINEN2_Pos) /*!< BPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define BPWM_CAPINEN_CAPINEN3_Pos (3) /*!< BPWM_T::CAPINEN: CAPINEN3 Position */ -#define BPWM_CAPINEN_CAPINEN3_Msk (0x1ul << BPWM_CAPINEN_CAPINEN3_Pos) /*!< BPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define BPWM_CAPINEN_CAPINEN4_Pos (4) /*!< BPWM_T::CAPINEN: CAPINEN4 Position */ -#define BPWM_CAPINEN_CAPINEN4_Msk (0x1ul << BPWM_CAPINEN_CAPINEN4_Pos) /*!< BPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define BPWM_CAPINEN_CAPINEN5_Pos (5) /*!< BPWM_T::CAPINEN: CAPINEN5 Position */ -#define BPWM_CAPINEN_CAPINEN5_Msk (0x1ul << BPWM_CAPINEN_CAPINEN5_Pos) /*!< BPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define BPWM_CAPINEN_CAPINENn_Pos (0) /*!< BPWM_T::CAPINEN: CAPINENn Position */ -#define BPWM_CAPINEN_CAPINENn_Msk (0x3ful << BPWM_CAPINEN_CAPINENn_Pos) /*!< BPWM_T::CAPINEN: CAPINENn Mask */ - -#define BPWM_CAPCTL_CAPEN0_Pos (0) /*!< BPWM_T::CAPCTL: CAPEN0 Position */ -#define BPWM_CAPCTL_CAPEN0_Msk (0x1ul << BPWM_CAPCTL_CAPEN0_Pos) /*!< BPWM_T::CAPCTL: CAPEN0 Mask */ - -#define BPWM_CAPCTL_CAPEN1_Pos (1) /*!< BPWM_T::CAPCTL: CAPEN1 Position */ -#define BPWM_CAPCTL_CAPEN1_Msk (0x1ul << BPWM_CAPCTL_CAPEN1_Pos) /*!< BPWM_T::CAPCTL: CAPEN1 Mask */ - -#define BPWM_CAPCTL_CAPEN2_Pos (2) /*!< BPWM_T::CAPCTL: CAPEN2 Position */ -#define BPWM_CAPCTL_CAPEN2_Msk (0x1ul << BPWM_CAPCTL_CAPEN2_Pos) /*!< BPWM_T::CAPCTL: CAPEN2 Mask */ - -#define BPWM_CAPCTL_CAPEN3_Pos (3) /*!< BPWM_T::CAPCTL: CAPEN3 Position */ -#define BPWM_CAPCTL_CAPEN3_Msk (0x1ul << BPWM_CAPCTL_CAPEN3_Pos) /*!< BPWM_T::CAPCTL: CAPEN3 Mask */ - -#define BPWM_CAPCTL_CAPEN4_Pos (4) /*!< BPWM_T::CAPCTL: CAPEN4 Position */ -#define BPWM_CAPCTL_CAPEN4_Msk (0x1ul << BPWM_CAPCTL_CAPEN4_Pos) /*!< BPWM_T::CAPCTL: CAPEN4 Mask */ - -#define BPWM_CAPCTL_CAPEN5_Pos (5) /*!< BPWM_T::CAPCTL: CAPEN5 Position */ -#define BPWM_CAPCTL_CAPEN5_Msk (0x1ul << BPWM_CAPCTL_CAPEN5_Pos) /*!< BPWM_T::CAPCTL: CAPEN5 Mask */ - -#define BPWM_CAPCTL_CAPENn_Pos (0) /*!< BPWM_T::CAPCTL: CAPENn Position */ -#define BPWM_CAPCTL_CAPENn_Msk (0x3ful << BPWM_CAPCTL_CAPENn_Pos) /*!< BPWM_T::CAPCTL: CAPENn Mask */ - -#define BPWM_CAPCTL_CAPINV0_Pos (8) /*!< BPWM_T::CAPCTL: CAPINV0 Position */ -#define BPWM_CAPCTL_CAPINV0_Msk (0x1ul << BPWM_CAPCTL_CAPINV0_Pos) /*!< BPWM_T::CAPCTL: CAPINV0 Mask */ - -#define BPWM_CAPCTL_CAPINV1_Pos (9) /*!< BPWM_T::CAPCTL: CAPINV1 Position */ -#define BPWM_CAPCTL_CAPINV1_Msk (0x1ul << BPWM_CAPCTL_CAPINV1_Pos) /*!< BPWM_T::CAPCTL: CAPINV1 Mask */ - -#define BPWM_CAPCTL_CAPINV2_Pos (10) /*!< BPWM_T::CAPCTL: CAPINV2 Position */ -#define BPWM_CAPCTL_CAPINV2_Msk (0x1ul << BPWM_CAPCTL_CAPINV2_Pos) /*!< BPWM_T::CAPCTL: CAPINV2 Mask */ - -#define BPWM_CAPCTL_CAPINV3_Pos (11) /*!< BPWM_T::CAPCTL: CAPINV3 Position */ -#define BPWM_CAPCTL_CAPINV3_Msk (0x1ul << BPWM_CAPCTL_CAPINV3_Pos) /*!< BPWM_T::CAPCTL: CAPINV3 Mask */ - -#define BPWM_CAPCTL_CAPINV4_Pos (12) /*!< BPWM_T::CAPCTL: CAPINV4 Position */ -#define BPWM_CAPCTL_CAPINV4_Msk (0x1ul << BPWM_CAPCTL_CAPINV4_Pos) /*!< BPWM_T::CAPCTL: CAPINV4 Mask */ - -#define BPWM_CAPCTL_CAPINV5_Pos (13) /*!< BPWM_T::CAPCTL: CAPINV5 Position */ -#define BPWM_CAPCTL_CAPINV5_Msk (0x1ul << BPWM_CAPCTL_CAPINV5_Pos) /*!< BPWM_T::CAPCTL: CAPINV5 Mask */ - -#define BPWM_CAPCTL_CAPINVn_Pos (8) /*!< BPWM_T::CAPCTL: CAPINVn Position */ -#define BPWM_CAPCTL_CAPINVn_Msk (0x3ful << BPWM_CAPCTL_CAPINVn_Pos) /*!< BPWM_T::CAPCTL: CAPINVn Mask */ - -#define BPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< BPWM_T::CAPCTL: RCRLDEN0 Position */ -#define BPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define BPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< BPWM_T::CAPCTL: RCRLDEN1 Position */ -#define BPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define BPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< BPWM_T::CAPCTL: RCRLDEN2 Position */ -#define BPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define BPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< BPWM_T::CAPCTL: RCRLDEN3 Position */ -#define BPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define BPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< BPWM_T::CAPCTL: RCRLDEN4 Position */ -#define BPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define BPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< BPWM_T::CAPCTL: RCRLDEN5 Position */ -#define BPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define BPWM_CAPCTL_RCRLDENn_Pos (16) /*!< BPWM_T::CAPCTL: RCRLDENn Position */ -#define BPWM_CAPCTL_RCRLDENn_Msk (0x3ful << BPWM_CAPCTL_RCRLDENn_Pos) /*!< BPWM_T::CAPCTL: RCRLDENn Mask */ - -#define BPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< BPWM_T::CAPCTL: FCRLDEN0 Position */ -#define BPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define BPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< BPWM_T::CAPCTL: FCRLDEN1 Position */ -#define BPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define BPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< BPWM_T::CAPCTL: FCRLDEN2 Position */ -#define BPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define BPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< BPWM_T::CAPCTL: FCRLDEN3 Position */ -#define BPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define BPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< BPWM_T::CAPCTL: FCRLDEN4 Position */ -#define BPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define BPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< BPWM_T::CAPCTL: FCRLDEN5 Position */ -#define BPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define BPWM_CAPCTL_FCRLDENn_Pos (24) /*!< BPWM_T::CAPCTL: FCRLDENn Position */ -#define BPWM_CAPCTL_FCRLDENn_Msk (0x3ful << BPWM_CAPCTL_FCRLDENn_Pos) /*!< BPWM_T::CAPCTL: FCRLDENn Mask */ - -#define BPWM_CAPSTS_CRIFOV0_Pos (0) /*!< BPWM_T::CAPSTS: CRIFOV0 Position */ -#define BPWM_CAPSTS_CRIFOV0_Msk (0x1ul << BPWM_CAPSTS_CRIFOV0_Pos) /*!< BPWM_T::CAPSTS: CRIFOV0 Mask */ - -#define BPWM_CAPSTS_CRIFOV1_Pos (1) /*!< BPWM_T::CAPSTS: CRIFOV1 Position */ -#define BPWM_CAPSTS_CRIFOV1_Msk (0x1ul << BPWM_CAPSTS_CRIFOV1_Pos) /*!< BPWM_T::CAPSTS: CRIFOV1 Mask */ - -#define BPWM_CAPSTS_CRIFOV2_Pos (2) /*!< BPWM_T::CAPSTS: CRIFOV2 Position */ -#define BPWM_CAPSTS_CRIFOV2_Msk (0x1ul << BPWM_CAPSTS_CRIFOV2_Pos) /*!< BPWM_T::CAPSTS: CRIFOV2 Mask */ - -#define BPWM_CAPSTS_CRIFOV3_Pos (3) /*!< BPWM_T::CAPSTS: CRIFOV3 Position */ -#define BPWM_CAPSTS_CRIFOV3_Msk (0x1ul << BPWM_CAPSTS_CRIFOV3_Pos) /*!< BPWM_T::CAPSTS: CRIFOV3 Mask */ - -#define BPWM_CAPSTS_CRIFOV4_Pos (4) /*!< BPWM_T::CAPSTS: CRIFOV4 Position */ -#define BPWM_CAPSTS_CRIFOV4_Msk (0x1ul << BPWM_CAPSTS_CRIFOV4_Pos) /*!< BPWM_T::CAPSTS: CRIFOV4 Mask */ - -#define BPWM_CAPSTS_CRIFOV5_Pos (5) /*!< BPWM_T::CAPSTS: CRIFOV5 Position */ -#define BPWM_CAPSTS_CRIFOV5_Msk (0x1ul << BPWM_CAPSTS_CRIFOV5_Pos) /*!< BPWM_T::CAPSTS: CRIFOV5 Mask */ - -#define BPWM_CAPSTS_CRIFOVn_Pos (0) /*!< BPWM_T::CAPSTS: CRIFOVn Position */ -#define BPWM_CAPSTS_CRIFOVn_Msk (0x3ful << BPWM_CAPSTS_CRIFOVn_Pos) /*!< BPWM_T::CAPSTS: CRIFOVn Mask */ - -#define BPWM_CAPSTS_CFIFOV0_Pos (8) /*!< BPWM_T::CAPSTS: CFIFOV0 Position */ -#define BPWM_CAPSTS_CFIFOV0_Msk (0x1ul << BPWM_CAPSTS_CFIFOV0_Pos) /*!< BPWM_T::CAPSTS: CFIFOV0 Mask */ - -#define BPWM_CAPSTS_CFIFOV1_Pos (9) /*!< BPWM_T::CAPSTS: CFIFOV1 Position */ -#define BPWM_CAPSTS_CFIFOV1_Msk (0x1ul << BPWM_CAPSTS_CFIFOV1_Pos) /*!< BPWM_T::CAPSTS: CFIFOV1 Mask */ - -#define BPWM_CAPSTS_CFIFOV2_Pos (10) /*!< BPWM_T::CAPSTS: CFIFOV2 Position */ -#define BPWM_CAPSTS_CFIFOV2_Msk (0x1ul << BPWM_CAPSTS_CFIFOV2_Pos) /*!< BPWM_T::CAPSTS: CFIFOV2 Mask */ - -#define BPWM_CAPSTS_CFIFOV3_Pos (11) /*!< BPWM_T::CAPSTS: CFIFOV3 Position */ -#define BPWM_CAPSTS_CFIFOV3_Msk (0x1ul << BPWM_CAPSTS_CFIFOV3_Pos) /*!< BPWM_T::CAPSTS: CFIFOV3 Mask */ - -#define BPWM_CAPSTS_CFIFOV4_Pos (12) /*!< BPWM_T::CAPSTS: CFIFOV4 Position */ -#define BPWM_CAPSTS_CFIFOV4_Msk (0x1ul << BPWM_CAPSTS_CFIFOV4_Pos) /*!< BPWM_T::CAPSTS: CFIFOV4 Mask */ - -#define BPWM_CAPSTS_CFIFOV5_Pos (13) /*!< BPWM_T::CAPSTS: CFIFOV5 Position */ -#define BPWM_CAPSTS_CFIFOV5_Msk (0x1ul << BPWM_CAPSTS_CFIFOV5_Pos) /*!< BPWM_T::CAPSTS: CFIFOV5 Mask */ - -#define BPWM_CAPSTS_CFIFOVn_Pos (8) /*!< BPWM_T::CAPSTS: CFIFOVn Position */ -#define BPWM_CAPSTS_CFIFOVn_Msk (0x3ful << BPWM_CAPSTS_CFIFOVn_Pos) /*!< BPWM_T::CAPSTS: CFIFOVn Mask */ - -#define BPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT0: RCAPDAT Position */ -#define BPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT0_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define BPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT0: FCAPDAT Position */ -#define BPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT0_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define BPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT1: RCAPDAT Position */ -#define BPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT1_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define BPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT1: FCAPDAT Position */ -#define BPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT1_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define BPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT2: RCAPDAT Position */ -#define BPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT2_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define BPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT2: FCAPDAT Position */ -#define BPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT2_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define BPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT3: RCAPDAT Position */ -#define BPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT3_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define BPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT3: FCAPDAT Position */ -#define BPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT3_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define BPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT4: RCAPDAT Position */ -#define BPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT4_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define BPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT4: FCAPDAT Position */ -#define BPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT4_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define BPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT5: RCAPDAT Position */ -#define BPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT5_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define BPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT5: FCAPDAT Position */ -#define BPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT5_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define BPWM_CAPIEN_CAPRIENn_Pos (0) /*!< BPWM_T::CAPIEN: CAPRIENn Position */ -#define BPWM_CAPIEN_CAPRIENn_Msk (0x3ful << BPWM_CAPIEN_CAPRIENn_Pos) /*!< BPWM_T::CAPIEN: CAPRIENn Mask */ - -#define BPWM_CAPIEN_CAPFIENn_Pos (8) /*!< BPWM_T::CAPIEN: CAPFIENn Position */ -#define BPWM_CAPIEN_CAPFIENn_Msk (0x3ful << BPWM_CAPIEN_CAPFIENn_Pos) /*!< BPWM_T::CAPIEN: CAPFIENn Mask */ - -#define BPWM_CAPIF_CAPRIF0_Pos (0) /*!< BPWM_T::CAPIF: CAPRIF0 Position */ -#define BPWM_CAPIF_CAPRIF0_Msk (0x1ul << BPWM_CAPIF_CAPRIF0_Pos) /*!< BPWM_T::CAPIF: CAPRIF0 Mask */ - -#define BPWM_CAPIF_CAPRIF1_Pos (1) /*!< BPWM_T::CAPIF: CAPRIF1 Position */ -#define BPWM_CAPIF_CAPRIF1_Msk (0x1ul << BPWM_CAPIF_CAPRIF1_Pos) /*!< BPWM_T::CAPIF: CAPRIF1 Mask */ - -#define BPWM_CAPIF_CAPRIF2_Pos (2) /*!< BPWM_T::CAPIF: CAPRIF2 Position */ -#define BPWM_CAPIF_CAPRIF2_Msk (0x1ul << BPWM_CAPIF_CAPRIF2_Pos) /*!< BPWM_T::CAPIF: CAPRIF2 Mask */ - -#define BPWM_CAPIF_CAPRIF3_Pos (3) /*!< BPWM_T::CAPIF: CAPRIF3 Position */ -#define BPWM_CAPIF_CAPRIF3_Msk (0x1ul << BPWM_CAPIF_CAPRIF3_Pos) /*!< BPWM_T::CAPIF: CAPRIF3 Mask */ - -#define BPWM_CAPIF_CAPRIF4_Pos (4) /*!< BPWM_T::CAPIF: CAPRIF4 Position */ -#define BPWM_CAPIF_CAPRIF4_Msk (0x1ul << BPWM_CAPIF_CAPRIF4_Pos) /*!< BPWM_T::CAPIF: CAPRIF4 Mask */ - -#define BPWM_CAPIF_CAPRIF5_Pos (5) /*!< BPWM_T::CAPIF: CAPRIF5 Position */ -#define BPWM_CAPIF_CAPRIF5_Msk (0x1ul << BPWM_CAPIF_CAPRIF5_Pos) /*!< BPWM_T::CAPIF: CAPRIF5 Mask */ - -#define BPWM_CAPIF_CAPRIFn_Pos (0) /*!< BPWM_T::CAPIF: CAPRIFn Position */ -#define BPWM_CAPIF_CAPRIFn_Msk (0x3ful << BPWM_CAPIF_CAPRIFn_Pos) /*!< BPWM_T::CAPIF: CAPRIFn Mask */ - -#define BPWM_CAPIF_CAPFIF0_Pos (8) /*!< BPWM_T::CAPIF: CAPFIF0 Position */ -#define BPWM_CAPIF_CAPFIF0_Msk (0x1ul << BPWM_CAPIF_CAPFIF0_Pos) /*!< BPWM_T::CAPIF: CAPFIF0 Mask */ - -#define BPWM_CAPIF_CAPFIF1_Pos (9) /*!< BPWM_T::CAPIF: CAPFIF1 Position */ -#define BPWM_CAPIF_CAPFIF1_Msk (0x1ul << BPWM_CAPIF_CAPFIF1_Pos) /*!< BPWM_T::CAPIF: CAPFIF1 Mask */ - -#define BPWM_CAPIF_CAPFIF2_Pos (10) /*!< BPWM_T::CAPIF: CAPFIF2 Position */ -#define BPWM_CAPIF_CAPFIF2_Msk (0x1ul << BPWM_CAPIF_CAPFIF2_Pos) /*!< BPWM_T::CAPIF: CAPFIF2 Mask */ - -#define BPWM_CAPIF_CAPFIF3_Pos (11) /*!< BPWM_T::CAPIF: CAPFIF3 Position */ -#define BPWM_CAPIF_CAPFIF3_Msk (0x1ul << BPWM_CAPIF_CAPFIF3_Pos) /*!< BPWM_T::CAPIF: CAPFIF3 Mask */ - -#define BPWM_CAPIF_CAPFIF4_Pos (12) /*!< BPWM_T::CAPIF: CAPFIF4 Position */ -#define BPWM_CAPIF_CAPFIF4_Msk (0x1ul << BPWM_CAPIF_CAPFIF4_Pos) /*!< BPWM_T::CAPIF: CAPFIF4 Mask */ - -#define BPWM_CAPIF_CAPFIF5_Pos (13) /*!< BPWM_T::CAPIF: CAPFIF5 Position */ -#define BPWM_CAPIF_CAPFIF5_Msk (0x1ul << BPWM_CAPIF_CAPFIF5_Pos) /*!< BPWM_T::CAPIF: CAPFIF5 Mask */ - -#define BPWM_CAPIF_CAPFIFn_Pos (8) /*!< BPWM_T::CAPIF: CAPFIFn Position */ -#define BPWM_CAPIF_CAPFIFn_Msk (0x3ful << BPWM_CAPIF_CAPFIFn_Pos) /*!< BPWM_T::CAPIF: CAPFIFn Mask */ - -#define BPWM_PBUF_PBUF_Pos (0) /*!< BPWM_T::PBUF: PBUF Position */ -#define BPWM_PBUF_PBUF_Msk (0xfffful << BPWM_PBUF_PBUF_Pos) /*!< BPWM_T::PBUF: PBUF Mask */ - -#define BPWM_CMPBUF0_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF0: CMPBUF Position */ -#define BPWM_CMPBUF0_CMPBUF_Msk (0xfffful << BPWM_CMPBUF0_CMPBUF_Pos) /*!< BPWM_T::CMPBUF0: CMPBUF Mask */ - -#define BPWM_CMPBUF1_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF1: CMPBUF Position */ -#define BPWM_CMPBUF1_CMPBUF_Msk (0xfffful << BPWM_CMPBUF1_CMPBUF_Pos) /*!< BPWM_T::CMPBUF1: CMPBUF Mask */ - -#define BPWM_CMPBUF2_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF2: CMPBUF Position */ -#define BPWM_CMPBUF2_CMPBUF_Msk (0xfffful << BPWM_CMPBUF2_CMPBUF_Pos) /*!< BPWM_T::CMPBUF2: CMPBUF Mask */ - -#define BPWM_CMPBUF3_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF3: CMPBUF Position */ -#define BPWM_CMPBUF3_CMPBUF_Msk (0xfffful << BPWM_CMPBUF3_CMPBUF_Pos) /*!< BPWM_T::CMPBUF3: CMPBUF Mask */ - -#define BPWM_CMPBUF4_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF4: CMPBUF Position */ -#define BPWM_CMPBUF4_CMPBUF_Msk (0xfffful << BPWM_CMPBUF4_CMPBUF_Pos) /*!< BPWM_T::CMPBUF4: CMPBUF Mask */ - -#define BPWM_CMPBUF5_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF5: CMPBUF Position */ -#define BPWM_CMPBUF5_CMPBUF_Msk (0xfffful << BPWM_CMPBUF5_CMPBUF_Pos) /*!< BPWM_T::CMPBUF5: CMPBUF Mask */ - -/**@}*/ /* BPWM_CONST */ -/**@}*/ /* end of BPWM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __BPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/canfd_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/canfd_reg.h deleted file mode 100644 index cf214fd8e37..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/canfd_reg.h +++ /dev/null @@ -1,1712 +0,0 @@ -/**************************************************************************//** - * @file canfd_reg.h - * @version V1.00 - * @brief CAN FD register definition header file - * -* SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __CANFD_REG_H__ -#define __CANFD_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup Controller Area Network with Feasibility Data Rate (CAN FD) - Memory Mapped Structure for CAN FD Controller -@{ */ - -typedef struct -{ - - /** - * @var CANFD_T::DBTP - * Offset: 0x0C Data Bit Timing & Prescaler Register Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |7[3:0] |DSJW |Data (Re) Synchronization Jump Width - * | | |Valid values are 0 to 15. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[7:4] |DTSEG2 |Data time segment after sample point - * | | |Valid values are 0 to 15. - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used. - * |[12:8] |DTSEG1 |Data time segment before sample point - * | | |Valid values are 0 to 31. - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used. - * |[20:16] |DBRP |Data Bit Rate Prescaler - * | | |The value by which the oscillator frequency is divided for generating the bit time quanta. - * | | |The bit time is built up from a multiple of this quanta. Valid values for the Bit Rate Prescaler are 0 to 31. When TDC ='1',the range is limited to 0,1. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[23] |TDC |Transmitter Delay Compensation - * | | |0 = Transmitter Delay Compensation disabled. - * | | |1 = Transmitter Delay Compensation enabled. - * --------------------------------------------------------------------------------------------------- - * @var CANFD_T::TEST - * Offset: 0x10 Test Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |LBCK |Loop Back Mode - * | | |0 = Reset value, Loop Back Mode is disabled. - * | | |1 = Loop Back Mode is enabled (refer to 1.1.5.1 TEST Mode). - * |[6:5] |TX |Control of Transmit Pin - * | | |00 = Reset value, CANx_TXD controlled by the CAN Core, updated at the end of the CAN bit time. - * | | |01 = Sample Point can be monitored at pin CANx_TXD. - * | | |10 = Dominant ('0') level at pin CANx_TXD. - * | | |11 = Recessive ('1') level at pin CANx_TXD. - * |[7] |RX |Receive Pin - * | | |Monitors the actual value of pin CANx_RXD - * | | |0 = The CAN bus is dominant (CANx_RXD = 0). - * | | |1 = The CAN bus is recessive (CANx_RXD = 1). - * @var CANFD_T::RWD - * Offset: 0x14 RAM Watchdog Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDC |Watchdog Conguration - * | | |Start value of the Message RAM Watchdog Counter. With the reset value of 00 the counter is disabled. - * |[15:8] |WDV |Watchdog Value - * | | |Actual Message RAM Watchdog Counter Value. - * @var CANFD_T::CCCR - * Offset: 0x18 CC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INIT |Initialization - * | | |0 = Normal Operation. - * | | |1 = Initialization is started. - * | | |Note: Due to the synchronization mechanism between the two clock domains, there may be a delay until the value written to INIT can be read back. - * | | |Therefore the programmer has to assure that the previous value written to INIT has been accepted by reading INIT before setting INIT to a new value. - * |[1] |CCE |Conguration Change Enable - * | | |0 = The CPU has no write access to the protected conguration registers. - * | | |1 = The CPU has write access to the protected conguration registers (while CANFD_INIT (CANFD_CCCR[0]) = 1). - * |[2] |ASM |Restricted Operation Mode - * | | |Bit ASM can only be set by the Host when both CCE and INIT are set to 1. - * | | |The bit can be reset by the Host software at any time. - * | | |This bit will be set automatically set to 1 when the Tx handler was not able to read data from the message RAM in time. - * | | |For a description of the Restricted Operation Mode refer to Restricted Operation Mode. - * | | |0 = Normal CAN operation. - * | | |1 = Restricted Operation Mode active. - * |[3] |CSA |Clock Stop Acknowledge - * | | |0 = No clock stop acknowledged. - * | | |1 = The Controller may be set in power down by stopping AHB clock and CAN Core clockcclk. - * |[4] |CSR |Clock Stop Request - * | | |0 = No clock stop is requested. - * | | |1 = Clock stop requested. - * | | |When clock stop is requested, first INIT and then CSA will be set after all pending transfer requests have been completed and the CAN bus reached idle. - * |[5] |MON |Bus Monitoring Mode - * | | |Bit MON can only be set by the Host when both CCE and INIT are set to 1. - * | | |The bit can be reset by the Host at any time. - * | | |0 = Bus Monitoring Mode is disabled. - * | | |1 = Bus Monitoring Mode is enabled. - * |[6] |DAR |Disable Automatic Retransmission - * | | |0 = Automatic retransmission of messages not transmitted successfully enabled. - * | | |1 = Automatic retransmission disabled. - * |[7] |TEST |Test Mode Enable - * | | |0 = Normal operation, register TEST holds reset values. - * | | |1 = Test Mode, write access to register TEST enabled. - * |[8] |FDOE |FD Operation Enable - * | | |0 = FD operation disabled. - * | | |1 = FD operation enabled. - * |[9] |BRSE |Bit Rate Switch Enable - * | | |0 = Bit rate switching for transmissions disabled. - * | | |1 = Bit rate switching for transmissions enabled. - * | | |Note: When CAN FD operation is disabled FDOE = 0, BRSE is not evaluated. - * |[12] |PXHD |Protocol Exception Handling Disable - * | | |0 = Protocol exception handling enabled. - * | | |1 = Protocol exception handling disabled. - * | | |Note: When protocol exception handling is disabled, the controller will transmit an error frame when it detects a protocol exception condition. - * |[13] |EFBI |Edge Filtering during Bus Integration - * | | |0 = Edge filtering disabled. - * | | |1 = Two consecutive dominant tq required to detect an edge f or hard synchronization. - * |[14] |TXP |Transmit Pause - * | | |If this bit is set, the CAN FD controller pauses for two CAN bit times before starting the next transmission after itself has successfully transmitted a frame (refer to 1.1.5.5). - * | | |0 = Transmit pause disabled. - * | | |1 = Transmit pause enabled. - * |[15] |NISO |Non ISO Operation - * | | |If this bit is set, the CAN FD controller controller uses the CAN FD frame format as specied by the Bosch CAN FD Specification V1.0. - * | | |0 = CAN FD frame format according to ISO 11898-1:2015. - * | | |1 = CAN FD frame format according to Bosch CAN FD Specification V1.0. - * @var CANFD_T::NBTP - * Offset: 0x1C Nominal Bit Timing & Prescaler Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |NTSEG2 |Nominal Time segment after sample point - * | | |0x01-0x7F Valid values are 1 to 127. - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used - * | | |tBS2 = (NTSEG2 + 1) x tq. - * | | |Note: With a CAN Core clock (cclk) of 8 MHz, the reset value of 0x06000A03 configures the controller for a bit rate of 500 kBit/s. - * |[15:8] |NTSEG1 |Nominal Time segment before sample point - * | | |Valid values are 1 to 255. - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used - * | | |tBS1 = (NTSEG1 + 1) x tq. - * |[24:16] |NBRP |Nominal Bit Rate Prescaler - * | | |0x000-0x1FF The value by which the oscillator frequency is divided for generating the bit time quanta. - * | | |The bit time is built up from a multiple of this quanta. - * | | |Valid values for the Bit Rate Prescaler are 0 to 511. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[31:25] |NSJW |Nominal Re-Synchronization Jump Width - * | | |Valid values are 0 to 127,Should be smaller than NTSEG2. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * | | |tSJW = (NSJW + 1) x tq. - * @var CANFD_T::TSCC - * Offset: 0x20 Timestamp Counter Conufiguration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TSS |Timestamp Select - * | | |00 = Timestamp counter value always 0x0000. - * | | |01 = Timestamp counter value incremented according to TCP. - * | | |10 = Reserved. - * | | |11 = Same as '00'. - * |[19:16] |TCP |Timestamp Counter Prescaler - * | | |Configures the timestamp and timeout counters time unit in multiples of CAN bit times [ 1...16 ]. - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * @var CANFD_T::TSCV - * Offset: 0x24 Timestamp Counter Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TSC |Timestamp Counter - * | | |The internal Timestamp Counter value is captured on start of frame (both Rx and Tx). - * | | |When CANFD_TSS (TSCC[[1:0]) = 2'b01, the Timestamp Counter is incremented in multiples of CAN bit times [ 1...16 ] depending on the configuration of CANFD_TCP (CANFD_TSCC[19:16]). - * | | |A wrap around sets interrupt ag CANFD_IR (CANFD_IR[16])Write access resets the counter to 0. - * | | |Note: A "wrap around" is a change of the Timestamp Counter value from non-zero to zero not caused by write access to CANFD_TSCV. - * @var CANFD_T::TOCC - * Offset: 0x28 Timeout Counter Conufiguration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ETOC |Enable Timeout Counter - * | | |0 = Timeout Counter disabled. - * | | |1 = Timeout Counter enabled. - * | | |Note: For use of timeout function with CAN FD refer to 1.1.5.3. - * |[2:1] |TOS |Timeout Select - * | | |When operating in Continuous mode, a write to CANFD_TOCV presets the counter to the value configured by CANFD_TOP (TOCC[31:16]) and continues down-counting - * | | |When the Timeout Counter is controlled by one of the FIFOs, an empty FIFO presets the counter to the value configured by CANFD_TOP (TOCC[31:16]) - * | | |Down-counting is started when the first FIFO element is stored. - * | | |00 = Continuous operation. - * | | |01 = Timeout controlled by Tx Event FIFO. - * | | |10 = Timeout controlled by Rx FIFO 0. - * | | |11 = Timeout controlled by Rx FIFO 1. - * |[31:16] |TOP |Timeout Period - * | | |Start value of the Timeout Counter (down-counter). Configures the Timeout Period. - * @var CANFD_T::TOCV - * Offset: 0x2C Timeout Counter Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TOC |Timeout Counter - * | | |The filed is decremented in multiples of CAN bit times [ 1...16 ] depending on the configuration of TCP (CANFD_TSCC[19:16]). - * | | |When decremented to 0, interrupt flag TOO (CANFD_IR[18]) is set and the timeout counter is stopped. - * | | |Start and reset/restart conditions are configured via TOS (CANFD_TOCC[1:0]). - * @var CANFD_T::ECR - * Offset: 0x40 Error Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TEC |Transmit Error Counter - * | | |Actual state of the Transmit Error Counter, values between 0 and 255. - * | | |Note: When ASM (CANFD_CCCR[2]) is set, the CAN protocol controller does not increment TEC and REC when a CAN protocol error is detected, but CEL is still incremented. - * |[14:8] |REC |Receive Error Counter - * | | |Actual state of the Receive Error Counter, values between 0 and 127. - * |[15] |RP |Receive Error Passive - * | | |0 = The Receive Error Counter is below the error passive level of 128. - * | | |1 = The Receive Error Counter has reached the error passive level of 128. - * |[23:16] |CEL |CAN Error Logging - * | | |The counter is incremented each time when a CAN protocol error causes the 8-bit Transmit Error Counter TEC or the 7-bit Receive Error Counter REC to be incremented. - * | | |The counter is also incremented when the Bus_Off limit is reached. - * | | |It is not incremented when only RP is set without changing REC. - * | | |The increment of CEL follows after the increment of REC or TEC. - * | | |The counter is reset by read access to CEL. - * | | |The counter stops at 0xFF; the next increment of TEC or REC sets interrupt flag ELO (CANFD_IR[22]). - * @var CANFD_T::PSR - * Offset: 0x44 Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |LEC |Last Error Code - * | | |The LEC indicates the type of the last error to occur on the CAN bus. - * | | |This field will be cleared to 0 when a message has been transferred (reception or transmission) without error. - * | | |000 = No Error: No error occurred since LEC has been reset by successful reception or transmission. - * | | |001 = Stuff Error: More than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed. - * | | |010 = Form Error: A fixed format part of a received frame has the wrong format. - * | | |011 = AckError: The message transmitted by the CANFD CONTROLLER was not acknowledged by another node. - * | | |100 = Bit1Error: During the transmission of a message (with the exception of the arbitration field), the device wanted to send a recessive level (bit of logical value 1), but the monitored bus value was dominant. - * | | |101 = Bit0Error : During the transmission of a message (or acknowledge bit, or active error flag, or overload flag), the device wanted to send a dominant level (data or identifier bit logical value 0), but the monitored bus value was recessive - * | | |During Bus_Off recovery this status is set each time a sequence of 11 recessive bits has been monitored. - * | | |This enables the CPU to monitor the proceeding of the Bus_Off recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed). - * | | |110 = CRCError: The CRC check sum of a received message was incorrect. - * | | |The CRC of an incoming message does not match with the CRC calculated from the received data. - * | | |111 = NoChange: Any read access to the Protocol Status Register re-initializes the LEC to 7.When the LEC shows the value 7, no CAN bus event was detected since the last CPU read access to the Protocol Status Register. - * |[4:3] |ACT |Activity - * | | |Monitors the module's CAN communication state. - * | | |00 = Synchronizing - node is synchronizing on CAN communication. - * | | |01 = Idle - node is neither receiver nor transmitter. - * | | |10 = Receiver - node is operating as receiver. - * | | |11 = Transmitter - node is operating as transmitter. - * |[5] |EP |Error Passive - * | | |0 = The CAN FD controller is in the Error_Active state. - * | | |It normally takes part in bus communication and sends an active error flag when an error has been detected. - * | | |1 = The CAN FD controller is in the Error_Passive state. - * |[6] |EW |Warning Status - * | | |0 = Both error counters are below the Error_Warning limit of 96. - * | | |1 = At least one of error counter has reached the Error_Warning limit of 96. - * |[7] |BO |Bus_Off Status - * | | |0 = The CAN FD controller is not Bus_Off. - * | | |1 = The CAN FD controller is in Bus_Off state. - * |[10:8] |DLEC |Data Phase Last Error Code - * | | |Type of last error that occurred in the data phase of a CAN FD format frame with its BRS flag set. - * | | |Coding is the same as for LEC. - * | | |This field will be cleared to zero when a CAN FD format frame with its BRS flag set has been transferred (reception or transmission) without error. - * |[11] |RESI |ESI flag of last received CAN FD Message - * | | |This bit is set together with RFDF, independent of acceptance filtering. - * | | |0 = Last received CAN FD message did not have its ESI flag set. - * | | |1 = Last received CAN FD message had its ESI flag set. - * |[12] |RBRS |BRS flag of last received CAN FD Message - * | | |This bit is set together with RFDF, independent of acceptance filtering. - * | | |0 = Last received CAN FD message did not have its BRS flag set. - * | | |1 = Last received CAN FD message had its BRS flag set. - * | | |Note: Byte access: Reading byte 0 will reset RBRS, reading bytes 3/2/1 has no impact. - * |[13] |RFDF |Received a CAN FD Message - * | | |This bit is set independent of acceptance filtering. - * | | |0 = Since this bit was reset by the CPU, no CAN FD message has been received. - * | | |1 = Message in CAN FD format with FDF flag set has been received. - * | | |Note: Byte access: Reading byte 0 will reset RFDF, reading bytes 3/2/1 has no impact. - * |[14] |PXE |Protocol Exception Event - * | | |0 = No protocol exception event occurred since last read access. - * | | |1 = Protocol exception event occurred. - * |[22:16] |TDCV |Transmitter Delay Compensation Value - * | | |Position of the secondary sample point, defined by the sum of the measured delay from CANx_TXD to CANx_RXD and TDCO (TDCR[[14:8]). - * | | |The SSP position is, in the data phase, the number of minimum time quata (mtq) between the start of the transmitted bit and the secondary sample point. - * | | |Valid values are 0 to 127 mtq. - * @var CANFD_T::TDCR - * Offset: 0x48 Transmitter Delay Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TDCF |Transmitter Delay Compensation Filter Window Length - * | | |0x00-0x7F Defines the minimum value for the SSP position, dominant edges on CANx_RXD that would result in an earlier SSP position are ignored for transmitter delay measurement - * | | |The feature is enabled when TDCF is configured to a value greater than TDCO. - * | | |Valid values are 0 to 127 mtq. - * |[14:8] |TDCO |Transmitter Delay Compensation SSP Offset - * | | |0x00-0x7F Offset value defining the distance between the measured delay from CANx_TXD to CANx_RXD and the secondary sample point. - * | | |Valid values are 0 to 127 mtq. - * @var CANFD_T::IR - * Offset: 0x50 Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RF0N |Rx FIFO 0 New Message - * | | |0 = No new message written to Rx FIFO 0. - * | | |1 = New message written to Rx FIFO 0. - * |[1] |RF0W |Rx FIFO 0 Watermark Reached - * | | |0 = Rx FIFO 0 fill level below watermark. - * | | |1 = Rx FIFO 0 fill level reached watermark. - * |[2] |RF0F |Rx FIFO 0 Full - * | | |0 = Rx FIFO 0 not full. - * | | |1 = Rx FIFO 0 full. - * |[3] |RF0L |Rx FIFO 0 Message Lost - * | | |0 = No Rx FIFO 0 message lost. - * | | |1 = Rx FIFO 0 message lost, also set after write attempt to Rx FIFO 0 of size zero. - * |[4] |RF1N |Rx FIFO 1 New Message - * | | |0 = No new message written to Rx FIFO 1. - * | | |1 = New message written to Rx FIFO 1. - * |[5] |RF1W |Rx FIFO 1 Watermark Reached - * | | |0 = Rx FIFO 1 fill level below watermark. - * | | |1 = Rx FIFO 1 fill level reached watermark. - * |[6] |RF1F |Rx FIFO 1 Full - * | | |0 = Rx FIFO 1 not full. - * | | |1 = Rx FIFO 1 full. - * |[7] |RF1L |Rx FIFO 1 Message Lost - * | | |0 = No Rx FIFO 1 message lost. - * | | |1 = Rx FIFO 1 message lost, also set after write attempt to Rx FIFO 1 of size zero. - * |[8] |HPM |High Priority Message - * | | |0 = No high priority message received. - * | | |1 = High priority message received. - * |[9] |TC |Transmission Completed - * | | |0 = No transmission completed. - * | | |1 = Transmission completed. - * |[10] |TCF |Transmission Cancellation Finished - * | | |0 = No transmission cancellation finished. - * | | |1 = Transmission cancellation finished. - * |[11] |TFE |Tx FIFO Empty - * | | |0 = Tx FIFO non-empty. - * | | |1 = Tx FIFO empty. - * |[12] |TEFN |Tx Event FIFO New Entry - * | | |0 = Tx Event FIFO unchanged. - * | | |1 = Tx Handler wrote Tx Event FIFO element. - * |[13] |TEFW |Tx Event FIFO Watermark Reached - * | | |0 = Tx Event FIFO fill level below watermark. - * | | |1 = Tx Event FIFO fill level reached watermark. - * |[14] |TEFF |Tx Event FIFO Full - * | | |0 = Tx Event FIFO not full. - * | | |1 = Tx Event FIFO full. - * |[15] |TEFL |Tx Event FIFO Element Lost - * | | |0 = No Tx Event FIFO element lost. - * | | |1 = Tx Event FIFO element lost, also set after write attempt to Tx Event FIFO of size zero. - * |[16] |TSW |Timestamp Wraparound - * | | |0 = No timestamp counter wrap-around. - * | | |1 = Timestamp counter wrapped around. - * |[17] |MRAF |Message RAM Access Failure - * | | |The flag is set, when the Rx Handler - * | | |Has not completed acceptance filtering or storage of an accepted message until the arbitration field of the following message has been received. - * | | |In this case acceptance filtering or message storage is aborted and the Rx Handler starts processing of the following message. - * | | |Was not able to write a message to the Message RAM. In this case message storage is aborted. - * | | |In both cases the FIFO put index is not updated resp. - * | | |The New Data flag for a dedicated Rx Buffer is not set, a partly stored message is overwritten when the next message is stored to this location. - * | | |The flag is also set when the Tx Handler was not able to read a message from the Message RAM in time. - * | | |In this case message transmission is aborted. - * | | |In case of a Tx Handler access failure the CAN FD controller is switched into Restricted Operation Mode (refer to Restricted Operation Mode). - * | | |To leave Restricted Operation Mode, the Host CPU has to reset CANFD_ASM (CANFD_CCCR[2]). - * | | |0 = No Message RAM access failure occurred. - * | | |1 = Message RAM access failure occurred. - * |[18] |TOO |Timeout Occurred - * | | |0 = No timeout. - * | | |1 = Timeout reached. - * |[19] |DRX |Message stored to Dedicated Rx Buffer - * | | |The flag is set whenever a received message has been stored into a dedicated Rx Buffer. - * | | |0 = No Rx Buffer updated. - * | | |1 = At least one received message stored into an Rx Buffer. - * |[22] |ELO |Error Logging Overflow - * | | |0= CAN Error Logging Counter did not overflow. - * | | |1= Overflow of CAN Error Logging Counter occurred. - * |[23] |EP |Error Passive - * | | |0 = Error_Passive status unchanged. - * | | |1 = Error_Passive status changed. - * |[24] |EW |Warning Status - * | | |0 = Error_Warning status unchanged. - * | | |1 = Error_Warning status changed. - * |[25] |BO |Bus_Off Status - * | | |0 = Bus_Off status unchanged. - * | | |1 = Bus_Off status changed. - * |[26] |WDI |Watchdog Interrupt - * | | |0 = No Message RAM Watchdog event occurred. - * | | |1 = Message RAM Watchdog event due to missing READY. - * |[27] |PEA |Protocol Error in Arbitration Phase - * | | |0 = No protocol error in arbitration phase. - * | | |1 = Protocol error in arbitration phase detected (CANFD_LEC (CANFD_PSR[2:0]) no equal 0 or 7). - * | | |Note: Nominal bit time is used - * |[28] |PED |Protocol Error in Data Phase - * | | |0 = No protocol error in data phase. - * | | |1= Protocol error in data phase detected (DLEC (CANFD_PSR[10:8]) no equal 0 or 7). - * | | |Note: Data bit time is used. - * |[29] |ARA |Access to Reserved Address - * | | |0 = No access to reserved address occurred. - * | | |1 = Access to reserved address occurred. - * @var CANFD_T::IE - * Offset: 0x54 Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RF0NE |Rx FIFO 0 New Message Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[1] |RF0WE |Rx FIFO 0 Watermark Reached Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[2] |RF0FE |Rx FIFO 0 Full Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[3] |RF0LE |Rx FIFO 0 Message Lost Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[4] |RF1NE |Rx FIFO 1 New Message Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[5] |RF1WE |Rx FIFO 1 Watermark Reached Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[6] |RF1FE |Rx FIFO 1 Full Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[7] |RF1LE |Rx FIFO 1 Message Lost Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[8] |HPME |High Priority Message Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[9] |TCE |Transmission Completed Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[10] |TCFE |Transmission Cancellation Finished Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[11] |TFEE |Tx FIFO Empty Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[12] |TEFNE |Tx Event FIFO New Entry Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[13] |TEFWE |Tx Event FIFO Watermark Reached Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[14] |TEFFE |Tx Event FIFO Full Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[15] |TEFLE |Tx Event FIFO Event Lost Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[16] |TSWE |Timestamp Wraparound Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[17] |MRAFE |Message RAM Access Failure Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[18] |TOOE |Timeout Occurred Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[19] |DRXE |Message stored to Dedicated Rx Buffer Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[20] |BECE |Bit Error Corrected Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[21] |BEUE |Bit Error Uncorrected Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[22] |ELOE |Error Logging Overflow Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[23] |EPE |Error Passive Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[24] |EWE |Warning Status Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[25] |BOE |Bus_Off Status Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[26] |WDIE |Watchdog Interrupt Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[27] |PEAE |Protocol Error in Arbitration Phase Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[28] |PEDE |Protocol Error in Data Phase Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[29] |ARAE |Access to Reserved Address Enable - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * @var CANFD_T::ILS - * Offset: 0x58 Interrupt Line Select - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RF0NL |Rx FIFO 0 New Message Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[1] |RF0WL |Rx FIFO 0 Watermark Reached Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[2] |RF0FL |Rx FIFO 0 Full Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[3] |RF0LL |Rx FIFO 0 Message Lost Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[4] |RF1NL |Rx FIFO 1 New Message Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[5] |RF1WL |Rx FIFO 1 Watermark Reached Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[6] |RF1FL |Rx FIFO 1 Full Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[7] |RF1LL |Rx FIFO 1 Message Lost Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[8] |HPML |High Priority Message Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[9] |TCL |Transmission Completed Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[10] |TCFL |Transmission Cancellation Finished Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[11] |TFEL |Tx FIFO Empty Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[12] |TEFNL |Tx Event FIFO New Entry Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[13] |TEFWL |Tx Event FIFO Watermark Reached Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[14] |TEFFL |Tx Event FIFO Full Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[15] |TEFLL |Tx Event FIFO Event Lost Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[16] |TSWL |Timestamp Wraparound Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[17] |MRAFL |Message RAM Access Failure Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[18] |TOOL |Timeout Occurred Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[19] |DRXL |Message stored to Dedicated Rx Buffer Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[22] |ELOL |Error Logging Overflow Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[23] |EPL |Error Passive Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[24] |EWL |Warning Status Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[25] |BOL |Bus_Off Status Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[26] |WDIL |Watchdog Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[27] |PEAL |Protocol Error in Arbitration Phase Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[28] |PEDL |Protocol Error in Data Phase Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[29] |ARAL |Access to Reserved Address Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * @var CANFD_T::ILE - * Offset: 0x5C Interrupt Line Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ENT0 |Enable Interrupt Line 0 - * | | |0 = Interrupt line canfd_int0 disabled. - * | | |1 = Interrupt line canfd_int0 enabled. - * |[1] |ENT1 |Enable Interrupt Line 1 - * | | |0 = Interrupt line canfd_int1 disabled. - * | | |1 = Interrupt line canfd_int1 enabled. - * @var CANFD_T::GFC - * Offset: 0x80 Global Filter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RRFE |Reject Remote Frames Extended - * | | |0= Filter remote frames with 29-bit extended IDs. - * | | |1= Reject all remote frames with 29-bit extended IDs. - * |[1] |RRFS |Reject Remote Frames Standard - * | | |0= Filter remote frames with 11-bit standard IDs. - * | | |1= Reject all remote frames with 11-bit standard IDs. - * |[3:2] |ANFE |Accept Non-matching Frames Extended - * | | |Defines how received messages with 29-bit IDs that do not match any element of the filter list are treated. - * | | |00 = Accept in Rx FIFO 0. - * | | |01 = Accept in Rx FIFO 1. - * | | |10 = Reject. - * | | |11 = Reject. - * |[5:4] |ANFS |Accept Non-matching Frames Standard - * | | |Defines how received messages with 11-bit IDs that do not match any element of the filter list are treated. - * | | |00 = Accept in Rx FIFO 0. - * | | |01 = Accept in Rx FIFO 1. - * | | |10 = Reject. - * | | |11 = Reject. - * @var CANFD_T::SIDFC - * Offset: 0x84 Standard ID Filter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |FLSSA |Filter List Standard Start Address - * | | |Start address of standard Message ID filter list (32-bit word address, refer to Figure 1.1-11). - * |[23:16] |LSS |List Size Standard - * | | |0= No standard Message ID filter. - * | | |1-128 = Number of standard Message ID filter elements. - * | | |>128= Values greater than 128 are interpreted as 128. - * @var CANFD_T::XIDFC - * Offset: 0x88 Extended ID Filter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |FLESA |Filter List Extended Start Address - * | | |Start address of extended Message ID filter list (32-bit word address, refer to Figure 1.1-11). - * |[22:16] |LSE |List Size Extended - * | | |0= No extended Message ID filter. - * | | |1-64= Number of extended Message ID filter elements. - * | | |>64= Values greater than 64 are interpreted as 64. - * @var CANFD_T::XIDAM - * Offset: 0x90 Extended ID AND Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |EIDM |Extended ID Mask - * | | |For acceptance filtering of extended frames the Extended ID AND Mask is ANDed with the Message ID of a received frame. - * | | |Intended for masking of 29-bit IDs in SAE J1939. - * | | |With the reset value of all bits set to one the mask is not active. - * | | |Note: These are protected write bits, write access is possible only when bit CCE and bit INIT of CANFD_CCCR register are set to 1. - * @var CANFD_T::HPMS - * Offset: 0x94 High Priority Message Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |BIDX |Buffer Index - * | | |Index of Rx FIFO element to which the message was stored. Only valid when MSI[1] = 1. - * |[7:6] |MSI |Message Storage Indicator - * | | |00 = No FIFO selected. - * | | |01 = FIFO message lost. - * | | |10 = Message stored in FIFO 0. - * | | |11 = Message stored in FIFO 1. - * |[14:8] |FIDX |Filter Index - * | | |Index of matching filter element. Range is 0 to CANFD_SIDFC.LSS - 1 respor. CANFD_XIDFC.LSE - 1. - * |[15] |FLST |Filter List - * | | |Indicates the filter list of the matching filter element. - * | | |0 = Standard Filter List. - * | | |1 = Extended Filter List. - * @var CANFD_T::NDAT1 - * Offset: 0x98 New Data 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NDn |New Data - * | | |The register holds the New Data flags of Rx Buffers 0 to 31. - * | | |The flags are set when the respective Rx Buffer has been updated from a received frame. - * | | |The flags remain set until the Host clears them. - * | | |A flag is cleared by writing a 1 to the corresponding bit position. - * | | |Writing a 0 has no effect.A hard reset will clear the register. - * | | |0 = Rx Buffer not updated. - * | | |1 = Rx Buffer updated from new message. - * @var CANFD_T::NDAT2 - * Offset: 0x9C New Data 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NDn |New Data - * | | |The register holds the New Data flags of Rx Buffers 32 to 63. - * | | |The flags are set when the respective Rx Buffer has been updated from a received frame. - * | | |The flags remain set until the Host clears them. - * | | |A flag is cleared by writing a 1 to the corresponding bit position. - * | | |Writing a 0 has no effect.A hard reset will clear the register. - * | | |0 = Rx Buffer not updated. - * | | |1 = Rx Buffer updated from new message. - * @var CANFD_T::RXF0C - * Offset: 0xA0 Rx FIFO 0 Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |F0SA |Rx FIFO 0 Start Address - * | | |Start address of Rx FIFO 0 in Message RAM (32-bit word address). - * |[22:16] |F0S |Rx FIFO 0 Size - * | | |0= No Rx FIFO 0. - * | | |1-64= Number of Rx FIFO 0 elements. - * | | |>64= Values greater than 64 are interpreted as 64. - * | | |The Rx FIFO 0 elements are indexed from 0 to F0S-1. - * |[30:24] |F0WM |Rx FIFO 0 Watermark - * | | |0= Watermark interrupt disabled - * | | |1-64 = Level for Rx FIFO 0 watermark interrupt (CANFD_IR.RF0W). - * | | |>64 = Watermark interrupt disabled. - * |[31] |F0OM |FIFO 0 Operation Mode - * | | |FIFO 0 can be operated in blocking or in overwrite mode (refer to Rx FIFOs). - * | | |0 = FIFO 0 blocking mode. - * | | |1 = FIFO 0 overwrite mode. - * @var CANFD_T::RXF0S - * Offset: 0xA4 Rx FIFO 0 Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |F0FL |Rx FIFO 0 Fill Level - * | | |Number of elements stored in Rx FIFO 0, range 0 to 64. - * |[13:8] |F0GI |Rx FIFO 0 Get Index - * | | |Rx FIFO 0 read index pointer, range 0 to 63. - * |[21:16] |F0PI |Rx FIFO 0 Put Index - * | | |Rx FIFO 0 write index pointer, range 0 to 63. - * |[24] |F0F |Rx FIFO 0 Full - * | | |0= Rx FIFO 0 not full. - * | | |1= Rx FIFO 0 full. - * |[25] |RF0L |Rx FIFO 0 Message Lost - * | | |This bit is a copy of interrupt flag CANFD_IR.RF0L. - * | | |When CANFD_IR.RF0L is reset, this bit is also reset. - * | | |0 = No Rx FIFO 0 message lost. - * | | |1 = Rx FIFO 0 message lost, also set after write attempt to Rx FIFO 0 of size zero. - * | | |Note: Overwriting the oldest message when F0OM (CANFD_RXF0C[31]) = 1 will not set this flag. - * @var CANFD_T::RXF0A - * Offset: 0xA8 Rx FIFO 0 Acknowledge - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |F0A |Rx FIFO 0 Acknowledge Index - * | | |After the Host has read a message or a sequence of messages from Rx FIFO 0 it has to write the buffer index of the last element read from Rx FIFO 0 to F0AI. - * | | |This will set the Rx FIFO 0 Get Index F0GI (CANFD_RXF0S[13:8]) to F0AI (CANFD_RXF0A[5:0]) + 1 and update the FIFO 0 Fill Level CANFD_RXF0S.F0FL. - * @var CANFD_T::RXBC - * Offset: 0xAC Rx Buffer Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |RBSA |Rx Buffer Start Address - * | | |Configures the start address of the Rx Buffers section in the Message RAM (32-bit word address). - * @var CANFD_T::RXF1C - * Offset: 0xB0 Rx FIFO 1 Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |F1SA |Rx FIFO 1 Start Address - * | | |Start address of Rx FIFO 1 in Message RAM (32-bit word address, refer to Figure 1.1-11). - * |[22:16] |F1S |Rx FIFO 1 Size. - * | | |0= No Rx FIFO 1. - * | | |1-64 = Number of Rx FIFO 1 elements. - * | | |>64 = Values greater than 64 are interpreted as 64. - * | | |The Rx FIFO 1 elements are indexed from 0 to F1S - 1. - * |[30:24] |F1WM |Rx FIFO 1 Watermark - * | | |0= Watermark interrupt disabled. - * | | |1-64 = Level for Rx FIFO 1 watermark interrupt (CANFD_IR.RF1W). - * | | |>64 = Watermark interrupt disabled. - * |[31] |F1OM |FIFO 1 Operation Mode. - * | | |FIFO 1 can be operated in blocking or in overwrite mode (refer to Rx FIFOs). - * | | |0= FIFO 1 blocking mode. - * | | |1= FIFO 1 overwrite mode. - * @var CANFD_T::RXF1S - * Offset: 0xB4 Rx FIFO 1 Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |F1FL |Rx FIFO 1 Fill Level - * | | |Number of elements stored in Rx FIFO 1, range 0 to 64. - * |[13:8] |F1G |Rx FIFO 1 Get Index - * | | |Rx FIFO 1 read index pointer, range 0 to 63. - * |[21:16] |F1P |Rx FIFO 1 Fill Level - * | | |Number of elements stored in Rx FIFO 1, range 0 to 64. - * |[24] |F1F |Rx FIFO 1 Full - * | | |0 = Rx FIFO 1 not full. - * | | |1 = Rx FIFO 1 full. - * |[25] |RF1L |Rx FIFO 1 Message Lost - * | | |This bit is a copy of interrupt flag CANFD_IR.RF1L. - * | | |When CANFD_IR.RF1L is reset, this bit is also reset. - * | | |0= No Rx FIFO 1 message lost. - * | | |1= Rx FIFO 1 message lost, also set after write attempt to Rx FIFO 1 of size zero. - * | | |Note: Overwriting the oldest message when F1OM (CANFD_RXF1C[31]) = 1 will not set this flag. - * @var CANFD_T::RXF1A - * Offset: 0xB8 Rx FIFO 1 Acknowledge - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |F1A |Rx FIFO 1 Acknowledge Index - * | | |After the Host has read a message or a sequence of messages from Rx FIFO 1 it has to write the buffer index of the last element read from Rx FIFO 1 to F1AI. - * | | |This will set the Rx FIFO 1 Get Index F1GI (CANFD_RXF1S[13:8]) to F1AI (CANFD_RXF1A[5:0]) + 1 and update the FIFO 1 Fill Level F1FL (CANFD_RXF1S[6:0]). - * @var CANFD_T::RXESC - * Offset: 0xBC Rx Buffer / FIFO Element Size Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |F0DS |Rx FIFO 0 Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * | | |Note: In case the data field size of an accepted CAN frame exceeds the data field size configured for the matching Rx Buffer or Rx FIFO, only the number of bytes as configured by CANFD_RXESC are stored to the Rx Buffer resp Rx FIFO element. - * | | |The rest of the frame data field is ignored. - * |[6:4] |F1DS |Rx FIFO 1 Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * |[10:8] |RBDS |Rx Buffer Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * @var CANFD_T::TXBC - * Offset: 0xC0 Tx Buffer Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |TBSA |Tx Buffers Start Address - * | | |Start address of Tx Buffers section in Message RAM (32-bit word address, refer to Figure 1.1-11). - * | | |Note: Be aware that tThe sum of TFQS and NDTB may be not greater than 32. - * | | |There is no check for erroneous configurations. - * | | |The Tx Buffers section in the Message RAM starts with the dedicated Tx Buffers. - * |[21:16] |NDTB |Number of Dedicated Transmit Buffers - * | | |0= No Dedicated Tx Buffers. - * | | |1-32= Number of Dedicated Tx Buffers. - * | | |>32= Values greater than 32 are interpreted as 32. - * |[29:24] |TFQS |Transmit FIFO/Queue Size - * | | |0= No Tx FIFO/Queue. - * | | |1-32= Number of Tx Buffers used for Tx FIFO/Queue. - * | | |>32= Values greater than 32 are interpreted as 32. - * |[30] |TFQM |Tx FIFO/Queue Mode - * | | |0= Tx FIFO operation. - * | | |1= Tx Queue operation. - * @var CANFD_T::TXFQS - * Offset: 0xC4 Tx FIFO/Queue Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |TFFL |Tx FIFO Free Level - * | | |Number of consecutive free Tx FIFO elements starting from TFGI, range 0 to 32 - * | | |Read as zero when Tx Queue operation is configured (TFQM (CANFD_TXBC[3]) = 1). - * | | |Note: In case of mixed configurations where dedicated Tx Buffers are combined with a Tx FIFO or a Tx Queue, the Put and Get Indices indicate the number of the Tx Buffer starting with the first dedicated Tx Buffers. - * | | |Example: For a configuration of 12 dedicated Tx Buffers and a Tx FIFO of 20 Buffers a Put Index of 15 points to the fourth buffer of the Tx FIFO. - * |[12:8] |TFG |Tx FIFO Get Index. - * | | |Tx FIFO read index pointer, range 0 to 31. - * | | |Read as zero when Tx Queue operation is configured (TFQM (CANFD_TXBC[30]) = 1). - * |[20:16] |TFQP |Tx FIFO/Queue Put Index - * | | |Tx FIFO/Queue write index pointer, range 0 to 31. - * |[21] |TFQF |Tx FIFO/Queue Full - * | | |0= Tx FIFO/Queue not full. - * | | |1= Tx FIFO/Queue full. - * @var CANFD_T::TXESC - * Offset: 0xC8 Tx Buffer Element Size Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TBDS |Tx Buffer Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * | | |Note: In case the data length code DLC of a Tx Buffer element is configured to a value higher than the Tx Buffer data field size CANFD_TXESC.TBDS, the bytes not defined by the Tx Buffer are transmitted as 0xCC (padding bytes). - * @var CANFD_T::TXBRP - * Offset: 0xCC Tx Buffer Request Pending - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TRPn |Transmission Request Pending Each Tx Buffer has its own Transmission Request Pending bit. The bits are set via register CANFD_TXBAR. The bits are reset after a requested transmission has completed or has been cancelled via register CANFD_TXBCR. - * | | |CANFD_TXBRP bits are set only for those Tx Buffers configured via CANFD_TXBC. - * | | |After a CANFD_TXBRP bit has been set, a Tx scan (refer to 1.1.5.5, Tx Handling) is started to check for the pending Tx request with the highest priority (Tx Buffer with lowest Message ID). - * | | |A cancellation request resets the corresponding transmission request pending bit of register CANFD_TXBRP. - * | | |In case a transmission has already been started when a cancellation is requested, this is done at the end of the transmission, regardless whether the transmission was successful or not. - * | | |The cancellation request bits are reset directly after the corresponding CANFD_TXBRP bit has been reset. - * | | |After a cancellation has been requested, a finished cancellation is signaled via CANFD_TXBCF. - * | | |- after successful transmission together with the corresponding CANFD_TXBTO bit. - * | | |- when the transmission has not yet been started at the point of cancellation. - * | | |- when the transmission has been aborted due to lost arbitration. - * | | |- when an error occurred during frame transmission. - * | | |In DAR mode all transmissions are automatically cancelled if they are not successful. - * | | |The corresponding CANFD_TXBCF bit is set for all unsuccessful transmissions. - * | | |0 = No transmission request pending. - * | | |1 = Transmission request pending. - * | | |Note: CANFD_TXBRP bits which are set while a Tx scan is in progress are not considered during this particular Tx scan. - * | | |In case a cancellation is requested for such a Tx Buffer, this Add Request is cancelled immediately, the corresponding CANFD_TXBRP bit is reset. - * @var CANFD_T::TXBAR - * Offset: 0xD0 Tx Buffer Add Request - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ARn |Add Request Each Tx Buffer has its own Add Request bit. Writing a 1 will set the corresponding Add Request bit; writing a 0 has no impact. This enables the Host to set transmission requests for multiple Tx Buffers with one write to CANFD_TXBAR. CANFD_TXBAR bits are set only for those Tx Buffers configured via CANFD_TXBC. - * | | |When no Tx scan is running, the bits are reset immediately, else the bits remain set until the Tx scan process has completed. - * | | |0 = No transmission request added. - * | | |1 = Transmission requested added. - * | | |Note: If an add request is applied for a Tx Buffer with pending transmission request (corre- sponding CANFD_TXBRP bit already set), this add request is ignored. - * @var CANFD_T::TXBCR - * Offset: 0xD4 Tx Buffer Cancellation Request - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRn |Cancellation Request - * | | |Each Tx Buffer has its own Cancellation Request bit. - * | | |Writing a 1 will set the corresponding Cancellation Request bit; writing a 0 has no impact. - * | | |This enables the Host to set cancellation requests for multiple Tx Buffers with one write to CANFD_TXBCR. - * | | |CANFD_TXBCR bits are set only for those Tx Buffers configured via CANFD_TXBC. - * | | |The bits remain set until the corresponding bit of CANFD_TXBRP is reset. - * | | |0 = No cancellation pending. - * | | |1 = Cancellation pending. - * @var CANFD_T::TXBTO - * Offset: 0xD8 Tx Buffer Transmission Occurred - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TOn |Transmission Occurred - * | | |Each Tx Buffer has its own Transmission Occurred bit. - * | | |The bits are set when the corresponding CANFD_TXBRP bit is cleared after a successful transmission. - * | | |The bits are reset when a new transmission is requested by writing a 1 to the corresponding bit of register CANFD_TXBAR. - * | | |0 = No transmission occurred. - * | | |1 = Transmission occurred. - * @var CANFD_T::TXBCF - * Offset: 0xDC Tx Buffer Cancellation Finished - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CFn |Cancellation Finished - * | | |Each Tx Buffer has its own Cancellation Finished bit. - * | | |The bits are set when the corresponding CANFD_TXBRP bit is cleared after a cancellation was requested via CANFD_TXBCR. - * | | |In case the corresponding CANFD_TXBRP bit was not set at the point of cancellation, CF is set immediately. - * | | |The bits are reset when a new transmission is requested by writing a 1 to the corresponding bit of register CANFD_TXBAR. - * | | |0 = No transmit buffer cancellation. - * | | |1 = Transmit buffer cancellation finished. - * @var CANFD_T::TXBTIE - * Offset: 0xE0 Tx Buffer Transmission Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TIEn |Transmission Interrupt Enable - * | | |Each Tx Buffer has its own Transmission Interrupt Enable bit. - * | | |0 = Transmission interrupt disabled. - * | | |1 = Transmission interrupt enable. - * @var CANFD_T::TXBCIE - * Offset: 0xE4 Tx Buffer Cancellation Finished Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CFIEn |Cancellation Finished Interrupt Enable - * | | |Each Tx Buffer has its own Cancellation Finished Interrupt Enable bit. - * | | |0 = Cancellation finished interrupt disabled. - * | | |1 = Cancellation finished interrupt enabled. - * @var CANFD_T::TXEFC - * Offset: 0xF0 Tx Event FIFO Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |EFSA |Event FIFO Start Address - * | | |Start address of Tx Event FIFO in Message RAM (32-bit word address, refer to Figure 1.1-11). - * |[21:16] |EFS |Event FIFO Size - * | | |0= Tx Event FIFO disabled. - * | | |1-32= Number of Tx Event FIFO elements. - * | | |>32= Values greater than 32 are interpreted as 32. - * | | |The Tx Event FIFO elements are indexed from 0 to EFS - 1. - * |[29:24] |EFWN |Event FIFO Watermark - * | | |0 = Watermark interrupt disabled. - * | | |1-32= Level for Tx Event FIFO watermark interrupt (TEFW (CANFD_IR[13])). - * | | |>32= Watermark interrupt disabled. - * @var CANFD_T::TXEFS - * Offset: 0xF4 Tx Event FIFO Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |EFFL |Event FIFO Fill Level - * | | |Number of elements stored in Tx Event FIFO, range 0 to 32. - * |[12:8] |EFG |Event FIFO Get Index - * | | |Tx Event FIFO read index pointer, range 0 to 31. - * |[20:16] |EFP |Event FIFO Put Index - * | | |Tx Event FIFO write index pointer, range 0 to 31. - * |[24] |EFF |Event FIFO Full - * | | |0= Tx Event FIFO not full. - * | | |1= Tx Event FIFO full. - * |[25] |TEFL |Tx Event FIFO Element Lost - * | | |This bit is a copy of interrupt flag TEFL (CANFD_IR[15]). - * | | |When TEFL is reset, this bit is also reset. - * | | |0= No Tx Event FIFO element lost. - * | | |1= Tx Event FIFO element lost, also set after write attempt to Tx Event FIFO of size zero. - * @var CANFD_T::TXEFA - * Offset: 0xF8 Tx Event FIFO Acknowledge - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |EFA |Event FIFO Acknowledge Index - * | | |After the Host has read an element or a sequence of elements from the Tx Event FIFO it has to write the index of the last element read from Tx Event FIFO to EFAI. - * | | |This will set the Tx Event FIFO Get Index EFGI (CANFD_TXEFS[12:8]) to EFAI + 1 and update the Event FIFO Fill Level EFFL (CANFD_TXEFS[5:0]). - */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DBTP; /*!< [0x000c] Data Bit Timing & Prescaler Register */ - __IO uint32_t TEST; /*!< [0x0010] Test Register */ - __IO uint32_t RWD; /*!< [0x0014] RAM Watchdog */ - __IO uint32_t CCCR; /*!< [0x0018] CC Control Register */ - __IO uint32_t NBTP; /*!< [0x001c] Nominal Bit Timing & Prescaler Register */ - __IO uint32_t TSCC; /*!< [0x0020] Timestamp Counter Configuration */ - __IO uint32_t TSCV; /*!< [0x0024] Timestamp Counter Value */ - __IO uint32_t TOCC; /*!< [0x0028] Timeout Counter Configuration */ - __IO uint32_t TOCV; /*!< [0x002c] Timeout Counter Value */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[4]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t ECR; /*!< [0x0040] Error Counter Register */ - __I uint32_t PSR; /*!< [0x0044] Protocol Status Register */ - __IO uint32_t TDCR; /*!< [0x0048] Transmitter Delay Compensation Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t IR; /*!< [0x0050] Interrupt Register */ - __IO uint32_t IE; /*!< [0x0054] Interrupt Enable */ - __IO uint32_t ILS; /*!< [0x0058] Interrupt Line Select */ - __IO uint32_t ILE; /*!< [0x005c] Interrupt Line Enable */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t GFC; /*!< [0x0080] Global Filter Configuration */ - __IO uint32_t SIDFC; /*!< [0x0084] Standard ID Filter Configuration */ - __IO uint32_t XIDFC; /*!< [0x0088] Extended ID Filter Configuration */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t XIDAM; /*!< [0x0090] Extended ID AND Mask */ - __I uint32_t HPMS; /*!< [0x0094] High Priority Message Status */ - __IO uint32_t NDAT1; /*!< [0x0098] New Data 1 */ - __IO uint32_t NDAT2; /*!< [0x009c] New Data 2 */ - __IO uint32_t RXF0C; /*!< [0x00a0] Rx FIFO 0 Configuration */ - __IO uint32_t RXF0S; /*!< [0x00a4] Rx FIFO 0 Status */ - __IO uint32_t RXF0A; /*!< [0x00a8] Rx FIFO 0 Acknowledge */ - __IO uint32_t RXBC; /*!< [0x00ac] Rx Buffer Configuration */ - __IO uint32_t RXF1C; /*!< [0x00b0] Rx FIFO 1 Configuration */ - __IO uint32_t RXF1S; /*!< [0x00b4] Rx FIFO 1 Status */ - __IO uint32_t RXF1A; /*!< [0x00b8] Rx FIFO 1 Acknowledge */ - __IO uint32_t RXESC; /*!< [0x00bc] Rx Buffer / FIFO Element Size Configuration */ - __IO uint32_t TXBC; /*!< [0x00c0] Tx Buffer Configuration */ - __IO uint32_t TXFQS; /*!< [0x00c4] Tx FIFO/Queue Status */ - __IO uint32_t TXESC; /*!< [0x00c8] Tx Buffer Element Size Configuration */ - __IO uint32_t TXBRP; /*!< [0x00cc] Tx Buffer Request Pending */ - __IO uint32_t TXBAR; /*!< [0x00d0] Tx Buffer Add Request */ - __IO uint32_t TXBCR; /*!< [0x00d4] Tx Buffer Cancellation Request */ - __IO uint32_t TXBTO; /*!< [0x00d8] Tx Buffer Transmission Occurred */ - __IO uint32_t TXBCF; /*!< [0x00dc] Tx Buffer Cancellation Finished */ - __IO uint32_t TXBTIE; /*!< [0x00e0] Tx Buffer Transmission Interrupt Enable */ - __IO uint32_t TXBCIE; /*!< [0x00e4] Tx Buffer Cancellation Finished Interrupt Enable */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t TXEFC; /*!< [0x00f0] Tx Event FIFO Configuration */ - __IO uint32_t TXEFS; /*!< [0x00f4] Tx Event FIFO Status */ - __IO uint32_t TXEFA; /*!< [0x00f8] Tx Event FIFO Acknowledge */ - -} CANFD_T; - -/** - @addtogroup CANFD_CONST CAN FD Bit Field Definition - Constant Definitions for CAN FD Controller -@{ */ - -#define CANFD_DBTP_DSJW_Pos (0) /*!< CANFD_T::DBTP: DSJW Position */ -#define CANFD_DBTP_DSJW_Msk (0xful << CANFD_DBTP_DSJW_Pos) /*!< CANFD_T::DBTP: DSJW Mask */ - -#define CANFD_DBTP_DTSEG2_Pos (4) /*!< CANFD_T::DBTP: DTSEG2 Position */ -#define CANFD_DBTP_DTSEG2_Msk (0xful << CANFD_DBTP_DTSEG2_Pos) /*!< CANFD_T::DBTP: DTSEG2 Mask */ - -#define CANFD_DBTP_DTSEG1_Pos (8) /*!< CANFD_T::DBTP: DTSEG1 Position */ -#define CANFD_DBTP_DTSEG1_Msk (0x1ful << CANFD_DBTP_DTSEG1_Pos) /*!< CANFD_T::DBTP: DTSEG1 Mask */ - -#define CANFD_DBTP_DBRP_Pos (16) /*!< CANFD_T::DBTP: DBRP Position */ -#define CANFD_DBTP_DBRP_Msk (0x1ful << CANFD_DBTP_DBRP_Pos) /*!< CANFD_T::DBTP: DBRP Mask */ - -#define CANFD_DBTP_TDC_Pos (23) /*!< CANFD_T::DBTP: TDC Position */ -#define CANFD_DBTP_TDC_Msk (0x1ul << CANFD_DBTP_TDC_Pos) /*!< CANFD_T::DBTP: TDC Mask */ - -#define CANFD_TEST_LBCK_Pos (4) /*!< CANFD_T::TEST: LBCK Position */ -#define CANFD_TEST_LBCK_Msk (0x1ul << CANFD_TEST_LBCK_Pos) /*!< CANFD_T::TEST: LBCK Mask */ - -#define CANFD_TEST_TX_Pos (5) /*!< CANFD_T::TEST: TX Position */ -#define CANFD_TEST_TX_Msk (0x3ul << CANFD_TEST_TX_Pos) /*!< CANFD_T::TEST: TX Mask */ - -#define CANFD_TEST_RX_Pos (7) /*!< CANFD_T::TEST: RX Position */ -#define CANFD_TEST_RX_Msk (0x1ul << CANFD_TEST_RX_Pos) /*!< CANFD_T::TEST: RX Mask */ - -#define CANFD_RWD_WDC_Pos (0) /*!< CANFD_T::RWD: WDC Position */ -#define CANFD_RWD_WDC_Msk (0xfful << CANFD_RWD_WDC_Pos) /*!< CANFD_T::RWD: WDC Mask */ - -#define CANFD_RWD_WDV_Pos (8) /*!< CANFD_T::RWD: WDV Position */ -#define CANFD_RWD_WDV_Msk (0xfful << CANFD_RWD_WDV_Pos) /*!< CANFD_T::RWD: WDV Mask */ - -#define CANFD_CCCR_INIT_Pos (0) /*!< CANFD_T::CCCR: INIT Position */ -#define CANFD_CCCR_INIT_Msk (0x1ul << CANFD_CCCR_INIT_Pos) /*!< CANFD_T::CCCR: INIT Mask */ - -#define CANFD_CCCR_CCE_Pos (1) /*!< CANFD_T::CCCR: CCE Position */ -#define CANFD_CCCR_CCE_Msk (0x1ul << CANFD_CCCR_CCE_Pos) /*!< CANFD_T::CCCR: CCE Mask */ - -#define CANFD_CCCR_ASM_Pos (2) /*!< CANFD_T::CCCR: ASM Position */ -#define CANFD_CCCR_ASM_Msk (0x1ul << CANFD_CCCR_ASM_Pos) /*!< CANFD_T::CCCR: ASM Mask */ - -#define CANFD_CCCR_CSA_Pos (3) /*!< CANFD_T::CCCR: CSA Position */ -#define CANFD_CCCR_CSA_Msk (0x1ul << CANFD_CCCR_CSA_Pos) /*!< CANFD_T::CCCR: CSA Mask */ - -#define CANFD_CCCR_CSR_Pos (4) /*!< CANFD_T::CCCR: CSR Position */ -#define CANFD_CCCR_CSR_Msk (0x1ul << CANFD_CCCR_CSR_Pos) /*!< CANFD_T::CCCR: CSR Mask */ - -#define CANFD_CCCR_MON_Pos (5) /*!< CANFD_T::CCCR: MON Position */ -#define CANFD_CCCR_MON_Msk (0x1ul << CANFD_CCCR_MON_Pos) /*!< CANFD_T::CCCR: MON Mask */ - -#define CANFD_CCCR_DAR_Pos (6) /*!< CANFD_T::CCCR: DAR Position */ -#define CANFD_CCCR_DAR_Msk (0x1ul << CANFD_CCCR_DAR_Pos) /*!< CANFD_T::CCCR: DAR Mask */ - -#define CANFD_CCCR_TEST_Pos (7) /*!< CANFD_T::CCCR: TEST Position */ -#define CANFD_CCCR_TEST_Msk (0x1ul << CANFD_CCCR_TEST_Pos) /*!< CANFD_T::CCCR: TEST Mask */ - -#define CANFD_CCCR_FDOE_Pos (8) /*!< CANFD_T::CCCR: FDOE Position */ -#define CANFD_CCCR_FDOE_Msk (0x1ul << CANFD_CCCR_FDOE_Pos) /*!< CANFD_T::CCCR: FDOE Mask */ - -#define CANFD_CCCR_BRSE_Pos (9) /*!< CANFD_T::CCCR: BRSE Position */ -#define CANFD_CCCR_BRSE_Msk (0x1ul << CANFD_CCCR_BRSE_Pos) /*!< CANFD_T::CCCR: BRSE Mask */ - -#define CANFD_CCCR_PXHD_Pos (12) /*!< CANFD_T::CCCR: PXHD Position */ -#define CANFD_CCCR_PXHD_Msk (0x1ul << CANFD_CCCR_PXHD_Pos) /*!< CANFD_T::CCCR: PXHD Mask */ - -#define CANFD_CCCR_EFBI_Pos (13) /*!< CANFD_T::CCCR: EFBI Position */ -#define CANFD_CCCR_EFBI_Msk (0x1ul << CANFD_CCCR_EFBI_Pos) /*!< CANFD_T::CCCR: EFBI Mask */ - -#define CANFD_CCCR_TXP_Pos (14) /*!< CANFD_T::CCCR: TXP Position */ -#define CANFD_CCCR_TXP_Msk (0x1ul << CANFD_CCCR_TXP_Pos) /*!< CANFD_T::CCCR: TXP Mask */ - -#define CANFD_CCCR_NISO_Pos (15) /*!< CANFD_T::CCCR: NISO Position */ -#define CANFD_CCCR_NISO_Msk (0x1ul << CANFD_CCCR_NISO_Pos) /*!< CANFD_T::CCCR: NISO Mask */ - -#define CANFD_NBTP_NTSEG2_Pos (0) /*!< CANFD_T::NBTP: NTSEG2 Position */ -#define CANFD_NBTP_NTSEG2_Msk (0x7ful << CANFD_NBTP_NTSEG2_Pos) /*!< CANFD_T::NBTP: NTSEG2 Mask */ - -#define CANFD_NBTP_NTSEG1_Pos (8) /*!< CANFD_T::NBTP: NTSEG1 Position */ -#define CANFD_NBTP_NTSEG1_Msk (0xfful << CANFD_NBTP_NTSEG1_Pos) /*!< CANFD_T::NBTP: NTSEG1 Mask */ - -#define CANFD_NBTP_NBRP_Pos (16) /*!< CANFD_T::NBTP: NBRP Position */ -#define CANFD_NBTP_NBRP_Msk (0x1fful << CANFD_NBTP_NBRP_Pos) /*!< CANFD_T::NBTP: NBRP Mask */ - -#define CANFD_NBTP_NSJW_Pos (25) /*!< CANFD_T::NBTP: NSJW Position */ -#define CANFD_NBTP_NSJW_Msk (0x7ful << CANFD_NBTP_NSJW_Pos) /*!< CANFD_T::NBTP: NSJW Mask */ - -#define CANFD_TSCC_TSS_Pos (0) /*!< CANFD_T::TSCC: TSS Position */ -#define CANFD_TSCC_TSS_Msk (0x3ul << CANFD_TSCC_TSS_Pos) /*!< CANFD_T::TSCC: TSS Mask */ - -#define CANFD_TSCC_TCP_Pos (16) /*!< CANFD_T::TSCC: TCP Position */ -#define CANFD_TSCC_TCP_Msk (0xful << CANFD_TSCC_TCP_Pos) /*!< CANFD_T::TSCC: TCP Mask */ - -#define CANFD_TSCV_TSC_Pos (0) /*!< CANFD_T::TSCV: TSC Position */ -#define CANFD_TSCV_TSC_Msk (0xfffful << CANFD_TSCV_TSC_Pos) /*!< CANFD_T::TSCV: TSC Mask */ - -#define CANFD_TOCC_ETOC_Pos (0) /*!< CANFD_T::TOCC: ETOC Position */ -#define CANFD_TOCC_ETOC_Msk (0x1ul << CANFD_TOCC_ETOC_Pos) /*!< CANFD_T::TOCC: ETOC Mask */ - -#define CANFD_TOCC_TOS_Pos (1) /*!< CANFD_T::TOCC: TOS Position */ -#define CANFD_TOCC_TOS_Msk (0x3ul << CANFD_TOCC_TOS_Pos) /*!< CANFD_T::TOCC: TOS Mask */ - -#define CANFD_TOCC_TOP_Pos (16) /*!< CANFD_T::TOCC: TOP Position */ -#define CANFD_TOCC_TOP_Msk (0xfffful << CANFD_TOCC_TOP_Pos) /*!< CANFD_T::TOCC: TOP Mask */ - -#define CANFD_TOCV_TOC_Pos (0) /*!< CANFD_T::TOCV: TOC Position */ -#define CANFD_TOCV_TOC_Msk (0xfffful << CANFD_TOCV_TOC_Pos) /*!< CANFD_T::TOCV: TOC Mask */ - -#define CANFD_ECR_TEC_Pos (0) /*!< CANFD_T::ECR: TEC Position */ -#define CANFD_ECR_TEC_Msk (0xfful << CANFD_ECR_TEC_Pos) /*!< CANFD_T::ECR: TEC Mask */ - -#define CANFD_ECR_REC_Pos (8) /*!< CANFD_T::ECR: REC Position */ -#define CANFD_ECR_REC_Msk (0x7ful << CANFD_ECR_REC_Pos) /*!< CANFD_T::ECR: REC Mask */ - -#define CANFD_ECR_RP_Pos (15) /*!< CANFD_T::ECR: RP Position */ -#define CANFD_ECR_RP_Msk (0x1ul << CANFD_ECR_RP_Pos) /*!< CANFD_T::ECR: RP Mask */ - -#define CANFD_ECR_CEL_Pos (16) /*!< CANFD_T::ECR: CEL Position */ -#define CANFD_ECR_CEL_Msk (0xfful << CANFD_ECR_CEL_Pos) /*!< CANFD_T::ECR: CEL Mask */ - -#define CANFD_PSR_LEC_Pos (0) /*!< CANFD_T::PSR: LEC Position */ -#define CANFD_PSR_LEC_Msk (0x7ul << CANFD_PSR_LEC_Pos) /*!< CANFD_T::PSR: LEC Mask */ - -#define CANFD_PSR_ACT_Pos (3) /*!< CANFD_T::PSR: ACT Position */ -#define CANFD_PSR_ACT_Msk (0x3ul << CANFD_PSR_ACT_Pos) /*!< CANFD_T::PSR: ACT Mask */ - -#define CANFD_PSR_EP_Pos (5) /*!< CANFD_T::PSR: EP Position */ -#define CANFD_PSR_EP_Msk (0x1ul << CANFD_PSR_EP_Pos) /*!< CANFD_T::PSR: EP Mask */ - -#define CANFD_PSR_EW_Pos (6) /*!< CANFD_T::PSR: EW Position */ -#define CANFD_PSR_EW_Msk (0x1ul << CANFD_PSR_EW_Pos) /*!< CANFD_T::PSR: EW Mask */ - -#define CANFD_PSR_BO_Pos (7) /*!< CANFD_T::PSR: BO Position */ -#define CANFD_PSR_BO_Msk (0x1ul << CANFD_PSR_BO_Pos) /*!< CANFD_T::PSR: BO Mask */ - -#define CANFD_PSR_DLEC_Pos (8) /*!< CANFD_T::PSR: DLEC Position */ -#define CANFD_PSR_DLEC_Msk (0x7ul << CANFD_PSR_DLEC_Pos) /*!< CANFD_T::PSR: DLEC Mask */ - -#define CANFD_PSR_RESI_Pos (11) /*!< CANFD_T::PSR: RESI Position */ -#define CANFD_PSR_RESI_Msk (0x1ul << CANFD_PSR_RESI_Pos) /*!< CANFD_T::PSR: RESI Mask */ - -#define CANFD_PSR_RBRS_Pos (12) /*!< CANFD_T::PSR: RBRS Position */ -#define CANFD_PSR_RBRS_Msk (0x1ul << CANFD_PSR_RBRS_Pos) /*!< CANFD_T::PSR: RBRS Mask */ - -#define CANFD_PSR_RFDF_Pos (13) /*!< CANFD_T::PSR: RFDF Position */ -#define CANFD_PSR_RFDF_Msk (0x1ul << CANFD_PSR_RFDF_Pos) /*!< CANFD_T::PSR: RFDF Mask */ - -#define CANFD_PSR_PXE_Pos (14) /*!< CANFD_T::PSR: PXE Position */ -#define CANFD_PSR_PXE_Msk (0x1ul << CANFD_PSR_PXE_Pos) /*!< CANFD_T::PSR: PXE Mask */ - -#define CANFD_PSR_TDCV_Pos (16) /*!< CANFD_T::PSR: TDCV Position */ -#define CANFD_PSR_TDCV_Msk (0x7ful << CANFD_PSR_TDCV_Pos) /*!< CANFD_T::PSR: TDCV Mask */ - -#define CANFD_TDCR_TDCF_Pos (0) /*!< CANFD_T::TDCR: TDCF Position */ -#define CANFD_TDCR_TDCF_Msk (0x7ful << CANFD_TDCR_TDCF_Pos) /*!< CANFD_T::TDCR: TDCF Mask */ - -#define CANFD_TDCR_TDCO_Pos (8) /*!< CANFD_T::TDCR: TDCO Position */ -#define CANFD_TDCR_TDCO_Msk (0x7ful << CANFD_TDCR_TDCO_Pos) /*!< CANFD_T::TDCR: TDCO Mask */ - -#define CANFD_IR_RF0N_Pos (0) /*!< CANFD_T::IR: RF0N Position */ -#define CANFD_IR_RF0N_Msk (0x1ul << CANFD_IR_RF0N_Pos) /*!< CANFD_T::IR: RF0N Mask */ - -#define CANFD_IR_RF0W_Pos (1) /*!< CANFD_T::IR: RF0W Position */ -#define CANFD_IR_RF0W_Msk (0x1ul << CANFD_IR_RF0W_Pos) /*!< CANFD_T::IR: RF0W Mask */ - -#define CANFD_IR_RF0F_Pos (2) /*!< CANFD_T::IR: RF0F Position */ -#define CANFD_IR_RF0F_Msk (0x1ul << CANFD_IR_RF0F_Pos) /*!< CANFD_T::IR: RF0F Mask */ - -#define CANFD_IR_RF0L_Pos (3) /*!< CANFD_T::IR: RF0L Position */ -#define CANFD_IR_RF0L_Msk (0x1ul << CANFD_IR_RF0L_Pos) /*!< CANFD_T::IR: RF0L Mask */ - -#define CANFD_IR_RF1N_Pos (4) /*!< CANFD_T::IR: RF1N Position */ -#define CANFD_IR_RF1N_Msk (0x1ul << CANFD_IR_RF1N_Pos) /*!< CANFD_T::IR: RF1N Mask */ - -#define CANFD_IR_RF1W_Pos (5) /*!< CANFD_T::IR: RF1W Position */ -#define CANFD_IR_RF1W_Msk (0x1ul << CANFD_IR_RF1W_Pos) /*!< CANFD_T::IR: RF1W Mask */ - -#define CANFD_IR_RF1F_Pos (6) /*!< CANFD_T::IR: RF1F Position */ -#define CANFD_IR_RF1F_Msk (0x1ul << CANFD_IR_RF1F_Pos) /*!< CANFD_T::IR: RF1F Mask */ - -#define CANFD_IR_RF1L_Pos (7) /*!< CANFD_T::IR: RF1L Position */ -#define CANFD_IR_RF1L_Msk (0x1ul << CANFD_IR_RF1L_Pos) /*!< CANFD_T::IR: RF1L Mask */ - -#define CANFD_IR_HPM_Pos (8) /*!< CANFD_T::IR: HPM Position */ -#define CANFD_IR_HPM_Msk (0x1ul << CANFD_IR_HPM_Pos) /*!< CANFD_T::IR: HPM Mask */ - -#define CANFD_IR_TC_Pos (9) /*!< CANFD_T::IR: TC Position */ -#define CANFD_IR_TC_Msk (0x1ul << CANFD_IR_TC_Pos) /*!< CANFD_T::IR: TC Mask */ - -#define CANFD_IR_TCF_Pos (10) /*!< CANFD_T::IR: TCF Position */ -#define CANFD_IR_TCF_Msk (0x1ul << CANFD_IR_TCF_Pos) /*!< CANFD_T::IR: TCF Mask */ - -#define CANFD_IR_TFE_Pos (11) /*!< CANFD_T::IR: TFE Position */ -#define CANFD_IR_TFE_Msk (0x1ul << CANFD_IR_TFE_Pos) /*!< CANFD_T::IR: TFE Mask */ - -#define CANFD_IR_TEFN_Pos (12) /*!< CANFD_T::IR: TEFN Position */ -#define CANFD_IR_TEFN_Msk (0x1ul << CANFD_IR_TEFN_Pos) /*!< CANFD_T::IR: TEFN Mask */ - -#define CANFD_IR_TEFW_Pos (13) /*!< CANFD_T::IR: TEFW Position */ -#define CANFD_IR_TEFW_Msk (0x1ul << CANFD_IR_TEFW_Pos) /*!< CANFD_T::IR: TEFW Mask */ - -#define CANFD_IR_TEFF_Pos (14) /*!< CANFD_T::IR: TEFF Position */ -#define CANFD_IR_TEFF_Msk (0x1ul << CANFD_IR_TEFF_Pos) /*!< CANFD_T::IR: TEFF Mask */ - -#define CANFD_IR_TEFL_Pos (15) /*!< CANFD_T::IR: TEFL Position */ -#define CANFD_IR_TEFL_Msk (0x1ul << CANFD_IR_TEFL_Pos) /*!< CANFD_T::IR: TEFL Mask */ - -#define CANFD_IR_TSW_Pos (16) /*!< CANFD_T::IR: TSW Position */ -#define CANFD_IR_TSW_Msk (0x1ul << CANFD_IR_TSW_Pos) /*!< CANFD_T::IR: TSW Mask */ - -#define CANFD_IR_MRAF_Pos (17) /*!< CANFD_T::IR: MRAF Position */ -#define CANFD_IR_MRAF_Msk (0x1ul << CANFD_IR_MRAF_Pos) /*!< CANFD_T::IR: MRAF Mask */ - -#define CANFD_IR_TOO_Pos (18) /*!< CANFD_T::IR: TOO Position */ -#define CANFD_IR_TOO_Msk (0x1ul << CANFD_IR_TOO_Pos) /*!< CANFD_T::IR: TOO Mask */ - -#define CANFD_IR_DRX_Pos (19) /*!< CANFD_T::IR: DRX Position */ -#define CANFD_IR_DRX_Msk (0x1ul << CANFD_IR_DRX_Pos) /*!< CANFD_T::IR: DRX Mask */ - -#define CANFD_IR_ELO_Pos (22) /*!< CANFD_T::IR: ELO Position */ -#define CANFD_IR_ELO_Msk (0x1ul << CANFD_IR_ELO_Pos) /*!< CANFD_T::IR: ELO Mask */ - -#define CANFD_IR_EP_Pos (23) /*!< CANFD_T::IR: EP Position */ -#define CANFD_IR_EP_Msk (0x1ul << CANFD_IR_EP_Pos) /*!< CANFD_T::IR: EP Mask */ - -#define CANFD_IR_EW_Pos (24) /*!< CANFD_T::IR: EW Position */ -#define CANFD_IR_EW_Msk (0x1ul << CANFD_IR_EW_Pos) /*!< CANFD_T::IR: EW Mask */ - -#define CANFD_IR_BO_Pos (25) /*!< CANFD_T::IR: BO Position */ -#define CANFD_IR_BO_Msk (0x1ul << CANFD_IR_BO_Pos) /*!< CANFD_T::IR: BO Mask */ - -#define CANFD_IR_WDI_Pos (26) /*!< CANFD_T::IR: WDI Position */ -#define CANFD_IR_WDI_Msk (0x1ul << CANFD_IR_WDI_Pos) /*!< CANFD_T::IR: WDI Mask */ - -#define CANFD_IR_PEA_Pos (27) /*!< CANFD_T::IR: PEA Position */ -#define CANFD_IR_PEA_Msk (0x1ul << CANFD_IR_PEA_Pos) /*!< CANFD_T::IR: PEA Mask */ - -#define CANFD_IR_PED_Pos (28) /*!< CANFD_T::IR: PED Position */ -#define CANFD_IR_PED_Msk (0x1ul << CANFD_IR_PED_Pos) /*!< CANFD_T::IR: PED Mask */ - -#define CANFD_IR_ARA_Pos (29) /*!< CANFD_T::IR: ARA Position */ -#define CANFD_IR_ARA_Msk (0x1ul << CANFD_IR_ARA_Pos) /*!< CANFD_T::IR: ARA Mask */ - -#define CANFD_IE_RF0NE_Pos (0) /*!< CANFD_T::IE: RF0NE Position */ -#define CANFD_IE_RF0NE_Msk (0x1ul << CANFD_IE_RF0NE_Pos) /*!< CANFD_T::IE: RF0NE Mask */ - -#define CANFD_IE_RF0WE_Pos (1) /*!< CANFD_T::IE: RF0WE Position */ -#define CANFD_IE_RF0WE_Msk (0x1ul << CANFD_IE_RF0WE_Pos) /*!< CANFD_T::IE: RF0WE Mask */ - -#define CANFD_IE_RF0FE_Pos (2) /*!< CANFD_T::IE: RF0FE Position */ -#define CANFD_IE_RF0FE_Msk (0x1ul << CANFD_IE_RF0FE_Pos) /*!< CANFD_T::IE: RF0FE Mask */ - -#define CANFD_IE_RF0LE_Pos (3) /*!< CANFD_T::IE: RF0LE Position */ -#define CANFD_IE_RF0LE_Msk (0x1ul << CANFD_IE_RF0LE_Pos) /*!< CANFD_T::IE: RF0LE Mask */ - -#define CANFD_IE_RF1NE_Pos (4) /*!< CANFD_T::IE: RF1NE Position */ -#define CANFD_IE_RF1NE_Msk (0x1ul << CANFD_IE_RF1NE_Pos) /*!< CANFD_T::IE: RF1NE Mask */ - -#define CANFD_IE_RF1WE_Pos (5) /*!< CANFD_T::IE: RF1WE Position */ -#define CANFD_IE_RF1WE_Msk (0x1ul << CANFD_IE_RF1WE_Pos) /*!< CANFD_T::IE: RF1WE Mask */ - -#define CANFD_IE_RF1FE_Pos (6) /*!< CANFD_T::IE: RF1FE Position */ -#define CANFD_IE_RF1FE_Msk (0x1ul << CANFD_IE_RF1FE_Pos) /*!< CANFD_T::IE: RF1FE Mask */ - -#define CANFD_IE_RF1LE_Pos (7) /*!< CANFD_T::IE: RF1LE Position */ -#define CANFD_IE_RF1LE_Msk (0x1ul << CANFD_IE_RF1LE_Pos) /*!< CANFD_T::IE: RF1LE Mask */ - -#define CANFD_IE_HPME_Pos (8) /*!< CANFD_T::IE: HPME Position */ -#define CANFD_IE_HPME_Msk (0x1ul << CANFD_IE_HPME_Pos) /*!< CANFD_T::IE: HPME Mask */ - -#define CANFD_IE_TCE_Pos (9) /*!< CANFD_T::IE: TCE Position */ -#define CANFD_IE_TCE_Msk (0x1ul << CANFD_IE_TCE_Pos) /*!< CANFD_T::IE: TCE Mask */ - -#define CANFD_IE_TCFE_Pos (10) /*!< CANFD_T::IE: TCFE Position */ -#define CANFD_IE_TCFE_Msk (0x1ul << CANFD_IE_TCFE_Pos) /*!< CANFD_T::IE: TCFE Mask */ - -#define CANFD_IE_TFEE_Pos (11) /*!< CANFD_T::IE: TFEE Position */ -#define CANFD_IE_TFEE_Msk (0x1ul << CANFD_IE_TFEE_Pos) /*!< CANFD_T::IE: TFEE Mask */ - -#define CANFD_IE_TEFNE_Pos (12) /*!< CANFD_T::IE: TEFNE Position */ -#define CANFD_IE_TEFNE_Msk (0x1ul << CANFD_IE_TEFNE_Pos) /*!< CANFD_T::IE: TEFNE Mask */ - -#define CANFD_IE_TEFWE_Pos (13) /*!< CANFD_T::IE: TEFWE Position */ -#define CANFD_IE_TEFWE_Msk (0x1ul << CANFD_IE_TEFWE_Pos) /*!< CANFD_T::IE: TEFWE Mask */ - -#define CANFD_IE_TEFFE_Pos (14) /*!< CANFD_T::IE: TEFFE Position */ -#define CANFD_IE_TEFFE_Msk (0x1ul << CANFD_IE_TEFFE_Pos) /*!< CANFD_T::IE: TEFFE Mask */ - -#define CANFD_IE_TEFLE_Pos (15) /*!< CANFD_T::IE: TEFLE Position */ -#define CANFD_IE_TEFLE_Msk (0x1ul << CANFD_IE_TEFLE_Pos) /*!< CANFD_T::IE: TEFLE Mask */ - -#define CANFD_IE_TSWE_Pos (16) /*!< CANFD_T::IE: TSWE Position */ -#define CANFD_IE_TSWE_Msk (0x1ul << CANFD_IE_TSWE_Pos) /*!< CANFD_T::IE: TSWE Mask */ - -#define CANFD_IE_MRAFE_Pos (17) /*!< CANFD_T::IE: MRAFE Position */ -#define CANFD_IE_MRAFE_Msk (0x1ul << CANFD_IE_MRAFE_Pos) /*!< CANFD_T::IE: MRAFE Mask */ - -#define CANFD_IE_TOOE_Pos (18) /*!< CANFD_T::IE: TOOE Position */ -#define CANFD_IE_TOOE_Msk (0x1ul << CANFD_IE_TOOE_Pos) /*!< CANFD_T::IE: TOOE Mask */ - -#define CANFD_IE_DRXE_Pos (19) /*!< CANFD_T::IE: DRXE Position */ -#define CANFD_IE_DRXE_Msk (0x1ul << CANFD_IE_DRXE_Pos) /*!< CANFD_T::IE: DRXE Mask */ - -#define CANFD_IE_BECE_Pos (20) /*!< CANFD_T::IE: BECE Position */ -#define CANFD_IE_BECE_Msk (0x1ul << CANFD_IE_BECE_Pos) /*!< CANFD_T::IE: BECE Mask */ - -#define CANFD_IE_BEUE_Pos (21) /*!< CANFD_T::IE: BEUE Position */ -#define CANFD_IE_BEUE_Msk (0x1ul << CANFD_IE_BEUE_Pos) /*!< CANFD_T::IE: BEUE Mask */ - -#define CANFD_IE_ELOE_Pos (22) /*!< CANFD_T::IE: ELOE Position */ -#define CANFD_IE_ELOE_Msk (0x1ul << CANFD_IE_ELOE_Pos) /*!< CANFD_T::IE: ELOE Mask */ - -#define CANFD_IE_EPE_Pos (23) /*!< CANFD_T::IE: EPE Position */ -#define CANFD_IE_EPE_Msk (0x1ul << CANFD_IE_EPE_Pos) /*!< CANFD_T::IE: EPE Mask */ - -#define CANFD_IE_EWE_Pos (24) /*!< CANFD_T::IE: EWE Position */ -#define CANFD_IE_EWE_Msk (0x1ul << CANFD_IE_EWE_Pos) /*!< CANFD_T::IE: EWE Mask */ - -#define CANFD_IE_BOE_Pos (25) /*!< CANFD_T::IE: BOE Position */ -#define CANFD_IE_BOE_Msk (0x1ul << CANFD_IE_BOE_Pos) /*!< CANFD_T::IE: BOE Mask */ - -#define CANFD_IE_WDIE_Pos (26) /*!< CANFD_T::IE: WDIE Position */ -#define CANFD_IE_WDIE_Msk (0x1ul << CANFD_IE_WDIE_Pos) /*!< CANFD_T::IE: WDIE Mask */ - -#define CANFD_IE_PEAE_Pos (27) /*!< CANFD_T::IE: PEAE Position */ -#define CANFD_IE_PEAE_Msk (0x1ul << CANFD_IE_PEAE_Pos) /*!< CANFD_T::IE: PEAE Mask */ - -#define CANFD_IE_PEDE_Pos (28) /*!< CANFD_T::IE: PEDE Position */ -#define CANFD_IE_PEDE_Msk (0x1ul << CANFD_IE_PEDE_Pos) /*!< CANFD_T::IE: PEDE Mask */ - -#define CANFD_IE_ARAE_Pos (29) /*!< CANFD_T::IE: ARAE Position */ -#define CANFD_IE_ARAE_Msk (0x1ul << CANFD_IE_ARAE_Pos) /*!< CANFD_T::IE: ARAE Mask */ - -#define CANFD_ILS_RF0NL_Pos (0) /*!< CANFD_T::ILS: RF0NL Position */ -#define CANFD_ILS_RF0NL_Msk (0x1ul << CANFD_ILS_RF0NL_Pos) /*!< CANFD_T::ILS: RF0NL Mask */ - -#define CANFD_ILS_RF0WL_Pos (1) /*!< CANFD_T::ILS: RF0WL Position */ -#define CANFD_ILS_RF0WL_Msk (0x1ul << CANFD_ILS_RF0WL_Pos) /*!< CANFD_T::ILS: RF0WL Mask */ - -#define CANFD_ILS_RF0FL_Pos (2) /*!< CANFD_T::ILS: RF0FL Position */ -#define CANFD_ILS_RF0FL_Msk (0x1ul << CANFD_ILS_RF0FL_Pos) /*!< CANFD_T::ILS: RF0FL Mask */ - -#define CANFD_ILS_RF0LL_Pos (3) /*!< CANFD_T::ILS: RF0LL Position */ -#define CANFD_ILS_RF0LL_Msk (0x1ul << CANFD_ILS_RF0LL_Pos) /*!< CANFD_T::ILS: RF0LL Mask */ - -#define CANFD_ILS_RF1NL_Pos (4) /*!< CANFD_T::ILS: RF1NL Position */ -#define CANFD_ILS_RF1NL_Msk (0x1ul << CANFD_ILS_RF1NL_Pos) /*!< CANFD_T::ILS: RF1NL Mask */ - -#define CANFD_ILS_RF1WL_Pos (5) /*!< CANFD_T::ILS: RF1WL Position */ -#define CANFD_ILS_RF1WL_Msk (0x1ul << CANFD_ILS_RF1WL_Pos) /*!< CANFD_T::ILS: RF1WL Mask */ - -#define CANFD_ILS_RF1FL_Pos (6) /*!< CANFD_T::ILS: RF1FL Position */ -#define CANFD_ILS_RF1FL_Msk (0x1ul << CANFD_ILS_RF1FL_Pos) /*!< CANFD_T::ILS: RF1FL Mask */ - -#define CANFD_ILS_RF1LL_Pos (7) /*!< CANFD_T::ILS: RF1LL Position */ -#define CANFD_ILS_RF1LL_Msk (0x1ul << CANFD_ILS_RF1LL_Pos) /*!< CANFD_T::ILS: RF1LL Mask */ - -#define CANFD_ILS_HPML_Pos (8) /*!< CANFD_T::ILS: HPML Position */ -#define CANFD_ILS_HPML_Msk (0x1ul << CANFD_ILS_HPML_Pos) /*!< CANFD_T::ILS: HPML Mask */ - -#define CANFD_ILS_TCL_Pos (9) /*!< CANFD_T::ILS: TCL Position */ -#define CANFD_ILS_TCL_Msk (0x1ul << CANFD_ILS_TCL_Pos) /*!< CANFD_T::ILS: TCL Mask */ - -#define CANFD_ILS_TCFL_Pos (10) /*!< CANFD_T::ILS: TCFL Position */ -#define CANFD_ILS_TCFL_Msk (0x1ul << CANFD_ILS_TCFL_Pos) /*!< CANFD_T::ILS: TCFL Mask */ - -#define CANFD_ILS_TFEL_Pos (11) /*!< CANFD_T::ILS: TFEL Position */ -#define CANFD_ILS_TFEL_Msk (0x1ul << CANFD_ILS_TFEL_Pos) /*!< CANFD_T::ILS: TFEL Mask */ - -#define CANFD_ILS_TEFNL_Pos (12) /*!< CANFD_T::ILS: TEFNL Position */ -#define CANFD_ILS_TEFNL_Msk (0x1ul << CANFD_ILS_TEFNL_Pos) /*!< CANFD_T::ILS: TEFNL Mask */ - -#define CANFD_ILS_TEFWL_Pos (13) /*!< CANFD_T::ILS: TEFWL Position */ -#define CANFD_ILS_TEFWL_Msk (0x1ul << CANFD_ILS_TEFWL_Pos) /*!< CANFD_T::ILS: TEFWL Mask */ - -#define CANFD_ILS_TEFFL_Pos (14) /*!< CANFD_T::ILS: TEFFL Position */ -#define CANFD_ILS_TEFFL_Msk (0x1ul << CANFD_ILS_TEFFL_Pos) /*!< CANFD_T::ILS: TEFFL Mask */ - -#define CANFD_ILS_TEFLL_Pos (15) /*!< CANFD_T::ILS: TEFLL Position */ -#define CANFD_ILS_TEFLL_Msk (0x1ul << CANFD_ILS_TEFLL_Pos) /*!< CANFD_T::ILS: TEFLL Mask */ - -#define CANFD_ILS_TSWL_Pos (16) /*!< CANFD_T::ILS: TSWL Position */ -#define CANFD_ILS_TSWL_Msk (0x1ul << CANFD_ILS_TSWL_Pos) /*!< CANFD_T::ILS: TSWL Mask */ - -#define CANFD_ILS_MRAFL_Pos (17) /*!< CANFD_T::ILS: MRAFL Position */ -#define CANFD_ILS_MRAFL_Msk (0x1ul << CANFD_ILS_MRAFL_Pos) /*!< CANFD_T::ILS: MRAFL Mask */ - -#define CANFD_ILS_TOOL_Pos (18) /*!< CANFD_T::ILS: TOOL Position */ -#define CANFD_ILS_TOOL_Msk (0x1ul << CANFD_ILS_TOOL_Pos) /*!< CANFD_T::ILS: TOOL Mask */ - -#define CANFD_ILS_DRXL_Pos (19) /*!< CANFD_T::ILS: DRXL Position */ -#define CANFD_ILS_DRXL_Msk (0x1ul << CANFD_ILS_DRXL_Pos) /*!< CANFD_T::ILS: DRXL Mask */ - -#define CANFD_ILS_ELOL_Pos (22) /*!< CANFD_T::ILS: ELOL Position */ -#define CANFD_ILS_ELOL_Msk (0x1ul << CANFD_ILS_ELOL_Pos) /*!< CANFD_T::ILS: ELOL Mask */ - -#define CANFD_ILS_EPL_Pos (23) /*!< CANFD_T::ILS: EPL Position */ -#define CANFD_ILS_EPL_Msk (0x1ul << CANFD_ILS_EPL_Pos) /*!< CANFD_T::ILS: EPL Mask */ - -#define CANFD_ILS_EWL_Pos (24) /*!< CANFD_T::ILS: EWL Position */ -#define CANFD_ILS_EWL_Msk (0x1ul << CANFD_ILS_EWL_Pos) /*!< CANFD_T::ILS: EWL Mask */ - -#define CANFD_ILS_BOL_Pos (25) /*!< CANFD_T::ILS: BOL Position */ -#define CANFD_ILS_BOL_Msk (0x1ul << CANFD_ILS_BOL_Pos) /*!< CANFD_T::ILS: BOL Mask */ - -#define CANFD_ILS_WDIL_Pos (26) /*!< CANFD_T::ILS: WDIL Position */ -#define CANFD_ILS_WDIL_Msk (0x1ul << CANFD_ILS_WDIL_Pos) /*!< CANFD_T::ILS: WDIL Mask */ - -#define CANFD_ILS_PEAL_Pos (27) /*!< CANFD_T::ILS: PEAL Position */ -#define CANFD_ILS_PEAL_Msk (0x1ul << CANFD_ILS_PEAL_Pos) /*!< CANFD_T::ILS: PEAL Mask */ - -#define CANFD_ILS_PEDL_Pos (28) /*!< CANFD_T::ILS: PEDL Position */ -#define CANFD_ILS_PEDL_Msk (0x1ul << CANFD_ILS_PEDL_Pos) /*!< CANFD_T::ILS: PEDL Mask */ - -#define CANFD_ILS_ARAL_Pos (29) /*!< CANFD_T::ILS: ARAL Position */ -#define CANFD_ILS_ARAL_Msk (0x1ul << CANFD_ILS_ARAL_Pos) /*!< CANFD_T::ILS: ARAL Mask */ - -#define CANFD_ILE_ENT0_Pos (0) /*!< CANFD_T::ILE: ENT0 Position */ -#define CANFD_ILE_ENT0_Msk (0x1ul << CANFD_ILE_ENT0_Pos) /*!< CANFD_T::ILE: ENT0 Mask */ - -#define CANFD_ILE_ENT1_Pos (1) /*!< CANFD_T::ILE: ENT1 Position */ -#define CANFD_ILE_ENT1_Msk (0x1ul << CANFD_ILE_ENT1_Pos) /*!< CANFD_T::ILE: ENT1 Mask */ - -#define CANFD_GFC_RRFE_Pos (0) /*!< CANFD_T::GFC: RRFE Position */ -#define CANFD_GFC_RRFE_Msk (0x1ul << CANFD_GFC_RRFE_Pos) /*!< CANFD_T::GFC: RRFE Mask */ - -#define CANFD_GFC_RRFS_Pos (1) /*!< CANFD_T::GFC: RRFS Position */ -#define CANFD_GFC_RRFS_Msk (0x1ul << CANFD_GFC_RRFS_Pos) /*!< CANFD_T::GFC: RRFS Mask */ - -#define CANFD_GFC_ANFE_Pos (2) /*!< CANFD_T::GFC: ANFE Position */ -#define CANFD_GFC_ANFE_Msk (0x3ul << CANFD_GFC_ANFE_Pos) /*!< CANFD_T::GFC: ANFE Mask */ - -#define CANFD_GFC_ANFS_Pos (4) /*!< CANFD_T::GFC: ANFS Position */ -#define CANFD_GFC_ANFS_Msk (0x3ul << CANFD_GFC_ANFS_Pos) /*!< CANFD_T::GFC: ANFS Mask */ - -#define CANFD_SIDFC_FLSSA_Pos (2) /*!< CANFD_T::SIDFC: FLSSA Position */ -#define CANFD_SIDFC_FLSSA_Msk (0x3ffful << CANFD_SIDFC_FLSSA_Pos) /*!< CANFD_T::SIDFC: FLSSA Mask */ - -#define CANFD_SIDFC_LSS_Pos (16) /*!< CANFD_T::SIDFC: LSS Position */ -#define CANFD_SIDFC_LSS_Msk (0xfful << CANFD_SIDFC_LSS_Pos) /*!< CANFD_T::SIDFC: LSS Mask */ - -#define CANFD_XIDFC_FLESA_Pos (2) /*!< CANFD_T::XIDFC: FLESA Position */ -#define CANFD_XIDFC_FLESA_Msk (0x3ffful << CANFD_XIDFC_FLESA_Pos) /*!< CANFD_T::XIDFC: FLESA Mask */ - -#define CANFD_XIDFC_LSE_Pos (16) /*!< CANFD_T::XIDFC: LSE Position */ -#define CANFD_XIDFC_LSE_Msk (0x7ful << CANFD_XIDFC_LSE_Pos) /*!< CANFD_T::XIDFC: LSE Mask */ - -#define CANFD_XIDAM_EIDM_Pos (0) /*!< CANFD_T::XIDAM: EIDM Position */ -#define CANFD_XIDAM_EIDM_Msk (0x1ffffffful << CANFD_XIDAM_EIDM_Pos) /*!< CANFD_T::XIDAM: EIDM Mask */ - -#define CANFD_HPMS_BIDX_Pos (0) /*!< CANFD_T::HPMS: BIDX Position */ -#define CANFD_HPMS_BIDX_Msk (0x3ful << CANFD_HPMS_BIDX_Pos) /*!< CANFD_T::HPMS: BIDX Mask */ - -#define CANFD_HPMS_MSI_Pos (6) /*!< CANFD_T::HPMS: MSI Position */ -#define CANFD_HPMS_MSI_Msk (0x3ul << CANFD_HPMS_MSI_Pos) /*!< CANFD_T::HPMS: MSI Mask */ - -#define CANFD_HPMS_FIDX_Pos (8) /*!< CANFD_T::HPMS: FIDX Position */ -#define CANFD_HPMS_FIDX_Msk (0x7ful << CANFD_HPMS_FIDX_Pos) /*!< CANFD_T::HPMS: FIDX Mask */ - -#define CANFD_HPMS_FLST_Pos (15) /*!< CANFD_T::HPMS: FLST Position */ -#define CANFD_HPMS_FLST_Msk (0x1ul << CANFD_HPMS_FLST_Pos) /*!< CANFD_T::HPMS: FLST Mask */ - -#define CANFD_NDAT1_NDn_Pos (0) /*!< CANFD_T::NDAT1: NDn Position */ -#define CANFD_NDAT1_NDn_Msk (0xfffffffful << CANFD_NDAT1_NDn_Pos) /*!< CANFD_T::NDAT1: NDn Mask */ - -#define CANFD_NDAT2_NDn_Pos (0) /*!< CANFD_T::NDAT2: NDn Position */ -#define CANFD_NDAT2_NDn_Msk (0xfffffffful << CANFD_NDAT2_NDn_Pos) /*!< CANFD_T::NDAT2: NDn Mask */ - -#define CANFD_RXF0C_F0SA_Pos (2) /*!< CANFD_T::RXF0C: F0SA Position */ -#define CANFD_RXF0C_F0SA_Msk (0x3ffful << CANFD_RXF0C_F0SA_Pos) /*!< CANFD_T::RXF0C: F0SA Mask */ - -#define CANFD_RXF0C_F0S_Pos (16) /*!< CANFD_T::RXF0C: F0S Position */ -#define CANFD_RXF0C_F0S_Msk (0x7ful << CANFD_RXF0C_F0S_Pos) /*!< CANFD_T::RXF0C: F0S Mask */ - -#define CANFD_RXF0C_F0WM_Pos (24) /*!< CANFD_T::RXF0C: F0WM Position */ -#define CANFD_RXF0C_F0WM_Msk (0x7ful << CANFD_RXF0C_F0WM_Pos) /*!< CANFD_T::RXF0C: F0WM Mask */ - -#define CANFD_RXF0C_F0OM_Pos (31) /*!< CANFD_T::RXF0C: F0OM Position */ -#define CANFD_RXF0C_F0OM_Msk (0x1ul << CANFD_RXF0C_F0OM_Pos) /*!< CANFD_T::RXF0C: F0OM Mask */ - -#define CANFD_RXF0S_F0FL_Pos (0) /*!< CANFD_T::RXF0S: F0FL Position */ -#define CANFD_RXF0S_F0FL_Msk (0x7ful << CANFD_RXF0S_F0FL_Pos) /*!< CANFD_T::RXF0S: F0FL Mask */ - -#define CANFD_RXF0S_F0GI_Pos (8) /*!< CANFD_T::RXF0S: F0GI Position */ -#define CANFD_RXF0S_F0GI_Msk (0x3ful << CANFD_RXF0S_F0GI_Pos) /*!< CANFD_T::RXF0S: F0GI Mask */ - -#define CANFD_RXF0S_F0PI_Pos (16) /*!< CANFD_T::RXF0S: F0PI Position */ -#define CANFD_RXF0S_F0PI_Msk (0x3ful << CANFD_RXF0S_F0PI_Pos) /*!< CANFD_T::RXF0S: F0PI Mask */ - -#define CANFD_RXF0S_F0F_Pos (24) /*!< CANFD_T::RXF0S: F0F Position */ -#define CANFD_RXF0S_F0F_Msk (0x1ul << CANFD_RXF0S_F0F_Pos) /*!< CANFD_T::RXF0S: F0F Mask */ - -#define CANFD_RXF0S_RF0L_Pos (25) /*!< CANFD_T::RXF0S: RF0L Position */ -#define CANFD_RXF0S_RF0L_Msk (0x1ul << CANFD_RXF0S_RF0L_Pos) /*!< CANFD_T::RXF0S: RF0L Mask */ - -#define CANFD_RXF0A_F0A_Pos (0) /*!< CANFD_T::RXF0A: F0A Position */ -#define CANFD_RXF0A_F0A_Msk (0x3ful << CANFD_RXF0A_F0A_Pos) /*!< CANFD_T::RXF0A: F0A Mask */ - -#define CANFD_RXBC_RBSA_Pos (2) /*!< CANFD_T::RXBC: RBSA Position */ -#define CANFD_RXBC_RBSA_Msk (0x3ffful << CANFD_RXBC_RBSA_Pos) /*!< CANFD_T::RXBC: RBSA Mask */ - -#define CANFD_RXF1C_F1SA_Pos (2) /*!< CANFD_T::RXF1C: F1SA Position */ -#define CANFD_RXF1C_F1SA_Msk (0x3ffful << CANFD_RXF1C_F1SA_Pos) /*!< CANFD_T::RXF1C: F1SA Mask */ - -#define CANFD_RXF1C_F1S_Pos (16) /*!< CANFD_T::RXF1C: F1S Position */ -#define CANFD_RXF1C_F1S_Msk (0x7ful << CANFD_RXF1C_F1S_Pos) /*!< CANFD_T::RXF1C: F1S Mask */ - -#define CANFD_RXF1C_F1WM_Pos (24) /*!< CANFD_T::RXF1C: F1WM Position */ -#define CANFD_RXF1C_F1WM_Msk (0x7ful << CANFD_RXF1C_F1WM_Pos) /*!< CANFD_T::RXF1C: F1WM Mask */ - -#define CANFD_RXF1C_F1OM_Pos (31) /*!< CANFD_T::RXF1C: F1OM Position */ -#define CANFD_RXF1C_F1OM_Msk (0x1ul << CANFD_RXF1C_F1OM_Pos) /*!< CANFD_T::RXF1C: F1OM Mask */ - -#define CANFD_RXF1S_F1FL_Pos (0) /*!< CANFD_T::RXF1S: F1FL Position */ -#define CANFD_RXF1S_F1FL_Msk (0x7ful << CANFD_RXF1S_F1FL_Pos) /*!< CANFD_T::RXF1S: F1FL Mask */ - -#define CANFD_RXF1S_F1GI_Pos (8) /*!< CANFD_T::RXF1S: F1GI Position */ -#define CANFD_RXF1S_F1GI_Msk (0x3ful << CANFD_RXF1S_F1GI_Pos) /*!< CANFD_T::RXF1S: F1GI Mask */ - -#define CANFD_RXF1S_F1PI_Pos (16) /*!< CANFD_T::RXF1S: F1PI Position */ -#define CANFD_RXF1S_F1PI_Msk (0x3ful << CANFD_RXF1S_F1PI_Pos) /*!< CANFD_T::RXF1S: F1PI Mask */ - -#define CANFD_RXF1S_F1F_Pos (24) /*!< CANFD_T::RXF1S: F1F Position */ -#define CANFD_RXF1S_F1F_Msk (0x1ul << CANFD_RXF1S_F1F_Pos) /*!< CANFD_T::RXF1S: F1F Mask */ - -#define CANFD_RXF1S_RF1L_Pos (25) /*!< CANFD_T::RXF1S: RF1L Position */ -#define CANFD_RXF1S_RF1L_Msk (0x1ul << CANFD_RXF1S_RF1L_Pos) /*!< CANFD_T::RXF1S: RF1L Mask */ - -#define CANFD_RXF1A_F1AI_Pos (0) /*!< CANFD_T::RXF1A: F1AI Position */ -#define CANFD_RXF1A_F1AI_Msk (0x3ful << CANFD_RXF1A_F1AI_Pos) /*!< CANFD_T::RXF1A: F1AI Mask */ - -#define CANFD_RXESC_F0DS_Pos (0) /*!< CANFD_T::RXESC: F0DS Position */ -#define CANFD_RXESC_F0DS_Msk (0x7ul << CANFD_RXESC_F0DS_Pos) /*!< CANFD_T::RXESC: F0DS Mask */ - -#define CANFD_RXESC_F1DS_Pos (4) /*!< CANFD_T::RXESC: F1DS Position */ -#define CANFD_RXESC_F1DS_Msk (0x7ul << CANFD_RXESC_F1DS_Pos) /*!< CANFD_T::RXESC: F1DS Mask */ - -#define CANFD_RXESC_RBDS_Pos (8) /*!< CANFD_T::RXESC: RBDS Position */ -#define CANFD_RXESC_RBDS_Msk (0x7ul << CANFD_RXESC_RBDS_Pos) /*!< CANFD_T::RXESC: RBDS Mask */ - -#define CANFD_TXBC_TBSA_Pos (2) /*!< CANFD_T::TXBC: TBSA Position */ -#define CANFD_TXBC_TBSA_Msk (0x3ffful << CANFD_TXBC_TBSA_Pos) /*!< CANFD_T::TXBC: TBSA Mask */ - -#define CANFD_TXBC_NDTB_Pos (16) /*!< CANFD_T::TXBC: NDTB Position */ -#define CANFD_TXBC_NDTB_Msk (0x3ful << CANFD_TXBC_NDTB_Pos) /*!< CANFD_T::TXBC: NDTB Mask */ - -#define CANFD_TXBC_TFQS_Pos (24) /*!< CANFD_T::TXBC: TFQS Position */ -#define CANFD_TXBC_TFQS_Msk (0x3ful << CANFD_TXBC_TFQS_Pos) /*!< CANFD_T::TXBC: TFQS Mask */ - -#define CANFD_TXBC_TFQM_Pos (30) /*!< CANFD_T::TXBC: TFQM Position */ -#define CANFD_TXBC_TFQM_Msk (0x1ul << CANFD_TXBC_TFQM_Pos) /*!< CANFD_T::TXBC: TFQM Mask */ - -#define CANFD_TXFQS_TFFL_Pos (0) /*!< CANFD_T::TXFQS: TFFL Position */ -#define CANFD_TXFQS_TFFL_Msk (0x3ful << CANFD_TXFQS_TFFL_Pos) /*!< CANFD_T::TXFQS: TFFL Mask */ - -#define CANFD_TXFQS_TFGI_Pos (8) /*!< CANFD_T::TXFQS: TFGI Position */ -#define CANFD_TXFQS_TFGI_Msk (0x1ful << CANFD_TXFQS_TFGI_Pos) /*!< CANFD_T::TXFQS: TFGI Mask */ - -#define CANFD_TXFQS_TFQPI_Pos (16) /*!< CANFD_T::TXFQS: TFQPI Position */ -#define CANFD_TXFQS_TFQPI_Msk (0x1ful << CANFD_TXFQS_TFQPI_Pos) /*!< CANFD_T::TXFQS: TFQPI Mask */ - -#define CANFD_TXFQS_TFQF_Pos (21) /*!< CANFD_T::TXFQS: TFQF Position */ -#define CANFD_TXFQS_TFQF_Msk (0x1ul << CANFD_TXFQS_TFQF_Pos) /*!< CANFD_T::TXFQS: TFQF Mask */ - -#define CANFD_TXESC_TBDS_Pos (0) /*!< CANFD_T::TXESC: TBDS Position */ -#define CANFD_TXESC_TBDS_Msk (0x7ul << CANFD_TXESC_TBDS_Pos) /*!< CANFD_T::TXESC: TBDS Mask */ - -#define CANFD_TXBRP_TRPn_Pos (0) /*!< CANFD_T::TXBRP: TRPn Position */ -#define CANFD_TXBRP_TRPn_Msk (0xfffffffful << CANFD_TXBRP_TRPn_Pos) /*!< CANFD_T::TXBRP: TRPn Mask */ - -#define CANFD_TXBAR_ARn_Pos (0) /*!< CANFD_T::TXBAR: ARn Position */ -#define CANFD_TXBAR_ARn_Msk (0xfffffffful << CANFD_TXBAR_ARn_Pos) /*!< CANFD_T::TXBAR: ARn Mask */ - -#define CANFD_TXBCR_CRn_Pos (0) /*!< CANFD_T::TXBCR: CRn Position */ -#define CANFD_TXBCR_CRn_Msk (0xfffffffful << CANFD_TXBCR_CRn_Pos) /*!< CANFD_T::TXBCR: CRn Mask */ - -#define CANFD_TXBTO_TOn_Pos (0) /*!< CANFD_T::TXBTO: TOn Position */ -#define CANFD_TXBTO_TOn_Msk (0xfffffffful << CANFD_TXBTO_TOn_Pos) /*!< CANFD_T::TXBTO: TOn Mask */ - -#define CANFD_TXBCF_CFn_Pos (0) /*!< CANFD_T::TXBCF: CFn Position */ -#define CANFD_TXBCF_CFn_Msk (0xfffffffful << CANFD_TXBCF_CFn_Pos) /*!< CANFD_T::TXBCF: CFn Mask */ - -#define CANFD_TXBTIE_TIEn_Pos (0) /*!< CANFD_T::TXBTIE: TIEn Position */ -#define CANFD_TXBTIE_TIEn_Msk (0xfffffffful << CANFD_TXBTIE_TIEn_Pos) /*!< CANFD_T::TXBTIE: TIEn Mask */ - -#define CANFD_TXBCIE_CFIEn_Pos (0) /*!< CANFD_T::TXBCIE: CFIEn Position */ -#define CANFD_TXBCIE_CFIEn_Msk (0xfffffffful << CANFD_TXBCIE_CFIEn_Pos) /*!< CANFD_T::TXBCIE: CFIEn Mask */ - -#define CANFD_TXEFC_EFSA_Pos (2) /*!< CANFD_T::TXEFC: EFSA Position */ -#define CANFD_TXEFC_EFSA_Msk (0x3ffful << CANFD_TXEFC_EFSA_Pos) /*!< CANFD_T::TXEFC: EFSA Mask */ - -#define CANFD_TXEFC_EFS_Pos (16) /*!< CANFD_T::TXEFC: EFS Position */ -#define CANFD_TXEFC_EFS_Msk (0x3ful << CANFD_TXEFC_EFS_Pos) /*!< CANFD_T::TXEFC: EFS Mask */ - -#define CANFD_TXEFC_EFWN_Pos (24) /*!< CANFD_T::TXEFC: EFWN Position */ -#define CANFD_TXEFC_EFWN_Msk (0x3ful << CANFD_TXEFC_EFWN_Pos) /*!< CANFD_T::TXEFC: EFWN Mask */ - -#define CANFD_TXEFS_EFFL_Pos (0) /*!< CANFD_T::TXEFS: EFFL Position */ -#define CANFD_TXEFS_EFFL_Msk (0x3ful << CANFD_TXEFS_EFFL_Pos) /*!< CANFD_T::TXEFS: EFFL Mask */ - -#define CANFD_TXEFS_EFGI_Pos (8) /*!< CANFD_T::TXEFS: EFGI Position */ -#define CANFD_TXEFS_EFGI_Msk (0x1ful << CANFD_TXEFS_EFGI_Pos) /*!< CANFD_T::TXEFS: EFGI Mask */ - -#define CANFD_TXEFS_EFPI_Pos (16) /*!< CANFD_T::TXEFS: EFPI Position */ -#define CANFD_TXEFS_EFPI_Msk (0x1ful << CANFD_TXEFS_EFPI_Pos) /*!< CANFD_T::TXEFS: EFPI Mask */ - -#define CANFD_TXEFS_EFF_Pos (24) /*!< CANFD_T::TXEFS: EFF Position */ -#define CANFD_TXEFS_EFF_Msk (0x1ul << CANFD_TXEFS_EFF_Pos) /*!< CANFD_T::TXEFS: EFF Mask */ - -#define CANFD_TXEFS_TEFL_Pos (25) /*!< CANFD_T::TXEFS: TEFL Position */ -#define CANFD_TXEFS_TEFL_Msk (0x1ul << CANFD_TXEFS_TEFL_Pos) /*!< CANFD_T::TXEFS: TEFL Mask */ - -#define CANFD_TXEFA_EFAI_Pos (0) /*!< CANFD_T::TXEFA: EFAI Position */ -#define CANFD_TXEFA_EFAI_Msk (0x1ful << CANFD_TXEFA_EFAI_Pos) /*!< CANFD_T::TXEFA: EFAI Mask */ - -/**@}*/ /* CANFD_CONST */ -/**@}*/ /* end of CANFD register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CANFD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ccap_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ccap_reg.h deleted file mode 100644 index fc81bad9405..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ccap_reg.h +++ /dev/null @@ -1,453 +0,0 @@ -/**************************************************************************//** - * @file ccap_reg.h - * @version V3.00 - * @brief CCAP register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CCAP_REG_H__ -#define __CCAP_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CCAP Camera Capture Interface Controller (CCAP) - Memory Mapped Structure for CCAP Controller -@{ */ - - -typedef struct -{ - - - /** - * @var CCAP_T::CTL - * Offset: 0x00 Camera Capture Interface Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCAPEN |Camera Capture Interface Enable Bit - * | | |0 = Camera Capture Interface Disabled. - * | | |1 = Camera Capture Interface Enabled. - * |[6] |PKTEN |Packet Output Enable Bit - * | | |0 = Packet output Disabled. - * | | |1 = Packet output Enabled. - * |[7] |MONO |Monochrome CMOS Sensor Select - * | | |0 = Color CMOS Sensor. - * | | |1 = Monochrome CMOS Sensor. The U/V components are ignored when the MONO is enabled. - * |[16] |SHUTTER |Camera Capture Interface Automatically Disable the Capture Interface After a Frame Had Been Captured - * | | |0 = Shutter Disabled. - * | | |1 = Shutter Enabled. - * |[17] |MY4_SWAP |Monochrome CMOS Sensor 4-bit Data Nibble Swap - * | | |0 = The 4-bit data input sequence: 1st Pixel is for 1st Nibble (1st pixel at MSB). - * | | |1 = The 4-bit data input sequence: 1st Pixel is for 2nd Nibble (1st pixel at LSB). - * |[18] |MY8_MY4 |Monochrome CMOS Sensor Data I/O Interface - * | | |0 = Monochrome CMOS sensor is by the 4-bit data I/O interface. - * | | |1 = Monochrome CMOS sensor is by the 8-bit data I/O interface. - * |[19] |Luma_Y_One|Color/Monochrome CMOS Sensor Luminance 8-bit Y to 1-bit Y Conversion - * | | |0 = Color/Monochrome CMOS sensor Luma-Y-One bit Disabled. - * | | |1 = Color/Monochrome CMOS sensor Luma-Y-One bit Enabled. - * | | |Note: Color CMOS sensor U/V components are ignored when the Luma_Y_One is enabled. - * |[20] |UPDATE |Update Register at New Frame - * | | |0 = Update register at new frame Disabled. - * | | |1 = Update register at new frame Enabled (Auto clear to 0 when register updated). - * |[24] |VPRST |Capture Interface Reset - * | | |0 = Capture interface reset Disabled. - * | | |1 = Capture interface reset Enabled. - * @var CCAP_T::PAR - * Offset: 0x04 Camera Capture Interface Parameter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INFMT |Sensor Input Data Format - * | | |0 = YCbCr422. - * | | |1 = RGB565. - * |[1] |SENTYPE |Sensor Input Type - * | | |0 = CCIR601. - * | | |1 = CCIR656, VSync & Hsync embedded in the data signal. - * |[3:2] |INDATORD |Sensor Input Data Order - * | | |If INFMT (CCAP_PAR[0]) = 0 (YCbCr): - * | | |00 = Sensor input data (Byte 0 1 2 3) is Y0 U0 Y1 V0. - * | | |01 = Sensor input data (Byte 0 1 2 3) is Y0 V0 Y1 U0. - * | | |10 = Sensor input data (Byte 0 1 2 3) is U0 Y0 V0 Y1. - * | | |11 = Sensor input data (Byte 0 1 2 3) is V0 Y0 U0 Y1. - * | | |If INFMT (CCAP_PAR[0]) = 1 (RGB565): - * | | |00 = Sensor input data (Byte 0) is {R[4:0],G[5:3]}. Sensor input data (Byte 1) is {G[2:0], B[4:0]}. - * | | |01 = Sensor input data (Byte 0) is {B[4:0],G[5:3]}. Sensor input data (Byte 1) is {G[2:0], R[4:0]}. - * | | |10 = Sensor input data (Byte 0) is {G[2:0],B[4:0]}. Sensor input data (Byte 1) is {R[4:0], G[5:3]}. - * | | |11 = Sensor input data (Byte 0) is {G[2:0],R[4:0]}. Sensor input data (Byte 1) is {B[4:0], G[5:3]}. - * |[5:4] |OUTFMT |Image Data Format Output to System Memory - * | | |00 = YCbCr422. - * | | |01 = Only output Y. (Select this format when CCAP_CTL "Luma_Y_One" or "MONO" enabled). - * | | |10 = RGB555. - * | | |11 = RGB565. - * |[6] |RANGE |Scale Input YUV CCIR601 Color Range to Full Range - * | | |0 = Default. - * | | |1 = Scale to full range. - * |[8] |PCLKP |Sensor Pixel Clock Polarity - * | | |0 = Input video data and signals are latched by falling edge of Pixel Clock. - * | | |1 = Input video data and signals are latched by rising edge of Pixel Clock. - * |[9] |HSP |Sensor Hsync Polarity - * | | |0 = Sync Low. - * | | |1 = Sync High. - * |[10] |VSP |Sensor Vsync Polarity - * | | |0 = Sync Low. - * | | |1 = Sync High. - * |[18] |FBB |Field by Blank - * | | |Field by Blank (only in ccir-656 mode) means blanking pixel data(0x80108010) have to transfer to system memory or not. - * | | |0 = Field by blank Disabled. (blank pixel data will transfer to system memory). - * | | |1 = Field by blank Enabled. (only active data will transfer to system memory). - * @var CCAP_T::INT - * Offset: 0x08 Camera Capture Interface Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VINTF |Video Frame End Interrupt - * | | |0 = Did not receive a frame completely. - * | | |1 = Received a frame completely. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |MEINTF |Bus Master Transfer Error Interrupt - * | | |0 = Transfer Error did not occur. - * | | |1 = Transfer Error occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |ADDRMINTF |Memory Address Match Interrupt - * | | |0 = Memory Address Match Interrupt did not occur. - * | | |1 = Memory Address Match Interrupt occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[16] |VIEN |Video Frame End Interrupt Enable Bit - * | | |0 = Video frame end interrupt Disabled. - * | | |1 = Video frame end interrupt Enabled. - * |[17] |MEIEN |Bus Master Transfer Error Interrupt Enable Bit - * | | |0 = Bus Master Transfer error interrupt Disabled. - * | | |1 = Bus Master Transfer error interrupt Enabled. - * |[19] |ADDRMIEN |Memory Address Match Interrupt Enable Bit - * | | |0 = Memory address match interrupt Disabled. - * | | |1 = Memory address match interrupt Enabled. - * @var CCAP_T::CWSP - * Offset: 0x20 Cropping Window Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CWSADDRH |Cropping Window Horizontal Starting Address - * | | |Specify the value of the cropping window horizontal start address. - * |[26:16] |CWSADDRV |Cropping Window Vertical Starting Address - * | | |Specify the value of the cropping window vertical start address. - * @var CCAP_T::CWS - * Offset: 0x24 Cropping Window Size Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CWW |Cropping Window Width - * | | |Specify the size of the cropping window width. - * |[26:16] |CWH |Cropping Window Height - * | | |Specify the size of the cropping window height. - * @var CCAP_T::PKTSL - * Offset: 0x28 Packet Scaling Vertical/Horizontal Factor Register (LSB) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PKTSHML |Packet Scaling Horizontal Factor M - * | | |Specifies the lower 8-bit of denominator part (M) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSHMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image width * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[15:8] |PKTSHNL |Packet Scaling Horizontal Factor N - * | | |Specify the lower 8-bit of numerator part (N) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSHNH) to form a 16-bit numerator of horizontal factor. - * |[23:16] |PKTSVML |Packet Scaling Vertical Factor M - * | | |Specify the lower 8-bit of denominator part (M) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSVMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image height * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[31:24] |PKTSVNL |Packet Scaling Vertical Factor N - * | | |Specify the lower 8-bit of numerator part (N) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSVNH) to form a 16-bit numerator of vertical factor. - * @var CCAP_T::FRCTL - * Offset: 0x30 Scaling Frame Rate Factor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |FRM |Scaling Frame Rate Factor M - * | | |Specify the denominator part (M) of the frame rate scaling factor. - * | | |The output image frame rate will be equal to input image frame rate * (N/M). - * | | |Note: The value of N must be equal to or less than M. - * |[13:8] |FRN |Scaling Frame Rate Factor N - * | | |Specify the numerator part (N) of the frame rate scaling factor. - * @var CCAP_T::STRIDE - * Offset: 0x34 Frame Output Pixel Stride Width Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PKTSTRIDE |Packet Frame Output Pixel Stride Width - * | | |The output pixel stride size of packet pipe. - * | | |It is a 32-pixel aligned stride width for the Luma-Y-One bit format or a 4-pixel aligned stride with for the Luma-Y-Eight bit format when color or monochrome CMOS sensors used. - * | | |This means that every new captured line is by word alignment address when color or monochrome CMOS sensors used. - * @var CCAP_T::FIFOTH - * Offset: 0x3C FIFO Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:24] |PKTFTH |Packet FIFO Threshold - * | | |Specify the 5-bit value of the packet FIFO threshold. - * |[31] |OVF |FIFO Overflow Flag - * | | |Indicate the FIFO overflow flag. - * @var CCAP_T::CMPADDR - * Offset: 0x40 Compare Memory Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CMPADDR |Compare Memory Base Address - * | | |It is a word alignment address, that is, the address is aligned by ignoring the 2 LSB bits [1:0]. - * @var CCAP_T::LUMA_Y1_THD - * Offset: 0x44 Luminance Y8 to Y1 Threshold Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :-----------: | :---- | - * |[7:0] |LUMA_Y1_THRESH |Luminance Y8 to Y1 Threshold Value - * | | |Specify the 8-bit threshold value for the luminance Y bit-8 to the luminance Y 1-bit conversion. - * @var CCAP_T::PKTSM - * Offset: 0x48 Packet Scaling Vertical/Horizontal Factor Register (MSB) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PKTSHMH |Packet Scaling Horizontal Factor M - * | | |Specify the higher 8-bit of denominator part (M) of the horizontal scaling factor. - * | | |Please refer to the register CCAP_PKTSL for the detailed operation. - * |[15:8] |PKTSHNH |Packet Scaling Horizontal Factor N - * | | |Specify the higher 8-bit of numerator part (N) of the horizontal scaling factor. - * | | |Please refer to the register CCAP_PKTSL for the detailed operation. - * |[23:16] |PKTSVMH |Packet Scaling Vertical Factor M - * | | |Specify the higher 8-bit of denominator part (M) of the vertical scaling factor. - * | | |Please refer to the register CCAP_PKTSL to check the cooperation between these two registers. - * |[31:24] |PKTSVNH |Packet Scaling Vertical Factor N - * | | |Specify the higher 8-bit of numerator part (N) of the vertical scaling factor. - * | | |Please refer to the register CCAP_PKTSL to check the cooperation between these two registers. - * @var CCAP_T::CURADDRP - * Offset: 0x50 Current Packet System Memory Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURADDR |Current Packet Output Memory Address - * | | |Specify the 32-bit value of the current packet output memory address. - * @var CCAP_T::PKTBA0 - * Offset: 0x60 System Memory Packet Base Address 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |BASEADDR |System Memory Packet Base Address 0 - * | | |It is a word alignment address, that is, the address is aligned by ignoring the 2 LSB bits [1:0]. - */ - __IO uint32_t CTL; /*!< [0x0000] Camera Capture Interface Control Register */ - __IO uint32_t PAR; /*!< [0x0004] Camera Capture Interface Parameter Register */ - __IO uint32_t INT; /*!< [0x0008] Camera Capture Interface Interrupt Register */ - __I uint32_t RESERVE0[5]; - __IO uint32_t CWSP; /*!< [0x0020] Cropping Window Starting Address Register */ - __IO uint32_t CWS; /*!< [0x0024] Cropping Window Size Register */ - __IO uint32_t PKTSL; /*!< [0x0028] Packet Scaling Vertical/Horizontal Factor Register (LSB) */ - __IO uint32_t PLNSL; /*!< [0x002C] Planar Scaling Vertical/Horizontal Factor Register (LSB) */ - __IO uint32_t FRCTL; /*!< [0x0030] Scaling Frame Rate Factor Register */ - __IO uint32_t STRIDE; /*!< [0x0034] Frame Output Pixel Stride Width Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t FIFOTH; /*!< [0x003C] FIFO Threshold Register */ - __IO uint32_t CMPADDR; /*!< [0x0040] Compare Memory Base Address Register */ - __IO uint32_t LUMA_Y1_THD; /*!< [0x0044] Luminance Y8 to Y1 Threshold Value Register */ - __IO uint32_t PKTSM; /*!< [0x0048] Packet Scaling Vertical/Horizontal Factor Register (MSB) */ - __IO uint32_t PLNSM; /*!< [0x004C] Planar Scaling Vertical/Horizontal Factor Register (MSB) */ - __I uint32_t CURADDRP; /*!< [0x0050] Current Packet System Memory Address Register */ - __I uint32_t CURADDRY; /*!< [0x0054] Current Planar Y System Memory Address Register */ - __I uint32_t CURADDRU; /*!< [0x0058] Current Planar U System Memory Address Register */ - __I uint32_t CURADDRV; /*!< [0x005C] Current Planar V System Memory Address Register */ - __IO uint32_t PKTBA0; /*!< [0x0060] System Memory Packet Base Address 0 Register */ - __I uint32_t RESERVE4[7]; - __IO uint32_t YBA; /*!< [0x0080] System Memory Planar Y Base Address Register */ - __IO uint32_t UBA; /*!< [0x0084] System Memory Planar U Base Address Register */ - __IO uint32_t VBA; /*!< [0x0088] System Memory Planar V Base Address Register */ -} CCAP_T; - -/** - @addtogroup CCAP_CONST CCAP Bit Field Definition - Constant Definitions for CCAP Controller -@{ */ - -#define CCAP_CTL_CCAPEN_Pos (0) /*!< CCAP_T::CTL: CCAPEN Position */ -#define CCAP_CTL_CCAPEN_Msk (0x1ul << CCAP_CTL_CCAPEN_Pos) /*!< CCAP_T::CTL: CCAPEN Mask */ - -#define CCAP_CTL_PLNEN_Pos (5) /*!< CCAP_T::CTL: PLNEN Position */ -#define CCAP_CTL_PLNEN_Msk (0x1ul << CCAP_CTL_PLNEN_Pos) /*!< CCAP_T::CTL: PLNEN Mask */ - -#define CCAP_CTL_PKTEN_Pos (6) /*!< CCAP_T::CTL: PKTEN Position */ -#define CCAP_CTL_PKTEN_Msk (0x1ul << CCAP_CTL_PKTEN_Pos) /*!< CCAP_T::CTL: PKTEN Mask */ - -#define CCAP_CTL_MONO_Pos (7) /*!< CCAP_T::CTL: MONO Position */ -#define CCAP_CTL_MONO_Msk (0x1ul << CCAP_CTL_MONO_Pos) /*!< CCAP_T::CTL: MONO Mask */ - -#define CCAP_CTL_SHUTTER_Pos (16) /*!< CCAP_T::CTL: SHUTTER Position */ -#define CCAP_CTL_SHUTTER_Msk (0x1ul << CCAP_CTL_SHUTTER_Pos) /*!< CCAP_T::CTL: SHUTTER Mask */ - -#define CCAP_CTL_MY4_SWAP_Pos (17) /*!< CCAP_T::CTL: MY4_SWAP Position */ -#define CCAP_CTL_MY4_SWAP_Msk (0x1ul << CCAP_CTL_MY4_SWAP_Pos) /*!< CCAP_T::CTL: MY4_SWAP Mask */ - -#define CCAP_CTL_MY8_MY4_Pos (18) /*!< CCAP_T::CTL: MY8_MY4 Position */ -#define CCAP_CTL_MY8_MY4_Msk (0x1ul << CCAP_CTL_MY8_MY4_Pos) /*!< CCAP_T::CTL: MY8_MY4 Mask */ - -#define CCAP_CTL_Luma_Y_One_Pos (19) /*!< CCAP_T::CTL: Luma_Y_One Position */ -#define CCAP_CTL_Luma_Y_One_Msk (0x1ul << CCAP_CTL_Luma_Y_One_Pos) /*!< CCAP_T::CTL: Luma_Y_One Mask */ - -#define CCAP_CTL_UPDATE_Pos (20) /*!< CCAP_T::CTL: UPDATE Position */ -#define CCAP_CTL_UPDATE_Msk (0x1ul << CCAP_CTL_UPDATE_Pos) /*!< CCAP_T::CTL: UPDATE Mask */ - -#define CCAP_CTL_VPRST_Pos (24) /*!< CCAP_T::CTL: VPRST Position */ -#define CCAP_CTL_VPRST_Msk (0x1ul << CCAP_CTL_VPRST_Pos) /*!< CCAP_T::CTL: VPRST Mask */ - -#define CCAP_PAR_INFMT_Pos (0) /*!< CCAP_T::PAR: INFMT Position */ -#define CCAP_PAR_INFMT_Msk (0x1ul << CCAP_PAR_INFMT_Pos) /*!< CCAP_T::PAR: INFMT Mask */ - -#define CCAP_PAR_SENTYPE_Pos (1) /*!< CCAP_T::PAR: SENTYPE Position */ -#define CCAP_PAR_SENTYPE_Msk (0x1ul << CCAP_PAR_SENTYPE_Pos) /*!< CCAP_T::PAR: SENTYPE Mask */ - -#define CCAP_PAR_INDATORD_Pos (2) /*!< CCAP_T::PAR: INDATORD Position */ -#define CCAP_PAR_INDATORD_Msk (0x3ul << CCAP_PAR_INDATORD_Pos) /*!< CCAP_T::PAR: INDATORD Mask */ - -#define CCAP_PAR_PLNFMT_Pos (7) /*!< CCAP_T::PAR: OUTFMT Position */ -#define CCAP_PAR_PLNFMT_Msk (0x1ul << CCAP_PAR_OUTFMT_Pos) /*!< CCAP_T::PAR: OUTFMT Mask */ - -#define CCAP_PAR_OUTFMT_Pos (4) /*!< CCAP_T::PAR: OUTFMT Position */ -#define CCAP_PAR_OUTFMT_Msk (0x3ul << CCAP_PAR_OUTFMT_Pos) /*!< CCAP_T::PAR: OUTFMT Mask */ - -#define CCAP_PAR_RANGE_Pos (6) /*!< CCAP_T::PAR: RANGE Position */ -#define CCAP_PAR_RANGE_Msk (0x1ul << CCAP_PAR_RANGE_Pos) /*!< CCAP_T::PAR: RANGE Mask */ - -#define CCAP_PAR_PCLKP_Pos (8) /*!< CCAP_T::PAR: PCLKP Position */ -#define CCAP_PAR_PCLKP_Msk (0x1ul << CCAP_PAR_PCLKP_Pos) /*!< CCAP_T::PAR: PCLKP Mask */ - -#define CCAP_PAR_HSP_Pos (9) /*!< CCAP_T::PAR: HSP Position */ -#define CCAP_PAR_HSP_Msk (0x1ul << CCAP_PAR_HSP_Pos) /*!< CCAP_T::PAR: HSP Mask */ - -#define CCAP_PAR_VSP_Pos (10) /*!< CCAP_T::PAR: VSP Position */ -#define CCAP_PAR_VSP_Msk (0x1ul << CCAP_PAR_VSP_Pos) /*!< CCAP_T::PAR: VSP Mask */ - -#define CCAP_PAR_FBB_Pos (18) /*!< CCAP_T::PAR: FBB Position */ -#define CCAP_PAR_FBB_Msk (0x1ul << CCAP_PAR_FBB_Pos) /*!< CCAP_T::PAR: FBB Mask */ - -#define CCAP_INT_VINTF_Pos (0) /*!< CCAP_T::INT: VINTF Position */ -#define CCAP_INT_VINTF_Msk (0x1ul << CCAP_INT_VINTF_Pos) /*!< CCAP_T::INT: VINTF Mask */ - -#define CCAP_INT_MEINTF_Pos (1) /*!< CCAP_T::INT: MEINTF Position */ -#define CCAP_INT_MEINTF_Msk (0x1ul << CCAP_INT_MEINTF_Pos) /*!< CCAP_T::INT: MEINTF Mask */ - -#define CCAP_INT_ADDRMINTF_Pos (3) /*!< CCAP_T::INT: ADDRMINTF Position */ -#define CCAP_INT_ADDRMINTF_Msk (0x1ul << CCAP_INT_ADDRMINTF_Pos) /*!< CCAP_T::INT: ADDRMINTF Mask */ - -#define CCAP_INT_VIEN_Pos (16) /*!< CCAP_T::INT: VIEN Position */ -#define CCAP_INT_VIEN_Msk (0x1ul << CCAP_INT_VIEN_Pos) /*!< CCAP_T::INT: VIEN Mask */ - -#define CCAP_INT_MEIEN_Pos (17) /*!< CCAP_T::INT: MEIEN Position */ -#define CCAP_INT_MEIEN_Msk (0x1ul << CCAP_INT_MEIEN_Pos) /*!< CCAP_T::INT: MEIEN Mask */ - -#define CCAP_INT_ADDRMIEN_Pos (19) /*!< CCAP_T::INT: ADDRMIEN Position */ -#define CCAP_INT_ADDRMIEN_Msk (0x1ul << CCAP_INT_ADDRMIEN_Pos) /*!< CCAP_T::INT: ADDRMIEN Mask */ - -#define CCAP_CWSP_CWSADDRH_Pos (0) /*!< CCAP_T::CWSP: CWSADDRH Position */ -#define CCAP_CWSP_CWSADDRH_Msk (0xffful << CCAP_CWSP_CWSADDRH_Pos) /*!< CCAP_T::CWSP: CWSADDRH Mask */ - -#define CCAP_CWSP_CWSADDRV_Pos (16) /*!< CCAP_T::CWSP: CWSADDRV Position */ -#define CCAP_CWSP_CWSADDRV_Msk (0x7fful << CCAP_CWSP_CWSADDRV_Pos) /*!< CCAP_T::CWSP: CWSADDRV Mask */ - -#define CCAP_CWS_CWW_Pos (0) /*!< CCAP_T::CWS: CWW Position */ -#define CCAP_CWS_CWW_Msk (0xffful << CCAP_CWS_CWW_Pos) /*!< CCAP_T::CWS: CWW Mask */ - -#define CCAP_CWS_CWH_Pos (16) /*!< CCAP_T::CWS: CIWH Position */ -#define CCAP_CWS_CWH_Msk (0x7fful << CCAP_CWS_CWH_Pos) /*!< CCAP_T::CWS: CIWH Mask */ - -#define CCAP_PKTSL_PKTSHML_Pos (0) /*!< CCAP_T::PKTSL: PKTSHML Position */ -#define CCAP_PKTSL_PKTSHML_Msk (0xfful << CCAP_PKTSL_PKTSHML_Pos) /*!< CCAP_T::PKTSL: PKTSHML Mask */ - -#define CCAP_PKTSL_PKTSHNL_Pos (8) /*!< CCAP_T::PKTSL: PKTSHNL Position */ -#define CCAP_PKTSL_PKTSHNL_Msk (0xfful << CCAP_PKTSL_PKTSHNL_Pos) /*!< CCAP_T::PKTSL: PKTSHNL Mask */ - -#define CCAP_PKTSL_PKTSVML_Pos (16) /*!< CCAP_T::PKTSL: PKTSVML Position */ -#define CCAP_PKTSL_PKTSVML_Msk (0xfful << CCAP_PKTSL_PKTSVML_Pos) /*!< CCAP_T::PKTSL: PKTSVML Mask */ - -#define CCAP_PKTSL_PKTSVNL_Pos (24) /*!< CCAP_T::PKTSL: PKTSVNL Position */ -#define CCAP_PKTSL_PKTSVNL_Msk (0xfful << CCAP_PKTSL_PKTSVNL_Pos) /*!< CCAP_T::PKTSL: PKTSVNL Mask */ - -#define CCAP_PLNSL_PLNSHML_Pos (0) /*!< CCAP_T::PLNSL: PLNSHML Position */ -#define CCAP_PLNSL_PLNSHML_Msk (0xfful << CCAP_PLNSL_PLNSHML_Pos) /*!< CCAP_T::PLNSL: PLNSHML Mask */ - -#define CCAP_PLNSL_PLNSHNL_Pos (8) /*!< CCAP_T::PLNSL: PLNSHNL Position */ -#define CCAP_PLNSL_PLNSHNL_Msk (0xfful << CCAP_PLNSL_PLNSHNL_Pos) /*!< CCAP_T::PLNSL: PLNSHNL Mask */ - -#define CCAP_PLNSL_PLNSVML_Pos (16) /*!< CCAP_T::PLNSL: PLNSVML Position */ -#define CCAP_PLNSL_PLNSVML_Msk (0xfful << CCAP_PLNSL_PLNSVML_Pos) /*!< CCAP_T::PLNSL: PLNSVML Mask */ - -#define CCAP_PLNSL_PLNSVNL_Pos (24) /*!< CCAP_T::PLNSL: PLNSVNL Position */ -#define CCAP_PLNSL_PLNSVNL_Msk (0xfful << CCAP_PLNSL_PLNSVNL_Pos) /*!< CCAP_T::PLNSL: PLNSVNL Mask */ - -#define CCAP_FRCTL_FRM_Pos (0) /*!< CCAP_T::FRCTL: FRM Position */ -#define CCAP_FRCTL_FRM_Msk (0x3ful << CCAP_FRCTL_FRM_Pos) /*!< CCAP_T::FRCTL: FRM Mask */ - -#define CCAP_FRCTL_FRN_Pos (8) /*!< CCAP_T::FRCTL: FRN Position */ -#define CCAP_FRCTL_FRN_Msk (0x3ful << CCAP_FRCTL_FRN_Pos) /*!< CCAP_T::FRCTL: FRN Mask */ - -#define CCAP_STRIDE_PKTSTRIDE_Pos (0) /*!< CCAP_T::STRIDE: PKTSTRIDE Position */ -#define CCAP_STRIDE_PKTSTRIDE_Msk (0x3ffful << CCAP_STRIDE_PKTSTRIDE_Pos) /*!< CCAP_T::STRIDE: PKTSTRIDE Mask */ - -#define CCAP_STRIDE_PLNSTRIDE_Pos (16) /*!< CCAP_T::STRIDE: PLNSTRIDE Position */ -#define CCAP_STRIDE_PLNSTRIDE_Msk (0x3ffful << CCAP_STRIDE_PLNSTRIDE_Pos) /*!< CCAP_T::STRIDE: PLNSTRIDE Mask */ - -#define CCAP_FIFOTH_PKTFTH_Pos (24) /*!< CCAP_T::FIFOTH: PKTFTH Position */ -#define CCAP_FIFOTH_PKTFTH_Msk (0x1ful << CCAP_FIFOTH_PKTFTH_Pos) /*!< CCAP_T::FIFOTH: PKTFTH Mask */ - -#define CCAP_FIFOTH_OVF_Pos (31) /*!< CCAP_T::FIFOTH: OVF Position */ -#define CCAP_FIFOTH_OVF_Msk (0x1ul << CCAP_FIFOTH_OVF_Pos) /*!< CCAP_T::FIFOTH: OVF Mask */ - -#define CCAP_CMPADDR_CMPADDR_Pos (0) /*!< CCAP_T::CMPADDR: CMPADDR Position */ -#define CCAP_CMPADDR_CMPADDR_Msk (0xfffffffful << CCAP_CMPADDR_CMPADDR_Pos) /*!< CCAP_T::CMPADDR: CMPADDR Mask */ - -#define CCAP_PKTSM_PKTSHMH_Pos (0) /*!< CCAP_T::PKTSM: PKTSHMH Position */ -#define CCAP_PKTSM_PKTSHMH_Msk (0xfful << CCAP_PKTSM_PKTSHMH_Pos) /*!< CCAP_T::PKTSM: PKTSHMH Mask */ - -#define CCAP_PKTSM_PKTSHNH_Pos (8) /*!< CCAP_T::PKTSM: PKTSHNH Position */ -#define CCAP_PKTSM_PKTSHNH_Msk (0xfful << CCAP_PKTSM_PKTSHNH_Pos) /*!< CCAP_T::PKTSM: PKTSHNH Mask */ - -#define CCAP_PKTSM_PKTSVMH_Pos (16) /*!< CCAP_T::PKTSM: PKTSVMH Position */ -#define CCAP_PKTSM_PKTSVMH_Msk (0xfful << CCAP_PKTSM_PKTSVMH_Pos) /*!< CCAP_T::PKTSM: PKTSVMH Mask */ - -#define CCAP_PKTSM_PKTSVNH_Pos (24) /*!< CCAP_T::PKTSM: PKTSVNH Position */ -#define CCAP_PKTSM_PKTSVNH_Msk (0xfful << CCAP_PKTSM_PKTSVNH_Pos) /*!< CCAP_T::PKTSM: PKTSVNH Mask */ - -#define CCAP_PLNSM_PLNSHMH_Pos (0) /*!< CCAP_T::PLNSM: PLNSHMH Position */ -#define CCAP_PLNSM_PLNSHMH_Msk (0xfful << CCAP_PLNSM_PLNSHMH_Pos) /*!< CCAP_T::PLNSM: PLNSHMH Mask */ - -#define CCAP_PLNSM_PLNSHNH_Pos (8) /*!< CCAP_T::PLNSM: PLNSHNH Position */ -#define CCAP_PLNSM_PLNSHNH_Msk (0xfful << CCAP_PLNSM_PLNSHNH_Pos) /*!< CCAP_T::PLNSM: PLNSHNH Mask */ - -#define CCAP_PLNSM_PLNSVMH_Pos (16) /*!< CCAP_T::PLNSM: PLNSVMH Position */ -#define CCAP_PLNSM_PLNSVMH_Msk (0xfful << CCAP_PLNSM_PLNSVMH_Pos) /*!< CCAP_T::PLNSM: PLNSVMH Mask */ - -#define CCAP_PLNSM_PLNSVNH_Pos (24) /*!< CCAP_T::PLNSM: PLNSVNH Position */ -#define CCAP_PLNSM_PLNSVNH_Msk (0xfful << CCAP_PLNSM_PLNSVNH_Pos) /*!< CCAP_T::PLNSM: PLNSVNH Mask */ - -#define CCAP_CURADDRP_CURADDR_Pos (0) /*!< CCAP_T::CURADDRP: CURADDR Position */ -#define CCAP_CURADDRP_CURADDR_Msk (0xfffffffful << CCAP_CURADDRP_CURADDR_Pos) /*!< CCAP_T::CURADDRP: CURADDR Mask */ - -#define CCAP_PKTBA0_BASEADDR_Pos (0) /*!< CCAP_T::PKTBA0: BASEADDR Position */ -#define CCAP_PKTBA0_BASEADDR_Msk (0xfffffffful << CCAP_PKTBA0_BASEADDR_Pos) /*!< CCAP_T::PKTBA0: BASEADDR Mask */ - -/**@}*/ /* CCAP_CONST */ -/**@}*/ /* end of CCAP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CCAP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/clk_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/clk_reg.h deleted file mode 100644 index f407ab88052..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/clk_reg.h +++ /dev/null @@ -1,2452 +0,0 @@ -/**************************************************************************//** - * @file clk_reg.h - * @version V3.00 - * @brief CLK register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CLK_REG_H__ -#define __CLK_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - - -/*---------------------- System Clock Controller -------------------------*/ -/** - @addtogroup CLK System Clock Controller(CLK) - Memory Mapped Structure for CLK Controller -@{ */ - -typedef struct -{ - - - /** - * @var CLK_T::PWRCTL - * Offset: 0x00 System Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTEN |HXT Enable Bit (Write Protect) - * | | |0 = 4~24 MHz external high speed crystal (HXT) Disabled. - * | | |1 = 4~24 MHz external high speed crystal (HXT) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |LXTEN |LXT Enable Bit (Write Protect) - * | | |0 = 32.768 kHz external low speed crystal (LXT) Disabled. - * | | |1 = 32.768 kHz external low speed crystal (LXT) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |HIRCEN |HIRC Enable Bit (Write Protect) - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) Disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |LIRCEN |LIRC Enable Bit (Write Protect) - * | | |0 = 10 kHz internal low speed RC oscillator (LIRC) Disabled. - * | | |1 = 10 kHz internal low speed RC oscillator (LIRC) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |PDWKDLY |Enable the Wake-up Delay Counter (Write Protect) - * | | |When the chip wakes up from Power-down mode, the clock control will delay certain clock cycles to wait system clock stable. - * | | |The delayed clock cycle is 4096 clock cycles when chip works at 4~24 MHz external high speed crystal oscillator (HXT), and 64 or 24 clock cycles when chip works at 12 MHz internal high speed RC oscillator (HIRC). - * | | |0 = Clock cycles delay Disabled. - * | | |1 = Clock cycles delay Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |PDWKIEN |Power-down Mode Wake-up Interrupt Enable Bit (Write Protect) - * | | |0 = Power-down mode wake-up interrupt Disabled. - * | | |1 = Power-down mode wake-up interrupt Enabled. - * | | |Note 1: The interrupt will occur when both PDWKIF and PDWKIEN are high. - * | | |Note 2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |PDWKIF |Power-down Mode Wake-up Interrupt Status - * | | |Set by Power-down wake-up event, it indicates that resume from Power-down mode. - * | | |The flag is set if any wake-up source ccurred. - * | | |Note 1: Write 1 to clear the bit to 0. - * | | |Note 2: This bit works only if PDWKIEN (CLK_PWRCTL[5]) set to 1. - * |[7] |PDEN |System Power-down Enable (Write Protect) - * | | |When this bit is set to 1, Power-down mode is enabled and chip keeps active till the CPU sleep mode is also active and then the chip enters Power-down mode. - * | | |When chip wakes up from Power-down mode, this bit is auto cleared - * | | |Users need to set this bit again for next Power-down. - * | | |In Power-down mode, HXT and the HIRC will be disabled in this mode, but LXT and LIRC are not controlled by Power-down mode. - * | | |In Power-down mode, the PLL, PLLFN and system clock are disabled, and ignored the clock source selection. - * | | |The clocks of peripheral are not controlled by Power-down mode, if the peripheral clock source is from LXT or LIRC. - * | | |0 = Chip will not enter Power-down mode after CPU sleep command WFI. - * | | |1 = Chip enters Power-down mode after CPU sleep command WFI. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11:10] |HXTGAIN |HXT Gain Control Bit (Write Protect) - * | | |Gain control is used to enlarge the gain of crystal to make sure crystal work normally. - * | | |00 = HXT frequency is lower than from 8 MHz. - * | | |01 = HXT frequency is from 8 MHz to 12 MHz. - * | | |10 = HXT frequency is from 12 MHz to 16 MHz. - * | | |11 = HXT frequency is higher than 16 MHz. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[12] |HXTSELTYP |HXT Crystal Type Select Bit (Write Protect) - * | | |0 = Select INV type. - * | | |1 = Select GM type. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17:16] |HIRCSTBS |HIRC Stable Count Select (Write Protect) - * | | |00 = HIRC stable count is 64 clocks. - * | | |01 = HIRC stable count is 24 clocks. - * | | |Others = Reserved - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[18] |HIRC48MEN |HIRC48M Enable Bit (Write Protect) - * | | |0 = 48 MHz internal high speed RC oscillator (HIRC48M) Disabled. - * | | |1 = 48 MHz internal high speed RC oscillator (HIRC48M) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[31] |HXTMD |HXT Bypass Mode (Write Protect) - * | | |0 = HXT work as crystal mode. PF.2 and PF.3 are configured as external high speed crystal (HXT) pins. - * | | |1 = HXT works as external clock mode. PF.3 is configured as external clock input pin. - * | | |Note: This bit is write protected. Refer to the SYS_REGCTL register. - * @var CLK_T::AHBCLK0 - * Offset: 0x04 AHB Devices Clock Enable Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |PDMA0CKEN |PDMA0 Controller Clock Enable Bit - * | | |0 = PDMA0 peripheral clock Disabled. - * | | |1 = PDMA0 peripheral clock Enabled. - * |[2] |ISPCKEN |Flash ISP Controller Clock Enable Bit - * | | |0 = Flash ISP peripheral clock Disabled. - * | | |1 = Flash ISP peripheral clock Enabled. - * |[3] |EBICKEN |EBI Controller Clock Enable Bit - * | | |0 = EBI peripheral clock Disabled. - * | | |1 = EBI peripheral clock Enabled. - * |[4] |STCKEN |System Tick Clock Enable Bit - * | | |0 = System tick clock Disabled. - * | | |1 = System tick clock Enabled. - * |[5] |EMAC0CKEN |EMAC0 Controller Clock Enable Bit - * | | |0 = EMAC0 controller clock Disabled. - * | | |1 = EMAC0 controller clock Enabled. - * |[6] |SDH0CKEN |SDH0 Controller Clock Enable Bit - * | | |0 = SDH0 clock Disabled. - * | | |1 = SDH0 clock Enabled. - * |[7] |CRCCKEN |CRC Generator Controller Clock Enable Bit - * | | |0 = CRC peripheral clock Disabled. - * | | |1 = CRC peripheral clock Enabled. - * |[8] |CCAPCKEN |Camera Capture Interface Controller Clock Enable Bit - * | | |0 = CCAP controller clock Disabled. - * | | |1 = CCAP controller clock Enabled. - * |[9] |SENCKEN |CCAP Sensor Clock Enable Bit - * | | |0 = CCAP Sensor clock Disabled. - * | | |1 = CCAP Sensor clock Enabled. - * |[10] |HSUSBDCKEN|HSUSB Device Clock Enable Bit - * | | |0 = HSUSB device controller clock Disabled. - * | | |1 = HSUSB device controller clock Enabled. - * |[11] |HBICKEN |Hyper Bus Interface Clock Enable Bit - * | | |0 = HBI clock Disabled. - * | | |1 = HBI clock Enabled. - * |[12] |CRPTCKEN |Cryptographic Accelerator Clock Enable Bit - * | | |0 = Cryptographic Accelerator clock Disabled. - * | | |1 = Cryptographic Accelerator clock Enabled. - * |[13] |KSCKEN |Key Stroe Clock Enable Bit - * | | |0 = Key Store clock Disabled. - * | | |1 = Key Store clock Enabled. - * |[14] |SPIMCKEN |SPIM Controller Clock Enable Bit - * | | |0 = SPIM controller clock Disabled. - * | | |1 = SPIM controller clock Enabled. - * |[15] |FMCIDLE |Flash Memory Controller Clock Enable Bit in IDLE Mode - * | | |0 = FMC clock Disabled when chip is under IDLE mode. - * | | |1 = FMC clock Enabled when chip is under IDLE mode. - * |[16] |USBHCKEN |USB HOST Controller Clock Enable Bit - * | | |0 = USB HOST peripheral clock Disabled. - * | | |1 = USB HOST peripheral clock Enabled. - * |[17] |SDH1CKEN |SDH1 Controller Clock Enable Bit - * | | |0 = SDH1 clock Disabled. - * | | |1 = SDH1 clock Enabled. - * |[18] |PDMA1CKEN |PDMA1 Clock Enable Bit - * | | |0 = PDMA1 clock Disabled. - * | | |1 = PDMA1 clock Enabled. - * |[19] |TRACECKEN |TRACE Clock Enable Bit - * | | |0 = TRACE clock Disabled. - * | | |1 = TRACE clock Enabled. - * |[24] |GPACKEN |GPIOA Clock Enable Bit - * | | |0 = GPIOA clock Disabled. - * | | |1 = GPIOA clock Enabled. - * |[25] |GPBCKEN |GPIOB Clock Enable Bit - * | | |0 = GPIOB clock Disabled. - * | | |1 = GPIOB clock Enabled. - * |[26] |GPCCKEN |GPIOC Clock Enable Bit - * | | |0 = GPIOC clock Disabled. - * | | |1 = GPIOC clock Enabled. - * |[27] |GPDCKEN |GPIOD Clock Enable Bit - * | | |0 = GPIOD clock Disabled. - * | | |1 = GPIOD clock Enabled. - * |[28] |GPECKEN |GPIOE Clock Enable Bit - * | | |0 = GPIOE clock Disabled. - * | | |1 = GPIOE clock Enabled. - * |[29] |GPFCKEN |GPIOF Clock Enable Bit - * | | |0 = GPIOF clock Disabled. - * | | |1 = GPIOF clock Enabled. - * |[30] |GPGCKEN |GPIOG Clock Enable Bit - * | | |0 = GPIOG clock Disabled. - * | | |1 = GPIOG clock Enabled. - * |[31] |GPHCKEN |GPIOH Clock Enable Bit - * | | |0 = GPIOH clock Disabled. - * | | |1 = GPIOH clock Enabled. - * @var CLK_T::APBCLK0 - * Offset: 0x08 APB Devices Clock Enable Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDTCKEN |Watchdog Timer Clock Enable Bit (Write Protect) - * | | |0 = Watchdog timer clock Disabled. - * | | |1 = Watchdog timer clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |RTCCKEN |Real-time-clock APB Interface Clock Enable Bit - * | | |This bit is used to control the RTC APB clock only. - * | | |The RTC peripheral clock source is selected from RTCCKSEL(RTC_LXTCTL[7]). - * | | |It can be selected to 32.768 kHz external low speed crystal (LXT) or 10 kHz internal low speed RC oscillator (LIRC). - * | | |0 = RTC clock Disabled. - * | | |1 = RTC clock Enabled. - * |[2] |TMR0CKEN |Timer0 Clock Enable Bit - * | | |0 = Timer0 clock Disabled. - * | | |1 = Timer0 clock Enabled. - * |[3] |TMR1CKEN |Timer1 Clock Enable Bit - * | | |0 = Timer1 clock Disabled. - * | | |1 = Timer1 clock Enabled. - * |[4] |TMR2CKEN |Timer2 Clock Enable Bit - * | | |0 = Timer2 clock Disabled. - * | | |1 = Timer2 clock Enabled. - * |[5] |TMR3CKEN |Timer3 Clock Enable Bit - * | | |0 = Timer3 clock Disabled. - * | | |1 = Timer3 clock Enabled. - * |[6] |CLKOCKEN |CLKO Clock Enable Bit - * | | |0 = CLKO clock Disabled. - * | | |1 = CLKO clock Enabled. - * |[7] |ACMP01CKEN|Analog Comparator 0/1 Clock Enable Bit - * | | |0 = Analog comparator 0/1 clock Disabled. - * | | |1 = Analog comparator 0/1 clock Enabled. - * |[8] |I2C0CKEN |I2C0 Clock Enable Bit - * | | |0 = I2C0 clock Disabled. - * | | |1 = I2C0 clock Enabled. - * |[9] |I2C1CKEN |I2C1 Clock Enable Bit - * | | |0 = I2C1 clock Disabled. - * | | |1 = I2C1 clock Enabled. - * |[10] |I2C2CKEN |I2C2 Clock Enable Bit - * | | |0 = I2C2 clock Disabled. - * | | |1 = I2C2 clock Enabled. - * |[11] |I2C3CKEN |I2C3 Clock Enable Bit - * | | |0 = I2C3 clock Disabled. - * | | |1 = I2C3 clock Enabled. - * |[12] |QSPI0CKEN |QSPI0 Clock Enable Bit - * | | |0 = QSPI0 clock Disabled. - * | | |1 = QSPI0 clock Enabled. - * |[13] |SPI0CKEN |SPI0 Clock Enable Bit - * | | |0 = SPI0 clock Disabled. - * | | |1 = SPI0 clock Enabled. - * |[14] |SPI1CKEN |SPI1 Clock Enable Bit - * | | |0 = SPI1 clock Disabled. - * | | |1 = SPI1 clock Enabled. - * |[15] |SPI2CKEN |SPI2 Clock Enable Bit - * | | |0 = SPI2 clock Disabled. - * | | |1 = SPI2 clock Enabled. - * |[16] |UART0CKEN |UART0 Clock Enable Bit - * | | |0 = UART0 clock Disabled. - * | | |1 = UART0 clock Enabled. - * |[17] |UART1CKEN |UART1 Clock Enable Bit - * | | |0 = UART1 clock Disabled. - * | | |1 = UART1 clock Enabled. - * |[18] |UART2CKEN |UART2 Clock Enable Bit - * | | |0 = UART2 clock Disabled. - * | | |1 = UART2 clock Enabled. - * |[19] |UART3CKEN |UART3 Clock Enable Bit - * | | |0 = UART3 clock Disabled. - * | | |1 = UART3 clock Enabled. - * |[20] |UART4CKEN |UART4 Clock Enable Bit - * | | |0 = UART4 clock Disabled. - * | | |1 = UART4 clock Enabled. - * |[21] |UART5CKEN |UART5 Clock Enable Bit - * | | |0 = UART5 clock Disabled. - * | | |1 = UART5 clock Enabled. - * |[22] |UART6CKEN |UART6 Clock Enable Bit - * | | |0 = UART6 clock Disabled. - * | | |1 = UART6 clock Enabled. - * |[23] |UART7CKEN |UART7 Clock Enable Bit - * | | |0 = UART7 clock Disabled. - * | | |1 = UART7 clock Enabled. - * |[26] |OTGCKEN |USB OTG Clock Enable Bit - * | | |0 = USB OTG clock Disabled. - * | | |1 = USB OTG clock Enabled. - * |[27] |USBDCKEN |USB Device Clock Enable Bit - * | | |0 = USB device clock Disabled. - * | | |1 = USB device clock Enabled. - * |[28] |EADC0CKEN |EADC0 Clock Enable Bit - * | | |0 = EADC0 clock Disabled. - * | | |1 = EADC0 clock Enabled. - * |[29] |I2S0CKEN |I2S0 Clock Enable Bit - * | | |0 = I2S0 clock Disabled. - * | | |1 = I2S0 clock Enabled. - * |[30] |HSOTGCKEN |HSUSB OTG Clock Enable Bit - * | | |0 = HSUSB OTG clock Disabled. - * | | |1 = HSUSB OTG clock Enabled. - * @var CLK_T::APBCLK1 - * Offset: 0x0C APB Devices Clock Enable Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SC0CKEN |SC0 Clock Enable Bit - * | | |0 = SC0 clock Disabled. - * | | |1 = SC0 clock Enabled. - * |[1] |SC1CKEN |SC1 Clock Enable Bit - * | | |0 = SC1 clock Disabled. - * | | |1 = SC1 clock Enabled. - * |[2] |SC2CKEN |SC2 Clock Enable Bit - * | | |0 = SC2 clock Disabled. - * | | |1 = SC2 clock Enabled. - * |[3] |I2C4CKEN |I2C4 Clock Enable Bit - * | | |0 = I2C4 clock Disabled. - * | | |1 = I2C4 clock Enabled. - * |[4] |QSPI1CKEN |QSPI1 Clock Enable Bit - * | | |0 = QSPI1 clock Disabled. - * | | |1 = QSPI1 clock Enabled. - * |[6] |SPI3CKEN |SPI3 Clock Enable Bit - * | | |0 = SPI3 clock Disabled. - * | | |1 = SPI3 clock Enabled. - * |[7] |SPI4CKEN |SPI4 Clock Enable Bit - * | | |0 = SPI4 clock Disabled. - * | | |1 = SPI4 clock Enabled. - * |[8] |USCI0CKEN |USCI0 Clock Enable Bit - * | | |0 = USCI0 clock Disabled. - * | | |1 = USCI0 clock Enabled. - * |[10] |PSIOCKEN |PSIO Clock Enable Bit - * | | |0 = PSIO clock Disabled. - * | | |1 = PSIO clock Enabled. - * |[12] |DACCKEN |DAC Clock Enable Bit - * | | |0 = DAC clock Disabled. - * | | |1 = DAC clock Enabled. - * |[13] |ECAP2CKEN |ECAP2 Clock Enable Bit - * | | |0 = ECAP2 clock Disabled. - * | | |1 = ECAP2 clock Enabled. - * |[14] |ECAP3CKEN |ECAP3 Clock Enable Bit - * | | |0 = ECAP3 clock Disabled. - * | | |1 = ECAP3 clock Enabled. - * |[16] |EPWM0CKEN |EPWM0 Clock Enable Bit - * | | |0 = EPWM0 clock Disabled. - * | | |1 = EPWM0 clock Enabled. - * |[17] |EPWM1CKEN |EPWM1 Clock Enable Bit - * | | |0 = EPWM1 clock Disabled. - * | | |1 = EPWM1 clock Enabled. - * |[18] |BPWM0CKEN |BPWM0 Clock Enable Bit - * | | |0 = BPWM0 clock Disabled. - * | | |1 = BPWM0 clock Enabled. - * |[19] |BPWM1CKEN |BPWM1 Clock Enable Bit - * | | |0 = BPWM1 clock Disabled. - * | | |1 = BPWM1 clock Enabled. - * |[20] |EQEI2CKEN |EQEI2 Clock Enable Bit - * | | |0 = EQEI2 clock Disabled. - * | | |1 = EQEI2 clock Enabled. - * |[21] |EQEI3CKEN |EQEI3 Clock Enable Bit - * | | |0 = EQEI3 clock Disabled. - * | | |1 = EQEI3 clock Enabled. - * |[22] |EQEI0CKEN |EQEI0 Clock Enable Bit - * | | |0 = EQEI0 clock Disabled. - * | | |1 = EQEI0 clock Enabled. - * |[23] |EQEI1CKEN |EQEI1 Clock Enable Bit - * | | |0 = EQEI1 clock Disabled. - * | | |1 = EQEI1 clock Enabled. - * |[25] |TRNGCKEN |TRNG Clock Enable Bit - * | | |0 = TRNG clock Disabled. - * | | |1 = TRNG clock Enabled. - * |[26] |ECAP0CKEN |ECAP0 Clock Enable Bit - * | | |0 = ECAP0 clock Disabled. - * | | |1 = ECAP0 clock Enabled. - * |[27] |ECAP1CKEN |ECAP1 Clock Enable Bit - * | | |0 = ECAP1 clock Disabled. - * | | |1 = ECAP1 clock Enabled. - * |[29] |I2S1CKEN |I2S1 Clock Enable Bit - * | | |0 = I2S1 clock Disabled. - * | | |1 = I2S1 clock Enabled. - * |[31] |EADC1CKEN |EADC1 Clock Enable Bit - * | | |0 = EADC1 clock Disabled. - * | | |1 = EADC1 clock Enabled. - * @var CLK_T::CLKSEL0 - * Offset: 0x10 Clock Source Select Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |HCLKSEL |HCLK Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PLL - * | | |011 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * | | |Note: Theses bits are write protected. Refer to the SYS_REGLCTL register. - * |[5:3] |STCLKSEL |Cortex-M4 SysTick Clock Source Selection (Write Protect) - * | | |If SYST_CTRL[2]=0, SysTick uses listed clock source below. - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from HXT/2. - * | | |011 = Clock source from HCLK/2. - * | | |111 = Clock source from HIRC/2. - * | | |Note 1: If SysTick clock source is not from HCLK (i.e. SYST_CTRL[2] = 0), SysTick needs to enable STCKEN(CLK_AHBCLK0[4]). - * | | |SysTick clock source must less than or equal to HCLK/2. - * | | |Note 2: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[8] |USBSEL |USB Clock Source Selection (Write Protect) - * | | |0 = Clock source from 48 MHz internal high speed RC oscillator (HIRC48M). - * | | |1 = Clock source from PLL/2. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11:10] |EADC0SEL |EADC0 Clock Source Selection (Write Protect) - * | | |00 = Clock source from PLLFN/2. - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from HCLK. - * | | |11 = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[13:12] |EADC1SEL |EADC1 Clock Source Selection (Write Protect) - * | | |00 = Clock source from PLLFN/2. - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from HCLK. - * | | |11 = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[15:14] |EADC2SEL |EADC2 Clock Source Selection (Write Protect) - * | | |00 = Clock source from PLLFN/2. - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from HCLK. - * | | |11 = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[17:16] |CCAPSEL |CCAP Sensor Clock Source Selection (Write Protect) - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[21:20] |SDH0SEL |SDH0 Clock Source Selection (Write Protect) - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2 clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[23:22] |SDH1SEL |SDH1 Clock Source Selection (Write Protect) - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2 clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[25:24] |CANFD0SEL |CANFD0 Clock Source Selection (Write Protect) - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2 clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[27:26] |CANFD1SEL |CANFD1 Clock Source Selection (Write Protect) - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2 clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[29:28] |CANFD2SEL |CANFD2 Clock Source Selection (Write Protect) - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2 clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[31:30] |CANFD3SEL |CANFD3 Clock Source Selection (Write Protect) - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2 clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::CLKSEL1 - * Offset: 0x14 Clock Source Select Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WDTSEL |Watchdog Timer Clock Source Selection (Write Protect) - * | | |00 = Reserved. - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[6:4] |CLKOSEL |Clock Output Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from HCLK. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |101 = Clock source from PLLFN/2. - * | | |110 = Clock source from PLL/2. - * | | |111 = Reserved. - * |[10:8] |TMR0SEL |TIMER0 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM0 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[14:12] |TMR1SEL |TIMER1 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM1 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[18:16] |TMR2SEL |TIMER2 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM2 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[22:20] |TMR3SEL |TIMER3 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM3 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[25:24] |UART0SEL |UART0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[27:26] |UART1SEL |UART1 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[31:30] |WWDTSEL |Window Watchdog Timer Clock Source Selection - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * @var CLK_T::CLKSEL2 - * Offset: 0x18 Clock Source Select Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EPWM0SEL |EPWM0 Clock Source Selection - * | | |The peripheral clock source of EPWM0 is defined by EPWM0SEL. - * | | |0 = Clock source from HCLK. - * | | |1 = Clock source from PCLK0. - * |[1] |EPWM1SEL |EPWM1 Clock Source Selection - * | | |The peripheral clock source of EPWM1 is defined by EPWM1SEL. - * | | |0 = Clock source from HCLK. - * | | |1 = Clock source from PCLK1. - * |[3:2] |QSPI0SEL |QSPI0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[6:4] |SPI0SEL |SPI0 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from 48 MHz internal high speed RC oscillator (HIRC48M). - * | | |101 = Clock source from PLLFN/2. - * | | |Others = Reserved. - * |[8] |BPWM0SEL |BPWM0 Clock Source Selection - * | | |The peripheral clock source of BPWM0 is defined by BPWM0SEL. - * | | |0 = Clock source from HCLK. - * | | |1 = Clock source from PCLK0. - * |[9] |BPWM1SEL |BPWM1 Clock Source Selection - * | | |The peripheral clock source of BPWM1 is defined by BPWM1SEL. - * | | |0 = Clock source from HCLK. - * | | |1 = Clock source from PCLK1. - * |[11:10] |QSPI1SEL |QSPI1 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[14:12] |SPI1SEL |SPI1 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from 48 MHz internal high speed RC oscillator (HIRC48M). - * | | |101 = Clock source from PLLFN/2. - * | | |Others = Reserved. - * |[18:16] |I2S1SEL |I2S1 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from 48 MHz internal high speed RC oscillator (HIRC48M). - * | | |101 = Clock source from PLLFN/2. - * | | |Others = Reserved. - * |[21:20] |UART8SEL |UART8 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[23:22] |UART9SEL |UART9 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[27] |TRNGSEL |TRNG Clock Source Selection - * | | |0 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |1 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * |[30:28] |PSIOSEL |PSIO Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from PLL/2. - * | | |100 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |101 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * @var CLK_T::CLKSEL3 - * Offset: 0x1C Clock Source Select Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SC0SEL |SC0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[3:2] |SC1SEL |SC0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[5:4] |SC2SEL |SC2 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[7:6] |KPISEL |KPI Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |10 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |11 = Reserved. - * |[11:9] |SPI2SEL |SPI2 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from 48 MHz internal high speed RC oscillator (HIRC48M). - * | | |101 = Clock source from PLLFN/2. - * | | |Others = Reserved. - * |[14:12] |SPI3SEL |SPI3 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from 48 MHz internal high speed RC oscillator (HIRC48M). - * | | |101 = Clock source from PLLFN/2. - * | | |Others = Reserved. - * |[18:16] |I2S0SEL |I2S0 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |100 = Clock source from 48 MHz internal high speed RC oscillator (HIRC48M). - * | | |101 = Clock source from PLLFN/2. - * | | |Others = Reserved. - * |[21:20] |UART6SEL |UART6 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[23:22] |UART7SEL |UART7 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[25:24] |UART2SEL |UART2 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[27:26] |UART3SEL |UART3 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[29:28] |UART4SEL |UART4 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[31:30] |UART5SEL |UART5 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * @var CLK_T::CLKDIV0 - * Offset: 0x20 Clock Divider Number Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |HCLKDIV |HCLK Clock Divide Number from HCLK Clock Source - * | | |HCLK clock frequency = (HCLK clock source frequency) / (HCLKDIV + 1). - * |[7:4] |USBDIV |USB Clock Divide Number from PLL/2 Clock - * | | |USB clock frequency = ((PLL frequency)/2) / (USBDIV + 1). - * |[11:8] |UART0DIV |UART0 Clock Divide Number from UART0 Clock Source - * | | |UART0 clock frequency = (UART0 clock source frequency) / (UART0DIV + 1). - * |[15:12] |UART1DIV |UART1 Clock Divide Number from UART1 Clock Source - * | | |UART1 clock frequency = (UART1 clock source frequency) / (UART1DIV + 1). - * |[23:16] |EADC0DIV |EADC0 Clock Divide Number from EADC0 Clock Source - * | | |EADC0 clock frequency = (EADC0 clock source frequency) / (EADC0DIV + 1). - * |[31:24] |SDH0DIV |SDH0 Clock Divide Number from SDH0 Clock Source - * | | |SDH0 clock frequency = (SDH0 clock source frequency) / (SDH0DIV + 1). - * @var CLK_T::CLKDIV1 - * Offset: 0x24 Clock Divider Number Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SC0DIV |SC0 Clock Divide Number from SC0 Clock Source - * | | |SC0 clock frequency = (SC0 clock source frequency) / (SC0DIV + 1). - * |[15:8] |SC1DIV |SC1 Clock Divide Number from SC1 Clock Source - * | | |SC1 clock frequency = (SC1 clock source frequency) / (SC1DIV + 1). - * |[23:16] |SC2DIV |SC2 Clock Divide Number from SC2 Clock Source - * | | |SC2 clock frequency = (SC2 clock source frequency) / (SC2DIV + 1). - * |[31:24] |PSIODIV |PSIO Clock Divide Number from PSIO Clock Source - * | | |PSIO clock frequency = (PSIO clock source frequency) / (PSIODIV + 1). - * @var CLK_T::CLKDIV2 - * Offset: 0x28 Clock Divider Number Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |I2S0DIV |I2S0 Clock Divide Number from I2S0 Clock Source - * | | |I2S0 clock frequency = (I2S0 clock source frequency) / (I2S0DIV + 1). - * |[7:4] |I2S1DIV |I2S1 Clock Divide Number from I2S1 Clock Source - * | | |I2S1 clock frequency = (I2S1 clock source frequency) / (I2S1DIV + 1). - * |[15:8] |KPIDIV |KPI Clock Divide Number from KPI Clock Source - * | | |KPI clock frequency = (KPI clock source frequency) / (KPIDIV + 1). - * |[31:24] |EADC1DIV |EADC1 Clock Divide Number from EADC1 Clock Source - * | | |EADC1 clock frequency = (EADC1 clock source frequency) / (EADC1DIV + 1). - * @var CLK_T::CLKDIV3 - * Offset: 0x2C Clock Divider Number Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:8] |VSENSEDIV |Video Pixel Clock Divide Number from CCAP Sensor Clock Source - * | | |Video pixel clock frequency = (CCAP sensor clock source frequency) / (VSENSEDIV + 1). - * |[23:16] |EMAC0DIV |EMAC0 Clock Divide Number form HCLK - * | | |EMAC0 MDCLK clock frequency = (HCLK) / (EMAC0DIV + 1). - * |[31:24] |SDH1DIV |SDH1 Clock Divide Number from SDH1 Clock Source - * | | |SDH1 clock frequency = (SDH1 clock source frequency) / (SDH1DIV + 1). - * @var CLK_T::CLKDIV4 - * Offset: 0x30 Clock Divider Number Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |UART2DIV |UART2 Clock Divide Number from UART2 Clock Source - * | | |UART2 clock frequency = (UART2 clock source frequency) / (UART2DIV + 1). - * |[7:4] |UART3DIV |UART3 Clock Divide Number from UART3 Clock Source - * | | |UART3 clock frequency = (UART3 clock source frequency) / (UART3DIV + 1). - * |[11:8] |UART4DIV |UART4 Clock Divide Number from UART4 Clock Source - * | | |UART4 clock frequency = (UART4 clock source frequency) / (UART4DIV + 1). - * |[15:12] |UART5DIV |UART5 Clock Divide Number from UART5 Clock Source - * | | |UART5 clock frequency = (UART5 clock source frequency) / (UART5DIV + 1). - * |[19:16] |UART6DIV |UART6 Clock Divide Number from UART6 Clock Source - * | | |UART6 clock frequency = (UART6 clock source frequency) / (UART6DIV + 1). - * |[23:20] |UART7DIV |UART7 Clock Divide Number from UART7 Clock Source - * | | |UART7 clock frequency = (UART7 clock source frequency) / (UART7DIV + 1). - * @var CLK_T::PCLKDIV - * Offset: 0x34 APB Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |APB0DIV |APB0 Clock Divider - * | | |APB0 clock can be divided from HCLK. - * | | |000 = PCLK0 frequency is HCLK. - * | | |001 = PCLK0 frequency is HCLK/2. - * | | |010 = PCLK0 frequency is HCLK/4. - * | | |011 = PCLK0 frequency is HCLK/8. - * | | |100 = PCLK0 frequency is HCLK/16. - * | | |Others = Reserved. - * |[6:4] |APB1DIV |APB1 Clock Divider - * | | |APB1 clock can be divided from HCLK. - * | | |000 = PCLK1 frequency is HCLK. - * | | |001 = PCLK1 frequency is HCLK/2. - * | | |010 = PCLK1 frequency is HCLK/4. - * | | |011 = PCLK1 frequency is HCLK/8. - * | | |100 = PCLK1 frequency is HCLK/16. - * | | |Others = Reserved. - * @var CLK_T::APBCLK2 - * Offset: 0x38 APB Devices Clock Enable Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KPICKEN |KPI Clock Enable Bit - * | | |0 = KPI clock Disabled. - * | | |1 = KPI clock Enabled. - * |[6] |EADC2CKEN |EADC2 Clock Enable Bit - * | | |0 = EADC2 clock Disabled. - * | | |1 = EADC2 clock Enabled. - * |[7] |ACMP23CKEN|Analog Comparator 2/3 Clock Enable Bit - * | | |0 = Analog Comparator 2/3 clock Disabled. - * | | |1 = Analog Comparator 2/3 clock Enabled. - * |[8] |SPI5CKEN |SPI5 Clock Enable Bit - * | | |0 = SPI5 clock Disabled. - * | | |1 = SPI5 clock Enabled. - * |[9] |SPI6CKEN |SPI6 Clock Enable Bit - * | | |0 = SPI6 clock Disabled. - * | | |1 = SPI6 clock Enabled. - * |[10] |SPI7CKEN |SPI7 Clock Enable Bit - * | | |0 = SPI7 clock Disabled. - * | | |1 = SPI7 clock Enabled. - * |[11] |SPI8CKEN |SPI8 Clock Enable Bit - * | | |0 = SPI8 clock Disabled. - * | | |1 = SPI8 clock Enabled. - * |[12] |SPI9CKEN |SPI9 Clock Enable Bit - * | | |0 = SPI9 clock Disabled. - * | | |1 = SPI9 clock Enabled. - * |[13] |SPI10CKEN |SPI10 Clock Enable Bit - * | | |0 = SPI10 clock Disabled. - * | | |1 = SPI10 clock Enabled. - * |[16] |UART8CKEN |UART8 Clock Enable Bit - * | | |0 = UART8 clock Disabled. - * | | |1 = UART8 clock Enabled. - * |[17] |UART9CKEN |UART9 Clock Enable Bit - * | | |0 = UART9 clock Disabled. - * | | |1 = UART9 clock Enabled. - * @var CLK_T::CLKDIV5 - * Offset: 0x3C Clock Divider Number Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CANFD0DIV |CANFD0 Clock Divide Number from CANFD0 Clock Source - * | | |CANFD0 clock frequency = (CANFD0 clock source frequency) / (CANFD0DIV + 1). - * |[7:4] |CANFD1DIV |CANFD1 Clock Divide Number from CANFD1 Clock Source - * | | |CANFD1 clock frequency = (CANFD1 clock source frequency) / (CANFD1DIV + 1). - * |[11:8] |CANFD2DIV |CANFD2 Clock Divide Number from CANFD2 Clock Source - * | | |CANFD2 clock frequency = (CANFD2 clock source frequency) / (CANFD2DIV + 1). - * |[15:12] |CANFD3DIV |CANFD3 Clock Divide Number from CANFD3 Clock Source - * | | |CANFD3 clock frequency = (CANFD3 clock source frequency) / (CANFD3DIV + 1). - * |[19:16] |UART8DIV |UART6 Clock Divide Number from UART8 Clock Source - * | | |UART6 clock frequency = (UART8 clock source frequency) / (UART8DIV + 1). - * |[23:20] |UART9DIV |UART7 Clock Divide Number from UART9 Clock Source - * | | |UART7 clock frequency = (UART9 clock source frequency) / (UART9DIV + 1). - * |[31:24] |EADC2DIV |EADC2 Clock Divide Number from EADC2 Clock Source - * | | |EADC2 clock frequency = (EADC2 clock source frequency) / (EADC2DIV + 1). - * @var CLK_T::PLLCTL - * Offset: 0x40 PLL Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[13:9] |INDIV |PLL Input Divider Control (Write Protect) - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[15:14] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[16] |PD |Power-down Mode (Write Protect) - * | | |If set the PDEN bit to 1 in CLK_PWRCTL register, the PLL will enter Power-down mode, too. - * | | |0 = PLL is in normal mode. - * | | |1 = PLL is in Power-down mode (default). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock FIN. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[18] |OE |PLL FOUT Enable Control (Write Protect) - * | | |0 = PLL FOUT Enabled. - * | | |1 = PLL FOUT is fixed low. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[19] |PLLSRC |PLL Source Clock Selection (Write Protect) - * | | |0 = PLL source clock from 4~24 MHz external high-speed crystal oscillator (HXT). - * | | |1 = PLL source clock from 12 MHz internal high-speed oscillator (HIRC). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |STBSEL |PLL Stable Counter Selection (Write Protect) - * | | |0 = PLL stable time is 1200 PLL source clock (suitable for source clock equal to or less than 12 MHz). - * | | |1 = PLL stable time is 2400 PLL source clock (suitable for source clock larger than 12 MHz). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::PLLFNCTL0 - * Offset: 0x48 PLLFN Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[13:9] |INDIV |PLL Input Divider Control (Write Protect) - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[15:14] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[27:16] |FRDIV |PLL Fractional Divider Control (Write Protect) - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::PLLFNCTL1 - * Offset: 0x4C PLLFN Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27] |STBSEL |PLL Stable Counter Selection (Write Protect) - * | | |0 = PLL stable time is 1200 PLL source clock (suitable for source clock equal to or less than 12 MHz). - * | | |1 = PLL stable time is 2400 PLL source clock (suitable for source clock larger than 12 MHz). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[28] |PD |Power-down Mode (Write Protect) - * | | |If set the PDEN bit to 1 in CLK_PWRCTL register, the PLL will enter Power-down mode, too. - * | | |0 = PLL is in normal mode. - * | | |1 = PLL is in Power-down mode (default). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[29] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock FIN. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[30] |OE |PLL FOUT Enable Control (Write Protect) - * | | |0 = PLL FOUT Enabled. - * | | |1 = PLL FOUT is fixed low. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[31] |PLLSRC |PLL Source Clock Selection (Write Protect) - * | | |0 = PLL source clock from 4~32 MHz external high-speed crystal oscillator (HXT). - * | | |1 = PLL source clock from 12 MHz internal high-speed oscillator (HIRC). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::STATUS - * Offset: 0x50 Clock Status Monitor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTSTB |HXT Clock Source Stable Flag (Read Only) - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock is not stable or disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock is stable and enabled. - * |[1] |LXTSTB |LXT Clock Source Stable Flag (Read Only) - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is not stable or disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock is stabled and enabled. - * |[2] |PLLSTB |Internal PLL Clock Source Stable Flag (Read Only) - * | | |0 = Internal PLL clock is not stable or disabled. - * | | |1 = Internal PLL clock is stable and enabled. - * |[3] |LIRCSTB |LIRC Clock Source Stable Flag (Read Only) - * | | |0 = 10 kHz internal low speed RC oscillator (LIRC) clock is not stable or disabled. - * | | |1 = 10 kHz internal low speed RC oscillator (LIRC) clock is stable and enabled. - * |[4] |HIRCSTB |HIRC Clock Source Stable Flag (Read Only) - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) clock is not stable or disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) clock is stable and enabled. - * |[6] |HIRC48MSTB|HIRC48M Clock Source Stable Flag (Read Only) - * | | |0 = 48 MHz internal high speed RC oscillator (HIRC48M) clock is not stable or disabled. - * | | |1 = 48 MHz internal high speed RC oscillator (HIRC48M) clock is stable and enabled. - * |[7] |CLKSFAIL |Clock Switching Fail Flag (Read Only) - * | | |This bit is updated when software switches system clock source - * | | |If switch target clock is stable, this bit will be set to 0 - * | | |If switch target clock is not stable, this bit will be set to 1. - * | | |0 = Clock switching success. - * | | |1 = Clock switching failure. - * | | |Note: This bit is read only. - * | | |After selected clock source is stable, hardware will switch system clock to selected clock automatically, and CLKSFAIL will be cleared automatically by hardware. - * |[10] |PLLFNSTB |Internal PLLFN Clock Source Stable Flag - * | | |0 = Internal PLLFN clock is not stable or disabled. - * | | |1 = Internal PLLFN clock is stable. - * | | |Note: This bit is read only. - * @var CLK_T::AHBCLK1 - * Offset: 0x58 AHB Devices Clock Enable Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[20] |CANFD0CKEN|CANFD0 Clock Enable Bit - * | | |0 = CANFD0 clock Disabled. - * | | |1 = CANFD0 clock Enabled. - * |[21] |CANFD1CKEN|CANFD1 Clock Enable Bit - * | | |0 = CANFD1 clock Disabled. - * | | |1 = CANFD1 clock Enabled. - * |[22] |CANFD2CKEN|CANFD2 Clock Enable Bit - * | | |0 = CANFD2 clock Disabled. - * | | |1 = CANFD2 clock Enabled. - * |[23] |CANFD3CKEN|CANFD3 Clock Enable Bit - * | | |0 = CANFD3 clock Disabled. - * | | |1 = CANFD3 clock Enabled. - * |[24] |GPICKEN |GPIOI Clock Enable Bit - * | | |0 = GPIOI clock Disabled. - * | | |1 = GPIOI clock Enabled. - * |[25] |GPJCKEN |GPIOJ Clock Enable Bit - * | | |0 = GPIOJ clock Disabled. - * | | |1 = GPIOJ clock Enabled. - * |[28] |BMCCKEN |BMC Clock Enable Bit - * | | |0 = BMC clock Disabled. - * | | |1 = BMC clock Enabled. - * @var CLK_T::CLKSEL4 - * Offset: 0x5C Clock Source Select Control Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |SPI4SEL |SPI4 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[6:4] |SPI5SEL |SPI5 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[10:8] |SPI6SEL |SPI6 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[14:12] |SPI7SEL |SPI7 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[18:16] |SPI8SEL |SPI8 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[22:20] |SPI9SEL |SPI9 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[26:24] |SPI10SEL |SPI10 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from PLL/2. - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * @var CLK_T::CLKOCTL - * Offset: 0x60 Clock Output Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |FREQSEL |Clock Output Frequency Selection - * | | |The formula of output frequency is Fout = Fin/2^(N+1). - * | | |Fin is the input clock frequency. - * | | |Fout is the frequency of divider output clock. - * | | |N is the 4-bit value of FREQSEL[3:0]. - * |[4] |CLKOEN |Clock Output Enable Bit - * | | |0 = Clock Output function Disabled. - * | | |1 = Clock Output function Enabled. - * |[5] |DIV1EN |Clock Output Divide One Enable Bit - * | | |0 = Clock Output will output clock with source frequency divided by FREQSEL. - * | | |1 = Clock Output will output clock with source frequency. - * |[6] |CLK1HZEN |Clock Output 1Hz Enable Bit - * | | |0 = 1 Hz clock output for 32.768 kHz frequency compensation Disabled. - * | | |1 = 1 Hz clock output for 32.768 kHz frequency compensation Enabled. - * @var CLK_T::CLKDCTL - * Offset: 0x70 Clock Fail Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |HXTFDEN |HXT Clock Fail Detector Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector Enabled. - * |[5] |HXTFIEN |HXT Clock Fail Interrupt Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Enabled. - * |[12] |LXTFDEN |LXT Clock Fail Detector Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Enabled. - * |[13] |LXTFIEN |LXT Clock Fail Interrupt Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Enabled. - * |[16] |HXTFQDEN |HXT Clock Frequency Range Detector Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector Enabled. - * |[17] |HXTFQIEN |HXT Clock Frequency Range Detector Interrupt Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector fail interrupt Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector fail interrupt Enabled. - * |[18] |HXTFQASW |HXT Clock Frequency Range Detector Event Auto Switch Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector fail event happened and HCLK will not switch to HIRC automatically. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector fail event happened and HCLK will switch to HIRC automatically. - * | | |Note: This bit should be set before HXTFQDEN(CLK_CLKDCTL[16]). - * @var CLK_T::CLKDSTS - * Offset: 0x74 Clock Fail Detector Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFIF |HXT Clock Fail Interrupt Flag (Write Protect) - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock is normal. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock stops. - * | | |Note 1: Write 1 to clear the bit to 0. - * | | |Note 2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |LXTFIF |LXT Clock Fail Interrupt Flag (Write Protect) - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is normal. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) stops. - * | | |Note 1: Write 1 to clear the bit to 0. - * | | |Note 2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |HXTFQIF |HXT Clock Frequency Range Detector Interrupt Flag (Write Protect) - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency is normal. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency is abnormal. - * | | |Note 1: Write 1 to clear the bit to 0. - * | | |Note 2: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::CDUPB - * Offset: 0x78 Clock Frequency Range Detector Upper Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |UPERBD |HXT Clock Frequency Range Detector Upper Boundary Value - * | | |The bits define the maximum value of frequency range detector window. - * | | |When HXT frequency higher than this maximum frequency value, the HXT Clock Frequency Range Detector Interrupt Flag will set to 1. - * @var CLK_T::CDLOWB - * Offset: 0x7C Clock Frequency Range Detector Lower Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |LOWERBD |HXT Clock Frequency Range Detector Lower Boundary Value - * | | |The bits define the minimum value of frequency range detector window. - * | | |When HXT frequency lower than this minimum frequency value, the HXT Clock Frequency Range Detector Interrupt Flag will set to 1. - * @var CLK_T::STOPREQ - * Offset: 0x80 Clock Stop Request Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CANFD0STR |CANFD0 Clock Stop Request - * | | |This bit is used to stop CANFD0 clock. - * | | |0 = CANFD0 clock is not stoped by this bit. (default) - * | | |1 = Set this bit and check the CANFD0STA(CLK_STOPACK[0]) is 1, then CANFD0 clock stop. - * |[1] |CANFD1STR |CANFD1 Clock Stop Request - * | | |This bit is used to stop CANFD1 clock. - * | | |0 = CANFD1 clock is not stoped by this bit. (default) - * | | |1 = Set this bit and check the CANFD1STA(CLK_STOPACK[1]) is 1, then CANFD1 clock stop. - * |[2] |CANFD2STR |CANFD2 Clock Stop Request - * | | |This bit is used to stop CANFD2 clock. - * | | |0 = CANFD2 clock is not stoped by this bit. (default) - * | | |1 = Set this bit and check the CANFD2STA(CLK_STOPACK[2]) is 1, then CANFD2 clock stop. - * |[3] |CANFD3STR |CANFD3 Clock Stop Request - * | | |This bit is used to stop CANFD3 clock. - * | | |0 = CANFD3 clock is not stoped by this bit. (default) - * | | |1 = Set this bit and check the CANFD3STA(CLK_STOPACK[3]) is 1, then CANFD3 clock stop. - * @var CLK_T::STOPACK - * Offset: 0x84 Clock Stop Acknowledge Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CANFD0STA |CANFD0 Clock Stop Acknowledge (Read Only) - * | | |This bit is used to check CANFD0 clock stop by setting CANFD0STR(CLK_STOPREQ[0]). - * | | |0 = CANFD0 clock not stoped. - * | | |1 = CANFD0 clock stoped. - * |[1] |CANFD1STA |CANFD1 Clock Stop Acknowledge (Read Only) - * | | |This bit is used to check CANFD1 clock stop by setting CANFD1STR(CLK_STOPREQ[1]). - * | | |0 = CANFD1 clock not stoped. - * | | |1 = CANFD1 clock stoped. - * |[2] |CANFD2STA |CANFD2 Clock Stop Acknowledge (Read Only) - * | | |This bit is used to check CANFD2 clock stop by setting CANFD2STR(CLK_STOPREQ[2]). - * | | |0 = CANFD2 clock not stoped. - * | | |1 = CANFD2 clock stoped. - * |[3] |CAN3STACK |CANFD3 Clock Stop Acknowledge (Read Only) - * | | |This bit is used to check CANFD3 clock stop by setting CANFD3STR(CLK_STOPREQ[3]). - * | | |0 = CANFD3 clock not stoped. - * | | |1 = CANFD3 clock stoped. - * @var CLK_T::PMUCTL - * Offset: 0x90 Power Manager Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |PDMSEL |Power-down Mode Selection (Write Protect) - * | | |These bits control chip power-down mode grade selection when CPU execute WFI/WFE instruction. - * | | |000 = Normal Power-down mode is selected (NPD). - * | | |001 = Low leakage Power-down mode is selected (LLPD). - * | | |010 = Fast wake-up Power-down mode is selected (FWPD). - * | | |011 = Reserved. - * | | |100 = Standby Power-down mode is selected (SPD). - * | | |101 = Reserved. - * | | |110 = Deep Power-down mode is selected (DPD). - * | | |111 = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[3] |DPDHOLDEN |Deep-Power-Down Mode GPIO Hold Enable Bit (Write Protect) - * | | |0= When GPIO enters deep power-down mode, all I/O status are tri-state. - * | | |1= When GPIO enters deep power-down mode, all I/O status are hold to keep normal operating status. - * | | |After chip was woken up from deep power-down mode, the I/O are still keep hold status until user set CLK_IOPDCTL[0] to release I/O hold status. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6:4] |SRETSEL |SRAM Retention Range Select Bit (Write Protect) - * | | |Select SRAM retention range when chip enter SPD mode. - * | | |000 = No SRAM retention. - * | | |001 = 16K SRAM retention when chip enter SPD mode. - * | | |010 = 32K SRAM retention when chip enter SPD mode. - * | | |011 = 64K SRAM retention when chip enter SPD mode. - * | | |100 = 128K SRAM retention when chip enter SPD mode. (default) - * | | |101 = 256K SRAM retention when chip enter SPD mode. - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[8] |WKTMREN |Wake-up Timer Enable Bit (Write Protect) - * | | |0 = Wake-up timer disabled at DPD/SPD mode. - * | | |1 = Wake-up timer enabled at DPD/SPD mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12:9] |WKTMRIS |Wake-up Timer Time-out Interval Select (Write Protect) - * | | |These bits control wake-up timer time-out interval when chip at DPD/SPD mode. - * | | |0000 = Time-out interval is 128 LIRC clocks (12.8 ms). - * | | |0001 = Time-out interval is 256 LIRC clocks (25.6 ms). - * | | |0010 = Time-out interval is 512 LIRC clocks (51.2 ms). - * | | |0011 = Time-out interval is 1024 LIRC clocks (102.4ms). - * | | |0100 = Time-out interval is 4096 LIRC clocks (409.6ms). - * | | |0101 = Time-out interval is 8192 LIRC clocks (819.2ms). - * | | |0110 = Time-out interval is 16384 LIRC clocks (1638.4ms). - * | | |0111 = Time-out interval is 65536 LIRC clocks (6553.6ms). - * | | |1000 = Time-out interval is 131072 LIRC clocks (13107.2ms). - * | | |1001 = Time-out interval is 262144 LIRC clocks (26214.4ms). - * | | |1010 = Time-out interval is 524288 LIRC clocks (52428.8ms). - * | | |1011 = Time-out interval is 1048576 LIRC clocks (104857.6ms). - * | | |Others = Time-out interval is 128 LIRC clocks (12.8ms). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[17:16] |WKPINEN0 |Wake-up Pin0 Enable Bit (Write Protect) - * | | |This is control register for GPC.0 to wake-up pin. - * | | |00 = Wake-up pin disabled at Deep Power-down mode. - * | | |01 = Wake-up pin rising edge enabled at Deep Power-down mode. - * | | |10 = Wake-up pin falling edge enabled at Deep Power-down mode. - * | | |11 = Wake-up pin both edge enabled at Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[18] |ACMPSPWK |ACMP Standby Power-down Mode Wake-up Enable Bit (Write Protect) - * | | |0 = ACMP wake-up disabled at Standby Power-down mode. - * | | |1 = ACMP wake-up enabled at Standby Power-down mode. - * | | |Note 1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Set FILTSEL(ACMP_CTLx[15:13]) for comparator output filter count selection, the filter clock is LIRC in ACMP SPD mode wakeup function. - * |[22] |VBUSWKEN |VBUS Wake-up Enable Bit (Write Protect) - * | | |0 = VBUS transition wake-up disabled at Deep Power-down mode. - * | | |1 = VBUS transition wake-up enabled at Deep Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |RTCWKEN |RTC Wake-up Enable Bit (Write Protect) - * | | |0 = RTC wake-up disabled at Deep Power-down mode or Standby Power-down mode. - * | | |1 = RTC wake-up enabled at Deep Power-down mode or Standby Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[25:24] |WKPINEN1 |Wake-up Pin1 Enable Bit (Write Protect) - * | | |This is control register for GPB.0 to wake-up pin. - * | | |00 = Wake-up pin disable at Deep Power-down mode. - * | | |01 = Wake-up pin rising edge enabled at Deep Power-down mode. - * | | |10 = Wake-up pin falling edge enabled at Deep Power-down mode. - * | | |11 = Wake-up pin both edge enabled at Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[27:26] |WKPINEN2 |Wake-up Pin2 Enable Bit (Write Protect) - * | | |This is control register for GPB.2 to wake-up pin. - * | | |00 = Wake-up pin disabled at Deep Power-down mode. - * | | |01 = Wake-up pin rising edge enabled at Deep Power-down mode. - * | | |10 = Wake-up pin falling edge enabled at Deep Power-down mode. - * | | |11 = Wake-up pin both edge enabled at Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[29:28] |WKPINEN3 |Wake-up Pin3 Enable Bit (Write Protect) - * | | |This is control register for GPB.12 to wake-up pin. - * | | |00 = Wake-up pin disabled at Deep Power-down mode. - * | | |01 = Wake-up pin rising edge enabled at Deep Power-down mode. - * | | |10 = Wake-up pin falling edge enabled at Deep Power-down mode. - * | | |11 = Wake-up pin both edge enabled at Deep Power-down mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[31:30] |WKPINEN4 |Wake-up Pin4 Enable Bit (Write Protect) - * | | |This is control register for GPF.6 to wake-up pin. - * | | |00 = Wake-up pin disabled at Deep Power-down mode. - * | | |01 = Wake-up pin rising edge enabled at Deep Power-down mode. - * | | |10 = Wake-up pin falling edge enabled at Deep Power-down mode. - * | | |11 = Wake-up pin both edge enabled at Deep Power-down mode. - * | | |Note 1: These bits are write protected. Refer to the SYS_REGLCTL register. - * | | |Note 2: Setting IOCTLSEL(RTC_LXTCTL[8]) to avoid GPF.6 unexpected falling edge. - * @var CLK_T::PMUSTS - * Offset: 0x94 Power Manager Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINWK0 |Pin0 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode was requested by a transition of the WAKEUP pin (GPC.0). - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering DPD mode. - * |[1] |TMRWK |Timer Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) or Standby Power-down (SPD) mode was requested by wakeup timer time-out. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD/DPD mode. - * |[2] |RTCWK |RTC Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Deep Power-down mode (DPD) or Standby Power-down (SPD) mode was requested with a RTC alarm, tick time or tamper happened. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD/DPD mode. - * |[3] |PINWK1 |Pin1 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode was requested by a transition of the WAKEUP pin (PB.0). - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering DPD mode. - * |[4] |PINWK2 |Pin2 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode was requested by a transition of the WAKEUP pin (PB.2). - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering DPD mode. - * |[5] |PINWK3 |Pin3 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode was requested by a transition of the WAKEUP pin (PB.12). - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering DPD mode. - * |[6] |PINWK4 |Pin4 Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode was requested by a transition of the WAKEUP pin (PF.6). - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering DPD mode. - * |[7] |VBUSWK |VBUS Wake-up Flag( Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode was requested by a transition of the WAKEUP pin (PA.12). - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering DPD mode. - * |[8] |GPAWK |GPA Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPA group pins. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[9] |GPBWK |GPB Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPB group pins. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[10] |GPCWK |GPC Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPC group pins. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[11] |GPDWK |GPD Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPD group pins. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[12] |LVRWK |LVR Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode was requested with a LVR happened. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[13] |BODWK |BOD Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with a BOD happened. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[15] |RSTWK |RST pin Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Deep Power-down mode (DPD) or Standby Power-down (SPD) mode was requested with a RST pin trigger happened. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD/DPD mode. - * |[16] |ACMPWK0 |ACMP0 Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with an ACMP0 transition. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[17] |ACMPWK1 |ACMP1 Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with an ACMP1 transition. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[18] |ACMPWK2 |ACMP2 Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with an ACMP2 transition. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[19] |ACMPWK3 |ACMP3 Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with an ACMP3 transition. - * | | |Note: This flag needs to be cleared by setting CLRWK(CLK_PMUSTS[31] when entering SPD mode. - * |[31] |CLRWK |Clear Wake-up Flag - * | | |0 = No clear. - * | | |1= Clear all wake-up flag. - * | | |Note: This bit is auto cleared by hardware. - * @var CLK_T::SWKDBCTL - * Offset: 0x9C GPIO Standby Power-down Wake-up De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SWKDBCLKSEL|Standby Power-down Wake-up De-bounce Sampling Cycle Selection - * | | |0000 = Sample wake-up input once per 1 clock. - * | | |0001 = Sample wake-up input once per 2 clocks. - * | | |0010 = Sample wake-up input once per 4 clocks. - * | | |0011 = Sample wake-up input once per 8 clocks. - * | | |0100 = Sample wake-up input once per 16 clocks. - * | | |0101 = Sample wake-up input once per 32 clocks. - * | | |0110 = Sample wake-up input once per 64 clocks. - * | | |0111 = Sample wake-up input once per 128 clocks. - * | | |1000 = Sample wake-up input once per 256 clocks. - * | | |1001 = Sample wake-up input once per 2*256 clocks. - * | | |1010 = Sample wake-up input once per 4*256 clocks. - * | | |1011 = Sample wake-up input once per 8*256 clocks. - * | | |1100 = Sample wake-up input once per 16*256 clocks. - * | | |1101 = Sample wake-up input once per 32*256 clocks. - * | | |1110 = Sample wake-up input once per 64*256 clocks. - * | | |1111 = Sample wake-up input once per 128*256 clocks.. - * | | |Note: De-bounce counter clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * @var CLK_T::PASWKCTL - * Offset: 0xA0 GPA Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPA group pin wake-up function Disabled. - * | | |1 = GPA group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPA group pin rising edge wake-up function Disabled. - * | | |1 = GPA group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPA group pin falling edge wake-up function Disabled. - * | | |1 = GPA group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPA Standby Power-down Wake-up Pin Select - * | | |0000 = GPA.0 wake-up function Enabled. - * | | |0001 = GPA.1 wake-up function Enabled. - * | | |0010 = GPA.2 wake-up function Enabled. - * | | |0011 = GPA.3 wake-up function Enabled. - * | | |0100 = GPA.4 wake-up function Enabled. - * | | |0101 = GPA.5 wake-up function Enabled. - * | | |0110 = GPA.6 wake-up function Enabled. - * | | |0111 = GPA.7 wake-up function Enabled. - * | | |1000 = GPA.8 wake-up function Enabled. - * | | |1001 = GPA.9 wake-up function Enabled. - * | | |1010 = GPA.10 wake-up function Enabled. - * | | |1011 = GPA.11 wake-up function Enabled. - * | | |1100 = GPA.12 wake-up function Enabled. - * | | |1101 = GPA.13 wake-up function Enabled. - * | | |1110 = GPA.14 wake-up function Enabled. - * | | |1111 = GPA.15 wake-up function Enabled. - * |[8] |DBEN |GPA Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding I/O. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up. - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * | | |0 = Standby power-down wake-up pin De-bounce function Disabled. - * | | |1 = Standby power-down wake-up pin De-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PBSWKCTL - * Offset: 0xA4 GPB Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPB group pin wake-up function Disabled. - * | | |1 = GPB group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPB group pin rising edge wake-up function Disabled. - * | | |1 = GPB group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPB group pin falling edge wake-up function Disabled. - * | | |1 = GPB group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPB Standby Power-down Wake-up Pin Select - * | | |0000 = GPB.0 wake-up function Enabled. - * | | |0001 = GPB.1 wake-up function Enabled. - * | | |0010 = GPB.2 wake-up function Enabled. - * | | |0011 = GPB.3 wake-up function Enabled. - * | | |0100 = GPB.4 wake-up function Enabled. - * | | |0101 = GPB.5 wake-up function Enabled. - * | | |0110 = GPB.6 wake-up function Enabled. - * | | |0111 = GPB.7 wake-up function Enabled. - * | | |1000 = GPB.8 wake-up function Enabled. - * | | |1001 = GPB.9 wake-up function Enabled. - * | | |1010 = GPB.10 wake-up function Enabled. - * | | |1011 = GPB.11 wake-up function Enabled. - * | | |1100 = GPB.12 wake-up function Enabled. - * | | |1101 = GPB.13 wake-up function Enabled. - * | | |1110 = GPB.14 wake-up function Enabled. - * | | |1111 = GPB.15 wake-up function Enabled. - * |[8] |DBEN |GPB Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding I/O. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up. - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator. (LIRC) - * | | |0 = Standby power-down wake-up pin De-bounce function Disabled. - * | | |1 = Standby power-down wake-up pin De-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PCSWKCTL - * Offset: 0xA8 GPC Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPC group pin wake-up function Disabled. - * | | |1 = GPC group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPC group pin rising edge wake-up function Disabled. - * | | |1 = GPC group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPC group pin falling edge wake-up function Disabled. - * | | |1 = GPC group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPC Standby Power-down Wake-up Pin Select - * | | |0000 = GPC.0 wake-up function Enabled. - * | | |0001 = GPC.1 wake-up function Enabled. - * | | |0010 = GPC.2 wake-up function Enabled. - * | | |0011 = GPC.3 wake-up function Enabled. - * | | |0100 = GPC.4 wake-up function Enabled. - * | | |0101 = GPC.5 wake-up function Enabled. - * | | |0110 = GPC.6 wake-up function Enabled. - * | | |0111 = GPC.7 wake-up function Enabled. - * | | |1000 = GPC.8 wake-up function Enabled. - * | | |1001 = GPC.9 wake-up function Enabled. - * | | |1010 = GPC.10 wake-up function Enabled. - * | | |1011 = GPC.11 wake-up function Enabled. - * | | |1100 = GPC.12 wake-up function Enabled. - * | | |1101 = GPC.13 wake-up function Enabled. - * | | |1110 = GPC.14 wake-up function Enabled. - * | | |1111 = GPC.15 wake-up function Enabled. - * |[8] |DBEN |GPC Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding I/O. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up. - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * | | |0 = Standby power-down wake-up pin De-bounce function Disabled. - * | | |1 = Standby power-down wake-up pin De-bounce function Enabled. - * | | |Note: The de-bounce function is valid only for edge triggered. - * @var CLK_T::PDSWKCTL - * Offset: 0xAC GPD Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPD group pin wake-up function Disabled. - * | | |1 = GPD group pin wake-up function Enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPD group pin rising edge wake-up function Disabled. - * | | |1 = GPD group pin rising edge wake-up function Enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPD group pin falling edge wake-up function Disabled. - * | | |1 = GPD group pin falling edge wake-up function Enabled. - * |[7:4] |WKPSEL |GPD Standby Power-down Wake-up Pin Select - * | | |0000 = GPD.0 wake-up function Enabled. - * | | |0001 = GPD.1 wake-up function Enabled. - * | | |0010 = GPD.2 wake-up function Enabled. - * | | |0011 = GPD.3 wake-up function Enabled. - * | | |0100 = GPD.4 wake-up function Enabled. - * | | |0101 = GPD.5 wake-up function Enabled. - * | | |0110 = GPD.6 wake-up function Enabled. - * | | |0111 = GPD.7 wake-up function Enabled. - * | | |1000 = GPD.8 wake-up function Enabled. - * | | |1001 = GPD.9 wake-up function Enabled. - * | | |1010 = GPD.10 wake-up function Enabled. - * | | |1011 = GPD.11 wake-up function Enabled. - * | | |1100 = GPD.12 wake-up function Enabled. - * | | |1101 = GPD.13 wake-up function Enabled. - * | | |1110 = GPD.14 wake-up function Enabled. - * | | |1111 = GPD.15 wake-up function Enabled. - * |[8] |DBEN |GPD Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding I/O. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up. - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * | | |0 = Standby power-down wake-up pin De-bounce function Disabled. - * | | |1 = Standby power-down wake-up pin De-bounce function Enabled. - * | | |Note: The de-bounce function is valid only for edge triggered. - * @var CLK_T::IOPDCTL - * Offset: 0xB0 GPIO Standby Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IOHR |GPIO Hold Release - * | | |When GPIO enters deep power-down mode or standby power-down mode, all I/O status are hold to keep normal operating status. - * | | |After chip is woken up from deep power-down mode or standby power-down mode, the I/O are still keep hold status until user set this bit to release I/O hold status. - * | | |Note: This bit is auto cleared by hardware. - */ - __IO uint32_t PWRCTL; /*!< [0x0000] System Power-down Control Register */ - __IO uint32_t AHBCLK0; /*!< [0x0004] AHB Devices Clock Enable Control Register 0 */ - __IO uint32_t APBCLK0; /*!< [0x0008] APB Devices Clock Enable Control Register 0 */ - __IO uint32_t APBCLK1; /*!< [0x000c] APB Devices Clock Enable Control Register 1 */ - __IO uint32_t CLKSEL0; /*!< [0x0010] Clock Source Select Control Register 0 */ - __IO uint32_t CLKSEL1; /*!< [0x0014] Clock Source Select Control Register 1 */ - __IO uint32_t CLKSEL2; /*!< [0x0018] Clock Source Select Control Register 2 */ - __IO uint32_t CLKSEL3; /*!< [0x001c] Clock Source Select Control Register 3 */ - __IO uint32_t CLKDIV0; /*!< [0x0020] Clock Divider Number Register 0 */ - __IO uint32_t CLKDIV1; /*!< [0x0024] Clock Divider Number Register 1 */ - __IO uint32_t CLKDIV2; /*!< [0x0028] Clock Divider Number Register 2 */ - __IO uint32_t CLKDIV3; /*!< [0x002c] Clock Divider Number Register 3 */ - __IO uint32_t CLKDIV4; /*!< [0x0030] Clock Divider Number Register 4 */ - __IO uint32_t PCLKDIV; /*!< [0x0034] APB Clock Divider Register */ - __IO uint32_t APBCLK2; /*!< [0x0038] APB Devices Clock Enable Control Register 2 */ - __IO uint32_t CLKDIV5; /*!< [0x003c] Clock Divider Number Register 5 */ - __IO uint32_t PLLCTL; /*!< [0x0040] PLL Control Register */ - __I uint32_t RESERVE0[1]; - __IO uint32_t PLLFNCTL0; /*!< [0x0048] PLLFN Control Register 0 */ - __IO uint32_t PLLFNCTL1; /*!< [0x004c] PLLFN Control Register 1 */ - __I uint32_t STATUS; /*!< [0x0050] Clock Status Monitor Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t AHBCLK1; /*!< [0x0058] AHB Devices Clock Enable Control Register 1 */ - __IO uint32_t CLKSEL4; /*!< [0x005c] Clock Source Select Control Register 4 */ - __IO uint32_t CLKOCTL; /*!< [0x0060] Clock Output Control Register */ - __I uint32_t RESERVE3[3]; - __IO uint32_t CLKDCTL; /*!< [0x0070] Clock Fail Detector Control Register */ - __IO uint32_t CLKDSTS; /*!< [0x0074] Clock Fail Detector Status Register */ - __IO uint32_t CDUPB; /*!< [0x0078] Clock Frequency Range Detector Upper Boundary Register */ - __IO uint32_t CDLOWB; /*!< [0x007c] Clock Frequency Range Detector Lower Boundary Register */ - __IO uint32_t STOPREQ; /*!< [0x0080] Clock Stop Request Register */ - __I uint32_t STOPACK; /*!< [0x0084] Clock Stop Acknowledge Register */ - __I uint32_t RESERVE4[2]; - __IO uint32_t PMUCTL; /*!< [0x0090] Power Manager Control Register */ - __IO uint32_t PMUSTS; /*!< [0x0094] Power Manager Status Register */ - __I uint32_t RESERVE5[1]; - __IO uint32_t SWKDBCTL; /*!< [0x009c] GPIO Standby Power-down Wake-up De-bounce Control Register */ - __IO uint32_t PASWKCTL; /*!< [0x00a0] GPA Standby Power-down Wake-up Control Register */ - __IO uint32_t PBSWKCTL; /*!< [0x00a4] GPB Standby Power-down Wake-up Control Register */ - __IO uint32_t PCSWKCTL; /*!< [0x00a8] GPC Standby Power-down Wake-up Control Register */ - __IO uint32_t PDSWKCTL; /*!< [0x00ac] GPD Standby Power-down Wake-up Control Register */ - __IO uint32_t IOPDCTL; /*!< [0x00b0] GPIO Standby Power-down Control Register */ - -} CLK_T; - -/** - @addtogroup CLK_CONST CLK Bit Field Definition - Constant Definitions for CLK Controller -@{ */ - -#define CLK_PWRCTL_HXTEN_Pos (0) /*!< CLK_T::PWRCTL: HXTEN Position */ -#define CLK_PWRCTL_HXTEN_Msk (0x1ul << CLK_PWRCTL_HXTEN_Pos) /*!< CLK_T::PWRCTL: HXTEN Mask */ - -#define CLK_PWRCTL_LXTEN_Pos (1) /*!< CLK_T::PWRCTL: LXTEN Position */ -#define CLK_PWRCTL_LXTEN_Msk (0x1ul << CLK_PWRCTL_LXTEN_Pos) /*!< CLK_T::PWRCTL: LXTEN Mask */ - -#define CLK_PWRCTL_HIRCEN_Pos (2) /*!< CLK_T::PWRCTL: HIRCEN Position */ -#define CLK_PWRCTL_HIRCEN_Msk (0x1ul << CLK_PWRCTL_HIRCEN_Pos) /*!< CLK_T::PWRCTL: HIRCEN Mask */ - -#define CLK_PWRCTL_LIRCEN_Pos (3) /*!< CLK_T::PWRCTL: LIRCEN Position */ -#define CLK_PWRCTL_LIRCEN_Msk (0x1ul << CLK_PWRCTL_LIRCEN_Pos) /*!< CLK_T::PWRCTL: LIRCEN Mask */ - -#define CLK_PWRCTL_PDWKDLY_Pos (4) /*!< CLK_T::PWRCTL: PDWKDLY Position */ -#define CLK_PWRCTL_PDWKDLY_Msk (0x1ul << CLK_PWRCTL_PDWKDLY_Pos) /*!< CLK_T::PWRCTL: PDWKDLY Mask */ - -#define CLK_PWRCTL_PDWKIEN_Pos (5) /*!< CLK_T::PWRCTL: PDWKIEN Position */ -#define CLK_PWRCTL_PDWKIEN_Msk (0x1ul << CLK_PWRCTL_PDWKIEN_Pos) /*!< CLK_T::PWRCTL: PDWKIEN Mask */ - -#define CLK_PWRCTL_PDWKIF_Pos (6) /*!< CLK_T::PWRCTL: PDWKIF Position */ -#define CLK_PWRCTL_PDWKIF_Msk (0x1ul << CLK_PWRCTL_PDWKIF_Pos) /*!< CLK_T::PWRCTL: PDWKIF Mask */ - -#define CLK_PWRCTL_PDEN_Pos (7) /*!< CLK_T::PWRCTL: PDEN Position */ -#define CLK_PWRCTL_PDEN_Msk (0x1ul << CLK_PWRCTL_PDEN_Pos) /*!< CLK_T::PWRCTL: PDEN Mask */ - -#define CLK_PWRCTL_HXTGAIN_Pos (10) /*!< CLK_T::PWRCTL: HXTGAIN Position */ -#define CLK_PWRCTL_HXTGAIN_Msk (0x3ul << CLK_PWRCTL_HXTGAIN_Pos) /*!< CLK_T::PWRCTL: HXTGAIN Mask */ - -#define CLK_PWRCTL_HXTSELTYP_Pos (12) /*!< CLK_T::PWRCTL: HXTSELTYP Position */ -#define CLK_PWRCTL_HXTSELTYP_Msk (0x1ul << CLK_PWRCTL_HXTSELTYP_Pos) /*!< CLK_T::PWRCTL: HXTSELTYP Mask */ - -#define CLK_PWRCTL_HIRCSTBS_Pos (16) /*!< CLK_T::PWRCTL: HIRCSTBS Position */ -#define CLK_PWRCTL_HIRCSTBS_Msk (0x3ul << CLK_PWRCTL_HIRCSTBS_Pos) /*!< CLK_T::PWRCTL: HIRCSTBS Mask */ - -#define CLK_PWRCTL_HIRC48MEN_Pos (18) /*!< CLK_T::PWRCTL: HIRC48MEN Position */ -#define CLK_PWRCTL_HIRC48MEN_Msk (0x1ul << CLK_PWRCTL_HIRC48MEN_Pos) /*!< CLK_T::PWRCTL: HIRC48MEN Mask */ - -#define CLK_PWRCTL_HXTMD_Pos (31) /*!< CLK_T::PWRCTL: HXTMD Position */ -#define CLK_PWRCTL_HXTMD_Msk (0x1ul << CLK_PWRCTL_HXTMD_Pos) /*!< CLK_T::PWRCTL: HXTMD Mask */ - -#define CLK_AHBCLK0_PDMA0CKEN_Pos (1) /*!< CLK_T::AHBCLK0: PDMA0CKEN Position */ -#define CLK_AHBCLK0_PDMA0CKEN_Msk (0x1ul << CLK_AHBCLK0_PDMA0CKEN_Pos) /*!< CLK_T::AHBCLK0: PDMA0CKEN Mask */ - -#define CLK_AHBCLK0_ISPCKEN_Pos (2) /*!< CLK_T::AHBCLK0: ISPCKEN Position */ -#define CLK_AHBCLK0_ISPCKEN_Msk (0x1ul << CLK_AHBCLK0_ISPCKEN_Pos) /*!< CLK_T::AHBCLK0: ISPCKEN Mask */ - -#define CLK_AHBCLK0_EBICKEN_Pos (3) /*!< CLK_T::AHBCLK0: EBICKEN Position */ -#define CLK_AHBCLK0_EBICKEN_Msk (0x1ul << CLK_AHBCLK0_EBICKEN_Pos) /*!< CLK_T::AHBCLK0: EBICKEN Mask */ - -#define CLK_AHBCLK0_STCKEN_Pos (4) /*!< CLK_T::AHBCLK0: STCKEN Position */ -#define CLK_AHBCLK0_STCKEN_Msk (0x1ul << CLK_AHBCLK0_STCKEN_Pos) /*!< CLK_T::AHBCLK0: STCKEN Mask */ - -#define CLK_AHBCLK0_EMAC0CKEN_Pos (5) /*!< CLK_T::AHBCLK0: EMAC0CKEN Position */ -#define CLK_AHBCLK0_EMAC0CKEN_Msk (0x1ul << CLK_AHBCLK0_EMAC0CKEN_Pos) /*!< CLK_T::AHBCLK0: EMAC0CKEN Mask */ - -#define CLK_AHBCLK0_SDH0CKEN_Pos (6) /*!< CLK_T::AHBCLK0: SDH0CKEN Position */ -#define CLK_AHBCLK0_SDH0CKEN_Msk (0x1ul << CLK_AHBCLK0_SDH0CKEN_Pos) /*!< CLK_T::AHBCLK0: SDH0CKEN Mask */ - -#define CLK_AHBCLK0_CRCCKEN_Pos (7) /*!< CLK_T::AHBCLK0: CRCCKEN Position */ -#define CLK_AHBCLK0_CRCCKEN_Msk (0x1ul << CLK_AHBCLK0_CRCCKEN_Pos) /*!< CLK_T::AHBCLK0: CRCCKEN Mask */ - -#define CLK_AHBCLK0_CCAPCKEN_Pos (8) /*!< CLK_T::AHBCLK0: CCAPCKEN Position */ -#define CLK_AHBCLK0_CCAPCKEN_Msk (0x1ul << CLK_AHBCLK0_CCAPCKEN_Pos) /*!< CLK_T::AHBCLK0: CCAPCKEN Mask */ - -#define CLK_AHBCLK0_SENCKEN_Pos (9) /*!< CLK_T::AHBCLK0: SENCKEN Position */ -#define CLK_AHBCLK0_SENCKEN_Msk (0x1ul << CLK_AHBCLK0_SENCKEN_Pos) /*!< CLK_T::AHBCLK0: SENCKEN Mask */ - -#define CLK_AHBCLK0_HSUSBDCKEN_Pos (10) /*!< CLK_T::AHBCLK0: HSUSBDCKEN Position */ -#define CLK_AHBCLK0_HSUSBDCKEN_Msk (0x1ul << CLK_AHBCLK0_HSUSBDCKEN_Pos) /*!< CLK_T::AHBCLK0: HSUSBDCKEN Mask */ - -#define CLK_AHBCLK0_HBICKEN_Pos (11) /*!< CLK_T::AHBCLK0: HBICKEN Position */ -#define CLK_AHBCLK0_HBICKEN_Msk (0x1ul << CLK_AHBCLK0_HBICKEN_Pos) /*!< CLK_T::AHBCLK0: HBICKEN Mask */ - -#define CLK_AHBCLK0_CRPTCKEN_Pos (12) /*!< CLK_T::AHBCLK0: CRPTCKEN Position */ -#define CLK_AHBCLK0_CRPTCKEN_Msk (0x1ul << CLK_AHBCLK0_CRPTCKEN_Pos) /*!< CLK_T::AHBCLK0: CRPTCKEN Mask */ - -#define CLK_AHBCLK0_KSCKEN_Pos (13) /*!< CLK_T::AHBCLK0: KSCKEN Position */ -#define CLK_AHBCLK0_KSCKEN_Msk (0x1ul << CLK_AHBCLK0_KSCKEN_Pos) /*!< CLK_T::AHBCLK0: KSCKEN Mask */ - -#define CLK_AHBCLK0_SPIMCKEN_Pos (14) /*!< CLK_T::AHBCLK0: SPIMCKEN Position */ -#define CLK_AHBCLK0_SPIMCKEN_Msk (0x1ul << CLK_AHBCLK0_SPIMCKEN_Pos) /*!< CLK_T::AHBCLK0: SPIMCKEN Mask */ - -#define CLK_AHBCLK0_FMCIDLE_Pos (15) /*!< CLK_T::AHBCLK0: FMCIDLE Position */ -#define CLK_AHBCLK0_FMCIDLE_Msk (0x1ul << CLK_AHBCLK0_FMCIDLE_Pos) /*!< CLK_T::AHBCLK0: FMCIDLE Mask */ - -#define CLK_AHBCLK0_USBHCKEN_Pos (16) /*!< CLK_T::AHBCLK0: USBHCKEN Position */ -#define CLK_AHBCLK0_USBHCKEN_Msk (0x1ul << CLK_AHBCLK0_USBHCKEN_Pos) /*!< CLK_T::AHBCLK0: USBHCKEN Mask */ - -#define CLK_AHBCLK0_SDH1CKEN_Pos (17) /*!< CLK_T::AHBCLK0: SDH1CKEN Position */ -#define CLK_AHBCLK0_SDH1CKEN_Msk (0x1ul << CLK_AHBCLK0_SDH1CKEN_Pos) /*!< CLK_T::AHBCLK0: SDH1CKEN Mask */ - -#define CLK_AHBCLK0_PDMA1CKEN_Pos (18) /*!< CLK_T::AHBCLK0: PDMA1CKEN Position */ -#define CLK_AHBCLK0_PDMA1CKEN_Msk (0x1ul << CLK_AHBCLK0_PDMA1CKEN_Pos) /*!< CLK_T::AHBCLK0: PDMA1CKEN Mask */ - -#define CLK_AHBCLK0_TRACECKEN_Pos (19) /*!< CLK_T::AHBCLK0: TRACECKEN Position */ -#define CLK_AHBCLK0_TRACECKEN_Msk (0x1ul << CLK_AHBCLK0_TRACECKEN_Pos) /*!< CLK_T::AHBCLK0: TRACECKEN Mask */ - -#define CLK_AHBCLK0_GPACKEN_Pos (24) /*!< CLK_T::AHBCLK0: GPACKEN Position */ -#define CLK_AHBCLK0_GPACKEN_Msk (0x1ul << CLK_AHBCLK0_GPACKEN_Pos) /*!< CLK_T::AHBCLK0: GPACKEN Mask */ - -#define CLK_AHBCLK0_GPBCKEN_Pos (25) /*!< CLK_T::AHBCLK0: GPBCKEN Position */ -#define CLK_AHBCLK0_GPBCKEN_Msk (0x1ul << CLK_AHBCLK0_GPBCKEN_Pos) /*!< CLK_T::AHBCLK0: GPBCKEN Mask */ - -#define CLK_AHBCLK0_GPCCKEN_Pos (26) /*!< CLK_T::AHBCLK0: GPCCKEN Position */ -#define CLK_AHBCLK0_GPCCKEN_Msk (0x1ul << CLK_AHBCLK0_GPCCKEN_Pos) /*!< CLK_T::AHBCLK0: GPCCKEN Mask */ - -#define CLK_AHBCLK0_GPDCKEN_Pos (27) /*!< CLK_T::AHBCLK0: GPDCKEN Position */ -#define CLK_AHBCLK0_GPDCKEN_Msk (0x1ul << CLK_AHBCLK0_GPDCKEN_Pos) /*!< CLK_T::AHBCLK0: GPDCKEN Mask */ - -#define CLK_AHBCLK0_GPECKEN_Pos (28) /*!< CLK_T::AHBCLK0: GPECKEN Position */ -#define CLK_AHBCLK0_GPECKEN_Msk (0x1ul << CLK_AHBCLK0_GPECKEN_Pos) /*!< CLK_T::AHBCLK0: GPECKEN Mask */ - -#define CLK_AHBCLK0_GPFCKEN_Pos (29) /*!< CLK_T::AHBCLK0: GPFCKEN Position */ -#define CLK_AHBCLK0_GPFCKEN_Msk (0x1ul << CLK_AHBCLK0_GPFCKEN_Pos) /*!< CLK_T::AHBCLK0: GPFCKEN Mask */ - -#define CLK_AHBCLK0_GPGCKEN_Pos (30) /*!< CLK_T::AHBCLK0: GPGCKEN Position */ -#define CLK_AHBCLK0_GPGCKEN_Msk (0x1ul << CLK_AHBCLK0_GPGCKEN_Pos) /*!< CLK_T::AHBCLK0: GPGCKEN Mask */ - -#define CLK_AHBCLK0_GPHCKEN_Pos (31) /*!< CLK_T::AHBCLK0: GPHCKEN Position */ -#define CLK_AHBCLK0_GPHCKEN_Msk (0x1ul << CLK_AHBCLK0_GPHCKEN_Pos) /*!< CLK_T::AHBCLK0: GPHCKEN Mask */ - -#define CLK_APBCLK0_WDTCKEN_Pos (0) /*!< CLK_T::APBCLK0: WDTCKEN Position */ -#define CLK_APBCLK0_WDTCKEN_Msk (0x1ul << CLK_APBCLK0_WDTCKEN_Pos) /*!< CLK_T::APBCLK0: WDTCKEN Mask */ - -#define CLK_APBCLK0_RTCCKEN_Pos (1) /*!< CLK_T::APBCLK0: RTCCKEN Position */ -#define CLK_APBCLK0_RTCCKEN_Msk (0x1ul << CLK_APBCLK0_RTCCKEN_Pos) /*!< CLK_T::APBCLK0: RTCCKEN Mask */ - -#define CLK_APBCLK0_TMR0CKEN_Pos (2) /*!< CLK_T::APBCLK0: TMR0CKEN Position */ -#define CLK_APBCLK0_TMR0CKEN_Msk (0x1ul << CLK_APBCLK0_TMR0CKEN_Pos) /*!< CLK_T::APBCLK0: TMR0CKEN Mask */ - -#define CLK_APBCLK0_TMR1CKEN_Pos (3) /*!< CLK_T::APBCLK0: TMR1CKEN Position */ -#define CLK_APBCLK0_TMR1CKEN_Msk (0x1ul << CLK_APBCLK0_TMR1CKEN_Pos) /*!< CLK_T::APBCLK0: TMR1CKEN Mask */ - -#define CLK_APBCLK0_TMR2CKEN_Pos (4) /*!< CLK_T::APBCLK0: TMR2CKEN Position */ -#define CLK_APBCLK0_TMR2CKEN_Msk (0x1ul << CLK_APBCLK0_TMR2CKEN_Pos) /*!< CLK_T::APBCLK0: TMR2CKEN Mask */ - -#define CLK_APBCLK0_TMR3CKEN_Pos (5) /*!< CLK_T::APBCLK0: TMR3CKEN Position */ -#define CLK_APBCLK0_TMR3CKEN_Msk (0x1ul << CLK_APBCLK0_TMR3CKEN_Pos) /*!< CLK_T::APBCLK0: TMR3CKEN Mask */ - -#define CLK_APBCLK0_CLKOCKEN_Pos (6) /*!< CLK_T::APBCLK0: CLKOCKEN Position */ -#define CLK_APBCLK0_CLKOCKEN_Msk (0x1ul << CLK_APBCLK0_CLKOCKEN_Pos) /*!< CLK_T::APBCLK0: CLKOCKEN Mask */ - -#define CLK_APBCLK0_ACMP01CKEN_Pos (7) /*!< CLK_T::APBCLK0: ACMP01CKEN Position */ -#define CLK_APBCLK0_ACMP01CKEN_Msk (0x1ul << CLK_APBCLK0_ACMP01CKEN_Pos) /*!< CLK_T::APBCLK0: ACMP01CKEN Mask */ - -#define CLK_APBCLK0_I2C0CKEN_Pos (8) /*!< CLK_T::APBCLK0: I2C0CKEN Position */ -#define CLK_APBCLK0_I2C0CKEN_Msk (0x1ul << CLK_APBCLK0_I2C0CKEN_Pos) /*!< CLK_T::APBCLK0: I2C0CKEN Mask */ - -#define CLK_APBCLK0_I2C1CKEN_Pos (9) /*!< CLK_T::APBCLK0: I2C1CKEN Position */ -#define CLK_APBCLK0_I2C1CKEN_Msk (0x1ul << CLK_APBCLK0_I2C1CKEN_Pos) /*!< CLK_T::APBCLK0: I2C1CKEN Mask */ - -#define CLK_APBCLK0_I2C2CKEN_Pos (10) /*!< CLK_T::APBCLK0: I2C2CKEN Position */ -#define CLK_APBCLK0_I2C2CKEN_Msk (0x1ul << CLK_APBCLK0_I2C2CKEN_Pos) /*!< CLK_T::APBCLK0: I2C2CKEN Mask */ - -#define CLK_APBCLK0_I2C3CKEN_Pos (11) /*!< CLK_T::APBCLK0: I2C3CKEN Position */ -#define CLK_APBCLK0_I2C3CKEN_Msk (0x1ul << CLK_APBCLK0_I2C3CKEN_Pos) /*!< CLK_T::APBCLK0: I2C3CKEN Mask */ - -#define CLK_APBCLK0_QSPI0CKEN_Pos (12) /*!< CLK_T::APBCLK0: QSPI0CKEN Position */ -#define CLK_APBCLK0_QSPI0CKEN_Msk (0x1ul << CLK_APBCLK0_QSPI0CKEN_Pos) /*!< CLK_T::APBCLK0: QSPI0CKEN Mask */ - -#define CLK_APBCLK0_SPI0CKEN_Pos (13) /*!< CLK_T::APBCLK0: SPI0CKEN Position */ -#define CLK_APBCLK0_SPI0CKEN_Msk (0x1ul << CLK_APBCLK0_SPI0CKEN_Pos) /*!< CLK_T::APBCLK0: SPI0CKEN Mask */ - -#define CLK_APBCLK0_SPI1CKEN_Pos (14) /*!< CLK_T::APBCLK0: SPI1CKEN Position */ -#define CLK_APBCLK0_SPI1CKEN_Msk (0x1ul << CLK_APBCLK0_SPI1CKEN_Pos) /*!< CLK_T::APBCLK0: SPI1CKEN Mask */ - -#define CLK_APBCLK0_SPI2CKEN_Pos (15) /*!< CLK_T::APBCLK0: SPI2CKEN Position */ -#define CLK_APBCLK0_SPI2CKEN_Msk (0x1ul << CLK_APBCLK0_SPI2CKEN_Pos) /*!< CLK_T::APBCLK0: SPI2CKEN Mask */ - -#define CLK_APBCLK0_UART0CKEN_Pos (16) /*!< CLK_T::APBCLK0: UART0CKEN Position */ -#define CLK_APBCLK0_UART0CKEN_Msk (0x1ul << CLK_APBCLK0_UART0CKEN_Pos) /*!< CLK_T::APBCLK0: UART0CKEN Mask */ - -#define CLK_APBCLK0_UART1CKEN_Pos (17) /*!< CLK_T::APBCLK0: UART1CKEN Position */ -#define CLK_APBCLK0_UART1CKEN_Msk (0x1ul << CLK_APBCLK0_UART1CKEN_Pos) /*!< CLK_T::APBCLK0: UART1CKEN Mask */ - -#define CLK_APBCLK0_UART2CKEN_Pos (18) /*!< CLK_T::APBCLK0: UART2CKEN Position */ -#define CLK_APBCLK0_UART2CKEN_Msk (0x1ul << CLK_APBCLK0_UART2CKEN_Pos) /*!< CLK_T::APBCLK0: UART2CKEN Mask */ - -#define CLK_APBCLK0_UART3CKEN_Pos (19) /*!< CLK_T::APBCLK0: UART3CKEN Position */ -#define CLK_APBCLK0_UART3CKEN_Msk (0x1ul << CLK_APBCLK0_UART3CKEN_Pos) /*!< CLK_T::APBCLK0: UART3CKEN Mask */ - -#define CLK_APBCLK0_UART4CKEN_Pos (20) /*!< CLK_T::APBCLK0: UART4CKEN Position */ -#define CLK_APBCLK0_UART4CKEN_Msk (0x1ul << CLK_APBCLK0_UART4CKEN_Pos) /*!< CLK_T::APBCLK0: UART4CKEN Mask */ - -#define CLK_APBCLK0_UART5CKEN_Pos (21) /*!< CLK_T::APBCLK0: UART5CKEN Position */ -#define CLK_APBCLK0_UART5CKEN_Msk (0x1ul << CLK_APBCLK0_UART5CKEN_Pos) /*!< CLK_T::APBCLK0: UART5CKEN Mask */ - -#define CLK_APBCLK0_UART6CKEN_Pos (22) /*!< CLK_T::APBCLK0: UART6CKEN Position */ -#define CLK_APBCLK0_UART6CKEN_Msk (0x1ul << CLK_APBCLK0_UART6CKEN_Pos) /*!< CLK_T::APBCLK0: UART6CKEN Mask */ - -#define CLK_APBCLK0_UART7CKEN_Pos (23) /*!< CLK_T::APBCLK0: UART7CKEN Position */ -#define CLK_APBCLK0_UART7CKEN_Msk (0x1ul << CLK_APBCLK0_UART7CKEN_Pos) /*!< CLK_T::APBCLK0: UART7CKEN Mask */ - -#define CLK_APBCLK0_OTGCKEN_Pos (26) /*!< CLK_T::APBCLK0: OTGCKEN Position */ -#define CLK_APBCLK0_OTGCKEN_Msk (0x1ul << CLK_APBCLK0_OTGCKEN_Pos) /*!< CLK_T::APBCLK0: OTGCKEN Mask */ - -#define CLK_APBCLK0_USBDCKEN_Pos (27) /*!< CLK_T::APBCLK0: USBDCKEN Position */ -#define CLK_APBCLK0_USBDCKEN_Msk (0x1ul << CLK_APBCLK0_USBDCKEN_Pos) /*!< CLK_T::APBCLK0: USBDCKEN Mask */ - -#define CLK_APBCLK0_EADC0CKEN_Pos (28) /*!< CLK_T::APBCLK0: EADC0CKEN Position */ -#define CLK_APBCLK0_EADC0CKEN_Msk (0x1ul << CLK_APBCLK0_EADC0CKEN_Pos) /*!< CLK_T::APBCLK0: EADC0CKEN Mask */ - -#define CLK_APBCLK0_I2S0CKEN_Pos (29) /*!< CLK_T::APBCLK0: I2S0CKEN Position */ -#define CLK_APBCLK0_I2S0CKEN_Msk (0x1ul << CLK_APBCLK0_I2S0CKEN_Pos) /*!< CLK_T::APBCLK0: I2S0CKEN Mask */ - -#define CLK_APBCLK0_HSOTGCKEN_Pos (30) /*!< CLK_T::APBCLK0: HSOTGCKEN Position */ -#define CLK_APBCLK0_HSOTGCKEN_Msk (0x1ul << CLK_APBCLK0_HSOTGCKEN_Pos) /*!< CLK_T::APBCLK0: HSOTGCKEN Mask */ - -#define CLK_APBCLK1_SC0CKEN_Pos (0) /*!< CLK_T::APBCLK1: SC0CKEN Position */ -#define CLK_APBCLK1_SC0CKEN_Msk (0x1ul << CLK_APBCLK1_SC0CKEN_Pos) /*!< CLK_T::APBCLK1: SC0CKEN Mask */ - -#define CLK_APBCLK1_SC1CKEN_Pos (1) /*!< CLK_T::APBCLK1: SC1CKEN Position */ -#define CLK_APBCLK1_SC1CKEN_Msk (0x1ul << CLK_APBCLK1_SC1CKEN_Pos) /*!< CLK_T::APBCLK1: SC1CKEN Mask */ - -#define CLK_APBCLK1_SC2CKEN_Pos (2) /*!< CLK_T::APBCLK1: SC2CKEN Position */ -#define CLK_APBCLK1_SC2CKEN_Msk (0x1ul << CLK_APBCLK1_SC2CKEN_Pos) /*!< CLK_T::APBCLK1: SC2CKEN Mask */ - -#define CLK_APBCLK1_I2C4CKEN_Pos (3) /*!< CLK_T::APBCLK1: I2C4CKEN Position */ -#define CLK_APBCLK1_I2C4CKEN_Msk (0x1ul << CLK_APBCLK1_I2C4CKEN_Pos) /*!< CLK_T::APBCLK1: I2C4CKEN Mask */ - -#define CLK_APBCLK1_QSPI1CKEN_Pos (4) /*!< CLK_T::APBCLK1: QSPI1CKEN Position */ -#define CLK_APBCLK1_QSPI1CKEN_Msk (0x1ul << CLK_APBCLK1_QSPI1CKEN_Pos) /*!< CLK_T::APBCLK1: QSPI1CKEN Mask */ - -#define CLK_APBCLK1_SPI3CKEN_Pos (6) /*!< CLK_T::APBCLK1: SPI3CKEN Position */ -#define CLK_APBCLK1_SPI3CKEN_Msk (0x1ul << CLK_APBCLK1_SPI3CKEN_Pos) /*!< CLK_T::APBCLK1: SPI3CKEN Mask */ - -#define CLK_APBCLK1_SPI4CKEN_Pos (7) /*!< CLK_T::APBCLK1: SPI4CKEN Position */ -#define CLK_APBCLK1_SPI4CKEN_Msk (0x1ul << CLK_APBCLK1_SPI4CKEN_Pos) /*!< CLK_T::APBCLK1: SPI4CKEN Mask */ - -#define CLK_APBCLK1_USCI0CKEN_Pos (8) /*!< CLK_T::APBCLK1: USCI0CKEN Position */ -#define CLK_APBCLK1_USCI0CKEN_Msk (0x1ul << CLK_APBCLK1_USCI0CKEN_Pos) /*!< CLK_T::APBCLK1: USCI0CKEN Mask */ - -#define CLK_APBCLK1_PSIOCKEN_Pos (10) /*!< CLK_T::APBCLK1: PSIOCKEN Position */ -#define CLK_APBCLK1_PSIOCKEN_Msk (0x1ul << CLK_APBCLK1_PSIOCKEN_Pos) /*!< CLK_T::APBCLK1: PSIOCKEN Mask */ - -#define CLK_APBCLK1_DACCKEN_Pos (12) /*!< CLK_T::APBCLK1: DACCKEN Position */ -#define CLK_APBCLK1_DACCKEN_Msk (0x1ul << CLK_APBCLK1_DACCKEN_Pos) /*!< CLK_T::APBCLK1: DACCKEN Mask */ - -#define CLK_APBCLK1_ECAP2CKEN_Pos (13) /*!< CLK_T::APBCLK1: ECAP2CKEN Position */ -#define CLK_APBCLK1_ECAP2CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP2CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP2CKEN Mask */ - -#define CLK_APBCLK1_ECAP3CKEN_Pos (14) /*!< CLK_T::APBCLK1: ECAP3CKEN Position */ -#define CLK_APBCLK1_ECAP3CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP3CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP3CKEN Mask */ - -#define CLK_APBCLK1_EPWM0CKEN_Pos (16) /*!< CLK_T::APBCLK1: EPWM0CKEN Position */ -#define CLK_APBCLK1_EPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM0CKEN Mask */ - -#define CLK_APBCLK1_EPWM1CKEN_Pos (17) /*!< CLK_T::APBCLK1: EPWM1CKEN Position */ -#define CLK_APBCLK1_EPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM1CKEN Mask */ - -#define CLK_APBCLK1_BPWM0CKEN_Pos (18) /*!< CLK_T::APBCLK1: BPWM0CKEN Position */ -#define CLK_APBCLK1_BPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM0CKEN Mask */ - -#define CLK_APBCLK1_BPWM1CKEN_Pos (19) /*!< CLK_T::APBCLK1: BPWM1CKEN Position */ -#define CLK_APBCLK1_BPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM1CKEN Mask */ - -#define CLK_APBCLK1_EQEI2CKEN_Pos (20) /*!< CLK_T::APBCLK1: EQEI2CKEN Position */ -#define CLK_APBCLK1_EQEI2CKEN_Msk (0x1ul << CLK_APBCLK1_EQEI2CKEN_Pos) /*!< CLK_T::APBCLK1: EQEI2CKEN Mask */ - -#define CLK_APBCLK1_EQEI3CKEN_Pos (21) /*!< CLK_T::APBCLK1: EQEI3CKEN Position */ -#define CLK_APBCLK1_EQEI3CKEN_Msk (0x1ul << CLK_APBCLK1_EQEI3CKEN_Pos) /*!< CLK_T::APBCLK1: EQEI3CKEN Mask */ - -#define CLK_APBCLK1_EQEI0CKEN_Pos (22) /*!< CLK_T::APBCLK1: EQEI0CKEN Position */ -#define CLK_APBCLK1_EQEI0CKEN_Msk (0x1ul << CLK_APBCLK1_EQEI0CKEN_Pos) /*!< CLK_T::APBCLK1: EQEI0CKEN Mask */ - -#define CLK_APBCLK1_EQEI1CKEN_Pos (23) /*!< CLK_T::APBCLK1: EQEI1CKEN Position */ -#define CLK_APBCLK1_EQEI1CKEN_Msk (0x1ul << CLK_APBCLK1_EQEI1CKEN_Pos) /*!< CLK_T::APBCLK1: EQEI1CKEN Mask */ - -#define CLK_APBCLK1_TRNGCKEN_Pos (25) /*!< CLK_T::APBCLK1: TRNGCKEN Position */ -#define CLK_APBCLK1_TRNGCKEN_Msk (0x1ul << CLK_APBCLK1_TRNGCKEN_Pos) /*!< CLK_T::APBCLK1: TRNGCKEN Mask */ - -#define CLK_APBCLK1_ECAP0CKEN_Pos (26) /*!< CLK_T::APBCLK1: ECAP0CKEN Position */ -#define CLK_APBCLK1_ECAP0CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP0CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP0CKEN Mask */ - -#define CLK_APBCLK1_ECAP1CKEN_Pos (27) /*!< CLK_T::APBCLK1: ECAP1CKEN Position */ -#define CLK_APBCLK1_ECAP1CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP1CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP1CKEN Mask */ - -#define CLK_APBCLK1_I2S1CKEN_Pos (29) /*!< CLK_T::APBCLK1: I2S1CKEN Position */ -#define CLK_APBCLK1_I2S1CKEN_Msk (0x1ul << CLK_APBCLK1_I2S1CKEN_Pos) /*!< CLK_T::APBCLK1: I2S1CKEN Mask */ - -#define CLK_APBCLK1_EADC1CKEN_Pos (31) /*!< CLK_T::APBCLK1: EADC1CKEN Position */ -#define CLK_APBCLK1_EADC1CKEN_Msk (0x1ul << CLK_APBCLK1_EADC1CKEN_Pos) /*!< CLK_T::APBCLK1: EADC1CKEN Mask */ - -#define CLK_CLKSEL0_HCLKSEL_Pos (0) /*!< CLK_T::CLKSEL0: HCLKSEL Position */ -#define CLK_CLKSEL0_HCLKSEL_Msk (0x7ul << CLK_CLKSEL0_HCLKSEL_Pos) /*!< CLK_T::CLKSEL0: HCLKSEL Mask */ - -#define CLK_CLKSEL0_STCLKSEL_Pos (3) /*!< CLK_T::CLKSEL0: STCLKSEL Position */ -#define CLK_CLKSEL0_STCLKSEL_Msk (0x7ul << CLK_CLKSEL0_STCLKSEL_Pos) /*!< CLK_T::CLKSEL0: STCLKSEL Mask */ - -#define CLK_CLKSEL0_USBSEL_Pos (8) /*!< CLK_T::CLKSEL0: USBSEL Position */ -#define CLK_CLKSEL0_USBSEL_Msk (0x1ul << CLK_CLKSEL0_USBSEL_Pos) /*!< CLK_T::CLKSEL0: USBSEL Mask */ - -#define CLK_CLKSEL0_EADC0SEL_Pos (10) /*!< CLK_T::CLKSEL0: EADC0SEL Position */ -#define CLK_CLKSEL0_EADC0SEL_Msk (0x3ul << CLK_CLKSEL0_EADC0SEL_Pos) /*!< CLK_T::CLKSEL0: EADC0SEL Mask */ - -#define CLK_CLKSEL0_EADC1SEL_Pos (12) /*!< CLK_T::CLKSEL0: EADC1SEL Position */ -#define CLK_CLKSEL0_EADC1SEL_Msk (0x3ul << CLK_CLKSEL0_EADC1SEL_Pos) /*!< CLK_T::CLKSEL0: EADC1SEL Mask */ - -#define CLK_CLKSEL0_EADC2SEL_Pos (14) /*!< CLK_T::CLKSEL0: EADC2SEL Position */ -#define CLK_CLKSEL0_EADC2SEL_Msk (0x3ul << CLK_CLKSEL0_EADC2SEL_Pos) /*!< CLK_T::CLKSEL0: EADC2SEL Mask */ - -#define CLK_CLKSEL0_CCAPSEL_Pos (16) /*!< CLK_T::CLKSEL0: CCAPSEL Position */ -#define CLK_CLKSEL0_CCAPSEL_Msk (0x3ul << CLK_CLKSEL0_CCAPSEL_Pos) /*!< CLK_T::CLKSEL0: CCAPSEL Mask */ - -#define CLK_CLKSEL0_SDH0SEL_Pos (20) /*!< CLK_T::CLKSEL0: SDH0SEL Position */ -#define CLK_CLKSEL0_SDH0SEL_Msk (0x3ul << CLK_CLKSEL0_SDH0SEL_Pos) /*!< CLK_T::CLKSEL0: SDH0SEL Mask */ - -#define CLK_CLKSEL0_SDH1SEL_Pos (22) /*!< CLK_T::CLKSEL0: SDH1SEL Position */ -#define CLK_CLKSEL0_SDH1SEL_Msk (0x3ul << CLK_CLKSEL0_SDH1SEL_Pos) /*!< CLK_T::CLKSEL0: SDH1SEL Mask */ - -#define CLK_CLKSEL0_CANFD0SEL_Pos (24) /*!< CLK_T::CLKSEL0: CANFD0SEL Position */ -#define CLK_CLKSEL0_CANFD0SEL_Msk (0x3ul << CLK_CLKSEL0_CANFD0SEL_Pos) /*!< CLK_T::CLKSEL0: CANFD0SEL Mask */ - -#define CLK_CLKSEL0_CANFD1SEL_Pos (26) /*!< CLK_T::CLKSEL0: CANFD1SEL Position */ -#define CLK_CLKSEL0_CANFD1SEL_Msk (0x3ul << CLK_CLKSEL0_CANFD1SEL_Pos) /*!< CLK_T::CLKSEL0: CANFD1SEL Mask */ - -#define CLK_CLKSEL0_CANFD2SEL_Pos (28) /*!< CLK_T::CLKSEL0: CANFD2SEL Position */ -#define CLK_CLKSEL0_CANFD2SEL_Msk (0x3ul << CLK_CLKSEL0_CANFD2SEL_Pos) /*!< CLK_T::CLKSEL0: CANFD2SEL Mask */ - -#define CLK_CLKSEL0_CANFD3SEL_Pos (30) /*!< CLK_T::CLKSEL0: CANFD3SEL Position */ -#define CLK_CLKSEL0_CANFD3SEL_Msk (0x3ul << CLK_CLKSEL0_CANFD3SEL_Pos) /*!< CLK_T::CLKSEL0: CANFD3SEL Mask */ - -#define CLK_CLKSEL1_WDTSEL_Pos (0) /*!< CLK_T::CLKSEL1: WDTSEL Position */ -#define CLK_CLKSEL1_WDTSEL_Msk (0x3ul << CLK_CLKSEL1_WDTSEL_Pos) /*!< CLK_T::CLKSEL1: WDTSEL Mask */ - -#define CLK_CLKSEL1_CLKOSEL_Pos (4) /*!< CLK_T::CLKSEL1: CLKOSEL Position */ -#define CLK_CLKSEL1_CLKOSEL_Msk (0x7ul << CLK_CLKSEL1_CLKOSEL_Pos) /*!< CLK_T::CLKSEL1: CLKOSEL Mask */ - -#define CLK_CLKSEL1_TMR0SEL_Pos (8) /*!< CLK_T::CLKSEL1: TMR0SEL Position */ -#define CLK_CLKSEL1_TMR0SEL_Msk (0x7ul << CLK_CLKSEL1_TMR0SEL_Pos) /*!< CLK_T::CLKSEL1: TMR0SEL Mask */ - -#define CLK_CLKSEL1_TMR1SEL_Pos (12) /*!< CLK_T::CLKSEL1: TMR1SEL Position */ -#define CLK_CLKSEL1_TMR1SEL_Msk (0x7ul << CLK_CLKSEL1_TMR1SEL_Pos) /*!< CLK_T::CLKSEL1: TMR1SEL Mask */ - -#define CLK_CLKSEL1_TMR2SEL_Pos (16) /*!< CLK_T::CLKSEL1: TMR2SEL Position */ -#define CLK_CLKSEL1_TMR2SEL_Msk (0x7ul << CLK_CLKSEL1_TMR2SEL_Pos) /*!< CLK_T::CLKSEL1: TMR2SEL Mask */ - -#define CLK_CLKSEL1_TMR3SEL_Pos (20) /*!< CLK_T::CLKSEL1: TMR3SEL Position */ -#define CLK_CLKSEL1_TMR3SEL_Msk (0x7ul << CLK_CLKSEL1_TMR3SEL_Pos) /*!< CLK_T::CLKSEL1: TMR3SEL Mask */ - -#define CLK_CLKSEL1_UART0SEL_Pos (24) /*!< CLK_T::CLKSEL1: UART0SEL Position */ -#define CLK_CLKSEL1_UART0SEL_Msk (0x3ul << CLK_CLKSEL1_UART0SEL_Pos) /*!< CLK_T::CLKSEL1: UART0SEL Mask */ - -#define CLK_CLKSEL1_UART1SEL_Pos (26) /*!< CLK_T::CLKSEL1: UART1SEL Position */ -#define CLK_CLKSEL1_UART1SEL_Msk (0x3ul << CLK_CLKSEL1_UART1SEL_Pos) /*!< CLK_T::CLKSEL1: UART1SEL Mask */ - -#define CLK_CLKSEL1_WWDTSEL_Pos (30) /*!< CLK_T::CLKSEL1: WWDTSEL Position */ -#define CLK_CLKSEL1_WWDTSEL_Msk (0x3ul << CLK_CLKSEL1_WWDTSEL_Pos) /*!< CLK_T::CLKSEL1: WWDTSEL Mask */ - -#define CLK_CLKSEL2_EPWM0SEL_Pos (0) /*!< CLK_T::CLKSEL2: EPWM0SEL Position */ -#define CLK_CLKSEL2_EPWM0SEL_Msk (0x1ul << CLK_CLKSEL2_EPWM0SEL_Pos) /*!< CLK_T::CLKSEL2: EPWM0SEL Mask */ - -#define CLK_CLKSEL2_EPWM1SEL_Pos (1) /*!< CLK_T::CLKSEL2: EPWM1SEL Position */ -#define CLK_CLKSEL2_EPWM1SEL_Msk (0x1ul << CLK_CLKSEL2_EPWM1SEL_Pos) /*!< CLK_T::CLKSEL2: EPWM1SEL Mask */ - -#define CLK_CLKSEL2_QSPI0SEL_Pos (2) /*!< CLK_T::CLKSEL2: QSPI0SEL Position */ -#define CLK_CLKSEL2_QSPI0SEL_Msk (0x3ul << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< CLK_T::CLKSEL2: QSPI0SEL Mask */ - -#define CLK_CLKSEL2_SPI0SEL_Pos (4) /*!< CLK_T::CLKSEL2: SPI0SEL Position */ -#define CLK_CLKSEL2_SPI0SEL_Msk (0x7ul << CLK_CLKSEL2_SPI0SEL_Pos) /*!< CLK_T::CLKSEL2: SPI0SEL Mask */ - -#define CLK_CLKSEL2_BPWM0SEL_Pos (8) /*!< CLK_T::CLKSEL2: BPWM0SEL Position */ -#define CLK_CLKSEL2_BPWM0SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM0SEL Mask */ - -#define CLK_CLKSEL2_BPWM1SEL_Pos (9) /*!< CLK_T::CLKSEL2: BPWM1SEL Position */ -#define CLK_CLKSEL2_BPWM1SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM1SEL Mask */ - -#define CLK_CLKSEL2_QSPI1SEL_Pos (10) /*!< CLK_T::CLKSEL2: QSPI1SEL Position */ -#define CLK_CLKSEL2_QSPI1SEL_Msk (0x3ul << CLK_CLKSEL2_QSPI1SEL_Pos) /*!< CLK_T::CLKSEL2: QSPI1SEL Mask */ - -#define CLK_CLKSEL2_SPI1SEL_Pos (12) /*!< CLK_T::CLKSEL2: SPI1SEL Position */ -#define CLK_CLKSEL2_SPI1SEL_Msk (0x7ul << CLK_CLKSEL2_SPI1SEL_Pos) /*!< CLK_T::CLKSEL2: SPI1SEL Mask */ - -#define CLK_CLKSEL2_I2S1SEL_Pos (16) /*!< CLK_T::CLKSEL2: I2S1SEL Position */ -#define CLK_CLKSEL2_I2S1SEL_Msk (0x7ul << CLK_CLKSEL2_I2S1SEL_Pos) /*!< CLK_T::CLKSEL2: I2S1SEL Mask */ - -#define CLK_CLKSEL2_UART8SEL_Pos (20) /*!< CLK_T::CLKSEL2: UART8SEL Position */ -#define CLK_CLKSEL2_UART8SEL_Msk (0x3ul << CLK_CLKSEL2_UART8SEL_Pos) /*!< CLK_T::CLKSEL2: UART8SEL Mask */ - -#define CLK_CLKSEL2_UART9SEL_Pos (22) /*!< CLK_T::CLKSEL2: UART9SEL Position */ -#define CLK_CLKSEL2_UART9SEL_Msk (0x3ul << CLK_CLKSEL2_UART9SEL_Pos) /*!< CLK_T::CLKSEL2: UART9SEL Mask */ - -#define CLK_CLKSEL2_TRNGSEL_Pos (27) /*!< CLK_T::CLKSEL2: TRNGSEL Position */ -#define CLK_CLKSEL2_TRNGSEL_Msk (0x1ul << CLK_CLKSEL2_TRNGSEL_Pos) /*!< CLK_T::CLKSEL2: TRNGSEL Mask */ - -#define CLK_CLKSEL2_PSIOSEL_Pos (28) /*!< CLK_T::CLKSEL2: PSIOSEL Position */ -#define CLK_CLKSEL2_PSIOSEL_Msk (0x7ul << CLK_CLKSEL2_PSIOSEL_Pos) /*!< CLK_T::CLKSEL2: PSIOSEL Mask */ - -#define CLK_CLKSEL3_SC0SEL_Pos (0) /*!< CLK_T::CLKSEL3: SC0SEL Position */ -#define CLK_CLKSEL3_SC0SEL_Msk (0x3ul << CLK_CLKSEL3_SC0SEL_Pos) /*!< CLK_T::CLKSEL3: SC0SEL Mask */ - -#define CLK_CLKSEL3_SC1SEL_Pos (2) /*!< CLK_T::CLKSEL3: SC1SEL Position */ -#define CLK_CLKSEL3_SC1SEL_Msk (0x3ul << CLK_CLKSEL3_SC1SEL_Pos) /*!< CLK_T::CLKSEL3: SC1SEL Mask */ - -#define CLK_CLKSEL3_SC2SEL_Pos (4) /*!< CLK_T::CLKSEL3: SC2SEL Position */ -#define CLK_CLKSEL3_SC2SEL_Msk (0x3ul << CLK_CLKSEL3_SC2SEL_Pos) /*!< CLK_T::CLKSEL3: SC2SEL Mask */ - -#define CLK_CLKSEL3_KPISEL_Pos (6) /*!< CLK_T::CLKSEL3: KPISEL Position */ -#define CLK_CLKSEL3_KPISEL_Msk (0x3ul << CLK_CLKSEL3_KPISEL_Pos) /*!< CLK_T::CLKSEL3: KPISEL Mask */ - -#define CLK_CLKSEL3_SPI2SEL_Pos (9) /*!< CLK_T::CLKSEL3: SPI2SEL Position */ -#define CLK_CLKSEL3_SPI2SEL_Msk (0x7ul << CLK_CLKSEL3_SPI2SEL_Pos) /*!< CLK_T::CLKSEL3: SPI2SEL Mask */ - -#define CLK_CLKSEL3_SPI3SEL_Pos (12) /*!< CLK_T::CLKSEL3: SPI3SEL Position */ -#define CLK_CLKSEL3_SPI3SEL_Msk (0x7ul << CLK_CLKSEL3_SPI3SEL_Pos) /*!< CLK_T::CLKSEL3: SPI3SEL Mask */ - -#define CLK_CLKSEL3_I2S0SEL_Pos (16) /*!< CLK_T::CLKSEL3: I2S0SEL Position */ -#define CLK_CLKSEL3_I2S0SEL_Msk (0x7ul << CLK_CLKSEL3_I2S0SEL_Pos) /*!< CLK_T::CLKSEL3: I2S0SEL Mask */ - -#define CLK_CLKSEL3_UART6SEL_Pos (20) /*!< CLK_T::CLKSEL3: UART6SEL Position */ -#define CLK_CLKSEL3_UART6SEL_Msk (0x3ul << CLK_CLKSEL3_UART6SEL_Pos) /*!< CLK_T::CLKSEL3: UART6SEL Mask */ - -#define CLK_CLKSEL3_UART7SEL_Pos (22) /*!< CLK_T::CLKSEL3: UART7SEL Position */ -#define CLK_CLKSEL3_UART7SEL_Msk (0x3ul << CLK_CLKSEL3_UART7SEL_Pos) /*!< CLK_T::CLKSEL3: UART7SEL Mask */ - -#define CLK_CLKSEL3_UART2SEL_Pos (24) /*!< CLK_T::CLKSEL3: UART2SEL Position */ -#define CLK_CLKSEL3_UART2SEL_Msk (0x3ul << CLK_CLKSEL3_UART2SEL_Pos) /*!< CLK_T::CLKSEL3: UART2SEL Mask */ - -#define CLK_CLKSEL3_UART3SEL_Pos (26) /*!< CLK_T::CLKSEL3: UART3SEL Position */ -#define CLK_CLKSEL3_UART3SEL_Msk (0x3ul << CLK_CLKSEL3_UART3SEL_Pos) /*!< CLK_T::CLKSEL3: UART3SEL Mask */ - -#define CLK_CLKSEL3_UART4SEL_Pos (28) /*!< CLK_T::CLKSEL3: UART4SEL Position */ -#define CLK_CLKSEL3_UART4SEL_Msk (0x3ul << CLK_CLKSEL3_UART4SEL_Pos) /*!< CLK_T::CLKSEL3: UART4SEL Mask */ - -#define CLK_CLKSEL3_UART5SEL_Pos (30) /*!< CLK_T::CLKSEL3: UART5SEL Position */ -#define CLK_CLKSEL3_UART5SEL_Msk (0x3ul << CLK_CLKSEL3_UART5SEL_Pos) /*!< CLK_T::CLKSEL3: UART5SEL Mask */ - -#define CLK_CLKDIV0_HCLKDIV_Pos (0) /*!< CLK_T::CLKDIV0: HCLKDIV Position */ -#define CLK_CLKDIV0_HCLKDIV_Msk (0xful << CLK_CLKDIV0_HCLKDIV_Pos) /*!< CLK_T::CLKDIV0: HCLKDIV Mask */ - -#define CLK_CLKDIV0_USBDIV_Pos (4) /*!< CLK_T::CLKDIV0: USBDIV Position */ -#define CLK_CLKDIV0_USBDIV_Msk (0xful << CLK_CLKDIV0_USBDIV_Pos) /*!< CLK_T::CLKDIV0: USBDIV Mask */ - -#define CLK_CLKDIV0_UART0DIV_Pos (8) /*!< CLK_T::CLKDIV0: UART0DIV Position */ -#define CLK_CLKDIV0_UART0DIV_Msk (0xful << CLK_CLKDIV0_UART0DIV_Pos) /*!< CLK_T::CLKDIV0: UART0DIV Mask */ - -#define CLK_CLKDIV0_UART1DIV_Pos (12) /*!< CLK_T::CLKDIV0: UART1DIV Position */ -#define CLK_CLKDIV0_UART1DIV_Msk (0xful << CLK_CLKDIV0_UART1DIV_Pos) /*!< CLK_T::CLKDIV0: UART1DIV Mask */ - -#define CLK_CLKDIV0_EADC0DIV_Pos (16) /*!< CLK_T::CLKDIV0: EADC0DIV Position */ -#define CLK_CLKDIV0_EADC0DIV_Msk (0xfful << CLK_CLKDIV0_EADC0DIV_Pos) /*!< CLK_T::CLKDIV0: EADC0DIV Mask */ - -#define CLK_CLKDIV0_SDH0DIV_Pos (24) /*!< CLK_T::CLKDIV0: SDH0DIV Position */ -#define CLK_CLKDIV0_SDH0DIV_Msk (0xfful << CLK_CLKDIV0_SDH0DIV_Pos) /*!< CLK_T::CLKDIV0: SDH0DIV Mask */ - -#define CLK_CLKDIV1_SC0DIV_Pos (0) /*!< CLK_T::CLKDIV1: SC0DIV Position */ -#define CLK_CLKDIV1_SC0DIV_Msk (0xfful << CLK_CLKDIV1_SC0DIV_Pos) /*!< CLK_T::CLKDIV1: SC0DIV Mask */ - -#define CLK_CLKDIV1_SC1DIV_Pos (8) /*!< CLK_T::CLKDIV1: SC1DIV Position */ -#define CLK_CLKDIV1_SC1DIV_Msk (0xfful << CLK_CLKDIV1_SC1DIV_Pos) /*!< CLK_T::CLKDIV1: SC1DIV Mask */ - -#define CLK_CLKDIV1_SC2DIV_Pos (16) /*!< CLK_T::CLKDIV1: SC2DIV Position */ -#define CLK_CLKDIV1_SC2DIV_Msk (0xfful << CLK_CLKDIV1_SC2DIV_Pos) /*!< CLK_T::CLKDIV1: SC2DIV Mask */ - -#define CLK_CLKDIV1_PSIODIV_Pos (24) /*!< CLK_T::CLKDIV1: PSIODIV Position */ -#define CLK_CLKDIV1_PSIODIV_Msk (0xfful << CLK_CLKDIV1_PSIODIV_Pos) /*!< CLK_T::CLKDIV1: PSIODIV Mask */ - -#define CLK_CLKDIV2_I2S0DIV_Pos (0) /*!< CLK_T::CLKDIV2: I2S0DIV Position */ -#define CLK_CLKDIV2_I2S0DIV_Msk (0xful << CLK_CLKDIV2_I2S0DIV_Pos) /*!< CLK_T::CLKDIV2: I2S0DIV Mask */ - -#define CLK_CLKDIV2_I2S1DIV_Pos (4) /*!< CLK_T::CLKDIV2: I2S1DIV Position */ -#define CLK_CLKDIV2_I2S1DIV_Msk (0xful << CLK_CLKDIV2_I2S1DIV_Pos) /*!< CLK_T::CLKDIV2: I2S1DIV Mask */ - -#define CLK_CLKDIV2_KPIDIV_Pos (8) /*!< CLK_T::CLKDIV2: KPIDIV Position */ -#define CLK_CLKDIV2_KPIDIV_Msk (0xfful << CLK_CLKDIV2_KPIDIV_Pos) /*!< CLK_T::CLKDIV2: KPIDIV Mask */ - -#define CLK_CLKDIV2_EADC1DIV_Pos (24) /*!< CLK_T::CLKDIV2: EADC1DIV Position */ -#define CLK_CLKDIV2_EADC1DIV_Msk (0xfful << CLK_CLKDIV2_EADC1DIV_Pos) /*!< CLK_T::CLKDIV2: EADC1DIV Mask */ - -#define CLK_CLKDIV3_VSENSEDIV_Pos (8) /*!< CLK_T::CLKDIV3: VSENSEDIV Position */ -#define CLK_CLKDIV3_VSENSEDIV_Msk (0xfful << CLK_CLKDIV3_VSENSEDIV_Pos) /*!< CLK_T::CLKDIV3: VSENSEDIV Mask */ - -#define CLK_CLKDIV3_EMAC0DIV_Pos (16) /*!< CLK_T::CLKDIV3: EMAC0DIV Position */ -#define CLK_CLKDIV3_EMAC0DIV_Msk (0xfful << CLK_CLKDIV3_EMAC0DIV_Pos) /*!< CLK_T::CLKDIV3: EMAC0DIV Mask */ - -#define CLK_CLKDIV3_SDH1DIV_Pos (24) /*!< CLK_T::CLKDIV3: SDH1DIV Position */ -#define CLK_CLKDIV3_SDH1DIV_Msk (0xfful << CLK_CLKDIV3_SDH1DIV_Pos) /*!< CLK_T::CLKDIV3: SDH1DIV Mask */ - -#define CLK_CLKDIV4_UART2DIV_Pos (0) /*!< CLK_T::CLKDIV4: UART2DIV Position */ -#define CLK_CLKDIV4_UART2DIV_Msk (0xful << CLK_CLKDIV4_UART2DIV_Pos) /*!< CLK_T::CLKDIV4: UART2DIV Mask */ - -#define CLK_CLKDIV4_UART3DIV_Pos (4) /*!< CLK_T::CLKDIV4: UART3DIV Position */ -#define CLK_CLKDIV4_UART3DIV_Msk (0xful << CLK_CLKDIV4_UART3DIV_Pos) /*!< CLK_T::CLKDIV4: UART3DIV Mask */ - -#define CLK_CLKDIV4_UART4DIV_Pos (8) /*!< CLK_T::CLKDIV4: UART4DIV Position */ -#define CLK_CLKDIV4_UART4DIV_Msk (0xful << CLK_CLKDIV4_UART4DIV_Pos) /*!< CLK_T::CLKDIV4: UART4DIV Mask */ - -#define CLK_CLKDIV4_UART5DIV_Pos (12) /*!< CLK_T::CLKDIV4: UART5DIV Position */ -#define CLK_CLKDIV4_UART5DIV_Msk (0xful << CLK_CLKDIV4_UART5DIV_Pos) /*!< CLK_T::CLKDIV4: UART5DIV Mask */ - -#define CLK_CLKDIV4_UART6DIV_Pos (16) /*!< CLK_T::CLKDIV4: UART6DIV Position */ -#define CLK_CLKDIV4_UART6DIV_Msk (0xful << CLK_CLKDIV4_UART6DIV_Pos) /*!< CLK_T::CLKDIV4: UART6DIV Mask */ - -#define CLK_CLKDIV4_UART7DIV_Pos (20) /*!< CLK_T::CLKDIV4: UART7DIV Position */ -#define CLK_CLKDIV4_UART7DIV_Msk (0xful << CLK_CLKDIV4_UART7DIV_Pos) /*!< CLK_T::CLKDIV4: UART7DIV Mask */ - -#define CLK_PCLKDIV_APB0DIV_Pos (0) /*!< CLK_T::PCLKDIV: APB0DIV Position */ -#define CLK_PCLKDIV_APB0DIV_Msk (0x7ul << CLK_PCLKDIV_APB0DIV_Pos) /*!< CLK_T::PCLKDIV: APB0DIV Mask */ - -#define CLK_PCLKDIV_APB1DIV_Pos (4) /*!< CLK_T::PCLKDIV: APB1DIV Position */ -#define CLK_PCLKDIV_APB1DIV_Msk (0x7ul << CLK_PCLKDIV_APB1DIV_Pos) /*!< CLK_T::PCLKDIV: APB1DIV Mask */ - -#define CLK_APBCLK2_KPICKEN_Pos (0) /*!< CLK_T::APBCLK2: KPICKEN Position */ -#define CLK_APBCLK2_KPICKEN_Msk (0x1ul << CLK_APBCLK2_KPICKEN_Pos) /*!< CLK_T::APBCLK2: KPICKEN Mask */ - -#define CLK_APBCLK2_EADC2CKEN_Pos (6) /*!< CLK_T::APBCLK2: EADC2CKEN Position */ -#define CLK_APBCLK2_EADC2CKEN_Msk (0x1ul << CLK_APBCLK2_EADC2CKEN_Pos) /*!< CLK_T::APBCLK2: EADC2CKEN Mask */ - -#define CLK_APBCLK2_ACMP23CKEN_Pos (7) /*!< CLK_T::APBCLK2: ACMP23CKEN Position */ -#define CLK_APBCLK2_ACMP23CKEN_Msk (0x1ul << CLK_APBCLK2_ACMP23CKEN_Pos) /*!< CLK_T::APBCLK2: ACMP23CKEN Mask */ - -#define CLK_APBCLK2_SPI5CKEN_Pos (8) /*!< CLK_T::APBCLK2: SPI5CKEN Position */ -#define CLK_APBCLK2_SPI5CKEN_Msk (0x1ul << CLK_APBCLK2_SPI5CKEN_Pos) /*!< CLK_T::APBCLK2: SPI5CKEN Mask */ - -#define CLK_APBCLK2_SPI6CKEN_Pos (9) /*!< CLK_T::APBCLK2: SPI6CKEN Position */ -#define CLK_APBCLK2_SPI6CKEN_Msk (0x1ul << CLK_APBCLK2_SPI6CKEN_Pos) /*!< CLK_T::APBCLK2: SPI6CKEN Mask */ - -#define CLK_APBCLK2_SPI7CKEN_Pos (10) /*!< CLK_T::APBCLK2: SPI7CKEN Position */ -#define CLK_APBCLK2_SPI7CKEN_Msk (0x1ul << CLK_APBCLK2_SPI7CKEN_Pos) /*!< CLK_T::APBCLK2: SPI7CKEN Mask */ - -#define CLK_APBCLK2_SPI8CKEN_Pos (11) /*!< CLK_T::APBCLK2: SPI8CKEN Position */ -#define CLK_APBCLK2_SPI8CKEN_Msk (0x1ul << CLK_APBCLK2_SPI8CKEN_Pos) /*!< CLK_T::APBCLK2: SPI8CKEN Mask */ - -#define CLK_APBCLK2_SPI9CKEN_Pos (12) /*!< CLK_T::APBCLK2: SPI9CKEN Position */ -#define CLK_APBCLK2_SPI9CKEN_Msk (0x1ul << CLK_APBCLK2_SPI9CKEN_Pos) /*!< CLK_T::APBCLK2: SPI9CKEN Mask */ - -#define CLK_APBCLK2_SPI10CKEN_Pos (13) /*!< CLK_T::APBCLK2: SPI10CKEN Position */ -#define CLK_APBCLK2_SPI10CKEN_Msk (0x1ul << CLK_APBCLK2_SPI10CKEN_Pos) /*!< CLK_T::APBCLK2: SPI10CKEN Mask */ - -#define CLK_APBCLK2_UART8CKEN_Pos (16) /*!< CLK_T::APBCLK2: UART8CKEN Position */ -#define CLK_APBCLK2_UART8CKEN_Msk (0x1ul << CLK_APBCLK2_UART8CKEN_Pos) /*!< CLK_T::APBCLK2: UART8CKEN Mask */ - -#define CLK_APBCLK2_UART9CKEN_Pos (17) /*!< CLK_T::APBCLK2: UART9CKEN Position */ -#define CLK_APBCLK2_UART9CKEN_Msk (0x1ul << CLK_APBCLK2_UART9CKEN_Pos) /*!< CLK_T::APBCLK2: UART9CKEN Mask */ - -#define CLK_CLKDIV5_CANFD0DIV_Pos (0) /*!< CLK_T::CLKDIV5: CANFD0DIV Position */ -#define CLK_CLKDIV5_CANFD0DIV_Msk (0xful << CLK_CLKDIV5_CANFD0DIV_Pos) /*!< CLK_T::CLKDIV5: CANFD0DIV Mask */ - -#define CLK_CLKDIV5_CANFD1DIV_Pos (4) /*!< CLK_T::CLKDIV5: CANFD1DIV Position */ -#define CLK_CLKDIV5_CANFD1DIV_Msk (0xful << CLK_CLKDIV5_CANFD1DIV_Pos) /*!< CLK_T::CLKDIV5: CANFD1DIV Mask */ - -#define CLK_CLKDIV5_CANFD2DIV_Pos (8) /*!< CLK_T::CLKDIV5: CANFD2DIV Position */ -#define CLK_CLKDIV5_CANFD2DIV_Msk (0xful << CLK_CLKDIV5_CANFD2DIV_Pos) /*!< CLK_T::CLKDIV5: CANFD2DIV Mask */ - -#define CLK_CLKDIV5_CANFD3DIV_Pos (12) /*!< CLK_T::CLKDIV5: CANFD3DIV Position */ -#define CLK_CLKDIV5_CANFD3DIV_Msk (0xful << CLK_CLKDIV5_CANFD3DIV_Pos) /*!< CLK_T::CLKDIV5: CANFD3DIV Mask */ - -#define CLK_CLKDIV5_UART8DIV_Pos (16) /*!< CLK_T::CLKDIV5: UART8DIV Position */ -#define CLK_CLKDIV5_UART8DIV_Msk (0xful << CLK_CLKDIV5_UART8DIV_Pos) /*!< CLK_T::CLKDIV5: UART8DIV Mask */ - -#define CLK_CLKDIV5_UART9DIV_Pos (20) /*!< CLK_T::CLKDIV5: UART9DIV Position */ -#define CLK_CLKDIV5_UART9DIV_Msk (0xful << CLK_CLKDIV5_UART9DIV_Pos) /*!< CLK_T::CLKDIV5: UART9DIV Mask */ - -#define CLK_CLKDIV5_EADC2DIV_Pos (24) /*!< CLK_T::CLKDIV5: EADC2DIV Position */ -#define CLK_CLKDIV5_EADC2DIV_Msk (0xfful << CLK_CLKDIV5_EADC2DIV_Pos) /*!< CLK_T::CLKDIV5: EADC2DIV Mask */ - -#define CLK_PLLCTL_FBDIV_Pos (0) /*!< CLK_T::PLLCTL: FBDIV Position */ -#define CLK_PLLCTL_FBDIV_Msk (0x1fful << CLK_PLLCTL_FBDIV_Pos) /*!< CLK_T::PLLCTL: FBDIV Mask */ - -#define CLK_PLLCTL_INDIV_Pos (9) /*!< CLK_T::PLLCTL: INDIV Position */ -#define CLK_PLLCTL_INDIV_Msk (0x1ful << CLK_PLLCTL_INDIV_Pos) /*!< CLK_T::PLLCTL: INDIV Mask */ - -#define CLK_PLLCTL_OUTDIV_Pos (14) /*!< CLK_T::PLLCTL: OUTDIV Position */ -#define CLK_PLLCTL_OUTDIV_Msk (0x3ul << CLK_PLLCTL_OUTDIV_Pos) /*!< CLK_T::PLLCTL: OUTDIV Mask */ - -#define CLK_PLLCTL_PD_Pos (16) /*!< CLK_T::PLLCTL: PD Position */ -#define CLK_PLLCTL_PD_Msk (0x1ul << CLK_PLLCTL_PD_Pos) /*!< CLK_T::PLLCTL: PD Mask */ - -#define CLK_PLLCTL_BP_Pos (17) /*!< CLK_T::PLLCTL: BP Position */ -#define CLK_PLLCTL_BP_Msk (0x1ul << CLK_PLLCTL_BP_Pos) /*!< CLK_T::PLLCTL: BP Mask */ - -#define CLK_PLLCTL_OE_Pos (18) /*!< CLK_T::PLLCTL: OE Position */ -#define CLK_PLLCTL_OE_Msk (0x1ul << CLK_PLLCTL_OE_Pos) /*!< CLK_T::PLLCTL: OE Mask */ - -#define CLK_PLLCTL_PLLSRC_Pos (19) /*!< CLK_T::PLLCTL: PLLSRC Position */ -#define CLK_PLLCTL_PLLSRC_Msk (0x1ul << CLK_PLLCTL_PLLSRC_Pos) /*!< CLK_T::PLLCTL: PLLSRC Mask */ - -#define CLK_PLLCTL_STBSEL_Pos (23) /*!< CLK_T::PLLCTL: STBSEL Position */ -#define CLK_PLLCTL_STBSEL_Msk (0x1ul << CLK_PLLCTL_STBSEL_Pos) /*!< CLK_T::PLLCTL: STBSEL Mask */ - -#define CLK_PLLFNCTL0_FBDIV_Pos (0) /*!< CLK_T::PLLFNCTL0: FBDIV Position */ -#define CLK_PLLFNCTL0_FBDIV_Msk (0x1fful << CLK_PLLFNCTL0_FBDIV_Pos) /*!< CLK_T::PLLFNCTL0: FBDIV Mask */ - -#define CLK_PLLFNCTL0_INDIV_Pos (9) /*!< CLK_T::PLLFNCTL0: INDIV Position */ -#define CLK_PLLFNCTL0_INDIV_Msk (0x1ful << CLK_PLLFNCTL0_INDIV_Pos) /*!< CLK_T::PLLFNCTL0: INDIV Mask */ - -#define CLK_PLLFNCTL0_OUTDIV_Pos (14) /*!< CLK_T::PLLFNCTL0: OUTDIV Position */ -#define CLK_PLLFNCTL0_OUTDIV_Msk (0x3ul << CLK_PLLFNCTL0_OUTDIV_Pos) /*!< CLK_T::PLLFNCTL0: OUTDIV Mask */ - -#define CLK_PLLFNCTL0_FRDIV_Pos (16) /*!< CLK_T::PLLFNCTL0: FRDIV Position */ -#define CLK_PLLFNCTL0_FRDIV_Msk (0xffful << CLK_PLLFNCTL0_FRDIV_Pos) /*!< CLK_T::PLLFNCTL0: FRDIV Mask */ - -#define CLK_PLLFNCTL1_STBSEL_Pos (27) /*!< CLK_T::PLLFNCTL1: STBSEL Position */ -#define CLK_PLLFNCTL1_STBSEL_Msk (0x1ul << CLK_PLLFNCTL1_STBSEL_Pos) /*!< CLK_T::PLLFNCTL1: STBSEL Mask */ - -#define CLK_PLLFNCTL1_PD_Pos (28) /*!< CLK_T::PLLFNCTL1: PD Position */ -#define CLK_PLLFNCTL1_PD_Msk (0x1ul << CLK_PLLFNCTL1_PD_Pos) /*!< CLK_T::PLLFNCTL1: PD Mask */ - -#define CLK_PLLFNCTL1_BP_Pos (29) /*!< CLK_T::PLLFNCTL1: BP Position */ -#define CLK_PLLFNCTL1_BP_Msk (0x1ul << CLK_PLLFNCTL1_BP_Pos) /*!< CLK_T::PLLFNCTL1: BP Mask */ - -#define CLK_PLLFNCTL1_OE_Pos (30) /*!< CLK_T::PLLFNCTL1: OE Position */ -#define CLK_PLLFNCTL1_OE_Msk (0x1ul << CLK_PLLFNCTL1_OE_Pos) /*!< CLK_T::PLLFNCTL1: OE Mask */ - -#define CLK_PLLFNCTL1_PLLSRC_Pos (31) /*!< CLK_T::PLLFNCTL1: PLLSRC Position */ -#define CLK_PLLFNCTL1_PLLSRC_Msk (0x1ul << CLK_PLLFNCTL1_PLLSRC_Pos) /*!< CLK_T::PLLFNCTL1: PLLSRC Mask */ - -#define CLK_STATUS_HXTSTB_Pos (0) /*!< CLK_T::STATUS: HXTSTB Position */ -#define CLK_STATUS_HXTSTB_Msk (0x1ul << CLK_STATUS_HXTSTB_Pos) /*!< CLK_T::STATUS: HXTSTB Mask */ - -#define CLK_STATUS_LXTSTB_Pos (1) /*!< CLK_T::STATUS: LXTSTB Position */ -#define CLK_STATUS_LXTSTB_Msk (0x1ul << CLK_STATUS_LXTSTB_Pos) /*!< CLK_T::STATUS: LXTSTB Mask */ - -#define CLK_STATUS_PLLSTB_Pos (2) /*!< CLK_T::STATUS: PLLSTB Position */ -#define CLK_STATUS_PLLSTB_Msk (0x1ul << CLK_STATUS_PLLSTB_Pos) /*!< CLK_T::STATUS: PLLSTB Mask */ - -#define CLK_STATUS_LIRCSTB_Pos (3) /*!< CLK_T::STATUS: LIRCSTB Position */ -#define CLK_STATUS_LIRCSTB_Msk (0x1ul << CLK_STATUS_LIRCSTB_Pos) /*!< CLK_T::STATUS: LIRCSTB Mask */ - -#define CLK_STATUS_HIRCSTB_Pos (4) /*!< CLK_T::STATUS: HIRCSTB Position */ -#define CLK_STATUS_HIRCSTB_Msk (0x1ul << CLK_STATUS_HIRCSTB_Pos) /*!< CLK_T::STATUS: HIRCSTB Mask */ - -#define CLK_STATUS_HIRC48MSTB_Pos (6) /*!< CLK_T::STATUS: HIRC48MSTB Position */ -#define CLK_STATUS_HIRC48MSTB_Msk (0x1ul << CLK_STATUS_HIRC48MSTB_Pos) /*!< CLK_T::STATUS: HIRC48MSTB Mask */ - -#define CLK_STATUS_CLKSFAIL_Pos (7) /*!< CLK_T::STATUS: CLKSFAIL Position */ -#define CLK_STATUS_CLKSFAIL_Msk (0x1ul << CLK_STATUS_CLKSFAIL_Pos) /*!< CLK_T::STATUS: CLKSFAIL Mask */ - -#define CLK_STATUS_PLLFNSTB_Pos (10) /*!< CLK_T::STATUS: PLLFNSTB Position */ -#define CLK_STATUS_PLLFNSTB_Msk (0x1ul << CLK_STATUS_PLLFNSTB_Pos) /*!< CLK_T::STATUS: PLLFNSTB Mask */ - -#define CLK_AHBCLK1_CANFD0CKEN_Pos (20) /*!< CLK_T::AHBCLK1: CANFD0CKEN Position */ -#define CLK_AHBCLK1_CANFD0CKEN_Msk (0x1ul << CLK_AHBCLK1_CANFD0CKEN_Pos) /*!< CLK_T::AHBCLK1: CANFD0CKEN Mask */ - -#define CLK_AHBCLK1_CANFD1CKEN_Pos (21) /*!< CLK_T::AHBCLK1: CANFD1CKEN Position */ -#define CLK_AHBCLK1_CANFD1CKEN_Msk (0x1ul << CLK_AHBCLK1_CANFD1CKEN_Pos) /*!< CLK_T::AHBCLK1: CANFD1CKEN Mask */ - -#define CLK_AHBCLK1_CANFD2CKEN_Pos (22) /*!< CLK_T::AHBCLK1: CANFD2CKEN Position */ -#define CLK_AHBCLK1_CANFD2CKEN_Msk (0x1ul << CLK_AHBCLK1_CANFD2CKEN_Pos) /*!< CLK_T::AHBCLK1: CANFD2CKEN Mask */ - -#define CLK_AHBCLK1_CANFD3CKEN_Pos (23) /*!< CLK_T::AHBCLK1: CANFD3CKEN Position */ -#define CLK_AHBCLK1_CANFD3CKEN_Msk (0x1ul << CLK_AHBCLK1_CANFD3CKEN_Pos) /*!< CLK_T::AHBCLK1: CANFD3CKEN Mask */ - -#define CLK_AHBCLK1_GPICKEN_Pos (24) /*!< CLK_T::AHBCLK1: GPICKEN Position */ -#define CLK_AHBCLK1_GPICKEN_Msk (0x1ul << CLK_AHBCLK1_GPICKEN_Pos) /*!< CLK_T::AHBCLK1: GPICKEN Mask */ - -#define CLK_AHBCLK1_GPJCKEN_Pos (25) /*!< CLK_T::AHBCLK1: GPJCKEN Position */ -#define CLK_AHBCLK1_GPJCKEN_Msk (0x1ul << CLK_AHBCLK1_GPJCKEN_Pos) /*!< CLK_T::AHBCLK1: GPJCKEN Mask */ - -#define CLK_AHBCLK1_BMCCKEN_Pos (28) /*!< CLK_T::AHBCLK1: BMCCKEN Position */ -#define CLK_AHBCLK1_BMCCKEN_Msk (0x1ul << CLK_AHBCLK1_BMCCKEN_Pos) /*!< CLK_T::AHBCLK1: BMCCKEN Mask */ - -#define CLK_CLKSEL4_SPI4SEL_Pos (0) /*!< CLK_T::CLKSEL4: SPI4SEL Position */ -#define CLK_CLKSEL4_SPI4SEL_Msk (0x7ul << CLK_CLKSEL4_SPI4SEL_Pos) /*!< CLK_T::CLKSEL4: SPI4SEL Mask */ - -#define CLK_CLKSEL4_SPI5SEL_Pos (4) /*!< CLK_T::CLKSEL4: SPI5SEL Position */ -#define CLK_CLKSEL4_SPI5SEL_Msk (0x7ul << CLK_CLKSEL4_SPI5SEL_Pos) /*!< CLK_T::CLKSEL4: SPI5SEL Mask */ - -#define CLK_CLKSEL4_SPI6SEL_Pos (8) /*!< CLK_T::CLKSEL4: SPI6SEL Position */ -#define CLK_CLKSEL4_SPI6SEL_Msk (0x7ul << CLK_CLKSEL4_SPI6SEL_Pos) /*!< CLK_T::CLKSEL4: SPI6SEL Mask */ - -#define CLK_CLKSEL4_SPI7SEL_Pos (12) /*!< CLK_T::CLKSEL4: SPI7SEL Position */ -#define CLK_CLKSEL4_SPI7SEL_Msk (0x7ul << CLK_CLKSEL4_SPI7SEL_Pos) /*!< CLK_T::CLKSEL4: SPI7SEL Mask */ - -#define CLK_CLKSEL4_SPI8SEL_Pos (16) /*!< CLK_T::CLKSEL4: SPI8SEL Position */ -#define CLK_CLKSEL4_SPI8SEL_Msk (0x7ul << CLK_CLKSEL4_SPI8SEL_Pos) /*!< CLK_T::CLKSEL4: SPI8SEL Mask */ - -#define CLK_CLKSEL4_SPI9SEL_Pos (20) /*!< CLK_T::CLKSEL4: SPI9SEL Position */ -#define CLK_CLKSEL4_SPI9SEL_Msk (0x7ul << CLK_CLKSEL4_SPI9SEL_Pos) /*!< CLK_T::CLKSEL4: SPI9SEL Mask */ - -#define CLK_CLKSEL4_SPI10SEL_Pos (24) /*!< CLK_T::CLKSEL4: SPI10SEL Position */ -#define CLK_CLKSEL4_SPI10SEL_Msk (0x7ul << CLK_CLKSEL4_SPI10SEL_Pos) /*!< CLK_T::CLKSEL4: SPI10SEL Mask */ - -#define CLK_CLKOCTL_FREQSEL_Pos (0) /*!< CLK_T::CLKOCTL: FREQSEL Position */ -#define CLK_CLKOCTL_FREQSEL_Msk (0xful << CLK_CLKOCTL_FREQSEL_Pos) /*!< CLK_T::CLKOCTL: FREQSEL Mask */ - -#define CLK_CLKOCTL_CLKOEN_Pos (4) /*!< CLK_T::CLKOCTL: CLKOEN Position */ -#define CLK_CLKOCTL_CLKOEN_Msk (0x1ul << CLK_CLKOCTL_CLKOEN_Pos) /*!< CLK_T::CLKOCTL: CLKOEN Mask */ - -#define CLK_CLKOCTL_DIV1EN_Pos (5) /*!< CLK_T::CLKOCTL: DIV1EN Position */ -#define CLK_CLKOCTL_DIV1EN_Msk (0x1ul << CLK_CLKOCTL_DIV1EN_Pos) /*!< CLK_T::CLKOCTL: DIV1EN Mask */ - -#define CLK_CLKOCTL_CLK1HZEN_Pos (6) /*!< CLK_T::CLKOCTL: CLK1HZEN Position */ -#define CLK_CLKOCTL_CLK1HZEN_Msk (0x1ul << CLK_CLKOCTL_CLK1HZEN_Pos) /*!< CLK_T::CLKOCTL: CLK1HZEN Mask */ - -#define CLK_CLKDCTL_HXTFDEN_Pos (4) /*!< CLK_T::CLKDCTL: HXTFDEN Position */ -#define CLK_CLKDCTL_HXTFDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFDEN Mask */ - -#define CLK_CLKDCTL_HXTFIEN_Pos (5) /*!< CLK_T::CLKDCTL: HXTFIEN Position */ -#define CLK_CLKDCTL_HXTFIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFIEN Mask */ - -#define CLK_CLKDCTL_LXTFDEN_Pos (12) /*!< CLK_T::CLKDCTL: LXTFDEN Position */ -#define CLK_CLKDCTL_LXTFDEN_Msk (0x1ul << CLK_CLKDCTL_LXTFDEN_Pos) /*!< CLK_T::CLKDCTL: LXTFDEN Mask */ - -#define CLK_CLKDCTL_LXTFIEN_Pos (13) /*!< CLK_T::CLKDCTL: LXTFIEN Position */ -#define CLK_CLKDCTL_LXTFIEN_Msk (0x1ul << CLK_CLKDCTL_LXTFIEN_Pos) /*!< CLK_T::CLKDCTL: LXTFIEN Mask */ - -#define CLK_CLKDCTL_HXTFQDEN_Pos (16) /*!< CLK_T::CLKDCTL: HXTFQDEN Position */ -#define CLK_CLKDCTL_HXTFQDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQDEN Mask */ - -#define CLK_CLKDCTL_HXTFQIEN_Pos (17) /*!< CLK_T::CLKDCTL: HXTFQIEN Position */ -#define CLK_CLKDCTL_HXTFQIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQIEN Mask */ - -#define CLK_CLKDCTL_HXTFQASW_Pos (18) /*!< CLK_T::CLKDCTL: HXTFQASW Position */ -#define CLK_CLKDCTL_HXTFQASW_Msk (0x1ul << CLK_CLKDCTL_HXTFQASW_Pos) /*!< CLK_T::CLKDCTL: HXTFQASW Mask */ - -#define CLK_CLKDSTS_HXTFIF_Pos (0) /*!< CLK_T::CLKDSTS: HXTFIF Position */ -#define CLK_CLKDSTS_HXTFIF_Msk (0x1ul << CLK_CLKDSTS_HXTFIF_Pos) /*!< CLK_T::CLKDSTS: HXTFIF Mask */ - -#define CLK_CLKDSTS_LXTFIF_Pos (1) /*!< CLK_T::CLKDSTS: LXTFIF Position */ -#define CLK_CLKDSTS_LXTFIF_Msk (0x1ul << CLK_CLKDSTS_LXTFIF_Pos) /*!< CLK_T::CLKDSTS: LXTFIF Mask */ - -#define CLK_CLKDSTS_HXTFQIF_Pos (8) /*!< CLK_T::CLKDSTS: HXTFQIF Position */ -#define CLK_CLKDSTS_HXTFQIF_Msk (0x1ul << CLK_CLKDSTS_HXTFQIF_Pos) /*!< CLK_T::CLKDSTS: HXTFQIF Mask */ - -#define CLK_CDUPB_UPERBD_Pos (0) /*!< CLK_T::CDUPB: UPERBD Position */ -#define CLK_CDUPB_UPERBD_Msk (0x3fful << CLK_CDUPB_UPERBD_Pos) /*!< CLK_T::CDUPB: UPERBD Mask */ - -#define CLK_CDLOWB_LOWERBD_Pos (0) /*!< CLK_T::CDLOWB: LOWERBD Position */ -#define CLK_CDLOWB_LOWERBD_Msk (0x3fful << CLK_CDLOWB_LOWERBD_Pos) /*!< CLK_T::CDLOWB: LOWERBD Mask */ - -#define CLK_STOPREQ_CANFD0STR_Pos (0) /*!< CLK_T::STOPREQ: CANFD0STR Position */ -#define CLK_STOPREQ_CANFD0STR_Msk (0x1ul << CLK_STOPREQ_CANFD0STR_Pos) /*!< CLK_T::STOPREQ: CANFD0STR Mask */ - -#define CLK_STOPREQ_CANFD1STR_Pos (1) /*!< CLK_T::STOPREQ: CANFD1STR Position */ -#define CLK_STOPREQ_CANFD1STR_Msk (0x1ul << CLK_STOPREQ_CANFD1STR_Pos) /*!< CLK_T::STOPREQ: CANFD1STR Mask */ - -#define CLK_STOPREQ_CANFD2STR_Pos (2) /*!< CLK_T::STOPREQ: CANFD2STR Position */ -#define CLK_STOPREQ_CANFD2STR_Msk (0x1ul << CLK_STOPREQ_CANFD2STR_Pos) /*!< CLK_T::STOPREQ: CANFD2STR Mask */ - -#define CLK_STOPREQ_CANFD3STR_Pos (3) /*!< CLK_T::STOPREQ: CANFD3STR Position */ -#define CLK_STOPREQ_CANFD3STR_Msk (0x1ul << CLK_STOPREQ_CANFD3STR_Pos) /*!< CLK_T::STOPREQ: CANFD3STR Mask */ - -#define CLK_STOPACK_CANFD0STA_Pos (0) /*!< CLK_T::STOPACK: CANFD0STA Position */ -#define CLK_STOPACK_CANFD0STA_Msk (0x1ul << CLK_STOPACK_CANFD0STA_Pos) /*!< CLK_T::STOPACK: CANFD0STA Mask */ - -#define CLK_STOPACK_CANFD1STA_Pos (1) /*!< CLK_T::STOPACK: CANFD1STA Position */ -#define CLK_STOPACK_CANFD1STA_Msk (0x1ul << CLK_STOPACK_CANFD1STA_Pos) /*!< CLK_T::STOPACK: CANFD1STA Mask */ - -#define CLK_STOPACK_CANFD2STA_Pos (2) /*!< CLK_T::STOPACK: CANFD2STA Position */ -#define CLK_STOPACK_CANFD2STA_Msk (0x1ul << CLK_STOPACK_CANFD2STA_Pos) /*!< CLK_T::STOPACK: CANFD2STA Mask */ - -#define CLK_STOPACK_CANFD3STA_Pos (3) /*!< CLK_T::STOPACK: CANFD3STA Position */ -#define CLK_STOPACK_CANFD3STA_Msk (0x1ul << CLK_STOPACK_CANFD3STA_Pos) /*!< CLK_T::STOPACK: CANFD3STA Mask */ - -#define CLK_PMUCTL_PDMSEL_Pos (0) /*!< CLK_T::PMUCTL: PDMSEL Position */ -#define CLK_PMUCTL_PDMSEL_Msk (0x7ul << CLK_PMUCTL_PDMSEL_Pos) /*!< CLK_T::PMUCTL: PDMSEL Mask */ - -#define CLK_PMUCTL_DPDHOLDEN_Pos (3) /*!< CLK_T::PMUCTL: DPDHOLDEN Position */ -#define CLK_PMUCTL_DPDHOLDEN_Msk (0x1ul << CLK_PMUCTL_DPDHOLDEN_Pos) /*!< CLK_T::PMUCTL: DPDHOLDEN Mask */ - -#define CLK_PMUCTL_SRETSEL_Pos (4) /*!< CLK_T::PMUCTL: SRETSEL Position */ -#define CLK_PMUCTL_SRETSEL_Msk (0x7ul << CLK_PMUCTL_SRETSEL_Pos) /*!< CLK_T::PMUCTL: SRETSEL Mask */ - -#define CLK_PMUCTL_WKTMREN_Pos (8) /*!< CLK_T::PMUCTL: WKTMREN Position */ -#define CLK_PMUCTL_WKTMREN_Msk (0x1ul << CLK_PMUCTL_WKTMREN_Pos) /*!< CLK_T::PMUCTL: WKTMREN Mask */ - -#define CLK_PMUCTL_WKTMRIS_Pos (9) /*!< CLK_T::PMUCTL: WKTMRIS Position */ -#define CLK_PMUCTL_WKTMRIS_Msk (0xful << CLK_PMUCTL_WKTMRIS_Pos) /*!< CLK_T::PMUCTL: WKTMRIS Mask */ - -#define CLK_PMUCTL_WKPINEN0_Pos (16) /*!< CLK_T::PMUCTL: WKPINEN0 Position */ -#define CLK_PMUCTL_WKPINEN0_Msk (0x3ul << CLK_PMUCTL_WKPINEN0_Pos) /*!< CLK_T::PMUCTL: WKPINEN0 Mask */ - -#define CLK_PMUCTL_ACMPSPWK_Pos (18) /*!< CLK_T::PMUCTL: ACMPSPWK Position */ -#define CLK_PMUCTL_ACMPSPWK_Msk (0x1ul << CLK_PMUCTL_ACMPSPWK_Pos) /*!< CLK_T::PMUCTL: ACMPSPWK Mask */ - -#define CLK_PMUCTL_VBUSWKEN_Pos (22) /*!< CLK_T::PMUCTL: VBUSWKEN Position */ -#define CLK_PMUCTL_VBUSWKEN_Msk (0x1ul << CLK_PMUCTL_VBUSWKEN_Pos) /*!< CLK_T::PMUCTL: VBUSWKEN Mask */ - -#define CLK_PMUCTL_RTCWKEN_Pos (23) /*!< CLK_T::PMUCTL: RTCWKEN Position */ -#define CLK_PMUCTL_RTCWKEN_Msk (0x1ul << CLK_PMUCTL_RTCWKEN_Pos) /*!< CLK_T::PMUCTL: RTCWKEN Mask */ - -#define CLK_PMUCTL_WKPINEN1_Pos (24) /*!< CLK_T::PMUCTL: WKPINEN1 Position */ -#define CLK_PMUCTL_WKPINEN1_Msk (0x3ul << CLK_PMUCTL_WKPINEN1_Pos) /*!< CLK_T::PMUCTL: WKPINEN1 Mask */ - -#define CLK_PMUCTL_WKPINEN2_Pos (26) /*!< CLK_T::PMUCTL: WKPINEN2 Position */ -#define CLK_PMUCTL_WKPINEN2_Msk (0x3ul << CLK_PMUCTL_WKPINEN2_Pos) /*!< CLK_T::PMUCTL: WKPINEN2 Mask */ - -#define CLK_PMUCTL_WKPINEN3_Pos (28) /*!< CLK_T::PMUCTL: WKPINEN3 Position */ -#define CLK_PMUCTL_WKPINEN3_Msk (0x3ul << CLK_PMUCTL_WKPINEN3_Pos) /*!< CLK_T::PMUCTL: WKPINEN3 Mask */ - -#define CLK_PMUCTL_WKPINEN4_Pos (30) /*!< CLK_T::PMUCTL: WKPINEN4 Position */ -#define CLK_PMUCTL_WKPINEN4_Msk (0x3ul << CLK_PMUCTL_WKPINEN4_Pos) /*!< CLK_T::PMUCTL: WKPINEN4 Mask */ - -#define CLK_PMUSTS_PINWK0_Pos (0) /*!< CLK_T::PMUSTS: PINWK0 Position */ -#define CLK_PMUSTS_PINWK0_Msk (0x1ul << CLK_PMUSTS_PINWK0_Pos) /*!< CLK_T::PMUSTS: PINWK0 Mask */ - -#define CLK_PMUSTS_TMRWK_Pos (1) /*!< CLK_T::PMUSTS: TMRWK Position */ -#define CLK_PMUSTS_TMRWK_Msk (0x1ul << CLK_PMUSTS_TMRWK_Pos) /*!< CLK_T::PMUSTS: TMRWK Mask */ - -#define CLK_PMUSTS_RTCWK_Pos (2) /*!< CLK_T::PMUSTS: RTCWK Position */ -#define CLK_PMUSTS_RTCWK_Msk (0x1ul << CLK_PMUSTS_RTCWK_Pos) /*!< CLK_T::PMUSTS: RTCWK Mask */ - -#define CLK_PMUSTS_PINWK1_Pos (3) /*!< CLK_T::PMUSTS: PINWK1 Position */ -#define CLK_PMUSTS_PINWK1_Msk (0x1ul << CLK_PMUSTS_PINWK1_Pos) /*!< CLK_T::PMUSTS: PINWK1 Mask */ - -#define CLK_PMUSTS_PINWK2_Pos (4) /*!< CLK_T::PMUSTS: PINWK2 Position */ -#define CLK_PMUSTS_PINWK2_Msk (0x1ul << CLK_PMUSTS_PINWK2_Pos) /*!< CLK_T::PMUSTS: PINWK2 Mask */ - -#define CLK_PMUSTS_PINWK3_Pos (5) /*!< CLK_T::PMUSTS: PINWK3 Position */ -#define CLK_PMUSTS_PINWK3_Msk (0x1ul << CLK_PMUSTS_PINWK3_Pos) /*!< CLK_T::PMUSTS: PINWK3 Mask */ - -#define CLK_PMUSTS_PINWK4_Pos (6) /*!< CLK_T::PMUSTS: PINWK4 Position */ -#define CLK_PMUSTS_PINWK4_Msk (0x1ul << CLK_PMUSTS_PINWK4_Pos) /*!< CLK_T::PMUSTS: PINWK4 Mask */ - -#define CLK_PMUSTS_VBUSWK_Pos (7) /*!< CLK_T::PMUSTS: VBUSWK Position */ -#define CLK_PMUSTS_VBUSWK_Msk (0x1ul << CLK_PMUSTS_VBUSWK_Pos) /*!< CLK_T::PMUSTS: VBUSWK Mask */ - -#define CLK_PMUSTS_GPAWK_Pos (8) /*!< CLK_T::PMUSTS: GPAWK Position */ -#define CLK_PMUSTS_GPAWK_Msk (0x1ul << CLK_PMUSTS_GPAWK_Pos) /*!< CLK_T::PMUSTS: GPAWK Mask */ - -#define CLK_PMUSTS_GPBWK_Pos (9) /*!< CLK_T::PMUSTS: GPBWK Position */ -#define CLK_PMUSTS_GPBWK_Msk (0x1ul << CLK_PMUSTS_GPBWK_Pos) /*!< CLK_T::PMUSTS: GPBWK Mask */ - -#define CLK_PMUSTS_GPCWK_Pos (10) /*!< CLK_T::PMUSTS: GPCWK Position */ -#define CLK_PMUSTS_GPCWK_Msk (0x1ul << CLK_PMUSTS_GPCWK_Pos) /*!< CLK_T::PMUSTS: GPCWK Mask */ - -#define CLK_PMUSTS_GPDWK_Pos (11) /*!< CLK_T::PMUSTS: GPDWK Position */ -#define CLK_PMUSTS_GPDWK_Msk (0x1ul << CLK_PMUSTS_GPDWK_Pos) /*!< CLK_T::PMUSTS: GPDWK Mask */ - -#define CLK_PMUSTS_LVRWK_Pos (12) /*!< CLK_T::PMUSTS: LVRWK Position */ -#define CLK_PMUSTS_LVRWK_Msk (0x1ul << CLK_PMUSTS_LVRWK_Pos) /*!< CLK_T::PMUSTS: LVRWK Mask */ - -#define CLK_PMUSTS_BODWK_Pos (13) /*!< CLK_T::PMUSTS: BODWK Position */ -#define CLK_PMUSTS_BODWK_Msk (0x1ul << CLK_PMUSTS_BODWK_Pos) /*!< CLK_T::PMUSTS: BODWK Mask */ - -#define CLK_PMUSTS_RSTWK_Pos (15) /*!< CLK_T::PMUSTS: RSTWK Position */ -#define CLK_PMUSTS_RSTWK_Msk (0x1ul << CLK_PMUSTS_RSTWK_Pos) /*!< CLK_T::PMUSTS: RSTWK Mask */ - -#define CLK_PMUSTS_ACMPWK0_Pos (16) /*!< CLK_T::PMUSTS: ACMPWK0 Position */ -#define CLK_PMUSTS_ACMPWK0_Msk (0x1ul << CLK_PMUSTS_ACMPWK0_Pos) /*!< CLK_T::PMUSTS: ACMPWK0 Mask */ - -#define CLK_PMUSTS_ACMPWK1_Pos (17) /*!< CLK_T::PMUSTS: ACMPWK1 Position */ -#define CLK_PMUSTS_ACMPWK1_Msk (0x1ul << CLK_PMUSTS_ACMPWK1_Pos) /*!< CLK_T::PMUSTS: ACMPWK1 Mask */ - -#define CLK_PMUSTS_ACMPWK2_Pos (18) /*!< CLK_T::PMUSTS: ACMPWK2 Position */ -#define CLK_PMUSTS_ACMPWK2_Msk (0x1ul << CLK_PMUSTS_ACMPWK2_Pos) /*!< CLK_T::PMUSTS: ACMPWK2 Mask */ - -#define CLK_PMUSTS_ACMPWK3_Pos (19) /*!< CLK_T::PMUSTS: ACMPWK3 Position */ -#define CLK_PMUSTS_ACMPWK3_Msk (0x1ul << CLK_PMUSTS_ACMPWK3_Pos) /*!< CLK_T::PMUSTS: ACMPWK3 Mask */ - -#define CLK_PMUSTS_CLRWK_Pos (31) /*!< CLK_T::PMUSTS: CLRWK Position */ -#define CLK_PMUSTS_CLRWK_Msk (0x1ul << CLK_PMUSTS_CLRWK_Pos) /*!< CLK_T::PMUSTS: CLRWK Mask */ - -#define CLK_SWKDBCTL_SWKDBCLKSEL_Pos (0) /*!< CLK_T::SWKDBCTL: SWKDBCLKSEL Position */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_Msk (0xful << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< CLK_T::SWKDBCTL: SWKDBCLKSEL Mask */ - -#define CLK_PASWKCTL_WKEN_Pos (0) /*!< CLK_T::PASWKCTL: WKEN Position */ -#define CLK_PASWKCTL_WKEN_Msk (0x1ul << CLK_PASWKCTL_WKEN_Pos) /*!< CLK_T::PASWKCTL: WKEN Mask */ - -#define CLK_PASWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PASWKCTL: PRWKEN Position */ -#define CLK_PASWKCTL_PRWKEN_Msk (0x1ul << CLK_PASWKCTL_PRWKEN_Pos) /*!< CLK_T::PASWKCTL: PRWKEN Mask */ - -#define CLK_PASWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PASWKCTL: PFWKEN Position */ -#define CLK_PASWKCTL_PFWKEN_Msk (0x1ul << CLK_PASWKCTL_PFWKEN_Pos) /*!< CLK_T::PASWKCTL: PFWKEN Mask */ - -#define CLK_PASWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PASWKCTL: WKPSEL Position */ -#define CLK_PASWKCTL_WKPSEL_Msk (0xful << CLK_PASWKCTL_WKPSEL_Pos) /*!< CLK_T::PASWKCTL: WKPSEL Mask */ - -#define CLK_PASWKCTL_DBEN_Pos (8) /*!< CLK_T::PASWKCTL: DBEN Position */ -#define CLK_PASWKCTL_DBEN_Msk (0x1ul << CLK_PASWKCTL_DBEN_Pos) /*!< CLK_T::PASWKCTL: DBEN Mask */ - -#define CLK_PBSWKCTL_WKEN_Pos (0) /*!< CLK_T::PBSWKCTL: WKEN Position */ -#define CLK_PBSWKCTL_WKEN_Msk (0x1ul << CLK_PBSWKCTL_WKEN_Pos) /*!< CLK_T::PBSWKCTL: WKEN Mask */ - -#define CLK_PBSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PBSWKCTL: PRWKEN Position */ -#define CLK_PBSWKCTL_PRWKEN_Msk (0x1ul << CLK_PBSWKCTL_PRWKEN_Pos) /*!< CLK_T::PBSWKCTL: PRWKEN Mask */ - -#define CLK_PBSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PBSWKCTL: PFWKEN Position */ -#define CLK_PBSWKCTL_PFWKEN_Msk (0x1ul << CLK_PBSWKCTL_PFWKEN_Pos) /*!< CLK_T::PBSWKCTL: PFWKEN Mask */ - -#define CLK_PBSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PBSWKCTL: WKPSEL Position */ -#define CLK_PBSWKCTL_WKPSEL_Msk (0xful << CLK_PBSWKCTL_WKPSEL_Pos) /*!< CLK_T::PBSWKCTL: WKPSEL Mask */ - -#define CLK_PBSWKCTL_DBEN_Pos (8) /*!< CLK_T::PBSWKCTL: DBEN Position */ -#define CLK_PBSWKCTL_DBEN_Msk (0x1ul << CLK_PBSWKCTL_DBEN_Pos) /*!< CLK_T::PBSWKCTL: DBEN Mask */ - -#define CLK_PCSWKCTL_WKEN_Pos (0) /*!< CLK_T::PCSWKCTL: WKEN Position */ -#define CLK_PCSWKCTL_WKEN_Msk (0x1ul << CLK_PCSWKCTL_WKEN_Pos) /*!< CLK_T::PCSWKCTL: WKEN Mask */ - -#define CLK_PCSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PCSWKCTL: PRWKEN Position */ -#define CLK_PCSWKCTL_PRWKEN_Msk (0x1ul << CLK_PCSWKCTL_PRWKEN_Pos) /*!< CLK_T::PCSWKCTL: PRWKEN Mask */ - -#define CLK_PCSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PCSWKCTL: PFWKEN Position */ -#define CLK_PCSWKCTL_PFWKEN_Msk (0x1ul << CLK_PCSWKCTL_PFWKEN_Pos) /*!< CLK_T::PCSWKCTL: PFWKEN Mask */ - -#define CLK_PCSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PCSWKCTL: WKPSEL Position */ -#define CLK_PCSWKCTL_WKPSEL_Msk (0xful << CLK_PCSWKCTL_WKPSEL_Pos) /*!< CLK_T::PCSWKCTL: WKPSEL Mask */ - -#define CLK_PCSWKCTL_DBEN_Pos (8) /*!< CLK_T::PCSWKCTL: DBEN Position */ -#define CLK_PCSWKCTL_DBEN_Msk (0x1ul << CLK_PCSWKCTL_DBEN_Pos) /*!< CLK_T::PCSWKCTL: DBEN Mask */ - -#define CLK_PDSWKCTL_WKEN_Pos (0) /*!< CLK_T::PDSWKCTL: WKEN Position */ -#define CLK_PDSWKCTL_WKEN_Msk (0x1ul << CLK_PDSWKCTL_WKEN_Pos) /*!< CLK_T::PDSWKCTL: WKEN Mask */ - -#define CLK_PDSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PDSWKCTL: PRWKEN Position */ -#define CLK_PDSWKCTL_PRWKEN_Msk (0x1ul << CLK_PDSWKCTL_PRWKEN_Pos) /*!< CLK_T::PDSWKCTL: PRWKEN Mask */ - -#define CLK_PDSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PDSWKCTL: PFWKEN Position */ -#define CLK_PDSWKCTL_PFWKEN_Msk (0x1ul << CLK_PDSWKCTL_PFWKEN_Pos) /*!< CLK_T::PDSWKCTL: PFWKEN Mask */ - -#define CLK_PDSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PDSWKCTL: WKPSEL Position */ -#define CLK_PDSWKCTL_WKPSEL_Msk (0xful << CLK_PDSWKCTL_WKPSEL_Pos) /*!< CLK_T::PDSWKCTL: WKPSEL Mask */ - -#define CLK_PDSWKCTL_DBEN_Pos (8) /*!< CLK_T::PDSWKCTL: DBEN Position */ -#define CLK_PDSWKCTL_DBEN_Msk (0x1ul << CLK_PDSWKCTL_DBEN_Pos) /*!< CLK_T::PDSWKCTL: DBEN Mask */ - -#define CLK_IOPDCTL_IOHR_Pos (0) /*!< CLK_T::IOPDCTL: IOHR Position */ -#define CLK_IOPDCTL_IOHR_Msk (0x1ul << CLK_IOPDCTL_IOHR_Pos) /*!< CLK_T::IOPDCTL: IOHR Mask */ - - -/**@}*/ /* CLK_CONST */ -/**@}*/ /* end of CLK register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CLK_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crc_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crc_reg.h deleted file mode 100644 index e4af4234bfc..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crc_reg.h +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************//** - * @file crc_reg.h - * @version V3.00 - * @brief CRC register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CRC_REG_H__ -#define __CRC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Cyclic Redundancy Check Controller -------------------------*/ -/** - @addtogroup CRC Cyclic Redundancy Check Controller(CRC) - Memory Mapped Structure for CRC Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var CRC_T::CTL - * Offset: 0x00 CRC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRCEN |CRC Channel Enable Bit - * | | |0 = No effect. - * | | |1 = CRC operation Enabled. - * |[1] |CHKSINIT |Checksum Initialization - * | | |0 = No effect. - * | | |1 = Initial checksum value by auto reload CRC_SEED register value to CRC_CHECKSUM register value. - * | | |Note: This bit will be cleared automatically and written only. - * |[24] |DATREV |Write Data Bit Order Reverse - * | | |This bit is used to enable the bit order reverse function per byte for write data value in CRC_DAT register. - * | | |0 = Bit order reversed for CRC write data in Disabled. - * | | |1 = Bit order reversed for CRC write data in Enabled (per byte). - * | | |Note: If the write data is 0xAABBCCDD, the bit order reverse for CRC write data in is 0x55DD33BB. - * |[25] |CHKSREV |Checksum Bit Order Reverse - * | | |This bit is used to enable the bit order reverse function for checksum result in CRC_CHECKSUM register. - * | | |0 = Bit order reverse for CRC checksum Disabled. - * | | |1 = Bit order reverse for CRC checksum Enabled. - * | | |Note: If the checksum result is 0xDD7B0F2E, the bit order reverse for CRC checksum is 0x74F0DEBB. - * |[26] |DATFMT |Write Data 1's Complement - * | | |This bit is used to enable the 1's complement function for write data value in CRC_DAT register. - * | | |0 = 1's complement for CRC writes data in Disabled. - * | | |1 = 1's complement for CRC writes data in Enabled. - * |[27] |CHKSFMT |Checksum 1's Complement - * | | |This bit is used to enable the 1's complement function for checksum result in CRC_CHECKSUM register. - * | | |0 = 1's complement for CRC checksum Disabled. - * | | |0 = 1's complement for CRC checksum Enabled. - * |[29:28] |DATLEN |CPU Write Data Length - * | | |This field indicates the write data length. - * | | |00 = Data length is 8-bit mode. - * | | |01 = Data length is 16-bit mode. - * | | |1x = Data length is 32-bit mode. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0]. - * |[31:30] |CRCMODE |CRC Polynomial Mode - * | | |This field indicates the CRC operation polynomial mode. - * | | |10 = CRC-16 Polynomial mode. - * | | |01 = CRC-8 Polynomial mode. - * | | |10 = CRC-16 Polynomial mode. - * | | |11 = CRC-32 Polynomial mode. - * | | |Note: User must program the polynomial value in CRC_POLYNOMIAL register to specify the polynomial used for CRC calculation. - * @var CRC_T::DAT - * Offset: 0x04 CRC Write Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |CRC Write Data Bits - * | | |User can write data directly by CPU mode or use PDMA function to write data to this field to perform CRC operation. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0]. - * @var CRC_T::SEED - * Offset: 0x08 CRC Seed Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |CRC Seed Value - * | | |This field indicates the CRC seed value. - * | | |Note: This field will be reloaded as checksum initial value (CRC_CHECKSUM register) after perform CHKSINIT (CRC_CTL[1]). - * @var CRC_T::CHECKSUM - * Offset: 0x0C CRC Checksum Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CHECKSUM |CRC Checksum Results - * | | |This field indicates the CRC checksum result. - * | | |Note: The valid bits of CRC_CHECKSUM[31:0] is correlated to CRCMODE (CRC_CTL[31:30]). - * @var CRC_T::POLYNOMIAL - * Offset: 0x10 CRC Polynomial Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POLYNOMIAL |CRC Polynomial Register - * | | |This field indicates the value of CRC polynomial. - */ - __IO uint32_t CTL; /*!< [0x0000] CRC Control Register */ - __IO uint32_t DAT; /*!< [0x0004] CRC Write Data Register */ - __IO uint32_t SEED; /*!< [0x0008] CRC Seed Register */ - __I uint32_t CHECKSUM; /*!< [0x000c] CRC Checksum Register */ - __IO uint32_t POLYNOMIAL; /*!< [0x0010] CRC Polynomial Register */ - -} CRC_T; - -/** - @addtogroup CRC_CONST CRC Bit Field Definition - Constant Definitions for CRC Controller - @{ -*/ - -#define CRC_CTL_CRCEN_Pos (0) /*!< CRC_T::CTL: CRCEN Position */ -#define CRC_CTL_CRCEN_Msk (0x1ul << CRC_CTL_CRCEN_Pos) /*!< CRC_T::CTL: CRCEN Mask */ - -#define CRC_CTL_CHKSINIT_Pos (1) /*!< CRC_T::CTL: CHKSINIT Position */ -#define CRC_CTL_CHKSINIT_Msk (0x1ul << CRC_CTL_CHKSINIT_Pos) /*!< CRC_T::CTL: CHKSINIT Mask */ - -#define CRC_CTL_DATREV_Pos (24) /*!< CRC_T::CTL: DATREV Position */ -#define CRC_CTL_DATREV_Msk (0x1ul << CRC_CTL_DATREV_Pos) /*!< CRC_T::CTL: DATREV Mask */ - -#define CRC_CTL_CHKSREV_Pos (25) /*!< CRC_T::CTL: CHKSREV Position */ -#define CRC_CTL_CHKSREV_Msk (0x1ul << CRC_CTL_CHKSREV_Pos) /*!< CRC_T::CTL: CHKSREV Mask */ - -#define CRC_CTL_DATFMT_Pos (26) /*!< CRC_T::CTL: DATFMT Position */ -#define CRC_CTL_DATFMT_Msk (0x1ul << CRC_CTL_DATFMT_Pos) /*!< CRC_T::CTL: DATFMT Mask */ - -#define CRC_CTL_CHKSFMT_Pos (27) /*!< CRC_T::CTL: CHKSFMT Position */ -#define CRC_CTL_CHKSFMT_Msk (0x1ul << CRC_CTL_CHKSFMT_Pos) /*!< CRC_T::CTL: CHKSFMT Mask */ - -#define CRC_CTL_DATLEN_Pos (28) /*!< CRC_T::CTL: DATLEN Position */ -#define CRC_CTL_DATLEN_Msk (0x3ul << CRC_CTL_DATLEN_Pos) /*!< CRC_T::CTL: DATLEN Mask */ - -#define CRC_CTL_CRCMODE_Pos (30) /*!< CRC_T::CTL: CRCMODE Position */ -#define CRC_CTL_CRCMODE_Msk (0x3ul << CRC_CTL_CRCMODE_Pos) /*!< CRC_T::CTL: CRCMODE Mask */ - -#define CRC_DAT_DATA_Pos (0) /*!< CRC_T::DAT: DATA Position */ -#define CRC_DAT_DATA_Msk (0xfffffffful << CRC_DAT_DATA_Pos) /*!< CRC_T::DAT: DATA Mask */ - -#define CRC_SEED_SEED_Pos (0) /*!< CRC_T::SEED: SEED Position */ -#define CRC_SEED_SEED_Msk (0xfffffffful << CRC_SEED_SEED_Pos) /*!< CRC_T::SEED: SEED Mask */ - -#define CRC_CHECKSUM_CHECKSUM_Pos (0) /*!< CRC_T::CHECKSUM: CHECKSUM Position */ -#define CRC_CHECKSUM_CHECKSUM_Msk (0xfffffffful << CRC_CHECKSUM_CHECKSUM_Pos) /*!< CRC_T::CHECKSUM: CHECKSUM Mask */ - -#define CRC_POLYNOMIAL_POLYNOMIAL_Pos (0) /*!< CRC_T::POLYNOMIAL: POLYNOMIAL Position */ -#define CRC_POLYNOMIAL_POLYNOMIAL_Msk (0xfffffffful << CRC_POLYNOMIAL_POLYNOMIAL_Pos) /*!< CRC_T::POLYNOMIAL: POLYNOMIAL Mask */ - - -/**@}*/ /* CRC_CONST */ -/**@}*/ /* end of CRC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CRC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crypto_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crypto_reg.h deleted file mode 100644 index 46c7794b861..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/crypto_reg.h +++ /dev/null @@ -1,6827 +0,0 @@ -/**************************************************************************//** - * @file crypto_reg.h - * @version V1.00 - * @brief CRYPTO register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CRYPTO_REG_H__ -#define __CRYPTO_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - - -/*---------------------- Cryptographic Accelerator -------------------------*/ -/** - @addtogroup CRPT Cryptographic Accelerator(CRPT) - Memory Mapped Structure for CRPT Controller -@{ */ - -typedef struct -{ - - - /** - * @var CRPT_T::INTEN - * Offset: 0x00 Crypto Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIEN |AES Interrupt Enable Bit - * | | |0 = AES interrupt Disabled. - * | | |1 = AES interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when an amount of data set in AES_DMA_CNT is fed into the AES engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the AES engine finishes the operation. - * |[1] |AESEIEN |AES Error Flag Enable Bit - * | | |0 = AES error interrupt flag Disabled. - * | | |1 = AES error interrupt flag Enabled. - * |[16] |PRNGIEN |PRNG Interrupt Enable Bit - * | | |0 = PRNG interrupt Disabled. - * | | |1 = PRNG interrupt Enabled. - * |[17] |PRNGEIEN |PRNG Error Flag Enable Bit - * | | |0 = PRNG error interrupt flag Disabled. - * | | |1 = PRNG error interrupt flag Enabled. - * |[22] |ECCIEN |ECC Interrupt Enable Bit - * | | |0 = ECC interrupt Disabled. - * | | |1 = ECC interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when an amount of data set in ECC_DMA_CNT is fed into the ECC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the ECC engine finishes the operation. - * |[23] |ECCEIEN |ECC Error Interrupt Enable Bit - * | | |0 = ECC error interrupt flag Disabled. - * | | |1 = ECC error interrupt flag Enabled. - * |[24] |HMACIEN |SHA/HMAC Interrupt Enable Bit - * | | |0 = SHA/HMAC interrupt Disabled. - * | | |1 = SHA/HMAC interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when an amount of data set in HMAC_DMA_CNT is fed into the SHA/HMAC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the SHA/HMAC engine finishes the operation. - * |[25] |HMACEIEN |SHA/HMAC Error Interrupt Enable Bit - * | | |0 = SHA/HMAC error interrupt flag Disabled. - * | | |1 = HMAC error interrupt flag Enabled. - * |[30] |RSAIEN |RSA Interrupt Enable Bit - * | | |0 = RSA interrupt Disabled. - * | | |1 = RSA interrupt Enabled. - * |[31] |RSAEIEN |RSA Error Interrupt Enable Bit - * | | |0 = RSA error interrupt flag Disabled. - * | | |1 = RSA error interrupt flag Enabled. - * @var CRPT_T::INTSTS - * Offset: 0x04 Crypto Interrupt Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIF |AES Finish Interrupt Flag - * | | |0 = No AES interrupt. - * | | |1 = AES encryption/decryption done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[1] |AESEIF |AES Error Flag - * | | |0 = No AES error. - * | | |1 = AES encryption/decryption error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[16] |PRNGIF |PRNG Finish Interrupt Flag - * | | |0 = No PRNG interrupt. - * | | |1 = PRNG key generation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[17] |PRNGEIF |PRNG Error Flag - * | | |0 = No PRNG error. - * | | |1 = PRNG key generation error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[22] |ECCIF |ECC Finish Interrupt Flag - * | | |0 = No ECC interrupt. - * | | |1 = ECC operation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[23] |ECCEIF |ECC Error Flag - * | | |This register includes operating and setting error. The detail flag is shown in CRPT_ECC_STS register. - * | | |0 = No ECC error. - * | | |1 = ECC error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[24] |HMACIF |SHA/HMAC Finish Interrupt Flag - * | | |0 = No SHA/HMAC interrupt. - * | | |1 = SHA/HMAC operation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[25] |HMACEIF |SHA/HMAC Error Flag - * | | |This register includes operating and setting error. The detail flag is shown in CRPT_HMAC_STS register. - * | | |0 = No SHA/HMAC error. - * | | |1 = SHA/HMAC error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[30] |RSAIF |RSA Finish Interrupt Flag - * | | |0 = No RSA interrupt. - * | | |1 = RSA operation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[31] |RSAEIF |RSA Error Interrupt Flag - * | | |This register includes operating and setting error. The detail flag is shown in CRPT_RSA_STS register. - * | | |0 = No RSA error. - * | | |1 = RSA error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * @var CRPT_T::PRNG_CTL - * Offset: 0x08 PRNG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Start PRNG Engine - * | | |0 = Stop PRNG engine. - * | | |1 = Generate new key and store the new key to register CRPT_PRNG_KEYx, which will be cleared when the new key is generated. - * |[1] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * |[5:2] |KEYSZ |PRNG Generate Key Size - * | | |0000 = 128 bits. - * | | |0001 = 163 bits. - * | | |0010 = 192 bits. - * | | |0011 = 224 bits. - * | | |0100 = 233 bits. - * | | |0101 = 255 bits. - * | | |0110 = 256 bits. - * | | |0111 = 283 bits (only for KS). - * | | |1000 = 384 bits (only for KS). - * | | |1001 = 409 bits (only for KS). - * | | |1010 = 512 bits (only for KS). - * | | |1011 = 521 bits (only for KS). - * | | |1100 = 571 bits (only for KS). - * | | |1101 = Reserved. - * | | |1110 = Reserved. - * | | |1111 = Reserved. - * | | |Note: 283~571 bits are only generated for key store. - * |[8] |BUSY |PRNG Busy (Read Only) - * | | |0 = PRNG engine is idle. - * | | |1 = PRNG engine is generating CRPT_PRNG_KEYx. - * |[16] |SEEDSRC |Seed Source - * | | |0 = Seed is from TRNG. - * | | |1 = Seed is from PRNG seed register. - * | | |Note: When SEEDRLD is set to 0, this bit (SEEDSRC) is meaningless. - * @var CRPT_T::PRNG_SEED - * Offset: 0x0C Seed for PRNG - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed for PRNG (Write Only) - * | | |The bits store the seed for PRNG engine. - * | | |Note: In TRNG+PRNG mode, the seed is from TRNG engine, and it will not be stored in this register. - * @var CRPT_T::PRNG_KEY0 - * Offset: 0x10 PRNG Generated Key0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_KEY1 - * Offset: 0x14 PRNG Generated Key1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_KEY2 - * Offset: 0x18 PRNG Generated Key2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_KEY3 - * Offset: 0x1C PRNG Generated Key3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_KEY4 - * Offset: 0x20 PRNG Generated Key4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_KEY5 - * Offset: 0x24 PRNG Generated Key5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_KEY6 - * Offset: 0x28 PRNG Generated Key6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_KEY7 - * Offset: 0x2C PRNG Generated Key7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::PRNG_STS - * Offset: 0x30 PRNG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |PRNG Busy Flag - * | | |0 = PRNG engine is idle. - * | | |1 = PRNG engine is generating CRPT_PRNG_KEYx. - * |[16] |KCTLERR |PRNG Key Control Register Error Flag - * | | |0 = No error. - * | | |1 = PRNG key control error - * | | |When PRNG execute ECDSA or ECDH, but PRNG seed not from TRNG or key is not written to the SRAM of key store (WSDST, CRPT_PRNG_KSCTL[23:22] is not equal to u201900u2019). - * |[17] |KSERR |PRNG Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access key store failed. - * @var CRPT_T::AES_FDBCK0 - * Offset: 0x50 AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next blocku2019s operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRPT_T::AES_FDBCK1 - * Offset: 0x54 AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next blocku2019s operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRPT_T::AES_FDBCK2 - * Offset: 0x58 AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next blocku2019s operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRPT_T::AES_FDBCK3 - * Offset: 0x5C AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next blocku2019s operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRPT_T::AES_GCM_IVCNT0 - * Offset: 0x80 AES GCM IV Byte Count Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM IV Byte Count - * | | |The bit length of IV is 64 bits for AES GCM mode - * | | |The CRPT_AES_GCM_IVCNT0 keeps the low weight byte count of initial vector (i.e., len(IV)[34:3]) of AES GCM mode and can be read and written. - * @var CRPT_T::AES_GCM_IVCNT1 - * Offset: 0x84 AES GCM IV Byte Count Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |CNT |AES GCM IV Byte Count - * | | |The bit length of IV is 64 bits for AES GCM mode - * | | |The CRPT_AES_GCM_IVCNT1 keeps the high weight byte count of initial vector (i.e., len(IV)[64:35]) of AES GCM mode and can be read and written. - * @var CRPT_T::AES_GCM_ACNT0 - * Offset: 0x88 AES GCM A Byte Count Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM a Byte Count - * | | |The bit length of A is 64 bits for AES GCM mode - * | | |The CRPT_AES_GCM_ACNT0 keeps the low weight byte count of the additional authenticated data (i.e., len(A)[34:3]) of AES GCM mode and can be read and written. - * @var CRPT_T::AES_GCM_ACNT1 - * Offset: 0x8C AES GCM A Byte Count Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |CNT |AES GCM a Byte Count - * | | |The bit length of A is 64 bits for AES GCM mode - * | | |The CRPT_AES_GCM_ACNT0 keeps the high weight byte count of the additional authenticated data (i.e., len(A)[63:35]) of AES GCM mode and can be read and written. - * @var CRPT_T::AES_GCM_PCNT0 - * Offset: 0x90 AES GCM P Byte Count Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM P Byte Count - * | | |The bit length of Por C is 39 bits for AES GCM mode - * | | |The CRPT_AES_GCM_PCNT0 keeps the low weight byte count of the plaintext or ciphertext (i.e., len(P)[34:3] or len(C)[34:3]) of AES GCM mode and can be read and written. - * @var CRPT_T::AES_GCM_PCNT1 - * Offset: 0x94 AES GCM P Byte Count Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |CNT |AES GCM P Byte Count - * | | |The bit length of Por C is 39 bits for AES GCM mode - * | | |The CRPT_AES_GCM_PCNT1 keeps the high weight byte count of the plaintext or ciphertext (i.e., len(P)[38:35] or len(C)[38:35]) of AES GCM mode and can be read and written. - * | | |The bit length of Por C is 64 bits for AES CCM mode - * | | |The CRPT_AES_GCM_PCNT1 keeps the high weight byte count of the plaintext or ciphertext (i.e., len(P)[63:35] or len(C)[63:35]) of AES CCM mode and can be read and written. - * @var CRPT_T::AES_FBADDR - * Offset: 0xA0 AES DMA Feedback Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FBADDR |AES DMA Feedback Address - * | | |In DMA cascade mode, software can update DMA feedback address register for automatically reading and writing feedback values via DMA - * | | |The FBADDR keeps the feedback address of the feedback data for the next cascade operation - * | | |Based on the feedback address, the AES accelerator can read the feedback data of the last cascade operation from SRAM memory space and write the feedback data of the current cascade operation to SRAM memory space - * | | |The start of feedback address should be located at word boundary - * | | |In other words, bit 1 and 0 of FBADDR are ignored. - * | | |FBADDR can be read and written. - * | | |In DMA mode, software can update the next CRPT_AES_FBADDR before triggering START. - * @var CRPT_T::AES_CTL - * Offset: 0x100 AES Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |AES Engine Start - * | | |0 = No effect. - * | | |1 = Start AES engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it is read back. - * |[1] |STOP |AES Engine Stop - * | | |0 = No effect. - * | | |1 = Stop AES engine. - * | | |Note: This bit is always 0 when it is read back. - * |[3:2] |KEYSZ |AES Key Size - * | | |This bit defines three different key size for AES operation. - * | | |2u2019b00 = 128 bits key. - * | | |2u2019b01 = 192 bits key. - * | | |2u2019b10 = 256 bits key. - * | | |2u2019b11 = Reserved. - * | | |If the AES accelerator is operating and the corresponding flag BUSY is 1, updating this register has no effect. - * |[5] |DMALAST |AES Last Block - * | | |In DMA mode, this bit must be set as beginning the last DMA cascade round. - * | | |In Non-DMA mode, this bit must be set when feeding in the last block of data in ECB, CBC, CTR, OFB, and CFB mode, and feeding in the (last-1) block of data at CBC-CS1, CBC-CS2, and CBC-CS3 mode. - * | | |This bit is always 0 when it is read back, and must be written again once START is triggered. - * |[6] |DMACSCAD |AES Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * | | |Note: The last two blocks of AES-CBC-CS1/2/3 must be in the last cascade operation. - * |[7] |DMAEN |AES Engine DMA Enable Bit - * | | |0 = AES DMA engine Disabled. - * | | |The AES engine operates in Non-DMA mode. The data need to be written in CRPT_AES_DATIN. - * | | |1 = AES_DMA engine Enabled. - * | | |The AES engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[15:8] |OPMODE |AES Engine Operation Modes - * | | |0x00 = ECB (Electronic Codebook Mode) 0x01 = CBC (Cipher Block Chaining Mode). - * | | |0x02 = CFB (Cipher Feedback Mode). - * | | |0x03 = OFB (Output Feedback Mode). - * | | |0x04 = CTR (Counter Mode). - * | | |0x10 = CBC-CS1 (CBC Ciphertext-Stealing 1 Mode). - * | | |0x11 = CBC-CS2 (CBC Ciphertext-Stealing 2 Mode). - * | | |0x12 = CBC-CS3 (CBC Ciphertext-Stealing 3 Mode). - * | | |0x20 = GCM (Galois/Counter Mode). - * | | |0x21 = GHASH (Galois Hash Function). - * | | |0x22 = CCM (Counter with CBC-MAC Mode). - * |[16] |ENCRYPTO |AES Encryption/Decryption - * | | |0 = AES engine executes decryption operation. - * | | |1 = AES engine executes encryption operation. - * |[20] |FBIN |Feedback Input to AES Via DMA Automatically - * | | |0 = DMA automatic feedback input function Disabled. - * | | |1 = DMA automatic feedback input function Enabled when DMAEN = 1. - * |[21] |FBOUT |Feedback Output From AES Via DMA Automatically - * | | |0 = DMA automatic feedback output function Disabled. - * | | |1 = DMA automatic feedback output function Enabled when DMAEN = 1. - * |[22] |OUTSWAP |AES Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU reads data from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |AES Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[24] |KOUTSWAP |AES Engine Output Key, Initial Vector and Feedback Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU reads key, initial vector and feedback from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[25] |KINSWAP |AES Engine Input Key and Initial Vector Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds key and initial vector to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[30:26] |KEYUNPRT |Unprotect Key - * | | |Writing 0 to CRPT_AES_CTL[31] and u201C10110u201D to CRPT_AES_CTL[30:26] is to unprotect the AES key. - * | | |The KEYUNPRT can be read and written - * | | |When it is written as the AES engine is operating, BUSY flag is 1, there would be no effect on KEYUNPRT. - * |[31] |KEYPRT |Protect Key - * | | |Read as a flag to reflect KEYPRT. - * | | |0 = No effect. - * | | |1 = Protect the content of the AES key from reading - * | | |The return value for reading CRPT_AES_KEYx is not the content of the registers CRPT_AES_KEYx - * | | |Once it is set, it can be cleared by asserting KEYUNPRT - * | | |The key content would be cleared as well. - * @var CRPT_T::AES_STS - * Offset: 0x104 AES Engine Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |AES Engine Busy - * | | |0 = The AES engine is idle or finished. - * | | |1 = The AES engine is under processing. - * |[8] |INBUFEMPTY|AES Input Buffer Empty - * | | |0 = There are some data in input buffer waiting for the AES engine to process. - * | | |1 = AES input buffer is empty - * | | |Software needs to feed data to the AES engine - * | | |Otherwise, the AES engine will be pending to wait for input data. - * |[9] |INBUFFULL |AES Input Buffer Full Flag - * | | |0 = AES input buffer is not full. Software can feed the data into the AES engine. - * | | |1 = AES input buffer is full - * | | |Software cannot feed data to the AES engine - * | | |Otherwise, the flag INBUFERR will be set to 1. - * |[10] |INBUFERR |AES Input Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happened during feeding data to the AES engine. - * |[12] |CNTERR |CRPT_AES_CNT Setting Error - * | | |0 = No error in CRPT_AES_CNT setting. - * | | |1 = CRPT_AES_CNT is 0 if DMAEN (CRPT_AES_CTL[7]) is enabled. - * |[16] |OUTBUFEMPTY|AES Out Buffer Empty - * | | |0 = AES output buffer is not empty. There are some valid data kept in output buffer. - * | | |1 = AES output buffer is empty - * | | |Software cannot get data from CRPT_AES_DATOUT - * | | |Otherwise, the flag OUTBUFERR will be set to 1 since the output buffer is empty. - * |[17] |OUTBUFFULL|AES Out Buffer Full Flag - * | | |0 = AES output buffer is not full. - * | | |1 = AES output buffer is full, and software needs to get data from CRPT_AES_DATOUT - * | | |Otherwise, the AES engine will be pending since the output buffer is full. - * |[18] |OUTBUFERR |AES Out Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happened during getting the result from AES engine. - * |[20] |BUSERR |AES DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and AES engine. - * |[21] |KSERR |AES Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Key store access error will stop AES engine. - * @var CRPT_T::AES_DATIN - * Offset: 0x108 AES Engine Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |AES Engine Input Port - * | | |CPU feeds data to AES engine through this port by checking CRPT_AES_STS. Feed data as INBUFFULL is 0. - * @var CRPT_T::AES_DATOUT - * Offset: 0x10C AES Engine Data Output Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATOUT |AES Engine Output Port - * | | |CPU gets results from the AES engine through this port by checking CRPT_AES_STS - * | | |Get data as OUTBUFEMPTY is 0. - * @var CRPT_T::AES_KEY0 - * Offset: 0x110 AES Key Word 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_KEY1 - * Offset: 0x114 AES Key Word 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_KEY2 - * Offset: 0x118 AES Key Word 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_KEY3 - * Offset: 0x11C AES Key Word 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_KEY4 - * Offset: 0x120 AES Key Word 4 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_KEY5 - * Offset: 0x124 AES Key Word 5 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_KEY6 - * Offset: 0x128 AES Key Word 6 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_KEY7 - * Offset: 0x12C AES Key Word 7 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRPT_AES_KEY7, CRPT_AES_KEY6, CRPT_AES_KEY5, CRPT_AES_KEY4, CRPT_AES_KEY3, CRPT_AES_KEY2, CRPT_AES_KEY1, CRPT_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES_IV0 - * Offset: 0x130 AES Initial Vector Word 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES_IV1 - * Offset: 0x134 AES Initial Vector Word 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES_IV2 - * Offset: 0x138 AES Initial Vector Word 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES_IV3 - * Offset: 0x13C AES Initial Vector Word 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AES_IV0, CRPT_AES_IV1, CRPT_AES_IV2, and CRPT_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES_SADDR - * Offset: 0x140 AES DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between SRAM memory space and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text (encryption) / cipher text (decryption) from SRAM memory space and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesnu2019t affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AES_SADDR before triggering START. - * | | |The value of CRPT_AES_SADDR and CRPT_AES_DADDR can be the same. - * @var CRPT_T::AES_DADDR - * Offset: 0x144 AES DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between SRAM memory space and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine outputu2019s text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text (encryption) / plain text (decryption) back to SRAM memory space after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesnu2019t affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AES_DADDR before triggering START. - * | | |The value of CRPT_AES_SADDR and CRPT_AES_DADDR can be the same. - * @var CRPT_T::AES_CNT - * Offset: 0x148 AES Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRPT_AES_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRPT_AES_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_AES_CNT can be read and written - * | | |Writing to CRPT_AES_CNT while the AES accelerator is operating doesnu2019t affect the current AES operation - * | | |But the value of CRPT_AES_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be more than 16 bytes - * | | |Operations that are qual or less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, CTR, CCM and GCM mode, CRPT_AES_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AES_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * | | |In AES GCM mode without DMA cascade function, the value of CRPT_AES_CNT is equal to the total value of {CRPT_AES_GCM_IVCNT1, CRPT_AES_GCM_IVCNT0}, {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0}. - * | | |In AES GCM mode with DMA cascade function, the value of CRPT_AES_CNT represents the byte count of source text in this cascade function - * | | |Thus, the value of CRPT_AES_CNT is less than or equal to the total value of {CRPT_AES_GCM_IVCNT1, CRPT_AES_GCM_IVCNT0}, {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0} and must be block alignment. - * | | |In AES CCM mode without DMA cascade function, the value of CRPT_AES_CNT is equal to the total value of {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0}. - * | | |In AES CCM mode with DMA cascade function, the value of CRPT_AES_CNT represents the byte count of source text in this cascade function - * | | |Thus, the value of CRPT_AES_CNT is less than or equal to the total value of {CRPT_AES_GCM_ACNT1, CRPT_AES_GCM_ACNT0} and {CRPT_AES_GCM_PCNT1, CRPT_AES_GCM_PCNT0} and must be block alignment, except for the last block of plaintext or ciphertext. - * @var CRPT_T::HMAC_CTL - * Offset: 0x300 SHA/HMAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |SHA/HMAC Engine Start - * | | |0 = No effect. - * | | |1 = Start SHA/HMAC engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it is read back. - * |[1] |STOP |SHA/HMAC Engine Stop - * | | |0 = No effect. - * | | |1 = Stop SHA/HMAC engine. - * | | |Note: This bit is always 0 when it is read back. - * |[4] |DMAFIRST |SHA/HMAC First Block in Cascade function - * | | |This bit must be set as feeding in first byte of data. - * |[5] |DMALAST |SHA/HMAC Last Block - * | | |This bit must be set as feeding in last byte of data. - * |[6] |DMACSCAD |SHA/HMAC Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |SHA/HMAC Engine DMA Enable Bit - * | | |0 = SHA/HMAC DMA engine Disabled. - * | | |SHA/HMAC engine operates in Non-DMA mode. The data need to be written in CRPT_HMAC_DATIN. - * | | |1 = SHA/HMAC DMA engine Enabled. - * | | |SHA/HMAC engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[10:8] |OPMODE |SHA/HMAC Engine Operation Modes - * | | |When SHA3EN=0,. - * | | |0x0xx: SHA1-160 - * | | |0x100: SHA2-256 - * | | |0x101: SHA2-224 - * | | |0x110: SHA2-512 - * | | |0x111: SHA2-384 - * | | |When SHA3EN=1,. - * | | |0x100: SHA3-256 - * | | |0x101: SHA3-224 - * | | |0x110: SHA3-512 - * | | |0x111: SHA3-384 - * | | |0x000: SHAKE128 - * | | |0x001: SHAKE256 - * | | |Note: These bits can be read and written. But writing to them wouldnu2019t take effect as BUSY is 1. - * |[11] |HMACEN |HMAC_SHA Engine Operating Mode - * | | |0 = Execute SHA function. - * | | |1 = Execute HMAC function. - * |[12] |SHA3EN |SHA3 Engine Enable Bit - * | | |0 = Execute other function. - * | | |1 = Execute SHA3 function. - * |[20] |FBIN |Feedback Input to SHA/HMAC Via DMA Automatically - * | | |0 = DMA automatic feedback input function Disabled. - * | | |1 = DMA automatic feedback input function Enabled when DMAEN = 1. - * |[21] |FBOUT |Feedback Output From SHA/HMAC Via DMA Automatically - * | | |0 = DMA automatic feedback output function Disabled. - * | | |1 = DMA automatic feedback output function Enabled when DMAEN = 1. - * |[22] |OUTSWAP |SHA/HMAC Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |SHA/HMAC Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[24] |NEXTDGST |SHAKE128/256 Next Digest Start - * | | |0 = No effect. - * | | |1 = Start SHAKE engine to generate the next digest only when SHAKEBUSY is 0 - * | | |BUSY and SHAKEBUSY flag will be set. - * |[25] |FINISHDGST|SHAKE128/256 Next Digest Finish - * | | |0 = No effect. - * | | |1 = finish generating the next digest. - * @var CRPT_T::HMAC_STS - * Offset: 0x304 SHA/HMAC Status Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |SHA/HMAC Engine Busy - * | | |0 = SHA/HMAC engine is idle or finished. - * | | |1 = SHA/HMAC engine is busy. - * |[1] |DMABUSY |SHA/HMAC Engine DMA Busy Flag - * | | |0 = SHA/HMAC DMA engine is idle or finished. - * | | |1 = SHA/HMAC DMA engine is busy. - * |[2] |SHAKEBUSY |SHAKE Engine Busy Flag - * | | |0 = SHAKE engine is idle or finished. - * | | |1 = SHAKE engine is busy. - * |[8] |DMAERR |SHA/HMAC Engine DMA Error Flag - * | | |0 = Show the SHA/HMAC engine access normal. - * | | |1 = Show the SHA/HMAC engine access error. - * |[9] |KSERR |HMAC Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop HMAC engine. - * |[16] |DATINREQ |SHA/HMAC Non-DMA Mode Data Input Request - * | | |0 = No effect. - * | | |1 = Request SHA/HMAC Non-DMA mode data input. - * @var CRPT_T::HMAC_DGST0 - * Offset: 0x308 SHA/HMAC Output Feedback Data 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST1 - * Offset: 0x30C SHA/HMAC Output Feedback Data 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST2 - * Offset: 0x310 SHA/HMAC Output Feedback Data 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST3 - * Offset: 0x314 SHA/HMAC Output Feedback Data 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST4 - * Offset: 0x318 SHA/HMAC Output Feedback Data 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST5 - * Offset: 0x31C SHA/HMAC Output Feedback Data 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST6 - * Offset: 0x320 SHA/HMAC Output Feedback Data 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST7 - * Offset: 0x324 SHA/HMAC Output Feedback Data 7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST8 - * Offset: 0x328 SHA/HMAC Output Feedback Data 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST9 - * Offset: 0x32C SHA/HMAC Output Feedback Data 9 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST10 - * Offset: 0x330 SHA/HMAC Output Feedback Data 10 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST11 - * Offset: 0x334 SHA/HMAC Output Feedback Data 11 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST12 - * Offset: 0x338 SHA/HMAC Output Feedback Data 12 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST13 - * Offset: 0x33C SHA/HMAC Output Feedback Data 13 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST14 - * Offset: 0x340 SHA/HMAC Output Feedback Data 14 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_DGST15 - * Offset: 0x344 SHA/HMAC Output Feedback Data 15 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_KEYCNT - * Offset: 0x348 SHA/HMAC Key Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEYCNT |SHA/HMAC Key Byte Count - * | | |The CRPT_HMAC_KEYCNT keeps the byte count of key that SHA/HMAC engine operates - * | | |The register is 32-bit and the maximum byte count is 4G bytes - * | | |It can be read and written. - * | | |Writing to the register CRPT_HMAC_KEYCNT as the SHA/HMAC accelerator operating doesnu2019t affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_KEYCNT will be updated later on - * | | |Consequently, software can prepare the key count for the next SHA/HMAC operation. - * @var CRPT_T::HMAC_SADDR - * Offset: 0x34C SHA/HMAC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |SHA/HMAC DMA Source Address - * | | |The SHA/HMAC accelerator supports DMA function to transfer the plain text between SRAM memory space and embedded FIFO - * | | |The CRPT_HMAC_SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the SHA/HMAC accelerator can read the plain text from SRAM memory space and do SHA/HMAC operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_HMAC_SADDR are ignored. - * | | |CRPT_HMAC_SADDR can be read and written - * | | |Writing to CRPT_HMAC_SADDR while the SHA/HMAC accelerator is operating doesnu2019t affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next SHA/HMAC operation. - * | | |In DMA mode, software can update the next CRPT_HMAC_SADDR before triggering START. - * | | |CRPT_HMAC_SADDR and CRPT_HMAC_DADDR can be the same in the value. - * @var CRPT_T::HMAC_DMACNT - * Offset: 0x350 SHA/HMAC Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMACNT |SHA/HMAC Operation Byte Count - * | | |The CRPT_HMAC_DMACNT keeps the byte count of source text that is for the SHA/HMAC engine operating in DMA mode - * | | |The CRPT_HMAC_DMACNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_HMAC_DMACNT can be read and written - * | | |Writing to CRPT_HMAC_DMACNT while the SHA/HMAC accelerator is operating doesnu2019t affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_DMACNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next SHA/HMAC operation. - * | | |In Non-DMA mode, CRPT_HMAC_DMACNT must be set as the byte count of the last block before feeding in the last block of data. - * @var CRPT_T::HMAC_DATIN - * Offset: 0x354 SHA/HMAC Engine Non-DMA Mode Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |SHA/HMAC Engine Input Port - * | | |CPU feeds data to SHA/HMAC engine through this port by checking CRPT_HMAC_STS - * | | |Feed data as DATINREQ is 1. - * @var CRPT_T::HMAC_FDBCK0 - * Offset: 0x358 SHA/HMAC Output Feedback Data 0 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK1 - * Offset: 0x35C SHA/HMAC Output Feedback Data 1 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK2 - * Offset: 0x360 SHA/HMAC Output Feedback Data 2 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK3 - * Offset: 0x364 SHA/HMAC Output Feedback Data 3 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK4 - * Offset: 0x368 SHA/HMAC Output Feedback Data 4 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK5 - * Offset: 0x36C SHA/HMAC Output Feedback Data 5 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK6 - * Offset: 0x370 SHA/HMAC Output Feedback Data 6 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK7 - * Offset: 0x374 SHA/HMAC Output Feedback Data 7 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK8 - * Offset: 0x378 SHA/HMAC Output Feedback Data 8 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK9 - * Offset: 0x37C SHA/HMAC Output Feedback Data 9 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK10 - * Offset: 0x380 SHA/HMAC Output Feedback Data 10 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK11 - * Offset: 0x384 SHA/HMAC Output Feedback Data 11 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK12 - * Offset: 0x388 SHA/HMAC Output Feedback Data 12 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK13 - * Offset: 0x38C SHA/HMAC Output Feedback Data 13 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK14 - * Offset: 0x390 SHA/HMAC Output Feedback Data 14 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK15 - * Offset: 0x394 SHA/HMAC Output Feedback Data 15 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK16 - * Offset: 0x398 SHA/HMAC Output Feedback Data 16 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK17 - * Offset: 0x39C SHA/HMAC Output Feedback Data 17 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK18 - * Offset: 0x3A0 SHA/HMAC Output Feedback Data 18 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK19 - * Offset: 0x3A4 SHA/HMAC Output Feedback Data 19 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK20 - * Offset: 0x3A8 SHA/HMAC Output Feedback Data 20 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK21 - * Offset: 0x3AC SHA/HMAC Output Feedback Data 21 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK22 - * Offset: 0x3B0 SHA/HMAC Output Feedback Data 22 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK23 - * Offset: 0x3B4 SHA/HMAC Output Feedback Data 23 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK24 - * Offset: 0x3B8 SHA/HMAC Output Feedback Data 24 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK25 - * Offset: 0x3BC SHA/HMAC Output Feedback Data 25 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK26 - * Offset: 0x3C0 SHA/HMAC Output Feedback Data 26 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK27 - * Offset: 0x3C4 SHA/HMAC Output Feedback Data 27 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK28 - * Offset: 0x3C8 SHA/HMAC Output Feedback Data 28 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK29 - * Offset: 0x3CC SHA/HMAC Output Feedback Data 29 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK30 - * Offset: 0x3D0 SHA/HMAC Output Feedback Data 30 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK31 - * Offset: 0x3D4 SHA/HMAC Output Feedback Data 31 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK32 - * Offset: 0x3D8 SHA/HMAC Output Feedback Data 32 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK33 - * Offset: 0x3DC SHA/HMAC Output Feedback Data 33 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK34 - * Offset: 0x3E0 SHA/HMAC Output Feedback Data 34 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK35 - * Offset: 0x3E4 SHA/HMAC Output Feedback Data 35 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK36 - * Offset: 0x3E8 SHA/HMAC Output Feedback Data 36 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK37 - * Offset: 0x3EC SHA/HMAC Output Feedback Data 37 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK38 - * Offset: 0x3F0 SHA/HMAC Output Feedback Data 38 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK39 - * Offset: 0x3F4 SHA/HMAC Output Feedback Data 39 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK40 - * Offset: 0x3F8 SHA/HMAC Output Feedback Data 40 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK41 - * Offset: 0x3FC SHA/HMAC Output Feedback Data 41 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK42 - * Offset: 0x400 SHA/HMAC Output Feedback Data 42 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK43 - * Offset: 0x404 SHA/HMAC Output Feedback Data 43 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK44 - * Offset: 0x408 SHA/HMAC Output Feedback Data 44 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK45 - * Offset: 0x40C SHA/HMAC Output Feedback Data 45 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK46 - * Offset: 0x410 SHA/HMAC Output Feedback Data 46 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK47 - * Offset: 0x414 SHA/HMAC Output Feedback Data 47 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK48 - * Offset: 0x418 SHA/HMAC Output Feedback Data 48 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK49 - * Offset: 0x41C SHA/HMAC Output Feedback Data 49 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK50 - * Offset: 0x420 SHA/HMAC Output Feedback Data 50 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK51 - * Offset: 0x424 SHA/HMAC Output Feedback Data 51 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK52 - * Offset: 0x428 SHA/HMAC Output Feedback Data 52 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK53 - * Offset: 0x42C SHA/HMAC Output Feedback Data 53 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK54 - * Offset: 0x430 SHA/HMAC Output Feedback Data 54 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK55 - * Offset: 0x434 SHA/HMAC Output Feedback Data 55 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK56 - * Offset: 0x438 SHA/HMAC Output Feedback Data 56 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK57 - * Offset: 0x43C SHA/HMAC Output Feedback Data 57 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK58 - * Offset: 0x440 SHA/HMAC Output Feedback Data 58 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK59 - * Offset: 0x444 SHA/HMAC Output Feedback Data 59 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK60 - * Offset: 0x448 SHA/HMAC Output Feedback Data 60 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK61 - * Offset: 0x44C SHA/HMAC Output Feedback Data 61 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK62 - * Offset: 0x450 SHA/HMAC Output Feedback Data 62 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK63 - * Offset: 0x454 SHA/HMAC Output Feedback Data 63 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK64 - * Offset: 0x458 SHA/HMAC Output Feedback Data 64 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK65 - * Offset: 0x45C SHA/HMAC Output Feedback Data 65 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK66 - * Offset: 0x460 SHA/HMAC Output Feedback Data 66 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK67 - * Offset: 0x464 SHA/HMAC Output Feedback Data 67 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK68 - * Offset: 0x468 SHA/HMAC Output Feedback Data 68 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK69 - * Offset: 0x46C SHA/HMAC Output Feedback Data 69 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK70 - * Offset: 0x470 SHA/HMAC Output Feedback Data 70 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK71 - * Offset: 0x474 SHA/HMAC Output Feedback Data 71 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK72 - * Offset: 0x478 SHA/HMAC Output Feedback Data 72 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK73 - * Offset: 0x47C SHA/HMAC Output Feedback Data 73 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK74 - * Offset: 0x480 SHA/HMAC Output Feedback Data 74 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK75 - * Offset: 0x484 SHA/HMAC Output Feedback Data 75 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK76 - * Offset: 0x488 SHA/HMAC Output Feedback Data 76 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK77 - * Offset: 0x48C SHA/HMAC Output Feedback Data 77 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK78 - * Offset: 0x490 SHA/HMAC Output Feedback Data 78 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK79 - * Offset: 0x494 SHA/HMAC Output Feedback Data 79 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK80 - * Offset: 0x498 SHA/HMAC Output Feedback Data 80 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK81 - * Offset: 0x49C SHA/HMAC Output Feedback Data 81 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK82 - * Offset: 0x4A0 SHA/HMAC Output Feedback Data 82 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK83 - * Offset: 0x4A4 SHA/HMAC Output Feedback Data 83 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK84 - * Offset: 0x4A8 SHA/HMAC Output Feedback Data 84 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK85 - * Offset: 0x4AC SHA/HMAC Output Feedback Data 85 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK86 - * Offset: 0x4B0 SHA/HMAC Output Feedback Data 86 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_FDBCK87 - * Offset: 0x4B4 SHA/HMAC Output Feedback Data 87 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRPT_HMAC_FDBCKx as the data inputted to CRPT_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next blocku2019s operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRPT_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRPT_T::HMAC_SHA512T - * Offset: 0x4F8 SHA/HMAC SHA512/t Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SHA512TEN |SHA512/t Engine Enable Bit - * | | |0 = Execute other function. - * | | |1 = Execute SHA512/t function if SHA3EN=0. - * | | |Note: When SHA512TEN=1, SHA/HMAC only execute SHA2-512. - * |[16:8] |TLEN |SHA512/t output digest length - * | | |The TLEN is equal to value t of SHA512/t. It also means the output digest length of SHA512 /t. - * | | |Note: TLEN < 512, and TLEN is not 384 - * @var CRPT_T::HMAC_FBADDR - * Offset: 0x4FC SHA/HMAC DMA Feedback Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FBADDR |SHA/HMAC DMA Feedback Address - * | | |In DMA cascade mode, software can update DMA feedback address register for automatically reading and writing feedback values via DMA - * | | |The FBADDR keeps the feedback address of the feedback data for the next cascade operation - * | | |Based on the feedback address, the SHA/HMAC accelerator can read the feedback data of the last cascade operation from SRAM memory space and write the feedback data of the current cascade operation to SRAM memory space - * | | |The start of feedback address should be located at word boundary - * | | |In other words, bit 1 and 0 of FBADDR are ignored. - * | | |FBADDR can be read and written. - * | | |In DMA mode, software can update the next CRPT_HMAC_FBADDR before triggering START. - * @var CRPT_T::HMAC_SHAKEDGST0 - * Offset: 0x500 SHA/HMAC SHAKE Digest Message 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST1 - * Offset: 0x504 SHA/HMAC SHAKE Digest Message 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST2 - * Offset: 0x508 SHA/HMAC SHAKE Digest Message 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST3 - * Offset: 0x50C SHA/HMAC SHAKE Digest Message 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST4 - * Offset: 0x510 SHA/HMAC SHAKE Digest Message 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST5 - * Offset: 0x514 SHA/HMAC SHAKE Digest Message 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST6 - * Offset: 0x518 SHA/HMAC SHAKE Digest Message 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST7 - * Offset: 0x51C SHA/HMAC SHAKE Digest Message 7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST8 - * Offset: 0x520 SHA/HMAC SHAKE Digest Message 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST9 - * Offset: 0x524 SHA/HMAC SHAKE Digest Message 9 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST10 - * Offset: 0x528 SHA/HMAC SHAKE Digest Message 10 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST11 - * Offset: 0x52C SHA/HMAC SHAKE Digest Message 11 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST12 - * Offset: 0x530 SHA/HMAC SHAKE Digest Message 12 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST13 - * Offset: 0x534 SHA/HMAC SHAKE Digest Message 13 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST14 - * Offset: 0x538 SHA/HMAC SHAKE Digest Message 14 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST15 - * Offset: 0x53C SHA/HMAC SHAKE Digest Message 15 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST16 - * Offset: 0x540 SHA/HMAC SHAKE Digest Message 16 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST17 - * Offset: 0x544 SHA/HMAC SHAKE Digest Message 17 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST18 - * Offset: 0x548 SHA/HMAC SHAKE Digest Message 18 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST19 - * Offset: 0x54C SHA/HMAC SHAKE Digest Message 19 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST20 - * Offset: 0x550 SHA/HMAC SHAKE Digest Message 20 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST21 - * Offset: 0x554 SHA/HMAC SHAKE Digest Message 21 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST22 - * Offset: 0x558 SHA/HMAC SHAKE Digest Message 22 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST23 - * Offset: 0x55C SHA/HMAC SHAKE Digest Message 23 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST24 - * Offset: 0x560 SHA/HMAC SHAKE Digest Message 24 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST25 - * Offset: 0x564 SHA/HMAC SHAKE Digest Message 25 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST26 - * Offset: 0x568 SHA/HMAC SHAKE Digest Message 26 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST27 - * Offset: 0x56C SHA/HMAC SHAKE Digest Message 27 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST28 - * Offset: 0x570 SHA/HMAC SHAKE Digest Message 28 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST29 - * Offset: 0x574 SHA/HMAC SHAKE Digest Message 29 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST30 - * Offset: 0x578 SHA/HMAC SHAKE Digest Message 30 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST31 - * Offset: 0x57C SHA/HMAC SHAKE Digest Message 31 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST32 - * Offset: 0x580 SHA/HMAC SHAKE Digest Message 32 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST33 - * Offset: 0x584 SHA/HMAC SHAKE Digest Message 33 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST34 - * Offset: 0x588 SHA/HMAC SHAKE Digest Message 34 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST35 - * Offset: 0x58C SHA/HMAC SHAKE Digest Message 35 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST36 - * Offset: 0x590 SHA/HMAC SHAKE Digest Message 36 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST37 - * Offset: 0x594 SHA/HMAC SHAKE Digest Message 37 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST38 - * Offset: 0x598 SHA/HMAC SHAKE Digest Message 38 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST39 - * Offset: 0x59C SHA/HMAC SHAKE Digest Message 39 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST40 - * Offset: 0x5A0 SHA/HMAC SHAKE Digest Message 40 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::HMAC_SHAKEDGST41 - * Offset: 0x5A4 SHA/HMAC SHAKE Digest Message 41 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRPT_HMAC_SHAKEDGST0 0 ~ CRPT_HMAC_ SHAKEDGST0 33. - * @var CRPT_T::ECC_CTL - * Offset: 0x800 ECC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |ECC Accelerator Start - * | | |0 = No effect. - * | | |1 = Start ECC accelerator. BUSY flag will be set. - * | | |This bit is always 0 when it is read back. - * | | |ECC accelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |ECC Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort ECC accelerator and make it into idle state. - * | | |This bit is always 0 when it is read back. - * | | |Remember to clear ECC interrupt flag after stopping ECC accelerator. - * |[3] |PFA2C |Prime Field Adder with 2 Cycles - * | | |0 = cost 1 cycle . - * | | |1 = cost 2 cycles. - * |[4] |ECDSAS |Generate S in ECDSA Signature Generation - * | | |0 = No effect. - * | | |1 = Formula for generating S. - * | | |POINTX1 = ((POINTX2 * POINTY1 + POINTY2 ) / POINTX1) % CURVEN. - * |[5] |ECDSAR |Generate R in ECDSA Signature Generation - * | | |0 = No effect. - * | | |1 = Formula for generating R. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * |[6] |DFAP |Differential Fault Attack Protection - * | | |0 = Differential fault attack protection Disabled. - * | | |1 = Differential fault attack protection Enabled. - * |[7] |DMAEN |ECC Accelerator DMA Enable Bit - * | | |0 = ECC DMA engine Disabled. - * | | |1 = ECC DMA engine Enabled. - * | | |Only when START and DMAEN are 1, ECC DMA engine will be active. - * |[8] |FSEL |Field Selection - * | | |0 = Binary Field (GF(2m )). - * | | |1 = Prime Field (GF(p)). - * |[10:9] |ECCOP |Point Operation for BF and PF - * | | |00 = Point multiplication:. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * | | |01 = Modulus operation: choose by MODOP (CRPT_ECC_CTL[12:11]). - * | | |10 = Point addition:. - * | | |(POINTX1, POINTY1) = (POINTX1, POINTY1) +. - * | | |(POINTX2, POINTY2) - * | | |11 = Point doubling:. - * | | |(POINTX1, POINTY1) = 2 * (POINTX1, POINTY1). - * | | |Besides above three input data, point operations still need the parameters of elliptic curve (CURVEA, CURVEB, CURVEN and CURVEM) as shown in Figure 6.27-11 - * |[12:11] |MODOP |Modulus Operation for PF - * | | |00 = Division:. - * | | |POINTX1 = (POINTY1 / POINTX1) % CURVEN. - * | | |01 = Multiplication:. - * | | |POINTX1 = (POINTX1 * POINTY1) % CURVEN. - * | | |10 = Addition:. - * | | |POINTX1 = (POINTX1 + POINTY1) % CURVEN. - * | | |11 = Subtraction:. - * | | |POINTX1 = (POINTX1 - POINTY1) % CURVEN. - * | | |MODOP is active only when ECCOP = 01. - * |[13] |CSEL |Curve Selection - * | | |0 = NIST suggested curve. - * | | |1 = Montgomery curve. - * |[14] |SCAP |Side-channel Attack Protection - * | | |0 = Full speed without side-channel protection. - * | | |1 = Less speed with side-channel protection. - * |[16] |LDP1 |The Control Signal of Register POINTX1 and POINTY1 for the x and Y Coordinate of the First Point - * | | |0 = The register for POINTX1 and POINTY1 is not modified by DMA or user. - * | | |1 = The register for POINTX1 and POINTY1 is modified by DMA or user. - * |[17] |LDP2 |The Control Signal of Register POINTX2 and POINTY2 for the x and Y Coordinate of the Second Point - * | | |0 = The register for POINTX2 and POINTY2 is not modified by DMA or user. - * | | |1 = The register for POINTX2 and POINTY2 is modified by DMA or user. - * |[18] |LDA |The Control Signal of Register for the Parameter CURVEA of Elliptic Curve - * | | |0 = The register for CURVEA is not modified by DMA or user. - * | | |1 = The register for CURVEA is modified by DMA or user. - * |[19] |LDB |The Control Signal of Register for the Parameter CURVEB of Elliptic Curve - * | | |0 = The register for CURVEB is not modified by DMA or user. - * | | |1 = The register for CURVEB is modified by DMA or user. - * |[20] |LDN |The Control Signal of Register for the Parameter CURVEN of Elliptic Curve - * | | |0 = The register for CURVEN is not modified by DMA or user. - * | | |1 = The register for CURVEN is modified by DMA or user. - * |[21] |LDK |The Control Signal of Register for SCALARK - * | | |0 = The register for SCALARK is not modified by DMA or user. - * | | |1 = The register for SCALARK is modified by DMA or user. - * |[31:22] |CURVEM |The key length of elliptic curve. - * @var CRPT_T::ECC_STS - * Offset: 0x804 ECC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |ECC Accelerator Busy Flag - * | | |0 = The ECC accelerator is idle or finished. - * | | |1 = The ECC accelerator is under processing and protects all registers. - * | | |Note: Remember to clear ECC interrupt flag after ECC accelerator is finished - * |[1] |DMABUSY |ECC DMA Busy Flag - * | | |0 = ECC DMA is idle or finished. - * | | |1 = ECC DMA is busy. - * |[16] |BUSERR |ECC DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and ECC accelerator. - * |[17] |KSERR |ECC Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop ECC engine. - * |[18] |DFAERR |ECC Engine Differential Fault Attack Error Flag - * | | |0 = No error. - * | | |1 = Differential Fault Attack happened in ECC engine. The results from ECC engine are wrong. - * @var CRPT_T::ECC_X1_00 - * Offset: 0x808 ECC the X-coordinate Word0 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_01 - * Offset: 0x80C ECC the X-coordinate Word1 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_02 - * Offset: 0x810 ECC the X-coordinate Word2 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_03 - * Offset: 0x814 ECC the X-coordinate Word3 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_04 - * Offset: 0x818 ECC the X-coordinate Word4 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_05 - * Offset: 0x81C ECC the X-coordinate Word5 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_06 - * Offset: 0x820 ECC the X-coordinate Word6 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_07 - * Offset: 0x824 ECC the X-coordinate Word7 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_08 - * Offset: 0x828 ECC the X-coordinate Word8 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_09 - * Offset: 0x82C ECC the X-coordinate Word9 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_10 - * Offset: 0x830 ECC the X-coordinate Word10 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_11 - * Offset: 0x834 ECC the X-coordinate Word11 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_12 - * Offset: 0x838 ECC the X-coordinate Word12 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_13 - * Offset: 0x83C ECC the X-coordinate Word13 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_14 - * Offset: 0x840 ECC the X-coordinate Word14 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_15 - * Offset: 0x844 ECC the X-coordinate Word15 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_16 - * Offset: 0x848 ECC the X-coordinate Word16 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_X1_17 - * Offset: 0x84C ECC the X-coordinate Word17 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_Y1_00 - * Offset: 0x850 ECC the Y-coordinate Word0 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_01 - * Offset: 0x854 ECC the Y-coordinate Word1 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_02 - * Offset: 0x858 ECC the Y-coordinate Word2 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_03 - * Offset: 0x85C ECC the Y-coordinate Word3 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_04 - * Offset: 0x860 ECC the Y-coordinate Word4 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_05 - * Offset: 0x864 ECC the Y-coordinate Word5 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_06 - * Offset: 0x868 ECC the Y-coordinate Word6 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_07 - * Offset: 0x86C ECC the Y-coordinate Word7 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_08 - * Offset: 0x870 ECC the Y-coordinate Word8 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_09 - * Offset: 0x874 ECC the Y-coordinate Word9 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_10 - * Offset: 0x878 ECC the Y-coordinate Word10 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_11 - * Offset: 0x87C ECC the Y-coordinate Word11 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_12 - * Offset: 0x880 ECC the Y-coordinate Word12 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_13 - * Offset: 0x884 ECC the Y-coordinate Word13 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_14 - * Offset: 0x888 ECC the Y-coordinate Word14 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_15 - * Offset: 0x88C ECC the Y-coordinate Word15 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_16 - * Offset: 0x890 ECC the Y-coordinate Word16 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_Y1_17 - * Offset: 0x894 ECC the Y-coordinate Word17 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_X2_00 - * Offset: 0x898 ECC the X-coordinate Word0 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_01 - * Offset: 0x89C ECC the X-coordinate Word1 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_02 - * Offset: 0x8A0 ECC the X-coordinate Word2 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_03 - * Offset: 0x8A4 ECC the X-coordinate Word3 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_04 - * Offset: 0x8A8 ECC the X-coordinate Word4 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_05 - * Offset: 0x8AC ECC the X-coordinate Word5 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_06 - * Offset: 0x8B0 ECC the X-coordinate Word6 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_07 - * Offset: 0x8B4 ECC the X-coordinate Word7 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_08 - * Offset: 0x8B8 ECC the X-coordinate Word8 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_09 - * Offset: 0x8BC ECC the X-coordinate Word9 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_10 - * Offset: 0x8C0 ECC the X-coordinate Word10 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_11 - * Offset: 0x8C4 ECC the X-coordinate Word11 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_12 - * Offset: 0x8C8 ECC the X-coordinate Word12 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_13 - * Offset: 0x8CC ECC the X-coordinate Word13 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_14 - * Offset: 0x8D0 ECC the X-coordinate Word14 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_15 - * Offset: 0x8D4 ECC the X-coordinate Word15 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_16 - * Offset: 0x8D8 ECC the X-coordinate Word16 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_X2_17 - * Offset: 0x8DC ECC the X-coordinate Word17 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_Y2_00 - * Offset: 0x8E0 ECC the Y-coordinate Word0 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_01 - * Offset: 0x8E4 ECC the Y-coordinate Word1 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_02 - * Offset: 0x8E8 ECC the Y-coordinate Word2 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_03 - * Offset: 0x8EC ECC the Y-coordinate Word3 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_04 - * Offset: 0x8F0 ECC the Y-coordinate Word4 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_05 - * Offset: 0x8F4 ECC the Y-coordinate Word5 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_06 - * Offset: 0x8F8 ECC the Y-coordinate Word6 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_07 - * Offset: 0x8FC ECC the Y-coordinate Word7 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_08 - * Offset: 0x900 ECC the Y-coordinate Word8 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_09 - * Offset: 0x904 ECC the Y-coordinate Word9 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_10 - * Offset: 0x908 ECC the Y-coordinate Word10 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_11 - * Offset: 0x90C ECC the Y-coordinate Word11 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_12 - * Offset: 0x910 ECC the Y-coordinate Word12 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_13 - * Offset: 0x914 ECC the Y-coordinate Word13 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_14 - * Offset: 0x918 ECC the Y-coordinate Word14 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_15 - * Offset: 0x91C ECC the Y-coordinate Word15 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_16 - * Offset: 0x920 ECC the Y-coordinate Word16 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_Y2_17 - * Offset: 0x924 ECC the Y-coordinate Word17 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_A_00 - * Offset: 0x928 ECC the Parameter CURVEA Word0 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_01 - * Offset: 0x92C ECC the Parameter CURVEA Word1 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_02 - * Offset: 0x930 ECC the Parameter CURVEA Word2 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_03 - * Offset: 0x934 ECC the Parameter CURVEA Word3 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_04 - * Offset: 0x938 ECC the Parameter CURVEA Word4 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_05 - * Offset: 0x93C ECC the Parameter CURVEA Word5 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_06 - * Offset: 0x940 ECC the Parameter CURVEA Word6 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_07 - * Offset: 0x944 ECC the Parameter CURVEA Word7 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_08 - * Offset: 0x948 ECC the Parameter CURVEA Word8 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_09 - * Offset: 0x94C ECC the Parameter CURVEA Word9 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_10 - * Offset: 0x950 ECC the Parameter CURVEA Word10 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_11 - * Offset: 0x954 ECC the Parameter CURVEA Word11 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_12 - * Offset: 0x958 ECC the Parameter CURVEA Word12 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_13 - * Offset: 0x95C ECC the Parameter CURVEA Word13 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_14 - * Offset: 0x960 ECC the Parameter CURVEA Word14 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_15 - * Offset: 0x964 ECC the Parameter CURVEA Word15 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_16 - * Offset: 0x968 ECC the Parameter CURVEA Word16 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_A_17 - * Offset: 0x96C ECC the Parameter CURVEA Word17 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_B_00 - * Offset: 0x970 ECC the Parameter CURVEB Word0 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_01 - * Offset: 0x974 ECC the Parameter CURVEB Word1 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_02 - * Offset: 0x978 ECC the Parameter CURVEB Word2 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_03 - * Offset: 0x97C ECC the Parameter CURVEB Word3 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_04 - * Offset: 0x980 ECC the Parameter CURVEB Word4 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_05 - * Offset: 0x984 ECC the Parameter CURVEB Word5 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_06 - * Offset: 0x988 ECC the Parameter CURVEB Word6 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_07 - * Offset: 0x98C ECC the Parameter CURVEB Word7 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_08 - * Offset: 0x990 ECC the Parameter CURVEB Word8 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_09 - * Offset: 0x994 ECC the Parameter CURVEB Word9 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_10 - * Offset: 0x998 ECC the Parameter CURVEB Word10 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_11 - * Offset: 0x99C ECC the Parameter CURVEB Word11 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_12 - * Offset: 0x9A0 ECC the Parameter CURVEB Word12 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_13 - * Offset: 0x9A4 ECC the Parameter CURVEB Word13 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_14 - * Offset: 0x9A8 ECC the Parameter CURVEB Word14 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_15 - * Offset: 0x9AC ECC the Parameter CURVEB Word15 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_16 - * Offset: 0x9B0 ECC the Parameter CURVEB Word16 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_B_17 - * Offset: 0x9B4 ECC the Parameter CURVEB Word17 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_N_00 - * Offset: 0x9B8 ECC the Parameter CURVEN Word0 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_01 - * Offset: 0x9BC ECC the Parameter CURVEN Word1 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_02 - * Offset: 0x9C0 ECC the Parameter CURVEN Word2 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_03 - * Offset: 0x9C4 ECC the Parameter CURVEN Word3 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_04 - * Offset: 0x9C8 ECC the Parameter CURVEN Word4 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_05 - * Offset: 0x9CC ECC the Parameter CURVEN Word5 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_06 - * Offset: 0x9D0 ECC the Parameter CURVEN Word6 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_07 - * Offset: 0x9D4 ECC the Parameter CURVEN Word7 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_08 - * Offset: 0x9D8 ECC the Parameter CURVEN Word8 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_09 - * Offset: 0x9DC ECC the Parameter CURVEN Word9 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_10 - * Offset: 0x9E0 ECC the Parameter CURVEN Word10 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_11 - * Offset: 0x9E4 ECC the Parameter CURVEN Word11 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_12 - * Offset: 0x9E8 ECC the Parameter CURVEN Word12 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_13 - * Offset: 0x9EC ECC the Parameter CURVEN Word13 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_14 - * Offset: 0x9F0 ECC the Parameter CURVEN Word14 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_15 - * Offset: 0x9F4 ECC the Parameter CURVEN Word15 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_16 - * Offset: 0x9F8 ECC the Parameter CURVEN Word16 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_N_17 - * Offset: 0x9FC ECC the Parameter CURVEN Word17 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_K_00 - * Offset: 0xA00 ECC the Scalar SCALARK Word0 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_01 - * Offset: 0xA04 ECC the Scalar SCALARK Word1 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_02 - * Offset: 0xA08 ECC the Scalar SCALARK Word2 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_03 - * Offset: 0xA0C ECC the Scalar SCALARK Word3 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_04 - * Offset: 0xA10 ECC the Scalar SCALARK Word4 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_05 - * Offset: 0xA14 ECC the Scalar SCALARK Word5 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_06 - * Offset: 0xA18 ECC the Scalar SCALARK Word6 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_07 - * Offset: 0xA1C ECC the Scalar SCALARK Word7 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_08 - * Offset: 0xA20 ECC the Scalar SCALARK Word8 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_09 - * Offset: 0xA24 ECC the Scalar SCALARK Word9 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_10 - * Offset: 0xA28 ECC the Scalar SCALARK Word10 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_11 - * Offset: 0xA2C ECC the Scalar SCALARK Word11 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_12 - * Offset: 0xA30 ECC the Scalar SCALARK Word12 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_13 - * Offset: 0xA34 ECC the Scalar SCALARK Word13 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_14 - * Offset: 0xA38 ECC the Scalar SCALARK Word14 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_15 - * Offset: 0xA3C ECC the Scalar SCALARK Word15 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_16 - * Offset: 0xA40 ECC the Scalar SCALARK Word16 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_K_17 - * Offset: 0xA44 ECC the Scalar SCALARK Word17 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_SADDR - * Offset: 0xA48 ECC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var CRPT_T::ECC_DADDR - * Offset: 0xA4C ECC DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |ECC DMA Destination Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory and ECC accelerator - * | | |The DADDR keeps the destination address of the data buffer where output data of ECC engine will be stored - * | | |Based on the destination address, the ECC accelerator can write the result data back to SRAM memory space after the ECC operation is finished - * | | |The start of destination address should be located at word boundary - * | | |That is, bit 1 and 0 of DADDR are ignored - * | | |DADDR can be read and written - * | | |In DMA mode, software must update the CRPT_ECC_DADDR before triggering START - * @var CRPT_T::ECC_STARTREG - * Offset: 0xA50 ECC Starting Address of Updated Registers - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |STARTREG |ECC Starting Address of Updated Registers - * | | |The address of the updated registers that DMA feeds the first data or parameter to ECC engine - * | | |When ECC engine is active, ECC accelerator does not allow users to modify STARTRE.G - * | | |For example, to update input data from register CRPT_ECC POINTX1 - * | | |Thus, the value of STARTREG is 0x808. - * @var CRPT_T::ECC_WORDCNT - * Offset: 0xA54 ECC DMA Word Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WORDCNT |ECC DMA Word Count - * | | |The CRPT_ECC_WORDCNT keeps the word count of source data that is for the required input data of ECC accelerator with various operations in DMA mode - * | | |Although CRPT_ECC_WORDCNT is 32-bit, the maximum of word count in ECC accelerator is 144 words - * | | |CRPT_ECC_WORDCNT can be read and written - * @var CRPT_T::RSA_CTL - * Offset: 0xB00 RSA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |RSA Accelerator Start - * | | |0 = No effect. - * | | |1 = Start RSA accelerator. BUSY flag will be set. - * | | |This bit is always 0 when it is read back. - * | | |RSA accelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |RSA Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort RSA accelerator and make it into initial state. - * | | |This bit is always 0 when it is read back. - * | | |Remember to clear RSA interrupt flag after stopping RSA accelerator. - * |[2] |CRT |CRT Enable Control - * | | |0 = CRT Disabled. - * | | |1 = CRT Enabled. - * | | |CRT is only used in decryption with key length 2048, 3072,4096 bits. - * |[3] |CRTBYP |CRT Bypass Enable Control - * | | |0 = CRT Bypass Disabled. - * | | |1 = CRT Bypass Enabled. - * | | |CRT bypass is only used in CRT decryption with the same key. - * | | |Note: If users want to decrypt repeatedly with the same key, they can execute CRT bypass mode after the first time CRT decryption (means the second time to the latest time), but they cannot set CRTBYP to 1 in non-CRT mode. - * |[5:4] |KEYLENG |The Key Length of RSA Operation - * | | |00 = 1024-bits. - * | | |01 = 2048-bits. - * | | |10 = 3072-bits. - * | | |11 = 4096-bits. - * |[8] |SCAP |Side Channel Attack Protection Enable Control - * | | |0 = Side Channel Attack Protection Disabled. - * | | |1 = Side Channel Attack Protection Enabled. - * @var CRPT_T::RSA_STS - * Offset: 0xB04 RSA Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |RSA Accelerator Busy Flag - * | | |0 = The RSA accelerator is idle or finished. - * | | |1 = The RSA accelerator is under processing and protects all registers. - * | | |Remember to clear RSA interrupt flag after RSA accelerator finished. - * |[1] |DMABUSY |RSA DMA Busy Flag - * | | |0 = RSA DMA is idle or finished. - * | | |1 = RSA DMA is busy. - * |[16] |BUSERR |RSA DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and RSA accelerator. - * |[17] |CTLERR |RSA Control Register Error Flag - * | | |0 = No error. - * | | |1 = RSA control error. RSA will not start in the unsupported situation. - * | | |Note: If users use the error combination of control, even though they donu2019t set START(CRPT_RSA_CTL[0]) to 1, CTLERR still be set to 1. - * |[18] |KSERR |RSA Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop RSA engine. - * @var CRPT_T::RSA_SADDR0 - * Offset: 0xB08 RSA DMA Source Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR0 |RSA DMA Source Address Register0 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Base of Exponentiation (M). - * @var CRPT_T::RSA_SADDR1 - * Offset: 0xB0C RSA DMA Source Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR1 |RSA DMA Source Address Register1 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Base of Modulus Operation (N). - * @var CRPT_T::RSA_SADDR2 - * Offset: 0xB10 RSA DMA Source Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR2 |RSA DMA Source Address Register2 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Exponent of Exponentiation (E). - * @var CRPT_T::RSA_SADDR3 - * Offset: 0xB14 RSA DMA Source Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR3 |RSA DMA Source Address Register3 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Factor of Modulus Operation (p). - * @var CRPT_T::RSA_SADDR4 - * Offset: 0xB18 RSA DMA Source Address Register4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR4 |RSA DMA Source Address Register4 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Factor of Modulus Operation (q). - * @var CRPT_T::RSA_DADDR - * Offset: 0xB1C RSA DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |RSA DMA Destination Address Register - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA DMA Destination Address Register (Ans). - * @var CRPT_T::RSA_MADDR0 - * Offset: 0xB20 RSA DMA Middle Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR0 |RSA DMA Middle Address Register0 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA CRT the Temporary Value (Cp -> Mp -> Sp). - * @var CRPT_T::RSA_MADDR1 - * Offset: 0xB24 RSA DMA Middle Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR1 |RSA DMA Middle Address Register1 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA CRT the Temporary Value (Cq -> Mq -> Sq). - * @var CRPT_T::RSA_MADDR2 - * Offset: 0xB28 RSA DMA Middle Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR2 |RSA DMA Middle Address Register2 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA CRT the Temporary Value (Dp). - * @var CRPT_T::RSA_MADDR3 - * Offset: 0xB2C RSA DMA Middle Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR3 |RSA DMA Middle Address Register3 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA CRT the Temporary Value (Dq). - * @var CRPT_T::RSA_MADDR4 - * Offset: 0xB30 RSA DMA Middle Address Register4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR4 |RSA DMA Middle Address Register4 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA CRT the Temporary Value (Rp). - * @var CRPT_T::RSA_MADDR5 - * Offset: 0xB34 RSA DMA Middle Address Register5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR5 |RSA DMA Middle Address Register5 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA CRT the Temporary Value (Rq). - * @var CRPT_T::RSA_MADDR6 - * Offset: 0xB38 RSA DMA Middle Address Register6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR6 |RSA DMA Middle Address Register6 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA SCA Protection the Temporary Value (Eu2019). - * @var CRPT_T::PRNG_KSCTL - * Offset: 0xF00 PRNG Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Write Key Number - * | | |The key number is sent to key store - * | | |Note: Only for destination Is OTP of key store. - * |[16] |TRUST |Write Key Trust Selection Bit - * | | |0 = Set written key as the non-secure key. - * | | |1 = Set written key as the secure key. - * |[19] |ECDH |ECDH Control Bit - * | | |0 = reserved. - * | | |1 = key is written to key store and used in ECDH. - * | | |Note: When ECDH was set to u20181u2019, 1 - * | | |PRNG seed must from TRNG and key is must written to the SRAM of key store (WSDST, CRPT_PRNG_KSCTL[23:22] must set to u201800u2019) - * | | |Otherwise, KCTLERR will become u20181u2019(CRPT_PRNG_KSSTS[16]) - * | | |2 - * | | |Key must in the interval [1, n-1] (the parameter n is from ECC) - * | | |The value of n cannot be 0 or 1, otherwise, PRNG will always keep busy. - * |[20] |ECDSA |ECDSA Control Bit - * | | |0 = reserved. - * | | |1 = key is written to key store and used in ECDSA. - * | | |Note: When ECDSA was set to u20181u2019, 1 - * | | |PRNG seed must from TRNG and key is must written to the SRAM of key store (WSDST, CRPT_PRNG_KSCTL[23:22] must set to u201800u2019) - * | | |Otherwise, KCTLERR will become u20181u2019(CRPT_PRNG_KSSTS[16]) - * | | |2 - * | | |Key must in the interval [1, n-1] (the parameter n is from ECC) - * | | |The value of n cannot be 0 or 1, otherwise, PRNG will always keep busy. - * |[21] |WDST |Write Key Destination - * | | |0 = key is written to registers CRPT_PRNG_KEYx. - * | | |1 = key is written to key store. - * |[23:22] |WSDST |Write Key Store Destination - * | | |00 = key is written to the SRAM of key store. - * | | |01 = key is written to the flash of key store. - * | | |10 = key is written to the OTP of key store. - * | | |Others = reserved. - * |[26:24] |OWNER |Write Key Owner Selection Bits - * | | |000 = Only for AES used. - * | | |001 = Only for HMAC engine used. - * | | |100 = Only for ECC engine used. - * | | |101 = Only for CPU engine use. - * | | |Others = reserved. - * @var CRPT_T::PRNG_KSSTS - * Offset: 0xF04 PRNG Key Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Key Number - * | | |The key number is generated by key store - * |[16] |KCTLERR |PRNG Key Control Register Error Flag - * | | |0 = No error. - * | | |1 = PRNG key control error - * | | |When PRNG execute ECDSA or ECDH, but PRNG seed not from TRNG or key is not written to the SRAM of key store (WSDST, CRPT_PRNG_KSCTL[23:22] is not equal to u201900u2019). - * @var CRPT_T::AES_KSCTL - * Offset: 0xF10 AES Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Source - * | | |0 = key is read from registers CRPT_AESx_KEYx. - * | | |1 = key is read from key store. - * |[7:6] |RSSRC |Read Key Store Source - * | | |00 = key is read from the SRAM of key store. - * | | |01 = key is read from the flash of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRPT_T::HMAC_KSCTL - * Offset: 0xF30 HMAC Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Source - * | | |0 = key is read from HMAC registers. - * | | |1 = key is read from key store. - * |[7:6] |RSSRC |Read Key Store Source - * | | |00 = key is read from the SRAM of key store. - * | | |01 = key is read from the flash of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRPT_T::ECC_KSCTL - * Offset: 0xF40 ECC Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUMK |Read Key Number K - * | | |The key number of CRPT_ECC_K is sent to key store when RSRCK =1. - * |[5] |RSRCK |Read Key Source for Key Number K - * | | |0 = key is read from ECC registers. - * | | |1 = key is read from key store. - * |[7:6] |RSSRCK |Read Key Store Source for Key Number K - * | | |00 = key is read from the SRAM of key store. - * | | |01 = key is read from the flash of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * |[14] |ECDH |ECDH Control Bit - * | | |0 = reserved. - * | | |1 = Set ECC operation is in ECDH - * | | |When this bit and RSRCK are equal to 0x1, ECC will read ECDH private key to CRPT_ECC_K from key store. - * |[16] |TRUST |Write Key Trust Selection Bit - * | | |0 = Set ECDH written key as the non-secure key. - * | | |1 = Set ECDH written key as the secure key. - * |[20] |XY |ECDH Output Select Bit - * | | |0 = The ECDH written key is from X-coordinate Value. - * | | |1 = The ECDH written key is from Y-coordinate Value. - * |[21] |WDST |Write Key Destination - * | | |0 = The ECDH written key is in registers CRPT_ECC_X1 and CRPT_ECC_Y. - * | | |1 = The ECDH written key is written to key store. - * |[23:22] |WSDST |Write Key Store Destination - * | | |00 = The ECDH written key is written to the SRAM of key store. - * | | |01 = The ECDH written key is written to the flash of key store. - * | | |10 = The ECDH written key is written to the OTP of key store. - * | | |Others = reserved. - * |[26:24] |OWNER |Write Key Owner Selection Bits - * | | |000 = The ECDH written key is only for AES used. - * | | |001 = The ECDH written key is only for HMAC engine used. - * | | |100 = The ECDH written key is only for ECC engine used. - * | | |101 = The ECDH written key is only for CPU engine use. - * | | |Others = reserved. - * @var CRPT_T::ECC_KSSTS - * Offset: 0xF44 ECC Key Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Key Number - * | | |The key number is generated by key store after ECDH. - * @var CRPT_T::ECC_KSXY - * Offset: 0xF48 ECC XY Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUMX |Read Key Number X - * | | |The key number of CRPT_ECC_X1 is sent to key store when RSRCXY =1. - * |[5] |RSRCXY |Read Key Source for Key Number x and Y - * | | |0 = Key is read from ECC registers. - * | | |1 = Key is read from key store. - * |[7:6] |RSSRCX |Read Key Store Source for Key Number X - * | | |00 = Key is read from the SRAM of key store. - * | | |01 = Key is read from the flash of key store. - * | | |10 = Key is read from the OTP of key store. - * | | |Others = reserved. - * |[12:8] |NUMY |Read Key Number Y - * | | |The key number of CRPT_ECC_Y1 is sent to key store when RSRCXY =1. - * |[15:14] |RSSRCY |Read Key Store Source for Key Number Y - * | | |00 = Key is read from the SRAM of key store. - * | | |01 = Key is read from the flash of key store. - * | | |10 = Key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRPT_T::RSA_KSCTL - * Offset: 0xF50 RSA Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Source - * | | |0 = Key is read from RSA engine. - * | | |1 = Key is read from key store. - * |[7:6] |RSSRC |Read Key Store Source - * | | |00 = Key is read from the SRAM of key store. - * | | |Others = Reserved. - * |[12:8] |BKNUM |Read Exponent Blind Key Number - * | | |The key number is sent to key store, and its destination always be the SRAM of key store - * | | |CPU cannot read the exponent blind key. - * | | |Note: Use this key number, only when executing SCA protection but no-CRT mode - * | | |When allocate space of key store, key owner selection bits(KS_METADATA[18:16]) should be u2018010u2019. - * @var CRPT_T::RSA_KSSTS0 - * Offset: 0xF54 RSA Key Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM0 |Key Number0 - * | | |The key number is generated by key store, RSA can get complete p by key number in key store while operating. - * | | |Note: The size of this key as half key length. - * |[12:8] |NUM1 |Key Number1 - * | | |The key number is generated by key store, RSA can get complete q by key number in Key Store while operating. - * | | |Note: The size of this key as half key length. - * |[20:16] |NUM2 |Key Number2 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value(Cp) by key number in the key store while operating. - * | | |Note: The size of this key as key length. - * |[28:24] |NUM3 |Key Number3 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value(Cq) by key number in the key store while operating. - * | | |Note: The size of this key as key length. - * @var CRPT_T::RSA_KSSTS1 - * Offset: 0xF58 RSA Key Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM4 |Key Number4 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value(Dp) by key number in key store while operating. - * | | |Note: The size of this key as half key length. - * |[12:8] |NUM5 |Key Number5 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value(Dq) by key number in key store while operating. - * | | |Note: The size of this key as half key length. - * |[20:16] |NUM6 |Key Number6 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value(Rp) by key number in key store while operating. - * | | |Note: The size of this key as key length. - * |[28:24] |NUM7 |Key Number7 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value(Rq) by key number in key store while operating. - * | | |Note: The size of this key as key length. - * @var CRPT_T::VERSION - * Offset: 0xFFC Crypto RTL Design Version Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MINOR |RTL Design Minor Version Number - * | | |Minor version number is dependent on moduleu2019s ECO version control. - * | | |0x1000:(Current Minor Version Number) - * |[23:16] |SUB |RTL Design Sub Version Number - * | | |Sub version number is correlated to moduleu2019s key feature. - * | | |0x01:(Current Sub Version Number) - * |[31:24] |MAJOR |RTL Design Major Version Number - * | | |Major version number is correlated to Product Line. - * | | |0x02:(Current Major Version Number) - */ - __IO uint32_t INTEN; /*!< [0x0000] Crypto Interrupt Enable Control Register */ - __IO uint32_t INTSTS; /*!< [0x0004] Crypto Interrupt Flag */ - __IO uint32_t PRNG_CTL; /*!< [0x0008] PRNG Control Register */ - __O uint32_t PRNG_SEED; /*!< [0x000c] Seed for PRNG */ - __I uint32_t PRNG_KEY[8]; /*!< [0x0010 - 0x002c] PRNG Generated Key0 */ - __I uint32_t PRNG_STS; /*!< [0x0030] PRNG Status Register */ - __I uint32_t RESERVE0[7]; - __I uint32_t AES_FDBCK[4]; /*!< [0x0050 - 0x005c] AES Engine Output Feedback Data After Cryptographic Operation */ - __I uint32_t RESERVE1[8]; - __IO uint32_t AES_GCM_IVCNT[2]; /*!< [0x0080 - 0x0084] AES GCM IV Byte Count Register 0 */ - __IO uint32_t AES_GCM_ACNT[2]; /*!< [0x0088 - 0x008c] AES GCM A Byte Count Register 0 */ - __IO uint32_t AES_GCM_PCNT[2]; /*!< [0x0090 - 0x0094] AES GCM P Byte Count Register 0 */ - __I uint32_t RESERVE2[2]; - __IO uint32_t AES_FBADDR; /*!< [0x00a0] AES DMA Feedback Address Register */ - __I uint32_t RESERVE3[23]; - __IO uint32_t AES_CTL; /*!< [0x0100] AES Control Register */ - __I uint32_t AES_STS; /*!< [0x0104] AES Engine Flag */ - __IO uint32_t AES_DATIN; /*!< [0x0108] AES Engine Data Input Port Register */ - __I uint32_t AES_DATOUT; /*!< [0x010c] AES Engine Data Output Port Register */ - __IO uint32_t AES_KEY[8]; /*!< [0x0110 - 0x012c] AES Key Word 0 Register */ - __IO uint32_t AES_IV[4]; /*!< [0x0130 - 0x013c] AES Initial Vector Word 0 Register */ - __IO uint32_t AES_SADDR; /*!< [0x0140] AES DMA Source Address Register */ - __IO uint32_t AES_DADDR; /*!< [0x0144] AES DMA Destination Address Register */ - __IO uint32_t AES_CNT; /*!< [0x0148] AES Byte Count Register */ - __I uint32_t RESERVE4[109]; - __IO uint32_t HMAC_CTL; /*!< [0x0300] SHA/HMAC Control Register */ - __I uint32_t HMAC_STS; /*!< [0x0304] SHA/HMAC Status Flag */ - __I uint32_t HMAC_DGST[16]; /*!< [0x0308 - 0x0344] SHA/HMAC Output Feedback Data 0 */ - __IO uint32_t HMAC_KEYCNT; /*!< [0x0348] SHA/HMAC Key Byte Count Register */ - __IO uint32_t HMAC_SADDR; /*!< [0x034c] SHA/HMAC DMA Source Address Register */ - __IO uint32_t HMAC_DMACNT; /*!< [0x0350] SHA/HMAC Byte Count Register */ - __IO uint32_t HMAC_DATIN; /*!< [0x0354] SHA/HMAC Engine Non-DMA Mode Data Input Port Register */ - __IO uint32_t HMAC_FDBCK[88]; /*!< [0x0358 - 0x04b4] SHA/HMAC Output Feedback Data 0 After SHA/HMAC Operation */ - __I uint32_t RESERVE5[16]; - __IO uint32_t HMAC_SHA512T; /*!< [0x04f8] SHA/HMAC SHA512/t Control Register */ - __IO uint32_t HMAC_FBADDR; /*!< [0x04fc] SHA/HMAC DMA Feedback Address Register */ - __I uint32_t HMAC_SHAKEDGST[42]; /*!< [0x0500 - 0x05a4] SHA/HMAC SHAKE Digest Message 0 */ - __I uint32_t RESERVE6[150]; - __IO uint32_t ECC_CTL; /*!< [0x0800] ECC Control Register */ - __I uint32_t ECC_STS; /*!< [0x0804] ECC Status Register */ - __IO uint32_t ECC_X1[18]; /*!< [0x0808 - 0x084c] ECC the X-coordinate Word0 of the First Point */ - __IO uint32_t ECC_Y1[18]; /*!< [0x0850 - 0x0894] ECC the Y-coordinate Word0 of the First Point */ - __IO uint32_t ECC_X2[18]; /*!< [0x0898 - 0x08dc] ECC the X-coordinate Word0 of the Second Point */ - __IO uint32_t ECC_Y2[18]; /*!< [0x08e0 - 0x0924] ECC the Y-coordinate Word0 of the Second Point */ - __IO uint32_t ECC_A[18]; /*!< [0x0928 - 0x096c] ECC the Parameter CURVEA Word0 of Elliptic Curve */ - __IO uint32_t ECC_B[18]; /*!< [0x0970 - 0x09b4] ECC the Parameter CURVEB Word0 of Elliptic Curve */ - __IO uint32_t ECC_N[18]; /*!< [0x09b8 - 0x09fc] ECC the Parameter CURVEN Word0 of Elliptic Curve */ - __O uint32_t ECC_K[18]; /*!< [0x0a00 - 0x0a44] ECC the Scalar SCALARK Word0 of Point Multiplication */ - __IO uint32_t ECC_SADDR; /*!< [0x0a48] ECC DMA Source Address Register */ - __IO uint32_t ECC_DADDR; /*!< [0x0a4c] ECC DMA Destination Address Register */ - __IO uint32_t ECC_STARTREG; /*!< [0x0a50] ECC Starting Address of Updated Registers */ - __IO uint32_t ECC_WORDCNT; /*!< [0x0a54] ECC DMA Word Count */ - __I uint32_t RESERVE7[42]; - __IO uint32_t RSA_CTL; /*!< [0x0b00] RSA Control Register */ - __I uint32_t RSA_STS; /*!< [0x0b04] RSA Status Register */ - __IO uint32_t RSA_SADDR[5]; /*!< [0x0b08 - 0x0b18] RSA DMA Source Address Register0 */ - __IO uint32_t RSA_DADDR; /*!< [0x0b1c] RSA DMA Destination Address Register */ - __IO uint32_t RSA_MADDR[7]; /*!< [0x0b20 - 0x0b38] RSA DMA Middle Address Register0 */ - __I uint32_t RESERVE8[241]; - __O uint32_t PRNG_KSCTL; /*!< [0x0f00] PRNG Key Control Register */ - __I uint32_t PRNG_KSSTS; /*!< [0x0f04] PRNG Key Status Register */ - __I uint32_t RESERVE9[2]; - __O uint32_t AES_KSCTL; /*!< [0x0f10] AES Key Control Register */ - __I uint32_t RESERVE10[7]; - __O uint32_t HMAC_KSCTL; /*!< [0x0f30] HMAC Key Control Register */ - __I uint32_t RESERVE11[3]; - __O uint32_t ECC_KSCTL; /*!< [0x0f40] ECC Key Control Register */ - __I uint32_t ECC_KSSTS; /*!< [0x0f44] ECC Key Status Register */ - __O uint32_t ECC_KSXY; /*!< [0x0f48] ECC XY Number Register */ - __I uint32_t RESERVE12[1]; - __O uint32_t RSA_KSCTL; /*!< [0x0f50] RSA Key Control Register */ - __IO uint32_t RSA_KSSTS[2]; /*!< [0x0f54 - 0x0f58] RSA Key Status Register 0 */ - __I uint32_t RESERVE13[40]; - __I uint32_t VERSION; /*!< [0x0ffc] Crypto RTL Design Version Register */ - -} CRPT_T; - -/** - @addtogroup CRPT_CONST CRPT Bit Field Definition - Constant Definitions for CRPT Controller -@{ */ - -#define CRPT_INTEN_AESIEN_Pos (0) /*!< CRPT_T::INTEN: AESIEN Position */ -#define CRPT_INTEN_AESIEN_Msk (0x1ul << CRPT_INTEN_AESIEN_Pos) /*!< CRPT_T::INTEN: AESIEN Mask */ - -#define CRPT_INTEN_AESEIEN_Pos (1) /*!< CRPT_T::INTEN: AESEIEN Position */ -#define CRPT_INTEN_AESEIEN_Msk (0x1ul << CRPT_INTEN_AESEIEN_Pos) /*!< CRPT_T::INTEN: AESEIEN Mask */ - -#define CRPT_INTEN_PRNGIEN_Pos (16) /*!< CRPT_T::INTEN: PRNGIEN Position */ -#define CRPT_INTEN_PRNGIEN_Msk (0x1ul << CRPT_INTEN_PRNGIEN_Pos) /*!< CRPT_T::INTEN: PRNGIEN Mask */ - -#define CRPT_INTEN_PRNGEIEN_Pos (17) /*!< CRPT_T::INTEN: PRNGEIEN Position */ -#define CRPT_INTEN_PRNGEIEN_Msk (0x1ul << CRPT_INTEN_PRNGEIEN_Pos) /*!< CRPT_T::INTEN: PRNGEIEN Mask */ - -#define CRPT_INTEN_ECCIEN_Pos (22) /*!< CRPT_T::INTEN: ECCIEN Position */ -#define CRPT_INTEN_ECCIEN_Msk (0x1ul << CRPT_INTEN_ECCIEN_Pos) /*!< CRPT_T::INTEN: ECCIEN Mask */ - -#define CRPT_INTEN_ECCEIEN_Pos (23) /*!< CRPT_T::INTEN: ECCEIEN Position */ -#define CRPT_INTEN_ECCEIEN_Msk (0x1ul << CRPT_INTEN_ECCEIEN_Pos) /*!< CRPT_T::INTEN: ECCEIEN Mask */ - -#define CRPT_INTEN_HMACIEN_Pos (24) /*!< CRPT_T::INTEN: HMACIEN Position */ -#define CRPT_INTEN_HMACIEN_Msk (0x1ul << CRPT_INTEN_HMACIEN_Pos) /*!< CRPT_T::INTEN: HMACIEN Mask */ - -#define CRPT_INTEN_HMACEIEN_Pos (25) /*!< CRPT_T::INTEN: HMACEIEN Position */ -#define CRPT_INTEN_HMACEIEN_Msk (0x1ul << CRPT_INTEN_HMACEIEN_Pos) /*!< CRPT_T::INTEN: HMACEIEN Mask */ - -#define CRPT_INTEN_RSAIEN_Pos (30) /*!< CRPT_T::INTEN: RSAIEN Position */ -#define CRPT_INTEN_RSAIEN_Msk (0x1ul << CRPT_INTEN_RSAIEN_Pos) /*!< CRPT_T::INTEN: RSAIEN Mask */ - -#define CRPT_INTEN_RSAEIEN_Pos (31) /*!< CRPT_T::INTEN: RSAEIEN Position */ -#define CRPT_INTEN_RSAEIEN_Msk (0x1ul << CRPT_INTEN_RSAEIEN_Pos) /*!< CRPT_T::INTEN: RSAEIEN Mask */ - -#define CRPT_INTSTS_AESIF_Pos (0) /*!< CRPT_T::INTSTS: AESIF Position */ -#define CRPT_INTSTS_AESIF_Msk (0x1ul << CRPT_INTSTS_AESIF_Pos) /*!< CRPT_T::INTSTS: AESIF Mask */ - -#define CRPT_INTSTS_AESEIF_Pos (1) /*!< CRPT_T::INTSTS: AESEIF Position */ -#define CRPT_INTSTS_AESEIF_Msk (0x1ul << CRPT_INTSTS_AESEIF_Pos) /*!< CRPT_T::INTSTS: AESEIF Mask */ - -#define CRPT_INTSTS_PRNGIF_Pos (16) /*!< CRPT_T::INTSTS: PRNGIF Position */ -#define CRPT_INTSTS_PRNGIF_Msk (0x1ul << CRPT_INTSTS_PRNGIF_Pos) /*!< CRPT_T::INTSTS: PRNGIF Mask */ - -#define CRPT_INTSTS_PRNGEIF_Pos (17) /*!< CRPT_T::INTSTS: PRNGEIF Position */ -#define CRPT_INTSTS_PRNGEIF_Msk (0x1ul << CRPT_INTSTS_PRNGEIF_Pos) /*!< CRPT_T::INTSTS: PRNGEIF Mask */ - -#define CRPT_INTSTS_ECCIF_Pos (22) /*!< CRPT_T::INTSTS: ECCIF Position */ -#define CRPT_INTSTS_ECCIF_Msk (0x1ul << CRPT_INTSTS_ECCIF_Pos) /*!< CRPT_T::INTSTS: ECCIF Mask */ - -#define CRPT_INTSTS_ECCEIF_Pos (23) /*!< CRPT_T::INTSTS: ECCEIF Position */ -#define CRPT_INTSTS_ECCEIF_Msk (0x1ul << CRPT_INTSTS_ECCEIF_Pos) /*!< CRPT_T::INTSTS: ECCEIF Mask */ - -#define CRPT_INTSTS_HMACIF_Pos (24) /*!< CRPT_T::INTSTS: HMACIF Position */ -#define CRPT_INTSTS_HMACIF_Msk (0x1ul << CRPT_INTSTS_HMACIF_Pos) /*!< CRPT_T::INTSTS: HMACIF Mask */ - -#define CRPT_INTSTS_HMACEIF_Pos (25) /*!< CRPT_T::INTSTS: HMACEIF Position */ -#define CRPT_INTSTS_HMACEIF_Msk (0x1ul << CRPT_INTSTS_HMACEIF_Pos) /*!< CRPT_T::INTSTS: HMACEIF Mask */ - -#define CRPT_INTSTS_RSAIF_Pos (30) /*!< CRPT_T::INTSTS: RSAIF Position */ -#define CRPT_INTSTS_RSAIF_Msk (0x1ul << CRPT_INTSTS_RSAIF_Pos) /*!< CRPT_T::INTSTS: RSAIF Mask */ - -#define CRPT_INTSTS_RSAEIF_Pos (31) /*!< CRPT_T::INTSTS: RSAEIF Position */ -#define CRPT_INTSTS_RSAEIF_Msk (0x1ul << CRPT_INTSTS_RSAEIF_Pos) /*!< CRPT_T::INTSTS: RSAEIF Mask */ - -#define CRPT_PRNG_CTL_START_Pos (0) /*!< CRPT_T::PRNG_CTL: START Position */ -#define CRPT_PRNG_CTL_START_Msk (0x1ul << CRPT_PRNG_CTL_START_Pos) /*!< CRPT_T::PRNG_CTL: START Mask */ - -#define CRPT_PRNG_CTL_SEEDRLD_Pos (1) /*!< CRPT_T::PRNG_CTL: SEEDRLD Position */ -#define CRPT_PRNG_CTL_SEEDRLD_Msk (0x1ul << CRPT_PRNG_CTL_SEEDRLD_Pos) /*!< CRPT_T::PRNG_CTL: SEEDRLD Mask */ - -#define CRPT_PRNG_CTL_KEYSZ_Pos (2) /*!< CRPT_T::PRNG_CTL: KEYSZ Position */ -#define CRPT_PRNG_CTL_KEYSZ_Msk (0xful << CRPT_PRNG_CTL_KEYSZ_Pos) /*!< CRPT_T::PRNG_CTL: KEYSZ Mask */ - -#define CRPT_PRNG_CTL_BUSY_Pos (8) /*!< CRPT_T::PRNG_CTL: BUSY Position */ -#define CRPT_PRNG_CTL_BUSY_Msk (0x1ul << CRPT_PRNG_CTL_BUSY_Pos) /*!< CRPT_T::PRNG_CTL: BUSY Mask */ - -#define CRPT_PRNG_CTL_SEEDSRC_Pos (16) /*!< CRPT_T::PRNG_CTL: SEEDSRC Position */ -#define CRPT_PRNG_CTL_SEEDSRC_Msk (0x1ul << CRPT_PRNG_CTL_SEEDSRC_Pos) /*!< CRPT_T::PRNG_CTL: SEEDSRC Mask */ - -#define CRPT_PRNG_SEED_SEED_Pos (0) /*!< CRPT_T::PRNG_SEED: SEED Position */ -#define CRPT_PRNG_SEED_SEED_Msk (0xfffffffful << CRPT_PRNG_SEED_SEED_Pos) /*!< CRPT_T::PRNG_SEED: SEED Mask */ - -#define CRPT_PRNG_KEY0_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY0: KEY Position */ -#define CRPT_PRNG_KEY0_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY0_KEY_Pos) /*!< CRPT_T::PRNG_KEY0: KEY Mask */ - -#define CRPT_PRNG_KEY1_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY1: KEY Position */ -#define CRPT_PRNG_KEY1_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY1_KEY_Pos) /*!< CRPT_T::PRNG_KEY1: KEY Mask */ - -#define CRPT_PRNG_KEY2_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY2: KEY Position */ -#define CRPT_PRNG_KEY2_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY2_KEY_Pos) /*!< CRPT_T::PRNG_KEY2: KEY Mask */ - -#define CRPT_PRNG_KEY3_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY3: KEY Position */ -#define CRPT_PRNG_KEY3_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY3_KEY_Pos) /*!< CRPT_T::PRNG_KEY3: KEY Mask */ - -#define CRPT_PRNG_KEY4_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY4: KEY Position */ -#define CRPT_PRNG_KEY4_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY4_KEY_Pos) /*!< CRPT_T::PRNG_KEY4: KEY Mask */ - -#define CRPT_PRNG_KEY5_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY5: KEY Position */ -#define CRPT_PRNG_KEY5_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY5_KEY_Pos) /*!< CRPT_T::PRNG_KEY5: KEY Mask */ - -#define CRPT_PRNG_KEY6_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY6: KEY Position */ -#define CRPT_PRNG_KEY6_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY6_KEY_Pos) /*!< CRPT_T::PRNG_KEY6: KEY Mask */ - -#define CRPT_PRNG_KEY7_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY7: KEY Position */ -#define CRPT_PRNG_KEY7_KEY_Msk (0xfffffffful << CRPT_PRNG_KEY7_KEY_Pos) /*!< CRPT_T::PRNG_KEY7: KEY Mask */ - -#define CRPT_PRNG_STS_BUSY_Pos (0) /*!< CRPT_T::PRNG_STS: BUSY Position */ -#define CRPT_PRNG_STS_BUSY_Msk (0x1ul << CRPT_PRNG_STS_BUSY_Pos) /*!< CRPT_T::PRNG_STS: BUSY Mask */ - -#define CRPT_PRNG_STS_KCTLERR_Pos (16) /*!< CRPT_T::PRNG_STS: KCTLERR Position */ -#define CRPT_PRNG_STS_KCTLERR_Msk (0x1ul << CRPT_PRNG_STS_KCTLERR_Pos) /*!< CRPT_T::PRNG_STS: KCTLERR Mask */ - -#define CRPT_PRNG_STS_KSERR_Pos (17) /*!< CRPT_T::PRNG_STS: KSERR Position */ -#define CRPT_PRNG_STS_KSERR_Msk (0x1ul << CRPT_PRNG_STS_KSERR_Pos) /*!< CRPT_T::PRNG_STS: KSERR Mask */ - -#define CRPT_AES_FDBCK0_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK0: FDBCK Position */ -#define CRPT_AES_FDBCK0_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK0_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK0: FDBCK Mask */ - -#define CRPT_AES_FDBCK1_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK1: FDBCK Position */ -#define CRPT_AES_FDBCK1_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK1_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK1: FDBCK Mask */ - -#define CRPT_AES_FDBCK2_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK2: FDBCK Position */ -#define CRPT_AES_FDBCK2_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK2_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK2: FDBCK Mask */ - -#define CRPT_AES_FDBCK3_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK3: FDBCK Position */ -#define CRPT_AES_FDBCK3_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCK3_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK3: FDBCK Mask */ - -#define CRPT_AES_GCM_IVCNT0_CNT_Pos (0) /*!< CRPT_T::AES_GCM_IVCNT0: CNT Position */ -#define CRPT_AES_GCM_IVCNT0_CNT_Msk (0xfffffffful << CRPT_AES_GCM_IVCNT0_CNT_Pos) /*!< CRPT_T::AES_GCM_IVCNT0: CNT Mask */ - -#define CRPT_AES_GCM_IVCNT1_CNT_Pos (0) /*!< CRPT_T::AES_GCM_IVCNT1: CNT Position */ -#define CRPT_AES_GCM_IVCNT1_CNT_Msk (0x1ffffffful << CRPT_AES_GCM_IVCNT1_CNT_Pos) /*!< CRPT_T::AES_GCM_IVCNT1: CNT Mask */ - -#define CRPT_AES_GCM_ACNT0_CNT_Pos (0) /*!< CRPT_T::AES_GCM_ACNT0: CNT Position */ -#define CRPT_AES_GCM_ACNT0_CNT_Msk (0xfffffffful << CRPT_AES_GCM_ACNT0_CNT_Pos) /*!< CRPT_T::AES_GCM_ACNT0: CNT Mask */ - -#define CRPT_AES_GCM_ACNT1_CNT_Pos (0) /*!< CRPT_T::AES_GCM_ACNT1: CNT Position */ -#define CRPT_AES_GCM_ACNT1_CNT_Msk (0x1ffffffful << CRPT_AES_GCM_ACNT1_CNT_Pos) /*!< CRPT_T::AES_GCM_ACNT1: CNT Mask */ - -#define CRPT_AES_GCM_PCNT0_CNT_Pos (0) /*!< CRPT_T::AES_GCM_PCNT0: CNT Position */ -#define CRPT_AES_GCM_PCNT0_CNT_Msk (0xfffffffful << CRPT_AES_GCM_PCNT0_CNT_Pos) /*!< CRPT_T::AES_GCM_PCNT0: CNT Mask */ - -#define CRPT_AES_GCM_PCNT1_CNT_Pos (0) /*!< CRPT_T::AES_GCM_PCNT1: CNT Position */ -#define CRPT_AES_GCM_PCNT1_CNT_Msk (0x1ffffffful << CRPT_AES_GCM_PCNT1_CNT_Pos) /*!< CRPT_T::AES_GCM_PCNT1: CNT Mask */ - -#define CRPT_AES_FBADDR_FBADDR_Pos (0) /*!< CRPT_T::AES_FBADDR: FBADDR Position */ -#define CRPT_AES_FBADDR_FBADDR_Msk (0xfffffffful << CRPT_AES_FBADDR_FBADDR_Pos) /*!< CRPT_T::AES_FBADDR: FBADDR Mask */ - -#define CRPT_AES_CTL_START_Pos (0) /*!< CRPT_T::AES_CTL: START Position */ -#define CRPT_AES_CTL_START_Msk (0x1ul << CRPT_AES_CTL_START_Pos) /*!< CRPT_T::AES_CTL: START Mask */ - -#define CRPT_AES_CTL_STOP_Pos (1) /*!< CRPT_T::AES_CTL: STOP Position */ -#define CRPT_AES_CTL_STOP_Msk (0x1ul << CRPT_AES_CTL_STOP_Pos) /*!< CRPT_T::AES_CTL: STOP Mask */ - -#define CRPT_AES_CTL_KEYSZ_Pos (2) /*!< CRPT_T::AES_CTL: KEYSZ Position */ -#define CRPT_AES_CTL_KEYSZ_Msk (0x3ul << CRPT_AES_CTL_KEYSZ_Pos) /*!< CRPT_T::AES_CTL: KEYSZ Mask */ - -#define CRPT_AES_CTL_DMALAST_Pos (5) /*!< CRPT_T::AES_CTL: DMALAST Position */ -#define CRPT_AES_CTL_DMALAST_Msk (0x1ul << CRPT_AES_CTL_DMALAST_Pos) /*!< CRPT_T::AES_CTL: DMALAST Mask */ - -#define CRPT_AES_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::AES_CTL: DMACSCAD Position */ -#define CRPT_AES_CTL_DMACSCAD_Msk (0x1ul << CRPT_AES_CTL_DMACSCAD_Pos) /*!< CRPT_T::AES_CTL: DMACSCAD Mask */ - -#define CRPT_AES_CTL_DMAEN_Pos (7) /*!< CRPT_T::AES_CTL: DMAEN Position */ -#define CRPT_AES_CTL_DMAEN_Msk (0x1ul << CRPT_AES_CTL_DMAEN_Pos) /*!< CRPT_T::AES_CTL: DMAEN Mask */ - -#define CRPT_AES_CTL_OPMODE_Pos (8) /*!< CRPT_T::AES_CTL: OPMODE Position */ -#define CRPT_AES_CTL_OPMODE_Msk (0xfful << CRPT_AES_CTL_OPMODE_Pos) /*!< CRPT_T::AES_CTL: OPMODE Mask */ - -#define CRPT_AES_CTL_ENCRPT_Pos (16) /*!< CRPT_T::AES_CTL: ENCRPT Position */ -#define CRPT_AES_CTL_ENCRPT_Msk (0x1ul << CRPT_AES_CTL_ENCRPT_Pos) /*!< CRPT_T::AES_CTL: ENCRPT Mask */ - -#define CRPT_AES_CTL_FBIN_Pos (20) /*!< CRPT_T::AES_CTL: FBIN Position */ -#define CRPT_AES_CTL_FBIN_Msk (0x1ul << CRPT_AES_CTL_FBIN_Pos) /*!< CRPT_T::AES_CTL: FBIN Mask */ - -#define CRPT_AES_CTL_FBOUT_Pos (21) /*!< CRPT_T::AES_CTL: FBOUT Position */ -#define CRPT_AES_CTL_FBOUT_Msk (0x1ul << CRPT_AES_CTL_FBOUT_Pos) /*!< CRPT_T::AES_CTL: FBOUT Mask */ - -#define CRPT_AES_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::AES_CTL: OUTSWAP Position */ -#define CRPT_AES_CTL_OUTSWAP_Msk (0x1ul << CRPT_AES_CTL_OUTSWAP_Pos) /*!< CRPT_T::AES_CTL: OUTSWAP Mask */ - -#define CRPT_AES_CTL_INSWAP_Pos (23) /*!< CRPT_T::AES_CTL: INSWAP Position */ -#define CRPT_AES_CTL_INSWAP_Msk (0x1ul << CRPT_AES_CTL_INSWAP_Pos) /*!< CRPT_T::AES_CTL: INSWAP Mask */ - -#define CRPT_AES_CTL_KOUTSWAP_Pos (24) /*!< CRPT_T::AES_CTL: KOUTSWAP Position */ -#define CRPT_AES_CTL_KOUTSWAP_Msk (0x1ul << CRPT_AES_CTL_KOUTSWAP_Pos) /*!< CRPT_T::AES_CTL: KOUTSWAP Mask */ - -#define CRPT_AES_CTL_KINSWAP_Pos (25) /*!< CRPT_T::AES_CTL: KINSWAP Position */ -#define CRPT_AES_CTL_KINSWAP_Msk (0x1ul << CRPT_AES_CTL_KINSWAP_Pos) /*!< CRPT_T::AES_CTL: KINSWAP Mask */ - -#define CRPT_AES_CTL_KEYUNPRT_Pos (26) /*!< CRPT_T::AES_CTL: KEYUNPRT Position */ -#define CRPT_AES_CTL_KEYUNPRT_Msk (0x1ful << CRPT_AES_CTL_KEYUNPRT_Pos) /*!< CRPT_T::AES_CTL: KEYUNPRT Mask */ - -#define CRPT_AES_CTL_KEYPRT_Pos (31) /*!< CRPT_T::AES_CTL: KEYPRT Position */ -#define CRPT_AES_CTL_KEYPRT_Msk (0x1ul << CRPT_AES_CTL_KEYPRT_Pos) /*!< CRPT_T::AES_CTL: KEYPRT Mask */ - -#define CRPT_AES_STS_BUSY_Pos (0) /*!< CRPT_T::AES_STS: BUSY Position */ -#define CRPT_AES_STS_BUSY_Msk (0x1ul << CRPT_AES_STS_BUSY_Pos) /*!< CRPT_T::AES_STS: BUSY Mask */ - -#define CRPT_AES_STS_INBUFEMPTY_Pos (8) /*!< CRPT_T::AES_STS: INBUFEMPTY Position */ -#define CRPT_AES_STS_INBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_INBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: INBUFEMPTY Mask */ - -#define CRPT_AES_STS_INBUFFULL_Pos (9) /*!< CRPT_T::AES_STS: INBUFFULL Position */ -#define CRPT_AES_STS_INBUFFULL_Msk (0x1ul << CRPT_AES_STS_INBUFFULL_Pos) /*!< CRPT_T::AES_STS: INBUFFULL Mask */ - -#define CRPT_AES_STS_INBUFERR_Pos (10) /*!< CRPT_T::AES_STS: INBUFERR Position */ -#define CRPT_AES_STS_INBUFERR_Msk (0x1ul << CRPT_AES_STS_INBUFERR_Pos) /*!< CRPT_T::AES_STS: INBUFERR Mask */ - -#define CRPT_AES_STS_CNTERR_Pos (12) /*!< CRPT_T::AES_STS: CNTERR Position */ -#define CRPT_AES_STS_CNTERR_Msk (0x1ul << CRPT_AES_STS_CNTERR_Pos) /*!< CRPT_T::AES_STS: CNTERR Mask */ - -#define CRPT_AES_STS_OUTBUFEMPTY_Pos (16) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Position */ -#define CRPT_AES_STS_OUTBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_OUTBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Mask */ - -#define CRPT_AES_STS_OUTBUFFULL_Pos (17) /*!< CRPT_T::AES_STS: OUTBUFFULL Position */ -#define CRPT_AES_STS_OUTBUFFULL_Msk (0x1ul << CRPT_AES_STS_OUTBUFFULL_Pos) /*!< CRPT_T::AES_STS: OUTBUFFULL Mask */ - -#define CRPT_AES_STS_OUTBUFERR_Pos (18) /*!< CRPT_T::AES_STS: OUTBUFERR Position */ -#define CRPT_AES_STS_OUTBUFERR_Msk (0x1ul << CRPT_AES_STS_OUTBUFERR_Pos) /*!< CRPT_T::AES_STS: OUTBUFERR Mask */ - -#define CRPT_AES_STS_BUSERR_Pos (20) /*!< CRPT_T::AES_STS: BUSERR Position */ -#define CRPT_AES_STS_BUSERR_Msk (0x1ul << CRPT_AES_STS_BUSERR_Pos) /*!< CRPT_T::AES_STS: BUSERR Mask */ - -#define CRPT_AES_STS_KSERR_Pos (21) /*!< CRPT_T::AES_STS: KSERR Position */ -#define CRPT_AES_STS_KSERR_Msk (0x1ul << CRPT_AES_STS_KSERR_Pos) /*!< CRPT_T::AES_STS: KSERR Mask */ - -#define CRPT_AES_DATIN_DATIN_Pos (0) /*!< CRPT_T::AES_DATIN: DATIN Position */ -#define CRPT_AES_DATIN_DATIN_Msk (0xfffffffful << CRPT_AES_DATIN_DATIN_Pos) /*!< CRPT_T::AES_DATIN: DATIN Mask */ - -#define CRPT_AES_DATOUT_DATOUT_Pos (0) /*!< CRPT_T::AES_DATOUT: DATOUT Position */ -#define CRPT_AES_DATOUT_DATOUT_Msk (0xfffffffful << CRPT_AES_DATOUT_DATOUT_Pos) /*!< CRPT_T::AES_DATOUT: DATOUT Mask */ - -#define CRPT_AES_KEY0_KEY_Pos (0) /*!< CRPT_T::AES_KEY0: KEY Position */ -#define CRPT_AES_KEY0_KEY_Msk (0xfffffffful << CRPT_AES_KEY0_KEY_Pos) /*!< CRPT_T::AES_KEY0: KEY Mask */ - -#define CRPT_AES_KEY1_KEY_Pos (0) /*!< CRPT_T::AES_KEY1: KEY Position */ -#define CRPT_AES_KEY1_KEY_Msk (0xfffffffful << CRPT_AES_KEY1_KEY_Pos) /*!< CRPT_T::AES_KEY1: KEY Mask */ - -#define CRPT_AES_KEY2_KEY_Pos (0) /*!< CRPT_T::AES_KEY2: KEY Position */ -#define CRPT_AES_KEY2_KEY_Msk (0xfffffffful << CRPT_AES_KEY2_KEY_Pos) /*!< CRPT_T::AES_KEY2: KEY Mask */ - -#define CRPT_AES_KEY3_KEY_Pos (0) /*!< CRPT_T::AES_KEY3: KEY Position */ -#define CRPT_AES_KEY3_KEY_Msk (0xfffffffful << CRPT_AES_KEY3_KEY_Pos) /*!< CRPT_T::AES_KEY3: KEY Mask */ - -#define CRPT_AES_KEY4_KEY_Pos (0) /*!< CRPT_T::AES_KEY4: KEY Position */ -#define CRPT_AES_KEY4_KEY_Msk (0xfffffffful << CRPT_AES_KEY4_KEY_Pos) /*!< CRPT_T::AES_KEY4: KEY Mask */ - -#define CRPT_AES_KEY5_KEY_Pos (0) /*!< CRPT_T::AES_KEY5: KEY Position */ -#define CRPT_AES_KEY5_KEY_Msk (0xfffffffful << CRPT_AES_KEY5_KEY_Pos) /*!< CRPT_T::AES_KEY5: KEY Mask */ - -#define CRPT_AES_KEY6_KEY_Pos (0) /*!< CRPT_T::AES_KEY6: KEY Position */ -#define CRPT_AES_KEY6_KEY_Msk (0xfffffffful << CRPT_AES_KEY6_KEY_Pos) /*!< CRPT_T::AES_KEY6: KEY Mask */ - -#define CRPT_AES_KEY7_KEY_Pos (0) /*!< CRPT_T::AES_KEY7: KEY Position */ -#define CRPT_AES_KEY7_KEY_Msk (0xfffffffful << CRPT_AES_KEY7_KEY_Pos) /*!< CRPT_T::AES_KEY7: KEY Mask */ - -#define CRPT_AES_IV0_IV_Pos (0) /*!< CRPT_T::AES_IV0: IV Position */ -#define CRPT_AES_IV0_IV_Msk (0xfffffffful << CRPT_AES_IV0_IV_Pos) /*!< CRPT_T::AES_IV0: IV Mask */ - -#define CRPT_AES_IV1_IV_Pos (0) /*!< CRPT_T::AES_IV1: IV Position */ -#define CRPT_AES_IV1_IV_Msk (0xfffffffful << CRPT_AES_IV1_IV_Pos) /*!< CRPT_T::AES_IV1: IV Mask */ - -#define CRPT_AES_IV2_IV_Pos (0) /*!< CRPT_T::AES_IV2: IV Position */ -#define CRPT_AES_IV2_IV_Msk (0xfffffffful << CRPT_AES_IV2_IV_Pos) /*!< CRPT_T::AES_IV2: IV Mask */ - -#define CRPT_AES_IV3_IV_Pos (0) /*!< CRPT_T::AES_IV3: IV Position */ -#define CRPT_AES_IV3_IV_Msk (0xfffffffful << CRPT_AES_IV3_IV_Pos) /*!< CRPT_T::AES_IV3: IV Mask */ - -#define CRPT_AES_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES_SADDR: SADDR Position */ -#define CRPT_AES_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES_SADDR_SADDR_Pos) /*!< CRPT_T::AES_SADDR: SADDR Mask */ - -#define CRPT_AES_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES_DADDR: DADDR Position */ -#define CRPT_AES_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES_DADDR_DADDR_Pos) /*!< CRPT_T::AES_DADDR: DADDR Mask */ - -#define CRPT_AES_CNT_CNT_Pos (0) /*!< CRPT_T::AES_CNT: CNT Position */ -#define CRPT_AES_CNT_CNT_Msk (0xfffffffful << CRPT_AES_CNT_CNT_Pos) /*!< CRPT_T::AES_CNT: CNT Mask */ - -#define CRPT_HMAC_CTL_START_Pos (0) /*!< CRPT_T::HMAC_CTL: START Position */ -#define CRPT_HMAC_CTL_START_Msk (0x1ul << CRPT_HMAC_CTL_START_Pos) /*!< CRPT_T::HMAC_CTL: START Mask */ - -#define CRPT_HMAC_CTL_STOP_Pos (1) /*!< CRPT_T::HMAC_CTL: STOP Position */ -#define CRPT_HMAC_CTL_STOP_Msk (0x1ul << CRPT_HMAC_CTL_STOP_Pos) /*!< CRPT_T::HMAC_CTL: STOP Mask */ - -#define CRPT_HMAC_CTL_DMAFIRST_Pos (4) /*!< CRPT_T::HMAC_CTL: DMAFIRST Position */ -#define CRPT_HMAC_CTL_DMAFIRST_Msk (0x1ul << CRPT_HMAC_CTL_DMAFIRST_Pos) /*!< CRPT_T::HMAC_CTL: DMAFIRST Mask */ - -#define CRPT_HMAC_CTL_DMALAST_Pos (5) /*!< CRPT_T::HMAC_CTL: DMALAST Position */ -#define CRPT_HMAC_CTL_DMALAST_Msk (0x1ul << CRPT_HMAC_CTL_DMALAST_Pos) /*!< CRPT_T::HMAC_CTL: DMALAST Mask */ - -#define CRPT_HMAC_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::HMAC_CTL: DMACSCAD Position */ -#define CRPT_HMAC_CTL_DMACSCAD_Msk (0x1ul << CRPT_HMAC_CTL_DMACSCAD_Pos) /*!< CRPT_T::HMAC_CTL: DMACSCAD Mask */ - -#define CRPT_HMAC_CTL_DMAEN_Pos (7) /*!< CRPT_T::HMAC_CTL: DMAEN Position */ -#define CRPT_HMAC_CTL_DMAEN_Msk (0x1ul << CRPT_HMAC_CTL_DMAEN_Pos) /*!< CRPT_T::HMAC_CTL: DMAEN Mask */ - -#define CRPT_HMAC_CTL_OPMODE_Pos (8) /*!< CRPT_T::HMAC_CTL: OPMODE Position */ -#define CRPT_HMAC_CTL_OPMODE_Msk (0x7ul << CRPT_HMAC_CTL_OPMODE_Pos) /*!< CRPT_T::HMAC_CTL: OPMODE Mask */ - -#define CRPT_HMAC_CTL_HMACEN_Pos (11) /*!< CRPT_T::HMAC_CTL: HMACEN Position */ -#define CRPT_HMAC_CTL_HMACEN_Msk (0x1ul << CRPT_HMAC_CTL_HMACEN_Pos) /*!< CRPT_T::HMAC_CTL: HMACEN Mask */ - -#define CRPT_HMAC_CTL_SHA3EN_Pos (12) /*!< CRPT_T::HMAC_CTL: SHA3EN Position */ -#define CRPT_HMAC_CTL_SHA3EN_Msk (0x1ul << CRPT_HMAC_CTL_SHA3EN_Pos) /*!< CRPT_T::HMAC_CTL: SHA3EN Mask */ - -#define CRPT_HMAC_CTL_FBIN_Pos (20) /*!< CRPT_T::HMAC_CTL: FBIN Position */ -#define CRPT_HMAC_CTL_FBIN_Msk (0x1ul << CRPT_HMAC_CTL_FBIN_Pos) /*!< CRPT_T::HMAC_CTL: FBIN Mask */ - -#define CRPT_HMAC_CTL_FBOUT_Pos (21) /*!< CRPT_T::HMAC_CTL: FBOUT Position */ -#define CRPT_HMAC_CTL_FBOUT_Msk (0x1ul << CRPT_HMAC_CTL_FBOUT_Pos) /*!< CRPT_T::HMAC_CTL: FBOUT Mask */ - -#define CRPT_HMAC_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::HMAC_CTL: OUTSWAP Position */ -#define CRPT_HMAC_CTL_OUTSWAP_Msk (0x1ul << CRPT_HMAC_CTL_OUTSWAP_Pos) /*!< CRPT_T::HMAC_CTL: OUTSWAP Mask */ - -#define CRPT_HMAC_CTL_INSWAP_Pos (23) /*!< CRPT_T::HMAC_CTL: INSWAP Position */ -#define CRPT_HMAC_CTL_INSWAP_Msk (0x1ul << CRPT_HMAC_CTL_INSWAP_Pos) /*!< CRPT_T::HMAC_CTL: INSWAP Mask */ - -#define CRPT_HMAC_CTL_NEXTDGST_Pos (24) /*!< CRPT_T::HMAC_CTL: NEXTDGST Position */ -#define CRPT_HMAC_CTL_NEXTDGST_Msk (0x1ul << CRPT_HMAC_CTL_NEXTDGST_Pos) /*!< CRPT_T::HMAC_CTL: NEXTDGST Mask */ - -#define CRPT_HMAC_CTL_FINISHDGST_Pos (25) /*!< CRPT_T::HMAC_CTL: FINISHDGST Position */ -#define CRPT_HMAC_CTL_FINISHDGST_Msk (0x1ul << CRPT_HMAC_CTL_FINISHDGST_Pos) /*!< CRPT_T::HMAC_CTL: FINISHDGST Mask */ - -#define CRPT_HMAC_STS_BUSY_Pos (0) /*!< CRPT_T::HMAC_STS: BUSY Position */ -#define CRPT_HMAC_STS_BUSY_Msk (0x1ul << CRPT_HMAC_STS_BUSY_Pos) /*!< CRPT_T::HMAC_STS: BUSY Mask */ - -#define CRPT_HMAC_STS_DMABUSY_Pos (1) /*!< CRPT_T::HMAC_STS: DMABUSY Position */ -#define CRPT_HMAC_STS_DMABUSY_Msk (0x1ul << CRPT_HMAC_STS_DMABUSY_Pos) /*!< CRPT_T::HMAC_STS: DMABUSY Mask */ - -#define CRPT_HMAC_STS_SHAKEBUSY_Pos (2) /*!< CRPT_T::HMAC_STS: SHAKEBUSY Position */ -#define CRPT_HMAC_STS_SHAKEBUSY_Msk (0x1ul << CRPT_HMAC_STS_SHAKEBUSY_Pos) /*!< CRPT_T::HMAC_STS: SHAKEBUSY Mask */ - -#define CRPT_HMAC_STS_DMAERR_Pos (8) /*!< CRPT_T::HMAC_STS: DMAERR Position */ -#define CRPT_HMAC_STS_DMAERR_Msk (0x1ul << CRPT_HMAC_STS_DMAERR_Pos) /*!< CRPT_T::HMAC_STS: DMAERR Mask */ - -#define CRPT_HMAC_STS_KSERR_Pos (9) /*!< CRPT_T::HMAC_STS: KSERR Position */ -#define CRPT_HMAC_STS_KSERR_Msk (0x1ul << CRPT_HMAC_STS_KSERR_Pos) /*!< CRPT_T::HMAC_STS: KSERR Mask */ - -#define CRPT_HMAC_STS_DATINREQ_Pos (16) /*!< CRPT_T::HMAC_STS: DATINREQ Position */ -#define CRPT_HMAC_STS_DATINREQ_Msk (0x1ul << CRPT_HMAC_STS_DATINREQ_Pos) /*!< CRPT_T::HMAC_STS: DATINREQ Mask */ - -#define CRPT_HMAC_DGST0_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST0: DGST Position */ -#define CRPT_HMAC_DGST0_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST0_DGST_Pos) /*!< CRPT_T::HMAC_DGST0: DGST Mask */ - -#define CRPT_HMAC_DGST1_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST1: DGST Position */ -#define CRPT_HMAC_DGST1_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST1_DGST_Pos) /*!< CRPT_T::HMAC_DGST1: DGST Mask */ - -#define CRPT_HMAC_DGST2_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST2: DGST Position */ -#define CRPT_HMAC_DGST2_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST2_DGST_Pos) /*!< CRPT_T::HMAC_DGST2: DGST Mask */ - -#define CRPT_HMAC_DGST3_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST3: DGST Position */ -#define CRPT_HMAC_DGST3_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST3_DGST_Pos) /*!< CRPT_T::HMAC_DGST3: DGST Mask */ - -#define CRPT_HMAC_DGST4_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST4: DGST Position */ -#define CRPT_HMAC_DGST4_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST4_DGST_Pos) /*!< CRPT_T::HMAC_DGST4: DGST Mask */ - -#define CRPT_HMAC_DGST5_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST5: DGST Position */ -#define CRPT_HMAC_DGST5_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST5_DGST_Pos) /*!< CRPT_T::HMAC_DGST5: DGST Mask */ - -#define CRPT_HMAC_DGST6_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST6: DGST Position */ -#define CRPT_HMAC_DGST6_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST6_DGST_Pos) /*!< CRPT_T::HMAC_DGST6: DGST Mask */ - -#define CRPT_HMAC_DGST7_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST7: DGST Position */ -#define CRPT_HMAC_DGST7_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST7_DGST_Pos) /*!< CRPT_T::HMAC_DGST7: DGST Mask */ - -#define CRPT_HMAC_DGST8_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST8: DGST Position */ -#define CRPT_HMAC_DGST8_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST8_DGST_Pos) /*!< CRPT_T::HMAC_DGST8: DGST Mask */ - -#define CRPT_HMAC_DGST9_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST9: DGST Position */ -#define CRPT_HMAC_DGST9_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST9_DGST_Pos) /*!< CRPT_T::HMAC_DGST9: DGST Mask */ - -#define CRPT_HMAC_DGST10_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST10: DGST Position */ -#define CRPT_HMAC_DGST10_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST10_DGST_Pos) /*!< CRPT_T::HMAC_DGST10: DGST Mask */ - -#define CRPT_HMAC_DGST11_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST11: DGST Position */ -#define CRPT_HMAC_DGST11_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST11_DGST_Pos) /*!< CRPT_T::HMAC_DGST11: DGST Mask */ - -#define CRPT_HMAC_DGST12_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST12: DGST Position */ -#define CRPT_HMAC_DGST12_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST12_DGST_Pos) /*!< CRPT_T::HMAC_DGST12: DGST Mask */ - -#define CRPT_HMAC_DGST13_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST13: DGST Position */ -#define CRPT_HMAC_DGST13_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST13_DGST_Pos) /*!< CRPT_T::HMAC_DGST13: DGST Mask */ - -#define CRPT_HMAC_DGST14_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST14: DGST Position */ -#define CRPT_HMAC_DGST14_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST14_DGST_Pos) /*!< CRPT_T::HMAC_DGST14: DGST Mask */ - -#define CRPT_HMAC_DGST15_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST15: DGST Position */ -#define CRPT_HMAC_DGST15_DGST_Msk (0xfffffffful << CRPT_HMAC_DGST15_DGST_Pos) /*!< CRPT_T::HMAC_DGST15: DGST Mask */ - -#define CRPT_HMAC_KEYCNT_KEYCNT_Pos (0) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Position */ -#define CRPT_HMAC_KEYCNT_KEYCNT_Msk (0xfffffffful << CRPT_HMAC_KEYCNT_KEYCNT_Pos) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Mask */ - -#define CRPT_HMAC_SADDR_SADDR_Pos (0) /*!< CRPT_T::HMAC_SADDR: SADDR Position */ -#define CRPT_HMAC_SADDR_SADDR_Msk (0xfffffffful << CRPT_HMAC_SADDR_SADDR_Pos) /*!< CRPT_T::HMAC_SADDR: SADDR Mask */ - -#define CRPT_HMAC_DMACNT_DMACNT_Pos (0) /*!< CRPT_T::HMAC_DMACNT: DMACNT Position */ -#define CRPT_HMAC_DMACNT_DMACNT_Msk (0xfffffffful << CRPT_HMAC_DMACNT_DMACNT_Pos) /*!< CRPT_T::HMAC_DMACNT: DMACNT Mask */ - -#define CRPT_HMAC_DATIN_DATIN_Pos (0) /*!< CRPT_T::HMAC_DATIN: DATIN Position */ -#define CRPT_HMAC_DATIN_DATIN_Msk (0xfffffffful << CRPT_HMAC_DATIN_DATIN_Pos) /*!< CRPT_T::HMAC_DATIN: DATIN Mask */ - -#define CRPT_HMAC_FDBCK0_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK0: FDBCK Position */ -#define CRPT_HMAC_FDBCK0_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK0_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK0: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK1_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK1: FDBCK Position */ -#define CRPT_HMAC_FDBCK1_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK1_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK1: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK2_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK2: FDBCK Position */ -#define CRPT_HMAC_FDBCK2_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK2_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK2: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK3_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK3: FDBCK Position */ -#define CRPT_HMAC_FDBCK3_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK3_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK3: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK4_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK4: FDBCK Position */ -#define CRPT_HMAC_FDBCK4_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK4_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK4: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK5_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK5: FDBCK Position */ -#define CRPT_HMAC_FDBCK5_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK5_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK5: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK6_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK6: FDBCK Position */ -#define CRPT_HMAC_FDBCK6_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK6_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK6: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK7_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK7: FDBCK Position */ -#define CRPT_HMAC_FDBCK7_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK7_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK7: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK8_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK8: FDBCK Position */ -#define CRPT_HMAC_FDBCK8_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK8_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK8: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK9_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK9: FDBCK Position */ -#define CRPT_HMAC_FDBCK9_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK9_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK9: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK10_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK10: FDBCK Position */ -#define CRPT_HMAC_FDBCK10_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK10_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK10: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK11_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK11: FDBCK Position */ -#define CRPT_HMAC_FDBCK11_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK11_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK11: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK12_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK12: FDBCK Position */ -#define CRPT_HMAC_FDBCK12_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK12_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK12: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK13_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK13: FDBCK Position */ -#define CRPT_HMAC_FDBCK13_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK13_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK13: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK14_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK14: FDBCK Position */ -#define CRPT_HMAC_FDBCK14_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK14_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK14: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK15_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK15: FDBCK Position */ -#define CRPT_HMAC_FDBCK15_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK15_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK15: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK16_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK16: FDBCK Position */ -#define CRPT_HMAC_FDBCK16_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK16_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK16: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK17_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK17: FDBCK Position */ -#define CRPT_HMAC_FDBCK17_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK17_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK17: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK18_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK18: FDBCK Position */ -#define CRPT_HMAC_FDBCK18_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK18_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK18: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK19_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK19: FDBCK Position */ -#define CRPT_HMAC_FDBCK19_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK19_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK19: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK20_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK20: FDBCK Position */ -#define CRPT_HMAC_FDBCK20_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK20_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK20: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK21_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK21: FDBCK Position */ -#define CRPT_HMAC_FDBCK21_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK21_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK21: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK22_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK22: FDBCK Position */ -#define CRPT_HMAC_FDBCK22_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK22_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK22: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK23_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK23: FDBCK Position */ -#define CRPT_HMAC_FDBCK23_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK23_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK23: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK24_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK24: FDBCK Position */ -#define CRPT_HMAC_FDBCK24_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK24_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK24: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK25_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK25: FDBCK Position */ -#define CRPT_HMAC_FDBCK25_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK25_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK25: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK26_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK26: FDBCK Position */ -#define CRPT_HMAC_FDBCK26_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK26_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK26: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK27_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK27: FDBCK Position */ -#define CRPT_HMAC_FDBCK27_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK27_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK27: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK28_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK28: FDBCK Position */ -#define CRPT_HMAC_FDBCK28_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK28_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK28: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK29_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK29: FDBCK Position */ -#define CRPT_HMAC_FDBCK29_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK29_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK29: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK30_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK30: FDBCK Position */ -#define CRPT_HMAC_FDBCK30_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK30_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK30: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK31_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK31: FDBCK Position */ -#define CRPT_HMAC_FDBCK31_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK31_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK31: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK32_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK32: FDBCK Position */ -#define CRPT_HMAC_FDBCK32_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK32_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK32: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK33_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK33: FDBCK Position */ -#define CRPT_HMAC_FDBCK33_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK33_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK33: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK34_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK34: FDBCK Position */ -#define CRPT_HMAC_FDBCK34_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK34_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK34: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK35_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK35: FDBCK Position */ -#define CRPT_HMAC_FDBCK35_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK35_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK35: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK36_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK36: FDBCK Position */ -#define CRPT_HMAC_FDBCK36_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK36_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK36: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK37_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK37: FDBCK Position */ -#define CRPT_HMAC_FDBCK37_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK37_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK37: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK38_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK38: FDBCK Position */ -#define CRPT_HMAC_FDBCK38_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK38_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK38: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK39_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK39: FDBCK Position */ -#define CRPT_HMAC_FDBCK39_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK39_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK39: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK40_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK40: FDBCK Position */ -#define CRPT_HMAC_FDBCK40_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK40_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK40: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK41_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK41: FDBCK Position */ -#define CRPT_HMAC_FDBCK41_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK41_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK41: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK42_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK42: FDBCK Position */ -#define CRPT_HMAC_FDBCK42_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK42_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK42: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK43_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK43: FDBCK Position */ -#define CRPT_HMAC_FDBCK43_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK43_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK43: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK44_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK44: FDBCK Position */ -#define CRPT_HMAC_FDBCK44_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK44_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK44: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK45_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK45: FDBCK Position */ -#define CRPT_HMAC_FDBCK45_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK45_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK45: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK46_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK46: FDBCK Position */ -#define CRPT_HMAC_FDBCK46_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK46_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK46: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK47_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK47: FDBCK Position */ -#define CRPT_HMAC_FDBCK47_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK47_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK47: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK48_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK48: FDBCK Position */ -#define CRPT_HMAC_FDBCK48_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK48_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK48: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK49_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK49: FDBCK Position */ -#define CRPT_HMAC_FDBCK49_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK49_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK49: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK50_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK50: FDBCK Position */ -#define CRPT_HMAC_FDBCK50_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK50_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK50: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK51_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK51: FDBCK Position */ -#define CRPT_HMAC_FDBCK51_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK51_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK51: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK52_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK52: FDBCK Position */ -#define CRPT_HMAC_FDBCK52_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK52_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK52: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK53_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK53: FDBCK Position */ -#define CRPT_HMAC_FDBCK53_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK53_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK53: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK54_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK54: FDBCK Position */ -#define CRPT_HMAC_FDBCK54_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK54_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK54: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK55_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK55: FDBCK Position */ -#define CRPT_HMAC_FDBCK55_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK55_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK55: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK56_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK56: FDBCK Position */ -#define CRPT_HMAC_FDBCK56_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK56_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK56: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK57_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK57: FDBCK Position */ -#define CRPT_HMAC_FDBCK57_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK57_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK57: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK58_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK58: FDBCK Position */ -#define CRPT_HMAC_FDBCK58_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK58_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK58: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK59_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK59: FDBCK Position */ -#define CRPT_HMAC_FDBCK59_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK59_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK59: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK60_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK60: FDBCK Position */ -#define CRPT_HMAC_FDBCK60_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK60_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK60: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK61_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK61: FDBCK Position */ -#define CRPT_HMAC_FDBCK61_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK61_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK61: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK62_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK62: FDBCK Position */ -#define CRPT_HMAC_FDBCK62_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK62_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK62: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK63_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK63: FDBCK Position */ -#define CRPT_HMAC_FDBCK63_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK63_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK63: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK64_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK64: FDBCK Position */ -#define CRPT_HMAC_FDBCK64_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK64_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK64: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK65_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK65: FDBCK Position */ -#define CRPT_HMAC_FDBCK65_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK65_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK65: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK66_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK66: FDBCK Position */ -#define CRPT_HMAC_FDBCK66_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK66_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK66: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK67_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK67: FDBCK Position */ -#define CRPT_HMAC_FDBCK67_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK67_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK67: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK68_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK68: FDBCK Position */ -#define CRPT_HMAC_FDBCK68_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK68_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK68: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK69_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK69: FDBCK Position */ -#define CRPT_HMAC_FDBCK69_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK69_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK69: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK70_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK70: FDBCK Position */ -#define CRPT_HMAC_FDBCK70_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK70_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK70: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK71_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK71: FDBCK Position */ -#define CRPT_HMAC_FDBCK71_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK71_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK71: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK72_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK72: FDBCK Position */ -#define CRPT_HMAC_FDBCK72_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK72_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK72: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK73_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK73: FDBCK Position */ -#define CRPT_HMAC_FDBCK73_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK73_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK73: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK74_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK74: FDBCK Position */ -#define CRPT_HMAC_FDBCK74_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK74_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK74: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK75_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK75: FDBCK Position */ -#define CRPT_HMAC_FDBCK75_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK75_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK75: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK76_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK76: FDBCK Position */ -#define CRPT_HMAC_FDBCK76_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK76_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK76: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK77_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK77: FDBCK Position */ -#define CRPT_HMAC_FDBCK77_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK77_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK77: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK78_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK78: FDBCK Position */ -#define CRPT_HMAC_FDBCK78_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK78_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK78: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK79_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK79: FDBCK Position */ -#define CRPT_HMAC_FDBCK79_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK79_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK79: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK80_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK80: FDBCK Position */ -#define CRPT_HMAC_FDBCK80_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK80_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK80: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK81_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK81: FDBCK Position */ -#define CRPT_HMAC_FDBCK81_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK81_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK81: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK82_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK82: FDBCK Position */ -#define CRPT_HMAC_FDBCK82_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK82_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK82: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK83_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK83: FDBCK Position */ -#define CRPT_HMAC_FDBCK83_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK83_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK83: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK84_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK84: FDBCK Position */ -#define CRPT_HMAC_FDBCK84_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK84_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK84: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK85_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK85: FDBCK Position */ -#define CRPT_HMAC_FDBCK85_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK85_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK85: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK86_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK86: FDBCK Position */ -#define CRPT_HMAC_FDBCK86_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK86_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK86: FDBCK Mask */ - -#define CRPT_HMAC_FDBCK87_FDBCK_Pos (0) /*!< CRPT_T::HMAC_FDBCK87: FDBCK Position */ -#define CRPT_HMAC_FDBCK87_FDBCK_Msk (0xfffffffful << CRPT_HMAC_FDBCK87_FDBCK_Pos) /*!< CRPT_T::HMAC_FDBCK87: FDBCK Mask */ - -#define CRPT_HMAC_SHA512T_SHA512TEN_Pos (0) /*!< CRPT_T::HMAC_SHA512T: SHA512TEN Position*/ -#define CRPT_HMAC_SHA512T_SHA512TEN_Msk (0x1ul << CRPT_HMAC_SHA512T_SHA512TEN_Pos) /*!< CRPT_T::HMAC_SHA512T: SHA512TEN Mask */ - -#define CRPT_HMAC_SHA512T_TLEN_Pos (8) /*!< CRPT_T::HMAC_SHA512T: TLEN Position */ -#define CRPT_HMAC_SHA512T_TLEN_Msk (0x1fful << CRPT_HMAC_SHA512T_TLEN_Pos) /*!< CRPT_T::HMAC_SHA512T: TLEN Mask */ - -#define CRPT_HMAC_FBADDR_FBADDR_Pos (0) /*!< CRPT_T::HMAC_FBADDR: FBADDR Position */ -#define CRPT_HMAC_FBADDR_FBADDR_Msk (0xfffffffful << CRPT_HMAC_FBADDR_FBADDR_Pos) /*!< CRPT_T::HMAC_FBADDR: FBADDR Mask */ - -#define CRPT_HMAC_SHAKEDGST0_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST0: DGST Position */ -#define CRPT_HMAC_SHAKEDGST0_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST0_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST0: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST1_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST1: DGST Position */ -#define CRPT_HMAC_SHAKEDGST1_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST1_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST1: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST2_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST2: DGST Position */ -#define CRPT_HMAC_SHAKEDGST2_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST2_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST2: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST3_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST3: DGST Position */ -#define CRPT_HMAC_SHAKEDGST3_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST3_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST3: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST4_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST4: DGST Position */ -#define CRPT_HMAC_SHAKEDGST4_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST4_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST4: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST5_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST5: DGST Position */ -#define CRPT_HMAC_SHAKEDGST5_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST5_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST5: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST6_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST6: DGST Position */ -#define CRPT_HMAC_SHAKEDGST6_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST6_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST6: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST7_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST7: DGST Position */ -#define CRPT_HMAC_SHAKEDGST7_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST7_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST7: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST8_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST8: DGST Position */ -#define CRPT_HMAC_SHAKEDGST8_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST8_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST8: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST9_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST9: DGST Position */ -#define CRPT_HMAC_SHAKEDGST9_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST9_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST9: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST10_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST10: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST10_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST10_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST10: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST11_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST11: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST11_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST11_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST11: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST12_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST12: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST12_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST12_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST12: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST13_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST13: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST13_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST13_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST13: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST14_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST14: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST14_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST14_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST14: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST15_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST15: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST15_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST15_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST15: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST16_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST16: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST16_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST16_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST16: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST17_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST17: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST17_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST17_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST17: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST18_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST18: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST18_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST18_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST18: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST19_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST19: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST19_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST19_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST19: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST20_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST20: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST20_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST20_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST20: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST21_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST21: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST21_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST21_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST21: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST22_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST22: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST22_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST22_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST22: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST23_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST23: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST23_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST23_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST23: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST24_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST24: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST24_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST24_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST24: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST25_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST25: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST25_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST25_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST25: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST26_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST26: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST26_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST26_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST26: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST27_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST27: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST27_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST27_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST27: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST28_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST28: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST28_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST28_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST28: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST29_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST29: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST29_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST29_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST29: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST30_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST30: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST30_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST30_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST30: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST31_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST31: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST31_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST31_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST31: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST32_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST32: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST32_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST32_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST32: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST33_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST33: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST33_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST33_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST33: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST34_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST34: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST34_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST34_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST34: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST35_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST35: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST35_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST35_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST35: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST36_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST36: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST36_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST36_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST36: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST37_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST37: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST37_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST37_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST37: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST38_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST38: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST38_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST38_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST38: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST39_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST39: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST39_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST39_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST39: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST40_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST40: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST40_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST40_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST40: DGST Mask */ - -#define CRPT_HMAC_SHAKEDGST41_DGST_Pos (0) /*!< CRPT_T::HMAC_SHAKEDGST41: DGST Position*/ -#define CRPT_HMAC_SHAKEDGST41_DGST_Msk (0xfffffffful << CRPT_HMAC_SHAKEDGST41_DGST_Pos) /*!< CRPT_T::HMAC_SHAKEDGST41: DGST Mask */ - -#define CRPT_ECC_CTL_START_Pos (0) /*!< CRPT_T::ECC_CTL: START Position */ -#define CRPT_ECC_CTL_START_Msk (0x1ul << CRPT_ECC_CTL_START_Pos) /*!< CRPT_T::ECC_CTL: START Mask */ - -#define CRPT_ECC_CTL_STOP_Pos (1) /*!< CRPT_T::ECC_CTL: STOP Position */ -#define CRPT_ECC_CTL_STOP_Msk (0x1ul << CRPT_ECC_CTL_STOP_Pos) /*!< CRPT_T::ECC_CTL: STOP Mask */ - -#define CRPT_ECC_CTL_PFA2C_Pos (3) /*!< CRPT_T::ECC_CTL: PFA2C Position */ -#define CRPT_ECC_CTL_PFA2C_Msk (0x1ul << CRPT_ECC_CTL_PFA2C_Pos) /*!< CRPT_T::ECC_CTL: PFA2C Mask */ - -#define CRPT_ECC_CTL_ECDSAS_Pos (4) /*!< CRPT_T::ECC_CTL: ECDSAS Position */ -#define CRPT_ECC_CTL_ECDSAS_Msk (0x1ul << CRPT_ECC_CTL_ECDSAS_Pos) /*!< CRPT_T::ECC_CTL: ECDSAS Mask */ - -#define CRPT_ECC_CTL_ECDSAR_Pos (5) /*!< CRPT_T::ECC_CTL: ECDSAR Position */ -#define CRPT_ECC_CTL_ECDSAR_Msk (0x1ul << CRPT_ECC_CTL_ECDSAR_Pos) /*!< CRPT_T::ECC_CTL: ECDSAR Mask */ - -#define CRPT_ECC_CTL_DFAP_Pos (6) /*!< CRPT_T::ECC_CTL: DFAP Position */ -#define CRPT_ECC_CTL_DFAP_Msk (0x1ul << CRPT_ECC_CTL_DFAP_Pos) /*!< CRPT_T::ECC_CTL: DFAP Mask */ - -#define CRPT_ECC_CTL_DMAEN_Pos (7) /*!< CRPT_T::ECC_CTL: DMAEN Position */ -#define CRPT_ECC_CTL_DMAEN_Msk (0x1ul << CRPT_ECC_CTL_DMAEN_Pos) /*!< CRPT_T::ECC_CTL: DMAEN Mask */ - -#define CRPT_ECC_CTL_FSEL_Pos (8) /*!< CRPT_T::ECC_CTL: FSEL Position */ -#define CRPT_ECC_CTL_FSEL_Msk (0x1ul << CRPT_ECC_CTL_FSEL_Pos) /*!< CRPT_T::ECC_CTL: FSEL Mask */ - -#define CRPT_ECC_CTL_ECCOP_Pos (9) /*!< CRPT_T::ECC_CTL: ECCOP Position */ -#define CRPT_ECC_CTL_ECCOP_Msk (0x3ul << CRPT_ECC_CTL_ECCOP_Pos) /*!< CRPT_T::ECC_CTL: ECCOP Mask */ - -#define CRPT_ECC_CTL_MODOP_Pos (11) /*!< CRPT_T::ECC_CTL: MODOP Position */ -#define CRPT_ECC_CTL_MODOP_Msk (0x3ul << CRPT_ECC_CTL_MODOP_Pos) /*!< CRPT_T::ECC_CTL: MODOP Mask */ - -#define CRPT_ECC_CTL_CSEL_Pos (13) /*!< CRPT_T::ECC_CTL: CSEL Position */ -#define CRPT_ECC_CTL_CSEL_Msk (0x1ul << CRPT_ECC_CTL_CSEL_Pos) /*!< CRPT_T::ECC_CTL: CSEL Mask */ - -#define CRPT_ECC_CTL_SCAP_Pos (14) /*!< CRPT_T::ECC_CTL: SCAP Position */ -#define CRPT_ECC_CTL_SCAP_Msk (0x1ul << CRPT_ECC_CTL_SCAP_Pos) /*!< CRPT_T::ECC_CTL: SCAP Mask */ - -#define CRPT_ECC_CTL_LDP1_Pos (16) /*!< CRPT_T::ECC_CTL: LDP1 Position */ -#define CRPT_ECC_CTL_LDP1_Msk (0x1ul << CRPT_ECC_CTL_LDP1_Pos) /*!< CRPT_T::ECC_CTL: LDP1 Mask */ - -#define CRPT_ECC_CTL_LDP2_Pos (17) /*!< CRPT_T::ECC_CTL: LDP2 Position */ -#define CRPT_ECC_CTL_LDP2_Msk (0x1ul << CRPT_ECC_CTL_LDP2_Pos) /*!< CRPT_T::ECC_CTL: LDP2 Mask */ - -#define CRPT_ECC_CTL_LDA_Pos (18) /*!< CRPT_T::ECC_CTL: LDA Position */ -#define CRPT_ECC_CTL_LDA_Msk (0x1ul << CRPT_ECC_CTL_LDA_Pos) /*!< CRPT_T::ECC_CTL: LDA Mask */ - -#define CRPT_ECC_CTL_LDB_Pos (19) /*!< CRPT_T::ECC_CTL: LDB Position */ -#define CRPT_ECC_CTL_LDB_Msk (0x1ul << CRPT_ECC_CTL_LDB_Pos) /*!< CRPT_T::ECC_CTL: LDB Mask */ - -#define CRPT_ECC_CTL_LDN_Pos (20) /*!< CRPT_T::ECC_CTL: LDN Position */ -#define CRPT_ECC_CTL_LDN_Msk (0x1ul << CRPT_ECC_CTL_LDN_Pos) /*!< CRPT_T::ECC_CTL: LDN Mask */ - -#define CRPT_ECC_CTL_LDK_Pos (21) /*!< CRPT_T::ECC_CTL: LDK Position */ -#define CRPT_ECC_CTL_LDK_Msk (0x1ul << CRPT_ECC_CTL_LDK_Pos) /*!< CRPT_T::ECC_CTL: LDK Mask */ - -#define CRPT_ECC_CTL_CURVEM_Pos (22) /*!< CRPT_T::ECC_CTL: CURVEM Position */ -#define CRPT_ECC_CTL_CURVEM_Msk (0x3fful << CRPT_ECC_CTL_CURVEM_Pos) /*!< CRPT_T::ECC_CTL: CURVEM Mask */ - -#define CRPT_ECC_STS_BUSY_Pos (0) /*!< CRPT_T::ECC_STS: BUSY Position */ -#define CRPT_ECC_STS_BUSY_Msk (0x1ul << CRPT_ECC_STS_BUSY_Pos) /*!< CRPT_T::ECC_STS: BUSY Mask */ - -#define CRPT_ECC_STS_DMABUSY_Pos (1) /*!< CRPT_T::ECC_STS: DMABUSY Position */ -#define CRPT_ECC_STS_DMABUSY_Msk (0x1ul << CRPT_ECC_STS_DMABUSY_Pos) /*!< CRPT_T::ECC_STS: DMABUSY Mask */ - -#define CRPT_ECC_STS_BUSERR_Pos (16) /*!< CRPT_T::ECC_STS: BUSERR Position */ -#define CRPT_ECC_STS_BUSERR_Msk (0x1ul << CRPT_ECC_STS_BUSERR_Pos) /*!< CRPT_T::ECC_STS: BUSERR Mask */ - -#define CRPT_ECC_STS_KSERR_Pos (17) /*!< CRPT_T::ECC_STS: KSERR Position */ -#define CRPT_ECC_STS_KSERR_Msk (0x1ul << CRPT_ECC_STS_KSERR_Pos) /*!< CRPT_T::ECC_STS: KSERR Mask */ - -#define CRPT_ECC_STS_DFAERR_Pos (18) /*!< CRPT_T::ECC_STS: DFAERR Position */ -#define CRPT_ECC_STS_DFAERR_Msk (0x1ul << CRPT_ECC_STS_DFAERR_Pos) /*!< CRPT_T::ECC_STS: DFAERR Mask */ - -#define CRPT_ECC_X1_00_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_00: POINTX1 Position */ -#define CRPT_ECC_X1_00_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_00_POINTX1_Pos) /*!< CRPT_T::ECC_X1_00: POINTX1 Mask */ - -#define CRPT_ECC_X1_01_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_01: POINTX1 Position */ -#define CRPT_ECC_X1_01_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_01_POINTX1_Pos) /*!< CRPT_T::ECC_X1_01: POINTX1 Mask */ - -#define CRPT_ECC_X1_02_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_02: POINTX1 Position */ -#define CRPT_ECC_X1_02_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_02_POINTX1_Pos) /*!< CRPT_T::ECC_X1_02: POINTX1 Mask */ - -#define CRPT_ECC_X1_03_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_03: POINTX1 Position */ -#define CRPT_ECC_X1_03_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_03_POINTX1_Pos) /*!< CRPT_T::ECC_X1_03: POINTX1 Mask */ - -#define CRPT_ECC_X1_04_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_04: POINTX1 Position */ -#define CRPT_ECC_X1_04_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_04_POINTX1_Pos) /*!< CRPT_T::ECC_X1_04: POINTX1 Mask */ - -#define CRPT_ECC_X1_05_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_05: POINTX1 Position */ -#define CRPT_ECC_X1_05_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_05_POINTX1_Pos) /*!< CRPT_T::ECC_X1_05: POINTX1 Mask */ - -#define CRPT_ECC_X1_06_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_06: POINTX1 Position */ -#define CRPT_ECC_X1_06_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_06_POINTX1_Pos) /*!< CRPT_T::ECC_X1_06: POINTX1 Mask */ - -#define CRPT_ECC_X1_07_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_07: POINTX1 Position */ -#define CRPT_ECC_X1_07_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_07_POINTX1_Pos) /*!< CRPT_T::ECC_X1_07: POINTX1 Mask */ - -#define CRPT_ECC_X1_08_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_08: POINTX1 Position */ -#define CRPT_ECC_X1_08_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_08_POINTX1_Pos) /*!< CRPT_T::ECC_X1_08: POINTX1 Mask */ - -#define CRPT_ECC_X1_09_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_09: POINTX1 Position */ -#define CRPT_ECC_X1_09_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_09_POINTX1_Pos) /*!< CRPT_T::ECC_X1_09: POINTX1 Mask */ - -#define CRPT_ECC_X1_10_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_10: POINTX1 Position */ -#define CRPT_ECC_X1_10_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_10_POINTX1_Pos) /*!< CRPT_T::ECC_X1_10: POINTX1 Mask */ - -#define CRPT_ECC_X1_11_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_11: POINTX1 Position */ -#define CRPT_ECC_X1_11_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_11_POINTX1_Pos) /*!< CRPT_T::ECC_X1_11: POINTX1 Mask */ - -#define CRPT_ECC_X1_12_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_12: POINTX1 Position */ -#define CRPT_ECC_X1_12_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_12_POINTX1_Pos) /*!< CRPT_T::ECC_X1_12: POINTX1 Mask */ - -#define CRPT_ECC_X1_13_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_13: POINTX1 Position */ -#define CRPT_ECC_X1_13_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_13_POINTX1_Pos) /*!< CRPT_T::ECC_X1_13: POINTX1 Mask */ - -#define CRPT_ECC_X1_14_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_14: POINTX1 Position */ -#define CRPT_ECC_X1_14_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_14_POINTX1_Pos) /*!< CRPT_T::ECC_X1_14: POINTX1 Mask */ - -#define CRPT_ECC_X1_15_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_15: POINTX1 Position */ -#define CRPT_ECC_X1_15_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_15_POINTX1_Pos) /*!< CRPT_T::ECC_X1_15: POINTX1 Mask */ - -#define CRPT_ECC_X1_16_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_16: POINTX1 Position */ -#define CRPT_ECC_X1_16_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_16_POINTX1_Pos) /*!< CRPT_T::ECC_X1_16: POINTX1 Mask */ - -#define CRPT_ECC_X1_17_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1_17: POINTX1 Position */ -#define CRPT_ECC_X1_17_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_17_POINTX1_Pos) /*!< CRPT_T::ECC_X1_17: POINTX1 Mask */ - -#define CRPT_ECC_Y1_00_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_00: POINTY1 Position */ -#define CRPT_ECC_Y1_00_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_00_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_00: POINTY1 Mask */ - -#define CRPT_ECC_Y1_01_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_01: POINTY1 Position */ -#define CRPT_ECC_Y1_01_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_01_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_01: POINTY1 Mask */ - -#define CRPT_ECC_Y1_02_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_02: POINTY1 Position */ -#define CRPT_ECC_Y1_02_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_02_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_02: POINTY1 Mask */ - -#define CRPT_ECC_Y1_03_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_03: POINTY1 Position */ -#define CRPT_ECC_Y1_03_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_03_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_03: POINTY1 Mask */ - -#define CRPT_ECC_Y1_04_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_04: POINTY1 Position */ -#define CRPT_ECC_Y1_04_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_04_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_04: POINTY1 Mask */ - -#define CRPT_ECC_Y1_05_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_05: POINTY1 Position */ -#define CRPT_ECC_Y1_05_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_05_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_05: POINTY1 Mask */ - -#define CRPT_ECC_Y1_06_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_06: POINTY1 Position */ -#define CRPT_ECC_Y1_06_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_06_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_06: POINTY1 Mask */ - -#define CRPT_ECC_Y1_07_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_07: POINTY1 Position */ -#define CRPT_ECC_Y1_07_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_07_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_07: POINTY1 Mask */ - -#define CRPT_ECC_Y1_08_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_08: POINTY1 Position */ -#define CRPT_ECC_Y1_08_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_08_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_08: POINTY1 Mask */ - -#define CRPT_ECC_Y1_09_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_09: POINTY1 Position */ -#define CRPT_ECC_Y1_09_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_09_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_09: POINTY1 Mask */ - -#define CRPT_ECC_Y1_10_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_10: POINTY1 Position */ -#define CRPT_ECC_Y1_10_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_10_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_10: POINTY1 Mask */ - -#define CRPT_ECC_Y1_11_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_11: POINTY1 Position */ -#define CRPT_ECC_Y1_11_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_11_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_11: POINTY1 Mask */ - -#define CRPT_ECC_Y1_12_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_12: POINTY1 Position */ -#define CRPT_ECC_Y1_12_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_12_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_12: POINTY1 Mask */ - -#define CRPT_ECC_Y1_13_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_13: POINTY1 Position */ -#define CRPT_ECC_Y1_13_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_13_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_13: POINTY1 Mask */ - -#define CRPT_ECC_Y1_14_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_14: POINTY1 Position */ -#define CRPT_ECC_Y1_14_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_14_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_14: POINTY1 Mask */ - -#define CRPT_ECC_Y1_15_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_15: POINTY1 Position */ -#define CRPT_ECC_Y1_15_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_15_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_15: POINTY1 Mask */ - -#define CRPT_ECC_Y1_16_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_16: POINTY1 Position */ -#define CRPT_ECC_Y1_16_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_16_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_16: POINTY1 Mask */ - -#define CRPT_ECC_Y1_17_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1_17: POINTY1 Position */ -#define CRPT_ECC_Y1_17_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_17_POINTY1_Pos) /*!< CRPT_T::ECC_Y1_17: POINTY1 Mask */ - -#define CRPT_ECC_X2_00_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_00: POINTX2 Position */ -#define CRPT_ECC_X2_00_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_00_POINTX2_Pos) /*!< CRPT_T::ECC_X2_00: POINTX2 Mask */ - -#define CRPT_ECC_X2_01_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_01: POINTX2 Position */ -#define CRPT_ECC_X2_01_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_01_POINTX2_Pos) /*!< CRPT_T::ECC_X2_01: POINTX2 Mask */ - -#define CRPT_ECC_X2_02_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_02: POINTX2 Position */ -#define CRPT_ECC_X2_02_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_02_POINTX2_Pos) /*!< CRPT_T::ECC_X2_02: POINTX2 Mask */ - -#define CRPT_ECC_X2_03_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_03: POINTX2 Position */ -#define CRPT_ECC_X2_03_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_03_POINTX2_Pos) /*!< CRPT_T::ECC_X2_03: POINTX2 Mask */ - -#define CRPT_ECC_X2_04_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_04: POINTX2 Position */ -#define CRPT_ECC_X2_04_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_04_POINTX2_Pos) /*!< CRPT_T::ECC_X2_04: POINTX2 Mask */ - -#define CRPT_ECC_X2_05_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_05: POINTX2 Position */ -#define CRPT_ECC_X2_05_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_05_POINTX2_Pos) /*!< CRPT_T::ECC_X2_05: POINTX2 Mask */ - -#define CRPT_ECC_X2_06_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_06: POINTX2 Position */ -#define CRPT_ECC_X2_06_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_06_POINTX2_Pos) /*!< CRPT_T::ECC_X2_06: POINTX2 Mask */ - -#define CRPT_ECC_X2_07_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_07: POINTX2 Position */ -#define CRPT_ECC_X2_07_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_07_POINTX2_Pos) /*!< CRPT_T::ECC_X2_07: POINTX2 Mask */ - -#define CRPT_ECC_X2_08_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_08: POINTX2 Position */ -#define CRPT_ECC_X2_08_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_08_POINTX2_Pos) /*!< CRPT_T::ECC_X2_08: POINTX2 Mask */ - -#define CRPT_ECC_X2_09_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_09: POINTX2 Position */ -#define CRPT_ECC_X2_09_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_09_POINTX2_Pos) /*!< CRPT_T::ECC_X2_09: POINTX2 Mask */ - -#define CRPT_ECC_X2_10_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_10: POINTX2 Position */ -#define CRPT_ECC_X2_10_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_10_POINTX2_Pos) /*!< CRPT_T::ECC_X2_10: POINTX2 Mask */ - -#define CRPT_ECC_X2_11_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_11: POINTX2 Position */ -#define CRPT_ECC_X2_11_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_11_POINTX2_Pos) /*!< CRPT_T::ECC_X2_11: POINTX2 Mask */ - -#define CRPT_ECC_X2_12_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_12: POINTX2 Position */ -#define CRPT_ECC_X2_12_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_12_POINTX2_Pos) /*!< CRPT_T::ECC_X2_12: POINTX2 Mask */ - -#define CRPT_ECC_X2_13_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_13: POINTX2 Position */ -#define CRPT_ECC_X2_13_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_13_POINTX2_Pos) /*!< CRPT_T::ECC_X2_13: POINTX2 Mask */ - -#define CRPT_ECC_X2_14_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_14: POINTX2 Position */ -#define CRPT_ECC_X2_14_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_14_POINTX2_Pos) /*!< CRPT_T::ECC_X2_14: POINTX2 Mask */ - -#define CRPT_ECC_X2_15_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_15: POINTX2 Position */ -#define CRPT_ECC_X2_15_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_15_POINTX2_Pos) /*!< CRPT_T::ECC_X2_15: POINTX2 Mask */ - -#define CRPT_ECC_X2_16_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_16: POINTX2 Position */ -#define CRPT_ECC_X2_16_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_16_POINTX2_Pos) /*!< CRPT_T::ECC_X2_16: POINTX2 Mask */ - -#define CRPT_ECC_X2_17_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2_17: POINTX2 Position */ -#define CRPT_ECC_X2_17_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_17_POINTX2_Pos) /*!< CRPT_T::ECC_X2_17: POINTX2 Mask */ - -#define CRPT_ECC_Y2_00_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_00: POINTY2 Position */ -#define CRPT_ECC_Y2_00_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_00_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_00: POINTY2 Mask */ - -#define CRPT_ECC_Y2_01_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_01: POINTY2 Position */ -#define CRPT_ECC_Y2_01_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_01_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_01: POINTY2 Mask */ - -#define CRPT_ECC_Y2_02_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_02: POINTY2 Position */ -#define CRPT_ECC_Y2_02_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_02_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_02: POINTY2 Mask */ - -#define CRPT_ECC_Y2_03_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_03: POINTY2 Position */ -#define CRPT_ECC_Y2_03_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_03_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_03: POINTY2 Mask */ - -#define CRPT_ECC_Y2_04_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_04: POINTY2 Position */ -#define CRPT_ECC_Y2_04_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_04_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_04: POINTY2 Mask */ - -#define CRPT_ECC_Y2_05_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_05: POINTY2 Position */ -#define CRPT_ECC_Y2_05_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_05_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_05: POINTY2 Mask */ - -#define CRPT_ECC_Y2_06_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_06: POINTY2 Position */ -#define CRPT_ECC_Y2_06_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_06_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_06: POINTY2 Mask */ - -#define CRPT_ECC_Y2_07_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_07: POINTY2 Position */ -#define CRPT_ECC_Y2_07_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_07_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_07: POINTY2 Mask */ - -#define CRPT_ECC_Y2_08_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_08: POINTY2 Position */ -#define CRPT_ECC_Y2_08_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_08_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_08: POINTY2 Mask */ - -#define CRPT_ECC_Y2_09_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_09: POINTY2 Position */ -#define CRPT_ECC_Y2_09_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_09_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_09: POINTY2 Mask */ - -#define CRPT_ECC_Y2_10_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_10: POINTY2 Position */ -#define CRPT_ECC_Y2_10_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_10_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_10: POINTY2 Mask */ - -#define CRPT_ECC_Y2_11_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_11: POINTY2 Position */ -#define CRPT_ECC_Y2_11_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_11_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_11: POINTY2 Mask */ - -#define CRPT_ECC_Y2_12_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_12: POINTY2 Position */ -#define CRPT_ECC_Y2_12_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_12_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_12: POINTY2 Mask */ - -#define CRPT_ECC_Y2_13_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_13: POINTY2 Position */ -#define CRPT_ECC_Y2_13_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_13_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_13: POINTY2 Mask */ - -#define CRPT_ECC_Y2_14_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_14: POINTY2 Position */ -#define CRPT_ECC_Y2_14_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_14_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_14: POINTY2 Mask */ - -#define CRPT_ECC_Y2_15_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_15: POINTY2 Position */ -#define CRPT_ECC_Y2_15_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_15_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_15: POINTY2 Mask */ - -#define CRPT_ECC_Y2_16_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_16: POINTY2 Position */ -#define CRPT_ECC_Y2_16_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_16_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_16: POINTY2 Mask */ - -#define CRPT_ECC_Y2_17_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2_17: POINTY2 Position */ -#define CRPT_ECC_Y2_17_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_17_POINTY2_Pos) /*!< CRPT_T::ECC_Y2_17: POINTY2 Mask */ - -#define CRPT_ECC_A_00_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_00: CURVEA Position */ -#define CRPT_ECC_A_00_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_00_CURVEA_Pos) /*!< CRPT_T::ECC_A_00: CURVEA Mask */ - -#define CRPT_ECC_A_01_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_01: CURVEA Position */ -#define CRPT_ECC_A_01_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_01_CURVEA_Pos) /*!< CRPT_T::ECC_A_01: CURVEA Mask */ - -#define CRPT_ECC_A_02_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_02: CURVEA Position */ -#define CRPT_ECC_A_02_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_02_CURVEA_Pos) /*!< CRPT_T::ECC_A_02: CURVEA Mask */ - -#define CRPT_ECC_A_03_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_03: CURVEA Position */ -#define CRPT_ECC_A_03_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_03_CURVEA_Pos) /*!< CRPT_T::ECC_A_03: CURVEA Mask */ - -#define CRPT_ECC_A_04_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_04: CURVEA Position */ -#define CRPT_ECC_A_04_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_04_CURVEA_Pos) /*!< CRPT_T::ECC_A_04: CURVEA Mask */ - -#define CRPT_ECC_A_05_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_05: CURVEA Position */ -#define CRPT_ECC_A_05_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_05_CURVEA_Pos) /*!< CRPT_T::ECC_A_05: CURVEA Mask */ - -#define CRPT_ECC_A_06_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_06: CURVEA Position */ -#define CRPT_ECC_A_06_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_06_CURVEA_Pos) /*!< CRPT_T::ECC_A_06: CURVEA Mask */ - -#define CRPT_ECC_A_07_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_07: CURVEA Position */ -#define CRPT_ECC_A_07_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_07_CURVEA_Pos) /*!< CRPT_T::ECC_A_07: CURVEA Mask */ - -#define CRPT_ECC_A_08_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_08: CURVEA Position */ -#define CRPT_ECC_A_08_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_08_CURVEA_Pos) /*!< CRPT_T::ECC_A_08: CURVEA Mask */ - -#define CRPT_ECC_A_09_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_09: CURVEA Position */ -#define CRPT_ECC_A_09_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_09_CURVEA_Pos) /*!< CRPT_T::ECC_A_09: CURVEA Mask */ - -#define CRPT_ECC_A_10_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_10: CURVEA Position */ -#define CRPT_ECC_A_10_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_10_CURVEA_Pos) /*!< CRPT_T::ECC_A_10: CURVEA Mask */ - -#define CRPT_ECC_A_11_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_11: CURVEA Position */ -#define CRPT_ECC_A_11_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_11_CURVEA_Pos) /*!< CRPT_T::ECC_A_11: CURVEA Mask */ - -#define CRPT_ECC_A_12_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_12: CURVEA Position */ -#define CRPT_ECC_A_12_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_12_CURVEA_Pos) /*!< CRPT_T::ECC_A_12: CURVEA Mask */ - -#define CRPT_ECC_A_13_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_13: CURVEA Position */ -#define CRPT_ECC_A_13_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_13_CURVEA_Pos) /*!< CRPT_T::ECC_A_13: CURVEA Mask */ - -#define CRPT_ECC_A_14_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_14: CURVEA Position */ -#define CRPT_ECC_A_14_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_14_CURVEA_Pos) /*!< CRPT_T::ECC_A_14: CURVEA Mask */ - -#define CRPT_ECC_A_15_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_15: CURVEA Position */ -#define CRPT_ECC_A_15_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_15_CURVEA_Pos) /*!< CRPT_T::ECC_A_15: CURVEA Mask */ - -#define CRPT_ECC_A_16_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_16: CURVEA Position */ -#define CRPT_ECC_A_16_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_16_CURVEA_Pos) /*!< CRPT_T::ECC_A_16: CURVEA Mask */ - -#define CRPT_ECC_A_17_CURVEA_Pos (0) /*!< CRPT_T::ECC_A_17: CURVEA Position */ -#define CRPT_ECC_A_17_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_17_CURVEA_Pos) /*!< CRPT_T::ECC_A_17: CURVEA Mask */ - -#define CRPT_ECC_B_00_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_00: CURVEB Position */ -#define CRPT_ECC_B_00_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_00_CURVEB_Pos) /*!< CRPT_T::ECC_B_00: CURVEB Mask */ - -#define CRPT_ECC_B_01_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_01: CURVEB Position */ -#define CRPT_ECC_B_01_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_01_CURVEB_Pos) /*!< CRPT_T::ECC_B_01: CURVEB Mask */ - -#define CRPT_ECC_B_02_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_02: CURVEB Position */ -#define CRPT_ECC_B_02_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_02_CURVEB_Pos) /*!< CRPT_T::ECC_B_02: CURVEB Mask */ - -#define CRPT_ECC_B_03_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_03: CURVEB Position */ -#define CRPT_ECC_B_03_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_03_CURVEB_Pos) /*!< CRPT_T::ECC_B_03: CURVEB Mask */ - -#define CRPT_ECC_B_04_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_04: CURVEB Position */ -#define CRPT_ECC_B_04_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_04_CURVEB_Pos) /*!< CRPT_T::ECC_B_04: CURVEB Mask */ - -#define CRPT_ECC_B_05_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_05: CURVEB Position */ -#define CRPT_ECC_B_05_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_05_CURVEB_Pos) /*!< CRPT_T::ECC_B_05: CURVEB Mask */ - -#define CRPT_ECC_B_06_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_06: CURVEB Position */ -#define CRPT_ECC_B_06_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_06_CURVEB_Pos) /*!< CRPT_T::ECC_B_06: CURVEB Mask */ - -#define CRPT_ECC_B_07_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_07: CURVEB Position */ -#define CRPT_ECC_B_07_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_07_CURVEB_Pos) /*!< CRPT_T::ECC_B_07: CURVEB Mask */ - -#define CRPT_ECC_B_08_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_08: CURVEB Position */ -#define CRPT_ECC_B_08_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_08_CURVEB_Pos) /*!< CRPT_T::ECC_B_08: CURVEB Mask */ - -#define CRPT_ECC_B_09_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_09: CURVEB Position */ -#define CRPT_ECC_B_09_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_09_CURVEB_Pos) /*!< CRPT_T::ECC_B_09: CURVEB Mask */ - -#define CRPT_ECC_B_10_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_10: CURVEB Position */ -#define CRPT_ECC_B_10_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_10_CURVEB_Pos) /*!< CRPT_T::ECC_B_10: CURVEB Mask */ - -#define CRPT_ECC_B_11_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_11: CURVEB Position */ -#define CRPT_ECC_B_11_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_11_CURVEB_Pos) /*!< CRPT_T::ECC_B_11: CURVEB Mask */ - -#define CRPT_ECC_B_12_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_12: CURVEB Position */ -#define CRPT_ECC_B_12_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_12_CURVEB_Pos) /*!< CRPT_T::ECC_B_12: CURVEB Mask */ - -#define CRPT_ECC_B_13_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_13: CURVEB Position */ -#define CRPT_ECC_B_13_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_13_CURVEB_Pos) /*!< CRPT_T::ECC_B_13: CURVEB Mask */ - -#define CRPT_ECC_B_14_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_14: CURVEB Position */ -#define CRPT_ECC_B_14_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_14_CURVEB_Pos) /*!< CRPT_T::ECC_B_14: CURVEB Mask */ - -#define CRPT_ECC_B_15_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_15: CURVEB Position */ -#define CRPT_ECC_B_15_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_15_CURVEB_Pos) /*!< CRPT_T::ECC_B_15: CURVEB Mask */ - -#define CRPT_ECC_B_16_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_16: CURVEB Position */ -#define CRPT_ECC_B_16_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_16_CURVEB_Pos) /*!< CRPT_T::ECC_B_16: CURVEB Mask */ - -#define CRPT_ECC_B_17_CURVEB_Pos (0) /*!< CRPT_T::ECC_B_17: CURVEB Position */ -#define CRPT_ECC_B_17_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_17_CURVEB_Pos) /*!< CRPT_T::ECC_B_17: CURVEB Mask */ - -#define CRPT_ECC_N_00_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_00: CURVEN Position */ -#define CRPT_ECC_N_00_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_00_CURVEN_Pos) /*!< CRPT_T::ECC_N_00: CURVEN Mask */ - -#define CRPT_ECC_N_01_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_01: CURVEN Position */ -#define CRPT_ECC_N_01_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_01_CURVEN_Pos) /*!< CRPT_T::ECC_N_01: CURVEN Mask */ - -#define CRPT_ECC_N_02_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_02: CURVEN Position */ -#define CRPT_ECC_N_02_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_02_CURVEN_Pos) /*!< CRPT_T::ECC_N_02: CURVEN Mask */ - -#define CRPT_ECC_N_03_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_03: CURVEN Position */ -#define CRPT_ECC_N_03_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_03_CURVEN_Pos) /*!< CRPT_T::ECC_N_03: CURVEN Mask */ - -#define CRPT_ECC_N_04_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_04: CURVEN Position */ -#define CRPT_ECC_N_04_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_04_CURVEN_Pos) /*!< CRPT_T::ECC_N_04: CURVEN Mask */ - -#define CRPT_ECC_N_05_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_05: CURVEN Position */ -#define CRPT_ECC_N_05_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_05_CURVEN_Pos) /*!< CRPT_T::ECC_N_05: CURVEN Mask */ - -#define CRPT_ECC_N_06_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_06: CURVEN Position */ -#define CRPT_ECC_N_06_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_06_CURVEN_Pos) /*!< CRPT_T::ECC_N_06: CURVEN Mask */ - -#define CRPT_ECC_N_07_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_07: CURVEN Position */ -#define CRPT_ECC_N_07_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_07_CURVEN_Pos) /*!< CRPT_T::ECC_N_07: CURVEN Mask */ - -#define CRPT_ECC_N_08_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_08: CURVEN Position */ -#define CRPT_ECC_N_08_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_08_CURVEN_Pos) /*!< CRPT_T::ECC_N_08: CURVEN Mask */ - -#define CRPT_ECC_N_09_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_09: CURVEN Position */ -#define CRPT_ECC_N_09_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_09_CURVEN_Pos) /*!< CRPT_T::ECC_N_09: CURVEN Mask */ - -#define CRPT_ECC_N_10_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_10: CURVEN Position */ -#define CRPT_ECC_N_10_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_10_CURVEN_Pos) /*!< CRPT_T::ECC_N_10: CURVEN Mask */ - -#define CRPT_ECC_N_11_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_11: CURVEN Position */ -#define CRPT_ECC_N_11_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_11_CURVEN_Pos) /*!< CRPT_T::ECC_N_11: CURVEN Mask */ - -#define CRPT_ECC_N_12_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_12: CURVEN Position */ -#define CRPT_ECC_N_12_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_12_CURVEN_Pos) /*!< CRPT_T::ECC_N_12: CURVEN Mask */ - -#define CRPT_ECC_N_13_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_13: CURVEN Position */ -#define CRPT_ECC_N_13_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_13_CURVEN_Pos) /*!< CRPT_T::ECC_N_13: CURVEN Mask */ - -#define CRPT_ECC_N_14_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_14: CURVEN Position */ -#define CRPT_ECC_N_14_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_14_CURVEN_Pos) /*!< CRPT_T::ECC_N_14: CURVEN Mask */ - -#define CRPT_ECC_N_15_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_15: CURVEN Position */ -#define CRPT_ECC_N_15_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_15_CURVEN_Pos) /*!< CRPT_T::ECC_N_15: CURVEN Mask */ - -#define CRPT_ECC_N_16_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_16: CURVEN Position */ -#define CRPT_ECC_N_16_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_16_CURVEN_Pos) /*!< CRPT_T::ECC_N_16: CURVEN Mask */ - -#define CRPT_ECC_N_17_CURVEN_Pos (0) /*!< CRPT_T::ECC_N_17: CURVEN Position */ -#define CRPT_ECC_N_17_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_17_CURVEN_Pos) /*!< CRPT_T::ECC_N_17: CURVEN Mask */ - -#define CRPT_ECC_K_00_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_00: SCALARK Position */ -#define CRPT_ECC_K_00_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_00_SCALARK_Pos) /*!< CRPT_T::ECC_K_00: SCALARK Mask */ - -#define CRPT_ECC_K_01_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_01: SCALARK Position */ -#define CRPT_ECC_K_01_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_01_SCALARK_Pos) /*!< CRPT_T::ECC_K_01: SCALARK Mask */ - -#define CRPT_ECC_K_02_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_02: SCALARK Position */ -#define CRPT_ECC_K_02_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_02_SCALARK_Pos) /*!< CRPT_T::ECC_K_02: SCALARK Mask */ - -#define CRPT_ECC_K_03_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_03: SCALARK Position */ -#define CRPT_ECC_K_03_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_03_SCALARK_Pos) /*!< CRPT_T::ECC_K_03: SCALARK Mask */ - -#define CRPT_ECC_K_04_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_04: SCALARK Position */ -#define CRPT_ECC_K_04_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_04_SCALARK_Pos) /*!< CRPT_T::ECC_K_04: SCALARK Mask */ - -#define CRPT_ECC_K_05_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_05: SCALARK Position */ -#define CRPT_ECC_K_05_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_05_SCALARK_Pos) /*!< CRPT_T::ECC_K_05: SCALARK Mask */ - -#define CRPT_ECC_K_06_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_06: SCALARK Position */ -#define CRPT_ECC_K_06_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_06_SCALARK_Pos) /*!< CRPT_T::ECC_K_06: SCALARK Mask */ - -#define CRPT_ECC_K_07_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_07: SCALARK Position */ -#define CRPT_ECC_K_07_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_07_SCALARK_Pos) /*!< CRPT_T::ECC_K_07: SCALARK Mask */ - -#define CRPT_ECC_K_08_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_08: SCALARK Position */ -#define CRPT_ECC_K_08_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_08_SCALARK_Pos) /*!< CRPT_T::ECC_K_08: SCALARK Mask */ - -#define CRPT_ECC_K_09_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_09: SCALARK Position */ -#define CRPT_ECC_K_09_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_09_SCALARK_Pos) /*!< CRPT_T::ECC_K_09: SCALARK Mask */ - -#define CRPT_ECC_K_10_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_10: SCALARK Position */ -#define CRPT_ECC_K_10_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_10_SCALARK_Pos) /*!< CRPT_T::ECC_K_10: SCALARK Mask */ - -#define CRPT_ECC_K_11_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_11: SCALARK Position */ -#define CRPT_ECC_K_11_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_11_SCALARK_Pos) /*!< CRPT_T::ECC_K_11: SCALARK Mask */ - -#define CRPT_ECC_K_12_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_12: SCALARK Position */ -#define CRPT_ECC_K_12_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_12_SCALARK_Pos) /*!< CRPT_T::ECC_K_12: SCALARK Mask */ - -#define CRPT_ECC_K_13_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_13: SCALARK Position */ -#define CRPT_ECC_K_13_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_13_SCALARK_Pos) /*!< CRPT_T::ECC_K_13: SCALARK Mask */ - -#define CRPT_ECC_K_14_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_14: SCALARK Position */ -#define CRPT_ECC_K_14_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_14_SCALARK_Pos) /*!< CRPT_T::ECC_K_14: SCALARK Mask */ - -#define CRPT_ECC_K_15_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_15: SCALARK Position */ -#define CRPT_ECC_K_15_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_15_SCALARK_Pos) /*!< CRPT_T::ECC_K_15: SCALARK Mask */ - -#define CRPT_ECC_K_16_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_16: SCALARK Position */ -#define CRPT_ECC_K_16_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_16_SCALARK_Pos) /*!< CRPT_T::ECC_K_16: SCALARK Mask */ - -#define CRPT_ECC_K_17_SCALARK_Pos (0) /*!< CRPT_T::ECC_K_17: SCALARK Position */ -#define CRPT_ECC_K_17_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_17_SCALARK_Pos) /*!< CRPT_T::ECC_K_17: SCALARK Mask */ - -#define CRPT_ECC_DADDR_DADDR_Pos (0) /*!< CRPT_T::ECC_DADDR: DADDR Position */ -#define CRPT_ECC_DADDR_DADDR_Msk (0xfffffffful << CRPT_ECC_DADDR_DADDR_Pos) /*!< CRPT_T::ECC_DADDR: DADDR Mask */ - -#define CRPT_ECC_STARTREG_STARTREG_Pos (0) /*!< CRPT_T::ECC_STARTREG: STARTREG Position*/ -#define CRPT_ECC_STARTREG_STARTREG_Msk (0xfffffffful << CRPT_ECC_STARTREG_STARTREG_Pos) /*!< CRPT_T::ECC_STARTREG: STARTREG Mask */ - -#define CRPT_ECC_WORDCNT_WORDCNT_Pos (0) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Position */ -#define CRPT_ECC_WORDCNT_WORDCNT_Msk (0xfffffffful << CRPT_ECC_WORDCNT_WORDCNT_Pos) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Mask */ - -#define CRPT_RSA_CTL_START_Pos (0) /*!< CRPT_T::RSA_CTL: START Position */ -#define CRPT_RSA_CTL_START_Msk (0x1ul << CRPT_RSA_CTL_START_Pos) /*!< CRPT_T::RSA_CTL: START Mask */ - -#define CRPT_RSA_CTL_STOP_Pos (1) /*!< CRPT_T::RSA_CTL: STOP Position */ -#define CRPT_RSA_CTL_STOP_Msk (0x1ul << CRPT_RSA_CTL_STOP_Pos) /*!< CRPT_T::RSA_CTL: STOP Mask */ - -#define CRPT_RSA_CTL_CRT_Pos (2) /*!< CRPT_T::RSA_CTL: CRT Position */ -#define CRPT_RSA_CTL_CRT_Msk (0x1ul << CRPT_RSA_CTL_CRT_Pos) /*!< CRPT_T::RSA_CTL: CRT Mask */ - -#define CRPT_RSA_CTL_CRTBYP_Pos (3) /*!< CRPT_T::RSA_CTL: CRTBYP Position */ -#define CRPT_RSA_CTL_CRTBYP_Msk (0x1ul << CRPT_RSA_CTL_CRTBYP_Pos) /*!< CRPT_T::RSA_CTL: CRTBYP Mask */ - -#define CRPT_RSA_CTL_KEYLENG_Pos (4) /*!< CRPT_T::RSA_CTL: KEYLENG Position */ -#define CRPT_RSA_CTL_KEYLENG_Msk (0x3ul << CRPT_RSA_CTL_KEYLENG_Pos) /*!< CRPT_T::RSA_CTL: KEYLENG Mask */ - -#define CRPT_RSA_CTL_SCAP_Pos (8) /*!< CRPT_T::RSA_CTL: SCAP Position */ -#define CRPT_RSA_CTL_SCAP_Msk (0x1ul << CRPT_RSA_CTL_SCAP_Pos) /*!< CRPT_T::RSA_CTL: SCAP Mask */ - -#define CRPT_RSA_STS_BUSY_Pos (0) /*!< CRPT_T::RSA_STS: BUSY Position */ -#define CRPT_RSA_STS_BUSY_Msk (0x1ul << CRPT_RSA_STS_BUSY_Pos) /*!< CRPT_T::RSA_STS: BUSY Mask */ - -#define CRPT_RSA_STS_DMABUSY_Pos (1) /*!< CRPT_T::RSA_STS: DMABUSY Position */ -#define CRPT_RSA_STS_DMABUSY_Msk (0x1ul << CRPT_RSA_STS_DMABUSY_Pos) /*!< CRPT_T::RSA_STS: DMABUSY Mask */ - -#define CRPT_RSA_STS_BUSERR_Pos (16) /*!< CRPT_T::RSA_STS: BUSERR Position */ -#define CRPT_RSA_STS_BUSERR_Msk (0x1ul << CRPT_RSA_STS_BUSERR_Pos) /*!< CRPT_T::RSA_STS: BUSERR Mask */ - -#define CRPT_RSA_STS_CTLERR_Pos (17) /*!< CRPT_T::RSA_STS: CTLERR Position */ -#define CRPT_RSA_STS_CTLERR_Msk (0x1ul << CRPT_RSA_STS_CTLERR_Pos) /*!< CRPT_T::RSA_STS: CTLERR Mask */ - -#define CRPT_RSA_STS_KSERR_Pos (18) /*!< CRPT_T::RSA_STS: KSERR Position */ -#define CRPT_RSA_STS_KSERR_Msk (0x1ul << CRPT_RSA_STS_KSERR_Pos) /*!< CRPT_T::RSA_STS: KSERR Mask */ - -#define CRPT_RSA_SADDR0_SADDR0_Pos (0) /*!< CRPT_T::RSA_SADDR0: SADDR0 Position */ -#define CRPT_RSA_SADDR0_SADDR0_Msk (0xfffffffful << CRPT_RSA_SADDR0_SADDR0_Pos) /*!< CRPT_T::RSA_SADDR0: SADDR0 Mask */ - -#define CRPT_RSA_SADDR1_SADDR1_Pos (0) /*!< CRPT_T::RSA_SADDR1: SADDR1 Position */ -#define CRPT_RSA_SADDR1_SADDR1_Msk (0xfffffffful << CRPT_RSA_SADDR1_SADDR1_Pos) /*!< CRPT_T::RSA_SADDR1: SADDR1 Mask */ - -#define CRPT_RSA_SADDR2_SADDR2_Pos (0) /*!< CRPT_T::RSA_SADDR2: SADDR2 Position */ -#define CRPT_RSA_SADDR2_SADDR2_Msk (0xfffffffful << CRPT_RSA_SADDR2_SADDR2_Pos) /*!< CRPT_T::RSA_SADDR2: SADDR2 Mask */ - -#define CRPT_RSA_SADDR3_SADDR3_Pos (0) /*!< CRPT_T::RSA_SADDR3: SADDR3 Position */ -#define CRPT_RSA_SADDR3_SADDR3_Msk (0xfffffffful << CRPT_RSA_SADDR3_SADDR3_Pos) /*!< CRPT_T::RSA_SADDR3: SADDR3 Mask */ - -#define CRPT_RSA_SADDR4_SADDR4_Pos (0) /*!< CRPT_T::RSA_SADDR4: SADDR4 Position */ -#define CRPT_RSA_SADDR4_SADDR4_Msk (0xfffffffful << CRPT_RSA_SADDR4_SADDR4_Pos) /*!< CRPT_T::RSA_SADDR4: SADDR4 Mask */ - -#define CRPT_RSA_DADDR_DADDR_Pos (0) /*!< CRPT_T::RSA_DADDR: DADDR Position */ -#define CRPT_RSA_DADDR_DADDR_Msk (0xfffffffful << CRPT_RSA_DADDR_DADDR_Pos) /*!< CRPT_T::RSA_DADDR: DADDR Mask */ - -#define CRPT_RSA_MADDR0_MADDR0_Pos (0) /*!< CRPT_T::RSA_MADDR0: MADDR0 Position */ -#define CRPT_RSA_MADDR0_MADDR0_Msk (0xfffffffful << CRPT_RSA_MADDR0_MADDR0_Pos) /*!< CRPT_T::RSA_MADDR0: MADDR0 Mask */ - -#define CRPT_RSA_MADDR1_MADDR1_Pos (0) /*!< CRPT_T::RSA_MADDR1: MADDR1 Position */ -#define CRPT_RSA_MADDR1_MADDR1_Msk (0xfffffffful << CRPT_RSA_MADDR1_MADDR1_Pos) /*!< CRPT_T::RSA_MADDR1: MADDR1 Mask */ - -#define CRPT_RSA_MADDR2_MADDR2_Pos (0) /*!< CRPT_T::RSA_MADDR2: MADDR2 Position */ -#define CRPT_RSA_MADDR2_MADDR2_Msk (0xfffffffful << CRPT_RSA_MADDR2_MADDR2_Pos) /*!< CRPT_T::RSA_MADDR2: MADDR2 Mask */ - -#define CRPT_RSA_MADDR3_MADDR3_Pos (0) /*!< CRPT_T::RSA_MADDR3: MADDR3 Position */ -#define CRPT_RSA_MADDR3_MADDR3_Msk (0xfffffffful << CRPT_RSA_MADDR3_MADDR3_Pos) /*!< CRPT_T::RSA_MADDR3: MADDR3 Mask */ - -#define CRPT_RSA_MADDR4_MADDR4_Pos (0) /*!< CRPT_T::RSA_MADDR4: MADDR4 Position */ -#define CRPT_RSA_MADDR4_MADDR4_Msk (0xfffffffful << CRPT_RSA_MADDR4_MADDR4_Pos) /*!< CRPT_T::RSA_MADDR4: MADDR4 Mask */ - -#define CRPT_RSA_MADDR5_MADDR5_Pos (0) /*!< CRPT_T::RSA_MADDR5: MADDR5 Position */ -#define CRPT_RSA_MADDR5_MADDR5_Msk (0xfffffffful << CRPT_RSA_MADDR5_MADDR5_Pos) /*!< CRPT_T::RSA_MADDR5: MADDR5 Mask */ - -#define CRPT_RSA_MADDR6_MADDR6_Pos (0) /*!< CRPT_T::RSA_MADDR6: MADDR6 Position */ -#define CRPT_RSA_MADDR6_MADDR6_Msk (0xfffffffful << CRPT_RSA_MADDR6_MADDR6_Pos) /*!< CRPT_T::RSA_MADDR6: MADDR6 Mask */ - -#define CRPT_PRNG_KSCTL_NUM_Pos (0) /*!< CRPT_T::PRNG_KSCTL: NUM Position */ -#define CRPT_PRNG_KSCTL_NUM_Msk (0x1ful << CRPT_PRNG_KSCTL_NUM_Pos) /*!< CRPT_T::PRNG_KSCTL: NUM Mask */ - -#define CRPT_PRNG_KSCTL_TRUST_Pos (16) /*!< CRPT_T::PRNG_KSCTL: TRUST Position */ -#define CRPT_PRNG_KSCTL_TRUST_Msk (0x1ul << CRPT_PRNG_KSCTL_TRUST_Pos) /*!< CRPT_T::PRNG_KSCTL: TRUST Mask */ - -#define CRPT_PRNG_KSCTL_ECDH_Pos (19) /*!< CRPT_T::PRNG_KSCTL: ECDH Position */ -#define CRPT_PRNG_KSCTL_ECDH_Msk (0x1ul << CRPT_PRNG_KSCTL_ECDH_Pos) /*!< CRPT_T::PRNG_KSCTL: ECDH Mask */ - -#define CRPT_PRNG_KSCTL_ECDSA_Pos (20) /*!< CRPT_T::PRNG_KSCTL: ECDSA Position */ -#define CRPT_PRNG_KSCTL_ECDSA_Msk (0x1ul << CRPT_PRNG_KSCTL_ECDSA_Pos) /*!< CRPT_T::PRNG_KSCTL: ECDSA Mask */ - -#define CRPT_PRNG_KSCTL_WDST_Pos (21) /*!< CRPT_T::PRNG_KSCTL: WDST Position */ -#define CRPT_PRNG_KSCTL_WDST_Msk (0x1ul << CRPT_PRNG_KSCTL_WDST_Pos) /*!< CRPT_T::PRNG_KSCTL: WDST Mask */ - -#define CRPT_PRNG_KSCTL_WSDST_Pos (22) /*!< CRPT_T::PRNG_KSCTL: WSDST Position */ -#define CRPT_PRNG_KSCTL_WSDST_Msk (0x3ul << CRPT_PRNG_KSCTL_WSDST_Pos) /*!< CRPT_T::PRNG_KSCTL: WSDST Mask */ - -#define CRPT_PRNG_KSCTL_OWNER_Pos (24) /*!< CRPT_T::PRNG_KSCTL: OWNER Position */ -#define CRPT_PRNG_KSCTL_OWNER_Msk (0x7ul << CRPT_PRNG_KSCTL_OWNER_Pos) /*!< CRPT_T::PRNG_KSCTL: OWNER Mask */ - -#define CRPT_PRNG_KSSTS_NUM_Pos (0) /*!< CRPT_T::PRNG_KSSTS: NUM Position */ -#define CRPT_PRNG_KSSTS_NUM_Msk (0x1ful << CRPT_PRNG_KSSTS_NUM_Pos) /*!< CRPT_T::PRNG_KSSTS: NUM Mask */ - -#define CRPT_PRNG_KSSTS_KCTLERR_Pos (16) /*!< CRPT_T::PRNG_KSSTS: KCTLERR Position */ -#define CRPT_PRNG_KSSTS_KCTLERR_Msk (0x1ul << CRPT_PRNG_KSSTS_KCTLERR_Pos) /*!< CRPT_T::PRNG_KSSTS: KCTLERR Mask */ - -#define CRPT_AES_KSCTL_NUM_Pos (0) /*!< CRPT_T::AES_KSCTL: NUM Position */ -#define CRPT_AES_KSCTL_NUM_Msk (0x1ful << CRPT_AES_KSCTL_NUM_Pos) /*!< CRPT_T::AES_KSCTL: NUM Mask */ - -#define CRPT_AES_KSCTL_RSRC_Pos (5) /*!< CRPT_T::AES_KSCTL: RSRC Position */ -#define CRPT_AES_KSCTL_RSRC_Msk (0x1ul << CRPT_AES_KSCTL_RSRC_Pos) /*!< CRPT_T::AES_KSCTL: RSRC Mask */ - -#define CRPT_AES_KSCTL_RSSRC_Pos (6) /*!< CRPT_T::AES_KSCTL: RSSRC Position */ -#define CRPT_AES_KSCTL_RSSRC_Msk (0x3ul << CRPT_AES_KSCTL_RSSRC_Pos) /*!< CRPT_T::AES_KSCTL: RSSRC Mask */ - -#define CRPT_HMAC_KSCTL_NUM_Pos (0) /*!< CRPT_T::HMAC_KSCTL: NUM Position */ -#define CRPT_HMAC_KSCTL_NUM_Msk (0x1ful << CRPT_HMAC_KSCTL_NUM_Pos) /*!< CRPT_T::HMAC_KSCTL: NUM Mask */ - -#define CRPT_HMAC_KSCTL_RSRC_Pos (5) /*!< CRPT_T::HMAC_KSCTL: RSRC Position */ -#define CRPT_HMAC_KSCTL_RSRC_Msk (0x1ul << CRPT_HMAC_KSCTL_RSRC_Pos) /*!< CRPT_T::HMAC_KSCTL: RSRC Mask */ - -#define CRPT_HMAC_KSCTL_RSSRC_Pos (6) /*!< CRPT_T::HMAC_KSCTL: RSSRC Position */ -#define CRPT_HMAC_KSCTL_RSSRC_Msk (0x3ul << CRPT_HMAC_KSCTL_RSSRC_Pos) /*!< CRPT_T::HMAC_KSCTL: RSSRC Mask */ - -#define CRPT_ECC_KSCTL_NUMK_Pos (0) /*!< CRPT_T::ECC_KSCTL: NUMK Position */ -#define CRPT_ECC_KSCTL_NUMK_Msk (0x1ful << CRPT_ECC_KSCTL_NUMK_Pos) /*!< CRPT_T::ECC_KSCTL: NUMK Mask */ - -#define CRPT_ECC_KSCTL_RSRCK_Pos (5) /*!< CRPT_T::ECC_KSCTL: RSRCK Position */ -#define CRPT_ECC_KSCTL_RSRCK_Msk (0x1ul << CRPT_ECC_KSCTL_RSRCK_Pos) /*!< CRPT_T::ECC_KSCTL: RSRCK Mask */ - -#define CRPT_ECC_KSCTL_RSSRCK_Pos (6) /*!< CRPT_T::ECC_KSCTL: RSSRCK Position */ -#define CRPT_ECC_KSCTL_RSSRCK_Msk (0x3ul << CRPT_ECC_KSCTL_RSSRCK_Pos) /*!< CRPT_T::ECC_KSCTL: RSSRCK Mask */ - -#define CRPT_ECC_KSCTL_ECDH_Pos (14) /*!< CRPT_T::ECC_KSCTL: ECDH Position */ -#define CRPT_ECC_KSCTL_ECDH_Msk (0x1ul << CRPT_ECC_KSCTL_ECDH_Pos) /*!< CRPT_T::ECC_KSCTL: ECDH Mask */ - -#define CRPT_ECC_KSCTL_TRUST_Pos (16) /*!< CRPT_T::ECC_KSCTL: TRUST Position */ -#define CRPT_ECC_KSCTL_TRUST_Msk (0x1ul << CRPT_ECC_KSCTL_TRUST_Pos) /*!< CRPT_T::ECC_KSCTL: TRUST Mask */ - -#define CRPT_ECC_KSCTL_XY_Pos (20) /*!< CRPT_T::ECC_KSCTL: XY Position */ -#define CRPT_ECC_KSCTL_XY_Msk (0x1ul << CRPT_ECC_KSCTL_XY_Pos) /*!< CRPT_T::ECC_KSCTL: XY Mask */ - -#define CRPT_ECC_KSCTL_WDST_Pos (21) /*!< CRPT_T::ECC_KSCTL: WDST Position */ -#define CRPT_ECC_KSCTL_WDST_Msk (0x1ul << CRPT_ECC_KSCTL_WDST_Pos) /*!< CRPT_T::ECC_KSCTL: WDST Mask */ - -#define CRPT_ECC_KSCTL_WSDST_Pos (22) /*!< CRPT_T::ECC_KSCTL: WSDST Position */ -#define CRPT_ECC_KSCTL_WSDST_Msk (0x3ul << CRPT_ECC_KSCTL_WSDST_Pos) /*!< CRPT_T::ECC_KSCTL: WSDST Mask */ - -#define CRPT_ECC_KSCTL_OWNER_Pos (24) /*!< CRPT_T::ECC_KSCTL: OWNER Position */ -#define CRPT_ECC_KSCTL_OWNER_Msk (0x7ul << CRPT_ECC_KSCTL_OWNER_Pos) /*!< CRPT_T::ECC_KSCTL: OWNER Mask */ - -#define CRPT_ECC_KSSTS_NUM_Pos (0) /*!< CRPT_T::ECC_KSSTS: NUM Position */ -#define CRPT_ECC_KSSTS_NUM_Msk (0x1ful << CRPT_ECC_KSSTS_NUM_Pos) /*!< CRPT_T::ECC_KSSTS: NUM Mask */ - -#define CRPT_ECC_KSXY_NUMX_Pos (0) /*!< CRPT_T::ECC_KSXY: NUMX Position */ -#define CRPT_ECC_KSXY_NUMX_Msk (0x1ful << CRPT_ECC_KSXY_NUMX_Pos) /*!< CRPT_T::ECC_KSXY: NUMX Mask */ - -#define CRPT_ECC_KSXY_RSRCXY_Pos (5) /*!< CRPT_T::ECC_KSXY: RSRCXY Position */ -#define CRPT_ECC_KSXY_RSRCXY_Msk (0x1ul << CRPT_ECC_KSXY_RSRCXY_Pos) /*!< CRPT_T::ECC_KSXY: RSRCXY Mask */ - -#define CRPT_ECC_KSXY_RSSRCX_Pos (6) /*!< CRPT_T::ECC_KSXY: RSSRCX Position */ -#define CRPT_ECC_KSXY_RSSRCX_Msk (0x3ul << CRPT_ECC_KSXY_RSSRCX_Pos) /*!< CRPT_T::ECC_KSXY: RSSRCX Mask */ - -#define CRPT_ECC_KSXY_NUMY_Pos (8) /*!< CRPT_T::ECC_KSXY: NUMY Position */ -#define CRPT_ECC_KSXY_NUMY_Msk (0x1ful << CRPT_ECC_KSXY_NUMY_Pos) /*!< CRPT_T::ECC_KSXY: NUMY Mask */ - -#define CRPT_ECC_KSXY_RSSRCY_Pos (14) /*!< CRPT_T::ECC_KSXY: RSSRCY Position */ -#define CRPT_ECC_KSXY_RSSRCY_Msk (0x3ul << CRPT_ECC_KSXY_RSSRCY_Pos) /*!< CRPT_T::ECC_KSXY: RSSRCY Mask */ - -#define CRPT_RSA_KSCTL_NUM_Pos (0) /*!< CRPT_T::RSA_KSCTL: NUM Position */ -#define CRPT_RSA_KSCTL_NUM_Msk (0x1ful << CRPT_RSA_KSCTL_NUM_Pos) /*!< CRPT_T::RSA_KSCTL: NUM Mask */ - -#define CRPT_RSA_KSCTL_RSRC_Pos (5) /*!< CRPT_T::RSA_KSCTL: RSRC Position */ -#define CRPT_RSA_KSCTL_RSRC_Msk (0x1ul << CRPT_RSA_KSCTL_RSRC_Pos) /*!< CRPT_T::RSA_KSCTL: RSRC Mask */ - -#define CRPT_RSA_KSCTL_RSSRC_Pos (6) /*!< CRPT_T::RSA_KSCTL: RSSRC Position */ -#define CRPT_RSA_KSCTL_RSSRC_Msk (0x3ul << CRPT_RSA_KSCTL_RSSRC_Pos) /*!< CRPT_T::RSA_KSCTL: RSSRC Mask */ - -#define CRPT_RSA_KSCTL_BKNUM_Pos (8) /*!< CRPT_T::RSA_KSCTL: BKNUM Position */ -#define CRPT_RSA_KSCTL_BKNUM_Msk (0x1ful << CRPT_RSA_KSCTL_BKNUM_Pos) /*!< CRPT_T::RSA_KSCTL: BKNUM Mask */ - -#define CRPT_RSA_KSSTS0_NUM0_Pos (0) /*!< CRPT_T::RSA_KSSTS0: NUM0 Position */ -#define CRPT_RSA_KSSTS0_NUM0_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM0_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM0 Mask */ - -#define CRPT_RSA_KSSTS0_NUM1_Pos (8) /*!< CRPT_T::RSA_KSSTS0: NUM1 Position */ -#define CRPT_RSA_KSSTS0_NUM1_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM1_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM1 Mask */ - -#define CRPT_RSA_KSSTS0_NUM2_Pos (16) /*!< CRPT_T::RSA_KSSTS0: NUM2 Position */ -#define CRPT_RSA_KSSTS0_NUM2_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM2_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM2 Mask */ - -#define CRPT_RSA_KSSTS0_NUM3_Pos (24) /*!< CRPT_T::RSA_KSSTS0: NUM3 Position */ -#define CRPT_RSA_KSSTS0_NUM3_Msk (0x1ful << CRPT_RSA_KSSTS0_NUM3_Pos) /*!< CRPT_T::RSA_KSSTS0: NUM3 Mask */ - -#define CRPT_RSA_KSSTS1_NUM4_Pos (0) /*!< CRPT_T::RSA_KSSTS1: NUM4 Position */ -#define CRPT_RSA_KSSTS1_NUM4_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM4_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM4 Mask */ - -#define CRPT_RSA_KSSTS1_NUM5_Pos (8) /*!< CRPT_T::RSA_KSSTS1: NUM5 Position */ -#define CRPT_RSA_KSSTS1_NUM5_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM5_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM5 Mask */ - -#define CRPT_RSA_KSSTS1_NUM6_Pos (16) /*!< CRPT_T::RSA_KSSTS1: NUM6 Position */ -#define CRPT_RSA_KSSTS1_NUM6_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM6_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM6 Mask */ - -#define CRPT_RSA_KSSTS1_NUM7_Pos (24) /*!< CRPT_T::RSA_KSSTS1: NUM7 Position */ -#define CRPT_RSA_KSSTS1_NUM7_Msk (0x1ful << CRPT_RSA_KSSTS1_NUM7_Pos) /*!< CRPT_T::RSA_KSSTS1: NUM7 Mask */ - -#define CRPT_VERSION_MINOR_Pos (0) /*!< CRPT_T::VERSION: MINOR Position */ -#define CRPT_VERSION_MINOR_Msk (0xfffful << CRPT_VERSION_MINOR_Pos) /*!< CRPT_T::VERSION: MINOR Mask */ - -#define CRPT_VERSION_SUB_Pos (16) /*!< CRPT_T::VERSION: SUB Position */ -#define CRPT_VERSION_SUB_Msk (0xfful << CRPT_VERSION_SUB_Pos) /*!< CRPT_T::VERSION: SUB Mask */ - -#define CRPT_VERSION_MAJOR_Pos (24) /*!< CRPT_T::VERSION: MAJOR Position */ -#define CRPT_VERSION_MAJOR_Msk (0xfful << CRPT_VERSION_MAJOR_Pos) /*!< CRPT_T::VERSION: MAJOR Mask */ - -/**@}*/ /* CRPT_CONST */ -/**@}*/ /* end of CRPT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CRYPTO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/dac_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/dac_reg.h deleted file mode 100644 index 40868e00675..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/dac_reg.h +++ /dev/null @@ -1,239 +0,0 @@ -/**************************************************************************//** - * @file dac_reg.h - * @version V1.00 - * @brief DAC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __DAC_REG_H__ -#define __DAC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup DAC Digital to Analog Converter(DAC) - Memory Mapped Structure for DAC Controller -@{ */ - -typedef struct -{ - - - /** - * @var DAC_T::CTL - * Offset: 0x00 DAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DACEN |DAC Enable Bit - * | | |0 = DAC is Disabled. - * | | |1 = DAC is Enabled. - * |[1] |DACIEN |DAC Interrupt Enable Bit - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[2] |DMAEN |DMA Mode Enable Bit - * | | |0 = DMA mode Disabled. - * | | |1 = DMA mode Enabled. - * |[3] |DMAURIEN |DMA Under-run Interrupt Enable Bit - * | | |0 = DMA under-run interrupt Disabled. - * | | |1 = DMA under-run interrupt Enabled. - * |[4] |TRGEN |Trigger Mode Enable Bit - * | | |0 = DAC event trigger mode Disabled. - * | | |1 = DAC event trigger mode Enabled. - * |[7:5] |TRGSEL |Trigger Source Selection - * | | |000 = Software trigger. - * | | |001 = External pin DAC0_ST trigger. - * | | |010 = Timer 0 trigger. - * | | |011 = Timer 1 trigger. - * | | |100 = Timer 2 trigger. - * | | |101 = Timer 3 trigger. - * | | |110 = EPWM0 trigger. - * | | |111 = EPWM1 trigger. - * |[8] |BYPASS |Bypass Buffer Mode - * | | |0 = Output voltage buffer Enabled. - * | | |1 = Output voltage buffer Disabled. - * |[10] |LALIGN |DAC Data Left-aligned Enabled Control - * | | |0 = Right alignment. - * | | |1 = Left alignment. - * |[13:12] |ETRGSEL |External Pin Trigger Selection - * | | |00 = Low level trigger. - * | | |01 = High level trigger. - * | | |10 = Falling edge trigger. - * | | |11 = Rising edge trigger. - * |[15:14] |BWSEL |DAC Data Bit-width Selection - * | | |00 = data is 12 bits. - * | | |01 = data is 8 bits. - * | | |Others = reserved. - * |[16] |GRPEN |DAC Group Mode Enable Bit - * | | |0 = DAC0 and DAC1 are not grouped. - * | | |1 = DAC0 and DAC1 are grouped. - * @var DAC_T::SWTRG - * Offset: 0x04 DAC Software Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWTRG |Software Trigger - * | | |0 = Software trigger Disabled. - * | | |1 = Software trigger Enabled. - * | | |User writes this bit to generate one shot pulse and it is cleared to 0 by hardware automatically; Reading this bit will always get 0. - * @var DAC_T::DAT - * Offset: 0x08 DAC Data Holding Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DACDAT |DAC 12-bit Holding Data - * | | |These bits are written by user software which specifies 12-bit conversion data for DAC output - * | | |The unused bits (DAC_DAT[3:0] in left-alignment mode and DAC_DAT[15:12] in right alignment mode) are ignored by DAC controller hardware. - * | | |12 bit left alignment: user has to load data into DAC_DAT[15:4] bits. - * | | |12 bit right alignment: user has to load data into DAC_DAT[11:0] bits. - * @var DAC_T::DATOUT - * Offset: 0x0C DAC Data Output Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DATOUT |DAC 12-bit Output Data - * | | |These bits are current digital data for DAC output conversion. - * | | |It is loaded from DAC_DAT register and user cannot write it directly. - * @var DAC_T::STATUS - * Offset: 0x10 DAC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FINISH |DAC Conversion Complete Finish Flag - * | | |0 = DAC is in conversion state. - * | | |1 = DAC conversion finish. - * | | |This bit set to 1 when conversion time counter counts to SETTLET - * | | |It is cleared to 0 when DAC starts a new conversion - * | | |User writes 1 to clear this bit to 0. - * |[1] |DMAUDR |DMA Under-run Interrupt Flag - * | | |0 = No DMA under-run error condition occurred. - * | | |1 = DMA under-run error condition occurred. - * | | |User writes 1 to clear this bit. - * |[8] |BUSY |DAC Busy Flag (Read Only) - * | | |0 = DAC is ready for next conversion. - * | | |1 = DAC is busy in conversion. - * | | |This is read only bit. - * @var DAC_T::TCTL - * Offset: 0x14 DAC Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |SETTLET |DAC Output Settling Time - * | | |User software needs to write appropriate value to these bits to meet DAC conversion settling time base on PCLK (APB clock) speed. - * | | |For example, DAC controller clock speed is 80MHz and DAC conversion settling time is 1 us, SETTLETvalue must be greater than 0x50. - * | | |SELTTLET = DAC controller clock speed x settling time. - * @var DAC_T::GRPDAT - * Offset: 0x30 DAC Group Mode Data Holding Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DAC0DAT |DAC0 12-bit Holding Data - * | | |These bits are written by user software which specifies 12-bit conversion data for DAC output - * | | |The unused bits (DAC_GRPDAT[3:0] in left-alignment mode and DAC_GRPDAT[15:12] in right alignment mode) are ignored by DAC controller hardware. - * | | |12 bit left alignment: user has to load data into DAC_GRPDAT[15:4] bits. - * | | |12 bit right alignment: user has to load data into DAC_GRPDAT[11:0] bits. - * | | |Note: In group mode, user can write 12-bit conversion data for DAC0 in DAC_GRPDAT[15:0] or DAC0_DAT[15:0] - * | | |The advantage of writing 12-bit conversion data in DAC_GRPDAT[15:0] is that can share one PDMA transfer mechanism. - * | | |Note: Write 12-bit conversion data in DAC0_DAT[15:0] or DAC1_DAT[15:0] have individual PDMA transfer mechanism between two DACs - * |[31:16] |DAC1DAT |DAC1 12-bit Holding Data - * | | |In group mode, user can write these bits for DAC1 12-bit conversion data - * | | |The unused bits (DAC_GRPDAT[3:0] in left-alignment mode and DAC_GRPDAT[15:12] in right alignment mode) are ignored by DAC controller hardware. - * | | |12 bit left alignment: user has to load data into DAC_GRPDAT[15:4] bits. - * | | |12 bit right alignment: user has to load data into DAC_GRPDAT[11:0] bits. - * | | |Note: In group mode, user can write 12-bit conversion data for DAC1 in DAC_GRPDAT[31:16] or DAC1_DAT[15:0] - * | | |The advantage of writing 12-bit conversion data in DAC_GRPDAT[31:16] is that can share one PDMA transfer mechanism. - * | | |Note: Write 12-bit conversion data in DAC0_DAT[15:0] or DAC1_DAT[15:0] have individual PDMA transfer mechanism between two DACs - */ - __IO uint32_t CTL; /*!< [0x0000] DAC Control Register */ - __IO uint32_t SWTRG; /*!< [0x0004] DAC Software Trigger Control Register */ - __IO uint32_t DAT; /*!< [0x0008] DAC Data Holding Register */ - __I uint32_t DATOUT; /*!< [0x000c] DAC Data Output Register */ - __IO uint32_t STATUS; /*!< [0x0010] DAC Status Register */ - __IO uint32_t TCTL; /*!< [0x0014] DAC Timing Control Register */ - __I uint32_t RESERVE0[6]; - __IO uint32_t GRPDAT; /*!< [0x0030] DAC Group Mode Data Holding Register */ - -} DAC_T; - -/** - @addtogroup DAC_CONST DAC Bit Field Definition - Constant Definitions for DAC Controller -@{ */ - -#define DAC_CTL_DACEN_Pos (0) /*!< DAC_T::CTL: DACEN Position */ -#define DAC_CTL_DACEN_Msk (0x1ul << DAC_CTL_DACEN_Pos) /*!< DAC_T::CTL: DACEN Mask */ - -#define DAC_CTL_DACIEN_Pos (1) /*!< DAC_T::CTL: DACIEN Position */ -#define DAC_CTL_DACIEN_Msk (0x1ul << DAC_CTL_DACIEN_Pos) /*!< DAC_T::CTL: DACIEN Mask */ - -#define DAC_CTL_DMAEN_Pos (2) /*!< DAC_T::CTL: DMAEN Position */ -#define DAC_CTL_DMAEN_Msk (0x1ul << DAC_CTL_DMAEN_Pos) /*!< DAC_T::CTL: DMAEN Mask */ - -#define DAC_CTL_DMAURIEN_Pos (3) /*!< DAC_T::CTL: DMAURIEN Position */ -#define DAC_CTL_DMAURIEN_Msk (0x1ul << DAC_CTL_DMAURIEN_Pos) /*!< DAC_T::CTL: DMAURIEN Mask */ - -#define DAC_CTL_TRGEN_Pos (4) /*!< DAC_T::CTL: TRGEN Position */ -#define DAC_CTL_TRGEN_Msk (0x1ul << DAC_CTL_TRGEN_Pos) /*!< DAC_T::CTL: TRGEN Mask */ - -#define DAC_CTL_TRGSEL_Pos (5) /*!< DAC_T::CTL: TRGSEL Position */ -#define DAC_CTL_TRGSEL_Msk (0x7ul << DAC_CTL_TRGSEL_Pos) /*!< DAC_T::CTL: TRGSEL Mask */ - -#define DAC_CTL_BYPASS_Pos (8) /*!< DAC_T::CTL: BYPASS Position */ -#define DAC_CTL_BYPASS_Msk (0x1ul << DAC_CTL_BYPASS_Pos) /*!< DAC_T::CTL: BYPASS Mask */ - -#define DAC_CTL_LALIGN_Pos (10) /*!< DAC_T::CTL: LALIGN Position */ -#define DAC_CTL_LALIGN_Msk (0x1ul << DAC_CTL_LALIGN_Pos) /*!< DAC_T::CTL: LALIGN Mask */ - -#define DAC_CTL_ETRGSEL_Pos (12) /*!< DAC_T::CTL: ETRGSEL Position */ -#define DAC_CTL_ETRGSEL_Msk (0x3ul << DAC_CTL_ETRGSEL_Pos) /*!< DAC_T::CTL: ETRGSEL Mask */ - -#define DAC_CTL_BWSEL_Pos (14) /*!< DAC_T::CTL: BWSEL Position */ -#define DAC_CTL_BWSEL_Msk (0x3ul << DAC_CTL_BWSEL_Pos) /*!< DAC_T::CTL: BWSEL Mask */ - -#define DAC_CTL_GRPEN_Pos (16) /*!< DAC_T::CTL: GRPEN Position */ -#define DAC_CTL_GRPEN_Msk (0x1ul << DAC_CTL_GRPEN_Pos) /*!< DAC_T::CTL: GRPEN Mask */ - -#define DAC_SWTRG_SWTRG_Pos (0) /*!< DAC_T::SWTRG: SWTRG Position */ -#define DAC_SWTRG_SWTRG_Msk (0x1ul << DAC_SWTRG_SWTRG_Pos) /*!< DAC_T::SWTRG: SWTRG Mask */ - -#define DAC_DAT_DACDAT_Pos (0) /*!< DAC_T::DAT: DACDAT Position */ -#define DAC_DAT_DACDAT_Msk (0xfffful << DAC_DAT_DACDAT_Pos) /*!< DAC_T::DAT: DACDAT Mask */ - -#define DAC_DATOUT_DATOUT_Pos (0) /*!< DAC_T::DATOUT: DATOUT Position */ -#define DAC_DATOUT_DATOUT_Msk (0xffful << DAC_DATOUT_DATOUT_Pos) /*!< DAC_T::DATOUT: DATOUT Mask */ - -#define DAC_STATUS_FINISH_Pos (0) /*!< DAC_T::STATUS: FINISH Position */ -#define DAC_STATUS_FINISH_Msk (0x1ul << DAC_STATUS_FINISH_Pos) /*!< DAC_T::STATUS: FINISH Mask */ - -#define DAC_STATUS_DMAUDR_Pos (1) /*!< DAC_T::STATUS: DMAUDR Position */ -#define DAC_STATUS_DMAUDR_Msk (0x1ul << DAC_STATUS_DMAUDR_Pos) /*!< DAC_T::STATUS: DMAUDR Mask */ - -#define DAC_STATUS_BUSY_Pos (8) /*!< DAC_T::STATUS: BUSY Position */ -#define DAC_STATUS_BUSY_Msk (0x1ul << DAC_STATUS_BUSY_Pos) /*!< DAC_T::STATUS: BUSY Mask */ - -#define DAC_TCTL_SETTLET_Pos (0) /*!< DAC_T::TCTL: SETTLET Position */ -#define DAC_TCTL_SETTLET_Msk (0x3fful << DAC_TCTL_SETTLET_Pos) /*!< DAC_T::TCTL: SETTLET Mask */ - -#define DAC_GRPDAT_DAC0DAT_Pos (0) /*!< DAC_T::GRPDAT: DAC0DAT Position */ -#define DAC_GRPDAT_DAC0DAT_Msk (0xfffful << DAC_GRPDAT_DAC0DAT_Pos) /*!< DAC_T::GRPDAT: DAC0DAT Mask */ - -#define DAC_GRPDAT_DAC1DAT_Pos (16) /*!< DAC_T::GRPDAT: DAC1DAT Position */ -#define DAC_GRPDAT_DAC1DAT_Msk (0xfffful << DAC_GRPDAT_DAC1DAT_Pos) /*!< DAC_T::GRPDAT: DAC1DAT Mask */ - -/**@}*/ /* DAC_CONST */ -/**@}*/ /* end of DAC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __DAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eadc_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eadc_reg.h deleted file mode 100644 index aa7d7f9873c..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eadc_reg.h +++ /dev/null @@ -1,2390 +0,0 @@ -/**************************************************************************//** - * @file eadc_reg.h - * @version V1.00 - * @brief EADC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EADC_REG_H__ -#define __EADC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Enhanced Analog to Digital Converter -------------------------*/ -/** - @addtogroup EADC Enhanced Analog to Digital Converter(EADC) - Memory Mapped Structure for EADC Controller -@{ */ - -typedef struct -{ - - - /** - * @var EADC_T::DAT[19] - * Offset: 0x00 EADC Data Register 0~18 for Sample Module 0~18 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |EADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |The 12-bit EADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |Note: When operating in oversampling mode, RESULT[15:0] can represent oversampling results. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::CURDAT - * Offset: 0x4C ADC PDMA Current Transfer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |CURDAT |EADC PDMA Current Transfer Data (Read Only) - * | | |This register is a shadow register of EADC_DATn (n=0~18) for PDMA support. - * @var EADC_T::CTL - * Offset: 0x50 EADC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCEN |EADC Converter Enable Bit - * | | |0 = EADC Disabled. - * | | |1 = EADC Enabled. - * | | |Note: Before starting EADC conversion function, this bit should be set to 1 - * | | |Clear it to 0 to disable EADC converter analog circuit power consumption. - * |[1] |ADCRST |EADC Converter Control Circuits Reset - * | | |0 = No effect. - * | | |1 = Cause EADC control circuits reset to initial state, but not change the EADC registers value. - * | | |Note: EADCRST bit remains 1 during EADC reset, when EADC reset end, the EADCRST bit is automatically cleared to 0. - * |[2] |ADCIEN0 |Specific Sample Module EADC ADINT0 Interrupt Enable Bit - * | | |The EADC converter generates a conversion end ADIF0 (EADC_STATUS2[0]) upon the end of specific sample module EADC conversion - * | | |If ADCIEN0 bit is set then conversion end interrupt request ADINT0 is generated. - * | | |0 = Specific sample module EADC ADINT0 interrupt function Disabled. - * | | |1 = Specific sample module EADC ADINT0 interrupt function Enabled. - * |[3] |ADCIEN1 |Specific Sample Module EADC ADINT1 Interrupt Enable Bit - * | | |The EADC converter generates a conversion end ADIF1 (EADC_STATUS2[1]) upon the end of specific sample module EADC conversion - * | | |If EADCIEN1 bit is set then conversion end interrupt request ADINT1 is generated. - * | | |0 = Specific sample module EADC ADINT1 interrupt function Disabled. - * | | |1 = Specific sample module EADC ADINT1 interrupt function Enabled. - * |[4] |ADCIEN2 |Specific Sample Module EADC ADINT2 Interrupt Enable Bit - * | | |The EADC converter generates a conversion end ADIF2 (EADC_STATUS2[2]) upon the end of specific sample module EADC conversion - * | | |If EADCIEN2 bit is set then conversion end interrupt request ADINT2 is generated. - * | | |0 = Specific sample module EADC ADINT2 interrupt function Disabled. - * | | |1 = Specific sample module EADC ADINT2 interrupt function Enabled. - * |[5] |ADCIEN3 |Specific Sample Module EADC ADINT3 Interrupt Enable Bit - * | | |The EADC converter generates a conversion end ADIF3 (EADC_STATUS2[3]) upon the end of specific sample module EADC conversion - * | | |If EADCIEN3 bit is set then conversion end interrupt request ADINT3 is generated. - * | | |0 = Specific sample module EADC ADINT3 interrupt function Disabled. - * | | |1 = Specific sample module EADC ADINT3 interrupt function Enabled. - * |[8] |DIFFEN |Differential Analog Input Mode Enable Bit - * | | |0 = Single-end analog input mode. - * | | |1 = Differential analog input mode. - * | | |Note: In the differential mode, the input channel pair must be configured to EADC_CHx, EADC_CHx+1 , x=0,2,4,6,8,10,12,14. - * |[9] |DMOF |ADC Differential Input Mode Output Format - * | | |0 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0], where n= 0 ~18) with unsigned format. - * | | |1 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0], where n= 0 ~18) with 2'complement format. - * |[19:16] |INTDELAY0 |ADC Start Of Conversion ADINT0 Delay Cycle Selection - * | | |Start of conversion interrupt ADINT0 will delay INTDELAY0 PCLK cycles to generate interrupt - * | | |The function supports delay 1 PCLK to 15 PCLK cycles - * | | |User can select one of the options according to the relationship of PCLK and ADC _CLK selected. - * | | |4u2019h0 = No delay cycle. - * | | |4u2019h1 = Start of conversion interrupt ADINT0 delay 1 PCLK cycle. - * | | |4u2019h2 = Start of conversion interrupt ADINT0 delay 2 PCLK cycles. - * | | |4u2019h3 = Start of conversion interrupt ADINT0 delay 3 PCLK cycles. - * | | |4u2019h4 = Start of conversion interrupt ADINT0 delay 4 PCLK cycles. - * | | |4u2019h5 = Start of conversion interrupt ADINT0 delay 5 PCLK cycles. - * | | |4u2019h6 = Start of conversion interrupt ADINT0 delay 6 PCLK cycles. - * | | |4u2019h7 = Start of conversion interrupt ADINT0 delay 7 PCLK cycles. - * | | |4u2019h8 = Start of conversion interrupt ADINT0 delay 8 PCLK cycles. - * | | |4u2019h9 = Start of conversion interrupt ADINT0 delay 9 PCLK cycles. - * | | |4u2019ha = Start of conversion interrupt ADINT0 delay 10 PCLK cycles. - * | | |4u2019hb = Start of conversion interrupt ADINT0 delay 11 PCLK cycles. - * | | |4u2019hc = Start of conversion interrupt ADINT0 delay 12 PCLK cycles. - * | | |4u2019hd = Start of conversion interrupt ADINT0 delay 13 PCLK cycles. - * | | |4u2019he = Start of conversion interrupt ADINT0 delay 14 PCLK cycles. - * | | |4u2019hf = Start of conversion interrupt ADINT0 delay 15 PCLK cycles. - * | | |Note 1: This function is workable only when any one of INTPOS (EADC_SCTLx[5]), x=0~15 is set. - * | | |Note 2: It is noted that the delayed interrupt ADINT0 must occur before the next ADINT0 generated when using the same sample module to control EADC conversion. - * |[23:20] |INTDELAY1 |ADC Start Of Conversion ADINT1 Delay Cycle Selection - * | | |Start of conversion interrupt ADINT1 will delay INTDELAY1 PCLK cycles to generate interrupt - * | | |The function supports delay 1 PCLK to 15 PCLK cycles - * | | |User can select one of the options according to the relationship of PCLK and ADC _CLK selected. - * | | |4u2019h0 = No delay cycle. - * | | |4u2019h1 = Start of conversion interrupt ADINT1 delay 1 PCLK cycle. - * | | |4u2019h2 = Start of conversion interrupt ADINT1 delay 2 PCLK cycles. - * | | |4u2019h3 = Start of conversion interrupt ADINT1 delay 3 PCLK cycles. - * | | |4u2019h4 = Start of conversion interrupt ADINT1 delay 4 PCLK cycles. - * | | |4u2019h5 = Start of conversion interrupt ADINT1 delay 5 PCLK cycles. - * | | |4u2019h6 = Start of conversion interrupt ADINT1 delay 6 PCLK cycles. - * | | |4u2019h7 = Start of conversion interrupt ADINT1 delay 7 PCLK cycles. - * | | |4u2019h8 = Start of conversion interrupt ADINT1 delay 8 PCLK cycles. - * | | |4u2019h9 = Start of conversion interrupt ADINT1 delay 9 PCLK cycles. - * | | |4u2019ha = Start of conversion interrupt ADINT1 delay 10 PCLK cycles. - * | | |4u2019hb = Start of conversion interrupt ADINT1 delay 11 PCLK cycles. - * | | |4u2019hc = Start of conversion interrupt ADINT1 delay 12 PCLK cycles. - * | | |4u2019hd = Start of conversion interrupt ADINT1 delay 13 PCLK cycles. - * | | |4u2019he = Start of conversion interrupt ADINT1 delay 14 PCLK cycles. - * | | |4u2019hf = Start of conversion interrupt ADINT1 delay 15 PCLK cycles. - * | | |Note 1: This function is workable only when any one of INTPOS (EADC_SCTLx[5]), x=0~15 is set. - * | | |Note 2: It is noted that the delayed interrupt ADINT1 must occur before the next ADINT1 generated when using the same sample module to control EADC conversion. - * |[27:24] |INTDELAY2 |ADC Start Of Conversion ADINT2 Delay Cycle Selection - * | | |Start of conversion interrupt ADINT2 will delay INTDELAY2 PCLK cycles to generate interrupt - * | | |The function supports delay 1 PCLK to 15 PCLK cycles - * | | |User can select one of the options according to the relationship of PCLK and ADC _CLK selected. - * | | |4u2019h0 = No delay cycle. - * | | |4u2019h1 = Start of conversion interrupt ADINT2 delay 1 PCLK cycle. - * | | |4u2019h2 = Start of conversion interrupt ADINT2 delay 2 PCLK cycles. - * | | |4u2019h3 = Start of conversion interrupt ADINT2 delay 3 PCLK cycles. - * | | |4u2019h4 = Start of conversion interrupt ADINT2 delay 4 PCLK cycles. - * | | |4u2019h5 = Start of conversion interrupt ADINT2 delay 5 PCLK cycles. - * | | |4u2019h6 = Start of conversion interrupt ADINT2 delay 6 PCLK cycles. - * | | |4u2019h7 = Start of conversion interrupt ADINT2 delay 7 PCLK cycles. - * | | |4u2019h8 = Start of conversion interrupt ADINT2 delay 8 PCLK cycles. - * | | |4u2019h9 = Start of conversion interrupt ADINT2 delay 9 PCLK cycles. - * | | |4u2019ha = Start of conversion interrupt ADINT2 delay 10 PCLK cycles. - * | | |4u2019hb = Start of conversion interrupt ADINT2 delay 11 PCLK cycles. - * | | |4u2019hc = Start of conversion interrupt ADINT2 delay 12 PCLK cycles. - * | | |4u2019hd = Start of conversion interrupt ADINT2 delay 13 PCLK cycles. - * | | |4u2019he = Start of conversion interrupt ADINT2 delay 14 PCLK cycles. - * | | |4u2019hf = Start of conversion interrupt ADINT2 delay 15 PCLK cycles. - * | | |Note 1: This function is workable only when any one of INTPOS (EADC_SCTLx[5]), x=0~15 is set. - * | | |Note 2: It is noted that the delayed interrupt ADINT2 must occur before the next ADINT2 generated when using the same sample module to control EADC conversion. - * |[31:28] |INTDELAY3 |ADC Start Of Conversion ADINT3 Delay Cycle Selection - * | | |Start of conversion interrupt ADINT3 will delay INTDELAY3 PCLK cycles to generate interrupt - * | | |The function supports delay 1 PCLK to 15 PCLK cycles - * | | |User can select one of the options according to the relationship of PCLK and ADC _CLK selected. - * | | |4u2019h0 = No delay cycle. - * | | |4u2019h1 = Start of conversion interrupt ADINT3 delay 1 PCLK cycle. - * | | |4u2019h2 = Start of conversion interrupt ADINT3 delay 2 PCLK cycles. - * | | |4u2019h3 = Start of conversion interrupt ADINT3 delay 3 PCLK cycles. - * | | |4u2019h4 = Start of conversion interrupt ADINT3 delay 4 PCLK cycles. - * | | |4u2019h5 = Start of conversion interrupt ADINT3 delay 5 PCLK cycles. - * | | |4u2019h6 = Start of conversion interrupt ADINT3 delay 6 PCLK cycles. - * | | |4u2019h7 = Start of conversion interrupt ADINT3 delay 7 PCLK cycles. - * | | |4u2019h8 = Start of conversion interrupt ADINT3 delay 8 PCLK cycles. - * | | |4u2019h9 = Start of conversion interrupt ADINT3 delay 9 PCLK cycles. - * | | |4u2019ha = Start of conversion interrupt ADINT3 delay 10 PCLK cycles. - * | | |4u2019hb = Start of conversion interrupt ADINT3 delay 11 PCLK cycles. - * | | |4u2019hc = Start of conversion interrupt ADINT3 delay 12 PCLK cycles. - * | | |4u2019hd = Start of conversion interrupt ADINT3 delay 13 PCLK cycles. - * | | |4u2019he = Start of conversion interrupt ADINT3 delay 14 PCLK cycles. - * | | |4u2019hf = Start of conversion interrupt ADINT3 delay 15 PCLK cycles. - * | | |Note 1: This function is workable only when any one of INTPOS (EADC_SCTLx[5]), x=0~15 is set. - * | | |Note 2: It is noted that the delayed interrupt ADINT3 must occur before the next ADINT3 generated when using the same sample module to control EADC conversion. - * @var EADC_T::SWTRG - * Offset: 0x54 ADC Sample Module Software Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |SWTRG |EADC Sample Module 0~18 Software Force to Start EADC Conversion - * | | |0 = No effect. - * | | |1 = Cause an EADC conversion when the priority is given to sample module. - * | | |Note: After writing this register to start EADC conversion, the EADC_PENDSTS register will show which sample module will conversion - * | | |If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - * @var EADC_T::PENDSTS - * Offset: 0x58 EADC Start of Conversion Pending Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |STPF |EADC Sample Module 0~18 Start of Conversion Pending Flag - * | | |Read Operation: - * | | |0 = There is no pending conversion for sample module. - * | | |1 = Sample module EADC start of conversion is pending. - * | | |Write Operation: - * | | |1 = Clear pending flag & cancel the conversion for sample module. - * | | |Note: This bit remains 1 during pending state when the respective EADC conversion is ended - * | | |The STPFn (n=0~18) bit is automatically cleared to 0 - * @var EADC_T::OVSTS - * Offset: 0x5C EADC Sample Module Start of Conversion Overrun Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |SPOVF |EADC SAMPLE0~18 Overrun Flag - * | | |0 = No sample module event overrun. - * | | |1 = Indicates a new sample module event is generated while an old one event is pending. - * | | |Note: This bit is cleared by writing 1 to it. - * @var EADC_T::CTL1 - * Offset: 0x60 EADC Control1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:4] |RESSEL |Resolution Select Bits - * | | |00 = ADC resolution 12 bits. - * | | |01 = ADC resolution 10 bits. - * | | |10 = ADC resolution 8 bits. - * | | |11 = Reserved. - * |[12] |ULPEN |Ultra Low Power Mode Enable Bit - * | | |0 = Ultra low power mode Disabled. - * | | |1 = Ultra low power mode Enabled. - * |[15:13] |ULPDIV |Ultra Low Power Mode Prescalar selection - * | | |000= ADC_CLK divided by 1. - * | | |001= ADC_CLK divided by 2. - * | | |010= ADC_CLK divided by 4. - * | | |011= ADC_CLK divided by 8. - * | | |100= ADC_CLK divided by 16. - * | | |Others = Reserved. - * | | |Note: the function is for internal used, itu2019s not complete function - * | | |Note: user set ULPEN and ULPDIV will get divided ADC_CLK only. The conversion time is still the same - * |[16] |DECSET |High Speed Oversampling Mode Enable Bit - * | | |0 = High speed oversampling mode Disabled. - * | | |1 = High speed oversampling mode Enabled. - * | | |Note: these bits is for analog RD used - * |[20] |CMP0TRG |ADC Comparator 0 Trigger EPWM Brake Enable Bit - * | | |0 = Comparator 0 trigger EPWM brake Disabled. - * | | |1 = Comparator 0 trigger EPWM brake Enabled. - * |[21] |CMP1TRG |ADC Comparator 1 Trigger EPWM Brake Enable Bit - * | | |0 = Comparator 1 trigger EPWM brake Disabled. - * | | |1 = Comparator 1 trigger EPWM brake Enabled. - * |[22] |CMP2TRG |ADC Comparator 2 Trigger EPWM Brake Enable Bit - * | | |0 = Comparator 2 trigger EPWM brake Disabled. - * | | |1 = Comparator 2 trigger EPWM brake Enabled. - * |[23] |CMP3TRG |ADC Comparator 3 Trigger EPWM Brake Enable Bit - * | | |0 = Comparator 3 trigger EPWM brake Disabled. - * | | |1 = Comparator 3 trigger EPWM brake Enabled. - * |[31:24] |OSR |Repeat Conversion Times Select - * | | |8u2019b00000000 = ADC converts for 1 time. - * | | |8u2019b00000001 = ADC converts for 2 times. - * | | |8u2019b00000010 = ADC converts for 3 times. - * | | |8u2019b00000011 = ADC converts for 4 times. - * | | |8u2019b00000100 = ADC converts for 5 times. - * | | |uFF1A - * | | |uFF1A - * | | |uFF1A - * | | |8u2019b11111101 = ADC converts for 254 times. - * | | |8u2019b11111110 = ADC converts for 255 times. - * | | |Note: The other steps of selection not listed above follow the same rule. - * | | |Note: these bits is for analog RD used - * @var EADC_T::SCTL[19] - * Offset: 0x80 EADC Sample Module 0~18 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CHSEL |EADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = EADC_CH8. - * | | |09H = EADC_CH9. - * | | |0AH = EADC_CH10. - * | | |0BH = EADC_CH11. - * | | |0CH = EADC_CH12. - * | | |0DH = EADC_CH13. - * | | |0EH = EADC_CH14. - * | | |0FH = EADC_CH15. - * |[5] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at EADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at EADC start of conversion. - * |[7:6] |TRGDLYDIV |EADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = EADC_CLK/1. - * | | |01 = EADC_CLK/2. - * | | |10 = EADC_CLK/4. - * | | |11 = EADC_CLK/16. - * |[15:8] |TRGDLYCNT |EADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x EADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * |[20:16] |TRGSEL |EADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = EADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = EADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = EPWM0TG0. - * | | |9H = EPWM0TG1. - * | | |AH = EPWM0TG2. - * | | |BH = EPWM0TG3. - * | | |CH = EPWM0TG4. - * | | |DH = EPWM0TG5. - * | | |EH = EPWM1TG0. - * | | |FH = EPWM1TG1. - * | | |10H = EPWM1TG2. - * | | |11H = EPWM1TG3. - * | | |12H = EPWM1TG4. - * | | |13H = EPWM1TG5. - * | | |14H = BPWM0TG. - * | | |15H = BPWM1TG. - * | | |other = Reserved. - * |[21] |EXTREN |EADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when EADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when EADC selects EADC0_ST as trigger source. - * |[22] |EXTFEN |EADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when EADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when EADC selects EADC0_ST as trigger source. - * |[23] |DBMEN |Double Buffer Mode Enable Bit - * | | |0 = Sample has one sample result register (default). - * | | |1 = Sample has two sample result registers. - * |[31:24] |EXTSMPT |EADC Sampling Time Extend - * | | |When EADC converting at high conversion rate, the sampling time of analog input voltage may not be enough if input channel loading is heavy, and user can extend EADC sampling time after trigger source is coming to get enough sampling time. - * | | |The range of start delay time is from 0~255 EADC clock. - * @var EADC_T::INTSRC[4] - * Offset: 0xD0 EADC interrupt 0~3 Source Enable Control Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPLIE0 |Sample Module 0 Interrupt Enable Bit - * | | |0 = Sample Module 0 interrupt Disabled. - * | | |1 = Sample Module 0 interrupt Enabled. - * |[1] |SPLIE1 |Sample Module 1 Interrupt Enable Bit - * | | |0 = Sample Module 1 interrupt Disabled. - * | | |1 = Sample Module 1 interrupt Enabled. - * |[2] |SPLIE2 |Sample Module 2 Interrupt Enable Bit - * | | |0 = Sample Module 2 interrupt Disabled. - * | | |1 = Sample Module 2 interrupt Enabled. - * |[3] |SPLIE3 |Sample Module 3 Interrupt Enable Bit - * | | |0 = Sample Module 3 interrupt Disabled. - * | | |1 = Sample Module 3 interrupt Enabled. - * |[4] |SPLIE4 |Sample Module 4 Interrupt Enable Bit - * | | |0 = Sample Module 4 interrupt Disabled. - * | | |1 = Sample Module 4 interrupt Enabled. - * |[5] |SPLIE5 |Sample Module 5 Interrupt Enable Bit - * | | |0 = Sample Module 5 interrupt Disabled. - * | | |1 = Sample Module 5 interrupt Enabled. - * |[6] |SPLIE6 |Sample Module 6 Interrupt Enable Bit - * | | |0 = Sample Module 6 interrupt Disabled. - * | | |1 = Sample Module 6 interrupt Enabled. - * |[7] |SPLIE7 |Sample Module 7 Interrupt Enable Bit - * | | |0 = Sample Module 7 interrupt Disabled. - * | | |1 = Sample Module 7 interrupt Enabled. - * |[8] |SPLIE8 |Sample Module 8 Interrupt Enable Bit - * | | |0 = Sample Module 8 interrupt Disabled. - * | | |1 = Sample Module 8 interrupt Enabled. - * |[9] |SPLIE9 |Sample Module 9 Interrupt Enable Bit - * | | |0 = Sample Module 9 interrupt Disabled. - * | | |1 = Sample Module 9 interrupt Enabled. - * |[10] |SPLIE10 |Sample Module 10 Interrupt Enable Bit - * | | |0 = Sample Module 10 interrupt Disabled. - * | | |1 = Sample Module 10 interrupt Enabled. - * |[11] |SPLIE11 |Sample Module 11 Interrupt Enable Bit - * | | |0 = Sample Module 11 interrupt Disabled. - * | | |1 = Sample Module 11 interrupt Enabled. - * |[12] |SPLIE12 |Sample Module 12 Interrupt Enable Bit - * | | |0 = Sample Module 12 interrupt Disabled. - * | | |1 = Sample Module 12 interrupt Enabled. - * |[13] |SPLIE13 |Sample Module 13 Interrupt Enable Bit - * | | |0 = Sample Module 13 interrupt Disabled. - * | | |1 = Sample Module 13 interrupt Enabled. - * |[14] |SPLIE14 |Sample Module 14 Interrupt Enable Bit - * | | |0 = Sample Module 14 interrupt Disabled. - * | | |1 = Sample Module 14 interrupt Enabled. - * |[15] |SPLIE15 |Sample Module 15 Interrupt Enable Bit - * | | |0 = Sample Module 15 interrupt Disabled. - * | | |1 = Sample Module 15 interrupt Enabled. - * |[16] |SPLIE16 |Sample Module 16 Interrupt Enable Bit - * | | |0 = Sample Module 16 interrupt Disabled. - * | | |1 = Sample Module 16 interrupt Enabled. - * |[17] |SPLIE17 |Sample Module 17 Interrupt Enable Bit - * | | |0 = Sample Module 17 interrupt Disabled. - * | | |1 = Sample Module 17 interrupt Enabled. - * |[18] |SPLIE18 |Sample Module 18 Interrupt Enable Bit - * | | |0 = Sample Module 18 interrupt Disabled. - * | | |1 = Sample Module 18 interrupt Enabled. - * @var EADC_T::CMP[4] - * Offset: 0xE0 ADC Result Compare Register 0~3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCMPEN |EADC Result Compare Enable Bit - * | | |0 = Compare Disabled. - * | | |1 = Compare Enabled. - * | | |Set this bit to 1 to enable compare CMPDAT (EADC_CMPn[27:16], n=0~3) with specified sample module conversion result when converted data is loaded into EADC_DAT register. - * |[1] |ADCMPIE |EADC Result Compare Interrupt Enable Bit - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, if ADCMPIE is set to 1, a compare interrupt request is generated. - * |[2] |CMPCOND |Compare Condition - * | | |0= Set the compare condition as that when a 12-bit EADC conversion result is less than the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |1= Set the compare condition as that when a 12-bit EADC conversion result is greater or equal to the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |Note: When the internal counter reaches the value to (CMPMCNT (EADC_CMPn[11:8], n=0~3) +1), the CMPF bit will be set. - * |[7:3] |CMPSPL |Compare Sample Module Selection - * | | |00000 = Sample Module 0 conversion result EADC_DAT0 is selected to be compared. - * | | |00001 = Sample Module 1 conversion result EADC_DAT1 is selected to be compared. - * | | |00010 = Sample Module 2 conversion result EADC_DAT2 is selected to be compared. - * | | |00011 = Sample Module 3 conversion result EADC_DAT3 is selected to be compared. - * | | |00100 = Sample Module 4 conversion result EADC_DAT4 is selected to be compared. - * | | |00101 = Sample Module 5 conversion result EADC_DAT5 is selected to be compared. - * | | |00110 = Sample Module 6 conversion result EADC_DAT6 is selected to be compared. - * | | |00111 = Sample Module 7 conversion result EADC_DAT7 is selected to be compared. - * | | |01000 = Sample Module 8 conversion result EADC_DAT8 is selected to be compared. - * | | |01001 = Sample Module 9 conversion result EADC_DAT9 is selected to be compared. - * | | |01010 = Sample Module 10 conversion result EADC_DAT10 is selected to be compared. - * | | |01011 = Sample Module 11 conversion result EADC_DAT11 is selected to be compared. - * | | |01100 = Sample Module 12 conversion result EADC_DAT12 is selected to be compared. - * | | |01101 = Sample Module 13 conversion result EADC_DAT13 is selected to be compared. - * | | |01110 = Sample Module 14 conversion result EADC_DAT14 is selected to be compared. - * | | |01111 = Sample Module 15 conversion result EADC_DAT15 is selected to be compared. - * | | |10000 = Sample Module 16 conversion result EADC_DAT16 is selected to be compared. - * | | |10001 = Sample Module 17 conversion result EADC_DAT17 is selected to be compared. - * | | |10010 = Sample Module 18 conversion result EADC_DAT18 is selected to be compared. - * | | |Others = reserved. - * |[11:8] |CMPMCNT |Compare Match Count - * | | |When the specified ADC sample module analog conversion result matches the compare condition defined by CMPCOND (EADC_CMPn[2], n=0~3), the internal match counter will increase 1 - * | | |If the compare result does not meet the compare condition, the internal compare match counter will reset to 0 - * | | |When the internal counter reaches the value to (CMPMCNT +1), the ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = ADCMPF0 (EADC_STATUS2[4]) will be set when EADC_CMP0 compared condition matched - * | | |EADCMPF2 (EADC_STATUS2[6]) will be set when EADC_CMP2 compared condition matched - * | | |1 = EADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched - * | | |EADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * | | |Note: This bit is only present in EADC_CMP0 and EADC_CMP2 register. - * | | |Note: When in compare window mode, the CMPCNT setting only follow EADC_CMP0, EADC_CMP2 registers - * |[27:16] |CMPDAT |Comparison Data - * | | |The 12 bits data is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage transition without imposing a load on software. - * @var EADC_T::STATUS0 - * Offset: 0xF0 EADC Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |VALID |EADC_DAT0~15 Data Valid Flag - * | | |It is a mirror of VALID bit in sample module EADC result data register EADC_DATn. (n=0~15). - * |[31:16] |OV |EADC_DAT0~15 Overrun Flag - * | | |It is a mirror to OV bit in sample module EADC result data register EADC_DATn. (n=0~15). - * @var EADC_T::STATUS1 - * Offset: 0xF4 EADC Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |VALID |EADC_DAT16~18 Data Valid Flag - * | | |It is a mirror of VALID bit in sample module EADC result data register EADC_DATn. (n=16~18). - * |[18:16] |OV |EADC_DAT16~18 Overrun Flag - * | | |It is a mirror to OV bit in sample module EADC result data register EADC_DATn. (n=16~18). - * @var EADC_T::STATUS2 - * Offset: 0xF8 EADC Status Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADIF0 |EADC ADINT0 Interrupt Flag - * | | |0 = No ADINT0 interrupt pulse received. - * | | |1 = ADINT0 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an EADC conversion of specific sample module has been completed - * |[1] |ADIF1 |EADC ADINT1 Interrupt Flag - * | | |0 = No ADINT1 interrupt pulse received. - * | | |1 = ADINT1 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an EADC conversion of specific sample module has been completed - * |[2] |ADIF2 |EADC ADINT2 Interrupt Flag - * | | |0 = No ADINT2 interrupt pulse received. - * | | |1 = ADINT2 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an EADC conversion of specific sample module has been completed - * |[3] |ADIF3 |EADC ADINT3 Interrupt Flag - * | | |0 = No ADINT3 interrupt pulse received. - * | | |1 = ADINT3 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an EADC conversion of specific sample module has been completed - * |[4] |ADCMPF0 |EADC Compare 0 Flag - * | | |When the specific sample module EADC conversion result meets setting condition in EADC_CMP0 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP0 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP0 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[5] |ADCMPF1 |EADC Compare 1 Flag - * | | |When the specific sample module EADC conversion result meets setting condition in EADC_CMP1 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP1 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP1 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |ADCMPF2 |EADC Compare 2 Flag - * | | |When the specific sample module EADC conversion result meets setting condition in EADC_CMP2 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP2 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP2 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[7] |ADCMPF3 |EADC Compare 3 Flag - * | | |When the specific sample module EADC conversion result meets setting condition in EADC_CMP3 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP3 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP3 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[8] |ADOVIF0 |EADC ADINT0 Interrupt Flag Overrun - * | | |0 = ADINT0 interrupt flag is not overwritten to 1. - * | | |1 = ADINT0 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[9] |ADOVIF1 |EADC ADINT1 Interrupt Flag Overrun - * | | |0 = ADINT1 interrupt flag is not overwritten to 1. - * | | |1 = ADINT1 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[10] |ADOVIF2 |EADC ADINT2 Interrupt Flag Overrun - * | | |0 = ADINT2 interrupt flag is not overwritten to 1. - * | | |1 = ADINT2 interrupt flag is s overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[11] |ADOVIF3 |EADC ADINT3 Interrupt Flag Overrun - * | | |0 = ADINT3 interrupt flag is not overwritten to 1. - * | | |1 = ADINT3 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[12] |ADCMPO0 |EADC Compare 0 Output Status (Read Only) - * | | |The 12 bits compare0 data CMPDAT0 (EADC_CMP0[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT0 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT0 setting. - * |[13] |ADCMPO1 |EADC Compare 1 Output Status (Read Only) - * | | |The 12 bits compare1 data CMPDAT1 (EADC_CMP1[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT1 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal to CMPDAT1 setting. - * |[14] |ADCMPO2 |EADC Compare 2 Output Status (Read Only) - * | | |The 12 bits compare2 data CMPDAT2 (EADC_CMP2[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT2 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal to CMPDAT2 setting. - * |[15] |ADCMPO3 |EADC Compare 3 Output Status (Read Only) - * | | |The 12 bits compare3 data CMPDAT3 (EADC_CMP3[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT3 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal to CMPDAT3 setting. - * |[20:16] |CHANNEL |Current Conversion Channel (Read Only) - * | | |This filed reflects EADC current conversion channel when BUSY=1. - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = EADC_CH8. - * | | |09H = EADC_CH9. - * | | |0AH = EADC_CH10. - * | | |0BH = EADC_CH11. - * | | |0CH = EADC_CH12. - * | | |0DH = EADC_CH13. - * | | |0EH = EADC_CH14. - * | | |0FH = EADC_CH15. - * | | |10H = VBG. - * | | |11H = VTEMP. - * | | |12H = DAC0_OUT. - * |[23] |BUSY |Busy/Idle (Read Only) - * | | |0 = EADC is in idle state. - * | | |1 = EADC is busy at conversion. - * | | |Note: This flag will be high after 4*EADC_CLK cycles when the trigger source is coming. - * |[24] |ADOVIF |All EADC Interrupt Flag Overrun Bits Check (Read Only) - * | | |n=0~3. - * | | |0 = None of ADINT interrupt flag ADOVIFn, n=0~3 is overwritten to 1. - * | | |1 = Any one of ADINT interrupt flag ADOVIFn, n=0~3 is overwritten to 1. - * | | |Note: This bit will keep 1 when any ADOVIFn Flag is equal to 1. - * |[25] |STOVF |for All EADC Sample Module Start of Conversion Overrun Flags Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * | | |1 = Any one of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * | | |Note: This bit will keep 1 when any SPOVFn Flag is equal to 1. - * |[26] |AVALID |for All Sample Module EADC Result Data Register EADC_DAT Data Valid Flag Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * | | |1 = Any one of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * | | |Note: This bit will keep 1 when any VALIDn Flag is equal to 1. - * |[27] |AOV |for All Sample Module EADC Result Data Register Overrun Flags Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * | | |1 = Any one of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * | | |Note: This bit will keep 1 when any OVn Flag is equal to 1. - * @var EADC_T::STATUS3 - * Offset: 0xFC EADC Status Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CURSPL |EADC Current Sample Module (Read Only) - * | | |This register shows the current EADC is controlled by which sample module control logic modules. - * | | |If the EADC is Idle, the bit filed will be set to 0x1F. - * @var EADC_T::DDAT[4] - * Offset: 0x100 EADC Double Data Register 0 for Sample Module 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |EADC Conversion Results - * | | |This field contains 12 bits conversion results. - * | | |The 12-bit EADC conversion result with unsigned format will be filled in RESULT [11:0] and zero will be filled in RESULT [15:12]. - * |[16] |OV |Overrun Flag - * | | |0 = Double Data in RESULT (EADC_DDATn[15:0], n=0~3) is recent conversion result. - * | | |1 = Double Data in RESULT (EADC_DDATn[15:0], n=0~3) is overwrite. - * | | |If converted data in RESULT[15:0] has not been read before new conversion result is loaded to this register, OV is set to 1 - * | | |It is cleared by hardware after EADC_DDAT register is read. - * |[17] |VALID |Valid Flag - * | | |0 = Double data in RESULT (EADC_DDATn[15:0]) is not valid. - * | | |1 = Double data in RESULT (EADC_DDATn[15:0]) is valid. - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DDATn register is read - * | | |(n=0~3). - * @var EADC_T::CALCTL - * Offset: 0x114 EADC Calibration Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAL |Calibration Enable Bit - * | | |0 = = Calibration Disabled. - * | | |1 = = Calibration Enabled. - * | | |Note: This bit is hardware auto cleared when calibration is done - * |[1] |CALIE |Calibration Interrupt Enable Bit - * | | |0 = Calibration interrupt Disabled. - * | | |1= Calibration interrupt Enabled. - * |[2] |CALWR |Calibration Write Operation Bit for debug mode - * | | |0 = none. - * | | |1 = do calibration write operation. - * | | |Note: writing 1 to this bit can write CALWDATA to corresponding address CALADDR. - * | | |Note: this bit is hardware cleared - * |[3] |CALRD |Calibration Read Operation Bit for debug mode - * | | |0 = none. - * | | |1 = do calibration read operation. - * |[4] |OUTSEL |Calibration Output Mode Selection - * |[5] |CALSEL16T |Calibration Select Times Bit - * | | |0 = Calibration 1 times. - * | | |1 = Calibration 16 times (default). - * | | |Note: CALSEL16T shoule keep value = 1 before doing calibration. - * |[12:8] |CALADDR |Calibration Data Address - * | | |Calibration Data address in the calibration circuit, write CALADDR and corresponding sw write CALWDATA will store into the CALADDR. - * |[19:16] |CALSEL |Calibration Select Bits - * | | |0 = Calibrate offset.1. - * | | |1 = Calibrate MSB. - * | | |2 = Calibrate MSB-1. - * | | |3 = Calibrate MSB-2. - * | | |4 = Calibrate MSB-3. - * | | |5 = Calibrate MSB-4. - * | | |6 = Reserved. - * | | |7 = Calibrate offset.1. - * | | |Others = reserved. - * |[31:24] |CALWRDATA |Calibration Write Data - * | | |SW write 8-bit data into the calibration circuit to debug R/W - * @var EADC_T::CALSR - * Offset: 0x118 EADC Calibration Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CALRDATA |Calibration Read Data - * | | |Read CALRDATA (EADC_CALSR[11:0]) will get CALWRDATA (EADC_CALCTL[31:24]) in the corresponding CALADDR setting . - * | | |Note: CALRDATA is read only - * | | |Note: when perform read operation, CALADDR, OUTSEL setting must be the same when perform write operation - * |[16] |CALIF |Calibration Finish Interrupt Flag - * | | |If calibration is finished, this flag will be set to 1. It is cleared by writing 1 to it. - * @var EADC_T::PDMACTL - * Offset: 0x130 EADC PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |PDMATEN |PDMA Transfer Enable Bit - * | | |When EADC conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, user can enable this bit to generate a PDMA data transfer request. - * | | |0 = PDMA data transfer Disabled. - * | | |1 = PDMA data transfer Enabled. - * | | |Note:When setting this bit field to 1, user must set ADCIENn (EADC_CTL[5:2], n=0~3) = 0 to disable interrupt. - * @var EADC_T::M0CTL1 - * Offset: 0x140 EADC Sample Module0 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M1CTL1 - * Offset: 0x144 EADC Sample Module1 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M2CTL1 - * Offset: 0x148 EADC Sample Module2 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M3CTL1 - * Offset: 0x14C EADC Sample Module3 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M4CTL1 - * Offset: 0x150 EADC Sample Module4 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M5CTL1 - * Offset: 0x154 EADC Sample Module5 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M6CTL1 - * Offset: 0x158 EADC Sample Module6 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M7CTL1 - * Offset: 0x15C EADC Sample Module7 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M8CTL1 - * Offset: 0x160 EADC Sample Module8 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M9CTL1 - * Offset: 0x164 EADC Sample Module9 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M10CTL1 - * Offset: 0x168 EADC Sample Module10 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M11CTL1 - * Offset: 0x16C EADC Sample Module11 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M12CTL1 - * Offset: 0x170 EADC Sample Module12 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M13CTL1 - * Offset: 0x174 EADC Sample Module13 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M14CTL1 - * Offset: 0x178 EADC Sample Module14 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - * @var EADC_T::M15CTL1 - * Offset: 0x17C EADC Sample Module15 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALIGN |Alignment Selection - * | | |0 = The conversion result will be right aligned in data register. - * | | |1 = The conversion result will be left aligned in data register. - * |[1] |AVG |Average Mode Selection - * | | |0 = Conversion results will be stored in data register without averaging. - * | | |1 = Conversion results in data register will be averaged. - * | | |Note: This bit needs to work with ACU (EADC_MnCTL1[7:4], n=0~23). - * |[7:4] |ACU |Number of Accumulated Conversion Results Selection - * | | |0000 = 1 conversion result will be accumulated. - * | | |0001 = 2 conversion result will be accumulated. - * | | |0010 = 4 conversion result will be accumulated. - * | | |0011 = 8 conversion result will be accumulated. - * | | |0100 = 16 conversion result will be accumulated. - * | | |0101 = 32 conversion result will be accumulated. - * | | |0110 = 64 conversion result will be accumulated. - * | | |0111 = 128 conversion result will be accumulated. - * | | |1000 = 256 conversion result will be accumulated. - * | | |Others = Reserved. - */ - __I uint32_t DAT[19]; /*!< [0x0000] EADC Data Register 0~18 for Sample Module 0~18 */ - __I uint32_t CURDAT; /*!< [0x004c] EADC PDMA Current Transfer Data Register */ - __IO uint32_t CTL; /*!< [0x0050] EADC Control Register */ - __O uint32_t SWTRG; /*!< [0x0054] EADC Sample Module Software Start Register */ - __IO uint32_t PENDSTS; /*!< [0x0058] EADC Start of Conversion Pending Flag Register */ - __IO uint32_t OVSTS; /*!< [0x005c] EADC Sample Module Start of Conversion Overrun Flag Register */ - __IO uint32_t CTL1; /*!< [0x0060] EADC Control1 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[7]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SCTL[19]; /*!< [0x0080] EADC Sample Module 0~18 Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t INTSRC[4]; /*!< [0x00d0] EADC interrupt 0~3 Source Enable Control Register. */ - __IO uint32_t CMP[4]; /*!< [0x00e0] EADC Result Compare Register 0~3 */ - __I uint32_t STATUS0; /*!< [0x00f0] EADC Status Register 0 */ - __I uint32_t STATUS1; /*!< [0x00f4] EADC Status Register 1 */ - __IO uint32_t STATUS2; /*!< [0x00f8] EADC Status Register 2 */ - __I uint32_t STATUS3; /*!< [0x00fc] EADC Status Register 3 */ - __I uint32_t DDAT[4]; /*!< [0x0100] EADC Double Data Register 0~3 for Sample Module 0~3 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CALCTL; /*!< [0x0114] EADC Calibration Control Register */ - __IO uint32_t CALSR; /*!< [0x0118] EADC Calibration Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PDMACTL; /*!< [0x0130] EADC PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t MCTL1[15]; /*!< [0x0140 - 0x017c] EADC Sample Module 0~15 Control Register */ -} EADC_T; - -/** - @addtogroup EADC_CONST EADC Bit Field Definition - Constant Definitions for EADC Controller -@{ */ - -#define EADC_DAT_RESULT_Pos (0) /*!< EADC_T::DAT: RESULT Position */ -#define EADC_DAT_RESULT_Msk (0xfffful << EADC_DAT_RESULT_Pos) /*!< EADC_T::DAT: RESULT Mask */ - -#define EADC_DAT_OV_Pos (16) /*!< EADC_T::DAT: OV Position */ -#define EADC_DAT_OV_Msk (0x1ul << EADC_DAT_OV_Pos) /*!< EADC_T::DAT: OV Mask */ - -#define EADC_DAT_VALID_Pos (17) /*!< EADC_T::DAT: VALID Position */ -#define EADC_DAT_VALID_Msk (0x1ul << EADC_DAT_VALID_Pos) /*!< EADC_T::DAT: VALID Mask */ - -#define EADC_DAT0_RESULT_Pos (0) /*!< EADC_T::DAT0: RESULT Position */ -#define EADC_DAT0_RESULT_Msk (0xfffful << EADC_DAT0_RESULT_Pos) /*!< EADC_T::DAT0: RESULT Mask */ - -#define EADC_DAT0_OV_Pos (16) /*!< EADC_T::DAT0: OV Position */ -#define EADC_DAT0_OV_Msk (0x1ul << EADC_DAT0_OV_Pos) /*!< EADC_T::DAT0: OV Mask */ - -#define EADC_DAT0_VALID_Pos (17) /*!< EADC_T::DAT0: VALID Position */ -#define EADC_DAT0_VALID_Msk (0x1ul << EADC_DAT0_VALID_Pos) /*!< EADC_T::DAT0: VALID Mask */ - -#define EADC_DAT1_RESULT_Pos (0) /*!< EADC_T::DAT1: RESULT Position */ -#define EADC_DAT1_RESULT_Msk (0xfffful << EADC_DAT1_RESULT_Pos) /*!< EADC_T::DAT1: RESULT Mask */ - -#define EADC_DAT1_OV_Pos (16) /*!< EADC_T::DAT1: OV Position */ -#define EADC_DAT1_OV_Msk (0x1ul << EADC_DAT1_OV_Pos) /*!< EADC_T::DAT1: OV Mask */ - -#define EADC_DAT1_VALID_Pos (17) /*!< EADC_T::DAT1: VALID Position */ -#define EADC_DAT1_VALID_Msk (0x1ul << EADC_DAT1_VALID_Pos) /*!< EADC_T::DAT1: VALID Mask */ - -#define EADC_DAT2_RESULT_Pos (0) /*!< EADC_T::DAT2: RESULT Position */ -#define EADC_DAT2_RESULT_Msk (0xfffful << EADC_DAT2_RESULT_Pos) /*!< EADC_T::DAT2: RESULT Mask */ - -#define EADC_DAT2_OV_Pos (16) /*!< EADC_T::DAT2: OV Position */ -#define EADC_DAT2_OV_Msk (0x1ul << EADC_DAT2_OV_Pos) /*!< EADC_T::DAT2: OV Mask */ - -#define EADC_DAT2_VALID_Pos (17) /*!< EADC_T::DAT2: VALID Position */ -#define EADC_DAT2_VALID_Msk (0x1ul << EADC_DAT2_VALID_Pos) /*!< EADC_T::DAT2: VALID Mask */ - -#define EADC_DAT3_RESULT_Pos (0) /*!< EADC_T::DAT3: RESULT Position */ -#define EADC_DAT3_RESULT_Msk (0xfffful << EADC_DAT3_RESULT_Pos) /*!< EADC_T::DAT3: RESULT Mask */ - -#define EADC_DAT3_OV_Pos (16) /*!< EADC_T::DAT3: OV Position */ -#define EADC_DAT3_OV_Msk (0x1ul << EADC_DAT3_OV_Pos) /*!< EADC_T::DAT3: OV Mask */ - -#define EADC_DAT3_VALID_Pos (17) /*!< EADC_T::DAT3: VALID Position */ -#define EADC_DAT3_VALID_Msk (0x1ul << EADC_DAT3_VALID_Pos) /*!< EADC_T::DAT3: VALID Mask */ - -#define EADC_DAT4_RESULT_Pos (0) /*!< EADC_T::DAT4: RESULT Position */ -#define EADC_DAT4_RESULT_Msk (0xfffful << EADC_DAT4_RESULT_Pos) /*!< EADC_T::DAT4: RESULT Mask */ - -#define EADC_DAT4_OV_Pos (16) /*!< EADC_T::DAT4: OV Position */ -#define EADC_DAT4_OV_Msk (0x1ul << EADC_DAT4_OV_Pos) /*!< EADC_T::DAT4: OV Mask */ - -#define EADC_DAT4_VALID_Pos (17) /*!< EADC_T::DAT4: VALID Position */ -#define EADC_DAT4_VALID_Msk (0x1ul << EADC_DAT4_VALID_Pos) /*!< EADC_T::DAT4: VALID Mask */ - -#define EADC_DAT5_RESULT_Pos (0) /*!< EADC_T::DAT5: RESULT Position */ -#define EADC_DAT5_RESULT_Msk (0xfffful << EADC_DAT5_RESULT_Pos) /*!< EADC_T::DAT5: RESULT Mask */ - -#define EADC_DAT5_OV_Pos (16) /*!< EADC_T::DAT5: OV Position */ -#define EADC_DAT5_OV_Msk (0x1ul << EADC_DAT5_OV_Pos) /*!< EADC_T::DAT5: OV Mask */ - -#define EADC_DAT5_VALID_Pos (17) /*!< EADC_T::DAT5: VALID Position */ -#define EADC_DAT5_VALID_Msk (0x1ul << EADC_DAT5_VALID_Pos) /*!< EADC_T::DAT5: VALID Mask */ - -#define EADC_DAT6_RESULT_Pos (0) /*!< EADC_T::DAT6: RESULT Position */ -#define EADC_DAT6_RESULT_Msk (0xfffful << EADC_DAT6_RESULT_Pos) /*!< EADC_T::DAT6: RESULT Mask */ - -#define EADC_DAT6_OV_Pos (16) /*!< EADC_T::DAT6: OV Position */ -#define EADC_DAT6_OV_Msk (0x1ul << EADC_DAT6_OV_Pos) /*!< EADC_T::DAT6: OV Mask */ - -#define EADC_DAT6_VALID_Pos (17) /*!< EADC_T::DAT6: VALID Position */ -#define EADC_DAT6_VALID_Msk (0x1ul << EADC_DAT6_VALID_Pos) /*!< EADC_T::DAT6: VALID Mask */ - -#define EADC_DAT7_RESULT_Pos (0) /*!< EADC_T::DAT7: RESULT Position */ -#define EADC_DAT7_RESULT_Msk (0xfffful << EADC_DAT7_RESULT_Pos) /*!< EADC_T::DAT7: RESULT Mask */ - -#define EADC_DAT7_OV_Pos (16) /*!< EADC_T::DAT7: OV Position */ -#define EADC_DAT7_OV_Msk (0x1ul << EADC_DAT7_OV_Pos) /*!< EADC_T::DAT7: OV Mask */ - -#define EADC_DAT7_VALID_Pos (17) /*!< EADC_T::DAT7: VALID Position */ -#define EADC_DAT7_VALID_Msk (0x1ul << EADC_DAT7_VALID_Pos) /*!< EADC_T::DAT7: VALID Mask */ - -#define EADC_DAT8_RESULT_Pos (0) /*!< EADC_T::DAT8: RESULT Position */ -#define EADC_DAT8_RESULT_Msk (0xfffful << EADC_DAT8_RESULT_Pos) /*!< EADC_T::DAT8: RESULT Mask */ - -#define EADC_DAT8_OV_Pos (16) /*!< EADC_T::DAT8: OV Position */ -#define EADC_DAT8_OV_Msk (0x1ul << EADC_DAT8_OV_Pos) /*!< EADC_T::DAT8: OV Mask */ - -#define EADC_DAT8_VALID_Pos (17) /*!< EADC_T::DAT8: VALID Position */ -#define EADC_DAT8_VALID_Msk (0x1ul << EADC_DAT8_VALID_Pos) /*!< EADC_T::DAT8: VALID Mask */ - -#define EADC_DAT9_RESULT_Pos (0) /*!< EADC_T::DAT9: RESULT Position */ -#define EADC_DAT9_RESULT_Msk (0xfffful << EADC_DAT9_RESULT_Pos) /*!< EADC_T::DAT9: RESULT Mask */ - -#define EADC_DAT9_OV_Pos (16) /*!< EADC_T::DAT9: OV Position */ -#define EADC_DAT9_OV_Msk (0x1ul << EADC_DAT9_OV_Pos) /*!< EADC_T::DAT9: OV Mask */ - -#define EADC_DAT9_VALID_Pos (17) /*!< EADC_T::DAT9: VALID Position */ -#define EADC_DAT9_VALID_Msk (0x1ul << EADC_DAT9_VALID_Pos) /*!< EADC_T::DAT9: VALID Mask */ - -#define EADC_DAT10_RESULT_Pos (0) /*!< EADC_T::DAT10: RESULT Position */ -#define EADC_DAT10_RESULT_Msk (0xfffful << EADC_DAT10_RESULT_Pos) /*!< EADC_T::DAT10: RESULT Mask */ - -#define EADC_DAT10_OV_Pos (16) /*!< EADC_T::DAT10: OV Position */ -#define EADC_DAT10_OV_Msk (0x1ul << EADC_DAT10_OV_Pos) /*!< EADC_T::DAT10: OV Mask */ - -#define EADC_DAT10_VALID_Pos (17) /*!< EADC_T::DAT10: VALID Position */ -#define EADC_DAT10_VALID_Msk (0x1ul << EADC_DAT10_VALID_Pos) /*!< EADC_T::DAT10: VALID Mask */ - -#define EADC_DAT11_RESULT_Pos (0) /*!< EADC_T::DAT11: RESULT Position */ -#define EADC_DAT11_RESULT_Msk (0xfffful << EADC_DAT11_RESULT_Pos) /*!< EADC_T::DAT11: RESULT Mask */ - -#define EADC_DAT11_OV_Pos (16) /*!< EADC_T::DAT11: OV Position */ -#define EADC_DAT11_OV_Msk (0x1ul << EADC_DAT11_OV_Pos) /*!< EADC_T::DAT11: OV Mask */ - -#define EADC_DAT11_VALID_Pos (17) /*!< EADC_T::DAT11: VALID Position */ -#define EADC_DAT11_VALID_Msk (0x1ul << EADC_DAT11_VALID_Pos) /*!< EADC_T::DAT11: VALID Mask */ - -#define EADC_DAT12_RESULT_Pos (0) /*!< EADC_T::DAT12: RESULT Position */ -#define EADC_DAT12_RESULT_Msk (0xfffful << EADC_DAT12_RESULT_Pos) /*!< EADC_T::DAT12: RESULT Mask */ - -#define EADC_DAT12_OV_Pos (16) /*!< EADC_T::DAT12: OV Position */ -#define EADC_DAT12_OV_Msk (0x1ul << EADC_DAT12_OV_Pos) /*!< EADC_T::DAT12: OV Mask */ - -#define EADC_DAT12_VALID_Pos (17) /*!< EADC_T::DAT12: VALID Position */ -#define EADC_DAT12_VALID_Msk (0x1ul << EADC_DAT12_VALID_Pos) /*!< EADC_T::DAT12: VALID Mask */ - -#define EADC_DAT13_RESULT_Pos (0) /*!< EADC_T::DAT13: RESULT Position */ -#define EADC_DAT13_RESULT_Msk (0xfffful << EADC_DAT13_RESULT_Pos) /*!< EADC_T::DAT13: RESULT Mask */ - -#define EADC_DAT13_OV_Pos (16) /*!< EADC_T::DAT13: OV Position */ -#define EADC_DAT13_OV_Msk (0x1ul << EADC_DAT13_OV_Pos) /*!< EADC_T::DAT13: OV Mask */ - -#define EADC_DAT13_VALID_Pos (17) /*!< EADC_T::DAT13: VALID Position */ -#define EADC_DAT13_VALID_Msk (0x1ul << EADC_DAT13_VALID_Pos) /*!< EADC_T::DAT13: VALID Mask */ - -#define EADC_DAT14_RESULT_Pos (0) /*!< EADC_T::DAT14: RESULT Position */ -#define EADC_DAT14_RESULT_Msk (0xfffful << EADC_DAT14_RESULT_Pos) /*!< EADC_T::DAT14: RESULT Mask */ - -#define EADC_DAT14_OV_Pos (16) /*!< EADC_T::DAT14: OV Position */ -#define EADC_DAT14_OV_Msk (0x1ul << EADC_DAT14_OV_Pos) /*!< EADC_T::DAT14: OV Mask */ - -#define EADC_DAT14_VALID_Pos (17) /*!< EADC_T::DAT14: VALID Position */ -#define EADC_DAT14_VALID_Msk (0x1ul << EADC_DAT14_VALID_Pos) /*!< EADC_T::DAT14: VALID Mask */ - -#define EADC_DAT15_RESULT_Pos (0) /*!< EADC_T::DAT15: RESULT Position */ -#define EADC_DAT15_RESULT_Msk (0xfffful << EADC_DAT15_RESULT_Pos) /*!< EADC_T::DAT15: RESULT Mask */ - -#define EADC_DAT15_OV_Pos (16) /*!< EADC_T::DAT15: OV Position */ -#define EADC_DAT15_OV_Msk (0x1ul << EADC_DAT15_OV_Pos) /*!< EADC_T::DAT15: OV Mask */ - -#define EADC_DAT15_VALID_Pos (17) /*!< EADC_T::DAT15: VALID Position */ -#define EADC_DAT15_VALID_Msk (0x1ul << EADC_DAT15_VALID_Pos) /*!< EADC_T::DAT15: VALID Mask */ - -#define EADC_DAT16_RESULT_Pos (0) /*!< EADC_T::DAT16: RESULT Position */ -#define EADC_DAT16_RESULT_Msk (0xfffful << EADC_DAT16_RESULT_Pos) /*!< EADC_T::DAT16: RESULT Mask */ - -#define EADC_DAT16_OV_Pos (16) /*!< EADC_T::DAT16: OV Position */ -#define EADC_DAT16_OV_Msk (0x1ul << EADC_DAT16_OV_Pos) /*!< EADC_T::DAT16: OV Mask */ - -#define EADC_DAT16_VALID_Pos (17) /*!< EADC_T::DAT16: VALID Position */ -#define EADC_DAT16_VALID_Msk (0x1ul << EADC_DAT16_VALID_Pos) /*!< EADC_T::DAT16: VALID Mask */ - -#define EADC_DAT17_RESULT_Pos (0) /*!< EADC_T::DAT17: RESULT Position */ -#define EADC_DAT17_RESULT_Msk (0xfffful << EADC_DAT17_RESULT_Pos) /*!< EADC_T::DAT17: RESULT Mask */ - -#define EADC_DAT17_OV_Pos (16) /*!< EADC_T::DAT17: OV Position */ -#define EADC_DAT17_OV_Msk (0x1ul << EADC_DAT17_OV_Pos) /*!< EADC_T::DAT17: OV Mask */ - -#define EADC_DAT17_VALID_Pos (17) /*!< EADC_T::DAT17: VALID Position */ -#define EADC_DAT17_VALID_Msk (0x1ul << EADC_DAT17_VALID_Pos) /*!< EADC_T::DAT17: VALID Mask */ - -#define EADC_DAT18_RESULT_Pos (0) /*!< EADC_T::DAT18: RESULT Position */ -#define EADC_DAT18_RESULT_Msk (0xfffful << EADC_DAT18_RESULT_Pos) /*!< EADC_T::DAT18: RESULT Mask */ - -#define EADC_DAT18_OV_Pos (16) /*!< EADC_T::DAT18: OV Position */ -#define EADC_DAT18_OV_Msk (0x1ul << EADC_DAT18_OV_Pos) /*!< EADC_T::DAT18: OV Mask */ - -#define EADC_DAT18_VALID_Pos (17) /*!< EADC_T::DAT18: VALID Position */ -#define EADC_DAT18_VALID_Msk (0x1ul << EADC_DAT18_VALID_Pos) /*!< EADC_T::DAT18: VALID Mask */ - -#define EADC_CURDAT_CURDAT_Pos (0) /*!< EADC_T::CURDAT: CURDAT Position */ -#define EADC_CURDAT_CURDAT_Msk (0x7fffful << EADC_CURDAT_CURDAT_Pos) /*!< EADC_T::CURDAT: CURDAT Mask */ - -#define EADC_CTL_ADCEN_Pos (0) /*!< EADC_T::CTL: ADCEN Position */ -#define EADC_CTL_ADCEN_Msk (0x1ul << EADC_CTL_ADCEN_Pos) /*!< EADC_T::CTL: ADCEN Mask */ - -#define EADC_CTL_ADCRST_Pos (1) /*!< EADC_T::CTL: ADCRST Position */ -#define EADC_CTL_ADCRST_Msk (0x1ul << EADC_CTL_ADCRST_Pos) /*!< EADC_T::CTL: ADCRST Mask */ - -#define EADC_CTL_ADCIEN0_Pos (2) /*!< EADC_T::CTL: ADCIEN0 Position */ -#define EADC_CTL_ADCIEN0_Msk (0x1ul << EADC_CTL_ADCIEN0_Pos) /*!< EADC_T::CTL: ADCIEN0 Mask */ - -#define EADC_CTL_ADCIEN1_Pos (3) /*!< EADC_T::CTL: ADCIEN1 Position */ -#define EADC_CTL_ADCIEN1_Msk (0x1ul << EADC_CTL_ADCIEN1_Pos) /*!< EADC_T::CTL: ADCIEN1 Mask */ - -#define EADC_CTL_ADCIEN2_Pos (4) /*!< EADC_T::CTL: ADCIEN2 Position */ -#define EADC_CTL_ADCIEN2_Msk (0x1ul << EADC_CTL_ADCIEN2_Pos) /*!< EADC_T::CTL: ADCIEN2 Mask */ - -#define EADC_CTL_ADCIEN3_Pos (5) /*!< EADC_T::CTL: ADCIEN3 Position */ -#define EADC_CTL_ADCIEN3_Msk (0x1ul << EADC_CTL_ADCIEN3_Pos) /*!< EADC_T::CTL: ADCIEN3 Mask */ - -#define EADC_CTL_DIFFEN_Pos (8) /*!< EADC_T::CTL: DIFFEN Position */ -#define EADC_CTL_DIFFEN_Msk (0x1ul << EADC_CTL_DIFFEN_Pos) /*!< EADC_T::CTL: DIFFEN Mask */ - -#define EADC_CTL_DMOF_Pos (9) /*!< EADC_T::CTL: DMOF Position */ -#define EADC_CTL_DMOF_Msk (0x1ul << EADC_CTL_DMOF_Pos) /*!< EADC_T::CTL: DMOF Mask */ - -#define EADC_CTL_INTDELAY0_Pos (16) /*!< EADC_T::CTL: INTDELAY0 Position */ -#define EADC_CTL_INTDELAY0_Msk (0xful << EADC_CTL_INTDELAY0_Pos) /*!< EADC_T::CTL: INTDELAY0 Mask */ - -#define EADC_CTL_INTDELAY1_Pos (20) /*!< EADC_T::CTL: INTDELAY1 Position */ -#define EADC_CTL_INTDELAY1_Msk (0xful << EADC_CTL_INTDELAY1_Pos) /*!< EADC_T::CTL: INTDELAY1 Mask */ - -#define EADC_CTL_INTDELAY2_Pos (24) /*!< EADC_T::CTL: INTDELAY2 Position */ -#define EADC_CTL_INTDELAY2_Msk (0xful << EADC_CTL_INTDELAY2_Pos) /*!< EADC_T::CTL: INTDELAY2 Mask */ - -#define EADC_CTL_INTDELAY3_Pos (28) /*!< EADC_T::CTL: INTDELAY3 Position */ -#define EADC_CTL_INTDELAY3_Msk (0xful << EADC_CTL_INTDELAY3_Pos) /*!< EADC_T::CTL: INTDELAY3 Mask */ - -#define EADC_SWTRG_SWTRG_Pos (0) /*!< EADC_T::SWTRG: SWTRG Position */ -#define EADC_SWTRG_SWTRG_Msk (0x7fffful << EADC_SWTRG_SWTRG_Pos) /*!< EADC_T::SWTRG: SWTRG Mask */ - -#define EADC_PENDSTS_STPF_Pos (0) /*!< EADC_T::PENDSTS: STPF Position */ -#define EADC_PENDSTS_STPF_Msk (0x7fffful << EADC_PENDSTS_STPF_Pos) /*!< EADC_T::PENDSTS: STPF Mask */ - -#define EADC_OVSTS_SPOVF_Pos (0) /*!< EADC_T::OVSTS: SPOVF Position */ -#define EADC_OVSTS_SPOVF_Msk (0x7fffful << EADC_OVSTS_SPOVF_Pos) /*!< EADC_T::OVSTS: SPOVF Mask */ - -#define EADC_CTL1_RESSEL_Pos (4) /*!< EADC_T::CTL1: RESSEL Position */ -#define EADC_CTL1_RESSEL_Msk (0x3ul << EADC_CTL1_RESSEL_Pos) /*!< EADC_T::CTL1: RESSEL Mask */ - -#define EADC_CTL1_CMP0TRG_Pos (20) /*!< EADC_T::CTL1: CMP0TRG Position */ -#define EADC_CTL1_CMP0TRG_Msk (0x1ul << EADC_CTL1_CMP0TRG_Pos) /*!< EADC_T::CTL1: CMP0TRG Mask */ - -#define EADC_CTL1_CMP1TRG_Pos (21) /*!< EADC_T::CTL1: CMP1TRG Position */ -#define EADC_CTL1_CMP1TRG_Msk (0x1ul << EADC_CTL1_CMP1TRG_Pos) /*!< EADC_T::CTL1: CMP1TRG Mask */ - -#define EADC_CTL1_CMP2TRG_Pos (22) /*!< EADC_T::CTL1: CMP2TRG Position */ -#define EADC_CTL1_CMP2TRG_Msk (0x1ul << EADC_CTL1_CMP2TRG_Pos) /*!< EADC_T::CTL1: CMP2TRG Mask */ - -#define EADC_CTL1_CMP3TRG_Pos (23) /*!< EADC_T::CTL1: CMP3TRG Position */ -#define EADC_CTL1_CMP3TRG_Msk (0x1ul << EADC_CTL1_CMP3TRG_Pos) /*!< EADC_T::CTL1: CMP3TRG Mask */ - -#define EADC_SCTL_CHSEL_Pos (0) /*!< EADC_T::SCTL: CHSEL Position */ -#define EADC_SCTL_CHSEL_Msk (0x1ful << EADC_SCTL_CHSEL_Pos) /*!< EADC_T::SCTL: CHSEL Mask */ - -#define EADC_SCTL_INTPOS_Pos (5) /*!< EADC_T::SCTL: INTPOS Position */ -#define EADC_SCTL_INTPOS_Msk (0x1ul << EADC_SCTL_INTPOS_Pos) /*!< EADC_T::SCTL: INTPOS Mask */ - -#define EADC_SCTL_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL: TRGDLYDIV Position */ -#define EADC_SCTL_TRGDLYDIV_Msk (0x3ul << EADC_SCTL_TRGDLYDIV_Pos) /*!< EADC_T::SCTL: TRGDLYDIV Mask */ - -#define EADC_SCTL_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL: TRGDLYCNT Position */ -#define EADC_SCTL_TRGDLYCNT_Msk (0xfful << EADC_SCTL_TRGDLYCNT_Pos) /*!< EADC_T::SCTL: TRGDLYCNT Mask */ - -#define EADC_SCTL_TRGSEL_Pos (16) /*!< EADC_T::SCTL: TRGSEL Position */ -#define EADC_SCTL_TRGSEL_Msk (0x1ful << EADC_SCTL_TRGSEL_Pos) /*!< EADC_T::SCTL: TRGSEL Mask */ - -#define EADC_SCTL_EXTREN_Pos (21) /*!< EADC_T::SCTL: EXTREN Position */ -#define EADC_SCTL_EXTREN_Msk (0x1ul << EADC_SCTL_EXTREN_Pos) /*!< EADC_T::SCTL: EXTREN Mask */ - -#define EADC_SCTL_EXTFEN_Pos (22) /*!< EADC_T::SCTL: EXTFEN Position */ -#define EADC_SCTL_EXTFEN_Msk (0x1ul << EADC_SCTL_EXTFEN_Pos) /*!< EADC_T::SCTL: EXTFEN Mask */ - -#define EADC_SCTL_DBMEN_Pos (23) /*!< EADC_T::SCTL: DBMEN Position */ -#define EADC_SCTL_DBMEN_Msk (0x1ul << EADC_SCTL_DBMEN_Pos) /*!< EADC_T::SCTL: DBMEN Mask */ - -#define EADC_SCTL_EXTSMPT_Pos (24) /*!< EADC_T::SCTL: EXTSMPT Position */ -#define EADC_SCTL_EXTSMPT_Msk (0xfful << EADC_SCTL_EXTSMPT_Pos) /*!< EADC_T::SCTL: EXTSMPT Mask */ - -#define EADC_SCTL0_CHSEL_Pos (0) /*!< EADC_T::SCTL0: CHSEL Position */ -#define EADC_SCTL0_CHSEL_Msk (0x1ful << EADC_SCTL0_CHSEL_Pos) /*!< EADC_T::SCTL0: CHSEL Mask */ - -#define EADC_SCTL0_INTPOS_Pos (5) /*!< EADC_T::SCTL0: INTPOS Position */ -#define EADC_SCTL0_INTPOS_Msk (0x1ul << EADC_SCTL0_INTPOS_Pos) /*!< EADC_T::SCTL0: INTPOS Mask */ - -#define EADC_SCTL0_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL0: TRGDLYDIV Position */ -#define EADC_SCTL0_TRGDLYDIV_Msk (0x3ul << EADC_SCTL0_TRGDLYDIV_Pos) /*!< EADC_T::SCTL0: TRGDLYDIV Mask */ - -#define EADC_SCTL0_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL0: TRGDLYCNT Position */ -#define EADC_SCTL0_TRGDLYCNT_Msk (0xfful << EADC_SCTL0_TRGDLYCNT_Pos) /*!< EADC_T::SCTL0: TRGDLYCNT Mask */ - -#define EADC_SCTL0_TRGSEL_Pos (16) /*!< EADC_T::SCTL0: TRGSEL Position */ -#define EADC_SCTL0_TRGSEL_Msk (0x1ful << EADC_SCTL0_TRGSEL_Pos) /*!< EADC_T::SCTL0: TRGSEL Mask */ - -#define EADC_SCTL0_EXTREN_Pos (21) /*!< EADC_T::SCTL0: EXTREN Position */ -#define EADC_SCTL0_EXTREN_Msk (0x1ul << EADC_SCTL0_EXTREN_Pos) /*!< EADC_T::SCTL0: EXTREN Mask */ - -#define EADC_SCTL0_EXTFEN_Pos (22) /*!< EADC_T::SCTL0: EXTFEN Position */ -#define EADC_SCTL0_EXTFEN_Msk (0x1ul << EADC_SCTL0_EXTFEN_Pos) /*!< EADC_T::SCTL0: EXTFEN Mask */ - -#define EADC_SCTL0_DBMEN_Pos (23) /*!< EADC_T::SCTL0: DBMEN Position */ -#define EADC_SCTL0_DBMEN_Msk (0x1ul << EADC_SCTL0_DBMEN_Pos) /*!< EADC_T::SCTL0: DBMEN Mask */ - -#define EADC_SCTL0_EXTSMPT_Pos (24) /*!< EADC_T::SCTL0: EXTSMPT Position */ -#define EADC_SCTL0_EXTSMPT_Msk (0xfful << EADC_SCTL0_EXTSMPT_Pos) /*!< EADC_T::SCTL0: EXTSMPT Mask */ - -#define EADC_SCTL1_CHSEL_Pos (0) /*!< EADC_T::SCTL1: CHSEL Position */ -#define EADC_SCTL1_CHSEL_Msk (0x1ful << EADC_SCTL1_CHSEL_Pos) /*!< EADC_T::SCTL1: CHSEL Mask */ - -#define EADC_SCTL1_INTPOS_Pos (5) /*!< EADC_T::SCTL1: INTPOS Position */ -#define EADC_SCTL1_INTPOS_Msk (0x1ul << EADC_SCTL1_INTPOS_Pos) /*!< EADC_T::SCTL1: INTPOS Mask */ - -#define EADC_SCTL1_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL1: TRGDLYDIV Position */ -#define EADC_SCTL1_TRGDLYDIV_Msk (0x3ul << EADC_SCTL1_TRGDLYDIV_Pos) /*!< EADC_T::SCTL1: TRGDLYDIV Mask */ - -#define EADC_SCTL1_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL1: TRGDLYCNT Position */ -#define EADC_SCTL1_TRGDLYCNT_Msk (0xfful << EADC_SCTL1_TRGDLYCNT_Pos) /*!< EADC_T::SCTL1: TRGDLYCNT Mask */ - -#define EADC_SCTL1_TRGSEL_Pos (16) /*!< EADC_T::SCTL1: TRGSEL Position */ -#define EADC_SCTL1_TRGSEL_Msk (0x1ful << EADC_SCTL1_TRGSEL_Pos) /*!< EADC_T::SCTL1: TRGSEL Mask */ - -#define EADC_SCTL1_EXTREN_Pos (21) /*!< EADC_T::SCTL1: EXTREN Position */ -#define EADC_SCTL1_EXTREN_Msk (0x1ul << EADC_SCTL1_EXTREN_Pos) /*!< EADC_T::SCTL1: EXTREN Mask */ - -#define EADC_SCTL1_EXTFEN_Pos (22) /*!< EADC_T::SCTL1: EXTFEN Position */ -#define EADC_SCTL1_EXTFEN_Msk (0x1ul << EADC_SCTL1_EXTFEN_Pos) /*!< EADC_T::SCTL1: EXTFEN Mask */ - -#define EADC_SCTL1_DBMEN_Pos (23) /*!< EADC_T::SCTL1: DBMEN Position */ -#define EADC_SCTL1_DBMEN_Msk (0x1ul << EADC_SCTL1_DBMEN_Pos) /*!< EADC_T::SCTL1: DBMEN Mask */ - -#define EADC_SCTL1_EXTSMPT_Pos (24) /*!< EADC_T::SCTL1: EXTSMPT Position */ -#define EADC_SCTL1_EXTSMPT_Msk (0xfful << EADC_SCTL1_EXTSMPT_Pos) /*!< EADC_T::SCTL1: EXTSMPT Mask */ - -#define EADC_SCTL2_CHSEL_Pos (0) /*!< EADC_T::SCTL2: CHSEL Position */ -#define EADC_SCTL2_CHSEL_Msk (0x1ful << EADC_SCTL2_CHSEL_Pos) /*!< EADC_T::SCTL2: CHSEL Mask */ - -#define EADC_SCTL2_INTPOS_Pos (5) /*!< EADC_T::SCTL2: INTPOS Position */ -#define EADC_SCTL2_INTPOS_Msk (0x1ul << EADC_SCTL2_INTPOS_Pos) /*!< EADC_T::SCTL2: INTPOS Mask */ - -#define EADC_SCTL2_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL2: TRGDLYDIV Position */ -#define EADC_SCTL2_TRGDLYDIV_Msk (0x3ul << EADC_SCTL2_TRGDLYDIV_Pos) /*!< EADC_T::SCTL2: TRGDLYDIV Mask */ - -#define EADC_SCTL2_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL2: TRGDLYCNT Position */ -#define EADC_SCTL2_TRGDLYCNT_Msk (0xfful << EADC_SCTL2_TRGDLYCNT_Pos) /*!< EADC_T::SCTL2: TRGDLYCNT Mask */ - -#define EADC_SCTL2_TRGSEL_Pos (16) /*!< EADC_T::SCTL2: TRGSEL Position */ -#define EADC_SCTL2_TRGSEL_Msk (0x1ful << EADC_SCTL2_TRGSEL_Pos) /*!< EADC_T::SCTL2: TRGSEL Mask */ - -#define EADC_SCTL2_EXTREN_Pos (21) /*!< EADC_T::SCTL2: EXTREN Position */ -#define EADC_SCTL2_EXTREN_Msk (0x1ul << EADC_SCTL2_EXTREN_Pos) /*!< EADC_T::SCTL2: EXTREN Mask */ - -#define EADC_SCTL2_EXTFEN_Pos (22) /*!< EADC_T::SCTL2: EXTFEN Position */ -#define EADC_SCTL2_EXTFEN_Msk (0x1ul << EADC_SCTL2_EXTFEN_Pos) /*!< EADC_T::SCTL2: EXTFEN Mask */ - -#define EADC_SCTL2_DBMEN_Pos (23) /*!< EADC_T::SCTL2: DBMEN Position */ -#define EADC_SCTL2_DBMEN_Msk (0x1ul << EADC_SCTL2_DBMEN_Pos) /*!< EADC_T::SCTL2: DBMEN Mask */ - -#define EADC_SCTL2_EXTSMPT_Pos (24) /*!< EADC_T::SCTL2: EXTSMPT Position */ -#define EADC_SCTL2_EXTSMPT_Msk (0xfful << EADC_SCTL2_EXTSMPT_Pos) /*!< EADC_T::SCTL2: EXTSMPT Mask */ - -#define EADC_SCTL3_CHSEL_Pos (0) /*!< EADC_T::SCTL3: CHSEL Position */ -#define EADC_SCTL3_CHSEL_Msk (0x1ful << EADC_SCTL3_CHSEL_Pos) /*!< EADC_T::SCTL3: CHSEL Mask */ - -#define EADC_SCTL3_INTPOS_Pos (5) /*!< EADC_T::SCTL3: INTPOS Position */ -#define EADC_SCTL3_INTPOS_Msk (0x1ul << EADC_SCTL3_INTPOS_Pos) /*!< EADC_T::SCTL3: INTPOS Mask */ - -#define EADC_SCTL3_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL3: TRGDLYDIV Position */ -#define EADC_SCTL3_TRGDLYDIV_Msk (0x3ul << EADC_SCTL3_TRGDLYDIV_Pos) /*!< EADC_T::SCTL3: TRGDLYDIV Mask */ - -#define EADC_SCTL3_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL3: TRGDLYCNT Position */ -#define EADC_SCTL3_TRGDLYCNT_Msk (0xfful << EADC_SCTL3_TRGDLYCNT_Pos) /*!< EADC_T::SCTL3: TRGDLYCNT Mask */ - -#define EADC_SCTL3_TRGSEL_Pos (16) /*!< EADC_T::SCTL3: TRGSEL Position */ -#define EADC_SCTL3_TRGSEL_Msk (0x1ful << EADC_SCTL3_TRGSEL_Pos) /*!< EADC_T::SCTL3: TRGSEL Mask */ - -#define EADC_SCTL3_EXTREN_Pos (21) /*!< EADC_T::SCTL3: EXTREN Position */ -#define EADC_SCTL3_EXTREN_Msk (0x1ul << EADC_SCTL3_EXTREN_Pos) /*!< EADC_T::SCTL3: EXTREN Mask */ - -#define EADC_SCTL3_EXTFEN_Pos (22) /*!< EADC_T::SCTL3: EXTFEN Position */ -#define EADC_SCTL3_EXTFEN_Msk (0x1ul << EADC_SCTL3_EXTFEN_Pos) /*!< EADC_T::SCTL3: EXTFEN Mask */ - -#define EADC_SCTL3_DBMEN_Pos (23) /*!< EADC_T::SCTL3: DBMEN Position */ -#define EADC_SCTL3_DBMEN_Msk (0x1ul << EADC_SCTL3_DBMEN_Pos) /*!< EADC_T::SCTL3: DBMEN Mask */ - -#define EADC_SCTL3_EXTSMPT_Pos (24) /*!< EADC_T::SCTL3: EXTSMPT Position */ -#define EADC_SCTL3_EXTSMPT_Msk (0xfful << EADC_SCTL3_EXTSMPT_Pos) /*!< EADC_T::SCTL3: EXTSMPT Mask */ - -#define EADC_SCTL4_CHSEL_Pos (0) /*!< EADC_T::SCTL4: CHSEL Position */ -#define EADC_SCTL4_CHSEL_Msk (0x1ful << EADC_SCTL4_CHSEL_Pos) /*!< EADC_T::SCTL4: CHSEL Mask */ - -#define EADC_SCTL4_INTPOS_Pos (5) /*!< EADC_T::SCTL4: INTPOS Position */ -#define EADC_SCTL4_INTPOS_Msk (0x1ul << EADC_SCTL4_INTPOS_Pos) /*!< EADC_T::SCTL4: INTPOS Mask */ - -#define EADC_SCTL4_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL4: TRGDLYDIV Position */ -#define EADC_SCTL4_TRGDLYDIV_Msk (0x3ul << EADC_SCTL4_TRGDLYDIV_Pos) /*!< EADC_T::SCTL4: TRGDLYDIV Mask */ - -#define EADC_SCTL4_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL4: TRGDLYCNT Position */ -#define EADC_SCTL4_TRGDLYCNT_Msk (0xfful << EADC_SCTL4_TRGDLYCNT_Pos) /*!< EADC_T::SCTL4: TRGDLYCNT Mask */ - -#define EADC_SCTL4_TRGSEL_Pos (16) /*!< EADC_T::SCTL4: TRGSEL Position */ -#define EADC_SCTL4_TRGSEL_Msk (0x1ful << EADC_SCTL4_TRGSEL_Pos) /*!< EADC_T::SCTL4: TRGSEL Mask */ - -#define EADC_SCTL4_EXTREN_Pos (21) /*!< EADC_T::SCTL4: EXTREN Position */ -#define EADC_SCTL4_EXTREN_Msk (0x1ul << EADC_SCTL4_EXTREN_Pos) /*!< EADC_T::SCTL4: EXTREN Mask */ - -#define EADC_SCTL4_EXTFEN_Pos (22) /*!< EADC_T::SCTL4: EXTFEN Position */ -#define EADC_SCTL4_EXTFEN_Msk (0x1ul << EADC_SCTL4_EXTFEN_Pos) /*!< EADC_T::SCTL4: EXTFEN Mask */ - -#define EADC_SCTL4_EXTSMPT_Pos (24) /*!< EADC_T::SCTL4: EXTSMPT Position */ -#define EADC_SCTL4_EXTSMPT_Msk (0xfful << EADC_SCTL4_EXTSMPT_Pos) /*!< EADC_T::SCTL4: EXTSMPT Mask */ - -#define EADC_SCTL5_CHSEL_Pos (0) /*!< EADC_T::SCTL5: CHSEL Position */ -#define EADC_SCTL5_CHSEL_Msk (0x1ful << EADC_SCTL5_CHSEL_Pos) /*!< EADC_T::SCTL5: CHSEL Mask */ - -#define EADC_SCTL5_INTPOS_Pos (5) /*!< EADC_T::SCTL5: INTPOS Position */ -#define EADC_SCTL5_INTPOS_Msk (0x1ul << EADC_SCTL5_INTPOS_Pos) /*!< EADC_T::SCTL5: INTPOS Mask */ - -#define EADC_SCTL5_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL5: TRGDLYDIV Position */ -#define EADC_SCTL5_TRGDLYDIV_Msk (0x3ul << EADC_SCTL5_TRGDLYDIV_Pos) /*!< EADC_T::SCTL5: TRGDLYDIV Mask */ - -#define EADC_SCTL5_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL5: TRGDLYCNT Position */ -#define EADC_SCTL5_TRGDLYCNT_Msk (0xfful << EADC_SCTL5_TRGDLYCNT_Pos) /*!< EADC_T::SCTL5: TRGDLYCNT Mask */ - -#define EADC_SCTL5_TRGSEL_Pos (16) /*!< EADC_T::SCTL5: TRGSEL Position */ -#define EADC_SCTL5_TRGSEL_Msk (0x1ful << EADC_SCTL5_TRGSEL_Pos) /*!< EADC_T::SCTL5: TRGSEL Mask */ - -#define EADC_SCTL5_EXTREN_Pos (21) /*!< EADC_T::SCTL5: EXTREN Position */ -#define EADC_SCTL5_EXTREN_Msk (0x1ul << EADC_SCTL5_EXTREN_Pos) /*!< EADC_T::SCTL5: EXTREN Mask */ - -#define EADC_SCTL5_EXTFEN_Pos (22) /*!< EADC_T::SCTL5: EXTFEN Position */ -#define EADC_SCTL5_EXTFEN_Msk (0x1ul << EADC_SCTL5_EXTFEN_Pos) /*!< EADC_T::SCTL5: EXTFEN Mask */ - -#define EADC_SCTL5_EXTSMPT_Pos (24) /*!< EADC_T::SCTL5: EXTSMPT Position */ -#define EADC_SCTL5_EXTSMPT_Msk (0xfful << EADC_SCTL5_EXTSMPT_Pos) /*!< EADC_T::SCTL5: EXTSMPT Mask */ - -#define EADC_SCTL6_CHSEL_Pos (0) /*!< EADC_T::SCTL6: CHSEL Position */ -#define EADC_SCTL6_CHSEL_Msk (0x1ful << EADC_SCTL6_CHSEL_Pos) /*!< EADC_T::SCTL6: CHSEL Mask */ - -#define EADC_SCTL6_INTPOS_Pos (5) /*!< EADC_T::SCTL6: INTPOS Position */ -#define EADC_SCTL6_INTPOS_Msk (0x1ul << EADC_SCTL6_INTPOS_Pos) /*!< EADC_T::SCTL6: INTPOS Mask */ - -#define EADC_SCTL6_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL6: TRGDLYDIV Position */ -#define EADC_SCTL6_TRGDLYDIV_Msk (0x3ul << EADC_SCTL6_TRGDLYDIV_Pos) /*!< EADC_T::SCTL6: TRGDLYDIV Mask */ - -#define EADC_SCTL6_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL6: TRGDLYCNT Position */ -#define EADC_SCTL6_TRGDLYCNT_Msk (0xfful << EADC_SCTL6_TRGDLYCNT_Pos) /*!< EADC_T::SCTL6: TRGDLYCNT Mask */ - -#define EADC_SCTL6_TRGSEL_Pos (16) /*!< EADC_T::SCTL6: TRGSEL Position */ -#define EADC_SCTL6_TRGSEL_Msk (0x1ful << EADC_SCTL6_TRGSEL_Pos) /*!< EADC_T::SCTL6: TRGSEL Mask */ - -#define EADC_SCTL6_EXTREN_Pos (21) /*!< EADC_T::SCTL6: EXTREN Position */ -#define EADC_SCTL6_EXTREN_Msk (0x1ul << EADC_SCTL6_EXTREN_Pos) /*!< EADC_T::SCTL6: EXTREN Mask */ - -#define EADC_SCTL6_EXTFEN_Pos (22) /*!< EADC_T::SCTL6: EXTFEN Position */ -#define EADC_SCTL6_EXTFEN_Msk (0x1ul << EADC_SCTL6_EXTFEN_Pos) /*!< EADC_T::SCTL6: EXTFEN Mask */ - -#define EADC_SCTL6_EXTSMPT_Pos (24) /*!< EADC_T::SCTL6: EXTSMPT Position */ -#define EADC_SCTL6_EXTSMPT_Msk (0xfful << EADC_SCTL6_EXTSMPT_Pos) /*!< EADC_T::SCTL6: EXTSMPT Mask */ - -#define EADC_SCTL7_CHSEL_Pos (0) /*!< EADC_T::SCTL7: CHSEL Position */ -#define EADC_SCTL7_CHSEL_Msk (0x1ful << EADC_SCTL7_CHSEL_Pos) /*!< EADC_T::SCTL7: CHSEL Mask */ - -#define EADC_SCTL7_INTPOS_Pos (5) /*!< EADC_T::SCTL7: INTPOS Position */ -#define EADC_SCTL7_INTPOS_Msk (0x1ul << EADC_SCTL7_INTPOS_Pos) /*!< EADC_T::SCTL7: INTPOS Mask */ - -#define EADC_SCTL7_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL7: TRGDLYDIV Position */ -#define EADC_SCTL7_TRGDLYDIV_Msk (0x3ul << EADC_SCTL7_TRGDLYDIV_Pos) /*!< EADC_T::SCTL7: TRGDLYDIV Mask */ - -#define EADC_SCTL7_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL7: TRGDLYCNT Position */ -#define EADC_SCTL7_TRGDLYCNT_Msk (0xfful << EADC_SCTL7_TRGDLYCNT_Pos) /*!< EADC_T::SCTL7: TRGDLYCNT Mask */ - -#define EADC_SCTL7_TRGSEL_Pos (16) /*!< EADC_T::SCTL7: TRGSEL Position */ -#define EADC_SCTL7_TRGSEL_Msk (0x1ful << EADC_SCTL7_TRGSEL_Pos) /*!< EADC_T::SCTL7: TRGSEL Mask */ - -#define EADC_SCTL7_EXTREN_Pos (21) /*!< EADC_T::SCTL7: EXTREN Position */ -#define EADC_SCTL7_EXTREN_Msk (0x1ul << EADC_SCTL7_EXTREN_Pos) /*!< EADC_T::SCTL7: EXTREN Mask */ - -#define EADC_SCTL7_EXTFEN_Pos (22) /*!< EADC_T::SCTL7: EXTFEN Position */ -#define EADC_SCTL7_EXTFEN_Msk (0x1ul << EADC_SCTL7_EXTFEN_Pos) /*!< EADC_T::SCTL7: EXTFEN Mask */ - -#define EADC_SCTL7_EXTSMPT_Pos (24) /*!< EADC_T::SCTL7: EXTSMPT Position */ -#define EADC_SCTL7_EXTSMPT_Msk (0xfful << EADC_SCTL7_EXTSMPT_Pos) /*!< EADC_T::SCTL7: EXTSMPT Mask */ - -#define EADC_SCTL8_CHSEL_Pos (0) /*!< EADC_T::SCTL8: CHSEL Position */ -#define EADC_SCTL8_CHSEL_Msk (0x1ful << EADC_SCTL8_CHSEL_Pos) /*!< EADC_T::SCTL8: CHSEL Mask */ - -#define EADC_SCTL8_INTPOS_Pos (5) /*!< EADC_T::SCTL8: INTPOS Position */ -#define EADC_SCTL8_INTPOS_Msk (0x1ul << EADC_SCTL8_INTPOS_Pos) /*!< EADC_T::SCTL8: INTPOS Mask */ - -#define EADC_SCTL8_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL8: TRGDLYDIV Position */ -#define EADC_SCTL8_TRGDLYDIV_Msk (0x3ul << EADC_SCTL8_TRGDLYDIV_Pos) /*!< EADC_T::SCTL8: TRGDLYDIV Mask */ - -#define EADC_SCTL8_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL8: TRGDLYCNT Position */ -#define EADC_SCTL8_TRGDLYCNT_Msk (0xfful << EADC_SCTL8_TRGDLYCNT_Pos) /*!< EADC_T::SCTL8: TRGDLYCNT Mask */ - -#define EADC_SCTL8_TRGSEL_Pos (16) /*!< EADC_T::SCTL8: TRGSEL Position */ -#define EADC_SCTL8_TRGSEL_Msk (0x1ful << EADC_SCTL8_TRGSEL_Pos) /*!< EADC_T::SCTL8: TRGSEL Mask */ - -#define EADC_SCTL8_EXTREN_Pos (21) /*!< EADC_T::SCTL8: EXTREN Position */ -#define EADC_SCTL8_EXTREN_Msk (0x1ul << EADC_SCTL8_EXTREN_Pos) /*!< EADC_T::SCTL8: EXTREN Mask */ - -#define EADC_SCTL8_EXTFEN_Pos (22) /*!< EADC_T::SCTL8: EXTFEN Position */ -#define EADC_SCTL8_EXTFEN_Msk (0x1ul << EADC_SCTL8_EXTFEN_Pos) /*!< EADC_T::SCTL8: EXTFEN Mask */ - -#define EADC_SCTL8_EXTSMPT_Pos (24) /*!< EADC_T::SCTL8: EXTSMPT Position */ -#define EADC_SCTL8_EXTSMPT_Msk (0xfful << EADC_SCTL8_EXTSMPT_Pos) /*!< EADC_T::SCTL8: EXTSMPT Mask */ - -#define EADC_SCTL9_CHSEL_Pos (0) /*!< EADC_T::SCTL9: CHSEL Position */ -#define EADC_SCTL9_CHSEL_Msk (0x1ful << EADC_SCTL9_CHSEL_Pos) /*!< EADC_T::SCTL9: CHSEL Mask */ - -#define EADC_SCTL9_INTPOS_Pos (5) /*!< EADC_T::SCTL9: INTPOS Position */ -#define EADC_SCTL9_INTPOS_Msk (0x1ul << EADC_SCTL9_INTPOS_Pos) /*!< EADC_T::SCTL9: INTPOS Mask */ - -#define EADC_SCTL9_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL9: TRGDLYDIV Position */ -#define EADC_SCTL9_TRGDLYDIV_Msk (0x3ul << EADC_SCTL9_TRGDLYDIV_Pos) /*!< EADC_T::SCTL9: TRGDLYDIV Mask */ - -#define EADC_SCTL9_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL9: TRGDLYCNT Position */ -#define EADC_SCTL9_TRGDLYCNT_Msk (0xfful << EADC_SCTL9_TRGDLYCNT_Pos) /*!< EADC_T::SCTL9: TRGDLYCNT Mask */ - -#define EADC_SCTL9_TRGSEL_Pos (16) /*!< EADC_T::SCTL9: TRGSEL Position */ -#define EADC_SCTL9_TRGSEL_Msk (0x1ful << EADC_SCTL9_TRGSEL_Pos) /*!< EADC_T::SCTL9: TRGSEL Mask */ - -#define EADC_SCTL9_EXTREN_Pos (21) /*!< EADC_T::SCTL9: EXTREN Position */ -#define EADC_SCTL9_EXTREN_Msk (0x1ul << EADC_SCTL9_EXTREN_Pos) /*!< EADC_T::SCTL9: EXTREN Mask */ - -#define EADC_SCTL9_EXTFEN_Pos (22) /*!< EADC_T::SCTL9: EXTFEN Position */ -#define EADC_SCTL9_EXTFEN_Msk (0x1ul << EADC_SCTL9_EXTFEN_Pos) /*!< EADC_T::SCTL9: EXTFEN Mask */ - -#define EADC_SCTL9_EXTSMPT_Pos (24) /*!< EADC_T::SCTL9: EXTSMPT Position */ -#define EADC_SCTL9_EXTSMPT_Msk (0xfful << EADC_SCTL9_EXTSMPT_Pos) /*!< EADC_T::SCTL9: EXTSMPT Mask */ - -#define EADC_SCTL10_CHSEL_Pos (0) /*!< EADC_T::SCTL10: CHSEL Position */ -#define EADC_SCTL10_CHSEL_Msk (0x1ful << EADC_SCTL10_CHSEL_Pos) /*!< EADC_T::SCTL10: CHSEL Mask */ - -#define EADC_SCTL10_INTPOS_Pos (5) /*!< EADC_T::SCTL10: INTPOS Position */ -#define EADC_SCTL10_INTPOS_Msk (0x1ul << EADC_SCTL10_INTPOS_Pos) /*!< EADC_T::SCTL10: INTPOS Mask */ - -#define EADC_SCTL10_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL10: TRGDLYDIV Position */ -#define EADC_SCTL10_TRGDLYDIV_Msk (0x3ul << EADC_SCTL10_TRGDLYDIV_Pos) /*!< EADC_T::SCTL10: TRGDLYDIV Mask */ - -#define EADC_SCTL10_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL10: TRGDLYCNT Position */ -#define EADC_SCTL10_TRGDLYCNT_Msk (0xfful << EADC_SCTL10_TRGDLYCNT_Pos) /*!< EADC_T::SCTL10: TRGDLYCNT Mask */ - -#define EADC_SCTL10_TRGSEL_Pos (16) /*!< EADC_T::SCTL10: TRGSEL Position */ -#define EADC_SCTL10_TRGSEL_Msk (0x1ful << EADC_SCTL10_TRGSEL_Pos) /*!< EADC_T::SCTL10: TRGSEL Mask */ - -#define EADC_SCTL10_EXTREN_Pos (21) /*!< EADC_T::SCTL10: EXTREN Position */ -#define EADC_SCTL10_EXTREN_Msk (0x1ul << EADC_SCTL10_EXTREN_Pos) /*!< EADC_T::SCTL10: EXTREN Mask */ - -#define EADC_SCTL10_EXTFEN_Pos (22) /*!< EADC_T::SCTL10: EXTFEN Position */ -#define EADC_SCTL10_EXTFEN_Msk (0x1ul << EADC_SCTL10_EXTFEN_Pos) /*!< EADC_T::SCTL10: EXTFEN Mask */ - -#define EADC_SCTL10_EXTSMPT_Pos (24) /*!< EADC_T::SCTL10: EXTSMPT Position */ -#define EADC_SCTL10_EXTSMPT_Msk (0xfful << EADC_SCTL10_EXTSMPT_Pos) /*!< EADC_T::SCTL10: EXTSMPT Mask */ - -#define EADC_SCTL11_CHSEL_Pos (0) /*!< EADC_T::SCTL11: CHSEL Position */ -#define EADC_SCTL11_CHSEL_Msk (0x1ful << EADC_SCTL11_CHSEL_Pos) /*!< EADC_T::SCTL11: CHSEL Mask */ - -#define EADC_SCTL11_INTPOS_Pos (5) /*!< EADC_T::SCTL11: INTPOS Position */ -#define EADC_SCTL11_INTPOS_Msk (0x1ul << EADC_SCTL11_INTPOS_Pos) /*!< EADC_T::SCTL11: INTPOS Mask */ - -#define EADC_SCTL11_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL11: TRGDLYDIV Position */ -#define EADC_SCTL11_TRGDLYDIV_Msk (0x3ul << EADC_SCTL11_TRGDLYDIV_Pos) /*!< EADC_T::SCTL11: TRGDLYDIV Mask */ - -#define EADC_SCTL11_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL11: TRGDLYCNT Position */ -#define EADC_SCTL11_TRGDLYCNT_Msk (0xfful << EADC_SCTL11_TRGDLYCNT_Pos) /*!< EADC_T::SCTL11: TRGDLYCNT Mask */ - -#define EADC_SCTL11_TRGSEL_Pos (16) /*!< EADC_T::SCTL11: TRGSEL Position */ -#define EADC_SCTL11_TRGSEL_Msk (0x1ful << EADC_SCTL11_TRGSEL_Pos) /*!< EADC_T::SCTL11: TRGSEL Mask */ - -#define EADC_SCTL11_EXTREN_Pos (21) /*!< EADC_T::SCTL11: EXTREN Position */ -#define EADC_SCTL11_EXTREN_Msk (0x1ul << EADC_SCTL11_EXTREN_Pos) /*!< EADC_T::SCTL11: EXTREN Mask */ - -#define EADC_SCTL11_EXTFEN_Pos (22) /*!< EADC_T::SCTL11: EXTFEN Position */ -#define EADC_SCTL11_EXTFEN_Msk (0x1ul << EADC_SCTL11_EXTFEN_Pos) /*!< EADC_T::SCTL11: EXTFEN Mask */ - -#define EADC_SCTL11_EXTSMPT_Pos (24) /*!< EADC_T::SCTL11: EXTSMPT Position */ -#define EADC_SCTL11_EXTSMPT_Msk (0xfful << EADC_SCTL11_EXTSMPT_Pos) /*!< EADC_T::SCTL11: EXTSMPT Mask */ - -#define EADC_SCTL12_CHSEL_Pos (0) /*!< EADC_T::SCTL12: CHSEL Position */ -#define EADC_SCTL12_CHSEL_Msk (0x1ful << EADC_SCTL12_CHSEL_Pos) /*!< EADC_T::SCTL12: CHSEL Mask */ - -#define EADC_SCTL12_INTPOS_Pos (5) /*!< EADC_T::SCTL12: INTPOS Position */ -#define EADC_SCTL12_INTPOS_Msk (0x1ul << EADC_SCTL12_INTPOS_Pos) /*!< EADC_T::SCTL12: INTPOS Mask */ - -#define EADC_SCTL12_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL12: TRGDLYDIV Position */ -#define EADC_SCTL12_TRGDLYDIV_Msk (0x3ul << EADC_SCTL12_TRGDLYDIV_Pos) /*!< EADC_T::SCTL12: TRGDLYDIV Mask */ - -#define EADC_SCTL12_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL12: TRGDLYCNT Position */ -#define EADC_SCTL12_TRGDLYCNT_Msk (0xfful << EADC_SCTL12_TRGDLYCNT_Pos) /*!< EADC_T::SCTL12: TRGDLYCNT Mask */ - -#define EADC_SCTL12_TRGSEL_Pos (16) /*!< EADC_T::SCTL12: TRGSEL Position */ -#define EADC_SCTL12_TRGSEL_Msk (0x1ful << EADC_SCTL12_TRGSEL_Pos) /*!< EADC_T::SCTL12: TRGSEL Mask */ - -#define EADC_SCTL12_EXTREN_Pos (21) /*!< EADC_T::SCTL12: EXTREN Position */ -#define EADC_SCTL12_EXTREN_Msk (0x1ul << EADC_SCTL12_EXTREN_Pos) /*!< EADC_T::SCTL12: EXTREN Mask */ - -#define EADC_SCTL12_EXTFEN_Pos (22) /*!< EADC_T::SCTL12: EXTFEN Position */ -#define EADC_SCTL12_EXTFEN_Msk (0x1ul << EADC_SCTL12_EXTFEN_Pos) /*!< EADC_T::SCTL12: EXTFEN Mask */ - -#define EADC_SCTL12_EXTSMPT_Pos (24) /*!< EADC_T::SCTL12: EXTSMPT Position */ -#define EADC_SCTL12_EXTSMPT_Msk (0xfful << EADC_SCTL12_EXTSMPT_Pos) /*!< EADC_T::SCTL12: EXTSMPT Mask */ - -#define EADC_SCTL13_CHSEL_Pos (0) /*!< EADC_T::SCTL13: CHSEL Position */ -#define EADC_SCTL13_CHSEL_Msk (0x1ful << EADC_SCTL13_CHSEL_Pos) /*!< EADC_T::SCTL13: CHSEL Mask */ - -#define EADC_SCTL13_INTPOS_Pos (5) /*!< EADC_T::SCTL13: INTPOS Position */ -#define EADC_SCTL13_INTPOS_Msk (0x1ul << EADC_SCTL13_INTPOS_Pos) /*!< EADC_T::SCTL13: INTPOS Mask */ - -#define EADC_SCTL13_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL13: TRGDLYDIV Position */ -#define EADC_SCTL13_TRGDLYDIV_Msk (0x3ul << EADC_SCTL13_TRGDLYDIV_Pos) /*!< EADC_T::SCTL13: TRGDLYDIV Mask */ - -#define EADC_SCTL13_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL13: TRGDLYCNT Position */ -#define EADC_SCTL13_TRGDLYCNT_Msk (0xfful << EADC_SCTL13_TRGDLYCNT_Pos) /*!< EADC_T::SCTL13: TRGDLYCNT Mask */ - -#define EADC_SCTL13_TRGSEL_Pos (16) /*!< EADC_T::SCTL13: TRGSEL Position */ -#define EADC_SCTL13_TRGSEL_Msk (0x1ful << EADC_SCTL13_TRGSEL_Pos) /*!< EADC_T::SCTL13: TRGSEL Mask */ - -#define EADC_SCTL13_EXTREN_Pos (21) /*!< EADC_T::SCTL13: EXTREN Position */ -#define EADC_SCTL13_EXTREN_Msk (0x1ul << EADC_SCTL13_EXTREN_Pos) /*!< EADC_T::SCTL13: EXTREN Mask */ - -#define EADC_SCTL13_EXTFEN_Pos (22) /*!< EADC_T::SCTL13: EXTFEN Position */ -#define EADC_SCTL13_EXTFEN_Msk (0x1ul << EADC_SCTL13_EXTFEN_Pos) /*!< EADC_T::SCTL13: EXTFEN Mask */ - -#define EADC_SCTL13_EXTSMPT_Pos (24) /*!< EADC_T::SCTL13: EXTSMPT Position */ -#define EADC_SCTL13_EXTSMPT_Msk (0xfful << EADC_SCTL13_EXTSMPT_Pos) /*!< EADC_T::SCTL13: EXTSMPT Mask */ - -#define EADC_SCTL14_CHSEL_Pos (0) /*!< EADC_T::SCTL14: CHSEL Position */ -#define EADC_SCTL14_CHSEL_Msk (0x1ful << EADC_SCTL14_CHSEL_Pos) /*!< EADC_T::SCTL14: CHSEL Mask */ - -#define EADC_SCTL14_INTPOS_Pos (5) /*!< EADC_T::SCTL14: INTPOS Position */ -#define EADC_SCTL14_INTPOS_Msk (0x1ul << EADC_SCTL14_INTPOS_Pos) /*!< EADC_T::SCTL14: INTPOS Mask */ - -#define EADC_SCTL14_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL14: TRGDLYDIV Position */ -#define EADC_SCTL14_TRGDLYDIV_Msk (0x3ul << EADC_SCTL14_TRGDLYDIV_Pos) /*!< EADC_T::SCTL14: TRGDLYDIV Mask */ - -#define EADC_SCTL14_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL14: TRGDLYCNT Position */ -#define EADC_SCTL14_TRGDLYCNT_Msk (0xfful << EADC_SCTL14_TRGDLYCNT_Pos) /*!< EADC_T::SCTL14: TRGDLYCNT Mask */ - -#define EADC_SCTL14_TRGSEL_Pos (16) /*!< EADC_T::SCTL14: TRGSEL Position */ -#define EADC_SCTL14_TRGSEL_Msk (0x1ful << EADC_SCTL14_TRGSEL_Pos) /*!< EADC_T::SCTL14: TRGSEL Mask */ - -#define EADC_SCTL14_EXTREN_Pos (21) /*!< EADC_T::SCTL14: EXTREN Position */ -#define EADC_SCTL14_EXTREN_Msk (0x1ul << EADC_SCTL14_EXTREN_Pos) /*!< EADC_T::SCTL14: EXTREN Mask */ - -#define EADC_SCTL14_EXTFEN_Pos (22) /*!< EADC_T::SCTL14: EXTFEN Position */ -#define EADC_SCTL14_EXTFEN_Msk (0x1ul << EADC_SCTL14_EXTFEN_Pos) /*!< EADC_T::SCTL14: EXTFEN Mask */ - -#define EADC_SCTL14_EXTSMPT_Pos (24) /*!< EADC_T::SCTL14: EXTSMPT Position */ -#define EADC_SCTL14_EXTSMPT_Msk (0xfful << EADC_SCTL14_EXTSMPT_Pos) /*!< EADC_T::SCTL14: EXTSMPT Mask */ - -#define EADC_SCTL15_CHSEL_Pos (0) /*!< EADC_T::SCTL15: CHSEL Position */ -#define EADC_SCTL15_CHSEL_Msk (0x1ful << EADC_SCTL15_CHSEL_Pos) /*!< EADC_T::SCTL15: CHSEL Mask */ - -#define EADC_SCTL15_INTPOS_Pos (5) /*!< EADC_T::SCTL15: INTPOS Position */ -#define EADC_SCTL15_INTPOS_Msk (0x1ul << EADC_SCTL15_INTPOS_Pos) /*!< EADC_T::SCTL15: INTPOS Mask */ - -#define EADC_SCTL15_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL15: TRGDLYDIV Position */ -#define EADC_SCTL15_TRGDLYDIV_Msk (0x3ul << EADC_SCTL15_TRGDLYDIV_Pos) /*!< EADC_T::SCTL15: TRGDLYDIV Mask */ - -#define EADC_SCTL15_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL15: TRGDLYCNT Position */ -#define EADC_SCTL15_TRGDLYCNT_Msk (0xfful << EADC_SCTL15_TRGDLYCNT_Pos) /*!< EADC_T::SCTL15: TRGDLYCNT Mask */ - -#define EADC_SCTL15_TRGSEL_Pos (16) /*!< EADC_T::SCTL15: TRGSEL Position */ -#define EADC_SCTL15_TRGSEL_Msk (0x1ful << EADC_SCTL15_TRGSEL_Pos) /*!< EADC_T::SCTL15: TRGSEL Mask */ - -#define EADC_SCTL15_EXTREN_Pos (21) /*!< EADC_T::SCTL15: EXTREN Position */ -#define EADC_SCTL15_EXTREN_Msk (0x1ul << EADC_SCTL15_EXTREN_Pos) /*!< EADC_T::SCTL15: EXTREN Mask */ - -#define EADC_SCTL15_EXTFEN_Pos (22) /*!< EADC_T::SCTL15: EXTFEN Position */ -#define EADC_SCTL15_EXTFEN_Msk (0x1ul << EADC_SCTL15_EXTFEN_Pos) /*!< EADC_T::SCTL15: EXTFEN Mask */ - -#define EADC_SCTL15_EXTSMPT_Pos (24) /*!< EADC_T::SCTL15: EXTSMPT Position */ -#define EADC_SCTL15_EXTSMPT_Msk (0xfful << EADC_SCTL15_EXTSMPT_Pos) /*!< EADC_T::SCTL15: EXTSMPT Mask */ - -#define EADC_SCTL16_EXTSMPT_Pos (24) /*!< EADC_T::SCTL16: EXTSMPT Position */ -#define EADC_SCTL16_EXTSMPT_Msk (0xfful << EADC_SCTL16_EXTSMPT_Pos) /*!< EADC_T::SCTL16: EXTSMPT Mask */ - -#define EADC_SCTL17_EXTSMPT_Pos (24) /*!< EADC_T::SCTL17: EXTSMPT Position */ -#define EADC_SCTL17_EXTSMPT_Msk (0xfful << EADC_SCTL17_EXTSMPT_Pos) /*!< EADC_T::SCTL17: EXTSMPT Mask */ - -#define EADC_SCTL18_EXTSMPT_Pos (24) /*!< EADC_T::SCTL18: EXTSMPT Position */ -#define EADC_SCTL18_EXTSMPT_Msk (0xfful << EADC_SCTL18_EXTSMPT_Pos) /*!< EADC_T::SCTL18: EXTSMPT Mask */ - -#define EADC_INTSRC0_SPLIE0_Pos (0) /*!< EADC_T::INTSRC0: SPLIE0 Position */ -#define EADC_INTSRC0_SPLIE0_Msk (0x1ul << EADC_INTSRC0_SPLIE0_Pos) /*!< EADC_T::INTSRC0: SPLIE0 Mask */ - -#define EADC_INTSRC0_SPLIE1_Pos (1) /*!< EADC_T::INTSRC0: SPLIE1 Position */ -#define EADC_INTSRC0_SPLIE1_Msk (0x1ul << EADC_INTSRC0_SPLIE1_Pos) /*!< EADC_T::INTSRC0: SPLIE1 Mask */ - -#define EADC_INTSRC0_SPLIE2_Pos (2) /*!< EADC_T::INTSRC0: SPLIE2 Position */ -#define EADC_INTSRC0_SPLIE2_Msk (0x1ul << EADC_INTSRC0_SPLIE2_Pos) /*!< EADC_T::INTSRC0: SPLIE2 Mask */ - -#define EADC_INTSRC0_SPLIE3_Pos (3) /*!< EADC_T::INTSRC0: SPLIE3 Position */ -#define EADC_INTSRC0_SPLIE3_Msk (0x1ul << EADC_INTSRC0_SPLIE3_Pos) /*!< EADC_T::INTSRC0: SPLIE3 Mask */ - -#define EADC_INTSRC0_SPLIE4_Pos (4) /*!< EADC_T::INTSRC0: SPLIE4 Position */ -#define EADC_INTSRC0_SPLIE4_Msk (0x1ul << EADC_INTSRC0_SPLIE4_Pos) /*!< EADC_T::INTSRC0: SPLIE4 Mask */ - -#define EADC_INTSRC0_SPLIE5_Pos (5) /*!< EADC_T::INTSRC0: SPLIE5 Position */ -#define EADC_INTSRC0_SPLIE5_Msk (0x1ul << EADC_INTSRC0_SPLIE5_Pos) /*!< EADC_T::INTSRC0: SPLIE5 Mask */ - -#define EADC_INTSRC0_SPLIE6_Pos (6) /*!< EADC_T::INTSRC0: SPLIE6 Position */ -#define EADC_INTSRC0_SPLIE6_Msk (0x1ul << EADC_INTSRC0_SPLIE6_Pos) /*!< EADC_T::INTSRC0: SPLIE6 Mask */ - -#define EADC_INTSRC0_SPLIE7_Pos (7) /*!< EADC_T::INTSRC0: SPLIE7 Position */ -#define EADC_INTSRC0_SPLIE7_Msk (0x1ul << EADC_INTSRC0_SPLIE7_Pos) /*!< EADC_T::INTSRC0: SPLIE7 Mask */ - -#define EADC_INTSRC0_SPLIE8_Pos (8) /*!< EADC_T::INTSRC0: SPLIE8 Position */ -#define EADC_INTSRC0_SPLIE8_Msk (0x1ul << EADC_INTSRC0_SPLIE8_Pos) /*!< EADC_T::INTSRC0: SPLIE8 Mask */ - -#define EADC_INTSRC0_SPLIE9_Pos (9) /*!< EADC_T::INTSRC0: SPLIE9 Position */ -#define EADC_INTSRC0_SPLIE9_Msk (0x1ul << EADC_INTSRC0_SPLIE9_Pos) /*!< EADC_T::INTSRC0: SPLIE9 Mask */ - -#define EADC_INTSRC0_SPLIE10_Pos (10) /*!< EADC_T::INTSRC0: SPLIE10 Position */ -#define EADC_INTSRC0_SPLIE10_Msk (0x1ul << EADC_INTSRC0_SPLIE10_Pos) /*!< EADC_T::INTSRC0: SPLIE10 Mask */ - -#define EADC_INTSRC0_SPLIE11_Pos (11) /*!< EADC_T::INTSRC0: SPLIE11 Position */ -#define EADC_INTSRC0_SPLIE11_Msk (0x1ul << EADC_INTSRC0_SPLIE11_Pos) /*!< EADC_T::INTSRC0: SPLIE11 Mask */ - -#define EADC_INTSRC0_SPLIE12_Pos (12) /*!< EADC_T::INTSRC0: SPLIE12 Position */ -#define EADC_INTSRC0_SPLIE12_Msk (0x1ul << EADC_INTSRC0_SPLIE12_Pos) /*!< EADC_T::INTSRC0: SPLIE12 Mask */ - -#define EADC_INTSRC0_SPLIE13_Pos (13) /*!< EADC_T::INTSRC0: SPLIE13 Position */ -#define EADC_INTSRC0_SPLIE13_Msk (0x1ul << EADC_INTSRC0_SPLIE13_Pos) /*!< EADC_T::INTSRC0: SPLIE13 Mask */ - -#define EADC_INTSRC0_SPLIE14_Pos (14) /*!< EADC_T::INTSRC0: SPLIE14 Position */ -#define EADC_INTSRC0_SPLIE14_Msk (0x1ul << EADC_INTSRC0_SPLIE14_Pos) /*!< EADC_T::INTSRC0: SPLIE14 Mask */ - -#define EADC_INTSRC0_SPLIE15_Pos (15) /*!< EADC_T::INTSRC0: SPLIE15 Position */ -#define EADC_INTSRC0_SPLIE15_Msk (0x1ul << EADC_INTSRC0_SPLIE15_Pos) /*!< EADC_T::INTSRC0: SPLIE15 Mask */ - -#define EADC_INTSRC0_SPLIE16_Pos (16) /*!< EADC_T::INTSRC0: SPLIE16 Position */ -#define EADC_INTSRC0_SPLIE16_Msk (0x1ul << EADC_INTSRC0_SPLIE16_Pos) /*!< EADC_T::INTSRC0: SPLIE16 Mask */ - -#define EADC_INTSRC0_SPLIE17_Pos (17) /*!< EADC_T::INTSRC0: SPLIE17 Position */ -#define EADC_INTSRC0_SPLIE17_Msk (0x1ul << EADC_INTSRC0_SPLIE17_Pos) /*!< EADC_T::INTSRC0: SPLIE17 Mask */ - -#define EADC_INTSRC0_SPLIE18_Pos (18) /*!< EADC_T::INTSRC0: SPLIE18 Position */ -#define EADC_INTSRC0_SPLIE18_Msk (0x1ul << EADC_INTSRC0_SPLIE18_Pos) /*!< EADC_T::INTSRC0: SPLIE18 Mask */ - -#define EADC_INTSRC1_SPLIE0_Pos (0) /*!< EADC_T::INTSRC1: SPLIE0 Position */ -#define EADC_INTSRC1_SPLIE0_Msk (0x1ul << EADC_INTSRC1_SPLIE0_Pos) /*!< EADC_T::INTSRC1: SPLIE0 Mask */ - -#define EADC_INTSRC1_SPLIE1_Pos (1) /*!< EADC_T::INTSRC1: SPLIE1 Position */ -#define EADC_INTSRC1_SPLIE1_Msk (0x1ul << EADC_INTSRC1_SPLIE1_Pos) /*!< EADC_T::INTSRC1: SPLIE1 Mask */ - -#define EADC_INTSRC1_SPLIE2_Pos (2) /*!< EADC_T::INTSRC1: SPLIE2 Position */ -#define EADC_INTSRC1_SPLIE2_Msk (0x1ul << EADC_INTSRC1_SPLIE2_Pos) /*!< EADC_T::INTSRC1: SPLIE2 Mask */ - -#define EADC_INTSRC1_SPLIE3_Pos (3) /*!< EADC_T::INTSRC1: SPLIE3 Position */ -#define EADC_INTSRC1_SPLIE3_Msk (0x1ul << EADC_INTSRC1_SPLIE3_Pos) /*!< EADC_T::INTSRC1: SPLIE3 Mask */ - -#define EADC_INTSRC1_SPLIE4_Pos (4) /*!< EADC_T::INTSRC1: SPLIE4 Position */ -#define EADC_INTSRC1_SPLIE4_Msk (0x1ul << EADC_INTSRC1_SPLIE4_Pos) /*!< EADC_T::INTSRC1: SPLIE4 Mask */ - -#define EADC_INTSRC1_SPLIE5_Pos (5) /*!< EADC_T::INTSRC1: SPLIE5 Position */ -#define EADC_INTSRC1_SPLIE5_Msk (0x1ul << EADC_INTSRC1_SPLIE5_Pos) /*!< EADC_T::INTSRC1: SPLIE5 Mask */ - -#define EADC_INTSRC1_SPLIE6_Pos (6) /*!< EADC_T::INTSRC1: SPLIE6 Position */ -#define EADC_INTSRC1_SPLIE6_Msk (0x1ul << EADC_INTSRC1_SPLIE6_Pos) /*!< EADC_T::INTSRC1: SPLIE6 Mask */ - -#define EADC_INTSRC1_SPLIE7_Pos (7) /*!< EADC_T::INTSRC1: SPLIE7 Position */ -#define EADC_INTSRC1_SPLIE7_Msk (0x1ul << EADC_INTSRC1_SPLIE7_Pos) /*!< EADC_T::INTSRC1: SPLIE7 Mask */ - -#define EADC_INTSRC1_SPLIE8_Pos (8) /*!< EADC_T::INTSRC1: SPLIE8 Position */ -#define EADC_INTSRC1_SPLIE8_Msk (0x1ul << EADC_INTSRC1_SPLIE8_Pos) /*!< EADC_T::INTSRC1: SPLIE8 Mask */ - -#define EADC_INTSRC1_SPLIE9_Pos (9) /*!< EADC_T::INTSRC1: SPLIE9 Position */ -#define EADC_INTSRC1_SPLIE9_Msk (0x1ul << EADC_INTSRC1_SPLIE9_Pos) /*!< EADC_T::INTSRC1: SPLIE9 Mask */ - -#define EADC_INTSRC1_SPLIE10_Pos (10) /*!< EADC_T::INTSRC1: SPLIE10 Position */ -#define EADC_INTSRC1_SPLIE10_Msk (0x1ul << EADC_INTSRC1_SPLIE10_Pos) /*!< EADC_T::INTSRC1: SPLIE10 Mask */ - -#define EADC_INTSRC1_SPLIE11_Pos (11) /*!< EADC_T::INTSRC1: SPLIE11 Position */ -#define EADC_INTSRC1_SPLIE11_Msk (0x1ul << EADC_INTSRC1_SPLIE11_Pos) /*!< EADC_T::INTSRC1: SPLIE11 Mask */ - -#define EADC_INTSRC1_SPLIE12_Pos (12) /*!< EADC_T::INTSRC1: SPLIE12 Position */ -#define EADC_INTSRC1_SPLIE12_Msk (0x1ul << EADC_INTSRC1_SPLIE12_Pos) /*!< EADC_T::INTSRC1: SPLIE12 Mask */ - -#define EADC_INTSRC1_SPLIE13_Pos (13) /*!< EADC_T::INTSRC1: SPLIE13 Position */ -#define EADC_INTSRC1_SPLIE13_Msk (0x1ul << EADC_INTSRC1_SPLIE13_Pos) /*!< EADC_T::INTSRC1: SPLIE13 Mask */ - -#define EADC_INTSRC1_SPLIE14_Pos (14) /*!< EADC_T::INTSRC1: SPLIE14 Position */ -#define EADC_INTSRC1_SPLIE14_Msk (0x1ul << EADC_INTSRC1_SPLIE14_Pos) /*!< EADC_T::INTSRC1: SPLIE14 Mask */ - -#define EADC_INTSRC1_SPLIE15_Pos (15) /*!< EADC_T::INTSRC1: SPLIE15 Position */ -#define EADC_INTSRC1_SPLIE15_Msk (0x1ul << EADC_INTSRC1_SPLIE15_Pos) /*!< EADC_T::INTSRC1: SPLIE15 Mask */ - -#define EADC_INTSRC1_SPLIE16_Pos (16) /*!< EADC_T::INTSRC1: SPLIE16 Position */ -#define EADC_INTSRC1_SPLIE16_Msk (0x1ul << EADC_INTSRC1_SPLIE16_Pos) /*!< EADC_T::INTSRC1: SPLIE16 Mask */ - -#define EADC_INTSRC1_SPLIE17_Pos (17) /*!< EADC_T::INTSRC1: SPLIE17 Position */ -#define EADC_INTSRC1_SPLIE17_Msk (0x1ul << EADC_INTSRC1_SPLIE17_Pos) /*!< EADC_T::INTSRC1: SPLIE17 Mask */ - -#define EADC_INTSRC1_SPLIE18_Pos (18) /*!< EADC_T::INTSRC1: SPLIE18 Position */ -#define EADC_INTSRC1_SPLIE18_Msk (0x1ul << EADC_INTSRC1_SPLIE18_Pos) /*!< EADC_T::INTSRC1: SPLIE18 Mask */ - -#define EADC_INTSRC2_SPLIE0_Pos (0) /*!< EADC_T::INTSRC2: SPLIE0 Position */ -#define EADC_INTSRC2_SPLIE0_Msk (0x1ul << EADC_INTSRC2_SPLIE0_Pos) /*!< EADC_T::INTSRC2: SPLIE0 Mask */ - -#define EADC_INTSRC2_SPLIE1_Pos (1) /*!< EADC_T::INTSRC2: SPLIE1 Position */ -#define EADC_INTSRC2_SPLIE1_Msk (0x1ul << EADC_INTSRC2_SPLIE1_Pos) /*!< EADC_T::INTSRC2: SPLIE1 Mask */ - -#define EADC_INTSRC2_SPLIE2_Pos (2) /*!< EADC_T::INTSRC2: SPLIE2 Position */ -#define EADC_INTSRC2_SPLIE2_Msk (0x1ul << EADC_INTSRC2_SPLIE2_Pos) /*!< EADC_T::INTSRC2: SPLIE2 Mask */ - -#define EADC_INTSRC2_SPLIE3_Pos (3) /*!< EADC_T::INTSRC2: SPLIE3 Position */ -#define EADC_INTSRC2_SPLIE3_Msk (0x1ul << EADC_INTSRC2_SPLIE3_Pos) /*!< EADC_T::INTSRC2: SPLIE3 Mask */ - -#define EADC_INTSRC2_SPLIE4_Pos (4) /*!< EADC_T::INTSRC2: SPLIE4 Position */ -#define EADC_INTSRC2_SPLIE4_Msk (0x1ul << EADC_INTSRC2_SPLIE4_Pos) /*!< EADC_T::INTSRC2: SPLIE4 Mask */ - -#define EADC_INTSRC2_SPLIE5_Pos (5) /*!< EADC_T::INTSRC2: SPLIE5 Position */ -#define EADC_INTSRC2_SPLIE5_Msk (0x1ul << EADC_INTSRC2_SPLIE5_Pos) /*!< EADC_T::INTSRC2: SPLIE5 Mask */ - -#define EADC_INTSRC2_SPLIE6_Pos (6) /*!< EADC_T::INTSRC2: SPLIE6 Position */ -#define EADC_INTSRC2_SPLIE6_Msk (0x1ul << EADC_INTSRC2_SPLIE6_Pos) /*!< EADC_T::INTSRC2: SPLIE6 Mask */ - -#define EADC_INTSRC2_SPLIE7_Pos (7) /*!< EADC_T::INTSRC2: SPLIE7 Position */ -#define EADC_INTSRC2_SPLIE7_Msk (0x1ul << EADC_INTSRC2_SPLIE7_Pos) /*!< EADC_T::INTSRC2: SPLIE7 Mask */ - -#define EADC_INTSRC2_SPLIE8_Pos (8) /*!< EADC_T::INTSRC2: SPLIE8 Position */ -#define EADC_INTSRC2_SPLIE8_Msk (0x1ul << EADC_INTSRC2_SPLIE8_Pos) /*!< EADC_T::INTSRC2: SPLIE8 Mask */ - -#define EADC_INTSRC2_SPLIE9_Pos (9) /*!< EADC_T::INTSRC2: SPLIE9 Position */ -#define EADC_INTSRC2_SPLIE9_Msk (0x1ul << EADC_INTSRC2_SPLIE9_Pos) /*!< EADC_T::INTSRC2: SPLIE9 Mask */ - -#define EADC_INTSRC2_SPLIE10_Pos (10) /*!< EADC_T::INTSRC2: SPLIE10 Position */ -#define EADC_INTSRC2_SPLIE10_Msk (0x1ul << EADC_INTSRC2_SPLIE10_Pos) /*!< EADC_T::INTSRC2: SPLIE10 Mask */ - -#define EADC_INTSRC2_SPLIE11_Pos (11) /*!< EADC_T::INTSRC2: SPLIE11 Position */ -#define EADC_INTSRC2_SPLIE11_Msk (0x1ul << EADC_INTSRC2_SPLIE11_Pos) /*!< EADC_T::INTSRC2: SPLIE11 Mask */ - -#define EADC_INTSRC2_SPLIE12_Pos (12) /*!< EADC_T::INTSRC2: SPLIE12 Position */ -#define EADC_INTSRC2_SPLIE12_Msk (0x1ul << EADC_INTSRC2_SPLIE12_Pos) /*!< EADC_T::INTSRC2: SPLIE12 Mask */ - -#define EADC_INTSRC2_SPLIE13_Pos (13) /*!< EADC_T::INTSRC2: SPLIE13 Position */ -#define EADC_INTSRC2_SPLIE13_Msk (0x1ul << EADC_INTSRC2_SPLIE13_Pos) /*!< EADC_T::INTSRC2: SPLIE13 Mask */ - -#define EADC_INTSRC2_SPLIE14_Pos (14) /*!< EADC_T::INTSRC2: SPLIE14 Position */ -#define EADC_INTSRC2_SPLIE14_Msk (0x1ul << EADC_INTSRC2_SPLIE14_Pos) /*!< EADC_T::INTSRC2: SPLIE14 Mask */ - -#define EADC_INTSRC2_SPLIE15_Pos (15) /*!< EADC_T::INTSRC2: SPLIE15 Position */ -#define EADC_INTSRC2_SPLIE15_Msk (0x1ul << EADC_INTSRC2_SPLIE15_Pos) /*!< EADC_T::INTSRC2: SPLIE15 Mask */ - -#define EADC_INTSRC2_SPLIE16_Pos (16) /*!< EADC_T::INTSRC2: SPLIE16 Position */ -#define EADC_INTSRC2_SPLIE16_Msk (0x1ul << EADC_INTSRC2_SPLIE16_Pos) /*!< EADC_T::INTSRC2: SPLIE16 Mask */ - -#define EADC_INTSRC2_SPLIE17_Pos (17) /*!< EADC_T::INTSRC2: SPLIE17 Position */ -#define EADC_INTSRC2_SPLIE17_Msk (0x1ul << EADC_INTSRC2_SPLIE17_Pos) /*!< EADC_T::INTSRC2: SPLIE17 Mask */ - -#define EADC_INTSRC2_SPLIE18_Pos (18) /*!< EADC_T::INTSRC2: SPLIE18 Position */ -#define EADC_INTSRC2_SPLIE18_Msk (0x1ul << EADC_INTSRC2_SPLIE18_Pos) /*!< EADC_T::INTSRC2: SPLIE18 Mask */ - -#define EADC_INTSRC3_SPLIE0_Pos (0) /*!< EADC_T::INTSRC3: SPLIE0 Position */ -#define EADC_INTSRC3_SPLIE0_Msk (0x1ul << EADC_INTSRC3_SPLIE0_Pos) /*!< EADC_T::INTSRC3: SPLIE0 Mask */ - -#define EADC_INTSRC3_SPLIE1_Pos (1) /*!< EADC_T::INTSRC3: SPLIE1 Position */ -#define EADC_INTSRC3_SPLIE1_Msk (0x1ul << EADC_INTSRC3_SPLIE1_Pos) /*!< EADC_T::INTSRC3: SPLIE1 Mask */ - -#define EADC_INTSRC3_SPLIE2_Pos (2) /*!< EADC_T::INTSRC3: SPLIE2 Position */ -#define EADC_INTSRC3_SPLIE2_Msk (0x1ul << EADC_INTSRC3_SPLIE2_Pos) /*!< EADC_T::INTSRC3: SPLIE2 Mask */ - -#define EADC_INTSRC3_SPLIE3_Pos (3) /*!< EADC_T::INTSRC3: SPLIE3 Position */ -#define EADC_INTSRC3_SPLIE3_Msk (0x1ul << EADC_INTSRC3_SPLIE3_Pos) /*!< EADC_T::INTSRC3: SPLIE3 Mask */ - -#define EADC_INTSRC3_SPLIE4_Pos (4) /*!< EADC_T::INTSRC3: SPLIE4 Position */ -#define EADC_INTSRC3_SPLIE4_Msk (0x1ul << EADC_INTSRC3_SPLIE4_Pos) /*!< EADC_T::INTSRC3: SPLIE4 Mask */ - -#define EADC_INTSRC3_SPLIE5_Pos (5) /*!< EADC_T::INTSRC3: SPLIE5 Position */ -#define EADC_INTSRC3_SPLIE5_Msk (0x1ul << EADC_INTSRC3_SPLIE5_Pos) /*!< EADC_T::INTSRC3: SPLIE5 Mask */ - -#define EADC_INTSRC3_SPLIE6_Pos (6) /*!< EADC_T::INTSRC3: SPLIE6 Position */ -#define EADC_INTSRC3_SPLIE6_Msk (0x1ul << EADC_INTSRC3_SPLIE6_Pos) /*!< EADC_T::INTSRC3: SPLIE6 Mask */ - -#define EADC_INTSRC3_SPLIE7_Pos (7) /*!< EADC_T::INTSRC3: SPLIE7 Position */ -#define EADC_INTSRC3_SPLIE7_Msk (0x1ul << EADC_INTSRC3_SPLIE7_Pos) /*!< EADC_T::INTSRC3: SPLIE7 Mask */ - -#define EADC_INTSRC3_SPLIE8_Pos (8) /*!< EADC_T::INTSRC3: SPLIE8 Position */ -#define EADC_INTSRC3_SPLIE8_Msk (0x1ul << EADC_INTSRC3_SPLIE8_Pos) /*!< EADC_T::INTSRC3: SPLIE8 Mask */ - -#define EADC_INTSRC3_SPLIE9_Pos (9) /*!< EADC_T::INTSRC3: SPLIE9 Position */ -#define EADC_INTSRC3_SPLIE9_Msk (0x1ul << EADC_INTSRC3_SPLIE9_Pos) /*!< EADC_T::INTSRC3: SPLIE9 Mask */ - -#define EADC_INTSRC3_SPLIE10_Pos (10) /*!< EADC_T::INTSRC3: SPLIE10 Position */ -#define EADC_INTSRC3_SPLIE10_Msk (0x1ul << EADC_INTSRC3_SPLIE10_Pos) /*!< EADC_T::INTSRC3: SPLIE10 Mask */ - -#define EADC_INTSRC3_SPLIE11_Pos (11) /*!< EADC_T::INTSRC3: SPLIE11 Position */ -#define EADC_INTSRC3_SPLIE11_Msk (0x1ul << EADC_INTSRC3_SPLIE11_Pos) /*!< EADC_T::INTSRC3: SPLIE11 Mask */ - -#define EADC_INTSRC3_SPLIE12_Pos (12) /*!< EADC_T::INTSRC3: SPLIE12 Position */ -#define EADC_INTSRC3_SPLIE12_Msk (0x1ul << EADC_INTSRC3_SPLIE12_Pos) /*!< EADC_T::INTSRC3: SPLIE12 Mask */ - -#define EADC_INTSRC3_SPLIE13_Pos (13) /*!< EADC_T::INTSRC3: SPLIE13 Position */ -#define EADC_INTSRC3_SPLIE13_Msk (0x1ul << EADC_INTSRC3_SPLIE13_Pos) /*!< EADC_T::INTSRC3: SPLIE13 Mask */ - -#define EADC_INTSRC3_SPLIE14_Pos (14) /*!< EADC_T::INTSRC3: SPLIE14 Position */ -#define EADC_INTSRC3_SPLIE14_Msk (0x1ul << EADC_INTSRC3_SPLIE14_Pos) /*!< EADC_T::INTSRC3: SPLIE14 Mask */ - -#define EADC_INTSRC3_SPLIE15_Pos (15) /*!< EADC_T::INTSRC3: SPLIE15 Position */ -#define EADC_INTSRC3_SPLIE15_Msk (0x1ul << EADC_INTSRC3_SPLIE15_Pos) /*!< EADC_T::INTSRC3: SPLIE15 Mask */ - -#define EADC_INTSRC3_SPLIE16_Pos (16) /*!< EADC_T::INTSRC3: SPLIE16 Position */ -#define EADC_INTSRC3_SPLIE16_Msk (0x1ul << EADC_INTSRC3_SPLIE16_Pos) /*!< EADC_T::INTSRC3: SPLIE16 Mask */ - -#define EADC_INTSRC3_SPLIE17_Pos (17) /*!< EADC_T::INTSRC3: SPLIE17 Position */ -#define EADC_INTSRC3_SPLIE17_Msk (0x1ul << EADC_INTSRC3_SPLIE17_Pos) /*!< EADC_T::INTSRC3: SPLIE17 Mask */ - -#define EADC_INTSRC3_SPLIE18_Pos (18) /*!< EADC_T::INTSRC3: SPLIE18 Position */ -#define EADC_INTSRC3_SPLIE18_Msk (0x1ul << EADC_INTSRC3_SPLIE18_Pos) /*!< EADC_T::INTSRC3: SPLIE18 Mask */ - -#define EADC_CMP_ADCMPEN_Pos (0) /*!< EADC_T::CMP: ADCMPEN Position */ -#define EADC_CMP_ADCMPEN_Msk (0x1ul << EADC_CMP_ADCMPEN_Pos) /*!< EADC_T::CMP: ADCMPEN Mask */ - -#define EADC_CMP_ADCMPIE_Pos (1) /*!< EADC_T::CMP: ADCMPIE Position */ -#define EADC_CMP_ADCMPIE_Msk (0x1ul << EADC_CMP_ADCMPIE_Pos) /*!< EADC_T::CMP: ADCMPIE Mask */ - -#define EADC_CMP_CMPCOND_Pos (2) /*!< EADC_T::CMP: CMPCOND Position */ -#define EADC_CMP_CMPCOND_Msk (0x1ul << EADC_CMP_CMPCOND_Pos) /*!< EADC_T::CMP: CMPCOND Mask */ - -#define EADC_CMP_CMPSPL_Pos (3) /*!< EADC_T::CMP: CMPSPL Position */ -#define EADC_CMP_CMPSPL_Msk (0x1ful << EADC_CMP_CMPSPL_Pos) /*!< EADC_T::CMP: CMPSPL Mask */ - -#define EADC_CMP_CMPMCNT_Pos (8) /*!< EADC_T::CMP: CMPMCNT Position */ -#define EADC_CMP_CMPMCNT_Msk (0xful << EADC_CMP_CMPMCNT_Pos) /*!< EADC_T::CMP: CMPMCNT Mask */ - -#define EADC_CMP_CMPWEN_Pos (15) /*!< EADC_T::CMP: CMPWEN Position */ -#define EADC_CMP_CMPWEN_Msk (0x1ul << EADC_CMP_CMPWEN_Pos) /*!< EADC_T::CMP: CMPWEN Mask */ - -#define EADC_CMP_CMPDAT_Pos (16) /*!< EADC_T::CMP: CMPDAT Position */ -#define EADC_CMP_CMPDAT_Msk (0xffful << EADC_CMP_CMPDAT_Pos) /*!< EADC_T::CMP: CMPDAT Mask */ - -#define EADC_CMP0_ADCMPEN_Pos (0) /*!< EADC_T::CMP0: ADCMPEN Position */ -#define EADC_CMP0_ADCMPEN_Msk (0x1ul << EADC_CMP0_ADCMPEN_Pos) /*!< EADC_T::CMP0: ADCMPEN Mask */ - -#define EADC_CMP0_ADCMPIE_Pos (1) /*!< EADC_T::CMP0: ADCMPIE Position */ -#define EADC_CMP0_ADCMPIE_Msk (0x1ul << EADC_CMP0_ADCMPIE_Pos) /*!< EADC_T::CMP0: ADCMPIE Mask */ - -#define EADC_CMP0_CMPCOND_Pos (2) /*!< EADC_T::CMP0: CMPCOND Position */ -#define EADC_CMP0_CMPCOND_Msk (0x1ul << EADC_CMP0_CMPCOND_Pos) /*!< EADC_T::CMP0: CMPCOND Mask */ - -#define EADC_CMP0_CMPSPL_Pos (3) /*!< EADC_T::CMP0: CMPSPL Position */ -#define EADC_CMP0_CMPSPL_Msk (0x1ful << EADC_CMP0_CMPSPL_Pos) /*!< EADC_T::CMP0: CMPSPL Mask */ - -#define EADC_CMP0_CMPMCNT_Pos (8) /*!< EADC_T::CMP0: CMPMCNT Position */ -#define EADC_CMP0_CMPMCNT_Msk (0xful << EADC_CMP0_CMPMCNT_Pos) /*!< EADC_T::CMP0: CMPMCNT Mask */ - -#define EADC_CMP0_CMPWEN_Pos (15) /*!< EADC_T::CMP0: CMPWEN Position */ -#define EADC_CMP0_CMPWEN_Msk (0x1ul << EADC_CMP0_CMPWEN_Pos) /*!< EADC_T::CMP0: CMPWEN Mask */ - -#define EADC_CMP0_CMPDAT_Pos (16) /*!< EADC_T::CMP0: CMPDAT Position */ -#define EADC_CMP0_CMPDAT_Msk (0xffful << EADC_CMP0_CMPDAT_Pos) /*!< EADC_T::CMP0: CMPDAT Mask */ - -#define EADC_CMP1_ADCMPEN_Pos (0) /*!< EADC_T::CMP1: ADCMPEN Position */ -#define EADC_CMP1_ADCMPEN_Msk (0x1ul << EADC_CMP1_ADCMPEN_Pos) /*!< EADC_T::CMP1: ADCMPEN Mask */ - -#define EADC_CMP1_ADCMPIE_Pos (1) /*!< EADC_T::CMP1: ADCMPIE Position */ -#define EADC_CMP1_ADCMPIE_Msk (0x1ul << EADC_CMP1_ADCMPIE_Pos) /*!< EADC_T::CMP1: ADCMPIE Mask */ - -#define EADC_CMP1_CMPCOND_Pos (2) /*!< EADC_T::CMP1: CMPCOND Position */ -#define EADC_CMP1_CMPCOND_Msk (0x1ul << EADC_CMP1_CMPCOND_Pos) /*!< EADC_T::CMP1: CMPCOND Mask */ - -#define EADC_CMP1_CMPSPL_Pos (3) /*!< EADC_T::CMP1: CMPSPL Position */ -#define EADC_CMP1_CMPSPL_Msk (0x1ful << EADC_CMP1_CMPSPL_Pos) /*!< EADC_T::CMP1: CMPSPL Mask */ - -#define EADC_CMP1_CMPMCNT_Pos (8) /*!< EADC_T::CMP1: CMPMCNT Position */ -#define EADC_CMP1_CMPMCNT_Msk (0xful << EADC_CMP1_CMPMCNT_Pos) /*!< EADC_T::CMP1: CMPMCNT Mask */ - -#define EADC_CMP1_CMPWEN_Pos (15) /*!< EADC_T::CMP1: CMPWEN Position */ -#define EADC_CMP1_CMPWEN_Msk (0x1ul << EADC_CMP1_CMPWEN_Pos) /*!< EADC_T::CMP1: CMPWEN Mask */ - -#define EADC_CMP1_CMPDAT_Pos (16) /*!< EADC_T::CMP1: CMPDAT Position */ -#define EADC_CMP1_CMPDAT_Msk (0xffful << EADC_CMP1_CMPDAT_Pos) /*!< EADC_T::CMP1: CMPDAT Mask */ - -#define EADC_CMP2_ADCMPEN_Pos (0) /*!< EADC_T::CMP2: ADCMPEN Position */ -#define EADC_CMP2_ADCMPEN_Msk (0x1ul << EADC_CMP2_ADCMPEN_Pos) /*!< EADC_T::CMP2: ADCMPEN Mask */ - -#define EADC_CMP2_ADCMPIE_Pos (1) /*!< EADC_T::CMP2: ADCMPIE Position */ -#define EADC_CMP2_ADCMPIE_Msk (0x1ul << EADC_CMP2_ADCMPIE_Pos) /*!< EADC_T::CMP2: ADCMPIE Mask */ - -#define EADC_CMP2_CMPCOND_Pos (2) /*!< EADC_T::CMP2: CMPCOND Position */ -#define EADC_CMP2_CMPCOND_Msk (0x1ul << EADC_CMP2_CMPCOND_Pos) /*!< EADC_T::CMP2: CMPCOND Mask */ - -#define EADC_CMP2_CMPSPL_Pos (3) /*!< EADC_T::CMP2: CMPSPL Position */ -#define EADC_CMP2_CMPSPL_Msk (0x1ful << EADC_CMP2_CMPSPL_Pos) /*!< EADC_T::CMP2: CMPSPL Mask */ - -#define EADC_CMP2_CMPMCNT_Pos (8) /*!< EADC_T::CMP2: CMPMCNT Position */ -#define EADC_CMP2_CMPMCNT_Msk (0xful << EADC_CMP2_CMPMCNT_Pos) /*!< EADC_T::CMP2: CMPMCNT Mask */ - -#define EADC_CMP2_CMPWEN_Pos (15) /*!< EADC_T::CMP2: CMPWEN Position */ -#define EADC_CMP2_CMPWEN_Msk (0x1ul << EADC_CMP2_CMPWEN_Pos) /*!< EADC_T::CMP2: CMPWEN Mask */ - -#define EADC_CMP2_CMPDAT_Pos (16) /*!< EADC_T::CMP2: CMPDAT Position */ -#define EADC_CMP2_CMPDAT_Msk (0xffful << EADC_CMP2_CMPDAT_Pos) /*!< EADC_T::CMP2: CMPDAT Mask */ - -#define EADC_CMP3_ADCMPEN_Pos (0) /*!< EADC_T::CMP3: ADCMPEN Position */ -#define EADC_CMP3_ADCMPEN_Msk (0x1ul << EADC_CMP3_ADCMPEN_Pos) /*!< EADC_T::CMP3: ADCMPEN Mask */ - -#define EADC_CMP3_ADCMPIE_Pos (1) /*!< EADC_T::CMP3: ADCMPIE Position */ -#define EADC_CMP3_ADCMPIE_Msk (0x1ul << EADC_CMP3_ADCMPIE_Pos) /*!< EADC_T::CMP3: ADCMPIE Mask */ - -#define EADC_CMP3_CMPCOND_Pos (2) /*!< EADC_T::CMP3: CMPCOND Position */ -#define EADC_CMP3_CMPCOND_Msk (0x1ul << EADC_CMP3_CMPCOND_Pos) /*!< EADC_T::CMP3: CMPCOND Mask */ - -#define EADC_CMP3_CMPSPL_Pos (3) /*!< EADC_T::CMP3: CMPSPL Position */ -#define EADC_CMP3_CMPSPL_Msk (0x1ful << EADC_CMP3_CMPSPL_Pos) /*!< EADC_T::CMP3: CMPSPL Mask */ - -#define EADC_CMP3_CMPMCNT_Pos (8) /*!< EADC_T::CMP3: CMPMCNT Position */ -#define EADC_CMP3_CMPMCNT_Msk (0xful << EADC_CMP3_CMPMCNT_Pos) /*!< EADC_T::CMP3: CMPMCNT Mask */ - -#define EADC_CMP3_CMPWEN_Pos (15) /*!< EADC_T::CMP3: CMPWEN Position */ -#define EADC_CMP3_CMPWEN_Msk (0x1ul << EADC_CMP3_CMPWEN_Pos) /*!< EADC_T::CMP3: CMPWEN Mask */ - -#define EADC_CMP3_CMPDAT_Pos (16) /*!< EADC_T::CMP3: CMPDAT Position */ -#define EADC_CMP3_CMPDAT_Msk (0xffful << EADC_CMP3_CMPDAT_Pos) /*!< EADC_T::CMP3: CMPDAT Mask */ - -#define EADC_STATUS0_VALID_Pos (0) /*!< EADC_T::STATUS0: VALID Position */ -#define EADC_STATUS0_VALID_Msk (0xfffful << EADC_STATUS0_VALID_Pos) /*!< EADC_T::STATUS0: VALID Mask */ - -#define EADC_STATUS0_OV_Pos (16) /*!< EADC_T::STATUS0: OV Position */ -#define EADC_STATUS0_OV_Msk (0xfffful << EADC_STATUS0_OV_Pos) /*!< EADC_T::STATUS0: OV Mask */ - -#define EADC_STATUS1_VALID_Pos (0) /*!< EADC_T::STATUS1: VALID Position */ -#define EADC_STATUS1_VALID_Msk (0x7ul << EADC_STATUS1_VALID_Pos) /*!< EADC_T::STATUS1: VALID Mask */ - -#define EADC_STATUS1_OV_Pos (16) /*!< EADC_T::STATUS1: OV Position */ -#define EADC_STATUS1_OV_Msk (0x7ul << EADC_STATUS1_OV_Pos) /*!< EADC_T::STATUS1: OV Mask */ - -#define EADC_STATUS2_ADIF0_Pos (0) /*!< EADC_T::STATUS2: ADIF0 Position */ -#define EADC_STATUS2_ADIF0_Msk (0x1ul << EADC_STATUS2_ADIF0_Pos) /*!< EADC_T::STATUS2: ADIF0 Mask */ - -#define EADC_STATUS2_ADIF1_Pos (1) /*!< EADC_T::STATUS2: ADIF1 Position */ -#define EADC_STATUS2_ADIF1_Msk (0x1ul << EADC_STATUS2_ADIF1_Pos) /*!< EADC_T::STATUS2: ADIF1 Mask */ - -#define EADC_STATUS2_ADIF2_Pos (2) /*!< EADC_T::STATUS2: ADIF2 Position */ -#define EADC_STATUS2_ADIF2_Msk (0x1ul << EADC_STATUS2_ADIF2_Pos) /*!< EADC_T::STATUS2: ADIF2 Mask */ - -#define EADC_STATUS2_ADIF3_Pos (3) /*!< EADC_T::STATUS2: ADIF3 Position */ -#define EADC_STATUS2_ADIF3_Msk (0x1ul << EADC_STATUS2_ADIF3_Pos) /*!< EADC_T::STATUS2: ADIF3 Mask */ - -#define EADC_STATUS2_ADCMPF0_Pos (4) /*!< EADC_T::STATUS2: ADCMPF0 Position */ -#define EADC_STATUS2_ADCMPF0_Msk (0x1ul << EADC_STATUS2_ADCMPF0_Pos) /*!< EADC_T::STATUS2: ADCMPF0 Mask */ - -#define EADC_STATUS2_ADCMPF1_Pos (5) /*!< EADC_T::STATUS2: ADCMPF1 Position */ -#define EADC_STATUS2_ADCMPF1_Msk (0x1ul << EADC_STATUS2_ADCMPF1_Pos) /*!< EADC_T::STATUS2: ADCMPF1 Mask */ - -#define EADC_STATUS2_ADCMPF2_Pos (6) /*!< EADC_T::STATUS2: ADCMPF2 Position */ -#define EADC_STATUS2_ADCMPF2_Msk (0x1ul << EADC_STATUS2_ADCMPF2_Pos) /*!< EADC_T::STATUS2: ADCMPF2 Mask */ - -#define EADC_STATUS2_ADCMPF3_Pos (7) /*!< EADC_T::STATUS2: ADCMPF3 Position */ -#define EADC_STATUS2_ADCMPF3_Msk (0x1ul << EADC_STATUS2_ADCMPF3_Pos) /*!< EADC_T::STATUS2: ADCMPF3 Mask */ - -#define EADC_STATUS2_ADOVIF0_Pos (8) /*!< EADC_T::STATUS2: ADOVIF0 Position */ -#define EADC_STATUS2_ADOVIF0_Msk (0x1ul << EADC_STATUS2_ADOVIF0_Pos) /*!< EADC_T::STATUS2: ADOVIF0 Mask */ - -#define EADC_STATUS2_ADOVIF1_Pos (9) /*!< EADC_T::STATUS2: ADOVIF1 Position */ -#define EADC_STATUS2_ADOVIF1_Msk (0x1ul << EADC_STATUS2_ADOVIF1_Pos) /*!< EADC_T::STATUS2: ADOVIF1 Mask */ - -#define EADC_STATUS2_ADOVIF2_Pos (10) /*!< EADC_T::STATUS2: ADOVIF2 Position */ -#define EADC_STATUS2_ADOVIF2_Msk (0x1ul << EADC_STATUS2_ADOVIF2_Pos) /*!< EADC_T::STATUS2: ADOVIF2 Mask */ - -#define EADC_STATUS2_ADOVIF3_Pos (11) /*!< EADC_T::STATUS2: ADOVIF3 Position */ -#define EADC_STATUS2_ADOVIF3_Msk (0x1ul << EADC_STATUS2_ADOVIF3_Pos) /*!< EADC_T::STATUS2: ADOVIF3 Mask */ - -#define EADC_STATUS2_ADCMPO0_Pos (12) /*!< EADC_T::STATUS2: ADCMPO0 Position */ -#define EADC_STATUS2_ADCMPO0_Msk (0x1ul << EADC_STATUS2_ADCMPO0_Pos) /*!< EADC_T::STATUS2: ADCMPO0 Mask */ - -#define EADC_STATUS2_ADCMPO1_Pos (13) /*!< EADC_T::STATUS2: ADCMPO1 Position */ -#define EADC_STATUS2_ADCMPO1_Msk (0x1ul << EADC_STATUS2_ADCMPO1_Pos) /*!< EADC_T::STATUS2: ADCMPO1 Mask */ - -#define EADC_STATUS2_ADCMPO2_Pos (14) /*!< EADC_T::STATUS2: ADCMPO2 Position */ -#define EADC_STATUS2_ADCMPO2_Msk (0x1ul << EADC_STATUS2_ADCMPO2_Pos) /*!< EADC_T::STATUS2: ADCMPO2 Mask */ - -#define EADC_STATUS2_ADCMPO3_Pos (15) /*!< EADC_T::STATUS2: ADCMPO3 Position */ -#define EADC_STATUS2_ADCMPO3_Msk (0x1ul << EADC_STATUS2_ADCMPO3_Pos) /*!< EADC_T::STATUS2: ADCMPO3 Mask */ - -#define EADC_STATUS2_CHANNEL_Pos (16) /*!< EADC_T::STATUS2: CHANNEL Position */ -#define EADC_STATUS2_CHANNEL_Msk (0x1ful << EADC_STATUS2_CHANNEL_Pos) /*!< EADC_T::STATUS2: CHANNEL Mask */ - -#define EADC_STATUS2_BUSY_Pos (23) /*!< EADC_T::STATUS2: BUSY Position */ -#define EADC_STATUS2_BUSY_Msk (0x1ul << EADC_STATUS2_BUSY_Pos) /*!< EADC_T::STATUS2: BUSY Mask */ - -#define EADC_STATUS2_ADOVIF_Pos (24) /*!< EADC_T::STATUS2: ADOVIF Position */ -#define EADC_STATUS2_ADOVIF_Msk (0x1ul << EADC_STATUS2_ADOVIF_Pos) /*!< EADC_T::STATUS2: ADOVIF Mask */ - -#define EADC_STATUS2_STOVF_Pos (25) /*!< EADC_T::STATUS2: STOVF Position */ -#define EADC_STATUS2_STOVF_Msk (0x1ul << EADC_STATUS2_STOVF_Pos) /*!< EADC_T::STATUS2: STOVF Mask */ - -#define EADC_STATUS2_AVALID_Pos (26) /*!< EADC_T::STATUS2: AVALID Position */ -#define EADC_STATUS2_AVALID_Msk (0x1ul << EADC_STATUS2_AVALID_Pos) /*!< EADC_T::STATUS2: AVALID Mask */ - -#define EADC_STATUS2_AOV_Pos (27) /*!< EADC_T::STATUS2: AOV Position */ -#define EADC_STATUS2_AOV_Msk (0x1ul << EADC_STATUS2_AOV_Pos) /*!< EADC_T::STATUS2: AOV Mask */ - -#define EADC_STATUS3_CURSPL_Pos (0) /*!< EADC_T::STATUS3: CURSPL Position */ -#define EADC_STATUS3_CURSPL_Msk (0x1ful << EADC_STATUS3_CURSPL_Pos) /*!< EADC_T::STATUS3: CURSPL Mask */ - -#define EADC_DDAT0_RESULT_Pos (0) /*!< EADC_T::DDAT0: RESULT Position */ -#define EADC_DDAT0_RESULT_Msk (0xfffful << EADC_DDAT0_RESULT_Pos) /*!< EADC_T::DDAT0: RESULT Mask */ - -#define EADC_DDAT0_OV_Pos (16) /*!< EADC_T::DDAT0: OV Position */ -#define EADC_DDAT0_OV_Msk (0x1ul << EADC_DDAT0_OV_Pos) /*!< EADC_T::DDAT0: OV Mask */ - -#define EADC_DDAT0_VALID_Pos (17) /*!< EADC_T::DDAT0: VALID Position */ -#define EADC_DDAT0_VALID_Msk (0x1ul << EADC_DDAT0_VALID_Pos) /*!< EADC_T::DDAT0: VALID Mask */ - -#define EADC_DDAT1_RESULT_Pos (0) /*!< EADC_T::DDAT1: RESULT Position */ -#define EADC_DDAT1_RESULT_Msk (0xfffful << EADC_DDAT1_RESULT_Pos) /*!< EADC_T::DDAT1: RESULT Mask */ - -#define EADC_DDAT1_OV_Pos (16) /*!< EADC_T::DDAT1: OV Position */ -#define EADC_DDAT1_OV_Msk (0x1ul << EADC_DDAT1_OV_Pos) /*!< EADC_T::DDAT1: OV Mask */ - -#define EADC_DDAT1_VALID_Pos (17) /*!< EADC_T::DDAT1: VALID Position */ -#define EADC_DDAT1_VALID_Msk (0x1ul << EADC_DDAT1_VALID_Pos) /*!< EADC_T::DDAT1: VALID Mask */ - -#define EADC_DDAT2_RESULT_Pos (0) /*!< EADC_T::DDAT2: RESULT Position */ -#define EADC_DDAT2_RESULT_Msk (0xfffful << EADC_DDAT2_RESULT_Pos) /*!< EADC_T::DDAT2: RESULT Mask */ - -#define EADC_DDAT2_OV_Pos (16) /*!< EADC_T::DDAT2: OV Position */ -#define EADC_DDAT2_OV_Msk (0x1ul << EADC_DDAT2_OV_Pos) /*!< EADC_T::DDAT2: OV Mask */ - -#define EADC_DDAT2_VALID_Pos (17) /*!< EADC_T::DDAT2: VALID Position */ -#define EADC_DDAT2_VALID_Msk (0x1ul << EADC_DDAT2_VALID_Pos) /*!< EADC_T::DDAT2: VALID Mask */ - -#define EADC_DDAT3_RESULT_Pos (0) /*!< EADC_T::DDAT3: RESULT Position */ -#define EADC_DDAT3_RESULT_Msk (0xfffful << EADC_DDAT3_RESULT_Pos) /*!< EADC_T::DDAT3: RESULT Mask */ - -#define EADC_DDAT3_OV_Pos (16) /*!< EADC_T::DDAT3: OV Position */ -#define EADC_DDAT3_OV_Msk (0x1ul << EADC_DDAT3_OV_Pos) /*!< EADC_T::DDAT3: OV Mask */ - -#define EADC_DDAT3_VALID_Pos (17) /*!< EADC_T::DDAT3: VALID Position */ -#define EADC_DDAT3_VALID_Msk (0x1ul << EADC_DDAT3_VALID_Pos) /*!< EADC_T::DDAT3: VALID Mask */ - -#define EADC_CALCTL_CAL_Pos (0) /*!< EADC_T::CALCTL: CAL Position */ -#define EADC_CALCTL_CAL_Msk (0x1ul << EADC_CALCTL_CAL_Pos) /*!< EADC_T::CALCTL: CAL Mask */ - -#define EADC_CALCTL_CALIE_Pos (1) /*!< EADC_T::CALCTL: CALIE Position */ -#define EADC_CALCTL_CALIE_Msk (0x1ul << EADC_CALCTL_CALIE_Pos) /*!< EADC_T::CALCTL: CALIE Mask */ - -#define EADC_CALSR_CALIF_Pos (16) /*!< EADC_T::CALSR: CALIF Position */ -#define EADC_CALSR_CALIF_Msk (0x1ul << EADC_CALSR_CALIF_Pos) /*!< EADC_T::CALSR: CALIF Mask */ - -#define EADC_PDMACTL_PDMATEN_Pos (0) /*!< EADC_T::PDMACTL: PDMATEN Position */ -#define EADC_PDMACTL_PDMATEN_Msk (0x7fffful << EADC_PDMACTL_PDMATEN_Pos) /*!< EADC_T::PDMACTL: PDMATEN Mask */ - -#define EADC_MCTL1_ALIGN_Pos (0) /*!< EADC_T::MCTL1: ALIGN Position */ -#define EADC_MCTL1_ALIGN_Msk (0x1ul << EADC_MCTL1_ALIGN_Pos) /*!< EADC_T::MCTL1: ALIGN Mask */ - -#define EADC_MCTL1_AVG_Pos (1) /*!< EADC_T::MCTL1: AVG Position */ -#define EADC_MCTL1_AVG_Msk (0x1ul << EADC_MCTL1_AVG_Pos) /*!< EADC_T::MCTL1: AVG Mask */ - -#define EADC_MCTL1_ACU_Pos (4) /*!< EADC_T::MCTL1: ACU Position */ -#define EADC_MCTL1_ACU_Msk (0xful << EADC_MCTL1_ACU_Pos) /*!< EADC_T::MCTL1: ACU Mask */ - -#define EADC_M0CTL1_ALIGN_Pos (0) /*!< EADC_T::M0CTL1: ALIGN Position */ -#define EADC_M0CTL1_ALIGN_Msk (0x1ul << EADC_M0CTL1_ALIGN_Pos) /*!< EADC_T::M0CTL1: ALIGN Mask */ - -#define EADC_M0CTL1_AVG_Pos (1) /*!< EADC_T::M0CTL1: AVG Position */ -#define EADC_M0CTL1_AVG_Msk (0x1ul << EADC_M0CTL1_AVG_Pos) /*!< EADC_T::M0CTL1: AVG Mask */ - -#define EADC_M0CTL1_ACU_Pos (4) /*!< EADC_T::M0CTL1: ACU Position */ -#define EADC_M0CTL1_ACU_Msk (0xful << EADC_M0CTL1_ACU_Pos) /*!< EADC_T::M0CTL1: ACU Mask */ - -#define EADC_M1CTL1_ALIGN_Pos (0) /*!< EADC_T::M1CTL1: ALIGN Position */ -#define EADC_M1CTL1_ALIGN_Msk (0x1ul << EADC_M1CTL1_ALIGN_Pos) /*!< EADC_T::M1CTL1: ALIGN Mask */ - -#define EADC_M1CTL1_AVG_Pos (1) /*!< EADC_T::M1CTL1: AVG Position */ -#define EADC_M1CTL1_AVG_Msk (0x1ul << EADC_M1CTL1_AVG_Pos) /*!< EADC_T::M1CTL1: AVG Mask */ - -#define EADC_M1CTL1_ACU_Pos (4) /*!< EADC_T::M1CTL1: ACU Position */ -#define EADC_M1CTL1_ACU_Msk (0xful << EADC_M1CTL1_ACU_Pos) /*!< EADC_T::M1CTL1: ACU Mask */ - -#define EADC_M2CTL1_ALIGN_Pos (0) /*!< EADC_T::M2CTL1: ALIGN Position */ -#define EADC_M2CTL1_ALIGN_Msk (0x1ul << EADC_M2CTL1_ALIGN_Pos) /*!< EADC_T::M2CTL1: ALIGN Mask */ - -#define EADC_M2CTL1_AVG_Pos (1) /*!< EADC_T::M2CTL1: AVG Position */ -#define EADC_M2CTL1_AVG_Msk (0x1ul << EADC_M2CTL1_AVG_Pos) /*!< EADC_T::M2CTL1: AVG Mask */ - -#define EADC_M2CTL1_ACU_Pos (4) /*!< EADC_T::M2CTL1: ACU Position */ -#define EADC_M2CTL1_ACU_Msk (0xful << EADC_M2CTL1_ACU_Pos) /*!< EADC_T::M2CTL1: ACU Mask */ - -#define EADC_M3CTL1_ALIGN_Pos (0) /*!< EADC_T::M3CTL1: ALIGN Position */ -#define EADC_M3CTL1_ALIGN_Msk (0x1ul << EADC_M3CTL1_ALIGN_Pos) /*!< EADC_T::M3CTL1: ALIGN Mask */ - -#define EADC_M3CTL1_AVG_Pos (1) /*!< EADC_T::M3CTL1: AVG Position */ -#define EADC_M3CTL1_AVG_Msk (0x1ul << EADC_M3CTL1_AVG_Pos) /*!< EADC_T::M3CTL1: AVG Mask */ - -#define EADC_M3CTL1_ACU_Pos (4) /*!< EADC_T::M3CTL1: ACU Position */ -#define EADC_M3CTL1_ACU_Msk (0xful << EADC_M3CTL1_ACU_Pos) /*!< EADC_T::M3CTL1: ACU Mask */ - -#define EADC_M4CTL1_ALIGN_Pos (0) /*!< EADC_T::M4CTL1: ALIGN Position */ -#define EADC_M4CTL1_ALIGN_Msk (0x1ul << EADC_M4CTL1_ALIGN_Pos) /*!< EADC_T::M4CTL1: ALIGN Mask */ - -#define EADC_M4CTL1_AVG_Pos (1) /*!< EADC_T::M4CTL1: AVG Position */ -#define EADC_M4CTL1_AVG_Msk (0x1ul << EADC_M4CTL1_AVG_Pos) /*!< EADC_T::M4CTL1: AVG Mask */ - -#define EADC_M4CTL1_ACU_Pos (4) /*!< EADC_T::M4CTL1: ACU Position */ -#define EADC_M4CTL1_ACU_Msk (0xful << EADC_M4CTL1_ACU_Pos) /*!< EADC_T::M4CTL1: ACU Mask */ - -#define EADC_M5CTL1_ALIGN_Pos (0) /*!< EADC_T::M5CTL1: ALIGN Position */ -#define EADC_M5CTL1_ALIGN_Msk (0x1ul << EADC_M5CTL1_ALIGN_Pos) /*!< EADC_T::M5CTL1: ALIGN Mask */ - -#define EADC_M5CTL1_AVG_Pos (1) /*!< EADC_T::M5CTL1: AVG Position */ -#define EADC_M5CTL1_AVG_Msk (0x1ul << EADC_M5CTL1_AVG_Pos) /*!< EADC_T::M5CTL1: AVG Mask */ - -#define EADC_M5CTL1_ACU_Pos (4) /*!< EADC_T::M5CTL1: ACU Position */ -#define EADC_M5CTL1_ACU_Msk (0xful << EADC_M5CTL1_ACU_Pos) /*!< EADC_T::M5CTL1: ACU Mask */ - -#define EADC_M6CTL1_ALIGN_Pos (0) /*!< EADC_T::M6CTL1: ALIGN Position */ -#define EADC_M6CTL1_ALIGN_Msk (0x1ul << EADC_M6CTL1_ALIGN_Pos) /*!< EADC_T::M6CTL1: ALIGN Mask */ - -#define EADC_M6CTL1_AVG_Pos (1) /*!< EADC_T::M6CTL1: AVG Position */ -#define EADC_M6CTL1_AVG_Msk (0x1ul << EADC_M6CTL1_AVG_Pos) /*!< EADC_T::M6CTL1: AVG Mask */ - -#define EADC_M6CTL1_ACU_Pos (4) /*!< EADC_T::M6CTL1: ACU Position */ -#define EADC_M6CTL1_ACU_Msk (0xful << EADC_M6CTL1_ACU_Pos) /*!< EADC_T::M6CTL1: ACU Mask */ - -#define EADC_M7CTL1_ALIGN_Pos (0) /*!< EADC_T::M7CTL1: ALIGN Position */ -#define EADC_M7CTL1_ALIGN_Msk (0x1ul << EADC_M7CTL1_ALIGN_Pos) /*!< EADC_T::M7CTL1: ALIGN Mask */ - -#define EADC_M7CTL1_AVG_Pos (1) /*!< EADC_T::M7CTL1: AVG Position */ -#define EADC_M7CTL1_AVG_Msk (0x1ul << EADC_M7CTL1_AVG_Pos) /*!< EADC_T::M7CTL1: AVG Mask */ - -#define EADC_M7CTL1_ACU_Pos (4) /*!< EADC_T::M7CTL1: ACU Position */ -#define EADC_M7CTL1_ACU_Msk (0xful << EADC_M7CTL1_ACU_Pos) /*!< EADC_T::M7CTL1: ACU Mask */ - -#define EADC_M8CTL1_ALIGN_Pos (0) /*!< EADC_T::M8CTL1: ALIGN Position */ -#define EADC_M8CTL1_ALIGN_Msk (0x1ul << EADC_M8CTL1_ALIGN_Pos) /*!< EADC_T::M8CTL1: ALIGN Mask */ - -#define EADC_M8CTL1_AVG_Pos (1) /*!< EADC_T::M8CTL1: AVG Position */ -#define EADC_M8CTL1_AVG_Msk (0x1ul << EADC_M8CTL1_AVG_Pos) /*!< EADC_T::M8CTL1: AVG Mask */ - -#define EADC_M8CTL1_ACU_Pos (4) /*!< EADC_T::M8CTL1: ACU Position */ -#define EADC_M8CTL1_ACU_Msk (0xful << EADC_M8CTL1_ACU_Pos) /*!< EADC_T::M8CTL1: ACU Mask */ - -#define EADC_M9CTL1_ALIGN_Pos (0) /*!< EADC_T::M9CTL1: ALIGN Position */ -#define EADC_M9CTL1_ALIGN_Msk (0x1ul << EADC_M9CTL1_ALIGN_Pos) /*!< EADC_T::M9CTL1: ALIGN Mask */ - -#define EADC_M9CTL1_AVG_Pos (1) /*!< EADC_T::M9CTL1: AVG Position */ -#define EADC_M9CTL1_AVG_Msk (0x1ul << EADC_M9CTL1_AVG_Pos) /*!< EADC_T::M9CTL1: AVG Mask */ - -#define EADC_M9CTL1_ACU_Pos (4) /*!< EADC_T::M9CTL1: ACU Position */ -#define EADC_M9CTL1_ACU_Msk (0xful << EADC_M9CTL1_ACU_Pos) /*!< EADC_T::M9CTL1: ACU Mask */ - -#define EADC_M10CTL1_ALIGN_Pos (0) /*!< EADC_T::M10CTL1: ALIGN Position */ -#define EADC_M10CTL1_ALIGN_Msk (0x1ul << EADC_M10CTL1_ALIGN_Pos) /*!< EADC_T::M10CTL1: ALIGN Mask */ - -#define EADC_M10CTL1_AVG_Pos (1) /*!< EADC_T::M10CTL1: AVG Position */ -#define EADC_M10CTL1_AVG_Msk (0x1ul << EADC_M10CTL1_AVG_Pos) /*!< EADC_T::M10CTL1: AVG Mask */ - -#define EADC_M10CTL1_ACU_Pos (4) /*!< EADC_T::M10CTL1: ACU Position */ -#define EADC_M10CTL1_ACU_Msk (0xful << EADC_M10CTL1_ACU_Pos) /*!< EADC_T::M10CTL1: ACU Mask */ - -#define EADC_M11CTL1_ALIGN_Pos (0) /*!< EADC_T::M11CTL1: ALIGN Position */ -#define EADC_M11CTL1_ALIGN_Msk (0x1ul << EADC_M11CTL1_ALIGN_Pos) /*!< EADC_T::M11CTL1: ALIGN Mask */ - -#define EADC_M11CTL1_AVG_Pos (1) /*!< EADC_T::M11CTL1: AVG Position */ -#define EADC_M11CTL1_AVG_Msk (0x1ul << EADC_M11CTL1_AVG_Pos) /*!< EADC_T::M11CTL1: AVG Mask */ - -#define EADC_M11CTL1_ACU_Pos (4) /*!< EADC_T::M11CTL1: ACU Position */ -#define EADC_M11CTL1_ACU_Msk (0xful << EADC_M11CTL1_ACU_Pos) /*!< EADC_T::M11CTL1: ACU Mask */ - -#define EADC_M12CTL1_ALIGN_Pos (0) /*!< EADC_T::M12CTL1: ALIGN Position */ -#define EADC_M12CTL1_ALIGN_Msk (0x1ul << EADC_M12CTL1_ALIGN_Pos) /*!< EADC_T::M12CTL1: ALIGN Mask */ - -#define EADC_M12CTL1_AVG_Pos (1) /*!< EADC_T::M12CTL1: AVG Position */ -#define EADC_M12CTL1_AVG_Msk (0x1ul << EADC_M12CTL1_AVG_Pos) /*!< EADC_T::M12CTL1: AVG Mask */ - -#define EADC_M12CTL1_ACU_Pos (4) /*!< EADC_T::M12CTL1: ACU Position */ -#define EADC_M12CTL1_ACU_Msk (0xful << EADC_M12CTL1_ACU_Pos) /*!< EADC_T::M12CTL1: ACU Mask */ - -#define EADC_M13CTL1_ALIGN_Pos (0) /*!< EADC_T::M13CTL1: ALIGN Position */ -#define EADC_M13CTL1_ALIGN_Msk (0x1ul << EADC_M13CTL1_ALIGN_Pos) /*!< EADC_T::M13CTL1: ALIGN Mask */ - -#define EADC_M13CTL1_AVG_Pos (1) /*!< EADC_T::M13CTL1: AVG Position */ -#define EADC_M13CTL1_AVG_Msk (0x1ul << EADC_M13CTL1_AVG_Pos) /*!< EADC_T::M13CTL1: AVG Mask */ - -#define EADC_M13CTL1_ACU_Pos (4) /*!< EADC_T::M13CTL1: ACU Position */ -#define EADC_M13CTL1_ACU_Msk (0xful << EADC_M13CTL1_ACU_Pos) /*!< EADC_T::M13CTL1: ACU Mask */ - -#define EADC_M14CTL1_ALIGN_Pos (0) /*!< EADC_T::M14CTL1: ALIGN Position */ -#define EADC_M14CTL1_ALIGN_Msk (0x1ul << EADC_M14CTL1_ALIGN_Pos) /*!< EADC_T::M14CTL1: ALIGN Mask */ - -#define EADC_M14CTL1_AVG_Pos (1) /*!< EADC_T::M14CTL1: AVG Position */ -#define EADC_M14CTL1_AVG_Msk (0x1ul << EADC_M14CTL1_AVG_Pos) /*!< EADC_T::M14CTL1: AVG Mask */ - -#define EADC_M14CTL1_ACU_Pos (4) /*!< EADC_T::M14CTL1: ACU Position */ -#define EADC_M14CTL1_ACU_Msk (0xful << EADC_M14CTL1_ACU_Pos) /*!< EADC_T::M14CTL1: ACU Mask */ - -#define EADC_M15CTL1_ALIGN_Pos (0) /*!< EADC_T::M15CTL1: ALIGN Position */ -#define EADC_M15CTL1_ALIGN_Msk (0x1ul << EADC_M15CTL1_ALIGN_Pos) /*!< EADC_T::M15CTL1: ALIGN Mask */ - -#define EADC_M15CTL1_AVG_Pos (1) /*!< EADC_T::M15CTL1: AVG Position */ -#define EADC_M15CTL1_AVG_Msk (0x1ul << EADC_M15CTL1_AVG_Pos) /*!< EADC_T::M15CTL1: AVG Mask */ - -#define EADC_M15CTL1_ACU_Pos (4) /*!< EADC_T::M15CTL1: ACU Position */ -#define EADC_M15CTL1_ACU_Msk (0xful << EADC_M15CTL1_ACU_Pos) /*!< EADC_T::M15CTL1: ACU Mask */ - -/**@}*/ /* EADC_CONST */ -/**@}*/ /* end of EADC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EADC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ebi_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ebi_reg.h deleted file mode 100644 index 195168cc713..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ebi_reg.h +++ /dev/null @@ -1,168 +0,0 @@ -/**************************************************************************//** - * @file ebi_reg.h - * @version V3.00 - * @brief EBI register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EBI_REG_H__ -#define __EBI_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- External Bus Interface Controller -------------------------*/ -/** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var EBI_T::CTL - * Offset: 0x00 External Bus Interface Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separating Mode Enable Bit - * | | |0 = Address/Data Bus Separating Mode Disabled. - * | | |1 = Address/Data Bus Separating Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When continuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register - * @var EBI_T::TCTL - * Offset: 0x04 External Bus Interface Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC define data access time (tACC). - * | | |tACC = (TACC+1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD define data access hold time (tAHD). - * | | |tAHD = (TAHD+1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - */ - __IO uint32_t CTL0; /*!< [0x0000] External Bus Interface Bank0 Control Register */ - __IO uint32_t TCTL0; /*!< [0x0004] External Bus Interface Bank0 Timing Control Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CTL1; /*!< [0x0010] External Bus Interface Bank1 Control Register */ - __IO uint32_t TCTL1; /*!< [0x0014] External Bus Interface Bank1 Timing Control Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t CTL2; /*!< [0x0020] External Bus Interface Bank2 Control Register */ - __IO uint32_t TCTL2; /*!< [0x0024] External Bus Interface Bank2 Timing Control Register */ - -} EBI_T; - -/** - @addtogroup EBI_CONST EBI Bit Field Definition - Constant Definitions for EBI Controller - @{ -*/ - -#define EBI_CTL_EN_Pos (0) /*!< EBI_T::CTL: EN Position */ -#define EBI_CTL_EN_Msk (0x1ul << EBI_CTL_EN_Pos) /*!< EBI_T::CTL: EN Mask */ - -#define EBI_CTL_DW16_Pos (1) /*!< EBI_T::CTL: DW16 Position */ -#define EBI_CTL_DW16_Msk (0x1ul << EBI_CTL_DW16_Pos) /*!< EBI_T::CTL: DW16 Mask */ - -#define EBI_CTL_CSPOLINV_Pos (2) /*!< EBI_T::CTL: CSPOLINV Position */ -#define EBI_CTL_CSPOLINV_Msk (0x1ul << EBI_CTL_CSPOLINV_Pos) /*!< EBI_T::CTL: CSPOLINV Mask */ - -#define EBI_CTL_ADSEPEN_Pos (3) /*!< EBI_T::CTL: ADSEPEN Position */ -#define EBI_CTL_ADSEPEN_Msk (0x1ul << EBI_CTL_ADSEPEN_Pos) /*!< EBI_T::CTL: ADSEPEN Mask */ - -#define EBI_CTL_CACCESS_Pos (4) /*!< EBI_T::CTL: CACCESS Position */ -#define EBI_CTL_CACCESS_Msk (0x1ul << EBI_CTL_CACCESS_Pos) /*!< EBI_T::CTL: CACCESS Mask */ - -#define EBI_CTL_MCLKDIV_Pos (8) /*!< EBI_T::CTL: MCLKDIV Position */ -#define EBI_CTL_MCLKDIV_Msk (0x7ul << EBI_CTL_MCLKDIV_Pos) /*!< EBI_T::CTL: MCLKDIV Mask */ - -#define EBI_CTL_TALE_Pos (16) /*!< EBI_T::CTL: TALE Position */ -#define EBI_CTL_TALE_Msk (0x7ul << EBI_CTL_TALE_Pos) /*!< EBI_T::CTL: TALE Mask */ - -#define EBI_CTL_WBUFEN_Pos (24) /*!< EBI_T::CTL: WBUFEN Position */ -#define EBI_CTL_WBUFEN_Msk (0x1ul << EBI_CTL_WBUFEN_Pos) /*!< EBI_T::CTL: WBUFEN Mask */ - -#define EBI_TCTL_TACC_Pos (3) /*!< EBI_T::TCTL: TACC Position */ -#define EBI_TCTL_TACC_Msk (0x1ful << EBI_TCTL_TACC_Pos) /*!< EBI_T::TCTL: TACC Mask */ - -#define EBI_TCTL_TAHD_Pos (8) /*!< EBI_T::TCTL: TAHD Position */ -#define EBI_TCTL_TAHD_Msk (0x7ul << EBI_TCTL_TAHD_Pos) /*!< EBI_T::TCTL: TAHD Mask */ - -#define EBI_TCTL_W2X_Pos (12) /*!< EBI_T::TCTL: W2X Position */ -#define EBI_TCTL_W2X_Msk (0xful << EBI_TCTL_W2X_Pos) /*!< EBI_T::TCTL: W2X Mask */ - -#define EBI_TCTL_RAHDOFF_Pos (22) /*!< EBI_T::TCTL: RAHDOFF Position */ -#define EBI_TCTL_RAHDOFF_Msk (0x1ul << EBI_TCTL_RAHDOFF_Pos) /*!< EBI_T::TCTL: RAHDOFF Mask */ - -#define EBI_TCTL_WAHDOFF_Pos (23) /*!< EBI_T::TCTL: WAHDOFF Position */ -#define EBI_TCTL_WAHDOFF_Msk (0x1ul << EBI_TCTL_WAHDOFF_Pos) /*!< EBI_T::TCTL: WAHDOFF Mask */ - -#define EBI_TCTL_R2R_Pos (24) /*!< EBI_T::TCTL: R2R Position */ -#define EBI_TCTL_R2R_Msk (0xful << EBI_TCTL_R2R_Pos) /*!< EBI_T::TCTL: R2R Mask */ - - -/**@}*/ /* EBI_CONST */ -/**@}*/ /* end of EBI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EBI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ecap_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ecap_reg.h deleted file mode 100644 index 87b48310c47..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ecap_reg.h +++ /dev/null @@ -1,390 +0,0 @@ -/**************************************************************************//** - * @file ecap_reg.h - * @version V1.00 - * @brief ECAP register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ECAP_REG_H__ -#define __ECAP_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ECAP Enhanced Input Capture Timer(ECAP) - Memory Mapped Structure for ECAP Controller -@{ */ - -typedef struct -{ - - /** - * @var ECAP_T::CNT - * Offset: 0x00 Input Capture Counter (24-bit up counter) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Input Capture Timer/Counter - * | | |The input Capture Timer/Counter is a 24-bit up-counting counter - * | | |The clock source for the counter is from the clock divider - * @var ECAP_T::HLD0 - * Offset: 0x04 Input Capture Hold Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD1 - * Offset: 0x08 Input Capture Hold Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD2 - * Offset: 0x0C Input Capture Hold Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::CNTCMP - * Offset: 0x10 Input Capture Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNTCMP |Input Capture Counter Compare Register - * | | |If the compare function is enabled (CMPEN = 1), this register (ECAP_CNTCMP) is used to compare with the capture counter (ECAP_CNT). - * | | |If the reload control is enabled (RLDEN[n] = 1, n=0~3), an overflow event or capture events will trigger the hardware to load the value of this register (ECAP_CNTCMP) into ECAP_CNT. - * @var ECAP_T::CTL0 - * Offset: 0x14 Input Capture Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection - * | | |To determine the sampling frequency of the Noise Filter clock - * | | |000 = CAP_CLK. - * | | |001 = CAP_CLK/2. - * | | |010 = CAP_CLK/4. - * | | |011 = CAP_CLK/16. - * | | |100 = CAP_CLK/32. - * | | |101 = CAP_CLK/64. - * |[3] |CAPNFDIS |Input Capture Noise Filter Disable Control - * | | |0 = Noise filter of Input Capture Enabled. - * | | |1 = Noise filter of Input Capture Disabled (Bypass). - * |[4] |IC0EN |Port Pin IC0 Input to Input Capture Unit Enable Control - * | | |0 = IC0 input to Input Capture Unit Disabled. - * | | |1 = IC0 input to Input Capture Unit Enabled. - * |[5] |IC1EN |Port Pin IC1 Input to Input Capture Unit Enable Control - * | | |0 = IC1 input to Input Capture Unit Disabled. - * | | |1 = IC1 input to Input Capture Unit Enabled. - * |[6] |IC2EN |Port Pin IC2 Input to Input Capture Unit Enable Control - * | | |0 = IC2 input to Input Capture Unit Disabled. - * | | |1 = IC2 input to Input Capture Unit Enabled. - * |[9:8] |CAPSEL0 |CAP0 Input Source Selection - * | | |00 = CAP0 input is from port pin ICAP0. - * | | |01 = Reserved. - * | | |10 = CAP0 input is from signal CHA of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[11:10] |CAPSEL1 |CAP1 Input Source Selection - * | | |00 = CAP1 input is from port pin ICAP1. - * | | |01 = Reserved. - * | | |10 = CAP1 input is from signal CHB of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[13:12] |CAPSEL2 |CAP2 Input Source Selection - * | | |00 = CAP2 input is from port pin ICAP2. - * | | |01 = Reserved. - * | | |10 = CAP2 input is from signal CHX of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[16] |CAPIEN0 |Input Capture Channel 0 Interrupt Enable Control - * | | |0 = The flag CAPTF0 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF0 can trigger Input Capture interrupt Enabled. - * |[17] |CAPIEN1 |Input Capture Channel 1 Interrupt Enable Control - * | | |0 = The flag CAPTF1 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF1 can trigger Input Capture interrupt Enabled. - * |[18] |CAPIEN2 |Input Capture Channel 2 Interrupt Enable Control - * | | |0 = The flag CAPTF2 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF2 can trigger Input Capture interrupt Enabled. - * |[20] |OVIEN |CAPOVF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPOVF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPOVF can trigger Input Capture interrupt Enabled. - * |[21] |CMPIEN |CAPCMPF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPCMPF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPCMPF can trigger Input Capture interrupt Enabled. - * |[24] |CNTEN |Input Capture Counter Start Counting Control - * | | |Setting this bit to 1, the capture counter (ECAP_CNT) starts up-counting synchronously with the clock from the . - * | | |0 = ECAP_CNT stop counting. - * | | |1 = ECAP_CNT starts up-counting. - * |[25] |CMPCLREN |Input Capture Counter Cleared by Compare-match Control - * | | |If this bit is set to 1, the capture counter (ECAP_CNT) will be cleared to 0 when the compare-match event (CAPCMPF = 1) occurs. - * | | |0 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Enabled. - * |[28] |CMPEN |Compare Function Enable Control - * | | |The compare function in input capture timer/counter is to compare the dynamic counting ECAP_CNT with the compare register ECAP_CNTCMP, if ECAP_CNT value reaches ECAP_CNTCMP, the flag CAPCMPF will be set. - * | | |0 = The compare function Disabled. - * | | |1 = The compare function Enabled. - * |[29] |CAPEN |Input Capture Timer/Counter Enable Control - * | | |0 = Input Capture function Disabled. - * | | |1 = Input Capture function Enabled. - * @var ECAP_T::CTL1 - * Offset: 0x18 Input Capture Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |EDGESEL0 |Channel 0 Captured Edge Selection - * | | |Input capture0 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[3:2] |EDGESEL1 |Channel 1 Captured Edge Selection - * | | |Input capture1 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[5:4] |EDGESEL2 |Channel 2 Captured Edge Selection - * | | |Input capture2 can detect falling edge change only, rising edge change only or both edge changes - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[8] |CAP0RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE0 Enable Bit - * | | |0 = The reload triggered by Event CAPTE0 Disabled. - * | | |1 = The reload triggered by Event CAPTE0 Enabled. - * |[9] |CAP1RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE1 Enable Bit - * | | |0 = The reload triggered by Event CAPTE1 Disabled. - * | | |1 = The reload triggered by Event CAPTE1 Enabled. - * |[10] |CAP2RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE2 Enable Bit - * | | |0 = The reload triggered by Event CAPTE2 Disabled. - * | | |1 = The reload triggered by Event CAPTE2 Enabled. - * |[11] |OVRLDEN |Capture Counteru2019s Reload Function Triggered by Overflow Enable Bit - * | | |0 = The reload triggered by CAPOV Disabled. - * | | |1 = The reload triggered by CAPOV Enabled. - * |[14:12] |CLKSEL |Capture Timer Clock Divide Selection - * | | |The capture timer clock has a pre-divider with eight divided options controlled by CLKSEL[2:0]. - * | | |000 = CAP_CLK/1. - * | | |001 = CAP_CLK/4. - * | | |010 = CAP_CLK/16. - * | | |011 = CAP_CLK/32. - * | | |100 = CAP_CLK/64. - * | | |101 = CAP_CLK/96. - * | | |110 = CAP_CLK/112. - * | | |111 = CAP_CLK/128. - * |[17:16] |CNTSRCSEL |Capture Timer/Counter Clock Source Selection - * | | |Select the capture timer/counter clock source. - * | | |00 = CAP_CLK (default). - * | | |01 = CAP0. - * | | |10 = CAP1. - * | | |11 = CAP2. - * |[20] |CAP0CLREN |Capture Counter Cleared by Capture Event0 Control - * | | |0 = Event CAPTE0 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE0 can clear capture counter (ECAP_CNT) Enabled. - * |[21] |CAP1CLREN |Capture Counter Cleared by Capture Event1 Control - * | | |0 = Event CAPTE1 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE1 can clear capture counter (ECAP_CNT) Enabled. - * |[22] |CAP2CLREN |Capture Counter Cleared by Capture Event2 Control - * | | |0 = Event CAPTE2 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE2 can clear capture counter (ECAP_CNT) Enabled. - * @var ECAP_T::STATUS - * Offset: 0x1C Input Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPTF0 |Input Capture Channel 0 Triggered Flag - * | | |When the input capture channel 0 detects a valid edge change at CAP0 input, it will set flag CAPTF0 to high. - * | | |0 = No valid edge change has been detected at CAP0 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP0 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[1] |CAPTF1 |Input Capture Channel 1 Triggered Flag - * | | |When the input capture channel 1 detects a valid edge change at CAP1 input, it will set flag CAPTF1 to high. - * | | |0 = No valid edge change has been detected at CAP1 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP1 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[2] |CAPTF2 |Input Capture Channel 2 Triggered Flag - * | | |When the input capture channel 2 detects a valid edge change at CAP2 input, it will set flag CAPTF2 to high. - * | | |0 = No valid edge change has been detected at CAP2 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP2 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[4] |CAPCMPF |Input Capture Compare-match Flag - * | | |If the input capture compare function is enabled, the flag is set by hardware when capture counter (ECAP_CNT) up counts and reaches the ECAP_CNTCMP value. - * | | |0 = ECAP_CNT has not matched ECAP_CNTCMP value since last clear. - * | | |1 = ECAP_CNT has matched ECAP_CNTCMP value at least once since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[5] |CAPOVF |Input Capture Counter Overflow Flag - * | | |Flag is set by hardware when counter (ECAP_CNT) overflows from 0x00FF_FFFF to zero. - * | | |0 = No overflow event has occurred since last clear. - * | | |1 = Overflow event(s) has/have occurred since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[6] |CAP0 |Value of Input Channel 0, CAP0 (Read Only) - * | | |Reflecting the value of input channel 0, CAP0 - * | | |(The bit is read only and write is ignored) - * |[7] |CAP1 |Value of Input Channel 1, CAP1 (Read Only) - * | | |Reflecting the value of input channel 1, CAP1 - * | | |(The bit is read only and write is ignored) - * |[8] |CAP2 |Value of Input Channel 2, CAP2 (Read Only) - * | | |Reflecting the value of input channel 2, CAP2. - * | | |(The bit is read only and write is ignored) - */ - __IO uint32_t CNT; /*!< [0x0000] Input Capture Counter */ - __IO uint32_t HLD0; /*!< [0x0004] Input Capture Hold Register 0 */ - __IO uint32_t HLD1; /*!< [0x0008] Input Capture Hold Register 1 */ - __IO uint32_t HLD2; /*!< [0x000c] Input Capture Hold Register 2 */ - __IO uint32_t CNTCMP; /*!< [0x0010] Input Capture Compare Register */ - __IO uint32_t CTL0; /*!< [0x0014] Input Capture Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0018] Input Capture Control Register 1 */ - __IO uint32_t STATUS; /*!< [0x001c] Input Capture Status Register */ - -} ECAP_T; - -/** - @addtogroup ECAP_CONST ECAP Bit Field Definition - Constant Definitions for ECAP Controller -@{ */ - -#define ECAP_CNT_CNT_Pos (0) /*!< ECAP_T::CNT: CNT Position */ -#define ECAP_CNT_CNT_Msk (0xfffffful << ECAP_CNT_CNT_Pos) /*!< ECAP_T::CNT: CNT Mask */ - -#define ECAP_HLD0_HOLD_Pos (0) /*!< ECAP_T::HLD0: HOLD Position */ -#define ECAP_HLD0_HOLD_Msk (0xfffffful << ECAP_HLD0_HOLD_Pos) /*!< ECAP_T::HLD0: HOLD Mask */ - -#define ECAP_HLD1_HOLD_Pos (0) /*!< ECAP_T::HLD1: HOLD Position */ -#define ECAP_HLD1_HOLD_Msk (0xfffffful << ECAP_HLD1_HOLD_Pos) /*!< ECAP_T::HLD1: HOLD Mask */ - -#define ECAP_HLD2_HOLD_Pos (0) /*!< ECAP_T::HLD2: HOLD Position */ -#define ECAP_HLD2_HOLD_Msk (0xfffffful << ECAP_HLD2_HOLD_Pos) /*!< ECAP_T::HLD2: HOLD Mask */ - -#define ECAP_CNTCMP_CNTCMP_Pos (0) /*!< ECAP_T::CNTCMP: CNTCMP Position */ -#define ECAP_CNTCMP_CNTCMP_Msk (0xfffffful << ECAP_CNTCMP_CNTCMP_Pos) /*!< ECAP_T::CNTCMP: CNTCMP Mask */ - -#define ECAP_CTL0_NFCLKSEL_Pos (0) /*!< ECAP_T::CTL0: NFCLKSEL Position */ -#define ECAP_CTL0_NFCLKSEL_Msk (0x7ul << ECAP_CTL0_NFCLKSEL_Pos) /*!< ECAP_T::CTL0: NFCLKSEL Mask */ - -#define ECAP_CTL0_CAPNFDIS_Pos (3) /*!< ECAP_T::CTL0: CAPNFDIS Position */ -#define ECAP_CTL0_CAPNFDIS_Msk (0x1ul << ECAP_CTL0_CAPNFDIS_Pos) /*!< ECAP_T::CTL0: CAPNFDIS Mask */ - -#define ECAP_CTL0_IC0EN_Pos (4) /*!< ECAP_T::CTL0: IC0EN Position */ -#define ECAP_CTL0_IC0EN_Msk (0x1ul << ECAP_CTL0_IC0EN_Pos) /*!< ECAP_T::CTL0: IC0EN Mask */ - -#define ECAP_CTL0_IC1EN_Pos (5) /*!< ECAP_T::CTL0: IC1EN Position */ -#define ECAP_CTL0_IC1EN_Msk (0x1ul << ECAP_CTL0_IC1EN_Pos) /*!< ECAP_T::CTL0: IC1EN Mask */ - -#define ECAP_CTL0_IC2EN_Pos (6) /*!< ECAP_T::CTL0: IC2EN Position */ -#define ECAP_CTL0_IC2EN_Msk (0x1ul << ECAP_CTL0_IC2EN_Pos) /*!< ECAP_T::CTL0: IC2EN Mask */ - -#define ECAP_CTL0_CAPSEL0_Pos (8) /*!< ECAP_T::CTL0: CAPSEL0 Position */ -#define ECAP_CTL0_CAPSEL0_Msk (0x3ul << ECAP_CTL0_CAPSEL0_Pos) /*!< ECAP_T::CTL0: CAPSEL0 Mask */ - -#define ECAP_CTL0_CAPSEL1_Pos (10) /*!< ECAP_T::CTL0: CAPSEL1 Position */ -#define ECAP_CTL0_CAPSEL1_Msk (0x3ul << ECAP_CTL0_CAPSEL1_Pos) /*!< ECAP_T::CTL0: CAPSEL1 Mask */ - -#define ECAP_CTL0_CAPSEL2_Pos (12) /*!< ECAP_T::CTL0: CAPSEL2 Position */ -#define ECAP_CTL0_CAPSEL2_Msk (0x3ul << ECAP_CTL0_CAPSEL2_Pos) /*!< ECAP_T::CTL0: CAPSEL2 Mask */ - -#define ECAP_CTL0_CAPIEN0_Pos (16) /*!< ECAP_T::CTL0: CAPIEN0 Position */ -#define ECAP_CTL0_CAPIEN0_Msk (0x1ul << ECAP_CTL0_CAPIEN0_Pos) /*!< ECAP_T::CTL0: CAPIEN0 Mask */ - -#define ECAP_CTL0_CAPIEN1_Pos (17) /*!< ECAP_T::CTL0: CAPIEN1 Position */ -#define ECAP_CTL0_CAPIEN1_Msk (0x1ul << ECAP_CTL0_CAPIEN1_Pos) /*!< ECAP_T::CTL0: CAPIEN1 Mask */ - -#define ECAP_CTL0_CAPIEN2_Pos (18) /*!< ECAP_T::CTL0: CAPIEN2 Position */ -#define ECAP_CTL0_CAPIEN2_Msk (0x1ul << ECAP_CTL0_CAPIEN2_Pos) /*!< ECAP_T::CTL0: CAPIEN2 Mask */ - -#define ECAP_CTL0_OVIEN_Pos (20) /*!< ECAP_T::CTL0: OVIEN Position */ -#define ECAP_CTL0_OVIEN_Msk (0x1ul << ECAP_CTL0_OVIEN_Pos) /*!< ECAP_T::CTL0: OVIEN Mask */ - -#define ECAP_CTL0_CMPIEN_Pos (21) /*!< ECAP_T::CTL0: CMPIEN Position */ -#define ECAP_CTL0_CMPIEN_Msk (0x1ul << ECAP_CTL0_CMPIEN_Pos) /*!< ECAP_T::CTL0: CMPIEN Mask */ - -#define ECAP_CTL0_CNTEN_Pos (24) /*!< ECAP_T::CTL0: CNTEN Position */ -#define ECAP_CTL0_CNTEN_Msk (0x1ul << ECAP_CTL0_CNTEN_Pos) /*!< ECAP_T::CTL0: CNTEN Mask */ - -#define ECAP_CTL0_CMPCLREN_Pos (25) /*!< ECAP_T::CTL0: CMPCLREN Position */ -#define ECAP_CTL0_CMPCLREN_Msk (0x1ul << ECAP_CTL0_CMPCLREN_Pos) /*!< ECAP_T::CTL0: CMPCLREN Mask */ - -#define ECAP_CTL0_CMPEN_Pos (28) /*!< ECAP_T::CTL0: CMPEN Position */ -#define ECAP_CTL0_CMPEN_Msk (0x1ul << ECAP_CTL0_CMPEN_Pos) /*!< ECAP_T::CTL0: CMPEN Mask */ - -#define ECAP_CTL0_CAPEN_Pos (29) /*!< ECAP_T::CTL0: CAPEN Position */ -#define ECAP_CTL0_CAPEN_Msk (0x1ul << ECAP_CTL0_CAPEN_Pos) /*!< ECAP_T::CTL0: CAPEN Mask */ - -#define ECAP_CTL1_EDGESEL0_Pos (0) /*!< ECAP_T::CTL1: EDGESEL0 Position */ -#define ECAP_CTL1_EDGESEL0_Msk (0x3ul << ECAP_CTL1_EDGESEL0_Pos) /*!< ECAP_T::CTL1: EDGESEL0 Mask */ - -#define ECAP_CTL1_EDGESEL1_Pos (2) /*!< ECAP_T::CTL1: EDGESEL1 Position */ -#define ECAP_CTL1_EDGESEL1_Msk (0x3ul << ECAP_CTL1_EDGESEL1_Pos) /*!< ECAP_T::CTL1: EDGESEL1 Mask */ - -#define ECAP_CTL1_EDGESEL2_Pos (4) /*!< ECAP_T::CTL1: EDGESEL2 Position */ -#define ECAP_CTL1_EDGESEL2_Msk (0x3ul << ECAP_CTL1_EDGESEL2_Pos) /*!< ECAP_T::CTL1: EDGESEL2 Mask */ - -#define ECAP_CTL1_CAP0RLDEN_Pos (8) /*!< ECAP_T::CTL1: CAP0RLDEN Position */ -#define ECAP_CTL1_CAP0RLDEN_Msk (0x1ul << ECAP_CTL1_CAP0RLDEN_Pos) /*!< ECAP_T::CTL1: CAP0RLDEN Mask */ - -#define ECAP_CTL1_CAP1RLDEN_Pos (9) /*!< ECAP_T::CTL1: CAP1RLDEN Position */ -#define ECAP_CTL1_CAP1RLDEN_Msk (0x1ul << ECAP_CTL1_CAP1RLDEN_Pos) /*!< ECAP_T::CTL1: CAP1RLDEN Mask */ - -#define ECAP_CTL1_CAP2RLDEN_Pos (10) /*!< ECAP_T::CTL1: CAP2RLDEN Position */ -#define ECAP_CTL1_CAP2RLDEN_Msk (0x1ul << ECAP_CTL1_CAP2RLDEN_Pos) /*!< ECAP_T::CTL1: CAP2RLDEN Mask */ - -#define ECAP_CTL1_OVRLDEN_Pos (11) /*!< ECAP_T::CTL1: OVRLDEN Position */ -#define ECAP_CTL1_OVRLDEN_Msk (0x1ul << ECAP_CTL1_OVRLDEN_Pos) /*!< ECAP_T::CTL1: OVRLDEN Mask */ - -#define ECAP_CTL1_CLKSEL_Pos (12) /*!< ECAP_T::CTL1: CLKSEL Position */ -#define ECAP_CTL1_CLKSEL_Msk (0x7ul << ECAP_CTL1_CLKSEL_Pos) /*!< ECAP_T::CTL1: CLKSEL Mask */ - -#define ECAP_CTL1_CNTSRCSEL_Pos (16) /*!< ECAP_T::CTL1: CNTSRCSEL Position */ -#define ECAP_CTL1_CNTSRCSEL_Msk (0x3ul << ECAP_CTL1_CNTSRCSEL_Pos) /*!< ECAP_T::CTL1: CNTSRCSEL Mask */ - -#define ECAP_CTL1_CAP0CLREN_Pos (20) /*!< ECAP_T::CTL1: CAP0CLREN Position */ -#define ECAP_CTL1_CAP0CLREN_Msk (0x1ul << ECAP_CTL1_CAP0CLREN_Pos) /*!< ECAP_T::CTL1: CAP0CLREN Mask */ - -#define ECAP_CTL1_CAP1CLREN_Pos (21) /*!< ECAP_T::CTL1: CAP1CLREN Position */ -#define ECAP_CTL1_CAP1CLREN_Msk (0x1ul << ECAP_CTL1_CAP1CLREN_Pos) /*!< ECAP_T::CTL1: CAP1CLREN Mask */ - -#define ECAP_CTL1_CAP2CLREN_Pos (22) /*!< ECAP_T::CTL1: CAP2CLREN Position */ -#define ECAP_CTL1_CAP2CLREN_Msk (0x1ul << ECAP_CTL1_CAP2CLREN_Pos) /*!< ECAP_T::CTL1: CAP2CLREN Mask */ - -#define ECAP_STATUS_CAPTF0_Pos (0) /*!< ECAP_T::STATUS: CAPTF0 Position */ -#define ECAP_STATUS_CAPTF0_Msk (0x1ul << ECAP_STATUS_CAPTF0_Pos) /*!< ECAP_T::STATUS: CAPTF0 Mask */ - -#define ECAP_STATUS_CAPTF1_Pos (1) /*!< ECAP_T::STATUS: CAPTF1 Position */ -#define ECAP_STATUS_CAPTF1_Msk (0x1ul << ECAP_STATUS_CAPTF1_Pos) /*!< ECAP_T::STATUS: CAPTF1 Mask */ - -#define ECAP_STATUS_CAPTF2_Pos (2) /*!< ECAP_T::STATUS: CAPTF2 Position */ -#define ECAP_STATUS_CAPTF2_Msk (0x1ul << ECAP_STATUS_CAPTF2_Pos) /*!< ECAP_T::STATUS: CAPTF2 Mask */ - -#define ECAP_STATUS_CAPCMPF_Pos (4) /*!< ECAP_T::STATUS: CAPCMPF Position */ -#define ECAP_STATUS_CAPCMPF_Msk (0x1ul << ECAP_STATUS_CAPCMPF_Pos) /*!< ECAP_T::STATUS: CAPCMPF Mask */ - -#define ECAP_STATUS_CAPOVF_Pos (5) /*!< ECAP_T::STATUS: CAPOVF Position */ -#define ECAP_STATUS_CAPOVF_Msk (0x1ul << ECAP_STATUS_CAPOVF_Pos) /*!< ECAP_T::STATUS: CAPOVF Mask */ - -#define ECAP_STATUS_CAP0_Pos (8) /*!< ECAP_T::STATUS: CAP0 Position */ -#define ECAP_STATUS_CAP0_Msk (0x1ul << ECAP_STATUS_CAP0_Pos) /*!< ECAP_T::STATUS: CAP0 Mask */ - -#define ECAP_STATUS_CAP1_Pos (9) /*!< ECAP_T::STATUS: CAP1 Position */ -#define ECAP_STATUS_CAP1_Msk (0x1ul << ECAP_STATUS_CAP1_Pos) /*!< ECAP_T::STATUS: CAP1 Mask */ - -#define ECAP_STATUS_CAP2_Pos (10) /*!< ECAP_T::STATUS: CAP2 Position */ -#define ECAP_STATUS_CAP2_Msk (0x1ul << ECAP_STATUS_CAP2_Pos) /*!< ECAP_T::STATUS: CAP2 Mask */ - -/**@}*/ /* ECAP_CONST */ -/**@}*/ /* end of ECAP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __ECAP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/emac_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/emac_reg.h deleted file mode 100644 index f9ad5efceb5..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/emac_reg.h +++ /dev/null @@ -1,2063 +0,0 @@ -/**************************************************************************//** - * @file emac_reg.h - * @version V1.00 - * @brief EMAC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EMAC_REG_H__ -#define __EMAC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EMAC Ethernet MAC Controller(EMAC) - Memory Mapped Structure for EMAC Controller -@{ */ - -typedef struct -{ - - /** - * @var EMAC_T::CAMCTL - * Offset: 0x00 CAM Comparison Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AUP |Accept Unicast Packet - * | | |The AUP controls the unicast packet reception - * | | |If AUP is enabled, EMAC receives all incoming packet its destination MAC address is a unicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all unicast packets. - * |[1] |AMP |Accept Multicast Packet - * | | |The AMP controls the multicast packet reception - * | | |If AMP is enabled, EMAC receives all incoming packet its destination MAC address is a multicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all multicast packets. - * |[2] |ABP |Accept Broadcast Packet - * | | |The ABP controls the broadcast packet reception - * | | |If ABP is enabled, EMAC receives all incoming packet its destination MAC address is a broadcast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all broadcast packets. - * |[3] |COMPEN |Complement CAM Comparison Enable Bit - * | | |The COMPEN controls the complement of the CAM comparison result - * | | |If the CMPEN and COMPEN are both enabled, the incoming packet with specific destination MAC address - * | | |configured in CAM entry will be dropped - * | | |And the incoming packet with destination MAC address does not configured in any CAM entry will be received. - * | | |0 = Complement CAM comparison result Disabled. - * | | |1 = Complement CAM comparison result Enabled. - * |[4] |CMPEN |CAM Compare Enable Bit - * | | |The CMPEN controls the enable of CAM comparison function for destination MAC address recognition - * | | |If software wants to receive a packet with specific destination MAC address, configures the MAC address - * | | |into CAM 12~0, then enables that CAM entry and set CMPEN to 1. - * | | |0 = CAM comparison function for destination MAC address recognition Disabled. - * | | |1 = CAM comparison function for destination MAC address recognition Enabled. - * @var EMAC_T::CAMEN - * Offset: 0x04 CAM Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAMxEN |CAM Entry X Enable Bit - * | | |The CAMxEN controls the validation of CAM entry x. - * | | |The CAM entry 13, 14 and 15 are for PAUSE control frame transmission - * | | |If software wants to transmit a PAUSE control frame out to network, the enable bits of these three CAM - * | | |entries all must be enabled first. - * | | |0 = CAM entry x Disabled. - * | | |1 = CAM entry x Enabled. - * @var EMAC_T::CAM0M - * Offset: 0x08 CAM0 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM0L - * Offset: 0x0C CAM0 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1M - * Offset: 0x10 CAM1 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1L - * Offset: 0x14 CAM1 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2M - * Offset: 0x18 CAM2 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2L - * Offset: 0x1C CAM2 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3M - * Offset: 0x20 CAM3 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3L - * Offset: 0x24 CAM3 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4M - * Offset: 0x28 CAM4 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4L - * Offset: 0x2C CAM4 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5M - * Offset: 0x30 CAM5 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5L - * Offset: 0x34 CAM5 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6M - * Offset: 0x38 CAM6 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6L - * Offset: 0x3C CAM6 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7M - * Offset: 0x40 CAM7 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7L - * Offset: 0x44 CAM7 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8M - * Offset: 0x48 CAM8 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8L - * Offset: 0x4C CAM8 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9M - * Offset: 0x50 CAM9 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9L - * Offset: 0x54 CAM9 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10M - * Offset: 0x58 CAM10 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10L - * Offset: 0x5C CAM10 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11M - * Offset: 0x60 CAM11 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11L - * Offset: 0x64 CAM11 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12M - * Offset: 0x68 CAM12 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12L - * Offset: 0x6C CAM12 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13M - * Offset: 0x70 CAM13 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13L - * Offset: 0x74 CAM13 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14M - * Offset: 0x78 CAM14 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14L - * Offset: 0x7C CAM14 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM15MSB - * Offset: 0x80 CAM15 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |OPCODE |OP Code Field of PAUSE Control Frame - * | | |In the PAUSE control frame, an op code field defined and is 0x0001. - * |[31:16] |LENGTH |LENGTH Field of PAUSE Control Frame - * | | |In the PAUSE control frame, a LENGTH field defined and is 0x8808. - * @var EMAC_T::CAM15LSB - * Offset: 0x84 CAM15 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:24] |OPERAND |Pause Parameter - * | | |In the PAUSE control frame, an OPERAND field defined and controls how much time the destination - * | | |Ethernet MAC Controller paused - * | | |The unit of the OPERAND is a slot time, the 512-bit time. - * @var EMAC_T::TXDSA - * Offset: 0x88 Transmit Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXDSA |Transmit Descriptor Link-list Start Address - * | | |The TXDSA keeps the start address of transmit descriptor link-list - * | | |If the software enables the bit TXON (EMAC_CTL[8]), the content of TXDSA will be loaded into the - * | | |current transmit descriptor start address register (EMAC_CTXDSA) - * | | |The TXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of TXDSA - * | | |This means that TX descriptors must locate at word boundary memory address. - * @var EMAC_T::RXDSA - * Offset: 0x8C Receive Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXDSA |Receive Descriptor Link-list Start Address - * | | |The RXDSA keeps the start address of receive descriptor link-list - * | | |If the S/W enables the bit RXON (EMAC_CTL[0]), the content of RXDSA will be loaded into the current - * | | |receive descriptor start address register (EMAC_CRXDSA) - * | | |The RXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of RXDSA - * | | |This means that RX descriptors must locate at word boundary memory address. - * @var EMAC_T::CTL - * Offset: 0x90 MAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXON |Frame Reception ON - * | | |The RXON controls the normal packet reception of EMAC - * | | |If the RXON is set to high, the EMAC starts the packet reception process, including the RX - * | | |descriptor fetching, packet reception and RX descriptor modification. - * | | |It is necessary to finish EMAC initial sequence before enable RXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the RXON is disabled during EMAC is receiving an incoming packet, the EMAC stops the packet - * | | |reception process after the current packet reception finished. - * | | |0 = Packet reception process stopped. - * | | |1 = Packet reception process started. - * |[1] |ALP |Accept Long Packet - * | | |The ALP controls the long packet, which packet length is greater than 1518 bytes, reception - * | | |If the ALP is set to high, the EMAC will accept the long packet. - * | | |Otherwise, the long packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the long packet. - * | | |1 = Ethernet MAC controller received the long packet. - * |[2] |ARP |Accept Runt Packet - * | | |The ARP controls the runt packet, which length is less than 64 bytes, reception - * | | |If the ARP is set to high, the EMAC will accept the runt packet. - * | | |Otherwise, the runt packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the runt packet. - * | | |1 = Ethernet MAC controller received the runt packet. - * |[3] |ACP |Accept Control Packet - * | | |The ACP controls the control frame reception - * | | |If the ACP is set to high, the EMAC will accept the control frame - * | | |Otherwise, the control frame will be dropped - * | | |It is recommended that S/W only enable ACP while EMAC is operating on full duplex mode. - * | | |0 = Ethernet MAC controller dropped the control frame. - * | | |1 = Ethernet MAC controller received the control frame. - * |[4] |AEP |Accept CRC Error Packet - * | | |The AEP controls the EMAC accepts or drops the CRC error packet - * | | |If the AEP is set to high, the incoming packet with CRC error will be received by EMAC as a good packet. - * | | |0 = Ethernet MAC controller dropped the CRC error packet. - * | | |1 = Ethernet MAC controller received the CRC error packet. - * |[5] |STRIPCRC |Strip CRC Checksum - * | | |The STRIPCRC controls if the length of incoming packet is calculated with 4 bytes CRC checksum - * | | |If the STRIPCRC is set to high, 4 bytes CRC checksum is excluded from length calculation of incoming packet. - * | | |0 = The 4 bytes CRC checksum is included in packet length calculation. - * | | |1 = The 4 bytes CRC checksum is excluded in packet length calculation. - * |[6] |WOLEN |Wake on LAN Enable Bit - * | | |The WOLEN high enables the functionality that Ethernet MAC controller checked if the incoming packet - * | | |is Magic Packet and wakeup system from Power-down mode. - * | | |If incoming packet was a Magic Packet and the system was in Power-down, the Ethernet MAC controller - * | | |would generate a wakeup event to wake system up from Power-down mode. - * | | |0 = Wake-up by Magic Packet function Disabled. - * | | |1 = Wake-up by Magic Packet function Enabled. - * |[8] |TXON |Frame Transmission ON - * | | |The TXON controls the normal packet transmission of EMAC - * | | |If the TXON is set to high, the EMAC starts the packet transmission process, including the TX - * | | |descriptor fetching, packet transmission and TX descriptor modification. - * | | |It is must to finish EMAC initial sequence before enable TXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the TXON is disabled during EMAC is transmitting a packet out, the EMAC stops the packet - * | | |transmission process after the current packet transmission finished. - * | | |0 = Packet transmission process stopped. - * | | |1 = Packet transmission process started. - * |[9] |NODEF |No Deferral - * | | |The NODEF controls the enable of deferral exceed counter - * | | |If NODEF is set to high, the deferral exceed counter is disabled - * | | |The NODEF is only useful while EMAC is operating on half duplex mode. - * | | |0 = The deferral exceed counter Enabled. - * | | |1 = The deferral exceed counter Disabled. - * |[16] |SDPZ |Send PAUSE Frame - * | | |The SDPZ controls the PAUSE control frame transmission. - * | | |If S/W wants to send a PAUSE control frame out, the CAM entry 13, 14 and 15 must be configured - * | | |first and the corresponding CAM enable bit of CAMEN register also must be set. - * | | |Then, set SDPZ to 1 enables the PAUSE control frame transmission. - * | | |The SDPZ is a self-clear bit - * | | |This means after the PAUSE control frame transmission has completed, the SDPZ will be cleared automatically. - * | | |It is recommended that only enabling SNDPAUSE while EMAC is operating in Full Duplex mode. - * | | |0 = PAUSE control frame transmission completed. - * | | |1 = PAUSE control frame transmission Enabled. - * |[17] |SQECHKEN |SQE Checking Enable Bit - * | | |The SQECHKEN controls the enable of SQE checking - * | | |The SQE checking is only available while EMAC is operating on 10M bps and half duplex mode - * | | |In other words, the SQECHKEN cannot affect EMAC operation, if the EMAC is operating on 100Mbps - * | | |or full duplex mode. - * | | |0 = SQE checking Disabled while EMAC is operating in 10Mbps and Half Duplex mode. - * | | |1 = SQE checking Enabled while EMAC is operating in 10Mbps and Half Duplex mode. - * |[18] |FUDUP |Full Duplex Mode Selection - * | | |The FUDUP controls that if EMAC is operating on full or half duplex mode. - * | | |0 = EMAC operates in half duplex mode. - * | | |1 = EMAC operates in full duplex mode. - * |[19] |RMIIRXCTL |RMII RX Control - * | | |The RMIIRXCTL control the receive data sample in RMII mode - * | | |It's necessary to set this bit high when RMIIEN (EMAC_CTL[ [22]) is high. - * | | |0 = RMII RX control disabled. - * | | |1 = RMII RX control enabled. - * |[20] |OPMODE |Operation Mode Selection - * | | |The OPMODE defines that if the EMAC is operating on 10M or 100M bps mode - * | | |The RST (EMAC_CTL[24]) would not affect OPMODE value. - * | | |0 = EMAC operates in 10Mbps mode. - * | | |1 = EMAC operates in 100Mbps mode. - * |[22] |RMIIEN |RMII Mode Enable Bit - * | | |This bit controls if Ethernet MAC controller connected with off-chip Ethernet PHY by MII - * | | |interface or RMII interface - * | | |The RST (EMAC_CTL[24]) would not affect RMIIEN value. - * | | |0 = Ethernet MAC controller RMII mode Disabled. - * | | |1 = Ethernet MAC controller RMII mode Enabled. - * | | |NOTE: This field must keep 1. - * |[24] |RST |Software Reset - * | | |The RST implements a reset function to make the EMAC return default state - * | | |The RST is a self-clear bit - * | | |This means after the software reset finished, the RST will be cleared automatically - * | | |Enable RST can also reset all control and status registers, exclusive of the control bits - * | | |RMIIEN (EMAC_CTL[22]), and OPMODE (EMAC_CTL[20]). - * | | |The EMAC re-initial is necessary after the software reset completed. - * | | |0 = Software reset completed. - * | | |1 = Software reset Enabled. - * @var EMAC_T::MIIMDAT - * Offset: 0x94 MII Management Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATA |MII Management Data - * | | |The DATA is the 16 bits data that will be written into the registers of external PHY for MII - * | | |Management write command or the data from the registers of external PHY for MII Management read command. - * @var EMAC_T::MIIMCTL - * Offset: 0x98 MII Management Control and Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PHYREG |PHY Register Address - * | | |The PHYREG keeps the address to indicate which register of external PHY is the target of the - * | | |MII management command. - * |[12:8] |PHYADDR |PHY Address - * | | |The PHYADDR keeps the address to differentiate which external PHY is the target of the MII management command. - * |[16] |WRITE |Write Command - * | | |The Write defines the MII management command is a read or write. - * | | |0 = MII management command is a read command. - * | | |1 = MII management command is a write command. - * |[17] |BUSY |Busy Bit - * | | |The BUSY controls the enable of the MII management frame generation - * | | |If S/W wants to access registers of external PHY, it set BUSY to high and EMAC generates - * | | |the MII management frame to external PHY through MII Management I/F - * | | |The BUSY is a self-clear bit - * | | |This means the BUSY will be cleared automatically after the MII management command finished. - * | | |0 = MII management command generation finished. - * | | |1 = MII management command generation Enabled. - * |[18] |PREAMSP |Preamble Suppress - * | | |The PREAMSP controls the preamble field generation of MII management frame - * | | |If the PREAMSP is set to high, the preamble field generation of MII management frame is skipped. - * | | |0 = Preamble field generation of MII management frame not skipped. - * | | |1 = Preamble field generation of MII management frame skipped. - * |[19] |MDCON |MDC Clock ON - * | | |The MDC controls the MDC clock generation. If the MDCON is set to high, the MDC clock is turned on. - * | | |0 = MDC clock off. - * | | |1 = MDC clock on. - * @var EMAC_T::FIFOCTL - * Offset: 0x9C FIFO Threshold Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RXFIFOTH |RXFIFO Low Threshold - * | | |The RXFIFOTH controls when RXDMA requests internal arbiter for data transfer between RXFIFO - * | | |and system memory - * | | |The RXFIFOTH defines not only the high threshold of RXFIFO, but also the low threshold - * | | |The low threshold is the half of high threshold always - * | | |During the packet reception, if the RXFIFO reaches the high threshold, the RXDMA starts to - * | | |transfer frame data from RXFIFO to system memory - * | | |If the frame data in RXFIFO is less than low threshold, RXDMA stops to transfer the frame - * | | |data to system memory. - * | | |00 = Depend on the burst length setting - * | | |If the burst length is 8 words, high threshold is 8 words, too. - * | | |01 = RXFIFO high threshold is 64B and low threshold is 32B. - * | | |10 = RXFIFO high threshold is 128B and low threshold is 64B. - * | | |11 = RXFIFO high threshold is 192B and low threshold is 96B. - * |[9:8] |TXFIFOTH |TXFIFO Low Threshold - * | | |The TXFIFOTH controls when TXDMA requests internal arbiter for data transfer between system - * | | |memory and TXFIFO - * | | |The TXFIFOTH defines not only the low threshold of TXFIFO, but also the high threshold - * | | |The high threshold is the twice of low threshold always - * | | |During the packet transmission, if the TXFIFO reaches the high threshold, the TXDMA stops - * | | |generate request to transfer frame data from system memory to TXFIFO - * | | |If the frame data in TXFIFO is less than low threshold, TXDMA starts to transfer frame data - * | | |from system memory to TXFIFO. - * | | |The TXFIFOTH also defines when the TXMAC starts to transmit frame out to network - * | | |The TXMAC starts to transmit the frame out while the TXFIFO first time reaches the high threshold - * | | |during the transmission of the frame - * | | |If the frame data length is less than TXFIFO high threshold, the TXMAC starts to transmit the frame - * | | |out after the frame data are all inside the TXFIFO. - * | | |00 = Undefined. - * | | |01 = TXFIFO low threshold is 64B and high threshold is 128B. - * | | |10 = TXFIFO low threshold is 80B and high threshold is 160B. - * | | |11 = TXFIFO low threshold is 96B and high threshold is 192B. - * |[21:20] |BURSTLEN |DMA Burst Length - * | | |This defines the burst length of AHB bus cycle while EMAC accesses system memory. - * | | |00 = 4 words. - * | | |01 = 8 words. - * | | |10 = 16 words. - * | | |11 = 16 words. - * @var EMAC_T::TXST - * Offset: 0xA0 Transmit Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXST |Transmit Start Demand - * | | |If the TX descriptor is not available for use of TXDMA after the TXON (EMAC_CTL[8]) is enabled, - * | | |the FSM (Finite State Machine) of TXDMA enters the Halt state and the frame transmission is halted - * | | |After the S/W has prepared the new TX descriptor for frame transmission, it must issue a write - * | | |command to EMAC_TXST register to make TXDMA to leave Halt state and continue the frame transmission. - * | | |The EMAC_TXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_TXST register takes effect only when TXDMA stayed at Halt state. - * @var EMAC_T::RXST - * Offset: 0xA4 Receive Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXST |Receive Start Demand - * | | |If the RX descriptor is not available for use of RXDMA after the RXON (EMAC_CTL[0]) is enabled, - * | | |the FSM (Finite State Machine) of RXDMA enters the Halt state and the frame reception is halted - * | | |After the S/W has prepared the new RX descriptor for frame reception, it must issue a write - * | | |command to EMAC_RXST register to make RXDMA to leave Halt state and continue the frame reception. - * | | |The EMAC_RXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_RXST register take effect only when RXDMA stayed at Halt state. - * @var EMAC_T::MRFL - * Offset: 0xA8 Maximum Receive Frame Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MRFL |Maximum Receive Frame Length - * | | |The MRFL defines the maximum frame length for received frame - * | | |If the frame length of received frame is greater than MRFL, and bit MFLEIEN (EMAC_INTEN[8]) - * | | |is also enabled, the bit MFLEIF (EMAC_INTSTS[8]) is set and the RX interrupt is triggered. - * | | |It is recommended that only use MRFL to qualify the length of received frame while S/W wants to - * | | |receive a frame which length is greater than 1518 bytes. - * @var EMAC_T::INTEN - * Offset: 0xAC MAC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIEN |Receive Interrupt Enable Bit - * | | |The RXIEN controls the RX interrupt generation. - * | | |If RXIEN is enabled and RXIF (EMAC_INTSTS[0]) is high, EMAC generates the RX interrupt to CPU - * | | |If RXIEN is disabled, no RX interrupt is generated to CPU even any status bit EMAC_INTSTS[15:1] - * | | |is set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive RX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any RX interrupt from EMAC, disables this bit. - * | | |0 = RXIF (EMAC_INTSTS[0]) is masked and RX interrupt generation Disabled. - * | | |1 = RXIF (EMAC_INTSTS[0]) is not masked and RX interrupt generation Enabled. - * |[1] |CRCEIEN |CRC Error Interrupt Enable Bit - * | | |The CRCEIEN controls the CRCEIF (EMAC_INTSTS[1]) interrupt generation - * | | |If CRCEIF (EMAC_INTSTS[1]) is set, and both CRCEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CRCEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CRCEIF (EMAC_INTSTS[1]) is set. - * | | |0 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Disabled. - * | | |1 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Enabled. - * |[2] |RXOVIEN |Receive FIFO Overflow Interrupt Enable Bit - * | | |The RXOVIEN controls the RXOVIF (EMAC_INTSTS[2]) interrupt generation - * | | |If RXOVIF (EMAC_INTSTS[2]) is set, and both RXOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXOVIF (EMAC_INTSTS[2]) is set. - * | | |0 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Disabled. - * | | |1 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Enabled. - * |[3] |LPIEN |Long Packet Interrupt Enable Bit - * | | |The LPIEN controls the LPIF (EMAC_INTSTS[3]) interrupt generation - * | | |If LPIF (EMAC_INTSTS[3]) is set, and both LPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If LPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the LPIF - * | | |(EMAC_INTSTS[3]) is set. - * | | |0 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Disabled. - * | | |1 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Enabled. - * |[4] |RXGDIEN |Receive Good Interrupt Enable Bit - * | | |The RXGDIEN controls the RXGDIF (EMAC_INTSTS[4]) interrupt generation - * | | |If RXGDIF (EMAC_INTSTS[4]) is set, and both RXGDIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXGDIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXGDIF (EMAC_INTSTS[4]) is set. - * | | |0 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Disabled. - * | | |1 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Enabled. - * |[5] |ALIEIEN |Alignment Error Interrupt Enable Bit - * | | |The ALIEIEN controls the ALIEIF (EMAC_INTSTS[5]) interrupt generation - * | | |If ALIEIF (EMAC_INTSTS[5]) is set, and both ALIEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If ALIEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |ALIEIF (EMAC_INTSTS[5]) is set. - * | | |0 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Disabled. - * | | |1 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Enabled. - * |[6] |RPIEN |Runt Packet Interrupt Enable Bit - * | | |The RPIEN controls the RPIF (EMAC_INTSTS[6]) interrupt generation - * | | |If RPIF (EMAC_INTSTS[6]) is set, and both RPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If RPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RPIF (EMAC_INTSTS[6]) is set. - * | | |0 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Disabled. - * | | |1 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Enabled. - * |[7] |MPCOVIEN |Miss Packet Counter Overrun Interrupt Enable Bit - * | | |The MPCOVIEN controls the MPCOVIF (EMAC_INTSTS[7]) interrupt generation - * | | |If MPCOVIF (EMAC_INTSTS[7]) is set, and both MPCOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If MPCOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MPCOVIF (EMAC_INTSTS[7]) is set. - * | | |0 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Disabled. - * | | |1 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Enabled. - * |[8] |MFLEIEN |Maximum Frame Length Exceed Interrupt Enable Bit - * | | |The MFLEIEN controls the MFLEIF (EMAC_INTSTS[8]) interrupt generation - * | | |If MFLEIF (EMAC_INTSTS[8]) is set, and both MFLEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If MFLEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MFLEIF (EMAC_INTSTS[8]) is set. - * | | |0 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Disabled. - * | | |1 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Enabled. - * |[9] |DENIEN |DMA Early Notification Interrupt Enable Bit - * | | |The DENIEN controls the DENIF (EMAC_INTSTS[9]) interrupt generation - * | | |If DENIF (EMAC_INTSTS[9]) is set, and both DENIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If DENIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |DENIF (EMAC_INTSTS[9]) is set. - * | | |0 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Disabled. - * | | |1 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Enabled. - * |[10] |RDUIEN |Receive Descriptor Unavailable Interrupt Enable Bit - * | | |The RDUIEN controls the RDUIF (EMAC_INTSTS[10]) interrupt generation - * | | |If RDUIF (EMAC_INTSTS[10]) is set, and both RDUIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RDUIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RDUIF (EMAC_MIOSTA[10]) register is set. - * | | |0 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Disabled. - * | | |1 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Enabled. - * |[11] |RXBEIEN |Receive Bus Error Interrupt Enable Bit - * | | |The RXBEIEN controls the RXBEIF (EMAC_INTSTS[11]) interrupt generation - * | | |If RXBEIF (EMAC_INTSTS[11]) is set, and both RXBEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXBEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXBEIF (EMAC_INTSTS[11]) is set. - * | | |0 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Disabled. - * | | |1 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Enabled. - * |[14] |CFRIEN |Control Frame Receive Interrupt Enable Bit - * | | |The CFRIEN controls the CFRIF (EMAC_INTSTS[14]) interrupt generation - * | | |If CFRIF (EMAC_INTSTS[14]) is set, and both CFRIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CFRIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CFRIF (EMAC_INTSTS[14]) register is set. - * | | |0 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Disabled. - * | | |1 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Enabled. - * |[15] |WOLIEN |Wake on LAN Interrupt Enable Bit - * | | |The WOLIEN controls the WOLIF (EMAC_INTSTS[15]) interrupt generation - * | | |If WOLIF (EMAC_INTSTS[15]) is set, and both WOLIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If WOLIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |WOLIF (EMAC_INTSTS[15]) is set. - * | | |0 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Disabled. - * | | |1 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Enabled. - * |[16] |TXIEN |Transmit Interrupt Enable Bit - * | | |The TXIEN controls the TX interrupt generation. - * | | |If TXIEN is enabled and TXIF (EMAC_INTSTS[16]) is high, EMAC generates the TX interrupt to CPU - * | | |If TXIEN is disabled, no TX interrupt is generated to CPU even any status bit of - * | | |EMAC_INTSTS[24:17] set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive TX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any TX interrupt from EMAC, disables this bit. - * | | |0 = TXIF (EMAC_INTSTS[16]) is masked and TX interrupt generation Disabled. - * | | |1 = TXIF (EMAC_INTSTS[16]) is not masked and TX interrupt generation Enabled. - * |[17] |TXUDIEN |Transmit FIFO Underflow Interrupt Enable Bit - * | | |The TXUDIEN controls the TXUDIF (EMAC_INTSTS[17]) interrupt generation - * | | |If TXUDIF (EMAC_INTSTS[17]) is set, and both TXUDIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXUDIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even - * | | |the TXUDIF (EMAC_INTSTS[17]) is set. - * | | |0 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Disabled. - * | | |1 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Enabled. - * |[18] |TXCPIEN |Transmit Completion Interrupt Enable Bit - * | | |The TXCPIEN controls the TXCPIF (EMAC_INTSTS[18]) interrupt generation - * | | |If TXCPIF (EMAC_INTSTS[18]) is set, and both TXCPIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXCPIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXCPIF (EMAC_INTSTS[18]) is set. - * | | |0 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Disabled. - * | | |1 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Enabled. - * |[19] |EXDEFIEN |Defer Exceed Interrupt Enable Bit - * | | |The EXDEFIEN controls the EXDEFIF (EMAC_INTSTS[19]) interrupt generation - * | | |If EXDEFIF (EMAC_INTSTS[19]) is set, and both EXDEFIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If EXDEFIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |EXDEFIF (EMAC_INTSTS[19]) is set. - * | | |0 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Disabled. - * | | |1 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Enabled. - * |[20] |NCSIEN |No Carrier Sense Interrupt Enable Bit - * | | |The NCSIEN controls the NCSIF (EMAC_INTSTS[20]) interrupt generation - * | | |If NCSIF (EMAC_INTSTS[20]) is set, and both NCSIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If NCSIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |NCSIF (EMAC_INTSTS[20]) is set. - * | | |0 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Disabled. - * | | |1 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Enabled. - * |[21] |TXABTIEN |Transmit Abort Interrupt Enable Bit - * | | |The TXABTIEN controls the TXABTIF (EMAC_INTSTS[21]) interrupt generation - * | | |If TXABTIF (EMAC_INTSTS[21]) is set, and both TXABTIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXABTIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXABTIF (EMAC_INTSTS[21]) is set. - * | | |0 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Disabled. - * | | |1 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Enabled. - * |[22] |LCIEN |Late Collision Interrupt Enable Bit - * | | |The LCIEN controls the LCIF (EMAC_INTSTS[22]) interrupt generation - * | | |If LCIF (EMAC_INTSTS[22]) is set, and both LCIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If LCIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |LCIF (EMAC_INTSTS[22]) is set. - * | | |0 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Disabled. - * | | |1 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Enabled. - * |[23] |TDUIEN |Transmit Descriptor Unavailable Interrupt Enable Bit - * | | |The TDUIEN controls the TDUIF (EMAC_INTSTS[23]) interrupt generation - * | | |If TDUIF (EMAC_INTSTS[23]) is set, and both TDUIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TDUIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TDUIF (EMAC_INTSTS[23]) is set. - * | | |0 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Disabled. - * | | |1 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Enabled. - * |[24] |TXBEIEN |Transmit Bus Error Interrupt Enable Bit - * | | |The TXBEIEN controls the TXBEIF (EMAC_INTSTS[24]) interrupt generation - * | | |If TXBEIF (EMAC_INTSTS[24]) is set, and both TXBEIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TXBEIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXBEIF (EMAC_INTSTS[24]) is set. - * | | |0 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Disabled. - * | | |1 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Enabled. - * |[28] |TSALMIEN |Time Stamp Alarm Interrupt Enable Bit - * | | |The TSALMIEN controls the TSALMIF (EMAC_INTSTS[28]) interrupt generation - * | | |If TSALMIF (EMAC_INTSTS[28]) is set, and both TSALMIEN and TXIEN (EMAC_INTEN[16]) enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TSALMIEN or TXIEN (EMAC_INTEN[16]) disabled, no TX interrupt generated to CPU even the - * | | |TXTSALMIF (EMAC_INTEN[28]) is set. - * | | |0 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Disabled. - * | | |1 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Enabled. - * @var EMAC_T::INTSTS - * Offset: 0xB0 MAC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIF |Receive Interrupt - * | | |The RXIF indicates the RX interrupt status. - * | | |If RXIF high and its corresponding enable bit, RXIEN (EMAC_INTEN[0]), is also high indicates - * | | |the EMAC generates RX interrupt to CPU - * | | |If RXIF is high but RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated. - * | | |The RXIF is logic OR result of bit logic AND result of EMAC_INTSTS[15:1] and EMAC_INTEN[15:1] - * | | |In other words, if any bit of EMAC_INTSTS[15:1] is high and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is also enabled, the RXIF will be high. - * | | |Because the RXIF is a logic OR result, clears EMAC_INTSTS[15:1] makes RXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[15:1] is set or no enable bit in EMAC_INTEN[15:1] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[15:1] is set and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is enabled, too. - * |[1] |CRCEIF |CRC Error Interrupt - * | | |The CRCEIF high indicates the incoming packet incurred the CRC error and the packet is dropped - * | | |If the AEP (EMAC_CTL[4]) is set, the CRC error packet will be regarded as a good packet and - * | | |CRCEIF will not be set. - * | | |If the CRCEIF is high and CRCEIEN (EMAC_INTEN[1]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CRCEIF status. - * | | |0 = The frame does not incur CRC error. - * | | |1 = The frame incurred CRC error. - * |[2] |RXOVIF |Receive FIFO Overflow Interrupt - * | | |The RXOVIF high indicates the RXFIFO overflow occurred during packet reception - * | | |While the RXFIFO overflow occurred, the EMAC drops the current receiving packer - * | | |If the RXFIFO overflow occurred often, it is recommended that modify RXFIFO threshold control, - * | | |the RXFIFOTH of FFTCR register, to higher level. - * | | |If the RXOVIF is high and RXOVIEN (EMAC_INTEN[2]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXOVIF status. - * | | |0 = No RXFIFO overflow occurred during packet reception. - * | | |1 = RXFIFO overflow occurred during packet reception. - * |[3] |LPIF |Long Packet Interrupt Flag - * | | |The LPIF high indicates the length of the incoming packet is greater than 1518 bytes and the - * | | |incoming packet is dropped - * | | |If the ALP (EMAC_CTL[1]) is set, the long packet will be regarded as a good packet and LPIF will not be set. - * | | |If the LPIF is high and LPIEN (EMAC_INTEN[3]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the LPIF status. - * | | |0 = The incoming frame is not a long frame or S/W wants to receive a long frame. - * | | |1 = The incoming frame is a long frame and dropped. - * |[4] |RXGDIF |Receive Good Interrupt - * | | |The RXGDIF high indicates the frame reception has completed. - * | | |If the RXGDIF is high and RXGDIEN (EAMC_MIEN[4]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXGDIF status. - * | | |0 = The frame reception has not complete yet. - * | | |1 = The frame reception has completed. - * |[5] |ALIEIF |Alignment Error Interrupt - * | | |The ALIEIF high indicates the length of the incoming frame is not a multiple of byte - * | | |If the ALIEIF is high and ALIEIEN (EMAC_INTEN[5]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the ALIEIF status. - * | | |0 = The frame length is a multiple of byte. - * | | |1 = The frame length is not a multiple of byte. - * |[6] |RPIF |Runt Packet Interrupt - * | | |The RPIF high indicates the length of the incoming packet is less than 64 bytes and the packet is dropped - * | | |If the ARP (EMAC_CTL[2]) is set, the short packet is regarded as a good packet and RPIF will not be set. - * | | |If the RPIF is high and RPIEN (EMAC_INTEN[6]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RPIF status. - * | | |0 = The incoming frame is not a short frame or S/W wants to receive a short frame. - * | | |1 = The incoming frame is a short frame and dropped. - * |[7] |MPCOVIF |Missed Packet Counter Overrun Interrupt Flag - * | | |The MPCOVIF high indicates the MPCNT, Missed Packet Count, has overflow - * | | |If the MPCOVIF is high and MPCOVIEN (EMAC_INTEN[7]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MPCOVIF status. - * | | |0 = The MPCNT has not rolled over yet. - * | | |1 = The MPCNT has rolled over yet. - * |[8] |MFLEIF |Maximum Frame Length Exceed Interrupt Flag - * | | |The MFLEIF high indicates the length of the incoming packet has exceeded the length limitation - * | | |configured in DMARFC register and the incoming packet is dropped - * | | |If the MFLEIF is high and MFLEIEN (EMAC_INTEN[8]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MFLEIF status. - * | | |0 = The length of the incoming packet does not exceed the length limitation configured in DMARFC. - * | | |1 = The length of the incoming packet has exceeded the length limitation configured in DMARFC. - * |[9] |DENIF |DMA Early Notification Interrupt - * | | |The DENIF high indicates the EMAC has received the LENGTH field of the incoming packet. - * | | |If the DENIF is high and DENIENI (EMAC_INTEN[9]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the DENIF status. - * | | |0 = The LENGTH field of incoming packet has not received yet. - * | | |1 = The LENGTH field of incoming packet has received. - * |[10] |RDUIF |Receive Descriptor Unavailable Interrupt - * | | |The RDUIF high indicates that there is no available RX descriptor for packet reception and - * | | |RXDMA will stay at Halt state - * | | |Once, the RXDMA enters the Halt state, S/W must issues a write command to RSDR register to - * | | |make RXDMA leave Halt state while new RX descriptor is available. - * | | |If the RDUIF is high and RDUIEN (EMAC_INTEN[10]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RDUIF status. - * | | |0 = RX descriptor is available. - * | | |1 = RX descriptor is unavailable. - * |[11] |RXBEIF |Receive Bus Error Interrupt - * | | |The RXBEIF high indicates the memory controller replies ERROR response while EMAC access - * | | |system memory through RXDMA during packet reception process - * | | |Reset EMAC is recommended while RXBEIF status is high. - * | | |If the RXBEIF is high and RXBEIEN (EMAC_INTEN[11]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[14] |CFRIF |Control Frame Receive Interrupt - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |If the CFRIF is high and CFRIEN (EMAC_INTEN[14]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CFRIF status. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[15] |WOLIF |Wake on LAN Interrupt Flag - * | | |The WOLIF high indicates EMAC receives a Magic Packet - * | | |The CFRIF only available while system is in power down mode and WOLEN is set high. - * | | |If the WOLIF is high and WOLIEN (EMAC_INTEN[15]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the WOLIF status. - * | | |0 = The EMAC does not receive the Magic Packet. - * | | |1 = The EMAC receives a Magic Packet. - * |[16] |TXIF |Transmit Interrupt - * | | |The TXIF indicates the TX interrupt status. - * | | |If TXIF high and its corresponding enable bit, TXIEN (EMAC_INTEN[16]), is also high indicates - * | | |the EMAC generates TX interrupt to CPU - * | | |If TXIF is high but TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated. - * | | |The TXIF is logic OR result of bit logic AND result of EMAC_INTSTS[28:17] and EMAC_INTEN[28:17] - * | | |In other words, if any bit of EMAC_INTSTS[28:17] is high and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is also enabled, the TXIF will be high - * | | |Because the TXIF is a logic OR result, clears EMAC_INTSTS[28:17] makes TXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[28:17] is set or no enable bit in EMAC_INTEN[28:17] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[28:17] is set and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is enabled, too. - * |[17] |TXUDIF |Transmit FIFO Underflow Interrupt - * | | |The TXUDIF high indicates the TXFIFO underflow occurred during packet transmission - * | | |While the TXFIFO underflow occurred, the EMAC will retransmit the packet automatically - * | | |without S/W intervention - * | | |If the TXFIFO underflow occurred often, it is recommended that modify TXFIFO threshold control, - * | | |the TXFIFOTH of FFTCR register, to higher level. - * | | |If the TXUDIF is high and TXUDIEN (EMAC_INTEN[17]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXUDIF status. - * | | |0 = No TXFIFO underflow occurred during packet transmission. - * | | |1 = TXFIFO underflow occurred during packet transmission. - * |[18] |TXCPIF |Transmit Completion Interrupt - * | | |The TXCPIF indicates the packet transmission has completed correctly. - * | | |If the TXCPIF is high and TXCPIEN (EMAC_INTEN[18]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXCPIF status. - * | | |0 = The packet transmission not completed. - * | | |1 = The packet transmission has completed. - * |[19] |EXDEFIF |Defer Exceed Interrupt - * | | |The EXDEFIF high indicates the frame waiting for transmission has deferred over 0.32768ms - * | | |on 100Mbps mode, or 3.2768ms on 10Mbps mode. - * | | |The deferral exceed check will only be done while bit NODEF of MCMDR is disabled, and EMAC - * | | |is operating on half-duplex mode. - * | | |If the EXDEFIF is high and EXDEFIEN (EMAC_INTEN[19]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the EXDEFIF status. - * | | |0 = Frame waiting for transmission has not deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * | | |1 = Frame waiting for transmission has deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * |[20] |NCSIF |No Carrier Sense Interrupt - * | | |The NCSIF high indicates the MII I/F signal CRS does not active at the start of or during - * | | |the packet transmission - * | | |The NCSIF is only available while EMAC is operating on half-duplex mode - * | | |If the NCSIF is high and NCSIEN (EMAC_INTEN[20]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the NCSIF status. - * | | |0 = CRS signal actives correctly. - * | | |1 = CRS signal does not active at the start of or during the packet transmission. - * |[21] |TXABTIF |Transmit Abort Interrupt - * | | |The TXABTIF high indicates the packet incurred 16 consecutive collisions during transmission, - * | | |and then the transmission process for this packet is aborted - * | | |The transmission abort is only available while EMAC is operating on half-duplex mode. - * | | |If the TXABTIF is high and TXABTIEN (EMAC_INTEN[21]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXABTIF status. - * | | |0 = Packet does not incur 16 consecutive collisions during transmission. - * | | |1 = Packet incurred 16 consecutive collisions during transmission. - * |[22] |LCIF |Late Collision Interrupt - * | | |The LCIF high indicates the collision occurred in the outside of 64 bytes collision window - * | | |This means after the 64 bytes of a frame has been transmitted out to the network, the collision - * | | |still occurred. - * | | |The late collision check will only be done while EMAC is operating on half-duplex mode - * | | |If the LCIF is high and LCIEN (EMAC_INTEN[22]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the LCIF status. - * | | |0 = No collision occurred in the outside of 64 bytes collision window. - * | | |1 = Collision occurred in the outside of 64 bytes collision window. - * |[23] |TDUIF |Transmit Descriptor Unavailable Interrupt - * | | |The TDUIF high indicates that there is no available TX descriptor for packet transmission and - * | | |TXDMA will stay at Halt state. - * | | |Once, the TXDMA enters the Halt state, S/W must issues a write command to TSDR register to make - * | | |TXDMA leave Halt state while new TX descriptor is available. - * | | |If the TDUIF is high and TDUIEN (EMAC_INTEN[23]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TDUIF status. - * | | |0 = TX descriptor is available. - * | | |1 = TX descriptor is unavailable. - * |[24] |TXBEIF |Transmit Bus Error Interrupt - * | | |The TXBEIF high indicates the memory controller replies ERROR response while EMAC access system - * | | |memory through TXDMA during packet transmission process - * | | |Reset EMAC is recommended while TXBEIF status is high. - * | | |If the TXBEIF is high and TXBEIEN (EMAC_INTEN[24]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[28] |TSALMIF |Time Stamp Alarm Interrupt - * | | |The TSALMIF high indicates the EMAC_TSSEC register value equals to EMAC_ALMSEC register and - * | | |EMAC_TSSUBSEC register value equals to register EMAC_ALMSUBLSR. - * | | |If TSALMIF is high and TSALMIEN (EMAC_INTEN[28]) enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TSALMIF status. - * | | |0 = EMAC_TSSEC did not equal EMAC_ALMSEC or EMAC_TSSUBSEC did not equal EMAC_ALMSUBSEC. - * | | |1 = EMAC_TSSEC equals EMAC_ALMSEC and EMAC_TSSUBSEC equals EMAC_ALMSUBSEC. - * @var EMAC_T::GENSTS - * Offset: 0xB4 MAC General Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CFR |Control Frame Received - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[1] |RXHALT |Receive Halted - * | | |The RXHALT high indicates the next normal packet reception process will be halted because - * | | |the bit RXON of MCMDR is disabled be S/W. - * | | |0 = Next normal packet reception process will go on. - * | | |1 = Next normal packet reception process will be halted. - * |[2] |RXFFULL |RXFIFO Full - * | | |The RXFFULL indicates the RXFIFO is full due to four 64-byte packets are kept in RXFIFO - * | | |and the following incoming packet will be dropped. - * | | |0 = The RXFIFO is not full. - * | | |1 = The RXFIFO is full and the following incoming packet will be dropped. - * |[7:4] |COLCNT |Collision Count - * | | |The COLCNT indicates that how many collisions occurred consecutively during a packet transmission - * | | |If the packet incurred 16 consecutive collisions during transmission, the COLCNT will be - * | | |0 and bit TXABTIF will be set to 1. - * |[8] |DEF |Deferred Transmission - * | | |The DEF high indicates the packet transmission has deferred once - * | | |The DEF is only available while EMAC is operating on half-duplex mode. - * | | |0 = Packet transmission does not defer. - * | | |1 = Packet transmission has deferred once. - * |[9] |TXPAUSED |Transmission Paused - * | | |The TXPAUSED high indicates the next normal packet transmission process will be paused temporally - * | | |because EMAC received a PAUSE control frame. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be paused. - * |[10] |SQE |Signal Quality Error - * | | |The SQE high indicates the SQE error found at end of packet transmission on 10Mbps half-duplex mode - * | | |The SQE error check will only be done while both bit SQECHKEN (EMAC_CTL[17]) is enabled and EMAC - * | | |is operating on 10Mbps half-duplex mode. - * | | |0 = No SQE error found at end of packet transmission. - * | | |1 = SQE error found at end of packet transmission. - * |[11] |TXHALT |Transmission Halted - * | | |The TXHALT high indicates the next normal packet transmission process will be halted because - * | | |the bit TXON (EMAC_CTL[8]) is disabled be S/W. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be halted. - * |[12] |RPSTS |Remote Pause Status - * | | |The RPSTS indicates that remote pause counter down counting actives. - * | | |After Ethernet MAC controller sent PAUSE frame out successfully, it starts the remote pause - * | | |counter down counting - * | | |When this bit high, it's predictable that remote Ethernet MAC controller wouldn't start the packet - * | | |transmission until the down counting done. - * | | |0 = Remote pause counter down counting done. - * | | |1 = Remote pause counter down counting actives. - * @var EMAC_T::MPCNT - * Offset: 0xB8 Missed Packet Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MPCNT |Miss Packet Count - * | | |The MPCNT indicates the number of packets that were dropped due to various types of receive errors - * | | |The following type of receiving error makes missed packet counter increase: - * | | |1. Incoming packet is incurred RXFIFO overflow. - * | | |2. Incoming packet is dropped due to RXON is disabled. - * | | |3. Incoming packet is incurred CRC error. - * @var EMAC_T::RPCNT - * Offset: 0xBC MAC Receive Pause Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RPCNT |MAC Receive Pause Count - * | | |The RPCNT keeps the OPERAND field of the PAUSE control frame - * | | |It indicates how many slot time (512 bit time) the TX of EMAC will be paused. - * @var EMAC_T::FRSTS - * Offset: 0xC8 DMA Receive Frame Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXFLT |Receive Frame LENGTH - * | | |The RXFLT keeps the LENGTH field of each incoming Ethernet packet - * | | |If the bit DENIEN (EMAC_INTEN[9]) is enabled and the LENGTH field of incoming packet has - * | | |received, the bit DENIF (EMAC_INTSTS[9]) will be set and trigger interrupt. - * | | |And, the content of LENGTH field will be stored in RXFLT. - * @var EMAC_T::CTXDSA - * Offset: 0xCC Current Transmit Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXDSA |Current Transmit Descriptor Start Address - * | | |The CTXDSA keeps the start address of TX descriptor that is used by TXDMA currently - * | | |The CTXDSA is read only and write to this register has no effect. - * @var EMAC_T::CTXBSA - * Offset: 0xD0 Current Transmit Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXBSA |Current Transmit Buffer Start Address - * | | |The CTXDSA keeps the start address of TX frame buffer that is used by TXDMA currently - * | | |The CTXBSA is read only and write to this register has no effect. - * @var EMAC_T::CRXDSA - * Offset: 0xD4 Current Receive Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXDSA |Current Receive Descriptor Start Address - * | | |The CRXDSA keeps the start address of RX descriptor that is used by RXDMA currently - * | | |The CRXDSA is read only and write to this register has no effect. - * @var EMAC_T::CRXBSA - * Offset: 0xD8 Current Receive Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXBSA |Current Receive Buffer Start Address - * | | |The CRXBSA keeps the start address of RX frame buffer that is used by RXDMA currently - * | | |The CRXBSA is read only and write to this register has no effect. - * @var EMAC_T::TSCTL - * Offset: 0x100 Time Stamp Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TSEN |Time Stamp Function Enable Bit - * | | |This bit controls if the IEEE 1588 PTP time stamp function is enabled or not. - * | | |Set this bit high to enable IEEE 1588 PTP time stamp function while set this bit low - * | | |to disable IEEE 1588 PTP time stamp function. - * | | |0 = I EEE 1588 PTP time stamp function Disabled. - * | | |1 = IEEE 1588 PTP time stamp function Enabled. - * |[1] |TSIEN |Time Stamp Counter Initialization Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to load value of register EMAC_UPDSEC - * | | |and EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the load operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = Time stamp counter initialization done. - * | | |1 = Time stamp counter initialization Enabled. - * |[2] |TSMODE |Time Stamp Fine Update Enable Bit - * | | |This bit chooses the time stamp counter update mode. - * | | |0 = Time stamp counter is in coarse update mode. - * | | |1 = Time stamp counter is in fine update mode. - * |[3] |TSUPDATE |Time Stamp Counter Time Update Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to add value of register EMAC_UPDSEC and - * | | |EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the add operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = No action. - * | | |1 = EMAC_UPDSEC updated to EMAC_TSSEC and EMAC_UPDSUBSEC updated to EMAC_TSSUBSEC. - * |[5] |TSALMEN |Time Stamp Alarm Enable Bit - * | | |Set this bit high enable Ethernet MAC controller to set TSALMIF (EMAC_INTSTS[28]) high when - * | | |EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |0 = Alarm disabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |1 = Alarm enabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * @var EMAC_T::TSSEC - * Offset: 0x110 Time Stamp Counter Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second - * | | |This register reflects the bit [63:32] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSSUBSEC - * Offset: 0x114 Time Stamp Counter Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second - * | | |This register reflects the bit [31:0] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the sub-second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSINC - * Offset: 0x118 Time Stamp Increment Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNTINC |Time Stamp Counter Increment - * | | |Time stamp counter increment value. - * | | |If TSEN (EMAC_TSCTL[0]) is high, EMAC adds EMAC_TSSUBSEC with this 8-bit value every - * | | |time when it wants to increase the EMAC_TSSUBSEC value. - * @var EMAC_T::TSADDEND - * Offset: 0x11C Time Stamp Addend Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDEND |Time Stamp Counter Addend - * | | |This register keeps a 32-bit value for accumulator to enable increment of EMAC_TSSUBSEC. - * | | |If TSEN (EMAC_TSCTL[0]) and TSMODE (EMAC_TSCTL[2]) are both high, EMAC increases accumulator - * | | |with this 32-bit value in each HCLK - * | | |Once the accumulator is overflow, it generates a enable to increase EMAC_TSSUBSEC with an 8-bit - * | | |value kept in register EMAC_TSINC. - * @var EMAC_T::UPDSEC - * Offset: 0x120 Time Stamp Update Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSEC with this 32-bit value. - * @var EMAC_T::UPDSUBSEC - * Offset: 0x124 Time Stamp Update Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSUBSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSUBSEC with this 32-bit value. - * @var EMAC_T::ALMSEC - * Offset: 0x128 Time Stamp Alarm Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Alarm - * | | |Time stamp counter second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - * @var EMAC_T::ALMSUBSEC - * Offset: 0x12C Time Stamp Alarm Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Alarm - * | | |Time stamp counter sub-second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - */ - __IO uint32_t CAMCTL; /*!< [0x0000] CAM Comparison Control Register */ - __IO uint32_t CAMEN; /*!< [0x0004] CAM Enable Register */ - __IO uint32_t CAM0M; /*!< [0x0008] CAM0 Most Significant Word Register */ - __IO uint32_t CAM0L; /*!< [0x000c] CAM0 Least Significant Word Register */ - __IO uint32_t CAM1M; /*!< [0x0010] CAM1 Most Significant Word Register */ - __IO uint32_t CAM1L; /*!< [0x0014] CAM1 Least Significant Word Register */ - __IO uint32_t CAM2M; /*!< [0x0018] CAM2 Most Significant Word Register */ - __IO uint32_t CAM2L; /*!< [0x001c] CAM2 Least Significant Word Register */ - __IO uint32_t CAM3M; /*!< [0x0020] CAM3 Most Significant Word Register */ - __IO uint32_t CAM3L; /*!< [0x0024] CAM3 Least Significant Word Register */ - __IO uint32_t CAM4M; /*!< [0x0028] CAM4 Most Significant Word Register */ - __IO uint32_t CAM4L; /*!< [0x002c] CAM4 Least Significant Word Register */ - __IO uint32_t CAM5M; /*!< [0x0030] CAM5 Most Significant Word Register */ - __IO uint32_t CAM5L; /*!< [0x0034] CAM5 Least Significant Word Register */ - __IO uint32_t CAM6M; /*!< [0x0038] CAM6 Most Significant Word Register */ - __IO uint32_t CAM6L; /*!< [0x003c] CAM6 Least Significant Word Register */ - __IO uint32_t CAM7M; /*!< [0x0040] CAM7 Most Significant Word Register */ - __IO uint32_t CAM7L; /*!< [0x0044] CAM7 Least Significant Word Register */ - __IO uint32_t CAM8M; /*!< [0x0048] CAM8 Most Significant Word Register */ - __IO uint32_t CAM8L; /*!< [0x004c] CAM8 Least Significant Word Register */ - __IO uint32_t CAM9M; /*!< [0x0050] CAM9 Most Significant Word Register */ - __IO uint32_t CAM9L; /*!< [0x0054] CAM9 Least Significant Word Register */ - __IO uint32_t CAM10M; /*!< [0x0058] CAM10 Most Significant Word Register */ - __IO uint32_t CAM10L; /*!< [0x005c] CAM10 Least Significant Word Register */ - __IO uint32_t CAM11M; /*!< [0x0060] CAM11 Most Significant Word Register */ - __IO uint32_t CAM11L; /*!< [0x0064] CAM11 Least Significant Word Register */ - __IO uint32_t CAM12M; /*!< [0x0068] CAM12 Most Significant Word Register */ - __IO uint32_t CAM12L; /*!< [0x006c] CAM12 Least Significant Word Register */ - __IO uint32_t CAM13M; /*!< [0x0070] CAM13 Most Significant Word Register */ - __IO uint32_t CAM13L; /*!< [0x0074] CAM13 Least Significant Word Register */ - __IO uint32_t CAM14M; /*!< [0x0078] CAM14 Most Significant Word Register */ - __IO uint32_t CAM14L; /*!< [0x007c] CAM14 Least Significant Word Register */ - __IO uint32_t CAM15MSB; /*!< [0x0080] CAM15 Most Significant Word Register */ - __IO uint32_t CAM15LSB; /*!< [0x0084] CAM15 Least Significant Word Register */ - __IO uint32_t TXDSA; /*!< [0x0088] Transmit Descriptor Link List Start Address Register */ - __IO uint32_t RXDSA; /*!< [0x008c] Receive Descriptor Link List Start Address Register */ - __IO uint32_t CTL; /*!< [0x0090] MAC Control Register */ - __IO uint32_t MIIMDAT; /*!< [0x0094] MII Management Data Register */ - __IO uint32_t MIIMCTL; /*!< [0x0098] MII Management Control and Address Register */ - __IO uint32_t FIFOCTL; /*!< [0x009c] FIFO Threshold Control Register */ - __O uint32_t TXST; /*!< [0x00a0] Transmit Start Demand Register */ - __O uint32_t RXST; /*!< [0x00a4] Receive Start Demand Register */ - __IO uint32_t MRFL; /*!< [0x00a8] Maximum Receive Frame Control Register */ - __IO uint32_t INTEN; /*!< [0x00ac] MAC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x00b0] MAC Interrupt Status Register */ - __IO uint32_t GENSTS; /*!< [0x00b4] MAC General Status Register */ - __IO uint32_t MPCNT; /*!< [0x00b8] Missed Packet Count Register */ - __I uint32_t RPCNT; /*!< [0x00bc] MAC Receive Pause Count Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[2]; - /** @endcond */ - __IO uint32_t FRSTS; /*!< [0x00c8] DMA Receive Frame Status Register */ - __I uint32_t CTXDSA; /*!< [0x00cc] Current Transmit Descriptor Start Address Register */ - __I uint32_t CTXBSA; /*!< [0x00d0] Current Transmit Buffer Start Address Register */ - __I uint32_t CRXDSA; /*!< [0x00d4] Current Receive Descriptor Start Address Register */ - __I uint32_t CRXBSA; /*!< [0x00d8] Current Receive Buffer Start Address Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE1[9]; - /** @endcond */ - __IO uint32_t TSCTL; /*!< [0x0100] Time Stamp Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE2[3]; - /** @endcond */ - __I uint32_t TSSEC; /*!< [0x0110] Time Stamp Counter Second Register */ - __I uint32_t TSSUBSEC; /*!< [0x0114] Time Stamp Counter Sub Second Register */ - __IO uint32_t TSINC; /*!< [0x0118] Time Stamp Increment Register */ - __IO uint32_t TSADDEND; /*!< [0x011c] Time Stamp Addend Register */ - __IO uint32_t UPDSEC; /*!< [0x0120] Time Stamp Update Second Register */ - __IO uint32_t UPDSUBSEC; /*!< [0x0124] Time Stamp Update Sub Second Register */ - __IO uint32_t ALMSEC; /*!< [0x0128] Time Stamp Alarm Second Register */ - __IO uint32_t ALMSUBSEC; /*!< [0x012c] Time Stamp Alarm Sub Second Register */ - -} EMAC_T; - -/** - @addtogroup EMAC_CONST EMAC Bit Field Definition - Constant Definitions for EMAC Controller -@{ */ - -#define EMAC_CAMCTL_AUP_Pos (0) /*!< EMAC_T::CAMCTL: AUP Position */ -#define EMAC_CAMCTL_AUP_Msk (0x1ul << EMAC_CAMCTL_AUP_Pos) /*!< EMAC_T::CAMCTL: AUP Mask */ - -#define EMAC_CAMCTL_AMP_Pos (1) /*!< EMAC_T::CAMCTL: AMP Position */ -#define EMAC_CAMCTL_AMP_Msk (0x1ul << EMAC_CAMCTL_AMP_Pos) /*!< EMAC_T::CAMCTL: AMP Mask */ - -#define EMAC_CAMCTL_ABP_Pos (2) /*!< EMAC_T::CAMCTL: ABP Position */ -#define EMAC_CAMCTL_ABP_Msk (0x1ul << EMAC_CAMCTL_ABP_Pos) /*!< EMAC_T::CAMCTL: ABP Mask */ - -#define EMAC_CAMCTL_COMPEN_Pos (3) /*!< EMAC_T::CAMCTL: COMPEN Position */ -#define EMAC_CAMCTL_COMPEN_Msk (0x1ul << EMAC_CAMCTL_COMPEN_Pos) /*!< EMAC_T::CAMCTL: COMPEN Mask */ - -#define EMAC_CAMCTL_CMPEN_Pos (4) /*!< EMAC_T::CAMCTL: CMPEN Position */ -#define EMAC_CAMCTL_CMPEN_Msk (0x1ul << EMAC_CAMCTL_CMPEN_Pos) /*!< EMAC_T::CAMCTL: CMPEN Mask */ - -#define EMAC_CAMEN_CAMxEN_Pos (0) /*!< EMAC_T::CAMEN: CAMxEN Position */ -#define EMAC_CAMEN_CAMxEN_Msk (0x1ul << EMAC_CAMEN_CAMxEN_Pos) /*!< EMAC_T::CAMEN: CAMxEN Mask */ - -#define EMAC_CAM0M_MACADDR2_Pos (0) /*!< EMAC_T::CAM0M: MACADDR2 Position */ -#define EMAC_CAM0M_MACADDR2_Msk (0xfful << EMAC_CAM0M_MACADDR2_Pos) /*!< EMAC_T::CAM0M: MACADDR2 Mask */ - -#define EMAC_CAM0M_MACADDR3_Pos (8) /*!< EMAC_T::CAM0M: MACADDR3 Position */ -#define EMAC_CAM0M_MACADDR3_Msk (0xfful << EMAC_CAM0M_MACADDR3_Pos) /*!< EMAC_T::CAM0M: MACADDR3 Mask */ - -#define EMAC_CAM0M_MACADDR4_Pos (16) /*!< EMAC_T::CAM0M: MACADDR4 Position */ -#define EMAC_CAM0M_MACADDR4_Msk (0xfful << EMAC_CAM0M_MACADDR4_Pos) /*!< EMAC_T::CAM0M: MACADDR4 Mask */ - -#define EMAC_CAM0M_MACADDR5_Pos (24) /*!< EMAC_T::CAM0M: MACADDR5 Position */ -#define EMAC_CAM0M_MACADDR5_Msk (0xfful << EMAC_CAM0M_MACADDR5_Pos) /*!< EMAC_T::CAM0M: MACADDR5 Mask */ - -#define EMAC_CAM0L_MACADDR0_Pos (16) /*!< EMAC_T::CAM0L: MACADDR0 Position */ -#define EMAC_CAM0L_MACADDR0_Msk (0xfful << EMAC_CAM0L_MACADDR0_Pos) /*!< EMAC_T::CAM0L: MACADDR0 Mask */ - -#define EMAC_CAM0L_MACADDR1_Pos (24) /*!< EMAC_T::CAM0L: MACADDR1 Position */ -#define EMAC_CAM0L_MACADDR1_Msk (0xfful << EMAC_CAM0L_MACADDR1_Pos) /*!< EMAC_T::CAM0L: MACADDR1 Mask */ - -#define EMAC_CAM1M_MACADDR2_Pos (0) /*!< EMAC_T::CAM1M: MACADDR2 Position */ -#define EMAC_CAM1M_MACADDR2_Msk (0xfful << EMAC_CAM1M_MACADDR2_Pos) /*!< EMAC_T::CAM1M: MACADDR2 Mask */ - -#define EMAC_CAM1M_MACADDR3_Pos (8) /*!< EMAC_T::CAM1M: MACADDR3 Position */ -#define EMAC_CAM1M_MACADDR3_Msk (0xfful << EMAC_CAM1M_MACADDR3_Pos) /*!< EMAC_T::CAM1M: MACADDR3 Mask */ - -#define EMAC_CAM1M_MACADDR4_Pos (16) /*!< EMAC_T::CAM1M: MACADDR4 Position */ -#define EMAC_CAM1M_MACADDR4_Msk (0xfful << EMAC_CAM1M_MACADDR4_Pos) /*!< EMAC_T::CAM1M: MACADDR4 Mask */ - -#define EMAC_CAM1M_MACADDR5_Pos (24) /*!< EMAC_T::CAM1M: MACADDR5 Position */ -#define EMAC_CAM1M_MACADDR5_Msk (0xfful << EMAC_CAM1M_MACADDR5_Pos) /*!< EMAC_T::CAM1M: MACADDR5 Mask */ - -#define EMAC_CAM1L_MACADDR0_Pos (16) /*!< EMAC_T::CAM1L: MACADDR0 Position */ -#define EMAC_CAM1L_MACADDR0_Msk (0xfful << EMAC_CAM1L_MACADDR0_Pos) /*!< EMAC_T::CAM1L: MACADDR0 Mask */ - -#define EMAC_CAM1L_MACADDR1_Pos (24) /*!< EMAC_T::CAM1L: MACADDR1 Position */ -#define EMAC_CAM1L_MACADDR1_Msk (0xfful << EMAC_CAM1L_MACADDR1_Pos) /*!< EMAC_T::CAM1L: MACADDR1 Mask */ - -#define EMAC_CAM2M_MACADDR2_Pos (0) /*!< EMAC_T::CAM2M: MACADDR2 Position */ -#define EMAC_CAM2M_MACADDR2_Msk (0xfful << EMAC_CAM2M_MACADDR2_Pos) /*!< EMAC_T::CAM2M: MACADDR2 Mask */ - -#define EMAC_CAM2M_MACADDR3_Pos (8) /*!< EMAC_T::CAM2M: MACADDR3 Position */ -#define EMAC_CAM2M_MACADDR3_Msk (0xfful << EMAC_CAM2M_MACADDR3_Pos) /*!< EMAC_T::CAM2M: MACADDR3 Mask */ - -#define EMAC_CAM2M_MACADDR4_Pos (16) /*!< EMAC_T::CAM2M: MACADDR4 Position */ -#define EMAC_CAM2M_MACADDR4_Msk (0xfful << EMAC_CAM2M_MACADDR4_Pos) /*!< EMAC_T::CAM2M: MACADDR4 Mask */ - -#define EMAC_CAM2M_MACADDR5_Pos (24) /*!< EMAC_T::CAM2M: MACADDR5 Position */ -#define EMAC_CAM2M_MACADDR5_Msk (0xfful << EMAC_CAM2M_MACADDR5_Pos) /*!< EMAC_T::CAM2M: MACADDR5 Mask */ - -#define EMAC_CAM2L_MACADDR0_Pos (16) /*!< EMAC_T::CAM2L: MACADDR0 Position */ -#define EMAC_CAM2L_MACADDR0_Msk (0xfful << EMAC_CAM2L_MACADDR0_Pos) /*!< EMAC_T::CAM2L: MACADDR0 Mask */ - -#define EMAC_CAM2L_MACADDR1_Pos (24) /*!< EMAC_T::CAM2L: MACADDR1 Position */ -#define EMAC_CAM2L_MACADDR1_Msk (0xfful << EMAC_CAM2L_MACADDR1_Pos) /*!< EMAC_T::CAM2L: MACADDR1 Mask */ - -#define EMAC_CAM3M_MACADDR2_Pos (0) /*!< EMAC_T::CAM3M: MACADDR2 Position */ -#define EMAC_CAM3M_MACADDR2_Msk (0xfful << EMAC_CAM3M_MACADDR2_Pos) /*!< EMAC_T::CAM3M: MACADDR2 Mask */ - -#define EMAC_CAM3M_MACADDR3_Pos (8) /*!< EMAC_T::CAM3M: MACADDR3 Position */ -#define EMAC_CAM3M_MACADDR3_Msk (0xfful << EMAC_CAM3M_MACADDR3_Pos) /*!< EMAC_T::CAM3M: MACADDR3 Mask */ - -#define EMAC_CAM3M_MACADDR4_Pos (16) /*!< EMAC_T::CAM3M: MACADDR4 Position */ -#define EMAC_CAM3M_MACADDR4_Msk (0xfful << EMAC_CAM3M_MACADDR4_Pos) /*!< EMAC_T::CAM3M: MACADDR4 Mask */ - -#define EMAC_CAM3M_MACADDR5_Pos (24) /*!< EMAC_T::CAM3M: MACADDR5 Position */ -#define EMAC_CAM3M_MACADDR5_Msk (0xfful << EMAC_CAM3M_MACADDR5_Pos) /*!< EMAC_T::CAM3M: MACADDR5 Mask */ - -#define EMAC_CAM3L_MACADDR0_Pos (16) /*!< EMAC_T::CAM3L: MACADDR0 Position */ -#define EMAC_CAM3L_MACADDR0_Msk (0xfful << EMAC_CAM3L_MACADDR0_Pos) /*!< EMAC_T::CAM3L: MACADDR0 Mask */ - -#define EMAC_CAM3L_MACADDR1_Pos (24) /*!< EMAC_T::CAM3L: MACADDR1 Position */ -#define EMAC_CAM3L_MACADDR1_Msk (0xfful << EMAC_CAM3L_MACADDR1_Pos) /*!< EMAC_T::CAM3L: MACADDR1 Mask */ - -#define EMAC_CAM4M_MACADDR2_Pos (0) /*!< EMAC_T::CAM4M: MACADDR2 Position */ -#define EMAC_CAM4M_MACADDR2_Msk (0xfful << EMAC_CAM4M_MACADDR2_Pos) /*!< EMAC_T::CAM4M: MACADDR2 Mask */ - -#define EMAC_CAM4M_MACADDR3_Pos (8) /*!< EMAC_T::CAM4M: MACADDR3 Position */ -#define EMAC_CAM4M_MACADDR3_Msk (0xfful << EMAC_CAM4M_MACADDR3_Pos) /*!< EMAC_T::CAM4M: MACADDR3 Mask */ - -#define EMAC_CAM4M_MACADDR4_Pos (16) /*!< EMAC_T::CAM4M: MACADDR4 Position */ -#define EMAC_CAM4M_MACADDR4_Msk (0xfful << EMAC_CAM4M_MACADDR4_Pos) /*!< EMAC_T::CAM4M: MACADDR4 Mask */ - -#define EMAC_CAM4M_MACADDR5_Pos (24) /*!< EMAC_T::CAM4M: MACADDR5 Position */ -#define EMAC_CAM4M_MACADDR5_Msk (0xfful << EMAC_CAM4M_MACADDR5_Pos) /*!< EMAC_T::CAM4M: MACADDR5 Mask */ - -#define EMAC_CAM4L_MACADDR0_Pos (16) /*!< EMAC_T::CAM4L: MACADDR0 Position */ -#define EMAC_CAM4L_MACADDR0_Msk (0xfful << EMAC_CAM4L_MACADDR0_Pos) /*!< EMAC_T::CAM4L: MACADDR0 Mask */ - -#define EMAC_CAM4L_MACADDR1_Pos (24) /*!< EMAC_T::CAM4L: MACADDR1 Position */ -#define EMAC_CAM4L_MACADDR1_Msk (0xfful << EMAC_CAM4L_MACADDR1_Pos) /*!< EMAC_T::CAM4L: MACADDR1 Mask */ - -#define EMAC_CAM5M_MACADDR2_Pos (0) /*!< EMAC_T::CAM5M: MACADDR2 Position */ -#define EMAC_CAM5M_MACADDR2_Msk (0xfful << EMAC_CAM5M_MACADDR2_Pos) /*!< EMAC_T::CAM5M: MACADDR2 Mask */ - -#define EMAC_CAM5M_MACADDR3_Pos (8) /*!< EMAC_T::CAM5M: MACADDR3 Position */ -#define EMAC_CAM5M_MACADDR3_Msk (0xfful << EMAC_CAM5M_MACADDR3_Pos) /*!< EMAC_T::CAM5M: MACADDR3 Mask */ - -#define EMAC_CAM5M_MACADDR4_Pos (16) /*!< EMAC_T::CAM5M: MACADDR4 Position */ -#define EMAC_CAM5M_MACADDR4_Msk (0xfful << EMAC_CAM5M_MACADDR4_Pos) /*!< EMAC_T::CAM5M: MACADDR4 Mask */ - -#define EMAC_CAM5M_MACADDR5_Pos (24) /*!< EMAC_T::CAM5M: MACADDR5 Position */ -#define EMAC_CAM5M_MACADDR5_Msk (0xfful << EMAC_CAM5M_MACADDR5_Pos) /*!< EMAC_T::CAM5M: MACADDR5 Mask */ - -#define EMAC_CAM5L_MACADDR0_Pos (16) /*!< EMAC_T::CAM5L: MACADDR0 Position */ -#define EMAC_CAM5L_MACADDR0_Msk (0xfful << EMAC_CAM5L_MACADDR0_Pos) /*!< EMAC_T::CAM5L: MACADDR0 Mask */ - -#define EMAC_CAM5L_MACADDR1_Pos (24) /*!< EMAC_T::CAM5L: MACADDR1 Position */ -#define EMAC_CAM5L_MACADDR1_Msk (0xfful << EMAC_CAM5L_MACADDR1_Pos) /*!< EMAC_T::CAM5L: MACADDR1 Mask */ - -#define EMAC_CAM6M_MACADDR2_Pos (0) /*!< EMAC_T::CAM6M: MACADDR2 Position */ -#define EMAC_CAM6M_MACADDR2_Msk (0xfful << EMAC_CAM6M_MACADDR2_Pos) /*!< EMAC_T::CAM6M: MACADDR2 Mask */ - -#define EMAC_CAM6M_MACADDR3_Pos (8) /*!< EMAC_T::CAM6M: MACADDR3 Position */ -#define EMAC_CAM6M_MACADDR3_Msk (0xfful << EMAC_CAM6M_MACADDR3_Pos) /*!< EMAC_T::CAM6M: MACADDR3 Mask */ - -#define EMAC_CAM6M_MACADDR4_Pos (16) /*!< EMAC_T::CAM6M: MACADDR4 Position */ -#define EMAC_CAM6M_MACADDR4_Msk (0xfful << EMAC_CAM6M_MACADDR4_Pos) /*!< EMAC_T::CAM6M: MACADDR4 Mask */ - -#define EMAC_CAM6M_MACADDR5_Pos (24) /*!< EMAC_T::CAM6M: MACADDR5 Position */ -#define EMAC_CAM6M_MACADDR5_Msk (0xfful << EMAC_CAM6M_MACADDR5_Pos) /*!< EMAC_T::CAM6M: MACADDR5 Mask */ - -#define EMAC_CAM6L_MACADDR0_Pos (16) /*!< EMAC_T::CAM6L: MACADDR0 Position */ -#define EMAC_CAM6L_MACADDR0_Msk (0xfful << EMAC_CAM6L_MACADDR0_Pos) /*!< EMAC_T::CAM6L: MACADDR0 Mask */ - -#define EMAC_CAM6L_MACADDR1_Pos (24) /*!< EMAC_T::CAM6L: MACADDR1 Position */ -#define EMAC_CAM6L_MACADDR1_Msk (0xfful << EMAC_CAM6L_MACADDR1_Pos) /*!< EMAC_T::CAM6L: MACADDR1 Mask */ - -#define EMAC_CAM7M_MACADDR2_Pos (0) /*!< EMAC_T::CAM7M: MACADDR2 Position */ -#define EMAC_CAM7M_MACADDR2_Msk (0xfful << EMAC_CAM7M_MACADDR2_Pos) /*!< EMAC_T::CAM7M: MACADDR2 Mask */ - -#define EMAC_CAM7M_MACADDR3_Pos (8) /*!< EMAC_T::CAM7M: MACADDR3 Position */ -#define EMAC_CAM7M_MACADDR3_Msk (0xfful << EMAC_CAM7M_MACADDR3_Pos) /*!< EMAC_T::CAM7M: MACADDR3 Mask */ - -#define EMAC_CAM7M_MACADDR4_Pos (16) /*!< EMAC_T::CAM7M: MACADDR4 Position */ -#define EMAC_CAM7M_MACADDR4_Msk (0xfful << EMAC_CAM7M_MACADDR4_Pos) /*!< EMAC_T::CAM7M: MACADDR4 Mask */ - -#define EMAC_CAM7M_MACADDR5_Pos (24) /*!< EMAC_T::CAM7M: MACADDR5 Position */ -#define EMAC_CAM7M_MACADDR5_Msk (0xfful << EMAC_CAM7M_MACADDR5_Pos) /*!< EMAC_T::CAM7M: MACADDR5 Mask */ - -#define EMAC_CAM7L_MACADDR0_Pos (16) /*!< EMAC_T::CAM7L: MACADDR0 Position */ -#define EMAC_CAM7L_MACADDR0_Msk (0xfful << EMAC_CAM7L_MACADDR0_Pos) /*!< EMAC_T::CAM7L: MACADDR0 Mask */ - -#define EMAC_CAM7L_MACADDR1_Pos (24) /*!< EMAC_T::CAM7L: MACADDR1 Position */ -#define EMAC_CAM7L_MACADDR1_Msk (0xfful << EMAC_CAM7L_MACADDR1_Pos) /*!< EMAC_T::CAM7L: MACADDR1 Mask */ - -#define EMAC_CAM8M_MACADDR2_Pos (0) /*!< EMAC_T::CAM8M: MACADDR2 Position */ -#define EMAC_CAM8M_MACADDR2_Msk (0xfful << EMAC_CAM8M_MACADDR2_Pos) /*!< EMAC_T::CAM8M: MACADDR2 Mask */ - -#define EMAC_CAM8M_MACADDR3_Pos (8) /*!< EMAC_T::CAM8M: MACADDR3 Position */ -#define EMAC_CAM8M_MACADDR3_Msk (0xfful << EMAC_CAM8M_MACADDR3_Pos) /*!< EMAC_T::CAM8M: MACADDR3 Mask */ - -#define EMAC_CAM8M_MACADDR4_Pos (16) /*!< EMAC_T::CAM8M: MACADDR4 Position */ -#define EMAC_CAM8M_MACADDR4_Msk (0xfful << EMAC_CAM8M_MACADDR4_Pos) /*!< EMAC_T::CAM8M: MACADDR4 Mask */ - -#define EMAC_CAM8M_MACADDR5_Pos (24) /*!< EMAC_T::CAM8M: MACADDR5 Position */ -#define EMAC_CAM8M_MACADDR5_Msk (0xfful << EMAC_CAM8M_MACADDR5_Pos) /*!< EMAC_T::CAM8M: MACADDR5 Mask */ - -#define EMAC_CAM8L_MACADDR0_Pos (16) /*!< EMAC_T::CAM8L: MACADDR0 Position */ -#define EMAC_CAM8L_MACADDR0_Msk (0xfful << EMAC_CAM8L_MACADDR0_Pos) /*!< EMAC_T::CAM8L: MACADDR0 Mask */ - -#define EMAC_CAM8L_MACADDR1_Pos (24) /*!< EMAC_T::CAM8L: MACADDR1 Position */ -#define EMAC_CAM8L_MACADDR1_Msk (0xfful << EMAC_CAM8L_MACADDR1_Pos) /*!< EMAC_T::CAM8L: MACADDR1 Mask */ - -#define EMAC_CAM9M_MACADDR2_Pos (0) /*!< EMAC_T::CAM9M: MACADDR2 Position */ -#define EMAC_CAM9M_MACADDR2_Msk (0xfful << EMAC_CAM9M_MACADDR2_Pos) /*!< EMAC_T::CAM9M: MACADDR2 Mask */ - -#define EMAC_CAM9M_MACADDR3_Pos (8) /*!< EMAC_T::CAM9M: MACADDR3 Position */ -#define EMAC_CAM9M_MACADDR3_Msk (0xfful << EMAC_CAM9M_MACADDR3_Pos) /*!< EMAC_T::CAM9M: MACADDR3 Mask */ - -#define EMAC_CAM9M_MACADDR4_Pos (16) /*!< EMAC_T::CAM9M: MACADDR4 Position */ -#define EMAC_CAM9M_MACADDR4_Msk (0xfful << EMAC_CAM9M_MACADDR4_Pos) /*!< EMAC_T::CAM9M: MACADDR4 Mask */ - -#define EMAC_CAM9M_MACADDR5_Pos (24) /*!< EMAC_T::CAM9M: MACADDR5 Position */ -#define EMAC_CAM9M_MACADDR5_Msk (0xfful << EMAC_CAM9M_MACADDR5_Pos) /*!< EMAC_T::CAM9M: MACADDR5 Mask */ - -#define EMAC_CAM9L_MACADDR0_Pos (16) /*!< EMAC_T::CAM9L: MACADDR0 Position */ -#define EMAC_CAM9L_MACADDR0_Msk (0xfful << EMAC_CAM9L_MACADDR0_Pos) /*!< EMAC_T::CAM9L: MACADDR0 Mask */ - -#define EMAC_CAM9L_MACADDR1_Pos (24) /*!< EMAC_T::CAM9L: MACADDR1 Position */ -#define EMAC_CAM9L_MACADDR1_Msk (0xfful << EMAC_CAM9L_MACADDR1_Pos) /*!< EMAC_T::CAM9L: MACADDR1 Mask */ - -#define EMAC_CAM10M_MACADDR2_Pos (0) /*!< EMAC_T::CAM10M: MACADDR2 Position */ -#define EMAC_CAM10M_MACADDR2_Msk (0xfful << EMAC_CAM10M_MACADDR2_Pos) /*!< EMAC_T::CAM10M: MACADDR2 Mask */ - -#define EMAC_CAM10M_MACADDR3_Pos (8) /*!< EMAC_T::CAM10M: MACADDR3 Position */ -#define EMAC_CAM10M_MACADDR3_Msk (0xfful << EMAC_CAM10M_MACADDR3_Pos) /*!< EMAC_T::CAM10M: MACADDR3 Mask */ - -#define EMAC_CAM10M_MACADDR4_Pos (16) /*!< EMAC_T::CAM10M: MACADDR4 Position */ -#define EMAC_CAM10M_MACADDR4_Msk (0xfful << EMAC_CAM10M_MACADDR4_Pos) /*!< EMAC_T::CAM10M: MACADDR4 Mask */ - -#define EMAC_CAM10M_MACADDR5_Pos (24) /*!< EMAC_T::CAM10M: MACADDR5 Position */ -#define EMAC_CAM10M_MACADDR5_Msk (0xfful << EMAC_CAM10M_MACADDR5_Pos) /*!< EMAC_T::CAM10M: MACADDR5 Mask */ - -#define EMAC_CAM10L_MACADDR0_Pos (16) /*!< EMAC_T::CAM10L: MACADDR0 Position */ -#define EMAC_CAM10L_MACADDR0_Msk (0xfful << EMAC_CAM10L_MACADDR0_Pos) /*!< EMAC_T::CAM10L: MACADDR0 Mask */ - -#define EMAC_CAM10L_MACADDR1_Pos (24) /*!< EMAC_T::CAM10L: MACADDR1 Position */ -#define EMAC_CAM10L_MACADDR1_Msk (0xfful << EMAC_CAM10L_MACADDR1_Pos) /*!< EMAC_T::CAM10L: MACADDR1 Mask */ - -#define EMAC_CAM11M_MACADDR2_Pos (0) /*!< EMAC_T::CAM11M: MACADDR2 Position */ -#define EMAC_CAM11M_MACADDR2_Msk (0xfful << EMAC_CAM11M_MACADDR2_Pos) /*!< EMAC_T::CAM11M: MACADDR2 Mask */ - -#define EMAC_CAM11M_MACADDR3_Pos (8) /*!< EMAC_T::CAM11M: MACADDR3 Position */ -#define EMAC_CAM11M_MACADDR3_Msk (0xfful << EMAC_CAM11M_MACADDR3_Pos) /*!< EMAC_T::CAM11M: MACADDR3 Mask */ - -#define EMAC_CAM11M_MACADDR4_Pos (16) /*!< EMAC_T::CAM11M: MACADDR4 Position */ -#define EMAC_CAM11M_MACADDR4_Msk (0xfful << EMAC_CAM11M_MACADDR4_Pos) /*!< EMAC_T::CAM11M: MACADDR4 Mask */ - -#define EMAC_CAM11M_MACADDR5_Pos (24) /*!< EMAC_T::CAM11M: MACADDR5 Position */ -#define EMAC_CAM11M_MACADDR5_Msk (0xfful << EMAC_CAM11M_MACADDR5_Pos) /*!< EMAC_T::CAM11M: MACADDR5 Mask */ - -#define EMAC_CAM11L_MACADDR0_Pos (16) /*!< EMAC_T::CAM11L: MACADDR0 Position */ -#define EMAC_CAM11L_MACADDR0_Msk (0xfful << EMAC_CAM11L_MACADDR0_Pos) /*!< EMAC_T::CAM11L: MACADDR0 Mask */ - -#define EMAC_CAM11L_MACADDR1_Pos (24) /*!< EMAC_T::CAM11L: MACADDR1 Position */ -#define EMAC_CAM11L_MACADDR1_Msk (0xfful << EMAC_CAM11L_MACADDR1_Pos) /*!< EMAC_T::CAM11L: MACADDR1 Mask */ - -#define EMAC_CAM12M_MACADDR2_Pos (0) /*!< EMAC_T::CAM12M: MACADDR2 Position */ -#define EMAC_CAM12M_MACADDR2_Msk (0xfful << EMAC_CAM12M_MACADDR2_Pos) /*!< EMAC_T::CAM12M: MACADDR2 Mask */ - -#define EMAC_CAM12M_MACADDR3_Pos (8) /*!< EMAC_T::CAM12M: MACADDR3 Position */ -#define EMAC_CAM12M_MACADDR3_Msk (0xfful << EMAC_CAM12M_MACADDR3_Pos) /*!< EMAC_T::CAM12M: MACADDR3 Mask */ - -#define EMAC_CAM12M_MACADDR4_Pos (16) /*!< EMAC_T::CAM12M: MACADDR4 Position */ -#define EMAC_CAM12M_MACADDR4_Msk (0xfful << EMAC_CAM12M_MACADDR4_Pos) /*!< EMAC_T::CAM12M: MACADDR4 Mask */ - -#define EMAC_CAM12M_MACADDR5_Pos (24) /*!< EMAC_T::CAM12M: MACADDR5 Position */ -#define EMAC_CAM12M_MACADDR5_Msk (0xfful << EMAC_CAM12M_MACADDR5_Pos) /*!< EMAC_T::CAM12M: MACADDR5 Mask */ - -#define EMAC_CAM12L_MACADDR0_Pos (16) /*!< EMAC_T::CAM12L: MACADDR0 Position */ -#define EMAC_CAM12L_MACADDR0_Msk (0xfful << EMAC_CAM12L_MACADDR0_Pos) /*!< EMAC_T::CAM12L: MACADDR0 Mask */ - -#define EMAC_CAM12L_MACADDR1_Pos (24) /*!< EMAC_T::CAM12L: MACADDR1 Position */ -#define EMAC_CAM12L_MACADDR1_Msk (0xfful << EMAC_CAM12L_MACADDR1_Pos) /*!< EMAC_T::CAM12L: MACADDR1 Mask */ - -#define EMAC_CAM13M_MACADDR2_Pos (0) /*!< EMAC_T::CAM13M: MACADDR2 Position */ -#define EMAC_CAM13M_MACADDR2_Msk (0xfful << EMAC_CAM13M_MACADDR2_Pos) /*!< EMAC_T::CAM13M: MACADDR2 Mask */ - -#define EMAC_CAM13M_MACADDR3_Pos (8) /*!< EMAC_T::CAM13M: MACADDR3 Position */ -#define EMAC_CAM13M_MACADDR3_Msk (0xfful << EMAC_CAM13M_MACADDR3_Pos) /*!< EMAC_T::CAM13M: MACADDR3 Mask */ - -#define EMAC_CAM13M_MACADDR4_Pos (16) /*!< EMAC_T::CAM13M: MACADDR4 Position */ -#define EMAC_CAM13M_MACADDR4_Msk (0xfful << EMAC_CAM13M_MACADDR4_Pos) /*!< EMAC_T::CAM13M: MACADDR4 Mask */ - -#define EMAC_CAM13M_MACADDR5_Pos (24) /*!< EMAC_T::CAM13M: MACADDR5 Position */ -#define EMAC_CAM13M_MACADDR5_Msk (0xfful << EMAC_CAM13M_MACADDR5_Pos) /*!< EMAC_T::CAM13M: MACADDR5 Mask */ - -#define EMAC_CAM13L_MACADDR0_Pos (16) /*!< EMAC_T::CAM13L: MACADDR0 Position */ -#define EMAC_CAM13L_MACADDR0_Msk (0xfful << EMAC_CAM13L_MACADDR0_Pos) /*!< EMAC_T::CAM13L: MACADDR0 Mask */ - -#define EMAC_CAM13L_MACADDR1_Pos (24) /*!< EMAC_T::CAM13L: MACADDR1 Position */ -#define EMAC_CAM13L_MACADDR1_Msk (0xfful << EMAC_CAM13L_MACADDR1_Pos) /*!< EMAC_T::CAM13L: MACADDR1 Mask */ - -#define EMAC_CAM14M_MACADDR2_Pos (0) /*!< EMAC_T::CAM14M: MACADDR2 Position */ -#define EMAC_CAM14M_MACADDR2_Msk (0xfful << EMAC_CAM14M_MACADDR2_Pos) /*!< EMAC_T::CAM14M: MACADDR2 Mask */ - -#define EMAC_CAM14M_MACADDR3_Pos (8) /*!< EMAC_T::CAM14M: MACADDR3 Position */ -#define EMAC_CAM14M_MACADDR3_Msk (0xfful << EMAC_CAM14M_MACADDR3_Pos) /*!< EMAC_T::CAM14M: MACADDR3 Mask */ - -#define EMAC_CAM14M_MACADDR4_Pos (16) /*!< EMAC_T::CAM14M: MACADDR4 Position */ -#define EMAC_CAM14M_MACADDR4_Msk (0xfful << EMAC_CAM14M_MACADDR4_Pos) /*!< EMAC_T::CAM14M: MACADDR4 Mask */ - -#define EMAC_CAM14M_MACADDR5_Pos (24) /*!< EMAC_T::CAM14M: MACADDR5 Position */ -#define EMAC_CAM14M_MACADDR5_Msk (0xfful << EMAC_CAM14M_MACADDR5_Pos) /*!< EMAC_T::CAM14M: MACADDR5 Mask */ - -#define EMAC_CAM14L_MACADDR0_Pos (16) /*!< EMAC_T::CAM14L: MACADDR0 Position */ -#define EMAC_CAM14L_MACADDR0_Msk (0xfful << EMAC_CAM14L_MACADDR0_Pos) /*!< EMAC_T::CAM14L: MACADDR0 Mask */ - -#define EMAC_CAM14L_MACADDR1_Pos (24) /*!< EMAC_T::CAM14L: MACADDR1 Position */ -#define EMAC_CAM14L_MACADDR1_Msk (0xfful << EMAC_CAM14L_MACADDR1_Pos) /*!< EMAC_T::CAM14L: MACADDR1 Mask */ - -#define EMAC_CAM15MSB_OPCODE_Pos (0) /*!< EMAC_T::CAM15MSB: OPCODE Position */ -#define EMAC_CAM15MSB_OPCODE_Msk (0xfffful << EMAC_CAM15MSB_OPCODE_Pos) /*!< EMAC_T::CAM15MSB: OPCODE Mask */ - -#define EMAC_CAM15MSB_LENGTH_Pos (16) /*!< EMAC_T::CAM15MSB: LENGTH Position */ -#define EMAC_CAM15MSB_LENGTH_Msk (0xfffful << EMAC_CAM15MSB_LENGTH_Pos) /*!< EMAC_T::CAM15MSB: LENGTH Mask */ - -#define EMAC_CAM15LSB_OPERAND_Pos (24) /*!< EMAC_T::CAM15LSB: OPERAND Position */ -#define EMAC_CAM15LSB_OPERAND_Msk (0xfful << EMAC_CAM15LSB_OPERAND_Pos) /*!< EMAC_T::CAM15LSB: OPERAND Mask */ - -#define EMAC_TXDSA_TXDSA_Pos (0) /*!< EMAC_T::TXDSA: TXDSA Position */ -#define EMAC_TXDSA_TXDSA_Msk (0xfffffffful << EMAC_TXDSA_TXDSA_Pos) /*!< EMAC_T::TXDSA: TXDSA Mask */ - -#define EMAC_RXDSA_RXDSA_Pos (0) /*!< EMAC_T::RXDSA: RXDSA Position */ -#define EMAC_RXDSA_RXDSA_Msk (0xfffffffful << EMAC_RXDSA_RXDSA_Pos) /*!< EMAC_T::RXDSA: RXDSA Mask */ - -#define EMAC_CTL_RXON_Pos (0) /*!< EMAC_T::CTL: RXON Position */ -#define EMAC_CTL_RXON_Msk (0x1ul << EMAC_CTL_RXON_Pos) /*!< EMAC_T::CTL: RXON Mask */ - -#define EMAC_CTL_ALP_Pos (1) /*!< EMAC_T::CTL: ALP Position */ -#define EMAC_CTL_ALP_Msk (0x1ul << EMAC_CTL_ALP_Pos) /*!< EMAC_T::CTL: ALP Mask */ - -#define EMAC_CTL_ARP_Pos (2) /*!< EMAC_T::CTL: ARP Position */ -#define EMAC_CTL_ARP_Msk (0x1ul << EMAC_CTL_ARP_Pos) /*!< EMAC_T::CTL: ARP Mask */ - -#define EMAC_CTL_ACP_Pos (3) /*!< EMAC_T::CTL: ACP Position */ -#define EMAC_CTL_ACP_Msk (0x1ul << EMAC_CTL_ACP_Pos) /*!< EMAC_T::CTL: ACP Mask */ - -#define EMAC_CTL_AEP_Pos (4) /*!< EMAC_T::CTL: AEP Position */ -#define EMAC_CTL_AEP_Msk (0x1ul << EMAC_CTL_AEP_Pos) /*!< EMAC_T::CTL: AEP Mask */ - -#define EMAC_CTL_STRIPCRC_Pos (5) /*!< EMAC_T::CTL: STRIPCRC Position */ -#define EMAC_CTL_STRIPCRC_Msk (0x1ul << EMAC_CTL_STRIPCRC_Pos) /*!< EMAC_T::CTL: STRIPCRC Mask */ - -#define EMAC_CTL_WOLEN_Pos (6) /*!< EMAC_T::CTL: WOLEN Position */ -#define EMAC_CTL_WOLEN_Msk (0x1ul << EMAC_CTL_WOLEN_Pos) /*!< EMAC_T::CTL: WOLEN Mask */ - -#define EMAC_CTL_TXON_Pos (8) /*!< EMAC_T::CTL: TXON Position */ -#define EMAC_CTL_TXON_Msk (0x1ul << EMAC_CTL_TXON_Pos) /*!< EMAC_T::CTL: TXON Mask */ - -#define EMAC_CTL_NODEF_Pos (9) /*!< EMAC_T::CTL: NODEF Position */ -#define EMAC_CTL_NODEF_Msk (0x1ul << EMAC_CTL_NODEF_Pos) /*!< EMAC_T::CTL: NODEF Mask */ - -#define EMAC_CTL_SDPZ_Pos (16) /*!< EMAC_T::CTL: SDPZ Position */ -#define EMAC_CTL_SDPZ_Msk (0x1ul << EMAC_CTL_SDPZ_Pos) /*!< EMAC_T::CTL: SDPZ Mask */ - -#define EMAC_CTL_SQECHKEN_Pos (17) /*!< EMAC_T::CTL: SQECHKEN Position */ -#define EMAC_CTL_SQECHKEN_Msk (0x1ul << EMAC_CTL_SQECHKEN_Pos) /*!< EMAC_T::CTL: SQECHKEN Mask */ - -#define EMAC_CTL_FUDUP_Pos (18) /*!< EMAC_T::CTL: FUDUP Position */ -#define EMAC_CTL_FUDUP_Msk (0x1ul << EMAC_CTL_FUDUP_Pos) /*!< EMAC_T::CTL: FUDUP Mask */ - -#define EMAC_CTL_RMIIRXCTL_Pos (19) /*!< EMAC_T::CTL: RMIIRXCTL Position */ -#define EMAC_CTL_RMIIRXCTL_Msk (0x1ul << EMAC_CTL_RMIIRXCTL_Pos) /*!< EMAC_T::CTL: RMIIRXCTL Mask */ - -#define EMAC_CTL_OPMODE_Pos (20) /*!< EMAC_T::CTL: OPMODE Position */ -#define EMAC_CTL_OPMODE_Msk (0x1ul << EMAC_CTL_OPMODE_Pos) /*!< EMAC_T::CTL: OPMODE Mask */ - -#define EMAC_CTL_RMIIEN_Pos (22) /*!< EMAC_T::CTL: RMIIEN Position */ -#define EMAC_CTL_RMIIEN_Msk (0x1ul << EMAC_CTL_RMIIEN_Pos) /*!< EMAC_T::CTL: RMIIEN Mask */ - -#define EMAC_CTL_RST_Pos (24) /*!< EMAC_T::CTL: RST Position */ -#define EMAC_CTL_RST_Msk (0x1ul << EMAC_CTL_RST_Pos) /*!< EMAC_T::CTL: RST Mask */ - -#define EMAC_MIIMDAT_DATA_Pos (0) /*!< EMAC_T::MIIMDAT: DATA Position */ -#define EMAC_MIIMDAT_DATA_Msk (0xfffful << EMAC_MIIMDAT_DATA_Pos) /*!< EMAC_T::MIIMDAT: DATA Mask */ - -#define EMAC_MIIMCTL_PHYREG_Pos (0) /*!< EMAC_T::MIIMCTL: PHYREG Position */ -#define EMAC_MIIMCTL_PHYREG_Msk (0x1ful << EMAC_MIIMCTL_PHYREG_Pos) /*!< EMAC_T::MIIMCTL: PHYREG Mask */ - -#define EMAC_MIIMCTL_PHYADDR_Pos (8) /*!< EMAC_T::MIIMCTL: PHYADDR Position */ -#define EMAC_MIIMCTL_PHYADDR_Msk (0x1ful << EMAC_MIIMCTL_PHYADDR_Pos) /*!< EMAC_T::MIIMCTL: PHYADDR Mask */ - -#define EMAC_MIIMCTL_WRITE_Pos (16) /*!< EMAC_T::MIIMCTL: WRITE Position */ -#define EMAC_MIIMCTL_WRITE_Msk (0x1ul << EMAC_MIIMCTL_WRITE_Pos) /*!< EMAC_T::MIIMCTL: WRITE Mask */ - -#define EMAC_MIIMCTL_BUSY_Pos (17) /*!< EMAC_T::MIIMCTL: BUSY Position */ -#define EMAC_MIIMCTL_BUSY_Msk (0x1ul << EMAC_MIIMCTL_BUSY_Pos) /*!< EMAC_T::MIIMCTL: BUSY Mask */ - -#define EMAC_MIIMCTL_PREAMSP_Pos (18) /*!< EMAC_T::MIIMCTL: PREAMSP Position */ -#define EMAC_MIIMCTL_PREAMSP_Msk (0x1ul << EMAC_MIIMCTL_PREAMSP_Pos) /*!< EMAC_T::MIIMCTL: PREAMSP Mask */ - -#define EMAC_MIIMCTL_MDCON_Pos (19) /*!< EMAC_T::MIIMCTL: MDCON Position */ -#define EMAC_MIIMCTL_MDCON_Msk (0x1ul << EMAC_MIIMCTL_MDCON_Pos) /*!< EMAC_T::MIIMCTL: MDCON Mask */ - -#define EMAC_FIFOCTL_RXFIFOTH_Pos (0) /*!< EMAC_T::FIFOCTL: RXFIFOTH Position */ -#define EMAC_FIFOCTL_RXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_RXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: RXFIFOTH Mask */ - -#define EMAC_FIFOCTL_TXFIFOTH_Pos (8) /*!< EMAC_T::FIFOCTL: TXFIFOTH Position */ -#define EMAC_FIFOCTL_TXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_TXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: TXFIFOTH Mask */ - -#define EMAC_FIFOCTL_BURSTLEN_Pos (20) /*!< EMAC_T::FIFOCTL: BURSTLEN Position */ -#define EMAC_FIFOCTL_BURSTLEN_Msk (0x3ul << EMAC_FIFOCTL_BURSTLEN_Pos) /*!< EMAC_T::FIFOCTL: BURSTLEN Mask */ - -#define EMAC_TXST_TXST_Pos (0) /*!< EMAC_T::TXST: TXST Position */ -#define EMAC_TXST_TXST_Msk (0xfffffffful << EMAC_TXST_TXST_Pos) /*!< EMAC_T::TXST: TXST Mask */ - -#define EMAC_RXST_RXST_Pos (0) /*!< EMAC_T::RXST: RXST Position */ -#define EMAC_RXST_RXST_Msk (0xfffffffful << EMAC_RXST_RXST_Pos) /*!< EMAC_T::RXST: RXST Mask */ - -#define EMAC_MRFL_MRFL_Pos (0) /*!< EMAC_T::MRFL: MRFL Position */ -#define EMAC_MRFL_MRFL_Msk (0xfffful << EMAC_MRFL_MRFL_Pos) /*!< EMAC_T::MRFL: MRFL Mask */ - -#define EMAC_INTEN_RXIEN_Pos (0) /*!< EMAC_T::INTEN: RXIEN Position */ -#define EMAC_INTEN_RXIEN_Msk (0x1ul << EMAC_INTEN_RXIEN_Pos) /*!< EMAC_T::INTEN: RXIEN Mask */ - -#define EMAC_INTEN_CRCEIEN_Pos (1) /*!< EMAC_T::INTEN: CRCEIEN Position */ -#define EMAC_INTEN_CRCEIEN_Msk (0x1ul << EMAC_INTEN_CRCEIEN_Pos) /*!< EMAC_T::INTEN: CRCEIEN Mask */ - -#define EMAC_INTEN_RXOVIEN_Pos (2) /*!< EMAC_T::INTEN: RXOVIEN Position */ -#define EMAC_INTEN_RXOVIEN_Msk (0x1ul << EMAC_INTEN_RXOVIEN_Pos) /*!< EMAC_T::INTEN: RXOVIEN Mask */ - -#define EMAC_INTEN_LPIEN_Pos (3) /*!< EMAC_T::INTEN: LPIEN Position */ -#define EMAC_INTEN_LPIEN_Msk (0x1ul << EMAC_INTEN_LPIEN_Pos) /*!< EMAC_T::INTEN: LPIEN Mask */ - -#define EMAC_INTEN_RXGDIEN_Pos (4) /*!< EMAC_T::INTEN: RXGDIEN Position */ -#define EMAC_INTEN_RXGDIEN_Msk (0x1ul << EMAC_INTEN_RXGDIEN_Pos) /*!< EMAC_T::INTEN: RXGDIEN Mask */ - -#define EMAC_INTEN_ALIEIEN_Pos (5) /*!< EMAC_T::INTEN: ALIEIEN Position */ -#define EMAC_INTEN_ALIEIEN_Msk (0x1ul << EMAC_INTEN_ALIEIEN_Pos) /*!< EMAC_T::INTEN: ALIEIEN Mask */ - -#define EMAC_INTEN_RPIEN_Pos (6) /*!< EMAC_T::INTEN: RPIEN Position */ -#define EMAC_INTEN_RPIEN_Msk (0x1ul << EMAC_INTEN_RPIEN_Pos) /*!< EMAC_T::INTEN: RPIEN Mask */ - -#define EMAC_INTEN_MPCOVIEN_Pos (7) /*!< EMAC_T::INTEN: MPCOVIEN Position */ -#define EMAC_INTEN_MPCOVIEN_Msk (0x1ul << EMAC_INTEN_MPCOVIEN_Pos) /*!< EMAC_T::INTEN: MPCOVIEN Mask */ - -#define EMAC_INTEN_MFLEIEN_Pos (8) /*!< EMAC_T::INTEN: MFLEIEN Position */ -#define EMAC_INTEN_MFLEIEN_Msk (0x1ul << EMAC_INTEN_MFLEIEN_Pos) /*!< EMAC_T::INTEN: MFLEIEN Mask */ - -#define EMAC_INTEN_DENIEN_Pos (9) /*!< EMAC_T::INTEN: DENIEN Position */ -#define EMAC_INTEN_DENIEN_Msk (0x1ul << EMAC_INTEN_DENIEN_Pos) /*!< EMAC_T::INTEN: DENIEN Mask */ - -#define EMAC_INTEN_RDUIEN_Pos (10) /*!< EMAC_T::INTEN: RDUIEN Position */ -#define EMAC_INTEN_RDUIEN_Msk (0x1ul << EMAC_INTEN_RDUIEN_Pos) /*!< EMAC_T::INTEN: RDUIEN Mask */ - -#define EMAC_INTEN_RXBEIEN_Pos (11) /*!< EMAC_T::INTEN: RXBEIEN Position */ -#define EMAC_INTEN_RXBEIEN_Msk (0x1ul << EMAC_INTEN_RXBEIEN_Pos) /*!< EMAC_T::INTEN: RXBEIEN Mask */ - -#define EMAC_INTEN_CFRIEN_Pos (14) /*!< EMAC_T::INTEN: CFRIEN Position */ -#define EMAC_INTEN_CFRIEN_Msk (0x1ul << EMAC_INTEN_CFRIEN_Pos) /*!< EMAC_T::INTEN: CFRIEN Mask */ - -#define EMAC_INTEN_WOLIEN_Pos (15) /*!< EMAC_T::INTEN: WOLIEN Position */ -#define EMAC_INTEN_WOLIEN_Msk (0x1ul << EMAC_INTEN_WOLIEN_Pos) /*!< EMAC_T::INTEN: WOLIEN Mask */ - -#define EMAC_INTEN_TXIEN_Pos (16) /*!< EMAC_T::INTEN: TXIEN Position */ -#define EMAC_INTEN_TXIEN_Msk (0x1ul << EMAC_INTEN_TXIEN_Pos) /*!< EMAC_T::INTEN: TXIEN Mask */ - -#define EMAC_INTEN_TXUDIEN_Pos (17) /*!< EMAC_T::INTEN: TXUDIEN Position */ -#define EMAC_INTEN_TXUDIEN_Msk (0x1ul << EMAC_INTEN_TXUDIEN_Pos) /*!< EMAC_T::INTEN: TXUDIEN Mask */ - -#define EMAC_INTEN_TXCPIEN_Pos (18) /*!< EMAC_T::INTEN: TXCPIEN Position */ -#define EMAC_INTEN_TXCPIEN_Msk (0x1ul << EMAC_INTEN_TXCPIEN_Pos) /*!< EMAC_T::INTEN: TXCPIEN Mask */ - -#define EMAC_INTEN_EXDEFIEN_Pos (19) /*!< EMAC_T::INTEN: EXDEFIEN Position */ -#define EMAC_INTEN_EXDEFIEN_Msk (0x1ul << EMAC_INTEN_EXDEFIEN_Pos) /*!< EMAC_T::INTEN: EXDEFIEN Mask */ - -#define EMAC_INTEN_NCSIEN_Pos (20) /*!< EMAC_T::INTEN: NCSIEN Position */ -#define EMAC_INTEN_NCSIEN_Msk (0x1ul << EMAC_INTEN_NCSIEN_Pos) /*!< EMAC_T::INTEN: NCSIEN Mask */ - -#define EMAC_INTEN_TXABTIEN_Pos (21) /*!< EMAC_T::INTEN: TXABTIEN Position */ -#define EMAC_INTEN_TXABTIEN_Msk (0x1ul << EMAC_INTEN_TXABTIEN_Pos) /*!< EMAC_T::INTEN: TXABTIEN Mask */ - -#define EMAC_INTEN_LCIEN_Pos (22) /*!< EMAC_T::INTEN: LCIEN Position */ -#define EMAC_INTEN_LCIEN_Msk (0x1ul << EMAC_INTEN_LCIEN_Pos) /*!< EMAC_T::INTEN: LCIEN Mask */ - -#define EMAC_INTEN_TDUIEN_Pos (23) /*!< EMAC_T::INTEN: TDUIEN Position */ -#define EMAC_INTEN_TDUIEN_Msk (0x1ul << EMAC_INTEN_TDUIEN_Pos) /*!< EMAC_T::INTEN: TDUIEN Mask */ - -#define EMAC_INTEN_TXBEIEN_Pos (24) /*!< EMAC_T::INTEN: TXBEIEN Position */ -#define EMAC_INTEN_TXBEIEN_Msk (0x1ul << EMAC_INTEN_TXBEIEN_Pos) /*!< EMAC_T::INTEN: TXBEIEN Mask */ - -#define EMAC_INTEN_TSALMIEN_Pos (28) /*!< EMAC_T::INTEN: TSALMIEN Position */ -#define EMAC_INTEN_TSALMIEN_Msk (0x1ul << EMAC_INTEN_TSALMIEN_Pos) /*!< EMAC_T::INTEN: TSALMIEN Mask */ - -#define EMAC_INTSTS_RXIF_Pos (0) /*!< EMAC_T::INTSTS: RXIF Position */ -#define EMAC_INTSTS_RXIF_Msk (0x1ul << EMAC_INTSTS_RXIF_Pos) /*!< EMAC_T::INTSTS: RXIF Mask */ - -#define EMAC_INTSTS_CRCEIF_Pos (1) /*!< EMAC_T::INTSTS: CRCEIF Position */ -#define EMAC_INTSTS_CRCEIF_Msk (0x1ul << EMAC_INTSTS_CRCEIF_Pos) /*!< EMAC_T::INTSTS: CRCEIF Mask */ - -#define EMAC_INTSTS_RXOVIF_Pos (2) /*!< EMAC_T::INTSTS: RXOVIF Position */ -#define EMAC_INTSTS_RXOVIF_Msk (0x1ul << EMAC_INTSTS_RXOVIF_Pos) /*!< EMAC_T::INTSTS: RXOVIF Mask */ - -#define EMAC_INTSTS_LPIF_Pos (3) /*!< EMAC_T::INTSTS: LPIF Position */ -#define EMAC_INTSTS_LPIF_Msk (0x1ul << EMAC_INTSTS_LPIF_Pos) /*!< EMAC_T::INTSTS: LPIF Mask */ - -#define EMAC_INTSTS_RXGDIF_Pos (4) /*!< EMAC_T::INTSTS: RXGDIF Position */ -#define EMAC_INTSTS_RXGDIF_Msk (0x1ul << EMAC_INTSTS_RXGDIF_Pos) /*!< EMAC_T::INTSTS: RXGDIF Mask */ - -#define EMAC_INTSTS_ALIEIF_Pos (5) /*!< EMAC_T::INTSTS: ALIEIF Position */ -#define EMAC_INTSTS_ALIEIF_Msk (0x1ul << EMAC_INTSTS_ALIEIF_Pos) /*!< EMAC_T::INTSTS: ALIEIF Mask */ - -#define EMAC_INTSTS_RPIF_Pos (6) /*!< EMAC_T::INTSTS: RPIF Position */ -#define EMAC_INTSTS_RPIF_Msk (0x1ul << EMAC_INTSTS_RPIF_Pos) /*!< EMAC_T::INTSTS: RPIF Mask */ - -#define EMAC_INTSTS_MPCOVIF_Pos (7) /*!< EMAC_T::INTSTS: MPCOVIF Position */ -#define EMAC_INTSTS_MPCOVIF_Msk (0x1ul << EMAC_INTSTS_MPCOVIF_Pos) /*!< EMAC_T::INTSTS: MPCOVIF Mask */ - -#define EMAC_INTSTS_MFLEIF_Pos (8) /*!< EMAC_T::INTSTS: MFLEIF Position */ -#define EMAC_INTSTS_MFLEIF_Msk (0x1ul << EMAC_INTSTS_MFLEIF_Pos) /*!< EMAC_T::INTSTS: MFLEIF Mask */ - -#define EMAC_INTSTS_DENIF_Pos (9) /*!< EMAC_T::INTSTS: DENIF Position */ -#define EMAC_INTSTS_DENIF_Msk (0x1ul << EMAC_INTSTS_DENIF_Pos) /*!< EMAC_T::INTSTS: DENIF Mask */ - -#define EMAC_INTSTS_RDUIF_Pos (10) /*!< EMAC_T::INTSTS: RDUIF Position */ -#define EMAC_INTSTS_RDUIF_Msk (0x1ul << EMAC_INTSTS_RDUIF_Pos) /*!< EMAC_T::INTSTS: RDUIF Mask */ - -#define EMAC_INTSTS_RXBEIF_Pos (11) /*!< EMAC_T::INTSTS: RXBEIF Position */ -#define EMAC_INTSTS_RXBEIF_Msk (0x1ul << EMAC_INTSTS_RXBEIF_Pos) /*!< EMAC_T::INTSTS: RXBEIF Mask */ - -#define EMAC_INTSTS_CFRIF_Pos (14) /*!< EMAC_T::INTSTS: CFRIF Position */ -#define EMAC_INTSTS_CFRIF_Msk (0x1ul << EMAC_INTSTS_CFRIF_Pos) /*!< EMAC_T::INTSTS: CFRIF Mask */ - -#define EMAC_INTSTS_WOLIF_Pos (15) /*!< EMAC_T::INTSTS: WOLIF Position */ -#define EMAC_INTSTS_WOLIF_Msk (0x1ul << EMAC_INTSTS_WOLIF_Pos) /*!< EMAC_T::INTSTS: WOLIF Mask */ - -#define EMAC_INTSTS_TXIF_Pos (16) /*!< EMAC_T::INTSTS: TXIF Position */ -#define EMAC_INTSTS_TXIF_Msk (0x1ul << EMAC_INTSTS_TXIF_Pos) /*!< EMAC_T::INTSTS: TXIF Mask */ - -#define EMAC_INTSTS_TXUDIF_Pos (17) /*!< EMAC_T::INTSTS: TXUDIF Position */ -#define EMAC_INTSTS_TXUDIF_Msk (0x1ul << EMAC_INTSTS_TXUDIF_Pos) /*!< EMAC_T::INTSTS: TXUDIF Mask */ - -#define EMAC_INTSTS_TXCPIF_Pos (18) /*!< EMAC_T::INTSTS: TXCPIF Position */ -#define EMAC_INTSTS_TXCPIF_Msk (0x1ul << EMAC_INTSTS_TXCPIF_Pos) /*!< EMAC_T::INTSTS: TXCPIF Mask */ - -#define EMAC_INTSTS_EXDEFIF_Pos (19) /*!< EMAC_T::INTSTS: EXDEFIF Position */ -#define EMAC_INTSTS_EXDEFIF_Msk (0x1ul << EMAC_INTSTS_EXDEFIF_Pos) /*!< EMAC_T::INTSTS: EXDEFIF Mask */ - -#define EMAC_INTSTS_NCSIF_Pos (20) /*!< EMAC_T::INTSTS: NCSIF Position */ -#define EMAC_INTSTS_NCSIF_Msk (0x1ul << EMAC_INTSTS_NCSIF_Pos) /*!< EMAC_T::INTSTS: NCSIF Mask */ - -#define EMAC_INTSTS_TXABTIF_Pos (21) /*!< EMAC_T::INTSTS: TXABTIF Position */ -#define EMAC_INTSTS_TXABTIF_Msk (0x1ul << EMAC_INTSTS_TXABTIF_Pos) /*!< EMAC_T::INTSTS: TXABTIF Mask */ - -#define EMAC_INTSTS_LCIF_Pos (22) /*!< EMAC_T::INTSTS: LCIF Position */ -#define EMAC_INTSTS_LCIF_Msk (0x1ul << EMAC_INTSTS_LCIF_Pos) /*!< EMAC_T::INTSTS: LCIF Mask */ - -#define EMAC_INTSTS_TDUIF_Pos (23) /*!< EMAC_T::INTSTS: TDUIF Position */ -#define EMAC_INTSTS_TDUIF_Msk (0x1ul << EMAC_INTSTS_TDUIF_Pos) /*!< EMAC_T::INTSTS: TDUIF Mask */ - -#define EMAC_INTSTS_TXBEIF_Pos (24) /*!< EMAC_T::INTSTS: TXBEIF Position */ -#define EMAC_INTSTS_TXBEIF_Msk (0x1ul << EMAC_INTSTS_TXBEIF_Pos) /*!< EMAC_T::INTSTS: TXBEIF Mask */ - -#define EMAC_INTSTS_TSALMIF_Pos (28) /*!< EMAC_T::INTSTS: TSALMIF Position */ -#define EMAC_INTSTS_TSALMIF_Msk (0x1ul << EMAC_INTSTS_TSALMIF_Pos) /*!< EMAC_T::INTSTS: TSALMIF Mask */ - -#define EMAC_GENSTS_CFR_Pos (0) /*!< EMAC_T::GENSTS: CFR Position */ -#define EMAC_GENSTS_CFR_Msk (0x1ul << EMAC_GENSTS_CFR_Pos) /*!< EMAC_T::GENSTS: CFR Mask */ - -#define EMAC_GENSTS_RXHALT_Pos (1) /*!< EMAC_T::GENSTS: RXHALT Position */ -#define EMAC_GENSTS_RXHALT_Msk (0x1ul << EMAC_GENSTS_RXHALT_Pos) /*!< EMAC_T::GENSTS: RXHALT Mask */ - -#define EMAC_GENSTS_RXFFULL_Pos (2) /*!< EMAC_T::GENSTS: RXFFULL Position */ -#define EMAC_GENSTS_RXFFULL_Msk (0x1ul << EMAC_GENSTS_RXFFULL_Pos) /*!< EMAC_T::GENSTS: RXFFULL Mask */ - -#define EMAC_GENSTS_COLCNT_Pos (4) /*!< EMAC_T::GENSTS: COLCNT Position */ -#define EMAC_GENSTS_COLCNT_Msk (0xful << EMAC_GENSTS_COLCNT_Pos) /*!< EMAC_T::GENSTS: COLCNT Mask */ - -#define EMAC_GENSTS_DEF_Pos (8) /*!< EMAC_T::GENSTS: DEF Position */ -#define EMAC_GENSTS_DEF_Msk (0x1ul << EMAC_GENSTS_DEF_Pos) /*!< EMAC_T::GENSTS: DEF Mask */ - -#define EMAC_GENSTS_TXPAUSED_Pos (9) /*!< EMAC_T::GENSTS: TXPAUSED Position */ -#define EMAC_GENSTS_TXPAUSED_Msk (0x1ul << EMAC_GENSTS_TXPAUSED_Pos) /*!< EMAC_T::GENSTS: TXPAUSED Mask */ - -#define EMAC_GENSTS_SQE_Pos (10) /*!< EMAC_T::GENSTS: SQE Position */ -#define EMAC_GENSTS_SQE_Msk (0x1ul << EMAC_GENSTS_SQE_Pos) /*!< EMAC_T::GENSTS: SQE Mask */ - -#define EMAC_GENSTS_TXHALT_Pos (11) /*!< EMAC_T::GENSTS: TXHALT Position */ -#define EMAC_GENSTS_TXHALT_Msk (0x1ul << EMAC_GENSTS_TXHALT_Pos) /*!< EMAC_T::GENSTS: TXHALT Mask */ - -#define EMAC_GENSTS_RPSTS_Pos (12) /*!< EMAC_T::GENSTS: RPSTS Position */ -#define EMAC_GENSTS_RPSTS_Msk (0x1ul << EMAC_GENSTS_RPSTS_Pos) /*!< EMAC_T::GENSTS: RPSTS Mask */ - -#define EMAC_MPCNT_MPCNT_Pos (0) /*!< EMAC_T::MPCNT: MPCNT Position */ -#define EMAC_MPCNT_MPCNT_Msk (0xfffful << EMAC_MPCNT_MPCNT_Pos) /*!< EMAC_T::MPCNT: MPCNT Mask */ - -#define EMAC_RPCNT_RPCNT_Pos (0) /*!< EMAC_T::RPCNT: RPCNT Position */ -#define EMAC_RPCNT_RPCNT_Msk (0xfffful << EMAC_RPCNT_RPCNT_Pos) /*!< EMAC_T::RPCNT: RPCNT Mask */ - -#define EMAC_FRSTS_RXFLT_Pos (0) /*!< EMAC_T::FRSTS: RXFLT Position */ -#define EMAC_FRSTS_RXFLT_Msk (0xfffful << EMAC_FRSTS_RXFLT_Pos) /*!< EMAC_T::FRSTS: RXFLT Mask */ - -#define EMAC_CTXDSA_CTXDSA_Pos (0) /*!< EMAC_T::CTXDSA: CTXDSA Position */ -#define EMAC_CTXDSA_CTXDSA_Msk (0xfffffffful << EMAC_CTXDSA_CTXDSA_Pos) /*!< EMAC_T::CTXDSA: CTXDSA Mask */ - -#define EMAC_CTXBSA_CTXBSA_Pos (0) /*!< EMAC_T::CTXBSA: CTXBSA Position */ -#define EMAC_CTXBSA_CTXBSA_Msk (0xfffffffful << EMAC_CTXBSA_CTXBSA_Pos) /*!< EMAC_T::CTXBSA: CTXBSA Mask */ - -#define EMAC_CRXDSA_CRXDSA_Pos (0) /*!< EMAC_T::CRXDSA: CRXDSA Position */ -#define EMAC_CRXDSA_CRXDSA_Msk (0xfffffffful << EMAC_CRXDSA_CRXDSA_Pos) /*!< EMAC_T::CRXDSA: CRXDSA Mask */ - -#define EMAC_CRXBSA_CRXBSA_Pos (0) /*!< EMAC_T::CRXBSA: CRXBSA Position */ -#define EMAC_CRXBSA_CRXBSA_Msk (0xfffffffful << EMAC_CRXBSA_CRXBSA_Pos) /*!< EMAC_T::CRXBSA: CRXBSA Mask */ - -#define EMAC_TSCTL_TSEN_Pos (0) /*!< EMAC_T::TSCTL: TSEN Position */ -#define EMAC_TSCTL_TSEN_Msk (0x1ul << EMAC_TSCTL_TSEN_Pos) /*!< EMAC_T::TSCTL: TSEN Mask */ - -#define EMAC_TSCTL_TSIEN_Pos (1) /*!< EMAC_T::TSCTL: TSIEN Position */ -#define EMAC_TSCTL_TSIEN_Msk (0x1ul << EMAC_TSCTL_TSIEN_Pos) /*!< EMAC_T::TSCTL: TSIEN Mask */ - -#define EMAC_TSCTL_TSMODE_Pos (2) /*!< EMAC_T::TSCTL: TSMODE Position */ -#define EMAC_TSCTL_TSMODE_Msk (0x1ul << EMAC_TSCTL_TSMODE_Pos) /*!< EMAC_T::TSCTL: TSMODE Mask */ - -#define EMAC_TSCTL_TSUPDATE_Pos (3) /*!< EMAC_T::TSCTL: TSUPDATE Position */ -#define EMAC_TSCTL_TSUPDATE_Msk (0x1ul << EMAC_TSCTL_TSUPDATE_Pos) /*!< EMAC_T::TSCTL: TSUPDATE Mask */ - -#define EMAC_TSCTL_TSALMEN_Pos (5) /*!< EMAC_T::TSCTL: TSALMEN Position */ -#define EMAC_TSCTL_TSALMEN_Msk (0x1ul << EMAC_TSCTL_TSALMEN_Pos) /*!< EMAC_T::TSCTL: TSALMEN Mask */ - -#define EMAC_TSSEC_SEC_Pos (0) /*!< EMAC_T::TSSEC: SEC Position */ -#define EMAC_TSSEC_SEC_Msk (0xfffffffful << EMAC_TSSEC_SEC_Pos) /*!< EMAC_T::TSSEC: SEC Mask */ - -#define EMAC_TSSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::TSSUBSEC: SUBSEC Position */ -#define EMAC_TSSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_TSSUBSEC_SUBSEC_Pos) /*!< EMAC_T::TSSUBSEC: SUBSEC Mask */ - -#define EMAC_TSINC_CNTINC_Pos (0) /*!< EMAC_T::TSINC: CNTINC Position */ -#define EMAC_TSINC_CNTINC_Msk (0xfful << EMAC_TSINC_CNTINC_Pos) /*!< EMAC_T::TSINC: CNTINC Mask */ - -#define EMAC_TSADDEND_ADDEND_Pos (0) /*!< EMAC_T::TSADDEND: ADDEND Position */ -#define EMAC_TSADDEND_ADDEND_Msk (0xfffffffful << EMAC_TSADDEND_ADDEND_Pos) /*!< EMAC_T::TSADDEND: ADDEND Mask */ - -#define EMAC_UPDSEC_SEC_Pos (0) /*!< EMAC_T::UPDSEC: SEC Position */ -#define EMAC_UPDSEC_SEC_Msk (0xfffffffful << EMAC_UPDSEC_SEC_Pos) /*!< EMAC_T::UPDSEC: SEC Mask */ - -#define EMAC_UPDSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::UPDSUBSEC: SUBSEC Position */ -#define EMAC_UPDSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_UPDSUBSEC_SUBSEC_Pos) /*!< EMAC_T::UPDSUBSEC: SUBSEC Mask */ - -#define EMAC_ALMSEC_SEC_Pos (0) /*!< EMAC_T::ALMSEC: SEC Position */ -#define EMAC_ALMSEC_SEC_Msk (0xfffffffful << EMAC_ALMSEC_SEC_Pos) /*!< EMAC_T::ALMSEC: SEC Mask */ - -#define EMAC_ALMSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::ALMSUBSEC: SUBSEC Position */ -#define EMAC_ALMSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_ALMSUBSEC_SUBSEC_Pos) /*!< EMAC_T::ALMSUBSEC: SUBSEC Mask */ - -/**@}*/ /* EMAC_CONST */ -/**@}*/ /* end of EMAC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EMAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/epwm_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/epwm_reg.h deleted file mode 100644 index 28bf41fb6f8..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/epwm_reg.h +++ /dev/null @@ -1,5418 +0,0 @@ -/**************************************************************************//** - * @file epwm_reg.h - * @version V1.00 - * @brief EPWM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EPWM_REG_H__ -#define __EPWM_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EPWM Pulse Width Modulation Controller(EPWM) - Memory Mapped Structure for EPWM Controller -@{ */ - -typedef struct -{ - /** - * @var ECAPDAT_T::RCAPDAT - * Offset: 0x20C EPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var ECAPDAT_T::FCAPDAT - * Offset: 0x210 EPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] EPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] EPWM Falling Capture Data Register 0~5 */ -} ECAPDAT_T; - -typedef struct -{ - - - /** - * @var EPWM_T::CTL0 - * Offset: 0x00 EPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the center point of a period - * |[1] |CTRLD1 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the center point of a period - * |[2] |CTRLD2 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the center point of a period - * |[3] |CTRLD3 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the center point of a period - * |[4] |CTRLD4 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the center point of a period - * |[5] |CTRLD5 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the center point of a period - * |[8] |WINLDEN0 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[9] |WINLDEN1 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[10] |WINLDEN2 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[11] |WINLDEN3 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[12] |WINLDEN4 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[13] |WINLDEN5 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[16] |IMMLDEN0 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMP will load to PBUF and CMPBUF immediately when software update PERIOD/CMP. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMP will load to PBUF and CMPBUF immediately when software update PERIOD/CMP. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMP will load to PBUF and CMPBUF immediately when software update PERIOD/CMP. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMP will load to PBUF and CMPBUF immediately when software update PERIOD/CMP. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMP will load to PBUF and CMPBUF immediately when software update PERIOD/CMP. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMP will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMP will load to PBUF and CMPBUF immediately when software update PERIOD/CMP. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[24] |GROUPEN |Group Function Enable Bit - * | | |0 = The output waveform of each EPWM channel are independent. - * | | |1 = Unify the EPWM_CH2 and EPWM_CH4 to output the same waveform as EPWM_CH0 and unify the EPWM_CH3 and EPWM_CH5 to output the same waveform as EPWM_CH1. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, EPWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt Disabled. - * | | |1 = ICE debug mode counter halt Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects EPWM output. - * | | |EPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |EPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * @var EPWM_T::CTL1 - * Offset: 0x04 EPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[3:2] |CNTTYPE1 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[5:4] |CNTTYPE2 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[7:6] |CNTTYPE3 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[9:8] |CNTTYPE4 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[11:10] |CNTTYPE5 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[16] |CNTMODE0 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[17] |CNTMODE1 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[18] |CNTMODE2 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[19] |CNTMODE3 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[20] |CNTMODE4 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[21] |CNTMODE5 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[24] |OUTMODE0 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[25] |OUTMODE2 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[26] |OUTMODE4 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * @var EPWM_T::SYNC - * Offset: 0x08 EPWM Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PHSEN0 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[1] |PHSEN2 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[2] |PHSEN4 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[9:8] |SINSRC0 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[11:10] |SINSRC2 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[13:12] |SINSRC4 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[16] |SNFLTEN |EPWM0_SYNC_IN Noise Filter Enable Bits - * | | |0 = Noise filter of input pin EPWM0_SYNC_IN Disabled. - * | | |1 = Noise filter of input pin EPWM0_SYNC_IN Enabled. - * |[19:17] |SFLTCSEL |SYNC Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[22:20] |SFLTCNT |SYNC Edge Detector Filter Count - * | | |The register bits control the counter number of edge detector. - * |[23] |SINPINV |SYNC Input Pin Inverse - * | | |0 = The state of pin SYNC is passed to the negative edge detector. - * | | |1 = The inversed state of pin SYNC is passed to the negative edge detector. - * |[24] |PHSDIR0 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[25] |PHSDIR2 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[26] |PHSDIR4 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * @var EPWM_T::SWSYNC - * Offset: 0x0C EPWM Software Control Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWSYNC0 |Software SYNC Function (Write Only) - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source comes from SYNC_IN or this bit. - * |[1] |SWSYNC2 |Software SYNC Function (Write Only) - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source comes from SYNC_IN or this bit. - * |[2] |SWSYNC4 |Software SYNC Function (Write Only) - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source comes from SYNC_IN or this bit. - * @var EPWM_T::CLKSRC - * Offset: 0x10 EPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |EPWM_CH01 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[10:8] |ECLKSRC2 |EPWM_CH23 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[18:16] |ECLKSRC4 |EPWM_CH45 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var EPWM_T::CNTEN - * Offset: 0x20 EPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[1] |CNTEN1 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[2] |CNTEN2 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[3] |CNTEN3 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[4] |CNTEN4 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[5] |CNTEN5 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * @var EPWM_T::CNTCLR - * Offset: 0x24 EPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[1] |CNTCLR1 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[2] |CNTCLR2 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[3] |CNTCLR3 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[4] |CNTCLR4 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[5] |CNTCLR5 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * @var EPWM_T::LOAD - * Offset: 0x28 EPWM Load Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LOAD0 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write to reload EPWM_CMPDATn, n=0~5. Hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[1] |LOAD1 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write to reload EPWM_CMPDATn, n=0~5. Hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[2] |LOAD2 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write to reload EPWM_CMPDATn, n=0~5. Hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[3] |LOAD3 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write to reload EPWM_CMPDATn, n=0~5. Hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[4] |LOAD4 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write to reload EPWM_CMPDATn, n=0~5. Hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[5] |LOAD5 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write to reload EPWM_CMPDATn, n=0~5. Hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * @var EPWM_T::PERIOD[6] - * Offset: 0x30 EPWM Period Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Down-Count mode: - * | | |In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Up-Down-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * (CLKPSC+1) * EPWM_CLK. - * @var EPWM_T::CMPDAT[6] - * Offset: 0x50 EPWM Comparator Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP is used to compare with CNT (EPWM_CNTn[15:0]) bits to generate EPWM waveform, interrupt and trigger EADC/DAC. - * | | |In independent mode, EPWM_CMPDATn, n=0,1..5 denote as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, EPWM_CMPDAT0, EPWM_CMPDAT 2, EPWM_CMPDAT4 denote as first compared point, and EPWM_CMPDAT1, EPWM_CMPDAT3, EPWM_CMPDAT5 denote as second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::PHS[3] - * Offset: 0x80 EPWM Counter Phase Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PHS |EPWM Synchronous Start Phase Bits - * | | |PHS determines the EPWM synchronous start phase value. These bits only use in synchronous function. - * @var EPWM_T::CNT[6] - * Offset: 0x90 EPWM Counter Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNTR to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is counting down. - * | | |1 = Counter is counting up. - * @var EPWM_T::WGCTL0 - * Offset: 0xB0 EPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[3:2] |ZPCTL1 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[5:4] |ZPCTL2 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[7:6] |ZPCTL3 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[9:8] |ZPCTL4 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[11:10] |ZPCTL5 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[17:16] |PRDPCTL0 |EPWM Period or Center Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |EPWM Period or Center Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |EPWM Period or Center Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |EPWM Period or Center Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |EPWM Period or Center Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |EPWM Period or Center Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * @var EPWM_T::WGCTL1 - * Offset: 0xB4 EPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[3:2] |CMPUCTL1 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[5:4] |CMPUCTL2 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[7:6] |CMPUCTL3 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[9:8] |CMPUCTL4 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[11:10] |CMPUCTL5 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[17:16] |CMPDCTL0 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[19:18] |CMPDCTL1 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[21:20] |CMPDCTL2 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[23:22] |CMPDCTL3 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[25:24] |CMPDCTL4 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[27:26] |CMPDCTL5 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMP. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * @var EPWM_T::MSKEN - * Offset: 0xB8 EPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[1] |MSKEN1 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[2] |MSKEN2 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[3] |MSKEN3 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[4] |MSKEN4 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[5] |MSKEN5 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * @var EPWM_T::MSK - * Offset: 0xBC EPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[1] |MSKDAT1 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[2] |MSKDAT2 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[3] |MSKDAT3 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[4] |MSKDAT4 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[5] |MSKDAT5 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * @var EPWM_T::BNF - * Offset: 0xC0 EPWM Brake Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRK0NFEN |EPWM Brake 0 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 0 Disabled. - * | | |1 = Noise filter of EPWM Brake 0 Enabled. - * |[3:1] |BRK0NFSEL |Brake 0 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[6:4] |BRK0FCNT |Brake 0 Edge Detector Filter Count - * | | |The register bits control the Brake0 filter counter to count from 0 to BRK0FCNT. - * |[7] |BRK0PINV |Brake 0 Pin Inverse - * | | |0 = brake pin event will be detected if EPWMx_BRAKE0 pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = brake pin event will be detected if EPWMx_BRAKE0 pin status transfer from high to low in edge-detect, or pin status is low in level-detect. - * |[8] |BRK1NFEN |EPWM Brake 1 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 1 Disabled. - * | | |1 = Noise filter of EPWM Brake 1 Enabled. - * |[11:9] |BRK1NFSEL |Brake 1 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[14:12] |BRK1FCNT |Brake 1 Edge Detector Filter Count - * | | |The register bits control the Brake1 filter counter to count from 0 to BRK1FCNT. - * |[15] |BRK1PINV |Brake 1 Pin Inverse - * | | |0 = brake pin event will be detected if EPWMx_BRAKE1 pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = brake pin event will be detected if EPWMx_BRAKE1 pin status transfer from high to low in edge-detect, or pin status is low in level-detect. - * |[16] |BK0SRC |Brake 0 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 0 pin source come from EPWM0_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |For EPWM1 setting: - * | | |0 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM0_BRAKE0. - * |[24] |BK1SRC |Brake 1 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 1 pin source come from EPWM0_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |For EPWM1 setting: - * | | |0 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM0_BRAKE1. - * @var EPWM_T::FAILBRK - * Offset: 0xC4 EPWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by CSS detection Disabled. - * | | |1 = Brake Function triggered by CSS detection Enabled. - * |[1] |BODBRKEN |Brown-out Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by BOD Disabled. - * | | |1 = Brake Function triggered by BOD Enabled. - * |[2] |RAMBRKEN |SRAM Parity Error Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by SRAM parity error detection Disabled. - * | | |1 = Brake Function triggered by SRAM parity error detection Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by Core lockup detection Disabled. - * | | |1 = Brake Function triggered by Core lockup detection Enabled. - * @var EPWM_T::BRKCTL[3] - * Offset: 0xC8 EPWM Brake Edge Detect Control Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CPO0EBEN |Enable ACMP0_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as edge-detect brake source Disabled. - * | | |1 = ACMP0_O as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[1] |CPO1EBEN |Enable ACMP1_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as edge-detect brake source Disabled. - * | | |1 = ACMP1_O as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[2] |CPO2EBEN |Enable ACMP2_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP2_O as edge-detect brake source Disabled. - * | | |1 = ACMP2_O as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[3] |CPO3EBEN |Enable ACMP3_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP3_O as edge-detect brake source Disabled. - * | | |1 = ACMP3_O as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[4] |BRKP0EEN |Enable EPWMx_BRAKE0 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[5] |BRKP1EEN |Enable EPWMx_BRAKE1 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as edge-detect brake source Disabled. - * | | |1 = System Fail condition as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[8] |CPO0LBEN |Enable ACMP0_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as level-detect brake source Disabled. - * | | |1 = ACMP0_O as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[9] |CPO1LBEN |Enable ACMP1_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as level-detect brake source Disabled. - * | | |1 = ACMP1_O as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[10] |CPO2LBEN |Enable ACMP2_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP2_O as level-detect brake source Disabled. - * | | |1 = ACMP2_O as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[11] |CPO3LBEN |Enable ACMP3_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP3_O as level-detect brake source Disabled. - * | | |1 = ACMP3_O as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[12] |BRKP0LEN |Enable BKP0 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[13] |BRKP1LEN |Enable BKP1 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as level-detect brake source Disabled. - * | | |1 = System Fail condition as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[17:16] |BRKAEVEN |EPWM Brake Action Select for Even Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect even channels output. - * | | |01 = EPWM even channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM even channel output low level when EPWMx brake event happened. - * | | |11 = EPWM even channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[19:18] |BRKAODD |EPWM Brake Action Select for Odd Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect odd channels output. - * | | |01 = EPWM odd channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM odd channel output low level when EPWMx brake event happened. - * | | |11 = EPWM odd channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[20] |EADC0EBEN |Enable EADC0 Result Monitor as Edge-detect Brake Source (Write Protect) - * | | |0 = EADC0RM as edge-detect brake source Disabled. - * | | |1 = EADC0RM as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[21] |EADC1EBEN |Enable EADC1 Result Monitor as Edge-detect Brake Source (Write Protect) - * | | |0 = EADC1RM as edge-detect brake source Disabled. - * | | |1 = EADC1RM as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[22] |EADC2EBEN |Enable EADC2 Result Monitor as Edge-detect Brake Source (Write Protect) - * | | |0 = EADC1RM as edge-detect brake source Disabled. - * | | |1 = EADC1RM as edge-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[28] |EADC0LBEN |Enable EADC0 Result Monitor as Level-detect Brake Source (Write Protect) - * | | |0 = EADC0RM as level-detect brake source Disabled. - * | | |1 = EADC0RM as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[29] |EADC1LBEN |Enable EADC1 Result Monitor as Level-detect Brake Source (Write Protect) - * | | |0 = EADC1RM as level-detect brake source Disabled. - * | | |1 = EADC1RM as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[30] |EADC2LBEN |Enable EADC2 Result Monitor as Level-detect Brake Source (Write Protect) - * | | |0 = EADC2RM as level-detect brake source Disabled. - * | | |1 = EADC2RM as level-detect brake source Enabled. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::POLCTL - * Offset: 0xD4 EPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[1] |PINV1 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[2] |PINV2 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[3] |PINV3 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[4] |PINV4 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[5] |PINV5 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * @var EPWM_T::POEN - * Offset: 0xD8 EPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[1] |POEN1 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[2] |POEN2 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[3] |POEN3 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[4] |POEN4 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[5] |POEN5 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * @var EPWM_T::SWBRK - * Offset: 0xDC EPWM Software Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG0 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[1] |BRKETRG2 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[2] |BRKETRG4 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[8] |BRKLTRG0 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[9] |BRKLTRG2 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[10] |BRKLTRG4 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::INTEN0 - * Offset: 0xE0 EPWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[1] |ZIEN1 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[2] |ZIEN2 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[3] |ZIEN3 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[4] |ZIEN4 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[5] |ZIEN5 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[8] |PIEN0 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[9] |PIEN1 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[10] |PIEN2 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[11] |PIEN3 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[12] |PIEN4 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[13] |PIEN5 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[16] |CMPUIEN0 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[17] |CMPUIEN1 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[18] |CMPUIEN2 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[19] |CMPUIEN3 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[20] |CMPUIEN4 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[21] |CMPUIEN5 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[24] |CMPDIEN0 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[25] |CMPDIEN1 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[26] |CMPDIEN2 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[27] |CMPDIEN3 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[28] |CMPDIEN4 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[29] |CMPDIEN5 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * @var EPWM_T::INTEN1 - * Offset: 0xE4 EPWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN0_1|EPWM Edge-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[1] |BRKEIEN2_3|EPWM Edge-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[2] |BRKEIEN4_5|EPWM Edge-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIEN0_1|EPWM Level-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Level-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[9] |BRKLIEN2_3|EPWM Level-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Level-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[10] |BRKLIEN4_5|EPWM Level-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Level-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * @var EPWM_T::INTSTS0 - * Offset: 0xE8 EPWM Interrupt Flag Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[1] |ZIF1 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[2] |ZIF2 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[3] |ZIF3 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[4] |ZIF4 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[5] |ZIF5 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[8] |PIF0 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[9] |PIF1 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[10] |PIF2 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[11] |PIF3 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[12] |PIF4 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[13] |PIF5 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[16] |CMPUIF0 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[17] |CMPUIF1 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[18] |CMPUIF2 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[19] |CMPUIF3 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[20] |CMPUIF4 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[21] |CMPUIF5 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[24] |CMPDIF0 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[25] |CMPDIF1 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[26] |CMPDIF2 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[27] |CMPDIF3 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[28] |CMPDIF4 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[29] |CMPDIF5 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * @var EPWM_T::INTSTS1 - * Offset: 0xEC EPWM Interrupt Flag Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |EPWM Channel0 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel0 edge-detect brake event do not happened. - * | | |1 = When EPWM channel0 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[1] |BRKEIF1 |EPWM Channel1 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel1 edge-detect brake event do not happened. - * | | |1 = When EPWM channel1 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[2] |BRKEIF2 |EPWM Channel2 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel2 edge-detect brake event do not happened. - * | | |1 = When EPWM channel2 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[3] |BRKEIF3 |EPWM Channel3 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel3 edge-detect brake event do not happened. - * | | |1 = When EPWM channel3 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[4] |BRKEIF4 |EPWM Channel4 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel4 edge-detect brake event do not happened. - * | | |1 = When EPWM channel4 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[5] |BRKEIF5 |EPWM Channel5 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel5 edge-detect brake event do not happened. - * | | |1 = When EPWM channel5 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIF0 |EPWM Channel0 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel0 level-detect brake event do not happened. - * | | |1 = When EPWM channel0 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[9] |BRKLIF1 |EPWM Channel1 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel1 level-detect brake event do not happened. - * | | |1 = When EPWM channel1 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[10] |BRKLIF2 |EPWM Channel2 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel2 level-detect brake event do not happened. - * | | |1 = When EPWM channel2 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[11] |BRKLIF3 |EPWM Channel3 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel3 level-detect brake event do not happened. - * | | |1 = When EPWM channel3 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[12] |BRKLIF4 |EPWM Channel4 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel4 level-detect brake event do not happened. - * | | |1 = When EPWM channel4 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[13] |BRKLIF5 |EPWM Channel5 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel5 level-detect brake event do not happened. - * | | |1 = When EEPWM channel5 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected. Refer toSYS_REGLCTL register. - * |[16] |BRKESTS0 |EPWM Channel0 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel0 edge-detect brake state is released. - * | | |1 = When EPWM channel0 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel0 at brake state, writing 1 to clear. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[17] |BRKESTS1 |EPWM Channel1 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel1 edge-detect brake state is released. - * | | |1 = When EPWM channel1 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel1 at brake state, writing 1 to clear. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[18] |BRKESTS2 |EPWM Channel2 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel2 edge-detect brake state is released. - * | | |1 = When EPWM channel2 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel2 at brake state, writing 1 to clear. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[19] |BRKESTS3 |EPWM Channel3 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel3 edge-detect brake state is released. - * | | |1 = When EPWM channel3 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel3 at brake state, writing 1 to clear. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[20] |BRKESTS4 |EPWM Channel4 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel4 edge-detect brake state is released. - * | | |1 = When EPWM channel4 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel4 at brake state, writing 1 to clear. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[21] |BRKESTS5 |EPWM Channel5 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel5 edge-detect brake state is released. - * | | |1 = When EPWM channel5 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel5 at brake state, writing 1 to clear. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[24] |BRKLSTS0 |EPWM Channel0 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel0 level-detect brake state is released. - * | | |1 = When EPWM channel0 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel0 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[25] |BRKLSTS1 |EPWM Channel1 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel1 level-detect brake state is released. - * | | |1 = When EPWM channel1 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel1 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[26] |BRKLSTS2 |EPWM Channel2 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel2 level-detect brake state is released. - * | | |1 = When EPWM channel2 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel2 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[27] |BRKLSTS3 |EPWM Channel3 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel3 level-detect brake state is released. - * | | |1 = When EPWM channel3 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel3 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[28] |BRKLSTS4 |EPWM Channel4 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel4 level-detect brake state is released. - * | | |1 = When EPWM channel4 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel4 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[29] |BRKLSTS5 |EPWM Channel5 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel5 level-detect brake state is released. - * | | |1 = When EPWM channel5 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel5 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * @var EPWM_T::DACTRGEN - * Offset: 0xF4 EPWM Trigger DAC Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZTE0 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[1] |ZTE1 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[2] |ZTE2 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[3] |ZTE3 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[4] |ZTE4 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[5] |ZTE5 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[8] |PTE0 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[9] |PTE1 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[10] |PTE2 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[11] |PTE3 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[12] |PTE4 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[13] |PTE5 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[16] |CUTRGEN0 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to CMP if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note 2: In complementary mode, CUTRGEN1, 3, 5 is used as another CUTRGEN for channel 0, 2, 4. - * |[17] |CUTRGEN1 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to CMP if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note 2: In complementary mode, CUTRGEN1, 3, 5 is used as another CUTRGEN for channel 0, 2, 4. - * |[18] |CUTRGEN2 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to CMP if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note 2: In complementary mode, CUTRGEN1, 3, 5 is used as another CUTRGEN for channel 0, 2, 4. - * |[19] |CUTRGEN3 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to CMP if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note 2: In complementary mode, CUTRGEN1, 3, 5 is used as another CUTRGEN for channel 0, 2, 4. - * |[20] |CUTRGEN4 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to CMP if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note 2: In complementary mode, CUTRGEN1, 3, 5 is used as another CUTRGEN for channel 0, 2, 4. - * |[21] |CUTRGEN5 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter counts up to CMP if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note 2: In complementary mode, CUTRGEN1, 3, 5 is used as another CUTRGEN for channel 0, 2, 4. - * |[24] |CDTRGEN0 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMP if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note 2: In complementary mode, CDTRGEN1, 3, 5 is used as another CDTRGEN for channel 0, 2, 4. - * |[25] |CDTRGEN1 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMP if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note 2: In complementary mode, CDTRGEN1, 3, 5 is used as another CDTRGEN for channel 0, 2, 4. - * |[26] |CDTRGEN2 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMP if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note 2: In complementary mode, CDTRGEN1, 3, 5 is used as another CDTRGEN for channel 0, 2, 4. - * |[27] |CDTRGEN3 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMP if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note 2: In complementary mode, CDTRGEN1, 3, 5 is used as another CDTRGEN for channel 0, 2, 4. - * |[28] |CDTRGEN4 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMP if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note 2: In complementary mode, CDTRGEN1, 3, 5 is used as another CDTRGEN for channel 0, 2, 4. - * |[29] |CDTRGEN5 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMP if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note 1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note 2: In complementary mode, CDTRGEN1, 3, 5 is used as another CDTRGEN for channel 0, 2, 4. - * @var EPWM_T::EADCTS0 - * Offset: 0xF8 EPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |TRGSEL0 |EPWM_CH0 Trigger EADC Source Select - * | | |00000 = EPWM_CH0 zero point. - * | | |00001 = EPWM_CH0 period point. - * | | |00010 = EPWM_CH0 zero or period point. - * | | |00011 = EPWM_CH0 up-count compared point. - * | | |00100 = EPWM_CH0 down-count compared point. - * | | |00101 = EPWM_CH1 zero point. - * | | |00110 = EPWM_CH1 period point. - * | | |00111 = EPWM_CH1 zero or period point. - * | | |01000 = EPWM_CH1 up-count compared point. - * | | |01001 = EPWM_CH1 down-count compared point. - * | | |01010 = EPWM_CH0 up-count free trigger compared point. - * | | |01011 = EPWM_CH0 down-count free trigger compared point. - * | | |01100 = EPWM_CH2 up-count free trigger compared point. - * | | |01101 = EPWM_CH2 down-count free trigger compared point. - * | | |01110 = EPWM_CH4 up-count free trigger compared point. - * | | |01111 = EPWM_CH4 down-count free trigger compared point. - * | | |10000 = EPWM_CH0 Interrupt Flag Accumulator Interrupt. - * | | |10001 = EPWM_CH1 Interrupt Flag Accumulator Interrupt. - * |[7] |TRGEN0 |EPWM_CH0 Trigger EADC Enable Bit - * | | |0 = EPWM_CH0 Trigger EADC function Disabled. - * | | |1 = EPWM_CH0 Trigger EADC function Enabled. - * |[12:8] |TRGSEL1 |EPWM_CH1 Trigger EADC Source Select - * | | |00000 = EPWM_CH0 zero point. - * | | |00001 = EPWM_CH0 period point. - * | | |00010 = EPWM_CH0 zero or period point. - * | | |00011 = EPWM_CH0 up-count compared point. - * | | |00100 = EPWM_CH0 down-count compared point. - * | | |00101 = EPWM_CH1 zero point. - * | | |00110 = EPWM_CH1 period point. - * | | |00111 = EPWM_CH1 zero or period point. - * | | |01000 = EPWM_CH1 up-count compared point. - * | | |01001 = EPWM_CH1 down-count compared point. - * | | |01010 = EPWM_CH0 up-count free trigger compared point. - * | | |01011 = EPWM_CH0 down-count free trigger compared point. - * | | |01100 = EPWM_CH2 up-count free trigger compared point. - * | | |01101 = EPWM_CH2 down-count free trigger compared point. - * | | |01110 = EPWM_CH4 up-count free trigger compared point. - * | | |01111 = EPWM_CH4 down-count free trigger compared point. - * | | |10000 = EPWM_CH0 Interrupt Flag Accumulator Interrupt. - * | | |10001 = EPWM_CH1 Interrupt Flag Accumulator Interrupt. - * |[15] |TRGEN1 |EPWM_CH1 Trigger EADC Enable Bit - * | | |0 = EPWM_CH1 Trigger EADC function Disabled. - * | | |1 = EPWM_CH1 Trigger EADC function Enabled. - * |[20:16] |TRGSEL2 |EPWM_CH2 Trigger EADC Source Select - * | | |00000 = EPWM_CH2 zero point. - * | | |00001 = EPWM_CH2 period point. - * | | |00010 = EPWM_CH2 zero or period point. - * | | |00011 = EPWM_CH2 up-count compared point. - * | | |00100 = EPWM_CH2 down-count compared point. - * | | |00101 = EPWM_CH3 zero point. - * | | |00110 = EPWM_CH3 period point. - * | | |00111 = EPWM_CH3 zero or period point. - * | | |01000 = EPWM_CH3 up-count compared point. - * | | |01001 = EPWM_CH3 down-count compared point. - * | | |01010 = EPWM_CH0 up-count free trigger compared point. - * | | |01011 = EPWM_CH0 down-count free trigger compared point. - * | | |01100 = EPWM_CH2 up-count free trigger compared point. - * | | |01101 = EPWM_CH2 down-count free trigger compared point. - * | | |01110 = EPWM_CH4 up-count free trigger compared point. - * | | |01111 = EPWM_CH4 down-count free trigger compared point. - * | | |10000 = EPWM_CH2 Interrupt Flag Accumulator Interrupt. - * | | |10001 = EPWM_CH3 Interrupt Flag Accumulator Interrupt. - * |[23] |TRGEN2 |EPWM_CH2 Trigger EADC Enable Bit - * | | |0 = EPWM_CH2 Trigger EADC function Disabled. - * | | |1 = EPWM_CH2 Trigger EADC function Enabled. - * |[28:24] |TRGSEL3 |EPWM_CH3 Trigger EADC Source Select - * | | |00000 = EPWM_CH2 zero point. - * | | |00001 = EPWM_CH2 period point. - * | | |00010 = EPWM_CH2 zero or period point. - * | | |00011 = EPWM_CH2 up-count compared point. - * | | |00100 = EPWM_CH2 down-count compared point. - * | | |00101 = EPWM_CH3 zero point. - * | | |00110 = EPWM_CH3 period point. - * | | |00111 = EPWM_CH3 zero or period point. - * | | |01000 = EPWM_CH3 up-count compared point. - * | | |01001 = EPWM_CH3 down-count compared point. - * | | |01010 = EPWM_CH0 up-count free trigger compared point. - * | | |01011 = EPWM_CH0 down-count free trigger compared point. - * | | |01100 = EPWM_CH2 up-count free trigger compared point. - * | | |01101 = EPWM_CH2 down-count free trigger compared point. - * | | |01110 = EPWM_CH4 up-count free trigger compared point. - * | | |01111 = EPWM_CH4 down-count free trigger compared point. - * | | |10000 = EPWM_CH2 Interrupt Flag Accumulator Interrupt. - * | | |10001 = EPWM_CH3 Interrupt Flag Accumulator Interrupt. - * |[31] |TRGEN3 |EPWM_CH3 Trigger EADC Enable Bit - * | | |0 = EPWM_CH3 Trigger EADC function Disabled. - * | | |1 = EPWM_CH3 Trigger EADC function Enabled. - * @var EPWM_T::EADCTS1 - * Offset: 0xFC EPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |TRGSEL4 |EPWM_CH4 Trigger EADC Source Select - * | | |00000 = EPWM_CH4 zero point. - * | | |00001 = EPWM_CH4 period point. - * | | |00010 = EPWM_CH4 zero or period point. - * | | |00011 = EPWM_CH4 up-count compared point. - * | | |00100 = EPWM_CH4 down-count compared point. - * | | |00101 = EPWM_CH5 zero point. - * | | |00110 = EPWM_CH5 period point. - * | | |00111 = EPWM_CH5 zero or period point. - * | | |01000 = EPWM_CH5 up-count compared point. - * | | |01001 = EPWM_CH5 down-count compared point. - * | | |01010 = EPWM_CH0 up-count free trigger compared point. - * | | |01011 = EPWM_CH0 down-count free trigger compared point. - * | | |01100 = EPWM_CH2 up-count free trigger compared point. - * | | |01101 = EPWM_CH2 down-count free trigger compared point. - * | | |01110 = EPWM_CH4 up-count free trigger compared point. - * | | |01111 = EPWM_CH4 down-count free trigger compared point. - * | | |10000 = EPWM_CH4 Interrupt Flag Accumulator Interrupt. - * | | |10001 = EPWM_CH5 Interrupt Flag Accumulator Interrupt. - * |[7] |TRGEN4 |EPWM_CH4 Trigger EADC Enable Bit - * | | |0 = EPWM_CH4 Trigger EADC function Disabled. - * | | |1 = EPWM_CH4 Trigger EADC function Enabled. - * |[12:8] |TRGSEL5 |EPWM_CH5 Trigger EADC Source Select - * | | |00000 = EPWM_CH4 zero point. - * | | |00001 = EPWM_CH4 period point. - * | | |00010 = EPWM_CH4 zero or period point. - * | | |00011 = EPWM_CH4 up-count compared point. - * | | |00100 = EPWM_CH4 down-count compared point. - * | | |00101 = EPWM_CH5 zero point. - * | | |00110 = EPWM_CH5 period point. - * | | |00111 = EPWM_CH5 zero or period point. - * | | |01000 = EPWM_CH5 up-count compared point. - * | | |01001 = EPWM_CH5 down-count compared point. - * | | |01010 = EPWM_CH0 up-count free trigger compared point. - * | | |01011 = EPWM_CH0 down-count free trigger compared point. - * | | |01100 = EPWM_CH2 up-count free trigger compared point. - * | | |01101 = EPWM_CH2 down-count free trigger compared point. - * | | |01110 = EPWM_CH4 up-count free trigger compared point. - * | | |01111 = EPWM_CH4 down-count free trigger compared point. - * | | |10000 = EPWM_CH4 Interrupt Flag Accumulator Interrupt. - * | | |10001 = EPWM_CH5 Interrupt Flag Accumulator Interrupt. - * |[15] |TRGEN5 |EPWM_CH5 Trigger EADC Enable Bit - * | | |0 = EPWM_CH5 Trigger EADC function Disabled. - * | | |1 = EPWM_CH5 Trigger EADC function Enabled. - * @var EPWM_T::FTCMPDAT[3] - * Offset: 0x100 EPWM Free Trigger Compare Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMP |EPWM Free Trigger Compare Register - * | | |FTCMP use to compare with even CNT (EPWM_CNTm[15:0], m=0,2,4) to trigger EADC - * | | |EPWM_FTCMPDAT0_1, EPWM_FTCMPDAT2_3, EPWM_FTCMPDAT4_5 corresponding complementary pairs EPWM_CH0and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::SSCTL - * Offset: 0x110 EPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[1] |SSEN1 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[2] |SSEN2 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[3] |SSEN3 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[4] |SSEN4 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[5] |SSEN5 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[9:8] |SSRC |EPWM Synchronous Start Source Select Bits - * | | |00 = Synchronous start source come from EPWM0. - * | | |01 = Synchronous start source come from EPWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var EPWM_T::SSTRG - * Offset: 0x114 EPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |EPWM Counter Synchronous Start Enable (Write Only) - * | | |PMW counter synchronous enable function is used to make selected EPWM channels (include EPWM0_CHx and EPWM1_CHx) start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit (CNTENn, n denotes channel 0 to 5) if correlated EPWM channel counter synchronous start function is enabled. - * @var EPWM_T::LEBCTL - * Offset: 0x118 EPWM Leading Edge Blanking Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LEBEN |EPWM Leading Edge Blanking Enable Bit - * | | |0 = EPWM Leading Edge Blanking Disabled. - * | | |1 = EPWM Leading Edge Blanking Enabled. - * |[8] |SRCEN0 |EPWM Leading Edge Blanking Source From EPWM_CH0 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH0 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH0 Enabled. - * |[9] |SRCEN2 |EPWM Leading Edge Blanking Source From EPWM_CH2 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH2 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH2 Enabled. - * |[10] |SRCEN4 |EPWM Leading Edge Blanking Source From EPWM_CH4 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH4 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH4 Enabled. - * |[17:16] |TRGTYPE |EPWM Leading Edge Blanking Trigger Type - * | | |0 = When detect leading edge blanking source rising edge, blanking counter start counting. - * | | |1 = When detect leading edge blanking source falling edge, blanking counter start counting. - * | | |2 = When detect leading edge blanking source rising or falling edge, blanking counter start counting. - * | | |3 = Reserved. - * @var EPWM_T::LEBCNT - * Offset: 0x11C EPWM Leading Edge Blanking Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |LEBCNT |EPWM Leading Edge Blanking Counter - * | | |This counter value decides leading edge blanking window size - * | | |Blanking window size = LEBCNT+1, and LEB counter clock base is ECLK. - * @var EPWM_T::STATUS - * Offset: 0x120 EPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF0 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[1] |CNTMAXF1 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[2] |CNTMAXF2 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[3] |CNTMAXF3 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[4] |CNTMAXF4 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[5] |CNTMAXF5 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[8] |SYNCINF0 |Input Synchronization Latched Flag - * | | |0 = No SYNC_IN event has occurred. - * | | |1 = A SYNC_IN event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[9] |SYNCINF2 |Input Synchronization Latched Flag - * | | |0 = No SYNC_IN event has occurred. - * | | |1 = A SYNC_IN event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[10] |SYNCINF4 |Input Synchronization Latched Flag - * | | |0 = No SYNC_IN event has occurred. - * | | |1 = A SYNC_IN event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[16] |EADCTRGF0 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[17] |EADCTRGF1 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[18] |EADCTRGF2 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[19] |EADCTRGF3 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[20] |EADCTRGF4 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[21] |EADCTRGF5 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event has occurred. - * | | |1 = An EADC start of conversion trigger event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[24] |DACTRGF |DAC Start of Conversion Flag - * | | |0 = No DAC start of conversion trigger event has occurred. - * | | |1 = A DAC start of conversion trigger event has occurred. - * | | |Note: This bit can be cleared by software writing 1. - * @var EPWM_T::IFA[6] - * Offset: 0x130 EPWM Interrupt Flag Accumulator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines (IFACNT+1) times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn Stop Mode Disabled. - * | | |1 = EPWM_CHn Stop Mode Enabled. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = EPWM_CHn zero point. - * | | |01 = EPWM_CHn period in channel n. - * | | |10 = EPWM_CHn up-count compared point. - * | | |11 = EPWM_CHn down-count compared point. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator disable. - * | | |1 = EPWM_CHn interrupt flag accumulator enable. - * @var EPWM_T::AINTSTS - * Offset: 0x150 EPWM Accumulator Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIF0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[1] |IFAIF1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[2] |IFAIF2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[3] |IFAIF3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[4] |IFAIF4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[5] |IFAIF5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * @var EPWM_T::AINTEN - * Offset: 0x154 EPWM Accumulator Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIEN0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[1] |IFAIEN1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[2] |IFAIEN2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[3] |IFAIEN3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[4] |IFAIEN4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[5] |IFAIEN5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * @var EPWM_T::APDMACTL - * Offset: 0x158 EPWM Accumulator PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APDMAEN0 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[1] |APDMAEN1 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[2] |APDMAEN2 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[3] |APDMAEN3 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[4] |APDMAEN4 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[5] |APDMAEN5 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * @var EPWM_T::FDEN - * Offset: 0x160 EPWM Fault Detect Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FDEN0 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disabled. - * | | |1 = Fault detect function Enabled. - * |[1] |FDEN1 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disabled. - * | | |1 = Fault detect function Enabled. - * |[2] |FDEN2 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disabled. - * | | |1 = Fault detect function Enabled. - * |[3] |FDEN3 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disabled. - * | | |1 = Fault detect function Enabled. - * |[4] |FDEN4 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disabled. - * | | |1 = Fault detect function Enabled. - * |[5] |FDEN5 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disabled. - * | | |1 = Fault detect function Enabled. - * |[8] |FDODIS0 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enabled. - * | | |1 = EPWM detect fault and output Disabled. - * |[9] |FDODIS1 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enabled. - * | | |1 = EPWM detect fault and output Disabled. - * |[10] |FDODIS2 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enabled. - * | | |1 = EPWM detect fault and output Disabled. - * |[11] |FDODIS3 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enabled. - * | | |1 = EPWM detect fault and output Disabled. - * |[12] |FDODIS4 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enabled. - * | | |1 = EPWM detect fault and output Disabled. - * |[13] |FDODIS5 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enabled. - * | | |1 = EPWM detect fault and output Disabled. - * |[16] |FDCKS0 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0 or 1. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0 or 1. - * |[17] |FDCKS1 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0 or 1. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0 or 1. - * |[18] |FDCKS2 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0 or 1. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0 or 1. - * |[19] |FDCKS3 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0 or 1. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0 or 1. - * |[20] |FDCKS4 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0 or 1. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0 or 1. - * |[21] |FDCKS5 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0 or 1. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0 or 1. - * @var EPWM_T::FDCTL0 - * Offset: 0x164 EPWM Fault Detect Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |1. FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |2. FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |1. FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |2. FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disabled. - * | | |1 = Fault detect deglitch function Enabled. - * @var EPWM_T::FDCTL1 - * Offset: 0x168 EPWM Fault Detect Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |1. FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |2. FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |1. FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |2. FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disabled. - * | | |1 = Fault detect deglitch function Enabled. - * @var EPWM_T::FDCTL2 - * Offset: 0x16C EPWM Fault Detect Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |1. FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |2. FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |1. FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |2. FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disabled. - * | | |1 = Fault detect deglitch function Enabled. - * @var EPWM_T::FDCTL3 - * Offset: 0x170 EPWM Fault Detect Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |1. FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |2. FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |1. FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |2. FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disabled. - * | | |1 = Fault detect deglitch function Enabled. - * @var EPWM_T::FDCTL4 - * Offset: 0x174 EPWM Fault Detect Control Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |1. FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |2. FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |1. FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |2. FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disabled. - * | | |1 = Fault detect deglitch function Enabled. - * @var EPWM_T::FDCTL5 - * Offset: 0x178 EPWM Fault Detect Control Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |1. FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |2. FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT+2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |1. FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |2. FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSCn[11:0]) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSCn[11:0]) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disabled. - * | | |1 = Fault detect deglitch function Enabled. - * @var EPWM_T::FDIEN - * Offset: 0x17C EPWM Fault Detect Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FDIENn |EPWM Channel n Fault Detect Interrupt Enable Bit - * | | |0 = EPWM Channel n Fault Detect Interrupt Disabled. - * | | |1 = EPWM Channel n Fault Detect Interrupt Enabled. - * @var EPWM_T::FDSTS - * Offset: 0x180 EPWM Fault Detect Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |FDIFn |EPWM Channel n Fault Detect Interrupt Flag Bit - * | | |Fault Detect Interrupt Flag will be set when EPWM output short - * | | |Software can clear this bit by writing 1 to it. - * @var EPWM_T::EADCPSCCTL - * Offset: 0x184 EPWM Trigger EADC Prescale Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PSCEN0 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[1] |PSCEN1 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[2] |PSCEN2 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[3] |PSCEN3 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[4] |PSCEN4 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[5] |PSCEN5 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * @var EPWM_T::EADCPSC0 - * Offset: 0x188 EPWM Trigger EADC Prescale Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EADCPSC0 |EPWM Channel 0 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC0+1) times of EPWM_CH0 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF0. - * |[11:8] |EADCPSC1 |EPWM Channel 1 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC1+1) times of EPWM_CH1 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF1. - * |[19:16] |EADCPSC2 |EPWM Channel 2 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC2+1) times of EPWM_CH2 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF2. - * |[27:24] |EADCPSC3 |EPWM Channel 3 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC3+1) times of EPWM_CH3 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF3. - * @var EPWM_T::EADCPSC1 - * Offset: 0x18C EPWM Trigger EADC Prescale Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EADCPSC4 |EPWM Channel 4 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC4+1) times of EPWM_CH4 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF4. - * |[11:8] |EADCPSC5 |EPWM Channel 5 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC5+1) times of EPWM_CH5 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF5. - * @var EPWM_T::EADCPSCNT0 - * Offset: 0x190 EPWM Trigger EADC Prescale Counter Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PSCNT0 |EPWM Trigger EADC Prescale Counter 0 - * | | |User can monitor PSCNT0 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN0 is 0. - * | | |Note 2: Write data limitation: PSCNT0 < EADCPSC0. - * |[11:8] |PSCNT1 |EPWM Trigger EADC Prescale Counter 1 - * | | |User can monitor PSCNT1 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN1 is 0. - * | | |Note 2: Write data limitation: PSCNT1 < EADCPSC1. - * |[19:16] |PSCNT2 |EPWM Trigger EADC Prescale Counter 2 - * | | |User can monitor PSCNT2 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN2 is 0. - * | | |Note 2: Write data limitation: PSCNT2 < EADCPSC2. - * |[27:24] |PSCNT3 |EPWM Trigger EADC Prescale Counter 3 - * | | |User can monitor PSCNT3 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN3 is 0. - * | | |Note 2: Write data limitation: PSCNT3 < EADCPSC3. - * @var EPWM_T::EADCPSCNT1 - * Offset: 0x194 EPWM Trigger EADC Prescale Counter Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PSCNT4 |EPWM Trigger EADC Prescale Counter 4 - * | | |User can monitor PSCNT4 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: User can write only when PSCEN4 is 0. - * | | |Note 2: Write data limitation: PSCNT4 < EADCPSC4. - * |[11:8] |PSCNT5 |EPWM Trigger EADC Prescale Counter 5 - * | | |User can monitor PSCNT5 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: User can write only when PSCEN5 is 0. - * | | |Note 2: Write data limitation: PSCNT5 < EADCPSC5. - * @var EPWM_T::CAPINEN - * Offset: 0x200 EPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * @var EPWM_T::CAPCTL - * Offset: 0x204 EPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. EPWM_RCAPDATn/EPWM_FCAPDATn register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. EPWM_RCAPDATn/EPWM_FCAPDATn register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. EPWM_RCAPDATn/EPWM_FCAPDATn register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. EPWM_RCAPDATn/EPWM_FCAPDATn register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. EPWM_RCAPDATn/EPWM_FCAPDATn register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. EPWM_RCAPDATn/EPWM_FCAPDATn register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var EPWM_T::CAPSTS - * Offset: 0x208 EPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIFOV0 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIFn(EPWM_CAPIF[n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CRLIFn(EPWM_CAPIF[n]). - * |[1] |CRLIFOV1 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIFn(EPWM_CAPIF[n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CRLIFn(EPWM_CAPIF[n]). - * |[2] |CRLIFOV2 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIFn(EPWM_CAPIF[n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CRLIFn(EPWM_CAPIF[n]). - * |[3] |CRLIFOV3 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIFn(EPWM_CAPIF[n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CRLIFn(EPWM_CAPIF[n]). - * |[4] |CRLIFOV4 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIFn(EPWM_CAPIF[n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CRLIFn(EPWM_CAPIF[n]). - * |[5] |CRLIFOV5 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIFn(EPWM_CAPIF[n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CRLIFn(EPWM_CAPIF[n]). - * |[8] |CFLIFOV0 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIFn(EPWM_CAPIF[8+n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CFLIFn(EPWM_CAPIF[8+n]). - * |[9] |CFLIFOV1 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIFn(EPWM_CAPIF[8+n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CFLIFn(EPWM_CAPIF[8+n]). - * |[10] |CFLIFOV2 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIFn(EPWM_CAPIF[8+n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CFLIFn(EPWM_CAPIF[8+n]). - * |[11] |CFLIFOV3 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIFn(EPWM_CAPIF[8+n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CFLIFn(EPWM_CAPIF[8+n]). - * |[12] |CFLIFOV4 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIFn(EPWM_CAPIF[8+n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CFLIFn(EPWM_CAPIF[8+n]). - * |[13] |CFLIFOV5 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIFn(EPWM_CAPIF[8+n]) is 1. - * | | |Note: This bit will be cleared automatically when user clears corresponding CFLIFn(EPWM_CAPIF[8+n]). - * @var EPWM_T::RCAPDAT0 - * Offset: 0x20C EPWM Rising Capture Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT0 - * Offset: 0x210 EPWM Falling Capture Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT1 - * Offset: 0x214 EPWM Rising Capture Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT1 - * Offset: 0x218 EPWM Falling Capture Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT2 - * Offset: 0x21C EPWM Rising Capture Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT2 - * Offset: 0x220 EPWM Falling Capture Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT3 - * Offset: 0x224 EPWM Rising Capture Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT3 - * Offset: 0x228 EPWM Falling Capture Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT4 - * Offset: 0x22C EPWM Rising Capture Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT4 - * Offset: 0x230 EPWM Falling Capture Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT5 - * Offset: 0x234 EPWM Rising Capture Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT5 - * Offset: 0x238 EPWM Falling Capture Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::PDMACTL - * Offset: 0x23C EPWM PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHEN0_1 |Channel 0/1 PDMA Enable Bit - * | | |0 = Channel 0/1 PDMA function Disabled. - * | | |1 = Channel 0/1 PDMA function Enabled for the channel 0/1 captured data and transfer to memory. - * |[2:1] |CAPMOD0_1 |Select EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT0/1. - * | | |10 = EPWM_FCAPDAT0/1. - * | | |11 = Both EPWM_RCAPDAT0/1 and EPWM_FCAPDAT0/1. - * |[3] |CAPORD0_1 |Capture Channel 0/1 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 is the first captured data transferred to memory through PDMA when CAPMOD0_1 =11. - * | | |0 = EPWM_FCAPDAT0/1 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT0/1 is the first captured data to memory. - * |[4] |CHSEL0_1 |Select Channel 0/1 to Do PDMA Transfer - * | | |0 = Channel0. - * | | |1 = Channel1. - * |[8] |CHEN2_3 |Channel 2/3 PDMA Enable Bit - * | | |0 = Channel 2/3 PDMA function Disabled. - * | | |1 = Channel 2/3 PDMA function Enabled for the channel 2/3 captured data and transfer to memory. - * |[10:9] |CAPMOD2_3 |Select EPWM_RCAPDAT2/3 or EPWM_FCAODAT2/3 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT2/3. - * | | |10 = EPWM_FCAPDAT2/3. - * | | |11 = Both EPWM_RCAPDAT2/3 and EPWM_FCAPDAT2/3. - * |[11] |CAPORD2_3 |Capture Channel 2/3 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT2/3 or EPWM_FCAPDAT2/3 is the first captured data transferred to memory through PDMA when CAPMOD2_3 =11. - * | | |0 = EPWM_FCAPDAT2/3 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT2/3 is the first captured data to memory. - * |[12] |CHSEL2_3 |Select Channel 2/3 to Do PDMA Transfer - * | | |0 = Channel2. - * | | |1 = Channel3. - * |[16] |CHEN4_5 |Channel 4/5 PDMA Enable Bit - * | | |0 = Channel 4/5 PDMA function Disabled. - * | | |1 = Channel 4/5 PDMA function Enabled for the channel 4/5 captured data and transfer to memory. - * |[18:17] |CAPMOD4_5 |Select EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT4/5. - * | | |10 = EPWM_FCAPDAT4/5. - * | | |11 = Both EPWM_RCAPDAT4/5 and EPWM_FCAPDAT4/5. - * |[19] |CAPORD4_5 |Capture Channel 4/5 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 is the first captured data transferred to memory through PDMA when CAPMOD4_5 =11. - * | | |0 = EPWM_FCAPDAT4/5 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT4/5 is the first captured data to memory. - * |[20] |CHSEL4_5 |Select Channel 4/5 to Do PDMA Transfer - * | | |0 = Channel4. - * | | |1 = Channel5. - * @var EPWM_T::PDMACAP[3] - * Offset: 0x240 EPWM Capture Channel 01 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |EPWM Capture PDMA Register (Read Only) - * | | |This register is used as a buffer to transfer EPWM capture rising or falling data to memory by PDMA. - * @var EPWM_T::CAPIEN - * Offset: 0x250 EPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIEN0 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[1] |CAPRIEN1 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[2] |CAPRIEN2 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[3] |CAPRIEN3 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[4] |CAPRIEN4 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[5] |CAPRIEN5 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[8] |CAPFIEN0 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[9] |CAPFIEN1 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[10] |CAPFIEN2 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[11] |CAPFIEN3 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[12] |CAPFIEN4 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[13] |CAPFIEN5 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var EPWM_T::CAPIF - * Offset: 0x254 EPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIF0 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CRLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[1] |CRLIF1 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CRLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[2] |CRLIF2 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CRLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[3] |CRLIF3 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CRLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[4] |CRLIF4 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CRLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[5] |CRLIF5 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CRLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[8] |CFLIF0 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, and this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CFLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[9] |CFLIF1 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, and this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CFLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[10] |CFLIF2 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, and this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CFLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[11] |CFLIF3 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, and this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CFLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[12] |CFLIF4 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, and this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CFLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[13] |CFLIF5 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, and this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, EPWM_CAPIF corresponding channel CFLIFn will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * @var EPWM_T::CAPNF0 - * Offset: 0x258 EPWM Capture Input Noise Filter Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPNFEN |Capture Noise Filter Enable - * | | |0 = Capture Noise Filter function Disabled. - * | | |1 = Capture Noise Filter function Enabled. - * |[6:4] |CAPNFSEL |Capture Edge Detector Noise Filter Clock Selection - * | | |000 = Filter clock = PCLK. - * | | |001 = Filter clock = PCLK/2. - * | | |010 = Filter clock = PCLK/4. - * | | |011 = Filter clock = PCLK/8. - * | | |100 = Filter clock = PCLK/16. - * | | |101 = Filter clock = PCLK/32. - * | | |110 = Filter clock = PCLK/64. - * | | |111 = Filter clock = PCLK/128. - * |[10:8] |CAPNFCNT |Capture Edge Detector Noise Filter Count - * | | |The register bits control the capture filter counter to count from 0 to CAPNFCNT. - * @var EPWM_T::CAPNF1 - * Offset: 0x25C EPWM Capture Input Noise Filter Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPNFEN |Capture Noise Filter Enable - * | | |0 = Capture Noise Filter function Disabled. - * | | |1 = Capture Noise Filter function Enabled. - * |[6:4] |CAPNFSEL |Capture Edge Detector Noise Filter Clock Selection - * | | |000 = Filter clock = PCLK. - * | | |001 = Filter clock = PCLK/2. - * | | |010 = Filter clock = PCLK/4. - * | | |011 = Filter clock = PCLK/8. - * | | |100 = Filter clock = PCLK/16. - * | | |101 = Filter clock = PCLK/32. - * | | |110 = Filter clock = PCLK/64. - * | | |111 = Filter clock = PCLK/128. - * |[10:8] |CAPNFCNT |Capture Edge Detector Noise Filter Count - * | | |The register bits control the capture filter counter to count from 0 to CAPNFCNT. - * @var EPWM_T::CAPNF2 - * Offset: 0x260 EPWM Capture Input Noise Filter Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPNFEN |Capture Noise Filter Enable - * | | |0 = Capture Noise Filter function Disabled. - * | | |1 = Capture Noise Filter function Enabled. - * |[6:4] |CAPNFSEL |Capture Edge Detector Noise Filter Clock Selection - * | | |000 = Filter clock = PCLK. - * | | |001 = Filter clock = PCLK/2. - * | | |010 = Filter clock = PCLK/4. - * | | |011 = Filter clock = PCLK/8. - * | | |100 = Filter clock = PCLK/16. - * | | |101 = Filter clock = PCLK/32. - * | | |110 = Filter clock = PCLK/64. - * | | |111 = Filter clock = PCLK/128. - * |[10:8] |CAPNFCNT |Capture Edge Detector Noise Filter Count - * | | |The register bits control the capture filter counter to count from 0 to CAPNFCNT. - * @var EPWM_T::CAPNF3 - * Offset: 0x264 EPWM Capture Input Noise Filter Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPNFEN |Capture Noise Filter Enable - * | | |0 = Capture Noise Filter function Disabled. - * | | |1 = Capture Noise Filter function Enabled. - * |[6:4] |CAPNFSEL |Capture Edge Detector Noise Filter Clock Selection - * | | |000 = Filter clock = PCLK. - * | | |001 = Filter clock = PCLK/2. - * | | |010 = Filter clock = PCLK/4. - * | | |011 = Filter clock = PCLK/8. - * | | |100 = Filter clock = PCLK/16. - * | | |101 = Filter clock = PCLK/32. - * | | |110 = Filter clock = PCLK/64. - * | | |111 = Filter clock = PCLK/128. - * |[10:8] |CAPNFCNT |Capture Edge Detector Noise Filter Count - * | | |The register bits control the capture filter counter to count from 0 to CAPNFCNT. - * @var EPWM_T::CAPNF4 - * Offset: 0x268 EPWM Capture Input Noise Filter Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPNFEN |Capture Noise Filter Enable - * | | |0 = Capture Noise Filter function Disabled. - * | | |1 = Capture Noise Filter function Enabled. - * |[6:4] |CAPNFSEL |Capture Edge Detector Noise Filter Clock Selection - * | | |000 = Filter clock = PCLK. - * | | |001 = Filter clock = PCLK/2. - * | | |010 = Filter clock = PCLK/4. - * | | |011 = Filter clock = PCLK/8. - * | | |100 = Filter clock = PCLK/16. - * | | |101 = Filter clock = PCLK/32. - * | | |110 = Filter clock = PCLK/64. - * | | |111 = Filter clock = PCLK/128. - * |[10:8] |CAPNFCNT |Capture Edge Detector Noise Filter Count - * | | |The register bits control the capture filter counter to count from 0 to CAPNFCNT. - * @var EPWM_T::CAPNF5 - * Offset: 0x26C EPWM Capture Input Noise Filter Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPNFEN |Capture Noise Filter Enable - * | | |0 = Capture Noise Filter function Disabled. - * | | |1 = Capture Noise Filter function Enabled. - * |[6:4] |CAPNFSEL |Capture Edge Detector Noise Filter Clock Selection - * | | |000 = Filter clock = PCLK. - * | | |001 = Filter clock = PCLK/2. - * | | |010 = Filter clock = PCLK/4. - * | | |011 = Filter clock = PCLK/8. - * | | |100 = Filter clock = PCLK/16. - * | | |101 = Filter clock = PCLK/32. - * | | |110 = Filter clock = PCLK/64. - * | | |111 = Filter clock = PCLK/128. - * |[10:8] |CAPNFCNT |Capture Edge Detector Noise Filter Count - * | | |The register bits control the capture filter counter to count from 0 to CAPNFCNT. - * @var EPWM_T::EXTETCTL0 - * Offset: 0x270 EPWM External Event Trigger Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EXETEN |External Event Trigger Enable Bit - * | | |0 = External Event Trigger function Disabled. - * | | |1 = External Event Trigger function Enabled. - * |[5:4] |CNTACTS |Counter Action Selection - * | | |00 = Counter reset. - * | | |01 = Counter start. - * | | |10 = Counter reset and start. - * | | |11 = Reserved. - * |[11:8] |EXTTRGS |External Trigger Selection - * | | |0000 = INT0. - * | | |0001 = INT1. - * | | |0010 = INT2. - * | | |0011 = INT3. - * | | |0100 = INT4. - * | | |0101 = INT5. - * | | |0110 = INT6. - * | | |0111 = INT7. - * | | |Other = Reserved. - * @var EPWM_T::EXTETCTL1 - * Offset: 0x274 EPWM External Event Trigger Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EXETEN |External Event Trigger Enable Bit - * | | |0 = External Event Trigger function Disabled. - * | | |1 = External Event Trigger function Enabled. - * |[5:4] |CNTACTS |Counter Action Selection - * | | |00 = Counter reset. - * | | |01 = Counter start. - * | | |10 = Counter reset and start. - * | | |11 = Reserved. - * |[11:8] |EXTTRGS |External Trigger Selection - * | | |0000 = INT0. - * | | |0001 = INT1. - * | | |0010 = INT2. - * | | |0011 = INT3. - * | | |0100 = INT4. - * | | |0101 = INT5. - * | | |0110 = INT6. - * | | |0111 = INT7. - * | | |Other = Reserved. - * @var EPWM_T::EXTETCTL2 - * Offset: 0x278 EPWM External Event Trigger Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EXETEN |External Event Trigger Enable Bit - * | | |0 = External Event Trigger function Disabled. - * | | |1 = External Event Trigger function Enabled. - * |[5:4] |CNTACTS |Counter Action Selection - * | | |00 = Counter reset. - * | | |01 = Counter start. - * | | |10 = Counter reset and start. - * | | |11 = Reserved. - * |[11:8] |EXTTRGS |External Trigger Selection - * | | |0000 = INT0. - * | | |0001 = INT1. - * | | |0010 = INT2. - * | | |0011 = INT3. - * | | |0100 = INT4. - * | | |0101 = INT5. - * | | |0110 = INT6. - * | | |0111 = INT7. - * | | |Other = Reserved. - * @var EPWM_T::EXTETCTL3 - * Offset: 0x27C EPWM External Event Trigger Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EXETEN |External Event Trigger Enable Bit - * | | |0 = External Event Trigger function Disabled. - * | | |1 = External Event Trigger function Enabled. - * |[5:4] |CNTACTS |Counter Action Selection - * | | |00 = Counter reset. - * | | |01 = Counter start. - * | | |10 = Counter reset and start. - * | | |11 = Reserved. - * |[11:8] |EXTTRGS |External Trigger Selection - * | | |0000 = INT0. - * | | |0001 = INT1. - * | | |0010 = INT2. - * | | |0011 = INT3. - * | | |0100 = INT4. - * | | |0101 = INT5. - * | | |0110 = INT6. - * | | |0111 = INT7. - * | | |Other = Reserved. - * @var EPWM_T::EXTETCTL4 - * Offset: 0x280 EPWM External Event Trigger Control Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EXETEN |External Event Trigger Enable Bit - * | | |0 = External Event Trigger function Disabled. - * | | |1 = External Event Trigger function Enabled. - * |[5:4] |CNTACTS |Counter Action Selection - * | | |00 = Counter reset. - * | | |01 = Counter start. - * | | |10 = Counter reset and start. - * | | |11 = Reserved. - * |[11:8] |EXTTRGS |External Trigger Selection - * | | |0000 = INT0. - * | | |0001 = INT1. - * | | |0010 = INT2. - * | | |0011 = INT3. - * | | |0100 = INT4. - * | | |0101 = INT5. - * | | |0110 = INT6. - * | | |0111 = INT7. - * | | |Other = Reserved. - * @var EPWM_T::EXTETCTL5 - * Offset: 0x284 EPWM External Event Trigger Control Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EXETEN |External Event Trigger Enable Bit - * | | |0 = External Event Trigger function Disabled. - * | | |1 = External Event Trigger function Enabled. - * |[5:4] |CNTACTS |Counter Action Selection - * | | |00 = Counter reset. - * | | |01 = Counter start. - * | | |10 = Counter reset and start. - * | | |11 = Reserved. - * |[11:8] |EXTTRGS |External Trigger Selection - * | | |0000 = INT0. - * | | |0001 = INT1. - * | | |0010 = INT2. - * | | |0011 = INT3. - * | | |0100 = INT4. - * | | |0101 = INT5. - * | | |0110 = INT6. - * | | |0111 = INT7. - * | | |Other = Reserved. - * @var EPWM_T::SWEOFCTL - * Offset: 0x288 EPWM Software Event Output Force Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OUTACTS0 |Output Action Selection - * | | |00 = Do nothing. - * | | |01 = EPWM output Low. - * | | |10 = EPWM output High. - * | | |11 = EPWM output Toggle. - * |[3:2] |OUTACTS1 |Output Action Selection - * | | |00 = Do nothing. - * | | |01 = EPWM output Low. - * | | |10 = EPWM output High. - * | | |11 = EPWM output Toggle. - * |[5:4] |OUTACTS2 |Output Action Selection - * | | |00 = Do nothing. - * | | |01 = EPWM output Low. - * | | |10 = EPWM output High. - * | | |11 = EPWM output Toggle. - * |[7:6] |OUTACTS3 |Output Action Selection - * | | |00 = Do nothing. - * | | |01 = EPWM output Low. - * | | |10 = EPWM output High. - * | | |11 = EPWM output Toggle. - * |[9:8] |OUTACTS4 |Output Action Selection - * | | |00 = Do nothing. - * | | |01 = EPWM output Low. - * | | |10 = EPWM output High. - * | | |11 = EPWM output Toggle. - * |[11:10] |OUTACTS5 |Output Action Selection - * | | |00 = Do nothing. - * | | |01 = EPWM output Low. - * | | |10 = EPWM output High. - * | | |11 = EPWM output Toggle. - * @var EPWM_T::SWEOFTRG - * Offset: 0x28C EPWM Software Event Output Force Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWETRG0 |Software Event Trigger - * | | |Write 1 to this bit will change EPWM output status according to OUTACTSn in EPWMx_SWEOFCTL setting. - * | | |Note: This bit will auto cleared by hardware. - * |[1] |SWETRG1 |Software Event Trigger - * | | |Write 1 to this bit will change EPWM output status according to OUTACTSn in EPWMx_SWEOFCTL setting. - * | | |Note: This bit will auto cleared by hardware. - * |[2] |SWETRG2 |Software Event Trigger - * | | |Write 1 to this bit will change EPWM output status according to OUTACTSn in EPWMx_SWEOFCTL setting. - * | | |Note: This bit will auto cleared by hardware. - * |[3] |SWETRG3 |Software Event Trigger - * | | |Write 1 to this bit will change EPWM output status according to OUTACTSn in EPWMx_SWEOFCTL setting. - * | | |Note: This bit will auto cleared by hardware. - * |[4] |SWETRG4 |Software Event Trigger - * | | |Write 1 to this bit will change EPWM output status according to OUTACTSn in EPWMx_SWEOFCTL setting. - * | | |Note: This bit will auto cleared by hardware. - * |[5] |SWETRG5 |Software Event Trigger - * | | |Write 1 to this bit will change EPWM output status according to OUTACTSn in EPWMx_SWEOFCTL setting. - * | | |Note: This bit will auto cleared by hardware. - * @var EPWM_T::CLKPSC0 - * Offset: 0x290 EPWM Clock Prescale Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair shares one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CLKPSC1 - * Offset: 0x294 EPWM Clock Prescale Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair shares one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CLKPSC2 - * Offset: 0x298 EPWM Clock Prescale Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair shares one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CLKPSC3 - * Offset: 0x29C EPWM Clock Prescale Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair shares one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CLKPSC4 - * Offset: 0x2A0 EPWM Clock Prescale Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair shares one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CLKPSC5 - * Offset: 0x2A4 EPWM Clock Prescale Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair shares one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::RDTCNT0_1 - * Offset: 0x2A8 EPWM Rising Dead-time Counter Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |RDTCNT |Rising Dead-time Counter (Write Protect) - * | | |The Rising dead-time can be calculated from the following formula: - * | | |RDTCKSEL=0: Rising Dead-time = (RDTCNT[11:0]+1) * EPWM_CLK period. - * | | |RDTCKSEL=1: Rising Dead-time = (RDTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::RDTCNT2_3 - * Offset: 0x2AC EPWM Rising Dead-time Counter Register 2/3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |RDTCNT |Rising Dead-time Counter (Write Protect) - * | | |The Rising dead-time can be calculated from the following formula: - * | | |RDTCKSEL=0: Rising Dead-time = (RDTCNT[11:0]+1) * EPWM_CLK period. - * | | |RDTCKSEL=1: Rising Dead-time = (RDTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::RDTCNT4_5 - * Offset: 0x2B0 EPWM Rising Dead-time Counter Register 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |RDTCNT |Rising Dead-time Counter (Write Protect) - * | | |The Rising dead-time can be calculated from the following formula: - * | | |RDTCKSEL=0: Rising Dead-time = (RDTCNT[11:0]+1) * EPWM_CLK period. - * | | |RDTCKSEL=1: Rising Dead-time = (RDTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::FDTCNT0_1 - * Offset: 0x2B4 EPWM Falling Dead-time Counter Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |FDTCNT |Falling Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |FDTCKSEL=0: Falling Dead-time = (FDTCNT[11:0]+1) * EPWM_CLK period. - * | | |FDTCKSEL=1: Falling Dead-time = (FDTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::FDTCNT2_3 - * Offset: 0x2B8 EPWM Falling Dead-time Counter Register 2/3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |FDTCNT |Falling Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |FDTCKSEL=0: Falling Dead-time = (FDTCNT[11:0]+1) * EPWM_CLK period. - * | | |FDTCKSEL=1: Falling Dead-time = (FDTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::FDTCNT4_5 - * Offset: 0x2BC EPWM Falling Dead-time Counter Register 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |FDTCNT |Falling Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |FDTCKSEL=0: Falling Dead-time = (FDTCNT[11:0]+1) * EPWM_CLK period. - * | | |FDTCKSEL=1: Falling Dead-time = (FDTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::DTCTL - * Offset: 0x2C0 EPWM Dead-time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDTEN0 |Enable Rising Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Rising Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If rising dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Rising Dead-time insertion Disabled on the pin pair. - * | | |1 = Rising Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[1] |RDTEN2 |Enable Rising Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Rising Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If rising dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Rising Dead-time insertion Disabled on the pin pair. - * | | |1 = Rising Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[2] |RDTEN4 |Enable Rising Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Rising Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If rising dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Rising Dead-time insertion Disabled on the pin pair. - * | | |1 = Rising Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[8] |FDTEN0 |Enable Falling Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Falling Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If falling dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Falling Dead-time insertion Disabled on the pin pair. - * | | |1 = Falling Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[9] |FDTEN2 |Enable Falling Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Falling Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If falling dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Falling Dead-time insertion Disabled on the pin pair. - * | | |1 = Falling Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[10] |FDTEN4 |Enable Falling Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Falling Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If falling dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Falling Dead-time insertion Disabled on the pin pair. - * | | |1 = Falling Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * |[16] |DTCKSELn |Dead-time Clock Select for EPWM Pair (Write Protect) - * | | |0 = Dead-time clock source from EPWM_CLK. - * | | |1 = Dead-time clock source from prescaler output. - * | | |Note: This bit is write protected. Refer to SYS_REGLCTL register. - * @var EPWM_T::PBUF[6] - * Offset: 0x304 EPWM PERIOD0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::CMPBUF[6] - * Offset: 0x31C EPWM CMPDAT0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CPSCBUF[3] - * Offset: 0x334 EPWM CLKPSC0_1/2_3/4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Use as EPWM counter clock prescale active register. - * @var EPWM_T::FTCBUF[3] - * Offset: 0x340 EPWM FTCMPDAT0_1/2_3/4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMPBUF |EPWM FTCMPDAT Buffer (Read Only) - * | | |Used as FTCMP active buffer. - * @var EPWM_T::FTCI - * Offset: 0x34C EPWM FTCMPDAT Indicator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FTCMU0 |EPWM FTCMPDAT Up Indicator - * | | |Indicator is set by hardware when EPWM counter up counts and reaches EPWM_FTCMPDATn - * | | |Software can clear this bit by writing 1 to it. - * |[1] |FTCMU2 |EPWM FTCMPDAT Up Indicator - * | | |Indicator is set by hardware when EPWM counter up counts and reaches EPWM_FTCMPDATn - * | | |Software can clear this bit by writing 1 to it. - * |[2] |FTCMU4 |EPWM FTCMPDAT Up Indicator - * | | |Indicator is set by hardware when EPWM counter up counts and reaches EPWM_FTCMPDATn - * | | |Software can clear this bit by writing 1 to it. - * |[8] |FTCMD0 |EPWM FTCMPDAT Down Indicator - * | | |Indicator is set by hardware when EPWM counter down counts and reaches EPWM_FTCMPDATn - * | | |Software can clear this bit by writing 1 to it. - * |[9] |FTCMD2 |EPWM FTCMPDAT Down Indicator - * | | |Indicator is set by hardware when EPWM counter down counts and reaches EPWM_FTCMPDATn - * | | |Software can clear this bit by writing 1 to it. - * |[10] |FTCMD4 |EPWM FTCMPDAT Down Indicator - * | | |Indicator is set by hardware when EPWM counter down counts and reaches EPWM_FTCMPDATn - * | | |Software can clear this bit by writing 1 to it. - * @var EPWM_T::CPSCBUF0 - * Offset: 0x350 EPWM CLKPSC0 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::CPSCBUF1 - * Offset: 0x354 EPWM CLKPSC1 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::CPSCBUF2 - * Offset: 0x358 EPWM CLKPSC2 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::CPSCBUF3 - * Offset: 0x35C EPWM CLKPSC3 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::CPSCBUF4 - * Offset: 0x360 EPWM CLKPSC4 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::CPSCBUF5 - * Offset: 0x364 EPWM CLKPSC5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::IFACNT0 - * Offset: 0x368 EPWM Interrupt Flag Accumulator Counter 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACUCNT |Accumulator Counter (Read Only) - * | | |This value indicates how many interrupt are accumulated when using interrupt flag accumulator function. - * @var EPWM_T::IFACNT1 - * Offset: 0x36C EPWM Interrupt Flag Accumulator Counter 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACUCNT |Accumulator Counter (Read Only) - * | | |This value indicates how many interrupt are accumulated when using interrupt flag accumulator function. - * @var EPWM_T::IFACNT2 - * Offset: 0x370 EPWM Interrupt Flag Accumulator Counter 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACUCNT |Accumulator Counter (Read Only) - * | | |This value indicates how many interrupt are accumulated when using interrupt flag accumulator function. - * @var EPWM_T::IFACNT3 - * Offset: 0x374 EPWM Interrupt Flag Accumulator Counter 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACUCNT |Accumulator Counter (Read Only) - * | | |This value indicates how many interrupt are accumulated when using interrupt flag accumulator function. - * @var EPWM_T::IFACNT4 - * Offset: 0x378 EPWM Interrupt Flag Accumulator Counter 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACUCNT |Accumulator Counter (Read Only) - * | | |This value indicates how many interrupt are accumulated when using interrupt flag accumulator function. - * @var EPWM_T::IFACNT5 - * Offset: 0x37C EPWM Interrupt Flag Accumulator Counter 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACUCNT |Accumulator Counter (Read Only) - * | | |This value indicates how many interrupt are accumulated when using interrupt flag accumulator function. - */ - __IO uint32_t CTL0; /*!< [0x0000] EPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] EPWM Control Register 1 */ - __IO uint32_t SYNC; /*!< [0x0008] EPWM Synchronization Register */ - __IO uint32_t SWSYNC; /*!< [0x000c] EPWM Software Control Synchronization Register */ - __IO uint32_t CLKSRC; /*!< [0x0010] EPWM Clock Source Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CNTEN; /*!< [0x0020] EPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] EPWM Clear Counter Register */ - __IO uint32_t LOAD; /*!< [0x0028] EPWM Load Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PERIOD[6]; /*!< [0x0030] EPWM Period Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CMPDAT[6]; /*!< [0x0050] EPWM Comparator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[6]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PHS[3]; /*!< [0x0080] EPWM Counter Phase Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[1]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t CNT[6]; /*!< [0x0090] EPWM Counter Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WGCTL0; /*!< [0x00b0] EPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] EPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] EPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] EPWM Mask Data Register */ - __IO uint32_t BNF; /*!< [0x00c0] EPWM Brake Noise Filter Register */ - __IO uint32_t FAILBRK; /*!< [0x00c4] EPWM System Fail Brake Control Register */ - __IO uint32_t BRKCTL[3]; /*!< [0x00c8] EPWM Brake Edge Detect Control Register 0/1,2/3,4/5 */ - __IO uint32_t POLCTL; /*!< [0x00d4] EPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] EPWM Output Enable Register */ - __O uint32_t SWBRK; /*!< [0x00dc] EPWM Software Brake Control Register */ - __IO uint32_t INTEN0; /*!< [0x00e0] EPWM Interrupt Enable Register 0 */ - __IO uint32_t INTEN1; /*!< [0x00e4] EPWM Interrupt Enable Register 1 */ - __IO uint32_t INTSTS0; /*!< [0x00e8] EPWM Interrupt Flag Register 0 */ - __IO uint32_t INTSTS1; /*!< [0x00ec] EPWM Interrupt Flag Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE6[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DACTRGEN; /*!< [0x00f4] EPWM Trigger DAC Enable Register */ - __IO uint32_t EADCTS0; /*!< [0x00f8] EPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] EPWM Trigger EADC Source Select Register 1 */ - __IO uint32_t FTCMPDAT[3]; /*!< [0x0100] EPWM Free Trigger Compare Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE7[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SSCTL; /*!< [0x0110] EPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] EPWM Synchronous Start Trigger Register */ - __IO uint32_t LEBCTL; /*!< [0x0118] EPWM Leading Edge Blanking Control Register */ - __IO uint32_t LEBCNT; /*!< [0x011c] EPWM Leading Edge Blanking Counter Register */ - __IO uint32_t STATUS; /*!< [0x0120] EPWM Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE8[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t IFA[6]; /*!< [0x0130] EPWM Interrupt Flag Accumulator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE9[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t AINTSTS; /*!< [0x0150] EPWM Accumulator Interrupt Flag Register */ - __IO uint32_t AINTEN; /*!< [0x0154] EPWM Accumulator Interrupt Enable Register */ - __IO uint32_t APDMACTL; /*!< [0x0158] EPWM Accumulator PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE10[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t FDEN; /*!< [0x0160] EPWM Fault Detect Enable Register */ - __IO uint32_t FDCTL[6]; /*!< [0x0164~0x178] EPWM Fault Detect Control Register 0~5 */ - __IO uint32_t FDIEN; /*!< [0x017C] EPWM Fault Detect Interrupt Enable Register */ - __IO uint32_t FDSTS; /*!< [0x0180] EPWM Fault Detect Interrupt Flag Register */ - __IO uint32_t EADCPSCCTL; /*!< [0x0184] EPWM Trigger EADC Prescale Control Register */ - __IO uint32_t EADCPSC0; /*!< [0x0188] EPWM Trigger EADC Prescale Register 0 */ - __IO uint32_t EADCPSC1; /*!< [0x018C] EPWM Trigger EADC Prescale Register 1 */ - __IO uint32_t EADCPSCNT0; /*!< [0x0190] EPWM Trigger EADC Prescale Counter Register 0 */ - __IO uint32_t EADCPSCNT1; /*!< [0x0194] EPWM Trigger EADC Prescale Counter Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE11[26]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPINEN; /*!< [0x0200] EPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] EPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] EPWM Capture Status Register */ - ECAPDAT_T CAPDAT[6]; /*!< [0x020C] EPWM Rising and Falling Capture Data Register 0~5 */ - __IO uint32_t PDMACTL; /*!< [0x023c] EPWM PDMA Control Register */ - __I uint32_t PDMACAP[3]; /*!< [0x0240] EPWM Capture Channel 01,23,45 PDMA Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE12[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPIEN; /*!< [0x0250] EPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] EPWM Capture Interrupt Flag Register */ - __IO uint32_t CAPNF[6]; /*!< [0x0258~0x26C] EPWM Capture Input Noise Filter Register 0~5 */ - __IO uint32_t EXTETCTL[6]; /*!< [0x0270~0x284] EPWM External Event Trigger Control Register 0~5 */ - __IO uint32_t SWEOFCTL; /*!< [0x0288] EPWM Software Event Output Force Control Register */ - __IO uint32_t SWEOFTRG; /*!< [0x028C] EPWM Software Event Output Force Trigger Register */ - __IO uint32_t CLKPSC[6]; /*!< [0x0290~0x2A4] EPWM Clock Prescale Register 0~5 */ - __IO uint32_t RDTCNT[3]; /*!< [0x02A8~0x2B0] EPWM Rising Dead-time Counter Register 0/1, 2/3, 4/5 */ - __IO uint32_t FDTCNT[3]; /*!< [0x02B4~0x2BC] EPWM Falling Dead-time Counter Register 0/1, 2/3, 4/5 */ - __IO uint32_t DTCTL; /*!< [0x02C0] EPWM Dead-Time Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE13[16]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t PBUF[6]; /*!< [0x0304] EPWM PERIOD0~5 Buffer */ - __I uint32_t CMPBUF[6]; /*!< [0x031c] EPWM CMPDAT0~5 Buffer */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE14[3]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t FTCBUF[3]; /*!< [0x0340] EPWM FTCMPDAT0_1/2_3/4_5 Buffer */ - __IO uint32_t FTCI; /*!< [0x034c] EPWM FTCMPDAT Indicator Register */ - __I uint32_t CPSCBUF[5]; /*!< [0x0350~0x364] EPWM CLKPSC0~5 Buffer */ - __I uint32_t IFACNT[5]; /*!< [0x0368~0x37C] EPWM Interrupt Flag Accumulator Counter 0~5 */ - -} EPWM_T; - -/** - @addtogroup EPWM_CONST EPWM Bit Field Definition - Constant Definitions for EPWM Controller -@{ */ - -#define EPWM_CTL0_CTRLD0_Pos (0) /*!< EPWM_T::CTL0: CTRLD0 Position */ -#define EPWM_CTL0_CTRLD0_Msk (0x1ul << EPWM_CTL0_CTRLD0_Pos) /*!< EPWM_T::CTL0: CTRLD0 Mask */ - -#define EPWM_CTL0_CTRLD1_Pos (1) /*!< EPWM_T::CTL0: CTRLD1 Position */ -#define EPWM_CTL0_CTRLD1_Msk (0x1ul << EPWM_CTL0_CTRLD1_Pos) /*!< EPWM_T::CTL0: CTRLD1 Mask */ - -#define EPWM_CTL0_CTRLD2_Pos (2) /*!< EPWM_T::CTL0: CTRLD2 Position */ -#define EPWM_CTL0_CTRLD2_Msk (0x1ul << EPWM_CTL0_CTRLD2_Pos) /*!< EPWM_T::CTL0: CTRLD2 Mask */ - -#define EPWM_CTL0_CTRLD3_Pos (3) /*!< EPWM_T::CTL0: CTRLD3 Position */ -#define EPWM_CTL0_CTRLD3_Msk (0x1ul << EPWM_CTL0_CTRLD3_Pos) /*!< EPWM_T::CTL0: CTRLD3 Mask */ - -#define EPWM_CTL0_CTRLD4_Pos (4) /*!< EPWM_T::CTL0: CTRLD4 Position */ -#define EPWM_CTL0_CTRLD4_Msk (0x1ul << EPWM_CTL0_CTRLD4_Pos) /*!< EPWM_T::CTL0: CTRLD4 Mask */ - -#define EPWM_CTL0_CTRLD5_Pos (5) /*!< EPWM_T::CTL0: CTRLD5 Position */ -#define EPWM_CTL0_CTRLD5_Msk (0x1ul << EPWM_CTL0_CTRLD5_Pos) /*!< EPWM_T::CTL0: CTRLD5 Mask */ - -#define EPWM_CTL0_WINLDEN0_Pos (8) /*!< EPWM_T::CTL0: WINLDEN0 Position */ -#define EPWM_CTL0_WINLDEN0_Msk (0x1ul << EPWM_CTL0_WINLDEN0_Pos) /*!< EPWM_T::CTL0: WINLDEN0 Mask */ - -#define EPWM_CTL0_WINLDEN1_Pos (9) /*!< EPWM_T::CTL0: WINLDEN1 Position */ -#define EPWM_CTL0_WINLDEN1_Msk (0x1ul << EPWM_CTL0_WINLDEN1_Pos) /*!< EPWM_T::CTL0: WINLDEN1 Mask */ - -#define EPWM_CTL0_WINLDEN2_Pos (10) /*!< EPWM_T::CTL0: WINLDEN2 Position */ -#define EPWM_CTL0_WINLDEN2_Msk (0x1ul << EPWM_CTL0_WINLDEN2_Pos) /*!< EPWM_T::CTL0: WINLDEN2 Mask */ - -#define EPWM_CTL0_WINLDEN3_Pos (11) /*!< EPWM_T::CTL0: WINLDEN3 Position */ -#define EPWM_CTL0_WINLDEN3_Msk (0x1ul << EPWM_CTL0_WINLDEN3_Pos) /*!< EPWM_T::CTL0: WINLDEN3 Mask */ - -#define EPWM_CTL0_WINLDEN4_Pos (12) /*!< EPWM_T::CTL0: WINLDEN4 Position */ -#define EPWM_CTL0_WINLDEN4_Msk (0x1ul << EPWM_CTL0_WINLDEN4_Pos) /*!< EPWM_T::CTL0: WINLDEN4 Mask */ - -#define EPWM_CTL0_WINLDEN5_Pos (13) /*!< EPWM_T::CTL0: WINLDEN5 Position */ -#define EPWM_CTL0_WINLDEN5_Msk (0x1ul << EPWM_CTL0_WINLDEN5_Pos) /*!< EPWM_T::CTL0: WINLDEN5 Mask */ - -#define EPWM_CTL0_IMMLDEN0_Pos (16) /*!< EPWM_T::CTL0: IMMLDEN0 Position */ -#define EPWM_CTL0_IMMLDEN0_Msk (0x1ul << EPWM_CTL0_IMMLDEN0_Pos) /*!< EPWM_T::CTL0: IMMLDEN0 Mask */ - -#define EPWM_CTL0_IMMLDEN1_Pos (17) /*!< EPWM_T::CTL0: IMMLDEN1 Position */ -#define EPWM_CTL0_IMMLDEN1_Msk (0x1ul << EPWM_CTL0_IMMLDEN1_Pos) /*!< EPWM_T::CTL0: IMMLDEN1 Mask */ - -#define EPWM_CTL0_IMMLDEN2_Pos (18) /*!< EPWM_T::CTL0: IMMLDEN2 Position */ -#define EPWM_CTL0_IMMLDEN2_Msk (0x1ul << EPWM_CTL0_IMMLDEN2_Pos) /*!< EPWM_T::CTL0: IMMLDEN2 Mask */ - -#define EPWM_CTL0_IMMLDEN3_Pos (19) /*!< EPWM_T::CTL0: IMMLDEN3 Position */ -#define EPWM_CTL0_IMMLDEN3_Msk (0x1ul << EPWM_CTL0_IMMLDEN3_Pos) /*!< EPWM_T::CTL0: IMMLDEN3 Mask */ - -#define EPWM_CTL0_IMMLDEN4_Pos (20) /*!< EPWM_T::CTL0: IMMLDEN4 Position */ -#define EPWM_CTL0_IMMLDEN4_Msk (0x1ul << EPWM_CTL0_IMMLDEN4_Pos) /*!< EPWM_T::CTL0: IMMLDEN4 Mask */ - -#define EPWM_CTL0_IMMLDEN5_Pos (21) /*!< EPWM_T::CTL0: IMMLDEN5 Position */ -#define EPWM_CTL0_IMMLDEN5_Msk (0x1ul << EPWM_CTL0_IMMLDEN5_Pos) /*!< EPWM_T::CTL0: IMMLDEN5 Mask */ - -#define EPWM_CTL0_GROUPEN_Pos (24) /*!< EPWM_T::CTL0: GROUPEN Position */ -#define EPWM_CTL0_GROUPEN_Msk (0x1ul << EPWM_CTL0_GROUPEN_Pos) /*!< EPWM_T::CTL0: GROUPEN Mask */ - -#define EPWM_CTL0_DBGHALT_Pos (30) /*!< EPWM_T::CTL0: DBGHALT Position */ -#define EPWM_CTL0_DBGHALT_Msk (0x1ul << EPWM_CTL0_DBGHALT_Pos) /*!< EPWM_T::CTL0: DBGHALT Mask */ - -#define EPWM_CTL0_DBGTRIOFF_Pos (31) /*!< EPWM_T::CTL0: DBGTRIOFF Position */ -#define EPWM_CTL0_DBGTRIOFF_Msk (0x1ul << EPWM_CTL0_DBGTRIOFF_Pos) /*!< EPWM_T::CTL0: DBGTRIOFF Mask */ - -#define EPWM_CTL1_CNTTYPE0_Pos (0) /*!< EPWM_T::CTL1: CNTTYPE0 Position */ -#define EPWM_CTL1_CNTTYPE0_Msk (0x3ul << EPWM_CTL1_CNTTYPE0_Pos) /*!< EPWM_T::CTL1: CNTTYPE0 Mask */ - -#define EPWM_CTL1_CNTTYPE1_Pos (2) /*!< EPWM_T::CTL1: CNTTYPE1 Position */ -#define EPWM_CTL1_CNTTYPE1_Msk (0x3ul << EPWM_CTL1_CNTTYPE1_Pos) /*!< EPWM_T::CTL1: CNTTYPE1 Mask */ - -#define EPWM_CTL1_CNTTYPE2_Pos (4) /*!< EPWM_T::CTL1: CNTTYPE2 Position */ -#define EPWM_CTL1_CNTTYPE2_Msk (0x3ul << EPWM_CTL1_CNTTYPE2_Pos) /*!< EPWM_T::CTL1: CNTTYPE2 Mask */ - -#define EPWM_CTL1_CNTTYPE3_Pos (6) /*!< EPWM_T::CTL1: CNTTYPE3 Position */ -#define EPWM_CTL1_CNTTYPE3_Msk (0x3ul << EPWM_CTL1_CNTTYPE3_Pos) /*!< EPWM_T::CTL1: CNTTYPE3 Mask */ - -#define EPWM_CTL1_CNTTYPE4_Pos (8) /*!< EPWM_T::CTL1: CNTTYPE4 Position */ -#define EPWM_CTL1_CNTTYPE4_Msk (0x3ul << EPWM_CTL1_CNTTYPE4_Pos) /*!< EPWM_T::CTL1: CNTTYPE4 Mask */ - -#define EPWM_CTL1_CNTTYPE5_Pos (10) /*!< EPWM_T::CTL1: CNTTYPE5 Position */ -#define EPWM_CTL1_CNTTYPE5_Msk (0x3ul << EPWM_CTL1_CNTTYPE5_Pos) /*!< EPWM_T::CTL1: CNTTYPE5 Mask */ - -#define EPWM_CTL1_CNTMODE0_Pos (16) /*!< EPWM_T::CTL1: CNTMODE0 Position */ -#define EPWM_CTL1_CNTMODE0_Msk (0x1ul << EPWM_CTL1_CNTMODE0_Pos) /*!< EPWM_T::CTL1: CNTMODE0 Mask */ - -#define EPWM_CTL1_CNTMODE1_Pos (17) /*!< EPWM_T::CTL1: CNTMODE1 Position */ -#define EPWM_CTL1_CNTMODE1_Msk (0x1ul << EPWM_CTL1_CNTMODE1_Pos) /*!< EPWM_T::CTL1: CNTMODE1 Mask */ - -#define EPWM_CTL1_CNTMODE2_Pos (18) /*!< EPWM_T::CTL1: CNTMODE2 Position */ -#define EPWM_CTL1_CNTMODE2_Msk (0x1ul << EPWM_CTL1_CNTMODE2_Pos) /*!< EPWM_T::CTL1: CNTMODE2 Mask */ - -#define EPWM_CTL1_CNTMODE3_Pos (19) /*!< EPWM_T::CTL1: CNTMODE3 Position */ -#define EPWM_CTL1_CNTMODE3_Msk (0x1ul << EPWM_CTL1_CNTMODE3_Pos) /*!< EPWM_T::CTL1: CNTMODE3 Mask */ - -#define EPWM_CTL1_CNTMODE4_Pos (20) /*!< EPWM_T::CTL1: CNTMODE4 Position */ -#define EPWM_CTL1_CNTMODE4_Msk (0x1ul << EPWM_CTL1_CNTMODE4_Pos) /*!< EPWM_T::CTL1: CNTMODE4 Mask */ - -#define EPWM_CTL1_CNTMODE5_Pos (21) /*!< EPWM_T::CTL1: CNTMODE5 Position */ -#define EPWM_CTL1_CNTMODE5_Msk (0x1ul << EPWM_CTL1_CNTMODE5_Pos) /*!< EPWM_T::CTL1: CNTMODE5 Mask */ - -#define EPWM_CTL1_OUTMODE0_Pos (24) /*!< EPWM_T::CTL1: OUTMODE0 Position */ -#define EPWM_CTL1_OUTMODE0_Msk (0x1ul << EPWM_CTL1_OUTMODE0_Pos) /*!< EPWM_T::CTL1: OUTMODE0 Mask */ - -#define EPWM_CTL1_OUTMODE2_Pos (25) /*!< EPWM_T::CTL1: OUTMODE2 Position */ -#define EPWM_CTL1_OUTMODE2_Msk (0x1ul << EPWM_CTL1_OUTMODE2_Pos) /*!< EPWM_T::CTL1: OUTMODE2 Mask */ - -#define EPWM_CTL1_OUTMODE4_Pos (26) /*!< EPWM_T::CTL1: OUTMODE4 Position */ -#define EPWM_CTL1_OUTMODE4_Msk (0x1ul << EPWM_CTL1_OUTMODE4_Pos) /*!< EPWM_T::CTL1: OUTMODE4 Mask */ - -#define EPWM_SYNC_PHSEN0_Pos (0) /*!< EPWM_T::SYNC: PHSEN0 Position */ -#define EPWM_SYNC_PHSEN0_Msk (0x1ul << EPWM_SYNC_PHSEN0_Pos) /*!< EPWM_T::SYNC: PHSEN0 Mask */ - -#define EPWM_SYNC_PHSEN2_Pos (1) /*!< EPWM_T::SYNC: PHSEN2 Position */ -#define EPWM_SYNC_PHSEN2_Msk (0x1ul << EPWM_SYNC_PHSEN2_Pos) /*!< EPWM_T::SYNC: PHSEN2 Mask */ - -#define EPWM_SYNC_PHSEN4_Pos (2) /*!< EPWM_T::SYNC: PHSEN4 Position */ -#define EPWM_SYNC_PHSEN4_Msk (0x1ul << EPWM_SYNC_PHSEN4_Pos) /*!< EPWM_T::SYNC: PHSEN4 Mask */ - -#define EPWM_SYNC_SINSRC0_Pos (8) /*!< EPWM_T::SYNC: SINSRC0 Position */ -#define EPWM_SYNC_SINSRC0_Msk (0x3ul << EPWM_SYNC_SINSRC0_Pos) /*!< EPWM_T::SYNC: SINSRC0 Mask */ - -#define EPWM_SYNC_SINSRC2_Pos (10) /*!< EPWM_T::SYNC: SINSRC2 Position */ -#define EPWM_SYNC_SINSRC2_Msk (0x3ul << EPWM_SYNC_SINSRC2_Pos) /*!< EPWM_T::SYNC: SINSRC2 Mask */ - -#define EPWM_SYNC_SINSRC4_Pos (12) /*!< EPWM_T::SYNC: SINSRC4 Position */ -#define EPWM_SYNC_SINSRC4_Msk (0x3ul << EPWM_SYNC_SINSRC4_Pos) /*!< EPWM_T::SYNC: SINSRC4 Mask */ - -#define EPWM_SYNC_SNFLTEN_Pos (16) /*!< EPWM_T::SYNC: SNFLTEN Position */ -#define EPWM_SYNC_SNFLTEN_Msk (0x1ul << EPWM_SYNC_SNFLTEN_Pos) /*!< EPWM_T::SYNC: SNFLTEN Mask */ - -#define EPWM_SYNC_SFLTCSEL_Pos (17) /*!< EPWM_T::SYNC: SFLTCSEL Position */ -#define EPWM_SYNC_SFLTCSEL_Msk (0x7ul << EPWM_SYNC_SFLTCSEL_Pos) /*!< EPWM_T::SYNC: SFLTCSEL Mask */ - -#define EPWM_SYNC_SFLTCNT_Pos (20) /*!< EPWM_T::SYNC: SFLTCNT Position */ -#define EPWM_SYNC_SFLTCNT_Msk (0x7ul << EPWM_SYNC_SFLTCNT_Pos) /*!< EPWM_T::SYNC: SFLTCNT Mask */ - -#define EPWM_SYNC_SINPINV_Pos (23) /*!< EPWM_T::SYNC: SINPINV Position */ -#define EPWM_SYNC_SINPINV_Msk (0x1ul << EPWM_SYNC_SINPINV_Pos) /*!< EPWM_T::SYNC: SINPINV Mask */ - -#define EPWM_SYNC_PHSDIR0_Pos (24) /*!< EPWM_T::SYNC: PHSDIR0 Position */ -#define EPWM_SYNC_PHSDIR0_Msk (0x1ul << EPWM_SYNC_PHSDIR0_Pos) /*!< EPWM_T::SYNC: PHSDIR0 Mask */ - -#define EPWM_SYNC_PHSDIR2_Pos (25) /*!< EPWM_T::SYNC: PHSDIR2 Position */ -#define EPWM_SYNC_PHSDIR2_Msk (0x1ul << EPWM_SYNC_PHSDIR2_Pos) /*!< EPWM_T::SYNC: PHSDIR2 Mask */ - -#define EPWM_SYNC_PHSDIR4_Pos (26) /*!< EPWM_T::SYNC: PHSDIR4 Position */ -#define EPWM_SYNC_PHSDIR4_Msk (0x1ul << EPWM_SYNC_PHSDIR4_Pos) /*!< EPWM_T::SYNC: PHSDIR4 Mask */ - -#define EPWM_SWSYNC_SWSYNC0_Pos (0) /*!< EPWM_T::SWSYNC: SWSYNC0 Position */ -#define EPWM_SWSYNC_SWSYNC0_Msk (0x1ul << EPWM_SWSYNC_SWSYNC0_Pos) /*!< EPWM_T::SWSYNC: SWSYNC0 Mask */ - -#define EPWM_SWSYNC_SWSYNC2_Pos (1) /*!< EPWM_T::SWSYNC: SWSYNC2 Position */ -#define EPWM_SWSYNC_SWSYNC2_Msk (0x1ul << EPWM_SWSYNC_SWSYNC2_Pos) /*!< EPWM_T::SWSYNC: SWSYNC2 Mask */ - -#define EPWM_SWSYNC_SWSYNC4_Pos (2) /*!< EPWM_T::SWSYNC: SWSYNC4 Position */ -#define EPWM_SWSYNC_SWSYNC4_Msk (0x1ul << EPWM_SWSYNC_SWSYNC4_Pos) /*!< EPWM_T::SWSYNC: SWSYNC4 Mask */ - -#define EPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< EPWM_T::CLKSRC: ECLKSRC0 Position */ -#define EPWM_CLKSRC_ECLKSRC0_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC0_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define EPWM_CLKSRC_ECLKSRC2_Pos (8) /*!< EPWM_T::CLKSRC: ECLKSRC2 Position */ -#define EPWM_CLKSRC_ECLKSRC2_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC2_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC2 Mask */ - -#define EPWM_CLKSRC_ECLKSRC4_Pos (16) /*!< EPWM_T::CLKSRC: ECLKSRC4 Position */ -#define EPWM_CLKSRC_ECLKSRC4_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC4_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC4 Mask */ - -#define EPWM_CNTEN_CNTEN0_Pos (0) /*!< EPWM_T::CNTEN: CNTEN0 Position */ -#define EPWM_CNTEN_CNTEN0_Msk (0x1ul << EPWM_CNTEN_CNTEN0_Pos) /*!< EPWM_T::CNTEN: CNTEN0 Mask */ - -#define EPWM_CNTEN_CNTEN1_Pos (1) /*!< EPWM_T::CNTEN: CNTEN1 Position */ -#define EPWM_CNTEN_CNTEN1_Msk (0x1ul << EPWM_CNTEN_CNTEN1_Pos) /*!< EPWM_T::CNTEN: CNTEN1 Mask */ - -#define EPWM_CNTEN_CNTEN2_Pos (2) /*!< EPWM_T::CNTEN: CNTEN2 Position */ -#define EPWM_CNTEN_CNTEN2_Msk (0x1ul << EPWM_CNTEN_CNTEN2_Pos) /*!< EPWM_T::CNTEN: CNTEN2 Mask */ - -#define EPWM_CNTEN_CNTEN3_Pos (3) /*!< EPWM_T::CNTEN: CNTEN3 Position */ -#define EPWM_CNTEN_CNTEN3_Msk (0x1ul << EPWM_CNTEN_CNTEN3_Pos) /*!< EPWM_T::CNTEN: CNTEN3 Mask */ - -#define EPWM_CNTEN_CNTEN4_Pos (4) /*!< EPWM_T::CNTEN: CNTEN4 Position */ -#define EPWM_CNTEN_CNTEN4_Msk (0x1ul << EPWM_CNTEN_CNTEN4_Pos) /*!< EPWM_T::CNTEN: CNTEN4 Mask */ - -#define EPWM_CNTEN_CNTEN5_Pos (5) /*!< EPWM_T::CNTEN: CNTEN5 Position */ -#define EPWM_CNTEN_CNTEN5_Msk (0x1ul << EPWM_CNTEN_CNTEN5_Pos) /*!< EPWM_T::CNTEN: CNTEN5 Mask */ - -#define EPWM_CNTCLR_CNTCLR0_Pos (0) /*!< EPWM_T::CNTCLR: CNTCLR0 Position */ -#define EPWM_CNTCLR_CNTCLR0_Msk (0x1ul << EPWM_CNTCLR_CNTCLR0_Pos) /*!< EPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define EPWM_CNTCLR_CNTCLR1_Pos (1) /*!< EPWM_T::CNTCLR: CNTCLR1 Position */ -#define EPWM_CNTCLR_CNTCLR1_Msk (0x1ul << EPWM_CNTCLR_CNTCLR1_Pos) /*!< EPWM_T::CNTCLR: CNTCLR1 Mask */ - -#define EPWM_CNTCLR_CNTCLR2_Pos (2) /*!< EPWM_T::CNTCLR: CNTCLR2 Position */ -#define EPWM_CNTCLR_CNTCLR2_Msk (0x1ul << EPWM_CNTCLR_CNTCLR2_Pos) /*!< EPWM_T::CNTCLR: CNTCLR2 Mask */ - -#define EPWM_CNTCLR_CNTCLR3_Pos (3) /*!< EPWM_T::CNTCLR: CNTCLR3 Position */ -#define EPWM_CNTCLR_CNTCLR3_Msk (0x1ul << EPWM_CNTCLR_CNTCLR3_Pos) /*!< EPWM_T::CNTCLR: CNTCLR3 Mask */ - -#define EPWM_CNTCLR_CNTCLR4_Pos (4) /*!< EPWM_T::CNTCLR: CNTCLR4 Position */ -#define EPWM_CNTCLR_CNTCLR4_Msk (0x1ul << EPWM_CNTCLR_CNTCLR4_Pos) /*!< EPWM_T::CNTCLR: CNTCLR4 Mask */ - -#define EPWM_CNTCLR_CNTCLR5_Pos (5) /*!< EPWM_T::CNTCLR: CNTCLR5 Position */ -#define EPWM_CNTCLR_CNTCLR5_Msk (0x1ul << EPWM_CNTCLR_CNTCLR5_Pos) /*!< EPWM_T::CNTCLR: CNTCLR5 Mask */ - -#define EPWM_LOAD_LOAD0_Pos (0) /*!< EPWM_T::LOAD: LOAD0 Position */ -#define EPWM_LOAD_LOAD0_Msk (0x1ul << EPWM_LOAD_LOAD0_Pos) /*!< EPWM_T::LOAD: LOAD0 Mask */ - -#define EPWM_LOAD_LOAD1_Pos (1) /*!< EPWM_T::LOAD: LOAD1 Position */ -#define EPWM_LOAD_LOAD1_Msk (0x1ul << EPWM_LOAD_LOAD1_Pos) /*!< EPWM_T::LOAD: LOAD1 Mask */ - -#define EPWM_LOAD_LOAD2_Pos (2) /*!< EPWM_T::LOAD: LOAD2 Position */ -#define EPWM_LOAD_LOAD2_Msk (0x1ul << EPWM_LOAD_LOAD2_Pos) /*!< EPWM_T::LOAD: LOAD2 Mask */ - -#define EPWM_LOAD_LOAD3_Pos (3) /*!< EPWM_T::LOAD: LOAD3 Position */ -#define EPWM_LOAD_LOAD3_Msk (0x1ul << EPWM_LOAD_LOAD3_Pos) /*!< EPWM_T::LOAD: LOAD3 Mask */ - -#define EPWM_LOAD_LOAD4_Pos (4) /*!< EPWM_T::LOAD: LOAD4 Position */ -#define EPWM_LOAD_LOAD4_Msk (0x1ul << EPWM_LOAD_LOAD4_Pos) /*!< EPWM_T::LOAD: LOAD4 Mask */ - -#define EPWM_LOAD_LOAD5_Pos (5) /*!< EPWM_T::LOAD: LOAD5 Position */ -#define EPWM_LOAD_LOAD5_Msk (0x1ul << EPWM_LOAD_LOAD5_Pos) /*!< EPWM_T::LOAD: LOAD5 Mask */ - -#define EPWM_PERIOD0_PERIOD_Pos (0) /*!< EPWM_T::PERIOD0: PERIOD Position */ -#define EPWM_PERIOD0_PERIOD_Msk (0xfffful << EPWM_PERIOD0_PERIOD_Pos) /*!< EPWM_T::PERIOD0: PERIOD Mask */ - -#define EPWM_PERIOD1_PERIOD_Pos (0) /*!< EPWM_T::PERIOD1: PERIOD Position */ -#define EPWM_PERIOD1_PERIOD_Msk (0xfffful << EPWM_PERIOD1_PERIOD_Pos) /*!< EPWM_T::PERIOD1: PERIOD Mask */ - -#define EPWM_PERIOD2_PERIOD_Pos (0) /*!< EPWM_T::PERIOD2: PERIOD Position */ -#define EPWM_PERIOD2_PERIOD_Msk (0xfffful << EPWM_PERIOD2_PERIOD_Pos) /*!< EPWM_T::PERIOD2: PERIOD Mask */ - -#define EPWM_PERIOD3_PERIOD_Pos (0) /*!< EPWM_T::PERIOD3: PERIOD Position */ -#define EPWM_PERIOD3_PERIOD_Msk (0xfffful << EPWM_PERIOD3_PERIOD_Pos) /*!< EPWM_T::PERIOD3: PERIOD Mask */ - -#define EPWM_PERIOD4_PERIOD_Pos (0) /*!< EPWM_T::PERIOD4: PERIOD Position */ -#define EPWM_PERIOD4_PERIOD_Msk (0xfffful << EPWM_PERIOD4_PERIOD_Pos) /*!< EPWM_T::PERIOD4: PERIOD Mask */ - -#define EPWM_PERIOD5_PERIOD_Pos (0) /*!< EPWM_T::PERIOD5: PERIOD Position */ -#define EPWM_PERIOD5_PERIOD_Msk (0xfffful << EPWM_PERIOD5_PERIOD_Pos) /*!< EPWM_T::PERIOD5: PERIOD Mask */ - -#define EPWM_CMPDAT0_CMP_Pos (0) /*!< EPWM_T::CMPDAT0: CMP Position */ -#define EPWM_CMPDAT0_CMP_Msk (0xfffful << EPWM_CMPDAT0_CMP_Pos) /*!< EPWM_T::CMPDAT0: CMP Mask */ - -#define EPWM_CMPDAT1_CMP_Pos (0) /*!< EPWM_T::CMPDAT1: CMP Position */ -#define EPWM_CMPDAT1_CMP_Msk (0xfffful << EPWM_CMPDAT1_CMP_Pos) /*!< EPWM_T::CMPDAT1: CMP Mask */ - -#define EPWM_CMPDAT2_CMP_Pos (0) /*!< EPWM_T::CMPDAT2: CMP Position */ -#define EPWM_CMPDAT2_CMP_Msk (0xfffful << EPWM_CMPDAT2_CMP_Pos) /*!< EPWM_T::CMPDAT2: CMP Mask */ - -#define EPWM_CMPDAT3_CMP_Pos (0) /*!< EPWM_T::CMPDAT3: CMP Position */ -#define EPWM_CMPDAT3_CMP_Msk (0xfffful << EPWM_CMPDAT3_CMP_Pos) /*!< EPWM_T::CMPDAT3: CMP Mask */ - -#define EPWM_CMPDAT4_CMP_Pos (0) /*!< EPWM_T::CMPDAT4: CMP Position */ -#define EPWM_CMPDAT4_CMP_Msk (0xfffful << EPWM_CMPDAT4_CMP_Pos) /*!< EPWM_T::CMPDAT4: CMP Mask */ - -#define EPWM_CMPDAT5_CMP_Pos (0) /*!< EPWM_T::CMPDAT5: CMP Position */ -#define EPWM_CMPDAT5_CMP_Msk (0xfffful << EPWM_CMPDAT5_CMP_Pos) /*!< EPWM_T::CMPDAT5: CMP Mask */ - -#define EPWM_PHS0_1_PHS_Pos (0) /*!< EPWM_T::PHS0_1: PHS Position */ -#define EPWM_PHS0_1_PHS_Msk (0xfffful << EPWM_PHS0_1_PHS_Pos) /*!< EPWM_T::PHS0_1: PHS Mask */ - -#define EPWM_PHS2_3_PHS_Pos (0) /*!< EPWM_T::PHS2_3: PHS Position */ -#define EPWM_PHS2_3_PHS_Msk (0xfffful << EPWM_PHS2_3_PHS_Pos) /*!< EPWM_T::PHS2_3: PHS Mask */ - -#define EPWM_PHS4_5_PHS_Pos (0) /*!< EPWM_T::PHS4_5: PHS Position */ -#define EPWM_PHS4_5_PHS_Msk (0xfffful << EPWM_PHS4_5_PHS_Pos) /*!< EPWM_T::PHS4_5: PHS Mask */ - -#define EPWM_CNT0_CNT_Pos (0) /*!< EPWM_T::CNT0: CNT Position */ -#define EPWM_CNT0_CNT_Msk (0xfffful << EPWM_CNT0_CNT_Pos) /*!< EPWM_T::CNT0: CNT Mask */ - -#define EPWM_CNT0_DIRF_Pos (16) /*!< EPWM_T::CNT0: DIRF Position */ -#define EPWM_CNT0_DIRF_Msk (0x1ul << EPWM_CNT0_DIRF_Pos) /*!< EPWM_T::CNT0: DIRF Mask */ - -#define EPWM_CNT1_CNT_Pos (0) /*!< EPWM_T::CNT1: CNT Position */ -#define EPWM_CNT1_CNT_Msk (0xfffful << EPWM_CNT1_CNT_Pos) /*!< EPWM_T::CNT1: CNT Mask */ - -#define EPWM_CNT1_DIRF_Pos (16) /*!< EPWM_T::CNT1: DIRF Position */ -#define EPWM_CNT1_DIRF_Msk (0x1ul << EPWM_CNT1_DIRF_Pos) /*!< EPWM_T::CNT1: DIRF Mask */ - -#define EPWM_CNT2_CNT_Pos (0) /*!< EPWM_T::CNT2: CNT Position */ -#define EPWM_CNT2_CNT_Msk (0xfffful << EPWM_CNT2_CNT_Pos) /*!< EPWM_T::CNT2: CNT Mask */ - -#define EPWM_CNT2_DIRF_Pos (16) /*!< EPWM_T::CNT2: DIRF Position */ -#define EPWM_CNT2_DIRF_Msk (0x1ul << EPWM_CNT2_DIRF_Pos) /*!< EPWM_T::CNT2: DIRF Mask */ - -#define EPWM_CNT3_CNT_Pos (0) /*!< EPWM_T::CNT3: CNT Position */ -#define EPWM_CNT3_CNT_Msk (0xfffful << EPWM_CNT3_CNT_Pos) /*!< EPWM_T::CNT3: CNT Mask */ - -#define EPWM_CNT3_DIRF_Pos (16) /*!< EPWM_T::CNT3: DIRF Position */ -#define EPWM_CNT3_DIRF_Msk (0x1ul << EPWM_CNT3_DIRF_Pos) /*!< EPWM_T::CNT3: DIRF Mask */ - -#define EPWM_CNT4_CNT_Pos (0) /*!< EPWM_T::CNT4: CNT Position */ -#define EPWM_CNT4_CNT_Msk (0xfffful << EPWM_CNT4_CNT_Pos) /*!< EPWM_T::CNT4: CNT Mask */ - -#define EPWM_CNT4_DIRF_Pos (16) /*!< EPWM_T::CNT4: DIRF Position */ -#define EPWM_CNT4_DIRF_Msk (0x1ul << EPWM_CNT4_DIRF_Pos) /*!< EPWM_T::CNT4: DIRF Mask */ - -#define EPWM_CNT5_CNT_Pos (0) /*!< EPWM_T::CNT5: CNT Position */ -#define EPWM_CNT5_CNT_Msk (0xfffful << EPWM_CNT5_CNT_Pos) /*!< EPWM_T::CNT5: CNT Mask */ - -#define EPWM_CNT5_DIRF_Pos (16) /*!< EPWM_T::CNT5: DIRF Position */ -#define EPWM_CNT5_DIRF_Msk (0x1ul << EPWM_CNT5_DIRF_Pos) /*!< EPWM_T::CNT5: DIRF Mask */ - -#define EPWM_WGCTL0_ZPCTL0_Pos (0) /*!< EPWM_T::WGCTL0: ZPCTL0 Position */ -#define EPWM_WGCTL0_ZPCTL0_Msk (0x3ul << EPWM_WGCTL0_ZPCTL0_Pos) /*!< EPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define EPWM_WGCTL0_ZPCTL1_Pos (2) /*!< EPWM_T::WGCTL0: ZPCTL1 Position */ -#define EPWM_WGCTL0_ZPCTL1_Msk (0x3ul << EPWM_WGCTL0_ZPCTL1_Pos) /*!< EPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define EPWM_WGCTL0_ZPCTL2_Pos (4) /*!< EPWM_T::WGCTL0: ZPCTL2 Position */ -#define EPWM_WGCTL0_ZPCTL2_Msk (0x3ul << EPWM_WGCTL0_ZPCTL2_Pos) /*!< EPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define EPWM_WGCTL0_ZPCTL3_Pos (6) /*!< EPWM_T::WGCTL0: ZPCTL3 Position */ -#define EPWM_WGCTL0_ZPCTL3_Msk (0x3ul << EPWM_WGCTL0_ZPCTL3_Pos) /*!< EPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define EPWM_WGCTL0_ZPCTL4_Pos (8) /*!< EPWM_T::WGCTL0: ZPCTL4 Position */ -#define EPWM_WGCTL0_ZPCTL4_Msk (0x3ul << EPWM_WGCTL0_ZPCTL4_Pos) /*!< EPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define EPWM_WGCTL0_ZPCTL5_Pos (10) /*!< EPWM_T::WGCTL0: ZPCTL5 Position */ -#define EPWM_WGCTL0_ZPCTL5_Msk (0x3ul << EPWM_WGCTL0_ZPCTL5_Pos) /*!< EPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define EPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< EPWM_T::WGCTL0: PRDPCTL0 Position */ -#define EPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL0_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define EPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< EPWM_T::WGCTL0: PRDPCTL1 Position */ -#define EPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL1_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define EPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< EPWM_T::WGCTL0: PRDPCTL2 Position */ -#define EPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL2_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define EPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< EPWM_T::WGCTL0: PRDPCTL3 Position */ -#define EPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL3_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define EPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< EPWM_T::WGCTL0: PRDPCTL4 Position */ -#define EPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL4_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define EPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< EPWM_T::WGCTL0: PRDPCTL5 Position */ -#define EPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL5_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define EPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< EPWM_T::WGCTL1: CMPUCTL0 Position */ -#define EPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define EPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< EPWM_T::WGCTL1: CMPUCTL1 Position */ -#define EPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define EPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< EPWM_T::WGCTL1: CMPUCTL2 Position */ -#define EPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define EPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< EPWM_T::WGCTL1: CMPUCTL3 Position */ -#define EPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define EPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< EPWM_T::WGCTL1: CMPUCTL4 Position */ -#define EPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define EPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< EPWM_T::WGCTL1: CMPUCTL5 Position */ -#define EPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define EPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< EPWM_T::WGCTL1: CMPDCTL0 Position */ -#define EPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define EPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< EPWM_T::WGCTL1: CMPDCTL1 Position */ -#define EPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define EPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< EPWM_T::WGCTL1: CMPDCTL2 Position */ -#define EPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define EPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< EPWM_T::WGCTL1: CMPDCTL3 Position */ -#define EPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define EPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< EPWM_T::WGCTL1: CMPDCTL4 Position */ -#define EPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define EPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< EPWM_T::WGCTL1: CMPDCTL5 Position */ -#define EPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define EPWM_MSKEN_MSKEN0_Pos (0) /*!< EPWM_T::MSKEN: MSKEN0 Position */ -#define EPWM_MSKEN_MSKEN0_Msk (0x1ul << EPWM_MSKEN_MSKEN0_Pos) /*!< EPWM_T::MSKEN: MSKEN0 Mask */ - -#define EPWM_MSKEN_MSKEN1_Pos (1) /*!< EPWM_T::MSKEN: MSKEN1 Position */ -#define EPWM_MSKEN_MSKEN1_Msk (0x1ul << EPWM_MSKEN_MSKEN1_Pos) /*!< EPWM_T::MSKEN: MSKEN1 Mask */ - -#define EPWM_MSKEN_MSKEN2_Pos (2) /*!< EPWM_T::MSKEN: MSKEN2 Position */ -#define EPWM_MSKEN_MSKEN2_Msk (0x1ul << EPWM_MSKEN_MSKEN2_Pos) /*!< EPWM_T::MSKEN: MSKEN2 Mask */ - -#define EPWM_MSKEN_MSKEN3_Pos (3) /*!< EPWM_T::MSKEN: MSKEN3 Position */ -#define EPWM_MSKEN_MSKEN3_Msk (0x1ul << EPWM_MSKEN_MSKEN3_Pos) /*!< EPWM_T::MSKEN: MSKEN3 Mask */ - -#define EPWM_MSKEN_MSKEN4_Pos (4) /*!< EPWM_T::MSKEN: MSKEN4 Position */ -#define EPWM_MSKEN_MSKEN4_Msk (0x1ul << EPWM_MSKEN_MSKEN4_Pos) /*!< EPWM_T::MSKEN: MSKEN4 Mask */ - -#define EPWM_MSKEN_MSKEN5_Pos (5) /*!< EPWM_T::MSKEN: MSKEN5 Position */ -#define EPWM_MSKEN_MSKEN5_Msk (0x1ul << EPWM_MSKEN_MSKEN5_Pos) /*!< EPWM_T::MSKEN: MSKEN5 Mask */ - -#define EPWM_MSK_MSKDAT0_Pos (0) /*!< EPWM_T::MSK: MSKDAT0 Position */ -#define EPWM_MSK_MSKDAT0_Msk (0x1ul << EPWM_MSK_MSKDAT0_Pos) /*!< EPWM_T::MSK: MSKDAT0 Mask */ - -#define EPWM_MSK_MSKDAT1_Pos (1) /*!< EPWM_T::MSK: MSKDAT1 Position */ -#define EPWM_MSK_MSKDAT1_Msk (0x1ul << EPWM_MSK_MSKDAT1_Pos) /*!< EPWM_T::MSK: MSKDAT1 Mask */ - -#define EPWM_MSK_MSKDAT2_Pos (2) /*!< EPWM_T::MSK: MSKDAT2 Position */ -#define EPWM_MSK_MSKDAT2_Msk (0x1ul << EPWM_MSK_MSKDAT2_Pos) /*!< EPWM_T::MSK: MSKDAT2 Mask */ - -#define EPWM_MSK_MSKDAT3_Pos (3) /*!< EPWM_T::MSK: MSKDAT3 Position */ -#define EPWM_MSK_MSKDAT3_Msk (0x1ul << EPWM_MSK_MSKDAT3_Pos) /*!< EPWM_T::MSK: MSKDAT3 Mask */ - -#define EPWM_MSK_MSKDAT4_Pos (4) /*!< EPWM_T::MSK: MSKDAT4 Position */ -#define EPWM_MSK_MSKDAT4_Msk (0x1ul << EPWM_MSK_MSKDAT4_Pos) /*!< EPWM_T::MSK: MSKDAT4 Mask */ - -#define EPWM_MSK_MSKDAT5_Pos (5) /*!< EPWM_T::MSK: MSKDAT5 Position */ -#define EPWM_MSK_MSKDAT5_Msk (0x1ul << EPWM_MSK_MSKDAT5_Pos) /*!< EPWM_T::MSK: MSKDAT5 Mask */ - -#define EPWM_BNF_BRK0NFEN_Pos (0) /*!< EPWM_T::BNF: BRK0NFEN Position */ -#define EPWM_BNF_BRK0NFEN_Msk (0x1ul << EPWM_BNF_BRK0NFEN_Pos) /*!< EPWM_T::BNF: BRK0NFEN Mask */ - -#define EPWM_BNF_BRK0NFSEL_Pos (1) /*!< EPWM_T::BNF: BRK0NFSEL Position */ -#define EPWM_BNF_BRK0NFSEL_Msk (0x7ul << EPWM_BNF_BRK0NFSEL_Pos) /*!< EPWM_T::BNF: BRK0NFSEL Mask */ - -#define EPWM_BNF_BRK0FCNT_Pos (4) /*!< EPWM_T::BNF: BRK0FCNT Position */ -#define EPWM_BNF_BRK0FCNT_Msk (0x7ul << EPWM_BNF_BRK0FCNT_Pos) /*!< EPWM_T::BNF: BRK0FCNT Mask */ - -#define EPWM_BNF_BRK0PINV_Pos (7) /*!< EPWM_T::BNF: BRK0PINV Position */ -#define EPWM_BNF_BRK0PINV_Msk (0x1ul << EPWM_BNF_BRK0PINV_Pos) /*!< EPWM_T::BNF: BRK0PINV Mask */ - -#define EPWM_BNF_BRK1NFEN_Pos (8) /*!< EPWM_T::BNF: BRK1NFEN Position */ -#define EPWM_BNF_BRK1NFEN_Msk (0x1ul << EPWM_BNF_BRK1NFEN_Pos) /*!< EPWM_T::BNF: BRK1NFEN Mask */ - -#define EPWM_BNF_BRK1NFSEL_Pos (9) /*!< EPWM_T::BNF: BRK1NFSEL Position */ -#define EPWM_BNF_BRK1NFSEL_Msk (0x7ul << EPWM_BNF_BRK1NFSEL_Pos) /*!< EPWM_T::BNF: BRK1NFSEL Mask */ - -#define EPWM_BNF_BRK1FCNT_Pos (12) /*!< EPWM_T::BNF: BRK1FCNT Position */ -#define EPWM_BNF_BRK1FCNT_Msk (0x7ul << EPWM_BNF_BRK1FCNT_Pos) /*!< EPWM_T::BNF: BRK1FCNT Mask */ - -#define EPWM_BNF_BRK1PINV_Pos (15) /*!< EPWM_T::BNF: BRK1PINV Position */ -#define EPWM_BNF_BRK1PINV_Msk (0x1ul << EPWM_BNF_BRK1PINV_Pos) /*!< EPWM_T::BNF: BRK1PINV Mask */ - -#define EPWM_BNF_BK0SRC_Pos (16) /*!< EPWM_T::BNF: BK0SRC Position */ -#define EPWM_BNF_BK0SRC_Msk (0x1ul << EPWM_BNF_BK0SRC_Pos) /*!< EPWM_T::BNF: BK0SRC Mask */ - -#define EPWM_BNF_BK1SRC_Pos (24) /*!< EPWM_T::BNF: BK1SRC Position */ -#define EPWM_BNF_BK1SRC_Msk (0x1ul << EPWM_BNF_BK1SRC_Pos) /*!< EPWM_T::BNF: BK1SRC Mask */ - -#define EPWM_FAILBRK_CSSBRKEN_Pos (0) /*!< EPWM_T::FAILBRK: CSSBRKEN Position */ -#define EPWM_FAILBRK_CSSBRKEN_Msk (0x1ul << EPWM_FAILBRK_CSSBRKEN_Pos) /*!< EPWM_T::FAILBRK: CSSBRKEN Mask */ - -#define EPWM_FAILBRK_BODBRKEN_Pos (1) /*!< EPWM_T::FAILBRK: BODBRKEN Position */ -#define EPWM_FAILBRK_BODBRKEN_Msk (0x1ul << EPWM_FAILBRK_BODBRKEN_Pos) /*!< EPWM_T::FAILBRK: BODBRKEN Mask */ - -#define EPWM_FAILBRK_RAMBRKEN_Pos (2) /*!< EPWM_T::FAILBRK: RAMBRKEN Position */ -#define EPWM_FAILBRK_RAMBRKEN_Msk (0x1ul << EPWM_FAILBRK_RAMBRKEN_Pos) /*!< EPWM_T::FAILBRK: RAMBRKEN Mask */ - -#define EPWM_FAILBRK_CORBRKEN_Pos (3) /*!< EPWM_T::FAILBRK: CORBRKEN Position */ -#define EPWM_FAILBRK_CORBRKEN_Msk (0x1ul << EPWM_FAILBRK_CORBRKEN_Pos) /*!< EPWM_T::FAILBRK: CORBRKEN Mask */ - -#define EPWM_BRKCTL0_1_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL0_1: CPO0EBEN Position */ -#define EPWM_BRKCTL0_1_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO0EBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL0_1: CPO1EBEN Position */ -#define EPWM_BRKCTL0_1_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO1EBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO2EBEN_Pos (2) /*!< EPWM_T::BRKCTL0_1: CPO2EBEN Position */ -#define EPWM_BRKCTL0_1_CPO2EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO2EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO2EBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO3EBEN_Pos (3) /*!< EPWM_T::BRKCTL0_1: CPO3EBEN Position */ -#define EPWM_BRKCTL0_1_CPO3EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO3EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO3EBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Position */ -#define EPWM_BRKCTL0_1_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Position */ -#define EPWM_BRKCTL0_1_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Mask */ - -#define EPWM_BRKCTL0_1_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Position */ -#define EPWM_BRKCTL0_1_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL0_1: CPO0LBEN Position */ -#define EPWM_BRKCTL0_1_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO0LBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL0_1: CPO1LBEN Position */ -#define EPWM_BRKCTL0_1_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO1LBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO2LBEN_Pos (10) /*!< EPWM_T::BRKCTL0_1: CPO2LBEN Position */ -#define EPWM_BRKCTL0_1_CPO2LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO2LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO2LBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO3LBEN_Pos (11) /*!< EPWM_T::BRKCTL0_1: CPO3LBEN Position */ -#define EPWM_BRKCTL0_1_CPO3LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO3LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO3LBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Position */ -#define EPWM_BRKCTL0_1_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Position */ -#define EPWM_BRKCTL0_1_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Mask */ - -#define EPWM_BRKCTL0_1_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Position */ -#define EPWM_BRKCTL0_1_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Position */ -#define EPWM_BRKCTL0_1_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL0_1: BRKAODD Position */ -#define EPWM_BRKCTL0_1_BRKAODD_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAODD_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAODD Mask */ - -#define EPWM_BRKCTL0_1_EADC0EBEN_Pos (20) /*!< EPWM_T::BRKCTL0_1: EADC0EBEN Position */ -#define EPWM_BRKCTL0_1_EADC0EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADC0EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADC0EBEN Mask */ - -#define EPWM_BRKCTL0_1_EADC1EBEN_Pos (21) /*!< EPWM_T::BRKCTL0_1: EADC1EBEN Position */ -#define EPWM_BRKCTL0_1_EADC1EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADC1EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADC1EBEN Mask */ - -#define EPWM_BRKCTL0_1_EADC2EBEN_Pos (22) /*!< EPWM_T::BRKCTL0_1: EADC2EBEN Position */ -#define EPWM_BRKCTL0_1_EADC2EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADC2EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADC2EBEN Mask */ - -#define EPWM_BRKCTL0_1_EADC0LBEN_Pos (28) /*!< EPWM_T::BRKCTL0_1: EADC0LBEN Position */ -#define EPWM_BRKCTL0_1_EADC0LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADC0LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADC0LBEN Mask */ - -#define EPWM_BRKCTL0_1_EADC1LBEN_Pos (29) /*!< EPWM_T::BRKCTL0_1: EADC1LBEN Position */ -#define EPWM_BRKCTL0_1_EADC1LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADC1LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADC1LBEN Mask */ - -#define EPWM_BRKCTL0_1_EADC2LBEN_Pos (30) /*!< EPWM_T::BRKCTL0_1: EADC2LBEN Position */ -#define EPWM_BRKCTL0_1_EADC2LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADC2LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADC2LBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL2_3: CPO0EBEN Position */ -#define EPWM_BRKCTL2_3_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO0EBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL2_3: CPO1EBEN Position */ -#define EPWM_BRKCTL2_3_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO1EBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO2EBEN_Pos (2) /*!< EPWM_T::BRKCTL2_3: CPO2EBEN Position */ -#define EPWM_BRKCTL2_3_CPO2EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO2EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO2EBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO3EBEN_Pos (3) /*!< EPWM_T::BRKCTL2_3: CPO3EBEN Position */ -#define EPWM_BRKCTL2_3_CPO3EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO3EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO3EBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Position */ -#define EPWM_BRKCTL2_3_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Position */ -#define EPWM_BRKCTL2_3_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Mask */ - -#define EPWM_BRKCTL2_3_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Position */ -#define EPWM_BRKCTL2_3_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL2_3: CPO0LBEN Position */ -#define EPWM_BRKCTL2_3_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO0LBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL2_3: CPO1LBEN Position */ -#define EPWM_BRKCTL2_3_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO1LBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO2LBEN_Pos (10) /*!< EPWM_T::BRKCTL2_3: CPO2LBEN Position */ -#define EPWM_BRKCTL2_3_CPO2LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO2LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO2LBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO3LBEN_Pos (11) /*!< EPWM_T::BRKCTL2_3: CPO3LBEN Position */ -#define EPWM_BRKCTL2_3_CPO3LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO3LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO3LBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Position */ -#define EPWM_BRKCTL2_3_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Position */ -#define EPWM_BRKCTL2_3_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Mask */ - -#define EPWM_BRKCTL2_3_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Position */ -#define EPWM_BRKCTL2_3_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Position */ -#define EPWM_BRKCTL2_3_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL2_3: BRKAODD Position */ -#define EPWM_BRKCTL2_3_BRKAODD_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAODD_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAODD Mask */ - -#define EPWM_BRKCTL2_3_EADC0EBEN_Pos (20) /*!< EPWM_T::BRKCTL2_3: EADC0EBEN Position */ -#define EPWM_BRKCTL2_3_EADC0EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADC0EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADC0EBEN Mask */ - -#define EPWM_BRKCTL2_3_EADC1EBEN_Pos (21) /*!< EPWM_T::BRKCTL2_3: EADC1EBEN Position */ -#define EPWM_BRKCTL2_3_EADC1EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADC1EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADC1EBEN Mask */ - -#define EPWM_BRKCTL2_3_EADC2EBEN_Pos (22) /*!< EPWM_T::BRKCTL2_3: EADC2EBEN Position */ -#define EPWM_BRKCTL2_3_EADC2EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADC2EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADC2EBEN Mask */ - -#define EPWM_BRKCTL2_3_EADC0LBEN_Pos (28) /*!< EPWM_T::BRKCTL2_3: EADC0LBEN Position */ -#define EPWM_BRKCTL2_3_EADC0LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADC0LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADC0LBEN Mask */ - -#define EPWM_BRKCTL2_3_EADC1LBEN_Pos (29) /*!< EPWM_T::BRKCTL2_3: EADC1LBEN Position */ -#define EPWM_BRKCTL2_3_EADC1LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADC1LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADC1LBEN Mask */ - -#define EPWM_BRKCTL2_3_EADC2LBEN_Pos (30) /*!< EPWM_T::BRKCTL2_3: EADC2LBEN Position */ -#define EPWM_BRKCTL2_3_EADC2LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADC2LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADC2LBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL4_5: CPO0EBEN Position */ -#define EPWM_BRKCTL4_5_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO0EBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL4_5: CPO1EBEN Position */ -#define EPWM_BRKCTL4_5_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO1EBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO2EBEN_Pos (2) /*!< EPWM_T::BRKCTL4_5: CPO2EBEN Position */ -#define EPWM_BRKCTL4_5_CPO2EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO2EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO2EBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO3EBEN_Pos (3) /*!< EPWM_T::BRKCTL4_5: CPO3EBEN Position */ -#define EPWM_BRKCTL4_5_CPO3EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO3EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO3EBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Position */ -#define EPWM_BRKCTL4_5_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Position */ -#define EPWM_BRKCTL4_5_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Mask */ - -#define EPWM_BRKCTL4_5_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Position */ -#define EPWM_BRKCTL4_5_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL4_5: CPO0LBEN Position */ -#define EPWM_BRKCTL4_5_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO0LBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL4_5: CPO1LBEN Position */ -#define EPWM_BRKCTL4_5_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO1LBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO2LBEN_Pos (10) /*!< EPWM_T::BRKCTL4_5: CPO2LBEN Position */ -#define EPWM_BRKCTL4_5_CPO2LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO2LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO2LBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO3LBEN_Pos (11) /*!< EPWM_T::BRKCTL4_5: CPO3LBEN Position */ -#define EPWM_BRKCTL4_5_CPO3LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO3LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO3LBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Position */ -#define EPWM_BRKCTL4_5_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Position */ -#define EPWM_BRKCTL4_5_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Mask */ - -#define EPWM_BRKCTL4_5_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Position */ -#define EPWM_BRKCTL4_5_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Position */ -#define EPWM_BRKCTL4_5_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL4_5: BRKAODD Position */ -#define EPWM_BRKCTL4_5_BRKAODD_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAODD_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAODD Mask */ - -#define EPWM_BRKCTL4_5_EADC0EBEN_Pos (20) /*!< EPWM_T::BRKCTL4_5: EADC0EBEN Position */ -#define EPWM_BRKCTL4_5_EADC0EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADC0EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADC0EBEN Mask */ - -#define EPWM_BRKCTL4_5_EADC1EBEN_Pos (21) /*!< EPWM_T::BRKCTL4_5: EADC1EBEN Position */ -#define EPWM_BRKCTL4_5_EADC1EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADC1EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADC1EBEN Mask */ - -#define EPWM_BRKCTL4_5_EADC2EBEN_Pos (22) /*!< EPWM_T::BRKCTL4_5: EADC2EBEN Position */ -#define EPWM_BRKCTL4_5_EADC2EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADC2EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADC2EBEN Mask */ - -#define EPWM_BRKCTL4_5_EADC0LBEN_Pos (28) /*!< EPWM_T::BRKCTL4_5: EADC0LBEN Position */ -#define EPWM_BRKCTL4_5_EADC0LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADC0LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADC0LBEN Mask */ - -#define EPWM_BRKCTL4_5_EADC1LBEN_Pos (29) /*!< EPWM_T::BRKCTL4_5: EADC1LBEN Position */ -#define EPWM_BRKCTL4_5_EADC1LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADC1LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADC1LBEN Mask */ - -#define EPWM_BRKCTL4_5_EADC2LBEN_Pos (30) /*!< EPWM_T::BRKCTL4_5: EADC2LBEN Position */ -#define EPWM_BRKCTL4_5_EADC2LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADC2LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADC2LBEN Mask */ - -#define EPWM_POLCTL_PINV0_Pos (0) /*!< EPWM_T::POLCTL: PINV0 Position */ -#define EPWM_POLCTL_PINV0_Msk (0x1ul << EPWM_POLCTL_PINV0_Pos) /*!< EPWM_T::POLCTL: PINV0 Mask */ - -#define EPWM_POLCTL_PINV1_Pos (1) /*!< EPWM_T::POLCTL: PINV1 Position */ -#define EPWM_POLCTL_PINV1_Msk (0x1ul << EPWM_POLCTL_PINV1_Pos) /*!< EPWM_T::POLCTL: PINV1 Mask */ - -#define EPWM_POLCTL_PINV2_Pos (2) /*!< EPWM_T::POLCTL: PINV2 Position */ -#define EPWM_POLCTL_PINV2_Msk (0x1ul << EPWM_POLCTL_PINV2_Pos) /*!< EPWM_T::POLCTL: PINV2 Mask */ - -#define EPWM_POLCTL_PINV3_Pos (3) /*!< EPWM_T::POLCTL: PINV3 Position */ -#define EPWM_POLCTL_PINV3_Msk (0x1ul << EPWM_POLCTL_PINV3_Pos) /*!< EPWM_T::POLCTL: PINV3 Mask */ - -#define EPWM_POLCTL_PINV4_Pos (4) /*!< EPWM_T::POLCTL: PINV4 Position */ -#define EPWM_POLCTL_PINV4_Msk (0x1ul << EPWM_POLCTL_PINV4_Pos) /*!< EPWM_T::POLCTL: PINV4 Mask */ - -#define EPWM_POLCTL_PINV5_Pos (5) /*!< EPWM_T::POLCTL: PINV5 Position */ -#define EPWM_POLCTL_PINV5_Msk (0x1ul << EPWM_POLCTL_PINV5_Pos) /*!< EPWM_T::POLCTL: PINV5 Mask */ - -#define EPWM_POEN_POEN0_Pos (0) /*!< EPWM_T::POEN: POEN0 Position */ -#define EPWM_POEN_POEN0_Msk (0x1ul << EPWM_POEN_POEN0_Pos) /*!< EPWM_T::POEN: POEN0 Mask */ - -#define EPWM_POEN_POEN1_Pos (1) /*!< EPWM_T::POEN: POEN1 Position */ -#define EPWM_POEN_POEN1_Msk (0x1ul << EPWM_POEN_POEN1_Pos) /*!< EPWM_T::POEN: POEN1 Mask */ - -#define EPWM_POEN_POEN2_Pos (2) /*!< EPWM_T::POEN: POEN2 Position */ -#define EPWM_POEN_POEN2_Msk (0x1ul << EPWM_POEN_POEN2_Pos) /*!< EPWM_T::POEN: POEN2 Mask */ - -#define EPWM_POEN_POEN3_Pos (3) /*!< EPWM_T::POEN: POEN3 Position */ -#define EPWM_POEN_POEN3_Msk (0x1ul << EPWM_POEN_POEN3_Pos) /*!< EPWM_T::POEN: POEN3 Mask */ - -#define EPWM_POEN_POEN4_Pos (4) /*!< EPWM_T::POEN: POEN4 Position */ -#define EPWM_POEN_POEN4_Msk (0x1ul << EPWM_POEN_POEN4_Pos) /*!< EPWM_T::POEN: POEN4 Mask */ - -#define EPWM_POEN_POEN5_Pos (5) /*!< EPWM_T::POEN: POEN5 Position */ -#define EPWM_POEN_POEN5_Msk (0x1ul << EPWM_POEN_POEN5_Pos) /*!< EPWM_T::POEN: POEN5 Mask */ - -#define EPWM_SWBRK_BRKETRG0_Pos (0) /*!< EPWM_T::SWBRK: BRKETRG0 Position */ -#define EPWM_SWBRK_BRKETRG0_Msk (0x1ul << EPWM_SWBRK_BRKETRG0_Pos) /*!< EPWM_T::SWBRK: BRKETRG0 Mask */ - -#define EPWM_SWBRK_BRKETRG2_Pos (1) /*!< EPWM_T::SWBRK: BRKETRG2 Position */ -#define EPWM_SWBRK_BRKETRG2_Msk (0x1ul << EPWM_SWBRK_BRKETRG2_Pos) /*!< EPWM_T::SWBRK: BRKETRG2 Mask */ - -#define EPWM_SWBRK_BRKETRG4_Pos (2) /*!< EPWM_T::SWBRK: BRKETRG4 Position */ -#define EPWM_SWBRK_BRKETRG4_Msk (0x1ul << EPWM_SWBRK_BRKETRG4_Pos) /*!< EPWM_T::SWBRK: BRKETRG4 Mask */ - -#define EPWM_SWBRK_BRKLTRG0_Pos (8) /*!< EPWM_T::SWBRK: BRKLTRG0 Position */ -#define EPWM_SWBRK_BRKLTRG0_Msk (0x1ul << EPWM_SWBRK_BRKLTRG0_Pos) /*!< EPWM_T::SWBRK: BRKLTRG0 Mask */ - -#define EPWM_SWBRK_BRKLTRG2_Pos (9) /*!< EPWM_T::SWBRK: BRKLTRG2 Position */ -#define EPWM_SWBRK_BRKLTRG2_Msk (0x1ul << EPWM_SWBRK_BRKLTRG2_Pos) /*!< EPWM_T::SWBRK: BRKLTRG2 Mask */ - -#define EPWM_SWBRK_BRKLTRG4_Pos (10) /*!< EPWM_T::SWBRK: BRKLTRG4 Position */ -#define EPWM_SWBRK_BRKLTRG4_Msk (0x1ul << EPWM_SWBRK_BRKLTRG4_Pos) /*!< EPWM_T::SWBRK: BRKLTRG4 Mask */ - -#define EPWM_INTEN0_ZIEN0_Pos (0) /*!< EPWM_T::INTEN0: ZIEN0 Position */ -#define EPWM_INTEN0_ZIEN0_Msk (0x1ul << EPWM_INTEN0_ZIEN0_Pos) /*!< EPWM_T::INTEN0: ZIEN0 Mask */ - -#define EPWM_INTEN0_ZIEN1_Pos (1) /*!< EPWM_T::INTEN0: ZIEN1 Position */ -#define EPWM_INTEN0_ZIEN1_Msk (0x1ul << EPWM_INTEN0_ZIEN1_Pos) /*!< EPWM_T::INTEN0: ZIEN1 Mask */ - -#define EPWM_INTEN0_ZIEN2_Pos (2) /*!< EPWM_T::INTEN0: ZIEN2 Position */ -#define EPWM_INTEN0_ZIEN2_Msk (0x1ul << EPWM_INTEN0_ZIEN2_Pos) /*!< EPWM_T::INTEN0: ZIEN2 Mask */ - -#define EPWM_INTEN0_ZIEN3_Pos (3) /*!< EPWM_T::INTEN0: ZIEN3 Position */ -#define EPWM_INTEN0_ZIEN3_Msk (0x1ul << EPWM_INTEN0_ZIEN3_Pos) /*!< EPWM_T::INTEN0: ZIEN3 Mask */ - -#define EPWM_INTEN0_ZIEN4_Pos (4) /*!< EPWM_T::INTEN0: ZIEN4 Position */ -#define EPWM_INTEN0_ZIEN4_Msk (0x1ul << EPWM_INTEN0_ZIEN4_Pos) /*!< EPWM_T::INTEN0: ZIEN4 Mask */ - -#define EPWM_INTEN0_ZIEN5_Pos (5) /*!< EPWM_T::INTEN0: ZIEN5 Position */ -#define EPWM_INTEN0_ZIEN5_Msk (0x1ul << EPWM_INTEN0_ZIEN5_Pos) /*!< EPWM_T::INTEN0: ZIEN5 Mask */ - -#define EPWM_INTEN0_PIEN0_Pos (8) /*!< EPWM_T::INTEN0: PIEN0 Position */ -#define EPWM_INTEN0_PIEN0_Msk (0x1ul << EPWM_INTEN0_PIEN0_Pos) /*!< EPWM_T::INTEN0: PIEN0 Mask */ - -#define EPWM_INTEN0_PIEN1_Pos (9) /*!< EPWM_T::INTEN0: PIEN1 Position */ -#define EPWM_INTEN0_PIEN1_Msk (0x1ul << EPWM_INTEN0_PIEN1_Pos) /*!< EPWM_T::INTEN0: PIEN1 Mask */ - -#define EPWM_INTEN0_PIEN2_Pos (10) /*!< EPWM_T::INTEN0: PIEN2 Position */ -#define EPWM_INTEN0_PIEN2_Msk (0x1ul << EPWM_INTEN0_PIEN2_Pos) /*!< EPWM_T::INTEN0: PIEN2 Mask */ - -#define EPWM_INTEN0_PIEN3_Pos (11) /*!< EPWM_T::INTEN0: PIEN3 Position */ -#define EPWM_INTEN0_PIEN3_Msk (0x1ul << EPWM_INTEN0_PIEN3_Pos) /*!< EPWM_T::INTEN0: PIEN3 Mask */ - -#define EPWM_INTEN0_PIEN4_Pos (12) /*!< EPWM_T::INTEN0: PIEN4 Position */ -#define EPWM_INTEN0_PIEN4_Msk (0x1ul << EPWM_INTEN0_PIEN4_Pos) /*!< EPWM_T::INTEN0: PIEN4 Mask */ - -#define EPWM_INTEN0_PIEN5_Pos (13) /*!< EPWM_T::INTEN0: PIEN5 Position */ -#define EPWM_INTEN0_PIEN5_Msk (0x1ul << EPWM_INTEN0_PIEN5_Pos) /*!< EPWM_T::INTEN0: PIEN5 Mask */ - -#define EPWM_INTEN0_CMPUIEN0_Pos (16) /*!< EPWM_T::INTEN0: CMPUIEN0 Position */ -#define EPWM_INTEN0_CMPUIEN0_Msk (0x1ul << EPWM_INTEN0_CMPUIEN0_Pos) /*!< EPWM_T::INTEN0: CMPUIEN0 Mask */ - -#define EPWM_INTEN0_CMPUIEN1_Pos (17) /*!< EPWM_T::INTEN0: CMPUIEN1 Position */ -#define EPWM_INTEN0_CMPUIEN1_Msk (0x1ul << EPWM_INTEN0_CMPUIEN1_Pos) /*!< EPWM_T::INTEN0: CMPUIEN1 Mask */ - -#define EPWM_INTEN0_CMPUIEN2_Pos (18) /*!< EPWM_T::INTEN0: CMPUIEN2 Position */ -#define EPWM_INTEN0_CMPUIEN2_Msk (0x1ul << EPWM_INTEN0_CMPUIEN2_Pos) /*!< EPWM_T::INTEN0: CMPUIEN2 Mask */ - -#define EPWM_INTEN0_CMPUIEN3_Pos (19) /*!< EPWM_T::INTEN0: CMPUIEN3 Position */ -#define EPWM_INTEN0_CMPUIEN3_Msk (0x1ul << EPWM_INTEN0_CMPUIEN3_Pos) /*!< EPWM_T::INTEN0: CMPUIEN3 Mask */ - -#define EPWM_INTEN0_CMPUIEN4_Pos (20) /*!< EPWM_T::INTEN0: CMPUIEN4 Position */ -#define EPWM_INTEN0_CMPUIEN4_Msk (0x1ul << EPWM_INTEN0_CMPUIEN4_Pos) /*!< EPWM_T::INTEN0: CMPUIEN4 Mask */ - -#define EPWM_INTEN0_CMPUIEN5_Pos (21) /*!< EPWM_T::INTEN0: CMPUIEN5 Position */ -#define EPWM_INTEN0_CMPUIEN5_Msk (0x1ul << EPWM_INTEN0_CMPUIEN5_Pos) /*!< EPWM_T::INTEN0: CMPUIEN5 Mask */ - -#define EPWM_INTEN0_CMPDIEN0_Pos (24) /*!< EPWM_T::INTEN0: CMPDIEN0 Position */ -#define EPWM_INTEN0_CMPDIEN0_Msk (0x1ul << EPWM_INTEN0_CMPDIEN0_Pos) /*!< EPWM_T::INTEN0: CMPDIEN0 Mask */ - -#define EPWM_INTEN0_CMPDIEN1_Pos (25) /*!< EPWM_T::INTEN0: CMPDIEN1 Position */ -#define EPWM_INTEN0_CMPDIEN1_Msk (0x1ul << EPWM_INTEN0_CMPDIEN1_Pos) /*!< EPWM_T::INTEN0: CMPDIEN1 Mask */ - -#define EPWM_INTEN0_CMPDIEN2_Pos (26) /*!< EPWM_T::INTEN0: CMPDIEN2 Position */ -#define EPWM_INTEN0_CMPDIEN2_Msk (0x1ul << EPWM_INTEN0_CMPDIEN2_Pos) /*!< EPWM_T::INTEN0: CMPDIEN2 Mask */ - -#define EPWM_INTEN0_CMPDIEN3_Pos (27) /*!< EPWM_T::INTEN0: CMPDIEN3 Position */ -#define EPWM_INTEN0_CMPDIEN3_Msk (0x1ul << EPWM_INTEN0_CMPDIEN3_Pos) /*!< EPWM_T::INTEN0: CMPDIEN3 Mask */ - -#define EPWM_INTEN0_CMPDIEN4_Pos (28) /*!< EPWM_T::INTEN0: CMPDIEN4 Position */ -#define EPWM_INTEN0_CMPDIEN4_Msk (0x1ul << EPWM_INTEN0_CMPDIEN4_Pos) /*!< EPWM_T::INTEN0: CMPDIEN4 Mask */ - -#define EPWM_INTEN0_CMPDIEN5_Pos (29) /*!< EPWM_T::INTEN0: CMPDIEN5 Position */ -#define EPWM_INTEN0_CMPDIEN5_Msk (0x1ul << EPWM_INTEN0_CMPDIEN5_Pos) /*!< EPWM_T::INTEN0: CMPDIEN5 Mask */ - -#define EPWM_INTEN1_BRKEIEN0_1_Pos (0) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Position */ -#define EPWM_INTEN1_BRKEIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKEIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKEIEN2_3_Pos (1) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Position */ -#define EPWM_INTEN1_BRKEIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKEIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKEIEN4_5_Pos (2) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Position */ -#define EPWM_INTEN1_BRKEIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKEIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Mask */ - -#define EPWM_INTEN1_BRKLIEN0_1_Pos (8) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Position */ -#define EPWM_INTEN1_BRKLIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKLIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKLIEN2_3_Pos (9) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Position */ -#define EPWM_INTEN1_BRKLIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKLIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKLIEN4_5_Pos (10) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Position */ -#define EPWM_INTEN1_BRKLIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKLIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Mask */ - -#define EPWM_INTSTS0_ZIF0_Pos (0) /*!< EPWM_T::INTSTS0: ZIF0 Position */ -#define EPWM_INTSTS0_ZIF0_Msk (0x1ul << EPWM_INTSTS0_ZIF0_Pos) /*!< EPWM_T::INTSTS0: ZIF0 Mask */ - -#define EPWM_INTSTS0_ZIF1_Pos (1) /*!< EPWM_T::INTSTS0: ZIF1 Position */ -#define EPWM_INTSTS0_ZIF1_Msk (0x1ul << EPWM_INTSTS0_ZIF1_Pos) /*!< EPWM_T::INTSTS0: ZIF1 Mask */ - -#define EPWM_INTSTS0_ZIF2_Pos (2) /*!< EPWM_T::INTSTS0: ZIF2 Position */ -#define EPWM_INTSTS0_ZIF2_Msk (0x1ul << EPWM_INTSTS0_ZIF2_Pos) /*!< EPWM_T::INTSTS0: ZIF2 Mask */ - -#define EPWM_INTSTS0_ZIF3_Pos (3) /*!< EPWM_T::INTSTS0: ZIF3 Position */ -#define EPWM_INTSTS0_ZIF3_Msk (0x1ul << EPWM_INTSTS0_ZIF3_Pos) /*!< EPWM_T::INTSTS0: ZIF3 Mask */ - -#define EPWM_INTSTS0_ZIF4_Pos (4) /*!< EPWM_T::INTSTS0: ZIF4 Position */ -#define EPWM_INTSTS0_ZIF4_Msk (0x1ul << EPWM_INTSTS0_ZIF4_Pos) /*!< EPWM_T::INTSTS0: ZIF4 Mask */ - -#define EPWM_INTSTS0_ZIF5_Pos (5) /*!< EPWM_T::INTSTS0: ZIF5 Position */ -#define EPWM_INTSTS0_ZIF5_Msk (0x1ul << EPWM_INTSTS0_ZIF5_Pos) /*!< EPWM_T::INTSTS0: ZIF5 Mask */ - -#define EPWM_INTSTS0_PIF0_Pos (8) /*!< EPWM_T::INTSTS0: PIF0 Position */ -#define EPWM_INTSTS0_PIF0_Msk (0x1ul << EPWM_INTSTS0_PIF0_Pos) /*!< EPWM_T::INTSTS0: PIF0 Mask */ - -#define EPWM_INTSTS0_PIF1_Pos (9) /*!< EPWM_T::INTSTS0: PIF1 Position */ -#define EPWM_INTSTS0_PIF1_Msk (0x1ul << EPWM_INTSTS0_PIF1_Pos) /*!< EPWM_T::INTSTS0: PIF1 Mask */ - -#define EPWM_INTSTS0_PIF2_Pos (10) /*!< EPWM_T::INTSTS0: PIF2 Position */ -#define EPWM_INTSTS0_PIF2_Msk (0x1ul << EPWM_INTSTS0_PIF2_Pos) /*!< EPWM_T::INTSTS0: PIF2 Mask */ - -#define EPWM_INTSTS0_PIF3_Pos (11) /*!< EPWM_T::INTSTS0: PIF3 Position */ -#define EPWM_INTSTS0_PIF3_Msk (0x1ul << EPWM_INTSTS0_PIF3_Pos) /*!< EPWM_T::INTSTS0: PIF3 Mask */ - -#define EPWM_INTSTS0_PIF4_Pos (12) /*!< EPWM_T::INTSTS0: PIF4 Position */ -#define EPWM_INTSTS0_PIF4_Msk (0x1ul << EPWM_INTSTS0_PIF4_Pos) /*!< EPWM_T::INTSTS0: PIF4 Mask */ - -#define EPWM_INTSTS0_PIF5_Pos (13) /*!< EPWM_T::INTSTS0: PIF5 Position */ -#define EPWM_INTSTS0_PIF5_Msk (0x1ul << EPWM_INTSTS0_PIF5_Pos) /*!< EPWM_T::INTSTS0: PIF5 Mask */ - -#define EPWM_INTSTS0_CMPUIF0_Pos (16) /*!< EPWM_T::INTSTS0: CMPUIF0 Position */ -#define EPWM_INTSTS0_CMPUIF0_Msk (0x1ul << EPWM_INTSTS0_CMPUIF0_Pos) /*!< EPWM_T::INTSTS0: CMPUIF0 Mask */ - -#define EPWM_INTSTS0_CMPUIF1_Pos (17) /*!< EPWM_T::INTSTS0: CMPUIF1 Position */ -#define EPWM_INTSTS0_CMPUIF1_Msk (0x1ul << EPWM_INTSTS0_CMPUIF1_Pos) /*!< EPWM_T::INTSTS0: CMPUIF1 Mask */ - -#define EPWM_INTSTS0_CMPUIF2_Pos (18) /*!< EPWM_T::INTSTS0: CMPUIF2 Position */ -#define EPWM_INTSTS0_CMPUIF2_Msk (0x1ul << EPWM_INTSTS0_CMPUIF2_Pos) /*!< EPWM_T::INTSTS0: CMPUIF2 Mask */ - -#define EPWM_INTSTS0_CMPUIF3_Pos (19) /*!< EPWM_T::INTSTS0: CMPUIF3 Position */ -#define EPWM_INTSTS0_CMPUIF3_Msk (0x1ul << EPWM_INTSTS0_CMPUIF3_Pos) /*!< EPWM_T::INTSTS0: CMPUIF3 Mask */ - -#define EPWM_INTSTS0_CMPUIF4_Pos (20) /*!< EPWM_T::INTSTS0: CMPUIF4 Position */ -#define EPWM_INTSTS0_CMPUIF4_Msk (0x1ul << EPWM_INTSTS0_CMPUIF4_Pos) /*!< EPWM_T::INTSTS0: CMPUIF4 Mask */ - -#define EPWM_INTSTS0_CMPUIF5_Pos (21) /*!< EPWM_T::INTSTS0: CMPUIF5 Position */ -#define EPWM_INTSTS0_CMPUIF5_Msk (0x1ul << EPWM_INTSTS0_CMPUIF5_Pos) /*!< EPWM_T::INTSTS0: CMPUIF5 Mask */ - -#define EPWM_INTSTS0_CMPDIF0_Pos (24) /*!< EPWM_T::INTSTS0: CMPDIF0 Position */ -#define EPWM_INTSTS0_CMPDIF0_Msk (0x1ul << EPWM_INTSTS0_CMPDIF0_Pos) /*!< EPWM_T::INTSTS0: CMPDIF0 Mask */ - -#define EPWM_INTSTS0_CMPDIF1_Pos (25) /*!< EPWM_T::INTSTS0: CMPDIF1 Position */ -#define EPWM_INTSTS0_CMPDIF1_Msk (0x1ul << EPWM_INTSTS0_CMPDIF1_Pos) /*!< EPWM_T::INTSTS0: CMPDIF1 Mask */ - -#define EPWM_INTSTS0_CMPDIF2_Pos (26) /*!< EPWM_T::INTSTS0: CMPDIF2 Position */ -#define EPWM_INTSTS0_CMPDIF2_Msk (0x1ul << EPWM_INTSTS0_CMPDIF2_Pos) /*!< EPWM_T::INTSTS0: CMPDIF2 Mask */ - -#define EPWM_INTSTS0_CMPDIF3_Pos (27) /*!< EPWM_T::INTSTS0: CMPDIF3 Position */ -#define EPWM_INTSTS0_CMPDIF3_Msk (0x1ul << EPWM_INTSTS0_CMPDIF3_Pos) /*!< EPWM_T::INTSTS0: CMPDIF3 Mask */ - -#define EPWM_INTSTS0_CMPDIF4_Pos (28) /*!< EPWM_T::INTSTS0: CMPDIF4 Position */ -#define EPWM_INTSTS0_CMPDIF4_Msk (0x1ul << EPWM_INTSTS0_CMPDIF4_Pos) /*!< EPWM_T::INTSTS0: CMPDIF4 Mask */ - -#define EPWM_INTSTS0_CMPDIF5_Pos (29) /*!< EPWM_T::INTSTS0: CMPDIF5 Position */ -#define EPWM_INTSTS0_CMPDIF5_Msk (0x1ul << EPWM_INTSTS0_CMPDIF5_Pos) /*!< EPWM_T::INTSTS0: CMPDIF5 Mask */ - -#define EPWM_INTSTS1_BRKEIF0_Pos (0) /*!< EPWM_T::INTSTS1: BRKEIF0 Position */ -#define EPWM_INTSTS1_BRKEIF0_Msk (0x1ul << EPWM_INTSTS1_BRKEIF0_Pos) /*!< EPWM_T::INTSTS1: BRKEIF0 Mask */ - -#define EPWM_INTSTS1_BRKEIF1_Pos (1) /*!< EPWM_T::INTSTS1: BRKEIF1 Position */ -#define EPWM_INTSTS1_BRKEIF1_Msk (0x1ul << EPWM_INTSTS1_BRKEIF1_Pos) /*!< EPWM_T::INTSTS1: BRKEIF1 Mask */ - -#define EPWM_INTSTS1_BRKEIF2_Pos (2) /*!< EPWM_T::INTSTS1: BRKEIF2 Position */ -#define EPWM_INTSTS1_BRKEIF2_Msk (0x1ul << EPWM_INTSTS1_BRKEIF2_Pos) /*!< EPWM_T::INTSTS1: BRKEIF2 Mask */ - -#define EPWM_INTSTS1_BRKEIF3_Pos (3) /*!< EPWM_T::INTSTS1: BRKEIF3 Position */ -#define EPWM_INTSTS1_BRKEIF3_Msk (0x1ul << EPWM_INTSTS1_BRKEIF3_Pos) /*!< EPWM_T::INTSTS1: BRKEIF3 Mask */ - -#define EPWM_INTSTS1_BRKEIF4_Pos (4) /*!< EPWM_T::INTSTS1: BRKEIF4 Position */ -#define EPWM_INTSTS1_BRKEIF4_Msk (0x1ul << EPWM_INTSTS1_BRKEIF4_Pos) /*!< EPWM_T::INTSTS1: BRKEIF4 Mask */ - -#define EPWM_INTSTS1_BRKEIF5_Pos (5) /*!< EPWM_T::INTSTS1: BRKEIF5 Position */ -#define EPWM_INTSTS1_BRKEIF5_Msk (0x1ul << EPWM_INTSTS1_BRKEIF5_Pos) /*!< EPWM_T::INTSTS1: BRKEIF5 Mask */ - -#define EPWM_INTSTS1_BRKLIF0_Pos (8) /*!< EPWM_T::INTSTS1: BRKLIF0 Position */ -#define EPWM_INTSTS1_BRKLIF0_Msk (0x1ul << EPWM_INTSTS1_BRKLIF0_Pos) /*!< EPWM_T::INTSTS1: BRKLIF0 Mask */ - -#define EPWM_INTSTS1_BRKLIF1_Pos (9) /*!< EPWM_T::INTSTS1: BRKLIF1 Position */ -#define EPWM_INTSTS1_BRKLIF1_Msk (0x1ul << EPWM_INTSTS1_BRKLIF1_Pos) /*!< EPWM_T::INTSTS1: BRKLIF1 Mask */ - -#define EPWM_INTSTS1_BRKLIF2_Pos (10) /*!< EPWM_T::INTSTS1: BRKLIF2 Position */ -#define EPWM_INTSTS1_BRKLIF2_Msk (0x1ul << EPWM_INTSTS1_BRKLIF2_Pos) /*!< EPWM_T::INTSTS1: BRKLIF2 Mask */ - -#define EPWM_INTSTS1_BRKLIF3_Pos (11) /*!< EPWM_T::INTSTS1: BRKLIF3 Position */ -#define EPWM_INTSTS1_BRKLIF3_Msk (0x1ul << EPWM_INTSTS1_BRKLIF3_Pos) /*!< EPWM_T::INTSTS1: BRKLIF3 Mask */ - -#define EPWM_INTSTS1_BRKLIF4_Pos (12) /*!< EPWM_T::INTSTS1: BRKLIF4 Position */ -#define EPWM_INTSTS1_BRKLIF4_Msk (0x1ul << EPWM_INTSTS1_BRKLIF4_Pos) /*!< EPWM_T::INTSTS1: BRKLIF4 Mask */ - -#define EPWM_INTSTS1_BRKLIF5_Pos (13) /*!< EPWM_T::INTSTS1: BRKLIF5 Position */ -#define EPWM_INTSTS1_BRKLIF5_Msk (0x1ul << EPWM_INTSTS1_BRKLIF5_Pos) /*!< EPWM_T::INTSTS1: BRKLIF5 Mask */ - -#define EPWM_INTSTS1_BRKESTS0_Pos (16) /*!< EPWM_T::INTSTS1: BRKESTS0 Position */ -#define EPWM_INTSTS1_BRKESTS0_Msk (0x1ul << EPWM_INTSTS1_BRKESTS0_Pos) /*!< EPWM_T::INTSTS1: BRKESTS0 Mask */ - -#define EPWM_INTSTS1_BRKESTS1_Pos (17) /*!< EPWM_T::INTSTS1: BRKESTS1 Position */ -#define EPWM_INTSTS1_BRKESTS1_Msk (0x1ul << EPWM_INTSTS1_BRKESTS1_Pos) /*!< EPWM_T::INTSTS1: BRKESTS1 Mask */ - -#define EPWM_INTSTS1_BRKESTS2_Pos (18) /*!< EPWM_T::INTSTS1: BRKESTS2 Position */ -#define EPWM_INTSTS1_BRKESTS2_Msk (0x1ul << EPWM_INTSTS1_BRKESTS2_Pos) /*!< EPWM_T::INTSTS1: BRKESTS2 Mask */ - -#define EPWM_INTSTS1_BRKESTS3_Pos (19) /*!< EPWM_T::INTSTS1: BRKESTS3 Position */ -#define EPWM_INTSTS1_BRKESTS3_Msk (0x1ul << EPWM_INTSTS1_BRKESTS3_Pos) /*!< EPWM_T::INTSTS1: BRKESTS3 Mask */ - -#define EPWM_INTSTS1_BRKESTS4_Pos (20) /*!< EPWM_T::INTSTS1: BRKESTS4 Position */ -#define EPWM_INTSTS1_BRKESTS4_Msk (0x1ul << EPWM_INTSTS1_BRKESTS4_Pos) /*!< EPWM_T::INTSTS1: BRKESTS4 Mask */ - -#define EPWM_INTSTS1_BRKESTS5_Pos (21) /*!< EPWM_T::INTSTS1: BRKESTS5 Position */ -#define EPWM_INTSTS1_BRKESTS5_Msk (0x1ul << EPWM_INTSTS1_BRKESTS5_Pos) /*!< EPWM_T::INTSTS1: BRKESTS5 Mask */ - -#define EPWM_INTSTS1_BRKLSTS0_Pos (24) /*!< EPWM_T::INTSTS1: BRKLSTS0 Position */ -#define EPWM_INTSTS1_BRKLSTS0_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS0_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS0 Mask */ - -#define EPWM_INTSTS1_BRKLSTS1_Pos (25) /*!< EPWM_T::INTSTS1: BRKLSTS1 Position */ -#define EPWM_INTSTS1_BRKLSTS1_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS1_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS1 Mask */ - -#define EPWM_INTSTS1_BRKLSTS2_Pos (26) /*!< EPWM_T::INTSTS1: BRKLSTS2 Position */ -#define EPWM_INTSTS1_BRKLSTS2_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS2_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS2 Mask */ - -#define EPWM_INTSTS1_BRKLSTS3_Pos (27) /*!< EPWM_T::INTSTS1: BRKLSTS3 Position */ -#define EPWM_INTSTS1_BRKLSTS3_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS3_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS3 Mask */ - -#define EPWM_INTSTS1_BRKLSTS4_Pos (28) /*!< EPWM_T::INTSTS1: BRKLSTS4 Position */ -#define EPWM_INTSTS1_BRKLSTS4_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS4_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS4 Mask */ - -#define EPWM_INTSTS1_BRKLSTS5_Pos (29) /*!< EPWM_T::INTSTS1: BRKLSTS5 Position */ -#define EPWM_INTSTS1_BRKLSTS5_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS5_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS5 Mask */ - -#define EPWM_DACTRGEN_ZTE0_Pos (0) /*!< EPWM_T::DACTRGEN: ZTE0 Position */ -#define EPWM_DACTRGEN_ZTE0_Msk (0x1ul << EPWM_DACTRGEN_ZTE0_Pos) /*!< EPWM_T::DACTRGEN: ZTE0 Mask */ - -#define EPWM_DACTRGEN_ZTE1_Pos (1) /*!< EPWM_T::DACTRGEN: ZTE1 Position */ -#define EPWM_DACTRGEN_ZTE1_Msk (0x1ul << EPWM_DACTRGEN_ZTE1_Pos) /*!< EPWM_T::DACTRGEN: ZTE1 Mask */ - -#define EPWM_DACTRGEN_ZTE2_Pos (2) /*!< EPWM_T::DACTRGEN: ZTE2 Position */ -#define EPWM_DACTRGEN_ZTE2_Msk (0x1ul << EPWM_DACTRGEN_ZTE2_Pos) /*!< EPWM_T::DACTRGEN: ZTE2 Mask */ - -#define EPWM_DACTRGEN_ZTE3_Pos (3) /*!< EPWM_T::DACTRGEN: ZTE3 Position */ -#define EPWM_DACTRGEN_ZTE3_Msk (0x1ul << EPWM_DACTRGEN_ZTE3_Pos) /*!< EPWM_T::DACTRGEN: ZTE3 Mask */ - -#define EPWM_DACTRGEN_ZTE4_Pos (4) /*!< EPWM_T::DACTRGEN: ZTE4 Position */ -#define EPWM_DACTRGEN_ZTE4_Msk (0x1ul << EPWM_DACTRGEN_ZTE4_Pos) /*!< EPWM_T::DACTRGEN: ZTE4 Mask */ - -#define EPWM_DACTRGEN_ZTE5_Pos (5) /*!< EPWM_T::DACTRGEN: ZTE5 Position */ -#define EPWM_DACTRGEN_ZTE5_Msk (0x1ul << EPWM_DACTRGEN_ZTE5_Pos) /*!< EPWM_T::DACTRGEN: ZTE5 Mask */ - -#define EPWM_DACTRGEN_PTE0_Pos (8) /*!< EPWM_T::DACTRGEN: PTE0 Position */ -#define EPWM_DACTRGEN_PTE0_Msk (0x1ul << EPWM_DACTRGEN_PTE0_Pos) /*!< EPWM_T::DACTRGEN: PTE0 Mask */ - -#define EPWM_DACTRGEN_PTE1_Pos (9) /*!< EPWM_T::DACTRGEN: PTE1 Position */ -#define EPWM_DACTRGEN_PTE1_Msk (0x1ul << EPWM_DACTRGEN_PTE1_Pos) /*!< EPWM_T::DACTRGEN: PTE1 Mask */ - -#define EPWM_DACTRGEN_PTE2_Pos (10) /*!< EPWM_T::DACTRGEN: PTE2 Position */ -#define EPWM_DACTRGEN_PTE2_Msk (0x1ul << EPWM_DACTRGEN_PTE2_Pos) /*!< EPWM_T::DACTRGEN: PTE2 Mask */ - -#define EPWM_DACTRGEN_PTE3_Pos (11) /*!< EPWM_T::DACTRGEN: PTE3 Position */ -#define EPWM_DACTRGEN_PTE3_Msk (0x1ul << EPWM_DACTRGEN_PTE3_Pos) /*!< EPWM_T::DACTRGEN: PTE3 Mask */ - -#define EPWM_DACTRGEN_PTE4_Pos (12) /*!< EPWM_T::DACTRGEN: PTE4 Position */ -#define EPWM_DACTRGEN_PTE4_Msk (0x1ul << EPWM_DACTRGEN_PTE4_Pos) /*!< EPWM_T::DACTRGEN: PTE4 Mask */ - -#define EPWM_DACTRGEN_PTE5_Pos (13) /*!< EPWM_T::DACTRGEN: PTE5 Position */ -#define EPWM_DACTRGEN_PTE5_Msk (0x1ul << EPWM_DACTRGEN_PTE5_Pos) /*!< EPWM_T::DACTRGEN: PTE5 Mask */ - -#define EPWM_DACTRGEN_CUTRGEN0_Pos (16) /*!< EPWM_T::DACTRGEN: CUTRGEN0 Position */ -#define EPWM_DACTRGEN_CUTRGEN0_Msk (0x1ul << EPWM_DACTRGEN_CUTRGEN0_Pos) /*!< EPWM_T::DACTRGEN: CUTRGEN0 Mask */ - -#define EPWM_DACTRGEN_CUTRGEN1_Pos (17) /*!< EPWM_T::DACTRGEN: CUTRGEN1 Position */ -#define EPWM_DACTRGEN_CUTRGEN1_Msk (0x1ul << EPWM_DACTRGEN_CUTRGEN1_Pos) /*!< EPWM_T::DACTRGEN: CUTRGEN1 Mask */ - -#define EPWM_DACTRGEN_CUTRGEN2_Pos (18) /*!< EPWM_T::DACTRGEN: CUTRGEN2 Position */ -#define EPWM_DACTRGEN_CUTRGEN2_Msk (0x1ul << EPWM_DACTRGEN_CUTRGEN2_Pos) /*!< EPWM_T::DACTRGEN: CUTRGEN2 Mask */ - -#define EPWM_DACTRGEN_CUTRGEN3_Pos (19) /*!< EPWM_T::DACTRGEN: CUTRGEN3 Position */ -#define EPWM_DACTRGEN_CUTRGEN3_Msk (0x1ul << EPWM_DACTRGEN_CUTRGEN3_Pos) /*!< EPWM_T::DACTRGEN: CUTRGEN3 Mask */ - -#define EPWM_DACTRGEN_CUTRGEN4_Pos (20) /*!< EPWM_T::DACTRGEN: CUTRGEN4 Position */ -#define EPWM_DACTRGEN_CUTRGEN4_Msk (0x1ul << EPWM_DACTRGEN_CUTRGEN4_Pos) /*!< EPWM_T::DACTRGEN: CUTRGEN4 Mask */ - -#define EPWM_DACTRGEN_CUTRGEN5_Pos (21) /*!< EPWM_T::DACTRGEN: CUTRGEN5 Position */ -#define EPWM_DACTRGEN_CUTRGEN5_Msk (0x1ul << EPWM_DACTRGEN_CUTRGEN5_Pos) /*!< EPWM_T::DACTRGEN: CUTRGEN5 Mask */ - -#define EPWM_DACTRGEN_CDTRGEN0_Pos (24) /*!< EPWM_T::DACTRGEN: CDTRGEN0 Position */ -#define EPWM_DACTRGEN_CDTRGEN0_Msk (0x1ul << EPWM_DACTRGEN_CDTRGEN0_Pos) /*!< EPWM_T::DACTRGEN: CDTRGEN0 Mask */ - -#define EPWM_DACTRGEN_CDTRGEN1_Pos (25) /*!< EPWM_T::DACTRGEN: CDTRGEN1 Position */ -#define EPWM_DACTRGEN_CDTRGEN1_Msk (0x1ul << EPWM_DACTRGEN_CDTRGEN1_Pos) /*!< EPWM_T::DACTRGEN: CDTRGEN1 Mask */ - -#define EPWM_DACTRGEN_CDTRGEN2_Pos (26) /*!< EPWM_T::DACTRGEN: CDTRGEN2 Position */ -#define EPWM_DACTRGEN_CDTRGEN2_Msk (0x1ul << EPWM_DACTRGEN_CDTRGEN2_Pos) /*!< EPWM_T::DACTRGEN: CDTRGEN2 Mask */ - -#define EPWM_DACTRGEN_CDTRGEN3_Pos (27) /*!< EPWM_T::DACTRGEN: CDTRGEN3 Position */ -#define EPWM_DACTRGEN_CDTRGEN3_Msk (0x1ul << EPWM_DACTRGEN_CDTRGEN3_Pos) /*!< EPWM_T::DACTRGEN: CDTRGEN3 Mask */ - -#define EPWM_DACTRGEN_CDTRGEN4_Pos (28) /*!< EPWM_T::DACTRGEN: CDTRGEN4 Position */ -#define EPWM_DACTRGEN_CDTRGEN4_Msk (0x1ul << EPWM_DACTRGEN_CDTRGEN4_Pos) /*!< EPWM_T::DACTRGEN: CDTRGEN4 Mask */ - -#define EPWM_DACTRGEN_CDTRGEN5_Pos (29) /*!< EPWM_T::DACTRGEN: CDTRGEN5 Position */ -#define EPWM_DACTRGEN_CDTRGEN5_Msk (0x1ul << EPWM_DACTRGEN_CDTRGEN5_Pos) /*!< EPWM_T::DACTRGEN: CDTRGEN5 Mask */ - -#define EPWM_EADCTS0_TRGSEL0_Pos (0) /*!< EPWM_T::EADCTS0: TRGSEL0 Position */ -#define EPWM_EADCTS0_TRGSEL0_Msk (0x1ful << EPWM_EADCTS0_TRGSEL0_Pos) /*!< EPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define EPWM_EADCTS0_TRGEN0_Pos (7) /*!< EPWM_T::EADCTS0: TRGEN0 Position */ -#define EPWM_EADCTS0_TRGEN0_Msk (0x1ul << EPWM_EADCTS0_TRGEN0_Pos) /*!< EPWM_T::EADCTS0: TRGEN0 Mask */ - -#define EPWM_EADCTS0_TRGSEL1_Pos (8) /*!< EPWM_T::EADCTS0: TRGSEL1 Position */ -#define EPWM_EADCTS0_TRGSEL1_Msk (0x1ful << EPWM_EADCTS0_TRGSEL1_Pos) /*!< EPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define EPWM_EADCTS0_TRGEN1_Pos (15) /*!< EPWM_T::EADCTS0: TRGEN1 Position */ -#define EPWM_EADCTS0_TRGEN1_Msk (0x1ul << EPWM_EADCTS0_TRGEN1_Pos) /*!< EPWM_T::EADCTS0: TRGEN1 Mask */ - -#define EPWM_EADCTS0_TRGSEL2_Pos (16) /*!< EPWM_T::EADCTS0: TRGSEL2 Position */ -#define EPWM_EADCTS0_TRGSEL2_Msk (0x1ful << EPWM_EADCTS0_TRGSEL2_Pos) /*!< EPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define EPWM_EADCTS0_TRGEN2_Pos (23) /*!< EPWM_T::EADCTS0: TRGEN2 Position */ -#define EPWM_EADCTS0_TRGEN2_Msk (0x1ul << EPWM_EADCTS0_TRGEN2_Pos) /*!< EPWM_T::EADCTS0: TRGEN2 Mask */ - -#define EPWM_EADCTS0_TRGSEL3_Pos (24) /*!< EPWM_T::EADCTS0: TRGSEL3 Position */ -#define EPWM_EADCTS0_TRGSEL3_Msk (0x1ful << EPWM_EADCTS0_TRGSEL3_Pos) /*!< EPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define EPWM_EADCTS0_TRGEN3_Pos (31) /*!< EPWM_T::EADCTS0: TRGEN3 Position */ -#define EPWM_EADCTS0_TRGEN3_Msk (0x1ul << EPWM_EADCTS0_TRGEN3_Pos) /*!< EPWM_T::EADCTS0: TRGEN3 Mask */ - -#define EPWM_EADCTS1_TRGSEL4_Pos (0) /*!< EPWM_T::EADCTS1: TRGSEL4 Position */ -#define EPWM_EADCTS1_TRGSEL4_Msk (0x1ful << EPWM_EADCTS1_TRGSEL4_Pos) /*!< EPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define EPWM_EADCTS1_TRGEN4_Pos (7) /*!< EPWM_T::EADCTS1: TRGEN4 Position */ -#define EPWM_EADCTS1_TRGEN4_Msk (0x1ul << EPWM_EADCTS1_TRGEN4_Pos) /*!< EPWM_T::EADCTS1: TRGEN4 Mask */ - -#define EPWM_EADCTS1_TRGSEL5_Pos (8) /*!< EPWM_T::EADCTS1: TRGSEL5 Position */ -#define EPWM_EADCTS1_TRGSEL5_Msk (0x1ful << EPWM_EADCTS1_TRGSEL5_Pos) /*!< EPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define EPWM_EADCTS1_TRGEN5_Pos (15) /*!< EPWM_T::EADCTS1: TRGEN5 Position */ -#define EPWM_EADCTS1_TRGEN5_Msk (0x1ul << EPWM_EADCTS1_TRGEN5_Pos) /*!< EPWM_T::EADCTS1: TRGEN5 Mask */ - -#define EPWM_FTCMPDAT0_1_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Position */ -#define EPWM_FTCMPDAT0_1_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT0_1_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Mask */ - -#define EPWM_FTCMPDAT2_3_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Position */ -#define EPWM_FTCMPDAT2_3_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT2_3_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Mask */ - -#define EPWM_FTCMPDAT4_5_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Position */ -#define EPWM_FTCMPDAT4_5_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT4_5_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Mask */ - -#define EPWM_SSCTL_SSEN0_Pos (0) /*!< EPWM_T::SSCTL: SSEN0 Position */ -#define EPWM_SSCTL_SSEN0_Msk (0x1ul << EPWM_SSCTL_SSEN0_Pos) /*!< EPWM_T::SSCTL: SSEN0 Mask */ - -#define EPWM_SSCTL_SSEN1_Pos (1) /*!< EPWM_T::SSCTL: SSEN1 Position */ -#define EPWM_SSCTL_SSEN1_Msk (0x1ul << EPWM_SSCTL_SSEN1_Pos) /*!< EPWM_T::SSCTL: SSEN1 Mask */ - -#define EPWM_SSCTL_SSEN2_Pos (2) /*!< EPWM_T::SSCTL: SSEN2 Position */ -#define EPWM_SSCTL_SSEN2_Msk (0x1ul << EPWM_SSCTL_SSEN2_Pos) /*!< EPWM_T::SSCTL: SSEN2 Mask */ - -#define EPWM_SSCTL_SSEN3_Pos (3) /*!< EPWM_T::SSCTL: SSEN3 Position */ -#define EPWM_SSCTL_SSEN3_Msk (0x1ul << EPWM_SSCTL_SSEN3_Pos) /*!< EPWM_T::SSCTL: SSEN3 Mask */ - -#define EPWM_SSCTL_SSEN4_Pos (4) /*!< EPWM_T::SSCTL: SSEN4 Position */ -#define EPWM_SSCTL_SSEN4_Msk (0x1ul << EPWM_SSCTL_SSEN4_Pos) /*!< EPWM_T::SSCTL: SSEN4 Mask */ - -#define EPWM_SSCTL_SSEN5_Pos (5) /*!< EPWM_T::SSCTL: SSEN5 Position */ -#define EPWM_SSCTL_SSEN5_Msk (0x1ul << EPWM_SSCTL_SSEN5_Pos) /*!< EPWM_T::SSCTL: SSEN5 Mask */ - -#define EPWM_SSCTL_SSRC_Pos (8) /*!< EPWM_T::SSCTL: SSRC Position */ -#define EPWM_SSCTL_SSRC_Msk (0x3ul << EPWM_SSCTL_SSRC_Pos) /*!< EPWM_T::SSCTL: SSRC Mask */ - -#define EPWM_SSTRG_CNTSEN_Pos (0) /*!< EPWM_T::SSTRG: CNTSEN Position */ -#define EPWM_SSTRG_CNTSEN_Msk (0x1ul << EPWM_SSTRG_CNTSEN_Pos) /*!< EPWM_T::SSTRG: CNTSEN Mask */ - -#define EPWM_LEBCTL_LEBEN_Pos (0) /*!< EPWM_T::LEBCTL: LEBEN Position */ -#define EPWM_LEBCTL_LEBEN_Msk (0x1ul << EPWM_LEBCTL_LEBEN_Pos) /*!< EPWM_T::LEBCTL: LEBEN Mask */ - -#define EPWM_LEBCTL_SRCEN0_Pos (8) /*!< EPWM_T::LEBCTL: SRCEN0 Position */ -#define EPWM_LEBCTL_SRCEN0_Msk (0x1ul << EPWM_LEBCTL_SRCEN0_Pos) /*!< EPWM_T::LEBCTL: SRCEN0 Mask */ - -#define EPWM_LEBCTL_SRCEN2_Pos (9) /*!< EPWM_T::LEBCTL: SRCEN2 Position */ -#define EPWM_LEBCTL_SRCEN2_Msk (0x1ul << EPWM_LEBCTL_SRCEN2_Pos) /*!< EPWM_T::LEBCTL: SRCEN2 Mask */ - -#define EPWM_LEBCTL_SRCEN4_Pos (10) /*!< EPWM_T::LEBCTL: SRCEN4 Position */ -#define EPWM_LEBCTL_SRCEN4_Msk (0x1ul << EPWM_LEBCTL_SRCEN4_Pos) /*!< EPWM_T::LEBCTL: SRCEN4 Mask */ - -#define EPWM_LEBCTL_TRGTYPE_Pos (16) /*!< EPWM_T::LEBCTL: TRGTYPE Position */ -#define EPWM_LEBCTL_TRGTYPE_Msk (0x3ul << EPWM_LEBCTL_TRGTYPE_Pos) /*!< EPWM_T::LEBCTL: TRGTYPE Mask */ - -#define EPWM_LEBCNT_LEBCNT_Pos (0) /*!< EPWM_T::LEBCNT: LEBCNT Position */ -#define EPWM_LEBCNT_LEBCNT_Msk (0x1fful << EPWM_LEBCNT_LEBCNT_Pos) /*!< EPWM_T::LEBCNT: LEBCNT Mask */ - -#define EPWM_STATUS_CNTMAXF0_Pos (0) /*!< EPWM_T::STATUS: CNTMAXF0 Position */ -#define EPWM_STATUS_CNTMAXF0_Msk (0x1ul << EPWM_STATUS_CNTMAXF0_Pos) /*!< EPWM_T::STATUS: CNTMAXF0 Mask */ - -#define EPWM_STATUS_CNTMAXF1_Pos (1) /*!< EPWM_T::STATUS: CNTMAXF1 Position */ -#define EPWM_STATUS_CNTMAXF1_Msk (0x1ul << EPWM_STATUS_CNTMAXF1_Pos) /*!< EPWM_T::STATUS: CNTMAXF1 Mask */ - -#define EPWM_STATUS_CNTMAXF2_Pos (2) /*!< EPWM_T::STATUS: CNTMAXF2 Position */ -#define EPWM_STATUS_CNTMAXF2_Msk (0x1ul << EPWM_STATUS_CNTMAXF2_Pos) /*!< EPWM_T::STATUS: CNTMAXF2 Mask */ - -#define EPWM_STATUS_CNTMAXF3_Pos (3) /*!< EPWM_T::STATUS: CNTMAXF3 Position */ -#define EPWM_STATUS_CNTMAXF3_Msk (0x1ul << EPWM_STATUS_CNTMAXF3_Pos) /*!< EPWM_T::STATUS: CNTMAXF3 Mask */ - -#define EPWM_STATUS_CNTMAXF4_Pos (4) /*!< EPWM_T::STATUS: CNTMAXF4 Position */ -#define EPWM_STATUS_CNTMAXF4_Msk (0x1ul << EPWM_STATUS_CNTMAXF4_Pos) /*!< EPWM_T::STATUS: CNTMAXF4 Mask */ - -#define EPWM_STATUS_CNTMAXF5_Pos (5) /*!< EPWM_T::STATUS: CNTMAXF5 Position */ -#define EPWM_STATUS_CNTMAXF5_Msk (0x1ul << EPWM_STATUS_CNTMAXF5_Pos) /*!< EPWM_T::STATUS: CNTMAXF5 Mask */ - -#define EPWM_STATUS_SYNCINF0_Pos (8) /*!< EPWM_T::STATUS: SYNCINF0 Position */ -#define EPWM_STATUS_SYNCINF0_Msk (0x1ul << EPWM_STATUS_SYNCINF0_Pos) /*!< EPWM_T::STATUS: SYNCINF0 Mask */ - -#define EPWM_STATUS_SYNCINF2_Pos (9) /*!< EPWM_T::STATUS: SYNCINF2 Position */ -#define EPWM_STATUS_SYNCINF2_Msk (0x1ul << EPWM_STATUS_SYNCINF2_Pos) /*!< EPWM_T::STATUS: SYNCINF2 Mask */ - -#define EPWM_STATUS_SYNCINF4_Pos (10) /*!< EPWM_T::STATUS: SYNCINF4 Position */ -#define EPWM_STATUS_SYNCINF4_Msk (0x1ul << EPWM_STATUS_SYNCINF4_Pos) /*!< EPWM_T::STATUS: SYNCINF4 Mask */ - -#define EPWM_STATUS_EADCTRGF0_Pos (16) /*!< EPWM_T::STATUS: EADCTRGF0 Position */ -#define EPWM_STATUS_EADCTRGF0_Msk (0x1ul << EPWM_STATUS_EADCTRGF0_Pos) /*!< EPWM_T::STATUS: EADCTRGF0 Mask */ - -#define EPWM_STATUS_EADCTRGF1_Pos (17) /*!< EPWM_T::STATUS: EADCTRGF1 Position */ -#define EPWM_STATUS_EADCTRGF1_Msk (0x1ul << EPWM_STATUS_EADCTRGF1_Pos) /*!< EPWM_T::STATUS: EADCTRGF1 Mask */ - -#define EPWM_STATUS_EADCTRGF2_Pos (18) /*!< EPWM_T::STATUS: EADCTRGF2 Position */ -#define EPWM_STATUS_EADCTRGF2_Msk (0x1ul << EPWM_STATUS_EADCTRGF2_Pos) /*!< EPWM_T::STATUS: EADCTRGF2 Mask */ - -#define EPWM_STATUS_EADCTRGF3_Pos (19) /*!< EPWM_T::STATUS: EADCTRGF3 Position */ -#define EPWM_STATUS_EADCTRGF3_Msk (0x1ul << EPWM_STATUS_EADCTRGF3_Pos) /*!< EPWM_T::STATUS: EADCTRGF3 Mask */ - -#define EPWM_STATUS_EADCTRGF4_Pos (20) /*!< EPWM_T::STATUS: EADCTRGF4 Position */ -#define EPWM_STATUS_EADCTRGF4_Msk (0x1ul << EPWM_STATUS_EADCTRGF4_Pos) /*!< EPWM_T::STATUS: EADCTRGF4 Mask */ - -#define EPWM_STATUS_EADCTRGF5_Pos (21) /*!< EPWM_T::STATUS: EADCTRGF5 Position */ -#define EPWM_STATUS_EADCTRGF5_Msk (0x1ul << EPWM_STATUS_EADCTRGF5_Pos) /*!< EPWM_T::STATUS: EADCTRGF5 Mask */ - -#define EPWM_STATUS_DACTRGF_Pos (24) /*!< EPWM_T::STATUS: DACTRGF Position */ -#define EPWM_STATUS_DACTRGF_Msk (0x1ul << EPWM_STATUS_DACTRGF_Pos) /*!< EPWM_T::STATUS: DACTRGF Mask */ - -#define EPWM_IFA0_IFACNT_Pos (0) /*!< EPWM_T::IFA0: IFACNT Position */ -#define EPWM_IFA0_IFACNT_Msk (0xfffful << EPWM_IFA0_IFACNT_Pos) /*!< EPWM_T::IFA0: IFACNT Mask */ - -#define EPWM_IFA0_STPMOD_Pos (24) /*!< EPWM_T::IFA0: STPMOD Position */ -#define EPWM_IFA0_STPMOD_Msk (0x1ul << EPWM_IFA0_STPMOD_Pos) /*!< EPWM_T::IFA0: STPMOD Mask */ - -#define EPWM_IFA0_IFASEL_Pos (28) /*!< EPWM_T::IFA0: IFASEL Position */ -#define EPWM_IFA0_IFASEL_Msk (0x3ul << EPWM_IFA0_IFASEL_Pos) /*!< EPWM_T::IFA0: IFASEL Mask */ - -#define EPWM_IFA0_IFAEN_Pos (31) /*!< EPWM_T::IFA0: IFAEN Position */ -#define EPWM_IFA0_IFAEN_Msk (0x1ul << EPWM_IFA0_IFAEN_Pos) /*!< EPWM_T::IFA0: IFAEN Mask */ - -#define EPWM_IFA1_IFACNT_Pos (0) /*!< EPWM_T::IFA1: IFACNT Position */ -#define EPWM_IFA1_IFACNT_Msk (0xfffful << EPWM_IFA1_IFACNT_Pos) /*!< EPWM_T::IFA1: IFACNT Mask */ - -#define EPWM_IFA1_STPMOD_Pos (24) /*!< EPWM_T::IFA1: STPMOD Position */ -#define EPWM_IFA1_STPMOD_Msk (0x1ul << EPWM_IFA1_STPMOD_Pos) /*!< EPWM_T::IFA1: STPMOD Mask */ - -#define EPWM_IFA1_IFASEL_Pos (28) /*!< EPWM_T::IFA1: IFASEL Position */ -#define EPWM_IFA1_IFASEL_Msk (0x3ul << EPWM_IFA1_IFASEL_Pos) /*!< EPWM_T::IFA1: IFASEL Mask */ - -#define EPWM_IFA1_IFAEN_Pos (31) /*!< EPWM_T::IFA1: IFAEN Position */ -#define EPWM_IFA1_IFAEN_Msk (0x1ul << EPWM_IFA1_IFAEN_Pos) /*!< EPWM_T::IFA1: IFAEN Mask */ - -#define EPWM_IFA2_IFACNT_Pos (0) /*!< EPWM_T::IFA2: IFACNT Position */ -#define EPWM_IFA2_IFACNT_Msk (0xfffful << EPWM_IFA2_IFACNT_Pos) /*!< EPWM_T::IFA2: IFACNT Mask */ - -#define EPWM_IFA2_STPMOD_Pos (24) /*!< EPWM_T::IFA2: STPMOD Position */ -#define EPWM_IFA2_STPMOD_Msk (0x1ul << EPWM_IFA2_STPMOD_Pos) /*!< EPWM_T::IFA2: STPMOD Mask */ - -#define EPWM_IFA2_IFASEL_Pos (28) /*!< EPWM_T::IFA2: IFASEL Position */ -#define EPWM_IFA2_IFASEL_Msk (0x3ul << EPWM_IFA2_IFASEL_Pos) /*!< EPWM_T::IFA2: IFASEL Mask */ - -#define EPWM_IFA2_IFAEN_Pos (31) /*!< EPWM_T::IFA2: IFAEN Position */ -#define EPWM_IFA2_IFAEN_Msk (0x1ul << EPWM_IFA2_IFAEN_Pos) /*!< EPWM_T::IFA2: IFAEN Mask */ - -#define EPWM_IFA3_IFACNT_Pos (0) /*!< EPWM_T::IFA3: IFACNT Position */ -#define EPWM_IFA3_IFACNT_Msk (0xfffful << EPWM_IFA3_IFACNT_Pos) /*!< EPWM_T::IFA3: IFACNT Mask */ - -#define EPWM_IFA3_STPMOD_Pos (24) /*!< EPWM_T::IFA3: STPMOD Position */ -#define EPWM_IFA3_STPMOD_Msk (0x1ul << EPWM_IFA3_STPMOD_Pos) /*!< EPWM_T::IFA3: STPMOD Mask */ - -#define EPWM_IFA3_IFASEL_Pos (28) /*!< EPWM_T::IFA3: IFASEL Position */ -#define EPWM_IFA3_IFASEL_Msk (0x3ul << EPWM_IFA3_IFASEL_Pos) /*!< EPWM_T::IFA3: IFASEL Mask */ - -#define EPWM_IFA3_IFAEN_Pos (31) /*!< EPWM_T::IFA3: IFAEN Position */ -#define EPWM_IFA3_IFAEN_Msk (0x1ul << EPWM_IFA3_IFAEN_Pos) /*!< EPWM_T::IFA3: IFAEN Mask */ - -#define EPWM_IFA4_IFACNT_Pos (0) /*!< EPWM_T::IFA4: IFACNT Position */ -#define EPWM_IFA4_IFACNT_Msk (0xfffful << EPWM_IFA4_IFACNT_Pos) /*!< EPWM_T::IFA4: IFACNT Mask */ - -#define EPWM_IFA4_STPMOD_Pos (24) /*!< EPWM_T::IFA4: STPMOD Position */ -#define EPWM_IFA4_STPMOD_Msk (0x1ul << EPWM_IFA4_STPMOD_Pos) /*!< EPWM_T::IFA4: STPMOD Mask */ - -#define EPWM_IFA4_IFASEL_Pos (28) /*!< EPWM_T::IFA4: IFASEL Position */ -#define EPWM_IFA4_IFASEL_Msk (0x3ul << EPWM_IFA4_IFASEL_Pos) /*!< EPWM_T::IFA4: IFASEL Mask */ - -#define EPWM_IFA4_IFAEN_Pos (31) /*!< EPWM_T::IFA4: IFAEN Position */ -#define EPWM_IFA4_IFAEN_Msk (0x1ul << EPWM_IFA4_IFAEN_Pos) /*!< EPWM_T::IFA4: IFAEN Mask */ - -#define EPWM_IFA5_IFACNT_Pos (0) /*!< EPWM_T::IFA5: IFACNT Position */ -#define EPWM_IFA5_IFACNT_Msk (0xfffful << EPWM_IFA5_IFACNT_Pos) /*!< EPWM_T::IFA5: IFACNT Mask */ - -#define EPWM_IFA5_STPMOD_Pos (24) /*!< EPWM_T::IFA5: STPMOD Position */ -#define EPWM_IFA5_STPMOD_Msk (0x1ul << EPWM_IFA5_STPMOD_Pos) /*!< EPWM_T::IFA5: STPMOD Mask */ - -#define EPWM_IFA5_IFASEL_Pos (28) /*!< EPWM_T::IFA5: IFASEL Position */ -#define EPWM_IFA5_IFASEL_Msk (0x3ul << EPWM_IFA5_IFASEL_Pos) /*!< EPWM_T::IFA5: IFASEL Mask */ - -#define EPWM_IFA5_IFAEN_Pos (31) /*!< EPWM_T::IFA5: IFAEN Position */ -#define EPWM_IFA5_IFAEN_Msk (0x1ul << EPWM_IFA5_IFAEN_Pos) /*!< EPWM_T::IFA5: IFAEN Mask */ - -#define EPWM_AINTSTS_IFAIF0_Pos (0) /*!< EPWM_T::AINTSTS: IFAIF0 Position */ -#define EPWM_AINTSTS_IFAIF0_Msk (0x1ul << EPWM_AINTSTS_IFAIF0_Pos) /*!< EPWM_T::AINTSTS: IFAIF0 Mask */ - -#define EPWM_AINTSTS_IFAIF1_Pos (1) /*!< EPWM_T::AINTSTS: IFAIF1 Position */ -#define EPWM_AINTSTS_IFAIF1_Msk (0x1ul << EPWM_AINTSTS_IFAIF1_Pos) /*!< EPWM_T::AINTSTS: IFAIF1 Mask */ - -#define EPWM_AINTSTS_IFAIF2_Pos (2) /*!< EPWM_T::AINTSTS: IFAIF2 Position */ -#define EPWM_AINTSTS_IFAIF2_Msk (0x1ul << EPWM_AINTSTS_IFAIF2_Pos) /*!< EPWM_T::AINTSTS: IFAIF2 Mask */ - -#define EPWM_AINTSTS_IFAIF3_Pos (3) /*!< EPWM_T::AINTSTS: IFAIF3 Position */ -#define EPWM_AINTSTS_IFAIF3_Msk (0x1ul << EPWM_AINTSTS_IFAIF3_Pos) /*!< EPWM_T::AINTSTS: IFAIF3 Mask */ - -#define EPWM_AINTSTS_IFAIF4_Pos (4) /*!< EPWM_T::AINTSTS: IFAIF4 Position */ -#define EPWM_AINTSTS_IFAIF4_Msk (0x1ul << EPWM_AINTSTS_IFAIF4_Pos) /*!< EPWM_T::AINTSTS: IFAIF4 Mask */ - -#define EPWM_AINTSTS_IFAIF5_Pos (5) /*!< EPWM_T::AINTSTS: IFAIF5 Position */ -#define EPWM_AINTSTS_IFAIF5_Msk (0x1ul << EPWM_AINTSTS_IFAIF5_Pos) /*!< EPWM_T::AINTSTS: IFAIF5 Mask */ - -#define EPWM_AINTEN_IFAIEN0_Pos (0) /*!< EPWM_T::AINTEN: IFAIEN0 Position */ -#define EPWM_AINTEN_IFAIEN0_Msk (0x1ul << EPWM_AINTEN_IFAIEN0_Pos) /*!< EPWM_T::AINTEN: IFAIEN0 Mask */ - -#define EPWM_AINTEN_IFAIEN1_Pos (1) /*!< EPWM_T::AINTEN: IFAIEN1 Position */ -#define EPWM_AINTEN_IFAIEN1_Msk (0x1ul << EPWM_AINTEN_IFAIEN1_Pos) /*!< EPWM_T::AINTEN: IFAIEN1 Mask */ - -#define EPWM_AINTEN_IFAIEN2_Pos (2) /*!< EPWM_T::AINTEN: IFAIEN2 Position */ -#define EPWM_AINTEN_IFAIEN2_Msk (0x1ul << EPWM_AINTEN_IFAIEN2_Pos) /*!< EPWM_T::AINTEN: IFAIEN2 Mask */ - -#define EPWM_AINTEN_IFAIEN3_Pos (3) /*!< EPWM_T::AINTEN: IFAIEN3 Position */ -#define EPWM_AINTEN_IFAIEN3_Msk (0x1ul << EPWM_AINTEN_IFAIEN3_Pos) /*!< EPWM_T::AINTEN: IFAIEN3 Mask */ - -#define EPWM_AINTEN_IFAIEN4_Pos (4) /*!< EPWM_T::AINTEN: IFAIEN4 Position */ -#define EPWM_AINTEN_IFAIEN4_Msk (0x1ul << EPWM_AINTEN_IFAIEN4_Pos) /*!< EPWM_T::AINTEN: IFAIEN4 Mask */ - -#define EPWM_AINTEN_IFAIEN5_Pos (5) /*!< EPWM_T::AINTEN: IFAIEN5 Position */ -#define EPWM_AINTEN_IFAIEN5_Msk (0x1ul << EPWM_AINTEN_IFAIEN5_Pos) /*!< EPWM_T::AINTEN: IFAIEN5 Mask */ - -#define EPWM_APDMACTL_APDMAEN0_Pos (0) /*!< EPWM_T::APDMACTL: APDMAEN0 Position */ -#define EPWM_APDMACTL_APDMAEN0_Msk (0x1ul << EPWM_APDMACTL_APDMAEN0_Pos) /*!< EPWM_T::APDMACTL: APDMAEN0 Mask */ - -#define EPWM_APDMACTL_APDMAEN1_Pos (1) /*!< EPWM_T::APDMACTL: APDMAEN1 Position */ -#define EPWM_APDMACTL_APDMAEN1_Msk (0x1ul << EPWM_APDMACTL_APDMAEN1_Pos) /*!< EPWM_T::APDMACTL: APDMAEN1 Mask */ - -#define EPWM_APDMACTL_APDMAEN2_Pos (2) /*!< EPWM_T::APDMACTL: APDMAEN2 Position */ -#define EPWM_APDMACTL_APDMAEN2_Msk (0x1ul << EPWM_APDMACTL_APDMAEN2_Pos) /*!< EPWM_T::APDMACTL: APDMAEN2 Mask */ - -#define EPWM_APDMACTL_APDMAEN3_Pos (3) /*!< EPWM_T::APDMACTL: APDMAEN3 Position */ -#define EPWM_APDMACTL_APDMAEN3_Msk (0x1ul << EPWM_APDMACTL_APDMAEN3_Pos) /*!< EPWM_T::APDMACTL: APDMAEN3 Mask */ - -#define EPWM_APDMACTL_APDMAEN4_Pos (4) /*!< EPWM_T::APDMACTL: APDMAEN4 Position */ -#define EPWM_APDMACTL_APDMAEN4_Msk (0x1ul << EPWM_APDMACTL_APDMAEN4_Pos) /*!< EPWM_T::APDMACTL: APDMAEN4 Mask */ - -#define EPWM_APDMACTL_APDMAEN5_Pos (5) /*!< EPWM_T::APDMACTL: APDMAEN5 Position */ -#define EPWM_APDMACTL_APDMAEN5_Msk (0x1ul << EPWM_APDMACTL_APDMAEN5_Pos) /*!< EPWM_T::APDMACTL: APDMAEN5 Mask */ - -#define EPWM_FDEN_FDEN0_Pos (0) /*!< EPWM_T::FDEN: FDEN0 Position */ -#define EPWM_FDEN_FDEN0_Msk (0x1ul << EPWM_FDEN_FDEN0_Pos) /*!< EPWM_T::FDEN: FDEN0 Mask */ - -#define EPWM_FDEN_FDEN1_Pos (1) /*!< EPWM_T::FDEN: FDEN1 Position */ -#define EPWM_FDEN_FDEN1_Msk (0x1ul << EPWM_FDEN_FDEN1_Pos) /*!< EPWM_T::FDEN: FDEN1 Mask */ - -#define EPWM_FDEN_FDEN2_Pos (2) /*!< EPWM_T::FDEN: FDEN2 Position */ -#define EPWM_FDEN_FDEN2_Msk (0x1ul << EPWM_FDEN_FDEN2_Pos) /*!< EPWM_T::FDEN: FDEN2 Mask */ - -#define EPWM_FDEN_FDEN3_Pos (3) /*!< EPWM_T::FDEN: FDEN3 Position */ -#define EPWM_FDEN_FDEN3_Msk (0x1ul << EPWM_FDEN_FDEN3_Pos) /*!< EPWM_T::FDEN: FDEN3 Mask */ - -#define EPWM_FDEN_FDEN4_Pos (4) /*!< EPWM_T::FDEN: FDEN4 Position */ -#define EPWM_FDEN_FDEN4_Msk (0x1ul << EPWM_FDEN_FDEN4_Pos) /*!< EPWM_T::FDEN: FDEN4 Mask */ - -#define EPWM_FDEN_FDEN5_Pos (5) /*!< EPWM_T::FDEN: FDEN5 Position */ -#define EPWM_FDEN_FDEN5_Msk (0x1ul << EPWM_FDEN_FDEN5_Pos) /*!< EPWM_T::FDEN: FDEN5 Mask */ - -#define EPWM_FDEN_FDODIS0_Pos (8) /*!< EPWM_T::FDEN: FDODIS0 Position */ -#define EPWM_FDEN_FDODIS0_Msk (0x1ul << EPWM_FDEN_FDODIS0_Pos) /*!< EPWM_T::FDEN: FDODIS0 Mask */ - -#define EPWM_FDEN_FDODIS1_Pos (9) /*!< EPWM_T::FDEN: FDODIS1 Position */ -#define EPWM_FDEN_FDODIS1_Msk (0x1ul << EPWM_FDEN_FDODIS1_Pos) /*!< EPWM_T::FDEN: FDODIS1 Mask */ - -#define EPWM_FDEN_FDODIS2_Pos (10) /*!< EPWM_T::FDEN: FDODIS2 Position */ -#define EPWM_FDEN_FDODIS2_Msk (0x1ul << EPWM_FDEN_FDODIS2_Pos) /*!< EPWM_T::FDEN: FDODIS2 Mask */ - -#define EPWM_FDEN_FDODIS3_Pos (11) /*!< EPWM_T::FDEN: FDODIS3 Position */ -#define EPWM_FDEN_FDODIS3_Msk (0x1ul << EPWM_FDEN_FDODIS3_Pos) /*!< EPWM_T::FDEN: FDODIS3 Mask */ - -#define EPWM_FDEN_FDODIS4_Pos (12) /*!< EPWM_T::FDEN: FDODIS4 Position */ -#define EPWM_FDEN_FDODIS4_Msk (0x1ul << EPWM_FDEN_FDODIS4_Pos) /*!< EPWM_T::FDEN: FDODIS4 Mask */ - -#define EPWM_FDEN_FDODIS5_Pos (13) /*!< EPWM_T::FDEN: FDODIS5 Position */ -#define EPWM_FDEN_FDODIS5_Msk (0x1ul << EPWM_FDEN_FDODIS5_Pos) /*!< EPWM_T::FDEN: FDODIS5 Mask */ - -#define EPWM_FDEN_FDCKS0_Pos (16) /*!< EPWM_T::FDEN: FDCKS0 Position */ -#define EPWM_FDEN_FDCKS0_Msk (0x1ul << EPWM_FDEN_FDCKS0_Pos) /*!< EPWM_T::FDEN: FDCKS0 Mask */ - -#define EPWM_FDEN_FDCKS1_Pos (17) /*!< EPWM_T::FDEN: FDCKS1 Position */ -#define EPWM_FDEN_FDCKS1_Msk (0x1ul << EPWM_FDEN_FDCKS1_Pos) /*!< EPWM_T::FDEN: FDCKS1 Mask */ - -#define EPWM_FDEN_FDCKS2_Pos (18) /*!< EPWM_T::FDEN: FDCKS2 Position */ -#define EPWM_FDEN_FDCKS2_Msk (0x1ul << EPWM_FDEN_FDCKS2_Pos) /*!< EPWM_T::FDEN: FDCKS2 Mask */ - -#define EPWM_FDEN_FDCKS3_Pos (19) /*!< EPWM_T::FDEN: FDCKS3 Position */ -#define EPWM_FDEN_FDCKS3_Msk (0x1ul << EPWM_FDEN_FDCKS3_Pos) /*!< EPWM_T::FDEN: FDCKS3 Mask */ - -#define EPWM_FDEN_FDCKS4_Pos (20) /*!< EPWM_T::FDEN: FDCKS4 Position */ -#define EPWM_FDEN_FDCKS4_Msk (0x1ul << EPWM_FDEN_FDCKS4_Pos) /*!< EPWM_T::FDEN: FDCKS4 Mask */ - -#define EPWM_FDEN_FDCKS5_Pos (21) /*!< EPWM_T::FDEN: FDCKS5 Position */ -#define EPWM_FDEN_FDCKS5_Msk (0x1ul << EPWM_FDEN_FDCKS5_Pos) /*!< EPWM_T::FDEN: FDCKS5 Mask */ - -#define EPWM_FDCTL0_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL0: TRMSKCNT Position */ -#define EPWM_FDCTL0_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL0_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL0: TRMSKCNT Mask */ - -#define EPWM_FDCTL0_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL0: FDMSKEN Position */ -#define EPWM_FDCTL0_FDMSKEN_Msk (0x1ul << EPWM_FDCTL0_FDMSKEN_Pos) /*!< EPWM_T::FDCTL0: FDMSKEN Mask */ - -#define EPWM_FDCTL0_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL0: DGSMPCYC Position */ -#define EPWM_FDCTL0_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL0_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL0: DGSMPCYC Mask */ - -#define EPWM_FDCTL0_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL0: FDCKSEL Position */ -#define EPWM_FDCTL0_FDCKSEL_Msk (0x3ul << EPWM_FDCTL0_FDCKSEL_Pos) /*!< EPWM_T::FDCTL0: FDCKSEL Mask */ - -#define EPWM_FDCTL0_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL0: FDDGEN Position */ -#define EPWM_FDCTL0_FDDGEN_Msk (0x1ul << EPWM_FDCTL0_FDDGEN_Pos) /*!< EPWM_T::FDCTL0: FDDGEN Mask */ - -#define EPWM_FDCTL1_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL1: TRMSKCNT Position */ -#define EPWM_FDCTL1_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL1_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL1: TRMSKCNT Mask */ - -#define EPWM_FDCTL1_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL1: FDMSKEN Position */ -#define EPWM_FDCTL1_FDMSKEN_Msk (0x1ul << EPWM_FDCTL1_FDMSKEN_Pos) /*!< EPWM_T::FDCTL1: FDMSKEN Mask */ - -#define EPWM_FDCTL1_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL1: DGSMPCYC Position */ -#define EPWM_FDCTL1_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL1_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL1: DGSMPCYC Mask */ - -#define EPWM_FDCTL1_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL1: FDCKSEL Position */ -#define EPWM_FDCTL1_FDCKSEL_Msk (0x3ul << EPWM_FDCTL1_FDCKSEL_Pos) /*!< EPWM_T::FDCTL1: FDCKSEL Mask */ - -#define EPWM_FDCTL1_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL1: FDDGEN Position */ -#define EPWM_FDCTL1_FDDGEN_Msk (0x1ul << EPWM_FDCTL1_FDDGEN_Pos) /*!< EPWM_T::FDCTL1: FDDGEN Mask */ - -#define EPWM_FDCTL2_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL2: TRMSKCNT Position */ -#define EPWM_FDCTL2_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL2_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL2: TRMSKCNT Mask */ - -#define EPWM_FDCTL2_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL2: FDMSKEN Position */ -#define EPWM_FDCTL2_FDMSKEN_Msk (0x1ul << EPWM_FDCTL2_FDMSKEN_Pos) /*!< EPWM_T::FDCTL2: FDMSKEN Mask */ - -#define EPWM_FDCTL2_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL2: DGSMPCYC Position */ -#define EPWM_FDCTL2_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL2_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL2: DGSMPCYC Mask */ - -#define EPWM_FDCTL2_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL2: FDCKSEL Position */ -#define EPWM_FDCTL2_FDCKSEL_Msk (0x3ul << EPWM_FDCTL2_FDCKSEL_Pos) /*!< EPWM_T::FDCTL2: FDCKSEL Mask */ - -#define EPWM_FDCTL2_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL2: FDDGEN Position */ -#define EPWM_FDCTL2_FDDGEN_Msk (0x1ul << EPWM_FDCTL2_FDDGEN_Pos) /*!< EPWM_T::FDCTL2: FDDGEN Mask */ - -#define EPWM_FDCTL3_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL3: TRMSKCNT Position */ -#define EPWM_FDCTL3_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL3_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL3: TRMSKCNT Mask */ - -#define EPWM_FDCTL3_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL3: FDMSKEN Position */ -#define EPWM_FDCTL3_FDMSKEN_Msk (0x1ul << EPWM_FDCTL3_FDMSKEN_Pos) /*!< EPWM_T::FDCTL3: FDMSKEN Mask */ - -#define EPWM_FDCTL3_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL3: DGSMPCYC Position */ -#define EPWM_FDCTL3_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL3_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL3: DGSMPCYC Mask */ - -#define EPWM_FDCTL3_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL3: FDCKSEL Position */ -#define EPWM_FDCTL3_FDCKSEL_Msk (0x3ul << EPWM_FDCTL3_FDCKSEL_Pos) /*!< EPWM_T::FDCTL3: FDCKSEL Mask */ - -#define EPWM_FDCTL3_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL3: FDDGEN Position */ -#define EPWM_FDCTL3_FDDGEN_Msk (0x1ul << EPWM_FDCTL3_FDDGEN_Pos) /*!< EPWM_T::FDCTL3: FDDGEN Mask */ - -#define EPWM_FDCTL4_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL4: TRMSKCNT Position */ -#define EPWM_FDCTL4_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL4_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL4: TRMSKCNT Mask */ - -#define EPWM_FDCTL4_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL4: FDMSKEN Position */ -#define EPWM_FDCTL4_FDMSKEN_Msk (0x1ul << EPWM_FDCTL4_FDMSKEN_Pos) /*!< EPWM_T::FDCTL4: FDMSKEN Mask */ - -#define EPWM_FDCTL4_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL4: DGSMPCYC Position */ -#define EPWM_FDCTL4_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL4_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL4: DGSMPCYC Mask */ - -#define EPWM_FDCTL4_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL4: FDCKSEL Position */ -#define EPWM_FDCTL4_FDCKSEL_Msk (0x3ul << EPWM_FDCTL4_FDCKSEL_Pos) /*!< EPWM_T::FDCTL4: FDCKSEL Mask */ - -#define EPWM_FDCTL4_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL4: FDDGEN Position */ -#define EPWM_FDCTL4_FDDGEN_Msk (0x1ul << EPWM_FDCTL4_FDDGEN_Pos) /*!< EPWM_T::FDCTL4: FDDGEN Mask */ - -#define EPWM_FDCTL5_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL5: TRMSKCNT Position */ -#define EPWM_FDCTL5_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL5_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL5: TRMSKCNT Mask */ - -#define EPWM_FDCTL5_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL5: FDMSKEN Position */ -#define EPWM_FDCTL5_FDMSKEN_Msk (0x1ul << EPWM_FDCTL5_FDMSKEN_Pos) /*!< EPWM_T::FDCTL5: FDMSKEN Mask */ - -#define EPWM_FDCTL5_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL5: DGSMPCYC Position */ -#define EPWM_FDCTL5_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL5_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL5: DGSMPCYC Mask */ - -#define EPWM_FDCTL5_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL5: FDCKSEL Position */ -#define EPWM_FDCTL5_FDCKSEL_Msk (0x3ul << EPWM_FDCTL5_FDCKSEL_Pos) /*!< EPWM_T::FDCTL5: FDCKSEL Mask */ - -#define EPWM_FDCTL5_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL5: FDDGEN Position */ -#define EPWM_FDCTL5_FDDGEN_Msk (0x1ul << EPWM_FDCTL5_FDDGEN_Pos) /*!< EPWM_T::FDCTL5: FDDGEN Mask */ - -#define EPWM_FDIEN_FDIEN0_Pos (0) /*!< EPWM_T::FDIEN: FDIEN0 Position */ -#define EPWM_FDIEN_FDIEN0_Msk (0x1ul << EPWM_FDIEN_FDIEN0_Pos) /*!< EPWM_T::FDIEN: FDIEN0 Mask */ - -#define EPWM_FDIEN_FDIEN1_Pos (1) /*!< EPWM_T::FDIEN: FDIEN1 Position */ -#define EPWM_FDIEN_FDIEN1_Msk (0x1ul << EPWM_FDIEN_FDIEN1_Pos) /*!< EPWM_T::FDIEN: FDIEN1 Mask */ - -#define EPWM_FDIEN_FDIEN2_Pos (2) /*!< EPWM_T::FDIEN: FDIEN2 Position */ -#define EPWM_FDIEN_FDIEN2_Msk (0x1ul << EPWM_FDIEN_FDIEN2_Pos) /*!< EPWM_T::FDIEN: FDIEN2 Mask */ - -#define EPWM_FDIEN_FDIEN3_Pos (3) /*!< EPWM_T::FDIEN: FDIEN3 Position */ -#define EPWM_FDIEN_FDIEN3_Msk (0x1ul << EPWM_FDIEN_FDIEN3_Pos) /*!< EPWM_T::FDIEN: FDIEN3 Mask */ - -#define EPWM_FDIEN_FDIEN4_Pos (4) /*!< EPWM_T::FDIEN: FDIEN4 Position */ -#define EPWM_FDIEN_FDIEN4_Msk (0x1ul << EPWM_FDIEN_FDIEN4_Pos) /*!< EPWM_T::FDIEN: FDIEN4 Mask */ - -#define EPWM_FDIEN_FDIEN5_Pos (5) /*!< EPWM_T::FDIEN: FDIEN5 Position */ -#define EPWM_FDIEN_FDIEN5_Msk (0x1ul << EPWM_FDIEN_FDIEN5_Pos) /*!< EPWM_T::FDIEN: FDIEN5 Mask */ - -#define EPWM_FDSTS_FDIF0_Pos (0) /*!< EPWM_T::FDSTS: FDIF0 Position */ -#define EPWM_FDSTS_FDIF0_Msk (0x1ul << EPWM_FDSTS_FDIF0_Pos) /*!< EPWM_T::FDSTS: FDIF0 Mask */ - -#define EPWM_FDSTS_FDIF1_Pos (1) /*!< EPWM_T::FDSTS: FDIF1 Position */ -#define EPWM_FDSTS_FDIF1_Msk (0x1ul << EPWM_FDSTS_FDIF1_Pos) /*!< EPWM_T::FDSTS: FDIF1 Mask */ - -#define EPWM_FDSTS_FDIF2_Pos (2) /*!< EPWM_T::FDSTS: FDIF2 Position */ -#define EPWM_FDSTS_FDIF2_Msk (0x1ul << EPWM_FDSTS_FDIF2_Pos) /*!< EPWM_T::FDSTS: FDIF2 Mask */ - -#define EPWM_FDSTS_FDIF3_Pos (3) /*!< EPWM_T::FDSTS: FDIF3 Position */ -#define EPWM_FDSTS_FDIF3_Msk (0x1ul << EPWM_FDSTS_FDIF3_Pos) /*!< EPWM_T::FDSTS: FDIF3 Mask */ - -#define EPWM_FDSTS_FDIF4_Pos (4) /*!< EPWM_T::FDSTS: FDIF4 Position */ -#define EPWM_FDSTS_FDIF4_Msk (0x1ul << EPWM_FDSTS_FDIF4_Pos) /*!< EPWM_T::FDSTS: FDIF4 Mask */ - -#define EPWM_FDSTS_FDIF5_Pos (5) /*!< EPWM_T::FDSTS: FDIF5 Position */ -#define EPWM_FDSTS_FDIF5_Msk (0x1ul << EPWM_FDSTS_FDIF5_Pos) /*!< EPWM_T::FDSTS: FDIF5 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN0_Pos (0) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Position */ -#define EPWM_EADCPSCCTL_PSCEN0_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN0_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN1_Pos (1) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Position */ -#define EPWM_EADCPSCCTL_PSCEN1_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN1_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN2_Pos (2) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Position */ -#define EPWM_EADCPSCCTL_PSCEN2_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN2_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN3_Pos (3) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Position */ -#define EPWM_EADCPSCCTL_PSCEN3_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN3_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN4_Pos (4) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Position */ -#define EPWM_EADCPSCCTL_PSCEN4_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN4_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN5_Pos (5) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Position */ -#define EPWM_EADCPSCCTL_PSCEN5_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN5_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Mask */ - -#define EPWM_EADCPSC0_EADCPSC0_Pos (0) /*!< EPWM_T::EADCPSC0: EADCPSC0 Position */ -#define EPWM_EADCPSC0_EADCPSC0_Msk (0xful << EPWM_EADCPSC0_EADCPSC0_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC0 Mask */ - -#define EPWM_EADCPSC0_EADCPSC1_Pos (8) /*!< EPWM_T::EADCPSC0: EADCPSC1 Position */ -#define EPWM_EADCPSC0_EADCPSC1_Msk (0xful << EPWM_EADCPSC0_EADCPSC1_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC1 Mask */ - -#define EPWM_EADCPSC0_EADCPSC2_Pos (16) /*!< EPWM_T::EADCPSC0: EADCPSC2 Position */ -#define EPWM_EADCPSC0_EADCPSC2_Msk (0xful << EPWM_EADCPSC0_EADCPSC2_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC2 Mask */ - -#define EPWM_EADCPSC0_EADCPSC3_Pos (24) /*!< EPWM_T::EADCPSC0: EADCPSC3 Position */ -#define EPWM_EADCPSC0_EADCPSC3_Msk (0xful << EPWM_EADCPSC0_EADCPSC3_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC3 Mask */ - -#define EPWM_EADCPSC1_EADCPSC4_Pos (0) /*!< EPWM_T::EADCPSC1: EADCPSC4 Position */ -#define EPWM_EADCPSC1_EADCPSC4_Msk (0xful << EPWM_EADCPSC1_EADCPSC4_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC4 Mask */ - -#define EPWM_EADCPSC1_EADCPSC5_Pos (8) /*!< EPWM_T::EADCPSC1: EADCPSC5 Position */ -#define EPWM_EADCPSC1_EADCPSC5_Msk (0xful << EPWM_EADCPSC1_EADCPSC5_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC5 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT0_Pos (0) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Position */ -#define EPWM_EADCPSCNT0_PSCNT0_Msk (0xful << EPWM_EADCPSCNT0_PSCNT0_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT1_Pos (8) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Position */ -#define EPWM_EADCPSCNT0_PSCNT1_Msk (0xful << EPWM_EADCPSCNT0_PSCNT1_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT2_Pos (16) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Position */ -#define EPWM_EADCPSCNT0_PSCNT2_Msk (0xful << EPWM_EADCPSCNT0_PSCNT2_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT3_Pos (24) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Position */ -#define EPWM_EADCPSCNT0_PSCNT3_Msk (0xful << EPWM_EADCPSCNT0_PSCNT3_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT4_Pos (0) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Position */ -#define EPWM_EADCPSCNT1_PSCNT4_Msk (0xful << EPWM_EADCPSCNT1_PSCNT4_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT5_Pos (8) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Position */ -#define EPWM_EADCPSCNT1_PSCNT5_Msk (0xful << EPWM_EADCPSCNT1_PSCNT5_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Mask */ - -#define EPWM_CAPINEN_CAPINEN0_Pos (0) /*!< EPWM_T::CAPINEN: CAPINEN0 Position */ -#define EPWM_CAPINEN_CAPINEN0_Msk (0x1ul << EPWM_CAPINEN_CAPINEN0_Pos) /*!< EPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define EPWM_CAPINEN_CAPINEN1_Pos (1) /*!< EPWM_T::CAPINEN: CAPINEN1 Position */ -#define EPWM_CAPINEN_CAPINEN1_Msk (0x1ul << EPWM_CAPINEN_CAPINEN1_Pos) /*!< EPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define EPWM_CAPINEN_CAPINEN2_Pos (2) /*!< EPWM_T::CAPINEN: CAPINEN2 Position */ -#define EPWM_CAPINEN_CAPINEN2_Msk (0x1ul << EPWM_CAPINEN_CAPINEN2_Pos) /*!< EPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define EPWM_CAPINEN_CAPINEN3_Pos (3) /*!< EPWM_T::CAPINEN: CAPINEN3 Position */ -#define EPWM_CAPINEN_CAPINEN3_Msk (0x1ul << EPWM_CAPINEN_CAPINEN3_Pos) /*!< EPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define EPWM_CAPINEN_CAPINEN4_Pos (4) /*!< EPWM_T::CAPINEN: CAPINEN4 Position */ -#define EPWM_CAPINEN_CAPINEN4_Msk (0x1ul << EPWM_CAPINEN_CAPINEN4_Pos) /*!< EPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define EPWM_CAPINEN_CAPINEN5_Pos (5) /*!< EPWM_T::CAPINEN: CAPINEN5 Position */ -#define EPWM_CAPINEN_CAPINEN5_Msk (0x1ul << EPWM_CAPINEN_CAPINEN5_Pos) /*!< EPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define EPWM_CAPCTL_CAPEN0_Pos (0) /*!< EPWM_T::CAPCTL: CAPEN0 Position */ -#define EPWM_CAPCTL_CAPEN0_Msk (0x1ul << EPWM_CAPCTL_CAPEN0_Pos) /*!< EPWM_T::CAPCTL: CAPEN0 Mask */ - -#define EPWM_CAPCTL_CAPEN1_Pos (1) /*!< EPWM_T::CAPCTL: CAPEN1 Position */ -#define EPWM_CAPCTL_CAPEN1_Msk (0x1ul << EPWM_CAPCTL_CAPEN1_Pos) /*!< EPWM_T::CAPCTL: CAPEN1 Mask */ - -#define EPWM_CAPCTL_CAPEN2_Pos (2) /*!< EPWM_T::CAPCTL: CAPEN2 Position */ -#define EPWM_CAPCTL_CAPEN2_Msk (0x1ul << EPWM_CAPCTL_CAPEN2_Pos) /*!< EPWM_T::CAPCTL: CAPEN2 Mask */ - -#define EPWM_CAPCTL_CAPEN3_Pos (3) /*!< EPWM_T::CAPCTL: CAPEN3 Position */ -#define EPWM_CAPCTL_CAPEN3_Msk (0x1ul << EPWM_CAPCTL_CAPEN3_Pos) /*!< EPWM_T::CAPCTL: CAPEN3 Mask */ - -#define EPWM_CAPCTL_CAPEN4_Pos (4) /*!< EPWM_T::CAPCTL: CAPEN4 Position */ -#define EPWM_CAPCTL_CAPEN4_Msk (0x1ul << EPWM_CAPCTL_CAPEN4_Pos) /*!< EPWM_T::CAPCTL: CAPEN4 Mask */ - -#define EPWM_CAPCTL_CAPEN5_Pos (5) /*!< EPWM_T::CAPCTL: CAPEN5 Position */ -#define EPWM_CAPCTL_CAPEN5_Msk (0x1ul << EPWM_CAPCTL_CAPEN5_Pos) /*!< EPWM_T::CAPCTL: CAPEN5 Mask */ - -#define EPWM_CAPCTL_CAPINV0_Pos (8) /*!< EPWM_T::CAPCTL: CAPINV0 Position */ -#define EPWM_CAPCTL_CAPINV0_Msk (0x1ul << EPWM_CAPCTL_CAPINV0_Pos) /*!< EPWM_T::CAPCTL: CAPINV0 Mask */ - -#define EPWM_CAPCTL_CAPINV1_Pos (9) /*!< EPWM_T::CAPCTL: CAPINV1 Position */ -#define EPWM_CAPCTL_CAPINV1_Msk (0x1ul << EPWM_CAPCTL_CAPINV1_Pos) /*!< EPWM_T::CAPCTL: CAPINV1 Mask */ - -#define EPWM_CAPCTL_CAPINV2_Pos (10) /*!< EPWM_T::CAPCTL: CAPINV2 Position */ -#define EPWM_CAPCTL_CAPINV2_Msk (0x1ul << EPWM_CAPCTL_CAPINV2_Pos) /*!< EPWM_T::CAPCTL: CAPINV2 Mask */ - -#define EPWM_CAPCTL_CAPINV3_Pos (11) /*!< EPWM_T::CAPCTL: CAPINV3 Position */ -#define EPWM_CAPCTL_CAPINV3_Msk (0x1ul << EPWM_CAPCTL_CAPINV3_Pos) /*!< EPWM_T::CAPCTL: CAPINV3 Mask */ - -#define EPWM_CAPCTL_CAPINV4_Pos (12) /*!< EPWM_T::CAPCTL: CAPINV4 Position */ -#define EPWM_CAPCTL_CAPINV4_Msk (0x1ul << EPWM_CAPCTL_CAPINV4_Pos) /*!< EPWM_T::CAPCTL: CAPINV4 Mask */ - -#define EPWM_CAPCTL_CAPINV5_Pos (13) /*!< EPWM_T::CAPCTL: CAPINV5 Position */ -#define EPWM_CAPCTL_CAPINV5_Msk (0x1ul << EPWM_CAPCTL_CAPINV5_Pos) /*!< EPWM_T::CAPCTL: CAPINV5 Mask */ - -#define EPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< EPWM_T::CAPCTL: RCRLDEN0 Position */ -#define EPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define EPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< EPWM_T::CAPCTL: RCRLDEN1 Position */ -#define EPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define EPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< EPWM_T::CAPCTL: RCRLDEN2 Position */ -#define EPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define EPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< EPWM_T::CAPCTL: RCRLDEN3 Position */ -#define EPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define EPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< EPWM_T::CAPCTL: RCRLDEN4 Position */ -#define EPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define EPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< EPWM_T::CAPCTL: RCRLDEN5 Position */ -#define EPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define EPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< EPWM_T::CAPCTL: FCRLDEN0 Position */ -#define EPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define EPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< EPWM_T::CAPCTL: FCRLDEN1 Position */ -#define EPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define EPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< EPWM_T::CAPCTL: FCRLDEN2 Position */ -#define EPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define EPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< EPWM_T::CAPCTL: FCRLDEN3 Position */ -#define EPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define EPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< EPWM_T::CAPCTL: FCRLDEN4 Position */ -#define EPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define EPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< EPWM_T::CAPCTL: FCRLDEN5 Position */ -#define EPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define EPWM_CAPSTS_CRLIFOV0_Pos (0) /*!< EPWM_T::CAPSTS: CRLIFOV0 Position */ -#define EPWM_CAPSTS_CRLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV0 Mask */ - -#define EPWM_CAPSTS_CRLIFOV1_Pos (1) /*!< EPWM_T::CAPSTS: CRLIFOV1 Position */ -#define EPWM_CAPSTS_CRLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV1 Mask */ - -#define EPWM_CAPSTS_CRLIFOV2_Pos (2) /*!< EPWM_T::CAPSTS: CRLIFOV2 Position */ -#define EPWM_CAPSTS_CRLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV2 Mask */ - -#define EPWM_CAPSTS_CRLIFOV3_Pos (3) /*!< EPWM_T::CAPSTS: CRLIFOV3 Position */ -#define EPWM_CAPSTS_CRLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV3 Mask */ - -#define EPWM_CAPSTS_CRLIFOV4_Pos (4) /*!< EPWM_T::CAPSTS: CRLIFOV4 Position */ -#define EPWM_CAPSTS_CRLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV4 Mask */ - -#define EPWM_CAPSTS_CRLIFOV5_Pos (5) /*!< EPWM_T::CAPSTS: CRLIFOV5 Position */ -#define EPWM_CAPSTS_CRLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV5 Mask */ - -#define EPWM_CAPSTS_CFLIFOV0_Pos (8) /*!< EPWM_T::CAPSTS: CFLIFOV0 Position */ -#define EPWM_CAPSTS_CFLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV0 Mask */ - -#define EPWM_CAPSTS_CFLIFOV1_Pos (9) /*!< EPWM_T::CAPSTS: CFLIFOV1 Position */ -#define EPWM_CAPSTS_CFLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV1 Mask */ - -#define EPWM_CAPSTS_CFLIFOV2_Pos (10) /*!< EPWM_T::CAPSTS: CFLIFOV2 Position */ -#define EPWM_CAPSTS_CFLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV2 Mask */ - -#define EPWM_CAPSTS_CFLIFOV3_Pos (11) /*!< EPWM_T::CAPSTS: CFLIFOV3 Position */ -#define EPWM_CAPSTS_CFLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV3 Mask */ - -#define EPWM_CAPSTS_CFLIFOV4_Pos (12) /*!< EPWM_T::CAPSTS: CFLIFOV4 Position */ -#define EPWM_CAPSTS_CFLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV4 Mask */ - -#define EPWM_CAPSTS_CFLIFOV5_Pos (13) /*!< EPWM_T::CAPSTS: CFLIFOV5 Position */ -#define EPWM_CAPSTS_CFLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV5 Mask */ - -#define EPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT0: RCAPDAT Position */ -#define EPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT0_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define EPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT0: FCAPDAT Position */ -#define EPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT0_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define EPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT1: RCAPDAT Position */ -#define EPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT1_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define EPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT1: FCAPDAT Position */ -#define EPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT1_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define EPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT2: RCAPDAT Position */ -#define EPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT2_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define EPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT2: FCAPDAT Position */ -#define EPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT2_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define EPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT3: RCAPDAT Position */ -#define EPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT3_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define EPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT3: FCAPDAT Position */ -#define EPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT3_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define EPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT4: RCAPDAT Position */ -#define EPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT4_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define EPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT4: FCAPDAT Position */ -#define EPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT4_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define EPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT5: RCAPDAT Position */ -#define EPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT5_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define EPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT5: FCAPDAT Position */ -#define EPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT5_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define EPWM_PDMACTL_CHEN0_1_Pos (0) /*!< EPWM_T::PDMACTL: CHEN0_1 Position */ -#define EPWM_PDMACTL_CHEN0_1_Msk (0x1ul << EPWM_PDMACTL_CHEN0_1_Pos) /*!< EPWM_T::PDMACTL: CHEN0_1 Mask */ - -#define EPWM_PDMACTL_CAPMOD0_1_Pos (1) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Position */ -#define EPWM_PDMACTL_CAPMOD0_1_Msk (0x3ul << EPWM_PDMACTL_CAPMOD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Mask */ - -#define EPWM_PDMACTL_CAPORD0_1_Pos (3) /*!< EPWM_T::PDMACTL: CAPORD0_1 Position */ -#define EPWM_PDMACTL_CAPORD0_1_Msk (0x1ul << EPWM_PDMACTL_CAPORD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPORD0_1 Mask */ - -#define EPWM_PDMACTL_CHSEL0_1_Pos (4) /*!< EPWM_T::PDMACTL: CHSEL0_1 Position */ -#define EPWM_PDMACTL_CHSEL0_1_Msk (0x1ul << EPWM_PDMACTL_CHSEL0_1_Pos) /*!< EPWM_T::PDMACTL: CHSEL0_1 Mask */ - -#define EPWM_PDMACTL_CHEN2_3_Pos (8) /*!< EPWM_T::PDMACTL: CHEN2_3 Position */ -#define EPWM_PDMACTL_CHEN2_3_Msk (0x1ul << EPWM_PDMACTL_CHEN2_3_Pos) /*!< EPWM_T::PDMACTL: CHEN2_3 Mask */ - -#define EPWM_PDMACTL_CAPMOD2_3_Pos (9) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Position */ -#define EPWM_PDMACTL_CAPMOD2_3_Msk (0x3ul << EPWM_PDMACTL_CAPMOD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Mask */ - -#define EPWM_PDMACTL_CAPORD2_3_Pos (11) /*!< EPWM_T::PDMACTL: CAPORD2_3 Position */ -#define EPWM_PDMACTL_CAPORD2_3_Msk (0x1ul << EPWM_PDMACTL_CAPORD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPORD2_3 Mask */ - -#define EPWM_PDMACTL_CHSEL2_3_Pos (12) /*!< EPWM_T::PDMACTL: CHSEL2_3 Position */ -#define EPWM_PDMACTL_CHSEL2_3_Msk (0x1ul << EPWM_PDMACTL_CHSEL2_3_Pos) /*!< EPWM_T::PDMACTL: CHSEL2_3 Mask */ - -#define EPWM_PDMACTL_CHEN4_5_Pos (16) /*!< EPWM_T::PDMACTL: CHEN4_5 Position */ -#define EPWM_PDMACTL_CHEN4_5_Msk (0x1ul << EPWM_PDMACTL_CHEN4_5_Pos) /*!< EPWM_T::PDMACTL: CHEN4_5 Mask */ - -#define EPWM_PDMACTL_CAPMOD4_5_Pos (17) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Position */ -#define EPWM_PDMACTL_CAPMOD4_5_Msk (0x3ul << EPWM_PDMACTL_CAPMOD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Mask */ - -#define EPWM_PDMACTL_CAPORD4_5_Pos (19) /*!< EPWM_T::PDMACTL: CAPORD4_5 Position */ -#define EPWM_PDMACTL_CAPORD4_5_Msk (0x1ul << EPWM_PDMACTL_CAPORD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPORD4_5 Mask */ - -#define EPWM_PDMACTL_CHSEL4_5_Pos (20) /*!< EPWM_T::PDMACTL: CHSEL4_5 Position */ -#define EPWM_PDMACTL_CHSEL4_5_Msk (0x1ul << EPWM_PDMACTL_CHSEL4_5_Pos) /*!< EPWM_T::PDMACTL: CHSEL4_5 Mask */ - -#define EPWM_PDMACAP0_1_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP0_1: CAPBUF Position */ -#define EPWM_PDMACAP0_1_CAPBUF_Msk (0xfffful << EPWM_PDMACAP0_1_CAPBUF_Pos) /*!< EPWM_T::PDMACAP0_1: CAPBUF Mask */ - -#define EPWM_PDMACAP2_3_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP2_3: CAPBUF Position */ -#define EPWM_PDMACAP2_3_CAPBUF_Msk (0xfffful << EPWM_PDMACAP2_3_CAPBUF_Pos) /*!< EPWM_T::PDMACAP2_3: CAPBUF Mask */ - -#define EPWM_PDMACAP4_5_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP4_5: CAPBUF Position */ -#define EPWM_PDMACAP4_5_CAPBUF_Msk (0xfffful << EPWM_PDMACAP4_5_CAPBUF_Pos) /*!< EPWM_T::PDMACAP4_5: CAPBUF Mask */ - -#define EPWM_CAPIEN_CAPRIEN0_Pos (0) /*!< EPWM_T::CAPIEN: CAPRIEN0 Position */ -#define EPWM_CAPIEN_CAPRIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN0 Mask */ - -#define EPWM_CAPIEN_CAPRIEN1_Pos (1) /*!< EPWM_T::CAPIEN: CAPRIEN1 Position */ -#define EPWM_CAPIEN_CAPRIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN1 Mask */ - -#define EPWM_CAPIEN_CAPRIEN2_Pos (2) /*!< EPWM_T::CAPIEN: CAPRIEN2 Position */ -#define EPWM_CAPIEN_CAPRIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN2 Mask */ - -#define EPWM_CAPIEN_CAPRIEN3_Pos (3) /*!< EPWM_T::CAPIEN: CAPRIEN3 Position */ -#define EPWM_CAPIEN_CAPRIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN3 Mask */ - -#define EPWM_CAPIEN_CAPRIEN4_Pos (4) /*!< EPWM_T::CAPIEN: CAPRIEN4 Position */ -#define EPWM_CAPIEN_CAPRIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN4 Mask */ - -#define EPWM_CAPIEN_CAPRIEN5_Pos (5) /*!< EPWM_T::CAPIEN: CAPRIEN5 Position */ -#define EPWM_CAPIEN_CAPRIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN5 Mask */ - -#define EPWM_CAPIEN_CAPFIEN0_Pos (8) /*!< EPWM_T::CAPIEN: CAPFIEN0 Position */ -#define EPWM_CAPIEN_CAPFIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN0 Mask */ - -#define EPWM_CAPIEN_CAPFIEN1_Pos (9) /*!< EPWM_T::CAPIEN: CAPFIEN1 Position */ -#define EPWM_CAPIEN_CAPFIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN1 Mask */ - -#define EPWM_CAPIEN_CAPFIEN2_Pos (10) /*!< EPWM_T::CAPIEN: CAPFIEN2 Position */ -#define EPWM_CAPIEN_CAPFIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN2 Mask */ - -#define EPWM_CAPIEN_CAPFIEN3_Pos (11) /*!< EPWM_T::CAPIEN: CAPFIEN3 Position */ -#define EPWM_CAPIEN_CAPFIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN3 Mask */ - -#define EPWM_CAPIEN_CAPFIEN4_Pos (12) /*!< EPWM_T::CAPIEN: CAPFIEN4 Position */ -#define EPWM_CAPIEN_CAPFIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN4 Mask */ - -#define EPWM_CAPIEN_CAPFIEN5_Pos (13) /*!< EPWM_T::CAPIEN: CAPFIEN5 Position */ -#define EPWM_CAPIEN_CAPFIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN5 Mask */ - -#define EPWM_CAPIF_CRLIF0_Pos (0) /*!< EPWM_T::CAPIF: CRLIF0 Position */ -#define EPWM_CAPIF_CRLIF0_Msk (0x1ul << EPWM_CAPIF_CRLIF0_Pos) /*!< EPWM_T::CAPIF: CRLIF0 Mask */ - -#define EPWM_CAPIF_CRLIF1_Pos (1) /*!< EPWM_T::CAPIF: CRLIF1 Position */ -#define EPWM_CAPIF_CRLIF1_Msk (0x1ul << EPWM_CAPIF_CRLIF1_Pos) /*!< EPWM_T::CAPIF: CRLIF1 Mask */ - -#define EPWM_CAPIF_CRLIF2_Pos (2) /*!< EPWM_T::CAPIF: CRLIF2 Position */ -#define EPWM_CAPIF_CRLIF2_Msk (0x1ul << EPWM_CAPIF_CRLIF2_Pos) /*!< EPWM_T::CAPIF: CRLIF2 Mask */ - -#define EPWM_CAPIF_CRLIF3_Pos (3) /*!< EPWM_T::CAPIF: CRLIF3 Position */ -#define EPWM_CAPIF_CRLIF3_Msk (0x1ul << EPWM_CAPIF_CRLIF3_Pos) /*!< EPWM_T::CAPIF: CRLIF3 Mask */ - -#define EPWM_CAPIF_CRLIF4_Pos (4) /*!< EPWM_T::CAPIF: CRLIF4 Position */ -#define EPWM_CAPIF_CRLIF4_Msk (0x1ul << EPWM_CAPIF_CRLIF4_Pos) /*!< EPWM_T::CAPIF: CRLIF4 Mask */ - -#define EPWM_CAPIF_CRLIF5_Pos (5) /*!< EPWM_T::CAPIF: CRLIF5 Position */ -#define EPWM_CAPIF_CRLIF5_Msk (0x1ul << EPWM_CAPIF_CRLIF5_Pos) /*!< EPWM_T::CAPIF: CRLIF5 Mask */ - -#define EPWM_CAPIF_CFLIF0_Pos (8) /*!< EPWM_T::CAPIF: CFLIF0 Position */ -#define EPWM_CAPIF_CFLIF0_Msk (0x1ul << EPWM_CAPIF_CFLIF0_Pos) /*!< EPWM_T::CAPIF: CFLIF0 Mask */ - -#define EPWM_CAPIF_CFLIF1_Pos (9) /*!< EPWM_T::CAPIF: CFLIF1 Position */ -#define EPWM_CAPIF_CFLIF1_Msk (0x1ul << EPWM_CAPIF_CFLIF1_Pos) /*!< EPWM_T::CAPIF: CFLIF1 Mask */ - -#define EPWM_CAPIF_CFLIF2_Pos (10) /*!< EPWM_T::CAPIF: CFLIF2 Position */ -#define EPWM_CAPIF_CFLIF2_Msk (0x1ul << EPWM_CAPIF_CFLIF2_Pos) /*!< EPWM_T::CAPIF: CFLIF2 Mask */ - -#define EPWM_CAPIF_CFLIF3_Pos (11) /*!< EPWM_T::CAPIF: CFLIF3 Position */ -#define EPWM_CAPIF_CFLIF3_Msk (0x1ul << EPWM_CAPIF_CFLIF3_Pos) /*!< EPWM_T::CAPIF: CFLIF3 Mask */ - -#define EPWM_CAPIF_CFLIF4_Pos (12) /*!< EPWM_T::CAPIF: CFLIF4 Position */ -#define EPWM_CAPIF_CFLIF4_Msk (0x1ul << EPWM_CAPIF_CFLIF4_Pos) /*!< EPWM_T::CAPIF: CFLIF4 Mask */ - -#define EPWM_CAPIF_CFLIF5_Pos (13) /*!< EPWM_T::CAPIF: CFLIF5 Position */ -#define EPWM_CAPIF_CFLIF5_Msk (0x1ul << EPWM_CAPIF_CFLIF5_Pos) /*!< EPWM_T::CAPIF: CFLIF5 Mask */ - -#define EPWM_CAPNF0_CAPNFEN_Pos (0) /*!< EPWM_T::CAPNF0: CAPNFEN Position */ -#define EPWM_CAPNF0_CAPNFEN_Msk (0x1ul << EPWM_CAPNF0_CAPNFEN_Pos) /*!< EPWM_T::CAPNF0: CAPNFEN Mask */ - -#define EPWM_CAPNF0_CAPNFSEL_Pos (4) /*!< EPWM_T::CAPNF0: CAPNFSEL Position */ -#define EPWM_CAPNF0_CAPNFSEL_Msk (0x7ul << EPWM_CAPNF0_CAPNFSEL_Pos) /*!< EPWM_T::CAPNF0: CAPNFSEL Mask */ - -#define EPWM_CAPNF0_CAPNFCNT_Pos (8) /*!< EPWM_T::CAPNF0: CAPNFCNT Position */ -#define EPWM_CAPNF0_CAPNFCNT_Msk (0x7ul << EPWM_CAPNF0_CAPNFCNT_Pos) /*!< EPWM_T::CAPNF0: CAPNFCNT Mask */ - -#define EPWM_CAPNF1_CAPNFEN_Pos (0) /*!< EPWM_T::CAPNF1: CAPNFEN Position */ -#define EPWM_CAPNF1_CAPNFEN_Msk (0x1ul << EPWM_CAPNF1_CAPNFEN_Pos) /*!< EPWM_T::CAPNF1: CAPNFEN Mask */ - -#define EPWM_CAPNF1_CAPNFSEL_Pos (4) /*!< EPWM_T::CAPNF1: CAPNFSEL Position */ -#define EPWM_CAPNF1_CAPNFSEL_Msk (0x7ul << EPWM_CAPNF1_CAPNFSEL_Pos) /*!< EPWM_T::CAPNF1: CAPNFSEL Mask */ - -#define EPWM_CAPNF1_CAPNFCNT_Pos (8) /*!< EPWM_T::CAPNF1: CAPNFCNT Position */ -#define EPWM_CAPNF1_CAPNFCNT_Msk (0x7ul << EPWM_CAPNF1_CAPNFCNT_Pos) /*!< EPWM_T::CAPNF1: CAPNFCNT Mask */ - -#define EPWM_CAPNF2_CAPNFEN_Pos (0) /*!< EPWM_T::CAPNF2: CAPNFEN Position */ -#define EPWM_CAPNF2_CAPNFEN_Msk (0x1ul << EPWM_CAPNF2_CAPNFEN_Pos) /*!< EPWM_T::CAPNF2: CAPNFEN Mask */ - -#define EPWM_CAPNF2_CAPNFSEL_Pos (4) /*!< EPWM_T::CAPNF2: CAPNFSEL Position */ -#define EPWM_CAPNF2_CAPNFSEL_Msk (0x7ul << EPWM_CAPNF2_CAPNFSEL_Pos) /*!< EPWM_T::CAPNF2: CAPNFSEL Mask */ - -#define EPWM_CAPNF2_CAPNFCNT_Pos (8) /*!< EPWM_T::CAPNF2: CAPNFCNT Position */ -#define EPWM_CAPNF2_CAPNFCNT_Msk (0x7ul << EPWM_CAPNF2_CAPNFCNT_Pos) /*!< EPWM_T::CAPNF2: CAPNFCNT Mask */ - -#define EPWM_CAPNF3_CAPNFEN_Pos (0) /*!< EPWM_T::CAPNF3: CAPNFEN Position */ -#define EPWM_CAPNF3_CAPNFEN_Msk (0x1ul << EPWM_CAPNF3_CAPNFEN_Pos) /*!< EPWM_T::CAPNF3: CAPNFEN Mask */ - -#define EPWM_CAPNF3_CAPNFSEL_Pos (4) /*!< EPWM_T::CAPNF3: CAPNFSEL Position */ -#define EPWM_CAPNF3_CAPNFSEL_Msk (0x7ul << EPWM_CAPNF3_CAPNFSEL_Pos) /*!< EPWM_T::CAPNF3: CAPNFSEL Mask */ - -#define EPWM_CAPNF3_CAPNFCNT_Pos (8) /*!< EPWM_T::CAPNF3: CAPNFCNT Position */ -#define EPWM_CAPNF3_CAPNFCNT_Msk (0x7ul << EPWM_CAPNF3_CAPNFCNT_Pos) /*!< EPWM_T::CAPNF3: CAPNFCNT Mask */ - -#define EPWM_CAPNF4_CAPNFEN_Pos (0) /*!< EPWM_T::CAPNF4: CAPNFEN Position */ -#define EPWM_CAPNF4_CAPNFEN_Msk (0x1ul << EPWM_CAPNF4_CAPNFEN_Pos) /*!< EPWM_T::CAPNF4: CAPNFEN Mask */ - -#define EPWM_CAPNF4_CAPNFSEL_Pos (4) /*!< EPWM_T::CAPNF4: CAPNFSEL Position */ -#define EPWM_CAPNF4_CAPNFSEL_Msk (0x7ul << EPWM_CAPNF4_CAPNFSEL_Pos) /*!< EPWM_T::CAPNF4: CAPNFSEL Mask */ - -#define EPWM_CAPNF4_CAPNFCNT_Pos (8) /*!< EPWM_T::CAPNF4: CAPNFCNT Position */ -#define EPWM_CAPNF4_CAPNFCNT_Msk (0x7ul << EPWM_CAPNF4_CAPNFCNT_Pos) /*!< EPWM_T::CAPNF4: CAPNFCNT Mask */ - -#define EPWM_CAPNF5_CAPNFEN_Pos (0) /*!< EPWM_T::CAPNF5: CAPNFEN Position */ -#define EPWM_CAPNF5_CAPNFEN_Msk (0x1ul << EPWM_CAPNF5_CAPNFEN_Pos) /*!< EPWM_T::CAPNF5: CAPNFEN Mask */ - -#define EPWM_CAPNF5_CAPNFSEL_Pos (4) /*!< EPWM_T::CAPNF5: CAPNFSEL Position */ -#define EPWM_CAPNF5_CAPNFSEL_Msk (0x7ul << EPWM_CAPNF5_CAPNFSEL_Pos) /*!< EPWM_T::CAPNF5: CAPNFSEL Mask */ - -#define EPWM_CAPNF5_CAPNFCNT_Pos (8) /*!< EPWM_T::CAPNF5: CAPNFCNT Position */ -#define EPWM_CAPNF5_CAPNFCNT_Msk (0x7ul << EPWM_CAPNF5_CAPNFCNT_Pos) /*!< EPWM_T::CAPNF5: CAPNFCNT Mask */ - -#define EPWM_EXTETCTL0_EXETEN_Pos (0) /*!< EPWM_T::EXTETCTL0: EXETEN Position */ -#define EPWM_EXTETCTL0_EXETEN_Msk (0x1ul << EPWM_EXTETCTL0_EXETEN_Pos) /*!< EPWM_T::EXTETCTL0: EXETEN Mask */ - -#define EPWM_EXTETCTL0_CNTACTS_Pos (4) /*!< EPWM_T::EXTETCTL0: CNTACTS Position */ -#define EPWM_EXTETCTL0_CNTACTS_Msk (0x3ul << EPWM_EXTETCTL0_CNTACTS_Pos) /*!< EPWM_T::EXTETCTL0: CNTACTS Mask */ - -#define EPWM_EXTETCTL0_EXTTRGS_Pos (8) /*!< EPWM_T::EXTETCTL0: EXTTRGS Position */ -#define EPWM_EXTETCTL0_EXTTRGS_Msk (0xful << EPWM_EXTETCTL0_EXTTRGS_Pos) /*!< EPWM_T::EXTETCTL0: EXTTRGS Mask */ - -#define EPWM_EXTETCTL1_EXETEN_Pos (0) /*!< EPWM_T::EXTETCTL1: EXETEN Position */ -#define EPWM_EXTETCTL1_EXETEN_Msk (0x1ul << EPWM_EXTETCTL1_EXETEN_Pos) /*!< EPWM_T::EXTETCTL1: EXETEN Mask */ - -#define EPWM_EXTETCTL1_CNTACTS_Pos (4) /*!< EPWM_T::EXTETCTL1: CNTACTS Position */ -#define EPWM_EXTETCTL1_CNTACTS_Msk (0x3ul << EPWM_EXTETCTL1_CNTACTS_Pos) /*!< EPWM_T::EXTETCTL1: CNTACTS Mask */ - -#define EPWM_EXTETCTL1_EXTTRGS_Pos (8) /*!< EPWM_T::EXTETCTL1: EXTTRGS Position */ -#define EPWM_EXTETCTL1_EXTTRGS_Msk (0xful << EPWM_EXTETCTL1_EXTTRGS_Pos) /*!< EPWM_T::EXTETCTL1: EXTTRGS Mask */ - -#define EPWM_EXTETCTL2_EXETEN_Pos (0) /*!< EPWM_T::EXTETCTL2: EXETEN Position */ -#define EPWM_EXTETCTL2_EXETEN_Msk (0x1ul << EPWM_EXTETCTL2_EXETEN_Pos) /*!< EPWM_T::EXTETCTL2: EXETEN Mask */ - -#define EPWM_EXTETCTL2_CNTACTS_Pos (4) /*!< EPWM_T::EXTETCTL2: CNTACTS Position */ -#define EPWM_EXTETCTL2_CNTACTS_Msk (0x3ul << EPWM_EXTETCTL2_CNTACTS_Pos) /*!< EPWM_T::EXTETCTL2: CNTACTS Mask */ - -#define EPWM_EXTETCTL2_EXTTRGS_Pos (8) /*!< EPWM_T::EXTETCTL2: EXTTRGS Position */ -#define EPWM_EXTETCTL2_EXTTRGS_Msk (0xful << EPWM_EXTETCTL2_EXTTRGS_Pos) /*!< EPWM_T::EXTETCTL2: EXTTRGS Mask */ - -#define EPWM_EXTETCTL3_EXETEN_Pos (0) /*!< EPWM_T::EXTETCTL3: EXETEN Position */ -#define EPWM_EXTETCTL3_EXETEN_Msk (0x1ul << EPWM_EXTETCTL3_EXETEN_Pos) /*!< EPWM_T::EXTETCTL3: EXETEN Mask */ - -#define EPWM_EXTETCTL3_CNTACTS_Pos (4) /*!< EPWM_T::EXTETCTL3: CNTACTS Position */ -#define EPWM_EXTETCTL3_CNTACTS_Msk (0x3ul << EPWM_EXTETCTL3_CNTACTS_Pos) /*!< EPWM_T::EXTETCTL3: CNTACTS Mask */ - -#define EPWM_EXTETCTL3_EXTTRGS_Pos (8) /*!< EPWM_T::EXTETCTL3: EXTTRGS Position */ -#define EPWM_EXTETCTL3_EXTTRGS_Msk (0xful << EPWM_EXTETCTL3_EXTTRGS_Pos) /*!< EPWM_T::EXTETCTL3: EXTTRGS Mask */ - -#define EPWM_EXTETCTL4_EXETEN_Pos (0) /*!< EPWM_T::EXTETCTL4: EXETEN Position */ -#define EPWM_EXTETCTL4_EXETEN_Msk (0x1ul << EPWM_EXTETCTL4_EXETEN_Pos) /*!< EPWM_T::EXTETCTL4: EXETEN Mask */ - -#define EPWM_EXTETCTL4_CNTACTS_Pos (4) /*!< EPWM_T::EXTETCTL4: CNTACTS Position */ -#define EPWM_EXTETCTL4_CNTACTS_Msk (0x3ul << EPWM_EXTETCTL4_CNTACTS_Pos) /*!< EPWM_T::EXTETCTL4: CNTACTS Mask */ - -#define EPWM_EXTETCTL4_EXTTRGS_Pos (8) /*!< EPWM_T::EXTETCTL4: EXTTRGS Position */ -#define EPWM_EXTETCTL4_EXTTRGS_Msk (0xful << EPWM_EXTETCTL4_EXTTRGS_Pos) /*!< EPWM_T::EXTETCTL4: EXTTRGS Mask */ - -#define EPWM_EXTETCTL5_EXETEN_Pos (0) /*!< EPWM_T::EXTETCTL5: EXETEN Position */ -#define EPWM_EXTETCTL5_EXETEN_Msk (0x1ul << EPWM_EXTETCTL5_EXETEN_Pos) /*!< EPWM_T::EXTETCTL5: EXETEN Mask */ - -#define EPWM_EXTETCTL5_CNTACTS_Pos (4) /*!< EPWM_T::EXTETCTL5: CNTACTS Position */ -#define EPWM_EXTETCTL5_CNTACTS_Msk (0x3ul << EPWM_EXTETCTL5_CNTACTS_Pos) /*!< EPWM_T::EXTETCTL5: CNTACTS Mask */ - -#define EPWM_EXTETCTL5_EXTTRGS_Pos (8) /*!< EPWM_T::EXTETCTL5: EXTTRGS Position */ -#define EPWM_EXTETCTL5_EXTTRGS_Msk (0xful << EPWM_EXTETCTL5_EXTTRGS_Pos) /*!< EPWM_T::EXTETCTL5: EXTTRGS Mask */ - -#define EPWM_SWEOFCTL_OUTACTS0_Pos (0) /*!< EPWM_T::SWEOFCTL: OUTACTS0 Position */ -#define EPWM_SWEOFCTL_OUTACTS0_Msk (0x3ul << EPWM_SWEOFCTL_OUTACTS0_Pos) /*!< EPWM_T::SWEOFCTL: OUTACTS0 Mask */ - -#define EPWM_SWEOFCTL_OUTACTS1_Pos (2) /*!< EPWM_T::SWEOFCTL: OUTACTS1 Position */ -#define EPWM_SWEOFCTL_OUTACTS1_Msk (0x3ul << EPWM_SWEOFCTL_OUTACTS1_Pos) /*!< EPWM_T::SWEOFCTL: OUTACTS1 Mask */ - -#define EPWM_SWEOFCTL_OUTACTS2_Pos (4) /*!< EPWM_T::SWEOFCTL: OUTACTS2 Position */ -#define EPWM_SWEOFCTL_OUTACTS2_Msk (0x3ul << EPWM_SWEOFCTL_OUTACTS2_Pos) /*!< EPWM_T::SWEOFCTL: OUTACTS2 Mask */ - -#define EPWM_SWEOFCTL_OUTACTS3_Pos (6) /*!< EPWM_T::SWEOFCTL: OUTACTS3 Position */ -#define EPWM_SWEOFCTL_OUTACTS3_Msk (0x3ul << EPWM_SWEOFCTL_OUTACTS3_Pos) /*!< EPWM_T::SWEOFCTL: OUTACTS3 Mask */ - -#define EPWM_SWEOFCTL_OUTACTS4_Pos (8) /*!< EPWM_T::SWEOFCTL: OUTACTS4 Position */ -#define EPWM_SWEOFCTL_OUTACTS4_Msk (0x3ul << EPWM_SWEOFCTL_OUTACTS4_Pos) /*!< EPWM_T::SWEOFCTL: OUTACTS4 Mask */ - -#define EPWM_SWEOFCTL_OUTACTS5_Pos (10) /*!< EPWM_T::SWEOFCTL: OUTACTS5 Position */ -#define EPWM_SWEOFCTL_OUTACTS5_Msk (0x3ul << EPWM_SWEOFCTL_OUTACTS5_Pos) /*!< EPWM_T::SWEOFCTL: OUTACTS5 Mask */ - -#define EPWM_SWEOFTRG_SWETRG0_Pos (0) /*!< EPWM_T::SWEOFTRG: SWETRG0 Position */ -#define EPWM_SWEOFTRG_SWETRG0_Msk (0x1ul << EPWM_SWEOFTRG_SWETRG0_Pos) /*!< EPWM_T::SWEOFTRG: SWETRG0 Mask */ - -#define EPWM_SWEOFTRG_SWETRG1_Pos (1) /*!< EPWM_T::SWEOFTRG: SWETRG1 Position */ -#define EPWM_SWEOFTRG_SWETRG1_Msk (0x1ul << EPWM_SWEOFTRG_SWETRG1_Pos) /*!< EPWM_T::SWEOFTRG: SWETRG1 Mask */ - -#define EPWM_SWEOFTRG_SWETRG2_Pos (2) /*!< EPWM_T::SWEOFTRG: SWETRG2 Position */ -#define EPWM_SWEOFTRG_SWETRG2_Msk (0x1ul << EPWM_SWEOFTRG_SWETRG2_Pos) /*!< EPWM_T::SWEOFTRG: SWETRG2 Mask */ - -#define EPWM_SWEOFTRG_SWETRG3_Pos (3) /*!< EPWM_T::SWEOFTRG: SWETRG3 Position */ -#define EPWM_SWEOFTRG_SWETRG3_Msk (0x1ul << EPWM_SWEOFTRG_SWETRG3_Pos) /*!< EPWM_T::SWEOFTRG: SWETRG3 Mask */ - -#define EPWM_SWEOFTRG_SWETRG4_Pos (4) /*!< EPWM_T::SWEOFTRG: SWETRG4 Position */ -#define EPWM_SWEOFTRG_SWETRG4_Msk (0x1ul << EPWM_SWEOFTRG_SWETRG4_Pos) /*!< EPWM_T::SWEOFTRG: SWETRG4 Mask */ - -#define EPWM_SWEOFTRG_SWETRG5_Pos (5) /*!< EPWM_T::SWEOFTRG: SWETRG5 Position */ -#define EPWM_SWEOFTRG_SWETRG5_Msk (0x1ul << EPWM_SWEOFTRG_SWETRG5_Pos) /*!< EPWM_T::SWEOFTRG: SWETRG5 Mask */ - -#define EPWM_CLKPSC0_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC0: CLKPSC Position */ -#define EPWM_CLKPSC0_CLKPSC_Msk (0xffful << EPWM_CLKPSC0_CLKPSC_Pos) /*!< EPWM_T::CLKPSC0: CLKPSC Mask */ - -#define EPWM_CLKPSC1_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC1: CLKPSC Position */ -#define EPWM_CLKPSC1_CLKPSC_Msk (0xffful << EPWM_CLKPSC1_CLKPSC_Pos) /*!< EPWM_T::CLKPSC1: CLKPSC Mask */ - -#define EPWM_CLKPSC2_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC2: CLKPSC Position */ -#define EPWM_CLKPSC2_CLKPSC_Msk (0xffful << EPWM_CLKPSC2_CLKPSC_Pos) /*!< EPWM_T::CLKPSC2: CLKPSC Mask */ - -#define EPWM_CLKPSC3_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC3: CLKPSC Position */ -#define EPWM_CLKPSC3_CLKPSC_Msk (0xffful << EPWM_CLKPSC3_CLKPSC_Pos) /*!< EPWM_T::CLKPSC3: CLKPSC Mask */ - -#define EPWM_CLKPSC4_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC4: CLKPSC Position */ -#define EPWM_CLKPSC4_CLKPSC_Msk (0xffful << EPWM_CLKPSC4_CLKPSC_Pos) /*!< EPWM_T::CLKPSC4: CLKPSC Mask */ - -#define EPWM_CLKPSC5_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC5: CLKPSC Position */ -#define EPWM_CLKPSC5_CLKPSC_Msk (0xffful << EPWM_CLKPSC5_CLKPSC_Pos) /*!< EPWM_T::CLKPSC5: CLKPSC Mask */ - -#define EPWM_RDTCNT0_1_RDTCNT_Pos (0) /*!< EPWM_T::RDTCNT0_1: RDTCNT Position */ -#define EPWM_RDTCNT0_1_RDTCNT_Msk (0xffful << EPWM_RDTCNT0_1_RDTCNT_Pos) /*!< EPWM_T::RDTCNT0_1: RDTCNT Mask */ - -#define EPWM_RDTCNT2_3_RDTCNT_Pos (0) /*!< EPWM_T::RDTCNT2_3: RDTCNT Position */ -#define EPWM_RDTCNT2_3_RDTCNT_Msk (0xffful << EPWM_RDTCNT2_3_RDTCNT_Pos) /*!< EPWM_T::RDTCNT2_3: RDTCNT Mask */ - -#define EPWM_RDTCNT4_5_RDTCNT_Pos (0) /*!< EPWM_T::RDTCNT4_5: RDTCNT Position */ -#define EPWM_RDTCNT4_5_RDTCNT_Msk (0xffful << EPWM_RDTCNT4_5_RDTCNT_Pos) /*!< EPWM_T::RDTCNT4_5: RDTCNT Mask */ - -#define EPWM_FDTCNT0_1_FDTCNT_Pos (0) /*!< EPWM_T::FDTCNT0_1: FDTCNT Position */ -#define EPWM_FDTCNT0_1_FDTCNT_Msk (0xffful << EPWM_FDTCNT0_1_FDTCNT_Pos) /*!< EPWM_T::FDTCNT0_1: FDTCNT Mask */ - -#define EPWM_FDTCNT2_3_FDTCNT_Pos (0) /*!< EPWM_T::FDTCNT2_3: FDTCNT Position */ -#define EPWM_FDTCNT2_3_FDTCNT_Msk (0xffful << EPWM_FDTCNT2_3_FDTCNT_Pos) /*!< EPWM_T::FDTCNT2_3: FDTCNT Mask */ - -#define EPWM_FDTCNT4_5_FDTCNT_Pos (0) /*!< EPWM_T::FDTCNT4_5: FDTCNT Position */ -#define EPWM_FDTCNT4_5_FDTCNT_Msk (0xffful << EPWM_FDTCNT4_5_FDTCNT_Pos) /*!< EPWM_T::FDTCNT4_5: FDTCNT Mask */ - -#define EPWM_DTCTL_RDTEN0_Pos (0) /*!< EPWM_T::DTCTL: RDTEN0 Position */ -#define EPWM_DTCTL_RDTEN0_Msk (0x1ul << EPWM_DTCTL_RDTEN0_Pos) /*!< EPWM_T::DTCTL: RDTEN0 Mask */ - -#define EPWM_DTCTL_RDTEN2_Pos (1) /*!< EPWM_T::DTCTL: RDTEN2 Position */ -#define EPWM_DTCTL_RDTEN2_Msk (0x1ul << EPWM_DTCTL_RDTEN2_Pos) /*!< EPWM_T::DTCTL: RDTEN2 Mask */ - -#define EPWM_DTCTL_RDTEN4_Pos (2) /*!< EPWM_T::DTCTL: RDTEN4 Position */ -#define EPWM_DTCTL_RDTEN4_Msk (0x1ul << EPWM_DTCTL_RDTEN4_Pos) /*!< EPWM_T::DTCTL: RDTEN4 Mask */ - -#define EPWM_DTCTL_FDTEN0_Pos (8) /*!< EPWM_T::DTCTL: FDTEN0 Position */ -#define EPWM_DTCTL_FDTEN0_Msk (0x1ul << EPWM_DTCTL_FDTEN0_Pos) /*!< EPWM_T::DTCTL: FDTEN0 Mask */ - -#define EPWM_DTCTL_FDTEN2_Pos (9) /*!< EPWM_T::DTCTL: FDTEN2 Position */ -#define EPWM_DTCTL_FDTEN2_Msk (0x1ul << EPWM_DTCTL_FDTEN2_Pos) /*!< EPWM_T::DTCTL: FDTEN2 Mask */ - -#define EPWM_DTCTL_FDTEN4_Pos (10) /*!< EPWM_T::DTCTL: FDTEN4 Position */ -#define EPWM_DTCTL_FDTEN4_Msk (0x1ul << EPWM_DTCTL_FDTEN4_Pos) /*!< EPWM_T::DTCTL: FDTEN4 Mask */ - -#define EPWM_DTCTL_DTCKSEL0_Pos (16) /*!< EPWM_T::DTCTL: DTCKSEL0 Position */ -#define EPWM_DTCTL_DTCKSEL0_Msk (0x1ul << EPWM_DTCTL_DTCKSEL0_Pos) /*!< EPWM_T::DTCTL: DTCKSEL0 Mask */ - -#define EPWM_DTCTL_DTCKSEL2_Pos (17) /*!< EPWM_T::DTCTL: DTCKSEL2 Position */ -#define EPWM_DTCTL_DTCKSEL2_Msk (0x1ul << EPWM_DTCTL_DTCKSEL2_Pos) /*!< EPWM_T::DTCTL: DTCKSEL2 Mask */ - -#define EPWM_DTCTL_DTCKSEL4_Pos (18) /*!< EPWM_T::DTCTL: DTCKSEL4 Position */ -#define EPWM_DTCTL_DTCKSEL4_Msk (0x1ul << EPWM_DTCTL_DTCKSEL4_Pos) /*!< EPWM_T::DTCTL: DTCKSEL4 Mask */ - -#define EPWM_PBUF0_PBUF_Pos (0) /*!< EPWM_T::PBUF0: PBUF Position */ -#define EPWM_PBUF0_PBUF_Msk (0xfffful << EPWM_PBUF0_PBUF_Pos) /*!< EPWM_T::PBUF0: PBUF Mask */ - -#define EPWM_PBUF1_PBUF_Pos (0) /*!< EPWM_T::PBUF1: PBUF Position */ -#define EPWM_PBUF1_PBUF_Msk (0xfffful << EPWM_PBUF1_PBUF_Pos) /*!< EPWM_T::PBUF1: PBUF Mask */ - -#define EPWM_PBUF2_PBUF_Pos (0) /*!< EPWM_T::PBUF2: PBUF Position */ -#define EPWM_PBUF2_PBUF_Msk (0xfffful << EPWM_PBUF2_PBUF_Pos) /*!< EPWM_T::PBUF2: PBUF Mask */ - -#define EPWM_PBUF3_PBUF_Pos (0) /*!< EPWM_T::PBUF3: PBUF Position */ -#define EPWM_PBUF3_PBUF_Msk (0xfffful << EPWM_PBUF3_PBUF_Pos) /*!< EPWM_T::PBUF3: PBUF Mask */ - -#define EPWM_PBUF4_PBUF_Pos (0) /*!< EPWM_T::PBUF4: PBUF Position */ -#define EPWM_PBUF4_PBUF_Msk (0xfffful << EPWM_PBUF4_PBUF_Pos) /*!< EPWM_T::PBUF4: PBUF Mask */ - -#define EPWM_PBUF5_PBUF_Pos (0) /*!< EPWM_T::PBUF5: PBUF Position */ -#define EPWM_PBUF5_PBUF_Msk (0xfffful << EPWM_PBUF5_PBUF_Pos) /*!< EPWM_T::PBUF5: PBUF Mask */ - -#define EPWM_CMPBUF0_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF0: CMPBUF Position */ -#define EPWM_CMPBUF0_CMPBUF_Msk (0xfffful << EPWM_CMPBUF0_CMPBUF_Pos) /*!< EPWM_T::CMPBUF0: CMPBUF Mask */ - -#define EPWM_CMPBUF1_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF1: CMPBUF Position */ -#define EPWM_CMPBUF1_CMPBUF_Msk (0xfffful << EPWM_CMPBUF1_CMPBUF_Pos) /*!< EPWM_T::CMPBUF1: CMPBUF Mask */ - -#define EPWM_CMPBUF2_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF2: CMPBUF Position */ -#define EPWM_CMPBUF2_CMPBUF_Msk (0xfffful << EPWM_CMPBUF2_CMPBUF_Pos) /*!< EPWM_T::CMPBUF2: CMPBUF Mask */ - -#define EPWM_CMPBUF3_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF3: CMPBUF Position */ -#define EPWM_CMPBUF3_CMPBUF_Msk (0xfffful << EPWM_CMPBUF3_CMPBUF_Pos) /*!< EPWM_T::CMPBUF3: CMPBUF Mask */ - -#define EPWM_CMPBUF4_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF4: CMPBUF Position */ -#define EPWM_CMPBUF4_CMPBUF_Msk (0xfffful << EPWM_CMPBUF4_CMPBUF_Pos) /*!< EPWM_T::CMPBUF4: CMPBUF Mask */ - -#define EPWM_CMPBUF5_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF5: CMPBUF Position */ -#define EPWM_CMPBUF5_CMPBUF_Msk (0xfffful << EPWM_CMPBUF5_CMPBUF_Pos) /*!< EPWM_T::CMPBUF5: CMPBUF Mask */ - -#define EPWM_FTCBUF0_1_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Position */ -#define EPWM_FTCBUF0_1_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF0_1_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Mask */ - -#define EPWM_FTCBUF2_3_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Position */ -#define EPWM_FTCBUF2_3_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF2_3_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Mask */ - -#define EPWM_FTCBUF4_5_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Position */ -#define EPWM_FTCBUF4_5_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF4_5_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Mask */ - -#define EPWM_FTCI_FTCMU0_Pos (0) /*!< EPWM_T::FTCI: FTCMU0 Position */ -#define EPWM_FTCI_FTCMU0_Msk (0x1ul << EPWM_FTCI_FTCMU0_Pos) /*!< EPWM_T::FTCI: FTCMU0 Mask */ - -#define EPWM_FTCI_FTCMU2_Pos (1) /*!< EPWM_T::FTCI: FTCMU2 Position */ -#define EPWM_FTCI_FTCMU2_Msk (0x1ul << EPWM_FTCI_FTCMU2_Pos) /*!< EPWM_T::FTCI: FTCMU2 Mask */ - -#define EPWM_FTCI_FTCMU4_Pos (2) /*!< EPWM_T::FTCI: FTCMU4 Position */ -#define EPWM_FTCI_FTCMU4_Msk (0x1ul << EPWM_FTCI_FTCMU4_Pos) /*!< EPWM_T::FTCI: FTCMU4 Mask */ - -#define EPWM_FTCI_FTCMD0_Pos (8) /*!< EPWM_T::FTCI: FTCMD0 Position */ -#define EPWM_FTCI_FTCMD0_Msk (0x1ul << EPWM_FTCI_FTCMD0_Pos) /*!< EPWM_T::FTCI: FTCMD0 Mask */ - -#define EPWM_FTCI_FTCMD2_Pos (9) /*!< EPWM_T::FTCI: FTCMD2 Position */ -#define EPWM_FTCI_FTCMD2_Msk (0x1ul << EPWM_FTCI_FTCMD2_Pos) /*!< EPWM_T::FTCI: FTCMD2 Mask */ - -#define EPWM_FTCI_FTCMD4_Pos (10) /*!< EPWM_T::FTCI: FTCMD4 Position */ -#define EPWM_FTCI_FTCMD4_Msk (0x1ul << EPWM_FTCI_FTCMD4_Pos) /*!< EPWM_T::FTCI: FTCMD4 Mask */ - -#define EPWM_CPSCBUF0_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF0: CPSCBUF Position */ -#define EPWM_CPSCBUF0_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF0_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF0: CPSCBUF Mask */ - -#define EPWM_CPSCBUF1_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF1: CPSCBUF Position */ -#define EPWM_CPSCBUF1_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF1_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF1: CPSCBUF Mask */ - -#define EPWM_CPSCBUF2_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF2: CPSCBUF Position */ -#define EPWM_CPSCBUF2_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF2_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF2: CPSCBUF Mask */ - -#define EPWM_CPSCBUF3_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF3: CPSCBUF Position */ -#define EPWM_CPSCBUF3_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF3_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF3: CPSCBUF Mask */ - -#define EPWM_CPSCBUF4_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF4: CPSCBUF Position */ -#define EPWM_CPSCBUF4_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF4_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF4: CPSCBUF Mask */ - -#define EPWM_CPSCBUF5_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF5: CPSCBUF Position */ -#define EPWM_CPSCBUF5_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF5_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF5: CPSCBUF Mask */ - -#define EPWM_IFACNT0_ACUCNT_Pos (0) /*!< EPWM_T::IFACNT0: ACUCNT Position */ -#define EPWM_IFACNT0_ACUCNT_Msk (0xfffful << EPWM_IFACNT0_ACUCNT_Pos) /*!< EPWM_T::IFACNT0: ACUCNT Mask */ - -#define EPWM_IFACNT1_ACUCNT_Pos (0) /*!< EPWM_T::IFACNT1: ACUCNT Position */ -#define EPWM_IFACNT1_ACUCNT_Msk (0xfffful << EPWM_IFACNT1_ACUCNT_Pos) /*!< EPWM_T::IFACNT1: ACUCNT Mask */ - -#define EPWM_IFACNT2_ACUCNT_Pos (0) /*!< EPWM_T::IFACNT2: ACUCNT Position */ -#define EPWM_IFACNT2_ACUCNT_Msk (0xfffful << EPWM_IFACNT2_ACUCNT_Pos) /*!< EPWM_T::IFACNT2: ACUCNT Mask */ - -#define EPWM_IFACNT3_ACUCNT_Pos (0) /*!< EPWM_T::IFACNT3: ACUCNT Position */ -#define EPWM_IFACNT3_ACUCNT_Msk (0xfffful << EPWM_IFACNT3_ACUCNT_Pos) /*!< EPWM_T::IFACNT3: ACUCNT Mask */ - -#define EPWM_IFACNT4_ACUCNT_Pos (0) /*!< EPWM_T::IFACNT4: ACUCNT Position */ -#define EPWM_IFACNT4_ACUCNT_Msk (0xfffful << EPWM_IFACNT4_ACUCNT_Pos) /*!< EPWM_T::IFACNT4: ACUCNT Mask */ - -#define EPWM_IFACNT5_ACUCNT_Pos (0) /*!< EPWM_T::IFACNT5: ACUCNT Position */ -#define EPWM_IFACNT5_ACUCNT_Msk (0xfffful << EPWM_IFACNT5_ACUCNT_Pos) /*!< EPWM_T::IFACNT5: ACUCNT Mask */ - -/**@}*/ /* EPWM_CONST */ -/**@}*/ /* end of EPWM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eqei_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eqei_reg.h deleted file mode 100644 index d277b8ee259..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/eqei_reg.h +++ /dev/null @@ -1,445 +0,0 @@ -/**************************************************************************//** - * @file qei_reg.h - * @version V1.00 - * @brief EQEI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EQEI_REG_H__ -#define __EQEI_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EQEI Quadrature Encoder Interface(EQEI) - Memory Mapped Structure for EQEI Controller -@{ */ - -typedef struct -{ - - - /** - * @var EQEI_T::CNT - * Offset: 0x00 EQEI Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |Quadrature Encoder Interface Counter - * | | |A 32-bit up/down counter - * | | |When an effective phase pulse is detected, this counter is increased by one if the bit DIRF (EQEI_STATUS[8]) is one or decreased by one if the bit DIRF(EQEI_STATUS[8]) is zero - * | | |This register performs an integrator which count value is proportional to the encoder position - * | | |The pulse counter may be initialized to a predetermined value by one of three events occurs: - * | | |1. Software is written if EQEIEN (EQEI_CTL[29]) = 0. - * | | |2. Compare-match event if EQEIEN(EQEI_CTL[29])=1 and EQEI is in compare-counting mode. - * | | |3. Index signal change if EQEIEN(EQEI_CTL[29])=1 and IDXRLDEN (EQEI_CTL[27])=1. - * @var EQEI_T::CNTHOLD - * Offset: 0x04 EQEI Counter Hold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTHOLD |Quadrature Encoder Interface Counter Hold - * | | |When bit HOLDCNT (EQEI_CTL[24]) goes from low to high, the CNT(EQEI_CNT[31:0]) is copied into CNTHOLD (EQEI_CNTHOLD[31:0]) register. - * @var EQEI_T::CNTLATCH - * Offset: 0x08 EQEI Counter Index Latch Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTLATCH |Quadrature Encoder Interface Counter Index Latch - * | | |When the IDXF (EQEI_STATUS[0]) bit is set, the CNT(EQEI_CNT[31:0]) is copied into CNTLATCH (EQEI_CNTLATCH[31:0]) register. - * @var EQEI_T::CNTCMP - * Offset: 0x0C EQEI Counter Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTCMP |Quadrature Encoder Interface Counter Compare - * | | |If the EQEI controller is in the compare-counting mode CMPEN (EQEI_CTL[28]) =1, when the value of CNT(EQEI_CNT[31:0]) matches CNTCMP(EQEI_CNTCMP[31:0]), CMPF will be set - * | | |This register is software writable. - * @var EQEI_T::CNTMAX - * Offset: 0x14 EQEI Pre-set Maximum Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTMAX |Quadrature Encoder Interface Preset Maximum Count - * | | |This register value determined by user stores the maximum value which may be the number of the EQEI counter for the EQEI controller compare-counting mode - * @var EQEI_T::CTL - * Offset: 0x18 EQEI Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection - * | | |To determine the sampling frequency of the Noise Filter clock . - * | | |000 = EQEI_CLK. - * | | |001 = EQEI_CLK/2. - * | | |010 = EQEI_CLK/4. - * | | |011 = EQEI_CLK/16. - * | | |100 = EQEI_CLK/32. - * | | |101 = EQEI_CLK/64. - * |[3] |NFDIS |QEI Controller Input Noise Filter Disable Bit - * | | |0 = The noise filter of EQEI controller Enabled. - * | | |1 = The noise filter of EQEI controller Disabled. - * |[4] |CHAEN |QEA Input to EQEI Controller Enable Bit - * | | |0 = QEA input to EQEI Controller Disabled. - * | | |1 = QEA input to EQEI Controller Enabled. - * |[5] |CHBEN |QEB Input to EQEI Controller Enable Bit - * | | |0 = QEB input to EQEI Controller Disabled. - * | | |1 = QEB input to EQEI Controller Enabled. - * |[6] |IDXEN |IDX Input to EQEI Controller Enable Bit - * | | |0 = IDX input to EQEI Controller Disabled. - * | | |1 = IDX input to EQEI Controller Enabled. - * |[7] |IDXRSTEN |IDX Reset EQEI Position Counter Enable Bit - * | | |0 = Reset EQEI position counter in every time IDX signal. - * | | |1 = Reset EQEI position counter in first time IDX signal. - * | | |Note: IDXRLDEN(EQEI_CTL[27]) should be set 1. - * |[10:8] |MODE |QEI Counting Mode Selection - * | | |There are seven quadrature encoder pulse counter operation modes. - * | | |000 = X4 Free-counting Mode. - * | | |001 = X2 Free-counting Mode. - * | | |010 = X4 Compare-counting Mode. - * | | |011 = X2 Compare-counting Mode. - * | | |100 = Phase Counting Mode Type 1. (PCMT1). - * | | |101 = Phase Counting Mode Type 2. (PCMT2). - * | | |110 = Directional Counting Mode. - * | | |111 = Reserved. - * | | |Note: User needs to set DIRSRC(EQEI_CTL2[5:4]) when MODE(EQEI_CTL[10:8]) selects to directional counting mode. - * |[12] |CHAINV |Inverse QEA Input Polarity - * | | |0 = Not inverse QEA input polarity. - * | | |1 = QEA input polarity is inversed to EQEI controller. - * |[13] |CHBINV |Inverse QEB Input Polarity - * | | |0 = Not inverse QEB input polarity. - * | | |1 = QEB input polarity is inversed to EQEI controller. - * |[14] |IDXINV |Inverse IDX Input Polarity - * | | |0 = Not inverse IDX input polarity. - * | | |1 = IDX input polarity is inversed to EQEI controller. - * |[15] |IDXRSTEV |IDX Signal Resets Enable Bit in First IDX Reset Event (Write Only) - * | | |0 = The next IDX level high signal reset function is disabled. - * | | |1 = The next IDX level high signal reset function is enabled. - * | | |Note: This bit only effective when IDXRSTEN (EQEI_CTL[7])=1 and IDXRLDEN (EQEI_CTL[27])=1. - * |[16] |OVUNIEN |OVUNF Trigger EQEI Interrupt Enable Bit - * | | |0 = OVUNF can trigger EQEI controller interrupt Disabled. - * | | |1 = OVUNF can trigger EQEI controller interrupt Enabled. - * |[17] |DIRIEN |DIRCHGF Trigger EQEI Interrupt Enable Bit - * | | |0 = DIRCHGF can trigger EQEI controller interrupt Disabled. - * | | |1 = DIRCHGF can trigger EQEI controller interrupt Enabled. - * |[18] |CMPIEN |CMPF Trigger EQEI Interrupt Enable Bit - * | | |0 = CMPF can trigger EQEI controller interrupt Disabled. - * | | |1 = CMPF can trigger EQEI controller interrupt Enabled. - * |[19] |IDXIEN |IDXF Trigger EQEI Interrupt Enable Bit - * | | |0 = The IDXF can trigger EQEI interrupt Disabled. - * | | |1 = The IDXF can trigger EQEI interrupt Enabled. - * |[20] |HOLDTMR0 |Hold EQEI_CNT by Timer 0 - * | | |0 = TIF (TIMER0_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER0_INTSTS[0]) in timer 0 sets HOLDCNT to 1. - * |[21] |HOLDTMR1 |Hold EQEI_CNT by Timer 1 - * | | |0 = TIF(TIMER1_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF (TIMER1_INTSTS[0]) in timer 1 sets HOLDCNT to 1. - * |[22] |HOLDTMR2 |Hold EQEI_CNT by Timer 2 - * | | |0 = TIF(TIMER2_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER2_INTSTS[0]) in timer 2 sets HOLDCNT to 1. - * |[23] |HOLDTMR3 |Hold EQEI_CNT by Timer 3 - * | | |0 = TIF (TIMER3_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER3_INTSTS[0]) in timer 3 sets HOLDCNT to 1. - * |[24] |HOLDCNT |Hold EQEI_CNT Control - * | | |When this bit is set from low to high, the CNT(EQEI_CNT[31:0]) is copied into CNTHOLD(EQEI_CNTHOLD[31:0]) - * | | |This bit may be set by writing 1 to it or Timer0~Timer3 interrupt flag TIF (TIMERx_INTSTS[0]). - * | | |0 = No operation. - * | | |1 = EQEI_CNT content is captured and stored in CNTHOLD(EQEI_CNTHOLD[31:0]). - * | | |Note: This bit is automatically cleared after EQEI_CNTHOLD holds EQEI_CNT value. - * |[25] |IDXLATEN |Index Latch EQEI_CNT Enable Bit - * | | |If this bit is set to high, the CNT(EQEI_CNT[31:0]) content will be latched into CNTLATCH (EQEI_CNTLATCH[31:0]) at every rising on signal CHX. - * | | |0 = The index signal latch EQEI counter function Disabled. - * | | |1 = The index signal latch EQEI counter function Enabled. - * |[27] |IDXRLDEN |Index Trigger EQEI_CNT Reload Enable Bit - * | | |When this bit is high and a rising edge comes on signal CHX, the CNT(EQEI_CNT[31:0]) will be reset to zero if the counter is in up-counting type (DIRF(EQEI_STATUS[8]) = 1); while the CNT(EQEI_CNT[31:0]) will be reloaded with CNTMAX (EQEI_CNTMAX[31:0]) content if the counter is in down-counting type (DIRF(EQEI_STATUS[8]) = 0). - * | | |0 = Reload function Disabled. - * | | |1 = EQEI_CNT re-initialized by Index signal Enabled. - * |[28] |CMPEN |The Compare Function Enable Bit - * | | |The compare function in EQEI controller is to compare the dynamic counting EQEI_CNT with the compare register CNTCMP( EQEI_CNTCMP[31:0]), if CNT(EQEI_CNT[31:0]) reaches CNTCMP( EQEI_CNTCMP[31:0]), the flag CMPF will be set. - * | | |0 = Compare function Disabled. - * | | |1 = Compare function Enabled. - * |[29] |EQEIEN |Enhanced Quadrature Encoder Interface Controller Enable Bit - * | | |0 = EQEI controller function Disabled. - * | | |1 = EQEI controller function Enabled. - * @var EQEI_T::CTL2 - * Offset: 0x1C EQEI Controller Control Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWAPEN |Swap Function Enable Bit - * | | |0 = EQEI swap function Disabled. - * | | |1 = EQEI swap function Enabled. - * |[2:1] |CRS |Clock Rate Setting without Quadrature Mode - * | | |00 = EQEI counter only counts the falling edge. - * | | |01 = EQEI counter only counts the rising edge. - * | | |10 = EQEI counter counts the rising and falling edge. - * | | |11 = reserved. - * |[5:4] |DIRSRC |Direction Signal Source Select - * | | |00 = Direction signal is determined from EQEI system calculation. - * | | |01 = reserved. - * | | |10 = Direction signal is tied 1 only for direction up count mode. - * | | |11 = Direction signal is tied 0 only for down count mode. - * |[8] |UTEN |Unit Timer Function Enable Bit - * | | |0 = EQEI unit timer function is disable. - * | | |1 = EQEI unit timer function is enable. - * |[9] |UTHOLDEN |Unit Timer Counter Hold Enable Bit - * | | |0 = No operation. - * | | |1 = EQEI_CNT content is captured and stored in CNTHOLD(EQEI_CNTHOLD[31:0]) when UTCNT matches UTCMP(EQEI_UTCMP[31:0]). - * |[10] |UTEVTRST |Enable Bit to Reset EQEI Position Counter by Unit Timer Event - * | | |0 = Disable to reset EQEI position counter feature when unit timer counter event occurs. - * | | |1 = Enable to reset EQEI position counter feature when unit timer counter event occurs. - * |[11] |IDXRSTUTS |IDX Resets Unit Timer Select Bit - * | | |0 = Unit timer will not be reset when IDX reset event happens. - * | | |1 = Resets unit timer or not will follow EQEI_CNT when IDX reset event happens. - * |[16] |PHEIEN |PHEF Trigger EQEI Interrupt Enable Bit - * | | |0 = PHEF can trigger EQEI controller interrupt Disabled. - * | | |1 = PHEF can trigger EQEI controller interrupt Enabled. - * |[17] |UTIEIEN |UTIEF Trigger EQEI Interrupt Enable Bit - * | | |0 = UTIEF can trigger EQEI controller interrupt Disabled. - * | | |1 = UTIEF can trigger EQEI controller interrupt Enabled. - * @var EQEI_T::UTCNT - * Offset: 0x20 EQEI Unit Timer Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UTCNT |Unit Timer Counter - * | | |A 32-bit unit timer counter which may be reset to an initial value when any of the following events occur: - * | | |1. Software is written if UTEN (EQEI_CTL2[8]) = 0. - * | | |2. UT_EN (EQEI_CTL2[8]) =1, and the unit timer counter value matches UTCMP(EQEI_UTCMP[31:0]). - * | | |3. IDXRLDEN(EQEI_CTL[27]) =1 and IDXRSTUTS(EQEI_CTL2[11]=1, determine the unit timer to be reset or not will follow EQEI_CNT when IDX reset event happens. - * @var EQEI_T::UTCMP - * Offset: 0x24 EQEI Unit Timer Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UTCMP |Unit Timer Counter Compare - * | | |If the EQEI unit timer is enable (EQEI_CTL2[8]) =1, and the unit timer counter value also matches UTCMP(EQEI_UTCMP[31:0]), then UTIEF (EQEI_STATUS[10]) will be set. This register is software writable. - * @var EQEI_T::STATUS - * Offset: 0x2C EQEI Controller Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IDXF |IDX Detected Flag - * | | |When the EQEI controller detects a rising edge on signal CHX it will set flag IDXF to high. - * | | |0 = No rising edge detected on signal CHX. - * | | |1 = A rising edge occurs on signal CHX. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[1] |CMPF |Compare-match Flag - * | | |If the EQEI compare function is enabled, the flag is set by hardware while EQEI counter up or down counts and reach to the CNTCMP(EQEI_CNTCMP[31:0]). - * | | |0 = EQEI counter does not match with CNTCMP(EQEI_CNTCMP[31:0]). - * | | |1 = EQEI counter counts to the same as CNTCMP(EQEI_CNTCMP[31:0]). - * | | |Note: This bit is only cleared by writing 1 to it. - * |[2] |OVUNF |QEI Counter Overflow or Underflow Flag - * | | |Flag is set by hardware while CNT(EQEI_CNT[31:0]) overflows from 0xFFFF_FFFF to zero in free-counting mode or from the CNTMAX (EQEI_CNTMAX[31:0]) to zero in compare-counting mode - * | | |Similarly, the flag is set while EQEI counter underflows from zero to 0xFFFF_FFFF or CNTMAX (EQEI_CNTMAX[31:0]). - * | | |0 = No overflow or underflow occurs in EQEI counter. - * | | |1 = EQEI counter occurs counting overflow or underflow. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[3] |DIRCHGF |Direction Change Flag - * | | |Flag is set by hardware while EQEI counter counting direction is changed. - * | | |Software can clear this bit by writing 1 to it. - * | | |0 = No change in EQEI counter counting direction. - * | | |1 = EQEI counter counting direction is changed. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[8] |DIRF |QEI Counter Counting Direction Indication - * | | |0 = EQEI Counter is in down-counting. - * | | |1 = EQEI Counter is in up-counting. - * | | |Note: This bit is set/reset by hardware according to the phase detection between CHA and CHB. - * |[9] |FIDXEF |First IDX Signal Reset Event Flag (Read Only) - * | | |0 = The first IDX reset event has not happened yet. - * | | |1 = The first IDX reset event has happened. - * | | |Note: This bit only effective when IDXRSTEN (EQEI_CTL[7])=1 and IDXRLDEN (EQEI_CTL[27])=1. - * |[16] |PHEF EQEI |Phase Error Flag - * | | |0 = No Phase error occurs in EQEI CHA and CHB. - * | | |1 = Phase error occurs in EQEI CHA and CHB. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[17] |UTIEF |EQEI Unit Timer Event Flag - * | | |0 = No timer event occurs in EQEI unit timer counter. - * | | |1 = Unit timer event occurs in EQEI unit timer counter. - * | | |Note: This bit is only cleared by writing 1 to it. - */ - __IO uint32_t CNT; /*!< [0x0000] EQEI Counter Register */ - __IO uint32_t CNTHOLD; /*!< [0x0004] EQEI Counter Hold Register */ - __IO uint32_t CNTLATCH; /*!< [0x0008] EQEI Counter Index Latch Register */ - __IO uint32_t CNTCMP; /*!< [0x000c] EQEI Counter Compare Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CNTMAX; /*!< [0x0014] EQEI Pre-set Maximum Count Register */ - __IO uint32_t CTL; /*!< [0x0018] EQEI Controller Control Register */ - __IO uint32_t CTL2; /*!< [0x001C] EQEI Controller Control Register2 */ - __IO uint32_t UTCNT; /*!< [0x0020] EQEI Unit Timer Counter Register */ - __IO uint32_t UTCMP; /*!< [0x0024] EQEI Unit Timer Compare Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t STATUS; /*!< [0x002c] EQEI Controller Status Register */ - -} EQEI_T; - -/** - @addtogroup EQEI_CONST EQEI Bit Field Definition - Constant Definitions for EQEI Controller -@{ */ - -#define EQEI_CNT_CNT_Pos (0) /*!< EQEI_T::CNT: CNT Position */ -#define EQEI_CNT_CNT_Msk (0xfffffffful << EQEI_CNT_CNT_Pos) /*!< EQEI_T::CNT: CNT Mask */ - -#define EQEI_CNTHOLD_CNTHOLD_Pos (0) /*!< EQEI_T::CNTHOLD: CNTHOLD Position */ -#define EQEI_CNTHOLD_CNTHOLD_Msk (0xfffffffful << EQEI_CNTHOLD_CNTHOLD_Pos) /*!< EQEI_T::CNTHOLD: CNTHOLD Mask */ - -#define EQEI_CNTLATCH_CNTLATCH_Pos (0) /*!< EQEI_T::CNTLATCH: CNTLATCH Position */ -#define EQEI_CNTLATCH_CNTLATCH_Msk (0xfffffffful << EQEI_CNTLATCH_CNTLATCH_Pos) /*!< EQEI_T::CNTLATCH: CNTLATCH Mask */ - -#define EQEI_CNTCMP_CNTCMP_Pos (0) /*!< EQEI_T::CNTCMP: CNTCMP Position */ -#define EQEI_CNTCMP_CNTCMP_Msk (0xfffffffful << EQEI_CNTCMP_CNTCMP_Pos) /*!< EQEI_T::CNTCMP: CNTCMP Mask */ - -#define EQEI_CNTMAX_CNTMAX_Pos (0) /*!< EQEI_T::CNTMAX: CNTMAX Position */ -#define EQEI_CNTMAX_CNTMAX_Msk (0xfffffffful << EQEI_CNTMAX_CNTMAX_Pos) /*!< EQEI_T::CNTMAX: CNTMAX Mask */ - -#define EQEI_CTL_NFCLKSEL_Pos (0) /*!< EQEI_T::CTL: NFCLKSEL Position */ -#define EQEI_CTL_NFCLKSEL_Msk (0x7ul << EQEI_CTL_NFCLKSEL_Pos) /*!< EQEI_T::CTL: NFCLKSEL Mask */ - -#define EQEI_CTL_NFDIS_Pos (3) /*!< EQEI_T::CTL: NFDIS Position */ -#define EQEI_CTL_NFDIS_Msk (0x1ul << EQEI_CTL_NFDIS_Pos) /*!< EQEI_T::CTL: NFDIS Mask */ - -#define EQEI_CTL_CHAEN_Pos (4) /*!< EQEI_T::CTL: CHAEN Position */ -#define EQEI_CTL_CHAEN_Msk (0x1ul << EQEI_CTL_CHAEN_Pos) /*!< EQEI_T::CTL: CHAEN Mask */ - -#define EQEI_CTL_CHBEN_Pos (5) /*!< EQEI_T::CTL: CHBEN Position */ -#define EQEI_CTL_CHBEN_Msk (0x1ul << EQEI_CTL_CHBEN_Pos) /*!< EQEI_T::CTL: CHBEN Mask */ - -#define EQEI_CTL_IDXEN_Pos (6) /*!< EQEI_T::CTL: IDXEN Position */ -#define EQEI_CTL_IDXEN_Msk (0x1ul << EQEI_CTL_IDXEN_Pos) /*!< EQEI_T::CTL: IDXEN Mask */ - -#define EQEI_CTL_IDXRSTEN_Pos (7) /*!< EQEI_T::CTL: IDXRSTEN Position */ -#define EQEI_CTL_IDXRSTEN_Msk (0x1ul << EQEI_CTL_IDXRSTEN_Pos) /*!< EQEI_T::CTL: IDXRSTEN Mask */ - -#define EQEI_CTL_MODE_Pos (8) /*!< EQEI_T::CTL: MODE Position */ -#define EQEI_CTL_MODE_Msk (0x7ul << EQEI_CTL_MODE_Pos) /*!< EQEI_T::CTL: MODE Mask */ - -#define EQEI_CTL_CHAINV_Pos (12) /*!< EQEI_T::CTL: CHAINV Position */ -#define EQEI_CTL_CHAINV_Msk (0x1ul << EQEI_CTL_CHAINV_Pos) /*!< EQEI_T::CTL: CHAINV Mask */ - -#define EQEI_CTL_CHBINV_Pos (13) /*!< EQEI_T::CTL: CHBINV Position */ -#define EQEI_CTL_CHBINV_Msk (0x1ul << EQEI_CTL_CHBINV_Pos) /*!< EQEI_T::CTL: CHBINV Mask */ - -#define EQEI_CTL_IDXINV_Pos (14) /*!< EQEI_T::CTL: IDXINV Position */ -#define EQEI_CTL_IDXINV_Msk (0x1ul << EQEI_CTL_IDXINV_Pos) /*!< EQEI_T::CTL: IDXINV Mask */ - -#define EQEI_CTL_IDXRSTEV_Pos (15) /*!< EQEI_T::CTL: IDXRSTEV Position */ -#define EQEI_CTL_IDXRSTEV_Msk (0x1ul << EQEI_CTL_IDXRSTEV_Pos) /*!< EQEI_T::CTL: IDXRSTEV Mask */ - -#define EQEI_CTL_OVUNIEN_Pos (16) /*!< EQEI_T::CTL: OVUNIEN Position */ -#define EQEI_CTL_OVUNIEN_Msk (0x1ul << EQEI_CTL_OVUNIEN_Pos) /*!< EQEI_T::CTL: OVUNIEN Mask */ - -#define EQEI_CTL_DIRIEN_Pos (17) /*!< EQEI_T::CTL: DIRIEN Position */ -#define EQEI_CTL_DIRIEN_Msk (0x1ul << EQEI_CTL_DIRIEN_Pos) /*!< EQEI_T::CTL: DIRIEN Mask */ - -#define EQEI_CTL_CMPIEN_Pos (18) /*!< EQEI_T::CTL: CMPIEN Position */ -#define EQEI_CTL_CMPIEN_Msk (0x1ul << EQEI_CTL_CMPIEN_Pos) /*!< EQEI_T::CTL: CMPIEN Mask */ - -#define EQEI_CTL_IDXIEN_Pos (19) /*!< EQEI_T::CTL: IDXIEN Position */ -#define EQEI_CTL_IDXIEN_Msk (0x1ul << EQEI_CTL_IDXIEN_Pos) /*!< EQEI_T::CTL: IDXIEN Mask */ - -#define EQEI_CTL_HOLDTMR0_Pos (20) /*!< EQEI_T::CTL: HOLDTMR0 Position */ -#define EQEI_CTL_HOLDTMR0_Msk (0x1ul << EQEI_CTL_HOLDTMR0_Pos) /*!< EQEI_T::CTL: HOLDTMR0 Mask */ - -#define EQEI_CTL_HOLDTMR1_Pos (21) /*!< EQEI_T::CTL: HOLDTMR1 Position */ -#define EQEI_CTL_HOLDTMR1_Msk (0x1ul << EQEI_CTL_HOLDTMR1_Pos) /*!< EQEI_T::CTL: HOLDTMR1 Mask */ - -#define EQEI_CTL_HOLDTMR2_Pos (22) /*!< EQEI_T::CTL: HOLDTMR2 Position */ -#define EQEI_CTL_HOLDTMR2_Msk (0x1ul << EQEI_CTL_HOLDTMR2_Pos) /*!< EQEI_T::CTL: HOLDTMR2 Mask */ - -#define EQEI_CTL_HOLDTMR3_Pos (23) /*!< EQEI_T::CTL: HOLDTMR3 Position */ -#define EQEI_CTL_HOLDTMR3_Msk (0x1ul << EQEI_CTL_HOLDTMR3_Pos) /*!< EQEI_T::CTL: HOLDTMR3 Mask */ - -#define EQEI_CTL_HOLDCNT_Pos (24) /*!< EQEI_T::CTL: HOLDCNT Position */ -#define EQEI_CTL_HOLDCNT_Msk (0x1ul << EQEI_CTL_HOLDCNT_Pos) /*!< EQEI_T::CTL: HOLDCNT Mask */ - -#define EQEI_CTL_IDXLATEN_Pos (25) /*!< EQEI_T::CTL: IDXLATEN Position */ -#define EQEI_CTL_IDXLATEN_Msk (0x1ul << EQEI_CTL_IDXLATEN_Pos) /*!< EQEI_T::CTL: IDXLATEN Mask */ - -#define EQEI_CTL_IDXRLDEN_Pos (27) /*!< EQEI_T::CTL: IDXRLDEN Position */ -#define EQEI_CTL_IDXRLDEN_Msk (0x1ul << EQEI_CTL_IDXRLDEN_Pos) /*!< EQEI_T::CTL: IDXRLDEN Mask */ - -#define EQEI_CTL_CMPEN_Pos (28) /*!< EQEI_T::CTL: CMPEN Position */ -#define EQEI_CTL_CMPEN_Msk (0x1ul << EQEI_CTL_CMPEN_Pos) /*!< EQEI_T::CTL: CMPEN Mask */ - -#define EQEI_CTL_QEIEN_Pos (29) /*!< EQEI_T::CTL: EQEIEN Position */ -#define EQEI_CTL_QEIEN_Msk (0x1ul << EQEI_CTL_QEIEN_Pos) /*!< EQEI_T::CTL: EQEIEN Mask */ - -#define EQEI_CTL2_SWAPEN_Pos (0) /*!< EQEI_T::CTL2: SWAPEN Position */ -#define EQEI_CTL2_SWAPEN_Msk (0x1ul << EQEI_CTL2_SWAPEN_Pos) /*!< EQEI_T::CTL2: SWAPEN Mask */ - -#define EQEI_CTL2_CRS_Pos (1) /*!< EQEI_T::CTL2: CRS Position */ -#define EQEI_CTL2_CRS_Msk (0x3ul << EQEI_CTL2_CRS_Pos) /*!< EQEI_T::CTL2: CRS Mask */ - -#define EQEI_CTL2_DIRSRC_Pos (4) /*!< EQEI_T::CTL2: DIRSRC Position */ -#define EQEI_CTL2_DIRSRC_Msk (0x3ul << EQEI_CTL2_DIRSRC_Pos) /*!< EQEI_T::CTL2: DIRSRC Mask */ - -#define EQEI_CTL2_UTEN_Pos (8) /*!< EQEI_T::CTL2: UTEN Position */ -#define EQEI_CTL2_UTEN_Msk (0x1ul << EQEI_CTL2_UTEN_Pos) /*!< EQEI_T::CTL2: UTEN Mask */ - -#define EQEI_CTL2_UTHOLDEN_Pos (9) /*!< EQEI_T::CTL2: UTHOLDEN Position */ -#define EQEI_CTL2_UTHOLDEN_Msk (0x1ul << EQEI_CTL2_UTHOLDEN_Pos) /*!< EQEI_T::CTL2: UTHOLDEN Mask */ - -#define EQEI_CTL2_UTEVTRST_Pos (10) /*!< EQEI_T::CTL2: UTEVTRST Position */ -#define EQEI_CTL2_UTEVTRST_Msk (0x1ul << EQEI_CTL2_UTEVTRST_Pos) /*!< EQEI_T::CTL2: UTEVTRST Mask */ - -#define EQEI_CTL2_IDXRSTUTS_Pos (11) /*!< EQEI_T::CTL2: IDXRSTUTS Position */ -#define EQEI_CTL2_IDXRSTUTS_Msk (0x1ul << EQEI_CTL2_IDXRSTUTS_Pos) /*!< EQEI_T::CTL2: IDXRSTUTS Mask */ - -#define EQEI_CTL2_PHEIEN_Pos (16) /*!< EQEI_T::CTL2: PHEIEN Position */ -#define EQEI_CTL2_PHEIEN_Msk (0x1ul << EQEI_CTL2_PHEIEN_Pos) /*!< EQEI_T::CTL2: PHEIEN Mask */ - -#define EQEI_CTL2_UTIEIEN_Pos (17) /*!< EQEI_T::CTL2: UTIEIEN Position */ -#define EQEI_CTL2_UTIEIEN_Msk (0x1ul << EQEI_CTL2_UTIEIEN_Pos) /*!< EQEI_T::CTL2: UTIEIEN Mask */ - -#define EQEI_UTCNT_UTCNT_Pos (0) /*!< EQEI_T::UTCNT: UTCNT Position */ -#define EQEI_UTCNT_UTCNT_Msk (0xfffffffful << EQEI_UTCNT_UTCNT_Pos) /*!< EQEI_T::UTCNT: UTCNT Mask */ - -#define EQEI_UTCMP_UTCMP_Pos (0) /*!< EQEI_T::UTCMP: UTCMP Position */ -#define EQEI_UTCMP_UTCMP_Msk (0xfffffffful << EQEI_UTCMP_UTCMP_Pos) /*!< EQEI_T::UTCMP: UTCMP Mask */ - -#define EQEI_STATUS_IDXF_Pos (0) /*!< EQEI_T::STATUS: IDXF Position */ -#define EQEI_STATUS_IDXF_Msk (0x1ul << EQEI_STATUS_IDXF_Pos) /*!< EQEI_T::STATUS: IDXF Mask */ - -#define EQEI_STATUS_CMPF_Pos (1) /*!< EQEI_T::STATUS: CMPF Position */ -#define EQEI_STATUS_CMPF_Msk (0x1ul << EQEI_STATUS_CMPF_Pos) /*!< EQEI_T::STATUS: CMPF Mask */ - -#define EQEI_STATUS_OVUNF_Pos (2) /*!< EQEI_T::STATUS: OVUNF Position */ -#define EQEI_STATUS_OVUNF_Msk (0x1ul << EQEI_STATUS_OVUNF_Pos) /*!< EQEI_T::STATUS: OVUNF Mask */ - -#define EQEI_STATUS_DIRCHGF_Pos (3) /*!< EQEI_T::STATUS: DIRCHGF Position */ -#define EQEI_STATUS_DIRCHGF_Msk (0x1ul << EQEI_STATUS_DIRCHGF_Pos) /*!< EQEI_T::STATUS: DIRCHGF Mask */ - -#define EQEI_STATUS_DIRF_Pos (8) /*!< EQEI_T::STATUS: DIRF Position */ -#define EQEI_STATUS_DIRF_Msk (0x1ul << EQEI_STATUS_DIRF_Pos) /*!< EQEI_T::STATUS: DIRF Mask */ - -#define EQEI_STATUS_FIDXEF_Pos (9) /*!< EQEI_T::STATUS: FIDXEF Position */ -#define EQEI_STATUS_FIDXEF_Msk (0x1ul << EQEI_STATUS_FIDXEF_Pos) /*!< EQEI_T::STATUS: FIDXEF Mask */ - -#define EQEI_STATUS_PHEF_Pos (16) /*!< EQEI_T::STATUS: PHEF Position */ -#define EQEI_STATUS_PHEF_Msk (0x1ul << EQEI_STATUS_PHEF_Pos) /*!< EQEI_T::STATUS: PHEF Mask */ - -#define EQEI_STATUS_UTIEF_Pos (17) /*!< EQEI_T::STATUS: UTIEF Position */ -#define EQEI_STATUS_UTIEF_Msk (0x1ul << EQEI_STATUS_UTIEF_Pos) /*!< EQEI_T::STATUS: UTIEF Mask */ - - -/**@}*/ /* EQEI_CONST */ -/**@}*/ /* end of EQEI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EQEI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/fmc_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/fmc_reg.h deleted file mode 100644 index 9dc0ee5cbdb..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/fmc_reg.h +++ /dev/null @@ -1,687 +0,0 @@ -/**************************************************************************//** - * @file fmc_reg.h - * @version V1.00 - * @brief FMC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __FMC_REG_H__ -#define __FMC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup FMC Flash Memory Controller(FMC) - Memory Mapped Structure for FMC Controller -@{ */ - -typedef struct -{ - /** - * @var FMC_T::ISPCTL - * Offset: 0x00 ISP Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPEN |ISP Enable Bit (Write Protect) - * | | |ISP function enable bit. Set this bit to enable ISP function. - * | | |0 = ISP function Disabled. - * | | |1 = ISP function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |BS |Boot Select (Write Protect) - * | | |When MBS in CONFIG0 is 1, set/clear this bit to select next booting from LDROM/APROM, respectively - * | | |This bit also functions as chip booting status flag, which can be used to check where chip booted from - * | | |This bit is initiated with the inversed value of CBS[1] (CONFIG0[7]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened - * | | |0 = Booting from APROM when MBS (CONFIG0[5]) is 1. - * | | |1 = Booting from LDROM when MBS (CONFIG0[5]) is 1. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |APUEN |APROM Update Enable Bit (Write Protect) - * | | |0 = APROM cannot be updated when the chip runs in APROM. - * | | |1 = APROM can be updated when the chip runs in APROM. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |CFGUEN |CONFIG Update Enable Bit (Write Protect) - * | | |0 = CONFIG cannot be updated. - * | | |1 = CONFIG can be updated. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |LDUEN |LDROM Update Enable Bit (Write Protect) - * | | |LDROM update enable bit. - * | | |0 = LDROM cannot be updated. - * | | |1 = LDROM can be updated. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |ISPFF |ISP Fail Flag (Write Protect) - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |This bit needs to be cleared by writing 1 to it. - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0 - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection - * | | |(7) Erase or Program command at brown-out detected - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands - * | | |(10) Vector address is mapping to SPROM region - * | | |(11) KPROM is erased/programmed if KEYLOCK is set to 1 - * | | |(12) APROM(except for Data Flash) is erased/programmed if KEYLOCK is set to 1 - * | | |(13) LDROM is erased/programmed if KEYLOCK is set to 1 - * | | |(14) SPROM is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1. - * | | |(15) CONFIG is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1 - * | | |(16) Invalid operations (except for chip erase) with ICE connection if SBLOCK is not 0x5A - * | | |(17) Read any content of boot loader with ICE connection - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |BL |Boot Loader Booting (Write Protect) - * | | |This bit is initiated with the inversed value of MBS (CONFIG0[5]) - * | | |Any reset, except CPU reset (CPU is 1) or system reset (SYS), BL will be reloaded - * | | |This bit is used to check chip boot from Boot Loader or not - * | | |User should keep original value of this bit when updating FMC_ISPCTL register. - * | | |0 = Booting from APROM or LDROM. - * | | |1 = Booting from Boot Loader. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::ISPADDR - * Offset: 0x04 ISP Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPADDR |ISP Address - * | | |The NuMicro M480 series is equipped with embedded flash - * | | |ISPADDR[1:0] must be kept 00 for ISP 32-bit operation - * | | |ISPADDR[2:0] must be kept 000 for ISP 64-bit operation. - * | | |For CRC32 Checksum Calculation command, this field is the flash starting address for checksum calculation, 4 Kbytes alignment is necessary for CRC32 checksum calculation. - * | | |For FLASH 32-bit Program, ISP address needs word alignment (4-byte) - * | | |For FLASH 64-bit Program, ISP address needs double word alignment (8-byte). - * @var FMC_T::ISPDAT - * Offset: 0x08 ISP Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT |ISP Data - * | | |Write data to this register before ISP program operation. - * | | |Read data from this register after ISP read operation. - * | | |When ISPFF (FMC_ISPCTL[6]) is 1, ISPDAT = 0xffff_ffff - * | | |For Run CRC32 Checksum Calculation command, ISPDAT is the memory size (byte) and 4 Kbytes alignment - * | | |For ISP Read CRC32 Checksum command, ISPDAT is the checksum result - * | | |If ISPDAT = 0x0000_0000, it means that (1) the checksum calculation is in progress, or (2) the memory range for checksum calculation is incorrect - * @var FMC_T::ISPCMD - * Offset: 0x0C ISP Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |CMD |ISP Command - * | | |ISP command table is shown below: - * | | |0x00= FLASH Read. - * | | |0x04= Read Unique ID. - * | | |0x08= Read Flash All-One Result. - * | | |0x0B= Read Company ID. - * | | |0x0C= Read Device ID. - * | | |0x0D= Read Checksum. - * | | |0x21= FLASH 32-bit Program. - * | | |0x22= FLASH Page Erase. Erase any page in two banks, except for OTP. - * | | |0x23= FLASH Bank Erase. Erase all pages of APROM in BANK0 or BANK1. - * | | |0x27= FLASH Multi-Word Program. - * | | |0x28= Run Flash All-One Verification. - * | | |0x2C= Bank Remap. - * | | |0x2D= Run Checksum Calculation. - * | | |0x2E= Vector Remap. - * | | |0x40= FLASH 64-bit Read. - * | | |0x61= FLASH 64-bit Program. - * | | |The other commands are invalid. - * @var FMC_T::ISPTRG - * Offset: 0x10 ISP Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPGO |ISP Start Trigger (Write Protect) - * | | |Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP operation is finished. - * | | |0 = ISP operation is finished. - * | | |1 = ISP is progressed. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::DFBA - * Offset: 0x14 Data Flash Base Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DFBA |Data Flash Base Address - * | | |This register indicates Data Flash start address. It is a read only register. - * | | |The Data Flash is shared with APROM. the content of this register is loaded from CONFIG1 - * | | |This register is valid when DFEN (CONFIG0[0]) =0 . - * @var FMC_T::ISPSTS - * Offset: 0x40 ISP Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPBUSY |ISP Busy Flag (Read Only) - * | | |Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP operation is finished. - * | | |This bit is the mirror of ISPGO(FMC_ISPTRG[0]). - * | | |0 = ISP operation is finished. - * | | |1 = ISP is progressed. - * |[2:1] |CBS |Boot Selection of CONFIG (Read Only) - * | | |This bit is initiated with the CBS (CONFIG0[7:6]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened. - * | | |The following function is valid when MBS (FMC_ISPSTS[3])= 1. - * | | |00 = LDROM with IAP mode. - * | | |01 = LDROM without IAP mode. - * | | |10 = APROM with IAP mode. - * | | |11 = APROM without IAP mode. - * |[3] |MBS |Boot From Boot Loader Selection Flag (Read Only) - * | | |This bit is initiated with the MBS (CONFIG0[5]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened - * | | |0 = Booting from Boot Loader. - * | | |1 = Booting from LDROM/APROM.(.see CBS bit setting) - * |[5] |PGFF |Flash Program with Fast Verification Flag (Read Only) - * | | |This bit is set if data is mismatched at ISP programming verification - * | | |This bit is clear by performing ISP flash erase or ISP read CID operation - * | | |0 = Flash Program is success. - * | | |1 = Flash Program is fail. Program data is different with data in the flash memory - * |[6] |ISPFF |ISP Fail Flag (Write Protect) - * | | |This bit is the mirror of ISPFF (FMC_ISPCTL[6]), it needs to be cleared by writing 1 to FMC_ISPCTL[6] or FMC_ISPSTS[6] - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0 - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection - * | | |(7) Erase or Program command at brown-out detected - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands - * | | |(10) Vector address is mapping to SPROM region. - * | | |(11) KPROM is erased/programmed if KEYLOCK is set to 1 - * | | |(12) APROM(except for Data Flash) is erased/programmed if KEYLOCK is set to 1 - * | | |(13) LDROM is erased/programmed if KEYLOCK is set to 1 - * | | |(14) SPROM is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1. - * | | |(15) CONFIG is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1. - * | | |(16) Invalid operations (except for chip erase) with ICE connection if SBLOCK is not 0x5A - * | | |(17) Read any content of boot loader with ICE connection - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |ALLONE |Flash All-one Verification Flag - * | | |This bit is set by hardware if all of flash bits are 1, and clear if flash bits are not all 1 after "Run Flash All-One Verification" complete; this bit also can be clear by writing 1 - * | | |0 = All of flash bits are 1 after "Run Flash All-One Verification" complete. - * | | |1 = Flash bits are not all 1 after "Run Flash All-One Verification" complete. - * |[23:9] |VECMAP |Vector Page Mapping Address (Read Only) - * | | |All access to 0x0000_0000~0x0000_01FF is remapped to the flash memory address {VECMAP[14:0], 9u2019h000} ~ {VECMAP[14:0], 9u2019h1FF} - * |[24] |INTFLAG |ISP Interrupt Flag - * | | |0 = ISP Not Finished. - * | | |1 = ISP done or ISPFF set. - * | | |Note: This function needs to be enabled by FMC_ISPCTRL[24]. - * |[28] |ISPCERR |ISP Conflict Error - * | | |This bit shows when FMC is doing ISP operation. User cannot access FMC_ISP_ADDR,FMC_ISPDAT,FMC_ISPCMD,FMC_ISPTRG. It would cause ISPFF. - * |[30] |FBS |Flash Bank Selection - * | | |This bit indicate which bank is selected to boot. - * | | |0 = Booting from BANK0. - * | | |1 = Booting from BANK1. - * @var FMC_T::CYCCTL - * Offset: 0x4C Flash Access Cycle Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CYCLE |Flash Access Cycle Control (Write Protect) - * | | |0001 = CPU access with one wait cycle if cache miss; flash access cycle is 1;. - * | | |The HCLK working frequency range range is<27MHz - * | | |0010 = CPU access with two wait cycles if cache miss; flash access cycle is 2;. - * | | | The optimized HCLK working frequency range is 27~54 MHz - * | | |0011 = CPU access with three wait cycles if cache miss; flash access cycle is 3;. - * | | |The optimized HCLK working frequency range is 54~81MHz - * | | |0100 = CPU access with four wait cycles if cache miss; flash access cycle is 4;. - * | | | The optimized HCLK working frequency range is81~108MHz - * | | |0101 = CPU access with five wait cycles if cache miss; flash access cycle is 5;. - * | | |The optimized HCLK working frequency range is 108~135MHz - * | | |0110 = CPU access with six wait cycles if cache miss; flash access cycle is 6;. - * | | | The optimized HCLK working frequency range is 135~162MHz - * | | |0111 = CPU access with seven wait cycles if cache miss; flash access cycle is 7;. - * | | | The optimized HCLK working frequency range is 162~192MHz - * | | |1000 = CPU access with eight wait cycles if cache miss; flash access cycle is 8;. - * | | |The optimized HCLK working frequency range is >192MHz - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::MPDAT0 - * Offset: 0x80 ISP Data0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT0 |ISP Data 0 - * | | |This register is the first 32-bit data for 32-bit/64-bit/multi-word programming, and it is also the mirror of FMC_ISPDAT, both registers keep the same data - * @var FMC_T::MPDAT1 - * Offset: 0x84 ISP Data1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT1 |ISP Data 1 - * | | |This register is the second 32-bit data for 64-bit/multi-word programming. - * @var FMC_T::MPDAT2 - * Offset: 0x88 ISP Data2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT2 |ISP Data 2 - * | | |This register is the third 32-bit data for multi-word programming. - * @var FMC_T::MPDAT3 - * Offset: 0x8C ISP Data3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT3 |ISP Data 3 - * | | |This register is the fourth 32-bit data for multi-word programming. - * @var FMC_T::MPSTS - * Offset: 0xC0 ISP Multi-Program Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MPBUSY |ISP Multi-word Program Busy Flag (Read Only) - * | | |Write 1 to start ISP Multi-Word program operation and this bit will be cleared to 0 by hardware automatically when ISP Multi-Word program operation is finished. - * | | |This bit is the mirror of ISPGO(FMC_ISPTRG[0]). - * | | |0 = ISP Multi-Word program operation is finished. - * | | |1 = ISP Multi-Word program operation is progressed. - * |[1] |PPGO |ISP Multi-program Status (Read Only) - * | | |0 = ISP multi-word program operation is not active. - * | | |1 = ISP multi-word program operation is in progress. - * |[2] |ISPFF |ISP Fail Flag (Read Only) - * | | |This bit is the mirror of ISPFF (FMC_ISPCTL[6]), it needs to be cleared by writing 1 to FMC_ISPCTL[6] or FMC_ISPSTS[6] - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0 - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection - * | | |(7) Erase or Program command at brown-out detected - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands - * | | |(10) Vector address is mapping to SPROM region. - * |[4] |D0 |ISP DATA 0 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT0 is written and auto-clear to 0 when the FMC_MPDAT0 data is programmed to flash complete. - * | | |0 = FMC_MPDAT0 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT0 register has been written, and not program to flash complete. - * |[5] |D1 |ISP DATA 1 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT1 is written and auto-clear to 0 when the FMC_MPDAT1 data is programmed to flash complete. - * | | |0 = FMC_MPDAT1 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT1 register has been written, and not program to flash complete. - * |[6] |D2 |ISP DATA 2 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT2 is written and auto-clear to 0 when the FMC_MPDAT2 data is programmed to flash complete. - * | | |0 = FMC_MPDAT2 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT2 register has been written, and not program to flash complete. - * |[7] |D3 |ISP DATA 3 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT3 is written and auto-clear to 0 when the FMC_MPDAT3 data is programmed to flash complete. - * | | |0 = FMC_MPDAT3 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT3 register has been written, and not program to flash complete. - * @var FMC_T::MPADDR - * Offset: 0xC4 ISP Multi-Program Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MPADDR |ISP Multi-word Program Address - * | | |MPADDR is the address of ISP multi-word program operation when ISPGO flag is 1. - * | | |MPADDR will keep the final ISP address when ISP multi-word program is complete. - * @var FMC_T::XOMR0STS - * Offset: 0xD0 XOM Region 0 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 0 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 0. - * |[31:8] |BASE |XOM Region 0 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 0. - * @var FMC_T::XOMR1STS - * Offset: 0xD4 XOM Region 1 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 1 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 1. - * |[31:8] |BASE |XOM Region 1 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 1. - * @var FMC_T::XOMR2STS - * Offset: 0xD8 XOM Region 2 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 2 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 2. - * |[31:8] |BASE |XOM Region 2 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 2. - * @var FMC_T::XOMR3STS - * Offset: 0xDC XOM Region 3 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SIZE |XOM Region 3 Size (Page-aligned) - * | | |SIZE is the page number of XOM Region 3. - * |[31:8] |BASE |XOM Region 3 Base Address (Page-aligned) - * | | |BASE is the base address of XOM Region 3. - * @var FMC_T::XOMSTS - * Offset: 0xE0 XOM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |XOMR0ON |XOM Region 0 On - * | | |XOM Region 0 active status. - * | | |0 = No active. - * | | |1 = XOM region 0 is active. - * |[1] |XOMR1ON |XOM Region 1 On - * | | |XOM Region 1 active status. - * | | |0 = No active. - * | | |1 = XOM region 1 is active. - * |[2] |XOMR2ON |XOM Region 2 On - * | | |XOM Region 2 active status. - * | | |0 = No active. - * | | |1 = XOM region 2 is active. - * |[3] |XOMR3ON |XOM Region 3 On - * | | |XOM Region 3 active status. - * | | |0 = No active. - * | | |1 = XOM region 3 is active. - * |[4] |XOMPEF |XOM Page Erase Function Fail - * | | |XOM page erase function status. If XOMPEF is set to 1, user needs to erase XOM region again. - * | | |0 = Success. - * | | |1 = Fail. - * @var FMC_T::APPROT - * Offset: 0x110 APROM Protect Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |APPROENn |APROM Proect enable - * | n=0,1..| |This bit indicates which APROM region is protected. - * | ..31 | |0 = APROM region n is not protected. - * | | |1 = APROM region n is protected. - * | | |Note: APROM protect region is 0x0 + n*(0x8000) to 0x7fff + n*(0x8000) - */ - - __IO uint32_t ISPCTL; /*!< [0x0000] ISP Control Register */ - __IO uint32_t ISPADDR; /*!< [0x0004] ISP Address Register */ - __IO uint32_t ISPDAT; /*!< [0x0008] ISP Data Register */ - __IO uint32_t ISPCMD; /*!< [0x000c] ISP Command Register */ - __IO uint32_t ISPTRG; /*!< [0x0010] ISP Trigger Control Register */ - __I uint32_t DFBA; /*!< [0x0014] Data Flash Base Address */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[10]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ISPSTS; /*!< [0x0040] ISP Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CYCCTL; /*!< [0x004c] Flash Access Cycle Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[12]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t MPDAT0; /*!< [0x0080] ISP Data0 Register */ - __IO uint32_t MPDAT1; /*!< [0x0084] ISP Data1 Register */ - __IO uint32_t MPDAT2; /*!< [0x0088] ISP Data2 Register */ - __IO uint32_t MPDAT3; /*!< [0x008c] ISP Data3 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[12]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t MPSTS; /*!< [0x00c0] ISP Multi-Program Status Register */ - __I uint32_t MPADDR; /*!< [0x00c4] ISP Multi-Program Address Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[2]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t XOMR0STS; /*!< [0x00d0] XOM Region 0 Status Register */ - __I uint32_t XOMR1STS; /*!< [0x00d4] XOM Region 1 Status Register */ - __I uint32_t XOMR2STS; /*!< [0x00d8] XOM Region 2 Status Register */ - __I uint32_t XOMR3STS; /*!< [0x00dc] XOM Region 3 Status Register */ - __I uint32_t XOMSTS; /*!< [0x00e0] XOM Status Register */ - __I uint32_t RESERVE5[11]; - __IO uint32_t APPROT; /*!< [0x0110] XOM Status Register */ - -} FMC_T; - -/** - @addtogroup FMC_CONST FMC Bit Field Definition - Constant Definitions for FMC Controller -@{ */ - -#define FMC_ISPCTL_ISPEN_Pos (0) /*!< FMC_T::ISPCTL: ISPEN Position */ -#define FMC_ISPCTL_ISPEN_Msk (0x1ul << FMC_ISPCTL_ISPEN_Pos) /*!< FMC_T::ISPCTL: ISPEN Mask */ - -#define FMC_ISPCTL_BS_Pos (1) /*!< FMC_T::ISPCTL: BS Position */ -#define FMC_ISPCTL_BS_Msk (0x1ul << FMC_ISPCTL_BS_Pos) /*!< FMC_T::ISPCTL: BS Mask */ - -#define FMC_ISPCTL_SPUEN_Pos (2) /*!< FMC_T::ISPCTL: SPUEN Position */ -#define FMC_ISPCTL_SPUEN_Msk (0x1ul << FMC_ISPCTL_SPUEN_Pos) /*!< FMC_T::ISPCTL: SPUEN Mask */ - -#define FMC_ISPCTL_APUEN_Pos (3) /*!< FMC_T::ISPCTL: APUEN Position */ -#define FMC_ISPCTL_APUEN_Msk (0x1ul << FMC_ISPCTL_APUEN_Pos) /*!< FMC_T::ISPCTL: APUEN Mask */ - -#define FMC_ISPCTL_CFGUEN_Pos (4) /*!< FMC_T::ISPCTL: CFGUEN Position */ -#define FMC_ISPCTL_CFGUEN_Msk (0x1ul << FMC_ISPCTL_CFGUEN_Pos) /*!< FMC_T::ISPCTL: CFGUEN Mask */ - -#define FMC_ISPCTL_LDUEN_Pos (5) /*!< FMC_T::ISPCTL: LDUEN Position */ -#define FMC_ISPCTL_LDUEN_Msk (0x1ul << FMC_ISPCTL_LDUEN_Pos) /*!< FMC_T::ISPCTL: LDUEN Mask */ - -#define FMC_ISPCTL_ISPFF_Pos (6) /*!< FMC_T::ISPCTL: ISPFF Position */ -#define FMC_ISPCTL_ISPFF_Msk (0x1ul << FMC_ISPCTL_ISPFF_Pos) /*!< FMC_T::ISPCTL: ISPFF Mask */ - -#define FMC_ISPCTL_BL_Pos (16) /*!< FMC_T::ISPCTL: BL Position */ -#define FMC_ISPCTL_BL_Msk (0x1ul << FMC_ISPCTL_BL_Pos) /*!< FMC_T::ISPCTL: BL Mask */ - -#define FMC_ISPADDR_ISPADDR_Pos (0) /*!< FMC_T::ISPADDR: ISPADDR Position */ -#define FMC_ISPADDR_ISPADDR_Msk (0xfffffffful << FMC_ISPADDR_ISPADDR_Pos) /*!< FMC_T::ISPADDR: ISPADDR Mask */ - -#define FMC_ISPDAT_ISPDAT_Pos (0) /*!< FMC_T::ISPDAT: ISPDAT Position */ -#define FMC_ISPDAT_ISPDAT_Msk (0xfffffffful << FMC_ISPDAT_ISPDAT_Pos) /*!< FMC_T::ISPDAT: ISPDAT Mask */ - -#define FMC_ISPCMD_CMD_Pos (0) /*!< FMC_T::ISPCMD: CMD Position */ -#define FMC_ISPCMD_CMD_Msk (0x7ful << FMC_ISPCMD_CMD_Pos) /*!< FMC_T::ISPCMD: CMD Mask */ - -#define FMC_ISPTRG_ISPGO_Pos (0) /*!< FMC_T::ISPTRG: ISPGO Position */ -#define FMC_ISPTRG_ISPGO_Msk (0x1ul << FMC_ISPTRG_ISPGO_Pos) /*!< FMC_T::ISPTRG: ISPGO Mask */ - -#define FMC_DFBA_DFBA_Pos (0) /*!< FMC_T::DFBA: DFBA Position */ -#define FMC_DFBA_DFBA_Msk (0xfffffffful << FMC_DFBA_DFBA_Pos) /*!< FMC_T::DFBA: DFBA Mask */ - -#define FMC_ISPSTS_ISPBUSY_Pos (0) /*!< FMC_T::ISPSTS: ISPBUSY Position */ -#define FMC_ISPSTS_ISPBUSY_Msk (0x1ul << FMC_ISPSTS_ISPBUSY_Pos) /*!< FMC_T::ISPSTS: ISPBUSY Mask */ - -#define FMC_ISPSTS_CBS_Pos (1) /*!< FMC_T::ISPSTS: CBS Position */ -#define FMC_ISPSTS_CBS_Msk (0x3ul << FMC_ISPSTS_CBS_Pos) /*!< FMC_T::ISPSTS: CBS Mask */ - -#define FMC_ISPSTS_MBS_Pos (3) /*!< FMC_T::ISPSTS: MBS Position */ -#define FMC_ISPSTS_MBS_Msk (0x1ul << FMC_ISPSTS_MBS_Pos) /*!< FMC_T::ISPSTS: MBS Mask */ - -#define FMC_ISPSTS_PGFF_Pos (5) /*!< FMC_T::ISPSTS: PGFF Position */ -#define FMC_ISPSTS_PGFF_Msk (0x1ul << FMC_ISPSTS_PGFF_Pos) /*!< FMC_T::ISPSTS: PGFF Mask */ - -#define FMC_ISPSTS_ISPFF_Pos (6) /*!< FMC_T::ISPSTS: ISPFF Position */ -#define FMC_ISPSTS_ISPFF_Msk (0x1ul << FMC_ISPSTS_ISPFF_Pos) /*!< FMC_T::ISPSTS: ISPFF Mask */ - -#define FMC_ISPSTS_ALLONE_Pos (7) /*!< FMC_T::ISPSTS: ALLONE Position */ -#define FMC_ISPSTS_ALLONE_Msk (0x1ul << FMC_ISPSTS_ALLONE_Pos) /*!< FMC_T::ISPSTS: ALLONE Mask */ - -#define FMC_ISPSTS_VECMAP_Pos (9) /*!< FMC_T::ISPSTS: VECMAP Position */ -#define FMC_ISPSTS_VECMAP_Msk (0x7ffful << FMC_ISPSTS_VECMAP_Pos) /*!< FMC_T::ISPSTS: VECMAP Mask */ - -#define FMC_ISPSTS_INTFLAG_Pos (24) /*!< FMC_T::ISPSTS: INTFLAG Position */ -#define FMC_ISPSTS_INTFLAG_Msk (0x01ul << FMC_ISPSTS_INTFLAG_Pos) /*!< FMC_T::ISPSTS: INTFLAG Position */ - -#define FMC_ISPSTS_ISPCERR_Pos (28) /*!< FMC_T::ISPSTS: ISPCERR Position */ -#define FMC_ISPSTS_ISPCERR_Msk (0x01ul << FMC_ISPSTS_ISPCERR_Pos) /*!< FMC_T::ISPSTS: ISPCERR Position */ - -#define FMC_ISPSTS_FBS_Pos (30) /*!< FMC_T::ISPSTS: FBS Position */ -#define FMC_ISPSTS_FBS_Msk (0x1ul << FMC_ISPSTS_FBS_Pos) /*!< FMC_T::ISPSTS: FBS Msk */ - -#define FMC_CYCCTL_CYCLE_Pos (0) /*!< FMC_T::CYCCTL: CYCLE Position */ -#define FMC_CYCCTL_CYCLE_Msk (0xful << FMC_CYCCTL_CYCLE_Pos) /*!< FMC_T::CYCCTL: CYCLE Mask */ - -#define FMC_MPDAT0_ISPDAT0_Pos (0) /*!< FMC_T::MPDAT0: ISPDAT0 Position */ -#define FMC_MPDAT0_ISPDAT0_Msk (0xfffffffful << FMC_MPDAT0_ISPDAT0_Pos) /*!< FMC_T::MPDAT0: ISPDAT0 Mask */ - -#define FMC_MPDAT1_ISPDAT1_Pos (0) /*!< FMC_T::MPDAT1: ISPDAT1 Position */ -#define FMC_MPDAT1_ISPDAT1_Msk (0xfffffffful << FMC_MPDAT1_ISPDAT1_Pos) /*!< FMC_T::MPDAT1: ISPDAT1 Mask */ - -#define FMC_MPDAT2_ISPDAT2_Pos (0) /*!< FMC_T::MPDAT2: ISPDAT2 Position */ -#define FMC_MPDAT2_ISPDAT2_Msk (0xfffffffful << FMC_MPDAT2_ISPDAT2_Pos) /*!< FMC_T::MPDAT2: ISPDAT2 Mask */ - -#define FMC_MPDAT3_ISPDAT3_Pos (0) /*!< FMC_T::MPDAT3: ISPDAT3 Position */ -#define FMC_MPDAT3_ISPDAT3_Msk (0xfffffffful << FMC_MPDAT3_ISPDAT3_Pos) /*!< FMC_T::MPDAT3: ISPDAT3 Mask */ - -#define FMC_MPSTS_MPBUSY_Pos (0) /*!< FMC_T::MPSTS: MPBUSY Position */ -#define FMC_MPSTS_MPBUSY_Msk (0x1ul << FMC_MPSTS_MPBUSY_Pos) /*!< FMC_T::MPSTS: MPBUSY Mask */ - -#define FMC_MPSTS_PPGO_Pos (1) /*!< FMC_T::MPSTS: PPGO Position */ -#define FMC_MPSTS_PPGO_Msk (0x1ul << FMC_MPSTS_PPGO_Pos) /*!< FMC_T::MPSTS: PPGO Mask */ - -#define FMC_MPSTS_ISPFF_Pos (2) /*!< FMC_T::MPSTS: ISPFF Position */ -#define FMC_MPSTS_ISPFF_Msk (0x1ul << FMC_MPSTS_ISPFF_Pos) /*!< FMC_T::MPSTS: ISPFF Mask */ - -#define FMC_MPSTS_D0_Pos (4) /*!< FMC_T::MPSTS: D0 Position */ -#define FMC_MPSTS_D0_Msk (0x1ul << FMC_MPSTS_D0_Pos) /*!< FMC_T::MPSTS: D0 Mask */ - -#define FMC_MPSTS_D1_Pos (5) /*!< FMC_T::MPSTS: D1 Position */ -#define FMC_MPSTS_D1_Msk (0x1ul << FMC_MPSTS_D1_Pos) /*!< FMC_T::MPSTS: D1 Mask */ - -#define FMC_MPSTS_D2_Pos (6) /*!< FMC_T::MPSTS: D2 Position */ -#define FMC_MPSTS_D2_Msk (0x1ul << FMC_MPSTS_D2_Pos) /*!< FMC_T::MPSTS: D2 Mask */ - -#define FMC_MPSTS_D3_Pos (7) /*!< FMC_T::MPSTS: D3 Position */ -#define FMC_MPSTS_D3_Msk (0x1ul << FMC_MPSTS_D3_Pos) /*!< FMC_T::MPSTS: D3 Mask */ - -#define FMC_MPADDR_MPADDR_Pos (0) /*!< FMC_T::MPADDR: MPADDR Position */ -#define FMC_MPADDR_MPADDR_Msk (0xfffffffful << FMC_MPADDR_MPADDR_Pos) /*!< FMC_T::MPADDR: MPADDR Mask */ - -#define FMC_XOMR0STS_SIZE_Pos (0) /*!< FMC_T::XOMR0STS: SIZE Position */ -#define FMC_XOMR0STS_SIZE_Msk (0xfful << FMC_XOMR0STS_SIZE_Pos) /*!< FMC_T::XOMR0STS: SIZE Mask */ - -#define FMC_XOMR0STS_BASE_Pos (8) /*!< FMC_T::XOMR0STS: BASE Position */ -#define FMC_XOMR0STS_BASE_Msk (0xfffffful << FMC_XOMR0STS_BASE_Pos) /*!< FMC_T::XOMR0STS: BASE Mask */ - -#define FMC_XOMR1STS_SIZE_Pos (0) /*!< FMC_T::XOMR1STS: SIZE Position */ -#define FMC_XOMR1STS_SIZE_Msk (0xfful << FMC_XOMR1STS_SIZE_Pos) /*!< FMC_T::XOMR1STS: SIZE Mask */ - -#define FMC_XOMR1STS_BASE_Pos (8) /*!< FMC_T::XOMR1STS: BASE Position */ -#define FMC_XOMR1STS_BASE_Msk (0xfffffful << FMC_XOMR1STS_BASE_Pos) /*!< FMC_T::XOMR1STS: BASE Mask */ - -#define FMC_XOMR2STS_SIZE_Pos (0) /*!< FMC_T::XOMR2STS: SIZE Position */ -#define FMC_XOMR2STS_SIZE_Msk (0xfful << FMC_XOMR2STS_SIZE_Pos) /*!< FMC_T::XOMR2STS: SIZE Mask */ - -#define FMC_XOMR2STS_BASE_Pos (8) /*!< FMC_T::XOMR2STS: BASE Position */ -#define FMC_XOMR2STS_BASE_Msk (0xfffffful << FMC_XOM20STS_BASE_Pos) /*!< FMC_T::XOMR2STS: BASE Mask */ - -#define FMC_XOMR3STS_SIZE_Pos (0) /*!< FMC_T::XOMR3STS: SIZE Position */ -#define FMC_XOMR3STS_SIZE_Msk (0xfful << FMC_XOMR3STS_SIZE_Pos) /*!< FMC_T::XOMR3STS: SIZE Mask */ - -#define FMC_XOMR3STS_BASE_Pos (8) /*!< FMC_T::XOMR3STS: BASE Position */ -#define FMC_XOMR3STS_BASE_Msk (0xfffffful << FMC_XOMR3STS_BASE_Pos) /*!< FMC_T::XOMR3STS: BASE Mask */ - -#define FMC_XOMSTS_XOMR0ON_Pos (0) /*!< FMC_T::XOMSTS: XOMR0ON Position */ -#define FMC_XOMSTS_XOMR0ON_Msk (0x1ul << FMC_XOMSTS_XOMR0ON_Pos) /*!< FMC_T::XOMSTS: XOMR0ON Mask */ - -#define FMC_XOMSTS_XOMR1ON_Pos (1) /*!< FMC_T::XOMSTS: XOMR1ON Position */ -#define FMC_XOMSTS_XOMR1ON_Msk (0x1ul << FMC_XOMSTS_XOMR1ON_Pos) /*!< FMC_T::XOMSTS: XOMR1ON Mask */ - -#define FMC_XOMSTS_XOMR2ON_Pos (2) /*!< FMC_T::XOMSTS: XOMR2ON Position */ -#define FMC_XOMSTS_XOMR2ON_Msk (0x1ul << FMC_XOMSTS_XOMR2ON_Pos) /*!< FMC_T::XOMSTS: XOMR2ON Mask */ - -#define FMC_XOMSTS_XOMR3ON_Pos (3) /*!< FMC_T::XOMSTS: XOMR3ON Position */ -#define FMC_XOMSTS_XOMR3ON_Msk (0x1ul << FMC_XOMSTS_XOMR3ON_Pos) /*!< FMC_T::XOMSTS: XOMR3ON Mask */ - -#define FMC_XOMSTS_XOMPEF_Pos (4) /*!< FMC_T::XOMSTS: XOMPEF Position */ -#define FMC_XOMSTS_XOMPEF_Msk (0x1ul << FMC_XOMSTS_XOMPEF_Pos) /*!< FMC_T::XOMSTS: XOMPEF Mask */ - -#define FMC_APPROT_APPROEN0_Pos (0) /*!< FMC_T::APPROT: APPROEN0 Position */ -#define FMC_APPROT_APPROEN0_Msk (0x1ul << FMC_APPROT_APPROEN0_Pos) /*!< FMC_T::APPROT: APPROEN0 Mask */ - -#define FMC_APPROT_APPROEN1_Pos (1) /*!< FMC_T::APPROT: APPROEN1 Position */ -#define FMC_APPROT_APPROEN1_Msk (0x1ul << FMC_APPROT_APPROEN1_Pos) /*!< FMC_T::APPROT: APPROEN1 Mask */ - -#define FMC_APPROT_APPROEN2_Pos (2) /*!< FMC_T::APPROT: APPROEN2 Position */ -#define FMC_APPROT_APPROEN2_Msk (0x1ul << FMC_APPROT_APPROEN2_Pos) /*!< FMC_T::APPROT: APPROEN2 Mask */ - -#define FMC_APPROT_APPROEN3_Pos (3) /*!< FMC_T::APPROT: APPROEN3 Position */ -#define FMC_APPROT_APPROEN3_Msk (0x1ul << FMC_APPROT_APPROEN3_Pos) /*!< FMC_T::APPROT: APPROEN3 Mask */ - -#define FMC_APPROT_APPROEN4_Pos (4) /*!< FMC_T::APPROT: APPROEN4 Position */ -#define FMC_APPROT_APPROEN4_Msk (0x1ul << FMC_APPROT_APPROEN4_Pos) /*!< FMC_T::APPROT: APPROEN4 Mask */ - -#define FMC_APPROT_APPROEN5_Pos (5) /*!< FMC_T::APPROT: APPROEN5 Position */ -#define FMC_APPROT_APPROEN5_Msk (0x1ul << FMC_APPROT_APPROEN5_Pos) /*!< FMC_T::APPROT: APPROEN5 Mask */ - -#define FMC_APPROT_APPROEN6_Pos (6) /*!< FMC_T::APPROT: APPROEN6 Position */ -#define FMC_APPROT_APPROEN6_Msk (0x1ul << FMC_APPROT_APPROEN6_Pos) /*!< FMC_T::APPROT: APPROEN6 Mask */ - -#define FMC_APPROT_APPROEN7_Pos (7) /*!< FMC_T::APPROT: APPROEN7 Position */ -#define FMC_APPROT_APPROEN7_Msk (0x1ul << FMC_APPROT_APPROEN7_Pos) /*!< FMC_T::APPROT: APPROEN7 Mask */ - -#define FMC_APPROT_APPROEN8_Pos (8) /*!< FMC_T::APPROT: APPROEN8 Position */ -#define FMC_APPROT_APPROEN8_Msk (0x1ul << FMC_APPROT_APPROEN8_Pos) /*!< FMC_T::APPROT: APPROEN8 Mask */ - -#define FMC_APPROT_APPROEN9_Pos (9) /*!< FMC_T::APPROT: APPROEN9 Position */ -#define FMC_APPROT_APPROEN9_Msk (0x1ul << FMC_APPROT_APPROEN9_Pos) /*!< FMC_T::APPROT: APPROEN9 Mask */ - -#define FMC_APPROT_APPROEN10_Pos (10) /*!< FMC_T::APPROT: APPROEN10 Position */ -#define FMC_APPROT_APPROEN10_Msk (0x1ul << FMC_APPROT_APPROEN10_Pos) /*!< FMC_T::APPROT: APPROEN10 Mask */ - -#define FMC_APPROT_APPROEN11_Pos (11) /*!< FMC_T::APPROT: APPROEN11 Position */ -#define FMC_APPROT_APPROEN11_Msk (0x1ul << FMC_APPROT_APPROEN11_Pos) /*!< FMC_T::APPROT: APPROEN11 Mask */ - -#define FMC_APPROT_APPROEN12_Pos (12) /*!< FMC_T::APPROT: APPROEN12 Position */ -#define FMC_APPROT_APPROEN12_Msk (0x1ul << FMC_APPROT_APPROEN12_Pos) /*!< FMC_T::APPROT: APPROEN12 Mask */ - -#define FMC_APPROT_APPROEN13_Pos (13) /*!< FMC_T::APPROT: APPROEN13 Position */ -#define FMC_APPROT_APPROEN13_Msk (0x1ul << FMC_APPROT_APPROEN13_Pos) /*!< FMC_T::APPROT: APPROEN13 Mask */ - -#define FMC_APPROT_APPROEN14_Pos (14) /*!< FMC_T::APPROT: APPROEN14 Position */ -#define FMC_APPROT_APPROEN14_Msk (0x1ul << FMC_APPROT_APPROEN14_Pos) /*!< FMC_T::APPROT: APPROEN14 Mask */ - -#define FMC_APPROT_APPROEN15_Pos (15) /*!< FMC_T::APPROT: APPROEN15 Position */ -#define FMC_APPROT_APPROEN15_Msk (0x1ul << FMC_APPROT_APPROEN15_Pos) /*!< FMC_T::APPROT: APPROEN15 Mask */ - -#define FMC_APPROT_APPROEN16_Pos (16) /*!< FMC_T::APPROT: APPROEN16 Position */ -#define FMC_APPROT_APPROEN16_Msk (0x1ul << FMC_APPROT_APPROEN16_Pos) /*!< FMC_T::APPROT: APPROEN16 Mask */ - -#define FMC_APPROT_APPROEN17_Pos (17) /*!< FMC_T::APPROT: APPROEN17 Position */ -#define FMC_APPROT_APPROEN17_Msk (0x1ul << FMC_APPROT_APPROEN17_Pos) /*!< FMC_T::APPROT: APPROEN17 Mask */ - -#define FMC_APPROT_APPROEN18_Pos (18) /*!< FMC_T::APPROT: APPROEN18 Position */ -#define FMC_APPROT_APPROEN18_Msk (0x1ul << FMC_APPROT_APPROEN18_Pos) /*!< FMC_T::APPROT: APPROEN18 Mask */ - -#define FMC_APPROT_APPROEN19_Pos (19) /*!< FMC_T::APPROT: APPROEN19 Position */ -#define FMC_APPROT_APPROEN19_Msk (0x1ul << FMC_APPROT_APPROEN19_Pos) /*!< FMC_T::APPROT: APPROEN19 Mask */ - -#define FMC_APPROT_APPROEN20_Pos (20) /*!< FMC_T::APPROT: APPROEN20 Position */ -#define FMC_APPROT_APPROEN20_Msk (0x1ul << FMC_APPROT_APPROEN20_Pos) /*!< FMC_T::APPROT: APPROEN20 Mask */ - -#define FMC_APPROT_APPROEN21_Pos (21) /*!< FMC_T::APPROT: APPROEN21 Position */ -#define FMC_APPROT_APPROEN21_Msk (0x1ul << FMC_APPROT_APPROEN21_Pos) /*!< FMC_T::APPROT: APPROEN21 Mask */ - -#define FMC_APPROT_APPROEN22_Pos (22) /*!< FMC_T::APPROT: APPROEN22 Position */ -#define FMC_APPROT_APPROEN22_Msk (0x1ul << FMC_APPROT_APPROEN22_Pos) /*!< FMC_T::APPROT: APPROEN22 Mask */ - -#define FMC_APPROT_APPROEN23_Pos (23) /*!< FMC_T::APPROT: APPROEN23 Position */ -#define FMC_APPROT_APPROEN23_Msk (0x1ul << FMC_APPROT_APPROEN23_Pos) /*!< FMC_T::APPROT: APPROEN23 Mask */ - -#define FMC_APPROT_APPROEN24_Pos (24) /*!< FMC_T::APPROT: APPROEN24 Position */ -#define FMC_APPROT_APPROEN24_Msk (0x1ul << FMC_APPROT_APPROEN24_Pos) /*!< FMC_T::APPROT: APPROEN24 Mask */ - -#define FMC_APPROT_APPROEN25_Pos (25) /*!< FMC_T::APPROT: APPROEN25 Position */ -#define FMC_APPROT_APPROEN25_Msk (0x1ul << FMC_APPROT_APPROEN25_Pos) /*!< FMC_T::APPROT: APPROEN25 Mask */ - -#define FMC_APPROT_APPROEN26_Pos (26) /*!< FMC_T::APPROT: APPROEN26 Position */ -#define FMC_APPROT_APPROEN26_Msk (0x1ul << FMC_APPROT_APPROEN26_Pos) /*!< FMC_T::APPROT: APPROEN26 Mask */ - -#define FMC_APPROT_APPROEN27_Pos (27) /*!< FMC_T::APPROT: APPROEN27 Position */ -#define FMC_APPROT_APPROEN27_Msk (0x1ul << FMC_APPROT_APPROEN27_Pos) /*!< FMC_T::APPROT: APPROEN27 Mask */ - -#define FMC_APPROT_APPROEN28_Pos (28) /*!< FMC_T::APPROT: APPROEN28 Position */ -#define FMC_APPROT_APPROEN28_Msk (0x1ul << FMC_APPROT_APPROEN28_Pos) /*!< FMC_T::APPROT: APPROEN28 Mask */ - -#define FMC_APPROT_APPROEN29_Pos (29) /*!< FMC_T::APPROT: APPROEN29 Position */ -#define FMC_APPROT_APPROEN29_Msk (0x1ul << FMC_APPROT_APPROEN29_Pos) /*!< FMC_T::APPROT: APPROEN29 Mask */ - -#define FMC_APPROT_APPROEN30_Pos (30) /*!< FMC_T::APPROT: APPROEN30 Position */ -#define FMC_APPROT_APPROEN30_Msk (0x1ul << FMC_APPROT_APPROEN30_Pos) /*!< FMC_T::APPROT: APPROEN30 Mask */ - -#define FMC_APPROT_APPROEN31_Pos (31) /*!< FMC_T::APPROT: APPROEN31 Position */ -#define FMC_APPROT_APPROEN31_Msk (0x1ul << FMC_APPROT_APPROEN31_Pos) /*!< FMC_T::APPROT: APPROEN31 Mask */ - -/**@}*/ /* FMC_CONST */ -/**@}*/ /* end of FMC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __FMC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/gpio_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/gpio_reg.h deleted file mode 100644 index b18b3ed0a96..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/gpio_reg.h +++ /dev/null @@ -1,1104 +0,0 @@ -/**************************************************************************//** - * @file gpio_reg.h - * @version V3.00 - * @brief GPIO register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __GPIO_REG_H__ -#define __GPIO_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup GPIO General Purpose Input/Output Controller(GPIO) - Memory Mapped Structure for GPIO Controller -@{ */ - - -typedef struct -{ - - /** - * @var GPIO_T::MODE - * Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0/0x200/0x240 Port A-J I/O Mode Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|MODEn |Port A-J I/O Pin[n] Mode Control - * | | |Determine each I/O mode of Px.n pins. - * | | |00 = Px.n is in Input mode. - * | | |01 = Px.n is in Push-pull Output mode. - * | | |10 = Px.n is in Open-drain Output mode. - * | | |11 = Px.n is in Quasi-bidirectional mode. - * | | |Note 1: The initial value of this field is defined by CIOINI (CONFIG0 [10]). - * | | |If CIOINI is set to 0, the default value is 0xFFFF_FFFF and all pins will be quasi-bidirectional mode after chip powered on. - * | | |If CIOINI is set to 1, the default value is 0x0000_0000 and all pins will be input mode after chip powered on. - * | | |Note 2: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::DINOFF - * Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4/0x204/0x244 Port A-J Digital Input Path Disable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n+16] |DINOFFn |Port A-J Pin[n] Digital Input Path Disable Control - * | | |Each of these bits is used to control if the digital input path of corresponding Px.n pin is disabled. - * | | |If input is analog signal, users can disable Px.n digital input path to avoid input current leakage. - * | | |0 = Px.n digital input path Enabled. - * | | |1 = Px.n digital input path Disabled (digital input tied to low). - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::DOUT - * Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8/0x208/0x248 Port A-J Data Output Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DOUTn |Port A-J Pin[n] Output Value - * | | |Each of these bits controls the status of a Px.n pin when the Px.n is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |0 = Px.n will drive Low if the Px.n pin is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |1 = Px.n will drive High if the Px.n pin is configured as Push-pull output or Quasi-bidirectional mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::DATMSK - * Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC/0x20C/0x24C Port A-J Data Output Write Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DATMSKn |Port A-J Pin[n] Data Output Write Mask - * | | |These bits are used to protect the corresponding DOUT (Px_DOUT[n]) bit. - * | | |When the DATMSK (Px_DATMSK[n]) bit is set to 1, the corresponding DOUT (Px_DOUT[n]) bit is protected. - * | | |If the write signal is masked, writing data to the protect bit is ignored. - * | | |0 = Corresponding DOUT (Px_DOUT[n]) bit can be updated. - * | | |1 = Corresponding DOUT (Px_DOUT[n]) bit protected. - * | | |Note 1: This function only protects the corresponding DOUT (Px_DOUT[n]) bit, and will not protect the corresponding PDIO (Pxn_PDIO[n]) bit. - * | | |Note 2: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::PIN - * Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0/0x210/0x250 Port A-J Pin Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |PINn |Port A-J Pin[n] Pin Value - * | | |Each bit of the register reflects the actual status of the respective Px.n pin. - * | | |If the bit is 1, it indicates the corresponding pin status is high; else the pin status is low. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::DBEN - * Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4/0x214/0x254 Port A-J De-Bounce Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DBENn |Port A-J Pin[n] Input Signal De-Bounce Enable Bit - * | | |The DBEN[n] bit is used to enable the de-bounce function for each corresponding bit. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the interrupt. - * | | |The de-bounce clock source is controlled by DBCLKSRC (Px_DBCTL [4]), one de-bounce sample cycle period is controlled by DBCLKSEL (Px_DBCTL [3:0]). - * | | |0 = Px.n de-bounce function Disabled. - * | | |1 = Px.n de-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::INTTYPE - * Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8/0x208/0x258 Port A-J Interrupt Trigger Type Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |TYPEn |Port A-J Pin[n] Edge or Level Detection Interrupt Trigger Type Control - * | | |TYPE (Px_INTTYPE[n]) bit is used to control the triggered interrupt is by level trigger or by edge trigger. - * | | |If the interrupt is by edge trigger, the trigger source can be controlled by de-bounce. - * | | |If the interrupt is by level trigger, the input source is sampled by one HCLK clock and generates the interrupt. - * | | |0 = Edge trigger interrupt. - * | | |1 = Level trigger interrupt. - * | | |If the pin is set as the level trigger interrupt, only one level can be set on the registers RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]). - * | | |If both levels to trigger interrupt are set, the setting is ignored and no interrupt will occur. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::INTEN - * Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC/0x21C Port A-J Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |FLIENn |Port A-J Pin[n] Falling Edge or Low Level Interrupt Trigger Type Enable Bit - * | | |The FLIEN (Px_INTEN[n]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the FLIEN (Px_INTEN[n]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at low level. - * | | |If the interrupt is edge trigger(TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from high to low. - * | | |0 = Px.n level low or high to low interrupt Disabled. - * | | |1 = Px.n level low or high to low interrupt Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * |[n+16] |RHIENn |Port A-J Pin[n] Rising Edge or High Level Interrupt Trigger Type Enable Bit - * | | |The RHIEN (Px_INTEN[n+16]) bit is used to enable the interrupt for each of the corresponding input Px.n pin - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the RHIEN (Px_INTEN[n+16]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at high level. - * | | |If the interrupt is edge trigger (TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from low to high. - * | | |0 = Px.n level high or low to high interrupt Disabled. - * | | |1 = Px.n level high or low to high interrupt Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::INTSRC - * Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0/0x220/0x260 Port A-J Interrupt Source Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |INTSRCn |Port A-J Pin[n] Interrupt Source Flag - * | | |Write Operation : - * | | |0 = No action. - * | | |1 = Clear the corresponding pending interrupt. - * | | |Read Operation : - * | | |0 = No interrupt at Px.n. - * | | |1 = Px.n generates an interrupt. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::SMTEN - * Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4/0x224/0x264 Port A-J Input Schmitt Trigger Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |SMTENn |Port A-J Pin[n] Input Schmitt Trigger Enable Bit - * | | |0 = Px.n input Schmitt trigger function Disabled. - * | | |1 = Px.n input Schmitt trigger function Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::SLEWCTL - * Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8/0x228/0x268 Port A-J High Slew Rate Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|HSRENn |Port A-J Pin[n] High Slew Rate Control - * | | |00 = Px.n output with normal slew rate mode. - * | | |01 = Px.n output with high slew rate mode. - * | | |10 = Px.n output with fast slew rate mode. - * | | |11 = Reserved. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::PUSEL - * Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0/0x230/0x270 Port A-J Pull-up and Pull-down Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|PUSELn |Port A-J Pin[n] Pull-up and Pull-down Enable Register - * | | |Determine each I/O Pull-up/pull-down of Px.n pins. - * | | |00 = Px.n pull-up and pull-down disable. - * | | |01 = Px.n pull-up enable. - * | | |10 = Px.n pull-down enable. - * | | |11 = Reserved. - * | | |Note 1: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation: - * | | |The independent pull-up control register only valid when MODEn set as tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when MODEn set as tri-state mode. - * | | |When both pull-up pull-down is set as 1 at tri-state mode, keep I/O in tri-state mode. - * | | |Note 2: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var GPIO_T::DBCTL - * Offset: 0x34/0x74/0xB4/0xF4/0x134/0x174/0x1B4/0x1F4/0x234/0x274 Port A-J Interrupt De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DBCLKSEL |De-Bounce Sampling Cycle Selection - * | | |0000 = Sample interrupt input once per 1 clocks. - * | | |0001 = Sample interrupt input once per 2 clocks. - * | | |0010 = Sample interrupt input once per 4 clocks. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 2*256 clocks. - * | | |1010 = Sample interrupt input once per 4*256 clocks. - * | | |1011 = Sample interrupt input once per 8*256 clocks. - * | | |1100 = Sample interrupt input once per 16*256 clocks. - * | | |1101 = Sample interrupt input once per 32*256 clocks. - * | | |1110 = Sample interrupt input once per 64*256 clocks. - * | | |1111 = Sample interrupt input once per 128*256 clocks. - * |[4] |DBCLKSRC |De-Bounce Counter Clock Source Selection - * | | |0 = De-bounce counter clock source is the HCLK. - * | | |1 = De-bounce counter clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * |[5] |ICLKON |Interrupt Clock On Mode - * | | |0 = Edge detection circuit is active only if I/O pin corresponding RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]) bit is set to 1. - * | | |If corresponding RHIEN or FLIEN is 0, the clock of I/O detect circuit is stopped and interrupt source flag(Px_INTSRC) cannot be clear also. - * | | |1 = All I/O pins edge detection circuit is always active after reset. - * | | |Note: It is recommended to disable this bit to save system power if no special application concern. - * |[31] |DBCLKBUSY |De-bounce Clock Switching Busy Flag (Read Only) - * | | |This bit is set when de-bounce clock source is changed by setting DBCLKSRC(Px_DBCTL[4]). - * | | |And it is cleared after de-bounce clock source switching is finished. De-bounce function can work normally after de-bounce clock switch done. - * | | |0 = De-bounce clock switch done. - * | | |1 = De-bounce clock is switching. - */ - - __IO uint32_t MODE; /* Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0/0x200/0x240 Port A-J I/O Mode Control */ - __IO uint32_t DINOFF; /* Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4/0x204/0x244 Port A-J Digital Input Path Disable Control */ - __IO uint32_t DOUT; /* Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8/0x208/0x248 Port A-J Data Output Value */ - __IO uint32_t DATMSK; /* Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC/0x20C/0x24C Port A-J Data Output Write Mask */ - __I uint32_t PIN; /* Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0/0x210/0x250 Port A-J Pin Value */ - __IO uint32_t DBEN; /* Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4/0x214/0x254 Port A-J De-Bounce Enable Control Register */ - __IO uint32_t INTTYPE; /* Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8/0x218/0x258 Port A-J Interrupt Trigger Type Control */ - __IO uint32_t INTEN; /* Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC/0x21C/0x25C Port A-J Interrupt Enable Control Register */ - __IO uint32_t INTSRC; /* Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0/0x220/0x260 Port A-J Interrupt Source Flag */ - __IO uint32_t SMTEN; /* Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4/0x224/0x264 Port A-J Input Schmitt Trigger Enable Register */ - __IO uint32_t SLEWCTL; /* Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8/0x228/0x268 Port A-J High Slew Rate Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PUSEL; /* Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0/0x230/0x270 Port A-J Pull-up and Pull-down Enable Register */ - __IO uint32_t DBCTL; /* Offset: 0x34/0x74/0xB4/0xF4/0x134/0x174/0x1B4/0x1F4/0x234/0x274 Port A-J Interrupt De-bounce Control Register */ - -} GPIO_T; - -typedef struct -{ - - /** - * @var GPIO_INT_T::INTn_INNF - * Offset: 0x450/0x454/0x458/0x45C/0x460/0x464/0x468/0x46C INT0~7 Input Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |NFEN |Noise Filter Enable - * | | |0 = Noise Filter function Disabled. - * | | |1 = Noise Filter function Enabled. - * |[6:4] |NFSEL |Noise Filter Clock Selection - * | | |000 = Filter clock is HCLK. - * | | |001 = Filter clock is HCLK/2. - * | | |010 = Filter clock is HCLK/4. - * | | |011 = Filter clock is HCLK/8. - * | | |100 = Filter clock is HCLK/16 - * | | |101 = Filter clock is HCLK/32. - * | | |110 = Filter clock is HCLK/64. - * | | |111 = Filter clock is HCLK/128. - * |[10:8] |NFCNT |Noise Filter Count - * | | |The register bits control the filter counter to count from 0 to NFCNT. - * @var GPIO_INT_T::INT_EDETCTL - * Offset: 0x490 INT Edge Detect Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|EDETCTLn |INTn Edge Detect Control Bits - * | | |00 = Not detect. - * | | |01 = INTn low to high detection Enable. - * | | |10 = INTn high to low detection Enable. - * | | |11 = INTn both low to high and high to low detection Enable. - * @var GPIO_INT_T::INT_EDINTEN - * Offset: 0x498 INT Edge Detect Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |EDIENn |INTn Edge Detect Interrupt Enable Bit - * | | |0 = INTn Edge Detect Interrupt Disable. - * | | |1 = INTn Edge Detect Interrupt Enable. - * @var GPIO_INT_T::INT_EDSTS - * Offset: 0x49C INT Edge Detect Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |EDIFn |INTn Edge Detect Interrupt Flag - * | | |0 = No Edge Detection happened. - * | | |1 = Rising Edge or Falling edge has been detected. - * | | |Note: This bit is cleared by writing 1 to it. - */ - - __IO uint32_t INT_INNF[8]; /* Offset: 0x450/0x454/0x458/0x45C/0x460/0x464/0x468/0x46C INT0~7 Input Noise Filter Register */ - __I uint32_t RESERVE1[8]; - __IO uint32_t INT_EDETCTL; /* Offset: 0x490 INT Edge Detect Control Register */ - __I uint32_t RESERVE2[1]; - __IO uint32_t INT_EDINTEN; /* Offset: 0x498 INT Edge Detect Interrupt Enable Control Register */ - __IO uint32_t INT_EDSTS; /* Offset: 0x49C INT Edge Detect Interrupt Flag Register */ - -} GPIO_INT_T; - -/** - @addtogroup GPIO_CONST GPIO Bit Field Definition - Constant Definitions for GPIO Controller -@{ */ - -#define GPIO_MODE_MODE0_Pos (0) /*!< GPIO_T::MODE: MODE0 Position */ -#define GPIO_MODE_MODE0_Msk (0x3ul << GPIO_MODE_MODE0_Pos) /*!< GPIO_T::MODE: MODE0 Mask */ - -#define GPIO_MODE_MODE1_Pos (2) /*!< GPIO_T::MODE: MODE1 Position */ -#define GPIO_MODE_MODE1_Msk (0x3ul << GPIO_MODE_MODE1_Pos) /*!< GPIO_T::MODE: MODE1 Mask */ - -#define GPIO_MODE_MODE2_Pos (4) /*!< GPIO_T::MODE: MODE2 Position */ -#define GPIO_MODE_MODE2_Msk (0x3ul << GPIO_MODE_MODE2_Pos) /*!< GPIO_T::MODE: MODE2 Mask */ - -#define GPIO_MODE_MODE3_Pos (6) /*!< GPIO_T::MODE: MODE3 Position */ -#define GPIO_MODE_MODE3_Msk (0x3ul << GPIO_MODE_MODE3_Pos) /*!< GPIO_T::MODE: MODE3 Mask */ - -#define GPIO_MODE_MODE4_Pos (8) /*!< GPIO_T::MODE: MODE4 Position */ -#define GPIO_MODE_MODE4_Msk (0x3ul << GPIO_MODE_MODE4_Pos) /*!< GPIO_T::MODE: MODE4 Mask */ - -#define GPIO_MODE_MODE5_Pos (10) /*!< GPIO_T::MODE: MODE5 Position */ -#define GPIO_MODE_MODE5_Msk (0x3ul << GPIO_MODE_MODE5_Pos) /*!< GPIO_T::MODE: MODE5 Mask */ - -#define GPIO_MODE_MODE6_Pos (12) /*!< GPIO_T::MODE: MODE6 Position */ -#define GPIO_MODE_MODE6_Msk (0x3ul << GPIO_MODE_MODE6_Pos) /*!< GPIO_T::MODE: MODE6 Mask */ - -#define GPIO_MODE_MODE7_Pos (14) /*!< GPIO_T::MODE: MODE7 Position */ -#define GPIO_MODE_MODE7_Msk (0x3ul << GPIO_MODE_MODE7_Pos) /*!< GPIO_T::MODE: MODE7 Mask */ - -#define GPIO_MODE_MODE8_Pos (16) /*!< GPIO_T::MODE: MODE8 Position */ -#define GPIO_MODE_MODE8_Msk (0x3ul << GPIO_MODE_MODE8_Pos) /*!< GPIO_T::MODE: MODE8 Mask */ - -#define GPIO_MODE_MODE9_Pos (18) /*!< GPIO_T::MODE: MODE9 Position */ -#define GPIO_MODE_MODE9_Msk (0x3ul << GPIO_MODE_MODE9_Pos) /*!< GPIO_T::MODE: MODE9 Mask */ - -#define GPIO_MODE_MODE10_Pos (20) /*!< GPIO_T::MODE: MODE10 Position */ -#define GPIO_MODE_MODE10_Msk (0x3ul << GPIO_MODE_MODE10_Pos) /*!< GPIO_T::MODE: MODE10 Mask */ - -#define GPIO_MODE_MODE11_Pos (22) /*!< GPIO_T::MODE: MODE11 Position */ -#define GPIO_MODE_MODE11_Msk (0x3ul << GPIO_MODE_MODE11_Pos) /*!< GPIO_T::MODE: MODE11 Mask */ - -#define GPIO_MODE_MODE12_Pos (24) /*!< GPIO_T::MODE: MODE12 Position */ -#define GPIO_MODE_MODE12_Msk (0x3ul << GPIO_MODE_MODE12_Pos) /*!< GPIO_T::MODE: MODE12 Mask */ - -#define GPIO_MODE_MODE13_Pos (26) /*!< GPIO_T::MODE: MODE13 Position */ -#define GPIO_MODE_MODE13_Msk (0x3ul << GPIO_MODE_MODE13_Pos) /*!< GPIO_T::MODE: MODE13 Mask */ - -#define GPIO_MODE_MODE14_Pos (28) /*!< GPIO_T::MODE: MODE14 Position */ -#define GPIO_MODE_MODE14_Msk (0x3ul << GPIO_MODE_MODE14_Pos) /*!< GPIO_T::MODE: MODE14 Mask */ - -#define GPIO_MODE_MODE15_Pos (30) /*!< GPIO_T::MODE: MODE15 Position */ -#define GPIO_MODE_MODE15_Msk (0x3ul << GPIO_MODE_MODE15_Pos) /*!< GPIO_T::MODE: MODE15 Mask */ - -#define GPIO_DINOFF_DINOFF0_Pos (16) /*!< GPIO_T::DINOFF: DINOFF0 Position */ -#define GPIO_DINOFF_DINOFF0_Msk (0x1ul << GPIO_DINOFF_DINOFF0_Pos) /*!< GPIO_T::DINOFF: DINOFF0 Mask */ - -#define GPIO_DINOFF_DINOFF1_Pos (17) /*!< GPIO_T::DINOFF: DINOFF1 Position */ -#define GPIO_DINOFF_DINOFF1_Msk (0x1ul << GPIO_DINOFF_DINOFF1_Pos) /*!< GPIO_T::DINOFF: DINOFF1 Mask */ - -#define GPIO_DINOFF_DINOFF2_Pos (18) /*!< GPIO_T::DINOFF: DINOFF2 Position */ -#define GPIO_DINOFF_DINOFF2_Msk (0x1ul << GPIO_DINOFF_DINOFF2_Pos) /*!< GPIO_T::DINOFF: DINOFF2 Mask */ - -#define GPIO_DINOFF_DINOFF3_Pos (19) /*!< GPIO_T::DINOFF: DINOFF3 Position */ -#define GPIO_DINOFF_DINOFF3_Msk (0x1ul << GPIO_DINOFF_DINOFF3_Pos) /*!< GPIO_T::DINOFF: DINOFF3 Mask */ - -#define GPIO_DINOFF_DINOFF4_Pos (20) /*!< GPIO_T::DINOFF: DINOFF4 Position */ -#define GPIO_DINOFF_DINOFF4_Msk (0x1ul << GPIO_DINOFF_DINOFF4_Pos) /*!< GPIO_T::DINOFF: DINOFF4 Mask */ - -#define GPIO_DINOFF_DINOFF5_Pos (21) /*!< GPIO_T::DINOFF: DINOFF5 Position */ -#define GPIO_DINOFF_DINOFF5_Msk (0x1ul << GPIO_DINOFF_DINOFF5_Pos) /*!< GPIO_T::DINOFF: DINOFF5 Mask */ - -#define GPIO_DINOFF_DINOFF6_Pos (22) /*!< GPIO_T::DINOFF: DINOFF6 Position */ -#define GPIO_DINOFF_DINOFF6_Msk (0x1ul << GPIO_DINOFF_DINOFF6_Pos) /*!< GPIO_T::DINOFF: DINOFF6 Mask */ - -#define GPIO_DINOFF_DINOFF7_Pos (23) /*!< GPIO_T::DINOFF: DINOFF7 Position */ -#define GPIO_DINOFF_DINOFF7_Msk (0x1ul << GPIO_DINOFF_DINOFF7_Pos) /*!< GPIO_T::DINOFF: DINOFF7 Mask */ - -#define GPIO_DINOFF_DINOFF8_Pos (24) /*!< GPIO_T::DINOFF: DINOFF8 Position */ -#define GPIO_DINOFF_DINOFF8_Msk (0x1ul << GPIO_DINOFF_DINOFF8_Pos) /*!< GPIO_T::DINOFF: DINOFF8 Mask */ - -#define GPIO_DINOFF_DINOFF9_Pos (25) /*!< GPIO_T::DINOFF: DINOFF9 Position */ -#define GPIO_DINOFF_DINOFF9_Msk (0x1ul << GPIO_DINOFF_DINOFF9_Pos) /*!< GPIO_T::DINOFF: DINOFF9 Mask */ - -#define GPIO_DINOFF_DINOFF10_Pos (26) /*!< GPIO_T::DINOFF: DINOFF10 Position */ -#define GPIO_DINOFF_DINOFF10_Msk (0x1ul << GPIO_DINOFF_DINOFF10_Pos) /*!< GPIO_T::DINOFF: DINOFF10 Mask */ - -#define GPIO_DINOFF_DINOFF11_Pos (27) /*!< GPIO_T::DINOFF: DINOFF11 Position */ -#define GPIO_DINOFF_DINOFF11_Msk (0x1ul << GPIO_DINOFF_DINOFF11_Pos) /*!< GPIO_T::DINOFF: DINOFF11 Mask */ - -#define GPIO_DINOFF_DINOFF12_Pos (28) /*!< GPIO_T::DINOFF: DINOFF12 Position */ -#define GPIO_DINOFF_DINOFF12_Msk (0x1ul << GPIO_DINOFF_DINOFF12_Pos) /*!< GPIO_T::DINOFF: DINOFF12 Mask */ - -#define GPIO_DINOFF_DINOFF13_Pos (29) /*!< GPIO_T::DINOFF: DINOFF13 Position */ -#define GPIO_DINOFF_DINOFF13_Msk (0x1ul << GPIO_DINOFF_DINOFF13_Pos) /*!< GPIO_T::DINOFF: DINOFF13 Mask */ - -#define GPIO_DINOFF_DINOFF14_Pos (30) /*!< GPIO_T::DINOFF: DINOFF14 Position */ -#define GPIO_DINOFF_DINOFF14_Msk (0x1ul << GPIO_DINOFF_DINOFF14_Pos) /*!< GPIO_T::DINOFF: DINOFF14 Mask */ - -#define GPIO_DINOFF_DINOFF15_Pos (31) /*!< GPIO_T::DINOFF: DINOFF15 Position */ -#define GPIO_DINOFF_DINOFF15_Msk (0x1ul << GPIO_DINOFF_DINOFF15_Pos) /*!< GPIO_T::DINOFF: DINOFF15 Mask */ - -#define GPIO_DOUT_DOUT0_Pos (0) /*!< GPIO_T::DOUT: DOUT0 Position */ -#define GPIO_DOUT_DOUT0_Msk (0x1ul << GPIO_DOUT_DOUT0_Pos) /*!< GPIO_T::DOUT: DOUT0 Mask */ - -#define GPIO_DOUT_DOUT1_Pos (1) /*!< GPIO_T::DOUT: DOUT1 Position */ -#define GPIO_DOUT_DOUT1_Msk (0x1ul << GPIO_DOUT_DOUT1_Pos) /*!< GPIO_T::DOUT: DOUT1 Mask */ - -#define GPIO_DOUT_DOUT2_Pos (2) /*!< GPIO_T::DOUT: DOUT2 Position */ -#define GPIO_DOUT_DOUT2_Msk (0x1ul << GPIO_DOUT_DOUT2_Pos) /*!< GPIO_T::DOUT: DOUT2 Mask */ - -#define GPIO_DOUT_DOUT3_Pos (3) /*!< GPIO_T::DOUT: DOUT3 Position */ -#define GPIO_DOUT_DOUT3_Msk (0x1ul << GPIO_DOUT_DOUT3_Pos) /*!< GPIO_T::DOUT: DOUT3 Mask */ - -#define GPIO_DOUT_DOUT4_Pos (4) /*!< GPIO_T::DOUT: DOUT4 Position */ -#define GPIO_DOUT_DOUT4_Msk (0x1ul << GPIO_DOUT_DOUT4_Pos) /*!< GPIO_T::DOUT: DOUT4 Mask */ - -#define GPIO_DOUT_DOUT5_Pos (5) /*!< GPIO_T::DOUT: DOUT5 Position */ -#define GPIO_DOUT_DOUT5_Msk (0x1ul << GPIO_DOUT_DOUT5_Pos) /*!< GPIO_T::DOUT: DOUT5 Mask */ - -#define GPIO_DOUT_DOUT6_Pos (6) /*!< GPIO_T::DOUT: DOUT6 Position */ -#define GPIO_DOUT_DOUT6_Msk (0x1ul << GPIO_DOUT_DOUT6_Pos) /*!< GPIO_T::DOUT: DOUT6 Mask */ - -#define GPIO_DOUT_DOUT7_Pos (7) /*!< GPIO_T::DOUT: DOUT7 Position */ -#define GPIO_DOUT_DOUT7_Msk (0x1ul << GPIO_DOUT_DOUT7_Pos) /*!< GPIO_T::DOUT: DOUT7 Mask */ - -#define GPIO_DOUT_DOUT8_Pos (8) /*!< GPIO_T::DOUT: DOUT8 Position */ -#define GPIO_DOUT_DOUT8_Msk (0x1ul << GPIO_DOUT_DOUT8_Pos) /*!< GPIO_T::DOUT: DOUT8 Mask */ - -#define GPIO_DOUT_DOUT9_Pos (9) /*!< GPIO_T::DOUT: DOUT9 Position */ -#define GPIO_DOUT_DOUT9_Msk (0x1ul << GPIO_DOUT_DOUT9_Pos) /*!< GPIO_T::DOUT: DOUT9 Mask */ - -#define GPIO_DOUT_DOUT10_Pos (10) /*!< GPIO_T::DOUT: DOUT10 Position */ -#define GPIO_DOUT_DOUT10_Msk (0x1ul << GPIO_DOUT_DOUT10_Pos) /*!< GPIO_T::DOUT: DOUT10 Mask */ - -#define GPIO_DOUT_DOUT11_Pos (11) /*!< GPIO_T::DOUT: DOUT11 Position */ -#define GPIO_DOUT_DOUT11_Msk (0x1ul << GPIO_DOUT_DOUT11_Pos) /*!< GPIO_T::DOUT: DOUT11 Mask */ - -#define GPIO_DOUT_DOUT12_Pos (12) /*!< GPIO_T::DOUT: DOUT12 Position */ -#define GPIO_DOUT_DOUT12_Msk (0x1ul << GPIO_DOUT_DOUT12_Pos) /*!< GPIO_T::DOUT: DOUT12 Mask */ - -#define GPIO_DOUT_DOUT13_Pos (13) /*!< GPIO_T::DOUT: DOUT13 Position */ -#define GPIO_DOUT_DOUT13_Msk (0x1ul << GPIO_DOUT_DOUT13_Pos) /*!< GPIO_T::DOUT: DOUT13 Mask */ - -#define GPIO_DOUT_DOUT14_Pos (14) /*!< GPIO_T::DOUT: DOUT14 Position */ -#define GPIO_DOUT_DOUT14_Msk (0x1ul << GPIO_DOUT_DOUT14_Pos) /*!< GPIO_T::DOUT: DOUT14 Mask */ - -#define GPIO_DOUT_DOUT15_Pos (15) /*!< GPIO_T::DOUT: DOUT15 Position */ -#define GPIO_DOUT_DOUT15_Msk (0x1ul << GPIO_DOUT_DOUT15_Pos) /*!< GPIO_T::DOUT: DOUT15 Mask */ - -#define GPIO_DATMSK_DATMSK0_Pos (0) /*!< GPIO_T::DATMSK: DATMSK0 Position */ -#define GPIO_DATMSK_DATMSK0_Msk (0x1ul << GPIO_DATMSK_DATMSK0_Pos) /*!< GPIO_T::DATMSK: DATMSK0 Mask */ - -#define GPIO_DATMSK_DATMSK1_Pos (1) /*!< GPIO_T::DATMSK: DATMSK1 Position */ -#define GPIO_DATMSK_DATMSK1_Msk (0x1ul << GPIO_DATMSK_DATMSK1_Pos) /*!< GPIO_T::DATMSK: DATMSK1 Mask */ - -#define GPIO_DATMSK_DATMSK2_Pos (2) /*!< GPIO_T::DATMSK: DATMSK2 Position */ -#define GPIO_DATMSK_DATMSK2_Msk (0x1ul << GPIO_DATMSK_DATMSK2_Pos) /*!< GPIO_T::DATMSK: DATMSK2 Mask */ - -#define GPIO_DATMSK_DATMSK3_Pos (3) /*!< GPIO_T::DATMSK: DATMSK3 Position */ -#define GPIO_DATMSK_DATMSK3_Msk (0x1ul << GPIO_DATMSK_DATMSK3_Pos) /*!< GPIO_T::DATMSK: DATMSK3 Mask */ - -#define GPIO_DATMSK_DATMSK4_Pos (4) /*!< GPIO_T::DATMSK: DATMSK4 Position */ -#define GPIO_DATMSK_DATMSK4_Msk (0x1ul << GPIO_DATMSK_DATMSK4_Pos) /*!< GPIO_T::DATMSK: DATMSK4 Mask */ - -#define GPIO_DATMSK_DATMSK5_Pos (5) /*!< GPIO_T::DATMSK: DATMSK5 Position */ -#define GPIO_DATMSK_DATMSK5_Msk (0x1ul << GPIO_DATMSK_DATMSK5_Pos) /*!< GPIO_T::DATMSK: DATMSK5 Mask */ - -#define GPIO_DATMSK_DATMSK6_Pos (6) /*!< GPIO_T::DATMSK: DATMSK6 Position */ -#define GPIO_DATMSK_DATMSK6_Msk (0x1ul << GPIO_DATMSK_DATMSK6_Pos) /*!< GPIO_T::DATMSK: DATMSK6 Mask */ - -#define GPIO_DATMSK_DATMSK7_Pos (7) /*!< GPIO_T::DATMSK: DATMSK7 Position */ -#define GPIO_DATMSK_DATMSK7_Msk (0x1ul << GPIO_DATMSK_DATMSK7_Pos) /*!< GPIO_T::DATMSK: DATMSK7 Mask */ - -#define GPIO_DATMSK_DATMSK8_Pos (8) /*!< GPIO_T::DATMSK: DATMSK8 Position */ -#define GPIO_DATMSK_DATMSK8_Msk (0x1ul << GPIO_DATMSK_DATMSK8_Pos) /*!< GPIO_T::DATMSK: DATMSK8 Mask */ - -#define GPIO_DATMSK_DATMSK9_Pos (9) /*!< GPIO_T::DATMSK: DATMSK9 Position */ -#define GPIO_DATMSK_DATMSK9_Msk (0x1ul << GPIO_DATMSK_DATMSK9_Pos) /*!< GPIO_T::DATMSK: DATMSK9 Mask */ - -#define GPIO_DATMSK_DATMSK10_Pos (10) /*!< GPIO_T::DATMSK: DATMSK10 Position */ -#define GPIO_DATMSK_DATMSK10_Msk (0x1ul << GPIO_DATMSK_DATMSK10_Pos) /*!< GPIO_T::DATMSK: DATMSK10 Mask */ - -#define GPIO_DATMSK_DATMSK11_Pos (11) /*!< GPIO_T::DATMSK: DATMSK11 Position */ -#define GPIO_DATMSK_DATMSK11_Msk (0x1ul << GPIO_DATMSK_DATMSK11_Pos) /*!< GPIO_T::DATMSK: DATMSK11 Mask */ - -#define GPIO_DATMSK_DATMSK12_Pos (12) /*!< GPIO_T::DATMSK: DATMSK12 Position */ -#define GPIO_DATMSK_DATMSK12_Msk (0x1ul << GPIO_DATMSK_DATMSK12_Pos) /*!< GPIO_T::DATMSK: DATMSK12 Mask */ - -#define GPIO_DATMSK_DATMSK13_Pos (13) /*!< GPIO_T::DATMSK: DATMSK13 Position */ -#define GPIO_DATMSK_DATMSK13_Msk (0x1ul << GPIO_DATMSK_DATMSK13_Pos) /*!< GPIO_T::DATMSK: DATMSK13 Mask */ - -#define GPIO_DATMSK_DATMSK14_Pos (14) /*!< GPIO_T::DATMSK: DATMSK14 Position */ -#define GPIO_DATMSK_DATMSK14_Msk (0x1ul << GPIO_DATMSK_DATMSK14_Pos) /*!< GPIO_T::DATMSK: DATMSK14 Mask */ - -#define GPIO_DATMSK_DATMSK15_Pos (15) /*!< GPIO_T::DATMSK: DATMSK15 Position */ -#define GPIO_DATMSK_DATMSK15_Msk (0x1ul << GPIO_DATMSK_DATMSK15_Pos) /*!< GPIO_T::DATMSK: DATMSK15 Mask */ - -#define GPIO_PIN_PIN0_Pos (0) /*!< GPIO_T::PIN: PIN0 Position */ -#define GPIO_PIN_PIN0_Msk (0x1ul << GPIO_PIN_PIN0_Pos) /*!< GPIO_T::PIN: PIN0 Mask */ - -#define GPIO_PIN_PIN1_Pos (1) /*!< GPIO_T::PIN: PIN1 Position */ -#define GPIO_PIN_PIN1_Msk (0x1ul << GPIO_PIN_PIN1_Pos) /*!< GPIO_T::PIN: PIN1 Mask */ - -#define GPIO_PIN_PIN2_Pos (2) /*!< GPIO_T::PIN: PIN2 Position */ -#define GPIO_PIN_PIN2_Msk (0x1ul << GPIO_PIN_PIN2_Pos) /*!< GPIO_T::PIN: PIN2 Mask */ - -#define GPIO_PIN_PIN3_Pos (3) /*!< GPIO_T::PIN: PIN3 Position */ -#define GPIO_PIN_PIN3_Msk (0x1ul << GPIO_PIN_PIN3_Pos) /*!< GPIO_T::PIN: PIN3 Mask */ - -#define GPIO_PIN_PIN4_Pos (4) /*!< GPIO_T::PIN: PIN4 Position */ -#define GPIO_PIN_PIN4_Msk (0x1ul << GPIO_PIN_PIN4_Pos) /*!< GPIO_T::PIN: PIN4 Mask */ - -#define GPIO_PIN_PIN5_Pos (5) /*!< GPIO_T::PIN: PIN5 Position */ -#define GPIO_PIN_PIN5_Msk (0x1ul << GPIO_PIN_PIN5_Pos) /*!< GPIO_T::PIN: PIN5 Mask */ - -#define GPIO_PIN_PIN6_Pos (6) /*!< GPIO_T::PIN: PIN6 Position */ -#define GPIO_PIN_PIN6_Msk (0x1ul << GPIO_PIN_PIN6_Pos) /*!< GPIO_T::PIN: PIN6 Mask */ - -#define GPIO_PIN_PIN7_Pos (7) /*!< GPIO_T::PIN: PIN7 Position */ -#define GPIO_PIN_PIN7_Msk (0x1ul << GPIO_PIN_PIN7_Pos) /*!< GPIO_T::PIN: PIN7 Mask */ - -#define GPIO_PIN_PIN8_Pos (8) /*!< GPIO_T::PIN: PIN8 Position */ -#define GPIO_PIN_PIN8_Msk (0x1ul << GPIO_PIN_PIN8_Pos) /*!< GPIO_T::PIN: PIN8 Mask */ - -#define GPIO_PIN_PIN9_Pos (9) /*!< GPIO_T::PIN: PIN9 Position */ -#define GPIO_PIN_PIN9_Msk (0x1ul << GPIO_PIN_PIN9_Pos) /*!< GPIO_T::PIN: PIN9 Mask */ - -#define GPIO_PIN_PIN10_Pos (10) /*!< GPIO_T::PIN: PIN10 Position */ -#define GPIO_PIN_PIN10_Msk (0x1ul << GPIO_PIN_PIN10_Pos) /*!< GPIO_T::PIN: PIN10 Mask */ - -#define GPIO_PIN_PIN11_Pos (11) /*!< GPIO_T::PIN: PIN11 Position */ -#define GPIO_PIN_PIN11_Msk (0x1ul << GPIO_PIN_PIN11_Pos) /*!< GPIO_T::PIN: PIN11 Mask */ - -#define GPIO_PIN_PIN12_Pos (12) /*!< GPIO_T::PIN: PIN12 Position */ -#define GPIO_PIN_PIN12_Msk (0x1ul << GPIO_PIN_PIN12_Pos) /*!< GPIO_T::PIN: PIN12 Mask */ - -#define GPIO_PIN_PIN13_Pos (13) /*!< GPIO_T::PIN: PIN13 Position */ -#define GPIO_PIN_PIN13_Msk (0x1ul << GPIO_PIN_PIN13_Pos) /*!< GPIO_T::PIN: PIN13 Mask */ - -#define GPIO_PIN_PIN14_Pos (14) /*!< GPIO_T::PIN: PIN14 Position */ -#define GPIO_PIN_PIN14_Msk (0x1ul << GPIO_PIN_PIN14_Pos) /*!< GPIO_T::PIN: PIN14 Mask */ - -#define GPIO_PIN_PIN15_Pos (15) /*!< GPIO_T::PIN: PIN15 Position */ -#define GPIO_PIN_PIN15_Msk (0x1ul << GPIO_PIN_PIN15_Pos) /*!< GPIO_T::PIN: PIN15 Mask */ - -#define GPIO_DBEN_DBEN0_Pos (0) /*!< GPIO_T::DBEN: DBEN0 Position */ -#define GPIO_DBEN_DBEN0_Msk (0x1ul << GPIO_DBEN_DBEN0_Pos) /*!< GPIO_T::DBEN: DBEN0 Mask */ - -#define GPIO_DBEN_DBEN1_Pos (1) /*!< GPIO_T::DBEN: DBEN1 Position */ -#define GPIO_DBEN_DBEN1_Msk (0x1ul << GPIO_DBEN_DBEN1_Pos) /*!< GPIO_T::DBEN: DBEN1 Mask */ - -#define GPIO_DBEN_DBEN2_Pos (2) /*!< GPIO_T::DBEN: DBEN2 Position */ -#define GPIO_DBEN_DBEN2_Msk (0x1ul << GPIO_DBEN_DBEN2_Pos) /*!< GPIO_T::DBEN: DBEN2 Mask */ - -#define GPIO_DBEN_DBEN3_Pos (3) /*!< GPIO_T::DBEN: DBEN3 Position */ -#define GPIO_DBEN_DBEN3_Msk (0x1ul << GPIO_DBEN_DBEN3_Pos) /*!< GPIO_T::DBEN: DBEN3 Mask */ - -#define GPIO_DBEN_DBEN4_Pos (4) /*!< GPIO_T::DBEN: DBEN4 Position */ -#define GPIO_DBEN_DBEN4_Msk (0x1ul << GPIO_DBEN_DBEN4_Pos) /*!< GPIO_T::DBEN: DBEN4 Mask */ - -#define GPIO_DBEN_DBEN5_Pos (5) /*!< GPIO_T::DBEN: DBEN5 Position */ -#define GPIO_DBEN_DBEN5_Msk (0x1ul << GPIO_DBEN_DBEN5_Pos) /*!< GPIO_T::DBEN: DBEN5 Mask */ - -#define GPIO_DBEN_DBEN6_Pos (6) /*!< GPIO_T::DBEN: DBEN6 Position */ -#define GPIO_DBEN_DBEN6_Msk (0x1ul << GPIO_DBEN_DBEN6_Pos) /*!< GPIO_T::DBEN: DBEN6 Mask */ - -#define GPIO_DBEN_DBEN7_Pos (7) /*!< GPIO_T::DBEN: DBEN7 Position */ -#define GPIO_DBEN_DBEN7_Msk (0x1ul << GPIO_DBEN_DBEN7_Pos) /*!< GPIO_T::DBEN: DBEN7 Mask */ - -#define GPIO_DBEN_DBEN8_Pos (8) /*!< GPIO_T::DBEN: DBEN8 Position */ -#define GPIO_DBEN_DBEN8_Msk (0x1ul << GPIO_DBEN_DBEN8_Pos) /*!< GPIO_T::DBEN: DBEN8 Mask */ - -#define GPIO_DBEN_DBEN9_Pos (9) /*!< GPIO_T::DBEN: DBEN9 Position */ -#define GPIO_DBEN_DBEN9_Msk (0x1ul << GPIO_DBEN_DBEN9_Pos) /*!< GPIO_T::DBEN: DBEN9 Mask */ - -#define GPIO_DBEN_DBEN10_Pos (10) /*!< GPIO_T::DBEN: DBEN10 Position */ -#define GPIO_DBEN_DBEN10_Msk (0x1ul << GPIO_DBEN_DBEN10_Pos) /*!< GPIO_T::DBEN: DBEN10 Mask */ - -#define GPIO_DBEN_DBEN11_Pos (11) /*!< GPIO_T::DBEN: DBEN11 Position */ -#define GPIO_DBEN_DBEN11_Msk (0x1ul << GPIO_DBEN_DBEN11_Pos) /*!< GPIO_T::DBEN: DBEN11 Mask */ - -#define GPIO_DBEN_DBEN12_Pos (12) /*!< GPIO_T::DBEN: DBEN12 Position */ -#define GPIO_DBEN_DBEN12_Msk (0x1ul << GPIO_DBEN_DBEN12_Pos) /*!< GPIO_T::DBEN: DBEN12 Mask */ - -#define GPIO_DBEN_DBEN13_Pos (13) /*!< GPIO_T::DBEN: DBEN13 Position */ -#define GPIO_DBEN_DBEN13_Msk (0x1ul << GPIO_DBEN_DBEN13_Pos) /*!< GPIO_T::DBEN: DBEN13 Mask */ - -#define GPIO_DBEN_DBEN14_Pos (14) /*!< GPIO_T::DBEN: DBEN14 Position */ -#define GPIO_DBEN_DBEN14_Msk (0x1ul << GPIO_DBEN_DBEN14_Pos) /*!< GPIO_T::DBEN: DBEN14 Mask */ - -#define GPIO_DBEN_DBEN15_Pos (15) /*!< GPIO_T::DBEN: DBEN15 Position */ -#define GPIO_DBEN_DBEN15_Msk (0x1ul << GPIO_DBEN_DBEN15_Pos) /*!< GPIO_T::DBEN: DBEN15 Mask */ - -#define GPIO_INTTYPE_TYPE0_Pos (0) /*!< GPIO_T::INTTYPE: TYPE0 Position */ -#define GPIO_INTTYPE_TYPE0_Msk (0x1ul << GPIO_INTTYPE_TYPE0_Pos) /*!< GPIO_T::INTTYPE: TYPE0 Mask */ - -#define GPIO_INTTYPE_TYPE1_Pos (1) /*!< GPIO_T::INTTYPE: TYPE1 Position */ -#define GPIO_INTTYPE_TYPE1_Msk (0x1ul << GPIO_INTTYPE_TYPE1_Pos) /*!< GPIO_T::INTTYPE: TYPE1 Mask */ - -#define GPIO_INTTYPE_TYPE2_Pos (2) /*!< GPIO_T::INTTYPE: TYPE2 Position */ -#define GPIO_INTTYPE_TYPE2_Msk (0x1ul << GPIO_INTTYPE_TYPE2_Pos) /*!< GPIO_T::INTTYPE: TYPE2 Mask */ - -#define GPIO_INTTYPE_TYPE3_Pos (3) /*!< GPIO_T::INTTYPE: TYPE3 Position */ -#define GPIO_INTTYPE_TYPE3_Msk (0x1ul << GPIO_INTTYPE_TYPE3_Pos) /*!< GPIO_T::INTTYPE: TYPE3 Mask */ - -#define GPIO_INTTYPE_TYPE4_Pos (4) /*!< GPIO_T::INTTYPE: TYPE4 Position */ -#define GPIO_INTTYPE_TYPE4_Msk (0x1ul << GPIO_INTTYPE_TYPE4_Pos) /*!< GPIO_T::INTTYPE: TYPE4 Mask */ - -#define GPIO_INTTYPE_TYPE5_Pos (5) /*!< GPIO_T::INTTYPE: TYPE5 Position */ -#define GPIO_INTTYPE_TYPE5_Msk (0x1ul << GPIO_INTTYPE_TYPE5_Pos) /*!< GPIO_T::INTTYPE: TYPE5 Mask */ - -#define GPIO_INTTYPE_TYPE6_Pos (6) /*!< GPIO_T::INTTYPE: TYPE6 Position */ -#define GPIO_INTTYPE_TYPE6_Msk (0x1ul << GPIO_INTTYPE_TYPE6_Pos) /*!< GPIO_T::INTTYPE: TYPE6 Mask */ - -#define GPIO_INTTYPE_TYPE7_Pos (7) /*!< GPIO_T::INTTYPE: TYPE7 Position */ -#define GPIO_INTTYPE_TYPE7_Msk (0x1ul << GPIO_INTTYPE_TYPE7_Pos) /*!< GPIO_T::INTTYPE: TYPE7 Mask */ - -#define GPIO_INTTYPE_TYPE8_Pos (8) /*!< GPIO_T::INTTYPE: TYPE8 Position */ -#define GPIO_INTTYPE_TYPE8_Msk (0x1ul << GPIO_INTTYPE_TYPE8_Pos) /*!< GPIO_T::INTTYPE: TYPE8 Mask */ - -#define GPIO_INTTYPE_TYPE9_Pos (9) /*!< GPIO_T::INTTYPE: TYPE9 Position */ -#define GPIO_INTTYPE_TYPE9_Msk (0x1ul << GPIO_INTTYPE_TYPE9_Pos) /*!< GPIO_T::INTTYPE: TYPE9 Mask */ - -#define GPIO_INTTYPE_TYPE10_Pos (10) /*!< GPIO_T::INTTYPE: TYPE10 Position */ -#define GPIO_INTTYPE_TYPE10_Msk (0x1ul << GPIO_INTTYPE_TYPE10_Pos) /*!< GPIO_T::INTTYPE: TYPE10 Mask */ - -#define GPIO_INTTYPE_TYPE11_Pos (11) /*!< GPIO_T::INTTYPE: TYPE11 Position */ -#define GPIO_INTTYPE_TYPE11_Msk (0x1ul << GPIO_INTTYPE_TYPE11_Pos) /*!< GPIO_T::INTTYPE: TYPE11 Mask */ - -#define GPIO_INTTYPE_TYPE12_Pos (12) /*!< GPIO_T::INTTYPE: TYPE12 Position */ -#define GPIO_INTTYPE_TYPE12_Msk (0x1ul << GPIO_INTTYPE_TYPE12_Pos) /*!< GPIO_T::INTTYPE: TYPE12 Mask */ - -#define GPIO_INTTYPE_TYPE13_Pos (13) /*!< GPIO_T::INTTYPE: TYPE13 Position */ -#define GPIO_INTTYPE_TYPE13_Msk (0x1ul << GPIO_INTTYPE_TYPE13_Pos) /*!< GPIO_T::INTTYPE: TYPE13 Mask */ - -#define GPIO_INTTYPE_TYPE14_Pos (14) /*!< GPIO_T::INTTYPE: TYPE14 Position */ -#define GPIO_INTTYPE_TYPE14_Msk (0x1ul << GPIO_INTTYPE_TYPE14_Pos) /*!< GPIO_T::INTTYPE: TYPE14 Mask */ - -#define GPIO_INTTYPE_TYPE15_Pos (15) /*!< GPIO_T::INTTYPE: TYPE15 Position */ -#define GPIO_INTTYPE_TYPE15_Msk (0x1ul << GPIO_INTTYPE_TYPE15_Pos) /*!< GPIO_T::INTTYPE: TYPE15 Mask */ - -#define GPIO_INTEN_FLIEN0_Pos (0) /*!< GPIO_T::INTEN: FLIEN0 Position */ -#define GPIO_INTEN_FLIEN0_Msk (0x1ul << GPIO_INTEN_FLIEN0_Pos) /*!< GPIO_T::INTEN: FLIEN0 Mask */ - -#define GPIO_INTEN_FLIEN1_Pos (1) /*!< GPIO_T::INTEN: FLIEN1 Position */ -#define GPIO_INTEN_FLIEN1_Msk (0x1ul << GPIO_INTEN_FLIEN1_Pos) /*!< GPIO_T::INTEN: FLIEN1 Mask */ - -#define GPIO_INTEN_FLIEN2_Pos (2) /*!< GPIO_T::INTEN: FLIEN2 Position */ -#define GPIO_INTEN_FLIEN2_Msk (0x1ul << GPIO_INTEN_FLIEN2_Pos) /*!< GPIO_T::INTEN: FLIEN2 Mask */ - -#define GPIO_INTEN_FLIEN3_Pos (3) /*!< GPIO_T::INTEN: FLIEN3 Position */ -#define GPIO_INTEN_FLIEN3_Msk (0x1ul << GPIO_INTEN_FLIEN3_Pos) /*!< GPIO_T::INTEN: FLIEN3 Mask */ - -#define GPIO_INTEN_FLIEN4_Pos (4) /*!< GPIO_T::INTEN: FLIEN4 Position */ -#define GPIO_INTEN_FLIEN4_Msk (0x1ul << GPIO_INTEN_FLIEN4_Pos) /*!< GPIO_T::INTEN: FLIEN4 Mask */ - -#define GPIO_INTEN_FLIEN5_Pos (5) /*!< GPIO_T::INTEN: FLIEN5 Position */ -#define GPIO_INTEN_FLIEN5_Msk (0x1ul << GPIO_INTEN_FLIEN5_Pos) /*!< GPIO_T::INTEN: FLIEN5 Mask */ - -#define GPIO_INTEN_FLIEN6_Pos (6) /*!< GPIO_T::INTEN: FLIEN6 Position */ -#define GPIO_INTEN_FLIEN6_Msk (0x1ul << GPIO_INTEN_FLIEN6_Pos) /*!< GPIO_T::INTEN: FLIEN6 Mask */ - -#define GPIO_INTEN_FLIEN7_Pos (7) /*!< GPIO_T::INTEN: FLIEN7 Position */ -#define GPIO_INTEN_FLIEN7_Msk (0x1ul << GPIO_INTEN_FLIEN7_Pos) /*!< GPIO_T::INTEN: FLIEN7 Mask */ - -#define GPIO_INTEN_FLIEN8_Pos (8) /*!< GPIO_T::INTEN: FLIEN8 Position */ -#define GPIO_INTEN_FLIEN8_Msk (0x1ul << GPIO_INTEN_FLIEN8_Pos) /*!< GPIO_T::INTEN: FLIEN8 Mask */ - -#define GPIO_INTEN_FLIEN9_Pos (9) /*!< GPIO_T::INTEN: FLIEN9 Position */ -#define GPIO_INTEN_FLIEN9_Msk (0x1ul << GPIO_INTEN_FLIEN9_Pos) /*!< GPIO_T::INTEN: FLIEN9 Mask */ - -#define GPIO_INTEN_FLIEN10_Pos (10) /*!< GPIO_T::INTEN: FLIEN10 Position */ -#define GPIO_INTEN_FLIEN10_Msk (0x1ul << GPIO_INTEN_FLIEN10_Pos) /*!< GPIO_T::INTEN: FLIEN10 Mask */ - -#define GPIO_INTEN_FLIEN11_Pos (11) /*!< GPIO_T::INTEN: FLIEN11 Position */ -#define GPIO_INTEN_FLIEN11_Msk (0x1ul << GPIO_INTEN_FLIEN11_Pos) /*!< GPIO_T::INTEN: FLIEN11 Mask */ - -#define GPIO_INTEN_FLIEN12_Pos (12) /*!< GPIO_T::INTEN: FLIEN12 Position */ -#define GPIO_INTEN_FLIEN12_Msk (0x1ul << GPIO_INTEN_FLIEN12_Pos) /*!< GPIO_T::INTEN: FLIEN12 Mask */ - -#define GPIO_INTEN_FLIEN13_Pos (13) /*!< GPIO_T::INTEN: FLIEN13 Position */ -#define GPIO_INTEN_FLIEN13_Msk (0x1ul << GPIO_INTEN_FLIEN13_Pos) /*!< GPIO_T::INTEN: FLIEN13 Mask */ - -#define GPIO_INTEN_FLIEN14_Pos (14) /*!< GPIO_T::INTEN: FLIEN14 Position */ -#define GPIO_INTEN_FLIEN14_Msk (0x1ul << GPIO_INTEN_FLIEN14_Pos) /*!< GPIO_T::INTEN: FLIEN14 Mask */ - -#define GPIO_INTEN_FLIEN15_Pos (15) /*!< GPIO_T::INTEN: FLIEN15 Position */ -#define GPIO_INTEN_FLIEN15_Msk (0x1ul << GPIO_INTEN_FLIEN15_Pos) /*!< GPIO_T::INTEN: FLIEN15 Mask */ - -#define GPIO_INTEN_RHIEN0_Pos (16) /*!< GPIO_T::INTEN: RHIEN0 Position */ -#define GPIO_INTEN_RHIEN0_Msk (0x1ul << GPIO_INTEN_RHIEN0_Pos) /*!< GPIO_T::INTEN: RHIEN0 Mask */ - -#define GPIO_INTEN_RHIEN1_Pos (17) /*!< GPIO_T::INTEN: RHIEN1 Position */ -#define GPIO_INTEN_RHIEN1_Msk (0x1ul << GPIO_INTEN_RHIEN1_Pos) /*!< GPIO_T::INTEN: RHIEN1 Mask */ - -#define GPIO_INTEN_RHIEN2_Pos (18) /*!< GPIO_T::INTEN: RHIEN2 Position */ -#define GPIO_INTEN_RHIEN2_Msk (0x1ul << GPIO_INTEN_RHIEN2_Pos) /*!< GPIO_T::INTEN: RHIEN2 Mask */ - -#define GPIO_INTEN_RHIEN3_Pos (19) /*!< GPIO_T::INTEN: RHIEN3 Position */ -#define GPIO_INTEN_RHIEN3_Msk (0x1ul << GPIO_INTEN_RHIEN3_Pos) /*!< GPIO_T::INTEN: RHIEN3 Mask */ - -#define GPIO_INTEN_RHIEN4_Pos (20) /*!< GPIO_T::INTEN: RHIEN4 Position */ -#define GPIO_INTEN_RHIEN4_Msk (0x1ul << GPIO_INTEN_RHIEN4_Pos) /*!< GPIO_T::INTEN: RHIEN4 Mask */ - -#define GPIO_INTEN_RHIEN5_Pos (21) /*!< GPIO_T::INTEN: RHIEN5 Position */ -#define GPIO_INTEN_RHIEN5_Msk (0x1ul << GPIO_INTEN_RHIEN5_Pos) /*!< GPIO_T::INTEN: RHIEN5 Mask */ - -#define GPIO_INTEN_RHIEN6_Pos (22) /*!< GPIO_T::INTEN: RHIEN6 Position */ -#define GPIO_INTEN_RHIEN6_Msk (0x1ul << GPIO_INTEN_RHIEN6_Pos) /*!< GPIO_T::INTEN: RHIEN6 Mask */ - -#define GPIO_INTEN_RHIEN7_Pos (23) /*!< GPIO_T::INTEN: RHIEN7 Position */ -#define GPIO_INTEN_RHIEN7_Msk (0x1ul << GPIO_INTEN_RHIEN7_Pos) /*!< GPIO_T::INTEN: RHIEN7 Mask */ - -#define GPIO_INTEN_RHIEN8_Pos (24) /*!< GPIO_T::INTEN: RHIEN8 Position */ -#define GPIO_INTEN_RHIEN8_Msk (0x1ul << GPIO_INTEN_RHIEN8_Pos) /*!< GPIO_T::INTEN: RHIEN8 Mask */ - -#define GPIO_INTEN_RHIEN9_Pos (25) /*!< GPIO_T::INTEN: RHIEN9 Position */ -#define GPIO_INTEN_RHIEN9_Msk (0x1ul << GPIO_INTEN_RHIEN9_Pos) /*!< GPIO_T::INTEN: RHIEN9 Mask */ - -#define GPIO_INTEN_RHIEN10_Pos (26) /*!< GPIO_T::INTEN: RHIEN10 Position */ -#define GPIO_INTEN_RHIEN10_Msk (0x1ul << GPIO_INTEN_RHIEN10_Pos) /*!< GPIO_T::INTEN: RHIEN10 Mask */ - -#define GPIO_INTEN_RHIEN11_Pos (27) /*!< GPIO_T::INTEN: RHIEN11 Position */ -#define GPIO_INTEN_RHIEN11_Msk (0x1ul << GPIO_INTEN_RHIEN11_Pos) /*!< GPIO_T::INTEN: RHIEN11 Mask */ - -#define GPIO_INTEN_RHIEN12_Pos (28) /*!< GPIO_T::INTEN: RHIEN12 Position */ -#define GPIO_INTEN_RHIEN12_Msk (0x1ul << GPIO_INTEN_RHIEN12_Pos) /*!< GPIO_T::INTEN: RHIEN12 Mask */ - -#define GPIO_INTEN_RHIEN13_Pos (29) /*!< GPIO_T::INTEN: RHIEN13 Position */ -#define GPIO_INTEN_RHIEN13_Msk (0x1ul << GPIO_INTEN_RHIEN13_Pos) /*!< GPIO_T::INTEN: RHIEN13 Mask */ - -#define GPIO_INTEN_RHIEN14_Pos (30) /*!< GPIO_T::INTEN: RHIEN14 Position */ -#define GPIO_INTEN_RHIEN14_Msk (0x1ul << GPIO_INTEN_RHIEN14_Pos) /*!< GPIO_T::INTEN: RHIEN14 Mask */ - -#define GPIO_INTEN_RHIEN15_Pos (31) /*!< GPIO_T::INTEN: RHIEN15 Position */ -#define GPIO_INTEN_RHIEN15_Msk (0x1ul << GPIO_INTEN_RHIEN15_Pos) /*!< GPIO_T::INTEN: RHIEN15 Mask */ - -#define GPIO_INTSRC_INTSRC0_Pos (0) /*!< GPIO_T::INTSRC: INTSRC0 Position */ -#define GPIO_INTSRC_INTSRC0_Msk (0x1ul << GPIO_INTSRC_INTSRC0_Pos) /*!< GPIO_T::INTSRC: INTSRC0 Mask */ - -#define GPIO_INTSRC_INTSRC1_Pos (1) /*!< GPIO_T::INTSRC: INTSRC1 Position */ -#define GPIO_INTSRC_INTSRC1_Msk (0x1ul << GPIO_INTSRC_INTSRC1_Pos) /*!< GPIO_T::INTSRC: INTSRC1 Mask */ - -#define GPIO_INTSRC_INTSRC2_Pos (2) /*!< GPIO_T::INTSRC: INTSRC2 Position */ -#define GPIO_INTSRC_INTSRC2_Msk (0x1ul << GPIO_INTSRC_INTSRC2_Pos) /*!< GPIO_T::INTSRC: INTSRC2 Mask */ - -#define GPIO_INTSRC_INTSRC3_Pos (3) /*!< GPIO_T::INTSRC: INTSRC3 Position */ -#define GPIO_INTSRC_INTSRC3_Msk (0x1ul << GPIO_INTSRC_INTSRC3_Pos) /*!< GPIO_T::INTSRC: INTSRC3 Mask */ - -#define GPIO_INTSRC_INTSRC4_Pos (4) /*!< GPIO_T::INTSRC: INTSRC4 Position */ -#define GPIO_INTSRC_INTSRC4_Msk (0x1ul << GPIO_INTSRC_INTSRC4_Pos) /*!< GPIO_T::INTSRC: INTSRC4 Mask */ - -#define GPIO_INTSRC_INTSRC5_Pos (5) /*!< GPIO_T::INTSRC: INTSRC5 Position */ -#define GPIO_INTSRC_INTSRC5_Msk (0x1ul << GPIO_INTSRC_INTSRC5_Pos) /*!< GPIO_T::INTSRC: INTSRC5 Mask */ - -#define GPIO_INTSRC_INTSRC6_Pos (6) /*!< GPIO_T::INTSRC: INTSRC6 Position */ -#define GPIO_INTSRC_INTSRC6_Msk (0x1ul << GPIO_INTSRC_INTSRC6_Pos) /*!< GPIO_T::INTSRC: INTSRC6 Mask */ - -#define GPIO_INTSRC_INTSRC7_Pos (7) /*!< GPIO_T::INTSRC: INTSRC7 Position */ -#define GPIO_INTSRC_INTSRC7_Msk (0x1ul << GPIO_INTSRC_INTSRC7_Pos) /*!< GPIO_T::INTSRC: INTSRC7 Mask */ - -#define GPIO_INTSRC_INTSRC8_Pos (8) /*!< GPIO_T::INTSRC: INTSRC8 Position */ -#define GPIO_INTSRC_INTSRC8_Msk (0x1ul << GPIO_INTSRC_INTSRC8_Pos) /*!< GPIO_T::INTSRC: INTSRC8 Mask */ - -#define GPIO_INTSRC_INTSRC9_Pos (9) /*!< GPIO_T::INTSRC: INTSRC9 Position */ -#define GPIO_INTSRC_INTSRC9_Msk (0x1ul << GPIO_INTSRC_INTSRC9_Pos) /*!< GPIO_T::INTSRC: INTSRC9 Mask */ - -#define GPIO_INTSRC_INTSRC10_Pos (10) /*!< GPIO_T::INTSRC: INTSRC10 Position */ -#define GPIO_INTSRC_INTSRC10_Msk (0x1ul << GPIO_INTSRC_INTSRC10_Pos) /*!< GPIO_T::INTSRC: INTSRC10 Mask */ - -#define GPIO_INTSRC_INTSRC11_Pos (11) /*!< GPIO_T::INTSRC: INTSRC11 Position */ -#define GPIO_INTSRC_INTSRC11_Msk (0x1ul << GPIO_INTSRC_INTSRC11_Pos) /*!< GPIO_T::INTSRC: INTSRC11 Mask */ - -#define GPIO_INTSRC_INTSRC12_Pos (12) /*!< GPIO_T::INTSRC: INTSRC12 Position */ -#define GPIO_INTSRC_INTSRC12_Msk (0x1ul << GPIO_INTSRC_INTSRC12_Pos) /*!< GPIO_T::INTSRC: INTSRC12 Mask */ - -#define GPIO_INTSRC_INTSRC13_Pos (13) /*!< GPIO_T::INTSRC: INTSRC13 Position */ -#define GPIO_INTSRC_INTSRC13_Msk (0x1ul << GPIO_INTSRC_INTSRC13_Pos) /*!< GPIO_T::INTSRC: INTSRC13 Mask */ - -#define GPIO_INTSRC_INTSRC14_Pos (14) /*!< GPIO_T::INTSRC: INTSRC14 Position */ -#define GPIO_INTSRC_INTSRC14_Msk (0x1ul << GPIO_INTSRC_INTSRC14_Pos) /*!< GPIO_T::INTSRC: INTSRC14 Mask */ - -#define GPIO_INTSRC_INTSRC15_Pos (15) /*!< GPIO_T::INTSRC: INTSRC15 Position */ -#define GPIO_INTSRC_INTSRC15_Msk (0x1ul << GPIO_INTSRC_INTSRC15_Pos) /*!< GPIO_T::INTSRC: INTSRC15 Mask */ - -#define GPIO_SMTEN_SMTEN0_Pos (0) /*!< GPIO_T::SMTEN: SMTEN0 Position */ -#define GPIO_SMTEN_SMTEN0_Msk (0x1ul << GPIO_SMTEN_SMTEN0_Pos) /*!< GPIO_T::SMTEN: SMTEN0 Mask */ - -#define GPIO_SMTEN_SMTEN1_Pos (1) /*!< GPIO_T::SMTEN: SMTEN1 Position */ -#define GPIO_SMTEN_SMTEN1_Msk (0x1ul << GPIO_SMTEN_SMTEN1_Pos) /*!< GPIO_T::SMTEN: SMTEN1 Mask */ - -#define GPIO_SMTEN_SMTEN2_Pos (2) /*!< GPIO_T::SMTEN: SMTEN2 Position */ -#define GPIO_SMTEN_SMTEN2_Msk (0x1ul << GPIO_SMTEN_SMTEN2_Pos) /*!< GPIO_T::SMTEN: SMTEN2 Mask */ - -#define GPIO_SMTEN_SMTEN3_Pos (3) /*!< GPIO_T::SMTEN: SMTEN3 Position */ -#define GPIO_SMTEN_SMTEN3_Msk (0x1ul << GPIO_SMTEN_SMTEN3_Pos) /*!< GPIO_T::SMTEN: SMTEN3 Mask */ - -#define GPIO_SMTEN_SMTEN4_Pos (4) /*!< GPIO_T::SMTEN: SMTEN4 Position */ -#define GPIO_SMTEN_SMTEN4_Msk (0x1ul << GPIO_SMTEN_SMTEN4_Pos) /*!< GPIO_T::SMTEN: SMTEN4 Mask */ - -#define GPIO_SMTEN_SMTEN5_Pos (5) /*!< GPIO_T::SMTEN: SMTEN5 Position */ -#define GPIO_SMTEN_SMTEN5_Msk (0x1ul << GPIO_SMTEN_SMTEN5_Pos) /*!< GPIO_T::SMTEN: SMTEN5 Mask */ - -#define GPIO_SMTEN_SMTEN6_Pos (6) /*!< GPIO_T::SMTEN: SMTEN6 Position */ -#define GPIO_SMTEN_SMTEN6_Msk (0x1ul << GPIO_SMTEN_SMTEN6_Pos) /*!< GPIO_T::SMTEN: SMTEN6 Mask */ - -#define GPIO_SMTEN_SMTEN7_Pos (7) /*!< GPIO_T::SMTEN: SMTEN7 Position */ -#define GPIO_SMTEN_SMTEN7_Msk (0x1ul << GPIO_SMTEN_SMTEN7_Pos) /*!< GPIO_T::SMTEN: SMTEN7 Mask */ - -#define GPIO_SMTEN_SMTEN8_Pos (8) /*!< GPIO_T::SMTEN: SMTEN8 Position */ -#define GPIO_SMTEN_SMTEN8_Msk (0x1ul << GPIO_SMTEN_SMTEN8_Pos) /*!< GPIO_T::SMTEN: SMTEN8 Mask */ - -#define GPIO_SMTEN_SMTEN9_Pos (9) /*!< GPIO_T::SMTEN: SMTEN9 Position */ -#define GPIO_SMTEN_SMTEN9_Msk (0x1ul << GPIO_SMTEN_SMTEN9_Pos) /*!< GPIO_T::SMTEN: SMTEN9 Mask */ - -#define GPIO_SMTEN_SMTEN10_Pos (10) /*!< GPIO_T::SMTEN: SMTEN10 Position */ -#define GPIO_SMTEN_SMTEN10_Msk (0x1ul << GPIO_SMTEN_SMTEN10_Pos) /*!< GPIO_T::SMTEN: SMTEN10 Mask */ - -#define GPIO_SMTEN_SMTEN11_Pos (11) /*!< GPIO_T::SMTEN: SMTEN11 Position */ -#define GPIO_SMTEN_SMTEN11_Msk (0x1ul << GPIO_SMTEN_SMTEN11_Pos) /*!< GPIO_T::SMTEN: SMTEN11 Mask */ - -#define GPIO_SMTEN_SMTEN12_Pos (12) /*!< GPIO_T::SMTEN: SMTEN12 Position */ -#define GPIO_SMTEN_SMTEN12_Msk (0x1ul << GPIO_SMTEN_SMTEN12_Pos) /*!< GPIO_T::SMTEN: SMTEN12 Mask */ - -#define GPIO_SMTEN_SMTEN13_Pos (13) /*!< GPIO_T::SMTEN: SMTEN13 Position */ -#define GPIO_SMTEN_SMTEN13_Msk (0x1ul << GPIO_SMTEN_SMTEN13_Pos) /*!< GPIO_T::SMTEN: SMTEN13 Mask */ - -#define GPIO_SMTEN_SMTEN14_Pos (14) /*!< GPIO_T::SMTEN: SMTEN14 Position */ -#define GPIO_SMTEN_SMTEN14_Msk (0x1ul << GPIO_SMTEN_SMTEN14_Pos) /*!< GPIO_T::SMTEN: SMTEN14 Mask */ - -#define GPIO_SMTEN_SMTEN15_Pos (15) /*!< GPIO_T::SMTEN: SMTEN15 Position */ -#define GPIO_SMTEN_SMTEN15_Msk (0x1ul << GPIO_SMTEN_SMTEN15_Pos) /*!< GPIO_T::SMTEN: SMTEN15 Mask */ - -#define GPIO_SLEWCTL_HSREN0_Pos (0) /*!< GPIO_T::SLEWCTL: HSREN0 Position */ -#define GPIO_SLEWCTL_HSREN0_Msk (0x3ul << GPIO_SLEWCTL_HSREN0_Pos) /*!< GPIO_T::SLEWCTL: HSREN0 Mask */ - -#define GPIO_SLEWCTL_HSREN1_Pos (2) /*!< GPIO_T::SLEWCTL: HSREN1 Position */ -#define GPIO_SLEWCTL_HSREN1_Msk (0x3ul << GPIO_SLEWCTL_HSREN1_Pos) /*!< GPIO_T::SLEWCTL: HSREN1 Mask */ - -#define GPIO_SLEWCTL_HSREN2_Pos (4) /*!< GPIO_T::SLEWCTL: HSREN2 Position */ -#define GPIO_SLEWCTL_HSREN2_Msk (0x3ul << GPIO_SLEWCTL_HSREN2_Pos) /*!< GPIO_T::SLEWCTL: HSREN2 Mask */ - -#define GPIO_SLEWCTL_HSREN3_Pos (6) /*!< GPIO_T::SLEWCTL: HSREN3 Position */ -#define GPIO_SLEWCTL_HSREN3_Msk (0x3ul << GPIO_SLEWCTL_HSREN3_Pos) /*!< GPIO_T::SLEWCTL: HSREN3 Mask */ - -#define GPIO_SLEWCTL_HSREN4_Pos (8) /*!< GPIO_T::SLEWCTL: HSREN4 Position */ -#define GPIO_SLEWCTL_HSREN4_Msk (0x3ul << GPIO_SLEWCTL_HSREN4_Pos) /*!< GPIO_T::SLEWCTL: HSREN4 Mask */ - -#define GPIO_SLEWCTL_HSREN5_Pos (10) /*!< GPIO_T::SLEWCTL: HSREN5 Position */ -#define GPIO_SLEWCTL_HSREN5_Msk (0x3ul << GPIO_SLEWCTL_HSREN5_Pos) /*!< GPIO_T::SLEWCTL: HSREN5 Mask */ - -#define GPIO_SLEWCTL_HSREN6_Pos (12) /*!< GPIO_T::SLEWCTL: HSREN6 Position */ -#define GPIO_SLEWCTL_HSREN6_Msk (0x3ul << GPIO_SLEWCTL_HSREN6_Pos) /*!< GPIO_T::SLEWCTL: HSREN6 Mask */ - -#define GPIO_SLEWCTL_HSREN7_Pos (14) /*!< GPIO_T::SLEWCTL: HSREN7 Position */ -#define GPIO_SLEWCTL_HSREN7_Msk (0x3ul << GPIO_SLEWCTL_HSREN7_Pos) /*!< GPIO_T::SLEWCTL: HSREN7 Mask */ - -#define GPIO_SLEWCTL_HSREN8_Pos (16) /*!< GPIO_T::SLEWCTL: HSREN8 Position */ -#define GPIO_SLEWCTL_HSREN8_Msk (0x3ul << GPIO_SLEWCTL_HSREN8_Pos) /*!< GPIO_T::SLEWCTL: HSREN8 Mask */ - -#define GPIO_SLEWCTL_HSREN9_Pos (18) /*!< GPIO_T::SLEWCTL: HSREN9 Position */ -#define GPIO_SLEWCTL_HSREN9_Msk (0x3ul << GPIO_SLEWCTL_HSREN9_Pos) /*!< GPIO_T::SLEWCTL: HSREN9 Mask */ - -#define GPIO_SLEWCTL_HSREN10_Pos (20) /*!< GPIO_T::SLEWCTL: HSREN10 Position */ -#define GPIO_SLEWCTL_HSREN10_Msk (0x3ul << GPIO_SLEWCTL_HSREN10_Pos) /*!< GPIO_T::SLEWCTL: HSREN10 Mask */ - -#define GPIO_SLEWCTL_HSREN11_Pos (22) /*!< GPIO_T::SLEWCTL: HSREN11 Position */ -#define GPIO_SLEWCTL_HSREN11_Msk (0x3ul << GPIO_SLEWCTL_HSREN11_Pos) /*!< GPIO_T::SLEWCTL: HSREN11 Mask */ - -#define GPIO_SLEWCTL_HSREN12_Pos (24) /*!< GPIO_T::SLEWCTL: HSREN12 Position */ -#define GPIO_SLEWCTL_HSREN12_Msk (0x3ul << GPIO_SLEWCTL_HSREN12_Pos) /*!< GPIO_T::SLEWCTL: HSREN12 Mask */ - -#define GPIO_SLEWCTL_HSREN13_Pos (26) /*!< GPIO_T::SLEWCTL: HSREN13 Position */ -#define GPIO_SLEWCTL_HSREN13_Msk (0x3ul << GPIO_SLEWCTL_HSREN13_Pos) /*!< GPIO_T::SLEWCTL: HSREN13 Mask */ - -#define GPIO_SLEWCTL_HSREN14_Pos (28) /*!< GPIO_T::SLEWCTL: HSREN14 Position */ -#define GPIO_SLEWCTL_HSREN14_Msk (0x3ul << GPIO_SLEWCTL_HSREN14_Pos) /*!< GPIO_T::SLEWCTL: HSREN14 Mask */ - -#define GPIO_SLEWCTL_HSREN15_Pos (30) /*!< GPIO_T::SLEWCTL: HSREN15 Position */ -#define GPIO_SLEWCTL_HSREN15_Msk (0x3ul << GPIO_SLEWCTL_HSREN15_Pos) /*!< GPIO_T::SLEWCTL: HSREN15 Mask */ - -#define GPIO_PUSEL_PUSEL0_Pos (0) /*!< GPIO_T::PUSEL: PUSEL0 Position */ -#define GPIO_PUSEL_PUSEL0_Msk (0x3ul << GPIO_PUSEL_PUSEL0_Pos) /*!< GPIO_T::PUSEL: PUSEL0 Mask */ - -#define GPIO_PUSEL_PUSEL1_Pos (2) /*!< GPIO_T::PUSEL: PUSEL1 Position */ -#define GPIO_PUSEL_PUSEL1_Msk (0x3ul << GPIO_PUSEL_PUSEL1_Pos) /*!< GPIO_T::PUSEL: PUSEL1 Mask */ - -#define GPIO_PUSEL_PUSEL2_Pos (4) /*!< GPIO_T::PUSEL: PUSEL2 Position */ -#define GPIO_PUSEL_PUSEL2_Msk (0x3ul << GPIO_PUSEL_PUSEL2_Pos) /*!< GPIO_T::PUSEL: PUSEL2 Mask */ - -#define GPIO_PUSEL_PUSEL3_Pos (6) /*!< GPIO_T::PUSEL: PUSEL3 Position */ -#define GPIO_PUSEL_PUSEL3_Msk (0x3ul << GPIO_PUSEL_PUSEL3_Pos) /*!< GPIO_T::PUSEL: PUSEL3 Mask */ - -#define GPIO_PUSEL_PUSEL4_Pos (8) /*!< GPIO_T::PUSEL: PUSEL4 Position */ -#define GPIO_PUSEL_PUSEL4_Msk (0x3ul << GPIO_PUSEL_PUSEL4_Pos) /*!< GPIO_T::PUSEL: PUSEL4 Mask */ - -#define GPIO_PUSEL_PUSEL5_Pos (10) /*!< GPIO_T::PUSEL: PUSEL5 Position */ -#define GPIO_PUSEL_PUSEL5_Msk (0x3ul << GPIO_PUSEL_PUSEL5_Pos) /*!< GPIO_T::PUSEL: PUSEL5 Mask */ - -#define GPIO_PUSEL_PUSEL6_Pos (12) /*!< GPIO_T::PUSEL: PUSEL6 Position */ -#define GPIO_PUSEL_PUSEL6_Msk (0x3ul << GPIO_PUSEL_PUSEL6_Pos) /*!< GPIO_T::PUSEL: PUSEL6 Mask */ - -#define GPIO_PUSEL_PUSEL7_Pos (14) /*!< GPIO_T::PUSEL: PUSEL7 Position */ -#define GPIO_PUSEL_PUSEL7_Msk (0x3ul << GPIO_PUSEL_PUSEL7_Pos) /*!< GPIO_T::PUSEL: PUSEL7 Mask */ - -#define GPIO_PUSEL_PUSEL8_Pos (16) /*!< GPIO_T::PUSEL: PUSEL8 Position */ -#define GPIO_PUSEL_PUSEL8_Msk (0x3ul << GPIO_PUSEL_PUSEL8_Pos) /*!< GPIO_T::PUSEL: PUSEL8 Mask */ - -#define GPIO_PUSEL_PUSEL9_Pos (18) /*!< GPIO_T::PUSEL: PUSEL9 Position */ -#define GPIO_PUSEL_PUSEL9_Msk (0x3ul << GPIO_PUSEL_PUSEL9_Pos) /*!< GPIO_T::PUSEL: PUSEL9 Mask */ - -#define GPIO_PUSEL_PUSEL10_Pos (20) /*!< GPIO_T::PUSEL: PUSEL10 Position */ -#define GPIO_PUSEL_PUSEL10_Msk (0x3ul << GPIO_PUSEL_PUSEL10_Pos) /*!< GPIO_T::PUSEL: PUSEL10 Mask */ - -#define GPIO_PUSEL_PUSEL11_Pos (22) /*!< GPIO_T::PUSEL: PUSEL11 Position */ -#define GPIO_PUSEL_PUSEL11_Msk (0x3ul << GPIO_PUSEL_PUSEL11_Pos) /*!< GPIO_T::PUSEL: PUSEL11 Mask */ - -#define GPIO_PUSEL_PUSEL12_Pos (24) /*!< GPIO_T::PUSEL: PUSEL12 Position */ -#define GPIO_PUSEL_PUSEL12_Msk (0x3ul << GPIO_PUSEL_PUSEL12_Pos) /*!< GPIO_T::PUSEL: PUSEL12 Mask */ - -#define GPIO_PUSEL_PUSEL13_Pos (26) /*!< GPIO_T::PUSEL: PUSEL13 Position */ -#define GPIO_PUSEL_PUSEL13_Msk (0x3ul << GPIO_PUSEL_PUSEL13_Pos) /*!< GPIO_T::PUSEL: PUSEL13 Mask */ - -#define GPIO_PUSEL_PUSEL14_Pos (28) /*!< GPIO_T::PUSEL: PUSEL14 Position */ -#define GPIO_PUSEL_PUSEL14_Msk (0x3ul << GPIO_PUSEL_PUSEL14_Pos) /*!< GPIO_T::PUSEL: PUSEL14 Mask */ - -#define GPIO_PUSEL_PUSEL15_Pos (30) /*!< GPIO_T::PUSEL: PUSEL15 Position */ -#define GPIO_PUSEL_PUSEL15_Msk (0x3ul << GPIO_PUSEL_PUSEL15_Pos) /*!< GPIO_T::PUSEL: PUSEL15 Mask */ - -#define GPIO_DBCTL_DBCLKSEL_Pos (0) /*!< GPIO_T::DBCTL: DBCLKSEL Position */ -#define GPIO_DBCTL_DBCLKSEL_Msk (0xFul << GPIO_DBCTL_DBCLKSEL_Pos) /*!< GPIO_T::DBCTL: DBCLKSEL Mask */ - -#define GPIO_DBCTL_DBCLKSRC_Pos (4) /*!< GPIO_T::DBCTL: DBCLKSRC Position */ -#define GPIO_DBCTL_DBCLKSRC_Msk (1ul << GPIO_DBCTL_DBCLKSRC_Pos) /*!< GPIO_T::DBCTL: DBCLKSRC Mask */ - -#define GPIO_DBCTL_ICLKON_Pos (5) /*!< GPIO_T::DBCTL: ICLKON Position */ -#define GPIO_DBCTL_ICLKON_Msk (1ul << GPIO_DBCTL_ICLKON_Pos) /*!< GPIO_T::DBCTL: ICLKON Mask */ - -#define GPIO_DBCTL_DBCLKBUSY_Pos (31) /*!< GPIO_T::DBCTL: DBCLKBUSY Position */ -#define GPIO_DBCTL_DBCLKBUSY_Msk (1ul << GPIO_DBCTL_DBCLKBUSY_Pos) /*!< GPIO_T::DBCTL: DBCLKBUSY Mask */ - -#define GPIO_INT_INNF_NFEN_Pos (0) /*!< GPIO_T::INT_INNF: NFEN Position */ -#define GPIO_INT_INNF_NFEN_Msk (0x1ul << GPIO_INT_INNF_NFEN_Pos) /*!< GPIO_T::INT_INNF: NFEN Mask */ - -#define GPIO_INT_INNF_NFSEL_Pos (4) /*!< GPIO_T::INT_INNF: NFSEL Position */ -#define GPIO_INT_INNF_NFSEL_Msk (0x7ul << GPIO_INT_INNF_NFSEL_Pos) /*!< GPIO_T::INT_INNF: NFSEL Mask */ - -#define GPIO_INT_INNF_NFCNT_Pos (8) /*!< GPIO_T::INT_INNF: NFCNT Position */ -#define GPIO_INT_INNF_NFCNT_Msk (0x7ul << GPIO_INT_INNF_NFCNT_Pos) /*!< GPIO_T::INT_INNF: NFCNT Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL0_Pos (0) /*!< GPIO_T::INT_EDETCTL: EDETCTL0 Position */ -#define GPIO_INT_EDETCTL_EDETCTL0_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL0_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL0 Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL1_Pos (2) /*!< GPIO_T::INT_EDETCTL: EDETCTL1 Position */ -#define GPIO_INT_EDETCTL_EDETCTL1_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL1_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL1 Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL2_Pos (4) /*!< GPIO_T::INT_EDETCTL: EDETCTL2 Position */ -#define GPIO_INT_EDETCTL_EDETCTL2_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL2_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL2 Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL3_Pos (6) /*!< GPIO_T::INT_EDETCTL: EDETCTL3 Position */ -#define GPIO_INT_EDETCTL_EDETCTL3_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL3_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL3 Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL4_Pos (8) /*!< GPIO_T::INT_EDETCTL: EDETCTL4 Position */ -#define GPIO_INT_EDETCTL_EDETCTL4_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL4_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL4 Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL5_Pos (10) /*!< GPIO_T::INT_EDETCTL: EDETCTL5 Position */ -#define GPIO_INT_EDETCTL_EDETCTL5_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL5_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL5 Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL6_Pos (12) /*!< GPIO_T::INT_EDETCTL: EDETCTL6 Position */ -#define GPIO_INT_EDETCTL_EDETCTL6_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL6_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL6 Mask */ - -#define GPIO_INT_EDETCTL_EDETCTL7_Pos (14) /*!< GPIO_T::INT_EDETCTL: EDETCTL7 Position */ -#define GPIO_INT_EDETCTL_EDETCTL7_Msk (0x3ul << GPIO_INT_EDETCTL_EDETCTL7_Pos) /*!< GPIO_T::INT_EDETCTL: EDETCTL7 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN0_Pos (0) /*!< GPIO_T::INT_EDINTEN: EDIEN0 Position */ -#define GPIO_INT_EDINTEN_EDIEN0_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN0_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN0 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN1_Pos (1) /*!< GPIO_T::INT_EDINTEN: EDIEN1 Position */ -#define GPIO_INT_EDINTEN_EDIEN1_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN1_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN1 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN2_Pos (2) /*!< GPIO_T::INT_EDINTEN: EDIEN2 Position */ -#define GPIO_INT_EDINTEN_EDIEN2_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN2_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN2 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN3_Pos (3) /*!< GPIO_T::INT_EDINTEN: EDIEN3 Position */ -#define GPIO_INT_EDINTEN_EDIEN3_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN3_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN3 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN4_Pos (4) /*!< GPIO_T::INT_EDINTEN: EDIEN4 Position */ -#define GPIO_INT_EDINTEN_EDIEN4_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN4_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN4 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN5_Pos (5) /*!< GPIO_T::INT_EDINTEN: EDIEN5 Position */ -#define GPIO_INT_EDINTEN_EDIEN5_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN5_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN5 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN6_Pos (6) /*!< GPIO_T::INT_EDINTEN: EDIEN6 Position */ -#define GPIO_INT_EDINTEN_EDIEN6_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN6_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN6 Mask */ - -#define GPIO_INT_EDINTEN_EDIEN7_Pos (7) /*!< GPIO_T::INT_EDINTEN: EDIEN7 Position */ -#define GPIO_INT_EDINTEN_EDIEN7_Msk (0x1ul << GPIO_INT_EDINTEN_EDIEN7_Pos) /*!< GPIO_T::INT_EDINTEN: EDIEN7 Mask */ - -#define GPIO_INT_EDSTS_EDIF0_Pos (0) /*!< GPIO_T::INT_EDSTS: EDIF0 Position */ -#define GPIO_INT_EDSTS_EDIF0_Msk (0x1ul << GPIO_INT_EDSTS_EDIF0_Pos) /*!< GPIO_T::INT_EDSTS: EDIF0 Mask */ - -#define GPIO_INT_EDSTS_EDIF1_Pos (1) /*!< GPIO_T::INT_EDSTS: EDIF1 Position */ -#define GPIO_INT_EDSTS_EDIF1_Msk (0x1ul << GPIO_INT_EDSTS_EDIF1_Pos) /*!< GPIO_T::INT_EDSTS: EDIF1 Mask */ - -#define GPIO_INT_EDSTS_EDIF2_Pos (2) /*!< GPIO_T::INT_EDSTS: EDIF2 Position */ -#define GPIO_INT_EDSTS_EDIF2_Msk (0x1ul << GPIO_INT_EDSTS_EDIF2_Pos) /*!< GPIO_T::INT_EDSTS: EDIF2 Mask */ - -#define GPIO_INT_EDSTS_EDIF3_Pos (3) /*!< GPIO_T::INT_EDSTS: EDIF3 Position */ -#define GPIO_INT_EDSTS_EDIF3_Msk (0x1ul << GPIO_INT_EDSTS_EDIF3_Pos) /*!< GPIO_T::INT_EDSTS: EDIF3 Mask */ - -#define GPIO_INT_EDSTS_EDIF4_Pos (4) /*!< GPIO_T::INT_EDSTS: EDIF4 Position */ -#define GPIO_INT_EDSTS_EDIF4_Msk (0x1ul << GPIO_INT_EDSTS_EDIF4_Pos) /*!< GPIO_T::INT_EDSTS: EDIF4 Mask */ - -#define GPIO_INT_EDSTS_EDIF5_Pos (5) /*!< GPIO_T::INT_EDSTS: EDIF5 Position */ -#define GPIO_INT_EDSTS_EDIF5_Msk (0x1ul << GPIO_INT_EDSTS_EDIF5_Pos) /*!< GPIO_T::INT_EDSTS: EDIF5 Mask */ - -#define GPIO_INT_EDSTS_EDIF6_Pos (6) /*!< GPIO_T::INT_EDSTS: EDIF6 Position */ -#define GPIO_INT_EDSTS_EDIF6_Msk (0x1ul << GPIO_INT_EDSTS_EDIF6_Pos) /*!< GPIO_T::INT_EDSTS: EDIF6 Mask */ - -#define GPIO_INT_EDSTS_EDIF7_Pos (7) /*!< GPIO_T::INT_EDSTS: EDIF7 Position */ -#define GPIO_INT_EDSTS_EDIF7_Msk (0x1ul << GPIO_INT_EDSTS_EDIF7_Pos) /*!< GPIO_T::INT_EDSTS: EDIF7 Mask */ - -/**@}*/ /* GPIO_CONST */ -/**@}*/ /* end of GPIO register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __GPIO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hbi_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hbi_reg.h deleted file mode 100644 index 9d1cfe2a273..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hbi_reg.h +++ /dev/null @@ -1,233 +0,0 @@ -/**************************************************************************//** - * @file hbi_reg.h - * @version V1.00 - * @brief HBI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HBI_REG_H__ -#define __HBI_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup Hyper Bus Interface Controller (HBI) - Memory Mapped Structure for HBI Controller -@{ */ -typedef struct -{ - - - /** - * @var HBI_T::CMD - * Offset: 0x00 HyperBus Command and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |HYPCMD |HyperBus Command and Status - * | | |Write - * | | |0001 = Reset HyperRAM. - * | | |0010 = Read HyperRAM regsiter (16-Bit, Read Data[15:0]. - * | | |0101 = Exit From Hybrid Sleep and deep power down. - * | | |0111 = Write HyperRAM regsiter (16-Bit, Write Data[15:0]. - * | | |1000 = Read 1 word (Read Data[15:0]) from HyperRAM. - * | | |1001 = Read 2 word (Read Data[31:0]) from HyperRAM. - * | | |1100 = Write 1 Byte (Write Data[7:0]) to HyperRAM. - * | | |1101 = Write 2 Bytes (Write Data[15:0]) to HyperRAM. - * | | |1110 = Write 3 Byte (Write Data[23:0]) to HyperRAM. - * | | |1111 = Write 4 Byte (Write Data[31:0]) to HyperRAM. - * | | |Other value = reserved. - * | | |Read - * | | |0000 = HyperBus interface is Idle. - * | | |Other value = HyperBus interface is busy. - * | | |Note: When an operation is Done, the read value automatically return to 4'b0000. - * @var HBI_T::CONFIG - * Offset: 0x04 HyperBus Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CSST |Chip Select Setup Time to Next CK Rising Edge - * | | |This field indicates the setup time between the chip select and the next CK rising edge - * | | |00 = 1.5 HCLK cycles. - * | | |01 = 2.5 HCLK cycles. - * | | |10 = 3.5 HCLK cycles. - * | | |11 = 4.5 HCLK cycles. - * |[5:2] |ACCT |Initial Access Time - * | | |This field indicates the initial access cycles of the Hyper Bus transaction - * | | |0000 = 5 CK cycles. - * | | |0001 = 6 CK cycles. - * | | |0010 = 7 CK cycles. - * | | |1110 = 3 CK cycles. - * | | |1111 = 4 CK cycles. - * | | |Others = Reserved. - * | | |Note: This field must be set to the same value as - * | | |initial Latency in HyperRAM Configuration Register 0. - * |[7:6] |CSH |Chip Select Hold Time After CK Falling Edge - * | | |This field indicates the hold time between the last CK falling edge and chip select - * | | |00 = 0.5 HCLK cycles. - * | | |01 = 1.5 HCLK cycles. - * | | |10 = 2.5 HCLK cycles. - * | | |11 = 3.5 HCLK cycles. - * |[11:8] |CSHI |Chip Select High between Transaction - * | | |This field indicates the inactive period between two Hyper Bus transactions - * | | |0000 = 1 HCLK cycle. - * | | |0001 = 2 HCLK cycles. - * | | |0010 = 3 HCLK cycles. - * | | |0011 = 4 HCLK cycles. - * | | |... - * | | |1111 = 16 HCLK cycles. - * | | |Note : This field must meet the HyperRAM device specification of tCSHI. - * |[13:12] |BGSIZE |Burst Group Size - * | | |This field indicates the burst length on the Hyper Bus transaction - * | | |00 = 128 Bytes. - * | | |01 = 64 Bytes. - * | | |10 = 16 Bytes. - * | | |11 = 32 Bytes. - * | | |Note : This field must be set to the same value as burst Length in HyperRAM Configuration Regsiter 0. - * |[14] |ENDIAN |Endian Condition on the Hyper Bus Data Pipe - * | | |0 = Little-Endian. - * | | | Byte A = Bits[7:0] of a 16-Bit ..........word - * | | | Byte B = Bits[15:8] of a 16-Bit ..........word - * | | |1 = Big-Endia. - * | | | Byte A = Bits[15:8] of a 16-Bit ..........word - * | | | Byte B = Bits[7:0] of a 16-Bit ..........word - * |[15] |CKDIV |Hyper Bus Clock Divider - * | | | 0 = Hyper Bus Clock rate is HCLK/2. - * | | | 1 = Hyper Bus Clock rate is HCLK/4. - * |[26:16] |CSMAXLT |Chip Select Maximum Low Time - * | | | This field indicates the maximum Low period of the chip select (CS#) in one transaction - * | | | 00000000000 = 1 HCLK cycle. - * | | | 00000000001 = 2 HCLK cycles. - * | | | 00000000010 = 3 HCLK cycles. - * | | | 00000000011 = 4 HCLK cycles. - * | | | ... - * | | | 01011101100 = 749 HCLK cycles (3.9us @192 MHz). - * | | | ... - * | | | 11111111110 = 2047 HCLK cycles. - * | | | 11111111111 = 2048 HCLK cycles. - * | | | Note: This field inidcates the timing of HyperRAM Chip Select specification so that it has to relative the frequency of HCLK and the CLKDIV (HBI_CONFIG[15]). - * @var HBI_T::ADR - * Offset: 0x08 HyperBus Byte Address access Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |HBI_ADR |HyperBus Byte Address - * | | |Memory Space Range: - * | | | 0x0000_0000 ~ 0x01FF_FFFF - * | | |Register Space Range: - * | | | 0X0000_0000 = Identification Register 0 - * | | | 0X0000_0002 = Identification Register 1 - * | | | 0X0000_1000 = Configuration Register 0 - * | | | 0X0000_1002 = Configuration Register 1 - * | | |Note: - * | | |1. It is "Byte" address, not "word" address - * | | |2. Up to 32M Bytes of memory space is supported. - * @var HBI_T::WDATA - * Offset: 0x0C HyperBus 32-Bits Write Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WDATA |HyperBus 32-Bits Write Data - * | | |To write 1 Byte to HyperRAM, Byte 0 (Data[7:0]) is used - * | | |To write 2 Bytes to HyperRAM, Byte 1~0 (Data[15:0]) is used - * | | |To write 3 Bytes to HyperRAM, Byte 2~0 (Data[23:0]) is used - * | | |To write 4 Bytes to HyperRAM, Byte 3~ (Data[31:0]) is used - * @var HBI_T::RDATA - * Offset: 0x10 HyperBus 32-Bits Read Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RDATA |HyperBus 32-Bits Read Data - * | | |32-Bits Data for HyperBus Read - * | | |Note: The data order is depened on the ENDIAN (HBI_CONFIG[14]). Refer to 1.1.5.4 for detail information. - * @var HBI_T::INTEN - * Offset: 0x14 HyperBus Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OPINTEN |HyperBus Operation Done Interrupt Enable - * | | |0 = Operation done interrupt is Disab led. - * | | |1 = Operation done interrupt is Enabled. - * @var HBI_T::INTSTS - * Offset: 0x18 HyperBus Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OPDONE |HyperBus Operation Done Interrupt - * | | |0 = HyperBus operation is busy. - * | | |1 = HyperBus operation is done. - */ - __IO uint32_t CMD ; /*!< [0x0000] HyperBus Command and Status Register */ - __IO uint32_t CONFIG; /*!< [0x0004] HyperBus Configuration Register */ - __IO uint32_t ADR; /*!< [0x0008] HyperBus Byte Address access Register */ - __IO uint32_t WDATA; /*!< [0x000C] HyperBus 32-Bits Write Data Register */ - __IO uint32_t RDATA; /*!< [0x0010] HyperBus 32-Bits Read Data Register */ - __IO uint32_t INTEN; /*!< [0x0014] HyperBus Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0018] HyperBus Interrupt Status Register */ -} HBI_T; - -/** - @addtogroup HBI_CONST HBI Bit Field Definition - Constant Definitions for HBI Controller -@{ */ - -#define HBI_CMD_HYPCMD_Pos (0) /*!< HBI_T::CMD: HYPCMD Position */ -#define HBI_CMD_HYPCMD_Msk (0xful << HBI_CMD_HYPCMD_Pos) /*!< HBI_T::CMD: HYPCMD Mask */ - -#define HBI_CONFIG_CSST_Pos (0) /*!< HBI_T::CONFIG: CSST Position */ -#define HBI_CONFIG_CSST_Msk (0x3ul << HBI_CONFIG_CSST_Pos) /*!< HBI_T::CONFIG: CSST Mask */ - -#define HBI_CONFIG_ACCT_Pos (2) /*!< HBI_T::CONFIG: ACCT Position */ -#define HBI_CONFIG_ACCT_Msk (0xful << HBI_CONFIG_ACCT_Pos) /*!< HBI_T::CONFIG: ACCT Mask */ - -#define HBI_CONFIG_CSH_Pos (6) /*!< HBI_T::CONFIG: CSH Position */ -#define HBI_CONFIG_CSH_Msk (0x3ul << HBI_CONFIG_CSH_Pos) /*!< HBI_T::CONFIG: CSH Mask */ - -#define HBI_CONFIG_CSHI_Pos (8) /*!< HBI_T::CONFIG: CSHI Position */ -#define HBI_CONFIG_CSHI_Msk (0xful << HBI_CONFIG_CSHI_Pos) /*!< HBI_T::CONFIG: CSHI Mask */ - -#define HBI_CONFIG_BGSIZE_Pos (12) /*!< HBI_T::CONFIG: BGSIZE Position */ -#define HBI_CONFIG_BGSIZE_Msk (0x3ul << HBI_CONFIG_BGSIZE_Pos) /*!< HBI_T::CONFIG: BGSIZE Mask */ - -#define HBI_CONFIG_ENDIAN_Pos (14) /*!< HBI_T::CONFIG: ENDIAN Position */ -#define HBI_CONFIG_ENDIAN_Msk (0x1ul << HBI_CONFIG_ENDIAN_Pos) /*!< HBI_T::CONFIG: ENDIAN Mask */ - -#define HBI_CONFIG_CKDIV_Pos (15) /*!< HBI_T::CONFIG: CKDIV Position */ -#define HBI_CONFIG_CKDIV_Msk (0x1ul << HBI_CONFIG_CKDIV_Pos) /*!< HBI_T::CONFIG: CKDIV Mask */ - -#define HBI_CONFIG_CSMAXLT_Pos (16) /*!< HBI_T::CONFIG: CSMAXLT Position */ -#define HBI_CONFIG_CSMAXLT_Msk (0x7fful << HBI_CONFIG_CSMAXLT_Pos) /*!< HBI_T::CONFIG: CSMAXLT Mask */ - -#define HBI_ADR_ADR_Pos (0) /*!< HBI_T::ADR: ADR Position */ -#define HBI_ADR_ADR_Msk (0xfffffffful << HBI_ADR_ADR_Pos) /*!< HBI_T::ADR: ADR Mask */ - -#define HBI_WDATA_WDATA_Pos (0) /*!< HBI_T::WDATA: WDATA Position */ -#define HBI_WDATA_WDATA_Msk (0xfffffffful << HBI_WDATA_WDATA_Pos) /*!< HBI_T::WDATA: WDATA Mask */ - -#define HBI_RDATA_RDATA_Pos (0) /*!< HBI_T::RDATA: RDATA Position */ -#define HBI_RDATA_RDATA_Msk (0xfffffffful << HBI_RDATA_RDATA_Pos) /*!< HBI_T::RDATA: RDATA Mask */ - -#define HBI_INTEN_OPINTEN_Pos (0) /*!< HBI_T::INTEN: OPINTEN Position */ -#define HBI_INTEN_OPINTEN_Msk (0x1ul << HBI_INTEN_OPINTEN_Pos) /*!< HBI_T::INTEN: OPINTEN Mask */ - -#define HBI_INTSTS_OPDONE_Pos (0) /*!< HBI_T::INTSTS: OPDONE Position */ -#define HBI_INTSTS_OPDONE_Msk (0x1ul << HBI_INTSTS_OPDONE_Pos) /*!< HBI_T::INTSTS: OPDONE Mask */ - - -/**@}*/ /* HBI_CONST */ -/**@}*/ /* end of HBI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __HBI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsotg_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsotg_reg.h deleted file mode 100644 index 4b312c718c6..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsotg_reg.h +++ /dev/null @@ -1,401 +0,0 @@ -/**************************************************************************//** - * @file hsotg_reg.h - * @version V3.00 - * @brief HSOTG register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HSOTG_REG_H__ -#define __HSOTG_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup HSOTG High Speed USB On-The-Go Controller(HSOTG) - Memory Mapped Structure for HSOTG Controller -@{ */ - -typedef struct -{ - - - /** - * @var HSOTG_T::CTL - * Offset: 0x00 HSOTG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDROP |Drop VBUS Control - * | | |If user application running on this OTG A-device wants to conserve power, set this bit to drop VBUS - * | | |BUSREQ (OTG_CTL[1]) will be also cleared no matter A-device or B-device. - * | | |0 = Not drop the VBUS. - * | | |1 = Drop the VBUS. - * |[1] |BUSREQ |OTG Bus Request - * | | |If OTG A-device wants to do data transfers via USB bus, setting this bit will drive VBUS high to detect USB device connection - * | | |If user won't use the bus any more, clearing this bit will drop VBUS to save power - * | | |This bit will be cleared when A-device goes to A_wait_vfall state - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set or IDSTS (OTG_STATUS[1]) changed. - * | | |If user of an OTG-B Device wants to request VBUS, setting this bit will run SRP protocol - * | | |This bit will be cleared if SRP failure (OTG A-device does not provide VBUS after B-device issues ARP in specified interval, defined in OTG specification) - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set IDSTS (OTG_STATUS[1]) changed. - * | | |0 = Not launch VBUS in OTG A-device or not request SRP in OTG B-device. - * | | |1 = Launch VBUS in OTG A-device or request SRP in OTG B-device. - * |[2] |HNPREQEN |OTG HNP Request Enable Bit - * | | |When USB frame as A-device, set this bit when A-device allows to process HNP protocol -- A-device changes role from Host to Peripheral - * | | |This bit will be cleared when OTG state changes from a_suspend to a_peripheral or goes back to a_idle state - * | | |When USB frame as B-device, set this bit after the OTG A-device successfully sends a SetFeature (b_hnp_enable) command to the OTG B-device to start role change -- B-device changes role from Peripheral to Host - * | | |This bit will be cleared when OTG state changes from b_peripheral to b_wait_acon or goes back to b_idle state. - * | | |0 = HNP request Disabled. - * | | |1 = HNP request Enabled (A-device can change role from Host to Peripheral or B-device can change role from Peripheral to Host). - * | | |Note: Refer to OTG specification to get a_suspend, a_peripheral, a_idle and b_idle state. - * |[4] |OTGEN |OTG Function Enable Bit - * | | |User needs to set this bit to enable OTG function while USB frame configured as OTG device - * | | |When USB frame not configured as OTG device, this bit is must be low. - * | | |0= OTG function Disabled. - * | | |1 = OTG function Enabled. - * |[5] |WKEN |OTG ID Pin Wake-up Enable Bit - * | | |0 = OTG ID pin status change wake-up function Disabled. - * | | |1 = OTG ID pin status change wake-up function Enabled. - * @var HSOTG_T::PHYCTL - * Offset: 0x04 HSOTG PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OTGPHYEN |OTG PHY Enable - * | | |When USB frame is configured as OTG-device or ID-dependent, user needs to set this bit before using OTG function - * | | |If device is not configured as OTG-device nor ID-dependent, this bit is "don't care". - * | | |0 = OTG PHY Disabled. - * | | |1 = OTG PHY Enabled. - * |[1] |IDDETEN |ID Detection Enable Bit - * | | |0 = Detect ID pin status Disabled. - * | | |1 = Detect ID pin status Enabled. - * |[4] |VBENPOL |Off-chip USB VBUS Power Switch Enable Polarity - * | | |The OTG controller will enable off-chip USB VBUS power switch to provide VBUS power when need - * | | |A USB_VBUS_EN pin is used to control the off-chip USB VBUS power switch. - * | | |The polarity of enabling off-chip USB VBUS power switch (high active or low active) depends on the selected component - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The off-chip USB VBUS power switch enable is active high. - * | | |1 = The off-chip USB VBUS power switch enable is active low. - * |[5] |VBSTSPOL |Off-chip USB VBUS Power Switch Status Polarity - * | | |The polarity of off-chip USB VBUS power switch valid signal depends on the selected component - * | | |A USB_VBUS_ST pin is used to monitor the valid signal of the off-chip USB VBUS power switch - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The polarity of off-chip USB VBUS power switch valid status is high. - * | | |1 = The polarity of off-chip USB VBUS power switch valid status is low. - * @var HSOTG_T::INTEN - * Offset: 0x08 HSOTG Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIEN|Role (Host or Peripheral) Changed Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[1] |VBEIEN |VBUS Error Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: VBUS error means going to a_vbus_err state. Please refer to A-device state diagram in OTG spec. - * |[2] |SRPFIEN |SRP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[3] |HNPFIEN |HNP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[4] |GOIDLEIEN |OTG Device Goes to IDLE State Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Going to idle state means going to a_idle or b_idle state - * | | |Please refer to A-device state diagram and B-device state diagram in OTG spec. - * |[5] |IDCHGIEN |IDSTS Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and IDSTS (OTG_STATUS[1]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[6] |PDEVIEN |Act As Peripheral Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a peripheral, a interrupt will be asserted. - * | | |0 = This device as a peripheral interrupt Disabled. - * | | |1 = This device as a peripheral interrupt Enabled. - * |[7] |HOSTIEN |Act As Host Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a host, a interrupt will be asserted. - * | | |0 = This device as a host interrupt Disabled. - * | | |1 = This device as a host interrupt Enabled. - * |[8] |BVLDCHGIEN|B-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and BVLD (OTG_STATUS[3]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[9] |AVLDCHGIEN|A-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and AVLD (OTG_STATUS[4]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[10] |VBCHGIEN |VBUSVLD Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and VBUSVLD (OTG_STATUS[5]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[11] |SECHGIEN |SESSEND Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and SESSEND (OTG_STATUS[2]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[13] |SRPDETIEN |SRP Detected Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * @var HSOTG_T::INTSTS - * Offset: 0x0C HSOTG Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIF |OTG Role Change Interrupt Status - * | | |This flag is set when the role of an OTG device changed from a host to a peripheral, or changed from a peripheral to a host while USB_ID pin status does not change. - * | | |0 = OTG device role not changed. - * | | |1 = OTG device role changed. - * | | |Note: Write 1 to clear this flag. - * |[1] |VBEIF |VBUS Error Interrupt Status - * | | |This bit will be set when voltage on VBUS cannot reach a minimum valid threshold 4.4V within a maximum time of 100ms after OTG A-device starting to drive VBUS high. - * | | |0 = OTG A-device drives VBUS over threshold voltage before this interval expires. - * | | |1 = OTG A-device cannot drive VBUS over threshold voltage before this interval expires. - * | | |Note: Write 1 to clear this flag and recover from the VBUS error state. - * |[2] |SRPFIF |SRP Fail Interrupt Status - * | | |After initiating SRP, an OTG B-device will wait for the OTG A-device to drive VBUS high at least TB_SRP_FAIL minimum, defined in OTG specification - * | | |This flag is set when the OTG B-device does not get VBUS high after this interval. - * | | |0 = OTG B-device gets VBUS high before this interval. - * | | |1 = OTG B-device does not get VBUS high before this interval. - * | | |Note: Write 1 to clear this flag. - * |[3] |HNPFIF |HNP Fail Interrupt Status - * | | |When A-device has granted B-device to be host and USB bus is in SE0 (both USB_D+ and USB_D- low) state, this bit will be set when A-device does not connect after specified interval expires. - * | | |0 = A-device connects to B-device before specified interval expires. - * | | |1 = A-device does not connect to B-device before specified interval expires. - * | | |Note: Write 1 to clear this flag. - * |[4] |GOIDLEIF |OTG Device Goes to IDLE Interrupt Status - * | | |Flag is set if the OTG device transfers from non-idle state to idle state - * | | |The OTG device will be neither a host nor a peripheral. - * | | |0 = OTG device does not go back to idle state (a_idle or b_idle). - * | | |1 = OTG device goes back to idle state(a_idle or b_idle). - * | | |Note 1: Going to idle state means going to a_idle or b_idle state. Please refer to OTG specification. - * | | |Note 2: Write 1 to clear this flag. - * |[5] |IDCHGIF |ID State Change Interrupt Status - * | | |0 = IDSTS (OTG_STATUS[1]) not toggled. - * | | |1 = IDSTS (OTG_STATUS[1]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[6] |PDEVIF |Act As Peripheral Interrupt Status - * | | |0= This device does not act as a peripheral. - * | | |1 = This device acts as a peripheral. - * | | |Note: Write 1 to clear this flag. - * |[7] |HOSTIF |Act As Host Interrupt Status - * | | |0= This device does not act as a host. - * | | |1 = This device acts as a host. - * | | |Note: Write 1 to clear this flag. - * |[8] |BVLDCHGIF |B-device Session Valid State Change Interrupt Status - * | | |0 = BVLD (OTG_STATUS[3]) is not toggled. - * | | |1 = BVLD (OTG_STATUS[3]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[9] |AVLDCHGIF |A-device Session Valid State Change Interrupt Status - * | | |0 = AVLD (OTG_STATUS[4]) not toggled. - * | | |1 = AVLD (OTG_STATUS[4]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[10] |VBCHGIF |VBUSVLD State Change Interrupt Status - * | | |0 = VBUSVLD (OTG_STATUS[5]) not toggled. - * | | |1 = VBUSVLD (OTG_STATUS[5]) from high to low or from low to high. - * | | |Note: Write 1 to clear this status. - * |[11] |SECHGIF |SESSEND State Change Interrupt Status - * | | |0 = SESSEND (OTG_STATUS[2]) not toggled. - * | | |1 = SESSEND (OTG_STATUS[2]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[13] |SRPDETIF |SRP Detected Interrupt Status - * | | |0 = SRP not detected. - * | | |1 = SRP detected. - * | | |Note: Write 1 to clear this status. - * @var HSOTG_T::STATUS - * Offset: 0x10 HSOTG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OVERCUR |over Current Condition - * | | |The voltage on VBUS cannot reach a minimum VBUS valid threshold, 4.4V minimum, within a maximum time of 100ms after OTG A-device drives VBUS high. - * | | |0 = OTG A-device drives VBUS successfully. - * | | |1 = OTG A-device cannot drives VBUS high in this interval. - * |[1] |IDSTS |USB_ID Pin State of Mini-b/Micro-plug - * | | |0 = Mini-A/Micro-A plug is attached. - * | | |1 = Mini-B/Micro-B plug is attached. - * |[2] |SESSEND |Session End Status - * | | |When VBUS voltage is lower than 0.4V, this bit will be set to 1 - * | | |Session end means no meaningful power on VBUS. - * | | |0 = Session is not end. - * | | |1 = Session is end. - * |[3] |BVLD |B-device Session Valid Status - * | | |0 = B-device session is not valid. - * | | |1 = B-device session is valid. - * |[4] |AVLD |A-device Session Valid Status - * | | |0 = A-device session is not valid. - * | | |1 = A-device session is valid. - * |[5] |VBUSVLD |VBUS Valid Status - * | | |When VBUS is larger than 4.7V and A-device drives VBUS , this bit will be set to 1. - * | | |0 = VBUS is not valid. - * | | |1 = VBUS is valid. - * |[6] |ASPERI |As Peripheral Status - * | | |When OTG as peripheral, this bit is set. - * | | |0: OTG not as peripheral - * | | |1: OTG as peripheral - * |[7] |ASHOST |As Host Status - * | | |When OTG as Host, this bit is set. - * | | |0: OTG not as Host - * | | |1: OTG as Host - */ - __IO uint32_t CTL; /*!< [0x0000] HSOTG Control Register */ - __IO uint32_t PHYCTL; /*!< [0x0004] HSOTG PHY Control Register */ - __IO uint32_t INTEN; /*!< [0x0008] HSOTG Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x000c] HSOTG Interrupt Status Register */ - __I uint32_t STATUS; /*!< [0x0010] HSOTG Status Register */ - -} HSOTG_T; - -/** - @addtogroup HSOTG_CONST HSOTG Bit Field Definition - Constant Definitions for HSOTG Controller -@{ */ - -#define HSOTG_CTL_VBUSDROP_Pos (0) /*!< HSOTG_T::CTL: VBUSDROP Position */ -#define HSOTG_CTL_VBUSDROP_Msk (0x1ul << HSOTG_CTL_VBUSDROP_Pos) /*!< HSOTG_T::CTL: VBUSDROP Mask */ - -#define HSOTG_CTL_BUSREQ_Pos (1) /*!< HSOTG_T::CTL: BUSREQ Position */ -#define HSOTG_CTL_BUSREQ_Msk (0x1ul << HSOTG_CTL_BUSREQ_Pos) /*!< HSOTG_T::CTL: BUSREQ Mask */ - -#define HSOTG_CTL_HNPREQEN_Pos (2) /*!< HSOTG_T::CTL: HNPREQEN Position */ -#define HSOTG_CTL_HNPREQEN_Msk (0x1ul << HSOTG_CTL_HNPREQEN_Pos) /*!< HSOTG_T::CTL: HNPREQEN Mask */ - -#define HSOTG_CTL_OTGEN_Pos (4) /*!< HSOTG_T::CTL: OTGEN Position */ -#define HSOTG_CTL_OTGEN_Msk (0x1ul << HSOTG_CTL_OTGEN_Pos) /*!< HSOTG_T::CTL: OTGEN Mask */ - -#define HSOTG_CTL_WKEN_Pos (5) /*!< HSOTG_T::CTL: WKEN Position */ -#define HSOTG_CTL_WKEN_Msk (0x1ul << HSOTG_CTL_WKEN_Pos) /*!< HSOTG_T::CTL: WKEN Mask */ - -#define HSOTG_PHYCTL_OTGPHYEN_Pos (0) /*!< HSOTG_T::PHYCTL: OTGPHYEN Position */ -#define HSOTG_PHYCTL_OTGPHYEN_Msk (0x1ul << HSOTG_PHYCTL_OTGPHYEN_Pos) /*!< HSOTG_T::PHYCTL: OTGPHYEN Mask */ - -#define HSOTG_PHYCTL_IDDETEN_Pos (1) /*!< HSOTG_T::PHYCTL: IDDETEN Position */ -#define HSOTG_PHYCTL_IDDETEN_Msk (0x1ul << HSOTG_PHYCTL_IDDETEN_Pos) /*!< HSOTG_T::PHYCTL: IDDETEN Mask */ - -#define HSOTG_PHYCTL_VBENPOL_Pos (4) /*!< HSOTG_T::PHYCTL: VBENPOL Position */ -#define HSOTG_PHYCTL_VBENPOL_Msk (0x1ul << HSOTG_PHYCTL_VBENPOL_Pos) /*!< HSOTG_T::PHYCTL: VBENPOL Mask */ - -#define HSOTG_PHYCTL_VBSTSPOL_Pos (5) /*!< HSOTG_T::PHYCTL: VBSTSPOL Position */ -#define HSOTG_PHYCTL_VBSTSPOL_Msk (0x1ul << HSOTG_PHYCTL_VBSTSPOL_Pos) /*!< HSOTG_T::PHYCTL: VBSTSPOL Mask */ - -#define HSOTG_PHYCTL_FSEL_Pos (8) /*!< HSOTG_T::PHYCTL: FSEL Position */ -#define HSOTG_PHYCTL_FSEL_Msk (0x7ul << HSOTG_PHYCTL_FSEL_Pos) /*!< HSOTG_T::PHYCTL: FSEL Mask */ - -#define HSOTG_INTEN_ROLECHGIEN_Pos (0) /*!< HSOTG_T::INTEN: ROLECHGIEN Position */ -#define HSOTG_INTEN_ROLECHGIEN_Msk (0x1ul << HSOTG_INTEN_ROLECHGIEN_Pos) /*!< HSOTG_T::INTEN: ROLECHGIEN Mask */ - -#define HSOTG_INTEN_VBEIEN_Pos (1) /*!< HSOTG_T::INTEN: VBEIEN Position */ -#define HSOTG_INTEN_VBEIEN_Msk (0x1ul << HSOTG_INTEN_VBEIEN_Pos) /*!< HSOTG_T::INTEN: VBEIEN Mask */ - -#define HSOTG_INTEN_SRPFIEN_Pos (2) /*!< HSOTG_T::INTEN: SRPFIEN Position */ -#define HSOTG_INTEN_SRPFIEN_Msk (0x1ul << HSOTG_INTEN_SRPFIEN_Pos) /*!< HSOTG_T::INTEN: SRPFIEN Mask */ - -#define HSOTG_INTEN_HNPFIEN_Pos (3) /*!< HSOTG_T::INTEN: HNPFIEN Position */ -#define HSOTG_INTEN_HNPFIEN_Msk (0x1ul << HSOTG_INTEN_HNPFIEN_Pos) /*!< HSOTG_T::INTEN: HNPFIEN Mask */ - -#define HSOTG_INTEN_GOIDLEIEN_Pos (4) /*!< HSOTG_T::INTEN: GOIDLEIEN Position */ -#define HSOTG_INTEN_GOIDLEIEN_Msk (0x1ul << HSOTG_INTEN_GOIDLEIEN_Pos) /*!< HSOTG_T::INTEN: GOIDLEIEN Mask */ - -#define HSOTG_INTEN_IDCHGIEN_Pos (5) /*!< HSOTG_T::INTEN: IDCHGIEN Position */ -#define HSOTG_INTEN_IDCHGIEN_Msk (0x1ul << HSOTG_INTEN_IDCHGIEN_Pos) /*!< HSOTG_T::INTEN: IDCHGIEN Mask */ - -#define HSOTG_INTEN_PDEVIEN_Pos (6) /*!< HSOTG_T::INTEN: PDEVIEN Position */ -#define HSOTG_INTEN_PDEVIEN_Msk (0x1ul << HSOTG_INTEN_PDEVIEN_Pos) /*!< HSOTG_T::INTEN: PDEVIEN Mask */ - -#define HSOTG_INTEN_HOSTIEN_Pos (7) /*!< HSOTG_T::INTEN: HOSTIEN Position */ -#define HSOTG_INTEN_HOSTIEN_Msk (0x1ul << HSOTG_INTEN_HOSTIEN_Pos) /*!< HSOTG_T::INTEN: HOSTIEN Mask */ - -#define HSOTG_INTEN_BVLDCHGIEN_Pos (8) /*!< HSOTG_T::INTEN: BVLDCHGIEN Position */ -#define HSOTG_INTEN_BVLDCHGIEN_Msk (0x1ul << HSOTG_INTEN_BVLDCHGIEN_Pos) /*!< HSOTG_T::INTEN: BVLDCHGIEN Mask */ - -#define HSOTG_INTEN_AVLDCHGIEN_Pos (9) /*!< HSOTG_T::INTEN: AVLDCHGIEN Position */ -#define HSOTG_INTEN_AVLDCHGIEN_Msk (0x1ul << HSOTG_INTEN_AVLDCHGIEN_Pos) /*!< HSOTG_T::INTEN: AVLDCHGIEN Mask */ - -#define HSOTG_INTEN_VBCHGIEN_Pos (10) /*!< HSOTG_T::INTEN: VBCHGIEN Position */ -#define HSOTG_INTEN_VBCHGIEN_Msk (0x1ul << HSOTG_INTEN_VBCHGIEN_Pos) /*!< HSOTG_T::INTEN: VBCHGIEN Mask */ - -#define HSOTG_INTEN_SECHGIEN_Pos (11) /*!< HSOTG_T::INTEN: SECHGIEN Position */ -#define HSOTG_INTEN_SECHGIEN_Msk (0x1ul << HSOTG_INTEN_SECHGIEN_Pos) /*!< HSOTG_T::INTEN: SECHGIEN Mask */ - -#define HSOTG_INTEN_SRPDETIEN_Pos (13) /*!< HSOTG_T::INTEN: SRPDETIEN Position */ -#define HSOTG_INTEN_SRPDETIEN_Msk (0x1ul << HSOTG_INTEN_SRPDETIEN_Pos) /*!< HSOTG_T::INTEN: SRPDETIEN Mask */ - -#define HSOTG_INTSTS_ROLECHGIF_Pos (0) /*!< HSOTG_T::INTSTS: ROLECHGIF Position */ -#define HSOTG_INTSTS_ROLECHGIF_Msk (0x1ul << HSOTG_INTSTS_ROLECHGIF_Pos) /*!< HSOTG_T::INTSTS: ROLECHGIF Mask */ - -#define HSOTG_INTSTS_VBEIF_Pos (1) /*!< HSOTG_T::INTSTS: VBEIF Position */ -#define HSOTG_INTSTS_VBEIF_Msk (0x1ul << HSOTG_INTSTS_VBEIF_Pos) /*!< HSOTG_T::INTSTS: VBEIF Mask */ - -#define HSOTG_INTSTS_SRPFIF_Pos (2) /*!< HSOTG_T::INTSTS: SRPFIF Position */ -#define HSOTG_INTSTS_SRPFIF_Msk (0x1ul << HSOTG_INTSTS_SRPFIF_Pos) /*!< HSOTG_T::INTSTS: SRPFIF Mask */ - -#define HSOTG_INTSTS_HNPFIF_Pos (3) /*!< HSOTG_T::INTSTS: HNPFIF Position */ -#define HSOTG_INTSTS_HNPFIF_Msk (0x1ul << HSOTG_INTSTS_HNPFIF_Pos) /*!< HSOTG_T::INTSTS: HNPFIF Mask */ - -#define HSOTG_INTSTS_GOIDLEIF_Pos (4) /*!< HSOTG_T::INTSTS: GOIDLEIF Position */ -#define HSOTG_INTSTS_GOIDLEIF_Msk (0x1ul << HSOTG_INTSTS_GOIDLEIF_Pos) /*!< HSOTG_T::INTSTS: GOIDLEIF Mask */ - -#define HSOTG_INTSTS_IDCHGIF_Pos (5) /*!< HSOTG_T::INTSTS: IDCHGIF Position */ -#define HSOTG_INTSTS_IDCHGIF_Msk (0x1ul << HSOTG_INTSTS_IDCHGIF_Pos) /*!< HSOTG_T::INTSTS: IDCHGIF Mask */ - -#define HSOTG_INTSTS_PDEVIF_Pos (6) /*!< HSOTG_T::INTSTS: PDEVIF Position */ -#define HSOTG_INTSTS_PDEVIF_Msk (0x1ul << HSOTG_INTSTS_PDEVIF_Pos) /*!< HSOTG_T::INTSTS: PDEVIF Mask */ - -#define HSOTG_INTSTS_HOSTIF_Pos (7) /*!< HSOTG_T::INTSTS: HOSTIF Position */ -#define HSOTG_INTSTS_HOSTIF_Msk (0x1ul << HSOTG_INTSTS_HOSTIF_Pos) /*!< HSOTG_T::INTSTS: HOSTIF Mask */ - -#define HSOTG_INTSTS_BVLDCHGIF_Pos (8) /*!< HSOTG_T::INTSTS: BVLDCHGIF Position */ -#define HSOTG_INTSTS_BVLDCHGIF_Msk (0x1ul << HSOTG_INTSTS_BVLDCHGIF_Pos) /*!< HSOTG_T::INTSTS: BVLDCHGIF Mask */ - -#define HSOTG_INTSTS_AVLDCHGIF_Pos (9) /*!< HSOTG_T::INTSTS: AVLDCHGIF Position */ -#define HSOTG_INTSTS_AVLDCHGIF_Msk (0x1ul << HSOTG_INTSTS_AVLDCHGIF_Pos) /*!< HSOTG_T::INTSTS: AVLDCHGIF Mask */ - -#define HSOTG_INTSTS_VBCHGIF_Pos (10) /*!< HSOTG_T::INTSTS: VBCHGIF Position */ -#define HSOTG_INTSTS_VBCHGIF_Msk (0x1ul << HSOTG_INTSTS_VBCHGIF_Pos) /*!< HSOTG_T::INTSTS: VBCHGIF Mask */ - -#define HSOTG_INTSTS_SECHGIF_Pos (11) /*!< HSOTG_T::INTSTS: SECHGIF Position */ -#define HSOTG_INTSTS_SECHGIF_Msk (0x1ul << HSOTG_INTSTS_SECHGIF_Pos) /*!< HSOTG_T::INTSTS: SECHGIF Mask */ - -#define HSOTG_INTSTS_SRPDETIF_Pos (13) /*!< HSOTG_T::INTSTS: SRPDETIF Position */ -#define HSOTG_INTSTS_SRPDETIF_Msk (0x1ul << HSOTG_INTSTS_SRPDETIF_Pos) /*!< HSOTG_T::INTSTS: SRPDETIF Mask */ - -#define HSOTG_STATUS_OVERCUR_Pos (0) /*!< HSOTG_T::STATUS: OVERCUR Position */ -#define HSOTG_STATUS_OVERCUR_Msk (0x1ul << HSOTG_STATUS_OVERCUR_Pos) /*!< HSOTG_T::STATUS: OVERCUR Mask */ - -#define HSOTG_STATUS_IDSTS_Pos (1) /*!< HSOTG_T::STATUS: IDSTS Position */ -#define HSOTG_STATUS_IDSTS_Msk (0x1ul << HSOTG_STATUS_IDSTS_Pos) /*!< HSOTG_T::STATUS: IDSTS Mask */ - -#define HSOTG_STATUS_SESSEND_Pos (2) /*!< HSOTG_T::STATUS: SESSEND Position */ -#define HSOTG_STATUS_SESSEND_Msk (0x1ul << HSOTG_STATUS_SESSEND_Pos) /*!< HSOTG_T::STATUS: SESSEND Mask */ - -#define HSOTG_STATUS_BVLD_Pos (3) /*!< HSOTG_T::STATUS: BVLD Position */ -#define HSOTG_STATUS_BVLD_Msk (0x1ul << HSOTG_STATUS_BVLD_Pos) /*!< HSOTG_T::STATUS: BVLD Mask */ - -#define HSOTG_STATUS_AVLD_Pos (4) /*!< HSOTG_T::STATUS: AVLD Position */ -#define HSOTG_STATUS_AVLD_Msk (0x1ul << HSOTG_STATUS_AVLD_Pos) /*!< HSOTG_T::STATUS: AVLD Mask */ - -#define HSOTG_STATUS_VBUSVLD_Pos (5) /*!< HSOTG_T::STATUS: VBUSVLD Position */ -#define HSOTG_STATUS_VBUSVLD_Msk (0x1ul << HSOTG_STATUS_VBUSVLD_Pos) /*!< HSOTG_T::STATUS: VBUSVLD Mask */ - -#define HSOTG_STATUS_ASPERI_Pos (6) /*!< HSOTG_T::STATUS: ASPERI Position */ -#define HSOTG_STATUS_ASPERI_Msk (0x1ul << HSOTG_STATUS_ASPERI_Pos) /*!< HSOTG_T::STATUS: ASPERI Mask */ - -#define HSOTG_STATUS_ASHOST_Pos (7) /*!< HSOTG_T::STATUS: ASHOST Position */ -#define HSOTG_STATUS_ASHOST_Msk (0x1ul << HSOTG_STATUS_ASHOST_Pos) /*!< HSOTG_T::STATUS: ASHOST Mask */ - -/**@}*/ /* HSOTG_CONST */ -/**@}*/ /* end of HSOTG register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __HSOTG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbd_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbd_reg.h deleted file mode 100644 index a2fadba87de..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbd_reg.h +++ /dev/null @@ -1,1425 +0,0 @@ -/**************************************************************************//** - * @file hsusbd_reg.h - * @version V3.00 - * @brief HSUSBD register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HSUSBD_REG_H__ -#define __HSUSBD_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup HSUSBD USB 2.0 Device Controller(HSUSBD) - Memory Mapped Structure for HSUSBD Controller -@{ */ - -typedef struct -{ - - /** - * @var HSUSBD_EP_T::EPDAT - * Offset: 0x00 Endpoint n Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |EPDAT |Endpoint A~L Data Register - * | | |Endpoint A~L data buffer for the buffer transaction (read or write). - * | | |Note: Only word access is supported. - * @var HSUSBD_EP_T::EPDAT_BYTE - * Offset: 0x00 Endpoint n Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |EPDAT |Endpoint A~L Data Register - * | | |Endpoint A~L data buffer for the buffer transaction (read or write). - * | | |Note: Only byte access is supported. - * @var HSUSBD_EP_T::EPINTSTS - * Offset: 0x04 Endpoint n Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUFFULLIF |Buffer Full - * | | |For an IN endpoint, the currently selected buffer is full, or no buffer is available to the local side for writing (no space to write) - * | | |For an OUT endpoint, there is a buffer available on the local side, and there are FIFO full of bytes available to be read (entire packet is available for reading). - * | | |0 = The endpoint packet buffer is not full. - * | | |1 = The endpoint packet buffer is full. - * | | |Note: This bit is read-only. - * |[1] |BUFEMPTYIF|Buffer Empty - * | | |For an IN endpoint, a buffer is available to the local side for writing up to FIFO full of bytes. - * | | |0 = The endpoint buffer is not empty. - * | | |1 = The endpoint buffer is empty. - * | | |For an OUT endpoint: - * | | |0 = The currently selected buffer has not a count of 0. - * | | |1 = The currently selected buffer has a count of 0, or no buffer is available on the local side (nothing to read). - * | | |Note: This bit is read-only. - * |[2] |SHORTTXIF |Short Packet Transferred Interrupt - * | | |0 = The length of the last packet was not less than the Maximum Packet Size (EPMPS). - * | | |1 = The length of the last packet was less than the Maximum Packet Size (EPMPS). - * | | |Note: Write 1 to clear this bit to 0. - * |[3] |TXPKIF |Data Packet Transmitted Interrupt - * | | |0 = Not a data packet is transmitted from the endpoint to the host. - * | | |1 = A data packet is transmitted from the endpoint to the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |RXPKIF |Data Packet Received Interrupt - * | | |0 = No data packet is received from the host by the endpoint. - * | | |1 = A data packet is received from the host by the endpoint. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |OUTTKIF |Data OUT Token Interrupt - * | | |0 = A Data OUT token has not been received from the host. - * | | |1 = A Data OUT token has been received from the host - * | | |This bit also set by PING token (in high-speed only). - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |INTKIF |Data IN Token Interrupt - * | | |0 = Not Data IN token has been received from the host. - * | | |1 = A Data IN token has been received from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |PINGIF |PING Token Interrupt - * | | |0 = A Data PING token has not been received from the host. - * | | |1 = A Data PING token has been received from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |NAKIF |USB NAK Sent - * | | |0 = The last USB IN packet could be provided, and was acknowledged with an ACK. - * | | |1 = The last USB IN packet could not be provided, and was acknowledged with a NAK. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |STALLIF |USB STALL Sent - * | | |0 = The last USB packet could be accepted or provided because the endpoint was stalled, and was acknowledged with a STALL. - * | | |1 = The last USB packet could not be accepted or provided because the endpoint was stalled, and was acknowledged with a STALL. - * | | |Note: Write 1 to clear this bit to 0. - * |[10] |NYETIF |NYET Sent - * | | |0 = The space available in the RAM is sufficient to accommodate the next on coming data packet. - * | | |1 = The space available in the RAM is not sufficient to accommodate the next on coming data packet. - * | | |Note: Write 1 to clear this bit to 0. - * |[11] |ERRIF |ERR Sent - * | | |0 = No any error in the transaction. - * | | |1 = There occurs any error in the transaction. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |SHORTRXIF |Bulk Out Short Packet Received - * | | |0 = No bulk out short packet is received. - * | | |1 = Received bulk out short packet (including zero length packet). - * | | |Note: Write 1 to clear this bit to 0. - * @var HSUSBD_EP_T::EPINTEN - * Offset: 0x08 Endpoint n Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUFFULLIEN|Buffer Full Interrupt - * | | |When set, this bit enables a local interrupt to be set when a buffer full condition is detected on the bus. - * | | |0 = Buffer full interrupt Disabled. - * | | |1 = Buffer full interrupt Enabled. - * |[1] |BUFEMPTYIEN|Buffer Empty Interrupt - * | | |When set, this bit enables a local interrupt to be set when a buffer empty condition is detected on the bus. - * | | |0 = Buffer empty interrupt Disabled. - * | | |1 = Buffer empty interrupt Enabled. - * |[2] |SHORTTXIEN|Short Packet Transferred Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a short data packet has been transferred to/from the host. - * | | |0 = Short data packet interrupt Disabled. - * | | |1 = Short data packet interrupt Enabled. - * |[3] |TXPKIEN |Data Packet Transmitted Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a data packet has been received from the host. - * | | |0 = Data packet has been received from the host interrupt Disabled. - * | | |1 = Data packet has been received from the host interrupt Enabled. - * |[4] |RXPKIEN |Data Packet Received Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a data packet has been transmitted to the host. - * | | |0 = Data packet has been transmitted to the host interrupt Disabled. - * | | |1 = Data packet has been transmitted to the host interrupt Enabled. - * |[5] |OUTTKIEN |Data OUT Token Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a Data OUT token has been received from the host. - * | | |0 = Data OUT token interrupt Disabled. - * | | |1 = Data OUT token interrupt Enabled. - * |[6] |INTKIEN |Data IN Token Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a Data IN token has been received from the host. - * | | |0 = Data IN token interrupt Disabled. - * | | |1 = Data IN token interrupt Enabled. - * |[7] |PINGIEN |PING Token Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a PING token has been received from the host. - * | | |0 = PING token interrupt Disabled. - * | | |1 = PING token interrupt Enabled. - * |[8] |NAKIEN |USB NAK Sent Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a NAK token is sent to the host. - * | | |0 = NAK token interrupt Disabled. - * | | |1 = NAK token interrupt Enabled. - * |[9] |STALLIEN |USB STALL Sent Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a stall token is sent to the host. - * | | |0 = STALL token interrupt Disabled. - * | | |1 = STALL token interrupt Enabled. - * |[10] |NYETIEN |NYET Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set whenever NYET condition occurs on the bus for this endpoint. - * | | |0 = NYET condition interrupt Disabled. - * | | |1 = NYET condition interrupt Enabled. - * |[11] |ERRIEN |ERR Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set whenever ERR condition occurs on the bus for this endpoint. - * | | |0 = Error event interrupt Disabled. - * | | |1 = Error event interrupt Enabled. - * |[12] |SHORTRXIEN|Bulk Out Short Packet Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set whenever bulk out short packet occurs on the bus for this endpoint. - * | | |0 = Bulk out interrupt Disabled. - * | | |1 = Bulk out interrupt Enabled. - * @var HSUSBD_EP_T::EPDATCNT - * Offset: 0x0C Endpoint n Data Available Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATCNT |Data Count - * | | |For an IN endpoint (EPDIR(USBD_EPxCFG[3] is high.), this register returns the number of valid bytes in the IN endpoint packet buffer. - * | | |For an OUT endpoint (EPDIR(USBD_EPxCFG[3] is low.), this register returns the number of received valid bytes in the Host OUT transfer. - * |[30:16] |DMALOOP |DMA Loop - * | | |This register is the remaining DMA loop to complete. Each loop means 32-byte transfer. - * @var HSUSBD_EP_T::EPRSPCTL - * Offset: 0x10 Endpoint n Response Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FLUSH |Buffer Flush - * | | |Writing 1 to this bit causes the packet buffer to be flushed and the corresponding EP_AVAIL register to be cleared - * | | |This bit is self-clearing - * | | |This bit should always be written after an configuration event. - * | | |0 = The packet buffer is not flushed. - * | | |1 = The packet buffer is flushed by user. - * |[2:1] |MODE |Mode Control - * | | |The two bits decide the operation mode of the in-endpoint. - * | | |00: Auto-Validate Mode - * | | |01: Manual-Validate Mode - * | | |10: Fly Mode - * | | |11: Reserved - * | | |These bits are not valid for an out-endpoint - * | | |The auto validate mode will be activated when the reserved mode is selected - * |[3] |TOGGLE |Endpoint Toggle - * | | |This bit is used to clear the endpoint data toggle bit - * | | |Reading this bit returns the current state of the endpoint data toggle bit. - * | | |The local CPU may use this bit to initialize the end-point's toggle in case of reception of a Set Interface request or a Clear Feature (ep_halt) request from the host - * | | |Only when toggle bit is "1", this bit can be written into the inversed write data bit[3]. - * | | |0 = Not clear the endpoint data toggle bit. - * | | |1 = Clear the endpoint data toggle bit. - * |[4] |HALT |Endpoint Halt - * | | |This bit is used to send a STALL handshake as response to the token from the host - * | | |When an Endpoint Set Feature (ep_halt) is detected by the local CPU, it must write a '1' to this bit. - * | | |0 = Not send a STALL handshake as response to the token from the host. - * | | |1 = Send a STALL handshake as response to the token from the host. - * |[5] |ZEROLEN |Zero Length - * | | |This bit is used to send a zero-length packet response to an IN-token - * | | |When this bit is set, a zero packet is sent to the host on reception of an IN-token - * | | |This bit gets cleared once the zero length data packet is sent. - * | | |0 = A zero packet is not sent to the host on reception of an IN-token. - * | | |1 = A zero packet is sent to the host on reception of an IN-token. - * |[6] |SHORTTXEN |Short Packet Transfer Enable - * | | |This bit is applicable only in case of Auto-Validate Method - * | | |This bit is set to validate any remaining data in the buffer which is not equal to the MPS of the endpoint, and happens to be the last transfer - * | | |This bit gets cleared once the data packet is sent. - * | | |0 = Not validate any remaining data in the buffer which is not equal to the MPS of the endpoint. - * | | |1 = Validate any remaining data in the buffer which is not equal to the MPS of the endpoint. - * |[7] |DISBUF |Buffer Disable Bit - * | | |This bit is used to receive unknown size OUT short packet - * | | |The received packet size is reference USBD_EPxDATCNT register. - * | | |0 = Buffer Not Disabled when Bulk-OUT short packet is received. - * | | |1 = Buffer Disabled when Bulk-OUT short packet is received. - * @var HSUSBD_EP_T::EPMPS - * Offset: 0x14 Endpoint n Maximum Packet Size Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |EPMPS |Endpoint Maximum Packet Size - * | | |This field determines the Maximum Packet Size of the Endpoint. - * @var HSUSBD_EP_T::EPTXCNT - * Offset: 0x18 Endpoint n Transfer Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |TXCNT |Endpoint Transfer Count - * | | |For IN endpoints, this field determines the total number of bytes to be sent to the host in case of manual validation method. - * | | |For OUT endpoints, this field has no effect. - * @var HSUSBD_EP_T::EPCFG - * Offset: 0x1C Endpoint n Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EPEN |Endpoint Valid - * | | |When set, this bit enables this endpoint - * | | |This bit has no effect on Endpoint 0, which is always enabled. - * | | |0 = The endpoint Disabled. - * | | |1 = The endpoint Enabled. - * |[2:1] |EPTYPE |Endpoint Type - * | | |This field selects the type of this endpoint. Endpoint 0 is forced to a Control type. - * | | |00 = Reserved. - * | | |01 = Bulk. - * | | |10 = Interrupt. - * | | |11 = Isochronous. - * |[3] |EPDIR |Endpoint Direction - * | | |0 = out-endpoint (Host OUT to Device). - * | | |1 = in-endpoint (Host IN to Device). - * | | |Note: A maximum of one OUT and IN endpoint is allowed for each endpoint number. - * |[7:4] |EPNUM |Endpoint Number - * | | |This field selects the number of the endpoint. Valid numbers 1 to 15. - * | | |Note: Do not support two endpoints have same endpoint number. - * @var HSUSBD_EP_T::EPBUFST - * Offset: 0x20 Endpoint n RAM Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |SADDR |Endpoint Start Address - * | | |This is the start-address of the RAM space allocated for the endpoint A~L. - * @var HSUSBD_EP_T::EPBUFEND - * Offset: 0x24 Endpoint n RAM End Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |EADDR |Endpoint End Address - * | | |This is the end-address of the RAM space allocated for the endpoint A~L. - */ - - union - { - __IO uint32_t EPDAT; - __IO uint8_t EPDAT_BYTE; - - }; /*!< [0x0000] Endpoint n Data Register */ - - __IO uint32_t EPINTSTS; /*!< [0x0004] Endpoint n Interrupt Status Register */ - __IO uint32_t EPINTEN; /*!< [0x0008] Endpoint n Interrupt Enable Register */ - __I uint32_t EPDATCNT; /*!< [0x000c] Endpoint n Data Available Count Register */ - __IO uint32_t EPRSPCTL; /*!< [0x0010] Endpoint n Response Control Register */ - __IO uint32_t EPMPS; /*!< [0x0014] Endpoint n Maximum Packet Size Register */ - __IO uint32_t EPTXCNT; /*!< [0x0018] Endpoint n Transfer Count Register */ - __IO uint32_t EPCFG; /*!< [0x001c] Endpoint n Configuration Register */ - __IO uint32_t EPBUFST; /*!< [0x0020] Endpoint n RAM Start Address Register */ - __IO uint32_t EPBUFEND; /*!< [0x0024] Endpoint n RAM End Address Register */ - -} HSUSBD_EP_T; - -typedef struct -{ - - /** - * @var HSUSBD_T::GINTSTS - * Offset: 0x00 Global Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIF |USB Interrupt - * | | |This bit conveys the interrupt status for USB specific events endpoint - * | | |When set, USB interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[1] |CEPIF |Control Endpoint Interrupt - * | | |This bit conveys the interrupt status for control endpoint - * | | |When set, Control-ep's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[2] |EPAIF |Endpoint a Interrupt - * | | |When set, the corresponding Endpoint A's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[3] |EPBIF |Endpoint B Interrupt - * | | |When set, the corresponding Endpoint B's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[4] |EPCIF |Endpoint C Interrupt - * | | |When set, the corresponding Endpoint C's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[5] |EPDIF |Endpoint D Interrupt - * | | |When set, the corresponding Endpoint D's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[6] |EPEIF |Endpoint E Interrupt - * | | |When set, the corresponding Endpoint E's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[7] |EPFIF |Endpoint F Interrupt - * | | |When set, the corresponding Endpoint F's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[8] |EPGIF |Endpoint G Interrupt - * | | |When set, the corresponding Endpoint G's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[9] |EPHIF |Endpoint H Interrupt - * | | |When set, the corresponding Endpoint H's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[10] |EPIIF |Endpoint I Interrupt - * | | |When set, the corresponding Endpoint I's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[11] |EPJIF |Endpoint J Interrupt - * | | |When set, the corresponding Endpoint J's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[12] |EPKIF |Endpoint K Interrupt - * | | |When set, the corresponding Endpoint K's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[13] |EPLIF |Endpoint L Interrupt - * | | |When set, the corresponding Endpoint L's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * @var HSUSBD_T::GINTEN - * Offset: 0x08 Global Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIEN |USB Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be generated when a USB event occurs on the bus. - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[1] |CEPIEN |Control Endpoint Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the control endpoint. - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[2] |EPAIEN |Interrupt Enable Control for Endpoint a - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint A. - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[3] |EPBIEN |Interrupt Enable Control for Endpoint B - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint B - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[4] |EPCIEN |Interrupt Enable Control for Endpoint C - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint C - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[5] |EPDIEN |Interrupt Enable Control for Endpoint D - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint D - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[6] |EPEIEN |Interrupt Enable Control for Endpoint E - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint E - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[7] |EPFIEN |Interrupt Enable Control for Endpoint F - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint F - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[8] |EPGIEN |Interrupt Enable Control for Endpoint G - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint G - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[9] |EPHIEN |Interrupt Enable Control for Endpoint H - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint H - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[10] |EPIIEN |Interrupt Enable Control for Endpoint I - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint I - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[11] |EPJIEN |Interrupt Enable Control for Endpoint J - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint J - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[12] |EPKIEN |Interrupt Enable Control for Endpoint K - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint K - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[13] |EPLIEN |Interrupt Enable Control for Endpoint L - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint L - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * @var HSUSBD_T::BUSINTSTS - * Offset: 0x10 USB Bus Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SOFIF |SOF Receive Control - * | | |This bit indicates when a start-of-frame packet has been received. - * | | |0 = No start-of-frame packet has been received. - * | | |1 = Start-of-frame packet has been received. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |RSTIF |Reset Status - * | | |When set, this bit indicates that either the USB root port reset is end. - * | | |0 = No USB root port reset is end. - * | | |1 = USB root port reset is end. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |RESUMEIF |Resume - * | | |When set, this bit indicates that a device resume has occurred. - * | | |0 = No device resume has occurred. - * | | |1 = Device resume has occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[3] |SUSPENDIF |Suspend Request - * | | |This bit is set as default and it has to be cleared by writing '1' before the USB reset - * | | |This bit is also set when a USB Suspend request is detected from the host. - * | | |0 = No USB Suspend request is detected from the host. - * | | |1= USB Suspend request is detected from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |HISPDIF |High-speed Settle - * | | |0 = No valid high-speed reset protocol is detected. - * | | |1 = Valid high-speed reset protocol is over and the device has settled in high-speed. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |DMADONEIF |DMA Completion Interrupt - * | | |0 = No DMA transfer over. - * | | |1 = DMA transfer is over. - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |PHYCLKVLDIF|Usable Clock Interrupt - * | | |0 = Usable clock is not available. - * | | |1 = Usable clock is available from the transceiver. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |VBUSDETIF |VBUS Detection Interrupt Status - * | | |0 = No VBUS is plug-in. - * | | |1 = VBUS is plug-in. - * | | |Note: Write 1 to clear this bit to 0. - * @var HSUSBD_T::BUSINTEN - * Offset: 0x14 USB Bus Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SOFIEN |SOF Interrupt - * | | |This bit enables the SOF interrupt. - * | | |0 = SOF interrupt Disabled. - * | | |1 = SOF interrupt Enabled. - * |[1] |RSTIEN |Reset Status - * | | |This bit enables the USB-Reset interrupt. - * | | |0 = USB-Reset interrupt Disabled. - * | | |1 = USB-Reset interrupt Enabled. - * |[2] |RESUMEIEN |Resume - * | | |This bit enables the Resume interrupt. - * | | |0 = Resume interrupt Disabled. - * | | |1 = Resume interrupt Enabled. - * |[3] |SUSPENDIEN|Suspend Request - * | | |This bit enables the Suspend interrupt. - * | | |0 = Suspend interrupt Disabled. - * | | |1 = Suspend interrupt Enabled. - * |[4] |HISPDIEN |High-speed Settle - * | | |This bit enables the high-speed settle interrupt. - * | | |0 = High-speed settle interrupt Disabled. - * | | |1 = High-speed settle interrupt Enabled. - * |[5] |DMADONEIEN|DMA Completion Interrupt - * | | |This bit enables the DMA completion interrupt - * | | |0 = DMA completion interrupt Disabled. - * | | |1 = DMA completion interrupt Enabled. - * |[6] |PHYCLKVLDIEN|Usable Clock Interrupt - * | | |This bit enables the usable clock interrupt. - * | | |0 = Usable clock interrupt Disabled. - * | | |1 = Usable clock interrupt Enabled. - * |[8] |VBUSDETIEN|VBUS Detection Interrupt Enable Bit - * | | |This bit enables the VBUS floating detection interrupt. - * | | |0 = VBUS floating detection interrupt Disabled. - * | | |1 = VBUS floating detection interrupt Enabled. - * @var HSUSBD_T::OPER - * Offset: 0x18 USB Operational Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RESUMEEN |Generate Resume - * | | |0 = No Resume sequence to be initiated to the host. - * | | |1 = A Resume sequence to be initiated to the host if device remote wakeup is enabled - * | | |This bit is self-clearing. - * |[1] |HISPDEN |USB High-speed - * | | |0 = The USB device controller to suppress the chirp-sequence during reset protocol, thereby allowing the USB device controller to settle in full-speed, even though it is connected to a USB2.0 Host. - * | | |1 = The USB device controller to initiate a chirp-sequence during reset protocol. - * |[2] |CURSPD |USB Current Speed - * | | |0 = The device has settled in Full Speed. - * | | |1 = The USB device controller has settled in High-speed. - * @var HSUSBD_T::FRAMECNT - * Offset: 0x1C USB Frame Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |MFRAMECNT |Micro-frame Counter - * | | |This field contains the micro-frame number for the frame number in the frame counter field. - * |[13:3] |FRAMECNT |Frame Counter - * | | |This field contains the frame count from the most recent start-of-frame packet. - * @var HSUSBD_T::FADDR - * Offset: 0x20 USB Function Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |FADDR |USB Function Address - * | | |This field contains the current USB address of the device - * | | |This field is cleared when a root port reset is detected - * @var HSUSBD_T::TEST - * Offset: 0x24 USB Test Mode Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TESTMODE |Test Mode Selection - * | | |000 = Normal Operation. - * | | |001 = Test_J. - * | | |010 = Test_K. - * | | |011 = Test_SE0_NAK. - * | | |100 = Test_Packet. - * | | |101 = Test_Force_Enable. - * | | |110 = Reserved. - * | | |111 = Reserved. - * | | |Note: This field is cleared when root port reset is detected. - * @var HSUSBD_T::CEPDAT - * Offset: 0x28 Control-Endpoint Data Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DAT |Control-endpoint Data Buffer - * | | |Control endpoint data buffer for the buffer transaction (read or write). - * | | |Note: Only word access is supported. - * @var HSUSBD_T::CEPDAT_BYTE - * Offset: 0x28 Control-Endpoint Data Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Control-endpoint Data Buffer - * | | |Control endpoint data buffer for the buffer transaction (read or write). - * | | |Note: Only byte access is supported. - * @var HSUSBD_T::CEPCTL - * Offset: 0x2C Control-Endpoint Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |NAKCLR |No Acknowledge Control - * | | |This bit plays a crucial role in any control transfer. - * | | |0 = The bit is being cleared by the local CPU by writing zero, the USB device controller will be responding with NAKs for the subsequent status phase - * | | |This mechanism holds the host from moving to the next request, until the local CPU is also ready to process the next request. - * | | |1 = This bit is set to one by the USB device controller, whenever a setup token is received - * | | |The local CPU can take its own time to finish off any house-keeping work based on the request and then clear this bit. - * | | |Note: Only when CPU writes data[1:0] is 2'b10 or 2'b00, this bit can be updated. - * |[1] |STALLEN |Stall Enable Bit - * | | |When this stall bit is set, the control endpoint sends a stall handshake in response to any in or out token thereafter - * | | |This is typically used for response to invalid/unsupported requests - * | | |When this bit is being set the NAK clear bit has to be cleared at the same time since the NAK clear bit has highest priority than STALL - * | | |It is automatically cleared on receipt of a next setup-token - * | | |So, the local CPU need not write again to clear this bit. - * | | |0 = No sends a stall handshake in response to any in or out token thereafter. - * | | |1 = The control endpoint sends a stall handshake in response to any in or out token thereafter. - * | | |Note: Only when CPU writes data[1:0] is 2'b10 or 2'b00, this bit can be updated. - * |[2] |ZEROLEN |Zero Packet Length - * | | |This bit is valid for Auto Validation mode only. - * | | |0 = No zero length packet to the host during Data stage to an IN token. - * | | |1 = USB device controller can send a zero length packet to the host during Data stage to an IN token - * | | |This bit gets cleared once the zero length data packet is sent - * | | |So, the local CPU need not write again to clear this bit. - * |[3] |FLUSH |CEP-flush Bit - * | | |0 = No the packet buffer and its corresponding USBD_CEPDATCNT register to be cleared. - * | | |1 = The packet buffer and its corresponding USBD_CEPDATCNT register to be cleared - * | | |This bit is self-cleaning. - * @var HSUSBD_T::CEPINTEN - * Offset: 0x30 Control-Endpoint Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SETUPTKIEN|Setup Token Interrupt Enable Bit - * | | |0 = The SETUP token interrupt in Control Endpoint Disabled. - * | | |1 = The SETUP token interrupt in Control Endpoint Enabled. - * |[1] |SETUPPKIEN|Setup Packet Interrupt - * | | |0 = The SETUP packet interrupt in Control Endpoint Disabled. - * | | |1 = The SETUP packet interrupt in Control Endpoint Enabled. - * |[2] |OUTTKIEN |Out Token Interrupt - * | | |0 = The OUT token interrupt in Control Endpoint Disabled. - * | | |1 = The OUT token interrupt in Control Endpoint Enabled. - * |[3] |INTKIEN |In Token Interrupt - * | | |0 = The IN token interrupt in Control Endpoint Disabled. - * | | |1 = The IN token interrupt in Control Endpoint Enabled. - * |[4] |PINGIEN |Ping Token Interrupt - * | | |0 = The ping token interrupt in Control Endpoint Disabled. - * | | |1 = The ping token interrupt Control Endpoint Enabled. - * |[5] |TXPKIEN |Data Packet Transmitted Interrupt - * | | |0 = The data packet transmitted interrupt in Control Endpoint Disabled. - * | | |1 = The data packet transmitted interrupt in Control Endpoint Enabled. - * |[6] |RXPKIEN |Data Packet Received Interrupt - * | | |0 = The data received interrupt in Control Endpoint Disabled. - * | | |1 = The data received interrupt in Control Endpoint Enabled. - * |[7] |NAKIEN |NAK Sent Interrupt - * | | |0 = The NAK sent interrupt in Control Endpoint Disabled. - * | | |1 = The NAK sent interrupt in Control Endpoint Enabled. - * |[8] |STALLIEN |STALL Sent Interrupt - * | | |0 = The STALL sent interrupt in Control Endpoint Disabled. - * | | |1 = The STALL sent interrupt in Control Endpoint Enabled. - * |[9] |ERRIEN |USB Error Interrupt - * | | |0 = The USB Error interrupt in Control Endpoint Disabled. - * | | |1 = The USB Error interrupt in Control Endpoint Enabled. - * |[10] |STSDONEIEN|Status Completion Interrupt - * | | |0 = The Status Completion interrupt in Control Endpoint Disabled. - * | | |1 = The Status Completion interrupt in Control Endpoint Enabled. - * |[11] |BUFFULLIEN|Buffer Full Interrupt - * | | |0 = The buffer full interrupt in Control Endpoint Disabled. - * | | |1 = The buffer full interrupt in Control Endpoint Enabled. - * |[12] |BUFEMPTYIEN|Buffer Empty Interrupt - * | | |0 = The buffer empty interrupt in Control Endpoint Disabled. - * | | |1= The buffer empty interrupt in Control Endpoint Enabled. - * @var HSUSBD_T::CEPINTSTS - * Offset: 0x34 Control-Endpoint Interrupt Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SETUPTKIF |Setup Token Interrupt - * | | |0 = Not a Setup token is received. - * | | |1 = A Setup token is received. Writing 1 clears this status bit - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |SETUPPKIF |Setup Packet Interrupt - * | | |This bit must be cleared (by writing 1) before the next setup packet can be received - * | | |If the bit is not cleared, then the successive setup packets will be overwritten in the setup packet buffer. - * | | |0 = Not a Setup packet has been received from the host. - * | | |1 = A Setup packet has been received from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |OUTTKIF |Out Token Interrupt - * | | |0 = The control-endpoint does not received an OUT token from the host. - * | | |1 = The control-endpoint receives an OUT token from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[3] |INTKIF |in Token Interrupt - * | | |0 = The control-endpoint does not received an IN token from the host. - * | | |1 = The control-endpoint receives an IN token from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |PINGIF |Ping Token Interrupt - * | | |0 = The control-endpoint does not received a ping token from the host. - * | | |1 = The control-endpoint receives a ping token from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |TXPKIF |Data Packet Transmitted Interrupt - * | | |0 = Not a data packet is successfully transmitted to the host in response to an IN-token and an ACK-token is received for the same. - * | | |1 = A data packet is successfully transmitted to the host in response to an IN-token and an ACK-token is received for the same. - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |RXPKIF |Data Packet Received Interrupt - * | | |0 = Not a data packet is successfully received from the host for an OUT-token and an ACK is sent to the host. - * | | |1 = A data packet is successfully received from the host for an OUT-token and an ACK is sent to the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |NAKIF |NAK Sent Interrupt - * | | |0 = Not a NAK-token is sent in response to an IN/OUT token. - * | | |1 = A NAK-token is sent in response to an IN/OUT token. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |STALLIF |STALL Sent Interrupt - * | | |0 = Not a stall-token is sent in response to an IN/OUT token. - * | | |1 = A stall-token is sent in response to an IN/OUT token. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |ERRIF |USB Error Interrupt - * | | |0 = No error had occurred during the transaction. - * | | |1 = An error had occurred during the transaction. - * | | |Note: Write 1 to clear this bit to 0. - * |[10] |STSDONEIF |Status Completion Interrupt - * | | |0 = Not a USB transaction has completed successfully. - * | | |1 = The status stage of a USB transaction has completed successfully. - * | | |Note: Write 1 to clear this bit to 0. - * |[11] |BUFFULLIF |Buffer Full Interrupt - * | | |0 = The control-endpoint buffer is not full. - * | | |1 = The control-endpoint buffer is full. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |BUFEMPTYIF|Buffer Empty Interrupt - * | | |0 = The control-endpoint buffer is not empty. - * | | |1 = The control-endpoint buffer is empty. - * | | |Note: Write 1 to clear this bit to 0. - * @var HSUSBD_T::CEPTXCNT - * Offset: 0x38 Control-Endpoint In-transfer Data Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TXCNT |In-transfer Data Count - * | | |There is no mode selection for the control endpoint (but it operates like manual mode).The local-CPU has to fill the control-endpoint buffer with the data to be sent for an in-token and to write the count of bytes in this register - * | | |When zero is written into this field, a zero length packet is sent to the host - * | | |When the count written in the register is more than the MPS, the data sent will be of only MPS. - * @var HSUSBD_T::CEPRXCNT - * Offset: 0x3C Control-Endpoint Out-transfer Data Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RXCNT |Out-transfer Data Count - * | | |The USB device controller maintains the count of the data received in case of an out transfer, during the control transfer. - * @var HSUSBD_T::CEPDATCNT - * Offset: 0x40 Control-Endpoint data count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATCNT |Control-endpoint Data Count - * | | |The USB device controller maintains the count of the data of control-endpoint. - * @var HSUSBD_T::SETUP1_0 - * Offset: 0x44 Setup1 & Setup0 bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP0 |Setup Byte 0[7:0] - * | | |This register provides byte 0 of the last setup packet received - * | | |For a Standard Device Request, the following bmRequestType information is returned. - * | | |Bit 7(Direction): - * | | | 0: Host to device - * | | | 1: Device to host - * | | |Bit 6-5 (Type): - * | | | 00: Standard - * | | | 01: Class - * | | | 10: Vendor - * | | | 11: Reserved - * | | |Bit 4-0 (Recipient) - * | | | 00000: Device - * | | | 00001: Interface - * | | | 00010: Endpoint - * | | | 00011: Other - * | | | Others: Reserved - * |[15:8] |SETUP1 |Setup Byte 1[15:8] - * | | |This register provides byte 1 of the last setup packet received - * | | |For a Standard Device Request, the following bRequest Code information is returned. - * | | |00000000 = Get Status. - * | | |00000001 = Clear Feature. - * | | |00000010 = Reserved. - * | | |00000011 = Set Feature. - * | | |00000100 = Reserved. - * | | |00000101 = Set Address. - * | | |00000110 = Get Descriptor. - * | | |00000111 = Set Descriptor. - * | | |00001000 = Get Configuration. - * | | |00001001 = Set Configuration. - * | | |00001010 = Get Interface. - * | | |00001011 = Set Interface. - * | | |00001100 = Sync Frame. - * @var HSUSBD_T::SETUP3_2 - * Offset: 0x48 Setup3 & Setup2 Bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP2 |Setup Byte 2 [7:0] - * | | |This register provides byte 2 of the last setup packet received - * | | |For a Standard Device Request, the least significant byte of the wValue field is returned - * |[15:8] |SETUP3 |Setup Byte 3 [15:8] - * | | |This register provides byte 3 of the last setup packet received - * | | |For a Standard Device Request, the most significant byte of the wValue field is returned. - * @var HSUSBD_T::SETUP5_4 - * Offset: 0x4C Setup5 & Setup4 Bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP4 |Setup Byte 4[7:0] - * | | |This register provides byte 4 of the last setup packet received - * | | |For a Standard Device Request, the least significant byte of the wIndex is returned. - * |[15:8] |SETUP5 |Setup Byte 5[15:8] - * | | |This register provides byte 5 of the last setup packet received - * | | |For a Standard Device Request, the most significant byte of the wIndex field is returned. - * @var HSUSBD_T::SETUP7_6 - * Offset: 0x50 Setup7 & Setup6 Bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP6 |Setup Byte 6[7:0] - * | | |This register provides byte 6 of the last setup packet received - * | | |For a Standard Device Request, the least significant byte of the wLength field is returned. - * |[15:8] |SETUP7 |Setup Byte 7[15:8] - * | | |This register provides byte 7 of the last setup packet received - * | | |For a Standard Device Request, the most significant byte of the wLength field is returned. - * @var HSUSBD_T::CEPBUFST - * Offset: 0x54 Control Endpoint RAM Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |SADDR |Control-endpoint Start Address - * | | |This is the start-address of the RAM space allocated for the control-endpoint. - * @var HSUSBD_T::CEPBUFEND - * Offset: 0x58 Control Endpoint RAM End Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |EADDR |Control-endpoint End Address - * | | |This is the end-address of the RAM space allocated for the control-endpoint. - * @var HSUSBD_T::DMACTL - * Offset: 0x5C DMA Control Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNUM |DMA Endpoint Address Bits - * | | |Used to define the Endpoint Address - * |[4] |DMARD |DMA Operation - * | | |0 : The operation is a DMA write (read from USB buffer) - * | | |DMA will check endpoint data available count (USBD_EPxDATCNT) according to EPNM setting before to perform DMA write operation. - * | | |1 : The operation is a DMA read (write to USB buffer). - * |[5] |DMAEN |DMA Enable Bit - * | | |0 : DMA function Disabled. - * | | |1 : DMA function Enabled. - * |[6] |SGEN |Scatter Gather Function Enable Bit - * | | |0 : Scatter gather function Disabled. - * | | |1 : Scatter gather function Enabled. - * |[7] |DMARST |Reset DMA State Machine - * | | |0 : No reset the DMA state machine. - * | | |1 : Reset the DMA state machine. - * |[8] |SVINEP |Serve IN Endpoint - * | | |This bit is used to specify DMA serving endpoint-IN endpoint or OUT endpoint. - * | | |0: DMA serves OUT endpoint - * | | |1: DMA serves IN endpoint - * @var HSUSBD_T::DMACNT - * Offset: 0x60 DMA Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[19:0] |DMACNT |DMA Transfer Count - * | | |The transfer count of the DMA operation to be performed is written to this register. - * @var HSUSBD_T::DMAADDR - * Offset: 0x700 AHB DMA Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMAADDR |DMAADDR - * | | |The register specifies the address from which the DMA has to read / write - * | | |The address must WORD (32-bit) aligned. - * @var HSUSBD_T::PHYCTL - * Offset: 0x704 USB PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |DPPUEN |DP Pull-up - * | | |0 = Pull-up resistor on D+ Disabled. - * | | |1 = Pull-up resistor on D+ Enabled. - * |[9] |PHYEN |PHY Suspend Enable Bit - * | | |0 = The USB PHY is suspend. - * | | |1 = The USB PHY is not suspend. - * |[24] |VBUSWKEN |Wake-up Enable Bit - * | | |0 = The wake-up function Disabled. - * | | |1 = The wake-up function Enabled. - * |[31] |VBUSDET |VBUS Status - * | | |0 = The VBUS is not detected yet. - * | | |1 = The VBUS is detected. - */ - - __I uint32_t GINTSTS; /*!< [0x0000] Global Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t GINTEN; /*!< [0x0008] Global Interrupt Enable Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t BUSINTSTS; /*!< [0x0010] USB Bus Interrupt Status Register */ - __IO uint32_t BUSINTEN; /*!< [0x0014] USB Bus Interrupt Enable Register */ - __IO uint32_t OPER; /*!< [0x0018] USB Operational Register */ - __I uint32_t FRAMECNT; /*!< [0x001c] USB Frame Count Register */ - __IO uint32_t FADDR; /*!< [0x0020] USB Function Address Register */ - __IO uint32_t TEST; /*!< [0x0024] USB Test Mode Register */ - - union - { - __IO uint32_t CEPDAT; - __IO uint8_t CEPDAT_BYTE; - - }; /*!< [0x0028] Control-Endpoint Data Buffer */ - - __IO uint32_t CEPCTL; /*!< [0x002c] Control-Endpoint Control Register */ - __IO uint32_t CEPINTEN; /*!< [0x0030] Control-Endpoint Interrupt Enable */ - __IO uint32_t CEPINTSTS; /*!< [0x0034] Control-Endpoint Interrupt Status */ - __IO uint32_t CEPTXCNT; /*!< [0x0038] Control-Endpoint In-transfer Data Count */ - __I uint32_t CEPRXCNT; /*!< [0x003c] Control-Endpoint Out-transfer Data Count */ - __I uint32_t CEPDATCNT; /*!< [0x0040] Control-Endpoint data count */ - __I uint32_t SETUP1_0; /*!< [0x0044] Setup1 & Setup0 bytes */ - __I uint32_t SETUP3_2; /*!< [0x0048] Setup3 & Setup2 Bytes */ - __I uint32_t SETUP5_4; /*!< [0x004c] Setup5 & Setup4 Bytes */ - __I uint32_t SETUP7_6; /*!< [0x0050] Setup7 & Setup6 Bytes */ - __IO uint32_t CEPBUFST; /*!< [0x0054] Control Endpoint RAM Start Address Register */ - __IO uint32_t CEPBUFEND; /*!< [0x0058] Control Endpoint RAM End Address Register */ - __IO uint32_t DMACTL; /*!< [0x005c] DMA Control Status Register */ - __IO uint32_t DMACNT; /*!< [0x0060] DMA Count Register */ - - HSUSBD_EP_T EP[12]; - - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[301]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t BCDC; /*!< [0x06f8] Battery Charge Detect Control Register */ - __IO uint32_t LPMCSR; /*!< [0x06fc] LPM Control and Status Register */ - __IO uint32_t DMAADDR; /*!< [0x0700] AHB DMA Address Register */ - __IO uint32_t PHYCTL; /*!< [0x0704] USB PHY Control Register */ - -} HSUSBD_T; - -/** - @addtogroup HSUSBD_CONST HSUSBD Bit Field Definition - Constant Definitions for HSUSBD Controller -@{ */ - -#define HSUSBD_GINTSTS_USBIF_Pos (0) /*!< HSUSBD_T::GINTSTS: USBIF Position */ -#define HSUSBD_GINTSTS_USBIF_Msk (0x1ul << HSUSBD_GINTSTS_USBIF_Pos) /*!< HSUSBD_T::GINTSTS: USBIF Mask */ - -#define HSUSBD_GINTSTS_CEPIF_Pos (1) /*!< HSUSBD_T::GINTSTS: CEPIF Position */ -#define HSUSBD_GINTSTS_CEPIF_Msk (0x1ul << HSUSBD_GINTSTS_CEPIF_Pos) /*!< HSUSBD_T::GINTSTS: CEPIF Mask */ - -#define HSUSBD_GINTSTS_EPAIF_Pos (2) /*!< HSUSBD_T::GINTSTS: EPAIF Position */ -#define HSUSBD_GINTSTS_EPAIF_Msk (0x1ul << HSUSBD_GINTSTS_EPAIF_Pos) /*!< HSUSBD_T::GINTSTS: EPAIF Mask */ - -#define HSUSBD_GINTSTS_EPBIF_Pos (3) /*!< HSUSBD_T::GINTSTS: EPBIF Position */ -#define HSUSBD_GINTSTS_EPBIF_Msk (0x1ul << HSUSBD_GINTSTS_EPBIF_Pos) /*!< HSUSBD_T::GINTSTS: EPBIF Mask */ - -#define HSUSBD_GINTSTS_EPCIF_Pos (4) /*!< HSUSBD_T::GINTSTS: EPCIF Position */ -#define HSUSBD_GINTSTS_EPCIF_Msk (0x1ul << HSUSBD_GINTSTS_EPCIF_Pos) /*!< HSUSBD_T::GINTSTS: EPCIF Mask */ - -#define HSUSBD_GINTSTS_EPDIF_Pos (5) /*!< HSUSBD_T::GINTSTS: EPDIF Position */ -#define HSUSBD_GINTSTS_EPDIF_Msk (0x1ul << HSUSBD_GINTSTS_EPDIF_Pos) /*!< HSUSBD_T::GINTSTS: EPDIF Mask */ - -#define HSUSBD_GINTSTS_EPEIF_Pos (6) /*!< HSUSBD_T::GINTSTS: EPEIF Position */ -#define HSUSBD_GINTSTS_EPEIF_Msk (0x1ul << HSUSBD_GINTSTS_EPEIF_Pos) /*!< HSUSBD_T::GINTSTS: EPEIF Mask */ - -#define HSUSBD_GINTSTS_EPFIF_Pos (7) /*!< HSUSBD_T::GINTSTS: EPFIF Position */ -#define HSUSBD_GINTSTS_EPFIF_Msk (0x1ul << HSUSBD_GINTSTS_EPFIF_Pos) /*!< HSUSBD_T::GINTSTS: EPFIF Mask */ - -#define HSUSBD_GINTSTS_EPGIF_Pos (8) /*!< HSUSBD_T::GINTSTS: EPGIF Position */ -#define HSUSBD_GINTSTS_EPGIF_Msk (0x1ul << HSUSBD_GINTSTS_EPGIF_Pos) /*!< HSUSBD_T::GINTSTS: EPGIF Mask */ - -#define HSUSBD_GINTSTS_EPHIF_Pos (9) /*!< HSUSBD_T::GINTSTS: EPHIF Position */ -#define HSUSBD_GINTSTS_EPHIF_Msk (0x1ul << HSUSBD_GINTSTS_EPHIF_Pos) /*!< HSUSBD_T::GINTSTS: EPHIF Mask */ - -#define HSUSBD_GINTSTS_EPIIF_Pos (10) /*!< HSUSBD_T::GINTSTS: EPIIF Position */ -#define HSUSBD_GINTSTS_EPIIF_Msk (0x1ul << HSUSBD_GINTSTS_EPIIF_Pos) /*!< HSUSBD_T::GINTSTS: EPIIF Mask */ - -#define HSUSBD_GINTSTS_EPJIF_Pos (11) /*!< HSUSBD_T::GINTSTS: EPJIF Position */ -#define HSUSBD_GINTSTS_EPJIF_Msk (0x1ul << HSUSBD_GINTSTS_EPJIF_Pos) /*!< HSUSBD_T::GINTSTS: EPJIF Mask */ - -#define HSUSBD_GINTSTS_EPKIF_Pos (12) /*!< HSUSBD_T::GINTSTS: EPKIF Position */ -#define HSUSBD_GINTSTS_EPKIF_Msk (0x1ul << HSUSBD_GINTSTS_EPKIF_Pos) /*!< HSUSBD_T::GINTSTS: EPKIF Mask */ - -#define HSUSBD_GINTSTS_EPLIF_Pos (13) /*!< HSUSBD_T::GINTSTS: EPLIF Position */ -#define HSUSBD_GINTSTS_EPLIF_Msk (0x1ul << HSUSBD_GINTSTS_EPLIF_Pos) /*!< HSUSBD_T::GINTSTS: EPLIF Mask */ - -#define HSUSBD_GINTEN_USBIEN_Pos (0) /*!< HSUSBD_T::GINTEN: USBIEN Position */ -#define HSUSBD_GINTEN_USBIEN_Msk (0x1ul << HSUSBD_GINTEN_USBIEN_Pos) /*!< HSUSBD_T::GINTEN: USBIEN Mask */ - -#define HSUSBD_GINTEN_CEPIEN_Pos (1) /*!< HSUSBD_T::GINTEN: CEPIEN Position */ -#define HSUSBD_GINTEN_CEPIEN_Msk (0x1ul << HSUSBD_GINTEN_CEPIEN_Pos) /*!< HSUSBD_T::GINTEN: CEPIEN Mask */ - -#define HSUSBD_GINTEN_EPAIEN_Pos (2) /*!< HSUSBD_T::GINTEN: EPAIEN Position */ -#define HSUSBD_GINTEN_EPAIEN_Msk (0x1ul << HSUSBD_GINTEN_EPAIEN_Pos) /*!< HSUSBD_T::GINTEN: EPAIEN Mask */ - -#define HSUSBD_GINTEN_EPBIEN_Pos (3) /*!< HSUSBD_T::GINTEN: EPBIEN Position */ -#define HSUSBD_GINTEN_EPBIEN_Msk (0x1ul << HSUSBD_GINTEN_EPBIEN_Pos) /*!< HSUSBD_T::GINTEN: EPBIEN Mask */ - -#define HSUSBD_GINTEN_EPCIEN_Pos (4) /*!< HSUSBD_T::GINTEN: EPCIEN Position */ -#define HSUSBD_GINTEN_EPCIEN_Msk (0x1ul << HSUSBD_GINTEN_EPCIEN_Pos) /*!< HSUSBD_T::GINTEN: EPCIEN Mask */ - -#define HSUSBD_GINTEN_EPDIEN_Pos (5) /*!< HSUSBD_T::GINTEN: EPDIEN Position */ -#define HSUSBD_GINTEN_EPDIEN_Msk (0x1ul << HSUSBD_GINTEN_EPDIEN_Pos) /*!< HSUSBD_T::GINTEN: EPDIEN Mask */ - -#define HSUSBD_GINTEN_EPEIEN_Pos (6) /*!< HSUSBD_T::GINTEN: EPEIEN Position */ -#define HSUSBD_GINTEN_EPEIEN_Msk (0x1ul << HSUSBD_GINTEN_EPEIEN_Pos) /*!< HSUSBD_T::GINTEN: EPEIEN Mask */ - -#define HSUSBD_GINTEN_EPFIEN_Pos (7) /*!< HSUSBD_T::GINTEN: EPFIEN Position */ -#define HSUSBD_GINTEN_EPFIEN_Msk (0x1ul << HSUSBD_GINTEN_EPFIEN_Pos) /*!< HSUSBD_T::GINTEN: EPFIEN Mask */ - -#define HSUSBD_GINTEN_EPGIEN_Pos (8) /*!< HSUSBD_T::GINTEN: EPGIEN Position */ -#define HSUSBD_GINTEN_EPGIEN_Msk (0x1ul << HSUSBD_GINTEN_EPGIEN_Pos) /*!< HSUSBD_T::GINTEN: EPGIEN Mask */ - -#define HSUSBD_GINTEN_EPHIEN_Pos (9) /*!< HSUSBD_T::GINTEN: EPHIEN Position */ -#define HSUSBD_GINTEN_EPHIEN_Msk (0x1ul << HSUSBD_GINTEN_EPHIEN_Pos) /*!< HSUSBD_T::GINTEN: EPHIEN Mask */ - -#define HSUSBD_GINTEN_EPIIEN_Pos (10) /*!< HSUSBD_T::GINTEN: EPIIEN Position */ -#define HSUSBD_GINTEN_EPIIEN_Msk (0x1ul << HSUSBD_GINTEN_EPIIEN_Pos) /*!< HSUSBD_T::GINTEN: EPIIEN Mask */ - -#define HSUSBD_GINTEN_EPJIEN_Pos (11) /*!< HSUSBD_T::GINTEN: EPJIEN Position */ -#define HSUSBD_GINTEN_EPJIEN_Msk (0x1ul << HSUSBD_GINTEN_EPJIEN_Pos) /*!< HSUSBD_T::GINTEN: EPJIEN Mask */ - -#define HSUSBD_GINTEN_EPKIEN_Pos (12) /*!< HSUSBD_T::GINTEN: EPKIEN Position */ -#define HSUSBD_GINTEN_EPKIEN_Msk (0x1ul << HSUSBD_GINTEN_EPKIEN_Pos) /*!< HSUSBD_T::GINTEN: EPKIEN Mask */ - -#define HSUSBD_GINTEN_EPLIEN_Pos (13) /*!< HSUSBD_T::GINTEN: EPLIEN Position */ -#define HSUSBD_GINTEN_EPLIEN_Msk (0x1ul << HSUSBD_GINTEN_EPLIEN_Pos) /*!< HSUSBD_T::GINTEN: EPLIEN Mask */ - -#define HSUSBD_BUSINTSTS_SOFIF_Pos (0) /*!< HSUSBD_T::BUSINTSTS: SOFIF Position */ -#define HSUSBD_BUSINTSTS_SOFIF_Msk (0x1ul << HSUSBD_BUSINTSTS_SOFIF_Pos) /*!< HSUSBD_T::BUSINTSTS: SOFIF Mask */ - -#define HSUSBD_BUSINTSTS_RSTIF_Pos (1) /*!< HSUSBD_T::BUSINTSTS: RSTIF Position */ -#define HSUSBD_BUSINTSTS_RSTIF_Msk (0x1ul << HSUSBD_BUSINTSTS_RSTIF_Pos) /*!< HSUSBD_T::BUSINTSTS: RSTIF Mask */ - -#define HSUSBD_BUSINTSTS_RESUMEIF_Pos (2) /*!< HSUSBD_T::BUSINTSTS: RESUMEIF Position */ -#define HSUSBD_BUSINTSTS_RESUMEIF_Msk (0x1ul << HSUSBD_BUSINTSTS_RESUMEIF_Pos) /*!< HSUSBD_T::BUSINTSTS: RESUMEIF Mask */ - -#define HSUSBD_BUSINTSTS_SUSPENDIF_Pos (3) /*!< HSUSBD_T::BUSINTSTS: SUSPENDIF Position*/ -#define HSUSBD_BUSINTSTS_SUSPENDIF_Msk (0x1ul << HSUSBD_BUSINTSTS_SUSPENDIF_Pos) /*!< HSUSBD_T::BUSINTSTS: SUSPENDIF Mask */ - -#define HSUSBD_BUSINTSTS_HISPDIF_Pos (4) /*!< HSUSBD_T::BUSINTSTS: HISPDIF Position */ -#define HSUSBD_BUSINTSTS_HISPDIF_Msk (0x1ul << HSUSBD_BUSINTSTS_HISPDIF_Pos) /*!< HSUSBD_T::BUSINTSTS: HISPDIF Mask */ - -#define HSUSBD_BUSINTSTS_DMADONEIF_Pos (5) /*!< HSUSBD_T::BUSINTSTS: DMADONEIF Position*/ -#define HSUSBD_BUSINTSTS_DMADONEIF_Msk (0x1ul << HSUSBD_BUSINTSTS_DMADONEIF_Pos) /*!< HSUSBD_T::BUSINTSTS: DMADONEIF Mask */ - -#define HSUSBD_BUSINTSTS_PHYCLKVLDIF_Pos (6) /*!< HSUSBD_T::BUSINTSTS: PHYCLKVLDIF Position*/ -#define HSUSBD_BUSINTSTS_PHYCLKVLDIF_Msk (0x1ul << HSUSBD_BUSINTSTS_PHYCLKVLDIF_Pos) /*!< HSUSBD_T::BUSINTSTS: PHYCLKVLDIF Mask */ - -#define HSUSBD_BUSINTSTS_VBUSDETIF_Pos (8) /*!< HSUSBD_T::BUSINTSTS: VBUSDETIF Position*/ -#define HSUSBD_BUSINTSTS_VBUSDETIF_Msk (0x1ul << HSUSBD_BUSINTSTS_VBUSDETIF_Pos) /*!< HSUSBD_T::BUSINTSTS: VBUSDETIF Mask */ - -#define HSUSBD_BUSINTSTS_LPMTKNIF_Pos (9) /*!< HSUSBD_T::BUSINTSTS: LPMTKNIF Position */ -#define HSUSBD_BUSINTSTS_LPMTKNIF_Msk (0x1ul << HSUSBD_BUSINTSTS_LPMTKNIF_Pos) /*!< HSUSBD_T::BUSINTSTS: LPMTKNIF Mask */ - -#define HSUSBD_BUSINTEN_SOFIEN_Pos (0) /*!< HSUSBD_T::BUSINTEN: SOFIEN Position */ -#define HSUSBD_BUSINTEN_SOFIEN_Msk (0x1ul << HSUSBD_BUSINTEN_SOFIEN_Pos) /*!< HSUSBD_T::BUSINTEN: SOFIEN Mask */ - -#define HSUSBD_BUSINTEN_RSTIEN_Pos (1) /*!< HSUSBD_T::BUSINTEN: RSTIEN Position */ -#define HSUSBD_BUSINTEN_RSTIEN_Msk (0x1ul << HSUSBD_BUSINTEN_RSTIEN_Pos) /*!< HSUSBD_T::BUSINTEN: RSTIEN Mask */ - -#define HSUSBD_BUSINTEN_RESUMEIEN_Pos (2) /*!< HSUSBD_T::BUSINTEN: RESUMEIEN Position */ -#define HSUSBD_BUSINTEN_RESUMEIEN_Msk (0x1ul << HSUSBD_BUSINTEN_RESUMEIEN_Pos) /*!< HSUSBD_T::BUSINTEN: RESUMEIEN Mask */ - -#define HSUSBD_BUSINTEN_SUSPENDIEN_Pos (3) /*!< HSUSBD_T::BUSINTEN: SUSPENDIEN Position*/ -#define HSUSBD_BUSINTEN_SUSPENDIEN_Msk (0x1ul << HSUSBD_BUSINTEN_SUSPENDIEN_Pos) /*!< HSUSBD_T::BUSINTEN: SUSPENDIEN Mask */ - -#define HSUSBD_BUSINTEN_HISPDIEN_Pos (4) /*!< HSUSBD_T::BUSINTEN: HISPDIEN Position */ -#define HSUSBD_BUSINTEN_HISPDIEN_Msk (0x1ul << HSUSBD_BUSINTEN_HISPDIEN_Pos) /*!< HSUSBD_T::BUSINTEN: HISPDIEN Mask */ - -#define HSUSBD_BUSINTEN_DMADONEIEN_Pos (5) /*!< HSUSBD_T::BUSINTEN: DMADONEIEN Position*/ -#define HSUSBD_BUSINTEN_DMADONEIEN_Msk (0x1ul << HSUSBD_BUSINTEN_DMADONEIEN_Pos) /*!< HSUSBD_T::BUSINTEN: DMADONEIEN Mask */ - -#define HSUSBD_BUSINTEN_PHYCLKVLDIEN_Pos (6) /*!< HSUSBD_T::BUSINTEN: PHYCLKVLDIEN Position*/ -#define HSUSBD_BUSINTEN_PHYCLKVLDIEN_Msk (0x1ul << HSUSBD_BUSINTEN_PHYCLKVLDIEN_Pos) /*!< HSUSBD_T::BUSINTEN: PHYCLKVLDIEN Mask */ - -#define HSUSBD_BUSINTEN_VBUSDETIEN_Pos (8) /*!< HSUSBD_T::BUSINTEN: VBUSDETIEN Position*/ -#define HSUSBD_BUSINTEN_VBUSDETIEN_Msk (0x1ul << HSUSBD_BUSINTEN_VBUSDETIEN_Pos) /*!< HSUSBD_T::BUSINTEN: VBUSDETIEN Mask */ - -#define HSUSBD_BUSINTEN_LPMTKNIEN_Pos (9) /*!< HSUSBD_T::BUSINTEN: LPMTKNIEN Position */ -#define HSUSBD_BUSINTEN_LPMTKNIEN_Msk (0x1ul << HSUSBD_BUSINTEN_LPMTKNIEN_Pos) /*!< HSUSBD_T::BUSINTEN: LPMTKNIEN Mask */ - -#define HSUSBD_OPER_RESUMEEN_Pos (0) /*!< HSUSBD_T::OPER: RESUMEEN Position */ -#define HSUSBD_OPER_RESUMEEN_Msk (0x1ul << HSUSBD_OPER_RESUMEEN_Pos) /*!< HSUSBD_T::OPER: RESUMEEN Mask */ - -#define HSUSBD_OPER_HISPDEN_Pos (1) /*!< HSUSBD_T::OPER: HISPDEN Position */ -#define HSUSBD_OPER_HISPDEN_Msk (0x1ul << HSUSBD_OPER_HISPDEN_Pos) /*!< HSUSBD_T::OPER: HISPDEN Mask */ - -#define HSUSBD_OPER_CURSPD_Pos (2) /*!< HSUSBD_T::OPER: CURSPD Position */ -#define HSUSBD_OPER_CURSPD_Msk (0x1ul << HSUSBD_OPER_CURSPD_Pos) /*!< HSUSBD_T::OPER: CURSPD Mask */ - -#define HSUSBD_FRAMECNT_MFRAMECNT_Pos (0) /*!< HSUSBD_T::FRAMECNT: MFRAMECNT Position */ -#define HSUSBD_FRAMECNT_MFRAMECNT_Msk (0x7ul << HSUSBD_FRAMECNT_MFRAMECNT_Pos) /*!< HSUSBD_T::FRAMECNT: MFRAMECNT Mask */ - -#define HSUSBD_FRAMECNT_FRAMECNT_Pos (3) /*!< HSUSBD_T::FRAMECNT: FRAMECNT Position */ -#define HSUSBD_FRAMECNT_FRAMECNT_Msk (0x7fful << HSUSBD_FRAMECNT_FRAMECNT_Pos) /*!< HSUSBD_T::FRAMECNT: FRAMECNT Mask */ - -#define HSUSBD_FADDR_FADDR_Pos (0) /*!< HSUSBD_T::FADDR: FADDR Position */ -#define HSUSBD_FADDR_FADDR_Msk (0x7ful << HSUSBD_FADDR_FADDR_Pos) /*!< HSUSBD_T::FADDR: FADDR Mask */ - -#define HSUSBD_TEST_TESTMODE_Pos (0) /*!< HSUSBD_T::TEST: TESTMODE Position */ -#define HSUSBD_TEST_TESTMODE_Msk (0x7ul << HSUSBD_TEST_TESTMODE_Pos) /*!< HSUSBD_T::TEST: TESTMODE Mask */ - -#define HSUSBD_CEPDAT_DAT_Pos (0) /*!< HSUSBD_T::CEPDAT: DAT Position */ -#define HSUSBD_CEPDAT_DAT_Msk (0xfffffffful << HSUSBD_CEPDAT_DAT_Pos) /*!< HSUSBD_T::CEPDAT: DAT Mask */ - -#define HSUSBD_CEPCTL_NAKCLR_Pos (0) /*!< HSUSBD_T::CEPCTL: NAKCLR Position */ -#define HSUSBD_CEPCTL_NAKCLR_Msk (0x1ul << HSUSBD_CEPCTL_NAKCLR_Pos) /*!< HSUSBD_T::CEPCTL: NAKCLR Mask */ - -#define HSUSBD_CEPCTL_STALLEN_Pos (1) /*!< HSUSBD_T::CEPCTL: STALLEN Position */ -#define HSUSBD_CEPCTL_STALLEN_Msk (0x1ul << HSUSBD_CEPCTL_STALLEN_Pos) /*!< HSUSBD_T::CEPCTL: STALLEN Mask */ - -#define HSUSBD_CEPCTL_ZEROLEN_Pos (2) /*!< HSUSBD_T::CEPCTL: ZEROLEN Position */ -#define HSUSBD_CEPCTL_ZEROLEN_Msk (0x1ul << HSUSBD_CEPCTL_ZEROLEN_Pos) /*!< HSUSBD_T::CEPCTL: ZEROLEN Mask */ - -#define HSUSBD_CEPCTL_FLUSH_Pos (3) /*!< HSUSBD_T::CEPCTL: FLUSH Position */ -#define HSUSBD_CEPCTL_FLUSH_Msk (0x1ul << HSUSBD_CEPCTL_FLUSH_Pos) /*!< HSUSBD_T::CEPCTL: FLUSH Mask */ - -#define HSUSBD_CEPINTEN_SETUPTKIEN_Pos (0) /*!< HSUSBD_T::CEPINTEN: SETUPTKIEN Position*/ -#define HSUSBD_CEPINTEN_SETUPTKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_SETUPTKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: SETUPTKIEN Mask */ - -#define HSUSBD_CEPINTEN_SETUPPKIEN_Pos (1) /*!< HSUSBD_T::CEPINTEN: SETUPPKIEN Position*/ -#define HSUSBD_CEPINTEN_SETUPPKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_SETUPPKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: SETUPPKIEN Mask */ - -#define HSUSBD_CEPINTEN_OUTTKIEN_Pos (2) /*!< HSUSBD_T::CEPINTEN: OUTTKIEN Position */ -#define HSUSBD_CEPINTEN_OUTTKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_OUTTKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: OUTTKIEN Mask */ - -#define HSUSBD_CEPINTEN_INTKIEN_Pos (3) /*!< HSUSBD_T::CEPINTEN: INTKIEN Position */ -#define HSUSBD_CEPINTEN_INTKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_INTKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: INTKIEN Mask */ - -#define HSUSBD_CEPINTEN_PINGIEN_Pos (4) /*!< HSUSBD_T::CEPINTEN: PINGIEN Position */ -#define HSUSBD_CEPINTEN_PINGIEN_Msk (0x1ul << HSUSBD_CEPINTEN_PINGIEN_Pos) /*!< HSUSBD_T::CEPINTEN: PINGIEN Mask */ - -#define HSUSBD_CEPINTEN_TXPKIEN_Pos (5) /*!< HSUSBD_T::CEPINTEN: TXPKIEN Position */ -#define HSUSBD_CEPINTEN_TXPKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_TXPKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: TXPKIEN Mask */ - -#define HSUSBD_CEPINTEN_RXPKIEN_Pos (6) /*!< HSUSBD_T::CEPINTEN: RXPKIEN Position */ -#define HSUSBD_CEPINTEN_RXPKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_RXPKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: RXPKIEN Mask */ - -#define HSUSBD_CEPINTEN_NAKIEN_Pos (7) /*!< HSUSBD_T::CEPINTEN: NAKIEN Position */ -#define HSUSBD_CEPINTEN_NAKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_NAKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: NAKIEN Mask */ - -#define HSUSBD_CEPINTEN_STALLIEN_Pos (8) /*!< HSUSBD_T::CEPINTEN: STALLIEN Position */ -#define HSUSBD_CEPINTEN_STALLIEN_Msk (0x1ul << HSUSBD_CEPINTEN_STALLIEN_Pos) /*!< HSUSBD_T::CEPINTEN: STALLIEN Mask */ - -#define HSUSBD_CEPINTEN_ERRIEN_Pos (9) /*!< HSUSBD_T::CEPINTEN: ERRIEN Position */ -#define HSUSBD_CEPINTEN_ERRIEN_Msk (0x1ul << HSUSBD_CEPINTEN_ERRIEN_Pos) /*!< HSUSBD_T::CEPINTEN: ERRIEN Mask */ - -#define HSUSBD_CEPINTEN_STSDONEIEN_Pos (10) /*!< HSUSBD_T::CEPINTEN: STSDONEIEN Position*/ -#define HSUSBD_CEPINTEN_STSDONEIEN_Msk (0x1ul << HSUSBD_CEPINTEN_STSDONEIEN_Pos) /*!< HSUSBD_T::CEPINTEN: STSDONEIEN Mask */ - -#define HSUSBD_CEPINTEN_BUFFULLIEN_Pos (11) /*!< HSUSBD_T::CEPINTEN: BUFFULLIEN Position*/ -#define HSUSBD_CEPINTEN_BUFFULLIEN_Msk (0x1ul << HSUSBD_CEPINTEN_BUFFULLIEN_Pos) /*!< HSUSBD_T::CEPINTEN: BUFFULLIEN Mask */ - -#define HSUSBD_CEPINTEN_BUFEMPTYIEN_Pos (12) /*!< HSUSBD_T::CEPINTEN: BUFEMPTYIEN Position*/ -#define HSUSBD_CEPINTEN_BUFEMPTYIEN_Msk (0x1ul << HSUSBD_CEPINTEN_BUFEMPTYIEN_Pos) /*!< HSUSBD_T::CEPINTEN: BUFEMPTYIEN Mask */ - -#define HSUSBD_CEPINTSTS_SETUPTKIF_Pos (0) /*!< HSUSBD_T::CEPINTSTS: SETUPTKIF Position*/ -#define HSUSBD_CEPINTSTS_SETUPTKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_SETUPTKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: SETUPTKIF Mask */ - -#define HSUSBD_CEPINTSTS_SETUPPKIF_Pos (1) /*!< HSUSBD_T::CEPINTSTS: SETUPPKIF Position*/ -#define HSUSBD_CEPINTSTS_SETUPPKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_SETUPPKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: SETUPPKIF Mask */ - -#define HSUSBD_CEPINTSTS_OUTTKIF_Pos (2) /*!< HSUSBD_T::CEPINTSTS: OUTTKIF Position */ -#define HSUSBD_CEPINTSTS_OUTTKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_OUTTKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: OUTTKIF Mask */ - -#define HSUSBD_CEPINTSTS_INTKIF_Pos (3) /*!< HSUSBD_T::CEPINTSTS: INTKIF Position */ -#define HSUSBD_CEPINTSTS_INTKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_INTKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: INTKIF Mask */ - -#define HSUSBD_CEPINTSTS_PINGIF_Pos (4) /*!< HSUSBD_T::CEPINTSTS: PINGIF Position */ -#define HSUSBD_CEPINTSTS_PINGIF_Msk (0x1ul << HSUSBD_CEPINTSTS_PINGIF_Pos) /*!< HSUSBD_T::CEPINTSTS: PINGIF Mask */ - -#define HSUSBD_CEPINTSTS_TXPKIF_Pos (5) /*!< HSUSBD_T::CEPINTSTS: TXPKIF Position */ -#define HSUSBD_CEPINTSTS_TXPKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_TXPKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: TXPKIF Mask */ - -#define HSUSBD_CEPINTSTS_RXPKIF_Pos (6) /*!< HSUSBD_T::CEPINTSTS: RXPKIF Position */ -#define HSUSBD_CEPINTSTS_RXPKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_RXPKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: RXPKIF Mask */ - -#define HSUSBD_CEPINTSTS_NAKIF_Pos (7) /*!< HSUSBD_T::CEPINTSTS: NAKIF Position */ -#define HSUSBD_CEPINTSTS_NAKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_NAKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: NAKIF Mask */ - -#define HSUSBD_CEPINTSTS_STALLIF_Pos (8) /*!< HSUSBD_T::CEPINTSTS: STALLIF Position */ -#define HSUSBD_CEPINTSTS_STALLIF_Msk (0x1ul << HSUSBD_CEPINTSTS_STALLIF_Pos) /*!< HSUSBD_T::CEPINTSTS: STALLIF Mask */ - -#define HSUSBD_CEPINTSTS_ERRIF_Pos (9) /*!< HSUSBD_T::CEPINTSTS: ERRIF Position */ -#define HSUSBD_CEPINTSTS_ERRIF_Msk (0x1ul << HSUSBD_CEPINTSTS_ERRIF_Pos) /*!< HSUSBD_T::CEPINTSTS: ERRIF Mask */ - -#define HSUSBD_CEPINTSTS_STSDONEIF_Pos (10) /*!< HSUSBD_T::CEPINTSTS: STSDONEIF Position*/ -#define HSUSBD_CEPINTSTS_STSDONEIF_Msk (0x1ul << HSUSBD_CEPINTSTS_STSDONEIF_Pos) /*!< HSUSBD_T::CEPINTSTS: STSDONEIF Mask */ - -#define HSUSBD_CEPINTSTS_BUFFULLIF_Pos (11) /*!< HSUSBD_T::CEPINTSTS: BUFFULLIF Position*/ -#define HSUSBD_CEPINTSTS_BUFFULLIF_Msk (0x1ul << HSUSBD_CEPINTSTS_BUFFULLIF_Pos) /*!< HSUSBD_T::CEPINTSTS: BUFFULLIF Mask */ - -#define HSUSBD_CEPINTSTS_BUFEMPTYIF_Pos (12) /*!< HSUSBD_T::CEPINTSTS: BUFEMPTYIF Position*/ -#define HSUSBD_CEPINTSTS_BUFEMPTYIF_Msk (0x1ul << HSUSBD_CEPINTSTS_BUFEMPTYIF_Pos) /*!< HSUSBD_T::CEPINTSTS: BUFEMPTYIF Mask */ - -#define HSUSBD_CEPTXCNT_TXCNT_Pos (0) /*!< HSUSBD_T::CEPTXCNT: TXCNT Position */ -#define HSUSBD_CEPTXCNT_TXCNT_Msk (0xfful << HSUSBD_CEPTXCNT_TXCNT_Pos) /*!< HSUSBD_T::CEPTXCNT: TXCNT Mask */ - -#define HSUSBD_CEPRXCNT_RXCNT_Pos (0) /*!< HSUSBD_T::CEPRXCNT: RXCNT Position */ -#define HSUSBD_CEPRXCNT_RXCNT_Msk (0xfful << HSUSBD_CEPRXCNT_RXCNT_Pos) /*!< HSUSBD_T::CEPRXCNT: RXCNT Mask */ - -#define HSUSBD_CEPDATCNT_DATCNT_Pos (0) /*!< HSUSBD_T::CEPDATCNT: DATCNT Position */ -#define HSUSBD_CEPDATCNT_DATCNT_Msk (0xfffful << HSUSBD_CEPDATCNT_DATCNT_Pos) /*!< HSUSBD_T::CEPDATCNT: DATCNT Mask */ - -#define HSUSBD_SETUP1_0_SETUP0_Pos (0) /*!< HSUSBD_T::SETUP1_0: SETUP0 Position */ -#define HSUSBD_SETUP1_0_SETUP0_Msk (0xfful << HSUSBD_SETUP1_0_SETUP0_Pos) /*!< HSUSBD_T::SETUP1_0: SETUP0 Mask */ - -#define HSUSBD_SETUP1_0_SETUP1_Pos (8) /*!< HSUSBD_T::SETUP1_0: SETUP1 Position */ -#define HSUSBD_SETUP1_0_SETUP1_Msk (0xfful << HSUSBD_SETUP1_0_SETUP1_Pos) /*!< HSUSBD_T::SETUP1_0: SETUP1 Mask */ - -#define HSUSBD_SETUP3_2_SETUP2_Pos (0) /*!< HSUSBD_T::SETUP3_2: SETUP2 Position */ -#define HSUSBD_SETUP3_2_SETUP2_Msk (0xfful << HSUSBD_SETUP3_2_SETUP2_Pos) /*!< HSUSBD_T::SETUP3_2: SETUP2 Mask */ - -#define HSUSBD_SETUP3_2_SETUP3_Pos (8) /*!< HSUSBD_T::SETUP3_2: SETUP3 Position */ -#define HSUSBD_SETUP3_2_SETUP3_Msk (0xfful << HSUSBD_SETUP3_2_SETUP3_Pos) /*!< HSUSBD_T::SETUP3_2: SETUP3 Mask */ - -#define HSUSBD_SETUP5_4_SETUP4_Pos (0) /*!< HSUSBD_T::SETUP5_4: SETUP4 Position */ -#define HSUSBD_SETUP5_4_SETUP4_Msk (0xfful << HSUSBD_SETUP5_4_SETUP4_Pos) /*!< HSUSBD_T::SETUP5_4: SETUP4 Mask */ - -#define HSUSBD_SETUP5_4_SETUP5_Pos (8) /*!< HSUSBD_T::SETUP5_4: SETUP5 Position */ -#define HSUSBD_SETUP5_4_SETUP5_Msk (0xfful << HSUSBD_SETUP5_4_SETUP5_Pos) /*!< HSUSBD_T::SETUP5_4: SETUP5 Mask */ - -#define HSUSBD_SETUP7_6_SETUP6_Pos (0) /*!< HSUSBD_T::SETUP7_6: SETUP6 Position */ -#define HSUSBD_SETUP7_6_SETUP6_Msk (0xfful << HSUSBD_SETUP7_6_SETUP6_Pos) /*!< HSUSBD_T::SETUP7_6: SETUP6 Mask */ - -#define HSUSBD_SETUP7_6_SETUP7_Pos (8) /*!< HSUSBD_T::SETUP7_6: SETUP7 Position */ -#define HSUSBD_SETUP7_6_SETUP7_Msk (0xfful << HSUSBD_SETUP7_6_SETUP7_Pos) /*!< HSUSBD_T::SETUP7_6: SETUP7 Mask */ - -#define HSUSBD_CEPBUFST_SADDR_Pos (0) /*!< HSUSBD_T::CEPBUFST: SADDR Position */ -#define HSUSBD_CEPBUFST_SADDR_Msk (0xffful << HSUSBD_CEPBUFST_SADDR_Pos) /*!< HSUSBD_T::CEPBUFST: SADDR Mask */ - -#define HSUSBD_CEPBUFEND_EADDR_Pos (0) /*!< HSUSBD_T::CEPBUFEND: EADDR Position */ -#define HSUSBD_CEPBUFEND_EADDR_Msk (0xffful << HSUSBD_CEPBUFEND_EADDR_Pos) /*!< HSUSBD_T::CEPBUFEND: EADDR Mask */ - -#define HSUSBD_DMACTL_EPNUM_Pos (0) /*!< HSUSBD_T::DMACTL: EPNUM Position */ -#define HSUSBD_DMACTL_EPNUM_Msk (0xful << HSUSBD_DMACTL_EPNUM_Pos) /*!< HSUSBD_T::DMACTL: EPNUM Mask */ - -#define HSUSBD_DMACTL_DMARD_Pos (4) /*!< HSUSBD_T::DMACTL: DMARD Position */ -#define HSUSBD_DMACTL_DMARD_Msk (0x1ul << HSUSBD_DMACTL_DMARD_Pos) /*!< HSUSBD_T::DMACTL: DMARD Mask */ - -#define HSUSBD_DMACTL_DMAEN_Pos (5) /*!< HSUSBD_T::DMACTL: DMAEN Position */ -#define HSUSBD_DMACTL_DMAEN_Msk (0x1ul << HSUSBD_DMACTL_DMAEN_Pos) /*!< HSUSBD_T::DMACTL: DMAEN Mask */ - -#define HSUSBD_DMACTL_SGEN_Pos (6) /*!< HSUSBD_T::DMACTL: SGEN Position */ -#define HSUSBD_DMACTL_SGEN_Msk (0x1ul << HSUSBD_DMACTL_SGEN_Pos) /*!< HSUSBD_T::DMACTL: SGEN Mask */ - -#define HSUSBD_DMACTL_DMARST_Pos (7) /*!< HSUSBD_T::DMACTL: DMARST Position */ -#define HSUSBD_DMACTL_DMARST_Msk (0x1ul << HSUSBD_DMACTL_DMARST_Pos) /*!< HSUSBD_T::DMACTL: DMARST Mask */ - -#define HSUSBD_DMACTL_SVINEP_Pos (8) /*!< HSUSBD_T::DMACTL: SVINEP Position */ -#define HSUSBD_DMACTL_SVINEP_Msk (0x1ul << HSUSBD_DMACTL_SVINEP_Pos) /*!< HSUSBD_T::DMACTL: SVINEP Mask */ - -#define HSUSBD_DMACNT_DMACNT_Pos (0) /*!< HSUSBD_T::DMACNT: DMACNT Position */ -#define HSUSBD_DMACNT_DMACNT_Msk (0xffffful << HSUSBD_DMACNT_DMACNT_Pos) /*!< HSUSBD_T::DMACNT: DMACNT Mask */ - -#define HSUSBD_EPDAT_EPDAT_Pos (0) /*!< HSUSBD_T::EPDAT: EPDAT Position */ -#define HSUSBD_EPDAT_EPDAT_Msk (0xfffffffful << HSUSBD_EPDAT_EPDAT_Pos) /*!< HSUSBD_T::EPDAT: EPDAT Mask */ - -#define HSUSBD_EPINTSTS_BUFFULLIF_Pos (0) /*!< HSUSBD_T::EPINTSTS: BUFFULLIF Position */ -#define HSUSBD_EPINTSTS_BUFFULLIF_Msk (0x1ul << HSUSBD_EPINTSTS_BUFFULLIF_Pos) /*!< HSUSBD_T::EPINTSTS: BUFFULLIF Mask */ - -#define HSUSBD_EPINTSTS_BUFEMPTYIF_Pos (1) /*!< HSUSBD_T::EPINTSTS: BUFEMPTYIF Position*/ -#define HSUSBD_EPINTSTS_BUFEMPTYIF_Msk (0x1ul << HSUSBD_EPINTSTS_BUFEMPTYIF_Pos) /*!< HSUSBD_T::EPINTSTS: BUFEMPTYIF Mask */ - -#define HSUSBD_EPINTSTS_SHORTTXIF_Pos (2) /*!< HSUSBD_T::EPINTSTS: SHORTTXIF Position */ -#define HSUSBD_EPINTSTS_SHORTTXIF_Msk (0x1ul << HSUSBD_EPINTSTS_SHORTTXIF_Pos) /*!< HSUSBD_T::EPINTSTS: SHORTTXIF Mask */ - -#define HSUSBD_EPINTSTS_TXPKIF_Pos (3) /*!< HSUSBD_T::EPINTSTS: TXPKIF Position */ -#define HSUSBD_EPINTSTS_TXPKIF_Msk (0x1ul << HSUSBD_EPINTSTS_TXPKIF_Pos) /*!< HSUSBD_T::EPINTSTS: TXPKIF Mask */ - -#define HSUSBD_EPINTSTS_RXPKIF_Pos (4) /*!< HSUSBD_T::EPINTSTS: RXPKIF Position */ -#define HSUSBD_EPINTSTS_RXPKIF_Msk (0x1ul << HSUSBD_EPINTSTS_RXPKIF_Pos) /*!< HSUSBD_T::EPINTSTS: RXPKIF Mask */ - -#define HSUSBD_EPINTSTS_OUTTKIF_Pos (5) /*!< HSUSBD_T::EPINTSTS: OUTTKIF Position */ -#define HSUSBD_EPINTSTS_OUTTKIF_Msk (0x1ul << HSUSBD_EPINTSTS_OUTTKIF_Pos) /*!< HSUSBD_T::EPINTSTS: OUTTKIF Mask */ - -#define HSUSBD_EPINTSTS_INTKIF_Pos (6) /*!< HSUSBD_T::EPINTSTS: INTKIF Position */ -#define HSUSBD_EPINTSTS_INTKIF_Msk (0x1ul << HSUSBD_EPINTSTS_INTKIF_Pos) /*!< HSUSBD_T::EPINTSTS: INTKIF Mask */ - -#define HSUSBD_EPINTSTS_PINGIF_Pos (7) /*!< HSUSBD_T::EPINTSTS: PINGIF Position */ -#define HSUSBD_EPINTSTS_PINGIF_Msk (0x1ul << HSUSBD_EPINTSTS_PINGIF_Pos) /*!< HSUSBD_T::EPINTSTS: PINGIF Mask */ - -#define HSUSBD_EPINTSTS_NAKIF_Pos (8) /*!< HSUSBD_T::EPINTSTS: NAKIF Position */ -#define HSUSBD_EPINTSTS_NAKIF_Msk (0x1ul << HSUSBD_EPINTSTS_NAKIF_Pos) /*!< HSUSBD_T::EPINTSTS: NAKIF Mask */ - -#define HSUSBD_EPINTSTS_STALLIF_Pos (9) /*!< HSUSBD_T::EPINTSTS: STALLIF Position */ -#define HSUSBD_EPINTSTS_STALLIF_Msk (0x1ul << HSUSBD_EPINTSTS_STALLIF_Pos) /*!< HSUSBD_T::EPINTSTS: STALLIF Mask */ - -#define HSUSBD_EPINTSTS_NYETIF_Pos (10) /*!< HSUSBD_T::EPINTSTS: NYETIF Position */ -#define HSUSBD_EPINTSTS_NYETIF_Msk (0x1ul << HSUSBD_EPINTSTS_NYETIF_Pos) /*!< HSUSBD_T::EPINTSTS: NYETIF Mask */ - -#define HSUSBD_EPINTSTS_ERRIF_Pos (11) /*!< HSUSBD_T::EPINTSTS: ERRIF Position */ -#define HSUSBD_EPINTSTS_ERRIF_Msk (0x1ul << HSUSBD_EPINTSTS_ERRIF_Pos) /*!< HSUSBD_T::EPINTSTS: ERRIF Mask */ - -#define HSUSBD_EPINTSTS_SHORTRXIF_Pos (12) /*!< HSUSBD_T::EPINTSTS: SHORTRXIF Position */ -#define HSUSBD_EPINTSTS_SHORTRXIF_Msk (0x1ul << HSUSBD_EPINTSTS_SHORTRXIF_Pos) /*!< HSUSBD_T::EPINTSTS: SHORTRXIF Mask */ - -#define HSUSBD_EPINTEN_BUFFULLIEN_Pos (0) /*!< HSUSBD_T::EPINTEN: BUFFULLIEN Position */ -#define HSUSBD_EPINTEN_BUFFULLIEN_Msk (0x1ul << HSUSBD_EPINTEN_BUFFULLIEN_Pos) /*!< HSUSBD_T::EPINTEN: BUFFULLIEN Mask */ - -#define HSUSBD_EPINTEN_BUFEMPTYIEN_Pos (1) /*!< HSUSBD_T::EPINTEN: BUFEMPTYIEN Position*/ -#define HSUSBD_EPINTEN_BUFEMPTYIEN_Msk (0x1ul << HSUSBD_EPINTEN_BUFEMPTYIEN_Pos) /*!< HSUSBD_T::EPINTEN: BUFEMPTYIEN Mask */ - -#define HSUSBD_EPINTEN_SHORTTXIEN_Pos (2) /*!< HSUSBD_T::EPINTEN: SHORTTXIEN Position */ -#define HSUSBD_EPINTEN_SHORTTXIEN_Msk (0x1ul << HSUSBD_EPINTEN_SHORTTXIEN_Pos) /*!< HSUSBD_T::EPINTEN: SHORTTXIEN Mask */ - -#define HSUSBD_EPINTEN_TXPKIEN_Pos (3) /*!< HSUSBD_T::EPINTEN: TXPKIEN Position */ -#define HSUSBD_EPINTEN_TXPKIEN_Msk (0x1ul << HSUSBD_EPINTEN_TXPKIEN_Pos) /*!< HSUSBD_T::EPINTEN: TXPKIEN Mask */ - -#define HSUSBD_EPINTEN_RXPKIEN_Pos (4) /*!< HSUSBD_T::EPINTEN: RXPKIEN Position */ -#define HSUSBD_EPINTEN_RXPKIEN_Msk (0x1ul << HSUSBD_EPINTEN_RXPKIEN_Pos) /*!< HSUSBD_T::EPINTEN: RXPKIEN Mask */ - -#define HSUSBD_EPINTEN_OUTTKIEN_Pos (5) /*!< HSUSBD_T::EPINTEN: OUTTKIEN Position */ -#define HSUSBD_EPINTEN_OUTTKIEN_Msk (0x1ul << HSUSBD_EPINTEN_OUTTKIEN_Pos) /*!< HSUSBD_T::EPINTEN: OUTTKIEN Mask */ - -#define HSUSBD_EPINTEN_INTKIEN_Pos (6) /*!< HSUSBD_T::EPINTEN: INTKIEN Position */ -#define HSUSBD_EPINTEN_INTKIEN_Msk (0x1ul << HSUSBD_EPINTEN_INTKIEN_Pos) /*!< HSUSBD_T::EPINTEN: INTKIEN Mask */ - -#define HSUSBD_EPINTEN_PINGIEN_Pos (7) /*!< HSUSBD_T::EPINTEN: PINGIEN Position */ -#define HSUSBD_EPINTEN_PINGIEN_Msk (0x1ul << HSUSBD_EPINTEN_PINGIEN_Pos) /*!< HSUSBD_T::EPINTEN: PINGIEN Mask */ - -#define HSUSBD_EPINTEN_NAKIEN_Pos (8) /*!< HSUSBD_T::EPINTEN: NAKIEN Position */ -#define HSUSBD_EPINTEN_NAKIEN_Msk (0x1ul << HSUSBD_EPINTEN_NAKIEN_Pos) /*!< HSUSBD_T::EPINTEN: NAKIEN Mask */ - -#define HSUSBD_EPINTEN_STALLIEN_Pos (9) /*!< HSUSBD_T::EPINTEN: STALLIEN Position */ -#define HSUSBD_EPINTEN_STALLIEN_Msk (0x1ul << HSUSBD_EPINTEN_STALLIEN_Pos) /*!< HSUSBD_T::EPINTEN: STALLIEN Mask */ - -#define HSUSBD_EPINTEN_NYETIEN_Pos (10) /*!< HSUSBD_T::EPINTEN: NYETIEN Position */ -#define HSUSBD_EPINTEN_NYETIEN_Msk (0x1ul << HSUSBD_EPINTEN_NYETIEN_Pos) /*!< HSUSBD_T::EPINTEN: NYETIEN Mask */ - -#define HSUSBD_EPINTEN_ERRIEN_Pos (11) /*!< HSUSBD_T::EPINTEN: ERRIEN Position */ -#define HSUSBD_EPINTEN_ERRIEN_Msk (0x1ul << HSUSBD_EPINTEN_ERRIEN_Pos) /*!< HSUSBD_T::EPINTEN: ERRIEN Mask */ - -#define HSUSBD_EPINTEN_SHORTRXIEN_Pos (12) /*!< HSUSBD_T::EPINTEN: SHORTRXIEN Position */ -#define HSUSBD_EPINTEN_SHORTRXIEN_Msk (0x1ul << HSUSBD_EPINTEN_SHORTRXIEN_Pos) /*!< HSUSBD_T::EPINTEN: SHORTRXIEN Mask */ - -#define HSUSBD_EPDATCNT_DATCNT_Pos (0) /*!< HSUSBD_T::EPDATCNT: DATCNT Position */ -#define HSUSBD_EPDATCNT_DATCNT_Msk (0xfffful << HSUSBD_EPDATCNT_DATCNT_Pos) /*!< HSUSBD_T::EPDATCNT: DATCNT Mask */ - -#define HSUSBD_EPDATCNT_DMALOOP_Pos (16) /*!< HSUSBD_T::EPDATCNT: DMALOOP Position */ -#define HSUSBD_EPDATCNT_DMALOOP_Msk (0x7ffful << HSUSBD_EPDATCNT_DMALOOP_Pos) /*!< HSUSBD_T::EPDATCNT: DMALOOP Mask */ - -#define HSUSBD_EPRSPCTL_FLUSH_Pos (0) /*!< HSUSBD_T::EPRSPCTL: FLUSH Position */ -#define HSUSBD_EPRSPCTL_FLUSH_Msk (0x1ul << HSUSBD_EPRSPCTL_FLUSH_Pos) /*!< HSUSBD_T::EPRSPCTL: FLUSH Mask */ - -#define HSUSBD_EPRSPCTL_MODE_Pos (1) /*!< HSUSBD_T::EPRSPCTL: MODE Position */ -#define HSUSBD_EPRSPCTL_MODE_Msk (0x3ul << HSUSBD_EPRSPCTL_MODE_Pos) /*!< HSUSBD_T::EPRSPCTL: MODE Mask */ - -#define HSUSBD_EPRSPCTL_TOGGLE_Pos (3) /*!< HSUSBD_T::EPRSPCTL: TOGGLE Position */ -#define HSUSBD_EPRSPCTL_TOGGLE_Msk (0x1ul << HSUSBD_EPRSPCTL_TOGGLE_Pos) /*!< HSUSBD_T::EPRSPCTL: TOGGLE Mask */ - -#define HSUSBD_EPRSPCTL_HALT_Pos (4) /*!< HSUSBD_T::EPRSPCTL: HALT Position */ -#define HSUSBD_EPRSPCTL_HALT_Msk (0x1ul << HSUSBD_EPRSPCTL_HALT_Pos) /*!< HSUSBD_T::EPRSPCTL: HALT Mask */ - -#define HSUSBD_EPRSPCTL_ZEROLEN_Pos (5) /*!< HSUSBD_T::EPRSPCTL: ZEROLEN Position */ -#define HSUSBD_EPRSPCTL_ZEROLEN_Msk (0x1ul << HSUSBD_EPRSPCTL_ZEROLEN_Pos) /*!< HSUSBD_T::EPRSPCTL: ZEROLEN Mask */ - -#define HSUSBD_EPRSPCTL_SHORTTXEN_Pos (6) /*!< HSUSBD_T::EPRSPCTL: SHORTTXEN Position */ -#define HSUSBD_EPRSPCTL_SHORTTXEN_Msk (0x1ul << HSUSBD_EPRSPCTL_SHORTTXEN_Pos) /*!< HSUSBD_T::EPRSPCTL: SHORTTXEN Mask */ - -#define HSUSBD_EPRSPCTL_DISBUF_Pos (7) /*!< HSUSBD_T::EPRSPCTL: DISBUF Position */ -#define HSUSBD_EPRSPCTL_DISBUF_Msk (0x1ul << HSUSBD_EPRSPCTL_DISBUF_Pos) /*!< HSUSBD_T::EPRSPCTL: DISBUF Mask */ - -#define HSUSBD_EPMPS_EPMPS_Pos (0) /*!< HSUSBD_T::EPMPS: EPMPS Position */ -#define HSUSBD_EPMPS_EPMPS_Msk (0x7fful << HSUSBD_EPMPS_EPMPS_Pos) /*!< HSUSBD_T::EPMPS: EPMPS Mask */ - -#define HSUSBD_EPTXCNT_TXCNT_Pos (0) /*!< HSUSBD_T::EPTXCNT: TXCNT Position */ -#define HSUSBD_EPTXCNT_TXCNT_Msk (0x7fful << HSUSBD_EPTXCNT_TXCNT_Pos) /*!< HSUSBD_T::EPTXCNT: TXCNT Mask */ - -#define HSUSBD_EPCFG_EPEN_Pos (0) /*!< HSUSBD_T::EPCFG: EPEN Position */ -#define HSUSBD_EPCFG_EPEN_Msk (0x1ul << HSUSBD_EPCFG_EPEN_Pos) /*!< HSUSBD_T::EPCFG: EPEN Mask */ - -#define HSUSBD_EPCFG_EPTYPE_Pos (1) /*!< HSUSBD_T::EPCFG: EPTYPE Position */ -#define HSUSBD_EPCFG_EPTYPE_Msk (0x3ul << HSUSBD_EPCFG_EPTYPE_Pos) /*!< HSUSBD_T::EPCFG: EPTYPE Mask */ - -#define HSUSBD_EPCFG_EPDIR_Pos (3) /*!< HSUSBD_T::EPCFG: EPDIR Position */ -#define HSUSBD_EPCFG_EPDIR_Msk (0x1ul << HSUSBD_EPCFG_EPDIR_Pos) /*!< HSUSBD_T::EPCFG: EPDIR Mask */ - -#define HSUSBD_EPCFG_EPNUM_Pos (4) /*!< HSUSBD_T::EPCFG: EPNUM Position */ -#define HSUSBD_EPCFG_EPNUM_Msk (0xful << HSUSBD_EPCFG_EPNUM_Pos) /*!< HSUSBD_T::EPCFG: EPNUM Mask */ - -#define HSUSBD_EPBUFST_SADDR_Pos (0) /*!< HSUSBD_T::EPBUFST: SADDR Position */ -#define HSUSBD_EPBUFST_SADDR_Msk (0xffful << HSUSBD_EPBUFST_SADDR_Pos) /*!< HSUSBD_T::EPBUFST: SADDR Mask */ - -#define HSUSBD_EPBUFEND_EADDR_Pos (0) /*!< HSUSBD_T::EPBUFEND: EADDR Position */ -#define HSUSBD_EPBUFEND_EADDR_Msk (0xffful << HSUSBD_EPBUFEND_EADDR_Pos) /*!< HSUSBD_T::EPBUFEND: EADDR Mask */ - -#define HSUSBD_BCDC_BCDEN_Pos (0) /*!< HSUSBD_T::BCDC: BCDEN Position */ -#define HSUSBD_BCDC_BCDEN_Msk (0x1ul << HSUSBD_BCDC_BCDEN_Pos) /*!< HSUSBD_T::BCDC: BCDEN Mask */ - -#define HSUSBD_BCDC_DETMOD_Pos (1) /*!< HSUSBD_T::BCDC: DETMOD Position */ -#define HSUSBD_BCDC_DETMOD_Msk (0x7ul << HSUSBD_BCDC_DETMOD_Pos) /*!< HSUSBD_T::BCDC: DETMOD Mask */ - -#define HSUSBD_BCDC_DETSTS_Pos (4) /*!< HSUSBD_T::BCDC: DETSTS Position */ -#define HSUSBD_BCDC_DETSTS_Msk (0x1ul << HSUSBD_BCDC_DETSTS_Pos) /*!< HSUSBD_T::BCDC: DETSTS Mask */ - -#define HSUSBD_BCDC_USP_Pos (5) /*!< HSUSBD_T::BCDC: USP Position */ -#define HSUSBD_BCDC_USP_Msk (0x1ul << HSUSBD_BCDC_USP_Pos) /*!< HSUSBD_T::BCDC: USP Mask */ - -#define HSUSBD_BCDC_BCDIEN_Pos (30) /*!< HSUSBD_T::BCDC: BCDIEN Position */ -#define HSUSBD_BCDC_BCDIEN_Msk (0x1ul << HSUSBD_BCDC_BCDIEN_Pos) /*!< HSUSBD_T::BCDC: BCDIEN Mask */ - -#define HSUSBD_BCDC_BCDIF_Pos (31) /*!< HSUSBD_T::BCDC: BCDIF Position */ -#define HSUSBD_BCDC_BCDIF_Msk (0x1ul << HSUSBD_BCDC_BCDIF_Pos) /*!< HSUSBD_T::BCDC: BCDIF Mask */ - -#define HSUSBD_LPMCSR_LPMEN_Pos (12) /*!< HSUSBD_T::LPMCSR: LPMEN Position */ -#define HSUSBD_LPMCSR_LPMEN_Msk (0x1ul << HSUSBD_LPMCSR_LPMEN_Pos) /*!< HSUSBD_T::LPMCSR: LPMEN Mask */ - -#define HSUSBD_LPMCSR_LPMSLEEPEN_Pos (13) /*!< HSUSBD_T::LPMCSR: LPMSLEEPEN Position */ -#define HSUSBD_LPMCSR_LPMSLEEPEN_Msk (0x1ul << HSUSBD_LPMCSR_LPMSLEEPEN_Pos) /*!< HSUSBD_T::LPMCSR: LPMSLEEPEN Mask */ - -#define HSUSBD_LPMCSR_LPMSENDNYET_Pos (14) /*!< HSUSBD_T::LPMCSR: LPMSENDNYET Position */ -#define HSUSBD_LPMCSR_LPMSENDNYET_Msk (0x1ul << HSUSBD_LPMCSR_LPMSENDNYET_Pos) /*!< HSUSBD_T::LPMCSR: LPMSENDNYET Mask */ - -#define HSUSBD_DMAADDR_DMAADDR_Pos (0) /*!< HSUSBD_T::DMAADDR: DMAADDR Position */ -#define HSUSBD_DMAADDR_DMAADDR_Msk (0xfffffffful << HSUSBD_DMAADDR_DMAADDR_Pos) /*!< HSUSBD_T::DMAADDR: DMAADDR Mask */ - -#define HSUSBD_PHYCTL_DPPUEN_Pos (8) /*!< HSUSBD_T::PHYCTL: DPPUEN Position */ -#define HSUSBD_PHYCTL_DPPUEN_Msk (0x1ul << HSUSBD_PHYCTL_DPPUEN_Pos) /*!< HSUSBD_T::PHYCTL: DPPUEN Mask */ - -#define HSUSBD_PHYCTL_PHYEN_Pos (9) /*!< HSUSBD_T::PHYCTL: PHYEN Position */ -#define HSUSBD_PHYCTL_PHYEN_Msk (0x1ul << HSUSBD_PHYCTL_PHYEN_Pos) /*!< HSUSBD_T::PHYCTL: PHYEN Mask */ - -#define HSUSBD_PHYCTL_VBUSWKEN_Pos (24) /*!< HSUSBD_T::PHYCTL: VBUSWKEN Position */ -#define HSUSBD_PHYCTL_VBUSWKEN_Msk (0x1ul << HSUSBD_PHYCTL_VBUSWKEN_Pos) /*!< HSUSBD_T::PHYCTL: VBUSWKEN Mask */ - -#define HSUSBD_PHYCTL_LINESTATEWKEN_Pos (25) /*!< HSUSBD_T::PHYCTL: LINESTATEWKEN Position*/ -#define HSUSBD_PHYCTL_LINESTATEWKEN_Msk (0x1ul << HSUSBD_PHYCTL_LINESTATEWKEN_Pos) /*!< HSUSBD_T::PHYCTL: LINESTATEWKEN Mask */ - -#define HSUSBD_PHYCTL_STALLREVERT_Pos (26) /*!< HSUSBD_T::PHYCTL: STALLREVERT Position */ -#define HSUSBD_PHYCTL_STALLREVERT_Msk (0x1ul << HSUSBD_PHYCTL_STALLREVERT_Pos) /*!< HSUSBD_T::PHYCTL: STALLREVERT Mask */ - -#define HSUSBD_PHYCTL_PHYCLKSTB_Pos (27) /*!< HSUSBD_T::PHYCTL: PHYCLKSTB Position */ -#define HSUSBD_PHYCTL_PHYCLKSTB_Msk (0x1ul << HSUSBD_PHYCTL_PHYCLKSTB_Pos) /*!< HSUSBD_T::PHYCTL: PHYCLKSTB Mask */ - -#define HSUSBD_PHYCTL_VBUSDET_Pos (31) /*!< HSUSBD_T::PHYCTL: VBUSDET Position */ -#define HSUSBD_PHYCTL_VBUSDET_Msk (0x1ul << HSUSBD_PHYCTL_VBUSDET_Pos) /*!< HSUSBD_T::PHYCTL: VBUSDET Mask */ - -/**@}*/ /* HSUSBD_CONST */ -/**@}*/ /* end of HSUSBD register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __HSUSBD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbh_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbh_reg.h deleted file mode 100644 index 35ac3595d88..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/hsusbh_reg.h +++ /dev/null @@ -1,653 +0,0 @@ -/**************************************************************************//** - * @file hsusbh_reg.h - * @version V1.00 - * @brief HSUSBH register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HSUSBH_REG_H__ -#define __HSUSBH_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup HSUSBH High Speed USB Host Controller (HSUSBH) - Memory Mapped Structure for HSUSBH Controller -@{ */ - -typedef struct -{ - - - /** - * @var HSUSBH_T::EHCVNR - * Offset: 0x00 EHCI Version Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CRLEN |Capability Registers Length - * | | |This register is used as an offset to add to register base to find the beginning of the Operational Register Space. - * |[31:16] |VERSION |Host Controller Interface Version Number - * | | |This is a two-byte register containing a BCD encoding of the EHCI revision number supported by this host controller - * | | |The most significant byte of this register represents a major revision and the least significant byte is the minor revision. - * @var HSUSBH_T::EHCSPR - * Offset: 0x04 EHCI Structural Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |N_PORTS |Number of Physical Downstream Ports - * | | |This field specifies the number of physical downstream ports implemented on this host controller - * | | |The value of this field determines how many port registers are addressable in the Operational Register Space (see Table 2-8) - * | | |Valid values are in the range of 1H to FH. - * | | |A zero in this field is undefined. - * |[4] |PPC |Port Power Control - * | | |This field indicates whether the host controller implementation includes port power control - * | | |A one in this bit indicates the ports have port power switches - * | | |A zero in this bit indicates the port do not have port power stitches - * | | |The value of this field affects the functionality of the Port Power field in each port status and control register. - * |[11:8] |N_PCC |Number of Ports Per Companion Controller - * | | |This field indicates the number of ports supported per companion host controller - * | | |It is used to indicate the port routing configuration to system software. - * | | |For example, if N_PORTS has a value of 6 and N_CC has a value of 2 then N_PCC could have a value of 3 - * | | |The convention is that the first N_PCC ports are assumed to be routed to companion controller 1, the next N_PCC ports to companion controller 2, etc - * | | |In the previous example, the N_PCC could have been 4, where the first 4 are routed to companion controller 1 and the last two are routed to companion controller 2. - * | | |The number in this field must be consistent with N_PORTS and N_CC. - * |[15:12] |N_CC |Number of Companion Controller - * | | |This field indicates the number of companion controllers associated with this USB 2.0 host controller. - * | | |A zero in this field indicates there are no companion host controllers - * | | |Port-ownership hand-off is not supported - * | | |Only high-speed devices are supported on the host controller root ports. - * | | |A value larger than zero in this field indicates there are companion USB 1.1 host controller(s) - * | | |Port-ownership hand-offs are supported - * | | |High, Full- and Low-speed devices are supported on the host controller root ports. - * @var HSUSBH_T::EHCCPR - * Offset: 0x08 EHCI Capability Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AC64 |64-bit Addressing Capability - * | | |0 = Data structure using 32-bit address memory pointers. - * |[1] |PFLF |Programmable Frame List Flag - * | | |0 = System software must use a frame list length of 1024 elements with this EHCI host controller. - * |[2] |ASPC |Asynchronous Schedule Park Capability - * | | |0 = This EHCI host controller doesn't support park feature of high-speed queue heads in the Asynchronous Schedule. - * |[7:4] |IST |Isochronous Scheduling Threshold - * | | |This field indicates, relative to the current position of the executing host controller, where software can reliably update the isochronous schedule. - * | | |When bit [7] is zero, the value of the least significant 3 bits indicates the number of micro-frames a host controller can hold a set of isochronous data structures (one or more) before flushing the state. - * |[15:8] |EECP |EHCI Extended Capabilities Pointer (EECP) - * | | |0 = No extended capabilities are implemented. - * @var HSUSBH_T::UCMDR - * Offset: 0x20 USB Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RUN |Run/Stop (R/W) - * | | |When set to a 1, the Host Controller proceeds with execution of the schedule - * | | |The Host Controller continues execution as long as this bit is set to a 1 - * | | |When this bit is set to 0, the Host Controller completes the current and any actively pipelined transactions on the USB and then halts - * | | |The Host Controller must halt within 16 micro-frames after software clears the Run bit - * | | |The HC Halted bit in the status register indicates when the Host Controller has finished its pending pipelined transactions and has entered the stopped state - * | | |Software must not write a one to this field unless the host controller is in the Halted state (i.e. - * | | |HCHalted in the USBSTS register is a one) - * | | |Doing so will yield undefined results. - * | | |0 = Stop. - * | | |1 = Run. - * |[1] |HCRST |Host Controller Reset (HCRESET) (R/W) - * | | |This control bit is used by software to reset the host controller - * | | |The effects of this on Root Hub registers are similar to a Chip Hardware Reset. - * | | |When software writes a one to this bit, the Host Controller resets its internal pipelines, timers, counters, state machines, etc - * | | |to their initial value - * | | |Any transaction currently in progress on USB is immediately terminated - * | | |A USB reset is not driven on downstream ports. - * | | |All operational registers, including port registers and port state machines are set to their initial values - * | | |Port ownership reverts to the companion host controller(s), with the side effects - * | | |Software must reinitialize the host controller in order to return the host controller to an operational state. - * | | |This bit is set to zero by the Host Controller when the reset process is complete - * | | |Software cannot terminate the reset process early by writing a zero to this register. - * | | |Software should not set this bit to a one when the HCHalted bit in the USBSTS register is a zero - * | | |Attempting to reset an actively running host controller will result in undefined behavior. - * |[3:2] |FLSZ |Frame List Size (R/W or RO) - * | | |This field is R/W only if Programmable Frame List Flag in the HCCPARAMS registers is set to a one - * | | |This field specifies the size of the frame list - * | | |The size the frame list controls which bits in the Frame Index Register should be used for the Frame List Current index - * | | |Values mean: - * | | |00 = 1024 elements (4096 bytes) Default value. - * | | |01 = 512 elements (2048 bytes). - * | | |10 = 256 elements (1024 bytes) u2013 for resource-constrained environment. - * | | |11 = Reserved. - * |[4] |PSEN |Periodic Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Periodic Schedule. Values mean: - * | | |0 = Do not process the Periodic Schedule. - * | | |1 = Use the PERIODICLISTBASE register to access the Periodic Schedule. - * |[5] |ASEN |Asynchronous Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Asynchronous Schedule. Values mean: - * | | |0 = Do not process the Asynchronous Schedule. - * | | |1 = Use the ASYNCLISTADDR register to access the Asynchronous Schedule. - * |[6] |IAAD |Interrupt on Asynchronous Advance Doorbell (R/W) - * | | |This bit is used as a doorbell by software to tell the host controller to issue an interrupt the next time it advances asynchronous schedule - * | | |Software must write a 1 to this bit to ring the doorbell. - * | | |When the host controller has evicted all appropriate cached schedule state, it sets the Interrupt on Asynchronous Advance status bit in the USBSTS register - * | | |If the Interrupt on Asynchronous Advance Enable bit in the USBINTR register is a one then the host controller will assert an interrupt at the next interrupt threshold. - * | | |The host controller sets this bit to a zero after it has set the Interrupt on Asynchronous Advance status bit in the USBSTS register to a one. - * | | |Software should not write a one to this bit when the asynchronous schedule is disabled - * | | |Doing so will yield undefined results. - * |[23:16] |ITC |Interrupt Threshold Control (R/W) - * | | |This field is used by system software to select the maximum rate at which the host controller will issue interrupts - * | | |The only valid values are defined below - * | | |If software writes an invalid value to this register, the results are undefined - * | | |Value Maximum Interrupt Interval - * | | |0x00 = Reserved. - * | | |0x01 = 1 micro-frame. - * | | |0x02 = 2 micro-frames. - * | | |0x04 = 4 micro-frames. - * | | |0x08 = 8 micro-frames (default, equates to 1 ms). - * | | |0x10 = 16 micro-frames (2 ms). - * | | |0x20 = 32 micro-frames (4 ms). - * | | |0x40 = 64 micro-frames (8 ms). - * | | |Any other value in this register yields undefined results. - * | | |Software modifications to this bit while HCHalted bit is equal to zero results in undefined behavior. - * @var HSUSBH_T::USTSR - * Offset: 0x24 USB Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBINT |USB Interrupt (USBINT) (R/WC) - * | | |The Host Controller sets this bit to 1 on the completion of a USB transaction, which results in the retirement of a Transfer Descriptor that had its IOC bit set. - * | | |The Host Controller also sets this bit to 1 when a short packet is detected (actual number of bytes received was less than the expected number of bytes). - * |[1] |UERRINT |USB Error Interrupt (USBERRINT) (R/WC) - * | | |The Host Controller sets this bit to 1 when completion of a USB transaction results in an error condition (e.g., error counter underflow) - * | | |If the TD on which the error interrupt occurred also had its IOC bit set, both this bit and USBINT bit are set. - * |[2] |PCD |Port Change Detect (R/WC) - * | | |The Host Controller sets this bit to a one when any port for which the Port Owner bit is set to zero has a change bit transition from a zero to a one or a Force Port Resume bit transition from a zero to a one as a result of a J-K transition detected on a suspended port - * | | |This bit will also be set as a result of the Connect Status Change being set to a one after system software has relinquished ownership of a connected port by writing a one to a port's Port Owner bit. - * | | |This bit is allowed to be maintained in the Auxiliary power well - * | | |Alternatively, it is also acceptable that on a D3 to D0 transition of the EHCI HC device, this bit is loaded with the OR of all of the PORTSC change bits (including: Force port resume, over-current change, enable/disable change and connect status change). - * |[3] |FLR |Frame List Rollover (R/WC) - * | | |The Host Controller sets this bit to a one when the Frame List Index rolls over from its maximum value to zero - * | | |The exact value at which the rollover occurs depends on the frame list size - * | | |For example, if the frame list size (as programmed in the Frame List Size field of the USBCMD register) is 1024, the Frame Index Register rolls over every time FRINDEX[13] toggles - * | | |Similarly, if the size is 512, the Host Controller sets this bit to a one every time FRINDEX[12] toggles. - * |[4] |HSERR |Host System Error (R/WC) - * | | |The Host Controller sets this bit to 1 when a serious error occurs during a host system access involving the Host Controller module. - * |[5] |IAA |Interrupt on Asynchronous Advance (R/WC) - * | | |System software can force the host controller to issue an interrupt the next time the host controller advances the asynchronous schedule by writing a one to the Interrupt on Asynchronous Advance Doorbell bit in the USBCMD register - * | | |This status bit indicates the assertion of that interrupt source. - * |[12] |HCHalted |HCHalted (RO) - * | | |This bit is a zero whenever the Run/Stop bit is a one - * | | |The Host Controller sets this bit to one after it has stopped executing as a result of the Run/Stop bit being set to 0, either by software or by the Host Controller hardware (e.g. - * | | |internal error). - * |[13] |RECLA |Reclamation (RO) - * | | |This is a read-only status bit, which is used to detect an empty asynchronous schedule. - * |[14] |PSS |Periodic Schedule Status (RO) - * | | |The bit reports the current real status of the Periodic Schedule - * | | |If this bit is a zero then the status of the Periodic Schedule is disabled - * | | |If this bit is a one then the status of the Periodic Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Periodic Schedule when software transitions the Periodic Schedule Enable bit in the USBCMD register - * | | |When this bit and the Periodic Schedule Enable bit are the same value, the Periodic Schedule is either enabled (1) or disabled (0). - * |[15] |ASS |Asynchronous Schedule Status (RO) - * | | |The bit reports the current real status of the Asynchronous Schedule - * | | |If this bit is a zero then the status of them Asynchronous Schedule is disabled - * | | |If this bit is a one then the status of the Asynchronous Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Asynchronous Schedule when software transitions the Asynchronous Schedule Enable bit in the USBCMD register - * | | |When this bit and the Asynchronous Schedule Enable bit are the same value, the Asynchronous Schedule is either enabled (1) or disabled (0). - * @var HSUSBH_T::UIENR - * Offset: 0x28 USB Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIEN |USB Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBINT bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBINT bit. - * | | |0 = USB interrupt Disabled. - * | | |1 = USB interrupt Enabled. - * |[1] |UERRIEN |USB Error Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBERRINT bit in the USBSTS register is a one, the host t controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBERRINT bit. - * | | |0 = USB Error interrupt Disabled. - * | | |1 = USB Error interrupt Enabled. - * |[2] |PCIEN |Port Change Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the Port Change Detect bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Port Change Detect bit. - * | | |0 = Port Change interrupt Disabled. - * | | |1 = Port Change interrupt Enabled. - * |[3] |FLREN |Frame List Rollover Enable or Disable Bit - * | | |When this bit is a one, and the Frame List Rollover bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Frame List Rollover bit. - * | | |0 = Frame List Rollover interrupt Disabled. - * | | |1 = Frame List Rollover interrupt Enabled. - * |[4] |HSERREN |Host System Error Enable or Disable Bit - * | | |When this bit is a one, and the Host System Error Status bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Host System Error bit. - * | | |0 = Host System Error interrupt Disabled. - * | | |1 = Host System Error interrupt Enabled. - * |[5] |IAAEN |Interrupt on Asynchronous Advance Enable or Disable Bit - * | | |When this bit is a one, and the Interrupt on Asynchronous Advance bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the Interrupt on Asynchronous Advance bit. - * | | |0 = Interrupt on Asynchronous Advance Disabled. - * | | |1 = Interrupt on Asynchronous Advance Enabled. - * @var HSUSBH_T::UFINDR - * Offset: 0x2C USB Frame Index Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Index - * | | |The value in this register increment at the end of each time frame (e.g. - * | | |micro-frame) - * | | |Bits [N:3] are used for the Frame List current index - * | | |This means that each location of the frame list is accessed 8 times (frames or micro-frames) before moving to the next index - * | | |The following illustrates values of N based on the value of the Frame List Size field in the USBCMD register. - * | | |FLSZ (UCMDR[3:2] Number Elements N - * | | |0x0 1024 12 - * | | |0x1 512 11 - * | | |0x2 256 10 - * | | |0x3 Reserved - * @var HSUSBH_T::UPFLBAR - * Offset: 0x34 USB Periodic Frame List Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |BADDR |Base Address - * | | |These bits correspond to memory address signals [31:12], respectively. - * @var HSUSBH_T::UCALAR - * Offset: 0x38 USB Current Asynchronous List Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:5] |LPL |Link Pointer Low (LPL) - * | | |These bits correspond to memory address signals [31:5], respectively - * | | |This field may only reference a Queue Head (QH). - * @var HSUSBH_T::UASSTR - * Offset: 0x3C USB Asynchronous Schedule Sleep Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ASSTMR |Asynchronous Schedule Sleep Timer - * | | |This field defines the AsyncSchedSleepTime of EHCI spec. - * | | |The asynchronous schedule sleep timer is used to control how often the host controller fetches asynchronous schedule list from system memory while the asynchronous schedule is empty. - * | | |The default value of this timer is 12'hBD6 - * | | |Because this timer is implemented in UTMI clock (30MHz) domain, the default sleeping time will be about 100us. - * @var HSUSBH_T::UCFGR - * Offset: 0x60 USB Configure Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CF |Configure Flag (CF) - * | | |Host software sets this bit as the last action in its process of configuring the Host Controller - * | | |This bit controls the default port-routing control logic - * | | |Bit values and side-effects are listed below. - * | | |0 = Port routing control logic default-routes each port to an implementation dependent classic host controller. - * | | |1 = Port routing control logic default-routes all ports to this host controller. - * @var HSUSBH_T::UPSCR[2] - * Offset: 0x64~0x68 USB Port 0~1 Status and Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |Current Connect Status (RO) - * | | |This value reflects the current state of the port, and may not correspond directly to the event that caused the Connect Status Change bit (Bit 1) to be set. - * | | |This field is zero if Port Power is zero. - * | | |0 = No device is present. - * | | |1 = Device is present on port. - * |[1] |CSC |Connect Status Change (R/W) - * | | |Indicates a change has occurred in the port's Current Connect Status - * | | |The host controller sets this bit for all changes to the port device connect status, even if system software has not cleared an existing connect status change - * | | |For example, the insertion status changes twice before system software has cleared the changed condition, hub hardware will be "setting" an already-set bit (i.e., the bit will remain set).Software sets this bit to 0 by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Change in Current Connect Status. - * |[2] |PE |Port Enabled/Disabled (R/W) - * | | |Ports can only be enabled by the host controller as a part of the reset and enable - * | | |Software cannot enable a port by writing a one to this field - * | | |The host controller will only set this bit to a one when the reset sequence determines that the attached device is a high-speed device. - * | | |Ports can be disabled by either a fault condition (disconnect event or other fault condition) or by host software - * | | |Note that the bit status does not change until the port state actually changes - * | | |There may be a delay in disabling or enabling a port due to other host controller and bus events. - * | | |When the port is disabled (0b) downstream propagation of data is blocked on this port, except for reset. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[3] |PEC |Port Enable/Disable Change (R/WC) - * | | |For the root hub, this bit gets set to a one only when a port is disabled due to the appropriate conditions existing at the EOF2 point (See Chapter 11 of the USB Specification for the definition of a Port Error) - * | | |Software clears this bit by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Port enabled/disabled status has changed. - * |[4] |OCA |Over-current Active (RO) - * | | |This bit will automatically transition from a one to a zero when the over current condition is removed. - * | | |0 = This port does not have an over-current condition. - * | | |1 = This port currently has an over-current condition. - * |[5] |OCC |Over-current Change (R/WC) - * | | |1 = This bit gets set to a one when there is a change to Over-current Active - * | | |Software clears this bit by writing a one to this bit position. - * |[6] |FPR |Force Port Resume (R/W) - * | | |This functionality defined for manipulating this bit depends on the value of the Suspend bit - * | | |For example, if the port is not suspended (Suspend and Enabled bits are a one) and software transitions this bit to a one, then the effects on the bus are undefined. - * | | |Software sets this bit to a 1 to drive resume signaling - * | | |The Host Controller sets this bit to a 1 if a J-to-K transition is detected while the port is in the Suspend state - * | | |When this bit transitions to a one because a J-to-K transition is detected, the Port Change Detect bit in the USBSTS register is also set to a one - * | | |If software sets this bit to a one, the host controller must not set the Port Change Detect bit. - * | | |Note that when the EHCI controller owns the port, the resume sequence follows the defined sequence documented in the USB Specification Revision 2.0 - * | | |The resume signaling (Full-speed 'K') is driven on the port as long as this bit remains a one - * | | |Software must appropriately time the Resume and set this bit to a zero when the appropriate amount of time has elapsed - * | | |Writing a zero (from one) causes the port to return to high-speed mode (forcing the bus below the port into a high-speed idle) - * | | |This bit will remain a one until the port has switched to the high-speed idle - * | | |The host controller must complete this transition within 2 milliseconds of software setting this bit to a zero. - * | | |This field is zero if Port Power is zero. - * | | |0 = No resume (K-state) detected/driven on port. - * | | |1 = Resume detected/driven on port. - * |[7] |SUSPEND |Suspend (R/W) - * | | |Port Enabled Bit and Suspend bit of this register define the port states as follows: - * | | |Port enable is 0 and suspend is 0 = Disable. - * | | |Port enable is 0 and suspend is 1 = Disable. - * | | |Port enable is 1 and suspend is 0 = Enable. - * | | |Port enable is 1 and suspend is 1 = Suspend. - * | | |When in suspend state, downstream propagation of data is blocked on this port, except for port reset - * | | |The blocking occurs at the end of the current transaction, if a transaction was in progress when this bit was written to 1 - * | | |In the suspend state, the port is sensitive to resume detection - * | | |Note that the bit status does not change until the port is suspended and that there may be a delay in suspending a port if there is a transaction currently in progress on the USB. - * | | |A write of zero to this bit is ignored by the host controller - * | | |The host controller will unconditionally set this bit to a zero when: - * | | |Software sets the Force Port Resume bit to a zero (from a one). - * | | |Software sets the Port Reset bit to a one (from a zero). - * | | |If host software sets this bit to a one when the port is not enabled (i.e. - * | | |Port enabled bit is a zero) the results are undefined. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port not in suspend state. - * | | |1 = Port in suspend state. - * |[8] |PRST |Port Reset (R/W) - * | | |When software writes a one to this bit (from a zero), the bus reset sequence as defined in the USB Specification Revision 2.0 is started - * | | |Software writes a zero to this bit to terminate the bus reset sequence - * | | |Software must keep this bit at a one long enough to ensure the reset sequence, as specified in the USB Specification Revision 2.0, completes - * | | |Note: when software writes this bit to a one, it must also write a zero to the Port Enable bit. - * | | |Note that when software writes a zero to this bit there may be a delay before the bit status changes to a zero - * | | |The bit status will not read as a zero until after the reset has completed - * | | |If the port is in high-speed mode after reset is complete, the host controller will automatically enable this port (e.g. - * | | |set the Port Enable bit to a one) - * | | |A host controller must terminate the reset and stabilize the state of the port within 2 milliseconds of software transitioning this bit from a one to a zero - * | | |For example: if the port detects that the attached device is high-speed during reset, then the host controller must have the port in the enabled state within 2ms of software writing this bit to a zero. - * | | |The HCHalted bit in the USBSTS register should be a zero before software attempts to use this bit - * | | |The host controller may hold Port Reset asserted to a one when the HCHalted bit is a one. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port is not in Reset. - * | | |1 = Port is in Reset. - * |[11:10] |LSTS |Line Status (RO) - * | | |These bits reflect the current logical levels of the D+ (bit 11) and D- (bit 10) signal lines - * | | |These bits are used for detection of low-speed USB devices prior to the port reset and enable sequence - * | | |This field is valid only when the port enable bit is zero and the current connect status bit is set to a one. - * | | |The encoding of the bits are: - * | | |Bits[11:10] USB State Interpretation - * | | |00 = SE0 Not Low-speed device, perform EHCI reset. - * | | |01 = K-state Low-speed device, release ownership of port. - * | | |10 = J-state Not Low-speed device, perform EHCI reset. - * | | |11 = Undefined Not Low-speed device, perform EHCI reset. - * | | |This value of this field is undefined if Port Power is zero. - * |[12] |PP |Port Power (PP) - * | | |Host controller has port power control switches - * | | |This bit represents the Current setting of the switch (0 = off, 1 = on) - * | | |When power is not available on a port (i.e. - * | | |PP equals a 0), the port is nonfunctional and will not report attaches, detaches, etc. - * | | |When an over-current condition is detected on a powered port and PPC is a one, the PP bit in each affected port may be transitioned by the host controller from a 1 to 0 (removing power from the port). - * |[13] |PO |Port Owner (R/W) - * | | |This bit unconditionally goes to a 0b when the Configured bit in the CONFIGFLAG register makes a 0 to 1 transition - * | | |This bit unconditionally goes to 1 whenever the Configured bit is zero. - * | | |System software uses this field to release ownership of the port to a selected host controller (in the event that the attached device is not a high-speed device) - * | | |Software writes a one to this bit when the attached device is not a high-speed device - * | | |A one in this bit means that a companion host controller owns and controls the port. - * |[19:16] |PTC |Port Test Control (R/W) - * | | |When this field is zero, the port is NOT operating in a test mode - * | | |A non-zero value indicates that it is operating in test mode and the specific test mode is indicated by the specific value - * | | |The encoding of the test mode bits are (0x6 ~ 0xF are reserved): - * | | |Bits Test Mode - * | | |0x0 = Test mode not enabled. - * | | |0x1 = Test J_STATE. - * | | |0x2 = Test K_STATE. - * | | |0x3 = Test SE0_NAK. - * | | |0x4 = Test Packet. - * | | |0x5 = Test FORCE_ENABLE. - * @var HSUSBH_T::USBPCR0 - * Offset: 0xC4 USB PHY 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 0. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 0 was suspended. - * | | |1 = USB PHY 0 was not suspended. - * |[11] |CLKVALID |UTMI Clock Valid - * | | |This bit is a flag to indicate if the UTMI clock from USB 2.0 PHY is ready - * | | |S/W program must prevent to write other control registers before this UTMI clock valid flag is active. - * | | |0 = UTMI clock is not valid. - * | | |1 = UTMI clock is valid. - * @var HSUSBH_T::USBPCR1 - * Offset: 0xC8 USB PHY 1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 1. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 1 was suspended. - * | | |1 = USB PHY 1 was not suspended. - */ - __I uint32_t EHCVNR; /*!< [0x0000] EHCI Version Number Register */ - __I uint32_t EHCSPR; /*!< [0x0004] EHCI Structural Parameters Register */ - __I uint32_t EHCCPR; /*!< [0x0008] EHCI Capability Parameters Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t UCMDR; /*!< [0x0020] USB Command Register */ - __IO uint32_t USTSR; /*!< [0x0024] USB Status Register */ - __IO uint32_t UIENR; /*!< [0x0028] USB Interrupt Enable Register */ - __IO uint32_t UFINDR; /*!< [0x002c] USB Frame Index Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t UPFLBAR; /*!< [0x0034] USB Periodic Frame List Base Address Register */ - __IO uint32_t UCALAR; /*!< [0x0038] USB Current Asynchronous List Address Register */ - __IO uint32_t UASSTR; /*!< [0x003c] USB Asynchronous Schedule Sleep Timer Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t UCFGR; /*!< [0x0060] USB Configure Flag Register */ - __IO uint32_t UPSCR[2]; /*!< [0x0064] ~ [0x0068] USB Port 0 & 1 Status and Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[22]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t USBPCR0; /*!< [0x00c4] USB PHY 0 Control Register */ - __IO uint32_t USBPCR1; /*!< [0x00c8] USB PHY 1 Control Register */ - -} HSUSBH_T; - -/** - @addtogroup HSUSBH_CONST HSUSBH Bit Field Definition - Constant Definitions for HSUSBH Controller -@{ */ - -#define HSUSBH_EHCVNR_CRLEN_Pos (0) /*!< HSUSBH_T::EHCVNR: CRLEN Position */ -#define HSUSBH_EHCVNR_CRLEN_Msk (0xfful << HSUSBH_EHCVNR_CRLEN_Pos) /*!< HSUSBH_T::EHCVNR: CRLEN Mask */ - -#define HSUSBH_EHCVNR_VERSION_Pos (16) /*!< HSUSBH_T::EHCVNR: VERSION Position */ -#define HSUSBH_EHCVNR_VERSION_Msk (0xfffful << HSUSBH_EHCVNR_VERSION_Pos) /*!< HSUSBH_T::EHCVNR: VERSION Mask */ - -#define HSUSBH_EHCSPR_N_PORTS_Pos (0) /*!< HSUSBH_T::EHCSPR: N_PORTS Position */ -#define HSUSBH_EHCSPR_N_PORTS_Msk (0xful << HSUSBH_EHCSPR_N_PORTS_Pos) /*!< HSUSBH_T::EHCSPR: N_PORTS Mask */ - -#define HSUSBH_EHCSPR_PPC_Pos (4) /*!< HSUSBH_T::EHCSPR: PPC Position */ -#define HSUSBH_EHCSPR_PPC_Msk (0x1ul << HSUSBH_EHCSPR_PPC_Pos) /*!< HSUSBH_T::EHCSPR: PPC Mask */ - -#define HSUSBH_EHCSPR_N_PCC_Pos (8) /*!< HSUSBH_T::EHCSPR: N_PCC Position */ -#define HSUSBH_EHCSPR_N_PCC_Msk (0xful << HSUSBH_EHCSPR_N_PCC_Pos) /*!< HSUSBH_T::EHCSPR: N_PCC Mask */ - -#define HSUSBH_EHCSPR_N_CC_Pos (12) /*!< HSUSBH_T::EHCSPR: N_CC Position */ -#define HSUSBH_EHCSPR_N_CC_Msk (0xful << HSUSBH_EHCSPR_N_CC_Pos) /*!< HSUSBH_T::EHCSPR: N_CC Mask */ - -#define HSUSBH_EHCCPR_AC64_Pos (0) /*!< HSUSBH_T::EHCCPR: AC64 Position */ -#define HSUSBH_EHCCPR_AC64_Msk (0x1ul << HSUSBH_EHCCPR_AC64_Pos) /*!< HSUSBH_T::EHCCPR: AC64 Mask */ - -#define HSUSBH_EHCCPR_PFLF_Pos (1) /*!< HSUSBH_T::EHCCPR: PFLF Position */ -#define HSUSBH_EHCCPR_PFLF_Msk (0x1ul << HSUSBH_EHCCPR_PFLF_Pos) /*!< HSUSBH_T::EHCCPR: PFLF Mask */ - -#define HSUSBH_EHCCPR_ASPC_Pos (2) /*!< HSUSBH_T::EHCCPR: ASPC Position */ -#define HSUSBH_EHCCPR_ASPC_Msk (0x1ul << HSUSBH_EHCCPR_ASPC_Pos) /*!< HSUSBH_T::EHCCPR: ASPC Mask */ - -#define HSUSBH_EHCCPR_IST_Pos (4) /*!< HSUSBH_T::EHCCPR: IST Position */ -#define HSUSBH_EHCCPR_IST_Msk (0xful << HSUSBH_EHCCPR_IST_Pos) /*!< HSUSBH_T::EHCCPR: IST Mask */ - -#define HSUSBH_EHCCPR_EECP_Pos (8) /*!< HSUSBH_T::EHCCPR: EECP Position */ -#define HSUSBH_EHCCPR_EECP_Msk (0xfful << HSUSBH_EHCCPR_EECP_Pos) /*!< HSUSBH_T::EHCCPR: EECP Mask */ - -#define HSUSBH_UCMDR_RUN_Pos (0) /*!< HSUSBH_T::UCMDR: RUN Position */ -#define HSUSBH_UCMDR_RUN_Msk (0x1ul << HSUSBH_UCMDR_RUN_Pos) /*!< HSUSBH_T::UCMDR: RUN Mask */ - -#define HSUSBH_UCMDR_HCRST_Pos (1) /*!< HSUSBH_T::UCMDR: HCRST Position */ -#define HSUSBH_UCMDR_HCRST_Msk (0x1ul << HSUSBH_UCMDR_HCRST_Pos) /*!< HSUSBH_T::UCMDR: HCRST Mask */ - -#define HSUSBH_UCMDR_FLSZ_Pos (2) /*!< HSUSBH_T::UCMDR: FLSZ Position */ -#define HSUSBH_UCMDR_FLSZ_Msk (0x3ul << HSUSBH_UCMDR_FLSZ_Pos) /*!< HSUSBH_T::UCMDR: FLSZ Mask */ - -#define HSUSBH_UCMDR_PSEN_Pos (4) /*!< HSUSBH_T::UCMDR: PSEN Position */ -#define HSUSBH_UCMDR_PSEN_Msk (0x1ul << HSUSBH_UCMDR_PSEN_Pos) /*!< HSUSBH_T::UCMDR: PSEN Mask */ - -#define HSUSBH_UCMDR_ASEN_Pos (5) /*!< HSUSBH_T::UCMDR: ASEN Position */ -#define HSUSBH_UCMDR_ASEN_Msk (0x1ul << HSUSBH_UCMDR_ASEN_Pos) /*!< HSUSBH_T::UCMDR: ASEN Mask */ - -#define HSUSBH_UCMDR_IAAD_Pos (6) /*!< HSUSBH_T::UCMDR: IAAD Position */ -#define HSUSBH_UCMDR_IAAD_Msk (0x1ul << HSUSBH_UCMDR_IAAD_Pos) /*!< HSUSBH_T::UCMDR: IAAD Mask */ - -#define HSUSBH_UCMDR_ITC_Pos (16) /*!< HSUSBH_T::UCMDR: ITC Position */ -#define HSUSBH_UCMDR_ITC_Msk (0xfful << HSUSBH_UCMDR_ITC_Pos) /*!< HSUSBH_T::UCMDR: ITC Mask */ - -#define HSUSBH_USTSR_USBINT_Pos (0) /*!< HSUSBH_T::USTSR: USBINT Position */ -#define HSUSBH_USTSR_USBINT_Msk (0x1ul << HSUSBH_USTSR_USBINT_Pos) /*!< HSUSBH_T::USTSR: USBINT Mask */ - -#define HSUSBH_USTSR_UERRINT_Pos (1) /*!< HSUSBH_T::USTSR: UERRINT Position */ -#define HSUSBH_USTSR_UERRINT_Msk (0x1ul << HSUSBH_USTSR_UERRINT_Pos) /*!< HSUSBH_T::USTSR: UERRINT Mask */ - -#define HSUSBH_USTSR_PCD_Pos (2) /*!< HSUSBH_T::USTSR: PCD Position */ -#define HSUSBH_USTSR_PCD_Msk (0x1ul << HSUSBH_USTSR_PCD_Pos) /*!< HSUSBH_T::USTSR: PCD Mask */ - -#define HSUSBH_USTSR_FLR_Pos (3) /*!< HSUSBH_T::USTSR: FLR Position */ -#define HSUSBH_USTSR_FLR_Msk (0x1ul << HSUSBH_USTSR_FLR_Pos) /*!< HSUSBH_T::USTSR: FLR Mask */ - -#define HSUSBH_USTSR_HSERR_Pos (4) /*!< HSUSBH_T::USTSR: HSERR Position */ -#define HSUSBH_USTSR_HSERR_Msk (0x1ul << HSUSBH_USTSR_HSERR_Pos) /*!< HSUSBH_T::USTSR: HSERR Mask */ - -#define HSUSBH_USTSR_IAA_Pos (5) /*!< HSUSBH_T::USTSR: IAA Position */ -#define HSUSBH_USTSR_IAA_Msk (0x1ul << HSUSBH_USTSR_IAA_Pos) /*!< HSUSBH_T::USTSR: IAA Mask */ - -#define HSUSBH_USTSR_HCHalted_Pos (12) /*!< HSUSBH_T::USTSR: HCHalted Position */ -#define HSUSBH_USTSR_HCHalted_Msk (0x1ul << HSUSBH_USTSR_HCHalted_Pos) /*!< HSUSBH_T::USTSR: HCHalted Mask */ - -#define HSUSBH_USTSR_RECLA_Pos (13) /*!< HSUSBH_T::USTSR: RECLA Position */ -#define HSUSBH_USTSR_RECLA_Msk (0x1ul << HSUSBH_USTSR_RECLA_Pos) /*!< HSUSBH_T::USTSR: RECLA Mask */ - -#define HSUSBH_USTSR_PSS_Pos (14) /*!< HSUSBH_T::USTSR: PSS Position */ -#define HSUSBH_USTSR_PSS_Msk (0x1ul << HSUSBH_USTSR_PSS_Pos) /*!< HSUSBH_T::USTSR: PSS Mask */ - -#define HSUSBH_USTSR_ASS_Pos (15) /*!< HSUSBH_T::USTSR: ASS Position */ -#define HSUSBH_USTSR_ASS_Msk (0x1ul << HSUSBH_USTSR_ASS_Pos) /*!< HSUSBH_T::USTSR: ASS Mask */ - -#define HSUSBH_UIENR_USBIEN_Pos (0) /*!< HSUSBH_T::UIENR: USBIEN Position */ -#define HSUSBH_UIENR_USBIEN_Msk (0x1ul << HSUSBH_UIENR_USBIEN_Pos) /*!< HSUSBH_T::UIENR: USBIEN Mask */ - -#define HSUSBH_UIENR_UERRIEN_Pos (1) /*!< HSUSBH_T::UIENR: UERRIEN Position */ -#define HSUSBH_UIENR_UERRIEN_Msk (0x1ul << HSUSBH_UIENR_UERRIEN_Pos) /*!< HSUSBH_T::UIENR: UERRIEN Mask */ - -#define HSUSBH_UIENR_PCIEN_Pos (2) /*!< HSUSBH_T::UIENR: PCIEN Position */ -#define HSUSBH_UIENR_PCIEN_Msk (0x1ul << HSUSBH_UIENR_PCIEN_Pos) /*!< HSUSBH_T::UIENR: PCIEN Mask */ - -#define HSUSBH_UIENR_FLREN_Pos (3) /*!< HSUSBH_T::UIENR: FLREN Position */ -#define HSUSBH_UIENR_FLREN_Msk (0x1ul << HSUSBH_UIENR_FLREN_Pos) /*!< HSUSBH_T::UIENR: FLREN Mask */ - -#define HSUSBH_UIENR_HSERREN_Pos (4) /*!< HSUSBH_T::UIENR: HSERREN Position */ -#define HSUSBH_UIENR_HSERREN_Msk (0x1ul << HSUSBH_UIENR_HSERREN_Pos) /*!< HSUSBH_T::UIENR: HSERREN Mask */ - -#define HSUSBH_UIENR_IAAEN_Pos (5) /*!< HSUSBH_T::UIENR: IAAEN Position */ -#define HSUSBH_UIENR_IAAEN_Msk (0x1ul << HSUSBH_UIENR_IAAEN_Pos) /*!< HSUSBH_T::UIENR: IAAEN Mask */ - -#define HSUSBH_UFINDR_FI_Pos (0) /*!< HSUSBH_T::UFINDR: FI Position */ -#define HSUSBH_UFINDR_FI_Msk (0x3ffful << HSUSBH_UFINDR_FI_Pos) /*!< HSUSBH_T::UFINDR: FI Mask */ - -#define HSUSBH_UPFLBAR_BADDR_Pos (12) /*!< HSUSBH_T::UPFLBAR: BADDR Position */ -#define HSUSBH_UPFLBAR_BADDR_Msk (0xffffful << HSUSBH_UPFLBAR_BADDR_Pos) /*!< HSUSBH_T::UPFLBAR: BADDR Mask */ - -#define HSUSBH_UCALAR_LPL_Pos (5) /*!< HSUSBH_T::UCALAR: LPL Position */ -#define HSUSBH_UCALAR_LPL_Msk (0x7fffffful << HSUSBH_UCALAR_LPL_Pos) /*!< HSUSBH_T::UCALAR: LPL Mask */ - -#define HSUSBH_UASSTR_ASSTMR_Pos (0) /*!< HSUSBH_T::UASSTR: ASSTMR Position */ -#define HSUSBH_UASSTR_ASSTMR_Msk (0xffful << HSUSBH_UASSTR_ASSTMR_Pos) /*!< HSUSBH_T::UASSTR: ASSTMR Mask */ - -#define HSUSBH_UCFGR_CF_Pos (0) /*!< HSUSBH_T::UCFGR: CF Position */ -#define HSUSBH_UCFGR_CF_Msk (0x1ul << HSUSBH_UCFGR_CF_Pos) /*!< HSUSBH_T::UCFGR: CF Mask */ - -#define HSUSBH_UPSCR_CCS_Pos (0) /*!< HSUSBH_T::UPSCR[2]: CCS Position */ -#define HSUSBH_UPSCR_CCS_Msk (0x1ul << HSUSBH_UPSCR_CCS_Pos) /*!< HSUSBH_T::UPSCR[2]: CCS Mask */ - -#define HSUSBH_UPSCR_CSC_Pos (1) /*!< HSUSBH_T::UPSCR[2]: CSC Position */ -#define HSUSBH_UPSCR_CSC_Msk (0x1ul << HSUSBH_UPSCR_CSC_Pos) /*!< HSUSBH_T::UPSCR[2]: CSC Mask */ - -#define HSUSBH_UPSCR_PE_Pos (2) /*!< HSUSBH_T::UPSCR[2]: PE Position */ -#define HSUSBH_UPSCR_PE_Msk (0x1ul << HSUSBH_UPSCR_PE_Pos) /*!< HSUSBH_T::UPSCR[2]: PE Mask */ - -#define HSUSBH_UPSCR_PEC_Pos (3) /*!< HSUSBH_T::UPSCR[2]: PEC Position */ -#define HSUSBH_UPSCR_PEC_Msk (0x1ul << HSUSBH_UPSCR_PEC_Pos) /*!< HSUSBH_T::UPSCR[2]: PEC Mask */ - -#define HSUSBH_UPSCR_OCA_Pos (4) /*!< HSUSBH_T::UPSCR[2]: OCA Position */ -#define HSUSBH_UPSCR_OCA_Msk (0x1ul << HSUSBH_UPSCR_OCA_Pos) /*!< HSUSBH_T::UPSCR[2]: OCA Mask */ - -#define HSUSBH_UPSCR_OCC_Pos (5) /*!< HSUSBH_T::UPSCR[2]: OCC Position */ -#define HSUSBH_UPSCR_OCC_Msk (0x1ul << HSUSBH_UPSCR_OCC_Pos) /*!< HSUSBH_T::UPSCR[2]: OCC Mask */ - -#define HSUSBH_UPSCR_FPR_Pos (6) /*!< HSUSBH_T::UPSCR[2]: FPR Position */ -#define HSUSBH_UPSCR_FPR_Msk (0x1ul << HSUSBH_UPSCR_FPR_Pos) /*!< HSUSBH_T::UPSCR[2]: FPR Mask */ - -#define HSUSBH_UPSCR_SUSPEND_Pos (7) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Position */ -#define HSUSBH_UPSCR_SUSPEND_Msk (0x1ul << HSUSBH_UPSCR_SUSPEND_Pos) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Mask */ - -#define HSUSBH_UPSCR_PRST_Pos (8) /*!< HSUSBH_T::UPSCR[2]: PRST Position */ -#define HSUSBH_UPSCR_PRST_Msk (0x1ul << HSUSBH_UPSCR_PRST_Pos) /*!< HSUSBH_T::UPSCR[2]: PRST Mask */ - -#define HSUSBH_UPSCR_LSTS_Pos (10) /*!< HSUSBH_T::UPSCR[2]: LSTS Position */ -#define HSUSBH_UPSCR_LSTS_Msk (0x3ul << HSUSBH_UPSCR_LSTS_Pos) /*!< HSUSBH_T::UPSCR[2]: LSTS Mask */ - -#define HSUSBH_UPSCR_PP_Pos (12) /*!< HSUSBH_T::UPSCR[2]: PP Position */ -#define HSUSBH_UPSCR_PP_Msk (0x1ul << HSUSBH_UPSCR_PP_Pos) /*!< HSUSBH_T::UPSCR[2]: PP Mask */ - -#define HSUSBH_UPSCR_PO_Pos (13) /*!< HSUSBH_T::UPSCR[2]: PO Position */ -#define HSUSBH_UPSCR_PO_Msk (0x1ul << HSUSBH_UPSCR_PO_Pos) /*!< HSUSBH_T::UPSCR[2]: PO Mask */ - -#define HSUSBH_UPSCR_PTC_Pos (16) /*!< HSUSBH_T::UPSCR[2]: PTC Position */ -#define HSUSBH_UPSCR_PTC_Msk (0xful << HSUSBH_UPSCR_PTC_Pos) /*!< HSUSBH_T::UPSCR[2]: PTC Mask */ - -#define HSUSBH_USBPCR0_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR0: SUSPEND Position */ -#define HSUSBH_USBPCR0_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR0_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR0: SUSPEND Mask */ - -#define HSUSBH_USBPCR0_CLKVALID_Pos (11) /*!< HSUSBH_T::USBPCR0: CLKVALID Position */ -#define HSUSBH_USBPCR0_CLKVALID_Msk (0x1ul << HSUSBH_USBPCR0_CLKVALID_Pos) /*!< HSUSBH_T::USBPCR0: CLKVALID Mask */ - -#define HSUSBH_USBPCR1_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR1: SUSPEND Position */ -#define HSUSBH_USBPCR1_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR1_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR1: SUSPEND Mask */ - -/**@}*/ /* HSUSBH_CONST */ -/**@}*/ /* end of HSUSBH register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __HSUSBH_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2c_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2c_reg.h deleted file mode 100644 index ad50f3dfc78..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2c_reg.h +++ /dev/null @@ -1,816 +0,0 @@ -/**************************************************************************//** - * @file i2c_reg.h - * @version V1.00 - * @brief I2C register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __I2C_REG_H__ -#define __I2C_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup I2C Inter-IC Bus Controller(I2C) - Memory Mapped Structure for I2C Controller -@{ */ - -typedef struct -{ - - - /** - * @var I2C_T::CTL0 - * Offset: 0x00 I2C Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |AA |Assert Acknowledge Control - * | | |When AA =1 prior to address or data is received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line - * |[3] |SI |I2C Interrupt Flag - * | | |When a new I2C state is present in the I2C_STATUS register, the SI flag is set by hardware - * | | |If bit INTEN (I2C_CTL [7]) is set, the I2C interrupt is requested - * | | |SI must be cleared by software - * | | |Clear SI by writing 1 to this bit. - * | | |For ACKMEN is set in slave read mode, the SI flag is set in 8th clock period for user to confirm the acknowledge bit and 9th clock period for user to read the data in the data buffer. - * |[4] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C controller will check the bus condition if a STOP condition is detected - * | | |This bit will be cleared by hardware automatically. - * |[5] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[6] |I2CEN |I2C Controller Enable Bit - * | | |Set to enable I2C serial function controller - * | | |When I2CEN=1 the I2C serial function enable - * | | |The multi-function pin function must set to SDA, and SCL of I2C function first. - * | | |0 = I2C controller Disabled. - * | | |1 = I2C controller Enabled. - * |[7] |INTEN |Enable Interrupt - * | | |0 = I2C interrupt Disabled. - * | | |1 = I2C interrupt Enabled. - * |[9:8] |DPBITSEL |Data Phase Bit Count Select - * | | |00 = DPCIF never set by hardware. - * | | |01 = When I2C is transfer data and bit count equal to 6, DPCIF will be set by hardware. - * | | |10 = When I2C is transfer data and bit count equal to 7, DPCIF will be set by hardware. - * | | |11 = When I2C is transfer data and bit count equal to 8, DPCIF will be set by hardware. - * |[12] |DPCINTEN |Data Phase Count Interrupt Enable Bit - * | | |0 = Data Phase Count Interrupt Disabled. - * | | |1 = Data Phase Count Interrupt Enabled. - * |[13] |SRCINTEN |Slave Read Command Interrupt Enable Bit - * | | |0 = Slave Read Command Interrupt Disabled. - * | | |1 = Slave Read Command Interrupt Enabled. - * |[14] |DPCIF |Data Phase Count Interrupt Flag - * | | |This bit is set by hardware when I2C transfer bit count equal to DPBITSEL setting - * | | |This bit is cleared by write 1 to it. - * |[15] |SARCIF |Slave Address Read Command Interrupt Flag - * | | |This bit is set by hardware when I2C receive address match read command. - * | | |This bit is cleared by write 1 to it. - * @var I2C_T::ADDR0 - * Offset: 0x04 I2C Slave Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::DAT - * Offset: 0x08 I2C Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |I2C Data - * | | |Bit [7:0] is located with the 8-bit transferred/received data of I2C serial port. - * @var I2C_T::STATUS0 - * Offset: 0x0C I2C Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |STATUS |I2C Status - * | | |The three least significant bits are always 0 - * | | |The five most significant bits contain the status code - * | | |There are 28 possible status codes - * | | |When the content of I2C_STATUS is F8H, no serial interrupt is requested - * | | |Others I2C_STATUS values correspond to defined I2C states - * | | |When each of these states is entered, a status interrupt is requested (SI = 1) - * | | |A valid status code is present in I2C_STATUS one cycle after SI is set by hardware and is still present one cycle after SI has been reset by software - * | | |In addition, states 00H stands for a Bus Error - * | | |A Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit. - * @var I2C_T::CLKDIV - * Offset: 0x10 I2C Clock Divided Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DIVIDER |I2C Clock Divided - * | | |Indicates the I2C clock rate: Data Baud Rate of I2C = (system clock) / (4x (I2C_CLKDIV+1)). - * | | |Note: The minimum value of I2C_CLKDIV is 4. - * |[15:12] |NFCNT |Noise Filter Count - * | | |The register bits control the input filter width. - * | | |0 = filter width 3*PCLK - * | | |1 = filter width 4*PCLK - * | | |N = filter width (3+N)*PCKL - * | | |Note: Filter width Min :3*PCLK, Max : 18*PCLK - * @var I2C_T::TOCTL - * Offset: 0x14 I2C Time-out Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIF |Time-out Flag - * | | |This bit is set by hardware when I2C time-out happened and it can interrupt CPU if I2C interrupt enable bit (INTEN) is set to 1. - * | | |Note: Software can write 1 to clear this bit. - * |[1] |TOCDIV4 |Time-out Counter Input Clock Divided by 4 - * | | |When Enabled, The time-out period is extend 4 times. - * | | |0 = Time-out period is extend 4 times Disabled. - * | | |1 = Time-out period is extend 4 times Enabled. - * |[2] |TOCEN |Time-out Counter Enable Bit - * | | |When Enabled, the 14-bit time-out counter will start counting when SI is clear - * | | |Setting flag SI to '1' will reset counter and re-start up counting after SI is cleared. - * | | |0 = Time-out counter Disabled. - * | | |1 = Time-out counter Enabled. - * @var I2C_T::ADDR1 - * Offset: 0x18 I2C Slave Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::ADDR2 - * Offset: 0x1C I2C Slave Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::ADDR3 - * Offset: 0x20 I2C Slave Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::ADDRMSK0 - * Offset: 0x24 I2C Slave Address Mask Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK1 - * Offset: 0x28 I2C Slave Address Mask Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK2 - * Offset: 0x2C I2C Slave Address Mask Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK3 - * Offset: 0x30 I2C Slave Address Mask Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::WKCTL - * Offset: 0x3C I2C Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |I2C Wake-up Enable Bit - * | | |0 = I2C wake-up function Disabled. - * | | |1 = I2C wake-up function Enabled. - * |[7] |NHDBUSEN |I2C No Hold BUS Enable Bit - * | | |0 = I2C hold bus after wake-up. - * | | |1 = I2C don't hold bus after wake-up. - * | | |Note: I2C controller could response when WKIF event is not clear, it may cause error data transmitted or received - * | | |If data transmitted or received when WKIF event is not clear, user must reset I2C controller and execute the original operation again. - * @var I2C_T::WKSTS - * Offset: 0x40 I2C Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKIF |I2C Wake-up Flag - * | | |When chip is woken up from Power-down mode by I2C, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * |[1] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release WKIF. Software can write 1 to clear this bit. - * |[2] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame - * | | |0 = Write command be record on the address match wakeup frame. - * | | |1 = Read command be record on the address match wakeup frame. - * | | |Note: This bit will be cleared when software can write 1 to WKAKDONE bit. - * @var I2C_T::CTL1 - * Offset: 0x44 I2C Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function disable. - * | | |1 = Transmit PDMA function enable. - * |[1] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function disable. - * | | |1 = Receive PDMA function enable. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the I2C request to PDMA. - * |[3] |OVRIEN |I2C over Run Interrupt Control Bit - * | | |Setting OVRIEN to logic 1 will send a interrupt to system when the TWOFF bit is enabled and there is over run event in received buffer. - * |[4] |UDRIEN |I2C Under Run Interrupt Control Bit - * | | |Setting UDRIEN to logic 1 will send a interrupt to system when the TWOFF bit is enabled and there is under run event happened in transmitted buffer. - * |[5] |TWOBUFEN |Two-level BUFFER Enable Bit - * | | |0 = Two-level buffer Disabled. - * | | |1 = Two-level buffer Enabled. - * | | |Set to enable the two-level buffer for I2C transmitted or received buffer. It is used to improve the performance of the I2C bus. - * |[8] |PDMASTR |PDMA Stretch Bit - * | | |0 = I2C send STOP automatically after PDMA transfer done. (only master TX) - * | | |1 = I2C SCL bus is stretched by hardware after PDMA transfer done if the SI is not cleared - * | | |(only master TX) - * |[9] |ADDR10EN |Address 10-bit Function Enable - * | | |0 = Address match 10-bit function is disabled. - * | | |1 = Address match 10-bit function is enabled. - * |[10] |SWITCHEN |SCL And SDA Pin Switch Enable Bit - * | | |0 = I2C use original pin configuration. - * | | |1 = I2C switch SCL and SDA pin configuration. - * | | |Note: Original pin configuration table is shown in Basic Configuration chapter. - * @var I2C_T::STATUS1 - * Offset: 0x48 I2C Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADMAT0 |I2C Address 0 Match Status Register - * | | |When address 0 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[1] |ADMAT1 |I2C Address 1 Match Status Register - * | | |When address 1 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[2] |ADMAT2 |I2C Address 2 Match Status Register - * | | |When address 2 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[3] |ADMAT3 |I2C Address 3 Match Status Register - * | | |When address 3 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[4] |FULL |TWO-LEVEL BUFFER FULL - * | | |This bit indicates two-level buffer TX or RX full or not when the TWOBUFEN = 1. - * | | |This bit is set when POINTER is equal to 2 - * | | |Note: This bit is read only. - * |[5] |EMPTY |TWO-LEVEL BUFFER EMPTY - * | | |This bit indicates two-level buffer TX or RX empty or not when the TWOBUFEN = 1. - * | | |This bit is set when POINTER is equal to 0. - * | | |Note: This bit is read only. - * |[6] |OVR |I2C over Run Status Bit - * | | |This bit indicates the received two-level buffer TX or RX is over run when the TWOBUFEN = 1. - * | | |Note: This bit is read only. - * |[7] |UDR |I2C Under Run Status Bit - * | | |This bit indicates the transmitted two-level buffer TX or RX is under run when the TWOBUFEN = 1. - * | | |Note: This bit is read only. - * |[8] |ONBUSY |On Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected. - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * | | |Note:This bit is read only. - * @var I2C_T::TMCTL - * Offset: 0x4C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control Register - * | | |This field is used to generate a delay timing between SDA falling edge and SCL rising edge in transmission mode. - * | | |The delay setup time is numbers of peripheral clock = STCTL x PCLK. - * | | |Note: Setup time setting should not make SCL output less than three PCLKs. - * |[24:16] |HTCTL |Hold Time Configure Control Register - * | | |This field is used to generate the delay timing between SCL falling edge and SDA rising edge in transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x PCLK. - * @var I2C_T::BUSCTL - * Offset: 0x50 I2C Bus Management Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACKMEN |Acknowledge Control by Manual - * | | |In order to allow ACK control in slave reception including the command and data, slave byte control mode must be enabled by setting the ACKMEN bit. - * | | |0 = Slave byte control Disabled. - * | | |1 = Slave byte control Enabled - * | | |The 9th bit can response the ACK or NACK according the received data by user - * | | |When the byte is received, stretching the SCLK signal low between the 8th and 9th SCLK pulse. - * | | |Note: If the BMDEN=1 and this bit is enabled, the information of I2C_STATUS will be fixed as 0xF0 in slave receive condition. - * |[1] |PECEN |Packet Error Checking Calculation Enable Bit - * | | |0 = Packet Error Checking Calculation Disabled. - * | | |1 = Packet Error Checking Calculation Enabled. - * | | |Note: When I2C enter power down mode, the bit should be enabled after wake-up if needed PEC calculation. - * |[2] |BMDEN |Bus Management Device Default Address Enable Bit - * | | |0 = Device default address Disable - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses NACKed - * | | |1 = Device default address Enabled - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses ACKed. - * |[3] |BMHEN |Bus Management Host Enable Bit - * | | |0 = Host function Disabled. - * | | |1 = Host function Enabled. - * |[4] |ALERTEN |Bus Management Alert Enable Bit - * | | |Device Mode (BMHEN=0). - * | | |0 = Release the BM_ALERT pin high and Alert Response Header disabled: 0001100x followed by NACK if both of BMDEN and ACKMEN are enabled. - * | | |1 = Drive BM_ALERT pin low and Alert Response Address Header enables: 0001100x followed by ACK if both of BMDEN and ACKMEN are enabled. - * | | |Host Mode (BMHEN=1). - * | | |0 = BM_ALERT pin not supported. - * | | |1 = BM_ALERT pin supported. - * |[5] |SCTLOSTS |Suspend/Control Data Output Status - * | | |0 = The output of SUSCON pin is low. - * | | |1 = The output of SUSCON pin is high. - * |[6] |SCTLOEN |Suspend or Control Pin Output Enable Bit - * | | |0 = The SUSCON pin in input. - * | | |1 = The output enable is active on the SUSCON pin. - * |[7] |BUSEN |BUS Enable Bit - * | | |0 = The system management function is Disabled. - * | | |1 = The system management function is Enable. - * | | |Note: When the bit is enabled, the internal 14-bit counter is used to calculate the time out event of clock low condition. - * |[8] |PECTXEN |Packet Error Checking Byte Transmission/Reception - * | | |0 = No PEC transfer. - * | | |1 = PEC transmission is requested. - * | | |Note: This bit has no effect in slave mode when ACKMEN=0. - * |[9] |TIDLE |Timer Check in Idle State - * | | |The BUSTOUT is used to calculate the time-out of clock low in bus active and the idle period in bus Idle - * | | |This bit is used to define which condition is enabled. - * | | |0 = The BUSTOUT is used to calculate the clock low period in bus active. - * | | |1 = The BUSTOUT is used to calculate the IDLE period in bus Idle. - * | | |Note: The BUSY (I2C_BUSSTS[0]) indicate the current bus state. - * |[10] |PECCLR |PEC Clear at Repeat Start - * | | |The calculation of PEC starts when PECEN is set to 1 and it is clear when the STA or STO bit is detected - * | | |This PECCLR bit is used to enable the condition of REPEAT START can clear the PEC calculation. - * | | |0 = The PEC calculation is cleared by "Repeat Start" function is Disabled. - * | | |1 = The PEC calculation is cleared by "Repeat Start"" function is Enabled. - * |[11] |ACKM9SI |Acknowledge Manual Enable Extra SI Interrupt - * | | |0 = There is no SI interrupt in the 9th clock cycle when the BUSEN=1 and ACKMEN=1. - * | | |1 = There is SI interrupt in the 9th clock cycle when the BUSEN=1 and ACKMEN=1. - * |[12] |BCDIEN |Packet Error Checking Byte Count Done Interrupt Enable Bit - * | | |0 = Indicates the byte count done interrupt is Disabled. - * | | |1 = Indicates the byte count done interrupt is Enabled. - * | | |Note: This bit is used in PECEN=1. - * |[13] |PECDIEN |Packet Error Checking Byte Transfer Done Interrupt Enable Bit - * | | |0 = Indicates the PEC transfer done interrupt is Disabled. - * | | |1 = Indicates the PEC transfer done interrupt is Enabled. - * | | |Note: This bit is used in PECEN=1. - * @var I2C_T::BUSTCTL - * Offset: 0x54 I2C Bus Management Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSTOEN |Bus Time Out Enable Bit - * | | |0 = Indicates the bus clock low time-out detection is Disabled. - * | | |1 = Indicates the bus clock low time-out detection is Enabled (bus clock is low for more than TTime-out (in BIDLE=0) or high more than TTime-out(in BIDLE =1) - * |[1] |CLKTOEN |Cumulative Clock Low Time Out Enable Bit - * | | |0 = Indicates the cumulative clock low time-out detection is Disabled. - * | | |1 = Indicates the cumulative clock low time-out detection is Enabled. - * | | |For Master, it calculates the period from START to ACK - * | | |For Slave, it calculates the period from START to STOP - * |[2] |BUSTOIEN |Time-out Interrupt Enable Bit - * | | |BUSY =1. - * | | |0 = Indicates the SCLK low time-out interrupt is Disabled. - * | | |1 = Indicates the SCLK low time-out interrupt is Enabled. - * | | |BUSY =0. - * | | |0 = Indicates the bus IDLE time-out interrupt is Disabled. - * | | |1 = Indicates the bus IDLE time-out interrupt is Enabled. - * |[3] |CLKTOIEN |Extended Clock Time Out Interrupt Enable Bit - * | | |0 = Indicates the clock time out interrupt is Disabled. - * | | |1 = Indicates the clock time out interrupt is Enabled. - * |[4] |TORSTEN |Time Out Reset Enable Bit - * | | |0 = Indicates the I2C state machine reset is Disable. - * | | |1 = Indicates the I2C state machine reset is Enable. (The clock and data bus will be released to high) - * @var I2C_T::BUSSTS - * Offset: 0x58 I2C Bus Management Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * |[1] |BCDONE |Byte Count Transmission/Receive Done - * | | |0 = Indicates the byte count transmission/ receive is not finished when the PECEN is set. - * | | |1 = Indicates the byte count transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * |[2] |PECERR |PEC Error in Reception - * | | |0 = Indicates the PEC value equal the received PEC data packet. - * | | |1 = Indicates the PEC value doesn't match the receive PEC data packet. - * | | |Note: Software can write 1 to clear this bit. - * |[3] |ALERT |SMBus Alert Status - * | | |Device Mode (BMHEN =0). - * | | |0 = Indicates SMBALERT pin state is low. - * | | |1 = Indicates SMBALERT pin state is high. - * | | |Host Mode (BMHEN =1). - * | | |0 = No SMBALERT event. - * | | |1 = Indicates there is SMBALERT event (falling edge) is detected in SMALERT pin when the BMHEN = 1 (SMBus host configuration) and the ALERTEN = 1. - * | | |Note: - * | | |1. The SMBALERT pin is an open-drain pin, the pull-high resistor is must in the system - * | | |2. Software can write 1 to clear this bit. - * |[4] |SCTLDIN |Bus Suspend or Control Signal Input Status - * | | |0 = The input status of SUSCON pin is 0. - * | | |1 = The input status of SUSCON pin is 1. - * |[5] |BUSTO |Bus Time-out Status - * | | |0 = Indicates that there is no any time-out or external clock time-out. - * | | |1 = Indicates that a time-out or external clock time-out occurred. - * | | |In bus busy, the bit indicates the total clock low time-out event occurred otherwise, it indicates the bus idle time-out event occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[6] |CLKTO |Clock Low Cumulate Time-out Status - * | | |0 = Indicates that the cumulative clock low is no any time-out. - * | | |1 = Indicates that the cumulative clock low time-out occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[7] |PECDONE |PEC Byte Transmission/Receive Done - * | | |0 = Indicates the PEC transmission/ receive is not finished when the PECEN is set. - * | | |1 = Indicates the PEC transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * @var I2C_T::PKTSIZE - * Offset: 0x5C I2C Packet Error Checking Byte Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |PLDSIZE |Transfer Byte Number - * | | |The transmission or receive byte number in one transaction when the PECEN is set - * | | |The maximum transaction or receive byte is 256 Bytes. - * | | |Notice: The byte number counting includes address, command code, and data frame. - * @var I2C_T::PKTCRC - * Offset: 0x60 I2C Packet Error Checking Byte Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PECCRC |Packet Error Checking Byte Value - * | | |This byte indicates the packet error checking content after transmission or receive byte count by using the C(x) = X8 + X2 + X + 1 - * | | |It is read only. - * @var I2C_T::BUSTOUT - * Offset: 0x64 I2C Bus Management Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BUSTO |Bus Management Time-out Value - * | | |Indicate the bus time-out value in bus is IDLE or SCLK low. - * | | |Note: If the user wants to revise the value of BUSTOUT, the TORSTEN (I2C_BUSTCTL[4]) bit shall be set to 1 and clear to 0 first in the BUSEN(I2C_BUSCTL[7]) is set. - * @var I2C_T::CLKTOUT - * Offset: 0x68 I2C Bus Management Clock Low Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CLKTO |Bus Clock Low Timer - * | | |The field is used to configure the cumulative clock extension time-out. - * | | |Note: If the user wants to revise the value of CLKLTOUT, the TORSTEN bit shall be set to 1 and clear to 0 first in the BUSEN is set. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2C Control Register 0 */ - __IO uint32_t ADDR0; /*!< [0x0004] I2C Slave Address Register0 */ - __IO uint32_t DAT; /*!< [0x0008] I2C Data Register */ - __I uint32_t STATUS0; /*!< [0x000c] I2C Status Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0010] I2C Clock Divided Register */ - __IO uint32_t TOCTL; /*!< [0x0014] I2C Time-out Control Register */ - __IO uint32_t ADDR1; /*!< [0x0018] I2C Slave Address Register1 */ - __IO uint32_t ADDR2; /*!< [0x001c] I2C Slave Address Register2 */ - __IO uint32_t ADDR3; /*!< [0x0020] I2C Slave Address Register3 */ - __IO uint32_t ADDRMSK0; /*!< [0x0024] I2C Slave Address Mask Register0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0028] I2C Slave Address Mask Register1 */ - __IO uint32_t ADDRMSK2; /*!< [0x002c] I2C Slave Address Mask Register2 */ - __IO uint32_t ADDRMSK3; /*!< [0x0030] I2C Slave Address Mask Register3 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WKCTL; /*!< [0x003c] I2C Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0040] I2C Wake-up Status Register */ - __IO uint32_t CTL1; /*!< [0x0044] I2C Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0048] I2C Status Register 1 */ - __IO uint32_t TMCTL; /*!< [0x004c] I2C Timing Configure Control Register */ - __IO uint32_t BUSCTL; /*!< [0x0050] I2C Bus Management Control Register */ - __IO uint32_t BUSTCTL; /*!< [0x0054] I2C Bus Management Timer Control Register */ - __IO uint32_t BUSSTS; /*!< [0x0058] I2C Bus Management Status Register */ - __IO uint32_t PKTSIZE; /*!< [0x005c] I2C Packet Error Checking Byte Number Register */ - __I uint32_t PKTCRC; /*!< [0x0060] I2C Packet Error Checking Byte Value Register */ - __IO uint32_t BUSTOUT; /*!< [0x0064] I2C Bus Management Timer Register */ - __IO uint32_t CLKTOUT; /*!< [0x0068] I2C Bus Management Clock Low Timer Register */ - -} I2C_T; - -/** - @addtogroup I2C_CONST I2C Bit Field Definition - Constant Definitions for I2C Controller -@{ */ - -#define I2C_CTL0_AA_Pos (2) /*!< I2C_T::CTL: AA Position */ -#define I2C_CTL0_AA_Msk (0x1ul << I2C_CTL0_AA_Pos) /*!< I2C_T::CTL: AA Mask */ - -#define I2C_CTL0_SI_Pos (3) /*!< I2C_T::CTL: SI Position */ -#define I2C_CTL0_SI_Msk (0x1ul << I2C_CTL0_SI_Pos) /*!< I2C_T::CTL: SI Mask */ - -#define I2C_CTL0_STO_Pos (4) /*!< I2C_T::CTL: STO Position */ -#define I2C_CTL0_STO_Msk (0x1ul << I2C_CTL0_STO_Pos) /*!< I2C_T::CTL: STO Mask */ - -#define I2C_CTL0_STA_Pos (5) /*!< I2C_T::CTL: STA Position */ -#define I2C_CTL0_STA_Msk (0x1ul << I2C_CTL0_STA_Pos) /*!< I2C_T::CTL: STA Mask */ - -#define I2C_CTL0_I2CEN_Pos (6) /*!< I2C_T::CTL: I2CEN Position */ -#define I2C_CTL0_I2CEN_Msk (0x1ul << I2C_CTL0_I2CEN_Pos) /*!< I2C_T::CTL: I2CEN Mask */ - -#define I2C_CTL0_INTEN_Pos (7) /*!< I2C_T::CTL: INTEN Position */ -#define I2C_CTL0_INTEN_Msk (0x1ul << I2C_CTL0_INTEN_Pos) /*!< I2C_T::CTL: INTEN Mask */ - -#define I2C_CTL0_DPBITSEL_Pos (8) /*!< I2C_T::CTL: DPBITSEL Position */ -#define I2C_CTL0_DPBITSEL_Msk (0x3ul << I2C_CTL0_DPBITSEL_Pos) /*!< I2C_T::CTL: DPBITSEL Mask */ - -#define I2C_CTL0_DPCINTEN_Pos (12) /*!< I2C_T::CTL: DPCINTEN Position */ -#define I2C_CTL0_DPCINTEN_Msk (0x1ul << I2C_CTL0_DPCINTEN_Pos) /*!< I2C_T::CTL: DPCINTEN Mask */ - -#define I2C_CTL0_SRCINTEN_Pos (13) /*!< I2C_T::CTL: SRCINTEN Position */ -#define I2C_CTL0_SRCINTEN_Msk (0x1ul << I2C_CTL0_SRCINTEN_Pos) /*!< I2C_T::CTL: SRCINTEN Mask */ - -#define I2C_CTL0_DPCIF_Pos (14) /*!< I2C_T::CTL: DPCIF Position */ -#define I2C_CTL0_DPCIF_Msk (0x1ul << I2C_CTL0_DPCIF_Pos) /*!< I2C_T::CTL: DPCIF Mask */ - -#define I2C_CTL0_SARCIF_Pos (15) /*!< I2C_T::CTL: SARCIF Position */ -#define I2C_CTL0_SARCIF_Msk (0x1ul << I2C_CTL0_SARCIF_Pos) /*!< I2C_T::CTL: SARCIF Mask */ - -#define I2C_ADDR0_GC_Pos (0) /*!< I2C_T::ADDR0: GC Position */ -#define I2C_ADDR0_GC_Msk (0x1ul << I2C_ADDR0_GC_Pos) /*!< I2C_T::ADDR0: GC Mask */ - -#define I2C_ADDR0_ADDR_Pos (1) /*!< I2C_T::ADDR0: ADDR Position */ -#define I2C_ADDR0_ADDR_Msk (0x3fful << I2C_ADDR0_ADDR_Pos) /*!< I2C_T::ADDR0: ADDR Mask */ - -#define I2C_DAT_DAT_Pos (0) /*!< I2C_T::DAT: DAT Position */ -#define I2C_DAT_DAT_Msk (0xfful << I2C_DAT_DAT_Pos) /*!< I2C_T::DAT: DAT Mask */ - -#define I2C_STATUS0_STATUS_Pos (0) /*!< I2C_T::STATUS: STATUS Position */ -#define I2C_STATUS0_STATUS_Msk (0xfful << I2C_STATUS_STATUS0_Pos) /*!< I2C_T::STATUS: STATUS Mask */ - -#define I2C_CLKDIV_DIVIDER_Pos (0) /*!< I2C_T::CLKDIV: DIVIDER Position */ -#define I2C_CLKDIV_DIVIDER_Msk (0x3fful << I2C_CLKDIV_DIVIDER_Pos) /*!< I2C_T::CLKDIV: DIVIDER Mask */ - -#define I2C_CLKDIV_NFCNT_Pos (12) /*!< I2C_T::CLKDIV: NFCNT Position */ -#define I2C_CLKDIV_NFCNT_Msk (0xful << I2C_CLKDIV_NFCNT_Pos) /*!< I2C_T::CLKDIV: NFCNT Mask */ - -#define I2C_TOCTL_TOIF_Pos (0) /*!< I2C_T::TOCTL: TOIF Position */ -#define I2C_TOCTL_TOIF_Msk (0x1ul << I2C_TOCTL_TOIF_Pos) /*!< I2C_T::TOCTL: TOIF Mask */ - -#define I2C_TOCTL_TOCDIV4_Pos (1) /*!< I2C_T::TOCTL: TOCDIV4 Position */ -#define I2C_TOCTL_TOCDIV4_Msk (0x1ul << I2C_TOCTL_TOCDIV4_Pos) /*!< I2C_T::TOCTL: TOCDIV4 Mask */ - -#define I2C_TOCTL_TOCEN_Pos (2) /*!< I2C_T::TOCTL: TOCEN Position */ -#define I2C_TOCTL_TOCEN_Msk (0x1ul << I2C_TOCTL_TOCEN_Pos) /*!< I2C_T::TOCTL: TOCEN Mask */ - -#define I2C_ADDR1_GC_Pos (0) /*!< I2C_T::ADDR1: GC Position */ -#define I2C_ADDR1_GC_Msk (0x1ul << I2C_ADDR1_GC_Pos) /*!< I2C_T::ADDR1: GC Mask */ - -#define I2C_ADDR1_ADDR_Pos (1) /*!< I2C_T::ADDR1: ADDR Position */ -#define I2C_ADDR1_ADDR_Msk (0x3fful << I2C_ADDR1_ADDR_Pos) /*!< I2C_T::ADDR1: ADDR Mask */ - -#define I2C_ADDR2_GC_Pos (0) /*!< I2C_T::ADDR2: GC Position */ -#define I2C_ADDR2_GC_Msk (0x1ul << I2C_ADDR2_GC_Pos) /*!< I2C_T::ADDR2: GC Mask */ - -#define I2C_ADDR2_ADDR_Pos (1) /*!< I2C_T::ADDR2: ADDR Position */ -#define I2C_ADDR2_ADDR_Msk (0x3fful << I2C_ADDR2_ADDR_Pos) /*!< I2C_T::ADDR2: ADDR Mask */ - -#define I2C_ADDR3_GC_Pos (0) /*!< I2C_T::ADDR3: GC Position */ -#define I2C_ADDR3_GC_Msk (0x1ul << I2C_ADDR3_GC_Pos) /*!< I2C_T::ADDR3: GC Mask */ - -#define I2C_ADDR3_ADDR_Pos (1) /*!< I2C_T::ADDR3: ADDR Position */ -#define I2C_ADDR3_ADDR_Msk (0x3fful << I2C_ADDR3_ADDR_Pos) /*!< I2C_T::ADDR3: ADDR Mask */ - -#define I2C_ADDRMSK0_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK0: ADDRMSK Position */ -#define I2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK0_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define I2C_ADDRMSK1_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK1: ADDRMSK Position */ -#define I2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK1_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define I2C_ADDRMSK2_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK2: ADDRMSK Position */ -#define I2C_ADDRMSK2_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK2_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK2: ADDRMSK Mask */ - -#define I2C_ADDRMSK3_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK3: ADDRMSK Position */ -#define I2C_ADDRMSK3_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK3_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK3: ADDRMSK Mask */ - -#define I2C_WKCTL_WKEN_Pos (0) /*!< I2C_T::WKCTL: WKEN Position */ -#define I2C_WKCTL_WKEN_Msk (0x1ul << I2C_WKCTL_WKEN_Pos) /*!< I2C_T::WKCTL: WKEN Mask */ - -#define I2C_WKCTL_NHDBUSEN_Pos (7) /*!< I2C_T::WKCTL: NHDBUSEN Position */ -#define I2C_WKCTL_NHDBUSEN_Msk (0x1ul << I2C_WKCTL_NHDBUSEN_Pos) /*!< I2C_T::WKCTL: NHDBUSEN Mask */ - -#define I2C_WKSTS_WKIF_Pos (0) /*!< I2C_T::WKSTS: WKIF Position */ -#define I2C_WKSTS_WKIF_Msk (0x1ul << I2C_WKSTS_WKIF_Pos) /*!< I2C_T::WKSTS: WKIF Mask */ - -#define I2C_WKSTS_WKAKDONE_Pos (1) /*!< I2C_T::WKSTS: WKAKDONE Position */ -#define I2C_WKSTS_WKAKDONE_Msk (0x1ul << I2C_WKSTS_WKAKDONE_Pos) /*!< I2C_T::WKSTS: WKAKDONE Mask */ - -#define I2C_WKSTS_WRSTSWK_Pos (2) /*!< I2C_T::WKSTS: WRSTSWK Position */ -#define I2C_WKSTS_WRSTSWK_Msk (0x1ul << I2C_WKSTS_WRSTSWK_Pos) /*!< I2C_T::WKSTS: WRSTSWK Mask */ - -#define I2C_CTL1_TXPDMAEN_Pos (0) /*!< I2C_T::CTL1: TXPDMAEN Position */ -#define I2C_CTL1_TXPDMAEN_Msk (0x1ul << I2C_CTL1_TXPDMAEN_Pos) /*!< I2C_T::CTL1: TXPDMAEN Mask */ - -#define I2C_CTL1_RXPDMAEN_Pos (1) /*!< I2C_T::CTL1: RXPDMAEN Position */ -#define I2C_CTL1_RXPDMAEN_Msk (0x1ul << I2C_CTL1_RXPDMAEN_Pos) /*!< I2C_T::CTL1: RXPDMAEN Mask */ - -#define I2C_CTL1_PDMARST_Pos (2) /*!< I2C_T::CTL1: PDMARST Position */ -#define I2C_CTL1_PDMARST_Msk (0x1ul << I2C_CTL1_PDMARST_Pos) /*!< I2C_T::CTL1: PDMARST Mask */ - -#define I2C_CTL1_OVRIEN_Pos (3) /*!< I2C_T::CTL1: OVRIEN Position */ -#define I2C_CTL1_OVRIEN_Msk (0x1ul << I2C_CTL1_OVRIEN_Pos) /*!< I2C_T::CTL1: OVRIEN Mask */ - -#define I2C_CTL1_UDRIEN_Pos (4) /*!< I2C_T::CTL1: UDRIEN Position */ -#define I2C_CTL1_UDRIEN_Msk (0x1ul << I2C_CTL1_UDRIEN_Pos) /*!< I2C_T::CTL1: UDRIEN Mask */ - -#define I2C_CTL1_TWOBUFEN_Pos (5) /*!< I2C_T::CTL1: TWOBUFEN Position */ -#define I2C_CTL1_TWOBUFEN_Msk (0x1ul << I2C_CTL1_TWOBUFEN_Pos) /*!< I2C_T::CTL1: TWOBUFEN Mask */ - -#define I2C_CTL1_PDMASTR_Pos (8) /*!< I2C_T::CTL1: PDMASTR Position */ -#define I2C_CTL1_PDMASTR_Msk (0x1ul << I2C_CTL1_PDMASTR_Pos) /*!< I2C_T::CTL1: PDMASTR Mask */ - -#define I2C_CTL1_ADDR10EN_Pos (9) /*!< I2C_T::CTL1: ADDR10EN Position */ -#define I2C_CTL1_ADDR10EN_Msk (0x1ul << I2C_CTL1_ADDR10EN_Pos) /*!< I2C_T::CTL1: ADDR10EN Mask */ - -#define I2C_CTL1_SWITCHEN_Pos (10) /*!< I2C_T::CTL1: SWITCHEN Position */ -#define I2C_CTL1_SWITCHEN_Msk (0x1ul << I2C_CTL1_SWITCHEN_Pos) /*!< I2C_T::CTL1: SWITCHEN Mask */ - -#define I2C_STATUS1_ADMAT0_Pos (0) /*!< I2C_T::STATUS1: ADMAT0 Position */ -#define I2C_STATUS1_ADMAT0_Msk (0x1ul << I2C_STATUS1_ADMAT0_Pos) /*!< I2C_T::STATUS1: ADMAT0 Mask */ - -#define I2C_STATUS1_ADMAT1_Pos (1) /*!< I2C_T::STATUS1: ADMAT1 Position */ -#define I2C_STATUS1_ADMAT1_Msk (0x1ul << I2C_STATUS1_ADMAT1_Pos) /*!< I2C_T::STATUS1: ADMAT1 Mask */ - -#define I2C_STATUS1_ADMAT2_Pos (2) /*!< I2C_T::STATUS1: ADMAT2 Position */ -#define I2C_STATUS1_ADMAT2_Msk (0x1ul << I2C_STATUS1_ADMAT2_Pos) /*!< I2C_T::STATUS1: ADMAT2 Mask */ - -#define I2C_STATUS1_ADMAT3_Pos (3) /*!< I2C_T::STATUS1: ADMAT3 Position */ -#define I2C_STATUS1_ADMAT3_Msk (0x1ul << I2C_STATUS1_ADMAT3_Pos) /*!< I2C_T::STATUS1: ADMAT3 Mask */ - -#define I2C_STATUS1_FULL_Pos (4) /*!< I2C_T::STATUS1: FULL Position */ -#define I2C_STATUS1_FULL_Msk (0x1ul << I2C_STATUS1_FULL_Pos) /*!< I2C_T::STATUS1: FULL Mask */ - -#define I2C_STATUS1_EMPTY_Pos (5) /*!< I2C_T::STATUS1: EMPTY Position */ -#define I2C_STATUS1_EMPTY_Msk (0x1ul << I2C_STATUS1_EMPTY_Pos) /*!< I2C_T::STATUS1: EMPTY Mask */ - -#define I2C_STATUS1_OVR_Pos (6) /*!< I2C_T::STATUS1: OVR Position */ -#define I2C_STATUS1_OVR_Msk (0x1ul << I2C_STATUS1_OVR_Pos) /*!< I2C_T::STATUS1: OVR Mask */ - -#define I2C_STATUS1_UDR_Pos (7) /*!< I2C_T::STATUS1: UDR Position */ -#define I2C_STATUS1_UDR_Msk (0x1ul << I2C_STATUS1_UDR_Pos) /*!< I2C_T::STATUS1: UDR Mask */ - -#define I2C_STATUS1_ONBUSY_Pos (8) /*!< I2C_T::STATUS1: ONBUSY Position */ -#define I2C_STATUS1_ONBUSY_Msk (0x1ul << I2C_STATUS1_ONBUSY_Pos) /*!< I2C_T::STATUS1: ONBUSY Mask */ - -#define I2C_TMCTL_STCTL_Pos (0) /*!< I2C_T::TMCTL: STCTL Position */ -#define I2C_TMCTL_STCTL_Msk (0x1fful << I2C_TMCTL_STCTL_Pos) /*!< I2C_T::TMCTL: STCTL Mask */ - -#define I2C_TMCTL_HTCTL_Pos (16) /*!< I2C_T::TMCTL: HTCTL Position */ -#define I2C_TMCTL_HTCTL_Msk (0x1fful << I2C_TMCTL_HTCTL_Pos) /*!< I2C_T::TMCTL: HTCTL Mask */ - -#define I2C_BUSCTL_ACKMEN_Pos (0) /*!< I2C_T::BUSCTL: ACKMEN Position */ -#define I2C_BUSCTL_ACKMEN_Msk (0x1ul << I2C_BUSCTL_ACKMEN_Pos) /*!< I2C_T::BUSCTL: ACKMEN Mask */ - -#define I2C_BUSCTL_PECEN_Pos (1) /*!< I2C_T::BUSCTL: PECEN Position */ -#define I2C_BUSCTL_PECEN_Msk (0x1ul << I2C_BUSCTL_PECEN_Pos) /*!< I2C_T::BUSCTL: PECEN Mask */ - -#define I2C_BUSCTL_BMDEN_Pos (2) /*!< I2C_T::BUSCTL: BMDEN Position */ -#define I2C_BUSCTL_BMDEN_Msk (0x1ul << I2C_BUSCTL_BMDEN_Pos) /*!< I2C_T::BUSCTL: BMDEN Mask */ - -#define I2C_BUSCTL_BMHEN_Pos (3) /*!< I2C_T::BUSCTL: BMHEN Position */ -#define I2C_BUSCTL_BMHEN_Msk (0x1ul << I2C_BUSCTL_BMHEN_Pos) /*!< I2C_T::BUSCTL: BMHEN Mask */ - -#define I2C_BUSCTL_ALERTEN_Pos (4) /*!< I2C_T::BUSCTL: ALERTEN Position */ -#define I2C_BUSCTL_ALERTEN_Msk (0x1ul << I2C_BUSCTL_ALERTEN_Pos) /*!< I2C_T::BUSCTL: ALERTEN Mask */ - -#define I2C_BUSCTL_SCTLOSTS_Pos (5) /*!< I2C_T::BUSCTL: SCTLOSTS Position */ -#define I2C_BUSCTL_SCTLOSTS_Msk (0x1ul << I2C_BUSCTL_SCTLOSTS_Pos) /*!< I2C_T::BUSCTL: SCTLOSTS Mask */ - -#define I2C_BUSCTL_SCTLOEN_Pos (6) /*!< I2C_T::BUSCTL: SCTLOEN Position */ -#define I2C_BUSCTL_SCTLOEN_Msk (0x1ul << I2C_BUSCTL_SCTLOEN_Pos) /*!< I2C_T::BUSCTL: SCTLOEN Mask */ - -#define I2C_BUSCTL_BUSEN_Pos (7) /*!< I2C_T::BUSCTL: BUSEN Position */ -#define I2C_BUSCTL_BUSEN_Msk (0x1ul << I2C_BUSCTL_BUSEN_Pos) /*!< I2C_T::BUSCTL: BUSEN Mask */ - -#define I2C_BUSCTL_PECTXEN_Pos (8) /*!< I2C_T::BUSCTL: PECTXEN Position */ -#define I2C_BUSCTL_PECTXEN_Msk (0x1ul << I2C_BUSCTL_PECTXEN_Pos) /*!< I2C_T::BUSCTL: PECTXEN Mask */ - -#define I2C_BUSCTL_TIDLE_Pos (9) /*!< I2C_T::BUSCTL: TIDLE Position */ -#define I2C_BUSCTL_TIDLE_Msk (0x1ul << I2C_BUSCTL_TIDLE_Pos) /*!< I2C_T::BUSCTL: TIDLE Mask */ - -#define I2C_BUSCTL_PECCLR_Pos (10) /*!< I2C_T::BUSCTL: PECCLR Position */ -#define I2C_BUSCTL_PECCLR_Msk (0x1ul << I2C_BUSCTL_PECCLR_Pos) /*!< I2C_T::BUSCTL: PECCLR Mask */ - -#define I2C_BUSCTL_ACKM9SI_Pos (11) /*!< I2C_T::BUSCTL: ACKM9SI Position */ -#define I2C_BUSCTL_ACKM9SI_Msk (0x1ul << I2C_BUSCTL_ACKM9SI_Pos) /*!< I2C_T::BUSCTL: ACKM9SI Mask */ - -#define I2C_BUSCTL_BCDIEN_Pos (12) /*!< I2C_T::BUSCTL: BCDIEN Position */ -#define I2C_BUSCTL_BCDIEN_Msk (0x1ul << I2C_BUSCTL_BCDIEN_Pos) /*!< I2C_T::BUSCTL: BCDIEN Mask */ - -#define I2C_BUSCTL_PECDIEN_Pos (13) /*!< I2C_T::BUSCTL: PECDIEN Position */ -#define I2C_BUSCTL_PECDIEN_Msk (0x1ul << I2C_BUSCTL_PECDIEN_Pos) /*!< I2C_T::BUSCTL: PECDIEN Mask */ - -#define I2C_BUSTCTL_BUSTOEN_Pos (0) /*!< I2C_T::BUSTCTL: BUSTOEN Position */ -#define I2C_BUSTCTL_BUSTOEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOEN Mask */ - -#define I2C_BUSTCTL_CLKTOEN_Pos (1) /*!< I2C_T::BUSTCTL: CLKTOEN Position */ -#define I2C_BUSTCTL_CLKTOEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOEN Mask */ - -#define I2C_BUSTCTL_BUSTOIEN_Pos (2) /*!< I2C_T::BUSTCTL: BUSTOIEN Position */ -#define I2C_BUSTCTL_BUSTOIEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOIEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOIEN Mask */ - -#define I2C_BUSTCTL_CLKTOIEN_Pos (3) /*!< I2C_T::BUSTCTL: CLKTOIEN Position */ -#define I2C_BUSTCTL_CLKTOIEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOIEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOIEN Mask */ - -#define I2C_BUSTCTL_TORSTEN_Pos (4) /*!< I2C_T::BUSTCTL: TORSTEN Position */ -#define I2C_BUSTCTL_TORSTEN_Msk (0x1ul << I2C_BUSTCTL_TORSTEN_Pos) /*!< I2C_T::BUSTCTL: TORSTEN Mask */ - -#define I2C_BUSSTS_BUSY_Pos (0) /*!< I2C_T::BUSSTS: BUSY Position */ -#define I2C_BUSSTS_BUSY_Msk (0x1ul << I2C_BUSSTS_BUSY_Pos) /*!< I2C_T::BUSSTS: BUSY Mask */ - -#define I2C_BUSSTS_BCDONE_Pos (1) /*!< I2C_T::BUSSTS: BCDONE Position */ -#define I2C_BUSSTS_BCDONE_Msk (0x1ul << I2C_BUSSTS_BCDONE_Pos) /*!< I2C_T::BUSSTS: BCDONE Mask */ - -#define I2C_BUSSTS_PECERR_Pos (2) /*!< I2C_T::BUSSTS: PECERR Position */ -#define I2C_BUSSTS_PECERR_Msk (0x1ul << I2C_BUSSTS_PECERR_Pos) /*!< I2C_T::BUSSTS: PECERR Mask */ - -#define I2C_BUSSTS_ALERT_Pos (3) /*!< I2C_T::BUSSTS: ALERT Position */ -#define I2C_BUSSTS_ALERT_Msk (0x1ul << I2C_BUSSTS_ALERT_Pos) /*!< I2C_T::BUSSTS: ALERT Mask */ - -#define I2C_BUSSTS_SCTLDIN_Pos (4) /*!< I2C_T::BUSSTS: SCTLDIN Position */ -#define I2C_BUSSTS_SCTLDIN_Msk (0x1ul << I2C_BUSSTS_SCTLDIN_Pos) /*!< I2C_T::BUSSTS: SCTLDIN Mask */ - -#define I2C_BUSSTS_BUSTO_Pos (5) /*!< I2C_T::BUSSTS: BUSTO Position */ -#define I2C_BUSSTS_BUSTO_Msk (0x1ul << I2C_BUSSTS_BUSTO_Pos) /*!< I2C_T::BUSSTS: BUSTO Mask */ - -#define I2C_BUSSTS_CLKTO_Pos (6) /*!< I2C_T::BUSSTS: CLKTO Position */ -#define I2C_BUSSTS_CLKTO_Msk (0x1ul << I2C_BUSSTS_CLKTO_Pos) /*!< I2C_T::BUSSTS: CLKTO Mask */ - -#define I2C_BUSSTS_PECDONE_Pos (7) /*!< I2C_T::BUSSTS: PECDONE Position */ -#define I2C_BUSSTS_PECDONE_Msk (0x1ul << I2C_BUSSTS_PECDONE_Pos) /*!< I2C_T::BUSSTS: PECDONE Mask */ - -#define I2C_PKTSIZE_PLDSIZE_Pos (0) /*!< I2C_T::PKTSIZE: PLDSIZE Position */ -#define I2C_PKTSIZE_PLDSIZE_Msk (0x1fful << I2C_PKTSIZE_PLDSIZE_Pos) /*!< I2C_T::PKTSIZE: PLDSIZE Mask */ - -#define I2C_PKTCRC_PECCRC_Pos (0) /*!< I2C_T::PKTCRC: PECCRC Position */ -#define I2C_PKTCRC_PECCRC_Msk (0xfful << I2C_PKTCRC_PECCRC_Pos) /*!< I2C_T::PKTCRC: PECCRC Mask */ - -#define I2C_BUSTOUT_BUSTO_Pos (0) /*!< I2C_T::BUSTOUT: BUSTO Position */ -#define I2C_BUSTOUT_BUSTO_Msk (0xfful << I2C_BUSTOUT_BUSTO_Pos) /*!< I2C_T::BUSTOUT: BUSTO Mask */ - -#define I2C_CLKTOUT_CLKTO_Pos (0) /*!< I2C_T::CLKTOUT: CLKTO Position */ -#define I2C_CLKTOUT_CLKTO_Msk (0xfful << I2C_CLKTOUT_CLKTO_Pos) /*!< I2C_T::CLKTOUT: CLKTO Mask */ - -/**@}*/ /* I2C_CONST */ -/**@}*/ /* end of I2C register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __I2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2s_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2s_reg.h deleted file mode 100644 index 82bf14940cf..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/i2s_reg.h +++ /dev/null @@ -1,707 +0,0 @@ -/**************************************************************************//** - * @file i2s_reg.h - * @version V3.00 - * @brief I2S register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __I2S_REG_H__ -#define __I2S_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup I2S I2S Interface Controller(I2S) - Memory Mapped Structure for I2S Controller -@{ */ - -typedef struct -{ - - - /** - * @var I2S_T::CTL0 - * Offset: 0x00 I2S Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SEN |I2S Controller Enable Control - * | | |0 = I2S controller Disabled. - * | | |1 = I2S controller Enabled. - * |[1] |TXEN |Transmit Enable Control - * | | |0 = Data transmission Disabled. - * | | |1 = Data transmission Enabled. - * |[2] |RXEN |Receive Enable Control - * | | |0 = Data receiving Disabled. - * | | |1 = Data receiving Enabled. - * |[3] |MUTE |Transmit Mute Enable Control - * | | |0 = Transmit data is shifted from buffer. - * | | |1 = Send zero on transmit channel. - * |[5:4] |DATWIDTH |Data Width - * | | |This bit field is used to define the bit-width of data word in each audio channel - * | | |00 = The bit-width of data word is 8-bit. - * | | |01 = The bit-width of data word is 16-bit. - * | | |10 = The bit-width of data word is 24-bit. - * | | |11 = The bit-width of data word is 32-bit. - * |[6] |MONO |Monaural Data Control - * | | |0 = Data is stereo format. - * | | |1 = Data is monaural format. - * | | |Note: when chip records data, RXLCH (I2S_CTL0[23]) indicates which channel data will be saved if monaural format is selected. - * |[7] |ORDER |Stereo Data Order in FIFO - * | | |In 8-bit/16-bit data width, this bit is used to select whether the even or odd channel data is stored in higher byte - * | | |In 24-bit data width, this is used to select the left/right alignment method of audio data which is stored in data memory consisted of 32-bit FIFO entries. - * | | |0 = Even channel data at high byte in 8-bit/16-bit data width. - * | | |LSB of 24-bit audio data in each channel is aligned to right side in 32-bit FIFO entries. - * | | |1 = Even channel data at low byte. - * | | | MSB of 24-bit audio data in each channel is aligned to left side in 32-bit FIFO entries. - * |[8] |SLAVE |Slave Mode Enable Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * | | |Note: I2S can operate as master or slave - * | | |For Master mode, I2S_BCLK and I2S_LRCLK pins are output mode and send out bit clock to Audio CODEC chip - * | | |In Slave mode, I2S_BCLK and I2S_LRCLK pins are input mode and I2S_BCLK and I2S_LRCLK signals are received from outer Audio CODEC chip. - * |[15] |MCLKEN |Master Clock Enable Control - * | | |If MCLKEN is set to 1, I2S controller will generate master clock on I2S_MCLK pin for external audio devices. - * | | |0 = Master clock Disabled. - * | | |1 = Master clock Enabled. - * |[18] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No Effect. - * | | |1 = Clear TX FIFO. - * | | |Note1: Write 1 to clear transmit FIFO, internal pointer is reset to FIFO start point, and TXCNT (I2S_STATUS1[12:8]) returns 0 and transmit FIFO becomes empty but data in transmit FIFO is not changed. - * | | |Note2: This bit is clear by hardware automatically, read it return zero. - * |[19] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No Effect. - * | | |1 = Clear RX FIFO. - * | | |Note1: Write 1 to clear receive FIFO, internal pointer is reset to FIFO start point, and RXCNT (I2S_STATUS1[20:16]) returns 0 and receive FIFO becomes empty. - * | | |Note2: This bit is cleared by hardware automatically, read it return zero. - * |[20] |TXPDMAEN |Transmit PDMA Enable Control - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[21] |RXPDMAEN |Receive PDMA Enable Control - * | | |0 = Receiver PDMA function Disabled. - * | | |1 = Receiver PDMA function Enabled. - * |[23] |RXLCH |Receive Left Channel Enable Control - * | | |When monaural format is selected (MONO = 1), I2S will receive channel1 data if RXLCH is set to 0, and receive channel0 data if RXLCH is set to 1. - * | | |0 = Receives channel1 data in MONO mode. - * | | |1 = Receives channel0 data in MONO mode. - * |[26:24] |FORMAT |Data Format Selection - * | | |000 = I2S standard data format. - * | | |001 = I2S with MSB justified. - * | | |010 = I2S with LSB justified. - * | | |011 = Reserved. - * | | |100 = PCM standard data format. - * | | |101 = PCM with MSB justified. - * | | |110 = PCM with LSB justified. - * | | |111 = Reserved. - * |[27] |PCMSYNC |PCM Synchronization Pulse Length Selection - * | | |This bit field is used to select the high pulse length of frame synchronization signal in PCM protocol - * | | |0 = One BCLK period. - * | | |1 = One channel period. - * | | |Note: This bit is only available in master mode - * |[29:28] |CHWIDTH |Channel Width - * | | |This bit fields are used to define the length of audio channel - * | | |If CHWIDTH < DATWIDTH, the hardware will set the real channel length as the bit-width of audio data which is defined by DATWIDTH. - * | | |00 = The bit-width of each audio channel is 8-bit. - * | | |01 = The bit-width of each audio channel is 16-bit. - * | | |10 = The bit-width of each audio channel is 24-bit. - * | | |11 = The bit-width of each audio channel is 32-bit. - * |[31:30] |TDMCHNUM |TDM Channel Number - * | | |This bit fields are used to define the TDM channel number in one audio frame while PCM mode (FORMAT[2] = 1). - * | | |00 = 2 channels in audio frame. - * | | |01 = 4 channels in audio frame. - * | | |10 = 6 channels in audio frame. - * | | |11 = 8 channels in audio frame. - * @var I2S_T::CLKDIV - * Offset: 0x04 I2S Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |MCLKDIV |Master Clock Divider - * | | |If chip external crystal frequency is (2xMCLKDIV)*256fs then software can program these bits to generate 256fs clock frequency to audio codec chip - * | | |If MCLKDIV is set to 0, MCLK is the same as external clock input. - * | | |For example, sampling rate is 24 kHz and chip external crystal clock is 12.288 MHz, set MCLKDIV = 1. - * | | |F_MCLK = F_I2SCLK/(2x(MCLKDIV)) (When MCLKDIV is >= 1 ). - * | | |F_MCLK = F_I2SCLK (When MCLKDIV is set to 0 ). - * | | |Note: F_MCLK is the frequency of MCLK, and F_I2SCLK is the frequency of the I2S_CLK - * |[16:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode - * | | |Software can program these bit fields to generate sampling rate clock frequency. - * | | |F_BCLK= F_I2SCLK / (2*(BCLKDIV + 1)). - * | | |Note: F_BCLK is the frequency of BCLK and F_I2SCLK is the frequency of I2S_CLK - * @var I2S_T::IEN - * Offset: 0x08 I2S Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXUDFIEN |Receive FIFO Underflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: If software reads receive FIFO when it is empty then RXUDIF (I2S_STATUS0[8]) flag is set to 1. - * |[1] |RXOVFIEN |Receive FIFO Overflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and RXOVIF (I2S_STATUS0[9]) flag is set to 1 - * |[2] |RXTHIEN |Receive FIFO Threshold Level Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: When data word in receive FIFO is equal or higher than RXTH (I2S_CTL1[19:16]) and the RXTHIF (I2S_STATUS0[10]) bit is set to 1 - * | | |If RXTHIEN bit is enabled, interrupt occur. - * |[8] |TXUDFIEN |Transmit FIFO Underflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occur if this bit is set to 1 and TXUDIF (I2S_STATUS0[16]) flag is set to 1. - * |[9] |TXOVFIEN |Transmit FIFO Overflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and TXOVIF (I2S_STATUS0[17]) flag is set to 1 - * |[10] |TXTHIEN |Transmit FIFO Threshold Level Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and data words in transmit FIFO is less than TXTH (I2S_CTL1[11:8]). - * |[16] |CH0ZCIEN |Channel0 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel0 zero-cross - * | | |Note2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[17] |CH1ZCIEN |Channel1 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel1 zero-cross - * | | |Note2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[18] |CH2ZCIEN |Channel2 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel2 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[19] |CH3ZCIEN |Channel3 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel3 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[20] |CH4ZCIEN |Channel4 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel4 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[21] |CH5ZCIEN |Channel5 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel5 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[22] |CH6ZCIEN |Channel6 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel6 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[23] |CH7ZCIEN |Channel7 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel7 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * @var I2S_T::STATUS0 - * Offset: 0x0C I2S Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SINT |I2S Interrupt Flag (Read Only) - * | | |0 = No I2S interrupt. - * | | |1 = I2S interrupt. - * | | |Note: It is wire-OR of I2STXINT and I2SRXINT bits. - * |[1] |I2SRXINT |I2S Receive Interrupt (Read Only) - * | | |0 = No receive interrupt. - * | | |1 = Receive interrupt. - * |[2] |I2STXINT |I2S Transmit Interrupt (Read Only) - * | | |0 = No transmit interrupt. - * | | |1 = Transmit interrupt. - * |[5:3] |DATACH |Transmission Data Channel (Read Only) - * | | |This bit fields are used to indicate which audio channel is current transmit data belong. - * | | |000 = channel0 (means left channel while 2-channel I2S/PCM mode). - * | | |001 = channel1 (means right channel while 2-channel I2S/PCM mode). - * | | |010 = channel2 (available while 4-channel TDM PCM mode). - * | | |011 = channel3 (available while 4-channel TDM PCM mode). - * | | |100 = channel4 (available while 6-channel TDM PCM mode). - * | | |101 = channel5 (available while 6-channel TDM PCM mode). - * | | |110 = channel6 (available while 8-channel TDM PCM mode). - * | | |111 = channel7 (available while 8-channel TDM PCM mode). - * |[8] |RXUDIF |Receive FIFO Underflow Interrupt Flag - * | | |0 = No underflow occur. - * | | |1 = Underflow occur. - * | | |Note1: When receive FIFO is empty, and software reads the receive FIFO again - * | | |This bit will be set to 1, and it indicates underflow situation occurs. - * | | |Note2: Write 1 to clear this bit to zero - * |[9] |RXOVIF |Receive FIFO Overflow Interrupt Flag - * | | |0 = No overflow occur. - * | | |1 = Overflow occur. - * | | |Note1: When receive FIFO is full and receive hardware attempt to write data into receive FIFO then this bit is set to 1, data in 1st buffer is overwrote. - * | | |Note2: Write 1 to clear this bit to 0. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is not higher than threshold level. - * | | |1 = Data word(s) in FIFO is higher than threshold level. - * | | |Note: When data word(s) in receive FIFO is higher than threshold value set in RXTH (I2S_CTL1[19:16]) the RXTHIF bit becomes to 1 - * | | |It keeps at 1 till RXCNT (I2S_STATUS1[20:16]) is not higher than RXTH (I2S_CTL1[19:16]) after software read RXFIFO register. - * |[11] |RXFULL |Receive FIFO Full (Read Only) - * | | |0 = Not full. - * | | |1 = Full. - * | | |Note: This bit reflects data words number in receive FIFO is 16. - * |[12] |RXEMPTY |Receive FIFO Empty (Read Only) - * | | |0 = Not empty. - * | | |1 = Empty. - * | | |Note: This bit reflects data words number in receive FIFO is zero - * |[16] |TXUDIF |Transmit FIFO Underflow Interrupt Flag - * | | |0 = No underflow. - * | | |1 = Underflow. - * | | |Note1: This bit will be set to 1 when shift logic hardware read data from transmitting FIFO and the filling data level in transmitting FIFO is not enough for one audio frame. - * | | |Note2: Write 1 to clear this bit to 0. - * |[17] |TXOVIF |Transmit FIFO Overflow Interrupt Flag - * | | |0 = No overflow. - * | | |1 = Overflow. - * | | |Note1: Write data to transmit FIFO when it is full and this bit set to 1 - * | | |Note2: Write 1 to clear this bit to 0. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is higher than threshold level. - * | | |1 = Data word(s) in FIFO is equal or lower than threshold level. - * | | |Note: When data word(s) in transmit FIFO is equal or lower than threshold value set in TXTH (I2S_CTL1[11:8]) the TXTHIF bit becomes to 1 - * | | |It keeps at 1 till TXCNT (I2S_STATUS1[12:8]) is higher than TXTH (I2S_CTL1[11:8]) after software write TXFIFO register. - * |[19] |TXFULL |Transmit FIFO Full (Read Only) - * | | |This bit reflect data word number in transmit FIFO is 16 - * | | |0 = Not full. - * | | |1 = Full. - * |[20] |TXEMPTY |Transmit FIFO Empty (Read Only) - * | | |This bit reflect data word number in transmit FIFO is zero - * | | |0 = Not empty. - * | | |1 = Empty. - * |[21] |TXBUSY |Transmit Busy (Read Only) - * | | |0 = Transmit shift buffer is empty. - * | | |1 = Transmit shift buffer is busy. - * | | |Note: This bit is cleared to 0 when all data in transmit FIFO and shift buffer is shifted out - * | | |And set to 1 when 1st data is load to shift buffer - * @var I2S_T::TXFIFO - * Offset: 0x10 I2S Transmit FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXFIFO |Transmit FIFO Bits - * | | |I2S contains 16 words (16x32 bit) data buffer for data transmit - * | | |Write data to this register to prepare data for transmit - * | | |The remaining word number is indicated by TXCNT (I2S_STATUS1[12:8]). - * @var I2S_T::RXFIFO - * Offset: 0x14 I2S Receive FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXFIFO |Receive FIFO Bits - * | | |I2S contains 16 words (16x32 bit) data buffer for data receive - * | | |Read this register to get data in FIFO - * | | |The remaining data word number is indicated by RXCNT (I2S_STATUS1[20:16]). - * @var I2S_T::CTL1 - * Offset: 0x20 I2S Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCEN |Channel0 Zero-cross Detection Enable Control - * | | |0 = channel0 zero-cross detect Disabled. - * | | |1 = channel0 zero-cross detect Enabled. - * | | |Note1: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note2: If this bit is set to 1, when channel0 data sign bit change or next shift data bits are all zero then CH0ZCIF(I2S_STATUS1[0]) flag is set to 1. - * | | |Note3: If CH0ZCIF Flag is set to 1, the channel0 will be mute. - * |[1] |CH1ZCEN |Channel1 Zero-cross Detect Enable Control - * | | |0 = channel1 zero-cross detect Disabled. - * | | |1 = channel1 zero-cross detect Enabled. - * | | |Note1: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note2: If this bit is set to 1, when channel1 data sign bit change or next shift data bits are all zero then CH1ZCIF(I2S_STATUS1[1]) flag is set to 1. - * | | |Note3: If CH1ZCIF Flag is set to 1, the channel1 will be mute. - * |[2] |CH2ZCEN |Channel2 Zero-cross Detect Enable Control - * | | |0 = channel2 zero-cross detect Disabled. - * | | |1 = channel2 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel2 data sign bit change or next shift data bits are all zero then CH2ZCIF(I2S_STATUS1[2]) flag is set to 1. - * | | |Note3: If CH2ZCIF Flag is set to 1, the channel2 will be mute. - * |[3] |CH3ZCEN |Channel3 Zero-cross Detect Enable Control - * | | |0 = channel3 zero-cross detect Disabled. - * | | |1 = channel3 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel3 data sign bit change or next shift data bits are all zero then CH3ZCIF(I2S_STATUS1[3]) flag is set to 1. - * | | |Note3: If CH3ZCIF Flag is set to 1, the channel3 will be mute. - * |[4] |CH4ZCEN |Channel4 Zero-cross Detect Enable Control - * | | |0 = channel4 zero-cross detect Disabled. - * | | |1 = channel4 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel4 data sign bit change or next shift data bits are all zero then CH4ZCIF(I2S_STATUS1[4]) flag is set to 1. - * | | |Note3: If CH4ZCIF Flag is set to 1, the channel4 will be mute. - * |[5] |CH5ZCEN |Channel5 Zero-cross Detect Enable Control - * | | |0 = channel5 zero-cross detect Disabled. - * | | |1 = channel5 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel5 data sign bit change or next shift data bits are all zero then CH5ZCIF(I2S_STATUS1[5]) flag is set to 1. - * | | |Note3: If CH5ZCIF Flag is set to 1, the channel5 will be mute. - * |[6] |CH6ZCEN |Channel6 Zero-cross Detect Enable Control - * | | |0 = channel6 zero-cross detect Disabled. - * | | |1 = channel6 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel6 data sign bit change or next shift data bits are all zero then CH6ZCIF(I2S_STATUS1[6]) flag is set to 1. - * | | |Note3: If CH6ZCIF Flag is set to 1, the channel6 will be mute. - * |[7] |CH7ZCEN |Channel7 Zero-cross Detect Enable Control - * | | |0 = channel7 zero-cross detect Disabled. - * | | |1 = channel7 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel7 data sign bit change or next shift data bits are all zero then CH7ZCIF (I2S_STATUS1[7]) flag is set to 1. - * | | |Note3: If CH7ZCIF Flag is set to 1, the channel7 will be mute. - * |[11:8] |TXTH |Transmit FIFO Threshold Level - * | | |0000 = 0 data word in transmit FIFO. - * | | |0001 = 1 data word in transmit FIFO. - * | | |0010 = 2 data words in transmit FIFO. - * | | |... - * | | |1110 = 14 data words in transmit FIFO. - * | | |1111 = 15 data words in transmit FIFO. - * | | |Note: If remain data word number in transmit FIFO is the same or less than threshold level then TXTHIF (I2S_STATUS0[18]) flag is set. - * |[19:16] |RXTH |Receive FIFO Threshold Level - * | | |0000 = 1 data word in receive FIFO. - * | | |0001 = 2 data words in receive FIFO. - * | | |0010 = 3 data words in receive FIFO. - * | | |... - * | | |1110 = 15 data words in receive FIFO. - * | | |1111 = 16 data words in receive FIFO. - * | | |Note: When received data word number in receive buffer is greater than threshold level then RXTHIF (I2S_STATUS0[10]) flag is set. - * |[24] |PBWIDTH |Peripheral Bus Data Width Selection - * | | |This bit is used to choice the available data width of APB bus - * | | |It must be set to 1 while PDMA function is enable and it is set to 16-bit transmission mode - * | | |0 = 32 bits data width. - * | | |1 = 16 bits data width. - * | | |Note1: If PBWIDTH=1, the low 16 bits of 32-bit data bus are available. - * | | |Note2: If PBWIDTH=1, the transmitting FIFO level will be increased after two FIFO write operations. - * | | |Note3: If PBWIDTH=1, the receiving FIFO level will be decreased after two FIFO read operations. - * |[25] |PB16ORD |FIFO Read/Write Order in 16-bit Width of Peripheral Bus - * | | |When PBWIDTH = 1, the data FIFO will be increased or decreased by two peripheral bus access - * | | |This bit is used to select the order of FIFO access operations to meet the 32-bit transmitting/receiving FIFO entries. - * | | |0 = Low 16-bit read/write access first. - * | | |1 = High 16-bit read/write access first. - * | | |Note: This bit is available while PBWIDTH = 1. - * @var I2S_T::STATUS1 - * Offset: 0x24 I2S Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCIF |Channel0 Zero-cross Interrupt Flag - * | | |It indicates channel0 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel0. - * | | |1 = Channel0 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[1] |CH1ZCIF |Channel1 Zero-cross Interrupt Flag - * | | |It indicates channel1 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel1. - * | | |1 = Channel1 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[2] |CH2ZCIF |Channel2 Zero-cross Interrupt Flag - * | | |It indicates channel2 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel2. - * | | |1 = Channel2 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[3] |CH3ZCIF |Channel3 Zero-cross Interrupt Flag - * | | |It indicates channel3 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel3. - * | | |1 = Channel3 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[4] |CH4ZCIF |Channel4 Zero-cross Interrupt Flag - * | | |It indicates channel4 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel4. - * | | |1 = Channel4 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[5] |CH5ZCIF |Channel5 Zero-cross Interrupt Flag - * | | |It indicates channel5 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel5. - * | | |1 = Channel5 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[6] |CH6ZCIF |Channel6 Zero-cross Interrupt Flag - * | | |It indicates channel6 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel6. - * | | |1 = Channel6 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[7] |CH7ZCIF |Channel7 Zero-cross Interrupt Flag - * | | |It indicates channel7 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel7. - * | | |1 = Channel7 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[12:8] |TXCNT |Transmit FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in transmit FIFO - * | | |00000 = No data. - * | | |00001 = 1 word in transmit FIFO. - * | | |00010 = 2 words in transmit FIFO. - * | | |... - * | | |01110 = 14 words in transmit FIFO. - * | | |01111 = 15 words in transmit FIFO. - * | | |10000 = 16 words in transmit FIFO. - * | | |Others are reserved. - * |[20:16] |RXCNT |Receive FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in receive FIFO - * | | |00000 = No data. - * | | |00001 = 1 word in receive FIFO. - * | | |00010 = 2 words in receive FIFO. - * | | |... - * | | |01110 = 14 words in receive FIFO. - * | | |01111 = 15 words in receive FIFO. - * | | |10000 = 16 words in receive FIFO. - * | | |Others are reserved. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2S Control Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0004] I2S Clock Divider Register */ - __IO uint32_t IEN; /*!< [0x0008] I2S Interrupt Enable Register */ - __IO uint32_t STATUS0; /*!< [0x000c] I2S Status Register 0 */ - __O uint32_t TXFIFO; /*!< [0x0010] I2S Transmit FIFO Register */ - __I uint32_t RXFIFO; /*!< [0x0014] I2S Receive FIFO Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL1; /*!< [0x0020] I2S Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0024] I2S Status Register 1 */ - -} I2S_T; - -/** - @addtogroup I2S_CONST I2S Bit Field Definition - Constant Definitions for I2S Controller -@{ */ - -#define I2S_CTL0_I2SEN_Pos (0) /*!< I2S_T::CTL0: I2SEN Position */ -#define I2S_CTL0_I2SEN_Msk (0x1ul << I2S_CTL0_I2SEN_Pos) /*!< I2S_T::CTL0: I2SEN Mask */ - -#define I2S_CTL0_TXEN_Pos (1) /*!< I2S_T::CTL0: TXEN Position */ -#define I2S_CTL0_TXEN_Msk (0x1ul << I2S_CTL0_TXEN_Pos) /*!< I2S_T::CTL0: TXEN Mask */ - -#define I2S_CTL0_RXEN_Pos (2) /*!< I2S_T::CTL0: RXEN Position */ -#define I2S_CTL0_RXEN_Msk (0x1ul << I2S_CTL0_RXEN_Pos) /*!< I2S_T::CTL0: RXEN Mask */ - -#define I2S_CTL0_MUTE_Pos (3) /*!< I2S_T::CTL0: MUTE Position */ -#define I2S_CTL0_MUTE_Msk (0x1ul << I2S_CTL0_MUTE_Pos) /*!< I2S_T::CTL0: MUTE Mask */ - -#define I2S_CTL0_DATWIDTH_Pos (4) /*!< I2S_T::CTL0: DATWIDTH Position */ -#define I2S_CTL0_DATWIDTH_Msk (0x3ul << I2S_CTL0_DATWIDTH_Pos) /*!< I2S_T::CTL0: DATWIDTH Mask */ - -#define I2S_CTL0_MONO_Pos (6) /*!< I2S_T::CTL0: MONO Position */ -#define I2S_CTL0_MONO_Msk (0x1ul << I2S_CTL0_MONO_Pos) /*!< I2S_T::CTL0: MONO Mask */ - -#define I2S_CTL0_ORDER_Pos (7) /*!< I2S_T::CTL0: ORDER Position */ -#define I2S_CTL0_ORDER_Msk (0x1ul << I2S_CTL0_ORDER_Pos) /*!< I2S_T::CTL0: ORDER Mask */ - -#define I2S_CTL0_SLAVE_Pos (8) /*!< I2S_T::CTL0: SLAVE Position */ -#define I2S_CTL0_SLAVE_Msk (0x1ul << I2S_CTL0_SLAVE_Pos) /*!< I2S_T::CTL0: SLAVE Mask */ - -#define I2S_CTL0_MCLKEN_Pos (15) /*!< I2S_T::CTL0: MCLKEN Position */ -#define I2S_CTL0_MCLKEN_Msk (0x1ul << I2S_CTL0_MCLKEN_Pos) /*!< I2S_T::CTL0: MCLKEN Mask */ - -#define I2S_CTL0_TXFBCLR_Pos (18) /*!< I2S_T::CTL0: TXFBCLR Position */ -#define I2S_CTL0_TXFBCLR_Msk (0x1ul << I2S_CTL0_TXFBCLR_Pos) /*!< I2S_T::CTL0: TXFBCLR Mask */ - -#define I2S_CTL0_RXFBCLR_Pos (19) /*!< I2S_T::CTL0: RXFBCLR Position */ -#define I2S_CTL0_RXFBCLR_Msk (0x1ul << I2S_CTL0_RXFBCLR_Pos) /*!< I2S_T::CTL0: RXFBCLR Mask */ - -#define I2S_CTL0_TXPDMAEN_Pos (20) /*!< I2S_T::CTL0: TXPDMAEN Position */ -#define I2S_CTL0_TXPDMAEN_Msk (0x1ul << I2S_CTL0_TXPDMAEN_Pos) /*!< I2S_T::CTL0: TXPDMAEN Mask */ - -#define I2S_CTL0_RXPDMAEN_Pos (21) /*!< I2S_T::CTL0: RXPDMAEN Position */ -#define I2S_CTL0_RXPDMAEN_Msk (0x1ul << I2S_CTL0_RXPDMAEN_Pos) /*!< I2S_T::CTL0: RXPDMAEN Mask */ - -#define I2S_CTL0_RXLCH_Pos (23) /*!< I2S_T::CTL0: RXLCH Position */ -#define I2S_CTL0_RXLCH_Msk (0x1ul << I2S_CTL0_RXLCH_Pos) /*!< I2S_T::CTL0: RXLCH Mask */ - -#define I2S_CTL0_FORMAT_Pos (24) /*!< I2S_T::CTL0: FORMAT Position */ -#define I2S_CTL0_FORMAT_Msk (0x7ul << I2S_CTL0_FORMAT_Pos) /*!< I2S_T::CTL0: FORMAT Mask */ - -#define I2S_CTL0_PCMSYNC_Pos (27) /*!< I2S_T::CTL0: PCMSYNC Position */ -#define I2S_CTL0_PCMSYNC_Msk (0x1ul << I2S_CTL0_PCMSYNC_Pos) /*!< I2S_T::CTL0: PCMSYNC Mask */ - -#define I2S_CTL0_CHWIDTH_Pos (28) /*!< I2S_T::CTL0: CHWIDTH Position */ -#define I2S_CTL0_CHWIDTH_Msk (0x3ul << I2S_CTL0_CHWIDTH_Pos) /*!< I2S_T::CTL0: CHWIDTH Mask */ - -#define I2S_CTL0_TDMCHNUM_Pos (30) /*!< I2S_T::CTL0: TDMCHNUM Position */ -#define I2S_CTL0_TDMCHNUM_Msk (0x3ul << I2S_CTL0_TDMCHNUM_Pos) /*!< I2S_T::CTL0: TDMCHNUM Mask */ - -#define I2S_CLKDIV_MCLKDIV_Pos (0) /*!< I2S_T::CLKDIV: MCLKDIV Position */ -#define I2S_CLKDIV_MCLKDIV_Msk (0x3ful << I2S_CLKDIV_MCLKDIV_Pos) /*!< I2S_T::CLKDIV: MCLKDIV Mask */ - -#define I2S_CLKDIV_BCLKDIV_Pos (8) /*!< I2S_T::CLKDIV: BCLKDIV Position */ -#define I2S_CLKDIV_BCLKDIV_Msk (0x1fful << I2S_CLKDIV_BCLKDIV_Pos) /*!< I2S_T::CLKDIV: BCLKDIV Mask */ - -#define I2S_IEN_RXUDFIEN_Pos (0) /*!< I2S_T::IEN: RXUDFIEN Position */ -#define I2S_IEN_RXUDFIEN_Msk (0x1ul << I2S_IEN_RXUDFIEN_Pos) /*!< I2S_T::IEN: RXUDFIEN Mask */ - -#define I2S_IEN_RXOVFIEN_Pos (1) /*!< I2S_T::IEN: RXOVFIEN Position */ -#define I2S_IEN_RXOVFIEN_Msk (0x1ul << I2S_IEN_RXOVFIEN_Pos) /*!< I2S_T::IEN: RXOVFIEN Mask */ - -#define I2S_IEN_RXTHIEN_Pos (2) /*!< I2S_T::IEN: RXTHIEN Position */ -#define I2S_IEN_RXTHIEN_Msk (0x1ul << I2S_IEN_RXTHIEN_Pos) /*!< I2S_T::IEN: RXTHIEN Mask */ - -#define I2S_IEN_TXUDFIEN_Pos (8) /*!< I2S_T::IEN: TXUDFIEN Position */ -#define I2S_IEN_TXUDFIEN_Msk (0x1ul << I2S_IEN_TXUDFIEN_Pos) /*!< I2S_T::IEN: TXUDFIEN Mask */ - -#define I2S_IEN_TXOVFIEN_Pos (9) /*!< I2S_T::IEN: TXOVFIEN Position */ -#define I2S_IEN_TXOVFIEN_Msk (0x1ul << I2S_IEN_TXOVFIEN_Pos) /*!< I2S_T::IEN: TXOVFIEN Mask */ - -#define I2S_IEN_TXTHIEN_Pos (10) /*!< I2S_T::IEN: TXTHIEN Position */ -#define I2S_IEN_TXTHIEN_Msk (0x1ul << I2S_IEN_TXTHIEN_Pos) /*!< I2S_T::IEN: TXTHIEN Mask */ - -#define I2S_IEN_CH0ZCIEN_Pos (16) /*!< I2S_T::IEN: CH0ZCIEN Position */ -#define I2S_IEN_CH0ZCIEN_Msk (0x1ul << I2S_IEN_CH0ZCIEN_Pos) /*!< I2S_T::IEN: CH0ZCIEN Mask */ - -#define I2S_IEN_CH1ZCIEN_Pos (17) /*!< I2S_T::IEN: CH1ZCIEN Position */ -#define I2S_IEN_CH1ZCIEN_Msk (0x1ul << I2S_IEN_CH1ZCIEN_Pos) /*!< I2S_T::IEN: CH1ZCIEN Mask */ - -#define I2S_IEN_CH2ZCIEN_Pos (18) /*!< I2S_T::IEN: CH2ZCIEN Position */ -#define I2S_IEN_CH2ZCIEN_Msk (0x1ul << I2S_IEN_CH2ZCIEN_Pos) /*!< I2S_T::IEN: CH2ZCIEN Mask */ - -#define I2S_IEN_CH3ZCIEN_Pos (19) /*!< I2S_T::IEN: CH3ZCIEN Position */ -#define I2S_IEN_CH3ZCIEN_Msk (0x1ul << I2S_IEN_CH3ZCIEN_Pos) /*!< I2S_T::IEN: CH3ZCIEN Mask */ - -#define I2S_IEN_CH4ZCIEN_Pos (20) /*!< I2S_T::IEN: CH4ZCIEN Position */ -#define I2S_IEN_CH4ZCIEN_Msk (0x1ul << I2S_IEN_CH4ZCIEN_Pos) /*!< I2S_T::IEN: CH4ZCIEN Mask */ - -#define I2S_IEN_CH5ZCIEN_Pos (21) /*!< I2S_T::IEN: CH5ZCIEN Position */ -#define I2S_IEN_CH5ZCIEN_Msk (0x1ul << I2S_IEN_CH5ZCIEN_Pos) /*!< I2S_T::IEN: CH5ZCIEN Mask */ - -#define I2S_IEN_CH6ZCIEN_Pos (22) /*!< I2S_T::IEN: CH6ZCIEN Position */ -#define I2S_IEN_CH6ZCIEN_Msk (0x1ul << I2S_IEN_CH6ZCIEN_Pos) /*!< I2S_T::IEN: CH6ZCIEN Mask */ - -#define I2S_IEN_CH7ZCIEN_Pos (23) /*!< I2S_T::IEN: CH7ZCIEN Position */ -#define I2S_IEN_CH7ZCIEN_Msk (0x1ul << I2S_IEN_CH7ZCIEN_Pos) /*!< I2S_T::IEN: CH7ZCIEN Mask */ - -#define I2S_STATUS0_I2SINT_Pos (0) /*!< I2S_T::STATUS0: I2SINT Position */ -#define I2S_STATUS0_I2SINT_Msk (0x1ul << I2S_STATUS0_I2SINT_Pos) /*!< I2S_T::STATUS0: I2SINT Mask */ - -#define I2S_STATUS0_I2SRXINT_Pos (1) /*!< I2S_T::STATUS0: I2SRXINT Position */ -#define I2S_STATUS0_I2SRXINT_Msk (0x1ul << I2S_STATUS0_I2SRXINT_Pos) /*!< I2S_T::STATUS0: I2SRXINT Mask */ - -#define I2S_STATUS0_I2STXINT_Pos (2) /*!< I2S_T::STATUS0: I2STXINT Position */ -#define I2S_STATUS0_I2STXINT_Msk (0x1ul << I2S_STATUS0_I2STXINT_Pos) /*!< I2S_T::STATUS0: I2STXINT Mask */ - -#define I2S_STATUS0_DATACH_Pos (3) /*!< I2S_T::STATUS0: DATACH Position */ -#define I2S_STATUS0_DATACH_Msk (0x7ul << I2S_STATUS0_DATACH_Pos) /*!< I2S_T::STATUS0: DATACH Mask */ - -#define I2S_STATUS0_RXUDIF_Pos (8) /*!< I2S_T::STATUS0: RXUDIF Position */ -#define I2S_STATUS0_RXUDIF_Msk (0x1ul << I2S_STATUS0_RXUDIF_Pos) /*!< I2S_T::STATUS0: RXUDIF Mask */ - -#define I2S_STATUS0_RXOVIF_Pos (9) /*!< I2S_T::STATUS0: RXOVIF Position */ -#define I2S_STATUS0_RXOVIF_Msk (0x1ul << I2S_STATUS0_RXOVIF_Pos) /*!< I2S_T::STATUS0: RXOVIF Mask */ - -#define I2S_STATUS0_RXTHIF_Pos (10) /*!< I2S_T::STATUS0: RXTHIF Position */ -#define I2S_STATUS0_RXTHIF_Msk (0x1ul << I2S_STATUS0_RXTHIF_Pos) /*!< I2S_T::STATUS0: RXTHIF Mask */ - -#define I2S_STATUS0_RXFULL_Pos (11) /*!< I2S_T::STATUS0: RXFULL Position */ -#define I2S_STATUS0_RXFULL_Msk (0x1ul << I2S_STATUS0_RXFULL_Pos) /*!< I2S_T::STATUS0: RXFULL Mask */ - -#define I2S_STATUS0_RXEMPTY_Pos (12) /*!< I2S_T::STATUS0: RXEMPTY Position */ -#define I2S_STATUS0_RXEMPTY_Msk (0x1ul << I2S_STATUS0_RXEMPTY_Pos) /*!< I2S_T::STATUS0: RXEMPTY Mask */ - -#define I2S_STATUS0_TXUDIF_Pos (16) /*!< I2S_T::STATUS0: TXUDIF Position */ -#define I2S_STATUS0_TXUDIF_Msk (0x1ul << I2S_STATUS0_TXUDIF_Pos) /*!< I2S_T::STATUS0: TXUDIF Mask */ - -#define I2S_STATUS0_TXOVIF_Pos (17) /*!< I2S_T::STATUS0: TXOVIF Position */ -#define I2S_STATUS0_TXOVIF_Msk (0x1ul << I2S_STATUS0_TXOVIF_Pos) /*!< I2S_T::STATUS0: TXOVIF Mask */ - -#define I2S_STATUS0_TXTHIF_Pos (18) /*!< I2S_T::STATUS0: TXTHIF Position */ -#define I2S_STATUS0_TXTHIF_Msk (0x1ul << I2S_STATUS0_TXTHIF_Pos) /*!< I2S_T::STATUS0: TXTHIF Mask */ - -#define I2S_STATUS0_TXFULL_Pos (19) /*!< I2S_T::STATUS0: TXFULL Position */ -#define I2S_STATUS0_TXFULL_Msk (0x1ul << I2S_STATUS0_TXFULL_Pos) /*!< I2S_T::STATUS0: TXFULL Mask */ - -#define I2S_STATUS0_TXEMPTY_Pos (20) /*!< I2S_T::STATUS0: TXEMPTY Position */ -#define I2S_STATUS0_TXEMPTY_Msk (0x1ul << I2S_STATUS0_TXEMPTY_Pos) /*!< I2S_T::STATUS0: TXEMPTY Mask */ - -#define I2S_STATUS0_TXBUSY_Pos (21) /*!< I2S_T::STATUS0: TXBUSY Position */ -#define I2S_STATUS0_TXBUSY_Msk (0x1ul << I2S_STATUS0_TXBUSY_Pos) /*!< I2S_T::STATUS0: TXBUSY Mask */ - -#define I2S_TXFIFO_TXFIFO_Pos (0) /*!< I2S_T::TXFIFO: TXFIFO Position */ -#define I2S_TXFIFO_TXFIFO_Msk (0xfffffffful << I2S_TXFIFO_TXFIFO_Pos) /*!< I2S_T::TXFIFO: TXFIFO Mask */ - -#define I2S_RXFIFO_RXFIFO_Pos (0) /*!< I2S_T::RXFIFO: RXFIFO Position */ -#define I2S_RXFIFO_RXFIFO_Msk (0xfffffffful << I2S_RXFIFO_RXFIFO_Pos) /*!< I2S_T::RXFIFO: RXFIFO Mask */ - -#define I2S_CTL1_CH0ZCEN_Pos (0) /*!< I2S_T::CTL1: CH0ZCEN Position */ -#define I2S_CTL1_CH0ZCEN_Msk (0x1ul << I2S_CTL1_CH0ZCEN_Pos) /*!< I2S_T::CTL1: CH0ZCEN Mask */ - -#define I2S_CTL1_CH1ZCEN_Pos (1) /*!< I2S_T::CTL1: CH1ZCEN Position */ -#define I2S_CTL1_CH1ZCEN_Msk (0x1ul << I2S_CTL1_CH1ZCEN_Pos) /*!< I2S_T::CTL1: CH1ZCEN Mask */ - -#define I2S_CTL1_CH2ZCEN_Pos (2) /*!< I2S_T::CTL1: CH2ZCEN Position */ -#define I2S_CTL1_CH2ZCEN_Msk (0x1ul << I2S_CTL1_CH2ZCEN_Pos) /*!< I2S_T::CTL1: CH2ZCEN Mask */ - -#define I2S_CTL1_CH3ZCEN_Pos (3) /*!< I2S_T::CTL1: CH3ZCEN Position */ -#define I2S_CTL1_CH3ZCEN_Msk (0x1ul << I2S_CTL1_CH3ZCEN_Pos) /*!< I2S_T::CTL1: CH3ZCEN Mask */ - -#define I2S_CTL1_CH4ZCEN_Pos (4) /*!< I2S_T::CTL1: CH4ZCEN Position */ -#define I2S_CTL1_CH4ZCEN_Msk (0x1ul << I2S_CTL1_CH4ZCEN_Pos) /*!< I2S_T::CTL1: CH4ZCEN Mask */ - -#define I2S_CTL1_CH5ZCEN_Pos (5) /*!< I2S_T::CTL1: CH5ZCEN Position */ -#define I2S_CTL1_CH5ZCEN_Msk (0x1ul << I2S_CTL1_CH5ZCEN_Pos) /*!< I2S_T::CTL1: CH5ZCEN Mask */ - -#define I2S_CTL1_CH6ZCEN_Pos (6) /*!< I2S_T::CTL1: CH6ZCEN Position */ -#define I2S_CTL1_CH6ZCEN_Msk (0x1ul << I2S_CTL1_CH6ZCEN_Pos) /*!< I2S_T::CTL1: CH6ZCEN Mask */ - -#define I2S_CTL1_CH7ZCEN_Pos (7) /*!< I2S_T::CTL1: CH7ZCEN Position */ -#define I2S_CTL1_CH7ZCEN_Msk (0x1ul << I2S_CTL1_CH7ZCEN_Pos) /*!< I2S_T::CTL1: CH7ZCEN Mask */ - -#define I2S_CTL1_TXTH_Pos (8) /*!< I2S_T::CTL1: TXTH Position */ -#define I2S_CTL1_TXTH_Msk (0xful << I2S_CTL1_TXTH_Pos) /*!< I2S_T::CTL1: TXTH Mask */ - -#define I2S_CTL1_RXTH_Pos (16) /*!< I2S_T::CTL1: RXTH Position */ -#define I2S_CTL1_RXTH_Msk (0xful << I2S_CTL1_RXTH_Pos) /*!< I2S_T::CTL1: RXTH Mask */ - -#define I2S_CTL1_PBWIDTH_Pos (24) /*!< I2S_T::CTL1: PBWIDTH Position */ -#define I2S_CTL1_PBWIDTH_Msk (0x1ul << I2S_CTL1_PBWIDTH_Pos) /*!< I2S_T::CTL1: PBWIDTH Mask */ - -#define I2S_CTL1_PB16ORD_Pos (25) /*!< I2S_T::CTL1: PB16ORD Position */ -#define I2S_CTL1_PB16ORD_Msk (0x1ul << I2S_CTL1_PB16ORD_Pos) /*!< I2S_T::CTL1: PB16ORD Mask */ - -#define I2S_STATUS1_CH0ZCIF_Pos (0) /*!< I2S_T::STATUS1: CH0ZCIF Position */ -#define I2S_STATUS1_CH0ZCIF_Msk (0x1ul << I2S_STATUS1_CH0ZCIF_Pos) /*!< I2S_T::STATUS1: CH0ZCIF Mask */ - -#define I2S_STATUS1_CH1ZCIF_Pos (1) /*!< I2S_T::STATUS1: CH1ZCIF Position */ -#define I2S_STATUS1_CH1ZCIF_Msk (0x1ul << I2S_STATUS1_CH1ZCIF_Pos) /*!< I2S_T::STATUS1: CH1ZCIF Mask */ - -#define I2S_STATUS1_CH2ZCIF_Pos (2) /*!< I2S_T::STATUS1: CH2ZCIF Position */ -#define I2S_STATUS1_CH2ZCIF_Msk (0x1ul << I2S_STATUS1_CH2ZCIF_Pos) /*!< I2S_T::STATUS1: CH2ZCIF Mask */ - -#define I2S_STATUS1_CH3ZCIF_Pos (3) /*!< I2S_T::STATUS1: CH3ZCIF Position */ -#define I2S_STATUS1_CH3ZCIF_Msk (0x1ul << I2S_STATUS1_CH3ZCIF_Pos) /*!< I2S_T::STATUS1: CH3ZCIF Mask */ - -#define I2S_STATUS1_CH4ZCIF_Pos (4) /*!< I2S_T::STATUS1: CH4ZCIF Position */ -#define I2S_STATUS1_CH4ZCIF_Msk (0x1ul << I2S_STATUS1_CH4ZCIF_Pos) /*!< I2S_T::STATUS1: CH4ZCIF Mask */ - -#define I2S_STATUS1_CH5ZCIF_Pos (5) /*!< I2S_T::STATUS1: CH5ZCIF Position */ -#define I2S_STATUS1_CH5ZCIF_Msk (0x1ul << I2S_STATUS1_CH5ZCIF_Pos) /*!< I2S_T::STATUS1: CH5ZCIF Mask */ - -#define I2S_STATUS1_CH6ZCIF_Pos (6) /*!< I2S_T::STATUS1: CH6ZCIF Position */ -#define I2S_STATUS1_CH6ZCIF_Msk (0x1ul << I2S_STATUS1_CH6ZCIF_Pos) /*!< I2S_T::STATUS1: CH6ZCIF Mask */ - -#define I2S_STATUS1_CH7ZCIF_Pos (7) /*!< I2S_T::STATUS1: CH7ZCIF Position */ -#define I2S_STATUS1_CH7ZCIF_Msk (0x1ul << I2S_STATUS1_CH7ZCIF_Pos) /*!< I2S_T::STATUS1: CH7ZCIF Mask */ - -#define I2S_STATUS1_TXCNT_Pos (8) /*!< I2S_T::STATUS1: TXCNT Position */ -#define I2S_STATUS1_TXCNT_Msk (0x1ful << I2S_STATUS1_TXCNT_Pos) /*!< I2S_T::STATUS1: TXCNT Mask */ - -#define I2S_STATUS1_RXCNT_Pos (16) /*!< I2S_T::STATUS1: RXCNT Position */ -#define I2S_STATUS1_RXCNT_Msk (0x1ful << I2S_STATUS1_RXCNT_Pos) /*!< I2S_T::STATUS1: RXCNT Mask */ - -/**@}*/ /* I2S_CONST */ -/**@}*/ /* end of I2S register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __I2S_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/keystore_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/keystore_reg.h deleted file mode 100644 index c2ecc997e07..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/keystore_reg.h +++ /dev/null @@ -1,398 +0,0 @@ -/**************************************************************************//** - * @file keystore_reg.h - * @version V1.00 - * @brief Key store register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __KEYSTORE_REG_H__ -#define __KEYSTORE_REG_H__ - - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Key Store -------------------------*/ -/** - @addtogroup KS Key Store(KS) - Memory Mapped Structure for KS Controller -@{ */ - -typedef struct -{ - - - /** - * @var KS_T::CTL - * Offset: 0x00 Key Store Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Key Store Start Control Bit - * | | |0 = No operation. - * | | |1 = Start the operation. - * |[3:1] |OPMODE |Key Store Operation Mode - * | | |000 = Read operation. - * | | |001 = Create operation. - * | | |010 = Erase one key operation (only for key is in SRAM and OTP). - * | | |011 = Erase all keys operation (only for SRAM and Flash). - * | | |100 = Revoke key operation. - * | | |101 = Data Remanence prevention operation (only for SRAM). - * | | |111 = Lock operation (only for OTP). - * | | |Others = reserved. - * |[7] |CONT |Read/Write Key Continue Bit - * | | |0 = Read/Write key operation is not continuous to previous operation. - * | | |1 = Read/Write key operation is continuous to previous operation. - * |[8] |INIT |Key Store Initialization - * | | |User should to check BUSY(KS_STS[2]) is 0, and then write 1 to this bit and START(KS_CTL[0[), the Key Store will start to be initializationed. - * | | |After Key Store is initialized, INIT will be cleared. - * | | |Note: Before executing INIT, user must to checks KS(SYS_SRAMPC1) is 00. - * |[15] |IEN |Key Store Interrupt Enable Bit - * | | |0 = Key Store Interrupt Disabled. - * | | |1 = Key Store Interrupt Enabled. - * @var KS_T::METADATA - * Offset: 0x04 Key Store Metadata Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SEC |Secure Key Selection Bit - * | | |0 = Set key as the non-secure key. - * | | |1 = Set key as the secure key. - * |[1] |PRIV |Privilege Key Selection Bit - * | | |0 = Set key as the non-privilege key. - * | | |1 = Set key as the privilege key. - * |[2] |READABLE |Key Readable Control Bit - * | | |0 = key is un-readable. - * | | |1 = key is readable. - * |[4] |BS |Booting State Selection Bit - * | | |0 = Set key used at all state. - * | | |1 = Set key used at boot loader state 1 (BL1 state). - * |[12:8] |SIZE |Key Size Selection Bits - * | | |00000 = 128 bits. - * | | |00001 = 163 bits. - * | | |00010 = 192 bits. - * | | |00011 = 224 bits. - * | | |00100 = 233 bits. - * | | |00101 = 255 bits. - * | | |00110 = 256 bits. - * | | |00111 = 283 bits. - * | | |01000 = 384 bits. - * | | |01001 = 409 bits. - * | | |01010 = 512 bits. - * | | |01011 = 521 bits. - * | | |01100 = 571 bits. - * | | |10000 = 1024 bits. - * | | |10001 = 1536 bits. - * | | |10010 = 2048 bits. - * | | |10011 = 3072 bits. - * | | |10100 = 4096 bits. - * | | |Others = reserved. - * |[18:16] |OWNER |Key Owner Selection Bits - * | | |000 = AES - * | | |001 = HMAC - * | | |010 = RSA exponent blind key for SCAP(CRYPTO_RSA_CTL[8]) = 1 and CRT(CRYPTO_RSA_CTL[2]) = 0 - * | | |011 = RSA middle data, p, q and private key. - * | | |100 = ECC. - * | | |101 = CPU. - * | | |Others = reserved. - * |[25:20] |NUMBER |Key Number - * | | |Before read or erase one key operation starts, user should write the key number to be operated - * | | |When create operation is finished, user can read these bits to get its key number. - * |[31:30] |DST |Key Location Selection Bits - * | | |00 = Key is in SRAM. - * | | |01 = Key is in Flash. - * | | |10 = Key is in OTP. - * | | |Others = reserved. - * @var KS_T::STS - * Offset: 0x08 Key Store Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IF |Key Store Finish Interrupt Flag - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No Key Store interrupt. - * | | |1 = Key Store operation done interrupt. - * |[1] |EIF |Key Store Error Flag - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No Key Store error. - * | | |1 = Key Store error interrupt. - * |[2] |BUSY |Key Store Busy Flag (read only) - * | | |0 = Key Store is idle or finished. - * | | |1 = Key Store is busy. - * |[3] |SRAMFULL |Key Storage at SRAM Full Status Bit (read only) - * | | |0 = Key Storage at SRAM is not full. - * | | |1 = Key Storage at SRAM is full. - * |[4] |FLASHFULL |Key Storage at Flash Full Status Bit (read only) - * | | |0 = Key Storage at Flash is not full. - * | | |1 = Key Storage at Flash is full. - * |[7] |INITDONE |Key Store Initialization Done Status (read only) - * | | |0 = Key Store is un-initialized. - * | | |1 = Key Store is initialized. - * |[8] |RAMINV |Key Store SRAM Invert Status (read only) - * | | |0 = Key Store key in SRAM is normal. - * | | |1 = Key Store key in SRAM is inverted. - * @var KS_T::REMAIN - * Offset: 0x0C Key Store Remaining Space Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |RRMNG |Key Store SRAM Remaining Space - * | | |The RRMNG shows the remaining byte count space for SRAM. - * |[28:16] |FRMNG |Key Store Flash Remaining Space - * | | |The FRMNG shows the remaining byte count space for Flash. - * @var KS_T::KEY0 - * Offset: 0x20 Key Store Entry Key Word 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY1 - * Offset: 0x24 Key Store Entry Key Word 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY2 - * Offset: 0x28 Key Store Entry Key Word 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY3 - * Offset: 0x2C Key Store Entry Key Word 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY4 - * Offset: 0x30 Key Store Entry Key Word 4 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY5 - * Offset: 0x34 Key Store Entry Key Word 5 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY6 - * Offset: 0x38 Key Store Entry Key Word 6 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY7 - * Offset: 0x3C Key Store Entry Key Word 7 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data - * | | |The register will be cleared if the Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::OTPSTS - * Offset: 0x40 Key Store OTP Keys Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KEY0 |OTP Key 0 Used Status - * | | |0 = OTP key 0 is unused. - * | | |1 = OTP key 0 is used. - * | | |Note: If chip is in RMA stage, this bit will set to 1 and key is revoked after initialization if key is existed.Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[1] |KEY1 |OTP Key 1 Used Status - * | | |0 = OTP key 1 is unused. - * | | |1 = OTP key 1 is used. - * | | |Note: If chip is in RMA stage, this bit will set to 1 and key is revoked after initialization if key is existed.Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[2] |KEY2 |OTP Key 2 Used Status - * | | |0 = OTP key 2 is unused. - * | | |1 = OTP key 2 is used. - * | | |Note: If chip is in RMA stage, this bit will set to 1 and key is revoked after initialization if key is existed.Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[3] |KEY3 |OTP Key 3 Used Status - * | | |0 = OTP key 3 is unused. - * | | |1 = OTP key 3 is used. - * | | |Note: If chip is in RMA stage, this bit will set to 1 and key is revoked after initialization if key is existed.Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[4] |KEY4 |OTP Key 4 Used Status - * | | |0 = OTP key 4 is unused. - * | | |1 = OTP key 4 is used. - * | | |Note: If chip is in RMA stage, this bit will set to 1 and key is revoked after initialization if key is existed.Note: If chip is changed to RMA stage, existing key will be revoked after initialization. - * |[5] |KEY5 |OTP Key 5 Used Status - * | | |0 = OTP key 5 is unused. - * | | |1 = OTP key 5 is used. - * | | |Note: If chip is in RMA stage, this bit will set to 1 and key is revoked after initialization if key is existed.Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[6] |KEY6 |OTP Key 6 Used Status - * | | |0 = OTP key 6 is unused. - * | | |1 = OTP key 6 is used. - * | | |Note: If chip is in RMA stage, this bit will set to 1 and key is revoked after initialization if key is existed.Note: If chip is changed to RMA stage, the existing key will be revoked after initialization. - * |[7] |KEY7 |OTP Key 7 Used Status - * | | |0 = OTP key 7 is unused. - * | | |1 = OTP key 7 is used. - * | | |Note: If chip is inchanged to RMA stage, this bit will set to 1 and key is revoked after initialization if key is existedthe existing key will be revoked after initialization. - * @var KS_T::REMKCNT - * Offset: 0x44 Key Store Remaining Key Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |RRMKCNT |Key Store SRAM Remaining Key Count - * | | |The RRMKCNT shows the remaining key count for SRAM. - * |[21:16] |FRMKCNT |Key Store Flash Remaining Key Count - * | | |The FRMKCNT shows the remaining key count for Flash. - * @var KS_T::VERSION - * Offset: 0xFFC Key Store RTL Design Version Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MINOR |RTL Design Minor Version Number - * | | |Minor version number is dependent on moduleu2019s ECO version control. - * | | |0x0000 (Current Minor Version Number) - * |[23:16] |SUB |RTL Design Sub Version Number - * | | |Sub version number is correlated to moduleu2019s key feature. - * | | |0x01 (Current Sub Version Number) - * |[31:24] |MAJOR |RTL Design Major Version Number - * | | |Major version number is correlated to Product Line. - * | | |0x021 (Current Major Version Number) - */ - __IO uint32_t CTL; /*!< [0x0000] Key Store Control Register */ - __IO uint32_t METADATA; /*!< [0x0004] Key Store Metadata Register */ - __IO uint32_t STS; /*!< [0x0008] Key Store Status Register */ - __I uint32_t REMAIN; /*!< [0x000c] Key Store Remaining Space Register */ - __I uint32_t RESERVE0[4]; - __IO uint32_t KEY[8]; /*!< [0x0020-0x003c] Key Store Entry Key Word 0 Register */ - __I uint32_t OTPSTS; /*!< [0x0040] Key Store OTP Keys Status Register */ - __I uint32_t REMKCNT; /*!< [0x0044] Key Store Remaining Key Count Register */ - __I uint32_t RESERVE1[1005]; - __I uint32_t VERSION; /*!< [0x0ffc] Key Store RTL Design Version Register */ - -} KS_T; - -/** - @addtogroup KS_CONST KS Bit Field Definition - Constant Definitions for KS Controller -@{ */ - -#define KS_CTL_START_Pos (0) /*!< KS_T::CTL: START Position */ -#define KS_CTL_START_Msk (0x1ul << KS_CTL_START_Pos) /*!< KS_T::CTL: START Mask */ - -#define KS_CTL_OPMODE_Pos (1) /*!< KS_T::CTL: OPMODE Position */ -#define KS_CTL_OPMODE_Msk (0x7ul << KS_CTL_OPMODE_Pos) /*!< KS_T::CTL: OPMODE Mask */ - -#define KS_CTL_CONT_Pos (7) /*!< KS_T::CTL: CONT Position */ -#define KS_CTL_CONT_Msk (0x1ul << KS_CTL_CONT_Pos) /*!< KS_T::CTL: CONT Mask */ - -#define KS_CTL_INIT_Pos (8) /*!< KS_T::CTL: INIT Position */ -#define KS_CTL_INIT_Msk (0x1ul << KS_CTL_INIT_Pos) /*!< KS_T::CTL: INIT Mask */ - -#define KS_CTL_IEN_Pos (15) /*!< KS_T::CTL: IEN Position */ -#define KS_CTL_IEN_Msk (0x1ul << KS_CTL_IEN_Pos) /*!< KS_T::CTL: IEN Mask */ - -#define KS_METADATA_SEC_Pos (0) /*!< KS_T::METADATA: SEC Position */ -#define KS_METADATA_SEC_Msk (0x1ul << KS_METADATA_SEC_Pos) /*!< KS_T::METADATA: SEC Mask */ - -#define KS_METADATA_PRIV_Pos (1) /*!< KS_T::METADATA: PRIV Position */ -#define KS_METADATA_PRIV_Msk (0x1ul << KS_METADATA_PRIV_Pos) /*!< KS_T::METADATA: PRIV Mask */ - -#define KS_METADATA_READABLE_Pos (2) /*!< KS_T::METADATA: READABLE Position */ -#define KS_METADATA_READABLE_Msk (0x1ul << KS_METADATA_READABLE_Pos) /*!< KS_T::METADATA: READABLE Mask */ - -#define KS_METADATA_BS_Pos (4) /*!< KS_T::METADATA: BS Position */ -#define KS_METADATA_BS_Msk (0x1ul << KS_METADATA_BS_Pos) /*!< KS_T::METADATA: BS Mask */ - -#define KS_METADATA_SIZE_Pos (8) /*!< KS_T::METADATA: SIZE Position */ -#define KS_METADATA_SIZE_Msk (0x1ful << KS_METADATA_SIZE_Pos) /*!< KS_T::METADATA: SIZE Mask */ - -#define KS_METADATA_OWNER_Pos (16) /*!< KS_T::METADATA: OWNER Position */ -#define KS_METADATA_OWNER_Msk (0x7ul << KS_METADATA_OWNER_Pos) /*!< KS_T::METADATA: OWNER Mask */ - -#define KS_METADATA_NUMBER_Pos (20) /*!< KS_T::METADATA: NUMBER Position */ -#define KS_METADATA_NUMBER_Msk (0x3ful << KS_METADATA_NUMBER_Pos) /*!< KS_T::METADATA: NUMBER Mask */ - -#define KS_METADATA_DST_Pos (30) /*!< KS_T::METADATA: DST Position */ -#define KS_METADATA_DST_Msk (0x3ul << KS_METADATA_DST_Pos) /*!< KS_T::METADATA: DST Mask */ - -#define KS_STS_IF_Pos (0) /*!< KS_T::STS: IF Position */ -#define KS_STS_IF_Msk (0x1ul << KS_STS_IF_Pos) /*!< KS_T::STS: IF Mask */ - -#define KS_STS_EIF_Pos (1) /*!< KS_T::STS: EIF Position */ -#define KS_STS_EIF_Msk (0x1ul << KS_STS_EIF_Pos) /*!< KS_T::STS: EIF Mask */ - -#define KS_STS_BUSY_Pos (2) /*!< KS_T::STS: BUSY Position */ -#define KS_STS_BUSY_Msk (0x1ul << KS_STS_BUSY_Pos) /*!< KS_T::STS: BUSY Mask */ - -#define KS_STS_SRAMFULL_Pos (3) /*!< KS_T::STS: SRAMFULL Position */ -#define KS_STS_SRAMFULL_Msk (0x1ul << KS_STS_SRAMFULL_Pos) /*!< KS_T::STS: SRAMFULL Mask */ - -#define KS_STS_FLASHFULL_Pos (4) /*!< KS_T::STS: FLASHFULL Position */ -#define KS_STS_FLASHFULL_Msk (0x1ul << KS_STS_FLASHFULL_Pos) /*!< KS_T::STS: FLASHFULL Mask */ - -#define KS_STS_INITDONE_Pos (7) /*!< KS_T::STS: INITDONE Position */ -#define KS_STS_INITDONE_Msk (0x1ul << KS_STS_INITDONE_Pos) /*!< KS_T::STS: INITDONE Mask */ - -#define KS_STS_RAMINV_Pos (8) /*!< KS_T::STS: RAMINV Position */ -#define KS_STS_RAMINV_Msk (0x1ul << KS_STS_RAMINV_Pos) /*!< KS_T::STS: RAMINV Mask */ - -#define KS_STS_KRVKF_Pos (9) /*!< KS_T::STS: KRVKF Position */ -#define KS_STS_KRVKF_Msk (0x1ul << KS_STS_KRVKF_Pos) /*!< KS_T::STS: KRVKF Mask */ - -#define KS_REMAIN_RRMNG_Pos (0) /*!< KS_T::REMAIN: RRMNG Position */ -#define KS_REMAIN_RRMNG_Msk (0x1ffful << KS_REMAIN_RRMNG_Pos) /*!< KS_T::REMAIN: RRMNG Mask */ - -#define KS_REMAIN_FRMNG_Pos (16) /*!< KS_T::REMAIN: FRMNG Position */ -#define KS_REMAIN_FRMNG_Msk (0x1ffful << KS_REMAIN_FRMNG_Pos) /*!< KS_T::REMAIN: FRMNG Mask */ - -#define KS_KEY_KEY_Pos (0) /*!< KS_T::KEY: KEY Position */ -#define KS_KEY_KEY_Msk (0xfffffffful << KS_KEY0_KEY_Pos) /*!< KS_T::KEY: KEY Mask */ - -#define KS_OTPSTS_KEY0_Pos (0) /*!< KS_T::OTPSTS: KEY0 Position */ -#define KS_OTPSTS_KEY0_Msk (0x1ul << KS_OTPSTS_KEY0_Pos) /*!< KS_T::OTPSTS: KEY0 Mask */ - -#define KS_OTPSTS_KEY1_Pos (1) /*!< KS_T::OTPSTS: KEY1 Position */ -#define KS_OTPSTS_KEY1_Msk (0x1ul << KS_OTPSTS_KEY1_Pos) /*!< KS_T::OTPSTS: KEY1 Mask */ - -#define KS_OTPSTS_KEY2_Pos (2) /*!< KS_T::OTPSTS: KEY2 Position */ -#define KS_OTPSTS_KEY2_Msk (0x1ul << KS_OTPSTS_KEY2_Pos) /*!< KS_T::OTPSTS: KEY2 Mask */ - -#define KS_OTPSTS_KEY3_Pos (3) /*!< KS_T::OTPSTS: KEY3 Position */ -#define KS_OTPSTS_KEY3_Msk (0x1ul << KS_OTPSTS_KEY3_Pos) /*!< KS_T::OTPSTS: KEY3 Mask */ - -#define KS_OTPSTS_KEY4_Pos (4) /*!< KS_T::OTPSTS: KEY4 Position */ -#define KS_OTPSTS_KEY4_Msk (0x1ul << KS_OTPSTS_KEY4_Pos) /*!< KS_T::OTPSTS: KEY4 Mask */ - -#define KS_OTPSTS_KEY5_Pos (5) /*!< KS_T::OTPSTS: KEY5 Position */ -#define KS_OTPSTS_KEY5_Msk (0x1ul << KS_OTPSTS_KEY5_Pos) /*!< KS_T::OTPSTS: KEY5 Mask */ - -#define KS_OTPSTS_KEY6_Pos (6) /*!< KS_T::OTPSTS: KEY6 Position */ -#define KS_OTPSTS_KEY6_Msk (0x1ul << KS_OTPSTS_KEY6_Pos) /*!< KS_T::OTPSTS: KEY6 Mask */ - -#define KS_OTPSTS_KEY7_Pos (7) /*!< KS_T::OTPSTS: KEY7 Position */ -#define KS_OTPSTS_KEY7_Msk (0x1ul << KS_OTPSTS_KEY7_Pos) /*!< KS_T::OTPSTS: KEY7 Mask */ - -#define KS_REMKCNT_RRMKCNT_Pos (0) /*!< KS_T::REMKCNT: RRMKCNT Position */ -#define KS_REMKCNT_RRMKCNT_Msk (0x3ful << KS_REMKCNT_RRMKCNT_Pos) /*!< KS_T::REMKCNT: RRMKCNT Mask */ - -#define KS_REMKCNT_FRMKCNT_Pos (16) /*!< KS_T::REMKCNT: FRMKCNT Position */ -#define KS_REMKCNT_FRMKCNT_Msk (0x3ful << KS_REMKCNT_FRMKCNT_Pos) /*!< KS_T::REMKCNT: FRMKCNT Mask */ - -#define KS_VERSION_MINOR_Pos (0) /*!< KS_T::VERSION: MINOR Position */ -#define KS_VERSION_MINOR_Msk (0xfffful << KS_VERSION_MINOR_Pos) /*!< KS_T::VERSION: MINOR Mask */ - -#define KS_VERSION_SUB_Pos (16) /*!< KS_T::VERSION: SUB Position */ -#define KS_VERSION_SUB_Msk (0xfful << KS_VERSION_SUB_Pos) /*!< KS_T::VERSION: SUB Mask */ - -#define KS_VERSION_MAJOR_Pos (24) /*!< KS_T::VERSION: MAJOR Position */ -#define KS_VERSION_MAJOR_Msk (0xfful << KS_VERSION_MAJOR_Pos) /*!< KS_T::VERSION: MAJOR Mask */ - -/**@}*/ /* KS_CONST */ -/**@}*/ /* end of KS register group */ -/**@}*/ /* end of REGISTER group */ - -#endif /* __KEYSTORE_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/kpi_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/kpi_reg.h deleted file mode 100644 index 35d29936b7c..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/kpi_reg.h +++ /dev/null @@ -1,370 +0,0 @@ -/**************************************************************************//** - * @file clk_reg.h - * @version V1.00 - * @brief CLK register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __KEYPAD_REG_H__ -#define __KEYPAD_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Keypad Control Interface -------------------------*/ -/** - @addtogroup KPI Keypad Control Interface (KPI) - Memory Mapped Structure for KPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var KPI_T::CTL - * Offset: 0x00 Keypad Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KPEN |Keypad Scan Enable Bit - * | | |Setting this bit high enables the key scan function. - * | | |0 = Keypad scan Disabled. - * | | |1 = Keypad scan Enabled. - * |[1] |KPIEN |Key Press Key Interrupt Enable Bit - * | | |The keypad controller will generate an interrupt when the controller detects any effective key press. - * | | |0 = Keypad press interrupt Disabled. - * | | |1 = Keypad press interrupt Enabled. - * | | |Note: The bit will be reset when KPI reset occurs. - * |[2] |KRIEN |Key Release Key Interrupt Enable Bit - * | | |The keypad controller will generate an interrupt when the controller detects keypad status changes from press to release. - * | | |0 = Keypad release interrupt Disabled. - * | | |1 = Keypad release interrupt Enabled. - * | | |Note: The bit will be reset when KPI reset occurs. - * |[3] |KIEN |Key Interrupt Enable Bit - * | | |0 = Keypad interrupt Disabled. - * | | |1 = Keypad interrupt Enabled. - * | | |Note: The bit will be reset when KPI reset occurs. - * |[5:4] |DBCT |De-bounce Cycle Time - * | | |For keypad debounce, keypad will generate an interrupt when key press, key release or three key reset continued n * key array scan time. - * | | |00 = n=1. - * | | |01 = n=2. - * | | |10 = n=3. - * | | |11 = n=4. - * | | |Note: It would need more time to indicate key press and release event when users selected more debounce cycle time. - * |[15:8] |PSC |Row Scan Cycle Pre-scale Value - * | | |This value is used to pre-scale row scan cycle. - * | | |The pre-scale counter is clocked by the divided crystal clock, xCLOCK. - * | | |The divided number is from 1 to 256. - * | | |E.g.If the crystal clock is 1Mhz then the xCLOCK period is 1us. - * | | |If the keypad matric is 3x3 then - * | | |Each row scan time = xCLOCK x PRESCALE PSC x PrescaleDividerPSCDIV. - * | | |Key array scan time = Each row scan time x ROWS. - * | | |Example scan time for PRESCALE = 0x40, and PrescaleDividerPSCDIV = 0x1F. - * | | |Each row scan time = 1us x 65 x 32 = 2.08ms. - * | | |Scan time = 2.08 x 3 = 6.24ms. - * | | |Note: - * | | |When PRESCALEPSC is determined, De-bounce sampling cycle should not exceed the half of (PRESCALEPSC x PrescaleDividerPSCDIV), - * | | |in the above example, and if scan row delay cycle is 4 xclock - * | | |The maximum DBCLKSEL should be 10244*256 xCLOCK, bouncing time is 1ms. - * |[19:16] |DBCLKSEL |Scan in De-bounce Sampling Cycle Selection - * | | |0000 = Reserved. - * | | |0001 = Reserved. - * | | |0010 = Reserved. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 512 clocks. - * | | |1010 = Sample interrupt input once per 1024 clocks. - * | | |1011 = Sample interrupt input once per 2048 clocks. - * | | |1100 = Sample interrupt input once per 4096 clocks. - * | | |1101 = Sample interrupt input once per 8192 clocks. - * | | |1110 = reserved. - * | | |1111 = reserved. - * | | |Note: - * | | |scan row delay cycle < debounce sampling cycle. - * | | |row scan time > scan row delay cycle + (2 * debounce sampling cycle) + 1 xclock cycle(change row) + 2 xclock cycle(cross clock domain). - * | | |row scan time = xCLOCK x PRESCALEPSC x PrescaleDividerPSCDIVprescale * 32 (xclock). - * | | |xclock = 1 MHz ~32 kHz. - * | | |bouncing time last for 1ms - * | | |For example, if xclock = 1 MHz,. - * | | |debounce sampling cycle choose 1024 xclock, - * | | |and scan row delay cycle choose 8 xclock, - * | | |row scan time should choose larger than (8+2048+3) xclock, - * | | |suppose PrescaleDividerPSCDIV = 0x1F, then prescale = 65 (20562059/32 = 64.2535). - * |[23:22] |ROWDLY |Scan Row Delay - * | | |Setting delay cycle when row change, for avoid KPI from detecting wrong key.. - * | | |00 = 4 KPI engine clock cycle. - * | | |01 = 8 KPI engine clock cycle. - * | | |10 = 16 KPI engine clock cycle. - * | | |11 = 32 KPI engine clock cycle. - * | | |Note: - * | | |scan row delay cycle < debounce sampling cycle. - * | | |row scan time > scan row delay cycle + (2 * debounce sampling cycle) + 1 xclock cycle(change row) + 2 xclock cycle(cross clock domain). - * |[26:24] |KCOL |Keypad Matrix COL Number - * | | |The keypad matrix is set by ROW x COL. The COL number can be set 1 to 8. - * | | |000 = 1. - * | | |001 = 2. - * | | |010 = 3. - * | | |011 = 4. - * | | |100 = 5. - * | | |101 = 6. - * | | |110 = 7. - * | | |111 = 8. - * |[30:28] |KROW |Keypad Matrix ROW Number - * | | |The keypad matrix is set by ROW x COL. The ROW number can be set 2 to 6. - * | | |000 = reserved. - * | | |001 = 2. - * | | |010 = 3. - * | | |011 = 4. - * | | |100 = 5. - * | | |101 = 6. - * | | |110 = Reserved. - * | | |111 = Reserved. - * @var KPI_T::STATUS - * Offset: 0x08 Keypad Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TKRIF |3Three-keys Reset Interrupt Flag - * | | |This bit will be set after 3Three-keys reset occurs. - * | | |When READ: - * | | |0 = No reset. - * | | |1 = 3Three -keys reset interrupt occurred. - * | | |When WRITE: - * | | |0 = No operation. - * | | |1 = Clear interrupt flag. - * |[2] |KIF |Key Interrupt Flag - * | | |This bit indicates the key scan interrupt is active when any key press or, key release or three key reset or wake up. - * | | |When READ: - * | | |0 = No reset. - * | | |1 = Key press/Key release/3Three-key reset/wakeup interrupt occurred. - * | | |To clear KIF, software must clear KPIF, KRIF and TKRIF - * | | |(u9019u6BB5WSu81EAu5DF1u731Cu7684uFF0Cu5C0Du55CE?) - * |[3] |KRIF |Release Key Release Interrupt Flag - * | | |This bit indicates that some keys (one or multiple key) have been released. - * | | |When READ: - * | | |0 = No key release. - * | | |1 = At least one key release. - * | | |Note: To clear KRKEYINTIF, software must clear each releasing event flag that are shown on u201Ckey releasing eventu201D - * | | |KPI_KRF0/1 registers. - * | | |C code example: - * | | |DWORD RKE0, RKE1 - * | | |PKE0 = reg_read(KPIKRE0); PKE1 = reg_read(KPIKRE1);. - * | | |Reg_write(KPIKRE0, RKE0); Reg_write(KPIKRE1, RKE1) - * |[4] |KPIF |Key Press Key Interrupt Flag - * | | |This bit indicates that some keys (one or multiple key) have been pressed. - * | | |When READ: - * | | |0 = No key press. - * | | |1 = At least one key press. - * | | |Note: To clear KPIFPKEYINT, software must clear each pressing event flag that are shown on u201CKPIKPE1KPI_KPF0/1, KPIKPE0u201D - * | | |registers. - * | | |C code example: - * | | |DWORD PKE0, PKE1 - * | | |PKE0 = reg_read(KPIKPE0); PKE1 = reg_read(KPIKPE1);. - * | | |Reg_write(KPIKPE0, PKE0); Reg_write(KPIKPE1, PKE1) - * @var KPI_T::KST0 - * Offset: 0x10 Keypad State Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KSTmn |Key State - * | | |KESTm,n: m is row number, n is column number. - * | | |0 = Key m,n is pressing. - * | | |1 = Key m,n is releasing. - * @var KPI_T::KST1 - * Offset: 0x14 Keypad State Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |KESTmn |Key State - * | | |KESTm,n: m is row number, n is column number. - * | | |0 = Key m,n is pressing. - * | | |1 = Key m,n is releasing. - * @var KPI_T::KPF0 - * Offset: 0x18 Lower 32 Key Press Flag Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KPFmn |Lower 32 Key Press Event Change IndicatorFlag - * | | |m is row number, n is column number. - * | | |KPE mn[X] = 1, m=row, n=column:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a high to low event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear PKEYINT KPIF (KPI_STATUS[4]) by writing 1 bit by bit to this register. - * @var KPI_T::KPF1 - * Offset: 0x1C Upper 32 Key Press Flag Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |KPEmn |Upper 32 Key Press Event Change IndicatorFlag - * | | |KPE mn[X] = 1, m =is row number, n =is column number.:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a high to low event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear PKEYINT (KPISTATUS[4]) by writing 1 bit by bit to this register. - * @var KPI_T::KRF0 - * Offset: 0x20 Lower 32 Key Release Flag Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KRFmn |Lower 32 Key Release Event Change IndicatorFlag - * | | |KRE mn[X] = 1, m= is row number, n= is column number.:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a low to high event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear RKEYINT (KPISTATUS[3]) by writing 1 bit by bit to this register. - * @var KPI_T::KRF1 - * Offset: 0x24 Upper 32 Key Release Flag Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |KRFmn |Upper 32 Key Release Event Change IndicatorFlag - * | | |KRE mn[X] = 1, m =is row number, n =is column number.:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a low to high event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear RKEYINT (KPISTATUS[3]) by writing 1 bit by bit to this register. - * @var KPI_T::DLYCTL - * Offset: 0x28 Delay Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PSCDIV |Pre-scale Divider - * | | |This value is used to divide RESCALE that is set in KPICONFKPI_CTL[15:8] - * | | |The prescale divider counter is clocked by the divided crystal clock, xCLOCK - * | | |The number is from 1 to 256. - * | | |E.g. If the crystal clock is 1Mhz then the xCLOCK period is 1us. If the keypad matrix is 3x3. Then, - * | | |each row scan time = xCLOCK x PRESCALEPSC x PrescaleDividerPSCDIV. - * | | |key array scan time = each row scan time x ROWS. - * | | |example scan time for PRESCALEPSC = 0x40, and PrescaleDividerPSCDIV = 0x1F. - * | | |each row scan time = 1us x 65 x 32 = 2.08ms. - * | | |scan time = 2.08 x 3 = 6.24ms. - * | | |Note: - * | | |When PRESCALEPSC (KPICONFKPI_CTL[15:8]) is determined, De-bounce sampling cycle should not exceed the half of (PRESCALEPSC x PrescaleDividerPSCDIV), - * | | |in the above example, and if scan row delay cycle is 4 xclock - * | | |The maximum DBCLKSEL(KPICONFKPI_CTL[19:16]) should be 1024 x clock, bouncing time is 1ms. - * |[17:8] |SCANDLY |Key Array Scan Delay - * | | |This value is used to insert delay cycle between each key array scan. - * | | |The key array scan delay counter is clocked by the divided crystal clock, xCLOCK. - * | | |Key array scan delay time = xCLOCK x KASDSCANDLY. - * | | |The number of key array scan delay cycle is 0 and from 2 to 1024. - * | | |0 = No delay. - * | | |Others = others + 1 cycles. - * | | |Note: - * | | |If the key array scan delay is set to 0, there are no delay between each key array scan. - * | | |There are no delay 1 cycle situation. - */ - __IO uint32_t CTL; /*!< [0x0000] Keypad Control Register */ - __IO uint32_t Reserved0; /*!< [0x0004] Reserved */ - __IO uint32_t STATUS; /*!< [0x0008] Keypad Status Register */ - __IO uint32_t Reserved1; /*!< [0x000c] Reserved */ - __I uint32_t KST[2]; /*!< [0x0010-0x0014] Keypad State Register 0 */ - __IO uint32_t KPF[2]; /*!< [0x0018-0x001c] Lower 32 Key Press Flag Register 0 */ - __IO uint32_t KRF[2]; /*!< [0x0020-0x0024] Lower 32 Key Release Flag Register 0 */ - __IO uint32_t DLYCTL; /*!< [0x0028] Delay Control Register */ - -} KPI_T; - -/** - @addtogroup KPI_CONST KPI Bit Field Definition - Constant Definitions for KPI Controller -@{ */ - -#define KPI_CTL_KPEN_Pos (0) /*!< KPI_T::CTL: KPEN Position */ -#define KPI_CTL_KPEN_Msk (0x1ul << KPI_CTL_KPEN_Pos) /*!< KPI_T::CTL: KPEN Mask */ - -#define KPI_CTL_KPIEN_Pos (1) /*!< KPI_T::CTL: KPIEN Position */ -#define KPI_CTL_KPIEN_Msk (0x1ul << KPI_CTL_KPIEN_Pos) /*!< KPI_T::CTL: KPIEN Mask */ - -#define KPI_CTL_KRIEN_Pos (2) /*!< KPI_T::CTL: KRIEN Position */ -#define KPI_CTL_KRIEN_Msk (0x1ul << KPI_CTL_KRIEN_Pos) /*!< KPI_T::CTL: KRIEN Mask */ - -#define KPI_CTL_KIEN_Pos (3) /*!< KPI_T::CTL: KIEN Position */ -#define KPI_CTL_KIEN_Msk (0x1ul << KPI_CTL_KIEN_Pos) /*!< KPI_T::CTL: KIEN Mask */ - -#define KPI_CTL_DBCT_Pos (4) /*!< KPI_T::CTL: DBCT Position */ -#define KPI_CTL_DBCT_Msk (0x3ul << KPI_CTL_DBCT_Pos) /*!< KPI_T::CTL: DBCT Mask */ - -#define KPI_CTL_PSC_Pos (8) /*!< KPI_T::CTL: PSC Position */ -#define KPI_CTL_PSC_Msk (0xfful << KPI_CTL_PSC_Pos) /*!< KPI_T::CTL: PSC Mask */ - -#define KPI_CTL_DBCLKSEL_Pos (16) /*!< KPI_T::CTL: DBCLKSEL Position */ -#define KPI_CTL_DBCLKSEL_Msk (0xful << KPI_CTL_DBCLKSEL_Pos) /*!< KPI_T::CTL: DBCLKSEL Mask */ - -#define KPI_CTL_ROWDLY_Pos (22) /*!< KPI_T::CTL: ROWDLY Position */ -#define KPI_CTL_ROWDLY_Msk (0x3ul << KPI_CTL_ROWDLY_Pos) /*!< KPI_T::CTL: ROWDLY Mask */ - -#define KPI_CTL_KCOL_Pos (24) /*!< KPI_T::CTL: KCOL Position */ -#define KPI_CTL_KCOL_Msk (0x7ul << KPI_CTL_KCOL_Pos) /*!< KPI_T::CTL: KCOL Mask */ - -#define KPI_CTL_KROW_Pos (28) /*!< KPI_T::CTL: KROW Position */ -#define KPI_CTL_KROW_Msk (0x7ul << KPI_CTL_KROW_Pos) /*!< KPI_T::CTL: KROW Mask */ - -#define KPI_STATUS_TKRIF_Pos (1) /*!< KPI_T::STATUS: TKRIF Position */ -#define KPI_STATUS_TKRIF_Msk (0x1ul << KPI_STATUS_TKRIF_Pos) /*!< KPI_T::STATUS: TKRIF Mask */ - -#define KPI_STATUS_KIF_Pos (2) /*!< KPI_T::STATUS: KIF Position */ -#define KPI_STATUS_KIF_Msk (0x1ul << KPI_STATUS_KIF_Pos) /*!< KPI_T::STATUS: KIF Mask */ - -#define KPI_STATUS_KRIF_Pos (3) /*!< KPI_T::STATUS: KRIF Position */ -#define KPI_STATUS_KRIF_Msk (0x1ul << KPI_STATUS_KRIF_Pos) /*!< KPI_T::STATUS: KRIF Mask */ - -#define KPI_STATUS_KPIF_Pos (4) /*!< KPI_T::STATUS: KPIF Position */ -#define KPI_STATUS_KPIF_Msk (0x1ul << KPI_STATUS_KPIF_Pos) /*!< KPI_T::STATUS: KPIF Mask */ - -#define KPI_KST0_KSTmn_Pos (0) /*!< KPI_T::KST0: KSTmn Position */ -#define KPI_KST0_KSTmn_Msk (0xfffffffful << KPI_KST0_KSTmn_Pos) /*!< KPI_T::KST0: KSTmn Mask */ - -#define KPI_KST1_KESTmn_Pos (0) /*!< KPI_T::KST1: KESTmn Position */ -#define KPI_KST1_KESTmn_Msk (0xfffful << KPI_KST1_KESTmn_Pos) /*!< KPI_T::KST1: KESTmn Mask */ - -#define KPI_KPF0_KPFmn_Pos (0) /*!< KPI_T::KPF0: KPFmn Position */ -#define KPI_KPF0_KPFmn_Msk (0xfffffffful << KPI_KPF0_KPFmn_Pos) /*!< KPI_T::KPF0: KPFmn Mask */ - -#define KPI_KPF1_KPEmn_Pos (0) /*!< KPI_T::KPF1: KPEmn Position */ -#define KPI_KPF1_KPEmn_Msk (0xfffful << KPI_KPF1_KPEmn_Pos) /*!< KPI_T::KPF1: KPEmn Mask */ - -#define KPI_KRF0_KRFmn_Pos (0) /*!< KPI_T::KRF0: KRFmn Position */ -#define KPI_KRF0_KRFmn_Msk (0xfffffffful << KPI_KRF0_KRFmn_Pos) /*!< KPI_T::KRF0: KRFmn Mask */ - -#define KPI_KRF1_KRFmn_Pos (0) /*!< KPI_T::KRF1: KRFmn Position */ -#define KPI_KRF1_KRFmn_Msk (0xfffful << KPI_KRF1_KRFmn_Pos) /*!< KPI_T::KRF1: KRFmn Mask */ - -#define KPI_DLYCTL_PSCDIV_Pos (0) /*!< KPI_T::DLYCTL: PSCDIV Position */ -#define KPI_DLYCTL_PSCDIV_Msk (0xfful << KPI_DLYCTL_PSCDIV_Pos) /*!< KPI_T::DLYCTL: PSCDIV Mask */ - -#define KPI_DLYCTL_SCANDLY_Pos (8) /*!< KPI_T::DLYCTL: SCANDLY Position */ -#define KPI_DLYCTL_SCANDLY_Msk (0x3fful << KPI_DLYCTL_SCANDLY_Pos) /*!< KPI_T::DLYCTL: SCANDLY Mask */ - -/**@}*/ /* KPI_CONST */ -/**@}*/ /* end of KPI register group */ - - -/**@}*/ /* end of REGISTER group */ -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __KEYPAD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/m460.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/m460.h deleted file mode 100644 index 89a6a08e8b5..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/m460.h +++ /dev/null @@ -1,815 +0,0 @@ -/**************************************************************************//** - * @file m460.h - * @version V3.00 - * @brief M460 peripheral access layer header file. - * This file contains all the peripheral register's definitions, - * bits definitions and memory mapping for NuMicro M460 MCU. - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -/** - \mainpage NuMicro M460 Driver Reference Guide - * - * Introduction - * - * This user manual describes the usage of M460 Series MCU device driver - * - * Disclaimer - * - * The Software is furnished "AS IS", without warranty as to performance or results, and - * the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all - * warranties, express, implied or otherwise, with regard to the Software, its use, or - * operation, including without limitation any and all warranties of merchantability, fitness - * for a particular purpose, and non-infringement of intellectual property rights. - * - * Important Notice - * - * Nuvoton Products are neither intended nor warranted for usage in systems or equipment, - * any malfunction or failure of which may cause loss of human life, bodily injury or severe - * property damage. Such applications are deemed, "Insecure Usage". - * - * Insecure usage includes, but is not limited to: equipment for surgical implementation, - * atomic energy control instruments, airplane or spaceship instruments, the control or - * operation of dynamic, brake or safety systems designed for vehicular use, traffic signal - * instruments, all types of safety devices, and other applications intended to support or - * sustain life. - * - * All Insecure Usage shall be made at customer's risk, and in the event that third parties - * lay claims to Nuvoton as a result of customer's Insecure Usage, customer shall indemnify - * the damages and liabilities thus incurred by Nuvoton. - * - * Please note that all data and specifications are subject to change without notice. All the - * trademarks of products and companies mentioned in this datasheet belong to their respective - * owners. - * - * Copyright Notice - * - * Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - */ -#ifndef __M460_H__ -#define __M460_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************/ -/* Processor and Core Peripherals */ -/******************************************************************************/ -/** @addtogroup CMSIS_Device Device CMSIS Definitions - Configuration of the Cortex-M4 Processor and Core Peripherals - @{ -*/ - -/** - * @details Interrupt Number Definition. - */ -typedef enum IRQn -{ - /****** Cortex-M4 Processor Exceptions Numbers ***************************************************/ - NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */ - MemoryManagement_IRQn = -12, /*!< 4 Memory Management Interrupt */ - BusFault_IRQn = -11, /*!< 5 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /*!< 6 Usage Fault Interrupt */ - SVCall_IRQn = -5, /*!< 11 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /*!< 14 Pend SV Interrupt */ - SysTick_IRQn = -1, /*!< 15 System Tick Interrupt */ - - /****** M460 Specific Interrupt Numbers ********************************************************/ - - BOD_IRQn = 0, /*!< Brown Out detection Interrupt */ - IRC_IRQn = 1, /*!< Internal RC Interrupt */ - PWRWU_IRQn = 2, /*!< Power Down Wake Up Interrupt */ - RAMPE_IRQn = 3, /*!< SRAM parity check failed Interrupt */ - CKFAIL_IRQn = 4, /*!< Clock failed Interrupt */ - ISP_IRQn = 5, /*!< FMC ISP Interrupt */ - RTC_IRQn = 6, /*!< Real Time Clock Interrupt */ - TAMPER_IRQn = 7, /*!< Tamper detection Interrupt */ - WDT_IRQn = 8, /*!< Watchdog timer Interrupt */ - WWDT_IRQn = 9, /*!< Window Watchdog timer Interrupt */ - EINT0_IRQn = 10, /*!< External Input 0 Interrupt */ - EINT1_IRQn = 11, /*!< External Input 1 Interrupt */ - EINT2_IRQn = 12, /*!< External Input 2 Interrupt */ - EINT3_IRQn = 13, /*!< External Input 3 Interrupt */ - EINT4_IRQn = 14, /*!< External Input 4 Interrupt */ - EINT5_IRQn = 15, /*!< External Input 5 Interrupt */ - GPA_IRQn = 16, /*!< GPIO Port A Interrupt */ - GPB_IRQn = 17, /*!< GPIO Port B Interrupt */ - GPC_IRQn = 18, /*!< GPIO Port C Interrupt */ - GPD_IRQn = 19, /*!< GPIO Port D Interrupt */ - GPE_IRQn = 20, /*!< GPIO Port E Interrupt */ - GPF_IRQn = 21, /*!< GPIO Port F Interrupt */ - QSPI0_IRQn = 22, /*!< QSPI0 Interrupt */ - SPI0_IRQn = 23, /*!< SPI0 Interrupt */ - BRAKE0_IRQn = 24, /*!< BRAKE0 Interrupt */ - EPWM0P0_IRQn = 25, /*!< EPWM0P0 Interrupt */ - EPWM0P1_IRQn = 26, /*!< EPWM0P1 Interrupt */ - EPWM0P2_IRQn = 27, /*!< EPWM0P2 Interrupt */ - BRAKE1_IRQn = 28, /*!< BRAKE1 Interrupt */ - EPWM1P0_IRQn = 29, /*!< EPWM1P0 Interrupt */ - EPWM1P1_IRQn = 30, /*!< EPWM1P1 Interrupt */ - EPWM1P2_IRQn = 31, /*!< EPWM1P2 Interrupt */ - TMR0_IRQn = 32, /*!< Timer 0 Interrupt */ - TMR1_IRQn = 33, /*!< Timer 1 Interrupt */ - TMR2_IRQn = 34, /*!< Timer 2 Interrupt */ - TMR3_IRQn = 35, /*!< Timer 3 Interrupt */ - UART0_IRQn = 36, /*!< UART 0 Interrupt */ - UART1_IRQn = 37, /*!< UART 1 Interrupt */ - I2C0_IRQn = 38, /*!< I2C 0 Interrupt */ - I2C1_IRQn = 39, /*!< I2C 1 Interrupt */ - PDMA0_IRQn = 40, /*!< Peripheral DMA 0 Interrupt */ - DAC_IRQn = 41, /*!< DAC Interrupt */ - EADC00_IRQn = 42, /*!< EADC00 Interrupt */ - EADC01_IRQn = 43, /*!< EADC01 Interrupt */ - ACMP01_IRQn = 44, /*!< Analog Comparator 0 and 1 Interrupt */ - ACMP23_IRQn = 45, /*!< Analog Comparator 2 and 3 Interrupt */ - EADC02_IRQn = 46, /*!< EADC02 Interrupt */ - EADC03_IRQn = 47, /*!< EADC03 Interrupt */ - UART2_IRQn = 48, /*!< UART2 Interrupt */ - UART3_IRQn = 49, /*!< UART3 Interrupt */ - QSPI1_IRQn = 50, /*!< QSPI1 Interrupt */ - SPI1_IRQn = 51, /*!< SPI1 Interrupt */ - SPI2_IRQn = 52, /*!< SPI2 Interrupt */ - USBD_IRQn = 53, /*!< USB device Interrupt */ - USBH_IRQn = 54, /*!< USB host Interrupt */ - USBOTG_IRQn = 55, /*!< USB OTG Interrupt */ - BMC_IRQn = 56, /*!< BMC Interrupt */ - SPI5_IRQn = 57, /*!< SPI5 Interrupt */ - SC0_IRQn = 58, /*!< Smart Card 0 Interrupt */ - SC1_IRQn = 59, /*!< Smart Card 1 Interrupt */ - SC2_IRQn = 60, /*!< Smart Card 2 Interrupt */ - GPJ_IRQn = 61, /*!< GPIO Port J Interrupt */ - SPI3_IRQn = 62, /*!< SPI3 Interrupt */ - SPI4_IRQn = 63, /*!< SPI4 Interrupt */ - EMAC0_TXRX_IRQn = 66, /*!< Ethernet MAC 0 Interrupt */ - SDH0_IRQn = 64, /*!< Secure Digital Host Controller 0 Interrupt */ - USBD20_IRQn = 65, /*!< High Speed USB device Interrupt */ - I2S0_IRQn = 68, /*!< I2S0 Interrupt */ - I2S1_IRQn = 69, /*!< I2S1 Interrupt */ - SPI6_IRQn = 70, /*!< SPI6 Interrupt */ - CRPT_IRQn = 71, /*!< CRPT Interrupt */ - GPG_IRQn = 72, /*!< GPIO Port G Interrupt */ - EINT6_IRQn = 73, /*!< External Input 6 Interrupt */ - UART4_IRQn = 74, /*!< UART4 Interrupt */ - UART5_IRQn = 75, /*!< UART5 Interrupt */ - USCI0_IRQn = 76, /*!< USCI0 Interrupt */ - SPI7_IRQn = 77, /*!< SPI7 Interrupt */ - BPWM0_IRQn = 78, /*!< BPWM0 Interrupt */ - BPWM1_IRQn = 79, /*!< BPWM1 Interrupt */ - SPIM_IRQn = 80, /*!< SPIM Interrupt */ - CCAP_IRQn = 81, /*!< CCAP Interrupt */ - I2C2_IRQn = 82, /*!< I2C2 Interrupt */ - I2C3_IRQn = 83, /*!< I2C3 Interrupt */ - EQEI0_IRQn = 84, /*!< EQEI0 Interrupt */ - EQEI1_IRQn = 85, /*!< EQEI1 Interrupt */ - ECAP0_IRQn = 86, /*!< ECAP0 Interrupt */ - ECAP1_IRQn = 87, /*!< ECAP1 Interrupt */ - GPH_IRQn = 88, /*!< GPIO Port H Interrupt */ - EINT7_IRQn = 89, /*!< External Input 7 Interrupt */ - SDH1_IRQn = 90, /*!< Secure Digital Host Controller 1 Interrupt */ - PSIO_IRQn = 91, /*!< PSIO Interrupt */ - HSUSBH_IRQn = 92, /*!< High speed USB host Interrupt */ - USBOTG20_IRQn = 93, /*!< High speed USB OTG Interrupt */ - ECAP2_IRQn = 94, /*!< ECAP2 Interrupt */ - ECAP3_IRQn = 95, /*!< ECAP3 Interrupt */ - KPI_IRQn = 96, /*!< Keypad Interface Interrupt */ - HBI_IRQn = 97, /*!< HBI Interrupt */ - PDMA1_IRQn = 98, /*!< Peripheral DMA 1 Interrupt */ - UART8_IRQn = 99, /*!< UART8 Interrupt */ - UART9_IRQn = 100, /*!< UART9 Interrupt */ - TRNG_IRQn = 101, /*!< TRNG Interrupt */ - UART6_IRQn = 102, /*!< UART6 Interrupt */ - UART7_IRQn = 103, /*!< UART7 Interrupt */ - EADC10_IRQn = 104, /*!< EADC10 Interrupt */ - EADC11_IRQn = 105, /*!< EADC11 Interrupt */ - EADC12_IRQn = 106, /*!< EADC12 Interrupt */ - EADC13_IRQn = 107, /*!< EADC13 Interrupt */ - SPI8_IRQn = 108, /*!< SPI8 Interrupt */ - KS_IRQn = 109, /*!< Keystore Interrupt */ - GPI_IRQn = 110, /*!< GPIO Port I Interrupt */ - SPI9_IRQn = 111, /*!< SPI9 Interrupt */ - CANFD00_IRQn = 112, /*!< CANFD00 Interrupt */ - CANFD01_IRQn = 113, /*!< CANFD01 Interrupt */ - CANFD10_IRQn = 114, /*!< CANFD10 Interrupt */ - CANFD11_IRQn = 115, /*!< CANFD11 Interrupt */ - EQEI2_IRQn = 116, /*!< EQEI2 Interrupt */ - EQEI3_IRQn = 117, /*!< EQEI3 Interrupt */ - I2C4_IRQn = 118, /*!< I2C4 Interrupt */ - SPI10_IRQn = 119, /*!< SPI10 Interrupt */ - CANFD20_IRQn = 120, /*!< CANFD20 Interrupt */ - CANFD21_IRQn = 121, /*!< CANFD21 Interrupt */ - CANFD30_IRQn = 122, /*!< CANFD30 Interrupt */ - CANFD31_IRQn = 123, /*!< CANFD31 Interrupt */ - EADC20_IRQn = 124, /*!< EADC20 Interrupt */ - EADC21_IRQn = 125, /*!< EADC21 Interrupt */ - EADC22_IRQn = 126, /*!< EADC22 Interrupt */ - EADC23_IRQn = 127, /*!< EADC23 Interrupt */ -} -IRQn_Type; - - -/* - * ========================================================================== - * ----------- Processor and Core Peripheral Section ------------------------ - * ========================================================================== - */ - -/* Configuration of the Cortex-M4 Processor and Core Peripherals */ -#define __CM4_REV 0x0201UL /*!< Core Revision r2p1 */ -#define __NVIC_PRIO_BITS 4UL /*!< Number of Bits used for Priority Levels */ -#define __Vendor_SysTickConfig 0UL /*!< Set to 1 if different SysTick Config is used */ -#define __MPU_PRESENT 1UL /*!< MPU present or not */ -#ifdef __FPU_PRESENT -#undef __FPU_PRESENT -#define __FPU_PRESENT 1UL /*!< FPU present or not */ -#else -#define __FPU_PRESENT 1UL /*!< FPU present or not */ -#endif - -/*@}*/ /* end of group CMSIS_Device */ - - -#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ -#include "system_m460.h" /* System include file */ -#include - - - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/******************************************************************************/ -/* Register definitions */ -/******************************************************************************/ - -#include "sys_reg.h" -#include "clk_reg.h" -#include "fmc_reg.h" -#include "gpio_reg.h" -#include "pdma_reg.h" -#include "timer_reg.h" -#include "wdt_reg.h" -#include "wwdt_reg.h" -#include "rtc_reg.h" -#include "epwm_reg.h" -#include "bpwm_reg.h" -#include "eqei_reg.h" -#include "ecap_reg.h" -#include "uart_reg.h" -#include "emac_reg.h" -#include "sc_reg.h" -#include "i2s_reg.h" -#include "spi_reg.h" -#include "qspi_reg.h" -#include "spim_reg.h" -#include "i2c_reg.h" -#include "uuart_reg.h" -#include "uspi_reg.h" -#include "ui2c_reg.h" -#include "canfd_reg.h" -#include "sdh_reg.h" -#include "ebi_reg.h" -#include "usbd_reg.h" -#include "hsusbd_reg.h" -#include "usbh_reg.h" -#include "hsusbh_reg.h" -#include "otg_reg.h" -#include "hsotg_reg.h" -#include "crc_reg.h" -#include "crypto_reg.h" -#include "trng_reg.h" -#include "eadc_reg.h" -#include "dac_reg.h" -#include "acmp_reg.h" -#include "ccap_reg.h" -#include "keystore_reg.h" -#include "kpi_reg.h" -#include "psio_reg.h" -#include "hbi_reg.h" -#include "bmc_reg.h" - -/** @addtogroup PERIPHERAL_MEM_MAP Peripheral Memory Base - Memory Mapped Structure for Peripherals - @{ - */ -/* Peripheral and SRAM base address */ -#define FLASH_BASE ((uint32_t)0x00000000) /*!< Flash base address */ -#define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM Base Address */ -#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral Base Address */ - -#define TCM_BASE (PERIPH_BASE + 0xBE000) - -/*!< AHB peripherals */ -//HCLK -// CPU,CRC,EBI,EMC,FMC,PDMA,SD0,SD1,CRPT,SPIM,SRAM,HSUSBD, HSUSBH, USBH -#define SYS_BASE (PERIPH_BASE + 0x00000UL) -#define CLK_BASE (PERIPH_BASE + 0x00200UL) -#define NMI_BASE (PERIPH_BASE + 0x00300UL) -#define GPIOA_BASE (PERIPH_BASE + 0x04000UL) -#define GPIOB_BASE (PERIPH_BASE + 0x04040UL) -#define GPIOC_BASE (PERIPH_BASE + 0x04080UL) -#define GPIOD_BASE (PERIPH_BASE + 0x040C0UL) -#define GPIOE_BASE (PERIPH_BASE + 0x04100UL) -#define GPIOF_BASE (PERIPH_BASE + 0x04140UL) -#define GPIOG_BASE (PERIPH_BASE + 0x04180UL) -#define GPIOH_BASE (PERIPH_BASE + 0x041C0UL) -#define GPIOI_BASE (PERIPH_BASE + 0x04200UL) -#define GPIOJ_BASE (PERIPH_BASE + 0x04240UL) -#define GPIO_INT_BASE (PERIPH_BASE + 0x04450UL) -#define GPIO_PIN_DATA_BASE (PERIPH_BASE + 0x04800UL) -#define SPIM_BASE (PERIPH_BASE + 0x07000UL) -#define PDMA0_BASE (PERIPH_BASE + 0x08000UL) -#define PDMA1_BASE (PERIPH_BASE + 0x18000UL) -#define USBH_BASE (PERIPH_BASE + 0x09000UL) -#define HSUSBH_BASE (PERIPH_BASE + 0x1A000UL) -#define EMAC_BASE (PERIPH_BASE + 0x12000UL) -#define FMC_BASE (PERIPH_BASE + 0x0C000UL) -#define SDH0_BASE (PERIPH_BASE + 0x0D000UL) -#define SDH1_BASE (PERIPH_BASE + 0x0E000UL) -#define EBI_BASE (PERIPH_BASE + 0x10000UL) -#define HSUSBD_BASE (PERIPH_BASE + 0x19000UL) -#define CCAP_BASE (PERIPH_BASE + 0x30000UL) -#define CRC_BASE (PERIPH_BASE + 0x31000UL) -#define CRPT_BASE (PERIPH_BASE + 0x32000UL) -#define KS_BASE (PERIPH_BASE + 0x35000UL) -#define TAMPER_BASE (PERIPH_BASE + 0xE1000UL) -#define HBI_BASE (PERIPH_BASE + 0xCE000UL) -#define BMC_BASE (PERIPH_BASE + 0x1B000UL) - -//PCLK0 -// BPWM0,QSPI0,ECAP2,I2C0/2/4,I2S0,OPA,EPWM0,EQEI0/2,SC0/2,SPI1/3/5/7/9,TMR01,UR0/2/4/6/8,USBD,USCI0,WDT - -/*!< APB0 peripherals */ -#define WDT_BASE (PERIPH_BASE + 0x40000UL) -#define WWDT_BASE (PERIPH_BASE + 0x40100UL) -#define OPA_BASE (PERIPH_BASE + 0x46000UL) -#define I2S0_BASE (PERIPH_BASE + 0x48000UL) -#define EADC1_BASE (PERIPH_BASE + 0x4B000UL) -#define TIMER0_BASE (PERIPH_BASE + 0x50000UL) -#define TIMER1_BASE (PERIPH_BASE + 0x50100UL) -#define EPWM0_BASE (PERIPH_BASE + 0x58000UL) -#define BPWM0_BASE (PERIPH_BASE + 0x5A000UL) -#define QSPI0_BASE (PERIPH_BASE + 0x60000UL) -#define SPI1_BASE (PERIPH_BASE + 0x62000UL) -#define SPI3_BASE (PERIPH_BASE + 0x64000UL) -#define SPI5_BASE (PERIPH_BASE + 0x66000UL) -#define SPI7_BASE (PERIPH_BASE + 0x68000UL) -#define SPI9_BASE (PERIPH_BASE + 0x6C000UL) -#define UART0_BASE (PERIPH_BASE + 0x70000UL) -#define UART2_BASE (PERIPH_BASE + 0x72000UL) -#define UART4_BASE (PERIPH_BASE + 0x74000UL) -#define UART6_BASE (PERIPH_BASE + 0x76000UL) -#define UART8_BASE (PERIPH_BASE + 0x78000UL) -#define I2C0_BASE (PERIPH_BASE + 0x80000UL) -#define I2C2_BASE (PERIPH_BASE + 0x82000UL) -#define CANFD0_BASE (PERIPH_BASE + 0x20000UL) -#define CANFD2_BASE (PERIPH_BASE + 0x28000UL) -#define EQEI0_BASE (PERIPH_BASE + 0xB0000UL) -#define ECAP0_BASE (PERIPH_BASE + 0xB4000UL) -#define USCI0_BASE (PERIPH_BASE + 0xD0000UL) - - - -//PCLK1 -// ACMP01/23,EADC0/1/2,BPWM1,DAC,ECAP1/3,I2C1/3,I2S1,OTG,HSOTG,EPWM1,QEI1/3,RTC,SC1,SPI0/2/4/6/8/10,QSPI1,TMR23,UR1/3/5/7/9,PSIO - -/*!< APB1 peripherals */ -#define RTC_BASE (PERIPH_BASE + 0x41000UL) -#define EADC0_BASE (PERIPH_BASE + 0x43000UL) -#define ACMP01_BASE (PERIPH_BASE + 0x45000UL) -#define I2S1_BASE (PERIPH_BASE + 0x49000UL) -#define USBD_BASE (PERIPH_BASE + 0xC0000UL) -#define EADC1_BASE (PERIPH_BASE + 0x4B000UL) -#define OTG_BASE (PERIPH_BASE + 0x4D000UL) -#define HSOTG_BASE (PERIPH_BASE + 0x4F000UL) -#define TIMER2_BASE (PERIPH_BASE + 0x51000UL) -#define TIMER3_BASE (PERIPH_BASE + 0x51100UL) -#define EADC2_BASE (PERIPH_BASE + 0x97000UL) -#define EPWM1_BASE (PERIPH_BASE + 0x59000UL) -#define BPWM1_BASE (PERIPH_BASE + 0x5B000UL) -#define SPI0_BASE (PERIPH_BASE + 0x61000UL) -#define SPI2_BASE (PERIPH_BASE + 0x63000UL) -#define SPI4_BASE (PERIPH_BASE + 0x65000UL) -#define SPI6_BASE (PERIPH_BASE + 0x67000UL) -#define QSPI1_BASE (PERIPH_BASE + 0x69000UL) -#define SPI8_BASE (PERIPH_BASE + 0x6B000UL) -#define SPI10_BASE (PERIPH_BASE + 0x6D000UL) -#define UART1_BASE (PERIPH_BASE + 0x71000UL) -#define UART3_BASE (PERIPH_BASE + 0x73000UL) -#define UART5_BASE (PERIPH_BASE + 0x75000UL) -#define UART7_BASE (PERIPH_BASE + 0x77000UL) -#define UART9_BASE (PERIPH_BASE + 0x79000UL) -#define I2C1_BASE (PERIPH_BASE + 0x81000UL) -#define CANFD1_BASE (PERIPH_BASE + 0x24000UL) -#define CANFD3_BASE (PERIPH_BASE + 0x2C000UL) -#define EQEI1_BASE (PERIPH_BASE + 0xB1000UL) -#define ECAP1_BASE (PERIPH_BASE + 0xB5000UL) -#define TRNG_BASE (PERIPH_BASE + 0xB9000UL) -#define ECAP2_BASE (PERIPH_BASE + 0xB6000UL) -#define ECAP3_BASE (PERIPH_BASE + 0xB7000UL) -#define EQEI2_BASE (PERIPH_BASE + 0xB2000UL) -#define EQEI3_BASE (PERIPH_BASE + 0xB3000UL) -#define I2C3_BASE (PERIPH_BASE + 0x83000UL) -#define I2C4_BASE (PERIPH_BASE + 0x84000UL) -#define SC0_BASE (PERIPH_BASE + 0x90000UL) -#define SC1_BASE (PERIPH_BASE + 0x91000UL) -#define SC2_BASE (PERIPH_BASE + 0x92000UL) -#define DAC0_BASE (PERIPH_BASE + 0x47000UL) -#define DAC1_BASE (PERIPH_BASE + 0x47040UL) -#define DACDBG_BASE (PERIPH_BASE + 0x47FECUL) -#define OPA0_BASE (PERIPH_BASE + 0x46000UL) - -#define KPI_BASE (PERIPH_BASE + 0x0C2000UL) -#define PSIO_BASE (PERIPH_BASE + 0x0C3000UL) -#define ACMP23_BASE (PERIPH_BASE + 0x0C9000UL) - - - -/*@}*/ /* end of group PERIPHERAL_MEM_MAP */ - - -/** @addtogroup PERIPHERAL_DECLARATION Peripheral Pointer - The Declaration of Peripherals - @{ - */ - -#define TCM ((TCM_T *) TCM_BASE) -#define SYS ((SYS_T *) SYS_BASE) -#define CLK ((CLK_T *) CLK_BASE) -#define NMI ((NMI_T *) NMI_BASE) -#define PA ((GPIO_T *) GPIOA_BASE) -#define PB ((GPIO_T *) GPIOB_BASE) -#define PC ((GPIO_T *) GPIOC_BASE) -#define PD ((GPIO_T *) GPIOD_BASE) -#define PE ((GPIO_T *) GPIOE_BASE) -#define PF ((GPIO_T *) GPIOF_BASE) -#define PG ((GPIO_T *) GPIOG_BASE) -#define PH ((GPIO_T *) GPIOH_BASE) -#define PI ((GPIO_T *) GPIOI_BASE) -#define PJ ((GPIO_T *) GPIOJ_BASE) -#define GPA ((GPIO_T *) GPIOA_BASE) -#define GPB ((GPIO_T *) GPIOB_BASE) -#define GPC ((GPIO_T *) GPIOC_BASE) -#define GPD ((GPIO_T *) GPIOD_BASE) -#define GPE ((GPIO_T *) GPIOE_BASE) -#define GPF ((GPIO_T *) GPIOF_BASE) -#define GPG ((GPIO_T *) GPIOG_BASE) -#define GPH ((GPIO_T *) GPIOH_BASE) -#define GPI ((GPIO_T *) GPIOI_BASE) -#define GPJ ((GPIO_T *) GPIOJ_BASE) -#define GPIO ((GPIO_INT_T *) GPIO_INT_BASE) -#define PDMA0 ((PDMA_T *) PDMA0_BASE) -#define PDMA1 ((PDMA_T *) PDMA1_BASE) -#define USBH ((USBH_T *) USBH_BASE) -#define HSUSBH ((HSUSBH_T *) HSUSBH_BASE) -#define EMAC ((EMAC_T *) EMAC_BASE) -#define FMC ((FMC_T *) FMC_BASE) -#define SDH0 ((SDH_T *) SDH0_BASE) -#define SDH1 ((SDH_T *) SDH1_BASE) -#define EBI ((EBI_T *) EBI_BASE) -#define CRC ((CRC_T *) CRC_BASE) -#define TAMPER ((TAMPER_T *) TAMPER_BASE) -#define KS ((KS_T *) KS_BASE) -#define HBI ((HBI_T *) HBI_BASE) -#define WDT ((WDT_T *) WDT_BASE) -#define WWDT ((WWDT_T *) WWDT_BASE) -#define RTC ((RTC_T *) RTC_BASE) -#define EADC0 ((EADC_T *) EADC0_BASE) -#define EADC1 ((EADC_T *) EADC1_BASE) -#define EADC2 ((EADC_T *) EADC2_BASE) -#define ACMP01 ((ACMP_T *) ACMP01_BASE) -#define ACMP23 ((ACMP_T *) ACMP23_BASE) -#define KPI ((KPI_T *) KPI_BASE) - -#define I2S0 ((I2S_T *) I2S0_BASE) -#define I2S1 ((I2S_T *) I2S1_BASE) -#define USBD ((USBD_T *) USBD_BASE) -#define OTG ((OTG_T *) OTG_BASE) -#define HSUSBD ((HSUSBD_T *)HSUSBD_BASE) -#define HSOTG ((HSOTG_T *) HSOTG_BASE) -#define TIMER0 ((TIMER_T *) TIMER0_BASE) -#define TIMER1 ((TIMER_T *) TIMER1_BASE) -#define TIMER2 ((TIMER_T *) TIMER2_BASE) -#define TIMER3 ((TIMER_T *) TIMER3_BASE) -#define EPWM0 ((EPWM_T *) EPWM0_BASE) -#define EPWM1 ((EPWM_T *) EPWM1_BASE) -#define BPWM0 ((BPWM_T *) BPWM0_BASE) -#define BPWM1 ((BPWM_T *) BPWM1_BASE) -#define ECAP0 ((ECAP_T *) ECAP0_BASE) -#define ECAP1 ((ECAP_T *) ECAP1_BASE) -#define ECAP2 ((ECAP_T *) ECAP2_BASE) -#define ECAP3 ((ECAP_T *) ECAP3_BASE) -#define EQEI0 ((EQEI_T *) EQEI0_BASE) -#define EQEI1 ((EQEI_T *) EQEI1_BASE) -#define EQEI2 ((EQEI_T *) EQEI2_BASE) -#define EQEI3 ((EQEI_T *) EQEI3_BASE) -#define QSPI0 ((QSPI_T *) QSPI0_BASE) -#define QSPI1 ((QSPI_T *) QSPI1_BASE) -#define SPI0 ((SPI_T *) SPI0_BASE) -#define SPI1 ((SPI_T *) SPI1_BASE) -#define SPI2 ((SPI_T *) SPI2_BASE) -#define SPI3 ((SPI_T *) SPI3_BASE) -#define SPI4 ((SPI_T *) SPI4_BASE) -#define SPI5 ((SPI_T *) SPI5_BASE) -#define SPI6 ((SPI_T *) SPI6_BASE) -#define SPI7 ((SPI_T *) SPI7_BASE) -#define SPI8 ((SPI_T *) SPI8_BASE) -#define SPI9 ((SPI_T *) SPI9_BASE) -#define SPI10 ((SPI_T *) SPI10_BASE) -#define UART0 ((UART_T *) UART0_BASE) -#define UART1 ((UART_T *) UART1_BASE) -#define UART2 ((UART_T *) UART2_BASE) -#define UART3 ((UART_T *) UART3_BASE) -#define UART4 ((UART_T *) UART4_BASE) -#define UART5 ((UART_T *) UART5_BASE) -#define UART6 ((UART_T *) UART6_BASE) -#define UART7 ((UART_T *) UART7_BASE) -#define UART8 ((UART_T *) UART8_BASE) -#define UART9 ((UART_T *) UART9_BASE) -#define I2C0 ((I2C_T *) I2C0_BASE) -#define I2C1 ((I2C_T *) I2C1_BASE) -#define I2C2 ((I2C_T *) I2C2_BASE) -#define I2C3 ((I2C_T *) I2C3_BASE) -#define I2C4 ((I2C_T *) I2C4_BASE) -#define SC0 ((SC_T *) SC0_BASE) -#define SC1 ((SC_T *) SC1_BASE) -#define SC2 ((SC_T *) SC2_BASE) -#define CANFD0 ((CANFD_T *) CANFD0_BASE) -#define CANFD1 ((CANFD_T *) CANFD1_BASE) -#define CANFD2 ((CANFD_T *) CANFD2_BASE) -#define CANFD3 ((CANFD_T *) CANFD3_BASE) -#define CRPT ((CRPT_T *) CRPT_BASE) -#define TRNG ((TRNG_T *) TRNG_BASE) -#define SPIM ((volatile SPIM_T *) SPIM_BASE) -#define DAC0 ((DAC_T *) DAC0_BASE) -#define DAC1 ((DAC_T *) DAC1_BASE) -#define USPI0 ((USPI_T *) USCI0_BASE) /*!< USPI0 Configuration Struct */ -#define OPA ((OPA_T *) OPA_BASE) -#define UI2C0 ((UI2C_T *) USCI0_BASE) /*!< UI2C0 Configuration Struct */ -#define UI2C1 ((UI2C_T *) USCI1_BASE) /*!< UI2C1 Configuration Struct */ -#define UUART0 ((UUART_T *) USCI0_BASE) /*!< UUART0 Configuration Struct */ -#define CCAP ((CCAP_T *) CCAP_BASE) -#define PSIO ((PSIO_T *) PSIO_BASE) -#define BMC ((BMC_T *) BMC_BASE) - -/*@}*/ /* end of group ERIPHERAL_DECLARATION */ - -/** @addtogroup IO_ROUTINE I/O Routines - The Declaration of I/O Routines - @{ - */ - -typedef volatile unsigned char vu8; ///< Define 8-bit unsigned volatile data type -typedef volatile unsigned short vu16; ///< Define 16-bit unsigned volatile data type -typedef volatile unsigned int vu32; ///< Define 32-bit unsigned volatile data type - -/** - * @brief Get a 8-bit unsigned value from specified address - * @param[in] addr Address to get 8-bit data from - * @return 8-bit unsigned value stored in specified address - */ -#define M8(addr) (*((vu8 *) (addr))) - -/** - * @brief Get a 16-bit unsigned value from specified address - * @param[in] addr Address to get 16-bit data from - * @return 16-bit unsigned value stored in specified address - * @note The input address must be 16-bit aligned - */ -#define M16(addr) (*((vu16 *) (addr))) - -/** - * @brief Get a 32-bit unsigned value from specified address - * @param[in] addr Address to get 32-bit data from - * @return 32-bit unsigned value stored in specified address - * @note The input address must be 32-bit aligned - */ -#define M32(addr) (*((vu32 *) (addr))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outpw(port,value) *((volatile unsigned int *)(port)) = (value) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inpw(port) (*((volatile unsigned int *)(port))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outps(port,value) *((volatile unsigned short *)(port)) = (value) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inps(port) (*((volatile unsigned short *)(port))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outpb(port,value) *((volatile unsigned char *)(port)) = (value) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inpb(port) (*((volatile unsigned char *)(port))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outp32(port,value) *((volatile unsigned int *)(port)) = (value) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inp32(port) (*((volatile unsigned int *)(port))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outp16(port,value) *((volatile unsigned short *)(port)) = (value) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inp16(port) (*((volatile unsigned short *)(port))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outp8(port,value) *((volatile unsigned char *)(port)) = (value) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inp8(port) (*((volatile unsigned char *)(port))) - - -/*@}*/ /* end of group IO_ROUTINE */ - -/******************************************************************************/ -/* Legacy Constants */ -/******************************************************************************/ -/** @addtogroup Legacy_Constants Legacy Constants - Legacy Constants - @{ -*/ - -#ifndef NULL -#define NULL (0) ///< NULL pointer -#endif - -#define TRUE (1UL) ///< Boolean true, define to use in API parameters or return value -#define FALSE (0UL) ///< Boolean false, define to use in API parameters or return value - -#define ENABLE (1UL) ///< Enable, define to use in API parameters -#define DISABLE (0UL) ///< Disable, define to use in API parameters - -/* Define one bit mask */ -#define BIT0 (0x00000001UL) ///< Bit 0 mask of an 32 bit integer -#define BIT1 (0x00000002UL) ///< Bit 1 mask of an 32 bit integer -#define BIT2 (0x00000004UL) ///< Bit 2 mask of an 32 bit integer -#define BIT3 (0x00000008UL) ///< Bit 3 mask of an 32 bit integer -#define BIT4 (0x00000010UL) ///< Bit 4 mask of an 32 bit integer -#define BIT5 (0x00000020UL) ///< Bit 5 mask of an 32 bit integer -#define BIT6 (0x00000040UL) ///< Bit 6 mask of an 32 bit integer -#define BIT7 (0x00000080UL) ///< Bit 7 mask of an 32 bit integer -#define BIT8 (0x00000100UL) ///< Bit 8 mask of an 32 bit integer -#define BIT9 (0x00000200UL) ///< Bit 9 mask of an 32 bit integer -#define BIT10 (0x00000400UL) ///< Bit 10 mask of an 32 bit integer -#define BIT11 (0x00000800UL) ///< Bit 11 mask of an 32 bit integer -#define BIT12 (0x00001000UL) ///< Bit 12 mask of an 32 bit integer -#define BIT13 (0x00002000UL) ///< Bit 13 mask of an 32 bit integer -#define BIT14 (0x00004000UL) ///< Bit 14 mask of an 32 bit integer -#define BIT15 (0x00008000UL) ///< Bit 15 mask of an 32 bit integer -#define BIT16 (0x00010000UL) ///< Bit 16 mask of an 32 bit integer -#define BIT17 (0x00020000UL) ///< Bit 17 mask of an 32 bit integer -#define BIT18 (0x00040000UL) ///< Bit 18 mask of an 32 bit integer -#define BIT19 (0x00080000UL) ///< Bit 19 mask of an 32 bit integer -#define BIT20 (0x00100000UL) ///< Bit 20 mask of an 32 bit integer -#define BIT21 (0x00200000UL) ///< Bit 21 mask of an 32 bit integer -#define BIT22 (0x00400000UL) ///< Bit 22 mask of an 32 bit integer -#define BIT23 (0x00800000UL) ///< Bit 23 mask of an 32 bit integer -#define BIT24 (0x01000000UL) ///< Bit 24 mask of an 32 bit integer -#define BIT25 (0x02000000UL) ///< Bit 25 mask of an 32 bit integer -#define BIT26 (0x04000000UL) ///< Bit 26 mask of an 32 bit integer -#define BIT27 (0x08000000UL) ///< Bit 27 mask of an 32 bit integer -#define BIT28 (0x10000000UL) ///< Bit 28 mask of an 32 bit integer -#define BIT29 (0x20000000UL) ///< Bit 29 mask of an 32 bit integer -#define BIT30 (0x40000000UL) ///< Bit 30 mask of an 32 bit integer -#define BIT31 (0x80000000UL) ///< Bit 31 mask of an 32 bit integer - -/* Byte Mask Definitions */ -#define BYTE0_Msk (0x000000FFUL) ///< Mask to get bit0~bit7 from a 32 bit integer -#define BYTE1_Msk (0x0000FF00UL) ///< Mask to get bit8~bit15 from a 32 bit integer -#define BYTE2_Msk (0x00FF0000UL) ///< Mask to get bit16~bit23 from a 32 bit integer -#define BYTE3_Msk (0xFF000000UL) ///< Mask to get bit24~bit31 from a 32 bit integer - -#define GET_BYTE0(u32Param) (((u32Param) & BYTE0_Msk) ) /*!< Extract Byte 0 (Bit 0~ 7) from parameter u32Param */ -#define GET_BYTE1(u32Param) (((u32Param) & BYTE1_Msk) >> 8) /*!< Extract Byte 1 (Bit 8~15) from parameter u32Param */ -#define GET_BYTE2(u32Param) (((u32Param) & BYTE2_Msk) >> 16) /*!< Extract Byte 2 (Bit 16~23) from parameter u32Param */ -#define GET_BYTE3(u32Param) (((u32Param) & BYTE3_Msk) >> 24) /*!< Extract Byte 3 (Bit 24~31) from parameter u32Param */ - -/*@}*/ /* end of group Legacy_Constants */ - - -/******************************************************************************/ -/* Peripheral header files */ -/******************************************************************************/ -#include "nu_sys.h" -#include "nu_clk.h" - -#include "nu_kpi.h" -#include "nu_rng.h" -#include "nu_keystore.h" -#include "nu_acmp.h" -#include "nu_dac.h" -#include "nu_uart.h" -#include "nu_usci_spi.h" -#include "nu_gpio.h" -#include "nu_ccap.h" -#include "nu_ecap.h" -#include "nu_hbi.h" -#include "nu_eqei.h" -#include "nu_timer.h" -#include "nu_timer_pwm.h" -#include "nu_pdma.h" -#include "nu_crypto.h" -#include "nu_trng.h" -#include "nu_fmc.h" -#include "nu_spim.h" -#include "nu_i2c.h" -#include "nu_i2s.h" -#include "nu_epwm.h" -#include "nu_eadc.h" -#include "nu_bpwm.h" -#include "nu_wdt.h" -#include "nu_wwdt.h" -#include "nu_crc.h" -#include "nu_ebi.h" -#include "nu_usci_i2c.h" -#include "nu_scuart.h" -#include "nu_sc.h" -#include "nu_spi.h" -#include "nu_qspi.h" -#include "nu_canfd.h" -#include "nu_rtc.h" -#include "nu_usci_uart.h" -#include "nu_sdh.h" -#include "nu_usbd.h" -#include "nu_hsusbd.h" -#include "nu_otg.h" -#include "nu_hsotg.h" -#include "nu_psio.h" -#include "nu_bmc.h" - - -#ifdef __cplusplus -} -#endif - -#endif /* __M460_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/opa_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/opa_reg.h deleted file mode 100644 index 32112ed157d..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/opa_reg.h +++ /dev/null @@ -1,268 +0,0 @@ -/**************************************************************************//** - * @file opa_reg.h - * @version V1.00 - * @brief OPA register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __OPA_REG_H__ -#define __OPA_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup OPA OP Amplifier(OPA) - Memory Mapped Structure for OPA Controller -@{ */ - -typedef struct -{ - - - /** - * @var OPA_T::CTL - * Offset: 0x00 OP Amplifier Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OPEN0 |OP Amplifier 0 Enable Bit - * | | |0 = OP amplifier0 Disabled. - * | | |1 = OP amplifier0 Enabled. - * | | |Note: OP Amplifier 0 output needs wait stable 20u03BCs after OPEN0 is set. - * |[1] |OPEN1 |OP Amplifier 1 Enable Bit - * | | |0 = OP amplifier1 Disabled. - * | | |1 = OP amplifier1 Enabled. - * | | |Note: OP Amplifier 1 output needs wait stable 20u03BCs after OPEN1 is set. - * |[2] |OPEN2 |OP Amplifier 2 Enable Bit - * | | |0 = OP amplifier2 Disabled. - * | | |1 = OP amplifier2 Enabled. - * | | |Note: OP Amplifier 2 output needs wait stable 20u03BCs after OPEN2 is set. - * |[4] |OPDOEN0 |OP Amplifier 0 Schmitt Trigger Non-inverting Buffer Enable Bit - * | | |0 = OP amplifier0 Schmitt Trigger non-invert buffer Disabled. - * | | |1 = OP amplifier0 Schmitt Trigger non-invert buffer Enabled. - * |[5] |OPDOEN1 |OP Amplifier 1 Schmitt Trigger Non-inverting Buffer Enable Bit - * | | |0 = OP amplifier1 Schmitt Trigger non-invert buffer Disabled. - * | | |1 = OP amplifier1 Schmitt Trigger non-invert buffer Enabled. - * |[6] |OPDOEN2 |OP Amplifier 2 Schmitt Trigger Non-inverting Buffer Enable Bit - * | | |0 = OP amplifier2 Schmitt Trigger non-invert buffer Disabled. - * | | |1 = OP amplifier2 Schmitt Trigger non-invert buffer Enabled. - * |[8] |OPDOIEN0 |OP Amplifier 0 Schmitt Trigger Digital Output Interrupt Enable Bit - * | | |0 = OP Amplifier 0 digital output interrupt function Disabled. - * | | |1 = OP Amplifier 0 digital output interrupt function Enabled. - * | | |The OPDOIF0 interrupt flag is set by hardware whenever the OP amplifier 0 Schmitt Trigger non-inverting buffer digital output changes state, in the meanwhile, if OPDOIEN0 is set to 1, a comparator interrupt request is generated. - * |[9] |OPDOIEN1 |OP Amplifier 1 Schmitt Trigger Digital Output Interrupt Enable Bit - * | | |0 = OP Amplifier 1 digital output interrupt function Disabled. - * | | |1 = OP Amplifier 1 digital output interrupt function Enabled. - * | | |OPDOIF1 interrupt flag is set by hardware whenever the OP amplifier 1 Schmitt trigger non-inverting buffer digital output changes state, in the meanwhile, if OPDOIEN1 is set to 1, a comparator interrupt request is generated. - * |[10] |OPDOIEN2 |OP Amplifier 2 Schmitt Trigger Digital Output Interrupt Enable Bit - * | | |0 = OP Amplifier 2 digital output interrupt function Disabled. - * | | |1 = OP Amplifier 2 digital output interrupt function Enabled. - * | | |OPDOIF2 interrupt flag is set by hardware whenever the OP amplifier 2 Schmitt Trigger non-inverting buffer digital output changes state, in the meanwhile, if OPDOIEN2 is set to 1, a comparator interrupt request is generated. - * @var OPA_T::STATUS - * Offset: 0x04 OP Amplifier Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OPDO0 |OP Amplifier 0 Digital Output - * | | |Synchronized to the APB clock to allow reading by software - * | | |Cleared when the Schmitt Trigger buffer is disabled (OPDOEN0 = 0) - * |[1] |OPDO1 |OP Amplifier 1 Digital Output - * | | |Synchronized to the APB clock to allow reading by software - * | | |Cleared when the Schmitt Trigger buffer is disabled (OPDOEN1 = 0) - * |[2] |OPDO2 |OP Amplifier 2 Digital Output - * | | |Synchronized to the APB clock to allow reading by software - * | | |Cleared when the Schmitt Trigger buffer is disabled (OPDOEN2 = 0) - * |[4] |OPDOIF0 |OP Amplifier 0 Schmitt Trigger Digital Output Interrupt Flag - * | | |OPDOIF0 interrupt flag is set by hardware whenever the OP amplifier 0 Schmitt Trigger non-inverting buffer digital output changes state - * | | |This bit is cleared by writing 1 to it. - * |[5] |OPDOIF1 |OP Amplifier 1 Schmitt Trigger Digital Output Interrupt Flag - * | | |OPDOIF1 interrupt flag is set by hardware whenever the OP amplifier 1 Schmitt Trigger non-inverting buffer digital output changes state - * | | |This bit is cleared by writing 1 to it. - * |[6] |OPDOIF2 |OP Amplifier 2 Schmitt Trigger Digital Output Interrupt Flag - * | | |OPDOIF2 interrupt flag is set by hardware whenever the OP amplifier 2 Schmitt Trigger non-inverting buffer digital output changes state - * | | |This bit is cleared by writing 1 to it. - * @var OPA_T::CALCTL - * Offset: 0x08 OP Amplifier Calibration Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CALTRG0 |OP Amplifier 0 Calibration Trigger Bit - * | | |0 = Stop, hardware auto clear. - * | | |1 = Start. Note: Before enable this bit, it should set OPEN0 in advance. - * |[1] |CALTRG1 |OP Amplifier 1 Calibration Trigger Bit - * | | |0 = Stop, hardware auto clear. - * | | |1 = Start. Note: Before enable this bit, it should set OPEN1 in advance. - * |[2] |CALTRG2 |OP Amplifier 2 Calibration Trigger Bit - * | | |0 = Stop, hardware auto clear. - * | | |1 = Start. Note: Before enable this bit, it should set OPEN2 in advance. - * |[16] |CALRVS0 |OPA0 Calibration Reference Voltage Selection - * | | |0 = VREF is AVDD. - * | | |1 = VREF from high vcm to low vcm. - * |[17] |CALRVS1 |OPA1 Calibration Reference Voltage Selection - * | | |0 = VREF is AVDD. - * | | |1 = VREF from high vcm to low vcm. - * |[18] |CALRVS2 |OPA2 Calibration Reference Voltage Selection - * | | |0 = VREF is AVDD. - * | | |1 = VREF from high vcm to low vcm. - * @var OPA_T::CALST - * Offset: 0x0C OP Amplifier Calibration Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DONE0 |OP Amplifier 0 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Done. - * |[1] |CALNS0 |OP Amplifier 0 Calibration Result Status for NMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[2] |CALPS0 |OP Amplifier 0 Calibration Result Status for PMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[4] |DONE1 |OP Amplifier 1 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Done. - * |[5] |CALNS1 |OP Amplifier 1 Calibration Result Status for NMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[6] |CALPS1 |OP Amplifier 1 Calibration Result Status for PMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[8] |DONE2 |OP Amplifier 2 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Done. - * |[9] |CALNS2 |OP Amplifier 2 Calibration Result Status for NMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[10] |CALPS2 |OP Amplifier 2 Calibration Result Status for PMOS - * | | |0 = Pass. - * | | |1 = Fail. - */ - __IO uint32_t CTL; /*!< [0x0000] OP Amplifier Control Register */ - __IO uint32_t STATUS; /*!< [0x0004] OP Amplifier Status Register */ - __IO uint32_t CALCTL; /*!< [0x0008] OP Amplifier Calibration Control Register */ - __I uint32_t CALST; /*!< [0x000c] OP Amplifier Calibration Status Register */ - -} OPA_T; - -/** - @addtogroup OPA_CONST OPA Bit Field Definition - Constant Definitions for OPA Controller -@{ */ - -#define OPA_CTL_OPEN0_Pos (0) /*!< OPA_T::CTL: OPEN0 Position */ -#define OPA_CTL_OPEN0_Msk (0x1ul << OPA_CTL_OPEN0_Pos) /*!< OPA_T::CTL: OPEN0 Mask */ - -#define OPA_CTL_OPEN1_Pos (1) /*!< OPA_T::CTL: OPEN1 Position */ -#define OPA_CTL_OPEN1_Msk (0x1ul << OPA_CTL_OPEN1_Pos) /*!< OPA_T::CTL: OPEN1 Mask */ - -#define OPA_CTL_OPEN2_Pos (2) /*!< OPA_T::CTL: OPEN2 Position */ -#define OPA_CTL_OPEN2_Msk (0x1ul << OPA_CTL_OPEN2_Pos) /*!< OPA_T::CTL: OPEN2 Mask */ - -#define OPA_CTL_OPDOEN0_Pos (4) /*!< OPA_T::CTL: OPDOEN0 Position */ -#define OPA_CTL_OPDOEN0_Msk (0x1ul << OPA_CTL_OPDOEN0_Pos) /*!< OPA_T::CTL: OPDOEN0 Mask */ - -#define OPA_CTL_OPDOEN1_Pos (5) /*!< OPA_T::CTL: OPDOEN1 Position */ -#define OPA_CTL_OPDOEN1_Msk (0x1ul << OPA_CTL_OPDOEN1_Pos) /*!< OPA_T::CTL: OPDOEN1 Mask */ - -#define OPA_CTL_OPDOEN2_Pos (6) /*!< OPA_T::CTL: OPDOEN2 Position */ -#define OPA_CTL_OPDOEN2_Msk (0x1ul << OPA_CTL_OPDOEN2_Pos) /*!< OPA_T::CTL: OPDOEN2 Mask */ - -#define OPA_CTL_OPDOIEN0_Pos (8) /*!< OPA_T::CTL: OPDOIEN0 Position */ -#define OPA_CTL_OPDOIEN0_Msk (0x1ul << OPA_CTL_OPDOIEN0_Pos) /*!< OPA_T::CTL: OPDOIEN0 Mask */ - -#define OPA_CTL_OPDOIEN1_Pos (9) /*!< OPA_T::CTL: OPDOIEN1 Position */ -#define OPA_CTL_OPDOIEN1_Msk (0x1ul << OPA_CTL_OPDOIEN1_Pos) /*!< OPA_T::CTL: OPDOIEN1 Mask */ - -#define OPA_CTL_OPDOIEN2_Pos (10) /*!< OPA_T::CTL: OPDOIEN2 Position */ -#define OPA_CTL_OPDOIEN2_Msk (0x1ul << OPA_CTL_OPDOIEN2_Pos) /*!< OPA_T::CTL: OPDOIEN2 Mask */ - -#define OPA_STATUS_OPDO0_Pos (0) /*!< OPA_T::STATUS: OPDO0 Position */ -#define OPA_STATUS_OPDO0_Msk (0x1ul << OPA_STATUS_OPDO0_Pos) /*!< OPA_T::STATUS: OPDO0 Mask */ - -#define OPA_STATUS_OPDO1_Pos (1) /*!< OPA_T::STATUS: OPDO1 Position */ -#define OPA_STATUS_OPDO1_Msk (0x1ul << OPA_STATUS_OPDO1_Pos) /*!< OPA_T::STATUS: OPDO1 Mask */ - -#define OPA_STATUS_OPDO2_Pos (2) /*!< OPA_T::STATUS: OPDO2 Position */ -#define OPA_STATUS_OPDO2_Msk (0x1ul << OPA_STATUS_OPDO2_Pos) /*!< OPA_T::STATUS: OPDO2 Mask */ - -#define OPA_STATUS_OPDOIF0_Pos (4) /*!< OPA_T::STATUS: OPDOIF0 Position */ -#define OPA_STATUS_OPDOIF0_Msk (0x1ul << OPA_STATUS_OPDOIF0_Pos) /*!< OPA_T::STATUS: OPDOIF0 Mask */ - -#define OPA_STATUS_OPDOIF1_Pos (5) /*!< OPA_T::STATUS: OPDOIF1 Position */ -#define OPA_STATUS_OPDOIF1_Msk (0x1ul << OPA_STATUS_OPDOIF1_Pos) /*!< OPA_T::STATUS: OPDOIF1 Mask */ - -#define OPA_STATUS_OPDOIF2_Pos (6) /*!< OPA_T::STATUS: OPDOIF2 Position */ -#define OPA_STATUS_OPDOIF2_Msk (0x1ul << OPA_STATUS_OPDOIF2_Pos) /*!< OPA_T::STATUS: OPDOIF2 Mask */ - -#define OPA_CALCTL_CALTRG0_Pos (0) /*!< OPA_T::CALCTL: CALTRG0 Position */ -#define OPA_CALCTL_CALTRG0_Msk (0x1ul << OPA_CALCTL_CALTRG0_Pos) /*!< OPA_T::CALCTL: CALTRG0 Mask */ - -#define OPA_CALCTL_CALTRG1_Pos (1) /*!< OPA_T::CALCTL: CALTRG1 Position */ -#define OPA_CALCTL_CALTRG1_Msk (0x1ul << OPA_CALCTL_CALTRG1_Pos) /*!< OPA_T::CALCTL: CALTRG1 Mask */ - -#define OPA_CALCTL_CALTRG2_Pos (2) /*!< OPA_T::CALCTL: CALTRG2 Position */ -#define OPA_CALCTL_CALTRG2_Msk (0x1ul << OPA_CALCTL_CALTRG2_Pos) /*!< OPA_T::CALCTL: CALTRG2 Mask */ - -#define OPA_CALCTL_CALCLK0_Pos (4) /*!< OPA_T::CALCTL: CALCLK0 Position */ -#define OPA_CALCTL_CALCLK0_Msk (0x3ul << OPA_CALCTL_CALCLK0_Pos) /*!< OPA_T::CALCTL: CALCLK0 Mask */ - -#define OPA_CALCTL_CALCLK1_Pos (6) /*!< OPA_T::CALCTL: CALCLK1 Position */ -#define OPA_CALCTL_CALCLK1_Msk (0x3ul << OPA_CALCTL_CALCLK1_Pos) /*!< OPA_T::CALCTL: CALCLK1 Mask */ - -#define OPA_CALCTL_CALCLK2_Pos (8) /*!< OPA_T::CALCTL: CALCLK2 Position */ -#define OPA_CALCTL_CALCLK2_Msk (0x3ul << OPA_CALCTL_CALCLK2_Pos) /*!< OPA_T::CALCTL: CALCLK2 Mask */ - -#define OPA_CALCTL_CALRVS0_Pos (16) /*!< OPA_T::CALCTL: CALRVS0 Position */ -#define OPA_CALCTL_CALRVS0_Msk (0x1ul << OPA_CALCTL_CALRVS0_Pos) /*!< OPA_T::CALCTL: CALRVS0 Mask */ - -#define OPA_CALCTL_CALRVS1_Pos (17) /*!< OPA_T::CALCTL: CALRVS1 Position */ -#define OPA_CALCTL_CALRVS1_Msk (0x1ul << OPA_CALCTL_CALRVS1_Pos) /*!< OPA_T::CALCTL: CALRVS1 Mask */ - -#define OPA_CALCTL_CALRVS2_Pos (18) /*!< OPA_T::CALCTL: CALRVS2 Position */ -#define OPA_CALCTL_CALRVS2_Msk (0x1ul << OPA_CALCTL_CALRVS2_Pos) /*!< OPA_T::CALCTL: CALRVS2 Mask */ - -#define OPA_CALST_DONE0_Pos (0) /*!< OPA_T::CALST: DONE0 Position */ -#define OPA_CALST_DONE0_Msk (0x1ul << OPA_CALST_DONE0_Pos) /*!< OPA_T::CALST: DONE0 Mask */ - -#define OPA_CALST_CALNS0_Pos (1) /*!< OPA_T::CALST: CALNS0 Position */ -#define OPA_CALST_CALNS0_Msk (0x1ul << OPA_CALST_CALNS0_Pos) /*!< OPA_T::CALST: CALNS0 Mask */ - -#define OPA_CALST_CALPS0_Pos (2) /*!< OPA_T::CALST: CALPS0 Position */ -#define OPA_CALST_CALPS0_Msk (0x1ul << OPA_CALST_CALPS0_Pos) /*!< OPA_T::CALST: CALPS0 Mask */ - -#define OPA_CALST_DONE1_Pos (4) /*!< OPA_T::CALST: DONE1 Position */ -#define OPA_CALST_DONE1_Msk (0x1ul << OPA_CALST_DONE1_Pos) /*!< OPA_T::CALST: DONE1 Mask */ - -#define OPA_CALST_CALNS1_Pos (5) /*!< OPA_T::CALST: CALNS1 Position */ -#define OPA_CALST_CALNS1_Msk (0x1ul << OPA_CALST_CALNS1_Pos) /*!< OPA_T::CALST: CALNS1 Mask */ - -#define OPA_CALST_CALPS1_Pos (6) /*!< OPA_T::CALST: CALPS1 Position */ -#define OPA_CALST_CALPS1_Msk (0x1ul << OPA_CALST_CALPS1_Pos) /*!< OPA_T::CALST: CALPS1 Mask */ - -#define OPA_CALST_DONE2_Pos (8) /*!< OPA_T::CALST: DONE2 Position */ -#define OPA_CALST_DONE2_Msk (0x1ul << OPA_CALST_DONE2_Pos) /*!< OPA_T::CALST: DONE2 Mask */ - -#define OPA_CALST_CALNS2_Pos (9) /*!< OPA_T::CALST: CALNS2 Position */ -#define OPA_CALST_CALNS2_Msk (0x1ul << OPA_CALST_CALNS2_Pos) /*!< OPA_T::CALST: CALNS2 Mask */ - -#define OPA_CALST_CALPS2_Pos (10) /*!< OPA_T::CALST: CALPS2 Position */ -#define OPA_CALST_CALPS2_Msk (0x1ul << OPA_CALST_CALPS2_Pos) /*!< OPA_T::CALST: CALPS2 Mask */ - -/**@}*/ /* OPA_CONST */ -/**@}*/ /* end of OPA register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __OPA_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/otg_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/otg_reg.h deleted file mode 100644 index 4ec15e259bd..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/otg_reg.h +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************//** - * @file otg_reg.h - * @version V3.00 - * @brief OTG register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __OTG_REG_H__ -#define __OTG_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup OTG USB On-The-Go Controller(OTG) - Memory Mapped Structure for OTG Controller -@{ */ - -typedef struct -{ - - - /** - * @var OTG_T::CTL - * Offset: 0x00 OTG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDROP |Drop VBUS Control - * | | |If user application running on this OTG A-device wants to conserve power, set this bit to drop VBUS - * | | |BUSREQ (OTG_CTL[1]) will be also cleared no matter A-device or B-device. - * | | |0 = Not drop the VBUS. - * | | |1 = Drop the VBUS. - * |[1] |BUSREQ |OTG Bus Request - * | | |If OTG A-device wants to do data transfers via USB bus, setting this bit will drive VBUS high to detect USB device connection - * | | |If user won't use the bus any more, clearing this bit will drop VBUS to save power - * | | |This bit will be cleared when A-device goes to A_wait_vfall state - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set or IDSTS (OTG_STATUS[1]) changed. - * | | |If user of an OTG-B Device wants to request VBUS, setting this bit will run SRP protocol - * | | |This bit will be cleared if SRP failure (OTG A-device does not provide VBUS after B-device issues ARP in specified interval, defined in OTG specification) - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set IDSTS (OTG_STATUS[1]) changed. - * | | |0 = Not launch VBUS in OTG A-device or not request SRP in OTG B-device. - * | | |1 = Launch VBUS in OTG A-device or request SRP in OTG B-device. - * |[2] |HNPREQEN |OTG HNP Request Enable Bit - * | | |When USB frame as A-device, set this bit when A-device allows to process HNP protocol -- A-device changes role from Host to Peripheral - * | | |This bit will be cleared when OTG state changes from a_suspend to a_peripheral or goes back to a_idle state - * | | |When USB frame as B-device, set this bit after the OTG A-device successfully sends a SetFeature (b_hnp_enable) command to the OTG B-device to start role change -- B-device changes role from Peripheral to Host - * | | |This bit will be cleared when OTG state changes from b_peripheral to b_wait_acon or goes back to b_idle state. - * | | |0 = HNP request Disabled. - * | | |1 = HNP request Enabled (A-device can change role from Host to Peripheral or B-device can change role from Peripheral to Host). - * | | |Note: Refer to OTG specification to get a_suspend, a_peripheral, a_idle and b_idle state. - * |[4] |OTGEN |OTG Function Enable Bit - * | | |User needs to set this bit to enable OTG function while USB frame configured as OTG device - * | | |When USB frame not configured as OTG device, this bit is must be low. - * | | |0= OTG function Disabled. - * | | |1 = OTG function Enabled. - * |[5] |WKEN |OTG ID Pin Wake-up Enable Bit - * | | |0 = OTG ID pin status change wake-up function Disabled. - * | | |1 = OTG ID pin status change wake-up function Enabled. - * @var OTG_T::PHYCTL - * Offset: 0x04 OTG PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OTGPHYEN |OTG PHY Enable - * | | |When USB frame is configured as OTG-device or ID-dependent, user needs to set this bit before using OTG function - * | | |If device is not configured as OTG-device nor ID-dependent , this bit is "don't care". - * | | |0 = OTG PHY Disabled. - * | | |1 = OTG PHY Enabled. - * |[1] |IDDETEN |ID Detection Enable Bit - * | | |0 = Detect ID pin status Disabled. - * | | |1 = Detect ID pin status Enabled. - * |[4] |VBENPOL |Off-chip USB VBUS Power Switch Enable Polarity - * | | |The OTG controller will enable off-chip USB VBUS power switch to provide VBUS power when need - * | | |A USB_VBUS_EN pin is used to control the off-chip USB VBUS power switch. - * | | |The polarity of enabling off-chip USB VBUS power switch (high active or low active) depends on the selected component - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The off-chip USB VBUS power switch enable is active high. - * | | |1 = The off-chip USB VBUS power switch enable is active low. - * |[5] |VBSTSPOL |Off-chip USB VBUS Power Switch Status Polarity - * | | |The polarity of off-chip USB VBUS power switch valid signal depends on the selected component - * | | |A USB_VBUS_ST pin is used to monitor the valid signal of the off-chip USB VBUS power switch - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The polarity of off-chip USB VBUS power switch valid status is high. - * | | |1 = The polarity of off-chip USB VBUS power switch valid status is low. - * @var OTG_T::INTEN - * Offset: 0x08 OTG Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIEN|Role (Host or Peripheral) Changed Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[1] |VBEIEN |VBUS Error Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: VBUS error means going to a_vbus_err state. Please refer to A-device state diagram in OTG spec. - * |[2] |SRPFIEN |SRP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[3] |HNPFIEN |HNP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[4] |GOIDLEIEN |OTG Device Goes to IDLE State Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Going to idle state means going to a_idle or b_idle state - * | | |Please refer to A-device state diagram and B-device state diagram in OTG spec. - * |[5] |IDCHGIEN |IDSTS Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and IDSTS (OTG_STATUS[1]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[6] |PDEVIEN |Act As Peripheral Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a peripheral, a interrupt will be asserted. - * | | |0 = This device as a peripheral interrupt Disabled. - * | | |1 = This device as a peripheral interrupt Enabled. - * |[7] |HOSTIEN |Act As Host Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a host, a interrupt will be asserted. - * | | |0 = This device as a host interrupt Disabled. - * | | |1 = This device as a host interrupt Enabled. - * |[8] |BVLDCHGIEN|B-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and BVLD (OTG_STATUS[3]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[9] |AVLDCHGIEN|A-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and AVLD (OTG_STATUS[4]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[10] |VBCHGIEN |VBUSVLD Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and VBUSVLD (OTG_STATUS[5]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[11] |SECHGIEN |SESSEND Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and SESSEND (OTG_STATUS[2]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[13] |SRPDETIEN |SRP Detected Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * @var OTG_T::INTSTS - * Offset: 0x0C OTG Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIF |OTG Role Change Interrupt Status - * | | |This flag is set when the role of an OTG device changed from a host to a peripheral, or changed from a peripheral to a host while USB_ID pin status does not change. - * | | |0 = OTG device role not changed. - * | | |1 = OTG device role changed. - * | | |Note: Write 1 to clear this flag. - * |[1] |VBEIF |VBUS Error Interrupt Status - * | | |This bit will be set when voltage on VBUS cannot reach a minimum valid threshold 4.4V within a maximum time of 100ms after OTG A-device starting to drive VBUS high. - * | | |0 = OTG A-device drives VBUS over threshold voltage before this interval expires. - * | | |1 = OTG A-device cannot drive VBUS over threshold voltage before this interval expires. - * | | |Note: Write 1 to clear this flag and recover from the VBUS error state. - * |[2] |SRPFIF |SRP Fail Interrupt Status - * | | |After initiating SRP, an OTG B-device will wait for the OTG A-device to drive VBUS high at least TB_SRP_FAIL minimum, defined in OTG specification - * | | |This flag is set when the OTG B-device does not get VBUS high after this interval. - * | | |0 = OTG B-device gets VBUS high before this interval. - * | | |1 = OTG B-device does not get VBUS high before this interval. - * | | |Note: Write 1 to clear this flag. - * |[3] |HNPFIF |HNP Fail Interrupt Status - * | | |When A-device has granted B-device to be host and USB bus is in SE0 (both USB_D+ and USB_D- low) state, this bit will be set when A-device does not connect after specified interval expires. - * | | |0 = A-device connects to B-device before specified interval expires. - * | | |1 = A-device does not connect to B-device before specified interval expires. - * | | |Note: Write 1 to clear this flag. - * |[4] |GOIDLEIF |OTG Device Goes to IDLE Interrupt Status - * | | |Flag is set if the OTG device transfers from non-idle state to idle state - * | | |The OTG device will be neither a host nor a peripheral. - * | | |0 = OTG device does not go back to idle state (a_idle or b_idle). - * | | |1 = OTG device goes back to idle state(a_idle or b_idle). - * | | |Note 1: Going to idle state means going to a_idle or b_idle state. Please refer to OTG specification. - * | | |Note 2: Write 1 to clear this flag. - * |[5] |IDCHGIF |ID State Change Interrupt Status - * | | |0 = IDSTS (OTG_STATUS[1]) not toggled. - * | | |1 = IDSTS (OTG_STATUS[1]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[6] |PDEVIF |Act As Peripheral Interrupt Status - * | | |0= This device does not act as a peripheral. - * | | |1 = This device acts as a peripheral. - * | | |Note: Write 1 to clear this flag. - * |[7] |HOSTIF |Act As Host Interrupt Status - * | | |0= This device does not act as a host. - * | | |1 = This device acts as a host. - * | | |Note: Write 1 to clear this flag. - * |[8] |BVLDCHGIF |B-device Session Valid State Change Interrupt Status - * | | |0 = BVLD (OTG_STATUS[3]) is not toggled. - * | | |1 = BVLD (OTG_STATUS[3]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[9] |AVLDCHGIF |A-device Session Valid State Change Interrupt Status - * | | |0 = AVLD (OTG_STATUS[4]) not toggled. - * | | |1 = AVLD (OTG_STATUS[4]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[10] |VBCHGIF |VBUSVLD State Change Interrupt Status - * | | |0 = VBUSVLD (OTG_STATUS[5]) not toggled. - * | | |1 = VBUSVLD (OTG_STATUS[5]) from high to low or from low to high. - * | | |Note: Write 1 to clear this status. - * |[11] |SECHGIF |SESSEND State Change Interrupt Status - * | | |0 = SESSEND (OTG_STATUS[2]) not toggled. - * | | |1 = SESSEND (OTG_STATUS[2]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[13] |SRPDETIF |SRP Detected Interrupt Status - * | | |0 = SRP not detected. - * | | |1 = SRP detected. - * | | |Note: Write 1 to clear this status. - * @var OTG_T::STATUS - * Offset: 0x10 OTG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OVERCUR |over Current Condition - * | | |The voltage on VBUS cannot reach a minimum VBUS valid threshold, 4.4V minimum, within a maximum time of 100ms after OTG A-device drives VBUS high. - * | | |0 = OTG A-device drives VBUS successfully. - * | | |1 = OTG A-device cannot drives VBUS high in this interval. - * |[1] |IDSTS |USB_ID Pin State of Mini-b/Micro-plug - * | | |0 = Mini-A/Micro-A plug is attached. - * | | |1 = Mini-B/Micro-B plug is attached. - * |[2] |SESSEND |Session End Status - * | | |When VBUS voltage is lower than 0.4V, this bit will be set to 1 - * | | |Session end means no meaningful power on VBUS. - * | | |0 = Session is not end. - * | | |1 = Session is end. - * |[3] |BVLD |B-device Session Valid Status - * | | |0 = B-device session is not valid. - * | | |1 = B-device session is valid. - * |[4] |AVLD |A-device Session Valid Status - * | | |0 = A-device session is not valid. - * | | |1 = A-device session is valid. - * |[5] |VBUSVLD |VBUS Valid Status - * | | |When VBUS is larger than 4.7V, this bit will be set to 1. - * | | |0 = VBUS is not valid. - * | | |1 = VBUS is valid. - * |[6] |ASPERI |As Peripheral Status - * | | |When OTG as peripheral, this bit is set. - * | | |0: OTG not as peripheral - * | | |1: OTG as peripheral - * |[7] |ASHOST |As Host Status - * | | |When OTG as Host, this bit is set. - * | | |0: OTG not as Host - * | | |1: OTG as Host - */ - __IO uint32_t CTL; /*!< [0x0000] OTG Control Register */ - __IO uint32_t PHYCTL; /*!< [0x0004] OTG PHY Control Register */ - __IO uint32_t INTEN; /*!< [0x0008] OTG Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x000c] OTG Interrupt Status Register */ - __I uint32_t STATUS; /*!< [0x0010] OTG Status Register */ - -} OTG_T; - - -/** - @addtogroup OTG_CONST OTG Bit Field Definition - Constant Definitions for OTG Controller -@{ */ - -#define OTG_CTL_VBUSDROP_Pos (0) /*!< OTG_T::CTL: VBUSDROP Position */ -#define OTG_CTL_VBUSDROP_Msk (0x1ul << OTG_CTL_VBUSDROP_Pos) /*!< OTG_T::CTL: VBUSDROP Mask */ - -#define OTG_CTL_BUSREQ_Pos (1) /*!< OTG_T::CTL: BUSREQ Position */ -#define OTG_CTL_BUSREQ_Msk (0x1ul << OTG_CTL_BUSREQ_Pos) /*!< OTG_T::CTL: BUSREQ Mask */ - -#define OTG_CTL_HNPREQEN_Pos (2) /*!< OTG_T::CTL: HNPREQEN Position */ -#define OTG_CTL_HNPREQEN_Msk (0x1ul << OTG_CTL_HNPREQEN_Pos) /*!< OTG_T::CTL: HNPREQEN Mask */ - -#define OTG_CTL_OTGEN_Pos (4) /*!< OTG_T::CTL: OTGEN Position */ -#define OTG_CTL_OTGEN_Msk (0x1ul << OTG_CTL_OTGEN_Pos) /*!< OTG_T::CTL: OTGEN Mask */ - -#define OTG_CTL_WKEN_Pos (5) /*!< OTG_T::CTL: WKEN Position */ -#define OTG_CTL_WKEN_Msk (0x1ul << OTG_CTL_WKEN_Pos) /*!< OTG_T::CTL: WKEN Mask */ - -#define OTG_PHYCTL_OTGPHYEN_Pos (0) /*!< OTG_T::PHYCTL: OTGPHYEN Position */ -#define OTG_PHYCTL_OTGPHYEN_Msk (0x1ul << OTG_PHYCTL_OTGPHYEN_Pos) /*!< OTG_T::PHYCTL: OTGPHYEN Mask */ - -#define OTG_PHYCTL_IDDETEN_Pos (1) /*!< OTG_T::PHYCTL: IDDETEN Position */ -#define OTG_PHYCTL_IDDETEN_Msk (0x1ul << OTG_PHYCTL_IDDETEN_Pos) /*!< OTG_T::PHYCTL: IDDETEN Mask */ - -#define OTG_PHYCTL_VBENPOL_Pos (4) /*!< OTG_T::PHYCTL: VBENPOL Position */ -#define OTG_PHYCTL_VBENPOL_Msk (0x1ul << OTG_PHYCTL_VBENPOL_Pos) /*!< OTG_T::PHYCTL: VBENPOL Mask */ - -#define OTG_PHYCTL_VBSTSPOL_Pos (5) /*!< OTG_T::PHYCTL: VBSTSPOL Position */ -#define OTG_PHYCTL_VBSTSPOL_Msk (0x1ul << OTG_PHYCTL_VBSTSPOL_Pos) /*!< OTG_T::PHYCTL: VBSTSPOL Mask */ - -#define OTG_INTEN_ROLECHGIEN_Pos (0) /*!< OTG_T::INTEN: ROLECHGIEN Position */ -#define OTG_INTEN_ROLECHGIEN_Msk (0x1ul << OTG_INTEN_ROLECHGIEN_Pos) /*!< OTG_T::INTEN: ROLECHGIEN Mask */ - -#define OTG_INTEN_VBEIEN_Pos (1) /*!< OTG_T::INTEN: VBEIEN Position */ -#define OTG_INTEN_VBEIEN_Msk (0x1ul << OTG_INTEN_VBEIEN_Pos) /*!< OTG_T::INTEN: VBEIEN Mask */ - -#define OTG_INTEN_SRPFIEN_Pos (2) /*!< OTG_T::INTEN: SRPFIEN Position */ -#define OTG_INTEN_SRPFIEN_Msk (0x1ul << OTG_INTEN_SRPFIEN_Pos) /*!< OTG_T::INTEN: SRPFIEN Mask */ - -#define OTG_INTEN_HNPFIEN_Pos (3) /*!< OTG_T::INTEN: HNPFIEN Position */ -#define OTG_INTEN_HNPFIEN_Msk (0x1ul << OTG_INTEN_HNPFIEN_Pos) /*!< OTG_T::INTEN: HNPFIEN Mask */ - -#define OTG_INTEN_GOIDLEIEN_Pos (4) /*!< OTG_T::INTEN: GOIDLEIEN Position */ -#define OTG_INTEN_GOIDLEIEN_Msk (0x1ul << OTG_INTEN_GOIDLEIEN_Pos) /*!< OTG_T::INTEN: GOIDLEIEN Mask */ - -#define OTG_INTEN_IDCHGIEN_Pos (5) /*!< OTG_T::INTEN: IDCHGIEN Position */ -#define OTG_INTEN_IDCHGIEN_Msk (0x1ul << OTG_INTEN_IDCHGIEN_Pos) /*!< OTG_T::INTEN: IDCHGIEN Mask */ - -#define OTG_INTEN_PDEVIEN_Pos (6) /*!< OTG_T::INTEN: PDEVIEN Position */ -#define OTG_INTEN_PDEVIEN_Msk (0x1ul << OTG_INTEN_PDEVIEN_Pos) /*!< OTG_T::INTEN: PDEVIEN Mask */ - -#define OTG_INTEN_HOSTIEN_Pos (7) /*!< OTG_T::INTEN: HOSTIEN Position */ -#define OTG_INTEN_HOSTIEN_Msk (0x1ul << OTG_INTEN_HOSTIEN_Pos) /*!< OTG_T::INTEN: HOSTIEN Mask */ - -#define OTG_INTEN_BVLDCHGIEN_Pos (8) /*!< OTG_T::INTEN: BVLDCHGIEN Position */ -#define OTG_INTEN_BVLDCHGIEN_Msk (0x1ul << OTG_INTEN_BVLDCHGIEN_Pos) /*!< OTG_T::INTEN: BVLDCHGIEN Mask */ - -#define OTG_INTEN_AVLDCHGIEN_Pos (9) /*!< OTG_T::INTEN: AVLDCHGIEN Position */ -#define OTG_INTEN_AVLDCHGIEN_Msk (0x1ul << OTG_INTEN_AVLDCHGIEN_Pos) /*!< OTG_T::INTEN: AVLDCHGIEN Mask */ - -#define OTG_INTEN_VBCHGIEN_Pos (10) /*!< OTG_T::INTEN: VBCHGIEN Position */ -#define OTG_INTEN_VBCHGIEN_Msk (0x1ul << OTG_INTEN_VBCHGIEN_Pos) /*!< OTG_T::INTEN: VBCHGIEN Mask */ - -#define OTG_INTEN_SECHGIEN_Pos (11) /*!< OTG_T::INTEN: SECHGIEN Position */ -#define OTG_INTEN_SECHGIEN_Msk (0x1ul << OTG_INTEN_SECHGIEN_Pos) /*!< OTG_T::INTEN: SECHGIEN Mask */ - -#define OTG_INTEN_SRPDETIEN_Pos (13) /*!< OTG_T::INTEN: SRPDETIEN Position */ -#define OTG_INTEN_SRPDETIEN_Msk (0x1ul << OTG_INTEN_SRPDETIEN_Pos) /*!< OTG_T::INTEN: SRPDETIEN Mask */ - -#define OTG_INTSTS_ROLECHGIF_Pos (0) /*!< OTG_T::INTSTS: ROLECHGIF Position */ -#define OTG_INTSTS_ROLECHGIF_Msk (0x1ul << OTG_INTSTS_ROLECHGIF_Pos) /*!< OTG_T::INTSTS: ROLECHGIF Mask */ - -#define OTG_INTSTS_VBEIF_Pos (1) /*!< OTG_T::INTSTS: VBEIF Position */ -#define OTG_INTSTS_VBEIF_Msk (0x1ul << OTG_INTSTS_VBEIF_Pos) /*!< OTG_T::INTSTS: VBEIF Mask */ - -#define OTG_INTSTS_SRPFIF_Pos (2) /*!< OTG_T::INTSTS: SRPFIF Position */ -#define OTG_INTSTS_SRPFIF_Msk (0x1ul << OTG_INTSTS_SRPFIF_Pos) /*!< OTG_T::INTSTS: SRPFIF Mask */ - -#define OTG_INTSTS_HNPFIF_Pos (3) /*!< OTG_T::INTSTS: HNPFIF Position */ -#define OTG_INTSTS_HNPFIF_Msk (0x1ul << OTG_INTSTS_HNPFIF_Pos) /*!< OTG_T::INTSTS: HNPFIF Mask */ - -#define OTG_INTSTS_GOIDLEIF_Pos (4) /*!< OTG_T::INTSTS: GOIDLEIF Position */ -#define OTG_INTSTS_GOIDLEIF_Msk (0x1ul << OTG_INTSTS_GOIDLEIF_Pos) /*!< OTG_T::INTSTS: GOIDLEIF Mask */ - -#define OTG_INTSTS_IDCHGIF_Pos (5) /*!< OTG_T::INTSTS: IDCHGIF Position */ -#define OTG_INTSTS_IDCHGIF_Msk (0x1ul << OTG_INTSTS_IDCHGIF_Pos) /*!< OTG_T::INTSTS: IDCHGIF Mask */ - -#define OTG_INTSTS_PDEVIF_Pos (6) /*!< OTG_T::INTSTS: PDEVIF Position */ -#define OTG_INTSTS_PDEVIF_Msk (0x1ul << OTG_INTSTS_PDEVIF_Pos) /*!< OTG_T::INTSTS: PDEVIF Mask */ - -#define OTG_INTSTS_HOSTIF_Pos (7) /*!< OTG_T::INTSTS: HOSTIF Position */ -#define OTG_INTSTS_HOSTIF_Msk (0x1ul << OTG_INTSTS_HOSTIF_Pos) /*!< OTG_T::INTSTS: HOSTIF Mask */ - -#define OTG_INTSTS_BVLDCHGIF_Pos (8) /*!< OTG_T::INTSTS: BVLDCHGIF Position */ -#define OTG_INTSTS_BVLDCHGIF_Msk (0x1ul << OTG_INTSTS_BVLDCHGIF_Pos) /*!< OTG_T::INTSTS: BVLDCHGIF Mask */ - -#define OTG_INTSTS_AVLDCHGIF_Pos (9) /*!< OTG_T::INTSTS: AVLDCHGIF Position */ -#define OTG_INTSTS_AVLDCHGIF_Msk (0x1ul << OTG_INTSTS_AVLDCHGIF_Pos) /*!< OTG_T::INTSTS: AVLDCHGIF Mask */ - -#define OTG_INTSTS_VBCHGIF_Pos (10) /*!< OTG_T::INTSTS: VBCHGIF Position */ -#define OTG_INTSTS_VBCHGIF_Msk (0x1ul << OTG_INTSTS_VBCHGIF_Pos) /*!< OTG_T::INTSTS: VBCHGIF Mask */ - -#define OTG_INTSTS_SECHGIF_Pos (11) /*!< OTG_T::INTSTS: SECHGIF Position */ -#define OTG_INTSTS_SECHGIF_Msk (0x1ul << OTG_INTSTS_SECHGIF_Pos) /*!< OTG_T::INTSTS: SECHGIF Mask */ - -#define OTG_INTSTS_SRPDETIF_Pos (13) /*!< OTG_T::INTSTS: SRPDETIF Position */ -#define OTG_INTSTS_SRPDETIF_Msk (0x1ul << OTG_INTSTS_SRPDETIF_Pos) /*!< OTG_T::INTSTS: SRPDETIF Mask */ - -#define OTG_STATUS_OVERCUR_Pos (0) /*!< OTG_T::STATUS: OVERCUR Position */ -#define OTG_STATUS_OVERCUR_Msk (0x1ul << OTG_STATUS_OVERCUR_Pos) /*!< OTG_T::STATUS: OVERCUR Mask */ - -#define OTG_STATUS_IDSTS_Pos (1) /*!< OTG_T::STATUS: IDSTS Position */ -#define OTG_STATUS_IDSTS_Msk (0x1ul << OTG_STATUS_IDSTS_Pos) /*!< OTG_T::STATUS: IDSTS Mask */ - -#define OTG_STATUS_SESSEND_Pos (2) /*!< OTG_T::STATUS: SESSEND Position */ -#define OTG_STATUS_SESSEND_Msk (0x1ul << OTG_STATUS_SESSEND_Pos) /*!< OTG_T::STATUS: SESSEND Mask */ - -#define OTG_STATUS_BVLD_Pos (3) /*!< OTG_T::STATUS: BVLD Position */ -#define OTG_STATUS_BVLD_Msk (0x1ul << OTG_STATUS_BVLD_Pos) /*!< OTG_T::STATUS: BVLD Mask */ - -#define OTG_STATUS_AVLD_Pos (4) /*!< OTG_T::STATUS: AVLD Position */ -#define OTG_STATUS_AVLD_Msk (0x1ul << OTG_STATUS_AVLD_Pos) /*!< OTG_T::STATUS: AVLD Mask */ - -#define OTG_STATUS_VBUSVLD_Pos (5) /*!< OTG_T::STATUS: VBUSVLD Position */ -#define OTG_STATUS_VBUSVLD_Msk (0x1ul << OTG_STATUS_VBUSVLD_Pos) /*!< OTG_T::STATUS: VBUSVLD Mask */ - -#define OTG_STATUS_ASPERI_Pos (6) /*!< OTG_T::STATUS: ASPERI Position */ -#define OTG_STATUS_ASPERI_Msk (0x1ul << OTG_STATUS_ASPERI_Pos) /*!< OTG_T::STATUS: ASPERI Mask */ - -#define OTG_STATUS_ASHOST_Pos (7) /*!< OTG_T::STATUS: ASHOST Position */ -#define OTG_STATUS_ASHOST_Msk (0x1ul << OTG_STATUS_ASHOST_Pos) /*!< OTG_T::STATUS: ASHOST Mask */ - -/**@}*/ /* OTG_CONST */ -/**@}*/ /* end of OTG register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __OTG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/pdma_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/pdma_reg.h deleted file mode 100644 index 1d140a36f25..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/pdma_reg.h +++ /dev/null @@ -1,1899 +0,0 @@ -/**************************************************************************//** - * @file pdma_reg.h - * @version V1.00 - * @brief PDMA register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __PDMA_REG_H__ -#define __PDMA_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -#define PDMA_CH_MAX 16UL /*!< Specify Maximum Channels of PDMA \hideinitializer */ -#define PDMA_CH_Msk ((1ul<= 1,. - * | | |If MCLKDIV = 0,. - * | | |where - * | | |is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL2 - * | | |In general, the master clock rate is 256 times sampling clock rate. - * |[17:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode - * | | |The clock frequency of bit clock , fBCLK, is determined by the following expression: - * | | |where - * | | |is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL2. - * | | |In I2S Slave mode, this field is used to define the frequency of peripheral clock and it's determined by . - * | | |The peripheral clock frequency in I2S Slave mode must be equal to or faster than 6 times of input bit clock. - * |[24] |I2SMODE |I2S Clock Divider Number Selection for I2S Mode and SPI Mode - * | | |User sets I2SMODE to set frequency of peripheral clock of I2S mode or SPI mode when BCLKDIV (SPIx_I2SCLK[17:8]) or DIVIDER (SPIx_CLKDIV[8:0]) is set. - * | | |User needs to set I2SMODE before I2SEN (SPIx_I2SCTL[0]) or SPIEN (SPIx_CTL[0]) is enabled. - * | | |0 = The frequency of peripheral clock is set to SPI mode. - * | | |1 = The frequency of peripheral clock is set to I2S mode. - * |[25] |I2SSLAVE |I2S Clock Divider Number Selection for I2S Slave Mode and I2S Master Mode - * | | |User sets I2SSLAVE to set frequency of peripheral clock of I2S master mode and I2S slave mode when BCLKDIV (SPIx_I2SCLK[17:8]) is set. - * | | |I2SSLAVE needs to set before I2SEN (SPIx_I2SCTL[0]) is enabled. - * | | |0 = The frequency of peripheral clock is set to I2S Master mode. - * | | |1 = The frequency of peripheral clock is set to I2S Slave mode. - * @var SPI_T::I2SSTS - * Offset: 0x68 I2S Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |RIGHT |Right Channel (Read Only) - * | | |This bit indicates the current transmit data is belong to which channel. - * | | |0 = Left channel. - * | | |1 = Right channel. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * | | |Note: If RXTHIEN = 1 and RXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock period in Master mode or over 576 SPI peripheral clock period in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |I2SENSTS |I2S Enable Status (Read Only) - * | | |0 = The SPI/I2S control logic is disabled. - * | | |1 = The SPI/I2S control logic is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI/I2S control logic is disabled, this bit indicates the real status of SPI/I2S control logic for user. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * | | |Note: If TXTHIEN = 1 and TXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[19] |TXUFIF |Transmit FIFO Underflow Interrupt Flag - * | | |When the transmit FIFO buffer is empty and there is no datum written into the FIFO buffer, if there is more bus clock input, this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[20] |RZCIF |Right Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on right channel. - * | | |1 = Zero cross event occurred on right channel. - * |[21] |LZCIF |Left Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on left channel. - * | | |1 = Zero cross event occurred on left channel. - * |[22] |SLVERRIF |Bit Clock Loss Interrupt Flag for Slave Mode - * | | |0 = No bit clock loss event occurred. - * | | |1 = Bit clock loss event occurred. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[26:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[30:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - */ - __IO uint32_t CTL; /*!< [0x0000] SPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] SPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] SPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] SPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] SPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] SPI Status Register */ - __I uint32_t STATUS2; /*!< [0x0018] SPI Status2 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __O uint32_t TX; /*!< [0x0020] SPI Data Transmit Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t RX; /*!< [0x0030] SPI Data Receive Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[11]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t I2SCTL; /*!< [0x0060] I2S Control Register */ - __IO uint32_t I2SCLK; /*!< [0x0064] I2S Clock Divider Control Register */ - __IO uint32_t I2SSTS; /*!< [0x0068] I2S Status Register */ - -} SPI_T; - -/** - @addtogroup SPI_CONST SPI Bit Field Definition - Constant Definitions for SPI Controller -@{ */ - -#define SPI_CTL_SPIEN_Pos (0) /*!< SPI_T::CTL: SPIEN Position */ -#define SPI_CTL_SPIEN_Msk (0x1ul << SPI_CTL_SPIEN_Pos) /*!< SPI_T::CTL: SPIEN Mask */ - -#define SPI_CTL_RXNEG_Pos (1) /*!< SPI_T::CTL: RXNEG Position */ -#define SPI_CTL_RXNEG_Msk (0x1ul << SPI_CTL_RXNEG_Pos) /*!< SPI_T::CTL: RXNEG Mask */ - -#define SPI_CTL_TXNEG_Pos (2) /*!< SPI_T::CTL: TXNEG Position */ -#define SPI_CTL_TXNEG_Msk (0x1ul << SPI_CTL_TXNEG_Pos) /*!< SPI_T::CTL: TXNEG Mask */ - -#define SPI_CTL_CLKPOL_Pos (3) /*!< SPI_T::CTL: CLKPOL Position */ -#define SPI_CTL_CLKPOL_Msk (0x1ul << SPI_CTL_CLKPOL_Pos) /*!< SPI_T::CTL: CLKPOL Mask */ - -#define SPI_CTL_SUSPITV_Pos (4) /*!< SPI_T::CTL: SUSPITV Position */ -#define SPI_CTL_SUSPITV_Msk (0xful << SPI_CTL_SUSPITV_Pos) /*!< SPI_T::CTL: SUSPITV Mask */ - -#define SPI_CTL_DWIDTH_Pos (8) /*!< SPI_T::CTL: DWIDTH Position */ -#define SPI_CTL_DWIDTH_Msk (0x1ful << SPI_CTL_DWIDTH_Pos) /*!< SPI_T::CTL: DWIDTH Mask */ - -#define SPI_CTL_LSB_Pos (13) /*!< SPI_T::CTL: LSB Position */ -#define SPI_CTL_LSB_Msk (0x1ul << SPI_CTL_LSB_Pos) /*!< SPI_T::CTL: LSB Mask */ - -#define SPI_CTL_HALFDPX_Pos (14) /*!< SPI_T::CTL: HALFDPX Position */ -#define SPI_CTL_HALFDPX_Msk (0x1ul << SPI_CTL_HALFDPX_Pos) /*!< SPI_T::CTL: HALFDPX Mask */ - -#define SPI_CTL_RXONLY_Pos (15) /*!< SPI_T::CTL: RXONLY Position */ -#define SPI_CTL_RXONLY_Msk (0x1ul << SPI_CTL_RXONLY_Pos) /*!< SPI_T::CTL: RXONLY Mask */ - -#define SPI_CTL_UNITIEN_Pos (17) /*!< SPI_T::CTL: UNITIEN Position */ -#define SPI_CTL_UNITIEN_Msk (0x1ul << SPI_CTL_UNITIEN_Pos) /*!< SPI_T::CTL: UNITIEN Mask */ - -#define SPI_CTL_SLAVE_Pos (18) /*!< SPI_T::CTL: SLAVE Position */ -#define SPI_CTL_SLAVE_Msk (0x1ul << SPI_CTL_SLAVE_Pos) /*!< SPI_T::CTL: SLAVE Mask */ - -#define SPI_CTL_REORDER_Pos (19) /*!< SPI_T::CTL: REORDER Position */ -#define SPI_CTL_REORDER_Msk (0x1ul << SPI_CTL_REORDER_Pos) /*!< SPI_T::CTL: REORDER Mask */ - -#define SPI_CTL_DATDIR_Pos (20) /*!< SPI_T::CTL: DATDIR Position */ -#define SPI_CTL_DATDIR_Msk (0x1ul << SPI_CTL_DATDIR_Pos) /*!< SPI_T::CTL: DATDIR Mask */ - -#define SPI_CLKDIV_DIVIDER_Pos (0) /*!< SPI_T::CLKDIV: DIVIDER Position */ -#define SPI_CLKDIV_DIVIDER_Msk (0x1fful << SPI_CLKDIV_DIVIDER_Pos) /*!< SPI_T::CLKDIV: DIVIDER Mask */ - -#define SPI_SSCTL_SS_Pos (0) /*!< SPI_T::SSCTL: SS Position */ -#define SPI_SSCTL_SS_Msk (0x1ul << SPI_SSCTL_SS_Pos) /*!< SPI_T::SSCTL: SS Mask */ - -#define SPI_SSCTL_SSACTPOL_Pos (2) /*!< SPI_T::SSCTL: SSACTPOL Position */ -#define SPI_SSCTL_SSACTPOL_Msk (0x1ul << SPI_SSCTL_SSACTPOL_Pos) /*!< SPI_T::SSCTL: SSACTPOL Mask */ - -#define SPI_SSCTL_AUTOSS_Pos (3) /*!< SPI_T::SSCTL: AUTOSS Position */ -#define SPI_SSCTL_AUTOSS_Msk (0x1ul << SPI_SSCTL_AUTOSS_Pos) /*!< SPI_T::SSCTL: AUTOSS Mask */ - -#define SPI_SSCTL_SLV3WIRE_Pos (4) /*!< SPI_T::SSCTL: SLV3WIRE Position */ -#define SPI_SSCTL_SLV3WIRE_Msk (0x1ul << SPI_SSCTL_SLV3WIRE_Pos) /*!< SPI_T::SSCTL: SLV3WIRE Mask */ - -#define SPI_SSCTL_SLVBEIEN_Pos (8) /*!< SPI_T::SSCTL: SLVBEIEN Position */ -#define SPI_SSCTL_SLVBEIEN_Msk (0x1ul << SPI_SSCTL_SLVBEIEN_Pos) /*!< SPI_T::SSCTL: SLVBEIEN Mask */ - -#define SPI_SSCTL_SLVURIEN_Pos (9) /*!< SPI_T::SSCTL: SLVURIEN Position */ -#define SPI_SSCTL_SLVURIEN_Msk (0x1ul << SPI_SSCTL_SLVURIEN_Pos) /*!< SPI_T::SSCTL: SLVURIEN Mask */ - -#define SPI_SSCTL_SSACTIEN_Pos (12) /*!< SPI_T::SSCTL: SSACTIEN Position */ -#define SPI_SSCTL_SSACTIEN_Msk (0x1ul << SPI_SSCTL_SSACTIEN_Pos) /*!< SPI_T::SSCTL: SSACTIEN Mask */ - -#define SPI_SSCTL_SSINAIEN_Pos (13) /*!< SPI_T::SSCTL: SSINAIEN Position */ -#define SPI_SSCTL_SSINAIEN_Msk (0x1ul << SPI_SSCTL_SSINAIEN_Pos) /*!< SPI_T::SSCTL: SSINAIEN Mask */ - -#define SPI_PDMACTL_TXPDMAEN_Pos (0) /*!< SPI_T::PDMACTL: TXPDMAEN Position */ -#define SPI_PDMACTL_TXPDMAEN_Msk (0x1ul << SPI_PDMACTL_TXPDMAEN_Pos) /*!< SPI_T::PDMACTL: TXPDMAEN Mask */ - -#define SPI_PDMACTL_RXPDMAEN_Pos (1) /*!< SPI_T::PDMACTL: RXPDMAEN Position */ -#define SPI_PDMACTL_RXPDMAEN_Msk (0x1ul << SPI_PDMACTL_RXPDMAEN_Pos) /*!< SPI_T::PDMACTL: RXPDMAEN Mask */ - -#define SPI_PDMACTL_PDMARST_Pos (2) /*!< SPI_T::PDMACTL: PDMARST Position */ -#define SPI_PDMACTL_PDMARST_Msk (0x1ul << SPI_PDMACTL_PDMARST_Pos) /*!< SPI_T::PDMACTL: PDMARST Mask */ - -#define SPI_FIFOCTL_RXRST_Pos (0) /*!< SPI_T::FIFOCTL: RXRST Position */ -#define SPI_FIFOCTL_RXRST_Msk (0x1ul << SPI_FIFOCTL_RXRST_Pos) /*!< SPI_T::FIFOCTL: RXRST Mask */ - -#define SPI_FIFOCTL_TXRST_Pos (1) /*!< SPI_T::FIFOCTL: TXRST Position */ -#define SPI_FIFOCTL_TXRST_Msk (0x1ul << SPI_FIFOCTL_TXRST_Pos) /*!< SPI_T::FIFOCTL: TXRST Mask */ - -#define SPI_FIFOCTL_RXTHIEN_Pos (2) /*!< SPI_T::FIFOCTL: RXTHIEN Position */ -#define SPI_FIFOCTL_RXTHIEN_Msk (0x1ul << SPI_FIFOCTL_RXTHIEN_Pos) /*!< SPI_T::FIFOCTL: RXTHIEN Mask */ - -#define SPI_FIFOCTL_TXTHIEN_Pos (3) /*!< SPI_T::FIFOCTL: TXTHIEN Position */ -#define SPI_FIFOCTL_TXTHIEN_Msk (0x1ul << SPI_FIFOCTL_TXTHIEN_Pos) /*!< SPI_T::FIFOCTL: TXTHIEN Mask */ - -#define SPI_FIFOCTL_RXTOIEN_Pos (4) /*!< SPI_T::FIFOCTL: RXTOIEN Position */ -#define SPI_FIFOCTL_RXTOIEN_Msk (0x1ul << SPI_FIFOCTL_RXTOIEN_Pos) /*!< SPI_T::FIFOCTL: RXTOIEN Mask */ - -#define SPI_FIFOCTL_RXOVIEN_Pos (5) /*!< SPI_T::FIFOCTL: RXOVIEN Position */ -#define SPI_FIFOCTL_RXOVIEN_Msk (0x1ul << SPI_FIFOCTL_RXOVIEN_Pos) /*!< SPI_T::FIFOCTL: RXOVIEN Mask */ - -#define SPI_FIFOCTL_TXUFPOL_Pos (6) /*!< SPI_T::FIFOCTL: TXUFPOL Position */ -#define SPI_FIFOCTL_TXUFPOL_Msk (0x1ul << SPI_FIFOCTL_TXUFPOL_Pos) /*!< SPI_T::FIFOCTL: TXUFPOL Mask */ - -#define SPI_FIFOCTL_TXUFIEN_Pos (7) /*!< SPI_T::FIFOCTL: TXUFIEN Position */ -#define SPI_FIFOCTL_TXUFIEN_Msk (0x1ul << SPI_FIFOCTL_TXUFIEN_Pos) /*!< SPI_T::FIFOCTL: TXUFIEN Mask */ - -#define SPI_FIFOCTL_RXFBCLR_Pos (8) /*!< SPI_T::FIFOCTL: RXFBCLR Position */ -#define SPI_FIFOCTL_RXFBCLR_Msk (0x1ul << SPI_FIFOCTL_RXFBCLR_Pos) /*!< SPI_T::FIFOCTL: RXFBCLR Mask */ - -#define SPI_FIFOCTL_TXFBCLR_Pos (9) /*!< SPI_T::FIFOCTL: TXFBCLR Position */ -#define SPI_FIFOCTL_TXFBCLR_Msk (0x1ul << SPI_FIFOCTL_TXFBCLR_Pos) /*!< SPI_T::FIFOCTL: TXFBCLR Mask */ - -#define SPI_FIFOCTL_SLVBERX_Pos (10) /*!< SPI_T::FIFOCTL: SLVBERX Position */ -#define SPI_FIFOCTL_SLVBERX_Msk (0x1ul << SPI_FIFOCTL_SLVBERX_Pos) /*!< SPI_T::FIFOCTL: SLVBERX Mask */ - -#define SPI_FIFOCTL_RXTH_Pos (24) /*!< SPI_T::FIFOCTL: RXTH Position */ -#define SPI_FIFOCTL_RXTH_Msk (0x7ul << SPI_FIFOCTL_RXTH_Pos) /*!< SPI_T::FIFOCTL: RXTH Mask */ - -#define SPI_FIFOCTL_TXTH_Pos (28) /*!< SPI_T::FIFOCTL: TXTH Position */ -#define SPI_FIFOCTL_TXTH_Msk (0x7ul << SPI_FIFOCTL_TXTH_Pos) /*!< SPI_T::FIFOCTL: TXTH Mask */ - -#define SPI_STATUS_BUSY_Pos (0) /*!< SPI_T::STATUS: BUSY Position */ -#define SPI_STATUS_BUSY_Msk (0x1ul << SPI_STATUS_BUSY_Pos) /*!< SPI_T::STATUS: BUSY Mask */ - -#define SPI_STATUS_UNITIF_Pos (1) /*!< SPI_T::STATUS: UNITIF Position */ -#define SPI_STATUS_UNITIF_Msk (0x1ul << SPI_STATUS_UNITIF_Pos) /*!< SPI_T::STATUS: UNITIF Mask */ - -#define SPI_STATUS_SSACTIF_Pos (2) /*!< SPI_T::STATUS: SSACTIF Position */ -#define SPI_STATUS_SSACTIF_Msk (0x1ul << SPI_STATUS_SSACTIF_Pos) /*!< SPI_T::STATUS: SSACTIF Mask */ - -#define SPI_STATUS_SSINAIF_Pos (3) /*!< SPI_T::STATUS: SSINAIF Position */ -#define SPI_STATUS_SSINAIF_Msk (0x1ul << SPI_STATUS_SSINAIF_Pos) /*!< SPI_T::STATUS: SSINAIF Mask */ - -#define SPI_STATUS_SSLINE_Pos (4) /*!< SPI_T::STATUS: SSLINE Position */ -#define SPI_STATUS_SSLINE_Msk (0x1ul << SPI_STATUS_SSLINE_Pos) /*!< SPI_T::STATUS: SSLINE Mask */ - -#define SPI_STATUS_SLVBEIF_Pos (6) /*!< SPI_T::STATUS: SLVBEIF Position */ -#define SPI_STATUS_SLVBEIF_Msk (0x1ul << SPI_STATUS_SLVBEIF_Pos) /*!< SPI_T::STATUS: SLVBEIF Mask */ - -#define SPI_STATUS_SLVURIF_Pos (7) /*!< SPI_T::STATUS: SLVURIF Position */ -#define SPI_STATUS_SLVURIF_Msk (0x1ul << SPI_STATUS_SLVURIF_Pos) /*!< SPI_T::STATUS: SLVURIF Mask */ - -#define SPI_STATUS_RXEMPTY_Pos (8) /*!< SPI_T::STATUS: RXEMPTY Position */ -#define SPI_STATUS_RXEMPTY_Msk (0x1ul << SPI_STATUS_RXEMPTY_Pos) /*!< SPI_T::STATUS: RXEMPTY Mask */ - -#define SPI_STATUS_RXFULL_Pos (9) /*!< SPI_T::STATUS: RXFULL Position */ -#define SPI_STATUS_RXFULL_Msk (0x1ul << SPI_STATUS_RXFULL_Pos) /*!< SPI_T::STATUS: RXFULL Mask */ - -#define SPI_STATUS_RXTHIF_Pos (10) /*!< SPI_T::STATUS: RXTHIF Position */ -#define SPI_STATUS_RXTHIF_Msk (0x1ul << SPI_STATUS_RXTHIF_Pos) /*!< SPI_T::STATUS: RXTHIF Mask */ - -#define SPI_STATUS_RXOVIF_Pos (11) /*!< SPI_T::STATUS: RXOVIF Position */ -#define SPI_STATUS_RXOVIF_Msk (0x1ul << SPI_STATUS_RXOVIF_Pos) /*!< SPI_T::STATUS: RXOVIF Mask */ - -#define SPI_STATUS_RXTOIF_Pos (12) /*!< SPI_T::STATUS: RXTOIF Position */ -#define SPI_STATUS_RXTOIF_Msk (0x1ul << SPI_STATUS_RXTOIF_Pos) /*!< SPI_T::STATUS: RXTOIF Mask */ - -#define SPI_STATUS_SPIENSTS_Pos (15) /*!< SPI_T::STATUS: SPIENSTS Position */ -#define SPI_STATUS_SPIENSTS_Msk (0x1ul << SPI_STATUS_SPIENSTS_Pos) /*!< SPI_T::STATUS: SPIENSTS Mask */ - -#define SPI_STATUS_TXEMPTY_Pos (16) /*!< SPI_T::STATUS: TXEMPTY Position */ -#define SPI_STATUS_TXEMPTY_Msk (0x1ul << SPI_STATUS_TXEMPTY_Pos) /*!< SPI_T::STATUS: TXEMPTY Mask */ - -#define SPI_STATUS_TXFULL_Pos (17) /*!< SPI_T::STATUS: TXFULL Position */ -#define SPI_STATUS_TXFULL_Msk (0x1ul << SPI_STATUS_TXFULL_Pos) /*!< SPI_T::STATUS: TXFULL Mask */ - -#define SPI_STATUS_TXTHIF_Pos (18) /*!< SPI_T::STATUS: TXTHIF Position */ -#define SPI_STATUS_TXTHIF_Msk (0x1ul << SPI_STATUS_TXTHIF_Pos) /*!< SPI_T::STATUS: TXTHIF Mask */ - -#define SPI_STATUS_TXUFIF_Pos (19) /*!< SPI_T::STATUS: TXUFIF Position */ -#define SPI_STATUS_TXUFIF_Msk (0x1ul << SPI_STATUS_TXUFIF_Pos) /*!< SPI_T::STATUS: TXUFIF Mask */ - -#define SPI_STATUS_TXRXRST_Pos (23) /*!< SPI_T::STATUS: TXRXRST Position */ -#define SPI_STATUS_TXRXRST_Msk (0x1ul << SPI_STATUS_TXRXRST_Pos) /*!< SPI_T::STATUS: TXRXRST Mask */ - -#define SPI_STATUS_RXCNT_Pos (24) /*!< SPI_T::STATUS: RXCNT Position */ -#define SPI_STATUS_RXCNT_Msk (0xful << SPI_STATUS_RXCNT_Pos) /*!< SPI_T::STATUS: RXCNT Mask */ - -#define SPI_STATUS_TXCNT_Pos (28) /*!< SPI_T::STATUS: TXCNT Position */ -#define SPI_STATUS_TXCNT_Msk (0xful << SPI_STATUS_TXCNT_Pos) /*!< SPI_T::STATUS: TXCNT Mask */ - -#define SPI_STATUS2_SLVBENUM_Pos (24) /*!< SPI_T::STATUS2: SLVBENUM Position */ -#define SPI_STATUS2_SLVBENUM_Msk (0x3ful << SPI_STATUS2_SLVBENUM_Pos) /*!< SPI_T::STATUS2: SLVBENUM Mask */ - -#define SPI_TX_TX_Pos (0) /*!< SPI_T::TX: TX Position */ -#define SPI_TX_TX_Msk (0xfffffffful << SPI_TX_TX_Pos) /*!< SPI_T::TX: TX Mask */ - -#define SPI_RX_RX_Pos (0) /*!< SPI_T::RX: RX Position */ -#define SPI_RX_RX_Msk (0xfffffffful << SPI_RX_RX_Pos) /*!< SPI_T::RX: RX Mask */ - -#define SPI_I2SCTL_I2SEN_Pos (0) /*!< SPI_T::I2SCTL: I2SEN Position */ -#define SPI_I2SCTL_I2SEN_Msk (0x1ul << SPI_I2SCTL_I2SEN_Pos) /*!< SPI_T::I2SCTL: I2SEN Mask */ - -#define SPI_I2SCTL_TXEN_Pos (1) /*!< SPI_T::I2SCTL: TXEN Position */ -#define SPI_I2SCTL_TXEN_Msk (0x1ul << SPI_I2SCTL_TXEN_Pos) /*!< SPI_T::I2SCTL: TXEN Mask */ - -#define SPI_I2SCTL_RXEN_Pos (2) /*!< SPI_T::I2SCTL: RXEN Position */ -#define SPI_I2SCTL_RXEN_Msk (0x1ul << SPI_I2SCTL_RXEN_Pos) /*!< SPI_T::I2SCTL: RXEN Mask */ - -#define SPI_I2SCTL_MUTE_Pos (3) /*!< SPI_T::I2SCTL: MUTE Position */ -#define SPI_I2SCTL_MUTE_Msk (0x1ul << SPI_I2SCTL_MUTE_Pos) /*!< SPI_T::I2SCTL: MUTE Mask */ - -#define SPI_I2SCTL_WDWIDTH_Pos (4) /*!< SPI_T::I2SCTL: WDWIDTH Position */ -#define SPI_I2SCTL_WDWIDTH_Msk (0x3ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPI_T::I2SCTL: WDWIDTH Mask */ - -#define SPI_I2SCTL_MONO_Pos (6) /*!< SPI_T::I2SCTL: MONO Position */ -#define SPI_I2SCTL_MONO_Msk (0x1ul << SPI_I2SCTL_MONO_Pos) /*!< SPI_T::I2SCTL: MONO Mask */ - -#define SPI_I2SCTL_ORDER_Pos (7) /*!< SPI_T::I2SCTL: ORDER Position */ -#define SPI_I2SCTL_ORDER_Msk (0x1ul << SPI_I2SCTL_ORDER_Pos) /*!< SPI_T::I2SCTL: ORDER Mask */ - -#define SPI_I2SCTL_SLAVE_Pos (8) /*!< SPI_T::I2SCTL: SLAVE Position */ -#define SPI_I2SCTL_SLAVE_Msk (0x1ul << SPI_I2SCTL_SLAVE_Pos) /*!< SPI_T::I2SCTL: SLAVE Mask */ - -#define SPI_I2SCTL_MCLKEN_Pos (15) /*!< SPI_T::I2SCTL: MCLKEN Position */ -#define SPI_I2SCTL_MCLKEN_Msk (0x1ul << SPI_I2SCTL_MCLKEN_Pos) /*!< SPI_T::I2SCTL: MCLKEN Mask */ - -#define SPI_I2SCTL_RZCEN_Pos (16) /*!< SPI_T::I2SCTL: RZCEN Position */ -#define SPI_I2SCTL_RZCEN_Msk (0x1ul << SPI_I2SCTL_RZCEN_Pos) /*!< SPI_T::I2SCTL: RZCEN Mask */ - -#define SPI_I2SCTL_LZCEN_Pos (17) /*!< SPI_T::I2SCTL: LZCEN Position */ -#define SPI_I2SCTL_LZCEN_Msk (0x1ul << SPI_I2SCTL_LZCEN_Pos) /*!< SPI_T::I2SCTL: LZCEN Mask */ - -#define SPI_I2SCTL_RXLCH_Pos (23) /*!< SPI_T::I2SCTL: RXLCH Position */ -#define SPI_I2SCTL_RXLCH_Msk (0x1ul << SPI_I2SCTL_RXLCH_Pos) /*!< SPI_T::I2SCTL: RXLCH Mask */ - -#define SPI_I2SCTL_RZCIEN_Pos (24) /*!< SPI_T::I2SCTL: RZCIEN Position */ -#define SPI_I2SCTL_RZCIEN_Msk (0x1ul << SPI_I2SCTL_RZCIEN_Pos) /*!< SPI_T::I2SCTL: RZCIEN Mask */ - -#define SPI_I2SCTL_LZCIEN_Pos (25) /*!< SPI_T::I2SCTL: LZCIEN Position */ -#define SPI_I2SCTL_LZCIEN_Msk (0x1ul << SPI_I2SCTL_LZCIEN_Pos) /*!< SPI_T::I2SCTL: LZCIEN Mask */ - -#define SPI_I2SCTL_FORMAT_Pos (28) /*!< SPI_T::I2SCTL: FORMAT Position */ -#define SPI_I2SCTL_FORMAT_Msk (0x3ul << SPI_I2SCTL_FORMAT_Pos) /*!< SPI_T::I2SCTL: FORMAT Mask */ - -#define SPI_I2SCTL_SLVERRIEN_Pos (31) /*!< SPI_T::I2SCTL: SLVERRIEN Position */ -#define SPI_I2SCTL_SLVERRIEN_Msk (0x1ul << SPI_I2SCTL_SLVERRIEN_Pos) /*!< SPI_T::I2SCTL: SLVERRIEN Mask */ - -#define SPI_I2SCLK_MCLKDIV_Pos (0) /*!< SPI_T::I2SCLK: MCLKDIV Position */ -#define SPI_I2SCLK_MCLKDIV_Msk (0x7ful << SPI_I2SCLK_MCLKDIV_Pos) /*!< SPI_T::I2SCLK: MCLKDIV Mask */ - -#define SPI_I2SCLK_BCLKDIV_Pos (8) /*!< SPI_T::I2SCLK: BCLKDIV Position */ -#define SPI_I2SCLK_BCLKDIV_Msk (0x3fful << SPI_I2SCLK_BCLKDIV_Pos) /*!< SPI_T::I2SCLK: BCLKDIV Mask */ - -#define SPI_I2SCLK_I2SMODE_Pos (24) /*!< SPI_T::I2SCLK: I2SMODE Position */ -#define SPI_I2SCLK_I2SMODE_Msk (0x1ul << SPI_I2SCLK_I2SMODE_Pos) /*!< SPI_T::I2SCLK: I2SMODE Mask */ - -#define SPI_I2SCLK_I2SSLAVE_Pos (25) /*!< SPI_T::I2SCLK: I2SSLAVE Position */ -#define SPI_I2SCLK_I2SSLAVE_Msk (0x1ul << SPI_I2SCLK_I2SSLAVE_Pos) /*!< SPI_T::I2SCLK: I2SSLAVE Mask */ - -#define SPI_I2SSTS_RIGHT_Pos (4) /*!< SPI_T::I2SSTS: RIGHT Position */ -#define SPI_I2SSTS_RIGHT_Msk (0x1ul << SPI_I2SSTS_RIGHT_Pos) /*!< SPI_T::I2SSTS: RIGHT Mask */ - -#define SPI_I2SSTS_RXEMPTY_Pos (8) /*!< SPI_T::I2SSTS: RXEMPTY Position */ -#define SPI_I2SSTS_RXEMPTY_Msk (0x1ul << SPI_I2SSTS_RXEMPTY_Pos) /*!< SPI_T::I2SSTS: RXEMPTY Mask */ - -#define SPI_I2SSTS_RXFULL_Pos (9) /*!< SPI_T::I2SSTS: RXFULL Position */ -#define SPI_I2SSTS_RXFULL_Msk (0x1ul << SPI_I2SSTS_RXFULL_Pos) /*!< SPI_T::I2SSTS: RXFULL Mask */ - -#define SPI_I2SSTS_RXTHIF_Pos (10) /*!< SPI_T::I2SSTS: RXTHIF Position */ -#define SPI_I2SSTS_RXTHIF_Msk (0x1ul << SPI_I2SSTS_RXTHIF_Pos) /*!< SPI_T::I2SSTS: RXTHIF Mask */ - -#define SPI_I2SSTS_RXOVIF_Pos (11) /*!< SPI_T::I2SSTS: RXOVIF Position */ -#define SPI_I2SSTS_RXOVIF_Msk (0x1ul << SPI_I2SSTS_RXOVIF_Pos) /*!< SPI_T::I2SSTS: RXOVIF Mask */ - -#define SPI_I2SSTS_RXTOIF_Pos (12) /*!< SPI_T::I2SSTS: RXTOIF Position */ -#define SPI_I2SSTS_RXTOIF_Msk (0x1ul << SPI_I2SSTS_RXTOIF_Pos) /*!< SPI_T::I2SSTS: RXTOIF Mask */ - -#define SPI_I2SSTS_I2SENSTS_Pos (15) /*!< SPI_T::I2SSTS: I2SENSTS Position */ -#define SPI_I2SSTS_I2SENSTS_Msk (0x1ul << SPI_I2SSTS_I2SENSTS_Pos) /*!< SPI_T::I2SSTS: I2SENSTS Mask */ - -#define SPI_I2SSTS_TXEMPTY_Pos (16) /*!< SPI_T::I2SSTS: TXEMPTY Position */ -#define SPI_I2SSTS_TXEMPTY_Msk (0x1ul << SPI_I2SSTS_TXEMPTY_Pos) /*!< SPI_T::I2SSTS: TXEMPTY Mask */ - -#define SPI_I2SSTS_TXFULL_Pos (17) /*!< SPI_T::I2SSTS: TXFULL Position */ -#define SPI_I2SSTS_TXFULL_Msk (0x1ul << SPI_I2SSTS_TXFULL_Pos) /*!< SPI_T::I2SSTS: TXFULL Mask */ - -#define SPI_I2SSTS_TXTHIF_Pos (18) /*!< SPI_T::I2SSTS: TXTHIF Position */ -#define SPI_I2SSTS_TXTHIF_Msk (0x1ul << SPI_I2SSTS_TXTHIF_Pos) /*!< SPI_T::I2SSTS: TXTHIF Mask */ - -#define SPI_I2SSTS_TXUFIF_Pos (19) /*!< SPI_T::I2SSTS: TXUFIF Position */ -#define SPI_I2SSTS_TXUFIF_Msk (0x1ul << SPI_I2SSTS_TXUFIF_Pos) /*!< SPI_T::I2SSTS: TXUFIF Mask */ - -#define SPI_I2SSTS_RZCIF_Pos (20) /*!< SPI_T::I2SSTS: RZCIF Position */ -#define SPI_I2SSTS_RZCIF_Msk (0x1ul << SPI_I2SSTS_RZCIF_Pos) /*!< SPI_T::I2SSTS: RZCIF Mask */ - -#define SPI_I2SSTS_LZCIF_Pos (21) /*!< SPI_T::I2SSTS: LZCIF Position */ -#define SPI_I2SSTS_LZCIF_Msk (0x1ul << SPI_I2SSTS_LZCIF_Pos) /*!< SPI_T::I2SSTS: LZCIF Mask */ - -#define SPI_I2SSTS_SLVERRIF_Pos (22) /*!< SPI_T::I2SSTS: SLVERRIF Position */ -#define SPI_I2SSTS_SLVERRIF_Msk (0x1ul << SPI_I2SSTS_SLVERRIF_Pos) /*!< SPI_T::I2SSTS: SLVERRIF Mask */ - -#define SPI_I2SSTS_TXRXRST_Pos (23) /*!< SPI_T::I2SSTS: TXRXRST Position */ -#define SPI_I2SSTS_TXRXRST_Msk (0x1ul << SPI_I2SSTS_TXRXRST_Pos) /*!< SPI_T::I2SSTS: TXRXRST Mask */ - -#define SPI_I2SSTS_RXCNT_Pos (24) /*!< SPI_T::I2SSTS: RXCNT Position */ -#define SPI_I2SSTS_RXCNT_Msk (0x7ul << SPI_I2SSTS_RXCNT_Pos) /*!< SPI_T::I2SSTS: RXCNT Mask */ - -#define SPI_I2SSTS_TXCNT_Pos (28) /*!< SPI_T::I2SSTS: TXCNT Position */ -#define SPI_I2SSTS_TXCNT_Msk (0x7ul << SPI_I2SSTS_TXCNT_Pos) /*!< SPI_T::I2SSTS: TXCNT Mask */ - -/**@}*/ /* SPI_CONST */ -/**@}*/ /* end of SPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/spim_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/spim_reg.h deleted file mode 100644 index 367c9e21207..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/spim_reg.h +++ /dev/null @@ -1,557 +0,0 @@ -/**************************************************************************//** - * @file spim_reg.h - * @version V1.00 - * @brief SPIM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SPIM_REG_H__ -#define __SPIM_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SPIM Serial Peripheral Interface Controller Master Mode (SPIM) - Memory Mapped Structure for SPIM Controller -@{ */ - -typedef struct -{ - - - /** - * @var SPIM_T::CTL0 - * Offset: 0x00 Control and Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CIPHOFF |Cipher Disable Control - * | | |0 = Cipher function Enabled. - * | | |1 = Cipher function Disabled. - * | | |Note1: If there is not any KEY1(SPIM_KEY1[31:0]) or KEY2(SPIM_KEY2[31:0]) (KEY1 is 0x0000_0000 or KEY2 is 0x0000_0000), the cipher function will be disabled automatically. - * | | |Note2: When CIPHOFF(SPIM_CTL0[0]) is 0, both of KEY1(SPIM_KEY1[31:0]) and KEY2(SPIM_KEY2[31:0]) do not equal to 0x0000_0000 (i.e. - * | | |KEY1 != 0x0000_0000 and KEY2 != 0x0000_0000), cipher encryption/decryption is enabled. - * | | |Note3 : When cipher encryption/decryption is enabled, please set DESELTIM (SPIM_DMMCTL[20:16]) >= 0x10. - * | | |When cipher encryption/decryption is disabled, please set DESELTIM(SPIM_DMMCTL[20:16]) >= 0x8. - * |[2] |BALEN |Balance the AHB Control Time Between Cipher Enable and Disable Control - * | | |When cipher is enabled, the AHB control signal will delay some time caused by the encoding or decoding calculation - * | | |Therefore, if set BALEN to 1, it will make the AHB signal processing time with cipher disabled be equal to that with cipher enabled. - * | | |Note: Only useful when cipher is disabled. - * |[5] |B4ADDREN |4-byte Address Mode Enable Control - * | | |0 = 4-byte address mode is disabled, and 3-byte address mode is enabled. - * | | |1 = 4-byte address mode is enabled. - * | | |Note: Used for DMA write mode, DMA read mode, and DMM mode. - * |[6] |IEN |Interrupt Enable Control - * | | |0 = SPIM Interrupt Disabled. - * | | |1 = SPIM Interrupt Enabled. - * |[7] |IF |Interrupt Flag - * | | |(1) Write Operation : - * | | |0 = No effect. - * | | |1 = Write 1 to clear. - * | | |(2) Read Operation : - * | | |0 = The transfer has not finished yet. - * | | |1 = The transfer has done. - * |[12:8] |DWIDTH |Transmit/Receive Bit Length - * | | |This specifies how many bits are transmitted/received in one transmit/receive transaction. - * | | |0x7 = 8 bits. - * | | |0xF = 16 bits. - * | | |0x17 = 24 bits. - * | | |0x1F = 32 bits. - * | | |Others = Incorrect transfer result. - * | | |Note1: Only used for normal I/O mode. - * | | |Note2: Only 8, 16, 24, and 32 bits are allowed. Other bit length will result in incorrect transfer. - * |[14:13] |BURSTNUM |Transmit/Receive Burst Number - * | | |This field specifies how many transmit/receive transactions should be executed continuously in one transfer. - * | | |0x0 = Only one transmit/receive transaction will be executed in one transfer. - * | | |0x1 = Two successive transmit/receive transactions will be executed in one transfer. - * | | |0x2 = Three successive transmit/receive transactions will be executed in one transfer. - * | | |0x3 = Four successive transmit/receive transactions will be executed in one transfer. - * | | |Note: Only used for normal I/O Mode. - * |[15] |QDIODIR |SPI Interface Direction Select for Quad/Dual Mode - * | | |0 = Interface signals are input. - * | | |1 = Interface signals are output. - * | | |Note: Only used for normal I/O mode. - * |[19:16] |SUSPITV |Suspend Interval - * | | |These four bits provide the configuration of suspend interval between two successive transmit/receive transactions in a transfer - * | | |The default value is 0x00 - * | | |When BURSTNUM = 00, setting this field has no effect on transfer - * | | |The desired interval is obtained according to the following equation (from the last falling edge of current SPI clock to the first rising edge of next SPI clock): - * | | | (SUSPITV+2)*period of AHB clock - * | | | 0x0 = 2 AHB clock cycles. - * | | | 0x1 = 3 AHB clock cycles. - * | | | ...... - * | | | 0xE = 16 AHB clock cycles. - * | | | 0xF = 17 AHB clock cycles. - * | | | Note: Only used for normal I/O mode. - * |[21:20] |BITMODE |SPI Interface Bit Mode - * | | |0x0 = Standard mode. - * | | |0x1 = Dual mode. - * | | |0x2 = Quad mode. - * | | |0x3 = Reserved. - * | | |Note: Only used for normal I/O mode. - * |[23:22] |OPMODE |SPI Function Operation Mode - * | | |0x0 = Normal I/O mode. (Note1) (Note3) - * | | |0x1 = DMA write mode. (Note2) (Note3) - * | | |0x2 = DMA read mode. (Note3) - * | | |0x3 = Direct Memory Mapping mode (DMM mode) (Default). (Note4) - * | | |Note1 : After user uses Normal I/O mode of SPI flash controller to program the content of external SPI flash, please set CDINVAL(SPIM_CTL1[3]) to 0x1 (Set all cache data to be invalid). - * | | |Note2 : In DMA write mode, hardware will send just one page program command per operation - * | | |Users must take care of cross-page cases - * | | |After user uses DMA write mode of SPI flash controller to program the content of external SPI flash, please set CDINVAL(SPIM_CTL1[3]) to 0x1 (Set all cache data to be invalid). - * | | |Note3 : For external SPI flash with 32 MB, access address range of external SPI flash address is from 0x00000000 to 0x01FFFFFF when user uses Normal I/O mode, DMA write mode, and DMA read mode to write/read external SPI flash data - * | | |Please user check size of used SPI flash component to know access address range of external SPI flash. - * | | |Note4 : For external SPI flash with 32 MB, access address range of external SPI flash address is from 0x08000000 to 0x09FFFFFF when user uses Direct Memory mapping mode (DMM mode) to read external SPI flash data - * | | |Please user check size of used SPI flash component to know access address range of external SPI flash. - * |[31:24] |CMDCODE |Page Program Command Code (Note4) - * | | |(1) 0x02 = Page program (Used for DMA Write mode). - * | | |(2) 0x32 = Quad page program with TYPE_1 program flow (Used for DMA Write mode). (Note3) - * | | |(3) 0x38 = Quad page program with TYPE_2 program flow (Used for DMA Write mode). (Note3) - * | | |(4) 0x40 = Quad page program with TYPE_3 program flow (Used for DMA Write mode). (Note3) - * | | |The Others = Reserved. - * | | |Read Command Code : - * | | |(1) 0x03 = Standard Read (Used for DMA Read/DMM mode). - * | | |(2) 0x0B = Fast Read (Used for DMA Read/DMM mode). - * | | |The fast read command code "0x0B" is similar to command code of standard read "0x03" except it can operate at highest possible frequency - * | | |(Note2) - * | | |(3) 0x3B = Fast Read Dual Output (Used for DMA Read/DMM mode). - * | | |(4) 0xBB = Fast Read Dual I/O (Used for DMA Read/DMM mode). - * | | |The fast read dual I/O command code "0xBB" is similar to command code of fast read dual output "0x3B" but with capability to input the address bits two bits per clock - * | | |(Note2) - * | | |(5) 0xEB = Fast quad read (Used for DMA Read/DMM mode). - * | | |(6) 0xE7 = Word quad read (Used for DMA Read/DMM mode). - * | | |The command code of word quad read "0xE7" is similar to command code of fast quad read "0xEB" except that the lowest address bit must equal to 0 and the number of dummy cycles is less than fast quad read - * | | |(Note2) - * | | |(7) 0x0D = DTR/DDR Fast read (Used for DMA Read/DMM mode). - * | | |(8) 0xBD = DTR/DDR dual read (Used for DMA Read/DMM mode). - * | | |(9) 0xED = DTR/DDR quad read (Used for DMA Read/DMM mode). - * | | |The Others command codes are Reserved. - * | | |The DTR/DDR read commands "0x0D,0xBD,0xED" improves throughput by transferring address and data on both the falling and rising edge of SPI flash clock (SPIM_CLK) - * | | |It is similar to those commands "0x0B, 0xBB, 0xEB" but allows transfer of address and data on rising edge and falling edge of SPI flash output clock - * | | |(Note2) - * | | |Note1: Quad mode of SPI Flash must be enabled first by normal I/O mode before using quad page program/quad read commands. - * | | |Note2: See SPI flash specifications for support items. - * | | |Note3: For TYPE_1, TYPE_2, and TYPE_3 of page program command code, refer to Figure 7.19-3, Figure 7.19-4, and Figure 7.19-5. - * | | |Note4: Please disable "continuous read mode" and "burst wrap mode" before DMA write mode of SPI flash controller is used to program data of external SPI flash - * | | |After user uses DMA write mode of SPI flash controller to program the content of external SPI flash, please set CDINVAL(SPIM_CTL1[3]) to 0x1 (Set all cache data to be invalid). - * @var SPIM_T::CTL1 - * Offset: 0x04 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIMEN |Go and Busy Status - * | | |(1) Write Operation : - * | | |0 = No effect. - * | | |1 = Start the transfer - * | | |This bit remains set during the transfer and is automatically cleared after transfer finished. - * | | |(2) Read Operation : - * | | |0 = The transfer has done. - * | | |1 = The transfer has not finished yet. - * | | |Note: All registers should be set before writing 1 to the SPIMEN bit - * | | |When a transfer is in progress, you should not write to any register of this peripheral. - * |[1] |CACHEOFF |Cache Memory Function Disable Control - * | | |0 = Cache memory function enable. (Default value) - * | | |1 = Cache memory function disable. - * | | |Note: When CCM mode is enabled, the cache function will be disable by hardware automatically - * | | |When CCM mode is disabled, the cache function can be enable or disable by user. - * |[2] |CCMEN |CCM (Core Coupled Memory) Mode Enable Control - * | | |0 = CCM mode disable. (Default value) - * | | |1 = CCM mode enable. - * | | |Note1: When CCM mode is enabled, the cache function will be disable by hardware automatically - * | | |When CCM mode is disabled, the cache function can be enabled or disabled by user. - * | | |Note2: When CCM mode is disabled, user accesses the core coupled memory by bus master - * | | |In this case, the SPI flash controller will send error response via HRESP bus signal to bus master. - * | | |Note3: When CCM mode needs to be enabled, user sets CCMEN to 1 and needs to read this register to show the current hardware status - * | | |When reading data of CCMEN is 1, MCU can start to read data from CCM memory space or write data to CCM memory space. - * |[3] |CDINVAL |Cache Data Invalid Enable Control - * | | |(1) Write Operation: - * | | |0 = No effect. - * | | |1 = Set all cache data to be invalid. This bit is cleared by hardware automatically. - * | | |(2) Read Operation : No effect - * | | |Note: When SPI flash memory is page erasing or whole flash erasing, please set CDINVAL to 0x1 - * | | |After user uses normal I/O mode or DMA write mode of SPI flash controller to program or erase the content of external SPI flash, please set CDINVAL to 0x1. - * |[4] |SS |Slave Select Active Enable Control - * | | |0 = SPIM_SS is in active level. - * | | |1 = SPIM_SS is in inactive level (Default). - * | | |Note: This interface can only drive one device/slave at a given time - * | | |Therefore, the slave selects of the selected device must be set to its active level before starting any read or write transfer - * | | |Functional description of SSACTPOL(SPIM_CTL1[5]) and SS is shown in Table 2. - * |[5] |SSACTPOL |Slave Select Active Level - * | | |It defines the active level of device/slave select signal (SPIM_SS), and we show in Table 2. - * | | |0 = The SPIM_SS slave select signal is active low. - * | | |1 = The SPIM_SS slave select signal is active high. - * |[11:8] |IDLETIME |Idle Time Interval - * | | |In DMM mode, IDLETIME is set to control the minimum idle time between two SPI Flash accesses. - * | | |Minimum idle time = (IDLETIME + 1) * AHB clock cycle time. - * | | |Note1: Only used for DMM mode. - * | | |Note2 : AHB clock cycle time = 1/AHB clock frequency. - * |[31:16] |DIVIDER |Clock Divider Register - * | | |The value in this field is the frequency divider of the AHB clock (HCLK) to generate the serial SPI output clock "SCLK" on the output SPIM_CLK pin - * | | |The desired frequency is obtained according to the following equation: - * | | |Note1: When set DIVIDER to zero, the frequency of SPIM_CLK will be equal to the frequency of HCLK. - * | | |Note2: SCLK is serial SPI output clock. - * | | |Note3: Please check the specification of the used SPI flash component to decide the frequency of SPI flash clock. - * | | |Note4: For DTR/DDR read commands "0x0D, 0xBD, 0xED", the setting values of DIVIDER are only 1,2,4,8,16,32,..., where n = 0,1,2,3,4, ... - * @var SPIM_T::RXCLKDLY - * Offset: 0x0C RX Clock Delay Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DWDELSEL |SPI flash deselect time interval of DMA write mode - * | | |For DMA write mode only - * | | |This register sets the deselect time interval of SPI flash (i.e. - * | | |time interval of inactive level of SPIM_SS) when SPI flash controller operates on DMA write mode - * | | |(Note1) - * | | |Deselect time interval of DMA write mode = (DWDELSEL + 1) * AHB clock cycle time (Note2). - * | | |Note1: Please user check the used external SPI flash component to set this register value - * | | |In general case, the deselect time interval of SPI flash is greater than 50 ns when SPI flash performs the program operation. - * | | |Note2: AHB clock cycle time = 1/AHB clock frequency. - * |[18:16] |RDDLYSEL |Sampling Clock Delay Selection for Received Data - * | | |For Normal I/O mode, DMA read mode, DMA write mode, and direct memory mapping mode - * | | |Determine the number of inserted delay cycles - * | | |Used to adjust the sampling clock of received data to latch the correct data. - * | | |0x0 : No delay. (Default Value) - * | | |0x1 : Delay 1 SPI flash clock. - * | | |0x2 : Delay 2 SPI flash clocks. - * | | |0x3 : Delay 3 SPI flash clocks. - * | | |... - * | | |0x7 : Delay 7 SPI flash clocks - * | | |Note : We can use manufacturer id or device id of external SPI flash component to determine the correct setting value of RDDLYSEL, and we give example as follows. - * | | |For example, manufacturer id and device id of external SPI flash for some vendor are 0xEF and 0x1234 separately - * | | |Firstly, we set RDDLYSEL to 0x0, and use read manufacturer id/device id command to read the manufacturer id of external SPI flash by using normal I/O mode (the manufacturer id is 0xEF (1110_1111) in this example). - * | | |If manufacturer id which reads from external SPI flash is 0xF7 (1111_0111), it denotes that manufacturer id is shifted the right by 1 bit and most significant bit (MSB) of manufacturer id is assigned to 1 - * | | |According to manufacturer id reads from external SPI flash, we need to set RDDLYSEL to 0x1 to receive SPI flash data correctly. - * |[20] |RDEDGE |Sampling Clock Edge Selection for Received Data - * | | |For Normal I/O mode, DMA read mode, DMA write mode, and direct memory mapping mode - * | | |0 : Use SPI input clock rising edge to sample received data. (Default Value) - * | | |1 : Use SPI input clock falling edge to sample received data. - * @var SPIM_T::RX[4] - * Offset: 0x10 ~ 0x1C Data Receive Register 0 ~ 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXDAT |Data Receive Register - * | | |The Data Receive Registers hold the received data of the last executed transfer. - * | | |Number of valid RX registers is specified in SPIM_CTL0[BURSTNUM] - * | | |If BURSTNUM > 0, received data are held in the most significant RXDAT register first. - * | | |Number of valid-bit is specified in SPIM_CTL0[DWIDTH] - * | | |If DWIDTH is 16, 24, or 32, received data are held in the least significant byte of RXDAT register first. - * | | |In a byte, received data are held in the most significant bit of RXDAT register first. - * | | |Example 1: If SPIM_CTL0[BURSTNUM] = 0x3 and SPIM_CTL1[DWIDTH] = 0x17, received data will be held in the order SPIM_RX3[23:0], SPIM_RX2[23:0], SPIM_RX1[23:0], SPIM_RX0[23:0]. - * | | |Example 2: If SPIM_CTL0[BURSTNUM = 0x0 and SPIM_CTL0[DWIDTH] = 0x17, received data will be held in the order SPIM_RX0[7:0], SPIM_RX0[15:8], SPIM_RX0[23:16]. - * | | |Example 3: If SPIM_CTL0[BURSTNUM = 0x0 and SPIM_CTL0[DWIDTH] = 0x07, received data will be held in the order SPIM_RX0[7], SPIM_RX0[6], ..., - * | | |SPIM_RX0[0]. - * @var SPIM_T::TX[4] - * Offset: 0x20 ~ 0x2C Data Transmit Register 0 ~ 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXDAT |Data Transmit Register - * | | |The Data Transmit Registers hold the data to be transmitted in next transfer. - * | | |Number of valid TXDAT registers is specified in SPIM_CTL0[BURSTNUM] - * | | |If BURSTNUM > 0, data are transmitted in the most significant TXDAT register first. - * | | |Number of valid-bit is specified in SPIM_CTL0[DWIDTH] - * | | |If DWIDTH is 16, 24, or 32, data are transmitted in the least significant byte of TXDAT register first. - * | | |In a byte, data are transmitted in the most significant bit of TXDAT register first. - * | | |Example 1: If SPIM_CTL0[BURSTNUM] = 0x3 and SPIM_CTL1[DWIDTH] = 0x17, data will be transmitted in the order SPIM_TX3[23:0], SPIM_TX2[23:0], SPIM_TX1[23:0], SPIM_TX0[23:0] in next transfer. - * | | |Example 2: If SPIM_CTL0[BURSTNUM] = 0x0 and SPIM_CTL0[DWIDTH] = 0x17, data will be transmitted in the order SPIM_TX0[7:0], SPIM_TX0[15:8], SPIM_TX0[23:16] in next transfer. - * | | |Example 3: If SPIM_CTL0[BURSTNUM] = 0x0 and SPIM_CTL0[DWIDTH] = 0x07, data will be transmitted in the order SPIM_TX0[7], SPIM_TX0[6], ..., - * | | |SPIM_TX0[0] in next transfer. - * @var SPIM_T::SRAMADDR - * Offset: 0x30 SRAM Memory Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDR |SRAM Memory Address - * | | |For DMA Read mode, this is the destination address for DMA transfer. - * | | |For DMA Write mode, this is the source address for DMA transfer. - * | | |Note: This address must be word-aligned. - * @var SPIM_T::DMACNT - * Offset: 0x34 DMA Transfer Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |DMACNT |DMA Transfer Byte Count Register - * | | |It indicates the transfer length for DMA process. - * | | |Note1: The unit for counting is byte. - * | | |Note2: The number must be the multiple of 4. - * | | |Note3: Please check specification of used SPI flash to know maximum byte length of page program. - * @var SPIM_T::FADDR - * Offset: 0x38 SPI Flash Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDR |SPI Flash Address Register - * | | |For DMA Read mode, this is the source address for DMA transfer. - * | | |For DMA Write mode, this is the destination address for DMA transfer. - * | | |Note 1 : This address must be word-aligned. - * | | |Note 2 : For external SPI flash with 32 MB, the value of this SPI flash address register "ADDR" is from 0x00000000 to 0x01FFFFFF when user uses DMA write mode and DMA read mode to write/read external SPI flash data - * | | |Please user check size of used SPI flash component to know access address range of external SPI flash. - * @var SPIM_T::KEY1 - * Offset: 0x3C Cipher Key1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY1 |Cipher Key1 Register - * | | |This is the KEY1 data for cipher function. - * | | |Note1: If there is not any KEY1(SPIM_KEY1[31:0]) or KEY2(SPIM_KEY2[31:0]) (KEY1 is 0x0000_0000 or KEY2 is 0x0000_0000), the cipher function will be disabled automatically. - * | | |Note2: When CIPHOFF(SPIM_CTL0[0]) is 0, both of KEY1(SPIM_KEY1[31:0]) and KEY2(SPIM_KEY2[31:0]) do not equal to 0x0000_0000 (i.e. - * | | |KEY1 != 0x0000_0000 and KEY2 != 0x0000_0000), cipher encryption/decryption is enabled. - * @var SPIM_T::KEY2 - * Offset: 0x40 Cipher Key2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY2 |Cipher Key2 Register - * | | |This is the KEY2 data for cipher function. - * | | |Note1: If there is not any KEY1(SPIM_KEY1[31:0]) or KEY2(SPIM_KEY2[31:0]) (KEY1 is 0x0000_0000 or KEY2 is 0x0000_0000), the cipher function will be disabled automatically. - * | | |Note2: When CIPHOFF(SPIM_CTL0[0]) is 0, both of KEY1(SPIM_KEY1[31:0]) and KEY2(SPIM_KEY2[31:0]) do not equal to 0x0000_0000 (i.e. - * | | |KEY1 != 0x0000_0000 and KEY2 != 0x0000_0000), cipher encryption/decryption is enabled. - * @var SPIM_T::DMMCTL - * Offset: 0x44 Direct Memory Mapping Mode Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:8] |CRMDAT |Mode bits data for Continuous Read Mode (or performance enhance mode) (Default value = 0) - * | | |Only for direct memory mapping mode - * | | |Set the mode bits data for continuous read mode (or performance enhance mode). - * | | |When we set this mode bits currently (Note1) and set CREN(SPIM_DMMCTL[25]), this reduces the command phase by eight clocks and allows the read address to be immediately entered after SPIM_SS asserted to active - * | | |(Note1) - * | | |Note1 : Please check the used SPI flash specification to know the setting value of this mode bits data, and different SPI flash vendor may use different setting values. - * | | |Note2 : CRMDAT needs to used with CREN(SPIM_DMMCTL[25]). - * |[20:16] |DESELTIM |SPI Flash Deselect Time - * | | |Only for direct memory mapping mode - * | | |Set the minimum time width of SPI flash deselect time (i.e. - * | | |Minimum SPIM_SS deselect time), and we show in Figure 7.19-8. - * | | |(1) Cache function disable : - * | | |Minimum time width of SPIM_SS deselect time = (DESELTIM + 1) * AHB clock cycle time. - * | | |(2) Cache function enable : - * | | |Minimum time width of SPIM_SS deselect time = (DESELTIM + 4) * AHB clock cycle time. - * | | |Note1 : AHB clock cycle time = 1/AHB clock frequency. - * | | |Note2 : When cipher encryption/decryption is enabled, please set this register value >= 0x10 - * | | |When cipher encryption/decryption is disabled, please set this register value >= 0x8. - * | | |Note3 : Please check the used SPI flash specification to know the setting value of this register, and different SPI flash vendor may use different setting values. - * |[24] |BWEN |16 bytes Burst Wrap Mode Enable Control Register (Default value = 0) - * | | |Only for WINBOND SPI flash, direct memory mapping mode, Cache enable, and read command code "0xEB, and 0xE7" - * | | |0 = Burst Wrap Mode Disable. (Default) - * | | |1 = Burst Wrap Mode Enable. - * | | |In direct memory mapping mode, both of quad read commands "0xEB" and "0xE7" support burst wrap mode for cache application and performance enhance - * | | |For cache application, the burst wrap mode can be used to fill the cache line quickly (In this SPI flash controller, we use cache data line with 16 bytes size) - * | | |For performance enhance with direct memory mapping mode and cache enable, when cache data is miss, the burst wrap mode can let MCU get the required SPI flash data quickly. - * |[25] |CREN |Continuous Read Mode Enable Control - * | | |Only for direct memory mapping mode, read command codes 0xBB, 0xEB, 0xE7, 0x0D, 0xBD, 0xED (Note2) - * | | |0 = Continuous Read Mode Disable. (Default) - * | | |1 = Continuous Read Mode Enable. - * | | |For read operations of SPI flash, commands of fast read quad I/O (0xEB), word read quad I/O (0xE7 in Winbond SPI flash), fast read dual I/O (0xBB), DTR/DDR fast read (0x0D), DTR/DDR fast read dual I/O (0xBD), and DTR/DDR fast read quad I/O (0xED) can further reduce command overhead through setting the "continuous read mode" bits (8 bits) after the input address data. - * | | |Note: When user uses function of continuous read mode and sets USETEN (SPIM_CTL2[16]) to 1, CRMDAT(SPIM_DMMCTL[15:8]) must be set by used SPI flash specifications - * | | |When user uses function of continuous read mode and sets USETEN(SPIM_CTL2[16]) to 0, CRMDAT(SPIM_DMMCTL[15:8]) is set by default value of WINBOND SPI flash. - * |[26] |UACTSCLK |User Sets SPI Flash Active SCLK Time - * | | |Only for direct memory mapping mode, DMA write mode, and DMA read mode - * | | |0 = According to DIVIDER(SPIM_CTL1[31:16]), ACTSCLKT(SPIM_DMMCTL[31:28]) is set by hardware automatically - * | | |(Default value) - * | | |1 = Set ACTSCLKT(SPIM_DMMCTL[31:28]) by user manually. - * | | |When user wants to set ACTSCLKT(SPIM_DMMCTL[31:28]) manually, please set UACTSCLK to 1. - * |[31:28] |ACTSCLKT |SPI Flash Active SCLK Time - * | | |Only for direct memory mapping mode, DMA write mode, and DMA read mode - * | | |This register sets time interval between SPIM SS active edge and the position edge of the first serial SPI output clock, and we show in Figure 7.19-8. - * | | |(1) ACTSCLKT = 0 (function disable) :. - * | | |Time interval = 1 AHB clock cycle time. - * | | |(2) ACTSCLKT != 0 (function enable) : - * | | |Time interval = (ACTSCLKT + 3) * AHB clock cycle time. - * | | |Note1 : AHB clock cycle time = 1/AHB clock frequency. - * | | |Note2 : SCLK is SPI output clock - * | | |Note3 : Please check the used SPI flash specification to know the setting value of this register, and different SPI flash vendor may use different setting values. - * @var SPIM_T::CTL2 - * Offset: 0x48 Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16] |USETEN |User Set Value Enable Control - * | | |Only for direct memory mapping mode and DMA read mode with read commands 0x03,0x0B,0x3B,0xBB,0xEB,0xE7 - * | | |0 = Hardware circuit of SPI flash controller will use the following default values of DCNUM(SPIM_CTL2[28:24]) and CRMDAT(SPIM_DMMCTL[15:8]) to configure SPI flash operations automatically. - * | | |Dummy cycle number (DCNUM) : - * | | |Dummy cycle number for read command 0x03 : 0x0 - * | | |Dummy cycle number for read command 0x0B : 0x8 - * | | |Dummy cycle number for read command 0x3B : 0x8 - * | | |Dummy cycle number for read command 0xBB : 0x0 - * | | |Dummy cycle number for read command 0xEB : 0x4 - * | | |Dummy cycle number for read command 0xE7 : 0x2 - * | | |Mode bits data for continuous read mode (CRMDAT) : 0x20 - * | | |1 = If DCNUM(SPIM_CTL2[28:24]) and CRMDAT(SPIM_DMMCTL[15:8]) are not set as above default values, user must set USETEN to 0x1, DCNUM(SPIM_CTL2[28:24]) and CRMDAT(SPIM_DMMCTL[15:8]) to configure SPI flash operations manually. - * | | |For DTR/DDR command codes 0x0D, 0xBD, and 0xED, please set USETEN to 0x1. - * |[20] |DTRMPOFF |Mode Phase OFF for DTR/DDR Command Codes 0x0D, 0xBD, and 0xED - * | | |Only for direct memory mapping mode and DMA read mode (Note1) - * | | |0 = mode cycle number (or performance enhance cycle number) does not equal to 0x0 in DTR/DDR read command codes 0x0D, 0xBD, and 0xED. - * | | |1 = mode cycle number (or performance enhance cycle number) equals to 0x0 in DTR/DDR read command codes 0x0D, 0xBD, and 0xED. - * | | |Note1 : Please check the used SPI flash specification to know the mode cycle number (or performance enhance cycle number) for DTR/DDR command codes 0x0D, 0xBD, and 0xED. - * |[28:24] |DCNUM |Dummy Cycle Number - * | | |Only for direct memory mapping mode and DMA read mode (Note1) - * | | |Set number of dummy cycles - * | | |(1) For non-DTR/non-DDR command codes 0x03, 0x0B, 0x3B, 0xBB, 0xEB, and 0xE7 : - * | | |When read command code do not need any dummy cycles (i.e. - * | | |dummy cycle number = 0x0), user must set DCNUM to 0x0. - * | | |For command code 0xBB, if both mode cycle number (or performance enhance cycle number) and dummy cycle number do not equal to 0x0 simultaneously, user must set DCNUM to "mode cycle number + dummy cycle number" by used SPI flash specification. - * | | |For command code 0xBB, if there is only dummy cycle number (i.e. - * | | |dummy cycle number != 0x0 and mode cycle number = 0x0 (or performance enhance cycle number = 0x0)), user set DCNUM to dummy cycle number by used SPI flash specification. - * | | |For command codes 0x0B, 0x3B, 0xEB, and 0xE7, user only set DCNUM to dummy cycle number by used SPI flash specification. - * | | |(2) For DTR/DDR command codes 0x0D, 0xBD, and 0xED : - * | | |user sets DCNUM to dummy cycle number and DTRMPOFF(SPIM_CTL2[20]) by used SPI flash specification. - * | | |Note1 : Number of dummy cycles depends on the frequency of SPI output clock, SPI flash vendor, and read command types - * | | |Please check the used SPI flash specification to know the setting value of this number of dummy cycles. - */ - __IO uint32_t CTL0; /*!< [0x0000] Control and Status Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] Control Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t RXCLKDLY; /*!< [0x000c] RX Clock Delay Control Register */ - __I uint32_t RX[4]; /*!< [0x0010] ~ [0x001C] Data Receive Register 0~3 */ - __IO uint32_t TX[4]; /*!< [0x0020] ~ [0x002C] Data Transmit Register 0~3 */ - __IO uint32_t SRAMADDR; /*!< [0x0030] SRAM Memory Address Register */ - __IO uint32_t DMACNT; /*!< [0x0034] DMA Transfer Byte Count Register */ - __IO uint32_t FADDR; /*!< [0x0038] SPI Flash Address Register */ - __O uint32_t KEY1; /*!< [0x003c] Cipher Key1 Register */ - __O uint32_t KEY2; /*!< [0x0040] Cipher Key2 Register */ - __IO uint32_t DMMCTL; /*!< [0x0044] Direct Memory Mapping Mode Control Register */ - __IO uint32_t CTL2; /*!< [0x0048] Control Register 2 */ - -} SPIM_T; - -/** - @addtogroup SPIM_CONST SPIM Bit Field Definition - Constant Definitions for SPIM Controller -@{ */ - -#define SPIM_CTL0_CIPHOFF_Pos (0) /*!< SPIM_T::CTL0: CIPHOFF Position */ -#define SPIM_CTL0_CIPHOFF_Msk (0x1ul << SPIM_CTL0_CIPHOFF_Pos) /*!< SPIM_T::CTL0: CIPHOFF Mask */ - -#define SPIM_CTL0_BALEN_Pos (2) /*!< SPIM_T::CTL0: BALEN Position */ -#define SPIM_CTL0_BALEN_Msk (0x1ul << SPIM_CTL0_BALEN_Pos) /*!< SPIM_T::CTL0: BALEN Mask */ - -#define SPIM_CTL0_B4ADDREN_Pos (5) /*!< SPIM_T::CTL0: B4ADDREN Position */ -#define SPIM_CTL0_B4ADDREN_Msk (0x1ul << SPIM_CTL0_B4ADDREN_Pos) /*!< SPIM_T::CTL0: B4ADDREN Mask */ - -#define SPIM_CTL0_IEN_Pos (6) /*!< SPIM_T::CTL0: IEN Position */ -#define SPIM_CTL0_IEN_Msk (0x1ul << SPIM_CTL0_IEN_Pos) /*!< SPIM_T::CTL0: IEN Mask */ - -#define SPIM_CTL0_IF_Pos (7) /*!< SPIM_T::CTL0: IF Position */ -#define SPIM_CTL0_IF_Msk (0x1ul << SPIM_CTL0_IF_Pos) /*!< SPIM_T::CTL0: IF Mask */ - -#define SPIM_CTL0_DWIDTH_Pos (8) /*!< SPIM_T::CTL0: DWIDTH Position */ -#define SPIM_CTL0_DWIDTH_Msk (0x1ful << SPIM_CTL0_DWIDTH_Pos) /*!< SPIM_T::CTL0: DWIDTH Mask */ - -#define SPIM_CTL0_BURSTNUM_Pos (13) /*!< SPIM_T::CTL0: BURSTNUM Position */ -#define SPIM_CTL0_BURSTNUM_Msk (0x3ul << SPIM_CTL0_BURSTNUM_Pos) /*!< SPIM_T::CTL0: BURSTNUM Mask */ - -#define SPIM_CTL0_QDIODIR_Pos (15) /*!< SPIM_T::CTL0: QDIODIR Position */ -#define SPIM_CTL0_QDIODIR_Msk (0x1ul << SPIM_CTL0_QDIODIR_Pos) /*!< SPIM_T::CTL0: QDIODIR Mask */ - -#define SPIM_CTL0_SUSPITV_Pos (16) /*!< SPIM_T::CTL0: SUSPITV Position */ -#define SPIM_CTL0_SUSPITV_Msk (0xful << SPIM_CTL0_SUSPITV_Pos) /*!< SPIM_T::CTL0: SUSPITV Mask */ - -#define SPIM_CTL0_BITMODE_Pos (20) /*!< SPIM_T::CTL0: BITMODE Position */ -#define SPIM_CTL0_BITMODE_Msk (0x3ul << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_T::CTL0: BITMODE Mask */ - -#define SPIM_CTL0_OPMODE_Pos (22) /*!< SPIM_T::CTL0: OPMODE Position */ -#define SPIM_CTL0_OPMODE_Msk (0x3ul << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_T::CTL0: OPMODE Mask */ - -#define SPIM_CTL0_CMDCODE_Pos (24) /*!< SPIM_T::CTL0: CMDCODE Position */ -#define SPIM_CTL0_CMDCODE_Msk (0xfful << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_T::CTL0: CMDCODE Mask */ - -#define SPIM_CTL1_SPIMEN_Pos (0) /*!< SPIM_T::CTL1: SPIMEN Position */ -#define SPIM_CTL1_SPIMEN_Msk (0x1ul << SPIM_CTL1_SPIMEN_Pos) /*!< SPIM_T::CTL1: SPIMEN Mask */ - -#define SPIM_CTL1_CACHEOFF_Pos (1) /*!< SPIM_T::CTL1: CACHEOFF Position */ -#define SPIM_CTL1_CACHEOFF_Msk (0x1ul << SPIM_CTL1_CACHEOFF_Pos) /*!< SPIM_T::CTL1: CACHEOFF Mask */ - -#define SPIM_CTL1_CCMEN_Pos (2) /*!< SPIM_T::CTL1: CCMEN Position */ -#define SPIM_CTL1_CCMEN_Msk (0x1ul << SPIM_CTL1_CCMEN_Pos) /*!< SPIM_T::CTL1: CCMEN Mask */ - -#define SPIM_CTL1_CDINVAL_Pos (3) /*!< SPIM_T::CTL1: CDINVAL Position */ -#define SPIM_CTL1_CDINVAL_Msk (0x1ul << SPIM_CTL1_CDINVAL_Pos) /*!< SPIM_T::CTL1: CDINVAL Mask */ - -#define SPIM_CTL1_SS_Pos (4) /*!< SPIM_T::CTL1: SS Position */ -#define SPIM_CTL1_SS_Msk (0x1ul << SPIM_CTL1_SS_Pos) /*!< SPIM_T::CTL1: SS Mask */ - -#define SPIM_CTL1_SSACTPOL_Pos (5) /*!< SPIM_T::CTL1: SSACTPOL Position */ -#define SPIM_CTL1_SSACTPOL_Msk (0x1ul << SPIM_CTL1_SSACTPOL_Pos) /*!< SPIM_T::CTL1: SSACTPOL Mask */ - -#define SPIM_CTL1_IDLETIME_Pos (8) /*!< SPIM_T::CTL1: IDLETIME Position */ -#define SPIM_CTL1_IDLETIME_Msk (0xful << SPIM_CTL1_IDLETIME_Pos) /*!< SPIM_T::CTL1: IDLETIME Mask */ - -#define SPIM_CTL1_DIVIDER_Pos (16) /*!< SPIM_T::CTL1: DIVIDER Position */ -#define SPIM_CTL1_DIVIDER_Msk (0xfffful << SPIM_CTL1_DIVIDER_Pos) /*!< SPIM_T::CTL1: DIVIDER Mask */ - -#define SPIM_RXCLKDLY_DWDELSEL_Pos (0) /*!< SPIM_T::RXCLKDLY: DWDELSEL Position */ -#define SPIM_RXCLKDLY_DWDELSEL_Msk (0xfful << SPIM_RXCLKDLY_DWDELSEL_Pos) /*!< SPIM_T::RXCLKDLY: DWDELSEL Mask */ - -#define SPIM_RXCLKDLY_RDDLYSEL_Pos (16) /*!< SPIM_T::RXCLKDLY: RDDLYSEL Position */ -#define SPIM_RXCLKDLY_RDDLYSEL_Msk (0x7ul << SPIM_RXCLKDLY_RDDLYSEL_Pos) /*!< SPIM_T::RXCLKDLY: RDDLYSEL Mask */ - -#define SPIM_RXCLKDLY_RDEDGE_Pos (20) /*!< SPIM_T::RXCLKDLY: RDEDGE Position */ -#define SPIM_RXCLKDLY_RDEDGE_Msk (0x1ul << SPIM_RXCLKDLY_RDEDGE_Pos) /*!< SPIM_T::RXCLKDLY: RDEDGE Mask */ - -#define SPIM_RX_RXDAT_Pos (0) /*!< SPIM_T::RX[4]: RXDAT Position */ -#define SPIM_RX_RXDAT_Msk (0xfffffffful << SPIM_RX_RXDAT_Pos) /*!< SPIM_T::RX[4]: RXDAT Mask */ - -#define SPIM_TX_TXDAT_Pos (0) /*!< SPIM_T::TX[4]: TXDAT Position */ -#define SPIM_TX_TXDAT_Msk (0xfffffffful << SPIM_TX_TXDAT_Pos) /*!< SPIM_T::TX[4]: TXDAT Mask */ - -#define SPIM_SRAMADDR_ADDR_Pos (0) /*!< SPIM_T::SRAMADDR: ADDR Position */ -#define SPIM_SRAMADDR_ADDR_Msk (0xfffffffful << SPIM_SRAMADDR_ADDR_Pos) /*!< SPIM_T::SRAMADDR: ADDR Mask */ - -#define SPIM_DMACNT_DMACNT_Pos (0) /*!< SPIM_T::DMACNT: DMACNT Position */ -#define SPIM_DMACNT_DMACNT_Msk (0xfffffful << SPIM_DMACNT_DMACNT_Pos) /*!< SPIM_T::DMACNT: DMACNT Mask */ - -#define SPIM_FADDR_ADDR_Pos (0) /*!< SPIM_T::FADDR: ADDR Position */ -#define SPIM_FADDR_ADDR_Msk (0xfffffffful << SPIM_FADDR_ADDR_Pos) /*!< SPIM_T::FADDR: ADDR Mask */ - -#define SPIM_KEY1_KEY1_Pos (0) /*!< SPIM_T::KEY1: KEY1 Position */ -#define SPIM_KEY1_KEY1_Msk (0xfffffffful << SPIM_KEY1_KEY1_Pos) /*!< SPIM_T::KEY1: KEY1 Mask */ - -#define SPIM_KEY2_KEY2_Pos (0) /*!< SPIM_T::KEY2: KEY2 Position */ -#define SPIM_KEY2_KEY2_Msk (0xfffffffful << SPIM_KEY2_KEY2_Pos) /*!< SPIM_T::KEY2: KEY2 Mask */ - -#define SPIM_DMMCTL_CRMDAT_Pos (8) /*!< SPIM_T::DMMCTL: CRMDAT Position */ -#define SPIM_DMMCTL_CRMDAT_Msk (0xfful << SPIM_DMMCTL_CRMDAT_Pos) /*!< SPIM_T::DMMCTL: CRMDAT Mask */ - -#define SPIM_DMMCTL_DESELTIM_Pos (16) /*!< SPIM_T::DMMCTL: DESELTIM Position */ -#define SPIM_DMMCTL_DESELTIM_Msk (0x1ful << SPIM_DMMCTL_DESELTIM_Pos) /*!< SPIM_T::DMMCTL: DESELTIM Mask */ - -#define SPIM_DMMCTL_BWEN_Pos (24) /*!< SPIM_T::DMMCTL: BWEN Position */ -#define SPIM_DMMCTL_BWEN_Msk (0x1ul << SPIM_DMMCTL_BWEN_Pos) /*!< SPIM_T::DMMCTL: BWEN Mask */ - -#define SPIM_DMMCTL_CREN_Pos (25) /*!< SPIM_T::DMMCTL: CREN Position */ -#define SPIM_DMMCTL_CREN_Msk (0x1ul << SPIM_DMMCTL_CREN_Pos) /*!< SPIM_T::DMMCTL: CREN Mask */ - -#define SPIM_DMMCTL_UACTSCLK_Pos (26) /*!< SPIM_T::DMMCTL: UACTSCLK Position */ -#define SPIM_DMMCTL_UACTSCLK_Msk (0x1ul << SPIM_DMMCTL_UACTSCLK_Pos) /*!< SPIM_T::DMMCTL: UACTSCLK Mask */ - -#define SPIM_DMMCTL_ACTSCLKT_Pos (28) /*!< SPIM_T::DMMCTL: ACTSCLKT Position */ -#define SPIM_DMMCTL_ACTSCLKT_Msk (0xful << SPIM_DMMCTL_ACTSCLKT_Pos) /*!< SPIM_T::DMMCTL: ACTSCLKT Mask */ - -#define SPIM_CTL2_USETEN_Pos (16) /*!< SPIM_T::CTL2: USETEN Position */ -#define SPIM_CTL2_USETEN_Msk (0x1ul << SPIM_CTL2_USETEN_Pos) /*!< SPIM_T::CTL2: USETEN Mask */ - -#define SPIM_CTL2_DTRMPOFF_Pos (20) /*!< SPIM_T::CTL2: DTRMPOFF Position */ -#define SPIM_CTL2_DTRMPOFF_Msk (0x1ul << SPIM_CTL2_DTRMPOFF_Pos) /*!< SPIM_T::CTL2: DTRMPOFF Mask */ - -#define SPIM_CTL2_DCNUM_Pos (24) /*!< SPIM_T::CTL2: DCNUM Position */ -#define SPIM_CTL2_DCNUM_Msk (0x1ful << SPIM_CTL2_DCNUM_Pos) /*!< SPIM_T::CTL2: DCNUM Mask */ - -/**@}*/ /* SPIM_CONST */ -/**@}*/ /* end of SPIM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SPIM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/sys_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/sys_reg.h deleted file mode 100644 index f5d91171e62..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/sys_reg.h +++ /dev/null @@ -1,4826 +0,0 @@ -/**************************************************************************//** - * @file sys_reg.h - * @version V3.00 - * @brief SYS register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SYS_REG_H__ -#define __SYS_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - - -/*---------------------- System Manger Controller -------------------------*/ -/** - @addtogroup SYS System Manger Controller(SYS) - Memory Mapped Structure for SYS Controller -@{ */ - -typedef struct -{ - - - /** - * @var SYS_T::PDID - * Offset: 0x00 Part Device Identification Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PDID |Part Device Identification Number (Read Only) - * | | |This register reflects device part number code. - * | | |Software can read this register to identify which device is used. - * @var SYS_T::RSTSTS - * Offset: 0x04 System Reset Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PORF |POR Reset Flag - * | | |The POR reset flag is set by the "Reset Signal" from the Power-on Reset (POR) Controller or bit CHIPRST (SYS_IPRST0[0]) to indicate the previous reset source. - * | | |0 = No reset from POR or CHIPRST. - * | | |1 = Power-on Reset (POR) or CHIPRST had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |PINRF |nRESET Pin Reset Flag - * | | |The nRESET pin reset flag is set by the "Reset Signal" from the nRESET Pin to indicate the previous reset source. - * | | |0 = No reset from nRESET pin. - * | | |1 = Pin nRESET had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |WDTRF |WDT Reset Flag - * | | |The WDT reset flag is set by the "Reset Signal" from the Watchdog Timer or Window Watchdog Timer to indicate the previous reset source. - * | | |0 = No reset from watchdog timer or window watchdog timer. - * | | |1 = The watchdog timer or window watchdog timer had issued the reset signal to reset the system. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer register RSTF(WDT_CTL[2]) bit is set if the system has been reset by WDT time-out reset - * | | |Window Watchdog Timer register WWDTRF(WWDT_STATUS[1]) bit is set if the system has been reset by WWDT time-out reset. - * |[3] |LVRF |LVR Reset Flag - * | | |The LVR reset flag is set by the "Reset Signal" from the Low Voltage Reset Controller to indicate the previous reset source. - * | | |0 = No reset from LVR. - * | | |1 = LVR controller had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |BODRF |BOD Reset Flag - * | | |The BOD reset flag is set by the "Reset Signal" from the Brown-Out Detector to indicate the previous reset source. - * | | |0 = No reset from BOD. - * | | |1 = The BOD had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |MCURF |MCU Reset Flag - * | | |The system reset flag is set by the "Reset Signal" from the Cortex-M4 Core to indicate the previous reset source. - * | | |0 = No reset from Cortex-M4. - * | | |1 = The Cortex-M4 had issued the reset signal to reset the system by writing 1 to the bit SYSRESETREQ(AIRCR[2], Application Interrupt and Reset Control Register, address = 0xE000ED0C) in system control registers of Cortex-M4 core. - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |HRESETRF |HRESET Reset Flag - * | | |The HRESET reset flag is set by the "Reset Signal" from the HRESET. - * | | |0 = No reset from HRESET. - * | | |1 = Reset from HRESET. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: HRESET includes: POR, Reset Pin, LVR, BOD, WDT, WWDT, CPU lock up, CHIP and MCU reset. - * |[7] |CPURF |CPU Reset Flag - * | | |The CPU reset flag is set by hardware if software writes CPURST (SYS_IPRST0[1]) 1 to reset Cortex-M4 Core and Flash Memory Controller (FMC). - * | | |0 = No reset from CPU. - * | | |1 = The Cortex-M4 Core and FMC are reset by software setting CPURST to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |CPULKRF |CPU Lockup Reset Flag - * | | |0 = No reset from CPU lockup happened. - * | | |1 = The Cortex-M4 lockup happened and chip is reset. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: When CPU lockup happened under ICE is connected, this flag will set to 1 but chip will not reset. - * @var SYS_T::IPRST0 - * Offset: 0x08 Peripheral Reset Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHIPRST |Chip One-shot Reset (Write Protect) - * | | |Setting this bit will reset the whole chip, including Processor core and all peripherals, and this bit will automatically return to 0 after the 2 clock cycles. - * | | |The CHIPRST is same as the POR reset, all the chip controllers is reset and the chip setting from Flash are also reload. - * | | |0 = Chip normal operation. - * | | |1 = Chip one-shot reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |CPURST |Processor Core One-shot Reset (Write Protect) - * | | |Setting this bit will only reset the processor core and Flash Memory Controller(FMC), and this bit will automatically return to 0 after the 2 clock cycles. - * | | |0 = Processor core normal operation. - * | | |1 = Processor core one-shot reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PDMA0RST |PDMA0 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the PDMA0 controller. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = PDMA0 controller normal operation. - * | | |1 = PDMA0 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |EBIRST |EBI Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the EBI controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = EBI controller normal operation. - * | | |1 = EBI controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |EMAC0RST |EMAC0 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the EMAC0 controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = EMAC0 controller normal operation. - * | | |1 = EMAC0 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |SDH0RST |SDH0 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the SDH0 controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = SDH0 controller normal operation. - * | | |1 = SDH0 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |CRCRST |CRC Calculation Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the CRC calculation controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CRC calculation controller normal operation. - * | | |1 = CRC calculation controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |CCAPRST |CCAP Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the CCAP controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CCAP controller normal operation. - * | | |1 = CCAP controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10] |HSUSBDRST |HSUSBD Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the HSUSBD controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = HSUSBD controller normal operation. - * | | |1 = HSUSBD controller reset. - * |[11] |HBIRST |HBI Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the HBI controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = HBI controller normal operation. - * | | |1 = HBI controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |CRPTRST |CRYPTO Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CRYPTO controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CRYPTO controller normal operation. - * | | |1 = CRYPTO controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |KSRST |Key Store Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the Key Store controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = Key Store controller normal operation. - * | | |1 = Key Store controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[14] |SPIMRST |SPIM Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the SPIM controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = SPIM controller normal operation. - * | | |1 = SPIM controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |HSUSBHRST |HSUSBH Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the HSUSBH controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = HSUSBH controller normal operation. - * | | |1 = HSUSBH controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17] |SDH1RST |SDH1 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the SDH1 controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = SDH1 controller normal operation. - * | | |1 = SDH1 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[18] |PDMA1RST |PDMA1 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the PDMA1 controller. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = PDMA1 controller normal operation. - * | | |1 = PDMA1 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[20] |CANFD0RST |CANFD0 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CANFD0 controller. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = CANFD0 controller normal operation. - * | | |1 = CANFD0 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[21] |CANFD1RST |CANFD1 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CANFD1 controller. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = CANFD1 controller normal operation. - * | | |1 = CANFD1 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[22] |CANFD2RST |CANFD2 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CANFD2 controller. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = CANFD2 controller normal operation. - * | | |1 = CANFD2 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |CANFD3RST |CANFD3 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CANFD3 controller. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = CANFD3 controller normal operation. - * | | |1 = CANFD3 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[28] |BMCRST |BMC Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the BMC controller. - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = BCM controller normal operation. - * | | |1 = BMC controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::IPRST1 - * Offset: 0x0C Peripheral Reset Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |GPIORST |GPIO Controller Reset - * | | |0 = GPIO controller normal operation. - * | | |1 = GPIO controller reset. - * |[2] |TMR0RST |Timer0 Controller Reset - * | | |0 = Timer0 controller normal operation. - * | | |1 = Timer0 controller reset. - * |[3] |TMR1RST |Timer1 Controller Reset - * | | |0 = Timer1 controller normal operation. - * | | |1 = Timer1 controller reset. - * |[4] |TMR2RST |Timer2 Controller Reset - * | | |0 = Timer2 controller normal operation. - * | | |1 = Timer2 controller reset. - * |[5] |TMR3RST |Timer3 Controller Reset - * | | |0 = Timer3 controller normal operation. - * | | |1 = Timer3 controller reset. - * |[7] |ACMP01RST |Analog Comparator 0/1 Controller Reset - * | | |0 = Analog Comparator 0/1 controller normal operation. - * | | |1 = Analog Comparator 0/1 controller reset. - * |[8] |I2C0RST |I2C0 Controller Reset - * | | |0 = I2C0 controller normal operation. - * | | |1 = I2C0 controller reset. - * |[9] |I2C1RST |I2C1 Controller Reset - * | | |0 = I2C1 controller normal operation. - * | | |1 = I2C1 controller reset. - * |[10] |I2C2RST |I2C2 Controller Reset - * | | |0 = I2C2 controller normal operation. - * | | |1 = I2C2 controller reset. - * |[11] |I2C3RST |I2C3 Controller Reset - * | | |0 = I2C3 controller normal operation. - * | | |1 = I2C3 controller reset. - * |[12] |QSPI0RST |QSPI0 Controller Reset - * | | |0 = QSPI0 controller normal operation. - * | | |1 = QSPI0 controller reset. - * |[13] |SPI0RST |SPI0 Controller Reset - * | | |0 = SPI0 controller normal operation. - * | | |1 = SPI0 controller reset. - * |[14] |SPI1RST |SPI1 Controller Reset - * | | |0 = SPI1 controller normal operation. - * | | |1 = SPI1 controller reset. - * |[15] |SPI2RST |SPI2 Controller Reset - * | | |0 = SPI2 controller normal operation. - * | | |1 = SPI2 controller reset. - * |[16] |UART0RST |UART0 Controller Reset - * | | |0 = UART0 controller normal operation. - * | | |1 = UART0 controller reset. - * |[17] |UART1RST |UART1 Controller Reset - * | | |0 = UART1 controller normal operation. - * | | |1 = UART1 controller reset. - * |[18] |UART2RST |UART2 Controller Reset - * | | |0 = UART2 controller normal operation. - * | | |1 = UART2 controller reset. - * |[19] |UART3RST |UART3 Controller Reset - * | | |0 = UART3 controller normal operation. - * | | |1 = UART3 controller reset. - * |[20] |UART4RST |UART4 Controller Reset - * | | |0 = UART4 controller normal operation. - * | | |1 = UART4 controller reset. - * |[21] |UART5RST |UART5 Controller Reset - * | | |0 = UART5 controller normal operation. - * | | |1 = UART5 controller reset. - * |[22] |UART6RST |UART6 Controller Reset - * | | |0 = UART6 controller normal operation. - * | | |1 = UART6 controller reset. - * |[23] |UART7RST |UART7 Controller Reset - * | | |0 = UART7 controller normal operation. - * | | |1 = UART7 controller reset. - * |[26] |OTGRST |OTG Controller Reset - * | | |0 = OTG controller normal operation. - * | | |1 = OTG controller reset. - * |[27] |USBDRST |USBD Controller Reset - * | | |0 = USBD controller normal operation. - * | | |1 = USBD controller reset. - * |[28] |EADC0RST |EADC0 Controller Reset - * | | |0 = EADC0 controller normal operation. - * | | |1 = EADC0 controller reset. - * |[29] |I2S0RST |I2S0 Controller Reset - * | | |0 = I2S0 controller normal operation. - * | | |1 = I2S0 controller reset. - * |[30] |HSOTGRST |HSOTG Controller Reset - * | | |0 = HSOTG controller normal operation. - * | | |1 = HSOTG controller reset. - * |[31] |TRNGRST |TRNG Controller Reset - * | | |0 = TRNG controller normal operation. - * | | |1 = TRNG controller reset. - * @var SYS_T::IPRST2 - * Offset: 0x10 Peripheral Reset Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SC0RST |SC0 Controller Reset - * | | |0 = SC0 controller normal operation. - * | | |1 = SC0 controller reset. - * |[1] |SC1RST |SC1 Controller Reset - * | | |0 = SC1 controller normal operation. - * | | |1 = SC1 controller reset. - * |[2] |SC2RST |SC2 Controller Reset - * | | |0 = SC2 controller normal operation. - * | | |1 = SC2 controller reset. - * |[3] |I2C4RST |I2C4 Controller Reset - * | | |0 = I2C4 controller normal operation. - * | | |1 = I2C4 controller reset. - * |[4] |QSPI1RST |QSPI1 Controller Reset - * | | |0 = QSPI1 controller normal operation. - * | | |1 = QSPI1 controller reset. - * |[6] |SPI3RST |SPI3 Controller Reset - * | | |0 = SPI3 controller normal operation. - * | | |1 = SPI3 controller reset. - * |[7] |SPI4RST |SPI4 Controller Reset - * | | |0 = SPI4 controller normal operation. - * | | |1 = SPI4 controller reset. - * |[8] |USCI0RST |USCI0 Controller Reset - * | | |0 = USCI0 controller normal operation. - * | | |1 = USCI0 controller reset. - * |[10] |PSIORST |PSIO Controller Reset - * | | |0 = PSIO controller normal operation. - * | | |1 = PSIO controller reset. - * |[12] |DACRST |DAC Controller Reset - * | | |0 = DAC controller normal operation. - * | | |1 = DAC controller reset. - * |[13] |ECAP2RST |ECAP2 Controller Reset - * | | |0 = ECAP2 controller normal operation. - * | | |1 = ECAP2 controller reset. - * |[14] |ECAP3RST |ECAP3 Controller Reset - * | | |0 = ECAP3 controller normal operation. - * | | |1 = ECAP3 controller reset. - * |[16] |EPWM0RST |EPWM0 Controller Reset - * | | |0 = EPWM0 controller normal operation. - * | | |1 = EPWM0 controller reset. - * |[17] |EPWM1RST |EPWM1 Controller Reset - * | | |0 = EPWM1 controller normal operation. - * | | |1 = EPWM1 controller reset. - * |[18] |BPWM0RST |BPWM0 Controller Reset - * | | |0 = BPWM0 controller normal operation. - * | | |1 = BPWM0 controller reset. - * |[19] |BPWM1RST |BPWM1 Controller Reset - * | | |0 = BPWM1 controller normal operation. - * | | |1 = BPWM1 controller reset. - * |[20] |EQEI2RST |EQEI2 Controller Reset - * | | |0 = EQEI2 controller normal operation. - * | | |1 = EQEI2 controller reset. - * |[21] |EQEI3RST |EQEI3 Controller Reset - * | | |0 = EQEI3 controller normal operation. - * | | |1 = EQEI3 controller reset. - * |[22] |EQEI0RST |EQEI0 Controller Reset - * | | |0 = EQEI0 controller normal operation. - * | | |1 = EQEI0 controller reset. - * |[23] |EQEI1RST |EQEI1 Controller Reset - * | | |0 = EQEI1 controller normal operation. - * | | |1 = EQEI1 controller reset. - * |[26] |ECAP0RST |ECAP0 Controller Reset - * | | |0 = ECAP0 controller normal operation. - * | | |1 = ECAP0 controller reset. - * |[27] |ECAP1RST |ECAP1 Controller Reset - * | | |0 = ECAP1 controller normal operation. - * | | |1 = ECAP1 controller reset. - * |[29] |I2S1RST |I2S1 Controller Reset - * | | |0 = I2S1 controller normal operation. - * | | |1 = I2S1 controller reset. - * |[31] |EADC1RST |EADC1 Controller Reset - * | | |0 = EADC1 controller normal operation. - * | | |1 = EADC1 controller reset. - * @var SYS_T::BODCTL - * Offset: 0x18 Brown-out Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODEN |Brown-out Detector Enable Bit (Write Protect) - * | | |The default value is set by Flash controller user configuration register CBODEN (CONFIG0 [19]). - * | | |0 = Brown-out Detector function Disabled. - * | | |1 = Brown-out Detector function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |BODRSTEN |Brown-out Reset Enable Bit (Write Protect) - * | | |The default value is set by Flash controller user configuration register CBORST(CONFIG0[20]) bit. - * | | |0 = Brown-out "INTERRUPT" function Enabled. - * | | |1 = Brown-out "RESET" function Enabled. - * | | |Note 1: While the Brown-out Detector function is enabled (BODEN high) and BOD reset function is enabled (BODRSTEN high), BOD will assert a signal to reset chip when the detected voltage is lower than the threshold (BODOUT high). - * | | |While the BOD function is enabled (BODEN high) and BOD interrupt function is enabled (BODRSTEN low), BOD will assert an interrupt if BODOUT is high - * | | |BOD interrupt will keep till to the BODEN set to 0. - * | | |BOD interrupt can be blocked by disabling the NVIC BOD interrupt or disabling BOD function (set BODEN low). - * | | |Note 2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |BODIF |Brown-out Detector Interrupt Flag - * | | |0 = Brown-out Detector does not detect any voltage draft at VDD down through or up through the voltage of BODVL setting. - * | | |1 = When Brown-out Detector detects the VDD is dropped down through the voltage of BODVL setting or the VDD is raised up through the voltage of BODVL setting, this bit is set to 1 and the brown-out interrupt is requested if brown-out interrupt is enabled. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |BODLPM |Brown-out Detector Low Power Mode (Write Protect) - * | | |0 = BOD operate in normal mode (default). - * | | |1 = BOD Low Power mode Enabled. - * | | |Note 1: The BOD consumes about 100uA in normal mode, the low power mode can reduce the current to about 1/10 but slow the BOD response. - * | | |Note 2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |BODOUT |Brown-out Detector Output Status - * | | |0 = Brown-out Detector output status is 0. - * | | |It means the detected voltage is higher than BODVL setting or BODEN is 0. - * | | |1 = Brown-out Detector output status is 1. - * | | |It means the detected voltage is lower than BODVL setting - * | | |If the BODEN is 0, BOD function disabled, this bit always responds 0. - * |[7] |LVREN |Low Voltage Reset Enable Bit (Write Protect) - * | | |The LVR function resets the chip when the input power voltage is lower than LVR circuit setting - * | | |LVR function is enabled by default. - * | | |0 = Low Voltage Reset function Disabled. - * | | |1 = Low Voltage Reset function Enabled. - * | | |Note 1: After enabling the bit, the LVR function will be active with 100us delay for LVR output stable (default). - * | | |Note 2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10:8] |BODDGSEL |Brown-out Detector Output De-glitch Time Select (Write Protect) - * | | |000 = BOD output is sampled by LIRC clock. - * | | |001 = 4 system clock (HCLK). - * | | |010 = 8 system clock (HCLK). - * | | |011 = 16 system clock (HCLK). - * | | |100 = 32 system clock (HCLK). - * | | |101 = 64 system clock (HCLK). - * | | |110 = 128 system clock (HCLK). - * | | |111 = 256 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[14:12] |LVRDGSEL |LVR Output De-glitch Time Select (Write Protect) - * | | |000 = Without de-glitch function. - * | | |001 = 4 system clock (HCLK). - * | | |010 = 8 system clock (HCLK). - * | | |011 = 16 system clock (HCLK). - * | | |100 = 32 system clock (HCLK). - * | | |101 = 64 system clock (HCLK). - * | | |110 = 128 system clock (HCLK). - * | | |111 = 256 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[15] |LVRRDY |Low Voltage Reset Ready Flag (Read Only) - * | | |When the LVR function first enable, need more HCLK to wait LVR ready. - * | | |0 = Low Voltage Reset function not ready. - * | | |1 = Low Voltage Reset function ready. - * |[18:16] |BODVL |Brown-out Detector Threshold Voltage Selection (Write Protect) - * | | |The default value is set by Flash controller user configuration register CBOV (CONFIG0 [23:21]). - * | | |000 = Brown-Out Detector threshold voltage is 1.6V. - * | | |001 = Brown-Out Detector threshold voltage is 1.8V. - * | | |010 = Brown-Out Detector threshold voltage is 2.0V. - * | | |011 = Brown-Out Detector threshold voltage is 2.2V. - * | | |100 = Brown-Out Detector threshold voltage is 2.4V. - * | | |101 = Brown-Out Detector threshold voltage is 2.6V. - * | | |110 = Brown-Out Detector threshold voltage is 2.8V. - * | | |111 = Brown-Out Detector threshold voltage is 3.0V. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::IVSCTL - * Offset: 0x1C Internal Voltage Source Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VTEMPEN |Temperature Sensor Enable Bit - * | | |This bit is used to enable/disable temperature sensor function. - * | | |0 = Temperature sensor function Disabled (default). - * | | |1 = Temperature sensor function Enabled. - * |[1] |VBATUGEN |VBAT Unity Gain Buffer Enable Bit - * | | |This bit is used to enable/disable VBAT unity gain buffer function. - * | | |0 = VBAT unity gain buffer function Disabled (default). - * | | |1 = VBAT unity gain buffer function Enabled. - * | | |Note: After this bit is set to 1, the value of VBAT unity gain buffer output voltage can be obtained from ADC conversion result - * @var SYS_T::IPRST3 - * Offset: 0x20 Peripheral Reset Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KPIRST |KPI Controller Reset - * | | |0 = KPI controller normal operation. - * | | |1 = KPI controller reset. - * |[6] |EADC2RST |EADC2 Controller Reset - * | | |0 = EADC2 controller normal operation. - * | | |1 = EADC2 controller reset. - * |[7] |ACMP23RST |Analog Comparator 2/3 Controller Reset - * | | |0 = Analog Comparator 2/3 controller normal operation. - * | | |1 = Analog Comparator 2/3 controller reset. - * |[8] |SPI5RST |SPI5 Controller Reset - * | | |0 = SPI5 controller normal operation. - * | | |1 = SPI5 controller reset. - * |[9] |SPI6RST |SPI6 Controller Reset - * | | |0 = SPI6 controller normal operation. - * | | |1 = SPI6 controller reset. - * |[10] |SPI7RST |SPI7 Controller Reset - * | | |0 = SPI7 controller normal operation. - * | | |1 = SPI7 controller reset. - * |[11] |SPI8RST |SPI8 Controller Reset - * | | |0 = SPI8 controller normal operation. - * | | |1 = SPI8 controller reset. - * |[12] |SPI9RST |SPI9 Controller Reset - * | | |0 = SPI9 controller normal operation. - * | | |1 = SPI9 controller reset. - * |[13] |SPI10RST |SPI10 Controller Reset - * | | |0 = SPI10 controller normal operation. - * | | |1 = SPI10 controller reset. - * |[16] |UART8RST |UART8 Controller Reset - * | | |0 = UART8 controller normal operation. - * | | |1 = UART8 controller reset. - * |[17] |UART9RST |UART9 Controller Reset - * | | |0 = UART9 controller normal operation. - * | | |1 = UART9 controller reset. - * @var SYS_T::PORCTL - * Offset: 0x24 Power-On-reset Controller Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |POROFF |Power-on Reset Enable Bit (Write Protect) - * | | |When powered on, the POR circuit generates a reset signal to reset the whole chip function, but noise on the power may cause the POR active again. - * | | |User can disable internal POR circuit to avoid unpredictable noise to cause chip reset by writing 0x5AA5 to this field. - * | | |The POR function will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::VREFCTL - * Offset: 0x28 VREF Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |VREFCTL |VREF Control Bits (Write Protect) - * | | |00000 = VREF is from external pin. - * | | |00011 = VREF is internal 1.6V. - * | | |00111 = VREF is internal 2.0V. - * | | |01011 = VREF is internal 2.5V. - * | | |01111 = VREF is internal 3.0V. - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[7:6] |PRELOADSEL|Pre-load Timing Selection (Write Protect) - * | | |00 = pre-load time is 60us for 0.1uF Capacitor. - * | | |01 = pre-load time is 310us for 1uF Capacitor. - * | | |10 = pre-load time is 1270us for 4.7uF Capacitor. - * | | |11 = pre-load time is 2650us for 10uF Capacitor. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[24] |VBGFEN |Chip Internal Voltage Bandgap Force Enable Bit (Write Protect) - * | | |0 = Chip internal voltage bandgap controlled by ADC/ACMP if source selected. - * | | |1 = Chip internal voltage bandgap force enable. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[26:25] |VBGISEL |Chip Internal Voltage Bandgap Current Selection Bits (Write Protect) - * | | |00 = Bandgap voltage buffer current is 4.2uA. - * | | |01 = Bandgap voltage buffer current is 7.3uA. - * | | |10 = Bandgap voltage buffer current is 10.4uA. - * | | |11 = Bandgap voltage buffer current is 13.5uA. - * | | |Note 1: When ADC conversion source select bandgap voltage, suggest set VBGISEL as 10. - * | | |Note 2: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::USBPHY - * Offset: 0x2C USB PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |USBROLE |USB Role Option (Write Protect) - * | | |These two bits are used to select the role of USB. - * | | |00 = Standard USB Device mode. - * | | |01 = Standard USB Host mode. - * | | |10 = ID dependent mode. - * | | |11 = On-The-Go device mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[2] |SBO |Note: This bit must always be kept 1. If set to 0, the result is unpredictable. - * |[8] |USBEN |USB PHY Enable - * | | |This bit is used to enable/disable USB PHY. - * | | |0 = USB PHY Disabled. - * | | |1 = USB PHY Enabled. - * |[17:16] |HSUSBROLE |HSUSB Role Option (Write Protect) - * | | |These two bits are used to select the role of HSUSB. - * | | |00 = Standard HSUSB Device mode. - * | | |01 = Standard HSUSB Host mode. - * | | |10 = ID dependent mode. - * | | |11 = On-The-Go device mode. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[24] |HSUSBEN |HSUSB PHY Enable - * | | |This bit is used to enable/disable HSUSB PHY. - * | | |0 = HSUSB PHY Disabled. - * | | |1 = HSUSB PHY Enabled. - * |[25] |HSUSBACT |HSUSB PHY Active Control - * | | |This bit is used to control HSUSB PHY at reset state or active state. - * | | |0 = HSUSB PHY at reset state. - * | | |1 = HSUSB PHY at active state. - * | | |Note: After setting HSUSBEN (SYS_USBPHY[24]) to enable HSUSB PHY, user should keep HSUSB PHY at reset mode at lease 10us before changing to active mode. - * @var SYS_T::GPA_MFOS - * Offset: 0x80-0xA4 GPIOA-GPIOJ Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |MFOSn |GPIOA-J Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin. - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G/H. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F. - * | | |n=6~15 for port I. - * | | |Max. n=13 for port J. - * @var SYS_T::SRAM_INTCTL - * Offset: 0xC0 System SRAM Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PERRIEN |SRAM Parity Check Error Interrupt Enable Bit - * | | |0 = SRAM parity check error interrupt Disabled. - * | | |1 = SRAM parity check error interrupt Enabled. - * @var SYS_T::SRAM_STATUS - * Offset: 0xC4 System SRAM Parity Error Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PERRIF |SRAM Parity Check Error Flag - * | | |This bit indicates the System SRAM parity error occurred. Write 1 to clear this to 0. - * | | |0 = No System SRAM parity error. - * | | |1 = System SRAM parity error occur. - * @var SYS_T::SRAM_ERRADDR - * Offset: 0xC8 System SRAM Parity Check Error Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ERRADDR |System SRAM Parity Error Address (Read Only) - * | | |This register shows system SRAM parity error byte address. - * @var SYS_T::SRAM_BISTCTL - * Offset: 0xD0 System SRAM BIST Test Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SRBIST0 |System SRAM Bank0 BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for system SRAM bank0. - * | | |0 = System SRAM bank0 BIST Disabled. - * | | |1 = System SRAM bank0 BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |SRBIST1 |System SRAM Bank1 BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for system SRAM bank1. - * | | |0 = System SRAM bank1 BIST Disabled. - * | | |1 = System SRAM bank1 BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |CRBIST |CACHE SRAM BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for CACHE SRAM. - * | | |0 = CACHE SRAM BIST Disabled. - * | | |1 = CACHE SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |CANBIST |CAN SRAM BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for CAN SRAM. - * | | |0 = CAN SRAM BIST Disabled. - * | | |1 = CAN SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |USBBIST |USB BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for USB SRAM. - * | | |0 = USB SRAM BIST Disabled. - * | | |1 = USB SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |SPIMBIST |SPIM BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for SPIM SRAM. - * | | |0 = SPIM SRAM BIST Disabled. - * | | |1 = SPIM SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |EMAC0BIST |EMAC0 BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for EMAC0 SRAM. - * | | |0 = EMAC0 SRAM BIST Disabled. - * | | |1 = EMAC0 SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |HSUSBDBIST|HSUSBD BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for HSUSBD SRAM. - * | | |0 = HSUSBD SRAM BIST Disabled. - * | | |1 = HSUSBD SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[9] |HSUSBHBIST|HSUSBH BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for HSUSBH SRAM. - * | | |0 = HSUSBH SRAM BIST Disabled. - * | | |1 = HSUSBH SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10] |SRBIST2 |System SRAM Bank2 BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for system SRAM bank2. - * | | |0 = System SRAM bank2 BIST Disabled. - * | | |1 = System SRAM bank2 BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11] |KSBIST |Key Store SRAM BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for Key Store SRAM. - * | | |0 = Key Store SRAM BIST Disabled. - * | | |1 = Key Store SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |CCAPBIST |CCAP SRAM BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for CCAP SRAM. - * | | |0 = CCAP SRAM BIST Disabled. - * | | |1 = CCAP SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |RSABIST |RSA SRAM BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for RSA SRAM. - * | | |0 = RSA SRAM BIST Disabled. - * | | |1 = RSA SRAM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::SRAM_BISTSTS - * Offset: 0xD4 System SRAM BIST Test Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SRBISTEF0 |System SRAM Bank0 BIST Fail Flag (Read Only) - * | | |0 = System SRAM bank0 BIST test pass. - * | | |1 = System SRAM bank0 BIST test fail. - * |[1] |SRBISTEF1 |System System Bank1 SRAM BIST Fail Flag (Read Only) - * | | |0 = System SRAM bank1 BIST test pass. - * | | |1 = System SRAM bank1 BIST test fail. - * |[2] |CRBISTEF |CACHE SRAM BIST Fail Flag (Read Only) - * | | |0 = CACHE SRAM BIST test pass. - * | | |1 = CACHE SRAM BIST test fail. - * |[3] |CANBEF |CAN SRAM BIST Fail Flag (Read Only) - * | | |0 = CAN SRAM BIST test pass. - * | | |1 = CAN SRAM BIST test fail. - * | | |Note: Any of the CAN SRAM macros BIST fail, this flag is 1. - * |[4] |USBBEF |USB SRAM BIST Fail Flag (Read Only) - * | | |0 = USB SRAM BIST test pass. - * | | |1 = USB SRAM BIST test fail. - * |[5] |SPIMBEF |SPIM SRAM BIST Fail Flag (Read Only) - * | | |0 = SPIM SRAM BIST test pass. - * | | |1 = SPIM SRAM BIST test fail. - * |[6] |EMAC0BEF |EMAC0 SRAM BIST Fail Flag (Read Only) - * | | |0 = EMAC0 SRAM BIST test pass. - * | | |1 = EMAC0 SRAM BIST test fail. - * |[8] |HSUSBDBEF |HSUSBD SRAM BIST Fail Flag (Read Only) - * | | |0 = HSUSBD SRAM BIST test pass. - * | | |1 = HSUSBD SRAM BIST test fail. - * |[9] |HSUSBHBEF |HSUSBH BIST Fail Flag (Read Only) - * | | |0 = HSUSBH SRAM BIST test pass. - * | | |1 = HSUSBH SRAM BIST test fail. - * |[10] |SRBISTEF2 |System SRAM Bank2 BIST Fail Flag (Read Only) - * | | |0 = System SRAM bank2 BIST test pass. - * | | |1 = System SRAM bank2 BIST test fail. - * |[11] |KSBISTEF |Key Store SRAM BIST Fail Flag (Read Only) - * | | |0 = Key Store SRAM BIST test pass. - * | | |1 = Key Store SRAM BIST test fail. - * |[12] |CCAPBISTEF|CCAP BIST Fail Flag (Read Only) - * | | |0 = CCAP BIST test pass. - * | | |1 = CCAP BIST test fail. - * |[13] |RSABISTE |RSA SRAM BIST Fail Flag (Read Only) - * | | |0 = RSA SRAM BIST test pass. - * | | |1 = RSA SRAM BIST test fail. - * |[16] |SRBEND0 |System SRAM Bank0 BIST Test Finish (Read Only) - * | | |0 = System SRAM bank0 BIST active. - * | | |1 = System SRAM bank0 BIST finish. - * |[17] |SRBEND1 |System SRAM Bank1 BIST Test Finish (Read Only) - * | | |0 = System SRAM bank1 BIST is active. - * | | |1 = System SRAM bank1 BIST finish. - * |[18] |CRBEND |CACHE SRAM BIST Test Finish (Read Only) - * | | |0 = CACHE SRAM BIST is active. - * | | |1 = CACHE SRAM BIST test finish. - * |[19] |CANBEND |CAN SRAM BIST Test Finish (Read Only) - * | | |0 = CAN SRAM BIST is active. - * | | |1 = CAN SRAM BIST test finish. - * | | |Note: All of the CAN SRAM macros BIST finish, this flag is 1. - * |[20] |USBBEND |USB SRAM BIST Test Finish - * | | |0 = USB SRAM BIST is active. (Read Only) - * | | |1 = USB SRAM BIST test finish. - * |[21] |SPIMBEND |SPIM SRAM BIST Test Finish (Read Only) - * | | |0 = SPIM SRAM BIST is active. - * | | |1 = SPIM SRAM BIST test finish. - * |[22] |EMAC0BEND |EMAC0 SRAM BIST Test Finish (Read Only) - * | | |0 = EMAC0 SRAM BIST is active. - * | | |1 = EMAC0 SRAM BIST test finish. - * |[24] |HSUSBDBEND|HSUSBD BIST Test Finish (Read Only) - * | | |0 = HSUSBD SRAM BIST is active. - * | | |1 = HSUSBD SRAM BIST test finish. - * |[25] |HSUSBHBEND|HSUSBH BIST Test Finish (Read Only) - * | | |0 = HSUSBH SRAM BIST is active. - * | | |1 = HSUSBH SRAM BIST test finish. - * |[26] |SRBEND2 |System SRAM Bank2 BIST Test Finish (Read Only) - * | | |0 = System SRAM bank2 BIST is active. - * | | |1 = System SRAM bank2 BIST finish. - * |[27] |KSBEND |Key Store SRAM BIST Test Finish (Read Only) - * | | |0 = Key Store SRAM BIST is active. - * | | |1 = Key Store SRAM BIST test finish. - * |[28] |CCAPBEND |CCAP SRAM BIST Test Finish (Read Only) - * | | |0 = CCAP SRAM BIST is active. - * | | |1 = CCAP SRAM BIST test finish. - * |[29] |RSABEND |RSA SRAM BIST Test Finish (Read Only) - * | | |0 = RSA SRAM BIST is active. - * | | |1 = RSA SRAM BIST test finish. - * @var SYS_T::HIRCTCTL - * Offset: 0xE4 HIRC48M Trim Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FREQSEL |Trim Frequency Selection - * | | |This field indicates the target frequency of 48 MHz internal high speed RC oscillator (HIRC48M) auto trim. - * | | |During auto trim operation, if clock error detected with CESTOPEN is set to 1 or trim retry limitation count reached, this field will be cleared to 00 automatically. - * | | |00 = Disable HIRC auto trim function. - * | | |01 = Enable HIRC auto trim function and trim HIRC to 48 MHz. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[5:4] |LOOPSEL |Trim Calculation Loop Selection - * | | |This field defines that trim value calculation is based on how many reference clocks. - * | | |00 = Trim value calculation is based on average difference in 4 clocks of reference clock. - * | | |01 = Trim value calculation is based on average difference in 8 clocks of reference clock. - * | | |10 = Trim value calculation is based on average difference in 16 clocks of reference clock. - * | | |11 = Trim value calculation is based on average difference in 32 clocks of reference clock. - * | | |Note: For example, if LOOPSEL is set as 00, auto trim circuit will calculate trim value based on the average frequency difference in 4 clocks of reference clock. - * |[7:6] |RETRYCNT |Trim Value Update Limitation Count - * | | |This field defines that how many times the auto trim circuit will try to update the HIRC trim value before the frequency of HIRC locked. - * | | |Once the HIRC locked, the internal trim value update counter will be reset. - * | | |If the trim value update counter reached this limitation value and frequency of HIRC still does not lock, the auto trim operation will be disabled and FREQSEL will be cleared to 00. - * | | |00 = Trim retry count limitation is 64 loops. - * | | |01 = Trim retry count limitation is 128 loops. - * | | |10 = Trim retry count limitation is 256 loops. - * | | |11 = Trim retry count limitation is 512 loops. - * |[8] |CESTOPEN |Clock Error Stop Enable Bit - * | | |0 = The trim operation is keep going if clock is inaccuracy. - * | | |1 = The trim operation is stopped if clock is inaccuracy. - * |[9] |BOUNDEN |Boundary Enable Bit - * | | |0 = Boundary function Disabled. - * | | |1 = Boundary function Enabled. - * |[10] |REFCKSEL |Reference Clock Selection - * | | |0 = HIRC trim reference clock is from LXT (32.768 kHz). - * | | |1 = HIRC trim reference clock is from internal USB synchronous mode. - * | | |Note: HIRC trim reference clock is 20 kHz in test mode. - * |[20:16] |BOUNDARY |Boundary Selection - * | | |Fill the boundary range from 0x1 to 0x31, 0x0 is reserved. - * | | |Note: This field is effective only when the BOUNDEN(SYS_HIRCTCTL[9]) is enabled. - * @var SYS_T::HIRCTIEN - * Offset: 0xE8 HIRC48M Trim Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TFAILIEN |Trim Failure Interrupt Enable Bit - * | | |This bit controls if an interrupt will be triggered while HIRC trim value update limitation count reached and HIRC frequency still not locked on target frequency set by FREQSEL(SYS_HIRCTCTL[1:0]). - * | | |If this bit is high and TFAILIF(SYS_HIRCTISTS[1]) is set during auto trim operation, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |0 = Disable TFAILIF(SYS_HIRCTISTS[1]) status to trigger an interrupt to CPU. - * | | |1 = Enable TFAILIF(SYS_HIRCTISTS[1]) status to trigger an interrupt to CPU. - * |[2] |CLKEIEN |Clock Error Interrupt Enable Bit - * | | |This bit controls if CPU would get an interrupt while clock is inaccuracy during auto trim operation. - * | | |If this bit is set to1, and CLKERRIF(SYS_HIRCTISTS[2]) is set during auto trim operation, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |0 = Disable CLKERRIF(SYS_HIRCTISTS[2]) status to trigger an interrupt to CPU. - * | | |1 = Enable CLKERRIF(SYS_HIRCTISTS[2]) status to trigger an interrupt to CPU. - * @var SYS_T::HIRCTISTS - * Offset: 0xEC HIRC48M Trim Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FREQLOCK |HIRC Frequency Lock Status - * | | |This bit indicates the HIRC frequency is locked. - * | | |This is a status bit and does not trigger any interrupt. - * | | |Write 1 to clear this to 0. - * | | |This bit will be set automatically, if the frequency is lock and the RC_TRIM is enabled. - * | | |0 = The internal high-speed oscillator frequency does not lock at 48 MHz yet. - * | | |1 = The internal high-speed oscillator frequency locked at 48 MHz. - * |[1] |TFAILIF |Trim Failure Interrupt Status - * | | |This bit indicates that HIRC trim value update limitation count reached and the HIRC clock frequency still does not be locked. - * | | |Once this bit is set, the auto trim operation stopped and FREQSEL(SYS_HIRCTCTL[1:0]) will be cleared to 00 by hardware automatically. - * | | |If this bit is set and TFAILIEN(SYS_HIRCTIEN[1]) is high, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |Write 1 to clear this to 0. - * | | |0 = Trim value update limitation count does not reach. - * | | |1 = Trim value update limitation count reached and HIRC frequency still not locked. - * |[2] |CLKERRIF |Clock Error Interrupt Status - * | | |When the frequency of 32.768 kHz external low speed crystal oscillator (LXT) or 48 MHz internal high speed RC oscillator (HIRC48M) is shift larger to unreasonable value, this bit will be set and to be an indicate that clock frequency is inaccuracy. - * | | |Once this bit is set to 1, the auto trim operation stopped and FREQSEL(SYS_HIRCTCTL[1:0]) will be cleared to 00 by hardware automatically if CESTOPEN(SYS_HIRCTCTL[8]) is set to 1. - * | | |If this bit is set and CLKEIEN(SYS_HIRCTIEN[2]) is high, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |Write 1 to clear this to 0. - * | | |0 = Clock frequency is accuracy. - * | | |1 = Clock frequency is inaccuracy. - * |[3] |OVBDIF |Over Boundary Status - * | | |When the over boundary function is set, if there occurs the over boundary condition, this flag will be set. - * | | |0 = Over boundary condition did not occur. - * | | |1 = Over boundary condition occurred. - * | | |Note: Write 1 to clear this flag. - * @var SYS_T::IRCTCTL - * Offset: 0xF0 HIRC Trim Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FREQSEL |Trim Frequency Selection - * | | |This field indicates the target frequency of 12 MHz internal high speed RC oscillator (HIRC) auto trim. - * | | |During auto trim operation, if clock error detected with CESTOPEN is set to 1 or trim retry limitation count reached, this field will be cleared to 00 automatically. - * | | |00 = Disable HIRC auto trim function. - * | | |01 = Enable HIRC auto trim function and trim HIRC to 12 MHz. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[5:4] |LOOPSEL |Trim Calculation Loop Selection - * | | |This field defines that trim value calculation is based on how many reference clocks. - * | | |00 = Trim value calculation is based on average difference in 4 clocks of reference clock. - * | | |01 = Trim value calculation is based on average difference in 8 clocks of reference clock. - * | | |10 = Trim value calculation is based on average difference in 16 clocks of reference clock. - * | | |11 = Trim value calculation is based on average difference in 32 clocks of reference clock. - * | | |Note: For example, if LOOPSEL is set as 00, auto trim circuit will calculate trim value based on the average frequency difference in 4 clocks of reference clock. - * |[7:6] |RETRYCNT |Trim Value Update Limitation Count - * | | |This field defines that how many times the auto trim circuit will try to update the HIRC trim value before the frequency of HIRC locked. - * | | |Once the HIRC locked, the internal trim value update counter will be reset. - * | | |If the trim value update counter reached this limitation value and frequency of HIRC still does not lock, the auto trim operation will be disabled and FREQSEL will be cleared to 00. - * | | |00 = Trim retry count limitation is 64 loops. - * | | |01 = Trim retry count limitation is 128 loops. - * | | |10 = Trim retry count limitation is 256 loops. - * | | |11 = Trim retry count limitation is 512 loops. - * |[8] |CESTOPEN |Clock Error Stop Enable Bit - * | | |0 = The trim operation is keep going if clock is inaccuracy. - * | | |1 = The trim operation is stopped if clock is inaccuracy. - * |[9] |BOUNDEN |Boundary Enable Bit - * | | |0 = Boundary function Disabled. - * | | |1 = Boundary function Enabled. - * |[10] |REFCKSEL |Reference Clock Selection - * | | |0 = HIRC trim reference clock is from LXT (32.768 kHz). - * | | |1 = HIRC trim reference clock is from internal USB synchronous mode. - * | | |Note: HIRC trim reference clock is 20 kHz in test mode. - * |[20:16] |BOUNDARY |Boundary Selection - * | | |Fill the boundary range from 0x1 to 0x31, 0x0 is reserved. - * | | |Note: This field is effective only when the BOUNDEN(SYS_IRCTCTL[9]) is enabled. - * @var SYS_T::IRCTIEN - * Offset: 0xF4 HIRC Trim Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TFAILIEN |Trim Failure Interrupt Enable Bit - * | | |This bit controls if an interrupt will be triggered while HIRC trim value update limitation count reached and HIRC frequency still not locked on target frequency set by FREQSEL(SYS_IRCTCTL[1:0]). - * | | |If this bit is high and TFAILIF(SYS_IRCTISTS[1]) is set during auto trim operation, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |0 = Disable TFAILIF(SYS_IRCTISTS[1]) status to trigger an interrupt to CPU. - * | | |1 = Enable TFAILIF(SYS_IRCTISTS[1]) status to trigger an interrupt to CPU. - * |[2] |CLKEIEN |Clock Error Interrupt Enable Bit - * | | |This bit controls if CPU would get an interrupt while clock is inaccuracy during auto trim operation. - * | | |If this bit is set to1, and CLKERRIF(SYS_IRCTISTS[2]) is set during auto trim operation, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |0 = Disable CLKERRIF(SYS_IRCTISTS[2]) status to trigger an interrupt to CPU. - * | | |1 = Enable CLKERRIF(SYS_IRCTISTS[2]) status to trigger an interrupt to CPU. - * @var SYS_T::IRCTISTS - * Offset: 0xF8 HIRC Trim Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FREQLOCK |HIRC Frequency Lock Status - * | | |This bit indicates the HIRC frequency is locked. - * | | |This is a status bit and does not trigger any interrupt. - * | | |Write 1 to clear this to 0. - * | | |This bit will be set automatically, if the frequency is lock and the RC_TRIM is enabled. - * | | |0 = The internal high-speed oscillator frequency does not lock at 12 MHz yet. - * | | |1 = The internal high-speed oscillator frequency locked at 12 MHz. - * |[1] |TFAILIF |Trim Failure Interrupt Status - * | | |This bit indicates that HIRC trim value update limitation count reached and the HIRC clock frequency still does not be locked. - * | | |Once this bit is set, the auto trim operation stopped and FREQSEL(SYS_IRCTCTL[1:0]) will be cleared to 00 by hardware automatically. - * | | |If this bit is set and TFAILIEN(SYS_IRCTIEN[1]) is high, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |Write 1 to clear this to 0. - * | | |0 = Trim value update limitation count does not reach. - * | | |1 = Trim value update limitation count reached and HIRC frequency still not locked. - * |[2] |CLKERRIF |Clock Error Interrupt Status - * | | |When the frequency of 32.768 kHz external low speed crystal oscillator (LXT) or 12 MHz internal high speed RC oscillator (HIRC) is shift larger to unreasonable value, this bit will be set and to be an indicate that clock frequency is inaccuracy. - * | | |Once this bit is set to 1, the auto trim operation stopped and FREQSEL(SYS_IRCTCL[1:0]) will be cleared to 00 by hardware automatically if CESTOPEN(SYS_IRCTCTL[8]) is set to 1. - * | | |If this bit is set and CLKEIEN(SYS_IRCTIEN[2]) is high, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |Write 1 to clear this to 0. - * | | |0 = Clock frequency is accuracy. - * | | |1 = Clock frequency is inaccuracy. - * |[3] |OVBDIF |Over Boundary Status - * | | |When the over boundary function is set, if there occurs the over boundary condition, this flag will be set. - * | | |0 = Over boundary condition did not occur. - * | | |1 = Over boundary condition occurred. - * | | |Note: Write 1 to clear this flag. - * @var SYS_T::REGLCTL - * Offset: 0x100 Register Lock Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REGLCTL |Register Lock Control Code (Write Only) - * | | |Some registers have write-protection function. - * | | |Writing these registers have to disable the protected function by writing the sequence value 0x59, 0x16, 0x88 to this field. - * | | |After this sequence is completed, the REGLCTL bit will be set to 1 and write-protection registers can be normal write. - * | | |REGLCTL[0] - * | | |Register Lock Control Disable Index (Read Only) - * | | |0 = Write-protection Enabled for writing protected registers. Any write to the protected register is ignored. - * | | |1 = Write-protection Disabled for writing protected registers. - * @var SYS_T::PORDISAN - * Offset: 0x1EC Analog POR Disable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |POROFFAN |Power-on Reset Enable Bit (Write Protect) - * | | |After powered on, User can turn off internal analog POR circuit to save power by writing 0x5AA5 to this field. - * | | |The analog POR circuit will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::CSERVER - * Offset: 0x1F4 Chip Series Version Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |VERSION |Chip Series Version (Read Only) - * | | |These bits indicate the series version of chip. - * | | |0x2 = M460HD. - * | | |0x3 = M460LD. - * | | |Others = Reserved. - * @var SYS_T::PLCTL - * Offset: 0x1F8 Power Level Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PLSEL |Power Level Select (Write Protect) - * | | |These bits indicate the status of power level. - * | | |00 = Power level is PL0. - * | | |01 = Power level is PL1. - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[21:16] |LVSSTEP |LDO Voltage Scaling Step (Write Protect) - * | | |The LVSSTEP value is LDO voltage rising step. - * | | |LDO voltage scaling step = (LVSSTEP + 1) * 10mV. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[31:24] |LVSPRD |LDO Voltage Scaling Period (Write Protect) - * | | |The LVSPRD value is the period of each LDO voltage rising step. - * | | |LDO voltage scaling period = (LVSPRD + 1) * 1us. - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::PLSTS - * Offset: 0x1FC Power Level Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PLCBUSY |Power Level Change Busy Bit (Read Only) - * | | |This bit is set by hardware when power level is changing. - * | | |After power level change is completed, this bit will be cleared automatically by hardware. - * | | |0 = Core voltage change is completed. - * | | |1 = Core voltage change is ongoing. - * |[9:8] |PLSTATUS |Power Level Status (Read Only) - * | | |This bit indicates the status of power level. - * | | |00 = Power level is PL0. - * | | |01 = Power level is PL1. - * | | |Others = Reserved. - * @var SYS_T::AHBMCTL - * Offset: 0x400 AHB Bus Matrix Priority Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INTACTEN |Highest AHB Bus Priority of Cortex-M4 Core Enable Bit (Write Protect) - * | | |Enable Cortex-M4 Core With Highest AHB Bus Priority In AHB Bus Matrix. - * | | |0 = Round-robin mode. - * | | |1 = Cortex-M4 CPU with highest bus priority when interrupt occurred. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::GPA_MFP0 - * Offset: 0x500 GPIOA Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PA0MFP |PA.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = SPIM_MOSI - * | | |03 = QSPI0_MOSI0 - * | | |04 = SPI0_MOSI - * | | |05 = SD1_DAT0 - * | | |06 = SC0_CLK - * | | |07 = UART0_RXD - * | | |08 = UART1_nRTS - * | | |09 = I2C2_SDA - * | | |10 = CCAP_DATA6 - * | | |12 = BPWM0_CH0 - * | | |13 = EPWM0_CH5 - * | | |14 = EQEI3_B - * | | |15 = DAC0_ST - * | | |17 = PSIO0_CH7 - * | | |20 = BMC19 - * |[12:8] |PA1MFP |PA.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = SPIM_MISO - * | | |03 = QSPI0_MISO0 - * | | |04 = SPI0_MISO - * | | |05 = SD1_DAT1 - * | | |06 = SC0_DAT - * | | |07 = UART0_TXD - * | | |08 = UART1_nCTS - * | | |09 = I2C2_SCL - * | | |10 = CCAP_DATA7 - * | | |12 = BPWM0_CH1 - * | | |13 = EPWM0_CH4 - * | | |14 = EQEI3_A - * | | |15 = DAC1_ST - * | | |17 = PSIO0_CH6 - * | | |20 = BMC18 - * |[20:16] |PA2MFP |PA.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = SPIM_CLK - * | | |03 = QSPI0_CLK - * | | |04 = SPI0_CLK - * | | |05 = SD1_DAT2 - * | | |06 = SC0_RST - * | | |07 = UART4_RXD - * | | |08 = UART1_RXD - * | | |09 = I2C1_SDA - * | | |10 = I2C0_SMBSUS - * | | |12 = BPWM0_CH2 - * | | |13 = EPWM0_CH3 - * | | |14 = EQEI3_INDEX - * | | |17 = PSIO0_CH5 - * | | |20 = BMC17 - * |[28:24] |PA3MFP |PA.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = SPIM_SS - * | | |03 = QSPI0_SS - * | | |04 = SPI0_SS - * | | |05 = SD1_DAT3 - * | | |06 = SC0_PWR - * | | |07 = UART4_TXD - * | | |08 = UART1_TXD - * | | |09 = I2C1_SCL - * | | |10 = I2C0_SMBAL - * | | |12 = BPWM0_CH3 - * | | |13 = EPWM0_CH2 - * | | |14 = EQEI0_B - * | | |15 = EPWM1_BRAKE1 - * | | |17 = PSIO0_CH4 - * | | |20 = BMC16 - * @var SYS_T::GPA_MFP1 - * Offset: 0x504 GPIOA Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PA4MFP |PA.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = SPIM_D3 - * | | |03 = QSPI0_MOSI1 - * | | |04 = SPI0_I2SMCLK - * | | |05 = SD1_CLK - * | | |06 = SC0_nCD - * | | |07 = UART0_nRTS - * | | |08 = UART5_RXD - * | | |09 = I2C0_SDA - * | | |10 = CAN0_RXD - * | | |11 = UART0_RXD - * | | |12 = BPWM0_CH4 - * | | |13 = EPWM0_CH1 - * | | |14 = EQEI0_A - * |[12:8] |PA5MFP |PA.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = SPIM_D2 - * | | |03 = QSPI0_MISO1 - * | | |04 = SPI1_I2SMCLK - * | | |05 = SD1_CMD - * | | |06 = SC2_nCD - * | | |07 = UART0_nCTS - * | | |08 = UART5_TXD - * | | |09 = I2C0_SCL - * | | |10 = CAN0_TXD - * | | |11 = UART0_TXD - * | | |12 = BPWM0_CH5 - * | | |13 = EPWM0_CH0 - * | | |14 = EQEI0_INDEX - * |[20:16] |PA6MFP |PA.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD6 - * | | |03 = EMAC0_RMII_RXERR - * | | |04 = SPI1_SS - * | | |05 = SD1_nCD - * | | |06 = SC2_CLK - * | | |07 = UART0_RXD - * | | |08 = I2C1_SDA - * | | |09 = QSPI1_MOSI1 - * | | |11 = EPWM1_CH5 - * | | |12 = BPWM1_CH3 - * | | |13 = ACMP1_WLAT - * | | |14 = TM3 - * | | |15 = INT0 - * | | |17 = SPI5_CLK - * | | |18 = KPI_COL0 - * | | |19 = SPI6_CLK - * | | |20 = BMC15 - * |[28:24] |PA7MFP |PA.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD7 - * | | |03 = EMAC0_RMII_CRSDV - * | | |04 = SPI1_CLK - * | | |06 = SC2_DAT - * | | |07 = UART0_TXD - * | | |08 = I2C1_SCL - * | | |09 = QSPI1_MISO1 - * | | |11 = EPWM1_CH4 - * | | |12 = BPWM1_CH2 - * | | |13 = ACMP0_WLAT - * | | |14 = TM2 - * | | |15 = INT1 - * | | |17 = SPI5_SS - * | | |18 = KPI_COL1 - * | | |19 = SPI6_SS - * | | |20 = BMC14 - * @var SYS_T::GPA_MFP2 - * Offset: 0x508 GPIOA Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PA8MFP |PA.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH4, EADC2_CH4 - * | | |02 = EBI_ALE - * | | |03 = SC2_CLK - * | | |04 = SPI2_MOSI - * | | |05 = SD1_DAT0 - * | | |06 = USCI0_CTL1 - * | | |07 = UART1_RXD - * | | |08 = UART7_RXD - * | | |09 = BPWM0_CH3 - * | | |10 = EQEI1_B - * | | |11 = ECAP0_IC2 - * | | |12 = I2S1_DO - * | | |13 = TM3_EXT - * | | |15 = INT4 - * | | |20 = BMC9 - * |[12:8] |PA9MFP |PA.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH5, EADC2_CH5 - * | | |02 = EBI_MCLK - * | | |03 = SC2_DAT - * | | |04 = SPI2_MISO - * | | |05 = SD1_DAT1 - * | | |06 = USCI0_DAT1 - * | | |07 = UART1_TXD - * | | |08 = UART7_TXD - * | | |09 = BPWM0_CH2 - * | | |10 = EQEI1_A - * | | |11 = ECAP0_IC1 - * | | |12 = I2S1_DI - * | | |13 = TM2_EXT - * | | |15 = SWDH_DAT (for M460HD) - * | | |20 = BMC8 - * |[20:16] |PA10MFP |PA.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH6, EADC2_CH6, ACMP1_P0 - * | | |02 = EBI_nWR - * | | |03 = SC2_RST - * | | |04 = SPI2_CLK - * | | |05 = SD1_DAT2 - * | | |06 = USCI0_DAT0 - * | | |07 = I2C2_SDA - * | | |08 = UART6_RXD - * | | |09 = BPWM0_CH1 - * | | |10 = EQEI1_INDEX - * | | |11 = ECAP0_IC0 - * | | |12 = I2S1_MCLK - * | | |13 = TM1_EXT - * | | |14 = DAC0_ST - * | | |15 = SWDH_CLK (for M460HD) - * | | |18 = KPI_ROW5 - * | | |20 = BMC7 - * |[28:24] |PA11MFP |PA.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH7, EADC2_CH7, ACMP0_P0 - * | | |02 = EBI_nRD - * | | |03 = SC2_PWR - * | | |04 = SPI2_SS - * | | |05 = SD1_DAT3 - * | | |06 = USCI0_CLK - * | | |07 = I2C2_SCL - * | | |08 = UART6_TXD - * | | |09 = BPWM0_CH0 - * | | |10 = EPWM0_SYNC_OUT - * | | |12 = I2S1_BCLK - * | | |13 = TM0_EXT - * | | |14 = DAC1_ST - * | | |18 = KPI_ROW4 - * | | |20 = BMC6 - * @var SYS_T::GPA_MFP3 - * Offset: 0x50C GPIOA Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PA12MFP |PA.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = I2S0_BCLK - * | | |03 = UART4_TXD - * | | |04 = I2C1_SCL - * | | |05 = SPI2_SS - * | | |06 = CAN0_TXD - * | | |07 = SC2_PWR - * | | |08 = SD1_nCD - * | | |09 = SPI0_SS (for M460LD) - * | | |10 = QSPI1_MISO0 - * | | |11 = BPWM1_CH2 - * | | |12 = EQEI1_INDEX - * | | |13 = ECAP3_IC0 - * | | |14 = USB_VBUS - * | | |17 = PSIO0_CH4 - * | | |19 = SPI10_SS - * | | |20 = BMC12 - * |[12:8] |PA13MFP |PA.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = I2S0_MCLK - * | | |03 = UART4_RXD - * | | |04 = I2C1_SDA - * | | |05 = SPI2_CLK - * | | |06 = CAN0_RXD - * | | |07 = SC2_RST - * | | |09 = SPI0_CLK (for M460LD) - * | | |10 = QSPI1_MOSI0 - * | | |11 = BPWM1_CH3 - * | | |12 = EQEI1_A - * | | |13 = ECAP3_IC1 - * | | |14 = USB_D- - * | | |17 = PSIO0_CH5 - * | | |19 = SPI10_CLK - * | | |20 = BMC13 - * |[20:16] |PA14MFP |PA.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = I2S0_DI - * | | |03 = UART0_TXD - * | | |04 = EBI_AD5 - * | | |05 = SPI2_MISO - * | | |06 = I2C2_SCL - * | | |07 = SC2_DAT - * | | |09 = SPI0_MISO (for M460LD) - * | | |11 = BPWM1_CH4 - * | | |12 = EQEI1_B - * | | |13 = ECAP3_IC2 - * | | |14 = USB_D+ - * | | |16 = I2C0_SCL (for M460LD) - * | | |17 = PSIO0_CH6 - * | | |19 = SPI10_MISO - * | | |20 = BMC14 - * |[28:24] |PA15MFP |PA.15 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = I2S0_DO - * | | |03 = UART0_RXD - * | | |04 = SPIM_MOSI - * | | |05 = SPI2_MOSI - * | | |06 = I2C2_SDA - * | | |07 = SC2_CLK - * | | |09 = SPI0_MOSI (for M460LD) - * | | |11 = BPWM1_CH5 - * | | |12 = EPWM0_SYNC_IN - * | | |13 = EQEI3_INDEX - * | | |14 = USB_OTG_ID - * | | |16 = I2C0_SDA (for M460LD) - * | | |17 = PSIO0_CH7 - * | | |19 = SPI10_MOSI - * | | |20 = BMC15 - * @var SYS_T::GPB_MFP0 - * Offset: 0x510 GPIOB Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PB0MFP |PB.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH0, EADC1_CH8, EADC2_CH8, ACMP3_N - * | | |02 = EBI_ADR9 - * | | |03 = SD0_CMD - * | | |04 = SPI2_I2SMCLK - * | | |06 = USCI0_CTL0 - * | | |07 = UART2_RXD - * | | |08 = SPI0_I2SMCLK - * | | |09 = I2C1_SDA - * | | |10 = I2S1_LRCK - * | | |11 = EPWM0_CH5 - * | | |12 = EPWM1_CH5 - * | | |13 = EPWM0_BRAKE1 - * | | |14 = ACMP3_O - * | | |15 = QSPI0_MOSI1 - * | | |18 = KPI_ROW3 - * | | |19 = SPI4_MOSI - * | | |20 = BMC5 - * |[12:8] |PB1MFP |PB.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH1, EADC1_CH9, EADC2_CH9, ACMP3_P0 - * | | |02 = EBI_ADR8 - * | | |03 = SD0_CLK - * | | |04 = EMAC_RMII_RXERR - * | | |05 = SPI1_I2SMCLK - * | | |06 = SPI3_I2SMCLK - * | | |07 = UART2_TXD - * | | |09 = I2C1_SCL - * | | |10 = I2S0_LRCK - * | | |11 = EPWM0_CH4 - * | | |12 = EPWM1_CH4 - * | | |13 = EPWM0_BRAKE0 - * | | |14 = ACMP2_O - * | | |15 = QSPI0_MISO1 - * | | |18 = KPI_ROW2 - * | | |19 = SPI4_MISO - * | | |20 = BMC4 - * |[20:16] |PB2MFP |PB.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH2, EADC1_CH10, ACMP0_P1 - * | | |02 = EBI_ADR3 - * | | |03 = SD0_DAT0 - * | | |04 = EMAC0_RMII_CRSDV - * | | |05 = SPI1_SS - * | | |06 = UART1_RXD - * | | |07 = UART5_nCTS - * | | |09 = SC0_PWR - * | | |10 = I2S0_DO - * | | |11 = EPWM0_CH3 - * | | |12 = I2C1_SDA - * | | |14 = TM3 - * | | |15 = INT3 - * | | |17 = PSIO0_CH7 - * | | |18 = KPI_ROW1 - * | | |19 = SPI4_CLK - * | | |20 = BMC3 - * |[28:24] |PB3MFP |PB.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH3, EADC1_CH11, ACMP0_N - * | | |02 = EBI_ADR2 - * | | |03 = SD0_DAT1 - * | | |04 = EMAC0_RMII_RXD1 - * | | |05 = SPI1_CLK - * | | |06 = UART1_TXD - * | | |07 = UART5_nRTS - * | | |09 = SC0_RST - * | | |10 = I2S0_DI - * | | |11 = EPWM0_CH2 - * | | |12 = I2C1_SCL - * | | |14 = TM2 - * | | |15 = INT2 - * | | |17 = PSIO0_CH6 - * | | |18 = KPI_ROW0 - * | | |19 = SPI4_SS - * | | |20 = BMC2 - * @var SYS_T::GPB_MFP1 - * Offset: 0x514 GPIOB Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PB4MFP |PB.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH4, ACMP1_P1 - * | | |02 = EBI_ADR1 - * | | |03 = SD0_DAT2 - * | | |04 = EMAC0_RMII_RXD0 - * | | |05 = SPI1_MOSI - * | | |06 = I2C0_SDA - * | | |07 = UART5_RXD - * | | |09 = SC0_DAT - * | | |10 = I2S0_MCLK - * | | |11 = EPWM0_CH1 - * | | |12 = UART2_RXD - * | | |14 = TM1 - * | | |15 = INT1 - * | | |17 = PSIO0_CH5 - * | | |18 = KPI_COL7 - * | | |20 = BMC1 - * |[12:8] |PB5MFP |PB.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH5, ACMP1_N - * | | |02 = EBI_ADR0 - * | | |03 = SD0_DAT3 - * | | |04 = EMAC0_RMII_REFCLK - * | | |05 = SPI1_MISO - * | | |06 = I2C0_SCL - * | | |07 = UART5_TXD - * | | |09 = SC0_CLK - * | | |10 = I2S0_BCLK - * | | |11 = EPWM0_CH0 - * | | |12 = UART2_TXD - * | | |14 = TM0 - * | | |15 = INT0 - * | | |17 = PSIO0_CH4 - * | | |18 = KPI_COL6 - * | | |20 = BMC0 - * |[20:16] |PB6MFP |PB.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH6, EADC2_CH14, ACMP2_N - * | | |02 = EBI_nWRH - * | | |03 = EMAC0_PPS - * | | |05 = CAN1_RXD - * | | |06 = UART1_RXD - * | | |07 = SD1_CLK - * | | |08 = EBI_nCS1 - * | | |10 = BPWM1_CH5 - * | | |11 = EPWM1_BRAKE1 - * | | |12 = EPWM1_CH5 - * | | |13 = INT4 - * | | |14 = USB_VBUS_EN - * | | |15 = ACMP1_O - * | | |16 = SPI3_MOSI (for M460LD) - * | | |18 = KPI_COL5 - * | | |19 = SPI1_SS - * | | |20 = BMC31 - * |[28:24] |PB7MFP |PB.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH7, EADC2_CH15, ACMP2_P0 - * | | |02 = EBI_nWRL - * | | |03 = EMAC0_RMII_TXEN - * | | |05 = CAN1_TXD - * | | |06 = UART1_TXD - * | | |07 = SD1_CMD - * | | |08 = EBI_nCS0 - * | | |10 = BPWM1_CH4 - * | | |11 = EPWM1_BRAKE0 - * | | |12 = EPWM1_CH4 - * | | |13 = INT5 - * | | |14 = USB_VBUS_ST - * | | |15 = ACMP0_O - * | | |16 = SPI3_MISO (for M460LD) - * | | |18 = KPI_COL4 - * | | |19 = SPI1_CLK (for M460LD) - * | | |20 = BMC30 - * @var SYS_T::GPB_MFP2 - * Offset: 0x518 GPIOB Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PB8MFP |PB.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH8, ACMP2_P1 - * | | |02 = EBI_ADR19 - * | | |03 = EMAC0_RMII_TXD1 - * | | |05 = UART0_RXD - * | | |06 = UART1_nRTS - * | | |07 = I2C1_SMBSUS - * | | |08 = UART7_RXD - * | | |09 = I2C0_SDA - * | | |10 = BPWM1_CH3 - * | | |11 = SPI3_MOSI - * | | |12 = CAN2_RXD - * | | |13 = INT6 - * | | |14 = EADC2_ST - * | | |20 = BMC23 - * |[12:8] |PB9MFP |PB.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH9, ACMP2_P2 - * | | |02 = EBI_ADR18 - * | | |03 = EMAC0_RMII_TXD0 - * | | |05 = UART0_TXD - * | | |06 = UART1_nCTS - * | | |07 = I2C1_SMBAL - * | | |08 = UART7_TXD - * | | |09 = I2C0_SCL - * | | |10 = BPWM1_CH2 - * | | |11 = SPI3_MISO - * | | |12 = CAN2_TXD - * | | |13 = INT7 - * | | |14 = CCAP_HSYNC - * | | |20 = BMC22 - * |[20:16] |PB10MFP |PB.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH10, ACMP2_P3 - * | | |02 = EBI_ADR17 - * | | |03 = EMAC0_RMII_MDIO - * | | |05 = UART0_nRTS - * | | |06 = UART4_RXD - * | | |07 = I2C1_SDA - * | | |08 = CAN0_RXD - * | | |10 = BPWM1_CH1 - * | | |11 = SPI3_SS - * | | |12 = CCAP_VSYNC - * | | |14 = HSUSB_VBUS_EN - * | | |20 = BMC21 - * |[28:24] |PB11MFP |PB.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH11 - * | | |02 = EBI_ADR16 - * | | |03 = EMAC0_RMII_MDC - * | | |05 = UART0_nCTS - * | | |06 = UART4_TXD - * | | |07 = I2C1_SCL - * | | |08 = CAN0_TXD - * | | |09 = SPI0_I2SMCLK - * | | |10 = BPWM1_CH0 - * | | |11 = SPI3_CLK - * | | |12 = CCAP_SFIELD - * | | |14 = HSUSB_VBUS_ST - * | | |20 = BMC20 - * @var SYS_T::GPB_MFP3 - * Offset: 0x51C GPIOB Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PB12MFP |PB.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH12, EADC1_CH12, DAC0_OUT, ACMP0_P2, ACMP1_P2 - * | | |02 = EBI_AD15 - * | | |03 = SC1_CLK - * | | |04 = SPI0_MOSI - * | | |05 = USCI0_CLK - * | | |06 = UART0_RXD - * | | |07 = UART3_nCTS - * | | |08 = I2C2_SDA - * | | |09 = SD0_nCD - * | | |10 = CCAP_SCLK - * | | |11 = EPWM1_CH3 - * | | |12 = ETMC_TRACE_DATA3 (for M460HD) - * | | |13 = TM3_EXT - * | | |14 = CAN3_RXD - * | | |16 = SPI3_SS (for M460LD) - * | | |17 = PSIO0_CH3 - * | | |18 = KPI_COL3 - * | | |20 = BMC29 - * |[12:8] |PB13MFP |PB.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH13, EADC1_CH13, DAC1_OUT, ACMP0_P3, ACMP1_P3 - * | | |02 = EBI_AD14 - * | | |03 = SC1_DAT - * | | |04 = SPI0_MISO - * | | |05 = USCI0_DAT0 - * | | |06 = UART0_TXD - * | | |07 = UART3_nRTS - * | | |08 = I2C2_SCL - * | | |10 = CCAP_PIXCLK - * | | |11 = EPWM1_CH2 - * | | |12 = ETMC_TRACE_DATA2 (for M460HD) - * | | |13 = TM2_EXT - * | | |14 = CAN3_TXD - * | | |16 = SPI3_CLK (for M460LD) - * | | |17 = PSIO0_CH2 - * | | |18 = KPI_COL2 - * | | |19 = SPI9_MISO - * | | |20 = BMC28 - * |[20:16] |PB14MFP |PB.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH14, EADC1_CH14 - * | | |02 = EBI_AD13 - * | | |03 = SC1_RST - * | | |04 = SPI0_CLK - * | | |05 = USCI0_DAT1 - * | | |06 = UART0_nRTS - * | | |07 = UART3_RXD - * | | |08 = I2C2_SMBSUS - * | | |09 = CCAP_DATA0 - * | | |11 = EPWM1_CH1 - * | | |12 = ETMC_TRACE_DATA1 (for M460HD) - * | | |13 = TM1_EXT - * | | |14 = CLKO - * | | |15 = USB_VBUS_ST - * | | |17 = PSIO0_CH1 - * | | |18 = KPI_COL1 - * | | |19 = SPI9_SS - * |[28:24] |PB15MFP |PB.15 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC0_CH15, EADC1_CH15 - * | | |02 = EBI_AD12 - * | | |03 = SC1_PWR - * | | |04 = SPI0_SS - * | | |05 = USCI0_CTL1 - * | | |06 = UART0_nCTS - * | | |07 = UART3_TXD - * | | |08 = I2C2_SMBAL - * | | |09 = CCAP_DATA1 - * | | |10 = EPWM0_BRAKE1 - * | | |11 = EPWM1_CH0 - * | | |12 = ETMC_TRACE_DATA0 (for M460HD) - * | | |13 = TM0_EXT - * | | |14 = USB_VBUS_EN - * | | |15 = HSUSB_VBUS_EN (for M460HD) - * | | |17 = PSIO0_CH0 - * | | |18 = KPI_COL0 - * | | |19 = SPI9_CLK - * | | |20 = BMC27 - * @var SYS_T::GPC_MFP0 - * Offset: 0x520 GPIOC Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PC0MFP |PC.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD0 - * | | |03 = SPIM_MOSI - * | | |04 = QSPI0_MOSI0 - * | | |05 = SC1_CLK - * | | |06 = I2S0_LRCK - * | | |07 = SPI1_SS - * | | |08 = UART2_RXD - * | | |09 = I2C0_SDA - * | | |10 = CAN2_RXD - * | | |12 = EPWM1_CH5 - * | | |13 = CCAP_DATA0 - * | | |14 = ACMP1_O - * | | |15 = EADC1_ST - * | | |16 = HBI_D2 - * | | |17 = QSPI1_CLK (for M460LD) - * | | |18 = KPI_ROW5 - * | | |19 = SPI7_MOSI - * | | |20 = BMC25 - * |[12:8] |PC1MFP |PC.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD1 - * | | |03 = SPIM_MISO - * | | |04 = QSPI0_MISO0 - * | | |05 = SC1_DAT - * | | |06 = I2S0_DO - * | | |07 = SPI1_CLK - * | | |08 = UART2_TXD - * | | |09 = I2C0_SCL - * | | |10 = CAN2_TXD - * | | |12 = EPWM1_CH4 - * | | |13 = CCAP_DATA1 - * | | |14 = ACMP0_O - * | | |15 = EADC0_ST - * | | |16 = HBI_RWDS - * | | |17 = QSPI1_SS (for M460LD) - * | | |18 = KPI_ROW4 - * | | |19 = SPI7_MISO - * | | |20 = BMC24 - * |[20:16] |PC2MFP |PC.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD2 - * | | |03 = SPIM_CLK - * | | |04 = QSPI0_CLK - * | | |05 = SC1_RST - * | | |06 = I2S0_DI - * | | |07 = SPI1_MOSI - * | | |08 = UART2_nCTS - * | | |09 = I2C0_SMBSUS - * | | |10 = CAN1_RXD - * | | |11 = UART3_RXD - * | | |12 = EPWM1_CH3 - * | | |13 = CCAP_DATA2 - * | | |14 = QSPI1_MOSI0 - * | | |15 = I2C3_SDA - * | | |16 = HBI_nRESET - * | | |17 = PSIO0_CH3 - * | | |18 = KPI_ROW3 - * | | |19 = SPI7_CLK - * | | |20 = BMC23 - * |[28:24] |PC3MFP |PC.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD3 - * | | |03 = SPIM_SS - * | | |04 = QSPI0_SS - * | | |05 = SC1_PWR - * | | |06 = I2S0_MCLK - * | | |07 = SPI1_MISO - * | | |08 = UART2_nRTS - * | | |09 = I2C0_SMBAL - * | | |10 = CAN1_TXD - * | | |11 = UART3_TXD - * | | |12 = EPWM1_CH2 - * | | |13 = CCAP_DATA3 - * | | |14 = QSPI1_MISO0 - * | | |15 = I2C3_SCL - * | | |16 = HBI_nCS - * | | |17 = PSIO0_CH2 - * | | |18 = KPI_ROW2 - * | | |19 = SPI7_SS - * | | |20 = BMC22 - * @var SYS_T::GPC_MFP1 - * Offset: 0x524 GPIOC Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PC4MFP |PC.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD4 - * | | |03 = SPIM_D3 - * | | |04 = QSPI0_MOSI1 - * | | |05 = SC1_nCD - * | | |06 = I2S0_BCLK - * | | |07 = SPI1_I2SMCLK - * | | |08 = UART2_RXD - * | | |09 = I2C1_SDA - * | | |10 = CAN0_RXD - * | | |11 = UART4_RXD - * | | |12 = EPWM1_CH1 - * | | |13 = CCAP_DATA4 - * | | |14 = QSPI1_CLK - * | | |15 = I2C3_SMBSUS - * | | |16 = HBI_CK - * | | |17 = PSIO0_CH1 - * | | |18 = KPI_ROW1 - * | | |20 = BMC21 - * |[12:8] |PC5MFP |PC.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD5 - * | | |03 = SPIM_D2 - * | | |04 = QSPI0_MISO1 - * | | |08 = UART2_TXD - * | | |09 = I2C1_SCL - * | | |10 = CAN0_TXD - * | | |11 = UART4_TXD - * | | |12 = EPWM1_CH0 - * | | |13 = CCAP_DATA5 - * | | |14 = QSPI1_SS - * | | |15 = I2C3_SMBAL - * | | |16 = HBI_nCK - * | | |17 = PSIO0_CH0 - * | | |18 = KPI_ROW0 - * | | |20 = BMC20 - * |[20:16] |PC6MFP |PC.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD8 - * | | |03 = EMAC0_RMII_RXD1 - * | | |04 = SPI1_MOSI - * | | |05 = UART4_RXD - * | | |06 = SC2_RST - * | | |07 = UART0_nRTS - * | | |08 = I2C1_SMBSUS - * | | |09 = UART6_RXD - * | | |10 = ACMP3_WLAT - * | | |11 = EPWM1_CH3 - * | | |12 = BPWM1_CH1 - * | | |13 = CAN3_RXD - * | | |14 = TM1 - * | | |15 = INT2 - * | | |18 = KPI_COL2 - * | | |19 = SPI6_MOSI - * | | |20 = BMC25 - * |[28:24] |PC7MFP |PC.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD9 - * | | |03 = EMAC0_RMII_RXD0 - * | | |04 = SPI1_MISO - * | | |05 = UART4_TXD - * | | |06 = SC2_PWR - * | | |07 = UART0_nCTS - * | | |08 = I2C1_SMBAL - * | | |09 = UART6_TXD - * | | |10 = ACMP2_WLAT - * | | |11 = EPWM1_CH2 - * | | |12 = BPWM1_CH0 - * | | |13 = CAN3_TXD - * | | |14 = TM0 - * | | |15 = INT3 - * | | |18 = KPI_COL3 - * | | |19 = SPI6_MISO - * | | |20 = BMC24 - * @var SYS_T::GPC_MFP2 - * Offset: 0x528 GPIOC Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PC8MFP |PC.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR16 - * | | |03 = EMAC0_RMII_REFCLK - * | | |04 = I2C0_SDA - * | | |05 = UART4_nCTS - * | | |08 = UART1_RXD - * | | |11 = EPWM1_CH1 - * | | |12 = BPWM1_CH4 - * | | |18 = KPI_COL4 - * |[12:8] |PC9MFP |PC.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC2_CH10, ACMP3_P1 - * | | |02 = EBI_ADR7 - * | | |05 = UART6_nCTS - * | | |06 = SPI3_SS - * | | |07 = UART3_RXD - * | | |09 = CAN1_RXD - * | | |10 = I2C4_SMBSUS - * | | |12 = EPWM1_CH3 - * | | |14 = EADC1_ST - * |[20:16] |PC10MFP |PC.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC2_CH11, ACMP3_P2 - * | | |02 = EBI_ADR6 - * | | |05 = UART6_nRTS - * | | |06 = SPI3_CLK - * | | |07 = UART3_TXD - * | | |09 = CAN1_TXD - * | | |10 = I2C4_SMBAL - * | | |11 = ECAP1_IC0 - * | | |12 = EPWM1_CH2 - * | | |14 = EADC1_ST - * |[28:24] |PC11MFP |PC.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC2_CH12, ACMP3_P3 - * | | |02 = EBI_ADR5 - * | | |03 = UART0_RXD - * | | |04 = I2C0_SDA - * | | |05 = UART6_RXD - * | | |06 = SPI3_MOSI - * | | |10 = I2C4_SDA - * | | |11 = ECAP1_IC1 - * | | |12 = EPWM1_CH1 - * | | |14 = ACMP1_O - * @var SYS_T::GPC_MFP3 - * Offset: 0x52C GPIOC Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PC12MFP |PC.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC2_CH13 - * | | |02 = EBI_ADR4 - * | | |03 = UART0_TXD - * | | |04 = I2C0_SCL - * | | |05 = UART6_TXD - * | | |06 = SPI3_MISO - * | | |09 = SC0_nCD - * | | |10 = I2C4_SCL - * | | |11 = ECAP1_IC2 - * | | |12 = EPWM1_CH0 - * | | |14 = ACMP0_O - * |[12:8] |PC13MFP |PC.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH3, EADC2_CH3 - * | | |02 = EBI_ADR10 - * | | |03 = SC2_nCD - * | | |04 = SPI2_I2SMCLK - * | | |05 = CAN1_TXD - * | | |06 = USCI0_CTL0 - * | | |07 = UART2_TXD - * | | |08 = UART8_nCTS - * | | |09 = BPWM0_CH4 - * | | |13 = CLKO - * | | |14 = EADC0_ST - * | | |19 = SPI9_SS - * |[20:16] |PC14MFP |PC.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD11 - * | | |03 = SC1_nCD - * | | |04 = SPI0_I2SMCLK - * | | |05 = USCI0_CTL0 - * | | |06 = QSPI0_CLK - * | | |10 = TRACE_SWO - * | | |11 = EPWM0_SYNC_IN - * | | |12 = ETMC_TRACE_CLK (for M460HD) - * | | |13 = TM1 - * | | |14 = USB_VBUS_ST - * | | |15 = HSUSB_VBUS_ST (for M460HD) - * | | |19 = SPI9_MOSI - * | | |20 = BMC26 - * |[28:24] |PC15MFP |PC.15 Multi-function Pin Selection - * @var SYS_T::GPD_MFP0 - * Offset: 0x530 GPIOD Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PD0MFP |PD.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD13 - * | | |03 = USCI0_CLK - * | | |04 = SPI0_MOSI - * | | |05 = UART3_RXD - * | | |06 = I2C2_SDA - * | | |07 = SC2_CLK - * | | |10 = I2S1_DO - * | | |12 = EQEI2_A - * | | |13 = ECAP2_IC1 - * | | |14 = TM2 - * |[12:8] |PD1MFP |PD.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD12 - * | | |03 = USCI0_DAT0 - * | | |04 = SPI0_MISO - * | | |05 = UART3_TXD - * | | |06 = I2C2_SCL - * | | |07 = SC2_DAT - * | | |10 = I2S1_DI - * | | |12 = EQEI2_INDEX - * | | |13 = ECAP2_IC0 - * |[20:16] |PD2MFP |PD.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD11 - * | | |03 = USCI0_DAT1 - * | | |04 = SPI0_CLK - * | | |05 = UART3_nCTS - * | | |07 = SC2_RST - * | | |09 = UART0_RXD - * | | |10 = I2S1_MCLK - * | | |13 = EQEI3_B - * |[28:24] |PD3MFP |PD.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD10 - * | | |03 = USCI0_CTL1 - * | | |04 = SPI0_SS - * | | |05 = UART3_nRTS - * | | |07 = SC2_PWR - * | | |08 = SC1_nCD - * | | |09 = UART0_TXD - * | | |10 = I2S1_BCLK - * | | |13 = EQEI3_A - * @var SYS_T::GPD_MFP1 - * Offset: 0x534 GPIOD Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PD4MFP |PD.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = USCI0_CTL0 - * | | |04 = I2C1_SDA - * | | |05 = SPI1_SS - * | | |08 = SC1_CLK - * | | |14 = USB_VBUS_ST - * | | |17 = PSIO0_CH7 - * |[12:8] |PD5MFP |PD.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |04 = I2C1_SCL - * | | |05 = SPI1_CLK - * | | |08 = SC1_DAT - * | | |14 = ACMP1_O - * | | |15 = EADC1_ST - * | | |16 = HBI_D7 - * | | |17 = PSIO0_CH6 - * |[20:16] |PD6MFP |PD.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD5 - * | | |03 = UART1_RXD - * | | |04 = I2C0_SDA - * | | |05 = SPI1_MOSI - * | | |06 = QSPI1_MOSI0 - * | | |08 = SC1_RST - * | | |14 = ACMP0_O - * | | |15 = EADC0_ST - * | | |16 = HBI_D6 - * | | |17 = PSIO0_CH5 - * |[28:24] |PD7MFP |PD.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD4 - * | | |03 = UART1_TXD - * | | |04 = I2C0_SCL - * | | |05 = SPI1_MISO - * | | |06 = QSPI1_MISO0 - * | | |07 = CCAP_HSYNC - * | | |08 = SC1_PWR - * | | |16 = HBI_D5 - * | | |17 = PSIO0_CH4 - * @var SYS_T::GPD_MFP2 - * Offset: 0x538 GPIOD Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PD8MFP |PD.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD6 - * | | |03 = I2C2_SDA - * | | |04 = UART2_nRTS - * | | |05 = UART7_RXD - * | | |06 = CAN2_RXD - * | | |17 = PSIO0_CH3 - * |[12:8] |PD9MFP |PD.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD7 - * | | |03 = I2C2_SCL - * | | |04 = UART2_nCTS - * | | |05 = UART7_TXD - * | | |06 = CAN2_TXD - * | | |17 = PSIO0_CH2 - * |[20:16] |PD10MFP |PD.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH0, EADC2_CH0 - * | | |02 = EBI_nCS2 - * | | |03 = UART1_RXD - * | | |04 = CAN0_RXD - * | | |08 = UART8_RXD - * | | |10 = EQEI0_B - * | | |11 = ECAP3_IC2 - * | | |15 = INT7 - * | | |19 = SPI9_MOSI - * |[28:24] |PD11MFP |PD.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH1, EADC2_CH1 - * | | |02 = EBI_nCS1 - * | | |03 = UART1_TXD - * | | |04 = CAN0_TXD - * | | |08 = UART8_TXD - * | | |10 = EQEI0_A - * | | |11 = ECAP3_IC1 - * | | |15 = INT6 - * | | |19 = SPI9_MISO - * @var SYS_T::GPD_MFP3 - * Offset: 0x53C GPIOD Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PD12MFP |PD.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |01 = EADC1_CH2, EADC2_CH2 - * | | |02 = EBI_nCS0 - * | | |05 = CAN1_RXD - * | | |07 = UART2_RXD - * | | |08 = UART8_nRTS - * | | |09 = BPWM0_CH5 - * | | |10 = EQEI0_INDEX - * | | |11 = ECAP3_IC0 - * | | |13 = CLKO - * | | |14 = EADC0_ST - * | | |15 = INT5 - * | | |19 = SPI9_CLK - * |[12:8] |PD13MFP |PD.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD10 - * | | |03 = SD0_nCD - * | | |04 = SPI0_I2SMCLK - * | | |05 = SPI1_I2SMCLK - * | | |06 = QSPI1_MOSI0 - * | | |07 = SC2_nCD - * | | |08 = SD1_CLK - * | | |09 = UART6_RXD - * | | |10 = I2S1_LRCK - * | | |11 = BPWM0_CH0 - * | | |12 = EQEI2_B - * | | |13 = ECAP2_IC2 - * | | |14 = CLKO - * | | |15 = EADC0_ST - * | | |19 = QSPI1_MOSI1 (for M460LD) - * |[20:16] |PD14MFP |PD.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nCS0 - * | | |03 = SPI3_I2SMCLK - * | | |04 = SC1_nCD - * | | |05 = SPI0_I2SMCLK - * | | |10 = I2S1_BCLK - * | | |11 = EPWM0_CH4 - * |[28:24] |PD15MFP |PD.15 Multi-function Pin Selection - * @var SYS_T::GPE_MFP0 - * Offset: 0x540 GPIOE Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PE0MFP |PE.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD11 - * | | |03 = QSPI0_MOSI0 - * | | |04 = SC2_CLK - * | | |05 = I2S0_MCLK - * | | |06 = SPI1_MOSI - * | | |07 = UART3_RXD - * | | |08 = I2C1_SDA - * | | |09 = UART4_nRTS - * | | |10 = UART8_RXD - * |[12:8] |PE1MFP |PE.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD10 - * | | |03 = QSPI0_MISO0 - * | | |04 = SC2_DAT - * | | |05 = I2S0_BCLK - * | | |06 = SPI1_MISO - * | | |07 = UART3_TXD - * | | |08 = I2C1_SCL - * | | |09 = UART4_nCTS - * | | |10 = UART8_TXD - * |[20:16] |PE2MFP |PE.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ALE - * | | |03 = SD0_DAT0 - * | | |04 = SPIM_MOSI - * | | |05 = SPI3_MOSI - * | | |06 = SC0_CLK - * | | |07 = USCI0_CLK - * | | |08 = UART6_nCTS - * | | |09 = UART7_RXD - * | | |10 = UART8_nRTS - * | | |11 = EQEI0_B - * | | |12 = EPWM0_CH5 - * | | |13 = BPWM0_CH0 - * |[28:24] |PE3MFP |PE.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_MCLK - * | | |03 = SD0_DAT1 - * | | |04 = SPIM_MISO - * | | |05 = SPI3_MISO - * | | |06 = SC0_DAT - * | | |07 = USCI0_DAT0 - * | | |08 = UART6_nRTS - * | | |09 = UART7_TXD - * | | |10 = UART8_nCTS - * | | |11 = EQEI0_A - * | | |12 = EPWM0_CH4 - * | | |13 = BPWM0_CH1 - * @var SYS_T::GPE_MFP1 - * Offset: 0x544 GPIOE Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PE4MFP |PE.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nWR - * | | |03 = SD0_DAT2 - * | | |04 = SPIM_CLK - * | | |05 = SPI3_CLK - * | | |06 = SC0_RST - * | | |07 = USCI0_DAT1 - * | | |08 = UART6_RXD - * | | |09 = UART7_nCTS - * | | |10 = UART9_RXD - * | | |11 = EQEI0_INDEX - * | | |12 = EPWM0_CH3 - * | | |13 = BPWM0_CH2 - * | | |17 = PSIO0_CH3 - * |[12:8] |PE5MFP |PE.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nRD - * | | |03 = SD0_DAT3 - * | | |04 = SPIM_SS - * | | |05 = SPI3_SS - * | | |06 = SC0_PWR - * | | |07 = USCI0_CTL1 - * | | |08 = UART6_TXD - * | | |09 = UART7_nRTS - * | | |10 = UART9_TXD - * | | |11 = EQEI1_B - * | | |12 = EPWM0_CH2 - * | | |13 = BPWM0_CH3 - * | | |17 = PSIO0_CH2 - * |[20:16] |PE6MFP |PE.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SD0_CLK - * | | |04 = SPIM_D3 - * | | |05 = SPI3_I2SMCLK - * | | |06 = SC0_nCD - * | | |07 = USCI0_CTL0 - * | | |08 = UART5_RXD - * | | |09 = CAN1_RXD - * | | |10 = UART9_nRTS - * | | |11 = EQEI1_A - * | | |12 = EPWM0_CH1 - * | | |13 = BPWM0_CH4 - * | | |14 = ACMP3_O - * | | |17 = PSIO0_CH1 - * |[28:24] |PE7MFP |PE.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SD0_CMD - * | | |04 = SPIM_D2 - * | | |08 = UART5_TXD - * | | |09 = CAN1_TXD - * | | |10 = UART9_nCTS - * | | |11 = EQEI1_INDEX - * | | |12 = EPWM0_CH0 - * | | |13 = BPWM0_CH5 - * | | |14 = ACMP2_O - * | | |17 = PSIO0_CH0 - * @var SYS_T::GPE_MFP2 - * Offset: 0x548 GPIOE Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PE8MFP |PE.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR10 - * | | |03 = EMAC0_RMII_MDC - * | | |04 = I2S0_BCLK - * | | |05 = SPI2_CLK - * | | |07 = UART2_TXD - * | | |10 = EPWM0_CH0 - * | | |11 = EPWM0_BRAKE0 - * | | |12 = ECAP0_IC0 - * | | |13 = EQEI2_INDEX - * | | |14 = TRACE_DATA3 - * | | |15 = ECAP3_IC0 - * |[12:8] |PE9MFP |PE.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR11 - * | | |03 = EMAC0_RMII_MDIO - * | | |04 = I2S0_MCLK - * | | |05 = SPI2_MISO - * | | |07 = UART2_RXD - * | | |10 = EPWM0_CH1 - * | | |11 = EPWM0_BRAKE1 - * | | |12 = ECAP0_IC1 - * | | |13 = EQEI2_A - * | | |14 = TRACE_DATA2 - * | | |15 = ECAP3_IC1 - * |[20:16] |PE10MFP |PE.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR12 - * | | |03 = EMAC_RMII_TXD0 - * | | |04 = I2S0_DI - * | | |05 = SPI2_MOSI - * | | |07 = UART3_TXD - * | | |10 = EPWM0_CH2 - * | | |11 = EPWM1_BRAKE0 - * | | |12 = ECAP0_IC2 - * | | |13 = EQEI2_B - * | | |14 = TRACE_DATA1 - * | | |15 = ECAP3_IC2 - * |[28:24] |PE11MFP |PE.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR13 - * | | |03 = EMAC0_RMII_TXD1 - * | | |04 = I2S0_DO - * | | |05 = SPI2_SS - * | | |07 = UART3_RXD - * | | |08 = UART1_nCTS - * | | |10 = EPWM0_CH3 - * | | |11 = EPWM1_BRAKE1 - * | | |13 = ECAP1_IC2 - * | | |14 = TRACE_DATA0 - * | | |18 = KPI_COL7 - * @var SYS_T::GPE_MFP3 - * Offset: 0x54C GPIOE Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PE12MFP |PE.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR14 - * | | |03 = EMAC0_RMII_TXEN - * | | |04 = I2S0_LRCK - * | | |05 = SPI2_I2SMCLK - * | | |08 = UART1_nRTS - * | | |10 = EPWM0_CH4 - * | | |13 = ECAP1_IC1 - * | | |14 = TRACE_CLK - * | | |18 = KPI_COL6 - * |[12:8] |PE13MFP |PE.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR15 - * | | |03 = EMAC0_PPS - * | | |04 = I2C0_SCL - * | | |05 = UART4_nRTS - * | | |08 = UART1_TXD - * | | |10 = EPWM0_CH5 - * | | |11 = EPWM1_CH0 - * | | |12 = BPWM1_CH5 - * | | |13 = ECAP1_IC0 - * | | |14 = TRACE_SWO - * | | |18 = KPI_COL5 - * |[20:16] |PE14MFP |PE.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD8 - * | | |03 = UART2_TXD - * | | |04 = CAN0_TXD - * | | |05 = SD1_nCD - * | | |06 = UART6_TXD - * | | |17 = PSIO0_CH0 - * |[28:24] |PE15MFP |PE.15 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD9 - * | | |03 = UART2_RXD - * | | |04 = CAN0_RXD - * | | |06 = UART6_RXD - * | | |17 = PSIO0_CH1 - * @var SYS_T::GPF_MFP0 - * Offset: 0x550 GPIOF Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PF0MFP |PF.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = UART1_TXD - * | | |03 = I2C1_SCL - * | | |04 = UART0_TXD - * | | |05 = SC1_DAT - * | | |06 = I2S0_DO - * | | |08 = UART2_TXD - * | | |09 = I2C0_SCL - * | | |10 = CAN2_TXD - * | | |11 = EPWM1_CH4 - * | | |12 = BPWM1_CH0 - * | | |13 = ACMP0_O - * | | |14 = ICE_DAT - * | | |15 = EADC0_ST - * | | |19 = QSPI1_MISO0 (for M460LD) - * |[12:8] |PF1MFP |PF.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = UART1_RXD - * | | |03 = I2C1_SDA - * | | |04 = UART0_RXD - * | | |05 = SC1_CLK - * | | |06 = I2S0_LRCK - * | | |08 = UART2_RXD - * | | |09 = I2C0_SDA - * | | |10 = CAN2_RXD - * | | |11 = EPWM1_CH5 - * | | |12 = BPWM1_CH1 - * | | |13 = ACMP1_O - * | | |14 = ICE_CLK - * | | |15 = EADC1_ST - * | | |19 = QSPI1_MOSI0 (for M460LD) - * |[20:16] |PF2MFP |PF.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nCS1 - * | | |03 = UART0_RXD - * | | |04 = I2C0_SDA - * | | |05 = QSPI0_CLK - * | | |07 = UART9_RXD - * | | |10 = XT1_OUT - * | | |11 = BPWM1_CH1 - * | | |12 = I2C4_SMBSUS - * | | |13 = ACMP3_O - * | | |20 = BMC13 - * |[28:24] |PF3MFP |PF.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nCS0 - * | | |03 = UART0_TXD - * | | |04 = I2C0_SCL - * | | |07 = UART9_TXD - * | | |10 = XT1_IN - * | | |11 = BPWM1_CH0 - * | | |12 = I2C4_SMBAL - * | | |13 = ACMP2_O - * | | |15 = EADC2_ST - * | | |20 = BMC12 - * @var SYS_T::GPF_MFP1 - * Offset: 0x554 GPIOF Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PF4MFP |PF.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = UART2_TXD - * | | |03 = EBI_AD0 - * | | |04 = UART2_nRTS - * | | |07 = EPWM0_CH1 - * | | |08 = BPWM0_CH5 - * | | |10 = X32_OUT - * | | |11 = EADC1_ST - * | | |12 = I2C4_SDA - * | | |13 = EQEI2_B - * | | |19 = SPI5_MISO - * | | |20 = BMC11 - * |[12:8] |PF5MFP |PF.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = UART2_RXD - * | | |03 = EBI_AD1 - * | | |04 = UART2_nCTS - * | | |07 = EPWM0_CH0 - * | | |08 = BPWM0_CH4 - * | | |09 = EPWM0_SYNC_OUT - * | | |10 = X32_IN - * | | |11 = EADC0_ST - * | | |12 = I2C4_SCL - * | | |13 = EQEI2_A - * | | |19 = SPI5_MOSI - * | | |20 = BMC10 - * |[20:16] |PF6MFP |PF.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR19 - * | | |03 = SC0_CLK - * | | |04 = I2S0_LRCK - * | | |05 = SPI0_MOSI - * | | |06 = UART4_RXD - * | | |07 = EBI_nCS0 - * | | |08 = CAN2_RXD - * | | |09 = SPI3_I2SMCLK - * | | |10 = TAMPER0 - * | | |13 = EQEI2_INDEX - * | | |14 = TRACE_SWO - * | | |19 = SPI5_CLK - * |[28:24] |PF7MFP |PF.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR18 - * | | |03 = SC0_DAT - * | | |04 = I2S0_DO - * | | |05 = SPI0_MISO - * | | |06 = UART4_TXD - * | | |07 = CCAP_DATA0 - * | | |08 = CAN2_TXD - * | | |10 = TAMPER1 - * | | |19 = SPI5_SS - - * @var SYS_T::GPF_MFP2 - * Offset: 0x558 GPIOF Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PF8MFP |PF.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR17 - * | | |03 = SC0_RST - * | | |04 = I2S0_DI - * | | |05 = SPI0_CLK - * | | |06 = UART5_nCTS - * | | |07 = CCAP_DATA1 - * | | |08 = CAN1_RXD - * | | |10 = TAMPER2 - * | | |11 = UART9_RXD - * |[12:8] |PF9MFP |PF.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR16 - * | | |03 = SC0_PWR - * | | |04 = I2S0_MCLK - * | | |05 = SPI0_SS - * | | |06 = UART5_nRTS - * | | |07 = CCAP_DATA2 - * | | |08 = CAN1_TXD - * | | |10 = TAMPER3 - * | | |11 = UART9_TXD - * |[20:16] |PF10MFP |PF.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR15 - * | | |03 = SC0_nCD - * | | |04 = I2S0_BCLK - * | | |05 = SPI0_I2SMCLK - * | | |06 = UART5_RXD - * | | |07 = CCAP_DATA3 - * | | |08 = CAN3_RXD - * | | |10 = TAMPER4 - * | | |11 = UART9_nRTS - * |[28:24] |PF11MFP |PF.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR14 - * | | |03 = SPI2_MOSI - * | | |06 = UART5_TXD - * | | |07 = CCAP_DATA4 - * | | |08 = CAN3_TXD - * | | |10 = TAMPER5 - * | | |11 = UART9_nCTS - * | | |13 = TM3 - * @var SYS_T::GPF_MFP3 - * Offset: 0x55C GPIOF Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PF12MFP |PF.12 Multi-function Pin Selection - * |[12:8] |PF13MFP |PF.13 Multi-function Pin Selection - * |[20:16] |PF14MFP |PF.14 Multi-function Pin Selection - * |[28:24] |PF15MFP |PF.15 Multi-function Pin Selection - * @var SYS_T::GPG_MFP0 - * Offset: 0x560 GPIOG Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PG0MFP |PG.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR8 - * | | |04 = I2C0_SCL - * | | |05 = I2C1_SMBAL - * | | |06 = UART2_RXD - * | | |07 = CAN1_TXD - * | | |08 = UART1_TXD - * | | |09 = I2C3_SCL - * |[12:8] |PG1MFP |PG.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR9 - * | | |03 = SPI2_I2SMCLK - * | | |04 = I2C0_SDA - * | | |05 = I2C1_SMBSUS - * | | |06 = UART2_TXD - * | | |07 = CAN1_RXD - * | | |08 = UART1_RXD - * | | |09 = I2C3_SDA - * |[20:16] |PG2MFP |PG.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR11 - * | | |03 = SPI2_SS - * | | |04 = I2C0_SMBAL - * | | |05 = I2C1_SCL - * | | |07 = CCAP_DATA7 - * | | |09 = I2C3_SMBAL - * | | |13 = TM0 - * |[28:24] |PG3MFP |PG.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR12 - * | | |03 = SPI2_CLK - * | | |04 = I2C0_SMBSUS - * | | |05 = I2C1_SDA - * | | |07 = CCAP_DATA6 - * | | |09 = I2C3_SMBSUS - * | | |13 = TM1 - * @var SYS_T::GPG_MFP1 - * Offset: 0x564 GPIOG Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PG4MFP |PG.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR13 - * | | |03 = SPI2_MISO - * | | |07 = CCAP_DATA5 - * | | |13 = TM2 - * |[12:8] |PG5MFP |PG.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nCS1 - * | | |03 = SPI3_SS - * | | |04 = SC1_PWR - * | | |08 = I2C3_SMBAL - * | | |10 = I2S1_MCLK - * | | |11 = EPWM0_CH3 - * |[20:16] |PG6MFP |PG.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nCS2 - * | | |03 = SPI3_CLK - * | | |04 = SC1_RST - * | | |08 = I2C3_SMBSUS - * | | |10 = I2S1_DI - * | | |11 = EPWM0_CH2 - * |[28:24] |PG7MFP |PG.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nWRL - * | | |03 = SPI3_MISO - * | | |04 = SC1_DAT - * | | |08 = I2C3_SCL - * | | |10 = I2S1_DO - * | | |11 = EPWM0_CH1 - * @var SYS_T::GPG_MFP2 - * Offset: 0x568 GPIOG Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PG8MFP |PG.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nWRH - * | | |03 = SPI3_MOSI - * | | |04 = SC1_CLK - * | | |08 = I2C3_SDA - * | | |10 = I2S1_LRCK - * | | |11 = EPWM0_CH0 - * |[12:8] |PG9MFP |PG.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD0 - * | | |03 = SD1_DAT3 - * | | |04 = SPIM_D2 - * | | |05 = QSPI1_MISO1 - * | | |07 = CCAP_PIXCLK - * | | |08 = I2C4_SCL - * | | |09 = ECAP2_IC0 - * | | |12 = BPWM0_CH5 - * | | |16 = HBI_D4 - * | | |19 = SPI8_SS - * | | |20 = BMC16 - * |[20:16] |PG10MFP |PG.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD1 - * | | |03 = SD1_DAT2 - * | | |04 = SPIM_D3 - * | | |05 = QSPI1_MOSI1 - * | | |07 = CCAP_SCLK - * | | |08 = I2C4_SDA - * | | |09 = ECAP2_IC1 - * | | |12 = BPWM0_CH4 - * | | |16 = HBI_D3 - * | | |19 = SPI8_CLK - * | | |20 = BMC17 - * |[28:24] |PG11MFP |PG.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD2 - * | | |03 = SD1_DAT1 - * | | |04 = SPIM_SS - * | | |05 = QSPI1_SS - * | | |06 = UART7_TXD - * | | |07 = CCAP_SFIELD - * | | |08 = I2C4_SMBAL - * | | |09 = ECAP2_IC2 - * | | |12 = BPWM0_CH3 - * | | |16 = HBI_D0 - * | | |19 = SPI8_MOSI - * | | |20 = BMC18 - * @var SYS_T::GPG_MFP3 - * Offset: 0x56C GPIOG Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PG12MFP |PG.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD3 - * | | |03 = SD1_DAT0 - * | | |04 = SPIM_CLK - * | | |05 = QSPI1_CLK - * | | |06 = UART7_RXD - * | | |07 = CCAP_VSYNC - * | | |08 = I2C4_SMBSUS - * | | |12 = BPWM0_CH2 - * | | |16 = HBI_D1 - * | | |19 = SPI8_MISO - * | | |20 = BMC19 - * |[12:8] |PG13MFP |PG.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD4 - * | | |03 = SD1_CMD - * | | |04 = SPIM_MISO - * | | |05 = QSPI1_MISO0 - * | | |06 = UART6_TXD - * | | |07 = CCAP_HSYNC - * | | |12 = BPWM0_CH1 - * | | |16 = HBI_D5 - * |[20:16] |PG14MFP |PG.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD5 - * | | |03 = SD1_CLK - * | | |04 = SPIM_MOSI - * | | |05 = QSPI1_MOSI0 - * | | |06 = UART6_RXD - * | | |12 = BPWM0_CH0 - * | | |16 = HBI_D6 - * |[28:24] |PG15MFP |PG.15 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SD1_nCD - * | | |14 = CLKO - * | | |15 = EADC0_ST - * | | |16 = HBI_D7 - * | | |19 = QSPI1_MISO1 (for M460LD) - * @var SYS_T::GPH_MFP0 - * Offset: 0x570 GPIOH Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PH0MFP |PH.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR7 - * | | |04 = UART5_TXD - * | | |13 = TM0_EXT - * |[12:8] |PH1MFP |PH.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR6 - * | | |04 = UART5_RXD - * | | |13 = TM1_EXT - * |[20:16] |PH2MFP |PH.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR5 - * | | |04 = UART5_nRTS - * | | |05 = UART4_TXD - * | | |06 = I2C0_SCL - * | | |13 = TM2_EXT - * |[28:24] |PH3MFP |PH.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR4 - * | | |03 = SPI1_I2SMCLK - * | | |04 = UART5_nCTS - * | | |05 = UART4_RXD - * | | |06 = I2C0_SDA - * | | |13 = TM3_EXT - * @var SYS_T::GPH_MFP1 - * Offset: 0x574 GPIOH Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PH4MFP |PH.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR3 - * | | |03 = SPI1_MISO - * | | |04 = UART7_nRTS - * | | |05 = UART6_TXD - * |[12:8] |PH5MFP |PH.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR2 - * | | |03 = SPI1_MOSI - * | | |04 = UART7_nCTS - * | | |05 = UART6_RXD - * |[20:16] |PH6MFP |PH.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR1 - * | | |03 = SPI1_CLK - * | | |04 = UART7_TXD - * | | |07 = UART9_nCTS - * |[28:24] |PH7MFP |PH.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ADR0 - * | | |03 = SPI1_SS - * | | |04 = UART7_RXD - * | | |07 = UART9_nRTS - * @var SYS_T::GPH_MFP2 - * Offset: 0x578 GPIOH Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PH8MFP |PH.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD12 - * | | |03 = QSPI0_CLK - * | | |04 = SC2_PWR - * | | |05 = I2S0_DI - * | | |06 = SPI1_CLK - * | | |07 = UART3_nRTS - * | | |08 = I2C1_SMBAL - * | | |09 = I2C2_SCL - * | | |10 = UART1_TXD - * | | |13 = UART9_nCTS - * |[12:8] |PH9MFP |PH.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD13 - * | | |03 = QSPI0_SS - * | | |04 = SC2_RST - * | | |05 = I2S0_DO - * | | |06 = SPI1_SS - * | | |07 = UART3_nCTS - * | | |08 = I2C1_SMBSUS - * | | |09 = I2C2_SDA - * | | |10 = UART1_RXD - * | | |13 = UART9_nRTS - * |[20:16] |PH10MFP |PH.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD14 - * | | |03 = QSPI0_MISO1 - * | | |04 = SC2_nCD - * | | |05 = I2S0_LRCK - * | | |06 = SPI1_I2SMCLK - * | | |07 = UART4_TXD - * | | |08 = UART0_TXD - * | | |13 = UART9_TXD - * |[28:24] |PH11MFP |PH.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD15 - * | | |03 = QSPI0_MOSI1 - * | | |07 = UART4_RXD - * | | |08 = UART0_RXD - * | | |11 = EPWM0_CH5 - * | | |13 = UART9_RXD - * @var SYS_T::GPH_MFP3 - * Offset: 0x57C GPIOH Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PH12MFP |PH.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD0 - * | | |03 = UART9_TXD - * | | |06 = QSPI1_MISO1 - * | | |07 = CCAP_PIXCLK - * | | |10 = CAN3_TXD - * | | |16 = HBI_nCK - * |[12:8] |PH13MFP |PH.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD1 - * | | |03 = UART9_RXD - * | | |06 = QSPI1_MOSI1 - * | | |07 = CCAP_SCLK - * | | |10 = CAN3_RXD - * | | |16 = HBI_CK - * |[20:16] |PH14MFP |PH.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD2 - * | | |06 = QSPI1_SS - * | | |07 = CCAP_SFIELD - * | | |16 = HBI_RWDS - * |[28:24] |PH15MFP |PH.15 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD3 - * | | |06 = QSPI1_CLK - * | | |07 = CCAP_VSYNC - * | | |16 = HBI_D4 - * @var SYS_T::GPI_MFP0 - * Offset: 0x580 GPIOI Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PI0MFP |PI.0 Multi-function Pin Selection - * |[12:8] |PI1MFP |PI.1 Multi-function Pin Selection - * |[20:16] |PI2MFP |PI.2 Multi-function Pin Selection - * |[28:24] |PI3MFP |PI.3 Multi-function Pin Selection - * @var SYS_T::GPI_MFP1 - * Offset: 0x584 GPIOI Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PI4MFP |PI.4 Multi-function Pin Selection - * |[12:8] |PI5MFP |PI.5 Multi-function Pin Selection - * |[20:16] |PI6MFP |PI.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |05 = SC1_nCD - * | | |06 = I2S0_BCLK - * | | |07 = SPI1_I2SMCLK - * | | |08 = UART2_TXD - * | | |09 = I2C1_SCL - * | | |13 = CAN3_TXD - * | | |15 = USB_VBUS_ST - * |[28:24] |PI7MFP |PI.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |05 = SC1_PWR - * | | |06 = I2S0_MCLK - * | | |07 = SPI1_MISO - * | | |08 = UART2_RXD - * | | |09 = I2C1_SDA - * | | |13 = CAN3_RXD - * | | |15 = USB_VBUS_EN - * @var SYS_T::GPI_MFP2 - * Offset: 0x588 GPIOI Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PI8MFP |PI.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |05 = SC1_RST - * | | |06 = I2S0_DI - * | | |07 = SPI1_MOSI - * | | |08 = UART2_nRTS - * | | |09 = I2C0_SMBAL - * | | |13 = CAN2_TXD - * |[12:8] |PI9MFP |PI.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |05 = SC1_DAT - * | | |06 = I2S0_DO - * | | |07 = SPI1_CLK - * | | |08 = UART2_nCTS - * | | |09 = I2C0_SMBSUS - * | | |13 = CAN2_RXD - * |[20:16] |PI10MFP |PI.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |05 = SC1_CLK - * | | |06 = I2S0_LRCK - * | | |07 = SPI1_SS - * | | |08 = UART2_TXD - * | | |09 = I2C0_SCL - * | | |13 = CAN3_TXD - * |[28:24] |PI11MFP |PI.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |08 = UART2_RXD - * | | |09 = I2C0_SDA - * | | |13 = CAN3_RXD - * @var SYS_T::GPI_MFP3 - * Offset: 0x58C GPIOI Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PI12MFP |PI.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SPIM_SS - * | | |04 = QSPI0_MISO1 - * | | |10 = CAN0_TXD - * | | |11 = UART4_TXD - * | | |12 = EPWM1_CH0 - * | | |15 = I2C3_SMBAL - * |[12:8] |PI13MFP |PI.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SPIM_MISO - * | | |04 = QSPI0_MOSI1 - * | | |10 = CAN0_RXD - * | | |11 = UART4_RXD - * | | |12 = EPWM1_CH1 - * | | |15 = I2C3_SMBSUS - * |[20:16] |PI14MFP |PI.14 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SPIM_D2 - * | | |04 = QSPI0_SS - * | | |07 = UART8_nCTS - * | | |10 = CAN1_TXD - * | | |11 = UART3_TXD - * | | |12 = EPWM1_CH2 - * | | |15 = I2C3_SCL - * |[28:24] |PI15MFP |PI.15 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SPIM_D3 - * | | |04 = QSPI0_CLK - * | | |07 = UART8_nRTS - * | | |10 = CAN1_RXD - * | | |11 = UART3_RXD - * | | |12 = EPWM1_CH3 - * | | |15 = I2C3_SDA - * @var SYS_T::GPJ_MFP0 - * Offset: 0x590 GPIOJ Multiple Function Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PJ0MFP |PJ.0 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SPIM_CLK - * | | |04 = QSPI0_MISO0 - * | | |07 = UART8_TXD - * | | |10 = CAN2_TXD - * | | |12 = EPWM1_CH4 - * |[12:8] |PJ1MFP |PJ.1 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SPIM_MOSI - * | | |04 = QSPI0_MOSI0 - * | | |07 = UART8_RXD - * | | |10 = CAN2_RXD - * | | |12 = EPWM1_CH5 - * |[20:16] |PJ2MFP |PJ.2 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD5 - * | | |03 = UART8_nCTS - * | | |06 = QSPI1_SS - * | | |07 = CCAP_DATA5 - * | | |10 = CAN0_TXD - * | | |16 = HBI_nRESET - * |[28:24] |PJ3MFP |PJ.3 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD4 - * | | |03 = UART8_nRTS - * | | |06 = QSPI1_CLK - * | | |07 = CCAP_DATA4 - * | | |10 = CAN0_RXD - * | | |16 = HBI_D7 - * @var SYS_T::GPJ_MFP1 - * Offset: 0x594 GPIOJ Multiple Function Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PJ4MFP |PJ.4 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD3 - * | | |03 = UART8_TXD - * | | |06 = QSPI1_MISO0 - * | | |07 = CCAP_DATA3 - * | | |10 = CAN1_TXD - * | | |16 = HBI_D2 - * |[12:8] |PJ5MFP |PJ.5 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD2 - * | | |03 = UART8_RXD - * | | |06 = QSPI1_MOSI0 - * | | |07 = CCAP_DATA2 - * | | |10 = CAN1_RXD - * | | |16 = HBI_D1 - * |[20:16] |PJ6MFP |PJ.6 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD1 - * | | |03 = UART9_nCTS - * | | |07 = CCAP_DATA1 - * | | |10 = CAN2_TXD - * | | |16 = HBI_D0 - * |[28:24] |PJ7MFP |PJ.7 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_AD0 - * | | |03 = UART9_nRTS - * | | |07 = CCAP_DATA0 - * | | |10 = CAN2_RXD - * | | |16 = HBI_nCS - * @var SYS_T::GPJ_MFP2 - * Offset: 0x598 GPIOJ Multiple Function Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PJ8MFP |PJ.8 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nRD - * | | |03 = SD1_DAT3 - * | | |04 = SPIM_SS - * | | |06 = UART7_TXD - * | | |11 = CAN2_TXD - * | | |12 = BPWM0_CH5 - * |[12:8] |PJ9MFP |PJ.9 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nWR - * | | |03 = SD1_DAT2 - * | | |04 = SPIM_MISO - * | | |06 = UART7_RXD - * | | |11 = CAN2_RXD - * | | |12 = BPWM0_CH4 - * |[20:16] |PJ10MFP |PJ.10 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_MCLK - * | | |03 = SD1_DAT1 - * | | |04 = SPIM_D2 - * | | |06 = UART6_TXD - * | | |08 = I2C4_SCL - * | | |09 = ECAP2_IC0 - * | | |11 = CAN0_TXD - * | | |12 = BPWM0_CH3 - * |[28:24] |PJ11MFP |PJ.11 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_ALE - * | | |03 = SD1_DAT0 - * | | |04 = SPIM_D3 - * | | |06 = UART6_RXD - * | | |08 = I2C4_SDA - * | | |09 = ECAP2_IC1 - * | | |11 = CAN0_RXD - * | | |12 = BPWM0_CH2 - * @var SYS_T::GPJ_MFP3 - * Offset: 0x59C GPIOJ Multiple Function Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PJ12MFP |PJ.12 Multi-function Pin Selection - * | | |00 = GPIO - * | | |02 = EBI_nCS0 - * | | |03 = SD1_CMD - * | | |04 = SPIM_CLK - * | | |08 = I2C4_SMBAL - * | | |09 = ECAP2_IC2 - * | | |11 = CAN1_TXD - * | | |12 = BPWM0_CH1 - * | | |15 = HSUSB_VBUS_ST - * |[12:8] |PJ13MFP |PJ.13 Multi-function Pin Selection - * | | |00 = GPIO - * | | |03 = SD1_CLK - * | | |04 = SPIM_MOSI - * | | |08 = I2C4_SMBSUS - * | | |11 = CAN1_RXD - * | | |12 = BPWM0_CH0 - * | | |15 = HSUSB_VBUS_EN - */ - __I uint32_t PDID; /*!< [0x0000] Part Device Identification Number Register */ - __IO uint32_t RSTSTS; /*!< [0x0004] System Reset Status Register */ - __IO uint32_t IPRST0; /*!< [0x0008] Peripheral Reset Control Register 0 */ - __IO uint32_t IPRST1; /*!< [0x000c] Peripheral Reset Control Register 1 */ - __IO uint32_t IPRST2; /*!< [0x0010] Peripheral Reset Control Register 2 */ - __I uint32_t RESERVE0[1]; - __IO uint32_t BODCTL; /*!< [0x0018] Brown-out Detector Control Register */ - __IO uint32_t IVSCTL; /*!< [0x001c] Internal Voltage Source Control Register */ - __IO uint32_t IPRST3; /*!< [0x0020] Peripheral Reset Control Register 3 */ - __IO uint32_t PORCTL; /*!< [0x0024] Power-On-reset Controller Register */ - __IO uint32_t VREFCTL; /*!< [0x0028] VREF Control Register */ - __IO uint32_t USBPHY; /*!< [0x002c] USB PHY Control Register */ - __I uint32_t RESERVE1[20]; - __IO uint32_t GPA_MFOS; /*!< [0x0080] GPIOA Multiple Function Output Select Register */ - __IO uint32_t GPB_MFOS; /*!< [0x0084] GPIOB Multiple Function Output Select Register */ - __IO uint32_t GPC_MFOS; /*!< [0x0088] GPIOC Multiple Function Output Select Register */ - __IO uint32_t GPD_MFOS; /*!< [0x008c] GPIOD Multiple Function Output Select Register */ - __IO uint32_t GPE_MFOS; /*!< [0x0090] GPIOE Multiple Function Output Select Register */ - __IO uint32_t GPF_MFOS; /*!< [0x0094] GPIOF Multiple Function Output Select Register */ - __IO uint32_t GPG_MFOS; /*!< [0x0098] GPIOG Multiple Function Output Select Register */ - __IO uint32_t GPH_MFOS; /*!< [0x009c] GPIOH Multiple Function Output Select Register */ - __IO uint32_t GPI_MFOS; /*!< [0x00A0] GPIOI Multiple Function Output Select Register */ - __IO uint32_t GPJ_MFOS; /*!< [0x00A4] GPIOJ Multiple Function Output Select Register */ - __I uint32_t RESERVE2[2]; - __I uint32_t RESERVE3[4]; - __IO uint32_t SRAM_INTCTL; /*!< [0x00c0] System SRAM Interrupt Enable Control Register */ - __IO uint32_t SRAM_STATUS; /*!< [0x00c4] System SRAM Parity Error Status Register */ - __I uint32_t SRAM_ERRADDR; /*!< [0x00c8] System SRAM Parity Check Error Address Register */ - __I uint32_t RESERVE4[1]; - __IO uint32_t SRAM_BISTCTL; /*!< [0x00d0] System SRAM BIST Test Control Register */ - __I uint32_t SRAM_BISTSTS; /*!< [0x00d4] System SRAM BIST Test Status Register */ - __I uint32_t RESERVE5[3]; - __IO uint32_t HIRCTCTL; /*!< [0x00e4] HIRC48M Trim Control Register */ - __IO uint32_t HIRCTIEN; /*!< [0x00e8] HIRC48M Trim Interrupt Enable Register */ - __IO uint32_t HIRCTISTS; /*!< [0x00ec] HIRC48M Trim Interrupt Status Register */ - __IO uint32_t IRCTCTL; /*!< [0x00f0] HIRC Trim Control Register */ - __IO uint32_t IRCTIEN; /*!< [0x00f4] HIRC Trim Interrupt Enable Register */ - __IO uint32_t IRCTISTS; /*!< [0x00f8] HIRC Trim Interrupt Status Register */ - __I uint32_t RESERVE6[1]; - __O uint32_t REGLCTL; /*!< [0x0100] Register Lock Control Register */ - __I uint32_t RESERVE7[58]; - __IO uint32_t PORDISAN; /*!< [0x01ec] Analog POR Disable Control Register */ - __I uint32_t RESERVE8[1]; - __I uint32_t CSERVER; /*!< [0x01f4] Chip Series Version Register */ - __IO uint32_t PLCTL; /*!< [0x01f8] Power Level Control Register */ - __I uint32_t PLSTS; /*!< [0x01fc] Power Level Status Register */ - __I uint32_t RESERVE9[128]; - __IO uint32_t AHBMCTL; /*!< [0x0400] AHB Bus Matrix Priority Control Register */ - __I uint32_t RESERVE10[63]; - __IO uint32_t GPA_MFP0; /*!< [0x0500] GPIOA Multiple Function Control Register 0 */ - __IO uint32_t GPA_MFP1; /*!< [0x0504] GPIOA Multiple Function Control Register 1 */ - __IO uint32_t GPA_MFP2; /*!< [0x0508] GPIOA Multiple Function Control Register 2 */ - __IO uint32_t GPA_MFP3; /*!< [0x050c] GPIOA Multiple Function Control Register 3 */ - __IO uint32_t GPB_MFP0; /*!< [0x0510] GPIOB Multiple Function Control Register 0 */ - __IO uint32_t GPB_MFP1; /*!< [0x0514] GPIOB Multiple Function Control Register 1 */ - __IO uint32_t GPB_MFP2; /*!< [0x0518] GPIOB Multiple Function Control Register 2 */ - __IO uint32_t GPB_MFP3; /*!< [0x051c] GPIOB Multiple Function Control Register 3 */ - __IO uint32_t GPC_MFP0; /*!< [0x0520] GPIOC Multiple Function Control Register 0 */ - __IO uint32_t GPC_MFP1; /*!< [0x0524] GPIOC Multiple Function Control Register 1 */ - __IO uint32_t GPC_MFP2; /*!< [0x0528] GPIOC Multiple Function Control Register 2 */ - __IO uint32_t GPC_MFP3; /*!< [0x052c] GPIOC Multiple Function Control Register 3 */ - __IO uint32_t GPD_MFP0; /*!< [0x0530] GPIOD Multiple Function Control Register 0 */ - __IO uint32_t GPD_MFP1; /*!< [0x0534] GPIOD Multiple Function Control Register 1 */ - __IO uint32_t GPD_MFP2; /*!< [0x0538] GPIOD Multiple Function Control Register 2 */ - __IO uint32_t GPD_MFP3; /*!< [0x053c] GPIOD Multiple Function Control Register 3 */ - __IO uint32_t GPE_MFP0; /*!< [0x0540] GPIOE Multiple Function Control Register 0 */ - __IO uint32_t GPE_MFP1; /*!< [0x0544] GPIOE Multiple Function Control Register 1 */ - __IO uint32_t GPE_MFP2; /*!< [0x0548] GPIOE Multiple Function Control Register 2 */ - __IO uint32_t GPE_MFP3; /*!< [0x054c] GPIOE Multiple Function Control Register 3 */ - __IO uint32_t GPF_MFP0; /*!< [0x0550] GPIOF Multiple Function Control Register 0 */ - __IO uint32_t GPF_MFP1; /*!< [0x0554] GPIOF Multiple Function Control Register 1 */ - __IO uint32_t GPF_MFP2; /*!< [0x0558] GPIOF Multiple Function Control Register 2 */ - __IO uint32_t GPF_MFP3; /*!< [0x055c] GPIOF Multiple Function Control Register 3 */ - __IO uint32_t GPG_MFP0; /*!< [0x0560] GPIOG Multiple Function Control Register 0 */ - __IO uint32_t GPG_MFP1; /*!< [0x0564] GPIOG Multiple Function Control Register 1 */ - __IO uint32_t GPG_MFP2; /*!< [0x0568] GPIOG Multiple Function Control Register 2 */ - __IO uint32_t GPG_MFP3; /*!< [0x056c] GPIOG Multiple Function Control Register 3 */ - __IO uint32_t GPH_MFP0; /*!< [0x0570] GPIOH Multiple Function Control Register 0 */ - __IO uint32_t GPH_MFP1; /*!< [0x0574] GPIOH Multiple Function Control Register 1 */ - __IO uint32_t GPH_MFP2; /*!< [0x0578] GPIOH Multiple Function Control Register 2 */ - __IO uint32_t GPH_MFP3; /*!< [0x057c] GPIOH Multiple Function Control Register 3 */ - __IO uint32_t GPI_MFP0; /*!< [0x0580] GPIOI Multiple Function Control Register 0 */ - __IO uint32_t GPI_MFP1; /*!< [0x0584] GPIOI Multiple Function Control Register 1 */ - __IO uint32_t GPI_MFP2; /*!< [0x0588] GPIOI Multiple Function Control Register 2 */ - __IO uint32_t GPI_MFP3; /*!< [0x058c] GPIOI Multiple Function Control Register 3 */ - __IO uint32_t GPJ_MFP0; /*!< [0x0590] GPIOJ Multiple Function Control Register 0 */ - __IO uint32_t GPJ_MFP1; /*!< [0x0594] GPIOJ Multiple Function Control Register 1 */ - __IO uint32_t GPJ_MFP2; /*!< [0x0598] GPIOJ Multiple Function Control Register 2 */ - __IO uint32_t GPJ_MFP3; /*!< [0x059c] GPIOJ Multiple Function Control Register 3 */ - -} SYS_T; - -/** - @addtogroup SYS_CONST SYS Bit Field Definition - Constant Definitions for SYS Controller -@{ */ - -#define SYS_PDID_PDID_Pos (0) /*!< SYS_T::PDID: PDID Position */ -#define SYS_PDID_PDID_Msk (0xfffffffful << SYS_PDID_PDID_Pos) /*!< SYS_T::PDID: PDID Mask */ - -#define SYS_RSTSTS_PORF_Pos (0) /*!< SYS_T::RSTSTS: PORF Position */ -#define SYS_RSTSTS_PORF_Msk (0x1ul << SYS_RSTSTS_PORF_Pos) /*!< SYS_T::RSTSTS: PORF Mask */ - -#define SYS_RSTSTS_PINRF_Pos (1) /*!< SYS_T::RSTSTS: PINRF Position */ -#define SYS_RSTSTS_PINRF_Msk (0x1ul << SYS_RSTSTS_PINRF_Pos) /*!< SYS_T::RSTSTS: PINRF Mask */ - -#define SYS_RSTSTS_WDTRF_Pos (2) /*!< SYS_T::RSTSTS: WDTRF Position */ -#define SYS_RSTSTS_WDTRF_Msk (0x1ul << SYS_RSTSTS_WDTRF_Pos) /*!< SYS_T::RSTSTS: WDTRF Mask */ - -#define SYS_RSTSTS_LVRF_Pos (3) /*!< SYS_T::RSTSTS: LVRF Position */ -#define SYS_RSTSTS_LVRF_Msk (0x1ul << SYS_RSTSTS_LVRF_Pos) /*!< SYS_T::RSTSTS: LVRF Mask */ - -#define SYS_RSTSTS_BODRF_Pos (4) /*!< SYS_T::RSTSTS: BODRF Position */ -#define SYS_RSTSTS_BODRF_Msk (0x1ul << SYS_RSTSTS_BODRF_Pos) /*!< SYS_T::RSTSTS: BODRF Mask */ - -#define SYS_RSTSTS_MCURF_Pos (5) /*!< SYS_T::RSTSTS: MCURF Position */ -#define SYS_RSTSTS_MCURF_Msk (0x1ul << SYS_RSTSTS_MCURF_Pos) /*!< SYS_T::RSTSTS: MCURF Mask */ - -#define SYS_RSTSTS_HRESETRF_Pos (6) /*!< SYS_T::RSTSTS: HRESETRF Position */ -#define SYS_RSTSTS_HRESETRF_Msk (0x1ul << SYS_RSTSTS_HRESETRF_Pos) /*!< SYS_T::RSTSTS: HRESETRF Mask */ - -#define SYS_RSTSTS_CPURF_Pos (7) /*!< SYS_T::RSTSTS: CPURF Position */ -#define SYS_RSTSTS_CPURF_Msk (0x1ul << SYS_RSTSTS_CPURF_Pos) /*!< SYS_T::RSTSTS: CPURF Mask */ - -#define SYS_RSTSTS_CPULKRF_Pos (8) /*!< SYS_T::RSTSTS: CPULKRF Position */ -#define SYS_RSTSTS_CPULKRF_Msk (0x1ul << SYS_RSTSTS_CPULKRF_Pos) /*!< SYS_T::RSTSTS: CPULKRF Mask */ - -#define SYS_IPRST0_CHIPRST_Pos (0) /*!< SYS_T::IPRST0: CHIPRST Position */ -#define SYS_IPRST0_CHIPRST_Msk (0x1ul << SYS_IPRST0_CHIPRST_Pos) /*!< SYS_T::IPRST0: CHIPRST Mask */ - -#define SYS_IPRST0_CPURST_Pos (1) /*!< SYS_T::IPRST0: CPURST Position */ -#define SYS_IPRST0_CPURST_Msk (0x1ul << SYS_IPRST0_CPURST_Pos) /*!< SYS_T::IPRST0: CPURST Mask */ - -#define SYS_IPRST0_PDMA0RST_Pos (2) /*!< SYS_T::IPRST0: PDMA0RST Position */ -#define SYS_IPRST0_PDMA0RST_Msk (0x1ul << SYS_IPRST0_PDMA0RST_Pos) /*!< SYS_T::IPRST0: PDMA0RST Mask */ - -#define SYS_IPRST0_EBIRST_Pos (3) /*!< SYS_T::IPRST0: EBIRST Position */ -#define SYS_IPRST0_EBIRST_Msk (0x1ul << SYS_IPRST0_EBIRST_Pos) /*!< SYS_T::IPRST0: EBIRST Mask */ - -#define SYS_IPRST0_EMAC0RST_Pos (5) /*!< SYS_T::IPRST0: EMAC0RST Position */ -#define SYS_IPRST0_EMAC0RST_Msk (0x1ul << SYS_IPRST0_EMAC0RST_Pos) /*!< SYS_T::IPRST0: EMAC0RST Mask */ - -#define SYS_IPRST0_SDH0RST_Pos (6) /*!< SYS_T::IPRST0: SDH0RST Position */ -#define SYS_IPRST0_SDH0RST_Msk (0x1ul << SYS_IPRST0_SDH0RST_Pos) /*!< SYS_T::IPRST0: SDH0RST Mask */ - -#define SYS_IPRST0_CRCRST_Pos (7) /*!< SYS_T::IPRST0: CRCRST Position */ -#define SYS_IPRST0_CRCRST_Msk (0x1ul << SYS_IPRST0_CRCRST_Pos) /*!< SYS_T::IPRST0: CRCRST Mask */ - -#define SYS_IPRST0_CCAPRST_Pos (8) /*!< SYS_T::IPRST0: CCAPRST Position */ -#define SYS_IPRST0_CCAPRST_Msk (0x1ul << SYS_IPRST0_CCAPRST_Pos) /*!< SYS_T::IPRST0: CCAPRST Mask */ - -#define SYS_IPRST0_HSUSBDRST_Pos (10) /*!< SYS_T::IPRST0: HSUSBDRST Position */ -#define SYS_IPRST0_HSUSBDRST_Msk (0x1ul << SYS_IPRST0_HSUSBDRST_Pos) /*!< SYS_T::IPRST0: HSUSBDRST Mask */ - -#define SYS_IPRST0_HBIRST_Pos (11) /*!< SYS_T::IPRST0: HBIRST Position */ -#define SYS_IPRST0_HBIRST_Msk (0x1ul << SYS_IPRST0_HBIRST_Pos) /*!< SYS_T::IPRST0: HBIRST Mask */ - -#define SYS_IPRST0_CRPTRST_Pos (12) /*!< SYS_T::IPRST0: CRPTRST Position */ -#define SYS_IPRST0_CRPTRST_Msk (0x1ul << SYS_IPRST0_CRPTRST_Pos) /*!< SYS_T::IPRST0: CRPTRST Mask */ - -#define SYS_IPRST0_KSRST_Pos (13) /*!< SYS_T::IPRST0: KSRST Position */ -#define SYS_IPRST0_KSRST_Msk (0x1ul << SYS_IPRST0_KSRST_Pos) /*!< SYS_T::IPRST0: KSRST Mask */ - -#define SYS_IPRST0_SPIMRST_Pos (14) /*!< SYS_T::IPRST0: SPIMRST Position */ -#define SYS_IPRST0_SPIMRST_Msk (0x1ul << SYS_IPRST0_SPIMRST_Pos) /*!< SYS_T::IPRST0: SPIMRST Mask */ - -#define SYS_IPRST0_HSUSBHRST_Pos (16) /*!< SYS_T::IPRST0: HSUSBHRST Position */ -#define SYS_IPRST0_HSUSBHRST_Msk (0x1ul << SYS_IPRST0_HSUSBHRST_Pos) /*!< SYS_T::IPRST0: HSUSBHRST Mask */ - -#define SYS_IPRST0_SDH1RST_Pos (17) /*!< SYS_T::IPRST0: SDH1RST Position */ -#define SYS_IPRST0_SDH1RST_Msk (0x1ul << SYS_IPRST0_SDH1RST_Pos) /*!< SYS_T::IPRST0: SDH1RST Mask */ - -#define SYS_IPRST0_PDMA1RST_Pos (18) /*!< SYS_T::IPRST0: PDMA1RST Position */ -#define SYS_IPRST0_PDMA1RST_Msk (0x1ul << SYS_IPRST0_PDMA1RST_Pos) /*!< SYS_T::IPRST0: PDMA1RST Mask */ - -#define SYS_IPRST0_CANFD0RST_Pos (20) /*!< SYS_T::IPRST0: CANFD0RST Position */ -#define SYS_IPRST0_CANFD0RST_Msk (0x1ul << SYS_IPRST0_CANFD0RST_Pos) /*!< SYS_T::IPRST0: CANFD0RST Mask */ - -#define SYS_IPRST0_CANFD1RST_Pos (21) /*!< SYS_T::IPRST0: CANFD1RST Position */ -#define SYS_IPRST0_CANFD1RST_Msk (0x1ul << SYS_IPRST0_CANFD1RST_Pos) /*!< SYS_T::IPRST0: CANFD1RST Mask */ - -#define SYS_IPRST0_CANFD2RST_Pos (22) /*!< SYS_T::IPRST0: CANFD2RST Position */ -#define SYS_IPRST0_CANFD2RST_Msk (0x1ul << SYS_IPRST0_CANFD2RST_Pos) /*!< SYS_T::IPRST0: CANFD2RST Mask */ - -#define SYS_IPRST0_CANFD3RST_Pos (23) /*!< SYS_T::IPRST0: CANFD3RST Position */ -#define SYS_IPRST0_CANFD3RST_Msk (0x1ul << SYS_IPRST0_CANFD3RST_Pos) /*!< SYS_T::IPRST0: CANFD3RST Mask */ - -#define SYS_IPRST0_BMCRST_Pos (28) /*!< SYS_T::IPRST0: BMCRST Position */ -#define SYS_IPRST0_BMCRST_Msk (0x1ul << SYS_IPRST0_BMCRST_Pos) /*!< SYS_T::IPRST0: BMCRST Mask */ - -#define SYS_IPRST1_GPIORST_Pos (1) /*!< SYS_T::IPRST1: GPIORST Position */ -#define SYS_IPRST1_GPIORST_Msk (0x1ul << SYS_IPRST1_GPIORST_Pos) /*!< SYS_T::IPRST1: GPIORST Mask */ - -#define SYS_IPRST1_TMR0RST_Pos (2) /*!< SYS_T::IPRST1: TMR0RST Position */ -#define SYS_IPRST1_TMR0RST_Msk (0x1ul << SYS_IPRST1_TMR0RST_Pos) /*!< SYS_T::IPRST1: TMR0RST Mask */ - -#define SYS_IPRST1_TMR1RST_Pos (3) /*!< SYS_T::IPRST1: TMR1RST Position */ -#define SYS_IPRST1_TMR1RST_Msk (0x1ul << SYS_IPRST1_TMR1RST_Pos) /*!< SYS_T::IPRST1: TMR1RST Mask */ - -#define SYS_IPRST1_TMR2RST_Pos (4) /*!< SYS_T::IPRST1: TMR2RST Position */ -#define SYS_IPRST1_TMR2RST_Msk (0x1ul << SYS_IPRST1_TMR2RST_Pos) /*!< SYS_T::IPRST1: TMR2RST Mask */ - -#define SYS_IPRST1_TMR3RST_Pos (5) /*!< SYS_T::IPRST1: TMR3RST Position */ -#define SYS_IPRST1_TMR3RST_Msk (0x1ul << SYS_IPRST1_TMR3RST_Pos) /*!< SYS_T::IPRST1: TMR3RST Mask */ - -#define SYS_IPRST1_ACMP01RST_Pos (7) /*!< SYS_T::IPRST1: ACMP01RST Position */ -#define SYS_IPRST1_ACMP01RST_Msk (0x1ul << SYS_IPRST1_ACMP01RST_Pos) /*!< SYS_T::IPRST1: ACMP01RST Mask */ - -#define SYS_IPRST1_I2C0RST_Pos (8) /*!< SYS_T::IPRST1: I2C0RST Position */ -#define SYS_IPRST1_I2C0RST_Msk (0x1ul << SYS_IPRST1_I2C0RST_Pos) /*!< SYS_T::IPRST1: I2C0RST Mask */ - -#define SYS_IPRST1_I2C1RST_Pos (9) /*!< SYS_T::IPRST1: I2C1RST Position */ -#define SYS_IPRST1_I2C1RST_Msk (0x1ul << SYS_IPRST1_I2C1RST_Pos) /*!< SYS_T::IPRST1: I2C1RST Mask */ - -#define SYS_IPRST1_I2C2RST_Pos (10) /*!< SYS_T::IPRST1: I2C2RST Position */ -#define SYS_IPRST1_I2C2RST_Msk (0x1ul << SYS_IPRST1_I2C2RST_Pos) /*!< SYS_T::IPRST1: I2C2RST Mask */ - -#define SYS_IPRST1_I2C3RST_Pos (11) /*!< SYS_T::IPRST1: I2C3RST Position */ -#define SYS_IPRST1_I2C3RST_Msk (0x1ul << SYS_IPRST1_I2C3RST_Pos) /*!< SYS_T::IPRST1: I2C3RST Mask */ - -#define SYS_IPRST1_QSPI0RST_Pos (12) /*!< SYS_T::IPRST1: QSPI0RST Position */ -#define SYS_IPRST1_QSPI0RST_Msk (0x1ul << SYS_IPRST1_QSPI0RST_Pos) /*!< SYS_T::IPRST1: QSPI0RST Mask */ - -#define SYS_IPRST1_SPI0RST_Pos (13) /*!< SYS_T::IPRST1: SPI0RST Position */ -#define SYS_IPRST1_SPI0RST_Msk (0x1ul << SYS_IPRST1_SPI0RST_Pos) /*!< SYS_T::IPRST1: SPI0RST Mask */ - -#define SYS_IPRST1_SPI1RST_Pos (14) /*!< SYS_T::IPRST1: SPI1RST Position */ -#define SYS_IPRST1_SPI1RST_Msk (0x1ul << SYS_IPRST1_SPI1RST_Pos) /*!< SYS_T::IPRST1: SPI1RST Mask */ - -#define SYS_IPRST1_SPI2RST_Pos (15) /*!< SYS_T::IPRST1: SPI2RST Position */ -#define SYS_IPRST1_SPI2RST_Msk (0x1ul << SYS_IPRST1_SPI2RST_Pos) /*!< SYS_T::IPRST1: SPI2RST Mask */ - -#define SYS_IPRST1_UART0RST_Pos (16) /*!< SYS_T::IPRST1: UART0RST Position */ -#define SYS_IPRST1_UART0RST_Msk (0x1ul << SYS_IPRST1_UART0RST_Pos) /*!< SYS_T::IPRST1: UART0RST Mask */ - -#define SYS_IPRST1_UART1RST_Pos (17) /*!< SYS_T::IPRST1: UART1RST Position */ -#define SYS_IPRST1_UART1RST_Msk (0x1ul << SYS_IPRST1_UART1RST_Pos) /*!< SYS_T::IPRST1: UART1RST Mask */ - -#define SYS_IPRST1_UART2RST_Pos (18) /*!< SYS_T::IPRST1: UART2RST Position */ -#define SYS_IPRST1_UART2RST_Msk (0x1ul << SYS_IPRST1_UART2RST_Pos) /*!< SYS_T::IPRST1: UART2RST Mask */ - -#define SYS_IPRST1_UART3RST_Pos (19) /*!< SYS_T::IPRST1: UART3RST Position */ -#define SYS_IPRST1_UART3RST_Msk (0x1ul << SYS_IPRST1_UART3RST_Pos) /*!< SYS_T::IPRST1: UART3RST Mask */ - -#define SYS_IPRST1_UART4RST_Pos (20) /*!< SYS_T::IPRST1: UART4RST Position */ -#define SYS_IPRST1_UART4RST_Msk (0x1ul << SYS_IPRST1_UART4RST_Pos) /*!< SYS_T::IPRST1: UART4RST Mask */ - -#define SYS_IPRST1_UART5RST_Pos (21) /*!< SYS_T::IPRST1: UART5RST Position */ -#define SYS_IPRST1_UART5RST_Msk (0x1ul << SYS_IPRST1_UART5RST_Pos) /*!< SYS_T::IPRST1: UART5RST Mask */ - -#define SYS_IPRST1_UART6RST_Pos (22) /*!< SYS_T::IPRST1: UART6RST Position */ -#define SYS_IPRST1_UART6RST_Msk (0x1ul << SYS_IPRST1_UART6RST_Pos) /*!< SYS_T::IPRST1: UART6RST Mask */ - -#define SYS_IPRST1_UART7RST_Pos (23) /*!< SYS_T::IPRST1: UART7RST Position */ -#define SYS_IPRST1_UART7RST_Msk (0x1ul << SYS_IPRST1_UART7RST_Pos) /*!< SYS_T::IPRST1: UART7RST Mask */ - -#define SYS_IPRST1_OTGRST_Pos (26) /*!< SYS_T::IPRST1: OTGRST Position */ -#define SYS_IPRST1_OTGRST_Msk (0x1ul << SYS_IPRST1_OTGRST_Pos) /*!< SYS_T::IPRST1: OTGRST Mask */ - -#define SYS_IPRST1_USBDRST_Pos (27) /*!< SYS_T::IPRST1: USBDRST Position */ -#define SYS_IPRST1_USBDRST_Msk (0x1ul << SYS_IPRST1_USBDRST_Pos) /*!< SYS_T::IPRST1: USBDRST Mask */ - -#define SYS_IPRST1_EADC0RST_Pos (28) /*!< SYS_T::IPRST1: EADC0RST Position */ -#define SYS_IPRST1_EADC0RST_Msk (0x1ul << SYS_IPRST1_EADC0RST_Pos) /*!< SYS_T::IPRST1: EADC0RST Mask */ - -#define SYS_IPRST1_I2S0RST_Pos (29) /*!< SYS_T::IPRST1: I2S0RST Position */ -#define SYS_IPRST1_I2S0RST_Msk (0x1ul << SYS_IPRST1_I2S0RST_Pos) /*!< SYS_T::IPRST1: I2S0RST Mask */ - -#define SYS_IPRST1_HSOTGRST_Pos (30) /*!< SYS_T::IPRST1: HSOTGRST Position */ -#define SYS_IPRST1_HSOTGRST_Msk (0x1ul << SYS_IPRST1_HSOTGRST_Pos) /*!< SYS_T::IPRST1: HSOTGRST Mask */ - -#define SYS_IPRST1_TRNGRST_Pos (31) /*!< SYS_T::IPRST1: TRNGRST Position */ -#define SYS_IPRST1_TRNGRST_Msk (0x1ul << SYS_IPRST1_TRNGRST_Pos) /*!< SYS_T::IPRST1: TRNGRST Mask */ - -#define SYS_IPRST2_SC0RST_Pos (0) /*!< SYS_T::IPRST2: SC0RST Position */ -#define SYS_IPRST2_SC0RST_Msk (0x1ul << SYS_IPRST2_SC0RST_Pos) /*!< SYS_T::IPRST2: SC0RST Mask */ - -#define SYS_IPRST2_SC1RST_Pos (1) /*!< SYS_T::IPRST2: SC1RST Position */ -#define SYS_IPRST2_SC1RST_Msk (0x1ul << SYS_IPRST2_SC1RST_Pos) /*!< SYS_T::IPRST2: SC1RST Mask */ - -#define SYS_IPRST2_SC2RST_Pos (2) /*!< SYS_T::IPRST2: SC2RST Position */ -#define SYS_IPRST2_SC2RST_Msk (0x1ul << SYS_IPRST2_SC2RST_Pos) /*!< SYS_T::IPRST2: SC2RST Mask */ - -#define SYS_IPRST2_I2C4RST_Pos (3) /*!< SYS_T::IPRST2: I2C4RST Position */ -#define SYS_IPRST2_I2C4RST_Msk (0x1ul << SYS_IPRST2_I2C4RST_Pos) /*!< SYS_T::IPRST2: I2C4RST Mask */ - -#define SYS_IPRST2_QSPI1RST_Pos (4) /*!< SYS_T::IPRST2: QSPI1RST Position */ -#define SYS_IPRST2_QSPI1RST_Msk (0x1ul << SYS_IPRST2_QSPI1RST_Pos) /*!< SYS_T::IPRST2: QSPI1RST Mask */ - -#define SYS_IPRST2_SPI3RST_Pos (6) /*!< SYS_T::IPRST2: SPI3RST Position */ -#define SYS_IPRST2_SPI3RST_Msk (0x1ul << SYS_IPRST2_SPI3RST_Pos) /*!< SYS_T::IPRST2: SPI3RST Mask */ - -#define SYS_IPRST2_SPI4RST_Pos (7) /*!< SYS_T::IPRST2: SPI4RST Position */ -#define SYS_IPRST2_SPI4RST_Msk (0x1ul << SYS_IPRST2_SPI4RST_Pos) /*!< SYS_T::IPRST2: SPI4RST Mask */ - -#define SYS_IPRST2_USCI0RST_Pos (8) /*!< SYS_T::IPRST2: USCI0RST Position */ -#define SYS_IPRST2_USCI0RST_Msk (0x1ul << SYS_IPRST2_USCI0RST_Pos) /*!< SYS_T::IPRST2: USCI0RST Mask */ - -#define SYS_IPRST2_PSIORST_Pos (10) /*!< SYS_T::IPRST2: PSIORST Position */ -#define SYS_IPRST2_PSIORST_Msk (0x1ul << SYS_IPRST2_PSIORST_Pos) /*!< SYS_T::IPRST2: PSIORST Mask */ - -#define SYS_IPRST2_DACRST_Pos (12) /*!< SYS_T::IPRST2: DACRST Position */ -#define SYS_IPRST2_DACRST_Msk (0x1ul << SYS_IPRST2_DACRST_Pos) /*!< SYS_T::IPRST2: DACRST Mask */ - -#define SYS_IPRST2_ECAP2RST_Pos (13) /*!< SYS_T::IPRST2: ECAP2RST Position */ -#define SYS_IPRST2_ECAP2RST_Msk (0x1ul << SYS_IPRST2_ECAP2RST_Pos) /*!< SYS_T::IPRST2: ECAP2RST Mask */ - -#define SYS_IPRST2_ECAP3RST_Pos (14) /*!< SYS_T::IPRST2: ECAP3RST Position */ -#define SYS_IPRST2_ECAP3RST_Msk (0x1ul << SYS_IPRST2_ECAP3RST_Pos) /*!< SYS_T::IPRST2: ECAP3RST Mask */ - -#define SYS_IPRST2_EPWM0RST_Pos (16) /*!< SYS_T::IPRST2: EPWM0RST Position */ -#define SYS_IPRST2_EPWM0RST_Msk (0x1ul << SYS_IPRST2_EPWM0RST_Pos) /*!< SYS_T::IPRST2: EPWM0RST Mask */ - -#define SYS_IPRST2_EPWM1RST_Pos (17) /*!< SYS_T::IPRST2: EPWM1RST Position */ -#define SYS_IPRST2_EPWM1RST_Msk (0x1ul << SYS_IPRST2_EPWM1RST_Pos) /*!< SYS_T::IPRST2: EPWM1RST Mask */ - -#define SYS_IPRST2_BPWM0RST_Pos (18) /*!< SYS_T::IPRST2: BPWM0RST Position */ -#define SYS_IPRST2_BPWM0RST_Msk (0x1ul << SYS_IPRST2_BPWM0RST_Pos) /*!< SYS_T::IPRST2: BPWM0RST Mask */ - -#define SYS_IPRST2_BPWM1RST_Pos (19) /*!< SYS_T::IPRST2: BPWM1RST Position */ -#define SYS_IPRST2_BPWM1RST_Msk (0x1ul << SYS_IPRST2_BPWM1RST_Pos) /*!< SYS_T::IPRST2: BPWM1RST Mask */ - -#define SYS_IPRST2_EQEI2RST_Pos (20) /*!< SYS_T::IPRST2: EQEI2RST Position */ -#define SYS_IPRST2_EQEI2RST_Msk (0x1ul << SYS_IPRST2_EQEI2RST_Pos) /*!< SYS_T::IPRST2: EQEI2RST Mask */ - -#define SYS_IPRST2_EQEI3RST_Pos (21) /*!< SYS_T::IPRST2: EQEI3RST Position */ -#define SYS_IPRST2_EQEI3RST_Msk (0x1ul << SYS_IPRST2_EQEI3RST_Pos) /*!< SYS_T::IPRST2: EQEI3RST Mask */ - -#define SYS_IPRST2_EQEI0RST_Pos (22) /*!< SYS_T::IPRST2: EQEI0RST Position */ -#define SYS_IPRST2_EQEI0RST_Msk (0x1ul << SYS_IPRST2_EQEI0RST_Pos) /*!< SYS_T::IPRST2: EQEI0RST Mask */ - -#define SYS_IPRST2_EQEI1RST_Pos (23) /*!< SYS_T::IPRST2: EQEI1RST Position */ -#define SYS_IPRST2_EQEI1RST_Msk (0x1ul << SYS_IPRST2_EQEI1RST_Pos) /*!< SYS_T::IPRST2: EQEI1RST Mask */ - -#define SYS_IPRST2_ECAP0RST_Pos (26) /*!< SYS_T::IPRST2: ECAP0RST Position */ -#define SYS_IPRST2_ECAP0RST_Msk (0x1ul << SYS_IPRST2_ECAP0RST_Pos) /*!< SYS_T::IPRST2: ECAP0RST Mask */ - -#define SYS_IPRST2_ECAP1RST_Pos (27) /*!< SYS_T::IPRST2: ECAP1RST Position */ -#define SYS_IPRST2_ECAP1RST_Msk (0x1ul << SYS_IPRST2_ECAP1RST_Pos) /*!< SYS_T::IPRST2: ECAP1RST Mask */ - -#define SYS_IPRST2_I2S1RST_Pos (29) /*!< SYS_T::IPRST2: I2S1RST Position */ -#define SYS_IPRST2_I2S1RST_Msk (0x1ul << SYS_IPRST2_I2S1RST_Pos) /*!< SYS_T::IPRST2: I2S1RST Mask */ - -#define SYS_IPRST2_EADC1RST_Pos (31) /*!< SYS_T::IPRST2: EADC1RST Position */ -#define SYS_IPRST2_EADC1RST_Msk (0x1ul << SYS_IPRST2_EADC1RST_Pos) /*!< SYS_T::IPRST2: EADC1RST Mask */ - -#define SYS_BODCTL_BODEN_Pos (0) /*!< SYS_T::BODCTL: BODEN Position */ -#define SYS_BODCTL_BODEN_Msk (0x1ul << SYS_BODCTL_BODEN_Pos) /*!< SYS_T::BODCTL: BODEN Mask */ - -#define SYS_BODCTL_BODRSTEN_Pos (3) /*!< SYS_T::BODCTL: BODRSTEN Position */ -#define SYS_BODCTL_BODRSTEN_Msk (0x1ul << SYS_BODCTL_BODRSTEN_Pos) /*!< SYS_T::BODCTL: BODRSTEN Mask */ - -#define SYS_BODCTL_BODIF_Pos (4) /*!< SYS_T::BODCTL: BODIF Position */ -#define SYS_BODCTL_BODIF_Msk (0x1ul << SYS_BODCTL_BODIF_Pos) /*!< SYS_T::BODCTL: BODIF Mask */ - -#define SYS_BODCTL_BODLPM_Pos (5) /*!< SYS_T::BODCTL: BODLPM Position */ -#define SYS_BODCTL_BODLPM_Msk (0x1ul << SYS_BODCTL_BODLPM_Pos) /*!< SYS_T::BODCTL: BODLPM Mask */ - -#define SYS_BODCTL_BODOUT_Pos (6) /*!< SYS_T::BODCTL: BODOUT Position */ -#define SYS_BODCTL_BODOUT_Msk (0x1ul << SYS_BODCTL_BODOUT_Pos) /*!< SYS_T::BODCTL: BODOUT Mask */ - -#define SYS_BODCTL_LVREN_Pos (7) /*!< SYS_T::BODCTL: LVREN Position */ -#define SYS_BODCTL_LVREN_Msk (0x1ul << SYS_BODCTL_LVREN_Pos) /*!< SYS_T::BODCTL: LVREN Mask */ - -#define SYS_BODCTL_BODDGSEL_Pos (8) /*!< SYS_T::BODCTL: BODDGSEL Position */ -#define SYS_BODCTL_BODDGSEL_Msk (0x7ul << SYS_BODCTL_BODDGSEL_Pos) /*!< SYS_T::BODCTL: BODDGSEL Mask */ - -#define SYS_BODCTL_LVRDGSEL_Pos (12) /*!< SYS_T::BODCTL: LVRDGSEL Position */ -#define SYS_BODCTL_LVRDGSEL_Msk (0x7ul << SYS_BODCTL_LVRDGSEL_Pos) /*!< SYS_T::BODCTL: LVRDGSEL Mask */ - -#define SYS_BODCTL_LVRRDY_Pos (15) /*!< SYS_T::BODCTL: LVRRDY Position */ -#define SYS_BODCTL_LVRRDY_Msk (0x1ul << SYS_BODCTL_LVRRDY_Pos) /*!< SYS_T::BODCTL: LVRRDY Mask */ - -#define SYS_BODCTL_BODVL_Pos (16) /*!< SYS_T::BODCTL: BODVL Position */ -#define SYS_BODCTL_BODVL_Msk (0x7ul << SYS_BODCTL_BODVL_Pos) /*!< SYS_T::BODCTL: BODVL Mask */ - -#define SYS_IVSCTL_VTEMPEN_Pos (0) /*!< SYS_T::IVSCTL: VTEMPEN Position */ -#define SYS_IVSCTL_VTEMPEN_Msk (0x1ul << SYS_IVSCTL_VTEMPEN_Pos) /*!< SYS_T::IVSCTL: VTEMPEN Mask */ - -#define SYS_IVSCTL_VBATUGEN_Pos (1) /*!< SYS_T::IVSCTL: VBATUGEN Position */ -#define SYS_IVSCTL_VBATUGEN_Msk (0x1ul << SYS_IVSCTL_VBATUGEN_Pos) /*!< SYS_T::IVSCTL: VBATUGEN Mask */ - -#define SYS_IPRST3_KPIRST_Pos (0) /*!< SYS_T::IPRST3: KPIRST Position */ -#define SYS_IPRST3_KPIRST_Msk (0x1ul << SYS_IPRST3_KPIRST_Pos) /*!< SYS_T::IPRST3: KPIRST Mask */ - -#define SYS_IPRST3_EADC2RST_Pos (6) /*!< SYS_T::IPRST3: EADC2RST Position */ -#define SYS_IPRST3_EADC2RST_Msk (0x1ul << SYS_IPRST3_EADC2RST_Pos) /*!< SYS_T::IPRST3: EADC2RST Mask */ - -#define SYS_IPRST3_ACMP23RST_Pos (7) /*!< SYS_T::IPRST3: ACMP23RST Position */ -#define SYS_IPRST3_ACMP23RST_Msk (0x1ul << SYS_IPRST3_ACMP23RST_Pos) /*!< SYS_T::IPRST3: ACMP23RST Mask */ - -#define SYS_IPRST3_SPI5RST_Pos (8) /*!< SYS_T::IPRST3: SPI5RST Position */ -#define SYS_IPRST3_SPI5RST_Msk (0x1ul << SYS_IPRST3_SPI5RST_Pos) /*!< SYS_T::IPRST3: SPI5RST Mask */ - -#define SYS_IPRST3_SPI6RST_Pos (9) /*!< SYS_T::IPRST3: SPI6RST Position */ -#define SYS_IPRST3_SPI6RST_Msk (0x1ul << SYS_IPRST3_SPI6RST_Pos) /*!< SYS_T::IPRST3: SPI6RST Mask */ - -#define SYS_IPRST3_SPI7RST_Pos (10) /*!< SYS_T::IPRST3: SPI7RST Position */ -#define SYS_IPRST3_SPI7RST_Msk (0x1ul << SYS_IPRST3_SPI7RST_Pos) /*!< SYS_T::IPRST3: SPI7RST Mask */ - -#define SYS_IPRST3_SPI8RST_Pos (11) /*!< SYS_T::IPRST3: SPI8RST Position */ -#define SYS_IPRST3_SPI8RST_Msk (0x1ul << SYS_IPRST3_SPI8RST_Pos) /*!< SYS_T::IPRST3: SPI8RST Mask */ - -#define SYS_IPRST3_SPI9RST_Pos (12) /*!< SYS_T::IPRST3: SPI9RST Position */ -#define SYS_IPRST3_SPI9RST_Msk (0x1ul << SYS_IPRST3_SPI9RST_Pos) /*!< SYS_T::IPRST3: SPI9RST Mask */ - -#define SYS_IPRST3_SPI10RST_Pos (13) /*!< SYS_T::IPRST3: SPI10RST Position */ -#define SYS_IPRST3_SPI10RST_Msk (0x1ul << SYS_IPRST3_SPI10RST_Pos) /*!< SYS_T::IPRST3: SPI10RST Mask */ - -#define SYS_IPRST3_UART8RST_Pos (16) /*!< SYS_T::IPRST3: UART8RST Position */ -#define SYS_IPRST3_UART8RST_Msk (0x1ul << SYS_IPRST3_UART8RST_Pos) /*!< SYS_T::IPRST3: UART8RST Mask */ - -#define SYS_IPRST3_UART9RST_Pos (17) /*!< SYS_T::IPRST3: UART9RST Position */ -#define SYS_IPRST3_UART9RST_Msk (0x1ul << SYS_IPRST3_UART9RST_Pos) /*!< SYS_T::IPRST3: UART9RST Mask */ - -#define SYS_PORCTL_POROFF_Pos (0) /*!< SYS_T::PORCTL: POROFF Position */ -#define SYS_PORCTL_POROFF_Msk (0xfffful << SYS_PORCTL_POROFF_Pos) /*!< SYS_T::PORCTL: POROFF Mask */ - -#define SYS_VREFCTL_VREFCTL_Pos (0) /*!< SYS_T::VREFCTL: VREFCTL Position */ -#define SYS_VREFCTL_VREFCTL_Msk (0x1ful << SYS_VREFCTL_VREFCTL_Pos) /*!< SYS_T::VREFCTL: VREFCTL Mask */ - -#define SYS_VREFCTL_PRELOADSEL_Pos (6) /*!< SYS_T::VREFCTL: PRELOADSEL Position */ -#define SYS_VREFCTL_PRELOADSEL_Msk (0x3ul << SYS_VREFCTL_PRELOADSEL_Pos) /*!< SYS_T::VREFCTL: PRELOADSEL Mask */ - -#define SYS_VREFCTL_VBGFEN_Pos (24) /*!< SYS_T::VREFCTL: VBGFEN Position */ -#define SYS_VREFCTL_VBGFEN_Msk (0x1ul << SYS_VREFCTL_VBGFEN_Pos) /*!< SYS_T::VREFCTL: VBGFEN Mask */ - -#define SYS_VREFCTL_VBGISEL_Pos (25) /*!< SYS_T::VREFCTL: VBGISEL Position */ -#define SYS_VREFCTL_VBGISEL_Msk (0x3ul << SYS_VREFCTL_VBGISEL_Pos) /*!< SYS_T::VREFCTL: VBGISEL Mask */ - -#define SYS_USBPHY_USBROLE_Pos (0) /*!< SYS_T::USBPHY: USBROLE Position */ -#define SYS_USBPHY_USBROLE_Msk (0x3ul << SYS_USBPHY_USBROLE_Pos) /*!< SYS_T::USBPHY: USBROLE Mask */ - -#define SYS_USBPHY_SBO_Pos (2) /*!< SYS_T::USBPHY: SBO Position */ -#define SYS_USBPHY_SBO_Msk (0x1ul << SYS_USBPHY_SBO_Pos) /*!< SYS_T::USBPHY: SBO Mask */ - -#define SYS_USBPHY_USBEN_Pos (8) /*!< SYS_T::USBPHY: USBEN Position */ -#define SYS_USBPHY_USBEN_Msk (0x1ul << SYS_USBPHY_USBEN_Pos) /*!< SYS_T::USBPHY: USBEN Mask */ - -#define SYS_USBPHY_HSUSBROLE_Pos (16) /*!< SYS_T::USBPHY: HSUSBROLE Position */ -#define SYS_USBPHY_HSUSBROLE_Msk (0x3ul << SYS_USBPHY_HSUSBROLE_Pos) /*!< SYS_T::USBPHY: HSUSBROLE Mask */ - -#define SYS_USBPHY_HSUSBEN_Pos (24) /*!< SYS_T::USBPHY: HSUSBEN Position */ -#define SYS_USBPHY_HSUSBEN_Msk (0x1ul << SYS_USBPHY_HSUSBEN_Pos) /*!< SYS_T::USBPHY: HSUSBEN Mask */ - -#define SYS_USBPHY_HSUSBACT_Pos (25) /*!< SYS_T::USBPHY: HSUSBACT Position */ -#define SYS_USBPHY_HSUSBACT_Msk (0x1ul << SYS_USBPHY_HSUSBACT_Pos) /*!< SYS_T::USBPHY: HSUSBACT Mask */ - -#define SYS_GPA_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPA_MFOS: MFOS0 Position */ -#define SYS_GPA_MFOS_MFOS0_Msk (0x1ul << SYS_GPA_MFOS_MFOS0_Pos) /*!< SYS_T::GPA_MFOS: MFOS0 Mask */ - -#define SYS_GPA_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPA_MFOS: MFOS1 Position */ -#define SYS_GPA_MFOS_MFOS1_Msk (0x1ul << SYS_GPA_MFOS_MFOS1_Pos) /*!< SYS_T::GPA_MFOS: MFOS1 Mask */ - -#define SYS_GPA_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPA_MFOS: MFOS2 Position */ -#define SYS_GPA_MFOS_MFOS2_Msk (0x1ul << SYS_GPA_MFOS_MFOS2_Pos) /*!< SYS_T::GPA_MFOS: MFOS2 Mask */ - -#define SYS_GPA_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPA_MFOS: MFOS3 Position */ -#define SYS_GPA_MFOS_MFOS3_Msk (0x1ul << SYS_GPA_MFOS_MFOS3_Pos) /*!< SYS_T::GPA_MFOS: MFOS3 Mask */ - -#define SYS_GPA_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPA_MFOS: MFOS4 Position */ -#define SYS_GPA_MFOS_MFOS4_Msk (0x1ul << SYS_GPA_MFOS_MFOS4_Pos) /*!< SYS_T::GPA_MFOS: MFOS4 Mask */ - -#define SYS_GPA_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPA_MFOS: MFOS5 Position */ -#define SYS_GPA_MFOS_MFOS5_Msk (0x1ul << SYS_GPA_MFOS_MFOS5_Pos) /*!< SYS_T::GPA_MFOS: MFOS5 Mask */ - -#define SYS_GPA_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPA_MFOS: MFOS6 Position */ -#define SYS_GPA_MFOS_MFOS6_Msk (0x1ul << SYS_GPA_MFOS_MFOS6_Pos) /*!< SYS_T::GPA_MFOS: MFOS6 Mask */ - -#define SYS_GPA_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPA_MFOS: MFOS7 Position */ -#define SYS_GPA_MFOS_MFOS7_Msk (0x1ul << SYS_GPA_MFOS_MFOS7_Pos) /*!< SYS_T::GPA_MFOS: MFOS7 Mask */ - -#define SYS_GPA_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPA_MFOS: MFOS8 Position */ -#define SYS_GPA_MFOS_MFOS8_Msk (0x1ul << SYS_GPA_MFOS_MFOS8_Pos) /*!< SYS_T::GPA_MFOS: MFOS8 Mask */ - -#define SYS_GPA_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPA_MFOS: MFOS9 Position */ -#define SYS_GPA_MFOS_MFOS9_Msk (0x1ul << SYS_GPA_MFOS_MFOS9_Pos) /*!< SYS_T::GPA_MFOS: MFOS9 Mask */ - -#define SYS_GPA_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPA_MFOS: MFOS10 Position */ -#define SYS_GPA_MFOS_MFOS10_Msk (0x1ul << SYS_GPA_MFOS_MFOS10_Pos) /*!< SYS_T::GPA_MFOS: MFOS10 Mask */ - -#define SYS_GPA_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPA_MFOS: MFOS11 Position */ -#define SYS_GPA_MFOS_MFOS11_Msk (0x1ul << SYS_GPA_MFOS_MFOS11_Pos) /*!< SYS_T::GPA_MFOS: MFOS11 Mask */ - -#define SYS_GPA_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPA_MFOS: MFOS12 Position */ -#define SYS_GPA_MFOS_MFOS12_Msk (0x1ul << SYS_GPA_MFOS_MFOS12_Pos) /*!< SYS_T::GPA_MFOS: MFOS12 Mask */ - -#define SYS_GPA_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPA_MFOS: MFOS13 Position */ -#define SYS_GPA_MFOS_MFOS13_Msk (0x1ul << SYS_GPA_MFOS_MFOS13_Pos) /*!< SYS_T::GPA_MFOS: MFOS13 Mask */ - -#define SYS_GPA_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPA_MFOS: MFOS14 Position */ -#define SYS_GPA_MFOS_MFOS14_Msk (0x1ul << SYS_GPA_MFOS_MFOS14_Pos) /*!< SYS_T::GPA_MFOS: MFOS14 Mask */ - -#define SYS_GPA_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPA_MFOS: MFOS15 Position */ -#define SYS_GPA_MFOS_MFOS15_Msk (0x1ul << SYS_GPA_MFOS_MFOS15_Pos) /*!< SYS_T::GPA_MFOS: MFOS15 Mask */ - -#define SYS_GPB_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPB_MFOS: MFOS0 Position */ -#define SYS_GPB_MFOS_MFOS0_Msk (0x1ul << SYS_GPB_MFOS_MFOS0_Pos) /*!< SYS_T::GPB_MFOS: MFOS0 Mask */ - -#define SYS_GPB_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPB_MFOS: MFOS1 Position */ -#define SYS_GPB_MFOS_MFOS1_Msk (0x1ul << SYS_GPB_MFOS_MFOS1_Pos) /*!< SYS_T::GPB_MFOS: MFOS1 Mask */ - -#define SYS_GPB_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPB_MFOS: MFOS2 Position */ -#define SYS_GPB_MFOS_MFOS2_Msk (0x1ul << SYS_GPB_MFOS_MFOS2_Pos) /*!< SYS_T::GPB_MFOS: MFOS2 Mask */ - -#define SYS_GPB_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPB_MFOS: MFOS3 Position */ -#define SYS_GPB_MFOS_MFOS3_Msk (0x1ul << SYS_GPB_MFOS_MFOS3_Pos) /*!< SYS_T::GPB_MFOS: MFOS3 Mask */ - -#define SYS_GPB_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPB_MFOS: MFOS4 Position */ -#define SYS_GPB_MFOS_MFOS4_Msk (0x1ul << SYS_GPB_MFOS_MFOS4_Pos) /*!< SYS_T::GPB_MFOS: MFOS4 Mask */ - -#define SYS_GPB_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPB_MFOS: MFOS5 Position */ -#define SYS_GPB_MFOS_MFOS5_Msk (0x1ul << SYS_GPB_MFOS_MFOS5_Pos) /*!< SYS_T::GPB_MFOS: MFOS5 Mask */ - -#define SYS_GPB_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPB_MFOS: MFOS6 Position */ -#define SYS_GPB_MFOS_MFOS6_Msk (0x1ul << SYS_GPB_MFOS_MFOS6_Pos) /*!< SYS_T::GPB_MFOS: MFOS6 Mask */ - -#define SYS_GPB_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPB_MFOS: MFOS7 Position */ -#define SYS_GPB_MFOS_MFOS7_Msk (0x1ul << SYS_GPB_MFOS_MFOS7_Pos) /*!< SYS_T::GPB_MFOS: MFOS7 Mask */ - -#define SYS_GPB_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPB_MFOS: MFOS8 Position */ -#define SYS_GPB_MFOS_MFOS8_Msk (0x1ul << SYS_GPB_MFOS_MFOS8_Pos) /*!< SYS_T::GPB_MFOS: MFOS8 Mask */ - -#define SYS_GPB_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPB_MFOS: MFOS9 Position */ -#define SYS_GPB_MFOS_MFOS9_Msk (0x1ul << SYS_GPB_MFOS_MFOS9_Pos) /*!< SYS_T::GPB_MFOS: MFOS9 Mask */ - -#define SYS_GPB_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPB_MFOS: MFOS10 Position */ -#define SYS_GPB_MFOS_MFOS10_Msk (0x1ul << SYS_GPB_MFOS_MFOS10_Pos) /*!< SYS_T::GPB_MFOS: MFOS10 Mask */ - -#define SYS_GPB_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPB_MFOS: MFOS11 Position */ -#define SYS_GPB_MFOS_MFOS11_Msk (0x1ul << SYS_GPB_MFOS_MFOS11_Pos) /*!< SYS_T::GPB_MFOS: MFOS11 Mask */ - -#define SYS_GPB_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPB_MFOS: MFOS12 Position */ -#define SYS_GPB_MFOS_MFOS12_Msk (0x1ul << SYS_GPB_MFOS_MFOS12_Pos) /*!< SYS_T::GPB_MFOS: MFOS12 Mask */ - -#define SYS_GPB_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPB_MFOS: MFOS13 Position */ -#define SYS_GPB_MFOS_MFOS13_Msk (0x1ul << SYS_GPB_MFOS_MFOS13_Pos) /*!< SYS_T::GPB_MFOS: MFOS13 Mask */ - -#define SYS_GPB_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPB_MFOS: MFOS14 Position */ -#define SYS_GPB_MFOS_MFOS14_Msk (0x1ul << SYS_GPB_MFOS_MFOS14_Pos) /*!< SYS_T::GPB_MFOS: MFOS14 Mask */ - -#define SYS_GPB_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPB_MFOS: MFOS15 Position */ -#define SYS_GPB_MFOS_MFOS15_Msk (0x1ul << SYS_GPB_MFOS_MFOS15_Pos) /*!< SYS_T::GPB_MFOS: MFOS15 Mask */ - -#define SYS_GPC_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPC_MFOS: MFOS0 Position */ -#define SYS_GPC_MFOS_MFOS0_Msk (0x1ul << SYS_GPC_MFOS_MFOS0_Pos) /*!< SYS_T::GPC_MFOS: MFOS0 Mask */ - -#define SYS_GPC_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPC_MFOS: MFOS1 Position */ -#define SYS_GPC_MFOS_MFOS1_Msk (0x1ul << SYS_GPC_MFOS_MFOS1_Pos) /*!< SYS_T::GPC_MFOS: MFOS1 Mask */ - -#define SYS_GPC_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPC_MFOS: MFOS2 Position */ -#define SYS_GPC_MFOS_MFOS2_Msk (0x1ul << SYS_GPC_MFOS_MFOS2_Pos) /*!< SYS_T::GPC_MFOS: MFOS2 Mask */ - -#define SYS_GPC_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPC_MFOS: MFOS3 Position */ -#define SYS_GPC_MFOS_MFOS3_Msk (0x1ul << SYS_GPC_MFOS_MFOS3_Pos) /*!< SYS_T::GPC_MFOS: MFOS3 Mask */ - -#define SYS_GPC_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPC_MFOS: MFOS4 Position */ -#define SYS_GPC_MFOS_MFOS4_Msk (0x1ul << SYS_GPC_MFOS_MFOS4_Pos) /*!< SYS_T::GPC_MFOS: MFOS4 Mask */ - -#define SYS_GPC_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPC_MFOS: MFOS5 Position */ -#define SYS_GPC_MFOS_MFOS5_Msk (0x1ul << SYS_GPC_MFOS_MFOS5_Pos) /*!< SYS_T::GPC_MFOS: MFOS5 Mask */ - -#define SYS_GPC_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPC_MFOS: MFOS6 Position */ -#define SYS_GPC_MFOS_MFOS6_Msk (0x1ul << SYS_GPC_MFOS_MFOS6_Pos) /*!< SYS_T::GPC_MFOS: MFOS6 Mask */ - -#define SYS_GPC_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPC_MFOS: MFOS7 Position */ -#define SYS_GPC_MFOS_MFOS7_Msk (0x1ul << SYS_GPC_MFOS_MFOS7_Pos) /*!< SYS_T::GPC_MFOS: MFOS7 Mask */ - -#define SYS_GPC_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPC_MFOS: MFOS8 Position */ -#define SYS_GPC_MFOS_MFOS8_Msk (0x1ul << SYS_GPC_MFOS_MFOS8_Pos) /*!< SYS_T::GPC_MFOS: MFOS8 Mask */ - -#define SYS_GPC_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPC_MFOS: MFOS9 Position */ -#define SYS_GPC_MFOS_MFOS9_Msk (0x1ul << SYS_GPC_MFOS_MFOS9_Pos) /*!< SYS_T::GPC_MFOS: MFOS9 Mask */ - -#define SYS_GPC_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPC_MFOS: MFOS10 Position */ -#define SYS_GPC_MFOS_MFOS10_Msk (0x1ul << SYS_GPC_MFOS_MFOS10_Pos) /*!< SYS_T::GPC_MFOS: MFOS10 Mask */ - -#define SYS_GPC_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPC_MFOS: MFOS11 Position */ -#define SYS_GPC_MFOS_MFOS11_Msk (0x1ul << SYS_GPC_MFOS_MFOS11_Pos) /*!< SYS_T::GPC_MFOS: MFOS11 Mask */ - -#define SYS_GPC_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPC_MFOS: MFOS12 Position */ -#define SYS_GPC_MFOS_MFOS12_Msk (0x1ul << SYS_GPC_MFOS_MFOS12_Pos) /*!< SYS_T::GPC_MFOS: MFOS12 Mask */ - -#define SYS_GPC_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPC_MFOS: MFOS13 Position */ -#define SYS_GPC_MFOS_MFOS13_Msk (0x1ul << SYS_GPC_MFOS_MFOS13_Pos) /*!< SYS_T::GPC_MFOS: MFOS13 Mask */ - -#define SYS_GPC_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPC_MFOS: MFOS14 Position */ -#define SYS_GPC_MFOS_MFOS14_Msk (0x1ul << SYS_GPC_MFOS_MFOS14_Pos) /*!< SYS_T::GPC_MFOS: MFOS14 Mask */ - -#define SYS_GPD_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPD_MFOS: MFOS0 Position */ -#define SYS_GPD_MFOS_MFOS0_Msk (0x1ul << SYS_GPD_MFOS_MFOS0_Pos) /*!< SYS_T::GPD_MFOS: MFOS0 Mask */ - -#define SYS_GPD_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPD_MFOS: MFOS1 Position */ -#define SYS_GPD_MFOS_MFOS1_Msk (0x1ul << SYS_GPD_MFOS_MFOS1_Pos) /*!< SYS_T::GPD_MFOS: MFOS1 Mask */ - -#define SYS_GPD_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPD_MFOS: MFOS2 Position */ -#define SYS_GPD_MFOS_MFOS2_Msk (0x1ul << SYS_GPD_MFOS_MFOS2_Pos) /*!< SYS_T::GPD_MFOS: MFOS2 Mask */ - -#define SYS_GPD_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPD_MFOS: MFOS3 Position */ -#define SYS_GPD_MFOS_MFOS3_Msk (0x1ul << SYS_GPD_MFOS_MFOS3_Pos) /*!< SYS_T::GPD_MFOS: MFOS3 Mask */ - -#define SYS_GPD_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPD_MFOS: MFOS4 Position */ -#define SYS_GPD_MFOS_MFOS4_Msk (0x1ul << SYS_GPD_MFOS_MFOS4_Pos) /*!< SYS_T::GPD_MFOS: MFOS4 Mask */ - -#define SYS_GPD_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPD_MFOS: MFOS5 Position */ -#define SYS_GPD_MFOS_MFOS5_Msk (0x1ul << SYS_GPD_MFOS_MFOS5_Pos) /*!< SYS_T::GPD_MFOS: MFOS5 Mask */ - -#define SYS_GPD_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPD_MFOS: MFOS6 Position */ -#define SYS_GPD_MFOS_MFOS6_Msk (0x1ul << SYS_GPD_MFOS_MFOS6_Pos) /*!< SYS_T::GPD_MFOS: MFOS6 Mask */ - -#define SYS_GPD_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPD_MFOS: MFOS7 Position */ -#define SYS_GPD_MFOS_MFOS7_Msk (0x1ul << SYS_GPD_MFOS_MFOS7_Pos) /*!< SYS_T::GPD_MFOS: MFOS7 Mask */ - -#define SYS_GPD_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPD_MFOS: MFOS8 Position */ -#define SYS_GPD_MFOS_MFOS8_Msk (0x1ul << SYS_GPD_MFOS_MFOS8_Pos) /*!< SYS_T::GPD_MFOS: MFOS8 Mask */ - -#define SYS_GPD_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPD_MFOS: MFOS9 Position */ -#define SYS_GPD_MFOS_MFOS9_Msk (0x1ul << SYS_GPD_MFOS_MFOS9_Pos) /*!< SYS_T::GPD_MFOS: MFOS9 Mask */ - -#define SYS_GPD_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPD_MFOS: MFOS10 Position */ -#define SYS_GPD_MFOS_MFOS10_Msk (0x1ul << SYS_GPD_MFOS_MFOS10_Pos) /*!< SYS_T::GPD_MFOS: MFOS10 Mask */ - -#define SYS_GPD_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPD_MFOS: MFOS11 Position */ -#define SYS_GPD_MFOS_MFOS11_Msk (0x1ul << SYS_GPD_MFOS_MFOS11_Pos) /*!< SYS_T::GPD_MFOS: MFOS11 Mask */ - -#define SYS_GPD_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPD_MFOS: MFOS12 Position */ -#define SYS_GPD_MFOS_MFOS12_Msk (0x1ul << SYS_GPD_MFOS_MFOS12_Pos) /*!< SYS_T::GPD_MFOS: MFOS12 Mask */ - -#define SYS_GPD_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPD_MFOS: MFOS13 Position */ -#define SYS_GPD_MFOS_MFOS13_Msk (0x1ul << SYS_GPD_MFOS_MFOS13_Pos) /*!< SYS_T::GPD_MFOS: MFOS13 Mask */ - -#define SYS_GPD_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPD_MFOS: MFOS14 Position */ -#define SYS_GPD_MFOS_MFOS14_Msk (0x1ul << SYS_GPD_MFOS_MFOS14_Pos) /*!< SYS_T::GPD_MFOS: MFOS14 Mask */ - -#define SYS_GPE_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPE_MFOS: MFOS0 Position */ -#define SYS_GPE_MFOS_MFOS0_Msk (0x1ul << SYS_GPE_MFOS_MFOS0_Pos) /*!< SYS_T::GPE_MFOS: MFOS0 Mask */ - -#define SYS_GPE_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPE_MFOS: MFOS1 Position */ -#define SYS_GPE_MFOS_MFOS1_Msk (0x1ul << SYS_GPE_MFOS_MFOS1_Pos) /*!< SYS_T::GPE_MFOS: MFOS1 Mask */ - -#define SYS_GPE_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPE_MFOS: MFOS2 Position */ -#define SYS_GPE_MFOS_MFOS2_Msk (0x1ul << SYS_GPE_MFOS_MFOS2_Pos) /*!< SYS_T::GPE_MFOS: MFOS2 Mask */ - -#define SYS_GPE_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPE_MFOS: MFOS3 Position */ -#define SYS_GPE_MFOS_MFOS3_Msk (0x1ul << SYS_GPE_MFOS_MFOS3_Pos) /*!< SYS_T::GPE_MFOS: MFOS3 Mask */ - -#define SYS_GPE_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPE_MFOS: MFOS4 Position */ -#define SYS_GPE_MFOS_MFOS4_Msk (0x1ul << SYS_GPE_MFOS_MFOS4_Pos) /*!< SYS_T::GPE_MFOS: MFOS4 Mask */ - -#define SYS_GPE_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPE_MFOS: MFOS5 Position */ -#define SYS_GPE_MFOS_MFOS5_Msk (0x1ul << SYS_GPE_MFOS_MFOS5_Pos) /*!< SYS_T::GPE_MFOS: MFOS5 Mask */ - -#define SYS_GPE_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPE_MFOS: MFOS6 Position */ -#define SYS_GPE_MFOS_MFOS6_Msk (0x1ul << SYS_GPE_MFOS_MFOS6_Pos) /*!< SYS_T::GPE_MFOS: MFOS6 Mask */ - -#define SYS_GPE_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPE_MFOS: MFOS7 Position */ -#define SYS_GPE_MFOS_MFOS7_Msk (0x1ul << SYS_GPE_MFOS_MFOS7_Pos) /*!< SYS_T::GPE_MFOS: MFOS7 Mask */ - -#define SYS_GPE_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPE_MFOS: MFOS8 Position */ -#define SYS_GPE_MFOS_MFOS8_Msk (0x1ul << SYS_GPE_MFOS_MFOS8_Pos) /*!< SYS_T::GPE_MFOS: MFOS8 Mask */ - -#define SYS_GPE_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPE_MFOS: MFOS9 Position */ -#define SYS_GPE_MFOS_MFOS9_Msk (0x1ul << SYS_GPE_MFOS_MFOS9_Pos) /*!< SYS_T::GPE_MFOS: MFOS9 Mask */ - -#define SYS_GPE_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPE_MFOS: MFOS10 Position */ -#define SYS_GPE_MFOS_MFOS10_Msk (0x1ul << SYS_GPE_MFOS_MFOS10_Pos) /*!< SYS_T::GPE_MFOS: MFOS10 Mask */ - -#define SYS_GPE_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPE_MFOS: MFOS11 Position */ -#define SYS_GPE_MFOS_MFOS11_Msk (0x1ul << SYS_GPE_MFOS_MFOS11_Pos) /*!< SYS_T::GPE_MFOS: MFOS11 Mask */ - -#define SYS_GPE_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPE_MFOS: MFOS12 Position */ -#define SYS_GPE_MFOS_MFOS12_Msk (0x1ul << SYS_GPE_MFOS_MFOS12_Pos) /*!< SYS_T::GPE_MFOS: MFOS12 Mask */ - -#define SYS_GPE_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPE_MFOS: MFOS13 Position */ -#define SYS_GPE_MFOS_MFOS13_Msk (0x1ul << SYS_GPE_MFOS_MFOS13_Pos) /*!< SYS_T::GPE_MFOS: MFOS13 Mask */ - -#define SYS_GPE_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPE_MFOS: MFOS14 Position */ -#define SYS_GPE_MFOS_MFOS14_Msk (0x1ul << SYS_GPE_MFOS_MFOS14_Pos) /*!< SYS_T::GPE_MFOS: MFOS14 Mask */ - -#define SYS_GPE_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPE_MFOS: MFOS15 Position */ -#define SYS_GPE_MFOS_MFOS15_Msk (0x1ul << SYS_GPE_MFOS_MFOS15_Pos) /*!< SYS_T::GPE_MFOS: MFOS15 Mask */ - -#define SYS_GPF_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPF_MFOS: MFOS0 Position */ -#define SYS_GPF_MFOS_MFOS0_Msk (0x1ul << SYS_GPF_MFOS_MFOS0_Pos) /*!< SYS_T::GPF_MFOS: MFOS0 Mask */ - -#define SYS_GPF_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPF_MFOS: MFOS1 Position */ -#define SYS_GPF_MFOS_MFOS1_Msk (0x1ul << SYS_GPF_MFOS_MFOS1_Pos) /*!< SYS_T::GPF_MFOS: MFOS1 Mask */ - -#define SYS_GPF_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPF_MFOS: MFOS2 Position */ -#define SYS_GPF_MFOS_MFOS2_Msk (0x1ul << SYS_GPF_MFOS_MFOS2_Pos) /*!< SYS_T::GPF_MFOS: MFOS2 Mask */ - -#define SYS_GPF_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPF_MFOS: MFOS3 Position */ -#define SYS_GPF_MFOS_MFOS3_Msk (0x1ul << SYS_GPF_MFOS_MFOS3_Pos) /*!< SYS_T::GPF_MFOS: MFOS3 Mask */ - -#define SYS_GPF_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPF_MFOS: MFOS4 Position */ -#define SYS_GPF_MFOS_MFOS4_Msk (0x1ul << SYS_GPF_MFOS_MFOS4_Pos) /*!< SYS_T::GPF_MFOS: MFOS4 Mask */ - -#define SYS_GPF_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPF_MFOS: MFOS5 Position */ -#define SYS_GPF_MFOS_MFOS5_Msk (0x1ul << SYS_GPF_MFOS_MFOS5_Pos) /*!< SYS_T::GPF_MFOS: MFOS5 Mask */ - -#define SYS_GPF_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPF_MFOS: MFOS6 Position */ -#define SYS_GPF_MFOS_MFOS6_Msk (0x1ul << SYS_GPF_MFOS_MFOS6_Pos) /*!< SYS_T::GPF_MFOS: MFOS6 Mask */ - -#define SYS_GPF_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPF_MFOS: MFOS7 Position */ -#define SYS_GPF_MFOS_MFOS7_Msk (0x1ul << SYS_GPF_MFOS_MFOS7_Pos) /*!< SYS_T::GPF_MFOS: MFOS7 Mask */ - -#define SYS_GPF_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPF_MFOS: MFOS8 Position */ -#define SYS_GPF_MFOS_MFOS8_Msk (0x1ul << SYS_GPF_MFOS_MFOS8_Pos) /*!< SYS_T::GPF_MFOS: MFOS8 Mask */ - -#define SYS_GPF_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPF_MFOS: MFOS9 Position */ -#define SYS_GPF_MFOS_MFOS9_Msk (0x1ul << SYS_GPF_MFOS_MFOS9_Pos) /*!< SYS_T::GPF_MFOS: MFOS9 Mask */ - -#define SYS_GPF_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPF_MFOS: MFOS10 Position */ -#define SYS_GPF_MFOS_MFOS10_Msk (0x1ul << SYS_GPF_MFOS_MFOS10_Pos) /*!< SYS_T::GPF_MFOS: MFOS10 Mask */ - -#define SYS_GPF_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPF_MFOS: MFOS11 Position */ -#define SYS_GPF_MFOS_MFOS11_Msk (0x1ul << SYS_GPF_MFOS_MFOS11_Pos) /*!< SYS_T::GPF_MFOS: MFOS11 Mask */ - -#define SYS_GPG_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPG_MFOS: MFOS0 Position */ -#define SYS_GPG_MFOS_MFOS0_Msk (0x1ul << SYS_GPG_MFOS_MFOS0_Pos) /*!< SYS_T::GPG_MFOS: MFOS0 Mask */ - -#define SYS_GPG_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPG_MFOS: MFOS1 Position */ -#define SYS_GPG_MFOS_MFOS1_Msk (0x1ul << SYS_GPG_MFOS_MFOS1_Pos) /*!< SYS_T::GPG_MFOS: MFOS1 Mask */ - -#define SYS_GPG_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPG_MFOS: MFOS2 Position */ -#define SYS_GPG_MFOS_MFOS2_Msk (0x1ul << SYS_GPG_MFOS_MFOS2_Pos) /*!< SYS_T::GPG_MFOS: MFOS2 Mask */ - -#define SYS_GPG_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPG_MFOS: MFOS3 Position */ -#define SYS_GPG_MFOS_MFOS3_Msk (0x1ul << SYS_GPG_MFOS_MFOS3_Pos) /*!< SYS_T::GPG_MFOS: MFOS3 Mask */ - -#define SYS_GPG_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPG_MFOS: MFOS4 Position */ -#define SYS_GPG_MFOS_MFOS4_Msk (0x1ul << SYS_GPG_MFOS_MFOS4_Pos) /*!< SYS_T::GPG_MFOS: MFOS4 Mask */ - -#define SYS_GPG_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPG_MFOS: MFOS5 Position */ -#define SYS_GPG_MFOS_MFOS5_Msk (0x1ul << SYS_GPG_MFOS_MFOS5_Pos) /*!< SYS_T::GPG_MFOS: MFOS5 Mask */ - -#define SYS_GPG_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPG_MFOS: MFOS6 Position */ -#define SYS_GPG_MFOS_MFOS6_Msk (0x1ul << SYS_GPG_MFOS_MFOS6_Pos) /*!< SYS_T::GPG_MFOS: MFOS6 Mask */ - -#define SYS_GPG_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPG_MFOS: MFOS7 Position */ -#define SYS_GPG_MFOS_MFOS7_Msk (0x1ul << SYS_GPG_MFOS_MFOS7_Pos) /*!< SYS_T::GPG_MFOS: MFOS7 Mask */ - -#define SYS_GPG_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPG_MFOS: MFOS8 Position */ -#define SYS_GPG_MFOS_MFOS8_Msk (0x1ul << SYS_GPG_MFOS_MFOS8_Pos) /*!< SYS_T::GPG_MFOS: MFOS8 Mask */ - -#define SYS_GPG_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPG_MFOS: MFOS9 Position */ -#define SYS_GPG_MFOS_MFOS9_Msk (0x1ul << SYS_GPG_MFOS_MFOS9_Pos) /*!< SYS_T::GPG_MFOS: MFOS9 Mask */ - -#define SYS_GPG_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPG_MFOS: MFOS10 Position */ -#define SYS_GPG_MFOS_MFOS10_Msk (0x1ul << SYS_GPG_MFOS_MFOS10_Pos) /*!< SYS_T::GPG_MFOS: MFOS10 Mask */ - -#define SYS_GPG_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPG_MFOS: MFOS11 Position */ -#define SYS_GPG_MFOS_MFOS11_Msk (0x1ul << SYS_GPG_MFOS_MFOS11_Pos) /*!< SYS_T::GPG_MFOS: MFOS11 Mask */ - -#define SYS_GPG_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPG_MFOS: MFOS12 Position */ -#define SYS_GPG_MFOS_MFOS12_Msk (0x1ul << SYS_GPG_MFOS_MFOS12_Pos) /*!< SYS_T::GPG_MFOS: MFOS12 Mask */ - -#define SYS_GPG_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPG_MFOS: MFOS13 Position */ -#define SYS_GPG_MFOS_MFOS13_Msk (0x1ul << SYS_GPG_MFOS_MFOS13_Pos) /*!< SYS_T::GPG_MFOS: MFOS13 Mask */ - -#define SYS_GPG_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPG_MFOS: MFOS14 Position */ -#define SYS_GPG_MFOS_MFOS14_Msk (0x1ul << SYS_GPG_MFOS_MFOS14_Pos) /*!< SYS_T::GPG_MFOS: MFOS14 Mask */ - -#define SYS_GPG_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPG_MFOS: MFOS15 Position */ -#define SYS_GPG_MFOS_MFOS15_Msk (0x1ul << SYS_GPG_MFOS_MFOS15_Pos) /*!< SYS_T::GPG_MFOS: MFOS15 Mask */ - -#define SYS_GPH_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPH_MFOS: MFOS0 Position */ -#define SYS_GPH_MFOS_MFOS0_Msk (0x1ul << SYS_GPH_MFOS_MFOS0_Pos) /*!< SYS_T::GPH_MFOS: MFOS0 Mask */ - -#define SYS_GPH_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPH_MFOS: MFOS1 Position */ -#define SYS_GPH_MFOS_MFOS1_Msk (0x1ul << SYS_GPH_MFOS_MFOS1_Pos) /*!< SYS_T::GPH_MFOS: MFOS1 Mask */ - -#define SYS_GPH_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPH_MFOS: MFOS2 Position */ -#define SYS_GPH_MFOS_MFOS2_Msk (0x1ul << SYS_GPH_MFOS_MFOS2_Pos) /*!< SYS_T::GPH_MFOS: MFOS2 Mask */ - -#define SYS_GPH_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPH_MFOS: MFOS3 Position */ -#define SYS_GPH_MFOS_MFOS3_Msk (0x1ul << SYS_GPH_MFOS_MFOS3_Pos) /*!< SYS_T::GPH_MFOS: MFOS3 Mask */ - -#define SYS_GPH_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPH_MFOS: MFOS4 Position */ -#define SYS_GPH_MFOS_MFOS4_Msk (0x1ul << SYS_GPH_MFOS_MFOS4_Pos) /*!< SYS_T::GPH_MFOS: MFOS4 Mask */ - -#define SYS_GPH_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPH_MFOS: MFOS5 Position */ -#define SYS_GPH_MFOS_MFOS5_Msk (0x1ul << SYS_GPH_MFOS_MFOS5_Pos) /*!< SYS_T::GPH_MFOS: MFOS5 Mask */ - -#define SYS_GPH_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPH_MFOS: MFOS6 Position */ -#define SYS_GPH_MFOS_MFOS6_Msk (0x1ul << SYS_GPH_MFOS_MFOS6_Pos) /*!< SYS_T::GPH_MFOS: MFOS6 Mask */ - -#define SYS_GPH_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPH_MFOS: MFOS7 Position */ -#define SYS_GPH_MFOS_MFOS7_Msk (0x1ul << SYS_GPH_MFOS_MFOS7_Pos) /*!< SYS_T::GPH_MFOS: MFOS7 Mask */ - -#define SYS_GPH_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPH_MFOS: MFOS8 Position */ -#define SYS_GPH_MFOS_MFOS8_Msk (0x1ul << SYS_GPH_MFOS_MFOS8_Pos) /*!< SYS_T::GPH_MFOS: MFOS8 Mask */ - -#define SYS_GPH_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPH_MFOS: MFOS9 Position */ -#define SYS_GPH_MFOS_MFOS9_Msk (0x1ul << SYS_GPH_MFOS_MFOS9_Pos) /*!< SYS_T::GPH_MFOS: MFOS9 Mask */ - -#define SYS_GPH_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPH_MFOS: MFOS10 Position */ -#define SYS_GPH_MFOS_MFOS10_Msk (0x1ul << SYS_GPH_MFOS_MFOS10_Pos) /*!< SYS_T::GPH_MFOS: MFOS10 Mask */ - -#define SYS_GPH_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPH_MFOS: MFOS11 Position */ -#define SYS_GPH_MFOS_MFOS11_Msk (0x1ul << SYS_GPH_MFOS_MFOS11_Pos) /*!< SYS_T::GPH_MFOS: MFOS11 Mask */ - -#define SYS_GPH_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPH_MFOS: MFOS12 Position */ -#define SYS_GPH_MFOS_MFOS12_Msk (0x1ul << SYS_GPH_MFOS_MFOS12_Pos) /*!< SYS_T::GPH_MFOS: MFOS12 Mask */ - -#define SYS_GPH_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPH_MFOS: MFOS13 Position */ -#define SYS_GPH_MFOS_MFOS13_Msk (0x1ul << SYS_GPH_MFOS_MFOS13_Pos) /*!< SYS_T::GPH_MFOS: MFOS13 Mask */ - -#define SYS_GPH_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPH_MFOS: MFOS14 Position */ -#define SYS_GPH_MFOS_MFOS14_Msk (0x1ul << SYS_GPH_MFOS_MFOS14_Pos) /*!< SYS_T::GPH_MFOS: MFOS14 Mask */ - -#define SYS_GPH_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPH_MFOS: MFOS15 Position */ -#define SYS_GPH_MFOS_MFOS15_Msk (0x1ul << SYS_GPH_MFOS_MFOS15_Pos) /*!< SYS_T::GPH_MFOS: MFOS15 Mask */ - -#define SYS_GPI_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPI_MFOS: MFOS6 Position */ -#define SYS_GPI_MFOS_MFOS6_Msk (0x1ul << SYS_GPI_MFOS_MFOS6_Pos) /*!< SYS_T::GPI_MFOS: MFOS6 Mask */ - -#define SYS_GPI_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPI_MFOS: MFOS7 Position */ -#define SYS_GPI_MFOS_MFOS7_Msk (0x1ul << SYS_GPI_MFOS_MFOS7_Pos) /*!< SYS_T::GPI_MFOS: MFOS7 Mask */ - -#define SYS_GPI_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPI_MFOS: MFOS8 Position */ -#define SYS_GPI_MFOS_MFOS8_Msk (0x1ul << SYS_GPI_MFOS_MFOS8_Pos) /*!< SYS_T::GPI_MFOS: MFOS8 Mask */ - -#define SYS_GPI_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPI_MFOS: MFOS9 Position */ -#define SYS_GPI_MFOS_MFOS9_Msk (0x1ul << SYS_GPI_MFOS_MFOS9_Pos) /*!< SYS_T::GPI_MFOS: MFOS9 Mask */ - -#define SYS_GPI_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPI_MFOS: MFOS10 Position */ -#define SYS_GPI_MFOS_MFOS10_Msk (0x1ul << SYS_GPI_MFOS_MFOS10_Pos) /*!< SYS_T::GPI_MFOS: MFOS10 Mask */ - -#define SYS_GPI_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPI_MFOS: MFOS11 Position */ -#define SYS_GPI_MFOS_MFOS11_Msk (0x1ul << SYS_GPI_MFOS_MFOS11_Pos) /*!< SYS_T::GPI_MFOS: MFOS11 Mask */ - -#define SYS_GPI_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPI_MFOS: MFOS12 Position */ -#define SYS_GPI_MFOS_MFOS12_Msk (0x1ul << SYS_GPI_MFOS_MFOS12_Pos) /*!< SYS_T::GPI_MFOS: MFOS12 Mask */ - -#define SYS_GPI_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPI_MFOS: MFOS13 Position */ -#define SYS_GPI_MFOS_MFOS13_Msk (0x1ul << SYS_GPI_MFOS_MFOS13_Pos) /*!< SYS_T::GPI_MFOS: MFOS13 Mask */ - -#define SYS_GPI_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPI_MFOS: MFOS14 Position */ -#define SYS_GPI_MFOS_MFOS14_Msk (0x1ul << SYS_GPI_MFOS_MFOS14_Pos) /*!< SYS_T::GPI_MFOS: MFOS14 Mask */ - -#define SYS_GPI_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPI_MFOS: MFOS15 Position */ -#define SYS_GPI_MFOS_MFOS15_Msk (0x1ul << SYS_GPI_MFOS_MFOS15_Pos) /*!< SYS_T::GPI_MFOS: MFOS15 Mask */ - -#define SYS_GPJ_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPJ_MFOS: MFOS0 Position */ -#define SYS_GPJ_MFOS_MFOS0_Msk (0x1ul << SYS_GPJ_MFOS_MFOS0_Pos) /*!< SYS_T::GPJ_MFOS: MFOS0 Mask */ - -#define SYS_GPJ_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPJ_MFOS: MFOS1 Position */ -#define SYS_GPJ_MFOS_MFOS1_Msk (0x1ul << SYS_GPJ_MFOS_MFOS1_Pos) /*!< SYS_T::GPJ_MFOS: MFOS1 Mask */ - -#define SYS_GPJ_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPJ_MFOS: MFOS2 Position */ -#define SYS_GPJ_MFOS_MFOS2_Msk (0x1ul << SYS_GPJ_MFOS_MFOS2_Pos) /*!< SYS_T::GPJ_MFOS: MFOS2 Mask */ - -#define SYS_GPJ_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPJ_MFOS: MFOS3 Position */ -#define SYS_GPJ_MFOS_MFOS3_Msk (0x1ul << SYS_GPJ_MFOS_MFOS3_Pos) /*!< SYS_T::GPJ_MFOS: MFOS3 Mask */ - -#define SYS_GPJ_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPJ_MFOS: MFOS4 Position */ -#define SYS_GPJ_MFOS_MFOS4_Msk (0x1ul << SYS_GPJ_MFOS_MFOS4_Pos) /*!< SYS_T::GPJ_MFOS: MFOS4 Mask */ - -#define SYS_GPJ_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPJ_MFOS: MFOS5 Position */ -#define SYS_GPJ_MFOS_MFOS5_Msk (0x1ul << SYS_GPJ_MFOS_MFOS5_Pos) /*!< SYS_T::GPJ_MFOS: MFOS5 Mask */ - -#define SYS_GPJ_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPJ_MFOS: MFOS6 Position */ -#define SYS_GPJ_MFOS_MFOS6_Msk (0x1ul << SYS_GPJ_MFOS_MFOS6_Pos) /*!< SYS_T::GPJ_MFOS: MFOS6 Mask */ - -#define SYS_GPJ_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPJ_MFOS: MFOS7 Position */ -#define SYS_GPJ_MFOS_MFOS7_Msk (0x1ul << SYS_GPJ_MFOS_MFOS7_Pos) /*!< SYS_T::GPJ_MFOS: MFOS7 Mask */ - -#define SYS_GPJ_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPJ_MFOS: MFOS8 Position */ -#define SYS_GPJ_MFOS_MFOS8_Msk (0x1ul << SYS_GPJ_MFOS_MFOS8_Pos) /*!< SYS_T::GPJ_MFOS: MFOS8 Mask */ - -#define SYS_GPJ_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPJ_MFOS: MFOS9 Position */ -#define SYS_GPJ_MFOS_MFOS9_Msk (0x1ul << SYS_GPJ_MFOS_MFOS9_Pos) /*!< SYS_T::GPJ_MFOS: MFOS9 Mask */ - -#define SYS_GPJ_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPJ_MFOS: MFOS10 Position */ -#define SYS_GPJ_MFOS_MFOS10_Msk (0x1ul << SYS_GPJ_MFOS_MFOS10_Pos) /*!< SYS_T::GPJ_MFOS: MFOS10 Mask */ - -#define SYS_GPJ_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPJ_MFOS: MFOS11 Position */ -#define SYS_GPJ_MFOS_MFOS11_Msk (0x1ul << SYS_GPJ_MFOS_MFOS11_Pos) /*!< SYS_T::GPJ_MFOS: MFOS11 Mask */ - -#define SYS_GPJ_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPJ_MFOS: MFOS12 Position */ -#define SYS_GPJ_MFOS_MFOS12_Msk (0x1ul << SYS_GPJ_MFOS_MFOS12_Pos) /*!< SYS_T::GPJ_MFOS: MFOS12 Mask */ - -#define SYS_GPJ_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPJ_MFOS: MFOS13 Position */ -#define SYS_GPJ_MFOS_MFOS13_Msk (0x1ul << SYS_GPJ_MFOS_MFOS13_Pos) /*!< SYS_T::GPJ_MFOS: MFOS13 Mask */ - -#define SYS_SRAM_INTCTL_PERRIEN_Pos (0) /*!< SYS_T::SRAM_INTCTL: PERRIEN Position */ -#define SYS_SRAM_INTCTL_PERRIEN_Msk (0x1ul << SYS_SRAM_INTCTL_PERRIEN_Pos) /*!< SYS_T::SRAM_INTCTL: PERRIEN Mask */ - -#define SYS_SRAM_STATUS_PERRIF_Pos (0) /*!< SYS_T::SRAM_STATUS: PERRIF Position */ -#define SYS_SRAM_STATUS_PERRIF_Msk (0x1ul << SYS_SRAM_STATUS_PERRIF_Pos) /*!< SYS_T::SRAM_STATUS: PERRIF Mask */ - -#define SYS_SRAM_ERRADDR_ERRADDR_Pos (0) /*!< SYS_T::SRAM_ERRADDR: ERRADDR Position */ -#define SYS_SRAM_ERRADDR_ERRADDR_Msk (0xfffffffful << SYS_SRAM_ERRADDR_ERRADDR_Pos) /*!< SYS_T::SRAM_ERRADDR: ERRADDR Mask */ - -#define SYS_SRAM_BISTCTL_SRBIST0_Pos (0) /*!< SYS_T::SRAM_BISTCTL: SRBIST0 Position */ -#define SYS_SRAM_BISTCTL_SRBIST0_Msk (0x1ul << SYS_SRAM_BISTCTL_SRBIST0_Pos) /*!< SYS_T::SRAM_BISTCTL: SRBIST0 Mask */ - -#define SYS_SRAM_BISTCTL_SRBIST1_Pos (1) /*!< SYS_T::SRAM_BISTCTL: SRBIST1 Position */ -#define SYS_SRAM_BISTCTL_SRBIST1_Msk (0x1ul << SYS_SRAM_BISTCTL_SRBIST1_Pos) /*!< SYS_T::SRAM_BISTCTL: SRBIST1 Mask */ - -#define SYS_SRAM_BISTCTL_CRBIST_Pos (2) /*!< SYS_T::SRAM_BISTCTL: CRBIST Position */ -#define SYS_SRAM_BISTCTL_CRBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_CRBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: CRBIST Mask */ - -#define SYS_SRAM_BISTCTL_CANBIST_Pos (3) /*!< SYS_T::SRAM_BISTCTL: CANBIST Position */ -#define SYS_SRAM_BISTCTL_CANBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_CANBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: CANBIST Mask */ - -#define SYS_SRAM_BISTCTL_USBBIST_Pos (4) /*!< SYS_T::SRAM_BISTCTL: USBBIST Position */ -#define SYS_SRAM_BISTCTL_USBBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_USBBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: USBBIST Mask */ - -#define SYS_SRAM_BISTCTL_SPIMBIST_Pos (5) /*!< SYS_T::SRAM_BISTCTL: SPIMBIST Position */ -#define SYS_SRAM_BISTCTL_SPIMBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_SPIMBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: SPIMBIST Mask */ - -#define SYS_SRAM_BISTCTL_EMAC0BIST_Pos (6) /*!< SYS_T::SRAM_BISTCTL: EMAC0BIST Position*/ -#define SYS_SRAM_BISTCTL_EMAC0BIST_Msk (0x1ul << SYS_SRAM_BISTCTL_EMAC0BIST_Pos) /*!< SYS_T::SRAM_BISTCTL: EMAC0BIST Mask */ - -#define SYS_SRAM_BISTCTL_HSUSBDBIST_Pos (8) /*!< SYS_T::SRAM_BISTCTL: HSUSBDBIST Position*/ -#define SYS_SRAM_BISTCTL_HSUSBDBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_HSUSBDBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: HSUSBDBIST Mask */ - -#define SYS_SRAM_BISTCTL_HSUSBHBIST_Pos (9) /*!< SYS_T::SRAM_BISTCTL: HSUSBHBIST Position*/ -#define SYS_SRAM_BISTCTL_HSUSBHBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_HSUSBHBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: HSUSBHBIST Mask */ - -#define SYS_SRAM_BISTCTL_SRBIST2_Pos (10) /*!< SYS_T::SRAM_BISTCTL: SRBIST2 Position */ -#define SYS_SRAM_BISTCTL_SRBIST2_Msk (0x1ul << SYS_SRAM_BISTCTL_SRBIST2_Pos) /*!< SYS_T::SRAM_BISTCTL: SRBIST2 Mask */ - -#define SYS_SRAM_BISTCTL_KSBIST_Pos (11) /*!< SYS_T::SRAM_BISTCTL: KSBIST Position */ -#define SYS_SRAM_BISTCTL_KSBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_KSBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: KSBIST Mask */ - -#define SYS_SRAM_BISTCTL_CCAPBIST_Pos (12) /*!< SYS_T::SRAM_BISTCTL: CCAPBIST Position */ -#define SYS_SRAM_BISTCTL_CCAPBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_CCAPBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: CCAPBIST Mask */ - -#define SYS_SRAM_BISTCTL_RSABIST_Pos (13) /*!< SYS_T::SRAM_BISTCTL: RSABIST Position */ -#define SYS_SRAM_BISTCTL_RSABIST_Msk (0x1ul << SYS_SRAM_BISTCTL_RSABIST_Pos) /*!< SYS_T::SRAM_BISTCTL: RSABIST Mask */ - -#define SYS_SRAM_BISTSTS_SRBISTEF0_Pos (0) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF0 Position*/ -#define SYS_SRAM_BISTSTS_SRBISTEF0_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBISTEF0_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF0 Mask */ - -#define SYS_SRAM_BISTSTS_SRBISTEF1_Pos (1) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF1 Position*/ -#define SYS_SRAM_BISTSTS_SRBISTEF1_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBISTEF1_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF1 Mask */ - -#define SYS_SRAM_BISTSTS_CRBISTEF_Pos (2) /*!< SYS_T::SRAM_BISTSTS: CRBISTEF Position */ -#define SYS_SRAM_BISTSTS_CRBISTEF_Msk (0x1ul << SYS_SRAM_BISTSTS_CRBISTEF_Pos) /*!< SYS_T::SRAM_BISTSTS: CRBISTEF Mask */ - -#define SYS_SRAM_BISTSTS_CANBEF_Pos (3) /*!< SYS_T::SRAM_BISTSTS: CANBEF Position */ -#define SYS_SRAM_BISTSTS_CANBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_CANBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: CANBEF Mask */ - -#define SYS_SRAM_BISTSTS_USBBEF_Pos (4) /*!< SYS_T::SRAM_BISTSTS: USBBEF Position */ -#define SYS_SRAM_BISTSTS_USBBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_USBBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: USBBEF Mask */ - -#define SYS_SRAM_BISTSTS_SPIMBEF_Pos (5) /*!< SYS_T::SRAM_BISTSTS: SPIMBEF Position */ -#define SYS_SRAM_BISTSTS_SPIMBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_SPIMBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: SPIMBEF Mask */ - -#define SYS_SRAM_BISTSTS_EMAC0BEF_Pos (6) /*!< SYS_T::SRAM_BISTSTS: EMAC0BEF Position */ -#define SYS_SRAM_BISTSTS_EMAC0BEF_Msk (0x1ul << SYS_SRAM_BISTSTS_EMAC0BEF_Pos) /*!< SYS_T::SRAM_BISTSTS: EMAC0BEF Mask */ - -#define SYS_SRAM_BISTSTS_HSUSBDBEF_Pos (8) /*!< SYS_T::SRAM_BISTSTS: HSUSBDBEF Position*/ -#define SYS_SRAM_BISTSTS_HSUSBDBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_HSUSBDBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: HSUSBDBEF Mask */ - -#define SYS_SRAM_BISTSTS_HSUSBHBEF_Pos (9) /*!< SYS_T::SRAM_BISTSTS: HSUSBHBEF Position*/ -#define SYS_SRAM_BISTSTS_HSUSBHBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_HSUSBHBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: HSUSBHBEF Mask */ - -#define SYS_SRAM_BISTSTS_SRBISTEF2_Pos (10) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF2 Position*/ -#define SYS_SRAM_BISTSTS_SRBISTEF2_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBISTEF2_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF2 Mask */ - -#define SYS_SRAM_BISTSTS_KSBISTEF_Pos (11) /*!< SYS_T::SRAM_BISTSTS: KSBISTEF Position */ -#define SYS_SRAM_BISTSTS_KSBISTEF_Msk (0x1ul << SYS_SRAM_BISTSTS_KSBISTEF_Pos) /*!< SYS_T::SRAM_BISTSTS: KSBISTEF Mask */ - -#define SYS_SRAM_BISTSTS_CCAPBISTEF_Pos (12) /*!< SYS_T::SRAM_BISTSTS: CCAPBISTEF Position*/ -#define SYS_SRAM_BISTSTS_CCAPBISTEF_Msk (0x1ul << SYS_SRAM_BISTSTS_CCAPBISTEF_Pos) /*!< SYS_T::SRAM_BISTSTS: CCAPBISTEF Mask */ - -#define SYS_SRAM_BISTSTS_RSABISTE_Pos (13) /*!< SYS_T::SRAM_BISTSTS: RSABISTE Position */ -#define SYS_SRAM_BISTSTS_RSABISTE_Msk (0x1ul << SYS_SRAM_BISTSTS_RSABISTE_Pos) /*!< SYS_T::SRAM_BISTSTS: RSABISTE Mask */ - -#define SYS_SRAM_BISTSTS_SRBEND0_Pos (16) /*!< SYS_T::SRAM_BISTSTS: SRBEND0 Position */ -#define SYS_SRAM_BISTSTS_SRBEND0_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBEND0_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBEND0 Mask */ - -#define SYS_SRAM_BISTSTS_SRBEND1_Pos (17) /*!< SYS_T::SRAM_BISTSTS: SRBEND1 Position */ -#define SYS_SRAM_BISTSTS_SRBEND1_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBEND1_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBEND1 Mask */ - -#define SYS_SRAM_BISTSTS_CRBEND_Pos (18) /*!< SYS_T::SRAM_BISTSTS: CRBEND Position */ -#define SYS_SRAM_BISTSTS_CRBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_CRBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: CRBEND Mask */ - -#define SYS_SRAM_BISTSTS_CANBEND_Pos (19) /*!< SYS_T::SRAM_BISTSTS: CANBEND Position */ -#define SYS_SRAM_BISTSTS_CANBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_CANBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: CANBEND Mask */ - -#define SYS_SRAM_BISTSTS_USBBEND_Pos (20) /*!< SYS_T::SRAM_BISTSTS: USBBEND Position */ -#define SYS_SRAM_BISTSTS_USBBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_USBBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: USBBEND Mask */ - -#define SYS_SRAM_BISTSTS_SPIMBEND_Pos (21) /*!< SYS_T::SRAM_BISTSTS: SPIMBEND Position */ -#define SYS_SRAM_BISTSTS_SPIMBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_SPIMBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: SPIMBEND Mask */ - -#define SYS_SRAM_BISTSTS_EMAC0BEND_Pos (22) /*!< SYS_T::SRAM_BISTSTS: EMAC0BEND Position*/ -#define SYS_SRAM_BISTSTS_EMAC0BEND_Msk (0x1ul << SYS_SRAM_BISTSTS_EMAC0BEND_Pos) /*!< SYS_T::SRAM_BISTSTS: EMAC0BEND Mask */ - -#define SYS_SRAM_BISTSTS_HSUSBDBEND_Pos (24) /*!< SYS_T::SRAM_BISTSTS: HSUSBDBEND Position*/ -#define SYS_SRAM_BISTSTS_HSUSBDBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_HSUSBDBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: HSUSBDBEND Mask */ - -#define SYS_SRAM_BISTSTS_HSUSBHBEND_Pos (25) /*!< SYS_T::SRAM_BISTSTS: HSUSBHBEND Position*/ -#define SYS_SRAM_BISTSTS_HSUSBHBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_HSUSBHBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: HSUSBHBEND Mask */ - -#define SYS_SRAM_BISTSTS_SRBEND2_Pos (26) /*!< SYS_T::SRAM_BISTSTS: SRBEND2 Position */ -#define SYS_SRAM_BISTSTS_SRBEND2_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBEND2_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBEND2 Mask */ - -#define SYS_SRAM_BISTSTS_KSBEND_Pos (27) /*!< SYS_T::SRAM_BISTSTS: KSBEND Position */ -#define SYS_SRAM_BISTSTS_KSBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_KSBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: KSBEND Mask */ - -#define SYS_SRAM_BISTSTS_CCAPBEND_Pos (28) /*!< SYS_T::SRAM_BISTSTS: CCAPBEND Position */ -#define SYS_SRAM_BISTSTS_CCAPBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_CCAPBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: CCAPBEND Mask */ - -#define SYS_SRAM_BISTSTS_RSABEND_Pos (29) /*!< SYS_T::SRAM_BISTSTS: RSABEND Position */ -#define SYS_SRAM_BISTSTS_RSABEND_Msk (0x1ul << SYS_SRAM_BISTSTS_RSABEND_Pos) /*!< SYS_T::SRAM_BISTSTS: RSABEND Mask */ - -#define SYS_HIRCTCTL_FREQSEL_Pos (0) /*!< SYS_T::HIRCTCTL: FREQSEL Position */ -#define SYS_HIRCTCTL_FREQSEL_Msk (0x3ul << SYS_HIRCTCTL_FREQSEL_Pos) /*!< SYS_T::HIRCTCTL: FREQSEL Mask */ - -#define SYS_HIRCTCTL_LOOPSEL_Pos (4) /*!< SYS_T::HIRCTCTL: LOOPSEL Position */ -#define SYS_HIRCTCTL_LOOPSEL_Msk (0x3ul << SYS_HIRCTCTL_LOOPSEL_Pos) /*!< SYS_T::HIRCTCTL: LOOPSEL Mask */ - -#define SYS_HIRCTCTL_RETRYCNT_Pos (6) /*!< SYS_T::HIRCTCTL: RETRYCNT Position */ -#define SYS_HIRCTCTL_RETRYCNT_Msk (0x3ul << SYS_HIRCTCTL_RETRYCNT_Pos) /*!< SYS_T::HIRCTCTL: RETRYCNT Mask */ - -#define SYS_HIRCTCTL_CESTOPEN_Pos (8) /*!< SYS_T::HIRCTCTL: CESTOPEN Position */ -#define SYS_HIRCTCTL_CESTOPEN_Msk (0x1ul << SYS_HIRCTCTL_CESTOPEN_Pos) /*!< SYS_T::HIRCTCTL: CESTOPEN Mask */ - -#define SYS_HIRCTCTL_BOUNDEN_Pos (9) /*!< SYS_T::HIRCTCTL: BOUNDEN Position */ -#define SYS_HIRCTCTL_BOUNDEN_Msk (0x1ul << SYS_HIRCTCTL_BOUNDEN_Pos) /*!< SYS_T::HIRCTCTL: BOUNDEN Mask */ - -#define SYS_HIRCTCTL_REFCKSEL_Pos (10) /*!< SYS_T::HIRCTCTL: REFCKSEL Position */ -#define SYS_HIRCTCTL_REFCKSEL_Msk (0x1ul << SYS_HIRCTCTL_REFCKSEL_Pos) /*!< SYS_T::HIRCTCTL: REFCKSEL Mask */ - -#define SYS_HIRCTCTL_BOUNDARY_Pos (16) /*!< SYS_T::HIRCTCTL: BOUNDARY Position */ -#define SYS_HIRCTCTL_BOUNDARY_Msk (0x1ful << SYS_HIRCTCTL_BOUNDARY_Pos) /*!< SYS_T::HIRCTCTL: BOUNDARY Mask */ - -#define SYS_HIRCTIEN_TFAILIEN_Pos (1) /*!< SYS_T::HIRCTIEN: TFAILIEN Position */ -#define SYS_HIRCTIEN_TFAILIEN_Msk (0x1ul << SYS_HIRCTIEN_TFAILIEN_Pos) /*!< SYS_T::HIRCTIEN: TFAILIEN Mask */ - -#define SYS_HIRCTIEN_CLKEIEN_Pos (2) /*!< SYS_T::HIRCTIEN: CLKEIEN Position */ -#define SYS_HIRCTIEN_CLKEIEN_Msk (0x1ul << SYS_HIRCTIEN_CLKEIEN_Pos) /*!< SYS_T::HIRCTIEN: CLKEIEN Mask */ - -#define SYS_HIRCTISTS_FREQLOCK_Pos (0) /*!< SYS_T::HIRCTISTS: FREQLOCK Position */ -#define SYS_HIRCTISTS_FREQLOCK_Msk (0x1ul << SYS_HIRCTISTS_FREQLOCK_Pos) /*!< SYS_T::HIRCTISTS: FREQLOCK Mask */ - -#define SYS_HIRCTISTS_TFAILIF_Pos (1) /*!< SYS_T::HIRCTISTS: TFAILIF Position */ -#define SYS_HIRCTISTS_TFAILIF_Msk (0x1ul << SYS_HIRCTISTS_TFAILIF_Pos) /*!< SYS_T::HIRCTISTS: TFAILIF Mask */ - -#define SYS_HIRCTISTS_CLKERRIF_Pos (2) /*!< SYS_T::HIRCTISTS: CLKERRIF Position */ -#define SYS_HIRCTISTS_CLKERRIF_Msk (0x1ul << SYS_HIRCTISTS_CLKERRIF_Pos) /*!< SYS_T::HIRCTISTS: CLKERRIF Mask */ - -#define SYS_HIRCTISTS_OVBDIF_Pos (3) /*!< SYS_T::HIRCTISTS: OVBDIF Position */ -#define SYS_HIRCTISTS_OVBDIF_Msk (0x1ul << SYS_HIRCTISTS_OVBDIF_Pos) /*!< SYS_T::HIRCTISTS: OVBDIF Mask */ - -#define SYS_IRCTCTL_FREQSEL_Pos (0) /*!< SYS_T::IRCTCTL: FREQSEL Position */ -#define SYS_IRCTCTL_FREQSEL_Msk (0x3ul << SYS_IRCTCTL_FREQSEL_Pos) /*!< SYS_T::IRCTCTL: FREQSEL Mask */ - -#define SYS_IRCTCTL_LOOPSEL_Pos (4) /*!< SYS_T::IRCTCTL: LOOPSEL Position */ -#define SYS_IRCTCTL_LOOPSEL_Msk (0x3ul << SYS_IRCTCTL_LOOPSEL_Pos) /*!< SYS_T::IRCTCTL: LOOPSEL Mask */ - -#define SYS_IRCTCTL_RETRYCNT_Pos (6) /*!< SYS_T::IRCTCTL: RETRYCNT Position */ -#define SYS_IRCTCTL_RETRYCNT_Msk (0x3ul << SYS_IRCTCTL_RETRYCNT_Pos) /*!< SYS_T::IRCTCTL: RETRYCNT Mask */ - -#define SYS_IRCTCTL_CESTOPEN_Pos (8) /*!< SYS_T::IRCTCTL: CESTOPEN Position */ -#define SYS_IRCTCTL_CESTOPEN_Msk (0x1ul << SYS_IRCTCTL_CESTOPEN_Pos) /*!< SYS_T::IRCTCTL: CESTOPEN Mask */ - -#define SYS_IRCTCTL_BOUNDEN_Pos (9) /*!< SYS_T::IRCTCTL: BOUNDEN Position */ -#define SYS_IRCTCTL_BOUNDEN_Msk (0x1ul << SYS_IRCTCTL_BOUNDEN_Pos) /*!< SYS_T::IRCTCTL: BOUNDEN Mask */ - -#define SYS_IRCTCTL_REFCKSEL_Pos (10) /*!< SYS_T::IRCTCTL: REFCKSEL Position */ -#define SYS_IRCTCTL_REFCKSEL_Msk (0x1ul << SYS_IRCTCTL_REFCKSEL_Pos) /*!< SYS_T::IRCTCTL: REFCKSEL Mask */ - -#define SYS_IRCTCTL_BOUNDARY_Pos (16) /*!< SYS_T::IRCTCTL: BOUNDARY Position */ -#define SYS_IRCTCTL_BOUNDARY_Msk (0x1ful << SYS_IRCTCTL_BOUNDARY_Pos) /*!< SYS_T::IRCTCTL: BOUNDARY Mask */ - -#define SYS_IRCTIEN_TFAILIEN_Pos (1) /*!< SYS_T::IRCTIEN: TFAILIEN Position */ -#define SYS_IRCTIEN_TFAILIEN_Msk (0x1ul << SYS_IRCTIEN_TFAILIEN_Pos) /*!< SYS_T::IRCTIEN: TFAILIEN Mask */ - -#define SYS_IRCTIEN_CLKEIEN_Pos (2) /*!< SYS_T::IRCTIEN: CLKEIEN Position */ -#define SYS_IRCTIEN_CLKEIEN_Msk (0x1ul << SYS_IRCTIEN_CLKEIEN_Pos) /*!< SYS_T::IRCTIEN: CLKEIEN Mask */ - -#define SYS_IRCTISTS_FREQLOCK_Pos (0) /*!< SYS_T::IRCTISTS: FREQLOCK Position */ -#define SYS_IRCTISTS_FREQLOCK_Msk (0x1ul << SYS_IRCTISTS_FREQLOCK_Pos) /*!< SYS_T::IRCTISTS: FREQLOCK Mask */ - -#define SYS_IRCTISTS_TFAILIF_Pos (1) /*!< SYS_T::IRCTISTS: TFAILIF Position */ -#define SYS_IRCTISTS_TFAILIF_Msk (0x1ul << SYS_IRCTISTS_TFAILIF_Pos) /*!< SYS_T::IRCTISTS: TFAILIF Mask */ - -#define SYS_IRCTISTS_CLKERRIF_Pos (2) /*!< SYS_T::IRCTISTS: CLKERRIF Position */ -#define SYS_IRCTISTS_CLKERRIF_Msk (0x1ul << SYS_IRCTISTS_CLKERRIF_Pos) /*!< SYS_T::IRCTISTS: CLKERRIF Mask */ - -#define SYS_IRCTISTS_OVBDIF_Pos (3) /*!< SYS_T::IRCTISTS: OVBDIF Position */ -#define SYS_IRCTISTS_OVBDIF_Msk (0x1ul << SYS_IRCTISTS_OVBDIF_Pos) /*!< SYS_T::IRCTISTS: OVBDIF Mask */ - -#define SYS_REGLCTL_REGLCTL_Pos (0) /*!< SYS_T::REGLCTL: REGLCTL Position */ -#define SYS_REGLCTL_REGLCTL_Msk (0xfful << SYS_REGLCTL_REGLCTL_Pos) /*!< SYS_T::REGLCTL: REGLCTL Mask */ - -#define SYS_PORDISAN_POROFFAN_Pos (0) /*!< SYS_T::PORDISAN: POROFFAN Position */ -#define SYS_PORDISAN_POROFFAN_Msk (0xfffful << SYS_PORDISAN_POROFFAN_Pos) /*!< SYS_T::PORDISAN: POROFFAN Mask */ - -#define SYS_CSERVER_VERSION_Pos (0) /*!< SYS_T::CSERVER: VERSION Position */ -#define SYS_CSERVER_VERSION_Msk (0xfful << SYS_CSERVER_VERSION_Pos) /*!< SYS_T::CSERVER: VERSION Mask */ - -#define SYS_PLCTL_PLSEL_Pos (0) /*!< SYS_T::PLCTL: PLSEL Position */ -#define SYS_PLCTL_PLSEL_Msk (0x3ul << SYS_PLCTL_PLSEL_Pos) /*!< SYS_T::PLCTL: PLSEL Mask */ - -#define SYS_PLCTL_LVSSTEP_Pos (16) /*!< SYS_T::PLCTL: LVSSTEP Position */ -#define SYS_PLCTL_LVSSTEP_Msk (0x3ful << SYS_PLCTL_LVSSTEP_Pos) /*!< SYS_T::PLCTL: LVSSTEP Mask */ - -#define SYS_PLCTL_LVSPRD_Pos (24) /*!< SYS_T::PLCTL: LVSPRD Position */ -#define SYS_PLCTL_LVSPRD_Msk (0xfful << SYS_PLCTL_LVSPRD_Pos) /*!< SYS_T::PLCTL: LVSPRD Mask */ - -#define SYS_PLSTS_PLCBUSY_Pos (0) /*!< SYS_T::PLSTS: PLCBUSY Position */ -#define SYS_PLSTS_PLCBUSY_Msk (0x1ul << SYS_PLSTS_PLCBUSY_Pos) /*!< SYS_T::PLSTS: PLCBUSY Mask */ - -#define SYS_PLSTS_PLSTATUS_Pos (8) /*!< SYS_T::PLSTS: PLSTATUS Position */ -#define SYS_PLSTS_PLSTATUS_Msk (0x3ul << SYS_PLSTS_PLSTATUS_Pos) /*!< SYS_T::PLSTS: PLSTATUS Mask */ - -#define SYS_AHBMCTL_INTACTEN_Pos (0) /*!< SYS_T::AHBMCTL: INTACTEN Position */ -#define SYS_AHBMCTL_INTACTEN_Msk (0x1ul << SYS_AHBMCTL_INTACTEN_Pos) /*!< SYS_T::AHBMCTL: INTACTEN Mask */ - -#define SYS_GPA_MFP0_PA0MFP_Pos (0) /*!< SYS_T::GPA_MFP0: PA0MFP Position */ -#define SYS_GPA_MFP0_PA0MFP_Msk (0x1ful << SYS_GPA_MFP0_PA0MFP_Pos) /*!< SYS_T::GPA_MFP0: PA0MFP Mask */ - -#define SYS_GPA_MFP0_PA1MFP_Pos (8) /*!< SYS_T::GPA_MFP0: PA1MFP Position */ -#define SYS_GPA_MFP0_PA1MFP_Msk (0x1ful << SYS_GPA_MFP0_PA1MFP_Pos) /*!< SYS_T::GPA_MFP0: PA1MFP Mask */ - -#define SYS_GPA_MFP0_PA2MFP_Pos (16) /*!< SYS_T::GPA_MFP0: PA2MFP Position */ -#define SYS_GPA_MFP0_PA2MFP_Msk (0x1ful << SYS_GPA_MFP0_PA2MFP_Pos) /*!< SYS_T::GPA_MFP0: PA2MFP Mask */ - -#define SYS_GPA_MFP0_PA3MFP_Pos (24) /*!< SYS_T::GPA_MFP0: PA3MFP Position */ -#define SYS_GPA_MFP0_PA3MFP_Msk (0x1ful << SYS_GPA_MFP0_PA3MFP_Pos) /*!< SYS_T::GPA_MFP0: PA3MFP Mask */ - -#define SYS_GPA_MFP1_PA4MFP_Pos (0) /*!< SYS_T::GPA_MFP1: PA4MFP Position */ -#define SYS_GPA_MFP1_PA4MFP_Msk (0x1ful << SYS_GPA_MFP1_PA4MFP_Pos) /*!< SYS_T::GPA_MFP1: PA4MFP Mask */ - -#define SYS_GPA_MFP1_PA5MFP_Pos (8) /*!< SYS_T::GPA_MFP1: PA5MFP Position */ -#define SYS_GPA_MFP1_PA5MFP_Msk (0x1ful << SYS_GPA_MFP1_PA5MFP_Pos) /*!< SYS_T::GPA_MFP1: PA5MFP Mask */ - -#define SYS_GPA_MFP1_PA6MFP_Pos (16) /*!< SYS_T::GPA_MFP1: PA6MFP Position */ -#define SYS_GPA_MFP1_PA6MFP_Msk (0x1ful << SYS_GPA_MFP1_PA6MFP_Pos) /*!< SYS_T::GPA_MFP1: PA6MFP Mask */ - -#define SYS_GPA_MFP1_PA7MFP_Pos (24) /*!< SYS_T::GPA_MFP1: PA7MFP Position */ -#define SYS_GPA_MFP1_PA7MFP_Msk (0x1ful << SYS_GPA_MFP1_PA7MFP_Pos) /*!< SYS_T::GPA_MFP1: PA7MFP Mask */ - -#define SYS_GPA_MFP2_PA8MFP_Pos (0) /*!< SYS_T::GPA_MFP2: PA8MFP Position */ -#define SYS_GPA_MFP2_PA8MFP_Msk (0x1ful << SYS_GPA_MFP2_PA8MFP_Pos) /*!< SYS_T::GPA_MFP2: PA8MFP Mask */ - -#define SYS_GPA_MFP2_PA9MFP_Pos (8) /*!< SYS_T::GPA_MFP2: PA9MFP Position */ -#define SYS_GPA_MFP2_PA9MFP_Msk (0x1ful << SYS_GPA_MFP2_PA9MFP_Pos) /*!< SYS_T::GPA_MFP2: PA9MFP Mask */ - -#define SYS_GPA_MFP2_PA10MFP_Pos (16) /*!< SYS_T::GPA_MFP2: PA10MFP Position */ -#define SYS_GPA_MFP2_PA10MFP_Msk (0x1ful << SYS_GPA_MFP2_PA10MFP_Pos) /*!< SYS_T::GPA_MFP2: PA10MFP Mask */ - -#define SYS_GPA_MFP2_PA11MFP_Pos (24) /*!< SYS_T::GPA_MFP2: PA11MFP Position */ -#define SYS_GPA_MFP2_PA11MFP_Msk (0x1ful << SYS_GPA_MFP2_PA11MFP_Pos) /*!< SYS_T::GPA_MFP2: PA11MFP Mask */ - -#define SYS_GPA_MFP3_PA12MFP_Pos (0) /*!< SYS_T::GPA_MFP3: PA12MFP Position */ -#define SYS_GPA_MFP3_PA12MFP_Msk (0x1ful << SYS_GPA_MFP3_PA12MFP_Pos) /*!< SYS_T::GPA_MFP3: PA12MFP Mask */ - -#define SYS_GPA_MFP3_PA13MFP_Pos (8) /*!< SYS_T::GPA_MFP3: PA13MFP Position */ -#define SYS_GPA_MFP3_PA13MFP_Msk (0x1ful << SYS_GPA_MFP3_PA13MFP_Pos) /*!< SYS_T::GPA_MFP3: PA13MFP Mask */ - -#define SYS_GPA_MFP3_PA14MFP_Pos (16) /*!< SYS_T::GPA_MFP3: PA14MFP Position */ -#define SYS_GPA_MFP3_PA14MFP_Msk (0x1ful << SYS_GPA_MFP3_PA14MFP_Pos) /*!< SYS_T::GPA_MFP3: PA14MFP Mask */ - -#define SYS_GPA_MFP3_PA15MFP_Pos (24) /*!< SYS_T::GPA_MFP3: PA15MFP Position */ -#define SYS_GPA_MFP3_PA15MFP_Msk (0x1ful << SYS_GPA_MFP3_PA15MFP_Pos) /*!< SYS_T::GPA_MFP3: PA15MFP Mask */ - -#define SYS_GPB_MFP0_PB0MFP_Pos (0) /*!< SYS_T::GPB_MFP0: PB0MFP Position */ -#define SYS_GPB_MFP0_PB0MFP_Msk (0x1ful << SYS_GPB_MFP0_PB0MFP_Pos) /*!< SYS_T::GPB_MFP0: PB0MFP Mask */ - -#define SYS_GPB_MFP0_PB1MFP_Pos (8) /*!< SYS_T::GPB_MFP0: PB1MFP Position */ -#define SYS_GPB_MFP0_PB1MFP_Msk (0x1ful << SYS_GPB_MFP0_PB1MFP_Pos) /*!< SYS_T::GPB_MFP0: PB1MFP Mask */ - -#define SYS_GPB_MFP0_PB2MFP_Pos (16) /*!< SYS_T::GPB_MFP0: PB2MFP Position */ -#define SYS_GPB_MFP0_PB2MFP_Msk (0x1ful << SYS_GPB_MFP0_PB2MFP_Pos) /*!< SYS_T::GPB_MFP0: PB2MFP Mask */ - -#define SYS_GPB_MFP0_PB3MFP_Pos (24) /*!< SYS_T::GPB_MFP0: PB3MFP Position */ -#define SYS_GPB_MFP0_PB3MFP_Msk (0x1ful << SYS_GPB_MFP0_PB3MFP_Pos) /*!< SYS_T::GPB_MFP0: PB3MFP Mask */ - -#define SYS_GPB_MFP1_PB4MFP_Pos (0) /*!< SYS_T::GPB_MFP1: PB4MFP Position */ -#define SYS_GPB_MFP1_PB4MFP_Msk (0x1ful << SYS_GPB_MFP1_PB4MFP_Pos) /*!< SYS_T::GPB_MFP1: PB4MFP Mask */ - -#define SYS_GPB_MFP1_PB5MFP_Pos (8) /*!< SYS_T::GPB_MFP1: PB5MFP Position */ -#define SYS_GPB_MFP1_PB5MFP_Msk (0x1ful << SYS_GPB_MFP1_PB5MFP_Pos) /*!< SYS_T::GPB_MFP1: PB5MFP Mask */ - -#define SYS_GPB_MFP1_PB6MFP_Pos (16) /*!< SYS_T::GPB_MFP1: PB6MFP Position */ -#define SYS_GPB_MFP1_PB6MFP_Msk (0x1ful << SYS_GPB_MFP1_PB6MFP_Pos) /*!< SYS_T::GPB_MFP1: PB6MFP Mask */ - -#define SYS_GPB_MFP1_PB7MFP_Pos (24) /*!< SYS_T::GPB_MFP1: PB7MFP Position */ -#define SYS_GPB_MFP1_PB7MFP_Msk (0x1ful << SYS_GPB_MFP1_PB7MFP_Pos) /*!< SYS_T::GPB_MFP1: PB7MFP Mask */ - -#define SYS_GPB_MFP2_PB8MFP_Pos (0) /*!< SYS_T::GPB_MFP2: PB8MFP Position */ -#define SYS_GPB_MFP2_PB8MFP_Msk (0x1ful << SYS_GPB_MFP2_PB8MFP_Pos) /*!< SYS_T::GPB_MFP2: PB8MFP Mask */ - -#define SYS_GPB_MFP2_PB9MFP_Pos (8) /*!< SYS_T::GPB_MFP2: PB9MFP Position */ -#define SYS_GPB_MFP2_PB9MFP_Msk (0x1ful << SYS_GPB_MFP2_PB9MFP_Pos) /*!< SYS_T::GPB_MFP2: PB9MFP Mask */ - -#define SYS_GPB_MFP2_PB10MFP_Pos (16) /*!< SYS_T::GPB_MFP2: PB10MFP Position */ -#define SYS_GPB_MFP2_PB10MFP_Msk (0x1ful << SYS_GPB_MFP2_PB10MFP_Pos) /*!< SYS_T::GPB_MFP2: PB10MFP Mask */ - -#define SYS_GPB_MFP2_PB11MFP_Pos (24) /*!< SYS_T::GPB_MFP2: PB11MFP Position */ -#define SYS_GPB_MFP2_PB11MFP_Msk (0x1ful << SYS_GPB_MFP2_PB11MFP_Pos) /*!< SYS_T::GPB_MFP2: PB11MFP Mask */ - -#define SYS_GPB_MFP3_PB12MFP_Pos (0) /*!< SYS_T::GPB_MFP3: PB12MFP Position */ -#define SYS_GPB_MFP3_PB12MFP_Msk (0x1ful << SYS_GPB_MFP3_PB12MFP_Pos) /*!< SYS_T::GPB_MFP3: PB12MFP Mask */ - -#define SYS_GPB_MFP3_PB13MFP_Pos (8) /*!< SYS_T::GPB_MFP3: PB13MFP Position */ -#define SYS_GPB_MFP3_PB13MFP_Msk (0x1ful << SYS_GPB_MFP3_PB13MFP_Pos) /*!< SYS_T::GPB_MFP3: PB13MFP Mask */ - -#define SYS_GPB_MFP3_PB14MFP_Pos (16) /*!< SYS_T::GPB_MFP3: PB14MFP Position */ -#define SYS_GPB_MFP3_PB14MFP_Msk (0x1ful << SYS_GPB_MFP3_PB14MFP_Pos) /*!< SYS_T::GPB_MFP3: PB14MFP Mask */ - -#define SYS_GPB_MFP3_PB15MFP_Pos (24) /*!< SYS_T::GPB_MFP3: PB15MFP Position */ -#define SYS_GPB_MFP3_PB15MFP_Msk (0x1ful << SYS_GPB_MFP3_PB15MFP_Pos) /*!< SYS_T::GPB_MFP3: PB15MFP Mask */ - -#define SYS_GPC_MFP0_PC0MFP_Pos (0) /*!< SYS_T::GPC_MFP0: PC0MFP Position */ -#define SYS_GPC_MFP0_PC0MFP_Msk (0x1ful << SYS_GPC_MFP0_PC0MFP_Pos) /*!< SYS_T::GPC_MFP0: PC0MFP Mask */ - -#define SYS_GPC_MFP0_PC1MFP_Pos (8) /*!< SYS_T::GPC_MFP0: PC1MFP Position */ -#define SYS_GPC_MFP0_PC1MFP_Msk (0x1ful << SYS_GPC_MFP0_PC1MFP_Pos) /*!< SYS_T::GPC_MFP0: PC1MFP Mask */ - -#define SYS_GPC_MFP0_PC2MFP_Pos (16) /*!< SYS_T::GPC_MFP0: PC2MFP Position */ -#define SYS_GPC_MFP0_PC2MFP_Msk (0x1ful << SYS_GPC_MFP0_PC2MFP_Pos) /*!< SYS_T::GPC_MFP0: PC2MFP Mask */ - -#define SYS_GPC_MFP0_PC3MFP_Pos (24) /*!< SYS_T::GPC_MFP0: PC3MFP Position */ -#define SYS_GPC_MFP0_PC3MFP_Msk (0x1ful << SYS_GPC_MFP0_PC3MFP_Pos) /*!< SYS_T::GPC_MFP0: PC3MFP Mask */ - -#define SYS_GPC_MFP1_PC4MFP_Pos (0) /*!< SYS_T::GPC_MFP1: PC4MFP Position */ -#define SYS_GPC_MFP1_PC4MFP_Msk (0x1ful << SYS_GPC_MFP1_PC4MFP_Pos) /*!< SYS_T::GPC_MFP1: PC4MFP Mask */ - -#define SYS_GPC_MFP1_PC5MFP_Pos (8) /*!< SYS_T::GPC_MFP1: PC5MFP Position */ -#define SYS_GPC_MFP1_PC5MFP_Msk (0x1ful << SYS_GPC_MFP1_PC5MFP_Pos) /*!< SYS_T::GPC_MFP1: PC5MFP Mask */ - -#define SYS_GPC_MFP1_PC6MFP_Pos (16) /*!< SYS_T::GPC_MFP1: PC6MFP Position */ -#define SYS_GPC_MFP1_PC6MFP_Msk (0x1ful << SYS_GPC_MFP1_PC6MFP_Pos) /*!< SYS_T::GPC_MFP1: PC6MFP Mask */ - -#define SYS_GPC_MFP1_PC7MFP_Pos (24) /*!< SYS_T::GPC_MFP1: PC7MFP Position */ -#define SYS_GPC_MFP1_PC7MFP_Msk (0x1ful << SYS_GPC_MFP1_PC7MFP_Pos) /*!< SYS_T::GPC_MFP1: PC7MFP Mask */ - -#define SYS_GPC_MFP2_PC8MFP_Pos (0) /*!< SYS_T::GPC_MFP2: PC8MFP Position */ -#define SYS_GPC_MFP2_PC8MFP_Msk (0x1ful << SYS_GPC_MFP2_PC8MFP_Pos) /*!< SYS_T::GPC_MFP2: PC8MFP Mask */ - -#define SYS_GPC_MFP2_PC9MFP_Pos (8) /*!< SYS_T::GPC_MFP2: PC9MFP Position */ -#define SYS_GPC_MFP2_PC9MFP_Msk (0x1ful << SYS_GPC_MFP2_PC9MFP_Pos) /*!< SYS_T::GPC_MFP2: PC9MFP Mask */ - -#define SYS_GPC_MFP2_PC10MFP_Pos (16) /*!< SYS_T::GPC_MFP2: PC10MFP Position */ -#define SYS_GPC_MFP2_PC10MFP_Msk (0x1ful << SYS_GPC_MFP2_PC10MFP_Pos) /*!< SYS_T::GPC_MFP2: PC10MFP Mask */ - -#define SYS_GPC_MFP2_PC11MFP_Pos (24) /*!< SYS_T::GPC_MFP2: PC11MFP Position */ -#define SYS_GPC_MFP2_PC11MFP_Msk (0x1ful << SYS_GPC_MFP2_PC11MFP_Pos) /*!< SYS_T::GPC_MFP2: PC11MFP Mask */ - -#define SYS_GPC_MFP3_PC12MFP_Pos (0) /*!< SYS_T::GPC_MFP3: PC12MFP Position */ -#define SYS_GPC_MFP3_PC12MFP_Msk (0x1ful << SYS_GPC_MFP3_PC12MFP_Pos) /*!< SYS_T::GPC_MFP3: PC12MFP Mask */ - -#define SYS_GPC_MFP3_PC13MFP_Pos (8) /*!< SYS_T::GPC_MFP3: PC13MFP Position */ -#define SYS_GPC_MFP3_PC13MFP_Msk (0x1ful << SYS_GPC_MFP3_PC13MFP_Pos) /*!< SYS_T::GPC_MFP3: PC13MFP Mask */ - -#define SYS_GPC_MFP3_PC14MFP_Pos (16) /*!< SYS_T::GPC_MFP3: PC14MFP Position */ -#define SYS_GPC_MFP3_PC14MFP_Msk (0x1ful << SYS_GPC_MFP3_PC14MFP_Pos) /*!< SYS_T::GPC_MFP3: PC14MFP Mask */ - -#define SYS_GPD_MFP0_PD0MFP_Pos (0) /*!< SYS_T::GPD_MFP0: PD0MFP Position */ -#define SYS_GPD_MFP0_PD0MFP_Msk (0x1ful << SYS_GPD_MFP0_PD0MFP_Pos) /*!< SYS_T::GPD_MFP0: PD0MFP Mask */ - -#define SYS_GPD_MFP0_PD1MFP_Pos (8) /*!< SYS_T::GPD_MFP0: PD1MFP Position */ -#define SYS_GPD_MFP0_PD1MFP_Msk (0x1ful << SYS_GPD_MFP0_PD1MFP_Pos) /*!< SYS_T::GPD_MFP0: PD1MFP Mask */ - -#define SYS_GPD_MFP0_PD2MFP_Pos (16) /*!< SYS_T::GPD_MFP0: PD2MFP Position */ -#define SYS_GPD_MFP0_PD2MFP_Msk (0x1ful << SYS_GPD_MFP0_PD2MFP_Pos) /*!< SYS_T::GPD_MFP0: PD2MFP Mask */ - -#define SYS_GPD_MFP0_PD3MFP_Pos (24) /*!< SYS_T::GPD_MFP0: PD3MFP Position */ -#define SYS_GPD_MFP0_PD3MFP_Msk (0x1ful << SYS_GPD_MFP0_PD3MFP_Pos) /*!< SYS_T::GPD_MFP0: PD3MFP Mask */ - -#define SYS_GPD_MFP1_PD4MFP_Pos (0) /*!< SYS_T::GPD_MFP1: PD4MFP Position */ -#define SYS_GPD_MFP1_PD4MFP_Msk (0x1ful << SYS_GPD_MFP1_PD4MFP_Pos) /*!< SYS_T::GPD_MFP1: PD4MFP Mask */ - -#define SYS_GPD_MFP1_PD5MFP_Pos (8) /*!< SYS_T::GPD_MFP1: PD5MFP Position */ -#define SYS_GPD_MFP1_PD5MFP_Msk (0x1ful << SYS_GPD_MFP1_PD5MFP_Pos) /*!< SYS_T::GPD_MFP1: PD5MFP Mask */ - -#define SYS_GPD_MFP1_PD6MFP_Pos (16) /*!< SYS_T::GPD_MFP1: PD6MFP Position */ -#define SYS_GPD_MFP1_PD6MFP_Msk (0x1ful << SYS_GPD_MFP1_PD6MFP_Pos) /*!< SYS_T::GPD_MFP1: PD6MFP Mask */ - -#define SYS_GPD_MFP1_PD7MFP_Pos (24) /*!< SYS_T::GPD_MFP1: PD7MFP Position */ -#define SYS_GPD_MFP1_PD7MFP_Msk (0x1ful << SYS_GPD_MFP1_PD7MFP_Pos) /*!< SYS_T::GPD_MFP1: PD7MFP Mask */ - -#define SYS_GPD_MFP2_PD8MFP_Pos (0) /*!< SYS_T::GPD_MFP2: PD8MFP Position */ -#define SYS_GPD_MFP2_PD8MFP_Msk (0x1ful << SYS_GPD_MFP2_PD8MFP_Pos) /*!< SYS_T::GPD_MFP2: PD8MFP Mask */ - -#define SYS_GPD_MFP2_PD9MFP_Pos (8) /*!< SYS_T::GPD_MFP2: PD9MFP Position */ -#define SYS_GPD_MFP2_PD9MFP_Msk (0x1ful << SYS_GPD_MFP2_PD9MFP_Pos) /*!< SYS_T::GPD_MFP2: PD9MFP Mask */ - -#define SYS_GPD_MFP2_PD10MFP_Pos (16) /*!< SYS_T::GPD_MFP2: PD10MFP Position */ -#define SYS_GPD_MFP2_PD10MFP_Msk (0x1ful << SYS_GPD_MFP2_PD10MFP_Pos) /*!< SYS_T::GPD_MFP2: PD10MFP Mask */ - -#define SYS_GPD_MFP2_PD11MFP_Pos (24) /*!< SYS_T::GPD_MFP2: PD11MFP Position */ -#define SYS_GPD_MFP2_PD11MFP_Msk (0x1ful << SYS_GPD_MFP2_PD11MFP_Pos) /*!< SYS_T::GPD_MFP2: PD11MFP Mask */ - -#define SYS_GPD_MFP3_PD12MFP_Pos (0) /*!< SYS_T::GPD_MFP3: PD12MFP Position */ -#define SYS_GPD_MFP3_PD12MFP_Msk (0x1ful << SYS_GPD_MFP3_PD12MFP_Pos) /*!< SYS_T::GPD_MFP3: PD12MFP Mask */ - -#define SYS_GPD_MFP3_PD13MFP_Pos (8) /*!< SYS_T::GPD_MFP3: PD13MFP Position */ -#define SYS_GPD_MFP3_PD13MFP_Msk (0x1ful << SYS_GPD_MFP3_PD13MFP_Pos) /*!< SYS_T::GPD_MFP3: PD13MFP Mask */ - -#define SYS_GPD_MFP3_PD14MFP_Pos (16) /*!< SYS_T::GPD_MFP3: PD14MFP Position */ -#define SYS_GPD_MFP3_PD14MFP_Msk (0x1ful << SYS_GPD_MFP3_PD14MFP_Pos) /*!< SYS_T::GPD_MFP3: PD14MFP Mask */ - -#define SYS_GPE_MFP0_PE0MFP_Pos (0) /*!< SYS_T::GPE_MFP0: PE0MFP Position */ -#define SYS_GPE_MFP0_PE0MFP_Msk (0x1ful << SYS_GPE_MFP0_PE0MFP_Pos) /*!< SYS_T::GPE_MFP0: PE0MFP Mask */ - -#define SYS_GPE_MFP0_PE1MFP_Pos (8) /*!< SYS_T::GPE_MFP0: PE1MFP Position */ -#define SYS_GPE_MFP0_PE1MFP_Msk (0x1ful << SYS_GPE_MFP0_PE1MFP_Pos) /*!< SYS_T::GPE_MFP0: PE1MFP Mask */ - -#define SYS_GPE_MFP0_PE2MFP_Pos (16) /*!< SYS_T::GPE_MFP0: PE2MFP Position */ -#define SYS_GPE_MFP0_PE2MFP_Msk (0x1ful << SYS_GPE_MFP0_PE2MFP_Pos) /*!< SYS_T::GPE_MFP0: PE2MFP Mask */ - -#define SYS_GPE_MFP0_PE3MFP_Pos (24) /*!< SYS_T::GPE_MFP0: PE3MFP Position */ -#define SYS_GPE_MFP0_PE3MFP_Msk (0x1ful << SYS_GPE_MFP0_PE3MFP_Pos) /*!< SYS_T::GPE_MFP0: PE3MFP Mask */ - -#define SYS_GPE_MFP1_PE4MFP_Pos (0) /*!< SYS_T::GPE_MFP1: PE4MFP Position */ -#define SYS_GPE_MFP1_PE4MFP_Msk (0x1ful << SYS_GPE_MFP1_PE4MFP_Pos) /*!< SYS_T::GPE_MFP1: PE4MFP Mask */ - -#define SYS_GPE_MFP1_PE5MFP_Pos (8) /*!< SYS_T::GPE_MFP1: PE5MFP Position */ -#define SYS_GPE_MFP1_PE5MFP_Msk (0x1ful << SYS_GPE_MFP1_PE5MFP_Pos) /*!< SYS_T::GPE_MFP1: PE5MFP Mask */ - -#define SYS_GPE_MFP1_PE6MFP_Pos (16) /*!< SYS_T::GPE_MFP1: PE6MFP Position */ -#define SYS_GPE_MFP1_PE6MFP_Msk (0x1ful << SYS_GPE_MFP1_PE6MFP_Pos) /*!< SYS_T::GPE_MFP1: PE6MFP Mask */ - -#define SYS_GPE_MFP1_PE7MFP_Pos (24) /*!< SYS_T::GPE_MFP1: PE7MFP Position */ -#define SYS_GPE_MFP1_PE7MFP_Msk (0x1ful << SYS_GPE_MFP1_PE7MFP_Pos) /*!< SYS_T::GPE_MFP1: PE7MFP Mask */ - -#define SYS_GPE_MFP2_PE8MFP_Pos (0) /*!< SYS_T::GPE_MFP2: PE8MFP Position */ -#define SYS_GPE_MFP2_PE8MFP_Msk (0x1ful << SYS_GPE_MFP2_PE8MFP_Pos) /*!< SYS_T::GPE_MFP2: PE8MFP Mask */ - -#define SYS_GPE_MFP2_PE9MFP_Pos (8) /*!< SYS_T::GPE_MFP2: PE9MFP Position */ -#define SYS_GPE_MFP2_PE9MFP_Msk (0x1ful << SYS_GPE_MFP2_PE9MFP_Pos) /*!< SYS_T::GPE_MFP2: PE9MFP Mask */ - -#define SYS_GPE_MFP2_PE10MFP_Pos (16) /*!< SYS_T::GPE_MFP2: PE10MFP Position */ -#define SYS_GPE_MFP2_PE10MFP_Msk (0x1ful << SYS_GPE_MFP2_PE10MFP_Pos) /*!< SYS_T::GPE_MFP2: PE10MFP Mask */ - -#define SYS_GPE_MFP2_PE11MFP_Pos (24) /*!< SYS_T::GPE_MFP2: PE11MFP Position */ -#define SYS_GPE_MFP2_PE11MFP_Msk (0x1ful << SYS_GPE_MFP2_PE11MFP_Pos) /*!< SYS_T::GPE_MFP2: PE11MFP Mask */ - -#define SYS_GPE_MFP3_PE12MFP_Pos (0) /*!< SYS_T::GPE_MFP3: PE12MFP Position */ -#define SYS_GPE_MFP3_PE12MFP_Msk (0x1ful << SYS_GPE_MFP3_PE12MFP_Pos) /*!< SYS_T::GPE_MFP3: PE12MFP Mask */ - -#define SYS_GPE_MFP3_PE13MFP_Pos (8) /*!< SYS_T::GPE_MFP3: PE13MFP Position */ -#define SYS_GPE_MFP3_PE13MFP_Msk (0x1ful << SYS_GPE_MFP3_PE13MFP_Pos) /*!< SYS_T::GPE_MFP3: PE13MFP Mask */ - -#define SYS_GPE_MFP3_PE14MFP_Pos (16) /*!< SYS_T::GPE_MFP3: PE14MFP Position */ -#define SYS_GPE_MFP3_PE14MFP_Msk (0x1ful << SYS_GPE_MFP3_PE14MFP_Pos) /*!< SYS_T::GPE_MFP3: PE14MFP Mask */ - -#define SYS_GPE_MFP3_PE15MFP_Pos (24) /*!< SYS_T::GPE_MFP3: PE15MFP Position */ -#define SYS_GPE_MFP3_PE15MFP_Msk (0x1ful << SYS_GPE_MFP3_PE15MFP_Pos) /*!< SYS_T::GPE_MFP3: PE15MFP Mask */ - -#define SYS_GPF_MFP0_PF0MFP_Pos (0) /*!< SYS_T::GPF_MFP0: PF0MFP Position */ -#define SYS_GPF_MFP0_PF0MFP_Msk (0x1ful << SYS_GPF_MFP0_PF0MFP_Pos) /*!< SYS_T::GPF_MFP0: PF0MFP Mask */ - -#define SYS_GPF_MFP0_PF1MFP_Pos (8) /*!< SYS_T::GPF_MFP0: PF1MFP Position */ -#define SYS_GPF_MFP0_PF1MFP_Msk (0x1ful << SYS_GPF_MFP0_PF1MFP_Pos) /*!< SYS_T::GPF_MFP0: PF1MFP Mask */ - -#define SYS_GPF_MFP0_PF2MFP_Pos (16) /*!< SYS_T::GPF_MFP0: PF2MFP Position */ -#define SYS_GPF_MFP0_PF2MFP_Msk (0x1ful << SYS_GPF_MFP0_PF2MFP_Pos) /*!< SYS_T::GPF_MFP0: PF2MFP Mask */ - -#define SYS_GPF_MFP0_PF3MFP_Pos (24) /*!< SYS_T::GPF_MFP0: PF3MFP Position */ -#define SYS_GPF_MFP0_PF3MFP_Msk (0x1ful << SYS_GPF_MFP0_PF3MFP_Pos) /*!< SYS_T::GPF_MFP0: PF3MFP Mask */ - -#define SYS_GPF_MFP1_PF4MFP_Pos (0) /*!< SYS_T::GPF_MFP1: PF4MFP Position */ -#define SYS_GPF_MFP1_PF4MFP_Msk (0x1ful << SYS_GPF_MFP1_PF4MFP_Pos) /*!< SYS_T::GPF_MFP1: PF4MFP Mask */ - -#define SYS_GPF_MFP1_PF5MFP_Pos (8) /*!< SYS_T::GPF_MFP1: PF5MFP Position */ -#define SYS_GPF_MFP1_PF5MFP_Msk (0x1ful << SYS_GPF_MFP1_PF5MFP_Pos) /*!< SYS_T::GPF_MFP1: PF5MFP Mask */ - -#define SYS_GPF_MFP1_PF6MFP_Pos (16) /*!< SYS_T::GPF_MFP1: PF6MFP Position */ -#define SYS_GPF_MFP1_PF6MFP_Msk (0x1ful << SYS_GPF_MFP1_PF6MFP_Pos) /*!< SYS_T::GPF_MFP1: PF6MFP Mask */ - -#define SYS_GPF_MFP1_PF7MFP_Pos (24) /*!< SYS_T::GPF_MFP1: PF7MFP Position */ -#define SYS_GPF_MFP1_PF7MFP_Msk (0x1ful << SYS_GPF_MFP1_PF7MFP_Pos) /*!< SYS_T::GPF_MFP1: PF7MFP Mask */ - -#define SYS_GPF_MFP2_PF8MFP_Pos (0) /*!< SYS_T::GPF_MFP2: PF8MFP Position */ -#define SYS_GPF_MFP2_PF8MFP_Msk (0x1ful << SYS_GPF_MFP2_PF8MFP_Pos) /*!< SYS_T::GPF_MFP2: PF8MFP Mask */ - -#define SYS_GPF_MFP2_PF9MFP_Pos (8) /*!< SYS_T::GPF_MFP2: PF9MFP Position */ -#define SYS_GPF_MFP2_PF9MFP_Msk (0x1ful << SYS_GPF_MFP2_PF9MFP_Pos) /*!< SYS_T::GPF_MFP2: PF9MFP Mask */ - -#define SYS_GPF_MFP2_PF10MFP_Pos (16) /*!< SYS_T::GPF_MFP2: PF10MFP Position */ -#define SYS_GPF_MFP2_PF10MFP_Msk (0x1ful << SYS_GPF_MFP2_PF10MFP_Pos) /*!< SYS_T::GPF_MFP2: PF10MFP Mask */ - -#define SYS_GPF_MFP2_PF11MFP_Pos (24) /*!< SYS_T::GPF_MFP2: PF11MFP Position */ -#define SYS_GPF_MFP2_PF11MFP_Msk (0x1ful << SYS_GPF_MFP2_PF11MFP_Pos) /*!< SYS_T::GPF_MFP2: PF11MFP Mask */ - -#define SYS_GPG_MFP0_PG0MFP_Pos (0) /*!< SYS_T::GPG_MFP0: PG0MFP Position */ -#define SYS_GPG_MFP0_PG0MFP_Msk (0x1ful << SYS_GPG_MFP0_PG0MFP_Pos) /*!< SYS_T::GPG_MFP0: PG0MFP Mask */ - -#define SYS_GPG_MFP0_PG1MFP_Pos (8) /*!< SYS_T::GPG_MFP0: PG1MFP Position */ -#define SYS_GPG_MFP0_PG1MFP_Msk (0x1ful << SYS_GPG_MFP0_PG1MFP_Pos) /*!< SYS_T::GPG_MFP0: PG1MFP Mask */ - -#define SYS_GPG_MFP0_PG2MFP_Pos (16) /*!< SYS_T::GPG_MFP0: PG2MFP Position */ -#define SYS_GPG_MFP0_PG2MFP_Msk (0x1ful << SYS_GPG_MFP0_PG2MFP_Pos) /*!< SYS_T::GPG_MFP0: PG2MFP Mask */ - -#define SYS_GPG_MFP0_PG3MFP_Pos (24) /*!< SYS_T::GPG_MFP0: PG3MFP Position */ -#define SYS_GPG_MFP0_PG3MFP_Msk (0x1ful << SYS_GPG_MFP0_PG3MFP_Pos) /*!< SYS_T::GPG_MFP0: PG3MFP Mask */ - -#define SYS_GPG_MFP1_PG4MFP_Pos (0) /*!< SYS_T::GPG_MFP1: PG4MFP Position */ -#define SYS_GPG_MFP1_PG4MFP_Msk (0x1ful << SYS_GPG_MFP1_PG4MFP_Pos) /*!< SYS_T::GPG_MFP1: PG4MFP Mask */ - -#define SYS_GPG_MFP1_PG5MFP_Pos (8) /*!< SYS_T::GPG_MFP1: PG5MFP Position */ -#define SYS_GPG_MFP1_PG5MFP_Msk (0x1ful << SYS_GPG_MFP1_PG5MFP_Pos) /*!< SYS_T::GPG_MFP1: PG5MFP Mask */ - -#define SYS_GPG_MFP1_PG6MFP_Pos (16) /*!< SYS_T::GPG_MFP1: PG6MFP Position */ -#define SYS_GPG_MFP1_PG6MFP_Msk (0x1ful << SYS_GPG_MFP1_PG6MFP_Pos) /*!< SYS_T::GPG_MFP1: PG6MFP Mask */ - -#define SYS_GPG_MFP1_PG7MFP_Pos (24) /*!< SYS_T::GPG_MFP1: PG7MFP Position */ -#define SYS_GPG_MFP1_PG7MFP_Msk (0x1ful << SYS_GPG_MFP1_PG7MFP_Pos) /*!< SYS_T::GPG_MFP1: PG7MFP Mask */ - -#define SYS_GPG_MFP2_PG8MFP_Pos (0) /*!< SYS_T::GPG_MFP2: PG8MFP Position */ -#define SYS_GPG_MFP2_PG8MFP_Msk (0x1ful << SYS_GPG_MFP2_PG8MFP_Pos) /*!< SYS_T::GPG_MFP2: PG8MFP Mask */ - -#define SYS_GPG_MFP2_PG9MFP_Pos (8) /*!< SYS_T::GPG_MFP2: PG9MFP Position */ -#define SYS_GPG_MFP2_PG9MFP_Msk (0x1ful << SYS_GPG_MFP2_PG9MFP_Pos) /*!< SYS_T::GPG_MFP2: PG9MFP Mask */ - -#define SYS_GPG_MFP2_PG10MFP_Pos (16) /*!< SYS_T::GPG_MFP2: PG10MFP Position */ -#define SYS_GPG_MFP2_PG10MFP_Msk (0x1ful << SYS_GPG_MFP2_PG10MFP_Pos) /*!< SYS_T::GPG_MFP2: PG10MFP Mask */ - -#define SYS_GPG_MFP2_PG11MFP_Pos (24) /*!< SYS_T::GPG_MFP2: PG11MFP Position */ -#define SYS_GPG_MFP2_PG11MFP_Msk (0x1ful << SYS_GPG_MFP2_PG11MFP_Pos) /*!< SYS_T::GPG_MFP2: PG11MFP Mask */ - -#define SYS_GPG_MFP3_PG12MFP_Pos (0) /*!< SYS_T::GPG_MFP3: PG12MFP Position */ -#define SYS_GPG_MFP3_PG12MFP_Msk (0x1ful << SYS_GPG_MFP3_PG12MFP_Pos) /*!< SYS_T::GPG_MFP3: PG12MFP Mask */ - -#define SYS_GPG_MFP3_PG13MFP_Pos (8) /*!< SYS_T::GPG_MFP3: PG13MFP Position */ -#define SYS_GPG_MFP3_PG13MFP_Msk (0x1ful << SYS_GPG_MFP3_PG13MFP_Pos) /*!< SYS_T::GPG_MFP3: PG13MFP Mask */ - -#define SYS_GPG_MFP3_PG14MFP_Pos (16) /*!< SYS_T::GPG_MFP3: PG14MFP Position */ -#define SYS_GPG_MFP3_PG14MFP_Msk (0x1ful << SYS_GPG_MFP3_PG14MFP_Pos) /*!< SYS_T::GPG_MFP3: PG14MFP Mask */ - -#define SYS_GPG_MFP3_PG15MFP_Pos (24) /*!< SYS_T::GPG_MFP3: PG15MFP Position */ -#define SYS_GPG_MFP3_PG15MFP_Msk (0x1ful << SYS_GPG_MFP3_PG15MFP_Pos) /*!< SYS_T::GPG_MFP3: PG15MFP Mask */ - -#define SYS_GPH_MFP0_PH0MFP_Pos (0) /*!< SYS_T::GPH_MFP0: PH0MFP Position */ -#define SYS_GPH_MFP0_PH0MFP_Msk (0x1ful << SYS_GPH_MFP0_PH0MFP_Pos) /*!< SYS_T::GPH_MFP0: PH0MFP Mask */ - -#define SYS_GPH_MFP0_PH1MFP_Pos (8) /*!< SYS_T::GPH_MFP0: PH1MFP Position */ -#define SYS_GPH_MFP0_PH1MFP_Msk (0x1ful << SYS_GPH_MFP0_PH1MFP_Pos) /*!< SYS_T::GPH_MFP0: PH1MFP Mask */ - -#define SYS_GPH_MFP0_PH2MFP_Pos (16) /*!< SYS_T::GPH_MFP0: PH2MFP Position */ -#define SYS_GPH_MFP0_PH2MFP_Msk (0x1ful << SYS_GPH_MFP0_PH2MFP_Pos) /*!< SYS_T::GPH_MFP0: PH2MFP Mask */ - -#define SYS_GPH_MFP0_PH3MFP_Pos (24) /*!< SYS_T::GPH_MFP0: PH3MFP Position */ -#define SYS_GPH_MFP0_PH3MFP_Msk (0x1ful << SYS_GPH_MFP0_PH3MFP_Pos) /*!< SYS_T::GPH_MFP0: PH3MFP Mask */ - -#define SYS_GPH_MFP1_PH4MFP_Pos (0) /*!< SYS_T::GPH_MFP1: PH4MFP Position */ -#define SYS_GPH_MFP1_PH4MFP_Msk (0x1ful << SYS_GPH_MFP1_PH4MFP_Pos) /*!< SYS_T::GPH_MFP1: PH4MFP Mask */ - -#define SYS_GPH_MFP1_PH5MFP_Pos (8) /*!< SYS_T::GPH_MFP1: PH5MFP Position */ -#define SYS_GPH_MFP1_PH5MFP_Msk (0x1ful << SYS_GPH_MFP1_PH5MFP_Pos) /*!< SYS_T::GPH_MFP1: PH5MFP Mask */ - -#define SYS_GPH_MFP1_PH6MFP_Pos (16) /*!< SYS_T::GPH_MFP1: PH6MFP Position */ -#define SYS_GPH_MFP1_PH6MFP_Msk (0x1ful << SYS_GPH_MFP1_PH6MFP_Pos) /*!< SYS_T::GPH_MFP1: PH6MFP Mask */ - -#define SYS_GPH_MFP1_PH7MFP_Pos (24) /*!< SYS_T::GPH_MFP1: PH7MFP Position */ -#define SYS_GPH_MFP1_PH7MFP_Msk (0x1ful << SYS_GPH_MFP1_PH7MFP_Pos) /*!< SYS_T::GPH_MFP1: PH7MFP Mask */ - -#define SYS_GPH_MFP2_PH8MFP_Pos (0) /*!< SYS_T::GPH_MFP2: PH8MFP Position */ -#define SYS_GPH_MFP2_PH8MFP_Msk (0x1ful << SYS_GPH_MFP2_PH8MFP_Pos) /*!< SYS_T::GPH_MFP2: PH8MFP Mask */ - -#define SYS_GPH_MFP2_PH9MFP_Pos (8) /*!< SYS_T::GPH_MFP2: PH9MFP Position */ -#define SYS_GPH_MFP2_PH9MFP_Msk (0x1ful << SYS_GPH_MFP2_PH9MFP_Pos) /*!< SYS_T::GPH_MFP2: PH9MFP Mask */ - -#define SYS_GPH_MFP2_PH10MFP_Pos (16) /*!< SYS_T::GPH_MFP2: PH10MFP Position */ -#define SYS_GPH_MFP2_PH10MFP_Msk (0x1ful << SYS_GPH_MFP2_PH10MFP_Pos) /*!< SYS_T::GPH_MFP2: PH10MFP Mask */ - -#define SYS_GPH_MFP2_PH11MFP_Pos (24) /*!< SYS_T::GPH_MFP2: PH11MFP Position */ -#define SYS_GPH_MFP2_PH11MFP_Msk (0x1ful << SYS_GPH_MFP2_PH11MFP_Pos) /*!< SYS_T::GPH_MFP2: PH11MFP Mask */ - -#define SYS_GPH_MFP3_PH12MFP_Pos (0) /*!< SYS_T::GPH_MFP3: PH12MFP Position */ -#define SYS_GPH_MFP3_PH12MFP_Msk (0x1ful << SYS_GPH_MFP3_PH12MFP_Pos) /*!< SYS_T::GPH_MFP3: PH12MFP Mask */ - -#define SYS_GPH_MFP3_PH13MFP_Pos (8) /*!< SYS_T::GPH_MFP3: PH13MFP Position */ -#define SYS_GPH_MFP3_PH13MFP_Msk (0x1ful << SYS_GPH_MFP3_PH13MFP_Pos) /*!< SYS_T::GPH_MFP3: PH13MFP Mask */ - -#define SYS_GPH_MFP3_PH14MFP_Pos (16) /*!< SYS_T::GPH_MFP3: PH14MFP Position */ -#define SYS_GPH_MFP3_PH14MFP_Msk (0x1ful << SYS_GPH_MFP3_PH14MFP_Pos) /*!< SYS_T::GPH_MFP3: PH14MFP Mask */ - -#define SYS_GPH_MFP3_PH15MFP_Pos (24) /*!< SYS_T::GPH_MFP3: PH15MFP Position */ -#define SYS_GPH_MFP3_PH15MFP_Msk (0x1ful << SYS_GPH_MFP3_PH15MFP_Pos) /*!< SYS_T::GPH_MFP3: PH15MFP Mask */ - -#define SYS_GPI_MFP1_PI6MFP_Pos (16) /*!< SYS_T::GPI_MFP1: PI6MFP Position */ -#define SYS_GPI_MFP1_PI6MFP_Msk (0x1ful << SYS_GPI_MFP1_PI6MFP_Pos) /*!< SYS_T::GPI_MFP1: PI6MFP Mask */ - -#define SYS_GPI_MFP1_PI7MFP_Pos (24) /*!< SYS_T::GPI_MFP1: PI7MFP Position */ -#define SYS_GPI_MFP1_PI7MFP_Msk (0x1ful << SYS_GPI_MFP1_PI7MFP_Pos) /*!< SYS_T::GPI_MFP1: PI7MFP Mask */ - -#define SYS_GPI_MFP2_PI8MFP_Pos (0) /*!< SYS_T::GPI_MFP2: PI8MFP Position */ -#define SYS_GPI_MFP2_PI8MFP_Msk (0x1ful << SYS_GPI_MFP2_PI8MFP_Pos) /*!< SYS_T::GPI_MFP2: PI8MFP Mask */ - -#define SYS_GPI_MFP2_PI9MFP_Pos (8) /*!< SYS_T::GPI_MFP2: PI9MFP Position */ -#define SYS_GPI_MFP2_PI9MFP_Msk (0x1ful << SYS_GPI_MFP2_PI9MFP_Pos) /*!< SYS_T::GPI_MFP2: PI9MFP Mask */ - -#define SYS_GPI_MFP2_PI10MFP_Pos (16) /*!< SYS_T::GPI_MFP2: PI10MFP Position */ -#define SYS_GPI_MFP2_PI10MFP_Msk (0x1ful << SYS_GPI_MFP2_PI10MFP_Pos) /*!< SYS_T::GPI_MFP2: PI10MFP Mask */ - -#define SYS_GPI_MFP2_PI11MFP_Pos (24) /*!< SYS_T::GPI_MFP2: PI11MFP Position */ -#define SYS_GPI_MFP2_PI11MFP_Msk (0x1ful << SYS_GPI_MFP2_PI11MFP_Pos) /*!< SYS_T::GPI_MFP2: PI11MFP Mask */ - -#define SYS_GPI_MFP3_PI12MFP_Pos (0) /*!< SYS_T::GPI_MFP3: PI12MFP Position */ -#define SYS_GPI_MFP3_PI12MFP_Msk (0x1ful << SYS_GPI_MFP3_PI12MFP_Pos) /*!< SYS_T::GPI_MFP3: PI12MFP Mask */ - -#define SYS_GPI_MFP3_PI13MFP_Pos (8) /*!< SYS_T::GPI_MFP3: PI13MFP Position */ -#define SYS_GPI_MFP3_PI13MFP_Msk (0x1ful << SYS_GPI_MFP3_PI13MFP_Pos) /*!< SYS_T::GPI_MFP3: PI13MFP Mask */ - -#define SYS_GPI_MFP3_PI14MFP_Pos (16) /*!< SYS_T::GPI_MFP3: PI14MFP Position */ -#define SYS_GPI_MFP3_PI14MFP_Msk (0x1ful << SYS_GPI_MFP3_PI14MFP_Pos) /*!< SYS_T::GPI_MFP3: PI14MFP Mask */ - -#define SYS_GPI_MFP3_PI15MFP_Pos (24) /*!< SYS_T::GPI_MFP3: PI15MFP Position */ -#define SYS_GPI_MFP3_PI15MFP_Msk (0x1ful << SYS_GPI_MFP3_PI15MFP_Pos) /*!< SYS_T::GPI_MFP3: PI15MFP Mask */ - -#define SYS_GPJ_MFP0_PJ0MFP_Pos (0) /*!< SYS_T::GPJ_MFP0: PJ0MFP Position */ -#define SYS_GPJ_MFP0_PJ0MFP_Msk (0x1ful << SYS_GPJ_MFP0_PJ0MFP_Pos) /*!< SYS_T::GPJ_MFP0: PJ0MFP Mask */ - -#define SYS_GPJ_MFP0_PJ1MFP_Pos (8) /*!< SYS_T::GPJ_MFP0: PJ1MFP Position */ -#define SYS_GPJ_MFP0_PJ1MFP_Msk (0x1ful << SYS_GPJ_MFP0_PJ1MFP_Pos) /*!< SYS_T::GPJ_MFP0: PJ1MFP Mask */ - -#define SYS_GPJ_MFP0_PJ2MFP_Pos (16) /*!< SYS_T::GPJ_MFP0: PJ2MFP Position */ -#define SYS_GPJ_MFP0_PJ2MFP_Msk (0x1ful << SYS_GPJ_MFP0_PJ2MFP_Pos) /*!< SYS_T::GPJ_MFP0: PJ2MFP Mask */ - -#define SYS_GPJ_MFP0_PJ3MFP_Pos (24) /*!< SYS_T::GPJ_MFP0: PJ3MFP Position */ -#define SYS_GPJ_MFP0_PJ3MFP_Msk (0x1ful << SYS_GPJ_MFP0_PJ3MFP_Pos) /*!< SYS_T::GPJ_MFP0: PJ3MFP Mask */ - -#define SYS_GPJ_MFP1_PJ4MFP_Pos (0) /*!< SYS_T::GPJ_MFP1: PJ4MFP Position */ -#define SYS_GPJ_MFP1_PJ4MFP_Msk (0x1ful << SYS_GPJ_MFP1_PJ4MFP_Pos) /*!< SYS_T::GPJ_MFP1: PJ4MFP Mask */ - -#define SYS_GPJ_MFP1_PJ5MFP_Pos (8) /*!< SYS_T::GPJ_MFP1: PJ5MFP Position */ -#define SYS_GPJ_MFP1_PJ5MFP_Msk (0x1ful << SYS_GPJ_MFP1_PJ5MFP_Pos) /*!< SYS_T::GPJ_MFP1: PJ5MFP Mask */ - -#define SYS_GPJ_MFP1_PJ6MFP_Pos (16) /*!< SYS_T::GPJ_MFP1: PJ6MFP Position */ -#define SYS_GPJ_MFP1_PJ6MFP_Msk (0x1ful << SYS_GPJ_MFP1_PJ6MFP_Pos) /*!< SYS_T::GPJ_MFP1: PJ6MFP Mask */ - -#define SYS_GPJ_MFP1_PJ7MFP_Pos (24) /*!< SYS_T::GPJ_MFP1: PJ7MFP Position */ -#define SYS_GPJ_MFP1_PJ7MFP_Msk (0x1ful << SYS_GPJ_MFP1_PJ7MFP_Pos) /*!< SYS_T::GPJ_MFP1: PJ7MFP Mask */ - -#define SYS_GPJ_MFP2_PJ8MFP_Pos (0) /*!< SYS_T::GPJ_MFP2: PJ8MFP Position */ -#define SYS_GPJ_MFP2_PJ8MFP_Msk (0x1ful << SYS_GPJ_MFP2_PJ8MFP_Pos) /*!< SYS_T::GPJ_MFP2: PJ8MFP Mask */ - -#define SYS_GPJ_MFP2_PJ9MFP_Pos (8) /*!< SYS_T::GPJ_MFP2: PJ9MFP Position */ -#define SYS_GPJ_MFP2_PJ9MFP_Msk (0x1ful << SYS_GPJ_MFP2_PJ9MFP_Pos) /*!< SYS_T::GPJ_MFP2: PJ9MFP Mask */ - -#define SYS_GPJ_MFP2_PJ10MFP_Pos (16) /*!< SYS_T::GPJ_MFP2: PJ10MFP Position */ -#define SYS_GPJ_MFP2_PJ10MFP_Msk (0x1ful << SYS_GPJ_MFP2_PJ10MFP_Pos) /*!< SYS_T::GPJ_MFP2: PJ10MFP Mask */ - -#define SYS_GPJ_MFP2_PJ11MFP_Pos (24) /*!< SYS_T::GPJ_MFP2: PJ11MFP Position */ -#define SYS_GPJ_MFP2_PJ11MFP_Msk (0x1ful << SYS_GPJ_MFP2_PJ11MFP_Pos) /*!< SYS_T::GPJ_MFP2: PJ11MFP Mask */ - -#define SYS_GPJ_MFP3_PJ12MFP_Pos (0) /*!< SYS_T::GPJ_MFP3: PJ12MFP Position */ -#define SYS_GPJ_MFP3_PJ12MFP_Msk (0x1ful << SYS_GPJ_MFP3_PJ12MFP_Pos) /*!< SYS_T::GPJ_MFP3: PJ12MFP Mask */ - -#define SYS_GPJ_MFP3_PJ13MFP_Pos (8) /*!< SYS_T::GPJ_MFP3: PJ13MFP Position */ -#define SYS_GPJ_MFP3_PJ13MFP_Msk (0x1ful << SYS_GPJ_MFP3_PJ13MFP_Pos) /*!< SYS_T::GPJ_MFP3: PJ13MFP Mask */ - -/**@}*/ /* SYS_CONST */ -/**@}*/ /* end of SYS register group */ - -/** - @addtogroup NMI NMI Controller (NMI) - Memory Mapped Structure for NMI Controller -@{ */ - -typedef struct -{ - - - /** - * @var NMI_T::NMIEN - * Offset: 0x00 NMI Source Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD NMI Source Enable (Write Protect) - * | | |0 = BOD NMI source Disabled. - * | | |1 = BOD NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |IRCINT |IRC TRIM NMI Source Enable (Write Protect) - * | | |0 = IRC TRIM NMI source Disabled. - * | | |1 = IRC TRIM NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PWRWUINT |Power-down Mode Wake-up NMI Source Enable (Write Protect) - * | | |0 = Power-down mode wake-up NMI source Disabled. - * | | |1 = Power-down mode wake-up NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |SRAMPERR |SRAM Parity Check NMI Source Enable (Write Protect) - * | | |0 = SRAM parity check error NMI source Disabled. - * | | |1 = SRAM parity check error NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |CLKFAIL |Clock Fail Detected and IRC Auto Trim Interrupt NMI Source Enable (Write Protect) - * | | |0 = Clock fail detected interrupt NMI source Disabled. - * | | |1 = Clock fail detected interrupt NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |RTCINT |RTC NMI Source Enable (Write Protect) - * | | |0 = RTC NMI source Disabled. - * | | |1 = RTC NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |TAMPERINT |TAMPER NMI Source Enable (Write Protect) - * | | |0 = Backup register tamper detected NMI source Disabled. - * | | |1 = Backup register tamper detected NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |EINT0 |External Interrupt from INT0 Pins NMI Source Enable (Write Protect) - * | | |0 = External interrupt from INT0 pins NMI source Disabled. - * | | |1 = External interrupt from INT0 pins NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[9] |EINT1 |External Interrupt from INT1 Pins NMI Source Enable (Write Protect) - * | | |0 = External interrupt from INT1 pins NMI source Disabled. - * | | |1 = External interrupt from INT1 pins NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10] |EINT2 |External Interrupt rrom INT2 Pins NMI Source Enable (Write Protect) - * | | |0 = External interrupt from INT2 pins NMI source Disabled. - * | | |1 = External interrupt from INT2 pins NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11] |EINT3 |External Interrupt from INT3 Pins NMI Source Enable (Write Protect) - * | | |0 = External interrupt from INT3 pins NMI source Disabled. - * | | |1 = External interrupt from INT3 pins pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |EINT4 |External Interrupt from INT4 Pins NMI Source Enable (Write Protect) - * | | |0 = External interrupt from INT4 pins NMI source Disabled. - * | | |1 = External interrupt from INT4 pins NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |EINT5 |External Interrupt from INT5 Pins NMI Source Enable (Write Protect) - * | | |0 = External interrupt from INT5 pins NMI source Disabled. - * | | |1 = External interrupt from INT5 pins NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[14] |UART0INT |UART0 NMI Source Enable (Write Protect) - * | | |0 = UART0 NMI source Disabled. - * | | |1 = UART0 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[15] |UART1INT |UART1 NMI Source Enable (Write Protect) - * | | |0 = UART1 NMI source Disabled. - * | | |1 = UART1 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var NMI_T::NMISTS - * Offset: 0x04 NMI Source Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD Interrupt Flag (Read Only) - * | | |0 = BOD interrupt is deasserted. - * | | |1 = BOD interrupt is asserted. - * |[1] |IRCINT |IRC TRIM Interrupt Flag (Read Only) - * | | |0 = IRC TRIM interrupt is deasserted. - * | | |1 = IRC TRIM interrupt is asserted. - * |[2] |PWRWUINT |Power-down Mode Wake-up Interrupt Flag (Read Only) - * | | |0 = Power-down mode wake-up interrupt is deasserted. - * | | |1 = Power-down mode wake-up interrupt is asserted. - * |[3] |SRAMPERR |SRAM Parity Check Error Interrupt Flag (Read Only) - * | | |0 = SRAM parity check error interrupt is deasserted. - * | | |1 = SRAM parity check error interrupt is asserted. - * |[4] |CLKFAIL |Clock Fail Detected or IRC Auto Trim Interrupt Flag (Read Only) - * | | |0 = Clock fail detected interrupt is deasserted. - * | | |1 = Clock fail detected interrupt is asserted. - * |[6] |RTCINT |RTC Interrupt Flag (Read Only) - * | | |0 = RTC interrupt is deasserted. - * | | |1 = RTC interrupt is asserted. - * |[7] |TAMPERINT |TAMPER Interrupt Flag (Read Only) - * | | |0 = Backup register tamper detected interrupt is deasserted. - * | | |1 = Backup register tamper detected interrupt is asserted. - * |[8] |EINT0 |External Interrupt from INT0 Pins Interrupt Flag (Read Only) - * | | |0 = External Interrupt from INT0 interrupt is deasserted. - * | | |1 = External Interrupt from INT0 interrupt is asserted. - * |[9] |EINT1 |External Interrupt from INT1 Pins Interrupt Flag (Read Only) - * | | |0 = External Interrupt from INT1 interrupt is deasserted. - * | | |1 = External Interrupt from INT1 interrupt is asserted. - * |[10] |EINT2 |External Interrupt from INT2 Pins Interrupt Flag (Read Only) - * | | |0 = External Interrupt from INT2 interrupt is deasserted. - * | | |1 = External Interrupt from INT2 interrupt is asserted. - * |[11] |EINT3 |External Interrupt from INT3 Pins Interrupt Flag (Read Only) - * | | |0 = External Interrupt from INT3 interrupt is deasserted. - * | | |1 = External Interrupt from INT3 interrupt is asserted. - * |[12] |EINT4 |External Interrupt from INT4 Pins Interrupt Flag (Read Only) - * | | |0 = External Interrupt from INT4 interrupt is deasserted. - * | | |1 = External Interrupt from INT4 interrupt is asserted. - * |[13] |EINT5 |External Interrupt from INT5 Pins Interrupt Flag (Read Only) - * | | |0 = External Interrupt from INT5 interrupt is deasserted. - * | | |1 = External Interrupt from INT5 interrupt is asserted. - * |[14] |UART0INT |UART0 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is deasserted. - * | | |1 = UART1 interrupt is asserted. - * |[15] |UART1INT |UART1 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is deasserted. - * | | |1 = UART1 interrupt is asserted. - */ - __IO uint32_t NMIEN; /*!< [0x0000] NMI Source Interrupt Enable Register */ - __I uint32_t NMISTS; /*!< [0x0004] NMI Source Interrupt Status Register */ - -} NMI_T; - -/** - @addtogroup NMI_CONST NMI Bit Field Definition - Constant Definitions for NMI Controller -@{ */ - -#define NMI_NMIEN_BODOUT_Pos (0) /*!< NMI_T::NMIEN: BODOUT Position */ -#define NMI_NMIEN_BODOUT_Msk (0x1ul << NMI_NMIEN_BODOUT_Pos) /*!< NMI_T::NMIEN: BODOUT Mask */ - -#define NMI_NMIEN_IRCINT_Pos (1) /*!< NMI_T::NMIEN: IRCINT Position */ -#define NMI_NMIEN_IRCINT_Msk (0x1ul << NMI_NMIEN_IRCINT_Pos) /*!< NMI_T::NMIEN: IRCINT Mask */ - -#define NMI_NMIEN_PWRWUINT_Pos (2) /*!< NMI_T::NMIEN: PWRWUINT Position */ -#define NMI_NMIEN_PWRWUINT_Msk (0x1ul << NMI_NMIEN_PWRWUINT_Pos) /*!< NMI_T::NMIEN: PWRWUINT Mask */ - -#define NMI_NMIEN_SRAMPERR_Pos (3) /*!< NMI_T::NMIEN: SRAMPERR Position */ -#define NMI_NMIEN_SRAMPERR_Msk (0x1ul << NMI_NMIEN_SRAMPERR_Pos) /*!< NMI_T::NMIEN: SRAMPERR Mask */ - -#define NMI_NMIEN_CLKFAIL_Pos (4) /*!< NMI_T::NMIEN: CLKFAIL Position */ -#define NMI_NMIEN_CLKFAIL_Msk (0x1ul << NMI_NMIEN_CLKFAIL_Pos) /*!< NMI_T::NMIEN: CLKFAIL Mask */ - -#define NMI_NMIEN_RTCINT_Pos (6) /*!< NMI_T::NMIEN: RTCINT Position */ -#define NMI_NMIEN_RTCINT_Msk (0x1ul << NMI_NMIEN_RTCINT_Pos) /*!< NMI_T::NMIEN: RTCINT Mask */ - -#define NMI_NMIEN_TAMPERINT_Pos (7) /*!< NMI_T::NMIEN: TAMPERINT Position */ -#define NMI_NMIEN_TAMPERINT_Msk (0x1ul << NMI_NMIEN_TAMPERINT_Pos) /*!< NMI_T::NMIEN: TAMPERINT Mask */ - -#define NMI_NMIEN_EINT0_Pos (8) /*!< NMI_T::NMIEN: EINT0 Position */ -#define NMI_NMIEN_EINT0_Msk (0x1ul << NMI_NMIEN_EINT0_Pos) /*!< NMI_T::NMIEN: EINT0 Mask */ - -#define NMI_NMIEN_EINT1_Pos (9) /*!< NMI_T::NMIEN: EINT1 Position */ -#define NMI_NMIEN_EINT1_Msk (0x1ul << NMI_NMIEN_EINT1_Pos) /*!< NMI_T::NMIEN: EINT1 Mask */ - -#define NMI_NMIEN_EINT2_Pos (10) /*!< NMI_T::NMIEN: EINT2 Position */ -#define NMI_NMIEN_EINT2_Msk (0x1ul << NMI_NMIEN_EINT2_Pos) /*!< NMI_T::NMIEN: EINT2 Mask */ - -#define NMI_NMIEN_EINT3_Pos (11) /*!< NMI_T::NMIEN: EINT3 Position */ -#define NMI_NMIEN_EINT3_Msk (0x1ul << NMI_NMIEN_EINT3_Pos) /*!< NMI_T::NMIEN: EINT3 Mask */ - -#define NMI_NMIEN_EINT4_Pos (12) /*!< NMI_T::NMIEN: EINT4 Position */ -#define NMI_NMIEN_EINT4_Msk (0x1ul << NMI_NMIEN_EINT4_Pos) /*!< NMI_T::NMIEN: EINT4 Mask */ - -#define NMI_NMIEN_EINT5_Pos (13) /*!< NMI_T::NMIEN: EINT5 Position */ -#define NMI_NMIEN_EINT5_Msk (0x1ul << NMI_NMIEN_EINT5_Pos) /*!< NMI_T::NMIEN: EINT5 Mask */ - -#define NMI_NMIEN_UART0INT_Pos (14) /*!< NMI_T::NMIEN: UART0INT Position */ -#define NMI_NMIEN_UART0INT_Msk (0x1ul << NMI_NMIEN_UART0INT_Pos) /*!< NMI_T::NMIEN: UART0INT Mask */ - -#define NMI_NMIEN_UART1INT_Pos (15) /*!< NMI_T::NMIEN: UART1INT Position */ -#define NMI_NMIEN_UART1INT_Msk (0x1ul << NMI_NMIEN_UART1INT_Pos) /*!< NMI_T::NMIEN: UART1INT Mask */ - -#define NMI_NMISTS_BODOUT_Pos (0) /*!< NMI_T::NMISTS: BODOUT Position */ -#define NMI_NMISTS_BODOUT_Msk (0x1ul << NMI_NMISTS_BODOUT_Pos) /*!< NMI_T::NMISTS: BODOUT Mask */ - -#define NMI_NMISTS_IRCINT_Pos (1) /*!< NMI_T::NMISTS: IRCINT Position */ -#define NMI_NMISTS_IRCINT_Msk (0x1ul << NMI_NMISTS_IRC_NT_Pos) /*!< NMI_T::NMISTS: IRCINT Mask */ - -#define NMI_NMISTS_PWRWUINT_Pos (2) /*!< NMI_T::NMISTS: PWRWUINT Position */ -#define NMI_NMISTS_PWRWUINT_Msk (0x1ul << NMI_NMISTS_PWRWUINT_Pos) /*!< NMI_T::NMISTS: PWRWUINT Mask */ - -#define NMI_NMISTS_SRAMPERR_Pos (3) /*!< NMI_T::NMISTS: SRAMPERR Position */ -#define NMI_NMISTS_SRAMPERR_Msk (0x1ul << NMI_NMISTS_SRAMPERR_Pos) /*!< NMI_T::NMISTS: SRAMPERR Mask */ - -#define NMI_NMISTS_CLKFAIL_Pos (4) /*!< NMI_T::NMISTS: CLKFAIL Position */ -#define NMI_NMISTS_CLKFAIL_Msk (0x1ul << NMI_NMISTS_CLKFAIL_Pos) /*!< NMI_T::NMISTS: CLKFAIL Mask */ - -#define NMI_NMISTS_RTCINT_Pos (6) /*!< NMI_T::NMISTS: RTCINT Position */ -#define NMI_NMISTS_RTCINT_Msk (0x1ul << NMI_NMISTS_RTCINT_Pos) /*!< NMI_T::NMISTS: RTCINT Mask */ - -#define NMI_NMISTS_TAMPERINT_Pos (7) /*!< NMI_T::NMISTS: TAMPERINT Position */ -#define NMI_NMISTS_TAMPERINT_Msk (0x1ul << NMI_NMISTS_TAMPERINT_Pos) /*!< NMI_T::NMISTS: TAMPERINT Mask */ - -#define NMI_NMISTS_EINT0_Pos (8) /*!< NMI_T::NMISTS: EINT0 Position */ -#define NMI_NMISTS_EINT0_Msk (0x1ul << NMI_NMISTS_EINT0_Pos) /*!< NMI_T::NMISTS: EINT0 Mask */ - -#define NMI_NMISTS_EINT1_Pos (9) /*!< NMI_T::NMISTS: EINT1 Position */ -#define NMI_NMISTS_EINT1_Msk (0x1ul << NMI_NMISTS_EINT1_Pos) /*!< NMI_T::NMISTS: EINT1 Mask */ - -#define NMI_NMISTS_EINT2_Pos (10) /*!< NMI_T::NMISTS: EINT2 Position */ -#define NMI_NMISTS_EINT2_Msk (0x1ul << NMI_NMISTS_EINT2_Pos) /*!< NMI_T::NMISTS: EINT2 Mask */ - -#define NMI_NMISTS_EINT3_Pos (11) /*!< NMI_T::NMISTS: EINT3 Position */ -#define NMI_NMISTS_EINT3_Msk (0x1ul << NMI_NMISTS_EINT3_Pos) /*!< NMI_T::NMISTS: EINT3 Mask */ - -#define NMI_NMISTS_EINT4_Pos (12) /*!< NMI_T::NMISTS: EINT4 Position */ -#define NMI_NMISTS_EINT4_Msk (0x1ul << NMI_NMISTS_EINT4_Pos) /*!< NMI_T::NMISTS: EINT4 Mask */ - -#define NMI_NMISTS_EINT5_Pos (13) /*!< NMI_T::NMISTS: EINT5 Position */ -#define NMI_NMISTS_EINT5_Msk (0x1ul << NMI_NMISTS_EINT5_Pos) /*!< NMI_T::NMISTS: EINT5 Mask */ - -#define NMI_NMISTS_UART0INT_Pos (14) /*!< NMI_T::NMISTS: UART0INT Position */ -#define NMI_NMISTS_UART0INT_Msk (0x1ul << NMI_NMISTS_UART0INT_Pos) /*!< NMI_T::NMISTS: UART0INT Mask */ - -#define NMI_NMISTS_UART1INT_Pos (15) /*!< NMI_T::NMISTS: UART1INT Position */ -#define NMI_NMISTS_UART1INT_Msk (0x1ul << NMI_NMISTS_UART1INT_Pos) /*!< NMI_T::NMISTS: UART1INT Mask */ - -/**@}*/ /* NMI_CONST */ -/**@}*/ /* end of NMI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SYS_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/system_m460.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/system_m460.h deleted file mode 100644 index fc874a0a46e..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/system_m460.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************//** - * @file system_m460.h - * @version V3.00 - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File for M460 - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __SYSTEM_M460_H__ -#define __SYSTEM_M460_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - -/*---------------------------------------------------------------------------- - Define clocks - *----------------------------------------------------------------------------*/ - -#ifndef __HSI -#define __HSI (12000000UL) /*!< PLL default output is 50MHz */ -#endif - -#ifndef __HXT -#define __HXT (12000000UL) /*!< External Crystal Clock Frequency */ -#endif - -#ifndef __LXT -#define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */ -#endif - -#define __HIRC (12000000UL) /*!< Internal 12M RC Oscillator Frequency */ -#define __HIRC48M (48000000UL) /*!< Internal 48M RC Oscillator Frequency */ -#define __LIRC (10000UL) /*!< Internal 10K RC Oscillator Frequency */ -#define __SYS_OSC_CLK ( ___HSI) /* Main oscillator frequency */ - - -#define __SYSTEM_CLOCK (1UL*__HXT) - -#ifndef DEBUG_PORT -#define DEBUG_PORT UART0 /*!< Select Debug Port which is used for retarget.c to output debug message to UART */ -#endif - -extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ -extern uint32_t CyclesPerUs; /*!< Cycles per micro second */ -extern uint32_t PllClock; /*!< PLL Output Clock Frequency */ - - -/** - * Initialize the system - * - * @param none - * @return none - * - * @brief Setup the micro controller system. - * Initialize the System and update the SystemCoreClock variable. - */ -extern void SystemInit(void); - -/** - * Update SystemCoreClock variable - * - * @param none - * @return none - * - * @brief Updates the SystemCoreClock with current core Clock - * retrieved from cpu registers. - */ -extern void SystemCoreClockUpdate(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __SYSTEM_M460_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/tcm_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/tcm_reg.h deleted file mode 100644 index 8aa10d7d867..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/tcm_reg.h +++ /dev/null @@ -1,714 +0,0 @@ -/**************************************************************************//** - * @file tcm_reg.h - * @version V1.00 - * @brief Tight Couple Memory Controller - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TCM_REG_H__ -#define __TCM_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- Tight Couple Memory Controller -------------------------*/ -/** - @addtogroup TCM Tight Couple Memory Controller(TCM) - Memory Mapped Structure for TCM Controller -@{ */ - -typedef struct -{ - - - /** - * @var TCM_T::GCTL - * Offset: 0x00 Tight Couple Memory Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WAYNUM |Number of TCM ways configured (Read Only) - * | | |00 = 1 way, NUM_WAY == 1 - * | | |01 = 2 way, NUM_WAY == 2 - * | | |10 = 3 way, NUM_WAY == 3 - * | | |11 = 4 way, NUM_WAY == 4 - * |[3:2] |WAYSIZE |Size of each TCM ways (Read Only) - * | | |00 = 1 Kbyte (WAY_SIZE == 0) - * | | |01 = 2 Kbyte (WAY_SIZE == 1) - * | | |10 = 4 Kbyte (WAY_SIZE == 2) - * | | |11 = 8 Kbyte (WAY_SIZE == 3) - * |[4] |CACHECFG |Cache Configuration Bit - * | | |(default: 0) When a TCM way is configured as a cache-way, setting this bit to 1 enables the write-back/write-allocate cache management policy - * | | |Otherwise, a 0 in this bit enables the write-through/no-write-allocate policy - * | | |This bit can be modified only when none of the TCM ways is enabled as a cache-way. - * |[5] |FIXAZERO |Fix Auto Zero (Read Only) - * | | |(default: 0) Asserting this bit to 1 to prohibit update of the AutoZero bits in the TCM way configuration registers by the core - * | | |The default 0 setting allows them to be modified - * | | |This bit itself is not modifiable by the core - * | | |Its value can only be changed during the chip configuration stage when the PORESETn input is HIGH and the SYSRESETn input is LOW - * |[8] |WAY0EN |TCM way0 Enable Contorl - * | | |0 = TCM way0 Disabled. - * | | |1 = TCM way0 Enabled. - * | | |When this bit toggles, the corresponding TCM way is enabled/disabled according to the CacheMode bit in the TCM_WayX_Config_Registers - * | | |Note that a TCM way is not fully enabled until the pre-/post-condition is met - * | | |Specifically, when CacheMode bit is 0, the TCM way is not fully enabled until the PreLoading bit is 0 - * | | |It is not fully disabled until both AutoFlushing and AutoZeroing bits are 0 - * | | |When CacheMode bit is 1, the TCM way is not fully enabled until the Invalidating bit is 0, and not fully disabled until the AutoZeroing bit is 0. - * |[9] |WAY1EN |TCM way1 Enable Contorl - * | | |0 = TCM way1 Disabled. - * | | |1 = TCM way1 Enabled. - * |[10] |WAY2EN |TCM way2 Enable Contorl - * | | |0 = TCM way2 Disabled. - * | | |1 = TCM way2 Enabled. - * |[11] |WAY3EN |TCM way3 Enable Contorl - * | | |0 = TCM way3 Disabled. - * | | |1 = TCM way3 Enabled. - * @var TCM_T::W0CTL - * Offset: 0x10 Tight Couple Memory Way0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CACHEMD |Cache Mode Enable Bit - * | | |0 = TCM as Local Memory Block (LMB) - * | | |1 = TCM as Cache - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * |[1] |PRELD |Pre-load the TCM way - * | | |When CacheMode bit is clear, setting this bit to 1 instructs TCM control to pre-load the TCM way according to the size/addr setting in the corresponding DMA register - * | | |The TCM way is not enabled as a LMB until the preloading operation is completed - * | | |When CacheMode is set, this bit has no meaning - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[2] |PRELDST |Pre-loading Status - * | | |This is a status bit that returns 1 when the pre-loading of the TCM way (as a LMB) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a LMB - * | | |An access request to the would-be-mapped address range will be wait-stated to avoid the multi-caching scenario that can happens when another TCM way is enabled as a cache-way and the requested target can become cached there because the I-/D-bus request is not blocked. - * |[3] |INVALST |Invalidation Status - * | | |This is a status bit that returns 1 when the pre-enabling invalidation of the TCM way (as a cache-way) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a cache-way - * | | |However, since no multi-caching scenario can occur, no any incoming request is blocked due the on-going invalidation. - * |[4] |AFLUSH |auto-flush the data array - * | | |When CacheMode is clear, setting this bit to 1 instructs TCM control to auto-flush the data array according to the size/addr setting in the corresponding DMA register - * | | |When CacheMode is set, this bit has no meaning - * | | |The data array is always fully flushed when a TCM way is disabled from a write-back/write-allocate cache way - * | | |The TCM way is not fully disabled until the flushing operation is completed - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[5] |AFLUSHST |This is a status bit that returns 1 when auto-flushing of the TCM way is on-going. The auto-flushing is triggered when the TCM way is disabled as a LMB with the AutoFlush bit set, or when the TCM way is disabled as a cache-way and the cache is configured with write-back/write-allocate. Until this bit is clear, a TCM way is not fully disabled. While it is set, accesses to targets residing in the TCM way are wait-stated. This can occur when the TCM way is configured as a LMB and the target falls in the mapped address range, or when the TCM way is configured as a cache-way in general. The blocking is to avoid memory consistency issue when a late arrival write access, whose target data has been flushed out to the memory. - * |[6] |AZERO |Setting this bit to 1 instructs TCM control to auto-zero a TCM way when it is to be disabled as either a LMB or a cache-way. Auto-zeroing of a LMB is not controlled by the size/addr setting in DMA_control register. The whole TCM way is zerou2019ed out. This bit is reset-configurable like FixAutoZero bit when PORESETn is high and SYSRESETn is low. After that, it is modifiable by the core only if the FixAutoZero bit is clear and the corresponding WayEnable bit is also clear. - * |[7] |AZEROST |Auto-zeroing Status - * | | |This is a status bit that returns 1 when auto-zeroing is on-going - * | | |Similar to AutoFlushing bit - * | | |Accesses with target potentially residing in the TCM way are all wait-stated. - * |[8] |XOMERROR |XOM Error Flag - * | | |This is a status bit that returns 1 when the TCM way is configured as a LMB and is currently mapping a XOM region - * | | |This bit is read-only by the core - * | | |It is set/cleared automatically by the TCM logic. - * |[9] |ERROR |Operating Error Flag - * | | |0 = No error is recored - * | | |1 = An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way). - * | | |An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way) - * | | |The operation didnu2019t complete successfully - * | | |No error can occur to invalidation or zeroing operation - * | | |This bit is set by TCM logic and can only be cleared by the core. - * |[23:13] |LMBTAG |LMB TAG Base Address - * | | |When TCM way configure as LMB used, these bits define the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB. - * | | |Note: This field can be modified only when the corresponding WAYxEN bit is clear. - * | | |(default: 0) When CacheMode is clear, these bits store the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB - * | | |Depending on LMBSize setting, some of the bits are ignored. - * | | |LMBSize == 1K : all bits used - * | | |LMBSize == 2K : bit 10 ignored - * | | |LMBSize == 4K : bit 11:10 ignored - * | | |LMBSize == 8K : bit 12:10 ignored - * @var TCM_T::W1CTL - * Offset: 0x14 Tight Couple Memory Way1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CACHEMD |Cache Mode Enable Bit - * | | |0 = TCM as Local Memory Block (LMB) - * | | |1 = TCM as Cache - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * |[1] |PRELD |Pre-load the TCM way - * | | |When CacheMode bit is clear, setting this bit to 1 instructs TCM control to pre-load the TCM way according to the size/addr setting in the corresponding DMA register - * | | |The TCM way is not enabled as a LMB until the preloading operation is completed - * | | |When CacheMode is set, this bit has no meaning - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[2] |PRELDST |Pre-loading Status - * | | |This is a status bit that returns 1 when the pre-loading of the TCM way (as a LMB) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a LMB - * | | |An access request to the would-be-mapped address range will be wait-stated to avoid the multi-caching scenario that can happens when another TCM way is enabled as a cache-way and the requested target can become cached there because the I-/D-bus request is not blocked. - * |[3] |INVALST |Invalidation Status - * | | |This is a status bit that returns 1 when the pre-enabling invalidation of the TCM way (as a cache-way) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a cache-way - * | | |However, since no multi-caching scenario can occur, no any incoming request is blocked due the on-going invalidation. - * |[4] |AFLUSH |auto-flush the data array - * | | |When CacheMode is clear, setting this bit to 1 instructs TCM control to auto-flush the data array according to the size/addr setting in the corresponding DMA register - * | | |When CacheMode is set, this bit has no meaning - * | | |The data array is always fully flushed when a TCM way is disabled from a write-back/write-allocate cache way - * | | |The TCM way is not fully disabled until the flushing operation is completed - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[5] |AFLUSHST |This is a status bit that returns 1 when auto-flushing of the TCM way is on-going. The auto-flushing is triggered when the TCM way is disabled as a LMB with the AutoFlush bit set, or when the TCM way is disabled as a cache-way and the cache is configured with write-back/write-allocate. Until this bit is clear, a TCM way is not fully disabled. While it is set, accesses to targets residing in the TCM way are wait-stated. This can occur when the TCM way is configured as a LMB and the target falls in the mapped address range, or when the TCM way is configured as a cache-way in general. The blocking is to avoid memory consistency issue when a late arrival write access, whose target data has been flushed out to the memory. - * |[6] |AZERO |Setting this bit to 1 instructs TCM control to auto-zero a TCM way when it is to be disabled as either a LMB or a cache-way. Auto-zeroing of a LMB is not controlled by the size/addr setting in DMA_control register. The whole TCM way is zerou2019ed out. This bit is reset-configurable like FixAutoZero bit when PORESETn is high and SYSRESETn is low. After that, it is modifiable by the core only if the FixAutoZero bit is clear and the corresponding WayEnable bit is also clear. - * |[7] |AZEROST |Auto-zeroing Status - * | | |This is a status bit that returns 1 when auto-zeroing is on-going - * | | |Similar to AutoFlushing bit - * | | |Accesses with target potentially residing in the TCM way are all wait-stated. - * |[8] |XOMERROR |XOM Error Flag - * | | |This is a status bit that returns 1 when the TCM way is configured as a LMB and is currently mapping a XOM region - * | | |This bit is read-only by the core - * | | |It is set/cleared automatically by the TCM logic. - * |[9] |ERROR |Operating Error Flag - * | | |0 = No error is recored - * | | |1 = An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way). - * | | |An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way) - * | | |The operation didnu2019t complete successfully - * | | |No error can occur to invalidation or zeroing operation - * | | |This bit is set by TCM logic and can only be cleared by the core. - * |[23:13] |LMBTAG |LMB TAG Base Address - * | | |When TCM way configure as LMB used, these bits define the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB. - * | | |Note: This field can be modified only when the corresponding WAYxEN bit is clear. - * | | |(default: 0) When CacheMode is clear, these bits store the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB - * | | |Depending on LMBSize setting, some of the bits are ignored. - * | | |LMBSize == 1K : all bits used - * | | |LMBSize == 2K : bit 10 ignored - * | | |LMBSize == 4K : bit 11:10 ignored - * | | |LMBSize == 8K : bit 12:10 ignored - * @var TCM_T::W2CTL - * Offset: 0x18 Tight Couple Memory Way2 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CACHEMD |Cache Mode Enable Bit - * | | |0 = TCM as Local Memory Block (LMB) - * | | |1 = TCM as Cache - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * |[1] |PRELD |Pre-load the TCM way - * | | |When CacheMode bit is clear, setting this bit to 1 instructs TCM control to pre-load the TCM way according to the size/addr setting in the corresponding DMA register - * | | |The TCM way is not enabled as a LMB until the preloading operation is completed - * | | |When CacheMode is set, this bit has no meaning - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[2] |PRELDST |Pre-loading Status - * | | |This is a status bit that returns 1 when the pre-loading of the TCM way (as a LMB) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a LMB - * | | |An access request to the would-be-mapped address range will be wait-stated to avoid the multi-caching scenario that can happens when another TCM way is enabled as a cache-way and the requested target can become cached there because the I-/D-bus request is not blocked. - * |[3] |INVALST |Invalidation Status - * | | |This is a status bit that returns 1 when the pre-enabling invalidation of the TCM way (as a cache-way) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a cache-way - * | | |However, since no multi-caching scenario can occur, no any incoming request is blocked due the on-going invalidation. - * |[4] |AFLUSH |auto-flush the data array - * | | |When CacheMode is clear, setting this bit to 1 instructs TCM control to auto-flush the data array according to the size/addr setting in the corresponding DMA register - * | | |When CacheMode is set, this bit has no meaning - * | | |The data array is always fully flushed when a TCM way is disabled from a write-back/write-allocate cache way - * | | |The TCM way is not fully disabled until the flushing operation is completed - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[5] |AFLUSHST |This is a status bit that returns 1 when auto-flushing of the TCM way is on-going. The auto-flushing is triggered when the TCM way is disabled as a LMB with the AutoFlush bit set, or when the TCM way is disabled as a cache-way and the cache is configured with write-back/write-allocate. Until this bit is clear, a TCM way is not fully disabled. While it is set, accesses to targets residing in the TCM way are wait-stated. This can occur when the TCM way is configured as a LMB and the target falls in the mapped address range, or when the TCM way is configured as a cache-way in general. The blocking is to avoid memory consistency issue when a late arrival write access, whose target data has been flushed out to the memory. - * |[6] |AZERO |Setting this bit to 1 instructs TCM control to auto-zero a TCM way when it is to be disabled as either a LMB or a cache-way. Auto-zeroing of a LMB is not controlled by the size/addr setting in DMA_control register. The whole TCM way is zerou2019ed out. This bit is reset-configurable like FixAutoZero bit when PORESETn is high and SYSRESETn is low. After that, it is modifiable by the core only if the FixAutoZero bit is clear and the corresponding WayEnable bit is also clear. - * |[7] |AZEROST |Auto-zeroing Status - * | | |This is a status bit that returns 1 when auto-zeroing is on-going - * | | |Similar to AutoFlushing bit - * | | |Accesses with target potentially residing in the TCM way are all wait-stated. - * |[8] |XOMERROR |XOM Error Flag - * | | |This is a status bit that returns 1 when the TCM way is configured as a LMB and is currently mapping a XOM region - * | | |This bit is read-only by the core - * | | |It is set/cleared automatically by the TCM logic. - * |[9] |ERROR |Operating Error Flag - * | | |0 = No error is recored - * | | |1 = An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way). - * | | |An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way) - * | | |The operation didnu2019t complete successfully - * | | |No error can occur to invalidation or zeroing operation - * | | |This bit is set by TCM logic and can only be cleared by the core. - * |[23:13] |LMBTAG |LMB TAG Base Address - * | | |When TCM way configure as LMB used, these bits define the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB. - * | | |Note: This field can be modified only when the corresponding WAYxEN bit is clear. - * | | |(default: 0) When CacheMode is clear, these bits store the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB - * | | |Depending on LMBSize setting, some of the bits are ignored. - * | | |LMBSize == 1K : all bits used - * | | |LMBSize == 2K : bit 10 ignored - * | | |LMBSize == 4K : bit 11:10 ignored - * | | |LMBSize == 8K : bit 12:10 ignored - * @var TCM_T::W3CTL - * Offset: 0x1C Tight Couple Memory Way3 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CACHEMD |Cache Mode Enable Bit - * | | |0 = TCM as Local Memory Block (LMB) - * | | |1 = TCM as Cache - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * |[1] |PRELD |Pre-load the TCM way - * | | |When CacheMode bit is clear, setting this bit to 1 instructs TCM control to pre-load the TCM way according to the size/addr setting in the corresponding DMA register - * | | |The TCM way is not enabled as a LMB until the preloading operation is completed - * | | |When CacheMode is set, this bit has no meaning - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[2] |PRELDST |Pre-loading Status - * | | |This is a status bit that returns 1 when the pre-loading of the TCM way (as a LMB) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a LMB - * | | |An access request to the would-be-mapped address range will be wait-stated to avoid the multi-caching scenario that can happens when another TCM way is enabled as a cache-way and the requested target can become cached there because the I-/D-bus request is not blocked. - * |[3] |INVALST |Invalidation Status - * | | |This is a status bit that returns 1 when the pre-enabling invalidation of the TCM way (as a cache-way) is on-going - * | | |Until this bit is clear, the TCM way is not fully enabled to serve I-/D-bus requests as a cache-way - * | | |However, since no multi-caching scenario can occur, no any incoming request is blocked due the on-going invalidation. - * |[4] |AFLUSH |auto-flush the data array - * | | |When CacheMode is clear, setting this bit to 1 instructs TCM control to auto-flush the data array according to the size/addr setting in the corresponding DMA register - * | | |When CacheMode is set, this bit has no meaning - * | | |The data array is always fully flushed when a TCM way is disabled from a write-back/write-allocate cache way - * | | |The TCM way is not fully disabled until the flushing operation is completed - * | | |This bit can be modified only when the corresponding WayEnable bit is clear. - * |[5] |AFLUSHST |This is a status bit that returns 1 when auto-flushing of the TCM way is on-going. The auto-flushing is triggered when the TCM way is disabled as a LMB with the AutoFlush bit set, or when the TCM way is disabled as a cache-way and the cache is configured with write-back/write-allocate. Until this bit is clear, a TCM way is not fully disabled. While it is set, accesses to targets residing in the TCM way are wait-stated. This can occur when the TCM way is configured as a LMB and the target falls in the mapped address range, or when the TCM way is configured as a cache-way in general. The blocking is to avoid memory consistency issue when a late arrival write access, whose target data has been flushed out to the memory. - * |[6] |AZERO |Setting this bit to 1 instructs TCM control to auto-zero a TCM way when it is to be disabled as either a LMB or a cache-way. Auto-zeroing of a LMB is not controlled by the size/addr setting in DMA_control register. The whole TCM way is zerou2019ed out. This bit is reset-configurable like FixAutoZero bit when PORESETn is high and SYSRESETn is low. After that, it is modifiable by the core only if the FixAutoZero bit is clear and the corresponding WayEnable bit is also clear. - * |[7] |AZEROST |Auto-zeroing Status - * | | |This is a status bit that returns 1 when auto-zeroing is on-going - * | | |Similar to AutoFlushing bit - * | | |Accesses with target potentially residing in the TCM way are all wait-stated. - * |[8] |XOMERROR |XOM Error Flag - * | | |This is a status bit that returns 1 when the TCM way is configured as a LMB and is currently mapping a XOM region - * | | |This bit is read-only by the core - * | | |It is set/cleared automatically by the TCM logic. - * |[9] |ERROR |Operating Error Flag - * | | |0 = No error is recored - * | | |1 = An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way). - * | | |An AHB error occurred during the last pre-loading (for LMB) or auto-flushing operation (for LMB or cache-way) - * | | |The operation didnu2019t complete successfully - * | | |No error can occur to invalidation or zeroing operation - * | | |This bit is set by TCM logic and can only be cleared by the core. - * |[23:13] |LMBTAG |LMB TAG Base Address - * | | |When TCM way configure as LMB used, these bits define the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB. - * | | |Note: This field can be modified only when the corresponding WAYxEN bit is clear. - * | | |(default: 0) When CacheMode is clear, these bits store the base address of the mapped region - * | | |This tag is compared against the incoming address to determine if the address hits in the LMB - * | | |Depending on LMBSize setting, some of the bits are ignored. - * | | |LMBSize == 1K : all bits used - * | | |LMBSize == 2K : bit 10 ignored - * | | |LMBSize == 4K : bit 11:10 ignored - * | | |LMBSize == 8K : bit 12:10 ignored - * @var TCM_T::W0DMACTL - * Offset: 0x20 Tight Couple Memory Way0 DMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMASIZE |DMA Size Selection Bit - * | | |This field indicate and size of moving external memory to LMB after DMA is trigged. - * | | |000 = Full TCM way - * | | |001 = 1/2 TCM way - * | | |010 = 1/4 TCM way - * | | |011 = 1/8 TCM way - * | | |100 = 1/16 TCM way - * | | |101 = 1/32 TCM way - * | | |110 = 1/64 TCM way - * | | |111 = 1/128 TCM way - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * | | |(default: 0) When the embedded DMA engine is triggered for either LMB preloading or auto-flushing, this field defines the size of the operation according to the following table - * | | |While a DMA operation is on-going, this field cannot be modified. - * |[23:4] |DMAADDR |DMA starting RAM address - * | | |When a LMB-related DMA operation is triggered, this field provides the starting RAM address of the operation - * | | |Depending on the setting of the WaySize and DMASize, not all bits are used - * | | |The following table lists the DMAAddr bits used to construct the base of the starting RAM address according to WaySize - * | | |While a DMA operation is on-going, this field cannot be modified. - * | | |WaySize / RAMBase 8K / {[23:13], 13u2019b0} 4K / {[23:12], 12u2019b0} 2K / {[23:11], 11u2019b0} 1K / {[23:10], 10u2019b0} - * | | |The following table lists the DMAAddr bits used as the offset for the RAM starting address - * | | |Note that the minimal DMA operation size is 16-byte (or 4-word). - * | | |Offset WaySize - * | | |DMASize 8K 4K 2K 1K - * | | |0 - - - - - * | | |1 [12] [11] [10] [9] - * | | |2 [12:11] [11:10] [10:9] [9:8] - * | | |3 [12:10] [11:9] [10:8] [9:7] - * | | |4 [12:9] [11:8] [10:7] [9:6] - * | | |5 [12:8] [11:7] [10:6] [9:5] - * | | |6 [12:7] [11:6] [10:5] [9:4] - * | | |7 [12:6] [11:5] [10:4] - - * |[30] |DMAFLUSH |Flushing DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a flushing DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a preloading DMA is on-going, this bit is not modifiable. - * |[31] |DMAPRELD |Preloading DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a preloading DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a flushing DMA is on-going, this bit is not modifiable. - * @var TCM_T::W1DMACTL - * Offset: 0x24 Tight Couple Memory Way1 DMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMASIZE |DMA Size Selection Bit - * | | |This field indicate and size of moving external memory to LMB after DMA is trigged. - * | | |000 = Full TCM way - * | | |001 = 1/2 TCM way - * | | |010 = 1/4 TCM way - * | | |011 = 1/8 TCM way - * | | |100 = 1/16 TCM way - * | | |101 = 1/32 TCM way - * | | |110 = 1/64 TCM way - * | | |111 = 1/128 TCM way - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * | | |(default: 0) When the embedded DMA engine is triggered for either LMB preloading or auto-flushing, this field defines the size of the operation according to the following table - * | | |While a DMA operation is on-going, this field cannot be modified. - * |[23:4] |DMAADDR |DMA starting RAM address - * | | |When a LMB-related DMA operation is triggered, this field provides the starting RAM address of the operation - * | | |Depending on the setting of the WaySize and DMASize, not all bits are used - * | | |The following table lists the DMAAddr bits used to construct the base of the starting RAM address according to WaySize - * | | |While a DMA operation is on-going, this field cannot be modified. - * | | |WaySize / RAMBase 8K / {[23:13], 13u2019b0} 4K / {[23:12], 12u2019b0} 2K / {[23:11], 11u2019b0} 1K / {[23:10], 10u2019b0} - * | | |The following table lists the DMAAddr bits used as the offset for the RAM starting address - * | | |Note that the minimal DMA operation size is 16-byte (or 4-word). - * | | |Offset WaySize - * | | |DMASize 8K 4K 2K 1K - * | | |0 - - - - - * | | |1 [12] [11] [10] [9] - * | | |2 [12:11] [11:10] [10:9] [9:8] - * | | |3 [12:10] [11:9] [10:8] [9:7] - * | | |4 [12:9] [11:8] [10:7] [9:6] - * | | |5 [12:8] [11:7] [10:6] [9:5] - * | | |6 [12:7] [11:6] [10:5] [9:4] - * | | |7 [12:6] [11:5] [10:4] - - * |[30] |DMAFLUSH |Flushing DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a flushing DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a preloading DMA is on-going, this bit is not modifiable. - * |[31] |DMAPRELD |Preloading DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a preloading DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a flushing DMA is on-going, this bit is not modifiable. - * @var TCM_T::W2DMACTL - * Offset: 0x28 Tight Couple Memory Way2 DMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMASIZE |DMA Size Selection Bit - * | | |This field indicate and size of moving external memory to LMB after DMA is trigged. - * | | |000 = Full TCM way - * | | |001 = 1/2 TCM way - * | | |010 = 1/4 TCM way - * | | |011 = 1/8 TCM way - * | | |100 = 1/16 TCM way - * | | |101 = 1/32 TCM way - * | | |110 = 1/64 TCM way - * | | |111 = 1/128 TCM way - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * | | |(default: 0) When the embedded DMA engine is triggered for either LMB preloading or auto-flushing, this field defines the size of the operation according to the following table - * | | |While a DMA operation is on-going, this field cannot be modified. - * |[23:4] |DMAADDR |DMA starting RAM address - * | | |When a LMB-related DMA operation is triggered, this field provides the starting RAM address of the operation - * | | |Depending on the setting of the WaySize and DMASize, not all bits are used - * | | |The following table lists the DMAAddr bits used to construct the base of the starting RAM address according to WaySize - * | | |While a DMA operation is on-going, this field cannot be modified. - * | | |WaySize / RAMBase 8K / {[23:13], 13u2019b0} 4K / {[23:12], 12u2019b0} 2K / {[23:11], 11u2019b0} 1K / {[23:10], 10u2019b0} - * | | |The following table lists the DMAAddr bits used as the offset for the RAM starting address - * | | |Note that the minimal DMA operation size is 16-byte (or 4-word). - * | | |Offset WaySize - * | | |DMASize 8K 4K 2K 1K - * | | |0 - - - - - * | | |1 [12] [11] [10] [9] - * | | |2 [12:11] [11:10] [10:9] [9:8] - * | | |3 [12:10] [11:9] [10:8] [9:7] - * | | |4 [12:9] [11:8] [10:7] [9:6] - * | | |5 [12:8] [11:7] [10:6] [9:5] - * | | |6 [12:7] [11:6] [10:5] [9:4] - * | | |7 [12:6] [11:5] [10:4] - - * |[30] |DMAFLUSH |Flushing DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a flushing DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a preloading DMA is on-going, this bit is not modifiable. - * |[31] |DMAPRELD |Preloading DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a preloading DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a flushing DMA is on-going, this bit is not modifiable. - * @var TCM_T::W3DMACTL - * Offset: 0x2C Tight Couple Memory Way3 DMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMASIZE |DMA Size Selection Bit - * | | |This field indicate and size of moving external memory to LMB after DMA is trigged. - * | | |000 = Full TCM way - * | | |001 = 1/2 TCM way - * | | |010 = 1/4 TCM way - * | | |011 = 1/8 TCM way - * | | |100 = 1/16 TCM way - * | | |101 = 1/32 TCM way - * | | |110 = 1/64 TCM way - * | | |111 = 1/128 TCM way - * | | |Note: This bit can be modified only when the corresponding WAYxEN bit is clear - * | | |(default: 0) When the embedded DMA engine is triggered for either LMB preloading or auto-flushing, this field defines the size of the operation according to the following table - * | | |While a DMA operation is on-going, this field cannot be modified. - * |[23:4] |DMAADDR |DMA starting RAM address - * | | |When a LMB-related DMA operation is triggered, this field provides the starting RAM address of the operation - * | | |Depending on the setting of the WaySize and DMASize, not all bits are used - * | | |The following table lists the DMAAddr bits used to construct the base of the starting RAM address according to WaySize - * | | |While a DMA operation is on-going, this field cannot be modified. - * | | |WaySize / RAMBase 8K / {[23:13], 13u2019b0} 4K / {[23:12], 12u2019b0} 2K / {[23:11], 11u2019b0} 1K / {[23:10], 10u2019b0} - * | | |The following table lists the DMAAddr bits used as the offset for the RAM starting address - * | | |Note that the minimal DMA operation size is 16-byte (or 4-word). - * | | |Offset WaySize - * | | |DMASize 8K 4K 2K 1K - * | | |0 - - - - - * | | |1 [12] [11] [10] [9] - * | | |2 [12:11] [11:10] [10:9] [9:8] - * | | |3 [12:10] [11:9] [10:8] [9:7] - * | | |4 [12:9] [11:8] [10:7] [9:6] - * | | |5 [12:8] [11:7] [10:6] [9:5] - * | | |6 [12:7] [11:6] [10:5] [9:4] - * | | |7 [12:6] [11:5] [10:4] - - * |[30] |DMAFLUSH |Flushing DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a flushing DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a preloading DMA is on-going, this bit is not modifiable. - * |[31] |DMAPRELD |Preloading DMA - * | | |When CacheMode bit is 0 (WayEnable bit 0 is OK), writing a 1 into this bit triggers a preloading DMA operation according to the setting in the DMASize and DMAAddr fields - * | | |This bit cannot be written 0 by M4 - * | | |It is self-clearing when the DMA operation completes - * | | |While a flushing DMA is on-going, this bit is not modifiable. - */ - __IO uint32_t GCTL; /*!< [0x0000] Tight Couple Memory Control Register */ - __I uint32_t RESERVE0[3]; - __IO uint32_t WAYCTL[4]; /*!< [0x10-0x1c] Tight Couple Memory Way0 Control Register */ - __IO uint32_t WDMACTL[4]; /*!< [0x20-0x2c] Tight Couple Memory Way0 DMA Control Register */ - -} TCM_T; - -/** - @addtogroup TCM_CONST TCM Bit Field Definition - Constant Definitions for TCM Controller -@{ */ - -#define TCM_GCTL_WAYNUM_Pos (0) /*!< TCM_T::GCTL: WAYNUM Position */ -#define TCM_GCTL_WAYNUM_Msk (0x3ul << TCM_GCTL_WAYNUM_Pos) /*!< TCM_T::GCTL: WAYNUM Mask */ - -#define TCM_GCTL_WAYSIZE_Pos (2) /*!< TCM_T::GCTL: WAYSIZE Position */ -#define TCM_GCTL_WAYSIZE_Msk (0x3ul << TCM_GCTL_WAYSIZE_Pos) /*!< TCM_T::GCTL: WAYSIZE Mask */ - -#define TCM_GCTL_CACHECFG_Pos (4) /*!< TCM_T::GCTL: CACHECFG Position */ -#define TCM_GCTL_CACHECFG_Msk (0x1ul << TCM_GCTL_CACHECFG_Pos) /*!< TCM_T::GCTL: CACHECFG Mask */ - -#define TCM_GCTL_FIXAZERO_Pos (5) /*!< TCM_T::GCTL: FIXAZERO Position */ -#define TCM_GCTL_FIXAZERO_Msk (0x1ul << TCM_GCTL_FIXAZERO_Pos) /*!< TCM_T::GCTL: FIXAZERO Mask */ - -#define TCM_GCTL_WAY0EN_Pos (8) /*!< TCM_T::GCTL: WAY0EN Position */ -#define TCM_GCTL_WAY0EN_Msk (0x1ul << TCM_GCTL_WAY0EN_Pos) /*!< TCM_T::GCTL: WAY0EN Mask */ - -#define TCM_GCTL_WAY1EN_Pos (9) /*!< TCM_T::GCTL: WAY1EN Position */ -#define TCM_GCTL_WAY1EN_Msk (0x1ul << TCM_GCTL_WAY1EN_Pos) /*!< TCM_T::GCTL: WAY1EN Mask */ - -#define TCM_GCTL_WAY2EN_Pos (10) /*!< TCM_T::GCTL: WAY2EN Position */ -#define TCM_GCTL_WAY2EN_Msk (0x1ul << TCM_GCTL_WAY2EN_Pos) /*!< TCM_T::GCTL: WAY2EN Mask */ - -#define TCM_GCTL_WAY3EN_Pos (11) /*!< TCM_T::GCTL: WAY3EN Position */ -#define TCM_GCTL_WAY3EN_Msk (0x1ul << TCM_GCTL_WAY3EN_Pos) /*!< TCM_T::GCTL: WAY3EN Mask */ - -#define TCM_W0CTL_CACHEMD_Pos (0) /*!< TCM_T::W0CTL: CACHEMD Position */ -#define TCM_W0CTL_CACHEMD_Msk (0x1ul << TCM_W0CTL_CACHEMD_Pos) /*!< TCM_T::W0CTL: CACHEMD Mask */ - -#define TCM_W0CTL_PRELD_Pos (1) /*!< TCM_T::W0CTL: PRELD Position */ -#define TCM_W0CTL_PRELD_Msk (0x1ul << TCM_W0CTL_PRELD_Pos) /*!< TCM_T::W0CTL: PRELD Mask */ - -#define TCM_W0CTL_PRELDST_Pos (2) /*!< TCM_T::W0CTL: PRELDST Position */ -#define TCM_W0CTL_PRELDST_Msk (0x1ul << TCM_W0CTL_PRELDST_Pos) /*!< TCM_T::W0CTL: PRELDST Mask */ - -#define TCM_W0CTL_INVALST_Pos (3) /*!< TCM_T::W0CTL: INVALST Position */ -#define TCM_W0CTL_INVALST_Msk (0x1ul << TCM_W0CTL_INVALST_Pos) /*!< TCM_T::W0CTL: INVALST Mask */ - -#define TCM_W0CTL_AFLUSH_Pos (4) /*!< TCM_T::W0CTL: AFLUSH Position */ -#define TCM_W0CTL_AFLUSH_Msk (0x1ul << TCM_W0CTL_AFLUSH_Pos) /*!< TCM_T::W0CTL: AFLUSH Mask */ - -#define TCM_W0CTL_AFLUSHST_Pos (5) /*!< TCM_T::W0CTL: AFLUSHST Position */ -#define TCM_W0CTL_AFLUSHST_Msk (0x1ul << TCM_W0CTL_AFLUSHST_Pos) /*!< TCM_T::W0CTL: AFLUSHST Mask */ - -#define TCM_W0CTL_AZERO_Pos (6) /*!< TCM_T::W0CTL: AZERO Position */ -#define TCM_W0CTL_AZERO_Msk (0x1ul << TCM_W0CTL_AZERO_Pos) /*!< TCM_T::W0CTL: AZERO Mask */ - -#define TCM_W0CTL_AZEROST_Pos (7) /*!< TCM_T::W0CTL: AZEROST Position */ -#define TCM_W0CTL_AZEROST_Msk (0x1ul << TCM_W0CTL_AZEROST_Pos) /*!< TCM_T::W0CTL: AZEROST Mask */ - -#define TCM_W0CTL_XOMERROR_Pos (8) /*!< TCM_T::W0CTL: XOMERROR Position */ -#define TCM_W0CTL_XOMERROR_Msk (0x1ul << TCM_W0CTL_XOMERROR_Pos) /*!< TCM_T::W0CTL: XOMERROR Mask */ - -#define TCM_W0CTL_ERROR_Pos (9) /*!< TCM_T::W0CTL: ERROR Position */ -#define TCM_W0CTL_ERROR_Msk (0x1ul << TCM_W0CTL_ERROR_Pos) /*!< TCM_T::W0CTL: ERROR Mask */ - -#define TCM_W0CTL_LMBTAG_Pos (13) /*!< TCM_T::W0CTL: LMBTAG Position */ -#define TCM_W0CTL_LMBTAG_Msk (0x7fful << TCM_W0CTL_LMBTAG_Pos) /*!< TCM_T::W0CTL: LMBTAG Mask */ - -#define TCM_W1CTL_CACHEMD_Pos (0) /*!< TCM_T::W1CTL: CACHEMD Position */ -#define TCM_W1CTL_CACHEMD_Msk (0x1ul << TCM_W1CTL_CACHEMD_Pos) /*!< TCM_T::W1CTL: CACHEMD Mask */ - -#define TCM_W1CTL_PRELD_Pos (1) /*!< TCM_T::W1CTL: PRELD Position */ -#define TCM_W1CTL_PRELD_Msk (0x1ul << TCM_W1CTL_PRELD_Pos) /*!< TCM_T::W1CTL: PRELD Mask */ - -#define TCM_W1CTL_PRELDST_Pos (2) /*!< TCM_T::W1CTL: PRELDST Position */ -#define TCM_W1CTL_PRELDST_Msk (0x1ul << TCM_W1CTL_PRELDST_Pos) /*!< TCM_T::W1CTL: PRELDST Mask */ - -#define TCM_W1CTL_INVALST_Pos (3) /*!< TCM_T::W1CTL: INVALST Position */ -#define TCM_W1CTL_INVALST_Msk (0x1ul << TCM_W1CTL_INVALST_Pos) /*!< TCM_T::W1CTL: INVALST Mask */ - -#define TCM_W1CTL_AFLUSH_Pos (4) /*!< TCM_T::W1CTL: AFLUSH Position */ -#define TCM_W1CTL_AFLUSH_Msk (0x1ul << TCM_W1CTL_AFLUSH_Pos) /*!< TCM_T::W1CTL: AFLUSH Mask */ - -#define TCM_W1CTL_AFLUSHST_Pos (5) /*!< TCM_T::W1CTL: AFLUSHST Position */ -#define TCM_W1CTL_AFLUSHST_Msk (0x1ul << TCM_W1CTL_AFLUSHST_Pos) /*!< TCM_T::W1CTL: AFLUSHST Mask */ - -#define TCM_W1CTL_AZERO_Pos (6) /*!< TCM_T::W1CTL: AZERO Position */ -#define TCM_W1CTL_AZERO_Msk (0x1ul << TCM_W1CTL_AZERO_Pos) /*!< TCM_T::W1CTL: AZERO Mask */ - -#define TCM_W1CTL_AZEROST_Pos (7) /*!< TCM_T::W1CTL: AZEROST Position */ -#define TCM_W1CTL_AZEROST_Msk (0x1ul << TCM_W1CTL_AZEROST_Pos) /*!< TCM_T::W1CTL: AZEROST Mask */ - -#define TCM_W1CTL_XOMERROR_Pos (8) /*!< TCM_T::W1CTL: XOMERROR Position */ -#define TCM_W1CTL_XOMERROR_Msk (0x1ul << TCM_W1CTL_XOMERROR_Pos) /*!< TCM_T::W1CTL: XOMERROR Mask */ - -#define TCM_W1CTL_ERROR_Pos (9) /*!< TCM_T::W1CTL: ERROR Position */ -#define TCM_W1CTL_ERROR_Msk (0x1ul << TCM_W1CTL_ERROR_Pos) /*!< TCM_T::W1CTL: ERROR Mask */ - -#define TCM_W1CTL_LMBTAG_Pos (13) /*!< TCM_T::W1CTL: LMBTAG Position */ -#define TCM_W1CTL_LMBTAG_Msk (0x7fful << TCM_W1CTL_LMBTAG_Pos) /*!< TCM_T::W1CTL: LMBTAG Mask */ - -#define TCM_W2CTL_CACHEMD_Pos (0) /*!< TCM_T::W2CTL: CACHEMD Position */ -#define TCM_W2CTL_CACHEMD_Msk (0x1ul << TCM_W2CTL_CACHEMD_Pos) /*!< TCM_T::W2CTL: CACHEMD Mask */ - -#define TCM_W2CTL_PRELD_Pos (1) /*!< TCM_T::W2CTL: PRELD Position */ -#define TCM_W2CTL_PRELD_Msk (0x1ul << TCM_W2CTL_PRELD_Pos) /*!< TCM_T::W2CTL: PRELD Mask */ - -#define TCM_W2CTL_PRELDST_Pos (2) /*!< TCM_T::W2CTL: PRELDST Position */ -#define TCM_W2CTL_PRELDST_Msk (0x1ul << TCM_W2CTL_PRELDST_Pos) /*!< TCM_T::W2CTL: PRELDST Mask */ - -#define TCM_W2CTL_INVALST_Pos (3) /*!< TCM_T::W2CTL: INVALST Position */ -#define TCM_W2CTL_INVALST_Msk (0x1ul << TCM_W2CTL_INVALST_Pos) /*!< TCM_T::W2CTL: INVALST Mask */ - -#define TCM_W2CTL_AFLUSH_Pos (4) /*!< TCM_T::W2CTL: AFLUSH Position */ -#define TCM_W2CTL_AFLUSH_Msk (0x1ul << TCM_W2CTL_AFLUSH_Pos) /*!< TCM_T::W2CTL: AFLUSH Mask */ - -#define TCM_W2CTL_AFLUSHST_Pos (5) /*!< TCM_T::W2CTL: AFLUSHST Position */ -#define TCM_W2CTL_AFLUSHST_Msk (0x1ul << TCM_W2CTL_AFLUSHST_Pos) /*!< TCM_T::W2CTL: AFLUSHST Mask */ - -#define TCM_W2CTL_AZERO_Pos (6) /*!< TCM_T::W2CTL: AZERO Position */ -#define TCM_W2CTL_AZERO_Msk (0x1ul << TCM_W2CTL_AZERO_Pos) /*!< TCM_T::W2CTL: AZERO Mask */ - -#define TCM_W2CTL_AZEROST_Pos (7) /*!< TCM_T::W2CTL: AZEROST Position */ -#define TCM_W2CTL_AZEROST_Msk (0x1ul << TCM_W2CTL_AZEROST_Pos) /*!< TCM_T::W2CTL: AZEROST Mask */ - -#define TCM_W2CTL_XOMERROR_Pos (8) /*!< TCM_T::W2CTL: XOMERROR Position */ -#define TCM_W2CTL_XOMERROR_Msk (0x1ul << TCM_W2CTL_XOMERROR_Pos) /*!< TCM_T::W2CTL: XOMERROR Mask */ - -#define TCM_W2CTL_ERROR_Pos (9) /*!< TCM_T::W2CTL: ERROR Position */ -#define TCM_W2CTL_ERROR_Msk (0x1ul << TCM_W2CTL_ERROR_Pos) /*!< TCM_T::W2CTL: ERROR Mask */ - -#define TCM_W2CTL_LMBTAG_Pos (13) /*!< TCM_T::W2CTL: LMBTAG Position */ -#define TCM_W2CTL_LMBTAG_Msk (0x7fful << TCM_W2CTL_LMBTAG_Pos) /*!< TCM_T::W2CTL: LMBTAG Mask */ - -#define TCM_W3CTL_CACHEMD_Pos (0) /*!< TCM_T::W3CTL: CACHEMD Position */ -#define TCM_W3CTL_CACHEMD_Msk (0x1ul << TCM_W3CTL_CACHEMD_Pos) /*!< TCM_T::W3CTL: CACHEMD Mask */ - -#define TCM_W3CTL_PRELD_Pos (1) /*!< TCM_T::W3CTL: PRELD Position */ -#define TCM_W3CTL_PRELD_Msk (0x1ul << TCM_W3CTL_PRELD_Pos) /*!< TCM_T::W3CTL: PRELD Mask */ - -#define TCM_W3CTL_PRELDST_Pos (2) /*!< TCM_T::W3CTL: PRELDST Position */ -#define TCM_W3CTL_PRELDST_Msk (0x1ul << TCM_W3CTL_PRELDST_Pos) /*!< TCM_T::W3CTL: PRELDST Mask */ - -#define TCM_W3CTL_INVALST_Pos (3) /*!< TCM_T::W3CTL: INVALST Position */ -#define TCM_W3CTL_INVALST_Msk (0x1ul << TCM_W3CTL_INVALST_Pos) /*!< TCM_T::W3CTL: INVALST Mask */ - -#define TCM_W3CTL_AFLUSH_Pos (4) /*!< TCM_T::W3CTL: AFLUSH Position */ -#define TCM_W3CTL_AFLUSH_Msk (0x1ul << TCM_W3CTL_AFLUSH_Pos) /*!< TCM_T::W3CTL: AFLUSH Mask */ - -#define TCM_W3CTL_AFLUSHST_Pos (5) /*!< TCM_T::W3CTL: AFLUSHST Position */ -#define TCM_W3CTL_AFLUSHST_Msk (0x1ul << TCM_W3CTL_AFLUSHST_Pos) /*!< TCM_T::W3CTL: AFLUSHST Mask */ - -#define TCM_W3CTL_AZERO_Pos (6) /*!< TCM_T::W3CTL: AZERO Position */ -#define TCM_W3CTL_AZERO_Msk (0x1ul << TCM_W3CTL_AZERO_Pos) /*!< TCM_T::W3CTL: AZERO Mask */ - -#define TCM_W3CTL_AZEROST_Pos (7) /*!< TCM_T::W3CTL: AZEROST Position */ -#define TCM_W3CTL_AZEROST_Msk (0x1ul << TCM_W3CTL_AZEROST_Pos) /*!< TCM_T::W3CTL: AZEROST Mask */ - -#define TCM_W3CTL_XOMERROR_Pos (8) /*!< TCM_T::W3CTL: XOMERROR Position */ -#define TCM_W3CTL_XOMERROR_Msk (0x1ul << TCM_W3CTL_XOMERROR_Pos) /*!< TCM_T::W3CTL: XOMERROR Mask */ - -#define TCM_W3CTL_ERROR_Pos (9) /*!< TCM_T::W3CTL: ERROR Position */ -#define TCM_W3CTL_ERROR_Msk (0x1ul << TCM_W3CTL_ERROR_Pos) /*!< TCM_T::W3CTL: ERROR Mask */ - -#define TCM_W3CTL_LMBTAG_Pos (13) /*!< TCM_T::W3CTL: LMBTAG Position */ -#define TCM_W3CTL_LMBTAG_Msk (0x7fful << TCM_W3CTL_LMBTAG_Pos) /*!< TCM_T::W3CTL: LMBTAG Mask */ - -#define TCM_W0DMACTL_DMASIZE_Pos (0) /*!< TCM_T::W0DMACTL: DMASIZE Position */ -#define TCM_W0DMACTL_DMASIZE_Msk (0x1ul << TCM_W0DMACTL_DMASIZE_Pos) /*!< TCM_T::W0DMACTL: DMASIZE Mask */ - -#define TCM_W0DMACTL_DMAADDR_Pos (4) /*!< TCM_T::W0DMACTL: DMAADDR Position */ -#define TCM_W0DMACTL_DMAADDR_Msk (0xffffful << TCM_W0DMACTL_DMAADDR_Pos) /*!< TCM_T::W0DMACTL: DMAADDR Mask */ - -#define TCM_W0DMACTL_DMAFLUSH_Pos (30) /*!< TCM_T::W0DMACTL: DMAFLUSH Position */ -#define TCM_W0DMACTL_DMAFLUSH_Msk (0x1ul << TCM_W0DMACTL_DMAFLUSH_Pos) /*!< TCM_T::W0DMACTL: DMAFLUSH Mask */ - -#define TCM_W0DMACTL_DMAPRELD_Pos (31) /*!< TCM_T::W0DMACTL: DMAPRELD Position */ -#define TCM_W0DMACTL_DMAPRELD_Msk (0x1ul << TCM_W0DMACTL_DMAPRELD_Pos) /*!< TCM_T::W0DMACTL: DMAPRELD Mask */ - -#define TCM_W1DMACTL_DMASIZE_Pos (0) /*!< TCM_T::W1DMACTL: DMASIZE Position */ -#define TCM_W1DMACTL_DMASIZE_Msk (0x1ul << TCM_W1DMACTL_DMASIZE_Pos) /*!< TCM_T::W1DMACTL: DMASIZE Mask */ - -#define TCM_W1DMACTL_DMAADDR_Pos (4) /*!< TCM_T::W1DMACTL: DMAADDR Position */ -#define TCM_W1DMACTL_DMAADDR_Msk (0xffffful << TCM_W1DMACTL_DMAADDR_Pos) /*!< TCM_T::W1DMACTL: DMAADDR Mask */ - -#define TCM_W1DMACTL_DMAFLUSH_Pos (30) /*!< TCM_T::W1DMACTL: DMAFLUSH Position */ -#define TCM_W1DMACTL_DMAFLUSH_Msk (0x1ul << TCM_W1DMACTL_DMAFLUSH_Pos) /*!< TCM_T::W1DMACTL: DMAFLUSH Mask */ - -#define TCM_W1DMACTL_DMAPRELD_Pos (31) /*!< TCM_T::W1DMACTL: DMAPRELD Position */ -#define TCM_W1DMACTL_DMAPRELD_Msk (0x1ul << TCM_W1DMACTL_DMAPRELD_Pos) /*!< TCM_T::W1DMACTL: DMAPRELD Mask */ - -#define TCM_W2DMACTL_DMASIZE_Pos (0) /*!< TCM_T::W2DMACTL: DMASIZE Position */ -#define TCM_W2DMACTL_DMASIZE_Msk (0x1ul << TCM_W2DMACTL_DMASIZE_Pos) /*!< TCM_T::W2DMACTL: DMASIZE Mask */ - -#define TCM_W2DMACTL_DMAADDR_Pos (4) /*!< TCM_T::W2DMACTL: DMAADDR Position */ -#define TCM_W2DMACTL_DMAADDR_Msk (0xffffful << TCM_W2DMACTL_DMAADDR_Pos) /*!< TCM_T::W2DMACTL: DMAADDR Mask */ - -#define TCM_W2DMACTL_DMAFLUSH_Pos (30) /*!< TCM_T::W2DMACTL: DMAFLUSH Position */ -#define TCM_W2DMACTL_DMAFLUSH_Msk (0x1ul << TCM_W2DMACTL_DMAFLUSH_Pos) /*!< TCM_T::W2DMACTL: DMAFLUSH Mask */ - -#define TCM_W2DMACTL_DMAPRELD_Pos (31) /*!< TCM_T::W2DMACTL: DMAPRELD Position */ -#define TCM_W2DMACTL_DMAPRELD_Msk (0x1ul << TCM_W2DMACTL_DMAPRELD_Pos) /*!< TCM_T::W2DMACTL: DMAPRELD Mask */ - -#define TCM_W3DMACTL_DMASIZE_Pos (0) /*!< TCM_T::W3DMACTL: DMASIZE Position */ -#define TCM_W3DMACTL_DMASIZE_Msk (0x1ul << TCM_W3DMACTL_DMASIZE_Pos) /*!< TCM_T::W3DMACTL: DMASIZE Mask */ - -#define TCM_W3DMACTL_DMAADDR_Pos (4) /*!< TCM_T::W3DMACTL: DMAADDR Position */ -#define TCM_W3DMACTL_DMAADDR_Msk (0xffffful << TCM_W3DMACTL_DMAADDR_Pos) /*!< TCM_T::W3DMACTL: DMAADDR Mask */ - -#define TCM_W3DMACTL_DMAFLUSH_Pos (30) /*!< TCM_T::W3DMACTL: DMAFLUSH Position */ -#define TCM_W3DMACTL_DMAFLUSH_Msk (0x1ul << TCM_W3DMACTL_DMAFLUSH_Pos) /*!< TCM_T::W3DMACTL: DMAFLUSH Mask */ - -#define TCM_W3DMACTL_DMAPRELD_Pos (31) /*!< TCM_T::W3DMACTL: DMAPRELD Position */ -#define TCM_W3DMACTL_DMAPRELD_Msk (0x1ul << TCM_W3DMACTL_DMAPRELD_Pos) /*!< TCM_T::W3DMACTL: DMAPRELD Mask */ - -/**@}*/ /* TCM_CONST */ -/**@}*/ /* end of TCM register group */ - - -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __ACMP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/timer_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/timer_reg.h deleted file mode 100644 index 79d21932c19..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/timer_reg.h +++ /dev/null @@ -1,1231 +0,0 @@ -/**************************************************************************//** - * @file timer_reg.h - * @version V1.00 - * @brief TIMER register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TIMER_REG_H__ -#define __TIMER_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Timer Controller -------------------------*/ -/** - @addtogroup TIMER Timer Controller(TIMER) - Memory Mapped Structure for CRC Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var TIMER_T::CTL - * Offset: 0x00 Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PSC |Prescale Counter - * | | |Timer input clock or event source is divided by (PSC+1) before it is fed to the timer up counter - * | | |If this field is 0 (PSC = 0), then there is no scaling. - * | | |Note: Update prescale counter value will reset internal 8-bit prescale counter and 24-bit up counter value. - * |[19] |INTRGEN |Inter-timer Trigger Mode Enable Control - * | | |Setting this bit will enable the inter-timer trigger capture function. - * | | |The Timer0/2 will be in event counter mode and counting with external clock source or event - * | | |Also, Timer1/3 will be in trigger-counting mode of capture function. - * | | |0 = Inter-Timer Trigger Capture mode Disabled. - * | | |1 = Inter-Timer Trigger Capture mode Enabled. - * | | |Note: For Timer1/3, this bit is ignored and the read back value is always 0. - * |[20] |PERIOSEL |Periodic Mode Behavior Selection Enable Bit - * | | |0 = The behavior selection in periodic mode is Disabled. - * | | |When user updates CMPDAT while timer is running in periodic mode, - * | | |CNT will be reset to default value. - * | | |1 = The behavior selection in periodic mode is Enabled. - * | | |When user update CMPDAT while timer is running in periodic mode, the limitations as bellows list, - * | | |If updated CMPDAT value > CNT, CMPDAT will be updated and CNT keep running continually. - * | | |If updated CMPDAT value = CNT, timer time-out interrupt will be asserted immediately. - * | | |If updated CMPDAT value < CNT, CNT will be reset to default value. - * |[21] |TGLPINSEL |Toggle-output Pin Select - * | | |0 = Toggle mode output to TMx (Timer Event Counter Pin). - * | | |1 = Toggle mode output to TMx_EXT (Timer External Capture Pin). - * |[22] |CAPSRC |Capture Pin Source Selection - * | | |0 = Capture Function source is from TMx_EXT (x= 0~3) pin. - * | | |1 = Capture Function source is from internal ACMP output signal - * | | |User can set ACMPSSEL (TIMERx_EXTCTL[8]) to decide which internal ACMP output signal as timer capture source. - * |[23] |WKEN |Wake-up Function Enable Bit - * | | |If this bit is set to 1, while timer interrupt flag TIF (TIMERx_INTSTS[0]) is 1 and INTEN (TIMERx_CTL[29]) is enabled, the timer interrupt signal will generate a wake-up trigger event to CPU. - * | | |0 = Wake-up function Disabled if timer interrupt signal generated. - * | | |1 = Wake-up function Enabled if timer interrupt signal generated. - * |[24] |EXTCNTEN |Event Counter Mode Enable Bit - * | | |This bit is for external counting pin function enabled. - * | | |0 = Event counter mode Disabled. - * | | |1 = Event counter mode Enabled. - * | | |Note: When timer is used as an event counter, this bit should be set to 1 and select PCLK as timer clock source. - * |[25] |ACTSTS |Timer Active Status Bit (Read Only) - * | | |This bit indicates the 24-bit up counter status. - * | | |0 = 24-bit up counter is not active. - * | | |1 = 24-bit up counter is active. - * | | |Note: This bit may active when CNT 0 transition to CNT 1. - * |[28:27] |OPMODE |Timer Counting Mode Select - * | | |00 = The Timer controller is operated in One-shot mode. - * | | |01 = The Timer controller is operated in Periodic mode. - * | | |10 = The Timer controller is operated in Toggle-output mode. - * | | |11 = The Timer controller is operated in Continuous Counting mode. - * |[29] |INTEN |Timer Interrupt Enable Bit - * | | |0 = Timer time-out interrupt Disabled. - * | | |1 = Timer time-out interrupt Enabled. - * | | |Note: If this bit is enabled, when the timer time-out interrupt flag TIF is set to 1, the timer interrupt signal is generated and inform to CPU. - * |[30] |CNTEN |Timer Counting Enable Bit - * | | |0 = Stops/Suspends counting. - * | | |1 = Starts counting. - * | | |Note1: In stop status, and then set CNTEN to 1 will enable the 24-bit up counter to keep counting from the last stop counting value. - * | | |Note2: This bit is auto-cleared by hardware in one-shot mode (TIMER_CTL[28:27] = 00) when the timer time-out interrupt flag TIF (TIMERx_INTSTS[0]) is generated. - * | | |Note3: Set enable/disable this bit needs 2 * TMR_CLK period to become active, user can read ACTSTS (TIMERx_CTL[25]) to check enable/disable command is completed or not. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects TIMER counting. - * | | |TIMER counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |TIMER counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var TIMER_T::CMP - * Offset: 0x04 Timer Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CMPDAT |Timer Comparator Value - * | | |CMPDAT is a 24-bit compared value register - * | | |When the internal 24-bit up counter value is equal to CMPDAT value, the TIF (TIMERx_INTSTS[0] Timer Interrupt Flag) will set to 1. - * | | |Time-out period = (Period of timer clock input) * (8-bit PSC + 1) * (24-bit CMPDAT). - * | | |Note1: Never write 0x0 or 0x1 in CMPDAT field, or the core will run into unknown state. - * | | |Note2: When timer is operating at continuous counting mode, the 24-bit up counter will keep counting continuously even if user writes a new value into CMPDAT field - * | | |But if timer is operating at other modes, the 24-bit up counter will restart counting from 0 and using newest CMPDAT value to be the timer compared value while user writes a new value into CMPDAT field. - * @var TIMER_T::INTSTS - * Offset: 0x08 Timer Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TIF |Timer Interrupt Flag - * | | |This bit indicates the interrupt flag status of Timer while 24-bit timer up counter CNT (TIMERx_CNT[23:0]) value reaches to CMPDAT (TIMERx_CMP[23:0]) value. - * | | |0 = No effect. - * | | |1 = CNT value matches the CMPDAT value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |TWKF |Timer Wake-up Flag - * | | |This bit indicates the interrupt wake-up flag status of timer. - * | | |0 = Timer does not cause CPU wake-up. - * | | |1 = CPU wake-up from Idle or Power-down mode if timer time-out interrupt signal generated. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::CNT - * Offset: 0x0C Timer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Timer Data Register - * | | |Read operation. - * | | |Read this register to get CNT value. For example: - * | | |If EXTCNTEN (TIMERx_CTL[24] ) is 0, user can read CNT value for getting current 24-bit counter value. - * | | |If EXTCNTEN (TIMERx_CTL[24] ) is 1, user can read CNT value for getting current 24-bit event input counter value. - * | | |Write operation. - * | | |Writing any value to this register will reset current CNT value to 0 and reload internal 8-bit prescale counter. - * |[31] |RSTACT |Timer Data Register Reset Active (Read Only) - * | | |This bit indicates if the counter reset operation active. - * | | |When user writes this CNT register, timer starts to reset its internal 24-bit timer up-counter to 0 and reload 8-bit pre-scale counter - * | | |At the same time, timer set this flag to 1 to indicate the counter reset operation is in progress - * | | |Once the counter reset operation done, timer clear this bit to 0 automatically. - * | | |0 = Reset operation is done. - * | | |1 = Reset operation triggered by writing TIMERx_CNT is in progress. - * | | |Note: This bit is read only. - * @var TIMER_T::CAP - * Offset: 0x10 Timer Capture Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CAPDAT |Timer Capture Data Register - * | | |When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT pin matched the CAPEDGE (TIMERx_EXTCTL[14:12]) setting, CAPIF (TIMERx_EINTSTS[0]) will set to 1 and the current timer counter value CNT (TIMERx_CNT[23:0]) will be auto-loaded into this CAPDAT field. - * @var TIMER_T::EXTCTL - * Offset: 0x14 Timer External Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTPHASE |Timer External Count Phase - * | | |This bit indicates the detection phase of external counting pin TMx (x= 0~3). - * | | |0 = A falling edge of external counting pin will be counted. - * | | |1 = A rising edge of external counting pin will be counted. - * |[3] |CAPEN |Timer External Capture Pin Enable Bit - * | | |This bit enables the TMx_EXT capture pin input function. - * | | |0 =TMx_EXT (x= 0~3) pin Disabled. - * | | |1 =TMx_EXT (x= 0~3) pin Enabled. - * |[4] |CAPFUNCS |Capture Function Selection - * | | |0 = External Capture Mode Enabled. - * | | |1 = External Reset Mode Enabled. - * | | |Note1: When CAPFUNCS is 0, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field. - * | | |Note2: When CAPFUNCS is 1, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field then CNT value will be reset immediately. - * |[5] |CAPIEN |Timer External Capture Interrupt Enable Bit - * | | |0 = TMx_EXT (x= 0~3) pin detection Interrupt Disabled. - * | | |1 = TMx_EXT (x= 0~3) pin detection Interrupt Enabled. - * | | |Note: CAPIEN is used to enable timer external interrupt - * | | |If CAPIEN enabled, timer will rise an interrupt when CAPIF (TIMERx_EINTSTS[0]) is 1. - * | | |For example, while CAPIEN = 1, CAPEN = 1, and CAPEDGE = 00, a 1 to 0 transition on the TMx_EXT pin will cause the CAPIF to be set then the interrupt signal is generated and sent to NVIC to inform CPU. - * |[6] |CAPDBEN |Timer External Capture Pin De-bounce Enable Bit - * | | |0 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Disabled. - * | | |1 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx_EXT pin or ACMP output is detected with de-bounce circuit. - * |[7] |CNTDBEN |Timer Counter Pin De-bounce Enable Bit - * | | |0 = TMx (x= 0~3) pin de-bounce Disabled. - * | | |1 = TMx (x= 0~3) pin de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx pin is detected with de-bounce circuit. - * |[8:10] |ICAPSEL |Internal Capture Source Select - * | | |000 = Capture Function source is from internal ACMP0 output signal. - * | | |001 = Capture Function source is from internal ACMP1 output signal. - * | | |010 = Capture Function source is from HXT. - * | | |011 = Capture Function source is from LXT. - * | | |100 = Capture Function source is from HIRC. - * | | |101 = Capture Function source is from LIRC. - * | | |110 = Reserved. - * | | |111 = Reserved. - * | | |Note: these bits only available when CAPSRC (TIMERx_CTL[22]) is 1. - * |[14:12] |CAPEDGE |Timer External Capture Pin Edge Detect - * | | |When first capture event is generated, the CNT (TIMERx_CNT[23:0]) will be reset to 0 and first CAPDAT (TIMERx_CAP[23:0]) should be to 0. - * | | |000 = Capture event occurred when detect falling edge transfer on TMx_EXT (x= 0~3) pin. - * | | |001 = Capture event occurred when detect rising edge transfer on TMx_EXT (x= 0~3) pin. - * | | |010 = Capture event occurred when detect both falling and rising edge transfer on TMx_EXT (x= 0~3) pin, and first capture event occurred at falling edge transfer. - * | | |011 = Capture event occurred when detect both rising and falling edge transfer on TMx_EXT (x= 0~3) pin, and first capture event occurred at rising edge transfer.. - * | | |110 = First capture event occurred at falling edge, follows capture events are at rising edge transfer on TMx_EXT (x= 0~3) pin. - * | | |111 = First capture event occurred at rising edge, follows capture events are at falling edge transfer on TMx_EXT (x= 0~3) pin. - * | | |100, 101 = Reserved. - * |[16] |ECNTSSEL |Event Counter Source Selection to Trigger Event Counter Function - * | | |0 = Event Counter input source is from TMx (x= 0~3) pin. - * | | |1 = Event Counter input source is from USB internal SOF output signal. - * |[31:28] |CAPDIVSCL |Timer Capture Source Divider - * | | |This bits indicate the divide scale for capture source divider - * | | |0000 = Capture source/1. - * | | |0001 = Capture source/2. - * | | |0010 = Capture source/4. - * | | |0011 = Capture source/8. - * | | |0100 = Capture source/16. - * | | |0101 = Capture source/32. - * | | |0110 = Capture source/64. - * | | |0111 = Capture source/128. - * | | |1000 = Capture source/256. - * | | |1001~1111 = Reserved. - * | | |Note: Sets INTERCAPSEL (TIMERx_EXTCTL[10:8]) and CAPSRC (TIMERx_CTL[22]) to select capture source. * @var TIMER_T::EINTSTS - * Offset: 0x18 Timer External Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPIF |Timer External Capture Interrupt Flag - * | | |This bit indicates the timer external capture interrupt flag status. - * | | |0 = TMx_EXT (x= 0~3) pin interrupt did not occur. - * | | |1 = TMx_EXT (x= 0~3) pin interrupt occurred. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT (x= 0~3) pin matched the CAPEDGE (TIMERx_EXTCTL[2:1]) setting, this bit will set to 1 by hardware. - * | | |Note3: There is a new incoming capture event detected before CPU clearing the CAPIF status - * | | |If the above condition occurred, the Timer will keep register TIMERx_CAP unchanged and drop the new capture value. - * @var TIMER_T::TRGCTL - * Offset: 0x1C Timer Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRGSSEL |Trigger Source Select Bit - * | | |This bit is used to select internal trigger source is form timer time-out interrupt signal or - * | | |capture interrupt signal. - * | | |0 = Time-out interrupt signal is used to internal trigger EPWM, BPWM, PDMA, DAC, and EADC. - * | | |1 = Capture interrupt signal is used to internal trigger EPWM, BPWM, PDMA, DAC, and EADC. - * |[1] |TRGPWM |Trigger EPWM and BPWM Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be as EPWM and BPWM counter clock source. - * | | |0 = Timer interrupt trigger EPWM and BPWM Disabled. - * | | |1 = Timer interrupt trigger EPWM and BPWM Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal as EPWM and BPWM counter clock source. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal as EPWM and BPWM counter clock source. - * |[2] |TRGEADC |Trigger EADC Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered EADC conversion. - * | | |0 = Timer interrupt trigger EADC Disabled. - * | | |1 = Timer interrupt trigger EADC Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger EADC conversion. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger EADC conversion. - * |[3] |TRGDAC |Trigger DAC Enable Bit - * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can be triggered DAC. - * | | |0 = Timer interrupt trigger DAC Disabled. - * | | |1 = Timer interrupt trigger DAC Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger DAC. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger DAC. - * |[4] |TRGPDMA |Trigger PDMA Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered PDMA transfer. - * | | |0 = Timer interrupt trigger PDMA Disabled. - * | | |1 = Timer interrupt trigger PDMA Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger PDMA transfer. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger PDMA transfer. - * @var TIMER_T::ALTCTL - * Offset: 0x20 Timer Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FUNCSEL |Function Selection - * | | |0 = Timer controller is used as timer function. - * | | |1 = Timer controller is used as PWM function. - * | | |Note: When timer is used as PWM, the clock source of time controller will be forced to PCLKx automatically. - * @var TIMER_T::CAPNF - * Offset: 0x24 Timer Capture Input Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPNFEN |Capture Noise Filter Enable - * | | |0 = Capture Noise Filter function Disabled. - * | | |1 = Capture Noise Filter function Enabled. - * |[6:4] |CAPNFSEL |Capture Edge Detector Noise Filter Clock Selection - * | | |000 = Noise filter clock is PCLKx. - * | | |001 = Noise filter clock is PCLKx/2. - * | | |010 = Noise filter clock is PCLKx/4. - * | | |011 = Noise filter clock is PCLKx/8. - * | | |100 = Noise filter clock is PCLKx/16. - * | | |101 = Noise filter clock is PCLKx/32. - * | | |110 = Noise filter clock is PCLKx/64. - * | | |111 = Noise filter clock is PCLKx/128. - * |[10:8] |CAPNFCNT |Capture Edge Detector Noise Filter Count - * | | |These bits control the capture filter counter to count from 0 to CAPNFCNT. - * @var TIMER_T::PWMCTL - * Offset: 0x40 Timer PWM Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN |PWM Counter Enable Bit - * | | |0 = PWM counter and clock prescale Stop Running. - * | | |1 = PWM counter and clock prescale Start Running. - * |[2:1] |CNTTYPE |PWM Counter Behavior Type - * | | |00 = Up count type. - * | | |01 = Down count type. - * | | |10 = Up-down count type. - * | | |11 = Reserved. - * |[3] |CNTMODE |PWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[8] |CTRLD |Center Re-load - * | | |In up-down count type, PERIOD will load to PBUF when current PWM period is completed always and CMP will load to CMPBUF at the center point of current period. - * |[9] |IMMLDEN |Immediately Load Enable Bit - * | | |0 = PERIOD will load to PBUF when current PWM period is completed no matter CTRLD is enabled/disabled - * | | |If CTRLD is disabled, CMP will load to CMPBUF when current PWM period is completed; if CTRLD is enabled in up-down count type, CMP will load to CMPBUF at the center point of current period. - * | | |1 = PERIOD/CMP will load to PBUF/CMPBUF immediately when user update PERIOD/CMP. - * | | |Note: If IMMLDEN is enabled, CTRLD will be invalid. - * |[16] |OUTMODE |PWM Output Mode - * | | |This bit controls the output mode of corresponding PWM channel. - * | | |0 = PWM independent mode. - * | | |1 = PWM complementary mode. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If debug mode counter halt is enabled, PWM counter will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt disable. - * | | |1 = ICE debug mode counter halt enable. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects PWM output. - * | | |PWM output pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |PWM output pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMCLKSRC - * Offset: 0x44 Timer PWM Counter Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |CLKSRC |PWM Counter Clock Source Select - * | | |The PWM counter clock source can be selected from TMRx_CLK or internal timer time-out or capture event. - * | | |000 = TMRx_CLK. - * | | |001 = Internal TIMER0 time-out or capture event. - * | | |010 = Internal TIMER1 time-out or capture event. - * | | |011 = Internal TIMER2 time-out or capture event. - * | | |100 = Internal TIMER3 time-out or capture event. - * | | |Others = Reserved. - * | | |Note: If TIMER0 PWM function is enabled, the PWM counter clock source can be selected from TMR0_CLK, TIMER1 interrupt events, TIMER2 interrupt events, or TIMER3 interrupt events. - * @var TIMER_T::PWMCLKPSC - * Offset: 0x48 Timer PWM Counter Clock Pre-scale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |PWM Counter Clock Pre-scale - * | | |The active clock of PWM counter is decided by counter clock prescale and divided by (CLKPSC + 1) - * | | |If CLKPSC is 0, then there is no scaling in PWM counter clock source. - * @var TIMER_T::PWMCNTCLR - * Offset: 0x4C Timer PWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR |Clear PWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit PWM counter to 0x10000 in up and up-down count type and reset counter value to PERIOD in down count type. - * @var TIMER_T::PWMPERIOD - * Offset: 0x50 Timer PWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |PWM Period Register - * | | |In up count type: PWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |In down count type: PWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |In up-down count type: PWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |In up and down count type: - * | | |PWM period time = (PERIOD + 1) * (CLKPSC + 1) * TMRx_PWMCLK. - * | | |In up-down count type: - * | | |PWM period time = 2 * PERIOD * (CLKPSC+ 1) * TMRx_PWMCLK. - * | | |Note: User should take care DIRF (TIMERx_PWMCNT[16]) bit in up/down/up-down count type to monitor current counter direction in each count type. - * @var TIMER_T::PWMCMPDAT - * Offset: 0x54 Timer PWM Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |PWM Comparator Register - * | | |PWM CMP is used to compare with PWM CNT to generate PWM output waveform, interrupt events and trigger ADC to start convert. - * @var TIMER_T::PWMDTCTL - * Offset: 0x58 Timer PWM Dead-Time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following two formulas: - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK, if DTCKSEL is 0. - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK * (CLKPSC + 1), if DTCKSEL is 1. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[16] |DTEN |Enable Dead-time Insertion for PWMx_CH0 and PWMx_CH1 (Write Protect) - * | | |Dead-time insertion function is only active when PWM complementary mode is enabled - * | | |If dead- time insertion is inactive, the outputs of PWMx_CH0 and PWMx_CH1 are complementary without any delay. - * | | |0 = Dead-time insertion Disabled on the pin pair. - * | | |1 = Dead-time insertion Enabled on the pin pair. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from TMRx_PWMCLK without counter clock prescale. - * | | |1 = Dead-time clock source from TMRx_PWMCLK with counter clock prescale. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMCNT - * Offset: 0x5C Timer PWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |PWM Counter Value Register (Read Only) - * | | |User can monitor CNT to know the current counter value in 16-bit period counter. - * |[16] |DIRF |PWM Counter Direction Indicator Flag (Read Only) - * | | |0 = Counter is active in down count. - * | | |1 = Counter is active up count. - * @var TIMER_T::PWMMSKEN - * Offset: 0x60 Timer PWM Output Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |PWMx_CH0 Output Mask Enable Bit - * | | |The PWMx_CH0 output signal will be masked when this bit is enabled - * | | |The PWMx_CH0 will output MSKDAT0 (TIMER_PWMMSK[0]) data. - * | | |0 = PWMx_CH0 output signal is non-masked. - * | | |1 = PWMx_CH0 output signal is masked and output MSKDAT0 data. - * |[1] |MSKEN1 |PWMx_CH1 Output Mask Enable Bit - * | | |The PWMx_CH1 output signal will be masked when this bit is enabled - * | | |The PWMx_CH1 will output MSKDAT1 (TIMER_PWMMSK[1]) data. - * | | |0 = PWMx_CH1 output signal is non-masked. - * | | |1 = PWMx_CH1 output signal is masked and output MSKDAT1 data. - * @var TIMER_T::PWMMSK - * Offset: 0x64 Timer PWM Output Mask Data Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |PWMx_CH0 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH0 pin when PWMx_CH0 output mask function is enabled (MSKEN0 = 1). - * | | |0 = Output logic Low to PWMx_CH0. - * | | |1 = Output logic High to PWMx_CH0. - * |[1] |MSKDAT1 |PWMx_CH1 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH1 pin when PWMx_CH1 output mask function is enabled (MSKEN1 = 1). - * | | |0 = Output logic Low to PWMx_CH1. - * | | |1 = Output logic High to PWMx_CH1. - * @var TIMER_T::PWMBNF - * Offset: 0x68 Timer PWM Brake Pin Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKNFEN |Brake Pin Noise Filter Enable Bit - * | | |0 = Pin noise filter detect of PWMx_BRAKEy Disabled. - * | | |1 = Pin noise filter detect of PWMx_BRAKEy Enabled. - * |[3:1] |BRKNFSEL |Brake Pin Noise Filter Clock Selection - * | | |000 = Noise filter clock is PCLKx. - * | | |001 = Noise filter clock is PCLKx/2. - * | | |010 = Noise filter clock is PCLKx/4. - * | | |011 = Noise filter clock is PCLKx/8. - * | | |100 = Noise filter clock is PCLKx/16. - * | | |101 = Noise filter clock is PCLKx/32. - * | | |110 = Noise filter clock is PCLKx/64. - * | | |111 = Noise filter clock is PCLKx/128. - * |[6:4] |BRKFCNT |Brake Pin Noise Filter Count - * | | |The fields is used to control the active noise filter sample time. - * | | |Once noise filter sample time = (Period time of BRKDBCS) * BRKFCNT. - * |[7] |BRKPINV |Brake Pin Detection Control Bit - * | | |0 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from high to low in edge-detect, or pin status is low in level-detect . - * |[17:16] |BKPINSRC |Brake Pin Source Select - * | | |00 = Brake pin source comes from PWM0_BRAKE0 pin. - * | | |01 = Brake pin source comes from PWM0_BRAKE1 pin. - * | | |10 = Brake pin source comes from PWM1_BRAKE0 pin. - * | | |11 = Brake pin source comes from PWM1_BRAKE1 pin. - * @var TIMER_T::PWMFAILBRK - * Offset: 0x6C Timer PWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by clock fail detection Disabled. - * | | |1 = Brake Function triggered by clock fail detection Enabled. - * |[1] |BODBRKEN |Brown-out Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by BOD event Disabled. - * | | |1 = Brake Function triggered by BOD event Enabled. - * |[2] |RAMBRKEN |SRAM Parity Error Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by SRAM parity error detection Disabled. - * | | |1 = Brake Function triggered by SRAM parity error detection Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by core lockup event Disabled. - * | | |1 = Brake Function triggered by core lockup event Enabled. - * @var TIMER_T::PWMBRKCTL - * Offset: 0x70 Timer PWM Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CPO0EBEN |Enable Internal ACMP0_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP0_O signal as edge-detect brake source Disabled. - * | | |1 = Internal ACMP0_O signal as edge-detect brake source Enabled. - * | | |Note1: Only internal ACMP0_O signal from low to high will be detected as brake event. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |CPO1EBEN |Enable Internal ACMP1_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP1_O signal as edge-detect brake source Disabled. - * | | |1 = Internal ACMP1_O signal as edge-detect brake source Enabled. - * | | |Note1: Only internal ACMP1_O signal from low to high will be detected as brake event. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[4] |BRKPEEN |Enable TM_BRAKEx Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as edge-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System fail condition as edge-detect brake source Disabled. - * | | |1 = System fail condition as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |CPO0LBEN |Enable Internal ACMP0_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP0_O signal as level-detect brake source Disabled. - * | | |1 = Internal ACMP0_O signal as level-detect brake source Enabled. - * | | |Note1: Only internal ACMP0_O signal from low to high will be detected as brake event. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |CPO1LBEN |Enable Internal ACMP1_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP1_O signal as level-detect brake source Disabled. - * | | |1 = Internal ACMP1_O signal as level-detect brake source Enabled. - * | | |Note1: Only internal ACMP1_O signal from low to high will be detected as brake event. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[12] |BRKPLEN |Enable TM_BRAKEx Pin As Level-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as level-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System fail condition as level-detect brake source Disabled. - * | | |1 = System fail condition as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[17:16] |BRKAEVEN |PWM Brake Action Select for PWMx_CH0 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH0 output. - * | | |01 = PWMx_CH0 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH0 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH0 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[19:18] |BRKAODD |PWM Brake Action Select for PWMx_CH1 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH1 output. - * | | |01 = PWMx_CH1 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH1 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH1 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMPOLCTL - * Offset: 0x74 Timer PWM Pin Output Polar Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |PWMx_CH0 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH0 output pin. - * | | |0 = PWMx_CH0 output pin polar inverse Disabled. - * | | |1 = PWMx_CH0 output pin polar inverse Enabled. - * |[1] |PINV1 |PWMx_CH1 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH1 output pin. - * | | |0 = PWMx_CH1 output pin polar inverse Disabled. - * | | |1 = PWMx_CH1 output pin polar inverse Enabled. - * @var TIMER_T::PWMPOEN - * Offset: 0x78 Timer PWM Pin Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |PWMx_CH0 Output Pin Enable Bit - * | | |0 = PWMx_CH0 pin at tri-state mode. - * | | |1 = PWMx_CH0 pin in output mode. - * |[1] |POEN1 |PWMx_CH1 Output Pin Enable Bit - * | | |0 = PWMx_CH1 pin at tri-state mode. - * | | |1 = PWMx_CH1 pin in output mode. - * @var TIMER_T::PWMSWBRK - * Offset: 0x7C Timer PWM Software Trigger Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG |Software Trigger Edge-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM edge-detect brake source, then BRKEIF0 and BRKEIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLTRG |Software Trigger Level-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM level-detect brake source, then BRKLIF0 and BRKLIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMINTEN0 - * Offset: 0x80 Timer PWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN |PWM Zero Point Interrupt Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * |[1] |PIEN |PWM Period Point Interrupt Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When in up-down count type, period point means the center point of current PWM period. - * |[2] |CMPUIEN |PWM Compare Up Count Interrupt Enable Bit - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[3] |CMPDIEN |PWM Compare Down Count Interrupt Enable Bit - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * @var TIMER_T::PWMINTEN1 - * Offset: 0x84 Timer PWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN |PWM Edge-detect Brake Interrupt Enable (Write Protect) - * | | |0 = PWM edge-detect brake interrupt Disabled. - * | | |1 = PWM edge-detect brake interrupt Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIEN |PWM Level-detect Brake Interrupt Enable (Write Protect) - * | | |0 = PWM level-detect brake interrupt Disabled. - * | | |1 = PWM level-detect brake interrupt Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMINTSTS0 - * Offset: 0x88 Timer PWM Interrupt Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF |PWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches zero. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |PIF |PWM Period Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches PERIOD. - * | | |Note1: When in up-down count type, PIF flag means the center point flag of current PWM period. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[2] |CMPUIF |PWM Compare Up Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in up count direction and reaches CMP. - * | | |Note1: If CMP equal to PERIOD, there is no CMPUIF flag in up count type and up-down count type. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[3] |CMPDIF |PWM Compare Down Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in down count direction and reaches CMP. - * | | |Note1: If CMP equal to PERIOD, there is no CMPDIF flag in down count type. - * | | |Note2: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMINTSTS1 - * Offset: 0x8C Timer PWM Interrupt Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |Edge-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 edge-detect brake event do not happened. - * | | |1 = PWMx_CH0 edge-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |BRKEIF1 |Edge-detect Brake Interrupt Flag PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 edge-detect brake event do not happened. - * | | |1 = PWMx_CH1 edge-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIF0 |Level-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 level-detect brake event do not happened. - * | | |1 = PWMx_CH0 level-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |BRKLIF1 |Level-detect Brake Interrupt Flag on PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 level-detect brake event do not happened. - * | | |1 = PWMx_CH1 level-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[16] |BRKESTS0 |Edge -detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 edge-detect brake state is released. - * | | |1 = PWMx_CH0 at edge-detect brake state. - * | | |Note: User can set BRKEIF0 1 to clear BRKEIF0 flag and PWMx_CH0 will release brake state when current PWM period finished and resume PWMx_CH0 output waveform start from next full PWM period. - * |[17] |BRKESTS1 |Edge-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 edge-detect brake state is released. - * | | |1 = PWMx_CH1 at edge-detect brake state. - * | | |Note: User can set BRKEIF1 1 to clear BRKEIF1 flag and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH1 output waveform start from next full PWM period. - * |[24] |BRKLSTS0 |Level-detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 level-detect brake state is released. - * | | |1 = PWMx_CH0 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * |[25] |BRKLSTS1 |Level-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 level-detect brake state is released. - * | | |1 = PWMx_CH1 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * @var TIMER_T::PWMTRGCTL - * Offset: 0x90 Timer PWM Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TRGSEL |PWM Counter Event Source Select to Trigger Conversion - * | | |000 = Trigger conversion at zero point (ZIF). - * | | |001 = Trigger conversion at period point (PIF). - * | | |010 = Trigger conversion at zero or period point (ZIF or PIF). - * | | |011 = Trigger conversion at compare up count point (CMPUIF). - * | | |100 = Trigger conversion at compare down count point (CMPDIF). - * | | |Others = Reserved. - * |[7] |TRGEADC |PWM Counter Event Trigger EADC Conversion Enable Bit - * | | |0 = PWM counter event trigger EADC conversion Disabled. - * | | |1 = PWM counter event trigger EADC conversion Enabled. - * @var TIMER_T::PWMSCTL - * Offset: 0x94 Timer PWM Synchronous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SYNCMODE |PWM Synchronous Mode Enable Select - * | | |00 = PWM synchronous function Disabled. - * | | |01 = PWM synchronous counter start function Enabled. - * | | |10 = Reserved. - * | | |11 = PWM synchronous counter clear function Enabled. - * |[8] |SYNCSRC |PWM Synchronous Counter Start/Clear Source Select - * | | |0 = Counter synchronous start/clear by trigger TIMER0_PWMSTRG STRGEN. - * | | |1 = Counter synchronous start/clear by trigger TIMER2_PWMSTRG STRGEN. - * | | |Note1: If TIMER0/1/2/3 PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8], TIMER1_PWMSCTL[8], TIMER2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be 0. - * | | |Note2: If TIMER0/1/ PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8] and TIMER1_PWMSCTL[8] should be set 0, and TIMER2/3/ PWM counter synchronous source are from TIMER2, TIME2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be set 1. - * @var TIMER_T::PWMSTRG - * Offset: 0x98 Timer PWM Synchronous Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STRGEN |PWM Counter Synchronous Trigger Enable Bit (Write Only) - * | | |PMW counter synchronous function is used to make selected PWM channels (include TIMER0/1/2/3 PWM, TIMER0/1 PWM and TIMER2/3 PWM) start counting or clear counter at the same time according to TIMERx_PWMSCTL setting. - * | | |Note: This bit is only available in TIMER0 and TIMER2. - * @var TIMER_T::PWMSTATUS - * Offset: 0x9C Timer PWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF |PWM Counter Equal to 0xFFFF Flag - * | | |0 = Indicates the PWM counter value never reached its maximum value 0xFFFF. - * | | |1 = Indicates the PWM counter value has reached its maximum value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[16] |EADCTRGF |Trigger EADC Start Conversion Flag - * | | |0 = PWM counter event trigger EADC start conversion is not occurred. - * | | |1 = PWM counter event trigger EADC start conversion has occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMPBUF - * Offset: 0xA0 Timer PWM Period Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |PWM Period Buffer Register (Read Only) - * | | |Used as PERIOD active register. - * @var TIMER_T::PWMCMPBUF - * Offset: 0xA4 Timer PWM Comparator Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |PWM Comparator Buffer Register (Read Only) - * | | |Used as CMP active register. - * @var TIMER_T::PWMIFA - * Offset: 0xA8 Timer PWM Interrupt Flag Accumulator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |PWM Interrupt Flag Accumulator Counter - * | | |This field sets the count number which defines (IFACNT+1) times of specify PWM interrupt occurs to set IFAIF bit to request the PWM accumulator interrupt. - * | | |PWM accumulator flag (IFAIF) will be set in every (IFACNT+1) times during the the PWM counter operation. - * |[24] |STPMOD |PWM Accumulator Stop Mode Enable Bit - * | | |0 = PWM interrupt accumulator event to stop counting Disabled. - * | | |1 = PWM interrupt accumulator event to stop counting Enabled. - * |[29:28] |IFASEL |PWM Interrupt Flag Accumulator Source Select - * | | |00 = Accumulate at each PWM zero point. - * | | |01 = Accumulate at each PWM period point. - * | | |10 = Accumulate at each PWM up-count compared point. - * | | |11 = Accumulate at each PWM down-count compared point. - * |[31] |IFAEN |PWM Interrupt Flag Accumulator Enable Bit - * | | |0 = PWM interrupt flag accumulator function Disabled. - * | | |1 = PWM interrupt flag accumulator function Enabled. - * @var TIMER_T::PWMAINTSTS - * Offset: 0xAC Timer PWM Accumulator Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIF |PWM Interrupt Flag Accumulator Interrupt Flag - * | | |This bit is set by hardware when the accumulator value reaches (IFACNT+1). - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2: If APDMAEN (TIMERx_PWMAPDMACTL[0]) is set, this bit will be auto clear after PDMA transfer done. - * @var TIMER_T::PWMAINTEN - * Offset: 0xB0 Timer PWM Accumulator Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIEN |PWM Interrupt Flag Accumulator Interrupt Enable Bit - * | | |0 = Interrupt Flag Accumulator interrupt Disabled. - * | | |1 = Interrupt Flag Accumulator interrupt Enabled. - * @var TIMER_T::PWMAPDMACTL - * Offset: 0xB4 Timer PWM Accumulator PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APDMAEN |PWM Accumulator PDMA Enable Bit - * | | |0 = PWM interrupt accumulator event to trigger PDMA transfer Disabled. - * | | |1 = PWM interrupt accumulator event to trigger PDMA transfer Enabled. - * @var TIMER_T::PWMEXTETCTL - * Offset: 0xB8 Timer PWM External Event Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EXTETEN |External Pin Event Trigger Enable Bit - * | | |0 = External pin event trigger function Disabled. - * | | |1 = External pin event trigger function Enabled. - * |[5:4] |CNTACTS |Counter Action Selection - * | | |00 = External pin event to trigger PWM counter reset. - * | | |01 = External pin event to trigger PWM counter start. - * | | |10 = External pin event to trigger PWM counter reset and start. - * | | |11 = Reserved. - * |[11:8] |EXTTRGS |External Trigger Pin Selection - * | | |0000 = Trigger source form INT0 pin. - * | | |0001 = Trigger source form INT1 pin. - * | | |0010 = Trigger source form INT2 pin. - * | | |0011 = Trigger source form INT3 pin. - * | | |0100 = Trigger source form INT4 pin. - * | | |0101 = Trigger source form INT5 pin. - * | | |0110 = Trigger source form INT6 pin. - * | | |0111 = Trigger source form INT7 pin. - * | | |Other = Reserved. - */ - __IO uint32_t CTL; /*!< [0x0000] Timer Control Register */ - __IO uint32_t CMP; /*!< [0x0004] Timer Comparator Register */ - __IO uint32_t INTSTS; /*!< [0x0008] Timer Interrupt Status Register */ - __IO uint32_t CNT; /*!< [0x000c] Timer Data Register */ - __I uint32_t CAP; /*!< [0x0010] Timer Capture Data Register */ - __IO uint32_t EXTCTL; /*!< [0x0014] Timer External Control Register */ - __IO uint32_t EINTSTS; /*!< [0x0018] Timer External Interrupt Status Register */ - __IO uint32_t TRGCTL; /*!< [0x001c] Timer Trigger Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0020] Timer Alternative Control Register */ - __IO uint32_t CAPNF; /*!< [0x0024] Timer Capture Input Noise Filter Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[6]; - /** @endcond */ - __IO uint32_t PWMCTL; /*!< [0x0040] Timer PWM Control Register */ - __IO uint32_t PWMCLKSRC; /*!< [0x0044] Timer PWM Counter Clock Source Register */ - __IO uint32_t PWMCLKPSC; /*!< [0x0048] Timer PWM Counter Clock Pre-scale Register */ - __IO uint32_t PWMCNTCLR; /*!< [0x004c] Timer PWM Clear Counter Register */ - __IO uint32_t PWMPERIOD; /*!< [0x0050] Timer PWM Period Register */ - __IO uint32_t PWMCMPDAT; /*!< [0x0054] Timer PWM Comparator Register */ - __IO uint32_t PWMDTCTL; /*!< [0x0058] Timer PWM Dead-Time Control Register */ - __I uint32_t PWMCNT; /*!< [0x005c] Timer PWM Counter Register */ - __IO uint32_t PWMMSKEN; /*!< [0x0060] Timer PWM Output Mask Enable Register */ - __IO uint32_t PWMMSK; /*!< [0x0064] Timer PWM Output Mask Data Control Register */ - __IO uint32_t PWMBNF; /*!< [0x0068] Timer PWM Brake Pin Noise Filter Register */ - __IO uint32_t PWMFAILBRK; /*!< [0x006c] Timer PWM System Fail Brake Control Register */ - __IO uint32_t PWMBRKCTL; /*!< [0x0070] Timer PWM Brake Control Register */ - __IO uint32_t PWMPOLCTL; /*!< [0x0074] Timer PWM Pin Output Polar Control Register */ - __IO uint32_t PWMPOEN; /*!< [0x0078] Timer PWM Pin Output Enable Register */ - __O uint32_t PWMSWBRK; /*!< [0x007c] Timer PWM Software Trigger Brake Control Register */ - __IO uint32_t PWMINTEN0; /*!< [0x0080] Timer PWM Interrupt Enable Register 0 */ - __IO uint32_t PWMINTEN1; /*!< [0x0084] Timer PWM Interrupt Enable Register 1 */ - __IO uint32_t PWMINTSTS0; /*!< [0x0088] Timer PWM Interrupt Status Register 0 */ - __IO uint32_t PWMINTSTS1; /*!< [0x008c] Timer PWM Interrupt Status Register 1 */ - __IO uint32_t PWMTRGCTL; /*!< [0x0090] Timer PWM Trigger Control Register */ - __IO uint32_t PWMSCTL; /*!< [0x0094] Timer PWM Synchronous Control Register */ - __O uint32_t PWMSTRG; /*!< [0x0098] Timer PWM Synchronous Trigger Register */ - __IO uint32_t PWMSTATUS; /*!< [0x009c] Timer PWM Status Register */ - __I uint32_t PWMPBUF; /*!< [0x00a0] Timer PWM Period Buffer Register */ - __I uint32_t PWMCMPBUF; /*!< [0x00a4] Timer PWM Comparator Buffer Register */ - __IO uint32_t PWMIFA; /*!< [0x00a8] Timer PWM Interrupt Flag Accumulator Register */ - __IO uint32_t PWMAINTSTS; /*!< [0x00ac] Timer PWM Accumulator Interrupt Flag Register */ - __IO uint32_t PWMAINTEN; /*!< [0x00b0] Timer PWM Accumulator Interrupt Enable Register */ - __IO uint32_t PWMAPDMACTL; /*!< [0x00b4] Timer PWM Accumulator PDMA Control Register */ - __IO uint32_t PWMEXTETCTL; /*!< [0x00b8] Timer PWM External Event Trigger Control Register */ - -} TIMER_T; - -/** - @addtogroup TIMER_CONST TIMER Bit Field Definition - Constant Definitions for TIMER Controller -@{ */ - -#define TIMER_CTL_PSC_Pos (0) /*!< TIMER_T::CTL: PSC Position */ -#define TIMER_CTL_PSC_Msk (0xfful << TIMER_CTL_PSC_Pos) /*!< TIMER_T::CTL: PSC Mask */ - -#define TIMER_CTL_INTRGEN_Pos (19) /*!< TIMER_T::CTL: INTRGEN Position */ -#define TIMER_CTL_INTRGEN_Msk (0x1ul << TIMER_CTL_INTRGEN_Pos) /*!< TIMER_T::CTL: INTRGEN Mask */ - -#define TIMER_CTL_PERIOSEL_Pos (20) /*!< TIMER_T::CTL: PERIOSEL Position */ -#define TIMER_CTL_PERIOSEL_Msk (0x1ul << TIMER_CTL_PERIOSEL_Pos) /*!< TIMER_T::CTL: PERIOSEL Mask */ - -#define TIMER_CTL_TGLPINSEL_Pos (21) /*!< TIMER_T::CTL: TGLPINSEL Position */ -#define TIMER_CTL_TGLPINSEL_Msk (0x1ul << TIMER_CTL_TGLPINSEL_Pos) /*!< TIMER_T::CTL: TGLPINSEL Mask */ - -#define TIMER_CTL_CAPSRC_Pos (22) /*!< TIMER_T::CTL: CAPSRC Position */ -#define TIMER_CTL_CAPSRC_Msk (0x1ul << TIMER_CTL_CAPSRC_Pos) /*!< TIMER_T::CTL: CAPSRC Mask */ - -#define TIMER_CTL_WKEN_Pos (23) /*!< TIMER_T::CTL: WKEN Position */ -#define TIMER_CTL_WKEN_Msk (0x1ul << TIMER_CTL_WKEN_Pos) /*!< TIMER_T::CTL: WKEN Mask */ - -#define TIMER_CTL_EXTCNTEN_Pos (24) /*!< TIMER_T::CTL: EXTCNTEN Position */ -#define TIMER_CTL_EXTCNTEN_Msk (0x1ul << TIMER_CTL_EXTCNTEN_Pos) /*!< TIMER_T::CTL: EXTCNTEN Mask */ - -#define TIMER_CTL_ACTSTS_Pos (25) /*!< TIMER_T::CTL: ACTSTS Position */ -#define TIMER_CTL_ACTSTS_Msk (0x1ul << TIMER_CTL_ACTSTS_Pos) /*!< TIMER_T::CTL: ACTSTS Mask */ - -#define TIMER_CTL_OPMODE_Pos (27) /*!< TIMER_T::CTL: OPMODE Position */ -#define TIMER_CTL_OPMODE_Msk (0x3ul << TIMER_CTL_OPMODE_Pos) /*!< TIMER_T::CTL: OPMODE Mask */ - -#define TIMER_CTL_INTEN_Pos (29) /*!< TIMER_T::CTL: INTEN Position */ -#define TIMER_CTL_INTEN_Msk (0x1ul << TIMER_CTL_INTEN_Pos) /*!< TIMER_T::CTL: INTEN Mask */ - -#define TIMER_CTL_CNTEN_Pos (30) /*!< TIMER_T::CTL: CNTEN Position */ -#define TIMER_CTL_CNTEN_Msk (0x1ul << TIMER_CTL_CNTEN_Pos) /*!< TIMER_T::CTL: CNTEN Mask */ - -#define TIMER_CTL_ICEDEBUG_Pos (31) /*!< TIMER_T::CTL: ICEDEBUG Position */ -#define TIMER_CTL_ICEDEBUG_Msk (0x1ul << TIMER_CTL_ICEDEBUG_Pos) /*!< TIMER_T::CTL: ICEDEBUG Mask */ - -#define TIMER_CMP_CMPDAT_Pos (0) /*!< TIMER_T::CMP: CMPDAT Position */ -#define TIMER_CMP_CMPDAT_Msk (0xfffffful << TIMER_CMP_CMPDAT_Pos) /*!< TIMER_T::CMP: CMPDAT Mask */ - -#define TIMER_INTSTS_TIF_Pos (0) /*!< TIMER_T::INTSTS: TIF Position */ -#define TIMER_INTSTS_TIF_Msk (0x1ul << TIMER_INTSTS_TIF_Pos) /*!< TIMER_T::INTSTS: TIF Mask */ - -#define TIMER_INTSTS_TWKF_Pos (1) /*!< TIMER_T::INTSTS: TWKF Position */ -#define TIMER_INTSTS_TWKF_Msk (0x1ul << TIMER_INTSTS_TWKF_Pos) /*!< TIMER_T::INTSTS: TWKF Mask */ - -#define TIMER_CNT_CNT_Pos (0) /*!< TIMER_T::CNT: CNT Position */ -#define TIMER_CNT_CNT_Msk (0xfffffful << TIMER_CNT_CNT_Pos) /*!< TIMER_T::CNT: CNT Mask */ - -#define TIMER_CNT_RSTACT_Pos (31) /*!< TIMER_T::CNT: RSTACT Position */ -#define TIMER_CNT_RSTACT_Msk (0x1ul << TIMER_CNT_RSTACT_Pos) /*!< TIMER_T::CNT: RSTACT Mask */ - -#define TIMER_CAP_CAPDAT_Pos (0) /*!< TIMER_T::CAP: CAPDAT Position */ -#define TIMER_CAP_CAPDAT_Msk (0xfffffful << TIMER_CAP_CAPDAT_Pos) /*!< TIMER_T::CAP: CAPDAT Mask */ - -#define TIMER_EXTCTL_CNTPHASE_Pos (0) /*!< TIMER_T::EXTCTL: CNTPHASE Position */ -#define TIMER_EXTCTL_CNTPHASE_Msk (0x1ul << TIMER_EXTCTL_CNTPHASE_Pos) /*!< TIMER_T::EXTCTL: CNTPHASE Mask */ - -#define TIMER_EXTCTL_CAPEN_Pos (3) /*!< TIMER_T::EXTCTL: CAPEN Position */ -#define TIMER_EXTCTL_CAPEN_Msk (0x1ul << TIMER_EXTCTL_CAPEN_Pos) /*!< TIMER_T::EXTCTL: CAPEN Mask */ - -#define TIMER_EXTCTL_CAPFUNCS_Pos (4) /*!< TIMER_T::EXTCTL: CAPFUNCS Position */ -#define TIMER_EXTCTL_CAPFUNCS_Msk (0x1ul << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< TIMER_T::EXTCTL: CAPFUNCS Mask */ - -#define TIMER_EXTCTL_CAPIEN_Pos (5) /*!< TIMER_T::EXTCTL: CAPIEN Position */ -#define TIMER_EXTCTL_CAPIEN_Msk (0x1ul << TIMER_EXTCTL_CAPIEN_Pos) /*!< TIMER_T::EXTCTL: CAPIEN Mask */ - -#define TIMER_EXTCTL_CAPDBEN_Pos (6) /*!< TIMER_T::EXTCTL: CAPDBEN Position */ -#define TIMER_EXTCTL_CAPDBEN_Msk (0x1ul << TIMER_EXTCTL_CAPDBEN_Pos) /*!< TIMER_T::EXTCTL: CAPDBEN Mask */ - -#define TIMER_EXTCTL_CNTDBEN_Pos (7) /*!< TIMER_T::EXTCTL: CNTDBEN Position */ -#define TIMER_EXTCTL_CNTDBEN_Msk (0x1ul << TIMER_EXTCTL_CNTDBEN_Pos) /*!< TIMER_T::EXTCTL: CNTDBEN Mask */ - -#define TIMER_EXTCTL_ICAPSEL_Pos (8) /*!< TIMER_T::EXTCTL: ICAPSEL Position */ -#define TIMER_EXTCTL_ICAPSEL_Msk (0x7ul << TIMER_EXTCTL_ICAPSEL_Pos) /*!< TIMER_T::EXTCTL: ICAPSEL Mask */ - -#define TIMER_EXTCTL_CAPEDGE_Pos (12) /*!< TIMER_T::EXTCTL: CAPEDGE Position */ -#define TIMER_EXTCTL_CAPEDGE_Msk (0x7ul << TIMER_EXTCTL_CAPEDGE_Pos) /*!< TIMER_T::EXTCTL: CAPEDGE Mask */ - -#define TIMER_EXTCTL_ECNTSSEL_Pos (16) /*!< TIMER_T::EXTCTL: ECNTSSEL Position */ -#define TIMER_EXTCTL_ECNTSSEL_Msk (0x3ul << TIMER_EXTCTL_ECNTSSEL_Pos) /*!< TIMER_T::EXTCTL: ECNTSSEL Mask */ - -#define TIMER_EXTCTL_CAPDIVSCL_Pos (28) /*!< TIMER_T::EXTCTL: CAPDIVSCL Position */ -#define TIMER_EXTCTL_CAPDIVSCL_Msk (0xful << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< TIMER_T::EXTCTL: CAPDIVSCL Mask */ - -#define TIMER_EINTSTS_CAPIF_Pos (0) /*!< TIMER_T::EINTSTS: CAPIF Position */ -#define TIMER_EINTSTS_CAPIF_Msk (0x1ul << TIMER_EINTSTS_CAPIF_Pos) /*!< TIMER_T::EINTSTS: CAPIF Mask */ - -#define TIMER_EINTSTS_CAPIFOV_Pos (1) /*!< TIMER_T::EINTSTS: CAPIFOV Position */ -#define TIMER_EINTSTS_CAPIFOV_Msk (0x1ul << TIMER_EINTSTS_CAPIFOV_Pos) /*!< TIMER_T::EINTSTS: CAPIFOV Mask */ - -#define TIMER_TRGCTL_TRGSSEL_Pos (0) /*!< TIMER_T::TRGCTL: TRGSSEL Position */ -#define TIMER_TRGCTL_TRGSSEL_Msk (0x1ul << TIMER_TRGCTL_TRGSSEL_Pos) /*!< TIMER_T::TRGCTL: TRGSSEL Mask */ - -#define TIMER_TRGCTL_TRGPWM_Pos (1) /*!< TIMER_T::TRGCTL: TRGPWM Position */ -#define TIMER_TRGCTL_TRGPWM_Msk (0x1ul << TIMER_TRGCTL_TRGPWM_Pos) /*!< TIMER_T::TRGCTL: TRGPWM Mask */ - -#define TIMER_TRGCTL_TRGEADC_Pos (2) /*!< TIMER_T::TRGCTL: TRGEADC Position */ -#define TIMER_TRGCTL_TRGEADC_Msk (0x1ul << TIMER_TRGCTL_TRGEADC_Pos) /*!< TIMER_T::TRGCTL: TRGEADC Mask */ - -#define TIMER_TRGCTL_TRGDAC_Pos (3) /*!< TIMER_T::TRGCTL: TRGDAC Position */ -#define TIMER_TRGCTL_TRGDAC_Msk (0x1ul << TIMER_TRGCTL_TRGDAC_Pos) /*!< TIMER_T::TRGCTL: TRGDAC Mask */ - -#define TIMER_TRGCTL_TRGPDMA_Pos (4) /*!< TIMER_T::TRGCTL: TRGPDMA Position */ -#define TIMER_TRGCTL_TRGPDMA_Msk (0x1ul << TIMER_TRGCTL_TRGPDMA_Pos) /*!< TIMER_T::TRGCTL: TRGPDMA Mask */ - -#define TIMER_ALTCTL_FUNCSEL_Pos (0) /*!< TIMER_T::ALTCTL: FUNCSEL Position */ -#define TIMER_ALTCTL_FUNCSEL_Msk (0x1ul << TIMER_ALTCTL_FUNCSEL_Pos) /*!< TIMER_T::ALTCTL: FUNCSEL Mask */ - -#define TIMER_CAPNF_CAPNFEN_Pos (0) /*!< TIMER_T::CAPNF: CAPNFEN Position */ -#define TIMER_CAPNF_CAPNFEN_Msk (0x1ul << TIMER_CAPNF_CAPNFEN_Pos) /*!< TIMER_T::CAPNF: CAPNFEN Mask */ - -#define TIMER_CAPNF_CAPNFSEL_Pos (4) /*!< TIMER_T::CAPNF: CAPNFSEL Position */ -#define TIMER_CAPNF_CAPNFSEL_Msk (0x7ul << TIMER_CAPNF_CAPNFSEL_Pos) /*!< TIMER_T::CAPNF: CAPNFSEL Mask */ - -#define TIMER_CAPNF_CAPNFCNT_Pos (8) /*!< TIMER_T::CAPNF: CAPNFCNT Position */ -#define TIMER_CAPNF_CAPNFCNT_Msk (0x7ul << TIMER_CAPNF_CAPNFCNT_Pos) /*!< TIMER_T::CAPNF: CAPNFCNT Mask */ - -#define TIMER_PWMCTL_CNTEN_Pos (0) /*!< TIMER_T::PWMCTL: CNTEN Position */ -#define TIMER_PWMCTL_CNTEN_Msk (0x1ul << TIMER_PWMCTL_CNTEN_Pos) /*!< TIMER_T::PWMCTL: CNTEN Mask */ - -#define TIMER_PWMCTL_CNTTYPE_Pos (1) /*!< TIMER_T::PWMCTL: CNTTYPE Position */ -#define TIMER_PWMCTL_CNTTYPE_Msk (0x3ul << TIMER_PWMCTL_CNTTYPE_Pos) /*!< TIMER_T::PWMCTL: CNTTYPE Mask */ - -#define TIMER_PWMCTL_CNTMODE_Pos (3) /*!< TIMER_T::PWMCTL: CNTMODE Position */ -#define TIMER_PWMCTL_CNTMODE_Msk (0x1ul << TIMER_PWMCTL_CNTMODE_Pos) /*!< TIMER_T::PWMCTL: CNTMODE Mask */ - -#define TIMER_PWMCTL_CTRLD_Pos (8) /*!< TIMER_T::PWMCTL: CTRLD Position */ -#define TIMER_PWMCTL_CTRLD_Msk (0x1ul << TIMER_PWMCTL_CTRLD_Pos) /*!< TIMER_T::PWMCTL: CTRLD Mask */ - -#define TIMER_PWMCTL_IMMLDEN_Pos (9) /*!< TIMER_T::PWMCTL: IMMLDEN Position */ -#define TIMER_PWMCTL_IMMLDEN_Msk (0x1ul << TIMER_PWMCTL_IMMLDEN_Pos) /*!< TIMER_T::PWMCTL: IMMLDEN Mask */ - -#define TIMER_PWMCTL_OUTMODE_Pos (16) /*!< TIMER_T::PWMCTL: OUTMODE Position */ -#define TIMER_PWMCTL_OUTMODE_Msk (0x1ul << TIMER_PWMCTL_OUTMODE_Pos) /*!< TIMER_T::PWMCTL: OUTMODE Mask */ - -#define TIMER_PWMCTL_DBGHALT_Pos (30) /*!< TIMER_T::PWMCTL: DBGHALT Position */ -#define TIMER_PWMCTL_DBGHALT_Msk (0x1ul << TIMER_PWMCTL_DBGHALT_Pos) /*!< TIMER_T::PWMCTL: DBGHALT Mask */ - -#define TIMER_PWMCTL_DBGTRIOFF_Pos (31) /*!< TIMER_T::PWMCTL: DBGTRIOFF Position */ -#define TIMER_PWMCTL_DBGTRIOFF_Msk (0x1ul << TIMER_PWMCTL_DBGTRIOFF_Pos) /*!< TIMER_T::PWMCTL: DBGTRIOFF Mask */ - -#define TIMER_PWMCLKSRC_CLKSRC_Pos (0) /*!< TIMER_T::PWMCLKSRC: CLKSRC Position */ -#define TIMER_PWMCLKSRC_CLKSRC_Msk (0x7ul << TIMER_PWMCLKSRC_CLKSRC_Pos) /*!< TIMER_T::PWMCLKSRC: CLKSRC Mask */ - -#define TIMER_PWMCLKPSC_CLKPSC_Pos (0) /*!< TIMER_T::PWMCLKPSC: CLKPSC Position */ -#define TIMER_PWMCLKPSC_CLKPSC_Msk (0xffful << TIMER_PWMCLKPSC_CLKPSC_Pos) /*!< TIMER_T::PWMCLKPSC: CLKPSC Mask */ - -#define TIMER_PWMCNTCLR_CNTCLR_Pos (0) /*!< TIMER_T::PWMCNTCLR: CNTCLR Position */ -#define TIMER_PWMCNTCLR_CNTCLR_Msk (0x1ul << TIMER_PWMCNTCLR_CNTCLR_Pos) /*!< TIMER_T::PWMCNTCLR: CNTCLR Mask */ - -#define TIMER_PWMPERIOD_PERIOD_Pos (0) /*!< TIMER_T::PWMPERIOD: PERIOD Position */ -#define TIMER_PWMPERIOD_PERIOD_Msk (0xfffful << TIMER_PWMPERIOD_PERIOD_Pos) /*!< TIMER_T::PWMPERIOD: PERIOD Mask */ - -#define TIMER_PWMCMPDAT_CMP_Pos (0) /*!< TIMER_T::PWMCMPDAT: CMP Position */ -#define TIMER_PWMCMPDAT_CMP_Msk (0xfffful << TIMER_PWMCMPDAT_CMP_Pos) /*!< TIMER_T::PWMCMPDAT: CMP Mask */ - -#define TIMER_PWMDTCTL_DTCNT_Pos (0) /*!< TIMER_T::PWMDTCTL: DTCNT Position */ -#define TIMER_PWMDTCTL_DTCNT_Msk (0xffful << TIMER_PWMDTCTL_DTCNT_Pos) /*!< TIMER_T::PWMDTCTL: DTCNT Mask */ - -#define TIMER_PWMDTCTL_DTEN_Pos (16) /*!< TIMER_T::PWMDTCTL: DTEN Position */ -#define TIMER_PWMDTCTL_DTEN_Msk (0x1ul << TIMER_PWMDTCTL_DTEN_Pos) /*!< TIMER_T::PWMDTCTL: DTEN Mask */ - -#define TIMER_PWMDTCTL_DTCKSEL_Pos (24) /*!< TIMER_T::PWMDTCTL: DTCKSEL Position */ -#define TIMER_PWMDTCTL_DTCKSEL_Msk (0x1ul << TIMER_PWMDTCTL_DTCKSEL_Pos) /*!< TIMER_T::PWMDTCTL: DTCKSEL Mask */ - -#define TIMER_PWMCNT_CNT_Pos (0) /*!< TIMER_T::PWMCNT: CNT Position */ -#define TIMER_PWMCNT_CNT_Msk (0xfffful << TIMER_PWMCNT_CNT_Pos) /*!< TIMER_T::PWMCNT: CNT Mask */ - -#define TIMER_PWMCNT_DIRF_Pos (16) /*!< TIMER_T::PWMCNT: DIRF Position */ -#define TIMER_PWMCNT_DIRF_Msk (0x1ul << TIMER_PWMCNT_DIRF_Pos) /*!< TIMER_T::PWMCNT: DIRF Mask */ - -#define TIMER_PWMMSKEN_MSKEN0_Pos (0) /*!< TIMER_T::PWMMSKEN: MSKEN0 Position */ -#define TIMER_PWMMSKEN_MSKEN0_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN0_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN0 Mask */ - -#define TIMER_PWMMSKEN_MSKEN1_Pos (1) /*!< TIMER_T::PWMMSKEN: MSKEN1 Position */ -#define TIMER_PWMMSKEN_MSKEN1_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN1_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN1 Mask */ - -#define TIMER_PWMMSK_MSKDAT0_Pos (0) /*!< TIMER_T::PWMMSK: MSKDAT0 Position */ -#define TIMER_PWMMSK_MSKDAT0_Msk (0x1ul << TIMER_PWMMSK_MSKDAT0_Pos) /*!< TIMER_T::PWMMSK: MSKDAT0 Mask */ - -#define TIMER_PWMMSK_MSKDAT1_Pos (1) /*!< TIMER_T::PWMMSK: MSKDAT1 Position */ -#define TIMER_PWMMSK_MSKDAT1_Msk (0x1ul << TIMER_PWMMSK_MSKDAT1_Pos) /*!< TIMER_T::PWMMSK: MSKDAT1 Mask */ - -#define TIMER_PWMBNF_BRKNFEN_Pos (0) /*!< TIMER_T::PWMBNF: BRKNFEN Position */ -#define TIMER_PWMBNF_BRKNFEN_Msk (0x1ul << TIMER_PWMBNF_BRKNFEN_Pos) /*!< TIMER_T::PWMBNF: BRKNFEN Mask */ - -#define TIMER_PWMBNF_BRKNFSEL_Pos (1) /*!< TIMER_T::PWMBNF: BRKNFSEL Position */ -#define TIMER_PWMBNF_BRKNFSEL_Msk (0x7ul << TIMER_PWMBNF_BRKNFSEL_Pos) /*!< TIMER_T::PWMBNF: BRKNFSEL Mask */ - -#define TIMER_PWMBNF_BRKFCNT_Pos (4) /*!< TIMER_T::PWMBNF: BRKFCNT Position */ -#define TIMER_PWMBNF_BRKFCNT_Msk (0x7ul << TIMER_PWMBNF_BRKFCNT_Pos) /*!< TIMER_T::PWMBNF: BRKFCNT Mask */ - -#define TIMER_PWMBNF_BRKPINV_Pos (7) /*!< TIMER_T::PWMBNF: BRKPINV Position */ -#define TIMER_PWMBNF_BRKPINV_Msk (0x1ul << TIMER_PWMBNF_BRKPINV_Pos) /*!< TIMER_T::PWMBNF: BRKPINV Mask */ - -#define TIMER_PWMBNF_BKPINSRC_Pos (16) /*!< TIMER_T::PWMBNF: BKPINSRC Position */ -#define TIMER_PWMBNF_BKPINSRC_Msk (0x3ul << TIMER_PWMBNF_BKPINSRC_Pos) /*!< TIMER_T::PWMBNF: BKPINSRC Mask */ - -#define TIMER_PWMFAILBRK_CSSBRKEN_Pos (0) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Position */ -#define TIMER_PWMFAILBRK_CSSBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CSSBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Mask */ - -#define TIMER_PWMFAILBRK_BODBRKEN_Pos (1) /*!< TIMER_T::PWMFAILBRK: BODBRKEN Position */ -#define TIMER_PWMFAILBRK_BODBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_BODBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: BODBRKEN Mask */ - -#define TIMER_PWMFAILBRK_RAMBRKEN_Pos (2) /*!< TIMER_T::PWMFAILBRK: RAMBRKEN Position */ -#define TIMER_PWMFAILBRK_RAMBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_RAMBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: RAMBRKEN Mask */ - -#define TIMER_PWMFAILBRK_CORBRKEN_Pos (3) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Position */ -#define TIMER_PWMFAILBRK_CORBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CORBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Mask */ - -#define TIMER_PWMBRKCTL_CPO0EBEN_Pos (0) /*!< TIMER_T::PWMBRKCTL: CPO0EBEN Position */ -#define TIMER_PWMBRKCTL_CPO0EBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO0EBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO0EBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO1EBEN_Pos (1) /*!< TIMER_T::PWMBRKCTL: CPO1EBEN Position */ -#define TIMER_PWMBRKCTL_CPO1EBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO1EBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO1EBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPEEN_Pos (4) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Position */ -#define TIMER_PWMBRKCTL_BRKPEEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPEEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Mask */ - -#define TIMER_PWMBRKCTL_SYSEBEN_Pos (7) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Position */ -#define TIMER_PWMBRKCTL_SYSEBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSEBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO0LBEN_Pos (8) /*!< TIMER_T::PWMBRKCTL: CPO0LBEN Position */ -#define TIMER_PWMBRKCTL_CPO0LBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO0LBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO0LBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO1LBEN_Pos (9) /*!< TIMER_T::PWMBRKCTL: CPO1LBEN Position */ -#define TIMER_PWMBRKCTL_CPO1LBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO1LBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO1LBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPLEN_Pos (12) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Position */ -#define TIMER_PWMBRKCTL_BRKPLEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPLEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Mask */ - -#define TIMER_PWMBRKCTL_SYSLBEN_Pos (15) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Position */ -#define TIMER_PWMBRKCTL_SYSLBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSLBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAEVEN_Pos (16) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Position */ -#define TIMER_PWMBRKCTL_BRKAEVEN_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAEVEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAODD_Pos (18) /*!< TIMER_T::PWMBRKCTL: BRKAODD Position */ -#define TIMER_PWMBRKCTL_BRKAODD_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAODD_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAODD Mask */ - -#define TIMER_PWMPOLCTL_PINV0_Pos (0) /*!< TIMER_T::PWMPOLCTL: PINV0 Position */ -#define TIMER_PWMPOLCTL_PINV0_Msk (0x1ul << TIMER_PWMPOLCTL_PINV0_Pos) /*!< TIMER_T::PWMPOLCTL: PINV0 Mask */ - -#define TIMER_PWMPOLCTL_PINV1_Pos (1) /*!< TIMER_T::PWMPOLCTL: PINV1 Position */ -#define TIMER_PWMPOLCTL_PINV1_Msk (0x1ul << TIMER_PWMPOLCTL_PINV1_Pos) /*!< TIMER_T::PWMPOLCTL: PINV1 Mask */ - -#define TIMER_PWMPOEN_POEN0_Pos (0) /*!< TIMER_T::PWMPOEN: POEN0 Position */ -#define TIMER_PWMPOEN_POEN0_Msk (0x1ul << TIMER_PWMPOEN_POEN0_Pos) /*!< TIMER_T::PWMPOEN: POEN0 Mask */ - -#define TIMER_PWMPOEN_POEN1_Pos (1) /*!< TIMER_T::PWMPOEN: POEN1 Position */ -#define TIMER_PWMPOEN_POEN1_Msk (0x1ul << TIMER_PWMPOEN_POEN1_Pos) /*!< TIMER_T::PWMPOEN: POEN1 Mask */ - -#define TIMER_PWMSWBRK_BRKETRG_Pos (0) /*!< TIMER_T::PWMSWBRK: BRKETRG Position */ -#define TIMER_PWMSWBRK_BRKETRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKETRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKETRG Mask */ - -#define TIMER_PWMSWBRK_BRKLTRG_Pos (8) /*!< TIMER_T::PWMSWBRK: BRKLTRG Position */ -#define TIMER_PWMSWBRK_BRKLTRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKLTRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKLTRG Mask */ - -#define TIMER_PWMINTEN0_ZIEN_Pos (0) /*!< TIMER_T::PWMINTEN0: ZIEN Position */ -#define TIMER_PWMINTEN0_ZIEN_Msk (0x1ul << TIMER_PWMINTEN0_ZIEN_Pos) /*!< TIMER_T::PWMINTEN0: ZIEN Mask */ - -#define TIMER_PWMINTEN0_PIEN_Pos (1) /*!< TIMER_T::PWMINTEN0: PIEN Position */ -#define TIMER_PWMINTEN0_PIEN_Msk (0x1ul << TIMER_PWMINTEN0_PIEN_Pos) /*!< TIMER_T::PWMINTEN0: PIEN Mask */ - -#define TIMER_PWMINTEN0_CMPUIEN_Pos (2) /*!< TIMER_T::PWMINTEN0: CMPUIEN Position */ -#define TIMER_PWMINTEN0_CMPUIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPUIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPUIEN Mask */ - -#define TIMER_PWMINTEN0_CMPDIEN_Pos (3) /*!< TIMER_T::PWMINTEN0: CMPDIEN Position */ -#define TIMER_PWMINTEN0_CMPDIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPDIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPDIEN Mask */ - -#define TIMER_PWMINTEN1_BRKEIEN_Pos (0) /*!< TIMER_T::PWMINTEN1: BRKEIEN Position */ -#define TIMER_PWMINTEN1_BRKEIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKEIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKEIEN Mask */ - -#define TIMER_PWMINTEN1_BRKLIEN_Pos (8) /*!< TIMER_T::PWMINTEN1: BRKLIEN Position */ -#define TIMER_PWMINTEN1_BRKLIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKLIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKLIEN Mask */ - -#define TIMER_PWMINTSTS0_ZIF_Pos (0) /*!< TIMER_T::PWMINTSTS0: ZIF Position */ -#define TIMER_PWMINTSTS0_ZIF_Msk (0x1ul << TIMER_PWMINTSTS0_ZIF_Pos) /*!< TIMER_T::PWMINTSTS0: ZIF Mask */ - -#define TIMER_PWMINTSTS0_PIF_Pos (1) /*!< TIMER_T::PWMINTSTS0: PIF Position */ -#define TIMER_PWMINTSTS0_PIF_Msk (0x1ul << TIMER_PWMINTSTS0_PIF_Pos) /*!< TIMER_T::PWMINTSTS0: PIF Mask */ - -#define TIMER_PWMINTSTS0_CMPUIF_Pos (2) /*!< TIMER_T::PWMINTSTS0: CMPUIF Position */ -#define TIMER_PWMINTSTS0_CMPUIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPUIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPUIF Mask */ - -#define TIMER_PWMINTSTS0_CMPDIF_Pos (3) /*!< TIMER_T::PWMINTSTS0: CMPDIF Position */ -#define TIMER_PWMINTSTS0_CMPDIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPDIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPDIF Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF0_Pos (0) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Position */ -#define TIMER_PWMINTSTS1_BRKEIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF1_Pos (1) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Position */ -#define TIMER_PWMINTSTS1_BRKEIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF0_Pos (8) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Position */ -#define TIMER_PWMINTSTS1_BRKLIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF1_Pos (9) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Position */ -#define TIMER_PWMINTSTS1_BRKLIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS0_Pos (16) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Position */ -#define TIMER_PWMINTSTS1_BRKESTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS1_Pos (17) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Position */ -#define TIMER_PWMINTSTS1_BRKESTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS0_Pos (24) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS1_Pos (25) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Mask */ - -#define TIMER_PWMTRGCTL_TRGSEL_Pos (0) /*!< TIMER_T::PWMTRGCTL: TRGSEL Position */ -#define TIMER_PWMTRGCTL_TRGSEL_Msk (0x7ul << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< TIMER_T::PWMTRGCTL: TRGSEL Mask */ - -#define TIMER_PWMTRGCTL_TRGEADC_Pos (7) /*!< TIMER_T::PWMTRGCTL: TRGEADC Position */ -#define TIMER_PWMTRGCTL_TRGEADC_Msk (0x1ul << TIMER_PWMTRGCTL_TRGEADC_Pos) /*!< TIMER_T::PWMTRGCTL: TRGEADC Mask */ - -#define TIMER_PWMSCTL_SYNCMODE_Pos (0) /*!< TIMER_T::PWMSCTL: SYNCMODE Position */ -#define TIMER_PWMSCTL_SYNCMODE_Msk (0x3ul << TIMER_PWMSCTL_SYNCMODE_Pos) /*!< TIMER_T::PWMSCTL: SYNCMODE Mask */ - -#define TIMER_PWMSCTL_SYNCSRC_Pos (8) /*!< TIMER_T::PWMSCTL: SYNCSRC Position */ -#define TIMER_PWMSCTL_SYNCSRC_Msk (0x1ul << TIMER_PWMSCTL_SYNCSRC_Pos) /*!< TIMER_T::PWMSCTL: SYNCSRC Mask */ - -#define TIMER_PWMSTRG_STRGEN_Pos (0) /*!< TIMER_T::PWMSTRG: STRGEN Position */ -#define TIMER_PWMSTRG_STRGEN_Msk (0x1ul << TIMER_PWMSTRG_STRGEN_Pos) /*!< TIMER_T::PWMSTRG: STRGEN Mask */ - -#define TIMER_PWMSTATUS_CNTMAXF_Pos (0) /*!< TIMER_T::PWMSTATUS: CNTMAXF Position */ -#define TIMER_PWMSTATUS_CNTMAXF_Msk (0x1ul << TIMER_PWMSTATUS_CNTMAXF_Pos) /*!< TIMER_T::PWMSTATUS: CNTMAXF Mask */ - -#define TIMER_PWMSTATUS_EADCTRGF_Pos (16) /*!< TIMER_T::PWMSTATUS: EADCTRGF Position */ -#define TIMER_PWMSTATUS_EADCTRGF_Msk (0x1ul << TIMER_PWMSTATUS_EADCTRGF_Pos) /*!< TIMER_T::PWMSTATUS: EADCTRGF Mask */ - -#define TIMER_PWMPBUF_PBUF_Pos (0) /*!< TIMER_T::PWMPBUF: PBUF Position */ -#define TIMER_PWMPBUF_PBUF_Msk (0xfffful << TIMER_PWMPBUF_PBUF_Pos) /*!< TIMER_T::PWMPBUF: PBUF Mask */ - -#define TIMER_PWMCMPBUF_CMPBUF_Pos (0) /*!< TIMER_T::PWMCMPBUF: CMPBUF Position */ -#define TIMER_PWMCMPBUF_CMPBUF_Msk (0xfffful << TIMER_PWMCMPBUF_CMPBUF_Pos) /*!< TIMER_T::PWMCMPBUF: CMPBUF Mask */ - -#define TIMER_PWMIFA_IFACNT_Pos (0) /*!< TIMER_T::PWMIFA: IFACNT Position */ -#define TIMER_PWMIFA_IFACNT_Msk (0xfffful << TIMER_PWMIFA_IFACNT_Pos) /*!< TIMER_T::PWMIFA: IFACNT Mask */ - -#define TIMER_PWMIFA_STPMOD_Pos (24) /*!< TIMER_T::PWMIFA: STPMOD Position */ -#define TIMER_PWMIFA_STPMOD_Msk (0x1ul << TIMER_PWMIFA_STPMOD_Pos) /*!< TIMER_T::PWMIFA: STPMOD Mask */ - -#define TIMER_PWMIFA_IFASEL_Pos (28) /*!< TIMER_T::PWMIFA: IFASEL Position */ -#define TIMER_PWMIFA_IFASEL_Msk (0x3ul << TIMER_PWMIFA_IFASEL_Pos) /*!< TIMER_T::PWMIFA: IFASEL Mask */ - -#define TIMER_PWMIFA_IFAEN_Pos (31) /*!< TIMER_T::PWMIFA: IFAEN Position */ -#define TIMER_PWMIFA_IFAEN_Msk (0x1ul << TIMER_PWMIFA_IFAEN_Pos) /*!< TIMER_T::PWMIFA: IFAEN Mask */ - -#define TIMER_PWMAINTSTS_IFAIF_Pos (0) /*!< TIMER_T::PWMAINTSTS: IFAIF Position */ -#define TIMER_PWMAINTSTS_IFAIF_Msk (0x1ul << TIMER_PWMAINTSTS_IFAIF_Pos) /*!< TIMER_T::PWMAINTSTS: IFAIF Mask */ - -#define TIMER_PWMAINTEN_IFAIEN_Pos (0) /*!< TIMER_T::PWMAINTEN: IFAIEN Position */ -#define TIMER_PWMAINTEN_IFAIEN_Msk (0x1ul << TIMER_PWMAINTEN_IFAIEN_Pos) /*!< TIMER_T::PWMAINTEN: IFAIEN Mask */ - -#define TIMER_PWMAPDMACTL_APDMAEN_Pos (0) /*!< TIMER_T::PWMAPDMACTL: APDMAEN Position */ -#define TIMER_PWMAPDMACTL_APDMAEN_Msk (0x1ul << TIMER_PWMAPDMACTL_APDMAEN_Pos) /*!< TIMER_T::PWMAPDMACTL: APDMAEN Mask */ - -#define TIMER_PWMEXTETCTL_EXTETEN_Pos (0) /*!< TIMER_T::PWMEXTETCTL: EXTETEN Position */ -#define TIMER_PWMEXTETCTL_EXTETEN_Msk (0x1ul << TIMER_PWMEXTETCTL_EXTETEN_Pos) /*!< TIMER_T::PWMEXTETCTL: EXTETEN Mask */ - -#define TIMER_PWMEXTETCTL_CNTACTS_Pos (4) /*!< TIMER_T::PWMEXTETCTL: CNTACTS Position */ -#define TIMER_PWMEXTETCTL_CNTACTS_Msk (0x3ul << TIMER_PWMEXTETCTL_CNTACTS_Pos) /*!< TIMER_T::PWMEXTETCTL: CNTACTS Mask */ - -#define TIMER_PWMEXTETCTL_EXTTRGS_Pos (8) /*!< TIMER_T::PWMEXTETCTL: EXTTRGS Position */ -#define TIMER_PWMEXTETCTL_EXTTRGS_Msk (0xful << TIMER_PWMEXTETCTL_EXTTRGS_Pos) /*!< TIMER_T::PWMEXTETCTL: EXTTRGS Mask */ - - -/**@}*/ /* TIMER_CONST */ -/**@}*/ /* end of TIMER register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __TIMER_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/trng_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/trng_reg.h deleted file mode 100644 index 55f62346ff5..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/trng_reg.h +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************//** - * @file trng_reg.h - * @version V1.00 - * @brief TRNG register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TRNG_REG_H__ -#define __TRNG_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- True Random Number Generator -------------------------*/ -/** - @addtogroup TRNG True Random Number Generator(TRNG) - Memory Mapped Structure for TRNG Controller -@{ */ - -typedef struct -{ - - - /** - * @var TRNG_T::CTL - * Offset: 0x00 TRNG Control Register and Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRNGEN |Random Number Generator Enable Bit - * | | |This bit can be set to 1 only after ACT (TRNG_ACT[7]) bit was set to 1 and READY (TRNG_CTL[7]) bit became 1. - * | | |0 = TRNG disabled. - * | | |1 = TRNG enabled. - * | | |Note: TRNGEN is an enable bit of digital part - * | | |When TRNG is not required to generate random number, TRNGEN bit and ACT (TRNG_ACT[7]) bit should be set to 0 to reduce power consumption. - * |[1] |DVIF |Data Valid (Read Only) - * | | |0 = Data is not valid. Reading from RNGD returns 0x00000000. - * | | |1 = Data is valid. A valid random number can be read form RNGD. - * | | |This bit is cleared to u20180u2019 by read TRNG_DATA. - * |[5:2] |CLKP |Clock Prescaler - * | | |The CLKP is the peripheral clock frequency range for the selected value , the CLKP must higher than or equal to the actual peripheral clock frequency (for correct random bit generation) - * | | |To change the CLKP contents, first set TRNGEN bit to 0 and then change CLKP; finally, set TRNGEN bit to 1 to re-enable the TRNG module. - * | | |0000 = 80 ~ 100 MHz. - * | | |0001 = 60 ~ 80 MHz. - * | | |0010 = 50 ~60 MHz. - * | | |0011 = 40 ~50 MHz. - * | | |0100 = 30 ~40 MHz. - * | | |0101 = 25 ~30 MHz. - * | | |0110 = 20 ~25 MHz. - * | | |0111 = 15 ~20 MHz. - * | | |1000 = 12 ~15 MHz. - * | | |1001 = 9 ~12 MHz. - * | | |1010 = 7 ~9 MHz. - * | | |1011 = 6 ~7 MHz. - * | | |1100 = 5 ~6 MHz. - * | | |1101 = 4 ~5 MHz. - * | | |1111 = Reserved. - * |[6] |DVIEN |Data Valid Interrupt Enable Bit - * | | |0 = Interrupt disabled.. - * | | |1 = Interrupt enabled. - * |[7] |READY |Random Number Generator Ready (Read Only) - * | | |After ACT (TRNG_ACT[7]) bit is set, the READY bit become to 1 after a delay of 90us~120us. - * | | |0 = RNG is not ready or was not activated. - * | | |1 = RNG is ready to be enabled.. - * |[31:8] |Reversed |Reversed - * @var TRNG_T::DATA - * Offset: 0x04 TRNG Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DATA |Random Number Generator Data (Read Only) - * | | |The DATA store the random number generated by TRNG and can be read only once. - * @var TRNG_T::ACT - * Offset: 0x0C TRNG Activation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |VER |TRNG Version - * | | |TRNG version number is dependent on TRNG module. - * | | |0x02:(Current Version Number) - * |[7] |ACT |Random Number Generator Activation - * | | |After enable the ACT bit, it will active the TRNG module and wait the READY (TRNG_CTL[7]) bit to become 1. - * | | |0 = TRNG inactive. - * | | |1 = TRNG active. - * | | |Note: ACT is an enable bit of analog part - * | | |When TRNG is not required to generate random number, TRNGEN (TRNG_CTL[0]) bit and ACT bit should be set to 0 to reduce power consumption. - */ - __IO uint32_t CTL; /*!< [0x0000] TRNG Control Register and Status */ - __I uint32_t DATA; /*!< [0x0004] TRNG Data Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ACT; /*!< [0x000c] TRNG Activation Register */ - -} TRNG_T; - -/** - @addtogroup TRNG_CONST TRNG Bit Field Definition - Constant Definitions for TRNG Controller -@{ */ - -#define TRNG_CTL_TRNGEN_Pos (0) /*!< TRNG_T::CTL: TRNGEN Position */ -#define TRNG_CTL_TRNGEN_Msk (0x1ul << TRNG_CTL_TRNGEN_Pos) /*!< TRNG_T::CTL: TRNGEN Mask */ - -#define TRNG_CTL_DVIF_Pos (1) /*!< TRNG_T::CTL: DVIF Position */ -#define TRNG_CTL_DVIF_Msk (0x1ul << TRNG_CTL_DVIF_Pos) /*!< TRNG_T::CTL: DVIF Mask */ - -#define TRNG_CTL_CLKPSC_Pos (2) /*!< TRNG_T::CTL: CLKPSC Position */ -#define TRNG_CTL_CLKPSC_Msk (0xful << TRNG_CTL_CLKP_Pos) /*!< TRNG_T::CTL: CLKPSC Mask */ - -#define TRNG_CTL_DVIEN_Pos (6) /*!< TRNG_T::CTL: DVIEN Position */ -#define TRNG_CTL_DVIEN_Msk (0x1ul << TRNG_CTL_DVIEN_Pos) /*!< TRNG_T::CTL: DVIEN Mask */ - -#define TRNG_CTL_READY_Pos (7) /*!< TRNG_T::CTL: READY Position */ -#define TRNG_CTL_READY_Msk (0x1ul << TRNG_CTL_READY_Pos) /*!< TRNG_T::CTL: READY Mask */ - -#define TRNG_CTL_Reversed_Pos (8) /*!< TRNG_T::CTL: Reversed Position */ -#define TRNG_CTL_Reversed_Msk (0xfffffful << TRNG_CTL_Reversed_Pos) /*!< TRNG_T::CTL: Reversed Mask */ - -#define TRNG_DATA_DATA_Pos (0) /*!< TRNG_T::DATA: DATA Position */ -#define TRNG_DATA_DATA_Msk (0xfful << TRNG_DATA_DATA_Pos) /*!< TRNG_T::DATA: DATA Mask */ - -#define TRNG_ACT_VER_Pos (0) /*!< TRNG_T::ACT: VER Position */ -#define TRNG_ACT_VER_Msk (0x7ful << TRNG_ACT_VER_Pos) /*!< TRNG_T::ACT: VER Mask */ - -#define TRNG_ACT_ACT_Pos (7) /*!< TRNG_T::ACT: ACT Position */ -#define TRNG_ACT_ACT_Msk (0x1ul << TRNG_ACT_ACT_Pos) /*!< TRNG_T::ACT: ACT Mask */ - -/**@}*/ /* TRNG_CONST */ -/**@}*/ /* end of TRNG register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __TRNG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uart_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uart_reg.h deleted file mode 100644 index 44f60827b05..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uart_reg.h +++ /dev/null @@ -1,1317 +0,0 @@ -/**************************************************************************//** - * @file uart_reg.h - * @version V3.00 - * @brief UART register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UART_REG_H__ -#define __UART_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UART Universal Asynchronous Receiver/Transmitter Controller(UART) - Memory Mapped Structure for UART Controller -@{ */ - -typedef struct -{ - - - /** - * @var UART_T::DAT - * Offset: 0x00 UART Receive/Transmit Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Data Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing one byte to this register, the data byte will be stored in transmitter FIFO. - * | | |The UART controller will send out the data stored in transmitter FIFO top location through the UART_TXD. - * | | |Read Operation: - * | | |By reading this register, the UART controller will return an 8-bit data received from receiver FIFO. - * |[8] |PARITY |Parity Bit Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing to this bit, the parity bit will be stored in transmitter FIFO. - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set, the UART controller will send out this bit follow the DAT (UART_DAT[7:0]) through the UART_TXD. - * | | |Read Operation: - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are enabled, the parity bit can be read by this bit. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set. - * @var UART_T::INTEN - * Offset: 0x04 UART Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIEN |Receive Data Available Interrupt Enable Bit - * | | |0 = Receive data available interrupt Disabled. - * | | |1 = Receive data available interrupt Enabled. - * |[1] |THREIEN |Transmit Holding Register Empty Interrupt Enable Bit - * | | |0 = Transmit holding register empty interrupt Disabled. - * | | |1 = Transmit holding register empty interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive Line Status interrupt Disabled. - * | | |1 = Receive Line Status interrupt Enabled. - * |[3] |MODEMIEN |Modem Status Interrupt Enable Bit - * | | |0 = Modem status interrupt Disabled. - * | | |1 = Modem status interrupt Enabled. - * |[4] |RXTOIEN |RX Time-out Interrupt Enable Bit - * | | |0 = RX time-out interrupt Disabled. - * | | |1 = RX time-out interrupt Enabled. - * |[5] |BUFERRIEN |Buffer Error Interrupt Enable Bit - * | | |0 = Buffer error interrupt Disabled. - * | | |1 = Buffer error interrupt Enabled. - * |[6] |WKIEN |Wake-up Interrupt Enable Bit - * | | |0 = Wake-up Interrupt Disabled. - * | | |1 = Wake-up Interrupt Enabled. - * |[8] |LINIEN |LIN Bus Interrupt Enable Bit - * | | |0 = LIN bus interrupt Disabled. - * | | |1 = LIN bus interrupt Enabled. - * | | |Note: This bit is used for LIN function mode. - * |[11] |TOCNTEN |Receive Buffer Time-out Counter Enable Bit - * | | |0 = Receive Buffer Time-out counter Disabled. - * | | |1 = Receive Buffer Time-out counter Enabled. - * |[12] |ATORTSEN |nRTS Auto-flow Control Enable Bit - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: When nRTS auto-flow is enabled, if the number of bytes in the RX FIFO equals the RTSTRGLV (UART_FIFO[19:16]), the UART will de-assert nRTS signal. - * |[13] |ATOCTSEN |nCTS Auto-flow Control Enable Bit - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * | | |Note: When nCTS auto-flow is enabled, the UART will send data to external device if nCTS input assert (UART will not send data to device until nCTS is asserted). - * |[14] |TXPDMAEN |TX PDMA Enable Bit - * | | |This bit can enable or disable TX PDMA service. - * | | |0 = TX PDMA Disabled. - * | | |1 = TX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused. - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]), UART PDMA transmit request operation is stopped. - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing '1' to corresponding BIF, FEF and PEF to make UART PDMA transmit request operation continue. - * |[15] |RXPDMAEN |RX PDMA Enable Bit - * | | |This bit can enable or disable RX PDMA service. - * | | |0 = RX PDMA Disabled. - * | | |1 = RX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused. - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]), UART PDMA receive request operation is stopped. - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing '1' to corresponding BIF, FEF and PEF to make UART PDMA receive request operation continue. - * |[16] |SWBEIEN |Single-wire Bit Error Detection Interrupt Enable Bit - * | | |Set this bit, the Single-wire Half Duplex Bit Error Detection Interrupt SWBEINT(UART_INTSTS[24]) is generated when Single-wire Bit Error Detection SWBEIF(UART_INTSTS[16]) is set. - * | | |0 = Single-wire Bit Error Detect Interrupt Disabled. - * | | |1 = Single-wire Bit Error Detect Interrupt Enabled. - * | | |Note: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * |[18] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[22] |TXENDIEN |Transmitter Empty Interrupt Enable Bit - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt TXENDINT (UART_INTSTS[30]) will be generated when TXENDIF (UART_INTSTS[22]) is set. - * | | |TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted. - * | | |0 = Transmitter empty interrupt Disabled. - * | | |1 = Transmitter empty interrupt Enabled. - * @var UART_T::FIFO - * Offset: 0x08 UART FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RXRST |RX Field Software Reset - * | | |When RXRST (UART_FIFO[1]) is set, all the byte in the receiver FIFO and RX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the RX internal state machine and pointers. - * | | |Note 1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note 2: Before setting this bit, it should wait for the RXIDLE (UART_FIFOSTS[29]) be set. - * |[2] |TXRST |TX Field Software Reset - * | | |When TXRST (UART_FIFO[2]) is set, all the byte in the transmit FIFO and TX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the TX internal state machine and pointers. - * | | |Note 1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note 2: Before setting this bit, it should wait for the TXEMPTYF (UART_FIFOSTS[28]) be set. - * |[7:4] |RFITL |RX FIFO Interrupt Trigger Level - * | | |When the number of bytes in the receive FIFO equals the RFITL, the RDAIF (UART_INTSTS[0]) will be set (if RDAIEN (UART_INTEN [0]) enabled, and an interrupt will be generated). - * | | |0000 = RX FIFO Interrupt Trigger Level is 1 byte. - * | | |0001 = RX FIFO Interrupt Trigger Level is 4 bytes. - * | | |0010 = RX FIFO Interrupt Trigger Level is 8 bytes. - * | | |0011 = RX FIFO Interrupt Trigger Level is 14 bytes. - * | | |Others = Reserved. - * |[8] |RXOFF |Receiver Disable Bit - * | | |The receiver is disabled or not (set 1 to disable receiver). - * | | |0 = Receiver Enabled. - * | | |1 = Receiver Disabled. - * | | |Note: This bit is used for RS-485 Normal Multi-drop mode. - * | | |It should be programmed before RS485NMM (UART_ALTCTL [8]) is programmed. - * |[19:16] |RTSTRGLV |nRTS Trigger Level for Auto-flow Control - * | | |0000 = nRTS Trigger Level is 1 byte. - * | | |0001 = nRTS Trigger Level is 4 bytes. - * | | |0010 = nRTS Trigger Level is 8 bytes. - * | | |0011 = nRTS Trigger Level is 14 bytes. - * | | |Others = Reserved. - * | | |Note: This field is used for auto nRTS flow control. - * @var UART_T::LINE - * Offset: 0x0C UART Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WLS |Word Length Selection - * | | |This field sets UART word length. - * | | |00 = 5 bits. - * | | |01 = 6 bits. - * | | |10 = 7 bits. - * | | |11 = 8 bits. - * |[2] |NSB |Number of 'STOP Bit' - * | | |0 = One 'STOP bit' is generated in the transmitted data. - * | | |1 = When select 5-bit word length, 1.5 'STOP bit' is generated in the transmitted data. - * | | |When select 6-, 7- and 8-bit word length, 2 'STOP bit' is generated in the transmitted data. - * |[3] |PBE |Parity Bit Enable Bit - * | | |0 = Parity bit generated Disabled. - * | | |1 = Parity bit generated Enabled. - * | | |Note: Parity bit is generated on each outgoing character and is checked on each incoming data. - * |[4] |EPE |Even Parity Enable Bit - * | | |0 = Odd number of logic '1's is transmitted and checked in each word. - * | | |1 = Even number of logic '1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) is set. - * |[5] |SPE |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: If PBE (UART_LINE[3]) and EPE (UART_LINE[4]) are logic 1, the parity bit is transmitted and checked as logic 0. - * | | |If PBE (UART_LINE[3]) is 1 and EPE (UART_LINE[4]) is 0 then the parity bit is transmitted and checked as 1. - * |[6] |BCB |Break Control Bit - * | | |0 = Break Control Disabled. - * | | |1 = Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the transmitted serial data output (TX) is forced to the Spacing State (logic 0). - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[7] |PSS |Parity Bit Source Selection - * | | |The parity bit can be selected to be generated and checked automatically or by software. - * | | |0 = Parity bit is generated by EPE (UART_LINE[4]) and SPE (UART_LINE[5]) setting and checked automatically. - * | | |1 = Parity bit generated and checked by software. - * | | |Note 1: This bit has effect only when PBE (UART_LINE[3]) is set. - * | | |Note 2: If PSS is 0, the parity bit is transmitted and checked automatically. - * | | |If PSS is 1, the transmitted parity bit value can be determined by writing PARITY (UART_DAT[8]) and the parity bit can be read by reading PARITY (UART_DAT[8]). - * |[8] |TXDINV |TX Data Inverted - * | | |0 = Transmitted data signal inverted Disabled. - * | | |1 = Transmitted data signal inverted Enabled. - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select UART, LIN or RS485 function. - * |[9] |RXDINV |RX Data Inverted - * | | |0 = Received data signal inverted Disabled. - * | | |1 = Received data signal inverted Enabled. - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select UART, LIN or RS485 function. - * @var UART_T::MODEM - * Offset: 0x10 UART Modem Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RTS |nRTS Signal Control - * | | |This bit is direct control internal nRTS (Request-to-send) signal active or not, and then drive the nRTS pin output with RTSACTLV bit configuration. - * | | |0 = nRTS signal is active. - * | | |1 = nRTS signal is inactive. - * | | |Note 1: This nRTS signal control bit is not effective when nRTS auto-flow control is enabled in UART function mode. - * | | |Note 2: This nRTS signal control bit is not effective when RS-485 auto direction mode (AUD) is enabled in RS-485 function mode. - * | | |Note 3: Single-wire mode is support this feature. - * |[9] |RTSACTLV |nRTS Pin Active Level - * | | |This bit defines the active level state of nRTS pin output. - * | | |0 = nRTS pin output is high level active. - * | | |1 = nRTS pin output is low level active. (Default) - * | | |Note: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * |[13] |RTSSTS |nRTS Pin Status (Read Only) - * | | |This bit mirror from nRTS pin output of voltage logic status. - * | | |0 = nRTS pin output is low level voltage logic state. - * | | |1 = nRTS pin output is high level voltage logic state. - * @var UART_T::MODEMSTS - * Offset: 0x14 UART Modem Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSDETF |Detect nCTS State Change Flag - * | | |This bit is set whenever nCTS input has change state, and it will generate Modem interrupt to CPU when MODEMIEN (UART_INTEN [3]) is set to 1. - * | | |0 = nCTS input has not change state. - * | | |1 = nCTS input has change state. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[4] |CTSSTS |nCTS Pin Status (Read Only) - * | | |This bit mirror from nCTS pin input of voltage logic status. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - * | | |Note: This bit echoes when UART controller peripheral clock is enabled, and nCTS multi-function port is selected. - * |[8] |CTSACTLV |nCTS Pin Active Level - * | | |This bit defines the active level state of nCTS pin input. - * | | |0 = nCTS pin input is high level active. - * | | |1 = nCTS pin input is low level active. (Default) - * | | |Note: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * @var UART_T::FIFOSTS - * Offset: 0x18 UART FIFO Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXOVIF |RX Overflow Error Interrupt Flag - * | | |This bit is set when RX FIFO overflow. - * | | |If the number of bytes of received data is greater than RX_FIFO (UART_DAT) size 16 bytes, this bit will be set. - * | | |0 = RX FIFO is not overflow. - * | | |1 = RX FIFO is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[1] |ABRDIF |Auto-baud Rate Detect Interrupt Flag - * | | |This bit is set to logic '1' when auto-baud rate detect function is finished. - * | | |0 = Auto-baud rate detect function is not finished. - * | | |1 = Auto-baud rate detect function is finished. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[2] |ABRDTOIF |Auto-baud Rate Detect Time-out Interrupt Flag - * | | |This bit is set to logic '1' in Auto-baud Rate Detect mode when the baud rate counter is overflow. - * | | |0 = Auto-baud rate counter is underflow. - * | | |1 = Auto-baud rate counter is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[3] |ADDRDETF |RS-485 Address Byte Detect Flag - * | | |0 = Receiver detects a data that is not an address bit (bit 9 ='0'). - * | | |1 = Receiver detects a data that is an address bit (bit 9 ='1'). - * | | |Note 1: This field is used for RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1 to enable Address detection mode. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[4] |PEF |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'parity bit'. - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[5] |FEF |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'stop bit' - * | | |(that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[6] |BIF |Break Interrupt Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the 'spacing state' (logic 0) - * | | |for longer than a full word transmission time (that is, the total time of start bit + data bits + parity + stop bits). - * | | |0 = No Break interrupt is generated. - * | | |1 = Break interrupt is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[13:8] |RXPTR |RX FIFO Pointer (Read Only) - * | | |This field indicates the RX FIFO Buffer Pointer - * | | |When UART receives one byte from external device, RXPTR increases one. - * | | |When one byte of RX FIFO is read by CPU, RXPTR decreases one. - * | | |The Maximum value shown in RXPTR is 15. - * | | |When the using level of RX FIFO Buffer equal to 16, the RXFULL bit is set to 1 and RXPTR will show 0. - * | | |As one byte of RX FIFO is read by CPU, the RXFULL bit is cleared to 0 and RXPTR will show 15. - * |[14] |RXEMPTY |Receiver FIFO Empty (Read Only) - * | | |This bit initiate RX FIFO empty or not. - * | | |0 = RX FIFO is not empty. - * | | |1 = RX FIFO is empty. - * | | |Note: When the last byte of RX FIFO has been read by CPU, hardware sets this bit high - * | | |It will be cleared when UART receives any new data. - * |[15] |RXFULL |Receiver FIFO Full (Read Only) - * | | |This bit initiates RX FIFO full or not. - * | | |0 = RX FIFO is not full. - * | | |1 = RX FIFO is full. - * | | |Note: This bit is set when the number of usage in RX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[21:16] |TXPTR |TX FIFO Pointer (Read Only) - * | | |This field indicates the TX FIFO Buffer Pointer - * | | |When CPU writes one byte into UART_DAT, TXPTR increases one. - * | | |When one byte of TX FIFO is transferred to Transmitter Shift Register, TXPTR decreases one.. - * | | |The Maximum value shown in TXPTR is 15. - * | | |When the using level of TX FIFO Buffer equal to 16, the TXFULL bit is set to 1 and TXPTR will show 0. - * | | |As one byte of TX FIFO is transferred to Transmitter Shift Register, the TXFULL bit is cleared to 0 and TXPTR will show 15. - * |[22] |TXEMPTY |Transmitter FIFO Empty (Read Only) - * | | |This bit indicates TX FIFO empty or not. - * | | |0 = TX FIFO is not empty. - * | | |1 = TX FIFO is empty. - * | | |Note: When the last byte of TX FIFO has been transferred to Transmitter Shift Register, hardware sets this bit high. - * | | |It will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[23] |TXFULL |Transmitter FIFO Full (Read Only) - * | | |This bit indicates TX FIFO full or not. - * | | |0 = TX FIFO is not full. - * | | |1 = TX FIFO is full. - * | | |Note: This bit is set when the number of usage in TX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[24] |TXOVIF |TX Overflow Error Interrupt Flag - * | | |If TX FIFO (UART_DAT) is full, an additional write to UART_DAT will cause this bit to logic 1. - * | | |0 = TX FIFO is not overflow. - * | | |1 = TX FIFO is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[28] |TXEMPTYF |Transmitter Empty Flag (Read Only) - * | | |This bit is set by hardware when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted. - * | | |0 = TX FIFO is not empty or the STOP bit of the last byte has been not transmitted. - * | | |1 = TX FIFO is empty and the STOP bit of the last byte has been transmitted. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[29] |RXIDLE |RX Idle Status (Read Only) - * | | |This bit is set by hardware when RX is idle. - * | | |0 = RX is busy. - * | | |1 = RX is idle. (Default) - * |[31] |TXRXACT |TX and RX Active Status (Read Only) - * | | |This bit indicates TX and RX are active or inactive. - * | | |0 = TX and RX are inactive. - * | | |1 = TX and RX are active. (Default) - * | | |Note: When TXRXDIS (UART_FUNCSEL[3]) is set and both TX and RX are in idle state, this bit is cleared. - * | | |The UART controller can not transmit or receive data at this moment. - * | | |Otherwise this bit is set. - * @var UART_T::INTSTS - * Offset: 0x1C UART Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIF |Receive Data Available Interrupt Flag (Read Only) - * | | |When the number of bytes in the RX FIFO equals the RFITL then the RDAIF(UART_INTSTS[0]) will be set. - * | | |If RDAIEN (UART_INTEN [0]) is enabled, the RDA interrupt will be generated. - * | | |0 = No RDA interrupt flag is generated. - * | | |1 = RDA interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when the number of unread bytes of RX FIFO drops below the threshold level (RFITL(UART_FIFO[7:4]). - * |[1] |THREIF |Transmit Holding Register Empty Interrupt Flag (Read Only) - * | | |This bit is set when the last data of TX FIFO is transferred to Transmitter Shift Register. - * | | |If THREIEN (UART_INTEN[1]) is enabled, the THRE interrupt will be generated. - * | | |0 = No THRE interrupt flag is generated. - * | | |1 = THRE interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[2] |RLSIF |Receive Line Interrupt Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]), is set). - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated. - * | | |1 = RLS interrupt flag is generated. - * | | |Note 1: In RS-485 function mode, this field is set include "receiver detect and received address byte character (bit9 = '1') bit". - * | | |At the same time, the bit of ADDRDETF (UART_FIFOSTS[3]) is also set. - * | | |Note 2: This bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note 3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]) , FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[3] |MODEMIF |MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS[0]) = 1). - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated. - * | | |1 = Modem interrupt flag is generated. - * | | |Note: This bit is read only and reset to 0 when bit CTSDETF is cleared by a write 1 on CTSDETF(UART_MODEMSTS[0]). - * |[4] |RXTOIF |RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]). - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated. - * | | |0 = No RX time-out interrupt flag is generated. - * | | |1 = RX time-out interrupt flag is generated. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[5] |BUFERRIF |Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX FIFO or RX FIFO overflows (TXOVIF (UART_FIFOSTS[24]) or RXOVIF (UART_FIFOSTS[0]) is set). - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer is not correct. - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated. - * | | |1 = Buffer error interrupt flag is generated. - * | | |Note: This bit is cleared if both of RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]) are cleared to 0 by writing 1 to RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]). - * |[6] |WKIF |UART Wake-up Interrupt Flag (Read Only) - * | | |This bit is set when TOUTWKF (UART_WKSTS[4]), RS485WKF (UART_WKSTS[3]), RFRTWKF (UART_WKSTS[2]), DATWKF (UART_WKSTS[1]) or CTSWKF(UART_WKSTS[0]) is set to 1. - * | | |0 = No UART wake-up interrupt flag is generated. - * | | |1 = UART wake-up interrupt flag is generated. - * | | |Note: This bit is cleared if all of TOUTWKF, RS485WKF, RFRTWKF, DATWKF and CTSWKF are cleared to 0 by writing 1 to the corresponding interrupt flag. - * |[7] |LINIF |LIN Bus Interrupt Flag - * | | |This bit is set when LIN slave header detect (SLVHDETF (UART_LINSTS[0] = 1)), LIN break detect (BRKDETF(UART_LINSTS[8]=1)), bit error detect (BITEF(UART_LINSTS[9]=1)), LIN slave ID parity error (SLVIDPEF(UART_LINSTS[2] = 1)) or LIN slave header error detect (SLVHEF (UART_LINSTS[1])). - * | | |If LINIEN (UART_INTEN [8]) is enabled the LIN interrupt will be generated. - * | | |0 = None of SLVHDETF, BRKDETF, BITEF, SLVIDPEF and SLVHEF is generated. - * | | |1 = At least one of SLVHDETF, BRKDETF, BITEF, SLVIDPEF and SLVHEF is generated. - * | | |Note: This bit is cleared when SLVHDETF(UART_LINSTS[0]), BRKDETF(UART_LINSTS[8]), BITEF(UART_LINSTS[9]), SLVIDPEF (UART_LINSTS[2]) and SLVHEF(UART_LINSTS[1]) all are cleared and software writing '1' to LINIF(UART_INTSTS[7]). - * |[8] |RDAINT |Receive Data Available Interrupt Indicator (Read Only) - * | | |This bit is set if RDAIEN (UART_INTEN[0]) and RDAIF (UART_INTSTS[0]) are both set to 1. - * | | |0 = No RDA interrupt is generated. - * | | |1 = RDA interrupt is generated. - * |[9] |THREINT |Transmit Holding Register Empty Interrupt Indicator (Read Only) - * | | |This bit is set if THREIEN (UART_INTEN[1]) and THREIF(UART_INTSTS[1]) are both set to 1. - * | | |0 = No THRE interrupt is generated. - * | | |1 = THRE interrupt is generated. - * |[10] |RLSINT |Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and RLSIF(UART_INTSTS[2]) are both set to 1. - * | | |0 = No RLS interrupt is generated. - * | | |1 = RLS interrupt is generated. - * |[11] |MODEMINT |MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN(UART_INTEN[3]) and MODEMIF(UART_INTSTS[3]) are both set to 1 - * | | |0 = No Modem interrupt is generated. - * | | |1 = Modem interrupt is generated. - * |[12] |RXTOINT |RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and RXTOIF(UART_INTSTS[4]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated. - * | | |1 = RX time-out interrupt is generated. - * |[13] |BUFERRINT |Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN(UART_INTEN[5]) and BUFERRIF(UART_ INTSTS[5]) are both set to 1. - * | | |0 = No buffer error interrupt is generated. - * | | |1 = Buffer error interrupt is generated. - * |[14] |WKINT |UART Wake-up Interrupt Indicator (Read Only) - * | | |This bit is set if WKIEN (UART_INTEN[6]) and WKIF (UART_INTSTS[6]) are both set to 1. - * | | |0 = No UART wake-up interrupt is generated. - * | | |1 = UART wake-up interrupt is generated. - * |[15] |LININT |LIN Bus Interrupt Indicator (Read Only) - * | | |This bit is set if LINIEN (UART_INTEN[8]) and LINIF(UART_INTSTS[7]) are both set to 1. - * | | |0 = No LIN Bus interrupt is generated. - * | | |1 = The LIN Bus interrupt is generated. - * |[16] |SWBEIF |Single-wire Bit Error Detection Interrupt Flag - * | | |This bit is set when the single wire bus state not equals to UART controller TX state in Single-wire mode. - * | | |0 = No single-wire bit error detection interrupt flag is generated. - * | | |1 = Single-wire bit error detection interrupt flag is generated. - * | | |Note 1: This bit is active when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[18] |HWRLSIF |PDMA Mode Receive Line Status Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF (UART_FIFOSTS[6]), FEF (UART_FIFOSTS[5]) and PEF (UART_FIFOSTS[4]) is set). - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated in PDMA mode. - * | | |1 = RLS interrupt flag is generated in PDMA mode. - * | | |Note 1: In RS-485 function mode, this field include "receiver detect any address byte received address byte character (bit9 = '1') bit". - * | | |Note 2: In UART function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]) , FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note 3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[19] |HWMODIF |PDMA Mode MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS [0] =1)) - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated in PDMA mode. - * | | |1 = Modem interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and reset to 0 when the bit CTSDETF (UART_MODEMSTS[0]) is cleared by writing 1 on CTSDETF (UART_MODEMSTS [0]). - * |[20] |HWTOIF |PDMA Mode RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]). - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated. - * | | |0 = No RX time-out interrupt flag is generated in PDMA mode. - * | | |1 = RX time-out interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[21] |HWBUFEIF |PDMA Mode Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX or RX FIFO overflows (TXOVIF (UART_FIFOSTS [24]) or RXOVIF (UART_FIFOSTS[0]) is set). - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer maybe is not correct. - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated in PDMA mode. - * | | |1 = Buffer error interrupt flag is generated in PDMA mode. - * | | |Note: This bit is cleared when both TXOVIF (UART_FIFOSTS[24]]) and RXOVIF (UART_FIFOSTS[0]) are cleared. - * |[22] |TXENDIF |Transmitter Empty Interrupt Flag (Read Only) - * | | |This bit is set when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted (TXEMPTYF (UART_FIFOSTS[28]) is set). - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt will be generated. - * | | |0 = No transmitter empty interrupt flag is generated. - * | | |1 = Transmitter empty interrupt flag is generated. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[24] |SWBEINT |Single-wire Bit Error Detect Interrupt Indicator (Read Only) - * | | |Single-wire Bit Error Detect Interrupt Indicator (Read Only) - * | | |This bit is set if SWBEIEN (UART_INTEN[16]) and SWBEIF (UART_INTSTS[16]) are both set to 1. - * | | |0 = No Single-wire Bit Error Detection Interrupt generated. - * | | |1 = Single-wire Bit Error Detection Interrupt generated. - * |[26] |HWRLSINT |PDMA Mode Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and HWRLSIF(UART_INTSTS[18]) are both set to 1. - * | | |0 = No RLS interrupt is generated in PDMA mode. - * | | |1 = RLS interrupt is generated in PDMA mode. - * |[27] |HWMODINT |PDMA Mode MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN (UART_INTEN[3]) and HWMODIF(UART_INTSTS[19]) are both set to 1. - * | | |0 = No Modem interrupt is generated in PDMA mode. - * | | |1 = Modem interrupt is generated in PDMA mode. - * |[28] |HWTOINT |PDMA Mode RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and HWTOIF(UART_INTSTS[20]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated in PDMA mode. - * | | |1 = RX time-out interrupt is generated in PDMA mode. - * |[29] |HWBUFEINT |PDMA Mode Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN (UART_INTEN[5]) and HWBUFEIF (UART_INTSTS[21]) are both set to 1. - * | | |0 = No buffer error interrupt is generated in PDMA mode. - * | | |1 = Buffer error interrupt is generated in PDMA mode. - * |[30] |TXENDINT |Transmitter Empty Interrupt Indicator (Read Only) - * | | |This bit is set if TXENDIEN (UART_INTEN[22]) and TXENDIF(UART_INTSTS[22]) are both set to 1. - * | | |0 = No Transmitter Empty interrupt is generated. - * | | |1 = Transmitter Empty interrupt is generated. - * |[31] |ABRINT |Auto-baud Rate Interrupt Indicator (Read Only) - * | | |This bit is set if ABRIEN (UART_INTEN[18]) and ABRIF (UART_ALTCTL[17]) are both set to 1. - * | | |0 = No Auto-baud Rate interrupt is generated. - * | | |1 = The Auto-baud Rate interrupt is generated. - * @var UART_T::TOUT - * Offset: 0x20 UART Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TOIC |Time-out Interrupt Comparator - * | | |The time-out counter resets and starts counting (the counting clock = baud rate) whenever the RX FIFO receives a new data word if time out counter is enabled by setting TOCNTEN (UART_INTEN[11]). - * | | |Once the content of time-out counter is equal to that of time-out interrupt comparator (TOIC (UART_TOUT[7:0])), a receiver time-out interrupt (RXTOINT(UART_INTSTS[12])) is generated if RXTOIEN (UART_INTEN [4]) enabled. - * | | |A new incoming data word or RX FIFO empty will clear RXTOIF (UART_INTSTS[4]). - * | | |In order to avoid receiver time-out interrupt generation immediately during one character is being received, TOIC value should be set between 40 and 255. - * | | |So, for example, if TOIC is set with 40, the time-out interrupt is generated after four characters are not received when 1 stop bit and no parity check is set for UART transfer. - * |[15:8] |DLY |TX Delay Time Value - * | | |This field is used to programming the transfer delay time between the last stop bit and next start bit. - * | | |The unit is bit time. - * @var UART_T::BAUD - * Offset: 0x24 UART Baud Rate Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |BRD |Baud Rate Divider - * | | |The field indicates the baud rate divider. - * | | |This filed is used in baud rate calculation. - * |[27:24] |EDIVM1 |Extra Divider for BAUD Rate Mode 1 - * | | |This field is used for baud rate calculation in mode 1 and has no effect for baud rate calculation in mode 0 and mode 2. - * |[28] |BAUDM0 |BAUD Rate Mode Selection Bit 0 - * | | |This bit is baud rate mode selection bit 0 - * | | |UART provides three baud rate calculation modes. - * | | |This bit combines with BAUDM1 (UART_BAUD[29]) to select baud rate calculation mode. - * |[29] |BAUDM1 |BAUD Rate Mode Selection Bit 1 - * | | |This bit is baud rate mode selection bit 1 - * | | |UART provides three baud rate calculation modes. - * | | |This bit combines with BAUDM0 (UART_BAUD[28]) to select baud rate calculation mode. - * | | |Note: In IrDA mode must be operated in mode 0. - * @var UART_T::IRDA - * Offset: 0x28 UART IrDA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXEN |IrDA Receiver/Transmitter Selection Enable Bit - * | | |0 = IrDA Transmitter Disabled and Receiver Enabled. (Default) - * | | |1 = IrDA Transmitter Enabled and Receiver Disabled. - * |[5] |TXINV |IrDA Inverse Transmitting Output Signal - * | | |0 = None inverse transmitting signal. (Default). - * | | |1 = Inverse transmitting output signal. - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select IrDA function. - * |[6] |RXINV |IrDA Inverse Receive Input Signal - * | | |0 = None inverse receiving input signal. - * | | |1 = Inverse receiving input signal. (Default) - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared. - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select IrDA function. - * @var UART_T::ALTCTL - * Offset: 0x2C UART Alternate Control/Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |BRKFL |UART LIN Break Field Length - * | | |This field indicates a 4-bit LIN TX break field count. - * | | |Note 1: This break field length is BRKFL + 1. - * | | |Note 2: According to LIN spec, the reset value is 0xC (break field length = 13). - * |[6] |LINRXEN |LIN RX Enable Bit - * | | |0 = LIN RX mode Disabled. - * | | |1 = LIN RX mode Enabled. - * |[7] |LINTXEN |LIN TX Break Mode Enable Bit - * | | |0 = LIN TX Break mode Disabled. - * | | |1 = LIN TX Break mode Enabled. - * | | |Note: When TX break field transfer operation finished, this bit will be cleared automatically. - * |[8] |RS485NMM |RS-485 Normal Multi-drop Operation Mode - * | | |0 = RS-485 Normal Multi-drop Operation mode (NMM) Disabled. - * | | |1 = RS-485 Normal Multi-drop Operation mode (NMM) Enabled. - * | | |Note: It cannot be active with RS-485_AAD operation mode. - * |[9] |RS485AAD |RS-485 Auto Address Detection Operation Mode - * | | |0 = RS-485 Auto Address Detection Operation mode (AAD) Disabled. - * | | |1 = RS-485 Auto Address Detection Operation mode (AAD) Enabled. - * | | |Note: It cannot be active with RS-485_NMM operation mode. - * |[10] |RS485AUD |RS-485 Auto Direction Function (AUD) - * | | |0 = RS-485 Auto Direction Operation function (AUD) Disabled. - * | | |1 = RS-485 Auto Direction Operation function (AUD) Enabled. - * | | |Note: It can be active with RS-485_AAD or RS-485_NMM operation mode. - * |[15] |ADDRDEN |RS-485 Address Detection Enable Bit - * | | |This bit is used to enable RS-485 Address Detection mode. - * | | |0 = Address detection mode Disabled. - * | | |1 = Address detection mode Enabled. - * | | |Note: This bit is used for RS-485 any operation mode. - * |[17] |ABRIF |Auto-baud Rate Interrupt Flag (Read Only) - * | | |This bit is set when auto-baud rate detection function finished or the auto-baud rate counter was overflow and if ABRIEN(UART_INTEN [18]) is set then the auto-baud rate interrupt will be generated. - * | | |0 = No auto-baud rate interrupt flag is generated. - * | | |1 = Auto-baud rate interrupt flag is generated. - * | | |Note: This bit is read only, but it can be cleared by writing '1' to ABRDTOIF (UART_FIFOSTS[2]) and ABRDIF(UART_FIFOSTS[1]). - * |[18] |ABRDEN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note : This bit is cleared automatically after auto-baud detection is finished. - * |[20:19] |ABRDBITS |Auto-baud Rate Detect Bit Length - * | | |00 = 1-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x01. - * | | |01 = 2-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x02. - * | | |10 = 4-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x08. - * | | |11 = 8-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x80. - * | | |Note : The calculation of bit number includes the START bit. - * |[31:24] |ADDRMV |Address Match Value - * | | |This field contains the RS-485 address match values. - * | | |Note: This field is used for RS-485 auto address detection mode. - * @var UART_T::FUNCSEL - * Offset: 0x30 UART Function Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNCSEL |Function Select - * | | |000 = UART function. - * | | |001 = LIN function. - * | | |010 = IrDA function. - * | | |011 = RS-485 function. - * | | |100 = UART Single-wire function. - * | | |Others = Reserved. - * |[3] |TXRXDIS |TX and RX Disable Bit - * | | |Setting this bit can disable TX and RX. - * | | |0 = TX and RX Enabled. - * | | |1 = TX and RX Disabled. - * | | |Note: The TX and RX will not disable immediately when this bit is set. - * | | |The TX and RX complete current task before disable TX and RX are disabled. - * | | |When TX and RX disable, the TXRXACT (UART_FIFOSTS[31]) is cleared. - * |[6] |DGE |Deglitch Enable Bit - * | | |0 = Deglitch Disabled. - * | | |1 = Deglitch Enabled. - * | | |Note 1: When this bit is set to logic 1, any pulse width less than about 150 ns will be considered a glitch and will be removed in the serial data input (RX). - * | | |This bit acts only on RX line and has no effect on the transmitter logic. - * | | |Note 2: It is recommended to set this bit only when operating at baud rate under 2.5 Mbps. - * |[7] |TXRXSWP |TX and RX Swap Enable Bit - * | | |Setting this bit Swaps TX pin and RX pin. - * | | |0 = TX and RX Swap Disabled. - * | | |1 = TX and RX Swap Enabled. - * @var UART_T::LINCTL - * Offset: 0x34 UART LIN Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLVEN |LIN Slave Mode Enable Bit - * | | |0 = LIN slave mode Disabled. - * | | |1 = LIN slave mode Enabled. - * |[1] |SLVHDEN |LIN Slave Header Detection Enable Bit - * | | |0 = LIN slave header detection Disabled. - * | | |1 = LIN slave header detection Enabled. - * | | |Note 1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note 2: In LIN function mode, when detect header field (break + sync + frame ID), SLVHDETF (UART_LINSTS [0]) flag will be asserted. - * | | |If the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * |[2] |SLVAREN |LIN Slave Automatic Resynchronization Mode Enable Bit - * | | |0 = LIN automatic resynchronization Disabled. - * | | |1 = LIN automatic resynchronization Enabled. - * | | |Note 1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note 2: When operation in Automatic Resynchronization mode, the baud rate setting must be mode2 (BAUDM1 (UART_BAUD [29]) and BAUDM0 (UART_BAUD [28]) must be 1). - * |[3] |SLVDUEN |LIN Slave Divider Update Method Enable Bit - * | | |0 = UART_BAUD updated is written by software (if no automatic resynchronization update occurs at the same time). - * | | |1 = UART_BAUD is updated at the next received character. User must set the bit before checksum reception. - * | | |Note 1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note 2: This bit used for LIN Slave Automatic Resynchronization mode. (for Non-Automatic Resynchronization mode, this bit should be kept cleared) - * |[4] |MUTE |LIN Mute Mode Enable Bit - * | | |0 = LIN mute mode Disabled. - * | | |1 = LIN mute mode Enabled. - * |[8] |SENDH |LIN TX Send Header Enable Bit - * | | |The LIN TX header can be break field or 'break and sync field' or 'break, sync and frame ID field', it is depend on setting HSEL (UART_LINCTL[23:22]). - * | | |0 = Send LIN TX header Disabled. - * | | |1 = Send LIN TX header Enabled. - * | | |Note 1: This bit is shadow bit of LINTXEN (UART_ALTCTL [7]); user can read/write it by setting LINTXEN (UART_ALTCTL [7]) or SENDH (UART_LINCTL [8]). - * | | |Note 2: When transmitter header field (it may be 'break' or 'break + sync' or 'break + sync + frame ID' selected by HSEL (UART_LINCTL[23:22]) field) transfer operation finished, this bit will be cleared automatically. - * |[9] |IDPEN |LIN ID Parity Enable Bit - * | | |0 = LIN frame ID parity Disabled. - * | | |1 = LIN frame ID parity Enabled. - * | | |Note 1: This bit can be used for LIN master to sending header field (SENDH (UART_LINCTL[8])) = 1 and HSEL (UART_LINCTL[23:22]) = 10 or be used for enable LIN slave received frame ID parity checked. - * | | |Note 2: This bit is only used when the operation header transmitter is in HSEL (UART_LINCTL[23:22]) = 10. - * |[10] |BRKDETEN |LIN Break Detection Enable Bit - * | | |When detect consecutive dominant greater than 11 bits, and are followed by a delimiter character, the BRKDETF (UART_LINSTS[8]) flag is set at the end of break field. - * | | |If the LINIEN (UART_INTEN [8])=1, an interrupt will be generated. - * | | |0 = LIN break detection Disabled. - * | | |1 = LIN break detection Enabled. - * |[11] |LINRXOFF |LIN Receiver Disable Bit - * | | |If the receiver is enabled (LINRXOFF (UART_LINCTL[11] ) = 0), all received byte data will be accepted and stored in the RX FIFO, and if the receiver is disabled (LINRXOFF (UART_LINCTL[11] = 1), all received byte data will be ignore. - * | | |0 = LIN receiver Enabled. - * | | |1 = LIN receiver Disabled. - * | | |Note: This bit is only valid when operating in LIN function mode (FUNCSEL (UART_FUNCSEL[2:0]) = 001). - * |[12] |BITERREN |Bit Error Detect Enable Bit - * | | |0 = Bit error detection function Disabled. - * | | |1 = Bit error detection function Enabled. - * | | |Note: In LIN function mode, when occur bit error, the BITEF (UART_LINSTS[9]) flag will be asserted - * | | |If the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * |[19:16] |BRKFL |LIN Break Field Length - * | | |This field indicates a 4-bit LIN TX break field count. - * | | |Note 1: These registers are shadow registers of BRKFL (UART_ALTCTL[3:0]), User can read/write it by setting BRKFL (UART_ALTCTL[3:0]) or BRKFL (UART_LINCTL[19:16]). - * | | |Note 2: This break field length is BRKFL + 1. - * | | |Note 3: According to LIN spec, the reset value is 12 (break field length = 13). - * |[21:20] |BSL |LIN Break/Sync Delimiter Length - * | | |00 = The LIN break/sync delimiter length is 1-bit time. - * | | |01 = The LIN break/sync delimiter length is 2-bit time. - * | | |10 = The LIN break/sync delimiter length is 3-bit time. - * | | |11 = The LIN break/sync delimiter length is 4-bit time. - * | | |Note: This bit used for LIN master to sending header field. - * |[23:22] |HSEL |LIN Header Select - * | | |00 = The LIN header includes 'break field'. - * | | |01 = The LIN header includes 'break field' and 'sync field'. - * | | |10 = The LIN header includes 'break field', 'sync field' and 'frame ID field'. - * | | |11 = Reserved. - * | | |Note: This bit is used to master mode for LIN to send header field (SENDH (UART_LINCTL [8]) = 1) or used to slave to indicates exit from mute mode condition (MUTE (UART_LINCTL[4] = 1). - * |[31:24] |PID |LIN PID Bits - * | | |This field contains the LIN frame ID value when in LIN function mode, the frame ID parity can be generated by software or hardware depends on IDPEN (UART_LINCTL[9]) = 1. - * | | |If the parity generated by hardware, user fill ID0~ID5 (PID [29:24] ), hardware will calculate P0 (PID[30]) and P1 (PID[31]), otherwise user must filled frame ID and parity in this field. - * | | |Note 1: User can fill any 8-bit value to this field and the bit 24 indicates ID0 (LSB first). - * | | |Note 2: This field can be used for LIN master mode or slave mode. - * @var UART_T::LINSTS - * Offset: 0x38 UART LIN Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLVHDETF |LIN Slave Header Detection Flag - * | | |This bit is set by hardware when a LIN header is detected in LIN slave mode and be cleared by writing 1 to it. - * | | |0 = LIN header not detected. - * | | |1 = LIN header detected (break + sync + frame ID). - * | | |Note 1: This bit can be cleared by writing 1 to it. - * | | |Note 2: This bit is only valid when in LIN slave mode (SLVEN (UART_LINCTL [0]) = 1) and enable LIN slave header detection function (SLVHDEN (UART_LINCTL [1])). - * | | |Note 3: When enable ID parity check IDPEN (UART_LINCTL [9]), if hardware detect complete header ('break + sync + frame ID'), the SLVHDETF will be set whether the frame ID correct or not. - * |[1] |SLVHEF |LIN Slave Header Error Flag - * | | |This bit is set by hardware when a LIN header error is detected in LIN slave mode and be cleared by writing 1 to it. - * | | |The header errors include 'break delimiter is too short (less than 0.5 bit time)', 'frame error in sync field or Identifier field', - * | | |'sync field data is not 0x55 in Non-Automatic Resynchronization mode', 'sync field deviation error with Automatic Resynchronization mode', - * | | |'sync field measure time-out with Automatic Resynchronization mode' and 'LIN header reception time-out'. - * | | |0 = LIN header error not detected. - * | | |1 = LIN header error detected. - * | | |Note 1: This bit can be cleared by writing 1 to it. - * | | |Note 2: This bit is only valid when UART is operated in LIN slave mode (SLVEN (UART_LINCTL [0]) = 1) and enables LIN slave header detection function (SLVHDEN (UART_LINCTL [1])). - * |[2] |SLVIDPEF |LIN Slave ID Parity Error Flag - * | | |This bit is set by hardware when receipted frame ID parity is not correct. - * | | |0 = No active. - * | | |1 = Receipted frame ID parity is not correct. - * | | |Note 1: This bit can be cleared by writing 1 to it. - * | | |Note 2: This bit is only valid when in LIN slave mode (SLVEN (UART_LINCTL [0])= 1) and enable LIN frame ID parity check function IDPEN (UART_LINCTL [9]). - * |[3] |SLVSYNCF |LIN Slave Sync Field - * | | |This bit indicates that the LIN sync field is being analyzed in Automatic Resynchronization mode - * | | |When the receiver header have some error been detect, user must reset the internal circuit to re-search new frame header by writing 1 to this bit. - * | | |0 = The current character is not at LIN sync state. - * | | |1 = The current character is at LIN sync state. - * | | |Note 1: This bit is only valid when in LIN Slave mode (SLVEN(UART_LINCTL[0]) = 1). - * | | |Note 2: This bit can be cleared by writing 1 to it. - * | | |Note 3: When writing 1 to it, hardware will reload the initial baud rate and re-search a new frame header. - * |[8] |BRKDETF |LIN Break Detection Flag - * | | |This bit is set by hardware when a break is detected and be cleared by writing 1 to it through software. - * | | |0 = LIN break not detected. - * | | |1 = LIN break detected. - * | | |Note 1: This bit can be cleared by writing 1 to it. - * | | |Note 2: This bit is only valid when LIN break detection function is enabled (BRKDETEN (UART_LINCTL[10])=1). - * |[9] |BITEF |Bit Error Detect Status Flag - * | | |At TX transfer state, hardware will monitor the bus state, if the input pin (UART_RXD) state not equals to the output pin (UART_TXD) state, BITEF (UART_LINSTS[9]) will be set. - * | | |When occur bit error, if the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * | | |0 = Bit error not detected. - * | | |1 = Bit error detected. - * | | |Note 1: This bit can be cleared by writing 1 to it. - * | | |Note 2: This bit is only valid when enable bit error detection function (BITERREN (UART_LINCTL [12]) = 1). - * @var UART_T::BRCOMP - * Offset: 0x3C UART Baud Rate Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |BRCOMP |Baud Rate Compensation Patten - * | | |These 9-bits are used to define the relative bit is compensated or not. - * | | |BRCOMP[7:0] is used to define the compensation of DAT (UART_DAT[7:0]) and BRCOMP[8] is used to define PARITY (UART_DAT[8]). - * |[31] |BRCOMPDEC |Baud Rate Compensation Decrease - * | | |0 = Positive (increase one module clock) compensation for each compensated bit. - * | | |1 = Negative (decrease one module clock) compensation for each compensated bit. - * @var UART_T::WKCTL - * Offset: 0x40 UART Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKCTSEN |nCTS Wake-up Enable Bit - * | | |0 = nCTS Wake-up system function Disabled. - * | | |1 = nCTS Wake-up system function Enabled. - * | | |Note: When the system is in Power-down mode, an external nCTS change will wake-up system from Power-down mode. - * |[1] |WKDATEN |Incoming Data Wake-up Enable Bit - * | | |0 = Incoming data wake-up system function Disabled. - * | | |1 = Incoming data wake-up system function Enabled. - * | | |Note: When the system is in Power-down mode, incoming data will wake-up system from Power-down mode. - * |[2] |WKRFRTEN |Received Data FIFO Reached Threshold Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold wake-up system function Enabled. - * | | |Note: When the system is in Power-down mode, Received Data FIFO reached threshold will wake-up system from Power-down mode. - * |[3] |WKRS485EN |RS-485 Address Match Wake-up Enable Bit - * | | |0 = RS-485 Address Match (AAD mode) wake-up system function Disabled. - * | | |1 = RS-485 Address Match (AAD mode) wake-up system function Enabled. - * | | |Note 1: When the system is in Power-down mode, RS-485 Address Match will wake-up system from Power-down mode. - * | | |Note 2: This bit is used for RS-485 Auto Address Detection (AAD) mode in RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1. - * |[4] |WKTOUTEN |Received Data FIFO Reached Threshold Time-out Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold time-out wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold time-out wake-up system function Enabled. - * | | |Note 1: When the system is in Power-down mode, Received Data FIFO reached threshold time-out will wake up system from Power-down mode. - * | | |Note 2: It is suggested the function is enabled when the WKRFRTEN (UART_WKCTL[2]) is set to 1. - * @var UART_T::WKSTS - * Offset: 0x44 UART Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSWKF |nCTS Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by nCTS wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by nCTS wake-up. - * | | |Note 1: If WKCTSEN (UART_WKCTL[0]) is enabled, the nCTS wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[1] |DATWKF |Incoming Data Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by data wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Incoming Data wake-up. - * | | |Note1: If WKDATEN (UART_WKCTL[1]) is enabled, the Incoming Data wake-up cause this bit is set to '1'. - * | | |Note2: This bit can be cleared by writing '1' to it. - * |[2] |RFRTWKF |Received Data FIFO Reached Threshold Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO reached threshold wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO Reached Threshold wake-up. - * | | |Note 1: If WKRFRTEN (UART_WKCTL[2]) is enabled, the Received Data FIFO Reached Threshold wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[3] |RS485WKF |RS-485 Address Match (AAD Mode) Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by RS-485 Address Match (AAD mode). - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by RS-485 Address Match (AAD mode) wake-up. - * | | |Note 1: If WKRS485EN (UART_WKCTL[3]) is enabled, the RS-485 Address Match (AAD mode) wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[4] |TOUTWKF |Received Data FIFO Threshold Time-out Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO Threshold Time-out wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO reached threshold time-out. - * | | |Note 1: If WKTOUTEN (UART_WKCTL[4]) is enabled, the Received Data FIFO reached threshold time-out wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * @var UART_T::DWKCOMP - * Offset: 0x48 UART Incoming Data Wake-up Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STCOMP |Start Bit Compensation Value - * | | |These bits field indicate how many clock cycle selected by UART_CLK do the UART controller can get the 1st bit (start bit) when the device is wake-up from power-down mode. - * | | |Note: It is valid only when WKDATEN (UART_WKCTL[1]) is set. - * @var UART_T::RS485DD - * Offset: 0x4C UART RS485 Transceiver Deactivate Delay Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RTSDDLY |RS485 Transceiver Deactivate Delay Value - * | | |These bits field indicate how many clock cycles selected by UART_CLK do the UART controller delay the RS485 transceiver state trancing when the state trancing of RS485 transceiver is from TX to RX state. - * | | |These bits field have no effect when the state trancing of RS485 transceiver is from RX to TX state. - * | | |Note: It is valid only when RS485AUD (UART_ALTCTL[10]) is set. - */ - __IO uint32_t DAT; /*!< [0x0000] UART Receive/Transmit Buffer Register */ - __IO uint32_t INTEN; /*!< [0x0004] UART Interrupt Enable Register */ - __IO uint32_t FIFO; /*!< [0x0008] UART FIFO Control Register */ - __IO uint32_t LINE; /*!< [0x000c] UART Line Control Register */ - __IO uint32_t MODEM; /*!< [0x0010] UART Modem Control Register */ - __IO uint32_t MODEMSTS; /*!< [0x0014] UART Modem Status Register */ - __IO uint32_t FIFOSTS; /*!< [0x0018] UART FIFO Status Register */ - __IO uint32_t INTSTS; /*!< [0x001c] UART Interrupt Status Register */ - __IO uint32_t TOUT; /*!< [0x0020] UART Time-out Register */ - __IO uint32_t BAUD; /*!< [0x0024] UART Baud Rate Divider Register */ - __IO uint32_t IRDA; /*!< [0x0028] UART IrDA Control Register */ - __IO uint32_t ALTCTL; /*!< [0x002c] UART Alternate Control/Status Register */ - __IO uint32_t FUNCSEL; /*!< [0x0030] UART Function Select Register */ - __IO uint32_t LINCTL; /*!< [0x0034] UART LIN Control Register */ - __IO uint32_t LINSTS; /*!< [0x0038] UART LIN Status Register */ - __IO uint32_t BRCOMP; /*!< [0x003c] UART Baud Rate Compensation Register */ - __IO uint32_t WKCTL; /*!< [0x0040] UART Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0044] UART Wake-up Status Register */ - __IO uint32_t DWKCOMP; /*!< [0x0048] UART Incoming Data Wake-up Compensation Register */ - __IO uint32_t RS485DD; /*!< [0x004C] UART RS485 Transceiver Deactivate Delay Register */ - -} UART_T; - -/** - @addtogroup UART_CONST UART Bit Field Definition - Constant Definitions for UART Controller -@{ */ - -#define UART_DAT_DAT_Pos (0) /*!< UART_T::DAT: DAT Position */ -#define UART_DAT_DAT_Msk (0xfful << UART_DAT_DAT_Pos) /*!< UART_T::DAT: DAT Mask */ - -#define UART_DAT_PARITY_Pos (8) /*!< UART_T::DAT: PARITY Position */ -#define UART_DAT_PARITY_Msk (0x1ul << UART_DAT_PARITY_Pos) /*!< UART_T::DAT: PARITY Mask */ - -#define UART_INTEN_RDAIEN_Pos (0) /*!< UART_T::INTEN: RDAIEN Position */ -#define UART_INTEN_RDAIEN_Msk (0x1ul << UART_INTEN_RDAIEN_Pos) /*!< UART_T::INTEN: RDAIEN Mask */ - -#define UART_INTEN_THREIEN_Pos (1) /*!< UART_T::INTEN: THREIEN Position */ -#define UART_INTEN_THREIEN_Msk (0x1ul << UART_INTEN_THREIEN_Pos) /*!< UART_T::INTEN: THREIEN Mask */ - -#define UART_INTEN_RLSIEN_Pos (2) /*!< UART_T::INTEN: RLSIEN Position */ -#define UART_INTEN_RLSIEN_Msk (0x1ul << UART_INTEN_RLSIEN_Pos) /*!< UART_T::INTEN: RLSIEN Mask */ - -#define UART_INTEN_MODEMIEN_Pos (3) /*!< UART_T::INTEN: MODEMIEN Position */ -#define UART_INTEN_MODEMIEN_Msk (0x1ul << UART_INTEN_MODEMIEN_Pos) /*!< UART_T::INTEN: MODEMIEN Mask */ - -#define UART_INTEN_RXTOIEN_Pos (4) /*!< UART_T::INTEN: RXTOIEN Position */ -#define UART_INTEN_RXTOIEN_Msk (0x1ul << UART_INTEN_RXTOIEN_Pos) /*!< UART_T::INTEN: RXTOIEN Mask */ - -#define UART_INTEN_BUFERRIEN_Pos (5) /*!< UART_T::INTEN: BUFERRIEN Position */ -#define UART_INTEN_BUFERRIEN_Msk (0x1ul << UART_INTEN_BUFERRIEN_Pos) /*!< UART_T::INTEN: BUFERRIEN Mask */ - -#define UART_INTEN_WKIEN_Pos (6) /*!< UART_T::INTEN: WKIEN Position */ -#define UART_INTEN_WKIEN_Msk (0x1ul << UART_INTEN_WKIEN_Pos) /*!< UART_T::INTEN: WKIEN Mask */ - -#define UART_INTEN_LINIEN_Pos (8) /*!< UART_T::INTEN: LINIEN Position */ -#define UART_INTEN_LINIEN_Msk (0x1ul << UART_INTEN_LINIEN_Pos) /*!< UART_T::INTEN: LINIEN Mask */ - -#define UART_INTEN_TOCNTEN_Pos (11) /*!< UART_T::INTEN: TOCNTEN Position */ -#define UART_INTEN_TOCNTEN_Msk (0x1ul << UART_INTEN_TOCNTEN_Pos) /*!< UART_T::INTEN: TOCNTEN Mask */ - -#define UART_INTEN_ATORTSEN_Pos (12) /*!< UART_T::INTEN: ATORTSEN Position */ -#define UART_INTEN_ATORTSEN_Msk (0x1ul << UART_INTEN_ATORTSEN_Pos) /*!< UART_T::INTEN: ATORTSEN Mask */ - -#define UART_INTEN_ATOCTSEN_Pos (13) /*!< UART_T::INTEN: ATOCTSEN Position */ -#define UART_INTEN_ATOCTSEN_Msk (0x1ul << UART_INTEN_ATOCTSEN_Pos) /*!< UART_T::INTEN: ATOCTSEN Mask */ - -#define UART_INTEN_TXPDMAEN_Pos (14) /*!< UART_T::INTEN: TXPDMAEN Position */ -#define UART_INTEN_TXPDMAEN_Msk (0x1ul << UART_INTEN_TXPDMAEN_Pos) /*!< UART_T::INTEN: TXPDMAEN Mask */ - -#define UART_INTEN_RXPDMAEN_Pos (15) /*!< UART_T::INTEN: RXPDMAEN Position */ -#define UART_INTEN_RXPDMAEN_Msk (0x1ul << UART_INTEN_RXPDMAEN_Pos) /*!< UART_T::INTEN: RXPDMAEN Mask */ - -#define UART_INTEN_SWBEIEN_Pos (16) /*!< UART_T::INTEN: SWBEIEN Position */ -#define UART_INTEN_SWBEIEN_Msk (0x1ul << UART_INTEN_SWBEIEN_Pos) /*!< UART_T::INTEN: SWBEIEN Mask */ - -#define UART_INTEN_ABRIEN_Pos (18) /*!< UART_T::INTEN: ABRIEN Position */ -#define UART_INTEN_ABRIEN_Msk (0x1ul << UART_INTEN_ABRIEN_Pos) /*!< UART_T::INTEN: ABRIEN Mask */ - -#define UART_INTEN_TXENDIEN_Pos (22) /*!< UART_T::INTEN: TXENDIEN Position */ -#define UART_INTEN_TXENDIEN_Msk (0x1ul << UART_INTEN_TXENDIEN_Pos) /*!< UART_T::INTEN: TXENDIEN Mask */ - -#define UART_FIFO_RXRST_Pos (1) /*!< UART_T::FIFO: RXRST Position */ -#define UART_FIFO_RXRST_Msk (0x1ul << UART_FIFO_RXRST_Pos) /*!< UART_T::FIFO: RXRST Mask */ - -#define UART_FIFO_TXRST_Pos (2) /*!< UART_T::FIFO: TXRST Position */ -#define UART_FIFO_TXRST_Msk (0x1ul << UART_FIFO_TXRST_Pos) /*!< UART_T::FIFO: TXRST Mask */ - -#define UART_FIFO_RFITL_Pos (4) /*!< UART_T::FIFO: RFITL Position */ -#define UART_FIFO_RFITL_Msk (0xful << UART_FIFO_RFITL_Pos) /*!< UART_T::FIFO: RFITL Mask */ - -#define UART_FIFO_RXOFF_Pos (8) /*!< UART_T::FIFO: RXOFF Position */ -#define UART_FIFO_RXOFF_Msk (0x1ul << UART_FIFO_RXOFF_Pos) /*!< UART_T::FIFO: RXOFF Mask */ - -#define UART_FIFO_RTSTRGLV_Pos (16) /*!< UART_T::FIFO: RTSTRGLV Position */ -#define UART_FIFO_RTSTRGLV_Msk (0xful << UART_FIFO_RTSTRGLV_Pos) /*!< UART_T::FIFO: RTSTRGLV Mask */ - -#define UART_LINE_WLS_Pos (0) /*!< UART_T::LINE: WLS Position */ -#define UART_LINE_WLS_Msk (0x3ul << UART_LINE_WLS_Pos) /*!< UART_T::LINE: WLS Mask */ - -#define UART_LINE_NSB_Pos (2) /*!< UART_T::LINE: NSB Position */ -#define UART_LINE_NSB_Msk (0x1ul << UART_LINE_NSB_Pos) /*!< UART_T::LINE: NSB Mask */ - -#define UART_LINE_PBE_Pos (3) /*!< UART_T::LINE: PBE Position */ -#define UART_LINE_PBE_Msk (0x1ul << UART_LINE_PBE_Pos) /*!< UART_T::LINE: PBE Mask */ - -#define UART_LINE_EPE_Pos (4) /*!< UART_T::LINE: EPE Position */ -#define UART_LINE_EPE_Msk (0x1ul << UART_LINE_EPE_Pos) /*!< UART_T::LINE: EPE Mask */ - -#define UART_LINE_SPE_Pos (5) /*!< UART_T::LINE: SPE Position */ -#define UART_LINE_SPE_Msk (0x1ul << UART_LINE_SPE_Pos) /*!< UART_T::LINE: SPE Mask */ - -#define UART_LINE_BCB_Pos (6) /*!< UART_T::LINE: BCB Position */ -#define UART_LINE_BCB_Msk (0x1ul << UART_LINE_BCB_Pos) /*!< UART_T::LINE: BCB Mask */ - -#define UART_LINE_PSS_Pos (7) /*!< UART_T::LINE: PSS Position */ -#define UART_LINE_PSS_Msk (0x1ul << UART_LINE_PSS_Pos) /*!< UART_T::LINE: PSS Mask */ - -#define UART_LINE_TXDINV_Pos (8) /*!< UART_T::LINE: TXDINV Position */ -#define UART_LINE_TXDINV_Msk (0x1ul << UART_LINE_TXDINV_Pos) /*!< UART_T::LINE: TXDINV Mask */ - -#define UART_LINE_RXDINV_Pos (9) /*!< UART_T::LINE: RXDINV Position */ -#define UART_LINE_RXDINV_Msk (0x1ul << UART_LINE_RXDINV_Pos) /*!< UART_T::LINE: RXDINV Mask */ - -#define UART_MODEM_RTS_Pos (1) /*!< UART_T::MODEM: RTS Position */ -#define UART_MODEM_RTS_Msk (0x1ul << UART_MODEM_RTS_Pos) /*!< UART_T::MODEM: RTS Mask */ - -#define UART_MODEM_RTSACTLV_Pos (9) /*!< UART_T::MODEM: RTSACTLV Position */ -#define UART_MODEM_RTSACTLV_Msk (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< UART_T::MODEM: RTSACTLV Mask */ - -#define UART_MODEM_RTSSTS_Pos (13) /*!< UART_T::MODEM: RTSSTS Position */ -#define UART_MODEM_RTSSTS_Msk (0x1ul << UART_MODEM_RTSSTS_Pos) /*!< UART_T::MODEM: RTSSTS Mask */ - -#define UART_MODEMSTS_CTSDETF_Pos (0) /*!< UART_T::MODEMSTS: CTSDETF Position */ -#define UART_MODEMSTS_CTSDETF_Msk (0x1ul << UART_MODEMSTS_CTSDETF_Pos) /*!< UART_T::MODEMSTS: CTSDETF Mask */ - -#define UART_MODEMSTS_CTSSTS_Pos (4) /*!< UART_T::MODEMSTS: CTSSTS Position */ -#define UART_MODEMSTS_CTSSTS_Msk (0x1ul << UART_MODEMSTS_CTSSTS_Pos) /*!< UART_T::MODEMSTS: CTSSTS Mask */ - -#define UART_MODEMSTS_CTSACTLV_Pos (8) /*!< UART_T::MODEMSTS: CTSACTLV Position */ -#define UART_MODEMSTS_CTSACTLV_Msk (0x1ul << UART_MODEMSTS_CTSACTLV_Pos) /*!< UART_T::MODEMSTS: CTSACTLV Mask */ - -#define UART_FIFOSTS_RXOVIF_Pos (0) /*!< UART_T::FIFOSTS: RXOVIF Position */ -#define UART_FIFOSTS_RXOVIF_Msk (0x1ul << UART_FIFOSTS_RXOVIF_Pos) /*!< UART_T::FIFOSTS: RXOVIF Mask */ - -#define UART_FIFOSTS_ABRDIF_Pos (1) /*!< UART_T::FIFOSTS: ABRDIF Position */ -#define UART_FIFOSTS_ABRDIF_Msk (0x1ul << UART_FIFOSTS_ABRDIF_Pos) /*!< UART_T::FIFOSTS: ABRDIF Mask */ - -#define UART_FIFOSTS_ABRDTOIF_Pos (2) /*!< UART_T::FIFOSTS: ABRDTOIF Position */ -#define UART_FIFOSTS_ABRDTOIF_Msk (0x1ul << UART_FIFOSTS_ABRDTOIF_Pos) /*!< UART_T::FIFOSTS: ABRDTOIF Mask */ - -#define UART_FIFOSTS_ADDRDETF_Pos (3) /*!< UART_T::FIFOSTS: ADDRDETF Position */ -#define UART_FIFOSTS_ADDRDETF_Msk (0x1ul << UART_FIFOSTS_ADDRDETF_Pos) /*!< UART_T::FIFOSTS: ADDRDETF Mask */ - -#define UART_FIFOSTS_PEF_Pos (4) /*!< UART_T::FIFOSTS: PEF Position */ -#define UART_FIFOSTS_PEF_Msk (0x1ul << UART_FIFOSTS_PEF_Pos) /*!< UART_T::FIFOSTS: PEF Mask */ - -#define UART_FIFOSTS_FEF_Pos (5) /*!< UART_T::FIFOSTS: FEF Position */ -#define UART_FIFOSTS_FEF_Msk (0x1ul << UART_FIFOSTS_FEF_Pos) /*!< UART_T::FIFOSTS: FEF Mask */ - -#define UART_FIFOSTS_BIF_Pos (6) /*!< UART_T::FIFOSTS: BIF Position */ -#define UART_FIFOSTS_BIF_Msk (0x1ul << UART_FIFOSTS_BIF_Pos) /*!< UART_T::FIFOSTS: BIF Mask */ - -#define UART_FIFOSTS_RXPTR_Pos (8) /*!< UART_T::FIFOSTS: RXPTR Position */ -#define UART_FIFOSTS_RXPTR_Msk (0x3ful << UART_FIFOSTS_RXPTR_Pos) /*!< UART_T::FIFOSTS: RXPTR Mask */ - -#define UART_FIFOSTS_RXEMPTY_Pos (14) /*!< UART_T::FIFOSTS: RXEMPTY Position */ -#define UART_FIFOSTS_RXEMPTY_Msk (0x1ul << UART_FIFOSTS_RXEMPTY_Pos) /*!< UART_T::FIFOSTS: RXEMPTY Mask */ - -#define UART_FIFOSTS_RXFULL_Pos (15) /*!< UART_T::FIFOSTS: RXFULL Position */ -#define UART_FIFOSTS_RXFULL_Msk (0x1ul << UART_FIFOSTS_RXFULL_Pos) /*!< UART_T::FIFOSTS: RXFULL Mask */ - -#define UART_FIFOSTS_TXPTR_Pos (16) /*!< UART_T::FIFOSTS: TXPTR Position */ -#define UART_FIFOSTS_TXPTR_Msk (0x3ful << UART_FIFOSTS_TXPTR_Pos) /*!< UART_T::FIFOSTS: TXPTR Mask */ - -#define UART_FIFOSTS_TXEMPTY_Pos (22) /*!< UART_T::FIFOSTS: TXEMPTY Position */ -#define UART_FIFOSTS_TXEMPTY_Msk (0x1ul << UART_FIFOSTS_TXEMPTY_Pos) /*!< UART_T::FIFOSTS: TXEMPTY Mask */ - -#define UART_FIFOSTS_TXFULL_Pos (23) /*!< UART_T::FIFOSTS: TXFULL Position */ -#define UART_FIFOSTS_TXFULL_Msk (0x1ul << UART_FIFOSTS_TXFULL_Pos) /*!< UART_T::FIFOSTS: TXFULL Mask */ - -#define UART_FIFOSTS_TXOVIF_Pos (24) /*!< UART_T::FIFOSTS: TXOVIF Position */ -#define UART_FIFOSTS_TXOVIF_Msk (0x1ul << UART_FIFOSTS_TXOVIF_Pos) /*!< UART_T::FIFOSTS: TXOVIF Mask */ - -#define UART_FIFOSTS_TXEMPTYF_Pos (28) /*!< UART_T::FIFOSTS: TXEMPTYF Position */ -#define UART_FIFOSTS_TXEMPTYF_Msk (0x1ul << UART_FIFOSTS_TXEMPTYF_Pos) /*!< UART_T::FIFOSTS: TXEMPTYF Mask */ - -#define UART_FIFOSTS_RXIDLE_Pos (29) /*!< UART_T::FIFOSTS: RXIDLE Position */ -#define UART_FIFOSTS_RXIDLE_Msk (0x1ul << UART_FIFOSTS_RXIDLE_Pos) /*!< UART_T::FIFOSTS: RXIDLE Mask */ - -#define UART_FIFOSTS_TXRXACT_Pos (31) /*!< UART_T::FIFOSTS: TXRXACT Position */ -#define UART_FIFOSTS_TXRXACT_Msk (0x1ul << UART_FIFOSTS_TXRXACT_Pos) /*!< UART_T::FIFOSTS: TXRXACT Mask */ - -#define UART_INTSTS_RDAIF_Pos (0) /*!< UART_T::INTSTS: RDAIF Position */ -#define UART_INTSTS_RDAIF_Msk (0x1ul << UART_INTSTS_RDAIF_Pos) /*!< UART_T::INTSTS: RDAIF Mask */ - -#define UART_INTSTS_THREIF_Pos (1) /*!< UART_T::INTSTS: THREIF Position */ -#define UART_INTSTS_THREIF_Msk (0x1ul << UART_INTSTS_THREIF_Pos) /*!< UART_T::INTSTS: THREIF Mask */ - -#define UART_INTSTS_RLSIF_Pos (2) /*!< UART_T::INTSTS: RLSIF Position */ -#define UART_INTSTS_RLSIF_Msk (0x1ul << UART_INTSTS_RLSIF_Pos) /*!< UART_T::INTSTS: RLSIF Mask */ - -#define UART_INTSTS_MODEMIF_Pos (3) /*!< UART_T::INTSTS: MODEMIF Position */ -#define UART_INTSTS_MODEMIF_Msk (0x1ul << UART_INTSTS_MODEMIF_Pos) /*!< UART_T::INTSTS: MODEMIF Mask */ - -#define UART_INTSTS_RXTOIF_Pos (4) /*!< UART_T::INTSTS: RXTOIF Position */ -#define UART_INTSTS_RXTOIF_Msk (0x1ul << UART_INTSTS_RXTOIF_Pos) /*!< UART_T::INTSTS: RXTOIF Mask */ - -#define UART_INTSTS_BUFERRIF_Pos (5) /*!< UART_T::INTSTS: BUFERRIF Position */ -#define UART_INTSTS_BUFERRIF_Msk (0x1ul << UART_INTSTS_BUFERRIF_Pos) /*!< UART_T::INTSTS: BUFERRIF Mask */ - -#define UART_INTSTS_WKIF_Pos (6) /*!< UART_T::INTSTS: WKIF Position */ -#define UART_INTSTS_WKIF_Msk (0x1ul << UART_INTSTS_WKIF_Pos) /*!< UART_T::INTSTS: WKIF Mask */ - -#define UART_INTSTS_LINIF_Pos (7) /*!< UART_T::INTSTS: LINIF Position */ -#define UART_INTSTS_LINIF_Msk (0x1ul << UART_INTSTS_LINIF_Pos) /*!< UART_T::INTSTS: LINIF Mask */ - -#define UART_INTSTS_RDAINT_Pos (8) /*!< UART_T::INTSTS: RDAINT Position */ -#define UART_INTSTS_RDAINT_Msk (0x1ul << UART_INTSTS_RDAINT_Pos) /*!< UART_T::INTSTS: RDAINT Mask */ - -#define UART_INTSTS_THREINT_Pos (9) /*!< UART_T::INTSTS: THREINT Position */ -#define UART_INTSTS_THREINT_Msk (0x1ul << UART_INTSTS_THREINT_Pos) /*!< UART_T::INTSTS: THREINT Mask */ - -#define UART_INTSTS_RLSINT_Pos (10) /*!< UART_T::INTSTS: RLSINT Position */ -#define UART_INTSTS_RLSINT_Msk (0x1ul << UART_INTSTS_RLSINT_Pos) /*!< UART_T::INTSTS: RLSINT Mask */ - -#define UART_INTSTS_MODEMINT_Pos (11) /*!< UART_T::INTSTS: MODEMINT Position */ -#define UART_INTSTS_MODEMINT_Msk (0x1ul << UART_INTSTS_MODEMINT_Pos) /*!< UART_T::INTSTS: MODEMINT Mask */ - -#define UART_INTSTS_RXTOINT_Pos (12) /*!< UART_T::INTSTS: RXTOINT Position */ -#define UART_INTSTS_RXTOINT_Msk (0x1ul << UART_INTSTS_RXTOINT_Pos) /*!< UART_T::INTSTS: RXTOINT Mask */ - -#define UART_INTSTS_BUFERRINT_Pos (13) /*!< UART_T::INTSTS: BUFERRINT Position */ -#define UART_INTSTS_BUFERRINT_Msk (0x1ul << UART_INTSTS_BUFERRINT_Pos) /*!< UART_T::INTSTS: BUFERRINT Mask */ - -#define UART_INTSTS_WKINT_Pos (14) /*!< UART_T::INTSTS: WKINT Position */ -#define UART_INTSTS_WKINT_Msk (0x1ul << UART_INTSTS_WKINT_Pos) /*!< UART_T::INTSTS: WKINT Mask */ - -#define UART_INTSTS_LININT_Pos (15) /*!< UART_T::INTSTS: LININT Position */ -#define UART_INTSTS_LININT_Msk (0x1ul << UART_INTSTS_LININT_Pos) /*!< UART_T::INTSTS: LININT Mask */ - -#define UART_INTSTS_SWBEIF_Pos (16) /*!< UART_T::INTSTS: SWBEIF Position */ -#define UART_INTSTS_SWBEIF_Msk (0x1ul << UART_INTSTS_SWBEIF_Pos) /*!< UART_T::INTSTS: SWBEIF Mask */ - -#define UART_INTSTS_HWRLSIF_Pos (18) /*!< UART_T::INTSTS: HWRLSIF Position */ -#define UART_INTSTS_HWRLSIF_Msk (0x1ul << UART_INTSTS_HWRLSIF_Pos) /*!< UART_T::INTSTS: HWRLSIF Mask */ - -#define UART_INTSTS_HWMODIF_Pos (19) /*!< UART_T::INTSTS: HWMODIF Position */ -#define UART_INTSTS_HWMODIF_Msk (0x1ul << UART_INTSTS_HWMODIF_Pos) /*!< UART_T::INTSTS: HWMODIF Mask */ - -#define UART_INTSTS_HWTOIF_Pos (20) /*!< UART_T::INTSTS: HWTOIF Position */ -#define UART_INTSTS_HWTOIF_Msk (0x1ul << UART_INTSTS_HWTOIF_Pos) /*!< UART_T::INTSTS: HWTOIF Mask */ - -#define UART_INTSTS_HWBUFEIF_Pos (21) /*!< UART_T::INTSTS: HWBUFEIF Position */ -#define UART_INTSTS_HWBUFEIF_Msk (0x1ul << UART_INTSTS_HWBUFEIF_Pos) /*!< UART_T::INTSTS: HWBUFEIF Mask */ - -#define UART_INTSTS_TXENDIF_Pos (22) /*!< UART_T::INTSTS: TXENDIF Position */ -#define UART_INTSTS_TXENDIF_Msk (0x1ul << UART_INTSTS_TXENDIF_Pos) /*!< UART_T::INTSTS: TXENDIF Mask */ - -#define UART_INTSTS_TXENDIF_Pos (22) /*!< UART_T::INTSTS: TXENDIF Position */ -#define UART_INTSTS_TXENDIF_Msk (0x1ul << UART_INTSTS_TXENDIF_Pos) /*!< UART_T::INTSTS: TXENDIF Mask */ - -#define UART_INTSTS_SWBEINT_Pos (24) /*!< UART_T::INTSTS: SWBEINT Position */ -#define UART_INTSTS_SWBEINT_Msk (0x1ul << UART_INTSTS_SWBEINT_Pos) /*!< UART_T::INTSTS: SWBEINT Mask */ - -#define UART_INTSTS_HWRLSINT_Pos (26) /*!< UART_T::INTSTS: HWRLSINT Position */ -#define UART_INTSTS_HWRLSINT_Msk (0x1ul << UART_INTSTS_HWRLSINT_Pos) /*!< UART_T::INTSTS: HWRLSINT Mask */ - -#define UART_INTSTS_HWMODINT_Pos (27) /*!< UART_T::INTSTS: HWMODINT Position */ -#define UART_INTSTS_HWMODINT_Msk (0x1ul << UART_INTSTS_HWMODINT_Pos) /*!< UART_T::INTSTS: HWMODINT Mask */ - -#define UART_INTSTS_HWTOINT_Pos (28) /*!< UART_T::INTSTS: HWTOINT Position */ -#define UART_INTSTS_HWTOINT_Msk (0x1ul << UART_INTSTS_HWTOINT_Pos) /*!< UART_T::INTSTS: HWTOINT Mask */ - -#define UART_INTSTS_HWBUFEINT_Pos (29) /*!< UART_T::INTSTS: HWBUFEINT Position */ -#define UART_INTSTS_HWBUFEINT_Msk (0x1ul << UART_INTSTS_HWBUFEINT_Pos) /*!< UART_T::INTSTS: HWBUFEINT Mask */ - -#define UART_INTSTS_TXENDINT_Pos (30) /*!< UART_T::INTSTS: TXENDINT Position */ -#define UART_INTSTS_TXENDINT_Msk (0x1ul << UART_INTSTS_TXENDINT_Pos) /*!< UART_T::INTSTS: TXENDINT Mask */ - -#define UART_INTSTS_ABRINT_Pos (31) /*!< UART_T::INTSTS: ABRINT Position */ -#define UART_INTSTS_ABRINT_Msk (0x1ul << UART_INTSTS_ABRINT_Pos) /*!< UART_T::INTSTS: ABRINT Mask */ - -#define UART_TOUT_TOIC_Pos (0) /*!< UART_T::TOUT: TOIC Position */ -#define UART_TOUT_TOIC_Msk (0xfful << UART_TOUT_TOIC_Pos) /*!< UART_T::TOUT: TOIC Mask */ - -#define UART_TOUT_DLY_Pos (8) /*!< UART_T::TOUT: DLY Position */ -#define UART_TOUT_DLY_Msk (0xfful << UART_TOUT_DLY_Pos) /*!< UART_T::TOUT: DLY Mask */ - -#define UART_BAUD_BRD_Pos (0) /*!< UART_T::BAUD: BRD Position */ -#define UART_BAUD_BRD_Msk (0xfffful << UART_BAUD_BRD_Pos) /*!< UART_T::BAUD: BRD Mask */ - -#define UART_BAUD_EDIVM1_Pos (24) /*!< UART_T::BAUD: EDIVM1 Position */ -#define UART_BAUD_EDIVM1_Msk (0xful << UART_BAUD_EDIVM1_Pos) /*!< UART_T::BAUD: EDIVM1 Mask */ - -#define UART_BAUD_BAUDM0_Pos (28) /*!< UART_T::BAUD: BAUDM0 Position */ -#define UART_BAUD_BAUDM0_Msk (0x1ul << UART_BAUD_BAUDM0_Pos) /*!< UART_T::BAUD: BAUDM0 Mask */ - -#define UART_BAUD_BAUDM1_Pos (29) /*!< UART_T::BAUD: BAUDM1 Position */ -#define UART_BAUD_BAUDM1_Msk (0x1ul << UART_BAUD_BAUDM1_Pos) /*!< UART_T::BAUD: BAUDM1 Mask */ - -#define UART_IRDA_TXEN_Pos (1) /*!< UART_T::IRDA: TXEN Position */ -#define UART_IRDA_TXEN_Msk (0x1ul << UART_IRDA_TXEN_Pos) /*!< UART_T::IRDA: TXEN Mask */ - -#define UART_IRDA_TXINV_Pos (5) /*!< UART_T::IRDA: TXINV Position */ -#define UART_IRDA_TXINV_Msk (0x1ul << UART_IRDA_TXINV_Pos) /*!< UART_T::IRDA: TXINV Mask */ - -#define UART_IRDA_RXINV_Pos (6) /*!< UART_T::IRDA: RXINV Position */ -#define UART_IRDA_RXINV_Msk (0x1ul << UART_IRDA_RXINV_Pos) /*!< UART_T::IRDA: RXINV Mask */ - -#define UART_ALTCTL_BRKFL_Pos (0) /*!< UART_T::ALTCTL: BRKFL Position */ -#define UART_ALTCTL_BRKFL_Msk (0xful << UART_ALTCTL_BRKFL_Pos) /*!< UART_T::ALTCTL: BRKFL Mask */ - -#define UART_ALTCTL_LINRXEN_Pos (6) /*!< UART_T::ALTCTL: LINRXEN Position */ -#define UART_ALTCTL_LINRXEN_Msk (0x1ul << UART_ALTCTL_LINRXEN_Pos) /*!< UART_T::ALTCTL: LINRXEN Mask */ - -#define UART_ALTCTL_LINTXEN_Pos (7) /*!< UART_T::ALTCTL: LINTXEN Position */ -#define UART_ALTCTL_LINTXEN_Msk (0x1ul << UART_ALTCTL_LINTXEN_Pos) /*!< UART_T::ALTCTL: LINTXEN Mask */ - -#define UART_ALTCTL_RS485NMM_Pos (8) /*!< UART_T::ALTCTL: RS485NMM Position */ -#define UART_ALTCTL_RS485NMM_Msk (0x1ul << UART_ALTCTL_RS485NMM_Pos) /*!< UART_T::ALTCTL: RS485NMM Mask */ - -#define UART_ALTCTL_RS485AAD_Pos (9) /*!< UART_T::ALTCTL: RS485AAD Position */ -#define UART_ALTCTL_RS485AAD_Msk (0x1ul << UART_ALTCTL_RS485AAD_Pos) /*!< UART_T::ALTCTL: RS485AAD Mask */ - -#define UART_ALTCTL_RS485AUD_Pos (10) /*!< UART_T::ALTCTL: RS485AUD Position */ -#define UART_ALTCTL_RS485AUD_Msk (0x1ul << UART_ALTCTL_RS485AUD_Pos) /*!< UART_T::ALTCTL: RS485AUD Mask */ - -#define UART_ALTCTL_ADDRDEN_Pos (15) /*!< UART_T::ALTCTL: ADDRDEN Position */ -#define UART_ALTCTL_ADDRDEN_Msk (0x1ul << UART_ALTCTL_ADDRDEN_Pos) /*!< UART_T::ALTCTL: ADDRDEN Mask */ - -#define UART_ALTCTL_ABRIF_Pos (17) /*!< UART_T::ALTCTL: ABRIF Position */ -#define UART_ALTCTL_ABRIF_Msk (0x1ul << UART_ALTCTL_ABRIF_Pos) /*!< UART_T::ALTCTL: ABRIF Mask */ - -#define UART_ALTCTL_ABRDEN_Pos (18) /*!< UART_T::ALTCTL: ABRDEN Position */ -#define UART_ALTCTL_ABRDEN_Msk (0x1ul << UART_ALTCTL_ABRDEN_Pos) /*!< UART_T::ALTCTL: ABRDEN Mask */ - -#define UART_ALTCTL_ABRDBITS_Pos (19) /*!< UART_T::ALTCTL: ABRDBITS Position */ -#define UART_ALTCTL_ABRDBITS_Msk (0x3ul << UART_ALTCTL_ABRDBITS_Pos) /*!< UART_T::ALTCTL: ABRDBITS Mask */ - -#define UART_ALTCTL_ADDRMV_Pos (24) /*!< UART_T::ALTCTL: ADDRMV Position */ -#define UART_ALTCTL_ADDRMV_Msk (0xfful << UART_ALTCTL_ADDRMV_Pos) /*!< UART_T::ALTCTL: ADDRMV Mask */ - -#define UART_FUNCSEL_FUNCSEL_Pos (0) /*!< UART_T::FUNCSEL: FUNCSEL Position */ -#define UART_FUNCSEL_FUNCSEL_Msk (0x7ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_T::FUNCSEL: FUNCSEL Mask */ - -#define UART_FUNCSEL_TXRXDIS_Pos (3) /*!< UART_T::FUNCSEL: TXRXDIS Position */ -#define UART_FUNCSEL_TXRXDIS_Msk (0x1ul << UART_FUNCSEL_TXRXDIS_Pos) /*!< UART_T::FUNCSEL: TXRXDIS Mask */ - -#define UART_FUNCSEL_DGE_Pos (6) /*!< UART_T::FUNCSEL: DGE Position */ -#define UART_FUNCSEL_DGE_Msk (0x1ul << UART_FUNCSEL_DGE_Pos) /*!< UART_T::FUNCSEL: DGE Mask */ - -#define UART_FUNCSEL_TXRXSWP_Pos (7) /*!< UART_T::FUNCSEL: TXRXSWP Position */ -#define UART_FUNCSEL_TXRXSWP_Msk (0x1ul << UART_FUNCSEL_TXRXSWP_Pos) /*!< UART_T::FUNCSEL: TXRXSWP Mask */ - -#define UART_LINCTL_SLVEN_Pos (0) /*!< UART_T::LINCTL: SLVEN Position */ -#define UART_LINCTL_SLVEN_Msk (0x1ul << UART_LINCTL_SLVEN_Pos) /*!< UART_T::LINCTL: SLVEN Mask */ - -#define UART_LINCTL_SLVHDEN_Pos (1) /*!< UART_T::LINCTL: SLVHDEN Position */ -#define UART_LINCTL_SLVHDEN_Msk (0x1ul << UART_LINCTL_SLVHDEN_Pos) /*!< UART_T::LINCTL: SLVHDEN Mask */ - -#define UART_LINCTL_SLVAREN_Pos (2) /*!< UART_T::LINCTL: SLVAREN Position */ -#define UART_LINCTL_SLVAREN_Msk (0x1ul << UART_LINCTL_SLVAREN_Pos) /*!< UART_T::LINCTL: SLVAREN Mask */ - -#define UART_LINCTL_SLVDUEN_Pos (3) /*!< UART_T::LINCTL: SLVDUEN Position */ -#define UART_LINCTL_SLVDUEN_Msk (0x1ul << UART_LINCTL_SLVDUEN_Pos) /*!< UART_T::LINCTL: SLVDUEN Mask */ - -#define UART_LINCTL_MUTE_Pos (4) /*!< UART_T::LINCTL: MUTE Position */ -#define UART_LINCTL_MUTE_Msk (0x1ul << UART_LINCTL_MUTE_Pos) /*!< UART_T::LINCTL: MUTE Mask */ - -#define UART_LINCTL_SENDH_Pos (8) /*!< UART_T::LINCTL: SENDH Position */ -#define UART_LINCTL_SENDH_Msk (0x1ul << UART_LINCTL_SENDH_Pos) /*!< UART_T::LINCTL: SENDH Mask */ - -#define UART_LINCTL_IDPEN_Pos (9) /*!< UART_T::LINCTL: IDPEN Position */ -#define UART_LINCTL_IDPEN_Msk (0x1ul << UART_LINCTL_IDPEN_Pos) /*!< UART_T::LINCTL: IDPEN Mask */ - -#define UART_LINCTL_BRKDETEN_Pos (10) /*!< UART_T::LINCTL: BRKDETEN Position */ -#define UART_LINCTL_BRKDETEN_Msk (0x1ul << UART_LINCTL_BRKDETEN_Pos) /*!< UART_T::LINCTL: BRKDETEN Mask */ - -#define UART_LINCTL_LINRXOFF_Pos (11) /*!< UART_T::LINCTL: LINRXOFF Position */ -#define UART_LINCTL_LINRXOFF_Msk (0x1ul << UART_LINCTL_LINRXOFF_Pos) /*!< UART_T::LINCTL: LINRXOFF Mask */ - -#define UART_LINCTL_BITERREN_Pos (12) /*!< UART_T::LINCTL: BITERREN Position */ -#define UART_LINCTL_BITERREN_Msk (0x1ul << UART_LINCTL_BITERREN_Pos) /*!< UART_T::LINCTL: BITERREN Mask */ - -#define UART_LINCTL_BRKFL_Pos (16) /*!< UART_T::LINCTL: BRKFL Position */ -#define UART_LINCTL_BRKFL_Msk (0xful << UART_LINCTL_BRKFL_Pos) /*!< UART_T::LINCTL: BRKFL Mask */ - -#define UART_LINCTL_BSL_Pos (20) /*!< UART_T::LINCTL: BSL Position */ -#define UART_LINCTL_BSL_Msk (0x3ul << UART_LINCTL_BSL_Pos) /*!< UART_T::LINCTL: BSL Mask */ - -#define UART_LINCTL_HSEL_Pos (22) /*!< UART_T::LINCTL: HSEL Position */ -#define UART_LINCTL_HSEL_Msk (0x3ul << UART_LINCTL_HSEL_Pos) /*!< UART_T::LINCTL: HSEL Mask */ - -#define UART_LINCTL_PID_Pos (24) /*!< UART_T::LINCTL: PID Position */ -#define UART_LINCTL_PID_Msk (0xfful << UART_LINCTL_PID_Pos) /*!< UART_T::LINCTL: PID Mask */ - -#define UART_LINSTS_SLVHDETF_Pos (0) /*!< UART_T::LINSTS: SLVHDETF Position */ -#define UART_LINSTS_SLVHDETF_Msk (0x1ul << UART_LINSTS_SLVHDETF_Pos) /*!< UART_T::LINSTS: SLVHDETF Mask */ - -#define UART_LINSTS_SLVHEF_Pos (1) /*!< UART_T::LINSTS: SLVHEF Position */ -#define UART_LINSTS_SLVHEF_Msk (0x1ul << UART_LINSTS_SLVHEF_Pos) /*!< UART_T::LINSTS: SLVHEF Mask */ - -#define UART_LINSTS_SLVIDPEF_Pos (2) /*!< UART_T::LINSTS: SLVIDPEF Position */ -#define UART_LINSTS_SLVIDPEF_Msk (0x1ul << UART_LINSTS_SLVIDPEF_Pos) /*!< UART_T::LINSTS: SLVIDPEF Mask */ - -#define UART_LINSTS_SLVSYNCF_Pos (3) /*!< UART_T::LINSTS: SLVSYNCF Position */ -#define UART_LINSTS_SLVSYNCF_Msk (0x1ul << UART_LINSTS_SLVSYNCF_Pos) /*!< UART_T::LINSTS: SLVSYNCF Mask */ - -#define UART_LINSTS_BRKDETF_Pos (8) /*!< UART_T::LINSTS: BRKDETF Position */ -#define UART_LINSTS_BRKDETF_Msk (0x1ul << UART_LINSTS_BRKDETF_Pos) /*!< UART_T::LINSTS: BRKDETF Mask */ - -#define UART_LINSTS_BITEF_Pos (9) /*!< UART_T::LINSTS: BITEF Position */ -#define UART_LINSTS_BITEF_Msk (0x1ul << UART_LINSTS_BITEF_Pos) /*!< UART_T::LINSTS: BITEF Mask */ - -#define UART_BRCOMP_BRCOMP_Pos (0) /*!< UART_T::BRCOMP: BRCOMP Position */ -#define UART_BRCOMP_BRCOMP_Msk (0x1fful << UART_BRCOMP_BRCOMP_Pos) /*!< UART_T::BRCOMP: BRCOMP Mask */ - -#define UART_BRCOMP_BRCOMPDEC_Pos (31) /*!< UART_T::BRCOMP: BRCOMPDEC Position */ -#define UART_BRCOMP_BRCOMPDEC_Msk (0x1ul << UART_BRCOMP_BRCOMPDEC_Pos) /*!< UART_T::BRCOMP: BRCOMPDEC Mask */ - -#define UART_WKCTL_WKCTSEN_Pos (0) /*!< UART_T::WKCTL: WKCTSEN Position */ -#define UART_WKCTL_WKCTSEN_Msk (0x1ul << UART_WKCTL_WKCTSEN_Pos) /*!< UART_T::WKCTL: WKCTSEN Mask */ - -#define UART_WKCTL_WKDATEN_Pos (1) /*!< UART_T::WKCTL: WKDATEN Position */ -#define UART_WKCTL_WKDATEN_Msk (0x1ul << UART_WKCTL_WKDATEN_Pos) /*!< UART_T::WKCTL: WKDATEN Mask */ - -#define UART_WKCTL_WKRFRTEN_Pos (2) /*!< UART_T::WKCTL: WKRFRTEN Position */ -#define UART_WKCTL_WKRFRTEN_Msk (0x1ul << UART_WKCTL_WKRFRTEN_Pos) /*!< UART_T::WKCTL: WKRFRTEN Mask */ - -#define UART_WKCTL_WKRS485EN_Pos (3) /*!< UART_T::WKCTL: WKRS485EN Position */ -#define UART_WKCTL_WKRS485EN_Msk (0x1ul << UART_WKCTL_WKRS485EN_Pos) /*!< UART_T::WKCTL: WKRS485EN Mask */ - -#define UART_WKCTL_WKTOUTEN_Pos (4) /*!< UART_T::WKCTL: WKTOUTEN Position */ -#define UART_WKCTL_WKTOUTEN_Msk (0x1ul << UART_WKCTL_WKTOUTEN_Pos) /*!< UART_T::WKCTL: WKTOUTEN Mask */ - -#define UART_WKSTS_CTSWKF_Pos (0) /*!< UART_T::WKSTS: CTSWKF Position */ -#define UART_WKSTS_CTSWKF_Msk (0x1ul << UART_WKSTS_CTSWKF_Pos) /*!< UART_T::WKSTS: CTSWKF Mask */ - -#define UART_WKSTS_DATWKF_Pos (1) /*!< UART_T::WKSTS: DATWKF Position */ -#define UART_WKSTS_DATWKF_Msk (0x1ul << UART_WKSTS_DATWKF_Pos) /*!< UART_T::WKSTS: DATWKF Mask */ - -#define UART_WKSTS_RFRTWKF_Pos (2) /*!< UART_T::WKSTS: RFRTWKF Position */ -#define UART_WKSTS_RFRTWKF_Msk (0x1ul << UART_WKSTS_RFRTWKF_Pos) /*!< UART_T::WKSTS: RFRTWKF Mask */ - -#define UART_WKSTS_RS485WKF_Pos (3) /*!< UART_T::WKSTS: RS485WKF Position */ -#define UART_WKSTS_RS485WKF_Msk (0x1ul << UART_WKSTS_RS485WKF_Pos) /*!< UART_T::WKSTS: RS485WKF Mask */ - -#define UART_WKSTS_TOUTWKF_Pos (4) /*!< UART_T::WKSTS: TOUTWKF Position */ -#define UART_WKSTS_TOUTWKF_Msk (0x1ul << UART_WKSTS_TOUTWKF_Pos) /*!< UART_T::WKSTS: TOUTWKF Mask */ - -#define UART_DWKCOMP_STCOMP_Pos (0) /*!< UART_T::DWKCOMP: STCOMP Position */ -#define UART_DWKCOMP_STCOMP_Msk (0xfffful << UART_DWKCOMP_STCOMP_Pos) /*!< UART_T::DWKCOMP: STCOMP Mask */ - -#define UART_RS485DD_RTSDDLY_Pos (0) /*!< UART_T::RS485DD: RTSDDLY Position */ -#define UART_RS485DD_RTSDDLY_Msk (0xfffful << UART_RS485DD_RTSDDLY_Pos) /*!< UART_T::RS485DD: RTSDDLY Mask */ - -/**@}*/ /* UART_CONST */ -/**@}*/ /* end of UART register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __UART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ui2c_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ui2c_reg.h deleted file mode 100644 index f1b2b5e6a64..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/ui2c_reg.h +++ /dev/null @@ -1,583 +0,0 @@ -/**************************************************************************//** - * @file ui2c_reg.h - * @version V1.00 - * @brief UI2C register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UI2C_REG_H__ -#define __UI2C_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UI2C I2C Mode of USCI Controller(UI2C) - Memory Mapped Structure for UI2C Controller -@{ */ - -typedef struct -{ - - - /** - * @var UI2C_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var UI2C_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK = fDIV_CLK. - * | | |01 = fSAMP_CLK = fPROT_CLK. - * | | |10 = fSAMP_CLK = fSCLK. - * | | |11 = fSAMP_CLK = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter is Disabled. - * | | |1 = Time measurement counter is Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * | | |Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(USCI_PROTCTL[6])) is enabled - * | | |The revised value is the average bit time between bit 5 and bit 6 - * | | |The user can use revised CLKDIV and new BRDETITV (USCI_PROTCTL[24:16]) to calculate the precise baud rate. - * @var UI2C_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * | | |Note: In UART protocol, the length can be configured as 6~13 bits - * | | |And in I2C protocol, the length fixed as 8 bits. - * @var UI2C_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UI2C_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note 1: In I2C protocol, RXDAT[12:8] indicate the different transmission conditions which defined in I2C. - * | | |Note 2: In UART protocol, RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (USCI_PROTSTS[7:5]). - * @var UI2C_T::DEVADDR0 - * Offset: 0x44 USCI Device Address Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note 1: The DEVADDR [9:7] must be set 3'b000 when I2C operating in 7-bit address mode. - * | | |Note 2: When software set 10'h000, the address can not be used. - * @var UI2C_T::DEVADDR1 - * Offset: 0x48 USCI Device Address Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note 1: The DEVADDR [9:7] must be set 3'000 when I2C operating in 7-bit address mode. - * | | |Note 2: When software set 10'h000, the address can not be used. - * @var UI2C_T::ADDRMSK0 - * Offset: 0x4C USCI Device Address Mask Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |USCI support multiple address recognition with two address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var UI2C_T::ADDRMSK1 - * Offset: 0x50 USCI Device Address Mask Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |USCI support multiple address recognition with two address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var UI2C_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[1] |WKADDREN |Wake-up Address Match Enable Bit - * | | |0 = The chip is woken up according data toggle. - * | | |1 = The chip is woken up according address match. - * @var UI2C_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var UI2C_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCFUNC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[1] |AA |Assert Acknowledge Control - * | | |When AA=1 prior to address or data received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line. - * |[2] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C hardware will check the bus condition if a STOP condition is detected this bit will be cleared by hardware automatically - * | | |In a slave mode, setting STO resets I2C hardware to the defined "not addressed" slave mode when bus error (USCI_PROTSTS.ERRIF = 1). - * |[3] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[4] |ADDR10EN |Address 10-bit Function Enable Bit - * | | |0 = Address match 10 bit function is disabled. - * | | |1 = Address match 10 bit function is enabled. - * |[5] |PTRG |I2C Protocol Trigger (Write Only) - * | | |When a new state is present in the USCI_PROTSTS register, if the related interrupt enable bits are set, the I2C interrupt is requested - * | | |It must write one by software to this bit after the related interrupt flags are set to 1 and the I2C protocol function will go ahead until the STOP is active or the PROTEN is disabled. - * | | |0 = I2C's stretch disabled and the I2C protocol function will go ahead. - * | | |1 = I2C's stretch active. - * |[8] |SCLOUTEN |SCL Output Enable Bit - * | | |This bit enables monitor pulling SCL to low - * | | |This monitor will pull SCL to low until it has had time to respond to an I2C interrupt. - * | | |0 = SCL output will be forced high due to open drain mechanism. - * | | |1 = I2C module may act as a slave peripheral just like in normal operation, the I2C holds the clock line low until it has had time to clear I2C interrupt. - * |[9] |MONEN |Monitor Mode Enable Bit - * | | |This bit enables monitor mode - * | | |In monitor mode the SDA output will be put in high impedance mode - * | | |This prevents the I2C module from outputting data of any kind (including ACK) onto the I2C data bus. - * | | |0 = The monitor mode is disabled. - * | | |1 = The monitor mode is enabled. - * | | |Note: Depending on the state of the SCLOUTEN bit, the SCL output may be also forced high, preventing the module from having control over the I2C clock line. - * |[25:16] |TOCNT |Time-out Clock Cycle - * | | |This bit field indicates how many clock cycle selected by TMCNTSRC (USCI_BRGEN [5]) when each interrupt flags are clear - * | | |The time-out is enable when TOCNT bigger than 0. - * | | |Note: The TMCNTSRC (USCI_BRGEN [5]) must be set zero on I2C mode. - * |[31] |PROTEN |I2C Protocol Enable Bit - * | | |0 = I2C Protocol disable. - * | | |1 = I2C Protocol enable. - * @var UI2C_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIEN |Time-out Interrupt Enable Control - * | | |In I2C protocol, this bit enables the interrupt generation in case of a time-out event. - * | | |0 = The time-out interrupt is disabled. - * | | |1 = The time-out interrupt is enabled. - * |[1] |STARIEN |Start Condition Received Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a start condition is detected. - * | | |0 = The start condition interrupt is disabled. - * | | |1 = The start condition interrupt is enabled. - * |[2] |STORIEN |Stop Condition Received Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a stop condition is detected. - * | | |0 = The stop condition interrupt is disabled. - * | | |1 = The stop condition interrupt is enabled. - * |[3] |NACKIEN |Non - Acknowledge Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a non - acknowledge is detected by a master. - * | | |0 = The non - acknowledge interrupt is disabled. - * | | |1 = The non - acknowledge interrupt is enabled. - * |[4] |ARBLOIEN |Arbitration Lost Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an arbitration lost event is detected. - * | | |0 = The arbitration lost interrupt is disabled. - * | | |1 = The arbitration lost interrupt is enabled. - * |[5] |ERRIEN |Error Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an I2C error condition is detected (indicated by ERR (USCI_PROTSTS [16])). - * | | |0 = The error interrupt is disabled. - * | | |1 = The error interrupt is enabled. - * |[6] |ACKIEN |Acknowledge Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an acknowledge is detected by a master. - * | | |0 = The acknowledge interrupt is disabled. - * | | |1 = The acknowledge interrupt is enabled. - * @var UI2C_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5] |TOIF |Time-out Interrupt Flag - * | | |0 = A time-out interrupt status has not occurred. - * | | |1 = A time-out interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit - * |[6] |ONBUSY |On Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * |[8] |STARIF |Start Condition Received Interrupt Flag - * | | |This bit indicates that a start condition or repeated start condition has been detected on master mode - * | | |However, this bit also indicates that a repeated start condition has been detected on slave mode. - * | | |A protocol interrupt can be generated if USCI_PROTCTL.STARIEN = 1. - * | | |0 = A start condition has not yet been detected. - * | | |1 = A start condition has been detected. - * | | |It is cleared by software writing one into this bit - * |[9] |STORIF |Stop Condition Received Interrupt Flag - * | | |This bit indicates that a stop condition has been detected on the I2C bus lines - * | | |A protocol interrupt can be generated if USCI_PROTCTL.STORIEN = 1. - * | | |0 = A stop condition has not yet been detected. - * | | |1 = A stop condition has been detected. - * | | |It is cleared by software writing one into this bit - * | | |Note: This bit is set when slave RX mode. - * |[10] |NACKIF |Non - Acknowledge Received Interrupt Flag - * | | |This bit indicates that a non - acknowledge has been received in master mode - * | | |A protocol interrupt can be generated if USCI_PROTCTL.NACKIEN = 1. - * | | |0 = A non - acknowledge has not been received. - * | | |1 = A non - acknowledge has been received. - * | | |It is cleared by software writing one into this bit - * |[11] |ARBLOIF |Arbitration Lost Interrupt Flag - * | | |This bit indicates that an arbitration has been lost - * | | |A protocol interrupt can be generated if USCI_PROTCTL.ARBLOIEN = 1. - * | | |0 = An arbitration has not been lost. - * | | |1 = An arbitration has been lost. - * | | |It is cleared by software writing one into this bit - * |[12] |ERRIF |Error Interrupt Flag - * | | |This bit indicates that a Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit - * | | |A protocol interrupt can be generated if USCI_PROTCTL.ERRIEN = 1. - * | | |0 = An I2C error has not been detected. - * | | |1 = An I2C error has been detected. - * | | |It is cleared by software writing one into this bit - * | | |Note: This bit is set when slave mode, user must write one into STO register to the defined "not addressed" slave mode. - * |[13] |ACKIF |Acknowledge Received Interrupt Flag - * | | |This bit indicates that an acknowledge has been received in master mode - * | | |A protocol interrupt can be generated if USCI_PROTCTL.ACKIEN = 1. - * | | |0 = An acknowledge has not been received. - * | | |1 = An acknowledge has been received. - * | | |It is cleared by software writing one into this bit - * |[14] |SLASEL |Slave Select Status - * | | |This bit indicates that this device has been selected as slave. - * | | |0 = The device is not selected as slave. - * | | |1 = The device is selected as slave. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[15] |SLAREAD |Slave Read Request Status - * | | |This bit indicates that a slave read request has been detected. - * | | |0 = A slave R/W bit is 1 has not been detected. - * | | |1 = A slave R/W bit is 1 has been detected. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[16] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release when WKUPIF is set. - * |[17] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame - * | | |0 = Write command be record on the address match wakeup frame. - * | | |1 = Read command be record on the address match wakeup frame. - * |[18] |BUSHANG |Bus Hang-up - * | | |This bit indicates bus hang-up status - * | | |There is 4-bit counter count when SCL hold high and refer fSAMP_CLK - * | | |The hang-up counter will count to overflow and set this bit when SDA is low - * | | |The counter will be reset by falling edge of SCL signal. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is hang-up status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * |[19] |ERRARBLO |Error Arbitration Lost - * | | |This bit indicates bus arbitration lost due to bigger noise which is can't be filtered by input processor - * | | |The I2C can send start condition when ERRARBLO is set - * | | |Thus this bit doesn't be cared on slave mode. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is error arbitration lost status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * @var UI2C_T::ADMAT - * Offset: 0x88 I2C Slave Match Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADMAT0 |USCI Address 0 Match Status Register - * | | |When address 0 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[1] |ADMAT1 |USCI Address 1 Match Status Register - * | | |When address 1 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * @var UI2C_T::TMCTL - * Offset: 0x8C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control Register - * | | |This field is used to generate a delay timing between SDA edge and SCL rising edge in transmission mode. - * | | |The delay setup time is numbers of peripheral clock = STCTL x fPCLK. - * |[24:16] |HTCTL |Hold Time Configure Control Register - * | | |This field is used to generate the delay timing between SCL falling edge SDA edge in - * | | |transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x fPCLK. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DEVADDR0; /*!< [0x0044] USCI Device Address Register 0 */ - __IO uint32_t DEVADDR1; /*!< [0x0048] USCI Device Address Register 1 */ - __IO uint32_t ADDRMSK0; /*!< [0x004c] USCI Device Address Mask Register 0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0050] USCI Device Address Mask Register 1 */ - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ADMAT; /*!< [0x0088] I2C Slave Match Address Register */ - __IO uint32_t TMCTL; /*!< [0x008c] I2C Timing Configure Control Register */ - -} UI2C_T; - -/** - @addtogroup UI2C_CONST UI2C Bit Field Definition - Constant Definitions for UI2C Controller -@{ */ - -#define UI2C_CTL_FUNMODE_Pos (0) /*!< UI2C_T::CTL: FUNMODE Position */ -#define UI2C_CTL_FUNMODE_Msk (0x7ul << UI2C_CTL_FUNMODE_Pos) /*!< UI2C_T::CTL: FUNMODE Mask */ - -#define UI2C_BRGEN_RCLKSEL_Pos (0) /*!< UI2C_T::BRGEN: RCLKSEL Position */ -#define UI2C_BRGEN_RCLKSEL_Msk (0x1ul << UI2C_BRGEN_RCLKSEL_Pos) /*!< UI2C_T::BRGEN: RCLKSEL Mask */ - -#define UI2C_BRGEN_PTCLKSEL_Pos (1) /*!< UI2C_T::BRGEN: PTCLKSEL Position */ -#define UI2C_BRGEN_PTCLKSEL_Msk (0x1ul << UI2C_BRGEN_PTCLKSEL_Pos) /*!< UI2C_T::BRGEN: PTCLKSEL Mask */ - -#define UI2C_BRGEN_SPCLKSEL_Pos (2) /*!< UI2C_T::BRGEN: SPCLKSEL Position */ -#define UI2C_BRGEN_SPCLKSEL_Msk (0x3ul << UI2C_BRGEN_SPCLKSEL_Pos) /*!< UI2C_T::BRGEN: SPCLKSEL Mask */ - -#define UI2C_BRGEN_TMCNTEN_Pos (4) /*!< UI2C_T::BRGEN: TMCNTEN Position */ -#define UI2C_BRGEN_TMCNTEN_Msk (0x1ul << UI2C_BRGEN_TMCNTEN_Pos) /*!< UI2C_T::BRGEN: TMCNTEN Mask */ - -#define UI2C_BRGEN_TMCNTSRC_Pos (5) /*!< UI2C_T::BRGEN: TMCNTSRC Position */ -#define UI2C_BRGEN_TMCNTSRC_Msk (0x1ul << UI2C_BRGEN_TMCNTSRC_Pos) /*!< UI2C_T::BRGEN: TMCNTSRC Mask */ - -#define UI2C_BRGEN_PDSCNT_Pos (8) /*!< UI2C_T::BRGEN: PDSCNT Position */ -#define UI2C_BRGEN_PDSCNT_Msk (0x3ul << UI2C_BRGEN_PDSCNT_Pos) /*!< UI2C_T::BRGEN: PDSCNT Mask */ - -#define UI2C_BRGEN_DSCNT_Pos (10) /*!< UI2C_T::BRGEN: DSCNT Position */ -#define UI2C_BRGEN_DSCNT_Msk (0x1ful << UI2C_BRGEN_DSCNT_Pos) /*!< UI2C_T::BRGEN: DSCNT Mask */ - -#define UI2C_BRGEN_CLKDIV_Pos (16) /*!< UI2C_T::BRGEN: CLKDIV Position */ -#define UI2C_BRGEN_CLKDIV_Msk (0x3fful << UI2C_BRGEN_CLKDIV_Pos) /*!< UI2C_T::BRGEN: CLKDIV Mask */ - -#define UI2C_LINECTL_LSB_Pos (0) /*!< UI2C_T::LINECTL: LSB Position */ -#define UI2C_LINECTL_LSB_Msk (0x1ul << UI2C_LINECTL_LSB_Pos) /*!< UI2C_T::LINECTL: LSB Mask */ - -#define UI2C_LINECTL_DWIDTH_Pos (8) /*!< UI2C_T::LINECTL: DWIDTH Position */ -#define UI2C_LINECTL_DWIDTH_Msk (0xful << UI2C_LINECTL_DWIDTH_Pos) /*!< UI2C_T::LINECTL: DWIDTH Mask */ - -#define UI2C_TXDAT_TXDAT_Pos (0) /*!< UI2C_T::TXDAT: TXDAT Position */ -#define UI2C_TXDAT_TXDAT_Msk (0xfffful << UI2C_TXDAT_TXDAT_Pos) /*!< UI2C_T::TXDAT: TXDAT Mask */ - -#define UI2C_RXDAT_RXDAT_Pos (0) /*!< UI2C_T::RXDAT: RXDAT Position */ -#define UI2C_RXDAT_RXDAT_Msk (0xfffful << UI2C_RXDAT_RXDAT_Pos) /*!< UI2C_T::RXDAT: RXDAT Mask */ - -#define UI2C_DEVADDR0_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR0: DEVADDR Position */ -#define UI2C_DEVADDR0_DEVADDR_Msk (0x3fful << UI2C_DEVADDR0_DEVADDR_Pos) /*!< UI2C_T::DEVADDR0: DEVADDR Mask */ - -#define UI2C_DEVADDR1_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR1: DEVADDR Position */ -#define UI2C_DEVADDR1_DEVADDR_Msk (0x3fful << UI2C_DEVADDR1_DEVADDR_Pos) /*!< UI2C_T::DEVADDR1: DEVADDR Mask */ - -#define UI2C_ADDRMSK0_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK0: ADDRMSK Position */ -#define UI2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK0_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define UI2C_ADDRMSK1_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK1: ADDRMSK Position */ -#define UI2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK1_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define UI2C_WKCTL_WKEN_Pos (0) /*!< UI2C_T::WKCTL: WKEN Position */ -#define UI2C_WKCTL_WKEN_Msk (0x1ul << UI2C_WKCTL_WKEN_Pos) /*!< UI2C_T::WKCTL: WKEN Mask */ - -#define UI2C_WKCTL_WKADDREN_Pos (1) /*!< UI2C_T::WKCTL: WKADDREN Position */ -#define UI2C_WKCTL_WKADDREN_Msk (0x1ul << UI2C_WKCTL_WKADDREN_Pos) /*!< UI2C_T::WKCTL: WKADDREN Mask */ - -#define UI2C_WKSTS_WKF_Pos (0) /*!< UI2C_T::WKSTS: WKF Position */ -#define UI2C_WKSTS_WKF_Msk (0x1ul << UI2C_WKSTS_WKF_Pos) /*!< UI2C_T::WKSTS: WKF Mask */ - -#define UI2C_PROTCTL_GCFUNC_Pos (0) /*!< UI2C_T::PROTCTL: GCFUNC Position */ -#define UI2C_PROTCTL_GCFUNC_Msk (0x1ul << UI2C_PROTCTL_GCFUNC_Pos) /*!< UI2C_T::PROTCTL: GCFUNC Mask */ - -#define UI2C_PROTCTL_AA_Pos (1) /*!< UI2C_T::PROTCTL: AA Position */ -#define UI2C_PROTCTL_AA_Msk (0x1ul << UI2C_PROTCTL_AA_Pos) /*!< UI2C_T::PROTCTL: AA Mask */ - -#define UI2C_PROTCTL_STO_Pos (2) /*!< UI2C_T::PROTCTL: STO Position */ -#define UI2C_PROTCTL_STO_Msk (0x1ul << UI2C_PROTCTL_STO_Pos) /*!< UI2C_T::PROTCTL: STO Mask */ - -#define UI2C_PROTCTL_STA_Pos (3) /*!< UI2C_T::PROTCTL: STA Position */ -#define UI2C_PROTCTL_STA_Msk (0x1ul << UI2C_PROTCTL_STA_Pos) /*!< UI2C_T::PROTCTL: STA Mask */ - -#define UI2C_PROTCTL_ADDR10EN_Pos (4) /*!< UI2C_T::PROTCTL: ADDR10EN Position */ -#define UI2C_PROTCTL_ADDR10EN_Msk (0x1ul << UI2C_PROTCTL_ADDR10EN_Pos) /*!< UI2C_T::PROTCTL: ADDR10EN Mask */ - -#define UI2C_PROTCTL_PTRG_Pos (5) /*!< UI2C_T::PROTCTL: PTRG Position */ -#define UI2C_PROTCTL_PTRG_Msk (0x1ul << UI2C_PROTCTL_PTRG_Pos) /*!< UI2C_T::PROTCTL: PTRG Mask */ - -#define UI2C_PROTCTL_SCLOUTEN_Pos (8) /*!< UI2C_T::PROTCTL: SCLOUTEN Position */ -#define UI2C_PROTCTL_SCLOUTEN_Msk (0x1ul << UI2C_PROTCTL_SCLOUTEN_Pos) /*!< UI2C_T::PROTCTL: SCLOUTEN Mask */ - -#define UI2C_PROTCTL_MONEN_Pos (9) /*!< UI2C_T::PROTCTL: MONEN Position */ -#define UI2C_PROTCTL_MONEN_Msk (0x1ul << UI2C_PROTCTL_MONEN_Pos) /*!< UI2C_T::PROTCTL: MONEN Mask */ - -#define UI2C_PROTCTL_TOCNT_Pos (16) /*!< UI2C_T::PROTCTL: TOCNT Position */ -#define UI2C_PROTCTL_TOCNT_Msk (0x3fful << UI2C_PROTCTL_TOCNT_Pos) /*!< UI2C_T::PROTCTL: TOCNT Mask */ - -#define UI2C_PROTCTL_PROTEN_Pos (31) /*!< UI2C_T::PROTCTL: PROTEN Position */ -#define UI2C_PROTCTL_PROTEN_Msk (0x1ul << UI2C_PROTCTL_PROTEN_Pos) /*!< UI2C_T::PROTCTL: PROTEN Mask */ - -#define UI2C_PROTIEN_TOIEN_Pos (0) /*!< UI2C_T::PROTIEN: TOIEN Position */ -#define UI2C_PROTIEN_TOIEN_Msk (0x1ul << UI2C_PROTIEN_TOIEN_Pos) /*!< UI2C_T::PROTIEN: TOIEN Mask */ - -#define UI2C_PROTIEN_STARIEN_Pos (1) /*!< UI2C_T::PROTIEN: STARIEN Position */ -#define UI2C_PROTIEN_STARIEN_Msk (0x1ul << UI2C_PROTIEN_STARIEN_Pos) /*!< UI2C_T::PROTIEN: STARIEN Mask */ - -#define UI2C_PROTIEN_STORIEN_Pos (2) /*!< UI2C_T::PROTIEN: STORIEN Position */ -#define UI2C_PROTIEN_STORIEN_Msk (0x1ul << UI2C_PROTIEN_STORIEN_Pos) /*!< UI2C_T::PROTIEN: STORIEN Mask */ - -#define UI2C_PROTIEN_NACKIEN_Pos (3) /*!< UI2C_T::PROTIEN: NACKIEN Position */ -#define UI2C_PROTIEN_NACKIEN_Msk (0x1ul << UI2C_PROTIEN_NACKIEN_Pos) /*!< UI2C_T::PROTIEN: NACKIEN Mask */ - -#define UI2C_PROTIEN_ARBLOIEN_Pos (4) /*!< UI2C_T::PROTIEN: ARBLOIEN Position */ -#define UI2C_PROTIEN_ARBLOIEN_Msk (0x1ul << UI2C_PROTIEN_ARBLOIEN_Pos) /*!< UI2C_T::PROTIEN: ARBLOIEN Mask */ - -#define UI2C_PROTIEN_ERRIEN_Pos (5) /*!< UI2C_T::PROTIEN: ERRIEN Position */ -#define UI2C_PROTIEN_ERRIEN_Msk (0x1ul << UI2C_PROTIEN_ERRIEN_Pos) /*!< UI2C_T::PROTIEN: ERRIEN Mask */ - -#define UI2C_PROTIEN_ACKIEN_Pos (6) /*!< UI2C_T::PROTIEN: ACKIEN Position */ -#define UI2C_PROTIEN_ACKIEN_Msk (0x1ul << UI2C_PROTIEN_ACKIEN_Pos) /*!< UI2C_T::PROTIEN: ACKIEN Mask */ - -#define UI2C_PROTSTS_TOIF_Pos (5) /*!< UI2C_T::PROTSTS: TOIF Position */ -#define UI2C_PROTSTS_TOIF_Msk (0x1ul << UI2C_PROTSTS_TOIF_Pos) /*!< UI2C_T::PROTSTS: TOIF Mask */ - -#define UI2C_PROTSTS_ONBUSY_Pos (6) /*!< UI2C_T::PROTSTS: ONBUSY Position */ -#define UI2C_PROTSTS_ONBUSY_Msk (0x1ul << UI2C_PROTSTS_ONBUSY_Pos) /*!< UI2C_T::PROTSTS: ONBUSY Mask */ - -#define UI2C_PROTSTS_STARIF_Pos (8) /*!< UI2C_T::PROTSTS: STARIF Position */ -#define UI2C_PROTSTS_STARIF_Msk (0x1ul << UI2C_PROTSTS_STARIF_Pos) /*!< UI2C_T::PROTSTS: STARIF Mask */ - -#define UI2C_PROTSTS_STORIF_Pos (9) /*!< UI2C_T::PROTSTS: STORIF Position */ -#define UI2C_PROTSTS_STORIF_Msk (0x1ul << UI2C_PROTSTS_STORIF_Pos) /*!< UI2C_T::PROTSTS: STORIF Mask */ - -#define UI2C_PROTSTS_NACKIF_Pos (10) /*!< UI2C_T::PROTSTS: NACKIF Position */ -#define UI2C_PROTSTS_NACKIF_Msk (0x1ul << UI2C_PROTSTS_NACKIF_Pos) /*!< UI2C_T::PROTSTS: NACKIF Mask */ - -#define UI2C_PROTSTS_ARBLOIF_Pos (11) /*!< UI2C_T::PROTSTS: ARBLOIF Position */ -#define UI2C_PROTSTS_ARBLOIF_Msk (0x1ul << UI2C_PROTSTS_ARBLOIF_Pos) /*!< UI2C_T::PROTSTS: ARBLOIF Mask */ - -#define UI2C_PROTSTS_ERRIF_Pos (12) /*!< UI2C_T::PROTSTS: ERRIF Position */ -#define UI2C_PROTSTS_ERRIF_Msk (0x1ul << UI2C_PROTSTS_ERRIF_Pos) /*!< UI2C_T::PROTSTS: ERRIF Mask */ - -#define UI2C_PROTSTS_ACKIF_Pos (13) /*!< UI2C_T::PROTSTS: ACKIF Position */ -#define UI2C_PROTSTS_ACKIF_Msk (0x1ul << UI2C_PROTSTS_ACKIF_Pos) /*!< UI2C_T::PROTSTS: ACKIF Mask */ - -#define UI2C_PROTSTS_SLASEL_Pos (14) /*!< UI2C_T::PROTSTS: SLASEL Position */ -#define UI2C_PROTSTS_SLASEL_Msk (0x1ul << UI2C_PROTSTS_SLASEL_Pos) /*!< UI2C_T::PROTSTS: SLASEL Mask */ - -#define UI2C_PROTSTS_SLAREAD_Pos (15) /*!< UI2C_T::PROTSTS: SLAREAD Position */ -#define UI2C_PROTSTS_SLAREAD_Msk (0x1ul << UI2C_PROTSTS_SLAREAD_Pos) /*!< UI2C_T::PROTSTS: SLAREAD Mask */ - -#define UI2C_PROTSTS_WKAKDONE_Pos (16) /*!< UI2C_T::PROTSTS: WKAKDONE Position */ -#define UI2C_PROTSTS_WKAKDONE_Msk (0x1ul << UI2C_PROTSTS_WKAKDONE_Pos) /*!< UI2C_T::PROTSTS: WKAKDONE Mask */ - -#define UI2C_PROTSTS_WRSTSWK_Pos (17) /*!< UI2C_T::PROTSTS: WRSTSWK Position */ -#define UI2C_PROTSTS_WRSTSWK_Msk (0x1ul << UI2C_PROTSTS_WRSTSWK_Pos) /*!< UI2C_T::PROTSTS: WRSTSWK Mask */ - -#define UI2C_PROTSTS_BUSHANG_Pos (18) /*!< UI2C_T::PROTSTS: BUSHANG Position */ -#define UI2C_PROTSTS_BUSHANG_Msk (0x1ul << UI2C_PROTSTS_BUSHANG_Pos) /*!< UI2C_T::PROTSTS: BUSHANG Mask */ - -#define UI2C_PROTSTS_ERRARBLO_Pos (19) /*!< UI2C_T::PROTSTS: ERRARBLO Position */ -#define UI2C_PROTSTS_ERRARBLO_Msk (0x1ul << UI2C_PROTSTS_ERRARBLO_Pos) /*!< UI2C_T::PROTSTS: ERRARBLO Mask */ - -#define UI2C_ADMAT_ADMAT0_Pos (0) /*!< UI2C_T::ADMAT: ADMAT0 Position */ -#define UI2C_ADMAT_ADMAT0_Msk (0x1ul << UI2C_ADMAT_ADMAT0_Pos) /*!< UI2C_T::ADMAT: ADMAT0 Mask */ - -#define UI2C_ADMAT_ADMAT1_Pos (1) /*!< UI2C_T::ADMAT: ADMAT1 Position */ -#define UI2C_ADMAT_ADMAT1_Msk (0x1ul << UI2C_ADMAT_ADMAT1_Pos) /*!< UI2C_T::ADMAT: ADMAT1 Mask */ - -#define UI2C_TMCTL_STCTL_Pos (0) /*!< UI2C_T::TMCTL: STCTL Position */ -#define UI2C_TMCTL_STCTL_Msk (0x1fful << UI2C_TMCTL_STCTL_Pos) /*!< UI2C_T::TMCTL: STCTL Mask */ - -#define UI2C_TMCTL_HTCTL_Pos (16) /*!< UI2C_T::TMCTL: HTCTL Position */ -#define UI2C_TMCTL_HTCTL_Msk (0x1fful << UI2C_TMCTL_HTCTL_Pos) /*!< UI2C_T::TMCTL: HTCTL Mask */ - -/**@}*/ /* UI2C_CONST */ -/**@}*/ /* end of UI2C register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __UI2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbd_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbd_reg.h deleted file mode 100644 index 8bbb62e85f5..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbd_reg.h +++ /dev/null @@ -1,772 +0,0 @@ -/**************************************************************************//** - * @file usbd_reg.h - * @version V3.00 - * @brief USBD register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBD_REG_H__ -#define __USBD_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USBD USB Device Controller(USBD) - Memory Mapped Structure for USBD Controller -@{ */ - -typedef struct -{ - - /** - * @var USBD_EP_T::BUFSEG - * Offset: 0x000 Endpoint n Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |BUFSEG |Endpoint Buffer Segmentation - * | | |It is used to indicate the offset address for each endpoint with the USB SRAM starting address The effective starting address of the endpoint is - * | | |USBD_SRAM address + { BUFSEG, 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Refer to the section 7.29.5.7 for the endpoint SRAM structure and its description. - * @var USBD_EP_T::MXPLD - * Offset: 0x004 Endpoint n Maximal Payload Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |MXPLD |Maximal Payload - * | | |Define the data length which is transmitted to host (IN token) or the actual data length which is received from the host (OUT token) - * | | |It also used to indicate that the endpoint is ready to be transmitted in IN token or received in OUT token. - * | | |(1) When the register is written by CPU, - * | | |For IN token, the value of MXPLD is used to define the data length to be transmitted and indicate the data buffer is ready. - * | | |For OUT token, it means that the controller is ready to receive data from the host and the value of MXPLD is the maximal data length comes from host. - * | | |(2) When the register is read by CPU, - * | | |For IN token, the value of MXPLD is indicated by the data length be transmitted to host - * | | |For OUT token, the value of MXPLD is indicated the actual data length receiving from host. - * | | |Note: Once MXPLD is written, the data packets will be transmitted/received immediately after IN/OUT token arrived. - * @var USBD_EP_T::CFG - * Offset: 0x008 Endpoint n Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNUM |Endpoint Number - * | | |These bits are used to define the endpoint number of the current endpoint - * |[4] |ISOCH |Isochronous Endpoint - * | | |This bit is used to set the endpoint as Isochronous endpoint, no handshake. - * | | |0 = No Isochronous endpoint. - * | | |1 = Isochronous endpoint. - * |[6:5] |STATE |Endpoint STATE - * | | |00 = Endpoint is Disabled. - * | | |01 = Out endpoint. - * | | |10 = IN endpoint. - * | | |11 = Undefined. - * |[7] |DSQSYNC |Data Sequence Synchronization - * | | |0 = DATA0 PID. - * | | |1 = DATA1 PID. - * | | |Note: It is used to specify the DATA0 or DATA1 PID in the following IN token transaction - * | | |hardware will toggle automatically in IN token base on the bit. - * |[9] |CSTALL |Clear STALL Response - * | | |0 = Disable the device to clear the STALL handshake in setup stage. - * | | |1 = Clear the device to response STALL handshake in setup stage. - * @var USBD_EP_T::CFGP - * Offset: 0x00C Endpoint n Set Stall and Clear In/Out Ready Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CLRRDY |Clear Ready - * | | |When the USBD_MXPLDx register is set by user, it means that the endpoint is ready to transmit or receive data - * | | |If the user wants to disable this transaction before the transaction start, users can set this bit to 1 to disable it and it is auto clear to 0. - * | | |For IN token, write '1' to clear the IN token had ready to transmit the data to USB. - * | | |For OUT token, write '1' to clear the OUT token had ready to receive the data from USB. - * | | |This bit is write 1 only and is always 0 when it is read back. - * |[1] |SSTALL |Set STALL - * | | |0 = Disable the device to response STALL. - * | | |1 = Set the device to respond STALL automatically. - */ - __IO uint32_t BUFSEG; /*!< [0x0000] Endpoint n Buffer Segmentation Register */ - __IO uint32_t MXPLD; /*!< [0x0004] Endpoint n Maximal Payload Register */ - __IO uint32_t CFG; /*!< [0x0008] Endpoint n Configuration Register */ - __IO uint32_t CFGP; /*!< [0x000c] Endpoint n Set Stall and Clear In/Out Ready Control Register */ - -} USBD_EP_T; - -typedef struct -{ - - - /** - * @var USBD_T::INTEN - * Offset: 0x00 USB Device Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIEN |Bus Event Interrupt Enable Bit - * | | |0 = BUS event interrupt Disabled. - * | | |1 = BUS event interrupt Enabled. - * |[1] |USBIEN |USB Event Interrupt Enable Bit - * | | |0 = USB event interrupt Disabled. - * | | |1 = USB event interrupt Enabled. - * |[2] |VBDETIEN |VBUS Detection Interrupt Enable Bit - * | | |0 = VBUS detection Interrupt Disabled. - * | | |1 = VBUS detection Interrupt Enabled. - * |[3] |NEVWKIEN |USB No-event-wake-up Interrupt Enable Bit - * | | |0 = No-event-wake-up Interrupt Disabled. - * | | |1 = No-event-wake-up Interrupt Enabled. - * |[4] |SOFIEN |Start of Frame Interrupt Enable Bit - * | | |0 = SOF Interrupt Disabled. - * | | |1 = SOF Interrupt Enabled. - * |[8] |WKEN |Wake-up Function Enable Bit - * | | |0 = USB wake-up function Disabled. - * | | |1 = USB wake-up function Enabled. - * |[15] |INNAKEN |Active NAK Function and Its Status in IN Token - * | | |0 = When device responds NAK after receiving IN token, IN NAK status will not be updated to USBD_EPSTS0 and USBD_EPSTS1register, so that the USB interrupt event will not be asserted. - * | | |1 = IN NAK status will be updated to USBD_EPSTS0 and USBD_EPSTS1 register and the USB interrupt event will be asserted, when the device responds NAK after receiving IN token. - * @var USBD_T::INTSTS - * Offset: 0x04 USB Device Interrupt Event Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIF |BUS Interrupt Status - * | | |The BUS event means that there is one of the suspense or the resume function in the bus. - * | | |0 = No BUS event occurred. - * | | |1 = Bus event occurred; check USBD_ATTR[3:0] to know which kind of bus event was occurred, cleared by write 1 to USBD_INTSTS[0]. - * |[1] |USBIF |USB Event Interrupt Status - * | | |The USB event includes the SETUP Token, IN Token, OUT ACK, ISO IN, or ISO OUT events in the bus. - * | | |0 = No USB event occurred. - * | | |1 = USB event occurred, check EPSTS0~5[2:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[1] or EPSTS0~11 and SETUP (USBD_INTSTS[31]). - * |[2] |VBDETIF |VBUS Detection Interrupt Status - * | | |0 = There is not attached/detached event in the USB. - * | | |1 = There is attached/detached event in the USB bus and it is cleared by write 1 to USBD_INTSTS[2]. - * |[3] |NEVWKIF |No-event-wake-up Interrupt Status - * | | |0 = NEVWK event does not occur. - * | | |1 = No-event-wake-up event occurred, cleared by write 1 to USBD_INTSTS[3]. - * |[4] |SOFIF |Start of Frame Interrupt Status - * | | |0 = SOF event does not occur. - * | | |1 = SOF event occurred, cleared by write 1 to USBD_INTSTS[4]. - * |[16] |EPEVT0 |Endpoint 0's USB Event Status - * | | |0 = No event occurred in endpoint 0. - * | | |1 = USB event occurred on Endpoint 0, check USBD_EPSTS0[3:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[16] or USBD_INTSTS[1]. - * |[17] |EPEVT1 |Endpoint 1's USB Event Status - * | | |0 = No event occurred in endpoint 1. - * | | |1 = USB event occurred on Endpoint 1, check USBD_EPSTS0[7:4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[17] or USBD_INTSTS[1]. - * |[18] |EPEVT2 |Endpoint 2's USB Event Status - * | | |0 = No event occurred in endpoint 2. - * | | |1 = USB event occurred on Endpoint 2, check USBD_EPSTS0[11:8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[18] or USBD_INTSTS[1]. - * |[19] |EPEVT3 |Endpoint 3's USB Event Status - * | | |0 = No event occurred in endpoint 3. - * | | |1 = USB event occurred on Endpoint 3, check USBD_EPSTS0[15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[19] or USBD_INTSTS[1]. - * |[20] |EPEVT4 |Endpoint 4's USB Event Status - * | | |0 = No event occurred in endpoint 4. - * | | |1 = USB event occurred on Endpoint 4, check USBD_EPSTS0[19:16] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[20] or USBD_INTSTS[1]. - * |[21] |EPEVT5 |Endpoint 5's USB Event Status - * | | |0 = No event occurred in endpoint 5. - * | | |1 = USB event occurred on Endpoint 5, check USBD_EPSTS0[23:20] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[21] or USBD_INTSTS[1]. - * |[22] |EPEVT6 |Endpoint 6's USB Event Status - * | | |0 = No event occurred in endpoint 6. - * | | |1 = USB event occurred on Endpoint 6, check USBD_EPSTS0[27:24] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[22] or USBD_INTSTS[1]. - * |[23] |EPEVT7 |Endpoint 7's USB Event Status - * | | |0 = No event occurred in endpoint 7. - * | | |1 = USB event occurred on Endpoint 7, check USBD_EPSTS0[31:28] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[23] or USBD_INTSTS[1]. - * |[24] |EPEVT8 |Endpoint 8's USB Event Status - * | | |0 = No event occurred in endpoint 8. - * | | |1 = USB event occurred on Endpoint 8, check USBD_EPSTS1[3 :0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[24] or USBD_INTSTS[1]. - * |[25] |EPEVT9 |Endpoint 9's USB Event Status - * | | |0 = No event occurred in endpoint 9. - * | | |1 = USB event occurred on Endpoint 9, check USBD_EPSTS1[7 :4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[25] or USBD_INTSTS[1]. - * |[26] |EPEVT10 |Endpoint 10's USB Event Status - * | | |0 = No event occurred in endpoint 10. - * | | |1 = USB event occurred on Endpoint 10, check USBD_EPSTS1[11 :8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[26] or USBD_INTSTS[1]. - * |[27] |EPEVT11 |Endpoint 11's USB Event Status - * | | |0 = No event occurred in endpoint 11. - * | | |1 = USB event occurred on Endpoint 11, check USBD_EPSTS1[ 15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[27] or USBD_INTSTS[1]. - * |[31] |SETUP |Setup Event Status - * | | |0 = No Setup event. - * | | |1 = Setup event occurred, cleared by write 1 to USBD_INTSTS[31]. - * @var USBD_T::FADDR - * Offset: 0x08 USB Device Function Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |FADDR |USB Device Function Address - * @var USBD_T::EPSTS - * Offset: 0x0C USB Device Endpoint Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |OV |Overrun - * | | |It indicates that the received data is over the maximum payload number or not. - * | | |0 = No overrun. - * | | |1 = Out Data is more than the Max Payload in MXPLD register or the Setup Data is more than 8 Bytes. - * @var USBD_T::ATTR - * Offset: 0x10 USB Device Bus Status and Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBRST |USB Reset Status - * | | |0 = Bus no reset. - * | | |1 = Bus reset when SE0 (single-ended 0) more than 2.5us. - * | | |Note: This bit is read only. - * |[1] |SUSPEND |Suspend Status - * | | |0 = Bus no suspend. - * | | |1 = Bus idle more than 3ms, either cable is plugged off or host is sleeping. - * | | |Note: This bit is read only. - * |[2] |RESUME |Resume Status - * | | |0 = No bus resume. - * | | |1 = Resume from suspend. - * | | |Note: This bit is read only. - * |[3] |TOUT |Time-out Status - * | | |0 = No time-out. - * | | |1 = No Bus response more than 18 bits time. - * | | |Note: This bit is read only. - * |[4] |PHYEN |PHY Transceiver Function Enable Bit - * | | |0 = PHY transceiver function Disabled. - * | | |1 = PHY transceiver function Enabled. - * |[5] |RWAKEUP |Remote Wake-up - * | | |0 = Release the USB bus from K state. - * | | |1 = Force USB bus to K (USB_D+ low, USB_D-: high) state, used for remote wake-up. - * |[7] |USBEN |USB Controller Enable Bit - * | | |0 = USB Controller Disabled. - * | | |1 = USB Controller Enabled. - * |[8] |DPPUEN |Pull-up Resistor on USB_DP Enable Bit - * | | |0 = Pull-up resistor in USB_D+ bus Disabled. - * | | |1 = Pull-up resistor in USB_D+ bus Active. - * |[10] |BYTEM |CPU Access USB SRAM Size Mode Selection - * | | |0 = Word mode: The size of the transfer from CPU to USB SRAM can be Word only. - * | | |1 = Byte mode: The size of the transfer from CPU to USB SRAM can be Byte only. - * |[11] |LPMACK |LPM Token Acknowledge Enable Bit - * | | |The NYET/ACK will be returned only on a successful LPM transaction if no errors in both the EXT token and the LPM token and a valid bLinkState = 0001 (L1) is received, else ERROR and STALL will be returned automatically, respectively. - * | | |0= the valid LPM Token will be NYET. - * | | |1= the valid LPM Token will be ACK. - * |[12] |L1SUSPEND |LPM L1 Suspend - * | | |0 = Bus no L1 state suspend. - * | | |1 = This bit is set by the hardware when LPM command to enter the L1 state is successfully received and acknowledged. - * | | |Note: This bit is read only. - * |[13] |L1RESUME |LPM L1 Resume - * | | |0 = Bus no LPM L1 state resume. - * | | |1 = LPM L1 state Resume from LPM L1 state suspend. - * | | |Note: This bit is read only. - * @var USBD_T::VBUSDET - * Offset: 0x14 USB Device VBUS Detection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDET |Device VBUS Detection - * | | |0 = Controller is not attached to the USB host. - * | | |1 = Controller is attached to the USB host. - * @var USBD_T::STBUFSEG - * Offset: 0x18 SETUP Token Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |STBUFSEG |SETUP Token Buffer Segmentation - * | | |It is used to indicate the offset address for the SETUP token with the USB Device SRAM starting address The effective starting address is - * | | |USBD_SRAM address + {STBUFSEG, 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Note: It is used for SETUP token only. - * @var USBD_T::EPSTS0 - * Offset: 0x20 USB Device Endpoint Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[03:00] |EPSTS0 |Endpoint 0 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[07:04] |EPSTS1 |Endpoint 1 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[11:08] |EPSTS2 |Endpoint 2 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[15:12] |EPSTS3 |Endpoint 3 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[19:16] |EPSTS4 |Endpoint 4 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[23:20] |EPSTS5 |Endpoint 5 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[27:24] |EPSTS6 |Endpoint 6 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[31:28] |EPSTS7 |Endpoint 7 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * @var USBD_T::EPSTS1 - * Offset: 0x24 USB Device Endpoint Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPSTS8 |Endpoint 8 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[7:4] |EPSTS9 |Endpoint 9 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[11:8] |EPSTS10 |Endpoint 10 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[15:12] |EPSTS11 |Endpoint 11 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * @var USBD_T::LPMATTR - * Offset: 0x88 USB LPM Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |LPMLINKSTS|LPM Link State - * | | |These bits contain the bLinkState received with last ACK LPM Token - * |[7:4] |LPMBESL |LPM Best Effort Service Latency - * | | |These bits contain the BESL value received with last ACK LPM Token - * |[8] |LPMRWAKUP |LPM Remote Wakeup - * | | |This bit contains the bRemoteWake value received with last ACK LPM Token - * @var USBD_T::FN - * Offset: 0x8C USB Frame number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FN |Frame Number - * | | |These bits contain the 11-bits frame number in the last received SOF packet. - * @var USBD_T::SE0 - * Offset: 0x90 USB Device Drive SE0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SE0 |Drive Single Ended Zero in USB Bus - * | | |The Single Ended Zero (SE0) is when both lines (USB_D+ and USB_D-) are being pulled low. - * | | |0 = Normal operation. - * | | |1 = Force USB PHY transceiver to drive SE0. - */ - - __IO uint32_t INTEN; /*!< [0x0000] USB Device Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0004] USB Device Interrupt Event Status Register */ - __IO uint32_t FADDR; /*!< [0x0008] USB Device Function Address Register */ - __I uint32_t EPSTS; /*!< [0x000c] USB Device Endpoint Status Register */ - __IO uint32_t ATTR; /*!< [0x0010] USB Device Bus Status and Attribution Register */ - __I uint32_t VBUSDET; /*!< [0x0014] USB Device VBUS Detection Register */ - __IO uint32_t STBUFSEG; /*!< [0x0018] SETUP Token Buffer Segmentation Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t EPSTS0; /*!< [0x0020] USB Device Endpoint Status Register 0 */ - __I uint32_t EPSTS1; /*!< [0x0024] USB Device Endpoint Status Register 1 */ - __I uint32_t EPSTS2; /*!< [0x0028] USB Device Endpoint Status Register 2 */ - __I uint32_t EPSTS3; /*!< [0x002c] USB Device Endpoint Status Register 3 */ - __IO uint32_t EPINTSTS; /*!< [0x0030] USB Device Endpoint Interrupt Event Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[21]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t LPMATTR; /*!< [0x0088] USB LPM Attribution Register */ - __I uint32_t FN; /*!< [0x008c] USB Frame number Register */ - __IO uint32_t SE0; /*!< [0x0090] USB Device Drive SE0 Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[283]; - /// @endcond //HIDDEN_SYMBOLS - USBD_EP_T EP[25]; /*!< [0x500~0x68c] USB End Point 0 ~ 24 Configuration Register */ - -} USBD_T; - - -/** - @addtogroup USBD_CONST USBD Bit Field Definition - Constant Definitions for USBD Controller -@{ */ - -#define USBD_INTEN_BUSIEN_Pos (0) /*!< USBD_T::INTEN: BUSIEN Position */ -#define USBD_INTEN_BUSIEN_Msk (0x1ul << USBD_INTEN_BUSIEN_Pos) /*!< USBD_T::INTEN: BUSIEN Mask */ - -#define USBD_INTEN_USBIEN_Pos (1) /*!< USBD_T::INTEN: USBIEN Position */ -#define USBD_INTEN_USBIEN_Msk (0x1ul << USBD_INTEN_USBIEN_Pos) /*!< USBD_T::INTEN: USBIEN Mask */ - -#define USBD_INTEN_VBDETIEN_Pos (2) /*!< USBD_T::INTEN: VBDETIEN Position */ -#define USBD_INTEN_VBDETIEN_Msk (0x1ul << USBD_INTEN_VBDETIEN_Pos) /*!< USBD_T::INTEN: VBDETIEN Mask */ - -#define USBD_INTEN_NEVWKIEN_Pos (3) /*!< USBD_T::INTEN: NEVWKIEN Position */ -#define USBD_INTEN_NEVWKIEN_Msk (0x1ul << USBD_INTEN_NEVWKIEN_Pos) /*!< USBD_T::INTEN: NEVWKIEN Mask */ - -#define USBD_INTEN_SOFIEN_Pos (4) /*!< USBD_T::INTEN: SOFIEN Position */ -#define USBD_INTEN_SOFIEN_Msk (0x1ul << USBD_INTEN_SOFIEN_Pos) /*!< USBD_T::INTEN: SOFIEN Mask */ - -#define USBD_INTEN_WKEN_Pos (8) /*!< USBD_T::INTEN: WKEN Position */ -#define USBD_INTEN_WKEN_Msk (0x1ul << USBD_INTEN_WKEN_Pos) /*!< USBD_T::INTEN: WKEN Mask */ - -#define USBD_INTEN_INNAKEN_Pos (15) /*!< USBD_T::INTEN: INNAKEN Position */ -#define USBD_INTEN_INNAKEN_Msk (0x1ul << USBD_INTEN_INNAKEN_Pos) /*!< USBD_T::INTEN: INNAKEN Mask */ - -#define USBD_INTSTS_BUSIF_Pos (0) /*!< USBD_T::INTSTS: BUSIF Position */ -#define USBD_INTSTS_BUSIF_Msk (0x1ul << USBD_INTSTS_BUSIF_Pos) /*!< USBD_T::INTSTS: BUSIF Mask */ - -#define USBD_INTSTS_USBIF_Pos (1) /*!< USBD_T::INTSTS: USBIF Position */ -#define USBD_INTSTS_USBIF_Msk (0x1ul << USBD_INTSTS_USBIF_Pos) /*!< USBD_T::INTSTS: USBIF Mask */ - -#define USBD_INTSTS_VBDETIF_Pos (2) /*!< USBD_T::INTSTS: VBDETIF Position */ -#define USBD_INTSTS_VBDETIF_Msk (0x1ul << USBD_INTSTS_VBDETIF_Pos) /*!< USBD_T::INTSTS: VBDETIF Mask */ - -#define USBD_INTSTS_NEVWKIF_Pos (3) /*!< USBD_T::INTSTS: NEVWKIF Position */ -#define USBD_INTSTS_NEVWKIF_Msk (0x1ul << USBD_INTSTS_NEVWKIF_Pos) /*!< USBD_T::INTSTS: NEVWKIF Mask */ - -#define USBD_INTSTS_SOFIF_Pos (4) /*!< USBD_T::INTSTS: SOFIF Position */ -#define USBD_INTSTS_SOFIF_Msk (0x1ul << USBD_INTSTS_SOFIF_Pos) /*!< USBD_T::INTSTS: SOFIF Mask */ - -#define USBD_INTSTS_EPEVT0_Pos (16) /*!< USBD_T::INTSTS: EPEVT0 Position */ -#define USBD_INTSTS_EPEVT0_Msk (0x1ul << USBD_INTSTS_EPEVT0_Pos) /*!< USBD_T::INTSTS: EPEVT0 Mask */ - -#define USBD_INTSTS_EPEVT1_Pos (17) /*!< USBD_T::INTSTS: EPEVT1 Position */ -#define USBD_INTSTS_EPEVT1_Msk (0x1ul << USBD_INTSTS_EPEVT1_Pos) /*!< USBD_T::INTSTS: EPEVT1 Mask */ - -#define USBD_INTSTS_EPEVT2_Pos (18) /*!< USBD_T::INTSTS: EPEVT2 Position */ -#define USBD_INTSTS_EPEVT2_Msk (0x1ul << USBD_INTSTS_EPEVT2_Pos) /*!< USBD_T::INTSTS: EPEVT2 Mask */ - -#define USBD_INTSTS_EPEVT3_Pos (19) /*!< USBD_T::INTSTS: EPEVT3 Position */ -#define USBD_INTSTS_EPEVT3_Msk (0x1ul << USBD_INTSTS_EPEVT3_Pos) /*!< USBD_T::INTSTS: EPEVT3 Mask */ - -#define USBD_INTSTS_EPEVT4_Pos (20) /*!< USBD_T::INTSTS: EPEVT4 Position */ -#define USBD_INTSTS_EPEVT4_Msk (0x1ul << USBD_INTSTS_EPEVT4_Pos) /*!< USBD_T::INTSTS: EPEVT4 Mask */ - -#define USBD_INTSTS_EPEVT5_Pos (21) /*!< USBD_T::INTSTS: EPEVT5 Position */ -#define USBD_INTSTS_EPEVT5_Msk (0x1ul << USBD_INTSTS_EPEVT5_Pos) /*!< USBD_T::INTSTS: EPEVT5 Mask */ - -#define USBD_INTSTS_EPEVT6_Pos (22) /*!< USBD_T::INTSTS: EPEVT6 Position */ -#define USBD_INTSTS_EPEVT6_Msk (0x1ul << USBD_INTSTS_EPEVT6_Pos) /*!< USBD_T::INTSTS: EPEVT6 Mask */ - -#define USBD_INTSTS_EPEVT7_Pos (23) /*!< USBD_T::INTSTS: EPEVT7 Position */ -#define USBD_INTSTS_EPEVT7_Msk (0x1ul << USBD_INTSTS_EPEVT7_Pos) /*!< USBD_T::INTSTS: EPEVT7 Mask */ - -#define USBD_INTSTS_EPEVT8_Pos (24) /*!< USBD_T::INTSTS: EPEVT8 Position */ -#define USBD_INTSTS_EPEVT8_Msk (0x1ul << USBD_INTSTS_EPEVT8_Pos) /*!< USBD_T::INTSTS: EPEVT8 Mask */ - -#define USBD_INTSTS_EPEVT9_Pos (25) /*!< USBD_T::INTSTS: EPEVT9 Position */ -#define USBD_INTSTS_EPEVT9_Msk (0x1ul << USBD_INTSTS_EPEVT9_Pos) /*!< USBD_T::INTSTS: EPEVT9 Mask */ - -#define USBD_INTSTS_EPEVT10_Pos (26) /*!< USBD_T::INTSTS: EPEVT10 Position */ -#define USBD_INTSTS_EPEVT10_Msk (0x1ul << USBD_INTSTS_EPEVT10_Pos) /*!< USBD_T::INTSTS: EPEVT10 Mask */ - -#define USBD_INTSTS_EPEVT11_Pos (27) /*!< USBD_T::INTSTS: EPEVT11 Position */ -#define USBD_INTSTS_EPEVT11_Msk (0x1ul << USBD_INTSTS_EPEVT11_Pos) /*!< USBD_T::INTSTS: EPEVT11 Mask */ - -#define USBD_INTSTS_SETUP_Pos (31) /*!< USBD_T::INTSTS: SETUP Position */ -#define USBD_INTSTS_SETUP_Msk (0x1ul << USBD_INTSTS_SETUP_Pos) /*!< USBD_T::INTSTS: SETUP Mask */ - -#define USBD_FADDR_FADDR_Pos (0) /*!< USBD_T::FADDR: FADDR Position */ -#define USBD_FADDR_FADDR_Msk (0x7ful << USBD_FADDR_FADDR_Pos) /*!< USBD_T::FADDR: FADDR Mask */ - -#define USBD_EPSTS_OV_Pos (7) /*!< USBD_T::EPSTS: OV Position */ -#define USBD_EPSTS_OV_Msk (0x1ul << USBD_EPSTS_OV_Pos) /*!< USBD_T::EPSTS: OV Mask */ - -#define USBD_ATTR_USBRST_Pos (0) /*!< USBD_T::ATTR: USBRST Position */ -#define USBD_ATTR_USBRST_Msk (0x1ul << USBD_ATTR_USBRST_Pos) /*!< USBD_T::ATTR: USBRST Mask */ - -#define USBD_ATTR_SUSPEND_Pos (1) /*!< USBD_T::ATTR: SUSPEND Position */ -#define USBD_ATTR_SUSPEND_Msk (0x1ul << USBD_ATTR_SUSPEND_Pos) /*!< USBD_T::ATTR: SUSPEND Mask */ - -#define USBD_ATTR_RESUME_Pos (2) /*!< USBD_T::ATTR: RESUME Position */ -#define USBD_ATTR_RESUME_Msk (0x1ul << USBD_ATTR_RESUME_Pos) /*!< USBD_T::ATTR: RESUME Mask */ - -#define USBD_ATTR_TOUT_Pos (3) /*!< USBD_T::ATTR: TOUT Position */ -#define USBD_ATTR_TOUT_Msk (0x1ul << USBD_ATTR_TOUT_Pos) /*!< USBD_T::ATTR: TOUT Mask */ - -#define USBD_ATTR_PHYEN_Pos (4) /*!< USBD_T::ATTR: PHYEN Position */ -#define USBD_ATTR_PHYEN_Msk (0x1ul << USBD_ATTR_PHYEN_Pos) /*!< USBD_T::ATTR: PHYEN Mask */ - -#define USBD_ATTR_RWAKEUP_Pos (5) /*!< USBD_T::ATTR: RWAKEUP Position */ -#define USBD_ATTR_RWAKEUP_Msk (0x1ul << USBD_ATTR_RWAKEUP_Pos) /*!< USBD_T::ATTR: RWAKEUP Mask */ - -#define USBD_ATTR_USBEN_Pos (7) /*!< USBD_T::ATTR: USBEN Position */ -#define USBD_ATTR_USBEN_Msk (0x1ul << USBD_ATTR_USBEN_Pos) /*!< USBD_T::ATTR: USBEN Mask */ - -#define USBD_ATTR_DPPUEN_Pos (8) /*!< USBD_T::ATTR: DPPUEN Position */ -#define USBD_ATTR_DPPUEN_Msk (0x1ul << USBD_ATTR_DPPUEN_Pos) /*!< USBD_T::ATTR: DPPUEN Mask */ - -#define USBD_ATTR_BYTEM_Pos (10) /*!< USBD_T::ATTR: BYTEM Position */ -#define USBD_ATTR_BYTEM_Msk (0x1ul << USBD_ATTR_BYTEM_Pos) /*!< USBD_T::ATTR: BYTEM Mask */ - -#define USBD_ATTR_LPMACK_Pos (11) /*!< USBD_T::ATTR: LPMACK Position */ -#define USBD_ATTR_LPMACK_Msk (0x1ul << USBD_ATTR_LPMACK_Pos) /*!< USBD_T::ATTR: LPMACK Mask */ - -#define USBD_ATTR_L1SUSPEND_Pos (12) /*!< USBD_T::ATTR: L1SUSPEND Position */ -#define USBD_ATTR_L1SUSPEND_Msk (0x1ul << USBD_ATTR_L1SUSPEND_Pos) /*!< USBD_T::ATTR: L1SUSPEND Mask */ - -#define USBD_ATTR_L1RESUME_Pos (13) /*!< USBD_T::ATTR: L1RESUME Position */ -#define USBD_ATTR_L1RESUME_Msk (0x1ul << USBD_ATTR_L1RESUME_Pos) /*!< USBD_T::ATTR: L1RESUME Mask */ - -#define USBD_VBUSDET_VBUSDET_Pos (0) /*!< USBD_T::VBUSDET: VBUSDET Position */ -#define USBD_VBUSDET_VBUSDET_Msk (0x1ul << USBD_VBUSDET_VBUSDET_Pos) /*!< USBD_T::VBUSDET: VBUSDET Mask */ - -#define USBD_STBUFSEG_STBUFSEG_Pos (3) /*!< USBD_T::STBUFSEG: STBUFSEG Position */ -#define USBD_STBUFSEG_STBUFSEG_Msk (0x3ful << USBD_STBUFSEG_STBUFSEG_Pos) /*!< USBD_T::STBUFSEG: STBUFSEG Mask */ - -#define USBD_EPSTS0_EPSTS0_Pos (0) /*!< USBD_T::EPSTS0: EPSTS0 Position */ -#define USBD_EPSTS0_EPSTS0_Msk (0xful << USBD_EPSTS0_EPSTS0_Pos) /*!< USBD_T::EPSTS0: EPSTS0 Mask */ - -#define USBD_EPSTS0_EPSTS1_Pos (4) /*!< USBD_T::EPSTS0: EPSTS1 Position */ -#define USBD_EPSTS0_EPSTS1_Msk (0xful << USBD_EPSTS0_EPSTS1_Pos) /*!< USBD_T::EPSTS0: EPSTS1 Mask */ - -#define USBD_EPSTS0_EPSTS2_Pos (8) /*!< USBD_T::EPSTS0: EPSTS2 Position */ -#define USBD_EPSTS0_EPSTS2_Msk (0xful << USBD_EPSTS0_EPSTS2_Pos) /*!< USBD_T::EPSTS0: EPSTS2 Mask */ - -#define USBD_EPSTS0_EPSTS3_Pos (12) /*!< USBD_T::EPSTS0: EPSTS3 Position */ -#define USBD_EPSTS0_EPSTS3_Msk (0xful << USBD_EPSTS0_EPSTS3_Pos) /*!< USBD_T::EPSTS0: EPSTS3 Mask */ - -#define USBD_EPSTS0_EPSTS4_Pos (16) /*!< USBD_T::EPSTS0: EPSTS4 Position */ -#define USBD_EPSTS0_EPSTS4_Msk (0xful << USBD_EPSTS0_EPSTS4_Pos) /*!< USBD_T::EPSTS0: EPSTS4 Mask */ - -#define USBD_EPSTS0_EPSTS5_Pos (20) /*!< USBD_T::EPSTS0: EPSTS5 Position */ -#define USBD_EPSTS0_EPSTS5_Msk (0xful << USBD_EPSTS0_EPSTS5_Pos) /*!< USBD_T::EPSTS0: EPSTS5 Mask */ - -#define USBD_EPSTS0_EPSTS6_Pos (24) /*!< USBD_T::EPSTS0: EPSTS6 Position */ -#define USBD_EPSTS0_EPSTS6_Msk (0xful << USBD_EPSTS0_EPSTS6_Pos) /*!< USBD_T::EPSTS0: EPSTS6 Mask */ - -#define USBD_EPSTS0_EPSTS7_Pos (28) /*!< USBD_T::EPSTS0: EPSTS7 Position */ -#define USBD_EPSTS0_EPSTS7_Msk (0xful << USBD_EPSTS0_EPSTS7_Pos) /*!< USBD_T::EPSTS0: EPSTS7 Mask */ - -#define USBD_EPSTS1_EPSTS8_Pos (0) /*!< USBD_T::EPSTS1: EPSTS8 Position */ -#define USBD_EPSTS1_EPSTS8_Msk (0xful << USBD_EPSTS1_EPSTS8_Pos) /*!< USBD_T::EPSTS1: EPSTS8 Mask */ - -#define USBD_EPSTS1_EPSTS9_Pos (4) /*!< USBD_T::EPSTS1: EPSTS9 Position */ -#define USBD_EPSTS1_EPSTS9_Msk (0xful << USBD_EPSTS1_EPSTS9_Pos) /*!< USBD_T::EPSTS1: EPSTS9 Mask */ - -#define USBD_EPSTS1_EPSTS10_Pos (8) /*!< USBD_T::EPSTS1: EPSTS10 Position */ -#define USBD_EPSTS1_EPSTS10_Msk (0xful << USBD_EPSTS1_EPSTS10_Pos) /*!< USBD_T::EPSTS1: EPSTS10 Mask */ - -#define USBD_EPSTS1_EPSTS11_Pos (12) /*!< USBD_T::EPSTS1: EPSTS11 Position */ -#define USBD_EPSTS1_EPSTS11_Msk (0xful << USBD_EPSTS1_EPSTS11_Pos) /*!< USBD_T::EPSTS1: EPSTS11 Mask */ - -#define USBD_EPSTS1_EPSTS12_Pos (16) /*!< USBD_T::EPSTS1: EPSTS12 Position */ -#define USBD_EPSTS1_EPSTS12_Msk (0xful << USBD_EPSTS1_EPSTS12_Pos) /*!< USBD_T::EPSTS1: EPSTS12 Mask */ - -#define USBD_EPSTS1_EPSTS13_Pos (20) /*!< USBD_T::EPSTS1: EPSTS13 Position */ -#define USBD_EPSTS1_EPSTS13_Msk (0xful << USBD_EPSTS1_EPSTS13_Pos) /*!< USBD_T::EPSTS1: EPSTS13 Mask */ - -#define USBD_EPSTS1_EPSTS14_Pos (24) /*!< USBD_T::EPSTS1: EPSTS14 Position */ -#define USBD_EPSTS1_EPSTS14_Msk (0xful << USBD_EPSTS1_EPSTS14_Pos) /*!< USBD_T::EPSTS1: EPSTS14 Mask */ - -#define USBD_EPSTS1_EPSTS15_Pos (28) /*!< USBD_T::EPSTS1: EPSTS15 Position */ -#define USBD_EPSTS1_EPSTS15_Msk (0xful << USBD_EPSTS1_EPSTS15_Pos) /*!< USBD_T::EPSTS1: EPSTS15 Mask */ - -#define USBD_EPSTS2_EPSTS16_Pos (0) /*!< USBD_T::EPSTS2: EPSTS16 Position */ -#define USBD_EPSTS2_EPSTS16_Msk (0xful << USBD_EPSTS2_EPSTS16_Pos) /*!< USBD_T::EPSTS2: EPSTS16 Mask */ - -#define USBD_EPSTS2_EPSTS17_Pos (4) /*!< USBD_T::EPSTS2: EPSTS17 Position */ -#define USBD_EPSTS2_EPSTS17_Msk (0xful << USBD_EPSTS2_EPSTS17_Pos) /*!< USBD_T::EPSTS2: EPSTS17 Mask */ - -#define USBD_EPSTS2_EPSTS18_Pos (8) /*!< USBD_T::EPSTS2: EPSTS18 Position */ -#define USBD_EPSTS2_EPSTS18_Msk (0xful << USBD_EPSTS2_EPSTS18_Pos) /*!< USBD_T::EPSTS2: EPSTS18 Mask */ - -#define USBD_EPSTS2_EPSTS19_Pos (12) /*!< USBD_T::EPSTS2: EPSTS19 Position */ -#define USBD_EPSTS2_EPSTS19_Msk (0xful << USBD_EPSTS2_EPSTS19_Pos) /*!< USBD_T::EPSTS2: EPSTS19 Mask */ - -#define USBD_EPSTS2_EPSTS20_Pos (16) /*!< USBD_T::EPSTS2: EPSTS20 Position */ -#define USBD_EPSTS2_EPSTS20_Msk (0xful << USBD_EPSTS2_EPSTS20_Pos) /*!< USBD_T::EPSTS2: EPSTS20 Mask */ - -#define USBD_EPSTS2_EPSTS21_Pos (20) /*!< USBD_T::EPSTS2: EPSTS21 Position */ -#define USBD_EPSTS2_EPSTS21_Msk (0xful << USBD_EPSTS2_EPSTS21_Pos) /*!< USBD_T::EPSTS2: EPSTS21 Mask */ - -#define USBD_EPSTS2_EPSTS22_Pos (24) /*!< USBD_T::EPSTS2: EPSTS22 Position */ -#define USBD_EPSTS2_EPSTS22_Msk (0xful << USBD_EPSTS2_EPSTS22_Pos) /*!< USBD_T::EPSTS2: EPSTS22 Mask */ - -#define USBD_EPSTS2_EPSTS23_Pos (28) /*!< USBD_T::EPSTS2: EPSTS23 Position */ -#define USBD_EPSTS2_EPSTS23_Msk (0xful << USBD_EPSTS2_EPSTS23_Pos) /*!< USBD_T::EPSTS2: EPSTS23 Mask */ - -#define USBD_EPSTS3_EPSTS24_Pos (0) /*!< USBD_T::EPSTS3: EPSTS24 Position */ -#define USBD_EPSTS3_EPSTS24_Msk (0xful << USBD_EPSTS3_EPSTS24_Pos) /*!< USBD_T::EPSTS3: EPSTS24 Mask */ - -#define USBD_EPINTSTS_EPEVT0_Pos (0) /*!< USBD_T::EPINTSTS: EPEVT0 Position */ -#define USBD_EPINTSTS_EPEVT0_Msk (0x1ul << USBD_EPINTSTS_EPEVT0_Pos) /*!< USBD_T::EPINTSTS: EPEVT0 Mask */ - -#define USBD_EPINTSTS_EPEVT1_Pos (1) /*!< USBD_T::EPINTSTS: EPEVT1 Position */ -#define USBD_EPINTSTS_EPEVT1_Msk (0x1ul << USBD_EPINTSTS_EPEVT1_Pos) /*!< USBD_T::EPINTSTS: EPEVT1 Mask */ - -#define USBD_EPINTSTS_EPEVT2_Pos (2) /*!< USBD_T::EPINTSTS: EPEVT2 Position */ -#define USBD_EPINTSTS_EPEVT2_Msk (0x1ul << USBD_EPINTSTS_EPEVT2_Pos) /*!< USBD_T::EPINTSTS: EPEVT2 Mask */ - -#define USBD_EPINTSTS_EPEVT3_Pos (3) /*!< USBD_T::EPINTSTS: EPEVT3 Position */ -#define USBD_EPINTSTS_EPEVT3_Msk (0x1ul << USBD_EPINTSTS_EPEVT3_Pos) /*!< USBD_T::EPINTSTS: EPEVT3 Mask */ - -#define USBD_EPINTSTS_EPEVT4_Pos (4) /*!< USBD_T::EPINTSTS: EPEVT4 Position */ -#define USBD_EPINTSTS_EPEVT4_Msk (0x1ul << USBD_EPINTSTS_EPEVT4_Pos) /*!< USBD_T::EPINTSTS: EPEVT4 Mask */ - -#define USBD_EPINTSTS_EPEVT5_Pos (5) /*!< USBD_T::EPINTSTS: EPEVT5 Position */ -#define USBD_EPINTSTS_EPEVT5_Msk (0x1ul << USBD_EPINTSTS_EPEVT5_Pos) /*!< USBD_T::EPINTSTS: EPEVT5 Mask */ - -#define USBD_EPINTSTS_EPEVT6_Pos (6) /*!< USBD_T::EPINTSTS: EPEVT6 Position */ -#define USBD_EPINTSTS_EPEVT6_Msk (0x1ul << USBD_EPINTSTS_EPEVT6_Pos) /*!< USBD_T::EPINTSTS: EPEVT6 Mask */ - -#define USBD_EPINTSTS_EPEVT7_Pos (7) /*!< USBD_T::EPINTSTS: EPEVT7 Position */ -#define USBD_EPINTSTS_EPEVT7_Msk (0x1ul << USBD_EPINTSTS_EPEVT7_Pos) /*!< USBD_T::EPINTSTS: EPEVT7 Mask */ - -#define USBD_EPINTSTS_EPEVT8_Pos (8) /*!< USBD_T::EPINTSTS: EPEVT8 Position */ -#define USBD_EPINTSTS_EPEVT8_Msk (0x1ul << USBD_EPINTSTS_EPEVT8_Pos) /*!< USBD_T::EPINTSTS: EPEVT8 Mask */ - -#define USBD_EPINTSTS_EPEVT9_Pos (9) /*!< USBD_T::EPINTSTS: EPEVT9 Position */ -#define USBD_EPINTSTS_EPEVT9_Msk (0x1ul << USBD_EPINTSTS_EPEVT9_Pos) /*!< USBD_T::EPINTSTS: EPEVT9 Mask */ - -#define USBD_EPINTSTS_EPEVT10_Pos (10) /*!< USBD_T::EPINTSTS: EPEVT10 Position */ -#define USBD_EPINTSTS_EPEVT10_Msk (0x1ul << USBD_EPINTSTS_EPEVT10_Pos) /*!< USBD_T::EPINTSTS: EPEVT10 Mask */ - -#define USBD_EPINTSTS_EPEVT11_Pos (11) /*!< USBD_T::EPINTSTS: EPEVT11 Position */ -#define USBD_EPINTSTS_EPEVT11_Msk (0x1ul << USBD_EPINTSTS_EPEVT11_Pos) /*!< USBD_T::EPINTSTS: EPEVT11 Mask */ - -#define USBD_EPINTSTS_EPEVT12_Pos (12) /*!< USBD_T::EPINTSTS: EPEVT12 Position */ -#define USBD_EPINTSTS_EPEVT12_Msk (0x1ul << USBD_EPINTSTS_EPEVT12_Pos) /*!< USBD_T::EPINTSTS: EPEVT12 Mask */ - -#define USBD_EPINTSTS_EPEVT13_Pos (13) /*!< USBD_T::EPINTSTS: EPEVT13 Position */ -#define USBD_EPINTSTS_EPEVT13_Msk (0x1ul << USBD_EPINTSTS_EPEVT13_Pos) /*!< USBD_T::EPINTSTS: EPEVT13 Mask */ - -#define USBD_EPINTSTS_EPEVT14_Pos (14) /*!< USBD_T::EPINTSTS: EPEVT14 Position */ -#define USBD_EPINTSTS_EPEVT14_Msk (0x1ul << USBD_EPINTSTS_EPEVT14_Pos) /*!< USBD_T::EPINTSTS: EPEVT14 Mask */ - -#define USBD_EPINTSTS_EPEVT15_Pos (15) /*!< USBD_T::EPINTSTS: EPEVT15 Position */ -#define USBD_EPINTSTS_EPEVT15_Msk (0x1ul << USBD_EPINTSTS_EPEVT15_Pos) /*!< USBD_T::EPINTSTS: EPEVT15 Mask */ - -#define USBD_EPINTSTS_EPEVT16_Pos (16) /*!< USBD_T::EPINTSTS: EPEVT16 Position */ -#define USBD_EPINTSTS_EPEVT16_Msk (0x1ul << USBD_EPINTSTS_EPEVT16_Pos) /*!< USBD_T::EPINTSTS: EPEVT16 Mask */ - -#define USBD_EPINTSTS_EPEVT17_Pos (17) /*!< USBD_T::EPINTSTS: EPEVT17 Position */ -#define USBD_EPINTSTS_EPEVT17_Msk (0x1ul << USBD_EPINTSTS_EPEVT17_Pos) /*!< USBD_T::EPINTSTS: EPEVT17 Mask */ - -#define USBD_EPINTSTS_EPEVT18_Pos (18) /*!< USBD_T::EPINTSTS: EPEVT18 Position */ -#define USBD_EPINTSTS_EPEVT18_Msk (0x1ul << USBD_EPINTSTS_EPEVT18_Pos) /*!< USBD_T::EPINTSTS: EPEVT18 Mask */ - -#define USBD_EPINTSTS_EPEVT19_Pos (19) /*!< USBD_T::EPINTSTS: EPEVT19 Position */ -#define USBD_EPINTSTS_EPEVT19_Msk (0x1ul << USBD_EPINTSTS_EPEVT19_Pos) /*!< USBD_T::EPINTSTS: EPEVT19 Mask */ - -#define USBD_EPINTSTS_EPEVT20_Pos (20) /*!< USBD_T::EPINTSTS: EPEVT20 Position */ -#define USBD_EPINTSTS_EPEVT20_Msk (0x1ul << USBD_EPINTSTS_EPEVT20_Pos) /*!< USBD_T::EPINTSTS: EPEVT20 Mask */ - -#define USBD_EPINTSTS_EPEVT21_Pos (21) /*!< USBD_T::EPINTSTS: EPEVT21 Position */ -#define USBD_EPINTSTS_EPEVT21_Msk (0x1ul << USBD_EPINTSTS_EPEVT21_Pos) /*!< USBD_T::EPINTSTS: EPEVT21 Mask */ - -#define USBD_EPINTSTS_EPEVT22_Pos (22) /*!< USBD_T::EPINTSTS: EPEVT22 Position */ -#define USBD_EPINTSTS_EPEVT22_Msk (0x1ul << USBD_EPINTSTS_EPEVT22_Pos) /*!< USBD_T::EPINTSTS: EPEVT22 Mask */ - -#define USBD_EPINTSTS_EPEVT23_Pos (23) /*!< USBD_T::EPINTSTS: EPEVT23 Position */ -#define USBD_EPINTSTS_EPEVT23_Msk (0x1ul << USBD_EPINTSTS_EPEVT23_Pos) /*!< USBD_T::EPINTSTS: EPEVT23 Mask */ - -#define USBD_EPINTSTS_EPEVT24_Pos (24) /*!< USBD_T::EPINTSTS: EPEVT24 Position */ -#define USBD_EPINTSTS_EPEVT24_Msk (0x1ul << USBD_EPINTSTS_EPEVT24_Pos) /*!< USBD_T::EPINTSTS: EPEVT24 Mask */ - -#define USBD_LPMATTR_LPMLINKSTS_Pos (0) /*!< USBD_T::LPMATTR: LPMLINKSTS Position */ -#define USBD_LPMATTR_LPMLINKSTS_Msk (0xful << USBD_LPMATTR_LPMLINKSTS_Pos) /*!< USBD_T::LPMATTR: LPMLINKSTS Mask */ - -#define USBD_LPMATTR_LPMBESL_Pos (4) /*!< USBD_T::LPMATTR: LPMBESL Position */ -#define USBD_LPMATTR_LPMBESL_Msk (0xful << USBD_LPMATTR_LPMBESL_Pos) /*!< USBD_T::LPMATTR: LPMBESL Mask */ - -#define USBD_LPMATTR_LPMRWAKUP_Pos (8) /*!< USBD_T::LPMATTR: LPMRWAKUP Position */ -#define USBD_LPMATTR_LPMRWAKUP_Msk (0x1ul << USBD_LPMATTR_LPMRWAKUP_Pos) /*!< USBD_T::LPMATTR: LPMRWAKUP Mask */ - -#define USBD_FN_FN_Pos (0) /*!< USBD_T::FN: FN Position */ -#define USBD_FN_FN_Msk (0x7fful << USBD_FN_FN_Pos) /*!< USBD_T::FN: FN Mask */ - -#define USBD_SE0_SE0_Pos (0) /*!< USBD_T::SE0: SE0 Position */ -#define USBD_SE0_SE0_Msk (0x1ul << USBD_SE0_SE0_Pos) /*!< USBD_T::SE0: SE0 Mask */ - -#define USBD_BUFSEG_BUFSEG_Pos (3) /*!< USBD_EP_T::BUFSEG: BUFSEG Position */ -#define USBD_BUFSEG_BUFSEG_Msk (0x3ful << USBD_BUFSEG_BUFSEG_Pos) /*!< USBD_EP_T::BUFSEG: BUFSEG Mask */ - -#define USBD_MXPLD_MXPLD_Pos (0) /*!< USBD_EP_T::MXPLD: MXPLD Position */ -#define USBD_MXPLD_MXPLD_Msk (0x1fful << USBD_MXPLD_MXPLD_Pos) /*!< USBD_EP_T::MXPLD: MXPLD Mask */ - -#define USBD_CFG_EPNUM_Pos (0) /*!< USBD_EP_T::CFG: EPNUM Position */ -#define USBD_CFG_EPNUM_Msk (0xful << USBD_CFG_EPNUM_Pos) /*!< USBD_EP_T::CFG: EPNUM Mask */ - -#define USBD_CFG_ISOCH_Pos (4) /*!< USBD_EP_T::CFG: ISOCH Position */ -#define USBD_CFG_ISOCH_Msk (0x1ul << USBD_CFG_ISOCH_Pos) /*!< USBD_EP_T::CFG: ISOCH Mask */ - -#define USBD_CFG_STATE_Pos (5) /*!< USBD_EP_T::CFG: STATE Position */ -#define USBD_CFG_STATE_Msk (0x3ul << USBD_CFG_STATE_Pos) /*!< USBD_EP_T::CFG: STATE Mask */ - -#define USBD_CFG_DSQSYNC_Pos (7) /*!< USBD_EP_T::CFG: DSQSYNC Position */ -#define USBD_CFG_DSQSYNC_Msk (0x1ul << USBD_CFG_DSQSYNC_Pos) /*!< USBD_EP_T::CFG: DSQSYNC Mask */ - -#define USBD_CFG_CSTALL_Pos (9) /*!< USBD_EP_T::CFG: CSTALL Position */ -#define USBD_CFG_CSTALL_Msk (0x1ul << USBD_CFG_CSTALL_Pos) /*!< USBD_EP_T::CFG: CSTALL Mask */ - -#define USBD_CFG_DBTGACTIVE_Pos (10) /*!< USBD_EP_T::CFG: DBTGACTIVE Position */ -#define USBD_CFG_DBTGACTIVE_Msk (0x1ul << USBD_CFG_DBTGACTIVE_Pos) /*!< USBD_EP_T::CFG: DBTGACTIVE Mask */ - -#define USBD_CFG_DBEN_Pos (11) /*!< USBD_EP_T::CFG: DBEN Position */ -#define USBD_CFG_DBEN_Msk (0x1ul << USBD_CFG_DBEN_Pos) /*!< USBD_EP_T::CFG: DBEN Mask */ - -#define USBD_CFGP_CLRRDY_Pos (0) /*!< USBD_EP_T::CFGP: CLRRDY Position */ -#define USBD_CFGP_CLRRDY_Msk (0x1ul << USBD_CFGP_CLRRDY_Pos) /*!< USBD_EP_T::CFGP: CLRRDY Mask */ - -#define USBD_CFGP_SSTALL_Pos (1) /*!< USBD_EP_T::CFGP: SSTALL Position */ -#define USBD_CFGP_SSTALL_Msk (0x1ul << USBD_CFGP_SSTALL_Pos) /*!< USBD_EP_T::CFGP: SSTALL Mask */ - -/**@}*/ /* USBD_CONST */ -/**@}*/ /* end of USBD register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __USBD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbh_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbh_reg.h deleted file mode 100644 index f9ab243760d..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/usbh_reg.h +++ /dev/null @@ -1,797 +0,0 @@ -/**************************************************************************//** - * @file usbh_reg.h - * @version V1.00 - * @brief USBH register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBH_REG_H__ -#define __USBH_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USBH USB Host Controller(USBH) - Memory Mapped Structure for USBH Controller -@{ */ - -typedef struct -{ - - /** - * @var USBH_T::HcRevision - * Offset: 0x00 Host Controller Revision Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REV |Revision Number - * | | |Indicates the Open HCI Specification revision number implemented by the Hardware - * | | |Host Controller supports 1.1 specification. - * | | |(X.Y = XYh). - * @var USBH_T::HcControl - * Offset: 0x04 Host Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CBSR |Control Bulk Service Ratio - * | | |This specifies the service ratio between Control and Bulk EDs - * | | |Before processing any of the non-periodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs - * | | |The internal count will be retained when crossing the frame boundary - * | | |In case of reset, HCD is responsible for restoring this - * | | |Value. - * | | |00 = Number of Control EDs over Bulk EDs served is 1:1. - * | | |01 = Number of Control EDs over Bulk EDs served is 2:1. - * | | |10 = Number of Control EDs over Bulk EDs served is 3:1. - * | | |11 = Number of Control EDs over Bulk EDs served is 4:1. - * |[2] |PLE |Periodic List Enable Bit - * | | |When set, this bit enables processing of the Periodic (interrupt and isochronous) list - * | | |The Host Controller checks this bit prior to attempting any periodic transfers in a frame. - * | | |0 = Processing of the Periodic (Interrupt and Isochronous) list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Periodic (Interrupt and Isochronous) list in the next frame Enabled. - * | | |Note: To enable the processing of the Isochronous list, user has to set both PLE and IE (HcControl[3]) high. - * |[3] |IE |Isochronous List Enable Bit - * | | |Both ISOEn and PLE (HcControl[2]) high enables Host Controller to process the Isochronous list - * | | |Either ISOEn or PLE (HcControl[2]) is low disables Host Controller to process the Isochronous list. - * | | |0 = Processing of the Isochronous list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Isochronous list in the next frame Enabled, if the PLE (HcControl[2]) is high, too. - * |[4] |CLE |Control List Enable Bit - * | | |0 = Processing of the Control list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Control list in the next frame Enabled. - * |[5] |BLE |Bulk List Enable Bit - * | | |0 = Processing of the Bulk list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Bulk list in the next frame Enabled. - * |[7:6] |HCFS |Host Controller Functional State - * | | |This field sets the Host Controller state - * | | |The Controller may force a state change from USBSUSPEND to USBRESUME after detecting resume signaling from a downstream port - * | | |States are: - * | | |00 = USBSUSPEND. - * | | |01 = USBOPERATIONAL. - * | | |10 = USBRESUME. - * | | |11 = USBRESET. - * @var USBH_T::HcCommandStatus - * Offset: 0x08 Host Controller Command Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HCR |Host Controller Reset - * | | |This bit is set to initiate the software reset of Host Controller - * | | |This bit is cleared by the Host Controller, upon completed of the reset operation. - * | | |This bit, when set, didn't reset the Root Hub and no subsequent reset signaling be asserted to its downstream ports. - * | | |0 = Host Controller is not in software reset state. - * | | |1 = Host Controller is in software reset state. - * |[1] |CLF |Control List Filled - * | | |Set high to indicate there is an active TD on the Control List - * | | |It may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Control List. - * | | |0 = No active TD found or Host Controller begins to process the head of the Control list. - * | | |1 = An active TD added or found on the Control list. - * |[2] |BLF |Bulk List Filled - * | | |Set high to indicate there is an active TD on the Bulk list - * | | |This bit may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Bulk list. - * | | |0 = No active TD found or Host Controller begins to process the head of the Bulk list. - * | | |1 = An active TD added or found on the Bulk list. - * |[17:16] |SOC |Schedule Overrun Count - * | | |These bits are incremented on each scheduling overrun error - * | | |It is initialized to 00b and wraps around at 11b - * | | |This will be incremented when a scheduling overrun is detected even if SO (HcInterruptStatus[0]) has already been set. - * @var USBH_T::HcInterruptStatus - * Offset: 0x0C Host Controller Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun - * | | |Set when the List Processor determines a Schedule Overrun has occurred. - * | | |0 = Schedule Overrun didn't occur. - * | | |1 = Schedule Overrun has occurred. - * |[1] |WDH |Write Back Done Head - * | | |Set after the Host Controller has written HcDoneHead to HccaDoneHead - * | | |Further updates of the HccaDoneHead will not occur until this bit has been cleared. - * | | |0 =.Host Controller didn't update HccaDoneHead. - * | | |1 =.Host Controller has written HcDoneHead to HccaDoneHead. - * |[2] |SF |Start of Frame - * | | |Set when the Frame Management functional block signals a 'Start of Frame' event - * | | |Host Control generates a SOF token at the same time. - * | | |0 =.Not the start of a frame. - * | | |1 =.Indicate the start of a frame and Host Controller generates a SOF token. - * |[3] |RD |Resume Detected - * | | |Set when Host Controller detects resume signaling on a downstream port. - * | | |0 = No resume signaling detected on a downstream port. - * | | |1 = Resume signaling detected on a downstream port. - * |[5] |FNO |Frame Number Overflow - * | | |This bit is set when bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |0 = The bit 15 of Frame Number didn't change. - * | | |1 = The bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * |[6] |RHSC |Root Hub Status Change - * | | |This bit is set when the content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |0 = The content of HcRhStatus and the content of HcRhPortStatus register didn't change. - * | | |1 = The content of HcRhStatus or the content of HcRhPortStatus register has changed. - * @var USBH_T::HcInterruptEnable - * Offset: 0x10 Host Controller Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Enable Bit - * | | |This bit is a global interrupt enable - * | | |A write of '1' allows interrupts to be enabled via the specific enable bits listed above. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcInterruptDisable - * Offset: 0x14 Host Controller Interrupt Disable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Disable Bit - * | | |Global interrupt disable. Writing '1' to disable all interrupts. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcHCCA - * Offset: 0x18 Host Controller Communication Area Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:8] |HCCA |Host Controller Communication Area - * | | |Pointer to indicate base address of the Host Controller Communication Area (HCCA). - * @var USBH_T::HcPeriodCurrentED - * Offset: 0x1C Host Controller Period Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |PCED |Periodic Current ED - * | | |Pointer to indicate physical address of the current Isochronous or Interrupt Endpoint Descriptor. - * @var USBH_T::HcControlHeadED - * Offset: 0x20 Host Controller Control Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CHED |Control Head ED - * | | |Pointer to indicate physical address of the first Endpoint Descriptor of the Control list. - * @var USBH_T::HcControlCurrentED - * Offset: 0x24 Host Controller Control Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CCED |Control Current Head ED - * | | |Pointer to indicate the physical address of the current Endpoint Descriptor of the Control list. - * @var USBH_T::HcBulkHeadED - * Offset: 0x28 Host Controller Bulk Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BHED |Bulk Head ED - * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Bulk list. - * @var USBH_T::HcBulkCurrentED - * Offset: 0x2C Host Controller Bulk Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BCED |Bulk Current Head ED - * | | |Pointer to indicate the physical address of the current endpoint of the Bulk list. - * @var USBH_T::HcDoneHead - * Offset: 0x30 Host Controller Done Head Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |DH |Done Head - * | | |Pointer to indicate the physical address of the last completed Transfer Descriptor that was added to the Done queue. - * @var USBH_T::HcFmInterval - * Offset: 0x34 Host Controller Frame Interval Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Interval - * | | |This field specifies the length of a frame as (bit times - 1) - * | | |For 12,000 bit times in a frame, a value of 11,999 is stored here. - * |[30:16] |FSMPS |FS Largest Data Packet - * | | |This field specifies a value that is loaded into the Largest Data Packet Counter at the beginning of each frame. - * |[31] |FIT |Frame Interval Toggle - * | | |This bit is toggled by Host Controller Driver when it loads a new value into FI (HcFmInterval[13:0]). - * | | |0 = Host Controller Driver didn't load new value into FI (HcFmInterval[13:0]). - * | | |1 = Host Controller Driver loads a new value into FI (HcFmInterval[13:0]). - * @var USBH_T::HcFmRemaining - * Offset: 0x38 Host Controller Frame Remaining Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FR |Frame Remaining - * | | |When the Host Controller is in the USBOPERATIONAL state, this 14-bit field decrements each 12 MHz clock period - * | | |When the count reaches 0, (end of frame) the counter reloads with Frame Interval - * | | |In addition, the counter loads when the Host Controller transitions into USBOPERATIONAL. - * |[31] |FRT |Frame Remaining Toggle - * | | |This bit is loaded from the FIT (HcFmInterval[31]) whenever FR (HcFmRemaining[13:0]) reaches 0. - * @var USBH_T::HcFmNumber - * Offset: 0x3C Host Controller Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FN |Frame Number - * | | |This 16-bit incrementing counter field is incremented coincident with the re-load of FR (HcFmRemaining[13:0]) - * | | |The count rolls over from 'FFFFh' to '0h.' - * @var USBH_T::HcPeriodicStart - * Offset: 0x40 Host Controller Periodic Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PS |Periodic Start - * | | |This field contains a value used by the List Processor to determine where in a frame the Periodic List processing must begin. - * @var USBH_T::HcLSThreshold - * Offset: 0x44 Host Controller Low-speed Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |LST |Low-speed Threshold - * | | |This field contains a value which is compared to the FR (HcFmRemaining[13:0]) field prior to initiating a Low-speed transaction - * | | |The transaction is started only if FR (HcFmRemaining[13:0]) >= this field - * | | |The value is calculated by Host Controller Driver with the consideration of transmission and setup overhead. - * @var USBH_T::HcRhDescriptorA - * Offset: 0x48 Host Controller Root Hub Descriptor A Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |NDP |Number Downstream Ports - * | | |USB host control supports two downstream ports and only one port is available in this series of chip. - * |[8] |PSM |Power Switching Mode - * | | |This bit is used to specify how the power switching of the Root Hub ports is controlled. - * | | |0 = Global Switching. - * | | |1 = Individual Switching. - * |[11] |OCPM |over Current Protection Mode - * | | |This bit describes how the over current status for the Root Hub ports reported - * | | |This bit is only valid when NOCP (HcRhDescriptorA[12]) is cleared. - * | | |0 = Global Over current. - * | | |1 = Individual Over current. - * |[12] |NOCP |No over Current Protection - * | | |This bit describes how the over current status for the Root Hub ports reported. - * | | |0 = Over current status is reported. - * | | |1 = Over current status is not reported. - * @var USBH_T::HcRhDescriptorB - * Offset: 0x4C Host Controller Root Hub Descriptor B Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |PPCM |Port Power Control Mask - * | | |Global power switching - * | | |This field is only valid if PowerSwitchingMode is set (individual port switching) - * | | |When set, the port only responds to individual port power switching commands (Set/ClearPortPower) - * | | |When cleared, the port only responds to global power switching commands (Set/ClearGlobalPower). - * | | |0 = Port power controlled by global power switching. - * | | |1 = Port power controlled by port power switching. - * | | |Note: PPCM[15:2] and PPCM[0] are reserved. - * @var USBH_T::HcRhStatus - * Offset: 0x50 Host Controller Root Hub Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPS |Clear Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to clear all ports' power. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear global power. - * |[1] |OCI |over Current Indicator - * | | |This bit reflects the state of the over current status pin - * | | |This field is only valid if NOCP (HcRhDesA[12]) and OCPM (HcRhDesA[11]) are cleared. - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[15] |DRWE |Device Remote Wakeup Enable Bit - * | | |This bit controls if port's Connect Status Change as a remote wake-up event. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * | | |Read Operation: - * | | |0 = Connect Status Change as a remote wake-up event Disabled. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * |[16] |LPSC |Set Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to enable power to all ports. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set global power. - * |[17] |OCIC |over Current Indicator Change - * | | |This bit is set by hardware when a change has occurred in OCI (HcRhStatus[1]). - * | | |Write 1 to clear this bit to zero. - * | | |0 = OCI (HcRhStatus[1]) didn't change. - * | | |1 = OCI (HcRhStatus[1]) change. - * |[31] |CRWE |Clear Remote Wake-up Enable Bit - * | | |This bit is use to clear DRWE (HcRhStatus[15]). - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear DRWE (HcRhStatus[15]). - * @var USBH_T::HcRhPortStatus[2] - * Offset: 0x54 Host Controller Root Hub Port Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |CurrentConnectStatus (Read) or ClearPortEnable Bit (Write) - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port enable. - * | | |Read Operation: - * | | |0 = No device connected. - * | | |1 = Device connected. - * |[1] |PES |Port Enable Status - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port enable. - * | | |Read Operation: - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[2] |PSS |Port Suspend Status - * | | |This bit indicates the port is suspended - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port suspend. - * | | |Read Operation: - * | | |0 = Port is not suspended. - * | | |1 = Port is selectively suspended. - * |[3] |POCI |Port over Current Indicator (Read) or Clear Port Suspend (Write) - * | | |This bit reflects the state of the over current status pin dedicated to this port - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) is cleared and OCPM (HcRhDescriptorA[11]) is set. - * | | |This bit is also used to initiate the selective result sequence for the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port suspend. - * | | |Read Operation: - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[4] |PRS |Port Reset Status - * | | |This bit reflects the reset state of the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port reset. - * | | |Read Operation - * | | |0 = Port reset signal is not active. - * | | |1 = Port reset signal is active. - * |[8] |PPS |Port Power Status - * | | |This bit reflects the power state of the port regardless of the power switching mode. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Port Power Enabled. - * | | |Read Operation: - * | | |0 = Port power is Disabled. - * | | |1 = Port power is Enabled. - * |[9] |LSDA |Low Speed Device Attached (Read) or Clear Port Power (Write) - * | | |This bit defines the speed (and bud idle) of the attached device - * | | |It is only valid when CCS (HcRhPortStatus1[0]) is set. - * | | |This bit is also used to clear port power. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear PPS (HcRhPortStatus1[8]). - * | | |Read Operation: - * | | |0 = Full Speed device. - * | | |1 = Low-speed device. - * |[16] |CSC |Connect Status Change - * | | |This bit indicates connect or disconnect event has been detected (CCS (HcRhPortStatus1[0]) changed). - * | | |Write 1 to clear this bit to zero. - * | | |0 = No connect/disconnect event (CCS (HcRhPortStatus1[0]) didn't change). - * | | |1 = Hardware detection of connect/disconnect event (CCS (HcRhPortStatus1[0]) changed). - * |[17] |PESC |Port Enable Status Change - * | | |This bit indicates that the port has been disabled (PES (HcRhPortStatus1[1]) cleared) due to a hardware event. - * | | |Write 1 to clear this bit to zero. - * | | |0 = PES (HcRhPortStatus1[1]) didn't change. - * | | |1 = PES (HcRhPortStatus1[1]) changed. - * |[18] |PSSC |Port Suspend Status Change - * | | |This bit indicates the completion of the selective resume sequence for the port. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port resume is not completed. - * | | |1 = Port resume completed. - * |[19] |OCIC |Port over Current Indicator Change - * | | |This bit is set when POCI (HcRhPortStatus1[3]) changes. - * | | |Write 1 to clear this bit to zero. - * | | |0 = POCI (HcRhPortStatus1[3]) didn't change. - * | | |1 = POCI (HcRhPortStatus1[3]) changes. - * |[20] |PRSC |Port Reset Status Change - * | | |This bit indicates that the port reset signal has completed. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port reset is not complete. - * | | |1 = Port reset is complete. - * @var USBH_T::HcPhyControl - * Offset: 0x200 Host Controller PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27] |STBYEN |USB Transceiver Standby Enable Bit - * | | |This bit controls if USB transceiver could enter the standby mode to reduce power consumption. - * | | |0 = The USB transceiver would never enter the standby mode. - * | | |1 = The USB transceiver will enter standby mode while port is in power off state (port power is inactive). - * @var USBH_T::HcMiscControl - * Offset: 0x204 Host Controller Miscellaneous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABORT |AHB Bus ERROR Response - * | | |This bit indicates there is an ERROR response received in AHB bus. - * | | |0 = No ERROR response received. - * | | |1 = ERROR response received. - * |[3] |OCAL |over Current Active Low - * | | |This bit controls the polarity of over current flag from external power IC. - * | | |0 = Over current flag is high active. - * | | |1 = Over current flag is low active. - * |[16] |DPRT1 |Disable Port 1 - * | | |This bit controls if the connection between USB host controller and transceiver of port 1 is disabled - * | | |If the connection is disabled, the USB host controller will not recognize any event of USB bus. - * | | |Set this bit high, the transceiver of port 1 will also be forced into the standby mode no matter what USB host controller operation is. - * | | |0 = The connection between USB host controller and transceiver of port 1 Enabled. - * | | |1 = The connection between USB host controller and transceiver of port 1 Disabled and the transceiver of port 1 will also be forced into the standby mode. - */ - __I uint32_t HcRevision; /*!< [0x0000] Host Controller Revision Register */ - __IO uint32_t HcControl; /*!< [0x0004] Host Controller Control Register */ - __IO uint32_t HcCommandStatus; /*!< [0x0008] Host Controller Command Status Register */ - __IO uint32_t HcInterruptStatus; /*!< [0x000c] Host Controller Interrupt Status Register */ - __IO uint32_t HcInterruptEnable; /*!< [0x0010] Host Controller Interrupt Enable Register */ - __IO uint32_t HcInterruptDisable; /*!< [0x0014] Host Controller Interrupt Disable Register */ - __IO uint32_t HcHCCA; /*!< [0x0018] Host Controller Communication Area Register */ - __IO uint32_t HcPeriodCurrentED; /*!< [0x001c] Host Controller Period Current ED Register */ - __IO uint32_t HcControlHeadED; /*!< [0x0020] Host Controller Control Head ED Register */ - __IO uint32_t HcControlCurrentED; /*!< [0x0024] Host Controller Control Current ED Register */ - __IO uint32_t HcBulkHeadED; /*!< [0x0028] Host Controller Bulk Head ED Register */ - __IO uint32_t HcBulkCurrentED; /*!< [0x002c] Host Controller Bulk Current ED Register */ - __IO uint32_t HcDoneHead; /*!< [0x0030] Host Controller Done Head Register */ - __IO uint32_t HcFmInterval; /*!< [0x0034] Host Controller Frame Interval Register */ - __I uint32_t HcFmRemaining; /*!< [0x0038] Host Controller Frame Remaining Register */ - __I uint32_t HcFmNumber; /*!< [0x003c] Host Controller Frame Number Register */ - __IO uint32_t HcPeriodicStart; /*!< [0x0040] Host Controller Periodic Start Register */ - __IO uint32_t HcLSThreshold; /*!< [0x0044] Host Controller Low-speed Threshold Register */ - __IO uint32_t HcRhDescriptorA; /*!< [0x0048] Host Controller Root Hub Descriptor A Register */ - __IO uint32_t HcRhDescriptorB; /*!< [0x004c] Host Controller Root Hub Descriptor B Register */ - __IO uint32_t HcRhStatus; /*!< [0x0050] Host Controller Root Hub Status Register */ - __IO uint32_t HcRhPortStatus[2]; /*!< [0x0054] Host Controller Root Hub Port Status [1] */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[105]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t HcPhyControl; /*!< [0x0200] Host Controller PHY Control Register */ - __IO uint32_t HcMiscControl; /*!< [0x0204] Host Controller Miscellaneous Control Register */ - -} USBH_T; - -/** - @addtogroup USBH_CONST USBH Bit Field Definition - Constant Definitions for USBH Controller -@{ */ - -#define USBH_HcRevision_REV_Pos (0) /*!< USBH_T::HcRevision: REV Position */ -#define USBH_HcRevision_REV_Msk (0xfful << USBH_HcRevision_REV_Pos) /*!< USBH_T::HcRevision: REV Mask */ - -#define USBH_HcControl_CBSR_Pos (0) /*!< USBH_T::HcControl: CBSR Position */ -#define USBH_HcControl_CBSR_Msk (0x3ul << USBH_HcControl_CBSR_Pos) /*!< USBH_T::HcControl: CBSR Mask */ - -#define USBH_HcControl_PLE_Pos (2) /*!< USBH_T::HcControl: PLE Position */ -#define USBH_HcControl_PLE_Msk (0x1ul << USBH_HcControl_PLE_Pos) /*!< USBH_T::HcControl: PLE Mask */ - -#define USBH_HcControl_IE_Pos (3) /*!< USBH_T::HcControl: IE Position */ -#define USBH_HcControl_IE_Msk (0x1ul << USBH_HcControl_IE_Pos) /*!< USBH_T::HcControl: IE Mask */ - -#define USBH_HcControl_CLE_Pos (4) /*!< USBH_T::HcControl: CLE Position */ -#define USBH_HcControl_CLE_Msk (0x1ul << USBH_HcControl_CLE_Pos) /*!< USBH_T::HcControl: CLE Mask */ - -#define USBH_HcControl_BLE_Pos (5) /*!< USBH_T::HcControl: BLE Position */ -#define USBH_HcControl_BLE_Msk (0x1ul << USBH_HcControl_BLE_Pos) /*!< USBH_T::HcControl: BLE Mask */ - -#define USBH_HcControl_HCFS_Pos (6) /*!< USBH_T::HcControl: HCFS Position */ -#define USBH_HcControl_HCFS_Msk (0x3ul << USBH_HcControl_HCFS_Pos) /*!< USBH_T::HcControl: HCFS Mask */ - -#define USBH_HcCommandStatus_HCR_Pos (0) /*!< USBH_T::HcCommandStatus: HCR Position */ -#define USBH_HcCommandStatus_HCR_Msk (0x1ul << USBH_HcCommandStatus_HCR_Pos) /*!< USBH_T::HcCommandStatus: HCR Mask */ - -#define USBH_HcCommandStatus_CLF_Pos (1) /*!< USBH_T::HcCommandStatus: CLF Position */ -#define USBH_HcCommandStatus_CLF_Msk (0x1ul << USBH_HcCommandStatus_CLF_Pos) /*!< USBH_T::HcCommandStatus: CLF Mask */ - -#define USBH_HcCommandStatus_BLF_Pos (2) /*!< USBH_T::HcCommandStatus: BLF Position */ -#define USBH_HcCommandStatus_BLF_Msk (0x1ul << USBH_HcCommandStatus_BLF_Pos) /*!< USBH_T::HcCommandStatus: BLF Mask */ - -#define USBH_HcCommandStatus_SOC_Pos (16) /*!< USBH_T::HcCommandStatus: SOC Position */ -#define USBH_HcCommandStatus_SOC_Msk (0x3ul << USBH_HcCommandStatus_SOC_Pos) /*!< USBH_T::HcCommandStatus: SOC Mask */ - -#define USBH_HcInterruptStatus_SO_Pos (0) /*!< USBH_T::HcInterruptStatus: SO Position */ -#define USBH_HcInterruptStatus_SO_Msk (0x1ul << USBH_HcInterruptStatus_SO_Pos) /*!< USBH_T::HcInterruptStatus: SO Mask */ - -#define USBH_HcInterruptStatus_WDH_Pos (1) /*!< USBH_T::HcInterruptStatus: WDH Position*/ -#define USBH_HcInterruptStatus_WDH_Msk (0x1ul << USBH_HcInterruptStatus_WDH_Pos) /*!< USBH_T::HcInterruptStatus: WDH Mask */ - -#define USBH_HcInterruptStatus_SF_Pos (2) /*!< USBH_T::HcInterruptStatus: SF Position */ -#define USBH_HcInterruptStatus_SF_Msk (0x1ul << USBH_HcInterruptStatus_SF_Pos) /*!< USBH_T::HcInterruptStatus: SF Mask */ - -#define USBH_HcInterruptStatus_RD_Pos (3) /*!< USBH_T::HcInterruptStatus: RD Position */ -#define USBH_HcInterruptStatus_RD_Msk (0x1ul << USBH_HcInterruptStatus_RD_Pos) /*!< USBH_T::HcInterruptStatus: RD Mask */ - -#define USBH_HcInterruptStatus_FNO_Pos (5) /*!< USBH_T::HcInterruptStatus: FNO Position*/ -#define USBH_HcInterruptStatus_FNO_Msk (0x1ul << USBH_HcInterruptStatus_FNO_Pos) /*!< USBH_T::HcInterruptStatus: FNO Mask */ - -#define USBH_HcInterruptStatus_RHSC_Pos (6) /*!< USBH_T::HcInterruptStatus: RHSC Position*/ -#define USBH_HcInterruptStatus_RHSC_Msk (0x1ul << USBH_HcInterruptStatus_RHSC_Pos) /*!< USBH_T::HcInterruptStatus: RHSC Mask */ - -#define USBH_HcInterruptEnable_SO_Pos (0) /*!< USBH_T::HcInterruptEnable: SO Position */ -#define USBH_HcInterruptEnable_SO_Msk (0x1ul << USBH_HcInterruptEnable_SO_Pos) /*!< USBH_T::HcInterruptEnable: SO Mask */ - -#define USBH_HcInterruptEnable_WDH_Pos (1) /*!< USBH_T::HcInterruptEnable: WDH Position*/ -#define USBH_HcInterruptEnable_WDH_Msk (0x1ul << USBH_HcInterruptEnable_WDH_Pos) /*!< USBH_T::HcInterruptEnable: WDH Mask */ - -#define USBH_HcInterruptEnable_SF_Pos (2) /*!< USBH_T::HcInterruptEnable: SF Position */ -#define USBH_HcInterruptEnable_SF_Msk (0x1ul << USBH_HcInterruptEnable_SF_Pos) /*!< USBH_T::HcInterruptEnable: SF Mask */ - -#define USBH_HcInterruptEnable_RD_Pos (3) /*!< USBH_T::HcInterruptEnable: RD Position */ -#define USBH_HcInterruptEnable_RD_Msk (0x1ul << USBH_HcInterruptEnable_RD_Pos) /*!< USBH_T::HcInterruptEnable: RD Mask */ - -#define USBH_HcInterruptEnable_FNO_Pos (5) /*!< USBH_T::HcInterruptEnable: FNO Position*/ -#define USBH_HcInterruptEnable_FNO_Msk (0x1ul << USBH_HcInterruptEnable_FNO_Pos) /*!< USBH_T::HcInterruptEnable: FNO Mask */ - -#define USBH_HcInterruptEnable_RHSC_Pos (6) /*!< USBH_T::HcInterruptEnable: RHSC Position*/ -#define USBH_HcInterruptEnable_RHSC_Msk (0x1ul << USBH_HcInterruptEnable_RHSC_Pos) /*!< USBH_T::HcInterruptEnable: RHSC Mask */ - -#define USBH_HcInterruptEnable_MIE_Pos (31) /*!< USBH_T::HcInterruptEnable: MIE Position*/ -#define USBH_HcInterruptEnable_MIE_Msk (0x1ul << USBH_HcInterruptEnable_MIE_Pos) /*!< USBH_T::HcInterruptEnable: MIE Mask */ - -#define USBH_HcInterruptDisable_SO_Pos (0) /*!< USBH_T::HcInterruptDisable: SO Position*/ -#define USBH_HcInterruptDisable_SO_Msk (0x1ul << USBH_HcInterruptDisable_SO_Pos) /*!< USBH_T::HcInterruptDisable: SO Mask */ - -#define USBH_HcInterruptDisable_WDH_Pos (1) /*!< USBH_T::HcInterruptDisable: WDH Position*/ -#define USBH_HcInterruptDisable_WDH_Msk (0x1ul << USBH_HcInterruptDisable_WDH_Pos) /*!< USBH_T::HcInterruptDisable: WDH Mask */ - -#define USBH_HcInterruptDisable_SF_Pos (2) /*!< USBH_T::HcInterruptDisable: SF Position*/ -#define USBH_HcInterruptDisable_SF_Msk (0x1ul << USBH_HcInterruptDisable_SF_Pos) /*!< USBH_T::HcInterruptDisable: SF Mask */ - -#define USBH_HcInterruptDisable_RD_Pos (3) /*!< USBH_T::HcInterruptDisable: RD Position*/ -#define USBH_HcInterruptDisable_RD_Msk (0x1ul << USBH_HcInterruptDisable_RD_Pos) /*!< USBH_T::HcInterruptDisable: RD Mask */ - -#define USBH_HcInterruptDisable_FNO_Pos (5) /*!< USBH_T::HcInterruptDisable: FNO Position*/ -#define USBH_HcInterruptDisable_FNO_Msk (0x1ul << USBH_HcInterruptDisable_FNO_Pos) /*!< USBH_T::HcInterruptDisable: FNO Mask */ - -#define USBH_HcInterruptDisable_RHSC_Pos (6) /*!< USBH_T::HcInterruptDisable: RHSC Position*/ -#define USBH_HcInterruptDisable_RHSC_Msk (0x1ul << USBH_HcInterruptDisable_RHSC_Pos) /*!< USBH_T::HcInterruptDisable: RHSC Mask */ - -#define USBH_HcInterruptDisable_MIE_Pos (31) /*!< USBH_T::HcInterruptDisable: MIE Position*/ -#define USBH_HcInterruptDisable_MIE_Msk (0x1ul << USBH_HcInterruptDisable_MIE_Pos) /*!< USBH_T::HcInterruptDisable: MIE Mask */ - -#define USBH_HcHCCA_HCCA_Pos (8) /*!< USBH_T::HcHCCA: HCCA Position */ -#define USBH_HcHCCA_HCCA_Msk (0xfffffful << USBH_HcHCCA_HCCA_Pos) /*!< USBH_T::HcHCCA: HCCA Mask */ - -#define USBH_HcPeriodCurrentED_PCED_Pos (4) /*!< USBH_T::HcPeriodCurrentED: PCED Position*/ -#define USBH_HcPeriodCurrentED_PCED_Msk (0xffffffful << USBH_HcPeriodCurrentED_PCED_Pos) /*!< USBH_T::HcPeriodCurrentED: PCED Mask */ - -#define USBH_HcControlHeadED_CHED_Pos (4) /*!< USBH_T::HcControlHeadED: CHED Position */ -#define USBH_HcControlHeadED_CHED_Msk (0xffffffful << USBH_HcControlHeadED_CHED_Pos) /*!< USBH_T::HcControlHeadED: CHED Mask */ - -#define USBH_HcControlCurrentED_CCED_Pos (4) /*!< USBH_T::HcControlCurrentED: CCED Position*/ -#define USBH_HcControlCurrentED_CCED_Msk (0xffffffful << USBH_HcControlCurrentED_CCED_Pos) /*!< USBH_T::HcControlCurrentED: CCED Mask */ - -#define USBH_HcBulkHeadED_BHED_Pos (4) /*!< USBH_T::HcBulkHeadED: BHED Position */ -#define USBH_HcBulkHeadED_BHED_Msk (0xffffffful << USBH_HcBulkHeadED_BHED_Pos) /*!< USBH_T::HcBulkHeadED: BHED Mask */ - -#define USBH_HcBulkCurrentED_BCED_Pos (4) /*!< USBH_T::HcBulkCurrentED: BCED Position */ -#define USBH_HcBulkCurrentED_BCED_Msk (0xffffffful << USBH_HcBulkCurrentED_BCED_Pos) /*!< USBH_T::HcBulkCurrentED: BCED Mask */ - -#define USBH_HcDoneHead_DH_Pos (4) /*!< USBH_T::HcDoneHead: DH Position */ -#define USBH_HcDoneHead_DH_Msk (0xffffffful << USBH_HcDoneHead_DH_Pos) /*!< USBH_T::HcDoneHead: DH Mask */ - -#define USBH_HcFmInterval_FI_Pos (0) /*!< USBH_T::HcFmInterval: FI Position */ -#define USBH_HcFmInterval_FI_Msk (0x3ffful << USBH_HcFmInterval_FI_Pos) /*!< USBH_T::HcFmInterval: FI Mask */ - -#define USBH_HcFmInterval_FSMPS_Pos (16) /*!< USBH_T::HcFmInterval: FSMPS Position */ -#define USBH_HcFmInterval_FSMPS_Msk (0x7ffful << USBH_HcFmInterval_FSMPS_Pos) /*!< USBH_T::HcFmInterval: FSMPS Mask */ - -#define USBH_HcFmInterval_FIT_Pos (31) /*!< USBH_T::HcFmInterval: FIT Position */ -#define USBH_HcFmInterval_FIT_Msk (0x1ul << USBH_HcFmInterval_FIT_Pos) /*!< USBH_T::HcFmInterval: FIT Mask */ - -#define USBH_HcFmRemaining_FR_Pos (0) /*!< USBH_T::HcFmRemaining: FR Position */ -#define USBH_HcFmRemaining_FR_Msk (0x3ffful << USBH_HcFmRemaining_FR_Pos) /*!< USBH_T::HcFmRemaining: FR Mask */ - -#define USBH_HcFmRemaining_FRT_Pos (31) /*!< USBH_T::HcFmRemaining: FRT Position */ -#define USBH_HcFmRemaining_FRT_Msk (0x1ul << USBH_HcFmRemaining_FRT_Pos) /*!< USBH_T::HcFmRemaining: FRT Mask */ - -#define USBH_HcFmNumber_FN_Pos (0) /*!< USBH_T::HcFmNumber: FN Position */ -#define USBH_HcFmNumber_FN_Msk (0xfffful << USBH_HcFmNumber_FN_Pos) /*!< USBH_T::HcFmNumber: FN Mask */ - -#define USBH_HcPeriodicStart_PS_Pos (0) /*!< USBH_T::HcPeriodicStart: PS Position */ -#define USBH_HcPeriodicStart_PS_Msk (0x3ffful << USBH_HcPeriodicStart_PS_Pos) /*!< USBH_T::HcPeriodicStart: PS Mask */ - -#define USBH_HcLSThreshold_LST_Pos (0) /*!< USBH_T::HcLSThreshold: LST Position */ -#define USBH_HcLSThreshold_LST_Msk (0xffful << USBH_HcLSThreshold_LST_Pos) /*!< USBH_T::HcLSThreshold: LST Mask */ - -#define USBH_HcRhDescriptorA_NDP_Pos (0) /*!< USBH_T::HcRhDescriptorA: NDP Position */ -#define USBH_HcRhDescriptorA_NDP_Msk (0xfful << USBH_HcRhDescriptorA_NDP_Pos) /*!< USBH_T::HcRhDescriptorA: NDP Mask */ - -#define USBH_HcRhDescriptorA_PSM_Pos (8) /*!< USBH_T::HcRhDescriptorA: PSM Position */ -#define USBH_HcRhDescriptorA_PSM_Msk (0x1ul << USBH_HcRhDescriptorA_PSM_Pos) /*!< USBH_T::HcRhDescriptorA: PSM Mask */ - -#define USBH_HcRhDescriptorA_OCPM_Pos (11) /*!< USBH_T::HcRhDescriptorA: OCPM Position */ -#define USBH_HcRhDescriptorA_OCPM_Msk (0x1ul << USBH_HcRhDescriptorA_OCPM_Pos) /*!< USBH_T::HcRhDescriptorA: OCPM Mask */ - -#define USBH_HcRhDescriptorA_NOCP_Pos (12) /*!< USBH_T::HcRhDescriptorA: NOCP Position */ -#define USBH_HcRhDescriptorA_NOCP_Msk (0x1ul << USBH_HcRhDescriptorA_NOCP_Pos) /*!< USBH_T::HcRhDescriptorA: NOCP Mask */ - -#define USBH_HcRhDescriptorB_PPCM_Pos (16) /*!< USBH_T::HcRhDescriptorB: PPCM Position */ -#define USBH_HcRhDescriptorB_PPCM_Msk (0xfffful << USBH_HcRhDescriptorB_PPCM_Pos) /*!< USBH_T::HcRhDescriptorB: PPCM Mask */ - -#define USBH_HcRhStatus_LPS_Pos (0) /*!< USBH_T::HcRhStatus: LPS Position */ -#define USBH_HcRhStatus_LPS_Msk (0x1ul << USBH_HcRhStatus_LPS_Pos) /*!< USBH_T::HcRhStatus: LPS Mask */ - -#define USBH_HcRhStatus_OCI_Pos (1) /*!< USBH_T::HcRhStatus: OCI Position */ -#define USBH_HcRhStatus_OCI_Msk (0x1ul << USBH_HcRhStatus_OCI_Pos) /*!< USBH_T::HcRhStatus: OCI Mask */ - -#define USBH_HcRhStatus_DRWE_Pos (15) /*!< USBH_T::HcRhStatus: DRWE Position */ -#define USBH_HcRhStatus_DRWE_Msk (0x1ul << USBH_HcRhStatus_DRWE_Pos) /*!< USBH_T::HcRhStatus: DRWE Mask */ - -#define USBH_HcRhStatus_LPSC_Pos (16) /*!< USBH_T::HcRhStatus: LPSC Position */ -#define USBH_HcRhStatus_LPSC_Msk (0x1ul << USBH_HcRhStatus_LPSC_Pos) /*!< USBH_T::HcRhStatus: LPSC Mask */ - -#define USBH_HcRhStatus_OCIC_Pos (17) /*!< USBH_T::HcRhStatus: OCIC Position */ -#define USBH_HcRhStatus_OCIC_Msk (0x1ul << USBH_HcRhStatus_OCIC_Pos) /*!< USBH_T::HcRhStatus: OCIC Mask */ - -#define USBH_HcRhStatus_CRWE_Pos (31) /*!< USBH_T::HcRhStatus: CRWE Position */ -#define USBH_HcRhStatus_CRWE_Msk (0x1ul << USBH_HcRhStatus_CRWE_Pos) /*!< USBH_T::HcRhStatus: CRWE Mask */ - -#define USBH_HcRhPortStatus_CCS_Pos (0) /*!< USBH_T::HcRhPortStatus1: CCS Position */ -#define USBH_HcRhPortStatus_CCS_Msk (0x1ul << USBH_HcRhPortStatus_CCS_Pos) /*!< USBH_T::HcRhPortStatus1: CCS Mask */ - -#define USBH_HcRhPortStatus_PES_Pos (1) /*!< USBH_T::HcRhPortStatus1: PES Position */ -#define USBH_HcRhPortStatus_PES_Msk (0x1ul << USBH_HcRhPortStatus_PES_Pos) /*!< USBH_T::HcRhPortStatus1: PES Mask */ - -#define USBH_HcRhPortStatus_PSS_Pos (2) /*!< USBH_T::HcRhPortStatus1: PSS Position */ -#define USBH_HcRhPortStatus_PSS_Msk (0x1ul << USBH_HcRhPortStatus_PSS_Pos) /*!< USBH_T::HcRhPortStatus1: PSS Mask */ - -#define USBH_HcRhPortStatus_POCI_Pos (3) /*!< USBH_T::HcRhPortStatus1: POCI Position */ -#define USBH_HcRhPortStatus_POCI_Msk (0x1ul << USBH_HcRhPortStatus_POCI_Pos) /*!< USBH_T::HcRhPortStatus1: POCI Mask */ - -#define USBH_HcRhPortStatus_PRS_Pos (4) /*!< USBH_T::HcRhPortStatus1: PRS Position */ -#define USBH_HcRhPortStatus_PRS_Msk (0x1ul << USBH_HcRhPortStatus_PRS_Pos) /*!< USBH_T::HcRhPortStatus1: PRS Mask */ - -#define USBH_HcRhPortStatus_PPS_Pos (8) /*!< USBH_T::HcRhPortStatus1: PPS Position */ -#define USBH_HcRhPortStatus_PPS_Msk (0x1ul << USBH_HcRhPortStatus_PPS_Pos) /*!< USBH_T::HcRhPortStatus1: PPS Mask */ - -#define USBH_HcRhPortStatus_LSDA_Pos (9) /*!< USBH_T::HcRhPortStatus1: LSDA Position */ -#define USBH_HcRhPortStatus_LSDA_Msk (0x1ul << USBH_HcRhPortStatus_LSDA_Pos) /*!< USBH_T::HcRhPortStatus1: LSDA Mask */ - -#define USBH_HcRhPortStatus_CSC_Pos (16) /*!< USBH_T::HcRhPortStatus1: CSC Position */ -#define USBH_HcRhPortStatus_CSC_Msk (0x1ul << USBH_HcRhPortStatus_CSC_Pos) /*!< USBH_T::HcRhPortStatus1: CSC Mask */ - -#define USBH_HcRhPortStatus_PESC_Pos (17) /*!< USBH_T::HcRhPortStatus1: PESC Position */ -#define USBH_HcRhPortStatus_PESC_Msk (0x1ul << USBH_HcRhPortStatus_PESC_Pos) /*!< USBH_T::HcRhPortStatus1: PESC Mask */ - -#define USBH_HcRhPortStatus_PSSC_Pos (18) /*!< USBH_T::HcRhPortStatus1: PSSC Position */ -#define USBH_HcRhPortStatus_PSSC_Msk (0x1ul << USBH_HcRhPortStatus_PSSC_Pos) /*!< USBH_T::HcRhPortStatus1: PSSC Mask */ - -#define USBH_HcRhPortStatus_OCIC_Pos (19) /*!< USBH_T::HcRhPortStatus1: OCIC Position */ -#define USBH_HcRhPortStatus_OCIC_Msk (0x1ul << USBH_HcRhPortStatus_OCIC_Pos) /*!< USBH_T::HcRhPortStatus1: OCIC Mask */ - -#define USBH_HcRhPortStatus_PRSC_Pos (20) /*!< USBH_T::HcRhPortStatus1: PRSC Position */ -#define USBH_HcRhPortStatus_PRSC_Msk (0x1ul << USBH_HcRhPortStatus_PRSC_Pos) /*!< USBH_T::HcRhPortStatus1: PRSC Mask */ - -#define USBH_HcPhyControl_STBYEN_Pos (27) /*!< USBH_T::HcPhyControl: STBYEN Position */ -#define USBH_HcPhyControl_STBYEN_Msk (0x1ul << USBH_HcPhyControl_STBYEN_Pos) /*!< USBH_T::HcPhyControl: STBYEN Mask */ - -#define USBH_HcMiscControl_ABORT_Pos (1) /*!< USBH_T::HcMiscControl: ABORT Position */ -#define USBH_HcMiscControl_ABORT_Msk (0x1ul << USBH_HcMiscControl_ABORT_Pos) /*!< USBH_T::HcMiscControl: ABORT Mask */ - -#define USBH_HcMiscControl_OCAL_Pos (3) /*!< USBH_T::HcMiscControl: OCAL Position */ -#define USBH_HcMiscControl_OCAL_Msk (0x1ul << USBH_HcMiscControl_OCAL_Pos) /*!< USBH_T::HcMiscControl: OCAL Mask */ - -#define USBH_HcMiscControl_DPRT1_Pos (16) /*!< USBH_T::HcMiscControl: DPRT1 Position */ -#define USBH_HcMiscControl_DPRT1_Msk (0x1ul << USBH_HcMiscControl_DPRT1_Pos) /*!< USBH_T::HcMiscControl: DPRT1 Mask */ - -/**@}*/ /* USBH_CONST */ -/**@}*/ /* end of USBH register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __USBH_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uspi_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uspi_reg.h deleted file mode 100644 index a8a966251bb..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uspi_reg.h +++ /dev/null @@ -1,677 +0,0 @@ -/**************************************************************************//** - * @file uspi_reg.h - * @version V1.00 - * @brief USPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USPI_REG_H__ -#define __USPI_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USPI SPI Mode of USCI Controller(USPI) - Memory Mapped Structure for USPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var USPI_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var USPI_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt is disabled. - * | | |1 = The transmit start interrupt is enabled. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt is disabled. - * | | |1 = The transmit finish interrupt is enabled. - * |[3] |RXSTIEN |Receive Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt is disabled. - * | | |1 = The receive start interrupt is enabled. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt is disabled. - * | | |1 = The receive end interrupt is enabled. - * @var USPI_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fDIV_CLK. - * | | |01 = fPROT_CLK. - * | | |10 = fSCLK. - * | | |11 = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter is Disabled. - * | | |1 = Time measurement counter is Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(USPI_PROTCTL[6])) is enabled - * | | |The revised value is the average bit time between bit 5 and bit 6 - * | | |The user can use revised CLKDIV and new BRDETITV (USPI_PROTCTL[24:16]) to calculate the precise baud rate. - * @var USPI_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * @var USPI_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var USPI_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * @var USPI_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT0/1 pin. - * | | |0 = Data output level is not inverted. - * | | |1 = Data output level is inverted. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: The control signal has different definitions in different protocol - * | | |In SPI protocol, the control signal means slave select signal - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * @var USPI_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission - * | | |In order to avoid overwriting the transmit data, user have to check TXEMPTY (USPI_BUFSTS[8]) status before writing transmit data into this bit field. - * |[16] |PORTDIR |Port Direction Control - * | | |This bit field is only available while USCI operates in SPI protocol (FUNMODE = 0x1) with half-duplex transfer - * | | |It is used to define the direction of the data port pin - * | | |When software writes USPI_TXDAT register, the transmit data and its port direction are settled simultaneously. - * | | |0 = The data pin is configured as output mode. - * | | |1 = The data pin is configured as input mode. - * @var USPI_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * @var USPI_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6] |TXUDRIEN |Slave Transmit Under Run Interrupt Enable Bit - * | | |0 = Transmit under-run interrupt Disabled. - * | | |1 = Transmit under-run interrupt Enabled. - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Interrupt Enable Bit - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * @var USPI_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Over-run Interrupt Status - * | | |This bit indicates that a receive buffer overrun event has been detected - * | | |If RXOVIEN (USPI_BUFCTL[14]) is enabled, the corresponding interrupt request is activated - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun event has not been detected. - * | | |1 = A receive buffer overrun event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty and available for the next transmission datum. - * |[9] |TXFULL |Transmit Buffer Full Indicator - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * |[11] |TXUDRIF |Transmit Buffer Under-run Interrupt Status - * | | |This bit indicates that a transmit buffer under-run event has been detected - * | | |If enabled by TXUDRIEN (USPI_BUFCTL[6]), the corresponding interrupt request is activated - * | | |It is cleared by software writes 1 to this bit - * | | |0 = A transmit buffer under-run event has not been detected. - * | | |1 = A transmit buffer under-run event has been detected. - * @var USPI_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * | | |Notice: The I2C is not supporting PDMA function. - * @var USPI_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[1] |WKADDREN |Wake-up Address Match Enable Bit - * | | |0 = The chip is woken up according data toggle. - * | | |1 = The chip is woken up according address match. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var USPI_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var USPI_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLAVE |Slave Mode Selection - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[1] |SLV3WIRE |Slave 3-wire Mode Selection (Slave Only) - * | | |The SPI protocol can work with 3-wire interface (without slave select signal) in Slave mode. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[2] |SS |Slave Select Control (Master Only) - * | | |If AUTOSS bit is cleared, setting this bit to 1 will set the slave select signal to active state, and setting this bit to 0 will set the slave select signal back to inactive state. - * | | |If the AUTOSS function is enabled (AUTOSS = 1), the setting value of this bit will not affect the current state of slave select signal. - * | | |Note: In SPI protocol, the internal slave select signal is active high. - * |[3] |AUTOSS |Automatic Slave Select Function Enable (Master Only) - * | | |0 = Slave select signal will be controlled by the setting value of SS (USPI_PROTCTL[2]) bit. - * | | |1 = Slave select signal will be generated automatically - * | | |The slave select signal will be asserted by the SPI controller when transmit/receive is started, and will be de-asserted after each transmit/receive is finished. - * |[7:6] |SCLKMODE |Serial Bus Clock Mode - * | | |This bit field defines the SCLK idle status, data transmit, and data receive edge. - * | | |MODE0 = The idle state of SPI clock is low level - * | | |Data is transmitted with falling edge and received with rising edge. - * | | |MODE1 = The idle state of SPI clock is low level - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |MODE2 = The idle state of SPI clock is high level - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |MODE3 = The idle state of SPI clock is high level - * | | |Data is transmitted with falling edge and received with rising edge. - * |[11:8] |SUSPITV |Suspend Interval (Master Only) - * | | |This bit field provides the configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPI_CLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 ... 0.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0x1 ... 1.5 SPI_CLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE ... 14.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0xF ... 15.5 SPI_CLK clock cycle. - * |[14:12] |TSMSEL |Transmit Data Mode Selection - * | | |This bit field describes how receive and transmit data is shifted in and out. - * | | |TSMSEL = 000b: Full-duplex SPI. - * | | |TSMSEL = 100b: Half-duplex SPI. - * | | |Other values are reserved. - * | | |Note: Changing the value of this bit field will produce the TXRST and RXRST to clear the TX/RX data buffer automatically. - * |[25:16] |SLVTOCNT |Slave Mode Time-out Period (Slave Only) - * | | |In Slave mode, this bit field is used for Slave time-out period - * | | |This bit field indicates how many clock periods (selected by TMCNTSRC, USPI_BRGEN[5]) between the two edges of input SCLK will assert the Slave time-out event - * | | |Writing 0x0 into this bit field will disable the Slave time-out function. - * | | |Example: Assume SLVTOCNT is 0x0A and TMCNTSRC (USPI_BRGEN[5]) is 1, it means the time-out event will occur if the state of SPI bus clock pin is not changed more than (10+1) periods of fDIV_CLK. - * |[28] |TXUDRPOL |Transmit Under-run Data Polarity (for Slave) - * | | |This bit defines the transmitting data level when no data is available for transferring. - * | | |0 = The output data level is 0 if TX under run event occurs. - * | | |1 = The output data level is 1 if TX under run event occurs. - * |[31] |PROTEN |SPI Protocol Enable Bit - * | | |0 = SPI Protocol Disabled. - * | | |1 = SPI Protocol Enabled. - * @var USPI_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSINAIEN |Slave Select Inactive Interrupt Enable Control - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to inactive. - * | | |0 = Slave select inactive interrupt generation Disabled. - * | | |1 = Slave select inactive interrupt generation Enabled. - * |[1] |SSACTIEN |Slave Select Active Interrupt Enable Control - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to active. - * | | |0 = Slave select active interrupt generation Disabled. - * | | |1 = Slave select active interrupt generation Enabled. - * |[2] |SLVTOIEN |Slave Time-out Interrupt Enable Control - * | | |In SPI protocol, this bit enables the interrupt generation in case of a Slave time-out event. - * | | |0 = The Slave time-out interrupt Disabled. - * | | |1 = The Slave time-out interrupt Enabled. - * |[3] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Control - * | | |If data transfer is terminated by slave time-out or slave select inactive event in Slave mode, so that the transmit/receive data bit count does not match the setting of DWIDTH (USPI_LINECTL[11:8]) - * | | |Bit count error event occurs. - * | | |0 = The Slave mode bit count error interrupt Disabled. - * | | |1 = The Slave mode bit count error interrupt Enabled. - * @var USPI_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = Transmit start event does not occur. - * | | |1 = Transmit start event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = Transmit end event does not occur. - * | | |1 = Transmit end event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = Receive start event does not occur. - * | | |1 = Receive start event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = Receive end event does not occur. - * | | |1 = Receive end event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag (for Slave Only) - * | | |0 = Slave time-out event does not occur. - * | | |1 = Slave time-out event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[6] |SLVBEIF |Slave Bit Count Error Interrupt Flag (for Slave Only) - * | | |0 = Slave bit count error event does not occur. - * | | |1 = Slave bit count error event occurs. - * | | |Note: It is cleared by software writes 1 to this bit. - * |[8] |SSINAIF |Slave Select Inactive Interrupt Flag (for Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to inactive - * | | |It is cleared by software writes 1 to this bit - * | | |0 = The slave select signal has not changed to inactive. - * | | |1 = The slave select signal has changed to inactive. - * | | |Note: The internal slave select signal is active high. - * |[9] |SSACTIF |Slave Select Active Interrupt Flag (for Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to active - * | | |It is cleared by software writes one to this bit - * | | |0 = The slave select signal has not changed to active. - * | | |1 = The slave select signal has changed to active. - * | | |Note: The internal slave select signal is active high. - * |[16] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |This bit is only available in Slave mode - * | | |It used to monitor the current status of the input slave select signal on the bus. - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * |[17] |BUSY |Busy Status (Read Only) - * | | |0 = SPI is in idle state. - * | | |1 = SPI is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. USPI_PROTCTL[31] = 1 and the TXEMPTY = 0. - * | | |b. For SPI Master mode, the TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |d. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[18] |SLVUDR |Slave Mode Transmit Under-run Status (Read Only) - * | | |In Slave mode, if there is no available transmit data in buffer while transmit data shift out caused by input serial bus clock, this status flag will be set to 1 - * | | |This bit indicates whether the current shift-out data of word transmission is switched to TXUDRPOL (USPI_PROTCTL[28]) or not. - * | | |0 = Slave transmit under-run event does not occur. - * | | |1 = Slave transmit under-run event occurs. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[4]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} USPI_T; - -/** - @addtogroup USPI_CONST USPI Bit Field Definition - Constant Definitions for USPI Controller -@{ */ - -#define USPI_CTL_FUNMODE_Pos (0) /*!< USPI_T::CTL: FUNMODE Position */ -#define USPI_CTL_FUNMODE_Msk (0x7ul << USPI_CTL_FUNMODE_Pos) /*!< USPI_T::CTL: FUNMODE Mask */ - -#define USPI_INTEN_TXSTIEN_Pos (1) /*!< USPI_T::INTEN: TXSTIEN Position */ -#define USPI_INTEN_TXSTIEN_Msk (0x1ul << USPI_INTEN_TXSTIEN_Pos) /*!< USPI_T::INTEN: TXSTIEN Mask */ - -#define USPI_INTEN_TXENDIEN_Pos (2) /*!< USPI_T::INTEN: TXENDIEN Position */ -#define USPI_INTEN_TXENDIEN_Msk (0x1ul << USPI_INTEN_TXENDIEN_Pos) /*!< USPI_T::INTEN: TXENDIEN Mask */ - -#define USPI_INTEN_RXSTIEN_Pos (3) /*!< USPI_T::INTEN: RXSTIEN Position */ -#define USPI_INTEN_RXSTIEN_Msk (0x1ul << USPI_INTEN_RXSTIEN_Pos) /*!< USPI_T::INTEN: RXSTIEN Mask */ - -#define USPI_INTEN_RXENDIEN_Pos (4) /*!< USPI_T::INTEN: RXENDIEN Position */ -#define USPI_INTEN_RXENDIEN_Msk (0x1ul << USPI_INTEN_RXENDIEN_Pos) /*!< USPI_T::INTEN: RXENDIEN Mask */ - -#define USPI_BRGEN_RCLKSEL_Pos (0) /*!< USPI_T::BRGEN: RCLKSEL Position */ -#define USPI_BRGEN_RCLKSEL_Msk (0x1ul << USPI_BRGEN_RCLKSEL_Pos) /*!< USPI_T::BRGEN: RCLKSEL Mask */ - -#define USPI_BRGEN_PTCLKSEL_Pos (1) /*!< USPI_T::BRGEN: PTCLKSEL Position */ -#define USPI_BRGEN_PTCLKSEL_Msk (0x1ul << USPI_BRGEN_PTCLKSEL_Pos) /*!< USPI_T::BRGEN: PTCLKSEL Mask */ - -#define USPI_BRGEN_SPCLKSEL_Pos (2) /*!< USPI_T::BRGEN: SPCLKSEL Position */ -#define USPI_BRGEN_SPCLKSEL_Msk (0x3ul << USPI_BRGEN_SPCLKSEL_Pos) /*!< USPI_T::BRGEN: SPCLKSEL Mask */ - -#define USPI_BRGEN_TMCNTEN_Pos (4) /*!< USPI_T::BRGEN: TMCNTEN Position */ -#define USPI_BRGEN_TMCNTEN_Msk (0x1ul << USPI_BRGEN_TMCNTEN_Pos) /*!< USPI_T::BRGEN: TMCNTEN Mask */ - -#define USPI_BRGEN_TMCNTSRC_Pos (5) /*!< USPI_T::BRGEN: TMCNTSRC Position */ -#define USPI_BRGEN_TMCNTSRC_Msk (0x1ul << USPI_BRGEN_TMCNTSRC_Pos) /*!< USPI_T::BRGEN: TMCNTSRC Mask */ - -#define USPI_BRGEN_CLKDIV_Pos (16) /*!< USPI_T::BRGEN: CLKDIV Position */ -#define USPI_BRGEN_CLKDIV_Msk (0x3fful << USPI_BRGEN_CLKDIV_Pos) /*!< USPI_T::BRGEN: CLKDIV Mask */ - -#define USPI_DATIN0_SYNCSEL_Pos (0) /*!< USPI_T::DATIN0: SYNCSEL Position */ -#define USPI_DATIN0_SYNCSEL_Msk (0x1ul << USPI_DATIN0_SYNCSEL_Pos) /*!< USPI_T::DATIN0: SYNCSEL Mask */ - -#define USPI_DATIN0_ININV_Pos (2) /*!< USPI_T::DATIN0: ININV Position */ -#define USPI_DATIN0_ININV_Msk (0x1ul << USPI_DATIN0_ININV_Pos) /*!< USPI_T::DATIN0: ININV Mask */ - -#define USPI_CTLIN0_SYNCSEL_Pos (0) /*!< USPI_T::CTLIN0: SYNCSEL Position */ -#define USPI_CTLIN0_SYNCSEL_Msk (0x1ul << USPI_CTLIN0_SYNCSEL_Pos) /*!< USPI_T::CTLIN0: SYNCSEL Mask */ - -#define USPI_CTLIN0_ININV_Pos (2) /*!< USPI_T::CTLIN0: ININV Position */ -#define USPI_CTLIN0_ININV_Msk (0x1ul << USPI_CTLIN0_ININV_Pos) /*!< USPI_T::CTLIN0: ININV Mask */ - -#define USPI_CLKIN_SYNCSEL_Pos (0) /*!< USPI_T::CLKIN: SYNCSEL Position */ -#define USPI_CLKIN_SYNCSEL_Msk (0x1ul << USPI_CLKIN_SYNCSEL_Pos) /*!< USPI_T::CLKIN: SYNCSEL Mask */ - -#define USPI_LINECTL_LSB_Pos (0) /*!< USPI_T::LINECTL: LSB Position */ -#define USPI_LINECTL_LSB_Msk (0x1ul << USPI_LINECTL_LSB_Pos) /*!< USPI_T::LINECTL: LSB Mask */ - -#define USPI_LINECTL_DATOINV_Pos (5) /*!< USPI_T::LINECTL: DATOINV Position */ -#define USPI_LINECTL_DATOINV_Msk (0x1ul << USPI_LINECTL_DATOINV_Pos) /*!< USPI_T::LINECTL: DATOINV Mask */ - -#define USPI_LINECTL_CTLOINV_Pos (7) /*!< USPI_T::LINECTL: CTLOINV Position */ -#define USPI_LINECTL_CTLOINV_Msk (0x1ul << USPI_LINECTL_CTLOINV_Pos) /*!< USPI_T::LINECTL: CTLOINV Mask */ - -#define USPI_LINECTL_DWIDTH_Pos (8) /*!< USPI_T::LINECTL: DWIDTH Position */ -#define USPI_LINECTL_DWIDTH_Msk (0xful << USPI_LINECTL_DWIDTH_Pos) /*!< USPI_T::LINECTL: DWIDTH Mask */ - -#define USPI_TXDAT_TXDAT_Pos (0) /*!< USPI_T::TXDAT: TXDAT Position */ -#define USPI_TXDAT_TXDAT_Msk (0xfffful << USPI_TXDAT_TXDAT_Pos) /*!< USPI_T::TXDAT: TXDAT Mask */ - -#define USPI_TXDAT_PORTDIR_Pos (16) /*!< USPI_T::TXDAT: PORTDIR Position */ -#define USPI_TXDAT_PORTDIR_Msk (0x1ul << USPI_TXDAT_PORTDIR_Pos) /*!< USPI_T::TXDAT: PORTDIR Mask */ - -#define USPI_RXDAT_RXDAT_Pos (0) /*!< USPI_T::RXDAT: RXDAT Position */ -#define USPI_RXDAT_RXDAT_Msk (0xfffful << USPI_RXDAT_RXDAT_Pos) /*!< USPI_T::RXDAT: RXDAT Mask */ - -#define USPI_BUFCTL_TXUDRIEN_Pos (6) /*!< USPI_T::BUFCTL: TXUDRIEN Position */ -#define USPI_BUFCTL_TXUDRIEN_Msk (0x1ul << USPI_BUFCTL_TXUDRIEN_Pos) /*!< USPI_T::BUFCTL: TXUDRIEN Mask */ - -#define USPI_BUFCTL_TXCLR_Pos (7) /*!< USPI_T::BUFCTL: TXCLR Position */ -#define USPI_BUFCTL_TXCLR_Msk (0x1ul << USPI_BUFCTL_TXCLR_Pos) /*!< USPI_T::BUFCTL: TXCLR Mask */ - -#define USPI_BUFCTL_RXOVIEN_Pos (14) /*!< USPI_T::BUFCTL: RXOVIEN Position */ -#define USPI_BUFCTL_RXOVIEN_Msk (0x1ul << USPI_BUFCTL_RXOVIEN_Pos) /*!< USPI_T::BUFCTL: RXOVIEN Mask */ - -#define USPI_BUFCTL_RXCLR_Pos (15) /*!< USPI_T::BUFCTL: RXCLR Position */ -#define USPI_BUFCTL_RXCLR_Msk (0x1ul << USPI_BUFCTL_RXCLR_Pos) /*!< USPI_T::BUFCTL: RXCLR Mask */ - -#define USPI_BUFCTL_TXRST_Pos (16) /*!< USPI_T::BUFCTL: TXRST Position */ -#define USPI_BUFCTL_TXRST_Msk (0x1ul << USPI_BUFCTL_TXRST_Pos) /*!< USPI_T::BUFCTL: TXRST Mask */ - -#define USPI_BUFCTL_RXRST_Pos (17) /*!< USPI_T::BUFCTL: RXRST Position */ -#define USPI_BUFCTL_RXRST_Msk (0x1ul << USPI_BUFCTL_RXRST_Pos) /*!< USPI_T::BUFCTL: RXRST Mask */ - -#define USPI_BUFSTS_RXEMPTY_Pos (0) /*!< USPI_T::BUFSTS: RXEMPTY Position */ -#define USPI_BUFSTS_RXEMPTY_Msk (0x1ul << USPI_BUFSTS_RXEMPTY_Pos) /*!< USPI_T::BUFSTS: RXEMPTY Mask */ - -#define USPI_BUFSTS_RXFULL_Pos (1) /*!< USPI_T::BUFSTS: RXFULL Position */ -#define USPI_BUFSTS_RXFULL_Msk (0x1ul << USPI_BUFSTS_RXFULL_Pos) /*!< USPI_T::BUFSTS: RXFULL Mask */ - -#define USPI_BUFSTS_RXOVIF_Pos (3) /*!< USPI_T::BUFSTS: RXOVIF Position */ -#define USPI_BUFSTS_RXOVIF_Msk (0x1ul << USPI_BUFSTS_RXOVIF_Pos) /*!< USPI_T::BUFSTS: RXOVIF Mask */ - -#define USPI_BUFSTS_TXEMPTY_Pos (8) /*!< USPI_T::BUFSTS: TXEMPTY Position */ -#define USPI_BUFSTS_TXEMPTY_Msk (0x1ul << USPI_BUFSTS_TXEMPTY_Pos) /*!< USPI_T::BUFSTS: TXEMPTY Mask */ - -#define USPI_BUFSTS_TXFULL_Pos (9) /*!< USPI_T::BUFSTS: TXFULL Position */ -#define USPI_BUFSTS_TXFULL_Msk (0x1ul << USPI_BUFSTS_TXFULL_Pos) /*!< USPI_T::BUFSTS: TXFULL Mask */ - -#define USPI_BUFSTS_TXUDRIF_Pos (11) /*!< USPI_T::BUFSTS: TXUDRIF Position */ -#define USPI_BUFSTS_TXUDRIF_Msk (0x1ul << USPI_BUFSTS_TXUDRIF_Pos) /*!< USPI_T::BUFSTS: TXUDRIF Mask */ - -#define USPI_PDMACTL_PDMARST_Pos (0) /*!< USPI_T::PDMACTL: PDMARST Position */ -#define USPI_PDMACTL_PDMARST_Msk (0x1ul << USPI_PDMACTL_PDMARST_Pos) /*!< USPI_T::PDMACTL: PDMARST Mask */ - -#define USPI_PDMACTL_TXPDMAEN_Pos (1) /*!< USPI_T::PDMACTL: TXPDMAEN Position */ -#define USPI_PDMACTL_TXPDMAEN_Msk (0x1ul << USPI_PDMACTL_TXPDMAEN_Pos) /*!< USPI_T::PDMACTL: TXPDMAEN Mask */ - -#define USPI_PDMACTL_RXPDMAEN_Pos (2) /*!< USPI_T::PDMACTL: RXPDMAEN Position */ -#define USPI_PDMACTL_RXPDMAEN_Msk (0x1ul << USPI_PDMACTL_RXPDMAEN_Pos) /*!< USPI_T::PDMACTL: RXPDMAEN Mask */ - -#define USPI_PDMACTL_PDMAEN_Pos (3) /*!< USPI_T::PDMACTL: PDMAEN Position */ -#define USPI_PDMACTL_PDMAEN_Msk (0x1ul << USPI_PDMACTL_PDMAEN_Pos) /*!< USPI_T::PDMACTL: PDMAEN Mask */ - -#define USPI_WKCTL_WKEN_Pos (0) /*!< USPI_T::WKCTL: WKEN Position */ -#define USPI_WKCTL_WKEN_Msk (0x1ul << USPI_WKCTL_WKEN_Pos) /*!< USPI_T::WKCTL: WKEN Mask */ - -#define USPI_WKCTL_WKADDREN_Pos (1) /*!< USPI_T::WKCTL: WKADDREN Position */ -#define USPI_WKCTL_WKADDREN_Msk (0x1ul << USPI_WKCTL_WKADDREN_Pos) /*!< USPI_T::WKCTL: WKADDREN Mask */ - -#define USPI_WKCTL_PDBOPT_Pos (2) /*!< USPI_T::WKCTL: PDBOPT Position */ -#define USPI_WKCTL_PDBOPT_Msk (0x1ul << USPI_WKCTL_PDBOPT_Pos) /*!< USPI_T::WKCTL: PDBOPT Mask */ - -#define USPI_WKSTS_WKF_Pos (0) /*!< USPI_T::WKSTS: WKF Position */ -#define USPI_WKSTS_WKF_Msk (0x1ul << USPI_WKSTS_WKF_Pos) /*!< USPI_T::WKSTS: WKF Mask */ - -#define USPI_PROTCTL_SLAVE_Pos (0) /*!< USPI_T::PROTCTL: SLAVE Position */ -#define USPI_PROTCTL_SLAVE_Msk (0x1ul << USPI_PROTCTL_SLAVE_Pos) /*!< USPI_T::PROTCTL: SLAVE Mask */ - -#define USPI_PROTCTL_SLV3WIRE_Pos (1) /*!< USPI_T::PROTCTL: SLV3WIRE Position */ -#define USPI_PROTCTL_SLV3WIRE_Msk (0x1ul << USPI_PROTCTL_SLV3WIRE_Pos) /*!< USPI_T::PROTCTL: SLV3WIRE Mask */ - -#define USPI_PROTCTL_SS_Pos (2) /*!< USPI_T::PROTCTL: SS Position */ -#define USPI_PROTCTL_SS_Msk (0x1ul << USPI_PROTCTL_SS_Pos) /*!< USPI_T::PROTCTL: SS Mask */ - -#define USPI_PROTCTL_AUTOSS_Pos (3) /*!< USPI_T::PROTCTL: AUTOSS Position */ -#define USPI_PROTCTL_AUTOSS_Msk (0x1ul << USPI_PROTCTL_AUTOSS_Pos) /*!< USPI_T::PROTCTL: AUTOSS Mask */ - -#define USPI_PROTCTL_SCLKMODE_Pos (6) /*!< USPI_T::PROTCTL: SCLKMODE Position */ -#define USPI_PROTCTL_SCLKMODE_Msk (0x3ul << USPI_PROTCTL_SCLKMODE_Pos) /*!< USPI_T::PROTCTL: SCLKMODE Mask */ - -#define USPI_PROTCTL_SUSPITV_Pos (8) /*!< USPI_T::PROTCTL: SUSPITV Position */ -#define USPI_PROTCTL_SUSPITV_Msk (0xful << USPI_PROTCTL_SUSPITV_Pos) /*!< USPI_T::PROTCTL: SUSPITV Mask */ - -#define USPI_PROTCTL_TSMSEL_Pos (12) /*!< USPI_T::PROTCTL: TSMSEL Position */ -#define USPI_PROTCTL_TSMSEL_Msk (0x7ul << USPI_PROTCTL_TSMSEL_Pos) /*!< USPI_T::PROTCTL: TSMSEL Mask */ - -#define USPI_PROTCTL_SLVTOCNT_Pos (16) /*!< USPI_T::PROTCTL: SLVTOCNT Position */ -#define USPI_PROTCTL_SLVTOCNT_Msk (0x3fful << USPI_PROTCTL_SLVTOCNT_Pos) /*!< USPI_T::PROTCTL: SLVTOCNT Mask */ - -#define USPI_PROTCTL_TXUDRPOL_Pos (28) /*!< USPI_T::PROTCTL: TXUDRPOL Position */ -#define USPI_PROTCTL_TXUDRPOL_Msk (0x1ul << USPI_PROTCTL_TXUDRPOL_Pos) /*!< USPI_T::PROTCTL: TXUDRPOL Mask */ - -#define USPI_PROTCTL_PROTEN_Pos (31) /*!< USPI_T::PROTCTL: PROTEN Position */ -#define USPI_PROTCTL_PROTEN_Msk (0x1ul << USPI_PROTCTL_PROTEN_Pos) /*!< USPI_T::PROTCTL: PROTEN Mask */ - -#define USPI_PROTIEN_SSINAIEN_Pos (0) /*!< USPI_T::PROTIEN: SSINAIEN Position */ -#define USPI_PROTIEN_SSINAIEN_Msk (0x1ul << USPI_PROTIEN_SSINAIEN_Pos) /*!< USPI_T::PROTIEN: SSINAIEN Mask */ - -#define USPI_PROTIEN_SSACTIEN_Pos (1) /*!< USPI_T::PROTIEN: SSACTIEN Position */ -#define USPI_PROTIEN_SSACTIEN_Msk (0x1ul << USPI_PROTIEN_SSACTIEN_Pos) /*!< USPI_T::PROTIEN: SSACTIEN Mask */ - -#define USPI_PROTIEN_SLVTOIEN_Pos (2) /*!< USPI_T::PROTIEN: SLVTOIEN Position */ -#define USPI_PROTIEN_SLVTOIEN_Msk (0x1ul << USPI_PROTIEN_SLVTOIEN_Pos) /*!< USPI_T::PROTIEN: SLVTOIEN Mask */ - -#define USPI_PROTIEN_SLVBEIEN_Pos (3) /*!< USPI_T::PROTIEN: SLVBEIEN Position */ -#define USPI_PROTIEN_SLVBEIEN_Msk (0x1ul << USPI_PROTIEN_SLVBEIEN_Pos) /*!< USPI_T::PROTIEN: SLVBEIEN Mask */ - -#define USPI_PROTSTS_TXSTIF_Pos (1) /*!< USPI_T::PROTSTS: TXSTIF Position */ -#define USPI_PROTSTS_TXSTIF_Msk (0x1ul << USPI_PROTSTS_TXSTIF_Pos) /*!< USPI_T::PROTSTS: TXSTIF Mask */ - -#define USPI_PROTSTS_TXENDIF_Pos (2) /*!< USPI_T::PROTSTS: TXENDIF Position */ -#define USPI_PROTSTS_TXENDIF_Msk (0x1ul << USPI_PROTSTS_TXENDIF_Pos) /*!< USPI_T::PROTSTS: TXENDIF Mask */ - -#define USPI_PROTSTS_RXSTIF_Pos (3) /*!< USPI_T::PROTSTS: RXSTIF Position */ -#define USPI_PROTSTS_RXSTIF_Msk (0x1ul << USPI_PROTSTS_RXSTIF_Pos) /*!< USPI_T::PROTSTS: RXSTIF Mask */ - -#define USPI_PROTSTS_RXENDIF_Pos (4) /*!< USPI_T::PROTSTS: RXENDIF Position */ -#define USPI_PROTSTS_RXENDIF_Msk (0x1ul << USPI_PROTSTS_RXENDIF_Pos) /*!< USPI_T::PROTSTS: RXENDIF Mask */ - -#define USPI_PROTSTS_SLVTOIF_Pos (5) /*!< USPI_T::PROTSTS: SLVTOIF Position */ -#define USPI_PROTSTS_SLVTOIF_Msk (0x1ul << USPI_PROTSTS_SLVTOIF_Pos) /*!< USPI_T::PROTSTS: SLVTOIF Mask */ - -#define USPI_PROTSTS_SLVBEIF_Pos (6) /*!< USPI_T::PROTSTS: SLVBEIF Position */ -#define USPI_PROTSTS_SLVBEIF_Msk (0x1ul << USPI_PROTSTS_SLVBEIF_Pos) /*!< USPI_T::PROTSTS: SLVBEIF Mask */ - -#define USPI_PROTSTS_SSINAIF_Pos (8) /*!< USPI_T::PROTSTS: SSINAIF Position */ -#define USPI_PROTSTS_SSINAIF_Msk (0x1ul << USPI_PROTSTS_SSINAIF_Pos) /*!< USPI_T::PROTSTS: SSINAIF Mask */ - -#define USPI_PROTSTS_SSACTIF_Pos (9) /*!< USPI_T::PROTSTS: SSACTIF Position */ -#define USPI_PROTSTS_SSACTIF_Msk (0x1ul << USPI_PROTSTS_SSACTIF_Pos) /*!< USPI_T::PROTSTS: SSACTIF Mask */ - -#define USPI_PROTSTS_SSLINE_Pos (16) /*!< USPI_T::PROTSTS: SSLINE Position */ -#define USPI_PROTSTS_SSLINE_Msk (0x1ul << USPI_PROTSTS_SSLINE_Pos) /*!< USPI_T::PROTSTS: SSLINE Mask */ - -#define USPI_PROTSTS_BUSY_Pos (17) /*!< USPI_T::PROTSTS: BUSY Position */ -#define USPI_PROTSTS_BUSY_Msk (0x1ul << USPI_PROTSTS_BUSY_Pos) /*!< USPI_T::PROTSTS: BUSY Mask */ - -#define USPI_PROTSTS_SLVUDR_Pos (18) /*!< USPI_T::PROTSTS: SLVUDR Position */ -#define USPI_PROTSTS_SLVUDR_Msk (0x1ul << USPI_PROTSTS_SLVUDR_Pos) /*!< USPI_T::PROTSTS: SLVUDR Mask */ - -/**@}*/ /* USPI_CONST */ -/**@}*/ /* end of USPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __USPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uuart_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uuart_reg.h deleted file mode 100644 index adb12a3a922..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/uuart_reg.h +++ /dev/null @@ -1,689 +0,0 @@ -/**************************************************************************//** - * @file uuart_reg.h - * @version V3.00 - * @brief UUART register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UUART_REG_H__ -#define __UUART_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UUART UART Mode of USCI Controller(UUART) - Memory Mapped Structure for UUART Controller -@{ */ - -typedef struct -{ - - - /** - * @var UUART_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller. - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI. - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol. - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Others = Reserved. - * @var UUART_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt is disabled. - * | | |1 = The transmit start interrupt is enabled. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt is disabled. - * | | |1 = The transmit finish interrupt is enabled. - * |[3] |RXSTIEN |Receive Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt is disabled. - * | | |1 = The receive start interrupt is enabled. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt is disabled. - * | | |1 = The receive end interrupt is enabled. - * @var UUART_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK is selected to fDIV_CLK. - * | | |01 = fSAMP_CLK is selected to fPROT_CLK. - * | | |10 = fSAMP_CLK is selected to fSCLK. - * | | |11 = fSAMP_CLK is selected to fREF_CLK. - * |[4] |TMCNTEN |Timing Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Timing measurement counter is Disabled. - * | | |1 = Timing measurement counter is Enabled. - * |[5] |TMCNTSRC |Timing Measurement Counter Clock Source Selection - * | | |0 = Timing measurement counter with fPROT_CLK. - * | | |1 = Timing measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK. - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * | | |Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value. - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(USCI_PROTCTL[6])) is enabled. - * | | |The revised value is the average bit time between bit 5 and bit 6. - * | | |The user can use revised CLKDIV and new BRDETITV (UUART_PROTCTL[24:16]) to calculate the precise baud rate. - * @var UUART_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * |[4:3] |EDGEDET |Input Signal Edge Detection Mode - * | | |This bit field selects which edge actives the trigger event of input data signal. - * | | |00 = The trigger event activation is disabled. - * | | |01 = A rising edge activates the trigger event of input data signal. - * | | |10 = A falling edge activates the trigger event of input data signal. - * | | |11 = Both edges activate the trigger event of input data signal. - * | | |Note: In UART function mode, it is suggested to set this bit field as 0x2. - * @var UUART_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var UUART_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * @var UUART_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT1 pin. - * | | |0 = The value of USCIx_DAT1 is equal to the data shift register. - * | | |1 = The value of USCIx_DAT1 is the inversion of data shift register. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: In UART protocol, the control signal means nRTS signal. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission. - * | | |The data word is always right-aligned in the data buffer. - * | | |USCI support word length from 4 to 16 bits. - * | | |0000 = The data word contains 16 bits located at bit positions [15:0]. - * | | |0001 = Reserved. - * | | |0010 = Reserved. - * | | |0011 = Reserved. - * | | |0100 = The data word contains 4 bits located at bit positions [3:0]. - * | | |0101 = The data word contains 5 bits located at bit positions [4:0]. - * | | |0110 = The data word contains 6 bits located at bit positions [5:0]. - * | | |0111 = The data word contains 7 bits located at bit positions [6:0]. - * | | |1000 = The data word contains 8 bits located at bit positions [7:0]. - * | | |1001 = The data word contains 9 bits located at bit positions [8:0]. - * | | |1010 = The data word contains 10 bits located at bit positions [9:0]. - * | | |1011 = The data word contains 11 bits located at bit positions [10:0]. - * | | |1100 = The data word contains 12 bits located at bit positions [11:0]. - * | | |1101 = The data word contains 13 bits located at bit positions [12:0]. - * | | |1110 = The data word contains 14 bits located at bit positions [13:0]. - * | | |1111 = The data word contains 15 bits located at bit positions [14:0]. - * | | |Note: In UART protocol, the length can be configured as 6~13 bits. - * @var UUART_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UUART_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note: RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (USCI_PROTSTS[7:5]). - * @var UUART_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared (filling level is cleared and output pointer is set to input pointer value). - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Error Interrupt Enable Control - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared (filling level is cleared and output pointer is set to input pointer value). - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note 1: It is cleared automatically after one PCLK cycle. - * | | |Note 2: It is suggest to check the RXBUSY (UUART_PROTSTS[10]) before this bit will be set to 1. - * @var UUART_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Over-run Error Interrupt Status - * | | |This bit indicates that a receive buffer overrun error event has been detected. - * | | |If RXOVIEN (UUART_BUFCTL[14]) is enabled, the corresponding interrupt request is activated. - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun error event has not been detected. - * | | |1 = A receive buffer overrun error event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty. - * |[9] |TXFULL |Transmit Buffer Full Indicator - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * @var UUART_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * @var UUART_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var UUART_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1. - * | | |Software can write 1 to clear this bit. - * @var UUART_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STOPB |Stop Bits - * | | |This bit defines the number of stop bits in an UART frame. - * | | |0 = The number of stop bits is 1. - * | | |1 = The number of stop bits is 2. - * |[1] |PARITYEN |Parity Enable Bit - * | | |This bit defines the parity bit is enabled in an UART frame. - * | | |0 = The parity bit Disabled. - * | | |1 = The parity bit Enabled. - * |[2] |EVENPARITY|Even Parity Enable Bit - * | | |0 = Odd number of logic 1's is transmitted and checked in each word. - * | | |1 = Even number of logic 1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PARITYEN is set. - * |[3] |RTSAUTOEN |nRTS Auto-flow Control Enable Bit - * | | |When nRTS auto-flow is enabled, if the receiver buffer is full (RXFULL (UUART_BUFSTS[1] = 1)), the UART will de-assert nRTS signal. - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: This bit has effect only when the RTSAUDIREN is not set. - * |[4] |CTSAUTOEN |nCTS Auto-flow Control Enable Bit - * | | |When nCTS auto-flow is enabled, the UART will send data to external device when nCTS input assert (UART will not send data to device if nCTS input is dis-asserted). - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * |[5] |RTSAUDIREN|nRTS Auto Direction Enable Bit - * | | |When nRTS auto direction is enabled, if the transmitted bytes in the TX buffer is empty, the UART asserted nRTS signal automatically. - * | | |0 = nRTS auto direction control Disabled. - * | | |1 = nRTS auto direction control Enabled. - * | | |Note 1: This bit is used for nRTS auto direction control for RS485. - * | | |Note 2: This bit has effect only when the RTSAUTOEN is not set. - * |[6] |ABREN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note: When the auto-baud rate detect operation finishes, hardware will clear this bit. - * | | |The associated interrupt ABRDETIF (UUART_PROTST[9]) will be generated (If ARBIEN (UUART_PROTIEN [1]) is enabled). - * |[9] |DATWKEN |Data Wake-up Mode Enable Bit - * | | |0 = Data wake-up mode Disabled. - * | | |1 = Data wake-up mode Enabled. - * |[10] |CTSWKEN |nCTS Wake-up Mode Enable Bit - * | | |0 = nCTS wake-up mode Disabled. - * | | |1 = nCTS wake-up mode Enabled. - * |[14:11] |WAKECNT |Wake-up Counter - * | | |These bits field indicate how many clock cycle selected by fPDS_CNT do the slave can get the 1st bit (start bit) when the device is wake-up from Power-down mode. - * |[24:16] |BRDETITV |Baud Rate Detection Interval - * | | |This bit fields indicate how many clock cycle selected by TMCNTSRC (UUART_BRGEN [5]) does the slave calculates the baud rate in one bits. - * | | |The order of the bus shall be 1 and 0 step by step (e.g. the input data pattern shall be 0x55). - * | | |The user can read the value to know the current input baud rate of the bus whenever the ABRDETIF (UUART_PROTCTL[9]) is set. - * | | |Note: This bit can be cleared to 0 by software writing '0' to the BRDETITV. - * |[26] |STICKEN |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: Refer to RS-485 Support section for detail information. - * |[29] |BCEN |Transmit Break Control Enable Bit - * | | |0 = Transmit Break Control Disabled. - * | | |1 = Transmit Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the serial data output (TX) is forced to the Spacing State (logic 0). - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[30] |DGE |Deglitch Enable Bit - * | | |0 = Deglitch Disabled. - * | | |1 = Deglitch Enabled. - * | | |Note 1: When this bit is set to logic 1, any pulse width less than about 150 ns will be considered a glitch and will be removed in the serial data input (RX). - * | | |This bit acts only on RX line and has no effect on the transmitter logic. - * | | |Note 2: It is recommended to set this bit only when operating at baud rate under 2.5 Mbps. - * |[31] |PROTEN |UART Protocol Enable Bit - * | | |0 = UART Protocol Disabled. - * | | |1 = UART Protocol Enabled. - * @var UUART_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive line status interrupt Disabled. - * | | |1 = Receive line status interrupt Enabled. - * | | |Note: UUART_PROTSTS[7:5] indicates the current interrupt event for receive line status interrupt. - * @var UUART_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = A transmit start interrupt status has not occurred. - * | | |1 = A transmit start interrupt status has occurred. - * | | |Note 1: It is cleared by software writing one into this bit. - * | | |Note 2: Used for user to load next transmit data when there is no data in transmit buffer. - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = A transmit end interrupt status has not occurred. - * | | |1 = A transmit end interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = A receive start interrupt status has not occurred. - * | | |1 = A receive start interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = A receive finish interrupt status has not occurred. - * | | |1 = A receive finish interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[5] |PARITYERR |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'parity bit'. - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. - * |[6] |FRMERR |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'stop bit'(that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. - * |[7] |BREAK |Break Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the 'spacing state' - * | | |(logic 0) for longer than a full word transmission time (that is, the total time of start bit + data bits + parity + stop bits). - * | | |0 = No Break is generated. - * | | |1 = Break is generated in the receiver bus. - * | | |Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. - * |[9] |ABRDETIF |Auto-baud Rate Interrupt Flag - * | | |This bit is set when auto-baud rate detection is done among the falling edge of the input data. - * | | |If the ABRIEN (UUART_PROTCTL[6]) is set, the auto-baud rate interrupt will be generated. - * | | |This bit can be set 4 times when the input data pattern is 0x55 and it is cleared before the next falling edge of the input bus. - * | | |0 = Auto-baud rate detect function is not done. - * | | |1 = One Bit auto-baud rate detect function is done. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[10] |RXBUSY |RX Bus Status Flag (Read Only) - * | | |This bit indicates the busy status of the receiver. - * | | |0 = The receiver is Idle. - * | | |1 = The receiver is BUSY. - * |[11] |ABERRSTS |Auto-baud Rate Error Status - * | | |This bit is set when auto-baud rate detection counter overrun - * | | |When the auto-baud rate counter overrun, the user shall revise the CLKDIV (UUART_BRGEN[25:16]) value and enable ABREN (UUART_PROTCTL[6]) to detect the correct baud rate again. - * | | |0 = Auto-baud rate detect counter is not overrun. - * | | |1 = Auto-baud rate detect counter is overrun. - * | | |Note 1: This bit is set at the same time of ABRDETIF. - * | | |Note 2: This bit can be cleared by writing '1' to ABRDETIF or ABERRSTS. - * |[16] |CTSSYNCLV |nCTS Synchronized Level Status (Read Only) - * | | |This bit used to indicate the current status of the internal synchronized nCTS signal. - * | | |0 = The internal synchronized nCTS is low. - * | | |1 = The internal synchronized nCTS is high. - * |[17] |CTSLV |nCTS Pin Status (Read Only) - * | | |This bit used to monitor the current status of nCTS pin input. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __IO uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __IO uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[4]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} UUART_T; - -/** - @addtogroup UUART_CONST UUART Bit Field Definition - Constant Definitions for UUART Controller -@{ */ - -#define UUART_CTL_FUNMODE_Pos (0) /*!< UUART_T::CTL: FUNMODE Position */ -#define UUART_CTL_FUNMODE_Msk (0x7ul << UUART_CTL_FUNMODE_Pos) /*!< UUART_T::CTL: FUNMODE Mask */ - -#define UUART_INTEN_TXSTIEN_Pos (1) /*!< UUART_T::INTEN: TXSTIEN Position */ -#define UUART_INTEN_TXSTIEN_Msk (0x1ul << UUART_INTEN_TXSTIEN_Pos) /*!< UUART_T::INTEN: TXSTIEN Mask */ - -#define UUART_INTEN_TXENDIEN_Pos (2) /*!< UUART_T::INTEN: TXENDIEN Position */ -#define UUART_INTEN_TXENDIEN_Msk (0x1ul << UUART_INTEN_TXENDIEN_Pos) /*!< UUART_T::INTEN: TXENDIEN Mask */ - -#define UUART_INTEN_RXSTIEN_Pos (3) /*!< UUART_T::INTEN: RXSTIEN Position */ -#define UUART_INTEN_RXSTIEN_Msk (0x1ul << UUART_INTEN_RXSTIEN_Pos) /*!< UUART_T::INTEN: RXSTIEN Mask */ - -#define UUART_INTEN_RXENDIEN_Pos (4) /*!< UUART_T::INTEN: RXENDIEN Position */ -#define UUART_INTEN_RXENDIEN_Msk (0x1ul << UUART_INTEN_RXENDIEN_Pos) /*!< UUART_T::INTEN: RXENDIEN Mask */ - -#define UUART_BRGEN_RCLKSEL_Pos (0) /*!< UUART_T::BRGEN: RCLKSEL Position */ -#define UUART_BRGEN_RCLKSEL_Msk (0x1ul << UUART_BRGEN_RCLKSEL_Pos) /*!< UUART_T::BRGEN: RCLKSEL Mask */ - -#define UUART_BRGEN_PTCLKSEL_Pos (1) /*!< UUART_T::BRGEN: PTCLKSEL Position */ -#define UUART_BRGEN_PTCLKSEL_Msk (0x1ul << UUART_BRGEN_PTCLKSEL_Pos) /*!< UUART_T::BRGEN: PTCLKSEL Mask */ - -#define UUART_BRGEN_SPCLKSEL_Pos (2) /*!< UUART_T::BRGEN: SPCLKSEL Position */ -#define UUART_BRGEN_SPCLKSEL_Msk (0x3ul << UUART_BRGEN_SPCLKSEL_Pos) /*!< UUART_T::BRGEN: SPCLKSEL Mask */ - -#define UUART_BRGEN_TMCNTEN_Pos (4) /*!< UUART_T::BRGEN: TMCNTEN Position */ -#define UUART_BRGEN_TMCNTEN_Msk (0x1ul << UUART_BRGEN_TMCNTEN_Pos) /*!< UUART_T::BRGEN: TMCNTEN Mask */ - -#define UUART_BRGEN_TMCNTSRC_Pos (5) /*!< UUART_T::BRGEN: TMCNTSRC Position */ -#define UUART_BRGEN_TMCNTSRC_Msk (0x1ul << UUART_BRGEN_TMCNTSRC_Pos) /*!< UUART_T::BRGEN: TMCNTSRC Mask */ - -#define UUART_BRGEN_PDSCNT_Pos (8) /*!< UUART_T::BRGEN: PDSCNT Position */ -#define UUART_BRGEN_PDSCNT_Msk (0x3ul << UUART_BRGEN_PDSCNT_Pos) /*!< UUART_T::BRGEN: PDSCNT Mask */ - -#define UUART_BRGEN_DSCNT_Pos (10) /*!< UUART_T::BRGEN: DSCNT Position */ -#define UUART_BRGEN_DSCNT_Msk (0x1ful << UUART_BRGEN_DSCNT_Pos) /*!< UUART_T::BRGEN: DSCNT Mask */ - -#define UUART_BRGEN_CLKDIV_Pos (16) /*!< UUART_T::BRGEN: CLKDIV Position */ -#define UUART_BRGEN_CLKDIV_Msk (0x3fful << UUART_BRGEN_CLKDIV_Pos) /*!< UUART_T::BRGEN: CLKDIV Mask */ - -#define UUART_DATIN0_SYNCSEL_Pos (0) /*!< UUART_T::DATIN0: SYNCSEL Position */ -#define UUART_DATIN0_SYNCSEL_Msk (0x1ul << UUART_DATIN0_SYNCSEL_Pos) /*!< UUART_T::DATIN0: SYNCSEL Mask */ - -#define UUART_DATIN0_ININV_Pos (2) /*!< UUART_T::DATIN0: ININV Position */ -#define UUART_DATIN0_ININV_Msk (0x1ul << UUART_DATIN0_ININV_Pos) /*!< UUART_T::DATIN0: ININV Mask */ - -#define UUART_DATIN0_EDGEDET_Pos (3) /*!< UUART_T::DATIN0: EDGEDET Position */ -#define UUART_DATIN0_EDGEDET_Msk (0x3ul << UUART_DATIN0_EDGEDET_Pos) /*!< UUART_T::DATIN0: EDGEDET Mask */ - -#define UUART_CTLIN0_SYNCSEL_Pos (0) /*!< UUART_T::CTLIN0: SYNCSEL Position */ -#define UUART_CTLIN0_SYNCSEL_Msk (0x1ul << UUART_CTLIN0_SYNCSEL_Pos) /*!< UUART_T::CTLIN0: SYNCSEL Mask */ - -#define UUART_CTLIN0_ININV_Pos (2) /*!< UUART_T::CTLIN0: ININV Position */ -#define UUART_CTLIN0_ININV_Msk (0x1ul << UUART_CTLIN0_ININV_Pos) /*!< UUART_T::CTLIN0: ININV Mask */ - -#define UUART_CLKIN_SYNCSEL_Pos (0) /*!< UUART_T::CLKIN: SYNCSEL Position */ -#define UUART_CLKIN_SYNCSEL_Msk (0x1ul << UUART_CLKIN_SYNCSEL_Pos) /*!< UUART_T::CLKIN: SYNCSEL Mask */ - -#define UUART_LINECTL_LSB_Pos (0) /*!< UUART_T::LINECTL: LSB Position */ -#define UUART_LINECTL_LSB_Msk (0x1ul << UUART_LINECTL_LSB_Pos) /*!< UUART_T::LINECTL: LSB Mask */ - -#define UUART_LINECTL_DATOINV_Pos (5) /*!< UUART_T::LINECTL: DATOINV Position */ -#define UUART_LINECTL_DATOINV_Msk (0x1ul << UUART_LINECTL_DATOINV_Pos) /*!< UUART_T::LINECTL: DATOINV Mask */ - -#define UUART_LINECTL_CTLOINV_Pos (7) /*!< UUART_T::LINECTL: CTLOINV Position */ -#define UUART_LINECTL_CTLOINV_Msk (0x1ul << UUART_LINECTL_CTLOINV_Pos) /*!< UUART_T::LINECTL: CTLOINV Mask */ - -#define UUART_LINECTL_DWIDTH_Pos (8) /*!< UUART_T::LINECTL: DWIDTH Position */ -#define UUART_LINECTL_DWIDTH_Msk (0xful << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_T::LINECTL: DWIDTH Mask */ - -#define UUART_TXDAT_TXDAT_Pos (0) /*!< UUART_T::TXDAT: TXDAT Position */ -#define UUART_TXDAT_TXDAT_Msk (0xfffful << UUART_TXDAT_TXDAT_Pos) /*!< UUART_T::TXDAT: TXDAT Mask */ - -#define UUART_RXDAT_RXDAT_Pos (0) /*!< UUART_T::RXDAT: RXDAT Position */ -#define UUART_RXDAT_RXDAT_Msk (0xfffful << UUART_RXDAT_RXDAT_Pos) /*!< UUART_T::RXDAT: RXDAT Mask */ - -#define UUART_BUFCTL_TXCLR_Pos (7) /*!< UUART_T::BUFCTL: TXCLR Position */ -#define UUART_BUFCTL_TXCLR_Msk (0x1ul << UUART_BUFCTL_TXCLR_Pos) /*!< UUART_T::BUFCTL: TXCLR Mask */ - -#define UUART_BUFCTL_RXOVIEN_Pos (14) /*!< UUART_T::BUFCTL: RXOVIEN Position */ -#define UUART_BUFCTL_RXOVIEN_Msk (0x1ul << UUART_BUFCTL_RXOVIEN_Pos) /*!< UUART_T::BUFCTL: RXOVIEN Mask */ - -#define UUART_BUFCTL_RXCLR_Pos (15) /*!< UUART_T::BUFCTL: RXCLR Position */ -#define UUART_BUFCTL_RXCLR_Msk (0x1ul << UUART_BUFCTL_RXCLR_Pos) /*!< UUART_T::BUFCTL: RXCLR Mask */ - -#define UUART_BUFCTL_TXRST_Pos (16) /*!< UUART_T::BUFCTL: TXRST Position */ -#define UUART_BUFCTL_TXRST_Msk (0x1ul << UUART_BUFCTL_TXRST_Pos) /*!< UUART_T::BUFCTL: TXRST Mask */ - -#define UUART_BUFCTL_RXRST_Pos (17) /*!< UUART_T::BUFCTL: RXRST Position */ -#define UUART_BUFCTL_RXRST_Msk (0x1ul << UUART_BUFCTL_RXRST_Pos) /*!< UUART_T::BUFCTL: RXRST Mask */ - -#define UUART_BUFSTS_RXEMPTY_Pos (0) /*!< UUART_T::BUFSTS: RXEMPTY Position */ -#define UUART_BUFSTS_RXEMPTY_Msk (0x1ul << UUART_BUFSTS_RXEMPTY_Pos) /*!< UUART_T::BUFSTS: RXEMPTY Mask */ - -#define UUART_BUFSTS_RXFULL_Pos (1) /*!< UUART_T::BUFSTS: RXFULL Position */ -#define UUART_BUFSTS_RXFULL_Msk (0x1ul << UUART_BUFSTS_RXFULL_Pos) /*!< UUART_T::BUFSTS: RXFULL Mask */ - -#define UUART_BUFSTS_RXOVIF_Pos (3) /*!< UUART_T::BUFSTS: RXOVIF Position */ -#define UUART_BUFSTS_RXOVIF_Msk (0x1ul << UUART_BUFSTS_RXOVIF_Pos) /*!< UUART_T::BUFSTS: RXOVIF Mask */ - -#define UUART_BUFSTS_TXEMPTY_Pos (8) /*!< UUART_T::BUFSTS: TXEMPTY Position */ -#define UUART_BUFSTS_TXEMPTY_Msk (0x1ul << UUART_BUFSTS_TXEMPTY_Pos) /*!< UUART_T::BUFSTS: TXEMPTY Mask */ - -#define UUART_BUFSTS_TXFULL_Pos (9) /*!< UUART_T::BUFSTS: TXFULL Position */ -#define UUART_BUFSTS_TXFULL_Msk (0x1ul << UUART_BUFSTS_TXFULL_Pos) /*!< UUART_T::BUFSTS: TXFULL Mask */ - -#define UUART_PDMACTL_PDMARST_Pos (0) /*!< UUART_T::PDMACTL: PDMARST Position */ -#define UUART_PDMACTL_PDMARST_Msk (0x1ul << UUART_PDMACTL_PDMARST_Pos) /*!< UUART_T::PDMACTL: PDMARST Mask */ - -#define UUART_PDMACTL_TXPDMAEN_Pos (1) /*!< UUART_T::PDMACTL: TXPDMAEN Position */ -#define UUART_PDMACTL_TXPDMAEN_Msk (0x1ul << UUART_PDMACTL_TXPDMAEN_Pos) /*!< UUART_T::PDMACTL: TXPDMAEN Mask */ - -#define UUART_PDMACTL_RXPDMAEN_Pos (2) /*!< UUART_T::PDMACTL: RXPDMAEN Position */ -#define UUART_PDMACTL_RXPDMAEN_Msk (0x1ul << UUART_PDMACTL_RXPDMAEN_Pos) /*!< UUART_T::PDMACTL: RXPDMAEN Mask */ - -#define UUART_PDMACTL_PDMAEN_Pos (3) /*!< UUART_T::PDMACTL: PDMAEN Position */ -#define UUART_PDMACTL_PDMAEN_Msk (0x1ul << UUART_PDMACTL_PDMAEN_Pos) /*!< UUART_T::PDMACTL: PDMAEN Mask */ - -#define UUART_WKCTL_WKEN_Pos (0) /*!< UUART_T::WKCTL: WKEN Position */ -#define UUART_WKCTL_WKEN_Msk (0x1ul << UUART_WKCTL_WKEN_Pos) /*!< UUART_T::WKCTL: WKEN Mask */ - -#define UUART_WKCTL_PDBOPT_Pos (2) /*!< UUART_T::WKCTL: PDBOPT Position */ -#define UUART_WKCTL_PDBOPT_Msk (0x1ul << UUART_WKCTL_PDBOPT_Pos) /*!< UUART_T::WKCTL: PDBOPT Mask */ - -#define UUART_WKSTS_WKF_Pos (0) /*!< UUART_T::WKSTS: WKF Position */ -#define UUART_WKSTS_WKF_Msk (0x1ul << UUART_WKSTS_WKF_Pos) /*!< UUART_T::WKSTS: WKF Mask */ - -#define UUART_PROTCTL_STOPB_Pos (0) /*!< UUART_T::PROTCTL: STOPB Position */ -#define UUART_PROTCTL_STOPB_Msk (0x1ul << UUART_PROTCTL_STOPB_Pos) /*!< UUART_T::PROTCTL: STOPB Mask */ - -#define UUART_PROTCTL_PARITYEN_Pos (1) /*!< UUART_T::PROTCTL: PARITYEN Position */ -#define UUART_PROTCTL_PARITYEN_Msk (0x1ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_T::PROTCTL: PARITYEN Mask */ - -#define UUART_PROTCTL_EVENPARITY_Pos (2) /*!< UUART_T::PROTCTL: EVENPARITY Position */ -#define UUART_PROTCTL_EVENPARITY_Msk (0x1ul << UUART_PROTCTL_EVENPARITY_Pos) /*!< UUART_T::PROTCTL: EVENPARITY Mask */ - -#define UUART_PROTCTL_RTSAUTOEN_Pos (3) /*!< UUART_T::PROTCTL: RTSAUTOEN Position */ -#define UUART_PROTCTL_RTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_RTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: RTSAUTOEN Mask */ - -#define UUART_PROTCTL_CTSAUTOEN_Pos (4) /*!< UUART_T::PROTCTL: CTSAUTOEN Position */ -#define UUART_PROTCTL_CTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_CTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: CTSAUTOEN Mask */ - -#define UUART_PROTCTL_RTSAUDIREN_Pos (5) /*!< UUART_T::PROTCTL: RTSAUDIREN Position */ -#define UUART_PROTCTL_RTSAUDIREN_Msk (0x1ul << UUART_PROTCTL_RTSAUDIREN_Pos) /*!< UUART_T::PROTCTL: RTSAUDIREN Mask */ - -#define UUART_PROTCTL_ABREN_Pos (6) /*!< UUART_T::PROTCTL: ABREN Position */ -#define UUART_PROTCTL_ABREN_Msk (0x1ul << UUART_PROTCTL_ABREN_Pos) /*!< UUART_T::PROTCTL: ABREN Mask */ - -#define UUART_PROTCTL_DATWKEN_Pos (9) /*!< UUART_T::PROTCTL: DATWKEN Position */ -#define UUART_PROTCTL_DATWKEN_Msk (0x1ul << UUART_PROTCTL_DATWKEN_Pos) /*!< UUART_T::PROTCTL: DATWKEN Mask */ - -#define UUART_PROTCTL_CTSWKEN_Pos (10) /*!< UUART_T::PROTCTL: CTSWKEN Position */ -#define UUART_PROTCTL_CTSWKEN_Msk (0x1ul << UUART_PROTCTL_CTSWKEN_Pos) /*!< UUART_T::PROTCTL: CTSWKEN Mask */ - -#define UUART_PROTCTL_WAKECNT_Pos (11) /*!< UUART_T::PROTCTL: WAKECNT Position */ -#define UUART_PROTCTL_WAKECNT_Msk (0xful << UUART_PROTCTL_WAKECNT_Pos) /*!< UUART_T::PROTCTL: WAKECNT Mask */ - -#define UUART_PROTCTL_BRDETITV_Pos (16) /*!< UUART_T::PROTCTL: BRDETITV Position */ -#define UUART_PROTCTL_BRDETITV_Msk (0x1fful << UUART_PROTCTL_BRDETITV_Pos) /*!< UUART_T::PROTCTL: BRDETITV Mask */ - -#define UUART_PROTCTL_STICKEN_Pos (26) /*!< UUART_T::PROTCTL: STICKEN Position */ -#define UUART_PROTCTL_STICKEN_Msk (0x1ul << UUART_PROTCTL_STICKEN_Pos) /*!< UUART_T::PROTCTL: STICKEN Mask */ - -#define UUART_PROTCTL_BCEN_Pos (29) /*!< UUART_T::PROTCTL: BCEN Position */ -#define UUART_PROTCTL_BCEN_Msk (0x1ul << UUART_PROTCTL_BCEN_Pos) /*!< UUART_T::PROTCTL: BCEN Mask */ - -#define UUART_PROTCTL_DGE_Pos (30) /*!< UUART_T::PROTCTL: DGE Position */ -#define UUART_PROTCTL_DGE_Msk (0x1ul << UUART_PROTCTL_DGE_Pos) /*!< UUART_T::PROTCTL: DGE Mask */ - -#define UUART_PROTCTL_PROTEN_Pos (31) /*!< UUART_T::PROTCTL: PROTEN Position */ -#define UUART_PROTCTL_PROTEN_Msk (0x1ul << UUART_PROTCTL_PROTEN_Pos) /*!< UUART_T::PROTCTL: PROTEN Mask */ - -#define UUART_PROTIEN_ABRIEN_Pos (1) /*!< UUART_T::PROTIEN: ABRIEN Position */ -#define UUART_PROTIEN_ABRIEN_Msk (0x1ul << UUART_PROTIEN_ABRIEN_Pos) /*!< UUART_T::PROTIEN: ABRIEN Mask */ - -#define UUART_PROTIEN_RLSIEN_Pos (2) /*!< UUART_T::PROTIEN: RLSIEN Position */ -#define UUART_PROTIEN_RLSIEN_Msk (0x1ul << UUART_PROTIEN_RLSIEN_Pos) /*!< UUART_T::PROTIEN: RLSIEN Mask */ - -#define UUART_PROTSTS_TXSTIF_Pos (1) /*!< UUART_T::PROTSTS: TXSTIF Position */ -#define UUART_PROTSTS_TXSTIF_Msk (0x1ul << UUART_PROTSTS_TXSTIF_Pos) /*!< UUART_T::PROTSTS: TXSTIF Mask */ - -#define UUART_PROTSTS_TXENDIF_Pos (2) /*!< UUART_T::PROTSTS: TXENDIF Position */ -#define UUART_PROTSTS_TXENDIF_Msk (0x1ul << UUART_PROTSTS_TXENDIF_Pos) /*!< UUART_T::PROTSTS: TXENDIF Mask */ - -#define UUART_PROTSTS_RXSTIF_Pos (3) /*!< UUART_T::PROTSTS: RXSTIF Position */ -#define UUART_PROTSTS_RXSTIF_Msk (0x1ul << UUART_PROTSTS_RXSTIF_Pos) /*!< UUART_T::PROTSTS: RXSTIF Mask */ - -#define UUART_PROTSTS_RXENDIF_Pos (4) /*!< UUART_T::PROTSTS: RXENDIF Position */ -#define UUART_PROTSTS_RXENDIF_Msk (0x1ul << UUART_PROTSTS_RXENDIF_Pos) /*!< UUART_T::PROTSTS: RXENDIF Mask */ - -#define UUART_PROTSTS_PARITYERR_Pos (5) /*!< UUART_T::PROTSTS: PARITYERR Position */ -#define UUART_PROTSTS_PARITYERR_Msk (0x1ul << UUART_PROTSTS_PARITYERR_Pos) /*!< UUART_T::PROTSTS: PARITYERR Mask */ - -#define UUART_PROTSTS_FRMERR_Pos (6) /*!< UUART_T::PROTSTS: FRMERR Position */ -#define UUART_PROTSTS_FRMERR_Msk (0x1ul << UUART_PROTSTS_FRMERR_Pos) /*!< UUART_T::PROTSTS: FRMERR Mask */ - -#define UUART_PROTSTS_BREAK_Pos (7) /*!< UUART_T::PROTSTS: BREAK Position */ -#define UUART_PROTSTS_BREAK_Msk (0x1ul << UUART_PROTSTS_BREAK_Pos) /*!< UUART_T::PROTSTS: BREAK Mask */ - -#define UUART_PROTSTS_ABRDETIF_Pos (9) /*!< UUART_T::PROTSTS: ABRDETIF Position */ -#define UUART_PROTSTS_ABRDETIF_Msk (0x1ul << UUART_PROTSTS_ABRDETIF_Pos) /*!< UUART_T::PROTSTS: ABRDETIF Mask */ - -#define UUART_PROTSTS_RXBUSY_Pos (10) /*!< UUART_T::PROTSTS: RXBUSY Position */ -#define UUART_PROTSTS_RXBUSY_Msk (0x1ul << UUART_PROTSTS_RXBUSY_Pos) /*!< UUART_T::PROTSTS: RXBUSY Mask */ - -#define UUART_PROTSTS_ABERRSTS_Pos (11) /*!< UUART_T::PROTSTS: ABERRSTS Position */ -#define UUART_PROTSTS_ABERRSTS_Msk (0x1ul << UUART_PROTSTS_ABERRSTS_Pos) /*!< UUART_T::PROTSTS: ABERRSTS Mask */ - -#define UUART_PROTSTS_CTSSYNCLV_Pos (16) /*!< UUART_T::PROTSTS: CTSSYNCLV Position */ -#define UUART_PROTSTS_CTSSYNCLV_Msk (0x1ul << UUART_PROTSTS_CTSSYNCLV_Pos) /*!< UUART_T::PROTSTS: CTSSYNCLV Mask */ - -#define UUART_PROTSTS_CTSLV_Pos (17) /*!< UUART_T::PROTSTS: CTSLV Position */ -#define UUART_PROTSTS_CTSLV_Msk (0x1ul << UUART_PROTSTS_CTSLV_Pos) /*!< UUART_T::PROTSTS: CTSLV Mask */ - -/**@}*/ /* UUART_CONST */ -/**@}*/ /* end of UUART register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __UUART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wdt_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wdt_reg.h deleted file mode 100644 index fbedb75c13e..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wdt_reg.h +++ /dev/null @@ -1,176 +0,0 @@ -/**************************************************************************//** - * @file wdt_reg.h - * @version V3.00 - * @brief WDT register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WDT_REG_H__ -#define __WDT_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Watch Dog Timer Controller -------------------------*/ -/** - @addtogroup WDT Watch Dog Timer Controller(WDT) - Memory Mapped Structure for WDT Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var WDT_T::CTL - * Offset: 0x00 WDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RSTEN |WDT Time-out Reset Enable Control (Write Protect) - * | | |Setting this bit will enable the WDT time-out reset function If the WDT up counter value has not been cleared after the specific WDT reset delay period expires. - * | | |0 = WDT time-out reset function Disabled. - * | | |1 = WDT time-out reset function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |RSTF |WDT Time-out Reset Flag - * | | |This bit indicates the system has been reset by WDT time-out reset or not. - * | | |0 = WDT time-out reset did not occur. - * | | |1 = WDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |IF |WDT Time-out Interrupt Flag - * | | |This bit will set to 1 while WDT up counter value reaches the selected WDT time-out interval - * | | |0 = WDT time-out interrupt did not occur. - * | | |1 = WDT time-out interrupt occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[4] |WKEN |WDT Time-out Wake-up Function Control (Write Protect) - * | | |If this bit is set to 1, while WDT time-out interrupt flag IF (WDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (WDT_CTL[6]) is enabled, the WDT time-out interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event Disabled if WDT time-out interrupt signal generated. - * | | |1 = Wake-up trigger event Enabled if WDT time-out interrupt signal generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Chip can be woken-up by WDT time-out interrupt signal generated only if WDT clock source is selected to 10 kHz internal low speed RC oscillator (LIRC) or LXT. - * |[5] |WKF |WDT Time-out Wake-up Flag (Write Protect) - * | | |This bit indicates the interrupt wake-up flag status of WDT - * | | |0 = WDT does not cause chip wake-up. - * | | |1 = Chip wake-up from Idle or Power-down mode if WDT time-out interrupt signal generated. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |INTEN |WDT Time-out Interrupt Enable Control (Write Protect) - * | | |If this bit is enabled, the WDT time-out interrupt signal is generated and inform to CPU. - * | | |0 = WDT time-out interrupt Disabled. - * | | |1 = WDT time-out interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |WDTEN |WDT Enable Bit (Write Protect) - * | | |0 = WDT Disabled (This action will reset the internal up counter value). - * | | |1 = WDT Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: If CWDTEN[2:0] (combined by Config0[31] and Config0[4:3]) bits is not configure to 111, this bit is forced as 1 and user cannot change this bit to 0. - * |[11:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect) - * | | |These three bits select the time-out interval period for the WDT. - * | | |000 = 2^4 * WDT_CLK. - * | | |001 = 2^6 * WDT_CLK. - * | | |010 = 2^8 * WDT_CLK. - * | | |011 = 2^10 * WDT_CLK. - * | | |100 = 2^12 * WDT_CLK. - * | | |101 = 2^14 * WDT_CLK. - * | | |110 = 2^16 * WDT_CLK. - * | | |111 = 2^18 * WDT_CLK. - * | | |111 = 2^20 * WDT_CLK. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[30] |SYNC |WDT Enable Control SYNC Flag Indicator (Read Only) - * | | |If user execute enable/disable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is completed or not. - * | | |0 = Setting WDTEN bit is completed and WDT is ready. - * | | |1 = Setting WDTEN bit is synchronizing and not become active yet. - * | | |Note: Perform enable or disable WDTEN bit needs 4 * WDT_CLK period to become active. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement affects WDT counting. - * | | |WDT up counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |WDT up counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var WDT_T::ALTCTL - * Offset: 0x04 WDT Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RSTDSEL |WDT Reset Delay Selection (Write Protect) - * | | |When WDT time-out happened, user has a time named WDT Reset Delay Period to clear WDT counter by programming 0x5AA5 to prevent WDT time-out reset happened. - * | | |User can select a suitable setting of RSTDSEL for different WDT Reset Delay Period. - * | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK. - * | | |01 = WDT Reset Delay Period is 130 * WDT_CLK. - * | | |10 = WDT Reset Delay Period is 18 * WDT_CLK. - * | | |11 = WDT Reset Delay Period is 3 * WDT_CLK. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This register will be reset to 0 if WDT time-out reset happened. - * @var WDT_T::RSTCNT - * Offset: 0x08 WDT Reset Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RSTCNT |WDT Reset Counter Register - * | | |Writing 0x00005AA5 to this field will reset the internal 20-bit WDT up counter value to 0. - * | | |Note: Perform RSTCNT to reset counter needs 2 * WDT_CLK period to become active. - */ - __IO uint32_t CTL; /*!< [0x0000] WDT Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0004] WDT Alternative Control Register */ - __O uint32_t RSTCNT; /*!< [0x0008] WDT Reset Counter Register */ - -} WDT_T; - -/** - @addtogroup WDT_CONST WDT Bit Field Definition - Constant Definitions for WDT Controller - @{ -*/ - -#define WDT_CTL_RSTEN_Pos (1) /*!< WDT_T::CTL: RSTEN Position */ -#define WDT_CTL_RSTEN_Msk (0x1ul << WDT_CTL_RSTEN_Pos) /*!< WDT_T::CTL: RSTEN Mask */ - -#define WDT_CTL_RSTF_Pos (2) /*!< WDT_T::CTL: RSTF Position */ -#define WDT_CTL_RSTF_Msk (0x1ul << WDT_CTL_RSTF_Pos) /*!< WDT_T::CTL: RSTF Mask */ - -#define WDT_CTL_IF_Pos (3) /*!< WDT_T::CTL: IF Position */ -#define WDT_CTL_IF_Msk (0x1ul << WDT_CTL_IF_Pos) /*!< WDT_T::CTL: IF Mask */ - -#define WDT_CTL_WKEN_Pos (4) /*!< WDT_T::CTL: WKEN Position */ -#define WDT_CTL_WKEN_Msk (0x1ul << WDT_CTL_WKEN_Pos) /*!< WDT_T::CTL: WKEN Mask */ - -#define WDT_CTL_WKF_Pos (5) /*!< WDT_T::CTL: WKF Position */ -#define WDT_CTL_WKF_Msk (0x1ul << WDT_CTL_WKF_Pos) /*!< WDT_T::CTL: WKF Mask */ - -#define WDT_CTL_INTEN_Pos (6) /*!< WDT_T::CTL: INTEN Position */ -#define WDT_CTL_INTEN_Msk (0x1ul << WDT_CTL_INTEN_Pos) /*!< WDT_T::CTL: INTEN Mask */ - -#define WDT_CTL_WDTEN_Pos (7) /*!< WDT_T::CTL: WDTEN Position */ -#define WDT_CTL_WDTEN_Msk (0x1ul << WDT_CTL_WDTEN_Pos) /*!< WDT_T::CTL: WDTEN Mask */ - -#define WDT_CTL_TOUTSEL_Pos (8) /*!< WDT_T::CTL: TOUTSEL Position */ -#define WDT_CTL_TOUTSEL_Msk (0xful << WDT_CTL_TOUTSEL_Pos) /*!< WDT_T::CTL: TOUTSEL Mask */ - -#define WDT_CTL_SYNC_Pos (30) /*!< WDT_T::CTL: SYNC Position */ -#define WDT_CTL_SYNC_Msk (0x1ul << WDT_CTL_SYNC_Pos) /*!< WDT_T::CTL: SYNC Mask */ - -#define WDT_CTL_ICEDEBUG_Pos (31) /*!< WDT_T::CTL: ICEDEBUG Position */ -#define WDT_CTL_ICEDEBUG_Msk (0x1ul << WDT_CTL_ICEDEBUG_Pos) /*!< WDT_T::CTL: ICEDEBUG Mask */ - -#define WDT_ALTCTL_RSTDSEL_Pos (0) /*!< WDT_T::ALTCTL: RSTDSEL Position */ -#define WDT_ALTCTL_RSTDSEL_Msk (0x3ul << WDT_ALTCTL_RSTDSEL_Pos) /*!< WDT_T::ALTCTL: RSTDSEL Mask */ - -#define WDT_RSTCNT_RSTCNT_Pos (0) /*!< WDT_T::RSTCNT: RSTCNT Position */ -#define WDT_RSTCNT_RSTCNT_Msk (0xfffffffful << WDT_RSTCNT_RSTCNT_Pos) /*!< WDT_T::RSTCNT: RSTCNT Mask */ - - -/**@}*/ /* WDT_CONST */ -/**@}*/ /* end of WDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __WDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wwdt_reg.h b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wwdt_reg.h deleted file mode 100644 index 2be3b65b4a1..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Include/wwdt_reg.h +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************//** - * @file wwdt_reg.h - * @version V3.00 - * @brief WWDT register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WWDT_REG_H__ -#define __WWDT_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Window Watchdog Timer -------------------------*/ -/** - @addtogroup WWDT Window Watchdog Timer(WWDT) - Memory Mapped Structure for WWDT Controller - @{ -*/ - -typedef struct -{ - - - /** - * @var WWDT_T::RLDCNT - * Offset: 0x00 WWDT Reload Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RLDCNT |WWDT Reload Counter Register - * | | |Writing 0x00005AA5 to this register will reload the WWDT counter value to 0x3F. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT (WWDT_CTL[21:16]). - * | | |If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, WWDT reset signal will be generated immediately. - * @var WWDT_T::CTL - * Offset: 0x04 WWDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTEN |WWDT Enable Bit - * | | |0 = Indicates WWDT counter is stopped. - * | | |1 = Enable WWDT counter starts counting. - * |[1] |INTEN |WWDT Interrupt Enable Bit - * | | |If this bit is enabled, the WWDT counter compare match interrupt signal is generated and inform to CPU. - * | | |0 = WWDT counter compare match interrupt Disabled. - * | | |1 = WWDT counter compare match interrupt Enabled. - * |[11:8] |PSCSEL |WWDT Counter Prescale Period Selection - * | | |0000 = Pre-scale is 1; Max time-out period is 1 * 64 * WWDT_CLK. - * | | |0001 = Pre-scale is 2; Max time-out period is 2 * 64 * WWDT_CLK. - * | | |0010 = Pre-scale is 4; Max time-out period is 4 * 64 * WWDT_CLK. - * | | |0011 = Pre-scale is 8; Max time-out period is 8 * 64 * WWDT_CLK. - * | | |0100 = Pre-scale is 16; Max time-out period is 16 * 64 * WWDT_CLK. - * | | |0101 = Pre-scale is 32; Max time-out period is 32 * 64 * WWDT_CLK. - * | | |0110 = Pre-scale is 64; Max time-out period is 64 * 64 * WWDT_CLK. - * | | |0111 = Pre-scale is 128; Max time-out period is 128 * 64 * WWDT_CLK. - * | | |1000 = Pre-scale is 192; Max time-out period is 192 * 64 * WWDT_CLK. - * | | |1001 = Pre-scale is 256; Max time-out period is 256 * 64 * WWDT_CLK. - * | | |1010 = Pre-scale is 384; Max time-out period is 384 * 64 * WWDT_CLK. - * | | |1011 = Pre-scale is 512; Max time-out period is 512 * 64 * WWDT_CLK. - * | | |1100 = Pre-scale is 768; Max time-out period is 768 * 64 * WWDT_CLK. - * | | |1101 = Pre-scale is 1024; Max time-out period is 1024 * 64 * WWDT_CLK. - * | | |1110 = Pre-scale is 1536; Max time-out period is 1536 * 64 * WWDT_CLK. - * | | |1111 = Pre-scale is 2048; Max time-out period is 2048 * 64 * WWDT_CLK. - * |[21:16] |CMPDAT |WWDT Window Compare - * | | |Set this register to adjust the valid reload window. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT. - * | | |If user writes WWDT_RLDCNT register when current WWDT counter value larger than CMPDAT, WWDT reset signal will generate immediately. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit - * | | |0 = ICE debug mode acknowledgement effects WWDT counting. - * | | |WWDT down counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |WWDT down counter will keep going no matter CPU is held by ICE or not. - * @var WWDT_T::STATUS - * Offset: 0x08 WWDT Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTIF |WWDT Compare Match Interrupt Flag - * | | |This bit indicates the interrupt flag status of WWDT while WWDT counter value matches CMPDAT (WWDT_CTL[21:16]). - * | | |0 = No effect. - * | | |1 = WWDT counter value matches CMPDAT. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WWDTRF |WWDT Timer-out Reset Flag - * | | |This bit indicates the system has been reset by WWDT time-out reset or not. - * | | |0 = WWDT time-out reset did not occur. - * | | |1 = WWDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var WWDT_T::CNT - * Offset: 0x0C WWDT Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CNTDAT |WWDT Counter Value - * | | |CNTDAT will be updated continuously to monitor 6-bit WWDT down counter value. - */ - __O uint32_t RLDCNT; /*!< [0x0000] WWDT Reload Counter Register */ - __IO uint32_t CTL; /*!< [0x0004] WWDT Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] WWDT Status Register */ - __I uint32_t CNT; /*!< [0x000c] WWDT Counter Value Register */ - -} WWDT_T; - - -/** - @addtogroup WWDT_CONST WWDT Bit Field Definition - Constant Definitions for WWDT Controller - @{ -*/ - -#define WWDT_RLDCNT_RLDCNT_Pos (0) /*!< WWDT_T::RLDCNT: RLDCNT Position */ -#define WWDT_RLDCNT_RLDCNT_Msk (0xfffffffful << WWDT_RLDCNT_RLDCNT_Pos) /*!< WWDT_T::RLDCNT: RLDCNT Mask */ - -#define WWDT_CTL_WWDTEN_Pos (0) /*!< WWDT_T::CTL: WWDTEN Position */ -#define WWDT_CTL_WWDTEN_Msk (0x1ul << WWDT_CTL_WWDTEN_Pos) /*!< WWDT_T::CTL: WWDTEN Mask */ - -#define WWDT_CTL_INTEN_Pos (1) /*!< WWDT_T::CTL: INTEN Position */ -#define WWDT_CTL_INTEN_Msk (0x1ul << WWDT_CTL_INTEN_Pos) /*!< WWDT_T::CTL: INTEN Mask */ - -#define WWDT_CTL_PSCSEL_Pos (8) /*!< WWDT_T::CTL: PSCSEL Position */ -#define WWDT_CTL_PSCSEL_Msk (0xful << WWDT_CTL_PSCSEL_Pos) /*!< WWDT_T::CTL: PSCSEL Mask */ - -#define WWDT_CTL_CMPDAT_Pos (16) /*!< WWDT_T::CTL: CMPDAT Position */ -#define WWDT_CTL_CMPDAT_Msk (0x3ful << WWDT_CTL_CMPDAT_Pos) /*!< WWDT_T::CTL: CMPDAT Mask */ - -#define WWDT_CTL_ICEDEBUG_Pos (31) /*!< WWDT_T::CTL: ICEDEBUG Position */ -#define WWDT_CTL_ICEDEBUG_Msk (0x1ul << WWDT_CTL_ICEDEBUG_Pos) /*!< WWDT_T::CTL: ICEDEBUG Mask */ - -#define WWDT_STATUS_WWDTIF_Pos (0) /*!< WWDT_T::STATUS: WWDTIF Position */ -#define WWDT_STATUS_WWDTIF_Msk (0x1ul << WWDT_STATUS_WWDTIF_Pos) /*!< WWDT_T::STATUS: WWDTIF Mask */ - -#define WWDT_STATUS_WWDTRF_Pos (1) /*!< WWDT_T::STATUS: WWDTRF Position */ -#define WWDT_STATUS_WWDTRF_Msk (0x1ul << WWDT_STATUS_WWDTRF_Pos) /*!< WWDT_T::STATUS: WWDTRF Mask */ - -#define WWDT_CNT_CNTDAT_Pos (0) /*!< WWDT_T::CNT: CNTDAT Position */ -#define WWDT_CNT_CNTDAT_Msk (0x3ful << WWDT_CNT_CNTDAT_Pos) /*!< WWDT_T::CNT: CNTDAT Mask */ - - -/**@}*/ /* WWDT_CONST */ -/**@}*/ /* end of WWDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __WWDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/ARM/startup_m460.s b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/ARM/startup_m460.s deleted file mode 100644 index a38d166c47e..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/ARM/startup_m460.s +++ /dev/null @@ -1,593 +0,0 @@ -;/****************************************************************************** -; * @file startup_m460.s -; * @version V3.00 -; * @brief CMSIS Cortex-M4 Core Device Startup File for M460 -; * -; * @copyright SPDX-License-Identifier: Apache-2.0 -; * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -;*****************************************************************************/ -;/* -;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ -;*/ - - -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Stack_Size -Stack_Size EQU 0x00000800 - ENDIF - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Heap_Size -Heap_Size EQU 0x00000100 - ENDIF - - 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 - - ; External Interrupts - DCD BOD_IRQHandler ; 0: Brown Out detection - DCD IRC_IRQHandler ; 1: Internal RC - DCD PWRWU_IRQHandler ; 2: Power down wake up - DCD RAMPE_IRQHandler ; 3: RAM parity error - DCD CKFAIL_IRQHandler ; 4: Clock detection fail - DCD ISP_IRQHandler ; 5: ISP - DCD RTC_IRQHandler ; 6: Real Time Clock - DCD TAMPER_IRQHandler ; 7: Tamper detection - DCD WDT_IRQHandler ; 8: Watchdog timer - DCD WWDT_IRQHandler ; 9: Window watchdog timer - DCD EINT0_IRQHandler ; 10: External Input 0 - DCD EINT1_IRQHandler ; 11: External Input 1 - DCD EINT2_IRQHandler ; 12: External Input 2 - DCD EINT3_IRQHandler ; 13: External Input 3 - DCD EINT4_IRQHandler ; 14: External Input 4 - DCD EINT5_IRQHandler ; 15: External Input 5 - DCD GPA_IRQHandler ; 16: GPIO Port A - DCD GPB_IRQHandler ; 17: GPIO Port B - DCD GPC_IRQHandler ; 18: GPIO Port C - DCD GPD_IRQHandler ; 19: GPIO Port D - DCD GPE_IRQHandler ; 20: GPIO Port E - DCD GPF_IRQHandler ; 21: GPIO Port F - DCD QSPI0_IRQHandler ; 22: QSPI0 - DCD SPI0_IRQHandler ; 23: SPI0 - DCD BRAKE0_IRQHandler ; 24: EPWM0 brake - DCD EPWM0P0_IRQHandler ; 25: EPWM0 pair 0 - DCD EPWM0P1_IRQHandler ; 26: EPWM0 pair 1 - DCD EPWM0P2_IRQHandler ; 27: EPWM0 pair 2 - DCD BRAKE1_IRQHandler ; 28: EPWM1 brake - DCD EPWM1P0_IRQHandler ; 29: EPWM1 pair 0 - DCD EPWM1P1_IRQHandler ; 30: EPWM1 pair 1 - DCD EPWM1P2_IRQHandler ; 31: EPWM1 pair 2 - DCD TMR0_IRQHandler ; 32: Timer 0 - DCD TMR1_IRQHandler ; 33: Timer 1 - DCD TMR2_IRQHandler ; 34: Timer 2 - DCD TMR3_IRQHandler ; 35: Timer 3 - DCD UART0_IRQHandler ; 36: UART0 - DCD UART1_IRQHandler ; 37: UART1 - DCD I2C0_IRQHandler ; 38: I2C0 - DCD I2C1_IRQHandler ; 39: I2C1 - DCD PDMA0_IRQHandler ; 40: Peripheral DMA 0 - DCD DAC_IRQHandler ; 41: DAC - DCD EADC00_IRQHandler ; 42: EADC0 interrupt source 0 - DCD EADC01_IRQHandler ; 43: EADC0 interrupt source 1 - DCD ACMP01_IRQHandler ; 44: ACMP0 and ACMP1 - DCD ACMP23_IRQHandler ; 45: ACMP2 and ACMP3 - DCD EADC02_IRQHandler ; 46: EADC0 interrupt source 2 - DCD EADC03_IRQHandler ; 47: EADC0 interrupt source 3 - DCD UART2_IRQHandler ; 48: UART2 - DCD UART3_IRQHandler ; 49: UART3 - DCD QSPI1_IRQHandler ; 50: QSPI1 - DCD SPI1_IRQHandler ; 51: SPI1 - DCD SPI2_IRQHandler ; 52: SPI2 - DCD USBD_IRQHandler ; 53: USB device - DCD OHCI_IRQHandler ; 54: OHCI - DCD USBOTG_IRQHandler ; 55: USB OTG - DCD BMC_IRQHandler ; 56: BMC - DCD SPI5_IRQHandler ; 57: SPI5 - DCD SC0_IRQHandler ; 58: SC0 - DCD SC1_IRQHandler ; 59: SC1 - DCD SC2_IRQHandler ; 60: SC2 - DCD GPJ_IRQHandler ; 61: GPIO Port J - DCD SPI3_IRQHandler ; 62: SPI3 - DCD SPI4_IRQHandler ; 63: SPI4 - DCD SDH0_IRQHandler ; 64: SDH0 - DCD USBD20_IRQHandler ; 65: USBD20 - DCD EMAC0_IRQHandler ; 66: EMAC0 - DCD Default_Handler ; 67: - DCD I2S0_IRQHandler ; 68: I2S0 - DCD I2S1_IRQHandler ; 69: I2S1 - DCD SPI6_IRQHandler ; 70: SPI6 - DCD CRPT_IRQHandler ; 71: CRYPTO - DCD GPG_IRQHandler ; 72: GPIO Port G - DCD EINT6_IRQHandler ; 73: External Input 6 - DCD UART4_IRQHandler ; 74: UART4 - DCD UART5_IRQHandler ; 75: UART5 - DCD USCI0_IRQHandler ; 76: USCI0 - DCD SPI7_IRQHandler ; 77: SPI7 - DCD BPWM0_IRQHandler ; 78: BPWM0 - DCD BPWM1_IRQHandler ; 79: BPWM1 - DCD SPIM_IRQHandler ; 80: SPIM - DCD CCAP_IRQHandler ; 81: CCAP - DCD I2C2_IRQHandler ; 82: I2C2 - DCD I2C3_IRQHandler ; 83: I2C3 - DCD EQEI0_IRQHandler ; 84: EQEI0 - DCD EQEI1_IRQHandler ; 85: EQEI1 - DCD ECAP0_IRQHandler ; 86: ECAP0 - DCD ECAP1_IRQHandler ; 87: ECAP1 - DCD GPH_IRQHandler ; 88: GPIO Port H - DCD EINT7_IRQHandler ; 89: External Input 7 - DCD SDH1_IRQHandler ; 90: SDH1 - DCD PSIO_IRQHandler ; 91: PSIO - DCD EHCI_IRQHandler ; 92: EHCI - DCD USBOTG20_IRQHandler ; 93: HSOTG - DCD ECAP2_IRQHandler ; 94: ECAP2 - DCD ECAP3_IRQHandler ; 95: ECAP3 - DCD KPI_IRQHandler ; 96: KPI - DCD HBI_IRQHandler ; 97: HBI - DCD PDMA1_IRQHandler ; 98: Peripheral DMA 1 - DCD UART8_IRQHandler ; 99: UART8 - DCD UART9_IRQHandler ; 100: UART9 - DCD TRNG_IRQHandler ; 101: TRNG - DCD UART6_IRQHandler ; 102: UART6 - DCD UART7_IRQHandler ; 103: UART7 - DCD EADC10_IRQHandler ; 104: EADC1 interrupt source 0 - DCD EADC11_IRQHandler ; 105: EADC1 interrupt source 1 - DCD EADC12_IRQHandler ; 106: EADC1 interrupt source 2 - DCD EADC13_IRQHandler ; 107: EADC1 interrupt source 3 - DCD SPI8_IRQHandler ; 108: SPI8 - DCD KS_IRQHandler ; 109: Key Store - DCD GPI_IRQHandler ; 110: GPIO Port I - DCD SPI9_IRQHandler ; 111: SPI9 - DCD CANFD00_IRQHandler ; 112: CANFD0 interrupt source 0 - DCD CANFD01_IRQHandler ; 113: CANFD0 interrupt source 1 - DCD CANFD10_IRQHandler ; 114: CANFD1 interrupt source 0 - DCD CANFD11_IRQHandler ; 115: CANFD1 interrupt source 1 - DCD EQEI2_IRQHandler ; 116: EQEI2 - DCD EQEI3_IRQHandler ; 117: EQEI3 - DCD I2C4_IRQHandler ; 118: I2C4 - DCD SPI10_IRQHandler ; 119: SPI10 - DCD CANFD20_IRQHandler ; 120: CANFD2 interrupt source 0 - DCD CANFD21_IRQHandler ; 121: CANFD2 interrupt source 1 - DCD CANFD30_IRQHandler ; 122: CANFD3 interrupt source 0 - DCD CANFD31_IRQHandler ; 123: CANFD3 interrupt source 1 - DCD EADC20_IRQHandler ; 124: EADC2 interrupt source 0 - DCD EADC21_IRQHandler ; 125: EADC2 interrupt source 1 - DCD EADC22_IRQHandler ; 126: EADC2 interrupt source 2 - DCD EADC23_IRQHandler ; 127: EADC2 interrupt source 3 - - -__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 - - ; Unlock Register - LDR R0, =0x40000100 - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - IF :LNOT: :DEF: ENABLE_SPIM_CACHE - LDR R0, =0x40000200 ; R0 = Clock Controller Register Base Address - LDR R1, [R0,#0x4] ; R1 = 0x40000204 (AHBCLK) - ORR R1, R1, #0x4000 - STR R1, [R0,#0x4] ; CLK->AHBCLK |= CLK_AHBCLK_SPIMCKEN_Msk; - - LDR R0, =0x40007000 ; R0 = SPIM Register Base Address - LDR R1, [R0,#4] ; R1 = SPIM->CTL1 - ORR R1, R1,#2 ; R1 |= SPIM_CTL1_CACHEOFF_Msk - STR R1, [R0,#4] ; _SPIM_DISABLE_CACHE() - LDR R1, [R0,#4] ; R1 = SPIM->CTL1 - ORR R1, R1, #4 ; R1 |= SPIM_CTL1_CCMEN_Msk - STR R1, [R0,#4] ; _SPIM_ENABLE_CCM() - ENDIF - - LDR R0, =SystemInit - BLX R0 - - - ; Lock - LDR R0, =0x40000100 - LDR R1, =0 - STR R1, [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 BOD_IRQHandler [WEAK] - EXPORT IRC_IRQHandler [WEAK] - EXPORT PWRWU_IRQHandler [WEAK] - EXPORT RAMPE_IRQHandler [WEAK] - EXPORT CKFAIL_IRQHandler [WEAK] - EXPORT ISP_IRQHandler [WEAK] - EXPORT RTC_IRQHandler [WEAK] - EXPORT TAMPER_IRQHandler [WEAK] - EXPORT WDT_IRQHandler [WEAK] - EXPORT WWDT_IRQHandler [WEAK] - EXPORT EINT0_IRQHandler [WEAK] - EXPORT EINT1_IRQHandler [WEAK] - EXPORT EINT2_IRQHandler [WEAK] - EXPORT EINT3_IRQHandler [WEAK] - EXPORT EINT4_IRQHandler [WEAK] - EXPORT EINT5_IRQHandler [WEAK] - EXPORT GPA_IRQHandler [WEAK] - EXPORT GPB_IRQHandler [WEAK] - EXPORT GPC_IRQHandler [WEAK] - EXPORT GPD_IRQHandler [WEAK] - EXPORT GPE_IRQHandler [WEAK] - EXPORT GPF_IRQHandler [WEAK] - EXPORT QSPI0_IRQHandler [WEAK] - EXPORT SPI0_IRQHandler [WEAK] - EXPORT BRAKE0_IRQHandler [WEAK] - EXPORT EPWM0P0_IRQHandler [WEAK] - EXPORT EPWM0P1_IRQHandler [WEAK] - EXPORT EPWM0P2_IRQHandler [WEAK] - EXPORT BRAKE1_IRQHandler [WEAK] - EXPORT EPWM1P0_IRQHandler [WEAK] - EXPORT EPWM1P1_IRQHandler [WEAK] - EXPORT EPWM1P2_IRQHandler [WEAK] - EXPORT TMR0_IRQHandler [WEAK] - EXPORT TMR1_IRQHandler [WEAK] - EXPORT TMR2_IRQHandler [WEAK] - EXPORT TMR3_IRQHandler [WEAK] - EXPORT UART0_IRQHandler [WEAK] - EXPORT UART1_IRQHandler [WEAK] - EXPORT I2C0_IRQHandler [WEAK] - EXPORT I2C1_IRQHandler [WEAK] - EXPORT PDMA0_IRQHandler [WEAK] - EXPORT DAC_IRQHandler [WEAK] - EXPORT EADC00_IRQHandler [WEAK] - EXPORT EADC01_IRQHandler [WEAK] - EXPORT ACMP01_IRQHandler [WEAK] - EXPORT ACMP23_IRQHandler [WEAK] - EXPORT EADC02_IRQHandler [WEAK] - EXPORT EADC03_IRQHandler [WEAK] - EXPORT UART2_IRQHandler [WEAK] - EXPORT UART3_IRQHandler [WEAK] - EXPORT QSPI1_IRQHandler [WEAK] - EXPORT SPI1_IRQHandler [WEAK] - EXPORT SPI2_IRQHandler [WEAK] - EXPORT USBD_IRQHandler [WEAK] - EXPORT OHCI_IRQHandler [WEAK] - EXPORT USBOTG_IRQHandler [WEAK] - EXPORT BMC_IRQHandler [WEAK] - EXPORT SPI5_IRQHandler [WEAK] - EXPORT SC0_IRQHandler [WEAK] - EXPORT SC1_IRQHandler [WEAK] - EXPORT SC2_IRQHandler [WEAK] - EXPORT GPJ_IRQHandler [WEAK] - EXPORT SPI3_IRQHandler [WEAK] - EXPORT SPI4_IRQHandler [WEAK] - EXPORT SDH0_IRQHandler [WEAK] - EXPORT USBD20_IRQHandler [WEAK] - EXPORT EMAC0_IRQHandler [WEAK] - EXPORT I2S0_IRQHandler [WEAK] - EXPORT I2S1_IRQHandler [WEAK] - EXPORT SPI6_IRQHandler [WEAK] - EXPORT CRPT_IRQHandler [WEAK] - EXPORT GPG_IRQHandler [WEAK] - EXPORT EINT6_IRQHandler [WEAK] - EXPORT UART4_IRQHandler [WEAK] - EXPORT UART5_IRQHandler [WEAK] - EXPORT USCI0_IRQHandler [WEAK] - EXPORT SPI7_IRQHandler [WEAK] - EXPORT BPWM0_IRQHandler [WEAK] - EXPORT BPWM1_IRQHandler [WEAK] - EXPORT SPIM_IRQHandler [WEAK] - EXPORT CCAP_IRQHandler [WEAK] - EXPORT I2C2_IRQHandler [WEAK] - EXPORT I2C3_IRQHandler [WEAK] - EXPORT EQEI0_IRQHandler [WEAK] - EXPORT EQEI1_IRQHandler [WEAK] - EXPORT ECAP0_IRQHandler [WEAK] - EXPORT ECAP1_IRQHandler [WEAK] - EXPORT GPH_IRQHandler [WEAK] - EXPORT EINT7_IRQHandler [WEAK] - EXPORT SDH1_IRQHandler [WEAK] - EXPORT PSIO_IRQHandler [WEAK] - EXPORT EHCI_IRQHandler [WEAK] - EXPORT USBOTG20_IRQHandler [WEAK] - EXPORT ECAP2_IRQHandler [WEAK] - EXPORT ECAP3_IRQHandler [WEAK] - EXPORT KPI_IRQHandler [WEAK] - EXPORT HBI_IRQHandler [WEAK] - EXPORT PDMA1_IRQHandler [WEAK] - EXPORT UART8_IRQHandler [WEAK] - EXPORT UART9_IRQHandler [WEAK] - EXPORT TRNG_IRQHandler [WEAK] - EXPORT UART6_IRQHandler [WEAK] - EXPORT UART7_IRQHandler [WEAK] - EXPORT EADC10_IRQHandler [WEAK] - EXPORT EADC11_IRQHandler [WEAK] - EXPORT EADC12_IRQHandler [WEAK] - EXPORT EADC13_IRQHandler [WEAK] - EXPORT SPI8_IRQHandler [WEAK] - EXPORT KS_IRQHandler [WEAK] - EXPORT GPI_IRQHandler [WEAK] - EXPORT SPI9_IRQHandler [WEAK] - EXPORT CANFD00_IRQHandler [WEAK] - EXPORT CANFD01_IRQHandler [WEAK] - EXPORT CANFD10_IRQHandler [WEAK] - EXPORT CANFD11_IRQHandler [WEAK] - EXPORT EQEI2_IRQHandler [WEAK] - EXPORT EQEI3_IRQHandler [WEAK] - EXPORT I2C4_IRQHandler [WEAK] - EXPORT SPI10_IRQHandler [WEAK] - EXPORT CANFD20_IRQHandler [WEAK] - EXPORT CANFD21_IRQHandler [WEAK] - EXPORT CANFD30_IRQHandler [WEAK] - EXPORT CANFD31_IRQHandler [WEAK] - EXPORT EADC20_IRQHandler [WEAK] - EXPORT EADC21_IRQHandler [WEAK] - EXPORT EADC22_IRQHandler [WEAK] - EXPORT EADC23_IRQHandler [WEAK] - - -Default__IRQHandler -BOD_IRQHandler -IRC_IRQHandler -PWRWU_IRQHandler -RAMPE_IRQHandler -CKFAIL_IRQHandler -ISP_IRQHandler -RTC_IRQHandler -TAMPER_IRQHandler -WDT_IRQHandler -WWDT_IRQHandler -EINT0_IRQHandler -EINT1_IRQHandler -EINT2_IRQHandler -EINT3_IRQHandler -EINT4_IRQHandler -EINT5_IRQHandler -GPA_IRQHandler -GPB_IRQHandler -GPC_IRQHandler -GPD_IRQHandler -GPE_IRQHandler -GPF_IRQHandler -QSPI0_IRQHandler -SPI0_IRQHandler -BRAKE0_IRQHandler -EPWM0P0_IRQHandler -EPWM0P1_IRQHandler -EPWM0P2_IRQHandler -BRAKE1_IRQHandler -EPWM1P0_IRQHandler -EPWM1P1_IRQHandler -EPWM1P2_IRQHandler -TMR0_IRQHandler -TMR1_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -UART0_IRQHandler -UART1_IRQHandler -I2C0_IRQHandler -I2C1_IRQHandler -PDMA0_IRQHandler -DAC_IRQHandler -EADC00_IRQHandler -EADC01_IRQHandler -ACMP01_IRQHandler -ACMP23_IRQHandler -EADC02_IRQHandler -EADC03_IRQHandler -UART2_IRQHandler -UART3_IRQHandler -QSPI1_IRQHandler -SPI1_IRQHandler -SPI2_IRQHandler -USBD_IRQHandler -OHCI_IRQHandler -USBOTG_IRQHandler -BMC_IRQHandler -SPI5_IRQHandler -SC0_IRQHandler -SC1_IRQHandler -SC2_IRQHandler -GPJ_IRQHandler -SPI3_IRQHandler -SPI4_IRQHandler -SDH0_IRQHandler -USBD20_IRQHandler -EMAC0_IRQHandler -I2S0_IRQHandler -I2S1_IRQHandler -SPI6_IRQHandler -CRPT_IRQHandler -GPG_IRQHandler -EINT6_IRQHandler -UART4_IRQHandler -UART5_IRQHandler -USCI0_IRQHandler -SPI7_IRQHandler -BPWM0_IRQHandler -BPWM1_IRQHandler -SPIM_IRQHandler -CCAP_IRQHandler -I2C2_IRQHandler -I2C3_IRQHandler -EQEI0_IRQHandler -EQEI1_IRQHandler -ECAP0_IRQHandler -ECAP1_IRQHandler -GPH_IRQHandler -EINT7_IRQHandler -SDH1_IRQHandler -PSIO_IRQHandler -EHCI_IRQHandler -USBOTG20_IRQHandler -ECAP2_IRQHandler -ECAP3_IRQHandler -KPI_IRQHandler -HBI_IRQHandler -PDMA1_IRQHandler -UART8_IRQHandler -UART9_IRQHandler -TRNG_IRQHandler -UART6_IRQHandler -UART7_IRQHandler -EADC10_IRQHandler -EADC11_IRQHandler -EADC12_IRQHandler -EADC13_IRQHandler -SPI8_IRQHandler -KS_IRQHandler -GPI_IRQHandler -SPI9_IRQHandler -CANFD00_IRQHandler -CANFD01_IRQHandler -CANFD10_IRQHandler -CANFD11_IRQHandler -EQEI2_IRQHandler -EQEI3_IRQHandler -I2C4_IRQHandler -SPI10_IRQHandler -CANFD20_IRQHandler -CANFD21_IRQHandler -CANFD30_IRQHandler -CANFD31_IRQHandler -EADC20_IRQHandler -EADC21_IRQHandler -EADC22_IRQHandler -EADC23_IRQHandler - - - 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 PROC - LDR R0, = Heap_Mem - LDR R1, =(Stack_Mem + Stack_Size) - LDR R2, = (Heap_Mem + Heap_Size) - LDR R3, = Stack_Mem - BX LR - ENDP - - ALIGN - - ENDIF - - - END diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/GCC/startup_M460.S b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/GCC/startup_M460.S deleted file mode 100644 index a8600c34db9..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/GCC/startup_M460.S +++ /dev/null @@ -1,428 +0,0 @@ - -/****************************************************************************//** - * @file startup_M460.S - * @version V3.00 - * @brief CMSIS Cortex-M4 Core Device Startup File for M460 - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - - // Unlock Register - ldr r0, =0x40000100 - ldr r1, =0x59 - str r1, [r0] - ldr r1, =0x16 - str r1, [r0] - ldr r1, =0x88 - str r1, [r0] - -#ifndef ENABLE_SPIM_CACHE - ldr r0, =0x40000200 // R0 = Clock Controller Register Base Address - ldr r1, [r0,#0x4] // R1 = 0x40000204 (AHBCLK) - orr r1, r1, #0x4000 - str r1, [r0,#0x4] // CLK->AHBCLK |= CLK_AHBCLK_SPIMCKEN_Msk// - - ldr r0, =0x40007000 // R0 = SPIM Register Base Address - ldr r1, [r0,#4] // R1 = SPIM->CTL1 - orr r1, r1,#2 // R1 |= SPIM_CTL1_CACHEOFF_Msk - str r1, [r0,#4] // _SPIM_DISABLE_CACHE() - ldr r1, [r0,#4] // R1 = SPIM->CTL1 - orr r1, r1, #4 // R1 |= SPIM_CTL1_CCMEN_Msk - str r1, [r0,#4] // _SPIM_ENABLE_CCM() -#endif - -#ifndef __NO_SYSTEM_INIT - bl SystemInit -#endif - - // Lock - ldr r0, =0x40000100 - ldr r1, =0 - str r1, [r0] - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the application's entry point.*/ - bl entry - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M4. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - -g_pfnVectors: - .long _estack /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler */ - .long HardFault_Handler /* Hard Fault Handler */ - .long MemManage_Handler /* MPU Fault Handler */ - .long BusFault_Handler /* Bus Fault Handler */ - .long UsageFault_Handler /* Usage Fault Handler */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long 0 /* Reserved */ - .long SVC_Handler /* SVCall Handler */ - .long DebugMon_Handler /* Debug Monitor Handler */ - .long 0 /* Reserved */ - .long PendSV_Handler /* PendSV Handler */ - .long SysTick_Handler /* SysTick Handler */ - - /* External interrupts */ - .long BOD_IRQHandler /* 0: BOD */ - .long IRC_IRQHandler /* 1: IRC */ - .long PWRWU_IRQHandler /* 2: PWRWU */ - .long RAMPE_IRQHandler /* 3: RAMPE */ - .long CKFAIL_IRQHandler /* 4: CKFAIL */ - .long ISP_IRQHandler /* 5: ISP */ - .long RTC_IRQHandler /* 6: RTC */ - .long TAMPER_IRQHandler /* 7: TAMPER */ - .long WDT_IRQHandler /* 8: WDT */ - .long WWDT_IRQHandler /* 9: WWDT */ - .long EINT0_IRQHandler /* 10: EINT0 */ - .long EINT1_IRQHandler /* 11: EINT1 */ - .long EINT2_IRQHandler /* 12: EINT2 */ - .long EINT3_IRQHandler /* 13: EINT3 */ - .long EINT4_IRQHandler /* 14: EINT4 */ - .long EINT5_IRQHandler /* 15: EINT5 */ - .long GPA_IRQHandler /* 16: GPA */ - .long GPB_IRQHandler /* 17: GPB */ - .long GPC_IRQHandler /* 18: GPC */ - .long GPD_IRQHandler /* 19: GPD */ - .long GPE_IRQHandler /* 20: GPE */ - .long GPF_IRQHandler /* 21: GPF */ - .long QSPI0_IRQHandler /* 22: QSPI0 */ - .long SPI0_IRQHandler /* 23: SPI0 */ - .long BRAKE0_IRQHandler /* 24: BRAKE0 */ - .long EPWM0P0_IRQHandler /* 25: EPWM0P0 */ - .long EPWM0P1_IRQHandler /* 26: EPWM0P1 */ - .long EPWM0P2_IRQHandler /* 27: EPWM0P2 */ - .long BRAKE1_IRQHandler /* 28: BRAKE1 */ - .long EPWM1P0_IRQHandler /* 29: EPWM1P0 */ - .long EPWM1P1_IRQHandler /* 30: EPWM1P1 */ - .long EPWM1P2_IRQHandler /* 31: EPWM1P2 */ - .long TMR0_IRQHandler /* 32: TIMER0 */ - .long TMR1_IRQHandler /* 33: TIMER1 */ - .long TMR2_IRQHandler /* 34: TIMER2 */ - .long TMR3_IRQHandler /* 35: TIMER3 */ - .long UART0_IRQHandler /* 36: UART0 */ - .long UART1_IRQHandler /* 37: UART1 */ - .long I2C0_IRQHandler /* 38: I2C0 */ - .long I2C1_IRQHandler /* 39: I2C1 */ - .long PDMA0_IRQHandler /* 40: PDMA0 */ - .long DAC_IRQHandler /* 41: DAC */ - .long EADC00_IRQHandler /* 42: EADC00 */ - .long EADC01_IRQHandler /* 43: EADC01 */ - .long ACMP01_IRQHandler /* 44: ACMP01 */ - .long ACMP23_IRQHandler /* 45: ACMP23 */ - .long EADC02_IRQHandler /* 46: EADC02 */ - .long EADC03_IRQHandler /* 47: EADC03 */ - .long UART2_IRQHandler /* 48: UART2 */ - .long UART3_IRQHandler /* 49: UART3 */ - .long QSPI1_IRQHandler /* 50: QSPI1 */ - .long SPI1_IRQHandler /* 51: SPI1 */ - .long SPI2_IRQHandler /* 52: SPI2 */ - .long USBD_IRQHandler /* 53: USBD */ - .long OHCI_IRQHandler /* 54: OHCI */ - .long USBOTG_IRQHandler /* 55: OTG */ - .long BMC_Handler /* 56: BMC */ - .long SPI5_IRQHandler /* 57: SPI5 */ - .long SC0_IRQHandler /* 58: SC0 */ - .long SC1_IRQHandler /* 59: SC1 */ - .long SC2_IRQHandler /* 60: SC2 */ - .long GPJ_IRQHandler /* 61: GPJ */ - .long SPI3_IRQHandler /* 62: SPI3 */ - .long SPI4_IRQHandler /* 63: SPI4 */ - .long SDH0_IRQHandler /* 64: SDH0 */ - .long USBD20_IRQHandler /* 65: HSUSBD */ - .long EMAC0_IRQHandler /* 66: EMAC0 */ - .long 0 /* 67: Reserved */ - .long I2S0_IRQHandler /* 68: I2S0 */ - .long I2S1_IRQHandler /* 69: I2S1 */ - .long SPI6_IRQHandler /* 70: SPI6 */ - .long CRPT_IRQHandler /* 71: CRPT */ - .long GPG_IRQHandler /* 72: GPG */ - .long EINT6_IRQHandler /* 73: EINT6 */ - .long UART4_IRQHandler /* 74: UART4 */ - .long UART5_IRQHandler /* 75: UART5 */ - .long USCI0_IRQHandler /* 76: USCI0 */ - .long SPI7_IRQHandler /* 77: SPI7 */ - .long BPWM0_IRQHandler /* 78: BPWM0 */ - .long BPWM1_IRQHandler /* 79: BPWM1 */ - .long SPIM_IRQHandler /* 80: SPIM */ - .long CCAP_IRQHandler /* 81: CCAP */ - .long I2C2_IRQHandler /* 82: I2C2 */ - .long I2C3_IRQHandler /* 83: I2C3 */ - .long EQEI0_IRQHandler /* 84: EQEI0 */ - .long EQEI1_IRQHandler /* 85: EQEI1 */ - .long ECAP0_IRQHandler /* 86: ECAP0 */ - .long ECAP1_IRQHandler /* 87: ECAP1 */ - .long GPH_IRQHandler /* 88: GPH */ - .long EINT7_IRQHandler /* 89: EINT7 */ - .long SDH1_IRQHandler /* 90: SDH1 */ - .long PSIO_IRQHandler /* 91: PSIO */ - .long EHCI_IRQHandler /* 92: EHCI */ - .long USBOTG20_IRQHandler /* 93: HSOTG */ - .long ECAP2_IRQHandler /* 94: ECAP2 */ - .long ECAP3_IRQHandler /* 95: ECAP3 */ - .long KPI_IRQHandler /* 96: KPI */ - .long HBI_IRQHandler /* 97: HBI */ - .long PDMA1_IRQHandler /* 98: PDMA1 */ - .long UART8_IRQHandler /* 99: UART8 */ - .long UART9_IRQHandler /* 100: UART9 */ - .long TRNG_IRQHandler /* 101: TRNG */ - .long UART6_IRQHandler /* 102: UART6 */ - .long UART7_IRQHandler /* 103: UART7 */ - .long EADC10_IRQHandler /* 104: EADC10 */ - .long EADC11_IRQHandler /* 105: EADC11 */ - .long EADC12_IRQHandler /* 106: EADC12 */ - .long EADC13_IRQHandler /* 107: EADC13 */ - .long SPI8_IRQHandler /* 108: SPI8 */ - .long KS_IRQHandler /* 109: KS */ - .long GPI_IRQHandler /* 110: GPI */ - .long SPI9_IRQHandler /* 111: SPI9 */ - .long CANFD00_IRQHandler /* 112: CANFD00 */ - .long CANFD01_IRQHandler /* 113: CANFD01 */ - .long CANFD10_IRQHandler /* 114: CANFD10 */ - .long CANFD10_IRQHandler /* 115: CANFD10 */ - .long EQEI2_IRQHandler /* 116: EQEI2 */ - .long EQEI3_IRQHandler /* 117: EQEI3 */ - .long I2C4_IRQHandler /* 118: I2C4 */ - .long SPI10_IRQHandler /* 119: SPI10 */ - .long CANFD20_IRQHandler /* 120: CANFD20 */ - .long CANFD21_IRQHandler /* 121: CANFD21 */ - .long CANFD30_IRQHandler /* 122: CANFD30 */ - .long CANFD30_IRQHandler /* 123: CANFD30 */ - .long EADC20_IRQHandler /* 124: EADC20 */ - .long EADC21_IRQHandler /* 125: EADC21 */ - .long EADC22_IRQHandler /* 126: EADC22 */ - .long EADC23_IRQHandler /* 127: EADC23 */ - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, Default_Handler - .endm - - def_irq_handler NMI_Handler - def_irq_handler HardFault_Handler - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SVC_Handler - def_irq_handler DebugMon_Handler - def_irq_handler PendSV_Handler - def_irq_handler SysTick_Handler - - def_irq_handler BOD_IRQHandler - def_irq_handler IRC_IRQHandler - def_irq_handler PWRWU_IRQHandler - def_irq_handler RAMPE_IRQHandler - def_irq_handler CKFAIL_IRQHandler - def_irq_handler ISP_IRQHandler - def_irq_handler RTC_IRQHandler - def_irq_handler TAMPER_IRQHandler - def_irq_handler WDT_IRQHandler - def_irq_handler WWDT_IRQHandler - def_irq_handler EINT0_IRQHandler - def_irq_handler EINT1_IRQHandler - def_irq_handler EINT2_IRQHandler - def_irq_handler EINT3_IRQHandler - def_irq_handler EINT4_IRQHandler - def_irq_handler EINT5_IRQHandler - def_irq_handler GPA_IRQHandler - def_irq_handler GPB_IRQHandler - def_irq_handler GPC_IRQHandler - def_irq_handler GPD_IRQHandler - def_irq_handler GPE_IRQHandler - def_irq_handler GPF_IRQHandler - def_irq_handler QSPI0_IRQHandler - def_irq_handler SPI0_IRQHandler - def_irq_handler BRAKE0_IRQHandler - def_irq_handler EPWM0P0_IRQHandler - def_irq_handler EPWM0P1_IRQHandler - def_irq_handler EPWM0P2_IRQHandler - def_irq_handler BRAKE1_IRQHandler - def_irq_handler EPWM1P0_IRQHandler - def_irq_handler EPWM1P1_IRQHandler - def_irq_handler EPWM1P2_IRQHandler - def_irq_handler TMR0_IRQHandler - def_irq_handler TMR1_IRQHandler - def_irq_handler TMR2_IRQHandler - def_irq_handler TMR3_IRQHandler - def_irq_handler UART0_IRQHandler - def_irq_handler UART1_IRQHandler - def_irq_handler I2C0_IRQHandler - def_irq_handler I2C1_IRQHandler - def_irq_handler PDMA0_IRQHandler - def_irq_handler DAC_IRQHandler - def_irq_handler EADC00_IRQHandler - def_irq_handler EADC01_IRQHandler - def_irq_handler ACMP01_IRQHandler - def_irq_handler ACMP23_IRQHandler - def_irq_handler EADC02_IRQHandler - def_irq_handler EADC03_IRQHandler - def_irq_handler UART2_IRQHandler - def_irq_handler UART3_IRQHandler - def_irq_handler QSPI1_IRQHandler - def_irq_handler SPI1_IRQHandler - def_irq_handler SPI2_IRQHandler - def_irq_handler USBD_IRQHandler - def_irq_handler OHCI_IRQHandler - def_irq_handler USBOTG_IRQHandler - def_irq_handler BMC_Handler - def_irq_handler SPI5_IRQHandler - def_irq_handler SC0_IRQHandler - def_irq_handler SC1_IRQHandler - def_irq_handler SC2_IRQHandler - def_irq_handler GPJ_IRQHandler - def_irq_handler SPI3_IRQHandler - def_irq_handler SPI4_IRQHandler - def_irq_handler SDH0_IRQHandler - def_irq_handler USBD20_IRQHandler - def_irq_handler EMAC0_IRQHandler - def_irq_handler I2S0_IRQHandler - def_irq_handler I2S1_IRQHandler - def_irq_handler SPI6_IRQHandler - def_irq_handler CRPT_IRQHandler - def_irq_handler GPG_IRQHandler - def_irq_handler EINT6_IRQHandler - def_irq_handler UART4_IRQHandler - def_irq_handler UART5_IRQHandler - def_irq_handler USCI0_IRQHandler - def_irq_handler SPI7_IRQHandler - def_irq_handler BPWM0_IRQHandler - def_irq_handler BPWM1_IRQHandler - def_irq_handler SPIM_IRQHandler - def_irq_handler CCAP_IRQHandler - def_irq_handler I2C2_IRQHandler - def_irq_handler I2C3_IRQHandler - def_irq_handler EQEI0_IRQHandler - def_irq_handler EQEI1_IRQHandler - def_irq_handler ECAP0_IRQHandler - def_irq_handler ECAP1_IRQHandler - def_irq_handler GPH_IRQHandler - def_irq_handler EINT7_IRQHandler - def_irq_handler SDH1_IRQHandler - def_irq_handler PSIO_IRQHandler - def_irq_handler EHCI_IRQHandler - def_irq_handler USBOTG20_IRQHandler - def_irq_handler ECAP2_IRQHandler - def_irq_handler ECAP3_IRQHandler - def_irq_handler KPI_IRQHandler - def_irq_handler HBI_IRQHandler - def_irq_handler PDMA1_IRQHandler - def_irq_handler UART8_IRQHandler - def_irq_handler UART9_IRQHandler - def_irq_handler TRNG_IRQHandler - def_irq_handler UART6_IRQHandler - def_irq_handler UART7_IRQHandler - def_irq_handler EADC10_IRQHandler - def_irq_handler EADC11_IRQHandler - def_irq_handler EADC12_IRQHandler - def_irq_handler EADC13_IRQHandler - def_irq_handler SPI8_IRQHandler - def_irq_handler KS_IRQHandler - def_irq_handler GPI_IRQHandler - def_irq_handler SPI9_IRQHandler - def_irq_handler CANFD00_IRQHandler - def_irq_handler CANFD01_IRQHandler - def_irq_handler CANFD10_IRQHandler - def_irq_handler CANFD11_IRQHandler - def_irq_handler EQEI2_IRQHandler - def_irq_handler EQEI3_IRQHandler - def_irq_handler I2C4_IRQHandler - def_irq_handler SPI10_IRQHandler - def_irq_handler CANFD20_IRQHandler - def_irq_handler CANFD21_IRQHandler - def_irq_handler CANFD30_IRQHandler - def_irq_handler CANFD31_IRQHandler - def_irq_handler EADC20_IRQHandler - def_irq_handler EADC21_IRQHandler - def_irq_handler EADC22_IRQHandler - def_irq_handler EADC23_IRQHandler - - .end diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/IAR/startup_M460.s b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/IAR/startup_M460.s deleted file mode 100644 index c8383f0fb59..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/IAR/startup_M460.s +++ /dev/null @@ -1,499 +0,0 @@ -;/****************************************************************************** -; * @file startup_M460.s -; * @version V3.00 -; * @brief CMSIS Cortex-M4 Core Device Startup File for M460 -; * -; * @copyright SPDX-License-Identifier: Apache-2.0 -; * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -;*****************************************************************************/ - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN HardFault_Handler - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler - DCD HardFault_Handler - DCD MemManage_Handler - DCD BusFault_Handler - DCD UsageFault_Handler -__vector_table_0x1c - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD SVC_Handler - DCD DebugMon_Handler - DCD 0 - DCD PendSV_Handler - DCD SysTick_Handler - - ; External Interrupts - DCD BOD_IRQHandler ; 0: Brown Out detection - DCD IRC_IRQHandler ; 1: Internal RC - DCD PWRWU_IRQHandler ; 2: Power down wake up - DCD RAMPE_IRQHandler ; 3: RAM parity error - DCD CKFAIL_IRQHandler ; 4: Clock detection fail - DCD ISP_IRQHandler ; 5: ISP - DCD RTC_IRQHandler ; 6: Real Time Clock - DCD TAMPER_IRQHandler ; 7: Tamper detection - DCD WDT_IRQHandler ; 8: Watchdog timer - DCD WWDT_IRQHandler ; 9: Window watchdog timer - DCD EINT0_IRQHandler ; 10: External Input 0 - DCD EINT1_IRQHandler ; 11: External Input 1 - DCD EINT2_IRQHandler ; 12: External Input 2 - DCD EINT3_IRQHandler ; 13: External Input 3 - DCD EINT4_IRQHandler ; 14: External Input 4 - DCD EINT5_IRQHandler ; 15: External Input 5 - DCD GPA_IRQHandler ; 16: GPIO Port A - DCD GPB_IRQHandler ; 17: GPIO Port B - DCD GPC_IRQHandler ; 18: GPIO Port C - DCD GPD_IRQHandler ; 19: GPIO Port D - DCD GPE_IRQHandler ; 20: GPIO Port E - DCD GPF_IRQHandler ; 21: GPIO Port F - DCD QSPI0_IRQHandler ; 22: QSPI0 - DCD SPI0_IRQHandler ; 23: SPI0 - DCD BRAKE0_IRQHandler ; 24: EPWM0 brake - DCD EPWM0P0_IRQHandler ; 25: EPWM0 pair 0 - DCD EPWM0P1_IRQHandler ; 26: EPWM0 pair 1 - DCD EPWM0P2_IRQHandler ; 27: EPWM0 pair 2 - DCD BRAKE1_IRQHandler ; 28: EPWM1 brake - DCD EPWM1P0_IRQHandler ; 29: EPWM1 pair 0 - DCD EPWM1P1_IRQHandler ; 30: EPWM1 pair 1 - DCD EPWM1P2_IRQHandler ; 31: EPWM1 pair 2 - DCD TMR0_IRQHandler ; 32: Timer 0 - DCD TMR1_IRQHandler ; 33: Timer 1 - DCD TMR2_IRQHandler ; 34: Timer 2 - DCD TMR3_IRQHandler ; 35: Timer 3 - DCD UART0_IRQHandler ; 36: UART0 - DCD UART1_IRQHandler ; 37: UART1 - DCD I2C0_IRQHandler ; 38: I2C0 - DCD I2C1_IRQHandler ; 39: I2C1 - DCD PDMA0_IRQHandler ; 40: Peripheral DMA 0 - DCD DAC_IRQHandler ; 41: DAC - DCD EADC00_IRQHandler ; 42: EADC0 interrupt source 0 - DCD EADC01_IRQHandler ; 43: EADC0 interrupt source 1 - DCD ACMP01_IRQHandler ; 44: ACMP0 and ACMP1 - DCD ACMP23_IRQHandler ; 45: ACMP2 and ACMP3 - DCD EADC02_IRQHandler ; 46: EADC0 interrupt source 2 - DCD EADC03_IRQHandler ; 47: EADC0 interrupt source 3 - DCD UART2_IRQHandler ; 48: UART2 - DCD UART3_IRQHandler ; 49: UART3 - DCD QSPI1_IRQHandler ; 50: QSPI1 - DCD SPI1_IRQHandler ; 51: SPI1 - DCD SPI2_IRQHandler ; 52: SPI2 - DCD USBD_IRQHandler ; 53: USB device - DCD OHCI_IRQHandler ; 54: OHCI - DCD USBOTG_IRQHandler ; 55: USB OTG - DCD BMC_Handler ; 56: BMC - DCD SPI5_IRQHandler ; 57: SPI5 - DCD SC0_IRQHandler ; 58: SC0 - DCD SC1_IRQHandler ; 59: SC1 - DCD SC2_IRQHandler ; 60: SC2 - DCD GPJ_IRQHandler ; 61: GPIO Port J - DCD SPI3_IRQHandler ; 62: SPI3 - DCD Default_Handler ; 63: - DCD SDH0_IRQHandler ; 64: SDH0 - DCD USBD20_IRQHandler ; 65: USBD20 - DCD EMAC0_IRQHandler ; 66: EMAC0 - DCD Default_Handler ; 67: - DCD I2S0_IRQHandler ; 68: I2S0 - DCD I2S1_IRQHandler ; 69: I2S1 - DCD SPI6_IRQHandler ; 70: SPI6 - DCD CRPT_IRQHandler ; 71: CRYPTO - DCD GPG_IRQHandler ; 72: GPIO Port G - DCD EINT6_IRQHandler ; 73: External Input 6 - DCD UART4_IRQHandler ; 74: UART4 - DCD UART5_IRQHandler ; 75: UART5 - DCD USCI0_IRQHandler ; 76: USCI0 - DCD SPI7_IRQHandler ; 77: SPI7 - DCD BPWM0_IRQHandler ; 78: BPWM0 - DCD BPWM1_IRQHandler ; 79: BPWM1 - DCD SPIM_IRQHandler ; 80: SPIM - DCD CCAP_IRQHandler ; 81: CCAP - DCD I2C2_IRQHandler ; 82: I2C2 - DCD I2C3_IRQHandler ; 83: I2C3 - DCD EQEI0_IRQHandler ; 84: QEI0 - DCD EQEI1_IRQHandler ; 85: QEI1 - DCD ECAP0_IRQHandler ; 86: ECAP0 - DCD ECAP1_IRQHandler ; 87: ECAP1 - DCD GPH_IRQHandler ; 88: GPIO Port H - DCD EINT7_IRQHandler ; 89: External Input 7 - DCD SDH1_IRQHandler ; 90: SDH1 - DCD PSIO_IRQHandler ; 91: PSIO - DCD EHCI_IRQHandler ; 92: EHCI - DCD USBOTG20_IRQHandler ; 93: HSOTG - DCD ECAP2_IRQHandler ; 94: ECAP2 - DCD ECAP3_IRQHandler ; 95: ECAP3 - DCD KPI_IRQHandler ; 96: KPI - DCD HBI_IRQHandler ; 97: HBI - DCD PDMA1_IRQHandler ; 98: Peripheral DMA 1 - DCD UART8_IRQHandler ; 99: UART8 - DCD UART9_IRQHandler ; 100: UART9 - DCD TRNG_IRQHandler ; 101: TRNG - DCD UART6_IRQHandler ; 102: UART6 - DCD UART7_IRQHandler ; 103: UART7 - DCD EADC10_IRQHandler ; 104: EADC1 interrupt source 0 - DCD EADC11_IRQHandler ; 105: EADC1 interrupt source 1 - DCD EADC12_IRQHandler ; 106: EADC1 interrupt source 2 - DCD EADC13_IRQHandler ; 107: EADC1 interrupt source 3 - DCD SPI8_IRQHandler ; 108: SPI8 - DCD KS_IRQHandler ; 109: Key Store - DCD GPI_IRQHandler ; 110: GPIO Port I - DCD SPI9_IRQHandler ; 111: SPI9 - DCD CANFD00_IRQHandler ; 112: CANFD0 interrupt source 0 - DCD CANFD01_IRQHandler ; 113: CANFD0 interrupt source 1 - DCD CANFD10_IRQHandler ; 114: CANFD1 interrupt source 0 - DCD CANFD11_IRQHandler ; 115: CANFD1 interrupt source 1 - DCD EQEI2_IRQHandler ; 116: EQEI2 - DCD EQEI3_IRQHandler ; 117: EQEI3 - DCD I2C4_IRQHandler ; 118: I2C4 - DCD SPI10_IRQHandler ; 119: SPI10 - DCD CANFD20_IRQHandler ; 112: CANFD2 interrupt source 0 - DCD CANFD21_IRQHandler ; 113: CANFD2 interrupt source 1 - DCD CANFD30_IRQHandler ; 114: CANFD3 interrupt source 0 - DCD CANFD31_IRQHandler ; 115: CANFD4 interrupt source 1 - DCD EADC20_IRQHandler ; 104: EADC2 interrupt source 0 - DCD EADC21_IRQHandler ; 105: EADC2 interrupt source 1 - DCD EADC22_IRQHandler ; 106: EADC2 interrupt source 2 - DCD EADC23_IRQHandler ; 107: EADC2 interrupt source 3 -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - - LDR R0, =SystemInit - BLX R0 - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B NMI_Handler - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B MemManage_Handler - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B BusFault_Handler - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B UsageFault_Handler - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B SVC_Handler - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B DebugMon_Handler - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B PendSV_Handler - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B SysTick_Handler - - PUBWEAK BOD_IRQHandler - PUBWEAK IRC_IRQHandler - PUBWEAK PWRWU_IRQHandler - PUBWEAK RAMPE_IRQHandler - PUBWEAK CKFAIL_IRQHandler - PUBWEAK ISP_IRQHandler - PUBWEAK RTC_IRQHandler - PUBWEAK TAMPER_IRQHandler - PUBWEAK WDT_IRQHandler - PUBWEAK WWDT_IRQHandler - PUBWEAK EINT0_IRQHandler - PUBWEAK EINT1_IRQHandler - PUBWEAK EINT2_IRQHandler - PUBWEAK EINT3_IRQHandler - PUBWEAK EINT4_IRQHandler - PUBWEAK EINT5_IRQHandler - PUBWEAK GPA_IRQHandler - PUBWEAK GPB_IRQHandler - PUBWEAK GPC_IRQHandler - PUBWEAK GPD_IRQHandler - PUBWEAK GPE_IRQHandler - PUBWEAK GPF_IRQHandler - PUBWEAK QSPI0_IRQHandler - PUBWEAK SPI0_IRQHandler - PUBWEAK BRAKE0_IRQHandler - PUBWEAK EPWM0P0_IRQHandler - PUBWEAK EPWM0P1_IRQHandler - PUBWEAK EPWM0P2_IRQHandler - PUBWEAK BRAKE1_IRQHandler - PUBWEAK EPWM1P0_IRQHandler - PUBWEAK EPWM1P1_IRQHandler - PUBWEAK EPWM1P2_IRQHandler - PUBWEAK TMR0_IRQHandler - PUBWEAK TMR1_IRQHandler - PUBWEAK TMR2_IRQHandler - PUBWEAK TMR3_IRQHandler - PUBWEAK UART0_IRQHandler - PUBWEAK UART1_IRQHandler - PUBWEAK I2C0_IRQHandler - PUBWEAK I2C1_IRQHandler - PUBWEAK PDMA0_IRQHandler - PUBWEAK DAC_IRQHandler - PUBWEAK EADC00_IRQHandler - PUBWEAK EADC01_IRQHandler - PUBWEAK ACMP01_IRQHandler - PUBWEAK ACMP23_IRQHandler - PUBWEAK EADC02_IRQHandler - PUBWEAK EADC03_IRQHandler - PUBWEAK UART2_IRQHandler - PUBWEAK UART3_IRQHandler - PUBWEAK QSPI1_IRQHandler - PUBWEAK SPI1_IRQHandler - PUBWEAK SPI2_IRQHandler - PUBWEAK USBD_IRQHandler - PUBWEAK OHCI_IRQHandler - PUBWEAK USBOTG_IRQHandler - PUBWEAK BMC_Handler - PUBWEAK SPI5_IRQHandler - PUBWEAK SC0_IRQHandler - PUBWEAK SC1_IRQHandler - PUBWEAK SC2_IRQHandler - PUBWEAK GPJ_IRQHandler - PUBWEAK SPI3_IRQHandler - PUBWEAK SPI4_IRQHandler - PUBWEAK SDH0_IRQHandler - PUBWEAK USBD20_IRQHandler - PUBWEAK EMAC0_IRQHandler - PUBWEAK I2S0_IRQHandler - PUBWEAK I2S1_IRQHandler - PUBWEAK SPI6_IRQHandler - PUBWEAK CRPT_IRQHandler - PUBWEAK GPG_IRQHandler - PUBWEAK EINT6_IRQHandler - PUBWEAK UART4_IRQHandler - PUBWEAK UART5_IRQHandler - PUBWEAK USCI0_IRQHandler - PUBWEAK SPI7_IRQHandler - PUBWEAK BPWM0_IRQHandler - PUBWEAK BPWM1_IRQHandler - PUBWEAK SPIM_IRQHandler - PUBWEAK CCAP_IRQHandler - PUBWEAK I2C2_IRQHandler - PUBWEAK I2C3_IRQHandler - PUBWEAK EQEI0_IRQHandler - PUBWEAK EQEI1_IRQHandler - PUBWEAK ECAP0_IRQHandler - PUBWEAK ECAP1_IRQHandler - PUBWEAK GPH_IRQHandler - PUBWEAK EINT7_IRQHandler - PUBWEAK SDH1_IRQHandler - PUBWEAK PSIO_IRQHandler - PUBWEAK EHCI_IRQHandler - PUBWEAK USBOTG20_IRQHandler - PUBWEAK ECAP2_IRQHandler - PUBWEAK ECAP3_IRQHandler - PUBWEAK KPI_IRQHandler - PUBWEAK HBI_IRQHandler - PUBWEAK PDMA1_IRQHandler - PUBWEAK UART8_IRQHandler - PUBWEAK UART9_IRQHandler - PUBWEAK TRNG_IRQHandler - PUBWEAK UART6_IRQHandler - PUBWEAK UART7_IRQHandler - PUBWEAK EADC10_IRQHandler - PUBWEAK EADC11_IRQHandler - PUBWEAK EADC12_IRQHandler - PUBWEAK EADC13_IRQHandler - PUBWEAK SPI8_IRQHandler - PUBWEAK GPI_IRQHandler - PUBWEAK SPI9_IRQHandler - PUBWEAK CANFD00_IRQHandler - PUBWEAK CANFD01_IRQHandler - PUBWEAK CANFD10_IRQHandler - PUBWEAK CANFD11_IRQHandler - PUBWEAK EQEI2_IRQHandler - PUBWEAK EQEI3_IRQHandler - PUBWEAK I2C4_IRQHandler - PUBWEAK SPI10_IRQHandler - PUBWEAK CANFD20_IRQHandler - PUBWEAK CANFD21_IRQHandler - PUBWEAK CANFD30_IRQHandler - PUBWEAK CANFD31_IRQHandler - PUBWEAK EADC20_IRQHandler - PUBWEAK EADC21_IRQHandler - PUBWEAK EADC22_IRQHandler - PUBWEAK EADC23_IRQHandler - SECTION .text:CODE:REORDER:NOROOT(1) - -BOD_IRQHandler -IRC_IRQHandler -PWRWU_IRQHandler -RAMPE_IRQHandler -CKFAIL_IRQHandler -ISP_IRQHandler -RTC_IRQHandler -TAMPER_IRQHandler -WDT_IRQHandler -WWDT_IRQHandler -EINT0_IRQHandler -EINT1_IRQHandler -EINT2_IRQHandler -EINT3_IRQHandler -EINT4_IRQHandler -EINT5_IRQHandler -GPA_IRQHandler -GPB_IRQHandler -GPC_IRQHandler -GPD_IRQHandler -GPE_IRQHandler -GPF_IRQHandler -QSPI0_IRQHandler -SPI0_IRQHandler -BRAKE0_IRQHandler -EPWM0P0_IRQHandler -EPWM0P1_IRQHandler -EPWM0P2_IRQHandler -BRAKE1_IRQHandler -EPWM1P0_IRQHandler -EPWM1P1_IRQHandler -EPWM1P2_IRQHandler -TMR0_IRQHandler -TMR1_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -UART0_IRQHandler -UART1_IRQHandler -I2C0_IRQHandler -I2C1_IRQHandler -PDMA0_IRQHandler -DAC_IRQHandler -EADC00_IRQHandler -EADC01_IRQHandler -ACMP01_IRQHandler -ACMP23_IRQHandler -EADC02_IRQHandler -EADC03_IRQHandler -UART2_IRQHandler -UART3_IRQHandler -QSPI1_IRQHandler -SPI1_IRQHandler -SPI2_IRQHandler -USBD_IRQHandler -OHCI_IRQHandler -USBOTG_IRQHandler -BMC_Handler -SPI5_IRQHandler -SC0_IRQHandler -SC1_IRQHandler -SC2_IRQHandler -GPJ_IRQHandler -SPI3_IRQHandler -SPI4_IRQHandler -SDH0_IRQHandler -USBD20_IRQHandler -EMAC0_IRQHandler -I2S0_IRQHandler -I2S1_IRQHandler -SPI6_IRQHandler -CRPT_IRQHandler -GPG_IRQHandler -EINT6_IRQHandler -UART4_IRQHandler -UART5_IRQHandler -USCI0_IRQHandler -SPI7_IRQHandler -BPWM0_IRQHandler -BPWM1_IRQHandler -SPIM_IRQHandler -CCAP_IRQHandler -I2C2_IRQHandler -I2C3_IRQHandler -EQEI0_IRQHandler -EQEI1_IRQHandler -ECAP0_IRQHandler -ECAP1_IRQHandler -GPH_IRQHandler -EINT7_IRQHandler -SDH1_IRQHandler -PSIO_IRQHandler -EHCI_IRQHandler -USBOTG20_IRQHandler -ECAP2_IRQHandler -ECAP3_IRQHandler -KPI_IRQHandler -HBI_IRQHandler -PDMA1_IRQHandler -UART8_IRQHandler -UART9_IRQHandler -TRNG_IRQHandler -UART6_IRQHandler -UART7_IRQHandler -EADC10_IRQHandler -EADC11_IRQHandler -EADC12_IRQHandler -EADC13_IRQHandler -SPI8_IRQHandler -KS_IRQHandler -GPI_IRQHandler -SPI9_IRQHandler -CANFD00_IRQHandler -CANFD01_IRQHandler -CANFD10_IRQHandler -CANFD11_IRQHandler -EQEI2_IRQHandler -EQEI3_IRQHandler -I2C4_IRQHandler -SPI10_IRQHandler -CANFD20_IRQHandler -CANFD21_IRQHandler -CANFD30_IRQHandler -CANFD31_IRQHandler -EADC20_IRQHandler -EADC21_IRQHandler -EADC22_IRQHandler -EADC23_IRQHandler -Default_Handler - B Default_Handler - - - - - END diff --git a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/system_m460.c b/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/system_m460.c deleted file mode 100644 index 798bd3140cf..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/Nuvoton/m460/Source/system_m460.c +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************//** - * @file system_m460.c - * @version V3.000 - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Source File for M460 - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - - -/*---------------------------------------------------------------------------- - DEFINES - *----------------------------------------------------------------------------*/ - - -/*---------------------------------------------------------------------------- - Clock Variable definitions - *----------------------------------------------------------------------------*/ -uint32_t SystemCoreClock = __SYSTEM_CLOCK; /*!< System Clock Frequency (Core Clock)*/ -uint32_t CyclesPerUs = (__HSI / 1000000UL); /* Cycles per micro second */ -uint32_t PllClock = __HSI; /*!< PLL Output Clock Frequency */ -uint32_t gau32ClkSrcTbl[] = {__HXT, __LXT, 0UL, __LIRC, 0UL, 0UL, 0UL, __HIRC}; - -/*---------------------------------------------------------------------------- - Clock functions - *----------------------------------------------------------------------------*/ -void SystemCoreClockUpdate(void) /* Get Core Clock Frequency */ -{ - uint32_t u32Freq, u32ClkSrc; - uint32_t u32HclkDiv; - - /* Update PLL Clock */ - PllClock = CLK_GetPLLClockFreq(); - - u32ClkSrc = CLK->CLKSEL0 & CLK_CLKSEL0_HCLKSEL_Msk; - - if (u32ClkSrc == CLK_CLKSEL0_HCLKSEL_PLL) - { - /* Use PLL clock */ - u32Freq = PllClock; - } - else - { - /* Use the clock sources directly */ - u32Freq = gau32ClkSrcTbl[u32ClkSrc]; - } - - u32HclkDiv = (CLK->CLKDIV0 & CLK_CLKDIV0_HCLKDIV_Msk) + 1UL; - - /* Update System Core Clock */ - SystemCoreClock = u32Freq / u32HclkDiv; - - - //if(SystemCoreClock == 0) - // __BKPT(0); - - CyclesPerUs = (SystemCoreClock + 500000UL) / 1000000UL; -} - - -/** - * @brief Initialize the System - * - * @param none - * @return none - */ -void SystemInit(void) -{ - - /* Add your system initialize code here. - Do not use global variables because this function is called before - reaching pre-main. RW section maybe overwritten afterwards. */ - - /* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - SCB->CPACR |= ((3UL << 10 * 2) | /* set CP10 Full Access */ - (3UL << 11 * 2)); /* set CP11 Full Access */ -#endif - - /* Unlock protected registers */ - SYS_UnlockReg(); - - /* Set HCLK switch to be reset by HRESET reset sources */ - outpw(0x40000014, inpw(0x40000014) | BIT7); - - /* Set HXT crystal as INV type */ - CLK->PWRCTL &= ~CLK_PWRCTL_HXTSELTYP_Msk; - - /* Lock protected registers */ - SYS_LockReg(); - -} diff --git a/bsp/nuvoton/libraries/m460/Device/SConscript b/bsp/nuvoton/libraries/m460/Device/SConscript deleted file mode 100644 index 16d4765ba8b..00000000000 --- a/bsp/nuvoton/libraries/m460/Device/SConscript +++ /dev/null @@ -1,25 +0,0 @@ -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(""" -Nuvoton/m460/Source/system_m460.c -""") - -# add for startup script -if rtconfig.PLATFORM in ['gcc']: - src = src + ['Nuvoton/m460/Source/GCC/startup_M460.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src = src + ['Nuvoton/m460/Source/ARM/startup_m460.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src = src + ['Nuvoton/m460/Source/IAR/startup_M460.s'] - -path = [cwd + '/Nuvoton/m460/Include',] - -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m460/StdDriver/SConscript b/bsp/nuvoton/libraries/m460/StdDriver/SConscript deleted file mode 100644 index 668101f3814..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/SConscript +++ /dev/null @@ -1,28 +0,0 @@ -# RT-Thread building script for component -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -libs = [] -src = Glob('*src/*.c') + Glob('src/*.cpp') -cpppath = [cwd + '/inc'] -libpath = [cwd + '/lib'] - -if not GetDepend('BSP_USE_STDDRIVER_SOURCE'): - if rtconfig.CROSS_TOOL == 'keil': - if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'): - libs += ['libstddriver_keil'] - elif GetOption('target') == 'mdk4' and os.path.isfile('./lib/libstddriver_keil4.lib'): - libs += ['libstddriver_keil4'] - elif rtconfig.CROSS_TOOL == 'gcc' and os.path.isfile('./lib/libstddriver_gcc.a'): - libs += ['libstddriver_gcc'] - elif os.path.isfile('./lib/libstddriver_iar.a'): - libs += ['libstddriver_iar'] - -if not libs: - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath) -else: - src = [] - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath) - -Return('group') diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_acmp.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_acmp.h deleted file mode 100644 index fd73ba70315..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_acmp.h +++ /dev/null @@ -1,455 +0,0 @@ -/**************************************************************************//** - * @file ACMP.h - * @version V1.00 - * @brief M480 Series ACMP Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_ACMP_H__ -#define __NU_ACMP_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_CONSTANTS ACMP Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_CTL_FILTSEL_OFF (0UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for filter function disabled. \hideinitializer */ -#define ACMP_CTL_FILTSEL_1PCLK (1UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 1 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_2PCLK (2UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 2 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_4PCLK (3UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 4 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_8PCLK (4UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 8 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_16PCLK (5UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 16 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_32PCLK (6UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 32 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_64PCLK (7UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 64 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_INTPOL_RF (0UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting rising edge and falling edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_INTPOL_R (1UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting rising edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_INTPOL_F (2UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting falling edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_POSSEL_P0 (0UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P0 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P1 (1UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P1 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P2 (2UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P2 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P3 (3UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P3 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_NEGSEL_PIN (0UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting the voltage of ACMP negative input pin as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_CRV (1UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting internal comparator reference voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_VBG (2UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting internal Band-gap voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_DAC (3UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting DAC output voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_30MV (3UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for enabling the hysteresis function at 30mV. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_20MV (2UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for enabling the hysteresis function at 20mV. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_10MV (1UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for enabling the hysteresis function at 10mV. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_DISABLE (0UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for disabling the hysteresis function. \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_VREF constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_VREF_CRV0SSEL_VDDA (0UL << ACMP_VREF_CRV0SSEL_Pos) /*!< ACMP_VREF setting for selecting analog supply voltage VDDA as the CRV0 source voltage \hideinitializer */ -#define ACMP_VREF_CRV0SSEL_INTVREF (1UL << ACMP_VREF_CRV0SSEL_Pos) /*!< ACMP_VREF setting for selecting internal reference voltage as the CRV0 source voltage \hideinitializer */ -#define ACMP_VREF_CRV1SSEL_VDDA (0UL << ACMP_VREF_CRV1SSEL_Pos) /*!< ACMP_VREF setting for selecting analog supply voltage VDDA as the CRV1 source voltage \hideinitializer */ -#define ACMP_VREF_CRV1SSEL_INTVREF (1UL << ACMP_VREF_CRV1SSEL_Pos) /*!< ACMP_VREF setting for selecting internal reference voltage as the CRV1 source voltage \hideinitializer */ -#define ACMP_VREF_CRV2SSEL_VDDA (0UL << ACMP_VREF_CRV2SSEL_Pos) /*!< ACMP_VREF setting for selecting analog supply voltage VDDA as the CRV2 source voltage \hideinitializer */ -#define ACMP_VREF_CRV2SSEL_INTVREF (1UL << ACMP_VREF_CRV2SSEL_Pos) /*!< ACMP_VREF setting for selecting internal reference voltage as the CRV2 source voltage \hideinitializer */ -#define ACMP_VREF_CRV3SSEL_VDDA (0UL << ACMP_VREF_CRV3SSEL_Pos) /*!< ACMP_VREF setting for selecting analog supply voltage VDDA as the CRV3 source voltage \hideinitializer */ -#define ACMP_VREF_CRV3SSEL_INTVREF (1UL << ACMP_VREF_CRV3SSEL_Pos) /*!< ACMP_VREF setting for selecting internal reference voltage as the CRV3 source voltage \hideinitializer */ - - -/*@}*/ /* end of group ACMP_EXPORTED_CONSTANTS */ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPOINV bit of ACMP_CTL register to enable output inverse function. - * \hideinitializer - */ -#define ACMP_ENABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to disable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPOINV bit of ACMP_CTL register to disable output inverse function. - * \hideinitializer - */ -#define ACMP_DISABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to select ACMP negative input source - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Src is comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * - \ref ACMP_CTL_NEGSEL_DAC - * @return None - * @details This macro will set NEGSEL (ACMP_CTL[5:4]) to determine the source of negative input. - * \hideinitializer - */ -#define ACMP_SET_NEG_SRC(acmp, u32ChNum, u32Src) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_NEGSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to enable hysteresis function and set hysteresis to 30mV - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * \hideinitializer - */ -#define ACMP_ENABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_HYSTERESIS_30MV) - -/** - * @brief This macro is used to disable hysteresis function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear HYSEL bits of ACMP_CTL register to disable hysteresis function. - * \hideinitializer - */ -#define ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_HYSSEL_Msk) - -/** - * @brief This macro is used to select hysteresis level - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32HysSel The hysteresis function option. Including: - * - \ref ACMP_CTL_HYSTERESIS_30MV - * - \ref ACMP_CTL_HYSTERESIS_20MV - * - \ref ACMP_CTL_HYSTERESIS_10MV - * - \ref ACMP_CTL_HYSTERESIS_DISABLE - * \hideinitializer - * @return None - */ -#define ACMP_CONFIG_HYSTERESIS(acmp, u32ChNum, u32HysSel) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_HYSSEL_Msk) | (u32HysSel)) - -/** - * @brief This macro is used to enable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPIE bit of ACMP_CTL register to enable interrupt function. - * If wake-up function is enabled, the wake-up interrupt will be enabled as well. - * \hideinitializer - */ -#define ACMP_ENABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to disable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPIE bit of ACMP_CTL register to disable interrupt function. - * \hideinitializer - */ -#define ACMP_DISABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to enable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPEN bit of ACMP_CTL register to enable analog comparator. - * \hideinitializer - */ -#define ACMP_ENABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to disable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - * \hideinitializer - */ -#define ACMP_DISABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to get ACMP output value - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP output value - * @details This macro will return the ACMP output value. - * \hideinitializer - */ -#define ACMP_GET_OUTPUT(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPO0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to get ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP interrupt occurred (1) or not (0) - * @details This macro will return the ACMP interrupt flag. - * \hideinitializer - */ -#define ACMP_GET_INT_FLAG(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to clear ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to ACMPIFn bit of ACMP_STATUS register to clear interrupt flag. - * \hideinitializer - */ -#define ACMP_CLR_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to clear ACMP wake-up interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to WKIFn bit of ACMP_STATUS register to clear interrupt flag. - * \hideinitializer - */ -#define ACMP_CLR_WAKEUP_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_WKIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to enable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WKEN (ACMP_CTL[16]) to enable ACMP wake-up function. - * \hideinitializer - */ -#define ACMP_ENABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WKEN (ACMP_CTL[16]) to disable ACMP wake-up function. - * \hideinitializer - */ -#define ACMP_DISABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to select ACMP positive input pin - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Pin Comparator positive pin selection. Including: - * - \ref ACMP_CTL_POSSEL_P0 - * - \ref ACMP_CTL_POSSEL_P1 - * - \ref ACMP_CTL_POSSEL_P2 - * - \ref ACMP_CTL_POSSEL_P3 - * @return None - * @details This macro will set POSSEL (ACMP_CTL[7:6]) to determine the comparator positive input pin. - * \hideinitializer - */ -#define ACMP_SELECT_P(acmp, u32ChNum, u32Pin) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_POSSEL_Msk) | (u32Pin)) - -/** - * @brief This macro is used to enable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set OUTSEL (ACMP_CTL[12]) to enable output filter function. - * \hideinitializer - */ -#define ACMP_ENABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to disable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear OUTSEL (ACMP_CTL[12]) to disable output filter function. - * \hideinitializer - */ -#define ACMP_DISABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to set ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cnt is comparator filter count setting. - * - \ref ACMP_CTL_FILTSEL_OFF - * - \ref ACMP_CTL_FILTSEL_1PCLK - * - \ref ACMP_CTL_FILTSEL_2PCLK - * - \ref ACMP_CTL_FILTSEL_4PCLK - * - \ref ACMP_CTL_FILTSEL_8PCLK - * - \ref ACMP_CTL_FILTSEL_16PCLK - * - \ref ACMP_CTL_FILTSEL_32PCLK - * - \ref ACMP_CTL_FILTSEL_64PCLK - * @return None - * @details When ACMP output filter function is enabled, the output sampling count is determined by FILTSEL (ACMP_CTL[15:13]). - * \hideinitializer - */ -#define ACMP_SET_FILTER(acmp, u32ChNum, u32Cnt) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_FILTSEL_Msk) | (u32Cnt)) - -/** - * @brief This macro is used to select comparator reference voltage - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32Level The comparator reference voltage setting. - * The formula is: - * comparator reference voltage = CRV source voltage x (1/6 + u32Level/24) - * The range of u32Level is 0 ~ 15. - * @return None - * @details When CRV is selected as ACMP negative input source, the CRV level is determined by CRVCTL (ACMP_VREF[3:0]). - * \hideinitializer - */ -#define ACMP_CRV_SEL(acmp, u32Level) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRV0SEL_Msk) | ((u32Level)<VREF = ((acmp)->VREF & ~ACMP_VREF_CRV0SEL_Msk) | ((u32Level)<VREF = ((acmp)->VREF & ~ACMP_VREF_CRV1SEL_Msk) | ((u32Level)<VREF |= ACMP_VREF_CRV0EN_Msk) -#define ACMP_ENABLE_CRV1(acmp) ((acmp)->VREF |= ACMP_VREF_CRV1EN_Msk) - - -/** - * @brief This macro is used to disable comparator reference voltage - * @param[in] acmp The pointer of the specified ACMP module - * @return None - * @details Disable CRV. - * \hideinitializer - */ -#define ACMP_DISABLE_CRV0(acmp) ((acmp)->VREF &= ~ACMP_VREF_CRV0EN_Msk) -#define ACMP_DISABLE_CRV1(acmp) ((acmp)->VREF &= ~ACMP_VREF_CRV1EN_Msk) - -/** - * @brief This macro is used to select the source of CRV - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32Src is the source of CRV. Including: - * - \ref ACMP_VREF_CRV0SSEL_VDDA - * - \ref ACMP_VREF_CRV0SSEL_INTVREF - * - \ref ACMP_VREF_CRV1SSEL_VDDA - * - \ref ACMP_VREF_CRV1SSEL_INTVREF - * - \ref ACMP_VREF_CRV2SSEL_VDDA - * - \ref ACMP_VREF_CRV2SSEL_INTVREF - * - \ref ACMP_VREF_CRV3SSEL_VDDA - * - \ref ACMP_VREF_CRV3SSEL_INTVREF - * @return None - * @details The source of CRV can be VDDA or internal reference voltage. The internal reference voltage level is determined by SYS_VREFCTL register. - * \hideinitializer - */ -#define ACMP_SELECT_CRV_SRC(acmp, u32Src) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRV0SSEL_Msk) | (u32Src)) -#define ACMP_SELECT_CRV0_SRC(acmp, u32Src) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRV0SSEL_Msk) | (u32Src)) -#define ACMP_SELECT_CRV1_SRC(acmp, u32Src) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRV1SSEL_Msk) | (u32Src)) -#define ACMP_SELECT_CRV2_SRC(acmp, u32Src) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRV0SSEL_Msk) | (u32Src)) -#define ACMP_SELECT_CRV3_SRC(acmp, u32Src) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRV1SSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to select ACMP interrupt condition - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cond Comparator interrupt condition selection. Including: - * - \ref ACMP_CTL_INTPOL_RF - * - \ref ACMP_CTL_INTPOL_R - * - \ref ACMP_CTL_INTPOL_F - * @return None - * @details The ACMP output interrupt condition can be rising edge, falling edge or any edge. - * \hideinitializer - */ -#define ACMP_SELECT_INT_COND(acmp, u32ChNum, u32Cond) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_INTPOL_Msk) | (u32Cond)) - -/** - * @brief This macro is used to enable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WLATEN (ACMP_CTL[17]) to enable ACMP window latch mode. - * When ACMP0/1_WLAT pin is at high level, ACMPO0/1 passes through window latch - * block; when ACMP0/1_WLAT pin is at low level, the output of window latch block, - * WLATOUT, is frozen. - * \hideinitializer - */ -#define ACMP_ENABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to disable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WLATEN (ACMP_CTL[17]) to disable ACMP window latch mode. - * \hideinitializer - */ -#define ACMP_DISABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to enable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WCMPSEL (ACMP_CTL[18]) to enable ACMP window compare mode. - * When window compare mode is enabled, user can connect the specific analog voltage - * source to either the positive inputs of both comparators or the negative inputs of - * both comparators. The upper bound and lower bound of the designated range are - * determined by the voltages applied to the other inputs of both comparators. If the - * output of a comparator is low and the other comparator outputs high, which means two - * comparators implies the upper and lower bound. User can directly monitor a specific - * analog voltage source via ACMPWO (ACMP_STATUS[16]). - * \hideinitializer - */ -#define ACMP_ENABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WCMPSEL_Msk) - -/** - * @brief This macro is used to disable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WCMPSEL (ACMP_CTL[18]) to disable ACMP window compare mode. - * \hideinitializer - */ -#define ACMP_DISABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WCMPSEL_Msk) - - - - -/* Function prototype declaration */ -void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel); -void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum); - - - -/*@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ACMP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - - -#endif /* __NU_ACMP_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bmc.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bmc.h deleted file mode 100644 index 65f6fb9f5e1..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bmc.h +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************//** - * @file nu_bmc.h - * @version V1.00 - * @brief M460 series BMC driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_BMC_H__ -#define __NU_BMC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BMC_Driver BMC Driver - @{ -*/ - -/** @addtogroup BMC_EXPORTED_CONSTANTS BMC Exported Constants - @{ -*/ -#define BMC_BITWIDTH_1 (0UL) /*!< The bit time period of logic 0 is same as logic 1 \hideinitializer */ -#define BMC_BITWIDTH_15 (BMC_CTL_BWADJ_Msk) /*!< The bit time period of logic 0 is 1.5 times logic 1 \hideinitializer */ - -#define BMC_PREAMBLE_64 (0UL) /*!< BMC preamble is 64 bits \hideinitializer */ -#define BMC_PREAMBLE_32 (BMC_CTL_PREAM32_Msk) /*!< BMC preamble is 32 bits \hideinitializer */ - -#define BMC_DUM_LVL_LOW (0UL) /*!< BMC dummy level is low \hideinitializer */ -#define BMC_DUM_LVL_HIGH (BMC_CTL_DUMLVL_Msk) /*!< BMC dummy level is high \hideinitializer */ - -#define BMC_GROUP_0 (0UL) /*!< BMC group 0 mask \hideinitializer */ -#define BMC_GROUP_1 (4UL) /*!< BMC group 1 mask \hideinitializer */ -#define BMC_GROUP_2 (8UL) /*!< BMC group 2 mask \hideinitializer */ -#define BMC_GROUP_3 (12UL) /*!< BMC group 3 mask \hideinitializer */ -#define BMC_GROUP_4 (16UL) /*!< BMC group 4 mask \hideinitializer */ -#define BMC_GROUP_5 (20UL) /*!< BMC group 5 mask \hideinitializer */ -#define BMC_GROUP_6 (24UL) /*!< BMC group 6 mask \hideinitializer */ -#define BMC_GROUP_7 (28UL) /*!< BMC group 7 mask \hideinitializer */ - -#define BMC_CHANNEL_NUM (32UL) /*!< BMC total channel number \hideinitializer */ - -#define BMC_FTXD_INT_MASK (0x1UL) /*!< Frame transmit done interrupt mask \hideinitializer */ -#define BMC_TXUND_INT_MASK (0x2UL) /*!< Transmit data under run interrupt mask \hideinitializer */ - -#define BMC_G0TXUND_MASK (0x01UL) /*!< BMC group 0 transmit data under run mask \hideinitializer */ -#define BMC_G1TXUND_MASK (0x02UL) /*!< BMC group 1 transmit data under run mask \hideinitializer */ -#define BMC_G2TXUND_MASK (0x04UL) /*!< BMC group 2 transmit data under run mask \hideinitializer */ -#define BMC_G3TXUND_MASK (0x08UL) /*!< BMC group 3 transmit data under run mask \hideinitializer */ -#define BMC_G4TXUND_MASK (0x10UL) /*!< BMC group 4 transmit data under run mask \hideinitializer */ -#define BMC_G5TXUND_MASK (0x20UL) /*!< BMC group 5 transmit data under run mask \hideinitializer */ -#define BMC_G6TXUND_MASK (0x40UL) /*!< BMC group 6 transmit data under run mask \hideinitializer */ -#define BMC_G7TXUND_MASK (0x80UL) /*!< BMC group 7 transmit data under run mask \hideinitializer */ - - -/*@}*/ /* end of group BMC_EXPORTED_CONSTANTS */ - - -/** @addtogroup BMC_EXPORTED_FUNCTIONS BMC Exported Functions - @{ -*/ - -/** - * @brief Enable BMC controller - * @return None - * @details This macro is used to enable Biphase Mask Coding function. - * \hideinitializer - */ -#define BMC_ENABLE() (BMC->CTL |= BMC_CTL_BMCEN_Msk) - -/** - * @brief Disable BMC controller - * @return None - * @details This macro is used to disable Biphase Mask Coding function. - * \hideinitializer - */ -#define BMC_DISABLE() (BMC->CTL &= ~BMC_CTL_BMCEN_Msk) - -/** - * @brief Set the bit width adjustment - * @param[in] u32BitAdj BMC bit time period adjustment selection, valid values are: - * - \ref BMC_BITWIDTH_1 - * - \ref BMC_BITWIDTH_15 - * @return None - * @details This macro is used to set bit width adjustment. - * \hideinitializer - */ -#define BMC_BITWIDTH_ADJUST(u32BitAdj) (BMC->CTL = (BMC->CTL & ~BMC_CTL_BWADJ_Msk) | (u32BitAdj)) - -/** - * @brief Set the bit number of preamble - * @param[in] u32PreamBit BMC preamble bit number selection, valid values are: - * - \ref BMC_PREAMBLE_64 - * - \ref BMC_PREAMBLE_32 - * @return None - * @details This macro is used to set the bit number of preamble. - * \hideinitializer - */ -#define BMC_PREAMBLE_BIT(u32PreamBit) (BMC->CTL = (BMC->CTL & ~BMC_CTL_PREAM32_Msk) | (u32PreamBit)) - -/** - * @brief Set the dummy bit level - * @param[in] u32DumLvl BMC dummy bit level selection, valid values are: - * - \ref BMC_DUM_LVL_LOW - * - \ref BMC_DUM_LVL_HIGH - * @return None - * @details This macro is used to set dummy bit level. - * \hideinitializer - */ -#define BMC_DUMMY_LEVEL(u32DumLvl) (BMC->CTL = (BMC->CTL & ~BMC_CTL_DUMLVL_Msk) | (u32DumLvl)) - -/** - * @brief Enable PDMA function - * @return None - * @details This macro is used to enable PDMA function. - * \hideinitializer - */ -#define BMC_ENABLE_DMA() (BMC->CTL |= BMC_CTL_DMAEN_Msk) - -/** - * @brief Disable PDMA function - * @return None - * @details This macro is used to disable PDMA function. - * \hideinitializer - */ -#define BMC_DISABLE_DMA() (BMC->CTL &= ~BMC_CTL_DMAEN_Msk) - -/** - * @brief Enable BMC group 0 channels - * @return None - * @details This macro is used to enable BMC channel 0~3. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP0() (BMC->CTL |= BMC_CTL_G0CHEN_Msk) - -/** - * @brief Enable BMC group 1 channels - * @return None - * @details This macro is used to enable BMC channel 4~7. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP1() (BMC->CTL |= BMC_CTL_G1CHEN_Msk) - -/** - * @brief Enable BMC group 2 channels - * @return None - * @details This macro is used to enable BMC channel 8~11. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP2() (BMC->CTL |= BMC_CTL_G2CHEN_Msk) - -/** - * @brief Enable BMC group 3 channels - * @return None - * @details This macro is used to enable BMC channel 12~15. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP3() (BMC->CTL |= BMC_CTL_G3CHEN_Msk) - -/** - * @brief Enable BMC group 4 channels - * @return None - * @details This macro is used to enable BMC channel 16~19. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP4() (BMC->CTL |= BMC_CTL_G4CHEN_Msk) - -/** - * @brief Enable BMC group 5 channels - * @return None - * @details This macro is used to enable BMC channel 20~23. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP5() (BMC->CTL |= BMC_CTL_G5CHEN_Msk) - -/** - * @brief Enable BMC group 6 channels - * @return None - * @details This macro is used to enable BMC channel 24~27. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP6() (BMC->CTL |= BMC_CTL_G6CHEN_Msk) - -/** - * @brief Enable BMC group 7 channels - * @return None - * @details This macro is used to enable BMC channel 28~31. - * \hideinitializer - */ -#define BMC_ENABLE_GROUP7() (BMC->CTL |= BMC_CTL_G7CHEN_Msk) - -/** - * @brief Get channel's FIFO empty flag - * @return Which channel's FIFO is empty - * @details This macro will return which channel's FIFO is empty. - * \hideinitializer - */ -#define BMC_GET_CH_EMPTY_FLAG() (BMC->CHEMPTY) - - -uint32_t BMC_SetBitClock(uint32_t u32BitClock); -uint32_t BMC_GetBitClock(void); -uint32_t BMC_SetDummyDelayPeriod(uint32_t u32ChGroup, uint32_t u32DumDelay); -void BMC_EnableInt(uint32_t u32Mask); -void BMC_DisableInt(uint32_t u32Mask); -uint32_t BMC_GetIntFlag(uint32_t u32Mask); -void BMC_ClearIntFlag(uint32_t u32Mask); -uint32_t BMC_GetStatus(uint32_t u32Mask); -void BMC_ClearStatus(uint32_t u32Mask); - - -/*@}*/ /* end of group BMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_BMC_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bpwm.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bpwm.h deleted file mode 100644 index 5b474c1da29..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_bpwm.h +++ /dev/null @@ -1,360 +0,0 @@ -/**************************************************************************//** - * @file nu_bpwm.h - * @version V1.00 - * @brief BPWM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_BPWM_H__ -#define __NU_BPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - -/** @addtogroup BPWM_EXPORTED_CONSTANTS BPWM Exported Constants - @{ -*/ -#define BPWM_CHANNEL_NUM (6UL) /*!< BPWM channel number */ -#define BPWM_CH_0_MASK (0x1UL) /*!< BPWM channel 0 mask \hideinitializer */ -#define BPWM_CH_1_MASK (0x2UL) /*!< BPWM channel 1 mask \hideinitializer */ -#define BPWM_CH_2_MASK (0x4UL) /*!< BPWM channel 2 mask \hideinitializer */ -#define BPWM_CH_3_MASK (0x8UL) /*!< BPWM channel 3 mask \hideinitializer */ -#define BPWM_CH_4_MASK (0x10UL) /*!< BPWM channel 4 mask \hideinitializer */ -#define BPWM_CH_5_MASK (0x20UL) /*!< BPWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_UP_COUNTER (0UL) /*!< Up counter type \hideinitializer */ -#define BPWM_DOWN_COUNTER (1UL) /*!< Down counter type \hideinitializer */ -#define BPWM_UP_DOWN_COUNTER (2UL) /*!< Up-Down counter type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_EDGE_ALIGNED (1UL) /*!< BPWM working in edge aligned type(down count) \hideinitializer */ -#define BPWM_CENTER_ALIGNED (2UL) /*!< BPWM working in center aligned type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_OUTPUT_NOTHING (0UL) /*!< BPWM output nothing \hideinitializer */ -#define BPWM_OUTPUT_LOW (1UL) /*!< BPWM output low \hideinitializer */ -#define BPWM_OUTPUT_HIGH (2UL) /*!< BPWM output high \hideinitializer */ -#define BPWM_OUTPUT_TOGGLE (3UL) /*!< BPWM output toggle \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_SSCTL_SSRC_PWM0 (0UL<SSCTL = ((bpwm)->SSCTL & ~BPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_DISABLE_TIMER_SYNC(bpwm, u32ChannelMask) ((bpwm)->SSCTL &= ~BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief This macro enable BPWM counter synchronous start counting function. - * @param[in] bpwm The pointer of the specified BPWM module - * @return None - * @details This macro is used to make selected BPWM0 and BPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by BPWM_ENABLE_TIMER_SYNC() and BPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define BPWM_TRIGGER_SYNC_START(bpwm) ((bpwm)->SSTRG = BPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * \hideinitializer - */ -#define BPWM_ENABLE_OUTPUT_INVERTER(bpwm, u32ChannelMask) ((bpwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_RISING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_FALLING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define BPWM_MASK_OUTPUT(bpwm, u32ChannelMask, u32LevelMask) \ - { \ - (bpwm)->MSKEN = (u32ChannelMask); \ - (bpwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 1 ~ 0xFFF - * @return None - * \hideinitializer - */ -#define BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescaler) ((bpwm)->CLKPSC = (u32Prescaler)) - -/** - * @brief This macro set the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Duty of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * \hideinitializer - */ -#define BPWM_SET_CMR(bpwm, u32ChannelNum, u32CMR) ((bpwm)->CMPDAT[(u32ChannelNum)] = (u32CMR)) - -/** - * @brief This macro get the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CMR(bpwm, u32ChannelNum) ((bpwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * @note BPWM counter will stop if period length set to 0 - * \hideinitializer - */ -#define BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR) ((bpwm)->PERIOD = (u32CNR)) - -/** - * @brief This macro get the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * \hideinitializer - */ -#define BPWM_GET_CNR(bpwm, u32ChannelNum) ((bpwm)->PERIOD) - -/** - * @brief This macro set the BPWM aligned type - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @param[in] u32AlignedType BPWM aligned type, valid values are: - * - \ref BPWM_EDGE_ALIGNED - * - \ref BPWM_CENTER_ALIGNED - * @return None - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_SET_ALIGNED_TYPE(bpwm, u32ChannelMask, u32AlignedType) ((bpwm)->CTL1 = (u32AlignedType)) - -/** - * @brief Clear counter of channel 0 - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to clear counter of channel 0 - * \hideinitializer - */ -#define BPWM_CLR_COUNTER(bpwm, u32ChannelMask) ((bpwm)->CNTCLR = (BPWM_CNTCLR_CNTCLR0_Msk)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * \hideinitializer - */ -#define BPWM_SET_OUTPUT_LEVEL(bpwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - uint32_t i; \ - for(i = 0UL; i < 6UL; i++) { \ - if((u32ChannelMask) & (1UL << i)) { \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (i << 1))) | ((u32ZeroLevel) << (i << 1))); \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (BPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))) | ((u32PeriodLevel) << (BPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (i << 1))) | ((u32CmpUpLevel) << (i << 1))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (BPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))) | ((u32CmpDownLevel) << (BPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))); \ - } \ - } \ - }while(0) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define BPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); - - -/*@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_BPWM_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_canfd.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_canfd.h deleted file mode 100644 index b82dca2f0bf..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_canfd.h +++ /dev/null @@ -1,477 +0,0 @@ -/**************************************************************************** - * @file nu_canfd.h - * @version V1.00 - * @brief CAN FD driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __NU_CANFD_H__ -#define __NU_CANFD_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CANFD_Driver CAN_FD Driver - @{ -*/ - -/** @addtogroup CANFD_EXPORTED_CONSTANTS CAN_FD Exported Constants - @{ -*/ - -#define CANFD_OP_CAN_MODE 0 -#define CANFD_OP_CAN_FD_MODE 1 - -/* Reserved number of elements in Message RAM - used for calculation of start addresses within RAM Configuration - some element_numbers set to less than max, to stay altogether below 256 words of Message RAM requirement*/ -#define CANFD_MAX_11_BIT_FTR_ELEMS 128ul /*!< maximum is 128 11-bit Filter */ -#define CANFD_MAX_29_BIT_FTR_ELEMS 64ul /*!< maximum is 64 29-bit Filter */ -#define CANFD_MAX_RX_FIFO0_ELEMS 64ul /*!< maximum is 64 Rx FIFO 0 elements */ -#define CANFD_MAX_RX_FIFO1_ELEMS 64ul /*!< maximum is 64 Rx FIFO 1 elements */ -#define CANFD_MAX_RX_BUF_ELEMS 64ul /*!< maximum is 64 Rx Buffers */ -#define CANFD_MAX_TX_BUF_ELEMS 32ul /*!< maximum is 32 Tx Buffers */ -#define CANFD_MAX_TX_EVNT_FIFO_ELEMS 32ul /*!< maximum is 32 Tx Event FIFO elements */ - -/* CAN FD sram size */ -#define CANFD_SRAM_SIZE 0x1800ul -#define CANFD_SRAM_OFFSET 0x200ul - -/* CAN FD sram address */ -#define CANFD_SRAM_BASE_ADDR(psCanfd) ((uint32_t)psCanfd + CANFD_SRAM_OFFSET) - -/* CAN FD Mask all interrupt */ -#define CANFD_INT_ALL_SIGNALS 0x3FFFFFFFul - -/* Maximum size of a CAN FD frame. Must be a valid CAN FD value */ -#define CANFD_MAX_MESSAGE_BYTES 64 - -/* Maximum size of a CAN FD frame. Must be a valid CAN FD value */ -#define CANFD_MAX_MESSAGE_WORDS (CANFD_MAX_MESSAGE_BYTES/4) - -/* Receive message buffer helper macro */ -#define CANFD_RX_BUFFER_STD(id, mbIdx) ((7UL << 27) | ((id & 0x7FF) << 16) | (mbIdx & 0x3F)) - -/* Receive message buffer extended helper macro - low */ -#define CANFD_RX_BUFFER_EXT_LOW(id, mbIdx) ((7UL << 29) | (id & 0x1FFFFFFFUL)) - -/* Receive message buffer extended helper macro - high */ -#define CANFD_RX_BUFFER_EXT_HIGH(id, mbIdx) (mbIdx & 0x3FUL) - -/* CAN FD Rx FIFO 0 Mask helper macro. */ -#define CANFD_RX_FIFO0_STD_MASK(match, mask) ((2UL << 30) | (1UL << 27) | ((match & 0x7FF) << 16) | (mask & 0x7FF)) - -/* CAN FD Rx FIFO 0 extended Mask helper macro - low. */ -#define CANFD_RX_FIFO0_EXT_MASK_LOW(match) ((1UL << 29) | (match & 0x1FFFFFFF)) - -/* CAN FD Rx FIFO 0 extended Mask helper macro - high. */ -#define CANFD_RX_FIFO0_EXT_MASK_HIGH(mask) ((2UL << 30) | (mask & 0x1FFFFFFF)) - -/* CAN FD Rx FIFO 1 Mask helper macro. */ -#define CANFD_RX_FIFO1_STD_MASK(match, mask) ((2UL << 30) | (2UL << 27) | ((match & 0x7FF) << 16) | (mask & 0x7FF)) - -/* CANFD Rx FIFO 1 extended Mask helper macro - low. */ -#define CANFD_RX_FIFO1_EXT_MASK_LOW(match) ((2UL << 29) | (match & 0x1FFFFFFF)) - -/* CANFD Rx FIFO 1 extended Mask helper macro - high. */ -#define CANFD_RX_FIFO1_EXT_MASK_HIGH(mask) ((2UL << 30) | (mask & 0x1FFFFFFF)) - -/** - * @brief Get the CAN Communication State Flag - * - * @param[in] canfd The pointer of the specified CANFD module - * - * @retval 0 Synchronizing - node is synchronizing on CANFD communication. - * @retval 1 Idle - node is neither receiver nor transmitter. - * @retval 2 Receiver - node is operating as receiver. - * @retval 3 Transmitter - node is operating as transmitter. - * - * @details This macro gets the CANFD communication state. - * \hideinitializer - */ -#define CANFD_GET_COMMUNICATION_STATE(canfd) (((canfd)->PSR & CANFD_PSR_ACT_Msk) >> CANFD_PSR_ACT_Pos) - - -/* CAN FD frame data field size. */ -typedef enum -{ - eCANFD_BYTE8 = 0, /*!< 8 byte data field. */ - eCANFD_BYTE12 = 1, /*!< 12 byte data field. */ - eCANFD_BYTE16 = 2, /*!< 16 byte data field. */ - eCANFD_BYTE20 = 3, /*!< 20 byte data field. */ - eCANFD_BYTE24 = 4, /*!< 24 byte data field. */ - eCANFD_BYTE32 = 5, /*!< 32 byte data field. */ - eCANFD_BYTE48 = 6, /*!< 48 byte data field. */ - eCANFD_BYTE64 = 7 /*!< 64 byte data field. */ -} E_CANFD_DATA_FIELD_SIZE; - -/* CAN FD Tx FIFO/Queue Mode. */ -typedef enum -{ - eCANFD_QUEUE_MODE = 0, /*!< Tx FIFO operation. */ - eCANFD_FIFO_MODE = 1 /*!< Tx Queue operation. */ -} E_CANFD_MODE; - -/* CAN FD Test & Bus monitor Mode. */ -typedef enum -{ - eCANFD_NORMAL = 0, /*!< None, Normal mode. */ - - /* - Support: - (1) to receive data frames - (2) to receive remote frames - (3) to give acknowledge to valid frames - Not support: - (1) data frames sending - (2) remote frames sending - (3) active error frames or overload frames sending - */ - eCANFD_RESTRICTED_OPERATION, /*!< Receive external RX frame and always keep recessive state or send dominate bit on ACK bit on TX pin. */ - - /* - Support: - (1) to receive valid data frames - (2) to receive valid remote frames - Not support: - (1) transmission start - (2) acknowledge to valid frames - */ - eCANFD_BUS_MONITOR, /*!< Receive external RX frame and always keep recessive state on TX pin. */ - - /* - Support: - (1) Loopback - (2) Also send out frames - Not support: - (1) to receive external frame - */ - eCANFD_LOOPBACK_EXTERNAL, /*!< Won't receive external RX frame. */ - /* - Support: - (1) Loopback - Not support: - (1) to receive external frame - (2) transmission start - */ - eCANFD_LOOPBACK_INTERNAL /*!< Won't receive external RX frame and always keep recessive state on TX pin */ -} E_CANFD_TEST_MODE; - -/* TX Buffer Configuration Parameters */ -typedef struct -{ - E_CANFD_DATA_FIELD_SIZE eDataFieldSize; /*!< TX Buffer Data Field Size (8byte .. 64byte) */ - E_CANFD_MODE eModeSel; /*!< select: CANFD_QUEUE_MODE/CANFD_FIFO_MODE */ - uint32_t u32ElemCnt; /*!< Elements in FIFO/Queue */ - uint32_t u32DBufNumber; /*!< Number of dedicated TX buffers */ -} CANFD_TX_BUF_CONFIG_T; - - -/* Nominal Bit Timing Parameters */ -typedef struct -{ - uint32_t u32BitRate; /*!< Transceiver baud rate in bps */ - uint16_t u16TDCOffset; /*!< Transceiver Delay Compensation Offset */ - uint16_t u16TDCFltrWin; /*!< Transceiver Delay Compensation Filter Window Length */ - uint8_t u8TDC; /*!< Transceiver Delay Compensation (1:Yes, 0:No) */ -} CANFD_NBT_CONFIG_T; - - -/* Data Bit Timing Parameters */ -typedef struct -{ - uint32_t u32BitRate; /*!< Transceiver baud rate in bps */ - uint16_t u16TDCOffset; /*!< Transceiver Delay Compensation Offset */ - uint16_t u16TDCFltrWin; /*!< Transceiver Delay Compensation Filter Window Length */ - uint8_t u8TDC; /*!< Transceiver Delay Compensation (1:Yes, 0:No) */ -} CANFD_DBT_CONFIG_T; - -/*! CAN FD protocol timing characteristic configuration structure. */ -typedef struct -{ - uint8_t u8PreDivider; /*!< Global Clock Division Factor. */ - uint16_t u16NominalPrescaler; /*!< Nominal clock prescaler. */ - uint8_t u8NominalRJumpwidth; /*!< Nominal Re-sync Jump Width. */ - uint8_t u8NominalPhaseSeg1; /*!< Nominal Phase Segment 1. */ - uint8_t u8NominalPhaseSeg2; /*!< Nominal Phase Segment 2. */ - uint8_t u8NominalPropSeg; /*!< Nominal Propagation Segment. */ - uint8_t u8DataPrescaler; /*!< Data clock prescaler. */ - uint8_t u8DataRJumpwidth; /*!< Data Re-sync Jump Width. */ - uint8_t u8DataPhaseSeg1; /*!< Data Phase Segment 1. */ - uint8_t u8DataPhaseSeg2; /*!< Data Phase Segment 2. */ - uint8_t u8DataPropSeg; /*!< Data Propagation Segment. */ - -} CANFD_TIMEING_CONFIG_T; - -/* CAN FD module configuration structure. */ -typedef struct -{ - CANFD_NBT_CONFIG_T sNormBitRate; /*!< Normal bit rate. */ - CANFD_DBT_CONFIG_T sDataBitRate; /*!< Data bit rate. */ - CANFD_TIMEING_CONFIG_T sConfigBitTing; /*!< Bit timing config*/ - uint8_t bFDEn; /*!< 1 == FD Operation enabled. */ - uint8_t bBitRateSwitch; /*!< 1 == Bit Rate Switch enabled (only evaluated in HW, if FD operation enabled). */ - E_CANFD_TEST_MODE evTestMode; /*!< See E_CANFD_TEST_MODE declaration. */ -} CANFD_FD_BT_CONFIG_T; - -/* CAN FD Message RAM Partitioning - i.e. Start Addresses (BYTE) */ -typedef struct -{ - uint32_t u32SIDFC_FLSSA; /*! EFID1), XIDAM not applied */ -} E_CANFD_XID_FLTR_ELEM_TYPE; - -/* Filter Element Configuration - Can be used for SFEC(Standard Id filter configuration) and EFEC(Extended Id filter configuration) */ -typedef enum -{ - eCANFD_FLTR_ELEM_DIS = 0x0, /*!< Filter Element Disable */ - eCANFD_FLTR_ELEM_STO_FIFO0 = 0x1, /*!< Filter Element Store In Fifo0 */ - eCANFD_FLTR_ELEM_STO_FIFO1 = 0x2, /*!< Filter Element Store In Fifo1 */ - eCANFD_FLTR_ELEM_REJ_ID = 0x3, /*!< Filter Element RejectId */ - eCANFD_FLTR_ELEM_SET_PRI = 0x4, /*!< Filter Element Set Priority */ - eCANFD_FLTR_ELEM_SET_PRI_STO_FIFO0 = 0x5, /*!< Filter Element Set Priority And Store In Fifo0 */ - eCANFD_FLTR_ELEM_SET_PRI_STO_FIFO1 = 0x6, /*!< Filter Element Set Priority And Store In Fifo1 */ - eCANFD_FLTR_ELEM_STO_RX_BUF_OR_DBG_MSG = 0x7 /*!< Filter Element Store In Rx Buf Or Debug Msg */ -} E_CANFD_FLTR_CONFIG; - -/* TX Event FIFO Element Struct */ -typedef struct -{ - E_CANFD_ID_TYPE eIdType; /*!< Standard ID or Extended ID */ - uint32_t u32Id; /*!< Standard ID (11bits) or Extended ID (29bits) */ - uint32_t u32DLC; /*!< Data Length Code used in the frame on the bus */ - uint32_t u32TxTs; /*!< Tx Timestamp */ - uint32_t u32MsgMarker; /*!< Message marker */ - uint8_t bErrStaInd; /*!< Error State Indicator */ - uint8_t bRemote; /*!< Remote transmission request */ - uint8_t bFDFormat; /*!< FD Format */ - uint8_t bBitRateSwitch; /*!< Bit Rate Switch */ -} CANFD_TX_EVNT_ELEM_T; - - -#define CANFD_TIMEOUT SystemCoreClock /*!< CANFD time-out counter (1 second time-out) */ -#define CANFD_OK ( 0L) /*!< CANFD operation OK */ -#define CANFD_ERR_FAIL (-1L) /*!< CANFD operation failed */ -#define CANFD_ERR_TIMEOUT (-2L) /*!< CANFD operation abort due to timeout error */ -#define CANFD_READ_REG_TIMEOUT (48UL) /*!< CANFD read register time-out count */ - -void CANFD_Open(CANFD_T *canfd, CANFD_FD_T *psCanfdStr); -void CANFD_Close(CANFD_T *canfd); -void CANFD_EnableInt(CANFD_T *canfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE); -void CANFD_DisableInt(CANFD_T *canfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE); -uint32_t CANFD_TransmitTxMsg(CANFD_T *canfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg); -uint32_t CANFD_TransmitDMsg(CANFD_T *canfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg); -void CANFD_SetGFC(CANFD_T *canfd, E_CANFD_ACC_NON_MATCH_FRM eNMStdFrm, E_CANFD_ACC_NON_MATCH_FRM eEMExtFrm, uint32_t u32RejRmtStdFrm, uint32_t u32RejRmtExtFrm); -void CANFD_SetSIDFltr(CANFD_T *canfd, uint32_t u32FltrIdx, uint32_t u32Filter); -void CANFD_SetXIDFltr(CANFD_T *canfd, uint32_t u32FltrIdx, uint32_t u32FilterLow, uint32_t u32FilterHigh); -uint32_t CANFD_ReadRxBufMsg(CANFD_T *canfd, uint8_t u8MbIdx, CANFD_FD_MSG_T *psMsgBuf); -uint32_t CANFD_ReadRxFifoMsg(CANFD_T *canfd, uint8_t u8FifoIdx, CANFD_FD_MSG_T *psMsgBuf); -void CANFD_CopyDBufToMsgBuf(CANFD_BUF_T *psRxBuffer, CANFD_FD_MSG_T *psMsgBuf); -void CANFD_CopyRxFifoToMsgBuf(CANFD_BUF_T *psRxBuf, CANFD_FD_MSG_T *psMsgBuf); -uint32_t CANFD_GetRxFifoWaterLvl(CANFD_T *canfd, uint32_t u32RxFifoNum); -void CANFD_TxBufCancelReq(CANFD_T *canfd, uint32_t u32TxBufIdx); -uint32_t CANFD_IsTxBufCancelFin(CANFD_T *canfd, uint32_t u32TxBufIdx); -uint32_t CANFD_IsTxBufTransmitOccur(CANFD_T *canfd, uint32_t u32TxBufIdx); -uint32_t CANFD_GetTxEvntFifoWaterLvl(CANFD_T *canfd); -void CANFD_CopyTxEvntFifoToUsrBuf(CANFD_T *canfd, uint32_t u32TxEvntNum, CANFD_TX_EVNT_ELEM_T *psTxEvntElem); -void CANFD_GetBusErrCount(CANFD_T *canfd, uint8_t *pu8TxErrBuf, uint8_t *pu8RxErrBuf); -int32_t CANFD_RunToNormal(CANFD_T *canfd, uint8_t u8Enable); -void CANFD_GetDefaultConfig(CANFD_FD_T *psConfig, uint8_t u8OpMode); -void CANFD_ClearStatusFlag(CANFD_T *canfd, uint32_t u32InterruptFlag); -uint32_t CANFD_GetStatusFlag(CANFD_T *canfd, uint32_t u32IntTypeFlag); -uint32_t CANFD_ReadReg(__I uint32_t *pu32RegAddr); - -/*@}*/ /* end of group CANFD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CANFD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __NU_CANFD_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ccap.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ccap.h deleted file mode 100644 index 5b885b77d77..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ccap.h +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************//** - * @file nu_ccap.h - * @version V3.00 - * @brief M460 Series CCAP Driver Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CCAP_H__ -#define __NU_CCAP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CCAP_Driver CCAP Driver - @{ -*/ - -/** @addtogroup CCAP_EXPORTED_CONSTANTS CCAP Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CCAP_CTL_CCAPEN (1ul<CTL & CCAP_CTL_CCAPEN_Msk)?0:1) - -/** - * @brief Clear CCAP flag - * - * @param[in] u32IntMask interrupt flags settings. It could be - * - \ref CCAP_INT_VINTF_Msk - * - \ref CCAP_INT_MEINTF_Msk - * - \ref CCAP_INT_ADDRMINTF_Msk - * - \ref CCAP_INT_MDINTF_Msk - * - * @return None - * - * @details Clear Camera Capture Interface interrupt flag - * \hideinitializer - */ -#define CCAP_CLR_INT_FLAG(ccap, u32IntMask) (ccap->INT |= (u32IntMask)) - -/** - * @brief Get CCAP Interrupt status - * - * @param None - * - * @return CCAP Interrupt Register - * - * @details Get Camera Capture Interface interrupt status. - * \hideinitializer - */ -#define CCAP_GET_INT_STS(ccap) (ccap->INT) - -#define CCAP_SET_CTL(ccap, u32IntMask) (ccap->CTL |= u32IntMask) -#define CCAP_CLR_CTL(ccap, u32IntMask) (ccap->CTL &= ~u32IntMask) - -void CCAP_Open(CCAP_T *ccap, uint32_t u32InFormat, uint32_t u32OutFormat); -void CCAP_SetCroppingWindow(CCAP_T *ccap, uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width); -void CCAP_SetPacketBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_Close(CCAP_T *ccap); -void CCAP_EnableInt(CCAP_T *ccap, uint32_t u32IntMask); -void CCAP_DisableInt(CCAP_T *ccap, uint32_t u32IntMask); -void CCAP_Start(CCAP_T *ccap); -void CCAP_Stop(CCAP_T *ccap, uint32_t u32FrameComplete); -void CCAP_SetPacketScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator); -void CCAP_SetPacketStride(CCAP_T *ccap, uint32_t u32Stride); -void CCAP_EnableMono(CCAP_T *ccap, uint32_t u32Interface); -void CCAP_DisableMono(CCAP_T *ccap); -void CCAP_EnableLumaYOne(CCAP_T *ccap, uint32_t u32th); -void CCAP_DisableLumaYOne(CCAP_T *ccap); - -void CCAP_SetPlanarYBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_SetPlanarUBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_SetPlanarVBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_SetPlanarScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator); -void CCAP_SetPlanarStride(CCAP_T *ccap, uint32_t u32Stride); - - -/*@}*/ /* end of group CCAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CCAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_CCAP_H__ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_clk.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_clk.h deleted file mode 100644 index 91dbd1f0bf8..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_clk.h +++ /dev/null @@ -1,1281 +0,0 @@ -/**************************************************************************//** - * @file CLK.h - * @version V3.00 - * @brief M460 Series CLK Driver Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CLK_H__ -#define __NU_CLK_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_CONSTANTS CLK Exported Constants - @{ -*/ - - -#define FREQ_1MHZ 1000000UL /*!< 1 MHz \hideinitializer */ -#define FREQ_4MHZ 4000000UL /*!< 4 MHz \hideinitializer */ -#define FREQ_8MHZ 8000000UL /*!< 8 MHz \hideinitializer */ -#define FREQ_25MHZ 25000000UL /*!< 25 MHz \hideinitializer */ -#define FREQ_50MHZ 50000000UL /*!< 50 MHz \hideinitializer */ -#define FREQ_75MHZ 75000000UL /*!< 75 MHz \hideinitializer */ -#define FREQ_100MHZ 100000000UL /*!< 100 MHz \hideinitializer */ -#define FREQ_125MHZ 125000000UL /*!< 125 MHz \hideinitializer */ -#define FREQ_150MHZ 150000000UL /*!< 50 MHz \hideinitializer */ -#define FREQ_175MHZ 175000000UL /*!< 175 MHz \hideinitializer */ -#define FREQ_180MHZ 180000000UL /*!< 180 MHz \hideinitializer */ -#define FREQ_192MHZ 192000000UL /*!< 192 MHz \hideinitializer */ -#define FREQ_200MHZ 200000000UL /*!< 200 MHz \hideinitializer */ -#define FREQ_500MHZ 500000000UL /*!< 500 MHz \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL0 constant definitions. (Write-protection) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL0_HCLKSEL_HXT (0x0UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_LXT (0x1UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_PLL (0x2UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from PLL \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_LIRC (0x3UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_HIRC (0x7UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL0_STCLKSEL_HXT (0x0UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_LXT (0x1UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HXT_DIV2 (0x2UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from HXT/2 \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 (0x3UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from HCLK/2 \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 (0x7UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from HIRC/2 \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HCLK (0x1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< Select SysTick clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_USBSEL_HIRC48M (0x0UL << CLK_CLKSEL0_USBSEL_Pos) /*!< Select USB clock source from HIRC48M \hideinitializer */ -#define CLK_CLKSEL0_USBSEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_USBSEL_Pos) /*!< Select USB clock source from PLL/2 \hideinitializer */ - -#define CLK_CLKSEL0_EADC0SEL_PLLFN_DIV2 (0x0UL << CLK_CLKSEL0_EADC0SEL_Pos) /*!< Select EADC0 clock source from PLLFN/2 \hideinitializer */ -#define CLK_CLKSEL0_EADC0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_EADC0SEL_Pos) /*!< Select EADC0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_EADC0SEL_HCLK (0x2UL << CLK_CLKSEL0_EADC0SEL_Pos) /*!< Select EADC0 clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_EADC1SEL_PLLFN_DIV2 (0x0UL << CLK_CLKSEL0_EADC1SEL_Pos) /*!< Select EADC1 clock source from PLLFN/2 \hideinitializer */ -#define CLK_CLKSEL0_EADC1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_EADC1SEL_Pos) /*!< Select EADC1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_EADC1SEL_HCLK (0x2UL << CLK_CLKSEL0_EADC1SEL_Pos) /*!< Select EADC1 clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_EADC2SEL_PLLFN_DIV2 (0x0UL << CLK_CLKSEL0_EADC2SEL_Pos) /*!< Select EADC2 clock source from PLLFN/2 \hideinitializer */ -#define CLK_CLKSEL0_EADC2SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_EADC2SEL_Pos) /*!< Select EADC2 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_EADC2SEL_HCLK (0x2UL << CLK_CLKSEL0_EADC2SEL_Pos) /*!< Select EADC2 clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_CCAPSEL_HXT (0x0UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP sensor clock source from HXT \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP sensor clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_HCLK (0x2UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP sensor clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_HIRC (0x3UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP sensor clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL0_SDH0SEL_HXT (0x0UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_SDH0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_SDH0SEL_HCLK (0x2UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_SDH0SEL_HIRC (0x3UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL0_SDH1SEL_HXT (0x0UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_SDH1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_SDH1SEL_HCLK (0x2UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_SDH1SEL_HIRC (0x3UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL0_CANFD0SEL_HXT (0x0UL << CLK_CLKSEL0_CANFD0SEL_Pos) /*!< Select CANFD0 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL0_CANFD0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_CANFD0SEL_Pos) /*!< Select CANFD0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_CANFD0SEL_HCLK (0x2UL << CLK_CLKSEL0_CANFD0SEL_Pos) /*!< Select CANFD0 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_CANFD0SEL_HIRC (0x3UL << CLK_CLKSEL0_CANFD0SEL_Pos) /*!< Select CANFD0 clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL0_CANFD1SEL_HXT (0x0UL << CLK_CLKSEL0_CANFD1SEL_Pos) /*!< Select CANFD1 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL0_CANFD1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_CANFD1SEL_Pos) /*!< Select CANFD1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_CANFD1SEL_HCLK (0x2UL << CLK_CLKSEL0_CANFD1SEL_Pos) /*!< Select CANFD1 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_CANFD1SEL_HIRC (0x3UL << CLK_CLKSEL0_CANFD1SEL_Pos) /*!< Select CANFD1 clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL0_CANFD2SEL_HXT (0x0UL << CLK_CLKSEL0_CANFD2SEL_Pos) /*!< Select CANFD2 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL0_CANFD2SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_CANFD2SEL_Pos) /*!< Select CANFD2 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_CANFD2SEL_HCLK (0x2UL << CLK_CLKSEL0_CANFD2SEL_Pos) /*!< Select CANFD2 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_CANFD2SEL_HIRC (0x3UL << CLK_CLKSEL0_CANFD2SEL_Pos) /*!< Select CANFD2 clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL0_CANFD3SEL_HXT (0x0UL << CLK_CLKSEL0_CANFD3SEL_Pos) /*!< Select CANFD3 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL0_CANFD3SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL0_CANFD3SEL_Pos) /*!< Select CANFD3 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL0_CANFD3SEL_HCLK (0x2UL << CLK_CLKSEL0_CANFD3SEL_Pos) /*!< Select CANFD3 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_CANFD3SEL_HIRC (0x3UL << CLK_CLKSEL0_CANFD3SEL_Pos) /*!< Select CANFD3 clock source from HIRC \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL1 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL1_WDTSEL_LXT (0x1UL << CLK_CLKSEL1_WDTSEL_Pos) /*!< Select WDT clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_WDTSEL_HCLK_DIV2048 (0x2UL << CLK_CLKSEL1_WDTSEL_Pos) /*!< Select WDT clock source from HCLK/2048 \hideinitializer */ -#define CLK_CLKSEL1_WDTSEL_LIRC (0x3UL << CLK_CLKSEL1_WDTSEL_Pos) /*!< Select WDT clock source from low speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_CLKOSEL_HXT (0x0UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from HXT \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_LXT (0x1UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from LXT \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_HCLK (0x2UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_HIRC (0x3UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from HIRC \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_LIRC (0x4UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from LIRC \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_PLLFN_DIV2 (0x5UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from PLLFN/2 \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_PLL_DIV2 (0x6UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from PLL/2 \hideinitializer */ - -#define CLK_CLKSEL1_TMR0SEL_HXT (0x0UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_LXT (0x1UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_PCLK0 (0x2UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_EXT (0x3UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from external trigger \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_TMR1SEL_HXT (0x0UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_LXT (0x1UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_PCLK0 (0x2UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_EXT (0x3UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from external trigger \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_TMR2SEL_HXT (0x0UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_LXT (0x1UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_PCLK1 (0x2UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_EXT (0x3UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from external trigger \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_TMR3SEL_HXT (0x0UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_LXT (0x1UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_PCLK1 (0x2UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_EXT (0x3UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from external trigger \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_UART0SEL_HXT (0x0UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL1_UART0SEL_LXT (0x2UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART0SEL_HIRC (0x3UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_UART1SEL_HXT (0x0UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL1_UART1SEL_LXT (0x2UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART1SEL_HIRC (0x3UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_WWDTSEL_HCLK_DIV2048 (0x2UL << CLK_CLKSEL1_WWDTSEL_Pos) /*!< Select WWDT clock source from HCLK/2048 \hideinitializer */ -#define CLK_CLKSEL1_WWDTSEL_LIRC (0x3UL << CLK_CLKSEL1_WWDTSEL_Pos) /*!< Select WWDT clock source from low speed oscillator \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL2 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL2_EPWM0SEL_HCLK (0x0UL << CLK_CLKSEL2_EPWM0SEL_Pos) /*!< Select EPWM0 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL2_EPWM0SEL_PCLK0 (0x1UL << CLK_CLKSEL2_EPWM0SEL_Pos) /*!< Select EPWM0 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL2_EPWM1SEL_HCLK (0x0UL << CLK_CLKSEL2_EPWM1SEL_Pos) /*!< Select EPWM1 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL2_EPWM1SEL_PCLK1 (0x1UL << CLK_CLKSEL2_EPWM1SEL_Pos) /*!< Select EPWM1 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL2_QSPI0SEL_HXT (0x0UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_QSPI0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_QSPI0SEL_PCLK0 (0x2UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL2_QSPI0SEL_HIRC (0x3UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL2_SPI0SEL_HXT (0x0UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_PCLK1 (0x2UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_HIRC (0x3UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_HIRC48M (0x4UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from HIRC48M \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_PLLFN_DIV2 (0x5UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from PLLFN/2 \hideinitializer */ - -#define CLK_CLKSEL2_BPWM0SEL_HCLK (0x0UL << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< Select BPWM0 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL2_BPWM0SEL_PCLK0 (0x1UL << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< Select BPWM0 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL2_BPWM1SEL_HCLK (0x0UL << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< Select BPWM1 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL2_BPWM1SEL_PCLK1 (0x1UL << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< Select BPWM1 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL2_QSPI1SEL_HXT (0x0UL << CLK_CLKSEL2_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_QSPI1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL2_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_QSPI1SEL_PCLK1 (0x2UL << CLK_CLKSEL2_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL2_QSPI1SEL_HIRC (0x3UL << CLK_CLKSEL2_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL2_SPI1SEL_HXT (0x0UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_PCLK0 (0x2UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_HIRC (0x3UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_HIRC48M (0x4UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from HIRC48M \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_PLLFN_DIV2 (0x5UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from PLLFN/2 \hideinitializer */ - -#define CLK_CLKSEL2_I2S1SEL_HXT (0x0UL << CLK_CLKSEL2_I2S1SEL_Pos) /*!< Select I2S1 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL2_I2S1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL2_I2S1SEL_Pos) /*!< Select I2S1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_I2S1SEL_PCLK1 (0x2UL << CLK_CLKSEL2_I2S1SEL_Pos) /*!< Select I2S1 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL2_I2S1SEL_HIRC (0x3UL << CLK_CLKSEL2_I2S1SEL_Pos) /*!< Select I2S1 clock source from HIRC \hideinitializer */ -#define CLK_CLKSEL2_I2S1SEL_HIRC48M (0x4UL << CLK_CLKSEL2_I2S1SEL_Pos) /*!< Select I2S1 clock source from HIRC48M \hideinitializer */ -#define CLK_CLKSEL2_I2S1SEL_PLLFN_DIV2 (0x5UL << CLK_CLKSEL2_I2S1SEL_Pos) /*!< Select I2S1 clock source from PLLFN/2 \hideinitializer */ - -#define CLK_CLKSEL2_UART8SEL_HXT (0x0UL << CLK_CLKSEL2_UART8SEL_Pos) /*!< Select UART8 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL2_UART8SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL2_UART8SEL_Pos) /*!< Select UART8 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_UART8SEL_LXT (0x2UL << CLK_CLKSEL2_UART8SEL_Pos) /*!< Select UART8 clock source from LXT \hideinitializer */ -#define CLK_CLKSEL2_UART8SEL_HIRC (0x3UL << CLK_CLKSEL2_UART8SEL_Pos) /*!< Select UART8 clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL2_UART9SEL_HXT (0x0UL << CLK_CLKSEL2_UART9SEL_Pos) /*!< Select UART9 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL2_UART9SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL2_UART9SEL_Pos) /*!< Select UART9 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_UART9SEL_LXT (0x2UL << CLK_CLKSEL2_UART9SEL_Pos) /*!< Select UART9 clock source from LXT \hideinitializer */ -#define CLK_CLKSEL2_UART9SEL_HIRC (0x3UL << CLK_CLKSEL2_UART9SEL_Pos) /*!< Select UART9 clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL2_TRNGSEL_LXT (0x0UL << CLK_CLKSEL2_TRNGSEL_Pos) /*!< Select TRNG clock source from LXT \hideinitializer */ -#define CLK_CLKSEL2_TRNGSEL_LIRC (0x1UL << CLK_CLKSEL2_TRNGSEL_Pos) /*!< Select TRNG clock source from LIRC \hideinitializer */ - -#define CLK_CLKSEL2_PSIOSEL_HXT (0x0UL << CLK_CLKSEL2_PSIOSEL_Pos) /*!< Select PSIO clock source from LXT \hideinitializer */ -#define CLK_CLKSEL2_PSIOSEL_LXT (0x1UL << CLK_CLKSEL2_PSIOSEL_Pos) /*!< Select PSIO clock source from LIRC \hideinitializer */ -#define CLK_CLKSEL2_PSIOSEL_PCLK1 (0x2UL << CLK_CLKSEL2_PSIOSEL_Pos) /*!< Select PSIO clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL2_PSIOSEL_PLL_DIV2 (0x3UL << CLK_CLKSEL2_PSIOSEL_Pos) /*!< Select PSIO clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL2_PSIOSEL_LIRC (0x4UL << CLK_CLKSEL2_PSIOSEL_Pos) /*!< Select PSIO clock source from LIRC \hideinitializer */ -#define CLK_CLKSEL2_PSIOSEL_HIRC (0x5UL << CLK_CLKSEL2_PSIOSEL_Pos) /*!< Select PSIO clock source from HIRC \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL3 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL3_SC0SEL_HXT (0x0UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SC0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_SC0SEL_PCLK0 (0x2UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL3_SC0SEL_HIRC (0x3UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_SC1SEL_HXT (0x0UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SC1SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_SC1SEL_PCLK1 (0x2UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL3_SC1SEL_HIRC (0x3UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_SC2SEL_HXT (0x0UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SC2SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_SC2SEL_PCLK0 (0x2UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL3_SC2SEL_HIRC (0x3UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_KPISEL_HXT (0x0UL << CLK_CLKSEL3_KPISEL_Pos) /*!< Select KPI clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_KPISEL_LIRC (0x1UL << CLK_CLKSEL3_KPISEL_Pos) /*!< Select KPI clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_KPISEL_HIRC (0x2UL << CLK_CLKSEL3_KPISEL_Pos) /*!< Select KPI clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_SPI2SEL_HXT (0x0UL << CLK_CLKSEL3_SPI2SEL_Pos) /*!< Select SPI2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SPI2SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_SPI2SEL_Pos) /*!< Select SPI2 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_SPI2SEL_PCLK1 (0x2UL << CLK_CLKSEL3_SPI2SEL_Pos) /*!< Select SPI2 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL3_SPI2SEL_HIRC (0x3UL << CLK_CLKSEL3_SPI2SEL_Pos) /*!< Select SPI2 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_SPI2SEL_HIRC48M (0x4UL << CLK_CLKSEL3_SPI2SEL_Pos) /*!< Select SPI2 clock source from HIRC48M \hideinitializer */ -#define CLK_CLKSEL3_SPI2SEL_PLLFN_DIV2 (0x5UL << CLK_CLKSEL3_SPI2SEL_Pos) /*!< Select SPI2 clock source from PLLFN/2 \hideinitializer */ - -#define CLK_CLKSEL3_SPI3SEL_HXT (0x0UL << CLK_CLKSEL3_SPI3SEL_Pos) /*!< Select SPI3 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SPI3SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_SPI3SEL_Pos) /*!< Select SPI3 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_SPI3SEL_PCLK0 (0x2UL << CLK_CLKSEL3_SPI3SEL_Pos) /*!< Select SPI3 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL3_SPI3SEL_HIRC (0x3UL << CLK_CLKSEL3_SPI3SEL_Pos) /*!< Select SPI3 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_SPI3SEL_HIRC48M (0x4UL << CLK_CLKSEL3_SPI3SEL_Pos) /*!< Select SPI3 clock source from HIRC48M \hideinitializer */ -#define CLK_CLKSEL3_SPI3SEL_PLLFN_DIV2 (0x5UL << CLK_CLKSEL3_SPI3SEL_Pos) /*!< Select SPI3 clock source from PLLFN/2 \hideinitializer */ - -#define CLK_CLKSEL3_I2S0SEL_HXT (0x0UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_PCLK0 (0x2UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_HIRC (0x3UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_HIRC48M (0x4UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from HIRC48M \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_PLLFN_DIV2 (0x5UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from PLLFN/2 \hideinitializer */ - -#define CLK_CLKSEL3_UART6SEL_HXT (0x0UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL3_UART6SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_UART6SEL_LXT (0x2UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from LXT \hideinitializer */ -#define CLK_CLKSEL3_UART6SEL_HIRC (0x3UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL3_UART7SEL_HXT (0x0UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from HXT \hideinitializer */ -#define CLK_CLKSEL3_UART7SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_UART7SEL_LXT (0x2UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from LXT \hideinitializer */ -#define CLK_CLKSEL3_UART7SEL_HIRC (0x3UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from HIRC \hideinitializer */ - -#define CLK_CLKSEL3_UART2SEL_HXT (0x0UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART2SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_UART2SEL_LXT (0x2UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART2SEL_HIRC (0x3UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART3SEL_HXT (0x0UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART3SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_UART3SEL_LXT (0x2UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART3SEL_HIRC (0x3UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART4SEL_HXT (0x0UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART4SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_UART4SEL_LXT (0x2UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART4SEL_HIRC (0x3UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART5SEL_HXT (0x0UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART5SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL3_UART5SEL_LXT (0x2UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART5SEL_HIRC (0x3UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from high speed oscillator \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL4 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL4_SPI4SEL_HXT (0x0UL << CLK_CLKSEL4_SPI4SEL_Pos) /*!< Select SPI4 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL4_SPI4SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL4_SPI4SEL_Pos) /*!< Select SPI4 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL4_SPI4SEL_PCLK1 (0x2UL << CLK_CLKSEL4_SPI4SEL_Pos) /*!< Select SPI4 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL4_SPI4SEL_HIRC (0x3UL << CLK_CLKSEL4_SPI4SEL_Pos) /*!< Select SPI4 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL4_SPI5SEL_HXT (0x0UL << CLK_CLKSEL4_SPI5SEL_Pos) /*!< Select SPI5 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL4_SPI5SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL4_SPI5SEL_Pos) /*!< Select SPI5 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL4_SPI5SEL_PCLK0 (0x2UL << CLK_CLKSEL4_SPI5SEL_Pos) /*!< Select SPI5 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL4_SPI5SEL_HIRC (0x3UL << CLK_CLKSEL4_SPI5SEL_Pos) /*!< Select SPI5 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL4_SPI6SEL_HXT (0x0UL << CLK_CLKSEL4_SPI6SEL_Pos) /*!< Select SPI6 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL4_SPI6SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL4_SPI6SEL_Pos) /*!< Select SPI6 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL4_SPI6SEL_PCLK1 (0x2UL << CLK_CLKSEL4_SPI6SEL_Pos) /*!< Select SPI6 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL4_SPI6SEL_HIRC (0x3UL << CLK_CLKSEL4_SPI6SEL_Pos) /*!< Select SPI6 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL4_SPI7SEL_HXT (0x0UL << CLK_CLKSEL4_SPI7SEL_Pos) /*!< Select SPI7 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL4_SPI7SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL4_SPI7SEL_Pos) /*!< Select SPI7 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL4_SPI7SEL_PCLK0 (0x2UL << CLK_CLKSEL4_SPI7SEL_Pos) /*!< Select SPI7 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL4_SPI7SEL_HIRC (0x3UL << CLK_CLKSEL4_SPI7SEL_Pos) /*!< Select SPI7 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL4_SPI8SEL_HXT (0x0UL << CLK_CLKSEL4_SPI8SEL_Pos) /*!< Select SPI8 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL4_SPI8SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL4_SPI8SEL_Pos) /*!< Select SPI8 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL4_SPI8SEL_PCLK1 (0x2UL << CLK_CLKSEL4_SPI8SEL_Pos) /*!< Select SPI8 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL4_SPI8SEL_HIRC (0x3UL << CLK_CLKSEL4_SPI8SEL_Pos) /*!< Select SPI8 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL4_SPI9SEL_HXT (0x0UL << CLK_CLKSEL4_SPI9SEL_Pos) /*!< Select SPI9 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL4_SPI9SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL4_SPI9SEL_Pos) /*!< Select SPI9 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL4_SPI9SEL_PCLK0 (0x2UL << CLK_CLKSEL4_SPI9SEL_Pos) /*!< Select SPI9 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL4_SPI9SEL_HIRC (0x3UL << CLK_CLKSEL4_SPI9SEL_Pos) /*!< Select SPI9 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL4_SPI10SEL_HXT (0x0UL << CLK_CLKSEL4_SPI10SEL_Pos) /*!< Select SPI10 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL4_SPI10SEL_PLL_DIV2 (0x1UL << CLK_CLKSEL4_SPI10SEL_Pos) /*!< Select SPI10 clock source from PLL/2 \hideinitializer */ -#define CLK_CLKSEL4_SPI10SEL_PCLK1 (0x2UL << CLK_CLKSEL4_SPI10SEL_Pos) /*!< Select SPI10 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL4_SPI10SEL_HIRC (0x3UL << CLK_CLKSEL4_SPI10SEL_Pos) /*!< Select SPI10 clock source from high speed oscillator \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC clock source constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_LXTCTL_RTCCKSEL_LXT (0x0UL<>29) & 0x07UL) /*!< Calculate AHBCLK/APBCLK offset on MODULE index, 0x0:AHBCLK0, 0x1:APBCLK0, 0x2:APBCLK1, 0x3:APBCLK2, 0x4:AHBCLK1 \hideinitializer */ -#define MODULE_CLKSEL(x) (((x) >>26) & 0x07UL) /*!< Calculate CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3, 0x4:CLKSEL4 \hideinitializer */ -#define MODULE_CLKSEL_Msk(x) (((x) >>22) & 0x0fUL) /*!< Calculate CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos(x) (((x) >>17) & 0x1fUL) /*!< Calculate CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV(x) (((x) >>14) & 0x07UL) /*!< Calculate APBCLK CLKDIV on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV2, 0x3:CLKDIV3, 0x4:CLKDIV4, 0x5:CLKDIV5 \hideinitializer */ -#define MODULE_CLKDIV_Msk(x) (((x) >>10) & 0x0fUL) /*!< Calculate CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos(x) (((x) >>5 ) & 0x1fUL) /*!< Calculate CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos(x) (((x) >>0 ) & 0x1fUL) /*!< Calculate APBCLK offset on MODULE index \hideinitializer */ -#define MODULE_NoMsk 0x0UL /*!< Not mask on MODULE index \hideinitializer */ -#define NA MODULE_NoMsk /*!< Not Available \hideinitializer */ - -#define MODULE_APBCLK_ENC(x) (((x) & 0x07UL) << 29) /*!< MODULE index, 0x0:AHBCLK0, 0x1:APBCLK0, 0x2:APBCLK1, 0x3:APBCLK2 0x4:AHBCLK1 \hideinitializer */ -#define MODULE_CLKSEL_ENC(x) (((x) & 0x07UL) << 26) /*!< CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3, 0x4:CLKSEL4, 0x5:CLKSEL5 \hideinitializer */ -#define MODULE_CLKSEL_Msk_ENC(x) (((x) & 0x0fUL) << 22) /*!< CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos_ENC(x) (((x) & 0x1fUL) << 17) /*!< CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_ENC(x) (((x) & 0x07UL) << 14) /*!< APBCLK CLKDIV on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV2, 0x3:CLKDIV3, 0x4:CLKDIV4, 0x4:CLKDIV5 \hideinitializer */ -#define MODULE_CLKDIV_Msk_ENC(x) (((x) & 0x0fUL) << 10) /*!< CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos_ENC(x) (((x) & 0x1fUL) << 5) /*!< CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos_ENC(x) (((x) & 0x1fUL) << 0) /*!< AHBCLK/APBCLK offset on MODULE index \hideinitializer */ - -/* AHBCLK0 */ -#define PDMA0_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_PDMA0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< PDMA0 Module */ - -#define ISP_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_ISPCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ISP Module */ - -#define EBI_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_EBICKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EBI Module */ - -#define ST_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_STCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ST Module */ - -#define EMAC0_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_EMAC0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC( NA)|MODULE_CLKSEL_Pos_ENC( NA)|\ - MODULE_CLKDIV_ENC( 3UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(16UL)) /*!< EMAC0 Module */ - -#define SDH0_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_SDH0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(24UL)) /*!< SDH0 Module */ - -#define CRC_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_CRCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CRC Module */ - -#define CCAP_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_CCAPCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CCAP Module */ - -#define SEN_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_SENCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC( NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( 3UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< SEN Module */ - -#define HSUSBD_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_HSUSBDCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< HSUSBD Module */ - -#define HBI_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_HBICKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< HBI Module */ - -#define CRPT_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_CRPTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< CRPT Module */ - -#define KS_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_KSCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< KS Module */ - -#define SPIM_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_SPIMCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPIM Module */ - -#define FMCIDLE_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_FMCIDLE_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< FMCIDLE Module */ - -#define USBH_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_USBHCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0xFUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< USBH Module */ - -#define SDH1_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_SDH1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(22UL)|\ - MODULE_CLKDIV_ENC( 3UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(24UL)) /*!< SDH1 Module */ - -#define PDMA1_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_PDMA1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< PDMA1 Module */ - -#define TRACE_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_TRACECKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TRACE Module */ - -#define GPA_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPACKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPA Module */ - -#define GPB_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPBCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPB Module */ - -#define GPC_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPC Module */ - -#define GPD_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPDCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPD Module */ - -#define GPE_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPECKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPE Module */ - -#define GPF_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPFCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPF Module */ - -#define GPG_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPGCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPG Module */ - -#define GPH_MODULE (MODULE_APBCLK_ENC( 0UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK0_GPHCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPH Module */ - -/* AHBCLK1 */ -#define CANFD0_MODULE (MODULE_APBCLK_ENC( 4UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK1_CANFD0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(24UL)|\ - MODULE_CLKDIV_ENC( 5UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 0UL)) /*!< CANFD0 Module */ - -#define CANFD1_MODULE (MODULE_APBCLK_ENC( 4UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK1_CANFD1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(26UL)|\ - MODULE_CLKDIV_ENC( 5UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< CANFD1 Module */ - -#define CANFD2_MODULE (MODULE_APBCLK_ENC( 4UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK1_CANFD2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(28UL)|\ - MODULE_CLKDIV_ENC( 5UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< CANFD2 Module */ - -#define CANFD3_MODULE (MODULE_APBCLK_ENC( 4UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK1_CANFD3CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(30UL)|\ - MODULE_CLKDIV_ENC( 5UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(12UL)) /*!< CANFD3 Module */ - -#define GPI_MODULE (MODULE_APBCLK_ENC( 4UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK1_GPICKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPI Module */ - -#define GPJ_MODULE (MODULE_APBCLK_ENC( 4UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK1_GPJCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< GPJ Module */ - -#define BMC_MODULE (MODULE_APBCLK_ENC( 4UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_AHBCLK1_BMCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< BMC Module */ - -/* APBCLK0 */ -#define WDT_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_WDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 0UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< WDT Module */ - -#define WWDT_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_WDTCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(30UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< WWDT Module */ - -#define RTC_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_RTCCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC( NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< RTC Module */ - -#define TMR0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR0 Module */ - -#define TMR1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR1 Module */ - -#define TMR2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR2 Module */ - -#define TMR3_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_TMR3CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< TMR3 Module */ - -#define CLKO_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_CLKOCKEN_Pos) |\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 4UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< CLKO Module */ - -#define ACMP01_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_ACMP01CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ACMP01 Module */ - -#define I2C0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2C0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C0 Module */ - -#define I2C1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2C1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C1 Module */ - -#define I2C2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2C2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C2 Module */ - -#define I2C3_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2C3CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C3 Module */ - -#define QSPI0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_QSPI0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 2UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< QSPI0 Module */ - -#define SPI0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_SPI0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 4UL)|\ - MODULE_CLKDIV_ENC(NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< SPI0 Module */ - -#define SPI1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_SPI1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< SPI1 Module */ - -#define SPI2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_SPI2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 9UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC( NA)|MODULE_CLKDIV_Pos_ENC( NA)) /*!< SPI2 Module */ - -#define UART0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(24UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< UART0 Module */ - -#define UART1_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 1UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(26UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(12UL)) /*!< UART1 Module */ - -#define UART2_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(24UL)|\ - MODULE_CLKDIV_ENC( 4UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 0UL)) /*!< UART2 Module */ - -#define UART3_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART3CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(26UL)|\ - MODULE_CLKDIV_ENC( 4UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< UART3 Module */ - -#define UART4_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART4CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(28UL)|\ - MODULE_CLKDIV_ENC( 4UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< UART4 Module */ - -#define UART5_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART5CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(30UL)|\ - MODULE_CLKDIV_ENC( 4UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(12UL)) /*!< UART5 Module */ - -#define UART6_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART6CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( 4UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(16UL)) /*!< UART6 Module */ - -#define UART7_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_UART7CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(22UL)|\ - MODULE_CLKDIV_ENC( 4UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(20UL)) /*!< UART7 Module */ - -#define OTG_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_OTGCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0xFUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< OTG Module */ - -#define USBD_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_USBDCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0xFUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< USBD Module */ - -#define EADC0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_EADC0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(10UL)|\ - MODULE_CLKDIV_ENC( 0UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(16UL)) /*!< EADC0 Module */ - -#define I2S0_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_I2S0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( 2UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 0UL)) /*!< I2S0 Module */ - -#define HSOTG_MODULE (MODULE_APBCLK_ENC( 1UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK0_HSOTGCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< HSOTG Module */ - -/* APBCLK1 */ -#define SC0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SC0CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 0UL)|\ - MODULE_CLKDIV_ENC( 1UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 0UL)) /*!< SC0 Module */ - -#define SC1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SC1CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 2UL)|\ - MODULE_CLKDIV_ENC( 1UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< SC1 Module */ - -#define SC2_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SC2CKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 4UL)|\ - MODULE_CLKDIV_ENC( 1UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(16UL)) /*!< SC2 Module */ - -#define I2C4_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_I2C4CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< I2C4 Module */ - -#define QSPI1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_QSPI1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(10UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< QSPI1 Module */ - -#define SPI3_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SPI3CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI3 Module */ - -#define SPI4_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_SPI4CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 4UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 0UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI4 Module */ - -#define USCI0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_USCI0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< USCI0 Module */ - -#define PSIO_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_PSIOCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(28UL)|\ - MODULE_CLKDIV_ENC( 1UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(24UL)) /*!< PSIO Module */ - -#define DAC_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_DACCKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< DAC Module */ - -#define ECAP2_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_ECAP2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ECAP2 Module */ - -#define ECAP3_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_ECAP3CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ECAP3 Module */ - -#define EPWM0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EPWM0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 0UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EPWM0 Module */ - -#define EPWM1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EPWM1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 1UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EPWM1 Module */ - -#define BPWM0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_BPWM0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< BPWM0 Module */ - -#define BPWM1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_BPWM1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC( 9UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< BPWM1 Module */ - -#define EQEI0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EQEI0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EQEI0 Module */ - -#define EQEI1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EQEI1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EQEI1 Module */ - -#define EQEI2_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EQEI2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EQEI2 Module */ - -#define EQEI3_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EQEI3CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EQEI3 Module */ - -#define TRNG_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_TRNGCKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 1UL)|MODULE_CLKSEL_Pos_ENC(27UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< TRNG Module */ - -#define ECAP0_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_ECAP0CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ECAP0 Module */ - -#define ECAP1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_ECAP1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ECAP1 Module */ - -#define I2S1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_I2S1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( 2UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 4UL)) /*!< I2S1 Module */ - -#define EADC1_MODULE (MODULE_APBCLK_ENC( 2UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK1_EADC1CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< EADC1 Module */ - -/* APBCLK2 */ -#define KPI_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_KPICKEN_Pos) |\ - MODULE_CLKSEL_ENC( 3UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC( 6UL)|\ - MODULE_CLKDIV_ENC( 2UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC( 8UL)) /*!< KPI Module */ - -#define EADC2_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_EADC2CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 0UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(14UL)|\ - MODULE_CLKDIV_ENC( 2UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(24UL)) /*!< EADC2 Module */ - -#define ACMP23_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_ACMP23CKEN_Pos) |\ - MODULE_CLKSEL_ENC( NA)|MODULE_CLKSEL_Msk_ENC(NA)|MODULE_CLKSEL_Pos_ENC(NA)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< ACMP23 Module */ - -#define SPI5_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_SPI5CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 4UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 4UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI5 Module */ - -#define SPI6_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_SPI6CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 4UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC( 8UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI6 Module */ - -#define SPI7_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_SPI7CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 4UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(12UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI7 Module */ - -#define SPI8_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_SPI8CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 4UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(16UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI8 Module */ - -#define SPI9_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_SPI9CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 4UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI9 Module */ - -#define SPI10_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_SPI10CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 4UL)|MODULE_CLKSEL_Msk_ENC( 7UL)|MODULE_CLKSEL_Pos_ENC(24UL)|\ - MODULE_CLKDIV_ENC( NA)|MODULE_CLKDIV_Msk_ENC(NA)|MODULE_CLKDIV_Pos_ENC(NA)) /*!< SPI10 Module */ - -#define UART8_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_UART8CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(20UL)|\ - MODULE_CLKDIV_ENC( 5UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(16UL)) /*!< UART8 Module */ - -#define UART9_MODULE (MODULE_APBCLK_ENC( 3UL)|MODULE_IP_EN_Pos_ENC((uint32_t)CLK_APBCLK2_UART9CKEN_Pos)|\ - MODULE_CLKSEL_ENC( 2UL)|MODULE_CLKSEL_Msk_ENC( 3UL)|MODULE_CLKSEL_Pos_ENC(22UL)|\ - MODULE_CLKDIV_ENC( 5UL)|MODULE_CLKDIV_Msk_ENC(0x0FUL)|MODULE_CLKDIV_Pos_ENC(20UL)) /*!< UART9 Module */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* PDMSEL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PMUCTL_PDMSEL_PD (0x0UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Power-down mode \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_LLPD (0x1UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Low leakage Power-down mode \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_FWPD (0x2UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Fast wake-up Power-down mode \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_SPD (0x4UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Standby Power-down mode \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_DPD (0x6UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Deep Power-down mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WKTMRIS constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PMUCTL_WKTMRIS_128 (0x0UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 128 OSC10K clocks (12.8 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_256 (0x1UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 256 OSC10K clocks (25.6 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_512 (0x2UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 512 OSC10K clocks (51.2 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_1024 (0x3UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 1024 OSC10K clocks (102.4ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_4096 (0x4UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 4096 OSC10K clocks (409.6ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_8192 (0x5UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 8192 OSC10K clocks (819.2ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_16384 (0x6UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 16384 OSC10K clocks (1638.4ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_65536 (0x7UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 65536 OSC10K clocks (6553.6ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_131072 (0x8UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 131072 OSC10K clocks (13107.2 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_262144 (0x9UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 262144 OSC10K clocks (26214.4 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_524288 (0xaUL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 524288 OSC10K clocks (52428.8ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_1048576 (0xbUL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 1048576 OSC10K clocks (104857.6ms) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SWKDBCLKSEL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_SWKDBCTL_SWKDBCLKSEL_1 (0x0UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 1 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_2 (0x1UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 2 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_4 (0x2UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 4 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_8 (0x3UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 8 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_16 (0x4UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 16 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_32 (0x5UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 32 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_64 (0x6UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 64 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_128 (0x7UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 128 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_256 (0x8UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_2x256 (0x9UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 2x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_4x256 (0xaUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 4x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_8x256 (0xbUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 8x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_16x256 (0xcUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 16x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_32x256 (0xdUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 32x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_64x256 (0xeUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 64x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_128x256 (0xfUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 128x256 clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* DPD Pin Rising/Falling Edge Wake-up Enable constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_DPDWKPIN0_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN0_Pos) /*!< Disable Wake-up pin0 (GPC.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_RISING (0x1UL << CLK_PMUCTL_WKPINEN0_Pos) /*!< Enable Wake-up pin0 (GPC.0) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_FALLING (0x2UL << CLK_PMUCTL_WKPINEN0_Pos) /*!< Enable Wake-up pin0 (GPC.0) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN0_Pos) /*!< Enable Wake-up pin0 (GPC.0) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN1_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Disable Wake-up pin1 (GPB.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_RISING (0x1UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_FALLING (0x2UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN2_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Disable Wake-up pin2 (GPB.2) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_RISING (0x1UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_FALLING (0x2UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN3_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Disable Wake-up pin3 (GPB.12) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_RISING (0x1UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_FALLING (0x2UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN4_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Disable Wake-up pin4 (GPF.6) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_RISING (0x1UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_FALLING (0x2UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) both edge at Deep Power-down mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SPD Pin Rising/Falling Edge Wake-up Enable constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_SPDWKPIN_ENABLE (0x1UL << 0) /*!< Enable Standby Power-down Pin Wake-up \hideinitializer */ -#define CLK_SPDWKPIN_RISING (0x1UL << 1) /*!< Standby Power-down Wake-up on Standby Power-down Pin rising edge \hideinitializer */ -#define CLK_SPDWKPIN_FALLING (0x1UL << 2) /*!< Standby Power-down Wake-up on Standby Power-down Pin falling edge \hideinitializer */ -#define CLK_SPDWKPIN_DEBOUNCEEN (0x1UL << 8) /*!< Enable Standby power-down pin De-bounce function \hideinitializer */ -#define CLK_SPDWKPIN_DEBOUNCEDIS (0x0UL << 8) /*!< Disable Standby power-down pin De-bounce function \hideinitializer */ - -#define CLK_SPDSRETSEL_NO (0x0UL << CLK_PMUCTL_SRETSEL_Pos) /*!< No SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_16K (0x1UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 16K SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_32K (0x2UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 32K SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_64K (0x3UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 64K SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_128K (0x4UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 128K SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_256K (0x5UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 256K SRAM retention when chip enter SPD mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLK Time-out Handler Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_TIMEOUT_ERR (-1) /*!< Clock timeout error value \hideinitializer */ - -/*@}*/ /* end of group CLK_EXPORTED_CONSTANTS */ - -extern int32_t g_CLK_i32ErrCode; - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - -/** - * @brief Disable Wake-up Timer - * @param None - * @return None - * @details This macro disables Wake-up timer at Standby or Deep Power-down mode. - */ -#define CLK_DISABLE_WKTMR() (CLK->PMUCTL &= ~CLK_PMUCTL_WKTMREN_Msk) - -/** - * @brief Enable Wake-up Timer - * @param None - * @return None - * @details This macro enables Wake-up timer at Standby or Deep Power-down mode. - */ -#define CLK_ENABLE_WKTMR() (CLK->PMUCTL |= CLK_PMUCTL_WKTMREN_Msk) - -/** - * @brief Disable DPD Mode Wake-up Pin 0 - * @param None - * @return None - * @details This macro disables Wake-up pin 0 (GPC.0) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN0() (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN0_Msk) - -/** - * @brief Disable DPD Mode Wake-up Pin 1 - * @param None - * @return None - * @details This macro disables Wake-up pin 1 (GPB.0) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN1() (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN1_Msk) - -/** - * @brief Disable DPD Mode Wake-up Pin 2 - * @param None - * @return None - * @details This macro disables Wake-up pin 2 (GPB.2) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN2() (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN2_Msk) - -/** - * @brief Disable DPD Mode Wake-up Pin 3 - * @param None - * @return None - * @details This macro disables Wake-up pin 3 (GPB.12) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN3() (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN3_Msk) - -/** - * @brief Disable DPD Mode Wake-up Pin 4 - * @param None - * @return None - * @details This macro disables Wake-up pin 4 (GPF.6) at Deep Power-down mode. - */ -#define CLK_DISABLE_DPDWKPIN4() (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN4_Msk) - -/** - * @brief Disable SPD Mode ACMP Wake-up - * @param None - * @return None - * @details This macro disables ACMP wake-up at Standby Power-down mode. - */ -#define CLK_DISABLE_SPDACMP() (CLK->PMUCTL &= ~CLK_PMUCTL_ACMPSPWK_Msk) - -/** - * @brief Enable SPD Mode ACMP Wake-up - * @param None - * @return None - * @details This macro enables ACMP wake-up at Standby Power-down mode. - */ -#define CLK_ENABLE_SPDACMP() (CLK->PMUCTL |= CLK_PMUCTL_ACMPSPWK_Msk) - -/** - * @brief Disable SPD and DPD Mode RTC Wake-up - * @param None - * @return None - * @details This macro disables RTC Wake-up at Standby or Deep Power-down mode. - */ -#define CLK_DISABLE_RTCWK() (CLK->PMUCTL &= ~CLK_PMUCTL_RTCWKEN_Msk) - -/** - * @brief Enable SPD and DPD Mode RTC Wake-up - * @param None - * @return None - * @details This macro enables RTC Wake-up at Standby or Deep Power-down mode. - */ -#define CLK_ENABLE_RTCWK() (CLK->PMUCTL |= CLK_PMUCTL_RTCWKEN_Msk) - -/** - * @brief Set Wake-up Timer Time-out Interval - * - * @param[in] u32Interval The Wake-up Timer Time-out Interval selection. It could be - * - \ref CLK_PMUCTL_WKTMRIS_128 - * - \ref CLK_PMUCTL_WKTMRIS_256 - * - \ref CLK_PMUCTL_WKTMRIS_512 - * - \ref CLK_PMUCTL_WKTMRIS_1024 - * - \ref CLK_PMUCTL_WKTMRIS_4096 - * - \ref CLK_PMUCTL_WKTMRIS_8192 - * - \ref CLK_PMUCTL_WKTMRIS_16384 - * - \ref CLK_PMUCTL_WKTMRIS_65536 - * - \ref CLK_PMUCTL_WKTMRIS_131072 - * - \ref CLK_PMUCTL_WKTMRIS_262144 - * - \ref CLK_PMUCTL_WKTMRIS_524288 - * - \ref CLK_PMUCTL_WKTMRIS_1048576 - * - * @return None - * - * @details This function set Wake-up Timer Time-out Interval. - * - * \hideinitializer - */ -#define CLK_SET_WKTMR_INTERVAL(u32Interval) CLK->PMUCTL = (CLK->PMUCTL & (~CLK_PMUCTL_WKTMRIS_Msk)) | (u32Interval) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] u32CycleSel The de-bounce sampling cycle selection. It could be - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_1 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_2 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_4 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_8 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_16 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_32 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_64 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_128 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_2x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_4x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_8x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_16x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_32x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_64x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_128x256 - * - * @return None - * - * @details This function set De-bounce Sampling Cycle Time for Standby Power-down pin wake-up. - * - * \hideinitializer - */ -#define CLK_SET_SPDDEBOUNCETIME(u32CycleSel) (CLK->SWKDBCTL = (u32CycleSel)) - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE int32_t CLK_SysTickDelay(uint32_t us); -__STATIC_INLINE int32_t CLK_SysTickLongDelay(uint32_t us); - -/** - * @brief This function execute delay function. - * @param[in] us Delay time. The Max value is 2^24 / CPU Clock(MHz). Ex: - * 200MHz => 83886us, 180MHz => 93206us ... - * @retval 0 Delay success. Target delay time reached. - * @retval CLK_TIMEOUT_ERR Delay function execute failed due to SysTick stop working. - * @details Use the SysTick to generate the delay time and the unit is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - * User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function. - */ -__STATIC_INLINE int32_t CLK_SysTickDelay(uint32_t us) -{ - /* The u32TimeOutCnt value must be greater than the max delay time of 1398ms if HCLK=12MHz */ - uint32_t u32TimeOutCnt = SystemCoreClock << 1; /* 2 second time-out */ - - SysTick->LOAD = us * CyclesPerUs; - SysTick->VAL = (0x00); - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) - { - if (--u32TimeOutCnt == 0) - { - break; - } - } - - /* Disable SysTick counter */ - SysTick->CTRL = 0; - - if (u32TimeOutCnt == 0) - return CLK_TIMEOUT_ERR; - else - return 0; -} - -/** - * @brief This function execute long delay function. - * @param[in] us Delay time. - * @retval 0 Delay success. Target delay time reached. - * @retval CLK_TIMEOUT_ERR Delay function execute failed due to SysTick stop working. - * @details Use the SysTick to generate the long delay time and the UNIT is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - * User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function. - */ -__STATIC_INLINE int32_t CLK_SysTickLongDelay(uint32_t us) -{ - /* The u32TimeOutCnt value must be greater than the max delay time of 1398ms if HCLK=12MHz */ - uint32_t u32Delay, u32TimeOutCnt; - - /* It should <= 65536us for each delay loop */ - u32Delay = 65536UL; - - do - { - if (us > u32Delay) - { - us -= u32Delay; - } - else - { - u32Delay = us; - us = 0UL; - } - - SysTick->LOAD = u32Delay * CyclesPerUs; - SysTick->VAL = (0x0UL); - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - u32TimeOutCnt = SystemCoreClock << 1; /* 2 second time-out */ - while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0UL) - if (--u32TimeOutCnt == 0) break; - - /* Disable SysTick counter */ - SysTick->CTRL = 0UL; - } - while ((us > 0UL) && (u32TimeOutCnt != 0)); - - if (u32TimeOutCnt == 0) - return CLK_TIMEOUT_ERR; - else - return 0; -} - - -void CLK_DisableCKO(void); -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En); -void CLK_PowerDown(void); -void CLK_Idle(void); -uint32_t CLK_GetHXTFreq(void); -uint32_t CLK_GetLXTFreq(void); -uint32_t CLK_GetHCLKFreq(void); -uint32_t CLK_GetPCLK0Freq(void); -uint32_t CLK_GetPCLK1Freq(void); -uint32_t CLK_GetCPUFreq(void); -uint32_t CLK_SetCoreClock(uint32_t u32Hclk); -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc); -void CLK_EnableXtalRC(uint32_t u32ClkMask); -void CLK_DisableXtalRC(uint32_t u32ClkMask); -void CLK_EnableModuleClock(uint32_t u32ModuleIdx); -void CLK_DisableModuleClock(uint32_t u32ModuleIdx); -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq); -void CLK_DisablePLL(void); -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask); -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count); -void CLK_DisableSysTick(void); -void CLK_SetPowerDownMode(uint32_t u32PDMode); -void CLK_EnableDPDWKPin(uint32_t u32TriggerType); -uint32_t CLK_GetPMUWKSrc(void); -void CLK_EnableSPDWKPin(uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerType, uint32_t u32DebounceEn); -uint32_t CLK_GetPLLClockFreq(void); -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx); -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx); -void CLK_DisablePLLFN(void); -uint32_t CLK_EnablePLLFN(uint32_t u32PllClkSrc, uint32_t u32PllFreq); -uint32_t CLK_GetPLLFNClockFreq(void); - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CLK_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crc.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crc.h deleted file mode 100644 index 8eff452ef7d..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crc.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************//** - * @file nu_crc.h - * @version V3.00 - * @brief Cyclic Redundancy Check(CRC) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_CRC_H__ -#define __NU_CRC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_CONSTANTS CRC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* CRC Polynomial Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CRC_CCITT (0UL << CRC_CTL_CRCMODE_Pos) /*!SEED = (u32Seed); CRC->CTL |= CRC_CTL_CHKSINIT_Msk; }while(0) - -/** - * @brief Get CRC Seed Value - * - * @param None - * - * @return CRC seed value - * - * @details This macro gets the current CRC seed value. - * \hideinitializer - */ -#define CRC_GET_SEED() (CRC->SEED) - -/** - * @brief CRC Write Data - * - * @param[in] u32Data Write data - * - * @return None - * - * @details User can write data directly to CRC Write Data Register(CRC_DAT) by this macro to perform CRC operation. - * \hideinitializer - */ -#define CRC_WRITE_DATA(u32Data) (CRC->DAT = (u32Data)) - - -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen); -uint32_t CRC_GetChecksum(void); - -/**@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CRC_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crypto.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crypto.h deleted file mode 100644 index 76738c9b277..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_crypto.h +++ /dev/null @@ -1,563 +0,0 @@ -/**************************************************************************//** - * @file nu_crypto.h - * @version V3.00 - * @brief Cryptographic Accelerator driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CRYPTO_H__ -#define __NU_CRYPTO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup CRYPTO_EXPORTED_CONSTANTS CRYPTO Exported Constants - @{ -*/ - - -#define PRNG_KEY_SIZE_128 ( 0UL) /*!< Select to generate 128-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_163 ( 1UL) /*!< Select to generate 163-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_192 ( 2UL) /*!< Select to generate 192-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_224 ( 3UL) /*!< Select to generate 224-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_255 ( 4UL) /*!< Select to generate 255-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_256 ( 6UL) /*!< Select to generate 256-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_283 ( 7UL) /*!< Select to generate 283-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_384 ( 8UL) /*!< Select to generate 384-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_409 ( 9UL) /*!< Select to generate 409-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_512 (10UL) /*!< Select to generate 512-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_521 (11UL) /*!< Select to generate 521-bit random key (Key Store Only) \hideinitializer */ -#define PRNG_KEY_SIZE_571 (12UL) /*!< Select to generate 571-bit random key (Key Store Only) \hideinitializer */ - -#define PRNG_SEED_CONT (0UL) /*!< PRNG using current seed \hideinitializer */ -#define PRNG_SEED_RELOAD (1UL) /*!< PRNG reload new seed \hideinitializer */ - -#define PRNG_CTL_SEEDSRC_TRNG (0UL) /*!< PRNG seed from TRNG \hideinitializer */ -#define PRNG_CTL_SEEDSRC_SEEDREG (CRPT_PRNG_CTL_SEEDSRC_Msk) /*!< PRNG seed from PRNG seed register \hideinitializer */ - - -#define AES_KEY_SIZE_128 (0UL) /*!< AES select 128-bit key length \hideinitializer */ -#define AES_KEY_SIZE_192 (1UL) /*!< AES select 192-bit key length \hideinitializer */ -#define AES_KEY_SIZE_256 (2UL) /*!< AES select 256-bit key length \hideinitializer */ - -#define AES_MODE_ECB (0UL) /*!< AES select ECB mode \hideinitializer */ -#define AES_MODE_CBC (1UL) /*!< AES select CBC mode \hideinitializer */ -#define AES_MODE_CFB (2UL) /*!< AES select CFB mode \hideinitializer */ -#define AES_MODE_OFB (3UL) /*!< AES select OFB mode \hideinitializer */ -#define AES_MODE_CTR (4UL) /*!< AES select CTR mode \hideinitializer */ -#define AES_MODE_CBC_CS1 (0x10UL) /*!< AES select CBC CS1 mode \hideinitializer */ -#define AES_MODE_CBC_CS2 (0x11UL) /*!< AES select CBC CS2 mode \hideinitializer */ -#define AES_MODE_CBC_CS3 (0x12UL) /*!< AES select CBC CS3 mode \hideinitializer */ -#define AES_MODE_GCM (0x20UL) -#define AES_MODE_GHASH (0x21UL) -#define AES_MODE_CCM (0x22UL) - -#define SM4_MODE_ECB (0x200UL) /*!< SM4 select ECB mode \hideinitializer */ -#define SM4_MODE_CBC (0x201UL) /*!< SM4 select CBC mode \hideinitializer */ -#define SM4_MODE_CFB (0x202UL) /*!< SM4 select CFB mode \hideinitializer */ -#define SM4_MODE_OFB (0x203UL) /*!< SM4 select OFB mode \hideinitializer */ -#define SM4_MODE_CTR (0x204UL) /*!< SM4 select CTR mode \hideinitializer */ -#define SM4_MODE_CBC_CS1 (0x210UL) /*!< SM4 select CBC CS1 mode \hideinitializer */ -#define SM4_MODE_CBC_CS2 (0x211UL) /*!< SM4 select CBC CS2 mode \hideinitializer */ -#define SM4_MODE_CBC_CS3 (0x212UL) /*!< SM4 select CBC CS3 mode \hideinitializer */ -#define SM4_MODE_GCM (0x220UL) -#define SM4_MODE_GHASH (0x221UL) -#define SM4_MODE_CCM (0x222UL) - - -#define AES_NO_SWAP (0UL) /*!< AES do not swap input and output data \hideinitializer */ -#define AES_OUT_SWAP (1UL) /*!< AES swap output data \hideinitializer */ -#define AES_IN_SWAP (2UL) /*!< AES swap input data \hideinitializer */ -#define AES_IN_OUT_SWAP (3UL) /*!< AES swap both input and output data \hideinitializer */ - -#define DES_MODE_ECB (0x000UL) /*!< DES select ECB mode \hideinitializer */ -#define DES_MODE_CBC (0x100UL) /*!< DES select CBC mode \hideinitializer */ -#define DES_MODE_CFB (0x200UL) /*!< DES select CFB mode \hideinitializer */ -#define DES_MODE_OFB (0x300UL) /*!< DES select OFB mode \hideinitializer */ -#define DES_MODE_CTR (0x400UL) /*!< DES select CTR mode \hideinitializer */ -#define TDES_MODE_ECB (0x004UL) /*!< TDES select ECB mode \hideinitializer */ -#define TDES_MODE_CBC (0x104UL) /*!< TDES select CBC mode \hideinitializer */ -#define TDES_MODE_CFB (0x204UL) /*!< TDES select CFB mode \hideinitializer */ -#define TDES_MODE_OFB (0x304UL) /*!< TDES select OFB mode \hideinitializer */ -#define TDES_MODE_CTR (0x404UL) /*!< TDES select CTR mode \hideinitializer */ - -#define TDES_NO_SWAP (0UL) /*!< TDES do not swap data \hideinitializer */ -#define TDES_WHL_SWAP (1UL) /*!< TDES swap high-low word \hideinitializer */ -#define TDES_OUT_SWAP (2UL) /*!< TDES swap output data \hideinitializer */ -#define TDES_OUT_WHL_SWAP (3UL) /*!< TDES swap output data and high-low word \hideinitializer */ -#define TDES_IN_SWAP (4UL) /*!< TDES swap input data \hideinitializer */ -#define TDES_IN_WHL_SWAP (5UL) /*!< TDES swap input data and high-low word \hideinitializer */ -#define TDES_IN_OUT_SWAP (6UL) /*!< TDES swap both input and output data \hideinitializer */ -#define TDES_IN_OUT_WHL_SWAP (7UL) /*!< TDES swap input, output and high-low word \hideinitializer */ - -#define SHA_MODE_SHA1 (0UL) /*!< SHA select SHA-1 160-bit \hideinitializer */ -#define SHA_MODE_SHA224 (5UL) /*!< SHA select SHA-224 224-bit \hideinitializer */ -#define SHA_MODE_SHA256 (4UL) /*!< SHA select SHA-256 256-bit \hideinitializer */ -#define SHA_MODE_SHA384 (7UL) /*!< SHA select SHA-384 384-bit \hideinitializer */ -#define SHA_MODE_SHA512 (6UL) /*!< SHA select SHA-512 512-bit \hideinitializer */ - -#define HMAC_MODE_SHA1 (8UL) /*!< HMAC select SHA-1 160-bit \hideinitializer */ -#define HMAC_MODE_SHA224 (13UL) /*!< HMAC select SHA-224 224-bit \hideinitializer */ -#define HMAC_MODE_SHA256 (12UL) /*!< HMAC select SHA-256 256-bit \hideinitializer */ -#define HMAC_MODE_SHA384 (15UL) /*!< HMAC select SHA-384 384-bit \hideinitializer */ -#define HMAC_MODE_SHA512 (14UL) /*!< HMAC select SHA-512 512-bit \hideinitializer */ - - -#define SHA_NO_SWAP (0UL) /*!< SHA do not swap input and output data \hideinitializer */ -#define SHA_OUT_SWAP (1UL) /*!< SHA swap output data \hideinitializer */ -#define SHA_IN_SWAP (2UL) /*!< SHA swap input data \hideinitializer */ -#define SHA_IN_OUT_SWAP (3UL) /*!< SHA swap both input and output data \hideinitializer */ - -#define CRYPTO_DMA_FIRST (0x4UL) /*!< Do first encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_ONE_SHOT (0x5UL) /*!< Do one shot encrypt/decrypt with DMA \hideinitializer */ -#define CRYPTO_DMA_CONTINUE (0x6UL) /*!< Do continuous encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_LAST (0x7UL) /*!< Do last encrypt/decrypt in DMA cascade \hideinitializer */ - -//--------------------------------------------------- - -#define RSA_MAX_KLEN (4096) -#define RSA_KBUF_HLEN (RSA_MAX_KLEN/4 + 8) -#define RSA_KBUF_BLEN (RSA_MAX_KLEN + 32) - -#define RSA_KEY_SIZE_1024 (0UL) /*!< RSA select 1024-bit key length \hideinitializer */ -#define RSA_KEY_SIZE_2048 (1UL) /*!< RSA select 2048-bit key length \hideinitializer */ -#define RSA_KEY_SIZE_3072 (2UL) /*!< RSA select 3072-bit key length \hideinitializer */ -#define RSA_KEY_SIZE_4096 (3UL) /*!< RSA select 4096-bit key length \hideinitializer */ - -#define RSA_MODE_NORMAL (0x000UL) /*!< RSA select normal mode \hideinitializer */ -#define RSA_MODE_CRT (0x004UL) /*!< RSA select CRT mode \hideinitializer */ -#define RSA_MODE_CRTBYPASS (0x00CUL) /*!< RSA select CRT bypass mode \hideinitializer */ -#define RSA_MODE_SCAP (0x100UL) /*!< RSA select SCAP mode \hideinitializer */ -#define RSA_MODE_CRT_SCAP (0x104UL) /*!< RSA select CRT SCAP mode \hideinitializer */ -#define RSA_MODE_CRTBYPASS_SCAP (0x10CUL) /*!< RSA select CRT bypass SCAP mode \hideinitializer */ - - -typedef enum -{ - /*!< ECC curve \hideinitializer */ - CURVE_P_192, /*!< ECC curve P-192 \hideinitializer */ - CURVE_P_224, /*!< ECC curve P-224 \hideinitializer */ - CURVE_P_256, /*!< ECC curve P-256 \hideinitializer */ - CURVE_P_384, /*!< ECC curve P-384 \hideinitializer */ - CURVE_P_521, /*!< ECC curve P-521 \hideinitializer */ - CURVE_K_163, /*!< ECC curve K-163 \hideinitializer */ - CURVE_K_233, /*!< ECC curve K-233 \hideinitializer */ - CURVE_K_283, /*!< ECC curve K-283 \hideinitializer */ - CURVE_K_409, /*!< ECC curve K-409 \hideinitializer */ - CURVE_K_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_B_163, /*!< ECC curve B-163 \hideinitializer */ - CURVE_B_233, /*!< ECC curve B-233 \hideinitializer */ - CURVE_B_283, /*!< ECC curve B-283 \hideinitializer */ - CURVE_B_409, /*!< ECC curve B-409 \hideinitializer */ - CURVE_B_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_KO_192, /*!< ECC 192-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_224, /*!< ECC 224-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_256, /*!< ECC 256-bits "Koblitz" curve \hideinitializer */ - CURVE_BP_256, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_384, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_512, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_25519, /*!< ECC curve-25519 \hideinitializer */ - CURVE_SM2_256, /*!< SM2 \hideinitializer */ - CURVE_UNDEF = -0x7fffffff, /*!< Invalid curve \hideinitializer */ -} -E_ECC_CURVE; - - - -typedef struct e_curve_t -{ - E_ECC_CURVE curve_id; - int32_t Echar; - char Ea[144]; - char Eb[144]; - char Px[144]; - char Py[144]; - int32_t Epl; - char Pp[176]; - int32_t Eol; - char Eorder[176]; - int32_t key_len; - int32_t irreducible_k1; - int32_t irreducible_k2; - int32_t irreducible_k3; - int32_t GF; -} ECC_CURVE; - - -/* RSA working buffer for normal mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ -} RSA_BUF_NORMAL_T; - -/* RSA working buffer for CRT ( + CRT bypass) mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ - uint32_t au32RsaP[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaQ[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaTmpCp[128]; /* The Temporary Value(Cp) of RSA CRT. */ - uint32_t au32RsaTmpCq[128]; /* The Temporary Value(Cq) of RSA CRT. */ - uint32_t au32RsaTmpDp[128]; /* The Temporary Value(Dp) of RSA CRT. */ - uint32_t au32RsaTmpDq[128]; /* The Temporary Value(Dq) of RSA CRT. */ - uint32_t au32RsaTmpRp[128]; /* The Temporary Value(Rp) of RSA CRT. */ - uint32_t au32RsaTmpRq[128]; /* The Temporary Value(Rq) of RSA CRT. */ -} RSA_BUF_CRT_T; - -/* RSA working buffer for SCAP mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ - uint32_t au32RsaP[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaQ[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaTmpBlindKey[128]; /* The Temporary Value(blind key) of RSA SCAP. */ -} RSA_BUF_SCAP_T; - -/* RSA working buffer for CRT ( + CRT bypass ) + SCAP mode */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ - uint32_t au32RsaE[128]; /* The exponent of exponentiation words. */ - uint32_t au32RsaP[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaQ[128]; /* The Factor of Modulus Operation. */ - uint32_t au32RsaTmpCp[128]; /* The Temporary Value(Cp) of RSA CRT. */ - uint32_t au32RsaTmpCq[128]; /* The Temporary Value(Cq) of RSA CRT. */ - uint32_t au32RsaTmpDp[128]; /* The Temporary Value(Dp) of RSA CRT. */ - uint32_t au32RsaTmpDq[128]; /* The Temporary Value(Dq) of RSA CRT. */ - uint32_t au32RsaTmpRp[128]; /* The Temporary Value(Rp) of RSA CRT. */ - uint32_t au32RsaTmpRq[128]; /* The Temporary Value(Rq) of RSA CRT. */ - uint32_t au32RsaTmpBlindKey[128]; /* The Temporary Value(blind key) of RSA SCAP. */ -} RSA_BUF_CRT_SCAP_T; - -/* RSA working buffer for using key store */ -typedef struct -{ - uint32_t au32RsaOutput[128]; /* The RSA answer. */ - uint32_t au32RsaN[128]; /* The base of modulus operation word. */ - uint32_t au32RsaM[128]; /* The base of exponentiation words. */ -} RSA_BUF_KS_T; - -/**@}*/ /* end of group CRYPTO_EXPORTED_CONSTANTS */ - - -/** @addtogroup CRYPTO_EXPORTED_MACROS CRYPTO Exported Macros - @{ -*/ - -/*----------------------------------------------------------------------------------------------*/ -/* Macros */ -/*----------------------------------------------------------------------------------------------*/ - -/** - * @brief This macro enables PRNG interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define PRNG_ENABLE_INT(crpt) ((crpt)->INTEN |= CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro disables PRNG interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define PRNG_DISABLE_INT(crpt) ((crpt)->INTEN &= ~CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro gets PRNG interrupt flag. - * @param crpt Specified crypto module - * @return PRNG interrupt flag. - * \hideinitializer - */ -#define PRNG_GET_INT_FLAG(crpt) ((crpt)->INTSTS & CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro clears PRNG interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define PRNG_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro enables AES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro disables AES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro gets AES interrupt flag. - * @param crpt Specified crypto module - * @return AES interrupt flag. - * \hideinitializer - */ -#define AES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro clears AES interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro enables AES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL |= CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables AES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL = ((crpt)->AES_CTL & ~CRPT_AES_CTL_KEYPRT_Msk) | (0x16UL<AES_CTL &= ~CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro enables TDES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESEIEN_Msk)) - -/** - * @brief This macro disables TDES interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESEIEN_Msk)) - -/** - * @brief This macro gets TDES interrupt flag. - * @param crpt Specified crypto module - * @return TDES interrupt flag. - * \hideinitializer - */ -#define TDES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESEIF_Msk)) - -/** - * @brief This macro clears TDES interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESEIF_Msk)) - -/** - * @brief This macro enables TDES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_ENABLE_KEY_PROTECT(crpt) ((crpt)->TDES_CTL |= CRPT_TDES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables TDES key protection. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_KEY_PROTECT(crpt) ((crpt)->TDES_CTL = ((crpt)->TDES_CTL & ~CRPT_TDES_CTL_KEYPRT_Msk) | (0x16UL<TDES_CTL &= ~CRPT_TDES_CTL_KEYPRT_Msk) - -/** - * @brief This macro enables SHA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define SHA_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro disables SHA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define SHA_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro gets SHA interrupt flag. - * @param crpt Specified crypto module - * @return SHA interrupt flag. - * \hideinitializer - */ -#define SHA_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro clears SHA interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define SHA_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro enables ECC interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define ECC_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro disables ECC interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define ECC_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro gets ECC interrupt flag. - * @param crpt Specified crypto module - * @return ECC interrupt flag. - * \hideinitializer - */ -#define ECC_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - -/** - * @brief This macro clears ECC interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define ECC_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - -/** - * @brief This macro enables RSA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define RSA_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_RSAIEN_Msk|CRPT_INTEN_RSAEIEN_Msk)) - -/** - * @brief This macro disables RSA interrupt. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define RSA_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_RSAIEN_Msk|CRPT_INTEN_RSAEIEN_Msk)) - -/** - * @brief This macro gets RSA interrupt flag. - * @param crpt Specified crypto module - * @return ECC interrupt flag. - * \hideinitializer - */ -#define RSA_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_RSAIF_Msk|CRPT_INTSTS_RSAEIF_Msk)) - -/** - * @brief This macro clears RSA interrupt flag. - * @param crpt Specified crypto module - * @return None - * \hideinitializer - */ -#define RSA_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_RSAIF_Msk|CRPT_INTSTS_RSAEIF_Msk)) - - -/**@}*/ /* end of group CRYPTO_EXPORTED_MACROS */ - - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed); -int32_t PRNG_Start(CRPT_T *crpt); -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]); -void AES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType); -void AES_Start(CRPT_T *crpt, int32_t u32Channel, uint32_t u32DMAMode); -void AES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize); -void AES_SetKey_KS(CRPT_T *crpt, KS_MEM_Type mem, int32_t i32KeyIdx); -void AES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32IV[]); -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt); -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len); -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode); -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt); -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]); -void ECC_DriverISR(CRPT_T *crpt); -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]); -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]); -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]); -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *d, char *k, char *R, char *S); -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *public_k1, char *public_k2, char *R, char *S); - - -int32_t RSA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32KeySize, void *psRSA_Buf, uint32_t u32BufSize, uint32_t u32UseKS); -int32_t RSA_SetKey(CRPT_T *crpt, char *Key); -int32_t RSA_SetDMATransfer(CRPT_T *crpt, char *Src, char *n, char *P, char *Q); -void RSA_Start(CRPT_T *crpt); -int32_t RSA_Read(CRPT_T *crpt, char *Output); -int32_t RSA_SetKey_KS(CRPT_T *crpt, uint32_t u32KeyNum, uint32_t u32KSMemType, uint32_t u32BlindKeyNum); -int32_t RSA_SetDMATransfer_KS(CRPT_T *crpt, char *Src, char *n, uint32_t u32PNum, - uint32_t u32QNum, uint32_t u32CpNum, uint32_t u32CqNum, uint32_t u32DpNum, - uint32_t u32DqNum, uint32_t u32RpNum, uint32_t u32RqNum); -int32_t ECC_GeneratePublicKey_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[], uint32_t u32ExtraOp); -int32_t ECC_GenerateSignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_d, int32_t i32KeyIdx_d, KS_MEM_Type mem_k, int32_t i32KeyIdx_k, char *R, char *S); -int32_t ECC_VerifySignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_pk1, int32_t i32KeyIdx_pk1, KS_MEM_Type mem_pk2, int32_t i32KeyIdx_pk2, char *R, char *S); -int32_t ECC_GenerateSecretZ_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[]); - -void CRPT_Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]); -void CRPT_Hex2Reg(char input[], uint32_t volatile reg[]); -int32_t ECC_GetCurve(CRPT_T *crpt, E_ECC_CURVE ecc_curve, ECC_CURVE *curve); - -/**@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRYPTO_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CRYPTO_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_dac.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_dac.h deleted file mode 100644 index 1f78c6bae87..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_dac.h +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************//** - * @file nu_dac.h - * @version V1.00 - * @brief DAC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_DAC_H__ -#define __NU_DAC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DAC_Driver DAC Driver - @{ -*/ - - -/** @addtogroup DAC_EXPORTED_CONSTANTS DAC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* DAC_CTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define DAC_CTL_LALIGN_RIGHT_ALIGN (0UL<SWTRG = DAC_SWTRG_SWTRG_Msk) - -/** - * @brief Enable DAC data left-aligned. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details User has to load data into DAC_DAT[15:4] bits. DAC_DAT[31:16] and DAC_DAT[3:0] are ignored in DAC conversion. - * \hideinitializer - */ -#define DAC_ENABLE_LEFT_ALIGN(dac) ((dac)->CTL |= DAC_CTL_LALIGN_Msk) - -/** - * @brief Enable DAC data right-aligned. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details User has to load data into DAC_DAT[11:0] bits, DAC_DAT[31:12] are ignored in DAC conversion. - * \hideinitializer - */ -#define DAC_ENABLE_RIGHT_ALIGN(dac) ((dac)->CTL &= ~DAC_CTL_LALIGN_Msk) - -/** - * @brief Enable output voltage buffer. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details The DAC integrates a voltage output buffer that can be used to reduce output impedance and - * drive external loads directly without having to add an external operational amplifier. - * \hideinitializer - */ -#define DAC_ENABLE_BYPASS_BUFFER(dac) ((dac)->CTL |= DAC_CTL_BYPASS_Msk) - -/** - * @brief Disable output voltage buffer. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to disable output voltage buffer. - * \hideinitializer - */ -#define DAC_DISABLE_BYPASS_BUFFER(dac) ((dac)->CTL &= ~DAC_CTL_BYPASS_Msk) - -/** - * @brief Enable the interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @return None - * @details This macro is used to enable DAC interrupt. - * \hideinitializer - */ -#define DAC_ENABLE_INT(dac, u32Ch) ((dac)->CTL |= DAC_CTL_DACIEN_Msk) - -/** - * @brief Disable the interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @return None - * @details This macro is used to disable DAC interrupt. - * \hideinitializer - */ -#define DAC_DISABLE_INT(dac, u32Ch) ((dac)->CTL &= ~DAC_CTL_DACIEN_Msk) - -/** - * @brief Enable DMA under-run interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to enable DMA under-run interrupt. - * \hideinitializer - */ -#define DAC_ENABLE_DMAUDR_INT(dac) ((dac)->CTL |= DAC_CTL_DMAURIEN_Msk) - -/** - * @brief Disable DMA under-run interrupt. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to disable DMA under-run interrupt. - * \hideinitializer - */ -#define DAC_DISABLE_DMAUDR_INT(dac) ((dac)->CTL &= ~DAC_CTL_DMAURIEN_Msk) - -/** - * @brief Enable PDMA mode. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details DAC DMA request is generated when a hardware trigger event occurs while DMAEN (DAC_CTL[2]) is set. - * \hideinitializer - */ -#define DAC_ENABLE_PDMA(dac) ((dac)->CTL |= DAC_CTL_DMAEN_Msk) - -/** - * @brief Disable PDMA mode. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details This macro is used to disable DMA mode. - * \hideinitializer - */ -#define DAC_DISABLE_PDMA(dac) ((dac)->CTL &= ~DAC_CTL_DMAEN_Msk) - -/** - * @brief Write data for conversion. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @param[in] u32Data Decides the data for conversion, valid range are between 0~0xFFF. - * @return None - * @details 12 bit left alignment: user has to load data into DAC_DAT[15:4] bits. - * 12 bit right alignment: user has to load data into DAC_DAT[11:0] bits. - * \hideinitializer - */ -#define DAC_WRITE_DATA(dac, u32Ch, u32Data) ((dac)->DAT = (u32Data)) - -/** - * @brief Read DAC 12-bit holding data. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @return Return DAC 12-bit holding data. - * @details This macro is used to read DAC_DAT register. - * \hideinitializer - */ -#define DAC_READ_DATA(dac, u32Ch) ((dac)->DAT) - -/** - * @brief Get the busy state of DAC. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @retval 0 Idle state. - * @retval 1 Busy state. - * @details This macro is used to read BUSY bit (DAC_STATUS[8]) to get busy state. - * \hideinitializer - */ -#define DAC_IS_BUSY(dac, u32Ch) (((dac)->STATUS & DAC_STATUS_BUSY_Msk) >> DAC_STATUS_BUSY_Pos) - -/** - * @brief Get the interrupt flag. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @retval 0 DAC is in conversion state. - * @retval 1 DAC conversion finish. - * @details This macro is used to read FINISH bit (DAC_STATUS[0]) to get DAC conversion complete finish flag. - * \hideinitializer - */ -#define DAC_GET_INT_FLAG(dac, u32Ch) ((dac)->STATUS & DAC_STATUS_FINISH_Msk) - -/** - * @brief Get the DMA under-run flag. - * @param[in] dac The pointer of the specified DAC module. - * @retval 0 No DMA under-run error condition occurred. - * @retval 1 DMA under-run error condition occurred. - * @details This macro is used to read DMAUDR bit (DAC_STATUS[1]) to get DMA under-run state. - * \hideinitializer - */ -#define DAC_GET_DMAUDR_FLAG(dac) (((dac)->STATUS & DAC_STATUS_DMAUDR_Msk) >> DAC_STATUS_DMAUDR_Pos) - -/** - * @brief This macro clear the interrupt status bit. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @return None - * @details User writes FINISH bit (DAC_STATUS[0]) to clear DAC conversion complete finish flag. - * \hideinitializer - */ -#define DAC_CLR_INT_FLAG(dac, u32Ch) ((dac)->STATUS = DAC_STATUS_FINISH_Msk) - -/** - * @brief This macro clear the DMA under-run flag. - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @details User writes DMAUDR bit (DAC_STATUS[1]) to clear DMA under-run flag. - * \hideinitializer - */ -#define DAC_CLR_DMAUDR_FLAG(dac) ((dac)->STATUS = DAC_STATUS_DMAUDR_Msk) - - -/** - * @brief Enable DAC group mode - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @note Only DAC0 has this control bit. - * \hideinitializer - */ -#define DAC_ENABLE_GROUP_MODE(dac) ((dac)->CTL |= DAC_CTL_GRPEN_Msk) - -/** - * @brief Disable DAC group mode - * @param[in] dac The pointer of the specified DAC module. - * @return None - * @note Only DAC0 has this control bit. - * \hideinitializer - */ -#define DAC_DISABLE_GROUP_MODE(dac) ((dac)->CTL &= ~DAC_CTL_GRPEN_Msk) - -void DAC_Open(DAC_T *dac, uint32_t u32Ch, uint32_t u32TrgSrc); -void DAC_Close(DAC_T *dac, uint32_t u32Ch); -uint32_t DAC_SetDelayTime(DAC_T *dac, uint32_t u32Delay); - -/*@}*/ /* end of group DAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group DAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_DAC_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eadc.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eadc.h deleted file mode 100644 index ab0f950b524..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eadc.h +++ /dev/null @@ -1,728 +0,0 @@ -/**************************************************************************//** - * @file nu_eadc.h - * @version V0.10 - * @brief EADC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_EADC_H__ -#define __NU_EADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_CONSTANTS EADC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EADC_CTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EADC_CTL_DIFFEN_SINGLE_END (0UL<CTL |= EADC_CTL_ADCRST_Msk) - -/** - * @brief Enable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details When A/D conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, - * user can enable this bit to generate a PDMA data transfer request. - * \hideinitializer - */ -#define EADC_ENABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL |= u32ModuleMask) - -/** - * @brief Disable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details This macro is used to disable sample module PDMA transfer. - * \hideinitializer - */ -#define EADC_DISABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL &= (~u32ModuleMask)) - -/** - * @brief Enable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details The EADC controller supports a double buffer mode in sample module 0~3. - * If user enable DBMEN (EADC_SCTLn[23], n=0~3), the double buffer mode will enable. - * \hideinitializer - */ -#define EADC_ENABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_DBMEN_Msk) - -/** - * @brief Disable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details Sample has one sample result register. - * \hideinitializer - */ -#define EADC_DISABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_DBMEN_Msk) - -/** - * @brief Set ADIFn at A/D end of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the start of conversion. - * \hideinitializer - */ -#define EADC_ENABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_INTPOS_Msk) - -/** - * @brief Set ADIFn at A/D start of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the end of conversion. - * \hideinitializer - */ -#define EADC_DISABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_INTPOS_Msk) - -/** - * @brief Enable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be enabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details The A/D converter generates a conversion end ADIFn (EADC_STATUS2[n]) upon the end of specific sample module A/D conversion. - * If ADCIENn bit (EADC_CTL[n+2]) is set then conversion end interrupt request ADINTn is generated (n=0~3). - * \hideinitializer - */ -#define EADC_ENABLE_INT(eadc, u32Mask) ((eadc)->CTL |= ((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Disable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be disabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details Specific sample module A/D ADINT0 interrupt function Disabled. - * \hideinitializer - */ -#define EADC_DISABLE_INT(eadc, u32Mask) ((eadc)->CTL &= ~((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Enable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be enabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 EADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - * \hideinitializer - */ -#define EADC_ENABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] |= (u32ModuleMask)) - -/** - * @brief Disable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 EADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - * \hideinitializer - */ -#define EADC_DISABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] &= (uint32_t)(~(u32ModuleMask))) - -/** - * @brief Set the input mode output format. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Format Decides the output format. Valid values are: - * - \ref EADC_CTL_DMOF_STRAIGHT_BINARY :Select the straight binary format as the output format of the conversion result. - * - \ref EADC_CTL_DMOF_TWOS_COMPLEMENT :Select the 2's complement format as the output format of the conversion result. - * @return None - * @details The macro is used to set A/D input mode output format. - * \hideinitializer - */ -#define EADC_SET_DMOF(eadc, u32Format) ((eadc)->CTL = ((eadc)->CTL & ~EADC_CTL_DMOF_Msk) | (u32Format)) - -/** - * @brief Start the A/D conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will be conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module 18. - * @return None - * @details After write EADC_SWTRG register to start EADC conversion, the EADC_PENDSTS register will show which SAMPLE will conversion. - * \hideinitializer - */ -#define EADC_START_CONV(eadc, u32ModuleMask) ((eadc)->SWTRG = (u32ModuleMask)) - -/** - * @brief Cancel the conversion for sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will stop the conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module18. - * @return None - * @details If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - * \hideinitializer - */ -#define EADC_STOP_CONV(eadc, u32ModuleMask) ((eadc)->PENDSTS = (u32ModuleMask)) - -/** - * @brief Get the conversion pending flag. - * @param[in] eadc The pointer of the specified EADC module. - * @return Return the conversion pending sample module. - * @details This STPFn(EADC_PENDSTS[18:0]) bit remains 1 during pending state, when the respective ADC conversion is end, - * the STPFn (n=0~18) bit is automatically cleared to 0. - * \hideinitializer - */ -#define EADC_GET_PENDING_CONV(eadc) ((eadc)->PENDSTS) - -/** - * @brief Get the conversion data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the conversion data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DATn[15:0], n=0~18) field to get conversion data. - * \hideinitializer - */ -#define EADC_GET_CONV_DATA(eadc, u32ModuleNum) ((eadc)->DAT[(u32ModuleNum)] & EADC_DAT_RESULT_Msk) - -/** - * @brief Get the data overrun flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data overrun status bits. Each bit corresponds to a data overrun status, valid range are between 1~0x7FFFF. - * @return Return the data overrun flag of the user-specified sample module. - * @details This macro is used to read OV bit (EADC_STATUS0[31:16], EADC_STATUS1[18:16]) field to get data overrun status. - * \hideinitializer - */ -#define EADC_GET_DATA_OVERRUN_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 >> EADC_STATUS0_OV_Pos) | ((eadc)->STATUS1 & EADC_STATUS1_OV_Msk)) & (u32ModuleMask)) - -/** - * @brief Get the data valid flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data valid status bits. Each bit corresponds to a data valid status, valid range are between 1~0x7FFFF. - * @return Return the data valid flag of the user-specified sample module. - * @details This macro is used to read VALID bit (EADC_STATUS0[15:0], EADC_STATUS1[2:0]) field to get data valid status. - * \hideinitializer - */ -#define EADC_GET_DATA_VALID_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 & EADC_STATUS0_VALID_Msk) | (((eadc)->STATUS1 & EADC_STATUS1_VALID_Msk) << 16)) & (u32ModuleMask)) - -/** - * @brief Get the double data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the double data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DDATn[15:0], n=0~3) field to get conversion data. - * \hideinitializer - */ -#define EADC_GET_DOUBLE_DATA(eadc, u32ModuleNum) ((eadc)->DDAT[(u32ModuleNum)] & EADC_DDAT0_RESULT_Msk) - -/** - * @brief Get the user-specified interrupt flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of interrupt status bits. Each bit corresponds to a interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return Return the user-specified interrupt flags. - * @details This macro is used to get the user-specified interrupt flags. - * \hideinitializer - */ -#define EADC_GET_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 & (u32Mask)) - -/** - * @brief Get the user-specified sample module overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status, valid range are between 1~0x7FFFF. - * @return Return the user-specified sample module overrun flags. - * @details This macro is used to get the user-specified sample module overrun flags. - * \hideinitializer - */ -#define EADC_GET_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS & (u32ModuleMask)) - -/** - * @brief Clear the selected interrupt status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of compare interrupt status bits. Each bit corresponds to a compare interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return None - * @details This macro is used to clear clear the selected interrupt status bits. - * \hideinitializer - */ -#define EADC_CLR_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 = (u32Mask)) - -/** - * @brief Clear the selected sample module overrun status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status. - * Bit 0 is SPOVF0, bit 1 is SPOVF1..., bit 18 is SPOVF18. - * @return None - * @details This macro is used to clear the selected sample module overrun status bits. - * \hideinitializer - */ -#define EADC_CLR_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS = (u32ModuleMask)) - -/** - * @brief Check all sample module A/D result data register overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register overrun flag is set to 1. - * @retval 1 Any one of sample module data register overrun flag is set to 1. - * @details The AOV bit (EADC_STATUS2[27]) will keep 1 when any one of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_DATA_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AOV_Msk) >> EADC_STATUS2_AOV_Pos) - -/** - * @brief Check all sample module A/D result data register valid flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register valid flag is set to 1. - * @retval 1 Any one of sample module data register valid flag is set to 1. - * @details The AVALID bit (EADC_STATUS2[26]) will keep 1 when any one of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_DATA_VALID(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AVALID_Msk) >> EADC_STATUS2_AVALID_Pos) - -/** - * @brief Check all A/D sample module start of conversion overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module event overrun flag is set to 1. - * @retval 1 Any one of sample module event overrun flag is set to 1. - * @details The STOVF bit (EADC_STATUS2[25]) will keep 1 when any one of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_SAMPLE_MODULE_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_STOVF_Msk) >> EADC_STATUS2_STOVF_Pos) - -/** - * @brief Check all A/D interrupt flag overrun bits. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of ADINT interrupt flag is overwritten to 1. - * @retval 1 Any one of ADINT interrupt flag is overwritten to 1. - * @details The ADOVIF bit (EADC_STATUS2[24]) will keep 1 when any one of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * \hideinitializer - */ -#define EADC_IS_INT_FLAG_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_ADOVIF_Msk) >> EADC_STATUS2_ADOVIF_Pos) - -/** - * @brief Get the busy state of EADC. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 Idle state. - * @retval 1 Busy state. - * @details This macro is used to read BUSY bit (EADC_STATUS2[23]) to get busy state. - * \hideinitializer - */ -#define EADC_IS_BUSY(eadc) (((eadc)->STATUS2 & EADC_STATUS2_BUSY_Msk) >> EADC_STATUS2_BUSY_Pos) - -/** - * @brief Configure the comparator 0 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP0(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 0 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP0(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[0] = (((eadc)->CMP[0] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 1 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP1(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 1 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP1(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[1] = (((eadc)->CMP[1] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 2 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP2(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 2 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP2(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[2] = (((eadc)->CMP[2] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 3 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 1~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP3(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 3 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP3(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[3] = (((eadc)->CMP[3] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Enable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched. - * \hideinitializer - */ -#define EADC_ENABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_CMPWEN_Msk) - -/** - * @brief Disable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * \hideinitializer - */ -#define EADC_DISABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_CMPWEN_Msk) - -/** - * @brief Enable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) - * and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, - * if ADCMPIE is set to 1, a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details This macro is used to disable the compare interrupt. - * \hideinitializer - */ -#define EADC_DISABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable comparator 0. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 0. - * \hideinitializer - */ -#define EADC_DISABLE_CMP0(eadc) ((eadc)->CMP[0] = 0UL) - -/** - * @brief Disable comparator 1. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 1. - * \hideinitializer - */ -#define EADC_DISABLE_CMP1(eadc) ((eadc)->CMP[1] = 0UL) - -/** - * @brief Disable comparator 2. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 2. - * \hideinitializer - */ -#define EADC_DISABLE_CMP2(eadc) ((eadc)->CMP[2] = 0UL) - -/** - * @brief Disable comparator 3. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 3. - * \hideinitializer - */ -#define EADC_DISABLE_CMP3(eadc) ((eadc)->CMP[3] = 0UL) - -/** - * @brief Enable conversion result left alignment. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 23. - * @return None - * @details The 12-bit conversion result will be left aligned and stored in EADC_DATn[15:4] (n=0~23). - * \hideinitializer - */ -#define EADC_ENABLE_LEFT_ALIGN(eadc, u32ModuleNum) ((((eadc)->MCTL1[(u32ModuleNum)])) |= EADC_MCTL1_ALIGN_Msk) - -/** - * @brief Disable conversion result left alignment. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 23. - * @return None - * @details The 12-bit conversion result will be right aligned and stored in EADC_DATn[11:0] (n=0~23). - * \hideinitializer - */ -#define EADC_DISABLE_LEFT_ALIGN(eadc, u32ModuleNum) ((((eadc)->MCTL1[(u32ModuleNum)])) &= (~EADC_MCTL1_ALIGN_Msk)) - -/** - * @brief Enable average mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 23. - * @return None - * @details Conversion results in data register will be averaged. - * @note This average mode needs to work with accumulated mode that configured by ACU (EADC_MnCTL1[7:4], n=0~23) bit field. - * \hideinitializer - */ -#define EADC_ENABLE_AVG(eadc, u32ModuleNum) ((((eadc)->MCTL1[(u32ModuleNum)])) |= EADC_MCTL1_AVG_Msk) - -/** - * @brief Disable average mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 23. - * @return None - * @details Conversion results in data register will not be averaged. - * \hideinitializer - */ -#define EADC_DISABLE_AVG(eadc, u32ModuleNum) ((((eadc)->MCTL1[(u32ModuleNum)])) &= (~EADC_MCTL1_AVG_Msk)) - -/** - * @brief Configure the Accumulation feature and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 23. - * @param[in] u16ACUNum specifies the number of accumulation, valid values are - * - \ref EADC_MCTL1_ACU_1 : 1 conversion result will be accumulated. - * - \ref EADC_MCTL1_ACU_2 : 2 conversion result will be accumulated. - * - \ref EADC_MCTL1_ACU_4 : 4 conversion result will be accumulated. - * - \ref EADC_MCTL1_ACU_8 : 8 conversion result will be accumulated. - * - \ref EADC_MCTL1_ACU_16 : 16 conversion result will be accumulated. - * - \ref EADC_MCTL1_ACU_32 : 32 conversion result will be accumulated. The result is right shift 1 bit to fit within the available 16-bit register size. - * - \ref EADC_MCTL1_ACU_64 : 64 conversion result will be accumulated. The result is right shift 2 bits to fit within the available 16-bit register size. - * - \ref EADC_MCTL1_ACU_128 : 128 conversion result will be accumulated. The result is right shift 3 bits to fit within the available 16-bit register size. - * - \ref EADC_MCTL1_ACU_256 : 256 conversion result will be accumulated. The result is right shift 4 bits to fit within the available 16-bit register size. - * @return None - * @details When accumulating more than 16 samples, the result will be too large to match the - * 16-bit RESULT register size (EADC_DATn[15:0]. To avoid overflow, the result is - * right shifted automatically to fit within the available 16-bit register size. - * The number of automatic right shifts is specified in parameter list above. - * \hideinitializer - */ -#define EADC_ENABLE_ACU(eadc,\ - u32ModuleNum,\ - u16ACUNum) ((((eadc)->MCTL1[(u32ModuleNum)])) = (((((eadc)->MCTL1[(u32ModuleNum)])) & (~EADC_MCTL1_ACU_Msk)) |\ - (u16ACUNum))) - -/** - * @brief Disable the Accumulation feature. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 23. - * @return None - * \hideinitializer - */ -#define EADC_DISABLE_ACU(eadc, u32ModuleNum) ((((eadc)->MCTL1[(u32ModuleNum)])) &= (~EADC_MCTL1_ACU_Msk)) - -/** - * @brief Set start of conversion interrupt delay cycle. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32DelayCycle Decides the interrupt delay cycle, valid value are from 0 to 15. - * @return None - * @details Select EADC start of conversion interrupt ADINT0 to ADINT3 delay cycle(s). - * @note This function is workable only when any one of INTPOS (EADC_SCTLx[5]), x=0~15 is set. - * \hideinitializer - */ -#define EADC_SET_INT_DELAY(eadc, u32IntSel, u32DelayCycle) ((eadc)->CTL = ((eadc)->CTL & ~(0xFUL << (EADC_CTL_INTDELAY0_Pos + ((u32IntSel) << 2)))) | \ - ((u32DelayCycle) << (EADC_CTL_INTDELAY0_Pos + ((u32IntSel) << 2)))) - -/** - * @brief Enable comparetor to trigger EPWM brake. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CmpSel Decides which comparator will be used, valid value are from 0 to 3. - * @return None - * @details Enable EADC comparator 0 to 3 can trigger EPWM brake. - * \hideinitializer - */ -#define EADC_ENABLE_CMP_TRIGGER_BRAKE(eadc, u32CmpSel) ((eadc)->CTL1 |= (1UL << (EADC_CTL1_CMP0TRG_Pos + (u32CmpSel)))) - -/** - * @brief Disable comparetor to trigger EPWM brake. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CmpSel Decides which comparator will be disabled, valid value are from 0 to 3. - * @return None - * @details Disable EADC comparator 0 to 3 trigger EPWM brake. - * \hideinitializer - */ -#define EADC_DISABLE_CMP_TRIGGER_BRAKE(eadc, u32CmpSel) ((eadc)->CTL1 &= (~(1UL << (EADC_CTL1_CMP0TRG_Pos + (u32CmpSel))))) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EADC functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode); -void EADC_Close(EADC_T *eadc); -void EADC_ConfigSampleModule(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerSrc, uint32_t u32Channel); -void EADC_SetTriggerDelayTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerDelayTime, uint32_t u32DelayClockDivider); -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime); - -/*@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EADC_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ebi.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ebi.h deleted file mode 100644 index b7f8e4dcb50..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ebi.h +++ /dev/null @@ -1,350 +0,0 @@ -/**************************************************************************//** - * @file nu_ebi.h - * @version V3.00 - * @brief External Bus Interface(EBI) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EBI_H__ -#define __NU_EBI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_CONSTANTS EBI Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0_BASE_ADDR 0x60000000UL /*!< EBI bank0 base address \hideinitializer */ -#define EBI_BANK1_BASE_ADDR 0x60100000UL /*!< EBI bank1 base address \hideinitializer */ -#define EBI_BANK2_BASE_ADDR 0x60200000UL /*!< EBI bank2 base address \hideinitializer */ -#define EBI_MAX_SIZE 0x00100000UL /*!< Maximum EBI size for each bank is 1 MB \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI bank number */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0 0UL /*!< EBI bank 0 \hideinitializer */ -#define EBI_BANK1 1UL /*!< EBI bank 1 \hideinitializer */ -#define EBI_BANK2 2UL /*!< EBI bank 2 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI data bus width */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BUSWIDTH_8BIT 8UL /*!< EBI bus width is 8-bit \hideinitializer */ -#define EBI_BUSWIDTH_16BIT 16UL /*!< EBI bus width is 16-bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI CS Active Level */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_CS_ACTIVE_LOW 0UL /*!< EBI CS active level is low \hideinitializer */ -#define EBI_CS_ACTIVE_HIGH 1UL /*!< EBI CS active level is high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI MCLK divider and Timing */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_MCLKDIV_1 0x0UL /*!< EBI output clock(MCLK) is HCLK/1 \hideinitializer */ -#define EBI_MCLKDIV_2 0x1UL /*!< EBI output clock(MCLK) is HCLK/2 \hideinitializer */ -#define EBI_MCLKDIV_4 0x2UL /*!< EBI output clock(MCLK) is HCLK/4 \hideinitializer */ -#define EBI_MCLKDIV_8 0x3UL /*!< EBI output clock(MCLK) is HCLK/8 \hideinitializer */ -#define EBI_MCLKDIV_16 0x4UL /*!< EBI output clock(MCLK) is HCLK/16 \hideinitializer */ -#define EBI_MCLKDIV_32 0x5UL /*!< EBI output clock(MCLK) is HCLK/32 \hideinitializer */ -#define EBI_MCLKDIV_64 0x6UL /*!< EBI output clock(MCLK) is HCLK/64 \hideinitializer */ -#define EBI_MCLKDIV_128 0x7UL /*!< EBI output clock(MCLK) is HCLK/128 \hideinitializer */ - -#define EBI_TIMING_FASTEST 0x0UL /*!< EBI timing is the fastest \hideinitializer */ -#define EBI_TIMING_VERYFAST 0x1UL /*!< EBI timing is very fast \hideinitializer */ -#define EBI_TIMING_FAST 0x2UL /*!< EBI timing is fast \hideinitializer */ -#define EBI_TIMING_NORMAL 0x3UL /*!< EBI timing is normal \hideinitializer */ -#define EBI_TIMING_SLOW 0x4UL /*!< EBI timing is slow \hideinitializer */ -#define EBI_TIMING_VERYSLOW 0x5UL /*!< EBI timing is very slow \hideinitializer */ -#define EBI_TIMING_SLOWEST 0x6UL /*!< EBI timing is the slowest \hideinitializer */ - -#define EBI_OPMODE_NORMAL 0x0UL /*!< EBI bus operate in normal mode \hideinitializer */ -#define EBI_OPMODE_CACCESS (EBI_CTL_CACCESS_Msk) /*!< EBI bus operate in Continuous Data Access mode \hideinitializer */ -#define EBI_OPMODE_ADSEPARATE (EBI_CTL_ADSEPEN_Msk) /*!< EBI bus operate in AD Separate mode \hideinitializer */ - -/**@}*/ /* end of group EBI_EXPORTED_CONSTANTS */ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Read 8-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Enable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to improve EBI write operation for all EBI banks. - * \hideinitializer - */ -#define EBI_ENABLE_WRITE_BUFFER() (EBI->CTL0 |= EBI_CTL_WBUFEN_Msk); - -/** - * @brief Disable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to disable EBI write buffer function. - * \hideinitializer - */ -#define EBI_DISABLE_WRITE_BUFFER() (EBI->CTL0 &= ~EBI_CTL_WBUFEN_Msk); - -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel); -void EBI_Close(uint32_t u32Bank); -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv); - -/**@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EBI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EBI_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ecap.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ecap.h deleted file mode 100644 index 3684ea8eeb6..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_ecap.h +++ /dev/null @@ -1,458 +0,0 @@ -/**************************************************************************//** - * @file nu_ecap.h - * @version V3.00 - * @brief EnHanced Input Capture Timer(ECAP) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_ECAP_H__ -#define __NU_ECAP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_CONSTANTS ECAP Exported Constants - @{ -*/ - -#define ECAP_IC0 (0UL) /*!< ECAP IC0 Unit \hideinitializer */ -#define ECAP_IC1 (1UL) /*!< ECAP IC1 Unit \hideinitializer */ -#define ECAP_IC2 (2UL) /*!< ECAP IC2 Unit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ECAP CTL0 constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ECAP_NOISE_FILTER_CLKDIV_1 (0UL<CTL0 = ((ecap)->CTL0 & ~ECAP_CTL0_NFCLKSEL_Msk)|(u32ClkSel)) - -/** - * @brief This macro is used to disable noise filter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the noise filter of input capture. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_DISABLE(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPNFDIS_Msk) - -/** - * @brief This macro is used to enable noise filter - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSel Select noise filter clock divide number - * - \ref ECAP_NOISE_FILTER_CLKDIV_1 - * - \ref ECAP_NOISE_FILTER_CLKDIV_2 - * - \ref ECAP_NOISE_FILTER_CLKDIV_4 - * - \ref ECAP_NOISE_FILTER_CLKDIV_16 - * - \ref ECAP_NOISE_FILTER_CLKDIV_32 - * - \ref ECAP_NOISE_FILTER_CLKDIV_64 - * @return None - * @details This macro will enable the noise filter of input capture and set noise filter clock divide. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_ENABLE(ecap, u32ClkSel) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPNFDIS_Msk|ECAP_CTL0_NFCLKSEL_Msk))|(u32ClkSel)) - -/** - * @brief This macro is used to enable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will enable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_ENABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will disable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_DISABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to select input channel source - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Src The input source - * - \ref ECAP_CAP_INPUT_SRC_FROM_IC - * - \ref ECAP_CAP_INPUT_SRC_FROM_CH - * @return None - * @details This macro will select the input source from ICx, CHx. - * \hideinitializer - */ -#define ECAP_SEL_INPUT_SRC(ecap, u32Index, u32Src) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPSEL0_Msk<<((u32Index)<<1)))|(((u32Src)<CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return None - * @details This macro will disable the input channel_n interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_INT(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to enable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_OVF_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to disable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_OVF_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to enable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to disable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to start capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will start capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_START(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to stop capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will stop capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_STOP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to set event to clear capture counter - * @param[in] ecap Specify ECAP port - * @param[in] u32Event The input channel number - * - \ref ECAP_CTL0_CMPCLREN_Msk - * - \ref ECAP_CTL1_CAP0RLDEN_Msk - * - \ref ECAP_CTL1_CAP1RLDEN_Msk - * - \ref ECAP_CTL1_CAP2RLDEN_Msk - * - \ref ECAP_CTL1_OVRLDEN_Msk - - * @return None - * @details This macro will enable and select compare or capture event that can clear capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CLEAR_EVENT(ecap, u32Event) do{ \ - if((u32Event) & ECAP_CTL0_CMPCLREN_Msk) \ - (ecap)->CTL0 |= ECAP_CTL0_CMPCLREN_Msk; \ - else \ - (ecap)->CTL0 &= ~ECAP_CTL0_CMPCLREN_Msk; \ - (ecap)->CTL1 = ((ecap)->CTL1 &~0xF00) | ((u32Event) & 0xF00); \ - }while(0); - -/** - * @brief This macro is used to enable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the compare function. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to disable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the compare function. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to enable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_ENABLE_CNT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to disable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_DISABLE_CNT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to select input channel edge detection - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Edge The input source - * - \ref ECAP_RISING_EDGE - * - \ref ECAP_FALLING_EDGE - * - \ref ECAP_RISING_FALLING_EDGE - * @return None - * @details This macro will select input capture can detect falling edge, rising edge or either rising or falling edge change. - * \hideinitializer - */ -#define ECAP_SEL_CAPTURE_EDGE(ecap, u32Index, u32Edge) ((ecap)->CTL1 = ((ecap)->CTL1 & ~(ECAP_CTL1_EDGESEL0_Msk<<((u32Index)<<1)))|((u32Edge)<<((u32Index)<<1))) - -/** - * @brief This macro is used to select ECAP counter reload trigger source - * @param[in] ecap Specify ECAP port - * @param[in] u32TrigSrc The input source - * - \ref ECAP_CTL1_CAP0RLDEN_Msk - * - \ref ECAP_CTL1_CAP1RLDEN_Msk - * - \ref ECAP_CTL1_CAP2RLDEN_Msk - * - \ref ECAP_CTL1_OVRLDEN_Msk - * @return None - * @details This macro will select capture counter reload trigger source. - * \hideinitializer - */ -#define ECAP_SEL_RELOAD_TRIG_SRC(ecap, u32TrigSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~0xF00)|(u32TrigSrc)) - -/** - * @brief This macro is used to select capture timer clock divide. - * @param[in] ecap Specify ECAP port - * @param[in] u32Clkdiv The input source - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_1 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_4 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_16 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_32 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_64 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_96 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_112 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_128 - * @return None - * @details This macro will select capture timer clock has a pre-divider with eight divided option. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_DIV(ecap, u32Clkdiv) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CLKSEL_Msk)|(u32Clkdiv)) - -/** - * @brief This macro is used to select capture timer/counter clock source - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSrc The input source - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP_CLK - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP0 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP1 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP2 - * @return None - * @details This macro will select capture timer/clock clock source. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_SRC(ecap, u32ClkSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CNTSRCSEL_Msk)|(u32ClkSrc)) - -/** - * @brief This macro is used to read input capture status - * @param[in] ecap Specify ECAP port - * @return Input capture status flags - * @details This macro will get the input capture interrupt status. - * \hideinitializer - */ -#define ECAP_GET_INT_STATUS(ecap) ((ecap)->STATUS) - -/** - * @brief This macro is used to get input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to get the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_GET_CAPTURE_FLAG(ecap, u32Mask) (((ecap)->STATUS & (u32Mask))?1:0) - -/** - * @brief This macro is used to clear input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to clear the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_CLR_CAPTURE_FLAG(ecap, u32Mask) ((ecap)->STATUS = (u32Mask)) - -/** - * @brief This macro is used to set input capture counter value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Counter value - * @return None - * @details This macro will set a counter value of input capture. - * \hideinitializer - */ -#define ECAP_SET_CNT_VALUE(ecap, u32Val) ((ecap)->CNT = (u32Val)) - -/** - * @brief This macro is used to get input capture counter value - * @param[in] ecap Specify ECAP port - * @return Capture counter value - * @details This macro will get a counter value of input capture. - * \hideinitializer - */ -#define ECAP_GET_CNT_VALUE(ecap) ((ecap)->CNT) - -/** - * @brief This macro is used to get input capture counter hold value - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return Capture counter hold value - * @details This macro will get a hold value of input capture channel_n. - * \hideinitializer - */ -#define ECAP_GET_CNT_HOLD_VALUE(ecap, u32Index) (*(__IO uint32_t *) (&((ecap)->HLD0) + (u32Index))) - -/** - * @brief This macro is used to set input capture counter compare value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Input capture compare value - * @return None - * @details This macro will set a compare value of input capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CMP(ecap, u32Val) ((ecap)->CNTCMP = (u32Val)) - -void ECAP_Open(ECAP_T *ecap, uint32_t u32FuncMask); -void ECAP_Close(ECAP_T *ecap); -void ECAP_EnableINT(ECAP_T *ecap, uint32_t u32Mask); -void ECAP_DisableINT(ECAP_T *ecap, uint32_t u32Mask); -/*@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ECAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_ECAP_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_epwm.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_epwm.h deleted file mode 100644 index 742fb9411e0..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_epwm.h +++ /dev/null @@ -1,652 +0,0 @@ -/**************************************************************************//** - * @file nu_epwm.h - * @version V1.00 - * @brief EPWM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EPWM_H__ -#define __NU_EPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - -/** @addtogroup EPWM_EXPORTED_CONSTANTS EPWM Exported Constants - @{ -*/ -#define EPWM_CHANNEL_NUM (6U) /*!< EPWM channel number \hideinitializer */ -#define EPWM_CH_0_MASK (0x1U) /*!< EPWM channel 0 mask \hideinitializer */ -#define EPWM_CH_1_MASK (0x2U) /*!< EPWM channel 1 mask \hideinitializer */ -#define EPWM_CH_2_MASK (0x4U) /*!< EPWM channel 2 mask \hideinitializer */ -#define EPWM_CH_3_MASK (0x8U) /*!< EPWM channel 3 mask \hideinitializer */ -#define EPWM_CH_4_MASK (0x10U) /*!< EPWM channel 4 mask \hideinitializer */ -#define EPWM_CH_5_MASK (0x20U) /*!< EPWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_UP_COUNTER (0U) /*!< Up counter type \hideinitializer */ -#define EPWM_DOWN_COUNTER (1U) /*!< Down counter type \hideinitializer */ -#define EPWM_UP_DOWN_COUNTER (2U) /*!< Up-Down counter type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_EDGE_ALIGNED (1U) /*!< EPWM working in edge aligned type(down count) \hideinitializer */ -#define EPWM_CENTER_ALIGNED (2U) /*!< EPWM working in center aligned type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_OUTPUT_NOTHING (0U) /*!< EPWM output nothing \hideinitializer */ -#define EPWM_OUTPUT_LOW (1U) /*!< EPWM output low \hideinitializer */ -#define EPWM_OUTPUT_HIGH (2U) /*!< EPWM output high \hideinitializer */ -#define EPWM_OUTPUT_TOGGLE (3U) /*!< EPWM output toggle \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_SSCTL_SSRC_EPWM0 (0U<CTL1 = (epwm)->CTL1 | (0x7ul<CTL1 = (epwm)->CTL1 & ~(0x7ul<CTL0 = (epwm)->CTL0 | EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief This macro disable group mode - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to disable group mode of EPWM module. - * \hideinitializer - */ -#define EPWM_DISABLE_GROUP_MODE(epwm) ((epwm)->CTL0 = (epwm)->CTL0 & ~EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief Enable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32SyncSrc Synchronous start source selection, valid values are: - * - \ref EPWM_SSCTL_SSRC_EPWM0 - * - \ref EPWM_SSCTL_SSRC_EPWM1 - * - \ref EPWM_SSCTL_SSRC_BPWM0 - * - \ref EPWM_SSCTL_SSRC_BPWM1 - * @return None - * @details This macro is used to enable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_TIMER_SYNC(epwm, u32ChannelMask, u32SyncSrc) ((epwm)->SSCTL = ((epwm)->SSCTL & ~EPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | (u32ChannelMask)) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_DISABLE_TIMER_SYNC(epwm, u32ChannelMask) \ - do{ \ - int i;\ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (epwm)->SSCTL &= ~(1UL << i); \ - } \ - }while(0) - -/** - * @brief This macro enable EPWM counter synchronous start counting function. - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to make selected EPWM0 and EPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by EPWM_ENABLE_TIMER_SYNC() and EPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC_START(epwm) ((epwm)->SSTRG = EPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to enable output inverter of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_OUTPUT_INVERTER(epwm, u32ChannelMask) ((epwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured rising data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_RISING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured falling data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_FALLING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define EPWM_MASK_OUTPUT(epwm, u32ChannelMask, u32LevelMask) \ - { \ - (epwm)->MSKEN = (u32ChannelMask); \ - (epwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @return None - * @details This macro is used to set the prescaler of specified channel. - * @note The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescaler) ((epwm)->CLKPSC[(u32ChannelNum)] = (u32Prescaler)) - -/** - * @brief This macro get the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @details This macro is used to get the prescaler of specified channel. - * @note The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_GET_PRESCALER(epwm, u32ChannelNum) ((epwm)->CLKPSC[(u32ChannelNum)]) - -/** - * @brief This macro set the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_CMR(epwm, u32ChannelNum, u32CMR) ((epwm)->CMPDAT[(u32ChannelNum)]= (u32CMR)) - -/** - * @brief This macro get the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the comparator of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the comparator of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CMR(epwm, u32ChannelNum) ((epwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the free trigger comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32FTCMR Free trigger comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the free trigger comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_FTCMR(epwm, u32ChannelNum, u32FTCMR) (((epwm)->FTCMPDAT[((u32ChannelNum) >> 1U)]) = (u32FTCMR)) - -/** - * @brief This macro set the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the period of specified channel. - * @note This new setting will take effect on next EPWM period. - * @note EPWM counter will stop if period length set to 0. - * \hideinitializer - */ -#define EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR) ((epwm)->PERIOD[(u32ChannelNum)] = (u32CNR)) - -/** - * @brief This macro get the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the period of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the period of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CNR(epwm, u32ChannelNum) ((epwm)->PERIOD[(u32ChannelNum)]) - -/** - * @brief This macro set the EPWM aligned type - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32AlignedType EPWM aligned type, valid values are: - * - \ref EPWM_EDGE_ALIGNED - * - \ref EPWM_CENTER_ALIGNED - * @return None - * @details This macro is used to set the EPWM aligned type of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_ALIGNED_TYPE(epwm, u32ChannelMask, u32AlignedType) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (epwm)->CTL1 = (((epwm)->CTL1 & ~(3UL << (i << 1))) | ((u32AlignedType) << (i << 1))); \ - } \ - }while(0) - -/** - * @brief Set load window of window loading mode for specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to set load window of window loading mode for specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_LOAD_WINDOW(epwm, u32ChannelMask) ((epwm)->LOAD |= (u32ChannelMask)) - -/** - * @brief Trigger synchronous event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are 0, 2, 4 - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @return None - * @details This macro is used to trigger synchronous event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC(epwm, u32ChannelNum) ((epwm)->SWSYNC |= (1 << ((u32ChannelNum) >> 1))) - -/** - * @brief Clear counter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to clear counter of specified channel(s). - * \hideinitializer - */ -#define EPWM_CLR_COUNTER(epwm, u32ChannelMask) ((epwm)->CNTCLR |= (u32ChannelMask)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_OUTPUT_LEVEL(epwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) { \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (i << 1))) | ((u32ZeroLevel) << (i << 1))); \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))) | ((u32PeriodLevel) << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (i << 1))) | ((u32CmpUpLevel) << (i << 1))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))) | ((u32CmpDownLevel) << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))); \ - } \ - } \ - }while(0) - -/** - * @brief Trigger brake event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @param[in] u32BrakeType Type of brake trigger. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This macro is used to trigger brake event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_BRAKE(epwm, u32ChannelMask, u32BrakeType) ((epwm)->SWBRK |= ((u32ChannelMask) << (u32BrakeType))) - -/** - * @brief Set Dead zone clock source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32AfterPrescaler Dead zone clock source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @return None - * @details This macro is used to set Dead zone clock source. Every two channels share the same setting. - * @note The write-protection function should be disabled before using this function. - * \hideinitializer - */ -#define EPWM_SET_DEADZONE_CLK_SRC(epwm, u32ChannelNum, u32AfterPrescaler) \ - ((epwm)->DTCTL = (((epwm)->DTCTL & ~(1UL << (EPWM_DTCTL_DTCKSEL0_Pos + ((u32ChannelNum) >> 1U)))) | \ - ((u32AfterPrescaler) << (EPWM_DTCTL_DTCKSEL0_Pos + ((u32ChannelNum) >> 1U))))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt); -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource); -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode); -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration); -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc); -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase); -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm); -void EPWM_EnableSyncPinInverse(EPWM_T *epwm); -void EPWM_DisableSyncPinInverse(EPWM_T *epwm); -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule); -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable); -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel); -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle); -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt); -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); - -/*@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EPWM_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eqei.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eqei.h deleted file mode 100644 index 1bee656d6f2..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_eqei.h +++ /dev/null @@ -1,434 +0,0 @@ -/**************************************************************************//** - * @file nu_eqei.h - * @version V3.00 - * @brief Enhanced Quadrature Encoder Interface (EQEI) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_EQEI_H__ -#define __NU_EQEI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EQEI_Driver EQEI Driver - @{ -*/ - -/** @addtogroup EQEI_EXPORTED_CONSTANTS EQEI Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EQEI counting mode selection constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EQEI_CTL_X4_FREE_COUNTING_MODE (0x0<CTL &= (~EQEI_CTL_CMPEN_Msk)) - -/** - * @brief Enable EQEI compare function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This macro enable EQEI counter compare function. - * \hideinitializer - */ -#define EQEI_ENABLE_CNT_CMP(eqei) ((eqei)->CTL |= EQEI_CTL_CMPEN_Msk) - -/** - * @brief Disable EQEI index latch function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This macro disable EQEI index trigger counter latch function. - * \hideinitializer - */ -#define EQEI_DISABLE_INDEX_LATCH(eqei) ((eqei)->CTL &= (~EQEI_CTL_IDXLATEN_Msk)) - -/** - * @brief Enable EQEI index latch function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This macro enable EQEI index trigger counter latch function. - * \hideinitializer - */ -#define EQEI_ENABLE_INDEX_LATCH(eqei) ((eqei)->CTL |= EQEI_CTL_IDXLATEN_Msk) - -/** - * @brief Disable EQEI index reload function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This macro disable EQEI index trigger counter reload function. - * \hideinitializer - */ -#define EQEI_DISABLE_INDEX_RELOAD(eqei) ((eqei)->CTL &= (~EQEI_CTL_IDXRLDEN_Msk)) - -/** - * @brief Enable EQEI index reload function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This macro enable EQEI index trigger counter reload function. - * \hideinitializer - */ -#define EQEI_ENABLE_INDEX_RELOAD(eqei) ((eqei)->CTL |= EQEI_CTL_IDXRLDEN_Msk) - -/** - * @brief Disable EQEI input - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32InputType Input signal type. - * - \ref EQEI_CTL_CHAEN_Msk : QEA input - * - \ref EQEI_CTL_CHAEN_Msk : QEB input - * - \ref EQEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro disable specified EQEI signal input. - * \hideinitializer - */ -#define EQEI_DISABLE_INPUT(eqei, u32InputType) ((eqei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable EQEI input - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32InputType Input signal type . - * - \ref EQEI_CTL_CHAEN_Msk : QEA input - * - \ref EQEI_CTL_CHBEN_Msk : QEB input - * - \ref EQEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro enable specified EQEI signal input. - * \hideinitializer - */ -#define EQEI_ENABLE_INPUT(eqei, u32InputType) ((eqei)->CTL |= (u32InputType)) - -/** - * @brief Disable inverted input polarity - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32InputType Input signal type . - * - \ref EQEI_CTL_CHAINV_Msk : QEA Input - * - \ref EQEI_CTL_CHBINV_Msk : QEB Input - * - \ref EQEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro disable specified EQEI signal inverted input polarity. - * \hideinitializer - */ -#define EQEI_DISABLE_INPUT_INV(eqei, u32InputType) ((eqei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable inverted input polarity - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32InputType Input signal type. - * - \ref EQEI_CTL_CHAINV_Msk : QEA Input - * - \ref EQEI_CTL_CHBINV_Msk : QEB Input - * - \ref EQEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro inverse specified EQEI signal input polarity. - * \hideinitializer - */ -#define EQEI_ENABLE_INPUT_INV(eqei, u32InputType) ((qei)->CTL |= (u32InputType)) - -/** - * @brief Disable EQEI interrupt - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref EQEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref EQEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref EQEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref EQEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro disable specified EQEI interrupt. - * \hideinitializer - */ -#define EQEI_DISABLE_INT(eqei, u32IntSel) ((eqei)->CTL &= ~(u32IntSel)) - -/** - * @brief Enable EQEI interrupt - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref EQEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref EQEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref EQEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref EQEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro enable specified EQEI interrupt. - * \hideinitializer - */ -#define EQEI_ENABLE_INT(eqei, u32IntSel) ((eqei)->CTL |= (u32IntSel)) - -/** - * @brief Disable EQEI noise filter - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This macro disable EQEI noise filter function. - * \hideinitializer - */ -#define EQEI_DISABLE_NOISE_FILTER(eqei) ((eqei)->CTL |= EQEI_CTL_NFDIS_Msk) - -/** - * @brief Enable EQEI noise filter - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32ClkSel The sampling frequency of the noise filter clock. - * - \ref EQEI_CTL_NFCLKSEL_DIV1 - * - \ref EQEI_CTL_NFCLKSEL_DIV2 - * - \ref EQEI_CTL_NFCLKSEL_DIV4 - * - \ref EQEI_CTL_NFCLKSEL_DIV16 - * - \ref EQEI_CTL_NFCLKSEL_DIV32 - * - \ref EQEI_CTL_NFCLKSEL_DIV64 - * @return None - * @details This macro enable EQEI noise filter function and select noise filter clock. - * \hideinitializer - */ -#define EQEI_ENABLE_NOISE_FILTER(eqei, u32ClkSel) ((eqei)->CTL = ((eqei)->CTL & (~(EQEI_CTL_NFDIS_Msk|EQEI_CTL_NFCLKSEL_Msk))) | (u32ClkSel)) - -/** - * @brief Get EQEI counter value - * @param[in] eqei The pointer of the specified EQEI module. - * @return EQEI pulse counter register value. - * @details This macro get EQEI pulse counter value. - * \hideinitializer - */ -#define EQEI_GET_CNT_VALUE(eqei) ((eqei)->CNT) - -/** - * @brief Get EQEI counting direction - * @param[in] eqei The pointer of the specified EQEI module. - * @retval 0 EQEI counter is in down-counting. - * @retval 1 EQEI counter is in up-counting. - * @details This macro get EQEI counting direction. - * \hideinitializer - */ -#define EQEI_GET_DIR(eqei) (((eqei)->STATUS & (EQEI_STATUS_DIRF_Msk))?1:0) - -/** - * @brief Get EQEI counter hold value - * @param[in] eqei The pointer of the specified EQEI module. - * @return EQEI pulse counter hold register value. - * @details This macro get EQEI pulse counter hold value, which is updated with counter value in hold counter value control. - * \hideinitializer - */ -#define EQEI_GET_HOLD_VALUE(eqei) ((eqei)->CNTHOLD) - -/** - * @brief Get EQEI counter index latch value - * @param[in] eqei The pointer of the specified EQEI module. - * @return EQEI pulse counter index latch value - * @details This macro get EQEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define EQEI_GET_INDEX_LATCH_VALUE(eqei) ((eqei)->CNTLATCH) - -/** - * @brief Set EQEI counter index latch value - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Val The latch value. - * @return EQEI pulse counter index latch value - * @details This macro set EQEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define EQEI_SET_INDEX_LATCH_VALUE(eqei,u32Val) ((eqei)->CNTLATCH = (u32Val)) - -/** - * @brief Get EQEI interrupt flag status - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32IntSel Interrupt type selection. -* - \ref EQEI_STATUS_DIRF_Msk : Counting direction flag - * - \ref EQEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref EQEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref EQEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref EQEI_STATUS_IDXF_Msk : Index detected flag - * @retval 0 EQEI specified interrupt flag is not set. - * @retval 1 EQEI specified interrupt flag is set. - * @details This macro get EQEI specified interrupt flag status. - * \hideinitializer - */ -#define EQEI_GET_INT_FLAG(eqei, u32IntSel) (((eqei)->STATUS & (u32IntSel))?1:0) - - -/** - * @brief Clear EQEI interrupt flag - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref EQEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref EQEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref EQEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref EQEI_STATUS_IDXF_Msk : Index detected flag - * @return None - * @details This macro clear EQEI specified interrupt flag. - * \hideinitializer - */ -#define EQEI_CLR_INT_FLAG(eqei, u32IntSel) ((eqei)->STATUS = (u32IntSel)) - -/** - * @brief Set EQEI counter compare value - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set EQEI pulse counter compare value. - * \hideinitializer - */ -#define EQEI_SET_CNT_CMP(eqei, u32Value) ((eqei)->CNTCMP = (u32Value)) - -/** - * @brief Set EQEI counter value - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set EQEI pulse counter value. - * \hideinitializer - */ -#define EQEI_SET_CNT_VALUE(eqei, u32Value) ((eqei)->CNT = (u32Value)) - -/** - * @brief Enable EQEI counter hold mode - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Type The triggered type. - * - \ref EQEI_CTL_HOLDCNT_Msk : Hold EQEI_CNT control - * - \ref EQEI_CTL_HOLDTMR0_Msk : Hold EQEI_CNT by Timer0 - * - \ref EQEI_CTL_HOLDTMR1_Msk : Hold EQEI_CNT by Timer1 - * - \ref EQEI_CTL_HOLDTMR2_Msk : Hold EQEI_CNT by Timer2 - * - \ref EQEI_CTL_HOLDTMR3_Msk : Hold EQEI_CNT by Timer3 - * @return None - * @details This macro enable EQEI counter hold mode. - * \hideinitializer - */ -#define EQEI_ENABLE_HOLD_TRG_SRC(eqei, u32Type) ((eqei)->CTL |= (u32Type)) - -/** - * @brief Disable EQEI counter hold mode - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Type The triggered type. - * - \ref EQEI_CTL_HOLDCNT_Msk : Hold EQEI_CNT control - * - \ref EQEI_CTL_HOLDTMR0_Msk : Hold EQEI_CNT by Timer0 - * - \ref EQEI_CTL_HOLDTMR1_Msk : Hold EQEI_CNT by Timer1 - * - \ref EQEI_CTL_HOLDTMR2_Msk : Hold EQEI_CNT by Timer2 - * - \ref EQEI_CTL_HOLDTMR3_Msk : Hold EQEI_CNT by Timer3 - * @return None - * @details This macro disable EQEI counter hold mode. - * \hideinitializer - */ -#define EQEI_DISABLE_HOLD_TRG_SRC(eqei, u32Type) ((eqei)->CTL &= ~(u32Type)) - -/** - * @brief Set EQEI maximum count value - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Value The counter maximum value. - * @return EQEI maximum count value - * @details This macro set EQEI maximum count value. - * \hideinitializer - */ -#define EQEI_SET_CNT_MAX(eqei, u32Value) ((eqei)->CNTMAX = (u32Value)) - -/** - * @brief Set EQEI counting mode - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Mode EQEI counting mode. - * - \ref EQEI_CTL_X4_FREE_COUNTING_MODE - * - \ref EQEI_CTL_X2_FREE_COUNTING_MODE - * - \ref EQEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref EQEI_CTL_X2_COMPARE_COUNTING_MODE - * - \ref EQEI_CTL_PHASE_COUNTING_MODE_TYPE1 - * - \ref EQEI_CTL_PHASE_COUNTING_MODE_TYPE2 - * - \ref EQEI_CTL_DIRECTIONAL_COUNTING_MODE - * @return None - * @details This macro set EQEI counting mode. - * \hideinitializer - */ -#define EQEI_SET_CNT_MODE(eqei, u32Mode) ((eqei)->CTL = ((eqei)->CTL & (~EQEI_CTL_MODE_Msk)) | (u32Mode)) - -/** - * @brief Set EQEI clock rate setting without quadrature mode - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Mode EQEI clock rate setting without quadrature mode. - * - \ref EQEI_CTL2_X1_COUNT_FALLING - * - \ref EQEI_CTL2_X1_COUNT_RISING - * - \ref EQEI_CTL2_X2_COUNT_FALLING_AND_RISING - * @return None - * @details This macro set EQEI clock rate setting without quadrature mode. - * \hideinitializer - */ -#define EQEI_SET_CRS_MODE(eqei, u32Mode) ((eqei)->CTL2 = ((eqei)->CTL2 & (~EQEI_CTL2_CRS_Msk)) | (u32Mode)) - -/** - * @brief Set EQEI direction signal source select - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Mode EQEI direction signal source select. - * - \ref EQEI_CTL2_DIRCTION_FROM_EQEI_CALC - * - \ref EQEI_CTL2_DIRCTION_TIED_HIGH - * - \ref EQEI_CTL2_DIRCTION_TIED_LOW - * @return None - * @details This macro set EQEI direction signal source select. - * \hideinitializer - */ -#define EQEI_SET_DIRSRC_MODE(eqei, u32Mode) ((eqei)->CTL2 = ((eqei)->CTL2 & (~EQEI_CTL2_DIRSRC_Msk)) | (u32Mode)) - - - -void EQEI_Close(EQEI_T *eqei); -void EQEI_DisableInt(EQEI_T *eqei, uint32_t u32IntSel); -void EQEI_EnableInt(EQEI_T *eqei, uint32_t u32IntSel); -void EQEI_Open(EQEI_T *eqei, uint32_t u32Mode, uint32_t u32Value); -void EQEI_Start(EQEI_T *eqei); -void EQEI_Stop(EQEI_T *eqei); - - -/*@}*/ /* end of group EQEI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EQEI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EQEI_H__ */ - -/*** (C) COPYRIGHT 2021 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_fmc.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_fmc.h deleted file mode 100644 index 8cad9cf9308..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_fmc.h +++ /dev/null @@ -1,384 +0,0 @@ -/**************************************************************************//** - * @file nu_fmc.h - * @version V3.00 - * @brief M460 Series Flash Memory Controller Driver Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_FMC_H__ -#define __NU_FMC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - - -/** @addtogroup FMC_EXPORTED_CONSTANTS FMC Exported Constants - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Base Address */ -/*---------------------------------------------------------------------------------------------------------*/ -#define FMC_APROM_BASE 0x00000000UL /*!< APROM base address \hideinitializer */ -#define FMC_APROM_END 0x00100000UL /*!< APROM end address \hideinitializer */ -#define FMC_APROM_BANK0_END (FMC_APROM_END/2UL) /*!< APROM bank0 end address \hideinitializer */ -#define FMC_LDROM_BASE 0x0F100000UL /*!< LDROM base address \hideinitializer */ -#define FMC_LDROM_END 0x0F102000UL /*!< LDROM end address \hideinitializer */ -#define FMC_XOM_BASE 0x0F200000UL /*!< XOM Base Address \hideinitializer */ -#define FMC_XOMR0_BASE 0x0F200000UL /*!< XOMR 0 Base Address \hideinitializer */ -#define FMC_XOMR1_BASE 0x0F200010UL /*!< XOMR 1 Base Address \hideinitializer */ -#define FMC_XOMR2_BASE 0x0F200020UL /*!< XOMR 2 Base Address \hideinitializer */ -#define FMC_XOMR3_BASE 0x0F200030UL /*!< XOMR 3 Base Address \hideinitializer */ -#define FMC_CONFIG_BASE 0x0F300000UL /*!< User Configuration address \hideinitializer */ -#define FMC_USER_CONFIG_0 0x0F300000UL /*!< User Config 0 address \hideinitializer */ -#define FMC_USER_CONFIG_1 0x0F300004UL /*!< User Config 1 address \hideinitializer */ -#define FMC_USER_CONFIG_2 0x0F300008UL /*!< User Config 2 address \hideinitializer */ -#define FMC_USER_CONFIG_3 0x0F30000CUL /*!< User Config 2 address \hideinitializer */ -#define FMC_OTP_BASE 0x0F310000UL /*!< OTP flash base address \hideinitializer */ -#define FMC_REMAPCFG_BASE 0x0F320000UL /*!< User Configuration address \hideinitializer */ - -#define FMC_FLASH_PAGE_SIZE 0x1000UL /*!< Flash Page Size (4K bytes) \hideinitializer */ -#define FMC_PAGE_ADDR_MASK 0xFFFFF000UL /*!< Flash page address mask \hideinitializer */ -#define FMC_MULTI_WORD_PROG_LEN 512 /*!< The maximum length of a multi-word program. */ -#define FMC_APPROT_BLOCK_SIZE 0x8000UL /*!< APROM APPROT size (32K bytes) \hideinitializer */ - - -#define FMC_APROM_SIZE FMC_APROM_END /*!< APROM Size \hideinitializer */ -#define FMC_BANK_SIZE (FMC_APROM_SIZE/2UL) /*!< APROM Bank Size \hideinitializer */ -#define FMC_LDROM_SIZE 0x2000UL /*!< LDROM Size (8 Kbytes) \hideinitializer */ -#define FMC_OTP_ENTRY_CNT 256UL /*!< OTP entry number \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* XOM region number constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define XOMR0 0UL /*!< XOM region 0 */ -#define XOMR1 1UL /*!< XOM region 1 */ -#define XOMR2 2UL /*!< XOM region 2 */ -#define XOMR3 3UL /*!< XOM region 3 */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ISPCTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define IS_BOOT_FROM_LDROM 0x1UL /*!< ISPCTL setting to select to boot from LDROM */ -#define IS_BOOT_FROM_APROM 0x0UL /*!< ISPCTL setting to select to boot from APROM */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ISPCMD constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define FMC_ISPCMD_READ 0x00UL /*!< ISP Command: Read flash word \hideinitializer */ -#define FMC_ISPCMD_READ_UID 0x04UL /*!< ISP Command: Read Unique ID \hideinitializer */ -#define FMC_ISPCMD_READ_ALL1 0x08UL /*!< ISP Command: Read all-one result \hideinitializer */ -#define FMC_ISPCMD_READ_CID 0x0BUL /*!< ISP Command: Read Company ID \hideinitializer */ -#define FMC_ISPCMD_READ_DID 0x0CUL /*!< ISP Command: Read Device ID \hideinitializer */ -#define FMC_ISPCMD_READ_CKS 0x0DUL /*!< ISP Command: Read checksum \hideinitializer */ -#define FMC_ISPCMD_PROGRAM 0x21UL /*!< ISP Command: Write flash word \hideinitializer */ -#define FMC_ISPCMD_PAGE_ERASE 0x22UL /*!< ISP Command: Page Erase Flash \hideinitializer */ -#define FMC_ISPCMD_BANK_ERASE 0x23UL /*!< ISP Command: Erase Flash bank 0 or 1 \hideinitializer */ -#define FMC_ISPCMD_BLOCK_ERASE 0x25UL /*!< ISP Command: Erase 4 pages alignment of APROM in bank 0 or 1 \hideinitializer */ -#define FMC_ISPCMD_PROGRAM_MUL 0x27UL /*!< ISP Command: Multuple word program \hideinitializer */ -#define FMC_ISPCMD_RUN_ALL1 0x28UL /*!< ISP Command: Run all-one verification \hideinitializer */ -#define FMC_ISPCMD_BANK_REMAP 0x2CUL /*!< ISP Command: Bank Remap \hideinitializer */ -#define FMC_ISPCMD_RUN_CKS 0x2DUL /*!< ISP Command: Run checksum calculation \hideinitializer */ -#define FMC_ISPCMD_VECMAP 0x2EUL /*!< ISP Command: Vector Page Remap \hideinitializer */ -#define FMC_ISPCMD_READ_64 0x40UL /*!< ISP Command: Read double flash word \hideinitializer */ -#define FMC_ISPCMD_PROGRAM_64 0x61UL /*!< ISP Command: Write double flash word \hideinitializer */ - - -#define READ_ALLONE_YES 0xA11FFFFFUL /*!< Check-all-one result is all one. \hideinitializer */ -#define READ_ALLONE_NOT 0xA1100000UL /*!< Check-all-one result is not all one. \hideinitializer */ -#define READ_ALLONE_CMD_FAIL 0xFFFFFFFFUL /*!< Check-all-one command failed. \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* FMC Time-out Handler Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define FMC_TIMEOUT_READ (SystemCoreClock>>3) /*!< Read command time-out 125 ms \hideinitializer */ -#define FMC_TIMEOUT_WRITE (SystemCoreClock>>3) /*!< Write command time-out 125 ms \hideinitializer */ -#define FMC_TIMEOUT_ERASE (SystemCoreClock>>2) /*!< Erase command time-out 250 ms \hideinitializer */ -#define FMC_TIMEOUT_CHKSUM (SystemCoreClock<<1) /*!< Get checksum command time-out 2 s \hideinitializer */ -#define FMC_TIMEOUT_CHKALLONE (SystemCoreClock<<1) /*!< Check-all-one command time-out 2 s \hideinitializer */ - -/*@}*/ /* end of group FMC_EXPORTED_CONSTANTS */ - - -/** @addtogroup FMC_EXPORTED_MACROS FMC Exported Macros - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macros */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define FMC_SET_APROM_BOOT() (FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk) /*!< Select booting from APROM \hideinitializer */ -#define FMC_SET_LDROM_BOOT() (FMC->ISPCTL |= FMC_ISPCTL_BS_Msk) /*!< Select booting from LDROM \hideinitializer */ -#define FMC_ENABLE_AP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk) /*!< Enable APROM update \hideinitializer */ -#define FMC_DISABLE_AP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk) /*!< Disable APROM update \hideinitializer */ -#define FMC_ENABLE_CFG_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) /*!< Enable User Config update \hideinitializer */ -#define FMC_DISABLE_CFG_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk) /*!< Disable User Config update \hideinitializer */ -#define FMC_ENABLE_LD_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) /*!< Enable LDROM update \hideinitializer */ -#define FMC_DISABLE_LD_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk) /*!< Disable LDROM update \hideinitializer */ -#define FMC_DISABLE_ISP() (FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk) /*!< Disable ISP function \hideinitializer */ -#define FMC_ENABLE_ISP() (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) /*!< Enable ISP function \hideinitializer */ -#define FMC_GET_FAIL_FLAG() ((FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) ? 1UL : 0UL) /*!< Get ISP fail flag \hideinitializer */ -#define FMC_CLR_FAIL_FLAG() (FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk) /*!< Clear ISP fail flag \hideinitializer */ -#define FMC_ENABLE_APPROT(u8Block) (FMC->APPROT |= (1ul << u8Block)) /*!< Enable APPROT Block \hideinitializer */ -#define FMC_DISABLE_APPROT(u8Block) (FMC->APPROT &= ~(1ul << u8Block)) /*!< Disable APPROT Block \hideinitializer */ -/*@}*/ /* end of group FMC_EXPORTED_MACROS */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Global variables */ -/*---------------------------------------------------------------------------------------------------------*/ -extern int32_t g_FMC_i32ErrCode; - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -__STATIC_INLINE uint32_t FMC_ReadCID(void); -__STATIC_INLINE uint32_t FMC_ReadPID(void); -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index); -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index); -__STATIC_INLINE int32_t FMC_SetVectorPageAddr(uint32_t u32PageAddr); -__STATIC_INLINE uint32_t FMC_GetVECMAP(void); - -/** - * @brief Get current vector mapping address. - * @param None - * @return The current vector mapping address. - * @details To get VECMAP value which is the page address for remapping to vector page (0x0). - * @note - * VECMAP only valid when new IAP function is enabled. (CBS = 10'b or 00'b) - */ -__STATIC_INLINE uint32_t FMC_GetVECMAP(void) -{ - return (FMC->ISPSTS & FMC_ISPSTS_VECMAP_Msk); -} - -/** - * @brief Read company ID - * @param None - * @return The company ID (32-bit). 0xFFFFFFFF means read failed. - * @details The company ID of Nuvoton is fixed to be 0xDA - * - * @note Global error code g_FMC_i32ErrCode - * -1 Read time-out - */ -__STATIC_INLINE uint32_t FMC_ReadCID(void) -{ - int32_t i32TimeOutCnt = FMC_TIMEOUT_READ; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_READ_CID; /* Set ISP Command Code */ - FMC->ISPADDR = 0x0u; /* Must keep 0x0 when read CID */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) /* Waiting for ISP Done */ - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return 0xFFFFFFFF; - } - } - - return FMC->ISPDAT; -} - -/** - * @brief Read product ID - * @param None - * @return The product ID (32-bit). 0xFFFFFFFF means read failed. - * @details This function is used to read product ID. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Read time-out - */ -__STATIC_INLINE uint32_t FMC_ReadPID(void) -{ - int32_t i32TimeOutCnt = FMC_TIMEOUT_READ; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_READ_DID; /* Set ISP Command Code */ - FMC->ISPADDR = 0x04u; /* Must keep 0x4 when read PID */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) /* Waiting for ISP Done */ - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return 0xFFFFFFFF; - } - } - - return FMC->ISPDAT; -} - -/** - * @brief Read Unique ID - * @param[in] u8Index UID index. 0 = UID[31:0], 1 = UID[63:32], 2 = UID[95:64] - * @return The 32-bit unique ID data of specified UID index. 0xFFFFFFFF means read failed. - * @details To read out 96-bit Unique ID. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Read time-out - */ -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index) -{ - int32_t i32TimeOutCnt = FMC_TIMEOUT_READ; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_READ_UID; - FMC->ISPADDR = ((uint32_t)u8Index << 2u); - FMC->ISPDAT = 0u; - FMC->ISPTRG = 0x1u; -#if ISBEN - __ISB(); -#endif - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) /* Waiting for ISP Done */ - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return 0xFFFFFFFF; - } - } - - return FMC->ISPDAT; -} - -/** - * @brief To read UCID - * @param[in] u32Index Index of the UCID to read. u32Index must be 0, 1, 2, or 3. - * @return The UCID of specified index - * @details This function is used to read unique chip ID (UCID). 0xFFFFFFFF means read failed. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Read time-out - */ -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index) -{ - int32_t i32TimeOutCnt = FMC_TIMEOUT_READ; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_READ_UID; /* Set ISP Command Code */ - FMC->ISPADDR = (0x04u * u32Index) + 0x10u; /* The UCID is at offset 0x10 with word alignment. */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) /* Waiting for ISP Done */ - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return 0xFFFFFFFF; - } - } - - return FMC->ISPDAT; -} - -/** - * @brief Set vector mapping address - * @param[in] u32PageAddr The page address to remap to address 0x0. The address must be page alignment. - * @return To set VECMAP to remap specified page address to 0x0. - * @details This function is used to set VECMAP to map specified page to vector page (0x0). - * @retval 0 Success - * @retval -1 Failed - * @note - * VECMAP only valid when new IAP function is enabled. (CBS = 10'b or 00'b) - * - * @note Global error code g_FMC_i32ErrCode - * -1 Command time-out - */ -__STATIC_INLINE int32_t FMC_SetVectorPageAddr(uint32_t u32PageAddr) -{ - int32_t i32TimeOutCnt = FMC_TIMEOUT_WRITE; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_VECMAP; /* Set ISP Command Code */ - FMC->ISPADDR = u32PageAddr; /* The address of specified page which will be map to address 0x0. It must be page alignment. */ - FMC->ISPTRG = 0x1u; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while (FMC->ISPTRG) /* Waiting for ISP Done */ - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return -1; - } - } - - return 0; -} - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -extern void FMC_Close(void); -extern int32_t FMC_ConfigXOM(uint32_t xom_num, uint32_t xom_base, uint8_t xom_page); -extern int32_t FMC_Erase(uint32_t u32PageAddr); -extern int32_t FMC_Erase_Bank(uint32_t u32BankAddr); -extern int32_t FMC_EraseXOM(uint32_t xom_num); -extern int32_t FMC_GetXOMState(uint32_t xom_num); -extern int32_t FMC_GetBootSource(void); -extern void FMC_Open(void); -extern uint32_t FMC_Read(uint32_t u32Addr); -extern int32_t FMC_Read_64(uint32_t u32addr, uint32_t *u32data0, uint32_t *u32data1); -extern uint32_t FMC_ReadDataFlashBaseAddr(void); -extern void FMC_SetBootSource(int32_t i32BootSrc); -extern int32_t FMC_Write(uint32_t u32Addr, uint32_t u32Data); -extern int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1); -extern int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len); -extern int32_t FMC_WriteOTP(uint32_t otp_num, uint32_t low_word, uint32_t high_word); -extern int32_t FMC_ReadOTP(uint32_t otp_num, uint32_t *low_word, uint32_t *high_word); -extern int32_t FMC_LockOTP(uint32_t otp_num); -extern int32_t FMC_IsOTPLocked(uint32_t otp_num); -extern int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count); -extern int32_t FMC_WriteConfig(uint32_t u32Config[], uint32_t u32Count); -extern uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count); -extern uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count); -extern int32_t FMC_RemapBank(uint32_t u32Bank); - - -/*@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group FMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_FMC_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_gpio.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_gpio.h deleted file mode 100644 index 856acbe6759..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_gpio.h +++ /dev/null @@ -1,564 +0,0 @@ -/**************************************************************************//** - * @file nu_gpio.h - * @version V3.00 - * @brief M460 series GPIO driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_GPIO_H__ -#define __NU_GPIO_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_CONSTANTS GPIO Exported Constants - @{ -*/ - - -#define GPIO_PIN_MAX 16UL /*!< Specify Maximum Pins of Each GPIO Port \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_MODE_INPUT 0x0UL /*!< Input Mode \hideinitializer */ -#define GPIO_MODE_OUTPUT 0x1UL /*!< Output Mode \hideinitializer */ -#define GPIO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode \hideinitializer */ -#define GPIO_MODE_QUASI 0x3UL /*!< Quasi-bidirectional Mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Interrupt Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INT_RISING 0x00010000UL /*!< Interrupt enable by Input Rising Edge \hideinitializer */ -#define GPIO_INT_FALLING 0x00000001UL /*!< Interrupt enable by Input Falling Edge \hideinitializer */ -#define GPIO_INT_BOTH_EDGE 0x00010001UL /*!< Interrupt enable by both Rising Edge and Falling Edge \hideinitializer */ -#define GPIO_INT_HIGH 0x01010000UL /*!< Interrupt enable by Level-High \hideinitializer */ -#define GPIO_INT_LOW 0x01000001UL /*!< Interrupt enable by Level-Level \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_INTTYPE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INTTYPE_EDGE 0UL /*!< GPIO_INTTYPE Setting for Edge Trigger Mode \hideinitializer */ -#define GPIO_INTTYPE_LEVEL 1UL /*!< GPIO_INTTYPE Setting for Edge Level Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Slew Rate Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_SLEWCTL_NORMAL 0x0UL /*!< GPIO slew setting for normal Mode \hideinitializer */ -#define GPIO_SLEWCTL_HIGH 0x1UL /*!< GPIO slew setting for high Mode \hideinitializer */ -#define GPIO_SLEWCTL_FAST 0x2UL /*!< GPIO slew setting for fast Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Pull-up And Pull-down Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_PUSEL_DISABLE 0x0UL /*!< GPIO PUSEL setting for Disable Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_UP 0x1UL /*!< GPIO PUSEL setting for Pull-up Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_DOWN 0x2UL /*!< GPIO PUSEL setting for Pull-down Mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_DBCTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_DBCTL_ICLK_ON 0x00000020UL /*!< GPIO_DBCTL setting for all IO pins edge detection circuit is always active after reset \hideinitializer */ -#define GPIO_DBCTL_ICLK_OFF 0x00000000UL /*!< GPIO_DBCTL setting for edge detection circuit is active only if IO pin corresponding GPIOx_IEN bit is set to 1 \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSRC_LIRC 0x00000010UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the internal 10 kHz \hideinitializer */ -#define GPIO_DBCTL_DBCLKSRC_HCLK 0x00000000UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the HCLK \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSEL_1 0x00000000UL /*!< GPIO_DBCTL setting for sampling cycle = 1 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2 0x00000001UL /*!< GPIO_DBCTL setting for sampling cycle = 2 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4 0x00000002UL /*!< GPIO_DBCTL setting for sampling cycle = 4 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8 0x00000003UL /*!< GPIO_DBCTL setting for sampling cycle = 8 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16 0x00000004UL /*!< GPIO_DBCTL setting for sampling cycle = 16 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32 0x00000005UL /*!< GPIO_DBCTL setting for sampling cycle = 32 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_64 0x00000006UL /*!< GPIO_DBCTL setting for sampling cycle = 64 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_128 0x00000007UL /*!< GPIO_DBCTL setting for sampling cycle = 128 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_256 0x00000008UL /*!< GPIO_DBCTL setting for sampling cycle = 256 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_512 0x00000009UL /*!< GPIO_DBCTL setting for sampling cycle = 512 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_1024 0x0000000AUL /*!< GPIO_DBCTL setting for sampling cycle = 1024 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2048 0x0000000BUL /*!< GPIO_DBCTL setting for sampling cycle = 2048 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4096 0x0000000CUL /*!< GPIO_DBCTL setting for sampling cycle = 4096 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8192 0x0000000DUL /*!< GPIO_DBCTL setting for sampling cycle = 8192 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16384 0x0000000EUL /*!< GPIO_DBCTL setting for sampling cycle = 16384 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32768 0x0000000FUL /*!< GPIO_DBCTL setting for sampling cycle = 32768 clocks \hideinitializer */ - - -/* Define GPIO Pin Data Input/Output. It could be used to control each I/O pin by pin address mapping. - Example 1: - - PA0 = 1; - - It is used to set GPIO PA.0 to high; - - Example 2: - - if (PA0) - PA0 = 0; - - If GPIO PA.0 pin status is high, then set GPIO PA.0 data output to low. - */ -#define GPIO_PIN_DATA(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2)))) /*!< Pin Data Input/Output \hideinitializer */ -#define PA0 GPIO_PIN_DATA(0, 0 ) /*!< Specify PA.0 Pin Data Input/Output \hideinitializer */ -#define PA1 GPIO_PIN_DATA(0, 1 ) /*!< Specify PA.1 Pin Data Input/Output \hideinitializer */ -#define PA2 GPIO_PIN_DATA(0, 2 ) /*!< Specify PA.2 Pin Data Input/Output \hideinitializer */ -#define PA3 GPIO_PIN_DATA(0, 3 ) /*!< Specify PA.3 Pin Data Input/Output \hideinitializer */ -#define PA4 GPIO_PIN_DATA(0, 4 ) /*!< Specify PA.4 Pin Data Input/Output \hideinitializer */ -#define PA5 GPIO_PIN_DATA(0, 5 ) /*!< Specify PA.5 Pin Data Input/Output \hideinitializer */ -#define PA6 GPIO_PIN_DATA(0, 6 ) /*!< Specify PA.6 Pin Data Input/Output \hideinitializer */ -#define PA7 GPIO_PIN_DATA(0, 7 ) /*!< Specify PA.7 Pin Data Input/Output \hideinitializer */ -#define PA8 GPIO_PIN_DATA(0, 8 ) /*!< Specify PA.8 Pin Data Input/Output \hideinitializer */ -#define PA9 GPIO_PIN_DATA(0, 9 ) /*!< Specify PA.9 Pin Data Input/Output \hideinitializer */ -#define PA10 GPIO_PIN_DATA(0, 10) /*!< Specify PA.10 Pin Data Input/Output \hideinitializer */ -#define PA11 GPIO_PIN_DATA(0, 11) /*!< Specify PA.11 Pin Data Input/Output \hideinitializer */ -#define PA12 GPIO_PIN_DATA(0, 12) /*!< Specify PA.12 Pin Data Input/Output \hideinitializer */ -#define PA13 GPIO_PIN_DATA(0, 13) /*!< Specify PA.13 Pin Data Input/Output \hideinitializer */ -#define PA14 GPIO_PIN_DATA(0, 14) /*!< Specify PA.14 Pin Data Input/Output \hideinitializer */ -#define PA15 GPIO_PIN_DATA(0, 15) /*!< Specify PA.15 Pin Data Input/Output \hideinitializer */ -#define PB0 GPIO_PIN_DATA(1, 0 ) /*!< Specify PB.0 Pin Data Input/Output \hideinitializer */ -#define PB1 GPIO_PIN_DATA(1, 1 ) /*!< Specify PB.1 Pin Data Input/Output \hideinitializer */ -#define PB2 GPIO_PIN_DATA(1, 2 ) /*!< Specify PB.2 Pin Data Input/Output \hideinitializer */ -#define PB3 GPIO_PIN_DATA(1, 3 ) /*!< Specify PB.3 Pin Data Input/Output \hideinitializer */ -#define PB4 GPIO_PIN_DATA(1, 4 ) /*!< Specify PB.4 Pin Data Input/Output \hideinitializer */ -#define PB5 GPIO_PIN_DATA(1, 5 ) /*!< Specify PB.5 Pin Data Input/Output \hideinitializer */ -#define PB6 GPIO_PIN_DATA(1, 6 ) /*!< Specify PB.6 Pin Data Input/Output \hideinitializer */ -#define PB7 GPIO_PIN_DATA(1, 7 ) /*!< Specify PB.7 Pin Data Input/Output \hideinitializer */ -#define PB8 GPIO_PIN_DATA(1, 8 ) /*!< Specify PB.8 Pin Data Input/Output \hideinitializer */ -#define PB9 GPIO_PIN_DATA(1, 9 ) /*!< Specify PB.9 Pin Data Input/Output \hideinitializer */ -#define PB10 GPIO_PIN_DATA(1, 10) /*!< Specify PB.10 Pin Data Input/Output \hideinitializer */ -#define PB11 GPIO_PIN_DATA(1, 11) /*!< Specify PB.11 Pin Data Input/Output \hideinitializer */ -#define PB12 GPIO_PIN_DATA(1, 12) /*!< Specify PB.12 Pin Data Input/Output \hideinitializer */ -#define PB13 GPIO_PIN_DATA(1, 13) /*!< Specify PB.13 Pin Data Input/Output \hideinitializer */ -#define PB14 GPIO_PIN_DATA(1, 14) /*!< Specify PB.14 Pin Data Input/Output \hideinitializer */ -#define PB15 GPIO_PIN_DATA(1, 15) /*!< Specify PB.15 Pin Data Input/Output \hideinitializer */ -#define PC0 GPIO_PIN_DATA(2, 0 ) /*!< Specify PC.0 Pin Data Input/Output \hideinitializer */ -#define PC1 GPIO_PIN_DATA(2, 1 ) /*!< Specify PC.1 Pin Data Input/Output \hideinitializer */ -#define PC2 GPIO_PIN_DATA(2, 2 ) /*!< Specify PC.2 Pin Data Input/Output \hideinitializer */ -#define PC3 GPIO_PIN_DATA(2, 3 ) /*!< Specify PC.3 Pin Data Input/Output \hideinitializer */ -#define PC4 GPIO_PIN_DATA(2, 4 ) /*!< Specify PC.4 Pin Data Input/Output \hideinitializer */ -#define PC5 GPIO_PIN_DATA(2, 5 ) /*!< Specify PC.5 Pin Data Input/Output \hideinitializer */ -#define PC6 GPIO_PIN_DATA(2, 6 ) /*!< Specify PC.6 Pin Data Input/Output \hideinitializer */ -#define PC7 GPIO_PIN_DATA(2, 7 ) /*!< Specify PC.7 Pin Data Input/Output \hideinitializer */ -#define PC8 GPIO_PIN_DATA(2, 8 ) /*!< Specify PC.8 Pin Data Input/Output \hideinitializer */ -#define PC9 GPIO_PIN_DATA(2, 9 ) /*!< Specify PC.9 Pin Data Input/Output \hideinitializer */ -#define PC10 GPIO_PIN_DATA(2, 10) /*!< Specify PC.10 Pin Data Input/Output \hideinitializer */ -#define PC11 GPIO_PIN_DATA(2, 11) /*!< Specify PC.11 Pin Data Input/Output \hideinitializer */ -#define PC12 GPIO_PIN_DATA(2, 12) /*!< Specify PC.12 Pin Data Input/Output \hideinitializer */ -#define PC13 GPIO_PIN_DATA(2, 13) /*!< Specify PC.13 Pin Data Input/Output \hideinitializer */ -#define PC14 GPIO_PIN_DATA(2, 14) /*!< Specify PC.14 Pin Data Input/Output \hideinitializer */ -#define PD0 GPIO_PIN_DATA(3, 0 ) /*!< Specify PD.0 Pin Data Input/Output \hideinitializer */ -#define PD1 GPIO_PIN_DATA(3, 1 ) /*!< Specify PD.1 Pin Data Input/Output \hideinitializer */ -#define PD2 GPIO_PIN_DATA(3, 2 ) /*!< Specify PD.2 Pin Data Input/Output \hideinitializer */ -#define PD3 GPIO_PIN_DATA(3, 3 ) /*!< Specify PD.3 Pin Data Input/Output \hideinitializer */ -#define PD4 GPIO_PIN_DATA(3, 4 ) /*!< Specify PD.4 Pin Data Input/Output \hideinitializer */ -#define PD5 GPIO_PIN_DATA(3, 5 ) /*!< Specify PD.5 Pin Data Input/Output \hideinitializer */ -#define PD6 GPIO_PIN_DATA(3, 6 ) /*!< Specify PD.6 Pin Data Input/Output \hideinitializer */ -#define PD7 GPIO_PIN_DATA(3, 7 ) /*!< Specify PD.7 Pin Data Input/Output \hideinitializer */ -#define PD8 GPIO_PIN_DATA(3, 8 ) /*!< Specify PD.8 Pin Data Input/Output \hideinitializer */ -#define PD9 GPIO_PIN_DATA(3, 9 ) /*!< Specify PD.9 Pin Data Input/Output \hideinitializer */ -#define PD10 GPIO_PIN_DATA(3, 10) /*!< Specify PD.10 Pin Data Input/Output \hideinitializer */ -#define PD11 GPIO_PIN_DATA(3, 11) /*!< Specify PD.11 Pin Data Input/Output \hideinitializer */ -#define PD12 GPIO_PIN_DATA(3, 12) /*!< Specify PD.12 Pin Data Input/Output \hideinitializer */ -#define PD13 GPIO_PIN_DATA(3, 13) /*!< Specify PD.13 Pin Data Input/Output \hideinitializer */ -#define PD14 GPIO_PIN_DATA(3, 14) /*!< Specify PD.14 Pin Data Input/Output \hideinitializer */ -#define PE0 GPIO_PIN_DATA(4, 0 ) /*!< Specify PE.0 Pin Data Input/Output \hideinitializer */ -#define PE1 GPIO_PIN_DATA(4, 1 ) /*!< Specify PE.1 Pin Data Input/Output \hideinitializer */ -#define PE2 GPIO_PIN_DATA(4, 2 ) /*!< Specify PE.2 Pin Data Input/Output \hideinitializer */ -#define PE3 GPIO_PIN_DATA(4, 3 ) /*!< Specify PE.3 Pin Data Input/Output \hideinitializer */ -#define PE4 GPIO_PIN_DATA(4, 4 ) /*!< Specify PE.4 Pin Data Input/Output \hideinitializer */ -#define PE5 GPIO_PIN_DATA(4, 5 ) /*!< Specify PE.5 Pin Data Input/Output \hideinitializer */ -#define PE6 GPIO_PIN_DATA(4, 6 ) /*!< Specify PE.6 Pin Data Input/Output \hideinitializer */ -#define PE7 GPIO_PIN_DATA(4, 7 ) /*!< Specify PE.7 Pin Data Input/Output \hideinitializer */ -#define PE8 GPIO_PIN_DATA(4, 8 ) /*!< Specify PE.8 Pin Data Input/Output \hideinitializer */ -#define PE9 GPIO_PIN_DATA(4, 9 ) /*!< Specify PE.9 Pin Data Input/Output \hideinitializer */ -#define PE10 GPIO_PIN_DATA(4, 10) /*!< Specify PE.10 Pin Data Input/Output \hideinitializer */ -#define PE11 GPIO_PIN_DATA(4, 11) /*!< Specify PE.11 Pin Data Input/Output \hideinitializer */ -#define PE12 GPIO_PIN_DATA(4, 12) /*!< Specify PE.12 Pin Data Input/Output \hideinitializer */ -#define PE13 GPIO_PIN_DATA(4, 13) /*!< Specify PE.13 Pin Data Input/Output \hideinitializer */ -#define PE14 GPIO_PIN_DATA(4, 14) /*!< Specify PE.14 Pin Data Input/Output \hideinitializer */ -#define PE15 GPIO_PIN_DATA(4, 15) /*!< Specify PE.15 Pin Data Input/Output \hideinitializer */ -#define PF0 GPIO_PIN_DATA(5, 0 ) /*!< Specify PF.0 Pin Data Input/Output \hideinitializer */ -#define PF1 GPIO_PIN_DATA(5, 1 ) /*!< Specify PF.1 Pin Data Input/Output \hideinitializer */ -#define PF2 GPIO_PIN_DATA(5, 2 ) /*!< Specify PF.2 Pin Data Input/Output \hideinitializer */ -#define PF3 GPIO_PIN_DATA(5, 3 ) /*!< Specify PF.3 Pin Data Input/Output \hideinitializer */ -#define PF4 GPIO_PIN_DATA(5, 4 ) /*!< Specify PF.4 Pin Data Input/Output \hideinitializer */ -#define PF5 GPIO_PIN_DATA(5, 5 ) /*!< Specify PF.5 Pin Data Input/Output \hideinitializer */ -#define PF6 GPIO_PIN_DATA(5, 6 ) /*!< Specify PF.6 Pin Data Input/Output \hideinitializer */ -#define PF7 GPIO_PIN_DATA(5, 7 ) /*!< Specify PF.7 Pin Data Input/Output \hideinitializer */ -#define PF8 GPIO_PIN_DATA(5, 8 ) /*!< Specify PF.8 Pin Data Input/Output \hideinitializer */ -#define PF9 GPIO_PIN_DATA(5, 9 ) /*!< Specify PF.9 Pin Data Input/Output \hideinitializer */ -#define PF10 GPIO_PIN_DATA(5, 10) /*!< Specify PF.10 Pin Data Input/Output \hideinitializer */ -#define PF11 GPIO_PIN_DATA(5, 11) /*!< Specify PF.11 Pin Data Input/Output \hideinitializer */ -#define PG0 GPIO_PIN_DATA(6, 0 ) /*!< Specify PG.0 Pin Data Input/Output \hideinitializer */ -#define PG1 GPIO_PIN_DATA(6, 1 ) /*!< Specify PG.1 Pin Data Input/Output \hideinitializer */ -#define PG2 GPIO_PIN_DATA(6, 2 ) /*!< Specify PG.2 Pin Data Input/Output \hideinitializer */ -#define PG3 GPIO_PIN_DATA(6, 3 ) /*!< Specify PG.3 Pin Data Input/Output \hideinitializer */ -#define PG4 GPIO_PIN_DATA(6, 4 ) /*!< Specify PG.4 Pin Data Input/Output \hideinitializer */ -#define PG5 GPIO_PIN_DATA(6, 5 ) /*!< Specify PG.5 Pin Data Input/Output \hideinitializer */ -#define PG6 GPIO_PIN_DATA(6, 6 ) /*!< Specify PG.6 Pin Data Input/Output \hideinitializer */ -#define PG7 GPIO_PIN_DATA(6, 7 ) /*!< Specify PG.7 Pin Data Input/Output \hideinitializer */ -#define PG8 GPIO_PIN_DATA(6, 8 ) /*!< Specify PG.8 Pin Data Input/Output \hideinitializer */ -#define PG9 GPIO_PIN_DATA(6, 9 ) /*!< Specify PG.9 Pin Data Input/Output \hideinitializer */ -#define PG10 GPIO_PIN_DATA(6, 10) /*!< Specify PG.10 Pin Data Input/Output \hideinitializer */ -#define PG11 GPIO_PIN_DATA(6, 11) /*!< Specify PG.11 Pin Data Input/Output \hideinitializer */ -#define PG12 GPIO_PIN_DATA(6, 12) /*!< Specify PG.12 Pin Data Input/Output \hideinitializer */ -#define PG13 GPIO_PIN_DATA(6, 13) /*!< Specify PG.13 Pin Data Input/Output \hideinitializer */ -#define PG14 GPIO_PIN_DATA(6, 14) /*!< Specify PG.14 Pin Data Input/Output \hideinitializer */ -#define PG15 GPIO_PIN_DATA(6, 15) /*!< Specify PG.15 Pin Data Input/Output \hideinitializer */ -#define PH0 GPIO_PIN_DATA(7, 0 ) /*!< Specify PH.0 Pin Data Input/Output \hideinitializer */ -#define PH1 GPIO_PIN_DATA(7, 1 ) /*!< Specify PH.1 Pin Data Input/Output \hideinitializer */ -#define PH2 GPIO_PIN_DATA(7, 2 ) /*!< Specify PH.2 Pin Data Input/Output \hideinitializer */ -#define PH3 GPIO_PIN_DATA(7, 3 ) /*!< Specify PH.3 Pin Data Input/Output \hideinitializer */ -#define PH4 GPIO_PIN_DATA(7, 4 ) /*!< Specify PH.4 Pin Data Input/Output \hideinitializer */ -#define PH5 GPIO_PIN_DATA(7, 5 ) /*!< Specify PH.5 Pin Data Input/Output \hideinitializer */ -#define PH6 GPIO_PIN_DATA(7, 6 ) /*!< Specify PH.6 Pin Data Input/Output \hideinitializer */ -#define PH7 GPIO_PIN_DATA(7, 7 ) /*!< Specify PH.7 Pin Data Input/Output \hideinitializer */ -#define PH8 GPIO_PIN_DATA(7, 8 ) /*!< Specify PH.8 Pin Data Input/Output \hideinitializer */ -#define PH9 GPIO_PIN_DATA(7, 9 ) /*!< Specify PH.9 Pin Data Input/Output \hideinitializer */ -#define PH10 GPIO_PIN_DATA(7, 10) /*!< Specify PH.10 Pin Data Input/Output \hideinitializer */ -#define PH11 GPIO_PIN_DATA(7, 11) /*!< Specify PH.11 Pin Data Input/Output \hideinitializer */ -#define PH12 GPIO_PIN_DATA(7, 12) /*!< Specify PH.12 Pin Data Input/Output \hideinitializer */ -#define PH13 GPIO_PIN_DATA(7, 13) /*!< Specify PH.13 Pin Data Input/Output \hideinitializer */ -#define PH14 GPIO_PIN_DATA(7, 14) /*!< Specify PH.14 Pin Data Input/Output \hideinitializer */ -#define PH15 GPIO_PIN_DATA(7, 15) /*!< Specify PH.15 Pin Data Input/Output \hideinitializer */ -#define PI6 GPIO_PIN_DATA(8, 6 ) /*!< Specify PI.6 Pin Data Input/Output \hideinitializer */ -#define PI7 GPIO_PIN_DATA(8, 7 ) /*!< Specify PI.7 Pin Data Input/Output \hideinitializer */ -#define PI8 GPIO_PIN_DATA(8, 8 ) /*!< Specify PI.8 Pin Data Input/Output \hideinitializer */ -#define PI9 GPIO_PIN_DATA(8, 9 ) /*!< Specify PI.9 Pin Data Input/Output \hideinitializer */ -#define PI10 GPIO_PIN_DATA(8, 10) /*!< Specify PI.10 Pin Data Input/Output \hideinitializer */ -#define PI11 GPIO_PIN_DATA(8, 11) /*!< Specify PI.11 Pin Data Input/Output \hideinitializer */ -#define PI12 GPIO_PIN_DATA(8, 12) /*!< Specify PI.12 Pin Data Input/Output \hideinitializer */ -#define PI13 GPIO_PIN_DATA(8, 13) /*!< Specify PI.13 Pin Data Input/Output \hideinitializer */ -#define PI14 GPIO_PIN_DATA(8, 14) /*!< Specify PI.14 Pin Data Input/Output \hideinitializer */ -#define PI15 GPIO_PIN_DATA(8, 15) /*!< Specify PI.15 Pin Data Input/Output \hideinitializer */ -#define PJ0 GPIO_PIN_DATA(9, 0 ) /*!< Specify PJ.0 Pin Data Input/Output \hideinitializer */ -#define PJ1 GPIO_PIN_DATA(9, 1 ) /*!< Specify PJ.1 Pin Data Input/Output \hideinitializer */ -#define PJ2 GPIO_PIN_DATA(9, 2 ) /*!< Specify PJ.2 Pin Data Input/Output \hideinitializer */ -#define PJ3 GPIO_PIN_DATA(9, 3 ) /*!< Specify PJ.3 Pin Data Input/Output \hideinitializer */ -#define PJ4 GPIO_PIN_DATA(9, 4 ) /*!< Specify PJ.4 Pin Data Input/Output \hideinitializer */ -#define PJ5 GPIO_PIN_DATA(9, 5 ) /*!< Specify PJ.5 Pin Data Input/Output \hideinitializer */ -#define PJ6 GPIO_PIN_DATA(9, 6 ) /*!< Specify PJ.6 Pin Data Input/Output \hideinitializer */ -#define PJ7 GPIO_PIN_DATA(9, 7 ) /*!< Specify PJ.7 Pin Data Input/Output \hideinitializer */ -#define PJ8 GPIO_PIN_DATA(9, 8 ) /*!< Specify PJ.8 Pin Data Input/Output \hideinitializer */ -#define PJ9 GPIO_PIN_DATA(9, 9 ) /*!< Specify PJ.9 Pin Data Input/Output \hideinitializer */ -#define PJ10 GPIO_PIN_DATA(9, 10) /*!< Specify PJ.10 Pin Data Input/Output \hideinitializer */ -#define PJ11 GPIO_PIN_DATA(9, 11) /*!< Specify PJ.11 Pin Data Input/Output \hideinitializer */ -#define PJ12 GPIO_PIN_DATA(9, 12) /*!< Specify PJ.12 Pin Data Input/Output \hideinitializer */ -#define PJ13 GPIO_PIN_DATA(9, 13) /*!< Specify PJ.13 Pin Data Input/Output \hideinitializer */ - -/*@}*/ /* end of group GPIO_EXPORTED_CONSTANTS */ - - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Clear GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * - * @return None - * - * @details Clear the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_CLR_INT_FLAG(port, u32PinMask) ((port)->INTSRC = (u32PinMask)) - -/** - * @brief Disable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * - * @return None - * - * @details Disable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask)) - -/** - * @brief Enable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * @return None - * - * @details Enable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask)) - -/** - * @brief Disable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * - * @return None - * - * @details Disable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16)) - -/** - * @brief Enable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * - * @return None - * - * @details Enable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16)) - -/** - * @brief Disable I/O DOUT mask - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * - * @return None - * - * @details Disable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask)) - -/** - * @brief Enable I/O DOUT mask - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * - * @return None - * - * @details Enable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask)) - -/** - * @brief Get GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * - * @retval 0 No interrupt at specified GPIO pin - * @retval 1 The specified GPIO pin generate an interrupt - * - * @details Get the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask)) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32ClkSrc The de-bounce counter clock source. It could be - * - \ref GPIO_DBCTL_DBCLKSRC_HCLK - * - \ref GPIO_DBCTL_DBCLKSRC_LIRC. - * @param[in] u32ClkSel The de-bounce sampling cycle selection. It could be - * - \ref GPIO_DBCTL_DBCLKSEL_1 - * - \ref GPIO_DBCTL_DBCLKSEL_2 - * - \ref GPIO_DBCTL_DBCLKSEL_4 - * - \ref GPIO_DBCTL_DBCLKSEL_8 - * - \ref GPIO_DBCTL_DBCLKSEL_16 - * - \ref GPIO_DBCTL_DBCLKSEL_32 - * - \ref GPIO_DBCTL_DBCLKSEL_64 - * - \ref GPIO_DBCTL_DBCLKSEL_128 - * - \ref GPIO_DBCTL_DBCLKSEL_256 - * - \ref GPIO_DBCTL_DBCLKSEL_512 - * - \ref GPIO_DBCTL_DBCLKSEL_1024 - * - \ref GPIO_DBCTL_DBCLKSEL_2048 - * - \ref GPIO_DBCTL_DBCLKSEL_4096 - * - \ref GPIO_DBCTL_DBCLKSEL_8192 - * - \ref GPIO_DBCTL_DBCLKSEL_16384 - * - \ref GPIO_DBCTL_DBCLKSEL_32768 - * - * @return None - * - * @details Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source. \n - * Example: GPIO_SET_DEBOUNCE_TIME(PA, GPIO_DBCTL_DBCLKSRC_LIRC, GPIO_DBCTL_DBCLKSEL_4). \n - * It's meaning the De-debounce counter clock source is internal 10 KHz and sampling cycle selection is 4. \n - * Then the target de-bounce sampling cycle time is (4)*(1/(10*1000)) s = 4*0.0001 s = 400 us, - * and system will sampling interrupt input once per 400 us. - */ -#define GPIO_SET_DEBOUNCE_TIME(port, u32ClkSrc, u32ClkSel) ((port)->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) - -/** - * @brief Set GPIO Interrupt Clock on bit - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @return None - * @details Set the I/O pins edge detection circuit always active after reset for specified port. - */ -#define GPIO_SET_DEBOUNCE_ICLKON(port) ((port)->DBCTL |= GPIO_DBCTL_ICLKON_Msk) - -/** - * @brief Clear GPIO Interrupt Clock on bit - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @return None - * @details Set edge detection circuit active only if I/O pin edge interrupt enabled for specified port. - */ -#define GPIO_CLR_DEBOUNCE_ICLKON(port) ((port)->DBCTL &= ~(GPIO_DBCTL_ICLKON_Msk)) - -/** - * @brief Get GPIO Port IN Data - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * - * @return The specified port data - * - * @details Get the PIN register of specified GPIO port. - * \hideinitializer - */ -#define GPIO_GET_IN_DATA(port) ((port)->PIN) - -/** - * @brief Set GPIO Port OUT Data - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32Data GPIO port data. - * - * @return None - * - * @details Set the Data into specified GPIO port. - * \hideinitializer - */ -#define GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data)) - -/** - * @brief Toggle Specified GPIO pin - * - * @param[in] u32Pin Pxy - * - * @return None - * - * @details Toggle the specified GPIO pint. - * \hideinitializer - */ -#define GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1) - - -/** - * @brief Enable External GPIO interrupt - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be 0 ~ 14 for PC and PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 6 ~ 15 for PI GPIO port. \n - * It could be 0 ~ 13 for PJ GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be \n - * - \ref GPIO_INT_RISING - * - \ref GPIO_INT_FALLING - * - \ref GPIO_INT_BOTH_EDGE - * - \ref GPIO_INT_HIGH - * - \ref GPIO_INT_LOW - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_EnableEINT GPIO_EnableInt - -/** - * @brief Disable External GPIO interrupt - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be 0 ~ 14 for PC and PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 6 ~ 15 for PI GPIO port. \n - * It could be 0 ~ 13 for PJ GPIO port. - * - * @return None - * - * @details This function is used to disable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_DisableEINT GPIO_DisableInt - - -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs); -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin); -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_GPIO_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hbi.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hbi.h deleted file mode 100644 index 640cc061629..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hbi.h +++ /dev/null @@ -1,298 +0,0 @@ -/**************************************************************************//** - * @file nu_hbi.h - * @version V1.00 - * @brief M460 series HBI driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_HBI_H__ -#define __NU_HBI_H__ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Include related headers */ -/*---------------------------------------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HyperBus Interface Driver - @{ -*/ - - -/** @addtogroup HBI_EXPORTED_CONSTANTS HBI Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* HyperRAM memory mapping address*/ -#define HYPER_RAM_MEM_MAP 0x0A000000 -/*---------------------------------------------------------------------------------------------------------*/ -/* HyperRAM Register Space constant definitions -Register Space Range: - 0x0000_0000 = Identification Register 0 - 0x0000_0002 = Identification Register 1 - 0x0000_1000 = Configuration Register 0 - 0x0000_1002 = Configuration Register 1 -*/ -#define HYPERRAM_ID_REG0 0x00000000 -#define HYPERRAM_ID_REG1 0x00000002 -#define HYPERRAM_CONFIG_REG0 0x00001000 -#define HYPERRAM_CONFIG_REG1 0x00001002 -/*---------------------------------------------------------------------------------------------------------*/ -/* HBI_CMD constant definitions -0001 = Reset HyperRAM -0010 = Read HyperRAM regsiter (16-Bit, Read Data[15:0] -0101 = Exit From Hybrid Sleep and deep power down -0111 = Write HyperRAM regsiter (16-Bit, Write Data[15:0] -1000 = Read 1 word (Read Data[15:0]) from HyperRAM -1001 = Read 2 word (Read Data[31:0]) from HyperRAM -1100 = Write 1 Byte (Write Data[7:0]) to HyperRAM -1101 = Write 2 Bytes (Write Data[15:0]) to HyperRAM -1110 = Write 3 Byte (Write Data[23:0]) to HyperRAM -1111 = Write 4 Byte (Write Data[31:0]) to HyperRAM -*/ -/*---------------------------------------------------------------------------------------------------------*/ -#define HBI_CMD_RESET_HRAM 0x1 -#define HBI_CMD_READ_HRAM_REGISTER 0x2 -#define HBI_CMD_EXIT_HS_PD 0x5 -#define HBI_CMD_WRITE_HRAM_REGISTER 0x7 -#define HBI_CMD_READ_HRAM_1_WORD 0x8 -#define HBI_CMD_READ_HRAM_2_WORD 0x9 -#define HBI_CMD_WRITE_HRAM_1_BYTE 0xC -#define HBI_CMD_WRITE_HRAM_2_BYTE 0xD -#define HBI_CMD_WRITE_HRAM_3_BYTE 0xE -#define HBI_CMD_WRITE_HRAM_4_BYTE 0xF -#define HBI_CMD_HRAM_IDLE 0x0 -/*---------------------------------------------------------------------------------------------------------*/ -/* HBI_CONFIG: Chip Select Setup Time to Next CK Rising Edge constant definitions -00 = 1.5 HCLK cycles. -01 = 2.5 HCLK cycles. -10 = 3.5 HCLK cycles. -11 = 4.5 HCLK cycles. -*/ -/*---------------------------------------------------------------------------------------------------------*/ -#define HBI_CONFIG_CSST_1_5_HCLK (0x0 << HBI_CONFIG_CSST_Pos) -#define HBI_CONFIG_CSST_2_5_HCLK (0x1 << HBI_CONFIG_CSST_Pos) -#define HBI_CONFIG_CSST_3_5_HCLK (0x2 << HBI_CONFIG_CSST_Pos) -#define HBI_CONFIG_CSST_4_5_HCLK (0x3 << HBI_CONFIG_CSST_Pos) -/*---------------------------------------------------------------------------------------------------------*/ -/* HBI_CONFIG: Initial Access Time constant definitions -0000 = 5 HCLK cycles. -0001 = 6 HCLK cycles. -0010 = 7 HCLK cycles. -1110 = 3 HCLK cycles. -1111 = 4 HCLK cycles. -*/ -/*---------------------------------------------------------------------------------------------------------*/ -#define HBI_CONFIG_ACCT_5_CK (0x0 << HBI_CONFIG_ACCT_Pos) -#define HBI_CONFIG_ACCT_6_CK (0x1 << HBI_CONFIG_ACCT_Pos) -#define HBI_CONFIG_ACCT_7_CK (0x2 << HBI_CONFIG_ACCT_Pos) -#define HBI_CONFIG_ACCT_3_CK (0xE << HBI_CONFIG_ACCT_Pos) -#define HBI_CONFIG_ACCT_4_CK (0xF << HBI_CONFIG_ACCT_Pos) -/*---------------------------------------------------------------------------------------------------------*/ -/* HBI_CONFIG: Chip Select Hold Time After CK Falling Edge constant definitions -00 = 0.5 HCLK cycles. -01 = 1.5 HCLK cycles. -10 = 2.5 HCLK cycles. -11 = 3.5 HCLK cycles. -*/ -/*---------------------------------------------------------------------------------------------------------*/ -#define HBI_CONFIG_CSH_0_5_HCLK (0x0 << HBI_CONFIG_CSH_Pos) -#define HBI_CONFIG_CSH_1_5_HCLK (0x1 << HBI_CONFIG_CSH_Pos) -#define HBI_CONFIG_CSH_2_5_HCLK (0x2 << HBI_CONFIG_CSH_Pos) -#define HBI_CONFIG_CSH_3_5_HCLK (0x3 << HBI_CONFIG_CSH_Pos) -/*---------------------------------------------------------------------------------------------------------*/ -/* HBI_CONFIG: Burst Group Size constant definitions -00 = 128 Bytes. -01 = 64 Bytes. -10 = 16 Bytes. -11 = 32 Bytes. -*/ -/*---------------------------------------------------------------------------------------------------------*/ -#define HBI_CONFIG_BGSIZE_128 (0x0 << HBI_CONFIG_BGSIZE_Pos) -#define HBI_CONFIG_BGSIZE_64 (0x1 << HBI_CONFIG_BGSIZE_Pos) -#define HBI_CONFIG_BGSIZE_16 (0x2 << HBI_CONFIG_BGSIZE_Pos) -#define HBI_CONFIG_BGSIZE_32 (0x3 << HBI_CONFIG_BGSIZE_Pos) -/*---------------------------------------------------------------------------------------------------------*/ -/* HBI_CONFIG: Endian Condition on the Hyper Bus Data Pipe constant definitions -0 = Little-Endian. -1 = Big-Endian. -*/ -/*---------------------------------------------------------------------------------------------------------*/ -#define HBI_CONFIG_LITTLE_ENDIAN (0x0 << HBI_CONFIG_ENDIAN_Pos) -#define HBI_CONFIG_BIG_ENDIAN (0x1 << HBI_CONFIG_ENDIAN_Pos) -/*---------------------------------------------------------------------------------------------------------*/ -/* HBI_CONFIG: Hyper Bus Clock Divider constant definitions -0 = Hyper Bus Clock rate is HCLK/2. -1 = Hyper Bus Clock rate is HCLK/4. -*/ -/*---------------------------------------------------------------------------------------------------------*/ -#define HBI_CONFIG_CKDIV_HCLK_DIV2 (0x0 << HBI_CONFIG_CKDIV_Pos) -#define HBI_CONFIG_CKDIV_HCLK_DIV4 (0x1 << HBI_CONFIG_CKDIV_Pos) -/*---------------------------------------------------------------------------------------------------------*/ - -#define HBI_TIMEOUT SystemCoreClock /*!< 1 second time-out \hideinitializer */ -#define HBI_TIMEOUT_ERR (-2L) /*!< HBI operation abort due to timeout error \hideinitializer */ -extern int32_t g_HBI_i32ErrCode; - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/** - * @brief Set HBI Chip Select Setup Time to Next CK Rising Edge - * @param[in] u8Value Chip Select Setup Time to Next CK Rising Edge. - * - \ref HBI_CONFIG_CSST_1_5_HCLK : 1.5 HCLK cycles - * - \ref HBI_CONFIG_CSST_2_5_HCLK : 2.5 HCLK cycles - * - \ref HBI_CONFIG_CSST_3_5_HCLK : 3.5 HCLK cycles - * - \ref HBI_CONFIG_CSST_4_5_HCLK : 4.5 HCLK cycles - * @return None - * @details This macro set HBI Chip Select Setup Time to Next CK Rising Edge - * \hideinitializer - */ -#define HBI_CONFIG_SET_CSST(u8Value) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_CSST_Msk))) | u8Value) - -/** - * @brief Set HBI Initial Access Time - * @param[in] u8Value Initial Access Time. - * - \ref HBI_CONFIG_ACCT_5_CK : 5 CK cycles - * - \ref HBI_CONFIG_ACCT_6_CK : 6 CK cycles - * - \ref HBI_CONFIG_ACCT_7_CK : 7 CK cycles - * - \ref HBI_CONFIG_ACCT_3_CK : 3 CK cycles - * - \ref HBI_CONFIG_ACCT_4_CK : 4 CK cycles - * @return None - * @details This macro set HBI Initial Access Time - * \hideinitializer - */ -#define HBI_CONFIG_SET_ACCT(u8Value) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_ACCT_Msk))) | u8Value) - -/** - * @brief Set HBI Chip Select Hold Time After CK Falling Edge - * @param[in] u8Value Chip Select Hold Time After CK Falling Edge. - * - \ref HBI_CONFIG_CSH_0_5_HCLK : 0.5 HCLK cycles - * - \ref HBI_CONFIG_CSH_1_5_HCLK : 1.5 HCLK cycles - * - \ref HBI_CONFIG_CSH_2_5_HCLK : 2.5 HCLK cycles - * - \ref HBI_CONFIG_CSH_3_5_HCLK : 3.5 HCLK cycles - * @return None - * @details This macro set HBI Chip Select Hold Time After CK Falling Edge - * \hideinitializer - */ -#define HBI_CONFIG_SET_CSH(u8Value) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_CSH_Msk))) | u8Value) - -/** - * @brief Set HBI Chip Select High between Transaction - * @param[in] u8Value Set Chip Select High between Transaction as u8Value HCLK cycles - u8Value must be 1 ~ 16 - * @return None - * @details This macro set HBI Chip Select High between Transaction. - * \hideinitializer - */ -#define HBI_CONFIG_SET_CSHI(u8Value) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_CSHI_Msk))) | ((u8Value-1) << HBI_CONFIG_CSHI_Pos)) - -/** - * @brief Set HBI Burst Group Size - * @param[in] u8Value Burst Group Size. - * - \ref HBI_CONFIG_BGSIZE_128 : 128 Bytes - * - \ref HBI_CONFIG_BGSIZE_64 : 64 Bytes - * - \ref HBI_CONFIG_BGSIZE_16 : 16 Bytes - * - \ref HBI_CONFIG_BGSIZE_32 : 32 Bytes - * @return None - * @details This macro set HBI Burst Group Size - * \hideinitializer - */ -#define HBI_CONFIG_SET_BGSIZE(u8Value) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_BGSIZE_Msk))) | u8Value) - -/** - * @brief Set HBI Endian Condition on the Hyper Bus Data Pipe - * @param[in] u8Value Endian Condition on the Hyper Bus Data Pipe. - * - \ref HBI_CONFIG_LITTLE_ENDIAN : Little-Endian - * - \ref HBI_CONFIG_BIG_ENDIAN : Big-Endian - * @return None - * @details This macro set HBI Endian Condition on the Hyper Bus Data Pipe - * \hideinitializer - */ -#define HBI_CONFIG_SET_ENDIAN(u8Value) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_ENDIAN_Msk))) | u8Value) - -/** - * @brief Set HBI Hyper Bus Clock Divider - * @param[in] u8Value Hyper Bus Clock Divider. - * - \ref HBI_CONFIG_CKDIV_HCLK_DIV2 : HCLK/2 - * - \ref HBI_CONFIG_CKDIV_HCLK_DIV4 : HCLK/4 - * @return None - * @details This macro set Hyper Bus Clock Divider - * \hideinitializer - */ -#define HBI_CONFIG_SET_CKDIV(u8Value) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_CKDIV_Msk))) | u8Value) - -/** - * @brief Set HBI Chip Select Maximum Low Time - * @param[in] u32CsMaxLT Set HBI Chip Select Maximum Low Time as u32CsMaxLT HCLK cycles. - u32CsMaxLT must be 1 ~ 2048 - * @return None - * @details This macro set HBI Chip Select Maximum Low Time. - * \hideinitializer - */ -#define HBI_CONFIG_SET_CSMAXLT(u32CsMaxLT) (HBI->CONFIG = (HBI->CONFIG & (~(HBI_CONFIG_CSMAXLT_Msk))) | ((u32CsMaxLT-1) << HBI_CONFIG_CSMAXLT_Pos)) - -/** - * @brief Enable HyperBus Operation Done Interrupt - * @param[in] None - * @return None - * @details This macro enable HyperBus Operation Done Interrupt. - * \hideinitializer - */ -#define HBI_ENABLE_INT (HBI->INTEN |= HBI_INTEN_OPINTEN_Msk) - -/** - * @brief Disable HyperBus Operation Done Interrupt - * @param[in] None - * @return None - * @details This macro disable HyperBus Operation Done Interrupt. - * \hideinitializer - */ -#define HBI_DISABLE_INT (HBI->INTEN &= ~HBI_INTEN_OPINTEN_Msk) - -/////////////////// -/** - * @brief Get HyperBus Operation Done Interrupt - * @param[in] None - * @return 0 = HyperBus operation is busy. - * 1 = HyperBus operation is done. - * @details This macro Get HyperBus Operation Done Interrupt. - * \hideinitializer - */ -#define HBI_GET_INTSTS ((HBI->INTSTS & HBI_INTSTS_OPDONE_Msk)? 1:0) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Function Prototypes */ -/*---------------------------------------------------------------------------------------------------------*/ -void HBI_ResetHyperRAM(void); -void HBI_ExitHSAndDPD(void); -int32_t HBI_ReadHyperRAMReg(uint32_t u32Addr); -int32_t HBI_WriteHyperRAMReg(uint32_t u32Addr, uint32_t u32Value); -uint32_t HBI_Read1Word(uint32_t u32Addr); -uint32_t HBI_Read2Word(uint32_t u32Addr); -void HBI_Write1Byte(uint32_t u32Addr, uint8_t u8Data); -void HBI_Write2Byte(uint32_t u32Addr, uint16_t u16Data); -void HBI_Write3Byte(uint32_t u32Addr, uint32_t u32Data); -void HBI_Write4Byte(uint32_t u32Addr, uint32_t u32Data); - -/*@}*/ /* end of group HBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_HBI_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsotg.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsotg.h deleted file mode 100644 index 8a49f2c5729..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsotg.h +++ /dev/null @@ -1,290 +0,0 @@ -/**************************************************************************//** - * @file nu_hsotg.h - * @version V3.00 - * @brief M460 series HSOTG driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ****************************************************************************/ -#ifndef __NU_HSOTG_H__ -#define __NU_HSOTG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HSOTG_Driver HSOTG Driver - @{ -*/ - - -/** @addtogroup HSOTG_EXPORTED_CONSTANTS HSOTG Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* HSOTG constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define HSOTG_VBUS_EN_ACTIVE_HIGH (0UL) /*!< USB VBUS power switch enable signal is active high. \hideinitializer */ -#define HSOTG_VBUS_EN_ACTIVE_LOW (1UL) /*!< USB VBUS power switch enable signal is active low. \hideinitializer */ -#define HSOTG_VBUS_ST_VALID_HIGH (0UL) /*!< USB VBUS power switch valid status is high. \hideinitializer */ -#define HSOTG_VBUS_ST_VALID_LOW (1UL) /*!< USB VBUS power switch valid status is low. \hideinitializer */ - -#define HSOTG_PHYCTL_FSEL_9_6M (0UL << HSOTG_PHYCTL_FSEL_Pos) /*!< Setting OTG PHY reference clock frequency as 9.6 MHz. \hideinitializer */ -#define HSOTG_PHYCTL_FSEL_10_0M (1UL << HSOTG_PHYCTL_FSEL_Pos) /*!< Setting OTG PHY reference clock frequency as 10 MHz. \hideinitializer */ -#define HSOTG_PHYCTL_FSEL_12_0M (2UL << HSOTG_PHYCTL_FSEL_Pos) /*!< Setting OTG PHY reference clock frequency as 12 MHz. \hideinitializer */ -#define HSOTG_PHYCTL_FSEL_19_2M (3UL << HSOTG_PHYCTL_FSEL_Pos) /*!< Setting OTG PHY reference clock frequency as 19.2 MHz. \hideinitializer */ -#define HSOTG_PHYCTL_FSEL_20_0M (4UL << HSOTG_PHYCTL_FSEL_Pos) /*!< Setting OTG PHY reference clock frequency as 20 MHz. \hideinitializer */ -#define HSOTG_PHYCTL_FSEL_24_0M (5UL << HSOTG_PHYCTL_FSEL_Pos) /*!< Setting OTG PHY reference clock frequency as 24 MHz. \hideinitializer */ -#define HSOTG_PHYCTL_FSEL_50_0M (7UL << HSOTG_PHYCTL_FSEL_Pos) /*!< Setting OTG PHY reference clock frequency as 50 MHz. \hideinitializer */ - - -/*@}*/ /* end of group HSOTG_EXPORTED_CONSTANTS */ - - -/** @addtogroup HSOTG_EXPORTED_FUNCTIONS HSOTG Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable HSOTG function - * @param None - * @return None - * @details This macro will set OTGEN bit of HSOTG_CTL register to enable HSOTG function. - * \hideinitializer - */ -#define HSOTG_ENABLE() (HSOTG->CTL |= HSOTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to disable HSOTG function - * @param None - * @return None - * @details This macro will clear OTGEN bit of HSOTG_CTL register to disable HSOTG function. - * \hideinitializer - */ -#define HSOTG_DISABLE() (HSOTG->CTL &= ~HSOTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to enable USB PHY - * @param None - * @return None - * @details When the USB role is selected as HSOTG device, use this macro to enable USB PHY. - * This macro will set OTGPHYEN bit of HSOTG_PHYCTL register to enable USB PHY. - * \hideinitializer - */ -#define HSOTG_ENABLE_PHY() (HSOTG->PHYCTL |= HSOTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to disable USB PHY - * @param None - * @return None - * @details This macro will clear OTGPHYEN bit of HSOTG_PHYCTL register to disable USB PHY. - * \hideinitializer - */ -#define HSOTG_DISABLE_PHY() (HSOTG->PHYCTL &= ~HSOTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to enable ID detection function - * @param None - * @return None - * @details This macro will set IDDETEN bit of HSOTG_PHYCTL register to enable ID detection function. - * \hideinitializer - */ -#define HSOTG_ENABLE_ID_DETECT() (HSOTG->PHYCTL |= HSOTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to disable ID detection function - * @param None - * @return None - * @details This macro will clear IDDETEN bit of HSOTG_PHYCTL register to disable ID detection function. - * \hideinitializer - */ -#define HSOTG_DISABLE_ID_DETECT() (HSOTG->PHYCTL &= ~HSOTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to enable HSOTG wake-up function - * @param None - * @return None - * @details This macro will set WKEN bit of HSOTG_CTL register to enable HSOTG wake-up function. - * \hideinitializer - */ -#define HSOTG_ENABLE_WAKEUP() (HSOTG->CTL |= HSOTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable HSOTG wake-up function - * @param None - * @return None - * @details This macro will clear WKEN bit of HSOTG_CTL register to disable HSOTG wake-up function. - * \hideinitializer - */ -#define HSOTG_DISABLE_WAKEUP() (HSOTG->CTL &= ~HSOTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to set the polarity of USB_VBUS_EN pin - * @param[in] u32Pol The polarity selection. Valid values are listed below. - * - \ref HSOTG_VBUS_EN_ACTIVE_HIGH - * - \ref HSOTG_VBUS_EN_ACTIVE_LOW - * @return None - * @details This macro is used to set the polarity of external USB VBUS power switch enable signal. - * \hideinitializer - */ -#define HSOTG_SET_VBUS_EN_POL(u32Pol) (HSOTG->PHYCTL = (HSOTG->PHYCTL & (~HSOTG_PHYCTL_VBENPOL_Msk)) | ((u32Pol) << HSOTG_PHYCTL_VBENPOL_Pos)) - -/** - * @brief This macro is used to set the polarity of USB_VBUS_ST pin - * @param[in] u32Pol The polarity selection. Valid values are listed below. - * - \ref HSOTG_VBUS_ST_VALID_HIGH - * - \ref HSOTG_VBUS_ST_VALID_LOW - * @return None - * @details This macro is used to set the polarity of external USB VBUS power switch status signal. - * \hideinitializer - */ -#define HSOTG_SET_VBUS_STS_POL(u32Pol) (HSOTG->PHYCTL = (HSOTG->PHYCTL & (~HSOTG_PHYCTL_VBSTSPOL_Msk)) | ((u32Pol) << HSOTG_PHYCTL_VBSTSPOL_Pos)) - -/** - * @brief This macro is used to enable HSOTG related interrupts - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref HSOTG_INTEN_ROLECHGIEN_Msk - * - \ref HSOTG_INTEN_VBEIEN_Msk - * - \ref HSOTG_INTEN_SRPFIEN_Msk - * - \ref HSOTG_INTEN_HNPFIEN_Msk - * - \ref HSOTG_INTEN_GOIDLEIEN_Msk - * - \ref HSOTG_INTEN_IDCHGIEN_Msk - * - \ref HSOTG_INTEN_PDEVIEN_Msk - * - \ref HSOTG_INTEN_HOSTIEN_Msk - * - \ref HSOTG_INTEN_BVLDCHGIEN_Msk - * - \ref HSOTG_INTEN_AVLDCHGIEN_Msk - * - \ref HSOTG_INTEN_VBCHGIEN_Msk - * - \ref HSOTG_INTEN_SECHGIEN_Msk - * - \ref HSOTG_INTEN_SRPDETIEN_Msk - * @return None - * @details This macro will enable HSOTG related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_ENABLE_INT(u32Mask) (HSOTG->INTEN |= (u32Mask)) - -/** - * @brief This macro is used to disable HSOTG related interrupts - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref HSOTG_INTEN_ROLECHGIEN_Msk - * - \ref HSOTG_INTEN_VBEIEN_Msk - * - \ref HSOTG_INTEN_SRPFIEN_Msk - * - \ref HSOTG_INTEN_HNPFIEN_Msk - * - \ref HSOTG_INTEN_GOIDLEIEN_Msk - * - \ref HSOTG_INTEN_IDCHGIEN_Msk - * - \ref HSOTG_INTEN_PDEVIEN_Msk - * - \ref HSOTG_INTEN_HOSTIEN_Msk - * - \ref HSOTG_INTEN_BVLDCHGIEN_Msk - * - \ref HSOTG_INTEN_AVLDCHGIEN_Msk - * - \ref HSOTG_INTEN_VBCHGIEN_Msk - * - \ref HSOTG_INTEN_SECHGIEN_Msk - * - \ref HSOTG_INTEN_SRPDETIEN_Msk - * @return None - * @details This macro will disable HSOTG related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_DISABLE_INT(u32Mask) (HSOTG->INTEN &= ~(u32Mask)) - -/** - * @brief This macro is used to get HSOTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref HSOTG_INTSTS_ROLECHGIF_Msk - * - \ref HSOTG_INTSTS_VBEIF_Msk - * - \ref HSOTG_INTSTS_SRPFIF_Msk - * - \ref HSOTG_INTSTS_HNPFIF_Msk - * - \ref HSOTG_INTSTS_GOIDLEIF_Msk - * - \ref HSOTG_INTSTS_IDCHGIF_Msk - * - \ref HSOTG_INTSTS_PDEVIF_Msk - * - \ref HSOTG_INTSTS_HOSTIF_Msk - * - \ref HSOTG_INTSTS_BVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_AVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_VBCHGIF_Msk - * - \ref HSOTG_INTSTS_SECHGIF_Msk - * - \ref HSOTG_INTSTS_SRPDETIF_Msk - * @return Interrupt flags of selected sources. - * @details This macro will return HSOTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_GET_INT_FLAG(u32Mask) (HSOTG->INTSTS & (u32Mask)) - -/** - * @brief This macro is used to clear HSOTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref HSOTG_INTSTS_ROLECHGIF_Msk - * - \ref HSOTG_INTSTS_VBEIF_Msk - * - \ref HSOTG_INTSTS_SRPFIF_Msk - * - \ref HSOTG_INTSTS_HNPFIF_Msk - * - \ref HSOTG_INTSTS_GOIDLEIF_Msk - * - \ref HSOTG_INTSTS_IDCHGIF_Msk - * - \ref HSOTG_INTSTS_PDEVIF_Msk - * - \ref HSOTG_INTSTS_HOSTIF_Msk - * - \ref HSOTG_INTSTS_BVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_AVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_VBCHGIF_Msk - * - \ref HSOTG_INTSTS_SECHGIF_Msk - * - \ref HSOTG_INTSTS_SRPDETIF_Msk - * @return None - * @details This macro will clear HSOTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_CLR_INT_FLAG(u32Mask) (HSOTG->INTSTS = (u32Mask)) - -/** - * @brief This macro is used to get HSOTG related status - * @param[in] u32Mask The combination of user specified source. Valid values are listed below. - * - \ref HSOTG_STATUS_OVERCUR_Msk - * - \ref HSOTG_STATUS_IDSTS_Msk - * - \ref HSOTG_STATUS_SESSEND_Msk - * - \ref HSOTG_STATUS_BVLD_Msk - * - \ref HSOTG_STATUS_AVLD_Msk - * - \ref HSOTG_STATUS_VBUSVLD_Msk - * - \ref HSOTG_STATUS_ASPERI_Msk - * - \ref HSOTG_STATUS_ASHOST_Msk - * @return The user specified status. - * @details This macro will return HSOTG related status specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_GET_STATUS(u32Mask) (HSOTG->STATUS & (u32Mask)) - -/** - * @brief Set OTG PHY reference clock frequency - * @param[in] u32RefClock The reference clock selection. Valid values are listed below. - * - \ref HSOTG_PHYCTL_FSEL_9_6M - * - \ref HSOTG_PHYCTL_FSEL_10_0M - * - \ref HSOTG_PHYCTL_FSEL_12_0M - * - \ref HSOTG_PHYCTL_FSEL_19_2M - * - \ref HSOTG_PHYCTL_FSEL_20_0M - * - \ref HSOTG_PHYCTL_FSEL_24_0M - * - \ref HSOTG_PHYCTL_FSEL_50_0M - * @return None - * @details This macro set OTG PHY reference clock frequency. - * \hideinitializer - */ -#define HSOTG_SET_PHY_REF_CLK(u32RefClock) (HSOTG->PHYCTL = (HSOTG->PHYCTL & ~HSOTG_PHYCTL_FSEL_Msk) | (u32RefClock)) - - - -/*@}*/ /* end of group HSOTG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HSOTG_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_HSOTG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsusbd.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsusbd.h deleted file mode 100644 index a98699b51c9..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_hsusbd.h +++ /dev/null @@ -1,404 +0,0 @@ -/**************************************************************************//** - * @file nu_hsusbd.h - * @version V3.00 - * @brief M460 series HSUSBD driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ****************************************************************************/ -#ifndef __NU_HSUSBD_H__ -#define __NU_HSUSBD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HSUSBD_Driver HSUSBD Driver - @{ -*/ - -/** @addtogroup HSUSBD_EXPORTED_CONSTANTS HSUSBD Exported Constants - @{ -*/ -/** @cond HIDDEN_SYMBOLS */ -#define HSUSBD_MAX_EP 12ul - -#define Maximum(a,b) (a)>(b) ? (a) : (b) -#define Minimum(a,b) (((a)<(b)) ? (a) : (b)) - - -#define CEP 0xfful /*!< Control Endpoint \hideinitializer */ -#define EPA 0ul /*!< Endpoint A \hideinitializer */ -#define EPB 1ul /*!< Endpoint B \hideinitializer */ -#define EPC 2ul /*!< Endpoint C \hideinitializer */ -#define EPD 3ul /*!< Endpoint D \hideinitializer */ -#define EPE 4ul /*!< Endpoint E \hideinitializer */ -#define EPF 5ul /*!< Endpoint F \hideinitializer */ -#define EPG 6ul /*!< Endpoint G \hideinitializer */ -#define EPH 7ul /*!< Endpoint H \hideinitializer */ -#define EPI 8ul /*!< Endpoint I \hideinitializer */ -#define EPJ 9ul /*!< Endpoint J \hideinitializer */ -#define EPK 10ul /*!< Endpoint K \hideinitializer */ -#define EPL 11ul /*!< Endpoint L \hideinitializer */ - -/** @endcond HIDDEN_SYMBOLS */ -/********************* Bit definition of CEPCTL register **********************/ -#define HSUSBD_CEPCTL_NAKCLR ((uint32_t)0x00000000ul) /*!PHYCTL |= (HSUSBD_PHYCTL_PHYEN_Msk|HSUSBD_PHYCTL_DPPUEN_Msk))) /*!PHYCTL &= ~HSUSBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= HSUSBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~HSUSBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~HSUSBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= HSUSBD_PHYCTL_DPPUEN_Msk)) /*!FADDR = (addr)) /*!FADDR)) /*!GINTEN = (intr)) /*!BUSINTEN = (intr)) /*!BUSINTSTS) /*!BUSINTSTS = (flag)) /*!CEPINTEN = (intr)) /*!CEPINTSTS = (flag)) /*!CEPCTL = (flag)) /*!CEPTXCNT = (size)) /*!EP[(ep)].EPMPS = (size)) /*!EP[(ep)].EPINTEN = (intr)) /*!EP[(ep)].EPINTSTS) /*!EP[(ep)].EPINTSTS = (flag)) /*!DMACNT = (len)) /*!DMAADDR = (addr)) /*!DMACTL = (HSUSBD->DMACTL & ~HSUSBD_DMACTL_EPNUM_Msk) | HSUSBD_DMACTL_DMARD_Msk | (epnum) | 0x100) /*!DMACTL = (HSUSBD->DMACTL & ~(HSUSBD_DMACTL_EPNUM_Msk | HSUSBD_DMACTL_DMARD_Msk | 0x100)) | (epnum)) /*!DMACTL |= HSUSBD_DMACTL_DMAEN_Msk) /*!PHYCTL & HSUSBD_PHYCTL_VBUSDET_Msk)) /*!BCDC |= HSUSBD_BCDC_BCDEN_Msk)) /*!BCDC &= ~HSUSBD_BCDC_BCDEN_Msk)) /*!LPMCSR |= HSUSBD_LPMCSR_LPMEN_Msk)) /*!LPMCSR &= ~HSUSBD_LPMCSR_LPMEN_Msk)) /*!DMACNT = 0ul; - HSUSBD->DMACTL = 0x80ul; - HSUSBD->DMACTL = 0x00ul; -} -/** - * @brief HSUSBD_SetEpBufAddr, Set Endpoint buffer address - * @param[in] u32Ep Endpoint Number - * @param[in] u32Base Buffer Start Address - * @param[in] u32Len Buffer length - * @retval None. - */ -__STATIC_INLINE void HSUSBD_SetEpBufAddr(uint32_t u32Ep, uint32_t u32Base, uint32_t u32Len) -{ - if (u32Ep == CEP) - { - HSUSBD->CEPBUFST = u32Base; - HSUSBD->CEPBUFEND = u32Base + u32Len - 1ul; - } - else - { - HSUSBD->EP[u32Ep].EPBUFST = u32Base; - HSUSBD->EP[u32Ep].EPBUFEND = u32Base + u32Len - 1ul; - } -} - -/** - * @brief HSUSBD_ConfigEp, Config Endpoint - * @param[in] u32Ep USB endpoint - * @param[in] u32EpNum Endpoint number - * @param[in] u32EpType Endpoint type - * @param[in] u32EpDir Endpoint direction - * @retval None. - */ -__STATIC_INLINE void HSUSBD_ConfigEp(uint32_t u32Ep, uint32_t u32EpNum, uint32_t u32EpType, uint32_t u32EpDir) -{ - if (u32EpType == HSUSBD_EP_CFG_TYPE_BULK) - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD_EP_RSPCTL_FLUSH | HSUSBD_EP_RSPCTL_MODE_AUTO); - } - else if (u32EpType == HSUSBD_EP_CFG_TYPE_INT) - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD_EP_RSPCTL_FLUSH | HSUSBD_EP_RSPCTL_MODE_MANUAL); - } - else if (u32EpType == HSUSBD_EP_CFG_TYPE_ISO) - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD_EP_RSPCTL_FLUSH | HSUSBD_EP_RSPCTL_MODE_FLY); - } - - HSUSBD->EP[u32Ep].EPCFG = (u32EpType | u32EpDir | HSUSBD_EP_CFG_VALID | (u32EpNum << 4)); -} - -/** - * @brief Set USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - */ -__STATIC_INLINE void HSUSBD_SetEpStall(uint32_t u32Ep) -{ - if (u32Ep == CEP) - { - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALL); - } - else - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD->EP[u32Ep].EPRSPCTL & 0xf7ul) | HSUSBD_EP_RSPCTL_HALT; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Set USB endpoint stall state, endpoint will return STALL token. - */ -__STATIC_INLINE void HSUSBD_SetStall(uint32_t u32EpNum) -{ - uint32_t i; - - if (u32EpNum == 0ul) - { - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALL); - } - else - { - for (i = 0ul; i < HSUSBD_MAX_EP; i++) - { - if (((HSUSBD->EP[i].EPCFG & 0xf0ul) >> 4) == u32EpNum) - { - HSUSBD->EP[i].EPRSPCTL = (HSUSBD->EP[i].EPRSPCTL & 0xf7ul) | HSUSBD_EP_RSPCTL_HALT; - } - } - } -} - -/** - * @brief Clear USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - */ -__STATIC_INLINE void HSUSBD_ClearEpStall(uint32_t u32Ep) -{ - HSUSBD->EP[u32Ep].EPRSPCTL = HSUSBD_EP_RSPCTL_TOGGLE; -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Clear USB endpoint stall state, endpoint will return ACK/NAK token. - */ -__STATIC_INLINE void HSUSBD_ClearStall(uint32_t u32EpNum) -{ - uint32_t i; - - for (i = 0ul; i < HSUSBD_MAX_EP; i++) - { - if (((HSUSBD->EP[i].EPCFG & 0xf0ul) >> 4) == u32EpNum) - { - HSUSBD->EP[i].EPRSPCTL = HSUSBD_EP_RSPCTL_TOGGLE; - } - } -} - -/** - * @brief Get USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * @details Get USB endpoint stall state of the specified endpoint ID. - */ -__STATIC_INLINE uint32_t HSUSBD_GetEpStall(uint32_t u32Ep) -{ - return (HSUSBD->EP[u32Ep].EPRSPCTL & HSUSBD_EP_RSPCTL_HALT); -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @retval 0: USB endpoint is not stalled. - * @retval non-0: USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - */ -__STATIC_INLINE uint32_t HSUSBD_GetStall(uint32_t u32EpNum) -{ - uint32_t i; - uint32_t val = 0ul; - - for (i = 0ul; i < HSUSBD_MAX_EP; i++) - { - if (((HSUSBD->EP[i].EPCFG & 0xf0ul) >> 4) == u32EpNum) - { - val = (HSUSBD->EP[i].EPRSPCTL & HSUSBD_EP_RSPCTL_HALT); - break; - } - } - return val; -} - - -/*-------------------------------------------------------------------------------------------*/ -typedef void (*HSUSBD_VENDOR_REQ)(void); /*!CTL0 = ((i2c)->CTL0 & ~0x3c) | (u8Ctrl)) - -/** - * @brief The macro is used to set START condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus START condition in I2C_CTL register. - * \hideinitializer - */ -#define I2C_START(i2c) ((i2c)->CTL0 = ((i2c)->CTL0 & ~I2C_CTL0_SI_Msk) | I2C_CTL0_STA_Msk) - -/** - * @brief The macro is used to wait I2C bus status get ready - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When a new status is presented of I2C bus, the SI flag will be set in I2C_CTL register. - * \hideinitializer - */ -#define I2C_WAIT_READY(i2c) while(!((i2c)->CTL0 & I2C_CTL0_SI_Msk)) - -/** - * @brief The macro is used to Read I2C Bus Data Register - * - * @param[in] i2c Specify I2C port - * - * @return A byte of I2C data register - * - * @details I2C controller read data from bus and save it in I2CDAT register. - * \hideinitializer - */ -#define I2C_GET_DATA(i2c) ((i2c)->DAT) - -/** - * @brief Write a Data to I2C Data Register - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data A byte that writes to data register - * - * @return None - * - * @details When write a data to I2C_DAT register, the I2C controller will shift it to I2C bus. - * \hideinitializer - */ -#define I2C_SET_DATA(i2c, u8Data) ((i2c)->DAT = (u8Data)) - -/** - * @brief Get I2C Bus status code - * - * @param[in] i2c Specify I2C port - * - * @return I2C status code - * - * @details To get this status code to monitor I2C bus event. - * \hideinitializer - */ -#define I2C_GET_STATUS(i2c) ((i2c)->STATUS0) - -/** - * @brief Get Time-out flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 I2C Bus time-out is not happened - * @retval 1 I2C Bus time-out is happened - * - * @details When I2C bus occurs time-out event, the time-out flag will be set. - * \hideinitializer - */ -#define I2C_GET_TIMEOUT_FLAG(i2c) ( ((i2c)->TOCTL & I2C_TOCTL_TOIF_Msk) == I2C_TOCTL_TOIF_Msk ? 1:0 ) - -/** - * @brief To get wake-up flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details I2C bus occurs wake-up event, wake-up flag will be set. - * \hideinitializer - */ -#define I2C_GET_WAKEUP_FLAG(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKIF_Msk) == I2C_WKSTS_WKIF_Msk ? 1:0 ) - -/** - * @brief To clear wake-up flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define I2C_CLEAR_WAKEUP_FLAG(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKIF_Msk) - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * \hideinitializer - * - */ -#define I2C_SMBUS_GET_STATUS(i2c) ((i2c)->BUSSTS) - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return Packet error check byte value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * \hideinitializer - */ -#define I2C_SMBUS_GET_PEC_VALUE(i2c) ((i2c)->PKTCRC) - -/** - * @brief Set SMBus Bytes number of Transmission or reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * \hideinitializer - */ -#define I2C_SMBUS_SET_PACKET_BYTE_COUNT(i2c, u32PktSize) ((i2c)->PKTSIZE = (u32PktSize)) - -/** - * @brief Enable SMBus Alert function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin will pull lo, and reply ACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin is supported to receive alert state(Lo trigger) - * \hideinitializer - */ -#define I2C_SMBUS_ENABLE_ALERT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Disable SMBus Alert pin function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin will pull hi, and reply NACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin is not supported to receive alert state(Lo trigger) - * \hideinitializer - */ -#define I2C_SMBUS_DISABLE_ALERT(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is output mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output mode. - * - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_OUT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is input mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is input mode. - * - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_IN(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin output high state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output hi state. - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_HIGH(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOSTS_Msk) - - -/** - * @brief Set SMBus SUSCON pin output low state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output lo state. - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_LOW(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOSTS_Msk) - -/** - * @brief Enable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The 9th bit can response the ACK or NACK according the received data by user. When the byte is received, SCLK line stretching to low between the 8th and 9th SCLK pulse. - * \hideinitializer - */ -#define I2C_SMBUS_ACK_MANUAL(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Disable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable acknowledge response control by user. - * \hideinitializer - */ -#define I2C_SMBUS_ACK_AUTO(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Enable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * \hideinitializer - */ -#define I2C_SMBUS_9THBIT_INT_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Disable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * \hideinitializer - */ -#define I2C_SMBUS_9THBIT_INT_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Enable SMBus PEC clear at REPEAT START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable the condition of REAEAT START can clear the PEC calculation. - * \hideinitializer - */ -#define I2C_SMBUS_RST_PEC_AT_START_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Disable SMBus PEC clear at Repeat START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable the condition of Repeat START can clear the PEC calculation. - * \hideinitializer - */ -#define I2C_SMBUS_RST_PEC_AT_START_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Enable RX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set RXPDMAEN bit of I2C_CTL1 register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_RX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Enable TX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set TXPDMAEN bit of I2C_CTL1 register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_TX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear RXPDMAEN bit of I2C_CTL1 register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_RX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear TXPDMAEN bit of I2C_CTL1 register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_TX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Enable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Enable this function is to stretch bus by hardware after PDMA transfer is done if SI is not cleared. - * \hideinitializer - */ -#define I2C_ENABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Disable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C will send STOP after PDMA transfers done automatically. - * \hideinitializer - */ -#define I2C_DISABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Reset PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C PDMA engine will be reset after this function is called. - * \hideinitializer - */ -#define I2C_DISABLE_RST_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMARST_Msk) - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c); - -/** - * @brief The macro is used to set STOP condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus STOP condition in I2C_CTL register. - */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c) -{ - uint32_t u32TimeOutCount = I2C_TIMEOUT; - - (i2c)->CTL0 |= (I2C_CTL0_SI_Msk | I2C_CTL0_STO_Msk); - while (i2c->CTL0 & I2C_CTL0_STO_Msk) - { - if (--u32TimeOutCount == 0) break; - } -} - -void I2C_ClearTimeoutFlag(I2C_T *i2c); -void I2C_Close(I2C_T *i2c); -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack); -void I2C_DisableInt(I2C_T *i2c); -void I2C_EnableInt(I2C_T *i2c); -uint32_t I2C_GetBusClockFreq(I2C_T *i2c); -uint32_t I2C_GetIntFlag(I2C_T *i2c); -uint32_t I2C_GetStatus(I2C_T *i2c); -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock); -uint8_t I2C_GetData(I2C_T *i2c); -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode); -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask); -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock); -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout); -void I2C_DisableTimeout(I2C_T *i2c); -void I2C_EnableWakeup(I2C_T *i2c); -void I2C_DisableWakeup(I2C_T *i2c); -void I2C_SetData(I2C_T *i2c, uint8_t u8Data); -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag); -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr); -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint32_t I2C_SMBusGetStatus(I2C_T *i2c); -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize); -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice); -void I2C_SMBusClose(I2C_T *i2c); -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn); -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c); -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk); -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_i2s.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_i2s.h deleted file mode 100644 index e466d6153e5..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_i2s.h +++ /dev/null @@ -1,354 +0,0 @@ -/**************************************************************************//** - * @file nu_i2s.h - * @version V3.00 - * @brief M460 series I2S driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_I2S_H__ -#define __NU_I2S_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ - -#define I2S_DATABIT_8 (0U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 8-bit \hideinitializer */ -#define I2S_DATABIT_16 (1U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 16-bit \hideinitializer */ -#define I2S_DATABIT_24 (2U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 24-bit \hideinitializer */ -#define I2S_DATABIT_32 (3U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 32-bit \hideinitializer */ - -/* Audio Format */ -#define I2S_MONO I2S_CTL0_MONO_Msk /*!< Mono channel \hideinitializer */ -#define I2S_STEREO (0U) /*!< Stereo channel \hideinitializer */ -#define I2S_ENABLE_MONO I2S_MONO -#define I2S_DISABLE_MONO I2S_STEREO - -/* I2S Data Format */ -#define I2S_FORMAT_I2S (0U << I2S_CTL0_FORMAT_Pos) /*!< I2S data format \hideinitializer */ -#define I2S_FORMAT_I2S_MSB (1U << I2S_CTL0_FORMAT_Pos) /*!< I2S MSB data format \hideinitializer */ -#define I2S_FORMAT_I2S_LSB (2U << I2S_CTL0_FORMAT_Pos) /*!< I2S LSB data format \hideinitializer */ -#define I2S_FORMAT_PCM (4U << I2S_CTL0_FORMAT_Pos) /*!< PCM data format \hideinitializer */ -#define I2S_FORMAT_PCM_MSB (5U << I2S_CTL0_FORMAT_Pos) /*!< PCM MSB data format \hideinitializer */ -#define I2S_FORMAT_PCM_LSB (6U << I2S_CTL0_FORMAT_Pos) /*!< PCM LSB data format \hideinitializer */ - -/* I2S Data Format */ -#define I2S_ORDER_AT_MSB (0U) /*!< Channel data is at MSB \hideinitializer */ -#define I2S_ORDER_AT_LSB I2S_CTL0_ORDER_Msk /*!< Channel data is at LSB \hideinitializer */ - -/* I2S TDM Channel Number */ -#define I2S_TDM_2CH 0U /*!< Use TDM 2 channel \hideinitializer */ -#define I2S_TDM_4CH 1U /*!< Use TDM 4 channel \hideinitializer */ -#define I2S_TDM_6CH 2U /*!< Use TDM 6 channel \hideinitializer */ -#define I2S_TDM_8CH 3U /*!< Use TDM 8 channel \hideinitializer */ - -/* I2S TDM Channel Width */ -#define I2S_TDM_WIDTH_8BIT 0U /*!< TDM channel witch is 8-bit \hideinitializer */ -#define I2S_TDM_WIDTH_16BIT 1U /*!< TDM channel witch is 16-bit \hideinitializer */ -#define I2S_TDM_WIDTH_24BIT 2U /*!< TDM channel witch is 24-bit \hideinitializer */ -#define I2S_TDM_WIDTH_32BIT 3U /*!< TDM channel witch is 32-bit \hideinitializer */ - -/* I2S TDM Sync Width */ -#define I2S_TDM_SYNC_ONE_BCLK 0U /*!< TDM sync widht is one BLCK period \hideinitializer */ -#define I2S_TDM_SYNC_ONE_CHANNEL 1U /*!< TDM sync widht is one channel period \hideinitializer */ - -/* I2S Operation mode */ -#define I2S_MODE_SLAVE I2S_CTL0_SLAVE_Msk /*!< As slave mode \hideinitializer */ -#define I2S_MODE_MASTER (0U) /*!< As master mode \hideinitializer */ - -/* I2S FIFO Threshold */ -#define I2S_FIFO_TX_LEVEL_WORD_0 (0U) /*!< TX threshold is 0 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_1 (1U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_2 (2U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_3 (3U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_4 (4U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_5 (5U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_6 (6U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_7 (7U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_8 (8U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_9 (9U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_10 (10U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_11 (11U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_12 (12U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_13 (13U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_14 (14U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_15 (15U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 15 words \hideinitializer */ - -#define I2S_FIFO_RX_LEVEL_WORD_1 (0U) /*!< RX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_2 (1U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_3 (2U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_4 (3U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_5 (4U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_6 (5U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_7 (6U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_8 (7U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_9 (8U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_10 (9U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_11 (10U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_12 (11U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_13 (12U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_14 (13U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_15 (14U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 15 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_16 (15U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 16 words \hideinitializer */ - -/* I2S Record Channel */ -#define I2S_MONO_RIGHT (0U) /*!< Record mono right channel \hideinitializer */ -#define I2S_MONO_LEFT I2S_CTL0_RXLCH_Msk /*!< Record mono left channel \hideinitializer */ - -/* I2S Channel */ -#define I2S_RIGHT (0U) /*!< Select right channel \hideinitializer */ -#define I2S_LEFT (1U) /*!< Select left channel \hideinitializer */ - -/*@}*/ /* end of group I2S_EXPORTED_CONSTANTS */ - - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -/** - * @brief Enable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_ENABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if ((u32ChMask > 0U) && (u32ChMask < 9U)) - { - i2s->CTL1 |= ((uint32_t)1U << (u32ChMask - 1U)); - } -} - -/** - * @brief Disable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_DISABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if ((u32ChMask > 0U) && (u32ChMask < 9U)) - { - i2s->CTL1 &= ~((uint32_t)1U << (u32ChMask - 1U)); - } -} - -/** - * @brief Enable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXEN_Msk ) - -/** - * @brief Disable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXEN_Msk ) - -/** - * @brief Enable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXEN_Msk ) - -/** - * @brief Disable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXEN_Msk ) - -/** - * @brief Enable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX_MUTE(i2s) ( (i2s)->CTL0 |= I2S_CTL0_MUTE_Msk ) - -/** - * @brief Disable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX_MUTE(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_MUTE_Msk ) - -/** - * @brief Clear Tx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_TX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXFBCLR_Msk ) - -/** - * @brief Clear Rx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_RX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref I2S_MONO_LEFT - * - \ref I2S_MONO_RIGHT - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_SET_MONO_RX_CHANNEL(I2S_T *i2s, uint32_t u32Ch) -{ - u32Ch == I2S_MONO_LEFT ? - (i2s->CTL0 |= I2S_CTL0_RXLCH_Msk) : - (i2s->CTL0 &= ~I2S_CTL0_RXLCH_Msk); -} - -/** - * @brief Write data to I2S Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Data: The data written to FIFO. - * @return none - * \hideinitializer - */ -#define I2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TXFIFO = (u32Data) ) - -/** - * @brief Read Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return Data in Rx FIFO. - * \hideinitializer - */ -#define I2S_READ_RX_FIFO(i2s) ( (i2s)->RXFIFO ) - -/** - * @brief This function gets the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 & (u32Mask) ) - -/** - * @brief This function clears the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 |= (u32Mask) ) - -/** - * @brief This function gets the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 & (u32Mask) ) - -/** - * @brief This function clears the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 |= (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_TX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_TXCNT_Msk) >> I2S_STATUS1_TXCNT_Pos) & 0xF ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_RX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_RXCNT_Msk) >> I2S_STATUS1_RXCNT_Pos) & 0xF ) - -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat); -void I2S_Close(I2S_T *i2s); -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask); -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask); -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock); -void I2S_DisableMCLK(I2S_T *i2s); -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth); - - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_I2S_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_keystore.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_keystore.h deleted file mode 100644 index f5e6d5d8d4f..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_keystore.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************//** - * @file nu_keystore.h - * @version V3.00 - * @brief Key Store Driver Header - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_KEYSTORE_H__ -#define __NU_KEYSTORE_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KS_Driver Key Store Driver - @{ -*/ - -/** @addtogroup KS_EXPORTED_CONSTANTS Key Store Exported Constants - @{ -*/ - -#define KS_TOMETAKEY(x) (((uint32_t)(x) << KS_METADATA_NUMBER_Pos) & KS_METADATA_NUMBER_Msk) -#define KS_TOKEYIDX(x) (((uint32_t)(x) & KS_METADATA_NUMBER_Msk) >> KS_METADATA_NUMBER_Pos) - -typedef enum KSMEM -{ - KS_SRAM = 0, /*!< Volatile Memory */ - KS_FLASH = 1, /*!< Non-volatile Memory */ - KS_OTP = 2 /*!< One-Time Programming Memory */ -} KS_MEM_Type; - -#define KS_OP_READ (0 << KS_CTL_OPMODE_Pos) -#define KS_OP_WRITE (1 << KS_CTL_OPMODE_Pos) -#define KS_OP_ERASE (2 << KS_CTL_OPMODE_Pos) -#define KS_OP_ERASE_ALL (3 << KS_CTL_OPMODE_Pos) -#define KS_OP_REVOKE (4 << KS_CTL_OPMODE_Pos) -#define KS_OP_REMAN (5 << KS_CTL_OPMODE_Pos) -#define KS_OP_LOCK (7 << KS_CTL_OPMODE_Pos) - -#define KS_OWNER_AES (0ul) -#define KS_OWNER_HMAC (1ul) -#define KS_OWNER_RSA_EXP (2ul) -#define KS_OWNER_RSA_MID (3ul) -#define KS_OWNER_ECC (4ul) -#define KS_OWNER_CPU (5ul) - -#define KS_META_AES (0ul << KS_METADATA_OWNER_Pos) /*!< AES Access Only */ -#define KS_META_HMAC (1ul << KS_METADATA_OWNER_Pos) /*!< HMAC Access Only */ -#define KS_META_RSA_EXP (2ul << KS_METADATA_OWNER_Pos) /*!< RSA_EXP Access Only */ -#define KS_META_RSA_MID (3ul << KS_METADATA_OWNER_Pos) /*!< RSA_MID Access Only */ -#define KS_META_ECC (4ul << KS_METADATA_OWNER_Pos) /*!< ECC Access Only */ -#define KS_META_CPU (5ul << KS_METADATA_OWNER_Pos) /*!< CPU Access Only */ - -#define KS_META_128 ( 0ul << KS_METADATA_SIZE_Pos) /*!< Key size 128 bits */ -#define KS_META_163 ( 1ul << KS_METADATA_SIZE_Pos) /*!< Key size 163 bits */ -#define KS_META_192 ( 2ul << KS_METADATA_SIZE_Pos) /*!< Key size 192 bits */ -#define KS_META_224 ( 3ul << KS_METADATA_SIZE_Pos) /*!< Key size 224 bits */ -#define KS_META_233 ( 4ul << KS_METADATA_SIZE_Pos) /*!< Key size 233 bits */ -#define KS_META_255 ( 5ul << KS_METADATA_SIZE_Pos) /*!< Key size 255 bits */ -#define KS_META_256 ( 6ul << KS_METADATA_SIZE_Pos) /*!< Key size 256 bits */ -#define KS_META_283 ( 7ul << KS_METADATA_SIZE_Pos) /*!< Key size 283 bits */ -#define KS_META_384 ( 8ul << KS_METADATA_SIZE_Pos) /*!< Key size 384 bits */ -#define KS_META_409 ( 9ul << KS_METADATA_SIZE_Pos) /*!< Key size 409 bits */ -#define KS_META_512 (10ul << KS_METADATA_SIZE_Pos) /*!< Key size 512 bits */ -#define KS_META_521 (11ul << KS_METADATA_SIZE_Pos) /*!< Key size 521 bits */ -#define KS_META_571 (12ul << KS_METADATA_SIZE_Pos) /*!< Key size 571 bits */ -#define KS_META_1024 (16ul << KS_METADATA_SIZE_Pos) /*!< Key size 1024 bits */ -#define KS_META_1536 (17ul << KS_METADATA_SIZE_Pos) /*!< Key size 1024 bits */ -#define KS_META_2048 (18ul << KS_METADATA_SIZE_Pos) /*!< Key size 2048 bits */ -#define KS_META_3072 (19ul << KS_METADATA_SIZE_Pos) /*!< Key size 1024 bits */ -#define KS_META_4096 (20ul << KS_METADATA_SIZE_Pos) /*!< Key size 4096 bits */ - -#define KS_META_BOOT ( 1ul << KS_METADATA_BS_Pos) /*!< Key only used for boot ROM only */ - -#define KS_META_READABLE (1ul << KS_METADATA_READABLE_Pos) /*!< Allow the key to be read by software */ - -#define KS_META_PRIV (1ul << KS_METADATA_PRIV_Pos) /*!< Privilege key */ -#define KS_META_NONPRIV (0ul << KS_METADATA_PRIV_Pos) /*!< Non-privilege key */ - -#define KS_META_SECURE (1ul << KS_METADATA_SEC_Pos) /*!< Secure key */ -#define KS_META_NONSECURE (0ul << KS_METADATA_SEC_Pos) /*!< Non-secure key */ - -#define KS_TIMEOUT SystemCoreClock /*!< 1 second time-out \hideinitializer */ - -#define KS_OK ( 0L) -#define KS_ERR_FAIL (-1L) /*!< KS failed */ -#define KS_ERR_TIMEOUT (-2L) /*!< KS operation abort due to timeout error */ -#define KS_ERR_INIT (-3L) /*!< KS intital fail */ -#define KS_ERR_BUSY (-4L) /*!< KS is in busy state */ -#define KS_ERR_PARAMETER (-5L) /*!< Wrong input parameters */ - -/** - * @brief Enable scramble function - * @details This function is used to enable scramle function of Key Store. - */ - -#define KS_SCRAMBLING() KS->CTL |= KS_CTL_SCMB_Msk - - - - -/**@}*/ /* end of group KS_EXPORTED_CONSTANTS */ - -extern int32_t g_KS_i32ErrCode; - -/** @addtogroup KS_EXPORTED_FUNCTIONS Key Store Exported Functions - @{ -*/ - -int32_t KS_Open(void); -int32_t KS_Read(KS_MEM_Type type, int32_t i32KeyIdx, uint32_t au32Key[], uint32_t u32WordCnt); -int32_t KS_Write(KS_MEM_Type eType, uint32_t u32Meta, uint32_t au32Key[]); -int32_t KS_WriteOTP(int32_t i32KeyIdx, uint32_t u32Meta, uint32_t au32Key[]); -int32_t KS_EraseKey(int32_t i32KeyIdx); -int32_t KS_EraseOTPKey(int32_t i32KeyIdx); -int32_t KS_LockOTPKey(int32_t i32KeyIdx); -int32_t KS_EraseAll(KS_MEM_Type eType); -int32_t KS_RevokeKey(KS_MEM_Type eType, int32_t i32KeyIdx); -uint32_t KS_GetRemainSize(KS_MEM_Type eType); -int32_t KS_ToggleSRAM(void); -uint32_t KS_GetKeyWordCnt(uint32_t u32Meta); -uint32_t KS_GetRemainKeyCount(KS_MEM_Type mem); - -/**@}*/ /* end of group KS_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group KS_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_KEYSTORE_H__ */ - - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_kpi.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_kpi.h deleted file mode 100644 index d892f581293..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_kpi.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************//** - * @file nu_kpi.h - * @version V3.00 - * @brief Keypad interface driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_KPI_H__ -#define __NU_KPI_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KPI_Driver KPI Driver - @{ -*/ - -/** @addtogroup KPI_EXPORTED_CONSTANTS KPI Exported Constants - @{ -*/ - -#define KPI_MAX_ROW 6 -#define KPI_MAX_COL 8 -#define KPI_MAX_KEYS (KPI_MAX_ROW * KPI_MAX_COL) - -#define KPI_PRESS 0 -#define KPI_RELEASE 1 - -typedef struct -{ - uint8_t x; - uint8_t y; - uint16_t st; -} KPI_KEY_T; - -/**@}*/ /* end of group KPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup KPI_EXPORTED_FUNCTIONS KPI Exported Functions - @{ -*/ - -int32_t KPI_Open(uint32_t u32Rows, uint32_t u32Columns, KPI_KEY_T *pkeyQueue, uint32_t u32MaxKeyCnt); -void KPI_Close(void); -int32_t KPI_kbhit(void); -KPI_KEY_T KPI_GetKey(void); -void KPI_SetSampleTime(uint32_t ms); - -/**@}*/ /* end of group KPI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group KPI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_KPI_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_opa.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_opa.h deleted file mode 100644 index 79d0911512f..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_opa.h +++ /dev/null @@ -1,209 +0,0 @@ -/**************************************************************************//** - * @file nu_opa.h - * @version V3.00 - * @brief M480 series OPA driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_OPA_H__ -#define __NU_OPA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup OPA_Driver OPA Driver - @{ -*/ - -/** @addtogroup OPA_EXPORTED_CONSTANTS OPA Exported Constants - @{ -*/ -#define OPA_CALIBRATION_CLK_1K (0UL) /*!< OPA calibration clock select 1 KHz \hideinitializer */ -#define OPA_CALIBRATION_RV_1_2_AVDD (0UL) /*!< OPA calibration reference voltage select 1/2 AVDD \hideinitializer */ -#define OPA_CALIBRATION_RV_H_L_VCM (1UL) /*!< OPA calibration reference voltage select from high vcm to low vcm \hideinitializer */ - -/*@}*/ /* end of group OPA_EXPORTED_CONSTANTS */ - -/** @addtogroup OPA_EXPORTED_FUNCTIONS OPA Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define OPA functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -__STATIC_INLINE int32_t OPA_Calibration(OPA_T *opa, uint32_t u32OpaNum, uint32_t u32ClockSel, uint32_t u32LevelSel); - -/** - * @brief This macro is used to power on the OPA circuit - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will set OPx_EN (x=0, 1) bit of OPACR register to power on the OPA circuit. - * @note Remember to enable HIRC clock while power on the OPA circuit. - * \hideinitializer - */ -#define OPA_POWER_ON(opa, u32OpaNum) ((opa)->CTL |= (1UL<<(OPA_CTL_OPEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to power down the OPA circuit - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will clear OPx_EN (x=0, 1) bit of OPACR register to power down the OPA circuit. - * \hideinitializer - */ -#define OPA_POWER_DOWN(opa, u32OpaNum) ((opa)->CTL &= ~(1UL<<(OPA_CTL_OPEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to enable the OPA Schmitt trigger buffer - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will set OPSCHx_EN (x=0, 1) bit of OPACR register to enable the OPA Schmitt trigger buffer. - * \hideinitializer - */ -#define OPA_ENABLE_SCH_TRIGGER(opa, u32OpaNum) ((opa)->CTL |= (1UL<<(OPA_CTL_OPDOEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to disable the OPA Schmitt trigger buffer - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will clear OPSCHx_EN (x=0, 1) bit of OPACR register to disable the OPA Schmitt trigger buffer. - * \hideinitializer - */ -#define OPA_DISABLE_SCH_TRIGGER(opa, u32OpaNum) ((opa)->CTL &= ~(1UL<<(OPA_CTL_OPDOEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to enable OPA Schmitt trigger digital output interrupt - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will set OPDIEx (x=0, 1) bit of OPACR register to enable the OPA Schmitt trigger digital output interrupt. - * \hideinitializer - */ -#define OPA_ENABLE_INT(opa, u32OpaNum) ((opa)->CTL |= (1UL<<(OPA_CTL_OPDOIEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to disable OPA Schmitt trigger digital output interrupt - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will clear OPDIEx (x=0, 1) bit of OPACR register to disable the OPA Schmitt trigger digital output interrupt. - * \hideinitializer - */ -#define OPA_DISABLE_INT(opa, u32OpaNum) ((opa)->CTL &= ~(1UL<<(OPA_CTL_OPDOIEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to get OPA digital output state - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return OPA digital output state - * @details This macro will return the OPA digital output value. - * \hideinitializer - */ -#define OPA_GET_DIGITAL_OUTPUT(opa, u32OpaNum) (((opa)->STATUS & (OPA_STATUS_OPDO0_Msk<<(u32OpaNum)))?1UL:0UL) - -/** - * @brief This macro is used to get OPA interrupt flag - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @retval 0 OPA interrupt does not occur. - * @retval 1 OPA interrupt occurs. - * @details This macro will return the ACMP interrupt flag. - * \hideinitializer - */ -#define OPA_GET_INT_FLAG(opa, u32OpaNum) (((opa)->STATUS & (OPA_STATUS_OPDOIF0_Msk<<(u32OpaNum)))?1UL:0UL) - -/** - * @brief This macro is used to clear OPA interrupt flag - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will write 1 to OPDFx (x=0,1) bit of OPASR register to clear interrupt flag. - * \hideinitializer - */ -#define OPA_CLR_INT_FLAG(opa, u32OpaNum) ((opa)->STATUS = (OPA_STATUS_OPDOIF0_Msk<<(u32OpaNum))) - - -/** - * @brief This function is used to configure and start OPA calibration - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @param[in] u32ClockSel Select OPA calibration clock - * - \ref OPA_CALIBRATION_CLK_1K - * @param[in] u32RefVol Select OPA reference voltage - * - \ref OPA_CALIBRATION_RV_1_2_AVDD - * - \ref OPA_CALIBRATION_RV_H_L_VCM - * @retval 0 PMOS and NMOS calibration successfully. - * @retval -1 only PMOS calibration failed. - * @retval -2 only NMOS calibration failed. - * @retval -3 PMOS and NMOS calibration failed. - */ -__STATIC_INLINE int32_t OPA_Calibration(OPA_T *opa, - uint32_t u32OpaNum, - uint32_t u32ClockSel, - uint32_t u32RefVol) -{ - uint32_t u32CALResult; - int32_t i32Ret = 0L; - - (opa)->CALCTL = (((opa)->CALCTL) & ~(OPA_CALCTL_CALCLK0_Msk << (u32OpaNum << 1))); - (opa)->CALCTL = (((opa)->CALCTL) & ~(OPA_CALCTL_CALRVS0_Msk << (u32OpaNum))) | (((u32RefVol) << OPA_CALCTL_CALRVS0_Pos) << (u32OpaNum)); - (opa)->CALCTL |= (OPA_CALCTL_CALTRG0_Msk << (u32OpaNum)); - while ((opa)->CALCTL & (OPA_CALCTL_CALTRG0_Msk << (u32OpaNum))) {} - - u32CALResult = ((opa)->CALST >> ((u32OpaNum) * 4U)) & (OPA_CALST_CALNS0_Msk | OPA_CALST_CALPS0_Msk); - if (u32CALResult == 0U) - { - i32Ret = 0L; - } - else if (u32CALResult == OPA_CALST_CALNS0_Msk) - { - i32Ret = -2L; - } - else if (u32CALResult == OPA_CALST_CALPS0_Msk) - { - i32Ret = -1L; - } - else if (u32CALResult == (OPA_CALST_CALNS0_Msk | OPA_CALST_CALPS0_Msk)) - { - i32Ret = -3L; - } - - return i32Ret; -} - -/** - * @brief This macro is used to generate asynchronous reset signals to OPA controller - * @param None - * @return None - * \hideinitializer - */ -#define OPA_Reset() \ -do { \ - SYS->IPRST2 |= SYS_IPRST2_OPARST_Msk; \ - SYS->IPRST2 &= ~SYS_IPRST2_OPARST_Msk; \ -} while(0) - -/*@}*/ /* end of group OPA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group OPA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_OPA_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_otg.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_otg.h deleted file mode 100644 index 274f630423b..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_otg.h +++ /dev/null @@ -1,266 +0,0 @@ -/**************************************************************************//** - * @file nu_otg.h - * @version V3.00 - * @brief M460 series OTG driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ****************************************************************************/ -#ifndef __NU_OTG_H__ -#define __NU_OTG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup OTG_Driver OTG Driver - @{ -*/ - - -/** @addtogroup OTG_EXPORTED_CONSTANTS OTG Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* OTG constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define OTG_VBUS_EN_ACTIVE_HIGH (0UL) /*!< USB VBUS power switch enable signal is active high. \hideinitializer */ -#define OTG_VBUS_EN_ACTIVE_LOW (1UL) /*!< USB VBUS power switch enable signal is active low. \hideinitializer */ -#define OTG_VBUS_ST_VALID_HIGH (0UL) /*!< USB VBUS power switch valid status is high. \hideinitializer */ -#define OTG_VBUS_ST_VALID_LOW (1UL) /*!< USB VBUS power switch valid status is low. \hideinitializer */ - - -/*@}*/ /* end of group OTG_EXPORTED_CONSTANTS */ - - -/** @addtogroup OTG_EXPORTED_FUNCTIONS OTG Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable OTG function - * @param None - * @return None - * @details This macro will set OTGEN bit of OTG_CTL register to enable OTG function. - * \hideinitializer - */ -#define OTG_ENABLE() (OTG->CTL |= OTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to disable OTG function - * @param None - * @return None - * @details This macro will clear OTGEN bit of OTG_CTL register to disable OTG function. - * \hideinitializer - */ -#define OTG_DISABLE() (OTG->CTL &= ~OTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to enable USB PHY - * @param None - * @return None - * @details When the USB role is selected as OTG device, use this macro to enable USB PHY. - * This macro will set OTGPHYEN bit of OTG_PHYCTL register to enable USB PHY. - * \hideinitializer - */ -#define OTG_ENABLE_PHY() (OTG->PHYCTL |= OTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to disable USB PHY - * @param None - * @return None - * @details This macro will clear OTGPHYEN bit of OTG_PHYCTL register to disable USB PHY. - * \hideinitializer - */ -#define OTG_DISABLE_PHY() (OTG->PHYCTL &= ~OTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to enable ID detection function - * @param None - * @return None - * @details This macro will set IDDETEN bit of OTG_PHYCTL register to enable ID detection function. - * \hideinitializer - */ -#define OTG_ENABLE_ID_DETECT() (OTG->PHYCTL |= OTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to disable ID detection function - * @param None - * @return None - * @details This macro will clear IDDETEN bit of OTG_PHYCTL register to disable ID detection function. - * \hideinitializer - */ -#define OTG_DISABLE_ID_DETECT() (OTG->PHYCTL &= ~OTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to enable OTG wake-up function - * @param None - * @return None - * @details This macro will set WKEN bit of OTG_CTL register to enable OTG wake-up function. - * \hideinitializer - */ -#define OTG_ENABLE_WAKEUP() (OTG->CTL |= OTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable OTG wake-up function - * @param None - * @return None - * @details This macro will clear WKEN bit of OTG_CTL register to disable OTG wake-up function. - * \hideinitializer - */ -#define OTG_DISABLE_WAKEUP() (OTG->CTL &= ~OTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to set the polarity of USB_VBUS_EN pin - * @param[in] u32Pol The polarity selection. Valid values are listed below. - * - \ref OTG_VBUS_EN_ACTIVE_HIGH - * - \ref OTG_VBUS_EN_ACTIVE_LOW - * @return None - * @details This macro is used to set the polarity of external USB VBUS power switch enable signal. - * \hideinitializer - */ -#define OTG_SET_VBUS_EN_POL(u32Pol) (OTG->PHYCTL = (OTG->PHYCTL & (~OTG_PHYCTL_VBENPOL_Msk)) | ((u32Pol) << OTG_PHYCTL_VBENPOL_Pos)) - -/** - * @brief This macro is used to set the polarity of USB_VBUS_ST pin - * @param[in] u32Pol The polarity selection. Valid values are listed below. - * - \ref OTG_VBUS_ST_VALID_HIGH - * - \ref OTG_VBUS_ST_VALID_LOW - * @return None - * @details This macro is used to set the polarity of external USB VBUS power switch status signal. - * \hideinitializer - */ -#define OTG_SET_VBUS_STS_POL(u32Pol) (OTG->PHYCTL = (OTG->PHYCTL & (~OTG_PHYCTL_VBSTSPOL_Msk)) | ((u32Pol) << OTG_PHYCTL_VBSTSPOL_Pos)) - -/** - * @brief This macro is used to enable OTG related interrupts - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTEN_ROLECHGIEN_Msk - * - \ref OTG_INTEN_VBEIEN_Msk - * - \ref OTG_INTEN_SRPFIEN_Msk - * - \ref OTG_INTEN_HNPFIEN_Msk - * - \ref OTG_INTEN_GOIDLEIEN_Msk - * - \ref OTG_INTEN_IDCHGIEN_Msk - * - \ref OTG_INTEN_PDEVIEN_Msk - * - \ref OTG_INTEN_HOSTIEN_Msk - * - \ref OTG_INTEN_BVLDCHGIEN_Msk - * - \ref OTG_INTEN_AVLDCHGIEN_Msk - * - \ref OTG_INTEN_VBCHGIEN_Msk - * - \ref OTG_INTEN_SECHGIEN_Msk - * - \ref OTG_INTEN_SRPDETIEN_Msk - * @return None - * @details This macro will enable OTG related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_ENABLE_INT(u32Mask) (OTG->INTEN |= (u32Mask)) - -/** - * @brief This macro is used to disable OTG related interrupts - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTEN_ROLECHGIEN_Msk - * - \ref OTG_INTEN_VBEIEN_Msk - * - \ref OTG_INTEN_SRPFIEN_Msk - * - \ref OTG_INTEN_HNPFIEN_Msk - * - \ref OTG_INTEN_GOIDLEIEN_Msk - * - \ref OTG_INTEN_IDCHGIEN_Msk - * - \ref OTG_INTEN_PDEVIEN_Msk - * - \ref OTG_INTEN_HOSTIEN_Msk - * - \ref OTG_INTEN_BVLDCHGIEN_Msk - * - \ref OTG_INTEN_AVLDCHGIEN_Msk - * - \ref OTG_INTEN_VBCHGIEN_Msk - * - \ref OTG_INTEN_SECHGIEN_Msk - * - \ref OTG_INTEN_SRPDETIEN_Msk - * @return None - * @details This macro will disable OTG related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_DISABLE_INT(u32Mask) (OTG->INTEN &= ~(u32Mask)) - -/** - * @brief This macro is used to get OTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTSTS_ROLECHGIF_Msk - * - \ref OTG_INTSTS_VBEIF_Msk - * - \ref OTG_INTSTS_SRPFIF_Msk - * - \ref OTG_INTSTS_HNPFIF_Msk - * - \ref OTG_INTSTS_GOIDLEIF_Msk - * - \ref OTG_INTSTS_IDCHGIF_Msk - * - \ref OTG_INTSTS_PDEVIF_Msk - * - \ref OTG_INTSTS_HOSTIF_Msk - * - \ref OTG_INTSTS_BVLDCHGIF_Msk - * - \ref OTG_INTSTS_AVLDCHGIF_Msk - * - \ref OTG_INTSTS_VBCHGIF_Msk - * - \ref OTG_INTSTS_SECHGIF_Msk - * - \ref OTG_INTSTS_SRPDETIF_Msk - * @return Interrupt flags of selected sources. - * @details This macro will return OTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_GET_INT_FLAG(u32Mask) (OTG->INTSTS & (u32Mask)) - -/** - * @brief This macro is used to clear OTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTSTS_ROLECHGIF_Msk - * - \ref OTG_INTSTS_VBEIF_Msk - * - \ref OTG_INTSTS_SRPFIF_Msk - * - \ref OTG_INTSTS_HNPFIF_Msk - * - \ref OTG_INTSTS_GOIDLEIF_Msk - * - \ref OTG_INTSTS_IDCHGIF_Msk - * - \ref OTG_INTSTS_PDEVIF_Msk - * - \ref OTG_INTSTS_HOSTIF_Msk - * - \ref OTG_INTSTS_BVLDCHGIF_Msk - * - \ref OTG_INTSTS_AVLDCHGIF_Msk - * - \ref OTG_INTSTS_VBCHGIF_Msk - * - \ref OTG_INTSTS_SECHGIF_Msk - * - \ref OTG_INTSTS_SRPDETIF_Msk - * @return None - * @details This macro will clear OTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_CLR_INT_FLAG(u32Mask) (OTG->INTSTS = (u32Mask)) - -/** - * @brief This macro is used to get OTG related status - * @param[in] u32Mask The combination of user specified source. Valid values are listed below. - * - \ref OTG_STATUS_OVERCUR_Msk - * - \ref OTG_STATUS_IDSTS_Msk - * - \ref OTG_STATUS_SESSEND_Msk - * - \ref OTG_STATUS_BVLD_Msk - * - \ref OTG_STATUS_AVLD_Msk - * - \ref OTG_STATUS_VBUSVLD_Msk - * - \ref OTG_STATUS_ASPERI_Msk - * - \ref OTG_STATUS_ASHOST_Msk - * @return The user specified status. - * @details This macro will return OTG related status specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_GET_STATUS(u32Mask) (OTG->STATUS & (u32Mask)) - - - -/*@}*/ /* end of group OTG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group OTG_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_OTG_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_pdma.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_pdma.h deleted file mode 100644 index ccccfc908bb..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_pdma.h +++ /dev/null @@ -1,446 +0,0 @@ -/**************************************************************************//** - * @file nu_pdma.h - * @version V1.00 - * @brief PDMA driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PDMA_H__ -#define __NU_PDMA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - -/** @addtogroup PDMA_EXPORTED_CONSTANTS PDMA Exported Constants - @{ -*/ -#define PDMA_CH_MAX 16UL /*!< Specify Maximum Channels of PDMA \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Operation Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_OP_STOP 0x00000000UL /*!INTSTS)) - -/** - * @brief Get Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_TD_STS(pdma) ((uint32_t)((pdma)->TDSTS)) - -/** - * @brief Clear Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TD_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->TDSTS = (u32Mask))) - -/** - * @brief Get Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ABORT_STS(pdma) ((uint32_t)((pdma)->ABTSTS)) - -/** - * @brief Clear Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ABORT_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->ABTSTS = (u32Mask))) - -/** - * @brief Get Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ALIGN_STS(pdma) ((uint32_t)((pdma)->ALIGN)) - -/** - * @brief Clear Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ALIGN_FLAG(pdma, u32Mask) ((uint32_t)((pdma)->ALIGN = (u32Mask))) - -/** - * @brief Clear Timeout Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details Clear the selected channel timeout interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TMOUT_FLAG(pdma, u32Ch) ((uint32_t)((pdma)->INTSTS = (1UL << ((u32Ch) + 8UL)))) - -/** - * @brief Check Channel Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @retval 0 Idle state - * @retval 1 Busy state - * - * @details Check the selected channel is busy or not. - * \hideinitializer - */ -#define PDMA_IS_CH_BUSY(pdma, u32Ch) ((uint32_t)((pdma)->TRGSTS & (1UL << (u32Ch)))? 1 : 0) - -/** - * @brief Set Source Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel source address. - * \hideinitializer - */ -#define PDMA_SET_SRC_ADDR(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].SA = (u32Addr))) - -/** - * @brief Set Destination Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel destination address. - * \hideinitializer - */ -#define PDMA_SET_DST_ADDR(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].DA = (u32Addr))) - -/** - * @brief Set Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32TransCount Transfer Count - * - * @return None - * - * @details This macro set the selected channel transfer count. - * \hideinitializer - */ -#define PDMA_SET_TRANS_CNT(pdma, u32Ch, u32TransCount) ((uint32_t)((pdma)->DSCT[(u32Ch)].CTL=((pdma)->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1UL) << PDMA_DSCT_CTL_TXCNT_Pos))) - -/** - * @brief Set Scatter-gather descriptor Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The descriptor address - * - * @return None - * - * @details This macro set the selected channel scatter-gather descriptor address. - * \hideinitializer - */ -#define PDMA_SET_SCATTER_DESC(pdma, u32Ch, u32Addr) ((uint32_t)((pdma)->DSCT[(u32Ch)].NEXT = (u32Addr) - ((pdma)->SCATBA))) - -/** - * @brief Stop the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro stop the selected channel. - * \hideinitializer - */ -#define PDMA_STOP(pdma, u32Ch) ((uint32_t)((pdma)->PAUSE = (1UL << (u32Ch)))) - -/** - * @brief Pause the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro pause the selected channel. - */ -#define PDMA_PAUSE(pdma, u32Ch) ((uint32_t)((pdma)->PAUSE = (1UL << (u32Ch)))) - -/** - * @brief Reset the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro reset the selected channel. - */ -#define PDMA_RESET(pdma, u32Ch) ((uint32_t)((pdma)->CHRST = (1UL << (u32Ch)))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define PDMA functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_Close(PDMA_T *pdma); -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount); -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl); -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr); -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize); -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt); -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch); -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount); -void PDMA_SetRepeat(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount); - - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_PDMA_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_psio.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_psio.h deleted file mode 100644 index 655559f3776..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_psio.h +++ /dev/null @@ -1,1191 +0,0 @@ -/**************************************************************************//** - * @file nu_psio.h - * @version V3.00 - * @brief M460 series PSIO driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - - -#ifndef __NU_PSIO_H__ -#define __NU_PSIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PSIO_Driver PSIO Driver - @{ -*/ - -/** @addtogroup PSIO_EXPORTED_CONSTANTS PSIO Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Operation Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PSIO_SC0 0x00000000UL /*!INTEN |= (u32IntSel)) - -/** - * @brief Disable specified PSIO interrupt - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32IntSel Interrupt type select - * - \ref PSIO_INTEN_CON0IE_Msk - * - \ref PSIO_INTEN_CON1IE_Msk - * - \ref PSIO_INTEN_MISMATIE_Msk - * - \ref PSIO_INTEN_TERRIE_Msk - * - \ref PSIO_INTEN_SC0IE_Msk - * - \ref PSIO_INTEN_SC1IE_Msk - * - \ref PSIO_INTEN_SC2IE_Msk - * - \ref PSIO_INTEN_SC3IE_Msk - * - * @return None - * - * @details This macro disable specified PSIO interrupt. - * \hideinitializer - */ -#define PSIO_DISABLE_INT(psio, u32IntSel) ((psio)->INTEN &= ~(u32IntSel)) - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32IntTypeFlag Interrupt Type Flag, Valid values are - * - \ref PSIO_INTSTS_CON0IF_Msk - * - \ref PSIO_INTSTS_CON1IF_Msk - * - \ref PSIO_INTSTS_MISMATIF_Msk - * - \ref PSIO_INTSTS_TERRIF_Msk - * - \ref PSIO_INTSTS_SC0IF_Msk - * - \ref PSIO_INTSTS_SC1IF_Msk - * - \ref PSIO_INTSTS_SC2IF_Msk - * - \ref PSIO_INTSTS_SC3IF_Msk - * - * @return 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define PSIO_GET_INT_FLAG(psio, u32IntTypeFlag) (((psio)->INTSTS & (u32IntTypeFlag))?1:0) - -/** - * @brief Clear specified interrupt flag/status - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32IntTypeFlag Interrupt Type Flag, Valid values are - * - \ref PSIO_INTSTS_CON0IF_Msk - * - \ref PSIO_INTSTS_CON1IF_Msk - * - \ref PSIO_INTSTS_MISMATIF_Msk - * - \ref PSIO_INTSTS_TERRIF_Msk - * - \ref PSIO_INTSTS_SC0IF_Msk - * - \ref PSIO_INTSTS_SC1IF_Msk - * - \ref PSIO_INTSTS_SC2IF_Msk - * - \ref PSIO_INTSTS_SC3IF_Msk - * - * @return None - * - * @details This macro clear specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define PSIO_CLEAR_INT_FLAG(psio, u32IntTypeFlag) ((psio)->INTSTS = u32IntTypeFlag) - -/** - * @brief Get specified transfer status - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Status Transfer status, Valid values are - * - \ref PSIO_TRANSTS_INFULL0_Msk - * - \ref PSIO_TRANSTS_INOVER0_Msk - * - \ref PSIO_TRANSTS_OUTEPY0_Msk - * - \ref PSIO_TRANSTS_OUTUF0_Msk - * - \ref PSIO_TRANSTS_INFULL1_Msk - * - \ref PSIO_TRANSTS_INOVER1_Msk - * - \ref PSIO_TRANSTS_OUTEPY1_Msk - * - \ref PSIO_TRANSTS_OUTUF1_Msk - * - \ref PSIO_TRANSTS_INFULL2_Msk - * - \ref PSIO_TRANSTS_INOVER2_Msk - * - \ref PSIO_TRANSTS_OUTEPY2_Msk - * - \ref PSIO_TRANSTS_OUTUF2_Msk - * - \ref PSIO_TRANSTS_INFULL3_Msk - * - \ref PSIO_TRANSTS_INOVER3_Msk - * - \ref PSIO_TRANSTS_OUTEPY3_Msk - * - \ref PSIO_TRANSTS_OUTUF3_Msk - * - \ref PSIO_TRANSTS_INFULL4_Msk - * - \ref PSIO_TRANSTS_INOVER4_Msk - * - \ref PSIO_TRANSTS_OUTEPY4_Msk - * - \ref PSIO_TRANSTS_OUTUF4_Msk - * - \ref PSIO_TRANSTS_INFULL5_Msk - * - \ref PSIO_TRANSTS_INOVER5_Msk - * - \ref PSIO_TRANSTS_OUTEPY5_Msk - * - \ref PSIO_TRANSTS_OUTUF5_Msk - * - \ref PSIO_TRANSTS_INFULL6_Msk - * - \ref PSIO_TRANSTS_INOVER6_Msk - * - \ref PSIO_TRANSTS_OUTEPY6_Msk - * - \ref PSIO_TRANSTS_OUTUF6_Msk - * - \ref PSIO_TRANSTS_INFULL7_Msk - * - \ref PSIO_TRANSTS_INOVER7_Msk - * - \ref PSIO_TRANSTS_OUTEPY7_Msk - * - \ref PSIO_TRANSTS_OUTUF7_Msk - * - * @return 0 The specified status is not happened. - * 1 The specified status is happened. - * - * @details This macro get specified transfer status. - * \hideinitializer - */ -#define PSIO_GET_TRANSFER_STATUS(psio, u32Status) (((psio)->TRANSTS & (u32Status))?1:0) - -/** - * @brief Clear specified transfer status - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Status Transfer status, Valid values are - * - \ref PSIO_TRANSTS_INOVER0_Msk - * - \ref PSIO_TRANSTS_OUTUF0_Msk - * - \ref PSIO_TRANSTS_INOVER1_Msk - * - \ref PSIO_TRANSTS_OUTUF1_Msk - * - \ref PSIO_TRANSTS_INOVER2_Msk - * - \ref PSIO_TRANSTS_OUTUF2_Msk - * - \ref PSIO_TRANSTS_INOVER3_Msk - * - \ref PSIO_TRANSTS_OUTUF3_Msk - * - \ref PSIO_TRANSTS_INOVER4_Msk - * - \ref PSIO_TRANSTS_OUTUF4_Msk - * - \ref PSIO_TRANSTS_INOVER5_Msk - * - \ref PSIO_TRANSTS_OUTUF5_Msk - * - \ref PSIO_TRANSTS_INOVER6_Msk - * - \ref PSIO_TRANSTS_OUTUF6_Msk - * - \ref PSIO_TRANSTS_INOVER7_Msk - * - \ref PSIO_TRANSTS_OUTUF7_Msk - * - * @return None - * - * @details This macro clear specified transfer status. - * \hideinitializer - */ -#define PSIO_CLEAR_TRANSFER_STATUS(psio, u32Status) ((psio)->TRANSTS = u32Status) - -/** - * @brief Get specified input status state - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Status Transfer input status state, Valid values are - * - \ref PSIO_ISSTS_VALID0_Msk - * - \ref PSIO_ISSTS_INSTSOV0_Msk - * - \ref PSIO_ISSTS_VALID1_Msk - * - \ref PSIO_ISSTS_INSTSOV1_Msk - * - \ref PSIO_ISSTS_VALID2_Msk - * - \ref PSIO_ISSTS_INSTSOV2_Msk - * - \ref PSIO_ISSTS_VALID3_Msk - * - \ref PSIO_ISSTS_INSTSOV3_Msk - * - \ref PSIO_ISSTS_VALID4_Msk - * - \ref PSIO_ISSTS_INSTSOV4_Msk - * - \ref PSIO_ISSTS_VALID5_Msk - * - \ref PSIO_ISSTS_INSTSOV5_Msk - * - \ref PSIO_ISSTS_VALID6_Msk - * - \ref PSIO_ISSTS_INSTSOV6_Msk - * - \ref PSIO_ISSTS_VALID7_Msk - * - \ref PSIO_ISSTS_INSTSOV7_Msk - * - * @return 0 The specified status is not happened. - * 1 The specified status is happened. - * - * @details This macro get input status state. - * \hideinitializer - */ -#define PSIO_GET_INPUT_STATUS_STATE(psio, u32Status) (((psio)->ISSTS & (u32Status))?1:0) - -/** - * @brief Clear specified input status state - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Status Transfer input status state, Valid values are - * - \ref PSIO_ISSTS_INSTSOV0_Msk - * - \ref PSIO_ISSTS_INSTSOV1_Msk - * - \ref PSIO_ISSTS_INSTSOV2_Msk - * - \ref PSIO_ISSTS_INSTSOV3_Msk - * - \ref PSIO_ISSTS_INSTSOV4_Msk - * - \ref PSIO_ISSTS_INSTSOV5_Msk - * - \ref PSIO_ISSTS_INSTSOV6_Msk - * - \ref PSIO_ISSTS_INSTSOV7_Msk - * - * @return None - * - * @details This macro clear input status state. - * \hideinitializer - */ -#define PSIO_CLEAR_INPUT_STATUS_STATE(psio, u32Status) ((psio)->ISSTS = u32Status) - -/** - * @brief Set PSIO PDMA control input - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * @param[in] u32InPin The selected input pin - * - \ref PSIO_PDMACTL_IPIN0EN_Msk - * - \ref PSIO_PDMACTL_IPIN1EN_Msk - * - \ref PSIO_PDMACTL_IPIN2EN_Msk - * - \ref PSIO_PDMACTL_IPIN3EN_Msk - * - \ref PSIO_PDMACTL_IPIN4EN_Msk - * - \ref PSIO_PDMACTL_IPIN5EN_Msk - * - \ref PSIO_PDMACTL_IPIN6EN_Msk - * - \ref PSIO_PDMACTL_IPIN7EN_Msk - * - * @return None - * - * @details This macro set PSIO input with PDMA. - * \hideinitializer - */ -#define PSIO_SET_PDMA_INPUT(psio, u32SC, u32InPin) ((psio)->PDMACTL = ((psio)->PDMACTL & ~PSIO_PDMACTL_INSCSEL_Msk) \ - |((u32SC)<PDMACTL = (psio)->PDMACTL & ~PSIO_PDMACTL_INSCSEL_Msk & ~(u32InPin)) - -/** - * @brief Set PSIO PDMA control output - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * @param[in] u32OutPin The selected output pin - * - \ref PSIO_PDMACTL_OPIN0EN_Msk - * - \ref PSIO_PDMACTL_OPIN1EN_Msk - * - \ref PSIO_PDMACTL_OPIN2EN_Msk - * - \ref PSIO_PDMACTL_OPIN3EN_Msk - * - \ref PSIO_PDMACTL_OPIN4EN_Msk - * - \ref PSIO_PDMACTL_OPIN5EN_Msk - * - \ref PSIO_PDMACTL_OPIN6EN_Msk - * - \ref PSIO_PDMACTL_OPIN7EN_Msk - * - * @return None - * - * @details This macro set PSIO output with PDMA. - * \hideinitializer - */ -#define PSIO_SET_PDMA_OUTPUT(psio, u32SC, u32OutPin) ((psio)->PDMACTL = ((psio)->PDMACTL & ~PSIO_PDMACTL_OUTSCSEL_Msk) \ - |((u32SC)<PDMACTL = (psio)->PDMACTL & ~PSIO_PDMACTL_OUTSCSEL_Msk & ~(u32OutPin)) - -/** - * @brief Set slot controller trigger source - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * @param[in] u32SrcType The selected trigger source type - * - \ref PSIO_SW_TRIGGER - * - \ref PSIO_FALLING_TRIGGER - * - \ref PSIO_RISING_TRIGGER - * - \ref PSIO_BOTH_EDGE_TRIGGER - * - * @return None - * - * @details This macro set slot controller trigger source. - * \hideinitializer - */ -#define PSIO_SET_TRIGSRC(psio, u32SC, u32SrcType) ((psio)->SCCT[(u32SC)].SCCTL=((psio)->SCCT[(u32SC)].SCCTL & ~PSIO_SCCT_SCCTL_TRIGSRC_Msk)|(u32SrcType)) - -/** - * @brief Start PSIO slot controller - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * - * @return None - * - * @details This macro start PSIO slot controller. - * \hideinitializer - */ -#define PSIO_START_SC(psio, u32SC) ((psio)->SCCT[(u32SC)].SCCTL |= PSIO_SCCT_SCCTL_START_Msk) - -/** - * @brief Stop PSIO slot controller - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * - * @return None - * - * @details This macro stop PSIO slot controller. - * \hideinitializer - */ -#define PSIO_STOP_SC(psio, u32SC) ((psio)->SCCT[(u32SC)].SCCTL |= PSIO_SCCT_SCCTL_STOP_Msk) - -/** - * @brief Get PSIO busy flag - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * - * @return 0 The busy flag is not happened. - * 1 The busy flag is happened. - * - * @details This macro get PSIO busy flag. - * \hideinitializer - */ -#define PSIO_GET_BUSY_FLAG(psio, u32SC) (((psio)->SCCT[(u32SC)].SCCTL & PSIO_SCCT_SCCTL_BUSY_Msk)?1:0) - -/** - * @brief Get PSIO idle flag - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * - * @return 0 The idle flag is not happened. - * 1 The idle flag is happened. - * - * @details This macro get PSIO idle flag. - * \hideinitializer - */ -#define PSIO_GET_IDLE_FLAG(psio, u32SC) (((psio)->SCCT[(u32SC)].SCCTL & PSIO_SCCT_SCCTL_IDLE_Msk)?1:0) - -/** -* @brief Clear PSIO idle flag -* -* @param[in] psio The pointer of the specified PSIO module -* @param[in] u32SC The selected slot controller. Valid values are -* - \ref PSIO_SC0 -* - \ref PSIO_SC1 -* - \ref PSIO_SC2 -* - \ref PSIO_SC3 -* -* @return None -* -* @details This macro clear PSIO idle flag. -* \hideinitializer -*/ -#define PSIO_SET_IDLE_FLAG(psio, u32SC) ((psio)->SCCT[(u32SC)].SCCTL |= PSIO_SCCT_SCCTL_IDLE_Msk) - -/** -* @brief Set PSIO slot tick count -* -* @param[in] psio The pointer of the specified PSIO module -* @param[in] u32SC The selected slot controller. Valid values are -* - \ref PSIO_SC0 -* - \ref PSIO_SC1 -* - \ref PSIO_SC2 -* - \ref PSIO_SC3 -* @param[in] u32Slot The selected slot. Valid values are -* - \ref PSIO_SLOT0 -* - \ref PSIO_SLOT1 -* - \ref PSIO_SLOT2 -* - \ref PSIO_SLOT3 -* - \ref PSIO_SLOT4 -* - \ref PSIO_SLOT5 -* - \ref PSIO_SLOT6 -* - \ref PSIO_SLOT7 -* @param[in] u32Cnt The slot tick count. Valid values are 0x0~0xF -* -* @return None -* -* @details This macro set PSIO slot tick count. -* \hideinitializer -*/ -#define PSIO_SCSLOT_SET_SLOT(psio, u32SC, u32Slot, u32Cnt) ((psio)->SCCT[(u32SC)].SCSLOT= \ - ((psio)->SCCT[(u32SC)].SCSLOT & ~(PSIO_SCCT_SCSLOT_SLOT0CNT_Msk<<((u32Slot-1)*PSIO_SCCT_SCSLOT_SLOT1CNT_Pos)))|((u32Cnt&0xF)<<((u32Slot-1)*PSIO_SCCT_SCSLOT_SLOT1CNT_Pos))) - -/** - * @brief Set PSIO all slot tick count - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * @param[in] u32Cnt The slot tick count. Valid values are 0x0~0xF - * - * @return None - * - * @details This macro set PSIO all slot tick count. - * \hideinitializer - */ -#define PSIO_SCSLOT_SET_ALL_SLOT(psio, u32SC, u32Cnt) ((psio)->SCCT[(u32SC)].SCSLOT= \ - ((u32Cnt&0xF)<GNCT[(u32Pin)].GENCTL = \ - ((psio)->GNCT[(u32Pin)].GENCTL & ~PSIO_GNCT_GENCTL_PINEN_Msk)|PSIO_GNCT_GENCTL_PINEN_Msk) - -/** - * @brief Disable Pin function - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * - * @return None - * - * @details This function is used to disable this Pin. - * \hideinitializer - */ -#define PSIO_DISABLE_PIN(psio, u32Pin) ((psio)->GNCT[(u32Pin)].GENCTL = \ - ((psio)->GNCT[(u32Pin)].GENCTL & ~PSIO_GNCT_GENCTL_PINEN_Msk)) - -/** - * @brief Set specified pin data width - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * @param[in] u32InWidth The input data width. Valid values are 0~32 - * @param[in] u32OutWidth The output data width. Valid values are 0~32 - * - * @return None - * - * @details This macro set in/out data width. - * \hideinitializer - */ -#define PSIO_SET_WIDTH(psio, u32Pin, u32InWidth, u32OutWidth) (((psio)->GNCT[(u32Pin)].DATCTL)= \ - ((psio)->GNCT[(u32Pin)].DATCTL & ~PSIO_GNCT_DATCTL_INDATWD_Msk & ~PSIO_GNCT_DATCTL_OUTDATWD_Msk) \ - |((u32InWidth==0?0:(u32InWidth-1))<GNCT[(u32Pin)].DATCTL)= \ - (PSIO->GNCT[(u32Pin)].DATCTL & ~PSIO_GNCT_DATCTL_ORDER_Msk)|(u32Order)) - -/** - * @brief Set specified pin output data depth - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * @param[in] u32Depth The data depth. Valid values are - * - \ref PSIO_DEPTH1 - * - \ref PSIO_DEPTH2 - * - \ref PSIO_DEPTH3 - * - \ref PSIO_DEPTH4 - * - * @return None - * - * @details This macro set output data order. - * \hideinitializer - */ -#define PSIO_SET_OUTPUT_DEPTH(psio, u32Pin, u32Depth) ((psio)->GNCT[(u32Pin)].DATCTL= \ - (PSIO->GNCT[(u32Pin)].DATCTL & ~PSIO_GNCT_DATCTL_OUTDEPTH_Msk)|((u32Depth)<GNCT[(u32Pin)].DATCTL= \ - (PSIO->GNCT[(u32Pin)].DATCTL & ~PSIO_GNCT_DATCTL_INDEPTH_Msk)|((u32Depth)<GNCT[u32Pin].INSTS&0xFF) - -/** - * @brief Get specified pin input data - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * - * @return The specified pin input data - * - * @details This macro get specified pin input data. - * \hideinitializer - */ -#define PSIO_GET_INPUT_DATA(psio, u32Pin) (psio->GNCT[u32Pin].INDAT) - -/** -* @brief Set specified pin output data -* -* @param[in] psio The pointer of the specified PSIO module -* @param[in] u32Pin The selected Pin. Valid values are -* - \ref PSIO_PIN0 -* - \ref PSIO_PIN1 -* - \ref PSIO_PIN2 -* - \ref PSIO_PIN3 -* - \ref PSIO_PIN4 -* - \ref PSIO_PIN5 -* - \ref PSIO_PIN6 -* - \ref PSIO_PIN7 -* @param[in] u32Data The output data -* -* @return None -* -* @details This macro set specified pin output data. -* \hideinitializer -*/ -#define PSIO_SET_OUTPUT_DATA(psio, u32Pin, u32Data) (psio->GNCT[u32Pin].OUTDAT = (u32Data)) - -/** -* @brief Set specified pin check point and slot link -* -* @param[in] psio The pointer of the specified PSIO module -* @param[in] u32Pin The selected Pin. Valid values are -* - \ref PSIO_PIN0 -* - \ref PSIO_PIN1 -* - \ref PSIO_PIN2 -* - \ref PSIO_PIN3 -* - \ref PSIO_PIN4 -* - \ref PSIO_PIN5 -* - \ref PSIO_PIN6 -* - \ref PSIO_PIN7 -* @param[in] u32CheckPoint The selected check point. Valid values are -* - \ref PSIO_CP0 -* - \ref PSIO_CP1 -* - \ref PSIO_CP2 -* - \ref PSIO_CP3 -* - \ref PSIO_CP4 -* - \ref PSIO_CP5 -* - \ref PSIO_CP6 -* - \ref PSIO_CP7 -* @param[in] u32Slot The selected slot. Valid values are -* - \ref PSIO_SLOT0 -* - \ref PSIO_SLOT1 -* - \ref PSIO_SLOT2 -* - \ref PSIO_SLOT3 -* - \ref PSIO_SLOT4 -* - \ref PSIO_SLOT5 -* - \ref PSIO_SLOT6 -* - \ref PSIO_SLOT7 -* -* @return None -* -* @details This macro used to link check point and slot. -* \hideinitializer -*/ -#define PSIO_SET_CHECKPOINT(psio, u32Pin, u32CheckPoint, u32Slot) (psio->GNCT[(u32Pin)].CPCTL0= \ - (psio->GNCT[(u32Pin)].CPCTL0 & ~(PSIO_GNCT_CPCTL0_CKPT0_Msk<<((u32CheckPoint)*PSIO_GNCT_CPCTL0_CKPT1_Pos))) \ - |((u32Slot)<<((u32CheckPoint)*PSIO_GNCT_CPCTL0_CKPT1_Pos))) - -/** - * @brief Clear specified pin check point and slot link - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * @param[in] u32CheckPoint The selected check point. Valid values are - * - \ref PSIO_CP0 - * - \ref PSIO_CP1 - * - \ref PSIO_CP2 - * - \ref PSIO_CP3 - * - \ref PSIO_CP4 - * - \ref PSIO_CP5 - * - \ref PSIO_CP6 - * - \ref PSIO_CP7 - * - * @return None - * - * @details This macro used to clear the link of check point and slot. - * \hideinitializer - */ -#define PSIO_CLEAR_CHECKPOINT(psio, u32Pin, u32CheckPoint) (psio->GNCT[(u32Pin)].CPCTL0= \ - psio->GNCT[(u32Pin)].CPCTL0 & ~(PSIO_GNCT_CPCTL0_CKPT0_Msk<<((u32CheckPoint)*PSIO_GNCT_CPCTL0_CKPT1_Pos))) - -/** - * @brief Set specified pin action of check point - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * @param[in] u32CheckPoint The selected check point. Valid values are - * - \ref PSIO_CP0 - * - \ref PSIO_CP1 - * - \ref PSIO_CP2 - * - \ref PSIO_CP3 - * - \ref PSIO_CP4 - * - \ref PSIO_CP5 - * - \ref PSIO_CP6 - * - \ref PSIO_CP7 - * @param[in] u32Action The selected action. Valid values are - * - \ref PSIO_OUT_LOW - * - \ref PSIO_OUT_HIGH - * - \ref PSIO_OUT_BUFFER - * - \ref PSIO_OUT_TOGGLE - * - \ref PSIO_IN_BUFFER - * - \ref PSIO_IN_STATUS - * - \ref PSIO_IN_STATUS_UPDATE - * - * @return None - * - * @details This macro used to set specified pin action of check point. - * \hideinitializer - */ -#define PSIO_SET_ACTION(psio, u32Pin, u32CheckPoint, u32Action) (psio->GNCT[(u32Pin)].CPCTL1= \ - (psio->GNCT[(u32Pin)].CPCTL1 & ~(PSIO_GNCT_CPCTL1_CKPT0ACT_Msk<<((u32CheckPoint)*PSIO_GNCT_CPCTL1_CKPT1ACT_Pos))) \ - |((u32Action)<<((u32CheckPoint)*PSIO_GNCT_CPCTL1_CKPT1ACT_Pos))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/** - * @brief Set interrupt control - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller - * @param[in] u32Int The interrupt type. Valid values are - * - \ref PSIO_INT0 - * - \ref PSIO_INT1 - * @param[in] u32Slot The selected slot. Valid values are - * - \ref PSIO_SLOT0 - * - \ref PSIO_SLOT1 - * - \ref PSIO_SLOT2 - * - \ref PSIO_SLOT3 - * - \ref PSIO_SLOT4 - * - \ref PSIO_SLOT5 - * - \ref PSIO_SLOT6 - * - \ref PSIO_SLOT7 - * - * @return None - * - * @details This function is used to set the selected slot controller, interrupt type and slot. - * \hideinitializer - */ -__STATIC_INLINE void PSIO_SET_INTCTL(PSIO_T *psio, uint32_t u32SC, uint32_t u32Int, uint32_t u32Slot) -{ - if (u32Int == PSIO_INT0) - { - (psio)->INTCTL = (((psio)->INTCTL & ~PSIO_INTCTL_CONI0SS_Msk & ~PSIO_INTCTL_CONI0SCS_Msk) - | ((u32SC) << PSIO_INTCTL_CONI0SCS_Pos) - | ((u32Slot) << PSIO_INTCTL_CONI0SS_Pos)); - } - else if (u32Int == PSIO_INT1) - { - (psio)->INTCTL = (((psio)->INTCTL & ~PSIO_INTCTL_CONI1SS_Msk & ~PSIO_INTCTL_CONI1SCS_Msk) - | ((u32SC) << PSIO_INTCTL_CONI1SCS_Pos) - | ((u32Slot) << PSIO_INTCTL_CONI1SS_Pos)); - } -} - -/** - * @brief Clear interrupt control setting - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Int The interrupt type. Valid values are - * - \ref PSIO_INT0 - * - \ref PSIO_INT1 - * - * @return None - * - * @details This function is used to clear the selected slot controller, interrupt type and slot. - * \hideinitializer - */ -__STATIC_INLINE void PSIO_CLEAR_INTCTL(PSIO_T *psio, uint32_t u32Int) -{ - if (u32Int == PSIO_INT0) - { - (psio)->INTCTL = ((psio)->INTCTL & ~PSIO_INTCTL_CONI0SS_Msk & ~PSIO_INTCTL_CONI0SCS_Msk); - } - else if (u32Int == PSIO_INT1) - { - (psio)->INTCTL = ((psio)->INTCTL & ~PSIO_INTCTL_CONI1SS_Msk & ~PSIO_INTCTL_CONI1SCS_Msk); - } -} - -/** - * @brief Set Slot controller control - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32SC The selected slot controller - * @param[in] u32InitSlot The selected initial slot of the repeat period. Valid values are - * - \ref PSIO_SLOT0 - * - \ref PSIO_SLOT1 - * - \ref PSIO_SLOT2 - * - \ref PSIO_SLOT3 - * - \ref PSIO_SLOT4 - * - \ref PSIO_SLOT5 - * - \ref PSIO_SLOT6 - * - \ref PSIO_SLOT7 - * @param[in] u32EndSlot The selected end slot of the repeat period. Valid values are - * - \ref PSIO_SLOT0 - * - \ref PSIO_SLOT1 - * - \ref PSIO_SLOT2 - * - \ref PSIO_SLOT3 - * - \ref PSIO_SLOT4 - * - \ref PSIO_SLOT5 - * - \ref PSIO_SLOT6 - * - \ref PSIO_SLOT7 - * @param[in] u32LoopCnt The slot period loop count. Valid values are - * - 0x0 : Disable - * - 0x1~0x3E : Repeat slot 0x2~0x3F times - * - 0x3F : Loop until stop PSIO slot controller - * @param[in] u32Repeat Repeat mode Enable/Disable. Valid values are - * - \ref PSIO_REPEAT_ENABLE - * - \ref PSIO_REPEAT_DISABLE - * - * @return None - * - * @details This function is used to set the slot controller loop and repeat configuration. - * \hideinitializer - */ -__STATIC_INLINE void PSIO_SET_SCCTL(PSIO_T *psio, uint32_t u32SC, uint32_t u32InitSlot, uint32_t u32EndSlot, uint32_t u32LoopCnt, uint32_t u32Repeat) -{ - (psio)->SCCT[u32SC].SCCTL = ((psio)->SCCT[u32SC].SCCTL & ~PSIO_SCCT_SCCTL_INISLOT_Msk & ~PSIO_SCCT_SCCTL_ENDSLOT_Msk & ~PSIO_SCCT_SCCTL_SPLCNT_Msk) - | ((u32InitSlot) << PSIO_SCCT_SCCTL_INISLOT_Pos) - | ((u32EndSlot) << PSIO_SCCT_SCCTL_ENDSLOT_Pos) - | ((u32LoopCnt & 0x3F) << PSIO_SCCT_SCCTL_SPLCNT_Pos); - - if (u32Repeat == PSIO_REPEAT_ENABLE) - (psio)->SCCT[u32SC].SCCTL |= PSIO_SCCT_SCCTL_REPEAT_Msk; - else if (u32Repeat == PSIO_REPEAT_DISABLE) - (psio)->SCCT[u32SC].SCCTL &= ~PSIO_SCCT_SCCTL_REPEAT_Msk; -} - -/** - * @brief Set Pin general control - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * @param[in] u32PinEn The selected Pin enable/disable. Valid values are - * - \ref PSIO_PIN_ENABLE - * - \ref PSIO_PIN_DISABLE - * @param[in] u32SC The selected slot controller for check point. Valid values are - * - \ref PSIO_SC0 - * - \ref PSIO_SC1 - * - \ref PSIO_SC2 - * - \ref PSIO_SC3 - * @param[in] u32IOMode The pin I/O mode. Valid values are - * - \ref PSIO_INPUT_MODE - * - \ref PSIO_OUTPUT_MODE - * - \ref PSIO_OPENDRAIN_MODE - * - \ref PSIO_QUASI_MODE - * @param[in] u32PinInit The pin initial status. Valid values are - * - \ref PSIO_LOW_LEVEL - * - \ref PSIO_HIGH_LEVEL - * - \ref PSIO_LAST_OUTPUT - * - \ref PSIO_Toggle - * @param[in] u32PinInterval The pin interval status. Valid values are - * - \ref PSIO_LOW_LEVEL - * - \ref PSIO_HIGH_LEVEL - * - \ref PSIO_LAST_OUTPUT - * - \ref PSIO_Toggle - * - * @return None - * - * @details This function is used to set the general control. - * \hideinitializer - */ -__STATIC_INLINE void PSIO_SET_GENCTL(PSIO_T *psio, uint32_t u32Pin, uint32_t u32PinEn, uint32_t u32SC, uint32_t u32IOMode, uint32_t u32PinInit, uint32_t u32PinInterval) -{ - (psio)->GNCT[u32Pin].GENCTL = ((psio)->GNCT[u32Pin].GENCTL & ~PSIO_GNCT_GENCTL_SCSEL_Msk & ~PSIO_GNCT_GENCTL_IOMODE_Msk - & ~PSIO_GNCT_GENCTL_INITIAL_Msk & ~PSIO_GNCT_GENCTL_INTERVAL_Msk) - | ((u32SC) << PSIO_GNCT_GENCTL_SCSEL_Pos) | ((u32IOMode) << PSIO_GNCT_GENCTL_IOMODE_Pos) - | ((u32PinInit) << PSIO_GNCT_GENCTL_INITIAL_Pos) | ((u32PinInterval) << PSIO_GNCT_GENCTL_INTERVAL_Pos); - - if (u32PinEn == PSIO_PIN_ENABLE) - (psio)->GNCT[u32Pin].GENCTL |= PSIO_GNCT_GENCTL_PINEN_Msk; - else if (u32PinEn == PSIO_PIN_DISABLE) - (psio)->GNCT[u32Pin].GENCTL &= ~PSIO_GNCT_GENCTL_PINEN_Msk; -} - -/** - * @brief Set Pin mode switch - * - * @param[in] psio The pointer of the specified PSIO module - * @param[in] u32Pin The selected Pin. Valid values are - * - \ref PSIO_PIN0 - * - \ref PSIO_PIN1 - * - \ref PSIO_PIN2 - * - \ref PSIO_PIN3 - * - \ref PSIO_PIN4 - * - \ref PSIO_PIN5 - * - \ref PSIO_PIN6 - * - \ref PSIO_PIN7 - * @param[in] u32SwPoint The switch point. Valid values are - * - \ref PSIO_SWITCH_P0 - * - \ref PSIO_SWITCH_P1 - * @param[in] u32SwMode The switch mode. Valid values are - * - \ref PSIO_INPUT_MODE - * - \ref PSIO_OUTPUT_MODE - * - \ref PSIO_OPENDRAIN_MODE - * - \ref PSIO_QUASI_MODE - * @param[in] u32SwCP The switch I/O mode at which point. Valid values are - * - \ref PSIO_CP0 - * - \ref PSIO_CP1 - * - \ref PSIO_CP2 - * - \ref PSIO_CP3 - * - \ref PSIO_CP4 - * - \ref PSIO_CP5 - * - \ref PSIO_CP6 - * - \ref PSIO_CP7 - * @return None - * - * @details This function is used to set the pin mode switch. - * \hideinitializer - */ -__STATIC_INLINE void PSIO_SWITCH_MODE(PSIO_T *psio, uint32_t u32Pin, uint32_t u32SwPoint, uint32_t u32SwMode, uint32_t u32SwCP) -{ - if (u32SwPoint == PSIO_SWITCH_P0) - { - (psio)->GNCT[u32Pin].GENCTL = ((psio)->GNCT[u32Pin].GENCTL & ~PSIO_GNCT_GENCTL_MODESW0_Msk & ~PSIO_GNCT_GENCTL_SW0CP_Msk) - | ((u32SwMode) << PSIO_GNCT_GENCTL_MODESW0_Pos) | ((u32SwCP + 1) << PSIO_GNCT_GENCTL_SW0CP_Pos); - } - else if (u32SwPoint == PSIO_SWITCH_P1) - { - (psio)->GNCT[u32Pin].GENCTL = ((psio)->GNCT[u32Pin].GENCTL & ~PSIO_GNCT_GENCTL_MODESW1_Msk & ~PSIO_GNCT_GENCTL_SW1CP_Msk) - | ((u32SwMode) << PSIO_GNCT_GENCTL_MODESW1_Pos) | ((u32SwCP + 1) << PSIO_GNCT_GENCTL_SW1CP_Pos); - } -} - -/** -* @brief Set specified pin check point and slot link, and pin action of check point -* -* @param[in] psio The pointer of the specified PSIO module -* @param[in] u32Pin The selected Pin. Valid values are -* - \ref PSIO_PIN0 -* - \ref PSIO_PIN1 -* - \ref PSIO_PIN2 -* - \ref PSIO_PIN3 -* - \ref PSIO_PIN4 -* - \ref PSIO_PIN5 -* - \ref PSIO_PIN6 -* - \ref PSIO_PIN7 -* @param[in] sConfig The selected check point configurations. -* -* @return None -* -* @details This macro used to link check point and slot, and set pin action of check point. -* \hideinitializer -*/ -__STATIC_INLINE void PSIO_SET_CP_CONFIG(PSIO_T *psio, uint32_t u32Pin, const S_PSIO_CP_CONFIG *sConfig) -{ - psio->GNCT[u32Pin].CPCTL0 = *(uint32_t *)sConfig; - psio->GNCT[u32Pin].CPCTL1 = *((uint32_t *)sConfig + 1); -} - -/*@}*/ /* end of group PSIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PSIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_PSIO_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_qspi.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_qspi.h deleted file mode 100644 index 81f92c9efa4..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_qspi.h +++ /dev/null @@ -1,437 +0,0 @@ -/**************************************************************************//** - * @file nu_qspi.h - * @version V3.00 - * @brief M460 series QSPI driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_QSPI_H__ -#define __NU_QSPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - -/** @addtogroup QSPI_EXPORTED_CONSTANTS QSPI Exported Constants - @{ -*/ - -#define QSPI_MODE_0 (QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define QSPI_MODE_1 (QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_2 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_3 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define QSPI_SLAVE (QSPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define QSPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define QSPI_SS (QSPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define QSPI_SS_ACTIVE_HIGH (QSPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define QSPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* QSPI Interrupt Mask */ -#define QSPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define QSPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define QSPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define QSPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define QSPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define QSPI_SLVTO_INT_MASK (0x020U) /*!< Slave mode time-out interrupt mask \hideinitializer */ -#define QSPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define QSPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* QSPI Status Mask */ -#define QSPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define QSPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define QSPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define QSPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define QSPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define QSPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define QSPI_SPIEN_STS_MASK (0x40U) /*!< SPIEN status mask \hideinitializer */ -#define QSPI_SSLINE_STS_MASK (0x80U) /*!< QSPIx_SS line status mask \hideinitializer */ - -/* QSPI Status2 Mask */ -#define QSPI_SLVBENUM_MASK (0x01U) /*!< Effective bit number of uncompleted RX data status mask \hideinitializer */ - -/*@}*/ /* end of group QSPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Write 1 to UNITIF bit of QSPI_STATUS register to clear the unit transfer interrupt flag. - * \hideinitializer - */ -#define QSPI_CLR_UNIT_TRANS_INT_FLAG(qspi) ( (qspi)->STATUS = QSPI_STATUS_UNITIF_Msk ) - -/** - * @brief Disable 2-bit Transfer mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TWOBIT bit of QSPI_CTL register to disable 2-bit Transfer mode. - * \hideinitializer - */ -#define QSPI_DISABLE_2BIT_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_TWOBIT_Msk ) - -/** - * @brief Disable Slave 3-wire mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear SLV3WIRE bit of QSPI_SSCTL register to disable Slave 3-wire mode. - * \hideinitializer - */ -#define QSPI_DISABLE_3WIRE_MODE(qspi) ( (qspi)->SSCTL &= ~QSPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Disable Dual I/O mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear DUALIOEN bit of QSPI_CTL register to disable Dual I/O mode. - * \hideinitializer - */ -#define QSPI_DISABLE_DUAL_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Disable Quad I/O mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear QUADIOEN bit of QSPI_CTL register to disable Quad I/O mode. - * \hideinitializer - */ -#define QSPI_DISABLE_QUAD_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Disable TX DTR mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXDTREN bit of QSPI_CTL register to disable TX DTR mode. - * \hideinitializer - */ -#define QSPI_DISABLE_TXDTR_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_TXDTREN_Msk ) - -/** - * @brief Enable 2-bit Transfer mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TWOBIT bit of QSPI_CTL register to enable 2-bit Transfer mode. - * \hideinitializer - */ -#define QSPI_ENABLE_2BIT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_TWOBIT_Msk ) - -/** - * @brief Enable Slave 3-wire mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set SLV3WIRE bit of QSPI_SSCTL register to enable Slave 3-wire mode. - * \hideinitializer - */ -#define QSPI_ENABLE_3WIRE_MODE(qspi) ( (qspi)->SSCTL |= QSPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable Dual input mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear DATDIR bit and set DUALIOEN bit of QSPI_CTL register to enable Dual input mode. - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & (~QSPI_CTL_DATDIR_Msk)) | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual output mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set DATDIR bit and DUALIOEN bit of QSPI_CTL register to enable Dual output mode. - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_OUTPUT_MODE(qspi) ( (qspi)->CTL |= (QSPI_CTL_DATDIR_Msk | QSPI_CTL_DUALIOEN_Msk) ) - -/** - * @brief Enable Quad input mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear DATDIR bit and set QUADIOEN bit of QSPI_CTL register to enable Quad input mode. - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & (~QSPI_CTL_DATDIR_Msk)) | QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Enable Quad output mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set DATDIR bit and QUADIOEN bit of QSPI_CTL register to enable Quad output mode. - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_OUTPUT_MODE(qspi) ( (qspi)->CTL |= (QSPI_CTL_DATDIR_Msk | QSPI_CTL_QUADIOEN_Msk) ) - -/** - * @brief Enable TX DTR mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXDTREN bit of QSPI_CTL register to enable TX DTR mode. - * \hideinitializer - */ -#define QSPI_ENABLE_TXDTR_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_TXDTREN_Msk ) - -/** - * @brief Trigger RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set RXPDMAEN bit of QSPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_RX_PDMA(qspi) ( (qspi)->PDMACTL |= QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Trigger TX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit of QSPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_PDMA(qspi) ( (qspi)->PDMACTL |= QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_RX_PDMA(qspi) ( (qspi)->PDMACTL |= (QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear RXPDMAEN bit of QSPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit of QSPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~(QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] qspi The pointer of the specified QSPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (QSPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_COUNT(qspi) ( ((qspi)->STATUS & QSPI_STATUS_RXCNT_Msk) >> QSPI_STATUS_RXCNT_Pos ) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of QSPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_EMPTY_FLAG(qspi) ( ((qspi)->STATUS & QSPI_STATUS_RXEMPTY_Msk) >> QSPI_STATUS_RXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of QSPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_EMPTY_FLAG(qspi) ( ((qspi)->STATUS & QSPI_STATUS_TXEMPTY_Msk) >> QSPI_STATUS_TXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of QSPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_FULL_FLAG(qspi) ( ((qspi)->STATUS & QSPI_STATUS_TXFULL_Msk) >> QSPI_STATUS_TXFULL_Pos ) - -/** - * @brief Get the datum read from RX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Data in RX register. - * @details Read QSPI_RX register to get the received datum. - * \hideinitializer - */ -#define QSPI_READ_RX(qspi) ( (qspi)->RX ) - -/** - * @brief Write datum to TX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxData The datum which user attempt to transfer through QSPI bus. - * @return None. - * @details Write u32TxData to QSPI_TX register. - * \hideinitializer - */ -#define QSPI_WRITE_TX(qspi, u32TxData) ( (qspi)->TX = (u32TxData) ) - -/** - * @brief Set QSPIx_SS pin to high state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to high state. - * \hideinitializer - */ -#define QSPI_SET_SS_HIGH(qspi) ( (qspi)->SSCTL = ((qspi)->SSCTL & (~QSPI_SSCTL_AUTOSS_Msk)) | (QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk) ) - -/** - * @brief Set QSPIx_SS pin to low state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to low state. - * \hideinitializer - */ -#define QSPI_SET_SS_LOW(qspi) ( (qspi)->SSCTL = ((qspi)->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk))) | QSPI_SSCTL_SS_Msk ) - -/** - * @brief Enable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (QSPI_CTL[7:4]). - * \hideinitializer - */ -#define QSPI_ENABLE_BYTE_REORDER(qspi) ( (qspi)->CTL |= QSPI_CTL_REORDER_Msk ) - -/** - * @brief Disable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear REORDER bit field of QSPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define QSPI_DISABLE_BYTE_REORDER(qspi) ( (qspi)->CTL &= ~QSPI_CTL_REORDER_Msk ) - -/** - * @brief Set the length of suspend interval. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one QSPI bus clock cycle). - * \hideinitializer - */ -#define QSPI_SET_SUSPEND_CYCLE(qspi, u32SuspCycle) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << QSPI_CTL_SUSPITV_Pos) ) - -/** - * @brief Set the QSPI transfer sequence with LSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set LSB bit of QSPI_CTL register to set the QSPI transfer sequence with LSB first. - * \hideinitializer - */ -#define QSPI_SET_LSB_FIRST(qspi) ( (qspi)->CTL |= QSPI_CTL_LSB_Msk ) - -/** - * @brief Set the QSPI transfer sequence with MSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear LSB bit of QSPI_CTL register to set the QSPI transfer sequence with MSB first. - * \hideinitializer - */ -#define QSPI_SET_MSB_FIRST(qspi) ( (qspi)->CTL &= ~QSPI_CTL_LSB_Msk ) - -/** - * @brief Set the data width of a QSPI transaction. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define QSPI_SET_DATA_WIDTH(qspi, u32Width) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DWIDTH_Msk) | (((u32Width) & 0x1F) << QSPI_CTL_DWIDTH_Pos) ) - -/** - * @brief Get the QSPI busy state. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 QSPI controller is not busy. - * @retval 1 QSPI controller is busy. - * @details This macro will return the busy state of QSPI controller. - * \hideinitializer - */ -#define QSPI_IS_BUSY(qspi) ( ((qspi)->STATUS & QSPI_STATUS_BUSY_Msk) >> QSPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set SPIEN (QSPI_CTL[0]) to enable QSPI controller. - * \hideinitializer - */ -#define QSPI_ENABLE(qspi) ( (qspi)->CTL |= QSPI_CTL_SPIEN_Msk ) - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear SPIEN (QSPI_CTL[0]) to disable QSPI controller. - * \hideinitializer - */ -#define QSPI_DISABLE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_SPIEN_Msk ) - - - -/* Function prototype declaration */ -uint32_t QSPI_Open(QSPI_T *qspi, uint32_t u32MasterSlave, uint32_t u32QSPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void QSPI_Close(QSPI_T *qspi); -void QSPI_ClearRxFIFO(QSPI_T *qspi); -void QSPI_ClearTxFIFO(QSPI_T *qspi); -void QSPI_DisableAutoSS(QSPI_T *qspi); -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock); -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t QSPI_GetBusClock(QSPI_T *qspi); -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetStatus2(QSPI_T *qspi, uint32_t u32Mask); - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_QSPI_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rng.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rng.h deleted file mode 100644 index 822dd5b3b3e..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rng.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************//** - * @file nu_rng.h - * @version V3.00 - * @brief Random Number Generator Interface Controller (rng) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_RNG_H__ -#define __NU_RNG_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RNG_Driver RNG Driver - @{ -*/ - -/** @addtogroup RNG_EXPORTED_CONSTANTS RNG Exported Constants - @{ -*/ - -/**@}*/ /* end of group RNG_EXPORTED_CONSTANTS */ - - -/** @addtogroup RNG_EXPORTED_FUNCTIONS RNG Exported Functions - @{ -*/ - -int32_t RNG_Open(void); -int32_t RNG_Random(uint32_t *pu32Buf, int32_t nWords); - -int32_t RNG_ECDSA_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]); -int32_t RNG_ECDSA(uint32_t u32KeySize); -int32_t RNG_ECDH_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]); -int32_t RNG_ECDH(uint32_t u32KeySize); -int32_t RNG_EntropyPoll(uint8_t *pu8Out, int32_t i32Len); - -/**@}*/ /* end of group RNG_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RNG_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RNG_H__ */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rtc.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rtc.h deleted file mode 100644 index 5eb6ee48174..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_rtc.h +++ /dev/null @@ -1,397 +0,0 @@ -/**************************************************************************//** - * @file nu_rtc.h - * @version V3.00 - * @brief Real Time Clock(RTC) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_RTC_H__ -#define __NU_RTC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_CONSTANTS RTC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Initial Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_INIT_KEY 0xA5EB1357UL /*!< RTC Initiation Key to make RTC leaving reset state \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Time Attribute Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_12 0UL /*!< RTC as 12-hour time scale with AM and PM indication \hideinitializer */ -#define RTC_CLOCK_24 1UL /*!< RTC as 24-hour time scale \hideinitializer */ -#define RTC_AM 1UL /*!< RTC as AM indication \hideinitializer */ -#define RTC_PM 2UL /*!< RTC as PM indication \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tick Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TICK_1_SEC 0x0UL /*!< RTC time tick period is 1 second \hideinitializer */ -#define RTC_TICK_1_2_SEC 0x1UL /*!< RTC time tick period is 1/2 second \hideinitializer */ -#define RTC_TICK_1_4_SEC 0x2UL /*!< RTC time tick period is 1/4 second \hideinitializer */ -#define RTC_TICK_1_8_SEC 0x3UL /*!< RTC time tick period is 1/8 second \hideinitializer */ -#define RTC_TICK_1_16_SEC 0x4UL /*!< RTC time tick period is 1/16 second \hideinitializer */ -#define RTC_TICK_1_32_SEC 0x5UL /*!< RTC time tick period is 1/32 second \hideinitializer */ -#define RTC_TICK_1_64_SEC 0x6UL /*!< RTC time tick period is 1/64 second \hideinitializer */ -#define RTC_TICK_1_128_SEC 0x7UL /*!< RTC time tick period is 1/128 second \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Day of Week Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_SUNDAY 0x0UL /*!< Day of the Week is Sunday \hideinitializer */ -#define RTC_MONDAY 0x1UL /*!< Day of the Week is Monday \hideinitializer */ -#define RTC_TUESDAY 0x2UL /*!< Day of the Week is Tuesday \hideinitializer */ -#define RTC_WEDNESDAY 0x3UL /*!< Day of the Week is Wednesday \hideinitializer */ -#define RTC_THURSDAY 0x4UL /*!< Day of the Week is Thursday \hideinitializer */ -#define RTC_FRIDAY 0x5UL /*!< Day of the Week is Friday \hideinitializer */ -#define RTC_SATURDAY 0x6UL /*!< Day of the Week is Saturday \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_YEAR2000 2000UL /*!< RTC Reference for compute year data \hideinitializer */ -#define RTC_FCR_REFERENCE 32752 /*!< RTC Reference for frequency compensation */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tamper Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TAMPER0_SELECT (0x1UL << 0) /*!< Select Tamper 0 \hideinitializer */ -#define RTC_TAMPER1_SELECT (0x1UL << 1) /*!< Select Tamper 1 \hideinitializer */ -#define RTC_TAMPER2_SELECT (0x1UL << 2) /*!< Select Tamper 2 \hideinitializer */ -#define RTC_TAMPER3_SELECT (0x1UL << 3) /*!< Select Tamper 3 \hideinitializer */ -#define RTC_TAMPER4_SELECT (0x1UL << 4) /*!< Select Tamper 4 \hideinitializer */ -#define RTC_TAMPER5_SELECT (0x1UL << 5) /*!< Select Tamper 5 \hideinitializer */ -#define RTC_MAX_TAMPER_PIN_NUM 6UL /*!< Tamper Pin number \hideinitializer */ - -#define RTC_TAMPER_LOW_LEVEL_DETECT 0UL /*!< Tamper pin detect voltage level is low \hideinitializer */ -#define RTC_TAMPER_HIGH_LEVEL_DETECT 1UL /*!< Tamper pin detect voltage level is high \hideinitializer */ - -#define RTC_TAMPER_DEBOUNCE_DISABLE 0UL /*!< Disable RTC tamper pin de-bounce function \hideinitializer */ -#define RTC_TAMPER_DEBOUNCE_ENABLE 1UL /*!< Enable RTC tamper pin de-bounce function \hideinitializer */ - -#define RTC_PAIR0_SELECT (0x1UL << 0) /*!< Select Pair 0 \hideinitializer */ -#define RTC_PAIR1_SELECT (0x1UL << 1) /*!< Select Pair 1 \hideinitializer */ -#define RTC_PAIR2_SELECT (0x1UL << 2) /*!< Select Pair 2 \hideinitializer */ -#define RTC_MAX_PAIR_NUM 3UL /*!< Pair number \hideinitializer */ - -#define RTC_2POW10_CLK (0x0UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 RTC clock cycles \hideinitializer */ -#define RTC_2POW11_CLK (0x1UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 2 RTC clock cycles \hideinitializer */ -#define RTC_2POW12_CLK (0x2UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 4 RTC clock cycles \hideinitializer */ -#define RTC_2POW13_CLK (0x3UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 6 RTC clock cycles \hideinitializer */ -#define RTC_2POW14_CLK (0x4UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 8 RTC clock cycles \hideinitializer */ -#define RTC_2POW15_CLK (0x5UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 16 RTC clock cycles \hideinitializer */ -#define RTC_2POW16_CLK (0x6UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 32 RTC clock cycles \hideinitializer */ -#define RTC_2POW17_CLK (0x7UL << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 64 RTC clock cycles \hideinitializer */ - -#define RTC_REF_RANDOM_PATTERN 0x0UL /*!< The new reference pattern is generated by random number generator when the reference pattern run out \hideinitializer */ -#define RTC_REF_SEED_VALUE 0x1UL /*!< The new reference pattern is repeated from SEED (RTC_TAMPSEED[31:0]) when the reference pattern run out \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Clock Source Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_SOURCE_LXT 0UL /*!< Set RTC clock source as external LXT \hideinitializer */ -#define RTC_CLOCK_SOURCE_LIRC 1UL /*!< Set RTC clock source as LIRC \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_IO_MODE_INPUT 0x0UL /*!< Input Mode */ -#define RTC_IO_MODE_OUTPUT 0x1UL /*!< Output Mode */ -#define RTC_IO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode */ -#define RTC_IO_MODE_QUASI 0x3UL /*!< Quasi-bidirectional Mode */ - -#define RTC_IO_DIGITAL_ENABLE 0UL /*!< I/O digital path is enabled */ -#define RTC_IO_DIGITAL_DISABLE 1UL /*!< I/O digital path is disabled */ - -#define RTC_IO_PULL_UP_DOWN_DISABLE 0x0UL /*!< I/O pull-up and pull-down is disabled */ -#define RTC_IO_PULL_UP_ENABLE 0x1UL /*!< I/O pull-up is enabled */ -#define RTC_IO_PULL_DOWN_ENABLE 0x2UL /*!< I/O pull-down is enabled */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Time-out Handler Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TIMEOUT_ERR (-1L) /*!< RTC operation abort due to timeout error \hideinitializer */ - -/**@}*/ /* end of group RTC_EXPORTED_CONSTANTS */ - - -/** @addtogroup RTC_EXPORTED_STRUCTS RTC Exported Structs - @{ -*/ -/** - * @details RTC define Time Data Struct - */ -typedef struct -{ - uint32_t u32Year; /*!< Year value */ - uint32_t u32Month; /*!< Month value */ - uint32_t u32Day; /*!< Day value */ - uint32_t u32DayOfWeek; /*!< Day of week value */ - uint32_t u32Hour; /*!< Hour value */ - uint32_t u32Minute; /*!< Minute value */ - uint32_t u32Second; /*!< Second value */ - uint32_t u32TimeScale; /*!< 12-Hour, 24-Hour */ - uint32_t u32AmPm; /*!< Only Time Scale select 12-hr used */ -} S_RTC_TIME_DATA_T; - -/**@}*/ /* end of group RTC_EXPORTED_STRUCTS */ - -extern int32_t g_RTC_i32ErrCode; - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Indicate is Leap Year or not - * - * @param None - * - * @retval 0 This year is not a leap year - * @retval 1 This year is a leap year - * - * @details According to current date, return this year is leap year or not. - * \hideinitializer - */ -#define RTC_IS_LEAP_YEAR() ((RTC->LEAPYEAR & RTC_LEAPYEAR_LEAPYEAR_Msk)? 1:0) - -/** - * @brief Clear RTC Alarm Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC alarm interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_ALARM_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_ALMIF_Msk) - -/** - * @brief Clear RTC Tick Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC tick interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TICK_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_TICKIF_Msk) - -/** - * @brief Clear RTC Tamper Interrupt Flag - * - * @param u32TamperFlag Tamper interrupt flag. It consists of: \n - * - \ref RTC_INTSTS_TAMP0IF_Msk \n - * - \ref RTC_INTSTS_TAMP1IF_Msk \n - * - \ref RTC_INTSTS_TAMP2IF_Msk \n - * - \ref RTC_INTSTS_TAMP3IF_Msk \n - * - \ref RTC_INTSTS_TAMP4IF_Msk \n - * - \ref RTC_INTSTS_TAMP5IF_Msk - * - * @return None - * - * @details This macro is used to clear RTC snooper pin interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TAMPER_INT_FLAG(u32TamperFlag) (RTC->INTSTS = (u32TamperFlag)) - -/** - * @brief Get RTC Alarm Interrupt Flag - * - * @param None - * - * @retval 0 RTC alarm interrupt did not occur - * @retval 1 RTC alarm interrupt occurred - * - * @details This macro indicates RTC alarm interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_ALARM_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_ALMIF_Msk)? 1:0) - -/** - * @brief Get RTC Time Tick Interrupt Flag - * - * @param None - * - * @retval 0 RTC time tick interrupt did not occur - * @retval 1 RTC time tick interrupt occurred - * - * @details This macro indicates RTC time tick interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TICK_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_TICKIF_Msk)? 1:0) - -/** - * @brief Set I/O Control By GPIO Module - * - * @param None - * - * @return None - * - * @details This macro sets the PF.4~11 pin I/O is controlled by GPIO module. - * \hideinitializer - */ -#define RTC_SET_IOCTL_BY_GPIO() (RTC->LXTCTL &= ~RTC_LXTCTL_IOCTLSEL_Msk) - -/** - * @brief Set I/O Control By RTC Module - * - * @param None - * - * @return None - * - * @details This macro sets the PF.4~11 pin I/O is controlled by RTC module. - * \hideinitializer - */ -#define RTC_SET_IOCTL_BY_RTC() (RTC->LXTCTL |= RTC_LXTCTL_IOCTLSEL_Msk) - -/** - * @brief Get I/O Control Property - * - * @param None - * - * @retval 0 PF.4~11 pin I/O is controlled by GPIO module - * @retval 1 PF.4~11 pin I/O is controlled by RTC module - * - * @details This macro indicates the PF.4~11 pin I/O control property. - * \hideinitializer - */ -#define RTC_GET_IOCTL_PROPERTY() ((RTC->LXTCTL & RTC_LXTCTL_IOCTLSEL_Msk)? 1:0) - -/** - * @brief Get RTC Tamper Interrupt Flag - * - * @param None - * - * @retval 0 RTC tamper event interrupt did not occur - * @retval 1 RTC tamper event interrupt occurred - * - * @details This macro indicates RTC tamper event occurred or not. - * \hideinitializer - */ -#define RTC_GET_TAMPER_INT_FLAG() ((RTC->INTSTS & (0x3F00))? 1:0) - -/** - * @brief Get RTC Tamper Interrupt Status - * - * @param None - * - * @retval RTC_INTSTS_TAMP0IF_Msk Tamper 0 interrupt flag is generated - * @retval RTC_INTSTS_TAMP1IF_Msk Tamper 1 interrupt flag is generated - * @retval RTC_INTSTS_TAMP2IF_Msk Tamper 2 interrupt flag is generated - * @retval RTC_INTSTS_TAMP3IF_Msk Tamper 3 interrupt flag is generated - * @retval RTC_INTSTS_TAMP4IF_Msk Tamper 4 interrupt flag is generated - * @retval RTC_INTSTS_TAMP5IF_Msk Tamper 5 interrupt flag is generated - * - * @details This macro indicates RTC tamper interrupt status. - * \hideinitializer - */ -#define RTC_GET_TAMPER_INT_STATUS() ((RTC->INTSTS & (0x3F00))) - -/** - * @brief Enable RTC Tick Wake-up Function - * - * @param None - * - * @return None - * - * @details This macro is used to enable RTC tick interrupt wake-up function. - * \hideinitializer - */ -#define RTC_ENABLE_TICK_WAKEUP() (RTC->INTEN |= RTC_INTEN_TICKIEN_Msk); - -/** - * @brief Disable RTC Tick Wake-up Function - * - * @param[in] rtc The pointer of RTC module. - * - * @return None - * - * @details This macro is used to disable RTC tick interrupt wake-up function. - * \hideinitializer - */ -#define RTC_DISABLE_TICK_WAKEUP(rtc) ((rtc)->INTEN &= ~RTC_INTEN_TICKIEN_Msk); - -/** - * @brief Read Spare Register - * - * @param[in] rtc The pointer of RTC module. - * @param[in] u32RegNum The spare register number, 0~19. - * - * @return Spare register content - * - * @details Read the specify spare register content. - * \hideinitializer - */ -#define RTC_READ_SPARE_REGISTER(u32RegNum) (RTC->SPR[(u32RegNum)]) - -/** - * @brief Write Spare Register - * - * @param[in] u32RegNum The spare register number, 0~19. - * @param[in] u32RegValue The spare register value. - * - * @return None - * - * @details Write specify data to spare register. - * \hideinitializer - */ -#define RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue) (RTC->SPR[(u32RegNum)] = (u32RegValue)) - -int32_t RTC_Open(S_RTC_TIME_DATA_T *sPt); -void RTC_Close(void); -void RTC_32KCalibration(int32_t i32FrequencyX10000); -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek); -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day); -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk); -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk); -uint32_t RTC_GetDayOfWeek(void); -void RTC_SetTickPeriod(uint32_t u32TickSelection); -void RTC_EnableInt(uint32_t u32IntFlagMask); -void RTC_DisableInt(uint32_t u32IntFlagMask); -void RTC_EnableSpareAccess(void); -void RTC_DisableSpareRegister(void); -void RTC_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn); -void RTC_StaticTamperDisable(uint32_t u32TamperSelect); -void RTC_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source); -void RTC_DynamicTamperDisable(uint32_t u32PairSel); -void RTC_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed); -uint32_t RTC_SetClockSource(uint32_t u32ClkSrc); -void RTC_SetGPIOMode(uint32_t u32PFPin, uint32_t u32Mode, uint32_t u32DigitalCtl, uint32_t u32PullCtl, uint32_t u32OutputLevel); -void RTC_SetGPIOLevel(uint32_t u32PFPin, uint32_t u32OutputLevel); - -/**@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RTC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RTC_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sc.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sc.h deleted file mode 100644 index 9b5e104bb7a..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sc.h +++ /dev/null @@ -1,335 +0,0 @@ -/**************************************************************************//** - * @file nu_sc.h - * @version V3.00 - * @brief Smartcard(SC) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SC_H__ -#define __NU_SC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_CONSTANTS SC Exported Constants - @{ -*/ -#define SC_INTERFACE_NUM (3UL) /*!< Smartcard interface numbers \hideinitializer */ -#define SC_PIN_STATE_HIGH (1UL) /*!< Smartcard pin status high \hideinitializer */ -#define SC_PIN_STATE_LOW (0UL) /*!< Smartcard pin status low \hideinitializer */ -#define SC_PIN_STATE_IGNORE (0xFFFFFFFFUL) /*!< Ignore pin status \hideinitializer */ -#define SC_CLK_ON (1UL) /*!< Smartcard clock on \hideinitializer */ -#define SC_CLK_OFF (0UL) /*!< Smartcard clock off \hideinitializer */ - -#define SC_TMR_MODE_0 (0UL << SC_TMRCTL0_OPMODE_Pos) /*!INTEN |= (u32Mask)) - -/** - * @brief This macro disable smartcard interrupt - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Interrupt mask to be disabled. A combination of - * - \ref SC_INTEN_ACERRIEN_Msk - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_INITIEN_Msk - * - \ref SC_INTEN_CDIEN_Msk - * - \ref SC_INTEN_BGTIEN_Msk - * - \ref SC_INTEN_TMR2IEN_Msk - * - \ref SC_INTEN_TMR1IEN_Msk - * - \ref SC_INTEN_TMR0IEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * - * @return None - * - * @details The macro is used to disable Auto-convention error interrupt, Receiver buffer time-out interrupt, Initial end interrupt, - * Card detect interrupt, Block guard time interrupt, Timer2 interrupt, Timer1 interrupt, Timer0 interrupt, - * Transfer error interrupt, Transmit buffer empty interrupt or Receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SC_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief This macro set VCC pin state of smartcard interface - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32State Pin state of VCC pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW. - * - * @return None - * - * @details User can set PWREN (SC_PINCTL[0]) and PWRINV (SC_PINCTL[11]) to decide SC_PWR pin is in high or low level. - * \hideinitializer - */ -#define SC_SET_VCC_PIN(sc, u32State) \ - do {\ - uint32_t u32TimeOutCount = SC_TIMEOUT;\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk)\ - if(--u32TimeOutCount == 0) break;\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_PWREN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_PWREN_Msk;\ - }while(0) - - -/** - * @brief This macro turns CLK output on or off - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32OnOff Clock on or off for selected smartcard module, valid values are \ref SC_CLK_ON and \ref SC_CLK_OFF. - * - * @return None - * - * @details User can set CLKKEEP (SC_PINCTL[6]) to decide SC_CLK pin always keeps free running or not. - * \hideinitializer - */ -#define SC_SET_CLK_PIN(sc, u32OnOff)\ - do {\ - uint32_t u32TimeOutCount = SC_TIMEOUT;\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk)\ - if(--u32TimeOutCount == 0) break;\ - if(u32OnOff)\ - (sc)->PINCTL |= SC_PINCTL_CLKKEEP_Msk;\ - else\ - (sc)->PINCTL &= ~(SC_PINCTL_CLKKEEP_Msk);\ - }while(0) - -/** - * @brief This macro set I/O pin state of smartcard interface - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32State Pin state of I/O pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW. - * - * @return None - * - * @details User can set SCDATA (SC_PINCTL[9]) to decide SC_DATA pin to high or low. - * \hideinitializer - */ -#define SC_SET_IO_PIN(sc, u32State)\ - do {\ - uint32_t u32TimeOutCount = SC_TIMEOUT;\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk)\ - if(--u32TimeOutCount == 0) break;\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_SCDATA_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_SCDATA_Msk;\ - }while(0) - -/** - * @brief This macro set RST pin state of smartcard interface - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32State Pin state of RST pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW. - * - * @return None - * - * @details User can set SCRST (SC_PINCTL[1]) to decide SC_RST pin to high or low. - * \hideinitializer - */ -#define SC_SET_RST_PIN(sc, u32State)\ - do {\ - uint32_t u32TimeOutCount = SC_TIMEOUT;\ - while(((sc)->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk)\ - if(--u32TimeOutCount == 0) break;\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_RSTEN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_RSTEN_Msk;\ - }while(0) - -/** - * @brief This macro read one byte from smartcard module receive FIFO - * - * @param[in] sc The pointer of smartcard module. - * - * @return One byte read from receive FIFO - * - * @details By reading DAT register, the SC will return an 8-bit received data. - * \hideinitializer - */ -#define SC_READ(sc) ((char)((sc)->DAT)) - -/** - * @brief This macro write one byte to smartcard module transmit FIFO - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u8Data Data to write to transmit FIFO. - * - * @return None - * - * @details By writing data to DAT register, the SC will send out an 8-bit data. - * \hideinitializer - */ -#define SC_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief This macro set smartcard stop bit length - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Len Stop bit length, ether 1 or 2. - * - * @return None - * - * @details Stop bit length must be 1 for T = 1 protocol and 2 for T = 0 protocol. - * \hideinitializer - */ -#define SC_SET_STOP_BIT_LEN(sc, u32Len) ((sc)->CTL = ((sc)->CTL & ~SC_CTL_NSB_Msk) | (((u32Len) == 1)? SC_CTL_NSB_Msk : 0)) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count); -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count); - - -/** - * @brief Enable/Disable Tx error retry, and set Tx error retry count - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Count The number of times of Tx error retry count, between 0~8. 0 means disable Tx error retry. - * - * @return None - * - * @details This function is used to enable/disable transmitter retry function when parity error has occurred, and set error retry count. - */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count) -{ - uint32_t u32TimeOutCount = 0; - - u32TimeOutCount = SC_TIMEOUT; - while (((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_TXRTY_Msk | SC_CTL_TXRTYEN_Msk); - - if ((u32Count) != 0UL) - { - u32TimeOutCount = SC_TIMEOUT; - while (((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_TXRTY_Pos) | SC_CTL_TXRTYEN_Msk; - } -} - -/** - * @brief Enable/Disable Rx error retry, and set Rx error retry count - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Count The number of times of Rx error retry count, between 0~8. 0 means disable Rx error retry. - * - * @return None - * - * @details This function is used to enable/disable receiver retry function when parity error has occurred, and set error retry count. - */ -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count) -{ - uint32_t u32TimeOutCount = 0; - - u32TimeOutCount = SC_TIMEOUT; - while (((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_RXRTY_Msk | SC_CTL_RXRTYEN_Msk); - - if ((u32Count) != 0UL) - { - u32TimeOutCount = SC_TIMEOUT; - while (((sc)->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_RXRTY_Pos) | SC_CTL_RXRTYEN_Msk; - } -} - - -uint32_t SC_IsCardInserted(SC_T *sc); -void SC_ClearFIFO(SC_T *sc); -void SC_Close(SC_T *sc); -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR); -void SC_ResetReader(SC_T *sc); -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT); -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT); -void SC_StopAllTimer(SC_T *sc); -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount); -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum); -uint32_t SC_GetInterfaceClock(SC_T *sc); - -/**@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SC_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_scuart.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_scuart.h deleted file mode 100644 index ef93b999ab6..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_scuart.h +++ /dev/null @@ -1,356 +0,0 @@ -/**************************************************************************//** - * @file nu_scuart.h - * @version V3.00 - * @brief Smartcard UART mode (SCUART) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SCUART_H__ -#define __NU_SCUART_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - -/** @addtogroup SCUART_EXPORTED_CONSTANTS SCUART Exported Constants - @{ -*/ -#define SCUART_CHAR_LEN_5 (0x3UL << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 5 bits \hideinitializer */ -#define SCUART_CHAR_LEN_6 (0x2UL << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 6 bits \hideinitializer */ -#define SCUART_CHAR_LEN_7 (0x1UL << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 7 bits \hideinitializer */ -#define SCUART_CHAR_LEN_8 (0UL) /*!< Set SCUART word length to 8 bits \hideinitializer */ - -#define SCUART_PARITY_NONE (SC_UARTCTL_PBOFF_Msk) /*!< Set SCUART transfer with no parity \hideinitializer */ -#define SCUART_PARITY_ODD (SC_UARTCTL_OPE_Msk) /*!< Set SCUART transfer with odd parity \hideinitializer */ -#define SCUART_PARITY_EVEN (0UL) /*!< Set SCUART transfer with even parity \hideinitializer */ - -#define SCUART_STOP_BIT_1 (SC_CTL_NSB_Msk) /*!< Set SCUART transfer with one stop bit \hideinitializer */ -#define SCUART_STOP_BIT_2 (0UL) /*!< Set SCUART transfer with two stop bits \hideinitializer */ - -#define SCUART_TIMEOUT_ERR (-1L) /*!< SCUART operation abort due to timeout error \hideinitializer */ - -/**@}*/ /* end of group SCUART_EXPORTED_CONSTANTS */ - -extern int32_t g_SCUART_i32ErrCode; - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/* TX Macros */ -/** - * @brief Write Data to Tx data register - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details By writing data to DAT register, the SC will send out an 8-bit data. - * \hideinitializer - */ -#define SCUART_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief Get Tx FIFO empty flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO empty status - * @retval 0 Transmit FIFO is not empty - * @retval SC_STATUS_TXEMPTY_Msk Transmit FIFO is empty - * - * @details When the last byte of Tx buffer has been transferred to Transmitter Shift Register, hardware sets TXEMPTY (SC_STATUS[9]) high. - * It will be cleared when writing data into DAT (SC_DAT[7:0]). - * \hideinitializer - */ -#define SCUART_GET_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXEMPTY_Msk) - -/** - * @brief Get Tx FIFO full flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval SC_STATUS_TXFULL_Msk Transmit FIFO is full - * - * @details TXFULL (SC_STATUS[10]) is set when Tx buffer counts equals to 4, otherwise is cleared by hardware. - * \hideinitializer - */ -#define SCUART_GET_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk) - -/** - * @brief Wait specified smartcard port transmission complete - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details TXACT (SC_STATUS[31]) is cleared automatically when Tx transfer is finished or the last byte transmission has completed. - * - * @note This macro blocks until transmit complete. - * \hideinitializer - */ -#define SCUART_WAIT_TX_EMPTY(sc) while(((sc)->STATUS & SC_STATUS_TXACT_Msk) == SC_STATUS_TXACT_Msk) - -/** - * @brief Check specified smartcard port transmit FIFO is full or not - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval 1 Transmit FIFO is full - * - * @details TXFULL (SC_STATUS[10]) indicates Tx buffer full or not. - * This bit is set when Tx buffer counts equals to 4, otherwise is cleared by hardware. - * \hideinitializer - */ -#define SCUART_IS_TX_FULL(sc) (((sc)->STATUS & SC_STATUS_TXFULL_Msk)? 1 : 0) - -/** - * @brief Check specified smartcard port transmission is over - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit complete status - * @retval 0 Transmit is not complete - * @retval 1 Transmit complete - * - * @details TXACT (SC_STATUS[31]) indicates Tx Transmit is complete or not. - * \hideinitializer - */ -#define SCUART_IS_TX_EMPTY(sc) (((sc)->STATUS & SC_STATUS_TXACT_Msk)? 0 : 1) - -/** - * @brief Check specified smartcard port transmit FIFO empty status - * - * @param[in] sc The pointer of smartcard module. - * - * @return Transmit FIFO empty status - * @retval 0 Transmit FIFO is not empty - * @retval 1 Transmit FIFO is empty - * - * @details TXEMPTY (SC_STATUS[9]) is set by hardware when the last byte of Tx buffer has been transferred to Transmitter Shift Register. - * \hideinitializer - */ -#define SCUART_IS_TX_FIFO_EMPTY(sc) (((sc)->STATUS & SC_STATUS_TXEMPTY_Msk)? 1 : 0) - -/** - * @brief Check specified Smartcard port Transmission Status - * - * @param[in] sc The pointer of smartcard module. - * - * @retval 0 Transmit is completed - * @retval 1 Transmit is active - * - * @details TXACT (SC_STATUS[31]) is set by hardware when Tx transfer is in active and the STOP bit of the last byte has been transmitted. - * \hideinitializer - */ -#define SCUART_IS_TX_ACTIVE(sc) (((sc)->STATUS & SC_STATUS_TXACT_Msk)? 1 : 0) - - -/* RX Macros */ -/** - * @brief Read Rx data register - * - * @param[in] sc The pointer of smartcard module. - * - * @return The oldest data byte in RX FIFO - * - * @details By reading DAT register, the SC will return an 8-bit received data. - * \hideinitializer - */ -#define SCUART_READ(sc) ((sc)->DAT) - -/** - * @brief Get Rx FIFO empty flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO empty status - * @retval 0 Receive FIFO is not empty - * @retval SC_STATUS_RXEMPTY_Msk Receive FIFO is empty - * - * @details When the last byte of Rx buffer has been read by CPU, hardware sets RXEMPTY (SC_STATUS[1]) high. - * It will be cleared when SC receives any new data. - * \hideinitializer - */ -#define SCUART_GET_RX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_RXEMPTY_Msk) - -/** - * @brief Get Rx FIFO full flag status from register - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval SC_STATUS_TXFULL_Msk Receive FIFO is full - * - * @details RXFULL (SC_STATUS[2]) is set when Rx buffer counts equals to 4, otherwise it is cleared by hardware. - * \hideinitializer - */ -#define SCUART_GET_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk) - -/** - * @brief Check if receive data number in FIFO reach FIFO trigger level or not - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO data status - * @retval 0 The number of bytes in receive FIFO is less than trigger level - * @retval 1 The number of bytes in receive FIFO equals or larger than trigger level - * - * @details RDAIF (SC_INTSTS[0]) is used for received data reaching trigger level RXTRGLV (SC_CTL[7:6]) interrupt status flag. - * - * @note If receive trigger level is \b not 1 byte, this macro return 0 does not necessary indicates there is no data in FIFO. - * \hideinitializer - */ -#define SCUART_IS_RX_READY(sc) (((sc)->INTSTS & SC_INTSTS_RDAIF_Msk)? 1 : 0) - -/** - * @brief Check specified smartcard port receive FIFO is full or not - * - * @param[in] sc The pointer of smartcard module. - * - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval 1 Receive FIFO is full - * - * @details RXFULLF( SC_STATUS[2]) is set when Rx buffer counts equals to 4, otherwise it is cleared by hardware. - * \hideinitializer - */ -#define SCUART_IS_RX_FULL(sc) (((sc)->STATUS & SC_STATUS_RXFULL_Msk)? 1 : 0) - - -/* Interrupt Macros */ -/** - * @brief Enable specified interrupts - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Interrupt masks to enable, a combination of following bits, - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * - * @return None - * - * @details The macro is used to enable receiver buffer time-out interrupt, transfer error interrupt, - * transmit buffer empty interrupt or receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SCUART_ENABLE_INT(sc, u32Mask) ((sc)->INTEN |= (u32Mask)) - -/** - * @brief Disable specified interrupts - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Interrupt masks to disable, a combination of following bits, - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * - * @return None - * - * @details The macro is used to disable receiver buffer time-out interrupt, transfer error interrupt, - * transmit buffer empty interrupt or receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SCUART_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Type Interrupt flag/status to check, could be one of following value - * - \ref SC_INTSTS_RXTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * - \ref SC_INTSTS_RDAIF_Msk - * - * @return The status of specified interrupt - * @retval 0 Specified interrupt does not happened - * @retval 1 Specified interrupt happened - * - * @details The macro is used to get receiver buffer time-out interrupt status, transfer error interrupt status, - * transmit buffer empty interrupt status or receive data reach interrupt status. - * \hideinitializer - */ -#define SCUART_GET_INT_FLAG(sc, u32Type) (((sc)->INTSTS & (u32Type))? 1 : 0) - -/** - * @brief Clear specified interrupt flag/status - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Type Interrupt flag/status to clear, only \ref SC_INTSTS_TERRIF_Msk valid for this macro. - * - * @return None - * - * @details The macro is used to clear transfer error interrupt flag. - * \hideinitializer - */ -#define SCUART_CLR_INT_FLAG(sc, u32Type) ((sc)->INTSTS = (u32Type)) - -/** - * @brief Get receive error flag/status - * - * @param[in] sc The pointer of smartcard module. - * - * @return Current receive error status, could one of following errors: - * @retval SC_STATUS_PEF_Msk Parity error - * @retval SC_STATUS_FEF_Msk Frame error - * @retval SC_STATUS_BEF_Msk Break error - * - * @details The macro is used to get receiver parity error status, frame error status or break error status. - * \hideinitializer - */ -#define SCUART_GET_ERR_FLAG(sc) ((sc)->STATUS & (SC_STATUS_PEF_Msk | SC_STATUS_FEF_Msk | SC_STATUS_BEF_Msk)) - -/** - * @brief Clear specified receive error flag/status - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Mask Receive error flag/status to clear, combination following values - * - \ref SC_STATUS_PEF_Msk - * - \ref SC_STATUS_FEF_Msk - * - \ref SC_STATUS_BEF_Msk - * - * @return None - * - * @details The macro is used to clear receiver parity error flag, frame error flag or break error flag. - * \hideinitializer - */ -#define SCUART_CLR_ERR_FLAG(sc, u32Mask) ((sc)->STATUS = (u32Mask)) - -void SCUART_Close(SC_T *sc); -uint32_t SCUART_Open(SC_T *sc, uint32_t u32Baudrate); -uint32_t SCUART_Read(SC_T *sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t SCUART_SetLineConfig(SC_T *sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits); -void SCUART_SetTimeoutCnt(SC_T *sc, uint32_t u32TOC); -uint32_t SCUART_Write(SC_T *sc, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); - -/**@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SCUART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SCUART_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sdh.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sdh.h deleted file mode 100644 index ffaed7d93eb..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sdh.h +++ /dev/null @@ -1,207 +0,0 @@ -/**************************************************************************//** - * @file nu_sdh.h - * @version V1.00 - * @brief SDH driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include - -#ifndef __NU_SDH_H__ -#define __NU_SDH_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup SDH_EXPORTED_CONSTANTS SDH Exported Constants - @{ -*/ - -#define SDH_ERR_ID 0xFFFF0100ul /*!< SDH error ID \hideinitializer */ - -#define SDH_TIMEOUT (SDH_ERR_ID|0x01ul) /*!< Timeout \hideinitializer */ -#define SDH_NO_MEMORY (SDH_ERR_ID|0x02ul) /*!< OOM \hideinitializer */ - -/*-- function return value */ -#define Successful 0ul /*!< Success \hideinitializer */ -#define Fail 1ul /*!< Failed \hideinitializer */ - -/*--- define type of SD card or MMC */ -#define SDH_TYPE_UNKNOWN 0ul /*!< Unknown card type \hideinitializer */ -#define SDH_TYPE_SD_HIGH 1ul /*!< SDHC card \hideinitializer */ -#define SDH_TYPE_SD_LOW 2ul /*!< SD card \hideinitializer */ -#define SDH_TYPE_MMC 3ul /*!< MMC card \hideinitializer */ -#define SDH_TYPE_EMMC 4ul /*!< eMMC card \hideinitializer */ - -/* SD error */ -#define SDH_NO_SD_CARD (SDH_ERR_ID|0x10ul) /*!< Card removed \hideinitializer */ -#define SDH_ERR_DEVICE (SDH_ERR_ID|0x11ul) /*!< Device error \hideinitializer */ -#define SDH_INIT_TIMEOUT (SDH_ERR_ID|0x12ul) /*!< Card init timeout \hideinitializer */ -#define SDH_SELECT_ERROR (SDH_ERR_ID|0x13ul) /*!< Card select error \hideinitializer */ -#define SDH_WRITE_PROTECT (SDH_ERR_ID|0x14ul) /*!< Card write protect \hideinitializer */ -#define SDH_INIT_ERROR (SDH_ERR_ID|0x15ul) /*!< Card init error \hideinitializer */ -#define SDH_CRC7_ERROR (SDH_ERR_ID|0x16ul) /*!< CRC 7 error \hideinitializer */ -#define SDH_CRC16_ERROR (SDH_ERR_ID|0x17ul) /*!< CRC 16 error \hideinitializer */ -#define SDH_CRC_ERROR (SDH_ERR_ID|0x18ul) /*!< CRC error \hideinitializer */ -#define SDH_CMD8_ERROR (SDH_ERR_ID|0x19ul) /*!< Command 8 error \hideinitializer */ - -#define MMC_FREQ 20000ul /*!< output 20MHz to MMC \hideinitializer */ -#define SD_FREQ 25000ul /*!< output 25MHz to SD \hideinitializer */ -#define SDHC_FREQ 50000ul /*!< output 50MHz to SDH \hideinitializer */ - -#define SD_PORT0 (1 << 0) /*!< Card select SD0 \hideinitializer */ -#define SD_PORT1 (1 << 2) /*!< Card select SD1 \hideinitializer */ -#define CardDetect_From_GPIO (1ul << 8) /*!< Card detection pin is GPIO \hideinitializer */ -#define CardDetect_From_DAT3 (1ul << 9) /*!< Card detection pin is DAT3 \hideinitializer */ - -#define TIMEOUT_SDH SystemCoreClock /*!< 1 second time-out \hideinitializer */ -#define SDH_TIMEOUT_ERR (-1L) /*!< SDH operation abort due to timeout error \hideinitializer */ - -/*@}*/ /* end of group SDH_EXPORTED_CONSTANTS */ - -/** @addtogroup SDH_EXPORTED_TYPEDEF SDH Exported Type Defines - @{ -*/ -typedef struct SDH_info_t -{ - unsigned char IsCardInsert; /*!< Card insert state */ - unsigned char R3Flag; - unsigned char R7Flag; - unsigned char volatile DataReadyFlag; - unsigned int CardType; /*!< SDHC, SD, or MMC */ - unsigned int RCA; /*!< Relative card address */ - unsigned int totalSectorN; /*!< Total sector number */ - unsigned int diskSize; /*!< Disk size in K bytes */ - int sectorSize; /*!< Sector size in bytes */ - unsigned char *dmabuf; -} SDH_INFO_T; /*!< Structure holds SD card info */ - -/*@}*/ /* end of group SDH_EXPORTED_TYPEDEF */ - -/** @cond HIDDEN_SYMBOLS */ -extern SDH_INFO_T SD0, SD1; -extern int32_t g_SDH_i32ErrCode; -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ - -/** - * @brief Enable specified interrupt. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_CDSRC_Msk \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / - * \ref SDH_INTEN_WKIEN_Msk - * - * @return None. - * \hideinitializer - */ -#define SDH_ENABLE_INT(sdh, u32IntMask) ((sdh)->INTEN |= (u32IntMask)) - -/** - * @brief Disable specified interrupt. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / \ref SDH_INTEN_WKIEN_Msk / \ref SDH_INTEN_CDSRC_Msk / - * - * @return None. - * \hideinitializer - */ -#define SDH_DISABLE_INT(sdh, u32IntMask) ((sdh)->INTEN &= ~(u32IntMask)) - -/** - * @brief Get specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CRC7_Msk / - * \ref SDH_INTSTS_CRC16_Msk / \ref SDH_INTSTS_CRCSTS_Msk / \ref SDH_INTSTS_DAT0STS_Msk / - * \ref SDH_INTSTS_CDIF_Msk \ref SDH_INTSTS_RTOIF_Msk / - * \ref SDH_INTSTS_DITOIF_Msk / \ref SDH_INTSTS_CDSTS_Msk / - * \ref SDH_INTSTS_DAT1STS_Msk - * - * - * @return 0 = The specified interrupt is not happened. - * 1 = The specified interrupt is happened. - * \hideinitializer - */ -#define SDH_GET_INT_FLAG(sdh, u32IntMask) (((sdh)->INTSTS & (u32IntMask))?1:0) - - -/** - * @brief Clear specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CDIF_Msk / - * \ref SDH_INTSTS_RTOIF_Msk / \ref SDH_INTSTS_DITOIF_Msk - * - * - * @return None. - * \hideinitializer - */ -#define SDH_CLR_INT_FLAG(sdh, u32IntMask) ((sdh)->INTSTS = (u32IntMask)) - - -/** - * @brief Check SD Card inserted or removed. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return 1: Card inserted. - * 0: Card removed. - * \hideinitializer - */ -#define SDH_IS_CARD_PRESENT(sdh) (((sdh) == SDH0)? SD0.IsCardInsert : SD1.IsCardInsert) - -/** - * @brief Get SD Card capacity. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return SD Card capacity. (unit: KByte) - * \hideinitializer - */ -#define SDH_GET_CARD_CAPACITY(sdh) (((sdh) == SDH0)? SD0.diskSize : SD1.diskSize) - - -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc); -uint32_t SDH_Probe(SDH_T *sdh); -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -void SDH_Set_clock(SDH_T *sdh, uint32_t sd_clock_khz); - -uint32_t SDH_CardDetection(SDH_T *sdh); -void SDH_Open_Disk(SDH_T *sdh, uint32_t u32CardDetSrc); -void SDH_Close_Disk(SDH_T *sdh); - - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SDH_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spi.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spi.h deleted file mode 100644 index 788d8b2c09f..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spi.h +++ /dev/null @@ -1,617 +0,0 @@ -/**************************************************************************//** - * @file nu_spi.h - * @version V3.00 - * @brief M460 series SPI driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SPI_H__ -#define __NU_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ - -#define SPI_MODE_0 (SPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define SPI_MODE_1 (SPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_2 (SPI_CTL_CLKPOL_Msk | SPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_3 (SPI_CTL_CLKPOL_Msk | SPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define SPI_SLAVE (SPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define SPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define SPI_SS (SPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define SPI_SS_ACTIVE_HIGH (SPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define SPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* SPI Interrupt Mask */ -#define SPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define SPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define SPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define SPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define SPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define SPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define SPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* SPI Status Mask */ -#define SPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define SPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define SPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define SPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define SPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define SPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define SPI_SPIEN_STS_MASK (0x40U) /*!< SPIEN status mask \hideinitializer */ -#define SPI_SSLINE_STS_MASK (0x80U) /*!< SPIx_SS line status mask \hideinitializer */ - -/* SPI Status2 Mask */ -#define SPI_SLVBENUM_MASK (0x01U) /*!< Effective bit number of uncompleted RX data status mask \hideinitializer */ - - -/* I2S Data Width */ -#define SPII2S_DATABIT_8 (0U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 8-bit \hideinitializer */ -#define SPII2S_DATABIT_16 (1U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 16-bit \hideinitializer */ -#define SPII2S_DATABIT_24 (2U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 24-bit \hideinitializer */ -#define SPII2S_DATABIT_32 (3U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 32-bit \hideinitializer */ - -/* I2S Audio Format */ -#define SPII2S_MONO SPI_I2SCTL_MONO_Msk /*!< Monaural channel \hideinitializer */ -#define SPII2S_STEREO (0U) /*!< Stereo channel \hideinitializer */ - -/* I2S Data Format */ -#define SPII2S_FORMAT_I2S (0U<STATUS = SPI_STATUS_UNITIF_Msk ) - -/** - * @brief Disable Slave 3-wire mode. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SLV3WIRE bit of SPI_SSCTL register to disable Slave 3-wire mode. - * \hideinitializer - */ -#define SPI_DISABLE_3WIRE_MODE(spi) ( (spi)->SSCTL &= ~SPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable Slave 3-wire mode. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SLV3WIRE bit of SPI_SSCTL register to enable Slave 3-wire mode. - * \hideinitializer - */ -#define SPI_ENABLE_3WIRE_MODE(spi) ( (spi)->SSCTL |= SPI_SSCTL_SLV3WIRE_Msk ) - -/** - * @brief Trigger RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set RXPDMAEN bit of SPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_RX_PDMA(spi) ( (spi)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Trigger TX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit of SPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_PDMA(spi) ( (spi)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_RX_PDMA(spi) ( (spi)->PDMACTL |= (SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear RXPDMAEN bit of SPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_RX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit of SPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_RX_PDMA(spi) ( (spi)->PDMACTL &= ~(SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] spi The pointer of the specified SPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (SPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_COUNT(spi) ( ((spi)->STATUS & SPI_STATUS_RXCNT_Msk) >> SPI_STATUS_RXCNT_Pos ) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of SPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_EMPTY_FLAG(spi) ( ((spi)->STATUS & SPI_STATUS_RXEMPTY_Msk) >> SPI_STATUS_RXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of SPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_EMPTY_FLAG(spi) ( ((spi)->STATUS & SPI_STATUS_TXEMPTY_Msk) >> SPI_STATUS_TXEMPTY_Pos ) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of SPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_FULL_FLAG(spi) ( ((spi)->STATUS & SPI_STATUS_TXFULL_Msk) >> SPI_STATUS_TXFULL_Pos ) - -/** - * @brief Get the datum read from RX register. - * @param[in] spi The pointer of the specified SPI module. - * @return Data in RX register. - * @details Read SPI_RX register to get the received datum. - * \hideinitializer - */ -#define SPI_READ_RX(spi) ( (spi)->RX ) - -/** - * @brief Write datum to TX register. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through SPI bus. - * @return None. - * @details Write u32TxData to SPI_TX register. - * \hideinitializer - */ -#define SPI_WRITE_TX(spi, u32TxData) ( (spi)->TX = (u32TxData) ) - -/** - * @brief Set SPIx_SS pin to high state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to high state. - * \hideinitializer - */ -#define SPI_SET_SS_HIGH(spi) ( (spi)->SSCTL = ((spi)->SSCTL & (~SPI_SSCTL_AUTOSS_Msk)) | (SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk) ) - -/** - * @brief Set SPIx_SS pin to low state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to low state. - * \hideinitializer - */ -#define SPI_SET_SS_LOW(spi) ( (spi)->SSCTL = ((spi)->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk))) | SPI_SSCTL_SS_Msk ) - -/** - * @brief Enable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (SPI_CTL[7:4]). - * \hideinitializer - */ -#define SPI_ENABLE_BYTE_REORDER(spi) ( (spi)->CTL |= SPI_CTL_REORDER_Msk ) - -/** - * @brief Disable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear REORDER bit field of SPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define SPI_DISABLE_BYTE_REORDER(spi) ( (spi)->CTL &= ~SPI_CTL_REORDER_Msk ) - -/** - * @brief Set the length of suspend interval. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one SPI bus clock cycle). - * \hideinitializer - */ -#define SPI_SET_SUSPEND_CYCLE(spi, u32SuspCycle) ( (spi)->CTL = ((spi)->CTL & ~SPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << SPI_CTL_SUSPITV_Pos) ) - -/** - * @brief Set the SPI transfer sequence with LSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set LSB bit of SPI_CTL register to set the SPI transfer sequence with LSB first. - * \hideinitializer - */ -#define SPI_SET_LSB_FIRST(spi) ( (spi)->CTL |= SPI_CTL_LSB_Msk ) - -/** - * @brief Set the SPI transfer sequence with MSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of SPI_CTL register to set the SPI transfer sequence with MSB first. - * \hideinitializer - */ -#define SPI_SET_MSB_FIRST(spi) ( (spi)->CTL &= ~SPI_CTL_LSB_Msk ) - -/** - * @brief Set the data width of a SPI transaction. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 4 ~ 32 bits. - * \hideinitializer - */ -#define SPI_SET_DATA_WIDTH(spi, u32Width) ( (spi)->CTL = ((spi)->CTL & ~SPI_CTL_DWIDTH_Msk) | (((u32Width) & 0x1F) << SPI_CTL_DWIDTH_Pos) ) - -/** - * @brief Get the SPI busy state. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 SPI controller is not busy. - * @retval 1 SPI controller is busy. - * @details This macro will return the busy state of SPI controller. - * \hideinitializer - */ -#define SPI_IS_BUSY(spi) ( ((spi)->STATUS & SPI_STATUS_BUSY_Msk) >> SPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SPIEN (SPI_CTL[0]) to enable SPI controller. - * \hideinitializer - */ -#define SPI_ENABLE(spi) ( (spi)->CTL |= SPI_CTL_SPIEN_Msk ) - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SPIEN (SPI_CTL[0]) to disable SPI controller. - * \hideinitializer - */ -#define SPI_DISABLE(spi) ( (spi)->CTL &= ~SPI_CTL_SPIEN_Msk ) - -/** - * @brief Enable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will set RZCEN or LZCEN bit of SPI_I2SCTL register to enable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_ENABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if (u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL |= SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Disable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will clear RZCEN or LZCEN bit of SPI_I2SCTL register to disable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_DISABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if (u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Enable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXPDMAEN bit of SPI_PDMACTL register to transmit data with PDMA. - * \hideinitializer - */ -#define SPII2S_ENABLE_TXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXPDMAEN bit of SPI_PDMACTL register to disable TX DMA function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXPDMAEN bit of SPI_PDMACTL register to receive data with PDMA. - * \hideinitializer - */ -#define SPII2S_ENABLE_RXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXPDMAEN bit of SPI_PDMACTL register to disable RX DMA function. - * \hideinitializer - */ -#define SPII2S_DISABLE_RXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXEN bit of SPI_I2SCTL register to enable I2S TX function. - * \hideinitializer - */ -#define SPII2S_ENABLE_TX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Disable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXEN bit of SPI_I2SCTL register to disable I2S TX function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Enable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXEN bit of SPI_I2SCTL register to enable I2S RX function. - * \hideinitializer - */ -#define SPII2S_ENABLE_RX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Disable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXEN bit of SPI_I2SCTL register to disable I2S RX function. - * \hideinitializer - */ -#define SPII2S_DISABLE_RX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Enable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set MUTE bit of SPI_I2SCTL register to enable I2S TX mute function. - * \hideinitializer - */ -#define SPII2S_ENABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Disable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear MUTE bit of SPI_I2SCTL register to disable I2S TX mute function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Clear TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TX FIFO. The internal TX FIFO pointer will be reset to FIFO start point. - * \hideinitializer - */ -#define SPII2S_CLR_TX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk ) - -/** - * @brief Clear RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RX FIFO. The internal RX FIFO pointer will be reset to FIFO start point. - * \hideinitializer - */ -#define SPII2S_CLR_RX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref SPII2S_MONO_LEFT - * - \ref SPII2S_MONO_RIGHT - * @return None - * @details This function selects the recording source channel of monaural mode. - * \hideinitializer - */ -__STATIC_INLINE void SPII2S_SET_MONO_RX_CHANNEL(SPI_T *i2s, uint32_t u32Ch) -{ - u32Ch == SPII2S_MONO_LEFT ? - (i2s->I2SCTL |= SPI_I2SCTL_RXLCH_Msk) : - (i2s->I2SCTL &= ~SPI_I2SCTL_RXLCH_Msk); -} - -/** - * @brief Write data to I2S TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Data The value written to TX FIFO. - * @return None - * @details This macro will write a value to TX FIFO. - * \hideinitializer - */ -#define SPII2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TX = (u32Data) ) - -/** - * @brief Read RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return The value read from RX FIFO. - * @details This function will return a value read from RX FIFO. - * \hideinitializer - */ -#define SPII2S_READ_RX_FIFO(i2s) ( (i2s)->RX ) - -/** - * @brief Get the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return The interrupt flags specified by the u32mask parameter. - * @details This macro will return the combination interrupt flags of SPI_I2SSTS register. The flags are specified by the u32mask parameter. - * \hideinitializer - */ -#define SPII2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS & (u32Mask) ) - -/** - * @brief Clear the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return None - * @details This macro will clear the interrupt flags specified by the u32mask parameter. - * @note Except TX and RX FIFO threshold interrupt flags, the other interrupt flags can be cleared by writing 1 to itself. - * \hideinitializer - */ -#define SPII2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS = (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return TX FIFO level - * @details This macro will return the number of available words in TX FIFO. - * \hideinitializer - */ -#define SPII2S_GET_TX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_TXCNT_Msk) >> SPI_I2SSTS_TXCNT_Pos ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return RX FIFO level - * @details This macro will return the number of available words in RX FIFO. - * \hideinitializer - */ -#define SPII2S_GET_RX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_RXCNT_Msk) >> SPI_I2SSTS_RXCNT_Pos ) - - - -/* Function prototype declaration */ -uint32_t SPI_Open(SPI_T *spi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void SPI_Close(SPI_T *spi); -void SPI_ClearRxFIFO(SPI_T *spi); -void SPI_ClearTxFIFO(SPI_T *spi); -void SPI_DisableAutoSS(SPI_T *spi); -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock); -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t SPI_GetBusClock(SPI_T *spi); -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask); -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask); -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetStatus2(SPI_T *spi, uint32_t u32Mask); - -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat); -void SPII2S_Close(SPI_T *i2s); -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask); -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask); -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock); -void SPII2S_DisableMCLK(SPI_T *i2s); -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); - - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SPI_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spim.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spim.h deleted file mode 100644 index 3e3f22f90b2..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_spim.h +++ /dev/null @@ -1,634 +0,0 @@ -/**************************************************************************//** - * @file nu_spim.h - * @version V1.00 - * @brief M480 series SPIM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SPIM_H__ -#define __NU_SPIM_H__ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Include related headers */ -/*---------------------------------------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPIM_Driver SPIM Driver - @{ -*/ - - -/** @addtogroup SPIM_EXPORTED_CONSTANTS SPIM Exported Constants - @{ -*/ - -#define SPIM_DMM_MAP_ADDR 0x100000UL /*!< DMM mode memory map base address \hideinitializer */ -#define SPIM_DMM_SIZE 0x100000UL /*!< DMM mode memory mapping size \hideinitializer */ -#define SPIM_CCM_ADDR 0x20020000UL /*!< CCM mode memory map base address \hideinitializer */ -#define SPIM_CCM_SIZE 0x8000UL /*!< CCM mode memory size \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SPIM_CTL0 constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SPIM_CTL0_RW_IN(x) ((x) ? 0UL : (0x1UL << SPIM_CTL0_QDIODIR_Pos)) /*!< SPIM_CTL0: SPI Interface Direction Select \hideinitializer */ -#define SPIM_CTL0_BITMODE_SING (0UL << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_CTL0: One bit mode (SPI Interface including DO, DI, HOLD, WP) \hideinitializer */ -#define SPIM_CTL0_BITMODE_DUAL (1UL << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_CTL0: Two bits mode (SPI Interface including D0, D1, HOLD, WP) \hideinitializer */ -#define SPIM_CTL0_BITMODE_QUAD (2UL << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_CTL0: Four bits mode (SPI Interface including D0, D1, D2, D3) \hideinitializer */ -#define SPIM_CTL0_OPMODE_IO (0UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: I/O Mode \hideinitializer */ -#define SPIM_CTL0_OPMODE_PAGEWRITE (1UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: Page Write Mode \hideinitializer */ -#define SPIM_CTL0_OPMODE_PAGEREAD (2UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: Page Read Mode \hideinitializer */ -#define SPIM_CTL0_OPMODE_DIRECTMAP (3UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: Direct Map Mode \hideinitializer */ - -#define CMD_NORMAL_PAGE_PROGRAM (0x02UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Page Program (Page Write Mode Use) \hideinitializer */ -#define CMD_NORMAL_PAGE_PROGRAM_4B (0x12UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Page Program (Page Write Mode Use) \hideinitializer */ -#define CMD_QUAD_PAGE_PROGRAM_WINBOND (0x32UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Quad Page program (for Winbond) (Page Write Mode Use) \hideinitializer */ -#define CMD_QUAD_PAGE_PROGRAM_MXIC (0x38UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Quad Page program (for MXIC) (Page Write Mode Use) \hideinitializer */ -#define CMD_QUAD_PAGE_PROGRAM_EON (0x40UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Quad Page Program (for EON) (Page Write Mode Use) \hideinitializer */ - -#define CMD_DMA_NORMAL_READ (0x03UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Read Data (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_READ (0x0BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_NORMAL_DUAL_READ (0x3BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_READ_DUAL_OUTPUT (0x3BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_READ_QUAD_OUTPUT (0x6BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_DUAL_READ (0xBBUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_NORMAL_QUAD_READ (0xE7UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Quad I/O (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_QUAD_READ (0xEBUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Quad I/O (Page Read Mode Use) \hideinitializer */ - -/** @cond HIDDEN_SYMBOLS */ - -typedef enum -{ - MFGID_UNKNOW = 0x00U, - MFGID_SPANSION = 0x01U, - MFGID_EON = 0x1CU, - MFGID_ISSI = 0x7FU, - MFGID_MXIC = 0xC2U, - MFGID_WINBOND = 0xEFU -} -E_MFGID; - -/* Flash opcodes. */ -#define OPCODE_WREN 0x06U /* Write enable */ -#define OPCODE_RDSR 0x05U /* Read status register #1*/ -#define OPCODE_WRSR 0x01U /* Write status register #1 */ -#define OPCODE_RDSR2 0x35U /* Read status register #2*/ -#define OPCODE_WRSR2 0x31U /* Write status register #2 */ -#define OPCODE_RDSR3 0x15U /* Read status register #3*/ -#define OPCODE_WRSR3 0x11U /* Write status register #3 */ -#define OPCODE_PP 0x02U /* Page program (up to 256 bytes) */ -#define OPCODE_SE_4K 0x20U /* Erase 4KB sector */ -#define OPCODE_BE_32K 0x52U /* Erase 32KB block */ -#define OPCODE_CHIP_ERASE 0xc7U /* Erase whole flash chip */ -#define OPCODE_BE_64K 0xd8U /* Erase 64KB block */ -#define OPCODE_READ_ID 0x90U /* Read ID */ -#define OPCODE_RDID 0x9fU /* Read JEDEC ID */ -#define OPCODE_BRRD 0x16U /* SPANSION flash - Bank Register Read command */ -#define OPCODE_BRWR 0x17U /* SPANSION flash - Bank Register write command */ -#define OPCODE_NORM_READ 0x03U /* Read data bytes */ -#define OPCODE_FAST_READ 0x0bU /* Read data bytes */ -#define OPCODE_FAST_DUAL_READ 0x3bU /* Read data bytes */ -#define OPCODE_FAST_QUAD_READ 0x6bU /* Read data bytes */ - -/* Used for SST flashes only. */ -#define OPCODE_BP 0x02U /* Byte program */ -#define OPCODE_WRDI 0x04U /* Write disable */ -#define OPCODE_AAI_WP 0xadU /* Auto u32Address increment word program */ - -/* Used for Macronix flashes only. */ -#define OPCODE_EN4B 0xb7U /* Enter 4-byte mode */ -#define OPCODE_EX4B 0xe9U /* Exit 4-byte mode */ - -#define OPCODE_RDSCUR 0x2bU -#define OPCODE_WRSCUR 0x2fU - -#define OPCODE_RSTEN 0x66U -#define OPCODE_RST 0x99U - -#define OPCODE_ENQPI 0x38U -#define OPCODE_EXQPI 0xFFU - -/* Status Register bits. */ -#define SR_WIP 0x1U /* Write in progress */ -#define SR_WEL 0x2U /* Write enable latch */ -#define SR_QE 0x40U /* Quad Enable for MXIC */ -/* Status Register #2 bits. */ -#define SR2_QE 0x2U /* Quad Enable for Winbond */ -/* meaning of other SR_* bits may differ between vendors */ -#define SR_BP0 0x4U /* Block protect 0 */ -#define SR_BP1 0x8U /* Block protect 1 */ -#define SR_BP2 0x10U /* Block protect 2 */ -#define SR_SRWD 0x80U /* SR write protect */ -#define SR3_ADR 0x01U /* 4-byte u32Address mode */ - -#define SCUR_4BYTE 0x04U /* 4-byte u32Address mode */ - -/** @endcond HIDDEN_SYMBOLS */ - -#define SPIM_TIMEOUT_ERR (-1L) /*!< SPIM operation abort due to timeout error \hideinitializer */ - -/*@}*/ /* end of group SPIM_EXPORTED_CONSTANTS */ - -extern int32_t g_SPIM_i32ErrCode; - -/** @addtogroup SPIM_EXPORTED_FUNCTIONS SPIM Exported Functions - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/** - * @details Enable cipher. - * \hideinitializer - */ -#define SPIM_ENABLE_CIPHER() (SPIM->CTL0 &= ~SPIM_CTL0_CIPHOFF_Msk) - -/** - * @details Disable cipher. - * \hideinitializer - */ -#define SPIM_DISABLE_CIPHER() (SPIM->CTL0 |= SPIM_CTL0_CIPHOFF_Msk) - -/** - * @details Enable cipher balance - * \hideinitializer - */ -#define SPIM_ENABLE_BALEN() (SPIM->CTL0 |= SPIM_CTL0_BALEN_Msk) - -/** - * @details Disable cipher balance - * \hideinitializer - */ -#define SPIM_DISABLE_BALEN() (SPIM->CTL0 &= ~SPIM_CTL0_BALEN_Msk) - -/** - * @details Set 4-byte address to be enabled/disabled. - * \hideinitializer - */ -#define SPIM_SET_4BYTE_ADDR_EN(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_B4ADDREN_Msk)) | (((x) ? 1UL : 0UL) << SPIM_CTL0_B4ADDREN_Pos); \ - } while (0) - -/** - * @details Enable SPIM interrupt - * \hideinitializer - */ -#define SPIM_ENABLE_INT() (SPIM->CTL0 |= SPIM_CTL0_IEN_Msk) - -/** - * @details Disable SPIM interrupt - * \hideinitializer - */ -#define SPIM_DISABLE_INT() (SPIM->CTL0 &= ~SPIM_CTL0_IEN_Msk) - -/** - * @details Is interrupt flag on. - * \hideinitializer - */ -#define SPIM_IS_IF_ON() ((SPIM->CTL0 & SPIM_CTL0_IF_Msk) != 0UL) - -/** - * @details Clear interrupt flag. - * \hideinitializer - */ -#define SPIM_CLR_INT() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_IF_Msk)) | (1UL << SPIM_CTL0_IF_Pos); \ - } while (0) - -/** - * @details Set transmit/receive bit length - * \hideinitializer - */ -#define SPIM_SET_DATA_WIDTH(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_DWIDTH_Msk)) | (((x) - 1U) << SPIM_CTL0_DWIDTH_Pos); \ - } while (0) - -/** - * @details Get data transmit/receive bit length setting - * \hideinitializer - */ -#define SPIM_GET_DATA_WIDTH() \ - (((SPIM->CTL0 & SPIM_CTL0_DWIDTH_Msk) >> SPIM_CTL0_DWIDTH_Pos)+1U) - -/** - * @details Set data transmit/receive burst number - * \hideinitializer - */ -#define SPIM_SET_DATA_NUM(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_BURSTNUM_Msk)) | (((x) - 1U) << SPIM_CTL0_BURSTNUM_Pos); \ - } while (0) - -/** - * @details Get data transmit/receive burst number - * \hideinitializer - */ -#define SPIM_GET_DATA_NUM() \ - (((SPIM->CTL0 & SPIM_CTL0_BURSTNUM_Msk) >> SPIM_CTL0_BURSTNUM_Pos)+1U) - -/** - * @details Enable Single Input mode. - * \hideinitializer - */ -#define SPIM_ENABLE_SING_INPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_SING | SPIM_CTL0_RW_IN(1)); \ - } while (0) - -/** - * @details Enable Single Output mode. - * \hideinitializer - */ -#define SPIM_ENABLE_SING_OUTPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_SING | SPIM_CTL0_RW_IN(0)); \ - } while (0) - -/** - * @details Enable Dual Input mode. - * \hideinitializer - */ -#define SPIM_ENABLE_DUAL_INPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_DUAL | SPIM_CTL0_RW_IN(1U)); \ - } while (0) - -/** - * @details Enable Dual Output mode. - * \hideinitializer - */ -#define SPIM_ENABLE_DUAL_OUTPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_DUAL | SPIM_CTL0_RW_IN(0U)); \ - } while (0) - -/** - * @details Enable Quad Input mode. - * \hideinitializer - */ -#define SPIM_ENABLE_QUAD_INPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_QUAD | SPIM_CTL0_RW_IN(1U)); \ - } while (0) - -/** - * @details Enable Quad Output mode. - * \hideinitializer - */ -#define SPIM_ENABLE_QUAD_OUTPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_QUAD | SPIM_CTL0_RW_IN(0U)); \ - } while (0) - -/** - * @details Set suspend interval which ranges between 0 and 15. - * \hideinitializer - */ -#define SPIM_SET_SUSP_INTVL(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_SUSPITV_Msk)) | ((x) << SPIM_CTL0_SUSPITV_Pos); \ - } while (0) - -/** - * @details Get suspend interval setting - * \hideinitializer - */ -#define SPIM_GET_SUSP_INTVL() \ - ((SPIM->CTL0 & SPIM_CTL0_SUSPITV_Msk) >> SPIM_CTL0_SUSPITV_Pos) - -/** - * @details Set operation mode. - * \hideinitializer - */ -#define SPIM_SET_OPMODE(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_OPMODE_Msk)) | (x); \ - } while (0) - -/** - * @details Get operation mode. - * \hideinitializer - */ -#define SPIM_GET_OP_MODE() (SPIM->CTL0 & SPIM_CTL0_OPMODE_Msk) - -/** - * @details Set SPIM mode. - * \hideinitializer - */ -#define SPIM_SET_SPIM_MODE(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_CMDCODE_Msk)) | (x); \ - } while (0) - -/** - * @details Get SPIM mode. - * \hideinitializer - */ -#define SPIM_GET_SPIM_MODE() (SPIM->CTL0 & SPIM_CTL0_CMDCODE_Msk) - -/** - * @details Start operation. - * \hideinitializer - */ -#define SPIM_SET_GO() (SPIM->CTL1 |= SPIM_CTL1_SPIMEN_Msk) - -/** - * @details Is engine busy. - * \hideinitializer - */ -#define SPIM_IS_BUSY() (SPIM->CTL1 & SPIM_CTL1_SPIMEN_Msk) - -/** - * @details Wait for free. - * \hideinitializer - */ -#define SPIM_WAIT_FREE() while (SPIM->CTL1 & SPIM_CTL1_SPIMEN_Msk) - -/** - * @details Enable cache. - * \hideinitializer - */ -#define SPIM_ENABLE_CACHE() (SPIM->CTL1 &= ~SPIM_CTL1_CACHEOFF_Msk) - -/** - * @details Disable cache. - * \hideinitializer - */ -#define SPIM_DISABLE_CACHE() (SPIM->CTL1 |= SPIM_CTL1_CACHEOFF_Msk) - -/** - * @details Is cache enabled. - * \hideinitializer - */ -#define SPIM_IS_CACHE_EN() ((SPIM->CTL1 & SPIM_CTL1_CACHEOFF_Msk) ? 0 : 1) - -/** - * @details Enable CCM - * \hideinitializer - */ -#define SPIM_ENABLE_CCM() (SPIM->CTL1 |= SPIM_CTL1_CCMEN_Msk) - -/** - * @details Disable CCM. - * \hideinitializer - */ -#define SPIM_DISABLE_CCM() (SPIM->CTL1 &= ~SPIM_CTL1_CCMEN_Msk) - -/** - * @details Is CCM enabled. - * \hideinitializer - */ -#define SPIM_IS_CCM_EN() ((SPIM->CTL1 & SPIM_CTL1_CCMEN_Msk) >> SPIM_CTL1_CCMEN_Pos) - -/** - * @details Invalidate cache. - * \hideinitializer - */ -#define SPIM_INVALID_CACHE() (SPIM->CTL1 |= SPIM_CTL1_CDINVAL_Msk) - -/** - * @details Set SS(Select Active) to active level. - * \hideinitializer - */ -#define SPIM_SET_SS_EN(x) \ - do { \ - (SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_SS_Msk)) | ((! (x) ? 1UL : 0UL) << SPIM_CTL1_SS_Pos)); \ - } while (0) - -/** - * @details Is SS(Select Active) in active level. - * \hideinitializer - */ -#define SPIM_GET_SS_EN() \ - (!(SPIM->CTL1 & SPIM_CTL1_SS_Msk)) - -/** - * @details Set active level of slave select to be high/low. - * \hideinitializer - */ -#define SPIM_SET_SS_ACTLVL(x) \ - do { \ - (SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_SSACTPOL_Msk)) | ((!! (x) ? 1UL : 0UL) << SPIM_CTL1_SSACTPOL_Pos)); \ - } while (0) - -/** - * @details Set idle time interval - * \hideinitializer - */ -#define SPIM_SET_IDL_INTVL(x) \ - do { \ - SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_IDLETIME_Msk)) | ((x) << SPIM_CTL1_IDLETIME_Pos); \ - } while (0) - -/** - * @details Get idle time interval setting - * \hideinitializer - */ -#define SPIM_GET_IDL_INTVL() \ - ((SPIM->CTL1 & SPIM_CTL1_IDLETIME_Msk) >> SPIM_CTL1_IDLETIME_Pos) - -/** - * @details Set SPIM clock divider - * \hideinitializer - */ -#define SPIM_SET_CLOCK_DIVIDER(x) \ - do { \ - SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_DIVIDER_Msk)) | ((x) << SPIM_CTL1_DIVIDER_Pos); \ - } while (0) - -/** - * @details Get SPIM current clock divider setting - * \hideinitializer - */ -#define SPIM_GET_CLOCK_DIVIDER() \ - ((SPIM->CTL1 & SPIM_CTL1_DIVIDER_Msk) >> SPIM_CTL1_DIVIDER_Pos) - -/** - * @details Set SPI flash deselect time interval of DMA write mode - * \hideinitializer - */ -#define SPIM_SET_RXCLKDLY_DWDELSEL(x) \ - do { \ - (SPIM->RXCLKDLY = (SPIM->RXCLKDLY & (~SPIM_RXCLKDLY_DWDELSEL_Msk)) | ((x) << SPIM_RXCLKDLY_DWDELSEL_Pos)); \ - } while (0) - -/** - * @details Get SPI flash deselect time interval of DMA write mode - * \hideinitializer - */ -#define SPIM_GET_RXCLKDLY_DWDELSEL() \ - ((SPIM->RXCLKDLY & SPIM_RXCLKDLY_DWDELSEL_Msk) >> SPIM_RXCLKDLY_DWDELSEL_Pos) - -/** - * @details Set sampling clock delay selection for received data - * \hideinitializer - */ -#define SPIM_SET_RXCLKDLY_RDDLYSEL(x) \ - do { \ - (SPIM->RXCLKDLY = (SPIM->RXCLKDLY & (~SPIM_RXCLKDLY_RDDLYSEL_Msk)) | ((x) << SPIM_RXCLKDLY_RDDLYSEL_Pos)); \ - } while (0) - -/** - * @details Get sampling clock delay selection for received data - * \hideinitializer - */ -#define SPIM_GET_RXCLKDLY_RDDLYSEL() \ - ((SPIM->RXCLKDLY & SPIM_RXCLKDLY_RDDLYSEL_Msk) >> SPIM_RXCLKDLY_RDDLYSEL_Pos) - -/** - * @details Set sampling clock edge selection for received data - * \hideinitializer - */ -#define SPIM_SET_RXCLKDLY_RDEDGE() \ - (SPIM->RXCLKDLY |= SPIM_RXCLKDLY_RDEDGE_Msk); \ - -/** - * @details Get sampling clock edge selection for received data - * \hideinitializer - */ -#define SPIM_CLR_RXCLKDLY_RDEDGE() \ - (SPIM->RXCLKDLY &= ~SPIM_RXCLKDLY_RDEDGE_Msk) - -/** - * @details Set mode bits data for continuous read mode - * \hideinitializer - */ -#define SPIM_SET_DMMCTL_CRMDAT(x) \ - do { \ - (SPIM->DMMCTL = (SPIM->DMMCTL & (~SPIM_DMMCTL_CRMDAT_Msk)) | ((x) << SPIM_DMMCTL_CRMDAT_Pos)) | SPIM_DMMCTL_CREN_Msk; \ - } while (0) - -/** - * @details Get mode bits data for continuous read mode - * \hideinitializer - */ -#define SPIM_GET_DMMCTL_CRMDAT() \ - ((SPIM->DMMCTL & SPIM_DMMCTL_CRMDAT_Msk) >> SPIM_DMMCTL_CRMDAT_Pos) - -/** - * @details Set DMM mode SPI flash deselect time - * \hideinitializer - */ -#define SPIM_DMM_SET_DESELTIM(x) \ - do { \ - SPIM->DMMCTL = (SPIM->DMMCTL & ~SPIM_DMMCTL_DESELTIM_Msk) | (((x) & 0x1FUL) << SPIM_DMMCTL_DESELTIM_Pos); \ - } while (0) - -/** - * @details Get current DMM mode SPI flash deselect time setting - * \hideinitializer - */ -#define SPIM_DMM_GET_DESELTIM() \ - ((SPIM->DMMCTL & SPIM_DMMCTL_DESELTIM_Msk) >> SPIM_DMMCTL_DESELTIM_Pos) - -/** - * @details Enable DMM mode burst wrap mode - * \hideinitializer - */ -#define SPIM_DMM_ENABLE_BWEN() (SPIM->DMMCTL |= SPIM_DMMCTL_BWEN_Msk) - -/** - * @details Disable DMM mode burst wrap mode - * \hideinitializer - */ -#define SPIM_DMM_DISABLE_BWEN() (SPIM->DMMCTL &= ~SPIM_DMMCTL_BWEN_Msk) - -/** - * @details Enable DMM mode continuous read mode - * \hideinitializer - */ -#define SPIM_DMM_ENABLE_CREN() (SPIM->DMMCTL |= SPIM_DMMCTL_CREN_Msk) - -/** - * @details Disable DMM mode continuous read mode - * \hideinitializer - */ -#define SPIM_DMM_DISABLE_CREN() (SPIM->DMMCTL &= ~SPIM_DMMCTL_CREN_Msk) - -/** - * @details Set DMM mode SPI flash active SCLK time - * \hideinitializer - */ -#define SPIM_DMM_SET_ACTSCLKT(x) \ - do { \ - SPIM->DMMCTL = (SPIM->DMMCTL & ~SPIM_DMMCTL_ACTSCLKT_Msk) | (((x) & 0xFUL) << SPIM_DMMCTL_ACTSCLKT_Pos) | SPIM_DMMCTL_UACTSCLK_Msk; \ - } while (0) - -/** - * @details Set SPI flash active SCLK time as SPIM default - * \hideinitializer - */ -#define SPIM_DMM_SET_DEFAULT_ACTSCLK() (SPIM->DMMCTL &= ~SPIM_DMMCTL_UACTSCLK_Msk) - -/** - * @details Set dummy cycle number (Only for DMM mode and DMA mode) - * \hideinitializer - */ -#define SPIM_SET_DCNUM(x) \ - do { \ - SPIM->CTL2 = (SPIM->CTL2 & ~SPIM_CTL2_DCNUM_Msk) | (((x) & 0x1FUL) << SPIM_CTL2_DCNUM_Pos) | SPIM_CTL2_USETEN_Msk; \ - } while (0) - -/** - * @details Set dummy cycle number (Only for DMM mode and DMA mode) as SPIM default - * \hideinitializer - */ -#define SPIM_SET_DEFAULT_DCNUM(x) (SPIM->CTL2 &= ~SPIM_CTL2_USETEN_Msk) - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Function Prototypes */ -/*---------------------------------------------------------------------------------------------------------*/ - - -int SPIM_InitFlash(int clrWP); -uint32_t SPIM_GetSClkFreq(void); -void SPIM_ReadJedecId(uint8_t idBuf[], uint32_t u32NRx, uint32_t u32NBit); -int SPIM_Enable_4Bytes_Mode(int isEn, uint32_t u32NBit); -int SPIM_Is4ByteModeEnable(uint32_t u32NBit); - -void SPIM_ChipErase(uint32_t u32NBit, int isSync); -void SPIM_EraseBlock(uint32_t u32Addr, int is4ByteAddr, uint8_t u8ErsCmd, uint32_t u32NBit, int isSync); - -void SPIM_IO_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat); -void SPIM_IO_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint8_t rdCmd, uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int u32NDummy); - -void SPIM_DMA_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint32_t wrCmd); -void SPIM_DMA_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint32_t u32RdCmd, int isSync); - -void SPIM_EnterDirectMapMode(int is4ByteAddr, uint32_t u32RdCmd, uint32_t u32IdleIntvl); -void SPIM_ExitDirectMapMode(void); - -void SPIM_SetQuadEnable(int isEn, uint32_t u32NBit); - -void SPIM_WinbondUnlock(uint32_t u32NBit); - -/*@}*/ /* end of group SPIM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPIM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SPIM_H__ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sys.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sys.h deleted file mode 100644 index a5f62b2a006..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_sys.h +++ /dev/null @@ -1,7092 +0,0 @@ -/**************************************************************************//** - * @file SYS.h - * @version V3.0 - * @brief M460 Series SYS Driver Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ - -#ifndef __NU_SYS_H__ -#define __NU_SYS_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - -/** @addtogroup SYS_EXPORTED_CONSTANTS SYS Exported Constants - @{ -*/ - -#define SYS_TIMEOUT_ERR (-1L) /*!< SYS operation abort due to timeout error \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Module Reset Control Resister constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA0_RST ((0UL<<24) | SYS_IPRST0_PDMA0RST_Pos) /*!< Reset PDMA0 \hideinitializer*/ -#define EBI_RST ((0UL<<24) | SYS_IPRST0_EBIRST_Pos) /*!< Reset EBI \hideinitializer*/ -#define EMAC0_RST ((0UL<<24) | SYS_IPRST0_EMAC0RST_Pos) /*!< Reset EMAC0 \hideinitializer */ -#define SDH0_RST ((0UL<<24) | SYS_IPRST0_SDH0RST_Pos) /*!< Reset SDH0 \hideinitializer */ -#define CRC_RST ((0UL<<24) | SYS_IPRST0_CRCRST_Pos) /*!< Reset CRC \hideinitializer */ -#define CCAP_RST ((0UL<<24) | SYS_IPRST0_CCAPRST_Pos) /*!< Reset CCAP \hideinitializer */ -#define HSUSBD_RST ((0UL<<24) | SYS_IPRST0_HSUSBDRST_Pos) /*!< Reset HSUSBD \hideinitializer */ -#define HBI_RST ((0UL<<24) | SYS_IPRST0_HBIRST_Pos) /*!< Reset HBI \hideinitializer */ -#define CRPT_RST ((0UL<<24) | SYS_IPRST0_CRPTRST_Pos) /*!< Reset CRPT \hideinitializer */ -#define KS_RST ((0UL<<24) | SYS_IPRST0_KSRST_Pos) /*!< Reset KS \hideinitializer */ -#define SPIM_RST ((0UL<<24) | SYS_IPRST0_SPIMRST_Pos) /*!< Reset SPIM \hideinitializer */ -#define HSUSBH_RST ((0UL<<24) | SYS_IPRST0_HSUSBHRST_Pos) /*!< Reset HSUSBH \hideinitializer */ -#define SDH1_RST ((0UL<<24) | SYS_IPRST0_SDH1RST_Pos) /*!< Reset SDH1 \hideinitializer */ -#define PDMA1_RST ((0UL<<24) | SYS_IPRST0_PDMA1RST_Pos) /*!< Reset PDMA1 \hideinitializer */ -#define CANFD0_RST ((0UL<<24) | SYS_IPRST0_CANFD0RST_Pos) /*!< Reset CANFD0 \hideinitializer */ -#define CANFD1_RST ((0UL<<24) | SYS_IPRST0_CANFD1RST_Pos) /*!< Reset CANFD1 \hideinitializer */ -#define CANFD2_RST ((0UL<<24) | SYS_IPRST0_CANFD2RST_Pos) /*!< Reset CANFD2 \hideinitializer */ -#define CANFD3_RST ((0UL<<24) | SYS_IPRST0_CANFD3RST_Pos) /*!< Reset CANFD3 \hideinitializer */ - -#define GPIO_RST ((4UL<<24) | SYS_IPRST1_GPIORST_Pos) /*!< Reset GPIO \hideinitializer */ -#define TMR0_RST ((4UL<<24) | SYS_IPRST1_TMR0RST_Pos) /*!< Reset TMR0 \hideinitializer */ -#define TMR1_RST ((4UL<<24) | SYS_IPRST1_TMR1RST_Pos) /*!< Reset TMR1 \hideinitializer */ -#define TMR2_RST ((4UL<<24) | SYS_IPRST1_TMR2RST_Pos) /*!< Reset TMR2 \hideinitializer */ -#define TMR3_RST ((4UL<<24) | SYS_IPRST1_TMR3RST_Pos) /*!< Reset TMR3 \hideinitializer */ -#define ACMP01_RST ((4UL<<24) | SYS_IPRST1_ACMP01RST_Pos) /*!< Reset ACMP01 \hideinitializer */ -#define I2C0_RST ((4UL<<24) | SYS_IPRST1_I2C0RST_Pos) /*!< Reset I2C0 \hideinitializer */ -#define I2C1_RST ((4UL<<24) | SYS_IPRST1_I2C1RST_Pos) /*!< Reset I2C1 \hideinitializer */ -#define I2C2_RST ((4UL<<24) | SYS_IPRST1_I2C2RST_Pos) /*!< Reset I2C2 \hideinitializer */ -#define I2C3_RST ((4UL<<24) | SYS_IPRST1_I2C3RST_Pos) /*!< Reset I2C3 \hideinitializer */ -#define QSPI0_RST ((4UL<<24) | SYS_IPRST1_QSPI0RST_Pos) /*!< Reset QSPI0 \hideinitializer */ -#define SPI0_RST ((4UL<<24) | SYS_IPRST1_SPI0RST_Pos) /*!< Reset SPI0 \hideinitializer */ -#define SPI1_RST ((4UL<<24) | SYS_IPRST1_SPI1RST_Pos) /*!< Reset SPI1 \hideinitializer */ -#define SPI2_RST ((4UL<<24) | SYS_IPRST1_SPI2RST_Pos) /*!< Reset SPI2 \hideinitializer */ -#define UART0_RST ((4UL<<24) | SYS_IPRST1_UART0RST_Pos) /*!< Reset UART0 \hideinitializer */ -#define UART1_RST ((4UL<<24) | SYS_IPRST1_UART1RST_Pos) /*!< Reset UART1 \hideinitializer */ -#define UART2_RST ((4UL<<24) | SYS_IPRST1_UART2RST_Pos) /*!< Reset UART2 \hideinitializer */ -#define UART3_RST ((4UL<<24) | SYS_IPRST1_UART3RST_Pos) /*!< Reset UART3 \hideinitializer */ -#define UART4_RST ((4UL<<24) | SYS_IPRST1_UART4RST_Pos) /*!< Reset UART4 \hideinitializer */ -#define UART5_RST ((4UL<<24) | SYS_IPRST1_UART5RST_Pos) /*!< Reset UART5 \hideinitializer */ -#define UART6_RST ((4UL<<24) | SYS_IPRST1_UART6RST_Pos) /*!< Reset UART6 \hideinitializer */ -#define UART7_RST ((4UL<<24) | SYS_IPRST1_UART7RST_Pos) /*!< Reset UART7 \hideinitializer */ -#define OTG_RST ((4UL<<24) | SYS_IPRST1_OTGRST_Pos) /*!< Reset OTG \hideinitializer */ -#define USBD_RST ((4UL<<24) | SYS_IPRST1_USBDRST_Pos) /*!< Reset USBD \hideinitializer */ -#define EADC0_RST ((4UL<<24) | SYS_IPRST1_EADC0RST_Pos) /*!< Reset EADC0 \hideinitializer */ -#define I2S0_RST ((4UL<<24) | SYS_IPRST1_I2S0RST_Pos) /*!< Reset I2S0 \hideinitializer */ -#define HSOTG_RST ((4UL<<24) | SYS_IPRST1_HSOTGRST_Pos) /*!< Reset HSOTG \hideinitializer */ -#define TRNG_RST ((4UL<<24) | SYS_IPRST1_TRNGRST_Pos) /*!< Reset TRNG \hideinitializer */ - -#define SC0_RST ((8UL<<24) | SYS_IPRST2_SC0RST_Pos) /*!< Reset SC0 \hideinitializer */ -#define SC1_RST ((8UL<<24) | SYS_IPRST2_SC1RST_Pos) /*!< Reset SC1 \hideinitializer */ -#define SC2_RST ((8UL<<24) | SYS_IPRST2_SC2RST_Pos) /*!< Reset SC2 \hideinitializer */ -#define I2C4_RST ((8UL<<24) | SYS_IPRST2_I2C4RST_Pos) /*!< Reset I2C4 \hideinitializer */ -#define QSPI1_RST ((8UL<<24) | SYS_IPRST2_QSPI1RST_Pos) /*!< Reset QSPI1 \hideinitializer */ -#define SPI3_RST ((8UL<<24) | SYS_IPRST2_SPI3RST_Pos) /*!< Reset SPI3 \hideinitializer */ -#define SPI4_RST ((8UL<<24) | SYS_IPRST2_SPI4RST_Pos) /*!< Reset SPI4 \hideinitializer */ -#define USCI0_RST ((8UL<<24) | SYS_IPRST2_USCI0RST_Pos) /*!< Reset USCI0 \hideinitializer */ -#define PSIO_RST ((8UL<<24) | SYS_IPRST2_PSIORST_Pos) /*!< Reset PSIO \hideinitializer */ -#define DAC_RST ((8UL<<24) | SYS_IPRST2_DACRST_Pos) /*!< Reset DAC \hideinitializer */ -#define EPWM0_RST ((8UL<<24) | SYS_IPRST2_EPWM0RST_Pos) /*!< Reset EPWM0 \hideinitializer */ -#define EPWM1_RST ((8UL<<24) | SYS_IPRST2_EPWM1RST_Pos) /*!< Reset EPWM1 \hideinitializer */ -#define BPWM0_RST ((8UL<<24) | SYS_IPRST2_BPWM0RST_Pos) /*!< Reset BPWM0 \hideinitializer */ -#define BPWM1_RST ((8UL<<24) | SYS_IPRST2_BPWM1RST_Pos) /*!< Reset BPWM1 \hideinitializer */ -#define EQEI0_RST ((8UL<<24) | SYS_IPRST2_EQEI0RST_Pos) /*!< Reset EQEI0 \hideinitializer */ -#define EQEI1_RST ((8UL<<24) | SYS_IPRST2_EQEI1RST_Pos) /*!< Reset EQEI1 \hideinitializer */ -#define EQEI2_RST ((8UL<<24) | SYS_IPRST2_EQEI2RST_Pos) /*!< Reset EQEI2 \hideinitializer */ -#define EQEI3_RST ((8UL<<24) | SYS_IPRST2_EQEI3RST_Pos) /*!< Reset EQEI3 \hideinitializer */ -#define ECAP0_RST ((8UL<<24) | SYS_IPRST2_ECAP0RST_Pos) /*!< Reset ECAP0 \hideinitializer */ -#define ECAP1_RST ((8UL<<24) | SYS_IPRST2_ECAP1RST_Pos) /*!< Reset ECAP1 \hideinitializer */ -#define ECAP2_RST ((8UL<<24) | SYS_IPRST2_ECAP2RST_Pos) /*!< Reset ECAP2 \hideinitializer */ -#define ECAP3_RST ((8UL<<24) | SYS_IPRST2_ECAP3RST_Pos) /*!< Reset ECAP3 \hideinitializer */ -#define I2S1_RST ((8UL<<24) | SYS_IPRST2_I2S1RST_Pos) /*!< Reset I2S1 \hideinitializer */ -#define EADC1_RST ((8UL<<24) | SYS_IPRST2_EADC1RST_Pos) /*!< Reset EADC1 \hideinitializer */ - -#define KPI_RST ((0x18UL<<24) | SYS_IPRST3_KPIRST_Pos) /*!< Reset KPI \hideinitializer */ -#define EADC2_RST ((0x18UL<<24) | SYS_IPRST3_EADC2RST_Pos) /*!< Reset EADC2 \hideinitializer */ -#define ACMP23_RST ((0x18UL<<24) | SYS_IPRST3_ACMP23RST_Pos) /*!< Reset ACMP23 \hideinitializer */ -#define SPI5_RST ((0x18UL<<24) | SYS_IPRST3_SPI5RST_Pos) /*!< Reset SPI5 \hideinitializer */ -#define SPI6_RST ((0x18UL<<24) | SYS_IPRST3_SPI6RST_Pos) /*!< Reset SPI6 \hideinitializer */ -#define SPI7_RST ((0x18UL<<24) | SYS_IPRST3_SPI7RST_Pos) /*!< Reset SPI7 \hideinitializer */ -#define SPI8_RST ((0x18UL<<24) | SYS_IPRST3_SPI8RST_Pos) /*!< Reset SPI8 \hideinitializer */ -#define SPI9_RST ((0x18UL<<24) | SYS_IPRST3_SPI9RST_Pos) /*!< Reset SPI9 \hideinitializer */ -#define SPI10_RST ((0x18UL<<24) | SYS_IPRST3_SPI10RST_Pos) /*!< Reset SPI10 \hideinitializer */ -#define UART8_RST ((0x18UL<<24) | SYS_IPRST3_UART8RST_Pos) /*!< Reset UART8 \hideinitializer */ -#define UART9_RST ((0x18UL<<24) | SYS_IPRST3_UART9RST_Pos) /*!< Reset UART9 \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brown Out Detector Threshold Voltage Selection constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_BODCTL_BOD_RST_EN (1UL << SYS_BODCTL_BODRSTEN_Pos) /*!< Brown-out Reset Enable \hideinitializer */ -#define SYS_BODCTL_BOD_INTERRUPT_EN (0UL << SYS_BODCTL_BODRSTEN_Pos) /*!< Brown-out Interrupt Enable \hideinitializer */ -#define SYS_BODCTL_BODVL_3_0V (7UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 3.0V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_8V (6UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.8V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_6V (5UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.6V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_4V (4UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.4V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_2V (3UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.2V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_0V (2UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.0V \hideinitializer */ -#define SYS_BODCTL_BODVL_1_8V (1UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 1.8V \hideinitializer */ -#define SYS_BODCTL_BODVL_1_6V (0UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 1.6V \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* VREFCTL constant definitions. (Write-Protection Register) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_VREFCTL_VREF_PIN (0x0UL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = Vref pin \hideinitializer */ -#define SYS_VREFCTL_VREF_1_6V (0x3UL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 1.6V \hideinitializer */ -#define SYS_VREFCTL_VREF_2_0V (0x7UL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 2.0V \hideinitializer */ -#define SYS_VREFCTL_VREF_2_5V (0xBUL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 2.5V \hideinitializer */ -#define SYS_VREFCTL_VREF_3_0V (0xFUL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 3.0V \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* USBPHY constant definitions. (Write-Protection Register) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_USBPHY_USBROLE_STD_USBD (0x0UL << SYS_USBPHY_USBROLE_Pos) /*!< Standard USB device \hideinitializer */ -#define SYS_USBPHY_USBROLE_STD_USBH (0x1UL << SYS_USBPHY_USBROLE_Pos) /*!< Standard USB host \hideinitializer */ -#define SYS_USBPHY_USBROLE_ID_DEPH (0x2UL << SYS_USBPHY_USBROLE_Pos) /*!< ID dependent device \hideinitializer */ -#define SYS_USBPHY_USBROLE_ON_THE_GO (0x3UL << SYS_USBPHY_USBROLE_Pos) /*!< On-The-Go device \hideinitializer */ -#define SYS_USBPHY_HSUSBROLE_STD_USBD (0x0UL << SYS_USBPHY_HSUSBROLE_Pos) /*!< Standard HSUSB device \hideinitializer */ -#define SYS_USBPHY_HSUSBROLE_STD_USBH (0x1UL << SYS_USBPHY_HSUSBROLE_Pos) /*!< Standard HSUSB host \hideinitializer */ -#define SYS_USBPHY_HSUSBROLE_ID_DEPH (0x2UL << SYS_USBPHY_HSUSBROLE_Pos) /*!< ID dependent device \hideinitializer */ -#define SYS_USBPHY_HSUSBROLE_ON_THE_GO (0x3UL << SYS_USBPHY_HSUSBROLE_Pos) /*!< On-The-Go device \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* PLCTL constant definitions. (Write-Protection Register) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_PLCTL_PLSEL_PL0 (0x0UL<GPA_MFP0 = (SYS->GPA_MFP0 & (~SYS_GPA_MFP0_PA0MFP_Msk) ) | SYS_GPA_MFP0_PA0_MFP_SC0_CLK; -*/ - - -/* PA.0 MFP */ -#define SYS_GPA_MFP0_PA0MFP_GPIO (0x00UL<GPB_MFP0 = (SYS->GPB_MFP0 & (~ACMP0_N_PB3_Msk)) | ACMP0_N_PB3 /*!< Set PB3 function to ACMP0_N */ -#define SET_ACMP0_O_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~ACMP0_O_PB7_Msk)) | ACMP0_O_PB7 /*!< Set PB7 function to ACMP0_O */ -#define SET_ACMP0_O_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~ACMP0_O_PC1_Msk)) | ACMP0_O_PC1 /*!< Set PC1 function to ACMP0_O */ -#define SET_ACMP0_O_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~ACMP0_O_PC12_Msk)) | ACMP0_O_PC12 /*!< Set PC12 function to ACMP0_O */ -#define SET_ACMP0_O_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~ACMP0_O_PD6_Msk)) | ACMP0_O_PD6 /*!< Set PD6 function to ACMP0_O */ -#define SET_ACMP0_O_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~ACMP0_O_PF0_Msk)) | ACMP0_O_PF0 /*!< Set PF0 function to ACMP0_O */ -#define SET_ACMP0_P0_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~ACMP0_P0_PA11_Msk)) | ACMP0_P0_PA11 /*!< Set PA11 function to ACMP0_P0 */ -#define SET_ACMP0_P1_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~ACMP0_P1_PB2_Msk)) | ACMP0_P1_PB2 /*!< Set PB2 function to ACMP0_P1 */ -#define SET_ACMP0_P2_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ACMP0_P2_PB12_Msk)) | ACMP0_P2_PB12 /*!< Set PB12 function to ACMP0_P2 */ -#define SET_ACMP0_P3_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ACMP0_P3_PB13_Msk)) | ACMP0_P3_PB13 /*!< Set PB13 function to ACMP0_P3 */ -#define SET_ACMP0_WLAT_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~ACMP0_WLAT_PA7_Msk)) | ACMP0_WLAT_PA7 /*!< Set PA7 function to ACMP0_WLAT */ -#define SET_ACMP1_N_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~ACMP1_N_PB5_Msk)) | ACMP1_N_PB5 /*!< Set PB5 function to ACMP1_N */ -#define SET_ACMP1_O_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~ACMP1_O_PC0_Msk)) | ACMP1_O_PC0 /*!< Set PC0 function to ACMP1_O */ -#define SET_ACMP1_O_PD5() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~ACMP1_O_PD5_Msk)) | ACMP1_O_PD5 /*!< Set PD5 function to ACMP1_O */ -#define SET_ACMP1_O_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~ACMP1_O_PB6_Msk)) | ACMP1_O_PB6 /*!< Set PB6 function to ACMP1_O */ -#define SET_ACMP1_O_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~ACMP1_O_PC11_Msk)) | ACMP1_O_PC11 /*!< Set PC11 function to ACMP1_O */ -#define SET_ACMP1_O_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~ACMP1_O_PF1_Msk)) | ACMP1_O_PF1 /*!< Set PF1 function to ACMP1_O */ -#define SET_ACMP1_P0_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~ACMP1_P0_PA10_Msk)) | ACMP1_P0_PA10 /*!< Set PA10 function to ACMP1_P0 */ -#define SET_ACMP1_P1_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~ACMP1_P1_PB4_Msk)) | ACMP1_P1_PB4 /*!< Set PB4 function to ACMP1_P1 */ -#define SET_ACMP1_P2_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ACMP1_P2_PB12_Msk)) | ACMP1_P2_PB12 /*!< Set PB12 function to ACMP1_P2 */ -#define SET_ACMP1_P3_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ACMP1_P3_PB13_Msk)) | ACMP1_P3_PB13 /*!< Set PB13 function to ACMP1_P3 */ -#define SET_ACMP1_WLAT_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~ACMP1_WLAT_PA6_Msk)) | ACMP1_WLAT_PA6 /*!< Set PA6 function to ACMP1_WLAT */ -#define SET_ACMP2_N_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~ACMP2_N_PB6_Msk)) | ACMP2_N_PB6 /*!< Set PB6 function to ACMP2_N */ -#define SET_ACMP2_O_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~ACMP2_O_PB1_Msk)) | ACMP2_O_PB1 /*!< Set PB1 function to ACMP2_O */ -#define SET_ACMP2_O_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~ACMP2_O_PE7_Msk)) | ACMP2_O_PE7 /*!< Set PE7 function to ACMP2_O */ -#define SET_ACMP2_O_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~ACMP2_O_PF3_Msk)) | ACMP2_O_PF3 /*!< Set PF3 function to ACMP2_O */ -#define SET_ACMP2_P0_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~ACMP2_P0_PB7_Msk)) | ACMP2_P0_PB7 /*!< Set PB7 function to ACMP2_P0 */ -#define SET_ACMP2_P1_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~ACMP2_P1_PB8_Msk)) | ACMP2_P1_PB8 /*!< Set PB8 function to ACMP2_P1 */ -#define SET_ACMP2_P2_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~ACMP2_P2_PB9_Msk)) | ACMP2_P2_PB9 /*!< Set PB9 function to ACMP2_P2 */ -#define SET_ACMP2_P3_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~ACMP2_P3_PB10_Msk)) | ACMP2_P3_PB10 /*!< Set PB10 function to ACMP2_P3 */ -#define SET_ACMP2_WLAT_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~ACMP2_WLAT_PC7_Msk)) | ACMP2_WLAT_PC7 /*!< Set PC7 function to ACMP2_WLAT */ -#define SET_ACMP3_N_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~ACMP3_N_PB0_Msk)) | ACMP3_N_PB0 /*!< Set PB0 function to ACMP3_N */ -#define SET_ACMP3_O_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~ACMP3_O_PB0_Msk)) | ACMP3_O_PB0 /*!< Set PB0 function to ACMP3_O */ -#define SET_ACMP3_O_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~ACMP3_O_PF2_Msk)) | ACMP3_O_PF2 /*!< Set PF2 function to ACMP3_O */ -#define SET_ACMP3_O_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~ACMP3_O_PE6_Msk)) | ACMP3_O_PE6 /*!< Set PE6 function to ACMP3_O */ -#define SET_ACMP3_P0_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~ACMP3_P0_PB1_Msk)) | ACMP3_P0_PB1 /*!< Set PB1 function to ACMP3_P0 */ -#define SET_ACMP3_P1_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~ACMP3_P1_PC9_Msk)) | ACMP3_P1_PC9 /*!< Set PC9 function to ACMP3_P1 */ -#define SET_ACMP3_P2_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~ACMP3_P2_PC10_Msk)) | ACMP3_P2_PC10 /*!< Set PC10 function to ACMP3_P2 */ -#define SET_ACMP3_P3_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~ACMP3_P3_PC11_Msk)) | ACMP3_P3_PC11 /*!< Set PC11 function to ACMP3_P3 */ -#define SET_ACMP3_WLAT_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~ACMP3_WLAT_PC6_Msk)) | ACMP3_WLAT_PC6 /*!< Set PC6 function to ACMP3_WLAT */ -#define SET_BMC0_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~BMC0_PB5_Msk)) | BMC0_PB5 /*!< Set PB5 function to BMC0 */ -#define SET_BMC1_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~BMC1_PB4_Msk)) | BMC1_PB4 /*!< Set PB4 function to BMC1 */ -#define SET_BMC10_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~BMC10_PF5_Msk)) | BMC10_PF5 /*!< Set PF5 function to BMC10 */ -#define SET_BMC11_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~BMC11_PF4_Msk)) | BMC11_PF4 /*!< Set PF4 function to BMC11 */ -#define SET_BMC12_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BMC12_PA12_Msk)) | BMC12_PA12 /*!< Set PA12 function to BMC12 */ -#define SET_BMC12_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~BMC12_PF3_Msk)) | BMC12_PF3 /*!< Set PF3 function to BMC12 */ -#define SET_BMC13_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~BMC13_PF2_Msk)) | BMC13_PF2 /*!< Set PF2 function to BMC13 */ -#define SET_BMC13_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BMC13_PA13_Msk)) | BMC13_PA13 /*!< Set PA13 function to BMC13 */ -#define SET_BMC14_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~BMC14_PA7_Msk)) | BMC14_PA7 /*!< Set PA7 function to BMC14 */ -#define SET_BMC14_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BMC14_PA14_Msk)) | BMC14_PA14 /*!< Set PA14 function to BMC14 */ -#define SET_BMC15_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~BMC15_PA6_Msk)) | BMC15_PA6 /*!< Set PA6 function to BMC15 */ -#define SET_BMC15_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BMC15_PA15_Msk)) | BMC15_PA15 /*!< Set PA15 function to BMC15 */ -#define SET_BMC16_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BMC16_PA3_Msk)) | BMC16_PA3 /*!< Set PA3 function to BMC16 */ -#define SET_BMC16_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~BMC16_PG9_Msk)) | BMC16_PG9 /*!< Set PG9 function to BMC16 */ -#define SET_BMC17_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BMC17_PA2_Msk)) | BMC17_PA2 /*!< Set PA2 function to BMC17 */ -#define SET_BMC17_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~BMC17_PG10_Msk)) | BMC17_PG10 /*!< Set PG10 function to BMC17 */ -#define SET_BMC18_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BMC18_PA1_Msk)) | BMC18_PA1 /*!< Set PA1 function to BMC18 */ -#define SET_BMC18_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~BMC18_PG11_Msk)) | BMC18_PG11 /*!< Set PG11 function to BMC18 */ -#define SET_BMC19_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BMC19_PA0_Msk)) | BMC19_PA0 /*!< Set PA0 function to BMC19 */ -#define SET_BMC19_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~BMC19_PG12_Msk)) | BMC19_PG12 /*!< Set PG12 function to BMC19 */ -#define SET_BMC2_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~BMC2_PB3_Msk)) | BMC2_PB3 /*!< Set PB3 function to BMC2 */ -#define SET_BMC20_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BMC20_PB11_Msk)) | BMC20_PB11 /*!< Set PB11 function to BMC20 */ -#define SET_BMC20_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~BMC20_PC5_Msk)) | BMC20_PC5 /*!< Set PC5 function to BMC20 */ -#define SET_BMC21_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~BMC21_PC4_Msk)) | BMC21_PC4 /*!< Set PC4 function to BMC21 */ -#define SET_BMC21_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BMC21_PB10_Msk)) | BMC21_PB10 /*!< Set PB10 function to BMC21 */ -#define SET_BMC22_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BMC22_PB9_Msk)) | BMC22_PB9 /*!< Set PB9 function to BMC22 */ -#define SET_BMC22_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~BMC22_PC3_Msk)) | BMC22_PC3 /*!< Set PC3 function to BMC22 */ -#define SET_BMC23_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~BMC23_PC2_Msk)) | BMC23_PC2 /*!< Set PC2 function to BMC23 */ -#define SET_BMC23_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BMC23_PB8_Msk)) | BMC23_PB8 /*!< Set PB8 function to BMC23 */ -#define SET_BMC24_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~BMC24_PC1_Msk)) | BMC24_PC1 /*!< Set PC1 function to BMC24 */ -#define SET_BMC24_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~BMC24_PC7_Msk)) | BMC24_PC7 /*!< Set PC7 function to BMC24 */ -#define SET_BMC25_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~BMC25_PC6_Msk)) | BMC25_PC6 /*!< Set PC6 function to BMC25 */ -#define SET_BMC25_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~BMC25_PC0_Msk)) | BMC25_PC0 /*!< Set PC0 function to BMC25 */ -#define SET_BMC26_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~BMC26_PC14_Msk)) | BMC26_PC14 /*!< Set PC14 function to BMC26 */ -#define SET_BMC27_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~BMC27_PB15_Msk)) | BMC27_PB15 /*!< Set PB15 function to BMC27 */ -#define SET_BMC28_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~BMC28_PB13_Msk)) | BMC28_PB13 /*!< Set PB13 function to BMC28 */ -#define SET_BMC29_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~BMC29_PB12_Msk)) | BMC29_PB12 /*!< Set PB12 function to BMC29 */ -#define SET_BMC3_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~BMC3_PB2_Msk)) | BMC3_PB2 /*!< Set PB2 function to BMC3 */ -#define SET_BMC30_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~BMC30_PB7_Msk)) | BMC30_PB7 /*!< Set PB7 function to BMC30 */ -#define SET_BMC31_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~BMC31_PB6_Msk)) | BMC31_PB6 /*!< Set PB6 function to BMC31 */ -#define SET_BMC4_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~BMC4_PB1_Msk)) | BMC4_PB1 /*!< Set PB1 function to BMC4 */ -#define SET_BMC5_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~BMC5_PB0_Msk)) | BMC5_PB0 /*!< Set PB0 function to BMC5 */ -#define SET_BMC6_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BMC6_PA11_Msk)) | BMC6_PA11 /*!< Set PA11 function to BMC6 */ -#define SET_BMC7_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BMC7_PA10_Msk)) | BMC7_PA10 /*!< Set PA10 function to BMC7 */ -#define SET_BMC8_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BMC8_PA9_Msk)) | BMC8_PA9 /*!< Set PA9 function to BMC8 */ -#define SET_BMC9_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BMC9_PA8_Msk)) | BMC9_PA8 /*!< Set PA8 function to BMC9 */ -#define SET_BPWM0_CH0_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~BPWM0_CH0_PD13_Msk)) | BPWM0_CH0_PD13 /*!< Set PD13 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~BPWM0_CH0_PE2_Msk)) | BPWM0_CH0_PE2 /*!< Set PE2 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BPWM0_CH0_PA0_Msk)) | BPWM0_CH0_PA0 /*!< Set PA0 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BPWM0_CH0_PA11_Msk)) | BPWM0_CH0_PA11 /*!< Set PA11 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PG14() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~BPWM0_CH0_PG14_Msk)) | BPWM0_CH0_PG14 /*!< Set PG14 function to BPWM0_CH0 */ -#define SET_BPWM0_CH0_PJ13() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~BPWM0_CH0_PJ13_Msk)) | BPWM0_CH0_PJ13 /*!< Set PJ13 function to BPWM0_CH0 */ -#define SET_BPWM0_CH1_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~BPWM0_CH1_PE3_Msk)) | BPWM0_CH1_PE3 /*!< Set PE3 function to BPWM0_CH1 */ -#define SET_BPWM0_CH1_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~BPWM0_CH1_PG13_Msk)) | BPWM0_CH1_PG13 /*!< Set PG13 function to BPWM0_CH1 */ -#define SET_BPWM0_CH1_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BPWM0_CH1_PA1_Msk)) | BPWM0_CH1_PA1 /*!< Set PA1 function to BPWM0_CH1 */ -#define SET_BPWM0_CH1_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~BPWM0_CH1_PJ12_Msk)) | BPWM0_CH1_PJ12 /*!< Set PJ12 function to BPWM0_CH1 */ -#define SET_BPWM0_CH1_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BPWM0_CH1_PA10_Msk)) | BPWM0_CH1_PA10 /*!< Set PA10 function to BPWM0_CH1 */ -#define SET_BPWM0_CH2_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BPWM0_CH2_PA9_Msk)) | BPWM0_CH2_PA9 /*!< Set PA9 function to BPWM0_CH2 */ -#define SET_BPWM0_CH2_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BPWM0_CH2_PA2_Msk)) | BPWM0_CH2_PA2 /*!< Set PA2 function to BPWM0_CH2 */ -#define SET_BPWM0_CH2_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~BPWM0_CH2_PJ11_Msk)) | BPWM0_CH2_PJ11 /*!< Set PJ11 function to BPWM0_CH2 */ -#define SET_BPWM0_CH2_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~BPWM0_CH2_PE4_Msk)) | BPWM0_CH2_PE4 /*!< Set PE4 function to BPWM0_CH2 */ -#define SET_BPWM0_CH2_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~BPWM0_CH2_PG12_Msk)) | BPWM0_CH2_PG12 /*!< Set PG12 function to BPWM0_CH2 */ -#define SET_BPWM0_CH3_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~BPWM0_CH3_PE5_Msk)) | BPWM0_CH3_PE5 /*!< Set PE5 function to BPWM0_CH3 */ -#define SET_BPWM0_CH3_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~BPWM0_CH3_PJ10_Msk)) | BPWM0_CH3_PJ10 /*!< Set PJ10 function to BPWM0_CH3 */ -#define SET_BPWM0_CH3_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~BPWM0_CH3_PG11_Msk)) | BPWM0_CH3_PG11 /*!< Set PG11 function to BPWM0_CH3 */ -#define SET_BPWM0_CH3_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~BPWM0_CH3_PA8_Msk)) | BPWM0_CH3_PA8 /*!< Set PA8 function to BPWM0_CH3 */ -#define SET_BPWM0_CH3_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~BPWM0_CH3_PA3_Msk)) | BPWM0_CH3_PA3 /*!< Set PA3 function to BPWM0_CH3 */ -#define SET_BPWM0_CH4_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~BPWM0_CH4_PF5_Msk)) | BPWM0_CH4_PF5 /*!< Set PF5 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PJ9() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~BPWM0_CH4_PJ9_Msk)) | BPWM0_CH4_PJ9 /*!< Set PJ9 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~BPWM0_CH4_PG10_Msk)) | BPWM0_CH4_PG10 /*!< Set PG10 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~BPWM0_CH4_PC13_Msk)) | BPWM0_CH4_PC13 /*!< Set PC13 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~BPWM0_CH4_PA4_Msk)) | BPWM0_CH4_PA4 /*!< Set PA4 function to BPWM0_CH4 */ -#define SET_BPWM0_CH4_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~BPWM0_CH4_PE6_Msk)) | BPWM0_CH4_PE6 /*!< Set PE6 function to BPWM0_CH4 */ -#define SET_BPWM0_CH5_PJ8() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~BPWM0_CH5_PJ8_Msk)) | BPWM0_CH5_PJ8 /*!< Set PJ8 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~BPWM0_CH5_PD12_Msk)) | BPWM0_CH5_PD12 /*!< Set PD12 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~BPWM0_CH5_PA5_Msk)) | BPWM0_CH5_PA5 /*!< Set PA5 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~BPWM0_CH5_PF4_Msk)) | BPWM0_CH5_PF4 /*!< Set PF4 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~BPWM0_CH5_PE7_Msk)) | BPWM0_CH5_PE7 /*!< Set PE7 function to BPWM0_CH5 */ -#define SET_BPWM0_CH5_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~BPWM0_CH5_PG9_Msk)) | BPWM0_CH5_PG9 /*!< Set PG9 function to BPWM0_CH5 */ -#define SET_BPWM1_CH0_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~BPWM1_CH0_PF3_Msk)) | BPWM1_CH0_PF3 /*!< Set PF3 function to BPWM1_CH0 */ -#define SET_BPWM1_CH0_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BPWM1_CH0_PB11_Msk)) | BPWM1_CH0_PB11 /*!< Set PB11 function to BPWM1_CH0 */ -#define SET_BPWM1_CH0_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~BPWM1_CH0_PC7_Msk)) | BPWM1_CH0_PC7 /*!< Set PC7 function to BPWM1_CH0 */ -#define SET_BPWM1_CH0_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~BPWM1_CH0_PF0_Msk)) | BPWM1_CH0_PF0 /*!< Set PF0 function to BPWM1_CH0 */ -#define SET_BPWM1_CH1_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~BPWM1_CH1_PF1_Msk)) | BPWM1_CH1_PF1 /*!< Set PF1 function to BPWM1_CH1 */ -#define SET_BPWM1_CH1_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BPWM1_CH1_PB10_Msk)) | BPWM1_CH1_PB10 /*!< Set PB10 function to BPWM1_CH1 */ -#define SET_BPWM1_CH1_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~BPWM1_CH1_PF2_Msk)) | BPWM1_CH1_PF2 /*!< Set PF2 function to BPWM1_CH1 */ -#define SET_BPWM1_CH1_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~BPWM1_CH1_PC6_Msk)) | BPWM1_CH1_PC6 /*!< Set PC6 function to BPWM1_CH1 */ -#define SET_BPWM1_CH2_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BPWM1_CH2_PB9_Msk)) | BPWM1_CH2_PB9 /*!< Set PB9 function to BPWM1_CH2 */ -#define SET_BPWM1_CH2_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~BPWM1_CH2_PA7_Msk)) | BPWM1_CH2_PA7 /*!< Set PA7 function to BPWM1_CH2 */ -#define SET_BPWM1_CH2_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BPWM1_CH2_PA12_Msk)) | BPWM1_CH2_PA12 /*!< Set PA12 function to BPWM1_CH2 */ -#define SET_BPWM1_CH3_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~BPWM1_CH3_PA6_Msk)) | BPWM1_CH3_PA6 /*!< Set PA6 function to BPWM1_CH3 */ -#define SET_BPWM1_CH3_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~BPWM1_CH3_PB8_Msk)) | BPWM1_CH3_PB8 /*!< Set PB8 function to BPWM1_CH3 */ -#define SET_BPWM1_CH3_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BPWM1_CH3_PA13_Msk)) | BPWM1_CH3_PA13 /*!< Set PA13 function to BPWM1_CH3 */ -#define SET_BPWM1_CH4_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~BPWM1_CH4_PB7_Msk)) | BPWM1_CH4_PB7 /*!< Set PB7 function to BPWM1_CH4 */ -#define SET_BPWM1_CH4_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~BPWM1_CH4_PC8_Msk)) | BPWM1_CH4_PC8 /*!< Set PC8 function to BPWM1_CH4 */ -#define SET_BPWM1_CH4_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BPWM1_CH4_PA14_Msk)) | BPWM1_CH4_PA14 /*!< Set PA14 function to BPWM1_CH4 */ -#define SET_BPWM1_CH5_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~BPWM1_CH5_PB6_Msk)) | BPWM1_CH5_PB6 /*!< Set PB6 function to BPWM1_CH5 */ -#define SET_BPWM1_CH5_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~BPWM1_CH5_PE13_Msk)) | BPWM1_CH5_PE13 /*!< Set PE13 function to BPWM1_CH5 */ -#define SET_BPWM1_CH5_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~BPWM1_CH5_PA15_Msk)) | BPWM1_CH5_PA15 /*!< Set PA15 function to BPWM1_CH5 */ -#define SET_CAN0_RXD_PI13() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~CAN0_RXD_PI13_Msk)) | CAN0_RXD_PI13 /*!< Set PI13 function to CAN0_RXD */ -#define SET_CAN0_RXD_PJ3() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~CAN0_RXD_PJ3_Msk)) | CAN0_RXD_PJ3 /*!< Set PJ3 function to CAN0_RXD */ -#define SET_CAN0_RXD_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~CAN0_RXD_PA4_Msk)) | CAN0_RXD_PA4 /*!< Set PA4 function to CAN0_RXD */ -#define SET_CAN0_RXD_PE15() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~CAN0_RXD_PE15_Msk)) | CAN0_RXD_PE15 /*!< Set PE15 function to CAN0_RXD */ -#define SET_CAN0_RXD_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~CAN0_RXD_PA13_Msk)) | CAN0_RXD_PA13 /*!< Set PA13 function to CAN0_RXD */ -#define SET_CAN0_RXD_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~CAN0_RXD_PJ11_Msk)) | CAN0_RXD_PJ11 /*!< Set PJ11 function to CAN0_RXD */ -#define SET_CAN0_RXD_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~CAN0_RXD_PC4_Msk)) | CAN0_RXD_PC4 /*!< Set PC4 function to CAN0_RXD */ -#define SET_CAN0_RXD_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~CAN0_RXD_PB10_Msk)) | CAN0_RXD_PB10 /*!< Set PB10 function to CAN0_RXD */ -#define SET_CAN0_RXD_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~CAN0_RXD_PD10_Msk)) | CAN0_RXD_PD10 /*!< Set PD10 function to CAN0_RXD */ -#define SET_CAN0_TXD_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~CAN0_TXD_PC5_Msk)) | CAN0_TXD_PC5 /*!< Set PC5 function to CAN0_TXD */ -#define SET_CAN0_TXD_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~CAN0_TXD_PB11_Msk)) | CAN0_TXD_PB11 /*!< Set PB11 function to CAN0_TXD */ -#define SET_CAN0_TXD_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~CAN0_TXD_PA5_Msk)) | CAN0_TXD_PA5 /*!< Set PA5 function to CAN0_TXD */ -#define SET_CAN0_TXD_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~CAN0_TXD_PJ10_Msk)) | CAN0_TXD_PJ10 /*!< Set PJ10 function to CAN0_TXD */ -#define SET_CAN0_TXD_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~CAN0_TXD_PD11_Msk)) | CAN0_TXD_PD11 /*!< Set PD11 function to CAN0_TXD */ -#define SET_CAN0_TXD_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~CAN0_TXD_PA12_Msk)) | CAN0_TXD_PA12 /*!< Set PA12 function to CAN0_TXD */ -#define SET_CAN0_TXD_PI12() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~CAN0_TXD_PI12_Msk)) | CAN0_TXD_PI12 /*!< Set PI12 function to CAN0_TXD */ -#define SET_CAN0_TXD_PE14() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~CAN0_TXD_PE14_Msk)) | CAN0_TXD_PE14 /*!< Set PE14 function to CAN0_TXD */ -#define SET_CAN0_TXD_PJ2() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~CAN0_TXD_PJ2_Msk)) | CAN0_TXD_PJ2 /*!< Set PJ2 function to CAN0_TXD */ -#define SET_CAN1_RXD_PJ5() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CAN1_RXD_PJ5_Msk)) | CAN1_RXD_PJ5 /*!< Set PJ5 function to CAN1_RXD */ -#define SET_CAN1_RXD_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~CAN1_RXD_PC9_Msk)) | CAN1_RXD_PC9 /*!< Set PC9 function to CAN1_RXD */ -#define SET_CAN1_RXD_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~CAN1_RXD_PD12_Msk)) | CAN1_RXD_PD12 /*!< Set PD12 function to CAN1_RXD */ -#define SET_CAN1_RXD_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CAN1_RXD_PF8_Msk)) | CAN1_RXD_PF8 /*!< Set PF8 function to CAN1_RXD */ -#define SET_CAN1_RXD_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~CAN1_RXD_PG1_Msk)) | CAN1_RXD_PG1 /*!< Set PG1 function to CAN1_RXD */ -#define SET_CAN1_RXD_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~CAN1_RXD_PB6_Msk)) | CAN1_RXD_PB6 /*!< Set PB6 function to CAN1_RXD */ -#define SET_CAN1_RXD_PI15() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~CAN1_RXD_PI15_Msk)) | CAN1_RXD_PI15 /*!< Set PI15 function to CAN1_RXD */ -#define SET_CAN1_RXD_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CAN1_RXD_PC2_Msk)) | CAN1_RXD_PC2 /*!< Set PC2 function to CAN1_RXD */ -#define SET_CAN1_RXD_PJ13() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~CAN1_RXD_PJ13_Msk)) | CAN1_RXD_PJ13 /*!< Set PJ13 function to CAN1_RXD */ -#define SET_CAN1_RXD_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~CAN1_RXD_PE6_Msk)) | CAN1_RXD_PE6 /*!< Set PE6 function to CAN1_RXD */ -#define SET_CAN1_TXD_PG0() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~CAN1_TXD_PG0_Msk)) | CAN1_TXD_PG0 /*!< Set PG0 function to CAN1_TXD */ -#define SET_CAN1_TXD_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~CAN1_TXD_PB7_Msk)) | CAN1_TXD_PB7 /*!< Set PB7 function to CAN1_TXD */ -#define SET_CAN1_TXD_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CAN1_TXD_PC3_Msk)) | CAN1_TXD_PC3 /*!< Set PC3 function to CAN1_TXD */ -#define SET_CAN1_TXD_PI14() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~CAN1_TXD_PI14_Msk)) | CAN1_TXD_PI14 /*!< Set PI14 function to CAN1_TXD */ -#define SET_CAN1_TXD_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~CAN1_TXD_PC10_Msk)) | CAN1_TXD_PC10 /*!< Set PC10 function to CAN1_TXD */ -#define SET_CAN1_TXD_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~CAN1_TXD_PE7_Msk)) | CAN1_TXD_PE7 /*!< Set PE7 function to CAN1_TXD */ -#define SET_CAN1_TXD_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~CAN1_TXD_PJ12_Msk)) | CAN1_TXD_PJ12 /*!< Set PJ12 function to CAN1_TXD */ -#define SET_CAN1_TXD_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~CAN1_TXD_PC13_Msk)) | CAN1_TXD_PC13 /*!< Set PC13 function to CAN1_TXD */ -#define SET_CAN1_TXD_PJ4() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CAN1_TXD_PJ4_Msk)) | CAN1_TXD_PJ4 /*!< Set PJ4 function to CAN1_TXD */ -#define SET_CAN1_TXD_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CAN1_TXD_PF9_Msk)) | CAN1_TXD_PF9 /*!< Set PF9 function to CAN1_TXD */ -#define SET_CAN2_RXD_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~CAN2_RXD_PF1_Msk)) | CAN2_RXD_PF1 /*!< Set PF1 function to CAN2_RXD */ -#define SET_CAN2_RXD_PJ1() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~CAN2_RXD_PJ1_Msk)) | CAN2_RXD_PJ1 /*!< Set PJ1 function to CAN2_RXD */ -#define SET_CAN2_RXD_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~CAN2_RXD_PF6_Msk)) | CAN2_RXD_PF6 /*!< Set PF6 function to CAN2_RXD */ -#define SET_CAN2_RXD_PI9() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~CAN2_RXD_PI9_Msk)) | CAN2_RXD_PI9 /*!< Set PI9 function to CAN2_RXD */ -#define SET_CAN2_RXD_PD8() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~CAN2_RXD_PD8_Msk)) | CAN2_RXD_PD8 /*!< Set PD8 function to CAN2_RXD */ -#define SET_CAN2_RXD_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~CAN2_RXD_PB8_Msk)) | CAN2_RXD_PB8 /*!< Set PB8 function to CAN2_RXD */ -#define SET_CAN2_RXD_PJ7() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CAN2_RXD_PJ7_Msk)) | CAN2_RXD_PJ7 /*!< Set PJ7 function to CAN2_RXD */ -#define SET_CAN2_RXD_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CAN2_RXD_PC0_Msk)) | CAN2_RXD_PC0 /*!< Set PC0 function to CAN2_RXD */ -#define SET_CAN2_RXD_PJ9() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~CAN2_RXD_PJ9_Msk)) | CAN2_RXD_PJ9 /*!< Set PJ9 function to CAN2_RXD */ -#define SET_CAN2_TXD_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~CAN2_TXD_PB9_Msk)) | CAN2_TXD_PB9 /*!< Set PB9 function to CAN2_TXD */ -#define SET_CAN2_TXD_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CAN2_TXD_PC1_Msk)) | CAN2_TXD_PC1 /*!< Set PC1 function to CAN2_TXD */ -#define SET_CAN2_TXD_PD9() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~CAN2_TXD_PD9_Msk)) | CAN2_TXD_PD9 /*!< Set PD9 function to CAN2_TXD */ -#define SET_CAN2_TXD_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~CAN2_TXD_PF0_Msk)) | CAN2_TXD_PF0 /*!< Set PF0 function to CAN2_TXD */ -#define SET_CAN2_TXD_PJ6() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CAN2_TXD_PJ6_Msk)) | CAN2_TXD_PJ6 /*!< Set PJ6 function to CAN2_TXD */ -#define SET_CAN2_TXD_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~CAN2_TXD_PF7_Msk)) | CAN2_TXD_PF7 /*!< Set PF7 function to CAN2_TXD */ -#define SET_CAN2_TXD_PJ8() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~CAN2_TXD_PJ8_Msk)) | CAN2_TXD_PJ8 /*!< Set PJ8 function to CAN2_TXD */ -#define SET_CAN2_TXD_PJ0() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~CAN2_TXD_PJ0_Msk)) | CAN2_TXD_PJ0 /*!< Set PJ0 function to CAN2_TXD */ -#define SET_CAN2_TXD_PI8() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~CAN2_TXD_PI8_Msk)) | CAN2_TXD_PI8 /*!< Set PI8 function to CAN2_TXD */ -#define SET_CAN3_RXD_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~CAN3_RXD_PC6_Msk)) | CAN3_RXD_PC6 /*!< Set PC6 function to CAN3_RXD */ -#define SET_CAN3_RXD_PH13() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~CAN3_RXD_PH13_Msk)) | CAN3_RXD_PH13 /*!< Set PH13 function to CAN3_RXD */ -#define SET_CAN3_RXD_PI7() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~CAN3_RXD_PI7_Msk)) | CAN3_RXD_PI7 /*!< Set PI7 function to CAN3_RXD */ -#define SET_CAN3_RXD_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CAN3_RXD_PF10_Msk)) | CAN3_RXD_PF10 /*!< Set PF10 function to CAN3_RXD */ -#define SET_CAN3_RXD_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~CAN3_RXD_PB12_Msk)) | CAN3_RXD_PB12 /*!< Set PB12 function to CAN3_RXD */ -#define SET_CAN3_RXD_PI11() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~CAN3_RXD_PI11_Msk)) | CAN3_RXD_PI11 /*!< Set PI11 function to CAN3_RXD */ -#define SET_CAN3_TXD_PI6() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~CAN3_TXD_PI6_Msk)) | CAN3_TXD_PI6 /*!< Set PI6 function to CAN3_TXD */ -#define SET_CAN3_TXD_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~CAN3_TXD_PC7_Msk)) | CAN3_TXD_PC7 /*!< Set PC7 function to CAN3_TXD */ -#define SET_CAN3_TXD_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~CAN3_TXD_PB13_Msk)) | CAN3_TXD_PB13 /*!< Set PB13 function to CAN3_TXD */ -#define SET_CAN3_TXD_PH12() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~CAN3_TXD_PH12_Msk)) | CAN3_TXD_PH12 /*!< Set PH12 function to CAN3_TXD */ -#define SET_CAN3_TXD_PI10() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~CAN3_TXD_PI10_Msk)) | CAN3_TXD_PI10 /*!< Set PI10 function to CAN3_TXD */ -#define SET_CAN3_TXD_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CAN3_TXD_PF11_Msk)) | CAN3_TXD_PF11 /*!< Set PF11 function to CAN3_TXD */ -#define SET_CCAP_DATA0_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~CCAP_DATA0_PB14_Msk)) | CCAP_DATA0_PB14 /*!< Set PB14 function to CCAP_DATA0 */ -#define SET_CCAP_DATA0_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CCAP_DATA0_PC0_Msk)) | CCAP_DATA0_PC0 /*!< Set PC0 function to CCAP_DATA0 */ -#define SET_CCAP_DATA0_PJ7() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CCAP_DATA0_PJ7_Msk)) | CCAP_DATA0_PJ7 /*!< Set PJ7 function to CCAP_DATA0 */ -#define SET_CCAP_DATA0_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~CCAP_DATA0_PF7_Msk)) | CCAP_DATA0_PF7 /*!< Set PF7 function to CCAP_DATA0 */ -#define SET_CCAP_DATA1_PJ6() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CCAP_DATA1_PJ6_Msk)) | CCAP_DATA1_PJ6 /*!< Set PJ6 function to CCAP_DATA1 */ -#define SET_CCAP_DATA1_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~CCAP_DATA1_PB15_Msk)) | CCAP_DATA1_PB15 /*!< Set PB15 function to CCAP_DATA1 */ -#define SET_CCAP_DATA1_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CCAP_DATA1_PC1_Msk)) | CCAP_DATA1_PC1 /*!< Set PC1 function to CCAP_DATA1 */ -#define SET_CCAP_DATA1_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CCAP_DATA1_PF8_Msk)) | CCAP_DATA1_PF8 /*!< Set PF8 function to CCAP_DATA1 */ -#define SET_CCAP_DATA2_PJ5() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CCAP_DATA2_PJ5_Msk)) | CCAP_DATA2_PJ5 /*!< Set PJ5 function to CCAP_DATA2 */ -#define SET_CCAP_DATA2_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CCAP_DATA2_PC2_Msk)) | CCAP_DATA2_PC2 /*!< Set PC2 function to CCAP_DATA2 */ -#define SET_CCAP_DATA2_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CCAP_DATA2_PF9_Msk)) | CCAP_DATA2_PF9 /*!< Set PF9 function to CCAP_DATA2 */ -#define SET_CCAP_DATA3_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CCAP_DATA3_PF10_Msk)) | CCAP_DATA3_PF10 /*!< Set PF10 function to CCAP_DATA3 */ -#define SET_CCAP_DATA3_PJ4() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~CCAP_DATA3_PJ4_Msk)) | CCAP_DATA3_PJ4 /*!< Set PJ4 function to CCAP_DATA3 */ -#define SET_CCAP_DATA3_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~CCAP_DATA3_PC3_Msk)) | CCAP_DATA3_PC3 /*!< Set PC3 function to CCAP_DATA3 */ -#define SET_CCAP_DATA4_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~CCAP_DATA4_PC4_Msk)) | CCAP_DATA4_PC4 /*!< Set PC4 function to CCAP_DATA4 */ -#define SET_CCAP_DATA4_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~CCAP_DATA4_PF11_Msk)) | CCAP_DATA4_PF11 /*!< Set PF11 function to CCAP_DATA4 */ -#define SET_CCAP_DATA4_PJ3() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~CCAP_DATA4_PJ3_Msk)) | CCAP_DATA4_PJ3 /*!< Set PJ3 function to CCAP_DATA4 */ -#define SET_CCAP_DATA5_PJ2() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~CCAP_DATA5_PJ2_Msk)) | CCAP_DATA5_PJ2 /*!< Set PJ2 function to CCAP_DATA5 */ -#define SET_CCAP_DATA5_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~CCAP_DATA5_PC5_Msk)) | CCAP_DATA5_PC5 /*!< Set PC5 function to CCAP_DATA5 */ -#define SET_CCAP_DATA5_PG4() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~CCAP_DATA5_PG4_Msk)) | CCAP_DATA5_PG4 /*!< Set PG4 function to CCAP_DATA5 */ -#define SET_CCAP_DATA6_PG3() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~CCAP_DATA6_PG3_Msk)) | CCAP_DATA6_PG3 /*!< Set PG3 function to CCAP_DATA6 */ -#define SET_CCAP_DATA6_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~CCAP_DATA6_PA0_Msk)) | CCAP_DATA6_PA0 /*!< Set PA0 function to CCAP_DATA6 */ -#define SET_CCAP_DATA7_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~CCAP_DATA7_PA1_Msk)) | CCAP_DATA7_PA1 /*!< Set PA1 function to CCAP_DATA7 */ -#define SET_CCAP_DATA7_PG2() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~CCAP_DATA7_PG2_Msk)) | CCAP_DATA7_PG2 /*!< Set PG2 function to CCAP_DATA7 */ -#define SET_CCAP_HSYNC_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~CCAP_HSYNC_PD7_Msk)) | CCAP_HSYNC_PD7 /*!< Set PD7 function to CCAP_HSYNC */ -#define SET_CCAP_HSYNC_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~CCAP_HSYNC_PG13_Msk)) | CCAP_HSYNC_PG13 /*!< Set PG13 function to CCAP_HSYNC */ -#define SET_CCAP_HSYNC_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~CCAP_HSYNC_PB9_Msk)) | CCAP_HSYNC_PB9 /*!< Set PB9 function to CCAP_HSYNC */ -#define SET_CCAP_PIXCLK_PH12() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~CCAP_PIXCLK_PH12_Msk)) | CCAP_PIXCLK_PH12 /*!< Set PH12 function to CCAP_PIXCLK */ -#define SET_CCAP_PIXCLK_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~CCAP_PIXCLK_PG9_Msk)) | CCAP_PIXCLK_PG9 /*!< Set PG9 function to CCAP_PIXCLK */ -#define SET_CCAP_PIXCLK_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~CCAP_PIXCLK_PB13_Msk)) | CCAP_PIXCLK_PB13 /*!< Set PB13 function to CCAP_PIXCLK */ -#define SET_CCAP_SCLK_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~CCAP_SCLK_PG10_Msk)) | CCAP_SCLK_PG10 /*!< Set PG10 function to CCAP_SCLK */ -#define SET_CCAP_SCLK_PH13() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~CCAP_SCLK_PH13_Msk)) | CCAP_SCLK_PH13 /*!< Set PH13 function to CCAP_SCLK */ -#define SET_CCAP_SCLK_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~CCAP_SCLK_PB12_Msk)) | CCAP_SCLK_PB12 /*!< Set PB12 function to CCAP_SCLK */ -#define SET_CCAP_SFIELD_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~CCAP_SFIELD_PG11_Msk)) | CCAP_SFIELD_PG11 /*!< Set PG11 function to CCAP_SFIELD */ -#define SET_CCAP_SFIELD_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~CCAP_SFIELD_PB11_Msk)) | CCAP_SFIELD_PB11 /*!< Set PB11 function to CCAP_SFIELD */ -#define SET_CCAP_SFIELD_PH14() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~CCAP_SFIELD_PH14_Msk)) | CCAP_SFIELD_PH14 /*!< Set PH14 function to CCAP_SFIELD */ -#define SET_CCAP_VSYNC_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~CCAP_VSYNC_PG12_Msk)) | CCAP_VSYNC_PG12 /*!< Set PG12 function to CCAP_VSYNC */ -#define SET_CCAP_VSYNC_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~CCAP_VSYNC_PB10_Msk)) | CCAP_VSYNC_PB10 /*!< Set PB10 function to CCAP_VSYNC */ -#define SET_CCAP_VSYNC_PH15() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~CCAP_VSYNC_PH15_Msk)) | CCAP_VSYNC_PH15 /*!< Set PH15 function to CCAP_VSYNC */ -#define SET_CLKO_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~CLKO_PC13_Msk)) | CLKO_PC13 /*!< Set PC13 function to CLKO */ -#define SET_CLKO_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~CLKO_PD13_Msk)) | CLKO_PD13 /*!< Set PD13 function to CLKO */ -#define SET_CLKO_PG15() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~CLKO_PG15_Msk)) | CLKO_PG15 /*!< Set PG15 function to CLKO */ -#define SET_CLKO_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~CLKO_PB14_Msk)) | CLKO_PB14 /*!< Set PB14 function to CLKO */ -#define SET_CLKO_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~CLKO_PD12_Msk)) | CLKO_PD12 /*!< Set PD12 function to CLKO */ -#define SET_DAC0_OUT_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~DAC0_OUT_PB12_Msk)) | DAC0_OUT_PB12 /*!< Set PB12 function to DAC0_OUT */ -#define SET_DAC0_ST_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~DAC0_ST_PA0_Msk)) | DAC0_ST_PA0 /*!< Set PA0 function to DAC0_ST */ -#define SET_DAC0_ST_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~DAC0_ST_PA10_Msk)) | DAC0_ST_PA10 /*!< Set PA10 function to DAC0_ST */ -#define SET_DAC1_OUT_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~DAC1_OUT_PB13_Msk)) | DAC1_OUT_PB13 /*!< Set PB13 function to DAC1_OUT */ -#define SET_DAC1_ST_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~DAC1_ST_PA11_Msk)) | DAC1_ST_PA11 /*!< Set PA11 function to DAC1_ST */ -#define SET_DAC1_ST_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~DAC1_ST_PA1_Msk)) | DAC1_ST_PA1 /*!< Set PA1 function to DAC1_ST */ -#define SET_EADC0_CH0_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC0_CH0_PB0_Msk)) | EADC0_CH0_PB0 /*!< Set PB0 function to EADC0_CH0 */ -#define SET_EADC0_CH1_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC0_CH1_PB1_Msk)) | EADC0_CH1_PB1 /*!< Set PB1 function to EADC0_CH1 */ -#define SET_EADC0_CH10_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EADC0_CH10_PB10_Msk)) | EADC0_CH10_PB10 /*!< Set PB10 function to EADC0_CH10 */ -#define SET_EADC0_CH11_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EADC0_CH11_PB11_Msk)) | EADC0_CH11_PB11 /*!< Set PB11 function to EADC0_CH11 */ -#define SET_EADC0_CH12_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC0_CH12_PB12_Msk)) | EADC0_CH12_PB12 /*!< Set PB12 function to EADC0_CH12 */ -#define SET_EADC0_CH13_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC0_CH13_PB13_Msk)) | EADC0_CH13_PB13 /*!< Set PB13 function to EADC0_CH13 */ -#define SET_EADC0_CH14_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC0_CH14_PB14_Msk)) | EADC0_CH14_PB14 /*!< Set PB14 function to EADC0_CH14 */ -#define SET_EADC0_CH15_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC0_CH15_PB15_Msk)) | EADC0_CH15_PB15 /*!< Set PB15 function to EADC0_CH15 */ -#define SET_EADC0_CH2_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC0_CH2_PB2_Msk)) | EADC0_CH2_PB2 /*!< Set PB2 function to EADC0_CH2 */ -#define SET_EADC0_CH3_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC0_CH3_PB3_Msk)) | EADC0_CH3_PB3 /*!< Set PB3 function to EADC0_CH3 */ -#define SET_EADC0_CH4_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EADC0_CH4_PB4_Msk)) | EADC0_CH4_PB4 /*!< Set PB4 function to EADC0_CH4 */ -#define SET_EADC0_CH5_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EADC0_CH5_PB5_Msk)) | EADC0_CH5_PB5 /*!< Set PB5 function to EADC0_CH5 */ -#define SET_EADC0_CH6_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EADC0_CH6_PB6_Msk)) | EADC0_CH6_PB6 /*!< Set PB6 function to EADC0_CH6 */ -#define SET_EADC0_CH7_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EADC0_CH7_PB7_Msk)) | EADC0_CH7_PB7 /*!< Set PB7 function to EADC0_CH7 */ -#define SET_EADC0_CH8_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EADC0_CH8_PB8_Msk)) | EADC0_CH8_PB8 /*!< Set PB8 function to EADC0_CH8 */ -#define SET_EADC0_CH9_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EADC0_CH9_PB9_Msk)) | EADC0_CH9_PB9 /*!< Set PB9 function to EADC0_CH9 */ -#define SET_EADC0_ST_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~EADC0_ST_PF0_Msk)) | EADC0_ST_PF0 /*!< Set PF0 function to EADC0_ST */ -#define SET_EADC0_ST_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EADC0_ST_PD12_Msk)) | EADC0_ST_PD12 /*!< Set PD12 function to EADC0_ST */ -#define SET_EADC0_ST_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~EADC0_ST_PD6_Msk)) | EADC0_ST_PD6 /*!< Set PD6 function to EADC0_ST */ -#define SET_EADC0_ST_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EADC0_ST_PC1_Msk)) | EADC0_ST_PC1 /*!< Set PC1 function to EADC0_ST */ -#define SET_EADC0_ST_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EADC0_ST_PF5_Msk)) | EADC0_ST_PF5 /*!< Set PF5 function to EADC0_ST */ -#define SET_EADC0_ST_PG15() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~EADC0_ST_PG15_Msk)) | EADC0_ST_PG15 /*!< Set PG15 function to EADC0_ST */ -#define SET_EADC0_ST_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EADC0_ST_PD13_Msk)) | EADC0_ST_PD13 /*!< Set PD13 function to EADC0_ST */ -#define SET_EADC0_ST_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EADC0_ST_PC13_Msk)) | EADC0_ST_PC13 /*!< Set PC13 function to EADC0_ST */ -#define SET_EADC1_CH0_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EADC1_CH0_PD10_Msk)) | EADC1_CH0_PD10 /*!< Set PD10 function to EADC1_CH0 */ -#define SET_EADC1_CH1_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EADC1_CH1_PD11_Msk)) | EADC1_CH1_PD11 /*!< Set PD11 function to EADC1_CH1 */ -#define SET_EADC1_CH10_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC1_CH10_PB2_Msk)) | EADC1_CH10_PB2 /*!< Set PB2 function to EADC1_CH10 */ -#define SET_EADC1_CH11_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC1_CH11_PB3_Msk)) | EADC1_CH11_PB3 /*!< Set PB3 function to EADC1_CH11 */ -#define SET_EADC1_CH12_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC1_CH12_PB12_Msk)) | EADC1_CH12_PB12 /*!< Set PB12 function to EADC1_CH12 */ -#define SET_EADC1_CH13_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC1_CH13_PB13_Msk)) | EADC1_CH13_PB13 /*!< Set PB13 function to EADC1_CH13 */ -#define SET_EADC1_CH14_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC1_CH14_PB14_Msk)) | EADC1_CH14_PB14 /*!< Set PB14 function to EADC1_CH14 */ -#define SET_EADC1_CH15_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EADC1_CH15_PB15_Msk)) | EADC1_CH15_PB15 /*!< Set PB15 function to EADC1_CH15 */ -#define SET_EADC1_CH2_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EADC1_CH2_PD12_Msk)) | EADC1_CH2_PD12 /*!< Set PD12 function to EADC1_CH2 */ -#define SET_EADC1_CH3_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EADC1_CH3_PC13_Msk)) | EADC1_CH3_PC13 /*!< Set PC13 function to EADC1_CH3 */ -#define SET_EADC1_CH4_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC1_CH4_PA8_Msk)) | EADC1_CH4_PA8 /*!< Set PA8 function to EADC1_CH4 */ -#define SET_EADC1_CH5_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC1_CH5_PA9_Msk)) | EADC1_CH5_PA9 /*!< Set PA9 function to EADC1_CH5 */ -#define SET_EADC1_CH6_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC1_CH6_PA10_Msk)) | EADC1_CH6_PA10 /*!< Set PA10 function to EADC1_CH6 */ -#define SET_EADC1_CH7_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC1_CH7_PA11_Msk)) | EADC1_CH7_PA11 /*!< Set PA11 function to EADC1_CH7 */ -#define SET_EADC1_CH8_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC1_CH8_PB0_Msk)) | EADC1_CH8_PB0 /*!< Set PB0 function to EADC1_CH8 */ -#define SET_EADC1_CH9_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC1_CH9_PB1_Msk)) | EADC1_CH9_PB1 /*!< Set PB1 function to EADC1_CH9 */ -#define SET_EADC1_ST_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EADC1_ST_PC10_Msk)) | EADC1_ST_PC10 /*!< Set PC10 function to EADC1_ST */ -#define SET_EADC1_ST_PD5() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~EADC1_ST_PD5_Msk)) | EADC1_ST_PD5 /*!< Set PD5 function to EADC1_ST */ -#define SET_EADC1_ST_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EADC1_ST_PC0_Msk)) | EADC1_ST_PC0 /*!< Set PC0 function to EADC1_ST */ -#define SET_EADC1_ST_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~EADC1_ST_PF1_Msk)) | EADC1_ST_PF1 /*!< Set PF1 function to EADC1_ST */ -#define SET_EADC1_ST_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EADC1_ST_PF4_Msk)) | EADC1_ST_PF4 /*!< Set PF4 function to EADC1_ST */ -#define SET_EADC1_ST_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EADC1_ST_PC9_Msk)) | EADC1_ST_PC9 /*!< Set PC9 function to EADC1_ST */ -#define SET_EADC2_CH0_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EADC2_CH0_PD10_Msk)) | EADC2_CH0_PD10 /*!< Set PD10 function to EADC2_CH0 */ -#define SET_EADC2_CH1_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EADC2_CH1_PD11_Msk)) | EADC2_CH1_PD11 /*!< Set PD11 function to EADC2_CH1 */ -#define SET_EADC2_CH10_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EADC2_CH10_PC9_Msk)) | EADC2_CH10_PC9 /*!< Set PC9 function to EADC2_CH10 */ -#define SET_EADC2_CH11_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EADC2_CH11_PC10_Msk)) | EADC2_CH11_PC10 /*!< Set PC10 function to EADC2_CH11 */ -#define SET_EADC2_CH12_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EADC2_CH12_PC11_Msk)) | EADC2_CH12_PC11 /*!< Set PC11 function to EADC2_CH12 */ -#define SET_EADC2_CH13_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EADC2_CH13_PC12_Msk)) | EADC2_CH13_PC12 /*!< Set PC12 function to EADC2_CH13 */ -#define SET_EADC2_CH14_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EADC2_CH14_PB6_Msk)) | EADC2_CH14_PB6 /*!< Set PB6 function to EADC2_CH14 */ -#define SET_EADC2_CH15_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EADC2_CH15_PB7_Msk)) | EADC2_CH15_PB7 /*!< Set PB7 function to EADC2_CH15 */ -#define SET_EADC2_CH2_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EADC2_CH2_PD12_Msk)) | EADC2_CH2_PD12 /*!< Set PD12 function to EADC2_CH2 */ -#define SET_EADC2_CH3_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EADC2_CH3_PC13_Msk)) | EADC2_CH3_PC13 /*!< Set PC13 function to EADC2_CH3 */ -#define SET_EADC2_CH4_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC2_CH4_PA8_Msk)) | EADC2_CH4_PA8 /*!< Set PA8 function to EADC2_CH4 */ -#define SET_EADC2_CH5_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC2_CH5_PA9_Msk)) | EADC2_CH5_PA9 /*!< Set PA9 function to EADC2_CH5 */ -#define SET_EADC2_CH6_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC2_CH6_PA10_Msk)) | EADC2_CH6_PA10 /*!< Set PA10 function to EADC2_CH6 */ -#define SET_EADC2_CH7_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EADC2_CH7_PA11_Msk)) | EADC2_CH7_PA11 /*!< Set PA11 function to EADC2_CH7 */ -#define SET_EADC2_CH8_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC2_CH8_PB0_Msk)) | EADC2_CH8_PB0 /*!< Set PB0 function to EADC2_CH8 */ -#define SET_EADC2_CH9_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EADC2_CH9_PB1_Msk)) | EADC2_CH9_PB1 /*!< Set PB1 function to EADC2_CH9 */ -#define SET_EADC2_ST_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~EADC2_ST_PF3_Msk)) | EADC2_ST_PF3 /*!< Set PF3 function to EADC2_ST */ -#define SET_EADC2_ST_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EADC2_ST_PB8_Msk)) | EADC2_ST_PB8 /*!< Set PB8 function to EADC2_ST */ -#define SET_EBI_AD0_PJ7() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~EBI_AD0_PJ7_Msk)) | EBI_AD0_PJ7 /*!< Set PJ7 function to EBI_AD0 */ -#define SET_EBI_AD0_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EBI_AD0_PF4_Msk)) | EBI_AD0_PF4 /*!< Set PF4 function to EBI_AD0 */ -#define SET_EBI_AD0_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~EBI_AD0_PG9_Msk)) | EBI_AD0_PG9 /*!< Set PG9 function to EBI_AD0 */ -#define SET_EBI_AD0_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EBI_AD0_PC0_Msk)) | EBI_AD0_PC0 /*!< Set PC0 function to EBI_AD0 */ -#define SET_EBI_AD0_PH12() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~EBI_AD0_PH12_Msk)) | EBI_AD0_PH12 /*!< Set PH12 function to EBI_AD0 */ -#define SET_EBI_AD1_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EBI_AD1_PC1_Msk)) | EBI_AD1_PC1 /*!< Set PC1 function to EBI_AD1 */ -#define SET_EBI_AD1_PH13() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~EBI_AD1_PH13_Msk)) | EBI_AD1_PH13 /*!< Set PH13 function to EBI_AD1 */ -#define SET_EBI_AD1_PJ6() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~EBI_AD1_PJ6_Msk)) | EBI_AD1_PJ6 /*!< Set PJ6 function to EBI_AD1 */ -#define SET_EBI_AD1_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~EBI_AD1_PG10_Msk)) | EBI_AD1_PG10 /*!< Set PG10 function to EBI_AD1 */ -#define SET_EBI_AD1_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EBI_AD1_PF5_Msk)) | EBI_AD1_PF5 /*!< Set PF5 function to EBI_AD1 */ -#define SET_EBI_AD10_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EBI_AD10_PD3_Msk)) | EBI_AD10_PD3 /*!< Set PD3 function to EBI_AD10 */ -#define SET_EBI_AD10_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EBI_AD10_PE1_Msk)) | EBI_AD10_PE1 /*!< Set PE1 function to EBI_AD10 */ -#define SET_EBI_AD10_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EBI_AD10_PD13_Msk)) | EBI_AD10_PD13 /*!< Set PD13 function to EBI_AD10 */ -#define SET_EBI_AD11_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EBI_AD11_PE0_Msk)) | EBI_AD11_PE0 /*!< Set PE0 function to EBI_AD11 */ -#define SET_EBI_AD11_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EBI_AD11_PC14_Msk)) | EBI_AD11_PC14 /*!< Set PC14 function to EBI_AD11 */ -#define SET_EBI_AD11_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EBI_AD11_PD2_Msk)) | EBI_AD11_PD2 /*!< Set PD2 function to EBI_AD11 */ -#define SET_EBI_AD12_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EBI_AD12_PD1_Msk)) | EBI_AD12_PD1 /*!< Set PD1 function to EBI_AD12 */ -#define SET_EBI_AD12_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~EBI_AD12_PH8_Msk)) | EBI_AD12_PH8 /*!< Set PH8 function to EBI_AD12 */ -#define SET_EBI_AD12_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EBI_AD12_PB15_Msk)) | EBI_AD12_PB15 /*!< Set PB15 function to EBI_AD12 */ -#define SET_EBI_AD13_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EBI_AD13_PD0_Msk)) | EBI_AD13_PD0 /*!< Set PD0 function to EBI_AD13 */ -#define SET_EBI_AD13_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~EBI_AD13_PH9_Msk)) | EBI_AD13_PH9 /*!< Set PH9 function to EBI_AD13 */ -#define SET_EBI_AD13_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EBI_AD13_PB14_Msk)) | EBI_AD13_PB14 /*!< Set PB14 function to EBI_AD13 */ -#define SET_EBI_AD14_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EBI_AD14_PB13_Msk)) | EBI_AD14_PB13 /*!< Set PB13 function to EBI_AD14 */ -#define SET_EBI_AD14_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~EBI_AD14_PH10_Msk)) | EBI_AD14_PH10 /*!< Set PH10 function to EBI_AD14 */ -#define SET_EBI_AD15_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EBI_AD15_PB12_Msk)) | EBI_AD15_PB12 /*!< Set PB12 function to EBI_AD15 */ -#define SET_EBI_AD15_PH11() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~EBI_AD15_PH11_Msk)) | EBI_AD15_PH11 /*!< Set PH11 function to EBI_AD15 */ -#define SET_EBI_AD2_PH14() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~EBI_AD2_PH14_Msk)) | EBI_AD2_PH14 /*!< Set PH14 function to EBI_AD2 */ -#define SET_EBI_AD2_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~EBI_AD2_PG11_Msk)) | EBI_AD2_PG11 /*!< Set PG11 function to EBI_AD2 */ -#define SET_EBI_AD2_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EBI_AD2_PC2_Msk)) | EBI_AD2_PC2 /*!< Set PC2 function to EBI_AD2 */ -#define SET_EBI_AD2_PJ5() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~EBI_AD2_PJ5_Msk)) | EBI_AD2_PJ5 /*!< Set PJ5 function to EBI_AD2 */ -#define SET_EBI_AD3_PJ4() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~EBI_AD3_PJ4_Msk)) | EBI_AD3_PJ4 /*!< Set PJ4 function to EBI_AD3 */ -#define SET_EBI_AD3_PH15() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~EBI_AD3_PH15_Msk)) | EBI_AD3_PH15 /*!< Set PH15 function to EBI_AD3 */ -#define SET_EBI_AD3_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~EBI_AD3_PG12_Msk)) | EBI_AD3_PG12 /*!< Set PG12 function to EBI_AD3 */ -#define SET_EBI_AD3_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EBI_AD3_PC3_Msk)) | EBI_AD3_PC3 /*!< Set PC3 function to EBI_AD3 */ -#define SET_EBI_AD4_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~EBI_AD4_PG13_Msk)) | EBI_AD4_PG13 /*!< Set PG13 function to EBI_AD4 */ -#define SET_EBI_AD4_PJ3() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~EBI_AD4_PJ3_Msk)) | EBI_AD4_PJ3 /*!< Set PJ3 function to EBI_AD4 */ -#define SET_EBI_AD4_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~EBI_AD4_PD7_Msk)) | EBI_AD4_PD7 /*!< Set PD7 function to EBI_AD4 */ -#define SET_EBI_AD4_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EBI_AD4_PC4_Msk)) | EBI_AD4_PC4 /*!< Set PC4 function to EBI_AD4 */ -#define SET_EBI_AD5_PJ2() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~EBI_AD5_PJ2_Msk)) | EBI_AD5_PJ2 /*!< Set PJ2 function to EBI_AD5 */ -#define SET_EBI_AD5_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~EBI_AD5_PA14_Msk)) | EBI_AD5_PA14 /*!< Set PA14 function to EBI_AD5 */ -#define SET_EBI_AD5_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~EBI_AD5_PD6_Msk)) | EBI_AD5_PD6 /*!< Set PD6 function to EBI_AD5 */ -#define SET_EBI_AD5_PG14() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~EBI_AD5_PG14_Msk)) | EBI_AD5_PG14 /*!< Set PG14 function to EBI_AD5 */ -#define SET_EBI_AD5_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EBI_AD5_PC5_Msk)) | EBI_AD5_PC5 /*!< Set PC5 function to EBI_AD5 */ -#define SET_EBI_AD6_PD8() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EBI_AD6_PD8_Msk)) | EBI_AD6_PD8 /*!< Set PD8 function to EBI_AD6 */ -#define SET_EBI_AD6_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EBI_AD6_PA6_Msk)) | EBI_AD6_PA6 /*!< Set PA6 function to EBI_AD6 */ -#define SET_EBI_AD7_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EBI_AD7_PA7_Msk)) | EBI_AD7_PA7 /*!< Set PA7 function to EBI_AD7 */ -#define SET_EBI_AD7_PD9() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EBI_AD7_PD9_Msk)) | EBI_AD7_PD9 /*!< Set PD9 function to EBI_AD7 */ -#define SET_EBI_AD8_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EBI_AD8_PC6_Msk)) | EBI_AD8_PC6 /*!< Set PC6 function to EBI_AD8 */ -#define SET_EBI_AD8_PE14() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EBI_AD8_PE14_Msk)) | EBI_AD8_PE14 /*!< Set PE14 function to EBI_AD8 */ -#define SET_EBI_AD9_PE15() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EBI_AD9_PE15_Msk)) | EBI_AD9_PE15 /*!< Set PE15 function to EBI_AD9 */ -#define SET_EBI_AD9_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EBI_AD9_PC7_Msk)) | EBI_AD9_PC7 /*!< Set PC7 function to EBI_AD9 */ -#define SET_EBI_ADR0_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EBI_ADR0_PB5_Msk)) | EBI_ADR0_PB5 /*!< Set PB5 function to EBI_ADR0 */ -#define SET_EBI_ADR0_PH7() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~EBI_ADR0_PH7_Msk)) | EBI_ADR0_PH7 /*!< Set PH7 function to EBI_ADR0 */ -#define SET_EBI_ADR1_PH6() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~EBI_ADR1_PH6_Msk)) | EBI_ADR1_PH6 /*!< Set PH6 function to EBI_ADR1 */ -#define SET_EBI_ADR1_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EBI_ADR1_PB4_Msk)) | EBI_ADR1_PB4 /*!< Set PB4 function to EBI_ADR1 */ -#define SET_EBI_ADR10_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EBI_ADR10_PE8_Msk)) | EBI_ADR10_PE8 /*!< Set PE8 function to EBI_ADR10 */ -#define SET_EBI_ADR10_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EBI_ADR10_PC13_Msk)) | EBI_ADR10_PC13 /*!< Set PC13 function to EBI_ADR10 */ -#define SET_EBI_ADR11_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EBI_ADR11_PE9_Msk)) | EBI_ADR11_PE9 /*!< Set PE9 function to EBI_ADR11 */ -#define SET_EBI_ADR11_PG2() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~EBI_ADR11_PG2_Msk)) | EBI_ADR11_PG2 /*!< Set PG2 function to EBI_ADR11 */ -#define SET_EBI_ADR12_PG3() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~EBI_ADR12_PG3_Msk)) | EBI_ADR12_PG3 /*!< Set PG3 function to EBI_ADR12 */ -#define SET_EBI_ADR12_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EBI_ADR12_PE10_Msk)) | EBI_ADR12_PE10 /*!< Set PE10 function to EBI_ADR12 */ -#define SET_EBI_ADR13_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EBI_ADR13_PE11_Msk)) | EBI_ADR13_PE11 /*!< Set PE11 function to EBI_ADR13 */ -#define SET_EBI_ADR13_PG4() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~EBI_ADR13_PG4_Msk)) | EBI_ADR13_PG4 /*!< Set PG4 function to EBI_ADR13 */ -#define SET_EBI_ADR14_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~EBI_ADR14_PF11_Msk)) | EBI_ADR14_PF11 /*!< Set PF11 function to EBI_ADR14 */ -#define SET_EBI_ADR14_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EBI_ADR14_PE12_Msk)) | EBI_ADR14_PE12 /*!< Set PE12 function to EBI_ADR14 */ -#define SET_EBI_ADR15_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EBI_ADR15_PE13_Msk)) | EBI_ADR15_PE13 /*!< Set PE13 function to EBI_ADR15 */ -#define SET_EBI_ADR15_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~EBI_ADR15_PF10_Msk)) | EBI_ADR15_PF10 /*!< Set PF10 function to EBI_ADR15 */ -#define SET_EBI_ADR16_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EBI_ADR16_PB11_Msk)) | EBI_ADR16_PB11 /*!< Set PB11 function to EBI_ADR16 */ -#define SET_EBI_ADR16_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EBI_ADR16_PC8_Msk)) | EBI_ADR16_PC8 /*!< Set PC8 function to EBI_ADR16 */ -#define SET_EBI_ADR16_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~EBI_ADR16_PF9_Msk)) | EBI_ADR16_PF9 /*!< Set PF9 function to EBI_ADR16 */ -#define SET_EBI_ADR17_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EBI_ADR17_PB10_Msk)) | EBI_ADR17_PB10 /*!< Set PB10 function to EBI_ADR17 */ -#define SET_EBI_ADR17_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~EBI_ADR17_PF8_Msk)) | EBI_ADR17_PF8 /*!< Set PF8 function to EBI_ADR17 */ -#define SET_EBI_ADR18_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EBI_ADR18_PF7_Msk)) | EBI_ADR18_PF7 /*!< Set PF7 function to EBI_ADR18 */ -#define SET_EBI_ADR18_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EBI_ADR18_PB9_Msk)) | EBI_ADR18_PB9 /*!< Set PB9 function to EBI_ADR18 */ -#define SET_EBI_ADR19_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EBI_ADR19_PF6_Msk)) | EBI_ADR19_PF6 /*!< Set PF6 function to EBI_ADR19 */ -#define SET_EBI_ADR19_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EBI_ADR19_PB8_Msk)) | EBI_ADR19_PB8 /*!< Set PB8 function to EBI_ADR19 */ -#define SET_EBI_ADR2_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EBI_ADR2_PB3_Msk)) | EBI_ADR2_PB3 /*!< Set PB3 function to EBI_ADR2 */ -#define SET_EBI_ADR2_PH5() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~EBI_ADR2_PH5_Msk)) | EBI_ADR2_PH5 /*!< Set PH5 function to EBI_ADR2 */ -#define SET_EBI_ADR3_PH4() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~EBI_ADR3_PH4_Msk)) | EBI_ADR3_PH4 /*!< Set PH4 function to EBI_ADR3 */ -#define SET_EBI_ADR3_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EBI_ADR3_PB2_Msk)) | EBI_ADR3_PB2 /*!< Set PB2 function to EBI_ADR3 */ -#define SET_EBI_ADR4_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EBI_ADR4_PC12_Msk)) | EBI_ADR4_PC12 /*!< Set PC12 function to EBI_ADR4 */ -#define SET_EBI_ADR4_PH3() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~EBI_ADR4_PH3_Msk)) | EBI_ADR4_PH3 /*!< Set PH3 function to EBI_ADR4 */ -#define SET_EBI_ADR5_PH2() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~EBI_ADR5_PH2_Msk)) | EBI_ADR5_PH2 /*!< Set PH2 function to EBI_ADR5 */ -#define SET_EBI_ADR5_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EBI_ADR5_PC11_Msk)) | EBI_ADR5_PC11 /*!< Set PC11 function to EBI_ADR5 */ -#define SET_EBI_ADR6_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EBI_ADR6_PC10_Msk)) | EBI_ADR6_PC10 /*!< Set PC10 function to EBI_ADR6 */ -#define SET_EBI_ADR6_PH1() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~EBI_ADR6_PH1_Msk)) | EBI_ADR6_PH1 /*!< Set PH1 function to EBI_ADR6 */ -#define SET_EBI_ADR7_PH0() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~EBI_ADR7_PH0_Msk)) | EBI_ADR7_PH0 /*!< Set PH0 function to EBI_ADR7 */ -#define SET_EBI_ADR7_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EBI_ADR7_PC9_Msk)) | EBI_ADR7_PC9 /*!< Set PC9 function to EBI_ADR7 */ -#define SET_EBI_ADR8_PG0() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~EBI_ADR8_PG0_Msk)) | EBI_ADR8_PG0 /*!< Set PG0 function to EBI_ADR8 */ -#define SET_EBI_ADR8_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EBI_ADR8_PB1_Msk)) | EBI_ADR8_PB1 /*!< Set PB1 function to EBI_ADR8 */ -#define SET_EBI_ADR9_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EBI_ADR9_PB0_Msk)) | EBI_ADR9_PB0 /*!< Set PB0 function to EBI_ADR9 */ -#define SET_EBI_ADR9_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~EBI_ADR9_PG1_Msk)) | EBI_ADR9_PG1 /*!< Set PG1 function to EBI_ADR9 */ -#define SET_EBI_ALE_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EBI_ALE_PA8_Msk)) | EBI_ALE_PA8 /*!< Set PA8 function to EBI_ALE */ -#define SET_EBI_ALE_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EBI_ALE_PE2_Msk)) | EBI_ALE_PE2 /*!< Set PE2 function to EBI_ALE */ -#define SET_EBI_ALE_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~EBI_ALE_PJ11_Msk)) | EBI_ALE_PJ11 /*!< Set PJ11 function to EBI_ALE */ -#define SET_EBI_MCLK_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EBI_MCLK_PE3_Msk)) | EBI_MCLK_PE3 /*!< Set PE3 function to EBI_MCLK */ -#define SET_EBI_MCLK_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EBI_MCLK_PA9_Msk)) | EBI_MCLK_PA9 /*!< Set PA9 function to EBI_MCLK */ -#define SET_EBI_MCLK_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~EBI_MCLK_PJ10_Msk)) | EBI_MCLK_PJ10 /*!< Set PJ10 function to EBI_MCLK */ -#define SET_EBI_nCS0_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~EBI_nCS0_PF3_Msk)) | EBI_nCS0_PF3 /*!< Set PF3 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~EBI_nCS0_PJ12_Msk)) | EBI_nCS0_PJ12 /*!< Set PJ12 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PD14() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EBI_nCS0_PD14_Msk)) | EBI_nCS0_PD14 /*!< Set PD14 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EBI_nCS0_PB7_Msk)) | EBI_nCS0_PB7 /*!< Set PB7 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EBI_nCS0_PF6_Msk)) | EBI_nCS0_PF6 /*!< Set PF6 function to EBI_nCS0 */ -#define SET_EBI_nCS0_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EBI_nCS0_PD12_Msk)) | EBI_nCS0_PD12 /*!< Set PD12 function to EBI_nCS0 */ -#define SET_EBI_nCS1_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EBI_nCS1_PB6_Msk)) | EBI_nCS1_PB6 /*!< Set PB6 function to EBI_nCS1 */ -#define SET_EBI_nCS1_PG5() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~EBI_nCS1_PG5_Msk)) | EBI_nCS1_PG5 /*!< Set PG5 function to EBI_nCS1 */ -#define SET_EBI_nCS1_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EBI_nCS1_PD11_Msk)) | EBI_nCS1_PD11 /*!< Set PD11 function to EBI_nCS1 */ -#define SET_EBI_nCS1_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~EBI_nCS1_PF2_Msk)) | EBI_nCS1_PF2 /*!< Set PF2 function to EBI_nCS1 */ -#define SET_EBI_nCS2_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EBI_nCS2_PD10_Msk)) | EBI_nCS2_PD10 /*!< Set PD10 function to EBI_nCS2 */ -#define SET_EBI_nCS2_PG6() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~EBI_nCS2_PG6_Msk)) | EBI_nCS2_PG6 /*!< Set PG6 function to EBI_nCS2 */ -#define SET_EBI_nRD_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EBI_nRD_PA11_Msk)) | EBI_nRD_PA11 /*!< Set PA11 function to EBI_nRD */ -#define SET_EBI_nRD_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EBI_nRD_PE5_Msk)) | EBI_nRD_PE5 /*!< Set PE5 function to EBI_nRD */ -#define SET_EBI_nRD_PJ8() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~EBI_nRD_PJ8_Msk)) | EBI_nRD_PJ8 /*!< Set PJ8 function to EBI_nRD */ -#define SET_EBI_nWR_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EBI_nWR_PA10_Msk)) | EBI_nWR_PA10 /*!< Set PA10 function to EBI_nWR */ -#define SET_EBI_nWR_PJ9() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~EBI_nWR_PJ9_Msk)) | EBI_nWR_PJ9 /*!< Set PJ9 function to EBI_nWR */ -#define SET_EBI_nWR_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EBI_nWR_PE4_Msk)) | EBI_nWR_PE4 /*!< Set PE4 function to EBI_nWR */ -#define SET_EBI_nWRH_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EBI_nWRH_PB6_Msk)) | EBI_nWRH_PB6 /*!< Set PB6 function to EBI_nWRH */ -#define SET_EBI_nWRH_PG8() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~EBI_nWRH_PG8_Msk)) | EBI_nWRH_PG8 /*!< Set PG8 function to EBI_nWRH */ -#define SET_EBI_nWRL_PG7() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~EBI_nWRL_PG7_Msk)) | EBI_nWRL_PG7 /*!< Set PG7 function to EBI_nWRL */ -#define SET_EBI_nWRL_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EBI_nWRL_PB7_Msk)) | EBI_nWRL_PB7 /*!< Set PB7 function to EBI_nWRL */ -#define SET_ECAP0_IC0_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~ECAP0_IC0_PE8_Msk)) | ECAP0_IC0_PE8 /*!< Set PE8 function to ECAP0_IC0 */ -#define SET_ECAP0_IC0_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~ECAP0_IC0_PA10_Msk)) | ECAP0_IC0_PA10 /*!< Set PA10 function to ECAP0_IC0 */ -#define SET_ECAP0_IC1_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~ECAP0_IC1_PA9_Msk)) | ECAP0_IC1_PA9 /*!< Set PA9 function to ECAP0_IC1 */ -#define SET_ECAP0_IC1_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~ECAP0_IC1_PE9_Msk)) | ECAP0_IC1_PE9 /*!< Set PE9 function to ECAP0_IC1 */ -#define SET_ECAP0_IC2_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~ECAP0_IC2_PE10_Msk)) | ECAP0_IC2_PE10 /*!< Set PE10 function to ECAP0_IC2 */ -#define SET_ECAP0_IC2_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~ECAP0_IC2_PA8_Msk)) | ECAP0_IC2_PA8 /*!< Set PA8 function to ECAP0_IC2 */ -#define SET_ECAP1_IC0_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~ECAP1_IC0_PE13_Msk)) | ECAP1_IC0_PE13 /*!< Set PE13 function to ECAP1_IC0 */ -#define SET_ECAP1_IC0_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~ECAP1_IC0_PC10_Msk)) | ECAP1_IC0_PC10 /*!< Set PC10 function to ECAP1_IC0 */ -#define SET_ECAP1_IC1_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~ECAP1_IC1_PC11_Msk)) | ECAP1_IC1_PC11 /*!< Set PC11 function to ECAP1_IC1 */ -#define SET_ECAP1_IC1_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~ECAP1_IC1_PE12_Msk)) | ECAP1_IC1_PE12 /*!< Set PE12 function to ECAP1_IC1 */ -#define SET_ECAP1_IC2_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~ECAP1_IC2_PC12_Msk)) | ECAP1_IC2_PC12 /*!< Set PC12 function to ECAP1_IC2 */ -#define SET_ECAP1_IC2_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~ECAP1_IC2_PE11_Msk)) | ECAP1_IC2_PE11 /*!< Set PE11 function to ECAP1_IC2 */ -#define SET_ECAP2_IC0_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~ECAP2_IC0_PG9_Msk)) | ECAP2_IC0_PG9 /*!< Set PG9 function to ECAP2_IC0 */ -#define SET_ECAP2_IC0_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~ECAP2_IC0_PJ10_Msk)) | ECAP2_IC0_PJ10 /*!< Set PJ10 function to ECAP2_IC0 */ -#define SET_ECAP2_IC0_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~ECAP2_IC0_PD1_Msk)) | ECAP2_IC0_PD1 /*!< Set PD1 function to ECAP2_IC0 */ -#define SET_ECAP2_IC1_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~ECAP2_IC1_PD0_Msk)) | ECAP2_IC1_PD0 /*!< Set PD0 function to ECAP2_IC1 */ -#define SET_ECAP2_IC1_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~ECAP2_IC1_PJ11_Msk)) | ECAP2_IC1_PJ11 /*!< Set PJ11 function to ECAP2_IC1 */ -#define SET_ECAP2_IC1_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~ECAP2_IC1_PG10_Msk)) | ECAP2_IC1_PG10 /*!< Set PG10 function to ECAP2_IC1 */ -#define SET_ECAP2_IC2_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~ECAP2_IC2_PG11_Msk)) | ECAP2_IC2_PG11 /*!< Set PG11 function to ECAP2_IC2 */ -#define SET_ECAP2_IC2_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~ECAP2_IC2_PJ12_Msk)) | ECAP2_IC2_PJ12 /*!< Set PJ12 function to ECAP2_IC2 */ -#define SET_ECAP2_IC2_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~ECAP2_IC2_PD13_Msk)) | ECAP2_IC2_PD13 /*!< Set PD13 function to ECAP2_IC2 */ -#define SET_ECAP3_IC0_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~ECAP3_IC0_PA12_Msk)) | ECAP3_IC0_PA12 /*!< Set PA12 function to ECAP3_IC0 */ -#define SET_ECAP3_IC0_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~ECAP3_IC0_PD12_Msk)) | ECAP3_IC0_PD12 /*!< Set PD12 function to ECAP3_IC0 */ -#define SET_ECAP3_IC0_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~ECAP3_IC0_PE8_Msk)) | ECAP3_IC0_PE8 /*!< Set PE8 function to ECAP3_IC0 */ -#define SET_ECAP3_IC1_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~ECAP3_IC1_PA13_Msk)) | ECAP3_IC1_PA13 /*!< Set PA13 function to ECAP3_IC1 */ -#define SET_ECAP3_IC1_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~ECAP3_IC1_PE9_Msk)) | ECAP3_IC1_PE9 /*!< Set PE9 function to ECAP3_IC1 */ -#define SET_ECAP3_IC1_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~ECAP3_IC1_PD11_Msk)) | ECAP3_IC1_PD11 /*!< Set PD11 function to ECAP3_IC1 */ -#define SET_ECAP3_IC2_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~ECAP3_IC2_PE10_Msk)) | ECAP3_IC2_PE10 /*!< Set PE10 function to ECAP3_IC2 */ -#define SET_ECAP3_IC2_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~ECAP3_IC2_PD10_Msk)) | ECAP3_IC2_PD10 /*!< Set PD10 function to ECAP3_IC2 */ -#define SET_ECAP3_IC2_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~ECAP3_IC2_PA14_Msk)) | ECAP3_IC2_PA14 /*!< Set PA14 function to ECAP3_IC2 */ -#define SET_EMAC0_PPS_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EMAC0_PPS_PE13_Msk)) | EMAC0_PPS_PE13 /*!< Set PE13 function to EMAC0_PPS */ -#define SET_EMAC0_PPS_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EMAC0_PPS_PB6_Msk)) | EMAC0_PPS_PB6 /*!< Set PB6 function to EMAC0_PPS */ -#define SET_EMAC0_RMII_CRSDV_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EMAC0_RMII_CRSDV_PA7_Msk)) | EMAC0_RMII_CRSDV_PA7 /*!< Set PA7 function to EMAC0_RMII_CRSDV */ -#define SET_EMAC0_RMII_CRSDV_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EMAC0_RMII_CRSDV_PB2_Msk)) | EMAC0_RMII_CRSDV_PB2 /*!< Set PB2 function to EMAC0_RMII_CRSDV */ -#define SET_EMAC0_RMII_MDC_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EMAC0_RMII_MDC_PE8_Msk)) | EMAC0_RMII_MDC_PE8 /*!< Set PE8 function to EMAC0_RMII_MDC */ -#define SET_EMAC0_RMII_MDC_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EMAC0_RMII_MDC_PB11_Msk)) | EMAC0_RMII_MDC_PB11 /*!< Set PB11 function to EMAC0_RMII_MDC */ -#define SET_EMAC0_RMII_MDIO_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EMAC0_RMII_MDIO_PB10_Msk)) | EMAC0_RMII_MDIO_PB10 /*!< Set PB10 function to EMAC0_RMII_MDIO */ -#define SET_EMAC0_RMII_MDIO_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EMAC0_RMII_MDIO_PE9_Msk)) | EMAC0_RMII_MDIO_PE9 /*!< Set PE9 function to EMAC0_RMII_MDIO */ -#define SET_EMAC0_RMII_REFCLK_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EMAC0_RMII_REFCLK_PB5_Msk)) | EMAC0_RMII_REFCLK_PB5 /*!< Set PB5 function to EMAC0_RMII_REFCLK */ -#define SET_EMAC0_RMII_REFCLK_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EMAC0_RMII_REFCLK_PC8_Msk)) | EMAC0_RMII_REFCLK_PC8 /*!< Set PC8 function to EMAC0_RMII_REFCLK */ -#define SET_EMAC0_RMII_RXD0_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EMAC0_RMII_RXD0_PC7_Msk)) | EMAC0_RMII_RXD0_PC7 /*!< Set PC7 function to EMAC0_RMII_RXD0 */ -#define SET_EMAC0_RMII_RXD0_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EMAC0_RMII_RXD0_PB4_Msk)) | EMAC0_RMII_RXD0_PB4 /*!< Set PB4 function to EMAC0_RMII_RXD0 */ -#define SET_EMAC0_RMII_RXD1_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EMAC0_RMII_RXD1_PB3_Msk)) | EMAC0_RMII_RXD1_PB3 /*!< Set PB3 function to EMAC0_RMII_RXD1 */ -#define SET_EMAC0_RMII_RXD1_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EMAC0_RMII_RXD1_PC6_Msk)) | EMAC0_RMII_RXD1_PC6 /*!< Set PC6 function to EMAC0_RMII_RXD1 */ -#define SET_EMAC0_RMII_RXERR_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EMAC0_RMII_RXERR_PA6_Msk)) | EMAC0_RMII_RXERR_PA6 /*!< Set PA6 function to EMAC0_RMII_RXERR */ -#define SET_EMAC0_RMII_RXERR_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EMAC0_RMII_RXERR_PB1_Msk)) | EMAC0_RMII_RXERR_PB1 /*!< Set PB1 function to EMAC0_RMII_RXERR */ -#define SET_EMAC0_RMII_TXD0_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EMAC0_RMII_TXD0_PE10_Msk)) | EMAC0_RMII_TXD0_PE10 /*!< Set PE10 function to EMAC0_RMII_TXD0 */ -#define SET_EMAC0_RMII_TXD0_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EMAC0_RMII_TXD0_PB9_Msk)) | EMAC0_RMII_TXD0_PB9 /*!< Set PB9 function to EMAC0_RMII_TXD0 */ -#define SET_EMAC0_RMII_TXD1_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~EMAC0_RMII_TXD1_PB8_Msk)) | EMAC0_RMII_TXD1_PB8 /*!< Set PB8 function to EMAC0_RMII_TXD1 */ -#define SET_EMAC0_RMII_TXD1_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EMAC0_RMII_TXD1_PE11_Msk)) | EMAC0_RMII_TXD1_PE11 /*!< Set PE11 function to EMAC0_RMII_TXD1 */ -#define SET_EMAC0_RMII_TXEN_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EMAC0_RMII_TXEN_PB7_Msk)) | EMAC0_RMII_TXEN_PB7 /*!< Set PB7 function to EMAC0_RMII_TXEN */ -#define SET_EMAC0_RMII_TXEN_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EMAC0_RMII_TXEN_PE12_Msk)) | EMAC0_RMII_TXEN_PE12 /*!< Set PE12 function to EMAC0_RMII_TXEN */ -#define SET_EPWM0_BRAKE0_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM0_BRAKE0_PE8_Msk)) | EPWM0_BRAKE0_PE8 /*!< Set PE8 function to EPWM0_BRAKE0 */ -#define SET_EPWM0_BRAKE0_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM0_BRAKE0_PB1_Msk)) | EPWM0_BRAKE0_PB1 /*!< Set PB1 function to EPWM0_BRAKE0 */ -#define SET_EPWM0_BRAKE1_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM0_BRAKE1_PE9_Msk)) | EPWM0_BRAKE1_PE9 /*!< Set PE9 function to EPWM0_BRAKE1 */ -#define SET_EPWM0_BRAKE1_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EPWM0_BRAKE1_PB15_Msk)) | EPWM0_BRAKE1_PB15 /*!< Set PB15 function to EPWM0_BRAKE1 */ -#define SET_EPWM0_BRAKE1_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM0_BRAKE1_PB0_Msk)) | EPWM0_BRAKE1_PB0 /*!< Set PB0 function to EPWM0_BRAKE1 */ -#define SET_EPWM0_CH0_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EPWM0_CH0_PA5_Msk)) | EPWM0_CH0_PA5 /*!< Set PA5 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PG8() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~EPWM0_CH0_PG8_Msk)) | EPWM0_CH0_PG8 /*!< Set PG8 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EPWM0_CH0_PF5_Msk)) | EPWM0_CH0_PF5 /*!< Set PF5 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EPWM0_CH0_PE7_Msk)) | EPWM0_CH0_PE7 /*!< Set PE7 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EPWM0_CH0_PB5_Msk)) | EPWM0_CH0_PB5 /*!< Set PB5 function to EPWM0_CH0 */ -#define SET_EPWM0_CH0_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM0_CH0_PE8_Msk)) | EPWM0_CH0_PE8 /*!< Set PE8 function to EPWM0_CH0 */ -#define SET_EPWM0_CH1_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM0_CH1_PE9_Msk)) | EPWM0_CH1_PE9 /*!< Set PE9 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EPWM0_CH1_PE6_Msk)) | EPWM0_CH1_PE6 /*!< Set PE6 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EPWM0_CH1_PF4_Msk)) | EPWM0_CH1_PF4 /*!< Set PF4 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EPWM0_CH1_PB4_Msk)) | EPWM0_CH1_PB4 /*!< Set PB4 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EPWM0_CH1_PA4_Msk)) | EPWM0_CH1_PA4 /*!< Set PA4 function to EPWM0_CH1 */ -#define SET_EPWM0_CH1_PG7() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~EPWM0_CH1_PG7_Msk)) | EPWM0_CH1_PG7 /*!< Set PG7 function to EPWM0_CH1 */ -#define SET_EPWM0_CH2_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EPWM0_CH2_PE5_Msk)) | EPWM0_CH2_PE5 /*!< Set PE5 function to EPWM0_CH2 */ -#define SET_EPWM0_CH2_PG6() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~EPWM0_CH2_PG6_Msk)) | EPWM0_CH2_PG6 /*!< Set PG6 function to EPWM0_CH2 */ -#define SET_EPWM0_CH2_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EPWM0_CH2_PA3_Msk)) | EPWM0_CH2_PA3 /*!< Set PA3 function to EPWM0_CH2 */ -#define SET_EPWM0_CH2_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM0_CH2_PB3_Msk)) | EPWM0_CH2_PB3 /*!< Set PB3 function to EPWM0_CH2 */ -#define SET_EPWM0_CH2_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM0_CH2_PE10_Msk)) | EPWM0_CH2_PE10 /*!< Set PE10 function to EPWM0_CH2 */ -#define SET_EPWM0_CH3_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM0_CH3_PB2_Msk)) | EPWM0_CH3_PB2 /*!< Set PB2 function to EPWM0_CH3 */ -#define SET_EPWM0_CH3_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EPWM0_CH3_PE4_Msk)) | EPWM0_CH3_PE4 /*!< Set PE4 function to EPWM0_CH3 */ -#define SET_EPWM0_CH3_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EPWM0_CH3_PA2_Msk)) | EPWM0_CH3_PA2 /*!< Set PA2 function to EPWM0_CH3 */ -#define SET_EPWM0_CH3_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM0_CH3_PE11_Msk)) | EPWM0_CH3_PE11 /*!< Set PE11 function to EPWM0_CH3 */ -#define SET_EPWM0_CH3_PG5() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~EPWM0_CH3_PG5_Msk)) | EPWM0_CH3_PG5 /*!< Set PG5 function to EPWM0_CH3 */ -#define SET_EPWM0_CH4_PD14() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EPWM0_CH4_PD14_Msk)) | EPWM0_CH4_PD14 /*!< Set PD14 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM0_CH4_PB1_Msk)) | EPWM0_CH4_PB1 /*!< Set PB1 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EPWM0_CH4_PE12_Msk)) | EPWM0_CH4_PE12 /*!< Set PE12 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EPWM0_CH4_PA1_Msk)) | EPWM0_CH4_PA1 /*!< Set PA1 function to EPWM0_CH4 */ -#define SET_EPWM0_CH4_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EPWM0_CH4_PE3_Msk)) | EPWM0_CH4_PE3 /*!< Set PE3 function to EPWM0_CH4 */ -#define SET_EPWM0_CH5_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EPWM0_CH5_PE13_Msk)) | EPWM0_CH5_PE13 /*!< Set PE13 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EPWM0_CH5_PA0_Msk)) | EPWM0_CH5_PA0 /*!< Set PA0 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM0_CH5_PB0_Msk)) | EPWM0_CH5_PB0 /*!< Set PB0 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EPWM0_CH5_PE2_Msk)) | EPWM0_CH5_PE2 /*!< Set PE2 function to EPWM0_CH5 */ -#define SET_EPWM0_CH5_PH11() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~EPWM0_CH5_PH11_Msk)) | EPWM0_CH5_PH11 /*!< Set PH11 function to EPWM0_CH5 */ -#define SET_EPWM0_SYNC_IN_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~EPWM0_SYNC_IN_PA15_Msk)) | EPWM0_SYNC_IN_PA15/*!< Set PA15 function to EPWM0_SYNC_IN */ -#define SET_EPWM0_SYNC_IN_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EPWM0_SYNC_IN_PC14_Msk)) | EPWM0_SYNC_IN_PC14/*!< Set PC14 function to EPWM0_SYNC_IN */ -#define SET_EPWM0_SYNC_OUT_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EPWM0_SYNC_OUT_PA11_Msk)) | EPWM0_SYNC_OUT_PA11/*!< Set PA11 function to EPWM0_SYNC_OUT */ -#define SET_EPWM0_SYNC_OUT_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EPWM0_SYNC_OUT_PF5_Msk)) | EPWM0_SYNC_OUT_PF5/*!< Set PF5 function to EPWM0_SYNC_OUT */ -#define SET_EPWM1_BRAKE0_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EPWM1_BRAKE0_PB7_Msk)) | EPWM1_BRAKE0_PB7 /*!< Set PB7 function to EPWM1_BRAKE0 */ -#define SET_EPWM1_BRAKE0_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM1_BRAKE0_PE10_Msk)) | EPWM1_BRAKE0_PE10 /*!< Set PE10 function to EPWM1_BRAKE0 */ -#define SET_EPWM1_BRAKE1_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EPWM1_BRAKE1_PA3_Msk)) | EPWM1_BRAKE1_PA3 /*!< Set PA3 function to EPWM1_BRAKE1 */ -#define SET_EPWM1_BRAKE1_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EPWM1_BRAKE1_PE11_Msk)) | EPWM1_BRAKE1_PE11 /*!< Set PE11 function to EPWM1_BRAKE1 */ -#define SET_EPWM1_BRAKE1_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EPWM1_BRAKE1_PB6_Msk)) | EPWM1_BRAKE1_PB6 /*!< Set PB6 function to EPWM1_BRAKE1 */ -#define SET_EPWM1_CH0_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EPWM1_CH0_PC5_Msk)) | EPWM1_CH0_PC5 /*!< Set PC5 function to EPWM1_CH0 */ -#define SET_EPWM1_CH0_PI12() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~EPWM1_CH0_PI12_Msk)) | EPWM1_CH0_PI12 /*!< Set PI12 function to EPWM1_CH0 */ -#define SET_EPWM1_CH0_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EPWM1_CH0_PB15_Msk)) | EPWM1_CH0_PB15 /*!< Set PB15 function to EPWM1_CH0 */ -#define SET_EPWM1_CH0_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~EPWM1_CH0_PE13_Msk)) | EPWM1_CH0_PE13 /*!< Set PE13 function to EPWM1_CH0 */ -#define SET_EPWM1_CH0_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~EPWM1_CH0_PC12_Msk)) | EPWM1_CH0_PC12 /*!< Set PC12 function to EPWM1_CH0 */ -#define SET_EPWM1_CH1_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EPWM1_CH1_PB14_Msk)) | EPWM1_CH1_PB14 /*!< Set PB14 function to EPWM1_CH1 */ -#define SET_EPWM1_CH1_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EPWM1_CH1_PC8_Msk)) | EPWM1_CH1_PC8 /*!< Set PC8 function to EPWM1_CH1 */ -#define SET_EPWM1_CH1_PI13() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~EPWM1_CH1_PI13_Msk)) | EPWM1_CH1_PI13 /*!< Set PI13 function to EPWM1_CH1 */ -#define SET_EPWM1_CH1_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EPWM1_CH1_PC4_Msk)) | EPWM1_CH1_PC4 /*!< Set PC4 function to EPWM1_CH1 */ -#define SET_EPWM1_CH1_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EPWM1_CH1_PC11_Msk)) | EPWM1_CH1_PC11 /*!< Set PC11 function to EPWM1_CH1 */ -#define SET_EPWM1_CH2_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EPWM1_CH2_PC10_Msk)) | EPWM1_CH2_PC10 /*!< Set PC10 function to EPWM1_CH2 */ -#define SET_EPWM1_CH2_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EPWM1_CH2_PB13_Msk)) | EPWM1_CH2_PB13 /*!< Set PB13 function to EPWM1_CH2 */ -#define SET_EPWM1_CH2_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EPWM1_CH2_PC7_Msk)) | EPWM1_CH2_PC7 /*!< Set PC7 function to EPWM1_CH2 */ -#define SET_EPWM1_CH2_PI14() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~EPWM1_CH2_PI14_Msk)) | EPWM1_CH2_PI14 /*!< Set PI14 function to EPWM1_CH2 */ -#define SET_EPWM1_CH2_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EPWM1_CH2_PC3_Msk)) | EPWM1_CH2_PC3 /*!< Set PC3 function to EPWM1_CH2 */ -#define SET_EPWM1_CH3_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~EPWM1_CH3_PC9_Msk)) | EPWM1_CH3_PC9 /*!< Set PC9 function to EPWM1_CH3 */ -#define SET_EPWM1_CH3_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EPWM1_CH3_PC2_Msk)) | EPWM1_CH3_PC2 /*!< Set PC2 function to EPWM1_CH3 */ -#define SET_EPWM1_CH3_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~EPWM1_CH3_PC6_Msk)) | EPWM1_CH3_PC6 /*!< Set PC6 function to EPWM1_CH3 */ -#define SET_EPWM1_CH3_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~EPWM1_CH3_PB12_Msk)) | EPWM1_CH3_PB12 /*!< Set PB12 function to EPWM1_CH3 */ -#define SET_EPWM1_CH3_PI15() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~EPWM1_CH3_PI15_Msk)) | EPWM1_CH3_PI15 /*!< Set PI15 function to EPWM1_CH3 */ -#define SET_EPWM1_CH4_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EPWM1_CH4_PB7_Msk)) | EPWM1_CH4_PB7 /*!< Set PB7 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM1_CH4_PB1_Msk)) | EPWM1_CH4_PB1 /*!< Set PB1 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PJ0() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~EPWM1_CH4_PJ0_Msk)) | EPWM1_CH4_PJ0 /*!< Set PJ0 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~EPWM1_CH4_PF0_Msk)) | EPWM1_CH4_PF0 /*!< Set PF0 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EPWM1_CH4_PA7_Msk)) | EPWM1_CH4_PA7 /*!< Set PA7 function to EPWM1_CH4 */ -#define SET_EPWM1_CH4_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EPWM1_CH4_PC1_Msk)) | EPWM1_CH4_PC1 /*!< Set PC1 function to EPWM1_CH4 */ -#define SET_EPWM1_CH5_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~EPWM1_CH5_PF1_Msk)) | EPWM1_CH5_PF1 /*!< Set PF1 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~EPWM1_CH5_PB0_Msk)) | EPWM1_CH5_PB0 /*!< Set PB0 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EPWM1_CH5_PA6_Msk)) | EPWM1_CH5_PA6 /*!< Set PA6 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PJ1() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~EPWM1_CH5_PJ1_Msk)) | EPWM1_CH5_PJ1 /*!< Set PJ1 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~EPWM1_CH5_PC0_Msk)) | EPWM1_CH5_PC0 /*!< Set PC0 function to EPWM1_CH5 */ -#define SET_EPWM1_CH5_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~EPWM1_CH5_PB6_Msk)) | EPWM1_CH5_PB6 /*!< Set PB6 function to EPWM1_CH5 */ -#define SET_ETMC_TRACE_CLK_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~ETMC_TRACE_CLK_PC14_Msk)) | ETMC_TRACE_CLK_PC14 /*!< Set PC14 function to ETMC_TRACE_CLK */ -#define SET_ETMC_TRACE_DATA0_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ETMC_TRACE_DATA0_PB15_Msk)) | ETMC_TRACE_DATA0_PB15 /*!< Set PB15 function to ETMC_TRACE_DATA0 */ -#define SET_ETMC_TRACE_DATA1_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ETMC_TRACE_DATA1_PB14_Msk)) | ETMC_TRACE_DATA1_PB14 /*!< Set PB14 function to ETMC_TRACE_DATA1 */ -#define SET_ETMC_TRACE_DATA2_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ETMC_TRACE_DATA2_PB13_Msk)) | ETMC_TRACE_DATA2_PB13 /*!< Set PB13 function to ETMC_TRACE_DATA2 */ -#define SET_ETMC_TRACE_DATA3_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~ETMC_TRACE_DATA3_PB12_Msk)) | ETMC_TRACE_DATA3_PB12 /*!< Set PB12 function to ETMC_TRACE_DATA3 */ -#define SET_HBI_CK_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~HBI_CK_PC4_Msk)) | HBI_CK_PC4 /*!< Set PC4 function to HBI_CK */ -#define SET_HBI_CK_PH13() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~HBI_CK_PH13_Msk)) | HBI_CK_PH13 /*!< Set PH13 function to HBI_CK */ -#define SET_HBI_D0_PJ6() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~HBI_D0_PJ6_Msk)) | HBI_D0_PJ6 /*!< Set PJ6 function to HBI_D0 */ -#define SET_HBI_D0_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~HBI_D0_PG11_Msk)) | HBI_D0_PG11 /*!< Set PG11 function to HBI_D0 */ -#define SET_HBI_D1_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~HBI_D1_PG12_Msk)) | HBI_D1_PG12 /*!< Set PG12 function to HBI_D1 */ -#define SET_HBI_D1_PJ5() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~HBI_D1_PJ5_Msk)) | HBI_D1_PJ5 /*!< Set PJ5 function to HBI_D1 */ -#define SET_HBI_D2_PJ4() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~HBI_D2_PJ4_Msk)) | HBI_D2_PJ4 /*!< Set PJ4 function to HBI_D2 */ -#define SET_HBI_D2_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~HBI_D2_PC0_Msk)) | HBI_D2_PC0 /*!< Set PC0 function to HBI_D2 */ -#define SET_HBI_D3_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~HBI_D3_PG10_Msk)) | HBI_D3_PG10 /*!< Set PG10 function to HBI_D3 */ -#define SET_HBI_D3_PJ3() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~HBI_D3_PJ3_Msk)) | HBI_D3_PJ3 /*!< Set PJ3 function to HBI_D3 */ -#define SET_HBI_D4_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~HBI_D4_PG9_Msk)) | HBI_D4_PG9 /*!< Set PG9 function to HBI_D4 */ -#define SET_HBI_D4_PH15() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~HBI_D4_PH15_Msk)) | HBI_D4_PH15 /*!< Set PH15 function to HBI_D4 */ -#define SET_HBI_D5_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~HBI_D5_PG13_Msk)) | HBI_D5_PG13 /*!< Set PG13 function to HBI_D5 */ -#define SET_HBI_D5_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~HBI_D5_PD7_Msk)) | HBI_D5_PD7 /*!< Set PD7 function to HBI_D5 */ -#define SET_HBI_D6_PG14() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~HBI_D6_PG14_Msk)) | HBI_D6_PG14 /*!< Set PG14 function to HBI_D6 */ -#define SET_HBI_D6_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~HBI_D6_PD6_Msk)) | HBI_D6_PD6 /*!< Set PD6 function to HBI_D6 */ -#define SET_HBI_D7_PG15() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~HBI_D7_PG15_Msk)) | HBI_D7_PG15 /*!< Set PG15 function to HBI_D7 */ -#define SET_HBI_D7_PD5() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~HBI_D7_PD5_Msk)) | HBI_D7_PD5 /*!< Set PD5 function to HBI_D7 */ -#define SET_HBI_RWDS_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~HBI_RWDS_PC1_Msk)) | HBI_RWDS_PC1 /*!< Set PC1 function to HBI_RWDS */ -#define SET_HBI_RWDS_PH14() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~HBI_RWDS_PH14_Msk)) | HBI_RWDS_PH14 /*!< Set PH14 function to HBI_RWDS */ -#define SET_HBI_nCK_PH12() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~HBI_nCK_PH12_Msk)) | HBI_nCK_PH12 /*!< Set PH12 function to HBI_nCK */ -#define SET_HBI_nCK_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~HBI_nCK_PC5_Msk)) | HBI_nCK_PC5 /*!< Set PC5 function to HBI_nCK */ -#define SET_HBI_nCS_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~HBI_nCS_PC3_Msk)) | HBI_nCS_PC3 /*!< Set PC3 function to HBI_nCS */ -#define SET_HBI_nCS_PJ7() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~HBI_nCS_PJ7_Msk)) | HBI_nCS_PJ7 /*!< Set PJ7 function to HBI_nCS */ -#define SET_HBI_nRESET_PJ2() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~HBI_nRESET_PJ2_Msk)) | HBI_nRESET_PJ2 /*!< Set PJ7 function to HBI_nRESET */ -#define SET_HBI_nRESET_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~HBI_nRESET_PC2_Msk)) | HBI_nRESET_PC2 /*!< Set PC2 function to HBI_nRESET */ -#define SET_HSUSB_VBUS_EN_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~HSUSB_VBUS_EN_PB10_Msk)) | HSUSB_VBUS_EN_PB10/*!< Set PB10 function to HSUSB_VBUS_EN */ -#define SET_HSUSB_VBUS_EN_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~HSUSB_VBUS_EN_PB15_Msk)) | HSUSB_VBUS_EN_PB15/*!< Set PB15 function to HSUSB_VBUS_EN */ -#define SET_HSUSB_VBUS_EN_PJ13() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~HSUSB_VBUS_EN_PJ13_Msk)) | HSUSB_VBUS_EN_PJ13/*!< Set PJ13 function to HSUSB_VBUS_EN */ -#define SET_HSUSB_VBUS_ST_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~HSUSB_VBUS_ST_PB11_Msk)) | HSUSB_VBUS_ST_PB11/*!< Set PB11 function to HSUSB_VBUS_ST */ -#define SET_HSUSB_VBUS_ST_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~HSUSB_VBUS_ST_PC14_Msk)) | HSUSB_VBUS_ST_PC14/*!< Set PC14 function to HSUSB_VBUS_ST */ -#define SET_HSUSB_VBUS_ST_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~HSUSB_VBUS_ST_PJ12_Msk)) | HSUSB_VBUS_ST_PJ12/*!< Set PJ12 function to HSUSB_VBUS_ST */ -#define SET_I2C0_SCL_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~I2C0_SCL_PB9_Msk)) | I2C0_SCL_PB9 /*!< Set PB9 function to I2C0_SCL */ -#define SET_I2C0_SCL_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C0_SCL_PF0_Msk)) | I2C0_SCL_PF0 /*!< Set PF0 function to I2C0_SCL */ -#define SET_I2C0_SCL_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~I2C0_SCL_PD7_Msk)) | I2C0_SCL_PD7 /*!< Set PD7 function to I2C0_SCL */ -#define SET_I2C0_SCL_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~I2C0_SCL_PA5_Msk)) | I2C0_SCL_PA5 /*!< Set PA5 function to I2C0_SCL */ -#define SET_I2C0_SCL_PH2() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~I2C0_SCL_PH2_Msk)) | I2C0_SCL_PH2 /*!< Set PH2 function to I2C0_SCL */ -#define SET_I2C0_SCL_PG0() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C0_SCL_PG0_Msk)) | I2C0_SCL_PG0 /*!< Set PG0 function to I2C0_SCL */ -#define SET_I2C0_SCL_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~I2C0_SCL_PC12_Msk)) | I2C0_SCL_PC12 /*!< Set PC12 function to I2C0_SCL */ -#define SET_I2C0_SCL_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2C0_SCL_PC1_Msk)) | I2C0_SCL_PC1 /*!< Set PC1 function to I2C0_SCL */ -#define SET_I2C0_SCL_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~I2C0_SCL_PB5_Msk)) | I2C0_SCL_PB5 /*!< Set PB5 function to I2C0_SCL */ -#define SET_I2C0_SCL_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~I2C0_SCL_PE13_Msk)) | I2C0_SCL_PE13 /*!< Set PE13 function to I2C0_SCL */ -#define SET_I2C0_SCL_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C0_SCL_PF3_Msk)) | I2C0_SCL_PF3 /*!< Set PF3 function to I2C0_SCL */ -#define SET_I2C0_SCL_PI10() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~I2C0_SCL_PI10_Msk)) | I2C0_SCL_PI10 /*!< Set PI10 function to I2C0_SCL */ -#define SET_I2C0_SCL_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2C0_SCL_PA14_Msk)) | I2C0_SCL_PA14 /*!< Set PA14 function to I2C0_SCL */ -#define SET_I2C0_SDA_PI11() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~I2C0_SDA_PI11_Msk)) | I2C0_SDA_PI11 /*!< Set PI11 function to I2C0_SDA */ -#define SET_I2C0_SDA_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C0_SDA_PF2_Msk)) | I2C0_SDA_PF2 /*!< Set PF2 function to I2C0_SDA */ -#define SET_I2C0_SDA_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~I2C0_SDA_PB4_Msk)) | I2C0_SDA_PB4 /*!< Set PB4 function to I2C0_SDA */ -#define SET_I2C0_SDA_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C0_SDA_PF1_Msk)) | I2C0_SDA_PF1 /*!< Set PF1 function to I2C0_SDA */ -#define SET_I2C0_SDA_PH3() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~I2C0_SDA_PH3_Msk)) | I2C0_SDA_PH3 /*!< Set PH3 function to I2C0_SDA */ -#define SET_I2C0_SDA_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C0_SDA_PG1_Msk)) | I2C0_SDA_PG1 /*!< Set PG1 function to I2C0_SDA */ -#define SET_I2C0_SDA_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~I2C0_SDA_PA4_Msk)) | I2C0_SDA_PA4 /*!< Set PA4 function to I2C0_SDA */ -#define SET_I2C0_SDA_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~I2C0_SDA_PC11_Msk)) | I2C0_SDA_PC11 /*!< Set PC11 function to I2C0_SDA */ -#define SET_I2C0_SDA_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~I2C0_SDA_PD6_Msk)) | I2C0_SDA_PD6 /*!< Set PD6 function to I2C0_SDA */ -#define SET_I2C0_SDA_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2C0_SDA_PC0_Msk)) | I2C0_SDA_PC0 /*!< Set PC0 function to I2C0_SDA */ -#define SET_I2C0_SDA_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~I2C0_SDA_PC8_Msk)) | I2C0_SDA_PC8 /*!< Set PC8 function to I2C0_SDA */ -#define SET_I2C0_SDA_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~I2C0_SDA_PB8_Msk)) | I2C0_SDA_PB8 /*!< Set PB8 function to I2C0_SDA */ -#define SET_I2C0_SDA_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2C0_SDA_PA15_Msk)) | I2C0_SDA_PA15 /*!< Set PA15 function to I2C0_SDA */ -#define SET_I2C0_SMBAL_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2C0_SMBAL_PC3_Msk)) | I2C0_SMBAL_PC3 /*!< Set PC3 function to I2C0_SMBAL */ -#define SET_I2C0_SMBAL_PG2() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C0_SMBAL_PG2_Msk)) | I2C0_SMBAL_PG2 /*!< Set PG2 function to I2C0_SMBAL */ -#define SET_I2C0_SMBAL_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~I2C0_SMBAL_PA3_Msk)) | I2C0_SMBAL_PA3 /*!< Set PA3 function to I2C0_SMBAL */ -#define SET_I2C0_SMBAL_PI8() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~I2C0_SMBAL_PI8_Msk)) | I2C0_SMBAL_PI8 /*!< Set PI8 function to I2C0_SMBAL */ -#define SET_I2C0_SMBSUS_PI9() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~I2C0_SMBSUS_PI9_Msk)) | I2C0_SMBSUS_PI9 /*!< Set PI9 function to I2C0_SMBSUS */ -#define SET_I2C0_SMBSUS_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~I2C0_SMBSUS_PA2_Msk)) | I2C0_SMBSUS_PA2 /*!< Set PA2 function to I2C0_SMBSUS */ -#define SET_I2C0_SMBSUS_PG3() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C0_SMBSUS_PG3_Msk)) | I2C0_SMBSUS_PG3 /*!< Set PG3 function to I2C0_SMBSUS */ -#define SET_I2C0_SMBSUS_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2C0_SMBSUS_PC2_Msk)) | I2C0_SMBSUS_PC2 /*!< Set PC2 function to I2C0_SMBSUS */ -#define SET_I2C1_SCL_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C1_SCL_PF0_Msk)) | I2C1_SCL_PF0 /*!< Set PF0 function to I2C1_SCL */ -#define SET_I2C1_SCL_PD5() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~I2C1_SCL_PD5_Msk)) | I2C1_SCL_PD5 /*!< Set PD5 function to I2C1_SCL */ -#define SET_I2C1_SCL_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2C1_SCL_PB1_Msk)) | I2C1_SCL_PB1 /*!< Set PB1 function to I2C1_SCL */ -#define SET_I2C1_SCL_PI6() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~I2C1_SCL_PI6_Msk)) | I2C1_SCL_PI6 /*!< Set PI6 function to I2C1_SCL */ -#define SET_I2C1_SCL_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2C1_SCL_PB3_Msk)) | I2C1_SCL_PB3 /*!< Set PB3 function to I2C1_SCL */ -#define SET_I2C1_SCL_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2C1_SCL_PA12_Msk)) | I2C1_SCL_PA12 /*!< Set PA12 function to I2C1_SCL */ -#define SET_I2C1_SCL_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~I2C1_SCL_PE1_Msk)) | I2C1_SCL_PE1 /*!< Set PE1 function to I2C1_SCL */ -#define SET_I2C1_SCL_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~I2C1_SCL_PB11_Msk)) | I2C1_SCL_PB11 /*!< Set PB11 function to I2C1_SCL */ -#define SET_I2C1_SCL_PG2() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C1_SCL_PG2_Msk)) | I2C1_SCL_PG2 /*!< Set PG2 function to I2C1_SCL */ -#define SET_I2C1_SCL_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~I2C1_SCL_PA7_Msk)) | I2C1_SCL_PA7 /*!< Set PA7 function to I2C1_SCL */ -#define SET_I2C1_SCL_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~I2C1_SCL_PC5_Msk)) | I2C1_SCL_PC5 /*!< Set PC5 function to I2C1_SCL */ -#define SET_I2C1_SCL_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~I2C1_SCL_PA3_Msk)) | I2C1_SCL_PA3 /*!< Set PA3 function to I2C1_SCL */ -#define SET_I2C1_SDA_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2C1_SDA_PB0_Msk)) | I2C1_SDA_PB0 /*!< Set PB0 function to I2C1_SDA */ -#define SET_I2C1_SDA_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~I2C1_SDA_PA2_Msk)) | I2C1_SDA_PA2 /*!< Set PA2 function to I2C1_SDA */ -#define SET_I2C1_SDA_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2C1_SDA_PB2_Msk)) | I2C1_SDA_PB2 /*!< Set PB2 function to I2C1_SDA */ -#define SET_I2C1_SDA_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~I2C1_SDA_PC4_Msk)) | I2C1_SDA_PC4 /*!< Set PC4 function to I2C1_SDA */ -#define SET_I2C1_SDA_PI7() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~I2C1_SDA_PI7_Msk)) | I2C1_SDA_PI7 /*!< Set PI7 function to I2C1_SDA */ -#define SET_I2C1_SDA_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C1_SDA_PF1_Msk)) | I2C1_SDA_PF1 /*!< Set PF1 function to I2C1_SDA */ -#define SET_I2C1_SDA_PD4() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~I2C1_SDA_PD4_Msk)) | I2C1_SDA_PD4 /*!< Set PD4 function to I2C1_SDA */ -#define SET_I2C1_SDA_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2C1_SDA_PA13_Msk)) | I2C1_SDA_PA13 /*!< Set PA13 function to I2C1_SDA */ -#define SET_I2C1_SDA_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~I2C1_SDA_PB10_Msk)) | I2C1_SDA_PB10 /*!< Set PB10 function to I2C1_SDA */ -#define SET_I2C1_SDA_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~I2C1_SDA_PA6_Msk)) | I2C1_SDA_PA6 /*!< Set PA6 function to I2C1_SDA */ -#define SET_I2C1_SDA_PG3() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C1_SDA_PG3_Msk)) | I2C1_SDA_PG3 /*!< Set PG3 function to I2C1_SDA */ -#define SET_I2C1_SDA_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~I2C1_SDA_PE0_Msk)) | I2C1_SDA_PE0 /*!< Set PE0 function to I2C1_SDA */ -#define SET_I2C1_SMBAL_PG0() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C1_SMBAL_PG0_Msk)) | I2C1_SMBAL_PG0 /*!< Set PG0 function to I2C1_SMBAL */ -#define SET_I2C1_SMBAL_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~I2C1_SMBAL_PC7_Msk)) | I2C1_SMBAL_PC7 /*!< Set PC7 function to I2C1_SMBAL */ -#define SET_I2C1_SMBAL_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~I2C1_SMBAL_PB9_Msk)) | I2C1_SMBAL_PB9 /*!< Set PB9 function to I2C1_SMBAL */ -#define SET_I2C1_SMBAL_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~I2C1_SMBAL_PH8_Msk)) | I2C1_SMBAL_PH8 /*!< Set PH8 function to I2C1_SMBAL */ -#define SET_I2C1_SMBSUS_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~I2C1_SMBSUS_PH9_Msk)) | I2C1_SMBSUS_PH9 /*!< Set PH9 function to I2C1_SMBSUS */ -#define SET_I2C1_SMBSUS_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~I2C1_SMBSUS_PC6_Msk)) | I2C1_SMBSUS_PC6 /*!< Set PC6 function to I2C1_SMBSUS */ -#define SET_I2C1_SMBSUS_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C1_SMBSUS_PG1_Msk)) | I2C1_SMBSUS_PG1 /*!< Set PG1 function to I2C1_SMBSUS */ -#define SET_I2C1_SMBSUS_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~I2C1_SMBSUS_PB8_Msk)) | I2C1_SMBSUS_PB8 /*!< Set PB8 function to I2C1_SMBSUS */ -#define SET_I2C2_SCL_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~I2C2_SCL_PA1_Msk)) | I2C2_SCL_PA1 /*!< Set PA1 function to I2C2_SCL */ -#define SET_I2C2_SCL_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~I2C2_SCL_PH8_Msk)) | I2C2_SCL_PH8 /*!< Set PH8 function to I2C2_SCL */ -#define SET_I2C2_SCL_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~I2C2_SCL_PB13_Msk)) | I2C2_SCL_PB13 /*!< Set PB13 function to I2C2_SCL */ -#define SET_I2C2_SCL_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~I2C2_SCL_PA11_Msk)) | I2C2_SCL_PA11 /*!< Set PA11 function to I2C2_SCL */ -#define SET_I2C2_SCL_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2C2_SCL_PA14_Msk)) | I2C2_SCL_PA14 /*!< Set PA14 function to I2C2_SCL */ -#define SET_I2C2_SCL_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~I2C2_SCL_PD1_Msk)) | I2C2_SCL_PD1 /*!< Set PD1 function to I2C2_SCL */ -#define SET_I2C2_SCL_PD9() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~I2C2_SCL_PD9_Msk)) | I2C2_SCL_PD9 /*!< Set PD9 function to I2C2_SCL */ -#define SET_I2C2_SDA_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~I2C2_SDA_PB12_Msk)) | I2C2_SDA_PB12 /*!< Set PB12 function to I2C2_SDA */ -#define SET_I2C2_SDA_PD8() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~I2C2_SDA_PD8_Msk)) | I2C2_SDA_PD8 /*!< Set PD8 function to I2C2_SDA */ -#define SET_I2C2_SDA_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~I2C2_SDA_PA0_Msk)) | I2C2_SDA_PA0 /*!< Set PA0 function to I2C2_SDA */ -#define SET_I2C2_SDA_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~I2C2_SDA_PH9_Msk)) | I2C2_SDA_PH9 /*!< Set PH9 function to I2C2_SDA */ -#define SET_I2C2_SDA_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2C2_SDA_PA15_Msk)) | I2C2_SDA_PA15 /*!< Set PA15 function to I2C2_SDA */ -#define SET_I2C2_SDA_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~I2C2_SDA_PA10_Msk)) | I2C2_SDA_PA10 /*!< Set PA10 function to I2C2_SDA */ -#define SET_I2C2_SDA_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~I2C2_SDA_PD0_Msk)) | I2C2_SDA_PD0 /*!< Set PD0 function to I2C2_SDA */ -#define SET_I2C2_SMBAL_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~I2C2_SMBAL_PB15_Msk)) | I2C2_SMBAL_PB15 /*!< Set PB15 function to I2C2_SMBAL */ -#define SET_I2C2_SMBSUS_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~I2C2_SMBSUS_PB14_Msk)) | I2C2_SMBSUS_PB14 /*!< Set PB14 function to I2C2_SMBSUS */ -#define SET_I2C3_SCL_PG7() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~I2C3_SCL_PG7_Msk)) | I2C3_SCL_PG7 /*!< Set PG7 function to I2C3_SCL */ -#define SET_I2C3_SCL_PG0() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C3_SCL_PG0_Msk)) | I2C3_SCL_PG0 /*!< Set PG0 function to I2C3_SCL */ -#define SET_I2C3_SCL_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2C3_SCL_PC3_Msk)) | I2C3_SCL_PC3 /*!< Set PC3 function to I2C3_SCL */ -#define SET_I2C3_SCL_PI14() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~I2C3_SCL_PI14_Msk)) | I2C3_SCL_PI14 /*!< Set PI14 function to I2C3_SCL */ -#define SET_I2C3_SDA_PG8() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~I2C3_SDA_PG8_Msk)) | I2C3_SDA_PG8 /*!< Set PG8 function to I2C3_SDA */ -#define SET_I2C3_SDA_PI15() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~I2C3_SDA_PI15_Msk)) | I2C3_SDA_PI15 /*!< Set PI15 function to I2C3_SDA */ -#define SET_I2C3_SDA_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2C3_SDA_PC2_Msk)) | I2C3_SDA_PC2 /*!< Set PC2 function to I2C3_SDA */ -#define SET_I2C3_SDA_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C3_SDA_PG1_Msk)) | I2C3_SDA_PG1 /*!< Set PG1 function to I2C3_SDA */ -#define SET_I2C3_SMBAL_PG2() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C3_SMBAL_PG2_Msk)) | I2C3_SMBAL_PG2 /*!< Set PG2 function to I2C3_SMBAL */ -#define SET_I2C3_SMBAL_PI12() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~I2C3_SMBAL_PI12_Msk)) | I2C3_SMBAL_PI12 /*!< Set PI12 function to I2C3_SMBAL */ -#define SET_I2C3_SMBAL_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~I2C3_SMBAL_PC5_Msk)) | I2C3_SMBAL_PC5 /*!< Set PC5 function to I2C3_SMBAL */ -#define SET_I2C3_SMBAL_PG5() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~I2C3_SMBAL_PG5_Msk)) | I2C3_SMBAL_PG5 /*!< Set PG5 function to I2C3_SMBAL */ -#define SET_I2C3_SMBSUS_PG6() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~I2C3_SMBSUS_PG6_Msk)) | I2C3_SMBSUS_PG6 /*!< Set PG6 function to I2C3_SMBSUS */ -#define SET_I2C3_SMBSUS_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~I2C3_SMBSUS_PC4_Msk)) | I2C3_SMBSUS_PC4 /*!< Set PC4 function to I2C3_SMBSUS */ -#define SET_I2C3_SMBSUS_PG3() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~I2C3_SMBSUS_PG3_Msk)) | I2C3_SMBSUS_PG3 /*!< Set PG3 function to I2C3_SMBSUS */ -#define SET_I2C3_SMBSUS_PI13() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~I2C3_SMBSUS_PI13_Msk)) | I2C3_SMBSUS_PI13 /*!< Set PI13 function to I2C3_SMBSUS */ -#define SET_I2C4_SCL_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~I2C4_SCL_PJ10_Msk)) | I2C4_SCL_PJ10 /*!< Set PJ10 function to I2C4_SCL */ -#define SET_I2C4_SCL_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~I2C4_SCL_PG9_Msk)) | I2C4_SCL_PG9 /*!< Set PG9 function to I2C4_SCL */ -#define SET_I2C4_SCL_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~I2C4_SCL_PC12_Msk)) | I2C4_SCL_PC12 /*!< Set PC12 function to I2C4_SCL */ -#define SET_I2C4_SCL_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~I2C4_SCL_PF5_Msk)) | I2C4_SCL_PF5 /*!< Set PF5 function to I2C4_SCL */ -#define SET_I2C4_SDA_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~I2C4_SDA_PJ11_Msk)) | I2C4_SDA_PJ11 /*!< Set PJ11 function to I2C4_SDA */ -#define SET_I2C4_SDA_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~I2C4_SDA_PG10_Msk)) | I2C4_SDA_PG10 /*!< Set PG10 function to I2C4_SDA */ -#define SET_I2C4_SDA_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~I2C4_SDA_PC11_Msk)) | I2C4_SDA_PC11 /*!< Set PC11 function to I2C4_SDA */ -#define SET_I2C4_SDA_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~I2C4_SDA_PF4_Msk)) | I2C4_SDA_PF4 /*!< Set PF4 function to I2C4_SDA */ -#define SET_I2C4_SMBAL_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~I2C4_SMBAL_PJ12_Msk)) | I2C4_SMBAL_PJ12 /*!< Set PJ12 function to I2C4_SMBAL */ -#define SET_I2C4_SMBAL_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~I2C4_SMBAL_PG11_Msk)) | I2C4_SMBAL_PG11 /*!< Set PG11 function to I2C4_SMBAL */ -#define SET_I2C4_SMBAL_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C4_SMBAL_PF3_Msk)) | I2C4_SMBAL_PF3 /*!< Set PF3 function to I2C4_SMBAL */ -#define SET_I2C4_SMBAL_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~I2C4_SMBAL_PC10_Msk)) | I2C4_SMBAL_PC10 /*!< Set PC10 function to I2C4_SMBAL */ -#define SET_I2C4_SMBSUS_PJ13() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~I2C4_SMBSUS_PJ13_Msk)) | I2C4_SMBSUS_PJ13 /*!< Set PJ13 function to I2C4_SMBSUS */ -#define SET_I2C4_SMBSUS_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~I2C4_SMBSUS_PG12_Msk)) | I2C4_SMBSUS_PG12 /*!< Set PG12 function to I2C4_SMBSUS */ -#define SET_I2C4_SMBSUS_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~I2C4_SMBSUS_PC9_Msk)) | I2C4_SMBSUS_PC9 /*!< Set PC9 function to I2C4_SMBSUS */ -#define SET_I2C4_SMBSUS_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2C4_SMBSUS_PF2_Msk)) | I2C4_SMBSUS_PF2 /*!< Set PF2 function to I2C4_SMBSUS */ -#define SET_I2S0_BCLK_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~I2S0_BCLK_PE8_Msk)) | I2S0_BCLK_PE8 /*!< Set PE8 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~I2S0_BCLK_PF10_Msk)) | I2S0_BCLK_PF10 /*!< Set PF10 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~I2S0_BCLK_PE1_Msk)) | I2S0_BCLK_PE1 /*!< Set PE1 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2S0_BCLK_PA12_Msk)) | I2S0_BCLK_PA12 /*!< Set PA12 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~I2S0_BCLK_PB5_Msk)) | I2S0_BCLK_PB5 /*!< Set PB5 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PI6() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~I2S0_BCLK_PI6_Msk)) | I2S0_BCLK_PI6 /*!< Set PI6 function to I2S0_BCLK */ -#define SET_I2S0_BCLK_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~I2S0_BCLK_PC4_Msk)) | I2S0_BCLK_PC4 /*!< Set PC4 function to I2S0_BCLK */ -#define SET_I2S0_DI_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2S0_DI_PB3_Msk)) | I2S0_DI_PB3 /*!< Set PB3 function to I2S0_DI */ -#define SET_I2S0_DI_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2S0_DI_PC2_Msk)) | I2S0_DI_PC2 /*!< Set PC2 function to I2S0_DI */ -#define SET_I2S0_DI_PI8() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~I2S0_DI_PI8_Msk)) | I2S0_DI_PI8 /*!< Set PI8 function to I2S0_DI */ -#define SET_I2S0_DI_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2S0_DI_PA14_Msk)) | I2S0_DI_PA14 /*!< Set PA14 function to I2S0_DI */ -#define SET_I2S0_DI_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~I2S0_DI_PF8_Msk)) | I2S0_DI_PF8 /*!< Set PF8 function to I2S0_DI */ -#define SET_I2S0_DI_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~I2S0_DI_PH8_Msk)) | I2S0_DI_PH8 /*!< Set PH8 function to I2S0_DI */ -#define SET_I2S0_DI_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~I2S0_DI_PE10_Msk)) | I2S0_DI_PE10 /*!< Set PE10 function to I2S0_DI */ -#define SET_I2S0_DO_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~I2S0_DO_PH9_Msk)) | I2S0_DO_PH9 /*!< Set PH9 function to I2S0_DO */ -#define SET_I2S0_DO_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2S0_DO_PC1_Msk)) | I2S0_DO_PC1 /*!< Set PC1 function to I2S0_DO */ -#define SET_I2S0_DO_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2S0_DO_PA15_Msk)) | I2S0_DO_PA15 /*!< Set PA15 function to I2S0_DO */ -#define SET_I2S0_DO_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2S0_DO_PB2_Msk)) | I2S0_DO_PB2 /*!< Set PB2 function to I2S0_DO */ -#define SET_I2S0_DO_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~I2S0_DO_PF7_Msk)) | I2S0_DO_PF7 /*!< Set PF7 function to I2S0_DO */ -#define SET_I2S0_DO_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2S0_DO_PF0_Msk)) | I2S0_DO_PF0 /*!< Set PF0 function to I2S0_DO */ -#define SET_I2S0_DO_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~I2S0_DO_PE11_Msk)) | I2S0_DO_PE11 /*!< Set PE11 function to I2S0_DO */ -#define SET_I2S0_DO_PI9() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~I2S0_DO_PI9_Msk)) | I2S0_DO_PI9 /*!< Set PI9 function to I2S0_DO */ -#define SET_I2S0_LRCK_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~I2S0_LRCK_PF6_Msk)) | I2S0_LRCK_PF6 /*!< Set PF6 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~I2S0_LRCK_PE12_Msk)) | I2S0_LRCK_PE12 /*!< Set PE12 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~I2S0_LRCK_PH10_Msk)) | I2S0_LRCK_PH10 /*!< Set PH10 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2S0_LRCK_PB1_Msk)) | I2S0_LRCK_PB1 /*!< Set PB1 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~I2S0_LRCK_PF1_Msk)) | I2S0_LRCK_PF1 /*!< Set PF1 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2S0_LRCK_PC0_Msk)) | I2S0_LRCK_PC0 /*!< Set PC0 function to I2S0_LRCK */ -#define SET_I2S0_LRCK_PI10() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~I2S0_LRCK_PI10_Msk)) | I2S0_LRCK_PI10 /*!< Set PI10 function to I2S0_LRCK */ -#define SET_I2S0_MCLK_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~I2S0_MCLK_PE0_Msk)) | I2S0_MCLK_PE0 /*!< Set PE0 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~I2S0_MCLK_PB4_Msk)) | I2S0_MCLK_PB4 /*!< Set PB4 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~I2S0_MCLK_PF9_Msk)) | I2S0_MCLK_PF9 /*!< Set PF9 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~I2S0_MCLK_PE9_Msk)) | I2S0_MCLK_PE9 /*!< Set PE9 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PI7() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~I2S0_MCLK_PI7_Msk)) | I2S0_MCLK_PI7 /*!< Set PI7 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~I2S0_MCLK_PA13_Msk)) | I2S0_MCLK_PA13 /*!< Set PA13 function to I2S0_MCLK */ -#define SET_I2S0_MCLK_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~I2S0_MCLK_PC3_Msk)) | I2S0_MCLK_PC3 /*!< Set PC3 function to I2S0_MCLK */ -#define SET_I2S1_BCLK_PD14() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~I2S1_BCLK_PD14_Msk)) | I2S1_BCLK_PD14 /*!< Set PD14 function to I2S1_BCLK */ -#define SET_I2S1_BCLK_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~I2S1_BCLK_PA11_Msk)) | I2S1_BCLK_PA11 /*!< Set PA11 function to I2S1_BCLK */ -#define SET_I2S1_BCLK_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~I2S1_BCLK_PD3_Msk)) | I2S1_BCLK_PD3 /*!< Set PD3 function to I2S1_BCLK */ -#define SET_I2S1_DI_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~I2S1_DI_PD1_Msk)) | I2S1_DI_PD1 /*!< Set PD1 function to I2S1_DI */ -#define SET_I2S1_DI_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~I2S1_DI_PA9_Msk)) | I2S1_DI_PA9 /*!< Set PA9 function to I2S1_DI */ -#define SET_I2S1_DI_PG6() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~I2S1_DI_PG6_Msk)) | I2S1_DI_PG6 /*!< Set PG6 function to I2S1_DI */ -#define SET_I2S1_DO_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~I2S1_DO_PD0_Msk)) | I2S1_DO_PD0 /*!< Set PD0 function to I2S1_DO */ -#define SET_I2S1_DO_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~I2S1_DO_PA8_Msk)) | I2S1_DO_PA8 /*!< Set PA8 function to I2S1_DO */ -#define SET_I2S1_DO_PG7() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~I2S1_DO_PG7_Msk)) | I2S1_DO_PG7 /*!< Set PG7 function to I2S1_DO */ -#define SET_I2S1_LRCK_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~I2S1_LRCK_PB0_Msk)) | I2S1_LRCK_PB0 /*!< Set PB0 function to I2S1_LRCK */ -#define SET_I2S1_LRCK_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~I2S1_LRCK_PD13_Msk)) | I2S1_LRCK_PD13 /*!< Set PD13 function to I2S1_LRCK */ -#define SET_I2S1_LRCK_PG8() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~I2S1_LRCK_PG8_Msk)) | I2S1_LRCK_PG8 /*!< Set PG8 function to I2S1_LRCK */ -#define SET_I2S1_MCLK_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~I2S1_MCLK_PD2_Msk)) | I2S1_MCLK_PD2 /*!< Set PD2 function to I2S1_MCLK */ -#define SET_I2S1_MCLK_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~I2S1_MCLK_PA10_Msk)) | I2S1_MCLK_PA10 /*!< Set PA10 function to I2S1_MCLK */ -#define SET_I2S1_MCLK_PG5() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~I2S1_MCLK_PG5_Msk)) | I2S1_MCLK_PG5 /*!< Set PG5 function to I2S1_MCLK */ -#define SET_ICE_CLK_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~ICE_CLK_PF1_Msk)) | ICE_CLK_PF1 /*!< Set PF1 function to ICE_CLK */ -#define SET_ICE_DAT_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~ICE_DAT_PF0_Msk)) | ICE_DAT_PF0 /*!< Set PF0 function to ICE_DAT */ -#define SET_INT0_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~INT0_PA6_Msk)) | INT0_PA6 /*!< Set PA6 function to INT0 */ -#define SET_INT0_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~INT0_PB5_Msk)) | INT0_PB5 /*!< Set PB5 function to INT0 */ -#define SET_INT1_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~INT1_PA7_Msk)) | INT1_PA7 /*!< Set PA7 function to INT1 */ -#define SET_INT1_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~INT1_PB4_Msk)) | INT1_PB4 /*!< Set PB4 function to INT1 */ -#define SET_INT2_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~INT2_PB3_Msk)) | INT2_PB3 /*!< Set PB3 function to INT2 */ -#define SET_INT2_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~INT2_PC6_Msk)) | INT2_PC6 /*!< Set PC6 function to INT2 */ -#define SET_INT3_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~INT3_PC7_Msk)) | INT3_PC7 /*!< Set PC7 function to INT3 */ -#define SET_INT3_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~INT3_PB2_Msk)) | INT3_PB2 /*!< Set PB2 function to INT3 */ -#define SET_INT4_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~INT4_PA8_Msk)) | INT4_PA8 /*!< Set PA8 function to INT4 */ -#define SET_INT4_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~INT4_PB6_Msk)) | INT4_PB6 /*!< Set PB6 function to INT4 */ -#define SET_INT5_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~INT5_PD12_Msk)) | INT5_PD12 /*!< Set PD12 function to INT5 */ -#define SET_INT5_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~INT5_PB7_Msk)) | INT5_PB7 /*!< Set PB7 function to INT5 */ -#define SET_INT6_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~INT6_PB8_Msk)) | INT6_PB8 /*!< Set PB8 function to INT6 */ -#define SET_INT6_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~INT6_PD11_Msk)) | INT6_PD11 /*!< Set PD11 function to INT6 */ -#define SET_INT7_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~INT7_PB9_Msk)) | INT7_PB9 /*!< Set PB9 function to INT7 */ -#define SET_INT7_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~INT7_PD10_Msk)) | INT7_PD10 /*!< Set PD10 function to INT7 */ -#define SET_TRACE_SWO_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~TRACE_SWO_PF6_Msk)) | TRACE_SWO_PF6 /*!< Set PF6 function to TRACE_SWO */ -#define SET_TRACE_SWO_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~TRACE_SWO_PC14_Msk)) | TRACE_SWO_PC14 /*!< Set PC14 function to TRACE_SWO */ -#define SET_TRACE_SWO_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~TRACE_SWO_PE13_Msk)) | TRACE_SWO_PE13 /*!< Set PE13 function to TRACE_SWO */ -#define SET_KPI_COL0_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~KPI_COL0_PA6_Msk)) | KPI_COL0_PA6 /*!< Set PA6 function to KPI_COL0 */ -#define SET_KPI_COL0_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~KPI_COL0_PB15_Msk)) | KPI_COL0_PB15 /*!< Set PB15 function to KPI_COL0 */ -#define SET_KPI_COL1_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~KPI_COL1_PA7_Msk)) | KPI_COL1_PA7 /*!< Set PA7 function to KPI_COL1 */ -#define SET_KPI_COL1_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~KPI_COL1_PB14_Msk)) | KPI_COL1_PB14 /*!< Set PB14 function to KPI_COL1 */ -#define SET_KPI_COL2_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~KPI_COL2_PC6_Msk)) | KPI_COL2_PC6 /*!< Set PC6 function to KPI_COL2 */ -#define SET_KPI_COL2_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~KPI_COL2_PB13_Msk)) | KPI_COL2_PB13 /*!< Set PB13 function to KPI_COL2 */ -#define SET_KPI_COL3_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~KPI_COL3_PC7_Msk)) | KPI_COL3_PC7 /*!< Set PC7 function to KPI_COL3 */ -#define SET_KPI_COL3_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~KPI_COL3_PB12_Msk)) | KPI_COL3_PB12 /*!< Set PB12 function to KPI_COL3 */ -#define SET_KPI_COL4_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~KPI_COL4_PB7_Msk)) | KPI_COL4_PB7 /*!< Set PB7 function to KPI_COL4 */ -#define SET_KPI_COL4_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~KPI_COL4_PC8_Msk)) | KPI_COL4_PC8 /*!< Set PC8 function to KPI_COL4 */ -#define SET_KPI_COL5_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~KPI_COL5_PB6_Msk)) | KPI_COL5_PB6 /*!< Set PB6 function to KPI_COL5 */ -#define SET_KPI_COL5_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~KPI_COL5_PE13_Msk)) | KPI_COL5_PE13 /*!< Set PE13 function to KPI_COL5 */ -#define SET_KPI_COL6_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~KPI_COL6_PE12_Msk)) | KPI_COL6_PE12 /*!< Set PE12 function to KPI_COL6 */ -#define SET_KPI_COL6_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~KPI_COL6_PB5_Msk)) | KPI_COL6_PB5 /*!< Set PB5 function to KPI_COL6 */ -#define SET_KPI_COL7_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~KPI_COL7_PE11_Msk)) | KPI_COL7_PE11 /*!< Set PE11 function to KPI_COL7 */ -#define SET_KPI_COL7_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~KPI_COL7_PB4_Msk)) | KPI_COL7_PB4 /*!< Set PB4 function to KPI_COL7 */ -#define SET_KPI_ROW0_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~KPI_ROW0_PC5_Msk)) | KPI_ROW0_PC5 /*!< Set PC5 function to KPI_ROW0 */ -#define SET_KPI_ROW0_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~KPI_ROW0_PB3_Msk)) | KPI_ROW0_PB3 /*!< Set PB3 function to KPI_ROW0 */ -#define SET_KPI_ROW1_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~KPI_ROW1_PC4_Msk)) | KPI_ROW1_PC4 /*!< Set PC4 function to KPI_ROW1 */ -#define SET_KPI_ROW1_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~KPI_ROW1_PB2_Msk)) | KPI_ROW1_PB2 /*!< Set PB2 function to KPI_ROW1 */ -#define SET_KPI_ROW2_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~KPI_ROW2_PB1_Msk)) | KPI_ROW2_PB1 /*!< Set PB1 function to KPI_ROW2 */ -#define SET_KPI_ROW2_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~KPI_ROW2_PC3_Msk)) | KPI_ROW2_PC3 /*!< Set PC3 function to KPI_ROW2 */ -#define SET_KPI_ROW3_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~KPI_ROW3_PC2_Msk)) | KPI_ROW3_PC2 /*!< Set PC2 function to KPI_ROW3 */ -#define SET_KPI_ROW3_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~KPI_ROW3_PB0_Msk)) | KPI_ROW3_PB0 /*!< Set PB0 function to KPI_ROW3 */ -#define SET_KPI_ROW4_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~KPI_ROW4_PA11_Msk)) | KPI_ROW4_PA11 /*!< Set PA11 function to KPI_ROW4 */ -#define SET_KPI_ROW4_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~KPI_ROW4_PC1_Msk)) | KPI_ROW4_PC1 /*!< Set PC1 function to KPI_ROW4 */ -#define SET_KPI_ROW5_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~KPI_ROW5_PA10_Msk)) | KPI_ROW5_PA10 /*!< Set PA10 function to KPI_ROW5 */ -#define SET_KPI_ROW5_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~KPI_ROW5_PC0_Msk)) | KPI_ROW5_PC0 /*!< Set PC0 function to KPI_ROW5 */ -#define SET_PSIO0_CH0_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~PSIO0_CH0_PC5_Msk)) | PSIO0_CH0_PC5 /*!< Set PC5 function to PSIO0_CH0 */ -#define SET_PSIO0_CH0_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~PSIO0_CH0_PB15_Msk)) | PSIO0_CH0_PB15 /*!< Set PB15 function to PSIO0_CH0 */ -#define SET_PSIO0_CH0_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~PSIO0_CH0_PE7_Msk)) | PSIO0_CH0_PE7 /*!< Set PE7 function to PSIO0_CH0 */ -#define SET_PSIO0_CH0_PE14() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~PSIO0_CH0_PE14_Msk)) | PSIO0_CH0_PE14 /*!< Set PE14 function to PSIO0_CH0 */ -#define SET_PSIO0_CH1_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~PSIO0_CH1_PC4_Msk)) | PSIO0_CH1_PC4 /*!< Set PC4 function to PSIO0_CH1 */ -#define SET_PSIO0_CH1_PE15() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~PSIO0_CH1_PE15_Msk)) | PSIO0_CH1_PE15 /*!< Set PE15 function to PSIO0_CH1 */ -#define SET_PSIO0_CH1_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~PSIO0_CH1_PE6_Msk)) | PSIO0_CH1_PE6 /*!< Set PE6 function to PSIO0_CH1 */ -#define SET_PSIO0_CH1_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~PSIO0_CH1_PB14_Msk)) | PSIO0_CH1_PB14 /*!< Set PB14 function to PSIO0_CH1 */ -#define SET_PSIO0_CH2_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~PSIO0_CH2_PC3_Msk)) | PSIO0_CH2_PC3 /*!< Set PC3 function to PSIO0_CH2 */ -#define SET_PSIO0_CH2_PD9() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~PSIO0_CH2_PD9_Msk)) | PSIO0_CH2_PD9 /*!< Set PD9 function to PSIO0_CH2 */ -#define SET_PSIO0_CH2_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~PSIO0_CH2_PE5_Msk)) | PSIO0_CH2_PE5 /*!< Set PE5 function to PSIO0_CH2 */ -#define SET_PSIO0_CH2_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~PSIO0_CH2_PB13_Msk)) | PSIO0_CH2_PB13 /*!< Set PB13 function to PSIO0_CH2 */ -#define SET_PSIO0_CH3_PD8() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~PSIO0_CH3_PD8_Msk)) | PSIO0_CH3_PD8 /*!< Set PD8 function to PSIO0_CH3 */ -#define SET_PSIO0_CH3_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~PSIO0_CH3_PC2_Msk)) | PSIO0_CH3_PC2 /*!< Set PC2 function to PSIO0_CH3 */ -#define SET_PSIO0_CH3_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~PSIO0_CH3_PE4_Msk)) | PSIO0_CH3_PE4 /*!< Set PE4 function to PSIO0_CH3 */ -#define SET_PSIO0_CH3_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~PSIO0_CH3_PB12_Msk)) | PSIO0_CH3_PB12 /*!< Set PB12 function to PSIO0_CH3 */ -#define SET_PSIO0_CH4_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~PSIO0_CH4_PD7_Msk)) | PSIO0_CH4_PD7 /*!< Set PD7 function to PSIO0_CH4 */ -#define SET_PSIO0_CH4_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~PSIO0_CH4_PA12_Msk)) | PSIO0_CH4_PA12 /*!< Set PA12 function to PSIO0_CH4 */ -#define SET_PSIO0_CH4_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~PSIO0_CH4_PB5_Msk)) | PSIO0_CH4_PB5 /*!< Set PB5 function to PSIO0_CH4 */ -#define SET_PSIO0_CH4_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~PSIO0_CH4_PA3_Msk)) | PSIO0_CH4_PA3 /*!< Set PA3 function to PSIO0_CH4 */ -#define SET_PSIO0_CH5_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~PSIO0_CH5_PA13_Msk)) | PSIO0_CH5_PA13 /*!< Set PA13 function to PSIO0_CH5 */ -#define SET_PSIO0_CH5_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~PSIO0_CH5_PB4_Msk)) | PSIO0_CH5_PB4 /*!< Set PB4 function to PSIO0_CH5 */ -#define SET_PSIO0_CH5_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~PSIO0_CH5_PA2_Msk)) | PSIO0_CH5_PA2 /*!< Set PA2 function to PSIO0_CH5 */ -#define SET_PSIO0_CH5_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~PSIO0_CH5_PD6_Msk)) | PSIO0_CH5_PD6 /*!< Set PD6 function to PSIO0_CH5 */ -#define SET_PSIO0_CH6_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~PSIO0_CH6_PB3_Msk)) | PSIO0_CH6_PB3 /*!< Set PB3 function to PSIO0_CH6 */ -#define SET_PSIO0_CH6_PD5() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~PSIO0_CH6_PD5_Msk)) | PSIO0_CH6_PD5 /*!< Set PD5 function to PSIO0_CH6 */ -#define SET_PSIO0_CH6_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~PSIO0_CH6_PA1_Msk)) | PSIO0_CH6_PA1 /*!< Set PA1 function to PSIO0_CH6 */ -#define SET_PSIO0_CH6_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~PSIO0_CH6_PA14_Msk)) | PSIO0_CH6_PA14 /*!< Set PA14 function to PSIO0_CH6 */ -#define SET_PSIO0_CH7_PD4() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~PSIO0_CH7_PD4_Msk)) | PSIO0_CH7_PD4 /*!< Set PD4 function to PSIO0_CH7 */ -#define SET_PSIO0_CH7_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~PSIO0_CH7_PA15_Msk)) | PSIO0_CH7_PA15 /*!< Set PA15 function to PSIO0_CH7 */ -#define SET_PSIO0_CH7_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~PSIO0_CH7_PB2_Msk)) | PSIO0_CH7_PB2 /*!< Set PB2 function to PSIO0_CH7 */ -#define SET_PSIO0_CH7_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~PSIO0_CH7_PA0_Msk)) | PSIO0_CH7_PA0 /*!< Set PA0 function to PSIO0_CH7 */ -#define SET_EQEI0_A_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EQEI0_A_PE3_Msk)) | EQEI0_A_PE3 /*!< Set PE3 function to EQEI0_A */ -#define SET_EQEI0_A_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EQEI0_A_PA4_Msk)) | EQEI0_A_PA4 /*!< Set PA4 function to EQEI0_A */ -#define SET_EQEI0_A_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EQEI0_A_PD11_Msk)) | EQEI0_A_PD11 /*!< Set PD11 function to EQEI0_A */ -#define SET_EQEI0_B_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EQEI0_B_PA3_Msk)) | EQEI0_B_PA3 /*!< Set PA3 function to EQEI0_B */ -#define SET_EQEI0_B_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~EQEI0_B_PD10_Msk)) | EQEI0_B_PD10 /*!< Set PD10 function to EQEI0_B */ -#define SET_EQEI0_B_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~EQEI0_B_PE2_Msk)) | EQEI0_B_PE2 /*!< Set PE2 function to EQEI0_B */ -#define SET_EQEI0_INDEX_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EQEI0_INDEX_PE4_Msk)) | EQEI0_INDEX_PE4 /*!< Set PE4 function to EQEI0_INDEX */ -#define SET_EQEI0_INDEX_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~EQEI0_INDEX_PA5_Msk)) | EQEI0_INDEX_PA5 /*!< Set PA5 function to EQEI0_INDEX */ -#define SET_EQEI0_INDEX_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EQEI0_INDEX_PD12_Msk)) | EQEI0_INDEX_PD12 /*!< Set PD12 function to EQEI0_INDEX */ -#define SET_EQEI1_A_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EQEI1_A_PA9_Msk)) | EQEI1_A_PA9 /*!< Set PA9 function to EQEI1_A */ -#define SET_EQEI1_A_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~EQEI1_A_PA13_Msk)) | EQEI1_A_PA13 /*!< Set PA13 function to EQEI1_A */ -#define SET_EQEI1_A_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EQEI1_A_PE6_Msk)) | EQEI1_A_PE6 /*!< Set PE6 function to EQEI1_A */ -#define SET_EQEI1_B_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EQEI1_B_PE5_Msk)) | EQEI1_B_PE5 /*!< Set PE5 function to EQEI1_B */ -#define SET_EQEI1_B_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EQEI1_B_PA8_Msk)) | EQEI1_B_PA8 /*!< Set PA8 function to EQEI1_B */ -#define SET_EQEI1_B_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~EQEI1_B_PA14_Msk)) | EQEI1_B_PA14 /*!< Set PA14 function to EQEI1_B */ -#define SET_EQEI1_INDEX_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~EQEI1_INDEX_PA10_Msk)) | EQEI1_INDEX_PA10 /*!< Set PA10 function to EQEI1_INDEX */ -#define SET_EQEI1_INDEX_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~EQEI1_INDEX_PE7_Msk)) | EQEI1_INDEX_PE7 /*!< Set PE7 function to EQEI1_INDEX */ -#define SET_EQEI1_INDEX_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~EQEI1_INDEX_PA12_Msk)) | EQEI1_INDEX_PA12 /*!< Set PA12 function to EQEI1_INDEX */ -#define SET_EQEI2_A_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EQEI2_A_PE9_Msk)) | EQEI2_A_PE9 /*!< Set PE9 function to EQEI2_A */ -#define SET_EQEI2_A_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EQEI2_A_PF5_Msk)) | EQEI2_A_PF5 /*!< Set PF5 function to EQEI2_A */ -#define SET_EQEI2_A_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EQEI2_A_PD0_Msk)) | EQEI2_A_PD0 /*!< Set PD0 function to EQEI2_A */ -#define SET_EQEI2_B_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EQEI2_B_PF4_Msk)) | EQEI2_B_PF4 /*!< Set PF4 function to EQEI2_B */ -#define SET_EQEI2_B_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EQEI2_B_PE10_Msk)) | EQEI2_B_PE10 /*!< Set PE10 function to EQEI2_B */ -#define SET_EQEI2_B_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~EQEI2_B_PD13_Msk)) | EQEI2_B_PD13 /*!< Set PD13 function to EQEI2_B */ -#define SET_EQEI2_INDEX_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~EQEI2_INDEX_PE8_Msk)) | EQEI2_INDEX_PE8 /*!< Set PE8 function to EQEI2_INDEX */ -#define SET_EQEI2_INDEX_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EQEI2_INDEX_PD1_Msk)) | EQEI2_INDEX_PD1 /*!< Set PD1 function to EQEI2_INDEX */ -#define SET_EQEI2_INDEX_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~EQEI2_INDEX_PF6_Msk)) | EQEI2_INDEX_PF6 /*!< Set PF6 function to EQEI2_INDEX */ -#define SET_EQEI3_A_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EQEI3_A_PD3_Msk)) | EQEI3_A_PD3 /*!< Set PD3 function to EQEI3_A */ -#define SET_EQEI3_A_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EQEI3_A_PA1_Msk)) | EQEI3_A_PA1 /*!< Set PA1 function to EQEI3_A */ -#define SET_EQEI3_B_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EQEI3_B_PA0_Msk)) | EQEI3_B_PA0 /*!< Set PA0 function to EQEI3_B */ -#define SET_EQEI3_B_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~EQEI3_B_PD2_Msk)) | EQEI3_B_PD2 /*!< Set PD2 function to EQEI3_B */ -#define SET_EQEI3_INDEX_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~EQEI3_INDEX_PA2_Msk)) | EQEI3_INDEX_PA2 /*!< Set PA2 function to EQEI3_INDEX */ -#define SET_EQEI3_INDEX_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~EQEI3_INDEX_PA15_Msk)) | EQEI3_INDEX_PA15 /*!< Set PA15 function to EQEI3_INDEX */ -#define SET_QSPI0_CLK_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~QSPI0_CLK_PH8_Msk)) | QSPI0_CLK_PH8 /*!< Set PH8 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~QSPI0_CLK_PA2_Msk)) | QSPI0_CLK_PA2 /*!< Set PA2 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PI15() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~QSPI0_CLK_PI15_Msk)) | QSPI0_CLK_PI15 /*!< Set PI15 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI0_CLK_PC2_Msk)) | QSPI0_CLK_PC2 /*!< Set PC2 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~QSPI0_CLK_PF2_Msk)) | QSPI0_CLK_PF2 /*!< Set PF2 function to QSPI0_CLK */ -#define SET_QSPI0_CLK_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~QSPI0_CLK_PC14_Msk)) | QSPI0_CLK_PC14 /*!< Set PC14 function to QSPI0_CLK */ -#define SET_QSPI0_MISO0_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI0_MISO0_PC1_Msk)) | QSPI0_MISO0_PC1 /*!< Set PC1 function to QSPI0_MISO0 */ -#define SET_QSPI0_MISO0_PJ0() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~QSPI0_MISO0_PJ0_Msk)) | QSPI0_MISO0_PJ0 /*!< Set PJ0 function to QSPI0_MISO0 */ -#define SET_QSPI0_MISO0_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~QSPI0_MISO0_PE1_Msk)) | QSPI0_MISO0_PE1 /*!< Set PE1 function to QSPI0_MISO0 */ -#define SET_QSPI0_MISO0_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~QSPI0_MISO0_PA1_Msk)) | QSPI0_MISO0_PA1 /*!< Set PA1 function to QSPI0_MISO0 */ -#define SET_QSPI0_MISO1_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~QSPI0_MISO1_PB1_Msk)) | QSPI0_MISO1_PB1 /*!< Set PB1 function to QSPI0_MISO1 */ -#define SET_QSPI0_MISO1_PI12() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~QSPI0_MISO1_PI12_Msk)) | QSPI0_MISO1_PI12 /*!< Set PI12 function to QSPI0_MISO1 */ -#define SET_QSPI0_MISO1_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~QSPI0_MISO1_PC5_Msk)) | QSPI0_MISO1_PC5 /*!< Set PC5 function to QSPI0_MISO1 */ -#define SET_QSPI0_MISO1_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~QSPI0_MISO1_PH10_Msk)) | QSPI0_MISO1_PH10 /*!< Set PH10 function to QSPI0_MISO1 */ -#define SET_QSPI0_MISO1_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~QSPI0_MISO1_PA5_Msk)) | QSPI0_MISO1_PA5 /*!< Set PA5 function to QSPI0_MISO1 */ -#define SET_QSPI0_MOSI0_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~QSPI0_MOSI0_PE0_Msk)) | QSPI0_MOSI0_PE0 /*!< Set PE0 function to QSPI0_MOSI0 */ -#define SET_QSPI0_MOSI0_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI0_MOSI0_PC0_Msk)) | QSPI0_MOSI0_PC0 /*!< Set PC0 function to QSPI0_MOSI0 */ -#define SET_QSPI0_MOSI0_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~QSPI0_MOSI0_PA0_Msk)) | QSPI0_MOSI0_PA0 /*!< Set PA0 function to QSPI0_MOSI0 */ -#define SET_QSPI0_MOSI0_PJ1() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~QSPI0_MOSI0_PJ1_Msk)) | QSPI0_MOSI0_PJ1 /*!< Set PJ1 function to QSPI0_MOSI0 */ -#define SET_QSPI0_MOSI1_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~QSPI0_MOSI1_PA4_Msk)) | QSPI0_MOSI1_PA4 /*!< Set PA4 function to QSPI0_MOSI1 */ -#define SET_QSPI0_MOSI1_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~QSPI0_MOSI1_PC4_Msk)) | QSPI0_MOSI1_PC4 /*!< Set PC4 function to QSPI0_MOSI1 */ -#define SET_QSPI0_MOSI1_PH11() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~QSPI0_MOSI1_PH11_Msk)) | QSPI0_MOSI1_PH11 /*!< Set PH11 function to QSPI0_MOSI1 */ -#define SET_QSPI0_MOSI1_PI13() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~QSPI0_MOSI1_PI13_Msk)) | QSPI0_MOSI1_PI13 /*!< Set PI13 function to QSPI0_MOSI1 */ -#define SET_QSPI0_MOSI1_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~QSPI0_MOSI1_PB0_Msk)) | QSPI0_MOSI1_PB0 /*!< Set PB0 function to QSPI0_MOSI1 */ -#define SET_QSPI0_SS_PI14() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~QSPI0_SS_PI14_Msk)) | QSPI0_SS_PI14 /*!< Set PI14 function to QSPI0_SS */ -#define SET_QSPI0_SS_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~QSPI0_SS_PA3_Msk)) | QSPI0_SS_PA3 /*!< Set PA3 function to QSPI0_SS */ -#define SET_QSPI0_SS_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI0_SS_PC3_Msk)) | QSPI0_SS_PC3 /*!< Set PC3 function to QSPI0_SS */ -#define SET_QSPI0_SS_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~QSPI0_SS_PH9_Msk)) | QSPI0_SS_PH9 /*!< Set PH9 function to QSPI0_SS */ -#define SET_QSPI1_CLK_PH15() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~QSPI1_CLK_PH15_Msk)) | QSPI1_CLK_PH15 /*!< Set PH15 function to QSPI1_CLK */ -#define SET_QSPI1_CLK_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~QSPI1_CLK_PC4_Msk)) | QSPI1_CLK_PC4 /*!< Set PC4 function to QSPI1_CLK */ -#define SET_QSPI1_CLK_PJ3() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~QSPI1_CLK_PJ3_Msk)) | QSPI1_CLK_PJ3 /*!< Set PJ3 function to QSPI1_CLK */ -#define SET_QSPI1_CLK_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~QSPI1_CLK_PG12_Msk)) | QSPI1_CLK_PG12 /*!< Set PG12 function to QSPI1_CLK */ -#define SET_QSPI1_CLK_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI1_CLK_PC0_Msk)) | QSPI1_CLK_PC0 /*!< Set PC0 function to QSPI1_CLK */ -#define SET_QSPI1_MISO0_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~QSPI1_MISO0_PD7_Msk)) | QSPI1_MISO0_PD7 /*!< Set PD7 function to QSPI1_MISO0 */ -#define SET_QSPI1_MISO0_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~QSPI1_MISO0_PA12_Msk)) | QSPI1_MISO0_PA12 /*!< Set PA12 function to QSPI1_MISO0 */ -#define SET_QSPI1_MISO0_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI1_MISO0_PC3_Msk)) | QSPI1_MISO0_PC3 /*!< Set PC3 function to QSPI1_MISO0 */ -#define SET_QSPI1_MISO0_PJ4() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~QSPI1_MISO0_PJ4_Msk)) | QSPI1_MISO0_PJ4 /*!< Set PJ4 function to QSPI1_MISO0 */ -#define SET_QSPI1_MISO0_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~QSPI1_MISO0_PG13_Msk)) | QSPI1_MISO0_PG13 /*!< Set PG13 function to QSPI1_MISO0 */ -#define SET_QSPI1_MISO0_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~QSPI1_MISO0_PF0_Msk)) | QSPI1_MISO0_PF0 /*!< Set PF0 function to QSPI1_MISO0 */ -#define SET_QSPI1_MISO1_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~QSPI1_MISO1_PG9_Msk)) | QSPI1_MISO1_PG9 /*!< Set PG9 function to QSPI1_MISO1 */ -#define SET_QSPI1_MISO1_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~QSPI1_MISO1_PA7_Msk)) | QSPI1_MISO1_PA7 /*!< Set PA7 function to QSPI1_MISO1 */ -#define SET_QSPI1_MISO1_PH12() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~QSPI1_MISO1_PH12_Msk)) | QSPI1_MISO1_PH12 /*!< Set PH12 function to QSPI1_MISO1 */ -#define SET_QSPI1_MISO1_PG15() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~QSPI1_MISO1_PG15_Msk)) | QSPI1_MISO1_PG15 /*!< Set PG15 function to QSPI1_MISO1 */ -#define SET_QSPI1_MOSI0_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~QSPI1_MOSI0_PA13_Msk)) | QSPI1_MOSI0_PA13 /*!< Set PA13 function to QSPI1_MOSI0 */ -#define SET_QSPI1_MOSI0_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~QSPI1_MOSI0_PD13_Msk)) | QSPI1_MOSI0_PD13 /*!< Set PD13 function to QSPI1_MOSI0 */ -#define SET_QSPI1_MOSI0_PG14() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~QSPI1_MOSI0_PG14_Msk)) | QSPI1_MOSI0_PG14 /*!< Set PG14 function to QSPI1_MOSI0 */ -#define SET_QSPI1_MOSI0_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI1_MOSI0_PC2_Msk)) | QSPI1_MOSI0_PC2 /*!< Set PC2 function to QSPI1_MOSI0 */ -#define SET_QSPI1_MOSI0_PJ5() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~QSPI1_MOSI0_PJ5_Msk)) | QSPI1_MOSI0_PJ5 /*!< Set PJ5 function to QSPI1_MOSI0 */ -#define SET_QSPI1_MOSI0_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~QSPI1_MOSI0_PD6_Msk)) | QSPI1_MOSI0_PD6 /*!< Set PD6 function to QSPI1_MOSI0 */ -#define SET_QSPI1_MOSI0_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~QSPI1_MOSI0_PF1_Msk)) | QSPI1_MOSI0_PF1 /*!< Set PF1 function to QSPI1_MOSI0 */ -#define SET_QSPI1_MOSI1_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~QSPI1_MOSI1_PG10_Msk)) | QSPI1_MOSI1_PG10 /*!< Set PG10 function to QSPI1_MOSI1 */ -#define SET_QSPI1_MOSI1_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~QSPI1_MOSI1_PA6_Msk)) | QSPI1_MOSI1_PA6 /*!< Set PA6 function to QSPI1_MOSI1 */ -#define SET_QSPI1_MOSI1_PH13() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~QSPI1_MOSI1_PH13_Msk)) | QSPI1_MOSI1_PH13 /*!< Set PH13 function to QSPI1_MOSI1 */ -#define SET_QSPI1_MOSI1_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~QSPI1_MOSI1_PD13_Msk)) | QSPI1_MOSI1_PD13 /*!< Set PD13 function to QSPI1_MOSI1 */ -#define SET_QSPI1_SS_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~QSPI1_SS_PG11_Msk)) | QSPI1_SS_PG11 /*!< Set PG11 function to QSPI1_SS */ -#define SET_QSPI1_SS_PH14() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~QSPI1_SS_PH14_Msk)) | QSPI1_SS_PH14 /*!< Set PH14 function to QSPI1_SS */ -#define SET_QSPI1_SS_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~QSPI1_SS_PC5_Msk)) | QSPI1_SS_PC5 /*!< Set PC5 function to QSPI1_SS */ -#define SET_QSPI1_SS_PJ2() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~QSPI1_SS_PJ2_Msk)) | QSPI1_SS_PJ2 /*!< Set PJ2 function to QSPI1_SS */ -#define SET_QSPI1_SS_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~QSPI1_SS_PC1_Msk)) | QSPI1_SS_PC1 /*!< Set PC1 function to QSPI1_SS */ -#define SET_SC0_CLK_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SC0_CLK_PA0_Msk)) | SC0_CLK_PA0 /*!< Set PA0 function to SC0_CLK */ -#define SET_SC0_CLK_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SC0_CLK_PF6_Msk)) | SC0_CLK_PF6 /*!< Set PF6 function to SC0_CLK */ -#define SET_SC0_CLK_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SC0_CLK_PE2_Msk)) | SC0_CLK_PE2 /*!< Set PE2 function to SC0_CLK */ -#define SET_SC0_CLK_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SC0_CLK_PB5_Msk)) | SC0_CLK_PB5 /*!< Set PB5 function to SC0_CLK */ -#define SET_SC0_DAT_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SC0_DAT_PE3_Msk)) | SC0_DAT_PE3 /*!< Set PE3 function to SC0_DAT */ -#define SET_SC0_DAT_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SC0_DAT_PB4_Msk)) | SC0_DAT_PB4 /*!< Set PB4 function to SC0_DAT */ -#define SET_SC0_DAT_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SC0_DAT_PA1_Msk)) | SC0_DAT_PA1 /*!< Set PA1 function to SC0_DAT */ -#define SET_SC0_DAT_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SC0_DAT_PF7_Msk)) | SC0_DAT_PF7 /*!< Set PF7 function to SC0_DAT */ -#define SET_SC0_PWR_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SC0_PWR_PE5_Msk)) | SC0_PWR_PE5 /*!< Set PE5 function to SC0_PWR */ -#define SET_SC0_PWR_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SC0_PWR_PA3_Msk)) | SC0_PWR_PA3 /*!< Set PA3 function to SC0_PWR */ -#define SET_SC0_PWR_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SC0_PWR_PB2_Msk)) | SC0_PWR_PB2 /*!< Set PB2 function to SC0_PWR */ -#define SET_SC0_PWR_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~SC0_PWR_PF9_Msk)) | SC0_PWR_PF9 /*!< Set PF9 function to SC0_PWR */ -#define SET_SC0_RST_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SC0_RST_PE4_Msk)) | SC0_RST_PE4 /*!< Set PE4 function to SC0_RST */ -#define SET_SC0_RST_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SC0_RST_PA2_Msk)) | SC0_RST_PA2 /*!< Set PA2 function to SC0_RST */ -#define SET_SC0_RST_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~SC0_RST_PF8_Msk)) | SC0_RST_PF8 /*!< Set PF8 function to SC0_RST */ -#define SET_SC0_RST_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SC0_RST_PB3_Msk)) | SC0_RST_PB3 /*!< Set PB3 function to SC0_RST */ -#define SET_SC0_nCD_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SC0_nCD_PC12_Msk)) | SC0_nCD_PC12 /*!< Set PC12 function to SC0_nCD */ -#define SET_SC0_nCD_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SC0_nCD_PE6_Msk)) | SC0_nCD_PE6 /*!< Set PE6 function to SC0_nCD */ -#define SET_SC0_nCD_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SC0_nCD_PA4_Msk)) | SC0_nCD_PA4 /*!< Set PA4 function to SC0_nCD */ -#define SET_SC0_nCD_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~SC0_nCD_PF10_Msk)) | SC0_nCD_PF10 /*!< Set PF10 function to SC0_nCD */ -#define SET_SC1_CLK_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~SC1_CLK_PF1_Msk)) | SC1_CLK_PF1 /*!< Set PF1 function to SC1_CLK */ -#define SET_SC1_CLK_PD4() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SC1_CLK_PD4_Msk)) | SC1_CLK_PD4 /*!< Set PD4 function to SC1_CLK */ -#define SET_SC1_CLK_PI10() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~SC1_CLK_PI10_Msk)) | SC1_CLK_PI10 /*!< Set PI10 function to SC1_CLK */ -#define SET_SC1_CLK_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SC1_CLK_PB12_Msk)) | SC1_CLK_PB12 /*!< Set PB12 function to SC1_CLK */ -#define SET_SC1_CLK_PG8() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SC1_CLK_PG8_Msk)) | SC1_CLK_PG8 /*!< Set PG8 function to SC1_CLK */ -#define SET_SC1_CLK_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SC1_CLK_PC0_Msk)) | SC1_CLK_PC0 /*!< Set PC0 function to SC1_CLK */ -#define SET_SC1_DAT_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SC1_DAT_PC1_Msk)) | SC1_DAT_PC1 /*!< Set PC1 function to SC1_DAT */ -#define SET_SC1_DAT_PD5() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SC1_DAT_PD5_Msk)) | SC1_DAT_PD5 /*!< Set PD5 function to SC1_DAT */ -#define SET_SC1_DAT_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~SC1_DAT_PF0_Msk)) | SC1_DAT_PF0 /*!< Set PF0 function to SC1_DAT */ -#define SET_SC1_DAT_PG7() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~SC1_DAT_PG7_Msk)) | SC1_DAT_PG7 /*!< Set PG7 function to SC1_DAT */ -#define SET_SC1_DAT_PI9() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~SC1_DAT_PI9_Msk)) | SC1_DAT_PI9 /*!< Set PI9 function to SC1_DAT */ -#define SET_SC1_DAT_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SC1_DAT_PB13_Msk)) | SC1_DAT_PB13 /*!< Set PB13 function to SC1_DAT */ -#define SET_SC1_PWR_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SC1_PWR_PD7_Msk)) | SC1_PWR_PD7 /*!< Set PD7 function to SC1_PWR */ -#define SET_SC1_PWR_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SC1_PWR_PC3_Msk)) | SC1_PWR_PC3 /*!< Set PC3 function to SC1_PWR */ -#define SET_SC1_PWR_PI7() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~SC1_PWR_PI7_Msk)) | SC1_PWR_PI7 /*!< Set PI7 function to SC1_PWR */ -#define SET_SC1_PWR_PG5() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~SC1_PWR_PG5_Msk)) | SC1_PWR_PG5 /*!< Set PG5 function to SC1_PWR */ -#define SET_SC1_PWR_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SC1_PWR_PB15_Msk)) | SC1_PWR_PB15 /*!< Set PB15 function to SC1_PWR */ -#define SET_SC1_RST_PI8() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~SC1_RST_PI8_Msk)) | SC1_RST_PI8 /*!< Set PI8 function to SC1_RST */ -#define SET_SC1_RST_PG6() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~SC1_RST_PG6_Msk)) | SC1_RST_PG6 /*!< Set PG6 function to SC1_RST */ -#define SET_SC1_RST_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SC1_RST_PB14_Msk)) | SC1_RST_PB14 /*!< Set PB14 function to SC1_RST */ -#define SET_SC1_RST_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SC1_RST_PC2_Msk)) | SC1_RST_PC2 /*!< Set PC2 function to SC1_RST */ -#define SET_SC1_RST_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SC1_RST_PD6_Msk)) | SC1_RST_PD6 /*!< Set PD6 function to SC1_RST */ -#define SET_SC1_nCD_PD14() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SC1_nCD_PD14_Msk)) | SC1_nCD_PD14 /*!< Set PD14 function to SC1_nCD */ -#define SET_SC1_nCD_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SC1_nCD_PC4_Msk)) | SC1_nCD_PC4 /*!< Set PC4 function to SC1_nCD */ -#define SET_SC1_nCD_PI6() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~SC1_nCD_PI6_Msk)) | SC1_nCD_PI6 /*!< Set PI6 function to SC1_nCD */ -#define SET_SC1_nCD_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SC1_nCD_PD3_Msk)) | SC1_nCD_PD3 /*!< Set PD3 function to SC1_nCD */ -#define SET_SC1_nCD_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SC1_nCD_PC14_Msk)) | SC1_nCD_PC14 /*!< Set PC14 function to SC1_nCD */ -#define SET_SC2_CLK_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SC2_CLK_PA15_Msk)) | SC2_CLK_PA15 /*!< Set PA15 function to SC2_CLK */ -#define SET_SC2_CLK_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SC2_CLK_PD0_Msk)) | SC2_CLK_PD0 /*!< Set PD0 function to SC2_CLK */ -#define SET_SC2_CLK_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SC2_CLK_PA6_Msk)) | SC2_CLK_PA6 /*!< Set PA6 function to SC2_CLK */ -#define SET_SC2_CLK_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SC2_CLK_PE0_Msk)) | SC2_CLK_PE0 /*!< Set PE0 function to SC2_CLK */ -#define SET_SC2_CLK_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SC2_CLK_PA8_Msk)) | SC2_CLK_PA8 /*!< Set PA8 function to SC2_CLK */ -#define SET_SC2_DAT_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SC2_DAT_PD1_Msk)) | SC2_DAT_PD1 /*!< Set PD1 function to SC2_DAT */ -#define SET_SC2_DAT_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SC2_DAT_PA9_Msk)) | SC2_DAT_PA9 /*!< Set PA9 function to SC2_DAT */ -#define SET_SC2_DAT_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SC2_DAT_PE1_Msk)) | SC2_DAT_PE1 /*!< Set PE1 function to SC2_DAT */ -#define SET_SC2_DAT_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SC2_DAT_PA14_Msk)) | SC2_DAT_PA14 /*!< Set PA14 function to SC2_DAT */ -#define SET_SC2_DAT_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SC2_DAT_PA7_Msk)) | SC2_DAT_PA7 /*!< Set PA7 function to SC2_DAT */ -#define SET_SC2_PWR_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SC2_PWR_PC7_Msk)) | SC2_PWR_PC7 /*!< Set PC7 function to SC2_PWR */ -#define SET_SC2_PWR_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SC2_PWR_PA11_Msk)) | SC2_PWR_PA11 /*!< Set PA11 function to SC2_PWR */ -#define SET_SC2_PWR_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SC2_PWR_PA12_Msk)) | SC2_PWR_PA12 /*!< Set PA12 function to SC2_PWR */ -#define SET_SC2_PWR_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SC2_PWR_PD3_Msk)) | SC2_PWR_PD3 /*!< Set PD3 function to SC2_PWR */ -#define SET_SC2_PWR_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~SC2_PWR_PH8_Msk)) | SC2_PWR_PH8 /*!< Set PH8 function to SC2_PWR */ -#define SET_SC2_RST_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SC2_RST_PC6_Msk)) | SC2_RST_PC6 /*!< Set PC6 function to SC2_RST */ -#define SET_SC2_RST_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SC2_RST_PD2_Msk)) | SC2_RST_PD2 /*!< Set PD2 function to SC2_RST */ -#define SET_SC2_RST_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SC2_RST_PA13_Msk)) | SC2_RST_PA13 /*!< Set PA13 function to SC2_RST */ -#define SET_SC2_RST_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SC2_RST_PA10_Msk)) | SC2_RST_PA10 /*!< Set PA10 function to SC2_RST */ -#define SET_SC2_RST_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~SC2_RST_PH9_Msk)) | SC2_RST_PH9 /*!< Set PH9 function to SC2_RST */ -#define SET_SC2_nCD_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SC2_nCD_PD13_Msk)) | SC2_nCD_PD13 /*!< Set PD13 function to SC2_nCD */ -#define SET_SC2_nCD_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SC2_nCD_PA5_Msk)) | SC2_nCD_PA5 /*!< Set PA5 function to SC2_nCD */ -#define SET_SC2_nCD_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SC2_nCD_PC13_Msk)) | SC2_nCD_PC13 /*!< Set PC13 function to SC2_nCD */ -#define SET_SC2_nCD_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~SC2_nCD_PH10_Msk)) | SC2_nCD_PH10 /*!< Set PH10 function to SC2_nCD */ -#define SET_SD0_CLK_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SD0_CLK_PB1_Msk)) | SD0_CLK_PB1 /*!< Set PB1 function to SD0_CLK */ -#define SET_SD0_CLK_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SD0_CLK_PE6_Msk)) | SD0_CLK_PE6 /*!< Set PE6 function to SD0_CLK */ -#define SET_SD0_CMD_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SD0_CMD_PE7_Msk)) | SD0_CMD_PE7 /*!< Set PE7 function to SD0_CMD */ -#define SET_SD0_CMD_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SD0_CMD_PB0_Msk)) | SD0_CMD_PB0 /*!< Set PB0 function to SD0_CMD */ -#define SET_SD0_DAT0_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SD0_DAT0_PE2_Msk)) | SD0_DAT0_PE2 /*!< Set PE2 function to SD0_DAT0 */ -#define SET_SD0_DAT0_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SD0_DAT0_PB2_Msk)) | SD0_DAT0_PB2 /*!< Set PB2 function to SD0_DAT0 */ -#define SET_SD0_DAT1_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SD0_DAT1_PB3_Msk)) | SD0_DAT1_PB3 /*!< Set PB3 function to SD0_DAT1 */ -#define SET_SD0_DAT1_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SD0_DAT1_PE3_Msk)) | SD0_DAT1_PE3 /*!< Set PE3 function to SD0_DAT1 */ -#define SET_SD0_DAT2_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SD0_DAT2_PE4_Msk)) | SD0_DAT2_PE4 /*!< Set PE4 function to SD0_DAT2 */ -#define SET_SD0_DAT2_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SD0_DAT2_PB4_Msk)) | SD0_DAT2_PB4 /*!< Set PB4 function to SD0_DAT2 */ -#define SET_SD0_DAT3_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SD0_DAT3_PE5_Msk)) | SD0_DAT3_PE5 /*!< Set PE5 function to SD0_DAT3 */ -#define SET_SD0_DAT3_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SD0_DAT3_PB5_Msk)) | SD0_DAT3_PB5 /*!< Set PB5 function to SD0_DAT3 */ -#define SET_SD0_nCD_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SD0_nCD_PB12_Msk)) | SD0_nCD_PB12 /*!< Set PB12 function to SD0_nCD */ -#define SET_SD0_nCD_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SD0_nCD_PD13_Msk)) | SD0_nCD_PD13 /*!< Set PD13 function to SD0_nCD */ -#define SET_SD1_CLK_PJ13() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~SD1_CLK_PJ13_Msk)) | SD1_CLK_PJ13 /*!< Set PJ13 function to SD1_CLK */ -#define SET_SD1_CLK_PG14() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SD1_CLK_PG14_Msk)) | SD1_CLK_PG14 /*!< Set PG14 function to SD1_CLK */ -#define SET_SD1_CLK_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SD1_CLK_PD13_Msk)) | SD1_CLK_PD13 /*!< Set PD13 function to SD1_CLK */ -#define SET_SD1_CLK_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SD1_CLK_PA4_Msk)) | SD1_CLK_PA4 /*!< Set PA4 function to SD1_CLK */ -#define SET_SD1_CLK_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SD1_CLK_PB6_Msk)) | SD1_CLK_PB6 /*!< Set PB6 function to SD1_CLK */ -#define SET_SD1_CMD_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SD1_CMD_PA5_Msk)) | SD1_CMD_PA5 /*!< Set PA5 function to SD1_CMD */ -#define SET_SD1_CMD_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~SD1_CMD_PJ12_Msk)) | SD1_CMD_PJ12 /*!< Set PJ12 function to SD1_CMD */ -#define SET_SD1_CMD_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SD1_CMD_PB7_Msk)) | SD1_CMD_PB7 /*!< Set PB7 function to SD1_CMD */ -#define SET_SD1_CMD_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SD1_CMD_PG13_Msk)) | SD1_CMD_PG13 /*!< Set PG13 function to SD1_CMD */ -#define SET_SD1_DAT0_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SD1_DAT0_PA8_Msk)) | SD1_DAT0_PA8 /*!< Set PA8 function to SD1_DAT0 */ -#define SET_SD1_DAT0_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SD1_DAT0_PA0_Msk)) | SD1_DAT0_PA0 /*!< Set PA0 function to SD1_DAT0 */ -#define SET_SD1_DAT0_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SD1_DAT0_PG12_Msk)) | SD1_DAT0_PG12 /*!< Set PG12 function to SD1_DAT0 */ -#define SET_SD1_DAT0_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SD1_DAT0_PJ11_Msk)) | SD1_DAT0_PJ11 /*!< Set PJ11 function to SD1_DAT0 */ -#define SET_SD1_DAT1_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SD1_DAT1_PG11_Msk)) | SD1_DAT1_PG11 /*!< Set PG11 function to SD1_DAT1 */ -#define SET_SD1_DAT1_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SD1_DAT1_PJ10_Msk)) | SD1_DAT1_PJ10 /*!< Set PJ10 function to SD1_DAT1 */ -#define SET_SD1_DAT1_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SD1_DAT1_PA9_Msk)) | SD1_DAT1_PA9 /*!< Set PA9 function to SD1_DAT1 */ -#define SET_SD1_DAT1_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SD1_DAT1_PA1_Msk)) | SD1_DAT1_PA1 /*!< Set PA1 function to SD1_DAT1 */ -#define SET_SD1_DAT2_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SD1_DAT2_PA2_Msk)) | SD1_DAT2_PA2 /*!< Set PA2 function to SD1_DAT2 */ -#define SET_SD1_DAT2_PJ9() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SD1_DAT2_PJ9_Msk)) | SD1_DAT2_PJ9 /*!< Set PJ9 function to SD1_DAT2 */ -#define SET_SD1_DAT2_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SD1_DAT2_PG10_Msk)) | SD1_DAT2_PG10 /*!< Set PG10 function to SD1_DAT2 */ -#define SET_SD1_DAT2_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SD1_DAT2_PA10_Msk)) | SD1_DAT2_PA10 /*!< Set PA10 function to SD1_DAT2 */ -#define SET_SD1_DAT3_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SD1_DAT3_PA3_Msk)) | SD1_DAT3_PA3 /*!< Set PA3 function to SD1_DAT3 */ -#define SET_SD1_DAT3_PJ8() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SD1_DAT3_PJ8_Msk)) | SD1_DAT3_PJ8 /*!< Set PJ8 function to SD1_DAT3 */ -#define SET_SD1_DAT3_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SD1_DAT3_PA11_Msk)) | SD1_DAT3_PA11 /*!< Set PA11 function to SD1_DAT3 */ -#define SET_SD1_DAT3_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SD1_DAT3_PG9_Msk)) | SD1_DAT3_PG9 /*!< Set PG9 function to SD1_DAT3 */ -#define SET_SD1_nCD_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SD1_nCD_PA6_Msk)) | SD1_nCD_PA6 /*!< Set PA6 function to SD1_nCD */ -#define SET_SD1_nCD_PG15() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SD1_nCD_PG15_Msk)) | SD1_nCD_PG15 /*!< Set PG15 function to SD1_nCD */ -#define SET_SD1_nCD_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SD1_nCD_PA12_Msk)) | SD1_nCD_PA12 /*!< Set PA12 function to SD1_nCD */ -#define SET_SD1_nCD_PE14() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~SD1_nCD_PE14_Msk)) | SD1_nCD_PE14 /*!< Set PE14 function to SD1_nCD */ -#define SET_SPI0_CLK_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SPI0_CLK_PD2_Msk)) | SPI0_CLK_PD2 /*!< Set PD2 function to SPI0_CLK */ -#define SET_SPI0_CLK_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~SPI0_CLK_PF8_Msk)) | SPI0_CLK_PF8 /*!< Set PF8 function to SPI0_CLK */ -#define SET_SPI0_CLK_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPI0_CLK_PA2_Msk)) | SPI0_CLK_PA2 /*!< Set PA2 function to SPI0_CLK */ -#define SET_SPI0_CLK_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI0_CLK_PB14_Msk)) | SPI0_CLK_PB14 /*!< Set PB14 function to SPI0_CLK */ -#define SET_SPI0_CLK_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI0_CLK_PA13_Msk)) | SPI0_CLK_PA13 /*!< Set PA13 function to SPI0_CLK */ -#define SET_SPI0_I2SMCLK_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~SPI0_I2SMCLK_PF10_Msk)) | SPI0_I2SMCLK_PF10 /*!< Set PF10 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SPI0_I2SMCLK_PD13_Msk)) | SPI0_I2SMCLK_PD13 /*!< Set PD13 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI0_I2SMCLK_PB0_Msk)) | SPI0_I2SMCLK_PB0 /*!< Set PB0 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PD14() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SPI0_I2SMCLK_PD14_Msk)) | SPI0_I2SMCLK_PD14 /*!< Set PD14 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI0_I2SMCLK_PA4_Msk)) | SPI0_I2SMCLK_PA4 /*!< Set PA4 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SPI0_I2SMCLK_PC14_Msk)) | SPI0_I2SMCLK_PC14 /*!< Set PC14 function to SPI0_I2SMCLK */ -#define SET_SPI0_I2SMCLK_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~SPI0_I2SMCLK_PB11_Msk)) | SPI0_I2SMCLK_PB11 /*!< Set PB11 function to SPI0_I2SMCLK */ -#define SET_SPI0_MISO_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SPI0_MISO_PD1_Msk)) | SPI0_MISO_PD1 /*!< Set PD1 function to SPI0_MISO */ -#define SET_SPI0_MISO_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI0_MISO_PB13_Msk)) | SPI0_MISO_PB13 /*!< Set PB13 function to SPI0_MISO */ -#define SET_SPI0_MISO_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SPI0_MISO_PF7_Msk)) | SPI0_MISO_PF7 /*!< Set PF7 function to SPI0_MISO */ -#define SET_SPI0_MISO_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPI0_MISO_PA1_Msk)) | SPI0_MISO_PA1 /*!< Set PA1 function to SPI0_MISO */ -#define SET_SPI0_MISO_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI0_MISO_PA14_Msk)) | SPI0_MISO_PA14 /*!< Set PA14 function to SPI0_MISO */ -#define SET_SPI0_MOSI_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SPI0_MOSI_PD0_Msk)) | SPI0_MOSI_PD0 /*!< Set PD0 function to SPI0_MOSI */ -#define SET_SPI0_MOSI_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI0_MOSI_PB12_Msk)) | SPI0_MOSI_PB12 /*!< Set PB12 function to SPI0_MOSI */ -#define SET_SPI0_MOSI_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SPI0_MOSI_PF6_Msk)) | SPI0_MOSI_PF6 /*!< Set PF6 function to SPI0_MOSI */ -#define SET_SPI0_MOSI_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPI0_MOSI_PA0_Msk)) | SPI0_MOSI_PA0 /*!< Set PA0 function to SPI0_MOSI */ -#define SET_SPI0_MOSI_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI0_MOSI_PA15_Msk)) | SPI0_MOSI_PA15 /*!< Set PA15 function to SPI0_MOSI */ -#define SET_SPI0_SS_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~SPI0_SS_PD3_Msk)) | SPI0_SS_PD3 /*!< Set PD3 function to SPI0_SS */ -#define SET_SPI0_SS_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~SPI0_SS_PF9_Msk)) | SPI0_SS_PF9 /*!< Set PF9 function to SPI0_SS */ -#define SET_SPI0_SS_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI0_SS_PB15_Msk)) | SPI0_SS_PB15 /*!< Set PB15 function to SPI0_SS */ -#define SET_SPI0_SS_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPI0_SS_PA3_Msk)) | SPI0_SS_PA3 /*!< Set PA3 function to SPI0_SS */ -#define SET_SPI0_SS_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI0_SS_PA12_Msk)) | SPI0_SS_PA12 /*!< Set PA12 function to SPI0_SS */ -#define SET_SPI1_CLK_PI9() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~SPI1_CLK_PI9_Msk)) | SPI1_CLK_PI9 /*!< Set PI9 function to SPI1_CLK */ -#define SET_SPI1_CLK_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~SPI1_CLK_PH8_Msk)) | SPI1_CLK_PH8 /*!< Set PH8 function to SPI1_CLK */ -#define SET_SPI1_CLK_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI1_CLK_PB3_Msk)) | SPI1_CLK_PB3 /*!< Set PB3 function to SPI1_CLK */ -#define SET_SPI1_CLK_PD5() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SPI1_CLK_PD5_Msk)) | SPI1_CLK_PD5 /*!< Set PD5 function to SPI1_CLK */ -#define SET_SPI1_CLK_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI1_CLK_PA7_Msk)) | SPI1_CLK_PA7 /*!< Set PA7 function to SPI1_CLK */ -#define SET_SPI1_CLK_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI1_CLK_PC1_Msk)) | SPI1_CLK_PC1 /*!< Set PC1 function to SPI1_CLK */ -#define SET_SPI1_CLK_PH6() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~SPI1_CLK_PH6_Msk)) | SPI1_CLK_PH6 /*!< Set PH6 function to SPI1_CLK */ -#define SET_SPI1_CLK_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SPI1_CLK_PB7_Msk)) | SPI1_CLK_PB7 /*!< Set PB7 function to SPI1_CLK */ -#define SET_SPI1_I2SMCLK_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SPI1_I2SMCLK_PC4_Msk)) | SPI1_I2SMCLK_PC4 /*!< Set PC4 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PI6() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~SPI1_I2SMCLK_PI6_Msk)) | SPI1_I2SMCLK_PI6 /*!< Set PI6 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~SPI1_I2SMCLK_PH10_Msk)) | SPI1_I2SMCLK_PH10 /*!< Set PH10 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI1_I2SMCLK_PA5_Msk)) | SPI1_I2SMCLK_PA5 /*!< Set PA5 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PH3() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~SPI1_I2SMCLK_PH3_Msk)) | SPI1_I2SMCLK_PH3 /*!< Set PH3 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SPI1_I2SMCLK_PD13_Msk)) | SPI1_I2SMCLK_PD13 /*!< Set PD13 function to SPI1_I2SMCLK */ -#define SET_SPI1_I2SMCLK_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI1_I2SMCLK_PB1_Msk)) | SPI1_I2SMCLK_PB1 /*!< Set PB1 function to SPI1_I2SMCLK */ -#define SET_SPI1_MISO_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SPI1_MISO_PE1_Msk)) | SPI1_MISO_PE1 /*!< Set PE1 function to SPI1_MISO */ -#define SET_SPI1_MISO_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI1_MISO_PC3_Msk)) | SPI1_MISO_PC3 /*!< Set PC3 function to SPI1_MISO */ -#define SET_SPI1_MISO_PH4() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~SPI1_MISO_PH4_Msk)) | SPI1_MISO_PH4 /*!< Set PH4 function to SPI1_MISO */ -#define SET_SPI1_MISO_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SPI1_MISO_PC7_Msk)) | SPI1_MISO_PC7 /*!< Set PC7 function to SPI1_MISO */ -#define SET_SPI1_MISO_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SPI1_MISO_PB5_Msk)) | SPI1_MISO_PB5 /*!< Set PB5 function to SPI1_MISO */ -#define SET_SPI1_MISO_PI7() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~SPI1_MISO_PI7_Msk)) | SPI1_MISO_PI7 /*!< Set PI7 function to SPI1_MISO */ -#define SET_SPI1_MISO_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SPI1_MISO_PD7_Msk)) | SPI1_MISO_PD7 /*!< Set PD7 function to SPI1_MISO */ -#define SET_SPI1_MOSI_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SPI1_MOSI_PD6_Msk)) | SPI1_MOSI_PD6 /*!< Set PD6 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PH5() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~SPI1_MOSI_PH5_Msk)) | SPI1_MOSI_PH5 /*!< Set PH5 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PI8() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~SPI1_MOSI_PI8_Msk)) | SPI1_MOSI_PI8 /*!< Set PI8 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SPI1_MOSI_PE0_Msk)) | SPI1_MOSI_PE0 /*!< Set PE0 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI1_MOSI_PC2_Msk)) | SPI1_MOSI_PC2 /*!< Set PC2 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SPI1_MOSI_PC6_Msk)) | SPI1_MOSI_PC6 /*!< Set PC6 function to SPI1_MOSI */ -#define SET_SPI1_MOSI_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SPI1_MOSI_PB4_Msk)) | SPI1_MOSI_PB4 /*!< Set PB4 function to SPI1_MOSI */ -#define SET_SPI1_SS_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI1_SS_PA6_Msk)) | SPI1_SS_PA6 /*!< Set PA6 function to SPI1_SS */ -#define SET_SPI1_SS_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~SPI1_SS_PH9_Msk)) | SPI1_SS_PH9 /*!< Set PH9 function to SPI1_SS */ -#define SET_SPI1_SS_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI1_SS_PC0_Msk)) | SPI1_SS_PC0 /*!< Set PC0 function to SPI1_SS */ -#define SET_SPI1_SS_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI1_SS_PB2_Msk)) | SPI1_SS_PB2 /*!< Set PB2 function to SPI1_SS */ -#define SET_SPI1_SS_PI10() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~SPI1_SS_PI10_Msk)) | SPI1_SS_PI10 /*!< Set PI10 function to SPI1_SS */ -#define SET_SPI1_SS_PD4() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~SPI1_SS_PD4_Msk)) | SPI1_SS_PD4 /*!< Set PD4 function to SPI1_SS */ -#define SET_SPI1_SS_PH7() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~SPI1_SS_PH7_Msk)) | SPI1_SS_PH7 /*!< Set PH7 function to SPI1_SS */ -#define SET_SPI2_CLK_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~SPI2_CLK_PE8_Msk)) | SPI2_CLK_PE8 /*!< Set PE8 function to SPI2_CLK */ -#define SET_SPI2_CLK_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SPI2_CLK_PA10_Msk)) | SPI2_CLK_PA10 /*!< Set PA10 function to SPI2_CLK */ -#define SET_SPI2_CLK_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI2_CLK_PA13_Msk)) | SPI2_CLK_PA13 /*!< Set PA13 function to SPI2_CLK */ -#define SET_SPI2_CLK_PG3() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~SPI2_CLK_PG3_Msk)) | SPI2_CLK_PG3 /*!< Set PG3 function to SPI2_CLK */ -#define SET_SPI2_I2SMCLK_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~SPI2_I2SMCLK_PG1_Msk)) | SPI2_I2SMCLK_PG1 /*!< Set PG1 function to SPI2_I2SMCLK */ -#define SET_SPI2_I2SMCLK_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SPI2_I2SMCLK_PC13_Msk)) | SPI2_I2SMCLK_PC13 /*!< Set PC13 function to SPI2_I2SMCLK */ -#define SET_SPI2_I2SMCLK_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI2_I2SMCLK_PB0_Msk)) | SPI2_I2SMCLK_PB0 /*!< Set PB0 function to SPI2_I2SMCLK */ -#define SET_SPI2_I2SMCLK_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~SPI2_I2SMCLK_PE12_Msk)) | SPI2_I2SMCLK_PE12 /*!< Set PE12 function to SPI2_I2SMCLK */ -#define SET_SPI2_MISO_PG4() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~SPI2_MISO_PG4_Msk)) | SPI2_MISO_PG4 /*!< Set PG4 function to SPI2_MISO */ -#define SET_SPI2_MISO_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~SPI2_MISO_PE9_Msk)) | SPI2_MISO_PE9 /*!< Set PE9 function to SPI2_MISO */ -#define SET_SPI2_MISO_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SPI2_MISO_PA9_Msk)) | SPI2_MISO_PA9 /*!< Set PA9 function to SPI2_MISO */ -#define SET_SPI2_MISO_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI2_MISO_PA14_Msk)) | SPI2_MISO_PA14 /*!< Set PA14 function to SPI2_MISO */ -#define SET_SPI2_MOSI_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SPI2_MOSI_PA8_Msk)) | SPI2_MOSI_PA8 /*!< Set PA8 function to SPI2_MOSI */ -#define SET_SPI2_MOSI_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI2_MOSI_PA15_Msk)) | SPI2_MOSI_PA15 /*!< Set PA15 function to SPI2_MOSI */ -#define SET_SPI2_MOSI_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~SPI2_MOSI_PF11_Msk)) | SPI2_MOSI_PF11 /*!< Set PF11 function to SPI2_MOSI */ -#define SET_SPI2_MOSI_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~SPI2_MOSI_PE10_Msk)) | SPI2_MOSI_PE10 /*!< Set PE10 function to SPI2_MOSI */ -#define SET_SPI2_SS_PG2() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~SPI2_SS_PG2_Msk)) | SPI2_SS_PG2 /*!< Set PG2 function to SPI2_SS */ -#define SET_SPI2_SS_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SPI2_SS_PA11_Msk)) | SPI2_SS_PA11 /*!< Set PA11 function to SPI2_SS */ -#define SET_SPI2_SS_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI2_SS_PA12_Msk)) | SPI2_SS_PA12 /*!< Set PA12 function to SPI2_SS */ -#define SET_SPI2_SS_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~SPI2_SS_PE11_Msk)) | SPI2_SS_PE11 /*!< Set PE11 function to SPI2_SS */ -#define SET_SPI3_CLK_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~SPI3_CLK_PC10_Msk)) | SPI3_CLK_PC10 /*!< Set PC10 function to SPI3_CLK */ -#define SET_SPI3_CLK_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~SPI3_CLK_PB11_Msk)) | SPI3_CLK_PB11 /*!< Set PB11 function to SPI3_CLK */ -#define SET_SPI3_CLK_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SPI3_CLK_PE4_Msk)) | SPI3_CLK_PE4 /*!< Set PE4 function to SPI3_CLK */ -#define SET_SPI3_CLK_PG6() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~SPI3_CLK_PG6_Msk)) | SPI3_CLK_PG6 /*!< Set PG6 function to SPI3_CLK */ -#define SET_SPI3_CLK_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI3_CLK_PB13_Msk)) | SPI3_CLK_PB13 /*!< Set PB13 function to SPI3_CLK */ -#define SET_SPI3_I2SMCLK_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SPI3_I2SMCLK_PF6_Msk)) | SPI3_I2SMCLK_PF6 /*!< Set PF6 function to SPI3_I2SMCLK */ -#define SET_SPI3_I2SMCLK_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI3_I2SMCLK_PB1_Msk)) | SPI3_I2SMCLK_PB1 /*!< Set PB1 function to SPI3_I2SMCLK */ -#define SET_SPI3_I2SMCLK_PD14() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SPI3_I2SMCLK_PD14_Msk)) | SPI3_I2SMCLK_PD14 /*!< Set PD14 function to SPI3_I2SMCLK */ -#define SET_SPI3_I2SMCLK_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SPI3_I2SMCLK_PE6_Msk)) | SPI3_I2SMCLK_PE6 /*!< Set PE6 function to SPI3_I2SMCLK */ -#define SET_SPI3_MISO_PG7() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~SPI3_MISO_PG7_Msk)) | SPI3_MISO_PG7 /*!< Set PG7 function to SPI3_MISO */ -#define SET_SPI3_MISO_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~SPI3_MISO_PB9_Msk)) | SPI3_MISO_PB9 /*!< Set PB9 function to SPI3_MISO */ -#define SET_SPI3_MISO_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SPI3_MISO_PC12_Msk)) | SPI3_MISO_PC12 /*!< Set PC12 function to SPI3_MISO */ -#define SET_SPI3_MISO_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SPI3_MISO_PE3_Msk)) | SPI3_MISO_PE3 /*!< Set PE3 function to SPI3_MISO */ -#define SET_SPI3_MISO_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SPI3_MISO_PB7_Msk)) | SPI3_MISO_PB7 /*!< Set PB7 function to SPI3_MISO */ -#define SET_SPI3_MOSI_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~SPI3_MOSI_PB8_Msk)) | SPI3_MOSI_PB8 /*!< Set PB8 function to SPI3_MOSI */ -#define SET_SPI3_MOSI_PG8() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SPI3_MOSI_PG8_Msk)) | SPI3_MOSI_PG8 /*!< Set PG8 function to SPI3_MOSI */ -#define SET_SPI3_MOSI_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~SPI3_MOSI_PC11_Msk)) | SPI3_MOSI_PC11 /*!< Set PC11 function to SPI3_MOSI */ -#define SET_SPI3_MOSI_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SPI3_MOSI_PE2_Msk)) | SPI3_MOSI_PE2 /*!< Set PE2 function to SPI3_MOSI */ -#define SET_SPI3_MOSI_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~SPI3_MOSI_PB6_Msk)) | SPI3_MOSI_PB6 /*!< Set PB6 function to SPI3_MOSI */ -#define SET_SPI3_SS_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SPI3_SS_PE5_Msk)) | SPI3_SS_PE5 /*!< Set PE5 function to SPI3_SS */ -#define SET_SPI3_SS_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~SPI3_SS_PB10_Msk)) | SPI3_SS_PB10 /*!< Set PB10 function to SPI3_SS */ -#define SET_SPI3_SS_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~SPI3_SS_PC9_Msk)) | SPI3_SS_PC9 /*!< Set PC9 function to SPI3_SS */ -#define SET_SPI3_SS_PG5() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~SPI3_SS_PG5_Msk)) | SPI3_SS_PG5 /*!< Set PG5 function to SPI3_SS */ -#define SET_SPI3_SS_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI3_SS_PB12_Msk)) | SPI3_SS_PB12 /*!< Set PB12 function to SPI3_SS */ -#define SET_SPI4_CLK_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI4_CLK_PB2_Msk)) | SPI4_CLK_PB2 /*!< Set PB2 function to SPI4_CLK */ -#define SET_SPI4_MISO_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI4_MISO_PB1_Msk)) | SPI4_MISO_PB1 /*!< Set PB1 function to SPI4_MISO */ -#define SET_SPI4_MOSI_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI4_MOSI_PB0_Msk)) | SPI4_MOSI_PB0 /*!< Set PB0 function to SPI4_MOSI */ -#define SET_SPI4_SS_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~SPI4_SS_PB3_Msk)) | SPI4_SS_PB3 /*!< Set PB3 function to SPI4_SS */ -#define SET_SPI5_CLK_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SPI5_CLK_PF6_Msk)) | SPI5_CLK_PF6 /*!< Set PF6 function to SPI5_CLK */ -#define SET_SPI5_CLK_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI5_CLK_PA6_Msk)) | SPI5_CLK_PA6 /*!< Set PA6 function to SPI5_CLK */ -#define SET_SPI5_MISO_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SPI5_MISO_PF4_Msk)) | SPI5_MISO_PF4 /*!< Set PF4 function to SPI5_MISO */ -#define SET_SPI5_MOSI_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SPI5_MOSI_PF5_Msk)) | SPI5_MOSI_PF5 /*!< Set PF5 function to SPI5_MOSI */ -#define SET_SPI5_SS_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI5_SS_PA7_Msk)) | SPI5_SS_PA7 /*!< Set PA7 function to SPI5_SS */ -#define SET_SPI5_SS_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~SPI5_SS_PF7_Msk)) | SPI5_SS_PF7 /*!< Set PF7 function to SPI5_SS */ -#define SET_SPI6_CLK_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI6_CLK_PA6_Msk)) | SPI6_CLK_PA6 /*!< Set PA6 function to SPI6_CLK */ -#define SET_SPI6_MISO_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SPI6_MISO_PC7_Msk)) | SPI6_MISO_PC7 /*!< Set PC7 function to SPI6_MISO */ -#define SET_SPI6_MOSI_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SPI6_MOSI_PC6_Msk)) | SPI6_MOSI_PC6 /*!< Set PC6 function to SPI6_MOSI */ -#define SET_SPI6_SS_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPI6_SS_PA7_Msk)) | SPI6_SS_PA7 /*!< Set PA7 function to SPI6_SS */ -#define SET_SPI7_CLK_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI7_CLK_PC2_Msk)) | SPI7_CLK_PC2 /*!< Set PC2 function to SPI7_CLK */ -#define SET_SPI7_MISO_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI7_MISO_PC1_Msk)) | SPI7_MISO_PC1 /*!< Set PC1 function to SPI7_MISO */ -#define SET_SPI7_MOSI_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI7_MOSI_PC0_Msk)) | SPI7_MOSI_PC0 /*!< Set PC0 function to SPI7_MOSI */ -#define SET_SPI7_SS_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPI7_SS_PC3_Msk)) | SPI7_SS_PC3 /*!< Set PC3 function to SPI7_SS */ -#define SET_SPI8_CLK_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SPI8_CLK_PG10_Msk)) | SPI8_CLK_PG10 /*!< Set PG10 function to SPI8_CLK */ -#define SET_SPI8_MISO_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SPI8_MISO_PG12_Msk)) | SPI8_MISO_PG12 /*!< Set PG12 function to SPI8_MISO */ -#define SET_SPI8_MOSI_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SPI8_MOSI_PG11_Msk)) | SPI8_MOSI_PG11 /*!< Set PG11 function to SPI8_MOSI */ -#define SET_SPI8_SS_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SPI8_SS_PG9_Msk)) | SPI8_SS_PG9 /*!< Set PG9 function to SPI8_SS */ -#define SET_SPI9_CLK_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI9_CLK_PB15_Msk)) | SPI9_CLK_PB15 /*!< Set PB15 function to SPI9_CLK */ -#define SET_SPI9_CLK_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~SPI9_CLK_PD12_Msk)) | SPI9_CLK_PD12 /*!< Set PD12 function to SPI9_CLK */ -#define SET_SPI9_MISO_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI9_MISO_PB13_Msk)) | SPI9_MISO_PB13 /*!< Set PB13 function to SPI9_MISO */ -#define SET_SPI9_MISO_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~SPI9_MISO_PD11_Msk)) | SPI9_MISO_PD11 /*!< Set PD11 function to SPI9_MISO */ -#define SET_SPI9_MOSI_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~SPI9_MOSI_PD10_Msk)) | SPI9_MOSI_PD10 /*!< Set PD10 function to SPI9_MOSI */ -#define SET_SPI9_MOSI_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SPI9_MOSI_PC14_Msk)) | SPI9_MOSI_PC14 /*!< Set PC14 function to SPI9_MOSI */ -#define SET_SPI9_SS_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~SPI9_SS_PC13_Msk)) | SPI9_SS_PC13 /*!< Set PC13 function to SPI9_SS */ -#define SET_SPI9_SS_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~SPI9_SS_PB14_Msk)) | SPI9_SS_PB14 /*!< Set PB14 function to SPI9_SS */ -#define SET_SPI10_CLK_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI10_CLK_PA13_Msk)) | SPI10_CLK_PA13 /*!< Set PA13 function to SPI10_CLK */ -#define SET_SPI10_MISO_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI10_MISO_PA14_Msk)) | SPI10_MISO_PA14 /*!< Set PA14 function to SPI10_MISO */ -#define SET_SPI10_MOSI_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI10_MOSI_PA15_Msk)) | SPI10_MOSI_PA15 /*!< Set PA15 function to SPI10_MOSI */ -#define SET_SPI10_SS_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPI10_SS_PA12_Msk)) | SPI10_SS_PA12 /*!< Set PA12 function to SPI10_SS */ -#define SET_SPIM_CLK_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SPIM_CLK_PE4_Msk)) | SPIM_CLK_PE4 /*!< Set PE4 function to SPIM_CLK */ -#define SET_SPIM_CLK_PJ12() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~SPIM_CLK_PJ12_Msk)) | SPIM_CLK_PJ12 /*!< Set PJ12 function to SPIM_CLK */ -#define SET_SPIM_CLK_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SPIM_CLK_PG12_Msk)) | SPIM_CLK_PG12 /*!< Set PG12 function to SPIM_CLK */ -#define SET_SPIM_CLK_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPIM_CLK_PA2_Msk)) | SPIM_CLK_PA2 /*!< Set PA2 function to SPIM_CLK */ -#define SET_SPIM_CLK_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPIM_CLK_PC2_Msk)) | SPIM_CLK_PC2 /*!< Set PC2 function to SPIM_CLK */ -#define SET_SPIM_CLK_PJ0() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~SPIM_CLK_PJ0_Msk)) | SPIM_CLK_PJ0 /*!< Set PJ0 function to SPIM_CLK */ -#define SET_SPIM_D2_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SPIM_D2_PJ10_Msk)) | SPIM_D2_PJ10 /*!< Set PJ10 function to SPIM_D2 */ -#define SET_SPIM_D2_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SPIM_D2_PE7_Msk)) | SPIM_D2_PE7 /*!< Set PE7 function to SPIM_D2 */ -#define SET_SPIM_D2_PI14() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~SPIM_D2_PI14_Msk)) | SPIM_D2_PI14 /*!< Set PI14 function to SPIM_D2 */ -#define SET_SPIM_D2_PG9() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SPIM_D2_PG9_Msk)) | SPIM_D2_PG9 /*!< Set PG9 function to SPIM_D2 */ -#define SET_SPIM_D2_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SPIM_D2_PC5_Msk)) | SPIM_D2_PC5 /*!< Set PC5 function to SPIM_D2 */ -#define SET_SPIM_D2_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPIM_D2_PA5_Msk)) | SPIM_D2_PA5 /*!< Set PA5 function to SPIM_D2 */ -#define SET_SPIM_D3_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SPIM_D3_PJ11_Msk)) | SPIM_D3_PJ11 /*!< Set PJ11 function to SPIM_D3 */ -#define SET_SPIM_D3_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SPIM_D3_PE6_Msk)) | SPIM_D3_PE6 /*!< Set PE6 function to SPIM_D3 */ -#define SET_SPIM_D3_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~SPIM_D3_PC4_Msk)) | SPIM_D3_PC4 /*!< Set PC4 function to SPIM_D3 */ -#define SET_SPIM_D3_PG10() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SPIM_D3_PG10_Msk)) | SPIM_D3_PG10 /*!< Set PG10 function to SPIM_D3 */ -#define SET_SPIM_D3_PI15() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~SPIM_D3_PI15_Msk)) | SPIM_D3_PI15 /*!< Set PI15 function to SPIM_D3 */ -#define SET_SPIM_D3_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~SPIM_D3_PA4_Msk)) | SPIM_D3_PA4 /*!< Set PA4 function to SPIM_D3 */ -#define SET_SPIM_MISO_PJ9() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SPIM_MISO_PJ9_Msk)) | SPIM_MISO_PJ9 /*!< Set PJ9 function to SPIM_MISO */ -#define SET_SPIM_MISO_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SPIM_MISO_PG13_Msk)) | SPIM_MISO_PG13 /*!< Set PG13 function to SPIM_MISO */ -#define SET_SPIM_MISO_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SPIM_MISO_PE3_Msk)) | SPIM_MISO_PE3 /*!< Set PE3 function to SPIM_MISO */ -#define SET_SPIM_MISO_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPIM_MISO_PC1_Msk)) | SPIM_MISO_PC1 /*!< Set PC1 function to SPIM_MISO */ -#define SET_SPIM_MISO_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPIM_MISO_PA1_Msk)) | SPIM_MISO_PA1 /*!< Set PA1 function to SPIM_MISO */ -#define SET_SPIM_MISO_PI13() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~SPIM_MISO_PI13_Msk)) | SPIM_MISO_PI13 /*!< Set PI13 function to SPIM_MISO */ -#define SET_SPIM_MOSI_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPIM_MOSI_PA0_Msk)) | SPIM_MOSI_PA0 /*!< Set PA0 function to SPIM_MOSI */ -#define SET_SPIM_MOSI_PG14() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~SPIM_MOSI_PG14_Msk)) | SPIM_MOSI_PG14 /*!< Set PG14 function to SPIM_MOSI */ -#define SET_SPIM_MOSI_PJ13() SYS->GPJ_MFP3 = (SYS->GPJ_MFP3 & (~SPIM_MOSI_PJ13_Msk)) | SPIM_MOSI_PJ13 /*!< Set PJ13 function to SPIM_MOSI */ -#define SET_SPIM_MOSI_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPIM_MOSI_PC0_Msk)) | SPIM_MOSI_PC0 /*!< Set PC0 function to SPIM_MOSI */ -#define SET_SPIM_MOSI_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~SPIM_MOSI_PA15_Msk)) | SPIM_MOSI_PA15 /*!< Set PA15 function to SPIM_MOSI */ -#define SET_SPIM_MOSI_PJ1() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~SPIM_MOSI_PJ1_Msk)) | SPIM_MOSI_PJ1 /*!< Set PJ1 function to SPIM_MOSI */ -#define SET_SPIM_MOSI_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~SPIM_MOSI_PE2_Msk)) | SPIM_MOSI_PE2 /*!< Set PE2 function to SPIM_MOSI */ -#define SET_SPIM_SS_PJ8() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~SPIM_SS_PJ8_Msk)) | SPIM_SS_PJ8 /*!< Set PJ8 function to SPIM_SS */ -#define SET_SPIM_SS_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~SPIM_SS_PG11_Msk)) | SPIM_SS_PG11 /*!< Set PG11 function to SPIM_SS */ -#define SET_SPIM_SS_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~SPIM_SS_PC3_Msk)) | SPIM_SS_PC3 /*!< Set PC3 function to SPIM_SS */ -#define SET_SPIM_SS_PI12() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~SPIM_SS_PI12_Msk)) | SPIM_SS_PI12 /*!< Set PI12 function to SPIM_SS */ -#define SET_SPIM_SS_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SPIM_SS_PA3_Msk)) | SPIM_SS_PA3 /*!< Set PA3 function to SPIM_SS */ -#define SET_SPIM_SS_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~SPIM_SS_PE5_Msk)) | SPIM_SS_PE5 /*!< Set PE5 function to SPIM_SS */ -#define SET_SWDH_CLK_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SWDH_CLK_PA10_Msk)) | SWDH_CLK_PA10 /*!< Set PA10 function to SWDH_CLK */ -#define SET_SWDH_DAT_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~SWDH_DAT_PA9_Msk)) | SWDH_DAT_PA9 /*!< Set PA9 function to SWDH_DAT */ -#define SET_TAMPER0_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~TAMPER0_PF6_Msk)) | TAMPER0_PF6 /*!< Set PF6 function to TAMPER0 */ -#define SET_TAMPER1_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~TAMPER1_PF7_Msk)) | TAMPER1_PF7 /*!< Set PF7 function to TAMPER1 */ -#define SET_TAMPER2_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~TAMPER2_PF8_Msk)) | TAMPER2_PF8 /*!< Set PF8 function to TAMPER2 */ -#define SET_TAMPER3_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~TAMPER3_PF9_Msk)) | TAMPER3_PF9 /*!< Set PF9 function to TAMPER3 */ -#define SET_TAMPER4_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~TAMPER4_PF10_Msk)) | TAMPER4_PF10 /*!< Set PF10 function to TAMPER4 */ -#define SET_TAMPER5_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~TAMPER5_PF11_Msk)) | TAMPER5_PF11 /*!< Set PF11 function to TAMPER5 */ -#define SET_TM0_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~TM0_PC7_Msk)) | TM0_PC7 /*!< Set PC7 function to TM0 */ -#define SET_TM0_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~TM0_PB5_Msk)) | TM0_PB5 /*!< Set PB5 function to TM0 */ -#define SET_TM0_PG2() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~TM0_PG2_Msk)) | TM0_PG2 /*!< Set PG2 function to TM0 */ -#define SET_TM0_EXT_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~TM0_EXT_PA11_Msk)) | TM0_EXT_PA11 /*!< Set PA11 function to TM0_EXT */ -#define SET_TM0_EXT_PH0() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~TM0_EXT_PH0_Msk)) | TM0_EXT_PH0 /*!< Set PH0 function to TM0_EXT */ -#define SET_TM0_EXT_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~TM0_EXT_PB15_Msk)) | TM0_EXT_PB15 /*!< Set PB15 function to TM0_EXT */ -#define SET_TM1_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~TM1_PC6_Msk)) | TM1_PC6 /*!< Set PC6 function to TM1 */ -#define SET_TM1_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~TM1_PB4_Msk)) | TM1_PB4 /*!< Set PB4 function to TM1 */ -#define SET_TM1_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~TM1_PC14_Msk)) | TM1_PC14 /*!< Set PC14 function to TM1 */ -#define SET_TM1_PG3() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~TM1_PG3_Msk)) | TM1_PG3 /*!< Set PG3 function to TM1 */ -#define SET_TM1_EXT_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~TM1_EXT_PA10_Msk)) | TM1_EXT_PA10 /*!< Set PA10 function to TM1_EXT */ -#define SET_TM1_EXT_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~TM1_EXT_PB14_Msk)) | TM1_EXT_PB14 /*!< Set PB14 function to TM1_EXT */ -#define SET_TM1_EXT_PH1() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~TM1_EXT_PH1_Msk)) | TM1_EXT_PH1 /*!< Set PH1 function to TM1_EXT */ -#define SET_TM2_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~TM2_PB3_Msk)) | TM2_PB3 /*!< Set PB3 function to TM2 */ -#define SET_TM2_PG4() SYS->GPG_MFP1 = (SYS->GPG_MFP1 & (~TM2_PG4_Msk)) | TM2_PG4 /*!< Set PG4 function to TM2 */ -#define SET_TM2_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~TM2_PD0_Msk)) | TM2_PD0 /*!< Set PD0 function to TM2 */ -#define SET_TM2_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~TM2_PA7_Msk)) | TM2_PA7 /*!< Set PA7 function to TM2 */ -#define SET_TM2_EXT_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~TM2_EXT_PB13_Msk)) | TM2_EXT_PB13 /*!< Set PB13 function to TM2_EXT */ -#define SET_TM2_EXT_PH2() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~TM2_EXT_PH2_Msk)) | TM2_EXT_PH2 /*!< Set PH2 function to TM2_EXT */ -#define SET_TM2_EXT_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~TM2_EXT_PA9_Msk)) | TM2_EXT_PA9 /*!< Set PA9 function to TM2_EXT */ -#define SET_TM3_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~TM3_PF11_Msk)) | TM3_PF11 /*!< Set PF11 function to TM3 */ -#define SET_TM3_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~TM3_PA6_Msk)) | TM3_PA6 /*!< Set PA6 function to TM3 */ -#define SET_TM3_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~TM3_PB2_Msk)) | TM3_PB2 /*!< Set PB2 function to TM3 */ -#define SET_TM3_EXT_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~TM3_EXT_PA8_Msk)) | TM3_EXT_PA8 /*!< Set PA8 function to TM3_EXT */ -#define SET_TM3_EXT_PH3() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~TM3_EXT_PH3_Msk)) | TM3_EXT_PH3 /*!< Set PH3 function to TM3_EXT */ -#define SET_TM3_EXT_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~TM3_EXT_PB12_Msk)) | TM3_EXT_PB12 /*!< Set PB12 function to TM3_EXT */ -#define SET_TRACE_CLK_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~TRACE_CLK_PE12_Msk)) | TRACE_CLK_PE12 /*!< Set PE12 function to TRACE_CLK */ -#define SET_TRACE_DATA0_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~TRACE_DATA0_PE11_Msk)) | TRACE_DATA0_PE11 /*!< Set PE11 function to TRACE_DATA0 */ -#define SET_TRACE_DATA1_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~TRACE_DATA1_PE10_Msk)) | TRACE_DATA1_PE10 /*!< Set PE10 function to TRACE_DATA1 */ -#define SET_TRACE_DATA2_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~TRACE_DATA2_PE9_Msk)) | TRACE_DATA2_PE9 /*!< Set PE9 function to TRACE_DATA2 */ -#define SET_TRACE_DATA3_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~TRACE_DATA3_PE8_Msk)) | TRACE_DATA3_PE8 /*!< Set PE8 function to TRACE_DATA3 */ -#define SET_UART0_RXD_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART0_RXD_PA0_Msk)) | UART0_RXD_PA0 /*!< Set PA0 function to UART0_RXD */ -#define SET_UART0_RXD_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART0_RXD_PC11_Msk)) | UART0_RXD_PC11 /*!< Set PC11 function to UART0_RXD */ -#define SET_UART0_RXD_PH11() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART0_RXD_PH11_Msk)) | UART0_RXD_PH11 /*!< Set PH11 function to UART0_RXD */ -#define SET_UART0_RXD_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART0_RXD_PA4_Msk)) | UART0_RXD_PA4 /*!< Set PA4 function to UART0_RXD */ -#define SET_UART0_RXD_PA6() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART0_RXD_PA6_Msk)) | UART0_RXD_PA6 /*!< Set PA6 function to UART0_RXD */ -#define SET_UART0_RXD_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~UART0_RXD_PD2_Msk)) | UART0_RXD_PD2 /*!< Set PD2 function to UART0_RXD */ -#define SET_UART0_RXD_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART0_RXD_PB8_Msk)) | UART0_RXD_PB8 /*!< Set PB8 function to UART0_RXD */ -#define SET_UART0_RXD_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART0_RXD_PF1_Msk)) | UART0_RXD_PF1 /*!< Set PF1 function to UART0_RXD */ -#define SET_UART0_RXD_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~UART0_RXD_PA15_Msk)) | UART0_RXD_PA15 /*!< Set PA15 function to UART0_RXD */ -#define SET_UART0_RXD_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART0_RXD_PF2_Msk)) | UART0_RXD_PF2 /*!< Set PF2 function to UART0_RXD */ -#define SET_UART0_RXD_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART0_RXD_PB12_Msk)) | UART0_RXD_PB12 /*!< Set PB12 function to UART0_RXD */ -#define SET_UART0_TXD_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~UART0_TXD_PD3_Msk)) | UART0_TXD_PD3 /*!< Set PD3 function to UART0_TXD */ -#define SET_UART0_TXD_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART0_TXD_PA5_Msk)) | UART0_TXD_PA5 /*!< Set PA5 function to UART0_TXD */ -#define SET_UART0_TXD_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART0_TXD_PF0_Msk)) | UART0_TXD_PF0 /*!< Set PF0 function to UART0_TXD */ -#define SET_UART0_TXD_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART0_TXD_PB9_Msk)) | UART0_TXD_PB9 /*!< Set PB9 function to UART0_TXD */ -#define SET_UART0_TXD_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART0_TXD_PF3_Msk)) | UART0_TXD_PF3 /*!< Set PF3 function to UART0_TXD */ -#define SET_UART0_TXD_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART0_TXD_PA1_Msk)) | UART0_TXD_PA1 /*!< Set PA1 function to UART0_TXD */ -#define SET_UART0_TXD_PA7() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART0_TXD_PA7_Msk)) | UART0_TXD_PA7 /*!< Set PA7 function to UART0_TXD */ -#define SET_UART0_TXD_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~UART0_TXD_PA14_Msk)) | UART0_TXD_PA14 /*!< Set PA14 function to UART0_TXD */ -#define SET_UART0_TXD_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~UART0_TXD_PC12_Msk)) | UART0_TXD_PC12 /*!< Set PC12 function to UART0_TXD */ -#define SET_UART0_TXD_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART0_TXD_PB13_Msk)) | UART0_TXD_PB13 /*!< Set PB13 function to UART0_TXD */ -#define SET_UART0_TXD_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART0_TXD_PH10_Msk)) | UART0_TXD_PH10 /*!< Set PH10 function to UART0_TXD */ -#define SET_UART0_nCTS_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART0_nCTS_PC7_Msk)) | UART0_nCTS_PC7 /*!< Set PC7 function to UART0_nCTS */ -#define SET_UART0_nCTS_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART0_nCTS_PB15_Msk)) | UART0_nCTS_PB15 /*!< Set PB15 function to UART0_nCTS */ -#define SET_UART0_nCTS_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART0_nCTS_PA5_Msk)) | UART0_nCTS_PA5 /*!< Set PA5 function to UART0_nCTS */ -#define SET_UART0_nCTS_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART0_nCTS_PB11_Msk)) | UART0_nCTS_PB11 /*!< Set PB11 function to UART0_nCTS */ -#define SET_UART0_nRTS_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART0_nRTS_PA4_Msk)) | UART0_nRTS_PA4 /*!< Set PA4 function to UART0_nRTS */ -#define SET_UART0_nRTS_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART0_nRTS_PB14_Msk)) | UART0_nRTS_PB14 /*!< Set PB14 function to UART0_nRTS */ -#define SET_UART0_nRTS_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART0_nRTS_PB10_Msk)) | UART0_nRTS_PB10 /*!< Set PB10 function to UART0_nRTS */ -#define SET_UART0_nRTS_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART0_nRTS_PC6_Msk)) | UART0_nRTS_PC6 /*!< Set PC6 function to UART0_nRTS */ -#define SET_UART1_RXD_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART1_RXD_PH9_Msk)) | UART1_RXD_PH9 /*!< Set PH9 function to UART1_RXD */ -#define SET_UART1_RXD_PD6() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~UART1_RXD_PD6_Msk)) | UART1_RXD_PD6 /*!< Set PD6 function to UART1_RXD */ -#define SET_UART1_RXD_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART1_RXD_PF1_Msk)) | UART1_RXD_PF1 /*!< Set PF1 function to UART1_RXD */ -#define SET_UART1_RXD_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART1_RXD_PA2_Msk)) | UART1_RXD_PA2 /*!< Set PA2 function to UART1_RXD */ -#define SET_UART1_RXD_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART1_RXD_PC8_Msk)) | UART1_RXD_PC8 /*!< Set PC8 function to UART1_RXD */ -#define SET_UART1_RXD_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~UART1_RXD_PB2_Msk)) | UART1_RXD_PB2 /*!< Set PB2 function to UART1_RXD */ -#define SET_UART1_RXD_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART1_RXD_PD10_Msk)) | UART1_RXD_PD10 /*!< Set PD10 function to UART1_RXD */ -#define SET_UART1_RXD_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~UART1_RXD_PG1_Msk)) | UART1_RXD_PG1 /*!< Set PG1 function to UART1_RXD */ -#define SET_UART1_RXD_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~UART1_RXD_PB6_Msk)) | UART1_RXD_PB6 /*!< Set PB6 function to UART1_RXD */ -#define SET_UART1_RXD_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~UART1_RXD_PA8_Msk)) | UART1_RXD_PA8 /*!< Set PA8 function to UART1_RXD */ -#define SET_UART1_TXD_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART1_TXD_PA3_Msk)) | UART1_TXD_PA3 /*!< Set PA3 function to UART1_TXD */ -#define SET_UART1_TXD_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART1_TXD_PD11_Msk)) | UART1_TXD_PD11 /*!< Set PD11 function to UART1_TXD */ -#define SET_UART1_TXD_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART1_TXD_PH8_Msk)) | UART1_TXD_PH8 /*!< Set PH8 function to UART1_TXD */ -#define SET_UART1_TXD_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~UART1_TXD_PB3_Msk)) | UART1_TXD_PB3 /*!< Set PB3 function to UART1_TXD */ -#define SET_UART1_TXD_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~UART1_TXD_PB7_Msk)) | UART1_TXD_PB7 /*!< Set PB7 function to UART1_TXD */ -#define SET_UART1_TXD_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~UART1_TXD_PA9_Msk)) | UART1_TXD_PA9 /*!< Set PA9 function to UART1_TXD */ -#define SET_UART1_TXD_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART1_TXD_PF0_Msk)) | UART1_TXD_PF0 /*!< Set PF0 function to UART1_TXD */ -#define SET_UART1_TXD_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~UART1_TXD_PE13_Msk)) | UART1_TXD_PE13 /*!< Set PE13 function to UART1_TXD */ -#define SET_UART1_TXD_PD7() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~UART1_TXD_PD7_Msk)) | UART1_TXD_PD7 /*!< Set PD7 function to UART1_TXD */ -#define SET_UART1_TXD_PG0() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~UART1_TXD_PG0_Msk)) | UART1_TXD_PG0 /*!< Set PG0 function to UART1_TXD */ -#define SET_UART1_nCTS_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~UART1_nCTS_PE11_Msk)) | UART1_nCTS_PE11 /*!< Set PE11 function to UART1_nCTS */ -#define SET_UART1_nCTS_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART1_nCTS_PB9_Msk)) | UART1_nCTS_PB9 /*!< Set PB9 function to UART1_nCTS */ -#define SET_UART1_nCTS_PA1() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART1_nCTS_PA1_Msk)) | UART1_nCTS_PA1 /*!< Set PA1 function to UART1_nCTS */ -#define SET_UART1_nRTS_PE12() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~UART1_nRTS_PE12_Msk)) | UART1_nRTS_PE12 /*!< Set PE12 function to UART1_nRTS */ -#define SET_UART1_nRTS_PA0() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART1_nRTS_PA0_Msk)) | UART1_nRTS_PA0 /*!< Set PA0 function to UART1_nRTS */ -#define SET_UART1_nRTS_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART1_nRTS_PB8_Msk)) | UART1_nRTS_PB8 /*!< Set PB8 function to UART1_nRTS */ -#define SET_UART2_RXD_PC0() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~UART2_RXD_PC0_Msk)) | UART2_RXD_PC0 /*!< Set PC0 function to UART2_RXD */ -#define SET_UART2_RXD_PE9() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~UART2_RXD_PE9_Msk)) | UART2_RXD_PE9 /*!< Set PE9 function to UART2_RXD */ -#define SET_UART2_RXD_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~UART2_RXD_PB0_Msk)) | UART2_RXD_PB0 /*!< Set PB0 function to UART2_RXD */ -#define SET_UART2_RXD_PF1() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART2_RXD_PF1_Msk)) | UART2_RXD_PF1 /*!< Set PF1 function to UART2_RXD */ -#define SET_UART2_RXD_PI7() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~UART2_RXD_PI7_Msk)) | UART2_RXD_PI7 /*!< Set PI7 function to UART2_RXD */ -#define SET_UART2_RXD_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~UART2_RXD_PD12_Msk)) | UART2_RXD_PD12 /*!< Set PD12 function to UART2_RXD */ -#define SET_UART2_RXD_PE15() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~UART2_RXD_PE15_Msk)) | UART2_RXD_PE15 /*!< Set PE15 function to UART2_RXD */ -#define SET_UART2_RXD_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART2_RXD_PC4_Msk)) | UART2_RXD_PC4 /*!< Set PC4 function to UART2_RXD */ -#define SET_UART2_RXD_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~UART2_RXD_PF5_Msk)) | UART2_RXD_PF5 /*!< Set PF5 function to UART2_RXD */ -#define SET_UART2_RXD_PG0() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~UART2_RXD_PG0_Msk)) | UART2_RXD_PG0 /*!< Set PG0 function to UART2_RXD */ -#define SET_UART2_RXD_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~UART2_RXD_PB4_Msk)) | UART2_RXD_PB4 /*!< Set PB4 function to UART2_RXD */ -#define SET_UART2_RXD_PI11() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~UART2_RXD_PI11_Msk)) | UART2_RXD_PI11 /*!< Set PI11 function to UART2_RXD */ -#define SET_UART2_TXD_PE8() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~UART2_TXD_PE8_Msk)) | UART2_TXD_PE8 /*!< Set PE8 function to UART2_TXD */ -#define SET_UART2_TXD_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART2_TXD_PC5_Msk)) | UART2_TXD_PC5 /*!< Set PC5 function to UART2_TXD */ -#define SET_UART2_TXD_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~UART2_TXD_PB5_Msk)) | UART2_TXD_PB5 /*!< Set PB5 function to UART2_TXD */ -#define SET_UART2_TXD_PF0() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART2_TXD_PF0_Msk)) | UART2_TXD_PF0 /*!< Set PF0 function to UART2_TXD */ -#define SET_UART2_TXD_PG1() SYS->GPG_MFP0 = (SYS->GPG_MFP0 & (~UART2_TXD_PG1_Msk)) | UART2_TXD_PG1 /*!< Set PG1 function to UART2_TXD */ -#define SET_UART2_TXD_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~UART2_TXD_PC13_Msk)) | UART2_TXD_PC13 /*!< Set PC13 function to UART2_TXD */ -#define SET_UART2_TXD_PE14() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~UART2_TXD_PE14_Msk)) | UART2_TXD_PE14 /*!< Set PE14 function to UART2_TXD */ -#define SET_UART2_TXD_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~UART2_TXD_PF4_Msk)) | UART2_TXD_PF4 /*!< Set PF4 function to UART2_TXD */ -#define SET_UART2_TXD_PI10() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~UART2_TXD_PI10_Msk)) | UART2_TXD_PI10 /*!< Set PI10 function to UART2_TXD */ -#define SET_UART2_TXD_PI6() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~UART2_TXD_PI6_Msk)) | UART2_TXD_PI6 /*!< Set PI6 function to UART2_TXD */ -#define SET_UART2_TXD_PB1() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~UART2_TXD_PB1_Msk)) | UART2_TXD_PB1 /*!< Set PB1 function to UART2_TXD */ -#define SET_UART2_TXD_PC1() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~UART2_TXD_PC1_Msk)) | UART2_TXD_PC1 /*!< Set PC1 function to UART2_TXD */ -#define SET_UART2_nCTS_PD9() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART2_nCTS_PD9_Msk)) | UART2_nCTS_PD9 /*!< Set PD9 function to UART2_nCTS */ -#define SET_UART2_nCTS_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~UART2_nCTS_PC2_Msk)) | UART2_nCTS_PC2 /*!< Set PC2 function to UART2_nCTS */ -#define SET_UART2_nCTS_PI9() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~UART2_nCTS_PI9_Msk)) | UART2_nCTS_PI9 /*!< Set PI9 function to UART2_nCTS */ -#define SET_UART2_nCTS_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~UART2_nCTS_PF5_Msk)) | UART2_nCTS_PF5 /*!< Set PF5 function to UART2_nCTS */ -#define SET_UART2_nRTS_PI8() SYS->GPI_MFP2 = (SYS->GPI_MFP2 & (~UART2_nRTS_PI8_Msk)) | UART2_nRTS_PI8 /*!< Set PI8 function to UART2_nRTS */ -#define SET_UART2_nRTS_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~UART2_nRTS_PF4_Msk)) | UART2_nRTS_PF4 /*!< Set PF4 function to UART2_nRTS */ -#define SET_UART2_nRTS_PD8() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART2_nRTS_PD8_Msk)) | UART2_nRTS_PD8 /*!< Set PD8 function to UART2_nRTS */ -#define SET_UART2_nRTS_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~UART2_nRTS_PC3_Msk)) | UART2_nRTS_PC3 /*!< Set PC3 function to UART2_nRTS */ -#define SET_UART3_RXD_PI15() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~UART3_RXD_PI15_Msk)) | UART3_RXD_PI15 /*!< Set PI15 function to UART3_RXD */ -#define SET_UART3_RXD_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART3_RXD_PE0_Msk)) | UART3_RXD_PE0 /*!< Set PE0 function to UART3_RXD */ -#define SET_UART3_RXD_PE11() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~UART3_RXD_PE11_Msk)) | UART3_RXD_PE11 /*!< Set PE11 function to UART3_RXD */ -#define SET_UART3_RXD_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART3_RXD_PB14_Msk)) | UART3_RXD_PB14 /*!< Set PB14 function to UART3_RXD */ -#define SET_UART3_RXD_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART3_RXD_PC9_Msk)) | UART3_RXD_PC9 /*!< Set PC9 function to UART3_RXD */ -#define SET_UART3_RXD_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~UART3_RXD_PD0_Msk)) | UART3_RXD_PD0 /*!< Set PD0 function to UART3_RXD */ -#define SET_UART3_RXD_PC2() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~UART3_RXD_PC2_Msk)) | UART3_RXD_PC2 /*!< Set PC2 function to UART3_RXD */ -#define SET_UART3_TXD_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART3_TXD_PB15_Msk)) | UART3_TXD_PB15 /*!< Set PB15 function to UART3_TXD */ -#define SET_UART3_TXD_PI14() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~UART3_TXD_PI14_Msk)) | UART3_TXD_PI14 /*!< Set PI14 function to UART3_TXD */ -#define SET_UART3_TXD_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~UART3_TXD_PD1_Msk)) | UART3_TXD_PD1 /*!< Set PD1 function to UART3_TXD */ -#define SET_UART3_TXD_PE10() SYS->GPE_MFP2 = (SYS->GPE_MFP2 & (~UART3_TXD_PE10_Msk)) | UART3_TXD_PE10 /*!< Set PE10 function to UART3_TXD */ -#define SET_UART3_TXD_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART3_TXD_PE1_Msk)) | UART3_TXD_PE1 /*!< Set PE1 function to UART3_TXD */ -#define SET_UART3_TXD_PC3() SYS->GPC_MFP0 = (SYS->GPC_MFP0 & (~UART3_TXD_PC3_Msk)) | UART3_TXD_PC3 /*!< Set PC3 function to UART3_TXD */ -#define SET_UART3_TXD_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART3_TXD_PC10_Msk)) | UART3_TXD_PC10 /*!< Set PC10 function to UART3_TXD */ -#define SET_UART3_nCTS_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART3_nCTS_PB12_Msk)) | UART3_nCTS_PB12 /*!< Set PB12 function to UART3_nCTS */ -#define SET_UART3_nCTS_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART3_nCTS_PH9_Msk)) | UART3_nCTS_PH9 /*!< Set PH9 function to UART3_nCTS */ -#define SET_UART3_nCTS_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~UART3_nCTS_PD2_Msk)) | UART3_nCTS_PD2 /*!< Set PD2 function to UART3_nCTS */ -#define SET_UART3_nRTS_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~UART3_nRTS_PB13_Msk)) | UART3_nRTS_PB13 /*!< Set PB13 function to UART3_nRTS */ -#define SET_UART3_nRTS_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART3_nRTS_PH8_Msk)) | UART3_nRTS_PH8 /*!< Set PH8 function to UART3_nRTS */ -#define SET_UART3_nRTS_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~UART3_nRTS_PD3_Msk)) | UART3_nRTS_PD3 /*!< Set PD3 function to UART3_nRTS */ -#define SET_UART4_RXD_PB10() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART4_RXD_PB10_Msk)) | UART4_RXD_PB10 /*!< Set PB10 function to UART4_RXD */ -#define SET_UART4_RXD_PI13() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~UART4_RXD_PI13_Msk)) | UART4_RXD_PI13 /*!< Set PI13 function to UART4_RXD */ -#define SET_UART4_RXD_PH3() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~UART4_RXD_PH3_Msk)) | UART4_RXD_PH3 /*!< Set PH3 function to UART4_RXD */ -#define SET_UART4_RXD_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~UART4_RXD_PA13_Msk)) | UART4_RXD_PA13 /*!< Set PA13 function to UART4_RXD */ -#define SET_UART4_RXD_PH11() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART4_RXD_PH11_Msk)) | UART4_RXD_PH11 /*!< Set PH11 function to UART4_RXD */ -#define SET_UART4_RXD_PA2() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART4_RXD_PA2_Msk)) | UART4_RXD_PA2 /*!< Set PA2 function to UART4_RXD */ -#define SET_UART4_RXD_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART4_RXD_PC6_Msk)) | UART4_RXD_PC6 /*!< Set PC6 function to UART4_RXD */ -#define SET_UART4_RXD_PF6() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~UART4_RXD_PF6_Msk)) | UART4_RXD_PF6 /*!< Set PF6 function to UART4_RXD */ -#define SET_UART4_RXD_PC4() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART4_RXD_PC4_Msk)) | UART4_RXD_PC4 /*!< Set PC4 function to UART4_RXD */ -#define SET_UART4_TXD_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~UART4_TXD_PA12_Msk)) | UART4_TXD_PA12 /*!< Set PA12 function to UART4_TXD */ -#define SET_UART4_TXD_PB11() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART4_TXD_PB11_Msk)) | UART4_TXD_PB11 /*!< Set PB11 function to UART4_TXD */ -#define SET_UART4_TXD_PF7() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~UART4_TXD_PF7_Msk)) | UART4_TXD_PF7 /*!< Set PF7 function to UART4_TXD */ -#define SET_UART4_TXD_PH2() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~UART4_TXD_PH2_Msk)) | UART4_TXD_PH2 /*!< Set PH2 function to UART4_TXD */ -#define SET_UART4_TXD_PI12() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~UART4_TXD_PI12_Msk)) | UART4_TXD_PI12 /*!< Set PI12 function to UART4_TXD */ -#define SET_UART4_TXD_PC5() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART4_TXD_PC5_Msk)) | UART4_TXD_PC5 /*!< Set PC5 function to UART4_TXD */ -#define SET_UART4_TXD_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART4_TXD_PC7_Msk)) | UART4_TXD_PC7 /*!< Set PC7 function to UART4_TXD */ -#define SET_UART4_TXD_PA3() SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~UART4_TXD_PA3_Msk)) | UART4_TXD_PA3 /*!< Set PA3 function to UART4_TXD */ -#define SET_UART4_TXD_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART4_TXD_PH10_Msk)) | UART4_TXD_PH10 /*!< Set PH10 function to UART4_TXD */ -#define SET_UART4_nCTS_PC8() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART4_nCTS_PC8_Msk)) | UART4_nCTS_PC8 /*!< Set PC8 function to UART4_nCTS */ -#define SET_UART4_nCTS_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART4_nCTS_PE1_Msk)) | UART4_nCTS_PE1 /*!< Set PE1 function to UART4_nCTS */ -#define SET_UART4_nRTS_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART4_nRTS_PE0_Msk)) | UART4_nRTS_PE0 /*!< Set PE0 function to UART4_nRTS */ -#define SET_UART4_nRTS_PE13() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~UART4_nRTS_PE13_Msk)) | UART4_nRTS_PE13 /*!< Set PE13 function to UART4_nRTS */ -#define SET_UART5_RXD_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART5_RXD_PF10_Msk)) | UART5_RXD_PF10 /*!< Set PF10 function to UART5_RXD */ -#define SET_UART5_RXD_PB4() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~UART5_RXD_PB4_Msk)) | UART5_RXD_PB4 /*!< Set PB4 function to UART5_RXD */ -#define SET_UART5_RXD_PH1() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~UART5_RXD_PH1_Msk)) | UART5_RXD_PH1 /*!< Set PH1 function to UART5_RXD */ -#define SET_UART5_RXD_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART5_RXD_PE6_Msk)) | UART5_RXD_PE6 /*!< Set PE6 function to UART5_RXD */ -#define SET_UART5_RXD_PA4() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART5_RXD_PA4_Msk)) | UART5_RXD_PA4 /*!< Set PA4 function to UART5_RXD */ -#define SET_UART5_TXD_PB5() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~UART5_TXD_PB5_Msk)) | UART5_TXD_PB5 /*!< Set PB5 function to UART5_TXD */ -#define SET_UART5_TXD_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART5_TXD_PF11_Msk)) | UART5_TXD_PF11 /*!< Set PF11 function to UART5_TXD */ -#define SET_UART5_TXD_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART5_TXD_PE7_Msk)) | UART5_TXD_PE7 /*!< Set PE7 function to UART5_TXD */ -#define SET_UART5_TXD_PA5() SYS->GPA_MFP1 = (SYS->GPA_MFP1 & (~UART5_TXD_PA5_Msk)) | UART5_TXD_PA5 /*!< Set PA5 function to UART5_TXD */ -#define SET_UART5_TXD_PH0() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~UART5_TXD_PH0_Msk)) | UART5_TXD_PH0 /*!< Set PH0 function to UART5_TXD */ -#define SET_UART5_nCTS_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART5_nCTS_PF8_Msk)) | UART5_nCTS_PF8 /*!< Set PF8 function to UART5_nCTS */ -#define SET_UART5_nCTS_PH3() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~UART5_nCTS_PH3_Msk)) | UART5_nCTS_PH3 /*!< Set PH3 function to UART5_nCTS */ -#define SET_UART5_nCTS_PB2() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~UART5_nCTS_PB2_Msk)) | UART5_nCTS_PB2 /*!< Set PB2 function to UART5_nCTS */ -#define SET_UART5_nRTS_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART5_nRTS_PF9_Msk)) | UART5_nRTS_PF9 /*!< Set PF9 function to UART5_nRTS */ -#define SET_UART5_nRTS_PH2() SYS->GPH_MFP0 = (SYS->GPH_MFP0 & (~UART5_nRTS_PH2_Msk)) | UART5_nRTS_PH2 /*!< Set PH2 function to UART5_nRTS */ -#define SET_UART5_nRTS_PB3() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~UART5_nRTS_PB3_Msk)) | UART5_nRTS_PB3 /*!< Set PB3 function to UART5_nRTS */ -#define SET_UART6_RXD_PE15() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~UART6_RXD_PE15_Msk)) | UART6_RXD_PE15 /*!< Set PE15 function to UART6_RXD */ -#define SET_UART6_RXD_PC6() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART6_RXD_PC6_Msk)) | UART6_RXD_PC6 /*!< Set PC6 function to UART6_RXD */ -#define SET_UART6_RXD_PH5() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART6_RXD_PH5_Msk)) | UART6_RXD_PH5 /*!< Set PH5 function to UART6_RXD */ -#define SET_UART6_RXD_PG14() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~UART6_RXD_PG14_Msk)) | UART6_RXD_PG14 /*!< Set PG14 function to UART6_RXD */ -#define SET_UART6_RXD_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~UART6_RXD_PA10_Msk)) | UART6_RXD_PA10 /*!< Set PA10 function to UART6_RXD */ -#define SET_UART6_RXD_PD13() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~UART6_RXD_PD13_Msk)) | UART6_RXD_PD13 /*!< Set PD13 function to UART6_RXD */ -#define SET_UART6_RXD_PC11() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART6_RXD_PC11_Msk)) | UART6_RXD_PC11 /*!< Set PC11 function to UART6_RXD */ -#define SET_UART6_RXD_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART6_RXD_PE4_Msk)) | UART6_RXD_PE4 /*!< Set PE4 function to UART6_RXD */ -#define SET_UART6_RXD_PJ11() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~UART6_RXD_PJ11_Msk)) | UART6_RXD_PJ11 /*!< Set PJ11 function to UART6_RXD */ -#define SET_UART6_TXD_PG13() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~UART6_TXD_PG13_Msk)) | UART6_TXD_PG13 /*!< Set PG13 function to UART6_TXD */ -#define SET_UART6_TXD_PE14() SYS->GPE_MFP3 = (SYS->GPE_MFP3 & (~UART6_TXD_PE14_Msk)) | UART6_TXD_PE14 /*!< Set PE14 function to UART6_TXD */ -#define SET_UART6_TXD_PC12() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~UART6_TXD_PC12_Msk)) | UART6_TXD_PC12 /*!< Set PC12 function to UART6_TXD */ -#define SET_UART6_TXD_PC7() SYS->GPC_MFP1 = (SYS->GPC_MFP1 & (~UART6_TXD_PC7_Msk)) | UART6_TXD_PC7 /*!< Set PC7 function to UART6_TXD */ -#define SET_UART6_TXD_PH4() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART6_TXD_PH4_Msk)) | UART6_TXD_PH4 /*!< Set PH4 function to UART6_TXD */ -#define SET_UART6_TXD_PJ10() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~UART6_TXD_PJ10_Msk)) | UART6_TXD_PJ10 /*!< Set PJ10 function to UART6_TXD */ -#define SET_UART6_TXD_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~UART6_TXD_PA11_Msk)) | UART6_TXD_PA11 /*!< Set PA11 function to UART6_TXD */ -#define SET_UART6_TXD_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART6_TXD_PE5_Msk)) | UART6_TXD_PE5 /*!< Set PE5 function to UART6_TXD */ -#define SET_UART6_nCTS_PC9() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART6_nCTS_PC9_Msk)) | UART6_nCTS_PC9 /*!< Set PC9 function to UART6_nCTS */ -#define SET_UART6_nCTS_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART6_nCTS_PE2_Msk)) | UART6_nCTS_PE2 /*!< Set PE2 function to UART6_nCTS */ -#define SET_UART6_nRTS_PC10() SYS->GPC_MFP2 = (SYS->GPC_MFP2 & (~UART6_nRTS_PC10_Msk)) | UART6_nRTS_PC10 /*!< Set PC10 function to UART6_nRTS */ -#define SET_UART6_nRTS_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART6_nRTS_PE3_Msk)) | UART6_nRTS_PE3 /*!< Set PE3 function to UART6_nRTS */ -#define SET_UART7_RXD_PD8() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART7_RXD_PD8_Msk)) | UART7_RXD_PD8 /*!< Set PD8 function to UART7_RXD */ -#define SET_UART7_RXD_PG12() SYS->GPG_MFP3 = (SYS->GPG_MFP3 & (~UART7_RXD_PG12_Msk)) | UART7_RXD_PG12 /*!< Set PG12 function to UART7_RXD */ -#define SET_UART7_RXD_PJ9() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~UART7_RXD_PJ9_Msk)) | UART7_RXD_PJ9 /*!< Set PJ9 function to UART7_RXD */ -#define SET_UART7_RXD_PH7() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART7_RXD_PH7_Msk)) | UART7_RXD_PH7 /*!< Set PH7 function to UART7_RXD */ -#define SET_UART7_RXD_PB8() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART7_RXD_PB8_Msk)) | UART7_RXD_PB8 /*!< Set PB8 function to UART7_RXD */ -#define SET_UART7_RXD_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART7_RXD_PE2_Msk)) | UART7_RXD_PE2 /*!< Set PE2 function to UART7_RXD */ -#define SET_UART7_RXD_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~UART7_RXD_PA8_Msk)) | UART7_RXD_PA8 /*!< Set PA8 function to UART7_RXD */ -#define SET_UART7_TXD_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART7_TXD_PE3_Msk)) | UART7_TXD_PE3 /*!< Set PE3 function to UART7_TXD */ -#define SET_UART7_TXD_PG11() SYS->GPG_MFP2 = (SYS->GPG_MFP2 & (~UART7_TXD_PG11_Msk)) | UART7_TXD_PG11 /*!< Set PG11 function to UART7_TXD */ -#define SET_UART7_TXD_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~UART7_TXD_PA9_Msk)) | UART7_TXD_PA9 /*!< Set PA9 function to UART7_TXD */ -#define SET_UART7_TXD_PJ8() SYS->GPJ_MFP2 = (SYS->GPJ_MFP2 & (~UART7_TXD_PJ8_Msk)) | UART7_TXD_PJ8 /*!< Set PJ8 function to UART7_TXD */ -#define SET_UART7_TXD_PB9() SYS->GPB_MFP2 = (SYS->GPB_MFP2 & (~UART7_TXD_PB9_Msk)) | UART7_TXD_PB9 /*!< Set PB9 function to UART7_TXD */ -#define SET_UART7_TXD_PD9() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART7_TXD_PD9_Msk)) | UART7_TXD_PD9 /*!< Set PD9 function to UART7_TXD */ -#define SET_UART7_TXD_PH6() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART7_TXD_PH6_Msk)) | UART7_TXD_PH6 /*!< Set PH6 function to UART7_TXD */ -#define SET_UART7_nCTS_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART7_nCTS_PE4_Msk)) | UART7_nCTS_PE4 /*!< Set PE4 function to UART7_nCTS */ -#define SET_UART7_nCTS_PH5() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART7_nCTS_PH5_Msk)) | UART7_nCTS_PH5 /*!< Set PH5 function to UART7_nCTS */ -#define SET_UART7_nRTS_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART7_nRTS_PE5_Msk)) | UART7_nRTS_PE5 /*!< Set PE5 function to UART7_nRTS */ -#define SET_UART7_nRTS_PH4() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART7_nRTS_PH4_Msk)) | UART7_nRTS_PH4 /*!< Set PH4 function to UART7_nRTS */ -#define SET_UART8_RXD_PJ1() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~UART8_RXD_PJ1_Msk)) | UART8_RXD_PJ1 /*!< Set PJ1 function to UART8_RXD */ -#define SET_UART8_RXD_PJ5() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~UART8_RXD_PJ5_Msk)) | UART8_RXD_PJ5 /*!< Set PJ5 function to UART8_RXD */ -#define SET_UART8_RXD_PE0() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART8_RXD_PE0_Msk)) | UART8_RXD_PE0 /*!< Set PE0 function to UART8_RXD */ -#define SET_UART8_RXD_PD10() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART8_RXD_PD10_Msk)) | UART8_RXD_PD10 /*!< Set PD10 function to UART8_RXD */ -#define SET_UART8_TXD_PE1() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART8_TXD_PE1_Msk)) | UART8_TXD_PE1 /*!< Set PE1 function to UART8_TXD */ -#define SET_UART8_TXD_PD11() SYS->GPD_MFP2 = (SYS->GPD_MFP2 & (~UART8_TXD_PD11_Msk)) | UART8_TXD_PD11 /*!< Set PD11 function to UART8_TXD */ -#define SET_UART8_TXD_PJ0() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~UART8_TXD_PJ0_Msk)) | UART8_TXD_PJ0 /*!< Set PJ0 function to UART8_TXD */ -#define SET_UART8_TXD_PJ4() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~UART8_TXD_PJ4_Msk)) | UART8_TXD_PJ4 /*!< Set PJ4 function to UART8_TXD */ -#define SET_UART8_nCTS_PJ2() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~UART8_nCTS_PJ2_Msk)) | UART8_nCTS_PJ2 /*!< Set PJ2 function to UART8_nCTS */ -#define SET_UART8_nCTS_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~UART8_nCTS_PC13_Msk)) | UART8_nCTS_PC13 /*!< Set PC13 function to UART8_nCTS */ -#define SET_UART8_nCTS_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART8_nCTS_PE3_Msk)) | UART8_nCTS_PE3 /*!< Set PE3 function to UART8_nCTS */ -#define SET_UART8_nCTS_PI14() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~UART8_nCTS_PI14_Msk)) | UART8_nCTS_PI14 /*!< Set PI14 function to UART8_nCTS */ -#define SET_UART8_nRTS_PI15() SYS->GPI_MFP3 = (SYS->GPI_MFP3 & (~UART8_nRTS_PI15_Msk)) | UART8_nRTS_PI15 /*!< Set PI15 function to UART8_nRTS */ -#define SET_UART8_nRTS_PJ3() SYS->GPJ_MFP0 = (SYS->GPJ_MFP0 & (~UART8_nRTS_PJ3_Msk)) | UART8_nRTS_PJ3 /*!< Set PJ3 function to UART8_nRTS */ -#define SET_UART8_nRTS_PD12() SYS->GPD_MFP3 = (SYS->GPD_MFP3 & (~UART8_nRTS_PD12_Msk)) | UART8_nRTS_PD12 /*!< Set PD12 function to UART8_nRTS */ -#define SET_UART8_nRTS_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~UART8_nRTS_PE2_Msk)) | UART8_nRTS_PE2 /*!< Set PE2 function to UART8_nRTS */ -#define SET_UART9_RXD_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART9_RXD_PF2_Msk)) | UART9_RXD_PF2 /*!< Set PF2 function to UART9_RXD */ -#define SET_UART9_RXD_PH11() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART9_RXD_PH11_Msk)) | UART9_RXD_PH11 /*!< Set PH11 function to UART9_RXD */ -#define SET_UART9_RXD_PF8() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART9_RXD_PF8_Msk)) | UART9_RXD_PF8 /*!< Set PF8 function to UART9_RXD */ -#define SET_UART9_RXD_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART9_RXD_PE4_Msk)) | UART9_RXD_PE4 /*!< Set PE4 function to UART9_RXD */ -#define SET_UART9_RXD_PH13() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~UART9_RXD_PH13_Msk)) | UART9_RXD_PH13 /*!< Set PH13 function to UART9_RXD */ -#define SET_UART9_TXD_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART9_TXD_PE5_Msk)) | UART9_TXD_PE5 /*!< Set PE5 function to UART9_TXD */ -#define SET_UART9_TXD_PF9() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART9_TXD_PF9_Msk)) | UART9_TXD_PF9 /*!< Set PF9 function to UART9_TXD */ -#define SET_UART9_TXD_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~UART9_TXD_PF3_Msk)) | UART9_TXD_PF3 /*!< Set PF3 function to UART9_TXD */ -#define SET_UART9_TXD_PH12() SYS->GPH_MFP3 = (SYS->GPH_MFP3 & (~UART9_TXD_PH12_Msk)) | UART9_TXD_PH12 /*!< Set PH12 function to UART9_TXD */ -#define SET_UART9_TXD_PH10() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART9_TXD_PH10_Msk)) | UART9_TXD_PH10 /*!< Set PH10 function to UART9_TXD */ -#define SET_UART9_nCTS_PJ6() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~UART9_nCTS_PJ6_Msk)) | UART9_nCTS_PJ6 /*!< Set PJ6 function to UART9_nCTS */ -#define SET_UART9_nCTS_PF11() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART9_nCTS_PF11_Msk)) | UART9_nCTS_PF11 /*!< Set PF11 function to UART9_nCTS */ -#define SET_UART9_nCTS_PH6() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART9_nCTS_PH6_Msk)) | UART9_nCTS_PH6 /*!< Set PH6 function to UART9_nCTS */ -#define SET_UART9_nCTS_PH8() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART9_nCTS_PH8_Msk)) | UART9_nCTS_PH8 /*!< Set PH8 function to UART9_nCTS */ -#define SET_UART9_nCTS_PE7() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART9_nCTS_PE7_Msk)) | UART9_nCTS_PE7 /*!< Set PE7 function to UART9_nCTS */ -#define SET_UART9_nRTS_PH7() SYS->GPH_MFP1 = (SYS->GPH_MFP1 & (~UART9_nRTS_PH7_Msk)) | UART9_nRTS_PH7 /*!< Set PH7 function to UART9_nRTS */ -#define SET_UART9_nRTS_PF10() SYS->GPF_MFP2 = (SYS->GPF_MFP2 & (~UART9_nRTS_PF10_Msk)) | UART9_nRTS_PF10 /*!< Set PF10 function to UART9_nRTS */ -#define SET_UART9_nRTS_PH9() SYS->GPH_MFP2 = (SYS->GPH_MFP2 & (~UART9_nRTS_PH9_Msk)) | UART9_nRTS_PH9 /*!< Set PH9 function to UART9_nRTS */ -#define SET_UART9_nRTS_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~UART9_nRTS_PE6_Msk)) | UART9_nRTS_PE6 /*!< Set PE6 function to UART9_nRTS */ -#define SET_UART9_nRTS_PJ7() SYS->GPJ_MFP1 = (SYS->GPJ_MFP1 & (~UART9_nRTS_PJ7_Msk)) | UART9_nRTS_PJ7 /*!< Set PJ7 function to UART9_nRTS */ -#define SET_USB_D_P_PA14() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~USB_D_P_PA14_Msk)) | USB_D_P_PA14 /*!< Set PA14 function to USB_D+ */ -#define SET_USB_D_N_PA13() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~USB_D_N_PA13_Msk)) | USB_D_N_PA13 /*!< Set PA13 function to USB_D- */ -#define SET_USB_OTG_ID_PA15() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~USB_OTG_ID_PA15_Msk)) | USB_OTG_ID_PA15 /*!< Set PA15 function to USB_OTG_ID */ -#define SET_USB_VBUS_PA12() SYS->GPA_MFP3 = (SYS->GPA_MFP3 & (~USB_VBUS_PA12_Msk)) | USB_VBUS_PA12 /*!< Set PA12 function to USB_VBUS */ -#define SET_USB_VBUS_EN_PB6() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~USB_VBUS_EN_PB6_Msk)) | USB_VBUS_EN_PB6 /*!< Set PB6 function to USB_VBUS_EN */ -#define SET_USB_VBUS_EN_PI7() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~USB_VBUS_EN_PI7_Msk)) | USB_VBUS_EN_PI7 /*!< Set PI7 function to USB_VBUS_EN */ -#define SET_USB_VBUS_EN_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~USB_VBUS_EN_PB15_Msk)) | USB_VBUS_EN_PB15 /*!< Set PB15 function to USB_VBUS_EN */ -#define SET_USB_VBUS_ST_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~USB_VBUS_ST_PB14_Msk)) | USB_VBUS_ST_PB14 /*!< Set PB14 function to USB_VBUS_ST */ -#define SET_USB_VBUS_ST_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~USB_VBUS_ST_PC14_Msk)) | USB_VBUS_ST_PC14 /*!< Set PC14 function to USB_VBUS_ST */ -#define SET_USB_VBUS_ST_PD4() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~USB_VBUS_ST_PD4_Msk)) | USB_VBUS_ST_PD4 /*!< Set PD4 function to USB_VBUS_ST */ -#define SET_USB_VBUS_ST_PB7() SYS->GPB_MFP1 = (SYS->GPB_MFP1 & (~USB_VBUS_ST_PB7_Msk)) | USB_VBUS_ST_PB7 /*!< Set PB7 function to USB_VBUS_ST */ -#define SET_USB_VBUS_ST_PI6() SYS->GPI_MFP1 = (SYS->GPI_MFP1 & (~USB_VBUS_ST_PI6_Msk)) | USB_VBUS_ST_PI6 /*!< Set PI6 function to USB_VBUS_ST */ -#define SET_USCI0_CLK_PD0() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~USCI0_CLK_PD0_Msk)) | USCI0_CLK_PD0 /*!< Set PD0 function to USCI0_CLK */ -#define SET_USCI0_CLK_PE2() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~USCI0_CLK_PE2_Msk)) | USCI0_CLK_PE2 /*!< Set PE2 function to USCI0_CLK */ -#define SET_USCI0_CLK_PA11() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~USCI0_CLK_PA11_Msk)) | USCI0_CLK_PA11 /*!< Set PA11 function to USCI0_CLK */ -#define SET_USCI0_CLK_PB12() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~USCI0_CLK_PB12_Msk)) | USCI0_CLK_PB12 /*!< Set PB12 function to USCI0_CLK */ -#define SET_USCI0_CTL0_PC14() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~USCI0_CTL0_PC14_Msk)) | USCI0_CTL0_PC14 /*!< Set PC14 function to USCI0_CTL0 */ -#define SET_USCI0_CTL0_PE6() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~USCI0_CTL0_PE6_Msk)) | USCI0_CTL0_PE6 /*!< Set PE6 function to USCI0_CTL0 */ -#define SET_USCI0_CTL0_PB0() SYS->GPB_MFP0 = (SYS->GPB_MFP0 & (~USCI0_CTL0_PB0_Msk)) | USCI0_CTL0_PB0 /*!< Set PB0 function to USCI0_CTL0 */ -#define SET_USCI0_CTL0_PD4() SYS->GPD_MFP1 = (SYS->GPD_MFP1 & (~USCI0_CTL0_PD4_Msk)) | USCI0_CTL0_PD4 /*!< Set PD4 function to USCI0_CTL0 */ -#define SET_USCI0_CTL0_PC13() SYS->GPC_MFP3 = (SYS->GPC_MFP3 & (~USCI0_CTL0_PC13_Msk)) | USCI0_CTL0_PC13 /*!< Set PC13 function to USCI0_CTL0 */ -#define SET_USCI0_CTL1_PA8() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~USCI0_CTL1_PA8_Msk)) | USCI0_CTL1_PA8 /*!< Set PA8 function to USCI0_CTL1 */ -#define SET_USCI0_CTL1_PD3() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~USCI0_CTL1_PD3_Msk)) | USCI0_CTL1_PD3 /*!< Set PD3 function to USCI0_CTL1 */ -#define SET_USCI0_CTL1_PE5() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~USCI0_CTL1_PE5_Msk)) | USCI0_CTL1_PE5 /*!< Set PE5 function to USCI0_CTL1 */ -#define SET_USCI0_CTL1_PB15() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~USCI0_CTL1_PB15_Msk)) | USCI0_CTL1_PB15 /*!< Set PB15 function to USCI0_CTL1 */ -#define SET_USCI0_DAT0_PA10() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~USCI0_DAT0_PA10_Msk)) | USCI0_DAT0_PA10 /*!< Set PA10 function to USCI0_DAT0 */ -#define SET_USCI0_DAT0_PB13() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~USCI0_DAT0_PB13_Msk)) | USCI0_DAT0_PB13 /*!< Set PB13 function to USCI0_DAT0 */ -#define SET_USCI0_DAT0_PE3() SYS->GPE_MFP0 = (SYS->GPE_MFP0 & (~USCI0_DAT0_PE3_Msk)) | USCI0_DAT0_PE3 /*!< Set PE3 function to USCI0_DAT0 */ -#define SET_USCI0_DAT0_PD1() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~USCI0_DAT0_PD1_Msk)) | USCI0_DAT0_PD1 /*!< Set PD1 function to USCI0_DAT0 */ -#define SET_USCI0_DAT1_PD2() SYS->GPD_MFP0 = (SYS->GPD_MFP0 & (~USCI0_DAT1_PD2_Msk)) | USCI0_DAT1_PD2 /*!< Set PD2 function to USCI0_DAT1 */ -#define SET_USCI0_DAT1_PE4() SYS->GPE_MFP1 = (SYS->GPE_MFP1 & (~USCI0_DAT1_PE4_Msk)) | USCI0_DAT1_PE4 /*!< Set PE4 function to USCI0_DAT1 */ -#define SET_USCI0_DAT1_PA9() SYS->GPA_MFP2 = (SYS->GPA_MFP2 & (~USCI0_DAT1_PA9_Msk)) | USCI0_DAT1_PA9 /*!< Set PA9 function to USCI0_DAT1 */ -#define SET_USCI0_DAT1_PB14() SYS->GPB_MFP3 = (SYS->GPB_MFP3 & (~USCI0_DAT1_PB14_Msk)) | USCI0_DAT1_PB14 /*!< Set PB14 function to USCI0_DAT1 */ -#define SET_X32_IN_PF5() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~X32_IN_PF5_Msk)) | X32_IN_PF5 /*!< Set PF5 function to X32_IN */ -#define SET_X32_OUT_PF4() SYS->GPF_MFP1 = (SYS->GPF_MFP1 & (~X32_OUT_PF4_Msk)) | X32_OUT_PF4 /*!< Set PF4 function to X32_OUT */ -#define SET_XT1_IN_PF3() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~XT1_IN_PF3_Msk)) | XT1_IN_PF3 /*!< Set PF3 function to XT1_IN */ -#define SET_XT1_OUT_PF2() SYS->GPF_MFP0 = (SYS->GPF_MFP0 & (~XT1_OUT_PF2_Msk)) | XT1_OUT_PF2 /*!< Set PF2 function to XT1_OUT */ - - -/** - * @brief Clear Brown-out detector interrupt flag - * @param None - * @return None - * @details This macro clear Brown-out detector interrupt flag. - * \hideinitializer - */ -#define SYS_CLEAR_BOD_INT_FLAG() (SYS->BODCTL |= SYS_BODCTL_BODIF_Msk) - -/** - * @brief Set Brown-out detector function to normal mode - * @param None - * @return None - * @details This macro set Brown-out detector to normal mode. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_CLEAR_BOD_LPM() (SYS->BODCTL &= ~SYS_BODCTL_BODLPM_Msk) - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This macro disable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_BOD() (SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk) - -/** - * @brief Enable Brown-out detector function - * @param None - * @return None - * @details This macro enable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_BOD() (SYS->BODCTL |= SYS_BODCTL_BODEN_Msk) - -/** - * @brief Get Brown-out detector interrupt flag - * @param None - * @retval 0 Brown-out detect interrupt flag is not set. - * @retval >=1 Brown-out detect interrupt flag is set. - * @details This macro get Brown-out detector interrupt flag. - * \hideinitializer - */ -#define SYS_GET_BOD_INT_FLAG() (SYS->BODCTL & SYS_BODCTL_BODIF_Msk) - -/** - * @brief Get Brown-out detector status - * @param None - * @retval 0 System voltage is higher than BOD threshold voltage setting or BOD function is disabled. - * @retval >=1 System voltage is lower than BOD threshold voltage setting. - * @details This macro get Brown-out detector output status. - * If the BOD function is disabled, this function always return 0. - * \hideinitializer - */ -#define SYS_GET_BOD_OUTPUT() (SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) - -/** - * @brief Enable Brown-out detector interrupt function - * @param None - * @return None - * @details This macro enable Brown-out detector interrupt function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_BOD_RST() (SYS->BODCTL &= ~SYS_BODCTL_BODRSTEN_Msk) - -/** - * @brief Enable Brown-out detector reset function - * @param None - * @return None - * @details This macro enable Brown-out detect reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_BOD_RST() (SYS->BODCTL |= SYS_BODCTL_BODRSTEN_Msk) - -/** - * @brief Set Brown-out detector function low power mode - * @param None - * @return None - * @details This macro set Brown-out detector to low power mode. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_SET_BOD_LPM() (SYS->BODCTL |= SYS_BODCTL_BODLPM_Msk) - -/** - * @brief Set Brown-out detector voltage level - * @param[in] u32Level is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_3_0V - * - \ref SYS_BODCTL_BODVL_2_8V - * - \ref SYS_BODCTL_BODVL_2_6V - * - \ref SYS_BODCTL_BODVL_2_4V - * - \ref SYS_BODCTL_BODVL_2_2V - * - \ref SYS_BODCTL_BODVL_2_0V - * - \ref SYS_BODCTL_BODVL_1_8V - * - \ref SYS_BODCTL_BODVL_1_6V - * @return None - * @details This macro set Brown-out detector voltage level. - * The write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_SET_BOD_LEVEL(u32Level) (SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | (u32Level)) - -/** - * @brief Get reset source is from Brown-out detector reset - * @param None - * @retval 0 Previous reset source is not from Brown-out detector reset - * @retval >=1 Previous reset source is from Brown-out detector reset - * @details This macro get previous reset source is from Brown-out detect reset or not. - * \hideinitializer - */ -#define SYS_IS_BOD_RST() (SYS->RSTSTS & SYS_RSTSTS_BODRF_Msk) - -/** - * @brief Get reset source is from CPU reset - * @param None - * @retval 0 Previous reset source is not from CPU reset - * @retval >=1 Previous reset source is from CPU reset - * @details This macro get previous reset source is from CPU reset. - * \hideinitializer - */ -#define SYS_IS_CPU_RST() (SYS->RSTSTS & SYS_RSTSTS_CPURF_Msk) - -/** - * @brief Get reset source is from LVR Reset - * @param None - * @retval 0 Previous reset source is not from Low-Voltage-Reset - * @retval >=1 Previous reset source is from Low-Voltage-Reset - * @details This macro get previous reset source is from Low-Voltage-Reset. - * \hideinitializer - */ -#define SYS_IS_LVR_RST() (SYS->RSTSTS & SYS_RSTSTS_LVRF_Msk) - -/** - * @brief Get reset source is from Power-on Reset - * @param None - * @retval 0 Previous reset source is not from Power-on Reset - * @retval >=1 Previous reset source is from Power-on Reset - * @details This macro get previous reset source is from Power-on Reset. - * \hideinitializer - */ -#define SYS_IS_POR_RST() (SYS->RSTSTS & SYS_RSTSTS_PORF_Msk) - -/** - * @brief Get reset source is from reset pin reset - * @param None - * @retval 0 Previous reset source is not from reset pin reset - * @retval >=1 Previous reset source is from reset pin reset - * @details This macro get previous reset source is from reset pin reset. - * \hideinitializer - */ -#define SYS_IS_RSTPIN_RST() (SYS->RSTSTS & SYS_RSTSTS_PINRF_Msk) - -/** - * @brief Get reset source is from system (MCU) reset - * @param None - * @retval 0 Previous reset source is not from system (MCU) reset - * @retval >=1 Previous reset source is from system (MCU) reset - * @details This macro get previous reset source is from system (MCU) reset. - * \hideinitializer - */ -#define SYS_IS_SYSTEM_RST() (SYS->RSTSTS & SYS_RSTSTS_MCURF_Msk) - -/** - * @brief Get reset source is from window watch dog reset - * @param None - * @retval 0 Previous reset source is not from window watch dog reset - * @retval >=1 Previous reset source is from window watch dog reset - * @details This macro get previous reset source is from window watch dog reset. - * \hideinitializer - */ -#define SYS_IS_WDT_RST() (SYS->RSTSTS & SYS_RSTSTS_WDTRF_Msk) - -/** - * @brief Disable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro disable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_LVR() (SYS->BODCTL &= ~SYS_BODCTL_LVREN_Msk) - -/** - * @brief Enable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro enable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_LVR() (SYS->BODCTL |= SYS_BODCTL_LVREN_Msk) - -/** - * @brief Disable Power-on Reset function - * @param None - * @return None - * @details This macro disable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_POR() (SYS->PORDISAN = 0x5AA5) - -/** - * @brief Enable Power-on Reset function - * @param None - * @return None - * @details This macro enable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_POR() (SYS->PORDISAN = 0) - -/** - * @brief Clear reset source flag - * @param[in] u32RstSrc is reset source. Including : - * - \ref SYS_RSTSTS_PORF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_MCURF_Msk - * - \ref SYS_RSTSTS_HRESETRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_CPULKRF_Msk - * @return None - * @details This macro clear reset source flag. - * \hideinitializer - */ -#define SYS_CLEAR_RST_SOURCE(u32RstSrc) ((SYS->RSTSTS) = (u32RstSrc) ) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SYS_UnlockReg(void); -__STATIC_INLINE void SYS_LockReg(void); - -/** - * @brief Disable register write-protection function - * @param None - * @return None - * @details This function disable register write-protection function. - * To unlock the protected register to allow write access. - */ -__STATIC_INLINE void SYS_UnlockReg(void) -{ - uint32_t u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - - do - { - SYS->REGLCTL = 0x59UL; - SYS->REGLCTL = 0x16UL; - SYS->REGLCTL = 0x88UL; - - if (--u32TimeOutCount == 0) break; - } - while (SYS->REGLCTL == 0UL); -} - -/** - * @brief Enable register write-protection function - * @param None - * @return None - * @details This function is used to enable register write-protection function. - * To lock the protected register to forbid write access. - */ -__STATIC_INLINE void SYS_LockReg(void) -{ - SYS->REGLCTL = 0UL; -} - - -void SYS_ClearResetSrc(uint32_t u32Src); -uint32_t SYS_GetBODStatus(void); -uint32_t SYS_GetResetSrc(void); -uint32_t SYS_IsRegLocked(void); -uint32_t SYS_ReadPDID(void); -void SYS_ResetChip(void); -void SYS_ResetCPU(void); -void SYS_ResetModule(uint32_t u32ModuleIndex); -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel); -void SYS_DisableBOD(void); -void SYS_SetPowerLevel(uint32_t u32PowerLevel); -void SYS_SetVRef(uint32_t u32VRefCTL); - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SYS_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer.h deleted file mode 100644 index b03fd6ffbb0..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer.h +++ /dev/null @@ -1,537 +0,0 @@ -/**************************************************************************//** - * @file nu_timer.h - * @version V3.00 - * @brief Timer Controller(Timer) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_H__ -#define __NU_TIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_CONSTANTS TIMER Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* TIMER Operation Mode, External Counter and Capture Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TIMER_ONESHOT_MODE (0UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in one-shot mode \hideinitializer */ -#define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in periodic mode \hideinitializer */ -#define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in toggle-output mode \hideinitializer */ -#define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in continuous counting mode \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX (0UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx pin \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX_EXT (1UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx_EXT pin \hideinitializer */ - -#define TIMER_COUNTER_EVENT_FALLING (0UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on falling edge detection \hideinitializer */ -#define TIMER_COUNTER_EVENT_RISING (1UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on rising edge detection \hideinitializer */ -#define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to get timer counter value \hideinitializer */ -#define TIMER_CAPTURE_COUNTER_RESET_MODE (1UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to reset timer counter \hideinitializer */ - -#define TIMER_CAPTURE_EVENT_FALLING (0UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Falling edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING (1UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Rising edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_FALLING_RISING (2UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both falling and rising edge detection to trigger capture event, and first event at falling edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING_FALLING (3UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both rising and falling edge detection to trigger capture event, and first event at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_LOW_PERIOD (6UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at falling edge, follows are at at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_HIGH_PERIOD (7UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at rising edge, follows are at at falling edge \hideinitializer */ - -#define TIMER_CAPTURE_SOURCE_FROM_PIN (0UL << TIMER_CTL_CAPSRC_Pos) /*!< The capture source is from TMx_EXT pin \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_FROM_INTERNAL (1UL << TIMER_CTL_CAPSRC_Pos) /*!< The capture source is from internal ACMPx signal or clock source \hideinitializer */ - -#define TIMER_CAPTURE_SOURCE_DIV_1 (0UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 1 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_2 (1UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 2 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_4 (2UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 4 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_8 (3UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 8 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_16 (4UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 16 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_32 (5UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 32 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_64 (6UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 64 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_128 (7UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 128 \hideinitializer */ -#define TIMER_CAPTURE_SOURCE_DIV_256 (8UL << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< Input capture source divide 256 \hideinitializer */ - -#define TIMER_INTER_CAPTURE_SOURCE_ACMP0 (0UL << TIMER_EXTCTL_ICAPSEL_Pos) /*!< Capture source from internal ACMP0 output signal \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_ACMP1 (1UL << TIMER_EXTCTL_ICAPSEL_Pos) /*!< Capture source from internal ACMP1 output signal \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_HXT (2UL << TIMER_EXTCTL_ICAPSEL_Pos) /*!< Capture source from HXT \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_LXT (3UL << TIMER_EXTCTL_ICAPSEL_Pos) /*!< Capture source from LXT \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_HIRC (4UL << TIMER_EXTCTL_ICAPSEL_Pos) /*!< Capture source from HIRC \hideinitializer */ -#define TIMER_INTER_CAPTURE_SOURCE_LIRC (5UL << TIMER_EXTCTL_ICAPSEL_Pos) /*!< Capture source from LIRC \hideinitializer */ - -#define TIMER_TRGSRC_TIMEOUT_EVENT (0UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer time-out event \hideinitializer */ -#define TIMER_TRGSRC_CAPTURE_EVENT (1UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer capture event \hideinitializer */ -#define TIMER_TRG_TO_PWM (TIMER_TRGCTL_TRGPWM_Msk) /*!< Each timer event as BPWM and EPWM counter clock source \hideinitializer */ -#define TIMER_TRG_TO_EADC (TIMER_TRGCTL_TRGEADC_Msk) /*!< Each timer event to start ADC conversion \hideinitializer */ -#define TIMER_TRG_TO_DAC (TIMER_TRGCTL_TRGDAC_Msk) /*!< Each timer event to start DAC conversion \hideinitializer */ -#define TIMER_TRG_TO_PDMA (TIMER_TRGCTL_TRGPDMA_Msk) /*!< Each timer event to trigger PDMA transfer \hideinitializer */ - -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_1 (0UL) /*!< Capture noise filter clock is PCLK divide by 1 \hideinitializer */ -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_2 (1UL) /*!< Capture noise filter clock is PCLK divide by 2 \hideinitializer */ -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_4 (2UL) /*!< Capture noise filter clock is PCLK divide by 4 \hideinitializer */ -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_8 (3UL) /*!< Capture noise filter clock is PCLK divide by 8 \hideinitializer */ -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_16 (4UL) /*!< Capture noise filter clock is PCLK divide by 16 \hideinitializer */ -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_32 (5UL) /*!< Capture noise filter clock is PCLK divide by 32 \hideinitializer */ -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_64 (6UL) /*!< Capture noise filter clock is PCLK divide by 64 \hideinitializer */ -#define TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_128 (7UL) /*!< Capture noise filter clock is PCLK divide by 128 \hideinitializer */ - -#define TIMER_TIMEOUT_ERR (-1L) /*!< TIMER operation abort due to timeout error \hideinitializer */ - -/*@}*/ /* end of group TIMER_EXPORTED_CONSTANTS */ - - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Set Timer Compared Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Value Timer compare value. Valid values are between 2 to 0xFFFFFF. - * - * @return None - * - * @details This macro is used to set timer compared value to adjust timer time-out interval. - * @note 1. Never write 0x0 or 0x1 in this field, or the core will run into unknown state. \n - * 2. If update timer compared value in continuous counting mode, timer counter value will keep counting continuously. \n - * But if timer is operating at other modes, the timer up counter will restart counting and start from 0. - * \hideinitializer - */ -#define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMP = (u32Value)) - -/** - * @brief Set Timer Prescale Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Value Timer prescale value. Valid values are between 0 to 0xFF. - * - * @return None - * - * @details This macro is used to set timer prescale value and timer source clock will be divided by (prescale + 1) \n - * before it is fed into timer. - * \hideinitializer - */ -#define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_PSC_Msk) | (u32Value)) - -/** - * @brief Check specify Timer Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer 24-bit up counter is inactive - * @retval 1 Timer 24-bit up counter is active - * - * @details This macro is used to check if specify Timer counter is inactive or active. - * \hideinitializer - */ -#define TIMER_IS_ACTIVE(timer) (((timer)->CTL & TIMER_CTL_ACTSTS_Msk)? 1 : 0) - -/** - * @brief Select Toggle-output Pin - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32ToutSel Toggle-output pin selection, valid values are: - * - \ref TIMER_TOUT_PIN_FROM_TMX - * - \ref TIMER_TOUT_PIN_FROM_TMX_EXT - * - * @return None - * - * @details This macro is used to select timer toggle-output pin is output on TMx or TMx_EXT pin. - * \hideinitializer - */ -#define TIMER_SELECT_TOUT_PIN(timer, u32ToutSel) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_TGLPINSEL_Msk) | (u32ToutSel)) - -/** - * @brief Select Timer operating mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32OpMode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * - * @return None - * \hideinitializer - */ -#define TIMER_SET_OPMODE(timer, u32OpMode) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_OPMODE_Msk) | (u32OpMode)) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer); -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer); - -/** - * @brief Start Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to start Timer counting. - */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to stop/suspend Timer counting. - */ -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Enable Timer Interrupt Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer interrupt wake-up function and interrupt source could be time-out interrupt, \n - * counter event interrupt or capture trigger interrupt. - * @note To wake the system from Power-down mode, timer clock source must be ether LXT or LIRC. - */ -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Disable Timer Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer interrupt wake-up function. - */ -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Start Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to start Timer capture function. - */ -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Stop Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to stop Timer capture function. - */ -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Disable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Enable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Disable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Enable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Disable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Enable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Disable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Get Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer time-out interrupt did not occur - * @retval 1 Timer time-out interrupt occurred - * - * @details This function indicates timer time-out interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer) -{ - return ((timer->INTSTS & TIMER_INTSTS_TIF_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears timer time-out interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TIF_Msk; -} - -/** - * @brief Get Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer capture interrupt did not occur - * @retval 1 Timer capture interrupt occurred - * - * @details This function indicates timer capture trigger interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer) -{ - return timer->EINTSTS; -} - -/** - * @brief Clear Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears timer capture trigger interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer) -{ - timer->EINTSTS = TIMER_EINTSTS_CAPIF_Msk; -} - -/** - * @brief Get Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer does not cause CPU wake-up - * @retval 1 Timer interrupt event cause CPU wake-up - * - * @details This function indicates timer interrupt event has waked up system or not. - */ -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer) -{ - return (timer->INTSTS & TIMER_INTSTS_TWKF_Msk ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears the timer wake-up system flag to 0. - */ -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TWKF_Msk; -} - -/** - * @brief Get Capture value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return 24-bit Capture Value - * - * @details This function reports the current 24-bit timer capture value. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer) -{ - return timer->CAP; -} - -/** - * @brief Get Counter value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return 24-bit Counter Value - * - * @details This function reports the current 24-bit timer counter value. - */ -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer) -{ - return timer->CNT; -} - - - -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq); -void TIMER_Close(TIMER_T *timer); -int32_t TIMER_Delay(TIMER_T *timer, uint32_t u32Usec); -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge); -void TIMER_DisableCapture(TIMER_T *timer); -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge); -void TIMER_DisableEventCounter(TIMER_T *timer); -uint32_t TIMER_GetModuleClock(TIMER_T *timer); -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt); -void TIMER_DisableFreqCounter(TIMER_T *timer); -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src); -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask); -int32_t TIMER_ResetCounter(TIMER_T *timer); -void TIMER_EnableCaptureInputNoiseFilter(TIMER_T *timer, uint32_t u32FilterCount, uint32_t u32ClkSrcSel); -void TIMER_DisableCaptureInputNoiseFilter(TIMER_T *timer); - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_TIMER_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer_pwm.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer_pwm.h deleted file mode 100644 index e2697af177e..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_timer_pwm.h +++ /dev/null @@ -1,783 +0,0 @@ -/**************************************************************************//** - * @file nu_timer_pwm.h - * @version V3.00 - * @brief Timer PWM Controller(Timer PWM) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_PWM_H__ -#define __NU_TIMER_PWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_CONSTANTS TIMER PWM Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Channel Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CH0 (BIT0) /*!< Indicate PWMx_CH0 \hideinitializer */ -#define TPWM_CH1 (BIT1) /*!< Indicate PWMx_CH1 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_UP_COUNT (0UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up count type \hideinitializer */ -#define TPWM_DOWN_COUNT (1UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Down count type \hideinitializer */ -#define TPWM_UP_DOWN_COUNT (2UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up-Down count type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_AUTO_RELOAD_MODE (0UL) /*!< Auto-reload mode \hideinitializer */ -#define TPWM_ONE_SHOT_MODE (TIMER_PWMCTL_CNTMODE_Msk) /*!< One-shot mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_OUTPUT_TOGGLE (0UL) /*!< Timer PWM output toggle \hideinitializer */ -#define TPWM_OUTPUT_NOTHING (1UL) /*!< Timer PWM output nothing \hideinitializer */ -#define TPWM_OUTPUT_LOW (2UL) /*!< Timer PWM output low \hideinitializer */ -#define TPWM_OUTPUT_HIGH (3UL) /*!< Timer PWM output high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Trigger EADC Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TRIGGER_EADC_AT_ZERO_POINT (0UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger EADC while counter zero point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EADC_AT_PERIOD_POINT (1UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger EADC while counter period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EADC_AT_ZERO_OR_PERIOD_POINT (2UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger EADC while counter zero or period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EADC_AT_COMPARE_UP_COUNT_POINT (3UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger EADC while counter up count compare point event occurred \hideinitializer */ -#define TPWM_TRIGGER_EADC_AT_COMPARE_DOWN_COUNT_POINT (4UL << TIMER_PWMTRGCTL_TRGSEL_Pos) /*!< Timer PWM trigger EADC while counter down count compare point event occurred \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP0 (TIMER_PWMBRKCTL_CPO0EBEN_Msk) /*!< Comparator 0 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP1 (TIMER_PWMBRKCTL_CPO1EBEN_Msk) /*!< Comparator 1 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_BKPIN (TIMER_PWMBRKCTL_BRKPEEN_Msk) /*!< Brake pin as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_CSS (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_BOD (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_COR (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_RAM (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as edge-detect fault brake source \hideinitializer */ - - -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP0 (TIMER_PWMBRKCTL_CPO0LBEN_Msk) /*!< Comparator 0 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP1 (TIMER_PWMBRKCTL_CPO1LBEN_Msk) /*!< Comparator 1 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_BKPIN (TIMER_PWMBRKCTL_BRKPLEN_Msk) /*!< Brake pin as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_COR (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as level-detect fault brake source \hideinitializer */ - -#define TPWM_BRAKE_EDGE (TIMER_PWMSWBRK_BRKETRG_Msk) /*!< Edge-detect fault brake \hideinitializer */ -#define TPWM_BRAKE_LEVEL (TIMER_PWMSWBRK_BRKLTRG_Msk) /*!< Level-detect fault brake \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Load Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_LOAD_MODE_PERIOD (0UL) /*!< Timer PWM period load mode \hideinitializer */ -#define TPWM_LOAD_MODE_IMMEDIATE (TIMER_PWMCTL_IMMLDEN_Msk) /*!< Timer PWM immediately load mode \hideinitializer */ -#define TPWM_LOAD_MODE_CENTER (TIMER_PWMCTL_CTRLD_Msk) /*!< Timer PWM center load mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin De-bounce Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BKP_DBCLK_PCLK_DIV_1 (0UL) /*!< De-bounce clock is PCLK divide by 1 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_2 (1UL) /*!< De-bounce clock is PCLK divide by 2 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_4 (2UL) /*!< De-bounce clock is PCLK divide by 4 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_8 (3UL) /*!< De-bounce clock is PCLK divide by 8 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_16 (4UL) /*!< De-bounce clock is PCLK divide by 16 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_32 (5UL) /*!< De-bounce clock is PCLK divide by 32 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_64 (6UL) /*!< De-bounce clock is PCLK divide by 64 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_128 (7UL) /*!< De-bounce clock is PCLK divide by 128 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TM_BRAKE0 (0UL) /*!< Brake pin source comes from TM_BRAKE0 \hideinitializer */ -#define TPWM_TM_BRAKE1 (1UL) /*!< Brake pin source comes from TM_BRAKE1 \hideinitializer */ -#define TPWM_TM_BRAKE2 (2UL) /*!< Brake pin source comes from TM_BRAKE2 \hideinitializer */ -#define TPWM_TM_BRAKE3 (3UL) /*!< Brake pin source comes from TM_BRAKE3 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_CLKSRC_TMR_CLK (0UL) /*!< Timer PWM Clock source selects to TMR_CLK \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER0_INT (1UL) /*!< Timer PWM Clock source selects to TIMER0 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER1_INT (2UL) /*!< Timer PWM Clock source selects to TIMER1 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER2_INT (3UL) /*!< Timer PWM Clock source selects to TIMER2 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER3_INT (4UL) /*!< Timer PWM Clock source selects to TIMER3 interrupt event \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Synchronous Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_SYNC_DISABLE (0UL) /*!< Disable TIMER PWM synchronous function \hideinitializer */ -#define TPWM_CNTR_SYNC_START_BY_TIMER0 ((0<ALTCTL = (1 << TIMER_ALTCTL_FUNCSEL_Pos)) - -/** - * @brief Disable PWM Counter Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable specified Timer channel as PWM counter mode, then timer counter mode is available. - * @note All registers about PWM counter function will be cleared to 0 after executing this macro. - * \hideinitializer - */ -#define TPWM_DISABLE_PWM_MODE(timer) ((timer)->ALTCTL = (0 << TIMER_ALTCTL_FUNCSEL_Pos)) - -/** - * @brief Enable Independent Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable independent mode of TIMER PWM module and complementary mode will be disabled. - * \hideinitializer - */ -#define TPWM_ENABLE_INDEPENDENT_MODE(timer) ((timer)->PWMCTL &= ~(1 << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Enable Complementary Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable complementary mode of Timer PWM module and independent mode will be disabled. - * \hideinitializer - */ -#define TPWM_ENABLE_COMPLEMENTARY_MODE(timer) ((timer)->PWMCTL |= (1 << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Set Counter Type - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] type Timer PWM count type, could be one of the following type - * - \ref TPWM_UP_COUNT - * - \ref TPWM_DOWN_COUNT - * - \ref TPWM_UP_DOWN_COUNT - * - * @return None - * - * @details This macro is used to set Timer PWM counter type. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_TYPE(timer, type) ((timer)->PWMCTL = ((timer)->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (type)) - -/** - * @brief Start PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable PWM generator and start counter counting. - * \hideinitializer - */ -#define TPWM_START_COUNTER(timer) ((timer)->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk) - -/** - * @brief Stop PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to stop PWM counter after current period is completed. - * \hideinitializer - */ -#define TPWM_STOP_COUNTER(timer) ((timer)->PWMPERIOD = 0x0) - -/** - * @brief Set Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] prescaler Clock prescaler of specified channel. Valid values are between 0x0~0xFFF. - * - * @return None - * - * @details This macro is used to set the prescaler of specified TIMER PWM. - * @note If prescaler is 0, then there is no scaling in counter clock source. - * \hideinitializer - */ -#define TPWM_SET_PRESCALER(timer, prescaler) ((timer)->PWMCLKPSC = (prescaler)) - -/** - * @brief Get Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target prescaler setting, CLKPSC (TIMERx_PWMCLKPSC[11:0]) - * - * @details Get the prescaler setting, the target counter clock divider is (CLKPSC + 1). - * \hideinitializer - */ -#define TPWM_GET_PRESCALER(timer) ((timer)->PWMCLKPSC) - -/** - * @brief Set Counter Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] period Period of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_PERIOD(timer, period) ((timer)->PWMPERIOD = (period)) - -/** - * @brief Get Counter Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target period setting, PERIOD (TIMERx_PWMPERIOD[15:0]) - * - * @details This macro is used to get the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_PERIOD(timer) ((timer)->PWMPERIOD) - -/** - * @brief Set Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] cmp Comparator of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_CMPDAT(timer, cmp) ((timer)->PWMCMPDAT = (cmp)) - -/** - * @brief Get Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target comparator setting, CMPDAT (TIMERx_PWMCMPDAT[15:0]) - * - * @details This macro is used to get the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_CMPDAT(timer) ((timer)->PWMCMPDAT) - -/** - * @brief Clear Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to clear counter of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_CLEAR_COUNTER(timer) ((timer)->PWMCNTCLR = TIMER_PWMCNTCLR_CNTCLR_Msk) - -/** - * @brief Software Trigger Brake Event - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] type Type of brake trigger. Valid values are: - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This macro is used to trigger brake event by writing PWMSWBRK register. - * \hideinitializer - */ -#define TPWM_SW_TRIGGER_BRAKE(timer, type) ((timer)->PWMSWBRK = (type)) - -/** - * @brief Enable Output Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Enable specified channel output function. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @return None - * - * @details This macro is used to enable output function of specified output pins. - * @note If the corresponding bit in ch parameter is 0, then output function will be disabled in this channel. - * \hideinitializer - */ -#define TPWM_ENABLE_OUTPUT(timer, ch) ((timer)->PWMPOEN = (ch)) - -/** - * @brief Set Output Inverse - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Set specified channel output is inversed or not. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @return None - * - * @details This macro is used to enable output inverse of specified output pins. - * @note If ch parameter is 0, then output inverse function will be disabled. - * \hideinitializer - */ -#define TPWM_SET_OUTPUT_INVERSE(timer, ch) ((timer)->PWMPOLCTL = (ch)) - -/** - * @brief Enable Output Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Enable specified channel output mask function. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @param[in] level Output to high or low on specified mask channel. - * - * @return None - * - * @details This macro is used to enable output function of specified output pins. - * @note If ch parameter is 0, then output mask function will be disabled. - * \hideinitializer - */ -#define TPWM_SET_MASK_OUTPUT(timer, ch, level) do {(timer)->PWMMSKEN = (ch); (timer)->PWMMSK = (level); }while(0) - -/** - * @brief Set Counter Synchronous Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] mode Synchronous mode. Possible options are: - * - \ref TPWM_CNTR_SYNC_DISABLE - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER2 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER2 - * - * @return None - * - * @details This macro is used to set counter synchronous mode of specified Timer PWM module. - * @note Only support all PWM counters are synchronous by TIMER0 PWM or TIMER0~1 PWM counter synchronous by TIMER0 PWM and - * TIMER2~3 PWM counter synchronous by TIMER2 PWM. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_SYNC_MODE(timer, mode) ((timer)->PWMSCTL = (mode)) - -/** - * @brief Trigger Counter Synchronous - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to trigger synchronous event by specified TIMER PWM. - * @note 1. This macro is only available for TIMER0 PWM and TIMER2 PWM. \n - * 2. STRGEN (PWMSTRG[0]) is write only and always read as 0. - * \hideinitializer - */ -#define TPWM_TRIGGER_COUNTER_SYNC(timer) ((timer)->PWMSTRG = TIMER_PWMSTRG_STRGEN_Msk) - -/** - * @brief Enable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the zero event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Disable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the zero event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Get Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Zero event interrupt did not occur - * @retval 1 Zero event interrupt occurred - * - * @details This macro indicates zero event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_ZERO_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_ZIF_Msk)? 1 : 0) - -/** - * @brief Clear Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears zero event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_ZERO_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_ZIF_Msk) - -/** - * @brief Enable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Disable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Get Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Period event interrupt did not occur - * @retval 1 Period event interrupt occurred - * - * @details This macro indicates period event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_PERIOD_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_PIF_Msk)? 1 : 0) - -/** - * @brief Clear Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears period event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_PERIOD_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_PIF_Msk) - -/** - * @brief Enable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Disable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Get Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Compare up event interrupt did not occur - * @retval 1 Compare up event interrupt occurred - * - * @details This macro indicates compare up event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_CMP_UP_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPUIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears compare up event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_UP_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPUIF_Msk) - -/** - * @brief Enable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the compare down event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Disable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the compare down event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Get Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Compare down event interrupt did not occur - * @retval 1 Compare down event interrupt occurred - * - * @details This macro indicates compare down event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_CMP_DOWN_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPDIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears compare down event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_DOWN_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPDIF_Msk) - -/** - * @brief Get Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer PWM counter never counts to maximum value - * @retval 1 Timer PWM counter counts to maximum value, 0xFFFF - * - * @details This macro indicates Timer PWM counter has count to 0xFFFF or not. - * \hideinitializer - */ -#define TPWM_GET_REACH_MAX_CNT_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_CNTMAXF_Msk)? 1 : 0) - -/** - * @brief Clear Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears reach maximum count status. - * \hideinitializer - */ -#define TPWM_CLEAR_REACH_MAX_CNT_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_CNTMAXF_Msk) - -/** - * @brief Get Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Trigger ADC start conversion is not occur - * @retval 1 Specified counter compare event has trigger ADC start conversion - * - * @details This macro is used to indicate PWM counter compare event has triggered ADC start conversion. - * \hideinitializer - */ -#define TPWM_GET_TRG_ADC_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_EADCTRGF_Msk)? 1 : 0) - -/** - * @brief Clear Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to clear PWM counter compare event trigger ADC status. - * \hideinitializer - */ -#define TPWM_CLEAR_TRG_ADC_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_EADCTRGF_Msk) - -/** - * @brief Set Brake Event at Brake Pin High or Low-to-High - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * @note The default brake pin detection is high level or from low to high. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_HIGH_DETECT(timer) ((timer)->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set Brake Event at Brake Pin Low or High-to-Low - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at low level or transfer from high to low. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_LOW_DETECT(timer) ((timer)->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set External Brake Pin Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] pin The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_SOURCE(timer, pin) ((timer)->PWMBNF = ((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | ((pin)<CTL = (TRNG->CTL&~TRNG_CTL_CLKP_Msk)|((clkpsc & 0xf)<> 4ul)-2ul) - - -/** - * @brief Calculate UART baudrate mode2 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode2 divider - * - * @details This macro calculate UART baudrate mode2 divider. - * \hideinitializer - */ -#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)/2ul)) / (u32BaudRate))-2ul) - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UART_WRITE(uart, u8Data) ((uart)->DAT = (u8Data)) - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module - * - * @return The oldest data byte in RX FIFO. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UART_READ(uart) ((uart)->DAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not empty - * @retval >=1 Tx FIFO is empty - * - * @details This macro get Transmitter FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_TX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not empty - * @retval >=1 Rx FIFO is empty - * - * @details This macro get Receiver FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_RX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified UART port transmission is over. - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. - * It indicates if specified UART port transmission is over nor not. - * \hideinitializer - */ -#define UART_IS_TX_EMPTY(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos) - - -/** - * @brief Wait specified UART port transmission is over - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro wait specified UART port transmission is over. - * \hideinitializer - */ -#define UART_WAIT_TX_EMPTY(uart) while(!((((uart)->FIFOSTS) & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos)) - - -/** - * @brief Check RX is ready or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 The number of bytes in the RX FIFO is less than the RFITL - * @retval 1 The number of bytes in the RX FIFO equals or larger than RFITL - * - * @details This macro check receive data available interrupt flag is set or not. - * \hideinitializer - */ -#define UART_IS_RX_READY(uart) (((uart)->INTSTS & UART_INTSTS_RDAIF_Msk)>>UART_INTSTS_RDAIF_Pos) - - -/** - * @brief Check TX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 TX FIFO is full - * @retval 0 TX FIFO is not full - * - * @details This macro check TX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_TX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk)>>UART_FIFOSTS_TXFULL_Pos) - - -/** - * @brief Check RX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 RX FIFO is full - * @retval 0 RX FIFO is not full - * - * @details This macro check RX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_RX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk)>>UART_FIFOSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not full. - * @retval >=1 Tx FIFO is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UART_GET_TX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not full. - * @retval >=1 Rx FIFO is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UART_GET_RX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk) - -/** - * @brief Rx Idle Status register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx is busy. - * @retval 1 Rx is Idle(Default) - * - * @details This macro get Rx Idle Status register value. - * \hideinitializer - */ -#define UART_RX_IDLE(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXIDLE_Msk )>> UART_FIFOSTS_RXIDLE_Pos) - -/** - * @brief Enable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty Interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Single-wire Bit Error Detection Interrupt - * - \ref UART_INTEN_SWBEIEN_Msk : Auto-baud Rate Interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin Bus Interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up Interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error Interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx Time-out Interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : MODEM Status Interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line Status Interrupt - * - \ref UART_INTEN_THREIEN_Msk : Transmit Holding Register Empty Interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Receive Data Available Interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_ENABLE_INT(uart, u32eIntSel) ((uart)->INTEN |= (u32eIntSel)) - - -/** - * @brief Disable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty Interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Single-wire Bit Error Detection Interrupt - * - \ref UART_INTEN_SWBEIEN_Msk : Auto-baud Rate Interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin Bus Interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up Interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error Interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx Time-out Interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : MODEM Status Interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line Status Interrupt - * - \ref UART_INTEN_THREIEN_Msk : Transmit Holding Register Empty Interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Receive Data Available Interrupt - * - * @return None - * - * @details This macro disable specified UART interrupt. - * \hideinitializer - */ -#define UART_DISABLE_INT(uart, u32eIntSel) ((uart)->INTEN &= ~ (u32eIntSel)) - - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref UART_INTSTS_ABRINT_Msk : Auto-baud Rate Interrupt Indicator - * - \ref UART_INTSTS_HWBUFEINT_Msk : PDMA Mode Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_HWTOINT_Msk : PDMA Mode Rx Time-out Interrupt Indicator - * - \ref UART_INTSTS_HWMODINT_Msk : PDMA Mode MODEM Status Interrupt Indicator - * - \ref UART_INTSTS_HWRLSINT_Msk : PDMA Mode Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_TXENDINT_Msk : Transmitter Empty Interrupt Indicator - * - \ref UART_INTSTS_SWBEINT_Msk : Single-wire Bit Error Detect Interrupt Indicator - * - \ref UART_INTSTS_TXENDIF_Msk : Transmitter Empty Interrupt Flag - * - \ref UART_INTSTS_HWBUFEIF_Msk : PDMA Mode Buffer Error Interrupt Flag - * - \ref UART_INTSTS_HWTOIF_Msk : PDMA Mode Time-out Interrupt Flag - * - \ref UART_INTSTS_HWMODIF_Msk : PDMA Mode MODEM Status Interrupt Flag - * - \ref UART_INTSTS_HWRLSIF_Msk : PDMA Mode Receive Line Status Flag - * - \ref UART_INTSTS_SWBEIF_Msk : Single-wire Bit Error Detect Interrupt Flag - * - \ref UART_INTSTS_LININT_Msk : LIN Bus Interrupt Indicator - * - \ref UART_INTSTS_WKINT_Msk : Wake-up Interrupt Indicator - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_RXTOINT_Msk : Rx Time-out Interrupt Indicator - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status Interrupt Indicator - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_THREINT_Msk : Transmit Holding Register Empty Interrupt Indicator - * - \ref UART_INTSTS_RDAINT_Msk : Receive Data Available Interrupt Indicator - * - \ref UART_INTSTS_LINIF_Msk : LIN Bus Interrupt Flag - * - \ref UART_INTSTS_WKIF_Msk : Wake-up Interrupt Flag - * - \ref UART_INTSTS_BUFERRIF_Msk : Buffer Error Interrupt Flag - * - \ref UART_INTSTS_RXTOIF_Msk : Rx Time-out Interrupt Flag - * - \ref UART_INTSTS_MODEMIF_Msk : MODEM Status Interrupt Flag - * - \ref UART_INTSTS_RLSIF_Msk : Receive Line Status Interrupt Flag - * - \ref UART_INTSTS_THREIF_Msk : Transmit Holding Register Empty Interrupt Flag - * - \ref UART_INTSTS_RDAIF_Msk : Receive Data Available Interrupt Flag - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define UART_GET_INT_FLAG(uart,u32eIntTypeFlag) (((uart)->INTSTS & (u32eIntTypeFlag))?1:0) - - -/** - * @brief Clear RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro clear RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_CLEAR_ADDR_FLAG(uart) ((uart)->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk) - - -/** - * @brief Get RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Receiver detects a data that is not an address bit. - * @retval 1 Receiver detects a data that is an address bit. - * - * @details This macro get RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_GET_ADDR_FLAG(uart) (((uart)->FIFOSTS & UART_FIFOSTS_ADDRDETF_Msk) >> UART_FIFOSTS_ADDRDETF_Pos) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T *uart); -__STATIC_INLINE void UART_SET_RTS(UART_T *uart); - - -/** - * @brief Set RTS pin to low - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to low. - * \hideinitializer - */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - uart->MODEM &= ~UART_MODEM_RTS_Msk; -} - - -/** - * @brief Set RTS pin to high - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to high. - * \hideinitializer - */ -__STATIC_INLINE void UART_SET_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk | UART_MODEM_RTS_Msk; -} - -/** - * @brief Enable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * @details This macro enable specified UART PDMA function. - * \hideinitializer - */ -#define UART_PDMA_ENABLE(uart, u32FuncSel) ((uart)->INTEN |= (u32FuncSel)) -/** - * @brief Disable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * @details This macro disable specified UART PDMA function. - * \hideinitializer - */ -#define UART_PDMA_DISABLE(uart, u32FuncSel) ((uart)->INTEN &= ~(u32FuncSel)) - - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Close(UART_T *uart); -void UART_DisableFlowCtrl(UART_T *uart); -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_EnableFlowCtrl(UART_T *uart); -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Open(UART_T *uart, uint32_t u32baudrate); -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC); -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction); -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr); -void UART_SelectLINMode(UART_T *uart, uint32_t u32Mode, uint32_t u32BreakLength); -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); -void UART_SelectSingleWireMode(UART_T *uart); - - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_UART_H__*/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usbd.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usbd.h deleted file mode 100644 index 94dc8775d2a..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usbd.h +++ /dev/null @@ -1,830 +0,0 @@ -/**************************************************************************//** - * @file nu_usbd.h - * @version V3.00 - * @brief M460 series USBD driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ****************************************************************************/ -#ifndef __NU_USBD_H__ -#define __NU_USBD_H__ - -//#define SUPPORT_LPM // define to support LPM - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - -/** @addtogroup USBD_EXPORTED_STRUCT USBD Exported Struct - @{ -*/ - -typedef struct s_usbd_info -{ - uint8_t *gu8DevDesc; /*!< Pointer for USB Device Descriptor */ - uint8_t *gu8ConfigDesc; /*!< Pointer for USB Configuration Descriptor */ - uint8_t **gu8StringDesc; /*!< Pointer for USB String Descriptor pointers */ - uint8_t **gu8HidReportDesc; /*!< Pointer for USB HID Report Descriptor */ - uint8_t *gu8BosDesc; /*!< Pointer for USB BOS Descriptor */ - uint32_t *gu32HidReportSize; /*!< Pointer for HID Report descriptor Size */ - uint32_t *gu32ConfigHidDescIdx; /*!< Pointer for HID Descriptor start index */ - -} S_USBD_INFO_T; /*!< Device description structure */ - -extern const S_USBD_INFO_T gsInfo; - -/*@}*/ /* end of group USBD_EXPORTED_STRUCT */ - - -/** @addtogroup USBD_EXPORTED_CONSTANTS USBD Exported Constants - @{ -*/ - -#define USBD_BUF_BASE (USBD_BASE+0x800ul) /*!< USBD buffer base address \hideinitializer */ -#define USBD_MAX_EP 25ul /*!< Total EP number \hideinitializer */ - -#define EP0 0ul /*!< Endpoint 0 \hideinitializer */ -#define EP1 1ul /*!< Endpoint 1 \hideinitializer */ -#define EP2 2ul /*!< Endpoint 2 \hideinitializer */ -#define EP3 3ul /*!< Endpoint 3 \hideinitializer */ -#define EP4 4ul /*!< Endpoint 4 \hideinitializer */ -#define EP5 5ul /*!< Endpoint 5 \hideinitializer */ -#define EP6 6ul /*!< Endpoint 6 \hideinitializer */ -#define EP7 7ul /*!< Endpoint 7 \hideinitializer */ -#define EP8 8ul /*!< Endpoint 8 \hideinitializer */ -#define EP9 9ul /*!< Endpoint 9 \hideinitializer */ -#define EP10 10ul /*!< Endpoint 10 \hideinitializer */ -#define EP11 11ul /*!< Endpoint 11 \hideinitializer */ -#define EP12 12ul /*!< Endpoint 12 \hideinitializer */ -#define EP13 13ul /*!< Endpoint 13 \hideinitializer */ -#define EP14 14ul /*!< Endpoint 14 \hideinitializer */ -#define EP15 15ul /*!< Endpoint 15 \hideinitializer */ -#define EP16 16ul /*!< Endpoint 16 \hideinitializer */ -#define EP17 17ul /*!< Endpoint 17 \hideinitializer */ -#define EP18 18ul /*!< Endpoint 18 \hideinitializer */ -#define EP19 19ul /*!< Endpoint 19 \hideinitializer */ -#define EP20 20ul /*!< Endpoint 20 \hideinitializer */ -#define EP21 21ul /*!< Endpoint 21 \hideinitializer */ -#define EP22 22ul /*!< Endpoint 22 \hideinitializer */ -#define EP23 23ul /*!< Endpoint 23 \hideinitializer */ -#define EP24 24ul /*!< Endpoint 24 \hideinitializer */ - -/** @cond HIDDEN_SYMBOLS */ -/* USB Request Type */ -#define REQ_STANDARD 0x00ul -#define REQ_CLASS 0x20ul -#define REQ_VENDOR 0x40ul - -/* USB Standard Request */ -#define GET_STATUS 0x00ul -#define CLEAR_FEATURE 0x01ul -#define SET_FEATURE 0x03ul -#define SET_ADDRESS 0x05ul -#define GET_DESCRIPTOR 0x06ul -#define SET_DESCRIPTOR 0x07ul -#define GET_CONFIGURATION 0x08ul -#define SET_CONFIGURATION 0x09ul -#define GET_INTERFACE 0x0Aul -#define SET_INTERFACE 0x0Bul -#define SYNC_FRAME 0x0Cul - -/* USB Descriptor Type */ -#define DESC_DEVICE 0x01ul -#define DESC_CONFIG 0x02ul -#define DESC_STRING 0x03ul -#define DESC_INTERFACE 0x04ul -#define DESC_ENDPOINT 0x05ul -#define DESC_QUALIFIER 0x06ul -#define DESC_OTHERSPEED 0x07ul -#define DESC_IFPOWER 0x08ul -#define DESC_OTG 0x09ul -#define DESC_BOS 0x0Ful -#define DESC_CAPABILITY 0x10ul - -/* USB Device Capability Type */ -#define CAP_WIRELESS 0x01ul -#define CAP_USB20_EXT 0x02ul - -/* USB HID Descriptor Type */ -#define DESC_HID 0x21ul -#define DESC_HID_RPT 0x22ul - -/* USB Descriptor Length */ -#define LEN_DEVICE 18ul -#define LEN_QUALIFIER 10ul -#define LEN_CONFIG 9ul -#define LEN_INTERFACE 9ul -#define LEN_ENDPOINT 7ul -#define LEN_OTG 5ul -#define LEN_BOS 5ul -#define LEN_HID 9ul -#define LEN_CCID 0x36ul -#define LEN_BOSCAP 7ul - -/* USB Endpoint Type */ -#define EP_ISO 0x01 -#define EP_BULK 0x02 -#define EP_INT 0x03 - -#define EP_INPUT 0x80 -#define EP_OUTPUT 0x00 - -/* USB Feature Selector */ -#define FEATURE_DEVICE_REMOTE_WAKEUP 0x01ul -#define FEATURE_ENDPOINT_HALT 0x00ul -/** @endcond HIDDEN_SYMBOLS */ - -/******************************************************************************/ -/* USB Specific Macros */ -/******************************************************************************/ - -#define USBD_WAKEUP_EN USBD_INTEN_WKEN_Msk /*!< USB Wake-up Enable \hideinitializer */ -#define USBD_DRVSE0 USBD_SE0_SE0_Msk /*!< Drive SE0 \hideinitializer */ - -#define USBD_LPMACK USBD_ATTR_LPMACK_Msk /*!< LPM Enable \hideinitializer */ -#define USBD_BYTEM USBD_ATTR_BYTEM_Msk /*!< Access Size Mode Selection \hideinitializer */ -#define USBD_PWRDN USBD_ATTR_PWRDN_Msk /*!< PHY Turn-On \hideinitializer */ -#define USBD_DPPU_EN USBD_ATTR_DPPUEN_Msk /*!< USB D+ Pull-up Enable \hideinitializer */ -#define USBD_USB_EN USBD_ATTR_USBEN_Msk /*!< USB Enable \hideinitializer */ -#define USBD_RWAKEUP USBD_ATTR_RWAKEUP_Msk /*!< Remote Wake-Up \hideinitializer */ -#define USBD_PHY_EN USBD_ATTR_PHYEN_Msk /*!< PHY Enable \hideinitializer */ - -#define USBD_INT_BUS USBD_INTEN_BUSIEN_Msk /*!< USB Bus Event Interrupt \hideinitializer */ -#define USBD_INT_USB USBD_INTEN_USBIEN_Msk /*!< USB Event Interrupt \hideinitializer */ -#define USBD_INT_FLDET USBD_INTEN_VBDETIEN_Msk /*!< USB VBUS Detection Interrupt \hideinitializer */ -#define USBD_INT_WAKEUP (USBD_INTEN_NEVWKIEN_Msk | USBD_INTEN_WKEN_Msk) /*!< USB No-Event-Wake-Up Interrupt \hideinitializer */ -#define USBD_INT_SOF USBD_INTEN_SOFIEN_Msk /*!< USB Start of Frame Interrupt \hideinitializer */ - -#define USBD_INTSTS_WAKEUP USBD_INTSTS_NEVWKIF_Msk /*!< USB No-Event-Wake-Up Interrupt Status \hideinitializer */ -#define USBD_INTSTS_FLDET USBD_INTSTS_VBDETIF_Msk /*!< USB Float Detect Interrupt Status \hideinitializer */ -#define USBD_INTSTS_BUS USBD_INTSTS_BUSIF_Msk /*!< USB Bus Event Interrupt Status \hideinitializer */ -#define USBD_INTSTS_USB USBD_INTSTS_USBIF_Msk /*!< USB Event Interrupt Status \hideinitializer */ -#define USBD_INTSTS_SETUP USBD_INTSTS_SETUP_Msk /*!< USB Setup Event \hideinitializer */ -#define USBD_INTSTS_EP0 USBD_INTSTS_EPEVT0_Msk /*!< USB Endpoint 0 Event \hideinitializer */ -#define USBD_INTSTS_EP1 USBD_INTSTS_EPEVT1_Msk /*!< USB Endpoint 1 Event \hideinitializer */ -#define USBD_INTSTS_EP2 USBD_INTSTS_EPEVT2_Msk /*!< USB Endpoint 2 Event \hideinitializer */ -#define USBD_INTSTS_EP3 USBD_INTSTS_EPEVT3_Msk /*!< USB Endpoint 3 Event \hideinitializer */ -#define USBD_INTSTS_EP4 USBD_INTSTS_EPEVT4_Msk /*!< USB Endpoint 4 Event \hideinitializer */ -#define USBD_INTSTS_EP5 USBD_INTSTS_EPEVT5_Msk /*!< USB Endpoint 5 Event \hideinitializer */ -#define USBD_INTSTS_EP6 USBD_INTSTS_EPEVT6_Msk /*!< USB Endpoint 6 Event \hideinitializer */ -#define USBD_INTSTS_EP7 USBD_INTSTS_EPEVT7_Msk /*!< USB Endpoint 7 Event \hideinitializer */ -#define USBD_INTSTS_EP8 USBD_INTSTS_EPEVT8_Msk /*!< USB Endpoint 8 Event \hideinitializer */ -#define USBD_INTSTS_EP9 USBD_INTSTS_EPEVT9_Msk /*!< USB Endpoint 9 Event \hideinitializer */ -#define USBD_INTSTS_EP10 USBD_INTSTS_EPEVT10_Msk /*!< USB Endpoint 10 Event \hideinitializer */ -#define USBD_INTSTS_EP11 USBD_INTSTS_EPEVT11_Msk /*!< USB Endpoint 11 Event \hideinitializer */ - -#define USBD_EPINTSTS_EP0 USBD_EPINTSTS_EPEVT0_Msk /*!< USB Endpoint 0 Event \hideinitializer */ -#define USBD_EPINTSTS_EP1 USBD_EPINTSTS_EPEVT1_Msk /*!< USB Endpoint 1 Event \hideinitializer */ -#define USBD_EPINTSTS_EP2 USBD_EPINTSTS_EPEVT2_Msk /*!< USB Endpoint 2 Event \hideinitializer */ -#define USBD_EPINTSTS_EP3 USBD_EPINTSTS_EPEVT3_Msk /*!< USB Endpoint 3 Event \hideinitializer */ -#define USBD_EPINTSTS_EP4 USBD_EPINTSTS_EPEVT4_Msk /*!< USB Endpoint 4 Event \hideinitializer */ -#define USBD_EPINTSTS_EP5 USBD_EPINTSTS_EPEVT5_Msk /*!< USB Endpoint 5 Event \hideinitializer */ -#define USBD_EPINTSTS_EP6 USBD_EPINTSTS_EPEVT6_Msk /*!< USB Endpoint 6 Event \hideinitializer */ -#define USBD_EPINTSTS_EP7 USBD_EPINTSTS_EPEVT7_Msk /*!< USB Endpoint 7 Event \hideinitializer */ -#define USBD_EPINTSTS_EP8 USBD_EPINTSTS_EPEVT8_Msk /*!< USB Endpoint 8 Event \hideinitializer */ -#define USBD_EPINTSTS_EP9 USBD_EPINTSTS_EPEVT9_Msk /*!< USB Endpoint 9 Event \hideinitializer */ -#define USBD_EPINTSTS_EP10 USBD_EPINTSTS_EPEVT10_Msk /*!< USB Endpoint 10 Event \hideinitializer */ -#define USBD_EPINTSTS_EP11 USBD_EPINTSTS_EPEVT11_Msk /*!< USB Endpoint 11 Event \hideinitializer */ -#define USBD_EPINTSTS_EP12 USBD_EPINTSTS_EPEVT12_Msk /*!< USB Endpoint 12 Event \hideinitializer */ -#define USBD_EPINTSTS_EP13 USBD_EPINTSTS_EPEVT13_Msk /*!< USB Endpoint 13 Event \hideinitializer */ -#define USBD_EPINTSTS_EP14 USBD_EPINTSTS_EPEVT14_Msk /*!< USB Endpoint 14 Event \hideinitializer */ -#define USBD_EPINTSTS_EP15 USBD_EPINTSTS_EPEVT15_Msk /*!< USB Endpoint 15 Event \hideinitializer */ -#define USBD_EPINTSTS_EP16 USBD_EPINTSTS_EPEVT16_Msk /*!< USB Endpoint 16 Event \hideinitializer */ -#define USBD_EPINTSTS_EP17 USBD_EPINTSTS_EPEVT17_Msk /*!< USB Endpoint 17 Event \hideinitializer */ -#define USBD_EPINTSTS_EP18 USBD_EPINTSTS_EPEVT18_Msk /*!< USB Endpoint 18 Event \hideinitializer */ -#define USBD_EPINTSTS_EP19 USBD_EPINTSTS_EPEVT19_Msk /*!< USB Endpoint 19 Event \hideinitializer */ -#define USBD_EPINTSTS_EP20 USBD_EPINTSTS_EPEVT20_Msk /*!< USB Endpoint 20 Event \hideinitializer */ -#define USBD_EPINTSTS_EP21 USBD_EPINTSTS_EPEVT21_Msk /*!< USB Endpoint 21 Event \hideinitializer */ -#define USBD_EPINTSTS_EP22 USBD_EPINTSTS_EPEVT22_Msk /*!< USB Endpoint 22 Event \hideinitializer */ -#define USBD_EPINTSTS_EP23 USBD_EPINTSTS_EPEVT23_Msk /*!< USB Endpoint 23 Event \hideinitializer */ -#define USBD_EPINTSTS_EP24 USBD_EPINTSTS_EPEVT24_Msk /*!< USB Endpoint 24 Event \hideinitializer */ - -#define USBD_STATE_USBRST USBD_ATTR_USBRST_Msk /*!< USB Bus Reset \hideinitializer */ -#define USBD_STATE_SUSPEND USBD_ATTR_SUSPEND_Msk /*!< USB Bus Suspend \hideinitializer */ -#define USBD_STATE_RESUME USBD_ATTR_RESUME_Msk /*!< USB Bus Resume \hideinitializer */ -#define USBD_STATE_TIMEOUT USBD_ATTR_TOUT_Msk /*!< USB Bus Timeout \hideinitializer */ -#define USBD_STATE_L1SUSPEND USBD_ATTR_L1SUSPEND_Msk /*!< USB Bus L1SUSPEND \hideinitializer */ -#define USBD_STATE_L1RESUME USBD_ATTR_L1RESUME_Msk /*!< USB Bus L1RESUME \hideinitializer */ - -#define USBD_CFG_DB_EN USBD_CFG_DBEN_Msk /*!< Double Buffer Enable \hideinitializer */ -#define USBD_CFG_DBTGACTIVE USBD_CFG_DBTGACTIVE_Msk /*!< Double Buffer Toggle Active \hideinitializer */ - -#define USBD_CFGP_SSTALL USBD_CFGP_SSTALL_Msk /*!< Set Stall \hideinitializer */ -#define USBD_CFG_CSTALL USBD_CFG_CSTALL_Msk /*!< Clear Stall \hideinitializer */ - -#define USBD_CFG_EPMODE_DISABLE (0ul << USBD_CFG_STATE_Pos) /*!< Endpoint Disable \hideinitializer */ -#define USBD_CFG_EPMODE_OUT (1ul << USBD_CFG_STATE_Pos) /*!< Out Endpoint \hideinitializer */ -#define USBD_CFG_EPMODE_IN (2ul << USBD_CFG_STATE_Pos) /*!< In Endpoint \hideinitializer */ -#define USBD_CFG_TYPE_ISO (1ul << USBD_CFG_ISOCH_Pos) /*!< Isochronous \hideinitializer */ - -/*@}*/ /* end of group USBD_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBD_EXPORTED_FUNCTIONS USBD Exported Functions - @{ -*/ - -/** - * @brief Compare two input numbers and return maximum one. - * - * @param[in] a First number to be compared. - * @param[in] b Second number to be compared. - * - * @return Maximum value between a and b. - * - * @details If a > b, then return a. Otherwise, return b. - * \hideinitializer - */ -#define USBD_Maximum(a,b) ((a)>(b) ? (a) : (b)) - -/** - * @brief Compare two input numbers and return minimum one - * - * @param[in] a First number to be compared - * @param[in] b Second number to be compared - * - * @return Minimum value between a and b - * - * @details If a < b, then return a. Otherwise, return b. - * \hideinitializer - */ -#define USBD_Minimum(a,b) ((a)<(b) ? (a) : (b)) - -/** - * @brief Enable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB and PHY. - * \hideinitializer - */ -#define USBD_ENABLE_USB() ((uint32_t)(USBD->ATTR |= 0x7D0)) - -/** - * @brief Disable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB. - * \hideinitializer - */ -#define USBD_DISABLE_USB() ((uint32_t)(USBD->ATTR &= ~USBD_USB_EN)) - -/** - * @brief Enable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB PHY. - * \hideinitializer - */ -#define USBD_ENABLE_PHY() ((uint32_t)(USBD->ATTR |= USBD_PHY_EN)) - -/** - * @brief Disable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB PHY. - * \hideinitializer - */ -#define USBD_DISABLE_PHY() ((uint32_t)(USBD->ATTR &= ~USBD_PHY_EN)) - -/** - * @brief Enable SE0. Force USB PHY transceiver to drive SE0. - * - * @param None - * - * @return None - * - * @details Set DRVSE0 bit of USB_DRVSE0 register to enable software-disconnect function. Force USB PHY transceiver to drive SE0 to bus. - * \hideinitializer - */ -#define USBD_SET_SE0() ((uint32_t)(USBD->SE0 |= USBD_DRVSE0)) - -/** - * @brief Disable SE0 - * - * @param None - * - * @return None - * - * @details Clear DRVSE0 bit of USB_DRVSE0 register to disable software-disconnect function. - * \hideinitializer - */ -#define USBD_CLR_SE0() ((uint32_t)(USBD->SE0 &= ~USBD_DRVSE0)) - -/** - * @brief Set USB device address - * - * @param[in] addr The USB device address. - * - * @return None - * - * @details Write USB device address to USB_FADDR register. - * \hideinitializer - */ -#define USBD_SET_ADDR(addr) (USBD->FADDR = (addr)) - -/** - * @brief Get USB device address - * - * @param None - * - * @return USB device address - * - * @details Read USB_FADDR register to get USB device address. - * \hideinitializer - */ -#define USBD_GET_ADDR() ((uint32_t)(USBD->FADDR)) - -/** - * @brief Enable USB interrupt function - * - * @param[in] intr The combination of the specified interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. - * (USBD_INT_SOF, USBD_INT_WAKEUP, USBD_INT_FLDET, USBD_INT_USB, USBD_INT_BUS) - * - * @return None - * - * @details Enable USB related interrupt functions specified by intr parameter. - * \hideinitializer - */ -#define USBD_ENABLE_INT(intr) (USBD->INTEN |= (intr)) - -/** - * @brief Get interrupt status - * - * @param None - * - * @return The value of USB_INTSTS register - * - * @details Return all interrupt flags of USB_INTSTS register. - * \hideinitializer - */ -#define USBD_GET_INT_FLAG() ((uint32_t)(USBD->INTSTS)) - -/** - * @brief Clear USB interrupt flag - * - * @param[in] flag The combination of the specified interrupt flags. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. - * (USBD_INT_SOF, USBD_INTSTS_WAKEUP, USBD_INTSTS_FLDET, USBD_INTSTS_BUS, USBD_INTSTS_USB) - * - * @return None - * - * @details Clear USB related interrupt flags specified by flag parameter. - * \hideinitializer - */ -#define USBD_CLR_INT_FLAG(flag) (USBD->INTSTS = (flag)) - -/** - * @brief Get endpoint interrupt status - * - * @param None - * - * @return The value of USB_EPINTSTS register - * - * @details Return all endpoint interrupt flags of USB_EPINTSTS register. - * \hideinitializer - */ -#define USBD_GET_EP_INT_FLAG() ((uint32_t)(USBD->EPINTSTS)) - -/** - * @brief Clear USB endpoint interrupt flag - * - * @param[in] flag The combination of the specified endpoint interrupt flags. - * Each bit corresponds to a endpoint interrupt source. - * This parameter decides which endpoint interrupt flags will be cleared. - * - * @return None - * - * @details Clear USB related interrupt flags specified by flag parameter. - * \hideinitializer - */ -#define USBD_CLR_EP_INT_FLAG(flag) (USBD->EPINTSTS = (flag)) - -/** - * @brief Get endpoint status - * - * @param None - * - * @return The value of USB_EPSTS register. - * - * @details Return all endpoint status. - * \hideinitializer - */ -#define USBD_GET_EP_FLAG() ((uint32_t)(USBD->EPSTS)) - -/** - * @brief Get USB bus state - * - * @param None - * - * @return The value of USB_ATTR[13:12] and USB_ATTR[3:0]. - * Bit 0 indicates USB bus reset status. - * Bit 1 indicates USB bus suspend status. - * Bit 2 indicates USB bus resume status. - * Bit 3 indicates USB bus time-out status. - * Bit 12 indicates USB bus LPM L1 suspend status. - * Bit 13 indicates USB bus LPM L1 resume status. - * - * @details Return USB_ATTR[13:12] and USB_ATTR[3:0] for USB bus events. - * \hideinitializer - */ -#define USBD_GET_BUS_STATE() ((uint32_t)(USBD->ATTR & 0x300f)) - -/** - * @brief Check cable connection state - * - * @param None - * - * @retval 0 USB cable is not attached. - * @retval 1 USB cable is attached. - * - * @details Check the connection state by FLDET bit of USB_FLDET register. - * \hideinitializer - */ -#define USBD_IS_ATTACHED() ((uint32_t)(USBD->VBUSDET & USBD_VBUSDET_VBUSDET_Msk)) - -/** - * @brief Stop USB transaction of the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Write 1 to CLRRDY bit of USB_CFGPx register to stop USB transaction of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_STOP_TRANSACTION(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_CLRRDY_Msk) - -/** - * @brief Set USB DATA1 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Set DSQ_SYNC bit of USB_CFGx register to specify the DATA1 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions. - * \hideinitializer - */ -#define USBD_SET_DATA1(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DSQSYNC_Msk) - -/** - * @brief Set USB DATA0 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Clear DSQ_SYNC bit of USB_CFGx register to specify the DATA0 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions. - * \hideinitializer - */ -#define USBD_SET_DATA0(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DSQSYNC_Msk)) - -/** - * @brief Set USB payload size (IN data) - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @param[in] size The transfer length. - * - * @return None - * - * @details This macro will write the transfer length to USB_MXPLDx register for IN data transaction. - * \hideinitializer - */ -#define USBD_SET_PAYLOAD_LEN(ep, size) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4))) = (size)) - -/** - * @brief Get USB payload size (OUT data) - * - * @param[in] ep The USB endpoint ID. M460 Series supports 8 endpoint ID. This parameter could be 0 ~ 24. - * - * @return The value of USB_MXPLDx register. - * - * @details Get the data length of OUT data transaction by reading USB_MXPLDx register. - * \hideinitializer - */ -#define USBD_GET_PAYLOAD_LEN(ep) ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4)))) - -/** - * @brief Configure endpoint - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @param[in] config The USB configuration. - * - * @return None - * - * @details This macro will write config parameter to USB_CFGx register of specified endpoint ID. - * \hideinitializer - */ -#define USBD_CONFIG_EP(ep, config) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) = (config)) - -/** - * @brief Set USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @param[in] offset The SRAM offset. - * - * @return None - * - * @details This macro will set the SRAM offset for the specified endpoint ID. - * \hideinitializer - */ -#define USBD_SET_EP_BUF_ADDR(ep, offset) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4))) = (offset)) - -/** - * @brief Get the offset of the specified USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return The offset of the specified endpoint buffer. - * - * @details This macro will return the SRAM offset of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_GET_EP_BUF_ADDR(ep) ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4)))) - -/** - * @brief Set USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - * \hideinitializer - */ -#define USBD_SET_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0ul].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_SSTALL_Msk) - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - * \hideinitializer - */ -#define USBD_CLR_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) &= ~USBD_CFGP_SSTALL_Msk) - -/** - * @brief Get USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_GET_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) & USBD_CFGP_SSTALL_Msk) - -/** - * @brief Set USB double buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Set DBEN bit of USB_CFGx register to enable the double buffer mode of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_SET_DB_MODE(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DBEN_Msk) - -/** - * @brief Set USB single buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Clear DBEN bit of USB_CFGx register to enable the single buffer mode of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_SET_SB_MODE(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DBEN_Msk)) - -/** - * @brief Get the buffer mode of the specified USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @retval 0 USB is single buffer mode. - * @retval 1 USB is double buffer mode. - * - * @details This macro will return the buffer mode of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_IS_DB_MODE(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) & USBD_CFG_DBEN_Msk) - -/** - * @brief Set to active in USB double buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Set DBTGACTIVE bit of USB_CFGx register for toggle active in the double buffer mode of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_SET_DB_ACTIVE(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DBTGACTIVE_Msk) - -/** - * @brief Set to inactive in USB double buffer mode for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M460 Series supports 25 hardware endpoint ID. This parameter could be 0 ~ 24. - * - * @return None - * - * @details Clear DBTGACTIVE bit of USB_CFGx register for toggle inactive in the double buffer mode of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_SET_DB_INACTIVE(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DBTGACTIVE_Msk)) - -/** - * @brief To support byte access between USB SRAM and system SRAM - * - * @param[in] dest Destination pointer. - * - * @param[in] src Source pointer. - * - * @param[in] size Byte count. - * - * @return None - * - * @details This function will copy the number of data specified by size and src parameters to the address specified by dest parameter. - * - */ -__STATIC_INLINE void USBD_MemCopy(uint8_t dest[], uint8_t src[], uint32_t size) -{ - uint32_t volatile i = 0ul; - - while (size--) - { - dest[i] = src[i]; - i++; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Set USB endpoint stall state. Endpoint will respond STALL token automatically. - * - */ -__STATIC_INLINE void USBD_SetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for (i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if ((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg | USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Clear USB endpoint stall state. Endpoint will respond ACK/NAK token. - * - */ -__STATIC_INLINE void USBD_ClearStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for (i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if ((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg & ~USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - * - */ -__STATIC_INLINE uint32_t USBD_GetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for (i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if ((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - break; - } - } - - return ((*((__IO uint32_t *)(u32CfgAddr))) & USBD_CFGP_SSTALL); -} - -extern uint8_t g_usbd_SetupPacket[8]; -extern volatile uint8_t g_usbd_RemoteWakeupEn; - - -typedef void (*VENDOR_REQ)(void); /*!< Functional pointer type definition for Vendor class */ -typedef void (*CLASS_REQ)(void); /*!< Functional pointer type declaration for USB class request callback handler */ -typedef void (*SET_INTERFACE_REQ)(uint32_t u32AltInterface); /*!< Functional pointer type declaration for USB set interface request callback handler */ -typedef void (*SET_CONFIG_CB)(void); /*!< Functional pointer type declaration for USB set configuration request callback handler */ - - -/*--------------------------------------------------------------------*/ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface); -void USBD_Start(void); -void USBD_GetSetupPacket(uint8_t *buf); -void USBD_ProcessSetupPacket(void); -void USBD_GetDescriptor(void); -void USBD_StandardRequest(void); -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size); -void USBD_CtrlIn(void); -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size); -void USBD_CtrlOut(void); -void USBD_SwReset(void); -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq); -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback); -void USBD_LockEpStall(uint32_t u32EpBitmap); - - -/*@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_USBD_H__*/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_i2c.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_i2c.h deleted file mode 100644 index eb49fd3dad3..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_i2c.h +++ /dev/null @@ -1,337 +0,0 @@ -/**************************************************************************//** - * @file USCI_I2C.h - * @version V3.0 - * @brief M460 series USCI I2C(UI2C) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_USCI_I2C_H__ -#define __NU_USCI_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - -/** @addtogroup USCI_I2C_EXPORTED_CONSTANTS USCI_I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C master event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_MASTER_EVENT -{ - MASTER_SEND_ADDRESS = 10, /*!< Master send address to Slave */ - MASTER_SEND_H_WR_ADDRESS, /*!< Master send High address to Slave */ - MASTER_SEND_H_RD_ADDRESS, /*!< Master send address to Slave (Read ADDR) */ - MASTER_SEND_L_ADDRESS, /*!< Master send Low address to Slave */ - MASTER_SEND_DATA, /*!< Master Send Data to Slave */ - MASTER_SEND_REPEAT_START, /*!< Master send repeat start to Slave */ - MASTER_READ_DATA, /*!< Master Get Data from Slave */ - MASTER_STOP, /*!< Master send stop to Slave */ - MASTER_SEND_START /*!< Master send start to Slave */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C slave event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_SLAVE_EVENT -{ - SLAVE_ADDRESS_ACK = 100, /*!< Slave send address ACK */ - SLAVE_H_WR_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_WR_ADDRESS_ACK, /*!< Slave send Low address ACK */ - SLAVE_GET_DATA, /*!< Slave Get Data from Master (Write CMD) */ - SLAVE_SEND_DATA, /*!< Slave Send Data to Master (Read CMD) */ - SLAVE_H_RD_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_RD_ADDRESS_ACK /*!< Slave send Low address ACK */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_CTL_PTRG 0x20UL /*!< USCI_CTL setting for I2C control bits. It would set PTRG bit \hideinitializer */ -#define UI2C_CTL_STA 0x08UL /*!< USCI_CTL setting for I2C control bits. It would set STA bit \hideinitializer */ -#define UI2C_CTL_STO 0x04UL /*!< USCI_CTL setting for I2C control bits. It would set STO bit \hideinitializer */ -#define UI2C_CTL_AA 0x02UL /*!< USCI_CTL setting for I2C control bits. It would set AA bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_GCMODE_ENABLE (1U) /*!< Enable USCI_I2C GC Mode \hideinitializer */ -#define UI2C_GCMODE_DISABLE (0U) /*!< Disable USCI_I2C GC Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C Wakeup Mode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_DATA_TOGGLE_WK (0x0U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according data toggle \hideinitializer */ -#define UI2C_ADDR_MATCH_WK (0x1U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according address match \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_TO_INT_MASK (0x001U) /*!< Time-out interrupt mask \hideinitializer */ -#define UI2C_STAR_INT_MASK (0x002U) /*!< Start condition received interrupt mask \hideinitializer */ -#define UI2C_STOR_INT_MASK (0x004U) /*!< Stop condition received interrupt mask \hideinitializer */ -#define UI2C_NACK_INT_MASK (0x008U) /*!< Non-acknowledge interrupt mask \hideinitializer */ -#define UI2C_ARBLO_INT_MASK (0x010U) /*!< Arbitration lost interrupt mask \hideinitializer */ -#define UI2C_ERR_INT_MASK (0x020U) /*!< Error interrupt mask \hideinitializer */ -#define UI2C_ACK_INT_MASK (0x040U) /*!< Acknowledge interrupt mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C Time-out Handler Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_TIMEOUT SystemCoreClock /*!< 1 second time-out \hideinitializer */ -#define UI2C_TIMEOUT_ERR (-1L) /*!< UI2C operation abort due to timeout error \hideinitializer */ - -/*@}*/ /* end of group USCI_I2C_EXPORTED_CONSTANTS */ - -extern int32_t g_UI2C_i32ErrCode; - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This macro sets the USCI_I2C protocol control register at one time - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Ctrl Set the register value of USCI_I2C control register. - * - * @return None - * - * @details Set UI2C_PROTCTL register to control USCI_I2C bus conditions of START, STOP, SI, ACK. - * \hideinitializer - */ -#define UI2C_SET_CONTROL_REG(ui2c, u8Ctrl) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2EU) | (u8Ctrl)) - -/** - * @brief This macro only set START bit to protocol control register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus START condition in UI2C_PROTCTL register. - * \hideinitializer - */ -#define UI2C_START(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~UI2C_PROTCTL_PTRG_Msk) | UI2C_PROTCTL_STA_Msk) - -/** - * @brief This macro only set STOP bit to the control register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus STOP condition in UI2C_PROTCTL register. - * \hideinitializer - */ -#define UI2C_STOP(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2E) | (UI2C_PROTCTL_PTRG_Msk | UI2C_PROTCTL_STO_Msk)) - -/** - * @brief This macro returns the data stored in data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Data - * - * @details Read a byte data value of UI2C_RXDAT register from USCI_I2C bus - * \hideinitializer - */ -#define UI2C_GET_DATA(ui2c) ((ui2c)->RXDAT) - -/** - * @brief This macro writes the data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details Write a byte data value of UI2C_TXDAT register, then sends address or data to USCI I2C bus - * \hideinitializer - */ -#define UI2C_SET_DATA(ui2c, u8Data) ((ui2c)->TXDAT = (u8Data)) - -/** - * @brief This macro returns time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 USCI_I2C bus time-out is not happened - * @retval 1 USCI_I2C bus time-out is happened - * - * @details USCI_I2C bus occurs time-out event, the time-out flag will be set. If not occurs time-out event, this bit is cleared. - * \hideinitializer - */ -#define UI2C_GET_TIMEOUT_FLAG(ui2c) (((ui2c)->PROTSTS & UI2C_PROTSTS_TOIF_Msk) == UI2C_PROTSTS_TOIF_Msk ? 1:0) - -/** - * @brief This macro returns wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details USCI_I2C controller wake-up flag will be set when USCI_I2C bus occurs wake-up from deep-sleep. - * \hideinitializer - */ -#define UI2C_GET_WAKEUP_FLAG(ui2c) (((ui2c)->WKSTS & UI2C_WKSTS_WKF_Msk) == UI2C_WKSTS_WKF_Msk ? 1:0) - -/** - * @brief This macro is used to clear USCI_I2C wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details If USCI_I2C wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define UI2C_CLR_WAKEUP_FLAG(ui2c) ((ui2c)->WKSTS = UI2C_WKSTS_WKF_Msk) - -/** - * @brief This macro disables the USCI_I2C 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details The UI2C_I2C is 7-bit address mode, when disable USCI_I2C 10-bit address match function. - * \hideinitializer - */ -#define UI2C_DISABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL &= ~(UI2C_PROTCTL_ADDR10EN_Msk)) - -/** - * @brief This macro enables the 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To enable USCI_I2C 10-bit address match function. - * \hideinitializer - */ -#define UI2C_ENABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL |= UI2C_PROTCTL_ADDR10EN_Msk) - -/** - * @brief This macro gets USCI_I2C protocol interrupt flag or bus status - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return A word data of USCI_I2C_PROTSTS register - * - * @details Read a word data of USCI_I2C PROTSTS register to get USCI_I2C bus Interrupt flags or status. - * \hideinitializer - */ -#define UI2C_GET_PROT_STATUS(ui2c) ((ui2c)->PROTSTS) - -/** - * @brief This macro clears specified protocol interrupt flag - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UI2C_PROTSTS_ACKIF_Msk - * - \ref UI2C_PROTSTS_ERRIF_Msk - * - \ref UI2C_PROTSTS_ARBLOIF_Msk - * - \ref UI2C_PROTSTS_NACKIF_Msk - * - \ref UI2C_PROTSTS_STORIF_Msk - * - \ref UI2C_PROTSTS_STARIF_Msk - * - \ref UI2C_PROTSTS_TOIF_Msk - * @return None - * - * @details To clear interrupt flag when USCI_I2C occurs interrupt and set interrupt flag. - * \hideinitializer - */ -#define UI2C_CLR_PROT_INT_FLAG(ui2c,u32IntTypeFlag) ((ui2c)->PROTSTS = (u32IntTypeFlag)) - -/** - * @brief This macro enables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Set specified USCI_I2C protocol interrupt bits to enable interrupt function. - * \hideinitializer - */ -#define UI2C_ENABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN |= (u32IntSel)) - -/** - * @brief This macro disables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Clear specified USCI_I2C protocol interrupt bits to disable interrupt function. - * \hideinitializer - */ -#define UI2C_DISABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN &= ~ (u32IntSel)) - - -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock); -void UI2C_Close(UI2C_T *ui2c); -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c); -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack); -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask); -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c); -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock); -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_ClearIntFlag(UI2C_T *ui2c, uint32_t u32Mask); -uint32_t UI2C_GetData(UI2C_T *ui2c); -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data); -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode); -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask); -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt); -void UI2C_DisableTimeout(UI2C_T *ui2c); -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode); -void UI2C_DisableWakeup(UI2C_T *ui2c); -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr); -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen); -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen); -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen); - -/*@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_spi.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_spi.h deleted file mode 100644 index aa900e2d529..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_spi.h +++ /dev/null @@ -1,426 +0,0 @@ -/**************************************************************************//** - * @file nu_usci_spi.h - * @version V3.00 - * @brief M460 series USCI_SPI driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_USCI_SPI_H__ -#define __NU_USCI_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - -/** @addtogroup USCI_SPI_EXPORTED_CONSTANTS USCI_SPI Exported Constants - @{ -*/ - -#define USPI_MODE_0 (0x0 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with falling edge and receive with rising edge \hideinitializer */ -#define USPI_MODE_1 (0x1 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with rising edge and receive with falling edge \hideinitializer */ -#define USPI_MODE_2 (0x2 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with rising edge and receive with falling edge \hideinitializer */ -#define USPI_MODE_3 (0x3 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with falling edge and receive with rising edge \hideinitializer */ - -#define USPI_SLAVE (USPI_PROTCTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define USPI_MASTER (0x0ul) /*!< Set as master \hideinitializer */ - -#define USPI_SS (USPI_PROTCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define USPI_SS_ACTIVE_HIGH (0x0ul) /*!< SS active high \hideinitializer */ -#define USPI_SS_ACTIVE_LOW (USPI_LINECTL_CTLOINV_Msk) /*!< SS active low \hideinitializer */ - -/* USCI_SPI Interrupt Mask */ -#define USPI_SSINACT_INT_MASK (0x001ul) /*!< Slave Slave Inactive interrupt mask \hideinitializer */ -#define USPI_SSACT_INT_MASK (0x002ul) /*!< Slave Slave Active interrupt mask \hideinitializer */ -#define USPI_SLVTO_INT_MASK (0x004ul) /*!< Slave Mode Time-out interrupt mask \hideinitializer */ -#define USPI_SLVBE_INT_MASK (0x008ul) /*!< Slave Mode Bit Count Error interrupt mask \hideinitializer */ -#define USPI_TXUDR_INT_MASK (0x010ul) /*!< Slave Transmit Under Run interrupt mask \hideinitializer */ -#define USPI_RXOV_INT_MASK (0x020ul) /*!< Receive Buffer Overrun interrupt mask \hideinitializer */ -#define USPI_TXST_INT_MASK (0x040ul) /*!< Transmit Start interrupt mask \hideinitializer */ -#define USPI_TXEND_INT_MASK (0x080ul) /*!< Transmit End interrupt mask \hideinitializer */ -#define USPI_RXST_INT_MASK (0x100ul) /*!< Receive Start interrupt mask \hideinitializer */ -#define USPI_RXEND_INT_MASK (0x200ul) /*!< Receive End interrupt mask \hideinitializer */ - -/* USCI_SPI Status Mask */ -#define USPI_BUSY_MASK (0x01ul) /*!< Busy status mask \hideinitializer */ -#define USPI_RX_EMPTY_MASK (0x02ul) /*!< RX empty status mask \hideinitializer */ -#define USPI_RX_FULL_MASK (0x04ul) /*!< RX full status mask \hideinitializer */ -#define USPI_TX_EMPTY_MASK (0x08ul) /*!< TX empty status mask \hideinitializer */ -#define USPI_TX_FULL_MASK (0x10ul) /*!< TX full status mask \hideinitializer */ -#define USPI_SSLINE_STS_MASK (0x20ul) /*!< USCI_SPI_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group USCI_SPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief Disable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL &= ~USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL |= USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Get the Rx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Rx buffer flag - * @retval 0: Rx buffer is not empty - * @retval 1: Rx buffer is empty - * \hideinitializer - */ -#define USPI_GET_RX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_RXEMPTY_Msk) == USPI_BUFSTS_RXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not empty - * @retval 1: Tx buffer is empty - * \hideinitializer - */ -#define USPI_GET_TX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXEMPTY_Msk) == USPI_BUFSTS_TXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer full flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not full - * @retval 1: Tx buffer is full - * \hideinitializer - */ -#define USPI_GET_TX_FULL_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXFULL_Msk) == USPI_BUFSTS_TXFULL_Msk ? 1:0 ) - -/** - * @brief Get the datum read from RX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return data in Rx register - * \hideinitializer - */ -#define USPI_READ_RX(uspi) ( (uspi)->RXDAT ) - -/** - * @brief Write datum to TX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through USCI_SPI bus. - * @return None - * \hideinitializer - */ -#define USPI_WRITE_TX(uspi, u32TxData) ( (uspi)->TXDAT = (u32TxData) ) - -/** - * @brief Set USCI_SPI_SS pin to high state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to high state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_HIGH(uspi) \ - do{ \ - (uspi)->LINECTL &= ~USPI_LINECTL_CTLOINV_Msk; \ - (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \ - }while(0) - -/** - * @brief Set USCI_SPI_SS pin to low state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to low state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_LOW(uspi) \ - do{ \ - (uspi)->LINECTL |= USPI_LINECTL_CTLOINV_Msk; \ - (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \ - }while(0) - -/** - * @brief Set the length of suspend interval. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SuspCycle Decide the length of suspend interval. - * @return None - * \hideinitializer - */ -#define USPI_SET_SUSPEND_CYCLE(uspi, u32SuspCycle) ( (uspi)->PROTCTL = ((uspi)->PROTCTL & ~USPI_PROTCTL_SUSPITV_Msk) | ((u32SuspCycle) << USPI_PROTCTL_SUSPITV_Pos) ) - -/** - * @brief Set the USCI_SPI transfer sequence with LSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_LSB_FIRST(uspi) ( (uspi)->LINECTL |= USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the USCI_SPI transfer sequence with MSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_MSB_FIRST(uspi) ( (uspi)->LINECTL &= ~USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the data width of a USCI_SPI transaction. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Width The data width - * @return None - * \hideinitializer - */ -#define USPI_SET_DATA_WIDTH(uspi, u32Width) \ - do{ \ - if((u32Width) == 16ul){ \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | (0 << USPI_LINECTL_DWIDTH_Pos); \ - }else { \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | ((u32Width) << USPI_LINECTL_DWIDTH_Pos); \ - } \ - }while(0) - -/** - * @brief Get the USCI_SPI busy state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return USCI_SPI busy status - * @retval 0: USCI_SPI module is not busy - * @retval 1: USCI_SPI module is busy - * \hideinitializer - */ -#define USPI_IS_BUSY(uspi) ( ((uspi)->PROTSTS & USPI_PROTSTS_BUSY_Msk) == USPI_PROTSTS_BUSY_Msk ? 1:0 ) - -/** - * @brief Get the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Wakeup status. - * @retval 0 Flag is not set. - * @retval 1 Flag is set. - * \hideinitializer - */ -#define USPI_GET_WAKEUP_FLAG(uspi) ( ((uspi)->WKSTS & USPI_WKSTS_WKF_Msk) == USPI_WKSTS_WKF_Msk ? 1:0 ) - -/** - * @brief Clear the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_CLR_WAKEUP_FLAG(uspi) ( (uspi)->WKSTS |= USPI_WKSTS_WKF_Msk ) - -/** - * @brief Get protocol interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of protocol status register. - * \hideinitializer - */ -#define USPI_GET_PROT_STATUS(uspi) ( (uspi)->PROTSTS ) - -/** - * @brief Clear specified protocol interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_PROTSTS_SSACTIF_Msk - * - \ref USPI_PROTSTS_SSINAIF_Msk - * - \ref USPI_PROTSTS_SLVBEIF_Msk - * - \ref USPI_PROTSTS_SLVTOIF_Msk - * - \ref USPI_PROTSTS_RXENDIF_Msk - * - \ref USPI_PROTSTS_RXSTIF_Msk - * - \ref USPI_PROTSTS_TXENDIF_Msk - * - \ref USPI_PROTSTS_TXSTIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_PROT_INT_FLAG(uspi, u32IntTypeFlag) ( (uspi)->PROTSTS = (u32IntTypeFlag) ) - -/** - * @brief Get buffer interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of buffer status register. - * \hideinitializer - */ -#define USPI_GET_BUF_STATUS(uspi) ( (uspi)->BUFSTS ) - -/** - * @brief Clear specified buffer interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_BUFSTS_TXUDRIF_Msk - * - \ref USPI_BUFSTS_RXOVIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_BUF_INT_FLAG(uspi, u32IntTypeFlag) ( (uspi)->BUFSTS = (u32IntTypeFlag) ) - -/** - * @brief Enable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_PROT_INT(uspi, u32IntSel) ( (uspi)->PROTIEN |= (u32IntSel) ) - -/** - * @brief Disable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_PROT_INT(uspi, u32IntSel) ( (uspi)->PROTIEN &= ~ (u32IntSel) ) - -/** - * @brief Enable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_BUF_INT(uspi, u32IntSel) ( (uspi)->BUFCTL |= (u32IntSel) ) - -/** - * @brief Disable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_BUF_INT(uspi, u32IntSel) ( (uspi)->BUFCTL &= ~ (u32IntSel) ) - -/** - * @brief Enable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_TRANS_INT(uspi, u32IntSel) ( (uspi)->INTEN |= (u32IntSel) ) - -/** - * @brief Disable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_TRANS_INT(uspi, u32IntSel) ( (uspi)->INTEN &= ~ (u32IntSel) ) - -/** - * @brief Trigger RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set RXPDMAEN bit of USPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_RX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_RXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Trigger TX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit of USPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_TX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_TX_RX_PDMA(uspi) ( (uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_RXPDMAEN_Msk | USPI_PDMACTL_PDMAEN_Msk ) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear RXPDMAEN bit of USPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit of USPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_TX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_TX_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~(USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_RXPDMAEN_Msk) ) - -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void USPI_Close(USPI_T *uspi); -void USPI_ClearRxBuf(USPI_T *uspi); -void USPI_ClearTxBuf(USPI_T *uspi); -void USPI_DisableAutoSS(USPI_T *uspi); -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock); -uint32_t USPI_GetBusClock(USPI_T *uspi); -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask); -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask); -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask); -void USPI_EnableWakeup(USPI_T *uspi); -void USPI_DisableWakeup(USPI_T *uspi); - - -/*@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_SPI_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_uart.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_uart.h deleted file mode 100644 index 101eb5f4f34..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_usci_uart.h +++ /dev/null @@ -1,519 +0,0 @@ -/**************************************************************************//** - * @file nu_usci_uart.h - * @version V3.00 - * @brief M460 series USCI UART (UUART) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_USCI_UART_H__ -#define __NU_USCI_UART_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_CONSTANTS USCI_UART Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_LINECTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_WORD_LEN_6 (6ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 6 bits \hideinitializer */ -#define UUART_WORD_LEN_7 (7ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 7 bits \hideinitializer */ -#define UUART_WORD_LEN_8 (8ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 8 bits \hideinitializer */ -#define UUART_WORD_LEN_9 (9ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 9 bits \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_PROTCTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_PARITY_NONE (0x0ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as no parity \hideinitializer */ -#define UUART_PARITY_ODD (0x1ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as odd parity \hideinitializer */ -#define UUART_PARITY_EVEN (0x3ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as even parity \hideinitializer */ - -#define UUART_STOP_BIT_1 (0x0ul) /*!< UUART_PROTCTL setting for one stop bit \hideinitializer */ -#define UUART_STOP_BIT_2 (0x1ul) /*!< UUART_PROTCTL setting for two stop bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI UART interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_ABR_INT_MASK (0x002ul) /*!< Auto-baud rate interrupt mask \hideinitializer */ -#define UUART_RLS_INT_MASK (0x004ul) /*!< Receive line status interrupt mask \hideinitializer */ -#define UUART_BUF_RXOV_INT_MASK (0x008ul) /*!< Buffer RX overrun interrupt mask \hideinitializer */ -#define UUART_TXST_INT_MASK (0x010ul) /*!< TX start interrupt mask \hideinitializer */ -#define UUART_TXEND_INT_MASK (0x020ul) /*!< Tx end interrupt mask \hideinitializer */ -#define UUART_RXST_INT_MASK (0x040ul) /*!< RX start interrupt mask \hideinitializer */ -#define UUART_RXEND_INT_MASK (0x080ul) /*!< RX end interrupt mask \hideinitializer */ - - -/*@}*/ /* end of group USCI_UART_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UUART_WRITE(uuart, u8Data) ((uuart)->TXDAT = (u8Data)) - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The oldest data byte in RX buffer. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UUART_READ(uuart) ((uuart)->RXDAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not empty - * @retval >=1 Tx buffer is empty - * - * @details This macro get Transmitter buffer empty register value. - * \hideinitializer - */ -#define UUART_GET_TX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not empty - * @retval >=1 Rx buffer is empty - * - * @details This macro get Receiver buffer empty register value. - * \hideinitializer - */ -#define UUART_GET_RX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified usci_uart port transmission is over. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. \n - * It indicates if specified usci_uart port transmission is over nor not. - * \hideinitializer - */ -#define UUART_IS_TX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos) - - -/** - * @brief Check specified usci_uart port receiver is empty. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx receiver is not empty - * @retval 1 Rx receiver is empty - * - * @details This macro return Receive Empty Flag register bit value. \n - * It indicates if specified usci_uart port receiver is empty nor not. - * \hideinitializer - */ -#define UUART_IS_RX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) >> UUART_BUFSTS_RXEMPTY_Pos) - - -/** - * @brief Wait specified usci_uart port transmission is over - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro wait specified usci_uart port transmission is over. - * \hideinitializer - */ -#define UUART_WAIT_TX_EMPTY(uuart) while(!((((uuart)->BUFSTS) & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos)) - - -/** - * @brief Check TX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 TX buffer is full - * @retval 0 TX buffer is not full - * - * @details This macro check TX buffer is full or not. - * \hideinitializer - */ -#define UUART_IS_TX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk)>>UUART_BUFSTS_TXFULL_Pos) - - -/** - * @brief Check RX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 RX buffer is full - * @retval 0 RX buffer is not full - * - * @details This macro check RX buffer is full or not. - * \hideinitializer - */ -#define UUART_IS_RX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk)>>UUART_BUFSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not full. - * @retval >=1 Tx buffer is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UUART_GET_TX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not full. - * @retval >=1 Rx buffer is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UUART_GET_RX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk) - - -/** - * @brief Enable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART protocol interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART protocol interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN &= ~(u32IntSel)) - - -/** - * @brief Enable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART buffer interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART buffer interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL &= ~ (u32IntSel)) - - -/** - * @brief Enable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART transfer interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART transfer interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN &= ~(u32IntSel)) - - -/** - * @brief Get protocol interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of protocol status register. - * - * @details This macro get protocol status register value. - * \hideinitializer - */ -#define UUART_GET_PROT_STATUS(uuart) ((uuart)->PROTSTS) - - -/** - * @brief Clear specified protocol interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_PROTSTS_ABERRSTS_Msk : Auto-baud Rate Error Interrupt Indicator - * - \ref UUART_PROTSTS_ABRDETIF_Msk : Auto-baud Rate Detected Interrupt Flag - * - \ref UUART_PROTSTS_BREAK_Msk : Break Flag - * - \ref UUART_PROTSTS_FRMERR_Msk : Framing Error Flag - * - \ref UUART_PROTSTS_PARITYERR_Msk : Parity Error Flag - * - \ref UUART_PROTSTS_RXENDIF_Msk : Receive End Interrupt Flag - * - \ref UUART_PROTSTS_RXSTIF_Msk : Receive Start Interrupt Flag - * - \ref UUART_PROTSTS_TXENDIF_Msk : Transmit End Interrupt Flag - * - \ref UUART_PROTSTS_TXSTIF_Msk : Transmit Start Interrupt Flag - * - * @return None - * - * @details This macro clear specified protocol interrupt flag. - * \hideinitializer - */ -#define UUART_CLR_PROT_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->PROTSTS = (u32IntTypeFlag)) - - -/** - * @brief Get transmit/receive buffer interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of buffer status register. - * - * @details This macro get buffer status register value. - * \hideinitializer - */ -#define UUART_GET_BUF_STATUS(uuart) ((uuart)->BUFSTS) - - -/** - * @brief Clear specified buffer interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_BUFSTS_RXOVIF_Msk : Receive Buffer Over-run Error Interrupt Indicator - * - * @return None - * - * @details This macro clear specified buffer interrupt flag. - * \hideinitializer - */ -#define UUART_CLR_BUF_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->BUFSTS = (u32IntTypeFlag)) - - -/** - * @brief Get wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Chip did not wake up from power-down mode. - * @retval 1 Chip waked up from power-down mode. - * - * @details This macro get wakeup flag. - * \hideinitializer - */ -#define UUART_GET_WAKEUP_FLAG(uuart) ((uuart)->WKSTS & UUART_WKSTS_WKF_Msk ? 1: 0 ) - - -/** - * @brief Clear wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro clear wakeup flag. - * \hideinitializer - */ -#define UUART_CLR_WAKEUP_FLAG(uuart) ((uuart)->WKSTS = UUART_WKSTS_WKF_Msk) - -/** - * @brief Trigger RX PDMA function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Set RXPDMAEN bit of UUART_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define UUART_TRIGGER_RX_PDMA(uuart) ((uuart)->PDMACTL |= UUART_PDMACTL_RXPDMAEN_Msk|UUART_PDMACTL_PDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Set TXPDMAEN bit of UUART_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define UUART_TRIGGER_TX_PDMA(uuart) ((uuart)->PDMACTL |= UUART_PDMACTL_TXPDMAEN_Msk|UUART_PDMACTL_PDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Clear RXPDMAEN bit of UUART_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define UUART_DISABLE_RX_PDMA(uuart) ( (uuart)->PDMACTL &= ~UUART_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Clear TXPDMAEN bit of UUART_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define UUART_DISABLE_TX_PDMA(uuart) ( (uuart)->PDMACTL &= ~UUART_PDMACTL_TXPDMAEN_Msk ) - - -/** - * @brief Enable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * @details This macro enable specified USCI_UART PDMA function. - * \hideinitializer - */ -#define UUART_PDMA_ENABLE(uuart, u32FuncSel) ((uuart)->PDMACTL |= (u32FuncSel)) - -/** - * @brief Disable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UUART_PDMA_DISABLE(uuart, u32FuncSel) ((uuart)->PDMACTL &= ~(u32FuncSel)) - - - - -void UUART_ClearIntFlag(UUART_T *uuart, uint32_t u32Mask); -uint32_t UUART_GetIntFlag(UUART_T *uuart, uint32_t u32Mask); -void UUART_Close(UUART_T *uuart); -void UUART_DisableInt(UUART_T *uuart, uint32_t u32Mask); -void UUART_EnableInt(UUART_T *uuart, uint32_t u32Mask); -uint32_t UUART_Open(UUART_T *uuart, uint32_t u32baudrate); -uint32_t UUART_Read(UUART_T *uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t UUART_SetLine_Config(UUART_T *uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -uint32_t UUART_Write(UUART_T *uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); -void UUART_EnableWakeup(UUART_T *uuart, uint32_t u32WakeupMode); -void UUART_DisableWakeup(UUART_T *uuart); -void UUART_EnableFlowCtrl(UUART_T *uuart); -void UUART_DisableFlowCtrl(UUART_T *uuart); - - -/*@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_UART_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wdt.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wdt.h deleted file mode 100644 index ded1b33e8fb..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wdt.h +++ /dev/null @@ -1,236 +0,0 @@ -/**************************************************************************//** - * @file nu_wdt.h - * @version V3.00 - * @brief Watchdog Timer(WDT) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WDT_H__ -#define __NU_WDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_CONSTANTS WDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Time-out Interval Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_TIMEOUT_2POW4 (0UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^4 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW6 (1UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^6 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW8 (2UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^8 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW10 (3UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^10 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW12 (4UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^12 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW14 (5UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^14 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW16 (6UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^16 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW18 (7UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^18 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW20 (8UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^20 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Reset Delay Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_DELAY_1026CLK (0UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 1026 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_130CLK (1UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 130 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_18CLK (2UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 18 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_3CLK (3UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 3 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Free Reset Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_COUNTER_KEYWORD (0x00005AA5UL) /*!< Fill this value to WDT_RSTCNT register to free reset WDT counter \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Time-out Handler Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_TIMEOUT SystemCoreClock /*!< 1 second time-out \hideinitializer */ -#define WDT_TIMEOUT_ERR (-1L) /*!< WDT operation abort due to timeout error \hideinitializer */ - -/**@}*/ /* end of group WDT_EXPORTED_CONSTANTS */ - -extern int32_t g_WDT_i32ErrCode; - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Clear WDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out reset system flag. - * \hideinitializer - */ -#define WDT_CLEAR_RESET_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_RSTF_Msk) - -/** - * @brief Clear WDT Time-out Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out interrupt flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_INT_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_IF_Msk) - -/** - * @brief Clear WDT Wake-up Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out wake-up system flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk)) | WDT_CTL_WKF_Msk) - -/** - * @brief Get WDT Time-out Reset Flag - * - * @param None - * - * @retval 0 WDT time-out reset system did not occur - * @retval 1 WDT time-out reset system occurred - * - * @details This macro indicates system has been reset by WDT time-out reset or not. - * \hideinitializer - */ -#define WDT_GET_RESET_FLAG() ((WDT->CTL & WDT_CTL_RSTF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Interrupt Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt did not occur - * @retval 1 WDT time-out interrupt occurred - * - * @details This macro indicates WDT time-out interrupt occurred or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_INT_FLAG() ((WDT->CTL & WDT_CTL_IF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Wake-up Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt does not cause CPU wake-up - * @retval 1 WDT time-out interrupt event cause CPU wake-up - * - * @details This macro indicates WDT time-out interrupt event has waked up system or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_WAKEUP_FLAG() ((WDT->CTL & WDT_CTL_WKF_Msk)? 1UL : 0UL) - -/** - * @brief Reset WDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reset the internal 20-bit WDT up counter value. - * @note If WDT is activated and time-out reset system function is enabled also, user should \n - * reset the 20-bit WDT up counter value to avoid generate WDT time-out reset signal to \n - * reset system before the WDT time-out reset delay period expires. - * \hideinitializer - */ -#define WDT_RESET_COUNTER() (WDT->RSTCNT = WDT_RESET_COUNTER_KEYWORD) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void WDT_Close(void); -__STATIC_INLINE void WDT_EnableInt(void); -__STATIC_INLINE void WDT_DisableInt(void); - -/** - * @brief Stop WDT Counting - * - * @param None - * - * @return None - * - * @details This function will stop WDT counting and disable WDT module. - * - * @note This function sets g_WDT_i32ErrCode to WDT_TIMEOUT_ERR if waiting WDT time-out. - */ -__STATIC_INLINE void WDT_Close(void) -{ - uint32_t u32TimeOutCount = WDT_TIMEOUT; - - g_WDT_i32ErrCode = 0; - WDT->CTL = 0UL; - while (WDT->CTL & WDT_CTL_SYNC_Msk) /* Wait disable WDTEN bit completed, it needs 2 * WDT_CLK. */ - { - if (--u32TimeOutCount == 0) - { - g_WDT_i32ErrCode = WDT_TIMEOUT_ERR; /* Time-out error */ - break; - } - } -} - -/** - * @brief Enable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will enable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_EnableInt(void) -{ - WDT->CTL |= WDT_CTL_INTEN_Msk; -} - -/** - * @brief Disable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will disable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_DisableInt(void) -{ - /* Do not touch another write 1 clear bits */ - WDT->CTL &= ~(WDT_CTL_INTEN_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk); -} - -void WDT_Open(uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup); - -/**@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WDT_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wwdt.h b/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wwdt.h deleted file mode 100644 index ef7a49d67ff..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/inc/nu_wwdt.h +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************//** - * @file nu_wwdt.h - * @version V3.00 - * @brief Window Watchdog Timer(WWDT) driver header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WWDT_H__ -#define __NU_WWDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_CONSTANTS WWDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Prescale Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_PRESCALER_1 (0 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2 (1 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_4 (2 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 4 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_8 (3 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 8 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_16 (4 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 16 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_32 (5 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 32 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_64 (6 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 64 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_128 (7 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 128 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_192 (8 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 192 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_256 (9 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 256 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_384 (10 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 384 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_512 (11 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 512 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_768 (12 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 768 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1024 (13 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1024 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1536 (14 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1536 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2048 (15 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2048 * (64*WWDT_CLK) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Reload Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_RELOAD_WORD (0x00005AA5) /*!< Fill this value to WWDT_RLDCNT register to reload WWDT counter \hideinitializer */ - -/**@}*/ /* end of group WWDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Clear WWDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT time-out reset system flag. - * \hideinitializer - */ -#define WWDT_CLEAR_RESET_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTRF_Msk) - -/** - * @brief Clear WWDT Compared Match Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT compared match interrupt flag. - * \hideinitializer - */ -#define WWDT_CLEAR_INT_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTIF_Msk) - -/** - * @brief Get WWDT Reset System Flag - * - * @param None - * - * @retval 0 WWDT time-out reset system did not occur - * @retval 1 WWDT time-out reset system occurred - * - * @details This macro is used to indicate system has been reset by WWDT time-out reset or not. - * \hideinitializer - */ -#define WWDT_GET_RESET_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTRF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Compared Match Interrupt Flag - * - * @param None - * - * @retval 0 WWDT compare match interrupt did not occur - * @retval 1 WWDT compare match interrupt occurred - * - * @details This macro is used to indicate WWDT counter value matches CMPDAT value or not. - * \hideinitializer - */ -#define WWDT_GET_INT_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTIF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Counter - * - * @param None - * - * @return WWDT Counter Value - * - * @details This macro reflects the current WWDT counter value. - * \hideinitializer - */ -#define WWDT_GET_COUNTER() (WWDT->CNT) - -/** - * @brief Reload WWDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reload the WWDT counter value to 0x3F. - * @note User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value \n - * between 0 and CMPDAT value. If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, \n - * WWDT reset signal will generate immediately to reset system. - * \hideinitializer - */ -#define WWDT_RELOAD_COUNTER() (WWDT->RLDCNT = WWDT_RELOAD_WORD) - -void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt); - -/**@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WWDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WWDT_H__ */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/lib/libStdDriver.uvprojx b/bsp/nuvoton/libraries/m460/StdDriver/lib/libStdDriver.uvprojx deleted file mode 100644 index c6803fd3d07..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/lib/libStdDriver.uvprojx +++ /dev/null @@ -1,608 +0,0 @@ - - - - 2.1 - -
### uVision Project, (C) Keil Software
- - - - libstddriver-m460 - 0x4 - ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC - 5060750::V5.06 update 6 (build 750)::ARMCC - 0 - - - M467HJHAE - Nuvoton - Nuvoton.NuMicro_DFP.1.3.13 - https://github.com/OpenNuvoton/cmsis-packs/raw/master/ - IRAM(0x20000000,0x80000) IROM(0x00000000,0x100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) - - - UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M460_AP_1M -FS00 -FL0100000 -FP0($$Device:M467HJHAE$Flash\M460_AP_1M.FLM)) - 0 - $$Device:M467HJHAE$Device\M460\Include\m460.h - - - - - - - - - - $$Device:M467HJHAE$SVD\Nuvoton\M460.svd - 0 - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - .\build\keil5\ - libstddriver_keil - 0 - 1 - 1 - 1 - 1 - .\build\keil5\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 1 - 0 - xcopy /y ".\build\keil5\@L.lib" "." - - 0 - 0 - 0 - 0 - - 1 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - 1 - - - SARMCM3.DLL - - DCM.DLL - -pCM4 - SARMCM3.DLL - - TCM.DLL - -pCM4 - - - - 1 - 0 - 0 - 0 - 16 - - - - - 1 - 0 - 0 - 1 - 1 - 4100 - - 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 - 2 - 0 - 0 - 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 - 0x20000000 - 0x80000 - - - 1 - 0x0 - 0x100000 - - - 0 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x100000 - - - 1 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x20000000 - 0x80000 - - - 0 - 0x0 - 0x0 - - - - - - 1 - 3 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 2 - 0 - 0 - 0 - 0 - 0 - 5 - 3 - 0 - 0 - 0 - 1 - 0 - - - - - ..\inc;..\..\CMSIS\Include;..\..\Device\Nuvoton\m460\Include;. - - - - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - 0 - 1 - 0 - 0x00000000 - 0x20000000 - - .\linking_scripts\m2354_flash.sct - - - --map --first='startup_M2354.o(RESET)' --datacompressor=off --info=inline --entry Reset_Handler - - - - - - - - src - - - nu_acmp.c - 1 - ..\src\nu_acmp.c - - - nu_bmc.c - 1 - ..\src\nu_bmc.c - - - nu_bpwm.c - 1 - ..\src\nu_bpwm.c - - - nu_canfd.c - 1 - ..\src\nu_canfd.c - - - nu_ccap.c - 1 - ..\src\nu_ccap.c - - - nu_clk.c - 1 - ..\src\nu_clk.c - - - nu_crc.c - 1 - ..\src\nu_crc.c - - - nu_crypto.c - 1 - ..\src\nu_crypto.c - - - nu_dac.c - 1 - ..\src\nu_dac.c - - - nu_eadc.c - 1 - ..\src\nu_eadc.c - - - nu_ebi.c - 1 - ..\src\nu_ebi.c - - - nu_ecap.c - 1 - ..\src\nu_ecap.c - - - nu_epwm.c - 1 - ..\src\nu_epwm.c - - - nu_eqei.c - 1 - ..\src\nu_eqei.c - - - nu_fmc.c - 1 - ..\src\nu_fmc.c - - - nu_gpio.c - 1 - ..\src\nu_gpio.c - - - nu_hbi.c - 1 - ..\src\nu_hbi.c - - - nu_hsusbd.c - 1 - ..\src\nu_hsusbd.c - - - nu_i2c.c - 1 - ..\src\nu_i2c.c - - - nu_i2s.c - 1 - ..\src\nu_i2s.c - - - nu_keystore.c - 1 - ..\src\nu_keystore.c - - - nu_kpi.c - 1 - ..\src\nu_kpi.c - - - nu_pdma.c - 1 - ..\src\nu_pdma.c - - - nu_qspi.c - 1 - ..\src\nu_qspi.c - - - nu_rng.c - 1 - ..\src\nu_rng.c - - - nu_rtc.c - 1 - ..\src\nu_rtc.c - - - nu_sc.c - 1 - ..\src\nu_sc.c - - - nu_scuart.c - 1 - ..\src\nu_scuart.c - - - nu_sdh.c - 1 - ..\src\nu_sdh.c - - - nu_spi.c - 1 - ..\src\nu_spi.c - - - nu_spim.c - 1 - ..\src\nu_spim.c - - - nu_sys.c - 1 - ..\src\nu_sys.c - - - nu_timer.c - 1 - ..\src\nu_timer.c - - - nu_timer_pwm.c - 1 - ..\src\nu_timer_pwm.c - - - nu_trng.c - 1 - ..\src\nu_trng.c - - - nu_uart.c - 1 - ..\src\nu_uart.c - - - nu_usbd.c - 1 - ..\src\nu_usbd.c - - - nu_usci_i2c.c - 1 - ..\src\nu_usci_i2c.c - - - nu_usci_spi.c - 1 - ..\src\nu_usci_spi.c - - - nu_usci_uart.c - 1 - ..\src\nu_usci_uart.c - - - nu_wdt.c - 1 - ..\src\nu_wdt.c - - - nu_wwdt.c - 1 - ..\src\nu_wwdt.c - - - - - - - - - - - - - -
diff --git a/bsp/nuvoton/libraries/m460/StdDriver/lib/nutool_clkcfg.h b/bsp/nuvoton/libraries/m460/StdDriver/lib/nutool_clkcfg.h deleted file mode 100644 index 950b09946e2..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/lib/nutool_clkcfg.h +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************************** - * @file nutool_clkcfg.h - * @version V1.05 - * @Date 2020/04/15-11:28:38 - * @brief NuMicro generated code file - * - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2013-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NUTOOL_CLKCFG_H__ -#define __NUTOOL_CLKCFG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif -#undef __HXT -#define __HXT (12000000UL) /*!< High Speed External Crystal Clock Frequency */ - -#ifdef __cplusplus -} -#endif -#endif /*__NUTOOL_CLKCFG_H__*/ - -/*** (C) COPYRIGHT 2013-2020 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_acmp.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_acmp.c deleted file mode 100644 index e13729e8a91..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_acmp.c +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************//** - * @file acmp.c - * @version V1.00 - * @brief M480 series Analog Comparator(ACMP) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - - -/** - * @brief Configure the specified ACMP module - * - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * @param[in] u32NegSrc Comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * - \ref ACMP_CTL_NEGSEL_DAC - * @param[in] u32HysSel The hysteresis function option. Including: - * - \ref ACMP_CTL_HYSTERESIS_30MV - * - \ref ACMP_CTL_HYSTERESIS_20MV - * - \ref ACMP_CTL_HYSTERESIS_10MV - * - \ref ACMP_CTL_HYSTERESIS_DISABLE - * - * @return None - * - * @details Configure hysteresis function, select the source of negative input and enable analog comparator. - */ -void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel) -{ - volatile int32_t delay; - - acmp->CTL[u32ChNum] = (acmp->CTL[u32ChNum] & (~(ACMP_CTL_NEGSEL_Msk | ACMP_CTL_HYSSEL_Msk | ACMP_CTL_MODESEL_Msk))) | (2 << ACMP_CTL_MODESEL_Pos) | (u32NegSrc | u32HysSel | ACMP_CTL_ACMPEN_Msk); - - /* - ACMP stable time is 1us for MODESEL = 2'b10 or 2'b11. - ACMP stable time is 20us for MODESEL = 2'b00 or 2'b01. - - By default, it is set MODESEL = 2'b10 here - */ - for (delay = 25; delay > 0; delay--) {} // Delay about 1.2us @ CPU = 192MHz -} - -/** - * @brief Close analog comparator - * - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * - * @return None - * - * @details This function will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - */ -void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum) -{ - acmp->CTL[u32ChNum] &= (~ACMP_CTL_ACMPEN_Msk); -} - - - -/*@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ACMP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_bmc.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_bmc.c deleted file mode 100644 index 1a9a38a234c..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_bmc.c +++ /dev/null @@ -1,352 +0,0 @@ -/**************************************************************************//** - * @file bmc.c - * @version V3.00 - * @brief M460 series BMC driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BMC_Driver BMC Driver - @{ -*/ - - -/** @addtogroup BMC_EXPORTED_FUNCTIONS BMC Exported Functions - @{ -*/ - -/** - * @brief Set the BMC bit clock - * @param[in] u32BitClock The expected frequency of BMC bit clock in Hz - * @return Actual frequency of BMC bit clock - * @details The actual clock rate may be different from the target BMC bit clock rate. - * For example, if the system clock rate is 200 MHz and the target BMC bit clock rate is 3 MHz, the actual BMC bit clock - * rate will be 2 MHz. - * \hideinitializer - */ -uint32_t BMC_SetBitClock(uint32_t u32BitClock) -{ - uint32_t u32HCLKFreq, u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - u32Div = ((u32HCLKFreq * 10UL) / u32BitClock + 5UL) / 10UL; /* Round to the nearest integer */ - - BMC->CTL = (BMC->CTL & (~BMC_CTL_BTDIV_Msk)) | (u32Div << BMC_CTL_BTDIV_Pos); - - /* Return BMC bit clock rate */ - u32RetValue = u32HCLKFreq / u32Div; - - return u32RetValue; -} - -/** - * @brief Get the actual frequency of BMC bit clock - * @return Actual BMC bit frequency in Hz - * @details This API will calculate the actual BMC bit clock rate according to the HBTDIV setting. - * \hideinitializer - */ -uint32_t BMC_GetBitClock(void) -{ - uint32_t u32HCLKFreq, u32Div; - - /* Get BTDIV setting */ - u32Div = (BMC->CTL & BMC_CTL_BTDIV_Msk) >> BMC_CTL_BTDIV_Pos; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - /* Return BMC bit clock rate */ - return (u32HCLKFreq / u32Div); -} - -/** - * @brief Set the dummy delay time period of each group - * @param[in] u32ChGroup BMC channel group selection, valid values are: - * - \ref BMC_GROUP_0 - * - \ref BMC_GROUP_1 - * - \ref BMC_GROUP_2 - * - \ref BMC_GROUP_3 - * - \ref BMC_GROUP_4 - * - \ref BMC_GROUP_5 - * - \ref BMC_GROUP_6 - * - \ref BMC_GROUP_7 - * @param[in] u32DumDelay The expected BMC dummy delay period in microsecond - * @return Actual dummy delay time period in microsecond - * @details This API is used to set each group dummy delay time period. - * \hideinitializer - */ -uint32_t BMC_SetDummyDelayPeriod(uint32_t u32ChGroup, uint32_t u32DumDelay) -{ - uint32_t i, u32BitNum; - - u32BitNum = ((BMC_GetBitClock() * u32DumDelay) / 1000000UL) / 8UL; - - for (i = 0UL; i < (uint32_t)BMC_CHANNEL_NUM; i += 4UL) - { - if ((u32ChGroup == i) && (u32ChGroup <= BMC_GROUP_3)) - { - outp8((uint32_t) & (BMC->DNUM0) + (i >> 2UL), u32BitNum); - break; - } - else if ((u32ChGroup == i) && (u32ChGroup > BMC_GROUP_3)) - { - outp8((uint32_t) & (BMC->DNUM1) + ((i >> 2UL) - 4UL), u32BitNum); - break; - } - } - - /* Return BMC dummy delay time period */ - return (8UL * 1000000UL / BMC_GetBitClock() * u32BitNum); -} - -/** - * @brief Enable interrupt function - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref BMC_FTXD_INT_MASK - * - \ref BMC_TXUND_INT_MASK - * @return None - * @details This API is used to enable BMC related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -void BMC_EnableInt(uint32_t u32Mask) -{ - /* Enable frame transmit done interrupt flag */ - if ((u32Mask & BMC_FTXD_INT_MASK) == BMC_FTXD_INT_MASK) - { - BMC->INTEN |= BMC_INTEN_FTXDIEN_Msk; - } - - /* Enable transmit data under run interrupt flag */ - if ((u32Mask & BMC_TXUND_INT_MASK) == BMC_TXUND_INT_MASK) - { - BMC->INTEN |= BMC_INTEN_TXUNDIEN_Msk; - } -} - -/** - * @brief Disable interrupt function - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref BMC_FTXD_INT_MASK - * - \ref BMC_TXUND_INT_MASK - * @return None - * @details This API is used to disable BMC related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -void BMC_DisableInt(uint32_t u32Mask) -{ - /* Disable frame transmit done interrupt flag */ - if ((u32Mask & BMC_FTXD_INT_MASK) == BMC_FTXD_INT_MASK) - { - BMC->INTEN &= ~BMC_INTEN_FTXDIEN_Msk; - } - - /* Disable transmit data under run interrupt flag */ - if ((u32Mask & BMC_TXUND_INT_MASK) == BMC_TXUND_INT_MASK) - { - BMC->INTEN &= ~BMC_INTEN_TXUNDIEN_Msk; - } -} - -/** - * @brief Get interrupt flag - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref BMC_FTXD_INT_MASK - * - \ref BMC_TXUND_INT_MASK - * @return Interrupt flags of selected sources - * @details This API is used to get BMC related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -uint32_t BMC_GetIntFlag(uint32_t u32Mask) -{ - uint32_t u32IntStatus; - uint32_t u32IntFlag = 0UL; - - u32IntStatus = BMC->INTSTS; - - /* Check frame transmit done interrupt flag */ - if ((u32Mask & BMC_FTXD_INT_MASK) && (u32IntStatus & BMC_INTSTS_FTXDIF_Msk)) - { - u32IntFlag |= BMC_FTXD_INT_MASK; - } - - /* Check transmit data under run interrupt flag */ - if ((u32Mask & BMC_TXUND_INT_MASK) && (u32IntStatus & BMC_INTSTS_TXUNDIF_Msk)) - { - u32IntFlag |= BMC_TXUND_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag - * @param[in] u32Mask The related interrupt source. - * This parameter decides which interrupt flag will be cleared. Possible option is: - * - \ref BMC_FTXD_INT_MASK - * @return None - * @details This API is used to clear BMC related interrupt flag specified by u32Mask parameter. - * \hideinitializer - */ -void BMC_ClearIntFlag(uint32_t u32Mask) -{ - if (u32Mask & BMC_FTXD_INT_MASK) - { - BMC->INTSTS = BMC_INTSTS_FTXDIF_Msk; /* Clear frame transmit done interrupt flag */ - } -} - -/** - * @brief Get BMC status - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a related source. - * This parameter decides which flags will be read. It is combination of: - * - \ref BMC_G0TXUND_MASK - * - \ref BMC_G1TXUND_MASK - * - \ref BMC_G2TXUND_MASK - * - \ref BMC_G3TXUND_MASK - * - \ref BMC_G4TXUND_MASK - * - \ref BMC_G5TXUND_MASK - * - \ref BMC_G6TXUND_MASK - * - \ref BMC_G7TXUND_MASK - * @return Flags of selected sources - * @details This API is used to get BMC related status specified by u32Mask parameter. - * \hideinitializer - */ -uint32_t BMC_GetStatus(uint32_t u32Mask) -{ - uint32_t u32TmpStatus; - uint32_t u32Flag = 0UL; - - u32TmpStatus = BMC->INTSTS; - - /* Check group 0 transmit data under run status */ - if ((u32Mask & BMC_G0TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G0TXUND_Msk)) - { - u32Flag |= BMC_G0TXUND_MASK; - } - - /* Check group 1 transmit data under run status */ - if ((u32Mask & BMC_G1TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G1TXUND_Msk)) - { - u32Flag |= BMC_G1TXUND_MASK; - } - - /* Check group 2 transmit data under run status */ - if ((u32Mask & BMC_G2TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G2TXUND_Msk)) - { - u32Flag |= BMC_G2TXUND_MASK; - } - - /* Check group 3 transmit data under run status */ - if ((u32Mask & BMC_G3TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G3TXUND_Msk)) - { - u32Flag |= BMC_G3TXUND_MASK; - } - - /* Check group 4 transmit data under run status */ - if ((u32Mask & BMC_G4TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G4TXUND_Msk)) - { - u32Flag |= BMC_G4TXUND_MASK; - } - - /* Check group 5 transmit data under run status */ - if ((u32Mask & BMC_G5TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G5TXUND_Msk)) - { - u32Flag |= BMC_G5TXUND_MASK; - } - - /* Check group 6 transmit data under run status */ - if ((u32Mask & BMC_G6TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G6TXUND_Msk)) - { - u32Flag |= BMC_G6TXUND_MASK; - } - - /* Check group 7 transmit data under run status */ - if ((u32Mask & BMC_G7TXUND_MASK) && (u32TmpStatus & BMC_INTSTS_G7TXUND_Msk)) - { - u32Flag |= BMC_G7TXUND_MASK; - } - - return u32Flag; -} - -/** - * @brief Clear BMC status - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a related source. - * This parameter decides which flags will be cleared. It is combination of: - * - \ref BMC_G0TXUND_MASK - * - \ref BMC_G1TXUND_MASK - * - \ref BMC_G2TXUND_MASK - * - \ref BMC_G3TXUND_MASK - * - \ref BMC_G4TXUND_MASK - * - \ref BMC_G5TXUND_MASK - * - \ref BMC_G6TXUND_MASK - * - \ref BMC_G7TXUND_MASK - * @return None - * @details This API is used to clear BMC related status specified by u32Mask parameter. - * \hideinitializer - */ -void BMC_ClearStatus(uint32_t u32Mask) -{ - if (u32Mask & BMC_G0TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G0TXUND_Msk; /* Check group 0 transmit data under run status */ - } - - if (u32Mask & BMC_G1TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G1TXUND_Msk; /* Check group 1 transmit data under run status */ - } - - if (u32Mask & BMC_G2TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G2TXUND_Msk; /* Check group 2 transmit data under run status */ - } - - if (u32Mask & BMC_G3TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G3TXUND_Msk; /* Check group 3 transmit data under run status */ - } - - if (u32Mask & BMC_G4TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G4TXUND_Msk; /* Check group 4 transmit data under run status */ - } - - if (u32Mask & BMC_G5TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G5TXUND_Msk; /* Check group 5 transmit data under run status */ - } - - if (u32Mask & BMC_G6TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G6TXUND_Msk; /* Check group 6 transmit data under run status */ - } - - if (u32Mask & BMC_G7TXUND_MASK) - { - BMC->INTSTS = BMC_INTSTS_G7TXUND_Msk; /* Check group 7 transmit data under run status */ - } -} - - -/*@}*/ /* end of group BMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_bpwm.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_bpwm.c deleted file mode 100644 index 48c23cb8ea1..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_bpwm.c +++ /dev/null @@ -1,758 +0,0 @@ -/**************************************************************************//** - * @file bpwm.c - * @version V1.00 - * @brief BPWM driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - - -/** @addtogroup BPWM_EXPORTED_FUNCTIONS BPWM Exported Functions - @{ -*/ - -/** - * @brief Configure BPWM capture and get the nearest unit time. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure BPWM capture and get the nearest unit time. - */ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32Src; - uint32_t u32PWMClockSrc; - uint32_t u32NearestUnitTimeNsec = 0U; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - (void)u32ChannelNum; - (void)u32CaptureEdge; - - if (bpwm == BPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk; - } - else /* (bpwm == BPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk; - } - - if (u32Src == 0U) - { - /* clock source is from PLL clock */ - u32PWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if (bpwm == BPWM0) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (bpwm == BPWM1) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - u32PWMClockSrc /= 1000UL; - for (u32Prescale = 1U; u32Prescale <= 0x1000UL; u32Prescale++) - { - uint32_t u32Exit = 0U; - u32NearestUnitTimeNsec = (1000000UL * u32Prescale) / u32PWMClockSrc; - if (u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if (u32Prescale == 0x1000U) /* limit to the maximum unit time(nano second) */ - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - if (!(1000000UL * (u32Prescale + 1UL) > (u32NearestUnitTimeNsec * u32PWMClockSrc))) - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - } - else - { - u32Exit = 1U; - } - if (u32Exit == 1U) - { - break; - } - } - - /* convert to real register value */ - /* all channels share a prescaler */ - u32Prescale -= 1U; - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); - - /* set BPWM to down count type(edge aligned) */ - (bpwm)->CTL1 = (1UL); - - BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure BPWM generator and get the nearest frequency in edge aligned(up counter type) auto-reload mode - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since all channels shares a prescaler. Call this API to configure BPWM frequency may affect - * existing frequency of other channel. - * @note This function is used for initial stage. - * To change duty cycle later, it should get the configured period value and calculate the new comparator value. - */ -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32Src; - uint32_t u32PWMClockSrc; - uint32_t i; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - if (bpwm == BPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk; - } - else /* (bpwm == BPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk; - } - - if (u32Src == 0U) - { - /* clock source is from PLL clock */ - u32PWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if (bpwm == BPWM0) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (bpwm == BPWM1) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - for (u32Prescale = 1U; u32Prescale < 0xFFFU; u32Prescale++) /* prescale could be 0~0xFFF */ - { - i = (u32PWMClockSrc / u32Frequency) / u32Prescale; - /* If target value is larger than CNR, need to use a larger prescaler */ - if (i <= (0x10000U)) - { - u32CNR = i; - break; - } - } - /* Store return value here 'cos we're gonna change u32Prescale & u32CNR to the real value to fill into register */ - i = u32PWMClockSrc / (u32Prescale * u32CNR); - - /* convert to real register value */ - /* all channels share a prescaler */ - u32Prescale -= 1U; - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); - /* set BPWM to up counter type(edge aligned) */ - (bpwm)->CTL1 = BPWM_UP_COUNTER; - - u32CNR -= 1U; - BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); - BPWM_SET_CMR(bpwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1UL) / 100UL); - - - (bpwm)->WGCTL0 = ((bpwm)->WGCTL0 & ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1))) | \ - (BPWM_OUTPUT_HIGH << (u32ChannelNum << 1UL << BPWM_WGCTL0_ZPCTL0_Pos)); - (bpwm)->WGCTL1 = ((bpwm)->WGCTL1 & ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1))) | \ - (BPWM_OUTPUT_LOW << (u32ChannelNum << 1UL << BPWM_WGCTL1_CMPUCTL0_Pos)); - - return (i); -} - -/** - * @brief Start BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to start BPWM module. - * @note All channels share one counter. - */ -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (void)u32ChannelMask; - (bpwm)->CNTEN = BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Stop BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM module. - * @note All channels share one period. - */ -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (void)u32ChannelMask; - (bpwm)->PERIOD = 0UL; -} - -/** - * @brief Stop BPWM generation immediately by clear channel enable bit - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM generation immediately by clear channel enable bit. - * @note All channels share one counter. - */ -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (void)u32ChannelMask; - (bpwm)->CNTEN &= ~BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_OR_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_DOWN_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable selected channel to trigger ADC - */ -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if (u32ChannelNum < 4UL) - { - (bpwm)->EADCTS0 &= ~((BPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3)); - (bpwm)->EADCTS0 |= ((BPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3)); - } - else - { - (bpwm)->EADCTS1 &= ~((BPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4UL) << 3)); - (bpwm)->EADCTS1 |= ((BPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4UL) << 3)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~3 - * @return None - * @details This function is used to disable selected channel to trigger ADC - */ -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - if (u32ChannelNum < 4UL) - { - (bpwm)->EADCTS0 &= ~(BPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3)); - } - else - { - (bpwm)->EADCTS1 &= ~(BPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4UL) << 3)); - } -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag - */ -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (void)u32Condition; - (bpwm)->STATUS = (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get BPWM trigger ADC to start of conversion flag for specified channel - */ -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->STATUS & (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s) - */ -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN |= u32ChannelMask; - (bpwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s) - */ -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN &= ~u32ChannelMask; - (bpwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enables BPWM output generation of selected channel(s) - */ -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disables BPWM output generation of selected channel(s) - */ -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - uint32_t u32CapIf = 0UL; - - u32CapIf = ((((bpwm)->CAPIF & (BPWM_CAPIF_CAPFIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1); - u32CapIf |= (((bpwm)->CAPIF & (BPWM_CAPIF_CAPRIF0_Msk << u32ChannelNum)) ? 1UL : 0UL); - return u32CapIf; -} - -/** - * @brief Enable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref BPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (bpwm)->INTEN |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel - */ -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN &= (uint32_t)(~((BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | BPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum)); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel - */ -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = (BPWM_INTSTS_CMPUIF0_Msk | BPWM_INTSTS_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel - */ -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return ((((bpwm)->INTSTS & ((BPWM_INTSTS_CMPDIF0_Msk | BPWM_INTSTS_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (void)u32ChannelNum; - (void)u32IntPeriodType; - (bpwm)->INTEN |= BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTEN &= ~BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTSTS = BPWM_INTSTS_PIF0_Msk; -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - return (((bpwm)->INTSTS & BPWM_INTSTS_PIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to enable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTEN |= BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTEN &= ~BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->INTSTS = BPWM_INTSTS_ZIF0_Msk; -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return zero interrupt flag of specified channel - * @retval 0 zero interrupt did not occur - * @retval 1 zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - return (((bpwm)->INTSTS & BPWM_INTSTS_ZIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode BPWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode BPWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Set BPWM clock source - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32ClkSrcSel BPWM external clock source. - * - \ref BPWM_CLKSRC_BPWM_CLK - * - \ref BPWM_CLKSRC_TIMER0 - * - \ref BPWM_CLKSRC_TIMER1 - * - \ref BPWM_CLKSRC_TIMER2 - * - \ref BPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set BPWM clock source. - * @note All channels share channel 0's setting. - */ -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (void)u32ChannelNum; - (bpwm)->CLKSRC = (u32ClkSrcSel); -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - return (((bpwm)->STATUS & BPWM_STATUS_CNTMAX0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (void)u32ChannelNum; - (bpwm)->STATUS = BPWM_STATUS_CNTMAX0_Msk; -} - - -/*@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_canfd.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_canfd.c deleted file mode 100644 index facacc99b60..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_canfd.c +++ /dev/null @@ -1,1862 +0,0 @@ -/**************************************************************************** - * @file canfd.c - * @version V1.00 - * @brief CAN FD driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" -#include "string.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Minimum number of time quanta in a bit. */ -#define MIN_TIME_QUANTA 9ul -/* Maximum number of time quanta in a bit. */ -#define MAX_TIME_QUANTA 20ul -/* Number of receive FIFOs (1 - 2) */ -#define CANFD_NUM_RX_FIFOS 2ul - -/*CANFD max nominal bit rate*/ -#define MAX_NOMINAL_BAUDRATE (1000000UL) - -/* Tx Event FIFO Element ESI(Error State Indicator) */ -#define TX_FIFO_E0_EVENT_ESI_Pos (31) -#define TX_FIFO_E0_EVENT_ESI_Msk (0x1ul << TX_FIFO_E0_EVENT_ESI_Pos) - -/* Tx Event FIFO Element XTD(Extended Identifier) */ -#define TX_FIFO_E0_EVENT_XTD_Pos (30) -#define TX_FIFO_E0_EVENT_XTD_Msk (0x1ul << TX_FIFO_E0_EVENT_XTD_Pos) - -/* Tx Event FIFO Element RTR(Remote Transmission Request) */ -#define TX_FIFO_E0_EVENT_RTR_Pos (29) -#define TX_FIFO_E0_EVENT_RTR_Msk (0x1ul << TX_FIFO_E0_EVENT_RTR_Pos) - -/* Tx Event FIFO Element ID(Identifier) */ -#define TX_FIFO_E0_EVENT_ID_Pos (0) -#define TX_FIFO_E0_EVENT_ID_Msk (0x1FFFFFFFul << TX_FIFO_E0_EVENT_ID_Pos) - -/* Tx Event FIFO Element MM(Message Marker) */ -#define TX_FIFO_E1_EVENT_MM_Pos (24) -#define TX_FIFO_E1_EVENT_MM_Msk (0xFFul << TX_FIFO_E1_EVENT_MM_Pos) - -/* Tx Event FIFO Element ET(Event Type) */ -#define TX_FIFO_E1_EVENT_ET_Pos (22) -#define TX_FIFO_E1_EVENT_ET_Msk (0x3ul << TX_FIFO_E1_EVENT_ET_Pos) - -/* Tx Event FIFO Element FDF(FD Format) */ -#define TX_FIFO_E1_EVENT_FDF_Pos (21) -#define TX_FIFO_E1_EVENT_FDF_Msk (0x1ul << TX_FIFO_E1_EVENT_FDF_Pos) - -/* Tx Event FIFO Element BRS(Bit Rate Switch) */ -#define TX_FIFO_E1_EVENT_BRS_Pos (20) -#define TX_FIFO_E1_EVENT_BRS_Msk (0x1ul << TX_FIFO_E1_EVENT_BRS_Pos) - -/* Tx Event FIFO Element DLC(Data Length Code) */ -#define TX_FIFO_E1_EVENT_DLC_Pos (16) -#define TX_FIFO_E1_EVENT_DLC_Msk (0xFul << TX_FIFO_E1_EVENT_DLC_Pos) - -/* Tx Event FIFO Element TXTS(Tx Timestamp) */ -#define TX_FIFO_E1A_EVENT_TXTS_Pos (0) -#define TX_FIFO_E1A_EVENT_TXTS_Msk (0xFFFFul << TX_FIFO_E1A_EVENT_TXTS_Pos) - -/* Tx Event FIFO Element MM(Message Marker) */ -#define TX_FIFO_E1B_EVENT_MM_Pos (8) -#define TX_FIFO_E1B_EVENT_MM_Msk (0xFFul << TX_FIFO_E1B_EVENT_MM_Pos) - -/* Tx Event FIFO Element TSC(Timestamp Captured) */ -#define TX_FIFO_E1B_EVENT_TSC_Pos (4) -#define TX_FIFO_E1B_EVENT_TSC_Msk (0x1ul << TX_FIFO_E1B_EVENT_TSC_Pos) - -/* Tx Event FIFO Element TSC(Timestamp Captured) */ -#define TX_FIFO_E1B_EVENT_TXTS_Pos (0) -#define TX_FIFO_E1B_EVENT_TXTS_Msk (0xFul << TX_FIFO_E1B_EVENT_TSC_Pos) - -/* Rx Buffer and FIFO Element ESI2(Error State Indicator) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Pos (31) -#define RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Msk (0x1ul << RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Pos) - -/* Rx Buffer and FIFO Element XTD(Extended Identifier) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Pos (30) -#define RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Msk (0x1ul << RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Pos) - -/* Rx Buffer and FIFO Element RTR(Remote Transmission Request) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Pos (29) -#define RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Msk (0x1ul << RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Pos) - -/* Rx Buffer and FIFO Element ID(Identifier) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_ID_Pos (0) -#define RX_BUFFER_AND_FIFO_R0_ELEM_ID_Msk (0x1FFFFFFFul << RX_BUFFER_AND_FIFO_R0_ELEM_ID_Pos) - -/* Rx Buffer and FIFO Element ANMF(Accepted Non-matching Frame) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_ANMF_Pos (31) -#define RX_BUFFER_AND_FIFO_R1_ELEM_ANMF_Msk (0x1ul << RX_BUFFER_AND_FIFO_R1_ELEM_ANMF_Pos) - -/* Rx Buffer and FIFO Element FIDX(Filter Index) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_FIDX_Pos (24) -#define RX_BUFFER_AND_FIFO_R1_ELEM_FIDX_Msk (0x7Ful << RX_BUFFER_AND_FIFO_R1_ELEM_FIDX_Pos) - -/* Rx Buffer and FIFO Element FDF(FD Format) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Pos (21) -#define RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Msk (0x1ul << RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Pos) - -/* Rx Buffer and FIFO Element BRS(Bit Rate Swit) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Pos (20) -#define RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Msk (0x1ul << RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Pos) - -/* Rx Buffer and FIFO Element DLC(Bit Rate Swit) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Pos (16) -#define RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Msk (0xFul << RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Pos) - -/* Rx Buffer and FIFO Element RXTS(Rx Timestamp) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_RXTS_Pos (0) -#define RX_BUFFER_AND_FIFO_R1_ELEM_RXTS_Msk (0xFFFFul << RX_BUFFER_AND_FIFO_R1_ELEM_RXTS_Pos) - -/* Tx Buffer Element ESI(Error State Indicator) */ -#define TX_BUFFER_T0_ELEM_ESI_Pos (31) -#define TX_BUFFER_T0_ELEM_ESI_Msk (0x1ul << TX_BUFFER_T0_ELEM_ESI_Pos) - -/* Tx Buffer Element XTD(Extended Identifier) */ -#define TX_BUFFER_T0_ELEM_XTD_Pos (30) -#define TX_BUFFER_T0_ELEM_XTD_Msk (0x1ul << TX_BUFFER_T0_ELEM_XTD_Pos) - -/* Tx Buffer RTR(Remote Transmission Request) */ -#define TX_BUFFER_T0_ELEM_RTR_Pos (29) -#define TX_BUFFER_T0_ELEM_RTR_Msk (0x1ul << TX_BUFFER_T0_ELEM_RTR_Pos) - -/* Tx Buffer Element ID(Identifier) */ -#define TX_BUFFER_T0_ELEM_ID_Pos (0) -#define TX_BUFFER_T0_ELEM_ID_Msk (0x1FFFFFFFul << TX_BUFFER_T0_ELEM_ID_Pos) - -/* Tx Buffer Element MM(Message Marker) */ -#define TX_BUFFER_T1_ELEM_MM1_Pos (24) -#define TX_BUFFER_T1_ELEM_MM1_Msk (0xFFul << TX_BUFFER_T1_ELEM_MM1_Pos) - -/* Tx Buffer Element EFC(Event FIFO Control) */ -#define TX_BUFFER_T1_ELEM_EFC_Pos (23) -#define TX_BUFFER_T1_ELEM_EFC_Msk (0xFFul << TX_BUFFER_T1_ELEM_EFC_Pos) - -/* Tx Buffer Element TSCE(Time Stamp Capture Enable for TSU) */ -#define TX_BUFFER_T1_ELEM_TSCE_Pos (22) -#define TX_BUFFER_T1_ELEM_TSCE_Msk (0x1ul << TX_BUFFER_T1_ELEM_TSCE_Pos) - -/* Tx Buffer Element FDF(FD Format) */ -#define TX_BUFFER_T1_ELEM_FDF_Pos (21) -#define TX_BUFFER_T1_ELEM_FDF_Msk (0x1ul << TX_BUFFER_T1_ELEM_FDF_Pos) - -/* Tx Buffer Element BRS(Bit Rate Swit) */ -#define TX_BUFFER_T1_ELEM_BSR_Pos (20) -#define TX_BUFFER_T1_ELEM_BSR_Msk (0x1ul << TX_BUFFER_T1_ELEM_BSR_Pos) - -/* Tx Buffer Element DLC(Bit Rate Swit) */ -#define TX_BUFFER_T1_ELEM_DLC_Pos (16) -#define TX_BUFFER_T1_ELEM_DLC_Msk (0xFul << TX_BUFFER_T1_ELEM_DLC_Pos) - -/* Tx Buffer Element MM(Message Marker) */ -#define TX_BUFFER_T1_ELEM_MM0_Pos (8) -#define TX_BUFFER_T1_ELEM_MM0_Msk (0xFFul << TX_BUFFER_T1_ELEM_MM0_Pos) - -#define CANFD_RXFS_RFL CANFD_RXF0S_RF0L_Msk - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CANFD_Driver CAN_FD Driver - @{ -*/ - -/** @addtogroup CANFD_EXPORTED_FUNCTIONS CAN_FD Exported Functions - @{ -*/ - -static void CANFD_InitRxFifo(CANFD_T *canfd, uint32_t u32RxFifoNum, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWM, E_CANFD_DATA_FIELD_SIZE eFifoSize); -static void CANFD_InitRxDBuf(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eRxBufSize); -static void CANFD_InitTxDBuf(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eTxBufSize); -static void CANFD_InitTxEvntFifo(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWaterLvl); -static void CANFD_ConfigSIDFC(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize); -static void CANFD_ConfigXIDFC(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize); - -uint32_t CANFD_ReadReg(__I uint32_t *pu32RegAddr) -{ - uint32_t u32ReadReg; - uint32_t u32TimeOutCnt = CANFD_READ_REG_TIMEOUT; - u32ReadReg = 0UL; - - do - { - u32ReadReg = inpw(pu32RegAddr); - if (--u32TimeOutCnt == 0UL) - { - break; - } - } - while (u32ReadReg == 0UL); - - return u32ReadReg; -} - -/** - * @brief Calculates the CAN FD RAM buffer address. - * - * @param[in] psConfigAddr CAN FD element star address structure. - * @param[in] psConfigSize CAN FD element size structure. - * - * @return None. - * - * @details Calculates the CAN FD RAM buffer address. - */ -static void CANFD_CalculateRamAddress(CANFD_RAM_PART_T *psConfigAddr, CANFD_ELEM_SIZE_T *psConfigSize) -{ - uint32_t u32RamAddrOffset = 0; - - /* Get the Standard Message ID Filter element address */ - if (psConfigSize->u32SIDFC > 0) - { - psConfigAddr->u32SIDFC_FLSSA = 0; - u32RamAddrOffset += psConfigSize->u32SIDFC * sizeof(CANFD_STD_FILTER_T); - } - - /* Get the Extended Message ID Filter element address */ - if (psConfigSize->u32XIDFC > 0) - { - psConfigAddr->u32XIDFC_FLESA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32XIDFC * sizeof(CANFD_EXT_FILTER_T); - } - - /* Get the Rx FIFO0 element address */ - if (psConfigSize->u32RxFifo0 > 0) - { - psConfigAddr->u32RXF0C_F0SA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32RxFifo0 * sizeof(CANFD_BUF_T); - } - - /* Get the Rx FIFO1 element address */ - if (psConfigSize->u32RxFifo1 > 0) - { - psConfigAddr->u32RXF1C_F1SA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32RxFifo1 * sizeof(CANFD_BUF_T); - } - - /* Get the Rx Buffer element address */ - if (psConfigSize->u32RxBuf > 0) - { - psConfigAddr->u32RXBC_RBSA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32RxBuf * sizeof(CANFD_BUF_T); - } - - /* Get the TX Event FIFO element address */ - if (psConfigSize->u32TxEventFifo > 0) - { - psConfigAddr->u32TXEFC_EFSA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32TxEventFifo * sizeof(CANFD_EXT_FILTER_T); - } - - /* Get the Tx Buffer element address */ - if (psConfigSize->u32TxBuf > 0) - { - psConfigAddr->u32TXBC_TBSA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32TxBuf * sizeof(CANFD_BUF_T); - } -} - -/** - * @brief Get the default configuration structure. - * - * @param[in] psConfig Pointer to CAN FD configuration structure. - * @param[in] u8OpMode Setting the CAN FD Operating mode. - * - * @return None. - * - * @details This function initializes the CAN FD configure structure to default value. - * The default value are: - * sNormBitRate.u32BitRate = 500000bps; - * u32DataBaudRate = 0(CAN mode) or 1000000(CAN FD mode) ; - * u32MRamSize = 6k bytes (1.5k words); - * bEnableLoopBack = FALSE; - * bBitRateSwitch = FALSE(CAN Mode) or TRUE(CAN FD Mode); - * bFDEn = FALSE(CAN Mode) or TRUE(CAN FD Mode); -*/ -void CANFD_GetDefaultConfig(CANFD_FD_T *psConfig, uint8_t u8OpMode) -{ - memset(psConfig, 0, sizeof(CANFD_FD_T)); - - psConfig->sBtConfig.sNormBitRate.u32BitRate = 500000; - - if (u8OpMode == CANFD_OP_CAN_MODE) - { - psConfig->sBtConfig.sDataBitRate.u32BitRate = 0; - psConfig->sBtConfig.bFDEn = FALSE; - psConfig->sBtConfig.bBitRateSwitch = FALSE; - } - else - { - psConfig->sBtConfig.sDataBitRate.u32BitRate = 10000000; - psConfig->sBtConfig.bFDEn = TRUE; - psConfig->sBtConfig.bBitRateSwitch = TRUE; - } - - /* Set normal mode by default */ - psConfig->sBtConfig.evTestMode = eCANFD_NORMAL; - - /*Get the CAN FD memory address*/ - psConfig->u32MRamSize = CANFD_SRAM_SIZE; - - /* CAN FD Standard message ID elements as 64 elements */ - psConfig->sElemSize.u32SIDFC = 64; - /* CAN FD Extended message ID elements as 64 elements */ - psConfig->sElemSize.u32XIDFC = 64; - /* CAN FD TX Buffer elements as 8 elements */ - psConfig->sElemSize.u32TxBuf = 8; - /* CAN FD RX Buffer elements as 8 elements */ - psConfig->sElemSize.u32RxBuf = 8; - /* CAN FD RX FIFO0 elements as 48 elements */ - psConfig->sElemSize.u32RxFifo0 = 48; - /* CAN FD RX FIFO1 elements as 8 elements */ - psConfig->sElemSize.u32RxFifo1 = 8; - /* CAN FD TX Event FOFI elements as 8 elements */ - psConfig->sElemSize.u32TxEventFifo = 8; - /*Calculates the CAN FD RAM buffer address*/ - CANFD_CalculateRamAddress(&psConfig->sMRamStartAddr, &psConfig->sElemSize); -} - - -/** - * @brief Encode the Data Length Code. - * - * @param[in] u8NumberOfBytes Number of bytes in a message. - * - * @return Data Length Code. - * - * @details Converts number of bytes in a message into a Data Length Code. - */ -static uint8_t CANFD_EncodeDLC(uint8_t u8NumberOfBytes) -{ - if (u8NumberOfBytes <= 8) return u8NumberOfBytes; - else if (u8NumberOfBytes <= 12) return 9; - else if (u8NumberOfBytes <= 16) return 10; - else if (u8NumberOfBytes <= 20) return 11; - else if (u8NumberOfBytes <= 24) return 12; - else if (u8NumberOfBytes <= 32) return 13; - else if (u8NumberOfBytes <= 48) return 14; - else return 15; -} - - -/** - * @brief Decode the Data Length Code. - * - * @param[in] u8Dlc Data Length Code. - * - * @return Number of bytes in a message. - * - * @details Converts a Data Length Code into a number of message bytes. - */ -static uint8_t CANFD_DecodeDLC(uint8_t u8Dlc) -{ - if (u8Dlc <= 8) return u8Dlc; - else if (u8Dlc == 9) return 12; - else if (u8Dlc == 10) return 16; - else if (u8Dlc == 11) return 20; - else if (u8Dlc == 12) return 24; - else if (u8Dlc == 13) return 32; - else if (u8Dlc == 14) return 48; - else return 64; -} - - -/** - * @brief Sets the CAN FD protocol timing characteristic. - * - * @param[in] psCanfd The pointer of the specified CANFD module. - * @param[in] psConfig Pointer to the timing configuration structure. - * - * @return None. - * - * @details This function gives user settings to CAN bus timing characteristic. - * The function is for an experienced user. For less experienced users, call - * the CANFD_Open() and fill the baud rate field with a desired value. - * This provides the default timing characteristics to the module. - */ -static void CANFD_SetTimingConfig(CANFD_T *psCanfd, const CANFD_TIMEING_CONFIG_T *psConfig) -{ - if (psCanfd == (CANFD_T *)CANFD0) - { - /* Set CANFD0 clock divider number */ - CLK->CLKDIV5 = (CLK->CLKDIV5 & ~CLK_CLKDIV5_CANFD0DIV_Msk) | CLK_CLKDIV5_CANFD0(psConfig->u8PreDivider) ; - } - else if (psCanfd == (CANFD_T *)CANFD1) - { - /* Set CANFD1 clock divider number */ - CLK->CLKDIV5 = (CLK->CLKDIV5 & ~CLK_CLKDIV5_CANFD1DIV_Msk) | CLK_CLKDIV5_CANFD1(psConfig->u8PreDivider) ; - } - else if (psCanfd == (CANFD_T *)CANFD2) - { - /* Set CANFD2 clock divider number */ - CLK->CLKDIV5 = (CLK->CLKDIV5 & ~CLK_CLKDIV5_CANFD2DIV_Msk) | CLK_CLKDIV5_CANFD2(psConfig->u8PreDivider) ; - } - else if (psCanfd == (CANFD_T *)CANFD3) - { - /* Set CANFD3 clock divider number */ - CLK->CLKDIV5 = (CLK->CLKDIV5 & ~CLK_CLKDIV5_CANFD3DIV_Msk) | CLK_CLKDIV5_CANFD3(psConfig->u8PreDivider) ; - } - else - { - return; - } - - /* configuration change enable */ - psCanfd->CCCR |= CANFD_CCCR_CCE_Msk; - - /* nominal bit rate */ - psCanfd->NBTP = (((psConfig->u8NominalRJumpwidth & 0x7F) - 1) << 25) + - (((psConfig->u16NominalPrescaler & 0x1FF) - 1) << 16) + - ((((psConfig->u8NominalPhaseSeg1 + psConfig->u8NominalPropSeg) & 0xFF) - 1) << 8) + - (((psConfig->u8NominalPhaseSeg2 & 0x7F) - 1) << 0); - - - /* canfd->DBTP */ - if (psCanfd->CCCR & CANFD_CCCR_FDOE_Msk) - { - psCanfd->DBTP = (((psConfig->u8DataPrescaler & 0x1F) - 1) << 16) + - ((((psConfig->u8DataPhaseSeg1 + psConfig->u8DataPropSeg) & 0x1F) - 1) << 8) + - (((psConfig->u8DataPhaseSeg2 & 0xF) - 1) << 4) + - (((psConfig->u8DataRJumpwidth & 0xF) - 1) << 0); - } -} - - -/** - * @brief Get the segment values. - * - * @param[in] u32NominalBaudRate The nominal speed in bps. - * @param[in] u32DataBaudRate The data speed in bps. - * @param[in] u32Ntq Number of nominal time quanta per bit. - * @param[in] u32Dtq Number of data time quanta per bit. - * @param[in] psConfig Passed is a configuration structure, on return the configuration is stored in the structure - * - * @return None. - * - * @details Calculates the segment values for a single bit time for nominal and data baudrates. - */ -static void CANFD_GetSegments(uint32_t u32NominalBaudRate, uint32_t u32DataBaudRate, uint32_t u32Ntq, uint32_t u32Dtq, CANFD_TIMEING_CONFIG_T *psConfig) -{ - float ideal_sp; - int int32P1; - - /* get ideal sample point */ - if (u32NominalBaudRate >= 1000000) ideal_sp = 0.750; - else if (u32NominalBaudRate >= 800000) ideal_sp = 0.800; - else ideal_sp = 0.875; - - /* distribute time quanta */ - int32P1 = (int)(u32Ntq * ideal_sp); - /* can controller doesn't separate prop seg and phase seg 1 */ - psConfig->u8NominalPropSeg = 0; - /* subtract one TQ for sync seg */ - psConfig->u8NominalPhaseSeg1 = int32P1 - 1; - psConfig->u8NominalPhaseSeg2 = u32Ntq - int32P1; - /* sjw is 20% of total TQ, rounded to nearest int */ - psConfig->u8NominalRJumpwidth = (u32Ntq + (5 - 1)) / 5; - - - /* if using baud rate switching then distribute time quanta for data rate */ - if (u32Dtq > 0) - { - /* get ideal sample point */ - if (u32DataBaudRate >= 1000000) ideal_sp = 0.750; - else if (u32DataBaudRate >= 800000) ideal_sp = 0.800; - else ideal_sp = 0.875; - - /* distribute time quanta */ - int32P1 = (int)(u32Dtq * ideal_sp); - /* can controller doesn't separate prop seg and phase seg 1 */ - psConfig->u8DataPropSeg = 0; - /* subtract one TQ for sync seg */ - psConfig->u8DataPhaseSeg1 = int32P1 - 1; - psConfig->u8DataPhaseSeg2 = u32Dtq - int32P1; - /* sjw is 20% of total TQ, rounded to nearest int */ - psConfig->u8DataRJumpwidth = (u32Dtq + (5 - 1)) / 5; - } - else - { - psConfig->u8DataPropSeg = 0; - psConfig->u8DataPhaseSeg1 = 0; - psConfig->u8DataPhaseSeg2 = 0; - psConfig->u8DataRJumpwidth = 0; - } -} - - -/** - * @brief Calculates the CAN controller timing values for specific baudrates. - * - * @param[in] u32NominalBaudRate The nominal speed in bps. - * @param[in] u32DataBaudRate The data speed in bps. Zero to disable baudrate switching. - * @param[in] u32SourceClock_Hz CAN FD Protocol Engine clock source frequency in Hz. - * @param[in] psConfig Passed is a configuration structure, on return the configuration is stored in the structure - * - * @return true if timing configuration found, false if failed to find configuration. - * - * @details Calculates the CAN controller timing values for specific baudrates. - */ -static uint32_t CANFD_CalculateTimingValues(CANFD_T *psCanfd, uint32_t u32NominalBaudRate, uint32_t u32DataBaudRate, uint32_t u32SourceClock_Hz, CANFD_TIMEING_CONFIG_T *psConfig) -{ - int i32Nclk; - int i32Nclk2; - int i32Ntq; - int i32Dclk; - int i32Dclk2; - int i32Dtq; - - /* observe baud rate maximums */ - if (u32NominalBaudRate > MAX_NOMINAL_BAUDRATE) u32NominalBaudRate = MAX_NOMINAL_BAUDRATE; - - for (i32Ntq = MAX_TIME_QUANTA; i32Ntq >= MIN_TIME_QUANTA; i32Ntq--) - { - i32Nclk = u32NominalBaudRate * i32Ntq; - - for (psConfig->u16NominalPrescaler = 0x001; psConfig->u16NominalPrescaler <= 0x400; (psConfig->u16NominalPrescaler)++) - { - i32Nclk2 = i32Nclk * psConfig->u16NominalPrescaler; - - if (((u32SourceClock_Hz / i32Nclk2) <= 5) && ((u32SourceClock_Hz % i32Nclk2) == 0)) - { - psConfig->u8PreDivider = u32SourceClock_Hz / i32Nclk2; - - /* FD Operation? */ - if (psCanfd->CCCR & CANFD_CCCR_FDOE_Msk) - { - /* Exception case: Let u32DataBaudRate is same with u32NominalBaudRate. */ - if (u32DataBaudRate == 0) - u32DataBaudRate = u32NominalBaudRate; - - /* if baudrates are the same and the solution for nominal will work for - data, then use the nominal settings for both */ - if ((u32DataBaudRate == u32NominalBaudRate) && (psConfig->u16NominalPrescaler <= 0x20)) - { - i32Dtq = i32Ntq; - psConfig->u8DataPrescaler = (uint8_t)psConfig->u16NominalPrescaler; - CANFD_GetSegments(u32NominalBaudRate, u32DataBaudRate, i32Ntq, i32Dtq, psConfig); - return TRUE; - } - - /* calculate data settings */ - for (i32Dtq = MAX_TIME_QUANTA; i32Dtq >= MIN_TIME_QUANTA; i32Dtq--) - { - i32Dclk = u32DataBaudRate * i32Dtq; - - for (psConfig->u8DataPrescaler = 0x01; psConfig->u8DataPrescaler <= 0x20; (psConfig->u8DataPrescaler)++) - { - i32Dclk2 = i32Dclk * psConfig->u8DataPrescaler; - if (u32SourceClock_Hz == ((uint32_t)i32Dclk2 * psConfig->u8PreDivider)) - { - CANFD_GetSegments(u32NominalBaudRate, u32DataBaudRate, i32Ntq, i32Dtq, psConfig); - return TRUE; - } - } - } - } - else - { - psConfig->u8DataPrescaler = 0; - CANFD_GetSegments(u32NominalBaudRate, 0, 0, 0, psConfig); - return TRUE; - } - } - } - } - - /* failed to find solution */ - return FALSE; -} - - -/** - * @brief Config message ram and Set bit-time. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psCanfdStr message ram setting and bit-time setting - * - * @return None. - * - * @details Converts a Data Length Code into a number of message bytes. - */ -void CANFD_Open(CANFD_T *psCanfd, CANFD_FD_T *psCanfdStr) -{ - uint32_t u32RegLockLevel = SYS_IsRegLocked(); - - if (u32RegLockLevel) - SYS_UnlockReg(); - - if (psCanfd == (CANFD_T *)CANFD0) - { - CLK_EnableModuleClock(CANFD0_MODULE); - SYS_ResetModule(CANFD0_RST); - } - else if (psCanfd == (CANFD_T *)CANFD1) - { - CLK_EnableModuleClock(CANFD1_MODULE); - SYS_ResetModule(CANFD1_RST); - } - else if (psCanfd == (CANFD_T *)CANFD2) - { - CLK_EnableModuleClock(CANFD2_MODULE); - SYS_ResetModule(CANFD2_RST); - } - else if (psCanfd == (CANFD_T *)CANFD3) - { - CLK_EnableModuleClock(CANFD3_MODULE); - SYS_ResetModule(CANFD3_RST); - } - else - { - if (u32RegLockLevel) - SYS_LockReg(); - - return; - } - - /* Initialization & un-lock */ - CANFD_RunToNormal(psCanfd, FALSE); - - if (psCanfdStr->sBtConfig.bBitRateSwitch) - { - /* enable FD and baud-rate switching */ - psCanfd->CCCR |= CANFD_CCCR_BRSE_Msk; - } - - if (psCanfdStr->sBtConfig.bFDEn) - { - /*FD Operation enabled*/ - psCanfd->CCCR |= CANFD_CCCR_FDOE_Msk; - } - - /*Clear the Rx Fifo0 element setting */ - psCanfd->RXF0C = 0; - /*Clear the Rx Fifo1 element setting */ - psCanfd->RXF1C = 0; - - /* calculate and apply timing */ - if (CANFD_CalculateTimingValues(psCanfd, psCanfdStr->sBtConfig.sNormBitRate.u32BitRate, psCanfdStr->sBtConfig.sDataBitRate.u32BitRate, - SystemCoreClock, &psCanfdStr->sBtConfig.sConfigBitTing)) - { - CANFD_SetTimingConfig(psCanfd, &psCanfdStr->sBtConfig.sConfigBitTing); - } - - if (u32RegLockLevel) - SYS_LockReg(); - - /* Configures the Standard ID Filter element */ - if (psCanfdStr->sElemSize.u32SIDFC != 0) - CANFD_ConfigSIDFC(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize); - - /*Configures the Extended ID Filter element */ - if (psCanfdStr->sElemSize.u32XIDFC != 0) - CANFD_ConfigXIDFC(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize); - - /*Configures the Tx Buffer element */ - if (psCanfdStr->sElemSize.u32RxBuf != 0) - CANFD_InitTxDBuf(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, eCANFD_BYTE64); - - /*Configures the Rx Buffer element */ - if (psCanfdStr->sElemSize.u32RxBuf != 0) - CANFD_InitRxDBuf(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, eCANFD_BYTE64); - - /*Configures the Rx Fifo0 element */ - if (psCanfdStr->sElemSize.u32RxFifo0 != 0) - CANFD_InitRxFifo(psCanfd, 0, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, 0, eCANFD_BYTE64); - - /*Configures the Rx Fifo1 element */ - if (psCanfdStr->sElemSize.u32RxFifo1 != 0) - CANFD_InitRxFifo(psCanfd, 1, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, 0, eCANFD_BYTE64); - - /*Configures the Tx Event FIFO element */ - if (psCanfdStr->sElemSize.u32TxEventFifo != 0) - CANFD_InitTxEvntFifo(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, 0); - - /*Reject all Non-matching Frames Extended ID and Frames Standard ID,Reject all remote frames with 11-bit standard IDs and 29-bit extended IDs */ - CANFD_SetGFC(psCanfd, eCANFD_REJ_NON_MATCH_FRM, eCANFD_REJ_NON_MATCH_FRM, 1, 1); - - /* Test mode configuration */ - switch (psCanfdStr->sBtConfig.evTestMode) - { - case eCANFD_RESTRICTED_OPERATION: - psCanfd->CCCR |= (CANFD_CCCR_TEST_Msk | CANFD_CCCR_ASM_Msk); - break; - - case eCANFD_BUS_MONITOR: - psCanfd->CCCR |= (CANFD_CCCR_TEST_Msk | CANFD_CCCR_MON_Msk); - break; - - case eCANFD_LOOPBACK_EXTERNAL: - psCanfd->CCCR |= CANFD_CCCR_TEST_Msk; - psCanfd->TEST |= CANFD_TEST_LBCK_Msk; - break; - - case eCANFD_LOOPBACK_INTERNAL: - psCanfd->CCCR |= (CANFD_CCCR_TEST_Msk | CANFD_CCCR_MON_Msk); - psCanfd->TEST |= CANFD_TEST_LBCK_Msk; - break; - - case eCANFD_NORMAL: /* Normal mode */ - default: - psCanfd->CCCR &= ~(CANFD_CCCR_MON_Msk | CANFD_CCCR_TEST_Msk | CANFD_CCCR_ASM_Msk); - psCanfd->TEST &= ~CANFD_TEST_LBCK_Msk; - break; - } -} - - -/** - * @brief Close the CAN FD Bus. - * - * @param[in] psCanfd The pointer to CANFD module base address. - * - * @return None. - * - * @details Disable the CAN FD clock and Interrupt. - */ -void CANFD_Close(CANFD_T *psCanfd) -{ - if (psCanfd == (CANFD_T *)CANFD0) - { - CLK_DisableModuleClock(CANFD0_MODULE); - } - else if (psCanfd == (CANFD_T *)CANFD1) - { - CLK_DisableModuleClock(CANFD1_MODULE); - } - else if (psCanfd == (CANFD_T *)CANFD2) - { - CLK_DisableModuleClock(CANFD2_MODULE); - } - else if (psCanfd == (CANFD_T *)CANFD3) - { - CLK_DisableModuleClock(CANFD3_MODULE); - } -} - - -/** - * @brief Get the element's address when read transmit buffer. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32Idx The number of the transmit buffer element - * - * @return Address of the element in transmit buffer. - * - * @details The function is used to get the element's address when read transmit buffer. - */ -static uint32_t CANFD_GetTxBufferElementAddress(CANFD_T *psCanfd, uint32_t u32Idx) -{ - uint32_t u32Size = 0; - u32Size = (CANFD_ReadReg(&psCanfd->TXESC) & CANFD_TXESC_TBDS_Msk) >> CANFD_TXESC_TBDS_Pos; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - return (CANFD_ReadReg(&psCanfd->TXBC) & CANFD_TXBC_TBSA_Msk) + u32Idx * u32Size * 4U; -} - -/** - * @brief Enables CAN FD interrupts according to provided mask . - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32IntLine0 The Interrupt Line 0 type select. - * @param[in] u32IntLine1 The Interrupt Line 1 type select. - * - \ref CANFD_IE_ARAE_Msk : Access to Reserved Address Interrupt - * - \ref CANFD_IE_PEDE_Msk : Protocol Error in Data Phase Interrupt - * - \ref CANFD_IE_PEAE_Msk : Protocol Error in Arbitration Phase Interrupt - * - \ref CANFD_IE_WDIE_Msk : Watchdog Interrupt - * - \ref CANFD_IE_BOE_Msk : Bus_Off Status Interrupt - * - \ref CANFD_IE_EWE_Msk : Warning Status Interrupt - * - \ref CANFD_IE_EPE_Msk : Error Passive Interrupt - * - \ref CANFD_IE_ELOE_Msk : Error Logging Overflow Interrupt - * - \ref CANFD_IE_BEUE_Msk : Bit Error Uncorrected Interrupt - * - \ref CANFD_IE_BECE_Msk : Bit Error Corrected Interrupt - * - \ref CANFD_IE_DRXE_Msk : Message stored to Dedicated Rx Buffer Interrupt - * - \ref CANFD_IE_TOOE_Msk : Timeout Occurred Interrupt - * - \ref CANFD_IE_MRAFE_Msk : Message RAM Access Failure Interrupt - * - \ref CANFD_IE_TSWE_Msk : Timestamp Wraparound Interrupt - * - \ref CANFD_IE_TEFLE_Msk : Tx Event FIFO Event Lost Interrupt - * - \ref CANFD_IE_TEFFE_Msk : Tx Event FIFO Full Interrupt - * - \ref CANFD_IE_TEFWE_Msk : Tx Event FIFO Watermark Reached Interrupt - * - \ref CANFD_IE_TEFNE_Msk : Tx Event FIFO New Entry Interrupt - * - \ref CANFD_IE_TFEE_Msk : Tx FIFO Empty Interrupt - * - \ref CANFD_IE_TCFE_Msk : Transmission Cancellation Finished Interrupt - * - \ref CANFD_IE_TCE_Msk : Transmission Completed Interrupt - * - \ref CANFD_IE_HPME_Msk : High Priority Message Interrupt - * - \ref CANFD_IE_RF1LE_Msk : Rx FIFO 1 Message Lost Interrupt - * - \ref CANFD_IE_RF1FE_Msk : Rx FIFO 1 Full Interrupt - * - \ref CANFD_IE_RF1WE_Msk : Rx FIFO 1 Watermark Reached Interrupt - * - \ref CANFD_IE_RF1NE_Msk : Rx FIFO 1 New Message Interrupt - * - \ref CANFD_IE_RF0LE_Msk : Rx FIFO 0 Message Lost Interrupt - * - \ref CANFD_IE_RF0FE_Msk : Rx FIFO 0 Full Interrupt - * - \ref CANFD_IE_RF0WE_Msk : Rx FIFO 0 Watermark Reached Interrupt - * - \ref CANFD_IE_RF0NE_Msk : Rx FIFO 0 New Message Interrupt - * - * @param[in] u32TXBTIE Enable Tx Buffer Transmission 0-31 Interrupt. - * @param[in] u32TXBCIE Enable Tx Buffer Cancellation Finished 0-31 Interrupt. - * @return None. - * - * @details This macro enable specified CAN FD interrupt. - */ -void CANFD_EnableInt(CANFD_T *psCanfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE) -{ - /*Setting the CANFD Interrupt Enabling*/ - psCanfd->IE = CANFD_ReadReg(&psCanfd->IE) | u32IntLine0 | u32IntLine1; - - if (u32IntLine0 != 0) - { - /* Select specified interrupt event of Line0. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) & ~u32IntLine0; - /* Enable Line0 interrupt. */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) | CANFD_ILE_ENT0_Msk; - } - - if (u32IntLine1 != 0) - { - /* Select specified interrupt event of Line1. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) | u32IntLine1; - /* Enable Line1 interrupt. */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) | CANFD_ILE_ENT1_Msk; - } - - /*Setting the Tx Buffer Transmission Interrupt Enable*/ - psCanfd->TXBTIE = CANFD_ReadReg(&psCanfd->TXBTIE) | u32TXBTIE; - - /*Tx Buffer Cancellation Finished Interrupt Enable*/ - psCanfd->TXBCIE = CANFD_ReadReg(&psCanfd->TXBCIE) | u32TXBCIE; -} - - -/** - * @brief Disables CAN FD interrupts according to provided mask . - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32IntLine0 The Interrupt Line 0 type select. - * @param[in] u32IntLine1 The Interrupt Line 1 type select. - * - \ref CANFD_IE_ARAE_Msk : Access to Reserved Address Interrupt - * - \ref CANFD_IE_PEDE_Msk : Protocol Error in Data Phase Interrupt - * - \ref CANFD_IE_PEAE_Msk : Protocol Error in Arbitration Phase Interrupt - * - \ref CANFD_IE_WDIE_Msk : Watchdog Interrupt - * - \ref CANFD_IE_BOE_Msk : Bus_Off Status Interrupt - * - \ref CANFD_IE_EWE_Msk : Warning Status Interrupt - * - \ref CANFD_IE_EPE_Msk : Error Passive Interrupt - * - \ref CANFD_IE_ELOE_Msk : Error Logging Overflow Interrupt - * - \ref CANFD_IE_BEUE_Msk : Bit Error Uncorrected Interrupt - * - \ref CANFD_IE_BECE_Msk : Bit Error Corrected Interrupt - * - \ref CANFD_IE_DRXE_Msk : Message stored to Dedicated Rx Buffer Interrupt - * - \ref CANFD_IE_TOOE_Msk : Timeout Occurred Interrupt - * - \ref CANFD_IE_MRAFE_Msk : Message RAM Access Failure Interrupt - * - \ref CANFD_IE_TSWE_Msk : Timestamp Wraparound Interrupt - * - \ref CANFD_IE_TEFLE_Msk : Tx Event FIFO Event Lost Interrupt - * - \ref CANFD_IE_TEFFE_Msk : Tx Event FIFO Full Interrupt - * - \ref CANFD_IE_TEFWE_Msk : Tx Event FIFO Watermark Reached Interrupt - * - \ref CANFD_IE_TEFNE_Msk : Tx Event FIFO New Entry Interrupt - * - \ref CANFD_IE_TFEE_Msk : Tx FIFO Empty Interrupt - * - \ref CANFD_IE_TCFE_Msk : Transmission Cancellation Finished Interrupt - * - \ref CANFD_IE_TCE_Msk : Transmission Completed Interrupt - * - \ref CANFD_IE_HPME_Msk : High Priority Message Interrupt - * - \ref CANFD_IE_RF1LE_Msk : Rx FIFO 1 Message Lost Interrupt - * - \ref CANFD_IE_RF1FE_Msk : Rx FIFO 1 Full Interrupt - * - \ref CANFD_IE_RF1WE_Msk : Rx FIFO 1 Watermark Reached Interrupt - * - \ref CANFD_IE_RF1NE_Msk : Rx FIFO 1 New Message Interrupt - * - \ref CANFD_IE_RF0LE_Msk : Rx FIFO 0 Message Lost Interrupt - * - \ref CANFD_IE_RF0FE_Msk : Rx FIFO 0 Full Interrupt - * - \ref CANFD_IE_RF0WE_Msk : Rx FIFO 0 Watermark Reached Interrupt - * - \ref CANFD_IE_RF0NE_Msk : Rx FIFO 0 New Message Interrupt - * - * @param[in] u32TXBTIE Disable Tx Buffer Transmission 0-31 Interrupt. - * @param[in] u32TXBCIE Disable Tx Buffer Cancellation Finished 0-31 Interrupt. - * @return None. - * - * @details This macro disable specified CAN FD interrupt. - */ -void CANFD_DisableInt(CANFD_T *psCanfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE) -{ - psCanfd->IE = CANFD_ReadReg(&psCanfd->IE) & ~(u32IntLine0 | u32IntLine1); - - if (u32IntLine0 != 0) - { - /* Cancel specified interrupt event of Line0. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) | u32IntLine0; - } - if (CANFD_ReadReg(&psCanfd->ILS) == ~0) - { - /* Disable Line0 interrupt */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) & ~CANFD_ILE_ENT0_Msk; - } - - if (u32IntLine1 != 0) - { - /* Select specified interrupt event of Line1. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) & ~u32IntLine1; - } - if (CANFD_ReadReg(&psCanfd->ILS) == 0) - { - /* Disable Line1 interrupt */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) & ~CANFD_ILE_ENT1_Msk; - } - - /*Setting the Tx Buffer Transmission Interrupt Disable*/ - psCanfd->TXBTIE = CANFD_ReadReg(&psCanfd->TXBTIE) & ~u32TXBTIE; - - /*Tx Buffer Cancellation Finished Interrupt Disable*/ - psCanfd->TXBCIE = CANFD_ReadReg(&psCanfd->TXBCIE) & ~u32TXBCIE; -} - - -/** - * @brief Copy Tx Message to TX buffer and Request transmission. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxBufIdx The Message Buffer index. - * @param[in] psTxMsg Message to be copied. - * - * @return number of tx requests set: 0= Tx Message Buffer is currently in use. - * 1= Write Tx Message Buffer Successfully. - * - * @details Copy Tx Message to FIFO/Queue TX buffer and Request transmission. - */ -uint32_t CANFD_TransmitTxMsg(CANFD_T *psCanfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg) -{ - uint32_t u32Success = 0; - uint32_t u32TimeOutCnt = CANFD_TIMEOUT; - - /* write the message to the message buffer */ - u32Success = CANFD_TransmitDMsg(psCanfd, u32TxBufIdx, psTxMsg); - - if (u32Success == 1) - { - /* wait for completion */ - while (!(psCanfd->TXBRP & (1UL << u32TxBufIdx))) - { - if (--u32TimeOutCnt == 0) - { - u32Success = 0; - break; - } - - } - } - - return u32Success; -} - - -/** - * @brief Writes a Tx Message to Transmit Message Buffer. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32TxBufIdx The Message Buffer index. - * @param[in] psTxMsg Pointer to CAN FD message frame to be sent. - * - * @return 1 Write Tx Message Buffer Successfully. - * 0 Tx Message Buffer is currently in use. - * - * @details This function writes a CANFD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CANFD Message transmit. After - * that the function returns immediately. - */ -uint32_t CANFD_TransmitDMsg(CANFD_T *psCanfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg) -{ - CANFD_BUF_T *psTxBuffer; - uint32_t u32Idx = 0, u32Success = 1; - uint32_t u32TimeOutCnt = CANFD_TIMEOUT; - - if (u32TxBufIdx >= CANFD_MAX_TX_BUF_ELEMS) return 0; - - /* transmission is pending in this message buffer */ - if (CANFD_ReadReg(&(psCanfd->TXBRP)) & (1UL << u32TxBufIdx)) return 0; - - /*Get the TX Buffer Start Address in the RAM*/ - psTxBuffer = (CANFD_BUF_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (CANFD_ReadReg(&psCanfd->TXBC) & 0xFFFF) + (u32TxBufIdx * sizeof(CANFD_BUF_T))); - - if (psTxMsg->eIdType == eCANFD_XID) - { - psTxBuffer->u32Id = TX_BUFFER_T0_ELEM_XTD_Msk | (psTxMsg->u32Id & 0x1FFFFFFF); - } - else - { - psTxBuffer->u32Id = (psTxMsg->u32Id & 0x7FF) << 18; - } - - if (psTxMsg->eFrmType == eCANFD_REMOTE_FRM) psTxBuffer->u32Id |= TX_BUFFER_T0_ELEM_RTR_Msk; - - psTxBuffer->u32Config = (CANFD_EncodeDLC(psTxMsg->u32DLC) << 16); - - if (psTxMsg->bFDFormat) psTxBuffer->u32Config |= TX_BUFFER_T1_ELEM_FDF_Msk; - - if (psTxMsg->bBitRateSwitch) psTxBuffer->u32Config |= TX_BUFFER_T1_ELEM_BSR_Msk; - - - for (u32Idx = 0; u32Idx < (psTxMsg->u32DLC + (4 - 1)) / 4; u32Idx++) - { - psTxBuffer->au32Data[u32Idx] = psTxMsg->au32Data[u32Idx]; - } - - while (CANFD_GET_COMMUNICATION_STATE(psCanfd) != eCANFD_IDLE) - { - if (--u32TimeOutCnt == 0) return 0; - } - - psCanfd->TXBAR = (1 << u32TxBufIdx); - - return u32Success; -} - - -/** - * @brief Global Filter Configuration (GFC). - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] eNMStdFrm Accept/Reject Non-Matching Standard(11-bits) Frames. - * @param[in] eEMExtFrm Accept/Reject Non-Matching Extended(29-bits) Frames. - * @param[in] u32RejRmtStdFrm Reject/Filter Remote Standard Frames. - * @param[in] u32RejRmtExtFrm Reject/Filter Remote Extended Frames. - * - * @return None. - * - * @details Global Filter Configuration. - */ -void CANFD_SetGFC(CANFD_T *psCanfd, E_CANFD_ACC_NON_MATCH_FRM eNMStdFrm, E_CANFD_ACC_NON_MATCH_FRM eEMExtFrm, uint32_t u32RejRmtStdFrm, uint32_t u32RejRmtExtFrm) -{ - psCanfd->GFC &= ~(CANFD_GFC_ANFS_Msk | CANFD_GFC_ANFE_Msk | CANFD_GFC_RRFS_Msk | CANFD_GFC_RRFE_Msk); - psCanfd->GFC = (eNMStdFrm << CANFD_GFC_ANFS_Pos) | - (eEMExtFrm << CANFD_GFC_ANFE_Pos) | - (u32RejRmtStdFrm << CANFD_GFC_RRFS_Pos) | - (u32RejRmtExtFrm << CANFD_GFC_RRFE_Pos); -} - - -/** - * @brief Rx FIFO Configuration for RX_FIFO_0 and RX_FIFO_1. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32RxFifoNum 0: RX FIFO_0, 1: RX_FIFO_1. - * @param[in] psRamConfig Rx FIFO Size in number of configuration ram address. - * @param[in] psElemSize Rx FIFO Size in number of Rx FIFO elements (element number (max. = 64)). - * @param[in] u32FifoWM Watermark in number of Rx FIFO elements - * @param[in] eFifoSize Maximum data field size that should be stored in this Rx FIFO - * (configure BYTE64 if you are unsure, as this is the largest data field allowed in CAN FD) - * - * @return None. - * - * @details Rx FIFO Configuration for RX_FIFO_0 and RX_FIFO_1. - */ -static void CANFD_InitRxFifo(CANFD_T *psCanfd, uint32_t u32RxFifoNum, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWM, E_CANFD_DATA_FIELD_SIZE eFifoSize) -{ - uint32_t u32Address; - uint32_t u32Size; - - /* ignore if index is too high */ - if (u32RxFifoNum > CANFD_NUM_RX_FIFOS)return; - - /* ignore if index is too high */ - if (psElemSize-> u32RxFifo0 > CANFD_MAX_RX_FIFO0_ELEMS) return; - - /* ignore if index is too high */ - if (psElemSize-> u32RxFifo1 > CANFD_MAX_RX_FIFO1_ELEMS) return; - - switch (u32RxFifoNum) - { - case 0: - if (psElemSize-> u32RxFifo0) - { - /* set size of Rx FIFO 0, set offset, blocking mode */ - psCanfd->RXF0C = (psRamConfig->u32RXF0C_F0SA) | (psElemSize->u32RxFifo0 << CANFD_RXF0C_F0S_Pos) - | (u32FifoWM << CANFD_RXF0C_F0WM_Pos); - psCanfd->RXESC = (psCanfd->RXESC & (~CANFD_RXESC_F0DS_Msk)) | (eFifoSize << CANFD_RXESC_F0DS_Pos); - - /*Get the RX FIFO 0 Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32RXF0C_F0SA & CANFD_RXF0C_F0SA_Msk); - u32Size = eFifoSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the RX FIFO 0 Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32RxFifo0)); - } - else - { - psCanfd->RXF0C = 0; - } - - break; - - case 1: - if (psElemSize-> u32RxFifo1) - { - /* set size of Rx FIFO 1, set offset, blocking mode */ - psCanfd->RXF1C = (psRamConfig->u32RXF1C_F1SA) | (psElemSize->u32RxFifo1 << CANFD_RXF1C_F1S_Pos) - | (u32FifoWM << CANFD_RXF1C_F1WM_Pos); - psCanfd->RXESC = (psCanfd->RXESC & (~CANFD_RXESC_F1DS_Msk)) | (eFifoSize << CANFD_RXESC_F1DS_Pos); - - /*Get the RX FIFO 1 Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32RXF1C_F1SA & CANFD_RXF1C_F1SA_Msk); - - u32Size = eFifoSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the RX FIFO 0 Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32RxFifo1)); - } - else - { - psCanfd->RXF1C = 0; - } - - break; - } -} - - -/** - * @brief Function configures the data structures used by a dedicated Rx Buffer. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Tx buffer configuration ram address. - * @param[in] psElemSize Tx buffer configuration element size. - * @param[in] eTxBufSize Maximum data field size that should be stored in a dedicated Tx Buffer - * (configure BYTE64 if you are unsure, as this is the largest data field allowed in CAN FD)largest data field allowed in CAN FD) - * - * @return None. - * - * @details Function configures the data structures used by a dedicated Rx Buffer. - */ -static void CANFD_InitTxDBuf(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eTxBufSize) -{ - uint32_t u32Address; - uint32_t u32Size; - - /*Setting the Tx Buffer Start Address*/ - psCanfd->TXBC = ((psElemSize->u32TxBuf & 0x3F) << CANFD_TXBC_NDTB_Pos) | (psRamConfig->u32TXBC_TBSA & CANFD_TXBC_TBSA_Msk); - - /*Get the TX Buffer Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32TXBC_TBSA & CANFD_TXBC_TBSA_Msk); - - /*Setting the Tx Buffer Data Field Size*/ - psCanfd->TXESC = (psCanfd->TXESC & (~CANFD_TXESC_TBDS_Msk)) | (eTxBufSize << CANFD_TXESC_TBDS_Pos); - - /*Get the Buffer Data Field Size*/ - u32Size = eTxBufSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the TX Buffer Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32TxBuf)); -} - - -/** - * @brief Function configures the data structures used by a dedicated Rx Buffer. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Rx buffer configuration ram address. - * @param[in] psElemSize Rx buffer configuration element size. - * @param[in] eRxBufSize Maximum data field size that should be stored in a dedicated Rx Buffer - * (configure BYTE64 if you are unsure, as this is the largest data field allowed in CAN FD)largest data field allowed in CAN FD) - * - * @return None. - * - * @details Function configures the data structures used by a dedicated Rx Buffer. - */ -static void CANFD_InitRxDBuf(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eRxBufSize) -{ - uint32_t u32Address; - uint32_t u32Size; - - /*Setting the Rx Buffer Start Address*/ - psCanfd->RXBC = (psRamConfig->u32RXBC_RBSA & CANFD_RXBC_RBSA_Msk); - - /*Get the RX Buffer Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32RXBC_RBSA & CANFD_RXBC_RBSA_Msk); - - /*Setting the Rx Buffer Data Field Size*/ - psCanfd->RXESC = (psCanfd->RXESC & (~CANFD_RXESC_RBDS_Msk)) | (eRxBufSize << CANFD_RXESC_RBDS_Pos); - /*Get the Buffer Data Field Size*/ - u32Size = eRxBufSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the RX Buffer Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32RxBuf)); -} - - -/** - * @brief Configures the register SIDFC for the 11-bit Standard Message ID Filter elements. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Standard ID filter configuration ram address - * @param[in] psElemSize Standard ID filter configuration element size - * - * @return None. - * - * @details Function configures the data structures used by a dedicated Rx Buffer. - */ -static void CANFD_ConfigSIDFC(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize) -{ - uint32_t u32Address; - - /*Setting the Filter List Standard Start Address and List Size */ - psCanfd->SIDFC = ((psElemSize->u32SIDFC & 0xFF) << CANFD_SIDFC_LSS_Pos) | (psRamConfig->u32SIDFC_FLSSA & CANFD_SIDFC_FLSSA_Msk); - - /*Get the Filter List Standard Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32SIDFC_FLSSA & CANFD_SIDFC_FLSSA_Msk); - - /*Clear the Filter List Memory*/ - memset((uint32_t *)(u32Address), 0x00, (psElemSize->u32SIDFC * sizeof(CANFD_STD_FILTER_T))); -} - - -/** - * @brief Configures the register XIDFC for the 29-bit Extended Message ID Filter elements. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Extended ID filter configuration ram address - * @param[in] psElemSize Extended ID filter configuration element size - * - * @return None. - * - * @details Configures the register XIDFC for the 29-bit Extended Message ID Filter elements. - */ -static void CANFD_ConfigXIDFC(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize) -{ - uint32_t u32Address; - - /*Setting the Filter List Extended Start Address and List Size */ - psCanfd->XIDFC = ((psElemSize->u32XIDFC & 0xFF) << CANFD_XIDFC_LSE_Pos) | (psRamConfig->u32XIDFC_FLESA & CANFD_XIDFC_FLESA_Msk); - - /*Get the Filter List Standard Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32XIDFC_FLESA & CANFD_XIDFC_FLESA_Msk); - - /*Clear the Filter List Memory*/ - memset((uint32_t *)(u32Address), 0x00, (psElemSize->u32XIDFC * sizeof(CANFD_EXT_FILTER_T))); -} - - -/** - * @brief Writes a 11-bit Standard ID filter element in the Message RAM. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32FltrIdx Index at which the filter element should be written in the '11-bit Filter' section of Message RAM - * @param[in] u32Filter Rx Individual filter value. - * - * @return None. - * - * @details Writes a 11-bit Standard ID filter element in the Message RAM. - */ -void CANFD_SetSIDFltr(CANFD_T *psCanfd, uint32_t u32FltrIdx, uint32_t u32Filter) -{ - CANFD_STD_FILTER_T *psFilter; - - /* ignore if index is too high */ - if (u32FltrIdx >= CANFD_MAX_11_BIT_FTR_ELEMS) return; - - /*Get the Filter List Configuration Address in the RAM*/ - psFilter = (CANFD_STD_FILTER_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (psCanfd->SIDFC & CANFD_SIDFC_FLSSA_Msk) + (u32FltrIdx * sizeof(CANFD_STD_FILTER_T))); - - /*Wirted the Standard ID filter element to RAM */ - psFilter->VALUE = u32Filter; -} - - -/** - * @brief Writes a 29-bit extended id filter element in the Message RAM. - * Size of an Extended Id filter element is 2 words. So 2 words are written into the Message RAM for each filter element - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32FltrIdx Index at which the filter element should be written in the '29-bit Filter' section of Message RAM. - * @param[in] u32FilterLow Rx Individual filter low value. - * @param[in] u32FilterHigh Rx Individual filter high value. - * - * @return None. - * - * @details Writes a 29-bit extended id filter element in the Message RAM. - */ -void CANFD_SetXIDFltr(CANFD_T *psCanfd, uint32_t u32FltrIdx, uint32_t u32FilterLow, uint32_t u32FilterHigh) -{ - CANFD_EXT_FILTER_T *psFilter; - - /* ignore if index is too high */ - if (u32FltrIdx >= CANFD_MAX_29_BIT_FTR_ELEMS) return; - - /*Get the Filter List Configuration Address on RAM*/ - psFilter = (CANFD_EXT_FILTER_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (psCanfd->XIDFC & CANFD_XIDFC_FLESA_Msk) + (u32FltrIdx * sizeof(CANFD_EXT_FILTER_T))); - - /*Wirted the Extended ID filter element to RAM */ - psFilter->LOWVALUE = u32FilterLow; - psFilter->HIGHVALUE = u32FilterHigh; -} - - -/** - * @brief Reads a CAN FD Message from Receive Message Buffer. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u8MbIdx The CANFD Message Buffer index. - * @param[in] psMsgBuf Pointer to CAN FD message frame structure for reception. - * - * @return 1:Rx Message Buffer is full and has been read successfully. - * 0:Rx Message Buffer is empty. - * - * @details This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with just received data - * and activates the Message Buffer again.The function returns immediately. -*/ -uint32_t CANFD_ReadRxBufMsg(CANFD_T *psCanfd, uint8_t u8MbIdx, CANFD_FD_MSG_T *psMsgBuf) -{ - CANFD_BUF_T *psRxBuffer; - uint32_t u32Success = 0; - uint32_t newData = 0; - - if (u8MbIdx < CANFD_MAX_RX_BUF_ELEMS) - { - if (u8MbIdx < 32) - newData = (CANFD_ReadReg(&psCanfd->NDAT1) >> u8MbIdx) & 1; - else - newData = (CANFD_ReadReg(&psCanfd->NDAT2) >> (u8MbIdx - 32)) & 1; - - /* new message is waiting to be read */ - if (newData) - { - /* get memory location of rx buffer */ - psRxBuffer = (CANFD_BUF_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (CANFD_ReadReg(&psCanfd->RXBC) & 0xFFFF) + (u8MbIdx * sizeof(CANFD_BUF_T))); - - /* read the message */ - CANFD_CopyDBufToMsgBuf(psRxBuffer, psMsgBuf); - - /* clear 'new data' flag */ - if (u8MbIdx < 32) - psCanfd->NDAT1 = CANFD_ReadReg(&psCanfd->NDAT1) | (1UL << u8MbIdx); - else - psCanfd->NDAT2 = CANFD_ReadReg(&psCanfd->NDAT2) | (1UL << (u8MbIdx - 32)); - - u32Success = 1; - } - } - - return u32Success; -} - - -/** - * @brief Reads a CAN FD Message from Rx FIFO. - * - * @param[in] psCanfd The pointer of the specified CANFD module. - * @param[in] u8FifoIdx Number of the FIFO, 0 or 1. - * @param[in] psMsgBuf Pointer to CANFD message frame structure for reception. - * - * @return 1 Read Message from Rx FIFO successfully. - * 2 Rx FIFO is already overflowed and has been read successfully - * 0 Rx FIFO is not enabled. - * - * @details This function reads a CAN message from the CANFD build-in Rx FIFO. - */ -uint32_t CANFD_ReadRxFifoMsg(CANFD_T *psCanfd, uint8_t u8FifoIdx, CANFD_FD_MSG_T *psMsgBuf) -{ - CANFD_BUF_T *pRxBuffer; - uint8_t GetIndex; - uint32_t u32Success = 0; - __I uint32_t *pRXFS; - __IO uint32_t *pRXFC, *pRXFA; - uint8_t msgLostBit; - - /* check for valid FIFO number */ - if (u8FifoIdx < CANFD_NUM_RX_FIFOS) - { - if (u8FifoIdx == 0) - { - pRXFS = &(psCanfd->RXF0S); - pRXFC = &(psCanfd->RXF0C); - pRXFA = &(psCanfd->RXF0A); - msgLostBit = 3; - } - else - { - pRXFS = &(psCanfd->RXF1S); - pRXFC = &(psCanfd->RXF1C); - pRXFA = &(psCanfd->RXF1A); - msgLostBit = 7; - } - - /* if FIFO is not empty */ - if ((CANFD_ReadReg(pRXFS) & 0x7F) > 0) - { - GetIndex = (uint8_t)((CANFD_ReadReg(pRXFS) >> 8) & 0x3F); - pRxBuffer = (CANFD_BUF_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (CANFD_ReadReg(pRXFC) & 0xFFFF) + (GetIndex * sizeof(CANFD_BUF_T))); - - CANFD_CopyRxFifoToMsgBuf(pRxBuffer, psMsgBuf); - - /* we got the message */ - *pRXFA = GetIndex; - - /* check for overflow */ - if (CANFD_ReadReg(pRXFS) & CANFD_RXFS_RFL) - { - /* clear overflow flag */ - psCanfd->IR = (1UL << msgLostBit); - u32Success = 2; - } - else - { - u32Success = 1; - } - } - } - - return u32Success; -} - - -/** - * @brief Copies a message from a dedicated Rx buffer into a message buffer. - * - * @param[in] psRxBuf Buffer to read from. - * @param[in] psMsgBuf Location to store read message. - * - * @return None. - * - * @details Copies a message from a dedicated Rx buffer into a message buffer. - */ -void CANFD_CopyDBufToMsgBuf(CANFD_BUF_T *psRxBuf, CANFD_FD_MSG_T *psMsgBuf) -{ - uint32_t u32Idx; - - if (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Msk) - psMsgBuf->bErrStaInd = TRUE; - else - psMsgBuf->bErrStaInd = FALSE; - - /* if 29-bit ID */ - if (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Msk) - { - psMsgBuf->u32Id = (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_ID_Msk); - psMsgBuf->eIdType = eCANFD_XID; - } - /* if 11-bit ID */ - else - { - psMsgBuf->u32Id = (psRxBuf->u32Id >> 18) & 0x7FF; - psMsgBuf->eIdType = eCANFD_SID; - } - - if (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Msk) - psMsgBuf->eFrmType = eCANFD_REMOTE_FRM; - else - psMsgBuf->eFrmType = eCANFD_DATA_FRM; - - - if (psRxBuf->u32Config & RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Msk) - psMsgBuf->bFDFormat = TRUE; - else - psMsgBuf->bFDFormat = FALSE; - - if (psRxBuf->u32Config & RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Msk) - psMsgBuf->bBitRateSwitch = TRUE; - else - psMsgBuf->bBitRateSwitch = FALSE; - - psMsgBuf->u32DLC = CANFD_DecodeDLC((psRxBuf->u32Config & RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Msk) >> RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Pos); - - for (u32Idx = 0 ; u32Idx < psMsgBuf->u32DLC ; u32Idx++) - { - psMsgBuf->au8Data[u32Idx] = psRxBuf->au8Data[u32Idx]; - } -} - - -/** - * @brief Get Rx FIFO water level. - * - * @param[in] psCanfd The pointer to CANFD module base address. - * @param[in] u32RxFifoNum 0: RX FIFO_0, 1: RX_FIFO_1 - * - * @return Rx FIFO water level. - * - * @details Get Rx FIFO water level. - */ -uint32_t CANFD_GetRxFifoWaterLvl(CANFD_T *psCanfd, uint32_t u32RxFifoNum) -{ - uint32_t u32WaterLevel = 0; - - if (u32RxFifoNum == 0) - u32WaterLevel = ((CANFD_ReadReg(&psCanfd->RXF0C) & CANFD_RXF0C_F0WM_Msk) >> CANFD_RXF0C_F0WM_Pos); - else - u32WaterLevel = ((CANFD_ReadReg(&psCanfd->RXF1C) & CANFD_RXF1C_F1WM_Msk) >> CANFD_RXF1C_F1WM_Pos); - - return u32WaterLevel; -} - - -/** - * @brief Copies messages from FIFO into a message buffert. - * - * @param[in] psRxBuf Buffer to read from. - * @param[in] psMsgBuf Location to store read message. - * - * @return None. - * - * @details Copies messages from FIFO into a message buffert. - */ -void CANFD_CopyRxFifoToMsgBuf(CANFD_BUF_T *psRxBuf, CANFD_FD_MSG_T *psMsgBuf) -{ - /*Copies a message from a dedicated Rx FIFO into a message buffer*/ - CANFD_CopyDBufToMsgBuf(psRxBuf, psMsgBuf); -} - - -/** - * @brief Cancel a Tx buffer transmission request. - * - * @param[in] psCanfd The pointer to CANFD module base address. - * @param[in] u32TxBufIdx Tx buffer index number - * - * @return None. - * - * @details Cancel a Tx buffer transmission request. - */ -void CANFD_TxBufCancelReq(CANFD_T *psCanfd, uint32_t u32TxBufIdx) -{ - psCanfd->TXBCR = CANFD_ReadReg(&psCanfd->TXBCR) | (0x1ul << u32TxBufIdx); -} - - -/** - * @brief Checks if a Tx buffer cancellation request has been finished or not. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxBufIdx Tx buffer index number - * - * @return 0: cancellation finished. - * 1: cancellation fail - * - * @details Checks if a Tx buffer cancellation request has been finished or not. - */ -uint32_t CANFD_IsTxBufCancelFin(CANFD_T *psCanfd, uint32_t u32TxBufIdx) -{ - /* wait for completion */ - return ((CANFD_ReadReg(&psCanfd->TXBCR) & (0x1ul << u32TxBufIdx)) >> u32TxBufIdx); -} - - -/** - * @brief Checks if a Tx buffer transmission has occurred or not. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxBufIdx Tx buffer index number - * - * @return 0: No transmission occurred. - * 1: Transmission occurred - * - * @details Checks if a Tx buffer transmission has occurred or not. - */ -uint32_t CANFD_IsTxBufTransmitOccur(CANFD_T *psCanfd, uint32_t u32TxBufIdx) -{ - return ((CANFD_ReadReg(&psCanfd->TXBTO) & (0x1ul << u32TxBufIdx)) >> u32TxBufIdx); -} - - -/** - * @brief Init Tx event fifo - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Tx Event Fifo configuration ram address. - * @param[in] psElemSize Tx Event Fifo configuration element size - * @param[in] u32FifoWaterLvl FIFO water level - * - * @return None. - * - * @details Init Tx event fifo. - */ -static void CANFD_InitTxEvntFifo(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWaterLvl) -{ - /* Set TX Event FIFO element size,watermark,start address. */ - psCanfd->TXEFC = (u32FifoWaterLvl << CANFD_TXEFC_EFWN_Pos) | (psElemSize->u32TxEventFifo << CANFD_TXEFC_EFS_Pos) - | (psRamConfig->u32TXEFC_EFSA & CANFD_TXEFC_EFSA_Msk); -} - - -/** - * @brief Get Tx event fifo water level - * - * @param[in] psCanfd The pointer to CANFD module base address. - * - * @return Tx event fifo water level. - * - * @details Get Tx event fifo water level. - */ -uint32_t CANFD_GetTxEvntFifoWaterLvl(CANFD_T *psCanfd) -{ - return ((CANFD_ReadReg(&psCanfd->TXEFC) & CANFD_TXEFC_EFWN_Msk) >> CANFD_TXEFC_EFWN_Pos); -} - - -/** - * @brief Copy Event Elements from TX Event FIFO to user buffer - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxEvntNum Tx Event FIFO number - * @param[in] psTxEvntElem Tx Event Message struct - * - * @return None. - * - * @details Copy all Event Elements from TX Event FIFO to the Software Event List . - */ -void CANFD_CopyTxEvntFifoToUsrBuf(CANFD_T *psCanfd, uint32_t u32TxEvntNum, CANFD_TX_EVNT_ELEM_T *psTxEvntElem) -{ - uint32_t *pu32TxEvnt; - /*Get the Tx Event FIFO Address*/ - pu32TxEvnt = (uint32_t *)CANFD_GetTxBufferElementAddress(psCanfd, u32TxEvntNum); - - /*Get the Error State Indicator*/ - if ((pu32TxEvnt[0] & TX_FIFO_E0_EVENT_ESI_Msk) > 0) - psTxEvntElem->bErrStaInd = TRUE; //Transmitting node is error passive - else - psTxEvntElem->bErrStaInd = FALSE;//Transmitting node is error active - - /*Get the Tx FIFO Identifier type and Identifier*/ - - if ((pu32TxEvnt[0] & TX_FIFO_E0_EVENT_XTD_Msk) > 0) - { - psTxEvntElem-> eIdType = eCANFD_XID; - psTxEvntElem->u32Id = (pu32TxEvnt[0] & TX_FIFO_E0_EVENT_ID_Msk);// Extended ID - } - else - { - psTxEvntElem-> eIdType = eCANFD_SID; - psTxEvntElem->u32Id = (pu32TxEvnt[0] & TX_FIFO_E0_EVENT_ID_Msk) >> 18;// Standard ID - } - - /*Get the Frame type*/ - if ((pu32TxEvnt[0] & TX_FIFO_E0_EVENT_RTR_Msk) > 0) - psTxEvntElem->bRemote = TRUE; //Remote frame - else - psTxEvntElem->bRemote = FALSE; //Data frame - - /*Get the FD Format type*/ - if ((pu32TxEvnt[0] & TX_FIFO_E1_EVENT_FDF_Msk) > 0) - psTxEvntElem->bFDFormat = TRUE; //CAN FD frame format - else - psTxEvntElem->bFDFormat = FALSE; //Classical CAN frame format - - /*Get the Bit Rate Switch type*/ - if ((pu32TxEvnt[0] & TX_FIFO_E1_EVENT_BRS_Msk) > 0) - psTxEvntElem->bBitRateSwitch = TRUE; //Frame transmitted with bit rate switching - else - psTxEvntElem->bBitRateSwitch = FALSE; //Frame transmitted without bit rate switching - - /*Get the Tx FIFO Data Length */ - psTxEvntElem->u32DLC = CANFD_DecodeDLC((uint8_t)((pu32TxEvnt[1] & TX_FIFO_E1_EVENT_DLC_Msk) >> TX_FIFO_E1_EVENT_DLC_Pos)); - - /*Get the Tx FIFO Timestamp */ - psTxEvntElem->u32TxTs = (((pu32TxEvnt[1] & TX_FIFO_E1A_EVENT_TXTS_Msk) >> TX_FIFO_E1A_EVENT_TXTS_Pos)); - /*Get the Tx FIFO Message marker */ - psTxEvntElem->u32MsgMarker = (((pu32TxEvnt[1] & TX_FIFO_E1_EVENT_MM_Msk) >> TX_FIFO_E1_EVENT_MM_Pos)); -} - - -/** - * @brief Get CAN FD interrupts status. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref CANFD_IR_ARA_Msk : Access to Reserved Address interrupt Indicator - * - \ref CANFD_IR_PED_Msk : Protocol Error in Data Phase interrupt Indicator - * - \ref CANFD_IR_PEA_Msk : Protocol Error in Arbitration Phase interrupt Indicator - * - \ref CANFD_IR_WDI_Msk : Watchdog interrupt Indicator - * - \ref CANFD_IR_BO_Msk : Bus_Off Status interrupt Indicator - * - \ref CANFD_IR_EW_Msk : Warning Status interrupt Indicator - * - \ref CANFD_IR_EP_Msk : Error Passive interrupt Indicator - * - \ref CANFD_IR_ELO_Msk : Error Logging Overflow interrupt Indicator - * - \ref CANFD_IR_DRX_Msk : Message stored to Dedicated Rx Buffer interrupt Indicator - * - \ref CANFD_IR_TOO_Msk : Timeout Occurred interrupt Indicator - * - \ref CANFD_IR_MRAF_Msk : Message RAM Access Failure interrupt Indicator - * - \ref CANFD_IR_TSW_Msk : Timestamp Wraparound interrupt Indicator - * - \ref CANFD_IR_TEFL_Msk : Tx Event FIFO Event Lost interrupt Indicator - * - \ref CANFD_IR_TEFF_Msk : Tx Event FIFO Full Indicator - * - \ref CANFD_IR_TEFW_Msk : Tx Event FIFO Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_TEFN_Msk : Tx Event FIFO New Entry Interrupt Indicator - * - \ref CANFD_IR_TFE_Msk : Tx FIFO Empty Interrupt Indicator - * - \ref CANFD_IR_TCF_Msk : Transmission Cancellation Finished Interrupt Indicator - * - \ref CANFD_IR_TC_Msk : Transmission Completed interrupt Indicator - * - \ref CANFD_IR_HPM_Msk : High Priority Message Interrupt Indicator - * - \ref CANFD_IR_RF1L_Msk : Rx FIFO 1 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF1F_Msk : Rx FIFO 1 Full Interrupt Indicator - * - \ref CANFD_IR_RF1W_Msk : Rx FIFO 1 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF1N_Msk : Rx FIFO 1 New Message Interrupt Indicator - * - \ref CANFD_IR_RF0L_Msk : Rx FIFO 0 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF0F_Msk : Rx FIFO 0 Full Interrupt Indicator - * - \ref CANFD_IR_RF0W_Msk : Rx FIFO 0 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF0N_Msk : Rx FIFO 0 New Message Interrupt Indicator - * - * @return None. - * - * @details This function gets all CAN FD interrupt status flags. - */ -uint32_t CANFD_GetStatusFlag(CANFD_T *psCanfd, uint32_t u32IntTypeFlag) -{ - return (CANFD_ReadReg(&psCanfd->IR) & u32IntTypeFlag); -} - - -/** - * @brief Clears the CAN FD module interrupt flags - * - * @param[in] psCanfd The pointer of the specified CANFD module. - * @param[in] u32InterruptFlag The specified interrupt of CAN FD module - * - \ref CANFD_IR_ARA_Msk : Access to Reserved Address interrupt Indicator - * - \ref CANFD_IR_PED_Msk : Protocol Error in Data Phase interrupt Indicator - * - \ref CANFD_IR_PEA_Msk : Protocol Error in Arbitration Phase interrupt Indicator - * - \ref CANFD_IR_WDI_Msk : Watchdog interrupt Indicator - * - \ref CANFD_IR_BO_Msk : Bus_Off Status interrupt Indicator - * - \ref CANFD_IR_EW_Msk : Warning Status interrupt Indicator - * - \ref CANFD_IR_EP_Msk : Error Passive interrupt Indicator - * - \ref CANFD_IR_ELO_Msk : Error Logging Overflow interrupt Indicator - * - \ref CANFD_IR_DRX_Msk : Message stored to Dedicated Rx Buffer interrupt Indicator - * - \ref CANFD_IR_TOO_Msk : Timeout Occurred interrupt Indicator - * - \ref CANFD_IR_MRAF_Msk : Message RAM Access Failure interrupt Indicator - * - \ref CANFD_IR_TSW_Msk : Timestamp Wraparound interrupt Indicator - * - \ref CANFD_IR_TEFL_Msk : Tx Event FIFO Event Lost interrupt Indicator - * - \ref CANFD_IR_TEFF_Msk : Tx Event FIFO Full Indicator - * - \ref CANFD_IR_TEFW_Msk : Tx Event FIFO Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_TEFN_Msk : Tx Event FIFO New Entry Interrupt Indicator - * - \ref CANFD_IR_TFE_Msk : Tx FIFO Empty Interrupt Indicator - * - \ref CANFD_IR_TCF_Msk : Transmission Cancellation Finished Interrupt Indicator - * - \ref CANFD_IR_TC_Msk : Transmission Completed interrupt Indicator - * - \ref CANFD_IR_HPM_Msk : High Priority Message Interrupt Indicator - * - \ref CANFD_IR_RF1L_Msk : Rx FIFO 1 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF1F_Msk : Rx FIFO 1 Full Interrupt Indicator - * - \ref CANFD_IR_RF1W_Msk : Rx FIFO 1 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF1N_Msk : Rx FIFO 1 New Message Interrupt Indicator - * - \ref CANFD_IR_RF0L_Msk : Rx FIFO 0 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF0F_Msk : Rx FIFO 0 Full Interrupt Indicator - * - \ref CANFD_IR_RF0W_Msk : Rx FIFO 0 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF0N_Msk : Rx FIFO 0 New Message Interrupt Indicator - * - * @return None. - * - * @details This function clears CAN FD interrupt status flags. - */ -void CANFD_ClearStatusFlag(CANFD_T *psCanfd, uint32_t u32InterruptFlag) -{ - /* Write 1 to clear status flag. */ - psCanfd->IR = CANFD_ReadReg(&psCanfd->IR) | u32InterruptFlag; -} - - -/** - * @brief Gets the CAN FD Bus Error Counter value. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] pu8TxErrBuf TxErrBuf Buffer to store Tx Error Counter value. - * @param[in] pu8RxErrBuf RxErrBuf Buffer to store Rx Error Counter value. - * - * @return None. - * - * @details This function gets the CAN FD Bus Error Counter value for both Tx and Rx direction. - * These values may be needed in the upper layer error handling. - */ -void CANFD_GetBusErrCount(CANFD_T *psCanfd, uint8_t *pu8TxErrBuf, uint8_t *pu8RxErrBuf) -{ - if (pu8TxErrBuf) - { - *pu8TxErrBuf = (uint8_t)((CANFD_ReadReg(&psCanfd->ECR) >> CANFD_ECR_TEC_Pos) & CANFD_ECR_TEC_Msk); - } - - if (pu8RxErrBuf) - { - *pu8RxErrBuf = (uint8_t)((CANFD_ReadReg(&psCanfd->ECR) >> CANFD_ECR_REC_Pos) & CANFD_ECR_REC_Msk); - } -} - - -/** - * @brief CAN FD Run to the Normal Operation. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u8Enable TxErrBuf Buffer to store Tx Error Counter value. - * - * @retval CANFD_OK CANFD operation OK. - * @retval CANFD_ERR_TIMEOUT CANFD operation abort due to timeout error. - * - * @details This function gets the CAN FD Bus Error Counter value for both Tx and Rx direction. - * These values may be needed in the upper layer error handling. - */ -int32_t CANFD_RunToNormal(CANFD_T *psCanfd, uint8_t u8Enable) -{ - uint32_t u32TimeOutCnt = CANFD_TIMEOUT; - - if (u8Enable) - { - /* start operation */ - psCanfd->CCCR = CANFD_ReadReg(&psCanfd->CCCR) & ~(CANFD_CCCR_CCE_Msk | CANFD_CCCR_INIT_Msk); - - while (psCanfd->CCCR & CANFD_CCCR_INIT_Msk) - { - if (--u32TimeOutCnt == 0) return CANFD_ERR_TIMEOUT; - } - } - else - { - /* init mode */ - psCanfd->CCCR = CANFD_ReadReg(&psCanfd->CCCR) | CANFD_CCCR_INIT_Msk | CANFD_CCCR_CCE_Msk; - - while (!(psCanfd->CCCR & CANFD_CCCR_INIT_Msk)) - { - if (--u32TimeOutCnt == 0) return CANFD_ERR_TIMEOUT; - } - } - - return CANFD_OK; -} - - - -/*@}*/ /* end of group CANFD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CANFD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ccap.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ccap.c deleted file mode 100644 index 55a41f6e123..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ccap.c +++ /dev/null @@ -1,406 +0,0 @@ -/**************************************************************************//** - * @file ccap.c - * @version V3.00 - * @brief M460 Series CCAP Driver Source File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CCAP_Driver CCAP Driver - @{ -*/ - -int32_t g_CCAP_i32ErrCode = 0; /*!< CCAP global error code */ - -/** @addtogroup CCAP_EXPORTED_FUNCTIONS CCAP Exported Functions - @{ -*/ - -/** - * @brief Open and set CCAP function - * - * @param[in] u32InFormat The bits corresponding VSP, HSP, PCLK, INFMT, SNRTYPE, OUTFMT and PDORD configurations. - * - VSP Sensor Vsync Polarity. It should be either \ref CCAP_PAR_VSP_LOW or \ref CCAP_PAR_VSP_HIGH - * - HSP Sensor Hsync Polarity. It should be either \ref CCAP_PAR_HSP_LOW or \ref CCAP_PAR_HSP_HIGH - * - PCLK Sensor Pixel Clock Polarity. It should be either \ref CCAP_PAR_PCLKP_LOW or \ref CCAP_PAR_PCLKP_HIGH - * - INFMT Sensor Input Data Format. It should be either \ref CCAP_PAR_INFMT_YUV422 or \ref CCAP_PAR_INFMT_RGB565 - * - SNRTYPE Sensor Input Type. It should be either \ref CCAP_PAR_SENTYPE_CCIR601 or \ref CCAP_PAR_SENTYPE_CCIR656 - * - PLNFMT Planar Output YUV Format - * - \ref 0 = YUV422 - * - OUTFMT Image Data Format Output to System Memory. It should be one of the following settings - * - \ref CCAP_PAR_OUTFMT_YUV422 - * - \ref CCAP_PAR_OUTFMT_ONLY_Y - * - \ref CCAP_PAR_OUTFMT_RGB555 - * - \ref CCAP_PAR_OUTFMT_RGB565 - * - PDORD Sensor Input Data Order. It should be one of the following settings - * - \ref CCAP_PAR_INDATORD_YUYV - * - \ref CCAP_PAR_INDATORD_YVYU - * - \ref CCAP_PAR_INDATORD_UYVY - * - \ref CCAP_PAR_INDATORD_VYUY - * - \ref CCAP_PAR_INDATORD_RGGB - * - \ref CCAP_PAR_INDATORD_BGGR - * - \ref CCAP_PAR_INDATORD_GBRG - * - \ref CCAP_PAR_INDATORD_GRBG - * @param[in] u32OutFormat Image Data Output Format. It should be - * - \ref CCAP_CTL_PKTEN - * - * @return None - * - * @details Initialize the Camera Capture Interface. - */ -void CCAP_Open(CCAP_T *ccap, uint32_t u32InFormat, uint32_t u32OutFormat) -{ - ccap->PAR = (ccap->PAR & ~(0x000007BFUL)) | u32InFormat; - ccap->CTL = (ccap->CTL & ~(0x00000060UL)) | u32OutFormat; -} - -/** - * @brief Set Cropping Window Starting Address and Size - * - * @param[in] u32VStart: Cropping Window Vertical Starting Address. It should be 0 ~ 0x7FF. - * @param[in] u32HStart: Cropping Window Horizontal Starting Address. It should be 0 ~ 0x7FF. - * @param[in] u32Height: Cropping Window Height. It should be 0 ~ 0x7FF. - * @param[in] u32Width: Cropping Window Width. It should be 0 ~ 0x7FF. - * - * @return None - * - * @details This function is used to set cropping window starting address and size. - */ -void CCAP_SetCroppingWindow(CCAP_T *ccap, uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width) -{ - ccap->CWSP = (ccap->CWSP & ~(CCAP_CWSP_CWSADDRV_Msk | CCAP_CWSP_CWSADDRH_Msk)) - | (((u32VStart << 16) | u32HStart)); - - ccap->CWS = (ccap->CWS & ~(CCAP_CWS_CWH_Msk | CCAP_CWS_CWW_Msk)) - | ((u32Height << 16) | u32Width); -} - -/** - * @brief Set System Memory Packet Base Address - * - * @param[in] u32Address: Set CCAP_PKTBA0 register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Packet Base Address 0 Register. - */ -void CCAP_SetPacketBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->PKTBA0 = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Set System Memory Planar Y Base Address - * - * @param[in] u32Address: Set CCAP_YBA register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Planar Y Base Address 0 Register. - */ -void CCAP_SetPlanarYBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->YBA = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Set System Memory Planar U Base Address - * - * @param[in] u32Address: Set CCAP_UBA register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Planar U Base Address 0 Register. - */ -void CCAP_SetPlanarUBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->UBA = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Set System Memory Planar V Base Address - * - * @param[in] u32Address: Set CCAP_VBA register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Planar V Base Address 0 Register. - */ -void CCAP_SetPlanarVBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->VBA = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Close Camera Capture Interface - * - * @param None - * - * @return None - * - * @details This function is used to disable Camera Capture Interface. - */ -void CCAP_Close(CCAP_T *ccap) -{ - ccap->CTL &= ~CCAP_CTL_CCAPEN; -} - -/** - * @brief Enable CCAP Interrupt - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CCAP_INT_VIEN_Msk - * - \ref CCAP_INT_MEIEN_Msk - * - \ref CCAP_INT_ADDRMIEN_Msk - * - * @return None - * - * @details This function is used to enable Video Frame End Interrupt, - * Bus Master Transfer Error Interrupt and Memory Address Match Interrupt. - */ -void CCAP_EnableInt(CCAP_T *ccap, uint32_t u32IntMask) -{ - ccap->INT = (ccap->INT & ~(CCAP_INT_VIEN_Msk | CCAP_INT_MEIEN_Msk | CCAP_INT_ADDRMIEN_Msk)) - | u32IntMask; -} - -/** - * @brief Disable CCAP Interrupt - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CCAP_INT_VINTF_Msk - * - \ref CCAP_INT_MEINTF_Msk - * - \ref CCAP_INT_ADDRMINTF_Msk - * - * @return None - * - * @details This function is used to disable Video Frame End Interrupt, - * Bus Master Transfer Error Interrupt and Memory Address Match Interrupt. - */ -void CCAP_DisableInt(CCAP_T *ccap, uint32_t u32IntMask) -{ - ccap->INT = (ccap->INT & ~(u32IntMask)); -} - -/** - * @brief Enable Monochrome CMOS Sensor - * - * @param[in] u32Interface Data I/O interface setting. It could be - * - \ref CCAP_CTL_MY8_MY4 - * - \ref CCAP_CTL_MY8_MY8 - * @return None - * - * @details This function is used to select monochrome CMOS sensor and set data width. - */ -void CCAP_EnableMono(CCAP_T *ccap, uint32_t u32Interface) -{ - ccap->CTL = (ccap->CTL & ~CCAP_CTL_MY8_MY4) | CCAP_CTL_MONO_Msk | u32Interface; -} - -/** - * @brief Disable Monochrome CMOS Sensor - * - * @param None - * - * @return None - * - * @details This function is used to disable monochrome CMOS sensor selection. - */ -void CCAP_DisableMono(CCAP_T *ccap) -{ - ccap->CTL &= ~CCAP_CTL_MONO_Msk; -} - -/** - * @brief Enable Luminance 8-bit Y to 1-bit Y Conversion - * - * @param[in] u32th Luminance Y8 to Y1 Threshold Value. It should be 0 ~ 255. - * - * @return None - * - * @details This function is used to enable luminance Y8 to Y1 function and set its threshold value. - */ -void CCAP_EnableLumaYOne(CCAP_T *ccap, uint32_t u32th) -{ - ccap->CTL |= CCAP_CTL_Luma_Y_One_Msk; - ccap->LUMA_Y1_THD = u32th & 0xff; -} - -/** - * @brief Disable Luminance 8-bit Y to 1-bit Y Conversion - * - * @param None - * - * @return None - * - * @details This function is used to disable luminance Y8 to Y1 function. - * - */ -void CCAP_DisableLumaYOne(CCAP_T *ccap) -{ - ccap->CTL &= ~CCAP_CTL_Luma_Y_One_Msk; -} - -/** - * @brief Start Camera Capture Interface - * - * @param None - * - * @return None - * - * @details This function is used to start Camera Capture Interface function. - */ -void CCAP_Start(CCAP_T *ccap) -{ - ccap->CTL |= CCAP_CTL_CCAPEN; -} - -/** - * @brief Stop Camera Capture Interface - * - * @param[in] u32FrameComplete: - * - \ref TRUE: Capture module disables the CCAP module automatically after a frame had been captured. - * - \ref FALSE: Stop Capture module now. - * - * @return None - * - * @details If u32FrameComplete is set to TRUE then get a new frame and disable CCAP module. - * - * @note This function sets g_CCAP_i32ErrCode to CCAP_TIMEOUT_ERR if the CCAP_IS_STOPPED() longer than expected. - */ -void CCAP_Stop(CCAP_T *ccap, uint32_t u32FrameComplete) -{ - uint32_t u32TimeOutCount = SystemCoreClock; - - if (u32FrameComplete == FALSE) - ccap->CTL &= ~CCAP_CTL_CCAPEN; - else - { - ccap->CTL |= CCAP_CTL_SHUTTER_Msk; - while (!CCAP_IS_STOPPED(ccap)) - { - if (--u32TimeOutCount == 0) - { - g_CCAP_i32ErrCode = CCAP_TIMEOUT_ERR; - break; - } - } - } -} - -/** - * @brief Set Packet Scaling Factor - * - * @param[in] u32VNumerator: Packet Scaling Vertical Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32VDenominator: Packet Scaling Vertical Factor M. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HNumerator: Packet Scaling Horizontal Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HDenominator: Packet Scaling Horizontal Factor M. It should be 0x0 ~ 0xFFFF. - * - * @return None - * - * @details This function is used to set Packet Scaling Vertical and Horizontal Factor register. - */ -void CCAP_SetPacketScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator) -{ - uint32_t u32NumeratorL, u32NumeratorH; - uint32_t u32DenominatorL, u32DenominatorH; - - u32NumeratorL = u32VNumerator & 0xFF; - u32NumeratorH = u32VNumerator >> 8; - u32DenominatorL = u32VDenominator & 0xFF; - u32DenominatorH = u32VDenominator >> 8; - ccap->PKTSL = (ccap->PKTSL & ~(CCAP_PKTSL_PKTSVNL_Msk | CCAP_PKTSL_PKTSVML_Msk)) - | ((u32NumeratorL << CCAP_PKTSL_PKTSVNL_Pos) | (u32DenominatorL << CCAP_PKTSL_PKTSVML_Pos)); - ccap->PKTSM = (ccap->PKTSM & ~(CCAP_PKTSM_PKTSVNH_Msk | CCAP_PKTSM_PKTSVMH_Msk)) - | ((u32NumeratorH << CCAP_PKTSL_PKTSVNL_Pos) | (u32DenominatorH << CCAP_PKTSL_PKTSVML_Pos)); - - u32NumeratorL = u32HNumerator & 0xFF; - u32NumeratorH = u32HNumerator >> 8; - u32DenominatorL = u32HDenominator & 0xFF; - u32DenominatorH = u32HDenominator >> 8; - ccap->PKTSL = (ccap->PKTSL & ~(CCAP_PKTSL_PKTSHNL_Msk | CCAP_PKTSL_PKTSHML_Msk)) - | ((u32NumeratorL << CCAP_PKTSL_PKTSHNL_Pos) | (u32DenominatorL << CCAP_PKTSL_PKTSHML_Pos)); - ccap->PKTSM = (ccap->PKTSM & ~(CCAP_PKTSM_PKTSHNH_Msk | CCAP_PKTSM_PKTSHMH_Msk)) - | ((u32NumeratorH << CCAP_PKTSL_PKTSHNL_Pos) | (u32DenominatorH << CCAP_PKTSL_PKTSHML_Pos)); -} - -/** - * @brief Set Planar Scaling Factor - * - * @param[in] u32VNumerator: Planar Scaling Vertical Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32VDenominator: Planar Scaling Vertical Factor M. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HNumerator: Planar Scaling Horizontal Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HDenominator: Planar Scaling Horizontal Factor M. It should be 0x0 ~ 0xFFFF. - * - * @return None - * - * @details This function is used to set Planar Scaling Vertical and Horizontal Factor register. - */ -void CCAP_SetPlanarScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator) -{ - uint32_t u32NumeratorL, u32NumeratorH; - uint32_t u32DenominatorL, u32DenominatorH; - - u32NumeratorL = u32VNumerator & 0xFF; - u32NumeratorH = u32VNumerator >> 8; - u32DenominatorL = u32VDenominator & 0xFF; - u32DenominatorH = u32VDenominator >> 8; - ccap->PLNSL = (ccap->PLNSL & ~(CCAP_PLNSL_PLNSVNL_Msk | CCAP_PLNSL_PLNSVML_Msk)) - | ((u32NumeratorL << CCAP_PLNSL_PLNSVNL_Pos) | (u32DenominatorL << CCAP_PLNSL_PLNSVML_Pos)); - ccap->PLNSM = (ccap->PLNSM & ~(CCAP_PLNSM_PLNSVNH_Msk | CCAP_PLNSM_PLNSVMH_Msk)) - | ((u32NumeratorH << CCAP_PLNSL_PLNSVNL_Pos) | (u32DenominatorH << CCAP_PLNSL_PLNSVML_Pos)); - - u32NumeratorL = u32HNumerator & 0xFF; - u32NumeratorH = u32HNumerator >> 8; - u32DenominatorL = u32HDenominator & 0xFF; - u32DenominatorH = u32HDenominator >> 8; - ccap->PLNSL = (ccap->PLNSL & ~(CCAP_PLNSL_PLNSHNL_Msk | CCAP_PLNSL_PLNSHML_Msk)) - | ((u32NumeratorL << CCAP_PLNSL_PLNSHNL_Pos) | (u32DenominatorL << CCAP_PLNSL_PLNSHML_Pos)); - ccap->PLNSM = (ccap->PLNSM & ~(CCAP_PLNSM_PLNSHNH_Msk | CCAP_PLNSM_PLNSHMH_Msk)) - | ((u32NumeratorH << CCAP_PLNSL_PLNSHNL_Pos) | (u32DenominatorH << CCAP_PLNSL_PLNSHML_Pos)); -} - -/** - * @brief Set Packet Frame Output Pixel Stride Width - * - * @param[in] u32Stride: Set CCAP_STRIDE register. It should be 0x0 ~ 0x3FFF. - * - * @return None - * - * @details This function is used to set Packet Frame Output Pixel Stride Width. - */ -void CCAP_SetPacketStride(CCAP_T *ccap, uint32_t u32Stride) -{ - ccap->STRIDE = (ccap->STRIDE & ~CCAP_STRIDE_PKTSTRIDE_Msk) | (u32Stride << CCAP_STRIDE_PKTSTRIDE_Pos); -} - -/** - * @brief Set Planar Frame Output Pixel Stride Width - * - * @param[in] u32Stride: Set CCAP_STRIDE register. It should be 0x0 ~ 0x3FFF. - * - * @return None - * - * @details This function is used to set Planar Frame Output Pixel Stride Width. - */ -void CCAP_SetPlanarStride(CCAP_T *ccap, uint32_t u32Stride) -{ - ccap->STRIDE = (ccap->STRIDE & ~CCAP_STRIDE_PLNSTRIDE_Msk) | (u32Stride << CCAP_STRIDE_PLNSTRIDE_Pos); -} - - -/*@}*/ /* end of group CCAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CCAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_clk.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_clk.c deleted file mode 100644 index 6eb030e301a..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_clk.c +++ /dev/null @@ -1,1845 +0,0 @@ -/**************************************************************************//** - * @file clk.c - * @version V3.00 - * @brief M460 series CLK driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -int32_t g_CLK_i32ErrCode = 0; /*!< CLK global error code */ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - -/** - * @brief Disable clock divider output function - * @param None - * @return None - * @details This function disable clock divider output function. - */ -void CLK_DisableCKO(void) -{ - /* Disable CKO clock source */ - CLK->APBCLK0 &= (~CLK_APBCLK0_CLKOCKEN_Msk); -} - -/** - * @brief This function enable clock divider output module clock, - * enable clock divider output function and set frequency selection. - * @param[in] u32ClkSrc is frequency divider function clock source. Including : - * - \ref CLK_CLKSEL1_CLKOSEL_HXT - * - \ref CLK_CLKSEL1_CLKOSEL_LXT - * - \ref CLK_CLKSEL1_CLKOSEL_HCLK - * - \ref CLK_CLKSEL1_CLKOSEL_HIRC - * - \ref CLK_CLKSEL1_CLKOSEL_LIRC - * - \ref CLK_CLKSEL1_CLKOSEL_PLLFN_DIV2 - * - \ref CLK_CLKSEL1_CLKOSEL_PLL_DIV2 - * @param[in] u32ClkDiv is divider output frequency selection. It could be 0~15. - * @param[in] u32ClkDivBy1En is clock divided by one enabled. - * @return None - * @details Output selected clock to CKO. The output clock frequency is divided by u32ClkDiv. \n - * The formula is: \n - * CKO frequency = (Clock source frequency) / 2^(u32ClkDiv + 1) \n - * This function is just used to set CKO clock. - * User must enable I/O for CKO clock output pin by themselves. \n - */ -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) -{ - /* CKO = clock source / 2^(u32ClkDiv + 1) */ - CLK->CLKOCTL = CLK_CLKOCTL_CLKOEN_Msk | (u32ClkDiv) | (u32ClkDivBy1En << CLK_CLKOCTL_DIV1EN_Pos); - - /* Enable CKO clock source */ - CLK->APBCLK0 |= CLK_APBCLK0_CLKOCKEN_Msk; - - /* Select CKO clock source */ - CLK->CLKSEL1 = (CLK->CLKSEL1 & (~CLK_CLKSEL1_CLKOSEL_Msk)) | (u32ClkSrc); -} - -/** - * @brief Enter to Power-down mode - * @param None - * @return None - * @details This function is used to let system enter to Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_PowerDown(void) -{ - volatile uint32_t u32SysTickTICKINT = 0, u32HIRCTCTL = 0, u32IRCTCTL = 0; - - /* Set the processor uses deep sleep as its low power mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* Set system Power-down enabled */ - CLK->PWRCTL |= (CLK_PWRCTL_PDEN_Msk); - - /* Store SysTick interrupt and HIRC auto trim setting */ - u32SysTickTICKINT = SysTick->CTRL & SysTick_CTRL_TICKINT_Msk; - u32HIRCTCTL = SYS->HIRCTCTL; - u32IRCTCTL = SYS->IRCTCTL; - - /* Disable SysTick interrupt and HIRC auto trim */ - SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; - SYS->HIRCTCTL &= (~SYS_HIRCTCTL_FREQSEL_Msk); - SYS->IRCTCTL &= (~SYS_IRCTCTL_FREQSEL_Msk); - - /* Chip enter Power-down mode after CPU run WFI instruction */ - __WFI(); - - /* Restore SysTick interrupt and HIRC auto trim setting */ - if (u32SysTickTICKINT) SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; - SYS->HIRCTCTL = u32HIRCTCTL; - SYS->IRCTCTL = u32IRCTCTL; -} - -/** - * @brief Enter to Idle mode - * @param None - * @return None - * @details This function let system enter to Idle mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_Idle(void) -{ - /* Set the processor uses sleep as its low power mode */ - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - - /* Set chip in idle mode because of WFI command */ - CLK->PWRCTL &= ~CLK_PWRCTL_PDEN_Msk; - - /* Chip enter idle mode after CPU run WFI instruction */ - __WFI(); -} - -/** - * @brief Get external high speed crystal clock frequency - * @param None - * @return External high frequency crystal frequency - * @details This function get external high frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetHXTFreq(void) -{ - uint32_t u32Freq; - - if (CLK->PWRCTL & CLK_PWRCTL_HXTEN_Msk) - { - u32Freq = __HXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - - -/** - * @brief Get external low speed crystal clock frequency - * @param None - * @return External low speed crystal clock frequency - * @details This function get external low frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetLXTFreq(void) -{ - uint32_t u32Freq; - - if (CLK->PWRCTL & CLK_PWRCTL_LXTEN_Msk) - { - u32Freq = __LXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - -/** - * @brief Get PCLK0 frequency - * @param None - * @return PCLK0 frequency - * @details This function get PCLK0 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPCLK0Freq(void) -{ - uint32_t u32Freq; - SystemCoreClockUpdate(); - - if ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV1) - { - u32Freq = SystemCoreClock; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV2) - { - u32Freq = SystemCoreClock >> 1; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV4) - { - u32Freq = SystemCoreClock >> 2; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV8) - { - u32Freq = SystemCoreClock >> 3; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV16) - { - u32Freq = SystemCoreClock >> 4; - } - else - { - u32Freq = SystemCoreClock; - } - - return u32Freq; -} - - -/** - * @brief Get PCLK1 frequency - * @param None - * @return PCLK1 frequency - * @details This function get PCLK1 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPCLK1Freq(void) -{ - uint32_t u32Freq; - SystemCoreClockUpdate(); - - if ((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV1) - { - u32Freq = SystemCoreClock; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV2) - { - u32Freq = SystemCoreClock >> 1; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV4) - { - u32Freq = SystemCoreClock >> 2; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV8) - { - u32Freq = SystemCoreClock >> 3; - } - else if ((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV16) - { - u32Freq = SystemCoreClock >> 4; - } - else - { - u32Freq = SystemCoreClock; - } - - return u32Freq; -} - - -/** - * @brief Get HCLK frequency - * @param None - * @return HCLK frequency - * @details This function get HCLK frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetHCLKFreq(void) -{ - SystemCoreClockUpdate(); - return SystemCoreClock; -} - - -/** - * @brief Get CPU frequency - * @param None - * @return CPU frequency - * @details This function get CPU frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetCPUFreq(void) -{ - SystemCoreClockUpdate(); - return SystemCoreClock; -} - - -/** - * @brief Set HCLK frequency - * @param[in] u32Hclk is HCLK frequency. The range of u32Hclk is 50MHz ~ 200MHz. - * @return HCLK frequency - * @details This function is used to set HCLK frequency by using PLL. The frequency unit is Hz. \n - * Power level and flash access cycle are also set according to HCLK frequency. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_SetCoreClock(uint32_t u32Hclk) -{ - uint32_t u32HIRCSTB; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* Check HCLK frequency range is 50MHz ~ 200MHz */ - if (u32Hclk > FREQ_200MHZ) - { - u32Hclk = FREQ_200MHZ; - } - else if (u32Hclk < FREQ_50MHZ) - { - u32Hclk = FREQ_50MHZ; - } - - /* Switch HCLK clock source to HIRC clock for safe */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_Msk; - CLK->CLKDIV0 &= (~CLK_CLKDIV0_HCLKDIV_Msk); - - /* Configure PLL setting if HXT clock is stable */ - if (CLK->STATUS & CLK_STATUS_HXTSTB_Msk) - { - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HXT, u32Hclk); - } - /* Configure PLL setting if HXT clock is not stable */ - else - { - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HIRC, u32Hclk); - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - } - - /* Select HCLK clock source to PLL, - select HCLK clock source divider as 1, - adjust power level, flash access cycle and update system core clock - */ - CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_PLL, CLK_CLKDIV0_HCLK(1UL)); - - /* Disable HIRC if HIRC is disabled before setting core clock */ - if (u32HIRCSTB == 0UL) - { - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; - } - - /* Return actually HCLK frequency is PLL frequency divide 1 */ - return u32Hclk; -} - -/** - * @brief Set HCLK clock source and HCLK clock divider - * @param[in] u32ClkSrc is HCLK clock source. Including : - * - \ref CLK_CLKSEL0_HCLKSEL_HXT - * - \ref CLK_CLKSEL0_HCLKSEL_LXT - * - \ref CLK_CLKSEL0_HCLKSEL_PLL - * - \ref CLK_CLKSEL0_HCLKSEL_LIRC - * - \ref CLK_CLKSEL0_HCLKSEL_HIRC - * @param[in] u32ClkDiv is HCLK clock divider. Including : - * - \ref CLK_CLKDIV0_HCLK(x) - * @return None - * @details This function set HCLK clock source and HCLK clock divider. \n - * Power level and flash access cycle are also set according to HCLK operation frequency. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32HIRCSTB, u32TimeOutCount; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* Switch to HIRC for safe. Avoid HCLK too high when applying new divider. */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_Msk; - - /* Switch to power level 0 for safe */ - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | SYS_PLCTL_PLSEL_PL0; - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - while (SYS->PLSTS & SYS_PLSTS_PLCBUSY_Msk) - { - if (u32TimeOutCount-- == 0) break; - } - - /* Set Flash Access Cycle to 8 for safe */ - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (8); - - /* Apply new Divider */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & (~CLK_CLKDIV0_HCLKDIV_Msk)) | u32ClkDiv; - - /* Switch HCLK to new HCLK source */ - CLK->CLKSEL0 = (CLK->CLKSEL0 & (~CLK_CLKSEL0_HCLKSEL_Msk)) | u32ClkSrc; - - /* Update System Core Clock */ - SystemCoreClockUpdate(); - - /* Set power level according to new HCLK */ - if (SystemCoreClock <= FREQ_180MHZ) - { - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | SYS_PLCTL_PLSEL_PL1; - } - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - while (SYS->PLSTS & SYS_PLSTS_PLCBUSY_Msk) - { - if (u32TimeOutCount-- == 0) break; - } - - /* Switch flash access cycle to suitable value base on HCLK */ - if (SystemCoreClock >= FREQ_175MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (8); - } - else if (SystemCoreClock >= FREQ_150MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (7); - } - else if (SystemCoreClock >= FREQ_125MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (6); - } - else if (SystemCoreClock >= FREQ_100MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (5); - } - else if (SystemCoreClock >= FREQ_75MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (4); - } - else if (SystemCoreClock >= FREQ_50MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (3); - } - else if (SystemCoreClock >= FREQ_25MHZ) - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (2); - } - else /* SystemCoreClock < FREQ_25MHZ */ - { - FMC->CYCCTL = (FMC->CYCCTL & (~FMC_CYCCTL_CYCLE_Msk)) | (1); - } - - /* Disable HIRC if HIRC is disabled before switching HCLK source */ - if (u32HIRCSTB == 0UL) - { - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; - } -} - -/** - * @brief This function set selected module clock source and module clock divider - * @param[in] u32ModuleIdx is module index. - * @param[in] u32ClkSrc is module clock source. - * @param[in] u32ClkDiv is module clock divider. - * @return None - * @details Valid parameter combinations listed in following table: - * - * |Module index |Clock source |Divider | - * | :---------------- | :----------------------------------- | :-------------------------- | - * |\ref USBH_MODULE |\ref CLK_CLKSEL0_USBSEL_HIRC48M |\ref CLK_CLKDIV0_USB(x) | - * |\ref USBH_MODULE |\ref CLK_CLKSEL0_USBSEL_PLL_DIV2 |\ref CLK_CLKDIV0_USB(x) | - * |\ref OTG_MODULE |\ref CLK_CLKSEL0_USBSEL_HIRC48M |\ref CLK_CLKDIV0_USB(x) | - * |\ref OTG_MODULE |\ref CLK_CLKSEL0_USBSEL_PLL_DIV2 |\ref CLK_CLKDIV0_USB(x) | - * |\ref USBD_MODULE |\ref CLK_CLKSEL0_USBSEL_HIRC48M |\ref CLK_CLKDIV0_USB(x) | - * |\ref USBD_MODULE |\ref CLK_CLKSEL0_USBSEL_PLL_DIV2 |\ref CLK_CLKDIV0_USB(x) | - * |\ref EADC0_MODULE |\ref CLK_CLKSEL0_EADC0SEL_PLLFN_DIV2 |\ref CLK_CLKDIV0_EADC0(x) | - * |\ref EADC0_MODULE |\ref CLK_CLKSEL0_EADC0SEL_PLL_DIV2 |\ref CLK_CLKDIV0_EADC0(x) | - * |\ref EADC0_MODULE |\ref CLK_CLKSEL0_EADC0SEL_HCLK |\ref CLK_CLKDIV0_EADC0(x) | - * |\ref EADC1_MODULE |\ref CLK_CLKSEL0_EADC1SEL_PLLFN_DIV2 |\ref CLK_CLKDIV2_EADC1(x) | - * |\ref EADC1_MODULE |\ref CLK_CLKSEL0_EADC1SEL_PLL_DIV2 |\ref CLK_CLKDIV2_EADC1(x) | - * |\ref EADC1_MODULE |\ref CLK_CLKSEL0_EADC1SEL_HCLK |\ref CLK_CLKDIV2_EADC1(x) | - * |\ref EADC2_MODULE |\ref CLK_CLKSEL0_EADC2SEL_PLLFN_DIV2 |\ref CLK_CLKDIV5_EADC2(x) | - * |\ref EADC2_MODULE |\ref CLK_CLKSEL0_EADC2SEL_PLL_DIV2 |\ref CLK_CLKDIV5_EADC2(x) | - * |\ref EADC2_MODULE |\ref CLK_CLKSEL0_EADC2SEL_HCLK |\ref CLK_CLKDIV5_EADC2(x) | - * |\ref CCAP_MODULE | x | x | - * |\ref CCAP_MODULE | x | x | - * |\ref CCAP_MODULE | x | x | - * |\ref CCAP_MODULE | x | x | - * |\ref SEN_MODULE |\ref CLK_CLKSEL0_CCAPSEL_HXT |\ref CLK_CLKDIV3_VSENSE(x) | - * |\ref SEN_MODULE |\ref CLK_CLKSEL0_CCAPSEL_PLL_DIV2 |\ref CLK_CLKDIV3_VSENSE(x) | - * |\ref SEN_MODULE |\ref CLK_CLKSEL0_CCAPSEL_HCLK |\ref CLK_CLKDIV3_VSENSE(x) | - * |\ref SEN_MODULE |\ref CLK_CLKSEL0_CCAPSEL_HIRC |\ref CLK_CLKDIV3_VSENSE(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HXT |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_PLL_DIV2 |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HIRC |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HCLK |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_HXT |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_PLL_DIV2 |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_HIRC |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_HCLK |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref CANFD0_MODULE |\ref CLK_CLKSEL0_CANFD0SEL_HXT |\ref CLK_CLKDIV5_CANFD0(x) | - * |\ref CANFD0_MODULE |\ref CLK_CLKSEL0_CANFD0SEL_PLL_DIV2 |\ref CLK_CLKDIV5_CANFD0(x) | - * |\ref CANFD0_MODULE |\ref CLK_CLKSEL0_CANFD0SEL_HCLK |\ref CLK_CLKDIV5_CANFD0(x) | - * |\ref CANFD0_MODULE |\ref CLK_CLKSEL0_CANFD0SEL_HIRC |\ref CLK_CLKDIV5_CANFD0(x) | - * |\ref CANFD1_MODULE |\ref CLK_CLKSEL0_CANFD1SEL_HXT |\ref CLK_CLKDIV5_CANFD1(x) | - * |\ref CANFD1_MODULE |\ref CLK_CLKSEL0_CANFD1SEL_PLL_DIV2 |\ref CLK_CLKDIV5_CANFD1(x) | - * |\ref CANFD1_MODULE |\ref CLK_CLKSEL0_CANFD1SEL_HCLK |\ref CLK_CLKDIV5_CANFD1(x) | - * |\ref CANFD1_MODULE |\ref CLK_CLKSEL0_CANFD1SEL_HIRC |\ref CLK_CLKDIV5_CANFD1(x) | - * |\ref CANFD2_MODULE |\ref CLK_CLKSEL0_CANFD2SEL_HXT |\ref CLK_CLKDIV5_CANFD2(x) | - * |\ref CANFD2_MODULE |\ref CLK_CLKSEL0_CANFD2SEL_PLL_DIV2 |\ref CLK_CLKDIV5_CANFD2(x) | - * |\ref CANFD2_MODULE |\ref CLK_CLKSEL0_CANFD2SEL_HCLK |\ref CLK_CLKDIV5_CANFD2(x) | - * |\ref CANFD2_MODULE |\ref CLK_CLKSEL0_CANFD2SEL_HIRC |\ref CLK_CLKDIV5_CANFD2(x) | - * |\ref CANFD3_MODULE |\ref CLK_CLKSEL0_CANFD3SEL_HXT |\ref CLK_CLKDIV5_CANFD3(x) | - * |\ref CANFD3_MODULE |\ref CLK_CLKSEL0_CANFD3SEL_PLL_DIV2 |\ref CLK_CLKDIV5_CANFD3(x) | - * |\ref CANFD3_MODULE |\ref CLK_CLKSEL0_CANFD3SEL_HCLK |\ref CLK_CLKDIV5_CANFD3(x) | - * |\ref CANFD3_MODULE |\ref CLK_CLKSEL0_CANFD3SEL_HIRC |\ref CLK_CLKDIV5_CANFD3(x) | - * |\ref EMAC0_MODULE | x |\ref CLK_CLKDIV3_EMAC0(x) | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LXT | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_HCLK_DIV2048 | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_LXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HCLK | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_LIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_PLLFN_DIV2 | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_PLL_DIV2 | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_PCLK0 | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_EXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LIRC | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_PCLK0 | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_EXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_PCLK1 | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_EXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_PCLK1 | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_EXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HIRC | x | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_HXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_PLL_DIV2 |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_LXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_HIRC |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_HXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_PLL_DIV2 |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_LXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_HIRC |\ref CLK_CLKDIV0_UART1(x) | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_HCLK_DIV2048 | x | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_LIRC | x | - * |\ref EPWM0_MODULE |\ref CLK_CLKSEL2_EPWM0SEL_HCLK | x | - * |\ref EPWM0_MODULE |\ref CLK_CLKSEL2_EPWM0SEL_PCLK0 | x | - * |\ref EPWM1_MODULE |\ref CLK_CLKSEL2_EPWM1SEL_HCLK | x | - * |\ref EPWM1_MODULE |\ref CLK_CLKSEL2_EPWM1SEL_PCLK1 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HXT | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PLL_DIV2 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PCLK0 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HIRC | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HXT | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PLL_DIV2 | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PCLK1 | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HIRC | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HIRC48M | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PLLFN_DIV2 | x | - * |\ref BPWM0_MODULE |\ref CLK_CLKSEL2_BPWM0SEL_HCLK | x | - * |\ref BPWM0_MODULE |\ref CLK_CLKSEL2_BPWM0SEL_PCLK0 | x | - * |\ref BPWM1_MODULE |\ref CLK_CLKSEL2_BPWM1SEL_HCLK | x | - * |\ref BPWM1_MODULE |\ref CLK_CLKSEL2_BPWM1SEL_PCLK1 | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_HXT | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_PLL_DIV2 | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_PCLK1 | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_HIRC | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_HXT | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_PLL_DIV2 | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_PCLK0 | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_HIRC | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_HIRC48M | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_PLLFN_DIV2 | x | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL2_I2S1SEL_HXT |\ref CLK_CLKDIV2_I2S1(x) | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL2_I2S1SEL_PLL_DIV2 |\ref CLK_CLKDIV2_I2S1(x) | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL2_I2S1SEL_PCLK1 |\ref CLK_CLKDIV2_I2S1(x) | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL2_I2S1SEL_HIRC |\ref CLK_CLKDIV2_I2S1(x) | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL2_I2S1SEL_HIRC48M |\ref CLK_CLKDIV2_I2S1(x) | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL2_I2S1SEL_PLLFN_DIV2 |\ref CLK_CLKDIV2_I2S1(x) | - * |\ref UART8_MODULE |\ref CLK_CLKSEL2_UART8SEL_HXT |\ref CLK_CLKDIV5_UART8(x) | - * |\ref UART8_MODULE |\ref CLK_CLKSEL2_UART8SEL_PLL_DIV2 |\ref CLK_CLKDIV5_UART8(x) | - * |\ref UART8_MODULE |\ref CLK_CLKSEL2_UART8SEL_LXT |\ref CLK_CLKDIV5_UART8(x) | - * |\ref UART8_MODULE |\ref CLK_CLKSEL2_UART8SEL_HIRC |\ref CLK_CLKDIV5_UART8(x) | - * |\ref UART9_MODULE |\ref CLK_CLKSEL2_UART9SEL_HXT |\ref CLK_CLKDIV5_UART9(x) | - * |\ref UART9_MODULE |\ref CLK_CLKSEL2_UART9SEL_PLL_DIV2 |\ref CLK_CLKDIV5_UART9(x) | - * |\ref UART9_MODULE |\ref CLK_CLKSEL2_UART9SEL_LXT |\ref CLK_CLKDIV5_UART9(x) | - * |\ref UART9_MODULE |\ref CLK_CLKSEL2_UART9SEL_HIRC |\ref CLK_CLKDIV5_UART9(x) | - * |\ref TRNG_MODULE |\ref CLK_CLKSEL2_TRNGSEL_LXT | x | - * |\ref TRNG_MODULE |\ref CLK_CLKSEL2_TRNGSEL_LIRC | x | - * |\ref PSIO_MODULE |\ref CLK_CLKSEL2_PSIOSEL_HXT |\ref CLK_CLKDIV1_PSIO(x) | - * |\ref PSIO_MODULE |\ref CLK_CLKSEL2_PSIOSEL_LXT |\ref CLK_CLKDIV1_PSIO(x) | - * |\ref PSIO_MODULE |\ref CLK_CLKSEL2_PSIOSEL_PCLK1 |\ref CLK_CLKDIV1_PSIO(x) | - * |\ref PSIO_MODULE |\ref CLK_CLKSEL2_PSIOSEL_PLL_DIV2 |\ref CLK_CLKDIV1_PSIO(x) | - * |\ref PSIO_MODULE |\ref CLK_CLKSEL2_PSIOSEL_LIRC |\ref CLK_CLKDIV1_PSIO(x) | - * |\ref PSIO_MODULE |\ref CLK_CLKSEL2_PSIOSEL_HIRC |\ref CLK_CLKDIV1_PSIO(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_HXT |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_PLL_DIV2 |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_PCLK0 |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_HIRC |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_HXT |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_PLL_DIV2 |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_PCLK1 |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_HIRC |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_HXT |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_PLL_DIV2 |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_PCLK0 |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_HIRC |\ref CLK_CLKDIV1_SC2(x) | - * |\ref KPI_MODULE |\ref CLK_CLKSEL3_KPISEL_HXT |\ref CLK_CLKDIV2_KPI(x) | - * |\ref KPI_MODULE |\ref CLK_CLKSEL3_KPISEL_LIRC |\ref CLK_CLKDIV1_KPI(x) | - * |\ref KPI_MODULE |\ref CLK_CLKSEL3_KPISEL_HIRC |\ref CLK_CLKDIV1_KPI(x) | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL3_SPI2SEL_HXT | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL3_SPI2SEL_PLL_DIV2 | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL3_SPI2SEL_PCLK1 | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL3_SPI2SEL_HIRC | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL3_SPI2SEL_HIRC48M | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL3_SPI2SEL_PLLFN_DIV2 | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL3_SPI3SEL_HXT | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL3_SPI3SEL_PLL_DIV2 | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL3_SPI3SEL_PCLK0 | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL3_SPI3SEL_HIRC | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL3_SPI3SEL_HIRC48M | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL3_SPI3SEL_PLLFN_DIV2 | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_HXT |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_PLL_DIV2 |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_PCLK0 |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_HIRC |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_HIRC48M |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_PLLFN_DIV2 |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_HXT |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_PLL_DIV2 |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_LXT |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_HIRC |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_HXT |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_PLL_DIV2 |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_LXT |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_HIRC |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_HXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_PLL_DIV2 |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_LXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_HIRC |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_HXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_PLL_DIV2 |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_LXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_HIRC |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_PLL_DIV2 |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_LXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HIRC |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_PLL_DIV2 |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_LXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HIRC |\ref CLK_CLKDIV4_UART5(x) | - * |\ref RTC_MODULE |\ref RTC_LXTCTL_RTCCKSEL_LXT | x | - * |\ref RTC_MODULE |\ref RTC_LXTCTL_RTCCKSEL_LIRC | x | - * |\ref SPI4_MODULE |\ref CLK_CLKSEL4_SPI4SEL_HXT | x | - * |\ref SPI4_MODULE |\ref CLK_CLKSEL4_SPI4SEL_PLL_DIV2 | x | - * |\ref SPI4_MODULE |\ref CLK_CLKSEL4_SPI4SEL_PCLK1 | x | - * |\ref SPI4_MODULE |\ref CLK_CLKSEL4_SPI4SEL_HIRC | x | - * |\ref SPI5_MODULE |\ref CLK_CLKSEL4_SPI5SEL_HXT | x | - * |\ref SPI5_MODULE |\ref CLK_CLKSEL4_SPI5SEL_PLL_DIV2 | x | - * |\ref SPI5_MODULE |\ref CLK_CLKSEL4_SPI5SEL_PCLK0 | x | - * |\ref SPI5_MODULE |\ref CLK_CLKSEL4_SPI5SEL_HIRC | x | - * |\ref SPI6_MODULE |\ref CLK_CLKSEL4_SPI6SEL_HXT | x | - * |\ref SPI6_MODULE |\ref CLK_CLKSEL4_SPI6SEL_PLL_DIV2 | x | - * |\ref SPI6_MODULE |\ref CLK_CLKSEL4_SPI6SEL_PCLK1 | x | - * |\ref SPI6_MODULE |\ref CLK_CLKSEL4_SPI6SEL_HIRC | x | - * |\ref SPI7_MODULE |\ref CLK_CLKSEL4_SPI7SEL_HXT | x | - * |\ref SPI7_MODULE |\ref CLK_CLKSEL4_SPI7SEL_PLL_DIV2 | x | - * |\ref SPI7_MODULE |\ref CLK_CLKSEL4_SPI7SEL_PCLK0 | x | - * |\ref SPI7_MODULE |\ref CLK_CLKSEL4_SPI7SEL_HIRC | x | - * |\ref SPI8_MODULE |\ref CLK_CLKSEL4_SPI8SEL_HXT | x | - * |\ref SPI8_MODULE |\ref CLK_CLKSEL4_SPI8SEL_PLL_DIV2 | x | - * |\ref SPI8_MODULE |\ref CLK_CLKSEL4_SPI8SEL_PCLK1 | x | - * |\ref SPI8_MODULE |\ref CLK_CLKSEL4_SPI8SEL_HIRC | x | - * |\ref SPI9_MODULE |\ref CLK_CLKSEL4_SPI9SEL_HXT | x | - * |\ref SPI9_MODULE |\ref CLK_CLKSEL4_SPI9SEL_PLL_DIV2 | x | - * |\ref SPI9_MODULE |\ref CLK_CLKSEL4_SPI9SEL_PCLK0 | x | - * |\ref SPI9_MODULE |\ref CLK_CLKSEL4_SPI9SEL_HIRC | x | - * |\ref SPI10_MODULE |\ref CLK_CLKSEL4_SPI10SEL_HXT | x | - * |\ref SPI10_MODULE |\ref CLK_CLKSEL4_SPI10SEL_PLL_DIV2 | x | - * |\ref SPI10_MODULE |\ref CLK_CLKSEL4_SPI10SEL_PCLK1 | x | - * |\ref SPI10_MODULE |\ref CLK_CLKSEL4_SPI10SEL_HIRC | x | - * - */ -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32Sel = 0UL, u32Div = 0UL; - uint32_t au32SelTbl[5] = {0x0UL, 0x4UL, 0x8UL, 0xCUL, 0x4CUL}; /* CLK_CLKSEL0~4 */ - uint32_t au32DivTbl[6] = {0x0UL, 0x4UL, 0x8UL, 0xCUL, 0x10UL, 0x1C}; /* CLK_CLKDIV0~5 */ - uint32_t u32RTCCKEN = CLK->APBCLK0 & CLK_APBCLK0_RTCCKEN_Msk; - - if (u32ModuleIdx == RTC_MODULE) /* RTC clock source configuration */ - { - if (u32RTCCKEN == 0UL) - { - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; /* Enable RTC clock to get LXT clock source */ - } - - /* Select RTC clock source */ - RTC->LXTCTL = (RTC->LXTCTL & (~RTC_LXTCTL_RTCCKSEL_Msk)) | (u32ClkSrc); - - if (u32RTCCKEN == 0UL) - { - CLK->APBCLK0 &= (~CLK_APBCLK0_RTCCKEN_Msk); /* Disable RTC clock if it is disabled before */ - } - } - else /* Others clock source configuration */ - { - /* Configure clock source divider */ - switch (u32ModuleIdx) - { - /* For 8 bits divider */ - case EADC0_MODULE: - CLK->CLKDIV0 = (CLK->CLKDIV0 & (~CLK_CLKDIV0_EADC0DIV_Msk)) | (u32ClkDiv); - break; - case SDH0_MODULE: - CLK->CLKDIV0 = (CLK->CLKDIV0 & (~CLK_CLKDIV0_SDH0DIV_Msk)) | (u32ClkDiv); - break; - case SC0_MODULE: - CLK->CLKDIV1 = (CLK->CLKDIV1 & (~CLK_CLKDIV1_SC0DIV_Msk)) | (u32ClkDiv); - break; - case SC1_MODULE: - CLK->CLKDIV1 = (CLK->CLKDIV1 & (~CLK_CLKDIV1_SC1DIV_Msk)) | (u32ClkDiv); - break; - case SC2_MODULE: - CLK->CLKDIV1 = (CLK->CLKDIV1 & (~CLK_CLKDIV1_SC2DIV_Msk)) | (u32ClkDiv); - break; - case PSIO_MODULE: - CLK->CLKDIV1 = (CLK->CLKDIV1 & (~CLK_CLKDIV1_PSIODIV_Msk)) | (u32ClkDiv); - break; - case KPI_MODULE: - CLK->CLKDIV2 = (CLK->CLKDIV2 & (~CLK_CLKDIV2_KPIDIV_Msk)) | (u32ClkDiv); - break; - case EADC1_MODULE: - CLK->CLKDIV2 = (CLK->CLKDIV2 & (~CLK_CLKDIV2_EADC1DIV_Msk)) | (u32ClkDiv); - break; - case SEN_MODULE: - CLK->CLKDIV3 = (CLK->CLKDIV3 & (~CLK_CLKDIV3_VSENSEDIV_Msk)) | (u32ClkDiv); - break; - case EMAC0_MODULE: - CLK->CLKDIV3 = (CLK->CLKDIV3 & (~CLK_CLKDIV3_EMAC0DIV_Msk)) | (u32ClkDiv); - break; - case SDH1_MODULE: - CLK->CLKDIV3 = (CLK->CLKDIV3 & (~CLK_CLKDIV3_SDH1DIV_Msk)) | (u32ClkDiv); - break; - case EADC2_MODULE: - CLK->CLKDIV5 = (CLK->CLKDIV5 & (~CLK_CLKDIV5_EADC2DIV_Msk)) | (u32ClkDiv); - break; - - /* Others */ - default: - { - if (MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock divider control register address */ - u32Div = (uint32_t)&CLK->CLKDIV0 + (au32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); - /* Apply new divider */ - M32(u32Div) = (M32(u32Div) & (~(MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx)))) | u32ClkDiv; - } - } - break; - } - - /* Configure clock source */ - if (MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32Sel = (uint32_t)&CLK->CLKSEL0 + (au32SelTbl[MODULE_CLKSEL(u32ModuleIdx)]); - /* Set new clock selection setting */ - M32(u32Sel) = (M32(u32Sel) & (~(MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx)))) | u32ClkSrc; - } - } - -} - -/** - * @brief Set SysTick clock source - * @param[in] u32ClkSrc is module clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * @return None - * @details This function set SysTick clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc) -{ - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; -} - -/** - * @brief Enable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * - \ref CLK_PWRCTL_HIRC48MEN_Msk - * @return None - * @details This function enable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL |= u32ClkMask; -} - -/** - * @brief Disable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * - \ref CLK_PWRCTL_HIRC48MEN_Msk - * @return None - * @details This function disable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL &= ~u32ClkMask; -} - -/** - * @brief Enable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref ST_MODULE - * - \ref EMAC0_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref CRC_MODULE - * - \ref CCAP_MODULE - * - \ref SEN_MODULE - * - \ref HSUSBD_MODULE - * - \ref HSOTG_MODULE - * - \ref HBI_MODULE - * - \ref CRPT_MODULE - * - \ref KS_MODULE - * - \ref SPIM_MODULE - * - \ref FMCIDLE_MODULE - * - \ref USBH_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref TRACE_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref GPI_MODULE - * - \ref GPJ_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref CLKO_MODULE - * - \ref ACMP01_MODULE - * - \ref ACMP23_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref I2C3_MODULE - * - \ref I2C4_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref SPI4_MODULE - * - \ref SPI5_MODULE - * - \ref SPI6_MODULE - * - \ref SPI7_MODULE - * - \ref SPI8_MODULE - * - \ref SPI9_MODULE - * - \ref SPI10_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref EADC0_MODULE - * - \ref EADC1_MODULE - * - \ref EADC2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref USCI0_MODULE - * - \ref PSIO_MODULE - * - \ref DAC_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref EQEI0_MODULE - * - \ref EQEI1_MODULE - * - \ref EQEI2_MODULE - * - \ref EQEI3_MODULE - * - \ref TRNG_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref ECAP2_MODULE - * - \ref ECAP3_MODULE - * - \ref TRNG_MODULE - * - \ref KPI_MODULE - * @return None - * @details This function is used to enable module clock. - */ -void CLK_EnableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - - /* Index, 0x0:AHBCLK0, 0x1:APBCLK0, 0x2:APBCLK1, 0x3:APBCLK2, 0x4:AHBCLK1 */ - uint32_t au32ClkEnTbl[5] = {0x0UL, 0x4UL, 0x8UL, 0x34UL, 0x54UL}; - - u32TmpVal = (1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32TmpAddr = (uint32_t)&CLK->AHBCLK0 + au32ClkEnTbl[MODULE_APBCLK(u32ModuleIdx)]; - - *(volatile uint32_t *)u32TmpAddr |= u32TmpVal; -} - -/** - * @brief Disable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref ST_MODULE - * - \ref EMAC0_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref CRC_MODULE - * - \ref CCAP_MODULE - * - \ref SEN_MODULE - * - \ref HSUSBD_MODULE - * - \ref HSOTG_MODULE - * - \ref HBI_MODULE - * - \ref CRPT_MODULE - * - \ref KS_MODULE - * - \ref SPIM_MODULE - * - \ref FMCIDLE_MODULE - * - \ref USBH_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref TRACE_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref GPI_MODULE - * - \ref GPJ_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref CLKO_MODULE - * - \ref ACMP01_MODULE - * - \ref ACMP23_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref I2C3_MODULE - * - \ref I2C4_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref SPI4_MODULE - * - \ref SPI5_MODULE - * - \ref SPI6_MODULE - * - \ref SPI7_MODULE - * - \ref SPI8_MODULE - * - \ref SPI9_MODULE - * - \ref SPI10_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref EADC0_MODULE - * - \ref EADC1_MODULE - * - \ref EADC2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref USCI0_MODULE - * - \ref PSIO_MODULE - * - \ref DAC_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref EQEI0_MODULE - * - \ref EQEI1_MODULE - * - \ref EQEI2_MODULE - * - \ref EQEI3_MODULE - * - \ref TRNG_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref ECAP2_MODULE - * - \ref ECAP3_MODULE - * - \ref TRNG_MODULE - * - \ref KPI_MODULE - * @return None - * @details This function is used to disable module clock. - */ -void CLK_DisableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - - /* Index, 0x0:AHBCLK0, 0x1:APBCLK0, 0x2:APBCLK1, 0x3:APBCLK2, 0x4:AHBCLK1 */ - uint32_t au32ClkEnTbl[5] = {0x0UL, 0x4UL, 0x8UL, 0x34UL, 0x54UL}; - - u32TmpVal = ~(1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32TmpAddr = (uint32_t)&CLK->AHBCLK0 + au32ClkEnTbl[MODULE_APBCLK(u32ModuleIdx)]; - - *(uint32_t *)u32TmpAddr &= u32TmpVal; -} - - -/** - * @brief Set PLL frequency - * @param[in] u32PllClkSrc is PLL clock source. Including : - * - \ref CLK_PLLCTL_PLLSRC_HXT - * - \ref CLK_PLLCTL_PLLSRC_HIRC - * @param[in] u32PllFreq is PLL frequency. The range of u32PllFreq is 50 MHz ~ 500 MHz. - * @return PLL frequency - * @details This function is used to configure PLLCTL register to set specified PLL frequency. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq) -{ - uint32_t u32PllSrcClk, u32NR, u32NF, u32NO, u32PllClk; - uint32_t u32Tmp, u32Tmp2, u32Tmp3, u32Min, u32MinNF, u32MinNR; - - /* Disable PLL first to avoid unstable when setting PLL */ - CLK->PLLCTL |= CLK_PLLCTL_PD_Msk; - - /* PLL source clock is from HXT */ - if (u32PllClkSrc == CLK_PLLCTL_PLLSRC_HXT) - { - /* Enable HXT clock */ - CLK->PWRCTL |= CLK_PWRCTL_HXTEN_Msk; - - /* Wait for HXT clock ready */ - CLK_WaitClockReady(CLK_STATUS_HXTSTB_Msk); - - /* Select PLL source clock from HXT */ - u32PllSrcClk = __HXT; - } - - /* PLL source clock is from HIRC */ - else - { - /* Enable HIRC clock */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - - /* Wait for HIRC clock ready */ - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - - /* Select PLL source clock from HIRC */ - u32PllSrcClk = __HIRC; - } - - /* Check PLL frequency range */ - /* Constraint 1: 50MHz < FOUT < 500MHz */ - if ((u32PllFreq <= FREQ_500MHZ) && (u32PllFreq >= FREQ_50MHZ)) - { - /* Select "NO" according to request frequency */ - if ((u32PllFreq < FREQ_100MHZ) && (u32PllFreq >= FREQ_50MHZ)) - { - u32NO = 3UL; - u32PllFreq = u32PllFreq << 2; - } - else if ((u32PllFreq < FREQ_200MHZ) && (u32PllFreq >= FREQ_100MHZ)) - { - u32NO = 1UL; - u32PllFreq = u32PllFreq << 1; - } - else - { - u32NO = 0UL; - } - - /* u32NR start from 3 to avoid calculation overflow */ - u32NR = 3UL; - - /* Find best solution */ - u32Min = (uint32_t) - 1; /* initial u32Min to max value of uint32_t (0xFFFFFFFF) */ - u32MinNR = 0UL; - u32MinNF = 0UL; - - for (; u32NR <= 32UL; u32NR++) /* max NR = 32 since NR = INDIV+1 and INDIV = 0~31 */ - { - u32Tmp = u32PllSrcClk / u32NR; /* FREF = FIN/NR */ - if ((u32Tmp >= FREQ_4MHZ) && (u32Tmp <= FREQ_8MHZ)) /* Constraint 2: 4MHz < FREF < 8MHz. */ - { - for (u32NF = 2UL; u32NF <= 513UL; u32NF++) /* NF = 2~513 since NF = FBDIV+2 and FBDIV = 0~511 */ - { - u32Tmp2 = (u32Tmp * u32NF) << 1; /* FVCO = FREF*2*NF */ - if ((u32Tmp2 >= FREQ_200MHZ) && (u32Tmp2 <= FREQ_500MHZ)) /* Constraint 3: 200MHz < FVCO < 500MHz */ - { - u32Tmp3 = (u32Tmp2 > u32PllFreq) ? u32Tmp2 - u32PllFreq : u32PllFreq - u32Tmp2; - if (u32Tmp3 < u32Min) - { - u32Min = u32Tmp3; - u32MinNR = u32NR; - u32MinNF = u32NF; - - /* Break when get good results */ - if (u32Min == 0UL) - { - break; - } - } - } - } - } - } - - /* Enable and apply new PLL setting. */ - CLK->PLLCTL = u32PllClkSrc | - (u32NO << CLK_PLLCTL_OUTDIV_Pos) | - ((u32MinNR - 1UL) << CLK_PLLCTL_INDIV_Pos) | - ((u32MinNF - 2UL) << CLK_PLLCTL_FBDIV_Pos); - - /* Actual PLL output clock frequency. FOUT = (FIN/NR)*2*NF*(1/NO) */ - u32PllClk = u32PllSrcClk / ((u32NO + 1UL) * u32MinNR) * (u32MinNF << 1); - } - else - { - /* Apply default PLL setting and return */ - CLK->PLLCTL = u32PllClkSrc | CLK_PLLCTL_192MHz_HXT; - - /* Actual PLL output clock frequency */ - u32PllClk = FREQ_192MHZ; - } - - /* Wait for PLL clock stable */ - CLK_WaitClockReady(CLK_STATUS_PLLSTB_Msk); - - /* Return actual PLL output clock frequency */ - return u32PllClk; -} - - -/** - * @brief Disable PLL - * @param None - * @return None - * @details This function set PLL in Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisablePLL(void) -{ - CLK->PLLCTL |= CLK_PLLCTL_PD_Msk; -} - - -/** - * @brief This function check selected clock source status - * @param[in] u32ClkMask is selected clock source. Including : - * - \ref CLK_STATUS_HXTSTB_Msk - * - \ref CLK_STATUS_LXTSTB_Msk - * - \ref CLK_STATUS_HIRCSTB_Msk - * - \ref CLK_STATUS_LIRCSTB_Msk - * - \ref CLK_STATUS_PLLSTB_Msk - * - \ref CLK_STATUS_PLLFNSTB_Msk - * - \ref CLK_STATUS_HIRC48MSTB_Msk - * @retval 0 clock is not stable - * @retval 1 clock is stable - * @details To wait for clock ready by specified clock source stable flag or timeout (>500ms) - * @note This function sets g_CLK_i32ErrCode to CLK_TIMEOUT_ERR if clock source status is not stable. - */ -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask) -{ - uint32_t u32TimeOutCnt = SystemCoreClock >> 1; /* 500ms time-out */ - uint32_t u32Ret = 1U; - - g_CLK_i32ErrCode = 0; - while ((CLK->STATUS & u32ClkMask) != u32ClkMask) - { - if (--u32TimeOutCnt == 0) - { - g_CLK_i32ErrCode = CLK_TIMEOUT_ERR; - u32Ret = 0U; - break; - } - } - - return u32Ret; -} - -/** - * @brief Enable System Tick counter - * @param[in] u32ClkSrc is System Tick clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK - * @param[in] u32Count is System Tick reload value. It could be 0~0xFFFFFF. - * @return None - * @details This function set System Tick clock source, reload value, enable System Tick counter and interrupt. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; - - /* Set System Tick clock source */ - if (u32ClkSrc == CLK_CLKSEL0_STCLKSEL_HCLK) - { - /* Disable System Tick clock source from external reference clock */ - CLK->AHBCLK0 &= ~CLK_AHBCLK0_STCKEN_Msk; - - /* Select System Tick clock source from core clock */ - SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk; - } - else - { - /* Enable System Tick clock source from external reference clock */ - CLK->AHBCLK0 |= CLK_AHBCLK0_STCKEN_Msk; - - /* Select System Tick external reference clock source */ - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; - - /* Select System Tick clock source from external reference clock */ - SysTick->CTRL &= ~SysTick_CTRL_CLKSOURCE_Msk; - } - - /* Set System Tick reload value */ - SysTick->LOAD = u32Count; - - /* Clear System Tick current value and counter flag */ - SysTick->VAL = 0UL; - - /* Set System Tick interrupt enabled and counter enabled */ - SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk; -} - -/** - * @brief Disable System Tick counter - * @param None - * @return None - * @details This function disable System Tick counter. - */ -void CLK_DisableSysTick(void) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; -} - - -/** - * @brief Power-down mode selected - * @param[in] u32PDMode is power down mode index. Including : - * - \ref CLK_PMUCTL_PDMSEL_PD - * - \ref CLK_PMUCTL_PDMSEL_LLPD - * - \ref CLK_PMUCTL_PDMSEL_FWPD - * - \ref CLK_PMUCTL_PDMSEL_SPD - * - \ref CLK_PMUCTL_PDMSEL_DPD - * @return None - * @details This function is used to set power-down mode. - * The register write-protection function should be disabled before using this function. - */ - -void CLK_SetPowerDownMode(uint32_t u32PDMode) -{ - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_PDMSEL_Msk)) | u32PDMode; -} - - -/** - * @brief Set Wake-up pin trigger type at Deep Power down mode - * - * @param[in] u32TriggerType Wake-up pin trigger type - * - \ref CLK_DPDWKPIN_RISING - * - \ref CLK_DPDWKPIN_FALLING - * - \ref CLK_DPDWKPIN_BOTHEDGE - * - \ref CLK_DPDWKPIN1_RISING - * - \ref CLK_DPDWKPIN1_FALLING - * - \ref CLK_DPDWKPIN1_BOTHEDGE - * - \ref CLK_DPDWKPIN2_RISING - * - \ref CLK_DPDWKPIN2_FALLING - * - \ref CLK_DPDWKPIN2_BOTHEDGE - * - \ref CLK_DPDWKPIN3_RISING - * - \ref CLK_DPDWKPIN3_FALLING - * - \ref CLK_DPDWKPIN3_BOTHEDGE - * - \ref CLK_DPDWKPIN4_RISING - * - \ref CLK_DPDWKPIN4_FALLING - * - \ref CLK_DPDWKPIN4_BOTHEDGE - * @return None - * - * @details This function is used to enable Wake-up pin trigger type. - * The register write-protection function should be disabled before using this function. - */ - -void CLK_EnableDPDWKPin(uint32_t u32TriggerType) -{ - uint32_t u32Pin1, u32Pin2, u32Pin3, u32Pin4; - - /* Get DPD wake-up pin configuration */ - u32Pin1 = ((u32TriggerType) & CLK_PMUCTL_WKPINEN1_Msk); - u32Pin2 = ((u32TriggerType) & CLK_PMUCTL_WKPINEN2_Msk); - u32Pin3 = ((u32TriggerType) & CLK_PMUCTL_WKPINEN3_Msk); - u32Pin4 = ((u32TriggerType) & CLK_PMUCTL_WKPINEN4_Msk); - - /* Set DPD wake-up pin configuration */ - if (u32Pin1) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN1_Msk)) | u32TriggerType; - } - else if (u32Pin2) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN2_Msk)) | u32TriggerType; - } - else if (u32Pin3) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN3_Msk)) | u32TriggerType; - } - else if (u32Pin4) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN4_Msk)) | u32TriggerType; - } - else - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN0_Msk)) | u32TriggerType; - } - -} - -/** - * @brief Get power manager wake up source - * - * @param[in] None - * @return None - * - * @details This function get power manager wake up source. - */ - -uint32_t CLK_GetPMUWKSrc(void) -{ - return (CLK->PMUSTS); -} - -/** - * @brief Set specified GPIO as wake up source at Stand-by Power down mode - * - * @param[in] u32Port GPIO port. It could be 0~3. - * @param[in] u32Pin The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32TriggerType Wake-up pin trigger type - * - \ref CLK_SPDWKPIN_RISING - * - \ref CLK_SPDWKPIN_FALLING - * @param[in] u32DebounceEn Standby Power-down mode wake-up pin de-bounce function - * - \ref CLK_SPDWKPIN_DEBOUNCEEN - * - \ref CLK_SPDWKPIN_DEBOUNCEDIS - * @return None - * - * @details This function is used to set specified GPIO as wake up source at Stand-by Power down mode. - */ -void CLK_EnableSPDWKPin(uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerType, uint32_t u32DebounceEn) -{ - uint32_t u32tmpAddr = 0UL; - uint32_t u32tmpVal = 0UL; - - /* GPx Stand-by Power-down Wake-up Pin Select */ - u32tmpAddr = (uint32_t)&CLK->PASWKCTL; - u32tmpAddr += (0x4UL * u32Port); - - u32tmpVal = inpw((uint32_t *)u32tmpAddr); - u32tmpVal = (u32tmpVal & ~(CLK_PASWKCTL_WKPSEL_Msk | CLK_PASWKCTL_PRWKEN_Msk | CLK_PASWKCTL_PFWKEN_Msk | CLK_PASWKCTL_DBEN_Msk | CLK_PASWKCTL_WKEN_Msk)) | - (u32Pin << CLK_PASWKCTL_WKPSEL_Pos) | u32TriggerType | u32DebounceEn | CLK_SPDWKPIN_ENABLE; - outpw((uint32_t *)u32tmpAddr, u32tmpVal); -} - -/** - * @brief Get PLL clock frequency - * @param None - * @return PLL frequency - * @details This function get PLL frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPLLClockFreq(void) -{ - uint32_t u32PllFreq = 0UL, u32PllReg; - uint32_t u32FIN, u32NF, u32NR, u32NO; - uint8_t au8NoTbl[4] = {1U, 2U, 2U, 4U}; - - u32PllReg = CLK->PLLCTL; - - if (u32PllReg & (CLK_PLLCTL_PD_Msk | CLK_PLLCTL_OE_Msk)) - { - u32PllFreq = 0UL; /* PLL is in power down mode or fix low */ - } - else /* PLL is in normal mode */ - { - /* PLL source clock */ - if (u32PllReg & CLK_PLLCTL_PLLSRC_Msk) - { - u32FIN = __HIRC; /* PLL source clock from HIRC */ - } - else - { - u32FIN = __HXT; /* PLL source clock from HXT */ - } - - /* Calculate PLL frequency */ - if (u32PllReg & CLK_PLLCTL_BP_Msk) - { - u32PllFreq = u32FIN; /* PLL is in bypass mode */ - } - else - { - /* PLL is output enabled in normal work mode */ - u32NO = au8NoTbl[((u32PllReg & CLK_PLLCTL_OUTDIV_Msk) >> CLK_PLLCTL_OUTDIV_Pos)]; - u32NF = ((u32PllReg & CLK_PLLCTL_FBDIV_Msk) >> CLK_PLLCTL_FBDIV_Pos) + 2UL; - u32NR = ((u32PllReg & CLK_PLLCTL_INDIV_Msk) >> CLK_PLLCTL_INDIV_Pos) + 1UL; - - /* u32FIN is shifted 2 bits to avoid overflow */ - u32PllFreq = (((u32FIN >> 2) * (u32NF << 1)) / (u32NR * u32NO) << 2); - } - } - - return u32PllFreq; -} - -/** - * @brief Get selected module clock source - * @param[in] u32ModuleIdx is module index. - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref SEN_MODULE - * - \ref USBH_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref WDT_MODULE - * - \ref WWDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref CLKO_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref SPI4_MODULE - * - \ref SPI5_MODULE - * - \ref SPI6_MODULE - * - \ref SPI7_MODULE - * - \ref SPI8_MODULE - * - \ref SPI9_MODULE - * - \ref SPI10_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref EADC0_MODULE - * - \ref EADC1_MODULE - * - \ref EADC2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref PSIO_MODULE - * - \ref TRNG_MODULE - * - \ref KPI_MODULE - * @return Selected module clock source setting - * @details This function get selected module clock source. - */ -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx) -{ - uint32_t u32TmpVal = 0UL, u32TmpAddr = 0UL; - uint32_t au32SelTbl[5] = {0x0UL, 0x4UL, 0x8UL, 0xCUL, 0x4CUL}; /* CLK_CLKSEL0~4 */ - uint32_t u32RTCCKEN = CLK->APBCLK0 & CLK_APBCLK0_RTCCKEN_Msk; - - /* Get clock source selection setting */ - if (u32ModuleIdx == RTC_MODULE) - { - if (u32RTCCKEN == 0UL) - { - /* Enable RTC clock to get LXT clock source */ - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; - } - - u32TmpVal = ((RTC->LXTCTL & RTC_LXTCTL_RTCCKSEL_Msk) >> RTC_LXTCTL_RTCCKSEL_Pos); - - if (u32RTCCKEN == 0UL) - { - /* Disable RTC clock if it is disabled before */ - CLK->APBCLK0 &= (~CLK_APBCLK0_RTCCKEN_Msk); - } - - } - else if (MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32TmpAddr = (uint32_t)&CLK->CLKSEL0 + (au32SelTbl[MODULE_CLKSEL(u32ModuleIdx)]); - - /* Get clock source selection setting */ - u32TmpVal = ((inpw((uint32_t *)u32TmpAddr) & (MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx))) >> MODULE_CLKSEL_Pos(u32ModuleIdx)); - } - - return u32TmpVal; - -} - -/** - * @brief Get selected module clock divider number - * @param[in] u32ModuleIdx is module index. - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref SEN_MODULE - * - \ref USBH_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref EADC0_MODULE - * - \ref EADC1_MODULE - * - \ref EADC2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref PSIO_MODULE - * - \ref KPI_MODULE - * - \ref EMAC0_MODULE - * @return Selected module clock divider number setting - * @details This function get selected module clock divider number. - */ -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx) -{ - uint32_t u32DivVal = 0UL, u32DivAddr = 0UL; - uint32_t au32DivTbl[6] = {0x0UL, 0x4UL, 0x8UL, 0xCUL, 0x10UL, 0x1C}; /* CLK_CLKDIV0~5 */ - - switch (u32ModuleIdx) - { - /* For 8 bits divider */ - case EADC0_MODULE: - u32DivVal = (CLK->CLKDIV0 & CLK_CLKDIV0_EADC0DIV_Msk) >> CLK_CLKDIV0_EADC0DIV_Pos; - break; - case SDH0_MODULE: - u32DivVal = (CLK->CLKDIV0 & CLK_CLKDIV0_SDH0DIV_Msk) >> CLK_CLKDIV0_SDH0DIV_Pos; - break; - case SC0_MODULE: - u32DivVal = (CLK->CLKDIV1 & CLK_CLKDIV1_SC0DIV_Msk) >> CLK_CLKDIV1_SC0DIV_Pos; - break; - case SC1_MODULE: - u32DivVal = (CLK->CLKDIV1 & CLK_CLKDIV1_SC1DIV_Msk) >> CLK_CLKDIV1_SC1DIV_Pos; - break; - case SC2_MODULE: - u32DivVal = (CLK->CLKDIV1 & CLK_CLKDIV1_SC2DIV_Msk) >> CLK_CLKDIV1_SC2DIV_Pos; - break; - case PSIO_MODULE: - u32DivVal = (CLK->CLKDIV1 & CLK_CLKDIV1_PSIODIV_Msk) >> CLK_CLKDIV1_PSIODIV_Pos; - break; - case KPI_MODULE: - u32DivVal = (CLK->CLKDIV2 & CLK_CLKDIV2_KPIDIV_Msk) >> CLK_CLKDIV2_KPIDIV_Pos; - break; - case EADC1_MODULE: - u32DivVal = (CLK->CLKDIV2 & CLK_CLKDIV2_EADC1DIV_Msk) >> CLK_CLKDIV2_EADC1DIV_Pos; - break; - case SEN_MODULE: - u32DivVal = (CLK->CLKDIV3 & CLK_CLKDIV3_VSENSEDIV_Msk) >> CLK_CLKDIV3_VSENSEDIV_Pos; - break; - case EMAC0_MODULE: - u32DivVal = (CLK->CLKDIV3 & CLK_CLKDIV3_EMAC0DIV_Msk) >> CLK_CLKDIV3_EMAC0DIV_Pos; - break; - case SDH1_MODULE: - u32DivVal = (CLK->CLKDIV3 & CLK_CLKDIV3_SDH1DIV_Msk) >> CLK_CLKDIV3_SDH1DIV_Pos; - break; - case EADC2_MODULE: - u32DivVal = (CLK->CLKDIV5 & CLK_CLKDIV5_EADC2DIV_Msk) >> CLK_CLKDIV5_EADC2DIV_Pos; - break; - - /* Others */ - default: - { - /* Get clock divider control register address */ - u32DivAddr = (uint32_t)&CLK->CLKDIV0 + (au32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); - /* Get clock divider number setting */ - u32DivVal = ((inpw((uint32_t *)u32DivAddr) & (MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx))) >> MODULE_CLKDIV_Pos(u32ModuleIdx)); - } - break; - } - - return u32DivVal; -} - -/** - * @brief Disable PLLFN - * @param None - * @return None - * @details This function set PLLFN in Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisablePLLFN(void) -{ - CLK->PLLFNCTL1 |= CLK_PLLFNCTL1_PD_Msk; -} - -/** - * @brief Set PLLFN frequency - * @param[in] u32PllClkSrc is PLLFN clock source. Including : - * - \ref CLK_PLLFNCTL1_PLLSRC_HXT - * - \ref CLK_PLLFNCTL1_PLLSRC_HIRC - * @param[in] u32PllFreq is PLLFN frequency. The range of u32PllFreq is 50 MHz ~ 500 MHz. - * @return PLL frequency - * @details This function is used to configure PLLFNCTL0 and PLLFNCTL1 register to set specified PLLFN frequency. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_EnablePLLFN(uint32_t u32PllClkSrc, uint32_t u32PllFreq) -{ - uint32_t u32FIN, u32FVCO, u32FREF, u32PllClk; - uint32_t u32NR = 0UL, u32NF, u32NO, u32X = 0UL; - float fNX_X = 0.0, fX = 0.0; - - /* Disable PLLFN first to avoid unstable when setting PLLFN */ - CLK->PLLFNCTL1 |= CLK_PLLFNCTL1_PD_Msk; - - /* PLLFN source clock is from HXT */ - if (u32PllClkSrc == CLK_PLLFNCTL1_PLLSRC_HXT) - { - /* Enable HXT clock */ - CLK->PWRCTL |= CLK_PWRCTL_HXTEN_Msk; - - /* Wait for HXT clock ready */ - CLK_WaitClockReady(CLK_STATUS_HXTSTB_Msk); - - /* Select PLLFN source clock from HXT */ - u32FIN = __HXT; - } - - /* PLL source clock is from HIRC */ - else - { - /* Enable HIRC clock */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - - /* Wait for HIRC clock ready */ - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - - /* Select PLL source clock from HIRC */ - u32FIN = __HIRC; - } - - /* Check PLL frequency range */ - /* Constraint 1: 50MHz < FOUT < 500MHz */ - if ((u32PllFreq <= FREQ_500MHZ) && (u32PllFreq >= FREQ_50MHZ)) - { - /* Select "NO" according to request frequency */ - if ((u32PllFreq < FREQ_100MHZ) && (u32PllFreq >= FREQ_50MHZ)) - { - u32NO = 3UL; - u32FVCO = u32PllFreq << 2; - } - else if ((u32PllFreq < FREQ_200MHZ) && (u32PllFreq >= FREQ_100MHZ)) - { - u32NO = 1UL; - u32FVCO = u32PllFreq << 1; - } - else - { - u32NO = 0UL; - u32FVCO = u32PllFreq; - } - - /* u32NR start from 3 to avoid calculation overflow */ - u32NR = 3UL; - - for (; u32NR <= 32UL; u32NR++) /* max NR = 32 since NR = INDIV+1 and INDIV = 0~31 */ - { - u32FREF = u32FIN / u32NR; /* FREF = FIN/NR */ - - if ((u32FREF >= FREQ_1MHZ) && (u32FREF <= FREQ_8MHZ)) /* Constraint 2: 1MHz <= FREF <= 8MHz. */ - { - fNX_X = (float)((u32FVCO * u32NR) >> 1) / u32FIN; - u32NF = (uint32_t)fNX_X; - - if ((u32NF >= 12) && (u32NF <= 255)) /* Constraint 4: 12<= NF <= 255. */ - { - fX = fNX_X - u32NF; - u32X = (uint32_t)(fX * 4096); - break; - } - } - } - - /* Enable and apply new PLL setting. */ - CLK->PLLFNCTL0 = (u32X << CLK_PLLFNCTL0_FRDIV_Pos) | - (u32NO << CLK_PLLFNCTL0_OUTDIV_Pos) | - ((u32NR - 1UL) << CLK_PLLFNCTL0_INDIV_Pos) | - ((u32NF - 2UL) << CLK_PLLFNCTL0_FBDIV_Pos); - CLK->PLLFNCTL1 = u32PllClkSrc; - - /* Actual PLL output clock frequency. FOUT = (FIN/NR)*2*(NF.X)*(1/NO) */ - u32PllClk = (uint32_t)((float)u32FIN / (((u32NO + 1UL) * u32NR) << 11) * ((u32NF << 12) + u32X)); - } - - if ((u32PllFreq > FREQ_500MHZ) || (u32PllFreq < FREQ_50MHZ) || (u32NR == 33)) - { - /* Apply default PLL setting and return */ - CLK->PLLCTL = u32PllClkSrc | CLK_PLLCTL_192MHz_HXT; - - /* Actual PLL output clock frequency */ - u32PllClk = FREQ_192MHZ; - } - - /* Wait for PLL clock stable */ - CLK_WaitClockReady(CLK_STATUS_PLLFNSTB_Msk); - - /* Return actual PLL output clock frequency */ - return u32PllClk; -} - - -/** - * @brief Get PLLFN clock frequency - * @param None - * @return PLL frequency - * @details This function get PLLFN frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPLLFNClockFreq(void) -{ - uint32_t u32PllFreq = 0UL, u32PllReg0, u32PllReg1; - uint32_t u32FIN, u32NF, u32NR, u32NO, u32X; - uint8_t au8NoTbl[4] = {1U, 2U, 2U, 4U}; - - /* Get PLLFN configuration */ - u32PllReg0 = CLK->PLLFNCTL0; - u32PllReg1 = CLK->PLLFNCTL1; - - if (u32PllReg1 & (CLK_PLLFNCTL1_PD_Msk | CLK_PLLFNCTL1_OE_Msk)) - { - u32PllFreq = 0UL; /* PLLFN is in power down mode or fix low */ - } - else /* PLLFN is in normal mode */ - { - /* PLLFN source clock */ - if (u32PllReg1 & CLK_PLLFNCTL1_PLLSRC_Msk) - { - u32FIN = __HIRC; /* PLLFN source clock from HIRC */ - } - else - { - u32FIN = __HXT; /* PLLFN source clock from HXT */ - } - - /* Calculate PLLFN frequency */ - if (u32PllReg1 & CLK_PLLFNCTL1_BP_Msk) - { - u32PllFreq = u32FIN; /* PLLFN is in bypass mode */ - } - else - { - /* PLLFN is output enabled in normal work mode */ - u32NO = au8NoTbl[((u32PllReg0 & CLK_PLLFNCTL0_OUTDIV_Msk) >> CLK_PLLFNCTL0_OUTDIV_Pos)]; - u32NF = ((u32PllReg0 & CLK_PLLFNCTL0_FBDIV_Msk) >> CLK_PLLFNCTL0_FBDIV_Pos) + 2UL; - u32NR = ((u32PllReg0 & CLK_PLLFNCTL0_INDIV_Msk) >> CLK_PLLFNCTL0_INDIV_Pos) + 1UL; - u32X = ((u32PllReg0 & CLK_PLLFNCTL0_FRDIV_Msk) >> CLK_PLLFNCTL0_FRDIV_Pos); - - u32PllFreq = (uint32_t)((float)u32FIN / ((u32NO * u32NR) << 11) * (((u32NF << 12) + u32X))); - } - } - - return u32PllFreq; -} - - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_crc.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_crc.c deleted file mode 100644 index 7efaf744bf1..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_crc.c +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************//** - * @file crc.c - * @version V3.00 - * @brief Cyclic Redundancy Check(CRC) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_FUNCTIONS CRC Exported Functions - @{ -*/ - -/** - * @brief CRC Open - * - * @param[in] u32Mode CRC operation polynomial mode. Valid values are: - * - \ref CRC_CCITT - * - \ref CRC_8 - * - \ref CRC_16 - * - \ref CRC_32 - * @param[in] u32Attribute CRC operation data attribute. Valid values are combined with: - * - \ref CRC_CHECKSUM_COM - * - \ref CRC_CHECKSUM_RVS - * - \ref CRC_WDATA_COM - * - \ref CRC_WDATA_RVS - * @param[in] u32Seed Seed value. - * @param[in] u32DataLen CPU Write Data Length. Valid values are: - * - \ref CRC_CPU_WDATA_8 - * - \ref CRC_CPU_WDATA_16 - * - \ref CRC_CPU_WDATA_32 - * - * @return None - * - * @details This function will enable the CRC controller by specify CRC operation mode, attribute, initial seed and write data length. \n - * After that, user can start to perform CRC calculate by calling CRC_WRITE_DATA macro or CRC_DAT register directly. - */ -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen) -{ - CRC->SEED = u32Seed; - - switch (u32Mode) - { - case CRC_CCITT: - u32Mode = CRC_16; - CRC->POLYNOMIAL = 0x1021; - break; - case CRC_8: - CRC->POLYNOMIAL = 0x7; - break; - case CRC_16: - CRC->POLYNOMIAL = 0x8005; - break; - case CRC_32: - CRC->POLYNOMIAL = 0x04C11DB7; - break; - default: - CRC->POLYNOMIAL = 0x0ul; - break; - } - - CRC->CTL = u32Mode | u32Attribute | u32DataLen | CRC_CTL_CRCEN_Msk; - - /* Setting CHKSINIT bit will reload the initial seed value(CRC_SEED register) to CRC controller */ - CRC->CTL |= CRC_CTL_CHKSINIT_Msk; -} - -/** - * @brief Get CRC Checksum - * - * @param[in] None - * - * @return Checksum Result - * - * @details This function gets the CRC checksum result by current CRC polynomial mode. - */ -uint32_t CRC_GetChecksum(void) -{ - uint32_t u32Checksum = 0UL; - - switch (CRC->CTL & CRC_CTL_CRCMODE_Msk) - { - case CRC_CCITT: - case CRC_16: - u32Checksum = (CRC->CHECKSUM & 0xFFFFUL); - break; - - case CRC_32: - u32Checksum = CRC->CHECKSUM; - break; - - case CRC_8: - u32Checksum = (CRC->CHECKSUM & 0xFFUL); - break; - - default: - break; - } - - return u32Checksum; -} - -/**@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_crypto.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_crypto.c deleted file mode 100644 index dbab8807702..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_crypto.c +++ /dev/null @@ -1,3036 +0,0 @@ -/**************************************************************************//** - * @file crypto.c - * @version V3.00 - * @brief Cryptographic Accelerator driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include -#ifdef __has_include - #if __has_include("strings.h") - #include - #endif -#endif -#include "NuMicro.h" - -#define ENABLE_DEBUG 0 - -#define ECC_SCA_PROTECT 1 // Enable Side-Channel Protecton - -#if ENABLE_DEBUG - #define CRPT_DBGMSG printf -#else - #define CRPT_DBGMSG(...) do { } while (0) /* disable debug */ -#endif - -#if defined(__ICCARM__) - #pragma diag_suppress=Pm073, Pm143, Pe223 /* Misra C rule 14.7 */ -#endif - -#define TIMEOUT_ECC SystemCoreClock /* 1 second time-out */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - -/* // @cond HIDDEN_SYMBOLS */ - - -static char hex_char_tbl[] = "0123456789abcdef"; - -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count); -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx); -static void Hex2Reg(char input[], uint32_t volatile reg[]); -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]); -static char ch2hex(char ch); -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift); -static int get_nibble_value(char c); -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]); -void ECC_Complete(CRPT_T *crpt); - - -/* // @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Open PRNG function - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32KeySize it is PRNG key size, including: - * - \ref PRNG_KEY_SIZE_128 - * - \ref PRNG_KEY_SIZE_192 - * - \ref PRNG_KEY_SIZE_224 - * - \ref PRNG_KEY_SIZE_255 - * - \ref PRNG_KEY_SIZE_256 - * - \ref PRNG_KEY_SIZE_283 - * - \ref PRNG_KEY_SIZE_384 - * - \ref PRNG_KEY_SIZE_409 - * - \ref PRNG_KEY_SIZE_512 - * - \ref PRNG_KEY_SIZE_521 - * - \ref PRNG_KEY_SIZE_571 - * @param[in] u32SeedReload is PRNG seed reload or not, including: - * - \ref PRNG_SEED_CONT - * - \ref PRNG_SEED_RELOAD - * @param[in] u32Seed The new seed. Only valid when u32SeedReload is PRNG_SEED_RELOAD. - * @return None - */ -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed) -{ - if (u32SeedReload) - { - crpt->PRNG_SEED = u32Seed; - } - - crpt->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | PRNG_CTL_SEEDSRC_SEEDREG | - (u32SeedReload << CRPT_PRNG_CTL_SEEDRLD_Pos); -} - -/** - * @brief Start to generate one PRNG key. - * @param[in] crpt The pointer of CRYPTO module - * @retval 0 Generate PRNG key success. - * @retval -1 Generate PRNG key time-out. - */ -int32_t PRNG_Start(CRPT_T *crpt) -{ - int32_t i32TimeOutCnt = SystemCoreClock; /* 1 second time-out */ - - crpt->PRNG_CTL |= CRPT_PRNG_CTL_START_Msk; - - /* Waiting for PRNG Busy */ - while (crpt->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - return -1; - } - } - - return 0; -} - -/** - * @brief Read the PRNG key. - * @param[in] crpt The pointer of CRYPTO module - * @param[out] u32RandKey The key buffer to store newly generated PRNG key. - * @return None - */ -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]) -{ - uint32_t i, wcnt; - uint32_t au32WcntTbl[7] = {4, 6, 6, 7, 8, 8, 8}; - - wcnt = ((crpt->PRNG_CTL & CRPT_PRNG_CTL_KEYSZ_Msk) >> CRPT_PRNG_CTL_KEYSZ_Pos); - if (wcnt > 6) return; - else wcnt = au32WcntTbl[wcnt]; - - for (i = 0U; i < wcnt; i++) - { - u32RandKey[i] = crpt->PRNG_KEY[i]; - } - - crpt->PRNG_CTL &= ~CRPT_PRNG_CTL_SEEDRLD_Msk; -} - - -/** - * @brief Open AES encrypt/decrypt function. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32EncDec 1: AES encode; 0: AES decode - * @param[in] u32OpMode AES operation mode, including: - * - \ref AES_MODE_ECB - * - \ref AES_MODE_CBC - * - \ref AES_MODE_CFB - * - \ref AES_MODE_OFB - * - \ref AES_MODE_CTR - * - \ref AES_MODE_CBC_CS1 - * - \ref AES_MODE_CBC_CS2 - * - \ref AES_MODE_CBC_CS3 - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @param[in] u32SwapType is AES input/output data swap control, including: - * - \ref AES_NO_SWAP - * - \ref AES_OUT_SWAP - * - \ref AES_IN_SWAP - * - \ref AES_IN_OUT_SWAP - * @return None - */ -void AES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, - uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType) -{ - (void)u32Channel; - - crpt->AES_CTL = (u32EncDec << CRPT_AES_CTL_ENCRPT_Pos) | - (u32OpMode << CRPT_AES_CTL_OPMODE_Pos) | - (u32KeySize << CRPT_AES_CTL_KEYSZ_Pos) | - (u32SwapType << CRPT_AES_CTL_OUTSWAP_Pos); - -} - -/** - * @brief Start AES encrypt/decrypt - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32DMAMode AES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shot AES encrypt/decrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous AES encrypt/decrypt. - * - \ref CRYPTO_DMA_LAST Last AES encrypt/decrypt of a series of AES_Start. - * @return None - */ -void AES_Start(CRPT_T *crpt, int32_t u32Channel, uint32_t u32DMAMode) -{ - (void)u32Channel; - - crpt->AES_CTL |= CRPT_AES_CTL_START_Msk | (u32DMAMode << CRPT_AES_CTL_DMALAST_Pos); -} - -/** - * @brief Set AES keys - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32Keys An word array contains AES keys. - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @return None - */ -void AES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize) -{ - uint32_t i, wcnt, key_reg_addr; - - (void) u32Channel; - - key_reg_addr = (uint32_t)&crpt->AES_KEY[0]; - wcnt = 4UL + u32KeySize * 2UL; - - for (i = 0U; i < wcnt; i++) - { - outpw(key_reg_addr, au32Keys[i]); - key_reg_addr += 4UL; - } -} - - - -/** - * @brief Set AES keys index of Key Store - * @param[in] crpt The pointer of CRYPTO module - * @param[in] mem Memory type of Key Store key. it could be: - * - \ref KS_SRAM - * - \ref KS_FLASH - * - \ref KS_OTP - * @param[in] i32KeyIdx Index of the key in Key Store. - * @details AES could use the key in Key Store. This function is used to set the key index of Key Store. - */ -void AES_SetKey_KS(CRPT_T *crpt, KS_MEM_Type mem, int32_t i32KeyIdx) -{ - /* Use key in key store */ - crpt->AES_KSCTL = CRPT_AES_KSCTL_RSRC_Msk /* use KS */ | - (uint32_t)((int)mem << CRPT_AES_KSCTL_RSSRC_Pos) /* KS Memory type */ | - (uint32_t)i32KeyIdx /* key num */ ; - -} - - -/** - * @brief Set AES initial vectors - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32IV A four entry word array contains AES initial vectors. - * @return None - */ -void AES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32IV[]) -{ - uint32_t i, key_reg_addr; - - (void) u32Channel; - - key_reg_addr = (uint32_t)&crpt->AES_IV[0]; - - for (i = 0U; i < 4U; i++) - { - outpw(key_reg_addr, au32IV[i]); - key_reg_addr += 4UL; - } -} - -/** - * @brief Set AES DMA transfer configuration. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32SrcAddr AES DMA source address - * @param[in] u32DstAddr AES DMA destination address - * @param[in] u32TransCnt AES DMA transfer byte count - * @return None - */ -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, - uint32_t u32DstAddr, uint32_t u32TransCnt) -{ - (void) u32Channel; - - crpt->AES_SADDR = u32SrcAddr; - crpt->AES_DADDR = u32DstAddr; - crpt->AES_CNT = u32TransCnt; - -} - -/** - * @brief Open SHA encrypt function. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32OpMode SHA operation mode, including: - * - \ref SHA_MODE_SHA1 - * - \ref SHA_MODE_SHA224 - * - \ref SHA_MODE_SHA256 - * @param[in] u32SwapType is SHA input/output data swap control, including: - * - \ref SHA_NO_SWAP - * - \ref SHA_OUT_SWAP - * - \ref SHA_IN_SWAP - * - \ref SHA_IN_OUT_SWAP - * @param[in] hmac_key_len HMAC key byte count - * @return None - */ -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len) -{ - crpt->HMAC_CTL = (u32OpMode << CRPT_HMAC_CTL_OPMODE_Pos) | - (u32SwapType << CRPT_HMAC_CTL_OUTSWAP_Pos); - - if (hmac_key_len != 0UL) - { - crpt->HMAC_KEYCNT = hmac_key_len; - } -} - -/** - * @brief Start SHA encrypt - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32DMAMode TDES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop SHA encrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous SHA encrypt. - * - \ref CRYPTO_DMA_LAST Last SHA encrypt of a series of SHA_Start. - * @return None - */ -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode) -{ - crpt->HMAC_CTL &= ~(0x7UL << CRPT_HMAC_CTL_DMALAST_Pos); - crpt->HMAC_CTL |= CRPT_HMAC_CTL_START_Msk | (u32DMAMode << CRPT_HMAC_CTL_DMALAST_Pos); -} - -/** - * @brief Set SHA DMA transfer - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32SrcAddr SHA DMA source address - * @param[in] u32TransCnt SHA DMA transfer byte count - * @return None - */ -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt) -{ - crpt->HMAC_SADDR = u32SrcAddr; - crpt->HMAC_DMACNT = u32TransCnt; -} - -/** - * @brief Read the SHA digest. - * @param[in] crpt The pointer of CRYPTO module - * @param[out] u32Digest The SHA encrypt output digest. - * @return None - */ -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]) -{ - uint32_t i, wcnt, reg_addr; - - i = (crpt->HMAC_CTL & CRPT_HMAC_CTL_OPMODE_Msk) >> CRPT_HMAC_CTL_OPMODE_Pos; - - if (i == SHA_MODE_SHA1) - { - wcnt = 5UL; - } - else if (i == SHA_MODE_SHA224) - { - wcnt = 7UL; - } - else if (i == SHA_MODE_SHA256) - { - wcnt = 8UL; - } - else if (i == SHA_MODE_SHA384) - { - wcnt = 12UL; - } - else - { - /* SHA_MODE_SHA512 */ - wcnt = 16UL; - } - - reg_addr = (uint32_t) & (crpt->HMAC_DGST[0]); - for (i = 0UL; i < wcnt; i++) - { - u32Digest[i] = inpw(reg_addr); - reg_addr += 4UL; - } -} - - -/*-----------------------------------------------------------------------------------------------*/ -/* */ -/* ECC */ -/* */ -/*-----------------------------------------------------------------------------------------------*/ - -#define ECCOP_POINT_MUL (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_MODULE (0x1UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_ADD (0x2UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_DOUBLE (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) - -#define MODOP_DIV (0x0UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_MUL (0x1UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_ADD (0x2UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_SUB (0x3UL << CRPT_ECC_CTL_MODOP_Pos) - -#define OP_ECDSAS (0x1UL << CRPT_ECC_CTL_ECDSAS_Pos) -#define OP_ECDSAR (0x1UL << CRPT_ECC_CTL_ECDSAR_Pos) - -enum -{ - CURVE_GF_P, - CURVE_GF_2M, -}; - -/*-----------------------------------------------------*/ -/* Define elliptic curve (EC): */ -/*-----------------------------------------------------*/ -static const ECC_CURVE _Curve[] = -{ - { - /* NIST: Curve P-192 : y^2=x^3-ax+b (mod p) */ - CURVE_P_192, - 48, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", /* "000000000000000000000000000000000000000000000003" */ - "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", - "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012", - "07192b95ffc8da78631011ed6b24cdd573f977a11e794811", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", /* "6277101735386680763835789423207666416083908700390324961279" */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", /* "6277101735386680763835789423176059013767194773182842284081" */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* NIST: Curve P-224 : y^2=x^3-ax+b (mod p) */ - CURVE_P_224, - 56, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", /* "00000000000000000000000000000000000000000000000000000003" */ - "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", - "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", - "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "0026959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", /* "0026959946667150639794667015087019625940457807714424391721682722368061" */ - 224, /* key_len */ - 9, - 8, - 3, - CURVE_GF_P - }, - { - /* NIST: Curve P-256 : y^2=x^3-ax+b (mod p) */ - CURVE_P_256, - 64, /* Echar */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", /* "0000000000000000000000000000000000000000000000000000000000000003" */ - "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", - "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", - "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", - 78, /* Epl */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", /* "115792089210356248762697446949407573530086143415290314195533631308867097853951" */ - 78, /* Eol */ - "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", /* "115792089210356248762697446949407573529996955224135760342422259061068512044369" */ - 256, /* key_len */ - 10, - 5, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-384 : y^2=x^3-ax+b (mod p) */ - CURVE_P_384, - 96, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", /* "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", - "aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", - "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", - 116, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", /* "39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319" */ - 116, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", /* "39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643" */ - 384, /* key_len */ - 12, - 3, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-521 : y^2=x^3-ax+b (mod p)*/ - CURVE_P_521, - 131, /* Echar */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", /* "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", - "0c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", - "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", - 157, /* Epl */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151" */ - 157, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449" */ - 521, /* key_len */ - 32, - 32, - 32, - CURVE_GF_P - }, - { - /* NIST: Curve B-163 : y^2+xy=x^3+ax^2+b */ - CURVE_B_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "20a601907b8c953ca1481eb10512f78744a3205fd", - "3f0eba16286a2d57ea0991168d4994637e8343e36", - "0d51fbc6c71a0094fa2cdd545b11c5c0c797324f1", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "40000000000000000000292FE77E70C12A4234C33", /* "5846006549323611672814742442876390689256843201587" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve B-233 : y^2+xy=x^3+ax^2+b */ - CURVE_B_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000001", - "066647ede6c332c7f8c0923bb58213b333b20e9ce4281fe115f7d8f90ad", - "0fac9dfcbac8313bb2139f1bb755fef65bc391f8b36f8f8eb7371fd558b", - "1006a08a41903350678e58528bebf8a0beff867a7ca36716f7e01f81052", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "1000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", /* "6901746346790563787434755862277025555839812737345013555379383634485463" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve B-283 : y^2+xy=x^3+ax^2+b */ - CURVE_B_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000001", - "27b680ac8b8596da5a4af8a19a0303fca97fd7645309fa2a581485af6263e313b79a2f5", - "5f939258db7dd90e1934f8c70b0dfec2eed25b8557eac9c80e2e198f8cdbecd86b12053", - "3676854fe24141cb98fe6d4b20d02b4516ff702350eddb0826779c813f0df45be8112f4", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", /* "7770675568902916283677847627294075626569625924376904889109196526770044277787378692871" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve B-409 : y^2+xy=x^3+ax^2+b */ - CURVE_B_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "021a5c2c8ee9feb5c4b9a753b7b476b7fd6422ef1f3dd674761fa99d6ac27c8a9a197b272822f6cd57a55aa4f50ae317b13545f", - "15d4860d088ddb3496b0c6064756260441cde4af1771d4db01ffe5b34e59703dc255a868a1180515603aeab60794e54bb7996a7", - "061b1cfab6be5f32bbfa78324ed106a7636b9c5a7bd198d0158aa4f5488d08f38514f1fdf4b4f40d2181b3681c364ba0273c706", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "10000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", /* "661055968790248598951915308032771039828404682964281219284648798304157774827374805208143723762179110965979867288366567526771" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve B-571 : y^2+xy=x^3+ax^2+b */ - CURVE_B_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a", - "303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19", - "37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", /* "3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* NIST: Curve K-163 : y^2+xy=x^3+ax^2+b */ - CURVE_K_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "00000000000000000000000000000000000000001", - "2fe13c0537bbc11acaa07d793de4e6d5e5c94eee8", - "289070fb05d38ff58321f2e800536d538ccdaa3d9", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "4000000000000000000020108A2E0CC0D99F8A5EF", /* "5846006549323611672814741753598448348329118574063" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve K-233 : y^2+xy=x^3+ax^2+b */ - CURVE_K_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000001", - "17232ba853a7e731af129f22ff4149563a419c26bf50a4c9d6eefad6126", - "1db537dece819b7f70f555a67c427a8cd9bf18aeb9b56e0c11056fae6a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", /* "3450873173395281893717377931138512760570940988862252126328087024741343" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve K-283 : y^2+xy=x^3+ax^2+b */ - CURVE_K_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000001", - "503213f78ca44883f1a3b8162f188e553cd265f23c1567a16876913b0c2ac2458492836", - "1ccda380f1c9e318d90f95d07e5426fe87e45c0e8184698e45962364e34116177dd2259", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", /* "3885337784451458141838923813647037813284811733793061324295874997529815829704422603873" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve K-409 : y^2+xy=x^3+ax^2+b */ - CURVE_K_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746", - "1e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", /* "330527984395124299475957654016385519914202341482140609642324395022880711289249191050673258457777458014096366590617731358671" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve K-571 : y^2+xy=x^3+ax^2+b */ - CURVE_K_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "26eb7a859923fbc82189631f8103fe4ac9ca2970012d5d46024804801841ca44370958493b205e647da304db4ceb08cbbd1ba39494776fb988b47174dca88c7e2945283a01c8972", - "349dc807f4fbf374f4aeade3bca95314dd58cec9f307a54ffc61efc006d8a2c9d4979c0ac44aea74fbebbb9f772aedcb620b01a7ba7af1b320430c8591984f601cd4c143ef1c7a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "20000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", /* "1932268761508629172347675945465993672149463664853217499328617625725759571144780212268133978522706711834706712800825351461273674974066617311929682421617092503555733685276673" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* Koblitz: Curve secp192k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_192, - 48, /* Echar */ - "00000000000000000000000000000000000000000", - "00000000000000000000000000000000000000003", - "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", - "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", /* p */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", /* n */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp224k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_224, - 56, /* Echar */ - "00000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000005", - "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", - "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", /* p */ - 70, /* Eol */ - "0000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", /* n */ - 224, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp256k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_256, - 64, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000007", - "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", - "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", - 78, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", /* p */ - 78, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", /* n */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP256r1 */ - CURVE_BP_256, - 64, /* Echar */ - "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", /* A */ - "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", /* B */ - "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", /* x */ - "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", /* y */ - 78, /* Epl */ - "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", /* p */ - 78, /* Eol */ - "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", /* q */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP384r1 */ - CURVE_BP_384, - 96, /* Echar */ - "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", /* A */ - "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", /* B */ - "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", /* x */ - "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", /* y */ - 116, /* Epl */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", /* p */ - 116, /* Eol */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", /* q */ - 384, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP512r1 */ - CURVE_BP_512, - 128, /* Echar */ - "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", /* A */ - "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", /* B */ - "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", /* x */ - "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", /* y */ - 156, /* Epl */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", /* p */ - 156, /* Eol */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", /* q */ - 512, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - CURVE_25519, - 64, // Echar - "0000000000000000000000000000000000000000000000000000000000076D06", // "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000009", - "20ae19a1b8a086b4e01edd2c7748d14c923d4d7e6d7c61b229e9c5a27eced3d9", - 78, // Epl - "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed", // "115792089210356248762697446949407573530086143415290314195533631308867097853951", - 78, // Eol - "1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed", // "115792089210356248762697446949407573529996955224135760342422259061068512044369", - 255, // key_len - 10, - 5, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-256 : y^2=x^3-ax+b (mod p) */ - CURVE_SM2_256, - 64, /* Echar */ - "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC", /* a */ - "28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93", /* b */ - "32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7", /* x */ - "BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0", /* y */ - 78, /* Epl */ - "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF", /* p */ - 78, /* Eol */ - "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", /* n */ - 256, /* key_len */ - 10, - 5, - 2, - CURVE_GF_P - }, - -}; - - -static ECC_CURVE *pCurve; -static ECC_CURVE Curve_Copy; - -static ECC_CURVE *get_curve(E_ECC_CURVE ecc_curve); -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve); -static int32_t run_ecc_codec(CRPT_T *crpt, uint32_t mode); - -static char temp_hex_str[160]; - -static volatile uint32_t g_ECC_done, g_ECCERR_done; - -void ECC_DriverISR(CRPT_T *crpt) -{ - if (crpt->INTSTS & CRPT_INTSTS_ECCIF_Msk) - { - g_ECC_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCIF_Msk; - /* printf("ECC done IRQ.\n"); */ - } - - if (crpt->INTSTS & CRPT_INTSTS_ECCEIF_Msk) - { - g_ECCERR_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCEIF_Msk; - /* printf("ECCERRIF is set!!\n"); */ - } -} - - -#if ENABLE_DEBUG -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ - int32_t i; - - printf("%s => ", str); - for (i = 0; i < count; i++) - { - printf("0x%08x ", regs[i]); - } - printf("\n"); -} -#else -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ - (void)str; - (void)regs; - (void)count; -} -#endif -static char ch2hex(char ch) -{ - if (ch <= '9') - { - return ch - '0'; - } - else if ((ch <= 'z') && (ch >= 'a')) - { - return ch - 'a' + 10U; - } - else - { - return ch - 'A' + 10U; - } -} - -static void Hex2Reg(char input[], uint32_t volatile reg[]) -{ - char hex; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0; - - while (si >= 0) - { - val32 = 0UL; - for (i = 0UL; (i < 8UL) && (si >= 0); i++) - { - hex = ch2hex(input[si]); - val32 |= (uint32_t)hex << (i * 4UL); - si--; - } - reg[ri++] = val32; - } -} - -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift) -{ - uint32_t hex, carry; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0; - carry = 0U; - while (si >= 0) - { - val32 = 0UL; - for (i = 0UL; (i < 8UL) && (si >= 0); i++) - { - hex = (uint32_t)ch2hex(input[si]); - hex <<= shift; - - val32 |= (uint32_t)((hex & 0xFU) | carry) << (i * 4UL); - carry = (hex >> 4) & 0xFU; - si--; - } - reg[ri++] = val32; - } - if (carry != 0U) - { - reg[ri] = carry; - } -} - -/** - * @brief Extract specified nibble from an unsigned word in character format. - * For example: - * Suppose val32 is 0x786543210, get_Nth_nibble_char(val32, 3) will return a '3'. - * @param[in] val32 The input unsigned word - * @param[in] idx The Nth nibble to be extracted. - * @return The nibble in character format. - */ -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx) -{ - return hex_char_tbl[(val32 >> (idx * 4U)) & 0xfU ]; -} - - -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]) -{ - int32_t idx, ri; - uint32_t i; - - output[count] = 0U; - idx = count - 1; - - for (ri = 0; idx >= 0; ri++) - { - for (i = 0UL; (i < 8UL) && (idx >= 0); i++) - { - output[idx] = get_Nth_nibble_char(reg[ri], i); - idx--; - } - } -} - -/** - * @brief Translate registers value into hex string - * @param[in] count The string length of ouptut hex string. - * @param[in] reg Register array. - * @param[in] output String buffer for output hex string. - */ -void CRPT_Reg2Hex(int32_t count, volatile uint32_t reg[], char output[]) -{ - Reg2Hex(count, reg, output); -} - -/** - * @brief Translate hex string to registers value - * @param[in] input hex string. - * @param[in] reg Register array. - */ -void CRPT_Hex2Reg(char input[], uint32_t volatile reg[]) -{ - Hex2Reg(input, reg); -} - - -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve) -{ - int32_t i, ret = 0; - - pCurve = get_curve(ecc_curve); - if (pCurve == NULL) - { - CRPT_DBGMSG("Cannot find curve %d!!\n", ecc_curve); - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_A[i] = 0UL; - crpt->ECC_B[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_N[i] = 0UL; - } - - Hex2Reg(pCurve->Ea, crpt->ECC_A); - Hex2Reg(pCurve->Eb, crpt->ECC_B); - Hex2Reg(pCurve->Px, crpt->ECC_X1); - Hex2Reg(pCurve->Py, crpt->ECC_Y1); - - CRPT_DBGMSG("Key length = %d\n", pCurve->key_len); - dump_ecc_reg("CRPT_ECC_CURVE_A", crpt->ECC_A, 10); - dump_ecc_reg("CRPT_ECC_CURVE_B", crpt->ECC_B, 10); - dump_ecc_reg("CRPT_ECC_POINT_X1", crpt->ECC_X1, 10); - dump_ecc_reg("CRPT_ECC_POINT_Y1", crpt->ECC_Y1, 10); - - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_N[0] = 0x1UL; - crpt->ECC_N[(pCurve->key_len) / 32] |= (1UL << ((pCurve->key_len) % 32)); - crpt->ECC_N[(pCurve->irreducible_k1) / 32] |= (1UL << ((pCurve->irreducible_k1) % 32)); - crpt->ECC_N[(pCurve->irreducible_k2) / 32] |= (1UL << ((pCurve->irreducible_k2) % 32)); - crpt->ECC_N[(pCurve->irreducible_k3) / 32] |= (1UL << ((pCurve->irreducible_k3) % 32)); - } - else - { - Hex2Reg(pCurve->Pp, crpt->ECC_N); - } - } - dump_ecc_reg("CRPT_ECC_CURVE_N", crpt->ECC_N, 10); - return ret; -} - - -static int get_nibble_value(char c) -{ - char ch; - - if ((c >= '0') && (c <= '9')) - { - ch = '0'; - return ((int)c - (int)ch); - } - - if ((c >= 'a') && (c <= 'f')) - { - ch = 'a'; - return ((int)c - (int)ch + 10); - } - - if ((c >= 'A') && (c <= 'F')) - { - ch = 'A'; - return ((int)c - (int)ch + 10); - } - return 0; -} - - -/** - * @brief Check if the private key is located in valid range of curve. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k The input private key. - * @return 1 Is valid. - * @return 0 Is not valid. - * @return -1 Invalid curve. - */ -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]) -{ - uint32_t i; - - (void)crpt; - pCurve = get_curve(ecc_curve); - if (pCurve == NULL) - { - return -1; - } - - if (strlen(private_k) < strlen(pCurve->Eorder)) - { - return 1; - } - - if (strlen(private_k) > strlen(pCurve->Eorder)) - { - return 0; - } - - for (i = 0U; i < strlen(private_k); i++) - { - if (get_nibble_value(private_k[i]) < get_nibble_value(pCurve->Eorder[i])) - { - return 1; - } - - if (get_nibble_value(private_k[i]) > get_nibble_value(pCurve->Eorder[i])) - { - return 0; - } - } - return 0; -} - - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] private_k The input private key. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] public_k1 The output publick key 1. - * @param[out] public_k2 The output publick key 2. - * @return 0 Success. - * @return -1 Hardware error or time-out. - * @return -2 "ecc_curve" value is invalid. - */ -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]) -{ - int32_t ret = 0, i, i32TimeOutCnt; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -2; - } - - if (ret == 0) - { - CRPT->ECC_KSCTL = 0; - - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - - Hex2Reg(private_k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - i32TimeOutCnt = TIMEOUT_ECC; - while (g_ECC_done == 0UL) - { - if ((i32TimeOutCnt-- <= 0) || g_ECCERR_done) - { - ret = -1; - break; - } - } - } - - if (ret == 0) - { - Reg2Hex(pCurve->Echar, crpt->ECC_X1, public_k1); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, public_k2); - } - - return ret; -} - - - - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] mem Memory type of Key Store. It could be KS_SRAM, KS_FLASH or KS_OTP. - * @param[in] i32KeyIdx Index of the key in Key Store. - * @param[out] public_k1 The output publick key 1. - * @param[out] public_k2 The output publick key 2. - * @param[in] u32ExtraOp Extra options for ECC_KSCTL register. - * @return 0 Success. - * @return -1 Hardware error or time-out. - * @return -2 "ecc_curve" value is invalid. - */ -int32_t ECC_GeneratePublicKey_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[], uint32_t u32ExtraOp) -{ - int32_t ret = 0, i32TimeOutCnt; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -2; - } - - if (ret == 0) - { - - // key from key store - crpt->ECC_KSCTL = (uint32_t)(mem << 6)/* KS Memory Type */ | - (CRPT_ECC_KSCTL_RSRCK_Msk)/* Key from KS */ | - u32ExtraOp | - (uint32_t)i32KeyIdx; - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - i32TimeOutCnt = TIMEOUT_ECC; - while (g_ECC_done == 0UL) - { - if ((i32TimeOutCnt-- <= 0) || g_ECCERR_done) - { - ret = -1; - break; - } - } - } - - if (ret == 0) - { - Reg2Hex(pCurve->Echar, crpt->ECC_X1, public_k1); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, public_k2); - } - - return ret; -} - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt Reference to Crypto module. - * @param[out] x1 The x-coordinate of input point. - * @param[out] y1 The y-coordinate of input point. - * @param[in] k The private key - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] x2 The x-coordinate of output point. - * @param[out] y2 The y-coordinate of output point. - * @return 0 Success. - * @return -1 Hardware error or time-out. - * @return -2 "ecc_curve" value is invalid. - */ -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]) -{ - int32_t i, ret = 0, i32TimeOutCnt; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -2; - } - - if (ret == 0) - { - for (i = 0; i < 9; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_K[i] = 0UL; - } - - Hex2Reg(x1, crpt->ECC_X1); - Hex2Reg(y1, crpt->ECC_Y1); - Hex2Reg(k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - - if (ecc_curve == CURVE_25519) - { - printf("!! Is curve-25519 !!\n"); - crpt->ECC_CTL |= CRPT_ECC_CTL_SCAP_Msk; - crpt->ECC_CTL |= CRPT_ECC_CTL_CSEL_Msk; - - /* If SCAP enabled, the curve order must be written to ECC_X2 */ - if (crpt->ECC_CTL & CRPT_ECC_CTL_SCAP_Msk) - { - Hex2Reg(pCurve->Eorder, crpt->ECC_X2); - } - } - - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - i32TimeOutCnt = TIMEOUT_ECC; - while (g_ECC_done == 0UL) - { - if ((i32TimeOutCnt-- <= 0) || g_ECCERR_done) - { - ret = -1; - break; - } - } - } - - if (ret == 0) - { - Reg2Hex(pCurve->Echar, crpt->ECC_X1, x2); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, y2); - } - - return ret; -} - - -/** - * @brief Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k One's own private key. - * @param[in] public_k1 The other party's publick key 1. - * @param[in] public_k2 The other party's publick key 2. - * @param[out] secret_z The ECC CDH secret Z. - * @return 0 Success. - * @return -1 Hardware error or time-out. - * @return -2 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]) -{ - int32_t i, ret = 0, i32TimeOutCnt; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -2; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - if ((ecc_curve == CURVE_B_163) || (ecc_curve == CURVE_B_233) || (ecc_curve == CURVE_B_283) || - (ecc_curve == CURVE_B_409) || (ecc_curve == CURVE_B_571) || (ecc_curve == CURVE_K_163)) - { - Hex2RegEx(private_k, crpt->ECC_K, 1); - } - else if ((ecc_curve == CURVE_K_233) || (ecc_curve == CURVE_K_283) || - (ecc_curve == CURVE_K_409) || (ecc_curve == CURVE_K_571)) - { - Hex2RegEx(private_k, crpt->ECC_K, 2); - } - else - { - Hex2Reg(private_k, crpt->ECC_K); - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - i32TimeOutCnt = TIMEOUT_ECC; - while (g_ECC_done == 0UL) - { - if ((i32TimeOutCnt-- <= 0) || g_ECCERR_done) - { - ret = -1; - break; - } - } - } - - if (ret == 0) - { - Reg2Hex(pCurve->Echar, crpt->ECC_X1, secret_z); - } - - return ret; -} - - -/** - * @brief Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k One's own private key. - * @param[in] public_k1 The other party's publick key 1. - * @param[in] public_k2 The other party's publick key 2. - * @param[out] secret_z The ECC CDH secret Z. - * @return 0 Success. - * @return -1 Hardware error or time-out. - * @return -2 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSecretZ_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, KS_MEM_Type mem, int32_t i32KeyIdx, char public_k1[], char public_k2[]) -{ - int32_t i, i32TimeOutCnt; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - return -2; - } - - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - crpt->ECC_KSCTL = CRPT_ECC_KSCTL_ECDH_Msk | CRPT_ECC_KSCTL_RSRCK_Msk | CRPT_ECC_KSCTL_WDST_Msk | - (uint32_t)(mem << CRPT_ECC_KSCTL_RSSRCK_Pos)/* KS Memory Type */ | - (uint32_t)i32KeyIdx; - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else /* CURVE_GF_P */ - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - i32TimeOutCnt = TIMEOUT_ECC; - while (g_ECC_done == 0UL) - { - if ((i32TimeOutCnt-- <= 0) || g_ECCERR_done) - { - return -1; - } - } - - return (crpt->ECC_KSSTS & 0x1f); - -} - - -static int32_t run_ecc_codec(CRPT_T *crpt, uint32_t mode) -{ - uint32_t eccop; - int32_t i32TimeOutCnt; - - eccop = mode & CRPT_ECC_CTL_ECCOP_Msk; - if (eccop == ECCOP_MODULE) - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - else - { - if (pCurve->GF == (int)CURVE_GF_2M) - { - /* point */ - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - -#ifdef ECC_SCA_PROTECT - if (eccop == ECCOP_POINT_MUL) - { - /* Enable side-channel protection in some operation */ - crpt->ECC_CTL |= CRPT_ECC_CTL_SCAP_Msk; - /* If SCAP enabled, the curve order must be written to ECC_X2 */ - Hex2Reg(pCurve->Eorder, crpt->ECC_X2); - } -#endif - - } - - g_ECC_done = g_ECCERR_done = 0UL; - - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | mode | CRPT_ECC_CTL_START_Msk; - - i32TimeOutCnt = TIMEOUT_ECC; - while (g_ECC_done == 0UL) - { - if ((i32TimeOutCnt-- <= 0) || g_ECCERR_done) - { - return -1; - } - } - - i32TimeOutCnt = TIMEOUT_ECC; - while (crpt->ECC_STS & CRPT_ECC_STS_BUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - return -1; - } - } - - return 0; -} - -/** - * @brief ECDSA digital signature generation. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] d The private key. - * @param[in] k The selected random integer. - * @param[out] R R of the (R,S) pair digital signature - * @param[out] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *d, char *k, char *R, char *S) -{ - uint32_t volatile temp_result1[18], temp_result2[18]; - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - CRPT->ECC_KSCTL = 0; - - /* - * 1. Calculate e = HASH(m), where HASH is a cryptographic hashing algorithm, (i.e. SHA-1) - * (1) Use SHA to calculate e - */ - - /* 2. Select a random integer k form [1, n-1] - * (1) Notice that n is order, not prime modulus or irreducible polynomial function - */ - - /* - * 3. Compute r = x1 (mod n), where (x1, y1) = k * G. If r = 0, go to step 2 - * (1) Write the curve parameter A, B, and curve length M to corresponding registers - * (2) Write the prime modulus or irreducible polynomial function to N registers according - * (3) Write the point G(x, y) to X1, Y1 registers - * (4) Write the random integer k to K register - * (5) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Write the curve order and curve length to N ,M registers according - * (10) Write 0x0 to Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 * - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Read X1 registers to get r - */ - - /* 3-(4) Write the random integer k to K register */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_K); - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* 3-(9) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(10) Write 0x0 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* 3-(15) Read X1 registers to get r */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result1, R); - - /* - * 4. Compute s = k^-1 * (e + d * r)(mod n). If s = 0, go to step 2 - * (1) Write the curve order to N registers according - * (2) Write 0x1 to Y1 registers - * (3) Write the random integer k to X1 registers according - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set START(CRPT_ECC_CTL[0]) to 1 - * (7) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (8) Read X1 registers to get k^-1 - * (9) Write the curve order and curve length to N ,M registers - * (10) Write r, d to X1, Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Write the curve order to N registers - * (16) Write e to Y1 registers - * (17) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (18) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (19) Set START(CRPT_ECC_CTL[0]) to 1 - * (20) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (21) Write the curve order and curve length to N ,M registers - * (22) Write k^-1 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get s - */ - - /* S/W: GFp_add_mod_order(pCurve->key_len+2, 0, x1, a, R); */ - - /* 4-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write 0x1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 4-(3) Write the random integer k to X1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(7) output = %s\n", temp_hex_str); -#endif - - /* 4-(8) Read X1 registers to get k^-1 */ - - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("k^-1 = %s\n", temp_hex_str); -#endif - - /* 4-(9) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(10) Write r, d to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - } - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - Hex2Reg(d, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(14) output = %s\n", temp_hex_str); -#endif - - /* 4-(15) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(16) Write e to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - Hex2Reg(message, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(20) output = %s\n", temp_hex_str); -#endif - - /* 4-(21) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(22) Write k^-1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(27) Read X1 registers to get s */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result2, S); - - } /* ret == 0 */ - - return ret; -} - - - -/** - * @brief ECDSA digital signature generation. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] d The private key. - * @param[in] k The selected random integer. - * @param[out] R R of the (R,S) pair digital signature - * @param[out] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_d, int32_t i32KeyIdx_d, KS_MEM_Type mem_k, int32_t i32KeyIdx_k, char *R, char *S) -{ - uint32_t volatile temp_result1[18], temp_result2[18]; - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - CRPT->ECC_KSCTL = 0; - CRPT->ECC_KSXY = 0; - - /* - * 1. Calculate e = HASH(m), where HASH is a cryptographic hashing algorithm, (i.e. SHA-1) - * (1) Use SHA to calculate e - */ - - /* 2. Select a random integer k form [1, n-1] - * (1) Notice that n is order, not prime modulus or irreducible polynomial function - */ - - /* - * 3. Compute r = x1 (mod n), where (x1, y1) = k * G. If r = 0, go to step 2 - * (1) Write the curve parameter A, B, and curve length M to corresponding registers - * (2) Write the prime modulus or irreducible polynomial function to N registers according - * (3) Write the point G(x, y) to X1, Y1 registers - * (4) Write the random integer k to K register - * (5) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Write the curve order and curve length to N ,M registers according - * (10) Write 0x0 to Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 * - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Read X1 registers to get r - */ - - /* 3-(4) Use k in Key Store */ - crpt->ECC_KSCTL = (uint32_t)(mem_k << CRPT_ECC_KSCTL_RSSRCK_Pos)/* KS Memory Type */ | - CRPT_ECC_KSCTL_RSRCK_Msk/* Key from KS */ | - (uint32_t)i32KeyIdx_k; - - run_ecc_codec(crpt, ECCOP_POINT_MUL | OP_ECDSAR); - - /* 3-(9) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(10) Write 0x0 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* 3-(15) Read X1 registers to get r */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result1, R); - - - /* - * 4. Compute s = k ^-1 * (e + d * r)(mod n). If s = 0, go to step 2 - * (1) Write the curve order to N registers according - * (2) Write 0x1 to Y1 registers - * (3) Write the random integer k to X1 registers according - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set START(CRPT_ECC_CTL[0]) to 1 - * (7) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (8) Read X1 registers to get k^-1 - * (9) Write the curve order and curve length to N ,M registers - * (10) Write r, d to X1, Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Write the curve order to N registers - * (16) Write e to Y1 registers - * (17) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (18) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (19) Set START(CRPT_ECC_CTL[0]) to 1 - * (20) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (21) Write the curve order and curve length to N ,M registers - * (22) Write k^-1 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get s - */ - - /* S/W: GFp_add_mod_order(pCurve->key_len+2, 0, x1, a, R); */ - - /* 4-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2)(3)(4)(5) Use d, k in Key Store */ - crpt->ECC_CTL = 0; - crpt->ECC_KSXY = CRPT_ECC_KSXY_RSRCXY_Msk | - (uint32_t)(mem_k << CRPT_ECC_KSXY_RSSRCX_Pos) | ((uint32_t)i32KeyIdx_k << CRPT_ECC_KSXY_NUMX_Pos) | // Key Store index of k - (uint32_t)(mem_d << CRPT_ECC_KSXY_RSSRCY_Pos) | ((uint32_t)i32KeyIdx_d << CRPT_ECC_KSXY_NUMY_Pos); // Key Store index of d - - // 4-5 - for (i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_result1[i]; - crpt->ECC_Y2[i] = 0; - } - Hex2Reg(message, crpt->ECC_Y2); - - run_ecc_codec(crpt, ECCOP_MODULE | OP_ECDSAS); - - /* 4-11 Read X1 registers to get s */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - Reg2Hex(pCurve->Echar, temp_result2, S); - - /* Clear KS Control */ - CRPT->ECC_KSCTL = 0; - CRPT->ECC_KSXY = 0; - - } /* ret == 0 */ - - return ret; -} - - -/** - * @brief ECDSA dogotal signature verification. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] public_k1 The public key 1. - * @param[in] public_k2 The public key 2. - * @param[in] R R of the (R,S) pair digital signature - * @param[in] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - * @return -2 Verification failed. - */ -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *public_k1, char *public_k2, char *R, char *S) -{ - uint32_t temp_result1[18], temp_result2[18]; - uint32_t temp_x[18], temp_y[18]; - int32_t i, ret = 0; - - /* - * 1. Verify that r and s are integers in the interval [1, n-1]. If not, the signature is invalid - * 2. Compute e = HASH (m), where HASH is the hashing algorithm in signature generation - * (1) Use SHA to calculate e - */ - - /* - * 3. Compute w = s^-1 (mod n) - * (1) Write the curve order to N registers - * (2) Write 0x1 to Y1 registers - * (3) Write s to X1 registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Read X1 registers to get w - */ - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - - /* 3-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(2) Write 0x1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 3-(3) Write s to X1 registers */ - for (i = 0; i < 18; i++) - { - CRPT->ECC_X1[i] = 0UL; - } - Hex2Reg(S, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - - /* 3-(9) Read X1 registers to get w */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - CRPT_DBGMSG("e = %s\n", message); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("w = %s\n", temp_hex_str); - CRPT_DBGMSG("o = %s (order)\n", pCurve->Eorder); -#endif - - /* - * 4. Compute u1 = e * w (mod n) and u2 = r * w (mod n) - * (1) Write the curve order and curve length to N ,M registers - * (2) Write e, w to X1, Y1 registers - * (3) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (4) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1 registers to get u1 - * (8) Write the curve order and curve length to N ,M registers - * (9) Write r, w to X1, Y1 registers - * (10) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (11) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Read X1 registers to get u2 - */ - - /* 4-(1) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write e, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(7) Read X1 registers to get u1 */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("u1 = %s\n", temp_hex_str); -#endif - - /* 4-(8) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(9) Write r, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(R, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(14) Read X1 registers to get u2 */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("u2 = %s\n", temp_hex_str); -#endif - - /* - * 5. Compute X * (x1', y1') = u1 * G + u2 * Q - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - * (3) Write u1 to K registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1, Y1 registers to get u1*G - * (8) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (9) Write the public key Q(x,y) to X1, Y1 registers - * (10) Write u2 to K registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (15) Write the result data u1*G to X2, Y2 registers - * (16) Set ECCOP(CRPT_ECC_CTL[10:9]) to 10 - * (17) Set START(CRPT_ECC_CTL[0]) to 1 - * (18) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (19) Read X1, Y1 registers to get X *(x1', y1') - * (20) Write the curve order and curve length to N ,M registers - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get x1 * (mod n) - * - * 6. The signature is valid if x1 * = r, otherwise it is invalid - */ - - /* - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - */ - ecc_init_curve(crpt, ecc_curve); - - /* (3) Write u1 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result1[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* (7) Read X1, Y1 registers to get u1*G */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, y = %s\n", temp_hex_str); -#endif - - /* (8) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* (9) Write the public key Q(x,y) to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* (10) Write u2 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - temp_result2[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, y = %s\n", temp_hex_str); -#endif - - /* (14) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* Write the result data u2*Q to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - crpt->ECC_Y1[i] = temp_result2[i]; - } - - /* (15) Write the result data u1*G to X2, Y2 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_x[i]; - crpt->ECC_Y2[i] = temp_y[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_ADD); - - /* (19) Read X1, Y1 registers to get X * (x1', y1') */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(19) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(19) y' = %s\n", temp_hex_str); -#endif - - /* (20) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_x[i]; - crpt->ECC_Y1[i] = 0UL; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(21) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, temp_hex_str); - CRPT_DBGMSG("5-(22) y' = %s\n", temp_hex_str); -#endif - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* (27) Read X1 registers to get x1 * (mod n) */ - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(27) x1' (mod n) = %s\n", temp_hex_str); - - /* 6. The signature is valid if x1 * = r, otherwise it is invalid */ - - /* Compare with test pattern to check if r is correct or not */ - if (strcasecmp(temp_hex_str, R) != 0) - { - CRPT_DBGMSG("x1' (mod n) != R Test filed!!\n"); - CRPT_DBGMSG("Signature R [%s] is not matched with expected R [%s]!\n", temp_hex_str, R); - ret = -2; - } - } /* ret == 0 */ - - return ret; -} - - - -/** - * @brief ECDSA signature verification with Key Store - * @param[in] crpt The pointer of CRYPTO module - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] public_k1 The public key 1. - * @param[in] public_k2 The public key 2. - * @param[in] R R of the (R,S) pair digital signature - * @param[in] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - * @return -2 Verification failed. - */ -int32_t ECC_VerifySignature_KS(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, KS_MEM_Type mem_pk1, int32_t i32KeyIdx_pk1, KS_MEM_Type mem_pk2, int32_t i32KeyIdx_pk2, char *R, char *S) -{ - uint32_t temp_result1[18], temp_result2[18]; - uint32_t temp_x[18], temp_y[18]; - int32_t i, ret = 0; - - /* - * 1. Verify that r and s are integers in the interval [1, n-1]. If not, the signature is invalid - * 2. Compute e = HASH (m), where HASH is the hashing algorithm in signature generation - * (1) Use SHA to calculate e - */ - - /* - * 3. Compute w = s^-1 (mod n) - * (1) Write the curve order to N registers - * (2) Write 0x1 to Y1 registers - * (3) Write s to X1 registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Read X1 registers to get w - */ - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - crpt->ECC_KSCTL = 0; - crpt->ECC_KSXY = 0; - - /* 3-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(2) Write 0x1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 3-(3) Write s to X1 registers */ - for (i = 0; i < 18; i++) - { - CRPT->ECC_X1[i] = 0UL; - } - Hex2Reg(S, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - - /* 3-(9) Read X1 registers to get w */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - CRPT_DBGMSG("e = %s\n", message); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("w = %s\n", temp_hex_str); - CRPT_DBGMSG("o = %s (order)\n", pCurve->Eorder); -#endif - - /* - * 4. Compute u1 = e * w (mod n) and u2 = r * w (mod n) - * (1) Write the curve order and curve length to N ,M registers - * (2) Write e, w to X1, Y1 registers - * (3) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (4) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1 registers to get u1 - * (8) Write the curve order and curve length to N ,M registers - * (9) Write r, w to X1, Y1 registers - * (10) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (11) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Read X1 registers to get u2 - */ - - /* 4-(1) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write e, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(7) Read X1 registers to get u1 */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("u1 = %s\n", temp_hex_str); -#endif - - /* 4-(8) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(9) Write r, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(R, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(14) Read X1 registers to get u2 */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("u2 = %s\n", temp_hex_str); -#endif - - /* - * 5. Compute X * (x1', y1') = u1 * G + u2 * Q - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - * (3) Write u1 to K registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1, Y1 registers to get u1*G - * (8) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (9) Write the public key Q(x,y) to X1, Y1 registers - * (10) Write u2 to K registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (15) Write the result data u1*G to X2, Y2 registers - * (16) Set ECCOP(CRPT_ECC_CTL[10:9]) to 10 - * (17) Set START(CRPT_ECC_CTL[0]) to 1 - * (18) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (19) Read X1, Y1 registers to get X * (x1', y1') - * (20) Write the curve order and curve length to N ,M registers - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get x1 * (mod n) - * - * 6. The signature is valid if x1 * = r, otherwise it is invalid - */ - - /* - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - */ - ecc_init_curve(crpt, ecc_curve); - - /* (3) Write u1 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result1[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* (7) Read X1, Y1 registers to get u1*G */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, y = %s\n", temp_hex_str); -#endif - - /* (8) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* (9) Write the public key Q(x,y) to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - -#if 0 - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); -#else - - /* 5-(2) Get the public key from key store */ - crpt->ECC_KSCTL = 0ul; - crpt->ECC_KSXY = CRPT_ECC_KSXY_RSRCXY_Msk | - (uint32_t)(mem_pk1 << CRPT_ECC_KSXY_RSSRCX_Pos) | ((uint32_t)i32KeyIdx_pk1 << CRPT_ECC_KSXY_NUMX_Pos) | // Key Store index of pk1 - (uint32_t)(mem_pk2 << CRPT_ECC_KSXY_RSSRCY_Pos) | ((uint32_t)i32KeyIdx_pk2 << CRPT_ECC_KSXY_NUMY_Pos); // Key Store index of pk2 - -#endif - - /* (10) Write u2 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - temp_result2[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, y = %s\n", temp_hex_str); -#endif - - /* (14) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* Write the result data u2*Q to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - crpt->ECC_Y1[i] = temp_result2[i]; - } - - /* (15) Write the result data u1*G to X2, Y2 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_x[i]; - crpt->ECC_Y2[i] = temp_y[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_ADD); - - /* (19) Read X1, Y1 registers to get X * (x1', y1') */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(19) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(19) y' = %s\n", temp_hex_str); -#endif - - /* (20) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* - * (21) Write x1 * to X1 registers - * (22) Write 0x0 to Y1 registers - */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_x[i]; - crpt->ECC_Y1[i] = 0UL; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(21) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, temp_hex_str); - CRPT_DBGMSG("5-(22) y' = %s\n", temp_hex_str); -#endif - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* (27) Read X1 registers to get x1 * (mod n) */ - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(27) x1' (mod n) = %s\n", temp_hex_str); - - /* 6. The signature is valid if x1 * = r, otherwise it is invalid */ - - /* Compare with test pattern to check if r is correct or not */ - if (strcasecmp(temp_hex_str, R) != 0) - { - CRPT_DBGMSG("x1' (mod n) != R Test filed!!\n"); - CRPT_DBGMSG("Signature R [%s] is not matched with expected R [%s]!\n", temp_hex_str, R); - ret = -2; - } - } /* ret == 0 */ - - return ret; -} - - -static ECC_CURVE *get_curve(E_ECC_CURVE ecc_curve) -{ - uint32_t i; - ECC_CURVE *ret = NULL; - - for (i = 0UL; i < sizeof(_Curve) / sizeof(ECC_CURVE); i++) - { - if (ecc_curve == _Curve[i].curve_id) - { - memcpy((char *)&Curve_Copy, &_Curve[i], sizeof(ECC_CURVE)); - ret = &Curve_Copy; /* (ECC_CURVE *)&_Curve[i]; */ - } - if (ret != NULL) - { - break; - } - } - return ret; -} - - -/** - * @brief ECC interrupt service routine. User application must invoke this function in - * his CRYPTO_IRQHandler() to let Crypto driver know ECC processing was done. - * @param[in] crpt Reference to Crypto module. - * @return none - */ -void ECC_Complete(CRPT_T *crpt) -{ - if (crpt->INTSTS & CRPT_INTSTS_ECCIF_Msk) - { - g_ECC_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCIF_Msk; - /* printf("ECC done IRQ.\n"); */ - } - - if (crpt->INTSTS & CRPT_INTSTS_ECCEIF_Msk) - { - g_ECCERR_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCEIF_Msk; - printf("ECCEIF flag is set!!\n"); - } -} - - -int32_t ECC_GetCurve(CRPT_T *crpt, E_ECC_CURVE ecc_curve, ECC_CURVE *curve) -{ - int32_t err; - - /* Update pCurve pointer */ - err = ecc_init_curve(crpt, ecc_curve); - if (err == 0) - { - /* get curve */ - memcpy(curve, pCurve, sizeof(ECC_CURVE)); - } - - return err; -} - - -/*-----------------------------------------------------------------------------------------------*/ -/* */ -/* RSA */ -/* */ -/*-----------------------------------------------------------------------------------------------*/ - -/** @cond HIDDEN_SYMBOLS */ - -static void *s_pRSABuf; -static uint32_t s_u32RsaOpMode; - -typedef enum -{ - BUF_NORMAL, - BUF_CRT, - BUF_CRTBYPASS, - BUF_SCAP, - BUF_CRT_SCAP, - BUF_CRTBYPASS_SCAP, - BUF_KS -} E_RSA_BUF_SEL; - -static int32_t CheckRsaBufferSize(uint32_t u32OpMode, uint32_t u32BufSize, uint32_t u32UseKS); - -/** @endcond HIDDEN_SYMBOLS */ - -/* Check the allocated buffer size for RSA operation. */ -static int32_t CheckRsaBufferSize(uint32_t u32OpMode, uint32_t u32BufSize, uint32_t u32UseKS) -{ - /* RSA buffer size for MODE_NORMAL, MODE_CRT, MODE_CRTBYPASS, MODE_SCAP, MODE_CRT_SCAP, MODE_CRTBYPASS_SCAP */ - uint32_t s_au32RsaBufSizeTbl[] = {sizeof(RSA_BUF_NORMAL_T), sizeof(RSA_BUF_CRT_T), sizeof(RSA_BUF_CRT_T), \ - sizeof(RSA_BUF_SCAP_T), sizeof(RSA_BUF_CRT_SCAP_T), sizeof(RSA_BUF_CRT_SCAP_T), \ - sizeof(RSA_BUF_KS_T) - }; - - if (u32UseKS) - { - if (u32BufSize != s_au32RsaBufSizeTbl[BUF_KS]) - return (-1); - } - else - { - switch (u32OpMode) - { - case RSA_MODE_NORMAL: - if (u32BufSize != s_au32RsaBufSizeTbl[BUF_NORMAL]) - return (-1); - break; - case RSA_MODE_CRT: - if (u32BufSize != s_au32RsaBufSizeTbl[BUF_CRT]) - return (-1); - break; - case RSA_MODE_CRTBYPASS: - if (u32BufSize != s_au32RsaBufSizeTbl[BUF_CRTBYPASS]) - return (-1); - break; - case RSA_MODE_SCAP: - if (u32BufSize != s_au32RsaBufSizeTbl[BUF_SCAP]) - return (-1); - break; - case RSA_MODE_CRT_SCAP: - if (u32BufSize != s_au32RsaBufSizeTbl[BUF_CRT_SCAP]) - return (-1); - break; - case RSA_MODE_CRTBYPASS_SCAP: - if (u32BufSize != s_au32RsaBufSizeTbl[BUF_CRTBYPASS_SCAP]) - return (-1); - break; - default: - return (-1); - } - } - - return 0; -} - -/** - * @brief Open RSA encrypt/decrypt function. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32OpMode RSA operation mode, including: - * - \ref RSA_MODE_NORMAL - * - \ref RSA_MODE_CRT - * - \ref RSA_MODE_CRTBYPASS - * - \ref RSA_MODE_SCAP - * - \ref RSA_MODE_CRT_SCAP - * - \ref RSA_MODE_CRTBYPASS_SCAP - * @param[in] u32KeySize is RSA key size, including: - * - \ref RSA_KEY_SIZE_1024 - * - \ref RSA_KEY_SIZE_2048 - * - \ref RSA_KEY_SIZE_3072 - * - \ref RSA_KEY_SIZE_4096 - * @param[in] psRSA_Buf The pointer of RSA buffer struct. User should declare correct RSA buffer for specific operation mode first. - * - \ref RSA_BUF_NORMAL_T The struct for normal mode - * - \ref RSA_BUF_CRT_T The struct for CRT ( + CRT bypass) mode - * - \ref RSA_BUF_SCAP_T The struct for SCAP mode - * - \ref RSA_BUF_CRT_SCAP_T The struct for CRT ( + CRT bypass) +SCAP mode - * - \ref RSA_BUF_KS_T The struct for using key store - * @param[in] u32BufSize is RSA buffer size. - * @param[in] u32UseKS is use key store function. - * - \ref 0 No use key store function - * - \ref 1 Use key store function - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32KeySize, \ - void *psRSA_Buf, uint32_t u32BufSize, uint32_t u32UseKS) -{ - if (psRSA_Buf == 0) - { - return (-1); - } - if (CheckRsaBufferSize(u32OpMode, u32BufSize, u32UseKS) != 0) - { - return (-1); - } - - s_u32RsaOpMode = u32OpMode; - s_pRSABuf = psRSA_Buf; - crpt->RSA_CTL = (u32OpMode) | (u32KeySize << CRPT_RSA_CTL_KEYLENG_Pos); - - return 0; -} - -/** - * @brief Set the RSA key - * @param[in] crpt The pointer of CRYPTO module - * @param[in] Key The private or public key. - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_SetKey(CRPT_T *crpt, char *Key) -{ - if (s_pRSABuf == 0) - { - return (-1); - } - Hex2Reg(Key, ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaE); - crpt->RSA_SADDR[2] = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaE; /* the public key or private key */ - - return 0; -} - -/** - * @brief Set RSA DMA transfer configuration. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] Src RSA DMA source data - * @param[in] n The modulus for both the public and private keys - * @param[in] P The factor of modulus operation(P) for CRT/SCAP mode - * @param[in] Q The factor of modulus operation(Q) for CRT/SCAP mode - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_SetDMATransfer(CRPT_T *crpt, char *Src, char *n, char *P, char *Q) -{ - if (s_pRSABuf == 0) - { - return (-1); - } - Hex2Reg(Src, ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaM); - Hex2Reg(n, ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaN); - - /* Assign the data to DMA */ - crpt->RSA_SADDR[0] = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaM; /* plaintext / encrypt data */ - crpt->RSA_SADDR[1] = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaN; /* the base of modulus operation */ - crpt->RSA_DADDR = (uint32_t) & ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaOutput; /* encrypt data / decrypt data */ - - if ((s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) && (s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk)) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - Hex2Reg(P, ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaP); - Hex2Reg(Q, ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaQ); - - crpt->RSA_SADDR[3] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaP; /* prime P */ - crpt->RSA_SADDR[4] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaQ; /* prime Q */ - - crpt->RSA_MADDR[0] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpCp; /* for storing the intermediate temporary value(Cp) */ - crpt->RSA_MADDR[1] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpCq; /* for storing the intermediate temporary value(Cq) */ - crpt->RSA_MADDR[2] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpDp; /* for storing the intermediate temporary value(Dp) */ - crpt->RSA_MADDR[3] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpDq; /* for storing the intermediate temporary value(Dq) */ - crpt->RSA_MADDR[4] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpRp; /* for storing the intermediate temporary value(Rp) */ - crpt->RSA_MADDR[5] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpRq; /* for storing the intermediate temporary value(Rq) */ - - /* For SCAP mode to store the intermediate temporary value(blind key) */ - crpt->RSA_MADDR[6] = (uint32_t) & ((RSA_BUF_CRT_SCAP_T *)s_pRSABuf)->au32RsaTmpBlindKey; - } - else if (s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - Hex2Reg(P, ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaP); - Hex2Reg(Q, ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaQ); - - crpt->RSA_SADDR[3] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaP; /* prime P */ - crpt->RSA_SADDR[4] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaQ; /* prime Q */ - - crpt->RSA_MADDR[0] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpCp; /* for storing the intermediate temporary value(Cp) */ - crpt->RSA_MADDR[1] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpCq; /* for storing the intermediate temporary value(Cq) */ - crpt->RSA_MADDR[2] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpDp; /* for storing the intermediate temporary value(Dp) */ - crpt->RSA_MADDR[3] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpDq; /* for storing the intermediate temporary value(Dq) */ - crpt->RSA_MADDR[4] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpRp; /* for storing the intermediate temporary value(Rp) */ - crpt->RSA_MADDR[5] = (uint32_t) & ((RSA_BUF_CRT_T *)s_pRSABuf)->au32RsaTmpRq; /* for storing the intermediate temporary value(Rq) */ - } - else if (s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - Hex2Reg(P, ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaP); - Hex2Reg(Q, ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaQ); - - crpt->RSA_SADDR[3] = (uint32_t) & ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaP; /* prime P */ - crpt->RSA_SADDR[4] = (uint32_t) & ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaQ; /* prime Q */ - - /* For SCAP mode to store the intermediate temporary value(blind key) */ - crpt->RSA_MADDR[6] = (uint32_t) & ((RSA_BUF_SCAP_T *)s_pRSABuf)->au32RsaTmpBlindKey; - } - - return 0; -} - -/** - * @brief Start RSA encrypt/decrypt - * @param[in] crpt The pointer of CRYPTO module - * @return None - */ -void RSA_Start(CRPT_T *crpt) -{ - crpt->RSA_CTL |= CRPT_RSA_CTL_START_Msk; -} - -/** - * @brief Read the RSA output. - * @param[in] crpt The pointer of CRYPTO module - * @param[out] Output The RSA operation output data. - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_Read(CRPT_T *crpt, char *Output) -{ - uint32_t au32CntTbl[4] = {256, 512, 768, 1024}; /* count is key length divided by 4 */ - uint32_t u32CntIdx = 0; - - if (s_pRSABuf == 0) - { - return (-1); - } - - u32CntIdx = (crpt->RSA_CTL & CRPT_RSA_CTL_KEYLENG_Msk) >> CRPT_RSA_CTL_KEYLENG_Pos; - Reg2Hex((int32_t)au32CntTbl[u32CntIdx], ((RSA_BUF_NORMAL_T *)s_pRSABuf)->au32RsaOutput, Output); - - return 0; -} - -/** - * @brief Set the RSA key is read from key store - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32KeyNum The number of private or public key in key store. - * @param[in] u32KSMemType The key is read from selected memory type of key store. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] u32BlindKeyNum The number of blind key in SRAM of key store for SCAP mode. This key is un-readable. - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - */ -int32_t RSA_SetKey_KS(CRPT_T *crpt, uint32_t u32KeyNum, uint32_t u32KSMemType, uint32_t u32BlindKeyNum) -{ - if (s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk) - { - crpt->RSA_KSCTL = (u32BlindKeyNum << 8) | (u32KSMemType << CRPT_RSA_KSCTL_RSSRC_Pos) | CRPT_RSA_KSCTL_RSRC_Msk | u32KeyNum; - } - else - { - crpt->RSA_KSCTL = (u32KSMemType << CRPT_RSA_KSCTL_RSSRC_Pos) | CRPT_RSA_KSCTL_RSRC_Msk | u32KeyNum; - } - return 0; -} - -/** - * @brief Set RSA DMA transfer configuration while using key store. - * @param[in] crpt The pointer of CRYPTO module - * @param[in] u32OpMode RSA operation mode, including: - * - \ref RSA_MODE_NORMAL - * - \ref RSA_MODE_CRT - * - \ref RSA_MODE_CRTBYPASS - * - \ref RSA_MODE_SCAP - * - \ref RSA_MODE_CRT_SCAP - * - \ref RSA_MODE_CRTBYPASS_SCAP - * @param[in] Src RSA DMA source data - * @param[in] n The modulus for both the public and private keys - * @param[in] u32PNum The number of the factor of modulus operation(P) in SRAM of key store for CRT/SCAP mode - * @param[in] u32QNum The number of the factor of modulus operation(Q) in SRAM of key store for CRT/SCAP mode - * @param[in] u32CpNum The number of Cp in SRAM of key store for CRT mode - * @param[in] u32CqNum The number of Cq in SRAM of key store for CRT mode - * @param[in] u32DpNum The number of Dp in SRAM of key store for CRT mode - * @param[in] u32DqNum The number of Dq in SRAM of key store for CRT mode - * @param[in] u32RpNum The number of Rp in SRAM of key store for CRT mode - * @param[in] u32RqNum The number of Rq in SRAM of key store for CRT mode - * @return 0 Success. - * @return -1 The value of pointer of RSA buffer struct is null. - * @note P, Q, Dp, Dq are equal to half key length. Cp, Cq, Rp, Rq, Blind key are equal to key length. - */ -int32_t RSA_SetDMATransfer_KS(CRPT_T *crpt, char *Src, char *n, uint32_t u32PNum, - uint32_t u32QNum, uint32_t u32CpNum, uint32_t u32CqNum, uint32_t u32DpNum, - uint32_t u32DqNum, uint32_t u32RpNum, uint32_t u32RqNum) -{ - if (s_pRSABuf == 0) - { - return (-1); - } - Hex2Reg(Src, ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaM); - Hex2Reg(n, ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaN); - - /* Assign the data to DMA */ - crpt->RSA_SADDR[0] = (uint32_t) & ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaM; /* plaintext / encrypt data */ - crpt->RSA_SADDR[1] = (uint32_t) & ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaN; /* the base of modulus operation */ - crpt->RSA_DADDR = (uint32_t) & ((RSA_BUF_KS_T *)s_pRSABuf)->au32RsaOutput; /* encrypt data / decrypt data */ - - if ((s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) || (s_u32RsaOpMode & CRPT_RSA_CTL_SCAP_Msk)) - { - /* For RSA CRT/SCAP mode, two primes of private key */ - crpt->RSA_KSSTS[0] = (crpt->RSA_KSSTS[0] & (~(CRPT_RSA_KSSTS0_NUM0_Msk | CRPT_RSA_KSSTS0_NUM1_Msk))) | \ - (u32PNum << CRPT_RSA_KSSTS0_NUM0_Pos) | (u32QNum << CRPT_RSA_KSSTS0_NUM1_Pos); - - } - if (s_u32RsaOpMode & CRPT_RSA_CTL_CRT_Msk) - { - /* For RSA CRT mode, Cp, Cq, Dp, Dq, Rp, Rq */ - crpt->RSA_KSSTS[0] = (crpt->RSA_KSSTS[0] & (~(CRPT_RSA_KSSTS0_NUM2_Msk | CRPT_RSA_KSSTS0_NUM3_Msk))) | \ - (u32CpNum << CRPT_RSA_KSSTS0_NUM2_Pos) | (u32CqNum << CRPT_RSA_KSSTS0_NUM3_Pos); - crpt->RSA_KSSTS[1] = (u32DpNum << CRPT_RSA_KSSTS1_NUM4_Pos) | (u32DqNum << CRPT_RSA_KSSTS1_NUM5_Pos) | \ - (u32RpNum << CRPT_RSA_KSSTS1_NUM6_Pos) | (u32RqNum << CRPT_RSA_KSSTS1_NUM7_Pos); - } - - return 0; -} - - -/**@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group CRYPTO_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_dac.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_dac.c deleted file mode 100644 index b39e5b63716..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_dac.c +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************//** - * @file dac.c - * @version V1.00 - * @brief DAC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DAC_Driver DAC Driver - @{ -*/ - -/** @addtogroup DAC_EXPORTED_FUNCTIONS DAC Exported Functions - @{ -*/ - -/** - * @brief This function make DAC module be ready to convert. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @param[in] u32TrgSrc Decides the trigger source. Valid values are: - * - \ref DAC_WRITE_DAT_TRIGGER :Write DAC_DAT trigger - * - \ref DAC_SOFTWARE_TRIGGER :Software trigger - * - \ref DAC_LOW_LEVEL_TRIGGER :STDAC pin low level trigger - * - \ref DAC_HIGH_LEVEL_TRIGGER :STDAC pin high level trigger - * - \ref DAC_FALLING_EDGE_TRIGGER :STDAC pin falling edge trigger - * - \ref DAC_RISING_EDGE_TRIGGER :STDAC pin rising edge trigger - * - \ref DAC_TIMER0_TRIGGER :Timer 0 trigger - * - \ref DAC_TIMER1_TRIGGER :Timer 1 trigger - * - \ref DAC_TIMER2_TRIGGER :Timer 2 trigger - * - \ref DAC_TIMER3_TRIGGER :Timer 3 trigger - * - \ref DAC_EPWM0_TRIGGER :EPWM0 trigger - * - \ref DAC_EPWM1_TRIGGER :EPWM1 trigger - * @return None - * @details The DAC conversion can be started by writing DAC_DAT, software trigger or hardware trigger. - * When TRGEN (DAC_CTL[4]) is 0, the data conversion is started by writing DAC_DAT register. - * When TRGEN (DAC_CTL[4]) is 1, the data conversion is started by SWTRG (DAC_SWTRG[0]) is set to 1, - * external STDAC pin, timer event, or EPWM event. - */ -void DAC_Open(DAC_T *dac, - uint32_t u32Ch, - uint32_t u32TrgSrc) -{ - (void)u32Ch; - dac->CTL &= ~(DAC_CTL_ETRGSEL_Msk | DAC_CTL_TRGSEL_Msk | DAC_CTL_TRGEN_Msk); - dac->CTL |= (u32TrgSrc | DAC_CTL_DACEN_Msk); -} - -/** - * @brief Disable DAC analog power. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Ch Not used. - * @return None - * @details Disable DAC analog power for saving power consumption. - */ -void DAC_Close(DAC_T *dac, uint32_t u32Ch) -{ - (void)u32Ch; - dac->CTL &= (~DAC_CTL_DACEN_Msk); -} - -/** - * @brief Set delay time for DAC to become stable. - * @param[in] dac The pointer of the specified DAC module. - * @param[in] u32Delay Decides the DAC conversion settling time, the range is from 0~(1023/PCLK1*1000000) micro seconds. - * @return Real DAC conversion settling time (micro second). - * @details For example, DAC controller clock speed is 160MHz and DAC conversion setting time is 1 us, SETTLET (DAC_TCTL[9:0]) value must be greater than 0xA0. - * @note User needs to write appropriate value to meet DAC conversion settling time base on PCLK (APB clock) speed. - */ -uint32_t DAC_SetDelayTime(DAC_T *dac, uint32_t u32Delay) -{ - - dac->TCTL = ((CLK_GetPCLK1Freq() * u32Delay / 1000000UL) & 0x3FFUL); - - return ((dac->TCTL) * 1000000UL / CLK_GetPCLK1Freq()); -} - - - -/*@}*/ /* end of group DAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group DAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_eadc.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_eadc.c deleted file mode 100644 index e88e1743717..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_eadc.c +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************//** - * @file eadc.c - * @version V2.00 - * @brief EADC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_FUNCTIONS EADC Exported Functions - @{ -*/ - -int32_t g_EADC_i32ErrCode = 0; /*!< EADC global error code */ - - -/** - * @brief This function make EADC_module be ready to convert. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32InputMode Decides the input mode. - * - \ref EADC_CTL_DIFFEN_SINGLE_END :Single end input mode. - * - \ref EADC_CTL_DIFFEN_DIFFERENTIAL :Differential input type. - * @return None - * @details This function is used to set analog input mode and enable A/D Converter. - * Before starting A/D conversion function, ADCEN bit (EADC_CTL[0]) should be set to 1. - * @note This API will reset and calibrate EADC if EADC never be calibrated after chip power on. - * @note This function sets g_EADC_i32ErrCode to EADC_TIMEOUT_ERR if CALIF(CALSR[16]) is not set to 1. - */ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode) -{ - uint32_t u32Delay = SystemCoreClock >> 4; - uint32_t u32ClkSel0Backup, u32EadcDivBackup, u32PclkDivBackup, u32RegLockBackup = 0; - - g_EADC_i32ErrCode = 0; - - eadc->CTL &= (~EADC_CTL_DIFFEN_Msk); - - eadc->CTL |= (u32InputMode | EADC_CTL_ADCEN_Msk); - - /* Do calibration for EADC to decrease the effect of electrical random noise. */ - if ((eadc->CALSR & EADC_CALSR_CALIF_Msk) == 0) - { - /* Must reset ADC before ADC calibration */ - eadc->CTL |= EADC_CTL_ADCRST_Msk; - while ((eadc->CTL & EADC_CTL_ADCRST_Msk) == EADC_CTL_ADCRST_Msk) - { - if (--u32Delay == 0) - { - g_EADC_i32ErrCode = EADC_TIMEOUT_ERR; - break; - } - } - - /* Registers backup */ - u32ClkSel0Backup = CLK->CLKSEL0; - u32PclkDivBackup = CLK->PCLKDIV; - - u32RegLockBackup = SYS_IsRegLocked(); - - /* Unlock protected registers */ - SYS_UnlockReg(); - - /* Set PCLK and EADC clock to the same frequency. */ - if (eadc == EADC0) - { - u32EadcDivBackup = CLK->CLKDIV0; - CLK->CLKDIV0 = (CLK->CLKDIV0 & ~CLK_CLKDIV0_EADC0DIV_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_EADC0SEL_Msk) | CLK_CLKSEL0_EADC0SEL_HCLK; - } - else if (eadc == EADC1) - { - u32EadcDivBackup = CLK->CLKDIV2; - CLK->CLKDIV2 = (CLK->CLKDIV2 & ~CLK_CLKDIV2_EADC1DIV_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_EADC1SEL_Msk) | CLK_CLKSEL0_EADC1SEL_HCLK; - } - else if (eadc == EADC2) - { - u32EadcDivBackup = CLK->CLKDIV5; - CLK->CLKDIV5 = (CLK->CLKDIV5 & ~CLK_CLKDIV5_EADC2DIV_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_EADC2SEL_Msk) | CLK_CLKSEL0_EADC2SEL_HCLK; - } - CLK->PCLKDIV = (CLK->PCLKDIV & ~CLK_PCLKDIV_APB1DIV_Msk); - - eadc->CALSR |= EADC_CALSR_CALIF_Msk; /* Clear Calibration Finish Interrupt Flag */ - eadc->CALCTL = (eadc->CALCTL & ~(0x000F0000)) | 0x00020000; - eadc->CALCTL |= EADC_CALCTL_CAL_Msk; /* Enable Calibration function */ - - u32Delay = SystemCoreClock >> 4; - while ((eadc->CALSR & EADC_CALSR_CALIF_Msk) != EADC_CALSR_CALIF_Msk) - { - if (--u32Delay == 0) - { - g_EADC_i32ErrCode = EADC_TIMEOUT_ERR; - - break; - } - } - - /* Restore registers */ - CLK->PCLKDIV = (CLK->PCLKDIV & ~CLK_PCLKDIV_APB1DIV_Msk) | (u32PclkDivBackup & CLK_PCLKDIV_APB1DIV_Msk); - if (eadc == EADC0) - { - CLK->CLKDIV0 = (u32EadcDivBackup & CLK_CLKDIV0_EADC0DIV_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_EADC0SEL_Msk) | (u32ClkSel0Backup & CLK_CLKSEL0_EADC0SEL_Msk); - } - else if (eadc == EADC1) - { - CLK->CLKDIV2 = (u32EadcDivBackup & CLK_CLKDIV2_EADC1DIV_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_EADC1SEL_Msk) | (u32ClkSel0Backup & CLK_CLKSEL0_EADC1SEL_Msk); - } - else if (eadc == EADC2) - { - CLK->CLKDIV5 = (u32EadcDivBackup & CLK_CLKDIV5_EADC2DIV_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_EADC2SEL_Msk) | (u32ClkSel0Backup & CLK_CLKSEL0_EADC2SEL_Msk); - } - if (u32RegLockBackup) - { - /* Lock protected registers */ - SYS_LockReg(); - } - } -} - -/** - * @brief Disable EADC_module. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details Clear ADCEN bit (EADC_CTL[0]) to disable A/D converter analog circuit power consumption. - */ -void EADC_Close(EADC_T *eadc) -{ - eadc->CTL &= ~EADC_CTL_ADCEN_Msk; -} - -/** - * @brief Configure the sample control logic module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerSrc Decides the trigger source. Valid values are: - * - \ref EADC_SOFTWARE_TRIGGER : Disable trigger - * - \ref EADC_FALLING_EDGE_TRIGGER : STADC pin falling edge trigger - * - \ref EADC_RISING_EDGE_TRIGGER : STADC pin rising edge trigger - * - \ref EADC_FALLING_RISING_EDGE_TRIGGER : STADC pin both falling and rising edge trigger - * - \ref EADC_ADINT0_TRIGGER : EADC ADINT0 interrupt EOC pulse trigger - * - \ref EADC_ADINT1_TRIGGER : EADC ADINT1 interrupt EOC pulse trigger - * - \ref EADC_TIMER0_TRIGGER : Timer0 overflow pulse trigger - * - \ref EADC_TIMER1_TRIGGER : Timer1 overflow pulse trigger - * - \ref EADC_TIMER2_TRIGGER : Timer2 overflow pulse trigger - * - \ref EADC_TIMER3_TRIGGER : Timer3 overflow pulse trigger - * - \ref EADC_EPWM0TG0_TRIGGER : EPWM0TG0 trigger - * - \ref EADC_EPWM0TG1_TRIGGER : EPWM0TG1 trigger - * - \ref EADC_EPWM0TG2_TRIGGER : EPWM0TG2 trigger - * - \ref EADC_EPWM0TG3_TRIGGER : EPWM0TG3 trigger - * - \ref EADC_EPWM0TG4_TRIGGER : EPWM0TG4 trigger - * - \ref EADC_EPWM0TG5_TRIGGER : EPWM0TG5 trigger - * - \ref EADC_EPWM1TG0_TRIGGER : EPWM1TG0 trigger - * - \ref EADC_EPWM1TG1_TRIGGER : EPWM1TG1 trigger - * - \ref EADC_EPWM1TG2_TRIGGER : EPWM1TG2 trigger - * - \ref EADC_EPWM1TG3_TRIGGER : EPWM1TG3 trigger - * - \ref EADC_EPWM1TG4_TRIGGER : EPWM1TG4 trigger - * - \ref EADC_EPWM1TG5_TRIGGER : EPWM1TG5 trigger - * - \ref EADC_BPWM0TG_TRIGGER : BPWM0TG trigger - * - \ref EADC_BPWM1TG_TRIGGER : BPWM1TG trigger - * @param[in] u32Channel Specifies the sample module channel, valid value are from 0 to 15. - * @return None - * @details Each of ADC control logic modules 0~15 which is configurable for ADC converter channel EADC_CH0~15 and trigger source. - * sample module 16~18 is fixed for ADC channel 16, 17, 18 input sources as band-gap voltage, temperature sensor, and battery power (VBAT). - */ -void EADC_ConfigSampleModule(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerSrc, \ - uint32_t u32Channel) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_EXTFEN_Msk | EADC_SCTL_EXTREN_Msk | EADC_SCTL_TRGSEL_Msk | EADC_SCTL_CHSEL_Msk); - eadc->SCTL[u32ModuleNum] |= (u32TriggerSrc | u32Channel); -} - - -/** - * @brief Set trigger delay time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerDelayTime Decides the trigger delay time, valid range are between 0~0xFF. - * @param[in] u32DelayClockDivider Decides the trigger delay clock divider. Valid values are: - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_1 : Trigger delay clock frequency is ADC_CLK/1 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_2 : Trigger delay clock frequency is ADC_CLK/2 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_4 : Trigger delay clock frequency is ADC_CLK/4 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_16 : Trigger delay clock frequency is ADC_CLK/16 - * @return None - * @details User can configure the trigger delay time by setting TRGDLYCNT (EADC_SCTLn[15:8], n=0~15) and TRGDLYDIV (EADC_SCTLn[7:6], n=0~15). - * Trigger delay time = (u32TriggerDelayTime) x Trigger delay clock period. - */ -void EADC_SetTriggerDelayTime(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerDelayTime, \ - uint32_t u32DelayClockDivider) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_TRGDLYDIV_Msk | EADC_SCTL_TRGDLYCNT_Msk); - eadc->SCTL[u32ModuleNum] |= ((u32TriggerDelayTime << EADC_SCTL_TRGDLYCNT_Pos) | u32DelayClockDivider); -} - -/** - * @brief Set ADC extend sample time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @param[in] u32ExtendSampleTime Decides the extend sampling time, the range is from 0~255 ADC clock. Valid value are from 0 to 0xFF. - * @return None - * @details When A/D converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, - * user can extend A/D sampling time after trigger source is coming to get enough sampling time. - */ -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime) -{ - eadc->SCTL[u32ModuleNum] &= ~EADC_SCTL_EXTSMPT_Msk; - - eadc->SCTL[u32ModuleNum] |= (u32ExtendSampleTime << EADC_SCTL_EXTSMPT_Pos); - -} - -/*@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ebi.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ebi.c deleted file mode 100644 index 035e7e7ce05..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ebi.c +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************//** - * @file ebi.c - * @version V3.00 - * @brief External Bus Interface(EBI) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Initialize EBI for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32DataWidth Data bus width. Valid values are: - * - \ref EBI_BUSWIDTH_8BIT - * - \ref EBI_BUSWIDTH_16BIT - * @param[in] u32TimingClass Default timing configuration. Valid values are: - * - \ref EBI_TIMING_FASTEST - * - \ref EBI_TIMING_VERYFAST - * - \ref EBI_TIMING_FAST - * - \ref EBI_TIMING_NORMAL - * - \ref EBI_TIMING_SLOW - * - \ref EBI_TIMING_VERYSLOW - * - \ref EBI_TIMING_SLOWEST - * @param[in] u32BusMode Set EBI bus operate mode. Valid values are: - * - \ref EBI_OPMODE_NORMAL - * - \ref EBI_OPMODE_CACCESS - * - \ref EBI_OPMODE_ADSEPARATE - * @param[in] u32CSActiveLevel CS is active High/Low. Valid values are: - * - \ref EBI_CS_ACTIVE_HIGH - * - \ref EBI_CS_ACTIVE_LOW - * - * @return None - * - * @details This function is used to open specify EBI bank with different bus width, timing setting and \n - * active level of CS pin to access EBI device. - * @note Write Buffer Enable(WBUFEN) and Extend Time Of ALE(TALE) are only available in EBI bank0 control register. - */ -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + ((uint32_t)u32Bank * 0x10UL); - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + ((uint32_t)u32Bank * 0x10UL); - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index0); - volatile uint32_t *pu32EBITCTL = (uint32_t *)(u32Index1); - - if (u32DataWidth == EBI_BUSWIDTH_8BIT) - { - *pu32EBICTL &= ~EBI_CTL_DW16_Msk; - } - else - { - *pu32EBICTL |= EBI_CTL_DW16_Msk; - } - - *pu32EBICTL |= u32BusMode; - - switch (u32TimingClass) - { - case EBI_TIMING_FASTEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0UL; - break; - - case EBI_TIMING_VERYFAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318UL; - break; - - case EBI_TIMING_FAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0UL; - break; - - case EBI_TIMING_NORMAL: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318UL; - break; - - case EBI_TIMING_SLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738UL; - break; - - case EBI_TIMING_VERYSLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_4 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738UL; - break; - - case EBI_TIMING_SLOWEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_8 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7UL << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738UL; - break; - - default: - *pu32EBICTL &= ~EBI_CTL_EN_Msk; - break; - } -} - -/** - * @brief Disable EBI on specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * - * @return None - * - * @details This function is used to close specify EBI function. - */ -void EBI_Close(uint32_t u32Bank) -{ - uint32_t u32Index = (uint32_t)&EBI->CTL0 + (u32Bank * 0x10UL); - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index); - - *pu32EBICTL &= ~EBI_CTL_EN_Msk; -} - -/** - * @brief Set EBI Bus Timing for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32TimingConfig Configure EBI timing settings, includes TACC, TAHD, W2X and R2R setting. - * @param[in] u32MclkDiv Divider for MCLK. Valid values are: - * - \ref EBI_MCLKDIV_1 - * - \ref EBI_MCLKDIV_2 - * - \ref EBI_MCLKDIV_4 - * - \ref EBI_MCLKDIV_8 - * - \ref EBI_MCLKDIV_16 - * - \ref EBI_MCLKDIV_32 - * - \ref EBI_MCLKDIV_64 - * - \ref EBI_MCLKDIV_128 - * - * @return None - * - * @details This function is used to configure specify EBI bus timing for access EBI device. - */ -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (u32Bank * 0x10UL); - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (u32Bank * 0x10UL); - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index0); - volatile uint32_t *pu32EBITCTL = (uint32_t *)(u32Index1); - - *pu32EBICTL = (*pu32EBICTL & ~EBI_CTL_MCLKDIV_Msk) | (u32MclkDiv << EBI_CTL_MCLKDIV_Pos); - *pu32EBITCTL = u32TimingConfig; -} - -/**@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group EBI_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ecap.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ecap.c deleted file mode 100644 index 96022f561c1..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_ecap.c +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************//** - * @file ecap.c - * @version V3.00 - * @brief Enhanced Input Capture Timer (ECAP) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_FUNCTIONS ECAP Exported Functions - @{ -*/ - -/** - * @brief Enable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @param[in] u32FuncMask Input capture function select - * - \ref ECAP_DISABLE_COMPARE - * - \ref ECAP_COMPARE_FUNCTION - * @return None - * @details This macro enable input capture function and select compare and reload function. - */ -void ECAP_Open(ECAP_T *ecap, uint32_t u32FuncMask) -{ - /* Clear Input capture mode*/ - ecap->CTL0 = ecap->CTL0 & ~(ECAP_CTL0_CMPEN_Msk); - - /* Enable Input Capture and set mode */ - ecap->CTL0 |= ECAP_CTL0_CAPEN_Msk | (u32FuncMask); -} - - - -/** - * @brief Disable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @return None - * @details This macro disable input capture function. - */ -void ECAP_Close(ECAP_T *ecap) -{ - /* Disable Input Capture*/ - ecap->CTL0 &= ~ECAP_CTL0_CAPEN_Msk; -} - -/** - * @brief This macro is used to enable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel Mask - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will enable the input channel_n interrupt. - */ -void ECAP_EnableINT(ECAP_T *ecap, uint32_t u32Mask) -{ - /* Enable input channel interrupt */ - ecap->CTL0 |= (u32Mask); - - /* Enable NVIC ECAP IRQ */ - if (ecap == (ECAP_T *)ECAP0) - { - NVIC_EnableIRQ((IRQn_Type)ECAP0_IRQn); - } - else if (ecap == (ECAP_T *)ECAP1) - { - NVIC_EnableIRQ((IRQn_Type)ECAP1_IRQn); - } - else if (ecap == (ECAP_T *)ECAP2) - { - NVIC_EnableIRQ((IRQn_Type)ECAP2_IRQn); - } - else - { - NVIC_EnableIRQ((IRQn_Type)ECAP3_IRQn); - } -} - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel number - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will disable the input channel_n interrupt. - */ -void ECAP_DisableINT(ECAP_T *ecap, uint32_t u32Mask) -{ - /* Disable input channel interrupt */ - ecap->CTL0 &= ~(u32Mask); - - /* Disable NVIC ECAP IRQ */ - if (ecap == (ECAP_T *)ECAP0) - { - NVIC_DisableIRQ((IRQn_Type)ECAP0_IRQn); - } - if (ecap == (ECAP_T *)ECAP1) - { - NVIC_DisableIRQ((IRQn_Type)ECAP1_IRQn); - } - if (ecap == (ECAP_T *)ECAP2) - { - NVIC_DisableIRQ((IRQn_Type)ECAP2_IRQn); - } - else - { - NVIC_DisableIRQ((IRQn_Type)ECAP3_IRQn); - } -} - -/*@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ECAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2021 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_epwm.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_epwm.c deleted file mode 100644 index faf463a4d6b..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_epwm.c +++ /dev/null @@ -1,1694 +0,0 @@ -/**************************************************************************//** - * @file epwm.c - * @version V3.00 - * $Revision: 3 $ - * @brief EPWM driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - - -/** @addtogroup EPWM_EXPORTED_FUNCTIONS EPWM Exported Functions - @{ -*/ - -/** - * @brief Configure EPWM capture and get the nearest unit time. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure EPWM capture and get the nearest unit time. - */ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32Src; - uint32_t u32EPWMClockSrc; - uint32_t u32NearestUnitTimeNsec; - uint32_t u16Prescale = 1U, u16CNR = 0xFFFFU; - - if (epwm == EPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM0SEL_Msk; - } - else /* (epwm == EPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM1SEL_Msk; - } - - if (u32Src == 0U) - { - /* clock source is from PLL clock */ - u32EPWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if (epwm == EPWM0) - { - u32EPWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (epwm == EPWM1) */ - { - u32EPWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - u32EPWMClockSrc /= 1000U; - for (u16Prescale = 1U; u16Prescale <= 0x1000U; u16Prescale++) - { - uint32_t u32Exit = 0U; - u32NearestUnitTimeNsec = (1000000U * u16Prescale) / u32EPWMClockSrc; - if (u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if (u16Prescale == 0x1000U) /* limit to the maximum unit time(nano second) */ - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - if (!((1000000U * (u16Prescale + 1U) > (u32NearestUnitTimeNsec * u32EPWMClockSrc)))) - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - } - else - { - u32Exit = 1U; - } - if (u32Exit == 1U) - { - break; - } - else {} - } - - /* convert to real register value */ - u16Prescale -= 1U; - EPWM_SET_PRESCALER(epwm, u32ChannelNum, u16Prescale); - - /* set EPWM to down count type(edge aligned) */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~(EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1U))) | (1UL << (u32ChannelNum << 1U)); - /* set EPWM to auto-reload mode */ - (epwm)->CTL1 &= ~(EPWM_CTL1_CNTMODE0_Msk << u32ChannelNum); - EPWM_SET_CNR(epwm, u32ChannelNum, u16CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure EPWM generator and get the nearest frequency in edge aligned(up counter type) auto-reload mode - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note This function is used for initial stage. - * To change duty cycle later, it should get the configured period value and calculate the new comparator value. - */ -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32Src; - uint32_t u32EPWMClockSrc; - uint32_t i; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - if (epwm == EPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM0SEL_Msk; - } - else /* (epwm == EPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM1SEL_Msk; - } - - if (u32Src == 0U) - { - /* clock source is from PLL clock */ - u32EPWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if (epwm == EPWM0) - { - u32EPWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (epwm == EPWM1) */ - { - u32EPWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - for (u32Prescale = 1U; u32Prescale < 0xFFFU; u32Prescale++) /* prescale could be 0~0xFFF */ - { - i = (u32EPWMClockSrc / u32Frequency) / u32Prescale; - /* If target value is larger than CNR, need to use a larger prescaler */ - if (i < (0x10000U)) - { - u32CNR = i; - break; - } - } - /* Store return value here 'cos we're gonna change u16Prescale & u16CNR to the real value to fill into register */ - i = u32EPWMClockSrc / (u32Prescale * u32CNR); - - /* convert to real register value */ - u32Prescale -= 1U; - EPWM_SET_PRESCALER(epwm, (u32ChannelNum), u32Prescale); - /* set EPWM to up counter type(edge aligned) and auto-reload mode */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~((EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1U)) | ((1UL << EPWM_CTL1_CNTMODE0_Pos) << u32ChannelNum))); - - u32CNR -= 1U; - EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR); - EPWM_SET_CMR(epwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1U) / 100U); - - (epwm)->WGCTL0 = ((epwm)->WGCTL0 & ~((EPWM_WGCTL0_PRDPCTL0_Msk | EPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1U))) | \ - ((uint32_t)EPWM_OUTPUT_HIGH << ((u32ChannelNum << 1U) + (uint32_t)EPWM_WGCTL0_ZPCTL0_Pos)); - (epwm)->WGCTL1 = ((epwm)->WGCTL1 & ~((EPWM_WGCTL1_CMPDCTL0_Msk | EPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1U))) | \ - ((uint32_t)EPWM_OUTPUT_LOW << ((u32ChannelNum << 1U) + (uint32_t)EPWM_WGCTL1_CMPUCTL0_Pos)); - - return (i); -} - -/** - * @brief Start EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to start EPWM module. - */ -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN |= u32ChannelMask; -} - -/** - * @brief Stop EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM module. - */ -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (epwm)->PERIOD[i] = 0U; - } - } -} - -/** - * @brief Stop EPWM generation immediately by clear channel enable bit - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM generation immediately by clear channel enable bit. - */ -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN &= ~u32ChannelMask; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref EPWM_TRG_ADC_EVEN_ZERO - * - \ref EPWM_TRG_ADC_EVEN_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_UP - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_ODD_ZERO - * - \ref EPWM_TRG_ADC_ODD_PERIOD - * - \ref EPWM_TRG_ADC_ODD_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_ODD_COMPARE_UP - * - \ref EPWM_TRG_ADC_ODD_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_DOWN - * @return None - * @details This function is used to enable selected channel to trigger ADC. - */ -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if (u32ChannelNum < 4U) - { - (epwm)->EADCTS0 &= ~((EPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3U)); - (epwm)->EADCTS0 |= ((EPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCTS1 &= ~((EPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4U) << 3U)); - (epwm)->EADCTS1 |= ((EPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4U) << 3U)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger ADC. - */ -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - if (u32ChannelNum < 4U) - { - (epwm)->EADCTS0 &= ~(EPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3U)); - } - else - { - (epwm)->EADCTS1 &= ~(EPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4U) << 3U)); - } -} - -/** - * @brief Enable and configure trigger ADC prescale - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32Prescale ADC prescale. Valid values are between 0 to 0xF. - * @param[in] u32PrescaleCnt ADC prescale counter. Valid values are between 0 to 0xF. - * @retval 0 Success. - * @retval -1 Failed. - * @details This function is used to enable and configure trigger ADC prescale. - * @note User can configure only when ADC trigger prescale is disabled. - * @note ADC prescale counter must less than ADC prescale. - */ -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt) -{ - /* User can write only when PSCENn(n = 0 ~ 5) is 0 */ - if ((epwm)->EADCPSCCTL & (1UL << u32ChannelNum)) - return (-1); - - if (u32ChannelNum < 4UL) - { - (epwm)->EADCPSC0 = ((epwm)->EADCPSC0 & ~((EPWM_EADCPSC0_EADCPSC0_Msk) << (u32ChannelNum << 3))) | \ - (u32Prescale << (u32ChannelNum << 3)); - (epwm)->EADCPSCNT0 = ((epwm)->EADCPSCNT0 & ~((EPWM_EADCPSCNT0_PSCNT0_Msk) << (u32ChannelNum << 3))) | \ - (u32PrescaleCnt << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCPSC1 = ((epwm)->EADCPSC1 & ~((EPWM_EADCPSC1_EADCPSC4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32Prescale << ((u32ChannelNum - 4UL) << 3)); - (epwm)->EADCPSCNT1 = ((epwm)->EADCPSCNT1 & ~((EPWM_EADCPSCNT1_PSCNT4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32PrescaleCnt << ((u32ChannelNum - 4UL) << 3)); - } - - (epwm)->EADCPSCCTL |= EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum; - - return 0; -} - -/** - * @brief Disable Trigger ADC prescale function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable trigger ADC prescale. - */ -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->EADCPSCCTL &= ~(EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum); -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag. - */ -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->STATUS = (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get EPWM trigger ADC to start of conversion flag for specified channel. - */ -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Enable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger DAC. Combination of following conditions: - * - \ref EPWM_TRIGGER_DAC_ZERO - * - \ref EPWM_TRIGGER_DAC_PERIOD - * - \ref EPWM_TRIGGER_DAC_COMPARE_UP - * - \ref EPWM_TRIGGER_DAC_COMPARE_DOWN - * @return None - * @details This function is used to enable selected channel to trigger DAC. - */ -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->DACTRGEN |= (u32Condition << u32ChannelNum); -} - -/** - * @brief Disable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger DAC. - */ -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->DACTRGEN &= ~((EPWM_TRIGGER_DAC_ZERO | EPWM_TRIGGER_DAC_PERIOD | EPWM_TRIGGER_DAC_COMPARE_UP | \ - EPWM_TRIGGER_DAC_COMPARE_DOWN) << u32ChannelNum); -} - -/** - * @brief Clear selected channel trigger DAC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. This parameter is not used - * @param[in] u32Condition The condition to trigger DAC. This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger DAC flag. - */ -void EPWM_ClearDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->STATUS = EPWM_STATUS_DACTRGF_Msk; -} - -/** - * @brief Get selected channel trigger DAC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. This parameter is not used - * @retval 0 The specified channel trigger DAC to start of conversion flag is not set - * @retval 1 The specified channel trigger DAC to start of conversion flag is set - * @details This function is used to get selected channel trigger DAC flag. - */ -uint32_t EPWM_GetDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & EPWM_STATUS_DACTRGF_Msk) ? 1UL : 0UL); -} - -/** - * @brief This function enable fault brake of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * @param[in] u32LevelMask Output high or low while fault brake occurs, each bit represent the level of a channel - * while fault brake occurs. Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32BrakeSource Fault brake source, could be one of following source - * - \ref EPWM_FB_EDGE_ADCRM - * - \ref EPWM_FB_EDGE_ACMP0 - * - \ref EPWM_FB_EDGE_ACMP1 - * - \ref EPWM_FB_EDGE_BKP0 - * - \ref EPWM_FB_EDGE_BKP1 - * - \ref EPWM_FB_EDGE_SYS_CSS - * - \ref EPWM_FB_EDGE_SYS_BOD - * - \ref EPWM_FB_EDGE_SYS_RAM - * - \ref EPWM_FB_EDGE_SYS_COR - * - \ref EPWM_FB_LEVEL_ADCRM - * - \ref EPWM_FB_LEVEL_ACMP0 - * - \ref EPWM_FB_LEVEL_ACMP1 - * - \ref EPWM_FB_LEVEL_BKP0 - * - \ref EPWM_FB_LEVEL_BKP1 - * - \ref EPWM_FB_LEVEL_SYS_CSS - * - \ref EPWM_FB_LEVEL_SYS_BOD - * - \ref EPWM_FB_LEVEL_SYS_RAM - * - \ref EPWM_FB_LEVEL_SYS_COR - * @return None - * @details This function is used to enable fault brake of selected channel(s). - * The write-protection function should be disabled before using this function. - */ -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource) -{ - uint32_t i; - - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - if ((u32BrakeSource == EPWM_FB_EDGE_SYS_CSS) || (u32BrakeSource == EPWM_FB_EDGE_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_EDGE_SYS_RAM) || (u32BrakeSource == EPWM_FB_EDGE_SYS_COR) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_CSS) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_RAM) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_COR)) - { - (epwm)->BRKCTL[i >> 1U] |= (u32BrakeSource & (EPWM_BRKCTL0_1_SYSEBEN_Msk | EPWM_BRKCTL0_1_SYSLBEN_Msk)); - (epwm)->FAILBRK |= (u32BrakeSource & 0xFU); - } - else - { - (epwm)->BRKCTL[i >> 1U] |= u32BrakeSource; - } - } - - if (u32LevelMask & (1UL << i)) - { - if ((i & 0x1U) == 0U) - { - /* set brake action as high level for even channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3U) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as high level for odd channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3U) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - else - { - if ((i & 0x1U) == 0U) - { - /* set brake action as low level for even channel */ - (epwm)->BRKCTL[i >> 1U] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1U] |= ((2U) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as low level for odd channel */ - (epwm)->BRKCTL[i >> 1U] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1U] |= ((2U) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - } -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s). - */ -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN |= u32ChannelMask; - (epwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s). - */ -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN &= ~u32ChannelMask; - (epwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enable EPWM output generation of selected channel(s). - */ -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disable EPWM output generation of selected channel(s). - */ -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @param[in] u32RisingFirst The capture order is rising, falling first. Every two channels share the same setting. Valid values are TRUE and FALSE. - * @param[in] u32Mode Captured data transferred by PDMA interrupt type. It could be either - * - \ref EPWM_CAPTURE_PDMA_RISING_LATCH - * - \ref EPWM_CAPTURE_PDMA_FALLING_LATCH - * - \ref EPWM_CAPTURE_PDMA_RISING_FALLING_LATCH - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - * @note This function can only selects even or odd channel of pairs to do PDMA transfer. - */ -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode) -{ - uint32_t u32IsOddCh; - u32IsOddCh = u32ChannelNum & 0x1U; - (epwm)->PDMACTL = ((epwm)->PDMACTL & ~((EPWM_PDMACTL_CHSEL0_1_Msk | EPWM_PDMACTL_CAPORD0_1_Msk | EPWM_PDMACTL_CAPMOD0_1_Msk) << ((u32ChannelNum >> 1U) << 3U))) | \ - (((u32IsOddCh << EPWM_PDMACTL_CHSEL0_1_Pos) | (u32RisingFirst << EPWM_PDMACTL_CAPORD0_1_Pos) | \ - u32Mode | EPWM_PDMACTL_CHEN0_1_Msk) << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Disables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - */ -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->PDMACTL &= ~(EPWM_PDMACTL_CHEN0_1_Msk << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Enable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Duration Dead zone length in EPWM clock count, valid values are between 0~0xFFF, but 0 means there is no Dead zone. - * @return None - * @details This function is used to enable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration) -{ - /* every two channels share the same setting */ - (epwm)->DTCTL |= (EPWM_DTCTL_RDTEN0_Msk << ((u32ChannelNum) >> 1U)) | (EPWM_DTCTL_FDTEN0_Msk << ((u32ChannelNum) >> 1U)); - (epwm)->RDTCNT[(u32ChannelNum) >> 1U] = u32Duration; - (epwm)->FDTCNT[(u32ChannelNum) >> 1U] = u32Duration; -} - -/** - * @brief Disable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - */ -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - /* every two channels shares the same setting */ - (epwm)->DTCTL &= ~((EPWM_DTCTL_RDTEN0_Msk << ((u32ChannelNum) >> 1U)) | (EPWM_DTCTL_FDTEN0_Msk << ((u32ChannelNum) >> 1U))); -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((((epwm)->CAPIF & (EPWM_CAPIF_CFLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1) | \ - (((epwm)->CAPIF & (EPWM_CAPIF_CRLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL)); -} -/** - * @brief Enable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref EPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (epwm)->INTEN0 |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel. - */ -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((uint32_t)(EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | EPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel. - */ -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = (EPWM_INTSTS0_CMPUIF0_Msk | EPWM_INTSTS0_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((EPWM_INTSTS0_CMPDIF0_Msk | EPWM_INTSTS0_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief This function enable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to enable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 |= (0x7UL << u32BrakeSource); -} - -/** - * @brief This function disable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to disable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 &= ~(0x7UL << u32BrakeSource); -} - -/** - * @brief This function clear fault brake interrupt of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to clear fault brake interrupt of selected source. - * The write-protection function should be disabled before using this function. - */ -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTSTS1 = (0x3fUL << u32BrakeSource); -} - -/** - * @brief This function get fault brake interrupt flag of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source, could be either - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * @details This function is used to get fault brake interrupt flag of selected source. - */ -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - return (((epwm)->INTSTS1 & (0x3fUL << u32BrakeSource)) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - */ -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (epwm)->INTEN0 |= ((1UL << EPWM_INTEN0_PIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable period interrupt of selected channel. - */ -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((1UL << EPWM_INTEN0_PIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear period interrupt of selected channel. - */ -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = ((1UL << EPWM_INTSTS0_PIF0_Pos) << u32ChannelNum); -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel. - */ -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((1UL << EPWM_INTSTS0_PIF0_Pos) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable zero interrupt of selected channel. - */ -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 |= ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable zero interrupt of selected channel. - */ -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear zero interrupt of selected channel. - */ -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Zero interrupt flag of specified channel - * @retval 0 Zero interrupt did not occur - * @retval 1 Zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - */ -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntFlagCnt Interrupt flag counter. Valid values are between 0~65535. - * @param[in] u32IntAccSrc Interrupt flag accumulator source selection. - * - \ref EPWM_IFA_ZERO_POINT - * - \ref EPWM_IFA_PERIOD_POINT - * - \ref EPWM_IFA_COMPARE_UP_COUNT_POINT - * - \ref EPWM_IFA_COMPARE_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable interrupt flag accumulator of selected channel. - */ -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc) -{ - (epwm)->IFA[u32ChannelNum] = (((epwm)->IFA[u32ChannelNum] & ~((EPWM_IFA0_IFACNT_Msk | EPWM_IFA0_IFASEL_Msk))) | \ - (EPWM_IFA0_IFAEN_Msk | (u32IntAccSrc << EPWM_IFA0_IFASEL_Pos) | u32IntFlagCnt)); -} - -/** - * @brief Disable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to Disable interrupt flag accumulator of selected channel. - */ -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] = ((epwm)->IFA[u32ChannelNum] & ~(EPWM_IFA0_IFAEN_Msk)); -} - -/** - * @brief Enable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Clear interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTSTS = (1UL << (u32ChannelNum)); -} - -/** - * @brief Get interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 Accumulator interrupt did not occur - * @retval 1 Accumulator interrupt occurred - * @details This function is used to Get interrupt flag accumulator interrupt of selected channel. - */ -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->AINTSTS & (1UL << (u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Enable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] |= EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Disable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] &= ~EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Clear free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear free trigger duty interrupt flag of selected channel. - */ -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FTCI = ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1U)); -} - -/** - * @brief Get free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Free trigger duty interrupt did not occur - * @retval 1 Free trigger duty interrupt occurred - * @details This function is used to get free trigger duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FTCI & ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1U))) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Configure synchronization phase of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32SyncSrc EPWM synchronize source selection. - * - \ref EPWM_SYNC_OUT_FROM_SYNCIN_SWSYNC - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_ZERO - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_COMPARATOR - * - \ref EPWM_SYNC_OUT_DISABLE - * @param[in] u32Direction Phase direction. Control EPWM counter count decrement or increment after synchronizing. - * - \ref EPWM_PHS_DIR_DECREMENT - * - \ref EPWM_PHS_DIR_INCREMENT - * @param[in] u32StartPhase Synchronous start phase value. Valid values are between 0~65535. - * @return None - * @details This function is used to configure synchronization phase of selected channel. - * @note Every two channels share the same setting. - */ -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase) -{ - /* every two channels shares the same setting */ - u32ChannelNum >>= 1U; - (epwm)->SYNC = (((epwm)->SYNC & ~(((3UL << EPWM_SYNC_SINSRC0_Pos) << (u32ChannelNum << 1U)) | ((1UL << EPWM_SYNC_PHSDIR0_Pos) << u32ChannelNum))) | \ - (u32Direction << EPWM_SYNC_PHSDIR0_Pos << u32ChannelNum) | ((u32SyncSrc << EPWM_SYNC_SINSRC0_Pos) << (u32ChannelNum << 1U))); - (epwm)->PHS[(u32ChannelNum)] = u32StartPhase; -} - - -/** - * @brief Enable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC |= ((1UL << EPWM_SYNC_PHSEN0_Pos) << (i >> 1U)); - } - } -} - -/** - * @brief Disable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC &= ~((1UL << EPWM_SYNC_PHSEN0_Pos) << (i >> 1U)); - } - } -} - -/** - * @brief Enable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector. - * The valid value is 0~7. - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM SYNC_IN noise filter function. - */ -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->SYNC = ((epwm)->SYNC & ~(EPWM_SYNC_SFLTCNT_Msk | EPWM_SYNC_SFLTCSEL_Msk)) | \ - ((u32ClkCnt << EPWM_SYNC_SFLTCNT_Pos) | (u32ClkDivSel << EPWM_SYNC_SFLTCSEL_Pos) | EPWM_SYNC_SNFLTEN_Msk); -} - -/** - * @brief Disable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC_IN noise filter function. - */ -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm) -{ - (epwm)->SYNC &= ~EPWM_SYNC_SNFLTEN_Msk; -} - -/** - * @brief Enable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to enable EPWM SYNC input pin inverse function. - */ -void EPWM_EnableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC |= EPWM_SYNC_SINPINV_Msk; -} - -/** - * @brief Disable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC input pin inverse function. - */ -void EPWM_DisableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC &= (~EPWM_SYNC_SINPINV_Msk); -} - -/** - * @brief Set EPWM clock source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32ClkSrcSel EPWM external clock source. - * - \ref EPWM_CLKSRC_EPWM_CLK - * - \ref EPWM_CLKSRC_TIMER0 - * - \ref EPWM_CLKSRC_TIMER1 - * - \ref EPWM_CLKSRC_TIMER2 - * - \ref EPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set EPWM clock source. - * @note Every two channels share the same setting. - * @note If the clock source of EPWM counter is selected from TIMERn interrupt events, the TRGEPWM(TIMERn_TRGCTL[1], n=0,1..3) bit must be set as 1. - */ -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (epwm)->CLKSRC = ((epwm)->CLKSRC & ~(EPWM_CLKSRC_ECLKSRC0_Msk << ((u32ChannelNum >> 1U) << 3U))) | \ - (u32ClkSrcSel << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Enable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM brake noise filter function. - */ -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->BNF = ((epwm)->BNF & ~((EPWM_BNF_BRK0FCNT_Msk | EPWM_BNF_BRK0NFSEL_Msk) << (u32BrakePinNum << 3U))) | \ - (((u32ClkCnt << EPWM_BNF_BRK0FCNT_Pos) | (u32ClkDivSel << EPWM_BNF_BRK0NFSEL_Pos) | EPWM_BNF_BRK0NFEN_Msk) << (u32BrakePinNum << 3U)); -} - -/** - * @brief Disable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake noise filter function. - */ -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0NFEN_Msk << (u32BrakePinNum << 3U)); -} - -/** - * @brief Enable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to enable EPWM brake pin inverse function. - */ -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF |= (EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum << 3U)); -} - -/** - * @brief Disable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake pin inverse function. - */ -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum * (uint32_t)EPWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Set EPWM brake pin source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32SelAnotherModule Select to another module. Valid values are TRUE or FALSE. - * @return None - * @details This function is used to set EPWM brake pin source. - */ -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule) -{ - (epwm)->BNF = ((epwm)->BNF & ~(EPWM_BNF_BK0SRC_Msk << (u32BrakePinNum << 3U))) | (u32SelAnotherModule << ((uint32_t)EPWM_BNF_BK0SRC_Pos + (u32BrakePinNum << 3U))); -} - -/** - * @brief Set EPWM leading edge blanking function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32TrigSrcSel Leading edge blanking source selection. - * - \ref EPWM_LEBCTL_SRCEN0 - * - \ref EPWM_LEBCTL_SRCEN2 - * - \ref EPWM_LEBCTL_SRCEN4 - * - \ref EPWM_LEBCTL_SRCEN0_2 - * - \ref EPWM_LEBCTL_SRCEN0_4 - * - \ref EPWM_LEBCTL_SRCEN2_4 - * - \ref EPWM_LEBCTL_SRCEN0_2_4 - * @param[in] u32TrigType Leading edge blanking trigger type. - * - \ref EPWM_LEBCTL_TRGTYPE_RISING - * - \ref EPWM_LEBCTL_TRGTYPE_FALLING - * - \ref EPWM_LEBCTL_TRGTYPE_RISING_OR_FALLING - * @param[in] u32BlankingCnt Leading Edge Blanking Counter. Valid values are between 1~512. - This counter value decides leading edge blanking window size, and this counter clock base is ECLK. - * @param[in] u32BlankingEnable Enable EPWM leading edge blanking function. Valid values are TRUE (ENABLE) or FALSE (DISABLE). - * - \ref FALSE - * - \ref TRUE - * @return None - * @details This function is used to configure EPWM leading edge blanking function that blank the false trigger from ACMP brake source which may cause by EPWM output transition. - * @note EPWM leading edge blanking function is only used for brake source from ACMP. - */ -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable) -{ - (epwm)->LEBCTL = (u32TrigType) | (u32TrigSrcSel) | (u32BlankingEnable); - /* Blanking window size = LEBCNT + 1, so LEBCNT = u32BlankingCnt - 1 */ - (epwm)->LEBCNT = (u32BlankingCnt) - 1U; -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - */ -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - */ -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->STATUS = (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum); -} - -/** - * @brief Enable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32AfterPrescaler Fault Detect Clock Source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @param[in] u32ClkSel Fault Detect Clock Select. - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_1 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_2 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_4 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_8 - * @return None - * @details This function is used to enable fault detect of selected channel. - */ -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel) -{ - (epwm)->FDEN = ((epwm)->FDEN & ~(EPWM_FDEN_FDCKS0_Msk << (u32ChannelNum))) | \ - ((EPWM_FDEN_FDEN0_Msk | ((u32AfterPrescaler) << EPWM_FDEN_FDCKS0_Pos)) << (u32ChannelNum)); - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & ~EPWM_FDCTL0_FDCKSEL_Msk) | (u32ClkSel); -} - -/** - * @brief Disable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect of selected channel. - */ -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect output of selected channel. - */ -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect output of selected channel. - */ -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN |= (EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32DeglitchSmpCycle Deglitch Sampling Cycle. Valid values are between 0~7. - * @return None - * @details This function is used to enable fault detect deglitch function of selected channel. - */ -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_DGSMPCYC_Msk)) | \ - (EPWM_FDCTL0_FDDGEN_Msk | ((u32DeglitchSmpCycle) << EPWM_FDCTL0_DGSMPCYC_Pos)); -} - -/** - * @brief Disable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect deglitch function of selected channel. - */ -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDDGEN_Msk; -} - -/** - * @brief Enable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32MaskCnt Transition mask counter. Valid values are between 0~0x7F. - * @return None - * @details This function is used to enable fault detect mask function of selected channel. - */ -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_TRMSKCNT_Msk)) | (EPWM_FDCTL0_FDMSKEN_Msk | (u32MaskCnt)); -} - -/** - * @brief Disable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect mask function of selected channel. - */ -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDMSKEN_Msk; -} - -/** - * @brief Enable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect interrupt of selected channel. - */ -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN |= (EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect interrupt of selected channel. - */ -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN &= ~(EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Clear fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to clear fault detect interrupt of selected channel. - */ -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDSTS = (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum)); -} - -/** - * @brief Get fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @retval 0 Fault detect interrupt did not occur. - * @retval 1 Fault detect interrupt occurred. - * @details This function is used to Get fault detect interrupt of selected channel. - */ -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FDSTS & (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum))) ? 1UL : 0UL); -} - -/*@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_eqei.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_eqei.c deleted file mode 100644 index e1c99cc2c91..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_eqei.c +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************//** - * @file qei.c - * @version V3.00 - * @brief Enhanced Quadrature Encoder Interface (EQEI) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EQEI_Driver EQEI Driver - @{ -*/ - -/** @addtogroup EQEI_EXPORTED_FUNCTIONS EQEI Exported Functions - @{ -*/ - -/** - * @brief Close EQEI function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This function reset EQEI configuration and stop EQEI counting. - */ -void EQEI_Close(EQEI_T *eqei) -{ - /* Reset EQEI configuration */ - eqei->CTL = (uint32_t)0; -} - -/** - * @brief Disable EQEI interrupt - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref EQEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref EQEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref EQEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref EQEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function disable EQEI specified interrupt. - */ -void EQEI_DisableInt(EQEI_T *eqei, uint32_t u32IntSel) -{ - /* Disable EQEI specified interrupt */ - EQEI_DISABLE_INT(eqei, u32IntSel); - - /* Disable NVIC EQEI IRQ */ - if (eqei == (EQEI_T *)EQEI0) - { - NVIC_DisableIRQ((IRQn_Type)EQEI0_IRQn); - } - else if (eqei == (EQEI_T *)EQEI1) - { - NVIC_DisableIRQ((IRQn_Type)EQEI1_IRQn); - } - else if (eqei == (EQEI_T *)EQEI2) - { - NVIC_DisableIRQ((IRQn_Type)EQEI2_IRQn); - } - else - { - NVIC_DisableIRQ((IRQn_Type)EQEI3_IRQn); - } -} - -/** - * @brief Enable EQEI interrupt - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref EQEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref EQEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref EQEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref EQEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function enable EQEI specified interrupt. - */ -void EQEI_EnableInt(EQEI_T *eqei, uint32_t u32IntSel) -{ - /* Enable EQEI specified interrupt */ - EQEI_ENABLE_INT(eqei, u32IntSel); - - /* Enable NVIC EQEI IRQ */ - if (eqei == (EQEI_T *)EQEI0) - { - NVIC_EnableIRQ(EQEI0_IRQn); - } - else if (eqei == (EQEI_T *)EQEI1) - { - NVIC_EnableIRQ(EQEI1_IRQn); - } - else if (eqei == (EQEI_T *)EQEI2) - { - NVIC_EnableIRQ(EQEI2_IRQn); - } - else - { - NVIC_EnableIRQ(EQEI3_IRQn); - } -} - -/** - * @brief Open EQEI in specified mode and enable input - * @param[in] eqei The pointer of the specified EQEI module. - * @param[in] u32Mode EQEI counting mode. - * - \ref EQEI_CTL_X4_FREE_COUNTING_MODE - * - \ref EQEI_CTL_X2_FREE_COUNTING_MODE - * - \ref EQEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref EQEI_CTL_X2_COMPARE_COUNTING_MODE - * - \ref EQEI_CTL_PHASE_COUNTING_MODE_TYPE1 - * - \ref EQEI_CTL_PHASE_COUNTING_MODE_TYPE2 - * - \ref EQEI_CTL_DIRECTIONAL_COUNTING_MODE - * @param[in] u32Value The counter maximum value in compare-counting mode. - * @return None - * @details This function set EQEI in specified mode and enable input. - */ -void EQEI_Open(EQEI_T *eqei, uint32_t u32Mode, uint32_t u32Value) -{ - /* Set EQEI function configuration */ - /* Set EQEI counting mode */ - /* Enable IDX, QEA and QEB input to EQEI controller */ - eqei->CTL = (eqei->CTL & (~EQEI_CTL_MODE_Msk)) | ((u32Mode) | EQEI_CTL_CHAEN_Msk | EQEI_CTL_CHBEN_Msk | EQEI_CTL_IDXEN_Msk); - - /* Set EQEI maximum count value in in compare-counting mode */ - eqei->CNTMAX = u32Value; -} - -/** - * @brief Start EQEI function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This function enable EQEI function and start EQEI counting. - */ -void EQEI_Start(EQEI_T *eqei) -{ - /* Enable EQEI controller function */ - eqei->CTL |= EQEI_CTL_QEIEN_Msk; -} - -/** - * @brief Stop EQEI function - * @param[in] eqei The pointer of the specified EQEI module. - * @return None - * @details This function disable EQEI function and stop EQEI counting. - */ -void EQEI_Stop(EQEI_T *eqei) -{ - /* Disable EQEI controller function */ - eqei->CTL &= (~EQEI_CTL_QEIEN_Msk); -} - - -/*@}*/ /* end of group EQEI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EQEI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2021 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_fmc.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_fmc.c deleted file mode 100644 index d02751318c5..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_fmc.c +++ /dev/null @@ -1,1232 +0,0 @@ -/**************************************************************************//** - * @file fmc.c - * @version V1.00 - * @brief M460 series FMC driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include - -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - -int32_t g_FMC_i32ErrCode = 0; /*!< FMC global error code */ - -/** - * @brief Disable FMC ISP function. - * @return None - */ -void FMC_Close(void) -{ - FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk; -} - -/** - * @brief Config XOM Region - * @param[in] u32XomNum The XOM number(0~3) - * @param[in] u32XomBase The XOM region base address. - * @param[in] u8XomPage The XOM page number of region size. - * - * @retval 0 Success - * @retval 1 XOM is has already actived. - * @retval -1 Program failed. - * @retval -2 Invalid XOM number. - * - * @details Program XOM base address and XOM size(page) - * @note Global error code g_FMC_i32ErrCode - * -1 Program failed or program time-out - * -2 Invalid XOM number. - */ -int32_t FMC_ConfigXOM(uint32_t u32XomNum, uint32_t u32XomBase, uint8_t u8XomPage) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if (u32XomNum >= 4UL) - { - g_FMC_i32ErrCode = -2; - ret = -2; - } - - if (ret == 0) - { - ret = FMC_GetXOMState(u32XomNum); - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u); - FMC->ISPDAT = u32XomBase; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u + 0x04u); - FMC->ISPDAT = u8XomPage; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u + 0x08u); - FMC->ISPDAT = 0u; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - } - - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_PAGE_ERASE command to erase a flash page. The page size is 4096 bytes. - * @param[in] u32PageAddr Address of the flash page to be erased. - * It must be a 4096 bytes aligned address. - * @return ISP page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * - * @note Global error code g_FMC_i32ErrCode - * -1 Erase failed or erase time-out - */ -int32_t FMC_Erase(uint32_t u32PageAddr) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = u32PageAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_ERASE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - - return ret; -} - - -/** - * @brief Execute FMC_ISPCMD_BANK_ERASE command to erase a flash block. - * @param[in] u32BankAddr Base address of the flash bank to be erased. - * @return ISP page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * - * @note Global error code g_FMC_i32ErrCode - * -1 Erase failed or erase time-out - */ -int32_t FMC_EraseBank(uint32_t u32BankAddr) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_BANK_ERASE; - FMC->ISPADDR = u32BankAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_ERASE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - return ret; -} - -/** - * @brief Execute Erase XOM Region - * - * @param[in] u32XomNum The XOMRn(n=0~3) - * - * @return XOM erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * @retval -2 Invalid XOM number. - * - * @details Execute FMC_ISPCMD_PAGE_ERASE command to erase XOM. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Program failed or program time-out - * -2 Invalid XOM number. - */ -int32_t FMC_EraseXOM(uint32_t u32XomNum) -{ - uint32_t u32Addr; - int32_t i32Active, err = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if (u32XomNum >= 4UL) - { - err = -2; - } - - if (err == 0) - { - i32Active = FMC_GetXOMState(u32XomNum); - - if (i32Active) - { - switch (u32XomNum) - { - case 0u: - u32Addr = (FMC->XOMR0STS & 0xFFFFFF00u) >> 8u; - break; - case 1u: - u32Addr = (FMC->XOMR1STS & 0xFFFFFF00u) >> 8u; - break; - case 2u: - u32Addr = (FMC->XOMR2STS & 0xFFFFFF00u) >> 8u; - break; - case 3u: - u32Addr = (FMC->XOMR3STS & 0xFFFFFF00u) >> 8u; - break; - default: - /* Should not be here */ - err = -2; - goto lexit; - } - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = u32Addr; - FMC->ISPDAT = 0x55aa03u; - FMC->ISPTRG = 0x1u; -#if ISBEN - __ISB(); -#endif - i32TimeOutCnt = FMC_TIMEOUT_ERASE; - while (FMC->ISPTRG) - { - if (i32TimeOutCnt-- <= 0) - { - err = -1; - break; - } - } - - /* Check ISPFF flag to know whether erase OK or fail. */ - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - err = -1; - } - } - else - { - err = -1; - } - } - -lexit: - g_FMC_i32ErrCode = err; - return err; -} - -/** - * @brief Check the XOM is actived or not. - * - * @param[in] u32XomNum The xom number(0~3). - * - * @retval 1 XOM is actived. - * @retval 0 XOM is not actived. - * @retval -2 Invalid XOM number. - * - * @details To get specify XOMRn(n=0~3) active status - */ -int32_t FMC_GetXOMState(uint32_t u32XomNum) -{ - uint32_t u32act; - int32_t ret = 0; - - if (u32XomNum >= 4UL) - { - ret = -2; - } - - if (ret >= 0) - { - u32act = (((FMC->XOMSTS) & 0xful) & (1ul << u32XomNum)) >> u32XomNum; - ret = (int32_t)u32act; - } - return ret; -} - -/** - * @brief Get the current boot source. - * @return The current boot source. - * @retval 0 Is boot from APROM. - * @retval 1 Is boot from LDROM. - * @retval 2 Is boot from Boot Loader. - */ -int32_t FMC_GetBootSource(void) -{ - if (FMC->ISPCTL & FMC_ISPCTL_BL_Msk) - { - return 2; - } - if (FMC->ISPCTL & FMC_ISPCTL_BS_Msk) - { - return 1; - } - return 0; -} - - -/** - * @brief Enable FMC ISP function - * @return None - */ -void FMC_Open(void) -{ - FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk; -} - - -/** - * @brief Execute FMC_ISPCMD_READ command to read a word from flash. - * @param[in] u32Addr Address of the flash location to be read. - * It must be a word aligned address. - * @return The word data read from specified flash address. - * Return 0xFFFFFFFF if read failed. - * @note Global error code g_FMC_i32ErrCode - * -1 Read time-out - */ -uint32_t FMC_Read(uint32_t u32Addr) -{ - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - FMC->ISPCMD = FMC_ISPCMD_READ; - FMC->ISPADDR = u32Addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_READ; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return 0xFFFFFFFF; - } - } - - return FMC->ISPDAT; -} - - -/** - * @brief Execute FMC_ISPCMD_READ_64 command to read a double-word from flash. - * @param[in] u32addr Address of the flash location to be read. - * It must be a double-word aligned address. - * @param[out] u32data0 Place holder of word 0 read from flash address u32addr. - * @param[out] u32data1 Place holder of word 0 read from flash address u32addr+4. - * @return 0 Success - * @return -1 Failed - * - * @note Global error code g_FMC_i32ErrCode - * -1 Read time-out - */ -int32_t FMC_Read_64(uint32_t u32addr, uint32_t *u32data0, uint32_t *u32data1) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - FMC->ISPCMD = FMC_ISPCMD_READ_64; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = 0x0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_READ; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - else - { - *u32data0 = FMC->MPDAT0; - *u32data1 = FMC->MPDAT1; - } - return ret; -} - - -/** - * @brief Get the base address of Data Flash if enabled. - * @retval The base address of Data Flash - */ -uint32_t FMC_ReadDataFlashBaseAddr(void) -{ - return FMC->DFBA; -} - -/** - * @brief Set boot source from LDROM or APROM after next software reset - * @param[in] i32BootSrc - * 1: Boot from LDROM - * 0: Boot from APROM - * @return None - * @details This function is used to switch APROM boot or LDROM boot. User need to call - * FMC_SetBootSource to select boot source first, then use CPU reset or - * System Reset Request to reset system. - */ -void FMC_SetBootSource(int32_t i32BootSrc) -{ - if (i32BootSrc) - { - FMC->ISPCTL |= FMC_ISPCTL_BS_Msk; /* Boot from LDROM */ - } - else - { - FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk;/* Boot from APROM */ - } -} - -/** - * @brief Execute ISP FMC_ISPCMD_PROGRAM to program a word to flash. - * @param[in] u32Addr Address of the flash location to be programmed. - * It must be a word aligned address. - * @param[in] u32Data The word data to be programmed. - * @return 0 Success - * @return -1 Failed - * - * @note Global error code g_FMC_i32ErrCode - * -1 Program failed or time-out - */ -int32_t FMC_Write(uint32_t u32Addr, uint32_t u32Data) -{ - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = u32Addr; - FMC->ISPDAT = u32Data; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return -1; - } - } - - return 0; -} - -/** - * @brief Execute ISP FMC_ISPCMD_PROGRAM_64 to program a double-word to flash. - * @param[in] u32addr Address of the flash location to be programmed. - * It must be a double-word aligned address. - * @param[in] u32data0 The word data to be programmed to flash address u32addr. - * @param[in] u32data1 The word data to be programmed to flash address u32addr+4. - * @return 0 Success - * @return -1 Failed - * - * @note Global error code g_FMC_i32ErrCode - * -1 Program failed or time-out - */ -int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - FMC->ISPCMD = FMC_ISPCMD_PROGRAM_64; - FMC->ISPADDR = u32addr; - FMC->MPDAT0 = u32data0; - FMC->MPDAT1 = u32data1; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - return ret; -} - - -/** - * @brief Program Multi-Word data into specified address of flash. - * @param[in] u32Addr Start flash address in APROM where the data chunk to be programmed into. - * This address must be 8-bytes aligned to flash address. - * @param[in] pu32Buf Buffer that carry the data chunk. - * @param[in] u32Len Length of the data chunk in bytes. - * @retval >=0 Number of data bytes were programmed. - * @retval -1 Program failed. - * @retval -2 Invalid address. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Program failed or time-out - * -2 Invalid address - */ -int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len) -{ - int i, idx, retval = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if ((u32Addr >= FMC_APROM_END) || ((u32Addr % 8) != 0)) - { - g_FMC_i32ErrCode = -2; - return -2; - } - - u32Len = u32Len - (u32Len % 8); /* u32Len must be multiple of 8. */ - - idx = 0; - - while (u32Len >= 8) - { - FMC->ISPADDR = u32Addr; - FMC->MPDAT0 = pu32Buf[idx++]; - FMC->MPDAT1 = pu32Buf[idx++]; - FMC->MPDAT2 = pu32Buf[idx++]; - FMC->MPDAT3 = pu32Buf[idx++]; - FMC->ISPCMD = FMC_ISPCMD_PROGRAM_MUL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - for (i = 16; i < FMC_MULTI_WORD_PROG_LEN;) - { - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->MPSTS & (FMC_MPSTS_D0_Msk | FMC_MPSTS_D1_Msk)) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return -1; - } - } - - retval += 8; - u32Len -= 8; - if (u32Len < 8) - { - return retval; - } - - if (!(FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk)) - { - /* printf(" [WARNING] busy cleared after D0D1 cleared!\n"); */ - i += 8; - break; - } - - FMC->MPDAT0 = pu32Buf[idx++]; - FMC->MPDAT1 = pu32Buf[idx++]; - - if (i == FMC_MULTI_WORD_PROG_LEN / 4) - break; // done - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->MPSTS & (FMC_MPSTS_D2_Msk | FMC_MPSTS_D3_Msk)) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return -1; - } - } - - retval += 8; - u32Len -= 8; - if (u32Len < 8) - { - return retval; - } - - if (!(FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk)) - { - /* printf(" [WARNING] busy cleared after D2D3 cleared!\n"); */ - i += 8; - break; - } - - FMC->MPDAT2 = pu32Buf[idx++]; - FMC->MPDAT3 = pu32Buf[idx++]; - } - - if (i != FMC_MULTI_WORD_PROG_LEN) - { - /* printf(" [WARNING] Multi-word program interrupted at 0x%x !!\n", i); */ - return retval; - } - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return -1; - } - } - - u32Addr += FMC_MULTI_WORD_PROG_LEN; - } - return retval; -} - - -/** - * @brief Program a 64-bits data to the specified OTP. - * @param[in] otp_num The OTP number. - * @param[in] low_word Low word of the 64-bits data. - * @param[in] high_word High word of the 64-bits data. - * @retval 0 Success - * @retval -1 Program failed. - * @retval -2 Invalid OTP number. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Program failed or time-out - * -2 Invalid OTP number - */ -int32_t FMC_WriteOTP(uint32_t otp_num, uint32_t low_word, uint32_t high_word) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if (otp_num > 255UL) - { - g_FMC_i32ErrCode = -2; - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + otp_num * 8UL; - FMC->ISPDAT = low_word; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + otp_num * 8UL + 4UL; - FMC->ISPDAT = high_word; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - } - - return ret; -} - -/** - * @brief Read the 64-bits data from the specified OTP. - * @param[in] otp_num The OTP number. - * @param[in] low_word Low word of the 64-bits data. - * @param[in] high_word High word of the 64-bits data. - * @retval 0 Success - * @retval -1 Read failed. - * @retval -2 Invalid OTP number. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Read failed or time-out - * -2 Invalid OTP number - */ -int32_t FMC_ReadOTP(uint32_t otp_num, uint32_t *low_word, uint32_t *high_word) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if (otp_num > 255UL) - { - g_FMC_i32ErrCode = -2; - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_READ_64; - FMC->ISPADDR = FMC_OTP_BASE + otp_num * 8UL ; - FMC->ISPDAT = 0x0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_READ; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - else - { - *low_word = FMC->MPDAT0; - *high_word = FMC->MPDAT1; - } - } - return ret; -} - -/** - * @brief Lock the specified OTP. - * @param[in] otp_num The OTP number. - * @retval 0 Success - * @retval -1 Failed to write OTP lock bits. - * @retval -2 Invalid OTP number. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Failed to write OTP lock bits or write time-out - * -2 Invalid OTP number - */ -int32_t FMC_LockOTP(uint32_t otp_num) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if (otp_num > 255UL) - { - g_FMC_i32ErrCode = -2; - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + 0x800UL + otp_num * 4UL; - FMC->ISPDAT = 0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - } - return ret; -} - -/** - * @brief Check the OTP is locked or not. - * @param[in] otp_num The OTP number. - * @retval 1 OTP is locked. - * @retval 0 OTP is not locked. - * @retval -1 Failed to read OTP lock bits. - * @retval -2 Invalid OTP number. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Failed to read OTP lock bits or read time-out - * -2 Invalid OTP number - */ -int32_t FMC_IsOTPLocked(uint32_t otp_num) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if (otp_num > 255UL) - { - g_FMC_i32ErrCode = -2; - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_READ; - FMC->ISPADDR = FMC_OTP_BASE + 0x800UL + otp_num * 4UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_READ; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - else - { - if (FMC->ISPDAT != 0xFFFFFFFFUL) - { - g_FMC_i32ErrCode = -1; - ret = 1; /* Lock work was progrmmed. OTP was locked. */ - } - } - } - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_READ command to read User Configuration. - * @param[out] u32Config A two-word array. - * u32Config[0] holds CONFIG0, while u32Config[1] holds CONFIG1. - * @param[in] u32Count Available word count in u32Config. - * @return Success or not. - * @retval 0 Success. - * @retval -1 Read failed - * @retval -2 Invalid parameter. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Read failed - * -2 Invalid parameter - */ -int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count) -{ - int32_t ret = 0; - - u32Config[0] = FMC_Read(FMC_CONFIG_BASE); - - if (g_FMC_i32ErrCode != 0) - return g_FMC_i32ErrCode; - - if (u32Count < 2UL) - { - ret = -2; - } - else - { - u32Config[1] = FMC_Read(FMC_CONFIG_BASE + 4UL); - } - return ret; -} - - -/** - * @brief Execute ISP commands to erase then write User Configuration. - * @param[in] u32Config A two-word array. - * u32Config[0] holds CONFIG0, while u32Config[1] holds CONFIG1. - * @param[in] u32Count The number of User Configuration words to be written. - * @return Success or not. - * @retval 0 Success - * @retval -1 Erase/program/read/verify failed - * - * @note Global error code g_FMC_i32ErrCode - * < 0 Errors caused by erase/program/read failed or time-out - */ -int32_t FMC_WriteConfig(uint32_t u32Config[], uint32_t u32Count) -{ - int i; - - FMC_ENABLE_CFG_UPDATE(); - - if (FMC_Erase(FMC_CONFIG_BASE) != 0) - return -1; - - if ((FMC_Read(FMC_CONFIG_BASE) != 0xFFFFFFFF) || (FMC_Read(FMC_CONFIG_BASE + 4) != 0xFFFFFFFF) || - (FMC_Read(FMC_CONFIG_BASE + 8) != 0xFFFF5A5A)) - { - FMC_DISABLE_CFG_UPDATE(); - return -1; - } - - if (g_FMC_i32ErrCode != 0) - { - FMC_DISABLE_CFG_UPDATE(); - return -1; - } - - for (i = 0; i < u32Count; i++) - { - if (FMC_Write(FMC_CONFIG_BASE + i * 4UL, u32Config[i]) != 0) - { - FMC_DISABLE_CFG_UPDATE(); - return -1; - } - - if (FMC_Read(FMC_CONFIG_BASE + i * 4UL) != u32Config[i]) - { - FMC_DISABLE_CFG_UPDATE(); - return -1; - } - - if (g_FMC_i32ErrCode != 0) - { - FMC_DISABLE_CFG_UPDATE(); - return -1; - } - } - - FMC_DISABLE_CFG_UPDATE(); - return 0; -} - - -/** - * @brief Run CRC32 checksum calculation and get result. - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 512 bytes. - * @return Success or not. - * @retval 0 Success. - * @retval 0xFFFFFFFF Invalid parameter or command failed. - * - * @note Global error code g_FMC_i32ErrCode - * -1 Run/Read check sum time-out failed - * -2 u32addr or u32count must be aligned with 512 - */ -uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - if ((u32addr % 512UL) || (u32count % 512UL)) - { - g_FMC_i32ErrCode = -2; - ret = 0xFFFFFFFF; - } - else - { - FMC->ISPCMD = FMC_ISPCMD_RUN_CKS; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = u32count; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_CHKSUM; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return 0xFFFFFFFF; - } - } - - FMC->ISPCMD = FMC_ISPCMD_READ_CKS; - FMC->ISPADDR = u32addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_CHKSUM; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - return 0xFFFFFFFF; - } - } - - ret = FMC->ISPDAT; - } - - return ret; -} - - -/** - * @brief Run flash all one verification and get result. - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 512 bytes. - * @retval READ_ALLONE_YES The contents of verified flash area are 0xFFFFFFFF. - * @retval READ_ALLONE_NOT Some contents of verified flash area are not 0xFFFFFFFF. - * @retval READ_ALLONE_CMD_FAIL Unexpected error occurred. - * - * @note Global error code g_FMC_i32ErrCode - * -1 RUN_ALL_ONE or CHECK_ALL_ONE commands time-out - */ -uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret = READ_ALLONE_CMD_FAIL; - int32_t i32TimeOutCnt0, i32TimeOutCnt1; - - g_FMC_i32ErrCode = 0; - - FMC->ISPSTS = 0x80UL; /* clear check all one bit */ - - FMC->ISPCMD = FMC_ISPCMD_RUN_ALL1; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = u32count; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt0 = FMC_TIMEOUT_CHKALLONE; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) - { - if (i32TimeOutCnt0-- <= 0) - { - g_FMC_i32ErrCode = -1; - break; - } - } - - if (g_FMC_i32ErrCode == 0) - { - i32TimeOutCnt1 = FMC_TIMEOUT_CHKALLONE; - do - { - FMC->ISPCMD = FMC_ISPCMD_READ_ALL1; - FMC->ISPADDR = u32addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt0 = FMC_TIMEOUT_CHKALLONE; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) - { - if (i32TimeOutCnt0-- <= 0) - { - g_FMC_i32ErrCode = -1; - break; - } - } - - if (i32TimeOutCnt1-- <= 0) - { - g_FMC_i32ErrCode = -1; - } - } - while ((FMC->ISPDAT == 0UL) && (g_FMC_i32ErrCode == 0)); - } - - if (g_FMC_i32ErrCode == 0) - { - if (FMC->ISPDAT == READ_ALLONE_YES) - ret = READ_ALLONE_YES; - else if (FMC->ISPDAT == READ_ALLONE_NOT) - ret = READ_ALLONE_NOT; - else - g_FMC_i32ErrCode = -1; - } - - return ret; -} - -/** - * @brief Remap Bank0/Bank1 - * - * @param[in] u32Bank Bank Num which will remap to. - * - * @retval 0 Success - * @retval -1 Program failed. - * - * @details Remap Bank0/Bank1 - * - * @note Global error code g_FMC_i32ErrCode - * -1 Program failed or time-out - */ -int32_t FMC_RemapBank(uint32_t u32Bank) -{ - int32_t ret = 0; - int32_t i32TimeOutCnt; - - g_FMC_i32ErrCode = 0; - - FMC->ISPCMD = FMC_ISPCMD_BANK_REMAP; - FMC->ISPADDR = u32Bank; - FMC->ISPDAT = 0x5AA55AA5UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - i32TimeOutCnt = FMC_TIMEOUT_WRITE; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) - { - if (i32TimeOutCnt-- <= 0) - { - g_FMC_i32ErrCode = -1; - ret = -1; - break; - } - } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - g_FMC_i32ErrCode = -1; - ret = -1; - } - return ret; -} - - -/*@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group FMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_gpio.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_gpio.c deleted file mode 100644 index de0d6cf02c5..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_gpio.c +++ /dev/null @@ -1,180 +0,0 @@ -/**************************************************************************//** - * @file gpio.c - * @version V3.00 - * @brief M460 series GPIO driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Set GPIO operation mode - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * @param[in] u32Mode Operation mode. It could be - * - \ref GPIO_MODE_INPUT - * - \ref GPIO_MODE_OUTPUT - * - \ref GPIO_MODE_OPEN_DRAIN - * - \ref GPIO_MODE_QUASI - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t u32Idx; - - for (u32Idx = 0ul; u32Idx < GPIO_PIN_MAX; u32Idx++) - { - if ((u32PinMask & (1ul << u32Idx)) == (1ul << u32Idx)) - { - port->MODE = (port->MODE & ~(0x3ul << (u32Idx << 1))) | (u32Mode << (u32Idx << 1)); - } - } -} - -/** - * @brief Enable GPIO interrupt - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be 0 ~ 14 for PC and PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 6 ~ 15 for PI GPIO port. \n - * It could be 0 ~ 13 for PJ GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be - * - \ref GPIO_INT_RISING - * - \ref GPIO_INT_FALLING - * - \ref GPIO_INT_BOTH_EDGE - * - \ref GPIO_INT_HIGH - * - \ref GPIO_INT_LOW - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs) -{ - /* Configure interrupt mode of specified pin */ - port->INTTYPE = (port->INTTYPE & ~(1ul << u32Pin)) | (((u32IntAttribs >> 24) & 0xFFUL) << u32Pin); - - /* Enable interrupt function of specified pin */ - port->INTEN = (port->INTEN & ~(0x00010001ul << u32Pin)) | ((u32IntAttribs & 0xFFFFFFUL) << u32Pin); -} - - -/** - * @brief Disable GPIO interrupt - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32Pin The pin of specified GPIO port. \n - * It could be 0 ~ 15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be 0 ~ 14 for PC and PD GPIO port. \n - * It could be 0 ~ 11 for PF GPIO port. \n - * It could be 6 ~ 15 for PI GPIO port. \n - * It could be 0 ~ 13 for PJ GPIO port. - * - * @return None - * - * @details This function is used to disable specified GPIO pin interrupt. - */ -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin) -{ - /* Configure interrupt mode of specified pin */ - port->INTTYPE &= ~(1UL << u32Pin); - - /* Disable interrupt function of specified pin */ - port->INTEN &= ~((0x00010001UL) << u32Pin); -} - -/** - * @brief Set GPIO slew rate control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * @param[in] u32Mode Slew rate mode. It could be - * - \ref GPIO_SLEWCTL_NORMAL - * - \ref GPIO_SLEWCTL_HIGH - * - \ref GPIO_SLEWCTL_FAST - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t u32Idx; - - for (u32Idx = 0ul; u32Idx < GPIO_PIN_MAX; u32Idx++) - { - if (u32PinMask & (1ul << u32Idx)) - { - port->SLEWCTL = (port->SLEWCTL & ~(0x3ul << (u32Idx << 1))) | (u32Mode << (u32Idx << 1)); - } - } -} - -/** - * @brief Set GPIO Pull-up and Pull-down control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, \ref PC, \ref PD, \ref PE, \ref PF, \ref PG, \ref PH, \ref PI or \ref PJ. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. \n - * It could be BIT0 ~ BIT15 for PA, PB, PE, PG and PH GPIO port. \n - * It could be BIT0 ~ BIT14 for PC and PD GPIO port. \n - * It could be BIT0 ~ BIT11 for PF GPIO port. \n - * It could be BIT6 ~ BIT15 for PI GPIO port. \n - * It could be BIT0 ~ BIT13 for PJ GPIO port. - * @param[in] u32Mode The pin mode of specified GPIO pin. It could be - * - \ref GPIO_PUSEL_DISABLE - * - \ref GPIO_PUSEL_PULL_UP - * - \ref GPIO_PUSEL_PULL_DOWN - * - * @return None - * - * @details Set the pin mode of specified GPIO pin. - */ -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t u32Idx; - - for (u32Idx = 0ul; u32Idx < GPIO_PIN_MAX; u32Idx++) - { - if (u32PinMask & (1ul << u32Idx)) - { - port->PUSEL = (port->PUSEL & ~(0x3ul << (u32Idx << 1))) | (u32Mode << (u32Idx << 1)); - } - } -} - -/**@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_hbi.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_hbi.c deleted file mode 100644 index 4a4c2297e2a..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_hbi.c +++ /dev/null @@ -1,301 +0,0 @@ -/**************************************************************************//** - * @file hbi.c - * @version V3.00 - * @brief HyperBus Interface (HBI) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HBI_Driver HBI Driver - @{ -*/ - -int32_t g_HBI_i32ErrCode = 0; /*!< HBI global error code */ - -/** @addtogroup HBI_EXPORTED_FUNCTIONS HBI Exported Functions - @{ -*/ - - -/** - * @brief Reset HBI function - * @return None - * @note This function sets g_HBI_i32ErrCode to HBI_TIMEOUT_ERR if waiting Hyper RAM time-out. - */ -void HBI_ResetHyperRAM(void) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->CMD = HBI_CMD_RESET_HRAM; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief Exit from Hybrid sleep and deep Power down function - * @return None - * @note This function sets g_HBI_i32ErrCode to HBI_TIMEOUT_ERR if waiting Hyper RAM time-out. - */ -void HBI_ExitHSAndDPD(void) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->CMD = HBI_CMD_EXIT_HS_PD; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief Read HyperRAM register space - * @param[in] u32Addr Address of HyperRAM register space - * - \ref HYPERRAM_ID_REG0 : 0x0000_0000 = Identification Register 0 - * - \ref HYPERRAM_ID_REG1 : 0x0000_0002 = Identification Register 1 - * - \ref HYPERRAM_CONFIG_REG0 : 0x0000_1000 = Configuration Register 0 - * - \ref HYPERRAM_CONFIG_REG1 : 0x0000_1002 = Configuration Register 1 - * @return The data of HyperRAM register. - * @return -1 An illeagal register space - * @return -2 Wait Hyper RAM time-out - */ -int32_t HBI_ReadHyperRAMReg(uint32_t u32Addr) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - if ((u32Addr == HYPERRAM_ID_REG0) || (u32Addr == HYPERRAM_ID_REG1) || (u32Addr == HYPERRAM_CONFIG_REG0) || (u32Addr == HYPERRAM_CONFIG_REG1)) - { - HBI->ADR = u32Addr; - HBI->CMD = HBI_CMD_READ_HRAM_REGISTER; - - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - return HBI_TIMEOUT_ERR; - } - } - return HBI->RDATA; - } - else - { - return -1; - } -} - -/** - * @brief Write HyperRAM register space - * @param[in] u32Addr Address of HyperRAM register space - * - \ref HYPERRAM_ID_REG0 : 0x0000_0000 = Identification Register 0 - * - \ref HYPERRAM_ID_REG1 : 0x0000_0002 = Identification Register 1 - * - \ref HYPERRAM_CONFIG_REG0 : 0x0000_1000 = Configuration Register 0 - * - \ref HYPERRAM_CONFIG_REG1 : 0x0000_1002 = Configuration Register 1 - * @param[in] - * @return 0 success. - * @return -1 An illeagal register space - * @return -2 Wait Hyper RAM time-out - */ -int32_t HBI_WriteHyperRAMReg(uint32_t u32Addr, uint32_t u32Value) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - if ((u32Addr == HYPERRAM_ID_REG0) || (u32Addr == HYPERRAM_ID_REG1) || (u32Addr == HYPERRAM_CONFIG_REG0) || (u32Addr == HYPERRAM_CONFIG_REG1)) - { - HBI->ADR = u32Addr; - HBI->WDATA = u32Value; - HBI->CMD = HBI_CMD_WRITE_HRAM_REGISTER; - - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - return HBI_TIMEOUT_ERR; - } - } - return 0; - } - else - { - return -1; - } -} - -/** - * @brief Read 1 word from HyperRAM space - * @param[in] u32Addr Address of HyperRAM space - * @return The 16 bit data of HyperRAM space. - * @note This function sets g_HBI_i32ErrCode to HBI_TIMEOUT_ERR if waiting Hyper RAM time-out. - */ -uint32_t HBI_Read1Word(uint32_t u32Addr) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->ADR = u32Addr; - HBI->CMD = HBI_CMD_READ_HRAM_1_WORD; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } - return HBI->RDATA; -} - -/** - * @brief Read 2 word from HyperRAM space - * @param[in] u32Addr Address of HyperRAM space - * @return The 32bit data of HyperRAM space. - */ -uint32_t HBI_Read2Word(uint32_t u32Addr) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->ADR = u32Addr; - HBI->CMD = HBI_CMD_READ_HRAM_2_WORD; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } - return HBI->RDATA; -} - -/** - * @brief Write 1 byte to HyperRAM space - * @param[in] u32Addr Address of HyperRAM space - * @param[in] u8Data 8 bits data to be written to HyperRAM space - * @return None. - * @note This function sets g_HBI_i32ErrCode to HBI_TIMEOUT_ERR if waiting Hyper RAM time-out. - */ -void HBI_Write1Byte(uint32_t u32Addr, uint8_t u8Data) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->ADR = u32Addr; - HBI->WDATA = u8Data; - HBI->CMD = HBI_CMD_WRITE_HRAM_1_BYTE; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief Write 2 bytes to HyperRAM space - * @param[in] u32Addr Address of HyperRAM space - * @param[in] u16Data 16 bits data to be written to HyperRAM space - * @return None. - * @note This function sets g_HBI_i32ErrCode to HBI_TIMEOUT_ERR if waiting Hyper RAM time-out. - */ -void HBI_Write2Byte(uint32_t u32Addr, uint16_t u16Data) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->ADR = u32Addr; - HBI->WDATA = u16Data; - HBI->CMD = HBI_CMD_WRITE_HRAM_2_BYTE; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief Write 3 bytes to HyperRAM space - * @param[in] u32Addr Address of HyperRAM space - * @param[in] u32Data 24 bits data to be written to HyperRAM space - * @return None. - * @note This function sets g_HBI_i32ErrCode to HBI_TIMEOUT_ERR if waiting Hyper RAM time-out. - */ -void HBI_Write3Byte(uint32_t u32Addr, uint32_t u32Data) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->ADR = u32Addr; - HBI->WDATA = u32Data; - HBI->CMD = HBI_CMD_WRITE_HRAM_3_BYTE; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief Write 4 byte to HyperRAM space - * @param[in] u32Addr Address of HyperRAM space - * @param[in] u32Data 32 bits data to be written to HyperRAM space - * @return None. - * @note This function sets g_HBI_i32ErrCode to HBI_TIMEOUT_ERR if waiting Hyper RAM time-out. - */ -void HBI_Write4Byte(uint32_t u32Addr, uint32_t u32Data) -{ - int32_t i32TimeOutCnt = HBI_TIMEOUT; - - HBI->ADR = u32Addr; - HBI->WDATA = u32Data; - HBI->CMD = HBI_CMD_WRITE_HRAM_4_BYTE; - - g_HBI_i32ErrCode = 0; - while (HBI->CMD != HBI_CMD_HRAM_IDLE) - { - if (i32TimeOutCnt-- <= 0) - { - g_HBI_i32ErrCode = HBI_TIMEOUT_ERR; - break; - } - } -} - - -/*@}*/ /* end of group HBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_hsusbd.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_hsusbd.c deleted file mode 100644 index 03518101988..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_hsusbd.c +++ /dev/null @@ -1,741 +0,0 @@ -/**************************************************************************//** - * @file hsusbd.c - * @version V3.00 - * @brief M460 series HSUSBD driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HSUSBD_Driver HSUSBD Driver - @{ -*/ - -/** @addtogroup HSUSBD_EXPORTED_FUNCTIONS HSUSBD Exported Functions - @{ -*/ -/*--------------------------------------------------------------------------*/ -/** @cond HIDDEN_SYMBOLS */ -/* Global variables for Control Pipe */ -S_HSUSBD_CMD_T gUsbCmd; -S_HSUSBD_INFO_T *g_hsusbd_sInfo; - -HSUSBD_VENDOR_REQ g_hsusbd_pfnVendorRequest = NULL; -HSUSBD_CLASS_REQ g_hsusbd_pfnClassRequest = NULL; -HSUSBD_SET_INTERFACE_REQ g_hsusbd_pfnSetInterface = NULL; -uint32_t g_u32HsEpStallLock = 0ul; /* Bit map flag to lock specified EP when SET_FEATURE */ - -static uint8_t *g_hsusbd_CtrlInPointer = 0; -static uint32_t g_hsusbd_CtrlMaxPktSize = 64ul; -static uint8_t g_hsusbd_UsbConfig = 0ul; -static uint8_t g_hsusbd_UsbAltInterface = 0ul; -static uint8_t g_hsusbd_EnableTestMode = 0ul; -static uint8_t g_hsusbd_TestSelector = 0ul; - -static uint8_t g_hsusbd_buf[12]; - -uint8_t volatile g_hsusbd_Configured = 0ul; -uint8_t g_hsusbd_CtrlZero = 0ul; -uint8_t g_hsusbd_UsbAddr = 0ul; -uint8_t g_hsusbd_ShortPacket = 0ul; -uint32_t volatile g_hsusbd_DmaDone = 0ul; -uint32_t g_hsusbd_CtrlInSize = 0ul; - -int32_t g_HSUSBD_i32ErrCode = 0; /*!< HSUSBD global error code */ -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief HSUSBD Initial - * - * @param[in] param Descriptor - * @param[in] pfnClassReq Class Request Callback Function - * @param[in] pfnSetInterface SetInterface Request Callback Function - * - * @return None - * - * @details This function is used to initial HSUSBD. - * - * @note This function sets g_HSUSBD_i32ErrCode to HSUSBD_TIMEOUT_ERR if waiting HSUSBD time-out. - */ -void HSUSBD_Open(S_HSUSBD_INFO_T *param, HSUSBD_CLASS_REQ pfnClassReq, HSUSBD_SET_INTERFACE_REQ pfnSetInterface) -{ - int32_t i32TimeOutCnt = HSUSBD_TIMEOUT; - - g_HSUSBD_i32ErrCode = 0; - - g_hsusbd_sInfo = param; - g_hsusbd_pfnClassRequest = pfnClassReq; - g_hsusbd_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - g_hsusbd_CtrlMaxPktSize = g_hsusbd_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ - HSUSBD_ENABLE_PHY(); - - /* wait PHY clock ready */ - while (!(HSUSBD->PHYCTL & HSUSBD_PHYCTL_PHYCLKSTB_Msk)) - { - if (i32TimeOutCnt-- < 0) - { - g_HSUSBD_i32ErrCode = HSUSBD_TIMEOUT_ERR; - break; - } - } - HSUSBD->OPER &= ~HSUSBD_OPER_HISPDEN_Msk; /* full-speed */ -} - -/** - * @brief HSUSBD Start - * - * @param[in] None - * - * @return None - * - * @details This function is used to start transfer - */ -void HSUSBD_Start(void) -{ - HSUSBD->OPER = HSUSBD_OPER_HISPDEN_Msk; /* high-speed */ - HSUSBD_CLR_SE0(); -} - -/** - * @brief Process Setup Packet - * - * @param[in] None - * - * @return None - * - * @details This function is used to process Setup packet. - */ -void HSUSBD_ProcessSetupPacket(void) -{ - /* Setup packet process */ - gUsbCmd.bmRequestType = (uint8_t)(HSUSBD->SETUP1_0 & 0xfful); - gUsbCmd.bRequest = (uint8_t)((HSUSBD->SETUP1_0 >> 8) & 0xfful); - gUsbCmd.wValue = (uint16_t)HSUSBD->SETUP3_2; - gUsbCmd.wIndex = (uint16_t)HSUSBD->SETUP5_4; - gUsbCmd.wLength = (uint16_t)HSUSBD->SETUP7_6; - - /* USB device request in setup packet: offset 0, D[6..5]: 0=Standard, 1=Class, 2=Vendor, 3=Reserved */ - switch (gUsbCmd.bmRequestType & 0x60ul) - { - case REQ_STANDARD: - { - HSUSBD_StandardRequest(); - break; - } - case REQ_CLASS: - { - if (g_hsusbd_pfnClassRequest != NULL) - { - g_hsusbd_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: - { - if (g_hsusbd_pfnVendorRequest != NULL) - { - g_hsusbd_pfnVendorRequest(); - } - break; - } - default: - { - /* Setup error, stall the device */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - break; - } - } -} - -/** - * @brief Get Descriptor request - * - * @param[in] None - * - * @return None - * - * @details This function is used to process GetDescriptor request. - */ -int HSUSBD_GetDescriptor(void) -{ - uint32_t u32Len; - int val = 0; - - u32Len = gUsbCmd.wLength; - g_hsusbd_CtrlZero = (uint8_t)0ul; - - switch ((gUsbCmd.wValue & 0xff00ul) >> 8) - { - /* Get Device Descriptor */ - case DESC_DEVICE: - { - u32Len = Minimum(u32Len, LEN_DEVICE); - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8DevDesc, u32Len); - break; - } - /* Get Configuration Descriptor */ - case DESC_CONFIG: - { - uint32_t u32TotalLen; - if ((HSUSBD->OPER & 0x04ul) == 0x04ul) - { - u32TotalLen = g_hsusbd_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8ConfigDesc, u32Len); - } - else - { - u32TotalLen = g_hsusbd_sInfo->gu8FullConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8FullConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8FullConfigDesc, u32Len); - } - - break; - } - /* Get BOS Descriptor */ - case DESC_BOS: - { - if (g_hsusbd_sInfo->gu8BosDesc == 0) - { - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - } - else - { - u32Len = Minimum(u32Len, LEN_BOS + LEN_BOSCAP); - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8BosDesc, u32Len); - } - break; - } - /* Get Qualifier Descriptor */ - case DESC_QUALIFIER: - { - u32Len = Minimum(u32Len, LEN_QUALIFIER); - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8QualDesc, u32Len); - break; - } - /* Get Other Speed Descriptor - Full speed */ - case DESC_OTHERSPEED: - { - uint32_t u32TotalLen; - if ((HSUSBD->OPER & 0x04ul) == 0x04ul) - { - u32TotalLen = g_hsusbd_sInfo->gu8HSOtherConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8HSOtherConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8HSOtherConfigDesc, u32Len); - } - else - { - u32TotalLen = g_hsusbd_sInfo->gu8FSOtherConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8FSOtherConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8FSOtherConfigDesc, u32Len); - } - - break; - } - /* Get HID Descriptor */ - case DESC_HID: - { - uint32_t u32ConfigDescOffset; /* u32ConfigDescOffset is configuration descriptor offset (HID descriptor start index) */ - u32Len = Minimum(u32Len, LEN_HID); - u32ConfigDescOffset = g_hsusbd_sInfo->gu32ConfigHidDescIdx[gUsbCmd.wIndex & 0xfful]; - HSUSBD_PrepareCtrlIn((uint8_t *)&g_hsusbd_sInfo->gu8ConfigDesc[u32ConfigDescOffset], u32Len); - break; - } - /* Get Report Descriptor */ - case DESC_HID_RPT: - { - if (u32Len > g_hsusbd_sInfo->gu32HidReportSize[gUsbCmd.wIndex & 0xfful]) - { - u32Len = g_hsusbd_sInfo->gu32HidReportSize[gUsbCmd.wIndex & 0xfful]; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8HidReportDesc[gUsbCmd.wIndex & 0xfful], u32Len); - break; - } - /* Get String Descriptor */ - case DESC_STRING: - { - if ((gUsbCmd.wValue & 0xfful) < 8ul) - { - if (u32Len > g_hsusbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful][0]) - { - u32Len = g_hsusbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful][0]; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful], u32Len); - } - else - { - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - val = 1; - } - break; - } - default: - /* Not support. Reply STALL. */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - val = 1; - break; - } - return val; -} - - -/** - * @brief Process USB standard request - * - * @param[in] None - * - * @return None - * - * @details This function is used to process USB Standard Request. - */ -void HSUSBD_StandardRequest(void) -{ - /* clear global variables for new request */ - g_hsusbd_CtrlInPointer = 0; - g_hsusbd_CtrlInSize = 0ul; - - if ((gUsbCmd.bmRequestType & 0x80ul) == 0x80ul) /* request data transfer direction */ - { - /* Device to host */ - switch (gUsbCmd.bRequest) - { - case GET_CONFIGURATION: - { - /* Return current configuration setting */ - HSUSBD_PrepareCtrlIn((uint8_t *)&g_hsusbd_UsbConfig, 1ul); - - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_DESCRIPTOR: - { - if (!HSUSBD_GetDescriptor()) - { - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - } - break; - } - case GET_INTERFACE: - { - /* Return current interface setting */ - HSUSBD_PrepareCtrlIn((uint8_t *)&g_hsusbd_UsbAltInterface, 1ul); - - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_STATUS: - { - /* Device */ - if (gUsbCmd.bmRequestType == 0x80ul) - { - if ((g_hsusbd_sInfo->gu8ConfigDesc[7] & 0x40ul) == 0x40ul) - { - g_hsusbd_buf[0] = (uint8_t)1ul; /* Self-Powered */ - } - else - { - g_hsusbd_buf[0] = (uint8_t)0ul; /* bus-Powered */ - } - } - /* Interface */ - else if (gUsbCmd.bmRequestType == 0x81ul) - { - g_hsusbd_buf[0] = (uint8_t)0ul; - } - /* Endpoint */ - else if (gUsbCmd.bmRequestType == 0x82ul) - { - uint8_t ep = (uint8_t)(gUsbCmd.wIndex & 0xFul); - g_hsusbd_buf[0] = (uint8_t)HSUSBD_GetStall((uint32_t)ep) ? (uint8_t)1 : (uint8_t)0; - } - g_hsusbd_buf[1] = (uint8_t)0ul; - HSUSBD_PrepareCtrlIn(g_hsusbd_buf, 2ul); - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - break; - } - } - } - else - { - /* Host to device */ - switch (gUsbCmd.bRequest) - { - case CLEAR_FEATURE: - { - if ((gUsbCmd.wValue & 0xfful) == FEATURE_ENDPOINT_HALT) - { - - uint32_t epNum, i; - - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_u32HsEpStallLock is added to support it */ - epNum = (uint32_t)(gUsbCmd.wIndex & 0xFul); - for (i = 0ul; i < HSUSBD_MAX_EP; i++) - { - if ((((HSUSBD->EP[i].EPCFG & 0xf0ul) >> 4) == epNum) && ((g_u32HsEpStallLock & (1ul << i)) == 0ul)) - { - HSUSBD->EP[i].EPRSPCTL = (HSUSBD->EP[i].EPRSPCTL & 0xeful) | HSUSBD_EP_RSPCTL_TOGGLE; - } - } - } - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_ADDRESS: - { - g_hsusbd_UsbAddr = (uint8_t)gUsbCmd.wValue; - /* Status Stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_CONFIGURATION: - { - g_hsusbd_UsbConfig = (uint8_t)gUsbCmd.wValue; - g_hsusbd_Configured = (uint8_t)1ul; - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_FEATURE: - { - if ((gUsbCmd.wValue & 0x3ul) == 2ul) /* TEST_MODE */ - { - g_hsusbd_EnableTestMode = (uint8_t)1ul; - g_hsusbd_TestSelector = (uint8_t)(gUsbCmd.wIndex >> 8); - } - if ((gUsbCmd.wValue & 0x3ul) == 3ul) /* HNP ebable */ - { - HSOTG->CTL |= (HSOTG_CTL_HNPREQEN_Msk | HSOTG_CTL_BUSREQ_Msk); - } - - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_INTERFACE: - { - g_hsusbd_UsbAltInterface = (uint8_t)gUsbCmd.wValue; - if (g_hsusbd_pfnSetInterface != NULL) - { - g_hsusbd_pfnSetInterface((uint32_t)g_hsusbd_UsbAltInterface); - } - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - break; - } - } - } -} - -/** - * @brief Update Device State - * - * @param[in] None - * - * @return None - * - * @details This function is used to update Device state when Setup packet complete - */ -/** @cond HIDDEN_SYMBOLS */ -#define TEST_J 0x01ul -#define TEST_K 0x02ul -#define TEST_SE0_NAK 0x03ul -#define TEST_PACKET 0x04ul -#define TEST_FORCE_ENABLE 0x05ul -/** @endcond HIDDEN_SYMBOLS */ - -void HSUSBD_UpdateDeviceState(void) -{ - switch (gUsbCmd.bRequest) - { - case SET_ADDRESS: - { - HSUSBD_SET_ADDR(g_hsusbd_UsbAddr); - break; - } - case SET_CONFIGURATION: - { - if (g_hsusbd_UsbConfig == 0ul) - { - uint32_t volatile i; - /* Reset PID DATA0 */ - for (i = 0ul; i < HSUSBD_MAX_EP; i++) - { - if ((HSUSBD->EP[i].EPCFG & 0x1ul) == 0x1ul) - { - HSUSBD->EP[i].EPRSPCTL = HSUSBD_EP_RSPCTL_TOGGLE; - } - } - } - break; - } - case SET_FEATURE: - { - if (gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - { - uint32_t idx; - idx = (uint32_t)(gUsbCmd.wIndex & 0xFul); - HSUSBD_SetStall(idx); - } - else if (g_hsusbd_EnableTestMode) - { - g_hsusbd_EnableTestMode = (uint8_t)0ul; - if (g_hsusbd_TestSelector == TEST_J) - { - HSUSBD->TEST = TEST_J; - } - else if (g_hsusbd_TestSelector == TEST_K) - { - HSUSBD->TEST = TEST_K; - } - else if (g_hsusbd_TestSelector == TEST_SE0_NAK) - { - HSUSBD->TEST = TEST_SE0_NAK; - } - else if (g_hsusbd_TestSelector == TEST_PACKET) - { - HSUSBD->TEST = TEST_PACKET; - } - else if (g_hsusbd_TestSelector == TEST_FORCE_ENABLE) - { - HSUSBD->TEST = TEST_FORCE_ENABLE; - } - } - break; - } - case CLEAR_FEATURE: - { - if (gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - { - uint32_t idx; - idx = (uint32_t)(gUsbCmd.wIndex & 0xFul); - HSUSBD_ClearStall(idx); - } - break; - } - default: - break; - } -} - - -/** - * @brief Prepare Control IN transaction - * - * @param[in] pu8Buf Control IN data pointer - * @param[in] u32Size IN transfer size - * - * @return None - * - * @details This function is used to prepare Control IN transfer - */ -void HSUSBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size) -{ - g_hsusbd_CtrlInPointer = pu8Buf; - g_hsusbd_CtrlInSize = u32Size; -} - - - -/** - * @brief Start Control IN transfer - * - * @param[in] None - * - * @return None - * - * @details This function is used to start Control IN - */ -void HSUSBD_CtrlIn(void) -{ - uint32_t volatile i, cnt; - uint8_t u8Value; - if (g_hsusbd_CtrlInSize >= g_hsusbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - cnt = g_hsusbd_CtrlMaxPktSize >> 2; - for (i = 0ul; i < cnt; i++) - { - HSUSBD->CEPDAT = *(uint32_t *)g_hsusbd_CtrlInPointer; - g_hsusbd_CtrlInPointer = (uint8_t *)(g_hsusbd_CtrlInPointer + 4ul); - } - HSUSBD_START_CEP_IN(g_hsusbd_CtrlMaxPktSize); - g_hsusbd_CtrlInSize -= g_hsusbd_CtrlMaxPktSize; - } - else - { - /* Data size <= MXPLD */ - cnt = g_hsusbd_CtrlInSize; - for (i = 0ul; i < cnt; i++) - { - u8Value = *(uint8_t *)(g_hsusbd_CtrlInPointer + i); - outpb(&HSUSBD->CEPDAT, u8Value); - } - - HSUSBD_START_CEP_IN(g_hsusbd_CtrlInSize); - g_hsusbd_CtrlInPointer = 0; - g_hsusbd_CtrlInSize = 0ul; - } -} - -/** - * @brief Start Control OUT transaction - * - * @param[in] pu8Buf Control OUT data pointer - * @param[in] u32Size OUT transfer size - * - * @return None - * - * @details This function is used to start Control OUT transfer - * - * @note This function sets g_HSUSBD_i32ErrCode to HSUSBD_TIMEOUT_ERR if waiting HSUSBD time-out. - */ -void HSUSBD_CtrlOut(uint8_t pu8Buf[], uint32_t u32Size) -{ - uint32_t volatile i; - int32_t i32TimeOutCnt = HSUSBD_TIMEOUT; - - g_HSUSBD_i32ErrCode = 0; - - while (1) - { - if ((HSUSBD->CEPINTSTS & HSUSBD_CEPINTSTS_RXPKIF_Msk) == HSUSBD_CEPINTSTS_RXPKIF_Msk) - { - for (i = 0ul; i < u32Size; i++) - { - pu8Buf[i] = inpb(&HSUSBD->CEPDAT); - } - HSUSBD->CEPINTSTS = HSUSBD_CEPINTSTS_RXPKIF_Msk; - break; - } - - if (i32TimeOutCnt-- < 0) - { - g_HSUSBD_i32ErrCode = HSUSBD_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief Clear all software flags - * - * @param[in] None - * - * @return None - * - * @details This function is used to clear all software control flag - */ -void HSUSBD_SwReset(void) -{ - /* Reset all variables for protocol */ - g_hsusbd_UsbAddr = (uint8_t)0ul; - g_hsusbd_DmaDone = 0ul; - g_hsusbd_ShortPacket = (uint8_t)0ul; - g_hsusbd_Configured = (uint8_t)0ul; - - /* Reset USB device address */ - HSUSBD_SET_ADDR(0ul); -} - -/** - * @brief HSUSBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set HSUSBD vendor request callback function - */ -void HSUSBD_SetVendorRequest(HSUSBD_VENDOR_REQ pfnVendorReq) -{ - g_hsusbd_pfnVendorRequest = pfnVendorReq; -} - - -/*@}*/ /* end of group HSUSBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HSUSBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2c.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2c.c deleted file mode 100644 index c47b59d7419..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2c.c +++ /dev/null @@ -1,1661 +0,0 @@ -/**************************************************************************//** - * @file i2c.c - * @version V3.00 - * @brief M460 series I2C driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - -int32_t g_I2C_i32ErrCode = 0; /*!< I2C global error code */ - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ - -/** - * @brief Enable specify I2C Controller and set Clock Divider - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C bus clock in Hz - * - * @return Actual I2C bus clock frequency - * - * @details The function enable the specify I2C Controller and set proper Clock Divider - * in I2C CLOCK DIVIDED REGISTER (I2CLK) according to the target I2C Bus clock. - * I2C Bus clock = PCLK / (4*(divider+1). - * - */ -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if ((i2c == I2C1) || (i2c == I2C3)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - /* Enable I2C */ - i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Disable specify I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Reset I2C Controller and disable specify I2C port. - * - */ - -void I2C_Close(I2C_T *i2c) -{ - /* Reset I2C Controller */ - if ((uint32_t)i2c == I2C0_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C0RST_Msk; - } - else if ((uint32_t)i2c == I2C1_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C1RST_Msk; - } - else if ((uint32_t)i2c == I2C2_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C2RST_Msk; - } - else if ((uint32_t)i2c == I2C3_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C3RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C3RST_Msk; - } - else if ((uint32_t)i2c == I2C4_BASE) - { - SYS->IPRST1 |= SYS_IPRST2_I2C4RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST2_I2C4RST_Msk; - } - /* Disable I2C */ - i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; -} - -/** - * @brief Clear Time-out Counter flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When Time-out flag will be set, use this function to clear I2C Bus Time-out counter flag . - * - */ -void I2C_ClearTimeoutFlag(I2C_T *i2c) -{ - i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; -} - -/** - * @brief Set Control bit of I2C Controller - * - * @param[in] i2c Specify I2C port - * @param[in] u8Start Set I2C START condition - * @param[in] u8Stop Set I2C STOP condition - * @param[in] u8Si Clear SI flag - * @param[in] u8Ack Set I2C ACK bit - * - * @return None - * - * @details The function set I2C Control bit of I2C Bus protocol. - * - */ -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - - if (u8Start) - { - u32Reg |= I2C_CTL_STA; - } - - if (u8Stop) - { - u32Reg |= I2C_CTL_STO; - } - - if (u8Si) - { - u32Reg |= I2C_CTL_SI; - } - - if (u8Ack) - { - u32Reg |= I2C_CTL_AA; - } - - i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; -} - -/** - * @brief Disable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for disable I2C interrupt - * - */ -void I2C_DisableInt(I2C_T *i2c) -{ - i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Enable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for enable I2C interrupt - * - */ -void I2C_EnableInt(I2C_T *i2c) -{ - i2c->CTL0 |= I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Get I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * - * @return The actual I2C Bus clock in Hz - * - * @details To get the actual I2C Bus Clock frequency. - */ -uint32_t I2C_GetBusClockFreq(I2C_T *i2c) -{ - uint32_t u32Divider = i2c->CLKDIV; - uint32_t u32Pclk; - - if ((i2c == I2C1) || (i2c == I2C3)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - return (u32Pclk / ((u32Divider + 1U) << 2U)); -} - -/** - * @brief Set I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C Bus Clock in Hz - * - * @return The actual I2C Bus Clock in Hz - * - * @details To set the actual I2C Bus Clock frequency. - */ -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if ((i2c == I2C1) || (i2c == I2C3)) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Get Interrupt Flag - * - * @param[in] i2c Specify I2C port - * - * @return I2C interrupt flag status - * - * @details To get I2C Bus interrupt flag. - */ -uint32_t I2C_GetIntFlag(I2C_T *i2c) -{ - uint32_t u32Value; - - if ((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk) - { - u32Value = 1U; - } - else - { - u32Value = 0U; - } - - return u32Value; -} - -/** - * @brief Get I2C Bus Status Code - * - * @param[in] i2c Specify I2C port - * - * @return I2C Status Code - * - * @details To get I2C Bus Status Code. - */ -uint32_t I2C_GetStatus(I2C_T *i2c) -{ - return (i2c->STATUS0); -} - -/** - * @brief Read a Byte from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return I2C Data - * - * @details To read a bytes data from specify I2C port. - */ -uint8_t I2C_GetData(I2C_T *i2c) -{ - return (uint8_t)(i2c->DAT); -} - -/** - * @brief Send a byte to I2C Bus - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data The data to send to I2C bus - * - * @return None - * - * @details This function is used to write a byte to specified I2C port - */ -void I2C_SetData(I2C_T *i2c, uint8_t u8Data) -{ - i2c->DAT = u8Data; -} - -/** - * @brief Set 7-bit Slave Address and GC Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address register (0~3) - * @param[in] u8SlaveAddr 7-bit slave address - * @param[in] u8GCMode Enable/Disable GC mode (I2C_GCMODE_ENABLE / I2C_GCMODE_DISABLE) - * - * @return None - * - * @details This function is used to set 7-bit slave addresses in I2C SLAVE ADDRESS REGISTER (I2CADDR0~3) - * and enable GC Mode. - * - */ -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDR1 = ((uint32_t)u16SlaveAddr << 1U) | u8GCMode; - break; - case 2: - i2c->ADDR2 = ((uint32_t)u16SlaveAddr << 1U) | u8GCMode; - break; - case 3: - i2c->ADDR3 = ((uint32_t)u16SlaveAddr << 1U) | u8GCMode; - break; - case 0: - default: - i2c->ADDR0 = ((uint32_t)u16SlaveAddr << 1U) | u8GCMode; - break; - } -} - -/** - * @brief Configure the mask bits of 7-bit Slave Address - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address mask register (0~3) - * @param[in] u8SlaveAddrMask A byte for slave address mask - * - * @return None - * - * @details This function is used to set 7-bit slave addresses. - * - */ -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDRMSK1 = (uint32_t)u16SlaveAddrMask << 1U; - break; - case 2: - i2c->ADDRMSK2 = (uint32_t)u16SlaveAddrMask << 1U; - break; - case 3: - i2c->ADDRMSK3 = (uint32_t)u16SlaveAddrMask << 1U; - break; - case 0: - default: - i2c->ADDRMSK0 = (uint32_t)u16SlaveAddrMask << 1U; - break; - } -} - -/** - * @brief Enable Time-out Counter Function and support Long Time-out - * - * @param[in] i2c Specify I2C port - * @param[in] u8LongTimeout Configure DIV4 to enable Long Time-out (0/1) - * - * @return None - * - * @details This function enable Time-out Counter function and configure DIV4 to support Long - * Time-out. - * - */ -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) -{ - if (u8LongTimeout) - { - i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; - } - else - { - i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; - } - - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Disable Time-out Counter Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Time-out Counter function in I2CTOC register. - * - */ -void I2C_DisableTimeout(I2C_T *i2c) -{ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Enable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To enable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_EnableWakeup(I2C_T *i2c) -{ - i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_DisableWakeup(I2C_T *i2c) -{ - i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * - */ -uint32_t I2C_SMBusGetStatus(I2C_T *i2c) -{ - return (i2c->BUSSTS); -} - -/** - * @brief Clear SMBus Interrupt Flag - * - * @param[in] i2c Specify I2C port - * @param[in] u8SMBusIntFlag Specify SMBus interrupt flag - * - * @return None - * - * @details To clear flags of I2C_BUSSTS status register if interrupt set. - * - */ -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag) -{ - i2c->BUSSTS = u8SMBusIntFlag; -} - -/** - * @brief Set SMBus Bytes Counts of Transmission or Reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * - */ -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize) -{ - i2c->PKTSIZE = u32PktSize; -} - -/** - * @brief Init SMBus Host/Device Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8HostDevice Init SMBus port mode(I2C_SMBH_ENABLE(1)/I2C_SMBD_ENABLE(0)) - * - * @return None - * - * @details Using SMBus communication must specify the port is a Host or a Device. - * - */ -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice) -{ - /* Clear BMHEN, BMDEN of BUSCTL Register */ - i2c->BUSCTL &= ~(I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BMDEN_Msk); - - /* Set SMBus Host/Device Mode, and enable Bus Management*/ - if (u8HostDevice == (uint8_t)I2C_SMBH_ENABLE) - { - i2c->BUSCTL |= (I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } - else - { - i2c->BUSCTL |= (I2C_BUSCTL_BMDEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } -} - -/** - * @brief Disable SMBus function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable all SMBus function include Bus disable, CRC check, Acknowledge by manual, Host/Device Mode. - * - */ -void I2C_SMBusClose(I2C_T *i2c) -{ - - i2c->BUSCTL = 0x00U; -} - -/** - * @brief Enable SMBus PEC Transmit Function - * - * @param[in] i2c Specify I2C port - * @param[in] u8PECTxEn CRC transmit enable(PECTX_ENABLE) or disable(PECTX_DISABLE) - * - * @return None - * - * @details When enable CRC check function, the Host or Device needs to transmit CRC byte. - * - */ -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn) -{ - i2c->BUSCTL &= ~I2C_BUSCTL_PECTXEN_Msk; - - if (u8PECTxEn) - { - i2c->BUSCTL |= (I2C_BUSCTL_PECEN_Msk | I2C_BUSCTL_PECTXEN_Msk); - } - else - { - i2c->BUSCTL |= I2C_BUSCTL_PECEN_Msk; - } -} - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return A byte is packet error check value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * - */ -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c) -{ - return (uint8_t)i2c->PKTCRC; -} - -/** - * @brief Calculate Time-out of SMBus idle period - * - * @param[in] i2c Specify I2C port - * @param[in] us Time-out length(us) - * @param[in] u32Hclk I2C peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Idle state. - * - */ - -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk) -{ - uint32_t u32Div, u32Hclk_kHz; - - i2c->BUSCTL |= I2C_BUSCTL_TIDLE_Msk; - u32Hclk_kHz = u32Hclk / 1000U; - u32Div = (((us * u32Hclk_kHz) / 1000U) >> 2U) - 1U; - if (u32Div > 255U) - { - i2c->BUSTOUT = 0xFFU; - } - else - { - i2c->BUSTOUT = u32Div; - } - -} - -/** - * @brief Calculate Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in active state. - * Time-out length is calculate the SCL line "one clock" pull low timing. - * - */ - -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if (u32Div <= 0xFFU) - { - i2c->BUSTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->BUSTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - -/** - * @brief Calculate Cumulative Clock low Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Active state. - * Time-out length is calculate the SCL line "clocks" low cumulative timing. - * - */ - -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if (u32Div <= 0xFFU) - { - i2c->CLKTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->CLKTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - - -/** - * @brief Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master write a byte data to Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ - -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master write multi bytes data to Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ - -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u, u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - case 0x28u: - if (u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify a address that data write to in Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ - -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u, u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Send Slave address with write bit */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u32txLen < 1u) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data bytes write to in Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ - -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u, u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify two bytes address that data write to in Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ - -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u, u32TimeOutCount = 0U; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if ((u32txLen < 1u) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] data[] A data array for write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data write to in Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ - -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u, u32TimeOutCount = 0U; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if ((u32txLen < u32wLen) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master to read a byte data from Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - uint32_t u32TimeOutCount = 0U; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master to read multi data bytes from Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u, u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify a byte address that a data byte read from Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - uint32_t u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify a byte address that multi data bytes read from Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u, u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify an address(2 bytes) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify two bytes address that a data byte read from Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify two bytes address that multi data bytes read from Slave. - * - * @note This function sets g_I2C_i32ErrCode to I2C_TIMEOUT_ERR if waiting I2C time-out. - * - */ -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u, u32TimeOutCount = 0u; - - g_I2C_i32ErrCode = 0; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = I2C_TIMEOUT; - I2C_WAIT_READY(i2c) - { - if (--u32TimeOutCount == 0) - { - g_I2C_i32ErrCode = I2C_TIMEOUT_ERR; - u8Err = 1u; - break; - } - } - - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2s.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2s.c deleted file mode 100644 index 8856e58060a..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_i2s.c +++ /dev/null @@ -1,301 +0,0 @@ -/**************************************************************************//** - * @file i2s.c - * @version V3.00 - * @brief M460 series I2S driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s); - -/** - * @brief This function is used to get I2S source clock frequency. - * @param[in] i2s is the base address of I2S module. - * @return I2S source clock frequency (Hz). - */ -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s) -{ - uint32_t u32Freq = 0UL, u32ClkSrcSel; - - if (i2s == I2S0) - { - /* get I2S selection clock source */ - u32ClkSrcSel = CLK->CLKSEL3 & CLK_CLKSEL3_I2S0SEL_Msk; - - switch (u32ClkSrcSel) - { - case CLK_CLKSEL3_I2S0SEL_HXT: - u32Freq = __HXT; - break; - - case CLK_CLKSEL3_I2S0SEL_PLL_DIV2: - u32Freq = (CLK_GetPLLClockFreq() >> 1); - break; - - case CLK_CLKSEL3_I2S0SEL_PCLK0: - u32Freq = CLK_GetPCLK0Freq(); - break; - - case CLK_CLKSEL3_I2S0SEL_HIRC: - u32Freq = __HIRC; - break; - - case CLK_CLKSEL3_I2S0SEL_HIRC48M: - u32Freq = __HIRC48M; - break; - - case CLK_CLKSEL3_I2S0SEL_PLLFN_DIV2: - u32Freq = (CLK_GetPLLFNClockFreq() >> 1); - break; - - default: - u32Freq = __HXT; - break; - } - } - else if (i2s == I2S1) - { - /* get I2S selection clock source */ - u32ClkSrcSel = CLK->CLKSEL2 & CLK_CLKSEL2_I2S1SEL_Msk; - - switch (u32ClkSrcSel) - { - case CLK_CLKSEL2_I2S1SEL_HXT: - u32Freq = __HXT; - break; - - case CLK_CLKSEL2_I2S1SEL_PLL_DIV2: - u32Freq = (CLK_GetPLLClockFreq() >> 1); - break; - - case CLK_CLKSEL2_I2S1SEL_PCLK1: - u32Freq = CLK_GetPCLK1Freq(); - break; - - case CLK_CLKSEL2_I2S1SEL_HIRC: - u32Freq = __HIRC; - break; - - case CLK_CLKSEL2_I2S1SEL_HIRC48M: - u32Freq = __HIRC48M; - break; - - case CLK_CLKSEL2_I2S1SEL_PLLFN_DIV2: - u32Freq = (CLK_GetPLLFNClockFreq() >> 1); - break; - - default: - u32Freq = __HXT; - break; - } - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * The sample rate may not be used from the parameter, it depends on system's clock settings, - * but real sample rate used by system will be returned for reference. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are: - * - \ref I2S_MODE_MASTER - * - \ref I2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are: - * - \ref I2S_DATABIT_8 - * - \ref I2S_DATABIT_16 - * - \ref I2S_DATABIT_24 - * - \ref I2S_DATABIT_32 - * @param[in] u32MonoData: Set audio data to mono or not. Valid values are: - * - \ref I2S_ENABLE_MONO - * - \ref I2S_DISABLE_MONO - * @param[in] u32DataFormat: Data format. This is also used to select I2S or PCM(TDM) function. Valid values are: - * - \ref I2S_FORMAT_I2S - * - \ref I2S_FORMAT_I2S_MSB - * - \ref I2S_FORMAT_I2S_LSB - * - \ref I2S_FORMAT_PCM - * - \ref I2S_FORMAT_PCM_MSB - * - \ref I2S_FORMAT_PCM_LSB - * @return Real sample rate. - */ -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat) -{ - uint16_t u16Divider; - uint32_t u32BitRate, u32SrcClk; - - if (i2s == I2S0) - { - SYS->IPRST1 |= SYS_IPRST1_I2S0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2S0RST_Msk; - } - else if (i2s == I2S1) - { - SYS->IPRST2 |= SYS_IPRST2_I2S1RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_I2S1RST_Msk; - } - - i2s->CTL0 = u32MasterSlave | u32WordWidth | u32MonoData | u32DataFormat; - i2s->CTL1 = I2S_FIFO_TX_LEVEL_WORD_8 | I2S_FIFO_RX_LEVEL_WORD_8; - - u32SrcClk = I2S_GetSourceClockFreq(i2s); - - u32BitRate = u32SampleRate * (((u32WordWidth >> 4U) & 0x3U) + 1U) * 16U; - u16Divider = (uint16_t)((((u32SrcClk * 10UL / u32BitRate) >> 1U) + 5UL) / 10UL) - 1U; /* Round to the nearest integer */ - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_BCLKDIV_Msk) | ((uint32_t)u16Divider << 8U); - - /* Calculate real sample rate */ - u32BitRate = u32SrcClk / (2U * ((uint32_t)u16Divider + 1U)); - u32SampleRate = u32BitRate / ((((u32WordWidth >> 4U) & 0x3U) + 1U) * 16U); - - i2s->CTL0 |= I2S_CTL0_I2SEN_Msk; - - return u32SampleRate; -} - -/** - * @brief Disable I2S function and I2S clock. - * @param[in] i2s is the base address of I2S module. - * @return none - */ -void I2S_Close(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_I2SEN_Msk; -} - -/** - * @brief This function enables the interrupt according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return none - */ -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN |= u32Mask; -} - -/** - * @brief This function disables the interrupt according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return none - */ -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN &= ~u32Mask; -} - -/** - * @brief Enable MCLK . - * @param[in] i2s is the base address of I2S module. - * @param[in] u32BusClock is the target MCLK clock - * @return Actual MCLK clock - */ -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock) -{ - uint8_t u8Divider; - uint32_t u32SrcClk, u32Reg, u32Clock; - - u32SrcClk = I2S_GetSourceClockFreq(i2s); - if (u32BusClock == u32SrcClk) - { - u8Divider = 0U; - } - else - { - u8Divider = (uint8_t)(u32SrcClk / u32BusClock) >> 1U; - } - - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_MCLKDIV_Msk) | u8Divider; - - i2s->CTL0 |= I2S_CTL0_MCLKEN_Msk; - - u32Reg = i2s->CLKDIV & I2S_CLKDIV_MCLKDIV_Msk; - - if (u32Reg == 0U) - { - u32Clock = u32SrcClk; - } - else - { - u32Clock = (u32SrcClk >> 1U) / u32Reg; - } - - return u32Clock; -} - -/** - * @brief Disable MCLK . - * @param[in] i2s is the base address of I2S module. - * @return none - */ -void I2S_DisableMCLK(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 15. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 15. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->CTL1 = (i2s->CTL1 & ~(I2S_CTL1_TXTH_Msk | I2S_CTL1_RXTH_Msk)) | - (u32TxThreshold << I2S_CTL1_TXTH_Pos) | - (u32RxThreshold << I2S_CTL1_RXTH_Pos); -} - -/** - * @brief Configure PCM(TDM) function parameters, such as channel width, channel number and sync pulse width - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChannelWidth Channel width. Valid values are: - * - \ref I2S_TDM_WIDTH_8BIT - * - \ref I2S_TDM_WIDTH_16BIT - * - \ref I2S_TDM_WIDTH_24BIT - * - \ref I2S_TDM_WIDTH_32BIT - * @param[in] u32ChannelNum Channel number. Valid values are: - * - \ref I2S_TDM_2CH - * - \ref I2S_TDM_4CH - * - \ref I2S_TDM_6CH - * - \ref I2S_TDM_8CH - * @param[in] u32SyncWidth Width for sync pulse. Valid values are: - * - \ref I2S_TDM_SYNC_ONE_BCLK - * - \ref I2S_TDM_SYNC_ONE_CHANNEL - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth) -{ - i2s->CTL0 = (i2s->CTL0 & ~(I2S_CTL0_TDMCHNUM_Msk | I2S_CTL0_CHWIDTH_Msk | I2S_CTL0_PCMSYNC_Msk)) | - (u32ChannelWidth << I2S_CTL0_CHWIDTH_Pos) | - (u32ChannelNum << I2S_CTL0_TDMCHNUM_Pos) | - (u32SyncWidth << I2S_CTL0_PCMSYNC_Pos); -} - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_keystore.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_keystore.c deleted file mode 100644 index 29af4e60ad7..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_keystore.c +++ /dev/null @@ -1,763 +0,0 @@ -/**************************************************************************//** - * @file keystore.c - * @version V3.01 - * @brief Key store driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2022 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KS_Driver Key Store Driver - @{ -*/ - -int32_t g_KS_i32ErrCode = 0; /*!< KS global error code */ - -/** @addtogroup KS_EXPORTED_FUNCTIONS Key Store Exported Functions - @{ -*/ - -/** - * @brief Initial key store - * @retval 0 Successful - * @retval others Fail - * @details This function is used to initial the key store. - * It is necessary to be called before using other APIs of Key Store. - */ -int32_t KS_Open(void) -{ - uint32_t u32TimeOutCount; - uint32_t au32Key[8] = {0}; - - CLK->AHBCLK0 |= CLK_AHBCLK0_KSCKEN_Msk; - - /* Key store initial */ - if ((KS->STS & KS_STS_INITDONE_Msk) == 0) - { - /* Waiting for busy */ - u32TimeOutCount = KS_TIMEOUT; - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - { - return KS_ERR_TIMEOUT; - } - } - - /* Start Key Store Initial */ - KS->CTL = KS_CTL_INIT_Msk | KS_CTL_START_Msk; - - /* Waiting for initilization */ - u32TimeOutCount = KS_TIMEOUT; - while ((KS->STS & KS_STS_INITDONE_Msk) == 0) - { - if (--u32TimeOutCount == 0) - { - return KS_ERR_TIMEOUT; - } - } - } - - /* Waiting busy to make sure KS is ready. */ - u32TimeOutCount = KS_TIMEOUT; - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - { - return KS_ERR_TIMEOUT; - } - } - - /* Create dummy key for KS Flash and KS SRAM */ - if (KS_Read(KS_FLASH, 0, au32Key, 8) < 0) - { - if (KS_Write(KS_FLASH, KS_META_CPU | KS_META_READABLE | KS_META_256, au32Key) != 0) - { - return KS_ERR_INIT; - } - } - - if (KS_Read(KS_SRAM, 0, au32Key, 8) < 0) - { - if (KS_Write(KS_SRAM, KS_META_CPU | KS_META_READABLE | KS_META_256, au32Key) != 0) - { - return KS_ERR_INIT; - } - } - - return KS_OK; -} - - -/** - * @brief Read key from key store - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] i32KeyIdx The key index to read - * @param[out] au32Key The buffer to store the key - * @param[in] u32WordCnt The word (32-bit) count of the key buffer size - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to read the key. - */ - -int32_t KS_Read(KS_MEM_Type eType, int32_t i32KeyIdx, uint32_t au32Key[], uint32_t u32WordCnt) -{ - int32_t i32Cnt; - uint32_t u32Cont; - int32_t offset, i, cnt; - uint32_t u32TimeOutCount; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Specify the key address */ - KS->METADATA = ((uint32_t)eType << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - offset = 0; - u32Cont = 0; - i32Cnt = (int32_t)u32WordCnt; - do - { - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Trigger to read the key */ - KS->CTL = u32Cont | KS_OP_READ | KS_CTL_START_Msk; - /* Waiting for key store processing */ - u32TimeOutCount = KS_TIMEOUT; - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - /* Read the key to key buffer */ - cnt = i32Cnt; - if (cnt > 8) - cnt = 8; - for (i = 0; i < cnt; i++) - { - au32Key[offset + i] = KS->KEY[i]; - } - - u32Cont = KS_CTL_CONT_Msk; - i32Cnt -= 8; - offset += 8; - } - while (i32Cnt > 0); - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - return KS_ERR_FAIL; - - - return KS_OK; -} - -/** - * @brief Get the word count of the specified Metadata key length - * @param[in] u32Meta The metadata define of the key length. It could be - \ref KS_META_128 - \ref KS_META_163 - \ref KS_META_192 - \ref KS_META_224 - \ref KS_META_233 - \ref KS_META_255 - \ref KS_META_256 - \ref KS_META_283 - \ref KS_META_384 - \ref KS_META_409 - \ref KS_META_512 - \ref KS_META_521 - \ref KS_META_571 - \ref KS_META_1024 - \ref KS_META_2048 - \ref KS_META_4096 - * @return The word (32-bit) count of the key - * @details This function is used to get word counts of the specified metadata key length. - * It could be used to know how may words needs to allocate for the key. - */ - -uint32_t KS_GetKeyWordCnt(uint32_t u32Meta) -{ - const uint16_t au8CntTbl[21] = { 4, 6, 6, 7, 8, 8, 8, 9, 12, 13, 16, 17, 18, 0, 0, 0, 32, 48, 64, 96, 128 }; - return au8CntTbl[((u32Meta & KS_METADATA_SIZE_Msk) >> KS_METADATA_SIZE_Pos)]; -} - -/** - * @brief Write key to key store -* @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - * @param[in] u32Meta The metadata of the key. It could be the combine of - \ref KS_META_AES - \ref KS_META_HMAC - \ref KS_META_RSA_EXP - \ref KS_META_RSA_MID - \ref KS_META_ECC - \ref KS_META_CPU - \ref KS_META_128 - \ref KS_META_163 - \ref KS_META_192 - \ref KS_META_224 - \ref KS_META_233 - \ref KS_META_255 - \ref KS_META_256 - \ref KS_META_283 - \ref KS_META_384 - \ref KS_META_409 - \ref KS_META_512 - \ref KS_META_521 - \ref KS_META_571 - \ref KS_META_1024 - \ref KS_META_2048 - \ref KS_META_4096 - \ref KS_META_BOOT - \ref KS_META_READABLE - \ref KS_META_PRIV - \ref KS_META_NONPRIV - \ref KS_META_SECURE - \ref KS_META_NONSECUR - - * @param[out] au32Key The buffer to store the key - * @param[in] u32WordCnt The word (32-bit) count of the key buffer size - * @return Index of the key. Failed when index < 0. - * @details This function is used to write a key to key store. - */ - -int32_t KS_Write(KS_MEM_Type eType, uint32_t u32Meta, uint32_t au32Key[]) -{ - int32_t i32Cnt; - uint32_t u32Cont; - int32_t i, cnt; - volatile int32_t offset; - uint32_t u32TimeOutCount; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Specify the key address */ - KS->METADATA = (eType << KS_METADATA_DST_Pos) | u32Meta; - - /* Get size index */ - i32Cnt = (int32_t)KS_GetKeyWordCnt(u32Meta); - - /* Invalid key length */ - if (i32Cnt == 0) - return KS_ERR_PARAMETER; - - /* OTP only support maximum 256 bits */ - if ((eType == KS_OTP) && (i32Cnt > 8)) - return KS_ERR_PARAMETER; - - /* Check size limit of KS FLASH */ - if (eType == KS_FLASH) - { - if ((int32_t)KS_GetRemainSize(KS_FLASH) - i32Cnt * 4 < 4) - return KS_ERR_FAIL; - } - - /* Check key count limit of KS SRAM */ - if (eType == KS_SRAM) - { - if (KS_GetRemainKeyCount(KS_SRAM) == 1) - return KS_ERR_FAIL; - } - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - offset = 0; - u32Cont = 0; - do - { - /* Prepare the key to write */ - cnt = i32Cnt; - if (cnt > 8) - cnt = 8; - for (i = 0; i < cnt; i++) - { - KS->KEY[i] = au32Key[offset + i]; - } - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Write the key */ - KS->CTL = u32Cont | KS_OP_WRITE | KS_CTL_START_Msk; - - u32Cont = KS_CTL_CONT_Msk; - i32Cnt -= 8; - offset += 8; - - /* Waiting for key store processing */ - u32TimeOutCount = KS_TIMEOUT; - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - } - while (i32Cnt > 0); - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - { - return KS_ERR_FAIL; - } - - return KS_TOKEYIDX(KS->METADATA); -} - -/** - * @brief Erase a key from key store SRAM - * @param[in] i32KeyIdx The key index to read - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to erase a key from SRAM of key store. - */ -int32_t KS_EraseKey(int32_t i32KeyIdx) -{ - uint32_t u32TimeOutCount = KS_TIMEOUT; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = (KS_SRAM << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_ERASE | KS_CTL_START_Msk; - - /* Waiting for processing */ - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - return KS_ERR_FAIL; - - return KS_OK; - -} - - -/** - * @brief Erase a key from key store OTP - * @param[in] i32KeyIdx The key index to erase - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to erase a key from key store OTP. - */ -int32_t KS_EraseOTPKey(int32_t i32KeyIdx) -{ - uint32_t u32TimeOutCount = KS_TIMEOUT; /* 1 second time-out */ - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = ((uint32_t)KS_OTP << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_ERASE | KS_CTL_START_Msk; - - /* Waiting for processing */ - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - return KS_ERR_FAIL; - - return KS_OK; - -} - - - -/** - * @brief Lock the OTP key - * @param[in] i32KeyIdx The key index to lock - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to lock a key of KS OTP. - */ -int32_t KS_LockOTPKey(int32_t i32KeyIdx) -{ - uint32_t u32TimeOutCount = KS_TIMEOUT; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = ((uint32_t)KS_OTP << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_LOCK | KS_CTL_START_Msk; - - /* Waiting for processing */ - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - return KS_ERR_FAIL; - - return KS_OK; - -} - -/** - * @brief Erase all keys from key store - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] i32KeyIdx The key index to read - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to erase all keys in SRAM or Flash of key store. - */ -int32_t KS_EraseAll(KS_MEM_Type eType) -{ - uint32_t au32Key[8] = { 0 }; - uint32_t u32TimeOutCount = KS_TIMEOUT; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = (eType << KS_METADATA_DST_Pos); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_ERASE_ALL | KS_CTL_START_Msk; - - /* Waiting for processing */ - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - return KS_ERR_FAIL; - - /* Create dummy key for KS Flash and KS SRAM */ - if (KS_Read(KS_FLASH, 0, au32Key, 8) < 0) - { - if (KS_Write(KS_FLASH, KS_META_CPU | KS_META_READABLE | KS_META_256, au32Key) != 0) - { - return KS_ERR_FAIL; - } - } - - if (KS_Read(KS_SRAM, 0, au32Key, 8) < 0) - { - if (KS_Write(KS_SRAM, KS_META_CPU | KS_META_READABLE | KS_META_256, au32Key) != 0) - { - return KS_ERR_FAIL; - } - } - - return KS_OK; - -} - - - -/** - * @brief Revoke a key in key store - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - \ref KS_OTP - * @param[in] i32KeyIdx The key index to read - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to revoke a key in key store. - */ -int32_t KS_RevokeKey(KS_MEM_Type eType, int32_t i32KeyIdx) -{ - uint32_t u32TimeOutCount = KS_TIMEOUT; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - - /* Specify the key address */ - KS->METADATA = (eType << KS_METADATA_DST_Pos) | KS_TOMETAKEY(i32KeyIdx); - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Erase the key */ - KS->CTL = KS_OP_REVOKE | KS_CTL_START_Msk; - - /* Waiting for processing */ - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - return KS_ERR_FAIL; - - return KS_OK; - -} - - -/** - * @brief Get remain size of specified Key Store memory - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - * @retval remain size of specified Key Store memory - * @details This function is used to get remain size of Key Store. - */ -uint32_t KS_GetRemainSize(KS_MEM_Type mem) -{ - uint32_t u32Reg; - uint32_t u32SramRemain, u32FlashRemain; - - u32Reg = KS->REMAIN; - //printf("KS Remain 0x%08x\n", u32Reg); - //printf("SRAM remain %lu bytes, Flash remain %lu bytes\n",(u32Reg&KS_REMAIN_RRMNG_Msk) >> KS_REMAIN_RRMNG_Pos, (u32Reg&KS_REMAIN_FRMNG_Msk) >> KS_REMAIN_FRMNG_Pos); - u32SramRemain = (u32Reg & KS_REMAIN_RRMNG_Msk) >> KS_REMAIN_RRMNG_Pos; - u32FlashRemain = (u32Reg & KS_REMAIN_FRMNG_Msk) >> KS_REMAIN_FRMNG_Pos; - - if (mem == KS_SRAM) - return u32SramRemain; - else - return u32FlashRemain; -} - - - -/** - * @brief Get remain key count of specified Key Store memory - * @param[in] eType The memory type. It could be: - \ref KS_SRAM - \ref KS_FLASH - * @retval Remain key count in the specified key store memory - * @details This function is used to get remain key count in specified key store memory. - */ -uint32_t KS_GetRemainKeyCount(KS_MEM_Type mem) -{ - uint32_t u32Reg; - uint32_t u32SramRemain, u32FlashRemain; - - u32Reg = KS->REMKCNT; - u32SramRemain = (u32Reg & KS_REMKCNT_RRMKCNT_Msk) >> KS_REMKCNT_RRMKCNT_Pos; - u32FlashRemain = (u32Reg & KS_REMKCNT_FRMKCNT_Msk) >> KS_REMKCNT_FRMKCNT_Pos; - - if (mem == KS_SRAM) - return u32SramRemain; - else - return u32FlashRemain; -} - - - -/** - * @brief Write OTP key to key store - * @param[in] i32KeyIdx The OTP key index to store the key. It could be 0~7. - OTP key index 0 is default for ROTPK. - * @param[in] u32Meta The metadata of the key. It could be the combine of - \ref KS_META_AES - \ref KS_META_HMAC - \ref KS_META_RSA_EXP - \ref KS_META_RSA_MID - \ref KS_META_ECC - \ref KS_META_CPU - \ref KS_META_128 - \ref KS_META_163 - \ref KS_META_192 - \ref KS_META_224 - \ref KS_META_233 - \ref KS_META_255 - \ref KS_META_256 - \ref KS_META_BOOT - \ref KS_META_READABLE - \ref KS_META_PRIV - \ref KS_META_NONPRIV - \ref KS_META_SECURE - \ref KS_META_NONSECUR - - * @param[out] au32Key The buffer to store the key - * @param[in] u32WordCnt The word (32-bit) count of the key buffer size - * @retval 0 Successful - * @retval -1 Fail - * @details This function is used to write a key to OTP key store. - */ -int32_t KS_WriteOTP(int32_t i32KeyIdx, uint32_t u32Meta, uint32_t au32Key[]) -{ - const uint16_t au8CntTbl[7] = {4, 6, 6, 7, 8, 8, 8}; - int32_t i32Cnt; - uint32_t u32Cont; - int32_t offset, i, cnt, sidx; - uint32_t u32TimeOutCount; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - /* Specify the key address */ - KS->METADATA = ((uint32_t)KS_OTP << KS_METADATA_DST_Pos) | u32Meta | KS_TOMETAKEY(i32KeyIdx); - - /* Get size index */ - sidx = (u32Meta >> KS_METADATA_SIZE_Pos) & 0xful; - - /* OTP only support maximum 256 bits */ - if (sidx >= 7) - return KS_ERR_PARAMETER; - - i32Cnt = au8CntTbl[sidx]; - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk; - offset = 0; - u32Cont = 0; - do - { - /* Prepare the key to write */ - cnt = i32Cnt; - if (cnt > 8) - cnt = 8; - for (i = 0; i < cnt; i++) - { - KS->KEY[i] = au32Key[offset + i]; - } - - /* Clear Status */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - - /* Write the key */ - KS->CTL = u32Cont | KS_OP_WRITE | KS_CTL_START_Msk; - - u32Cont = KS_CTL_CONT_Msk; - i32Cnt -= 8; - offset += 8; - - /* Waiting for key store processing */ - u32TimeOutCount = KS_TIMEOUT; - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - } - while (i32Cnt > 0); - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - { - return KS_ERR_FAIL; - } - - return i32KeyIdx; -} - - -/** - * @brief Trigger to inverse the date in KS_SRAM. - * @retval 1 The data in KS SRAM is inverted. - * @retval 0 The data in KS SRAM is non-inverted. - * @retval -1 Fail to invert the date in KS SRAM. - * @details This function is used to trigger anti-remanence procedure by inverse the data in SRAM. - * This won't change the reading key. - */ - -int32_t KS_ToggleSRAM(void) -{ - uint32_t u32TimeOutCount = KS_TIMEOUT; - - /* Just return when key store is in busy */ - if (KS->STS & KS_STS_BUSY_Msk) - return KS_ERR_BUSY; - - - /* Specify the key address */ - KS->METADATA = ((uint32_t)KS_SRAM << KS_METADATA_DST_Pos); - - /* Clear error flag */ - KS->STS = KS_STS_EIF_Msk | KS_STS_IF_Msk; - /* Trigger to do anti-remanence procedure */ - KS->CTL = KS_OP_REMAN | KS_CTL_START_Msk; - - /* Waiting for key store processing */ - while (KS->STS & KS_STS_BUSY_Msk) - { - if (--u32TimeOutCount == 0) - return KS_ERR_TIMEOUT; - } - - /* Check error flag */ - if (KS->STS & KS_STS_EIF_Msk) - return KS_ERR_FAIL; - - return ((KS->STS & KS_STS_RAMINV_Msk) > 0); -} - - -/**@}*/ /* end of group KS_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group KS_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_kpi.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_kpi.c deleted file mode 100644 index 32acc474f0f..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_kpi.c +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************//** - * @file kpi.c - * @version V3.00 - * @brief KPI driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KPI_Driver KPI Driver - @{ -*/ - -/** @addtogroup KPI_EXPORTED_FUNCTIONS KPI Exported Functions - @{ -*/ - -static KPI_KEY_T *s_pKeyQueue = 0; -static volatile uint32_t s_u32MaxKeyCnt = 0; -static volatile uint32_t s_u32FirstKey = 0; -static volatile uint32_t s_u32LastKey = 0; - -__WEAK void KPI_KeyHandler(KPI_KEY_T key) - -{ - uint32_t u32Next; - - /* Move last to next available space */ - u32Next = s_u32LastKey + 1; - if (u32Next >= s_u32MaxKeyCnt) - u32Next = 0; // buffer wrap - if (u32Next == s_u32FirstKey) - return; // Queue full - - /* Push key to the queue */ - s_pKeyQueue[s_u32LastKey] = key; - s_u32LastKey = u32Next; - -} - - -void KPI_IRQHandler() -{ - int32_t i, j, idx, r; - uint32_t u32KeyPress[2], u32KeyRelease[2], status; - uint32_t row, col, mask; - KPI_KEY_T key; - - /* cache key events ASAP */ - status = KPI->STATUS; - u32KeyPress[0] = KPI->KPF[0]; - u32KeyPress[1] = KPI->KPF[1]; - u32KeyRelease[0] = KPI->KRF[0]; - u32KeyRelease[1] = KPI->KRF[1]; - - if (status & KPI_STATUS_KIF_Msk) - { - /* Get current row/column setting */ - row = ((KPI->CTL & KPI_CTL_KROW_Msk) >> KPI_CTL_KROW_Pos) + 1; - col = ((KPI->CTL & KPI_CTL_KCOL_Msk) >> KPI_CTL_KCOL_Pos) + 1; - - /* Deal with the key evernts */ - for (i = 0; i < row; i++) - { - for (j = 0; j < col; j++) - { - /* Identify the specified key bit */ - idx = (i < 4) ? 0 : 1; - r = i - idx * 4; - mask = 1ul << (r * 8 + j); - - /* Key Release */ - if (status & KPI_STATUS_KRIF_Msk) - { - if (u32KeyRelease[idx] & mask) - { - /* Clean event */ - KPI->KRF[idx] = mask; - - /* Record the key */ - key.x = i; - key.y = j; - key.st = KPI_RELEASE; - - /* call handler */ - KPI_KeyHandler(key); - } - } - } - } - - /* Deal with the key evernts */ - for (i = 0; i < row; i++) - { - for (j = 0; j < col; j++) - { - /* Identify the specified key bit */ - idx = (i < 4) ? 0 : 1; - r = i - idx * 4; - mask = 1ul << (r * 8 + j); - - - /* Key Press */ - if (status & KPI_STATUS_KPIF_Msk) - { - if (u32KeyPress[idx] & mask) - { - /* Clean event */ - KPI->KPF[idx] = mask; - - /* Record the key */ - key.x = i; - key.y = j; - key.st = KPI_PRESS; - - /* call handler */ - KPI_KeyHandler(key); - } - } - } - } - } - - if (status & KPI_STATUS_TKRIF_Msk) - { - /* Clear flag */ - KPI->STATUS = KPI_STATUS_TKRIF_Msk; - - printf("Three key press!!\n"); - - } - -} - - - -/** - * @brief Open Keypad interface - * - * @param[in] kpi The pointer of the specified KPI module. - * @param[in] u32Rows The number of key rows for key scan. it could be 2 ~ 6. - * @param[in] u32Columns The number of key columns for key scan. it could be 1 ~ 8. - * @param[in] keyQueue The FIFO queue of the key press/release status. - * - * @retval 0 Sucessful - * @retval -1 Failure - * - * @details The function is used to set row and column of keypad and start to key scan. - */ -int32_t KPI_Open(uint32_t u32Rows, uint32_t u32Columns, KPI_KEY_T *pkeyQueue, uint32_t u32MaxKeyCnt) -{ - /* Key ROW limitation */ - if ((u32Rows < 2) || (u32Rows > 6)) - return -1; - - /* Key COLUMN limitation */ - if (u32Columns > 8) - return -1; - - /* Enable KPI Clock */ - CLK->APBCLK2 |= CLK_APBCLK2_KPICKEN_Msk; - - /* Seleck KPI Clock Source */ - CLK->CLKSEL3 |= CLK_CLKSEL3_KPISEL_HIRC; - - - /* Reset KPI */ - SYS->IPRST3 |= SYS_IPRST3_KPIRST_Msk; - SYS->IPRST3 ^= SYS_IPRST3_KPIRST_Msk; - - /* Set KPI */ - KPI->CTL = ((u32Rows - 1) << KPI_CTL_KROW_Pos) | ((u32Columns - 1) << KPI_CTL_KCOL_Pos) | - KPI_CTL_KIEN_Msk | KPI_CTL_KPIEN_Msk | KPI_CTL_KRIEN_Msk | - (3 << KPI_CTL_DBCLKSEL_Pos) | - KPI_CTL_KPEN_Msk; - - NVIC_EnableIRQ(KPI_IRQn); - - /* Set up the queue of key */ - s_pKeyQueue = pkeyQueue; - s_u32MaxKeyCnt = u32MaxKeyCnt; - s_u32FirstKey = 0; - s_u32LastKey = 0; - - return 0; -} - -/** - * @brief Close Keypad interface - * - * @details The function is used to stop and close key pad. - */ - -void KPI_Close() -{ - /* Disable Keypad */ - KPI->CTL = 0; -} - - -/** - * @brief Detect any key press - * - * - * @retval 1 Key pressed - * @retval 0 No key pressed - * - * @details The function is used to check if any key pressed. - */ -int32_t KPI_kbhit() -{ - if (s_u32FirstKey != s_u32LastKey) - return 1; - return 0; -} - - -/** - * @brief Get pressed/released key - * - * @return return the pressed key information. If no key pressed, return key index is 0xff, 0xff. - * - * @details The function is get the key pressed or key released. - */ -KPI_KEY_T KPI_GetKey() -{ - KPI_KEY_T key = {0xff, 0xff, 0xffff}; - - /* Check if queue is empty */ - if (s_u32FirstKey != s_u32LastKey) - { - /* Pop the key from queue */ - key = s_pKeyQueue[s_u32FirstKey++]; - - /* Wrap around check */ - if (s_u32FirstKey >= s_u32MaxKeyCnt) - s_u32FirstKey = 0; - } - - return key; -} - - -/** - * @brief Set key sample time - * - * @param[in] ms The key sample time in milliseconds. - * - * @details The function is used to set key sample time. The maximum time is 1398 milliseconds. - */ -void KPI_SetSampleTime(uint32_t ms) -{ - if (ms >= 1398) - ms = 1398; - - KPI->DLYCTL = 0x1F | ((__HIRC / 1000) * ms << 8); -} - - -/*@}*/ /* end of group KPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group KPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_pdma.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_pdma.c deleted file mode 100644 index be6dbbaf562..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_pdma.c +++ /dev/null @@ -1,470 +0,0 @@ -/**************************************************************************//** - * @file pdma.c - * @version V1.00 - * @brief PDMA driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - - -/** @addtogroup PDMA_EXPORTED_FUNCTIONS PDMA Exported Functions - @{ -*/ - -/** - * @brief PDMA Open - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable the PDMA channels. - */ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask) -{ - uint32_t i; - - for (i = 0UL; i < PDMA_CH_MAX; i++) - { - if ((1 << i) & u32Mask) - { - pdma->DSCT[i].CTL = 0UL; - } - } - - pdma->CHCTL |= u32Mask; -} - -/** - * @brief PDMA Close - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details This function disable all PDMA channels. - */ -void PDMA_Close(PDMA_T *pdma) -{ - pdma->CHCTL = 0UL; -} - -/** - * @brief Set PDMA Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Width Data width. Valid values are - * - \ref PDMA_WIDTH_8 - * - \ref PDMA_WIDTH_16 - * - \ref PDMA_WIDTH_32 - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected channel data width and transfer count. - */ -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXCNT_Msk | PDMA_DSCT_CTL_TXWIDTH_Msk); - pdma->DSCT[u32Ch].CTL |= (u32Width | ((u32TransCount - 1UL) << PDMA_DSCT_CTL_TXCNT_Pos)); -} - -/** - * @brief Set PDMA Stride Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestLen Destination stride count - * @param[in] u32SrcLen Source stride count - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected stride mode. - */ -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount) -{ - (pdma)->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - (pdma)->STRIDE[u32Ch].ASOCR = (u32DestLen << 16) | u32SrcLen; - (pdma)->STRIDE[u32Ch].STCR = u32TransCount; -} - -/** - * @brief Set PDMA Repeat - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestInterval Destination address interval count - * @param[in] u32SrcInterval Source address interval count - * @param[in] u32RepeatCount Repeat count - * - * @return None - * - * @details This function set the selected repeat. - */ -void PDMA_SetRepeat(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount) -{ - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - pdma->REPEAT[u32Ch].AICTL = ((u32DestInterval) << 16) | (u32SrcInterval); - pdma->REPEAT[u32Ch].RCNT = u32RepeatCount; -} - -/** - * @brief Set PDMA Transfer Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32SrcAddr Source address - * @param[in] u32SrcCtrl Source control attribute. Valid values are - * - \ref PDMA_SAR_INC - * - \ref PDMA_SAR_FIX - * @param[in] u32DstAddr Destination address - * @param[in] u32DstCtrl Destination control attribute. Valid values are - * - \ref PDMA_DAR_INC - * - \ref PDMA_DAR_FIX - * - * @return None - * - * @details This function set the selected channel source/destination address and attribute. - */ -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl) -{ - pdma->DSCT[u32Ch].SA = u32SrcAddr; - pdma->DSCT[u32Ch].DA = u32DstAddr; - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_SAINC_Msk | PDMA_DSCT_CTL_DAINC_Msk); - pdma->DSCT[u32Ch].CTL |= (u32SrcCtrl | u32DstCtrl); -} - -/** - * @brief Set PDMA Transfer Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Peripheral The selected peripheral. Valid values are - * - \ref PDMA_MEM - * - \ref PDMA_USB_TX - * - \ref PDMA_USB_RX - * - \ref PDMA_UART0_TX - * - \ref PDMA_UART0_RX - * - \ref PDMA_UART1_TX - * - \ref PDMA_UART1_RX - * - \ref PDMA_UART2_TX - * - \ref PDMA_UART2_RX - * - \ref PDMA_UART3_TX - * - \ref PDMA_UART3_RX - * - \ref PDMA_UART4_TX - * - \ref PDMA_UART4_RX - * - \ref PDMA_UART5_TX - * - \ref PDMA_UART5_RX - * - \ref PDMA_USCI0_TX - * - \ref PDMA_USCI0_RX - * - \ref PDMA_QSPI0_TX - * - \ref PDMA_QSPI0_RX - * - \ref PDMA_SPI0_TX - * - \ref PDMA_SPI0_RX - * - \ref PDMA_SPI1_TX - * - \ref PDMA_SPI1_RX - * - \ref PDMA_SPI2_TX - * - \ref PDMA_SPI2_RX - * - \ref PDMA_SPI3_TX - * - \ref PDMA_SPI3_RX - * - \ref PDMA_QSPI1_TX - * - \ref PDMA_QSPI1_RX - * - \ref PDMA_EPWM0_P1_RX - * - \ref PDMA_EPWM0_P2_RX - * - \ref PDMA_EPWM0_P3_RX - * - \ref PDMA_EPWM1_P1_RX - * - \ref PDMA_EPWM1_P2_RX - * - \ref PDMA_EPWM1_P3_RX - * - \ref PDMA_I2C0_TX - * - \ref PDMA_I2C0_RX - * - \ref PDMA_I2C1_TX - * - \ref PDMA_I2C1_RX - * - \ref PDMA_I2C2_TX - * - \ref PDMA_I2C2_RX - * - \ref PDMA_I2S0_TX - * - \ref PDMA_I2S0_RX - * - \ref PDMA_TMR0 - * - \ref PDMA_TMR1 - * - \ref PDMA_TMR2 - * - \ref PDMA_TMR3 - * - \ref PDMA_EADC0_RX - * - \ref PDMA_DAC0_TX - * - \ref PDMA_DAC1_TX - * - \ref PDMA_EPWM0_CH0_TX - * - \ref PDMA_EPWM0_CH1_TX - * - \ref PDMA_EPWM0_CH2_TX - * - \ref PDMA_EPWM0_CH3_TX - * - \ref PDMA_EPWM0_CH4_TX - * - \ref PDMA_EPWM0_CH5_TX - * - \ref PDMA_EPWM1_CH0_TX - * - \ref PDMA_EPWM1_CH1_TX - * - \ref PDMA_EPWM1_CH2_TX - * - \ref PDMA_EPWM1_CH3_TX - * - \ref PDMA_EPWM1_CH4_TX - * - \ref PDMA_EPWM1_CH5_TX - * - \ref PDMA_UART6_TX - * - \ref PDMA_UART6_RX - * - \ref PDMA_UART7_TX - * - \ref PDMA_UART7_RX - * - \ref PDMA_EADC1_RX - * - \ref PDMA_ACMP0 - * - \ref PDMA_ACMP1 - * - \ref PDMA_PSIO_TX - * - \ref PDMA_PSIO_RX - * - \ref PDMA_I2C3_TX - * - \ref PDMA_I2C3_RX - * - \ref PDMA_I2C4_TX - * - \ref PDMA_I2C4_RX - * - \ref PDMA_I2S1_TX - * - \ref PDMA_I2S1_RX - * - \ref PDMA_EINT0 - * - \ref PDMA_EINT1 - * - \ref PDMA_EINT2 - * - \ref PDMA_EINT3 - * - \ref PDMA_EINT4 - * - \ref PDMA_EINT5 - * - \ref PDMA_EINT6 - * - \ref PDMA_EINT7 - * - \ref PDMA_UART8_TX - * - \ref PDMA_UART8_RX - * - \ref PDMA_UART9_TX - * - \ref PDMA_UART9_RX - * - \ref PDMA_EADC2_RX - * - \ref PDMA_ACMP2 - * - \ref PDMA_ACMP3 - * @param[in] u32ScatterEn Scatter-gather mode enable - * @param[in] u32DescAddr Scatter-gather descriptor address - * - * @return None - * - * @details This function set the selected channel transfer mode. Include peripheral setting. - */ -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - pau32REQSEL[u32Ch / 4] = (pau32REQSEL[u32Ch / 4] & ~u32REQSEL_Msk) | (u32Peripheral << u32REQSEL_Pos); - - if (u32ScatterEn) - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_SCATTER; - pdma->DSCT[u32Ch].NEXT = u32DescAddr - (pdma->SCATBA); - } - else - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_BASIC; - } - } - else {} -} - -/** - * @brief Set PDMA Burst Type and Size - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32BurstType Burst mode or single mode. Valid values are - * - \ref PDMA_REQ_SINGLE - * - \ref PDMA_REQ_BURST - * @param[in] u32BurstSize Set the size of burst mode. Valid values are - * - \ref PDMA_BURST_128 - * - \ref PDMA_BURST_64 - * - \ref PDMA_BURST_32 - * - \ref PDMA_BURST_16 - * - \ref PDMA_BURST_8 - * - \ref PDMA_BURST_4 - * - \ref PDMA_BURST_2 - * - \ref PDMA_BURST_1 - * - * @return None - * - * @details This function set the selected channel burst type and size. - */ -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXTYPE_Msk | PDMA_DSCT_CTL_BURSIZE_Msk); - pdma->DSCT[u32Ch].CTL |= (u32BurstType | u32BurstSize); -} - -/** - * @brief Enable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable timeout function of the selected channel(s). - */ -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN |= u32Mask; -} - -/** - * @brief Disable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function disable timeout function of the selected channel(s). - */ -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN &= ~u32Mask; -} - -/** - * @brief Set PDMA Timeout Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32OnOff Enable/disable time out function - * @param[in] u32TimeOutCnt Timeout count - * - * @return None - * - * @details This function set the timeout count. - */ -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32TOC = (__IO uint32_t *)&pdma->TOC0_1; - uint32_t u32TOC_Pos, u32TOC_Msk; - - u32TOC_Pos = (u32Ch % 2) * 16 ; - u32TOC_Msk = PDMA_TOC0_1_TOC0_Msk << u32TOC_Pos; - pau32TOC[u32Ch / 2] = (pau32TOC[u32Ch / 2] & ~u32TOC_Msk) | (u32TimeOutCnt << u32TOC_Pos); - - if (u32OnOff) - pdma->TOUTEN |= (1 << u32Ch); - else - pdma->TOUTEN &= ~(1 << u32Ch); - } - else {} -} - -/** - * @brief Trigger PDMA - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This function trigger the selected channel. - */ -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch) -{ - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk, u32ChReq; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - - u32ChReq = (pau32REQSEL[u32Ch / 4] & u32REQSEL_Msk) >> u32REQSEL_Pos; - - if (u32ChReq == PDMA_MEM) - { - pdma->SWREQ = (1ul << u32Ch); - } - else {} -} - -/** - * @brief Enable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function enable the selected channel interrupt. - */ -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN |= (1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL &= ~PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN |= (1ul << u32Ch); - break; - - default: - break; - } -} - -/** - * @brief Disable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function disable the selected channel interrupt. - * @note The transfer done interrupt is disabled when table empty interrupt is disabled(PDMA_INT_TEMPTY). - */ -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN &= ~(1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN &= ~(1ul << u32Ch); - break; - - default: - break; - } -} - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_qspi.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_qspi.c deleted file mode 100644 index 7068b15f3e6..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_qspi.c +++ /dev/null @@ -1,901 +0,0 @@ -/**************************************************************************//** - * @file qspi.c - * @version V3.00 - * @brief M460 series QSPI driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32MasterSlave Decides the QSPI module is operating in master mode or in slave mode. (QSPI_SLAVE, QSPI_MASTER) - * @param[in] u32QSPIMode Decides the transfer timing. (QSPI_MODE_0, QSPI_MODE_1, QSPI_MODE_2, QSPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a QSPI transaction. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI peripheral clock. - * @details By default, the QSPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the QSPI clock divider setting will be 0. - * The actual clock rate may be different from the target QSPI clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the - * actual QSPI clock rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the QSPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t QSPI_Open(QSPI_T *qspi, - uint32_t u32MasterSlave, - uint32_t u32QSPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0U, u32Div, u32HCLKFreq, u32RetValue = 0U; - - if (u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32MasterSlave == QSPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - if (qspi == QSPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - else if (qspi == QSPI1) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI1SEL_Msk)) | CLK_CLKSEL2_QSPI1SEL_PCLK1; - } - - /* Check clock source of QSPI */ - if (qspi == QSPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (qspi == QSPI1) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0x1FF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - } - else /* For slave mode, force the QSPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - - /* Select PCLK as the clock source of QSPI */ - if (qspi == QSPI0) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if (qspi == QSPI1) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI1SEL_Msk)) | CLK_CLKSEL2_QSPI1SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will reset QSPI controller. - */ -void QSPI_Close(QSPI_T *qspi) -{ - /* Reset QSPI */ - if (qspi == QSPI0) - { - SYS->IPRST1 |= SYS_IPRST1_QSPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_QSPI0RST_Msk; - } - else if (qspi == QSPI1) - { - SYS->IPRST2 |= SYS_IPRST2_QSPI1RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_QSPI1RST_Msk; - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI RX FIFO buffer. The RXEMPTY (QSPI_STATUS[8]) will be set to 1. - */ -void QSPI_ClearRxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI TX FIFO buffer. The TXEMPTY (QSPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void QSPI_ClearTxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void QSPI_DisableAutoSS(QSPI_T *qspi) -{ - qspi->SSCTL &= ~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (QSPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (QSPI_SS_ACTIVE_HIGH, QSPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - qspi->SSCTL = (qspi->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | QSPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the QSPI bus clock. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target QSPI bus clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - if (qspi == QSPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - else if (qspi == QSPI1) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI1SEL_Msk)) | CLK_CLKSEL2_QSPI1SEL_PCLK1; - } - - /* Check clock source of QSPI */ - if (qspi == QSPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (qspi == QSPI1) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0x1FF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - qspi->FIFOCTL = (qspi->FIFOCTL & ~(QSPI_FIFOCTL_TXTH_Msk | QSPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << QSPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << QSPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of QSPI bus clock. Only available in Master mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Actual QSPI bus clock frequency in Hz. - * @details This function will calculate the actual QSPI bus clock rate according to the QSPIxSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t QSPI_GetBusClock(QSPI_T *qspi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc = 0UL; - - /* Get DIVIDER setting */ - u32Div = (qspi->CLKDIV & QSPI_CLKDIV_DIVIDER_Msk) >> QSPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of QSPI */ - if (qspi == QSPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (qspi == QSPI1) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI1SEL_Msk) == CLK_CLKSEL2_QSPI1SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - /* Return QSPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1U)); -} - -/** - * @brief Enable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL |= QSPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave mode time-out interrupt flag */ - if ((u32Mask & QSPI_SLVTO_INT_MASK) == QSPI_SLVTO_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVTOIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL &= ~QSPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave mode time-out interrupt flag */ - if ((u32Mask & QSPI_SLVTO_INT_MASK) == QSPI_SLVTO_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVTOIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get QSPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = qspi->STATUS & QSPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_UNIT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSINACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVUR_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVBE_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVTOIF_Msk; - /* Check slave mode time-out interrupt flag */ - if ((u32Mask & QSPI_SLVTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVTO_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_TXUF_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_SLVTO_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear QSPI related interrupt flags specified by u32Mask parameter. - */ -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - if (u32Mask & QSPI_UNIT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & QSPI_SSACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & QSPI_SSINACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & QSPI_SLVUR_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & QSPI_SLVBE_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & QSPI_SLVTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVTOIF_Msk; /* Clear slave mode time-out interrupt flag */ - } - - if (u32Mask & QSPI_TXUF_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXOV_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get QSPI status. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_BUSY_MASK - * - \ref QSPI_RX_EMPTY_MASK - * - \ref QSPI_RX_FULL_MASK - * - \ref QSPI_TX_EMPTY_MASK - * - \ref QSPI_TX_FULL_MASK - * - \ref QSPI_TXRX_RESET_MASK - * - \ref QSPI_SPIEN_STS_MASK - * - \ref QSPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = qspi->STATUS & QSPI_STATUS_BUSY_Msk; - /* Check busy status */ - if ((u32Mask & QSPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_BUSY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if ((u32Mask & QSPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if ((u32Mask & QSPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if ((u32Mask & QSPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if ((u32Mask & QSPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if ((u32Mask & QSPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TXRX_RESET_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SPIENSTS_Msk; - /* Check SPIEN flag */ - if ((u32Mask & QSPI_SPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_SPIEN_STS_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SSLINE_Msk; - /* Check QSPIx_SS line status */ - if ((u32Mask & QSPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - -/** - * @brief Get QSPI status2. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_SLVBENUM_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus2(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32TmpStatus; - uint32_t u32Number = 0U; - - u32TmpStatus = qspi->STATUS2; - - /* Check effective bit number of uncompleted RX data status */ - if (u32Mask & QSPI_SLVBENUM_MASK) - { - u32Number = (u32TmpStatus & QSPI_STATUS2_SLVBENUM_Msk) >> QSPI_STATUS2_SLVBENUM_Pos; - } - - return u32Number; -} - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_rng.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_rng.c deleted file mode 100644 index bccc1a71525..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_rng.c +++ /dev/null @@ -1,361 +0,0 @@ -/**************************************************************************//** - * @file rng.c - * @version V3.01 - * @brief Show how to get true random number. - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RNG_Driver RNG Driver - @{ -*/ - - -/** @addtogroup RNG_EXPORTED_FUNCTIONS RNG Exported Functions - @{ -*/ - -typedef enum _RNG_KEY_SIZE -{ - KEY_128 = 0, - KEY_192 = 2, - KEY_224 = 3, - KEY_233 = 4, - KEY_255 = 5, - KEY_256 = 6, - KEY_283 = 7, - KEY_384 = 8, - KEY_409 = 9, - KEY_512 = 10, - KEY_521 = 11, - KEY_571 = 12 - -} eRNG_SZ; - - -/** - * @brief Basic Configuration of TRNG and PRNG - * - * @details The function is used to set the basic configuration for TRNG and PRNG. - */ -static void RNG_BasicConfig() -{ - int32_t i; - int32_t timeout = 0x1000000; - - /* Enable TRNG & PRNG */ - CLK->AHBCLK0 |= CLK_AHBCLK0_CRPTCKEN_Msk; - CLK->APBCLK1 |= CLK_APBCLK1_TRNGCKEN_Msk; - - /* Use LIRC as TRNG engine clock */ - CLK->PWRCTL |= CLK_PWRCTL_LIRCEN_Msk; - while ((CLK->STATUS & CLK_STATUS_LIRCSTB_Msk) == 0) - { - if (i++ > timeout) break; /* Wait LIRC time-out */ - } - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_TRNGSEL_Msk)) | CLK_CLKSEL2_TRNGSEL_LIRC; - -} - - - - -/** - * @brief Open random number generator - * - * @return 0 Successful - * -1 Failed - * - * @details The function is used to disable rng interrupt. - */ -int32_t RNG_Open() -{ - int32_t i; - int32_t timeout = 0x1000000; - - RNG_BasicConfig(); - - /* TRNG Activate */ - TRNG->ACT |= TRNG_ACT_ACT_Msk; - /* Waiting for ready */ - i = 0; - while ((TRNG->CTL & TRNG_CTL_READY_Msk) == 0) - { - if (i++ > timeout) - { - /* TRNG ready timeout */ - return -1; - } - } - - /* CLKPSC is default to 0. The performance maybe low but suitable for any cases */ - TRNG->CTL = 0; - - /* Waiting for PRNG busy */ - i = 0; - while ((CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) == CRPT_PRNG_CTL_BUSY_Msk) - { - if (i++ > timeout) - { - /* PRNG busy timeout */ - return -1; - } - } - - /* Reload seed from TRNG only at first time */ - CRPT->PRNG_CTL = (PRNG_KEY_SIZE_256 << CRPT_PRNG_CTL_KEYSZ_Pos) | CRPT_PRNG_CTL_START_Msk | CRPT_PRNG_CTL_SEEDRLD_Msk | PRNG_CTL_SEEDSRC_TRNG; - - i = 0; - while (CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if (i++ > timeout) - { - /* busy timeout */ - return -1; - } - } - - return 0; -} - - -/** - * @brief Get random words - * - * @param[in] pu32Buf Buffer pointer to store the random number - * - * @param[in] nWords Buffer size in word count. nWords must <= 8 - * - * @return Word count of random number in buffer - * - * @details The function is used to generate random numbers - */ -int32_t RNG_Random(uint32_t *pu32Buf, int32_t nWords) -{ - int32_t i; - int32_t timeout = 0x10000; - - /* Waiting for Busy */ - while (CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if (timeout-- < 0) - return 0; - } - - if (nWords > 8) - nWords = 8; - - /* Trig to generate seed 256 bits random number */ - CRPT->PRNG_CTL = (6 << CRPT_PRNG_CTL_KEYSZ_Pos) | CRPT_PRNG_CTL_START_Msk; - - timeout = 0x10000; - while (CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if (timeout-- < 0) - return 0; - } - - for (i = 0; i < nWords; i++) - { - pu32Buf[i] = CRPT->PRNG_KEY[i]; - } - - return nWords; -} - - - -/** - * @brief Initial function for ECDSA key generator for Key Store - * - * @param[in] u32KeySize It could be PRNG_KEY_SIZE_128 ~ PRNG_KEY_SIZE_571 - * - * @param[in] au32ECC_N The N value of specified ECC curve. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is initial funciton of RNG_ECDSA function. - * This funciton should be called before calling RNG_ECDSA(). - */ -int32_t RNG_ECDSA_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]) -{ - int32_t i; - - /* Initial TRNG and PRNG for random number */ - if (RNG_Open()) - return -1; - - /* It is necessary to set ECC_N for ECDSA */ - for (i = 0; i < 18; i++) - CRPT->ECC_N[i] = au32ECC_N[i]; - - CRPT->PRNG_KSCTL = (KS_OWNER_ECC << CRPT_PRNG_KSCTL_OWNER_Pos) | - CRPT_PRNG_KSCTL_ECDSA_Msk | - (CRPT_PRNG_KSCTL_WDST_Msk) | - (KS_SRAM << CRPT_PRNG_KSCTL_WSDST_Pos); - - return 0; -} - - -/** - * @brief To generate a key to KS SRAM for ECDSA. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is used to generate a key to KS SRAM for ECDSA. - * This key is necessary for ECDSA+Key Store function of ECC. - */ -int32_t RNG_ECDSA(uint32_t u32KeySize) -{ - - int32_t timeout; - int32_t i; - - /* Reload seed only at first time */ - CRPT->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | CRPT_PRNG_CTL_START_Msk | PRNG_CTL_SEEDSRC_TRNG; - - timeout = 0x10000; - i = 0; - while (CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if (i++ > timeout) - { - return -1; - } - } - - if (CRPT->PRNG_KSSTS & CRPT_PRNG_KSSTS_KCTLERR_Msk) - { - return -1; - } - - return (CRPT->PRNG_KSSTS & CRPT_PRNG_KSCTL_NUM_Msk); -} - - - -/** - * @brief Initial funciton for RNG_ECDH. - * - * @param[in] u32KeySize It could be PRNG_KEY_SIZE_128 ~ PRNG_KEY_SIZE_571 - * - * @param[in] au32ECC_N The N value of specified ECC curve. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is initial function of RNG_ECDH. - * - */ -int32_t RNG_ECDH_Init(uint32_t u32KeySize, uint32_t au32ECC_N[18]) -{ - int32_t i; - - /* Initial Random Number Generator */ - if (RNG_Open()) - return -1; - - /* It is necessary to set ECC_N for ECDSA */ - for (i = 0; i < 18; i++) - CRPT->ECC_N[i] = au32ECC_N[i]; - - CRPT->PRNG_KSCTL = (KS_OWNER_ECC << CRPT_PRNG_KSCTL_OWNER_Pos) | - (CRPT_PRNG_KSCTL_ECDH_Msk) | - (CRPT_PRNG_KSCTL_WDST_Msk) | - (KS_SRAM << CRPT_PRNG_KSCTL_WSDST_Pos); - - return 0; -} - - -/** - * @brief To generate a key to KS SRAM for ECDH. - * - * @return -1 Failed - * Others The key number in KS SRAM - * - * @details The function is used to generate a key to KS SRAM for ECDH. - * This key is necessary for ECDH+Key Store function of ECC. - */ -int32_t RNG_ECDH(uint32_t u32KeySize) -{ - int32_t timeout; - int32_t i; - - /* Reload seed only at first time */ - CRPT->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | CRPT_PRNG_CTL_START_Msk | PRNG_CTL_SEEDSRC_TRNG; - - timeout = 0x10000; - i = 0; - while (CRPT->PRNG_CTL & CRPT_PRNG_CTL_BUSY_Msk) - { - if (i++ > timeout) - return -1; - } - - if (CRPT->PRNG_KSSTS & CRPT_PRNG_KSSTS_KCTLERR_Msk) - return -1; - - return (CRPT->PRNG_KSSTS & CRPT_PRNG_KSCTL_NUM_Msk); -} - - -/** - * @brief To generate entropy from hardware entropy source (TRNG) - * - * @return -1 Failed - * Others The bytes in pu8Out buffer - * - * @details The function is used to generate entropy from TRNG. - */ -int32_t RNG_EntropyPoll(uint8_t *pu8Out, int32_t i32Len) -{ - int32_t timeout; - int32_t i; - - if ((TRNG->CTL & TRNG_CTL_READY_Msk) == 0) - { - /* TRNG is not in active */ - printf("trng is not active\n"); - return -1; - } - - /* Trigger entropy generate */ - TRNG->CTL |= TRNG_CTL_TRNGEN_Msk; - - for (i = 0; i < i32Len; i++) - { - timeout = SystemCoreClock; - while ((TRNG->CTL & TRNG_CTL_DVIF_Msk) == 0) - { - if (timeout-- <= 0) - { - /* Timeout error */ - printf("timeout\n"); - return -1; - } - } - /* Get one byte entroy */ - *pu8Out++ = TRNG->DATA; - } - - return i32Len; -} - -/**@}*/ /* end of group RNG_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RNG_Driver */ - -/**@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_rtc.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_rtc.c deleted file mode 100644 index e3a67b2e98b..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_rtc.c +++ /dev/null @@ -1,1178 +0,0 @@ -/**************************************************************************//** - * @file rtc.c - * @version V3.00 - * @brief Real Time Clock(RTC) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @cond HIDDEN_SYMBOLS */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Global file scope (static) variables */ -/*---------------------------------------------------------------------------------------------------------*/ -static volatile uint32_t g_u32hiYear, g_u32loYear, g_u32hiMonth, g_u32loMonth, g_u32hiDay, g_u32loDay; -static volatile uint32_t g_u32hiHour, g_u32loHour, g_u32hiMin, g_u32loMin, g_u32hiSec, g_u32loSec; - -/** @endcond HIDDEN_SYMBOLS */ - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -int32_t g_RTC_i32ErrCode = 0; /*!< RTC global error code */ - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Initialize RTC module and start counting - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @retval 0: SUCCESS - * @retval -1: Initialize RTC module fail - * - * @details This function is used to: \n - * 1. Write initial key to let RTC start count. \n - * 2. Input parameter indicates start date/time. \n - * 3. User has to make sure that parameters of RTC date/time are reasonable. \n - * 4. Enable frequency dynamic compensation function. \n - * @note Null pointer for using default starting date/time. - */ -int32_t RTC_Open(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - - RTC->INIT = RTC_INIT_KEY; - - if (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - RTC->INIT = RTC_INIT_KEY; - while (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - if (--u32TimeOutCount == 0) return -1; - } - } - - if (sPt != 0) - { - /* Enable frequency dynamic compensation function */ - RTC->CLKFMT |= RTC_CLKFMT_DCOMPEN_Msk; - - /* Set RTC date and time */ - RTC_SetDateAndTime(sPt); - } - - return 0; -} - -/** - * @brief Disable RTC Clock - * - * @param None - * - * @return None - * - * @details This API will disable RTC peripheral clock. - */ -void RTC_Close(void) -{ - CLK->APBCLK0 &= ~CLK_APBCLK0_RTCCKEN_Msk; -} - -/** - * @brief Set 32K Frequency Compensation Data - * - * @param[in] i32FrequencyX10000 Specify the RTC clock X10000, ex: 327736512 means 32773.6512. - * - * @return None - * - * @details This API is used to compensate the 32 kHz frequency by current LXT frequency for RTC application. - * - * @note This function sets g_RTC_i32ErrCode to RTC_TIMEOUT_ERR if waiting RTC time-out. - */ -void RTC_32KCalibration(int32_t i32FrequencyX10000) -{ - int32_t i32RegInt, i32RegFra; - uint32_t u32TimeOutCount = SystemCoreClock << 1; /* 2 second time-out */ - - g_RTC_i32ErrCode = 0; - - /* Compute integer and fraction for RTC FCR register */ - i32RegInt = (i32FrequencyX10000 / 10000) - RTC_FCR_REFERENCE; - i32RegFra = ((((i32FrequencyX10000 % 10000)) * 64) + 5000) / 10000; - - if (i32RegFra >= 0x40) - { - i32RegFra = 0x0; - i32RegInt++; - } - - /* Judge Integer part is reasonable */ - if ((i32RegInt >= 0) && (i32RegInt <= 31)) - { - u32TimeOutCount = SystemCoreClock << 1; /* 2 second time-out */ - while ((RTC->FREQADJ & RTC_FREQADJ_FCRBUSY_Msk) == RTC_FREQADJ_FCRBUSY_Msk) - if (--u32TimeOutCount == 0) - { - g_RTC_i32ErrCode = RTC_TIMEOUT_ERR; - break; - } - RTC->FREQADJ = (uint32_t)((i32RegInt << 8) | i32RegFra); - u32TimeOutCount = SystemCoreClock << 1; /* 2 second time-out */ - while ((RTC->FREQADJ & RTC_FREQADJ_FCRBUSY_Msk) == RTC_FREQADJ_FCRBUSY_Msk) - if (--u32TimeOutCount == 0) - { - g_RTC_i32ErrCode = RTC_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief Get Current RTC Date and Time - * - * @param[out] sPt The returned pointer is specified the current RTC value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the current RTC date and time value. - */ -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get [Date digit] data */ - g_u32hiYear = (RTC->CAL & RTC_CAL_TENYEAR_Msk) >> RTC_CAL_TENYEAR_Pos; - g_u32loYear = (RTC->CAL & RTC_CAL_YEAR_Msk) >> RTC_CAL_YEAR_Pos; - g_u32hiMonth = (RTC->CAL & RTC_CAL_TENMON_Msk) >> RTC_CAL_TENMON_Pos; - g_u32loMonth = (RTC->CAL & RTC_CAL_MON_Msk) >> RTC_CAL_MON_Pos; - g_u32hiDay = (RTC->CAL & RTC_CAL_TENDAY_Msk) >> RTC_CAL_TENDAY_Pos; - g_u32loDay = (RTC->CAL & RTC_CAL_DAY_Msk) >> RTC_CAL_DAY_Pos; - - /* Get [Time digit] data */ - g_u32hiHour = (RTC->TIME & RTC_TIME_TENHR_Msk) >> RTC_TIME_TENHR_Pos; - g_u32loHour = (RTC->TIME & RTC_TIME_HR_Msk) >> RTC_TIME_HR_Pos; - g_u32hiMin = (RTC->TIME & RTC_TIME_TENMIN_Msk) >> RTC_TIME_TENMIN_Pos; - g_u32loMin = (RTC->TIME & RTC_TIME_MIN_Msk) >> RTC_TIME_MIN_Pos; - g_u32hiSec = (RTC->TIME & RTC_TIME_TENSEC_Msk) >> RTC_TIME_TENSEC_Pos; - g_u32loSec = (RTC->TIME & RTC_TIME_SEC_Msk) >> RTC_TIME_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10UL); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + (uint32_t)RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10UL); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10UL); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21UL) - { - sPt->u32AmPm = (uint32_t)RTC_PM; - sPt->u32Hour -= 20UL; - } - else - { - sPt->u32AmPm = (uint32_t)RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Get RTC Alarm Date and Time - * - * @param[out] sPt The returned pointer is specified the RTC alarm value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the RTC alarm date and time setting. - */ -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get alarm [Date digit] data */ - g_u32hiYear = (RTC->CALM & RTC_CALM_TENYEAR_Msk) >> RTC_CALM_TENYEAR_Pos; - g_u32loYear = (RTC->CALM & RTC_CALM_YEAR_Msk) >> RTC_CALM_YEAR_Pos; - g_u32hiMonth = (RTC->CALM & RTC_CALM_TENMON_Msk) >> RTC_CALM_TENMON_Pos; - g_u32loMonth = (RTC->CALM & RTC_CALM_MON_Msk) >> RTC_CALM_MON_Pos; - g_u32hiDay = (RTC->CALM & RTC_CALM_TENDAY_Msk) >> RTC_CALM_TENDAY_Pos; - g_u32loDay = (RTC->CALM & RTC_CALM_DAY_Msk) >> RTC_CALM_DAY_Pos; - - /* Get alarm [Time digit] data */ - g_u32hiHour = (RTC->TALM & RTC_TALM_TENHR_Msk) >> RTC_TALM_TENHR_Pos; - g_u32loHour = (RTC->TALM & RTC_TALM_HR_Msk) >> RTC_TALM_HR_Pos; - g_u32hiMin = (RTC->TALM & RTC_TALM_TENMIN_Msk) >> RTC_TALM_TENMIN_Pos; - g_u32loMin = (RTC->TALM & RTC_TALM_MIN_Msk) >> RTC_TALM_MIN_Pos; - g_u32hiSec = (RTC->TALM & RTC_TALM_TENSEC_Msk) >> RTC_TALM_TENSEC_Pos; - g_u32loSec = (RTC->TALM & RTC_TALM_SEC_Msk) >> RTC_TALM_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10UL); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + (uint32_t)RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10UL); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10UL); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21UL) - { - sPt->u32AmPm = (uint32_t)RTC_PM; - sPt->u32Hour -= 20UL; - } - else - { - sPt->u32AmPm = (uint32_t)RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32hiHour * 10UL); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10UL); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10UL); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Update Current RTC Date and Time - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update current date and time to RTC. - */ -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCAL, u32RegTIME; - - if (sPt != 0) - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == (uint32_t)RTC_PM) - { - sPt->u32Hour += 20UL; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set Day of the Week */ - RTC->WEEKDAY = sPt->u32DayOfWeek; - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Current Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCAL = ((sPt->u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCAL |= (((sPt->u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCAL |= ((sPt->u32Month / 10UL) << 12); - u32RegCAL |= ((sPt->u32Month % 10UL) << 8); - u32RegCAL |= ((sPt->u32Day / 10UL) << 4); - u32RegCAL |= (sPt->u32Day % 10UL); - - u32RegTIME = ((sPt->u32Hour / 10UL) << 20); - u32RegTIME |= ((sPt->u32Hour % 10UL) << 16); - u32RegTIME |= ((sPt->u32Minute / 10UL) << 12); - u32RegTIME |= ((sPt->u32Minute % 10UL) << 8); - u32RegTIME |= ((sPt->u32Second / 10UL) << 4); - u32RegTIME |= (sPt->u32Second % 10UL); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Calender and Time Loading */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC->CAL = (uint32_t)u32RegCAL; - RTC->TIME = (uint32_t)u32RegTIME; - } -} - -/** - * @brief Update RTC Alarm Date and Time - * - * @param[in] sPt Specify the time property and alarm date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update alarm date and time setting to RTC. - */ -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCALM, u32RegTALM; - - if (sPt != 0) - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (sPt->u32TimeScale == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == (uint32_t)RTC_PM) - { - sPt->u32Hour += 20UL; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Alarm Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCALM = ((sPt->u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCALM |= (((sPt->u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCALM |= ((sPt->u32Month / 10UL) << 12); - u32RegCALM |= ((sPt->u32Month % 10UL) << 8); - u32RegCALM |= ((sPt->u32Day / 10UL) << 4); - u32RegCALM |= (sPt->u32Day % 10UL); - - u32RegTALM = ((sPt->u32Hour / 10UL) << 20); - u32RegTALM |= ((sPt->u32Hour % 10UL) << 16); - u32RegTALM |= ((sPt->u32Minute / 10UL) << 12); - u32RegTALM |= ((sPt->u32Minute % 10UL) << 8); - u32RegTALM |= ((sPt->u32Second / 10UL) << 4); - u32RegTALM |= (sPt->u32Second % 10UL); - - RTC->CALM = (uint32_t)u32RegCALM; - RTC->TALM = (uint32_t)u32RegTALM; - } -} - -/** - * @brief Update RTC Current Date - * - * @param[in] u32Year The year calendar digit of current RTC setting. - * @param[in] u32Month The month calendar digit of current RTC setting. - * @param[in] u32Day The day calendar digit of current RTC setting. - * @param[in] u32DayOfWeek The Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] - * - * @return None - * - * @details This API is used to update current date to RTC. - */ -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek) -{ - uint32_t u32RegCAL; - - u32RegCAL = ((u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCAL |= (((u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCAL |= ((u32Month / 10UL) << 12); - u32RegCAL |= ((u32Month % 10UL) << 8); - u32RegCAL |= ((u32Day / 10UL) << 4); - u32RegCAL |= (u32Day % 10UL); - - - /* Set Day of the Week */ - RTC->WEEKDAY = u32DayOfWeek & RTC_WEEKDAY_WEEKDAY_Msk; - - /* Set RTC Calender Loading */ - RTC->CAL = (uint32_t)u32RegCAL; -} - -/** - * @brief Update RTC Current Time - * - * @param[in] u32Hour The hour time digit of current RTC setting. - * @param[in] u32Minute The minute time digit of current RTC setting. - * @param[in] u32Second The second time digit of current RTC setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update current time to RTC. - */ -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTIME; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == (uint32_t)RTC_CLOCK_12) && (u32AmPm == (uint32_t)RTC_PM)) - { - u32Hour += 20UL; - } - - u32RegTIME = ((u32Hour / 10UL) << 20); - u32RegTIME |= ((u32Hour % 10UL) << 16); - u32RegTIME |= ((u32Minute / 10UL) << 12); - u32RegTIME |= ((u32Minute % 10UL) << 8); - u32RegTIME |= ((u32Second / 10UL) << 4); - u32RegTIME |= (u32Second % 10UL); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (u32TimeMode == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - RTC->TIME = (uint32_t)u32RegTIME; -} - -/** - * @brief Update RTC Alarm Date - * - * @param[in] u32Year The year calendar digit of RTC alarm setting. - * @param[in] u32Month The month calendar digit of RTC alarm setting. - * @param[in] u32Day The day calendar digit of RTC alarm setting. - * - * @return None - * - * @details This API is used to update alarm date setting to RTC. - */ -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day) -{ - uint32_t u32RegCALM; - - u32RegCALM = ((u32Year - (uint32_t)RTC_YEAR2000) / 10UL) << 20; - u32RegCALM |= (((u32Year - (uint32_t)RTC_YEAR2000) % 10UL) << 16); - u32RegCALM |= ((u32Month / 10UL) << 12); - u32RegCALM |= ((u32Month % 10UL) << 8); - u32RegCALM |= ((u32Day / 10UL) << 4); - u32RegCALM |= (u32Day % 10UL); - - - /* Set RTC Alarm Date */ - RTC->CALM = (uint32_t)u32RegCALM; -} - -/** - * @brief Update RTC Alarm Time - * - * @param[in] u32Hour The hour time digit of RTC alarm setting. - * @param[in] u32Minute The minute time digit of RTC alarm setting. - * @param[in] u32Second The second time digit of RTC alarm setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update alarm time setting to RTC. - */ -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTALM; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == (uint32_t)RTC_CLOCK_12) && (u32AmPm == (uint32_t)RTC_PM)) - { - u32Hour += 20UL; - } - - u32RegTALM = ((u32Hour / 10UL) << 20); - u32RegTALM |= ((u32Hour % 10UL) << 16); - u32RegTALM |= ((u32Minute / 10UL) << 12); - u32RegTALM |= ((u32Minute % 10UL) << 8); - u32RegTALM |= ((u32Second / 10UL) << 4); - u32RegTALM |= (u32Second % 10UL); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (u32TimeMode == (uint32_t)RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set RTC Alarm Time */ - RTC->TALM = (uint32_t)u32RegTALM; -} - -/** - * @brief Set RTC Alarm Date Mask Function - * - * @param[in] u8IsTenYMsk 1: enable 10-Year digit alarm mask; 0: disabled. - * @param[in] u8IsYMsk 1: enable 1-Year digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsTenDMsk 1: enable 10-Day digit alarm mask; 0: disabled. - * @param[in] u8IsDMsk 1: enable 1-Day digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm date mask function. - */ -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk) -{ - RTC->CAMSK = ((uint32_t)u8IsTenYMsk << RTC_CAMSK_MTENYEAR_Pos) | - ((uint32_t)u8IsYMsk << RTC_CAMSK_MYEAR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_CAMSK_MTENMON_Pos) | - ((uint32_t)u8IsMMsk << RTC_CAMSK_MMON_Pos) | - ((uint32_t)u8IsTenDMsk << RTC_CAMSK_MTENDAY_Pos) | - ((uint32_t)u8IsDMsk << RTC_CAMSK_MDAY_Pos); -} - -/** - * @brief Set RTC Alarm Time Mask Function - * - * @param[in] u8IsTenHMsk 1: enable 10-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsHMsk 1: enable 1-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Min digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Min digit alarm mask; 0: disabled. - * @param[in] u8IsTenSMsk 1: enable 10-Sec digit alarm mask; 0: disabled. - * @param[in] u8IsSMsk 1: enable 1-Sec digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm time mask function. - */ -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk) -{ - RTC->TAMSK = ((uint32_t)u8IsTenHMsk << RTC_TAMSK_MTENHR_Pos) | - ((uint32_t)u8IsHMsk << RTC_TAMSK_MHR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_TAMSK_MTENMIN_Pos) | - ((uint32_t)u8IsMMsk << RTC_TAMSK_MMIN_Pos) | - ((uint32_t)u8IsTenSMsk << RTC_TAMSK_MTENSEC_Pos) | - ((uint32_t)u8IsSMsk << RTC_TAMSK_MSEC_Pos); -} - -/** - * @brief Get Day of the Week - * - * @param None - * - * @retval 0 Sunday - * @retval 1 Monday - * @retval 2 Tuesday - * @retval 3 Wednesday - * @retval 4 Thursday - * @retval 5 Friday - * @retval 6 Saturday - * - * @details This API is used to get day of the week of current RTC date. - */ -uint32_t RTC_GetDayOfWeek(void) -{ - return (RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk); -} - -/** - * @brief Set RTC Tick Period Time - * - * @param[in] u32TickSelection It is used to set the RTC tick period time for Periodic Time Tick request. \n - * It consists of: - * - \ref RTC_TICK_1_SEC : Time tick is 1 second - * - \ref RTC_TICK_1_2_SEC : Time tick is 1/2 second - * - \ref RTC_TICK_1_4_SEC : Time tick is 1/4 second - * - \ref RTC_TICK_1_8_SEC : Time tick is 1/8 second - * - \ref RTC_TICK_1_16_SEC : Time tick is 1/16 second - * - \ref RTC_TICK_1_32_SEC : Time tick is 1/32 second - * - \ref RTC_TICK_1_64_SEC : Time tick is 1/64 second - * - \ref RTC_TICK_1_128_SEC : Time tick is 1/128 second - * - * @return None - * - * @details This API is used to set RTC tick period time for each tick interrupt. - */ -void RTC_SetTickPeriod(uint32_t u32TickSelection) -{ - RTC->TICK = (RTC->TICK & ~RTC_TICK_TICK_Msk) | u32TickSelection; -} - -/** - * @brief Enable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - \ref RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP1IEN_Msk : Tamper 1 or Pair 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP3IEN_Msk : Tamper 3 or Pair 1 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP5IEN_Msk : Tamper 5 or Pair 2 Pin Event Detection interrupt - * - * @return None - * - * @details This API is used to enable the specify RTC interrupt function. - */ -void RTC_EnableInt(uint32_t u32IntFlagMask) -{ - RTC->INTEN |= u32IntFlagMask; -} - -/** - * @brief Disable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - \ref RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP1IEN_Msk : Tamper 1 or Pair 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP3IEN_Msk : Tamper 3 or Pair 1 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP5IEN_Msk : Tamper 5 or Pair 2 Pin Event Detection interrupt - * - * @return None - * - * @details This API is used to disable the specify RTC interrupt function. - */ -void RTC_DisableInt(uint32_t u32IntFlagMask) -{ - RTC->INTEN &= ~u32IntFlagMask; - RTC->INTSTS = u32IntFlagMask; -} - -/** - * @brief Enable Spare Registers Access - * - * @param None - * - * @return None - * - * @details This API is used to enable the spare registers 0~19 can be accessed. - */ -void RTC_EnableSpareAccess(void) -{ - RTC->SPRCTL |= RTC_SPRCTL_SPRRWEN_Msk; -} - -/** - * @brief Disable Spare Register - * - * @param None - * - * @return None - * - * @details This API is used to disable the spare register 0~19 cannot be accessed. - */ -void RTC_DisableSpareRegister(void) -{ - RTC->SPRCTL &= ~RTC_SPRCTL_SPRRWEN_Msk; -} - -/** - * @brief Static Tamper Detect - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref RTC_TAMPER0_SELECT - * - \ref RTC_TAMPER1_SELECT - * - \ref RTC_TAMPER2_SELECT - * - \ref RTC_TAMPER3_SELECT - * - \ref RTC_TAMPER4_SELECT - * - \ref RTC_TAMPER5_SELECT - * - * @param[in] u32DetecLevel Tamper pin detection level select. Possible options are - * - \ref RTC_TAMPER_HIGH_LEVEL_DETECT - * - \ref RTC_TAMPER_LOW_LEVEL_DETECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref RTC_TAMPER_DEBOUNCE_ENABLE - * - \ref RTC_TAMPER_DEBOUNCE_DISABLE - * - * @return None - * - * @details This API is used to enable the tamper pin detect function with specify trigger condition. - * User need disable dynamic tamper function before use this API. - */ -void RTC_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - u32Reg = RTC->TAMPCTL; - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | (u32DetecLevel << RTC_TAMPCTL_TAMP0LV_Pos) | - (u32DebounceEn << RTC_TAMPCTL_TAMP0DBEN_Pos)); - - for (i = 0UL; i < (uint32_t)RTC_MAX_TAMPER_PIN_NUM; i++) - { - if (u32TamperSelect & (0x1UL << i)) - { - u32Reg &= ~((RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP0LV_Msk | RTC_TAMPCTL_TAMP0DBEN_Msk) << (i * 4UL)); - u32Reg |= (u32TmpReg << (i * 4UL)); - } - } - - RTC->TAMPCTL = u32Reg; - -} - -/** - * @brief Static Tamper Disable - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref RTC_TAMPER0_SELECT - * - \ref RTC_TAMPER1_SELECT - * - \ref RTC_TAMPER2_SELECT - * - \ref RTC_TAMPER3_SELECT - * - \ref RTC_TAMPER4_SELECT - * - \ref RTC_TAMPER5_SELECT - * - * @return None - * - * @details This API is used to disable the static tamper pin detect. - */ -void RTC_StaticTamperDisable(uint32_t u32TamperSelect) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - u32Reg = RTC->TAMPCTL; - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk); - - for (i = 0UL; i < (uint32_t)RTC_MAX_TAMPER_PIN_NUM; i++) - { - if (u32TamperSelect & (0x1UL << i)) - { - u32Reg &= ~(u32TmpReg << (i * 4UL)); - } - } - - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Detect - * - * @param[in] u32PairSel Tamper pin detection enable. Possible options are - * - \ref RTC_PAIR0_SELECT - * - \ref RTC_PAIR1_SELECT - * - \ref RTC_PAIR2_SELECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref RTC_TAMPER_DEBOUNCE_ENABLE - * - \ref RTC_TAMPER_DEBOUNCE_DISABLE - * - * @param[in] u32Pair1Source Dynamic Pair 1 Input Source Select - * 0: Pair 1 source select tamper 2 - * 1: Pair 1 source select tamper 0 - * - * @param[in] u32Pair2Source Dynamic Pair 2 Input Source Select - * 0: Pair 2 source select tamper 4 - * 1: Pair 2 source select tamper 0 - * - * @return None - * - * @details This API is used to enable the dynamic tamper. - */ -void RTC_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2Debounce, u32Tamper4Debounce; - - u32Reg = RTC->TAMPCTL; - u32Reg &= ~(RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_TAMP2EN_Msk | - RTC_TAMPCTL_TAMP3EN_Msk | RTC_TAMPCTL_TAMP4EN_Msk | RTC_TAMPCTL_TAMP5EN_Msk); - - u32Tamper2Debounce = u32Reg & RTC_TAMPCTL_TAMP2DBEN_Msk; - u32Tamper4Debounce = u32Reg & RTC_TAMPCTL_TAMP4DBEN_Msk; - - u32Reg &= ~(RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_TAMP2EN_Msk | - RTC_TAMPCTL_TAMP3EN_Msk | RTC_TAMPCTL_TAMP4EN_Msk | RTC_TAMPCTL_TAMP5EN_Msk); - u32Reg &= ~(RTC_TAMPCTL_DYN1ISS_Msk | RTC_TAMPCTL_DYN2ISS_Msk); - u32Reg |= ((u32Pair1Source & 0x1UL) << RTC_TAMPCTL_DYN1ISS_Pos) | ((u32Pair2Source & 0x1UL) << RTC_TAMPCTL_DYN2ISS_Pos); - - if (u32DebounceEn) - { - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | - RTC_TAMPCTL_TAMP0DBEN_Msk | RTC_TAMPCTL_TAMP1DBEN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - } - else - { - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - } - - for (i = 0UL; i < (uint32_t)RTC_MAX_PAIR_NUM; i++) - { - if (u32PairSel & (0x1UL << i)) - { - u32Reg &= ~((RTC_TAMPCTL_TAMP0DBEN_Msk | RTC_TAMPCTL_TAMP1DBEN_Msk) << (i * 8UL)); - u32Reg |= (u32TmpReg << (i * 8UL)); - } - } - - if ((u32Pair1Source) && (u32PairSel & (uint32_t)RTC_PAIR1_SELECT)) - { - u32Reg &= ~RTC_TAMPCTL_TAMP2EN_Msk; - u32Reg |= u32Tamper2Debounce; - } - - if ((u32Pair2Source) && (u32PairSel & (uint32_t)RTC_PAIR2_SELECT)) - { - u32Reg &= ~RTC_TAMPCTL_TAMP4EN_Msk; - u32Reg |= u32Tamper4Debounce; - } - - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Disable - * - * @param[in] u32PairSel Tamper pin detection enable. Possible options are - * - \ref RTC_PAIR0_SELECT - * - \ref RTC_PAIR1_SELECT - * - \ref RTC_PAIR2_SELECT - * - * @return None - * - * @details This API is used to disable the dynamic tamper. - */ -void RTC_DynamicTamperDisable(uint32_t u32PairSel) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2En = 0UL, u32Tamper4En = 0UL; - - u32Reg = RTC->TAMPCTL; - - if ((u32Reg & (uint32_t)RTC_TAMPCTL_DYN1ISS_Msk) && (u32PairSel & (uint32_t)RTC_PAIR1_SELECT)) - { - u32Tamper2En = u32Reg & RTC_TAMPCTL_TAMP2EN_Msk; - } - - if ((u32Reg & (uint32_t)RTC_TAMPCTL_DYN2ISS_Msk) && (u32PairSel & (uint32_t)RTC_PAIR2_SELECT)) - { - u32Tamper4En = u32Reg & RTC_TAMPCTL_TAMP4EN_Msk; - } - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - - for (i = 0UL; i < (uint32_t)RTC_MAX_PAIR_NUM; i++) - { - if (u32PairSel & (0x1UL << i)) - { - u32Reg &= ~(u32TmpReg << ((i * 8UL))); - } - } - - u32Reg |= (u32Tamper2En | u32Tamper4En); - - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Configure Dynamic Tamper - * - * @param[in] u32ChangeRate The dynamic tamper output change rate - * - \ref RTC_2POW10_CLK - * - \ref RTC_2POW11_CLK - * - \ref RTC_2POW12_CLK - * - \ref RTC_2POW13_CLK - * - \ref RTC_2POW14_CLK - * - \ref RTC_2POW15_CLK - * - \ref RTC_2POW16_CLK - * - \ref RTC_2POW17_CLK - * - * @param[in] u32SeedReload Reload new seed or not - * 0: not reload new seed - * 1: reload new seed - * - * @param[in] u32RefPattern Reference pattern - * - \ref RTC_REF_RANDOM_PATTERN - * - \ref RTC_REF_SEED_VALUE - * - * @param[in] u32Seed Seed Value (0x0 ~ 0xFFFFFFFF) - * - * @return None - * - * @details This API is used to config dynamic tamper setting. - */ -void RTC_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed) -{ - uint32_t u32Reg; - - u32Reg = RTC->TAMPCTL; - - u32Reg &= ~(RTC_TAMPCTL_DYNSRC_Msk | RTC_TAMPCTL_SEEDRLD_Msk | RTC_TAMPCTL_DYNRATE_Msk); - - u32Reg |= (u32ChangeRate) | ((u32SeedReload & 0x1UL) << RTC_TAMPCTL_SEEDRLD_Pos) | - (u32RefPattern << RTC_TAMPCTL_DYNSRC_Pos); - - RTC->TAMPSEED = u32Seed; /* need set seed value before re-loade seed */ - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Set RTC Clock Source - * - * @param[in] u32ClkSrc u32ClkSrc is the RTC clock source. It could be - * - \ref RTC_CLOCK_SOURCE_LXT - * - \ref RTC_CLOCK_SOURCE_LIRC - * - * @retval RTC_CLOCK_SOURCE_LXT - * @retval RTC_CLOCK_SOURCE_LIRC - * - * @details This API is used to get the setting of RTC clock source. - * User must to enable the selected clock source by themselves executing perform this API. - */ -uint32_t RTC_SetClockSource(uint32_t u32ClkSrc) -{ - uint32_t u32TrimDefault = inpw(SYS_BASE + 0x14Cul); - - if (u32ClkSrc == RTC_CLOCK_SOURCE_LXT) - { - /* RTC clock source is external LXT */ - RTC->LXTCTL &= ~RTC_LXTCTL_RTCCKSEL_Msk; - - return RTC_CLOCK_SOURCE_LXT; - } - else if (u32ClkSrc == RTC_CLOCK_SOURCE_LIRC) - { - /* RTC clock source is LIRC */ - RTC->LXTCTL |= RTC_LXTCTL_RTCCKSEL_Msk; - - return RTC_CLOCK_SOURCE_LIRC; - } - else - { - /* Set the default RTC clock source is LIRC */ - RTC->LXTCTL |= RTC_LXTCTL_RTCCKSEL_Msk; - - return RTC_CLOCK_SOURCE_LIRC; - } -} - -/** - * @brief Set RTC GPIO Operation Mode - * - * @param[in] u32Pin The single pin of GPIO-F port. - * It could be 4~11, which means PF.4~PF.11. - * @param[in] u32Mode Operation mode. It could be - * - \ref RTC_IO_MODE_INPUT - * - \ref RTC_IO_MODE_OUTPUT - * - \ref RTC_IO_MODE_OPEN_DRAIN - * - \ref RTC_IO_MODE_QUASI - * @param[in] u32DigitalCtl The digital input path control of specified pin. It could be - * - \ref RTC_IO_DIGITAL_ENABLE - * - \ref RTC_IO_DIGITAL_DISABLE - * @param[in] u32PullCtl The pull-up or pull-down control of specified pin. It could be - * - \ref RTC_IO_PULL_UP_DOWN_DISABLE - * - \ref RTC_IO_PULL_UP_ENABLE - * - \ref RTC_IO_PULL_DOWN_ENABLE - * @param[in] u32OutputLevel The I/O output level. 0: output low; 1: output high. - * - * @return None - * - * @details This function is used to set specified GPIO operation mode controlled by RTC module. - */ -void RTC_SetGPIOMode(uint32_t u32PFPin, uint32_t u32Mode, uint32_t u32DigitalCtl, uint32_t u32PullCtl, uint32_t u32OutputLevel) -{ - uint32_t u32Offset; - - if ((u32PFPin == 4) || (u32PFPin == 5) || (u32PFPin == 6) || (u32PFPin == 7)) - { - u32Offset = u32PFPin - 4; - - RTC_SET_IOCTL_BY_RTC(); - - RTC->GPIOCTL0 = (RTC->GPIOCTL0 & ~(0x3FUL << (u32Offset * 8))) | - (u32Mode << (u32Offset * 8)) | - (u32OutputLevel << ((u32Offset * 8) + 2)) | - (u32DigitalCtl << ((u32Offset * 8) + 3)) | - (u32PullCtl << ((u32Offset * 8) + 4)); - } - - if ((u32PFPin == 8) || (u32PFPin == 9) || (u32PFPin == 10) || (u32PFPin == 11)) - { - u32Offset = u32PFPin - 8; - - RTC_SET_IOCTL_BY_RTC(); - - RTC->GPIOCTL1 = (RTC->GPIOCTL1 & ~(0x3FUL << (u32Offset * 8))) | - (u32Mode << (u32Offset * 8)) | - (u32OutputLevel << ((u32Offset * 8) + 2)) | - (u32DigitalCtl << ((u32Offset * 8) + 3)) | - (u32PullCtl << ((u32Offset * 8) + 4)); - } -} - -/** - * @brief Set RTC GPIO Output Level - * - * @param[in] u32Pin The single pin of GPIO-F port. - * It could be 4~11, which means PF.4~PF.11. - * @param[in] u32OutputLevel The I/O output level. 0: output low; 1: output high. - * - * @return None - * - * @details This function is used to set GPIO output level by RTC module. - */ -void RTC_SetGPIOLevel(uint32_t u32PFPin, uint32_t u32OutputLevel) -{ - uint32_t u32Offset; - - if ((u32PFPin == 4) || (u32PFPin == 5) || (u32PFPin == 6) || (u32PFPin == 7)) - { - u32Offset = u32PFPin - 4; - - RTC->GPIOCTL0 = (RTC->GPIOCTL0 & ~(0x4UL << (u32Offset * 8))) | - (u32OutputLevel << ((u32Offset * 8) + 2)); - } - - if ((u32PFPin == 8) || (u32PFPin == 9) || (u32PFPin == 10) || (u32PFPin == 11)) - { - u32Offset = u32PFPin - 8; - - RTC->GPIOCTL1 = (RTC->GPIOCTL1 & ~(0x4UL << (u32Offset * 8))) | - (u32OutputLevel << ((u32Offset * 8) + 2)); - } -} - -/**@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group RTC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sc.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sc.c deleted file mode 100644 index 817b78ca8f9..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sc.c +++ /dev/null @@ -1,477 +0,0 @@ -/**************************************************************************//** - * @file sc.c - * @version V3.00 - * @brief Smartcard(SC) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/* Below are variables used locally by SC driver and does not want to parse by doxygen unless HIDDEN_SYMBOLS is defined */ -/** @cond HIDDEN_SYMBOLS */ -static uint32_t g_u32CardStateIgnore[SC_INTERFACE_NUM] = {0UL, 0UL, 0UL}; - -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_FUNCTIONS SC Exported Functions - @{ -*/ - -/** - * @brief Indicates specified smartcard slot status - * - * @param[in] sc The pointer of smartcard module. - * - * @return Card insert status - * @retval TRUE Card insert - * @retval FALSE Card remove - * - * @details This function is used to check if specified smartcard slot is presented. - */ -uint32_t SC_IsCardInserted(SC_T *sc) -{ - uint32_t u32Ret; - - /* put conditions into two variable to remove IAR compilation warning */ - uint32_t cond1 = ((sc->STATUS & SC_STATUS_CDPINSTS_Msk) >> SC_STATUS_CDPINSTS_Pos); - uint32_t cond2 = ((sc->CTL & SC_CTL_CDLV_Msk) >> SC_CTL_CDLV_Pos); - - if ((sc == SC0) && (g_u32CardStateIgnore[0] == 1UL)) - { - u32Ret = (uint32_t)TRUE; - } - else if ((sc == SC1) && (g_u32CardStateIgnore[1] == 1UL)) - { - u32Ret = (uint32_t)TRUE; - } - else if ((sc == SC2) && (g_u32CardStateIgnore[2] == 1UL)) - { - u32Ret = (uint32_t)TRUE; - } - else if (cond1 != cond2) - { - u32Ret = (uint32_t)FALSE; - } - else - { - u32Ret = (uint32_t)TRUE; - } - - return u32Ret; -} - -/* - * @brief Reset the Tx and Rx FIFO of smartcard module - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details This function reset both transmit and receive FIFO of specified smartcard module. - */ -void SC_ClearFIFO(SC_T *sc) -{ - uint32_t u32TimeOutCount = SC_TIMEOUT; - - while ((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk); -} - -/** - * @brief Disable specified smartcard module - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details This function disable specified smartcard module, and force all transition to IDLE state. - */ -void SC_Close(SC_T *sc) -{ - uint32_t u32TimeOutCount; - - sc->INTEN = 0UL; - - u32TimeOutCount = SC_TIMEOUT; - while ((sc->PINCTL & SC_PINCTL_SYNC_Msk) == SC_PINCTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - sc->PINCTL = 0UL; - sc->ALTCTL = 0UL; - - u32TimeOutCount = SC_TIMEOUT; - while ((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - sc->CTL = 0UL; -} - -/** - * @brief Initialized smartcard module - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32CardDet Card detect polarity, select the SC_CD pin state which indicates card absent. Could be: - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * -\ref SC_PIN_STATE_IGNORE, no card detect pin, always assumes card present. - * @param[in] u32PWR Power off polarity, select the SC_PWR pin state which could set smartcard VCC to high level. Could be: - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * - * @return None - * - * @details This function initialized smartcard module. - */ -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR) -{ - uint32_t u32Reg = 0UL, u32Intf, u32TimeOutCount; - - if (sc == SC0) - { - u32Intf = 0UL; - } - else if (sc == SC1) - { - u32Intf = 1UL; - } - else - { - u32Intf = 2UL; - } - - if (u32CardDet != SC_PIN_STATE_IGNORE) - { - u32Reg = u32CardDet ? 0UL : SC_CTL_CDLV_Msk; - g_u32CardStateIgnore[u32Intf] = 0UL; - } - else - { - g_u32CardStateIgnore[u32Intf] = 1UL; - } - sc->PINCTL = u32PWR ? 0UL : SC_PINCTL_PWRINV_Msk; - u32TimeOutCount = SC_TIMEOUT; - while ((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_TMRSEL_Msk | u32Reg; -} - -/** - * @brief Reset specified smartcard module - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @details This function reset specified smartcard module to its default state for activate smartcard. - */ -void SC_ResetReader(SC_T *sc) -{ - uint32_t u32Intf, u32TimeOutCount; - - if (sc == SC0) - { - u32Intf = 0UL; - } - else if (sc == SC1) - { - u32Intf = 1UL; - } - else - { - u32Intf = 2UL; - } - - /* Reset FIFO, enable auto de-activation while card removal */ - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk | SC_ALTCTL_ADACEN_Msk); - /* Set Rx trigger level to 1 character, longest card detect debounce period, disable error retry (EMV ATR does not use error retry) */ - u32TimeOutCount = SC_TIMEOUT; - while ((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - sc->CTL &= ~(SC_CTL_RXTRGLV_Msk | - SC_CTL_CDDBSEL_Msk | - SC_CTL_TXRTY_Msk | - SC_CTL_TXRTYEN_Msk | - SC_CTL_RXRTY_Msk | - SC_CTL_RXRTYEN_Msk); - u32TimeOutCount = SC_TIMEOUT; - while ((sc->CTL & SC_CTL_SYNC_Msk) == SC_CTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - /* Enable auto convention, and all three smartcard internal timers */ - sc->CTL |= SC_CTL_AUTOCEN_Msk | SC_CTL_TMRSEL_Msk; - /* Disable Rx timeout */ - sc->RXTOUT = 0UL; - /* 372 clocks per ETU by default */ - sc->ETUCTL = 371UL; - - /* Enable necessary interrupt for smartcard operation */ - if (g_u32CardStateIgnore[u32Intf]) /* Do not enable card detect interrupt if card present state ignore */ - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_ACERRIEN_Msk); - } - else - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_ACERRIEN_Msk | - SC_INTEN_CDIEN_Msk); - } -} - -/** - * @brief Set Block Guard Time (BGT) - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32BGT Block guard time using ETU as unit, valid range are between 1 ~ 32. - * - * @return None - * - * @details This function is used to configure block guard time (BGT) of specified smartcard module. - */ -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT) -{ - sc->CTL = (sc->CTL & ~SC_CTL_BGT_Msk) | ((u32BGT - 1UL) << SC_CTL_BGT_Pos); -} - -/** - * @brief Set Character Guard Time (CGT) - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32CGT Character guard time using ETU as unit, valid range are between 11 ~ 267. - * - * @return None - * - * @details This function is used to configure character guard time (CGT) of specified smartcard module. - * @note Before using this API, user should set the correct stop bit length first. - */ -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT) -{ - /* CGT is "START bit" + "8-bits" + "Parity bit" + "STOP bit(s)" + "EGT counts" */ - u32CGT -= ((sc->CTL & SC_CTL_NSB_Msk) == SC_CTL_NSB_Msk) ? 11UL : 12UL; - sc->EGT = u32CGT; -} - -/** - * @brief Stop all smartcard timer - * - * @param[in] sc The pointer of smartcard module. - * - * @return None - * - * @note This function stop the timers within specified smartcard module, \b not timer module. - */ -void SC_StopAllTimer(SC_T *sc) -{ - uint32_t u32TimeOutCount = SC_TIMEOUT; - - while ((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0) break; - } - sc->ALTCTL &= ~(SC_ALTCTL_CNTEN0_Msk | SC_ALTCTL_CNTEN1_Msk | SC_ALTCTL_CNTEN2_Msk); -} - -/** - * @brief Configure and start smartcard timer - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32TimerNum Timer to start. Valid values are 0, 1, 2. - * @param[in] u32Mode Timer operating mode, valid values are: - * - \ref SC_TMR_MODE_0 - * - \ref SC_TMR_MODE_1 - * - \ref SC_TMR_MODE_2 - * - \ref SC_TMR_MODE_3 - * - \ref SC_TMR_MODE_4 - * - \ref SC_TMR_MODE_5 - * - \ref SC_TMR_MODE_6 - * - \ref SC_TMR_MODE_7 - * - \ref SC_TMR_MODE_8 - * - \ref SC_TMR_MODE_F - * @param[in] u32ETUCount Timer timeout duration, ETU based. For timer 0, valid range are between 1 ~ 0x1000000 ETUs. - * For timer 1 and timer 2, valid range are between 1 ~ 0x100 ETUs. - * - * @return None - * - * @note This function start the timer within specified smartcard module, \b not timer module. - * @note Depend on the timer operating mode, timer may not start counting immediately and starts when condition match. - */ -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount) -{ - uint32_t u32Reg = u32Mode | (SC_TMRCTL0_CNT_Msk & (u32ETUCount - 1UL)); - uint32_t u32TimeOutCount = 0UL; - - u32TimeOutCount = SC_TIMEOUT; - while ((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - if (u32TimerNum == 0UL) - { - u32TimeOutCount = SC_TIMEOUT; - while ((sc->TMRCTL0 & SC_TMRCTL0_SYNC_Msk) == SC_TMRCTL0_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - sc->TMRCTL0 = u32Reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN0_Msk; - } - else if (u32TimerNum == 1UL) - { - u32TimeOutCount = SC_TIMEOUT; - while ((sc->TMRCTL1 & SC_TMRCTL1_SYNC_Msk) == SC_TMRCTL1_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - sc->TMRCTL1 = u32Reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - u32TimeOutCount = SC_TIMEOUT; - while ((sc->TMRCTL2 & SC_TMRCTL2_SYNC_Msk) == SC_TMRCTL2_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - sc->TMRCTL2 = u32Reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief Stop a smartcard timer - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32TimerNum Timer to stop. Valid values are 0, 1, 2. - * - * @return None - * - * @note This function stop the timer within specified smartcard module, \b not timer module. - */ -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum) -{ - uint32_t u32TimeOutCount = SC_TIMEOUT; - - while (sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - if (--u32TimeOutCount == 0UL) break; - } - - if (u32TimerNum == 0UL) /* timer 0 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN0_Msk; - } - else if (u32TimerNum == 1UL) /* timer 1 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief Get smartcard clock frequency - * - * @param[in] sc The pointer of smartcard module. - * - * @return Smartcard frequency in kHZ - * - * @details This function is used to get specified smartcard module clock frequency in kHz. - */ -uint32_t SC_GetInterfaceClock(SC_T *sc) -{ - uint32_t u32ClkSrc = 0, u32Num = 0, u32ClkFreq = __HIRC, u32Div = 0; - - /* Get smartcard module clock source and divider */ - if (sc == SC0) - { - u32Num = 0UL; - u32ClkSrc = CLK_GetModuleClockSource(SC0_MODULE); - u32Div = CLK_GetModuleClockDivider(SC0_MODULE); - } - else if (sc == SC1) - { - u32Num = 1UL; - u32ClkSrc = CLK_GetModuleClockSource(SC1_MODULE); - u32Div = CLK_GetModuleClockDivider(SC1_MODULE); - } - else if (sc == SC2) - { - u32Num = 2UL; - u32ClkSrc = CLK_GetModuleClockSource(SC2_MODULE); - u32Div = CLK_GetModuleClockDivider(SC2_MODULE); - } - else - { - u32ClkFreq = 0UL; - } - - if (u32ClkFreq != 0UL) - { - /* Get smartcard module clock */ - if (u32ClkSrc == 0UL) - { - u32ClkFreq = __HXT; - } - else if (u32ClkSrc == 1UL) - { - u32ClkFreq = CLK_GetPLLClockFreq(); - } - else if (u32ClkSrc == 2UL) - { - if (u32Num == 1UL) - { - u32ClkFreq = CLK_GetPCLK1Freq(); - } - else - { - u32ClkFreq = CLK_GetPCLK0Freq(); - } - } - else - { - u32ClkFreq = __HIRC; - } - - u32ClkFreq /= (u32Div + 1UL) * 1000UL; - } - - return u32ClkFreq; -} - -/**@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SC_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_scuart.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_scuart.c deleted file mode 100644 index 843ec8f6628..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_scuart.c +++ /dev/null @@ -1,286 +0,0 @@ -/**************************************************************************//** - * @file scuart.c - * @version V3.00 - * @brief Smartcard UART mode (SCUART) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - -int32_t g_SCUART_i32ErrCode = 0; /*!< SCUART global error code */ - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/** - * @brief Disable smartcard interface - * - * @param sc The pointer of smartcard module. - * - * @return None - * - * @details The function is used to disable smartcard interface UART mode. - */ -void SCUART_Close(SC_T *sc) -{ - sc->INTEN = 0UL; - sc->UARTCTL = 0UL; - sc->CTL = 0UL; -} - -/** @cond HIDDEN_SYMBOLS */ -/** - * @brief Returns module clock of specified SC interface - * - * @param[in] sc The pointer of smartcard module. - * - * @return Module clock of specified SC interface. - */ -static uint32_t SCUART_GetClock(SC_T *sc) -{ - uint32_t u32ClkSrc = 0, u32Num = 0, u32ClkFreq = __HIRC, u32Div = 0; - - /* Get smartcard module clock source and divider */ - if (sc == SC0) - { - u32Num = 0UL; - u32ClkSrc = CLK_GetModuleClockSource(SC0_MODULE); - u32Div = CLK_GetModuleClockDivider(SC0_MODULE); - } - else if (sc == SC1) - { - u32Num = 1UL; - u32ClkSrc = CLK_GetModuleClockSource(SC1_MODULE); - u32Div = CLK_GetModuleClockDivider(SC1_MODULE); - } - else if (sc == SC2) - { - u32Num = 2UL; - u32ClkSrc = CLK_GetModuleClockSource(SC2_MODULE); - u32Div = CLK_GetModuleClockDivider(SC2_MODULE); - } - else - { - u32ClkFreq = 0UL; - } - - if (u32ClkFreq != 0UL) - { - /* Get smartcard module clock */ - if (u32ClkSrc == 0UL) - { - u32ClkFreq = __HXT; - } - else if (u32ClkSrc == 1UL) - { - u32ClkFreq = CLK_GetPLLClockFreq(); - } - else if (u32ClkSrc == 2UL) - { - if (u32Num == 1UL) - { - u32ClkFreq = CLK_GetPCLK1Freq(); - } - else - { - u32ClkFreq = CLK_GetPCLK0Freq(); - } - } - else - { - u32ClkFreq = __HIRC; - } - - u32ClkFreq /= (u32Div + 1UL); - } - - return u32ClkFreq; -} -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Enable smartcard module UART mode and set baudrate - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Baudrate Target baudrate of smartcard UART module. - * - * @return Actual baudrate of smartcard UART mode - * - * @details This function use to enable smartcard module UART mode and set baudrate. - * - * @note This function configures character width to 8 bits, 1 stop bit, and no parity. - * And can use \ref SCUART_SetLineConfig function to update these settings. - * The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_Open(SC_T *sc, uint32_t u32Baudrate) -{ - uint32_t u32ClkFreq = SCUART_GetClock(sc), u32Div; - - /* Calculate divider for target baudrate */ - u32Div = (u32ClkFreq + (u32Baudrate >> 1) - 1UL) / u32Baudrate - 1UL; - - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk; /* Enable smartcard interface and stop bit = 1 */ - sc->UARTCTL = SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk; /* Enable UART mode, disable parity and 8 bit per character */ - sc->ETUCTL = u32Div; - - return (u32ClkFreq / (u32Div + 1UL)); -} - -/** - * @brief Read Rx data from Rx FIFO - * - * @param[in] sc The pointer of smartcard module. - * @param[in] pu8RxBuf The buffer to store receive the data. - * @param[in] u32ReadBytes Target number of characters to receive - * - * @return Actual character number reads to buffer - * - * @details The function is used to read data from Rx FIFO. - * - * @note This function does not block and return immediately if there's no data available. - */ -uint32_t SCUART_Read(SC_T *sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count; - - for (u32Count = 0UL; u32Count < u32ReadBytes; u32Count++) - { - if (SCUART_GET_RX_EMPTY(sc) == SC_STATUS_RXEMPTY_Msk) - { - /* No data available */ - break; - } - /* Get data from FIFO */ - pu8RxBuf[u32Count] = (uint8_t)SCUART_READ(sc); - } - - return u32Count; -} - -/** - * @brief Configure smartcard UART mode line setting - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32Baudrate Target baudrate of smartcard UART mode. If this value is 0, SC UART baudrate will not change. - * @param[in] u32DataWidth The data length, could be: - * - \ref SCUART_CHAR_LEN_5 - * - \ref SCUART_CHAR_LEN_6 - * - \ref SCUART_CHAR_LEN_7 - * - \ref SCUART_CHAR_LEN_8 - * @param[in] u32Parity The parity setting, could be: - * - \ref SCUART_PARITY_NONE - * - \ref SCUART_PARITY_ODD - * - \ref SCUART_PARITY_EVEN - * @param[in] u32StopBits The stop bit length, could be: - * - \ref SCUART_STOP_BIT_1 - * - \ref SCUART_STOP_BIT_2 - * - * @return Actual baudrate of smartcard UART mode - * - * @details The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_SetLineConfig(SC_T *sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits) -{ - uint32_t u32ClkFreq = SCUART_GetClock(sc), u32Div; - - if (u32Baudrate == 0UL) - { - /* Keep original baudrate setting */ - u32Div = sc->ETUCTL & SC_ETUCTL_ETURDIV_Msk; - } - else - { - /* Calculate divider for target baudrate */ - u32Div = ((u32ClkFreq + (u32Baudrate >> 1) - 1UL) / u32Baudrate) - 1UL; - sc->ETUCTL = u32Div; - } - - sc->CTL = u32StopBits | SC_CTL_SCEN_Msk; /* Set stop bit */ - sc->UARTCTL = u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk; /* Set character width and parity */ - - return (u32ClkFreq / (u32Div + 1UL)); -} - -/** - * @brief Set receive timeout count - * - * @param[in] sc The pointer of smartcard module. - * @param[in] u32TOC Rx time-out counter, using baudrate as counter unit. Valid range are 0~0x1FF, - * set this value to 0 will disable time-out counter. - * - * @return None - * - * @details The time-out counter resets and starts counting whenever the Rx buffer received a - * new data word. Once the counter decrease to 1 and no new data is received or CPU - * does not read any data from FIFO, a receiver time-out interrupt will be generated. - */ -void SCUART_SetTimeoutCnt(SC_T *sc, uint32_t u32TOC) -{ - sc->RXTOUT = u32TOC; -} - -/** - * @brief Write data into transmit FIFO to send data out - * - * @param[in] sc The pointer of smartcard module. - * @param[in] pu8TxBuf The buffer containing data to send to transmit FIFO. - * @param[in] u32WriteBytes Number of data to send. - * - * @return Actual number of data put into SCUART Tx FIFO - * - * @details This function is used to write data into Tx FIFO to send data out. - * - * @note This function sets g_SCUART_i32ErrCode to SCUART_TIMEOUT_ERR if the Tx FIFO - * blocks longer than expected. - */ -uint32_t SCUART_Write(SC_T *sc, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count; - /* Baudrate * (start bit + 8-bit data + 1-bit parity + 2-bit stop) */ - uint32_t u32Delay = (SystemCoreClock / SCUART_GetClock(sc)) * sc->ETUCTL * 12, i; - - g_SCUART_i32ErrCode = 0; - for (u32Count = 0UL; u32Count != u32WriteBytes; u32Count++) - { - i = 0; - /* Wait 'til FIFO not full */ - while (SCUART_GET_TX_FULL(sc)) - { - /* Block longer than expected. Maybe some interrupt disable SCUART clock? */ - if (i++ > u32Delay) - { - g_SCUART_i32ErrCode = SCUART_TIMEOUT_ERR; - return u32Count; - } - } - /* Write 1 byte to FIFO */ - sc->DAT = pu8TxBuf[u32Count]; - } - return u32Count; -} - - -/**@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group SCUART_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sdh.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sdh.c deleted file mode 100644 index 5ab07e62f09..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sdh.c +++ /dev/null @@ -1,1454 +0,0 @@ -/**************************************************************************//** - * @file SDH.c - * @version V1.00 - * @brief SDH driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - -int32_t g_SDH_i32ErrCode = 0; /*!< SDH global error code */ - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ -#define SDH_BLOCK_SIZE 512ul - -/** @cond HIDDEN_SYMBOLS */ - -/* global variables */ -/* For response R3 (such as ACMD41, CRC-7 is invalid; but SD controller will still */ -/* calculate CRC-7 and get an error result, software should ignore this error and clear SDISR [CRC_IF] flag */ -/* _sd_uR3_CMD is the flag for it. 1 means software should ignore CRC-7 error */ - -static uint32_t _SDH0_ReferenceClock, _SDH1_ReferenceClock; - -#ifdef __ICCARM__ - #pragma data_alignment = 4 - static uint8_t _SDH0_ucSDHCBuffer[512]; - static uint8_t _SDH1_ucSDHCBuffer[512]; -#else - static uint8_t _SDH0_ucSDHCBuffer[512] __attribute__((aligned(4))); - static uint8_t _SDH1_ucSDHCBuffer[512] __attribute__((aligned(4))); -#endif - -SDH_INFO_T SD0, SD1; - -void SDH_CheckRB(SDH_T *sdh) -{ - uint32_t u32TimeOutCount1, u32TimeOutCount2; - - g_SDH_i32ErrCode = 0; - u32TimeOutCount2 = TIMEOUT_SDH; - while (1) - { - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - u32TimeOutCount1 = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - if (--u32TimeOutCount1 == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - if ((sdh->INTSTS & SDH_INTSTS_DAT0STS_Msk) == SDH_INTSTS_DAT0STS_Msk) - { - break; - } - if (--u32TimeOutCount2 == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } -} - - -uint32_t SDH_SDCommand(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf, val = 0ul; - SDH_INFO_T *pSD; - uint32_t u32TimeOutCount = TIMEOUT_SDH; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | (SDH_CTL_COEN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_COEN_Msk) == SDH_CTL_COEN_Msk) - { - if (pSD->IsCardInsert == 0ul) - { - val = SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - return val; -} - - -uint32_t SDH_SDCmdAndRsp(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg, uint32_t ntickCount) -{ - volatile uint32_t buf; - SDH_INFO_T *pSD; - uint32_t u32TimeOutCount = TIMEOUT_SDH; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk); - sdh->CTL = buf; - - if (ntickCount > 0ul) - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (ntickCount-- == 0ul) - { - sdh->CTL |= SDH_CTL_CTLRST_Msk; /* reset SD engine */ - return 2ul; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - else - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - } - - if (pSD->R7Flag) - { - uint32_t tmp0 = 0ul, tmp1 = 0ul; - tmp1 = sdh->RESP1 & 0xfful; - tmp0 = sdh->RESP0 & 0xful; - if ((tmp1 != 0x55ul) && (tmp0 != 0x01ul)) - { - pSD->R7Flag = 0ul; - return SDH_CMD8_ERROR; - } - } - - if (!pSD->R3Flag) - { - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return Successful; - } - else - { - return SDH_CRC7_ERROR; - } - } - else - { - /* ignore CRC error for R3 case */ - pSD->R3Flag = 0ul; - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return Successful; - } -} - - -uint32_t SDH_Swap32(uint32_t val) -{ - uint32_t buf; - - buf = val; - val <<= 24; - val |= (buf << 8) & 0xff0000ul; - val |= (buf >> 8) & 0xff00ul; - val |= (buf >> 24) & 0xfful; - return val; -} - -/* Get 16 bytes CID or CSD */ -uint32_t SDH_SDCmdAndRsp2(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg, uint32_t puR2ptr[]) -{ - uint32_t i, buf; - uint32_t tmpBuf[5]; - SDH_INFO_T *pSD; - uint32_t u32TimeOutCount = TIMEOUT_SDH; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_R2EN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_R2EN_Msk) == SDH_CTL_R2EN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) - { - for (i = 0ul; i < 5ul; i++) - { - tmpBuf[i] = SDH_Swap32(sdh->FB[i]); - } - for (i = 0ul; i < 4ul; i++) - { - puR2ptr[i] = ((tmpBuf[i] & 0x00fffffful) << 8) | ((tmpBuf[i + 1ul] & 0xff000000ul) >> 24); - } - } - else - { - return SDH_CRC7_ERROR; - } - return Successful; -} - - -uint32_t SDH_SDCmdAndRspDataIn(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf; - SDH_INFO_T *pSD; - uint32_t u32TimeOutCount; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | - (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - - sdh->CTL = buf; - - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_DIEN_Msk) == SDH_CTL_DIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) - { - /* check CRC7 */ - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) - { - /* check CRC16 */ - return SDH_CRC16_ERROR; - } - return 0ul; -} - -/* there are 8 bits for divider0, maximum is 256 */ -#define SDH_CLK_DIV0_MAX 256ul - -void SDH_Set_clock(SDH_T *sdh, uint32_t sd_clock_khz) -{ - uint32_t rate, div1; - static uint32_t u32SD_ClkSrc = 0ul, u32SD_PwrCtl = 0ul; - - uint32_t u32RegLockBackup = SYS_IsRegLocked(); - SYS_UnlockReg(); - - /* initial state, clock source use HIRC */ - if (sd_clock_khz <= 400ul) - { - u32SD_PwrCtl = CLK->PWRCTL; - if ((u32SD_PwrCtl & CLK_PWRCTL_HIRCEN_Msk) != 0x4ul) - { - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - } - - if (sdh == SDH0) - { - u32SD_ClkSrc = (CLK->CLKSEL0 & CLK_CLKSEL0_SDH0SEL_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH0SEL_Msk) | CLK_CLKSEL0_SDH0SEL_HIRC; - _SDH0_ReferenceClock = (__HIRC / 1000ul); - } - else - { - u32SD_ClkSrc = (CLK->CLKSEL0 & CLK_CLKSEL0_SDH1SEL_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH1SEL_Msk) | CLK_CLKSEL0_SDH1SEL_HIRC; - _SDH1_ReferenceClock = (__HIRC / 1000ul); - } - } - /* transfer state, clock source use sys_init() */ - else - { - CLK->PWRCTL = u32SD_PwrCtl; - if (sdh == SDH0) - { - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH0SEL_Msk) | u32SD_ClkSrc; - if (u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_HXT) - { - _SDH0_ReferenceClock = (CLK_GetHXTFreq() / 1000ul); - } - else if (u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_HIRC) - { - _SDH0_ReferenceClock = (__HIRC / 1000ul); - } - else if (u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_PLL_DIV2) - { - _SDH0_ReferenceClock = ((CLK_GetPLLClockFreq() >> 1) / 1000ul); - } - else if (u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_HCLK) - { - _SDH0_ReferenceClock = (CLK_GetHCLKFreq() / 1000ul); - } - } - else - { - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH1SEL_Msk) | u32SD_ClkSrc; - if (u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_HXT) - { - _SDH1_ReferenceClock = (CLK_GetHXTFreq() / 1000ul); - } - else if (u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_HIRC) - { - _SDH1_ReferenceClock = (__HIRC / 1000ul); - } - else if (u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_PLL_DIV2) - { - _SDH1_ReferenceClock = ((CLK_GetPLLClockFreq() >> 1) / 1000ul); - } - else if (u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_HCLK) - { - _SDH1_ReferenceClock = (CLK_GetHCLKFreq() / 1000ul); - } - } - - if (sd_clock_khz >= 50000ul) - { - sd_clock_khz = 50000ul; - } - } - if (sdh == SDH0) - { - rate = _SDH0_ReferenceClock / sd_clock_khz; - - /* choose slower clock if system clock cannot divisible by wanted clock */ - if ((_SDH0_ReferenceClock % sd_clock_khz) != 0ul) - { - rate++; - } - } - else - { - rate = _SDH1_ReferenceClock / sd_clock_khz; - - /* choose slower clock if system clock cannot divisible by wanted clock */ - if ((_SDH1_ReferenceClock % sd_clock_khz) != 0ul) - { - rate++; - } - } - - if (rate >= SDH_CLK_DIV0_MAX) - { - rate = SDH_CLK_DIV0_MAX; - } - - /*--- calculate the second divider CLKDIV0[SDHOST_N]*/ - div1 = (rate - 1ul) & 0xFFul; - - /*--- setup register */ - if (sdh == SDH0) - { - CLK->CLKDIV0 &= ~CLK_CLKDIV0_SDH0DIV_Msk; - CLK->CLKDIV0 |= (div1 << CLK_CLKDIV0_SDH0DIV_Pos); - } - else - { - CLK->CLKDIV3 &= ~CLK_CLKDIV3_SDH1DIV_Msk; - CLK->CLKDIV3 |= (div1 << CLK_CLKDIV3_SDH1DIV_Pos); - } - - if (u32RegLockBackup) - { - /* Lock protected registers */ - SYS_LockReg(); - } - - return; -} - -uint32_t SDH_CardDetection(SDH_T *sdh) -{ - uint32_t i, val = TRUE; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - - if ((sdh->INTEN & SDH_INTEN_CDSRC_Msk) == SDH_INTEN_CDSRC_Msk) /* Card detect pin from GPIO */ - { - if ((sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) == SDH_INTSTS_CDSTS_Msk) /* Card remove */ - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - else - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - } - else if ((sdh->INTEN & SDH_INTEN_CDSRC_Msk) != SDH_INTEN_CDSRC_Msk) - { - sdh->CTL |= SDH_CTL_CLKKEEP_Msk; - for (i = 0ul; i < 5000ul; i++) - { - } - - if ((sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) == SDH_INTSTS_CDSTS_Msk) /* Card insert */ - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - else - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - - sdh->CTL &= ~SDH_CTL_CLKKEEP_Msk; - } - - return val; -} - -uint32_t SDH_Init(SDH_T *sdh) -{ - uint32_t volatile i, status; - uint32_t resp; - uint32_t CIDBuffer[4]; - uint32_t volatile u32CmdTimeOut; - SDH_INFO_T *pSD; - uint32_t u32TimeOutCount; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - /* set the clock to 300KHz */ - SDH_Set_clock(sdh, 300ul); - - /* power ON 74 clock */ - sdh->CTL |= SDH_CTL_CLK74OEN_Msk; - - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_CLK74OEN_Msk) == SDH_CTL_CLK74OEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - SDH_SDCommand(sdh, 0ul, 0ul); /* reset all cards */ - for (i = 0x1000ul; i > 0ul; i--) - { - } - - /* initial SDHC */ - pSD->R7Flag = 1ul; - u32CmdTimeOut = 0xFFFFFul; - - i = SDH_SDCmdAndRsp(sdh, 8ul, 0x00000155ul, u32CmdTimeOut); - if (i == Successful) - { - /* SD 2.0 */ - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 2.7v-3.6v */ - resp = sdh->RESP0; - - u32TimeOutCount = TIMEOUT_SDH; - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_SD_HIGH; - } - else - { - pSD->CardType = SDH_TYPE_SD_LOW; - } - } - else - { - /* SD 1.1 */ - SDH_SDCommand(sdh, 0ul, 0ul); /* reset all cards */ - for (i = 0x100ul; i > 0ul; i--) - { - } - - i = SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - if (i == 2ul) /* MMC memory */ - { - - SDH_SDCommand(sdh, 0ul, 0ul); /* reset */ - for (i = 0x100ul; i > 0ul; i--) - { - } - - pSD->R3Flag = 1ul; - - if (SDH_SDCmdAndRsp(sdh, 1ul, 0x40ff8000ul, u32CmdTimeOut) != 2ul) /* eMMC memory */ - { - resp = sdh->RESP0; - u32TimeOutCount = TIMEOUT_SDH; - while ((resp & 0x00800000ul) != 0x00800000ul) - { - /* check if card is ready */ - pSD->R3Flag = 1ul; - - SDH_SDCmdAndRsp(sdh, 1ul, 0x40ff8000ul, u32CmdTimeOut); /* high voltage */ - resp = sdh->RESP0; - - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_EMMC; - } - else - { - pSD->CardType = SDH_TYPE_MMC; - } - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_ERR_DEVICE; - } - } - else if (i == 0ul) /* SD Memory */ - { - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - u32TimeOutCount = TIMEOUT_SDH; - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - pSD->CardType = SDH_TYPE_SD_LOW; - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_INIT_ERROR; - } - } - - if (pSD->CardType != SDH_TYPE_UNKNOWN) - { - SDH_SDCmdAndRsp2(sdh, 2ul, 0x00ul, CIDBuffer); - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - if ((status = SDH_SDCmdAndRsp(sdh, 3ul, 0x10000ul, 0ul)) != Successful) /* set RCA */ - { - return status; - } - pSD->RCA = 0x10000ul; - } - else - { - if ((status = SDH_SDCmdAndRsp(sdh, 3ul, 0x00ul, 0ul)) != Successful) /* get RCA */ - { - return status; - } - else - { - pSD->RCA = (sdh->RESP0 << 8) & 0xffff0000; - } - } - } - return Successful; -} - - -uint32_t SDH_SwitchToHighSpeed(SDH_T *sdh, SDH_INFO_T *pSD) -{ - uint32_t volatile status = 0ul; - uint16_t current_comsumption, busy_status0; - uint32_t u32TimeOutCount = TIMEOUT_SDH; - - g_SDH_i32ErrCode = 0; - - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; - - if ((status = SDH_SDCmdAndRspDataIn(sdh, 6ul, 0x00ffff01ul)) != Successful) - { - return Fail; - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - busy_status0 = (uint16_t)(*(pSD->dmabuf + 28)) << 8; - busy_status0 |= (uint16_t)(*(pSD->dmabuf + 29)); - - if (!busy_status0) /* function ready */ - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; /* 512 bit */ - - if ((status = SDH_SDCmdAndRspDataIn(sdh, 6ul, 0x80ffff01ul)) != Successful) - { - return Fail; - } - - /* function change timing: 8 clocks */ - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - return Successful; - } - else - { - return Fail; - } -} - - -uint32_t SDH_SelectCardType(SDH_T *sdh) -{ - uint32_t volatile status = 0ul; - uint32_t param; - SDH_INFO_T *pSD; - uint32_t u32TimeOutCount; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* if SD card set 4bit */ - if (pSD->CardType == SDH_TYPE_SD_HIGH) - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 0x07ul; /* 64 bit */ - sdh->DMACTL |= SDH_DMACTL_DMARST_Msk; - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == 0x2) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, 51ul, 0x00ul)) != Successful) - { - return status; - } - - if ((*pSD->dmabuf & 0xful) == 0x2ul) - { - status = SDH_SwitchToHighSpeed(sdh, pSD); - if (status == Successful) - { - /* divider */ - SDH_Set_clock(sdh, SDHC_FREQ); - } - } - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, 0x02ul, 0ul)) != Successful) /* set bus width */ - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if (pSD->CardType == SDH_TYPE_SD_LOW) - { - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 0x07ul; - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, 51ul, 0x00ul)) != Successful) - { - return status; - } - - /* set data bus width. ACMD6 for SD card, SDCR_DBW for host. */ - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, 0x02ul, 0ul)) != Successful) - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - - if (pSD->CardType == SDH_TYPE_MMC) - { - sdh->CTL &= ~SDH_CTL_DBW_Msk; - } - - /*--- sent CMD6 to MMC card to set bus width to 4 bits mode */ - /* set CMD6 argument Access field to 3, Index to 183, Value to 1 (4-bit mode) */ - param = (3ul << 24) | (183ul << 16) | (1ul << 8); - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, param, 0ul)) != Successful) - { - return status; - } - SDH_CheckRB(sdh); - - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - - } - - if ((status = SDH_SDCmdAndRsp(sdh, 16ul, SDH_BLOCK_SIZE, 0ul)) != Successful) - { - return status; - } - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - sdh->INTEN |= SDH_INTEN_BLKDIEN_Msk; - - return Successful; -} - -void SDH_Get_SD_info(SDH_T *sdh) -{ - unsigned int R_LEN, C_Size, MULT, size; - uint32_t Buffer[4]; - //unsigned char *ptr; - SDH_INFO_T *pSD; - uint32_t u32TimeOutCount = TIMEOUT_SDH; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - SDH_SDCmdAndRsp2(sdh, 9ul, pSD->RCA, Buffer); - - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - /* for MMC/eMMC card */ - if ((Buffer[0] & 0xc0000000) == 0xc0000000) - { - /* CSD_STRUCTURE [127:126] is 3 */ - /* CSD version depend on EXT_CSD register in eMMC v4.4 for card size > 2GB */ - SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul); - - //ptr = (uint8_t *)((uint32_t)_SDH_ucSDHCBuffer ); - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 511ul; /* read 512 bytes for EXT_CSD */ - - if (SDH_SDCmdAndRspDataIn(sdh, 8ul, 0x00ul) == Successful) - { - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - pSD->totalSectorN = (uint32_t)(*(pSD->dmabuf + 215)) << 24; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 214)) << 16; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 213)) << 8; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 212)); - pSD->diskSize = pSD->totalSectorN / 2ul; - } - } - else - { - /* CSD version v1.0/1.1/1.2 in eMMC v4.4 spec for card size <= 2GB */ - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size + 1ul) * (1ul << (MULT + 2ul)) * (1ul << R_LEN); - - pSD->diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - else - { - if ((Buffer[0] & 0xc0000000) != 0x0ul) - { - C_Size = ((Buffer[1] & 0x0000003ful) << 16) | ((Buffer[2] & 0xffff0000ul) >> 16); - size = (C_Size + 1ul) * 512ul; /* Kbytes */ - - pSD->diskSize = size; - pSD->totalSectorN = size << 1; - } - else - { - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size + 1ul) * (1ul << (MULT + 2ul)) * (1ul << R_LEN); - - pSD->diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - pSD->sectorSize = (int)512; -} - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief This function use to reset SD function and select card detection source and pin. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32CardDetSrc Select card detection pin from GPIO or DAT3 pin. ( \ref CardDetect_From_GPIO / \ref CardDetect_From_DAT3) - * - * @return None - */ -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc) -{ - uint32_t u32TimeOutCount; - - g_SDH_i32ErrCode = 0; - - sdh->DMACTL = SDH_DMACTL_DMARST_Msk; - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == SDH_DMACTL_DMARST_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - sdh->DMACTL = SDH_DMACTL_DMAEN_Msk; - - sdh->GCTL = SDH_GCTL_GCTLRST_Msk | SDH_GCTL_SDEN_Msk; - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->GCTL & SDH_GCTL_GCTLRST_Msk) == SDH_GCTL_GCTLRST_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if (sdh == SDH0) - { - NVIC_EnableIRQ(SDH0_IRQn); - memset(&SD0, 0, sizeof(SDH_INFO_T)); - SD0.dmabuf = _SDH0_ucSDHCBuffer; - } - else if (sdh == SDH1) - { - NVIC_EnableIRQ(SDH1_IRQn); - memset(&SD1, 0, sizeof(SDH_INFO_T)); - SD1.dmabuf = _SDH1_ucSDHCBuffer; - } - else - { - } - - sdh->GCTL = SDH_GCTL_SDEN_Msk; - - if ((u32CardDetSrc & CardDetect_From_DAT3) == CardDetect_From_DAT3) - { - sdh->INTEN &= ~SDH_INTEN_CDSRC_Msk; - } - else - { - sdh->INTEN |= SDH_INTEN_CDSRC_Msk; - } - sdh->INTEN |= SDH_INTEN_CDIEN_Msk; - - sdh->CTL |= SDH_CTL_CTLRST_Msk; - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_CTLRST_Msk) == SDH_CTL_CTLRST_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } -} - -/** - * @brief This function use to initial SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return None - * - * @details This function is used to initial SD card. - * SD initial state needs 400KHz clock output, driver will use HIRC for SD initial clock source. - * And then switch back to the user's setting. - */ -uint32_t SDH_Probe(SDH_T *sdh) -{ - uint32_t val; - - sdh->GINTEN = 0ul; - sdh->CTL &= ~SDH_CTL_SDNWR_Msk; - sdh->CTL |= 0x09ul << SDH_CTL_SDNWR_Pos; /* set SDNWR = 9 */ - sdh->CTL &= ~SDH_CTL_BLKCNT_Msk; - sdh->CTL |= 0x01ul << SDH_CTL_BLKCNT_Pos; /* set BLKCNT = 1 */ - sdh->CTL &= ~SDH_CTL_DBW_Msk; /* SD 1-bit data bus */ - - if (!(SDH_CardDetection(sdh))) - { - return SDH_NO_SD_CARD; - } - - if ((val = SDH_Init(sdh)) != 0ul) - { - return val; - } - - /* divider */ - if ((SD0.CardType == SDH_TYPE_MMC) || (SD1.CardType == SDH_TYPE_MMC)) - { - SDH_Set_clock(sdh, MMC_FREQ); - } - else - { - SDH_Set_clock(sdh, SD_FREQ); - } - SDH_Get_SD_info(sdh); - - if ((val = SDH_SelectCardType(sdh)) != 0ul) - { - return val; - } - - return 0ul; -} - -/** - * @brief This function use to read data from SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[out] pu8BufAddr The buffer to receive the data from SD card. - * @param[in] u32StartSec The start read sector address. - * @param[in] u32SecCount The the read sector number of data - * - * @return None - */ -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE, buf; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - uint32_t blksize = SDH_BLOCK_SIZE; - uint32_t u32TimeOutCount; - - SDH_INFO_T *pSD; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - SDH_CheckRB(sdh); - - sdh->BLEN = blksize - 1ul; /* the actual byte count is equal to (SDBLEN+1) */ - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * blksize; - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - - loop = u32SecCount / 255ul; - for (i = 0ul; i < loop; i++) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & ~SDH_CTL_CMDCODE_Msk; - reg = reg | 0xff0000ul; /* set BLK_CNT to 255 */ - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg | (18ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - u32TimeOutCount = TIMEOUT_SDH; - while (!pSD->DataReadyFlag) - { - if (pSD->DataReadyFlag) - { - break; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & (~SDH_CTL_CMDCODE_Msk); - reg = reg & (~SDH_CTL_BLKCNT_Msk); - reg |= (loop << 16); /* setup SDCR_BLKCNT */ - - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg | (18ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - u32TimeOutCount = TIMEOUT_SDH; - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - if (SDH_SDCmdAndRsp(sdh, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - return Successful; -} - - -/** - * @brief This function use to write data to SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] pu8BufAddr The buffer to send the data to SD card. - * @param[in] u32StartSec The start write sector address. - * @param[in] u32SecCount The the write sector number of data. - * - * @return \ref SDH_SELECT_ERROR : u32SecCount is zero. \n - * \ref SDH_NO_SD_CARD : SD card be removed. \n - * \ref SDH_CRC_ERROR : CRC error happen. \n - * \ref SDH_CRC7_ERROR : CRC7 error happen. \n - * \ref Successful : Write data to SD card success. - */ -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - uint32_t u32TimeOutCount; - - SDH_INFO_T *pSD; - - g_SDH_i32ErrCode = 0; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* According to SD Spec v2.0, the write CMD block size MUST be 512, and the start address MUST be 512*n. */ - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * SDH_BLOCK_SIZE; /* set start address for SD CMD */ - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - loop = u32SecCount / 255ul; /* the maximum block count is 0xFF=255 for register SDCR[BLK_CNT] */ - for (i = 0ul; i < loop; i++) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & 0xff00c080; - reg = reg | 0xff0000ul; /* set BLK_CNT to 0xFF=255 */ - if (!bIsSendCmd) - { - sdh->CTL = reg | (25ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - u32TimeOutCount = TIMEOUT_SDH; - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = (sdh->CTL & 0xff00c080) | (loop << 16); - if (!bIsSendCmd) - { - sdh->CTL = reg | (25ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - u32TimeOutCount = TIMEOUT_SDH; - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - - if (SDH_SDCmdAndRsp(sdh, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - u32TimeOutCount = TIMEOUT_SDH; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SDH_i32ErrCode = SDH_TIMEOUT_ERR; - break; - } - } - - return Successful; -} - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_spi.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_spi.c deleted file mode 100644 index ff23cd345e3..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_spi.c +++ /dev/null @@ -1,2127 +0,0 @@ -/**************************************************************************//** - * @file spi.c - * @version V3.00 - * @brief M460 series SPI driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s); - -/** - * @brief This function make SPI module be ready to transfer. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32MasterSlave Decides the SPI module is operating in master mode or in slave mode. (SPI_SLAVE, SPI_MASTER) - * @param[in] u32SPIMode Decides the transfer timing. (SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a SPI transaction. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI peripheral clock. - * @details By default, the SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the SPI clock divider setting will be 0. - * The actual clock rate may be different from the target SPI clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the - * actual SPI clock rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPI_Open(SPI_T *spi, - uint32_t u32MasterSlave, - uint32_t u32SPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0U, u32Div, u32HCLKFreq, u32RetValue = 0U; - - /* Disable I2S mode */ - spi->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; - - if (u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32MasterSlave == SPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - } - else if (spi == SPI1) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - } - else if (spi == SPI2) - { - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI2SEL_Msk)) | CLK_CLKSEL3_SPI2SEL_PCLK1; - } - else if (spi == SPI3) - { - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI3SEL_Msk)) | CLK_CLKSEL3_SPI3SEL_PCLK0; - } - else if (spi == SPI4) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI4SEL_Msk)) | CLK_CLKSEL4_SPI4SEL_PCLK1; - } - else if (spi == SPI5) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI5SEL_Msk)) | CLK_CLKSEL4_SPI5SEL_PCLK0; - } - else if (spi == SPI6) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI6SEL_Msk)) | CLK_CLKSEL4_SPI6SEL_PCLK1; - } - else if (spi == SPI7) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI7SEL_Msk)) | CLK_CLKSEL4_SPI7SEL_PCLK0; - } - else if (spi == SPI8) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI8SEL_Msk)) | CLK_CLKSEL4_SPI8SEL_PCLK1; - } - else if (spi == SPI9) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI9SEL_Msk)) | CLK_CLKSEL4_SPI9SEL_PCLK0; - } - else - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI10SEL_Msk)) | CLK_CLKSEL4_SPI10SEL_PCLK1; - } - } - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI1) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI2) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI3) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI4) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI5) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI6) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI7) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI8) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI9) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0x1FF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - } - else /* For slave mode, force the SPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (spi == SPI1) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if (spi == SPI2) - { - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI2SEL_Msk)) | CLK_CLKSEL3_SPI2SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (spi == SPI3) - { - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI3SEL_Msk)) | CLK_CLKSEL3_SPI3SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if (spi == SPI4) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI4SEL_Msk)) | CLK_CLKSEL4_SPI4SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (spi == SPI5) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI5SEL_Msk)) | CLK_CLKSEL4_SPI5SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if (spi == SPI6) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI6SEL_Msk)) | CLK_CLKSEL4_SPI6SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (spi == SPI7) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI7SEL_Msk)) | CLK_CLKSEL4_SPI7SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if (spi == SPI8) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI8SEL_Msk)) | CLK_CLKSEL4_SPI8SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (spi == SPI9) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI9SEL_Msk)) | CLK_CLKSEL4_SPI9SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI10SEL_Msk)) | CLK_CLKSEL4_SPI10SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will reset SPI controller. - */ -void SPI_Close(SPI_T *spi) -{ - if (spi == SPI0) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - else if (spi == SPI1) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI1RST_Msk; - } - else if (spi == SPI2) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI2RST_Msk; - } - else if (spi == SPI3) - { - /* Reset SPI */ - SYS->IPRST2 |= SYS_IPRST2_SPI3RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI3RST_Msk; - } - else if (spi == SPI4) - { - /* Reset SPI */ - SYS->IPRST2 |= SYS_IPRST2_SPI4RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI4RST_Msk; - } - else if (spi == SPI5) - { - /* Reset SPI */ - SYS->IPRST3 |= SYS_IPRST3_SPI5RST_Msk; - SYS->IPRST3 &= ~SYS_IPRST3_SPI5RST_Msk; - } - else if (spi == SPI6) - { - /* Reset SPI */ - SYS->IPRST3 |= SYS_IPRST3_SPI6RST_Msk; - SYS->IPRST3 &= ~SYS_IPRST3_SPI6RST_Msk; - } - else if (spi == SPI7) - { - /* Reset SPI */ - SYS->IPRST3 |= SYS_IPRST3_SPI7RST_Msk; - SYS->IPRST3 &= ~SYS_IPRST3_SPI7RST_Msk; - } - else if (spi == SPI8) - { - /* Reset SPI */ - SYS->IPRST3 |= SYS_IPRST3_SPI8RST_Msk; - SYS->IPRST3 &= ~SYS_IPRST3_SPI8RST_Msk; - } - else if (spi == SPI9) - { - /* Reset SPI */ - SYS->IPRST3 |= SYS_IPRST3_SPI9RST_Msk; - SYS->IPRST3 &= ~SYS_IPRST3_SPI9RST_Msk; - } - else - { - /* Reset SPI */ - SYS->IPRST3 |= SYS_IPRST3_SPI10RST_Msk; - SYS->IPRST3 &= ~SYS_IPRST3_SPI10RST_Msk; - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI RX FIFO buffer. The RXEMPTY (SPI_STATUS[8]) will be set to 1. - */ -void SPI_ClearRxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI TX FIFO buffer. The TXEMPTY (SPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void SPI_ClearTxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void SPI_DisableAutoSS(SPI_T *spi) -{ - spi->SSCTL &= ~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (SPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (SPI_SS_ACTIVE_HIGH, SPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - spi->SSCTL = (spi->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | SPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the SPI bus clock. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target SPI bus clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the actual SPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - else if (spi == SPI1) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - else if (spi == SPI2) - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI2SEL_Msk)) | CLK_CLKSEL3_SPI2SEL_PCLK1; - else if (spi == SPI3) - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI3SEL_Msk)) | CLK_CLKSEL3_SPI3SEL_PCLK0; - else if (spi == SPI4) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI4SEL_Msk)) | CLK_CLKSEL4_SPI4SEL_PCLK1; - else if (spi == SPI5) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI5SEL_Msk)) | CLK_CLKSEL4_SPI5SEL_PCLK0; - else if (spi == SPI6) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI6SEL_Msk)) | CLK_CLKSEL4_SPI6SEL_PCLK1; - else if (spi == SPI7) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI7SEL_Msk)) | CLK_CLKSEL4_SPI7SEL_PCLK0; - else if (spi == SPI8) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI8SEL_Msk)) | CLK_CLKSEL4_SPI8SEL_PCLK1; - else if (spi == SPI9) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI9SEL_Msk)) | CLK_CLKSEL4_SPI9SEL_PCLK0; - else - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI10SEL_Msk)) | CLK_CLKSEL4_SPI10SEL_PCLK1; - } - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI1) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI2) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI3) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI4) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI5) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI6) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI7) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI8) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI9) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0x1FF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0x1FFU + 1U)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. If data width is 4 ~ 16 bits, it could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. If data width is 4 ~ 16 bits, it could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - spi->FIFOCTL = (spi->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of SPI bus clock. Only available in Master mode. - * @param[in] spi The pointer of the specified SPI module. - * @return Actual SPI bus clock frequency in Hz. - * @details This function will calculate the actual SPI bus clock rate according to the SPIxSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t SPI_GetBusClock(SPI_T *spi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc; - - /* Get DIVIDER setting */ - u32Div = (spi->CLKDIV & SPI_CLKDIV_DIVIDER_Msk) >> SPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI1) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI2) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI3) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC) - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC48M) - { - u32ClkSrc = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32ClkSrc = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (spi == SPI4) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI4SEL_Msk) == CLK_CLKSEL4_SPI4SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI5) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI5SEL_Msk) == CLK_CLKSEL4_SPI5SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI6) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI6SEL_Msk) == CLK_CLKSEL4_SPI6SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI7) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI7SEL_Msk) == CLK_CLKSEL4_SPI7SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI8) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI8SEL_Msk) == CLK_CLKSEL4_SPI8SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (spi == SPI9) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI9SEL_Msk) == CLK_CLKSEL4_SPI9SEL_PCLK0) - { - u32ClkSrc = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_PLL_DIV2) - { - u32ClkSrc = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI10SEL_Msk) == CLK_CLKSEL4_SPI10SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - /* Return SPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1U)); -} - -/** - * @brief Enable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL |= SPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL &= ~SPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get SPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = spi->STATUS & SPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_UNIT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSINACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVUR_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVBE_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_TXUF_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear SPI related interrupt flags specified by u32Mask parameter. - */ -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - if (u32Mask & SPI_UNIT_INT_MASK) - { - spi->STATUS = SPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & SPI_SSACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & SPI_SSINACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & SPI_SLVUR_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & SPI_SLVBE_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & SPI_TXUF_INT_MASK) - { - spi->STATUS = SPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & SPI_FIFO_RXOV_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & SPI_FIFO_RXTO_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get SPI status. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_BUSY_MASK - * - \ref SPI_RX_EMPTY_MASK - * - \ref SPI_RX_FULL_MASK - * - \ref SPI_TX_EMPTY_MASK - * - \ref SPI_TX_FULL_MASK - * - \ref SPI_TXRX_RESET_MASK - * - \ref SPI_SPIEN_STS_MASK - * - \ref SPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = spi->STATUS & SPI_STATUS_BUSY_Msk; - /* Check busy status */ - if ((u32Mask & SPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_BUSY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if ((u32Mask & SPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if ((u32Mask & SPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if ((u32Mask & SPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if ((u32Mask & SPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if ((u32Mask & SPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TXRX_RESET_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SPIENSTS_Msk; - /* Check SPIEN flag */ - if ((u32Mask & SPI_SPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SPIEN_STS_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SSLINE_Msk; - /* Check SPIx_SS line status */ - if ((u32Mask & SPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - -/** - * @brief Get SPI status2. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_SLVBENUM_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus2(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32TmpStatus; - uint32_t u32Number = 0U; - - u32TmpStatus = spi->STATUS2; - - /* Check effective bit number of uncompleted RX data status */ - if (u32Mask & SPI_SLVBENUM_MASK) - { - u32Number = (u32TmpStatus & SPI_STATUS2_SLVBENUM_Msk) >> SPI_STATUS2_SLVBENUM_Pos; - } - - return u32Number; -} - - -/** - * @brief This function is used to get I2S source clock frequency. - * @param[in] i2s The pointer of the specified I2S module. - * @return I2S source clock frequency (Hz). - * @details Return the source clock frequency according to the setting of SPIxSEL. - */ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s) -{ - uint32_t u32Freq; - - if (i2s == SPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL_DIV2) - { - u32Freq = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - u32Freq = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC) - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HIRC48M) - { - u32Freq = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32Freq = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (i2s == SPI1) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL_DIV2) - { - u32Freq = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - u32Freq = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC) - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HIRC48M) - { - u32Freq = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32Freq = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else if (i2s == SPI2) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PLL_DIV2) - { - u32Freq = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_PCLK1) - { - u32Freq = CLK_GetPCLK1Freq(); /* Clock source is PCLK1 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC) - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI2SEL_Msk) == CLK_CLKSEL3_SPI2SEL_HIRC48M) - { - u32Freq = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32Freq = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - else - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PLL_DIV2) - { - u32Freq = (CLK_GetPLLClockFreq() >> 1); /* Clock source is PLL/2 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_PCLK0) - { - u32Freq = CLK_GetPCLK0Freq(); /* Clock source is PCLK0 */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC) - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_SPI3SEL_Msk) == CLK_CLKSEL3_SPI3SEL_HIRC48M) - { - u32Freq = __HIRC48M; /* Clock source is RC48M */ - } - else - { - u32Freq = (CLK_GetPLLFNClockFreq() >> 1); /* Clock source is PLLFN/2 */ - } - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are listed below. - * - \ref SPII2S_MODE_MASTER - * - \ref SPII2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are listed below. - * - \ref SPII2S_DATABIT_8 - * - \ref SPII2S_DATABIT_16 - * - \ref SPII2S_DATABIT_24 - * - \ref SPII2S_DATABIT_32 - * @param[in] u32Channels Audio format. Valid values are listed below. - * - \ref SPII2S_MONO - * - \ref SPII2S_STEREO - * @param[in] u32DataFormat Data format. Valid values are listed below. - * - \ref SPII2S_FORMAT_I2S - * - \ref SPII2S_FORMAT_MSB - * - \ref SPII2S_FORMAT_PCMA - * - \ref SPII2S_FORMAT_PCMB - * @return Real sample rate of master mode or peripheral clock rate of slave mode. - * @details This function will reset SPI/I2S controller and configure I2S controller according to the input parameters. - * Set TX FIFO threshold to 2 and RX FIFO threshold to 1. Both the TX and RX functions will be enabled. - * The actual sample rate may be different from the target sample rate. The real sample rate will be returned for reference. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat) -{ - uint32_t u32Divider; - uint32_t u32BitRate, u32SrcClk, u32RetValue; - - /* Reset SPI/I2S */ - if (i2s == SPI0) - { - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - else if (i2s == SPI1) - { - SYS->IPRST1 |= SYS_IPRST1_SPI1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI1RST_Msk; - } - else if (i2s == SPI2) - { - SYS->IPRST1 |= SYS_IPRST1_SPI2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI2RST_Msk; - } - else - { - SYS->IPRST2 |= SYS_IPRST2_SPI3RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI3RST_Msk; - } - - /* Configure I2S controller */ - i2s->I2SCTL = u32MasterSlave | u32WordWidth | u32Channels | u32DataFormat; - /* Set TX FIFO threshold to 2 and RX FIFO threshold to 1 */ - SPII2S_SetFIFO(i2s, 2, 1); - - if (u32MasterSlave == SPII2S_MODE_MASTER) - { - /* Get the source clock rate */ - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - - /* Calculate the bit clock rate */ - u32BitRate = u32SampleRate * ((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1U) * 16U; - u32Divider = ((((u32SrcClk * 10UL / u32BitRate) >> 1U) + 5UL) / 10UL) - 1U; /* Round to the nearest integer */ - /* Set BCLKDIV setting */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_BCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_BCLKDIV_Pos); - /* Enable I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= SPI_I2SCLK_I2SMODE_Msk; - - /* Calculate bit clock rate */ - u32BitRate = u32SrcClk / ((u32Divider + 1U) * 2U); - /* Calculate real sample rate */ - u32SampleRate = u32BitRate / (((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1U) * 16U); - - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - - /* Return the real sample rate */ - u32RetValue = u32SampleRate; - } - else - { - /* Set BCLKDIV = 0 */ - i2s->I2SCLK &= ~SPI_I2SCLK_BCLKDIV_Msk; - - if (i2s == SPI0) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (i2s == SPI1) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if (i2s == SPI2) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI2SEL_Msk)) | CLK_CLKSEL3_SPI2SEL_PCLK1; - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_SPI3SEL_Msk)) | CLK_CLKSEL3_SPI3SEL_PCLK0; - /* Enable I2S slave mode and I2S mode for the frequency of peripheral clock. */ - i2s->I2SCLK |= (SPI_I2SCLK_I2SSLAVE_Msk | SPI_I2SCLK_I2SMODE_Msk); - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable I2S function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Disable I2S function. - */ -void SPII2S_Close(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; -} - -/** - * @brief Enable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * - \ref SPII2S_SLAVE_ERR_INT_MASK - * @return None - * @details This function enables the interrupt according to the u32Mask parameter. - */ -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Enable TX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Enable TX underflow interrupt flag */ - if ((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable right channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCIEN_Msk; - } - - /* Enable left channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_LZCIEN_Msk; - } - /* Enable bit clock loss interrupt flag */ - if ((u32Mask & SPII2S_SLAVE_ERR_INT_MASK) == SPII2S_SLAVE_ERR_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_SLVERRIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * - \ref SPII2S_SLAVE_ERR_INT_MASK - * @return None - * @details This function disables the interrupt according to the u32Mask parameter. - */ -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Disable TX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Disable TX underflow interrupt flag */ - if ((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable right channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCIEN_Msk; - } - - /* Disable left channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCIEN_Msk; - } - /* Disable bit clock loss interrupt flag */ - if ((u32Mask & SPII2S_SLAVE_ERR_INT_MASK) == SPII2S_SLAVE_ERR_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_SLVERRIEN_Msk; - } -} - -/** - * @brief Enable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32BusClock The target MCLK clock rate. - * @return Actual MCLK clock rate - * @details Set the master clock rate according to u32BusClock parameter and enable master clock output. - * The actual master clock rate may be different from the target master clock rate. The real master clock rate will be returned for reference. - */ -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock) -{ - uint32_t u32Divider; - uint32_t u32SrcClk, u32RetValue; - - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - if (u32BusClock == u32SrcClk) - { - u32Divider = 0U; - } - else - { - u32Divider = (u32SrcClk / u32BusClock) >> 1U; - /* MCLKDIV is a 7-bit width configuration. The maximum value is 0x7F. */ - if (u32Divider > 0x7FU) - { - u32Divider = 0x7FU; - } - } - - /* Write u32Divider to MCLKDIV (SPI_I2SCLK[6:0]) */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_MCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_MCLKDIV_Pos); - - /* Enable MCLK output */ - i2s->I2SCTL |= SPI_I2SCTL_MCLKEN_Msk; - - if (u32Divider == 0U) - { - u32RetValue = u32SrcClk; /* If MCLKDIV=0, master clock rate is equal to the source clock rate. */ - } - else - { - u32RetValue = ((u32SrcClk >> 1U) / u32Divider); /* If MCLKDIV>0, master clock rate = source clock rate / (MCLKDIV * 2) */ - } - - return u32RetValue; -} - -/** - * @brief Disable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Clear MCLKEN bit of SPI_I2SCTL register to disable master clock output. - */ -void SPII2S_DisableMCLK(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->FIFOCTL = (i2s->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_spim.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_spim.c deleted file mode 100644 index e961364a45b..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_spim.c +++ /dev/null @@ -1,1383 +0,0 @@ -/**************************************************************************//** - * @file spim.c - * @version V1.00 - * @brief M460 series SPIM driver - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPIM_Driver SPIM Driver - @{ -*/ - -int32_t g_SPIM_i32ErrCode = 0; /*!< SPIM global error code */ - -/** @addtogroup SPIM_EXPORTED_FUNCTIONS SPIM Exported Functions - @{ -*/ - - -/** @cond HIDDEN_SYMBOLS */ - - -#define ENABLE_DEBUG 0 - -#if ENABLE_DEBUG - #define SPIM_DBGMSG printf -#else - #define SPIM_DBGMSG(...) do { } while (0) /* disable debug */ -#endif - -static volatile uint8_t g_Supported_List[] = -{ - MFGID_WINBOND, - MFGID_MXIC, - MFGID_EON, - MFGID_ISSI, - MFGID_SPANSION -}; - -static void N_delay(int n); -static void SwitchNBitOutput(uint32_t u32NBit); -static void SwitchNBitInput(uint32_t u32NBit); -static void spim_write(uint8_t pu8TxBuf[], uint32_t u32NTx); -static void spim_read(uint8_t pu8RxBuf[], uint32_t u32NRx); -static void SPIM_WriteStatusRegister(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit); -static void SPIM_ReadStatusRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static void SPIM_ReadStatusRegister2(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static void SPIM_WriteStatusRegister2(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit); -static void SPIM_ReadStatusRegister3(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static void SPIM_ReadSecurityRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static int spim_is_write_done(uint32_t u32NBit); -static int spim_wait_write_done(uint32_t u32NBit); -static void spim_set_write_enable(int isEn, uint32_t u32NBit); -static void spim_enable_spansion_quad_mode(int isEn); -static void spim_eon_set_qpi_mode(int isEn); -static void SPIM_SPANSION_4Bytes_Enable(int isEn, uint32_t u32NBit); -static void SPIM_WriteInPageDataByIo(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int isSync); -static void SPIM_WriteInPageDataByPageWrite(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, - uint8_t pu8TxBuf[], uint32_t wrCmd, int isSync); - - -static void N_delay(int n) -{ - while (n-- > 0) - { - __NOP(); - } -} - -static void SwitchNBitOutput(uint32_t u32NBit) -{ - switch (u32NBit) - { - case 1UL: - SPIM_ENABLE_SING_OUTPUT_MODE(); /* 1-bit, Output. */ - break; - - case 2UL: - SPIM_ENABLE_DUAL_OUTPUT_MODE(); /* 2-bit, Output. */ - break; - - case 4UL: - SPIM_ENABLE_QUAD_OUTPUT_MODE(); /* 4-bit, Output. */ - break; - - default: - break; - } -} - -static void SwitchNBitInput(uint32_t u32NBit) -{ - switch (u32NBit) - { - case 1UL: - SPIM_ENABLE_SING_INPUT_MODE(); /* 1-bit, Input. */ - break; - - case 2UL: - SPIM_ENABLE_DUAL_INPUT_MODE(); /* 2-bit, Input. */ - break; - - case 4UL: - SPIM_ENABLE_QUAD_INPUT_MODE(); /* 4-bit, Input. */ - break; - - default: - break; - } -} - - -/** - * @brief Write data to SPI slave. - * @param pu8TxBuf Transmit buffer. - * @param u32NTx Number of bytes to transmit. - * @return None. - * @note This function sets g_SPIM_i32ErrCode to SPIM_TIMEOUT_ERR if waiting SPIM time-out. - */ -static void spim_write(uint8_t pu8TxBuf[], uint32_t u32NTx) -{ - uint32_t buf_idx = 0UL; - uint32_t u32TimeOutCount = 0UL; - - g_SPIM_i32ErrCode = 0; - - while (u32NTx) - { - uint32_t dataNum = 0UL, dataNum2; - - if (u32NTx >= 16UL) - { - dataNum = 4UL; - } - else if (u32NTx >= 12UL) - { - dataNum = 3UL; - } - else if (u32NTx >= 8UL) - { - dataNum = 2UL; - } - else if (u32NTx >= 4UL) - { - dataNum = 1UL; - } - - dataNum2 = dataNum; - while (dataNum2) - { - uint32_t tmp; - - memcpy(&tmp, &pu8TxBuf[buf_idx], 4U); - buf_idx += 4UL; - u32NTx -= 4UL; - - dataNum2 --; - /* *((__O uint32_t *) &SPIM->TX0 + dataNum2) = tmp; */ - SPIM->TX[dataNum2] = tmp; - } - - if (dataNum) - { - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(32UL); - SPIM_SET_DATA_NUM(dataNum); - SPIM_SET_GO(); - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - SPIM_WAIT_FREE() - { - if (--u32TimeOutCount == 0) - { - g_SPIM_i32ErrCode = SPIM_TIMEOUT_ERR; - break; - } - } - } - - if (u32NTx && (u32NTx < 4UL)) - { - uint32_t rnm, tmp; - - rnm = u32NTx; - memcpy(&tmp, &pu8TxBuf[buf_idx], u32NTx); - buf_idx += u32NTx; - u32NTx = 0UL; - SPIM->TX[0] = tmp; - - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(rnm * 8UL); - SPIM_SET_DATA_NUM(1UL); - SPIM_SET_GO(); - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - SPIM_WAIT_FREE() - { - if (--u32TimeOutCount == 0) - { - g_SPIM_i32ErrCode = SPIM_TIMEOUT_ERR; - break; - } - } - } - } -} - -/** - * @brief Read data from SPI slave. - * @param pu8TxBuf Receive buffer. - * @param u32NRx Size of receive buffer in bytes. - * @return None. - * @note This function sets g_SPIM_i32ErrCode to SPIM_TIMEOUT_ERR if waiting SPIM time-out. - */ -static void spim_read(uint8_t pu8RxBuf[], uint32_t u32NRx) -{ - uint32_t buf_idx = 0UL; - uint32_t u32TimeOutCount = 0UL; - - g_SPIM_i32ErrCode = 0; - - while (u32NRx) - { - uint32_t dataNum = 0UL; /* number of words */ - - if (u32NRx >= 16UL) - { - dataNum = 4UL; - } - else if (u32NRx >= 12UL) - { - dataNum = 3UL; - } - else if (u32NRx >= 8UL) - { - dataNum = 2UL; - } - else if (u32NRx >= 4UL) - { - dataNum = 1UL; - } - - if (dataNum) - { - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(32UL); - SPIM_SET_DATA_NUM(dataNum); - SPIM_SET_GO(); - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - SPIM_WAIT_FREE() - { - if (--u32TimeOutCount == 0) - { - g_SPIM_i32ErrCode = SPIM_TIMEOUT_ERR; - break; - } - } - } - - while (dataNum) - { - uint32_t tmp; - - tmp = SPIM->RX[dataNum - 1UL]; - memcpy(&pu8RxBuf[buf_idx], &tmp, 4U); - buf_idx += 4UL; - dataNum --; - u32NRx -= 4UL; - } - - if (u32NRx && (u32NRx < 4UL)) - { - uint32_t tmp; - - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(u32NRx * 8UL); - SPIM_SET_DATA_NUM(1UL); - SPIM_SET_GO(); - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - SPIM_WAIT_FREE() - { - if (--u32TimeOutCount == 0) - { - g_SPIM_i32ErrCode = SPIM_TIMEOUT_ERR; - break; - } - } - - tmp = SPIM->RX[0]; - memcpy(&pu8RxBuf[buf_idx], &tmp, u32NRx); - buf_idx += u32NRx; - u32NRx = 0UL; - } - } -} - -/** - * @brief Issue Read Status Register #1 command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadStatusRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSR}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Issue Write Status Register #1 command. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteStatusRegister(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_WRSR, 0x00U}; /* 1-byte Write Status Register #1 command + 1-byte data. */ - - cmdBuf[1] = dataBuf[0]; - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Issue Read Status Register #2 command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadStatusRegister2(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSR2}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Issue Winbond Write Status Register command. This command write both Status Register-1 - * and Status Register-2. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteStatusRegister2(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[3] = {OPCODE_WRSR, 0U, 0U}; - - cmdBuf[1] = dataBuf[0]; - cmdBuf[2] = dataBuf[1]; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -#if 0 /* not used */ -/** - * @brief Issue Write Status Register #3 command. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteStatusRegister3(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_WRSR3, 0x00U}; /* 1-byte Write Status Register #2 command + 1-byte data. */ - cmdBuf[1] = dataBuf[0]; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} -#endif - -/** - * @brief Issue Read Status Register #3 command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadStatusRegister3(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSR3}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -#if 0 /* not used */ -/** - * @brief Issue Write Security Register command. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteSecurityRegister(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_WRSCUR, 0x00U}; /* 1-byte Write Status Register #2 command + 1-byte data. */ - cmdBuf[1] = dataBuf[0]; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} -#endif - -/** - * @brief Issue Read Security Register command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadSecurityRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSCUR}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Check if Erase/Write is done. - * @return 0: Not done. 1: Done. - */ -static int spim_is_write_done(uint32_t u32NBit) -{ - uint8_t status[1]; - SPIM_ReadStatusRegister(status, sizeof(status), u32NBit); - return !(status[0] & SR_WIP); -} - -/** - * @brief Wait until Erase/Write done. - * @param u32NBit N-bit transmit/receive. - * @return 0 SPIM write done. - */ -static int spim_wait_write_done(uint32_t u32NBit) -{ - uint32_t count; - int ret = -1; - - for (count = 0UL; count < SystemCoreClock / 1000UL; count++) - { - if (spim_is_write_done(u32NBit)) - { - ret = 0; - break; - } - } - if (ret != 0) - { - SPIM_DBGMSG("spim_wait_write_done time-out!!\n"); - } - return ret; -} - -/** - * @brief Issue Write Enable/disable command. - * @param isEn Enable/disable. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void spim_set_write_enable(int isEn, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {0U}; /* 1-byte Write Enable command. */ - cmdBuf[0] = isEn ? OPCODE_WREN : OPCODE_WRDI; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Get SPIM serial clock. - * @return SPI serial clock. - * @details This function calculates the serial clock of SPI in Hz. - */ -uint32_t SPIM_GetSClkFreq(void) -{ - uint32_t clkDiv = SPIM_GET_CLOCK_DIVIDER(); - - return clkDiv ? SystemCoreClock / (clkDiv * 2U) : SystemCoreClock; -} - -/** - * @brief Initialize SPIM flash. - * @param clrWP Clear Write Protect or not. - * @return 0 Success. - * @return -1 Unrecognized manufacture ID or failed on reading manufacture ID. - */ -int SPIM_InitFlash(int clrWP) -{ - uint8_t idBuf[3]; - uint8_t cmdBuf[1]; - uint32_t i; - int32_t ret = -1; - - SPIM_SET_SS_ACTLVL(0); - - /* - * Because not sure in SPI or QPI mode, do QPI reset and then SPI reset. - */ - /* QPI Reset Enable */ - cmdBuf[0] = OPCODE_RSTEN; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_QUAD_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* QPI Reset */ - cmdBuf[0] = OPCODE_RST; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_QUAD_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* SPI ResetEnable */ - cmdBuf[0] = OPCODE_RSTEN; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_SING_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* SPI Reset */ - cmdBuf[0] = OPCODE_RST; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_SING_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (clrWP) - { - uint8_t dataBuf[] = {0x00U}; - - spim_set_write_enable(1, 1UL); /* Clear Block Protect. */ - SPIM_WriteStatusRegister(dataBuf, sizeof(dataBuf), 1U); - spim_wait_write_done(1UL); - } - - SPIM_ReadJedecId(idBuf, sizeof(idBuf), 1UL); - - /* printf("ID: 0x%x, 0x%x, px%x\n", idBuf[0], idBuf[1], idBuf[2]); */ - - for (i = 0UL; i < sizeof(g_Supported_List) / sizeof(g_Supported_List[0]); i++) - { - if (idBuf[0] == g_Supported_List[i]) - { - ret = 0; - } - } - if (ret != 0) - { - SPIM_DBGMSG("Flash initialize failed!! 0x%x\n", idBuf[0]); - } - return ret; -} - -/** - * @brief Issue JEDEC ID command. - * @param idBuf ID buffer. - * @param u32NRx Size of ID buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -void SPIM_ReadJedecId(uint8_t idBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = { OPCODE_RDID }; /* 1-byte JEDEC ID command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(idBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** @cond HIDDEN_SYMBOLS */ - -static void spim_enable_spansion_quad_mode(int isEn) -{ - uint8_t cmdBuf[3]; - uint8_t dataBuf[1], status1; - - cmdBuf[0] = 0x5U; /* Read Status Register-1 */ - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(1UL); - spim_read(dataBuf, sizeof(dataBuf)); - SPIM_SET_SS_EN(0); - /* SPIM_DBGMSG("SR1 = 0x%x\n", dataBuf[0]); */ - - status1 = dataBuf[0]; - - cmdBuf[0] = 0x35U; /* Read Configuration Register-1 */ - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(1UL); - spim_read(dataBuf, sizeof(dataBuf)); - SPIM_SET_SS_EN(0); - /* SPIM_DBGMSG("CR1 = 0x%x\n", dataBuf[0]); */ - - spim_set_write_enable(1, 1UL); - - cmdBuf[0] = 0x1U; /* Write register */ - cmdBuf[1] = status1; - - if (isEn) - { - cmdBuf[2] = dataBuf[0] | 0x2U; /* set QUAD */ - } - else - { - cmdBuf[2] = dataBuf[0] & ~0x2U; /* clear QUAD */ - } - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, 3UL); - SPIM_SET_SS_EN(0); - - spim_set_write_enable(0, 1UL); - - - cmdBuf[0] = 0x35U; /* Read Configuration Register-1 */ - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof(cmdBuf)); - SwitchNBitInput(1UL); - spim_read(dataBuf, sizeof(dataBuf)); - SPIM_SET_SS_EN(0); - - /* SPIM_DBGMSG("CR1 = 0x%x\n", dataBuf[0]); */ - N_delay(10000); -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Set Quad Enable/disable. - * @param isEn Enable/disable. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -void SPIM_SetQuadEnable(int isEn, uint32_t u32NBit) -{ - uint8_t idBuf[3]; - uint8_t dataBuf[2]; - - SPIM_ReadJedecId(idBuf, sizeof(idBuf), u32NBit); - - SPIM_DBGMSG("SPIM_SetQuadEnable - Flash ID is 0x%x\n", idBuf[0]); - - switch (idBuf[0]) - { - case MFGID_WINBOND: /* Winbond SPI flash */ - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register: 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); - if (isEn) - { - dataBuf[1] |= SR2_QE; - } - else - { - dataBuf[1] &= ~SR2_QE; - } - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - SPIM_WriteStatusRegister2(dataBuf, sizeof(dataBuf), u32NBit); - spim_wait_write_done(u32NBit); - - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register: 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); - break; - - case MFGID_MXIC: /* MXIC SPI flash. */ - case MFGID_EON: - case MFGID_ISSI: /* ISSI SPI flash. */ - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - dataBuf[0] = isEn ? SR_QE : 0U; - SPIM_WriteStatusRegister(dataBuf, sizeof(dataBuf), u32NBit); - spim_wait_write_done(u32NBit); - break; - - case MFGID_SPANSION: - spim_enable_spansion_quad_mode(isEn); - break; - - default: - break; - } -} - -/** - * @brief Enter/exit QPI mode. - * @param isEn Enable/disable. - * @return None. - */ -static void spim_eon_set_qpi_mode(int isEn) -{ - uint8_t cmdBuf[1]; /* 1-byte command. */ - - uint8_t status[1]; - SPIM_ReadStatusRegister(status, sizeof(status), 1UL); - SPIM_DBGMSG("Status: 0x%x\n", status[0]); - - if (isEn) /* Assume in SPI mode. */ - { - cmdBuf[0] = OPCODE_ENQPI; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - } - else /* Assume in QPI mode. */ - { - cmdBuf[0] = OPCODE_EXQPI; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(4UL); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - } - - SPIM_ReadStatusRegister(status, sizeof(status), 1UL); - SPIM_DBGMSG("Status: 0x%x\n", status[0]); -} - - -static void SPIM_SPANSION_4Bytes_Enable(int isEn, uint32_t u32NBit) -{ - uint8_t cmdBuf[2]; - uint8_t dataBuf[1]; - - cmdBuf[0] = OPCODE_BRRD; - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, 1UL); - SwitchNBitInput(1UL); - spim_read(dataBuf, 1UL); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - SPIM_DBGMSG("Bank Address register= 0x%x\n", dataBuf[0]); - - cmdBuf[0] = OPCODE_BRWR; - - if (isEn) - { - cmdBuf[1] = dataBuf[0] | 0x80U; /* set EXTADD */ - } - else - { - cmdBuf[1] = dataBuf[0] & ~0x80U; /* clear EXTADD */ - } - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(1UL); - spim_write(cmdBuf, 2UL); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** @cond HIDDEN_SYMBOLS */ - -/** - * @brief Query 4-byte address mode enabled or not. - * @param u32NBit N-bit transmit/receive. - * @return 0: 4-byte address mode disabled. 1: 4-byte address mode enabled. - */ -int SPIM_Is4ByteModeEnable(uint32_t u32NBit) -{ - int isEn = 0; - int isSupt = 0; - uint8_t idBuf[3]; - uint8_t dataBuf[1]; - - SPIM_ReadJedecId(idBuf, sizeof(idBuf), u32NBit); - - /* Based on Flash size, check if 4-byte address mode is supported. */ - switch (idBuf[0]) - { - case MFGID_WINBOND: - case MFGID_MXIC: - case MFGID_EON: - isSupt = (idBuf[2] < 0x19U) ? 0L : 1L; - break; - - case MFGID_ISSI: - isSupt = (idBuf[2] < 0x49U) ? 0L : 1L; - break; - - default: - break; - } - - if (isSupt != 0) - { - if (idBuf[0] == MFGID_WINBOND) - { - /* Winbond SPI flash. */ - SPIM_ReadStatusRegister3(dataBuf, sizeof(dataBuf), u32NBit); - isEn = !!(dataBuf[0] & SR3_ADR); - } - else if ((idBuf[0] == MFGID_MXIC) || (idBuf[0] == MFGID_EON)) - { - /* MXIC/EON SPI flash. */ - SPIM_ReadSecurityRegister(dataBuf, sizeof(dataBuf), u32NBit); - isEn = !!(dataBuf[0] & SCUR_4BYTE); - } - } - - return isEn; -} - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief Enter/Exit 4-byte address mode. - * @param isEn Enable/disable. - * @param u32NBit N-bit transmit/receive. - * @return 0 success - * -1 failed - */ -int SPIM_Enable_4Bytes_Mode(int isEn, uint32_t u32NBit) -{ - int isSupt = 0L, ret = -1; - uint8_t idBuf[3]; - uint8_t cmdBuf[1]; /* 1-byte Enter/Exit 4-Byte Mode command. */ - int32_t i32TimeOutCount = 0; - - SPIM_ReadJedecId(idBuf, sizeof(idBuf), u32NBit); - - /* Based on Flash size, check if 4-byte address mode is supported. */ - switch (idBuf[0]) - { - case MFGID_WINBOND: - isSupt = (idBuf[2] < 0x16U) ? 0L : 1L; - break; - case MFGID_MXIC: - case MFGID_EON: - isSupt = (idBuf[2] < 0x19U) ? 0L : 1L; - break; - - case MFGID_ISSI: - isSupt = (idBuf[2] < 0x49U) ? 0L : 1L; - break; - - case MFGID_SPANSION: - SPIM_SPANSION_4Bytes_Enable(isEn, u32NBit); - isSupt = 1L; - ret = 0L; - break; - - default: - break; - } - - if ((isSupt) && (idBuf[0] != MFGID_SPANSION)) - { - cmdBuf[0] = isEn ? OPCODE_EN4B : OPCODE_EX4B; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* - * FIXME: Per test, 4BYTE Indicator bit doesn't set after EN4B, which - * doesn't match spec(MX25L25635E), so skip the check below. - */ - ret = 0; - if (idBuf[0] != MFGID_MXIC) - { - /* - * About over 100 instrucsions executed, just want to give - * a time-out about 1 seconds to avoid infinite loop - */ - i32TimeOutCount = (SystemCoreClock) / 100; - - if (isEn) - { - while ((i32TimeOutCount-- > 0) && !SPIM_Is4ByteModeEnable(u32NBit)) { } - } - else - { - while ((i32TimeOutCount-- > 0) && SPIM_Is4ByteModeEnable(u32NBit)) { } - } - if (i32TimeOutCount <= 0) - ret = -1; - } - } - return ret; -} - - -void SPIM_WinbondUnlock(uint32_t u32NBit) -{ - uint8_t idBuf[3]; - uint8_t dataBuf[4]; - - SPIM_ReadJedecId(idBuf, sizeof(idBuf), u32NBit); - - if ((idBuf[0] != MFGID_WINBOND) || (idBuf[1] != 0x40) || (idBuf[2] != 0x16)) - { - SPIM_DBGMSG("SPIM_WinbondUnlock - Not W25Q32, do nothing.\n"); - return; - } - - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register: 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); - dataBuf[1] &= ~0x40; /* clear Status Register-1 SEC bit */ - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - SPIM_WriteStatusRegister2(dataBuf, sizeof(dataBuf), u32NBit); - spim_wait_write_done(u32NBit); - - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register (after unlock): 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); -} - -/** - * @brief Erase whole chip. - * @param u32NBit N-bit transmit/receive. - * @param isSync Block or not. - * @return None. - */ -void SPIM_ChipErase(uint32_t u32NBit, int isSync) -{ - uint8_t cmdBuf[] = { OPCODE_CHIP_ERASE }; /* 1-byte Chip Erase command. */ - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof(cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (isSync) - { - spim_wait_write_done(u32NBit); - } -} - - -/** - * @brief Erase one block. - * @param u32Addr Block to erase which contains the u32Addr. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u8ErsCmd Erase command. - * @param u32NBit N-bit transmit/receive. - * @param isSync Block or not. - * @return None. - */ -void SPIM_EraseBlock(uint32_t u32Addr, int is4ByteAddr, uint8_t u8ErsCmd, uint32_t u32NBit, int isSync) -{ - uint8_t cmdBuf[16]; - uint32_t buf_idx = 0UL; - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - - cmdBuf[buf_idx++] = u8ErsCmd; - - if (is4ByteAddr) - { - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 24); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr & 0xFFUL); - } - else - { - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr & 0xFFUL); - } - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, buf_idx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (isSync) - { - spim_wait_write_done(u32NBit); - } -} - - -/** @cond HIDDEN_SYMBOLS */ - -/** - * @brief Write data in the same page by I/O mode. - * @param u32Addr Start u32Address to write. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NTx Number of bytes to write. - * @param pu8TxBuf Transmit buffer. - * @param wrCmd Write command. - * @param u32NBitCmd N-bit transmit command. - * @param u32NBitAddr N-bit transmit u32Address. - * @param u32NBitDat N-bit transmit/receive data. - * @param isSync Block or not. - * @return None. - */ -static void SPIM_WriteInPageDataByIo(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int isSync) -{ - uint8_t cmdBuf[16]; - uint32_t buf_idx; - - spim_set_write_enable(1, u32NBitCmd); /* Write Enable. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - - SwitchNBitOutput(u32NBitCmd); - cmdBuf[0] = wrCmd; - spim_write(cmdBuf, 1UL); /* Write out command. */ - - buf_idx = 0UL; - if (is4ByteAddr) - { - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 24); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - else - { - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - - SwitchNBitOutput(u32NBitAddr); - spim_write(cmdBuf, buf_idx); /* Write out u32Address. */ - - SwitchNBitOutput(u32NBitDat); - spim_write(pu8TxBuf, u32NTx); /* Write out data. */ - - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (isSync) - { - spim_wait_write_done(u32NBitCmd); - } -} - -/** - * @brief Write data in the same page by Page Write mode. - * @param u32Addr Start u32Address to write. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NTx Number of bytes to write. - * @param pu8TxBuf Transmit buffer. - * @param wrCmd Write command. - * @param isSync Block or not. - * @return None. - * @note This function sets g_SPIM_i32ErrCode to SPIM_TIMEOUT_ERR if waiting SPIM time-out. - */ -static void SPIM_WriteInPageDataByPageWrite(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, - uint8_t pu8TxBuf[], uint32_t wrCmd, int isSync) -{ - uint32_t u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - - g_SPIM_i32ErrCode = 0; - - if ((wrCmd == CMD_QUAD_PAGE_PROGRAM_WINBOND) || - (wrCmd == CMD_QUAD_PAGE_PROGRAM_MXIC)) - { - SPIM_SetQuadEnable(1, 1UL); /* Set Quad Enable. */ - } - else if (wrCmd == CMD_QUAD_PAGE_PROGRAM_EON) - { - SPIM_SetQuadEnable(1, 1UL); /* Set Quad Enable. */ - spim_eon_set_qpi_mode(1); /* Enter QPI mode. */ - } - - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_PAGEWRITE);/* Switch to Page Write mode. */ - SPIM_SET_SPIM_MODE(wrCmd); /* SPIM mode. */ - SPIM_SET_4BYTE_ADDR_EN(is4ByteAddr); /* Enable/disable 4-Byte Address. */ - - SPIM->SRAMADDR = (uint32_t) pu8TxBuf; /* SRAM u32Address. */ - SPIM->DMACNT = u32NTx; /* Transfer length. */ - SPIM->FADDR = u32Addr; /* Flash u32Address.*/ - SPIM_SET_GO(); /* Go. */ - - if (isSync) - { - SPIM_WAIT_FREE() - { - if (--u32TimeOutCount == 0) - { - g_SPIM_i32ErrCode = SPIM_TIMEOUT_ERR; - break; - } - } - } - - if (wrCmd == CMD_QUAD_PAGE_PROGRAM_EON) - { - spim_eon_set_qpi_mode(0); /* Exit QPI mode. */ - } -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Write data to SPI Flash by sending commands manually (I/O mode). - * @param u32Addr: Start u32Address to write. - * @param is4ByteAddr: 4-byte u32Address or not. - * @param u32NTx: Number of bytes to write. - * @param pu8TxBuf: Transmit buffer. - * @param wrCmd: Write command. - * @param u32NBitCmd: N-bit transmit command. - * @param u32NBitAddr: N-bit transmit u32Address. - * @param u32NBitDat: N-bit transmit/receive data. - * @return None. - */ -void SPIM_IO_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat) -{ - uint32_t pageOffset, toWr; - uint32_t buf_idx = 0UL; - - pageOffset = u32Addr % 256UL; - - if ((pageOffset + u32NTx) <= 256UL) /* Do all the bytes fit onto one page ? */ - { - SPIM_WriteInPageDataByIo(u32Addr, is4ByteAddr, u32NTx, &pu8TxBuf[buf_idx], - wrCmd, u32NBitCmd, u32NBitAddr, u32NBitDat, 1); - } - else - { - toWr = 256UL - pageOffset; /* Size of data remaining on the first page. */ - - SPIM_WriteInPageDataByIo(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], - wrCmd, u32NBitCmd, u32NBitAddr, u32NBitDat, 1); - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - - while (u32NTx) - { - toWr = 256UL; - if (toWr > u32NTx) - { - toWr = u32NTx; - } - - SPIM_WriteInPageDataByIo(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], - wrCmd, u32NBitCmd, u32NBitAddr, u32NBitDat, 1); - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - } - } -} - -/** - * @brief Read data from SPI Flash by sending commands manually (I/O mode). - * @param u32Addr Start u32Address to read. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NRx Number of bytes to read. - * @param pu8RxBuf Receive buffer. - * @param rdCmd Read command. - * @param u32NBitCmd N-bit transmit command. - * @param u32NBitAddr N-bit transmit u32Address. - * @param u32NBitDat N-bit transmit/receive data. - * @param u32NDummy Number of dummy bytes following address. - * @return None. - */ -void SPIM_IO_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint8_t rdCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int u32NDummy) -{ - uint8_t cmdBuf[16]; - uint32_t buf_idx; - - SPIM_SET_SS_EN(1); /* CS activated. */ - - cmdBuf[0] = rdCmd; - SwitchNBitOutput(u32NBitCmd); - spim_write(cmdBuf, 1UL); /* Write out command. */ - - buf_idx = 0UL; - if (is4ByteAddr) - { - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 24); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - else - { - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t)(u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - SwitchNBitOutput(u32NBitAddr); - spim_write(cmdBuf, buf_idx); /* Write out u32Address. */ - - buf_idx = 0UL; - while (u32NDummy --) - { - cmdBuf[buf_idx++] = 0x00U; - } - - /* Same bit mode as above. */ - spim_write(cmdBuf, buf_idx); /* Write out dummy bytes. */ - - SwitchNBitInput(u32NBitDat); - spim_read(pu8RxBuf, u32NRx); /* Read back data. */ - - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Write data to SPI Flash by Page Write mode. - * @param u32Addr Start address to write. - * @param is4ByteAddr 4-byte address or not. - * @param u32NTx Number of bytes to write. - * @param pu8TxBuf Transmit buffer. - * @param wrCmd Write command. - * @return None. - */ -void SPIM_DMA_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint32_t wrCmd) -{ - uint32_t pageOffset, toWr; - uint32_t buf_idx = 0UL; - - pageOffset = u32Addr % 256UL; - - if ((pageOffset + u32NTx) <= 256UL) - { - /* Do all the bytes fit onto one page ? */ - SPIM_WriteInPageDataByPageWrite(u32Addr, is4ByteAddr, u32NTx, pu8TxBuf, wrCmd, 1); - } - else - { - toWr = 256UL - pageOffset; /* Size of data remaining on the first page. */ - - SPIM_WriteInPageDataByPageWrite(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], wrCmd, 1); - - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - - while (u32NTx) - { - toWr = 256UL; - if (toWr > u32NTx) - { - toWr = u32NTx; - } - - SPIM_WriteInPageDataByPageWrite(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], wrCmd, 1); - - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - } - } -} - -/** - * @brief Read data from SPI Flash by Page Read mode. - * @param u32Addr Start address to read. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NRx Number of bytes to read. - * @param pu8RxBuf Receive buffer. - * @param u32RdCmd Read command. - * @param isSync Block or not. - * @return None. - * @note This function sets g_SPIM_i32ErrCode to SPIM_TIMEOUT_ERR if waiting SPIM time-out. - */ -void SPIM_DMA_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], - uint32_t u32RdCmd, int isSync) -{ - uint32_t u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - - g_SPIM_i32ErrCode = 0; - - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_PAGEREAD); /* Switch to Page Read mode. */ - SPIM_SET_SPIM_MODE(u32RdCmd); /* SPIM mode. */ - SPIM_SET_4BYTE_ADDR_EN(is4ByteAddr); /* Enable/disable 4-Byte Address. */ - - SPIM->SRAMADDR = (uint32_t) pu8RxBuf; /* SRAM u32Address. */ - SPIM->DMACNT = u32NRx; /* Transfer length. */ - SPIM->FADDR = u32Addr; /* Flash u32Address.*/ - SPIM_SET_GO(); /* Go. */ - - if (isSync) - { - SPIM_WAIT_FREE() /* Wait for DMA done. */ - { - if (--u32TimeOutCount == 0) - { - g_SPIM_i32ErrCode = SPIM_TIMEOUT_ERR; - break; - } - } - } -} - -/** - * @brief Enter Direct Map mode. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32RdCmd Read command. - * @param u32IdleIntvl Idle interval. - * @return None. - */ -void SPIM_EnterDirectMapMode(int is4ByteAddr, uint32_t u32RdCmd, uint32_t u32IdleIntvl) -{ - SPIM_SET_4BYTE_ADDR_EN(is4ByteAddr); /* Enable/disable 4-byte u32Address. */ - SPIM_SET_SPIM_MODE(u32RdCmd); /* SPIM mode. */ - SPIM_SET_IDL_INTVL(u32IdleIntvl); /* Idle interval. */ - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_DIRECTMAP); /* Switch to Direct Map mode. */ -} - -/** - * @brief Exit Direct Map mode. - * @return None. - */ -void SPIM_ExitDirectMapMode(void) -{ - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch back to Normal mode. */ -} - - -/*@}*/ /* end of group SPIM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPIM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sys.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sys.c deleted file mode 100644 index bd422f2973e..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_sys.c +++ /dev/null @@ -1,331 +0,0 @@ -/**************************************************************************//** - * @file sys.c - * @version V3.00 - * @brief M460 series SYS driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - -int32_t g_SYS_i32ErrCode = 0; /*!< SYS global error code */ - -/** @addtogroup SYS_EXPORTED_FUNCTIONS SYS Exported Functions - @{ -*/ - -/** - * @brief Clear reset source - * @param[in] u32Src is system reset source. Including : - * - \ref SYS_RSTSTS_CPULKRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_HRESETRF_Msk - * - \ref SYS_RSTSTS_MCURF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_PORF_Msk - * @return None - * @details This function clear the selected system reset source. - */ -void SYS_ClearResetSrc(uint32_t u32Src) -{ - SYS->RSTSTS = u32Src; -} - -/** - * @brief Get Brown-out detector output status - * @param None - * @retval 0 System voltage is higher than BODVL setting or BODEN is 0. - * @retval 1 System voltage is lower than BODVL setting. - * @details This function get Brown-out detector output status. - */ -uint32_t SYS_GetBODStatus(void) -{ - return ((SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) >> SYS_BODCTL_BODOUT_Pos); -} - -/** - * @brief Get reset status register value - * @param None - * @return Reset source - * @details This function get the system reset status register value. - */ -uint32_t SYS_GetResetSrc(void) -{ - return (SYS->RSTSTS); -} - -/** - * @brief Check if register is locked nor not - * @param None - * @retval 0 Write-protection function is disabled. - * 1 Write-protection function is enabled. - * @details This function check register write-protection bit setting. - */ -uint32_t SYS_IsRegLocked(void) -{ - return SYS->REGLCTL & 1UL ? 0UL : 1UL; -} - -/** - * @brief Get product ID - * @param None - * @return Product ID - * @details This function get product ID. - */ -uint32_t SYS_ReadPDID(void) -{ - return SYS->PDID; -} - -/** - * @brief Reset chip with chip reset - * @param None - * @return None - * @details This function reset chip with chip reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetChip(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk; -} - -/** - * @brief Reset chip with CPU reset - * @param None - * @return None - * @details This function reset CPU with CPU reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetCPU(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CPURST_Msk; -} - -/** - * @brief Reset selected module - * @param[in] u32ModuleIndex is module index. Including : - * - \ref PDMA0_RST - * - \ref PDMA1_RST - * - \ref EBI_RST - * - \ref EMAC0_RST - * - \ref SDH0_RST - * - \ref SDH1_RST - * - \ref CRC_RST - * - \ref CCAP_RST - * - \ref HSUSBD_RST - * - \ref HBI_RST - * - \ref CRPT_RST - * - \ref KS_RST - * - \ref SPIM_RST - * - \ref HSUSBH_RST - * - \ref CANFD0_RST - * - \ref CANFD1_RST - * - \ref CANFD2_RST - * - \ref CANFD3_RST - * - \ref GPIO_RST - * - \ref TMR0_RST - * - \ref TMR1_RST - * - \ref TMR2_RST - * - \ref TMR3_RST - * - \ref ACMP01_RST - * - \ref ACMP23_RST - * - \ref I2C0_RST - * - \ref I2C1_RST - * - \ref I2C2_RST - * - \ref I2C3_RST - * - \ref I2C4_RST - * - \ref QSPI0_RST - * - \ref QSPI1_RST - * - \ref SPI0_RST - * - \ref SPI1_RST - * - \ref SPI2_RST - * - \ref SPI3_RST - * - \ref SPI4_RST - * - \ref SPI5_RST - * - \ref SPI6_RST - * - \ref SPI7_RST - * - \ref SPI8_RST - * - \ref SPI9_RST - * - \ref SPI10_RST - * - \ref UART0_RST - * - \ref UART1_RST - * - \ref UART2_RST - * - \ref UART3_RST - * - \ref UART4_RST - * - \ref UART5_RST - * - \ref UART6_RST - * - \ref UART7_RST - * - \ref UART8_RST - * - \ref UART9_RST - * - \ref OTG_RST - * - \ref USBD_RST - * - \ref EADC0_RST - * - \ref EADC1_RST - * - \ref EADC2_RST - * - \ref I2S0_RST - * - \ref I2S1_RST - * - \ref HSOTG_RST - * - \ref TRNG_RST - * - \ref SC0_RST - * - \ref SC1_RST - * - \ref SC2_RST - * - \ref USCI0_RST - * - \ref PSIO_RST - * - \ref DAC_RST - * - \ref EPWM0_RST - * - \ref EPWM1_RST - * - \ref BPWM0_RST - * - \ref BPWM1_RST - * - \ref EQEI0_RST - * - \ref EQEI1_RST - * - \ref EQEI2_RST - * - \ref EQEI3_RST - * - \ref ECAP0_RST - * - \ref ECAP1_RST - * - \ref ECAP2_RST - * - \ref ECAP3_RST - * - \ref EADC1_RST - * - \ref KPI_RST - * @return None - * @details This function reset selected module. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetModule(uint32_t u32ModuleIndex) -{ - uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL; - - /* Generate reset signal to the corresponding module */ - u32tmpVal = (1UL << (u32ModuleIndex & 0x00ffffffUL)); - u32tmpAddr = (uint32_t)&SYS->IPRST0 + ((u32ModuleIndex >> 24UL)); - *(volatile uint32_t *)u32tmpAddr |= u32tmpVal; - - /* Release corresponding module from reset state */ - u32tmpVal = ~(1UL << (u32ModuleIndex & 0x00ffffffUL)); - *(volatile uint32_t *)u32tmpAddr &= u32tmpVal; -} - -/** - * @brief Enable and configure Brown-out detector function - * @param[in] i32Mode is reset or interrupt mode. Including : - * - \ref SYS_BODCTL_BOD_RST_EN - * - \ref SYS_BODCTL_BOD_INTERRUPT_EN - * @param[in] u32BODLevel is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_3_0V - * - \ref SYS_BODCTL_BODVL_2_8V - * - \ref SYS_BODCTL_BODVL_2_6V - * - \ref SYS_BODCTL_BODVL_2_4V - * - \ref SYS_BODCTL_BODVL_2_2V - * - \ref SYS_BODCTL_BODVL_2_0V - * - \ref SYS_BODCTL_BODVL_1_8V - * - \ref SYS_BODCTL_BODVL_1_6V - * @return None - * @details This function configure Brown-out detector reset or interrupt mode, enable Brown-out function and set Brown-out voltage level. - * The register write-protection function should be disabled before using this function. - */ -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel) -{ - /* Enable Brown-out Detector function */ - /* Enable Brown-out interrupt or reset function */ - /* Select Brown-out Detector threshold voltage */ - SYS->BODCTL = (SYS->BODCTL & ~(SYS_BODCTL_BODRSTEN_Msk | SYS_BODCTL_BODVL_Msk)) | - ((uint32_t)i32Mode) | (u32BODLevel) | (SYS_BODCTL_BODEN_Msk); -} - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This function disable Brown-out detector function. - * The register write-protection function should be disabled before using this function. - */ -void SYS_DisableBOD(void) -{ - SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk; -} - -/** - * @brief Set Power Level - * @param[in] u32PowerLevel is power level setting. Including : - * - \ref SYS_PLCTL_PLSEL_PL0 : Supports system clock up to 200MHz. - * - \ref SYS_PLCTL_PLSEL_PL1 : Supports system clock up to 180MHz. - * @return None - * @details This function select power level. - * The register write-protection function should be disabled before using this function. - * @note This function sets g_SYS_i32ErrCode to SYS_TIMEOUT_ERR if waiting SYS time-out. - */ -void SYS_SetPowerLevel(uint32_t u32PowerLevel) -{ - uint32_t u32TimeOutCount = 0; - - g_SYS_i32ErrCode = 0; - - /* Wait for power level change busy flag is cleared */ - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - while (SYS->PLSTS & SYS_PLSTS_PLCBUSY_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SYS_i32ErrCode = SYS_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - /* Set power voltage level */ - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | (u32PowerLevel); - - /* Wait for power level change busy flag is cleared */ - u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - while (SYS->PLSTS & SYS_PLSTS_PLCBUSY_Msk) - { - if (--u32TimeOutCount == 0) - { - g_SYS_i32ErrCode = SYS_TIMEOUT_ERR; /* Time-out error */ - break; - } - } -} - -/** - * @brief Set Reference Voltage - * @param[in] u32VRefCTL is reference voltage setting. Including : - * - \ref SYS_VREFCTL_VREF_PIN - * - \ref SYS_VREFCTL_VREF_1_6V - * - \ref SYS_VREFCTL_VREF_2_0V - * - \ref SYS_VREFCTL_VREF_2_5V - * - \ref SYS_VREFCTL_VREF_3_0V - * @return None - * @details This function select reference voltage. - * The register write-protection function should be disabled before using this function. - */ -void SYS_SetVRef(uint32_t u32VRefCTL) -{ - /* Set reference voltage */ - SYS->VREFCTL = (SYS->VREFCTL & (~SYS_VREFCTL_VREFCTL_Msk)) | (u32VRefCTL); -} - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer.c deleted file mode 100644 index 1efaa809dde..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer.c +++ /dev/null @@ -1,437 +0,0 @@ -/**************************************************************************//** - * @file timer.c - * @version V3.00 - * @brief Timer Controller(Timer) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Open Timer with Operate Mode and Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Mode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * @param[in] u32Freq Target working frequency - * - * @return Real timer working frequency - * - * @details This API is used to configure timer to operate in specified mode and frequency. - * If timer cannot work in target frequency, a closest frequency will be chose and returned. - * @note After calling this API, Timer is \b NOT running yet. But could start timer running be calling - * \ref TIMER_Start macro or program registers directly. - */ -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Cmpr = 0UL, u32Prescale = 0UL; - - /* Fastest possible timer working freq is (u32Clk / 2). While cmpr = 2, prescaler = 0. */ - if (u32Freq > (u32Clk / 2UL)) - { - u32Cmpr = 2UL; - } - else - { - u32Cmpr = u32Clk / u32Freq; - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if (u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CTL = u32Mode | u32Prescale; - timer->CMP = u32Cmpr; - - return (u32Clk / (u32Cmpr * (u32Prescale + 1UL))); -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This API stops timer counting and disable all timer interrupt function. - */ -void TIMER_Close(TIMER_T *timer) -{ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; -} - -/** - * @brief Create a specify Delay Time - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Usec Delay period in micro seconds. Valid values are between 100~1000000 (100 micro second ~ 1 second). - * - * @return Delay success or not - * @retval 0 Success, target delay time reached - * @retval TIMER_TIMEOUT_ERR Delay function execute failed due to timer stop working - * - * @details This API is used to create a delay loop for u32usec micro seconds by using timer one-shot mode. - * @note This API overwrites the register setting of the timer used to count the delay time. - * @note This API use polling mode. So there is no need to enable interrupt for the timer module used to generate delay. - */ -int32_t TIMER_Delay(TIMER_T *timer, uint32_t u32Usec) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Prescale = 0UL, u32Delay; - uint32_t u32Cmpr, u32Cntr, u32NsecPerTick, i = 0UL; - - /* Clear current timer configuration */ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; - - if (u32Clk <= 1000000UL) /* min delay is 1000 us if timer clock source is <= 1 MHz */ - { - if (u32Usec < 1000UL) - { - u32Usec = 1000UL; - } - if (u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - else - { - if (u32Usec < 100UL) - { - u32Usec = 100UL; - } - if (u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - - if (u32Clk <= 1000000UL) - { - u32Prescale = 0UL; - u32NsecPerTick = 1000000000UL / u32Clk; - u32Cmpr = (u32Usec * 1000UL) / u32NsecPerTick; - } - else - { - u32Cmpr = u32Usec * (u32Clk / 1000000UL); - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if (u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CMP = u32Cmpr; - timer->CTL = TIMER_CTL_CNTEN_Msk | TIMER_ONESHOT_MODE | u32Prescale; - - /* When system clock is faster than timer clock, it is possible timer active bit cannot set in time while we check it. - And the while loop below return immediately, so put a tiny delay larger than 1 ECLK here allowing timer start counting and raise active flag. */ - for (u32Delay = (SystemCoreClock / u32Clk) + 1UL; u32Delay > 0UL; u32Delay--) - { - __NOP(); - } - - /* Add a bail out counter here in case timer clock source is disabled accidentally. - Prescale counter reset every ECLK * (prescale value + 1). - The u32Delay here is to make sure timer counter value changed when prescale counter reset */ - u32Delay = (SystemCoreClock / TIMER_GetModuleClock(timer)) * (u32Prescale + 1); - u32Cntr = timer->CNT; - while (timer->CTL & TIMER_CTL_ACTSTS_Msk) - { - /* Bailed out if timer stop counting e.g. Some interrupt handler close timer clock source. */ - if (u32Cntr == timer->CNT) - { - if (i++ > u32Delay) - { - return TIMER_TIMEOUT_ERR; - } - } - else - { - i = 0; - u32Cntr = timer->CNT; - } - } - return 0; -} - -/** - * @brief Enable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CapMode Timer capture mode. Could be - * - \ref TIMER_CAPTURE_FREE_COUNTING_MODE - * - \ref TIMER_CAPTURE_COUNTER_RESET_MODE - * @param[in] u32Edge Timer capture trigger edge. Possible values are - * - \ref TIMER_CAPTURE_EVENT_FALLING - * - \ref TIMER_CAPTURE_EVENT_RISING - * - \ref TIMER_CAPTURE_EVENT_FALLING_RISING - * - \ref TIMER_CAPTURE_EVENT_RISING_FALLING - * - * @return None - * - * @details This API is used to enable timer capture function with specify capture trigger edge \n - * to get current counter value or reset counter value to 0. - * @note Timer frequency should be configured separately by using \ref TIMER_Open API, or program registers directly. - */ -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~(TIMER_EXTCTL_CAPFUNCS_Msk | TIMER_EXTCTL_CAPEDGE_Msk)) | - u32CapMode | u32Edge | TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Disable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This API is used to disable the timer capture function. - */ -void TIMER_DisableCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Edge Detection edge of counter pin. Could be ether - * - \ref TIMER_COUNTER_EVENT_FALLING, or - * - \ref TIMER_COUNTER_EVENT_RISING - * - * @return None - * - * @details This function is used to enable the timer counter function with specify detection edge. - * @note Timer compare value should be configured separately by using \ref TIMER_SET_CMP_VALUE macro or program registers directly. - * @note While using event counter function, \ref TIMER_TOGGLE_MODE cannot set as timer operation mode. - */ -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~TIMER_EXTCTL_CNTPHASE_Msk) | u32Edge; - timer->CTL |= TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Disable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This API is used to disable the timer event counter function. - */ -void TIMER_DisableEventCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Get Timer Clock Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Timer clock frequency - * - * @details This API is used to get the timer clock frequency. - * @note This API cannot return correct clock rate if timer source is from external clock input. - */ -uint32_t TIMER_GetModuleClock(TIMER_T *timer) -{ - uint32_t u32Src, u32Clk; - const uint32_t au32Clk[] = {__HXT, __LXT, 0UL, 0UL, 0UL, __LIRC, 0UL, __HIRC}; - - if (timer == TIMER0) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR0SEL_Msk) >> CLK_CLKSEL1_TMR0SEL_Pos; - } - else if (timer == TIMER1) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR1SEL_Msk) >> CLK_CLKSEL1_TMR1SEL_Pos; - } - else if (timer == TIMER2) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR2SEL_Msk) >> CLK_CLKSEL1_TMR2SEL_Pos; - } - else /* Timer 3 */ - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR3SEL_Msk) >> CLK_CLKSEL1_TMR3SEL_Pos; - } - - if (u32Src == 2UL) - { - if ((timer == TIMER0) || (timer == TIMER1)) - { - u32Clk = CLK_GetPCLK0Freq(); - } - else - { - u32Clk = CLK_GetPCLK1Freq(); - } - } - else - { - u32Clk = au32Clk[u32Src]; - } - - return u32Clk; -} - -/** - * @brief This function is used to enable the Timer frequency counter function - * @param[in] timer The base address of Timer module. Can be \ref TIMER0 or \ref TIMER2 - * @param[in] u32DropCount This parameter has no effect in M480 series BSP - * @param[in] u32Timeout This parameter has no effect in M480 series BSP - * @param[in] u32EnableInt Enable interrupt assertion after capture complete or not. Valid values are TRUE and FALSE - * @return None - * @details This function is used to calculate input event frequency. After enable - * this function, a pair of timers, TIMER0 and TIMER1, or TIMER2 and TIMER3 - * will be configured for this function. The mode used to calculate input - * event frequency is mentioned as "Inter Timer Trigger Mode" in Technical - * Reference Manual - */ -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt) -{ - TIMER_T *t; /* store the timer base to configure compare value */ - - t = (timer == TIMER0) ? TIMER1 : TIMER3; - - t->CMP = 0xFFFFFFUL; - t->EXTCTL = u32EnableInt ? TIMER_EXTCTL_CAPIEN_Msk : 0UL; - timer->CTL = TIMER_CTL_INTRGEN_Msk | TIMER_CTL_CNTEN_Msk; - - return; -} - -/** - * @brief This function is used to disable the Timer frequency counter function. - * @param[in] timer The base address of Timer module - * @return None - */ -void TIMER_DisableFreqCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTRGEN_Msk; -} - -/** - * @brief This function is used to select the interrupt source used to trigger other modules. - * @param[in] timer The base address of Timer module - * @param[in] u32Src Selects the interrupt source to trigger other modules. Could be: - * - \ref TIMER_TRGSRC_TIMEOUT_EVENT - * - \ref TIMER_TRGSRC_CAPTURE_EVENT - * @return None - */ -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src) -{ - timer->TRGCTL = (timer->TRGCTL & ~TIMER_TRGCTL_TRGSSEL_Msk) | u32Src; -} - -/** - * @brief This function is used to set modules trigger by timer interrupt - * @param[in] timer The base address of Timer module - * @param[in] u32Mask The mask of modules (EPWM/BPWM, EADC, DAC and PDMA) trigger by timer. Is the combination of - * - \ref TIMER_TRG_TO_PWM, - * - \ref TIMER_TRG_TO_EADC, - * - \ref TIMER_TRG_TO_DAC, and - * - \ref TIMER_TRG_TO_PDMA - * @return None - */ -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask) -{ - timer->TRGCTL = (timer->TRGCTL & ~(TIMER_TRGCTL_TRGPWM_Msk | TIMER_TRGCTL_TRGDAC_Msk | TIMER_TRGCTL_TRGEADC_Msk | TIMER_TRGCTL_TRGPDMA_Msk)) | u32Mask; -} - -/** - * @brief Reset Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Reset success or not - * @retval 0 Timer reset success - * @retval TIMER_TIMEOUT_ERR Timer reset failed - * - * @details This function is used to reset current counter value and internal prescale counter value. - */ -int32_t TIMER_ResetCounter(TIMER_T *timer) -{ - uint32_t u32Delay; - - timer->CNT = 0UL; - /* Takes 2~3 ECLKs to reset timer counter */ - u32Delay = (SystemCoreClock / TIMER_GetModuleClock(timer)) * 3; - while (((timer->CNT & TIMER_CNT_RSTACT_Msk) == TIMER_CNT_RSTACT_Msk) && (--u32Delay)) - { - __NOP(); - } - return u32Delay > 0 ? 0 : TIMER_TIMEOUT_ERR; -} - -/** - * @brief Enable Capture Input Noise Filter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] u32FilterCount Noise filter counter. Valid values are between 0~7. - * - * @param[in] u32ClkSrcSel Noise filter counter clock source, could be one of following source - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_1 - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_2 - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_4 - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_8 - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_16 - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_32 - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_64 - * - \ref TIMER_CAPTURE_NOISE_FILTER_PCLK_DIV_128 - * - * @return None - * - * @details This function is used to enable capture input noise filter function. - */ -void TIMER_EnableCaptureInputNoiseFilter(TIMER_T *timer, uint32_t u32FilterCount, uint32_t u32ClkSrcSel) -{ - timer->CAPNF = (((timer)->CAPNF & ~(TIMER_CAPNF_CAPNFCNT_Msk | TIMER_CAPNF_CAPNFSEL_Msk)) - | (TIMER_CAPNF_CAPNFEN_Msk | (u32FilterCount << TIMER_CAPNF_CAPNFCNT_Pos) | (u32ClkSrcSel << TIMER_CAPNF_CAPNFSEL_Pos))); -} - -/** - * @brief Disable Capture Input Noise Filter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable capture input noise filter function. - */ -void TIMER_DisableCaptureInputNoiseFilter(TIMER_T *timer) -{ - timer->CAPNF &= ~TIMER_CAPNF_CAPNFEN_Msk; -} - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer_pwm.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer_pwm.c deleted file mode 100644 index 2c311ba9d32..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_timer_pwm.c +++ /dev/null @@ -1,595 +0,0 @@ -/**************************************************************************//** - * @file timer_pwm.c - * @version V3.00 - * @brief Timer PWM Controller(Timer PWM) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_FUNCTIONS TIMER PWM Exported Functions - @{ -*/ - -/** - * @brief Set PWM Counter Clock Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CntClkSrc PWM counter clock source, could be one of following source - * - \ref TPWM_CNTR_CLKSRC_TMR_CLK - * - \ref TPWM_CNTR_CLKSRC_TIMER0_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER1_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER2_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER3_INT - * - * @return None - * - * @details This function is used to set PWM counter clock source. - */ -void TPWM_SetCounterClockSource(TIMER_T *timer, uint32_t u32CntClkSrc) -{ - (timer)->PWMCLKSRC = ((timer)->PWMCLKSRC & ~TIMER_PWMCLKSRC_CLKSRC_Msk) | u32CntClkSrc; -} - -/** - * @brief Configure PWM Output Frequency and Duty Cycle - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Frequency Target generator frequency. - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0~100. 10 means 10%, 20 means 20%... - * - * @return Nearest frequency clock in nano second - * - * @details This API is used to configure PWM output frequency and duty cycle in up count type and auto-reload operation mode. - * @note This API is only available if Timer PWM counter clock source is from TMRx_CLK. - */ -uint32_t TPWM_ConfigOutputFreqAndDuty(TIMER_T *timer, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32PWMClockFreq, u32TargetFreq; - uint32_t u32Prescaler = 0x1000UL, u32Period, u32CMP; - - if ((timer == TIMER0) || (timer == TIMER1)) - { - u32PWMClockFreq = CLK_GetPCLK0Freq(); - } - else - { - u32PWMClockFreq = CLK_GetPCLK1Freq(); - } - - /* Calculate u16PERIOD and u16PSC */ - for (u32Prescaler = 1UL; u32Prescaler <= 0x1000UL; u32Prescaler++) - { - u32Period = (u32PWMClockFreq / u32Prescaler) / u32Frequency; - - /* If target u32Period is larger than 0x10000, need to use a larger prescaler */ - if (u32Period <= 0x10000UL) - { - break; - } - } - /* Store return value here 'cos we're gonna change u32Prescaler & u32Period to the real value to fill into register */ - u32TargetFreq = (u32PWMClockFreq / u32Prescaler) / u32Period; - - /* Set PWM to up count type */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (TPWM_UP_COUNT << TIMER_PWMCTL_CNTTYPE_Pos); - - /* Set PWM to auto-reload mode */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTMODE_Msk) | TPWM_AUTO_RELOAD_MODE; - - /* Convert to real register value */ - TPWM_SET_PRESCALER(timer, (u32Prescaler - 1UL)); - - TPWM_SET_PERIOD(timer, (u32Period - 1UL)); - if (u32DutyCycle) - { - u32CMP = (u32DutyCycle * u32Period) / 100UL; - } - else - { - u32CMP = 0UL; - } - - TPWM_SET_CMPDAT(timer, u32CMP); - - return (u32TargetFreq); -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the same as Timer PWM clock source. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableDeadTime(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the Timer PWM clock source with prescale. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableDeadTimeWithPrescale(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTCKSEL_Msk | TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Disable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable Dead-time of selected channel. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_DisableDeadTime(TIMER_T *timer) -{ - timer->PWMDTCTL = 0x0UL; -} - -/** - * @brief Enable PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable PWM generator and start counter counting. - */ -void TPWM_EnableCounter(TIMER_T *timer) -{ - timer->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Disable PWM Generator - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable PWM counter immediately by clear CNTEN (TIMERx_PWMCTL[0]) bit. - */ -void TPWM_DisableCounter(TIMER_T *timer) -{ - timer->PWMCTL &= ~TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Enable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Condition The condition to trigger EADC. It could be one of following conditions: - * - \ref TPWM_TRIGGER_EADC_AT_ZERO_POINT - * - \ref TPWM_TRIGGER_EADC_AT_PERIOD_POINT - * - \ref TPWM_TRIGGER_EADC_AT_ZERO_OR_PERIOD_POINT - * - \ref TPWM_TRIGGER_EADC_AT_COMPARE_UP_COUNT_POINT - * - \ref TPWM_TRIGGER_EADC_AT_COMPARE_DOWN_COUNT_POINT - * - * @return None - * - * @details This function is used to enable specified counter compare event to trigger EADC. - */ -void TPWM_EnableTriggerADC(TIMER_T *timer, uint32_t u32Condition) -{ - timer->PWMTRGCTL = TIMER_PWMTRGCTL_TRGEADC_Msk | u32Condition; -} - -/** - * @brief Disable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable counter compare event to trigger ADC. - */ -void TPWM_DisableTriggerADC(TIMER_T *timer) -{ - timer->PWMTRGCTL = 0x0UL; -} - -/** - * @brief Enable Fault Brake Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CH0Level PWMx_CH0 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32CH1Level PWMx_CH1 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32BrakeSource Fault brake source, combination of following source - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_EDGE_BKPIN - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_RAM - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_BKPIN - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM - * - * @return None - * - * @details This function is used to enable fault brake function. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableFaultBrake(TIMER_T *timer, uint32_t u32CH0Level, uint32_t u32CH1Level, uint32_t u32BrakeSource) -{ - timer->PWMFAILBRK |= ((u32BrakeSource >> 16) & 0xFUL); - timer->PWMBRKCTL = (timer->PWMBRKCTL & ~(TIMER_PWMBRKCTL_BRKAEVEN_Msk | TIMER_PWMBRKCTL_BRKAODD_Msk)) | - (u32BrakeSource & 0xFFFFUL) | (u32CH0Level << TIMER_PWMBRKCTL_BRKAEVEN_Pos) | (u32CH1Level << TIMER_PWMBRKCTL_BRKAODD_Pos); -} - -/** - * @brief Enable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to enable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 |= u32IntSource; -} - -/** - * @brief Disable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to disable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_DisableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 &= ~u32IntSource; -} - -/** - * @brief Indicate Fault Brake Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * - * @details This function is used to indicate fault brake interrupt flag occurred or not of selected source. - */ -uint32_t TPWM_GetFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - return ((timer->PWMINTSTS1 & (0x3UL << u32IntSource)) ? 1UL : 0UL); -} - -/** - * @brief Clear Fault Brake Interrupt Flags - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to clear fault brake interrupt flags of selected source. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_ClearFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTSTS1 = (0x3UL << u32IntSource); -} - -/** - * @brief Enable Load Mode of Selected Channel - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32LoadMode Timer PWM counter loading mode, could be one of following mode - * - \ref TPWM_LOAD_MODE_PERIOD - * - \ref TPWM_LOAD_MODE_IMMEDIATE - * - \ref TPWM_LOAD_MODE_CENTER - * - * @return None - * - * @details This function is used to enable load mode of selected channel. - * @note The default loading mode is period loading mode. - */ -void TPWM_SetLoadMode(TIMER_T *timer, uint32_t u32LoadMode) -{ - timer->PWMCTL = (timer->PWMCTL & ~(TIMER_PWMCTL_IMMLDEN_Msk | TIMER_PWMCTL_CTRLD_Msk)) | u32LoadMode; -} - -/** - * @brief Enable Brake Pin Noise Filter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32BrakePinSrc The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * @param[in] u32DebounceCnt This value controls the real debounce sample time. - * The target debounce sample time is (debounce sample clock period) * (u32DebounceCnt). - * @param[in] u32ClkSrcSel Brake pin detector debounce clock source, could be one of following source - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_1 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_2 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_4 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_8 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_16 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_32 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_64 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_128 - * - * @return None - * - * @details This function is used to enable external brake pin detector noise filter function. - */ -void TPWM_EnableBrakePinDebounce(TIMER_T *timer, uint32_t u32BrakePinSrc, uint32_t u32DebounceCnt, uint32_t u32ClkSrcSel) -{ - timer->PWMBNF = (timer->PWMBNF & ~(TIMER_PWMBNF_BKPINSRC_Msk | TIMER_PWMBNF_BRKFCNT_Msk | TIMER_PWMBNF_BRKNFSEL_Msk)) | - (u32BrakePinSrc << TIMER_PWMBNF_BKPINSRC_Pos) | - (u32DebounceCnt << TIMER_PWMBNF_BRKFCNT_Pos) | - (u32ClkSrcSel << TIMER_PWMBNF_BRKNFSEL_Pos) | TIMER_PWMBNF_BRKNFEN_Msk; -} - -/** - * @brief Disable Brake Pin Noise Filter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable external brake pin detector noise filter function. - */ -void TPWM_DisableBrakePinDebounce(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKNFEN_Msk; -} - - -/** - * @brief Enable Brake Pin Inverse Function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to enable PWM brake pin inverse function. - */ -void TPWM_EnableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Disable Brake Pin Inverse Function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to disable PWM brake pin inverse function. - */ -void TPWM_DisableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Set Brake Pin Source - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32BrakePinNum Brake pin selection. One of the following: - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * @return None - * @details This function is used to set PWM brake pin source. - */ -void TPWM_SetBrakePinSource(TIMER_T *timer, uint32_t u32BrakePinNum) -{ - timer->PWMBNF = (((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | (u32BrakePinNum << TIMER_PWMBNF_BKPINSRC_Pos)); -} - -/** - * @brief Enable Interrupt Flag Accumulator - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntFlagCnt Interrupt flag counter. Valid values are between 0~65535. - * @param[in] u32IntAccSrc Interrupt flag accumulator source selection. - * - \ref TPWM_IFA_ZERO_POINT - * - \ref TPWM_IFA_PERIOD_POINT - * - \ref TPWM_IFA_COMPARE_UP_COUNT_POINT - * - \ref TPWM_IFA_COMPARE_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable interrupt flag accumulator. - */ -void TPWM_EnableAcc(TIMER_T *timer, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc) -{ - timer->PWMIFA = (((timer)->PWMIFA & ~(TIMER_PWMIFA_IFACNT_Msk | TIMER_PWMIFA_IFASEL_Msk | TIMER_PWMIFA_STPMOD_Msk)) - | (TIMER_PWMIFA_IFAEN_Msk | (u32IntFlagCnt << TIMER_PWMIFA_IFACNT_Pos) | (u32IntAccSrc << TIMER_PWMIFA_IFASEL_Pos))); -} - -/** - * @brief Disable Interrupt Flag Accumulator - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to disable interrupt flag accumulator. - */ -void TPWM_DisableAcc(TIMER_T *timer) -{ - timer->PWMIFA &= ~TIMER_PWMIFA_IFAEN_Msk; -} - -/** - * @brief Enable Interrupt Flag Accumulator Interrupt Function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to enable interrupt flag accumulator interrupt. - */ -void TPWM_EnableAccInt(TIMER_T *timer) -{ - timer->PWMAINTEN |= TIMER_PWMAINTEN_IFAIEN_Msk; -} - -/** - * @brief Disable Interrupt Flag Accumulator Interrupt Function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to disable interrupt flag accumulator interrupt. - */ -void TPWM_DisableAccInt(TIMER_T *timer) -{ - timer->PWMAINTEN &= ~TIMER_PWMAINTEN_IFAIEN_Msk; -} - -/** - * @brief Clear Interrupt Flag Accumulator Interrupt Flag - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to clear interrupt flag accumulator interrupt. - */ -void TPWM_ClearAccInt(TIMER_T *timer) -{ - timer->PWMAINTSTS = TIMER_PWMAINTSTS_IFAIF_Msk; -} - -/** - * @brief Get Interrupt Flag Accumulator Interrupt Flag - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @retval 0 Accumulator interrupt did not occur - * @retval 1 Accumulator interrupt occurred - * @details This function is used to get interrupt flag accumulator interrupt. - */ -uint32_t TPWM_GetAccInt(TIMER_T *timer) -{ - return (((timer)->PWMAINTSTS & TIMER_PWMAINTSTS_IFAIF_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable Accumulator Interrupt Trigger PDMA - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to enable accumulator interrupt trigger PDMA transfer. - */ -void TPWM_EnableAccPDMA(TIMER_T *timer) -{ - timer->PWMAPDMACTL |= TIMER_PWMAPDMACTL_APDMAEN_Msk; -} - -/** - * @brief Disable Accumulator Interrupt Trigger PDMA - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to disable accumulator interrupt trigger PDMA transfer. - */ -void TPWM_DisableAccPDMA(TIMER_T *timer) -{ - timer->PWMAPDMACTL &= ~TIMER_PWMAPDMACTL_APDMAEN_Msk; -} - -/** - * @brief Enable Interrupt Flag Accumulator Stop Mode - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to enable interrupt flag accumulator event to stop PWM counting. - */ -void TPWM_EnableAccStopMode(TIMER_T *timer) -{ - timer->PWMIFA |= TIMER_PWMIFA_STPMOD_Msk; -} - -/** - * @brief Disable Interrupt Flag Accumulator Stop Mode - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to disable interrupt flag accumulator event to stop PWM counting. - */ -void TPWM_DisableAccStopMode(TIMER_T *timer) -{ - timer->PWMIFA &= ~TIMER_PWMIFA_STPMOD_Msk; -} - -/** - * @brief Enable External Event Trigger Counter Action - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32ExtEventSrc External event source selection. - * - \ref TPWM_EXT_TGR_PIN_INT0 - * - \ref TPWM_EXT_TGR_PIN_INT1 - * - \ref TPWM_EXT_TGR_PIN_INT2 - * - \ref TPWM_EXT_TGR_PIN_INT3 - * - \ref TPWM_EXT_TGR_PIN_INT4 - * - \ref TPWM_EXT_TGR_PIN_INT5 - * - \ref TPWM_EXT_TGR_PIN_INT6 - * - \ref TPWM_EXT_TGR_PIN_INT7 - * @param[in] u32CounterAction Counter action selection. - * - \ref TPWM_EXT_TGR_COUNTER_RESET - * - \ref TPWM_EXT_TGR_COUNTER_START - * - \ref TPWM_EXT_TGR_COUNTER_RESET_AND_START - * @return None - * @details This function is used to enable external event to trigger the counter specified action. - */ -void TPWM_EnableExtEventTrigger(TIMER_T *timer, uint32_t u32ExtEventSrc, uint32_t u32CounterAction) -{ - timer->PWMEXTETCTL = (((timer)->PWMEXTETCTL & ~(TIMER_PWMEXTETCTL_EXTTRGS_Msk | TIMER_PWMEXTETCTL_CNTACTS_Msk)) - | (TIMER_PWMEXTETCTL_EXTETEN_Msk | (u32ExtEventSrc << TIMER_PWMEXTETCTL_EXTTRGS_Pos) | (u32CounterAction << TIMER_PWMEXTETCTL_CNTACTS_Pos))); -} - -/** - * @brief Disable External Event Trigger Counter Action - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to disable external event to trigger counter action. - */ -void TPWM_DisableExtEventTrigger(TIMER_T *timer) -{ - timer->PWMEXTETCTL &= ~TIMER_PWMEXTETCTL_EXTETEN_Msk; -} - -/*@}*/ /* end of group TIMER_PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_PWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_trng.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_trng.c deleted file mode 100644 index 56318b9447f..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_trng.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************//** - * @file trng.c - * @version V3.00 - * @brief M460 series TRNG driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include - -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TRNG_Driver TRNG Driver - @{ -*/ - - -/** @addtogroup TRNG_EXPORTED_FUNCTIONS TRNG Exported Functions - @{ -*/ - - -/** - * @brief Initialize TRNG hardware. - * @return TRNG hardware enable success or failed. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_Open(void) -{ - uint32_t u32TimeOutCount = SystemCoreClock; /* 1 second time-out */ - - SYS->IPRST1 |= SYS_IPRST1_TRNGRST_Msk; - SYS->IPRST1 ^= SYS_IPRST1_TRNGRST_Msk; - - TRNG->CTL |= TRNG_CTL_TRNGEN_Msk; - - TRNG->ACT |= TRNG_ACT_ACT_Msk; - - /* Waiting for ready */ - while ((TRNG->CTL & TRNG_CTL_READY_Msk) == 0) - { - if (--u32TimeOutCount == 0) return -1; /* Time-out error */ - } - - return 0; -} - - -/** - * @brief Generate a 32-bits random number word. - * @param[out] u32RndNum The output 32-bits word random number. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenWord(uint32_t *u32RndNum) -{ - uint32_t i, u32Reg, timeout; - - *u32RndNum = 0; - u32Reg = TRNG->CTL; - - for (i = 0; i < 4; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - *u32RndNum |= ((TRNG->DATA & 0xff) << i * 8); - - } - return 0; -} - -/** - * @brief Generate a big number in binary format. - * @param[out] u8BigNum The output big number. - * @param[in] i32Len Request bit length of the output big number. It must be multiple of 8. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenBignum(uint8_t u8BigNum[], int32_t i32Len) -{ - uint32_t i, u32Reg, timeout; - - u32Reg = TRNG->CTL; - - for (i = 0; i < i32Len / 8; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - u8BigNum[i] = (TRNG->DATA & 0xff); - } - return 0; -} - -/** - * @brief Generate a big number in hex format. - * @param[out] cBigNumHex The output hex format big number. - * @param[in] i32Len Request bit length of the output big number. It must be multiple of 8. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenBignumHex(char cBigNumHex[], int32_t i32Len) -{ - uint32_t i, idx, u32Reg, timeout; - uint32_t data; - - u32Reg = TRNG->CTL; - idx = 0; - for (i = 0; i < i32Len / 8; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - data = (TRNG->DATA & 0xff); - - if (data >= 0xA0) - cBigNumHex[idx++] = ((data >> 4) & 0xf) - 10 + 'A'; - else - cBigNumHex[idx++] = ((data >> 4) & 0xf) + '0'; - - data &= 0xf; - if (data >= 0xA) - cBigNumHex[idx++] = data - 10 + 'A'; - else - cBigNumHex[idx++] = data + '0'; - } - cBigNumHex[idx] = 0; - return 0; -} - - -/*@}*/ /* end of group TRNG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TRNG_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_uart.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_uart.c deleted file mode 100644 index 19a0490ed96..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_uart.c +++ /dev/null @@ -1,670 +0,0 @@ -/**************************************************************************//** - * @file uart.c - * @version V3.00 - * @brief M460 series UART driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -/** - * @brief Clear UART specified interrupt flag - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTSTS_SWBEINT_Msk : Single-wire Bit Error Detect Interrupt Indicator - * - \ref UART_INTSTS_LININT_Msk : LIN Bus Interrupt Indicator - * - \ref UART_INTSTS_WKINT_Msk : Wake-up Interrupt Indicator - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status Interrupt Indicator - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status Interrupt Indicator - * - * @return None - * - * @details The function is used to clear UART specified interrupt flag. - */ - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag) -{ - if (u32InterruptFlag & UART_INTSTS_SWBEINT_Msk) /* Clear Single-wire Bit Error Detect Interrupt */ - { - uart->FIFOSTS = UART_INTSTS_SWBEIF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_RLSINT_Msk) /* Clear Receive Line Status Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_BIF_Msk | UART_FIFOSTS_FEF_Msk | UART_FIFOSTS_PEF_Msk | UART_FIFOSTS_ADDRDETF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_MODEMINT_Msk) /* Clear Modem Status Interrupt */ - { - uart->MODEMSTS |= UART_MODEMSTS_CTSDETF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_BUFERRINT_Msk) /* Clear Buffer Error Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_RXOVIF_Msk | UART_FIFOSTS_TXOVIF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_WKINT_Msk) /* Clear Wake-up Interrupt */ - { - uart->WKSTS = UART_WKSTS_CTSWKF_Msk | UART_WKSTS_DATWKF_Msk | - UART_WKSTS_RFRTWKF_Msk | UART_WKSTS_RS485WKF_Msk | - UART_WKSTS_TOUTWKF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_LININT_Msk) /* Clear LIN Bus Interrupt */ - { - uart->INTSTS = UART_INTSTS_LINIF_Msk; - uart->LINSTS = UART_LINSTS_BITEF_Msk | UART_LINSTS_BRKDETF_Msk | - UART_LINSTS_SLVSYNCF_Msk | UART_LINSTS_SLVIDPEF_Msk | - UART_LINSTS_SLVHEF_Msk | UART_LINSTS_SLVHDETF_Msk ; - } -} - - -/** - * @brief Disable UART interrupt - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART interrupt. - */ -void UART_Close(UART_T *uart) -{ - uart->INTEN = 0ul; -} - - -/** - * @brief Disable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART auto flow control. - */ -void UART_DisableFlowCtrl(UART_T *uart) -{ - uart->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk); -} - - -/** - * @brief Disable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty Interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto-baud Rate Interrupt - * - \ref UART_INTEN_SWBEIEN_Msk : Single-wire Bit Error Detect Interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin Bus interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx Time-out Interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : MODEM Status Interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line Status Interrupt - * - \ref UART_INTEN_THREIEN_Msk : Transmit Holding Register Empty Interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Receive Data Available Interrupt - * - * @return None - * - * @details The function is used to disable UART specified interrupt. - */ -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Disable UART specified interrupt */ - UART_DISABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Enable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to enable UART auto flow control. - */ -void UART_EnableFlowCtrl(UART_T *uart) -{ - /* Set RTS pin output is low level active */ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - - /* Set CTS pin input is low level active */ - uart->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk; - - /* Set RTS and CTS auto flow control enable */ - uart->INTEN |= UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk; -} - - -/** - * @brief Enable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module: - * - \ref UART_INTEN_TXENDIEN_Msk : Transmitter Empty Interrupt - * - \ref UART_INTEN_ABRIEN_Msk : Auto-baud Rate Interrupt - * - \ref UART_INTEN_SWBEIEN_Msk : Single-wire Bit Error Detect Interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin Bus interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx Time-out Interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : MODEM Status Interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line Status Interrupt - * - \ref UART_INTEN_THREIEN_Msk : Transmit Holding Register Empty Interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Receive Data Available Interrupt - * - * @return None - * - * @details The function is used to enable UART specified interrupt. - */ -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Enable UART specified interrupt */ - UART_ENABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Open and set UART function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The baudrate of UART module. - * - * @return None - * - * @details This function use to enable UART function and set baud-rate. - */ -void UART_Open(UART_T *uart, uint32_t u32baudrate) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - uint32_t au32ClkTbl[4] = {__HXT, 0ul, __LXT, __HIRC}; - uint32_t u32BaudDiv = 0ul; - - /* Get UART clock source selection and UART clock divider number */ - switch ((uint32_t)uart) - { - case UART0_BASE: - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk) >> CLK_CLKSEL1_UART0SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - break; - case UART1_BASE: - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - break; - case UART2_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - break; - case UART3_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - break; - case UART4_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - break; - case UART5_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - break; - case UART6_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART6SEL_Msk) >> CLK_CLKSEL3_UART6SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART6DIV_Msk) >> CLK_CLKDIV4_UART6DIV_Pos; - break; - case UART7_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART7SEL_Msk) >> CLK_CLKSEL3_UART7SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART7DIV_Msk) >> CLK_CLKDIV4_UART7DIV_Pos; - break; - case UART8_BASE: - u32UartClkSrcSel = (CLK->CLKSEL2 & CLK_CLKSEL2_UART8SEL_Msk) >> CLK_CLKSEL2_UART8SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV5 & CLK_CLKDIV5_UART8DIV_Msk) >> CLK_CLKDIV5_UART8DIV_Pos; - break; - case UART9_BASE: - u32UartClkSrcSel = (CLK->CLKSEL2 & CLK_CLKSEL2_UART9SEL_Msk) >> CLK_CLKSEL2_UART9SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV5 & CLK_CLKDIV5_UART9DIV_Msk) >> CLK_CLKDIV5_UART9DIV_Pos; - break; - default: - return; - } - - /* Select UART function */ - uart->FUNCSEL = UART_FUNCSEL_UART; - - /* Set UART line configuration */ - uart->LINE = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1; - - /* Set UART Rx and RTS trigger level */ - uart->FIFO &= ~(UART_FIFO_RFITL_Msk | UART_FIFO_RTSTRGLV_Msk); - - /* Get PLL/2 clock frequency if UART clock source selection is PLL/2 */ - if (u32UartClkSrcSel == 1ul) - { - au32ClkTbl[1] = CLK_GetPLLClockFreq() >> 1; - } - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32BaudDiv = UART_BAUD_MODE2_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32BaudDiv > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32BaudDiv); - } - } -} - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive FIFO. - * @param[in] u32ReadBytes The the read bytes number of data. - * - * @return u32Count Receive byte count - * - * @details The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf. - */ -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while (uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - pu8RxBuf[u32Count] = (uint8_t)uart->DAT; /* Get Data from UART RX */ - } - } - - return u32Count; -} - - -/** - * @brief Set UART line configuration - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The register value of baudrate of UART module. - * If u32baudrate = 0, UART baudrate will not change. - * @param[in] u32data_width The data length of UART module. - * - \ref UART_WORD_LEN_5 - * - \ref UART_WORD_LEN_6 - * - \ref UART_WORD_LEN_7 - * - \ref UART_WORD_LEN_8 - * @param[in] u32parity The parity setting (none/odd/even/mark/space) of UART module. - * - \ref UART_PARITY_NONE - * - \ref UART_PARITY_ODD - * - \ref UART_PARITY_EVEN - * - \ref UART_PARITY_MARK - * - \ref UART_PARITY_SPACE - * @param[in] u32stop_bits The stop bit length (1/1.5/2 bit) of UART module. - * - \ref UART_STOP_BIT_1 - * - \ref UART_STOP_BIT_1_5 - * - \ref UART_STOP_BIT_2 - * - * @return None - * - * @details This function use to config UART line setting. - */ -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - uint32_t au32ClkTbl[4] = {__HXT, 0ul, __LXT, __HIRC}; - uint32_t u32BaudDiv = 0ul; - - /* Get UART clock source selection and UART clock divider number */ - switch ((uint32_t)uart) - { - case UART0_BASE: - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk) >> CLK_CLKSEL1_UART0SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - break; - case UART1_BASE: - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - break; - case UART2_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - break; - case UART3_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - break; - case UART4_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - break; - case UART5_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - break; - case UART6_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART6SEL_Msk) >> CLK_CLKSEL3_UART6SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART6DIV_Msk) >> CLK_CLKDIV4_UART6DIV_Pos; - break; - case UART7_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART7SEL_Msk) >> CLK_CLKSEL3_UART7SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART7DIV_Msk) >> CLK_CLKDIV4_UART7DIV_Pos; - break; - case UART8_BASE: - u32UartClkSrcSel = (CLK->CLKSEL2 & CLK_CLKSEL2_UART8SEL_Msk) >> CLK_CLKSEL2_UART8SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV5 & CLK_CLKDIV5_UART8DIV_Msk) >> CLK_CLKDIV5_UART8DIV_Pos; - break; - case UART9_BASE: - u32UartClkSrcSel = (CLK->CLKSEL2 & CLK_CLKSEL2_UART9SEL_Msk) >> CLK_CLKSEL2_UART9SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV5 & CLK_CLKDIV5_UART9DIV_Msk) >> CLK_CLKDIV5_UART9DIV_Pos; - break; - default: - return; - } - - /* Get PLL/2 clock frequency if UART clock source selection is PLL/2 */ - if (u32UartClkSrcSel == 1ul) - { - au32ClkTbl[1] = CLK_GetPLLClockFreq() >> 1; - } - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32BaudDiv = UART_BAUD_MODE2_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32BaudDiv > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32BaudDiv); - } - } - - /* Set UART line configuration */ - uart->LINE = u32data_width | u32parity | u32stop_bits; -} - - -/** - * @brief Set Rx timeout count - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32TOC Rx timeout counter. - * - * @return None - * - * @details This function use to set Rx timeout count. - */ -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC) -{ - /* Set time-out interrupt comparator */ - uart->TOUT = (uart->TOUT & ~UART_TOUT_TOIC_Msk) | (u32TOC); - - /* Set time-out counter enable */ - uart->INTEN |= UART_INTEN_TOCNTEN_Msk; -} - - -/** - * @brief Select and configure IrDA function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Buadrate The baudrate of UART module. - * @param[in] u32Direction The direction of UART module in IrDA mode: - * - \ref UART_IRDA_TXEN - * - \ref UART_IRDA_RXEN - * - * @return None - * - * @details The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate. - */ -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - uint32_t au32ClkTbl[4] = {__HXT, 0ul, __LXT, __HIRC}; - uint32_t u32BaudDiv = 0ul; - - /* Select IrDA function mode */ - uart->FUNCSEL = UART_FUNCSEL_IrDA; - - /* Get UART clock source selection and UART clock divider number */ - switch ((uint32_t)uart) - { - case UART0_BASE: - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk) >> CLK_CLKSEL1_UART0SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - break; - case UART1_BASE: - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - break; - case UART2_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - break; - case UART3_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - break; - case UART4_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - break; - case UART5_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - break; - case UART6_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART6SEL_Msk) >> CLK_CLKSEL3_UART6SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART6DIV_Msk) >> CLK_CLKDIV4_UART6DIV_Pos; - break; - case UART7_BASE: - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART7SEL_Msk) >> CLK_CLKSEL3_UART7SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART7DIV_Msk) >> CLK_CLKDIV4_UART7DIV_Pos; - break; - case UART8_BASE: - u32UartClkSrcSel = (CLK->CLKSEL2 & CLK_CLKSEL2_UART8SEL_Msk) >> CLK_CLKSEL2_UART8SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV5 & CLK_CLKDIV5_UART8DIV_Msk) >> CLK_CLKDIV5_UART8DIV_Pos; - break; - case UART9_BASE: - u32UartClkSrcSel = (CLK->CLKSEL2 & CLK_CLKSEL2_UART9SEL_Msk) >> CLK_CLKSEL2_UART9SEL_Pos; - u32UartClkDivNum = (CLK->CLKDIV5 & CLK_CLKDIV5_UART9DIV_Msk) >> CLK_CLKDIV5_UART9DIV_Pos; - break; - default: - return; - } - - /* Get PLL/2 clock frequency if UART clock source selection is PLL/2 */ - if (u32UartClkSrcSel == 1ul) - { - au32ClkTbl[1] = CLK_GetPLLClockFreq() >> 1; - } - - /* Set UART IrDA baud rate in mode 0 */ - if (u32Buadrate != 0ul) - { - u32BaudDiv = UART_BAUD_MODE0_DIVIDER((au32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32Buadrate); - - if (u32BaudDiv < 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | u32BaudDiv); - } - } - - /* Configure IrDA relative settings */ - if (u32Direction == UART_IRDA_RXEN) - { - uart->IRDA |= UART_IRDA_RXINV_Msk; /* Rx signal is inverse */ - uart->IRDA &= ~UART_IRDA_TXEN_Msk; - } - else - { - uart->IRDA &= ~UART_IRDA_TXINV_Msk; /* Tx signal is not inverse */ - uart->IRDA |= UART_IRDA_TXEN_Msk; - } - -} - - -/** - * @brief Select and configure RS485 function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The operation mode(NMM/AUD/AAD). - * - \ref UART_ALTCTL_RS485NMM_Msk - * - \ref UART_ALTCTL_RS485AUD_Msk - * - \ref UART_ALTCTL_RS485AAD_Msk - * @param[in] u32Addr The RS485 address. - * - * @return None - * - * @details The function is used to set RS485 relative setting. - */ -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr) -{ - /* Select UART RS485 function mode */ - uart->FUNCSEL = UART_FUNCSEL_RS485; - - /* Set RS585 configuration */ - uart->ALTCTL &= ~(UART_ALTCTL_RS485NMM_Msk | UART_ALTCTL_RS485AUD_Msk | UART_ALTCTL_RS485AAD_Msk | UART_ALTCTL_ADDRMV_Msk); - uart->ALTCTL |= (u32Mode | (u32Addr << UART_ALTCTL_ADDRMV_Pos)); -} - - -/** - * @brief Select and configure LIN function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The LIN direction : - * - \ref UART_ALTCTL_LINTXEN_Msk - * - \ref UART_ALTCTL_LINRXEN_Msk - * @param[in] u32BreakLength The break field length. - * - * @return None - * - * @details The function is used to set LIN relative setting. - */ -void UART_SelectLINMode(UART_T *uart, uint32_t u32Mode, uint32_t u32BreakLength) -{ - /* Select LIN function mode */ - uart->FUNCSEL = UART_FUNCSEL_LIN; - - /* Select LIN function setting : Tx enable, Rx enable and break field length */ - uart->ALTCTL &= ~(UART_ALTCTL_LINTXEN_Msk | UART_ALTCTL_LINRXEN_Msk | UART_ALTCTL_BRKFL_Msk); - uart->ALTCTL |= (u32Mode | (u32BreakLength << UART_ALTCTL_BRKFL_Pos)); -} - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8TxBuf The buffer to send the data to UART transmission FIFO. - * @param[out] u32WriteBytes The byte number of data. - * - * @return u32Count transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by UART. - */ -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while (uart->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) /* Wait Tx not full or Time-out manner */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - uart->DAT = pu8TxBuf[u32Count]; /* Send UART Data from buffer */ - } - } - - return u32Count; -} - -/** - * @brief Select Single Wire mode function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to select Single Wire mode. - */ -void UART_SelectSingleWireMode(UART_T *uart) -{ - /* Select UART Single Wire function mode */ - uart->FUNCSEL = ((uart->FUNCSEL & (~UART_FUNCSEL_FUNCSEL_Msk)) | UART_FUNCSEL_SINGLE_WIRE); -} - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usbd.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usbd.c deleted file mode 100644 index d1354dc5b5d..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usbd.c +++ /dev/null @@ -1,743 +0,0 @@ -/**************************************************************************//** - * @file usbd.c - * @version V3.00 - * @brief M460 series USBD driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - - -/** @addtogroup USBD_EXPORTED_FUNCTIONS USBD Exported Functions - @{ -*/ - -/* Global variables for Control Pipe */ -uint8_t g_usbd_SetupPacket[8] = {0ul}; /*!< Setup packet buffer */ -volatile uint8_t g_usbd_RemoteWakeupEn = 0ul; /*!< Remote wake up function enable flag */ - -/** - * @cond HIDDEN_SYMBOLS - */ -static uint8_t *g_usbd_CtrlInPointer = 0; -static uint8_t *g_usbd_CtrlOutPointer = 0; -static volatile uint32_t g_usbd_CtrlInSize = 0ul; -static volatile uint32_t g_usbd_CtrlOutSize = 0ul; -static volatile uint32_t g_usbd_CtrlOutSizeLimit = 0ul; -static volatile uint32_t g_usbd_UsbAddr = 0ul; -static volatile uint32_t g_usbd_UsbConfig = 0ul; -static volatile uint32_t g_usbd_CtrlMaxPktSize = 8ul; -static volatile uint32_t g_usbd_UsbAltInterface = 0ul; -static volatile uint8_t g_usbd_CtrlInZeroFlag = 0ul; -/** - * @endcond - */ - -const S_USBD_INFO_T *g_usbd_sInfo; /*!< A pointer for USB information structure */ - -VENDOR_REQ g_usbd_pfnVendorRequest = NULL; /*!< USB Vendor Request Functional Pointer */ -CLASS_REQ g_usbd_pfnClassRequest = NULL; /*!< USB Class Request Functional Pointer */ -SET_INTERFACE_REQ g_usbd_pfnSetInterface = NULL; /*!< USB Set Interface Functional Pointer */ -SET_CONFIG_CB g_usbd_pfnSetConfigCallback = NULL; /*!< USB Set configuration callback function pointer */ -uint32_t g_u32EpStallLock = 0ul; /*!< Bit map flag to lock specified EP when SET_FEATURE */ - -/** - * @brief This function makes USBD module to be ready to use - * - * @param[in] param The structure of USBD information. - * @param[in] pfnClassReq USB Class request callback function. - * @param[in] pfnSetInterface USB Set Interface request callback function. - * - * @return None - * - * @details This function will enable USB controller, USB PHY transceiver and pull-up resistor of USB_D+ pin. USB PHY will drive SE0 to bus. - */ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface) -{ - g_usbd_sInfo = param; - g_usbd_pfnClassRequest = pfnClassReq; - g_usbd_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - g_usbd_CtrlMaxPktSize = g_usbd_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ -#ifdef SUPPORT_LPM - USBD->ATTR = 0x7D0ul | USBD_LPMACK; -#else - USBD->ATTR = 0x7D0ul; -#endif - /* Force SE0 */ - USBD_SET_SE0(); -} - -/** - * @brief This function makes USB host to recognize the device - * - * @param None - * - * @return None - * - * @details Enable WAKEUP, FLDET, USB and BUS interrupts. Disable software-disconnect function after 100ms delay with SysTick timer. - */ -void USBD_Start(void) -{ - /* Disable software-disconnect function */ - USBD_CLR_SE0(); - - /* Clear USB-related interrupts before enable interrupt */ - USBD_CLR_INT_FLAG(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); - - /* Enable USB-related interrupts. */ - USBD_ENABLE_INT(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); -} - -/** - * @brief Get the received SETUP packet - * - * @param[in] buf A buffer pointer used to store 8-byte SETUP packet. - * - * @return None - * - * @details Store SETUP packet to a user-specified buffer. - * - */ -void USBD_GetSetupPacket(uint8_t *buf) -{ - USBD_MemCopy(buf, g_usbd_SetupPacket, 8ul); -} - -/** - * @brief Process SETUP packet - * - * @param None - * - * @return None - * - * @details Parse SETUP packet and perform the corresponding action. - * - */ -void USBD_ProcessSetupPacket(void) -{ - /* Get SETUP packet from USB buffer */ - USBD_MemCopy(g_usbd_SetupPacket, (uint8_t *)USBD_BUF_BASE, 8ul); - - /* Check the request type */ - switch (g_usbd_SetupPacket[0] & 0x60ul) - { - case REQ_STANDARD: - { - USBD_StandardRequest(); - break; - } - case REQ_CLASS: - { - if (g_usbd_pfnClassRequest != NULL) - { - g_usbd_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: - { - if (g_usbd_pfnVendorRequest != NULL) - { - g_usbd_pfnVendorRequest(); - } - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } -} - -/** - * @brief Process GetDescriptor request - * - * @param None - * - * @return None - * - * @details Parse GetDescriptor request and perform the corresponding action. - * - */ -void USBD_GetDescriptor(void) -{ - uint32_t u32Len; - - g_usbd_CtrlInZeroFlag = (uint8_t)0ul; - u32Len = 0ul; - u32Len = g_usbd_SetupPacket[7]; - u32Len <<= 8ul; - u32Len += g_usbd_SetupPacket[6]; - - switch (g_usbd_SetupPacket[3]) - { - /* Get Device Descriptor */ - case DESC_DEVICE: - { - u32Len = USBD_Minimum(u32Len, (uint32_t)LEN_DEVICE); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8DevDesc, u32Len); - break; - } - /* Get Configuration Descriptor */ - case DESC_CONFIG: - { - uint32_t u32TotalLen; - - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlInZeroFlag = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8ConfigDesc, u32Len); - break; - } - /* Get BOS Descriptor */ - case DESC_BOS: - { - if (g_usbd_sInfo->gu8BosDesc == 0) - { - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - } - else - { - u32Len = USBD_Minimum(u32Len, LEN_BOS + LEN_BOSCAP); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8BosDesc, u32Len); - } - break; - } - /* Get HID Descriptor */ - case DESC_HID: - { - /* CV3.0 HID Class Descriptor Test, - Need to indicate index of the HID Descriptor within gu8ConfigDescriptor, specifically HID Composite device. */ - uint32_t u32ConfigDescOffset; /* u32ConfigDescOffset is configuration descriptor offset (HID descriptor start index) */ - - u32Len = USBD_Minimum(u32Len, LEN_HID); - u32ConfigDescOffset = g_usbd_sInfo->gu32ConfigHidDescIdx[g_usbd_SetupPacket[4]]; - USBD_PrepareCtrlIn((uint8_t *)&g_usbd_sInfo->gu8ConfigDesc[u32ConfigDescOffset], u32Len); - break; - } - /* Get Report Descriptor */ - case DESC_HID_RPT: - { - if (u32Len > g_usbd_sInfo->gu32HidReportSize[g_usbd_SetupPacket[4]]) - { - u32Len = g_usbd_sInfo->gu32HidReportSize[g_usbd_SetupPacket[4]]; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlInZeroFlag = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8HidReportDesc[g_usbd_SetupPacket[4]], u32Len); - break; - } - /* Get String Descriptor */ - case DESC_STRING: - { - /* Get String Descriptor */ - if (g_usbd_SetupPacket[2] < 4ul) - { - if (u32Len > g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]][0]) - { - u32Len = g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]][0]; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlInZeroFlag = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]], u32Len); - break; - } - else - { - /* Not support. Reply STALL. */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - default: - /* Not support. Reply STALL. */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } -} - -/** - * @brief Process standard request - * - * @param None - * - * @return None - * - * @details Parse standard request and perform the corresponding action. - * - */ -void USBD_StandardRequest(void) -{ - uint32_t addr; - - /* clear global variables for new request */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - - if ((g_usbd_SetupPacket[0] & 0x80ul) == 0x80ul) /* request data transfer direction */ - { - /* Device to host */ - switch (g_usbd_SetupPacket[1]) - { - case GET_CONFIGURATION: - { - /* Return current configuration setting */ - /* Data stage */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)g_usbd_UsbConfig; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - case GET_DESCRIPTOR: - { - USBD_GetDescriptor(); - USBD_PrepareCtrlOut(0, 0ul); /* For status stage */ - break; - } - case GET_INTERFACE: - { - /* Return current interface setting */ - /* Data stage */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)g_usbd_UsbAltInterface; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - case GET_STATUS: - { - /* Device */ - if (g_usbd_SetupPacket[0] == 0x80ul) - { - uint8_t u8Tmp = 0; - - u8Tmp = (uint8_t)0ul; - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x40ul) == 0x40ul) - { - u8Tmp |= (uint8_t)1ul; /* Self-Powered/Bus-Powered.*/ - } - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x20ul) == 0x20ul) - { - u8Tmp |= (uint8_t)(g_usbd_RemoteWakeupEn << 1ul); /* Remote wake up */ - } - - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = u8Tmp; - } - /* Interface */ - else if (g_usbd_SetupPacket[0] == 0x81ul) - { - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)0ul; - } - /* Endpoint */ - else if (g_usbd_SetupPacket[0] == 0x82ul) - { - uint8_t ep = (uint8_t)(g_usbd_SetupPacket[4] & 0xFul); - - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)(USBD_GetStall(ep) ? 1ul : 0ul); - } - - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0) + 1ul; - M8(addr) = (uint8_t)0ul; - /* Data stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 2ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } - else - { - /* Host to device */ - switch (g_usbd_SetupPacket[1]) - { - case CLEAR_FEATURE: - { - if (g_usbd_SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - uint32_t epNum, i; - - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_u32EpStallLock is added to support it */ - epNum = (uint8_t)(g_usbd_SetupPacket[4] & 0xFul); - for (i = 0ul; i < USBD_MAX_EP; i++) - { - if (((USBD->EP[i].CFG & 0xFul) == epNum) && ((g_u32EpStallLock & (1ul << i)) == 0ul)) - { - USBD->EP[i].CFGP &= ~USBD_CFGP_SSTALL_Msk; - USBD->EP[i].CFG &= ~USBD_CFG_DSQSYNC_Msk; - } - } - } - else if (g_usbd_SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_usbd_RemoteWakeupEn = (uint8_t)0; - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_ADDRESS: - { - g_usbd_UsbAddr = g_usbd_SetupPacket[2]; - /* Status Stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_CONFIGURATION: - { - g_usbd_UsbConfig = g_usbd_SetupPacket[2]; - - if (g_usbd_pfnSetConfigCallback) - { - g_usbd_pfnSetConfigCallback(); - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_FEATURE: - { - if ((g_usbd_SetupPacket[0] & 0xFul) == 0ul) /* 0: device */ - { - if ((g_usbd_SetupPacket[2] == 3ul) && (g_usbd_SetupPacket[3] == 0ul)) /* 3: HNP enable */ - { - OTG->CTL |= (OTG_CTL_HNPREQEN_Msk | OTG_CTL_BUSREQ_Msk); - } - } - if (g_usbd_SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - USBD_SetStall((uint8_t)(g_usbd_SetupPacket[4] & 0xFul)); - } - else if (g_usbd_SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_usbd_RemoteWakeupEn = (uint8_t)1ul; - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_INTERFACE: - { - g_usbd_UsbAltInterface = g_usbd_SetupPacket[2]; - if (g_usbd_pfnSetInterface != NULL) - { - g_usbd_pfnSetInterface(g_usbd_UsbAltInterface); - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } -} - -/** - * @brief Prepare the first Control IN pipe - * - * @param[in] pu8Buf The pointer of data sent to USB host. - * @param[in] u32Size The IN transfer size. - * - * @return None - * - * @details Prepare data for Control IN transfer. - * - */ -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size) -{ - uint32_t addr; - - if (u32Size > g_usbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - g_usbd_CtrlInPointer = pu8Buf + g_usbd_CtrlMaxPktSize; - g_usbd_CtrlInSize = u32Size - g_usbd_CtrlMaxPktSize; - USBD_SET_DATA1(EP0); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, pu8Buf, g_usbd_CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlMaxPktSize); - } - else - { - /* Data size <= MXPLD */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - USBD_SET_DATA1(EP0); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, pu8Buf, u32Size); - USBD_SET_PAYLOAD_LEN(EP0, u32Size); - } -} - -/** - * @brief Repeat Control IN pipe - * - * @param None - * - * @return None - * - * @details This function processes the remained data of Control IN transfer. - * - */ -void USBD_CtrlIn(void) -{ - uint32_t addr; - - if (g_usbd_CtrlInSize) - { - /* Process remained data */ - if (g_usbd_CtrlInSize > g_usbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, (uint8_t *)g_usbd_CtrlInPointer, g_usbd_CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlMaxPktSize); - g_usbd_CtrlInPointer += g_usbd_CtrlMaxPktSize; - g_usbd_CtrlInSize -= g_usbd_CtrlMaxPktSize; - } - else - { - /* Data size <= MXPLD */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, (uint8_t *)g_usbd_CtrlInPointer, g_usbd_CtrlInSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlInSize); - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - } - } - else - { - /* In ACK for Set address */ - if ((g_usbd_SetupPacket[0] == REQ_STANDARD) && (g_usbd_SetupPacket[1] == SET_ADDRESS)) - { - addr = USBD_GET_ADDR(); - if ((addr != g_usbd_UsbAddr) && (addr == 0ul)) - { - USBD_SET_ADDR(g_usbd_UsbAddr); - } - } - - /* For the case of data size is integral times maximum packet size */ - if (g_usbd_CtrlInZeroFlag) - { - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - g_usbd_CtrlInZeroFlag = (uint8_t)0ul; - } - } -} - -/** - * @brief Prepare the first Control OUT pipe - * - * @param[in] pu8Buf The pointer of data received from USB host. - * @param[in] u32Size The OUT transfer size. - * - * @return None - * - * @details This function is used to prepare the first Control OUT transfer. - * - */ -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size) -{ - g_usbd_CtrlOutPointer = pu8Buf; - g_usbd_CtrlOutSize = 0ul; - g_usbd_CtrlOutSizeLimit = u32Size; - USBD_SET_PAYLOAD_LEN(EP1, g_usbd_CtrlMaxPktSize); -} - -/** - * @brief Repeat Control OUT pipe - * - * @param None - * - * @return None - * - * @details This function processes the successive Control OUT transfer. - * - */ -void USBD_CtrlOut(void) -{ - uint32_t u32Size; - uint32_t addr; - - if (g_usbd_CtrlOutSize < g_usbd_CtrlOutSizeLimit) - { - u32Size = USBD_GET_PAYLOAD_LEN(EP1); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP1); - USBD_MemCopy((uint8_t *)g_usbd_CtrlOutPointer, (uint8_t *)addr, u32Size); - g_usbd_CtrlOutPointer += u32Size; - g_usbd_CtrlOutSize += u32Size; - - if (g_usbd_CtrlOutSize < g_usbd_CtrlOutSizeLimit) - { - USBD_SET_PAYLOAD_LEN(EP1, g_usbd_CtrlMaxPktSize); - } - } -} - -/** - * @brief Reset software flags - * - * @param None - * - * @return None - * - * @details This function resets all variables for protocol and resets USB device address to 0. - * - */ -void USBD_SwReset(void) -{ - uint32_t i, u32CFG; - - /* Reset all variables for protocol */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - g_usbd_CtrlOutPointer = 0; - g_usbd_CtrlOutSize = 0ul; - g_usbd_CtrlOutSizeLimit = 0ul; - g_u32EpStallLock = 0ul; - memset(g_usbd_SetupPacket, 0, 8ul); - - for (i = 0ul; i < USBD_MAX_EP; i++) - { - if (!USBD_IS_DB_MODE(i)) - { - /* Reset PID DATA0 */ - USBD->EP[i].CFG &= ~USBD_CFG_DSQSYNC_Msk; - } - else - { - /* Reset double buffer setting */ - u32CFG = USBD->EP[i].CFG; - USBD->EP[i].CFG = u32CFG; - } - } - - /* Reset USB device address */ - USBD_SET_ADDR(0ul); -} - -/** - * @brief USBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set USBD vendor request callback function - */ -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq) -{ - g_usbd_pfnVendorRequest = pfnVendorReq; -} - -/** - * @brief The callback function which called when get SET CONFIGURATION request - * - * @param[in] pfnSetConfigCallback Callback function pointer for SET CONFIGURATION request - * - * @return None - * - * @details This function is used to set the callback function which will be called at SET CONFIGURATION request. - */ -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback) -{ - g_usbd_pfnSetConfigCallback = pfnSetConfigCallback; -} - - -/** - * @brief EP stall lock function to avoid stall clear by USB SET FEATURE request. - * - * @param[in] u32EpBitmap Use bitmap to select which endpoints will be locked - * - * @return None - * - * @details This function is used to lock relative endpoint to avoid stall clear by SET FEATURE request. - * If ep stall locked, user needs to reset USB device or re-configure device to clear it. - */ -void USBD_LockEpStall(uint32_t u32EpBitmap) -{ - g_u32EpStallLock = u32EpBitmap; -} - - -/*@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_i2c.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_i2c.c deleted file mode 100644 index 4dbb0ce09fa..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_i2c.c +++ /dev/null @@ -1,1799 +0,0 @@ -/****************************************************************************//** - * @file usci_i2c.c - * @version V3.00 - * @brief M460 series USCI I2C(UI2C) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - -int32_t g_UI2C_i32ErrCode = 0; /*!< UI2C global error code */ - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This function makes USCI_I2C module be ready and set the wanted bus clock - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Enable USCI_I2C module and configure USCI_I2C module(bus clock, data format). - */ -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - - u32Pclk = CLK_GetPCLK0Freq(); - - u32ClkDiv = (uint32_t)((((((u32Pclk / 2U) * 10U) / (u32BusClock)) + 5U) / 10U) - 1U); /* Compute proper divider for USCI_I2C clock */ - - /* Enable USCI_I2C protocol */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; - ui2c->CTL = 4U << UI2C_CTL_FUNMODE_Pos; - - /* Data format configuration */ - /* 8 bit data length */ - ui2c->LINECTL &= ~UI2C_LINECTL_DWIDTH_Msk; - ui2c->LINECTL |= 8U << UI2C_LINECTL_DWIDTH_Pos; - - /* MSB data format */ - ui2c->LINECTL &= ~UI2C_LINECTL_LSB_Msk; - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - ui2c->PROTCTL |= UI2C_PROTCTL_PROTEN_Msk; - - return (u32Pclk / ((u32ClkDiv + 1U) << 1U)); -} - -/** - * @brief This function closes the USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Close USCI_I2C protocol function. - */ -void UI2C_Close(UI2C_T *ui2c) -{ - /* Disable USCI_I2C function */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; -} - -/** - * @brief This function clears the time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Clear time-out flag when time-out flag is set. - */ -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c) -{ - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; -} - -/** - * @brief This function sets the control bit of the USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Start Set START bit to USCI_I2C module. - * @param[in] u8Stop Set STOP bit to USCI_I2C module. - * @param[in] u8Ptrg Set PTRG bit to USCI_I2C module. - * @param[in] u8Ack Set ACK bit to USCI_I2C module. - * - * @return None - * - * @details The function set USCI_I2C control bit of USCI_I2C bus protocol. - */ -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - uint32_t u32Val = ui2c->PROTCTL & ~(UI2C_PROTCTL_STA_Msk | UI2C_PROTCTL_STO_Msk | UI2C_PROTCTL_AA_Msk); - - if (u8Start) - { - u32Reg |= UI2C_PROTCTL_STA_Msk; - } - if (u8Stop) - { - u32Reg |= UI2C_PROTCTL_STO_Msk; - } - if (u8Ptrg) - { - u32Reg |= UI2C_PROTCTL_PTRG_Msk; - } - if (u8Ack) - { - u32Reg |= UI2C_PROTCTL_AA_Msk; - } - - ui2c->PROTCTL = u32Val | u32Reg; -} - -/** - * @brief This function disables the interrupt of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to an interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details The function is used to disable USCI_I2C bus interrupt events. - */ -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Disable time-out interrupt flag */ - if ((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_TOIEN_Msk; - } - - /* Disable start condition received interrupt flag */ - if ((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STARIEN_Msk; - } - - /* Disable stop condition received interrupt flag */ - if ((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STORIEN_Msk; - } - - /* Disable non-acknowledge interrupt flag */ - if ((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_NACKIEN_Msk; - } - - /* Disable arbitration lost interrupt flag */ - if ((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ARBLOIEN_Msk; - } - - /* Disable error interrupt flag */ - if ((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ERRIEN_Msk; - } - - /* Disable acknowledge interrupt flag */ - if ((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function enables the interrupt of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * @return None - * - * @details The function is used to enable USCI_I2C bus interrupt events. - */ -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Enable time-out interrupt flag */ - if ((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_TOIEN_Msk; - } - - /* Enable start condition received interrupt flag */ - if ((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STARIEN_Msk; - } - - /* Enable stop condition received interrupt flag */ - if ((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STORIEN_Msk; - } - - /* Enable non-acknowledge interrupt flag */ - if ((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_NACKIEN_Msk; - } - - /* Enable arbitration lost interrupt flag */ - if ((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ARBLOIEN_Msk; - } - - /* Enable error interrupt flag */ - if ((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ERRIEN_Msk; - } - - /* Enable acknowledge interrupt flag */ - if ((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function returns the real bus clock of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details The function returns the actual USCI_I2C module bus clock. - */ -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c) -{ - uint32_t u32Divider; - uint32_t u32Pclk; - - u32Pclk = CLK_GetPCLK0Freq(); - u32Divider = (ui2c->BRGEN & UI2C_BRGEN_CLKDIV_Msk) >> UI2C_BRGEN_CLKDIV_Pos; - - return (u32Pclk / ((u32Divider + 1U) << 1U)); -} - -/** - * @brief This function sets bus clock frequency of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Use this function set USCI_I2C bus clock frequency and return actual bus clock. - */ -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - u32Pclk = CLK_GetPCLK0Freq(); - u32ClkDiv = (uint32_t)((((((u32Pclk / 2U) * 10U) / (u32BusClock)) + 5U) / 10U) - 1U); /* Compute proper divider for USCI_I2C clock */ - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - - return (u32Pclk / ((u32ClkDiv + 1U) << 1U)); -} - -/** - * @brief This function gets the interrupt flag of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details Use this function to get USCI_I2C interrupt flag when module occurs interrupt event. - */ -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U; - uint32_t u32TmpValue; - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_TOIF_Msk; - /* Check Time-out Interrupt Flag */ - if ((u32Mask & UI2C_TO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_TO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STARIF_Msk; - /* Check Start Condition Received Interrupt Flag */ - if ((u32Mask & UI2C_STAR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STAR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STORIF_Msk; - /* Check Stop Condition Received Interrupt Flag */ - if ((u32Mask & UI2C_STOR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STOR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_NACKIF_Msk; - /* Check Non-Acknowledge Interrupt Flag */ - if ((u32Mask & UI2C_NACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_NACK_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ARBLOIF_Msk; - /* Check Arbitration Lost Interrupt Flag */ - if ((u32Mask & UI2C_ARBLO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ARBLO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ERRIF_Msk; - /* Check Error Interrupt Flag */ - if ((u32Mask & UI2C_ERR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ERR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ACKIF_Msk; - /* Check Acknowledge Interrupt Flag */ - if ((u32Mask & UI2C_ACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ACK_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief This function clears the interrupt flag of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details Use this function to clear USCI_I2C interrupt flag when module occurs interrupt event and set flag. - */ -void UI2C_ClearIntFlag(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Clear Time-out Interrupt Flag */ - if (u32Mask & UI2C_TO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; - } - - /* Clear Start Condition Received Interrupt Flag */ - if (u32Mask & UI2C_STAR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STARIF_Msk; - } - - /* Clear Stop Condition Received Interrupt Flag */ - if (u32Mask & UI2C_STOR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STORIF_Msk; - } - - /* Clear Non-Acknowledge Interrupt Flag */ - if (u32Mask & UI2C_NACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_NACKIF_Msk; - } - - /* Clear Arbitration Lost Interrupt Flag */ - if (u32Mask & UI2C_ARBLO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ARBLOIF_Msk; - } - - /* Clear Error Interrupt Flag */ - if (u32Mask & UI2C_ERR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ERRIF_Msk; - } - - /* Clear Acknowledge Interrupt Flag */ - if (u32Mask & UI2C_ACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ACKIF_Msk; - } -} - -/** - * @brief This function returns the data stored in data register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return USCI_I2C data. - * - * @details To read a byte data from USCI_I2C module receive data register. - */ -uint32_t UI2C_GetData(UI2C_T *ui2c) -{ - return (ui2c->RXDAT); -} - -/** - * @brief This function writes a byte data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details To write a byte data to transmit data register to transmit data. - */ -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data) -{ - ui2c->TXDAT = u8Data; -} - -/** - * @brief Configure slave address and enable GC mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channel number [0/1] - * @param[in] u16SlaveAddr The slave address. - * @param[in] u8GCMode GC mode enable or not. Valid values are: - * - \ref UI2C_GCMODE_ENABLE - * - \ref UI2C_GCMODE_DISABLE - * - * @return None - * - * @details To configure USCI_I2C module slave address and GC mode. - */ -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) -{ - if (u8SlaveNo) - { - ui2c->DEVADDR1 = u16SlaveAddr; - } - else - { - ui2c->DEVADDR0 = u16SlaveAddr; - } - - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_GCFUNC_Msk) | u8GCMode; -} - -/** - * @brief Configure the mask bit of slave address. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channel number [0/1] - * @param[in] u16SlaveAddrMask The slave address mask. - * - * @return None - * - * @details To configure USCI_I2C module slave address mask bit. - * @note The corresponding address bit is "Don't Care". - */ -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) -{ - if (u8SlaveNo) - { - ui2c->ADDRMSK1 = u16SlaveAddrMask; - } - else - { - ui2c->ADDRMSK0 = u16SlaveAddrMask; - } -} - -/** - * @brief This function enables time-out function and configures timeout counter - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32TimeoutCnt Timeout counter. Valid values are between 0~0x3FF - * - * @return None - * - * @details To enable USCI_I2C bus time-out function and set time-out counter. - */ -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt) -{ - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_TOCNT_Msk) | (u32TimeoutCnt << UI2C_PROTCTL_TOCNT_Pos); - ui2c->BRGEN = (ui2c->BRGEN & ~UI2C_BRGEN_TMCNTSRC_Msk) | UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function disables time-out function - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C bus time-out function. - */ -void UI2C_DisableTimeout(UI2C_T *ui2c) -{ - ui2c->PROTCTL &= ~UI2C_PROTCTL_TOCNT_Msk; - ui2c->BRGEN &= ~UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function enables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8WakeupMode The wake-up mode selection. Valid values are: - * - \ref UI2C_DATA_TOGGLE_WK - * - \ref UI2C_ADDR_MATCH_WK - * - * @return None - * - * @details To enable USCI_I2C module wake-up function. - */ -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode) -{ - ui2c->WKCTL = (ui2c->WKCTL & ~UI2C_WKCTL_WKADDREN_Msk) | (u8WakeupMode | UI2C_WKCTL_WKEN_Msk); -} - -/** - * @brief This function disables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C module wake-up function. - */ -void UI2C_DisableWakeup(UI2C_T *ui2c) -{ - ui2c->WKCTL &= ~UI2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master write a byte data to Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ - -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - uint32_t u32TimeOutCount = 0U; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master write multi bytes data to Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ - -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U, u32TimeOutCount = 0U; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify a address that data write to in Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ - -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U, u32TimeOutCount = 0U; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes write to in Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ - -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U, u32TimeOutCount = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - if (u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify two bytes address that data write to in Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ - -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U, u32TimeOutCount = 0U; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 2U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data write to in Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ - -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U, u32TimeOutCount = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u8Addr = 0; - } - else - { - if (u32txLen < u32wLen) - { - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master to read a byte data from Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - uint32_t u32TimeOutCount = 0U; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - eEvent = MASTER_READ_DATA; - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Err = 1U; - } - else - { - rdata = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; - - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master to read multi data bytes from Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U, u32TimeOutCount = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < (u32rLen - 1U)) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify a byte address that a data byte read from Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - uint32_t u32TimeOutCount = 0U; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering && (u8Err == 0U)) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes read from Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U, u32TimeOutCount = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - /* SLA+R ACK */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address(2 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify two bytes address that a data byte read from Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Addr = 1U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - uint32_t u32TimeOutCount = 0U; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering && (u8Err == 0u)) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify two bytes address that multi data bytes read from Slave. - * - * @note This function sets g_UI2C_i32ErrCode to UI2C_TIMEOUT_ERR if waiting USCI_I2C time-out. - * - */ -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U, u32TimeOutCount = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - g_UI2C_i32ErrCode = 0; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - u32TimeOutCount = UI2C_TIMEOUT; - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)) /* Wait UI2C new status occur */ - { - if (--u32TimeOutCount == 0) - { - g_UI2C_i32ErrCode = UI2C_TIMEOUT_ERR; /* Time-out error */ - break; - } - } - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/*@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_spi.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_spi.c deleted file mode 100644 index 7077e7db3f4..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_spi.c +++ /dev/null @@ -1,677 +0,0 @@ -/**************************************************************************//** - * @file usci_spi.c - * @version V3.00 - * @brief M460 series USCI_SPI driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief This function make USCI_SPI module be ready to transfer. - * By default, the USCI_SPI transfer sequence is MSB first, the slave selection - * signal is active low and the automatic slave select function is disabled. In - * Slave mode, the u32BusClock must be NULL and the USCI_SPI clock - * divider setting will be 0. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32MasterSlave Decide the USCI_SPI module is operating in master mode or in slave mode. Valid values are: - * - \ref USPI_SLAVE - * - \ref USPI_MASTER - * @param[in] u32SPIMode Decide the transfer timing. Valid values are: - * - \ref USPI_MODE_0 - * - \ref USPI_MODE_1 - * - \ref USPI_MODE_2 - * - \ref USPI_MODE_3 - * @param[in] u32DataWidth The data width of a USCI_SPI transaction. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock in Hz. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv = 0ul; - uint32_t u32Pclk; - uint32_t u32UspiClk = 0ul; - - if (uspi == (USPI_T *)USPI0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - if (u32BusClock != 0ul) - { - u32ClkDiv = (uint32_t)((((((u32Pclk / 2ul) * 10ul) / (u32BusClock)) + 5ul) / 10ul) - 1ul); /* Compute proper divider for USCI_SPI clock */ - } - else {} - - /* Enable USCI_SPI protocol */ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; - uspi->CTL = 1ul << USPI_CTL_FUNMODE_Pos; - - /* Data format configuration */ - if (u32DataWidth == 16ul) - { - u32DataWidth = 0ul; - } - else {} - uspi->LINECTL &= ~USPI_LINECTL_DWIDTH_Msk; - uspi->LINECTL |= (u32DataWidth << USPI_LINECTL_DWIDTH_Pos); - - /* MSB data format */ - uspi->LINECTL &= ~USPI_LINECTL_LSB_Msk; - - /* Set slave selection signal active low */ - if (u32MasterSlave == USPI_MASTER) - { - uspi->LINECTL |= USPI_LINECTL_CTLOINV_Msk; - } - else - { - uspi->CTLIN0 |= USPI_CTLIN0_ININV_Msk; - } - - /* Set operating mode and transfer timing */ - uspi->PROTCTL &= ~(USPI_PROTCTL_SCLKMODE_Msk | USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SLAVE_Msk); - uspi->PROTCTL |= (u32MasterSlave | u32SPIMode); - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - uspi->PROTCTL |= USPI_PROTCTL_PROTEN_Msk; - - if (u32BusClock != 0ul) - { - u32UspiClk = (uint32_t)(u32Pclk / ((u32ClkDiv + 1ul) << 1)); - } - else {} - - return u32UspiClk; -} - -/** - * @brief Disable USCI_SPI function mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_Close(USPI_T *uspi) -{ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; -} - -/** - * @brief Clear Rx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearRxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_RXCLR_Msk; -} - -/** - * @brief Clear Tx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearTxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_TXCLR_Msk; -} - -/** - * @brief Disable the automatic slave select function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableAutoSS(USPI_T *uspi) -{ - uspi->PROTCTL &= ~(USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave select function. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SSPinMask This parameter is not used. - * @param[in] u32ActiveLevel The active level of slave select signal. Valid values are: - * - \ref USPI_SS_ACTIVE_HIGH - * - \ref USPI_SS_ACTIVE_LOW - * @return None - */ -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - uspi->LINECTL = (uspi->LINECTL & ~USPI_LINECTL_CTLOINV_Msk) | u32ActiveLevel; - uspi->PROTCTL |= USPI_PROTCTL_AUTOSS_Msk; -} - -/** - * @brief Set the USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk = 0UL; - - if (uspi == USPI0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32ClkDiv = (uint32_t)((((((u32Pclk / 2ul) * 10ul) / (u32BusClock)) + 5ul) / 10ul) - 1ul); /* Compute proper divider for USCI_SPI clock */ - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - - return (u32Pclk / ((u32ClkDiv + 1ul) << 1)); -} - -/** - * @brief Get the actual frequency of USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Actual USCI_SPI bus clock frequency. - */ -uint32_t USPI_GetBusClock(USPI_T *uspi) -{ - uint32_t u32BusClk = 0UL; - uint32_t u32ClkDiv; - - u32ClkDiv = (uspi->BRGEN & USPI_BRGEN_CLKDIV_Msk) >> USPI_BRGEN_CLKDIV_Pos; - - if (uspi == USPI0) - { - u32BusClk = (uint32_t)(CLK_GetPCLK0Freq() / ((u32ClkDiv + 1ul) << 1)); - } - - return u32BusClk; -} - -/** - * @brief Enable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be enabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSINAIEN_Msk; - } - else {} - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSACTIEN_Msk; - } - else {} - - /* Enable slave time-out interrupt flag */ - if ((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVTOIEN_Msk; - } - else {} - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVBEIEN_Msk; - } - else {} - - /* Enable TX under run interrupt flag */ - if ((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_TXUDRIEN_Msk; - } - else {} - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_RXOVIEN_Msk; - } - else {} - - /* Enable TX start interrupt flag */ - if ((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXSTIEN_Msk; - } - else {} - - /* Enable TX end interrupt flag */ - if ((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXENDIEN_Msk; - } - else {} - - /* Enable RX start interrupt flag */ - if ((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXSTIEN_Msk; - } - else {} - - /* Enable RX end interrupt flag */ - if ((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXENDIEN_Msk; - } - else {} -} - -/** - * @brief Disable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSINAIEN_Msk; - } - else {} - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSACTIEN_Msk; - } - else {} - - /* Disable slave time-out interrupt flag */ - if ((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVTOIEN_Msk; - } - else {} - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVBEIEN_Msk; - } - else {} - - /* Disable TX under run interrupt flag */ - if ((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_TXUDRIEN_Msk; - } - else {} - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_RXOVIEN_Msk; - } - else {} - - /* Disable TX start interrupt flag */ - if ((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXSTIEN_Msk; - } - else {} - - /* Disable TX end interrupt flag */ - if ((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXENDIEN_Msk; - } - else {} - - /* Disable RX start interrupt flag */ - if ((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXSTIEN_Msk; - } - else {} - - /* Disable RX end interrupt flag */ - if ((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXENDIEN_Msk; - } - else {} -} - -/** - * @brief Get interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return Interrupt flags of selected sources. - */ -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32TmpFlag; - uint32_t u32IntFlag = 0ul; - - /* Check slave selection signal inactive interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SSINAIF_Msk; - if (((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_SSINAIF_Msk)) - { - u32IntFlag |= USPI_SSINACT_INT_MASK; - } - else {} - - /* Check slave selection signal active interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SSACTIF_Msk; - if (((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_SSACTIF_Msk)) - { - u32IntFlag |= USPI_SSACT_INT_MASK; - } - else {} - - /* Check slave time-out interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SLVTOIF_Msk; - if (((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_SLVTOIF_Msk)) - { - u32IntFlag |= USPI_SLVTO_INT_MASK; - } - else {} - - /* Check slave bit count error interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SLVBEIF_Msk; - if (((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_SLVBEIF_Msk)) - { - u32IntFlag |= USPI_SLVBE_INT_MASK; - } - else {} - - /* Check TX under run interrupt flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_TXUDRIF_Msk; - if (((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) && (u32TmpFlag == USPI_BUFSTS_TXUDRIF_Msk)) - { - u32IntFlag |= USPI_TXUDR_INT_MASK; - } - else {} - - /* Check RX overrun interrupt flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_RXOVIF_Msk; - if (((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) && (u32TmpFlag == USPI_BUFSTS_RXOVIF_Msk)) - { - u32IntFlag |= USPI_RXOV_INT_MASK; - } - else {} - - /* Check TX start interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_TXSTIF_Msk; - if (((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_TXSTIF_Msk)) - { - u32IntFlag |= USPI_TXST_INT_MASK; - } - else {} - - /* Check TX end interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_TXENDIF_Msk; - if (((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_TXENDIF_Msk)) - { - u32IntFlag |= USPI_TXEND_INT_MASK; - } - else {} - - /* Check RX start interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_RXSTIF_Msk; - if (((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_RXSTIF_Msk)) - { - u32IntFlag |= USPI_RXST_INT_MASK; - } - else {} - - /* Check RX end interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_RXENDIF_Msk; - if (((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_RXENDIF_Msk)) - { - u32IntFlag |= USPI_RXEND_INT_MASK; - } - else {} - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - /* Clear slave selection signal inactive interrupt flag */ - if ((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSINAIF_Msk; - } - else {} - - /* Clear slave selection signal active interrupt flag */ - if ((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSACTIF_Msk; - } - else {} - - /* Clear slave time-out interrupt flag */ - if ((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVTOIF_Msk; - } - else {} - - /* Clear slave bit count error interrupt flag */ - if ((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVBEIF_Msk; - } - else {} - - /* Clear TX under run interrupt flag */ - if ((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_TXUDRIF_Msk; - } - else {} - - /* Clear RX overrun interrupt flag */ - if ((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_RXOVIF_Msk; - } - else {} - - /* Clear TX start interrupt flag */ - if ((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXSTIF_Msk; - } - else {} - - /* Clear TX end interrupt flag */ - if ((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXENDIF_Msk; - } - else {} - - /* Clear RX start interrupt flag */ - if ((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXSTIF_Msk; - } - else {} - - /* Clear RX end interrupt flag */ - if ((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXENDIF_Msk; - } - else {} -} - -/** - * @brief Get USCI_SPI status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref USPI_BUSY_MASK - * - \ref USPI_RX_EMPTY_MASK - * - \ref USPI_RX_FULL_MASK - * - \ref USPI_TX_EMPTY_MASK - * - \ref USPI_TX_FULL_MASK - * - \ref USPI_SSLINE_STS_MASK - * @return Flags of selected sources. - */ -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0ul; - uint32_t u32TmpFlag; - - /* Check busy status */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_BUSY_Msk; - if (((u32Mask & USPI_BUSY_MASK) == USPI_BUSY_MASK) && (u32TmpFlag & USPI_PROTSTS_BUSY_Msk)) - { - u32Flag |= USPI_BUSY_MASK; - } - else {} - - /* Check RX empty flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_RXEMPTY_Msk; - if (((u32Mask & USPI_RX_EMPTY_MASK) == USPI_RX_EMPTY_MASK) && (u32TmpFlag == USPI_BUFSTS_RXEMPTY_Msk)) - { - u32Flag |= USPI_RX_EMPTY_MASK; - } - else {} - - /* Check RX full flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_RXFULL_Msk; - if (((u32Mask & USPI_RX_FULL_MASK) == USPI_RX_FULL_MASK) && (u32TmpFlag == USPI_BUFSTS_RXFULL_Msk)) - { - u32Flag |= USPI_RX_FULL_MASK; - } - else {} - - /* Check TX empty flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_TXEMPTY_Msk; - if (((u32Mask & USPI_TX_EMPTY_MASK) == USPI_TX_EMPTY_MASK) && (u32TmpFlag == USPI_BUFSTS_TXEMPTY_Msk)) - { - u32Flag |= USPI_TX_EMPTY_MASK; - } - else {} - - /* Check TX full flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_TXFULL_Msk; - if (((u32Mask & USPI_TX_FULL_MASK) == USPI_TX_FULL_MASK) && (u32TmpFlag == USPI_BUFSTS_TXFULL_Msk)) - { - u32Flag |= USPI_TX_FULL_MASK; - } - else {} - - /* Check USCI_SPI_SS line status */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SSLINE_Msk; - if (((u32Mask & USPI_SSLINE_STS_MASK) == USPI_SSLINE_STS_MASK) && (u32TmpFlag & USPI_PROTSTS_SSLINE_Msk)) - { - u32Flag |= USPI_SSLINE_STS_MASK; - } - else {} - - return u32Flag; -} - -/** - * @brief Enable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_EnableWakeup(USPI_T *uspi) -{ - uspi->WKCTL |= USPI_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableWakeup(USPI_T *uspi) -{ - uspi->WKCTL &= ~USPI_WKCTL_WKEN_Msk; -} - -/*@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_uart.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_uart.c deleted file mode 100644 index ccfee67b0be..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_usci_uart.c +++ /dev/null @@ -1,713 +0,0 @@ -/**************************************************************************//** - * @file usci_uart.c - * @version V3.00 - * @brief M460 series USCI UART (UUART) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - -/** - * @brief Clear USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to clear USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -void UUART_ClearIntFlag(UUART_T *uuart, uint32_t u32Mask) -{ - - if (u32Mask & UUART_ABR_INT_MASK) /* Clear Auto-baud Rate Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_ABRDETIF_Msk; - } - - if (u32Mask & UUART_RLS_INT_MASK) /* Clear Receive Line Status Interrupt */ - { - uuart->PROTSTS = (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk); - } - - if (u32Mask & UUART_BUF_RXOV_INT_MASK) /* Clear Receive Buffer Over-run Error Interrupt */ - { - uuart->BUFSTS = UUART_BUFSTS_RXOVIF_Msk; - } - - if (u32Mask & UUART_TXST_INT_MASK) /* Clear Transmit Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXSTIF_Msk; - } - - if (u32Mask & UUART_TXEND_INT_MASK) /* Clear Transmit End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXENDIF_Msk; - } - - if (u32Mask & UUART_RXST_INT_MASK) /* Clear Receive Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXSTIF_Msk; - } - - if (u32Mask & UUART_RXEND_INT_MASK) /* Clear Receive End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXENDIF_Msk; - } - -} - -/** - * @brief Get USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details The function is used to get USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -uint32_t UUART_GetIntFlag(UUART_T *uuart, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0ul; - uint32_t u32Tmp1, u32Tmp2; - - /* Check Auto-baud Rate Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_ABR_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_ABRDETIF_Msk); - if (u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_ABR_INT_MASK; - } - - /* Check Receive Line Status Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RLS_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk)); - if (u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RLS_INT_MASK; - } - - /* Check Receive Buffer Over-run Error Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_BUF_RXOV_INT_MASK); - u32Tmp2 = (uuart->BUFSTS & UUART_BUFSTS_RXOVIF_Msk); - if (u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_BUF_RXOV_INT_MASK; - } - - /* Check Transmit Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXSTIF_Msk); - if (u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXST_INT_MASK; - } - - /* Check Transmit End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXENDIF_Msk); - if (u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXEND_INT_MASK; - } - - /* Check Receive Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXSTIF_Msk); - if (u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXST_INT_MASK; - } - - /* Check Receive End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXENDIF_Msk); - if (u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXEND_INT_MASK; - } - - return u32IntFlag; - -} - - -/** - * @brief Disable USCI_UART function mode - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART function mode. - */ -void UUART_Close(UUART_T *uuart) -{ - uuart->CTL = 0ul; -} - - -/** - * @brief Disable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to disabled USCI_UART related interrupts specified by u32Mask parameter. - */ -void UUART_DisableInt(UUART_T *uuart, uint32_t u32Mask) -{ - - /* Disable Auto-baud rate interrupt flag */ - if ((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_ABRIEN_Msk; - } - - /* Disable receive line status interrupt flag */ - if ((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_RLSIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL &= ~UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Disable TX start interrupt flag */ - if ((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXSTIEN_Msk; - } - - /* Disable TX end interrupt flag */ - if ((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXENDIEN_Msk; - } - - /* Disable RX start interrupt flag */ - if ((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXSTIEN_Msk; - } - - /* Disable RX end interrupt flag */ - if ((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Enable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to enable USCI_UART related interrupts specified by u32Mask parameter. - */ -void UUART_EnableInt(UUART_T *uuart, uint32_t u32Mask) -{ - /* Enable Auto-baud rate interrupt flag */ - if ((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_ABRIEN_Msk; - } - - /* Enable receive line status interrupt flag */ - if ((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_RLSIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL |= UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Enable TX start interrupt flag */ - if ((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXSTIEN_Msk; - } - - /* Enable TX end interrupt flag */ - if ((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXENDIEN_Msk; - } - - /* Enable RX start interrupt flag */ - if ((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXSTIEN_Msk; - } - - /* Enable RX end interrupt flag */ - if ((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Open and set USCI_UART function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The baud rate of USCI_UART module. - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to enable USCI_UART function and set baud-rate. - */ -uint32_t UUART_Open(UUART_T *uuart, uint32_t u32baudrate) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - u32PCLKFreq = CLK_GetPCLK0Freq(); - - /* Calculate baud rate divider */ - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div + 1ul)); - - if (u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - if (u32Div >= 65536ul) - { - - /* Set the smallest baud rate that USCI_UART can generate */ - u32PDSCnt = 0x4ul; - u32MinDSCnt = 0x10ul; - u32MinClkDiv = 0x400ul; - - } - else - { - - u32Tmp = 0x400ul * 0x10ul; - for (u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if (u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if (u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - u32Tmp = 0ul; - - for (u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - - u32ClkDiv = u32Div / u32DSCnt; - - if (u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv + 1ul) * u32DSCnt) - u32Div; - } - - if (u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if (u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if (u32Min == 0ul) - { - break; - } - } - } - } - - /* Enable USCI_UART protocol */ - uuart->CTL &= ~UUART_CTL_FUNMODE_Msk; - uuart->CTL = 2ul << UUART_CTL_FUNMODE_Pos; - - /* Set USCI_UART line configuration */ - uuart->LINECTL = UUART_WORD_LEN_8 | UUART_LINECTL_LSB_Msk; - uuart->DATIN0 = (2ul << UUART_DATIN0_EDGEDET_Pos); /* Set falling edge detection */ - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv - 1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt - 1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt - 1ul) << UUART_BRGEN_PDSCNT_Pos); - - uuart->PROTCTL |= UUART_PROTCTL_PROTEN_Msk; - - return (u32PCLKFreq / u32PDSCnt / u32MinDSCnt / u32MinClkDiv); -} - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive buffer. - * @param[in] u32ReadBytes The read bytes number of data. - * - * @return Receive byte count - * - * @details The function is used to read Rx data from RX buffer and the data will be stored in pu8RxBuf. - */ -uint32_t UUART_Read(UUART_T *uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - - for (u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while (uuart->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - break; - } - } - - if (u32delayno >= 0x40000000ul) - { - break; - } - - pu8RxBuf[u32Count] = (uint8_t)uuart->RXDAT; /* Get Data from USCI RX */ - } - - return u32Count; - -} - - -/** - * @brief Set USCI_UART line configuration - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The register value of baud rate of USCI_UART module. - * If u32baudrate = 0, USCI_UART baud rate will not change. - * @param[in] u32data_width The data length of USCI_UART module. - * - \ref UUART_WORD_LEN_6 - * - \ref UUART_WORD_LEN_7 - * - \ref UUART_WORD_LEN_8 - * - \ref UUART_WORD_LEN_9 - * @param[in] u32parity The parity setting (none/odd/even) of USCI_UART module. - * - \ref UUART_PARITY_NONE - * - \ref UUART_PARITY_ODD - * - \ref UUART_PARITY_EVEN - * @param[in] u32stop_bits The stop bit length (1/2 bit) of USCI_UART module. - * - \ref UUART_STOP_BIT_1 - * - \ref UUART_STOP_BIT_2 - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to config USCI_UART line setting. - */ -uint32_t UUART_SetLine_Config(UUART_T *uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - u32PCLKFreq = CLK_GetPCLK0Freq(); - - - if (u32baudrate != 0ul) - { - - /* Calculate baud rate divider */ - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div + 1ul)); - - if (u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - if (u32Div >= 65536ul) - { - - /* Set the smallest baud rate that USCI_UART can generate */ - u32PDSCnt = 0x4ul; - u32MinDSCnt = 0x10ul; - u32MinClkDiv = 0x400ul; - - } - else - { - u32Tmp = 0x400ul * 0x10ul; - for (u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if (u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if (u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - - for (u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - u32ClkDiv = u32Div / u32DSCnt; - - if (u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv + 1ul) * u32DSCnt) - u32Div; - } - - if (u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if (u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if (u32Min == 0ul) - { - break; - } - } - } - - } - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv - 1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt - 1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt - 1ul) << UUART_BRGEN_PDSCNT_Pos); - } - else - { - u32PDSCnt = ((uuart->BRGEN & UUART_BRGEN_PDSCNT_Msk) >> UUART_BRGEN_PDSCNT_Pos) + 1ul; - u32MinDSCnt = ((uuart->BRGEN & UUART_BRGEN_DSCNT_Msk) >> UUART_BRGEN_DSCNT_Pos) + 1ul; - u32MinClkDiv = ((uuart->BRGEN & UUART_BRGEN_CLKDIV_Msk) >> UUART_BRGEN_CLKDIV_Pos) + 1ul; - } - - /* Set USCI_UART line configuration */ - uuart->LINECTL = (uuart->LINECTL & ~UUART_LINECTL_DWIDTH_Msk) | u32data_width; - uuart->PROTCTL = (uuart->PROTCTL & ~(UUART_PROTCTL_STICKEN_Msk | UUART_PROTCTL_EVENPARITY_Msk | - UUART_PROTCTL_PARITYEN_Msk)) | u32parity; - uuart->PROTCTL = (uuart->PROTCTL & ~UUART_PROTCTL_STOPB_Msk) | u32stop_bits; - - return (u32PCLKFreq / u32PDSCnt / u32MinDSCnt / u32MinClkDiv); -} - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8TxBuf The buffer to send the data to USCI transmission buffer. - * @param[out] u32WriteBytes The byte number of data. - * - * @return Transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by USCI_UART. - */ -uint32_t UUART_Write(UUART_T *uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - - for (u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while ((uuart->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) == 0ul) /* Wait Tx empty */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - break; - } - } - - if (u32delayno >= 0x40000000ul) - { - break; - } - - uuart->TXDAT = (uint8_t)pu8TxBuf[u32Count]; /* Send USCI_UART Data to buffer */ - } - - return u32Count; - -} - - -/** - * @brief Enable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32WakeupMode The wakeup mode of USCI_UART module. - * - \ref UUART_PROTCTL_DATWKEN_Msk : Data wake-up Mode - * - \ref UUART_PROTCTL_CTSWKEN_Msk : nCTS wake-up Mode - * - * @return None - * - * @details The function is used to enable Wake-up function of USCI_UART. - */ -void UUART_EnableWakeup(UUART_T *uuart, uint32_t u32WakeupMode) -{ - uuart->PROTCTL |= u32WakeupMode; - uuart->WKCTL |= UUART_WKCTL_WKEN_Msk; -} - - -/** - * @brief Disable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable Wake-up function of USCI_UART. - */ -void UUART_DisableWakeup(UUART_T *uuart) -{ - uuart->PROTCTL &= ~(UUART_PROTCTL_DATWKEN_Msk | UUART_PROTCTL_CTSWKEN_Msk); - uuart->WKCTL &= ~UUART_WKCTL_WKEN_Msk; -} - -/** - * @brief Enable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to enable USCI_UART auto flow control. - */ -void UUART_EnableFlowCtrl(UUART_T *uuart) -{ - /* Set RTS signal is low level active */ - uuart->LINECTL &= ~UUART_LINECTL_CTLOINV_Msk; - - /* Set CTS signal is low level active */ - uuart->CTLIN0 &= ~UUART_CTLIN0_ININV_Msk; - - /* Enable CTS and RTS auto flow control function */ - uuart->PROTCTL |= UUART_PROTCTL_RTSAUTOEN_Msk | UUART_PROTCTL_CTSAUTOEN_Msk; -} - -/** - * @brief Disable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART auto flow control. - */ -void UUART_DisableFlowCtrl(UUART_T *uuart) -{ - /* Disable CTS and RTS auto flow control function */ - uuart->PROTCTL &= ~(UUART_PROTCTL_RTSAUTOEN_Msk | UUART_PROTCTL_CTSAUTOEN_Msk); -} - - -/*@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_wdt.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_wdt.c deleted file mode 100644 index 4226e336bf4..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_wdt.c +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************//** - * @file wdt.c - * @version V3.00 - * @brief Watchdog Timer(WDT) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -int32_t g_WDT_i32ErrCode = 0; /*!< WDT global error code */ - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Initialize WDT and start counting - * - * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: - * - \ref WDT_TIMEOUT_2POW4 - * - \ref WDT_TIMEOUT_2POW6 - * - \ref WDT_TIMEOUT_2POW8 - * - \ref WDT_TIMEOUT_2POW10 - * - \ref WDT_TIMEOUT_2POW12 - * - \ref WDT_TIMEOUT_2POW14 - * - \ref WDT_TIMEOUT_2POW16 - * - \ref WDT_TIMEOUT_2POW18 - * - \ref WDT_TIMEOUT_2POW20 - * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: - * - \ref WDT_RESET_DELAY_1026CLK - * - \ref WDT_RESET_DELAY_130CLK - * - \ref WDT_RESET_DELAY_18CLK - * - \ref WDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable WDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - * @note This function sets g_WDT_i32ErrCode to WDT_TIMEOUT_ERR if waiting WDT time-out. - */ -void WDT_Open(uint32_t u32TimeoutInterval, - uint32_t u32ResetDelay, - uint32_t u32EnableReset, - uint32_t u32EnableWakeup) -{ - uint32_t u32TimeOutCount = WDT_TIMEOUT; - - g_WDT_i32ErrCode = 0; - - WDT->ALTCTL = u32ResetDelay; - - WDT->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk | - (u32EnableReset << WDT_CTL_RSTEN_Pos) | - (u32EnableWakeup << WDT_CTL_WKEN_Pos); - - while ((WDT->CTL & WDT_CTL_SYNC_Msk) == WDT_CTL_SYNC_Msk) /* Wait enable WDTEN bit completed, it needs 2 * WDT_CLK. */ - { - if (--u32TimeOutCount == 0) - { - g_WDT_i32ErrCode = WDT_TIMEOUT_ERR; /* Time-out error */ - break; - } - } -} - -/**@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_wwdt.c b/bsp/nuvoton/libraries/m460/StdDriver/src/nu_wwdt.c deleted file mode 100644 index c45f4824441..00000000000 --- a/bsp/nuvoton/libraries/m460/StdDriver/src/nu_wwdt.c +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************//** - * @file wwdt.c - * @version V3.00 - * @brief Window Watchdog Timer(WWDT) driver source file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Open WWDT and start counting - * - * @param[in] u32PreScale Pre-scale setting of WWDT counter. Valid values are: - * - \ref WWDT_PRESCALER_1 - * - \ref WWDT_PRESCALER_2 - * - \ref WWDT_PRESCALER_4 - * - \ref WWDT_PRESCALER_8 - * - \ref WWDT_PRESCALER_16 - * - \ref WWDT_PRESCALER_32 - * - \ref WWDT_PRESCALER_64 - * - \ref WWDT_PRESCALER_128 - * - \ref WWDT_PRESCALER_192 - * - \ref WWDT_PRESCALER_256 - * - \ref WWDT_PRESCALER_384 - * - \ref WWDT_PRESCALER_512 - * - \ref WWDT_PRESCALER_768 - * - \ref WWDT_PRESCALER_1024 - * - \ref WWDT_PRESCALER_1536 - * - \ref WWDT_PRESCALER_2048 - * @param[in] u32CmpValue Setting the window compared value. Valid values are between 0x0 to 0x3F. - * @param[in] u32EnableInt Enable WWDT time-out interrupt function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WWDT module start counting with different counter period by pre-scale setting and compared window value. - * @note Application can call this function only once after boot up. - */ -void WWDT_Open(uint32_t u32PreScale, - uint32_t u32CmpValue, - uint32_t u32EnableInt) -{ - WWDT->CTL = u32PreScale | - (u32CmpValue << WWDT_CTL_CMPDAT_Pos) | - ((u32EnableInt == (uint32_t)TRUE) ? WWDT_CTL_INTEN_Msk : 0UL) | - WWDT_CTL_WWDTEN_Msk; -} - -/**@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/**@}*/ /* end of group WWDT_Driver */ - -/**@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/SConscript b/bsp/nuvoton/libraries/m460/USBHostLib/SConscript deleted file mode 100644 index 8119a1ff1d6..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -group = [] -if GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_USBH'): - src = Glob('*src/*.c') + Glob('src/*.cpp') - CPPPATH = [cwd + '/inc'] - group = DefineGroup('m460_usbhostlib', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/inc/config.h b/bsp/nuvoton/libraries/m460/USBHostLib/inc/config.h deleted file mode 100644 index 1534e645d2c..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/inc/config.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************//** - * @file config.h - * @version V1.00 - * @brief This header file defines the configuration of USB Host library. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_CONFIG_H_ -#define _USBH_CONFIG_H_ - -/// @cond HIDDEN_SYMBOLS - -#include -#include -/*----------------------------------------------------------------------------------------*/ -/* Hardware settings */ -/*----------------------------------------------------------------------------------------*/ -#define HCLK_MHZ 192 /* used for loop-delay. must be larger than - true HCLK clock MHz */ - -#define ENABLE_OHCI_IRQ() NVIC_EnableIRQ(USBH_IRQn) -#define DISABLE_OHCI_IRQ() NVIC_DisableIRQ(USBH_IRQn) -#define ENABLE_EHCI_IRQ() NVIC_EnableIRQ(HSUSBH_IRQn) -#define DISABLE_EHCI_IRQ() NVIC_DisableIRQ(HSUSBH_IRQn) - -#define ENABLE_OHCI /* Enable OHCI host controller */ - -#if defined(BSP_USING_HSUSBH) - #define ENABLE_EHCI /* Enable EHCI host controller */ -#endif - -#define EHCI_PORT_CNT 1 /* Number of EHCI roothub ports */ -#define OHCI_PORT_CNT 2 /* Number of OHCI roothub ports */ -#define OHCI_PER_PORT_POWER /* OHCI root hub per port powered */ - -#define OHCI_ISO_DELAY 4 /* preserved number frames while scheduling - OHCI isochronous transfer */ - -#define EHCI_ISO_DELAY 2 /* preserved number of frames while - scheduling EHCI isochronous transfer */ - -#define EHCI_ISO_RCLM_RANGE 32 /* When inspecting activated iTD/siTD, - unconditionally reclaim iTD/isTD scheduled - in just elapsed EHCI_ISO_RCLM_RANGE ms. */ - -#define MAX_DESC_BUFF_SIZE 512 /* To hold the configuration descriptor, USB - core will allocate a buffer with this size - for each connected device. USB core does - not release it until device disconnected. */ - -/*----------------------------------------------------------------------------------------*/ -/* Memory allocation settings */ -/*----------------------------------------------------------------------------------------*/ - -#define STATIC_MEMORY_ALLOC 0 /* pre-allocate static memory blocks. No dynamic memory aloocation. - But the maximum number of connected devices and transfers are - limited. */ - -#define MAX_UDEV_DRIVER 8 /*!< Maximum number of registered drivers */ -#define MAX_ALT_PER_IFACE 8 /*!< maximum number of alternative interfaces per interface */ -#define MAX_EP_PER_IFACE 6 /*!< maximum number of endpoints per interface */ -#define MAX_HUB_DEVICE 8 /*!< Maximum number of hub devices */ - -/* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI - are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE. - May allocate one or more units depend on hardware descriptor type. */ - -#define MEM_POOL_UNIT_SIZE 64 /*!< A fixed hard coding setting. Do not change it! */ -#define MEM_POOL_UNIT_NUM 256 /*!< Increase this or heap size if memory allocate failed. */ - -/*----------------------------------------------------------------------------------------*/ -/* Re-defined staff for various compiler */ -/*----------------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ - #define __inline inline -#endif - - -/*----------------------------------------------------------------------------------------*/ -/* Debug settings */ -/*----------------------------------------------------------------------------------------*/ -#define ENABLE_ERROR_MSG /* enable debug messages */ -#define ENABLE_DEBUG_MSG /* enable debug messages */ -//#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */ -//#define DUMP_DESCRIPTOR /* dump descriptors */ - -#ifdef ENABLE_ERROR_MSG - #define USB_error rt_kprintf -#else - #define USB_error(...) -#endif - -#ifdef ENABLE_DEBUG_MSG - #define USB_debug rt_kprintf - #ifdef ENABLE_VERBOSE_DEBUG - #define USB_vdebug rt_kprintf - #else - #define USB_vdebug(...) - #endif -#else - #define USB_debug(...) - #define USB_vdebug(...) -#endif - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_CONFIG_H_ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/inc/ehci.h b/bsp/nuvoton/libraries/m460/USBHostLib/inc/ehci.h deleted file mode 100644 index f99a4abde34..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/inc/ehci.h +++ /dev/null @@ -1,281 +0,0 @@ -/**************************************************************************//** - * @file ehci.h - * @version V1.00 - * @brief USB EHCI host controller driver header file. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_EHCI_H_ -#define _USBH_EHCI_H_ - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct qh_t; -struct iso_ep_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------------*/ -/* Periodic Frame List Size (256, 512, or 1024) */ -/*----------------------------------------------------------------------------------------*/ -#define FL_SIZE 1024 /* frame list size can be 256, 512, or 1024 */ -#define NUM_IQH 11 /* depends on FL_SIZE, 256:9, 512:10, 1024:11 */ - - -/*----------------------------------------------------------------------------------------*/ -/* Interrupt Threshold Control (1, 2, 4, 6, .. 64) */ -/*----------------------------------------------------------------------------------------*/ -#define UCMDR_INT_THR_CTRL (0x1< of QH */ -} qTD_T; - - -#define QTD_LIST_END 0x1 /* Indicate the terminate of qTD list. */ -#define QTD_PTR(x) ((qTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Status: qTD Token[7:0] - */ -#define QTD_STS_PS_OUT (0<<0) /* directs the HC to issue an OUT PID */ -#define QTD_STS_PS_PING (1<<0) /* directs the HC to issue an PING PID */ -#define QTD_STS_SPLIT_STRAT (0<<1) /* directs the HC to issue an Start split */ -#define QTD_STS_SPLIT_COMPLETE (1<<1) /* directs the HC to issue an Complete split */ -#define QTD_STS_MISS_MF (1<<2) /* miss a required complete-split transaction */ -#define QTD_STS_XactErr (1<<3) /* Transaction Error occurred */ -#define QTD_STS_BABBLE (1<<4) /* Babble Detected */ -#define QTD_STS_DATA_BUFF_ERR (1<<5) /* Data Buffer Error */ -#define QTD_STS_HALT (1<<6) /* Halted */ -#define QTD_STS_ACTIVE (1<<7) /* Active */ - -/* - * PID: qTD Token[9:8] - */ -#define QTD_PID_Msk (0x3<<8) -#define QTD_PID_OUT (0<<8) /* generates token (E1H) */ -#define QTD_PID_IN (1<<8) /* generates token (69H) */ -#define QTD_PID_SETUP (2<<8) /* generates token (2DH) */ - -#define QTD_ERR_COUNTER (3<<10) /* Token[11:10] */ -#define QTD_IOC (1<<15) /* Token[15] - Interrupt On Complete */ -#define QTD_TODO_LEN_Pos 16 /* Token[31:16] - Total Bytes to Transfer */ -#define QTD_TODO_LEN(x) (((x)>>16) & 0x7FFF) -#define QTD_DT (1UL<<31) /* Token[31] - Data Toggle */ - -/*----------------------------------------------------------------------------------------*/ -/* Queue Head (QH) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct qh_t -{ - /* OHCI spec. Endpoint descriptor */ - uint32_t HLink; /* Queue Head Horizontal Link Pointer */ - uint32_t Chrst; /* Endpoint Characteristics: QH DWord 1 */ - uint32_t Cap; /* Endpoint Capabilities: QH DWord 2 */ - uint32_t Curr_qTD; /* Current qTD Pointer */ - /* - * The followings are qTD Transfer Overlay - */ - uint32_t OL_Next_qTD; /* Next qTD Pointer */ - uint32_t OL_Alt_Next_qTD; /* Alternate Next qTD Pointer */ - uint32_t OL_Token; /* qTD Token */ - uint32_t OL_Bptr[5]; /* qTD Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - qTD_T *dummy; /* point to the inactive dummy qTD */ - qTD_T *qtd_list; /* currently linked qTD transfers */ - qTD_T *done_list; /* currently linked qTD transfers */ - struct qh_t *next; /* point to the next QH in remove list */ -} QH_T; - -/* HLink[0] T field of "Queue Head Horizontal Link Pointer" */ -#define QH_HLNK_END 0x1 - -/* - * HLink[2:1] Typ field of "Queue Head Horizontal Link Pointer" - */ -#define QH_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define QH_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define QH_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define QH_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define QH_PTR(x) ((QH_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Bit fields of "Endpoint Characteristics" - */ -#define QH_NAK_RL (4L<<28) /* Chrst[31:28] - NAK Count Reload */ -#define QH_CTRL_EP_FLAG (1<<27) /* Chrst[27] - Control Endpoint Flag */ -#define QH_RCLM_LIST_HEAD (1<<15) /* Chrst[15] - Head of Reclamation List Flag */ -#define QH_DTC (1<<14) /* Chrst[14] - Data Toggle Control */ -#define QH_EPS_FULL (0<<12) /* Chrst[13:12] - Endpoint Speed (Full) */ -#define QH_EPS_LOW (1<<12) /* Chrst[13:12] - Endpoint Speed (Low) */ -#define QH_EPS_HIGH (2<<12) /* Chrst[13:12] - Endpoint Speed (High) */ -#define QH_I_NEXT (1<<7) /* Chrst[7] - Inactivate on Next Transaction */ - -/* - * Bit fields of "Endpoint Capabilities" - */ -#define QH_MULT_Pos 30 /* Cap[31:30] - High-Bandwidth Pipe Multiplier */ -#define QH_HUB_PORT_Pos 23 /* Cap[29:23] - Hub Port Number */ -#define QH_HUB_ADDR_Pos 16 /* Cap[22:16] - Hub Addr */ -#define QH_C_MASK_Msk 0xFF00 /* Cap[15:8] - uFrame C-mask */ -#define QH_S_MASK_Msk 0x00FF /* Cap[7:0] - uFrame S-mask */ - - -/*----------------------------------------------------------------------------------------*/ -/* Isochronous (High-Speed) Transfer Descriptor (iTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct itd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Transaction[8]; /* Transaction Status and Control */ - uint32_t Bptr[7]; /* Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint32_t buff_base; /* buffer base address */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint8_t trans_mask; /* mask of activated transactions in iTD */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct itd_t *next; /* used by software to maintain iTD list */ -} iTD_T; - -/* - * Next_Link[2:1] Typ field of "Next Schedule Element Pointer" Typ field - */ -#define ITD_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define ITD_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define ITD_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define ITD_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define ITD_PTR(x) ((iTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Transaction[8] - */ -#define ITD_STATUS(x) (((x)>>28)&0xF) -#define ITD_STATUS_ACTIVE (0x80000000UL) /* Active */ -#define ITD_STATUS_BUFF_ERR (0x40000000UL) /* Data Buffer Error */ -#define ITD_STATUS_BABBLE (0x20000000UL) /* Babble Detected */ -#define ITD_STATUS_XACT_ERR (0x10000000UL) /* Transcation Error */ - -#define ITD_XLEN_Pos 16 -#define ITD_XFER_LEN(x) (((x)>>16)&0xFFF) -#define ITD_IOC (1<<15) -#define ITD_PG_Pos 12 -#define ITD_XFER_OFF_Msk 0xFFF - -/* - * Bptr[7] - */ -#define ITD_BUFF_PAGE_Pos 12 -/* Bptr[0] */ -#define ITD_EP_NUM_Pos 8 -#define ITD_EP_NUM(itd) (((itd)->Bptr[0]>>8)&0xF) -#define ITD_DEV_ADDR_Pos 0 -#define ITD_DEV_ADDR(itd) ((itd)->Bptr[0]&0x7F) -/* Bptr[1] */ -#define ITD_DIR_IN (1<<11) -#define ITD_DIR_OUT (0<<11) -#define ITD_MAX_PKTSZ_Pos 0 -#define ITD_MAX_PKTSZ(itd) ((itd)->Bptr[1]&0x7FF) - -/*----------------------------------------------------------------------------------------*/ -/* Split Isochronous (Full-Speed) Transfer Descriptor (siTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct sitd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Chrst; /* Endpoint and Transaction Translator Characteristics */ - uint32_t Sched; /* Micro-frame Schedule Control */ - uint32_t StsCtrl; /* siTD Transfer Status and Control */ - uint32_t Bptr[2]; /* Buffer Page Pointer List */ - uint32_t BackLink; /* siTD Back Link Pointer */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct sitd_t *next; /* used by software to maintain siTD list */ -} siTD_T; - -#define SITD_LIST_END 0x1 /* Indicate the terminate of siTD list. */ - -#define SITD_XFER_IO_Msk (1UL<<31) -#define SITD_XFER_IN (1UL<<31) -#define SITD_XFER_OUT (0UL<<31) - -#define SITD_PORT_NUM_Pos 24 -#define SITD_HUB_ADDR_Pos 16 -#define SITD_EP_NUM_Pos 8 -#define SITD_DEV_ADDR_Pos 0 - -#define SITD_IOC (1UL<<31) -#define SITD_XFER_CNT_Pos 16 -#define SITD_XFER_CNT_Msk (0x3FF<>28) & 0x0F) -#define TD_CC_SET(td, cc) (td) = ((td) & 0x0FFFFFFF) | (((cc) & 0x0F) << 28) -#define TD_T_DATA0 0x02000000 -#define TD_T_DATA1 0x03000000 -#define TD_R 0x00040000 -#define TD_DP 0x00180000 -#define TD_DP_IN 0x00100000 -#define TD_DP_OUT 0x00080000 -#define MAXPSW 8 -/* steel TD reserved bits to keep driver data */ -#define TD_TYPE_Msk (0x3<<16) -#define TD_TYPE_CTRL (0x0<<16) -#define TD_TYPE_BULK (0x1<<16) -#define TD_TYPE_INT (0x2<<16) -#define TD_TYPE_ISO (0x3<<16) -#define TD_CTRL_Msk (0x7<<15) -#define TD_CTRL_DATA (1<<15) - - -/* - * The HCCA (Host Controller Communications Area) is a 256 byte - * structure defined in the OHCI spec. that the host controller is - * told the base address of. It must be 256-byte aligned. - */ -typedef struct -{ - uint32_t int_table[32]; /* Interrupt ED table */ - uint16_t frame_no; /* current frame number */ - uint16_t pad1; /* set to 0 on each frame_no change */ - uint32_t done_head; /* info returned for an interrupt */ - uint8_t reserved_for_hc[116]; -} HCCA_T; - - -/// @endcond - -#endif /* _USBH_OHCI_H_ */ diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/inc/usb.h b/bsp/nuvoton/libraries/m460/USBHostLib/inc/usb.h deleted file mode 100644 index f9816a7babc..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/inc/usb.h +++ /dev/null @@ -1,486 +0,0 @@ -/**************************************************************************//** - * @file usb.h - * @version V1.00 - * @brief USB Host library header file. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_H_ -#define _USBH_H_ - -#include "config.h" -#include "usbh_lib.h" -#include "ehci.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct hub_dev_t; -struct iface_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------*/ -/* USB device request setup packet */ -/*----------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ -typedef struct -{ - __packed uint8_t bmRequestType; - __packed uint8_t bRequest; - __packed uint16_t wValue; - __packed uint16_t wIndex; - __packed uint16_t wLength; -} DEV_REQ_T; -#else -typedef struct __attribute__((__packed__)) -{ - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} -DEV_REQ_T; -#endif - -/* - * bmRequestType[7] - Data transfer direction - */ -#define REQ_TYPE_OUT 0x00 -#define REQ_TYPE_IN 0x80 -/* - * bmRequestType[6:5] - Type - */ -#define REQ_TYPE_STD_DEV 0x00 -#define REQ_TYPE_CLASS_DEV 0x20 -#define REQ_TYPE_VENDOR_DEV 0x40 -/* - * bmRequestType[4:0] - Recipient - */ -#define REQ_TYPE_TO_DEV 0x00 -#define REQ_TYPE_TO_IFACE 0x01 -#define REQ_TYPE_TO_EP 0x02 -#define REQ_TYPE_TO_OTHER 0x03 -/* - * Standard Requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_SET_INTERFACE 0x0B -/* - * Descriptor Types - */ -#define USB_DT_STANDARD 0x00 -#define USB_DT_CLASS 0x20 -#define USB_DT_VENDOR 0x40 - -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIGURATION 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 -#define USB_DT_DEVICE_QUALIFIER 0x06 -#define USB_DT_OTHER_SPEED_CONF 0x07 -#define USB_DT_IFACE_POWER 0x08 - - - -/*----------------------------------------------------------------------------------*/ -/* USB standard descriptors */ -/*----------------------------------------------------------------------------------*/ - -/* Descriptor header */ -#ifdef __ICCARM__ -typedef struct -{ - __packed uint8_t bLength; - __packed uint8_t bDescriptorType; -} DESC_HDR_T; -#else -typedef struct __attribute__((__packed__)) -{ - uint8_t bLength; - uint8_t bDescriptorType; -} -DESC_HDR_T; -#endif - -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ -typedef struct /*!< device descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of device descriptor */ - __packed uint8_t bDescriptorType; /*!< Device descriptor type */ - __packed uint16_t bcdUSB; /*!< USB version number */ - __packed uint8_t bDeviceClass; /*!< Device class code */ - __packed uint8_t bDeviceSubClass; /*!< Device subclass code */ - __packed uint8_t bDeviceProtocol; /*!< Device protocol code */ - __packed uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - __packed uint16_t idVendor; /*!< Vendor ID */ - __packed uint16_t idProduct; /*!< Product ID */ - __packed uint16_t bcdDevice; /*!< Device ID */ - __packed uint8_t iManufacturer; /*!< Manufacture description string ID */ - __packed uint8_t iProduct; /*!< Product description string ID */ - __packed uint8_t iSerialNumber; /*!< Serial number description string ID */ - __packed uint8_t bNumConfigurations; /*!< Total number of configurations */ -} DESC_DEV_T; /*!< device descriptor structure */ -#else -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) /*!< device descriptor structure */ -{ - uint8_t bLength; /*!< Length of device descriptor */ - uint8_t bDescriptorType; /*!< Device descriptor type */ - uint16_t bcdUSB; /*!< USB version number */ - uint8_t bDeviceClass; /*!< Device class code */ - uint8_t bDeviceSubClass; /*!< Device subclass code */ - uint8_t bDeviceProtocol; /*!< Device protocol code */ - uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - uint16_t idVendor; /*!< Vendor ID */ - uint16_t idProduct; /*!< Product ID */ - uint16_t bcdDevice; /*!< Device ID */ - uint8_t iManufacturer; /*!< Manufacture description string ID */ - uint8_t iProduct; /*!< Product description string ID */ - uint8_t iSerialNumber; /*!< Serial number description string ID */ - uint8_t bNumConfigurations; /*!< Total number of configurations */ -} -DESC_DEV_T; /*!< device descriptor structure */ -#endif - -/* - * Configuration Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_config_descriptor /*!< Configuration descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of configuration descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint16_t wTotalLength; /*!< Total length of this configuration */ - __packed uint8_t bNumInterfaces; /*!< Total number of interfaces */ - __packed uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - __packed uint8_t iConfiguration; /*!< String descriptor ID */ - __packed uint8_t bmAttributes; /*!< Configuration characteristics */ - __packed uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_config_descriptor /*!< Configuration descriptor structure */ -{ - uint8_t bLength; /*!< Length of configuration descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint16_t wTotalLength; /*!< Total length of this configuration */ - uint8_t bNumInterfaces; /*!< Total number of interfaces */ - uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - uint8_t iConfiguration; /*!< String descriptor ID */ - uint8_t bmAttributes; /*!< Configuration characteristics */ - uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ -#endif - -/* - * Interface Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_interface_descriptor /*!< Interface descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of interface descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint8_t bInterfaceNumber; /*!< Interface number */ - __packed uint8_t bAlternateSetting;/*!< Alternate setting number */ - __packed uint8_t bNumEndpoints; /*!< Number of endpoints */ - __packed uint8_t bInterfaceClass; /*!< Interface class code */ - __packed uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - __packed uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - __packed uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_interface_descriptor /*!< Interface descriptor structure */ -{ - uint8_t bLength; /*!< Length of interface descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bInterfaceNumber; /*!< Interface number */ - uint8_t bAlternateSetting; /*!< Alternate setting number */ - uint8_t bNumEndpoints; /*!< Number of endpoints */ - uint8_t bInterfaceClass; /*!< Interface class code */ - uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ -#endif - -/* - * Interface descriptor bInterfaceClass[7:0] - */ -#if 0 - #define USB_CLASS_AUDIO 0x01 - #define USB_CLASS_COMM 0x02 - #define USB_CLASS_HID 0x03 - #define USB_CLASS_PRINTER 0x07 - #define USB_CLASS_MASS_STORAGE 0x08 - #define USB_CLASS_HUB 0x09 - #define USB_CLASS_DATA 0x0A - #define USB_CLASS_VIDEO 0x0E -#endif -/* - * Endpoint Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of endpoint descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint8_t bEndpointAddress; /*!< Endpoint address */ - __packed uint8_t bmAttributes; /*!< Endpoint attribute */ - __packed uint16_t wMaxPacketSize; /*!< Maximum packet size */ - __packed uint8_t bInterval; /*!< Synchronous transfer interval */ - __packed uint8_t bRefresh; /*!< Refresh */ - __packed uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - uint8_t bLength; /*!< Length of endpoint descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bEndpointAddress; /*!< Endpoint address */ - uint8_t bmAttributes; /*!< Endpoint attribute */ - uint16_t wMaxPacketSize; /*!< Maximum packet size */ - uint8_t bInterval; /*!< Synchronous transfer interval */ - uint8_t bRefresh; /*!< Refresh */ - uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ -#endif - -/* - * Endpoint descriptor bEndpointAddress[7] - direction - */ -#define EP_ADDR_DIR_MASK 0x80 -#define EP_ADDR_DIR_IN 0x80 -#define EP_ADDR_DIR_OUT 0x00 - -/* - * Endpoint descriptor bmAttributes[1:0] - transfer type - */ -#define EP_ATTR_TT_MASK 0x03 -#define EP_ATTR_TT_CTRL 0x00 -#define EP_ATTR_TT_ISO 0x01 -#define EP_ATTR_TT_BULK 0x02 -#define EP_ATTR_TT_INT 0x03 - - -/*----------------------------------------------------------------------------------*/ -/* USB Host controller driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*init)(void); - void (*shutdown)(void); - void (*suspend)(void); - void (*resume)(void); - int (*ctrl_xfer)(struct utr_t *utr); - int (*bulk_xfer)(struct utr_t *utr); - int (*int_xfer)(struct utr_t *utr); - int (*iso_xfer)(struct utr_t *utr); - int (*quit_xfer)(struct utr_t *utr, struct ep_info_t *ep); - - /* root hub support */ - int (*rthub_port_reset)(int port); - int (*rthub_polling)(void); -} HC_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*probe)(struct iface_t *iface); - void (*disconnect)(struct iface_t *iface); - void (*suspend)(struct iface_t *iface); - void (*resume)(struct iface_t *iface); -} UDEV_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device */ -/*----------------------------------------------------------------------------------*/ - -typedef enum -{ - SPEED_LOW, - SPEED_FULL, - SPEED_HIGH -} SPEED_E; - -typedef struct ep_info_t -{ - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint8_t bInterval; - uint8_t bToggle; - uint16_t wMaxPacketSize; - void *hw_pipe; /*!< point to the HC assocaied endpoint \hideinitializer */ -} EP_INFO_T; - -typedef struct udev_t -{ - DESC_DEV_T descriptor; /*!< Device descriptor. \hideinitializer */ - struct hub_dev_t *parent; /*!< parent hub device \hideinitializer */ - uint8_t port_num; /*!< The hub port this device connected on \hideinitializer */ - uint8_t dev_num; /*!< device number \hideinitializer */ - int8_t cur_conf; /*!< Currentll selected configuration \hideinitializer */ - SPEED_E speed; /*!< device speed (low/full/high) \hideinitializer */ - /* - * The followings are lightweight USB stack internal used . - */ - uint8_t *cfd_buff; /*!< Configuration descriptor buffer. \hideinitializer */ - EP_INFO_T ep0; /*!< Endpoint 0 \hideinitializer */ - HC_DRV_T *hc_driver; /*!< host controller driver \hideinitializer */ - struct iface_t *iface_list; /*!< Working interface list \hideinitializer */ - struct udev_t *next; /*!< link for global usb device list \hideinitializer */ -} UDEV_T; - -typedef struct alt_iface_t -{ - DESC_IF_T *ifd; /*!< point to the location of this alternative interface descriptor in UDEV_T->cfd_buff */ - EP_INFO_T ep[MAX_EP_PER_IFACE]; /*!< endpoints of this alternative interface */ -} ALT_IFACE_T; - -typedef struct iface_t -{ - UDEV_T *udev; /*!< USB device \hideinitializer */ - uint8_t if_num; /*!< Interface number \hideinitializer */ - uint8_t num_alt; /*!< Number of alternative interface \hideinitializer */ - ALT_IFACE_T *aif; /*!< Point to the active alternative interface */ - ALT_IFACE_T alt[MAX_ALT_PER_IFACE]; /*!< List of alternative interface \hideinitializer */ - UDEV_DRV_T *driver; /*!< Interface associated driver \hideinitializer */ - void *context; /*!< Reference to device context \hideinitializer */ - struct iface_t *next; /*!< Point to next interface of the same device. Started from UDEV_T->iface_list \hideinitializer */ -} IFACE_T; - - -/*----------------------------------------------------------------------------------*/ -/* URB (USB Request Block) */ -/*----------------------------------------------------------------------------------*/ - -#define IF_PER_UTR 8 /* number of frames per UTR isochronous transfer (DO NOT modify it!) */ - -typedef void (*FUNC_UTR_T)(struct utr_t *); - -typedef struct utr_t -{ - UDEV_T *udev; /*!< point to associated USB device \hideinitializer */ - DEV_REQ_T setup; /*!< buffer for setup packet \hideinitializer */ - EP_INFO_T *ep; /*!< associated endpoint \hideinitializer */ - uint8_t *buff; /*!< transfer buffer \hideinitializer */ - uint8_t bIsTransferDone; /*!< tansfer done? \hideinitializer */ - uint32_t data_len; /*!< length of data to be transferred \hideinitializer */ - uint32_t xfer_len; /*!< length of transferred data \hideinitializer */ - uint8_t bIsoNewSched; /*!< New schedule isochronous transfer \hideinitializer */ - uint16_t iso_sf; /*!< Isochronous start frame number \hideinitializer */ - uint16_t iso_xlen[IF_PER_UTR]; /*!< transfer length of isochronous frames \hideinitializer */ - uint8_t *iso_buff[IF_PER_UTR]; /*!< transfer buffer address of isochronous frames \hideinitializer */ - int iso_status[IF_PER_UTR]; /*!< transfer status of isochronous frames \hideinitializer */ - int td_cnt; /*!< number of transfer descriptors \hideinitializer */ - int status; /*!< return status \hideinitializer */ - int interval; /*!< interrupt/isochronous interval \hideinitializer */ - void *context; /*!< point to deivce proprietary data area \hideinitializer */ - FUNC_UTR_T func; /*!< tansfer done call-back function \hideinitializer */ - struct utr_t *next; /* point to the next UTR of the same endpoint. \hideinitializer */ -} UTR_T; - - -/*----------------------------------------------------------------------------------*/ -/* Global variables */ -/*----------------------------------------------------------------------------------*/ -extern USBH_T *_ohci; -extern HSUSBH_T *_ehci; - -extern HC_DRV_T ohci_driver; -extern HC_DRV_T ehci_driver; - -extern UDEV_T *g_udev_list; - -/*----------------------------------------------------------------------------------*/ -/* USB stack exported functions */ -/*----------------------------------------------------------------------------------*/ -extern void usbh_delay_ms(int msec); - -extern void dump_ohci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ohci_int_table(void); -extern void dump_ehci_regs(void); -extern void dump_ehci_qtd(qTD_T *qtd); -extern void dump_ehci_asynclist(void); -extern void dump_ehci_period_frame_list_simple(void); -extern void usbh_dump_buff_bytes(uint8_t *buff, int nSize); -extern void usbh_dump_interface_descriptor(DESC_IF_T *if_desc); -extern void usbh_dump_endpoint_descriptor(DESC_EP_T *ep_desc); -extern void usbh_dump_iface(IFACE_T *iface); -extern void usbh_dump_ep_info(EP_INFO_T *ep); - -/* - * Memory management functions - */ -extern void usbh_memory_init(void); -extern uint32_t usbh_memory_used(void); -extern void *usbh_alloc_mem(int size); -extern void usbh_free_mem(void *p, int size); -extern int alloc_dev_address(void); -extern void free_dev_address(int dev_addr); -extern UDEV_T *alloc_device(void); -extern void free_device(UDEV_T *udev); -extern UTR_T *alloc_utr(UDEV_T *udev); -extern void free_utr(UTR_T *utr); -extern ED_T *alloc_ohci_ED(void); -extern void free_ohci_ED(ED_T *ed); -extern TD_T *alloc_ohci_TD(UTR_T *utr); -extern void free_ohci_TD(TD_T *td); -extern QH_T *alloc_ehci_QH(void); -extern void free_ehci_QH(QH_T *qh); -extern qTD_T *alloc_ehci_qTD(UTR_T *utr); -extern void free_ehci_qTD(qTD_T *qtd); -extern iTD_T *alloc_ehci_iTD(void); -extern void free_ehci_iTD(iTD_T *itd); -extern siTD_T *alloc_ehci_siTD(void); -extern void free_ehci_siTD(siTD_T *sitd); - - -extern void usbh_hub_init(void); -extern int usbh_connect_device(UDEV_T *); -extern void usbh_disconnect_device(UDEV_T *); -extern int usbh_register_driver(UDEV_DRV_T *driver); -extern EP_INFO_T *usbh_iface_find_ep(IFACE_T *iface, uint8_t ep_addr, uint8_t dir_type); -extern int usbh_reset_device(UDEV_T *); -extern int usbh_reset_port(UDEV_T *); - -/* - * USB Standard Request functions - */ -extern int usbh_get_device_descriptor(UDEV_T *udev, DESC_DEV_T *desc_buff); -extern int usbh_get_config_descriptor(UDEV_T *udev, uint8_t *desc_buff, int buff_len); -extern int usbh_set_configuration(UDEV_T *udev, uint8_t conf_val); -extern int usbh_set_interface(IFACE_T *iface, uint16_t alt_setting); -extern int usbh_clear_halt(UDEV_T *udev, uint16_t ep_addr); - -extern int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout); -extern int usbh_bulk_xfer(UTR_T *utr); -extern int usbh_int_xfer(UTR_T *utr); -extern int usbh_iso_xfer(UTR_T *utr); -extern int usbh_quit_utr(UTR_T *utr); -extern int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep); - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_H_ */ diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/inc/usbh_lib.h b/bsp/nuvoton/libraries/m460/USBHostLib/inc/usbh_lib.h deleted file mode 100644 index a4b86c9df6f..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/inc/usbh_lib.h +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************//** - * @file usbh_lib.h - * @version V1.10 - * @brief USB Host library exported header file. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef _USBH_LIB_H_ -#define _USBH_LIB_H_ - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup LIBRARY Library - @{ -*/ - -/** @addtogroup USBH_Library USB Host Library - @{ -*/ - -/** @addtogroup USBH_EXPORTED_CONSTANTS USB Host Exported Constants - @{ -*/ - -#define USBH_OK 0 /*!< No error. */ -#define USBH_ERR_MEMORY_OUT -10 /*!< Out of memory. */ -#define USBH_ERR_IF_ALT_LIMIT -11 /*!< Number of alternative interface > MAX_ALT_PER_IFACE */ -#define USBH_ERR_IF_EP_LIMIT -15 /*!< Number of endpoints > MAX_EP_PER_IFACE */ -#define USBH_ERR_NOT_SUPPORTED -101 /*!< Device/Class/Transfer not supported */ -#define USBH_ERR_NOT_MATCHED -103 /*!< Not macthed */ -#define USBH_ERR_NOT_EXPECTED -104 /*!< Unknown or unexpected */ -#define USBH_ERR_INVALID_PARAM -105 /*!< Invalid parameter */ -#define USBH_ERR_NOT_FOUND -106 /*!< Device or interface not found */ -#define USBH_ERR_EP_NOT_FOUND -107 /*!< Endpoint not found */ -#define USBH_ERR_DESCRIPTOR -137 /*!< Failed to parse USB descriptors */ -#define USBH_ERR_SET_DEV_ADDR -139 /*!< Failed to set device address */ -#define USBH_ERR_SET_CONFIG -151 /*!< Failed to set device configuration */ - -#define USBH_ERR_TRANSFER -201 /*!< USB transfer error */ -#define USBH_ERR_TIMEOUT -203 /*!< USB transfer time-out */ -#define USBH_ERR_ABORT -205 /*!< USB transfer aborted due to disconnect or reset */ -#define USBH_ERR_PORT_RESET -255 /*!< Hub port reset failed */ -#define USBH_ERR_SCH_OVERRUN -257 /*!< USB isochronous schedule overrun */ -#define USBH_ERR_DISCONNECTED -259 /*!< USB device was disconnected */ - -#define USBH_ERR_TRANSACTION -271 /*!< USB transaction timeout, CRC, Bad PID, etc. */ -#define USBH_ERR_BABBLE_DETECTED -272 /*!< A 'babble' is detected during the transaction */ -#define USBH_ERR_DATA_BUFF -274 /*!< Data buffer overrun or underrun */ - -#define USBH_ERR_CC_NO_ERR -280 /*!< OHCI CC code - no error */ -#define USBH_ERR_CRC -281 /*!< USB trasfer CRC error */ -#define USBH_ERR_BIT_STUFF -282 /*!< USB transfer bit stuffing error */ -#define USBH_ERR_DATA_TOGGLE -283 /*!< USB trasfer data toggle error */ -#define USBH_ERR_STALL -284 /*!< USB trasfer STALL error */ -#define USBH_ERR_DEV_NO_RESP -285 /*!< USB trasfer device no response error */ -#define USBH_ERR_PID_CHECK -286 /*!< USB trasfer PID check failure */ -#define USBH_ERR_UNEXPECT_PID -287 /*!< USB trasfer unexpected PID error */ -#define USBH_ERR_DATA_OVERRUN -288 /*!< USB trasfer data overrun error */ -#define USBH_ERR_DATA_UNDERRUN -289 /*!< USB trasfer data underrun error */ -#define USBH_ERR_BUFF_OVERRUN -292 /*!< USB trasfer buffer overrun error */ -#define USBH_ERR_BUFF_UNDERRUN -293 /*!< USB trasfer buffer underrun error */ -#define USBH_ERR_NOT_ACCESS0 -294 /*!< USB trasfer not accessed error */ -#define USBH_ERR_NOT_ACCESS1 -295 /*!< USB trasfer not accessed error */ - -#define USBH_ERR_OHCI_INIT -301 /*!< Failed to initialize OHIC controller. */ -#define USBH_ERR_OHCI_EP_BUSY -303 /*!< The endpoint is under transfer. */ - -#define USBH_ERR_EHCI_INIT -501 /*!< Failed to initialize EHCI controller. */ -#define USBH_ERR_EHCI_QH_BUSY -503 /*!< the Queue Head is busy. */ - -#define UMAS_OK 0 /*!< No error. */ -#define UMAS_ERR_NO_DEVICE -1031 /*!< No Mass Stroage Device found. */ -#define UMAS_ERR_IO -1033 /*!< Device read/write failed. */ -#define UMAS_ERR_INIT_DEVICE -1035 /*!< failed to init MSC device */ -#define UMAS_ERR_CMD_STATUS -1037 /*!< SCSI command status failed */ -#define UMAS_ERR_IVALID_PARM -1038 /*!< Invalid parameter. */ -#define UMAS_ERR_DRIVE_NOT_FOUND -1039 /*!< drive not found */ - -#define HID_RET_OK 0 /*!< Return with no errors. */ -#define HID_RET_DEV_NOT_FOUND -1081 /*!< HID device not found or removed. */ -#define HID_RET_IO_ERR -1082 /*!< USB transfer failed. */ -#define HID_RET_INVALID_PARAMETER -1083 /*!< Invalid parameter. */ -#define HID_RET_OUT_OF_MEMORY -1084 /*!< Out of memory. */ -#define HID_RET_NOT_SUPPORTED -1085 /*!< Function not supported. */ -#define HID_RET_EP_NOT_FOUND -1086 /*!< Endpoint not found. */ -#define HID_RET_PARSING -1087 /*!< Failed to parse HID descriptor */ -#define HID_RET_XFER_IS_RUNNING -1089 /*!< The transfer has been enabled. */ -#define HID_RET_REPORT_NOT_FOUND -1090 /*!< The transfer has been enabled. */ - -#define UAC_RET_OK 0 /*!< Return with no errors. */ -#define UAC_RET_DEV_NOT_FOUND -2001 /*!< Audio Class device not found or removed. */ -#define UAC_RET_FUNC_NOT_FOUND -2002 /*!< Audio device has no this function. */ -#define UAC_RET_IO_ERR -2003 /*!< USB transfer failed. */ -#define UAC_RET_DATA_LEN -2004 /*!< Unexpected transfer length */ -#define UAC_RET_INVALID -2005 /*!< Invalid parameter or usage. */ -#define UAC_RET_OUT_OF_MEMORY -2007 /*!< Out of memory. */ -#define UAC_RET_DRV_NOT_SUPPORTED -2009 /*!< Function not supported by this UAC driver. */ -#define UAC_RET_DEV_NOT_SUPPORTED -2011 /*!< Function not supported by the UAC device. */ -#define UAC_RET_PARSER -2013 /*!< Failed to parse UAC descriptor */ -#define UAC_RET_IS_STREAMING -2015 /*!< Audio pipe is on streaming. */ - - -/*@}*/ /* end of group USBH_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBH_EXPORTED_TYPEDEF USB Host Typedef - @{ -*/ -struct udev_t; -typedef void (CONN_FUNC)(struct udev_t *udev, int param); - -struct line_coding_t; -struct cdc_dev_t; -typedef void (CDC_CB_FUNC)(struct cdc_dev_t *cdev, uint8_t *rdata, int data_len); - -struct usbhid_dev; -typedef void (HID_IR_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *rdata, uint32_t data_len); /*!< interrupt in callback function \hideinitializer */ -typedef void (HID_IW_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *wbuff, uint32_t *data_len); /*!< interrupt out callback function \hideinitializer */ - -struct uac_dev_t; -typedef int (UAC_CB_FUNC)(struct uac_dev_t *dev, uint8_t *data, int len); /*!< audio in callback function \hideinitializer */ - -/*@}*/ /* end of group USBH_EXPORTED_STRUCT */ - - - -/** @addtogroup USBH_EXPORTED_FUNCTIONS USB Host Exported Functions - @{ -*/ - -/*------------------------------------------------------------------*/ -/* */ -/* USB Core Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_core_init(void); -extern int usbh_polling_root_hubs(void); -extern void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func); -extern void usbh_suspend(void); -extern void usbh_resume(void); -extern struct udev_t *usbh_find_device(char *hub_id, int port); - -/** - * @brief A function return current tick count. - * @return Current tick. - * @details User application must provide this function to return current tick. - * The tick should increase by 1 for every 10 ms. - */ -extern uint32_t usbh_get_ticks(void); /* This function must be provided by user application. */ -extern uint32_t usbh_tick_from_millisecond(uint32_t msec); /* This function must be provided by user application. */ - - -/// @cond HIDDEN_SYMBOLS - -extern void dump_ohci_regs(void); -extern void dump_ehci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ehci_ports(void); -extern uint32_t usbh_memory_used(void); - -/// @endcond HIDDEN_SYMBOLS - - -/*@}*/ /* end of group USBH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBH_Library */ - -/*@}*/ /* end of group LIBRARY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _USBH_LIB_H_ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/src/ehci.c b/bsp/nuvoton/libraries/m460/USBHostLib/src/ehci.c deleted file mode 100644 index 709568b0d04..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/src/ehci.c +++ /dev/null @@ -1,1312 +0,0 @@ -/**************************************************************************//** - * @file ehci.c - * @version V1.10 - * @brief USB Host library EHCI (USB 2.0) host controller driver. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -static QH_T *_H_qh; /* head of reclamation list */ -static qTD_T *_ghost_qtd; /* used as a terminator qTD */ -static QH_T *qh_remove_list; - -extern ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ -extern int ehci_iso_xfer(UTR_T *utr); /* EHCI isochronous transfer function */ -extern int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep); - -#ifdef __ICCARM__ - #pragma data_alignment=4096 - uint32_t _PFList[FL_SIZE]; /* Periodic frame list (IAR) */ -#else - uint32_t _PFList[FL_SIZE] __attribute__((aligned(4096))); /* Periodic frame list */ -#endif - -QH_T *_Iqh[NUM_IQH]; - - -#ifdef ENABLE_ERROR_MSG -void dump_ehci_regs() -{ - USB_debug("Dump HSUSBH(EHCI) registers:\n"); - USB_debug(" UCMDR = 0x%x\n", _ehci->UCMDR); - USB_debug(" USTSR = 0x%x\n", _ehci->USTSR); - USB_debug(" UIENR = 0x%x\n", _ehci->UIENR); - USB_debug(" UFINDR = 0x%x\n", _ehci->UFINDR); - USB_debug(" UPFLBAR = 0x%x\n", _ehci->UPFLBAR); - USB_debug(" UCALAR = 0x%x\n", _ehci->UCALAR); - USB_debug(" UASSTR = 0x%x\n", _ehci->UASSTR); - USB_debug(" UCFGR = 0x%x\n", _ehci->UCFGR); - USB_debug(" UPSCR = 0x%x\n", _ehci->UPSCR[0]); - USB_debug(" PHYCTL0 = 0x%x\n", _ehci->USBPCR0); - USB_debug(" PHYCTL1 = 0x%x\n", _ehci->USBPCR1); -} - -void dump_ehci_ports() -{ - USB_debug("_ehci port0=0x%x, port1=0x%x\n", _ehci->UPSCR[0], _ehci->UPSCR[1]); -} - -void dump_ehci_qtd(qTD_T *qtd) -{ - USB_debug(" [qTD] - 0x%08x\n", (int)qtd); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qtd->Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qtd->Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token) PID: %s, Bytes: %d, IOC: %d\n", qtd->Token, (((qtd->Token >> 8) & 0x3) == 0) ? "OUT" : ((((qtd->Token >> 8) & 0x3) == 1) ? "IN" : "SETUP"), (qtd->Token >> 16) & 0x7FFF, (qtd->Token >> 15) & 0x1); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qtd->Bptr[0]); - //USB_debug(" 0x%08x (Buffer Pointer (page 1))\n", qtd->Bptr[1]); - //USB_debug(" 0x%08x (Buffer Pointer (page 2))\n", qtd->Bptr[2]); - //USB_debug(" 0x%08x (Buffer Pointer (page 3))\n", qtd->Bptr[3]); - //USB_debug(" 0x%08x (Buffer Pointer (page 4))\n", qtd->Bptr[4]); - USB_debug("\n"); -} - -void dump_ehci_asynclist(void) -{ - QH_T *qh = _H_qh; - qTD_T *qtd; - - USB_debug(">>> Dump EHCI Asynchronous List <<<\n"); - do - { - USB_debug("[QH] - 0x%08x\n", (int)qh); - USB_debug(" 0x%08x (Queue Head Horizontal Link Pointer, Queue Head DWord 0)\n", qh->HLink); - USB_debug(" 0x%08x (Endpoint Characteristics) DevAddr: %d, EP: 0x%x, PktSz: %d, Speed: %s\n", qh->Chrst, qh->Chrst & 0x7F, (qh->Chrst >> 8) & 0xF, (qh->Chrst >> 16) & 0x7FF, ((qh->Chrst >> 12) & 0x3 == 0) ? "Full" : (((qh->Chrst >> 12) & 0x3 == 1) ? "Low" : "High")); - USB_debug(" 0x%08x (Endpoint Capabilities: Queue Head DWord 2)\n", qh->Cap); - USB_debug(" 0x%08x (Current qtd Pointer)\n", qh->Curr_qTD); - USB_debug(" --- Overlay Area ---\n"); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qh->OL_Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qh->OL_Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token)\n", qh->OL_Token); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qh->OL_Bptr[0]); - USB_debug("\n"); - - qtd = QTD_PTR(qh->Curr_qTD); - while (qtd != NULL) - { - dump_ehci_qtd(qtd); - qtd = QTD_PTR(qtd->Next_qTD); - } - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); -} - -void dump_ehci_asynclist_simple(void) -{ - QH_T *qh = _H_qh; - - USB_debug(">>> EHCI Asynchronous List <<<\n"); - USB_debug("[QH] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list_simple(void) -{ - QH_T *qh = _Iqh[NUM_IQH - 1]; - - USB_debug(">>> EHCI period frame list simple <<<\n"); - USB_debug("[FList] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != NULL); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list() -{ - int i; - QH_T *qh; - - for (i = 0; i < FL_SIZE; i++) - { - USB_debug("!%02d: ", i); - qh = QH_PTR(_PFList[i]);; - while (qh != NULL) - { - // USB_debug("0x%x (0x%x) => ", (int)qh, qh->HLink); - USB_debug("0x%x => ", (int)qh); - qh = QH_PTR(qh->HLink); - } - USB_debug("0\n"); - } -} - -#endif /* ENABLE_ERROR_MSG */ - -static void init_periodic_frame_list() -{ - QH_T *qh_p; - int i, idx, interval; - - memset(_PFList, 0, sizeof(_PFList)); - - iso_ep_list = NULL; - - for (i = NUM_IQH - 1; i >= 0; i--) /* interval = i^2 */ - { - _Iqh[i] = alloc_ehci_QH(); - - _Iqh[i]->HLink = QH_HLNK_END; - _Iqh[i]->Curr_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Next_qTD = QTD_LIST_END; - _Iqh[i]->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Token = QTD_STS_HALT; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < FL_SIZE; idx += interval) - { - if (_PFList[idx] == 0) /* is empty list, insert directly */ - { - _PFList[idx] = QH_HLNK_QH(_Iqh[i]); - } - else - { - qh_p = QH_PTR(_PFList[idx]); - - while (1) - { - if (qh_p == _Iqh[i]) - break; /* already chained by previous visit */ - - if (qh_p->HLink == QH_HLNK_END) /* reach end of list? */ - { - qh_p->HLink = QH_HLNK_QH(_Iqh[i]); - break; - } - qh_p = QH_PTR(qh_p->HLink); - } - } - } - } -} - -static QH_T *get_int_tree_head_node(int interval) -{ - int i; - - interval /= 8; /* each frame list entry for 8 micro-frame */ - - for (i = 0; i < NUM_IQH - 1; i++) - { - interval >>= 1; - if (interval == 0) - return _Iqh[i]; - } - return _Iqh[NUM_IQH - 1]; -} - -static int make_int_s_mask(int bInterval) -{ - int order, interval; - - interval = 1; - while (bInterval > 1) - { - interval *= 2; - bInterval--; - } - - if (interval < 2) - return 0xFF; /* interval 1 */ - if (interval < 4) - return 0x55; /* interval 2 */ - if (interval < 8) - return 0x22; /* interval 4 */ - for (order = 0; (interval > 1); order++) - { - interval >>= 1; - } - return (0x1 << (order % 8)); -} - -static int ehci_init(void) -{ - int timeout = 250 * 1000; /* EHCI reset time-out 250 ms */ - - /*------------------------------------------------------------------------------------*/ - /* Reset EHCI host controller */ - /*------------------------------------------------------------------------------------*/ - _ehci->UCMDR = HSUSBH_UCMDR_HCRST_Msk; - while ((_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) && (timeout > 0)) - { - usbh_delay_ms(1); - timeout -= 1000; - } - if (_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) - return USBH_ERR_EHCI_INIT; - - _ehci->UCMDR = UCMDR_INT_THR_CTRL | HSUSBH_UCMDR_RUN_Msk; - - _ghost_qtd = alloc_ehci_qTD(NULL); - _ghost_qtd->Token = 0x11197B3F; //QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It represents a qhost qTD. - - /*------------------------------------------------------------------------------------*/ - /* Initialize asynchronous list */ - /*------------------------------------------------------------------------------------*/ - qh_remove_list = NULL; - - /* Create the QH list head with H-bit 1 */ - _H_qh = alloc_ehci_QH(); - _H_qh->HLink = QH_HLNK_QH(_H_qh); /* circular link to itself, the only one QH */ - _H_qh->Chrst = QH_RCLM_LIST_HEAD; /* it's the head of reclamation list */ - _H_qh->Curr_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Next_qTD = QTD_LIST_END; - _H_qh->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Token = QTD_STS_HALT; - _ehci->UCALAR = (uint32_t)_H_qh; - - /*------------------------------------------------------------------------------------*/ - /* Initialize periodic list */ - /*------------------------------------------------------------------------------------*/ - if (FL_SIZE == 256) - _ehci->UCMDR |= (0x2 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 512) - _ehci->UCMDR |= (0x1 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 1024) - _ehci->UCMDR |= (0x0 << HSUSBH_UCMDR_FLSZ_Pos); - else - return USBH_ERR_EHCI_INIT; /* Invalid FL_SIZE setting! */ - - _ehci->UPFLBAR = (uint32_t)_PFList; - - /*------------------------------------------------------------------------------------*/ - /* start run */ - /*------------------------------------------------------------------------------------*/ - - _ehci->UCFGR = 0x1; /* enable port routing to EHCI */ - _ehci->UIENR = HSUSBH_UIENR_USBIEN_Msk | HSUSBH_UIENR_UERRIEN_Msk | HSUSBH_UIENR_HSERREN_Msk | HSUSBH_UIENR_IAAEN_Msk; - - usbh_delay_ms(1); /* delay 1 ms */ - - _ehci->UPSCR[0] = HSUSBH_UPSCR_PP_Msk; /* enable port 1 port power */ - _ehci->UPSCR[1] = HSUSBH_UPSCR_PP_Msk | HSUSBH_UPSCR_PO_Msk; /* set port 2 owner to OHCI */ - - init_periodic_frame_list(); - - usbh_delay_ms(10); /* delay 10 ms */ - - return 0; -} - -static void ehci_suspend(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] |= HSUSBH_UPSCR_SUSPEND_Msk; -} - -static void ehci_resume(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] = (HSUSBH->UPSCR[0] & ~HSUSBH_UPSCR_SUSPEND_Msk) | HSUSBH_UPSCR_FPR_Msk; -} - -static void ehci_shutdown(void) -{ - ehci_suspend(); -} - -static void move_qh_to_remove_list(QH_T *qh) -{ - QH_T *q; - - // USB_debug("move_qh_to_remove_list - 0x%x (0x%x)\n", (int)qh, qh->Chrst); - - /* check if this ED found in ed_remove_list */ - q = qh_remove_list; - while (q) - { - if (q == qh) /* This QH found in qh_remove_list. */ - { - return; /* Do nothing, return... */ - } - q = q->next; - } - - DISABLE_EHCI_IRQ(); - - /*------------------------------------------------------------------------------------*/ - /* Search asynchronous frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _H_qh; /* find and remove it from asynchronous list */ - while (QH_PTR(q->HLink) != _H_qh) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - - /*------------------------------------------------------------------------------------*/ - /* Search periodic frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _Iqh[NUM_IQH - 1]; - while (q->HLink != QH_HLNK_END) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - ENABLE_EHCI_IRQ(); -} - -static void append_to_qtd_list_of_QH(QH_T *qh, qTD_T *qtd) -{ - qTD_T *q; - - if (qh->qtd_list == NULL) - { - qh->qtd_list = qtd; - } - else - { - q = qh->qtd_list; - while (q->next != NULL) - { - q = q->next; - } - q->next = qtd; - } -} - -/* - * If ep==NULL, it's a control endpoint QH. - */ -static void write_qh(UDEV_T *udev, EP_INFO_T *ep, QH_T *qh) -{ - uint32_t chrst, cap; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 1 - Endpoint Characteristics */ - /*------------------------------------------------------------------------------------*/ - if (ep == NULL) /* is control endpoint? */ - { - if (udev->descriptor.bMaxPacketSize0 == 0) - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - chrst = QH_DTC | QH_NAK_RL | (udev->descriptor.bMaxPacketSize0 << 16); - if (udev->speed != SPEED_HIGH) - chrst |= QH_CTRL_EP_FLAG; /* non-high-speed control endpoint */ - } - else /* not a control endpoint */ - { - chrst = QH_NAK_RL | (ep->wMaxPacketSize << 16); - chrst |= ((ep->bEndpointAddress & 0xf) << 8); /* Endpoint Address */ - } - - if (udev->speed == SPEED_LOW) - chrst |= QH_EPS_LOW; - else if (udev->speed == SPEED_FULL) - chrst |= QH_EPS_FULL; - else - chrst |= QH_EPS_HIGH; - - chrst |= udev->dev_num; - - qh->Chrst = chrst; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 2 - Endpoint Capabilities */ - /*------------------------------------------------------------------------------------*/ - if (udev->speed == SPEED_HIGH) - { - cap = 0; - } - else - { - /* - * Backtrace device tree until the USB 2.0 hub found - */ - HUB_DEV_T *hub; - int port_num; - - port_num = udev->port_num; - hub = udev->parent; - - while ((hub != NULL) && (hub->iface->udev->speed != SPEED_HIGH)) - { - port_num = hub->iface->udev->port_num; - hub = hub->iface->udev->parent; - } - - cap = (port_num << QH_HUB_PORT_Pos) | - (hub->iface->udev->dev_num << QH_HUB_ADDR_Pos); - } - - qh->Cap = cap; -} - -static void write_qtd_bptr(qTD_T *qtd, uint32_t buff_addr, int xfer_len) -{ - int i; - - qtd->xfer_len = xfer_len; - qtd->Bptr[0] = buff_addr; - - buff_addr = (buff_addr + 0x1000) & ~0xFFF; - - for (i = 1; i < 5; i++) - { - qtd->Bptr[i] = buff_addr; - buff_addr += 0x1000; - } -} - -static int ehci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - QH_T *qh; - qTD_T *qtd_setup, *qtd_data, *qtd_status; - uint32_t token; - int is_new_qh = 0; - - udev = utr->udev; - - if (utr->data_len > 0) - { - if (((uint32_t)utr->buff + utr->data_len) > (((uint32_t)utr->buff & ~0xFFF) + 0x5000)) - return USBH_ERR_BUFF_OVERRUN; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate and link QH */ - /*------------------------------------------------------------------------------------*/ - if (udev->ep0.hw_pipe != NULL) - { - qh = (QH_T *)udev->ep0.hw_pipe; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - - udev->ep0.hw_pipe = (void *)qh; /* driver can find QH from EP */ - is_new_qh = 1; - } - write_qh(udev, NULL, qh); - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - - /*------------------------------------------------------------------------------------*/ - /* Allocate qTDs */ - /*------------------------------------------------------------------------------------*/ - qtd_setup = alloc_ehci_qTD(utr); /* allocate qTD for SETUP */ - - if (utr->data_len > 0) - qtd_data = alloc_ehci_qTD(utr); /* allocate qTD for DATA */ - else - qtd_data = NULL; - - qtd_status = alloc_ehci_qTD(utr); /* allocate qTD for USTSR */ - - if (qtd_status == NULL) /* out of memory? */ - { - if (qtd_setup) - free_ehci_qTD(qtd_setup); /* free memory */ - if (qtd_data) - free_ehci_qTD(qtd_data); /* free memory */ - return USBH_ERR_MEMORY_OUT; /* out of memory */ - } - - // USB_debug("qh=0x%x, qtd_setup=0x%x, qtd_data=0x%x, qtd_status=0x%x\n", (int)qh, (int)qtd_setup, (int)qtd_data, (int)qtd_status); - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_setup->qh = qh; - //qtd_setup->utr = utr; - write_qtd_bptr(qtd_setup, (uint32_t)&utr->setup, 8); - append_to_qtd_list_of_QH(qh, qtd_setup); - qtd_setup->Token = (8 << 16) | QTD_ERR_COUNTER | QTD_PID_SETUP | QTD_STS_ACTIVE; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage qTD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - qtd_setup->Next_qTD = (uint32_t)qtd_data; - qtd_data->Next_qTD = (uint32_t)qtd_status; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd_data->qh = qh; - //qtd_data->utr = utr; - write_qtd_bptr(qtd_data, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd_data); - qtd_data->Token = QTD_DT | (utr->data_len << 16) | token; - } - else - { - qtd_setup->Next_qTD = (uint32_t)qtd_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare USTSR stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_status->Next_qTD = (uint32_t)_ghost_qtd; - qtd_status->Alt_Next_qTD = QTD_LIST_END; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - - qtd_status->qh = qh; - //qtd_status->utr = utr; - append_to_qtd_list_of_QH(qh, qtd_status); - qtd_status->Token = QTD_DT | QTD_IOC | token; - - /*------------------------------------------------------------------------------------*/ - /* Update QH overlay */ - /*------------------------------------------------------------------------------------*/ - qh->Curr_qTD = 0; - qh->OL_Next_qTD = (uint32_t)qtd_setup; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = 0; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - return 0; -} - -static int ehci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh; - qTD_T *qtd, *qtd_pre; - uint32_t data_len, xfer_len; - uint8_t *buff; - uint32_t token; - int is_new_qh = 0; - - //USB_debug("Bulk XFER =>\n"); - // dump_ehci_asynclist_simple(); - - udev = utr->udev; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - { - return USBH_ERR_EHCI_QH_BUSY; - } - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTDs */ - /*------------------------------------------------------------------------------------*/ - data_len = utr->data_len; - buff = utr->buff; - qtd_pre = NULL; - - while (data_len > 0) - { - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - qtd = qh->qtd_list; - while (qtd != NULL) - { - qtd_pre = qtd; - qtd = qtd->next; - free_ehci_qTD(qtd_pre); - } - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - if (data_len > 0x4000) /* force maximum x'fer length 16K per qTD */ - xfer_len = 0x4000; - else - xfer_len = data_len; /* remaining data length < 4K */ - - qtd->qh = qh; - qtd->Next_qTD = (uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)buff, xfer_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = (xfer_len << 16) | token; - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - if (data_len == 0) /* is this the latest qTD? */ - { - qtd->Token |= QTD_IOC; /* ask to raise an interrupt on the last qTD */ - qtd->Next_qTD = (uint32_t)_ghost_qtd; /* qTD list end */ - } - - if (qtd_pre != NULL) - qtd_pre->Next_qTD = (uint32_t)qtd; - qtd_pre = qtd; - } - - //USB_debug("utr=0x%x, qh=0x%x, qtd=0x%x\n", (int)utr, (int)qh, (int)qh->qtd_list); - - qtd = qh->qtd_list; - -// qh->Curr_qTD = 0; //(uint32_t)qtd; - qh->OL_Next_qTD = (uint32_t)qtd; -// qh->OL_Alt_Next_qTD = QTD_LIST_END; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - - qh->OL_Token = 0; //qtd->Token; - - if (utr->ep->bToggle) - qh->OL_Token |= QTD_DT; - - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - - return 0; -} - -static int ehci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh, *iqh; - qTD_T *qtd, *dummy_qtd; - uint32_t token; - - dummy_qtd = alloc_ehci_qTD(NULL); /* allocate a new dummy qTD */ - if (dummy_qtd == NULL) - return USBH_ERR_MEMORY_OUT; - dummy_qtd->Token &= ~(QTD_STS_ACTIVE | QTD_STS_HALT); - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - { - free_ehci_qTD(dummy_qtd); - return USBH_ERR_MEMORY_OUT; - } - write_qh(udev, ep, qh); - qh->Chrst &= ~0xF0000000; - - if (udev->speed == SPEED_HIGH) - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & 0xff) | make_int_s_mask(ep->bInterval); - } - else - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & ~(QH_C_MASK_Msk | QH_S_MASK_Msk)) | 0x7802; - } - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - - /* - * Allocate another dummy qTD - */ - qtd = alloc_ehci_qTD(NULL); /* allocate a new dummy qTD */ - if (qtd == NULL) - { - free_ehci_qTD(dummy_qtd); - free_ehci_QH(qh); - return USBH_ERR_MEMORY_OUT; - } - qtd->Token &= ~(QTD_STS_ACTIVE | QTD_STS_HALT); - - qh->dummy = dummy_qtd; - qh->OL_Next_qTD = (uint32_t)dummy_qtd; - qh->OL_Token = 0; /* !Active & !Halted */ - - /* - * link QH - */ - if (udev->speed == SPEED_HIGH) /* get head node of this interval */ - iqh = get_int_tree_head_node(ep->bInterval); - else - iqh = get_int_tree_head_node(ep->bInterval * 8); - qh->HLink = iqh->HLink; /* Add to list of the same interval */ - iqh->HLink = QH_HLNK_QH(qh); - - dummy_qtd = qtd; - } - - qtd = qh->dummy; /* use the current dummy qTD */ - qtd->Next_qTD = (uint32_t)dummy_qtd; - qtd->utr = utr; - qh->dummy = dummy_qtd; /* give the new dummy qTD */ - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTD */ - /*------------------------------------------------------------------------------------*/ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT; - else - token = QTD_ERR_COUNTER | QTD_PID_IN; - - qtd->qh = qh; - qtd->Alt_Next_qTD = QTD_LIST_END; - write_qtd_bptr(qtd, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = QTD_IOC | (utr->data_len << 16) | token | QTD_STS_ACTIVE; - - // printf("ehci_int_xfer - qh: 0x%x, 0x%x, 0x%x\n", (int)qh, (int)qh->Chrst, (int)qh->Cap); - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; -} - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ehci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - QH_T *qh; - - // USB_debug("ehci_quit_xfer - utr: 0x%x, ep: 0x%x\n", (int)utr, (int)ep); - - DISABLE_EHCI_IRQ(); - if (ehci_quit_iso_xfer(utr, ep) == 0) - { - ENABLE_EHCI_IRQ(); - return 0; - } - ENABLE_EHCI_IRQ(); - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - qh = (QH_T *)(utr->ep->hw_pipe); - - if (!qh) - return USBH_ERR_NOT_FOUND; - - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - qh = (QH_T *)(ep->hw_pipe); - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - ep->hw_pipe = NULL; - } - usbh_delay_ms(2); - - return 0; -} - -static int visit_qtd(qTD_T *qtd) -{ - if ((qtd->Token == 0x11197B3F) || (qtd->Token == 0x1197B3F)) - return 0; /* A Dummy qTD or qTD on writing, don't touch it. */ - - // USB_debug("Visit qtd 0x%x - 0x%x\n", (int)qtd, qtd->Token); - - if ((qtd->Token & QTD_STS_ACTIVE) == 0) - { - if (qtd->Token & (QTD_STS_HALT | QTD_STS_DATA_BUFF_ERR | QTD_STS_BABBLE | QTD_STS_XactErr | QTD_STS_MISS_MF)) - { - USB_error("qTD error token=0x%x! 0x%x\n", qtd->Token, qtd->Bptr[0]); - if (qtd->utr->status == 0) - qtd->utr->status = USBH_ERR_TRANSACTION; - } - else - { - if ((qtd->Token & QTD_PID_Msk) != QTD_PID_SETUP) - { - qtd->utr->xfer_len += qtd->xfer_len - QTD_TODO_LEN(qtd->Token); - // USB_debug("0x%x utr->xfer_len += %d\n", qtd->Token, qtd->xfer_len - QTD_TODO_LEN(qtd->Token)); - } - } - return 1; - } - return 0; -} - -void scan_asynchronous_list() -{ - QH_T *qh, *qh_tmp; - qTD_T *q_pre = NULL, *qtd, *qtd_tmp; - UTR_T *utr; - - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - // USB_debug("Scan qh=0x%x, 0x%x\n", (int)qh, qh->OL_Token); - - utr = NULL; - qtd = qh->qtd_list; - while (qtd != NULL) - { - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - /* qTD is completed, will remove it */ - utr = qtd->utr; - if (qtd == qh->qtd_list) - qh->qtd_list = qtd->next; /* unlink the qTD from qtd_list */ - else - q_pre->next = qtd->next; /* unlink the qTD from qtd_list */ - - qtd_tmp = qtd; /* remember this qTD for freeing later */ - qtd = qtd->next; /* advance to the next qTD */ - - qtd_tmp->next = qh->done_list; /* push this qTD to QH's done list */ - qh->done_list = qtd_tmp; - } - else - { - q_pre = qtd; /* remember this qTD as a preceder */ - qtd = qtd->next; /* advance to next qTD */ - } - } - - qh_tmp = qh; - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qh_tmp->qtd_list == NULL) && utr) - { - // printf("T %d [%d]\n", (qh_tmp->Chrst>>8)&0xf, (qh_tmp->OL_Token&QTD_DT) ? 1 : 0); - if (qh_tmp->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - } -} - -static void scan_periodic_frame_list() -{ - QH_T *qh; - qTD_T *qtd, *qNext; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Scan interrupt frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - qtd = qh->qtd_list; - - if (qtd == NULL) - { - /* empty QH */ - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - continue; - } - - while (qtd != NULL) - { - qNext = qtd->next; - - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - qh->qtd_list = qtd->next; /* proceed to next qTD or NULL */ - qtd->next = qh->done_list; /* push qTD into the done list */ - qh->done_list = qtd; /* move qTD to done list */ - } - qtd = qNext; - } - - qtd = qh->done_list; - - while (qtd != NULL) - { - utr = qtd->utr; - - if (qh->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - - qtd = qtd->next; - } - - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Scan isochronous frame list */ - /*------------------------------------------------------------------------------------*/ - - scan_isochronous_list(); -} - -void iaad_remove_qh() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Remove all QHs in qh_remove_list... */ - /*------------------------------------------------------------------------------------*/ - while (qh_remove_list != NULL) - { - qh = qh_remove_list; - qh_remove_list = qh->next; - - // USB_debug("iaad_remove_qh - remove QH 0x%x\n", (int)qh); - - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - - if (qh->qtd_list != NULL) /* still have incomplete qTDs? */ - { - utr = qh->qtd_list->utr; - while (qh->qtd_list) - { - qtd = qh->qtd_list; - qh->qtd_list = qtd->next; - free_ehci_qTD(qtd); - } - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); /* call back */ - } - free_ehci_QH(qh); /* free the QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each asynchronous QH */ - /*------------------------------------------------------------------------------------*/ - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each QH of periodic frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } -} - -//static irqreturn_t ehci_irq (struct usb_hcd *hcd) -void EHCI_IRQHandler(void) -{ - uint32_t intsts; - - /* enter interrupt */ - rt_interrupt_enter(); - - intsts = _ehci->USTSR; - _ehci->USTSR = intsts; /* clear interrupt status */ - - // USB_debug("Eirq USTSR=0x%x\n", intsts); - - if (intsts & HSUSBH_USTSR_UERRINT_Msk) - { - // USB_error("Transfer error!\n"); - } - - if (intsts & HSUSBH_USTSR_USBINT_Msk) - { - /* some transfers completed, travel asynchronous */ - /* and periodic lists to find and reclaim them. */ - scan_asynchronous_list(); - - scan_periodic_frame_list(); - } - - if (intsts & HSUSBH_USTSR_IAA_Msk) - { - iaad_remove_qh(); - } - - /* leave interrupt */ - rt_interrupt_leave(); -} - -static UDEV_T *ehci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && (udev->speed == SPEED_HIGH)) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ehci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ehci->UPSCR[port] = (_ehci->UPSCR[port] | HSUSBH_UPSCR_PRST_Msk) & ~HSUSBH_UPSCR_PE_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) ; /* wait at least 50 ms */ - - _ehci->UPSCR[port] &= ~HSUSBH_UPSCR_PRST_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) || - ((_ehci->UPSCR[port] & (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk)) == (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("EHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PEC_Msk; /* clear port enable change status */ - return USBH_OK; /* port reset success */ -} - -static int ehci_rh_polling(void) -{ - UDEV_T *udev; - int ret; - int connect_status, t0, debounce_tick; - - if (!(_ehci->UPSCR[0] & HSUSBH_UPSCR_CSC_Msk)) - return 0; - - /*------------------------------------------------------------------------------------*/ - /* connect status change */ - /*------------------------------------------------------------------------------------*/ - - USB_debug("EHCI port1 status change: 0x%x\n", _ehci->UPSCR[0]); - - /*--------------------------------------------------------------------------------*/ - /* Disconnect the devices attached to this port. */ - /*--------------------------------------------------------------------------------*/ - while (1) - { - udev = ehci_find_device_by_port(1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - /*--------------------------------------------------------------------------------*/ - /* Port de-bounce */ - /*--------------------------------------------------------------------------------*/ - t0 = usbh_get_ticks(); - debounce_tick = usbh_tick_from_millisecond(HUB_DEBOUNCE_TIME); - connect_status = _ehci->UPSCR[0] & HSUSBH_UPSCR_CCS_Msk; - while (usbh_get_ticks() - t0 < debounce_tick) - { - if (connect_status != (_ehci->UPSCR[0] & HSUSBH_UPSCR_CCS_Msk)) - { - /* reset stable time counting */ - t0 = usbh_get_ticks(); - connect_status = _ehci->UPSCR[0] & HSUSBH_UPSCR_CCS_Msk; - } - } - - _ehci->UPSCR[0] |= HSUSBH_UPSCR_CSC_Msk; /* clear connect status change bit */ - - if (connect_status == HSUSBH_UPSCR_CCS_Msk) - { - /*--------------------------------------------------------------------------------*/ - /* A new device connected. */ - /*--------------------------------------------------------------------------------*/ - if (ehci_rh_port_reset(0) != USBH_OK) - { - /* port reset failed, maybe an USB 1.1 device */ - _ehci->UPSCR[0] |= HSUSBH_UPSCR_PO_Msk; /* change port owner to OHCI */ - _ehci->UPSCR[0] |= HSUSBH_UPSCR_CSC_Msk; /* clear all status change bits */ - return 0; - } - - /* - * Port reset success. Start to enumerate this new device. - */ - udev = alloc_device(); - if (udev == NULL) - return 0; /* out-of-memory, do nothing... */ - - udev->parent = NULL; - udev->port_num = 1; - udev->speed = SPEED_HIGH; - udev->hc_driver = &ehci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - } - else - { - /* - * Device disconnected - */ - while (1) - { - udev = ehci_find_device_by_port(1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - } - return 1; -} - - -HC_DRV_T ehci_driver = -{ - ehci_init, /* init */ - ehci_shutdown, /* shutdown */ - ehci_suspend, /* suspend */ - ehci_resume, /* resume */ - ehci_ctrl_xfer, /* ctrl_xfer */ - ehci_bulk_xfer, /* bulk_xfer */ - ehci_int_xfer, /* int_xfer */ - ehci_iso_xfer, /* iso_xfer */ - ehci_quit_xfer, /* quit_xfer */ - ehci_rh_port_reset, /* rthub_port_reset */ - ehci_rh_polling /* rthub_polling */ -}; - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/src/ehci_iso.c b/bsp/nuvoton/libraries/m460/USBHostLib/src/ehci_iso.c deleted file mode 100644 index c4e410d3c89..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/src/ehci_iso.c +++ /dev/null @@ -1,916 +0,0 @@ -/**************************************************************************//** - * @file ehci_iso.c - * @version V1.10 - * @brief USB EHCI isochronous transfer driver. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -uint32_t g_flr_cnt; /* frame list rollover counter */ - -ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ - -extern uint32_t _PFList[FL_SIZE]; /* Periodic frame list */ - -static const uint16_t sitd_OUT_Smask [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f }; - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep); - -/* - * Inspect the iTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_itd(iTD_T *itd) -{ - UTR_T *utr; - uint32_t frnidx = itd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int i, fidx; - - // printf("R - %d %d, 0x%x\n", now_frame, frnidx, itd->Transaction[0]); - - if (now_frame == frnidx) - { - for (i = 0; i < 8; i++) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - return 0; /* have any not completed frames */ - } - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this iTD - */ - utr = itd->utr; - fidx = itd->fidx; - for (i = 0; i < 8; i++) - { - if (!(itd->trans_mask & (0x1 << i))) - continue; /* not scheduled micro-frame */ - - if (ITD_STATUS(itd->Transaction[i])) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - utr->status = USBH_ERR_NOT_ACCESS0; - } - else if (itd->Transaction[i] & ITD_STATUS_BABBLE) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (itd->Transaction[i] & ITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - utr->iso_status[fidx] = 0; - utr->iso_xlen[fidx] = ITD_XFER_LEN(itd->Transaction[i]); - } - fidx++; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - - return 1; /* to be reclaimed */ -} - -/* - * Inspect the siTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_sitd(siTD_T *sitd) -{ - UTR_T *utr; - uint32_t frnidx = sitd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int fidx; - uint32_t TotalBytesToTransfer; - - if (now_frame == frnidx) - { - if (SITD_STATUS(sitd->StsCtrl) == SITD_STATUS_ACTIVE) - return 0; - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this siTD - */ - utr = sitd->utr; - fidx = sitd->fidx; - - if (SITD_STATUS(sitd->StsCtrl)) - { - if (sitd->StsCtrl & SITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - } - else if (sitd->StsCtrl & SITD_BABBLE_DETECTED) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (sitd->StsCtrl & SITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - TotalBytesToTransfer = (sitd->StsCtrl & SITD_XFER_CNT_Msk) >> SITD_XFER_CNT_Pos; - utr->iso_xlen[fidx] = utr->iso_xlen[fidx] - TotalBytesToTransfer; - utr->iso_status[fidx] = 0; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - return 1; /* to be reclaimed */ -} - -/* - * Some iTD/siTD may be scheduled but not serviced due to time missed. - * This function scan several earlier frames and drop unserviced iTD/siTD if found. - */ -void scan_isochronous_list(void) -{ - ISO_EP_T *iso_ep = iso_ep_list; - iTD_T *itd, *itd_pre, *p; - siTD_T *sitd, *sitd_pre, *sp; - uint32_t frnidx; - - DISABLE_EHCI_IRQ(); - - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - /*--------------------------------------------------------------------------------*/ - /* Scan all iTDs */ - /*--------------------------------------------------------------------------------*/ - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - itd_pre = NULL; - while (itd != NULL) /* traverse all iTDs of itd list */ - { - if (review_itd(itd)) /* inspect and reclaim iTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("An iTD lost refernece to periodic frame list! 0x%x -> %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this iTD from iso_ep's iTD list */ - /*------------------------------------------------------------------------*/ - if (itd_pre == NULL) - { - iso_ep->itd_list = itd->next; - } - else - { - itd_pre->next = itd->next; - } - p = itd->next; - free_ehci_iTD(itd); - itd = p; - } - else - { - itd_pre = itd; - itd = itd->next; /* traverse to the next iTD of iTD list */ - } - } - - /*--------------------------------------------------------------------------------*/ - /* Scan all siTDs */ - /*--------------------------------------------------------------------------------*/ - sitd = iso_ep->sitd_list; /* get the first siTD from iso_ep's siTD list */ - sitd_pre = NULL; - while (sitd != NULL) /* traverse all siTDs of sitd list */ - { - if (review_sitd(sitd)) /* inspect and reclaim siTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this siTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = sitd->sched_frnidx; - if (_PFList[frnidx] == SITD_HLNK_SITD(sitd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = sitd->Next_Link; - } - else - { - sp = SITD_PTR(_PFList[frnidx]); /* find the preceding siTD */ - while ((SITD_PTR(sp->Next_Link) != sitd) && (sp != NULL)) - { - sp = SITD_PTR(sp->Next_Link); - } - - if (sp == NULL) /* link list out of control! */ - { - USB_error("An siTD lost reference to periodic frame list! 0x%x -> %d\n", (int)sitd, frnidx); - } - else /* remove iTD from list */ - { - sp->Next_Link = sitd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this siTD from iso_ep's siTD list */ - /*------------------------------------------------------------------------*/ - if (sitd_pre == NULL) - { - iso_ep->sitd_list = sitd->next; - } - else - { - sitd_pre->next = sitd->next; - } - sp = sitd->next; - free_ehci_siTD(sitd); - sitd = sp; - } - else - { - sitd_pre = sitd; - sitd = sitd->next; /* traverse to the next siTD of siTD list */ - } - } - - iso_ep = iso_ep->next; - } - - ENABLE_EHCI_IRQ(); -} - - -static void write_itd_info(UTR_T *utr, iTD_T *itd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int i; - - buff_page_addr = itd->buff_base & 0xFFFFF000; /* 4K page */ - - for (i = 0; i < 7; i++) - { - itd->Bptr[i] = buff_page_addr + (0x1000 * i); - } - /* EndPtr R Device Address */ - itd->Bptr[0] |= (udev->dev_num) | ((ep->bEndpointAddress & 0xF) << ITD_EP_NUM_Pos); - itd->Bptr[1] |= ep->wMaxPacketSize; /* Maximum Packet Size */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - itd->Bptr[1] |= ITD_DIR_IN; - else - itd->Bptr[1] |= ITD_DIR_OUT; - - itd->Bptr[2] |= (ep->wMaxPacketSize + 1023) / 1024; /* Mult */ -} - -static void write_itd_micro_frame(UTR_T *utr, int fidx, iTD_T *itd, int mf) -{ - uint32_t buff_addr; - - buff_addr = (uint32_t)(utr->iso_buff[fidx]); /* xfer buffer start address of this frame */ - - itd->Transaction[mf] = ITD_STATUS_ACTIVE | /* Status */ - ((utr->iso_xlen[fidx] & 0xFFF) << ITD_XLEN_Pos) | /* Transaction Length */ - ((buff_addr & 0xFFFFF000) - (itd->buff_base & 0xFFFFF000)) | /* PG */ - (buff_addr & 0xFFF); /* Transaction offset */ -} - - -static void remove_iso_ep_from_list(ISO_EP_T *iso_ep) -{ - ISO_EP_T *p; - - if (iso_ep_list == iso_ep) - { - iso_ep_list = iso_ep->next; /* it's the first entry, remove it */ - return; - } - - p = iso_ep_list; /* find the previous entry of iso_ep */ - while (p->next != NULL) - { - if (p->next == iso_ep) - { - break; - } - p = p->next; - } - - if (p->next == NULL) - { - return; /* not found */ - } - p->next = iso_ep->next; /* remove iso_ep from list */ -} - - -static __inline void add_itd_to_iso_ep(ISO_EP_T *iso_ep, iTD_T *itd) -{ - iTD_T *p; - - itd->next = NULL; - - if (iso_ep->itd_list == NULL) - { - iso_ep->itd_list = itd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->itd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = itd; -} - -int ehci_iso_xfer(UTR_T *utr) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - ISO_EP_T *iso_ep; /* software iso endpoint descriptor */ - iTD_T *itd, *itd_next, *itd_list = NULL; - int i, itd_cnt; - int trans_mask; /* bit mask of used xfer in an iTD */ - int fidx; /* index to the 8 iso frames of UTR */ - int interval; /* frame interval of iTD */ - - if (ep->hw_pipe != NULL) - { - iso_ep = (ISO_EP_T *)ep->hw_pipe; /* get reference of the isochronous endpoint */ - - if (utr->bIsoNewSched) - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - } - else - { - /* first time transfer of this iso endpoint */ - iso_ep = usbh_alloc_mem(sizeof(*iso_ep)); - if (iso_ep == NULL) - return USBH_ERR_MEMORY_OUT; - - memset(iso_ep, 0, sizeof(*iso_ep)); - iso_ep->ep = ep; - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - - ep->hw_pipe = iso_ep; - - /* - * Add this iso_ep into iso_ep_list - */ - DISABLE_EHCI_IRQ(); - iso_ep->next = iso_ep_list; - iso_ep_list = iso_ep; - ENABLE_EHCI_IRQ(); - } - - if (utr->udev->speed == SPEED_FULL) - return ehci_iso_split_xfer(utr, iso_ep); - - /*------------------------------------------------------------------------------------*/ - /* Allocate iTDs */ - /*------------------------------------------------------------------------------------*/ - - if (ep->bInterval < 2) /* transfer interval is 1 micro-frame */ - { - trans_mask = 0xFF; - itd_cnt = 1; /* required 1 iTD for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 4) /* transfer interval is 2 micro-frames */ - { - trans_mask = 0x55; - itd_cnt = 2; /* required 2 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 8) /* transfer interval is 4 micro-frames */ - { - trans_mask = 0x44; - itd_cnt = 4; /* required 4 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 16) /* transfer interval is 8 micro-frames */ - { - trans_mask = 0x08; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 32) /* transfer interval is 16 micro-frames */ - { - trans_mask = 0x10; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 2; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 64) /* transfer interval is 32 micro-frames */ - { - trans_mask = 0x02; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 4; /* iTD frame interval of this endpoint */ - } - else /* transfer interval is 64 micro-frames */ - { - trans_mask = 0x04; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 8; /* iTD frame interval of this endpoint */ - } - - for (i = 0; i < itd_cnt; i++) /* allocate all iTDs required by UTR */ - { - itd = alloc_ehci_iTD(); - if (itd == NULL) - goto malloc_failed; - - if (itd_list == NULL) /* link all iTDs */ - { - itd_list = itd; - } - else - { - itd->next = itd_list; - itd_list = itd; - } - } - - utr->td_cnt = itd_cnt; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all iTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (itd = itd_list; (itd != NULL);) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver ITD bug!?\n"); - goto malloc_failed; - } - - itd->utr = utr; - itd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - itd->buff_base = (uint32_t)(utr->iso_buff[fidx]); /* iTD buffer base is buffer of the first UTR iso frame serviced by this iTD */ - itd->trans_mask = trans_mask; - - write_itd_info(utr, itd); - - for (i = 0; i < 8; i++) /* settle xfer into micro-frames */ - { - if (!(trans_mask & (0x1 << i))) - { - itd->Transaction[i] = 0; /* not accesed */ - continue; /* not scheduled micro-frame */ - } - - write_itd_micro_frame(utr, fidx, itd, i); - - fidx++; /* preceed to next UTR iso frame */ - - if (fidx == IF_PER_UTR) /* is the last scheduled micro-frame? */ - { - /* raise interrupt on completed */ - itd->Transaction[i] |= ITD_IOC; - break; - } - } - - itd_next = itd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - DISABLE_EHCI_IRQ(); - itd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - add_itd_to_iso_ep(iso_ep, itd); /* add to software itd list */ - itd->Next_Link = _PFList[itd->sched_frnidx]; /* keep the next link */ - _PFList[itd->sched_frnidx] = ITD_HLNK_ITD(itd); - iso_ep->next_frame = (iso_ep->next_frame + interval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - itd = itd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (itd_list != NULL) - { - itd = itd_list; - itd_list = itd->next; - free_ehci_iTD(itd); - } - return USBH_ERR_MEMORY_OUT; -} - -static __inline void add_sitd_to_iso_ep(ISO_EP_T *iso_ep, siTD_T *sitd) -{ - siTD_T *p; - - sitd->next = NULL; - - if (iso_ep->sitd_list == NULL) - { - iso_ep->sitd_list = sitd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->sitd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = sitd; -} - -static void write_sitd_info(UTR_T *utr, siTD_T *sitd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int xlen = utr->iso_xlen[sitd->fidx]; - int scnt; - - sitd->Chrst = (udev->port_num << SITD_PORT_NUM_Pos) | - (udev->parent->iface->udev->dev_num << SITD_HUB_ADDR_Pos) | - ((ep->bEndpointAddress & 0xF) << SITD_EP_NUM_Pos) | - (udev->dev_num << SITD_DEV_ADDR_Pos); - - buff_page_addr = ((uint32_t)utr->iso_buff[sitd->fidx]) & 0xFFFFF000; - sitd->Bptr[0] = (uint32_t)(utr->iso_buff[sitd->fidx]); - sitd->Bptr[1] = buff_page_addr + 0x1000; - - scnt = (xlen + 187) / 188; - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - { - sitd->Chrst |= SITD_XFER_IN; - sitd->Sched = (1 << (scnt + 2)) - 1; - sitd->Sched = (sitd->Sched << 10) | 0x1; - //sitd->Sched <<= 1; - } - else - { - sitd->Chrst |= SITD_XFER_OUT; - sitd->Sched = sitd_OUT_Smask[scnt - 1]; - if (scnt > 1) - { - sitd->Bptr[1] |= (0x1 << 3); /* Transaction position (TP) 01b: Begin */ - } - sitd->Bptr[1] |= scnt; /* Transaction count (T-Count) */ - } - - if (sitd->fidx == IF_PER_UTR) - { - sitd->Sched |= SITD_IOC; - } - - sitd->StsCtrl = (xlen << SITD_XFER_CNT_Pos) | SITD_STATUS_ACTIVE; - - sitd->BackLink = SITD_LIST_END; -} - - -static void ehci_sitd_adjust_schedule(siTD_T *sitd) -{ - siTD_T *hlink = (siTD_T *)_PFList[sitd->sched_frnidx]; - uint32_t uframe_mask = 0x00; - - while (hlink && !HLINK_IS_TERMINATED(hlink) && HLINK_IS_SITD(hlink)) - { - hlink = SITD_PTR(hlink); - if (hlink != sitd) - { - if ((hlink->Chrst & SITD_XFER_IO_Msk) == SITD_XFER_IN) - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by IN S-mask */ - uframe_mask |= ((hlink->Sched >> 8) & 0xFF); /* mark micro-frames used by IN C-mask */ - } - else - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by OUT S-mask */ - } - } - hlink = SITD_PTR(hlink->Next_Link); - } - - uframe_mask = uframe_mask | (uframe_mask << 8); /* mark both S-mask and C-mask */ - - if (uframe_mask) - { - /* - * Shift afterward one micro-frame until no conflicts. - */ - while (1) - { - if (sitd->Sched & uframe_mask) - { - sitd->Sched = (sitd->Sched & 0xFFFF0000) | ((sitd->Sched << 1) & 0xFFFF); - } - else - { - break; /* no conflit, done. */ - } - } - } -} - - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - siTD_T *sitd, *sitd_next, *sitd_list = NULL; - int i; - int fidx; /* index to the 8 iso frames of UTR */ - - if (utr->udev->parent == NULL) - { - USB_error("siso xfer - parent lost!\n"); - return USBH_ERR_INVALID_PARAM; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate siTDs */ - /*------------------------------------------------------------------------------------*/ - for (i = 0; i < IF_PER_UTR; i++) /* allocate all siTDs required by UTR */ - { - sitd = alloc_ehci_siTD(); - if (sitd == NULL) - goto malloc_failed; - - if (sitd_list == NULL) /* link all siTDs */ - { - sitd_list = sitd; - } - else - { - sitd->next = sitd_list; - sitd_list = sitd; - } - } - - utr->td_cnt = IF_PER_UTR; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all siTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (sitd = sitd_list; (sitd != NULL); fidx++) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver siTD bug!?\n"); - goto malloc_failed; - } - - sitd->utr = utr; - sitd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - - write_sitd_info(utr, sitd); - - sitd_next = sitd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - sitd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - DISABLE_EHCI_IRQ(); - ehci_sitd_adjust_schedule(sitd); - add_sitd_to_iso_ep(iso_ep, sitd); /* add to software itd list */ - sitd->Next_Link = _PFList[sitd->sched_frnidx];/* keep the next link */ - _PFList[sitd->sched_frnidx] = SITD_HLNK_SITD(sitd); - iso_ep->next_frame = (iso_ep->next_frame + ep->bInterval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - sitd = sitd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (sitd_list != NULL) - { - sitd = sitd_list; - sitd_list = sitd->next; - free_ehci_siTD(sitd); - } - return USBH_ERR_MEMORY_OUT; -} - -/* - * If it's an isochronous endpoint, quit current transfer via UTR or hardware EP. - */ -int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ISO_EP_T *iso_ep; - iTD_T *itd, *itd_next, *p; - uint32_t frnidx; - uint32_t now_frame; - - if (ep == NULL) - { - if (utr == NULL) - return USBH_ERR_NOT_FOUND; - - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ep = utr->ep; - } - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) != EP_ATTR_TT_ISO) - return USBH_ERR_NOT_FOUND; /* not isochronous endpoint */ - - /*------------------------------------------------------------------------------------*/ - /* It's an iso endpoint. Remove it as required. */ - /*------------------------------------------------------------------------------------*/ - iso_ep = iso_ep_list; - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - if (iso_ep->ep == ep) - break; - iso_ep = iso_ep->next; - } - if (iso_ep == NULL) - return 0; /* should have been removed */ - - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - - while (itd != NULL) /* traverse all iTDs of itd list */ - { - itd_next = itd->next; /* remember the next iTD */ - utr = itd->utr; - - /*--------------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*--------------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - - /* - * Prevent to race with Host Controller. If the iTD to be removed is located in - * current or next frame, wait until HC passed through it. - */ - while (1) - { - now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - if ((now_frame == frnidx) || (((now_frame + 1) % 1024) == frnidx)) - continue; - break; - } - - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("ehci_quit_iso_xfer - An iTD lost reference to periodic frame list! 0x%x on %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - utr->status = USBH_ERR_ABORT; - } - free_ehci_iTD(itd); - itd = itd_next; - } - - /* - * Remove iso_ep from iso_ep_list - */ - remove_iso_ep_from_list(iso_ep); - usbh_free_mem(iso_ep, sizeof(*iso_ep)); /* free this iso_ep */ - ep->hw_pipe = NULL; - - if (iso_ep_list == NULL) - _ehci->UCMDR &= ~HSUSBH_UCMDR_PSEN_Msk; - - return 0; -} - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/src/mem_alloc.c b/bsp/nuvoton/libraries/m460/USBHostLib/src/mem_alloc.c deleted file mode 100644 index 0ea890cc5b1..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/src/mem_alloc.c +++ /dev/null @@ -1,503 +0,0 @@ -/**************************************************************************//** - * @file mem_alloc.c - * @version V1.10 - * @brief USB host library memory allocation functions. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" - - -/// @cond HIDDEN_SYMBOLS - -//#define MEM_DEBUG - -#ifdef MEM_DEBUG - #define mem_debug rt_kprintf -#else - #define mem_debug(...) -#endif - -#ifdef __ICCARM__ - #pragma data_alignment=32 - static uint8_t _mem_pool[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE]; -#else - static uint8_t _mem_pool[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE] __attribute__((aligned(32))); -#endif -static uint8_t _unit_used[MEM_POOL_UNIT_NUM]; - -static volatile int _usbh_mem_used; -static volatile int _usbh_max_mem_used; -static volatile int _mem_pool_used; - - -UDEV_T *g_udev_list; - -uint8_t _dev_addr_pool[128]; -static volatile int _device_addr; - -static int _sidx = 0;; - -/*--------------------------------------------------------------------------*/ -/* Memory alloc/free recording */ -/*--------------------------------------------------------------------------*/ - -void usbh_memory_init(void) -{ - if (sizeof(TD_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("TD_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - if (sizeof(ED_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("ED_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - _usbh_mem_used = 0L; - _usbh_max_mem_used = 0L; - - memset(_unit_used, 0, sizeof(_unit_used)); - _mem_pool_used = 0; - _sidx = 0; - - g_udev_list = NULL; - - memset(_dev_addr_pool, 0, sizeof(_dev_addr_pool)); - _device_addr = 1; -} - -uint32_t usbh_memory_used(void) -{ - rt_kprintf("USB static memory: %d/%d, heap used: %d\n", _mem_pool_used, MEM_POOL_UNIT_NUM, _usbh_mem_used); - return _usbh_mem_used; -} - -static void memory_counter(int size) -{ - _usbh_mem_used += size; - if (_usbh_mem_used > _usbh_max_mem_used) - _usbh_max_mem_used = _usbh_mem_used; -} - -void *usbh_alloc_mem(int size) -{ - void *p; - - p = malloc(size); - if (p == NULL) - { - USB_error("usbh_alloc_mem failed! %d\n", size); - return NULL; - } - - memset(p, 0, size); - memory_counter(size); - return p; -} - -void usbh_free_mem(void *p, int size) -{ - free(p); - memory_counter(0 - size); -} - - -/*--------------------------------------------------------------------------*/ -/* USB device allocate/free */ -/*--------------------------------------------------------------------------*/ - -UDEV_T *alloc_device(void) -{ - UDEV_T *udev; - - udev = malloc(sizeof(*udev)); - if (udev == NULL) - { - USB_error("alloc_device failed!\n"); - return NULL; - } - memset(udev, 0, sizeof(*udev)); - memory_counter(sizeof(*udev)); - udev->cur_conf = -1; /* must! used to identify the first SET CONFIGURATION */ - udev->next = g_udev_list; /* chain to global device list */ - g_udev_list = udev; - return udev; -} - -void free_device(UDEV_T *udev) -{ - UDEV_T *d; - - if (udev == NULL) - return; - - if (udev->cfd_buff != NULL) - usbh_free_mem(udev->cfd_buff, MAX_DESC_BUFF_SIZE); - - /* - * Remove it from the global device list - */ - if (g_udev_list == udev) - { - g_udev_list = g_udev_list->next; - } - else - { - d = g_udev_list; - while (d != NULL) - { - if (d->next == udev) - { - d->next = udev->next; - break; - } - d = d->next; - } - } - - free(udev); - memory_counter(-sizeof(*udev)); -} - -int alloc_dev_address(void) -{ - _device_addr++; - - if (_device_addr >= 128) - _device_addr = 1; - - while (1) - { - if (_dev_addr_pool[_device_addr] == 0) - { - _dev_addr_pool[_device_addr] = 1; - return _device_addr; - } - _device_addr++; - if (_device_addr >= 128) - _device_addr = 1; - } -} - -void free_dev_address(int dev_addr) -{ - if (dev_addr < 128) - _dev_addr_pool[dev_addr] = 0; -} - -/*--------------------------------------------------------------------------*/ -/* UTR (USB Transfer Request) allocate/free */ -/*--------------------------------------------------------------------------*/ - -UTR_T *alloc_utr(UDEV_T *udev) -{ - UTR_T *utr; - - utr = malloc(sizeof(*utr)); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - memory_counter(sizeof(*utr)); - memset(utr, 0, sizeof(*utr)); - utr->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr); - return utr; -} - -void free_utr(UTR_T *utr) -{ - if (utr == NULL) - return; - - mem_debug("[FREE] [UTR] - 0x%x\n", (int)utr); - free(utr); - memory_counter(0 - (int)sizeof(*utr)); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI ED allocate/free */ -/*--------------------------------------------------------------------------*/ - -ED_T *alloc_ohci_ED(void) -{ - int i; - ED_T *ed; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - ed = (ED_T *)&_mem_pool[i]; - memset(ed, 0, sizeof(*ed)); - mem_debug("[ALLOC] [ED] - 0x%x\n", (int)ed); - return ed; - } - } - USB_error("alloc_ohci_ED failed!\n"); - return NULL; -} - -void free_ohci_ED(ED_T *ed) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)ed) - { - mem_debug("[FREE] [ED] - 0x%x\n", (int)ed); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ohci_ED - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI TD allocate/free */ -/*--------------------------------------------------------------------------*/ -TD_T *alloc_ohci_TD(UTR_T *utr) -{ - int i; - TD_T *td; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - td = (TD_T *)&_mem_pool[i]; - - memset(td, 0, sizeof(*td)); - td->utr = utr; - mem_debug("[ALLOC] [TD] - 0x%x\n", (int)td); - return td; - } - } - USB_error("alloc_ohci_TD failed!\n"); - return NULL; -} - -void free_ohci_TD(TD_T *td) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)td) - { - mem_debug("[FREE] [TD] - 0x%x\n", (int)td); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ohci_TD - not found!\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI QH allocate/free */ -/*--------------------------------------------------------------------------*/ -QH_T *alloc_ehci_QH(void) -{ - int i; - QH_T *qh = NULL; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qh = (QH_T *)&_mem_pool[i]; - memset(qh, 0, sizeof(*qh)); - mem_debug("[ALLOC] [QH] - 0x%x\n", (int)qh); - break; - } - } - if (qh == NULL) - { - USB_error("alloc_ehci_QH failed!\n"); - return NULL; - } - qh->Curr_qTD = QTD_LIST_END; - qh->OL_Next_qTD = QTD_LIST_END; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = QTD_STS_HALT; - return qh; -} - -void free_ehci_QH(QH_T *qh) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)qh) - { - mem_debug("[FREE] [QH] - 0x%x\n", (int)qh); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ehci_QH - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI qTD allocate/free */ -/*--------------------------------------------------------------------------*/ -qTD_T *alloc_ehci_qTD(UTR_T *utr) -{ - int i; - qTD_T *qtd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qtd = (qTD_T *)&_mem_pool[i]; - - memset(qtd, 0, sizeof(*qtd)); - qtd->Next_qTD = QTD_LIST_END; - qtd->Alt_Next_qTD = QTD_LIST_END; - qtd->Token = 0x1197B3F; // QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It means the qTD still not ready for transfer. - qtd->utr = utr; - mem_debug("[ALLOC] [qTD] - 0x%x\n", (int)qtd); - return qtd; - } - } - USB_error("alloc_ehci_qTD failed!\n"); - return NULL; -} - -void free_ehci_qTD(qTD_T *qtd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)qtd) - { - mem_debug("[FREE] [qTD] - 0x%x\n", (int)qtd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_qTD 0x%x - not found!\n", (int)qtd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -iTD_T *alloc_ehci_iTD(void) -{ - int i; - iTD_T *itd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (i + 2 >= MEM_POOL_UNIT_NUM) - continue; - - if ((_unit_used[i] == 0) && (_unit_used[i + 1] == 0)) - { - _unit_used[i] = _unit_used[i + 1] = 1; - _sidx = i + 1; - _mem_pool_used += 2; - itd = (iTD_T *)&_mem_pool[i]; - memset(itd, 0, sizeof(*itd)); - mem_debug("[ALLOC] [iTD] - 0x%x\n", (int)itd); - return itd; - } - } - USB_error("alloc_ehci_iTD failed!\n"); - return NULL; -} - -void free_ehci_iTD(iTD_T *itd) -{ - int i; - - for (i = 0; i + 1 < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)itd) - { - mem_debug("[FREE] [iTD] - 0x%x\n", (int)itd); - _unit_used[i] = _unit_used[i + 1] = 0; - _mem_pool_used -= 2; - return; - } - } - USB_error("free_ehci_iTD 0x%x - not found!\n", (int)itd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -siTD_T *alloc_ehci_siTD(void) -{ - int i; - siTD_T *sitd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used ++; - sitd = (siTD_T *)&_mem_pool[i]; - memset(sitd, 0, sizeof(*sitd)); - mem_debug("[ALLOC] [siTD] - 0x%x\n", (int)sitd); - return sitd; - } - } - USB_error("alloc_ehci_siTD failed!\n"); - return NULL; -} - -void free_ehci_siTD(siTD_T *sitd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)sitd) - { - mem_debug("[FREE] [siTD] - 0x%x\n", (int)sitd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_siTD 0x%x - not found!\n", (int)sitd); -} - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/src/ohci.c b/bsp/nuvoton/libraries/m460/USBHostLib/src/ohci.c deleted file mode 100644 index 458c48659cc..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/src/ohci.c +++ /dev/null @@ -1,1297 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -//#define TD_debug printf -#define TD_debug(...) - -//#define ED_debug printf -#define ED_debug(...) - -#ifdef __ICCARM__ - #pragma data_alignment=256 - HCCA_T _hcca; -#else - HCCA_T _hcca __attribute__((aligned(256))); -#endif - -ED_T *_Ied[6]; - - -static ED_T *ed_remove_list; - -static void add_to_ED_remove_list(ED_T *ed) -{ - ED_T *p; - - ED_debug("add_to_ED_remove_list - 0x%x (0x%x)\n", (int)ed, ed->Info); - DISABLE_OHCI_IRQ(); - - /* check if this ED found in ed_remove_list */ - p = ed_remove_list; - while (p) - { - if (p == ed) - { - ENABLE_OHCI_IRQ(); /* This ED found in ed_remove_list */ - return; /* do nothing */ - } - p = p->next; - } - - ed->Info |= ED_SKIP; /* ask OHCI controller skip this ED */ - ed->next = ed_remove_list; - ed_remove_list = ed; /* insert to the head of ed_remove_list */ - ENABLE_OHCI_IRQ(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_SF_Msk; - usbh_delay_ms(2); /* Full speed wait 2 ms is enough */ -} - -static int ohci_reset(void) -{ - volatile int t0; - - /* Disable HC interrupts */ - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_MIE_Msk; - - /* HC Reset requires max 10 ms delay */ - _ohci->HcControl = 0; - _ohci->HcCommandStatus = USBH_HcCommandStatus_HCR_Msk; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((_ohci->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB OHCI reset timed out!\n"); - return -1; - } - - _ohci->HcRhStatus = USBH_HcRhStatus_OCI_Msk | USBH_HcRhStatus_LPS_Msk; - - _ohci->HcControl = HCFS_RESET; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((_ohci->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB HC reset timed out!\n"); - return -1; - } - return 0; -} - -static void init_hcca_int_table() -{ - ED_T *ed_p; - int i, idx, interval; - - memset(_hcca.int_table, 0, sizeof(_hcca.int_table)); - - for (i = 5; i >= 0; i--) /* interval = i^2 */ - { - _Ied[i] = alloc_ohci_ED(); - _Ied[i]->Info = ED_SKIP; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < 32; idx += interval) - { - if (_hcca.int_table[idx] == 0) /* is empty list, insert directly */ - { - _hcca.int_table[idx] = (uint32_t)_Ied[i]; - } - else - { - ed_p = (ED_T *)_hcca.int_table[idx]; - - while (1) - { - if (ed_p == _Ied[i]) - break; /* already chained by previous visit */ - - if (ed_p->NextED == 0) /* reach end of list? */ - { - ed_p->NextED = (uint32_t)_Ied[i]; - break; - } - ed_p = (ED_T *)ed_p->NextED; - } - } - } - } -} - -static ED_T *get_int_tree_head_node(int interval) -{ - int i; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return _Ied[i]; - } - return _Ied[5]; /* for interval >= 32 */ -} - -static int get_ohci_interval(int interval) -{ - int i, bInterval = 1; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return bInterval; - bInterval *= 2; - } - return 32; /* for interval >= 32 */ -} - - -static int ohci_init(void) -{ - uint32_t fminterval; - volatile int i; - - if (ohci_reset() < 0) - return -1; - - ed_remove_list = NULL; - - init_hcca_int_table(); - - /* Tell the controller where the control and bulk lists are - * The lists are empty now. */ - _ohci->HcControlHeadED = 0; /* control ED list head */ - _ohci->HcBulkHeadED = 0; /* bulk ED list head */ - - _ohci->HcHCCA = (uint32_t)&_hcca; /* HCCA area */ - - /* periodic start 90% of frame interval */ - fminterval = 0x2edf; /* 11,999 */ - _ohci->HcPeriodicStart = (fminterval * 9) / 10; - - /* set FSLargestDataPacket, 10,104 for 0x2edf frame interval */ - fminterval |= ((((fminterval - 210) * 6) / 7) << 16); - _ohci->HcFmInterval = fminterval; - - _ohci->HcLSThreshold = 0x628; - - /* start controller operations */ - _ohci->HcControl = HCFS_OPER | (0x3 << USBH_HcControl_CBSR_Pos); - -#ifdef OHCI_PER_PORT_POWER - _ohci->HcRhDescriptorB = 0x60000; - _ohci->HcRhPortStatus[0] = USBH_HcRhPortStatus_PPS_Msk; - _ohci->HcRhPortStatus[1] = USBH_HcRhPortStatus_PPS_Msk; -#else - _ohci->HcRhDescriptorA = (_ohci->HcRhDescriptorA | (1 << 9)) & ~USBH_HcRhDescriptorA_PSM_Msk; - _ohci->HcRhStatus = USBH_HcRhStatus_LPSC_Msk; -#endif - - _ohci->HcInterruptEnable = USBH_HcInterruptEnable_MIE_Msk | USBH_HcInterruptEnable_WDH_Msk | USBH_HcInterruptEnable_SF_Msk; - - /* POTPGT delay is bits 24-31, in 20 ms units. */ - usbh_delay_ms(20); - return 0; -} - -static void ohci_suspend(void) -{ - /* set port suspend if connected */ - if (_ohci->HcRhPortStatus[0] & 0x1) - _ohci->HcRhPortStatus[0] = 0x4; - - if (_ohci->HcRhPortStatus[1] & 0x1) - _ohci->HcRhPortStatus[1] = 0x4; - - /* enable Device Remote Wakeup */ - _ohci->HcRhStatus |= USBH_HcRhStatus_DRWE_Msk; - - /* enable USBH RHSC interrupt for system wakeup */ - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_RHSC_Msk | USBH_HcInterruptEnable_RD_Msk; - - /* set Host Controller enter suspend state */ - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (3 << USBH_HcControl_HCFS_Pos); -} - -static void ohci_resume(void) -{ - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (1 << USBH_HcControl_HCFS_Pos); - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (2 << USBH_HcControl_HCFS_Pos); - - if (_ohci->HcRhPortStatus[0] & 0x4) - _ohci->HcRhPortStatus[0] = 0x8; - if (_ohci->HcRhPortStatus[1] & 0x4) - _ohci->HcRhPortStatus[1] = 0x8; -} - -static void ohci_shutdown(void) -{ - ohci_suspend(); - DISABLE_OHCI_IRQ(); -#ifndef OHCI_PER_PORT_POWER - _ohci->HcRhStatus = USBH_HcRhStatus_LPS_Msk; -#endif -} - - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ohci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ED_T *ed; - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ed = (ED_T *)(utr->ep->hw_pipe); - - if (!ed) - return USBH_ERR_NOT_FOUND; - - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - ed = (ED_T *)(ep->hw_pipe); - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - ep->hw_pipe = NULL; - } - - return 0; -} - -uint32_t ed_make_info(UDEV_T *udev, EP_INFO_T *ep) -{ - uint32_t info; - - if (ep == NULL) /* is a control endpoint */ - { - /* control endpoint direction is from TD */ - if (udev->descriptor.bMaxPacketSize0 == 0) /* is 0 if device descriptor still not obtained. */ - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - info = (udev->descriptor.bMaxPacketSize0 << 16) /* Control endpoint Maximum Packet Size from device descriptor */ - | ED_DIR_BY_TD /* Direction (Get direction From TD) */ - | ED_FORMAT_GENERAL /* General format */ - | (0 << ED_CTRL_EN_Pos); /* Endpoint address 0 */ - } - else /* Other endpoint direction is from endpoint descriptor */ - { - info = (ep->wMaxPacketSize << 16); /* Maximum Packet Size from endpoint */ - - info |= ((ep->bEndpointAddress & 0xf) << ED_CTRL_EN_Pos); /* Endpoint Number */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) - info |= ED_DIR_IN; - else - info |= ED_DIR_OUT; - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) == EP_ATTR_TT_ISO) - info |= ED_FORMAT_ISO; - else - info |= ED_FORMAT_GENERAL; - } - - info |= ((udev->speed == SPEED_LOW) ? ED_SPEED_LOW : ED_SPEED_FULL); /* Speed */ - info |= (udev->dev_num); /* Function Address */ - - return info; -} - -static void write_td(TD_T *td, uint32_t info, uint8_t *buff, uint32_t data_len) -{ - td->Info = info; - td->CBP = (uint32_t)((!buff || !data_len) ? 0 : buff); - td->BE = (uint32_t)((!buff || !data_len) ? 0 : (uint32_t)buff + data_len - 1); - td->buff_start = td->CBP; - // TD_debug("TD [0x%x]: 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->BE); -} - -static int ohci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - ED_T *ed; - TD_T *td_setup, *td_data, *td_status; - uint32_t info; - - udev = utr->udev; - - /*------------------------------------------------------------------------------------*/ - /* Allocate ED and TDs */ - /*------------------------------------------------------------------------------------*/ - td_setup = alloc_ohci_TD(utr); - - if (utr->data_len > 0) - td_data = alloc_ohci_TD(utr); - else - td_data = NULL; - - td_status = alloc_ohci_TD(utr); - - if (td_status == NULL) - { - free_ohci_TD(td_setup); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - - /* Check if there's any transfer pending on this endpoint... */ - if (udev->ep0.hw_pipe == NULL) - { - ed = alloc_ohci_ED(); - if (ed == NULL) - { - free_ohci_TD(td_setup); - free_ohci_TD(td_status); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - } - else - ed = (ED_T *)udev->ep0.hw_pipe; - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage TD */ - /*------------------------------------------------------------------------------------*/ - info = TD_CC | TD_T_DATA0 | TD_TYPE_CTRL; - write_td(td_setup, info, (uint8_t *)&utr->setup, 8); - td_setup->ed = ed; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage TD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - - write_td(td_data, info, utr->buff, utr->data_len); - td_data->ed = ed; - td_setup->NextTD = (uint32_t)td_data; - td_setup->next = td_data; - td_data->NextTD = (uint32_t)td_status; - td_data->next = td_status; - } - else - { - td_setup->NextTD = (uint32_t)td_status; - td_setup->next = td_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare STATUS stage TD */ - /*------------------------------------------------------------------------------------*/ - ed->Info = ed_make_info(udev, NULL); - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL); - else - info = (TD_CC | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL); - - write_td(td_status, info, NULL, 0); - td_status->ed = ed; - td_status->NextTD = 0; - td_status->next = 0; - - /*------------------------------------------------------------------------------------*/ - /* prepare ED */ - /*------------------------------------------------------------------------------------*/ - ed->TailP = 0; - ed->HeadP = (uint32_t)td_setup; - ed->Info = ed_make_info(udev, NULL); - ed->NextED = 0; - - //TD_debug("TD SETUP [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_setup, td_setup->Info, td_setup->CBP, td_setup->BE, td_setup->NextTD); - //if (td_data) - // TD_debug("TD DATA [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_data, td_data->Info, td_data->CBP, td_data->BE, td_data->NextTD); - //TD_debug("TD STATUS [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_status, td_status->Info, td_status->CBP, td_status->BE, td_status->NextTD); - ED_debug("Xfer ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - if (utr->data_len > 0) - utr->td_cnt = 3; - else - utr->td_cnt = 2; - - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - udev->ep0.hw_pipe = (void *)ed; /* driver can find ED from EP */ - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - _ohci->HcControlHeadED = (uint32_t)ed; /* Link ED to OHCI */ - _ohci->HcControl |= USBH_HcControl_CLE_Msk; /* enable control list */ - ENABLE_OHCI_IRQ(); - _ohci->HcCommandStatus = USBH_HcCommandStatus_CLF_Msk; /* start Control list */ - - return 0; -} - -static int ohci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed; - TD_T *td, *td_p, *td_list = NULL; - uint32_t info; - uint32_t data_len, xfer_len; - int8_t bIsNewED = 0; - uint8_t *buff; - - /*------------------------------------------------------------------------------------*/ - /* Check if there's uncompleted transfer on this endpoint... */ - /* Prepare ED */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - - /* Check if there's any transfer pending on this endpoint... */ - ed = (ED_T *)_ohci->HcBulkHeadED; /* get the head of bulk endpoint list */ - while (ed != NULL) - { - if (ed->Info == info) /* have transfer of this EP not completed? */ - { - if ((ed->HeadP & 0xFFFFFFF0) != (ed->TailP & 0xFFFFFFF0)) - return USBH_ERR_OHCI_EP_BUSY; /* endpoint is busy */ - else - break; /* ED already there... */ - } - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ED_debug("Link BULK ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - } - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - utr->td_cnt = 0; - data_len = utr->data_len; - buff = utr->buff; - - do - { - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_BULK); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_BULK); - - info &= ~(1 << 25); /* Data toggle from ED toggleCarry bit */ - - if (data_len > 4096) /* maximum transfer length is 4K for each TD */ - xfer_len = 4096; - else - xfer_len = data_len; /* remaining data length < 4K */ - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - write_td(td, info, buff, xfer_len); - td->ed = ed; - - utr->td_cnt++; /* increase TD count, for recalim counter */ - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - /* chain to end of TD list */ - if (td_list == NULL) - { - td_list = td; - } - else - { - td_p = td_list; - while (td_p->NextTD != 0) - td_p = (TD_T *)td_p->NextTD; - td_p->NextTD = (uint32_t)td; - } - - } - while (data_len > 0); - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - if (bIsNewED) - { - ed->HeadP = (uint32_t)td_list; - /* Link ED to OHCI Bulk List */ - ed->NextED = _ohci->HcBulkHeadED; - _ohci->HcBulkHeadED = (uint32_t)ed; - } - ENABLE_OHCI_IRQ(); - _ohci->HcControl |= USBH_HcControl_BLE_Msk; /* enable bulk list */ - _ohci->HcCommandStatus = USBH_HcCommandStatus_BLF_Msk; /* start bulk list */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static int ohci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_new; - uint32_t info; - int8_t bIsNewED = 0; - - if (utr->data_len > 64) /* USB 1.1 interrupt transfer maximum packet size is 64 */ - return USBH_ERR_INVALID_PARAM; - - td_new = alloc_ohci_TD(utr); /* allocate a TD for dummy TD */ - if (td_new == NULL) - return USBH_ERR_MEMORY_OUT; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - - td = alloc_ohci_TD(NULL); /* allocate the initial dummy TD for ED */ - if (td == NULL) - { - free_ohci_ED(ed); - free_ohci_TD(td_new); - return USBH_ERR_MEMORY_OUT; - } - ed->HeadP = (uint32_t)td; /* Let both HeadP and TailP point to dummy TD */ - ed->TailP = ed->HeadP; - } - else - { - td = (TD_T *)(ed->TailP & ~0xf); /* TailP always point to the dummy TD */ - } - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TD */ - /*------------------------------------------------------------------------------------*/ - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_INT); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_INT); - - /* Keep data toggle */ - info = (info & ~(1 << 25)) | (td->Info & (1 << 25)); - - /* fill this TD */ - write_td(td, info, utr->buff, utr->data_len); - td->ed = ed; - td->NextTD = (uint32_t)td_new; - td->utr = utr; - utr->td_cnt = 1; /* increase TD count, for recalim counter */ - utr->status = 0; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - - ed->TailP = (uint32_t)td_new; - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - - //printf("Link INT ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - _ohci->HcControl |= USBH_HcControl_PLE_Msk; /* periodic list enable */ - return 0; -} - -static int ohci_iso_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_list, *last_td; - int i; - uint32_t info; - uint32_t buff_addr; - int8_t bIsNewED = 0; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - } - else - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - if (utr->bIsoNewSched) /* Is the starting of isochronous streaming? */ - ed->next_sf = _hcca.frame_no + OHCI_ISO_DELAY; - - utr->td_cnt = 0; - utr->iso_sf = ed->next_sf; - - last_td = NULL; - td_list = NULL; - - for (i = 0; i < IF_PER_UTR; i++) - { - utr->iso_status[i] = USBH_ERR_NOT_ACCESS1; - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - buff_addr = (uint32_t)(utr->iso_buff[i]); - td->Info = (TD_CC | TD_TYPE_ISO) | ed->next_sf; - ed->next_sf += get_ohci_interval(ed->bInterval); - td->CBP = buff_addr & ~0xFFF; - td->BE = buff_addr + utr->iso_xlen[i] - 1; - td->PSW[0] = 0xE000 | (buff_addr & 0xFFF); - - td->ed = ed; - utr->td_cnt++; /* increase TD count, for reclaim counter */ - - /* chain to end of TD list */ - if (td_list == NULL) - td_list = td; - else - last_td->NextTD = (uint32_t)td; - - last_td = td; - }; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - - if ((ed->HeadP & ~0x3) == 0) - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - else - { - /* find the tail of TDs under this ED */ - td = (TD_T *)(ed->HeadP & ~0x3); - while (td->NextTD != 0) - { - td = (TD_T *)td->NextTD; - } - td->NextTD = (uint32_t)td_list; - } - - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - ED_debug("Link ISO ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - _ohci->HcControl |= USBH_HcControl_PLE_Msk | USBH_HcControl_IE_Msk; /* enable periodic list and isochronous transfer */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static UDEV_T *ohci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && - ((udev->speed == SPEED_LOW) || (udev->speed == SPEED_FULL))) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ohci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_PRS_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) - { - /* - * If device is disconnected or port enabled, we can stop port reset. - */ - if (((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) || - ((_ohci->HcRhPortStatus[port] & (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk)) == (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("OHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - return USBH_OK; /* port reset success */ -} - -static int ohci_rh_polling(void) -{ - int i, change = 0; - UDEV_T *udev; - int ret; - - for (i = 0; i < 2; i++) - { - /* M460LD OHCI has no root hub port 1 */ - - /* clear unwanted port change status */ - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_OCIC_Msk | USBH_HcRhPortStatus_PRSC_Msk | - USBH_HcRhPortStatus_PSSC_Msk | USBH_HcRhPortStatus_PESC_Msk; - - if ((_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CSC_Msk) == 0) - continue; - - /*--------------------------------------------------------------------------------*/ - /* connect status change */ - /*--------------------------------------------------------------------------------*/ - - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* First of all, check if there's any previously connected device. */ - /*----------------------------------------------------------------------------*/ - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - if (ohci_rh_port_reset(i) != USBH_OK) - continue; - - /* - * Port reset success... - */ - udev = alloc_device(); - if (udev == NULL) - continue; - - udev->parent = NULL; - udev->port_num = i + 1; - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_LSDA_Msk) - udev->speed = SPEED_LOW; - else - udev->speed = SPEED_FULL; - udev->hc_driver = &ohci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - - change = 1; - } - else - { - /* - * Device disconnected - */ - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - change = 1; - } - } - return change; -} - -void td_done(TD_T *td) -{ - UTR_T *utr = td->utr; - uint32_t info; - int cc; - - info = td->Info; - - TD_debug("td_done: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->NextTD, td->BE); - - /* ISO ... drivers see per-TD length/status */ - if ((info & TD_TYPE_Msk) == TD_TYPE_ISO) - { - uint16_t sf; - int idx; - - sf = info & 0xFFFF; - idx = ((sf + 0x10000 - utr->iso_sf) & 0xFFFF) / get_ohci_interval(td->ed->bInterval); - if (idx >= IF_PER_UTR) - { - USB_error("ISO invalid index!! %d, %d\n", sf, utr->iso_sf); - goto td_out; - } - - cc = (td->PSW[0] >> 12) & 0xF; - if (cc == 0xF) /* this frame was not transferred */ - { - USB_debug("ISO F %d N/A!\n", sf); - utr->iso_status[idx] = USBH_ERR_SCH_OVERRUN; - goto td_out; - } - if ((cc != 0) && (cc != CC_DATA_UNDERRUN)) - { - utr->iso_status[idx] = USBH_ERR_CC_NO_ERR - cc; - goto td_out; - } - utr->iso_status[idx] = 0; - utr->iso_xlen[idx] = td->PSW[0] & 0x7FF; - } - else - { - cc = TD_CC_GET(info); - - /* short packet is fine */ - if ((cc != CC_NOERROR) && (cc != CC_DATA_UNDERRUN)) - { - USB_error("TD error, CC = 0x%x\n", cc); - if (cc == CC_STALL) - utr->status = USBH_ERR_STALL; - else - utr->status = USBH_ERR_TRANSFER; - } - - switch (info & TD_TYPE_Msk) - { - case TD_TYPE_CTRL: - if (info & TD_CTRL_DATA) - { - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - } - break; - - case TD_TYPE_BULK: - case TD_TYPE_INT: - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - break; - } - } - -td_out: - - utr->td_cnt--; - - /* If all TDs are done, call-back to requester. */ - if (utr->td_cnt == 0) - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } -} - -/* in IRQ context */ -static void remove_ed() -{ - ED_T *ed, *ed_p, *ied; - TD_T *td, *td_next; - UTR_T *utr; - int found; - - while (ed_remove_list != NULL) - { - ED_debug("Remove ED: 0x%x, %d\n", (int)ed_remove_list, ed_remove_list->bInterval); - ed_p = ed_remove_list; - found = 0; - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Control List if found */ - /*--------------------------------------------------------------------------------*/ - if ((ed_p->Info & ED_EP_ADDR_Msk) == 0) - { - if (_ohci->HcControlHeadED == (uint32_t)ed_p) - { - _ohci->HcControlHeadED = (uint32_t)ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcControlHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove INT or ISO endpoint from HCCA interrupt table */ - /*--------------------------------------------------------------------------------*/ - else if (ed_p->bInterval > 0) - { - ied = get_int_tree_head_node(ed_p->bInterval); - - ed = ied; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - break; - } - ed = (ED_T *)ed->NextED; - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Bulk List if found */ - /*--------------------------------------------------------------------------------*/ - else - { - if (_ohci->HcBulkHeadED == (uint32_t)ed_p) - { - ed = (ED_T *)ed_p; - _ohci->HcBulkHeadED = ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcBulkHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove and free all TDs under this endpoint */ - /*--------------------------------------------------------------------------------*/ - if (found) - { - td = (TD_T *)(ed_p->HeadP & ~0x3); - if (td != NULL) - { - while (td != NULL) - { - utr = td->utr; - td_next = (TD_T *)td->NextTD; - free_ohci_TD(td); - td = td_next; - - utr->td_cnt--; - if (utr->td_cnt == 0) - { - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - } - } - } - - /* - * Done. Remove this ED from [ed_remove_list] and free it. - */ - ed_remove_list = ed_p->next; - free_ohci_ED(ed_p); - } -} - - -//static irqreturn_t ohci_irq (struct usb_hcd *hcd) -void OHCI_IRQHandler(void) -{ - TD_T *td, *td_prev, *td_next; - uint32_t int_sts; - - /* enter interrupt */ - rt_interrupt_enter(); - - int_sts = _ohci->HcInterruptStatus; - - //USB_debug("ohci int_sts = 0x%x\n", int_sts); - - if ((_ohci->HcInterruptEnable & USBH_HcInterruptEnable_SF_Msk) && - (int_sts & USBH_HcInterruptStatus_SF_Msk)) - { - int_sts &= ~USBH_HcInterruptStatus_SF_Msk; - - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_SF_Msk; - remove_ed(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - } - - if (int_sts & USBH_HcInterruptStatus_WDH_Msk) - { - //printf("!%02x\n", _ohci->HcFmNumber & 0xff); - int_sts &= ~USBH_HcInterruptStatus_WDH_Msk; - /* - * reverse done list - */ - td = (TD_T *)(_hcca.done_head & TD_ADDR_MASK); - _hcca.done_head = 0; - td_prev = NULL; - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_WDH_Msk; - - while (td != NULL) - { - //TD_debug("Done list TD 0x%x => 0x%x\n", (int)td, (int)td->NextTD); - td_next = (TD_T *)(td->NextTD & TD_ADDR_MASK); - td->NextTD = (uint32_t)td_prev; - td_prev = td; - td = td_next; - } - td = td_prev; /* first TD of the reversed done list */ - - /* - * reclaim TDs - */ - while (td != NULL) - { - TD_debug("Reclaim TD 0x%x, next 0x%x\n", (int)td, td->NextTD); - td_next = (TD_T *)td->NextTD; - td_done(td); - free_ohci_TD(td); - td = td_next; - } - } - - if (int_sts & USBH_HcInterruptStatus_RHSC_Msk) - { - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_RHSC_Msk; - } - - _ohci->HcInterruptStatus = int_sts; - - /* leave interrupt */ - rt_interrupt_leave(); -} - -#ifdef ENABLE_DEBUG_MSG - -void dump_ohci_int_table() -{ - int i; - ED_T *ed; - - for (i = 0; i < 32; i++) -// for (i = 0; i < 1; i++) - - { - USB_debug("%02d: ", i); - - ed = (ED_T *)_hcca.int_table[i]; - - while (ed != NULL) - { - USB_debug("0x%x (0x%x) => ", (int)ed, ed->HeadP); - ed = (ED_T *)ed->NextED; - } - rt_kprintf("0\n"); - } -} - -void dump_ohci_regs() -{ - USB_debug("Dump OCHI registers:\n"); - USB_debug(" HcRevision = 0x%x\n", _ohci->HcRevision); - USB_debug(" HcControl = 0x%x\n", _ohci->HcControl); - USB_debug(" HcCommandStatus = 0x%x\n", _ohci->HcCommandStatus); - USB_debug(" HcInterruptStatus = 0x%x\n", _ohci->HcInterruptStatus); - USB_debug(" HcInterruptEnable = 0x%x\n", _ohci->HcInterruptEnable); - USB_debug(" HcInterruptDisable = 0x%x\n", _ohci->HcInterruptDisable); - USB_debug(" HcHCCA = 0x%x\n", _ohci->HcHCCA); - USB_debug(" HcPeriodCurrentED = 0x%x\n", _ohci->HcPeriodCurrentED); - USB_debug(" HcControlHeadED = 0x%x\n", _ohci->HcControlHeadED); - USB_debug(" HcControlCurrentED = 0x%x\n", _ohci->HcControlCurrentED); - USB_debug(" HcBulkHeadED = 0x%x\n", _ohci->HcBulkHeadED); - USB_debug(" HcBulkCurrentED = 0x%x\n", _ohci->HcBulkCurrentED); - USB_debug(" HcDoneHead = 0x%x\n", _ohci->HcDoneHead); - USB_debug(" HcFmInterval = 0x%x\n", _ohci->HcFmInterval); - USB_debug(" HcFmRemaining = 0x%x\n", _ohci->HcFmRemaining); - USB_debug(" HcFmNumber = 0x%x\n", _ohci->HcFmNumber); - USB_debug(" HcPeriodicStart = 0x%x\n", _ohci->HcPeriodicStart); - USB_debug(" HcLSThreshold = 0x%x\n", _ohci->HcLSThreshold); - USB_debug(" HcRhDescriptorA = 0x%x\n", _ohci->HcRhDescriptorA); - USB_debug(" HcRhDescriptorB = 0x%x\n", _ohci->HcRhDescriptorB); - USB_debug(" HcRhStatus = 0x%x\n", _ohci->HcRhStatus); - USB_debug(" HcRhPortStatus0 = 0x%x\n", _ohci->HcRhPortStatus[0]); - USB_debug(" HcRhPortStatus1 = 0x%x\n", _ohci->HcRhPortStatus[1]); - USB_debug(" HcPhyControl = 0x%x\n", _ohci->HcPhyControl); - USB_debug(" HcMiscControl = 0x%x\n", _ohci->HcMiscControl); -} - -void dump_ohci_ports() -{ - USB_debug("_ohci port0=0x%x, port1=0x%x\n", _ohci->HcRhPortStatus[0], _ohci->HcRhPortStatus[1]); -} - -#endif // ENABLE_DEBUG_MSG - -HC_DRV_T ohci_driver = -{ - ohci_init, /* init */ - ohci_shutdown, /* shutdown */ - ohci_suspend, /* suspend */ - ohci_resume, /* resume */ - ohci_ctrl_xfer, /* ctrl_xfer */ - ohci_bulk_xfer, /* bulk_xfer */ - ohci_int_xfer, /* int_xfer */ - ohci_iso_xfer, /* iso_xfer */ - ohci_quit_xfer, /* quit_xfer */ - ohci_rh_port_reset, /* rthub_port_reset */ - ohci_rh_polling /* rthub_polling */ -}; - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m460/USBHostLib/src/usb_core.c b/bsp/nuvoton/libraries/m460/USBHostLib/src/usb_core.c deleted file mode 100644 index 582d1782b4b..00000000000 --- a/bsp/nuvoton/libraries/m460/USBHostLib/src/usb_core.c +++ /dev/null @@ -1,290 +0,0 @@ -/**************************************************************************//** - * @file usb_core.c - * @version V1.10 - * @brief USB Host library core. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" - -/// @cond HIDDEN_SYMBOLS - -USBH_T *_ohci; -HSUSBH_T *_ehci; - -static UDEV_DRV_T *_drivers[MAX_UDEV_DRIVER]; -static CONN_FUNC *g_conn_func, *g_disconn_func; - -/** - * @brief Initialize M480 USB Host controller and USB stack. - * - * @return None. - */ -void usbh_core_init() -{ - DISABLE_EHCI_IRQ(); - DISABLE_OHCI_IRQ(); - - _ohci = USBH; - _ehci = HSUSBH; - - memset(_drivers, 0, sizeof(_drivers)); - - g_conn_func = NULL; - g_disconn_func = NULL; - -// usbh_hub_init(); - - _ehci->USBPCR0 = 0x160; /* enable PHY 0 */ - _ehci->USBPCR1 = 0x520; /* enable PHY 1 */ - - usbh_memory_init(); - - _ohci->HcMiscControl |= USBH_HcMiscControl_OCAL_Msk; /* Over-current active low */ - //_ohci->HcMiscControl &= ~USBH_HcMiscControl_OCAL_Msk; /* Over-current active high */ - -#ifdef ENABLE_OHCI - ohci_driver.init(); - ENABLE_OHCI_IRQ(); -#endif - -#ifdef ENABLE_EHCI - ehci_driver.init(); - ENABLE_EHCI_IRQ(); -#endif -} - -/** - * @brief Let USB stack polls all root hubs. If there's any hub port - * change found, USB stack will manage the hub events in this function call. - * In this function, USB stack enumerates newly connected devices and remove staff - * of disconnected devices. User's application should periodically invoke this - * function. - * @return There's hub port change or not. - * @retval 0 No any hub port status changes found. - * @retval 1 There's hub port status changes. - */ -int usbh_polling_root_hubs(void) -{ - int ret, change = 0; - -#ifdef ENABLE_EHCI - _ehci->UPSCR[1] = HSUSBH_UPSCR_PP_Msk | HSUSBH_UPSCR_PO_Msk; /* set port 2 owner to OHCI */ - do - { - ret = ehci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - -#ifdef ENABLE_OHCI - do - { - ret = ohci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - - return change; -} - -/** - * @brief Force to quit an endpoint transfer. - * @param[in] udev The USB device. - * @param[in] ep The endpoint to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep) -{ - return udev->hc_driver->quit_xfer(NULL, ep); -} - - -int usbh_connect_device(UDEV_T *udev) -{ - usbh_delay_ms(100); /* initially, give 100 ms delay */ - - if (g_conn_func) - g_conn_func(udev, 0); - - return 0; -} - - -void usbh_disconnect_device(UDEV_T *udev) -{ - USB_debug("disconnect device...\n"); - - if (g_disconn_func) - g_disconn_func(udev, 0); - - -#if 1 //CHECK: Maybe create a new API to quit_xfer and free udev for application - usbh_quit_xfer(udev, &(udev->ep0)); /* Quit control transfer if hw_pipe is not NULL. */ - - /* remove device from global device list */ -// free_dev_address(udev->dev_num); - free_device(udev); - -// usbh_memory_used(); -#endif -} - -/** - * @brief Install device connect and disconnect callback function. - * - * @param[in] conn_func Device connect callback function. - * @param[in] disconn_func Device disconnect callback function. - * @return None. - */ -void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func) -{ - g_conn_func = conn_func; - g_disconn_func = disconn_func; -} - -int usbh_reset_port(UDEV_T *udev) -{ - if (udev->parent == NULL) - { - if (udev->hc_driver) - return udev->hc_driver->rthub_port_reset(udev->port_num - 1); - else - return USBH_ERR_NOT_FOUND; - } - else - { - return udev->parent->port_reset(udev->parent, udev->port_num); - } -} - - -/** - * @brief Force to quit an UTR transfer. - * @param[in] utr The UTR transfer to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_utr(UTR_T *utr) -{ - if (!utr || !utr->udev) - return USBH_ERR_NOT_FOUND; - - return utr->udev->hc_driver->quit_xfer(utr, NULL); -} - - -/** - * @brief Execute an USB request in control transfer. This function returns after the request - * was done or aborted. - * @param[in] udev The target USB device. - * @param[in] bmRequestType Characteristics of request - * @param[in] bRequest Specific request - * @param[in] wValue Word-sized field that varies according to request - * @param[in] wIndex Word-sized field that varies according to request - * @param[in] wLength Number of bytes to transfer if there is a Data stage - * @param[in] buff Data buffer used in data stage - * @param[out] xfer_len Transmitted/received length of data - * @param[in] timeout Time-out limit (in 10ms - timer tick) of this transfer - * @retval 0 Transfer success - * @retval < 0 Transfer failed. Refer to error code definitions. - */ -int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, - uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout) -{ - UTR_T *utr; - uint32_t t0, timeout_tick; - int status; - - *xfer_len = 0; - - //if (check_device(udev)) - // return USBH_ERR_INVALID_PARAM; - - utr = alloc_utr(udev); - if (utr == NULL) - return USBH_ERR_MEMORY_OUT; - - utr->setup.bmRequestType = bmRequestType; - utr->setup.bRequest = bRequest; - utr->setup.wValue = wValue; - utr->setup.wIndex = wIndex; - utr->setup.wLength = wLength; - - utr->buff = buff; - utr->data_len = wLength; - utr->bIsTransferDone = 0; - status = udev->hc_driver->ctrl_xfer(utr); - if (status < 0) - { - udev->ep0.hw_pipe = NULL; - free_utr(utr); - return status; - } - - timeout_tick = usbh_tick_from_millisecond(timeout); - t0 = usbh_get_ticks(); - while (utr->bIsTransferDone == 0) - { - if (usbh_get_ticks() - t0 > timeout_tick) - { - usbh_quit_utr(utr); - free_utr(utr); - udev->ep0.hw_pipe = NULL; - return USBH_ERR_TIMEOUT; - } - } - - status = utr->status; - - if (status == 0) - { - *xfer_len = utr->xfer_len; - } - free_utr(utr); - - return status; -} - -/** - * @brief Execute a bulk transfer request. This function will return immediately after - * issued the bulk transfer. USB stack will later call back utr->func() once the bulk - * transfer was done or aborted. - * @param[in] utr The bulk transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_bulk_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->bulk_xfer(utr); -} - -/** - * @brief Execute an interrupt transfer request. This function will return immediately after - * issued the interrupt transfer. USB stack will later call back utr->func() once the - * interrupt transfer was done or aborted. - * @param[in] utr The interrupt transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_int_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->int_xfer(utr); -} - - diff --git a/bsp/nuvoton/libraries/m460/rtt_port/Kconfig b/bsp/nuvoton/libraries/m460/rtt_port/Kconfig index f941184bb88..e13519e10e7 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/Kconfig +++ b/bsp/nuvoton/libraries/m460/rtt_port/Kconfig @@ -4,6 +4,7 @@ config SOC_SERIES_M460 select SOC_FAMILY_NUMICRO select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN + select PKG_USING_NUVOTON_SERIES_DRIVER default y config BSP_USE_STDDRIVER_SOURCE diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_common_tables.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_common_tables.h deleted file mode 100644 index 03153851b8f..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_common_tables.h +++ /dev/null @@ -1,136 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. October 2015 -* $Revision: V.1.4.5 a -* -* Project: CMSIS DSP Library -* Title: arm_common_tables.h -* -* Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_COMMON_TABLES_H -#define _ARM_COMMON_TABLES_H - -#include "arm_math.h" - -extern const uint16_t armBitRevTable[1024]; -extern const q15_t armRecipTableQ15[64]; -extern const q31_t armRecipTableQ31[64]; -/* extern const q31_t realCoefAQ31[1024]; */ -/* extern const q31_t realCoefBQ31[1024]; */ -extern const float32_t twiddleCoef_16[32]; -extern const float32_t twiddleCoef_32[64]; -extern const float32_t twiddleCoef_64[128]; -extern const float32_t twiddleCoef_128[256]; -extern const float32_t twiddleCoef_256[512]; -extern const float32_t twiddleCoef_512[1024]; -extern const float32_t twiddleCoef_1024[2048]; -extern const float32_t twiddleCoef_2048[4096]; -extern const float32_t twiddleCoef_4096[8192]; -#define twiddleCoef twiddleCoef_4096 -extern const q31_t twiddleCoef_16_q31[24]; -extern const q31_t twiddleCoef_32_q31[48]; -extern const q31_t twiddleCoef_64_q31[96]; -extern const q31_t twiddleCoef_128_q31[192]; -extern const q31_t twiddleCoef_256_q31[384]; -extern const q31_t twiddleCoef_512_q31[768]; -extern const q31_t twiddleCoef_1024_q31[1536]; -extern const q31_t twiddleCoef_2048_q31[3072]; -extern const q31_t twiddleCoef_4096_q31[6144]; -extern const q15_t twiddleCoef_16_q15[24]; -extern const q15_t twiddleCoef_32_q15[48]; -extern const q15_t twiddleCoef_64_q15[96]; -extern const q15_t twiddleCoef_128_q15[192]; -extern const q15_t twiddleCoef_256_q15[384]; -extern const q15_t twiddleCoef_512_q15[768]; -extern const q15_t twiddleCoef_1024_q15[1536]; -extern const q15_t twiddleCoef_2048_q15[3072]; -extern const q15_t twiddleCoef_4096_q15[6144]; -extern const float32_t twiddleCoef_rfft_32[32]; -extern const float32_t twiddleCoef_rfft_64[64]; -extern const float32_t twiddleCoef_rfft_128[128]; -extern const float32_t twiddleCoef_rfft_256[256]; -extern const float32_t twiddleCoef_rfft_512[512]; -extern const float32_t twiddleCoef_rfft_1024[1024]; -extern const float32_t twiddleCoef_rfft_2048[2048]; -extern const float32_t twiddleCoef_rfft_4096[4096]; - - -/* floating-point bit reversal tables */ -#define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) -#define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) -#define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) -#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) -#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) -#define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) -#define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) -#define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; - -/* fixed-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) -#define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) -#define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) -#define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) -#define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) -#define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) -#define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) -#define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; - -/* Tables for Fast Math Sine and Cosine */ -extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; -extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; -extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; - -#endif /* ARM_COMMON_TABLES_H */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_const_structs.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_const_structs.h deleted file mode 100644 index 4d026173446..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_const_structs.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. March 2015 -* $Revision: V.1.4.5 -* -* Project: CMSIS DSP Library -* Title: arm_const_structs.h -* -* Description: This file has constant structs that are initialized for -* user convenience. For example, some can be given as -* arguments to the arm_cfft_f32() function. -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_CONST_STRUCTS_H -#define _ARM_CONST_STRUCTS_H - -#include "arm_math.h" -#include "arm_common_tables.h" - -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; - -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; - -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; - -#endif diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_math.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_math.h deleted file mode 100644 index d33f8a9b3b5..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/arm_math.h +++ /dev/null @@ -1,7154 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2015 ARM Limited. All rights reserved. -* -* $Date: 20. October 2015 -* $Revision: V1.4.5 b -* -* Project: CMSIS DSP Library -* Title: arm_math.h -* -* Description: Public header file for CMSIS DSP Library -* -* Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. - * -------------------------------------------------------------------- */ - -/** - \mainpage CMSIS DSP Software Library - * - * Introduction - * ------------ - * - * This user manual describes the CMSIS DSP software library, - * a suite of common signal processing functions for use on Cortex-M processor based devices. - * - * The library is divided into a number of functions each covering a specific category: - * - Basic math functions - * - Fast math functions - * - Complex math functions - * - Filters - * - Matrix functions - * - Transforms - * - Motor control functions - * - Statistical functions - * - Support functions - * - Interpolation functions - * - * The library has separate functions for operating on 8-bit integers, 16-bit integers, - * 32-bit integer and 32-bit floating-point values. - * - * Using the Library - * ------------ - * - * The library installer contains prebuilt versions of the libraries in the Lib folder. - * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7l_math.lib (Little endian on Cortex-M7) - * - arm_cortexM7b_math.lib (Big endian on Cortex-M7) - * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4l_math.lib (Little endian on Cortex-M4) - * - arm_cortexM4b_math.lib (Big endian on Cortex-M4) - * - arm_cortexM3l_math.lib (Little endian on Cortex-M3) - * - arm_cortexM3b_math.lib (Big endian on Cortex-M3) - * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+) - * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+) - * - * The library functions are declared in the public file arm_math.h which is placed in the Include folder. - * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single - * public header file arm_math.h for Cortex-M7/M4/M3/M0/M0+ with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. - * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or - * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. - * - * Examples - * -------- - * - * The library ships with a number of examples which demonstrate how to use the library functions. - * - * Toolchain Support - * ------------ - * - * The library has been developed and tested with MDK-ARM version 5.14.0.0 - * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. - * - * Building the Library - * ------------ - * - * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. - * - arm_cortexM_math.uvprojx - * - * - * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above. - * - * Pre-processor Macros - * ------------ - * - * Each library project have differant pre-processor macros. - * - * - UNALIGNED_SUPPORT_DISABLE: - * - * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access - * - * - ARM_MATH_BIG_ENDIAN: - * - * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. - * - * - ARM_MATH_MATRIX_CHECK: - * - * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices - * - * - ARM_MATH_ROUNDING: - * - * Define macro ARM_MATH_ROUNDING for rounding on support functions - * - * - ARM_MATH_CMx: - * - * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target - * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and - * ARM_MATH_CM7 for building the library on cortex-M7. - * - * - __FPU_PRESENT: - * - * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries - * - *
- * CMSIS-DSP in ARM::CMSIS Pack - * ----------------------------- - * - * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: - * |File/Folder |Content | - * |------------------------------|------------------------------------------------------------------------| - * |\b CMSIS\\Documentation\\DSP | This documentation | - * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | - * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | - * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | - * - *
- * Revision History of CMSIS-DSP - * ------------ - * Please refer to \ref ChangeLog_pg. - * - * Copyright Notice - * ------------ - * - * Copyright (C) 2010-2015 ARM Limited. All rights reserved. - */ - - -/** - * @defgroup groupMath Basic Math Functions - */ - -/** - * @defgroup groupFastMath Fast Math Functions - * This set of functions provides a fast approximation to sine, cosine, and square root. - * As compared to most of the other functions in the CMSIS math library, the fast math functions - * operate on individual values and not arrays. - * There are separate functions for Q15, Q31, and floating-point data. - * - */ - -/** - * @defgroup groupCmplxMath Complex Math Functions - * This set of functions operates on complex data vectors. - * The data in the complex arrays is stored in an interleaved fashion - * (real, imag, real, imag, ...). - * In the API functions, the number of samples in a complex array refers - * to the number of complex values; the array contains twice this number of - * real values. - */ - -/** - * @defgroup groupFilters Filtering Functions - */ - -/** - * @defgroup groupMatrix Matrix Functions - * - * This set of functions provides basic matrix math operations. - * The functions operate on matrix data structures. For example, - * the type - * definition for the floating-point matrix structure is shown - * below: - *
- *     typedef struct
- *     {
- *       uint16_t numRows;     // number of rows of the matrix.
- *       uint16_t numCols;     // number of columns of the matrix.
- *       float32_t *pData;     // points to the data of the matrix.
- *     } arm_matrix_instance_f32;
- * 
- * There are similar definitions for Q15 and Q31 data types. - * - * The structure specifies the size of the matrix and then points to - * an array of data. The array is of size numRows X numCols - * and the values are arranged in row order. That is, the - * matrix element (i, j) is stored at: - *
- *     pData[i*numCols + j]
- * 
- * - * \par Init Functions - * There is an associated initialization function for each type of matrix - * data structure. - * The initialization function sets the values of the internal structure fields. - * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() - * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. - * - * \par - * Use of the initialization function is optional. However, if initialization function is used - * then the instance structure cannot be placed into a const data section. - * To place the instance structure in a const data - * section, manually initialize the data structure. For example: - *
- * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
- * 
- * where nRows specifies the number of rows, nColumns - * specifies the number of columns, and pData points to the - * data array. - * - * \par Size Checking - * By default all of the matrix functions perform size checking on the input and - * output matrices. For example, the matrix addition function verifies that the - * two input matrices and the output matrix all have the same number of rows and - * columns. If the size check fails the functions return: - *
- *     ARM_MATH_SIZE_MISMATCH
- * 
- * Otherwise the functions return - *
- *     ARM_MATH_SUCCESS
- * 
- * There is some overhead associated with this matrix size checking. - * The matrix size checking is enabled via the \#define - *
- *     ARM_MATH_MATRIX_CHECK
- * 
- * within the library project settings. By default this macro is defined - * and size checking is enabled. By changing the project settings and - * undefining this macro size checking is eliminated and the functions - * run a bit faster. With size checking disabled the functions always - * return ARM_MATH_SUCCESS. - */ - -/** - * @defgroup groupTransforms Transform Functions - */ - -/** - * @defgroup groupController Controller Functions - */ - -/** - * @defgroup groupStats Statistics Functions - */ -/** - * @defgroup groupSupport Support Functions - */ - -/** - * @defgroup groupInterpolation Interpolation Functions - * These functions perform 1- and 2-dimensional interpolation of data. - * Linear interpolation is used for 1-dimensional data and - * bilinear interpolation is used for 2-dimensional data. - */ - -/** - * @defgroup groupExamples Examples - */ -#ifndef _ARM_MATH_H -#define _ARM_MATH_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ - -#if defined(ARM_MATH_CM7) - #include "core_cm7.h" -#elif defined (ARM_MATH_CM4) - #include "core_cm4.h" -#elif defined (ARM_MATH_CM3) - #include "core_cm3.h" -#elif defined (ARM_MATH_CM0) - #include "core_cm0.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_CM0PLUS) - #include "core_cm0plus.h" - #define ARM_MATH_CM0_FAMILY -#else - #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" -#endif - -#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ -#include "string.h" -#include "math.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - - /** - * @brief Macros required for reciprocal calculation in Normalized LMS - */ - -#define DELTA_Q31 (0x100) -#define DELTA_Q15 0x5 -#define INDEX_MASK 0x0000003F -#ifndef PI -#define PI 3.14159265358979f -#endif - - /** - * @brief Macros required for SINE and COSINE Fast math approximations - */ - -#define FAST_MATH_TABLE_SIZE 512 -#define FAST_MATH_Q31_SHIFT (32 - 10) -#define FAST_MATH_Q15_SHIFT (16 - 10) -#define CONTROLLER_Q31_SHIFT (32 - 9) -#define TABLE_SIZE 256 -#define TABLE_SPACING_Q31 0x400000 -#define TABLE_SPACING_Q15 0x80 - - /** - * @brief Macros required for SINE and COSINE Controller functions - */ - /* 1.31(q31) Fixed value of 2/360 */ - /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ -#define INPUT_SPACING 0xB60B61 - - /** - * @brief Macro for Unaligned Support - */ -#ifndef UNALIGNED_SUPPORT_DISABLE - #define ALIGN4 -#else - #if defined (__GNUC__) - #define ALIGN4 __attribute__((aligned(4))) - #else - #define ALIGN4 __align(4) - #endif -#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ - - /** - * @brief Error status returned by some functions in the library. - */ - - typedef enum - { - ARM_MATH_SUCCESS = 0, /**< No error */ - ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ - ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ - ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ - ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ - ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ - ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ - } arm_status; - - /** - * @brief 8-bit fractional data type in 1.7 format. - */ - typedef int8_t q7_t; - - /** - * @brief 16-bit fractional data type in 1.15 format. - */ - typedef int16_t q15_t; - - /** - * @brief 32-bit fractional data type in 1.31 format. - */ - typedef int32_t q31_t; - - /** - * @brief 64-bit fractional data type in 1.63 format. - */ - typedef int64_t q63_t; - - /** - * @brief 32-bit floating-point type definition. - */ - typedef float float32_t; - - /** - * @brief 64-bit floating-point type definition. - */ - typedef double float64_t; - - /** - * @brief definition to read/write two 16 bit values. - */ -#if defined __CC_ARM - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __GNUC__ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __ICCARM__ - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED - -#elif defined __CSMC__ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED - -#elif defined __TASKING__ - #define __SIMD32_TYPE __unaligned int32_t - #define CMSIS_UNUSED - -#else - #error Unknown compiler -#endif - -#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) -#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) -#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) -#define __SIMD64(addr) (*(int64_t **) & (addr)) - -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - /** - * @brief definition to pack two 16 bit values. - */ -#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ - (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) -#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ - (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) - -#endif - - - /** - * @brief definition to pack four 8 bit values. - */ -#ifndef ARM_MATH_BIG_ENDIAN - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) -#else - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) - -#endif - - - /** - * @brief Clips Q63 to Q31 values. - */ - static __INLINE q31_t clip_q63_to_q31( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; - } - - /** - * @brief Clips Q63 to Q15 values. - */ - static __INLINE q15_t clip_q63_to_q15( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); - } - - /** - * @brief Clips Q31 to Q7 values. - */ - static __INLINE q7_t clip_q31_to_q7( - q31_t x) - { - return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? - ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; - } - - /** - * @brief Clips Q31 to Q15 values. - */ - static __INLINE q15_t clip_q31_to_q15( - q31_t x) - { - return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? - ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; - } - - /** - * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. - */ - - static __INLINE q63_t mult32x64( - q63_t x, - q31_t y) - { - return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + - (((q63_t) (x >> 32) * y))); - } - -/* - #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) - #define __CLZ __clz - #endif - */ -/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ -#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) - static __INLINE uint32_t __CLZ( - q31_t data); - - static __INLINE uint32_t __CLZ( - q31_t data) - { - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); - } -#endif - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. - */ - - static __INLINE uint32_t arm_recip_q31( - q31_t in, - q31_t * dst, - q31_t * pRecipTable) - { - q31_t out; - uint32_t tempVal; - uint32_t index, i; - uint32_t signBits; - - if(in > 0) - { - signBits = ((uint32_t) (__CLZ( in) - 1)); - } - else - { - signBits = ((uint32_t) (__CLZ(-in) - 1)); - } - - /* Convert input sample to 1.31 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 24); - index = (index & INDEX_MASK); - - /* 1.31 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t) (((q63_t) in * out) >> 31); - tempVal = 0x7FFFFFFFu - tempVal; - /* 1.31 with exp 1 */ - /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ - out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1u); - } - - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. - */ - static __INLINE uint32_t arm_recip_q15( - q15_t in, - q15_t * dst, - q15_t * pRecipTable) - { - q15_t out = 0; - uint32_t tempVal = 0; - uint32_t index = 0, i = 0; - uint32_t signBits = 0; - - if(in > 0) - { - signBits = ((uint32_t)(__CLZ( in) - 17)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 17)); - } - - /* Convert input sample to 1.15 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 8); - index = (index & INDEX_MASK); - - /* 1.15 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t) (((q31_t) in * out) >> 15); - tempVal = 0x7FFFu - tempVal; - /* 1.15 with exp 1 */ - out = (q15_t) (((q31_t) out * tempVal) >> 14); - /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1); - } - - - /* - * @brief C custom defined intrinisic function for only M0 processors - */ -#if defined(ARM_MATH_CM0_FAMILY) - static __INLINE q31_t __SSAT( - q31_t x, - uint32_t y) - { - int32_t posMax, negMin; - uint32_t i; - - posMax = 1; - for (i = 0; i < (y - 1); i++) - { - posMax = posMax * 2; - } - - if(x > 0) - { - posMax = (posMax - 1); - - if(x > posMax) - { - x = posMax; - } - } - else - { - negMin = -posMax; - - if(x < negMin) - { - x = negMin; - } - } - return (x); - } -#endif /* end of ARM_MATH_CM0_FAMILY */ - - - /* - * @brief C custom defined intrinsic function for M3 and M0 processors - */ -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - - /* - * @brief C custom defined QADD8 for M3 and M0 processors - */ - static __INLINE uint32_t __QADD8( - uint32_t x, - uint32_t y) - { - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); - } - - - /* - * @brief C custom defined QSUB8 for M3 and M0 processors - */ - static __INLINE uint32_t __QSUB8( - uint32_t x, - uint32_t y) - { - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); - } - - - /* - * @brief C custom defined QADD16 for M3 and M0 processors - */ - static __INLINE uint32_t __QADD16( - uint32_t x, - uint32_t y) - { -/* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ - q31_t r = 0, s = 0; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHADD16 for M3 and M0 processors - */ - static __INLINE uint32_t __SHADD16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QSUB16 for M3 and M0 processors - */ - static __INLINE uint32_t __QSUB16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHSUB16 for M3 and M0 processors - */ - static __INLINE uint32_t __SHSUB16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QASX for M3 and M0 processors - */ - static __INLINE uint32_t __QASX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHASX for M3 and M0 processors - */ - static __INLINE uint32_t __SHASX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QSAX for M3 and M0 processors - */ - static __INLINE uint32_t __QSAX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHSAX for M3 and M0 processors - */ - static __INLINE uint32_t __SHSAX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SMUSDX for M3 and M0 processors - */ - static __INLINE uint32_t __SMUSDX( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); - } - - /* - * @brief C custom defined SMUADX for M3 and M0 processors - */ - static __INLINE uint32_t __SMUADX( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); - } - - - /* - * @brief C custom defined QADD for M3 and M0 processors - */ - static __INLINE int32_t __QADD( - int32_t x, - int32_t y) - { - return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); - } - - - /* - * @brief C custom defined QSUB for M3 and M0 processors - */ - static __INLINE int32_t __QSUB( - int32_t x, - int32_t y) - { - return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); - } - - - /* - * @brief C custom defined SMLAD for M3 and M0 processors - */ - static __INLINE uint32_t __SMLAD( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLADX for M3 and M0 processors - */ - static __INLINE uint32_t __SMLADX( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLSDX for M3 and M0 processors - */ - static __INLINE uint32_t __SMLSDX( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLALD for M3 and M0 processors - */ - static __INLINE uint64_t __SMLALD( - uint32_t x, - uint32_t y, - uint64_t sum) - { -/* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + - ( ((q63_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLALDX for M3 and M0 processors - */ - static __INLINE uint64_t __SMLALDX( - uint32_t x, - uint32_t y, - uint64_t sum) - { -/* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q63_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMUAD for M3 and M0 processors - */ - static __INLINE uint32_t __SMUAD( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); - } - - - /* - * @brief C custom defined SMUSD for M3 and M0 processors - */ - static __INLINE uint32_t __SMUSD( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); - } - - - /* - * @brief C custom defined SXTB16 for M3 and M0 processors - */ - static __INLINE uint32_t __SXTB16( - uint32_t x) - { - return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | - ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) )); - } - -#endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ - - - /** - * @brief Instance structure for the Q7 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q7; - - /** - * @brief Instance structure for the Q15 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_f32; - - - /** - * @brief Processing function for the Q7 FIR filter. - * @param[in] S points to an instance of the Q7 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q7( - const arm_fir_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q7 FIR filter. - * @param[in,out] S points to an instance of the Q7 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed. - */ - void arm_fir_init_q7( - arm_fir_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR filter. - * @param[in] S points to an instance of the Q15 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_fast_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR filter. - * @param[in,out] S points to an instance of the Q15 FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if - * numTaps is not a supported value. - */ - arm_status arm_fir_init_q15( - arm_fir_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR filter. - * @param[in] S points to an instance of the Q31 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_fast_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR filter. - * @param[in,out] S points to an instance of the Q31 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ - void arm_fir_init_q31( - arm_fir_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point FIR filter. - * @param[in] S points to an instance of the floating-point FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_f32( - const arm_fir_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR filter. - * @param[in,out] S points to an instance of the floating-point FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ - void arm_fir_init_f32( - arm_fir_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 Biquad cascade filter. - */ - typedef struct - { - int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - } arm_biquad_casd_df1_inst_q15; - - /** - * @brief Instance structure for the Q31 Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - } arm_biquad_casd_df1_inst_q31; - - /** - * @brief Instance structure for the floating-point Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_casd_df1_inst_f32; - - - /** - * @brief Processing function for the Q15 Biquad cascade filter. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cascade_df1_init_q15( - arm_biquad_casd_df1_inst_q15 * S, - uint8_t numStages, - q15_t * pCoeffs, - q15_t * pState, - int8_t postShift); - - - /** - * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_fast_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 Biquad cascade filter - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_fast_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cascade_df1_init_q31( - arm_biquad_casd_df1_inst_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q31_t * pState, - int8_t postShift); - - - /** - * @brief Processing function for the floating-point Biquad cascade filter. - * @param[in] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_f32( - const arm_biquad_casd_df1_inst_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point Biquad cascade filter. - * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df1_init_f32( - arm_biquad_casd_df1_inst_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float32_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f32; - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float64_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f64; - - /** - * @brief Instance structure for the Q15 matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q15_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_q15; - - /** - * @brief Instance structure for the Q31 matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q31_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_q31; - - - /** - * @brief Floating-point matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pScratch); - - - /** - * @brief Q31, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_f32( - const arm_matrix_instance_f32 * pSrc, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_q15( - const arm_matrix_instance_q15 * pSrc, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_q31( - const arm_matrix_instance_q31 * pSrc, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - - /** - * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_fast_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - - /** - * @brief Q31 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_fast_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix scaling. - * @param[in] pSrc points to the input matrix - * @param[in] scale scale factor - * @param[out] pDst points to the output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_f32( - const arm_matrix_instance_f32 * pSrc, - float32_t scale, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_q15( - const arm_matrix_instance_q15 * pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_q31( - const arm_matrix_instance_q31 * pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Q31 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_q31( - arm_matrix_instance_q31 * S, - uint16_t nRows, - uint16_t nColumns, - q31_t * pData); - - - /** - * @brief Q15 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_q15( - arm_matrix_instance_q15 * S, - uint16_t nRows, - uint16_t nColumns, - q15_t * pData); - - - /** - * @brief Floating-point matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_f32( - arm_matrix_instance_f32 * S, - uint16_t nRows, - uint16_t nColumns, - float32_t * pData); - - - - /** - * @brief Instance structure for the Q15 PID Control. - */ - typedef struct - { - q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ -#ifdef ARM_MATH_CM0_FAMILY - q15_t A1; - q15_t A2; -#else - q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ -#endif - q15_t state[3]; /**< The state array of length 3. */ - q15_t Kp; /**< The proportional gain. */ - q15_t Ki; /**< The integral gain. */ - q15_t Kd; /**< The derivative gain. */ - } arm_pid_instance_q15; - - /** - * @brief Instance structure for the Q31 PID Control. - */ - typedef struct - { - q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - q31_t A2; /**< The derived gain, A2 = Kd . */ - q31_t state[3]; /**< The state array of length 3. */ - q31_t Kp; /**< The proportional gain. */ - q31_t Ki; /**< The integral gain. */ - q31_t Kd; /**< The derivative gain. */ - } arm_pid_instance_q31; - - /** - * @brief Instance structure for the floating-point PID Control. - */ - typedef struct - { - float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - float32_t A2; /**< The derived gain, A2 = Kd . */ - float32_t state[3]; /**< The state array of length 3. */ - float32_t Kp; /**< The proportional gain. */ - float32_t Ki; /**< The integral gain. */ - float32_t Kd; /**< The derivative gain. */ - } arm_pid_instance_f32; - - - - /** - * @brief Initialization function for the floating-point PID Control. - * @param[in,out] S points to an instance of the PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_f32( - arm_pid_instance_f32 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - */ - void arm_pid_reset_f32( - arm_pid_instance_f32 * S); - - - /** - * @brief Initialization function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_q31( - arm_pid_instance_q31 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - */ - - void arm_pid_reset_q31( - arm_pid_instance_q31 * S); - - - /** - * @brief Initialization function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_q15( - arm_pid_instance_q15 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the Q15 PID Control. - * @param[in,out] S points to an instance of the q15 PID Control structure - */ - void arm_pid_reset_q15( - arm_pid_instance_q15 * S); - - - /** - * @brief Instance structure for the floating-point Linear Interpolate function. - */ - typedef struct - { - uint32_t nValues; /**< nValues */ - float32_t x1; /**< x1 */ - float32_t xSpacing; /**< xSpacing */ - float32_t *pYData; /**< pointer to the table of Y values */ - } arm_linear_interp_instance_f32; - - /** - * @brief Instance structure for the floating-point bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - float32_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_f32; - - /** - * @brief Instance structure for the Q31 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q31_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q31; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q15_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q15; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q7_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q7; - - - /** - * @brief Q7 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q15( - arm_cfft_radix2_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q15( - const arm_cfft_radix2_instance_q15 * S, - q15_t * pSrc); - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q15( - arm_cfft_radix4_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_q15( - const arm_cfft_radix4_instance_q15 * S, - q15_t * pSrc); - - /** - * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q31; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q31( - arm_cfft_radix2_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q31( - const arm_cfft_radix2_instance_q31 * S, - q31_t * pSrc); - - /** - * @brief Instance structure for the Q31 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q31; - -/* Deprecated */ - void arm_cfft_radix4_q31( - const arm_cfft_radix4_instance_q31 * S, - q31_t * pSrc); - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q31( - arm_cfft_radix4_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix2_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_f32( - arm_cfft_radix2_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_f32( - const arm_cfft_radix2_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix4_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_f32( - arm_cfft_radix4_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_f32( - const arm_cfft_radix4_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q15; - -void arm_cfft_q15( - const arm_cfft_instance_q15 * S, - q15_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q31; - -void arm_cfft_q31( - const arm_cfft_instance_q31 * S, - q31_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_f32; - - void arm_cfft_f32( - const arm_cfft_instance_f32 * S, - float32_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the Q15 RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q15; - - arm_status arm_rfft_init_q15( - arm_rfft_instance_q15 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q15( - const arm_rfft_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst); - - /** - * @brief Instance structure for the Q31 RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q31; - - arm_status arm_rfft_init_q31( - arm_rfft_instance_q31 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q31( - const arm_rfft_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint16_t fftLenBy2; /**< length of the complex FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_f32; - - arm_status arm_rfft_init_f32( - arm_rfft_instance_f32 * S, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_f32( - const arm_rfft_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct - { - arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ - uint16_t fftLenRFFT; /**< length of the real sequence */ - float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ - } arm_rfft_fast_instance_f32 ; - -arm_status arm_rfft_fast_init_f32 ( - arm_rfft_fast_instance_f32 * S, - uint16_t fftLen); - -void arm_rfft_fast_f32( - arm_rfft_fast_instance_f32 * S, - float32_t * p, float32_t * pOut, - uint8_t ifftFlag); - - /** - * @brief Instance structure for the floating-point DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - float32_t normalize; /**< normalizing factor. */ - float32_t *pTwiddle; /**< points to the twiddle factor table. */ - float32_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_f32; - - - /** - * @brief Initialization function for the floating-point DCT4/IDCT4. - * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. - */ - arm_status arm_dct4_init_f32( - arm_dct4_instance_f32 * S, - arm_rfft_instance_f32 * S_RFFT, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint16_t N, - uint16_t Nby2, - float32_t normalize); - - - /** - * @brief Processing function for the floating-point DCT4/IDCT4. - * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_f32( - const arm_dct4_instance_f32 * S, - float32_t * pState, - float32_t * pInlineBuffer); - - - /** - * @brief Instance structure for the Q31 DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q31_t normalize; /**< normalizing factor. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - q31_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q31; - - - /** - * @brief Initialization function for the Q31 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure - * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - arm_status arm_dct4_init_q31( - arm_dct4_instance_q31 * S, - arm_rfft_instance_q31 * S_RFFT, - arm_cfft_radix4_instance_q31 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize); - - - /** - * @brief Processing function for the Q31 DCT4/IDCT4. - * @param[in] S points to an instance of the Q31 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_q31( - const arm_dct4_instance_q31 * S, - q31_t * pState, - q31_t * pInlineBuffer); - - - /** - * @brief Instance structure for the Q15 DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q15_t normalize; /**< normalizing factor. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - q15_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q15; - - - /** - * @brief Initialization function for the Q15 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - arm_status arm_dct4_init_q15( - arm_dct4_instance_q15 * S, - arm_rfft_instance_q15 * S_RFFT, - arm_cfft_radix4_instance_q15 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize); - - - /** - * @brief Processing function for the Q15 DCT4/IDCT4. - * @param[in] S points to an instance of the Q15 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_q15( - const arm_dct4_instance_q15 * S, - q15_t * pState, - q15_t * pInlineBuffer); - - - /** - * @brief Floating-point vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a floating-point vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scale scale factor to be applied - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_f32( - float32_t * pSrc, - float32_t scale, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q7 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q7( - q7_t * pSrc, - q7_t scaleFract, - int8_t shift, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q15 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q15( - q15_t * pSrc, - q15_t scaleFract, - int8_t shift, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q31 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q31( - q31_t * pSrc, - q31_t scaleFract, - int8_t shift, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Dot product of floating-point vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t blockSize, - float32_t * result); - - - /** - * @brief Dot product of Q7 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q7( - q7_t * pSrcA, - q7_t * pSrcB, - uint32_t blockSize, - q31_t * result); - - - /** - * @brief Dot product of Q15 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - - /** - * @brief Dot product of Q31 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - - /** - * @brief Shifts the elements of a Q7 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q7( - q7_t * pSrc, - int8_t shiftBits, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Shifts the elements of a Q15 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q15( - q15_t * pSrc, - int8_t shiftBits, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Shifts the elements of a Q31 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q31( - q31_t * pSrc, - int8_t shiftBits, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_f32( - float32_t * pSrc, - float32_t offset, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q7( - q7_t * pSrc, - q7_t offset, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q15( - q15_t * pSrc, - q15_t offset, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q31( - q31_t * pSrc, - q31_t offset, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a floating-point vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q7 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a floating-point vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_f32( - float32_t value, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q7 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q7( - q7_t value, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q15 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q15( - q15_t value, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q31 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q31( - q31_t value, - q31_t * pDst, - uint32_t blockSize); - - -/** - * @brief Convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ - void arm_conv_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ - void arm_conv_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ - void arm_conv_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ - void arm_conv_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ - void arm_conv_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ - void arm_conv_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Partial convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Partial convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q7 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Partial convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - arm_status arm_conv_partial_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Instance structure for the Q15 FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - } arm_fir_decimate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - } arm_fir_decimate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - } arm_fir_decimate_instance_f32; - - - /** - * @brief Processing function for the floating-point FIR decimator. - * @param[in] S points to an instance of the floating-point FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_f32( - const arm_fir_decimate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR decimator. - * @param[in,out] S points to an instance of the floating-point FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_f32( - arm_fir_decimate_instance_f32 * S, - uint16_t numTaps, - uint8_t M, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR decimator. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_fast_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR decimator. - * @param[in,out] S points to an instance of the Q15 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_q15( - arm_fir_decimate_instance_q15 * S, - uint16_t numTaps, - uint8_t M, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR decimator. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_q31( - const arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_fast_q31( - arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR decimator. - * @param[in,out] S points to an instance of the Q31 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_q31( - arm_fir_decimate_instance_q31 * S, - uint16_t numTaps, - uint8_t M, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ - } arm_fir_interpolate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ - } arm_fir_interpolate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ - } arm_fir_interpolate_instance_f32; - - - /** - * @brief Processing function for the Q15 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_q15( - const arm_fir_interpolate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR interpolator. - * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_q15( - arm_fir_interpolate_instance_q15 * S, - uint8_t L, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_q31( - const arm_fir_interpolate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR interpolator. - * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_q31( - arm_fir_interpolate_instance_q31 * S, - uint8_t L, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point FIR interpolator. - * @param[in] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_f32( - const arm_fir_interpolate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR interpolator. - * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_f32( - arm_fir_interpolate_instance_f32 * S, - uint8_t L, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the high precision Q31 Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ - } arm_biquad_cas_df1_32x64_ins_q31; - - - /** - * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cas_df1_32x64_q31( - const arm_biquad_cas_df1_32x64_ins_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cas_df1_32x64_init_q31( - arm_biquad_cas_df1_32x64_ins_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q63_t * pState, - uint8_t postShift); - - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f32; - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_stereo_df2T_instance_f32; - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f64; - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df2T_f32( - const arm_biquad_cascade_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_stereo_df2T_f32( - const arm_biquad_cascade_stereo_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df2T_f64( - const arm_biquad_cascade_df2T_instance_f64 * S, - float64_t * pSrc, - float64_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df2T_init_f32( - arm_biquad_cascade_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_stereo_df2T_init_f32( - arm_biquad_cascade_stereo_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df2T_init_f64( - arm_biquad_cascade_df2T_instance_f64 * S, - uint8_t numStages, - float64_t * pCoeffs, - float64_t * pState); - - - /** - * @brief Instance structure for the Q15 FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_f32; - - - /** - * @brief Initialization function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_q15( - arm_fir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pCoeffs, - q15_t * pState); - - - /** - * @brief Processing function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_q15( - const arm_fir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_q31( - arm_fir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pCoeffs, - q31_t * pState); - - - /** - * @brief Processing function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_q31( - const arm_fir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_f32( - arm_fir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Processing function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_f32( - const arm_fir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_f32; - - - /** - * @brief Processing function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_f32( - const arm_iir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_init_f32( - arm_iir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pkCoeffs, - float32_t * pvCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_q31( - const arm_iir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_init_q31( - arm_iir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pkCoeffs, - q31_t * pvCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the Q15 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_q15( - const arm_iir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process per call. - */ - void arm_iir_lattice_init_q15( - arm_iir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pkCoeffs, - q15_t * pvCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the floating-point LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that controls filter coefficient updates. */ - } arm_lms_instance_f32; - - - /** - * @brief Processing function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_f32( - const arm_lms_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_init_f32( - arm_lms_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - } arm_lms_instance_q15; - - - /** - * @brief Initialization function for the Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_init_q15( - arm_lms_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint32_t postShift); - - - /** - * @brief Processing function for Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_q15( - const arm_lms_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - } arm_lms_instance_q31; - - - /** - * @brief Processing function for Q31 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_q31( - const arm_lms_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q31 LMS filter. - * @param[in] S points to an instance of the Q31 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_init_q31( - arm_lms_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint32_t postShift); - - - /** - * @brief Instance structure for the floating-point normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that control filter coefficient updates. */ - float32_t energy; /**< saves previous frame energy. */ - float32_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_f32; - - - /** - * @brief Processing function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_f32( - arm_lms_norm_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_init_f32( - arm_lms_norm_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q31_t *recipTable; /**< points to the reciprocal initial value table. */ - q31_t energy; /**< saves previous frame energy. */ - q31_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q31; - - - /** - * @brief Processing function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_q31( - arm_lms_norm_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_norm_init_q31( - arm_lms_norm_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint8_t postShift); - - - /** - * @brief Instance structure for the Q15 normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< Number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q15_t *recipTable; /**< Points to the reciprocal initial value table. */ - q15_t energy; /**< saves previous frame energy. */ - q15_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q15; - - - /** - * @brief Processing function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_q15( - arm_lms_norm_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_norm_init_q15( - arm_lms_norm_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint8_t postShift); - - - /** - * @brief Correlation of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Correlation of Q15 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ - void arm_correlate_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - - /** - * @brief Correlation of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - - void arm_correlate_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - - void arm_correlate_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ - void arm_correlate_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - - /** - * @brief Correlation of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ - void arm_correlate_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Instance structure for the floating-point sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_f32; - - /** - * @brief Instance structure for the Q31 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q31; - - /** - * @brief Instance structure for the Q15 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q15; - - /** - * @brief Instance structure for the Q7 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q7; - - - /** - * @brief Processing function for the floating-point sparse FIR filter. - * @param[in] S points to an instance of the floating-point sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_f32( - arm_fir_sparse_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - float32_t * pScratchIn, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point sparse FIR filter. - * @param[in,out] S points to an instance of the floating-point sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_f32( - arm_fir_sparse_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 sparse FIR filter. - * @param[in] S points to an instance of the Q31 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q31( - arm_fir_sparse_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - q31_t * pScratchIn, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 sparse FIR filter. - * @param[in,out] S points to an instance of the Q31 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q31( - arm_fir_sparse_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 sparse FIR filter. - * @param[in] S points to an instance of the Q15 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q15( - arm_fir_sparse_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - q15_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 sparse FIR filter. - * @param[in,out] S points to an instance of the Q15 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q15( - arm_fir_sparse_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q7 sparse FIR filter. - * @param[in] S points to an instance of the Q7 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q7( - arm_fir_sparse_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - q7_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q7 sparse FIR filter. - * @param[in,out] S points to an instance of the Q7 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q7( - arm_fir_sparse_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Floating-point sin_cos function. - * @param[in] theta input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cos output. - */ - void arm_sin_cos_f32( - float32_t theta, - float32_t * pSinVal, - float32_t * pCosVal); - - - /** - * @brief Q31 sin_cos function. - * @param[in] theta scaled input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cosine output. - */ - void arm_sin_cos_q31( - q31_t theta, - q31_t * pSinVal, - q31_t * pCosVal); - - - /** - * @brief Floating-point complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - /** - * @brief Q31 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup PID PID Motor Control - * - * A Proportional Integral Derivative (PID) controller is a generic feedback control - * loop mechanism widely used in industrial control systems. - * A PID controller is the most commonly used type of feedback controller. - * - * This set of functions implements (PID) controllers - * for Q15, Q31, and floating-point data types. The functions operate on a single sample - * of data and each call to the function returns a single processed value. - * S points to an instance of the PID control data structure. in - * is the input sample value. The functions return the output value. - * - * \par Algorithm: - *
-   *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
-   *    A0 = Kp + Ki + Kd
-   *    A1 = (-Kp ) - (2 * Kd )
-   *    A2 = Kd  
- * - * \par - * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant - * - * \par - * \image html PID.gif "Proportional Integral Derivative Controller" - * - * \par - * The PID controller calculates an "error" value as the difference between - * the measured output and the reference input. - * The controller attempts to minimize the error by adjusting the process control inputs. - * The proportional value determines the reaction to the current error, - * the integral value determines the reaction based on the sum of recent errors, - * and the derivative value determines the reaction based on the rate at which the error has been changing. - * - * \par Instance Structure - * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. - * A separate instance structure must be defined for each PID Controller. - * There are separate instance structure declarations for each of the 3 supported data types. - * - * \par Reset Functions - * There is also an associated reset function for each data type which clears the state array. - * - * \par Initialization Functions - * There is also an associated initialization function for each data type. - * The initialization function performs the following operations: - * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. - * - Zeros out the values in the state buffer. - * - * \par - * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. - * - * \par Fixed-Point Behavior - * Care must be taken when using the fixed-point versions of the PID Controller functions. - * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup PID - * @{ - */ - - /** - * @brief Process function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - */ - static __INLINE float32_t arm_pid_f32( - arm_pid_instance_f32 * S, - float32_t in) - { - float32_t out; - - /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ - out = (S->A0 * in) + - (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - - } - - /** - * @brief Process function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 64-bit accumulator. - * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. - * Thus, if the accumulator result overflows it wraps around rather than clip. - * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. - * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. - */ - static __INLINE q31_t arm_pid_q31( - arm_pid_instance_q31 * S, - q31_t in) - { - q63_t acc; - q31_t out; - - /* acc = A0 * x[n] */ - acc = (q63_t) S->A0 * in; - - /* acc += A1 * x[n-1] */ - acc += (q63_t) S->A1 * S->state[0]; - - /* acc += A2 * x[n-2] */ - acc += (q63_t) S->A2 * S->state[1]; - - /* convert output to 1.31 format to add y[n-1] */ - out = (q31_t) (acc >> 31u); - - /* out += y[n-1] */ - out += S->state[2]; - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - } - - - /** - * @brief Process function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using a 64-bit internal accumulator. - * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. - * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. - * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. - * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. - * Lastly, the accumulator is saturated to yield a result in 1.15 format. - */ - static __INLINE q15_t arm_pid_q15( - arm_pid_instance_q15 * S, - q15_t in) - { - q63_t acc; - q15_t out; - -#ifndef ARM_MATH_CM0_FAMILY - __SIMD32_TYPE *vstate; - - /* Implementation of PID controller */ - - /* acc = A0 * x[n] */ - acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - vstate = __SIMD32_CONST(S->state); - acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc); -#else - /* acc = A0 * x[n] */ - acc = ((q31_t) S->A0) * in; - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - acc += (q31_t) S->A1 * S->state[0]; - acc += (q31_t) S->A2 * S->state[1]; -#endif - - /* acc += y[n-1] */ - acc += (q31_t) S->state[2] << 15; - - /* saturate the output */ - out = (q15_t) (__SSAT((acc >> 15), 16)); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - } - - /** - * @} end of PID group - */ - - - /** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 * src, - arm_matrix_instance_f32 * dst); - - - /** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - arm_status arm_mat_inverse_f64( - const arm_matrix_instance_f64 * src, - arm_matrix_instance_f64 * dst); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup clarke Vector Clarke Transform - * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. - * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents - * in the two-phase orthogonal stator axis Ialpha and Ibeta. - * When Ialpha is superposed with Ia as shown in the figure below - * \image html clarke.gif Stator current space vector and its components in (a,b). - * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta - * can be calculated using only Ia and Ib. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeFormula.gif - * where Ia and Ib are the instantaneous stator phases and - * pIalpha and pIbeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup clarke - * @{ - */ - - /** - * - * @brief Floating-point Clarke transform - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - */ - static __INLINE void arm_clarke_f32( - float32_t Ia, - float32_t Ib, - float32_t * pIalpha, - float32_t * pIbeta) - { - /* Calculate pIalpha using the equation, pIalpha = Ia */ - *pIalpha = Ia; - - /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ - *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); - } - - - /** - * @brief Clarke transform for Q31 version - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - static __INLINE void arm_clarke_q31( - q31_t Ia, - q31_t Ib, - q31_t * pIalpha, - q31_t * pIbeta) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIalpha from Ia by equation pIalpha = Ia */ - *pIalpha = Ia; - - /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); - - /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ - product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); - - /* pIbeta is calculated by adding the intermediate products */ - *pIbeta = __QADD(product1, product2); - } - - /** - * @} end of clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_q7_to_q31( - q7_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_clarke Vector Inverse Clarke Transform - * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeInvFormula.gif - * where pIa and pIb are the instantaneous stator phases and - * Ialpha and Ibeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_clarke - * @{ - */ - - /** - * @brief Floating-point Inverse Clarke transform - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - */ - static __INLINE void arm_inv_clarke_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pIa, - float32_t * pIb) - { - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ - *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; - } - - - /** - * @brief Inverse Clarke transform for Q31 version - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the subtraction, hence there is no risk of overflow. - */ - static __INLINE void arm_inv_clarke_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pIa, - q31_t * pIb) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); - - /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); - - /* pIb is calculated by subtracting the products */ - *pIb = __QSUB(product2, product1); - } - - /** - * @} end of inv_clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_q7_to_q15( - q7_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup park Vector Park Transform - * - * Forward Park transform converts the input two-coordinate vector to flux and torque components. - * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents - * from the stationary to the moving reference frame and control the spatial relationship between - * the stator vector current and rotor flux vector. - * If we consider the d axis aligned with the rotor flux, the diagram below shows the - * current vector and the relationship from the two reference frames: - * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkFormula.gif - * where Ialpha and Ibeta are the stator vector components, - * pId and pIq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup park - * @{ - */ - - /** - * @brief Floating-point Park transform - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * The function implements the forward Park transform. - * - */ - static __INLINE void arm_park_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pId, - float32_t * pIq, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ - *pId = Ialpha * cosVal + Ibeta * sinVal; - - /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ - *pIq = -Ialpha * sinVal + Ibeta * cosVal; - } - - - /** - * @brief Park transform for Q31 version - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition and subtraction, hence there is no risk of overflow. - */ - static __INLINE void arm_park_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pId, - q31_t * pIq, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Ialpha * cosVal) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * sinVal) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Ialpha * sinVal) */ - product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * cosVal) */ - product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); - - /* Calculate pId by adding the two intermediate products 1 and 2 */ - *pId = __QADD(product1, product2); - - /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ - *pIq = __QSUB(product4, product3); - } - - /** - * @} end of park group - */ - - /** - * @brief Converts the elements of the Q7 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q7_to_float( - q7_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_park Vector Inverse Park transform - * Inverse Park transform converts the input flux and torque components to two-coordinate vector. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkInvFormula.gif - * where pIalpha and pIbeta are the stator vector components, - * Id and Iq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_park - * @{ - */ - - /** - * @brief Floating-point Inverse Park transform - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - */ - static __INLINE void arm_inv_park_f32( - float32_t Id, - float32_t Iq, - float32_t * pIalpha, - float32_t * pIbeta, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ - *pIalpha = Id * cosVal - Iq * sinVal; - - /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ - *pIbeta = Id * sinVal + Iq * cosVal; - } - - - /** - * @brief Inverse Park transform for Q31 version - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - static __INLINE void arm_inv_park_q31( - q31_t Id, - q31_t Iq, - q31_t * pIalpha, - q31_t * pIbeta, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Id * cosVal) */ - product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Iq * sinVal) */ - product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Id * sinVal) */ - product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Iq * cosVal) */ - product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); - - /* Calculate pIalpha by using the two intermediate products 1 and 2 */ - *pIalpha = __QSUB(product1, product2); - - /* Calculate pIbeta by using the two intermediate products 3 and 4 */ - *pIbeta = __QADD(product4, product3); - } - - /** - * @} end of Inverse park group - */ - - - /** - * @brief Converts the elements of the Q31 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_float( - q31_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
-   *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
-   *       where x0, x1 are nearest values of input x
-   *             y0, y1 are nearest values to output y
-   * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ - - /** - * @addtogroup LinearInterpolate - * @{ - */ - - /** - * @brief Process function for the floating-point Linear Interpolation Function. - * @param[in,out] S is an instance of the floating-point Linear Interpolation structure - * @param[in] x input sample to process - * @return y processed output sample. - * - */ - static __INLINE float32_t arm_linear_interp_f32( - arm_linear_interp_instance_f32 * S, - float32_t x) - { - float32_t y; - float32_t x0, x1; /* Nearest input values */ - float32_t y0, y1; /* Nearest output values */ - float32_t xSpacing = S->xSpacing; /* spacing between input values */ - int32_t i; /* Index variable */ - float32_t *pYData = S->pYData; /* pointer to output table */ - - /* Calculation of index */ - i = (int32_t) ((x - S->x1) / xSpacing); - - if(i < 0) - { - /* Iniatilize output for below specified range as least output value of table */ - y = pYData[0]; - } - else if((uint32_t)i >= S->nValues) - { - /* Iniatilize output for above specified range as last output value of table */ - y = pYData[S->nValues - 1]; - } - else - { - /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; - - /* Read of nearest output values */ - y0 = pYData[i]; - y1 = pYData[i + 1]; - - /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); - - } - - /* returns output value */ - return (y); - } - - - /** - * - * @brief Process function for the Q31 Linear Interpolation Function. - * @param[in] pYData pointer to Q31 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - static __INLINE q31_t arm_linear_interp_q31( - q31_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q31_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (q31_t)0xFFF00000) >> 20); - - if(index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if(index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* shift left by 11 to keep fract in 1.31 format */ - fract = (x & 0x000FFFFF) << 11; - - /* Read two nearest output values from the index in 1.31(q31) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 2.30 format */ - y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); - - /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ - y += ((q31_t) (((q63_t) y1 * fract) >> 32)); - - /* Convert y to 1.31 format */ - return (y << 1u); - } - } - - - /** - * - * @brief Process function for the Q15 Linear Interpolation Function. - * @param[in] pYData pointer to Q15 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - static __INLINE q15_t arm_linear_interp_q15( - q15_t * pYData, - q31_t x, - uint32_t nValues) - { - q63_t y; /* output */ - q15_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (int32_t)0xFFF00000) >> 20); - - if(index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if(index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 13.35 format */ - y = ((q63_t) y0 * (0xFFFFF - fract)); - - /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ - y += ((q63_t) y1 * (fract)); - - /* convert y to 1.15 format */ - return (q15_t) (y >> 20); - } - } - - - /** - * - * @brief Process function for the Q7 Linear Interpolation Function. - * @param[in] pYData pointer to Q7 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - */ - static __INLINE q7_t arm_linear_interp_q7( - q7_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q7_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - uint32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - if (x < 0) - { - return (pYData[0]); - } - index = (x >> 20) & 0xfff; - - if(index >= (nValues - 1)) - { - return (pYData[nValues - 1]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index and are in 1.7(q7) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ - y = ((y0 * (0xFFFFF - fract))); - - /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ - y += (y1 * fract); - - /* convert y to 1.7(q7) format */ - return (q7_t) (y >> 20); - } - } - - /** - * @} end of LinearInterpolate group - */ - - /** - * @brief Fast approximation to the trigonometric sine function for floating-point data. - * @param[in] x input value in radians. - * @return sin(x). - */ - float32_t arm_sin_f32( - float32_t x); - - - /** - * @brief Fast approximation to the trigonometric sine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - q31_t arm_sin_q31( - q31_t x); - - - /** - * @brief Fast approximation to the trigonometric sine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - q15_t arm_sin_q15( - q15_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for floating-point data. - * @param[in] x input value in radians. - * @return cos(x). - */ - float32_t arm_cos_f32( - float32_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - q31_t arm_cos_q31( - q31_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - q15_t arm_cos_q15( - q15_t x); - - - /** - * @ingroup groupFastMath - */ - - - /** - * @defgroup SQRT Square Root - * - * Computes the square root of a number. - * There are separate functions for Q15, Q31, and floating-point data types. - * The square root function is computed using the Newton-Raphson algorithm. - * This is an iterative algorithm of the form: - *
-   *      x1 = x0 - f(x0)/f'(x0)
-   * 
- * where x1 is the current estimate, - * x0 is the previous estimate, and - * f'(x0) is the derivative of f() evaluated at x0. - * For the square root function, the algorithm reduces to: - *
-   *     x0 = in/2                         [initial guess]
-   *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
-   * 
- */ - - - /** - * @addtogroup SQRT - * @{ - */ - - /** - * @brief Floating-point square root function. - * @param[in] in input value. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - static __INLINE arm_status arm_sqrt_f32( - float32_t in, - float32_t * pOut) - { - if(in >= 0.0f) - { - -#if (__FPU_USED == 1) && defined ( __CC_ARM ) - *pOut = __sqrtf(in); -#elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined(__GNUC__) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) - __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); -#else - *pOut = sqrtf(in); -#endif - - return (ARM_MATH_SUCCESS); - } - else - { - *pOut = 0.0f; - return (ARM_MATH_ARGUMENT_ERROR); - } - } - - - /** - * @brief Q31 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q31( - q31_t in, - q31_t * pOut); - - - /** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q15( - q15_t in, - q15_t * pOut); - - /** - * @} end of SQRT group - */ - - - /** - * @brief floating-point Circular write function. - */ - static __INLINE void arm_circularWrite_f32( - int32_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const int32_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - - /** - * @brief floating-point Circular Read function. - */ - static __INLINE void arm_circularRead_f32( - int32_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - int32_t * dst, - int32_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (int32_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Q15 Circular write function. - */ - static __INLINE void arm_circularWrite_q15( - q15_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q15_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - /** - * @brief Q15 Circular Read function. - */ - static __INLINE void arm_circularRead_q15( - q15_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q15_t * dst, - q15_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (q15_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update wOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Q7 Circular write function. - */ - static __INLINE void arm_circularWrite_q7( - q7_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q7_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - /** - * @brief Q7 Circular Read function. - */ - static __INLINE void arm_circularRead_q7( - q7_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q7_t * dst, - q7_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (q7_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Sum of the squares of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q31( - q31_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q15( - q15_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q7( - q7_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Mean value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult); - - - /** - * @brief Mean value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Mean value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Mean value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Variance of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Variance of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Variance of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Standard deviation of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Standard deviation of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Standard deviation of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Floating-point complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t numSamples, - q31_t * realResult, - q31_t * imagResult); - - - /** - * @brief Q31 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t numSamples, - q63_t * realResult, - q63_t * imagResult); - - - /** - * @brief Floating-point complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t numSamples, - float32_t * realResult, - float32_t * imagResult); - - - /** - * @brief Q15 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_q15( - q15_t * pSrcCmplx, - q15_t * pSrcReal, - q15_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_q31( - q31_t * pSrcCmplx, - q31_t * pSrcReal, - q31_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_f32( - float32_t * pSrcCmplx, - float32_t * pSrcReal, - float32_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Minimum value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] result is output pointer - * @param[in] index is the array index of the minimum value in the input buffer. - */ - void arm_min_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * result, - uint32_t * index); - - - /** - * @brief Minimum value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[in] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Minimum value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Minimum value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q7 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q15 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q31 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a floating-point vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Q15 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Converts the elements of the floating-point vector to Q31 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q31 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q31( - float32_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the floating-point vector to Q15 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q15( - float32_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the floating-point vector to Q7 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q7 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q7( - float32_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q31 vector to Q15 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_q15( - q31_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q31 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_q7( - q31_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_float( - q15_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q31 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_q31( - q15_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_q7( - q15_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
-   *   typedef struct
-   *   {
-   *     uint16_t numRows;
-   *     uint16_t numCols;
-   *     float32_t *pData;
-   * } arm_bilinear_interp_instance_f32;
-   * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
-   *     XF = floor(x)
-   *     YF = floor(y)
-   * 
- * \par - * The interpolated output point is computed as: - *
-   *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
-   *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
-   *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
-   *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
-   * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ - - /** - * @addtogroup BilinearInterpolate - * @{ - */ - - - /** - * - * @brief Floating-point bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate. - * @param[in] Y interpolation coordinate. - * @return out interpolated value. - */ - static __INLINE float32_t arm_bilinear_interp_f32( - const arm_bilinear_interp_instance_f32 * S, - float32_t X, - float32_t Y) - { - float32_t out; - float32_t f00, f01, f10, f11; - float32_t *pData = S->pData; - int32_t xIndex, yIndex, index; - float32_t xdiff, ydiff; - float32_t b1, b2, b3, b4; - - xIndex = (int32_t) X; - yIndex = (int32_t) Y; - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) - { - return (0); - } - - /* Calculation of index for two nearest points in X-direction */ - index = (xIndex - 1) + (yIndex - 1) * S->numCols; - - - /* Read two nearest points in X-direction */ - f00 = pData[index]; - f01 = pData[index + 1]; - - /* Calculation of index for two nearest points in Y-direction */ - index = (xIndex - 1) + (yIndex) * S->numCols; - - - /* Read two nearest points in Y-direction */ - f10 = pData[index]; - f11 = pData[index + 1]; - - /* Calculation of intermediate values */ - b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; - - /* Calculation of fractional part in X */ - xdiff = X - xIndex; - - /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; - - /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; - - /* return to application */ - return (out); - } - - - /** - * - * @brief Q31 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q31_t arm_bilinear_interp_q31( - arm_bilinear_interp_instance_q31 * S, - q31_t X, - q31_t Y) - { - q31_t out; /* Temporary output */ - q31_t acc = 0; /* output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q31_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q31_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* shift left xfract by 11 to keep 1.31 format */ - xfract = (X & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; - x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; - - /* 20 bits for the fractional part */ - /* shift left yfract by 11 to keep 1.31 format */ - yfract = (Y & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; - y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ - out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); - acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); - - /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); - - /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* Convert acc to 1.31(q31) format */ - return ((q31_t)(acc << 2)); - } - - - /** - * @brief Q15 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q15_t arm_bilinear_interp_q15( - arm_bilinear_interp_instance_q15 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q15_t x1, x2, y1, y2; /* Nearest output values */ - q31_t xfract, yfract; /* X, Y fractional parts */ - int32_t rI, cI; /* Row and column indices */ - q15_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ - - /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ - /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ - out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); - acc = ((q63_t) out * (0xFFFFF - yfract)); - - /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); - acc += ((q63_t) out * (xfract)); - - /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* acc is in 13.51 format and down shift acc by 36 times */ - /* Convert out to 1.15 format */ - return ((q15_t)(acc >> 36)); - } - - - /** - * @brief Q7 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q7_t arm_bilinear_interp_q7( - arm_bilinear_interp_instance_q7 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q7_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q7_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ - out = ((x1 * (0xFFFFF - xfract))); - acc = (((q63_t) out * (0xFFFFF - yfract))); - - /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ - out = ((x2 * (0xFFFFF - yfract))); - acc += (((q63_t) out * (xfract))); - - /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y1 * (0xFFFFF - xfract))); - acc += (((q63_t) out * (yfract))); - - /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y2 * (yfract))); - acc += (((q63_t) out * (xfract))); - - /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ - return ((q7_t)(acc >> 40)); - } - - /** - * @} end of BilinearInterpolate group - */ - - -/* SMMLAR */ -#define multAcc_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMLSR */ -#define multSub_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMULR */ -#define mult_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) - -/* SMMLA */ -#define multAcc_32x32_keep32(a, x, y) \ - a += (q31_t) (((q63_t) x * y) >> 32) - -/* SMMLS */ -#define multSub_32x32_keep32(a, x, y) \ - a -= (q31_t) (((q63_t) x * y) >> 32) - -/* SMMUL */ -#define mult_32x32_keep32(a, x, y) \ - a = (q31_t) (((q63_t) x * y ) >> 32) - - -#if defined ( __CC_ARM ) - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("push") \ - _Pragma ("O1") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_EXIT \ - _Pragma ("pop") - #else - #define LOW_OPTIMIZATION_EXIT - #endif - - /* Enter low optimization region - place directly above function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - - /* Exit low optimization region - place directly after end of function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__GNUC__) - #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") )) - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ICCARM__) - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #define LOW_OPTIMIZATION_EXIT - - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__CSMC__) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__TASKING__) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#endif - - -#ifdef __cplusplus -} -#endif - - -#if defined ( __GNUC__ ) -#pragma GCC diagnostic pop -#endif - -#endif /* _ARM_MATH_H */ - -/** - * - * End of file. - */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc.h deleted file mode 100644 index 74c49c67def..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc.h +++ /dev/null @@ -1,734 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#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 - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/* intrinsic void __enable_irq(); */ -/* 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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)1); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \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 (__FPU_PRESENT == 1U) && (__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 (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - register uint32_t __regfpscr __ASM("fpscr"); - __regfpscr = (fpscr); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __rev - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_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] value Value to rotate - \param [in] value 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - #define __RBIT __rbit -#else -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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) - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -#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 /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_H */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc_V6.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc_V6.h deleted file mode 100644 index 6d8f998d84f..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_armcc_V6.h +++ /dev/null @@ -1,1804 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc_V6.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_ARMCC_V6_H -#define __CMSIS_ARMCC_V6_H - - -/* ########################### 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, control" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile("MSR control, %0" : : "r"(control) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get IPSR Register (non-secure) - \details Returns the content of the non-secure IPSR Register when in secure state. - \return IPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_IPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get APSR Register (non-secure) - \details Returns the content of the non-secure APSR Register when in secure state. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_APSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get xPSR Register (non-secure) - \details Returns the content of the non-secure xPSR Register when in secure state. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_xPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp, %0" : : "r"(topOfProcStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp_ns, %0" : : "r"(topOfProcStack) : "sp"); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp, %0" : : "r"(topOfMainStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp_ns, %0" : : "r"(topOfMainStack) : "sp"); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, primask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile("MSR primask, %0" : : "r"(priMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile("MSR primask_ns, %0" : : "r"(priMask) : "memory"); -} -#endif - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, basepri" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile("MSR basepri, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_ns, %0" : : "r"(value) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile("MSR basepri_max, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Base Priority with condition (non_secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_MAX_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_max_ns, %0" : : "r"(value) : "memory"); -} -#endif - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, faultmask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask, %0" : : "r"(faultMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask_ns, %0" : : "r"(faultMask) : "memory"); -} -#endif - - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \brief Get Process Stack Pointer Limit - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim, %0" : : "r"(ProcStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim_ns, %0\n" : : "r"(ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim" : "=r"(result)); - - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim, %0" : : "r"(MainStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim_ns, %0" : : "r"(MainStackPtrLimit)); -} -#endif - -#endif /* (__ARM_ARCH_8M__ == 1U) */ - - -#if ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=4 */ - -/** - \brief Get FPSCR - \details eturns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#define __get_FPSCR __builtin_arm_get_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get FPSCR (non-secure) - \details Returns the current value of the non-secure Floating Point Status/Control register when in secure state. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FPSCR_NS(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr_ns" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#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 - */ -#define __set_FPSCR __builtin_arm_set_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set FPSCR (non-secure) - \details Assigns the given value to the non-secure Floating Point Status/Control register when in secure state. - \param [in] fpscr Floating Point Status/Control value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FPSCR_NS(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr_ns, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#endif /* ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __builtin_bswap32 - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16 __builtin_bswap16 /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -#if 0 -__attribute__((always_inline)) __STATIC_INLINE 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); -} -#endif - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -/* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ - int32_t result; - - __ASM volatile("revsh %0, %1" : __CMSIS_GCC_OUT_REG(result) : __CMSIS_GCC_USE_REG(value)); - return (result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -/* ToDo: ARMCC_V6: check if __builtin_arm_rbit is supported */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - __ASM volatile("rbit %0, %1" : "=r"(result) : "r"(value)); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \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 - - -/** - \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*/ -#define __SSAT(ARG1,ARG2) \ -({ \ - 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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat -#if 0 -#define __USAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) -#endif - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile("strt %1, %0" : "=Q"(*ptr) : "r"(value)); -} - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 /* (__ARM_ARCH_8M__ == 1U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__ARM_FEATURE_DSP == 1U) /* ToDo: ARMCC_V6: This should be ARCH >= ARMv7-M + SIMD */ - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) \ -({ \ - uint32_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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("uxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("sxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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 __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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_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 == 1U) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_V6_H */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_gcc.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_gcc.h deleted file mode 100644 index bb89fbba9e4..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/cmsis_gcc.h +++ /dev/null @@ -1,1373 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_GCC_H -#define __CMSIS_GCC_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#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. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); - return(result); -} - - -/** - \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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp"); -} - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msp\n" : "=r" (result) ); - return(result); -} - - -/** - \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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp"); -} - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (__CORTEX_M >= 0x03U) - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); -} - - -/** - \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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (value) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - -#endif /* (__CORTEX_M >= 0x03U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - __ASM volatile (""); - return(result); -#else - return(0); -#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 - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc"); - __ASM volatile (""); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) -{ - __ASM volatile ("wfe"); -} - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (short)__builtin_bswap16(value); -#else - int32_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] value Value to rotate - \param [in] value Number of Bits to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __CLREX(void) -{ - __ASM volatile ("clrex" ::: "memory"); -} - - -/** - \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(ARG1,ARG2) \ -({ \ - uint32_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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1,ARG2) \ -({ \ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %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 ("ldrbt %0, [%1]" : "=r" (result) : "r" (addr) : "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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %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 ("ldrht %0, [%1]" : "=r" (result) : "r" (addr) : "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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*addr) ); - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *addr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*addr) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *addr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*addr) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *addr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*addr) : "r" (value) ); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE 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 __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; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_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 /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#if defined ( __GNUC__ ) -#pragma GCC diagnostic pop -#endif - -#endif /* __CMSIS_GCC_H */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm0.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm0.h deleted file mode 100644 index 711dad55170..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm0.h +++ /dev/null @@ -1,798 +0,0 @@ -/**************************************************************************//** - * @file core_cm0.h - * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM0 definitions */ -#define __CM0_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM0_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \ - __CM0_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 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_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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M0 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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/m480/CMSIS/Include/core_cm0plus.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm0plus.h deleted file mode 100644 index b04aa390532..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm0plus.h +++ /dev/null @@ -1,914 +0,0 @@ -/**************************************************************************//** - * @file core_cm0plus.h - * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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+ - @{ - */ - -/* CMSIS CM0+ definitions */ -#define __CM0PLUS_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM0PLUS_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16U) | \ - __CM0PLUS_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 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 */ -#if (__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 (__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 (__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 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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M0+ 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 (__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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/m480/CMSIS/Include/core_cm3.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm3.h deleted file mode 100644 index b4ac4c7b05a..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm3.h +++ /dev/null @@ -1,1763 +0,0 @@ -/**************************************************************************//** - * @file core_cm3.h - * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM3 definitions */ -#define __CM3_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM3_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16U) | \ - __CM3_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x03U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 4U - #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:15; /*!< bit: 9..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_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 RSERVED1[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 (__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 */ - -/* 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 */ - -#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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M3 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 (__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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/m480/CMSIS/Include/core_cm4.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm4.h deleted file mode 100644 index dc840ebf222..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm4.h +++ /dev/null @@ -1,1937 +0,0 @@ -/**************************************************************************//** - * @file core_cm4.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM4 definitions */ -#define __CM4_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM4_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \ - __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x04U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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 (__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_PCS_VFP - #if (__FPU_PRESENT == 1) - #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 (__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 (__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 ( __TMS470__ ) - #if defined __TI_VFP_SUPPORT__ - #if (__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 (__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 (__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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ -#include "core_cmSimd.h" /* Compiler specific SIMD Intrinsics */ - -#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 4U - #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: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 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 RSERVED1[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 */ - -/* 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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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 - - -#if (__FPU_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 */ -} 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 */ - -/*@} end of group CMSIS_FPU */ -#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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M4 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 (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1U) - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point 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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/m480/CMSIS/Include/core_cm7.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm7.h deleted file mode 100644 index 3b7530ad505..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cm7.h +++ /dev/null @@ -1,2512 +0,0 @@ -/**************************************************************************//** - * @file core_cm7.h - * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM7 definitions */ -#define __CM7_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM7_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16U) | \ - __CM7_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x07U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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 (__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_PCS_VFP - #if (__FPU_PRESENT == 1) - #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 (__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 (__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 ( __TMS470__ ) - #if defined __TI_VFP_SUPPORT__ - #if (__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 (__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 (__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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ -#include "core_cmSimd.h" /* Compiler specific SIMD Intrinsics */ - -#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: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 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 RSERVED1[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 1 */ - 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 */ - -/* 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_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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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 - - -#if (__FPU_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 */ - -/*@} end of group CMSIS_FPU */ -#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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M4 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 (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1U) - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point 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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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) -{ - uint32_t mvfr0; - - mvfr0 = SCB->MVFR0; - if ((mvfr0 & 0x00000FF0UL) == 0x220UL) - { - return 2UL; /* Double + Single precision FPU */ - } - else if ((mvfr0 & 0x00000FF0UL) == 0x020UL) - { - return 1UL; /* Single precision FPU */ - } - else - { - return 0UL; /* 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 ) - - -/** - \brief Enable I-Cache - \details Turns on I-Cache - */ -__STATIC_INLINE void SCB_EnableICache (void) -{ - #if (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; /* invalidate I-Cache */ - SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; /* enable I-Cache */ - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Disable I-Cache - \details Turns off I-Cache - */ -__STATIC_INLINE void SCB_DisableICache (void) -{ - #if (__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_INLINE void SCB_InvalidateICache (void) -{ - #if (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Enable D-Cache - \details Turns on D-Cache - */ -__STATIC_INLINE void SCB_EnableDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - __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_INLINE void SCB_DisableDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* Level 1 data cache */ - __DSB(); - - ccsidr = SCB->CCSIDR; - - SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ - - /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Invalidate D-Cache - \details Invalidates D-Cache - */ -__STATIC_INLINE void SCB_InvalidateDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Clean D-Cache - \details Cleans D-Cache - */ -__STATIC_INLINE void SCB_CleanDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief Clean & Invalidate D-Cache - \details Cleans and Invalidates D-Cache - */ -__STATIC_INLINE void SCB_CleanInvalidateDCache (void) -{ - #if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Invalidate by address - \details Invalidates D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t)addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCIMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Clean by address - \details Cleans D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCCMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \brief D-Cache Clean and Invalidate by address - \details Cleans and invalidates D_Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) { - SCB->DCCIMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __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 (__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 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/nuvoton/libraries/m480/CMSIS/Include/core_cmFunc.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmFunc.h deleted file mode 100644 index 652a48af07a..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmFunc.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmFunc.h - * @brief CMSIS Cortex-M Core Function Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMFUNC_H -#define __CORE_CMFUNC_H - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@} end of CMSIS_Core_RegAccFunctions */ - -#endif /* __CORE_CMFUNC_H */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmInstr.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmInstr.h deleted file mode 100644 index f474b0e6f36..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmInstr.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmInstr.h - * @brief CMSIS Cortex-M Core Instruction Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMINSTR_H -#define __CORE_CMINSTR_H - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - -#endif /* __CORE_CMINSTR_H */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmSimd.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmSimd.h deleted file mode 100644 index 66bf5c2a725..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_cmSimd.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file core_cmSimd.h - * @brief CMSIS Cortex-M SIMD Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMSIMD_H -#define __CORE_CMSIMD_H - -#ifdef __cplusplus - extern "C" { -#endif - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CMSIMD_H */ diff --git a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_sc000.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_sc000.h deleted file mode 100644 index 514dbd81b9f..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_sc000.h +++ /dev/null @@ -1,926 +0,0 @@ -/**************************************************************************//** - * @file core_sc000.h - * @brief CMSIS SC000 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS SC000 definitions */ -#define __SC000_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __SC000_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16U) | \ - __SC000_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (000U) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 SC000 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 (__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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/m480/CMSIS/Include/core_sc300.h b/bsp/nuvoton/libraries/m480/CMSIS/Include/core_sc300.h deleted file mode 100644 index 8bd18aa318a..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/Include/core_sc300.h +++ /dev/null @@ -1,1745 +0,0 @@ -/**************************************************************************//** - * @file core_sc300.h - * @brief CMSIS SC300 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS SC300 definitions */ -#define __SC300_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __SC300_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16U) | \ - __SC300_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (300U) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __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_PCS_VFP - #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 ( __TMS470__ ) - #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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 4U - #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:15; /*!< bit: 9..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_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 RSERVED1[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 */ - -/* 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 */ - uint32_t RESERVED1[1U]; -} 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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M3 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 (__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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/m480/CMSIS/SConscript b/bsp/nuvoton/libraries/m480/CMSIS/SConscript deleted file mode 100644 index 904fca41463..00000000000 --- a/bsp/nuvoton/libraries/m480/CMSIS/SConscript +++ /dev/null @@ -1,16 +0,0 @@ -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(""" -""") - -path = [cwd + '/Include',] - -group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/M480.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/M480.h deleted file mode 100644 index 782ee01aa9a..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/M480.h +++ /dev/null @@ -1,713 +0,0 @@ -/**************************************************************************//** - * @file M480.h - * @version V1.00 - * @brief M480 peripheral access layer header file. - * This file contains all the peripheral register's definitions, - * bits definitions and memory mapping for NuMicro M480 MCU. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -/** - \mainpage NuMicro M480 Driver Reference Guide - * - * Introduction - * - * This user manual describes the usage of M480 Series MCU device driver - * - * Disclaimer - * - * The Software is furnished "AS IS", without warranty as to performance or results, and - * the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all - * warranties, express, implied or otherwise, with regard to the Software, its use, or - * operation, including without limitation any and all warranties of merchantability, fitness - * for a particular purpose, and non-infringement of intellectual property rights. - * - * Important Notice - * - * Nuvoton Products are neither intended nor warranted for usage in systems or equipment, - * any malfunction or failure of which may cause loss of human life, bodily injury or severe - * property damage. Such applications are deemed, "Insecure Usage". - * - * Insecure usage includes, but is not limited to: equipment for surgical implementation, - * atomic energy control instruments, airplane or spaceship instruments, the control or - * operation of dynamic, brake or safety systems designed for vehicular use, traffic signal - * instruments, all types of safety devices, and other applications intended to support or - * sustain life. - * - * All Insecure Usage shall be made at customer's risk, and in the event that third parties - * lay claims to Nuvoton as a result of customer's Insecure Usage, customer shall indemnify - * the damages and liabilities thus incurred by Nuvoton. - * - * Please note that all data and specifications are subject to change without notice. All the - * trademarks of products and companies mentioned in this datasheet belong to their respective - * owners. - * - * Copyright Notice - * - * Copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - */ -#ifndef __M480_H__ -#define __M480_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************/ -/* Processor and Core Peripherals */ -/******************************************************************************/ -/** @addtogroup CMSIS_Device Device CMSIS Definitions - Configuration of the Cortex-M4 Processor and Core Peripherals - @{ -*/ - -/** - * @details Interrupt Number Definition. - */ -typedef enum IRQn -{ - /****** Cortex-M4 Processor Exceptions Numbers ***************************************************/ - NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */ - MemoryManagement_IRQn = -12, /*!< 4 Memory Management Interrupt */ - BusFault_IRQn = -11, /*!< 5 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /*!< 6 Usage Fault Interrupt */ - SVCall_IRQn = -5, /*!< 11 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /*!< 14 Pend SV Interrupt */ - SysTick_IRQn = -1, /*!< 15 System Tick Interrupt */ - - /****** M480 Specific Interrupt Numbers ********************************************************/ - - BOD_IRQn = 0, /*!< Brown Out detection Interrupt */ - IRC_IRQn = 1, /*!< Internal RC Interrupt */ - PWRWU_IRQn = 2, /*!< Power Down Wake Up Interrupt */ - RAMPE_IRQn = 3, /*!< SRAM parity check failed Interrupt */ - CKFAIL_IRQn = 4, /*!< Clock failed Interrupt */ - RTC_IRQn = 6, /*!< Real Time Clock Interrupt */ - TAMPER_IRQn = 7, /*!< Tamper detection Interrupt */ - WDT_IRQn = 8, /*!< Watchdog timer Interrupt */ - WWDT_IRQn = 9, /*!< Window Watchdog timer Interrupt */ - EINT0_IRQn = 10, /*!< External Input 0 Interrupt */ - EINT1_IRQn = 11, /*!< External Input 1 Interrupt */ - EINT2_IRQn = 12, /*!< External Input 2 Interrupt */ - EINT3_IRQn = 13, /*!< External Input 3 Interrupt */ - EINT4_IRQn = 14, /*!< External Input 4 Interrupt */ - EINT5_IRQn = 15, /*!< External Input 5 Interrupt */ - GPA_IRQn = 16, /*!< GPIO Port A Interrupt */ - GPB_IRQn = 17, /*!< GPIO Port B Interrupt */ - GPC_IRQn = 18, /*!< GPIO Port C Interrupt */ - GPD_IRQn = 19, /*!< GPIO Port D Interrupt */ - GPE_IRQn = 20, /*!< GPIO Port E Interrupt */ - GPF_IRQn = 21, /*!< GPIO Port F Interrupt */ - QSPI0_IRQn = 22, /*!< QSPI0 Interrupt */ - SPI0_IRQn = 23, /*!< SPI0 Interrupt */ - BRAKE0_IRQn = 24, /*!< BRAKE0 Interrupt */ - EPWM0P0_IRQn = 25, /*!< EPWM0P0 Interrupt */ - EPWM0P1_IRQn = 26, /*!< EPWM0P1 Interrupt */ - EPWM0P2_IRQn = 27, /*!< EPWM0P2 Interrupt */ - BRAKE1_IRQn = 28, /*!< BRAKE1 Interrupt */ - EPWM1P0_IRQn = 29, /*!< EPWM1P0 Interrupt */ - EPWM1P1_IRQn = 30, /*!< EPWM1P1 Interrupt */ - EPWM1P2_IRQn = 31, /*!< EPWM1P2 Interrupt */ - TMR0_IRQn = 32, /*!< Timer 0 Interrupt */ - TMR1_IRQn = 33, /*!< Timer 1 Interrupt */ - TMR2_IRQn = 34, /*!< Timer 2 Interrupt */ - TMR3_IRQn = 35, /*!< Timer 3 Interrupt */ - UART0_IRQn = 36, /*!< UART 0 Interrupt */ - UART1_IRQn = 37, /*!< UART 1 Interrupt */ - I2C0_IRQn = 38, /*!< I2C 0 Interrupt */ - I2C1_IRQn = 39, /*!< I2C 1 Interrupt */ - PDMA_IRQn = 40, /*!< Peripheral DMA Interrupt */ - DAC_IRQn = 41, /*!< DAC Interrupt */ - EADC00_IRQn = 42, /*!< EADC00 Interrupt */ - EADC01_IRQn = 43, /*!< EADC01 Interrupt */ - ACMP01_IRQn = 44, /*!< Analog Comparator 0 and 1 Interrupt */ - EADC02_IRQn = 46, /*!< EADC02 Interrupt */ - EADC03_IRQn = 47, /*!< EADC03 Interrupt */ - UART2_IRQn = 48, /*!< UART2 Interrupt */ - UART3_IRQn = 49, /*!< UART3 Interrupt */ - QSPI1_IRQn = 50, /*!< QSPI1 Interrupt */ - SPI1_IRQn = 51, /*!< SPI1 Interrupt */ - SPI2_IRQn = 52, /*!< SPI2 Interrupt */ - USBD_IRQn = 53, /*!< USB device Interrupt */ - USBH_IRQn = 54, /*!< USB host Interrupt */ - USBOTG_IRQn = 55, /*!< USB OTG Interrupt */ - CAN0_IRQn = 56, /*!< CAN0 Interrupt */ - CAN1_IRQn = 57, /*!< CAN1 Interrupt */ - SC0_IRQn = 58, /*!< Smart Card 0 Interrupt */ - SC1_IRQn = 59, /*!< Smart Card 1 Interrupt */ - SC2_IRQn = 60, /*!< Smart Card 2 Interrupt */ - SPI3_IRQn = 62, /*!< SPI3 Interrupt */ - EMAC_TX_IRQn = 66, /*!< Ethernet MAC TX Interrupt */ - EMAC_RX_IRQn = 67, /*!< Ethernet MAC RX Interrupt */ - SDH0_IRQn = 64, /*!< Secure Digital Host Controller 0 Interrupt */ - USBD20_IRQn = 65, /*!< High Speed USB device Interrupt */ - I2S0_IRQn = 68, /*!< I2S0 Interrupt */ - OPA_IRQn = 70, /*!< OPA Interrupt */ - CRPT_IRQn = 71, /*!< CRPT Interrupt */ - GPG_IRQn = 72, /*!< GPIO Port G Interrupt */ - EINT6_IRQn = 73, /*!< External Input 6 Interrupt */ - UART4_IRQn = 74, /*!< UART4 Interrupt */ - UART5_IRQn = 75, /*!< UART5 Interrupt */ - USCI0_IRQn = 76, /*!< USCI0 Interrupt */ - USCI1_IRQn = 77, /*!< USCI1 Interrupt */ - BPWM0_IRQn = 78, /*!< BPWM0 Interrupt */ - BPWM1_IRQn = 79, /*!< BPWM1 Interrupt */ - SPIM_IRQn = 80, /*!< SPIM Interrupt */ - CCAP_IRQn = 81, /*!< CCAP Interrupt */ - I2C2_IRQn = 82, /*!< I2C2 Interrupt */ - QEI0_IRQn = 84, /*!< QEI0 Interrupt */ - QEI1_IRQn = 85, /*!< QEI1 Interrupt */ - ECAP0_IRQn = 86, /*!< ECAP0 Interrupt */ - ECAP1_IRQn = 87, /*!< ECAP1 Interrupt */ - GPH_IRQn = 88, /*!< GPIO Port H Interrupt */ - EINT7_IRQn = 89, /*!< External Input 7 Interrupt */ - SDH1_IRQn = 90, /*!< Secure Digital Host Controller 1 Interrupt */ - HSUSBH_IRQn = 92, /*!< High speed USB host Interrupt */ - USBOTG20_IRQn = 93, /*!< High speed USB OTG Interrupt */ - TRNG_IRQn = 101, /*!< TRNG Interrupt */ - UART6_IRQn = 102, /*!< UART6 Interrupt */ - UART7_IRQn = 103, /*!< UART7 Interrupt */ - EADC10_IRQn = 104, /*!< EADC10 Interrupt */ - EADC11_IRQn = 105, /*!< EADC11 Interrupt */ - EADC12_IRQn = 106, /*!< EADC12 Interrupt */ - EADC13_IRQn = 107, /*!< EADC13 Interrupt */ - CAN2_IRQn = 108, /*!< CAN2 Interrupt */ -} -IRQn_Type; - - -/* - * ========================================================================== - * ----------- Processor and Core Peripheral Section ------------------------ - * ========================================================================== - */ - -/* Configuration of the Cortex-M4 Processor and Core Peripherals */ -#define __CM4_REV 0x0201UL /*!< Core Revision r2p1 */ -#define __NVIC_PRIO_BITS 4UL /*!< Number of Bits used for Priority Levels */ -#define __Vendor_SysTickConfig 0UL /*!< Set to 1 if different SysTick Config is used */ -#define __MPU_PRESENT 1UL /*!< MPU present or not */ -#ifdef __FPU_PRESENT -#undef __FPU_PRESENT -#define __FPU_PRESENT 1UL /*!< FPU present or not */ -#else -#define __FPU_PRESENT 1UL /*!< FPU present or not */ -#endif - -/*@}*/ /* end of group CMSIS_Device */ - - -#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ -#include "system_M480.h" /* System include file */ -#include - - - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/******************************************************************************/ -/* Register definitions */ -/******************************************************************************/ - -#include "sys_reg.h" -#include "clk_reg.h" -#include "fmc_reg.h" -#include "gpio_reg.h" -#include "pdma_reg.h" -#include "timer_reg.h" -#include "wdt_reg.h" -#include "wwdt_reg.h" -#include "rtc_reg.h" -#include "epwm_reg.h" -#include "bpwm_reg.h" -#include "qei_reg.h" -#include "ecap_reg.h" -#include "uart_reg.h" -#include "emac_reg.h" -#include "sc_reg.h" -#include "i2s_reg.h" -#include "spi_reg.h" -#include "qspi_reg.h" -#include "spim_reg.h" -#include "i2c_reg.h" -#include "uuart_reg.h" -#include "uspi_reg.h" -#include "ui2c_reg.h" -#include "can_reg.h" -#include "sdh_reg.h" -#include "ebi_reg.h" -#include "usbd_reg.h" -#include "hsusbd_reg.h" -#include "usbh_reg.h" -#include "hsusbh_reg.h" -#include "otg_reg.h" -#include "hsotg_reg.h" -#include "crc_reg.h" -#include "crypto_reg.h" -#include "trng_reg.h" -#include "eadc_reg.h" -#include "dac_reg.h" -#include "acmp_reg.h" -#include "opa_reg.h" -#include "ccap_reg.h" - - -/** @addtogroup PERIPHERAL_MEM_MAP Peripheral Memory Base - Memory Mapped Structure for Peripherals - @{ - */ -/* Peripheral and SRAM base address */ -#define FLASH_BASE ((uint32_t)0x00000000) /*!< Flash base address */ -#define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM Base Address */ -#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral Base Address */ -#define AHBPERIPH_BASE PERIPH_BASE /*!< AHB Base Address */ -#define APBPERIPH_BASE (PERIPH_BASE + (uint32_t)0x00040000) /*!< APB Base Address */ - -/*!< AHB peripherals */ -#define SYS_BASE (AHBPERIPH_BASE + 0x00000UL) -#define CLK_BASE (AHBPERIPH_BASE + 0x00200UL) -#define NMI_BASE (AHBPERIPH_BASE + 0x00300UL) -#define GPIOA_BASE (AHBPERIPH_BASE + 0x04000UL) -#define GPIOB_BASE (AHBPERIPH_BASE + 0x04040UL) -#define GPIOC_BASE (AHBPERIPH_BASE + 0x04080UL) -#define GPIOD_BASE (AHBPERIPH_BASE + 0x040C0UL) -#define GPIOE_BASE (AHBPERIPH_BASE + 0x04100UL) -#define GPIOF_BASE (AHBPERIPH_BASE + 0x04140UL) -#define GPIOG_BASE (AHBPERIPH_BASE + 0x04180UL) -#define GPIOH_BASE (AHBPERIPH_BASE + 0x041C0UL) -#define GPIOI_BASE (AHBPERIPH_BASE + 0x04200UL) -#define GPIO_DBCTL_BASE (AHBPERIPH_BASE + 0x04440UL) -#define GPIO_PIN_DATA_BASE (AHBPERIPH_BASE + 0x04800UL) -#define PDMA_BASE (AHBPERIPH_BASE + 0x08000UL) -#define USBH_BASE (AHBPERIPH_BASE + 0x09000UL) -#define HSUSBH_BASE (AHBPERIPH_BASE + 0x1A000UL) -#define EMAC_BASE (AHBPERIPH_BASE + 0x0B000UL) -#define FMC_BASE (AHBPERIPH_BASE + 0x0C000UL) -#define SDH0_BASE (AHBPERIPH_BASE + 0x0D000UL) -#define SDH1_BASE (AHBPERIPH_BASE + 0x0E000UL) -#define EBI_BASE (AHBPERIPH_BASE + 0x10000UL) -#define HSUSBD_BASE (AHBPERIPH_BASE + 0x19000UL) -#define CCAP_BASE (AHBPERIPH_BASE + 0x30000UL) -#define CRC_BASE (AHBPERIPH_BASE + 0x31000UL) -#define TAMPER_BASE (AHBPERIPH_BASE + 0xE1000UL) - -/*!< APB2 peripherals */ -#define WDT_BASE (APBPERIPH_BASE + 0x00000UL) -#define WWDT_BASE (APBPERIPH_BASE + 0x00100UL) -#define OPA_BASE (APBPERIPH_BASE + 0x06000UL) -#define I2S_BASE (APBPERIPH_BASE + 0x08000UL) -#define EADC1_BASE (APBPERIPH_BASE + 0x0B000UL) -#define TIMER0_BASE (APBPERIPH_BASE + 0x10000UL) -#define TIMER1_BASE (APBPERIPH_BASE + 0x10100UL) -#define EPWM0_BASE (APBPERIPH_BASE + 0x18000UL) -#define BPWM0_BASE (APBPERIPH_BASE + 0x1A000UL) -#define QSPI0_BASE (APBPERIPH_BASE + 0x20000UL) -#define SPI1_BASE (APBPERIPH_BASE + 0x22000UL) -#define SPI3_BASE (APBPERIPH_BASE + 0x24000UL) -#define UART0_BASE (APBPERIPH_BASE + 0x30000UL) -#define UART2_BASE (APBPERIPH_BASE + 0x32000UL) -#define UART4_BASE (APBPERIPH_BASE + 0x34000UL) -#define UART6_BASE (APBPERIPH_BASE + 0x36000UL) -#define I2C0_BASE (APBPERIPH_BASE + 0x40000UL) -#define I2C2_BASE (APBPERIPH_BASE + 0x42000UL) -#define CAN0_BASE (APBPERIPH_BASE + 0x60000UL) -#define CAN2_BASE (APBPERIPH_BASE + 0x62000UL) -#define QEI0_BASE (APBPERIPH_BASE + 0x70000UL) -#define ECAP0_BASE (APBPERIPH_BASE + 0x74000UL) -#define USCI0_BASE (APBPERIPH_BASE + 0x90000UL) - - -/*!< APB1 peripherals */ -#define RTC_BASE (APBPERIPH_BASE + 0x01000UL) -#define EADC_BASE (APBPERIPH_BASE + 0x03000UL) -#define ACMP01_BASE (APBPERIPH_BASE + 0x05000UL) -#define USBD_BASE (APBPERIPH_BASE + 0x80000UL) -#define OTG_BASE (APBPERIPH_BASE + 0x0D000UL) -#define HSOTG_BASE (APBPERIPH_BASE + 0x0F000UL) -#define TIMER2_BASE (APBPERIPH_BASE + 0x11000UL) -#define TIMER3_BASE (APBPERIPH_BASE + 0x11100UL) -#define EPWM1_BASE (APBPERIPH_BASE + 0x19000UL) -#define BPWM1_BASE (APBPERIPH_BASE + 0x1B000UL) -#define SPI0_BASE (APBPERIPH_BASE + 0x21000UL) -#define SPI2_BASE (APBPERIPH_BASE + 0x23000UL) -#define QSPI1_BASE (APBPERIPH_BASE + 0x29000UL) -#define UART1_BASE (APBPERIPH_BASE + 0x31000UL) -#define UART3_BASE (APBPERIPH_BASE + 0x33000UL) -#define UART5_BASE (APBPERIPH_BASE + 0x35000UL) -#define UART7_BASE (APBPERIPH_BASE + 0x37000UL) -#define I2C1_BASE (APBPERIPH_BASE + 0x41000UL) -#define CAN1_BASE (APBPERIPH_BASE + 0x61000UL) -#define QEI1_BASE (APBPERIPH_BASE + 0x71000UL) -#define ECAP1_BASE (APBPERIPH_BASE + 0x75000UL) -#define TRNG_BASE (APBPERIPH_BASE + 0x79000UL) -#define USCI1_BASE (APBPERIPH_BASE + 0x91000UL) -#define CRPT_BASE (0x50080000UL) -#define SPIM_BASE (0x40007000UL) - -#define SC0_BASE (APBPERIPH_BASE + 0x50000UL) -#define SC1_BASE (APBPERIPH_BASE + 0x51000UL) -#define SC2_BASE (APBPERIPH_BASE + 0x52000UL) -#define DAC0_BASE (APBPERIPH_BASE + 0x07000UL) -#define DAC1_BASE (APBPERIPH_BASE + 0x07040UL) -#define DACDBG_BASE (APBPERIPH_BASE + 0x07FECUL) -#define OPA0_BASE (APBPERIPH_BASE + 0x06000UL) - -/*@}*/ /* end of group PERIPHERAL_MEM_MAP */ - - -/** @addtogroup PERIPHERAL_DECLARATION Peripheral Pointer - The Declaration of Peripherals - @{ - */ - -#define SYS ((SYS_T *) SYS_BASE) -#define CLK ((CLK_T *) CLK_BASE) -#define NMI ((NMI_T *) NMI_BASE) -#define PA ((GPIO_T *) GPIOA_BASE) -#define PB ((GPIO_T *) GPIOB_BASE) -#define PC ((GPIO_T *) GPIOC_BASE) -#define PD ((GPIO_T *) GPIOD_BASE) -#define PE ((GPIO_T *) GPIOE_BASE) -#define PF ((GPIO_T *) GPIOF_BASE) -#define PG ((GPIO_T *) GPIOG_BASE) -#define PH ((GPIO_T *) GPIOH_BASE) -#define GPA ((GPIO_T *) GPIOA_BASE) -#define GPB ((GPIO_T *) GPIOB_BASE) -#define GPC ((GPIO_T *) GPIOC_BASE) -#define GPD ((GPIO_T *) GPIOD_BASE) -#define GPE ((GPIO_T *) GPIOE_BASE) -#define GPF ((GPIO_T *) GPIOF_BASE) -#define GPG ((GPIO_T *) GPIOG_BASE) -#define GPH ((GPIO_T *) GPIOH_BASE) -#define GPIO ((GPIO_DBCTL_T *) GPIO_DBCTL_BASE) -#define PDMA ((PDMA_T *) PDMA_BASE) -#define USBH ((USBH_T *) USBH_BASE) -#define HSUSBH ((HSUSBH_T *) HSUSBH_BASE) -#define EMAC ((EMAC_T *) EMAC_BASE) -#define FMC ((FMC_T *) FMC_BASE) -#define SDH0 ((SDH_T *) SDH0_BASE) -#define SDH1 ((SDH_T *) SDH1_BASE) -#define EBI ((EBI_T *) EBI_BASE) -#define CRC ((CRC_T *) CRC_BASE) -#define TAMPER ((TAMPER_T *) TAMPER_BASE) - -#define WDT ((WDT_T *) WDT_BASE) -#define WWDT ((WWDT_T *) WWDT_BASE) -#define RTC ((RTC_T *) RTC_BASE) -#define EADC ((EADC_T *) EADC_BASE) -#define EADC0 ((EADC_T *) EADC_BASE) -#define EADC1 ((EADC_T *) EADC1_BASE) -#define ACMP01 ((ACMP_T *) ACMP01_BASE) - -#define I2S0 ((I2S_T *) I2S_BASE) -#define USBD ((USBD_T *) USBD_BASE) -#define OTG ((OTG_T *) OTG_BASE) -#define HSUSBD ((HSUSBD_T *)HSUSBD_BASE) -#define HSOTG ((HSOTG_T *) HSOTG_BASE) -#define TIMER0 ((TIMER_T *) TIMER0_BASE) -#define TIMER1 ((TIMER_T *) TIMER1_BASE) -#define TIMER2 ((TIMER_T *) TIMER2_BASE) -#define TIMER3 ((TIMER_T *) TIMER3_BASE) -#define EPWM0 ((EPWM_T *) EPWM0_BASE) -#define EPWM1 ((EPWM_T *) EPWM1_BASE) -#define BPWM0 ((BPWM_T *) BPWM0_BASE) -#define BPWM1 ((BPWM_T *) BPWM1_BASE) -#define ECAP0 ((ECAP_T *) ECAP0_BASE) -#define ECAP1 ((ECAP_T *) ECAP1_BASE) -#define QEI0 ((QEI_T *) QEI0_BASE) -#define QEI1 ((QEI_T *) QEI1_BASE) -#define QSPI0 ((QSPI_T *) QSPI0_BASE) -#define QSPI1 ((QSPI_T *) QSPI1_BASE) -#define SPI0 ((SPI_T *) SPI0_BASE) -#define SPI1 ((SPI_T *) SPI1_BASE) -#define SPI2 ((SPI_T *) SPI2_BASE) -#define SPI3 ((SPI_T *) SPI3_BASE) -#define UART0 ((UART_T *) UART0_BASE) -#define UART1 ((UART_T *) UART1_BASE) -#define UART2 ((UART_T *) UART2_BASE) -#define UART3 ((UART_T *) UART3_BASE) -#define UART4 ((UART_T *) UART4_BASE) -#define UART5 ((UART_T *) UART5_BASE) -#define UART6 ((UART_T *) UART6_BASE) -#define UART7 ((UART_T *) UART7_BASE) -#define I2C0 ((I2C_T *) I2C0_BASE) -#define I2C1 ((I2C_T *) I2C1_BASE) -#define I2C2 ((I2C_T *) I2C2_BASE) -#define SC0 ((SC_T *) SC0_BASE) -#define SC1 ((SC_T *) SC1_BASE) -#define SC2 ((SC_T *) SC2_BASE) -#define CAN0 ((CAN_T *) CAN0_BASE) -#define CAN1 ((CAN_T *) CAN1_BASE) -#define CAN2 ((CAN_T *) CAN2_BASE) -#define CRPT ((CRPT_T *) CRPT_BASE) -#define TRNG ((TRNG_T *) TRNG_BASE) -#define SPIM ((volatile SPIM_T *) SPIM_BASE) -#define DAC0 ((DAC_T *) DAC0_BASE) -#define DAC1 ((DAC_T *) DAC1_BASE) -#define USPI0 ((USPI_T *) USCI0_BASE) /*!< USPI0 Configuration Struct */ -#define USPI1 ((USPI_T *) USCI1_BASE) /*!< USPI1 Configuration Struct */ -#define OPA ((OPA_T *) OPA_BASE) -#define UI2C0 ((UI2C_T *) USCI0_BASE) /*!< UI2C0 Configuration Struct */ -#define UI2C1 ((UI2C_T *) USCI1_BASE) /*!< UI2C1 Configuration Struct */ -#define UUART0 ((UUART_T *) USCI0_BASE) /*!< UUART0 Configuration Struct */ -#define UUART1 ((UUART_T *) USCI1_BASE) /*!< UUART1 Configuration Struct */ -#define CCAP ((CCAP_T *) CCAP_BASE) - -/*@}*/ /* end of group ERIPHERAL_DECLARATION */ - -/** @addtogroup IO_ROUTINE I/O Routines - The Declaration of I/O Routines - @{ - */ - -typedef volatile unsigned char vu8; ///< Define 8-bit unsigned volatile data type -typedef volatile unsigned short vu16; ///< Define 16-bit unsigned volatile data type -typedef volatile unsigned long vu32; ///< Define 32-bit unsigned volatile data type - -/** - * @brief Get a 8-bit unsigned value from specified address - * @param[in] addr Address to get 8-bit data from - * @return 8-bit unsigned value stored in specified address - */ -#define M8(addr) (*((vu8 *) (addr))) - -/** - * @brief Get a 16-bit unsigned value from specified address - * @param[in] addr Address to get 16-bit data from - * @return 16-bit unsigned value stored in specified address - * @note The input address must be 16-bit aligned - */ -#define M16(addr) (*((vu16 *) (addr))) - -/** - * @brief Get a 32-bit unsigned value from specified address - * @param[in] addr Address to get 32-bit data from - * @return 32-bit unsigned value stored in specified address - * @note The input address must be 32-bit aligned - */ -#define M32(addr) (*((vu32 *) (addr))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outpw(port,value) *((volatile unsigned int *)(port)) = (value) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inpw(port) (*((volatile unsigned int *)(port))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outps(port,value) *((volatile unsigned short *)(port)) = (value) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inps(port) (*((volatile unsigned short *)(port))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outpb(port,value) *((volatile unsigned char *)(port)) = (value) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inpb(port) (*((volatile unsigned char *)(port))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outp32(port,value) *((volatile unsigned int *)(port)) = (value) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inp32(port) (*((volatile unsigned int *)(port))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outp16(port,value) *((volatile unsigned short *)(port)) = (value) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inp16(port) (*((volatile unsigned short *)(port))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outp8(port,value) *((volatile unsigned char *)(port)) = (value) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inp8(port) (*((volatile unsigned char *)(port))) - - -/*@}*/ /* end of group IO_ROUTINE */ - -/******************************************************************************/ -/* Legacy Constants */ -/******************************************************************************/ -/** @addtogroup Legacy_Constants Legacy Constants - Legacy Constants - @{ -*/ - -#ifndef NULL -#define NULL (0) ///< NULL pointer -#endif - -#define TRUE (1UL) ///< Boolean true, define to use in API parameters or return value -#define FALSE (0UL) ///< Boolean false, define to use in API parameters or return value - -#define ENABLE (1UL) ///< Enable, define to use in API parameters -#define DISABLE (0UL) ///< Disable, define to use in API parameters - -/* Define one bit mask */ -#define BIT0 (0x00000001UL) ///< Bit 0 mask of an 32 bit integer -#define BIT1 (0x00000002UL) ///< Bit 1 mask of an 32 bit integer -#define BIT2 (0x00000004UL) ///< Bit 2 mask of an 32 bit integer -#define BIT3 (0x00000008UL) ///< Bit 3 mask of an 32 bit integer -#define BIT4 (0x00000010UL) ///< Bit 4 mask of an 32 bit integer -#define BIT5 (0x00000020UL) ///< Bit 5 mask of an 32 bit integer -#define BIT6 (0x00000040UL) ///< Bit 6 mask of an 32 bit integer -#define BIT7 (0x00000080UL) ///< Bit 7 mask of an 32 bit integer -#define BIT8 (0x00000100UL) ///< Bit 8 mask of an 32 bit integer -#define BIT9 (0x00000200UL) ///< Bit 9 mask of an 32 bit integer -#define BIT10 (0x00000400UL) ///< Bit 10 mask of an 32 bit integer -#define BIT11 (0x00000800UL) ///< Bit 11 mask of an 32 bit integer -#define BIT12 (0x00001000UL) ///< Bit 12 mask of an 32 bit integer -#define BIT13 (0x00002000UL) ///< Bit 13 mask of an 32 bit integer -#define BIT14 (0x00004000UL) ///< Bit 14 mask of an 32 bit integer -#define BIT15 (0x00008000UL) ///< Bit 15 mask of an 32 bit integer -#define BIT16 (0x00010000UL) ///< Bit 16 mask of an 32 bit integer -#define BIT17 (0x00020000UL) ///< Bit 17 mask of an 32 bit integer -#define BIT18 (0x00040000UL) ///< Bit 18 mask of an 32 bit integer -#define BIT19 (0x00080000UL) ///< Bit 19 mask of an 32 bit integer -#define BIT20 (0x00100000UL) ///< Bit 20 mask of an 32 bit integer -#define BIT21 (0x00200000UL) ///< Bit 21 mask of an 32 bit integer -#define BIT22 (0x00400000UL) ///< Bit 22 mask of an 32 bit integer -#define BIT23 (0x00800000UL) ///< Bit 23 mask of an 32 bit integer -#define BIT24 (0x01000000UL) ///< Bit 24 mask of an 32 bit integer -#define BIT25 (0x02000000UL) ///< Bit 25 mask of an 32 bit integer -#define BIT26 (0x04000000UL) ///< Bit 26 mask of an 32 bit integer -#define BIT27 (0x08000000UL) ///< Bit 27 mask of an 32 bit integer -#define BIT28 (0x10000000UL) ///< Bit 28 mask of an 32 bit integer -#define BIT29 (0x20000000UL) ///< Bit 29 mask of an 32 bit integer -#define BIT30 (0x40000000UL) ///< Bit 30 mask of an 32 bit integer -#define BIT31 (0x80000000UL) ///< Bit 31 mask of an 32 bit integer - -/* Byte Mask Definitions */ -#define BYTE0_Msk (0x000000FFUL) ///< Mask to get bit0~bit7 from a 32 bit integer -#define BYTE1_Msk (0x0000FF00UL) ///< Mask to get bit8~bit15 from a 32 bit integer -#define BYTE2_Msk (0x00FF0000UL) ///< Mask to get bit16~bit23 from a 32 bit integer -#define BYTE3_Msk (0xFF000000UL) ///< Mask to get bit24~bit31 from a 32 bit integer - -#define GET_BYTE0(u32Param) (((u32Param) & BYTE0_Msk) ) /*!< Extract Byte 0 (Bit 0~ 7) from parameter u32Param */ -#define GET_BYTE1(u32Param) (((u32Param) & BYTE1_Msk) >> 8) /*!< Extract Byte 1 (Bit 8~15) from parameter u32Param */ -#define GET_BYTE2(u32Param) (((u32Param) & BYTE2_Msk) >> 16) /*!< Extract Byte 2 (Bit 16~23) from parameter u32Param */ -#define GET_BYTE3(u32Param) (((u32Param) & BYTE3_Msk) >> 24) /*!< Extract Byte 3 (Bit 24~31) from parameter u32Param */ - -/*@}*/ /* end of group Legacy_Constants */ - - -/******************************************************************************/ -/* Peripheral header files */ -/******************************************************************************/ -#include "nu_sys.h" -#include "nu_clk.h" - -#include "nu_acmp.h" -#include "nu_dac.h" -#include "nu_emac.h" -#include "nu_uart.h" -#include "nu_usci_spi.h" -#include "nu_gpio.h" -#include "nu_ccap.h" -#include "nu_ecap.h" -#include "nu_qei.h" -#include "nu_timer.h" -#include "nu_timer_pwm.h" -#include "nu_pdma.h" -#include "nu_crypto.h" -#include "nu_trng.h" -#include "nu_fmc.h" -#include "nu_spim.h" -#include "nu_i2c.h" -#include "nu_i2s.h" -#include "nu_epwm.h" -#include "nu_eadc.h" -#include "nu_bpwm.h" -#include "nu_wdt.h" -#include "nu_wwdt.h" -#include "nu_opa.h" -#include "nu_crc.h" -#include "nu_ebi.h" -#include "nu_usci_i2c.h" -#include "nu_scuart.h" -#include "nu_sc.h" -#include "nu_spi.h" -#include "nu_qspi.h" -#include "nu_can.h" -#include "nu_rtc.h" -#include "nu_usci_uart.h" -#include "nu_sdh.h" -#include "nu_usbd.h" -#include "nu_hsusbd.h" -#include "nu_otg.h" -#include "nu_hsotg.h" - - -#ifdef __cplusplus -} -#endif - -#endif /* __M480_H__ */ - diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/NuMicro.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/NuMicro.h deleted file mode 100644 index c627d8af7c4..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/NuMicro.h +++ /dev/null @@ -1,17 +0,0 @@ -/**************************************************************************//** - * @file NuMicro.h - * @version V1.00 - * @brief NuMicro peripheral access layer header file. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NUMICRO_H__ -#define __NUMICRO_H__ - -#include "nutool_clkcfg.h" -#include "M480.h" - -#endif /* __NUMICRO_H__ */ - - diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/acmp_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/acmp_reg.h deleted file mode 100644 index 663f86292a7..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/acmp_reg.h +++ /dev/null @@ -1,240 +0,0 @@ -/**************************************************************************//** - * @file acmp_reg.h - * @version V1.00 - * @brief ACMP register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ACMP_REG_H__ -#define __ACMP_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ACMP Analog Comparator Controller(ACMP) - Memory Mapped Structure for ACMP Controller -@{ */ - -typedef struct -{ - - - /** - * @var ACMP_T::CTL - * Offset: 0x00~0x04 Analog Comparator 0/1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPEN |Comparator Enable Bit - * | | |0 = Comparator x Disabled. - * | | |1 = Comparator x Enabled. - * |[1] |ACMPIE |Comparator Interrupt Enable Bit - * | | |0 = Comparator x interrupt Disabled. - * | | |1 = Comparator x interrupt Enabled - * | | |If WKEN (ACMP_CTL0[16]) is set to 1, the wake-up interrupt function will be enabled as well. - * |[3] |ACMPOINV |Comparator Output Inverse - * | | |0 = Comparator x output inverse Disabled. - * | | |1 = Comparator x output inverse Enabled. - * |[5:4] |NEGSEL |Comparator Negative Input Selection - * | | |00 = ACMPx_N pin. - * | | |01 = Internal comparator reference voltage (CRV). - * | | |10 = Band-gap voltage. - * | | |11 = DAC output. - * |[7:6] |POSSEL |Comparator Positive Input Selection - * | | |00 = Input from ACMPx_P0. - * | | |01 = Input from ACMPx_P1. - * | | |10 = Input from ACMPx_P2. - * | | |11 = Input from ACMPx_P3. - * |[9:8] |INTPOL |Interrupt Condition Polarity Selection - * | | |ACMPIFx will be set to 1 when comparator output edge condition is detected. - * | | |00 = Rising edge or falling edge. - * | | |01 = Rising edge. - * | | |10 = Falling edge. - * | | |11 = Reserved. - * |[12] |OUTSEL |Comparator Output Select - * | | |0 = Comparator x output to ACMPx_O pin is unfiltered comparator output. - * | | |1 = Comparator x output to ACMPx_O pin is from filter output. - * |[15:13] |FILTSEL |Comparator Output Filter Count Selection - * | | |000 = Filter function is Disabled. - * | | |001 = ACMPx output is sampled 1 consecutive PCLK. - * | | |010 = ACMPx output is sampled 2 consecutive PCLKs. - * | | |011 = ACMPx output is sampled 4 consecutive PCLKs. - * | | |100 = ACMPx output is sampled 8 consecutive PCLKs. - * | | |101 = ACMPx output is sampled 16 consecutive PCLKs. - * | | |110 = ACMPx output is sampled 32 consecutive PCLKs. - * | | |111 = ACMPx output is sampled 64 consecutive PCLKs. - * |[16] |WKEN |Power-down Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[17] |WLATEN |Window Latch Mode Enable Bit - * | | |0 = Window Latch Mode Disabled. - * | | |1 = Window Latch Mode Enabled. - * |[18] |WCMPSEL |Window Compare Mode Selection - * | | |0 = Window Compare Mode Disabled. - * | | |1 = Window Compare Mode is Selected. - * |[25:24] |HYSSEL |Hysteresis Mode Selection - * | | |00 = Hysteresis is 0mV. - * | | |01 = Hysteresis is 10mV. - * | | |10 = Hysteresis is 20mV. - * | | |11 = Hysteresis is 30mV. - * |[29:28] |MODESEL |Propagation Delay Mode Selection - * | | |00 = Max propagation delay is 4.5uS, operation current is 1.2uA. - * | | |01 = Max propagation delay is 2uS, operation current is 3uA. - * | | |10 = Max propagation delay is 600nS, operation current is 10uA. - * | | |11 = Max propagation delay is 200nS, operation current is 75uA. - * @var ACMP_T::STATUS - * Offset: 0x08 Analog Comparator Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACMPIF0 |Comparator 0 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL0[9:8]) - * | | |is detected on comparator 0 output. - * | | |This will generate an interrupt if ACMPIE (ACMP_CTL0[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |ACMPIF1 |Comparator 1 Interrupt Flag - * | | |This bit is set by hardware when the edge condition defined by INTPOL (ACMP_CTL1[9:8]) - * | | |is detected on comparator 1 output. - * | | |This will cause an interrupt if ACMPIE (ACMP_CTL1[1]) is set to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |ACMPO0 |Comparator 0 Output - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 0 is disabled, i.e. - * | | |ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[5] |ACMPO1 |Comparator 1 Output - * | | |Synchronized to the PCLK to allow reading by software. - * | | |Cleared when the comparator 1 is disabled, i.e. - * | | |ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[8] |WKIF0 |Comparator 0 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP0 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |WKIF1 |Comparator 1 Power-down Wake-up Interrupt Flag - * | | |This bit will be set to 1 when ACMP1 wake-up interrupt event occurs. - * | | |0 = No power-down wake-up occurred. - * | | |1 = Power-down wake-up occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |ACMPS0 |Comparator 0 Status - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 0 is disabled, i.e. - * | | |ACMPEN (ACMP_CTL0[0]) is cleared to 0. - * |[13] |ACMPS1 |Comparator 1 Status - * | | |Synchronized to the PCLK to allow reading by software - * | | |Cleared when the comparator 1 is disabled, i.e. - * | | |ACMPEN (ACMP_CTL1[0]) is cleared to 0. - * |[16] |ACMPWO |Comparator Window Output - * | | |This bit shows the output status of window compare mode - * | | |0 = The positive input voltage is outside the window. - * | | |1 = The positive input voltage is in the window. - * @var ACMP_T::VREF - * Offset: 0x0C Analog Comparator Reference Voltage Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CRVCTL |Comparator Reference Voltage Setting - * | | |CRV = CRV source voltage * (1/6+CRVCTL/24). - * |[6] |CRVSSEL |CRV Source Voltage Selection - * | | |0 = VDDA is selected as CRV source voltage. - * | | |1 = The reference voltage defined by SYS_VREFCTL register is selected as CRV source voltage. - */ - __IO uint32_t CTL[2]; /*!< [0x0000~0x0004] Analog Comparator 0/1 Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] Analog Comparator Status Register */ - __IO uint32_t VREF; /*!< [0x000c] Analog Comparator Reference Voltage Control Register */ - -} ACMP_T; - -/** - @addtogroup ACMP_CONST ACMP Bit Field Definition - Constant Definitions for ACMP Controller -@{ */ - -#define ACMP_CTL_ACMPEN_Pos (0) /*!< ACMP_T::CTL: ACMPEN Position */ -#define ACMP_CTL_ACMPEN_Msk (0x1ul << ACMP_CTL_ACMPEN_Pos) /*!< ACMP_T::CTL: ACMPEN Mask */ - -#define ACMP_CTL_ACMPIE_Pos (1) /*!< ACMP_T::CTL: ACMPIE Position */ -#define ACMP_CTL_ACMPIE_Msk (0x1ul << ACMP_CTL_ACMPIE_Pos) /*!< ACMP_T::CTL: ACMPIE Mask */ - -#define ACMP_CTL_ACMPOINV_Pos (3) /*!< ACMP_T::CTL: ACMPOINV Position */ -#define ACMP_CTL_ACMPOINV_Msk (0x1ul << ACMP_CTL_ACMPOINV_Pos) /*!< ACMP_T::CTL: ACMPOINV Mask */ - -#define ACMP_CTL_NEGSEL_Pos (4) /*!< ACMP_T::CTL: NEGSEL Position */ -#define ACMP_CTL_NEGSEL_Msk (0x3ul << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_T::CTL: NEGSEL Mask */ - -#define ACMP_CTL_POSSEL_Pos (6) /*!< ACMP_T::CTL: POSSEL Position */ -#define ACMP_CTL_POSSEL_Msk (0x3ul << ACMP_CTL_POSSEL_Pos) /*!< ACMP_T::CTL: POSSEL Mask */ - -#define ACMP_CTL_INTPOL_Pos (8) /*!< ACMP_T::CTL: INTPOL Position */ -#define ACMP_CTL_INTPOL_Msk (0x3ul << ACMP_CTL_INTPOL_Pos) /*!< ACMP_T::CTL: INTPOL Mask */ - -#define ACMP_CTL_OUTSEL_Pos (12) /*!< ACMP_T::CTL: OUTSEL Position */ -#define ACMP_CTL_OUTSEL_Msk (0x1ul << ACMP_CTL_OUTSEL_Pos) /*!< ACMP_T::CTL: OUTSEL Mask */ - -#define ACMP_CTL_FILTSEL_Pos (13) /*!< ACMP_T::CTL: FILTSEL Position */ -#define ACMP_CTL_FILTSEL_Msk (0x7ul << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_T::CTL: FILTSEL Mask */ - -#define ACMP_CTL_WKEN_Pos (16) /*!< ACMP_T::CTL: WKEN Position */ -#define ACMP_CTL_WKEN_Msk (0x1ul << ACMP_CTL_WKEN_Pos) /*!< ACMP_T::CTL: WKEN Mask */ - -#define ACMP_CTL_WLATEN_Pos (17) /*!< ACMP_T::CTL: WLATEN Position */ -#define ACMP_CTL_WLATEN_Msk (0x1ul << ACMP_CTL_WLATEN_Pos) /*!< ACMP_T::CTL: WLATEN Mask */ - -#define ACMP_CTL_WCMPSEL_Pos (18) /*!< ACMP_T::CTL: WCMPSEL Position */ -#define ACMP_CTL_WCMPSEL_Msk (0x1ul << ACMP_CTL_WCMPSEL_Pos) /*!< ACMP_T::CTL: WCMPSEL Mask */ - -#define ACMP_CTL_HYSSEL_Pos (24) /*!< ACMP_T::CTL: HYSSEL Position */ -#define ACMP_CTL_HYSSEL_Msk (0x3ul << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_T::CTL: HYSSEL Mask */ - -#define ACMP_CTL_MODESEL_Pos (28) /*!< ACMP_T::CTL: MODESEL Position */ -#define ACMP_CTL_MODESEL_Msk (0x3ul << ACMP_CTL_MODESEL_Pos) /*!< ACMP_T::CTL: MODESEL Mask */ - -#define ACMP_STATUS_ACMPIF0_Pos (0) /*!< ACMP_T::STATUS: ACMPIF0 Position */ -#define ACMP_STATUS_ACMPIF0_Msk (0x1ul << ACMP_STATUS_ACMPIF0_Pos) /*!< ACMP_T::STATUS: ACMPIF0 Mask */ - -#define ACMP_STATUS_ACMPIF1_Pos (1) /*!< ACMP_T::STATUS: ACMPIF1 Position */ -#define ACMP_STATUS_ACMPIF1_Msk (0x1ul << ACMP_STATUS_ACMPIF1_Pos) /*!< ACMP_T::STATUS: ACMPIF1 Mask */ - -#define ACMP_STATUS_ACMPO0_Pos (4) /*!< ACMP_T::STATUS: ACMPO0 Position */ -#define ACMP_STATUS_ACMPO0_Msk (0x1ul << ACMP_STATUS_ACMPO0_Pos) /*!< ACMP_T::STATUS: ACMPO0 Mask */ - -#define ACMP_STATUS_ACMPO1_Pos (5) /*!< ACMP_T::STATUS: ACMPO1 Position */ -#define ACMP_STATUS_ACMPO1_Msk (0x1ul << ACMP_STATUS_ACMPO1_Pos) /*!< ACMP_T::STATUS: ACMPO1 Mask */ - -#define ACMP_STATUS_WKIF0_Pos (8) /*!< ACMP_T::STATUS: WKIF0 Position */ -#define ACMP_STATUS_WKIF0_Msk (0x1ul << ACMP_STATUS_WKIF0_Pos) /*!< ACMP_T::STATUS: WKIF0 Mask */ - -#define ACMP_STATUS_WKIF1_Pos (9) /*!< ACMP_T::STATUS: WKIF1 Position */ -#define ACMP_STATUS_WKIF1_Msk (0x1ul << ACMP_STATUS_WKIF1_Pos) /*!< ACMP_T::STATUS: WKIF1 Mask */ - -#define ACMP_STATUS_ACMPS0_Pos (12) /*!< ACMP_T::STATUS: ACMPS0 Position */ -#define ACMP_STATUS_ACMPS0_Msk (0x1ul << ACMP_STATUS_ACMPS0_Pos) /*!< ACMP_T::STATUS: ACMPS0 Mask */ - -#define ACMP_STATUS_ACMPS1_Pos (13) /*!< ACMP_T::STATUS: ACMPS1 Position */ -#define ACMP_STATUS_ACMPS1_Msk (0x1ul << ACMP_STATUS_ACMPS1_Pos) /*!< ACMP_T::STATUS: ACMPS1 Mask */ - -#define ACMP_STATUS_ACMPWO_Pos (16) /*!< ACMP_T::STATUS: ACMPWO Position */ -#define ACMP_STATUS_ACMPWO_Msk (0x1ul << ACMP_STATUS_ACMPWO_Pos) /*!< ACMP_T::STATUS: ACMPWO Mask */ - -#define ACMP_VREF_CRVCTL_Pos (0) /*!< ACMP_T::VREF: CRVCTL Position */ -#define ACMP_VREF_CRVCTL_Msk (0xful << ACMP_VREF_CRVCTL_Pos) /*!< ACMP_T::VREF: CRVCTL Mask */ - -#define ACMP_VREF_CRVSSEL_Pos (6) /*!< ACMP_T::VREF: CRVSSEL Position */ -#define ACMP_VREF_CRVSSEL_Msk (0x1ul << ACMP_VREF_CRVSSEL_Pos) /*!< ACMP_T::VREF: CRVSSEL Mask */ - -/**@}*/ /* ACMP_CONST */ -/**@}*/ /* end of ACMP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __ACMP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/bpwm_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/bpwm_reg.h deleted file mode 100644 index 3a4fc35fdd3..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/bpwm_reg.h +++ /dev/null @@ -1,1835 +0,0 @@ -/**************************************************************************//** - * @file bpwm_reg.h - * @version V1.00 - * @brief BPWM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __BPWM_REG_H__ -#define __BPWM_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup BPWM Basic Pulse Width Modulation Controller(BPWM) - Memory Mapped Structure for BPWM Controller -@{ */ - -typedef struct -{ - /** - * @var BCAPDAT_T::RCAPDAT - * Offset: 0x20C BPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |BPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the BPWM counter value will be saved in this register. - * @var BCAPDAT_T::FCAPDAT - * Offset: 0x210 BPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |BPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the BPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] BPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] BPWM Falling Capture Data Register 0~5 */ -} BCAPDAT_T; - -typedef struct -{ - - - /** - * @var BPWM_T::CTL0 - * Offset: 0x00 BPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[1] |CTRLD1 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[2] |CTRLD2 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[3] |CTRLD3 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[4] |CTRLD4 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[5] |CTRLD5 |Center Re-load - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[16] |IMMLDEN0 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bit(S) - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, BPWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt Disabled. - * | | |1 = ICE debug mode counter halt Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects BPWM output. - * | | |BPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |BPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var BPWM_T::CTL1 - * Offset: 0x04 BPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |BPWM Counter Behavior Type 0 - * | | |Each bit n controls corresponding BPWM channel n. - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * @var BPWM_T::CLKSRC - * Offset: 0x10 BPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |BPWM_CH01 External Clock Source Select - * | | |000 = BPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var BPWM_T::CLKPSC - * Offset: 0x14 BPWM Clock Prescale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |BPWM Counter Clock Prescale - * | | |The clock of BPWM counter is decided by clock prescaler - * | | |Each BPWM pair share one BPWM counter clock prescaler - * | | |The clock of BPWM counter is divided by (CLKPSC+ 1) - * @var BPWM_T::CNTEN - * Offset: 0x20 BPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |BPWM Counter 0 Enable Bit - * | | |0 = BPWM Counter and clock prescaler stop running. - * | | |1 = BPWM Counter and clock prescaler start running. - * @var BPWM_T::CNTCLR - * Offset: 0x24 BPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear BPWM Counter Control Bit 0 - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit BPWM counter to 0000H. - * @var BPWM_T::PERIOD - * Offset: 0x30 BPWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |BPWM Period Register - * | | |Up-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |Down-Count mode: In this mode, BPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |BPWM period time = (PERIOD+1) * BPWM_CLK period. - * | | |Up-Down-Count mode: In this mode, BPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |BPWM period time = 2 * PERIOD * BPWM_CLK period. - * @var BPWM_T::CMPDAT[6] - * Offset: 0x50 BPWM Comparator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPDAT |BPWM Comparator Register - * | | |CMPDAT use to compare with CNTR to generate BPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 denote as 6 independent BPWM_CH0~5 compared point. - * @var BPWM_T::CNT - * Offset: 0x90 BPWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |BPWM Data Register (Read Only) - * | | |User can monitor CNTR to know the current value in 16-bit period counter. - * |[16] |DIRF |BPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is Down count. - * | | |1 = Counter is UP count. - * @var BPWM_T::WGCTL0 - * Offset: 0xB0 BPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[3:2] |ZPCTL1 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[5:4] |ZPCTL2 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[7:6] |ZPCTL3 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[9:8] |ZPCTL4 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[11:10] |ZPCTL5 |BPWM Zero Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM zero point output Low. - * | | |10 = BPWM zero point output High. - * | | |11 = BPWM zero point output Toggle. - * | | |BPWM can control output level when BPWM counter count to zero. - * |[17:16] |PRDPCTL0 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |BPWM Period (Center) Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM period (center) point output Low. - * | | |10 = BPWM period (center) point output High. - * | | |11 = BPWM period (center) point output Toggle. - * | | |BPWM can control output level when BPWM counter count to (PERIOD+1). - * | | |Note: This bit is center point control when BPWM counter operating in up-down counter type. - * @var BPWM_T::WGCTL1 - * Offset: 0xB4 BPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[3:2] |CMPUCTL1 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[5:4] |CMPUCTL2 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[7:6] |CMPUCTL3 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[9:8] |CMPUCTL4 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[11:10] |CMPUCTL5 |BPWM Compare Up Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare up point output Low. - * | | |10 = BPWM compare up point output High. - * | | |11 = BPWM compare up point output Toggle. - * | | |BPWM can control output level when BPWM counter up count to CMPDAT. - * |[17:16] |CMPDCTL0 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[19:18] |CMPDCTL1 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[21:20] |CMPDCTL2 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[23:22] |CMPDCTL3 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[25:24] |CMPDCTL4 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * |[27:26] |CMPDCTL5 |BPWM Compare Down Point Control - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |00 = Do nothing. - * | | |01 = BPWM compare down point output Low. - * | | |10 = BPWM compare down point output High. - * | | |11 = BPWM compare down point output Toggle. - * | | |BPWM can control output level when BPWM counter down count to CMPDAT. - * @var BPWM_T::MSKEN - * Offset: 0xB8 BPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[1] |MSKEN1 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[2] |MSKEN2 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[3] |MSKEN3 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[4] |MSKEN4 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * |[5] |MSKEN5 |BPWM Mask Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |The BPWM output signal will be masked when this bit is enabled - * | | |The corresponding BPWM channel n will output MSKDATn (BPWM_MSK[5:0]) data. - * | | |0 = BPWM output signal is non-masked. - * | | |1 = BPWM output signal is masked and output MSKDATn data. - * @var BPWM_T::MSK - * Offset: 0xBC BPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[1] |MSKDAT1 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[2] |MSKDAT2 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[3] |MSKDAT3 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[4] |MSKDAT4 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * |[5] |MSKDAT5 |BPWM Mask Data Bit - * | | |This data bit control the state of BPWMn output pin, if corresponding mask function is enabled - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Output logic low to BPWMn. - * | | |1 = Output logic high to BPWMn. - * @var BPWM_T::POLCTL - * Offset: 0xD4 BPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[1] |PINV1 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[2] |PINV2 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[3] |PINV3 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[4] |PINV4 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * |[5] |PINV5 |BPWM PIN Polar Inverse Control - * | | |The register controls polarity state of BPWM output - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM output polar inverse Disabled. - * | | |1 = BPWM output polar inverse Enabled. - * @var BPWM_T::POEN - * Offset: 0xD8 BPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[1] |POEN1 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[2] |POEN2 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[3] |POEN3 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[4] |POEN4 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * |[5] |POEN5 |BPWM Pin Output Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM pin at tri-state. - * | | |1 = BPWM pin in output mode. - * @var BPWM_T::INTEN - * Offset: 0xE0 BPWM Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |BPWM Zero Point Interrupt 0 Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * |[8] |PIEN0 |BPWM Period Point Interrupt 0 Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When up-down counter type period point means center point. - * |[16] |CMPUIEN0 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[17] |CMPUIEN1 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[18] |CMPUIEN2 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[19] |CMPUIEN3 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[20] |CMPUIEN4 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[21] |CMPUIEN5 |BPWM Compare Up Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[24] |CMPDIEN0 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[25] |CMPDIEN1 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[26] |CMPDIEN2 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[27] |CMPDIEN3 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[28] |CMPDIEN4 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * |[29] |CMPDIEN5 |BPWM Compare Down Count Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * @var BPWM_T::INTSTS - * Offset: 0xE8 BPWM Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |BPWM Zero Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches zero, software can write 1 to clear this bit to zero. - * |[8] |PIF0 |BPWM Period Point Interrupt Flag 0 - * | | |This bit is set by hardware when BPWM_CH0 counter reaches BPWM_PERIOD0, software can write 1 to clear this bit to zero. - * |[16] |CMPUIF0 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[17] |CMPUIF1 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[18] |CMPUIF2 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[19] |CMPUIF3 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[20] |CMPUIF4 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[21] |CMPUIF5 |BPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when BPWM counter up count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * |[24] |CMPDIF0 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[25] |CMPDIF1 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[26] |CMPDIF2 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[27] |CMPDIF3 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[28] |CMPDIF4 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * |[29] |CMPDIF5 |BPWM Compare Down Count Interrupt Flag - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Flag is set by hardware when BPWM counter down count and reaches BPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * @var BPWM_T::EADCTS0 - * Offset: 0xF8 BPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |BPWM_CH0 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN0 |BPWM_CH0 Trigger EADC Enable Bit - * |[11:8] |TRGSEL1 |BPWM_CH1 Trigger EADC Source Select - * | | |0000 = BPWM_CH0 zero point. - * | | |0001 = BPWM_CH0 period point. - * | | |0010 = BPWM_CH0 zero or period point. - * | | |0011 = BPWM_CH0 up-count CMPDAT point. - * | | |0100 = BPWM_CH0 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH1 up-count CMPDAT point. - * | | |1001 = BPWM_CH1 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN1 |BPWM_CH1 Trigger EADC Enable Bit - * |[19:16] |TRGSEL2 |BPWM_CH2 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved - * |[23] |TRGEN2 |BPWM_CH2 Trigger EADC Enable Bit - * |[27:24] |TRGSEL3 |BPWM_CH3 Trigger EADC Source Select - * | | |0000 = BPWM_CH2 zero point. - * | | |0001 = BPWM_CH2 period point. - * | | |0010 = BPWM_CH2 zero or period point. - * | | |0011 = BPWM_CH2 up-count CMPDAT point. - * | | |0100 = BPWM_CH2 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH3 up-count CMPDAT point. - * | | |1001 = BPWM_CH3 down-count CMPDAT point. - * | | |Others reserved. - * |[31] |TRGEN3 |BPWM_CH3 Trigger EADC Enable Bit - * @var BPWM_T::EADCTS1 - * Offset: 0xFC BPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |BPWM_CH4 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[7] |TRGEN4 |BPWM_CH4 Trigger EADC Enable Bit - * |[11:8] |TRGSEL5 |BPWM_CH5 Trigger EADC Source Select - * | | |0000 = BPWM_CH4 zero point. - * | | |0001 = BPWM_CH4 period point. - * | | |0010 = BPWM_CH4 zero or period point. - * | | |0011 = BPWM_CH4 up-count CMPDAT point. - * | | |0100 = BPWM_CH4 down-count CMPDAT point. - * | | |0101 = Reserved. - * | | |0110 = Reserved. - * | | |0111 = Reserved. - * | | |1000 = BPWM_CH5 up-count CMPDAT point. - * | | |1001 = BPWM_CH5 down-count CMPDAT point. - * | | |Others reserved - * |[15] |TRGEN5 |BPWM_CH5 Trigger EADC Enable Bit - * @var BPWM_T::SSCTL - * Offset: 0x110 BPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |BPWM Synchronous Start Function 0 Enable Bit - * | | |When synchronous start function is enabled, the BPWM_CH0 counter enable bit (CNTEN0) can be enabled by writing BPWM synchronous start trigger bit (CNTSEN). - * | | |0 = BPWM synchronous start function Disabled. - * | | |1 = BPWM synchronous start function Enabled. - * |[9:8] |SSRC |BPWM Synchronous Start Source Select - * | | |00 = Synchronous start source come from PWM0. - * | | |01 = Synchronous start source come from PWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var BPWM_T::SSTRG - * Offset: 0x114 BPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |BPWM Counter Synchronous Start Enable Bit(Write Only) - * | | |BPMW counter synchronous enable function is used to make PWM or BPWM channels start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit if correlated BPWM channel counter synchronous start function is enabled. - * @var BPWM_T::STATUS - * Offset: 0x120 BPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAX0 |Time-base Counter 0 Equal to 0xFFFF Latched Status - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[16] |EADCTRG0 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[17] |EADCTRG1 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[18] |EADCTRG2 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[19] |EADCTRG3 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[20] |EADCTRG4 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[21] |EADCTRG5 |EADC Start of Conversion Status - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * @var BPWM_T::CAPINEN - * Offset: 0x200 BPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = BPWM Channel capture input path Disabled - * | | |The input of BPWM channel capture function is always regarded as 0. - * | | |1 = BPWM Channel capture input path Enabled - * | | |The input of BPWM channel capture function comes from correlative multifunction pin. - * @var BPWM_T::CAPCTL - * Offset: 0x204 BPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the BPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var BPWM_T::CAPSTS - * Offset: 0x208 BPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRIFOV0 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[1] |CRIFOV1 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[2] |CRIFOV2 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[3] |CRIFOV3 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[4] |CRIFOV4 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[5] |CRIFOV5 |Capture Rising Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CAPRIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPRIF. - * |[8] |CFIFOV0 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[9] |CFIFOV1 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[10] |CFIFOV2 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[11] |CFIFOV3 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[12] |CFIFOV4 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * |[13] |CFIFOV5 |Capture Falling Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CAPFIF is 1 - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |Note: This bit will be cleared automatically when user clear corresponding CAPFIF. - * @var BPWM_T::CAPIEN - * Offset: 0x250 BPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CAPRIENn |BPWM Capture Rising Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[13:8] |CAPFIENn |BPWM Capture Falling Latch Interrupt Enable Bits - * | | |Each bit n controls the corresponding BPWM channel n. - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var BPWM_T::CAPIF - * Offset: 0x254 BPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIF0 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[1] |CAPRIF1 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[2] |CAPRIF2 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[3] |CAPRIF3 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[4] |CAPRIF4 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[5] |CAPRIF5 |BPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * |[8] |CAPFIF0 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[9] |CAPFIF1 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[10] |CAPFIF2 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[11] |CAPFIF3 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[12] |CAPFIF4 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * |[13] |CAPFIF5 |BPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. Each bit n controls the corresponding BPWM channel n. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * @var BPWM_T::PBUF - * Offset: 0x304 BPWM PERIOD Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |BPWM Period Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var BPWM_T::CMPBUF[6] - * Offset: 0x31C BPWM CMPDAT 0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |BPWM Comparator Buffer (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL0; /*!< [0x0000] BPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] BPWM Control Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CLKSRC; /*!< [0x0010] BPWM Clock Source Register */ - __IO uint32_t CLKPSC; /*!< [0x0014] BPWM Clock Prescale Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CNTEN; /*!< [0x0020] BPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] BPWM Clear Counter Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PERIOD; /*!< [0x0030] BPWM Period Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[7]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CMPDAT[6]; /*!< [0x0050] BPWM Comparator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[10]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t CNT; /*!< [0x0090] BPWM Counter Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[7]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WGCTL0; /*!< [0x00b0] BPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] BPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] BPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] BPWM Mask Data Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE6[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t POLCTL; /*!< [0x00d4] BPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] BPWM Output Enable Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE7[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t INTEN; /*!< [0x00e0] BPWM Interrupt Enable Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE8[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t INTSTS; /*!< [0x00e8] BPWM Interrupt Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE9[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t EADCTS0; /*!< [0x00f8] BPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] BPWM Trigger EADC Source Select Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE10[4]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SSCTL; /*!< [0x0110] BPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] BPWM Synchronous Start Trigger Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE11[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t STATUS; /*!< [0x0120] BPWM Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE12[55]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPINEN; /*!< [0x0200] BPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] BPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] BPWM Capture Status Register */ - BCAPDAT_T CAPDAT[6]; /*!< [0x020C] BPWM Rising and Falling Capture Data Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE13[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPIEN; /*!< [0x0250] BPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] BPWM Capture Interrupt Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE14[43]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t PBUF; /*!< [0x0304] BPWM PERIOD Buffer */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE15[5]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t CMPBUF[6]; /*!< [0x031c] BPWM CMPDAT 0~5 Buffer */ - -} BPWM_T; - -/** - @addtogroup BPWM_CONST BPWM Bit Field Definition - Constant Definitions for BPWM Controller -@{ */ - -#define BPWM_CTL0_CTRLD0_Pos (0) /*!< BPWM_T::CTL0: CTRLD0 Position */ -#define BPWM_CTL0_CTRLD0_Msk (0x1ul << BPWM_CTL0_CTRLD0_Pos) /*!< BPWM_T::CTL0: CTRLD0 Mask */ - -#define BPWM_CTL0_CTRLD1_Pos (1) /*!< BPWM_T::CTL0: CTRLD1 Position */ -#define BPWM_CTL0_CTRLD1_Msk (0x1ul << BPWM_CTL0_CTRLD1_Pos) /*!< BPWM_T::CTL0: CTRLD1 Mask */ - -#define BPWM_CTL0_CTRLD2_Pos (2) /*!< BPWM_T::CTL0: CTRLD2 Position */ -#define BPWM_CTL0_CTRLD2_Msk (0x1ul << BPWM_CTL0_CTRLD2_Pos) /*!< BPWM_T::CTL0: CTRLD2 Mask */ - -#define BPWM_CTL0_CTRLD3_Pos (3) /*!< BPWM_T::CTL0: CTRLD3 Position */ -#define BPWM_CTL0_CTRLD3_Msk (0x1ul << BPWM_CTL0_CTRLD3_Pos) /*!< BPWM_T::CTL0: CTRLD3 Mask */ - -#define BPWM_CTL0_CTRLD4_Pos (4) /*!< BPWM_T::CTL0: CTRLD4 Position */ -#define BPWM_CTL0_CTRLD4_Msk (0x1ul << BPWM_CTL0_CTRLD4_Pos) /*!< BPWM_T::CTL0: CTRLD4 Mask */ - -#define BPWM_CTL0_CTRLD5_Pos (5) /*!< BPWM_T::CTL0: CTRLD5 Position */ -#define BPWM_CTL0_CTRLD5_Msk (0x1ul << BPWM_CTL0_CTRLD5_Pos) /*!< BPWM_T::CTL0: CTRLD5 Mask */ - -#define BPWM_CTL0_IMMLDEN0_Pos (16) /*!< BPWM_T::CTL0: IMMLDEN0 Position */ -#define BPWM_CTL0_IMMLDEN0_Msk (0x1ul << BPWM_CTL0_IMMLDEN0_Pos) /*!< BPWM_T::CTL0: IMMLDEN0 Mask */ - -#define BPWM_CTL0_IMMLDEN1_Pos (17) /*!< BPWM_T::CTL0: IMMLDEN1 Position */ -#define BPWM_CTL0_IMMLDEN1_Msk (0x1ul << BPWM_CTL0_IMMLDEN1_Pos) /*!< BPWM_T::CTL0: IMMLDEN1 Mask */ - -#define BPWM_CTL0_IMMLDEN2_Pos (18) /*!< BPWM_T::CTL0: IMMLDEN2 Position */ -#define BPWM_CTL0_IMMLDEN2_Msk (0x1ul << BPWM_CTL0_IMMLDEN2_Pos) /*!< BPWM_T::CTL0: IMMLDEN2 Mask */ - -#define BPWM_CTL0_IMMLDEN3_Pos (19) /*!< BPWM_T::CTL0: IMMLDEN3 Position */ -#define BPWM_CTL0_IMMLDEN3_Msk (0x1ul << BPWM_CTL0_IMMLDEN3_Pos) /*!< BPWM_T::CTL0: IMMLDEN3 Mask */ - -#define BPWM_CTL0_IMMLDEN4_Pos (20) /*!< BPWM_T::CTL0: IMMLDEN4 Position */ -#define BPWM_CTL0_IMMLDEN4_Msk (0x1ul << BPWM_CTL0_IMMLDEN4_Pos) /*!< BPWM_T::CTL0: IMMLDEN4 Mask */ - -#define BPWM_CTL0_IMMLDEN5_Pos (21) /*!< BPWM_T::CTL0: IMMLDEN5 Position */ -#define BPWM_CTL0_IMMLDEN5_Msk (0x1ul << BPWM_CTL0_IMMLDEN5_Pos) /*!< BPWM_T::CTL0: IMMLDEN5 Mask */ - -#define BPWM_CTL0_DBGHALT_Pos (30) /*!< BPWM_T::CTL0: DBGHALT Position */ -#define BPWM_CTL0_DBGHALT_Msk (0x1ul << BPWM_CTL0_DBGHALT_Pos) /*!< BPWM_T::CTL0: DBGHALT Mask */ - -#define BPWM_CTL0_DBGTRIOFF_Pos (31) /*!< BPWM_T::CTL0: DBGTRIOFF Position */ -#define BPWM_CTL0_DBGTRIOFF_Msk (0x1ul << BPWM_CTL0_DBGTRIOFF_Pos) /*!< BPWM_T::CTL0: DBGTRIOFF Mask */ - -#define BPWM_CTL1_CNTTYPE0_Pos (0) /*!< BPWM_T::CTL1: CNTTYPE0 Position */ -#define BPWM_CTL1_CNTTYPE0_Msk (0x3ul << BPWM_CTL1_CNTTYPE0_Pos) /*!< BPWM_T::CTL1: CNTTYPE0 Mask */ - -#define BPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< BPWM_T::CLKSRC: ECLKSRC0 Position */ -#define BPWM_CLKSRC_ECLKSRC0_Msk (0x7ul << BPWM_CLKSRC_ECLKSRC0_Pos) /*!< BPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define BPWM_CLKPSC_CLKPSC_Pos (0) /*!< BPWM_T::CLKPSC: CLKPSC Position */ -#define BPWM_CLKPSC_CLKPSC_Msk (0xffful << BPWM_CLKPSC_CLKPSC_Pos) /*!< BPWM_T::CLKPSC: CLKPSC Mask */ - -#define BPWM_CNTEN_CNTEN0_Pos (0) /*!< BPWM_T::CNTEN: CNTEN0 Position */ -#define BPWM_CNTEN_CNTEN0_Msk (0x1ul << BPWM_CNTEN_CNTEN0_Pos) /*!< BPWM_T::CNTEN: CNTEN0 Mask */ - -#define BPWM_CNTCLR_CNTCLR0_Pos (0) /*!< BPWM_T::CNTCLR: CNTCLR0 Position */ -#define BPWM_CNTCLR_CNTCLR0_Msk (0x1ul << BPWM_CNTCLR_CNTCLR0_Pos) /*!< BPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define BPWM_PERIOD_PERIOD_Pos (0) /*!< BPWM_T::PERIOD: PERIOD Position */ -#define BPWM_PERIOD_PERIOD_Msk (0xfffful << BPWM_PERIOD_PERIOD_Pos) /*!< BPWM_T::PERIOD: PERIOD Mask */ - -#define BPWM_CMPDAT0_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT0: CMPDAT Position */ -#define BPWM_CMPDAT0_CMPDAT_Msk (0xfffful << BPWM_CMPDAT0_CMPDAT_Pos) /*!< BPWM_T::CMPDAT0: CMPDAT Mask */ - -#define BPWM_CMPDAT1_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT1: CMPDAT Position */ -#define BPWM_CMPDAT1_CMPDAT_Msk (0xfffful << BPWM_CMPDAT1_CMPDAT_Pos) /*!< BPWM_T::CMPDAT1: CMPDAT Mask */ - -#define BPWM_CMPDAT2_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT2: CMPDAT Position */ -#define BPWM_CMPDAT2_CMPDAT_Msk (0xfffful << BPWM_CMPDAT2_CMPDAT_Pos) /*!< BPWM_T::CMPDAT2: CMPDAT Mask */ - -#define BPWM_CMPDAT3_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT3: CMPDAT Position */ -#define BPWM_CMPDAT3_CMPDAT_Msk (0xfffful << BPWM_CMPDAT3_CMPDAT_Pos) /*!< BPWM_T::CMPDAT3: CMPDAT Mask */ - -#define BPWM_CMPDAT4_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT4: CMPDAT Position */ -#define BPWM_CMPDAT4_CMPDAT_Msk (0xfffful << BPWM_CMPDAT4_CMPDAT_Pos) /*!< BPWM_T::CMPDAT4: CMPDAT Mask */ - -#define BPWM_CMPDAT5_CMPDAT_Pos (0) /*!< BPWM_T::CMPDAT5: CMPDAT Position */ -#define BPWM_CMPDAT5_CMPDAT_Msk (0xfffful << BPWM_CMPDAT5_CMPDAT_Pos) /*!< BPWM_T::CMPDAT5: CMPDAT Mask */ - -#define BPWM_CNT_CNT_Pos (0) /*!< BPWM_T::CNT: CNT Position */ -#define BPWM_CNT_CNT_Msk (0xfffful << BPWM_CNT_CNT_Pos) /*!< BPWM_T::CNT: CNT Mask */ - -#define BPWM_CNT_DIRF_Pos (16) /*!< BPWM_T::CNT: DIRF Position */ -#define BPWM_CNT_DIRF_Msk (0x1ul << BPWM_CNT_DIRF_Pos) /*!< BPWM_T::CNT: DIRF Mask */ - -#define BPWM_WGCTL0_ZPCTL0_Pos (0) /*!< BPWM_T::WGCTL0: ZPCTL0 Position */ -#define BPWM_WGCTL0_ZPCTL0_Msk (0x3ul << BPWM_WGCTL0_ZPCTL0_Pos) /*!< BPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define BPWM_WGCTL0_ZPCTL1_Pos (2) /*!< BPWM_T::WGCTL0: ZPCTL1 Position */ -#define BPWM_WGCTL0_ZPCTL1_Msk (0x3ul << BPWM_WGCTL0_ZPCTL1_Pos) /*!< BPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define BPWM_WGCTL0_ZPCTL2_Pos (4) /*!< BPWM_T::WGCTL0: ZPCTL2 Position */ -#define BPWM_WGCTL0_ZPCTL2_Msk (0x3ul << BPWM_WGCTL0_ZPCTL2_Pos) /*!< BPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define BPWM_WGCTL0_ZPCTL3_Pos (6) /*!< BPWM_T::WGCTL0: ZPCTL3 Position */ -#define BPWM_WGCTL0_ZPCTL3_Msk (0x3ul << BPWM_WGCTL0_ZPCTL3_Pos) /*!< BPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define BPWM_WGCTL0_ZPCTL4_Pos (8) /*!< BPWM_T::WGCTL0: ZPCTL4 Position */ -#define BPWM_WGCTL0_ZPCTL4_Msk (0x3ul << BPWM_WGCTL0_ZPCTL4_Pos) /*!< BPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define BPWM_WGCTL0_ZPCTL5_Pos (10) /*!< BPWM_T::WGCTL0: ZPCTL5 Position */ -#define BPWM_WGCTL0_ZPCTL5_Msk (0x3ul << BPWM_WGCTL0_ZPCTL5_Pos) /*!< BPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define BPWM_WGCTL0_ZPCTLn_Pos (0) /*!< BPWM_T::WGCTL0: ZPCTLn Position */ -#define BPWM_WGCTL0_ZPCTLn_Msk (0xffful << BPWM_WGCTL0_ZPCTLn_Pos) /*!< BPWM_T::WGCTL0: ZPCTLn Mask */ - -#define BPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< BPWM_T::WGCTL0: PRDPCTL0 Position */ -#define BPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL0_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define BPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< BPWM_T::WGCTL0: PRDPCTL1 Position */ -#define BPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL1_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define BPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< BPWM_T::WGCTL0: PRDPCTL2 Position */ -#define BPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL2_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define BPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< BPWM_T::WGCTL0: PRDPCTL3 Position */ -#define BPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL3_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define BPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< BPWM_T::WGCTL0: PRDPCTL4 Position */ -#define BPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL4_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define BPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< BPWM_T::WGCTL0: PRDPCTL5 Position */ -#define BPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << BPWM_WGCTL0_PRDPCTL5_Pos) /*!< BPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define BPWM_WGCTL0_PRDPCTLn_Pos (16) /*!< BPWM_T::WGCTL0: PRDPCTLn Position */ -#define BPWM_WGCTL0_PRDPCTLn_Msk (0xffful << BPWM_WGCTL0_PRDPCTLn_Pos) /*!< BPWM_T::WGCTL0: PRDPCTLn Mask */ - -#define BPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< BPWM_T::WGCTL1: CMPUCTL0 Position */ -#define BPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define BPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< BPWM_T::WGCTL1: CMPUCTL1 Position */ -#define BPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define BPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< BPWM_T::WGCTL1: CMPUCTL2 Position */ -#define BPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define BPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< BPWM_T::WGCTL1: CMPUCTL3 Position */ -#define BPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define BPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< BPWM_T::WGCTL1: CMPUCTL4 Position */ -#define BPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define BPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< BPWM_T::WGCTL1: CMPUCTL5 Position */ -#define BPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPUCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define BPWM_WGCTL1_CMPUCTLn_Pos (0) /*!< BPWM_T::WGCTL1: CMPUCTLn Position */ -#define BPWM_WGCTL1_CMPUCTLn_Msk (0xffful << BPWM_WGCTL1_CMPUCTLn_Pos) /*!< BPWM_T::WGCTL1: CMPUCTLn Mask */ - -#define BPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< BPWM_T::WGCTL1: CMPDCTL0 Position */ -#define BPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL0_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define BPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< BPWM_T::WGCTL1: CMPDCTL1 Position */ -#define BPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL1_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define BPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< BPWM_T::WGCTL1: CMPDCTL2 Position */ -#define BPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL2_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define BPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< BPWM_T::WGCTL1: CMPDCTL3 Position */ -#define BPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL3_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define BPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< BPWM_T::WGCTL1: CMPDCTL4 Position */ -#define BPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL4_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define BPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< BPWM_T::WGCTL1: CMPDCTL5 Position */ -#define BPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << BPWM_WGCTL1_CMPDCTL5_Pos) /*!< BPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define BPWM_WGCTL1_CMPDCTLn_Pos (16) /*!< BPWM_T::WGCTL1: CMPDCTLn Position */ -#define BPWM_WGCTL1_CMPDCTLn_Msk (0xffful << BPWM_WGCTL1_CMPDCTLn_Pos) /*!< BPWM_T::WGCTL1: CMPDCTLn Mask */ - -#define BPWM_MSKEN_MSKEN0_Pos (0) /*!< BPWM_T::MSKEN: MSKEN0 Position */ -#define BPWM_MSKEN_MSKEN0_Msk (0x1ul << BPWM_MSKEN_MSKEN0_Pos) /*!< BPWM_T::MSKEN: MSKEN0 Mask */ - -#define BPWM_MSKEN_MSKEN1_Pos (1) /*!< BPWM_T::MSKEN: MSKEN1 Position */ -#define BPWM_MSKEN_MSKEN1_Msk (0x1ul << BPWM_MSKEN_MSKEN1_Pos) /*!< BPWM_T::MSKEN: MSKEN1 Mask */ - -#define BPWM_MSKEN_MSKEN2_Pos (2) /*!< BPWM_T::MSKEN: MSKEN2 Position */ -#define BPWM_MSKEN_MSKEN2_Msk (0x1ul << BPWM_MSKEN_MSKEN2_Pos) /*!< BPWM_T::MSKEN: MSKEN2 Mask */ - -#define BPWM_MSKEN_MSKEN3_Pos (3) /*!< BPWM_T::MSKEN: MSKEN3 Position */ -#define BPWM_MSKEN_MSKEN3_Msk (0x1ul << BPWM_MSKEN_MSKEN3_Pos) /*!< BPWM_T::MSKEN: MSKEN3 Mask */ - -#define BPWM_MSKEN_MSKEN4_Pos (4) /*!< BPWM_T::MSKEN: MSKEN4 Position */ -#define BPWM_MSKEN_MSKEN4_Msk (0x1ul << BPWM_MSKEN_MSKEN4_Pos) /*!< BPWM_T::MSKEN: MSKEN4 Mask */ - -#define BPWM_MSKEN_MSKEN5_Pos (5) /*!< BPWM_T::MSKEN: MSKEN5 Position */ -#define BPWM_MSKEN_MSKEN5_Msk (0x1ul << BPWM_MSKEN_MSKEN5_Pos) /*!< BPWM_T::MSKEN: MSKEN5 Mask */ - -#define BPWM_MSKEN_MSKENn_Pos (0) /*!< BPWM_T::MSKEN: MSKENn Position */ -#define BPWM_MSKEN_MSKENn_Msk (0x3ful << BPWM_MSKEN_MSKENn_Pos) /*!< BPWM_T::MSKEN: MSKENn Mask */ - -#define BPWM_MSK_MSKDAT0_Pos (0) /*!< BPWM_T::MSK: MSKDAT0 Position */ -#define BPWM_MSK_MSKDAT0_Msk (0x1ul << BPWM_MSK_MSKDAT0_Pos) /*!< BPWM_T::MSK: MSKDAT0 Mask */ - -#define BPWM_MSK_MSKDAT1_Pos (1) /*!< BPWM_T::MSK: MSKDAT1 Position */ -#define BPWM_MSK_MSKDAT1_Msk (0x1ul << BPWM_MSK_MSKDAT1_Pos) /*!< BPWM_T::MSK: MSKDAT1 Mask */ - -#define BPWM_MSK_MSKDAT2_Pos (2) /*!< BPWM_T::MSK: MSKDAT2 Position */ -#define BPWM_MSK_MSKDAT2_Msk (0x1ul << BPWM_MSK_MSKDAT2_Pos) /*!< BPWM_T::MSK: MSKDAT2 Mask */ - -#define BPWM_MSK_MSKDAT3_Pos (3) /*!< BPWM_T::MSK: MSKDAT3 Position */ -#define BPWM_MSK_MSKDAT3_Msk (0x1ul << BPWM_MSK_MSKDAT3_Pos) /*!< BPWM_T::MSK: MSKDAT3 Mask */ - -#define BPWM_MSK_MSKDAT4_Pos (4) /*!< BPWM_T::MSK: MSKDAT4 Position */ -#define BPWM_MSK_MSKDAT4_Msk (0x1ul << BPWM_MSK_MSKDAT4_Pos) /*!< BPWM_T::MSK: MSKDAT4 Mask */ - -#define BPWM_MSK_MSKDAT5_Pos (5) /*!< BPWM_T::MSK: MSKDAT5 Position */ -#define BPWM_MSK_MSKDAT5_Msk (0x1ul << BPWM_MSK_MSKDAT5_Pos) /*!< BPWM_T::MSK: MSKDAT5 Mask */ - -#define BPWM_MSK_MSKDATn_Pos (0) /*!< BPWM_T::MSK: MSKDATn Position */ -#define BPWM_MSK_MSKDATn_Msk (0x3ful << BPWM_MSK_MSKDATn_Pos) /*!< BPWM_T::MSK: MSKDATn Mask */ - -#define BPWM_POLCTL_PINV0_Pos (0) /*!< BPWM_T::POLCTL: PINV0 Position */ -#define BPWM_POLCTL_PINV0_Msk (0x1ul << BPWM_POLCTL_PINV0_Pos) /*!< BPWM_T::POLCTL: PINV0 Mask */ - -#define BPWM_POLCTL_PINV1_Pos (1) /*!< BPWM_T::POLCTL: PINV1 Position */ -#define BPWM_POLCTL_PINV1_Msk (0x1ul << BPWM_POLCTL_PINV1_Pos) /*!< BPWM_T::POLCTL: PINV1 Mask */ - -#define BPWM_POLCTL_PINV2_Pos (2) /*!< BPWM_T::POLCTL: PINV2 Position */ -#define BPWM_POLCTL_PINV2_Msk (0x1ul << BPWM_POLCTL_PINV2_Pos) /*!< BPWM_T::POLCTL: PINV2 Mask */ - -#define BPWM_POLCTL_PINV3_Pos (3) /*!< BPWM_T::POLCTL: PINV3 Position */ -#define BPWM_POLCTL_PINV3_Msk (0x1ul << BPWM_POLCTL_PINV3_Pos) /*!< BPWM_T::POLCTL: PINV3 Mask */ - -#define BPWM_POLCTL_PINV4_Pos (4) /*!< BPWM_T::POLCTL: PINV4 Position */ -#define BPWM_POLCTL_PINV4_Msk (0x1ul << BPWM_POLCTL_PINV4_Pos) /*!< BPWM_T::POLCTL: PINV4 Mask */ - -#define BPWM_POLCTL_PINV5_Pos (5) /*!< BPWM_T::POLCTL: PINV5 Position */ -#define BPWM_POLCTL_PINV5_Msk (0x1ul << BPWM_POLCTL_PINV5_Pos) /*!< BPWM_T::POLCTL: PINV5 Mask */ - -#define BPWM_POLCTL_PINVn_Pos (0) /*!< BPWM_T::POLCTL: PINVn Position */ -#define BPWM_POLCTL_PINVn_Msk (0x3ful << BPWM_POLCTL_PINVn_Pos) /*!< BPWM_T::POLCTL: PINVn Mask */ - -#define BPWM_POEN_POEN0_Pos (0) /*!< BPWM_T::POEN: POEN0 Position */ -#define BPWM_POEN_POEN0_Msk (0x1ul << BPWM_POEN_POEN0_Pos) /*!< BPWM_T::POEN: POEN0 Mask */ - -#define BPWM_POEN_POEN1_Pos (1) /*!< BPWM_T::POEN: POEN1 Position */ -#define BPWM_POEN_POEN1_Msk (0x1ul << BPWM_POEN_POEN1_Pos) /*!< BPWM_T::POEN: POEN1 Mask */ - -#define BPWM_POEN_POEN2_Pos (2) /*!< BPWM_T::POEN: POEN2 Position */ -#define BPWM_POEN_POEN2_Msk (0x1ul << BPWM_POEN_POEN2_Pos) /*!< BPWM_T::POEN: POEN2 Mask */ - -#define BPWM_POEN_POEN3_Pos (3) /*!< BPWM_T::POEN: POEN3 Position */ -#define BPWM_POEN_POEN3_Msk (0x1ul << BPWM_POEN_POEN3_Pos) /*!< BPWM_T::POEN: POEN3 Mask */ - -#define BPWM_POEN_POEN4_Pos (4) /*!< BPWM_T::POEN: POEN4 Position */ -#define BPWM_POEN_POEN4_Msk (0x1ul << BPWM_POEN_POEN4_Pos) /*!< BPWM_T::POEN: POEN4 Mask */ - -#define BPWM_POEN_POEN5_Pos (5) /*!< BPWM_T::POEN: POEN5 Position */ -#define BPWM_POEN_POEN5_Msk (0x1ul << BPWM_POEN_POEN5_Pos) /*!< BPWM_T::POEN: POEN5 Mask */ - -#define BPWM_POEN_POENn_Pos (0) /*!< BPWM_T::POEN: POENn Position */ -#define BPWM_POEN_POENn_Msk (0x3ful << BPWM_POEN_POENn_Pos) /*!< BPWM_T::POEN: POENn Mask */ - -#define BPWM_INTEN_ZIEN0_Pos (0) /*!< BPWM_T::INTEN: ZIEN0 Position */ -#define BPWM_INTEN_ZIEN0_Msk (0x1ul << BPWM_INTEN_ZIEN0_Pos) /*!< BPWM_T::INTEN: ZIEN0 Mask */ - -#define BPWM_INTEN_PIEN0_Pos (8) /*!< BPWM_T::INTEN: PIEN0 Position */ -#define BPWM_INTEN_PIEN0_Msk (0x1ul << BPWM_INTEN_PIEN0_Pos) /*!< BPWM_T::INTEN: PIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN0_Pos (16) /*!< BPWM_T::INTEN: CMPUIEN0 Position */ -#define BPWM_INTEN_CMPUIEN0_Msk (0x1ul << BPWM_INTEN_CMPUIEN0_Pos) /*!< BPWM_T::INTEN: CMPUIEN0 Mask */ - -#define BPWM_INTEN_CMPUIEN1_Pos (17) /*!< BPWM_T::INTEN: CMPUIEN1 Position */ -#define BPWM_INTEN_CMPUIEN1_Msk (0x1ul << BPWM_INTEN_CMPUIEN1_Pos) /*!< BPWM_T::INTEN: CMPUIEN1 Mask */ - -#define BPWM_INTEN_CMPUIEN2_Pos (18) /*!< BPWM_T::INTEN: CMPUIEN2 Position */ -#define BPWM_INTEN_CMPUIEN2_Msk (0x1ul << BPWM_INTEN_CMPUIEN2_Pos) /*!< BPWM_T::INTEN: CMPUIEN2 Mask */ - -#define BPWM_INTEN_CMPUIEN3_Pos (19) /*!< BPWM_T::INTEN: CMPUIEN3 Position */ -#define BPWM_INTEN_CMPUIEN3_Msk (0x1ul << BPWM_INTEN_CMPUIEN3_Pos) /*!< BPWM_T::INTEN: CMPUIEN3 Mask */ - -#define BPWM_INTEN_CMPUIEN4_Pos (20) /*!< BPWM_T::INTEN: CMPUIEN4 Position */ -#define BPWM_INTEN_CMPUIEN4_Msk (0x1ul << BPWM_INTEN_CMPUIEN4_Pos) /*!< BPWM_T::INTEN: CMPUIEN4 Mask */ - -#define BPWM_INTEN_CMPUIEN5_Pos (21) /*!< BPWM_T::INTEN: CMPUIEN5 Position */ -#define BPWM_INTEN_CMPUIEN5_Msk (0x1ul << BPWM_INTEN_CMPUIEN5_Pos) /*!< BPWM_T::INTEN: CMPUIEN5 Mask */ - -#define BPWM_INTEN_CMPUIENn_Pos (16) /*!< BPWM_T::INTEN: CMPUIENn Position */ -#define BPWM_INTEN_CMPUIENn_Msk (0x3ful << BPWM_INTEN_CMPUIENn_Pos) /*!< BPWM_T::INTEN: CMPUIENn Mask */ - -#define BPWM_INTEN_CMPDIEN0_Pos (24) /*!< BPWM_T::INTEN: CMPDIEN0 Position */ -#define BPWM_INTEN_CMPDIEN0_Msk (0x1ul << BPWM_INTEN_CMPDIEN0_Pos) /*!< BPWM_T::INTEN: CMPDIEN0 Mask */ - -#define BPWM_INTEN_CMPDIEN1_Pos (25) /*!< BPWM_T::INTEN: CMPDIEN1 Position */ -#define BPWM_INTEN_CMPDIEN1_Msk (0x1ul << BPWM_INTEN_CMPDIEN1_Pos) /*!< BPWM_T::INTEN: CMPDIEN1 Mask */ - -#define BPWM_INTEN_CMPDIEN2_Pos (26) /*!< BPWM_T::INTEN: CMPDIEN2 Position */ -#define BPWM_INTEN_CMPDIEN2_Msk (0x1ul << BPWM_INTEN_CMPDIEN2_Pos) /*!< BPWM_T::INTEN: CMPDIEN2 Mask */ - -#define BPWM_INTEN_CMPDIEN3_Pos (27) /*!< BPWM_T::INTEN: CMPDIEN3 Position */ -#define BPWM_INTEN_CMPDIEN3_Msk (0x1ul << BPWM_INTEN_CMPDIEN3_Pos) /*!< BPWM_T::INTEN: CMPDIEN3 Mask */ - -#define BPWM_INTEN_CMPDIEN4_Pos (28) /*!< BPWM_T::INTEN: CMPDIEN4 Position */ -#define BPWM_INTEN_CMPDIEN4_Msk (0x1ul << BPWM_INTEN_CMPDIEN4_Pos) /*!< BPWM_T::INTEN: CMPDIEN4 Mask */ - -#define BPWM_INTEN_CMPDIEN5_Pos (29) /*!< BPWM_T::INTEN: CMPDIEN5 Position */ -#define BPWM_INTEN_CMPDIEN5_Msk (0x1ul << BPWM_INTEN_CMPDIEN5_Pos) /*!< BPWM_T::INTEN: CMPDIEN5 Mask */ - -#define BPWM_INTEN_CMPDIENn_Pos (24) /*!< BPWM_T::INTEN: CMPDIENn Position */ -#define BPWM_INTEN_CMPDIENn_Msk (0x3ful << BPWM_INTEN_CMPDIENn_Pos) /*!< BPWM_T::INTEN: CMPDIENn Mask */ - -#define BPWM_INTSTS_ZIF0_Pos (0) /*!< BPWM_T::INTSTS: ZIF0 Position */ -#define BPWM_INTSTS_ZIF0_Msk (0x1ul << BPWM_INTSTS_ZIF0_Pos) /*!< BPWM_T::INTSTS: ZIF0 Mask */ - -#define BPWM_INTSTS_PIF0_Pos (8) /*!< BPWM_T::INTSTS: PIF0 Position */ -#define BPWM_INTSTS_PIF0_Msk (0x1ul << BPWM_INTSTS_PIF0_Pos) /*!< BPWM_T::INTSTS: PIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF0_Pos (16) /*!< BPWM_T::INTSTS: CMPUIF0 Position */ -#define BPWM_INTSTS_CMPUIF0_Msk (0x1ul << BPWM_INTSTS_CMPUIF0_Pos) /*!< BPWM_T::INTSTS: CMPUIF0 Mask */ - -#define BPWM_INTSTS_CMPUIF1_Pos (17) /*!< BPWM_T::INTSTS: CMPUIF1 Position */ -#define BPWM_INTSTS_CMPUIF1_Msk (0x1ul << BPWM_INTSTS_CMPUIF1_Pos) /*!< BPWM_T::INTSTS: CMPUIF1 Mask */ - -#define BPWM_INTSTS_CMPUIF2_Pos (18) /*!< BPWM_T::INTSTS: CMPUIF2 Position */ -#define BPWM_INTSTS_CMPUIF2_Msk (0x1ul << BPWM_INTSTS_CMPUIF2_Pos) /*!< BPWM_T::INTSTS: CMPUIF2 Mask */ - -#define BPWM_INTSTS_CMPUIF3_Pos (19) /*!< BPWM_T::INTSTS: CMPUIF3 Position */ -#define BPWM_INTSTS_CMPUIF3_Msk (0x1ul << BPWM_INTSTS_CMPUIF3_Pos) /*!< BPWM_T::INTSTS: CMPUIF3 Mask */ - -#define BPWM_INTSTS_CMPUIF4_Pos (20) /*!< BPWM_T::INTSTS: CMPUIF4 Position */ -#define BPWM_INTSTS_CMPUIF4_Msk (0x1ul << BPWM_INTSTS_CMPUIF4_Pos) /*!< BPWM_T::INTSTS: CMPUIF4 Mask */ - -#define BPWM_INTSTS_CMPUIF5_Pos (21) /*!< BPWM_T::INTSTS: CMPUIF5 Position */ -#define BPWM_INTSTS_CMPUIF5_Msk (0x1ul << BPWM_INTSTS_CMPUIF5_Pos) /*!< BPWM_T::INTSTS: CMPUIF5 Mask */ - -#define BPWM_INTSTS_CMPUIFn_Pos (16) /*!< BPWM_T::INTSTS: CMPUIFn Position */ -#define BPWM_INTSTS_CMPUIFn_Msk (0x3ful << BPWM_INTSTS_CMPUIFn_Pos) /*!< BPWM_T::INTSTS: CMPUIFn Mask */ - -#define BPWM_INTSTS_CMPDIF0_Pos (24) /*!< BPWM_T::INTSTS: CMPDIF0 Position */ -#define BPWM_INTSTS_CMPDIF0_Msk (0x1ul << BPWM_INTSTS_CMPDIF0_Pos) /*!< BPWM_T::INTSTS: CMPDIF0 Mask */ - -#define BPWM_INTSTS_CMPDIF1_Pos (25) /*!< BPWM_T::INTSTS: CMPDIF1 Position */ -#define BPWM_INTSTS_CMPDIF1_Msk (0x1ul << BPWM_INTSTS_CMPDIF1_Pos) /*!< BPWM_T::INTSTS: CMPDIF1 Mask */ - -#define BPWM_INTSTS_CMPDIF2_Pos (26) /*!< BPWM_T::INTSTS: CMPDIF2 Position */ -#define BPWM_INTSTS_CMPDIF2_Msk (0x1ul << BPWM_INTSTS_CMPDIF2_Pos) /*!< BPWM_T::INTSTS: CMPDIF2 Mask */ - -#define BPWM_INTSTS_CMPDIF3_Pos (27) /*!< BPWM_T::INTSTS: CMPDIF3 Position */ -#define BPWM_INTSTS_CMPDIF3_Msk (0x1ul << BPWM_INTSTS_CMPDIF3_Pos) /*!< BPWM_T::INTSTS: CMPDIF3 Mask */ - -#define BPWM_INTSTS_CMPDIF4_Pos (28) /*!< BPWM_T::INTSTS: CMPDIF4 Position */ -#define BPWM_INTSTS_CMPDIF4_Msk (0x1ul << BPWM_INTSTS_CMPDIF4_Pos) /*!< BPWM_T::INTSTS: CMPDIF4 Mask */ - -#define BPWM_INTSTS_CMPDIF5_Pos (29) /*!< BPWM_T::INTSTS: CMPDIF5 Position */ -#define BPWM_INTSTS_CMPDIF5_Msk (0x1ul << BPWM_INTSTS_CMPDIF5_Pos) /*!< BPWM_T::INTSTS: CMPDIF5 Mask */ - -#define BPWM_INTSTS_CMPDIFn_Pos (24) /*!< BPWM_T::INTSTS: CMPDIFn Position */ -#define BPWM_INTSTS_CMPDIFn_Msk (0x3ful << BPWM_INTSTS_CMPDIFn_Pos) /*!< BPWM_T::INTSTS: CMPDIFn Mask */ - -#define BPWM_EADCTS0_TRGSEL0_Pos (0) /*!< BPWM_T::EADCTS0: TRGSEL0 Position */ -#define BPWM_EADCTS0_TRGSEL0_Msk (0xful << BPWM_EADCTS0_TRGSEL0_Pos) /*!< BPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define BPWM_EADCTS0_TRGEN0_Pos (7) /*!< BPWM_T::EADCTS0: TRGEN0 Position */ -#define BPWM_EADCTS0_TRGEN0_Msk (0x1ul << BPWM_EADCTS0_TRGEN0_Pos) /*!< BPWM_T::EADCTS0: TRGEN0 Mask */ - -#define BPWM_EADCTS0_TRGSEL1_Pos (8) /*!< BPWM_T::EADCTS0: TRGSEL1 Position */ -#define BPWM_EADCTS0_TRGSEL1_Msk (0xful << BPWM_EADCTS0_TRGSEL1_Pos) /*!< BPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define BPWM_EADCTS0_TRGEN1_Pos (15) /*!< BPWM_T::EADCTS0: TRGEN1 Position */ -#define BPWM_EADCTS0_TRGEN1_Msk (0x1ul << BPWM_EADCTS0_TRGEN1_Pos) /*!< BPWM_T::EADCTS0: TRGEN1 Mask */ - -#define BPWM_EADCTS0_TRGSEL2_Pos (16) /*!< BPWM_T::EADCTS0: TRGSEL2 Position */ -#define BPWM_EADCTS0_TRGSEL2_Msk (0xful << BPWM_EADCTS0_TRGSEL2_Pos) /*!< BPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define BPWM_EADCTS0_TRGEN2_Pos (23) /*!< BPWM_T::EADCTS0: TRGEN2 Position */ -#define BPWM_EADCTS0_TRGEN2_Msk (0x1ul << BPWM_EADCTS0_TRGEN2_Pos) /*!< BPWM_T::EADCTS0: TRGEN2 Mask */ - -#define BPWM_EADCTS0_TRGSEL3_Pos (24) /*!< BPWM_T::EADCTS0: TRGSEL3 Position */ -#define BPWM_EADCTS0_TRGSEL3_Msk (0xful << BPWM_EADCTS0_TRGSEL3_Pos) /*!< BPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define BPWM_EADCTS0_TRGEN3_Pos (31) /*!< BPWM_T::EADCTS0: TRGEN3 Position */ -#define BPWM_EADCTS0_TRGEN3_Msk (0x1ul << BPWM_EADCTS0_TRGEN3_Pos) /*!< BPWM_T::EADCTS0: TRGEN3 Mask */ - -#define BPWM_EADCTS1_TRGSEL4_Pos (0) /*!< BPWM_T::EADCTS1: TRGSEL4 Position */ -#define BPWM_EADCTS1_TRGSEL4_Msk (0xful << BPWM_EADCTS1_TRGSEL4_Pos) /*!< BPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define BPWM_EADCTS1_TRGEN4_Pos (7) /*!< BPWM_T::EADCTS1: TRGEN4 Position */ -#define BPWM_EADCTS1_TRGEN4_Msk (0x1ul << BPWM_EADCTS1_TRGEN4_Pos) /*!< BPWM_T::EADCTS1: TRGEN4 Mask */ - -#define BPWM_EADCTS1_TRGSEL5_Pos (8) /*!< BPWM_T::EADCTS1: TRGSEL5 Position */ -#define BPWM_EADCTS1_TRGSEL5_Msk (0xful << BPWM_EADCTS1_TRGSEL5_Pos) /*!< BPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define BPWM_EADCTS1_TRGEN5_Pos (15) /*!< BPWM_T::EADCTS1: TRGEN5 Position */ -#define BPWM_EADCTS1_TRGEN5_Msk (0x1ul << BPWM_EADCTS1_TRGEN5_Pos) /*!< BPWM_T::EADCTS1: TRGEN5 Mask */ - -#define BPWM_SSCTL_SSEN0_Pos (0) /*!< BPWM_T::SSCTL: SSEN0 Position */ -#define BPWM_SSCTL_SSEN0_Msk (0x1ul << BPWM_SSCTL_SSEN0_Pos) /*!< BPWM_T::SSCTL: SSEN0 Mask */ - -#define BPWM_SSCTL_SSRC_Pos (8) /*!< BPWM_T::SSCTL: SSRC Position */ -#define BPWM_SSCTL_SSRC_Msk (0x3ul << BPWM_SSCTL_SSRC_Pos) /*!< BPWM_T::SSCTL: SSRC Mask */ - -#define BPWM_SSTRG_CNTSEN_Pos (0) /*!< BPWM_T::SSTRG: CNTSEN Position */ -#define BPWM_SSTRG_CNTSEN_Msk (0x1ul << BPWM_SSTRG_CNTSEN_Pos) /*!< BPWM_T::SSTRG: CNTSEN Mask */ - -#define BPWM_STATUS_CNTMAX0_Pos (0) /*!< BPWM_T::STATUS: CNTMAX0 Position */ -#define BPWM_STATUS_CNTMAX0_Msk (0x1ul << BPWM_STATUS_CNTMAX0_Pos) /*!< BPWM_T::STATUS: CNTMAX0 Mask */ - -#define BPWM_STATUS_EADCTRG0_Pos (16) /*!< BPWM_T::STATUS: EADCTRG0 Position */ -#define BPWM_STATUS_EADCTRG0_Msk (0x1ul << BPWM_STATUS_EADCTRG0_Pos) /*!< BPWM_T::STATUS: EADCTRG0 Mask */ - -#define BPWM_STATUS_EADCTRG1_Pos (17) /*!< BPWM_T::STATUS: EADCTRG1 Position */ -#define BPWM_STATUS_EADCTRG1_Msk (0x1ul << BPWM_STATUS_EADCTRG1_Pos) /*!< BPWM_T::STATUS: EADCTRG1 Mask */ - -#define BPWM_STATUS_EADCTRG2_Pos (18) /*!< BPWM_T::STATUS: EADCTRG2 Position */ -#define BPWM_STATUS_EADCTRG2_Msk (0x1ul << BPWM_STATUS_EADCTRG2_Pos) /*!< BPWM_T::STATUS: EADCTRG2 Mask */ - -#define BPWM_STATUS_EADCTRG3_Pos (19) /*!< BPWM_T::STATUS: EADCTRG3 Position */ -#define BPWM_STATUS_EADCTRG3_Msk (0x1ul << BPWM_STATUS_EADCTRG3_Pos) /*!< BPWM_T::STATUS: EADCTRG3 Mask */ - -#define BPWM_STATUS_EADCTRG4_Pos (20) /*!< BPWM_T::STATUS: EADCTRG4 Position */ -#define BPWM_STATUS_EADCTRG4_Msk (0x1ul << BPWM_STATUS_EADCTRG4_Pos) /*!< BPWM_T::STATUS: EADCTRG4 Mask */ - -#define BPWM_STATUS_EADCTRG5_Pos (21) /*!< BPWM_T::STATUS: EADCTRG5 Position */ -#define BPWM_STATUS_EADCTRG5_Msk (0x1ul << BPWM_STATUS_EADCTRG5_Pos) /*!< BPWM_T::STATUS: EADCTRG5 Mask */ - -#define BPWM_STATUS_EADCTRGn_Pos (16) /*!< BPWM_T::STATUS: EADCTRGn Position */ -#define BPWM_STATUS_EADCTRGn_Msk (0x3ful << BPWM_STATUS_EADCTRGn_Pos) /*!< BPWM_T::STATUS: EADCTRGn Mask */ - -#define BPWM_CAPINEN_CAPINEN0_Pos (0) /*!< BPWM_T::CAPINEN: CAPINEN0 Position */ -#define BPWM_CAPINEN_CAPINEN0_Msk (0x1ul << BPWM_CAPINEN_CAPINEN0_Pos) /*!< BPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define BPWM_CAPINEN_CAPINEN1_Pos (1) /*!< BPWM_T::CAPINEN: CAPINEN1 Position */ -#define BPWM_CAPINEN_CAPINEN1_Msk (0x1ul << BPWM_CAPINEN_CAPINEN1_Pos) /*!< BPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define BPWM_CAPINEN_CAPINEN2_Pos (2) /*!< BPWM_T::CAPINEN: CAPINEN2 Position */ -#define BPWM_CAPINEN_CAPINEN2_Msk (0x1ul << BPWM_CAPINEN_CAPINEN2_Pos) /*!< BPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define BPWM_CAPINEN_CAPINEN3_Pos (3) /*!< BPWM_T::CAPINEN: CAPINEN3 Position */ -#define BPWM_CAPINEN_CAPINEN3_Msk (0x1ul << BPWM_CAPINEN_CAPINEN3_Pos) /*!< BPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define BPWM_CAPINEN_CAPINEN4_Pos (4) /*!< BPWM_T::CAPINEN: CAPINEN4 Position */ -#define BPWM_CAPINEN_CAPINEN4_Msk (0x1ul << BPWM_CAPINEN_CAPINEN4_Pos) /*!< BPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define BPWM_CAPINEN_CAPINEN5_Pos (5) /*!< BPWM_T::CAPINEN: CAPINEN5 Position */ -#define BPWM_CAPINEN_CAPINEN5_Msk (0x1ul << BPWM_CAPINEN_CAPINEN5_Pos) /*!< BPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define BPWM_CAPINEN_CAPINENn_Pos (0) /*!< BPWM_T::CAPINEN: CAPINENn Position */ -#define BPWM_CAPINEN_CAPINENn_Msk (0x3ful << BPWM_CAPINEN_CAPINENn_Pos) /*!< BPWM_T::CAPINEN: CAPINENn Mask */ - -#define BPWM_CAPCTL_CAPEN0_Pos (0) /*!< BPWM_T::CAPCTL: CAPEN0 Position */ -#define BPWM_CAPCTL_CAPEN0_Msk (0x1ul << BPWM_CAPCTL_CAPEN0_Pos) /*!< BPWM_T::CAPCTL: CAPEN0 Mask */ - -#define BPWM_CAPCTL_CAPEN1_Pos (1) /*!< BPWM_T::CAPCTL: CAPEN1 Position */ -#define BPWM_CAPCTL_CAPEN1_Msk (0x1ul << BPWM_CAPCTL_CAPEN1_Pos) /*!< BPWM_T::CAPCTL: CAPEN1 Mask */ - -#define BPWM_CAPCTL_CAPEN2_Pos (2) /*!< BPWM_T::CAPCTL: CAPEN2 Position */ -#define BPWM_CAPCTL_CAPEN2_Msk (0x1ul << BPWM_CAPCTL_CAPEN2_Pos) /*!< BPWM_T::CAPCTL: CAPEN2 Mask */ - -#define BPWM_CAPCTL_CAPEN3_Pos (3) /*!< BPWM_T::CAPCTL: CAPEN3 Position */ -#define BPWM_CAPCTL_CAPEN3_Msk (0x1ul << BPWM_CAPCTL_CAPEN3_Pos) /*!< BPWM_T::CAPCTL: CAPEN3 Mask */ - -#define BPWM_CAPCTL_CAPEN4_Pos (4) /*!< BPWM_T::CAPCTL: CAPEN4 Position */ -#define BPWM_CAPCTL_CAPEN4_Msk (0x1ul << BPWM_CAPCTL_CAPEN4_Pos) /*!< BPWM_T::CAPCTL: CAPEN4 Mask */ - -#define BPWM_CAPCTL_CAPEN5_Pos (5) /*!< BPWM_T::CAPCTL: CAPEN5 Position */ -#define BPWM_CAPCTL_CAPEN5_Msk (0x1ul << BPWM_CAPCTL_CAPEN5_Pos) /*!< BPWM_T::CAPCTL: CAPEN5 Mask */ - -#define BPWM_CAPCTL_CAPENn_Pos (0) /*!< BPWM_T::CAPCTL: CAPENn Position */ -#define BPWM_CAPCTL_CAPENn_Msk (0x3ful << BPWM_CAPCTL_CAPENn_Pos) /*!< BPWM_T::CAPCTL: CAPENn Mask */ - -#define BPWM_CAPCTL_CAPINV0_Pos (8) /*!< BPWM_T::CAPCTL: CAPINV0 Position */ -#define BPWM_CAPCTL_CAPINV0_Msk (0x1ul << BPWM_CAPCTL_CAPINV0_Pos) /*!< BPWM_T::CAPCTL: CAPINV0 Mask */ - -#define BPWM_CAPCTL_CAPINV1_Pos (9) /*!< BPWM_T::CAPCTL: CAPINV1 Position */ -#define BPWM_CAPCTL_CAPINV1_Msk (0x1ul << BPWM_CAPCTL_CAPINV1_Pos) /*!< BPWM_T::CAPCTL: CAPINV1 Mask */ - -#define BPWM_CAPCTL_CAPINV2_Pos (10) /*!< BPWM_T::CAPCTL: CAPINV2 Position */ -#define BPWM_CAPCTL_CAPINV2_Msk (0x1ul << BPWM_CAPCTL_CAPINV2_Pos) /*!< BPWM_T::CAPCTL: CAPINV2 Mask */ - -#define BPWM_CAPCTL_CAPINV3_Pos (11) /*!< BPWM_T::CAPCTL: CAPINV3 Position */ -#define BPWM_CAPCTL_CAPINV3_Msk (0x1ul << BPWM_CAPCTL_CAPINV3_Pos) /*!< BPWM_T::CAPCTL: CAPINV3 Mask */ - -#define BPWM_CAPCTL_CAPINV4_Pos (12) /*!< BPWM_T::CAPCTL: CAPINV4 Position */ -#define BPWM_CAPCTL_CAPINV4_Msk (0x1ul << BPWM_CAPCTL_CAPINV4_Pos) /*!< BPWM_T::CAPCTL: CAPINV4 Mask */ - -#define BPWM_CAPCTL_CAPINV5_Pos (13) /*!< BPWM_T::CAPCTL: CAPINV5 Position */ -#define BPWM_CAPCTL_CAPINV5_Msk (0x1ul << BPWM_CAPCTL_CAPINV5_Pos) /*!< BPWM_T::CAPCTL: CAPINV5 Mask */ - -#define BPWM_CAPCTL_CAPINVn_Pos (8) /*!< BPWM_T::CAPCTL: CAPINVn Position */ -#define BPWM_CAPCTL_CAPINVn_Msk (0x3ful << BPWM_CAPCTL_CAPINVn_Pos) /*!< BPWM_T::CAPCTL: CAPINVn Mask */ - -#define BPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< BPWM_T::CAPCTL: RCRLDEN0 Position */ -#define BPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define BPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< BPWM_T::CAPCTL: RCRLDEN1 Position */ -#define BPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define BPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< BPWM_T::CAPCTL: RCRLDEN2 Position */ -#define BPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define BPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< BPWM_T::CAPCTL: RCRLDEN3 Position */ -#define BPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define BPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< BPWM_T::CAPCTL: RCRLDEN4 Position */ -#define BPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define BPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< BPWM_T::CAPCTL: RCRLDEN5 Position */ -#define BPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_RCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define BPWM_CAPCTL_RCRLDENn_Pos (16) /*!< BPWM_T::CAPCTL: RCRLDENn Position */ -#define BPWM_CAPCTL_RCRLDENn_Msk (0x3ful << BPWM_CAPCTL_RCRLDENn_Pos) /*!< BPWM_T::CAPCTL: RCRLDENn Mask */ - -#define BPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< BPWM_T::CAPCTL: FCRLDEN0 Position */ -#define BPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN0_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define BPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< BPWM_T::CAPCTL: FCRLDEN1 Position */ -#define BPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN1_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define BPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< BPWM_T::CAPCTL: FCRLDEN2 Position */ -#define BPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN2_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define BPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< BPWM_T::CAPCTL: FCRLDEN3 Position */ -#define BPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN3_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define BPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< BPWM_T::CAPCTL: FCRLDEN4 Position */ -#define BPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN4_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define BPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< BPWM_T::CAPCTL: FCRLDEN5 Position */ -#define BPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << BPWM_CAPCTL_FCRLDEN5_Pos) /*!< BPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define BPWM_CAPCTL_FCRLDENn_Pos (24) /*!< BPWM_T::CAPCTL: FCRLDENn Position */ -#define BPWM_CAPCTL_FCRLDENn_Msk (0x3ful << BPWM_CAPCTL_FCRLDENn_Pos) /*!< BPWM_T::CAPCTL: FCRLDENn Mask */ - -#define BPWM_CAPSTS_CRIFOV0_Pos (0) /*!< BPWM_T::CAPSTS: CRIFOV0 Position */ -#define BPWM_CAPSTS_CRIFOV0_Msk (0x1ul << BPWM_CAPSTS_CRIFOV0_Pos) /*!< BPWM_T::CAPSTS: CRIFOV0 Mask */ - -#define BPWM_CAPSTS_CRIFOV1_Pos (1) /*!< BPWM_T::CAPSTS: CRIFOV1 Position */ -#define BPWM_CAPSTS_CRIFOV1_Msk (0x1ul << BPWM_CAPSTS_CRIFOV1_Pos) /*!< BPWM_T::CAPSTS: CRIFOV1 Mask */ - -#define BPWM_CAPSTS_CRIFOV2_Pos (2) /*!< BPWM_T::CAPSTS: CRIFOV2 Position */ -#define BPWM_CAPSTS_CRIFOV2_Msk (0x1ul << BPWM_CAPSTS_CRIFOV2_Pos) /*!< BPWM_T::CAPSTS: CRIFOV2 Mask */ - -#define BPWM_CAPSTS_CRIFOV3_Pos (3) /*!< BPWM_T::CAPSTS: CRIFOV3 Position */ -#define BPWM_CAPSTS_CRIFOV3_Msk (0x1ul << BPWM_CAPSTS_CRIFOV3_Pos) /*!< BPWM_T::CAPSTS: CRIFOV3 Mask */ - -#define BPWM_CAPSTS_CRIFOV4_Pos (4) /*!< BPWM_T::CAPSTS: CRIFOV4 Position */ -#define BPWM_CAPSTS_CRIFOV4_Msk (0x1ul << BPWM_CAPSTS_CRIFOV4_Pos) /*!< BPWM_T::CAPSTS: CRIFOV4 Mask */ - -#define BPWM_CAPSTS_CRIFOV5_Pos (5) /*!< BPWM_T::CAPSTS: CRIFOV5 Position */ -#define BPWM_CAPSTS_CRIFOV5_Msk (0x1ul << BPWM_CAPSTS_CRIFOV5_Pos) /*!< BPWM_T::CAPSTS: CRIFOV5 Mask */ - -#define BPWM_CAPSTS_CRIFOVn_Pos (0) /*!< BPWM_T::CAPSTS: CRIFOVn Position */ -#define BPWM_CAPSTS_CRIFOVn_Msk (0x3ful << BPWM_CAPSTS_CRIFOVn_Pos) /*!< BPWM_T::CAPSTS: CRIFOVn Mask */ - -#define BPWM_CAPSTS_CFIFOV0_Pos (8) /*!< BPWM_T::CAPSTS: CFIFOV0 Position */ -#define BPWM_CAPSTS_CFIFOV0_Msk (0x1ul << BPWM_CAPSTS_CFIFOV0_Pos) /*!< BPWM_T::CAPSTS: CFIFOV0 Mask */ - -#define BPWM_CAPSTS_CFIFOV1_Pos (9) /*!< BPWM_T::CAPSTS: CFIFOV1 Position */ -#define BPWM_CAPSTS_CFIFOV1_Msk (0x1ul << BPWM_CAPSTS_CFIFOV1_Pos) /*!< BPWM_T::CAPSTS: CFIFOV1 Mask */ - -#define BPWM_CAPSTS_CFIFOV2_Pos (10) /*!< BPWM_T::CAPSTS: CFIFOV2 Position */ -#define BPWM_CAPSTS_CFIFOV2_Msk (0x1ul << BPWM_CAPSTS_CFIFOV2_Pos) /*!< BPWM_T::CAPSTS: CFIFOV2 Mask */ - -#define BPWM_CAPSTS_CFIFOV3_Pos (11) /*!< BPWM_T::CAPSTS: CFIFOV3 Position */ -#define BPWM_CAPSTS_CFIFOV3_Msk (0x1ul << BPWM_CAPSTS_CFIFOV3_Pos) /*!< BPWM_T::CAPSTS: CFIFOV3 Mask */ - -#define BPWM_CAPSTS_CFIFOV4_Pos (12) /*!< BPWM_T::CAPSTS: CFIFOV4 Position */ -#define BPWM_CAPSTS_CFIFOV4_Msk (0x1ul << BPWM_CAPSTS_CFIFOV4_Pos) /*!< BPWM_T::CAPSTS: CFIFOV4 Mask */ - -#define BPWM_CAPSTS_CFIFOV5_Pos (13) /*!< BPWM_T::CAPSTS: CFIFOV5 Position */ -#define BPWM_CAPSTS_CFIFOV5_Msk (0x1ul << BPWM_CAPSTS_CFIFOV5_Pos) /*!< BPWM_T::CAPSTS: CFIFOV5 Mask */ - -#define BPWM_CAPSTS_CFIFOVn_Pos (8) /*!< BPWM_T::CAPSTS: CFIFOVn Position */ -#define BPWM_CAPSTS_CFIFOVn_Msk (0x3ful << BPWM_CAPSTS_CFIFOVn_Pos) /*!< BPWM_T::CAPSTS: CFIFOVn Mask */ - -#define BPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT0: RCAPDAT Position */ -#define BPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT0_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define BPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT0: FCAPDAT Position */ -#define BPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT0_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define BPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT1: RCAPDAT Position */ -#define BPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT1_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define BPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT1: FCAPDAT Position */ -#define BPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT1_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define BPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT2: RCAPDAT Position */ -#define BPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT2_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define BPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT2: FCAPDAT Position */ -#define BPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT2_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define BPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT3: RCAPDAT Position */ -#define BPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT3_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define BPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT3: FCAPDAT Position */ -#define BPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT3_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define BPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT4: RCAPDAT Position */ -#define BPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT4_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define BPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT4: FCAPDAT Position */ -#define BPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT4_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define BPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< BPWM_T::RCAPDAT5: RCAPDAT Position */ -#define BPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << BPWM_RCAPDAT5_RCAPDAT_Pos) /*!< BPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define BPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< BPWM_T::FCAPDAT5: FCAPDAT Position */ -#define BPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << BPWM_FCAPDAT5_FCAPDAT_Pos) /*!< BPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define BPWM_CAPIEN_CAPRIENn_Pos (0) /*!< BPWM_T::CAPIEN: CAPRIENn Position */ -#define BPWM_CAPIEN_CAPRIENn_Msk (0x3ful << BPWM_CAPIEN_CAPRIENn_Pos) /*!< BPWM_T::CAPIEN: CAPRIENn Mask */ - -#define BPWM_CAPIEN_CAPFIENn_Pos (8) /*!< BPWM_T::CAPIEN: CAPFIENn Position */ -#define BPWM_CAPIEN_CAPFIENn_Msk (0x3ful << BPWM_CAPIEN_CAPFIENn_Pos) /*!< BPWM_T::CAPIEN: CAPFIENn Mask */ - -#define BPWM_CAPIF_CAPRIF0_Pos (0) /*!< BPWM_T::CAPIF: CAPRIF0 Position */ -#define BPWM_CAPIF_CAPRIF0_Msk (0x1ul << BPWM_CAPIF_CAPRIF0_Pos) /*!< BPWM_T::CAPIF: CAPRIF0 Mask */ - -#define BPWM_CAPIF_CAPRIF1_Pos (1) /*!< BPWM_T::CAPIF: CAPRIF1 Position */ -#define BPWM_CAPIF_CAPRIF1_Msk (0x1ul << BPWM_CAPIF_CAPRIF1_Pos) /*!< BPWM_T::CAPIF: CAPRIF1 Mask */ - -#define BPWM_CAPIF_CAPRIF2_Pos (2) /*!< BPWM_T::CAPIF: CAPRIF2 Position */ -#define BPWM_CAPIF_CAPRIF2_Msk (0x1ul << BPWM_CAPIF_CAPRIF2_Pos) /*!< BPWM_T::CAPIF: CAPRIF2 Mask */ - -#define BPWM_CAPIF_CAPRIF3_Pos (3) /*!< BPWM_T::CAPIF: CAPRIF3 Position */ -#define BPWM_CAPIF_CAPRIF3_Msk (0x1ul << BPWM_CAPIF_CAPRIF3_Pos) /*!< BPWM_T::CAPIF: CAPRIF3 Mask */ - -#define BPWM_CAPIF_CAPRIF4_Pos (4) /*!< BPWM_T::CAPIF: CAPRIF4 Position */ -#define BPWM_CAPIF_CAPRIF4_Msk (0x1ul << BPWM_CAPIF_CAPRIF4_Pos) /*!< BPWM_T::CAPIF: CAPRIF4 Mask */ - -#define BPWM_CAPIF_CAPRIF5_Pos (5) /*!< BPWM_T::CAPIF: CAPRIF5 Position */ -#define BPWM_CAPIF_CAPRIF5_Msk (0x1ul << BPWM_CAPIF_CAPRIF5_Pos) /*!< BPWM_T::CAPIF: CAPRIF5 Mask */ - -#define BPWM_CAPIF_CAPRIFn_Pos (0) /*!< BPWM_T::CAPIF: CAPRIFn Position */ -#define BPWM_CAPIF_CAPRIFn_Msk (0x3ful << BPWM_CAPIF_CAPRIFn_Pos) /*!< BPWM_T::CAPIF: CAPRIFn Mask */ - -#define BPWM_CAPIF_CAPFIF0_Pos (8) /*!< BPWM_T::CAPIF: CAPFIF0 Position */ -#define BPWM_CAPIF_CAPFIF0_Msk (0x1ul << BPWM_CAPIF_CAPFIF0_Pos) /*!< BPWM_T::CAPIF: CAPFIF0 Mask */ - -#define BPWM_CAPIF_CAPFIF1_Pos (9) /*!< BPWM_T::CAPIF: CAPFIF1 Position */ -#define BPWM_CAPIF_CAPFIF1_Msk (0x1ul << BPWM_CAPIF_CAPFIF1_Pos) /*!< BPWM_T::CAPIF: CAPFIF1 Mask */ - -#define BPWM_CAPIF_CAPFIF2_Pos (10) /*!< BPWM_T::CAPIF: CAPFIF2 Position */ -#define BPWM_CAPIF_CAPFIF2_Msk (0x1ul << BPWM_CAPIF_CAPFIF2_Pos) /*!< BPWM_T::CAPIF: CAPFIF2 Mask */ - -#define BPWM_CAPIF_CAPFIF3_Pos (11) /*!< BPWM_T::CAPIF: CAPFIF3 Position */ -#define BPWM_CAPIF_CAPFIF3_Msk (0x1ul << BPWM_CAPIF_CAPFIF3_Pos) /*!< BPWM_T::CAPIF: CAPFIF3 Mask */ - -#define BPWM_CAPIF_CAPFIF4_Pos (12) /*!< BPWM_T::CAPIF: CAPFIF4 Position */ -#define BPWM_CAPIF_CAPFIF4_Msk (0x1ul << BPWM_CAPIF_CAPFIF4_Pos) /*!< BPWM_T::CAPIF: CAPFIF4 Mask */ - -#define BPWM_CAPIF_CAPFIF5_Pos (13) /*!< BPWM_T::CAPIF: CAPFIF5 Position */ -#define BPWM_CAPIF_CAPFIF5_Msk (0x1ul << BPWM_CAPIF_CAPFIF5_Pos) /*!< BPWM_T::CAPIF: CAPFIF5 Mask */ - -#define BPWM_CAPIF_CAPFIFn_Pos (8) /*!< BPWM_T::CAPIF: CAPFIFn Position */ -#define BPWM_CAPIF_CAPFIFn_Msk (0x3ful << BPWM_CAPIF_CAPFIFn_Pos) /*!< BPWM_T::CAPIF: CAPFIFn Mask */ - -#define BPWM_PBUF_PBUF_Pos (0) /*!< BPWM_T::PBUF: PBUF Position */ -#define BPWM_PBUF_PBUF_Msk (0xfffful << BPWM_PBUF_PBUF_Pos) /*!< BPWM_T::PBUF: PBUF Mask */ - -#define BPWM_CMPBUF0_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF0: CMPBUF Position */ -#define BPWM_CMPBUF0_CMPBUF_Msk (0xfffful << BPWM_CMPBUF0_CMPBUF_Pos) /*!< BPWM_T::CMPBUF0: CMPBUF Mask */ - -#define BPWM_CMPBUF1_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF1: CMPBUF Position */ -#define BPWM_CMPBUF1_CMPBUF_Msk (0xfffful << BPWM_CMPBUF1_CMPBUF_Pos) /*!< BPWM_T::CMPBUF1: CMPBUF Mask */ - -#define BPWM_CMPBUF2_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF2: CMPBUF Position */ -#define BPWM_CMPBUF2_CMPBUF_Msk (0xfffful << BPWM_CMPBUF2_CMPBUF_Pos) /*!< BPWM_T::CMPBUF2: CMPBUF Mask */ - -#define BPWM_CMPBUF3_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF3: CMPBUF Position */ -#define BPWM_CMPBUF3_CMPBUF_Msk (0xfffful << BPWM_CMPBUF3_CMPBUF_Pos) /*!< BPWM_T::CMPBUF3: CMPBUF Mask */ - -#define BPWM_CMPBUF4_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF4: CMPBUF Position */ -#define BPWM_CMPBUF4_CMPBUF_Msk (0xfffful << BPWM_CMPBUF4_CMPBUF_Pos) /*!< BPWM_T::CMPBUF4: CMPBUF Mask */ - -#define BPWM_CMPBUF5_CMPBUF_Pos (0) /*!< BPWM_T::CMPBUF5: CMPBUF Position */ -#define BPWM_CMPBUF5_CMPBUF_Msk (0xfffful << BPWM_CMPBUF5_CMPBUF_Pos) /*!< BPWM_T::CMPBUF5: CMPBUF Mask */ - -/**@}*/ /* BPWM_CONST */ -/**@}*/ /* end of BPWM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __BPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/can_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/can_reg.h deleted file mode 100644 index b0152f8011e..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/can_reg.h +++ /dev/null @@ -1,759 +0,0 @@ -/**************************************************************************//** - * @file can_reg.h - * @version V1.00 - * @brief CAN register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CAN_REG_H__ -#define __CAN_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CAN Controller Area Network Controller(CAN) - Memory Mapped Structure for CAN Controller -@{ */ - - -typedef struct -{ - - /** - * @var CAN_IF_T::CREQ - * Offset: 0x20, 0x80 IFn Command Request Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |MessageNumber|Message Number - * | | |0x01-0x20: Valid Message Number, the Message Object in the Message - * | | |RAM is selected for data transfer. - * | | |0x00: Not a valid Message Number, interpreted as 0x20. - * | | |0x21-0x3F: Not a valid Message Number, interpreted as 0x01-0x1F. - * |[15] |Busy |Busy Flag - * | | |0 = Read/write action has finished. - * | | |1 = Writing to the IFn Command Request Register is in progress - * | | |This bit can only be read by the software. - * @var CAN_IF_T::CMASK - * Offset: 0x24, 0x84 IFn Command Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DAT_B |Access Data Bytes [7:4] - * | | |Write Operation: - * | | |0 = Data Bytes [7:4] unchanged. - * | | |1 = Transfer Data Bytes [7:4] to Message Object. - * | | |Read Operation: - * | | |0 = Data Bytes [7:4] unchanged. - * | | |1 = Transfer Data Bytes [7:4] to IFn Message Buffer Register. - * |[1] |DAT_A |Access Data Bytes [3:0] - * | | |Write Operation: - * | | |0 = Data Bytes [3:0] unchanged. - * | | |1 = Transfer Data Bytes [3:0] to Message Object. - * | | |Read Operation: - * | | |0 = Data Bytes [3:0] unchanged. - * | | |1 = Transfer Data Bytes [3:0] to IFn Message Buffer Register. - * |[2] |TxRqst_NewDat|Access Transmission Request Bit When Write Operation - * | | |0 = TxRqst bit unchanged. - * | | |1 = Set TxRqst bit. - * | | |Note: If a transmission is requested by programming bit TxRqst/NewDat in the IFn Command Mask Register, bit TxRqst in the IFn Message Control Register will be ignored. - * | | |Access New Data Bit when Read Operation. - * | | |0 = NewDat bit remains unchanged. - * | | |1 = Clear NewDat bit in the Message Object. - * | | |Note: A read access to a Message Object can be combined with the reset of the control bits IntPnd and NewDat - * | | |The values of these bits transferred to the IFn Message Control Register always reflect the status before resetting these bits. - * |[3] |ClrIntPnd |Clear Interrupt Pending Bit - * | | |Write Operation: - * | | |When writing to a Message Object, this bit is ignored. - * | | |Read Operation: - * | | |0 = IntPnd bit (CAN_IFn_MCON[13]) remains unchanged. - * | | |1 = Clear IntPnd bit in the Message Object. - * |[4] |Control |Control Access Control Bits - * | | |Write Operation: - * | | |0 = Control Bits unchanged. - * | | |1 = Transfer Control Bits to Message Object. - * | | |Read Operation: - * | | |0 = Control Bits unchanged. - * | | |1 = Transfer Control Bits to IFn Message Buffer Register. - * |[5] |Arb |Access Arbitration Bits - * | | |Write Operation: - * | | |0 = Arbitration bits unchanged. - * | | |1 = Transfer Identifier + Dir (CAN_IFn_ARB2[13]) + Xtd (CAN_IFn_ARB2[14]) + MsgVal (CAN_IFn_ARB2[15]) to Message Object. - * | | |Read Operation: - * | | |0 = Arbitration bits unchanged. - * | | |1 = Transfer Identifier + Dir + Xtd + MsgVal to IFn Message Buffer Register. - * |[6] |Mask |Access Mask Bits - * | | |Write Operation: - * | | |0 = Mask bits unchanged. - * | | |1 = Transfer Identifier Mask + MDir + MXtd to Message Object. - * | | |Read Operation: - * | | |0 = Mask bits unchanged. - * | | |1 = Transfer Identifier Mask + MDir + MXtd to IFn Message Buffer Register. - * |[7] |WR_RD |Write / Read Mode - * | | |0 = Read: Transfer data from the Message Object addressed by the Command Request Register into the selected Message Buffer Registers. - * | | |1 = Write: Transfer data from the selected Message Buffer Registers to the Message Object addressed by the Command Request Register. - * @var CAN_IF_T::MASK1 - * Offset: 0x28, 0x88 IFn Mask 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |Msk |Identifier Mask 15-0 - * | | |0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering. - * | | |1 = The corresponding identifier bit is used for acceptance filtering. - * @var CAN_IF_T::MASK2 - * Offset: 0x2C, 0x8C IFn Mask 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |Msk |Identifier Mask 28-16 - * | | |0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering. - * | | |1 = The corresponding identifier bit is used for acceptance filtering. - * |[14] |MDir |Mask Message Direction - * | | |0 = The message direction bit (Dir (CAN_IFn_ARB2[13])) has no effect on the acceptance filtering. - * | | |1 = The message direction bit (Dir) is used for acceptance filtering. - * |[15] |MXtd |Mask Extended Identifier - * | | |0 = The extended identifier bit (IDE) has no effect on the acceptance filtering. - * | | |1 = The extended identifier bit (IDE) is used for acceptance filtering. - * | | |Note: When 11-bit (standard) Identifiers are used for a Message Object, the identifiers of received Data Frames are written into bits ID28 to ID18 (CAN_IFn_ARB2[12:2]) - * | | |For acceptance filtering, only these bits together with mask bits Msk28 to Msk18 (CAN_IFn_MASK2[12:2]) are considered. - * @var CAN_IF_T::ARB1 - * Offset: 0x30, 0x90 IFn Arbitration 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ID |Message Identifier 15-0 - * | | |ID28 - ID0, 29-bit Identifier (Extended Frame) - * | | |ID28 - ID18, 11-bit Identifier (Standard Frame) - * @var CAN_IF_T::ARB2 - * Offset: 0x34, 0x94 IFn Arbitration 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |ID |Message Identifier 28-16 - * | | |ID28 - ID0, 29-bit Identifier (Extended Frame) - * | | |ID28 - ID18, 11-bit Identifier (Standard Frame) - * |[13] |Dir |Message Direction - * | | |0 = Direction is receive. - * | | |On TxRqst, a Remote Frame with the identifier of this Message Object is transmitted - * | | |On reception of a Data Frame with matching identifier, that message is stored in this Message Object. - * | | |1 = Direction is transmit. - * | | |On TxRqst, the respective Message Object is transmitted as a Data Frame - * | | |On reception of a Remote Frame with matching identifier, the TxRqst bit (CAN_IFn_CMASK[2]) of this Message Object is set (if RmtEn (CAN_IFn_MCON[9]) = one). - * |[14] |Xtd |Extended Identifier - * | | |0 = The 11-bit (standard) Identifier will be used for this Message Object. - * | | |1 = The 29-bit (extended) Identifier will be used for this Message Object. - * |[15] |MsgVal |Message Valid - * | | |0 = The Message Object is ignored by the Message Handler. - * | | |1 = The Message Object is configured and should be considered by the Message Handler. - * | | |Note: The application software must reset the MsgVal bit of all unused Messages Objects during the initialization before it resets bit Init (CAN_CON[0]) - * | | |This bit must also be reset before the identifier Id28-0 (CAN_IFn_ARB1/2), the control bits Xtd (CAN_IFn_ARB2[14]), Dir (CAN_IFn_ARB2[13]), or the Data Length Code DLC3-0 (CAN_IFn_MCON[3:0]) are modified, or if the Messages Object is no longer required. - * @var CAN_IF_T::MCON - * Offset: 0x38, 0x98 IFn Message Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DLC |Data Length Code - * | | |0-8: Data Frame has 0-8 data bytes. - * | | |9-15: Data Frame has 8 data bytes - * | | |Note: The Data Length Code of a Message Object must be defined the same as in all the corresponding objects with the same identifier at other nodes - * | | |When the Message Handler stores a data frame, it will write the DLC to the value given by the received message. - * | | |Data(0): 1st data byte of a CAN Data Frame - * | | |Data(1): 2nd data byte of a CAN Data Frame - * | | |Data(2): 3rd data byte of a CAN Data Frame - * | | |Data(3): 4th data byte of a CAN Data Frame - * | | |Data(4): 5th data byte of a CAN Data Frame - * | | |Data(5): 6th data byte of a CAN Data Frame - * | | |Data(6): 7th data byte of a CAN Data Frame - * | | |Data(7): 8th data byte of a CAN Data Frame - * | | |Note: The Data(0) byte is the first data byte shifted into the shift register of the CAN Core during a reception while the Data(7) byte is the last - * | | |When the Message Handler stores a Data Frame, it will write all the eight data bytes into a Message Object - * | | |If the Data Length Code is less than 8, the remaining bytes of the Message Object will be overwritten by unspecified values. - * |[7] |EoB |End of Buffer - * | | |0 = Message Object belongs to a FIFO Buffer and is not the last Message Object of that FIFO Buffer. - * | | |1 = Single Message Object or last Message Object of a FIFO Buffer. - * | | |Note: This bit is used to concatenate two or more Message Objects (up to 32) to build a FIFO Buffer - * | | |For single Message Objects (not belonging to a FIFO Buffer), this bit must always be set to one - * |[8] |TxRqst |Transmit Request - * | | |0 = This Message Object is not waiting for transmission. - * | | |1 = The transmission of this Message Object is requested and is not yet done. - * |[9] |RmtEn |Remote Enable Bit - * | | |0 = At the reception of a Remote Frame, TxRqst (CAN_IFn_MCON[8]) is left unchanged. - * | | |1 = At the reception of a Remote Frame, TxRqst is set. - * |[10] |RxIE |Receive Interrupt Enable Bit - * | | |0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after a successful reception of a frame. - * | | |1 = IntPnd will be set after a successful reception of a frame. - * |[11] |TxIE |Transmit Interrupt Enable Bit - * | | |0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after the successful transmission of a frame. - * | | |1 = IntPnd will be set after a successful transmission of a frame. - * |[12] |UMask |Use Acceptance Mask - * | | |0 = Mask ignored. - * | | |1 = Use Mask (Msk28-0, MXtd, and MDir) for acceptance filtering. - * | | |Note: If the UMask bit is set to one, the Message Object's mask bits have to be programmed during initialization of the Message Object before MsgVal bit (CAN_IFn_ARB2[15]) is set to one. - * |[13] |IntPnd |Interrupt Pending - * | | |0 = This message object is not the source of an interrupt. - * | | |1 = This message object is the source of an interrupt - * | | |The Interrupt Identifier in the Interrupt Register will point to this message object if there is no other interrupt source with higher priority. - * |[14] |MsgLst |Message Lost (only valid for Message Objects with direction = receive). - * | | |0 = No message lost since last time this bit was reset by the CPU. - * | | |1 = The Message Handler stored a new message into this object when NewDat was still set, the CPU has lost a message. - * |[15] |NewDat |New Data - * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since last time this flag was cleared by the application software. - * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object. - * @var CAN_IF_T::DAT_A1 - * Offset: 0x3C, 0x9C IFn Data A1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data_0_ |Data Byte 0 - * | | |1st data byte of a CAN Data Frame - * |[15:8] |Data_1_ |Data Byte 1 - * | | |2nd data byte of a CAN Data Frame - * @var CAN_IF_T::DAT_A2 - * Offset: 0x40, 0xA0 IFn Data A2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data_2_ |Data Byte 2 - * | | |3rd data byte of CAN Data Frame - * |[15:8] |Data_3_ |Data Byte 3 - * | | |4th data byte of CAN Data Frame - * @var CAN_IF_T::DAT_B1 - * Offset: 0x44, 0xA4 IFn Data B1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data_4_ |Data Byte 4 - * | | |5th data byte of CAN Data Frame - * |[15:8] |Data_5_ |Data Byte 5 - * | | |6th data byte of CAN Data Frame - * @var CAN_IF_T::DAT_B2 - * Offset: 0x48, 0xA8 IFn Data B2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |Data_6_ |Data Byte 6 - * | | |7th data byte of CAN Data Frame. - * |[15:8] |Data_7_ |Data Byte 7 - * | | |8th data byte of CAN Data Frame. - */ - __IO uint32_t CREQ; /*!< [0x0020] IFn Command Request Register */ - __IO uint32_t CMASK; /*!< [0x0024] IFn Command Mask Register */ - __IO uint32_t MASK1; /*!< [0x0028] IFn Mask 1 Register */ - __IO uint32_t MASK2; /*!< [0x002c] IFn Mask 2 Register */ - __IO uint32_t ARB1; /*!< [0x0030] IFn Arbitration 1 Register */ - __IO uint32_t ARB2; /*!< [0x0034] IFn Arbitration 2 Register */ - __IO uint32_t MCON; /*!< [0x0038] IFn Message Control Register */ - __IO uint32_t DAT_A1; /*!< [0x003c] IFn Data A1 Register */ - __IO uint32_t DAT_A2; /*!< [0x0040] IFn Data A2 Register */ - __IO uint32_t DAT_B1; /*!< [0x0044] IFn Data B1 Register */ - __IO uint32_t DAT_B2; /*!< [0x0048] IFn Data B2 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[13]; - /// @endcond //HIDDEN_SYMBOLS -} CAN_IF_T; - - -typedef struct -{ - - - /** - * @var CAN_T::CON - * Offset: 0x00 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |Init |Init Initialization - * | | |0 = Normal Operation. - * | | |1 = Initialization is started. - * |[1] |IE |Module Interrupt Enable Bit - * | | |0 = Function interrupt is Disabled. - * | | |1 = Function interrupt is Enabled. - * |[2] |SIE |Status Change Interrupt Enable Bit - * | | |0 = Disabled - No Status Change Interrupt will be generated. - * | | |1 = Enabled - An interrupt will be generated when a message transfer is successfully completed or a CAN bus error is detected. - * |[3] |EIE |Error Interrupt Enable Bit - * | | |0 = Disabled - No Error Status Interrupt will be generated. - * | | |1 = Enabled - A change in the bits BOff (CAN_STATUS[7]) or EWarn (CAN_STATUS[6]) in the Status Register will generate an interrupt. - * |[5] |DAR |Automatic Re-transmission Disable Bit - * | | |0 = Automatic Retransmission of disturbed messages Enabled. - * | | |1 = Automatic Retransmission Disabled. - * |[6] |CCE |Configuration Change Enable Bit - * | | |0 = No write access to the Bit Timing Register. - * | | |1 = Write access to the Bit Timing Register (CAN_BTIME) allowed. (while Init bit (CAN_CON[0]) = 1). - * |[7] |Test |Test Mode Enable Bit - * | | |0 = Normal Operation. - * | | |1 = Test Mode. - * @var CAN_T::STATUS - * Offset: 0x04 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |LEC |Last Error Code (Type of the Last Error to Occur on the CAN Bus) - * | | |The LEC field holds a code, which indicates the type of the last error to occur on the CAN bus - * | | |This field will be cleared to '0' when a message has been transferred (reception or transmission) without error - * | | |The unused code '7' may be written by the CPU to check for updates - * | | |The Error! Reference source not found - * | | |describes the error code. - * |[3] |TxOK |Transmitted a Message Successfully - * | | |0 = Since this bit was reset by the CPU, no message has been successfully transmitted - * | | |This bit is never reset by the CAN Core. - * | | |1 = Since this bit was last reset by the CPU, a message has been successfully (error free and acknowledged by at least one other node) transmitted. - * |[4] |RxOK |Received a Message Successfully - * | | |0 = No message has been successfully received since this bit was last reset by the CPU - * | | |This bit is never reset by the CAN Core. - * | | |1 = A message has been successfully received since this bit was last reset by the CPU (independent of the result of acceptance filtering). - * |[5] |EPass |Error Passive (Read Only) - * | | |0 = The CAN Core is error active. - * | | |1 = The CAN Core is in the error passive state as defined in the CAN Specification. - * |[6] |EWarn |Error Warning Status (Read Only) - * | | |0 = Both error counters are below the error warning limit of 96. - * | | |1 = At least one of the error counters in the EML has reached the error warning limit of 96. - * |[7] |BOff |Bus-off Status (Read Only) - * | | |0 = The CAN module is not in bus-off state. - * | | |1 = The CAN module is in bus-off state. - * @var CAN_T::ERR - * Offset: 0x08 Error Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TEC |Transmit Error Counter - * | | |Actual state of the Transmit Error Counter. Values between 0 and 255. - * |[14:8] |REC |Receive Error Counter - * | | |Actual state of the Receive Error Counter. Values between 0 and 127. - * |[15] |RP |Receive Error Passive - * | | |0 = The Receive Error Counter is below the error passive level. - * | | |1 = The Receive Error Counter has reached the error passive level as defined in the CAN Specification. - * @var CAN_T::BTIME - * Offset: 0x0C Bit Timing Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |BRP |Baud Rate Prescaler - * | | |0x01-0x3F: The value by which the oscillator frequency is divided for generating the bit time quanta - * | | |The bit time is built up from a multiple of this quanta - * | | |Valid values for the Baud Rate Prescaler are [0...63] - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[7:6] |SJW |(Re)Synchronization Jump Width - * | | |0x0-0x3: Valid programmed values are [0...3] - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[11:8] |TSeg1 |Time Segment Before the Sample Point Minus Sync_Seg - * | | |0x01-0x0F: valid values for TSeg1 are [1...15] - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed is used. - * |[14:12] |TSeg2 |Time Segment After Sample Point - * | | |0x0-0x7: Valid values for TSeg2 are [0...7] - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * @var CAN_T::IIDR - * Offset: 0x10 Interrupt Identifier Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IntId |Interrupt Identifier (Indicates the Source of the Interrupt) - * | | |If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt with the highest priority, disregarding their chronological order - * | | |An interrupt remains pending until the application software has cleared it - * | | |If IntId is different from 0x0000 and IE (CAN_CON[1]) is set, the IRQ interrupt signal to the EIC is active - * | | |The interrupt remains active until IntId is back to value 0x0000 (the cause of the interrupt is reset) or until IE is reset. - * | | |The Status Interrupt has the highest priority - * | | |Among the message interrupts, the Message Object' s interrupt priority decreases with increasing message number. - * | | |A message interrupt is cleared by clearing the Message Object's IntPnd bit (CAN_IFn_MCON[13]) - * | | |The Status Interrupt is cleared by reading the Status Register. - * @var CAN_T::TEST - * Offset: 0x14 Test Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |Basic |Basic Mode - * | | |0 = Basic Mode Disabled. - * | | |1= IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer. - * |[3] |Silent |Silent Mode - * | | |0 = Normal operation. - * | | |1 = The module is in Silent Mode. - * |[4] |LBack |Loop Back Mode Enable Bit - * | | |0 = Loop Back Mode is Disabled. - * | | |1 = Loop Back Mode is Enabled. - * |[6:5] |Tx |Tx[1:0]: Control of CAN_TX Pin - * | | |00 = Reset value, CAN_TX pin is controlled by the CAN Core. - * | | |01 = Sample Point can be monitored at CAN_TX pin. - * | | |10 = CAN_TX pin drives a dominant ('0') value. - * | | |11 = CAN_TX pin drives a recessive ('1') value. - * |[7] |Rx |Monitors the Actual Value of CAN_RX Pin (Read Only) *(1) - * | | |0 = The CAN bus is dominant (CAN_RX = '0'). - * | | |1 = The CAN bus is recessive (CAN_RX = '1'). - * @var CAN_T::BRPE - * Offset: 0x18 Baud Rate Prescaler Extension Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |BRPE |BRPE: Baud Rate Prescaler Extension - * | | |0x00-0x0F: By programming BRPE, the Baud Rate Prescaler can be extended to values up to 1023 - * | | |The actual interpretation by the hardware is that one more than the value programmed by BRPE (MSBs) and BTIME (LSBs) is used. - * @var CAN_T::TXREQ1 - * Offset: 0x100 Transmission Request Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TxRqst16_1|Transmission Request Bits 16-1 (of All Message Objects) - * | | |0 = This Message Object is not waiting for transmission. - * | | |1 = The transmission of this Message Object is requested and is not yet done. - * | | |These bits are read only. - * @var CAN_T::TXREQ2 - * Offset: 0x104 Transmission Request Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TxRqst32_17|Transmission Request Bits 32-17 (of All Message Objects) - * | | |0 = This Message Object is not waiting for transmission. - * | | |1 = The transmission of this Message Object is requested and is not yet done. - * | | |These bits are read only. - * @var CAN_T::NDAT1 - * Offset: 0x120 New Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |NewData16_1|New Data Bits 16-1 (of All Message Objects) - * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since the last time this flag was cleared by the application software. - * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object. - * @var CAN_T::NDAT2 - * Offset: 0x124 New Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |NewData32_17|New Data Bits 32-17 (of All Message Objects) - * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since the last time this flag was cleared by the application software. - * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object. - * @var CAN_T::IPND1 - * Offset: 0x140 Interrupt Pending Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IntPnd16_1|Interrupt Pending Bits 16-1 (of All Message Objects) - * | | |0 = This message object is not the source of an interrupt. - * | | |1 = This message object is the source of an interrupt. - * @var CAN_T::IPND2 - * Offset: 0x144 Interrupt Pending Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IntPnd32_17|Interrupt Pending Bits 32-17 (of All Message Objects) - * | | |0 = This message object is not the source of an interrupt. - * | | |1 = This message object is the source of an interrupt. - * @var CAN_T::MVLD1 - * Offset: 0x160 Message Valid Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MsgVal16_1|Message Valid Bits 16-1 (of All Message Objects) (Read Only) - * | | |0 = This Message Object is ignored by the Message Handler. - * | | |1 = This Message Object is configured and should be considered by the Message Handler. - * | | |Ex - * | | |CAN_MVLD1[0] means Message object No.1 is valid or not - * | | |If CAN_MVLD1[0] is set, message object No.1 is configured. - * @var CAN_T::MVLD2 - * Offset: 0x164 Message Valid Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MsgVal32_17|Message Valid Bits 32-17 (of All Message Objects) (Read Only) - * | | |0 = This Message Object is ignored by the Message Handler. - * | | |1 = This Message Object is configured and should be considered by the Message Handler. - * | | |Ex.CAN_MVLD2[15] means Message object No.32 is valid or not - * | | |If CAN_MVLD2[15] is set, message object No.32 is configured. - * @var CAN_T::WU_EN - * Offset: 0x168 Wake-up Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WAKUP_EN |Wake-up Enable Bit - * | | |0 = The wake-up function Disabled. - * | | |1 = The wake-up function Enabled. - * | | |Note: User can wake-up system when there is a falling edge in the CAN_Rx pin. - * @var CAN_T::WU_STATUS - * Offset: 0x16C Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WAKUP_STS |Wake-up Status - * | | |0 = No wake-up event occurred. - * | | |1 = Wake-up event occurred. - * | | |Note: This bit can be cleared by writing '0'. - */ - __IO uint32_t CON; /*!< [0x0000] Control Register */ - __IO uint32_t STATUS; /*!< [0x0004] Status Register */ - __I uint32_t ERR; /*!< [0x0008] Error Counter Register */ - __IO uint32_t BTIME; /*!< [0x000c] Bit Timing Register */ - __I uint32_t IIDR; /*!< [0x0010] Interrupt Identifier Register */ - __IO uint32_t TEST; /*!< [0x0014] Test Register */ - __IO uint32_t BRPE; /*!< [0x0018] Baud Rate Prescaler Extension Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO CAN_IF_T IF[2]; - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[8]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t TXREQ1; /*!< [0x0100] Transmission Request Register 1 */ - __I uint32_t TXREQ2; /*!< [0x0104] Transmission Request Register 2 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[6]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t NDAT1; /*!< [0x0120] New Data Register 1 */ - __I uint32_t NDAT2; /*!< [0x0124] New Data Register 2 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[6]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t IPND1; /*!< [0x0140] Interrupt Pending Register 1 */ - __I uint32_t IPND2; /*!< [0x0144] Interrupt Pending Register 2 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[6]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t MVLD1; /*!< [0x0160] Message Valid Register 1 */ - __I uint32_t MVLD2; /*!< [0x0164] Message Valid Register 2 */ - __IO uint32_t WU_EN; /*!< [0x0168] Wake-up Enable Control Register */ - __IO uint32_t WU_STATUS; /*!< [0x016c] Wake-up Status Register */ - -} CAN_T; - -/** - @addtogroup CAN_CONST CAN Bit Field Definition - Constant Definitions for CAN Controller -@{ */ - -#define CAN_CON_INIT_Pos (0) /*!< CAN_T::CON: Init Position */ -#define CAN_CON_INIT_Msk (0x1ul << CAN_CON_INIT_Pos) /*!< CAN_T::CON: Init Mask */ - -#define CAN_CON_IE_Pos (1) /*!< CAN_T::CON: IE Position */ -#define CAN_CON_IE_Msk (0x1ul << CAN_CON_IE_Pos) /*!< CAN_T::CON: IE Mask */ - -#define CAN_CON_SIE_Pos (2) /*!< CAN_T::CON: SIE Position */ -#define CAN_CON_SIE_Msk (0x1ul << CAN_CON_SIE_Pos) /*!< CAN_T::CON: SIE Mask */ - -#define CAN_CON_EIE_Pos (3) /*!< CAN_T::CON: EIE Position */ -#define CAN_CON_EIE_Msk (0x1ul << CAN_CON_EIE_Pos) /*!< CAN_T::CON: EIE Mask */ - -#define CAN_CON_DAR_Pos (5) /*!< CAN_T::CON: DAR Position */ -#define CAN_CON_DAR_Msk (0x1ul << CAN_CON_DAR_Pos) /*!< CAN_T::CON: DAR Mask */ - -#define CAN_CON_CCE_Pos (6) /*!< CAN_T::CON: CCE Position */ -#define CAN_CON_CCE_Msk (0x1ul << CAN_CON_CCE_Pos) /*!< CAN_T::CON: CCE Mask */ - -#define CAN_CON_TEST_Pos (7) /*!< CAN_T::CON: Test Position */ -#define CAN_CON_TEST_Msk (0x1ul << CAN_CON_TEST_Pos) /*!< CAN_T::CON: Test Mask */ - -#define CAN_STATUS_LEC_Pos (0) /*!< CAN_T::STATUS: LEC Position */ -#define CAN_STATUS_LEC_Msk (0x7ul << CAN_STATUS_LEC_Pos) /*!< CAN_T::STATUS: LEC Mask */ - -#define CAN_STATUS_TXOK_Pos (3) /*!< CAN_T::STATUS: TxOK Position */ -#define CAN_STATUS_TXOK_Msk (0x1ul << CAN_STATUS_TXOK_Pos) /*!< CAN_T::STATUS: TxOK Mask */ - -#define CAN_STATUS_RXOK_Pos (4) /*!< CAN_T::STATUS: RxOK Position */ -#define CAN_STATUS_RXOK_Msk (0x1ul << CAN_STATUS_RXOK_Pos) /*!< CAN_T::STATUS: RxOK Mask */ - -#define CAN_STATUS_EPASS_Pos (5) /*!< CAN_T::STATUS: EPass Position */ -#define CAN_STATUS_EPASS_Msk (0x1ul << CAN_STATUS_EPASS_Pos) /*!< CAN_T::STATUS: EPass Mask */ - -#define CAN_STATUS_EWARN_Pos (6) /*!< CAN_T::STATUS: EWarn Position */ -#define CAN_STATUS_EWARN_Msk (0x1ul << CAN_STATUS_EWARN_Pos) /*!< CAN_T::STATUS: EWarn Mask */ - -#define CAN_STATUS_BOFF_Pos (7) /*!< CAN_T::STATUS: BOff Position */ -#define CAN_STATUS_BOFF_Msk (0x1ul << CAN_STATUS_BOFF_Pos) /*!< CAN_T::STATUS: BOff Mask */ - -#define CAN_ERR_TEC_Pos (0) /*!< CAN_T::ERR: TEC Position */ -#define CAN_ERR_TEC_Msk (0xfful << CAN_ERR_TEC_Pos) /*!< CAN_T::ERR: TEC Mask */ - -#define CAN_ERR_REC_Pos (8) /*!< CAN_T::ERR: REC Position */ -#define CAN_ERR_REC_Msk (0x7ful << CAN_ERR_REC_Pos) /*!< CAN_T::ERR: REC Mask */ - -#define CAN_ERR_RP_Pos (15) /*!< CAN_T::ERR: RP Position */ -#define CAN_ERR_RP_Msk (0x1ul << CAN_ERR_RP_Pos) /*!< CAN_T::ERR: RP Mask */ - -#define CAN_BTIME_BRP_Pos (0) /*!< CAN_T::BTIME: BRP Position */ -#define CAN_BTIME_BRP_Msk (0x3ful << CAN_BTIME_BRP_Pos) /*!< CAN_T::BTIME: BRP Mask */ - -#define CAN_BTIME_SJW_Pos (6) /*!< CAN_T::BTIME: SJW Position */ -#define CAN_BTIME_SJW_Msk (0x3ul << CAN_BTIME_SJW_Pos) /*!< CAN_T::BTIME: SJW Mask */ - -#define CAN_BTIME_TSEG1_Pos (8) /*!< CAN_T::BTIME: TSeg1 Position */ -#define CAN_BTIME_TSEG1_Msk (0xful << CAN_BTIME_TSEG1_Pos) /*!< CAN_T::BTIME: TSeg1 Mask */ - -#define CAN_BTIME_TSEG2_Pos (12) /*!< CAN_T::BTIME: TSeg2 Position */ -#define CAN_BTIME_TSEG2_Msk (0x7ul << CAN_BTIME_TSEG2_Pos) /*!< CAN_T::BTIME: TSeg2 Mask */ - -#define CAN_IIDR_INTID_Pos (0) /*!< CAN_T::IIDR: IntId Position */ -#define CAN_IIDR_INTID_Msk (0xfffful << CAN_IIDR_INTID_Pos) /*!< CAN_T::IIDR: IntId Mask */ - -#define CAN_TEST_BASIC_Pos (2) /*!< CAN_T::TEST: Basic Position */ -#define CAN_TEST_BASIC_Msk (0x1ul << CAN_TEST_BASIC_Pos) /*!< CAN_T::TEST: Basic Mask */ - -#define CAN_TEST_SILENT_Pos (3) /*!< CAN_T::TEST: Silent Position */ -#define CAN_TEST_SILENT_Msk (0x1ul << CAN_TEST_SILENT_Pos) /*!< CAN_T::TEST: Silent Mask */ - -#define CAN_TEST_LBACK_Pos (4) /*!< CAN_T::TEST: LBack Position */ -#define CAN_TEST_LBACK_Msk (0x1ul << CAN_TEST_LBACK_Pos) /*!< CAN_T::TEST: LBack Mask */ - -#define CAN_TEST_Tx_Pos (5) /*!< CAN_T::TEST: Tx Position */ -#define CAN_TEST_Tx_Msk (0x3ul << CAN_TEST_Tx_Pos) /*!< CAN_T::TEST: Tx Mask */ - -#define CAN_TEST_Rx_Pos (7) /*!< CAN_T::TEST: Rx Position */ -#define CAN_TEST_Rx_Msk (0x1ul << CAN_TEST_Rx_Pos) /*!< CAN_T::TEST: Rx Mask */ - -#define CAN_BRPE_BRPE_Pos (0) /*!< CAN_T::BRPE: BRPE Position */ -#define CAN_BRPE_BRPE_Msk (0xful << CAN_BRPE_BRPE_Pos) /*!< CAN_T::BRPE: BRPE Mask */ - -#define CAN_IF_CREQ_MSGNUM_Pos (0) /*!< CAN_IF_T::CREQ: MessageNumber Position*/ -#define CAN_IF_CREQ_MSGNUM_Msk (0x3ful << CAN_IF_CREQ_MSGNUM_Pos) /*!< CAN_IF_T::CREQ: MessageNumber Mask */ - -#define CAN_IF_CREQ_BUSY_Pos (15) /*!< CAN_IF_T::CREQ: Busy Position */ -#define CAN_IF_CREQ_BUSY_Msk (0x1ul << CAN_IF_CREQ_BUSY_Pos) /*!< CAN_IF_T::CREQ: Busy Mask */ - -#define CAN_IF_CMASK_DATAB_Pos (0) /*!< CAN_IF_T::CMASK: DAT_B Position */ -#define CAN_IF_CMASK_DATAB_Msk (0x1ul << CAN_IF_CMASK_DATAB_Pos) /*!< CAN_IF_T::CMASK: DAT_B Mask */ - -#define CAN_IF_CMASK_DATAA_Pos (1) /*!< CAN_IF_T::CMASK: DAT_A Position */ -#define CAN_IF_CMASK_DATAA_Msk (0x1ul << CAN_IF_CMASK_DATAA_Pos) /*!< CAN_IF_T::CMASK: DAT_A Mask */ - -#define CAN_IF_CMASK_TXRQSTNEWDAT_Pos (2) /*!< CAN_IF_T::CMASK: TxRqst_NewDat Position*/ -#define CAN_IF_CMASK_TXRQSTNEWDAT_Msk (0x1ul << CAN_IF_CMASK_TXRQSTNEWDAT_Pos) /*!< CAN_IF_T::CMASK: TxRqst_NewDat Mask */ - -#define CAN_IF_CMASK_CLRINTPND_Pos (3) /*!< CAN_IF_T::CMASK: ClrIntPnd Position */ -#define CAN_IF_CMASK_CLRINTPND_Msk (0x1ul << CAN_IF_CMASK_CLRINTPND_Pos) /*!< CAN_IF_T::CMASK: ClrIntPnd Mask */ - -#define CAN_IF_CMASK_CONTROL_Pos (4) /*!< CAN_IF_T::CMASK: Control Position */ -#define CAN_IF_CMASK_CONTROL_Msk (0x1ul << CAN_IF_CMASK_CONTROL_Pos) /*!< CAN_IF_T::CMASK: Control Mask */ - -#define CAN_IF_CMASK_ARB_Pos (5) /*!< CAN_IF_T::CMASK: Arb Position */ -#define CAN_IF_CMASK_ARB_Msk (0x1ul << CAN_IF_CMASK_ARB_Pos) /*!< CAN_IF_T::CMASK: Arb Mask */ - -#define CAN_IF_CMASK_MASK_Pos (6) /*!< CAN_IF_T::CMASK: Mask Position */ -#define CAN_IF_CMASK_MASK_Msk (0x1ul << CAN_IF_CMASK_MASK_Pos) /*!< CAN_IF_T::CMASK: Mask Mask */ - -#define CAN_IF_CMASK_WRRD_Pos (7) /*!< CAN_IF_T::CMASK: WR_RD Position */ -#define CAN_IF_CMASK_WRRD_Msk (0x1ul << CAN_IF_CMASK_WRRD_Pos) /*!< CAN_IF_T::CMASK: WR_RD Mask */ - -#define CAN_IF_MASK1_Msk_Pos (0) /*!< CAN_IF_T::MASK1: Msk Position */ -#define CAN_IF_MASK1_Msk_Msk (0xfffful << CAN_IF_MASK1_Msk_Pos) /*!< CAN_IF_T::MASK1: Msk Mask */ - -#define CAN_IF_MASK2_Msk_Pos (0) /*!< CAN_IF_T::MASK2: Msk Position */ -#define CAN_IF_MASK2_Msk_Msk (0x1ffful << CAN_IF_MASK2_Msk_Pos) /*!< CAN_IF_T::MASK2: Msk Mask */ - -#define CAN_IF_MASK2_MDIR_Pos (14) /*!< CAN_IF_T::MASK2: MDir Position */ -#define CAN_IF_MASK2_MDIR_Msk (0x1ul << CAN_IF_MASK2_MDIR_Pos) /*!< CAN_IF_T::MASK2: MDir Mask */ - -#define CAN_IF_MASK2_MXTD_Pos (15) /*!< CAN_IF_T::MASK2: MXtd Position */ -#define CAN_IF_MASK2_MXTD_Msk (0x1ul << CAN_IF_MASK2_MXTD_Pos) /*!< CAN_IF_T::MASK2: MXtd Mask */ - -#define CAN_IF_ARB1_ID_Pos (0) /*!< CAN_IF_T::ARB1: ID Position */ -#define CAN_IF_ARB1_ID_Msk (0xfffful << CAN_IF_ARB1_ID_Pos) /*!< CAN_IF_T::ARB1: ID Mask */ - -#define CAN_IF_ARB2_ID_Pos (0) /*!< CAN_IF_T::ARB2: ID Position */ -#define CAN_IF_ARB2_ID_Msk (0x1ffful << CAN_IF_ARB2_ID_Pos) /*!< CAN_IF_T::ARB2: ID Mask */ - -#define CAN_IF_ARB2_DIR_Pos (13) /*!< CAN_IF_T::ARB2: Dir Position */ -#define CAN_IF_ARB2_DIR_Msk (0x1ul << CAN_IF_ARB2_DIR_Pos) /*!< CAN_IF_T::ARB2: Dir Mask */ - -#define CAN_IF_ARB2_XTD_Pos (14) /*!< CAN_IF_T::ARB2: Xtd Position */ -#define CAN_IF_ARB2_XTD_Msk (0x1ul << CAN_IF_ARB2_XTD_Pos) /*!< CAN_IF_T::ARB2: Xtd Mask */ - -#define CAN_IF_ARB2_MSGVAL_Pos (15) /*!< CAN_IF_T::ARB2: MsgVal Position */ -#define CAN_IF_ARB2_MSGVAL_Msk (0x1ul << CAN_IF_ARB2_MSGVAL_Pos) /*!< CAN_IF_T::ARB2: MsgVal Mask */ - -#define CAN_IF_MCON_DLC_Pos (0) /*!< CAN_IF_T::MCON: DLC Position */ -#define CAN_IF_MCON_DLC_Msk (0xful << CAN_IF_MCON_DLC_Pos) /*!< CAN_IF_T::MCON: DLC Mask */ - -#define CAN_IF_MCON_EOB_Pos (7) /*!< CAN_IF_T::MCON: EoB Position */ -#define CAN_IF_MCON_EOB_Msk (0x1ul << CAN_IF_MCON_EOB_Pos) /*!< CAN_IF_T::MCON: EoB Mask */ - -#define CAN_IF_MCON_TxRqst_Pos (8) /*!< CAN_IF_T::MCON: TxRqst Position */ -#define CAN_IF_MCON_TxRqst_Msk (0x1ul << CAN_IF_MCON_TxRqst_Pos) /*!< CAN_IF_T::MCON: TxRqst Mask */ - -#define CAN_IF_MCON_RmtEn_Pos (9) /*!< CAN_IF_T::MCON: RmtEn Position */ -#define CAN_IF_MCON_RmtEn_Msk (0x1ul << CAN_IF_MCON_RmtEn_Pos) /*!< CAN_IF_T::MCON: RmtEn Mask */ - -#define CAN_IF_MCON_RXIE_Pos (10) /*!< CAN_IF_T::MCON: RxIE Position */ -#define CAN_IF_MCON_RXIE_Msk (0x1ul << CAN_IF_MCON_RXIE_Pos) /*!< CAN_IF_T::MCON: RxIE Mask */ - -#define CAN_IF_MCON_TXIE_Pos (11) /*!< CAN_IF_T::MCON: TxIE Position */ -#define CAN_IF_MCON_TXIE_Msk (0x1ul << CAN_IF_MCON_TXIE_Pos) /*!< CAN_IF_T::MCON: TxIE Mask */ - -#define CAN_IF_MCON_UMASK_Pos (12) /*!< CAN_IF_T::MCON: UMask Position */ -#define CAN_IF_MCON_UMASK_Msk (0x1ul << CAN_IF_MCON_UMASK_Pos) /*!< CAN_IF_T::MCON: UMask Mask */ - -#define CAN_IF_MCON_IntPnd_Pos (13) /*!< CAN_IF_T::MCON: IntPnd Position */ -#define CAN_IF_MCON_IntPnd_Msk (0x1ul << CAN_IF_MCON_IntPnd_Pos) /*!< CAN_IF_T::MCON: IntPnd Mask */ - -#define CAN_IF_MCON_MsgLst_Pos (14) /*!< CAN_IF_T::MCON: MsgLst Position */ -#define CAN_IF_MCON_MsgLst_Msk (0x1ul << CAN_IF_MCON_MsgLst_Pos) /*!< CAN_IF_T::MCON: MsgLst Mask */ - -#define CAN_IF_MCON_NEWDAT_Pos (15) /*!< CAN_IF_T::MCON: NewDat Position */ -#define CAN_IF_MCON_NEWDAT_Msk (0x1ul << CAN_IF_MCON_NEWDAT_Pos) /*!< CAN_IF_T::MCON: NewDat Mask */ - -#define CAN_IF_DAT_A1_DATA0_Pos (0) /*!< CAN_IF_T::DAT_A1: Data_0_ Position */ -#define CAN_IF_DAT_A1_DATA0_Msk (0xfful << CAN_IF_DAT_A1_DATA0_Pos) /*!< CAN_IF_T::DAT_A1: Data_0_ Mask */ - -#define CAN_IF_DAT_A1_DATA1_Pos (8) /*!< CAN_IF_T::DAT_A1: Data_1_ Position */ -#define CAN_IF_DAT_A1_DATA1_Msk (0xfful << CAN_IF_DAT_A1_DATA1_Pos) /*!< CAN_IF_T::DAT_A1: Data_1_ Mask */ - -#define CAN_IF_DAT_A2_DATA2_Pos (0) /*!< CAN_IF_T::DAT_A2: Data_2_ Position */ -#define CAN_IF_DAT_A2_DATA2_Msk (0xfful << CAN_IF_DAT_A2_DATA2_Pos) /*!< CAN_IF_T::DAT_A2: Data_2_ Mask */ - -#define CAN_IF_DAT_A2_DATA3_Pos (8) /*!< CAN_IF_T::DAT_A2: Data_3_ Position */ -#define CAN_IF_DAT_A2_DATA3_Msk (0xfful << CAN_IF_DAT_A2_DATA3_Pos) /*!< CAN_IF_T::DAT_A2: Data_3_ Mask */ - -#define CAN_IF_DAT_B1_DATA4_Pos (0) /*!< CAN_IF_T::DAT_B1: Data_4_ Position */ -#define CAN_IF_DAT_B1_DATA4_Msk (0xfful << CAN_IF_DAT_B1_DATA4_Pos) /*!< CAN_IF_T::DAT_B1: Data_4_ Mask */ - -#define CAN_IF_DAT_B1_DATA5_Pos (8) /*!< CAN_IF_T::DAT_B1: Data_5_ Position */ -#define CAN_IF_DAT_B1_DATA5_Msk (0xfful << CAN_IF_DAT_B1_DATA5_Pos) /*!< CAN_IF_T::DAT_B1: Data_5_ Mask */ - -#define CAN_IF_DAT_B2_DATA6_Pos (0) /*!< CAN_IF_T::DAT_B2: Data_6_ Position */ -#define CAN_IF_DAT_B2_DATA6_Msk (0xfful << CAN_IF_DAT_B2_DATA6_Pos) /*!< CAN_IF_T::DAT_B2: Data_6_ Mask */ - -#define CAN_IF_DAT_B2_DATA7_Pos (8) /*!< CAN_IF_T::DAT_B2: Data_7_ Position */ -#define CAN_IF_DAT_B2_DATA7_Msk (0xfful << CAN_IF_DAT_B2_DATA7_Pos) /*!< CAN_IF_T::DAT_B2: Data_7_ Mask */ - -#define CAN_TXREQ1_TXRQST16_1_Pos (0) /*!< CAN_T::TXREQ1: TxRqst16_1 Position */ -#define CAN_TXREQ1_TXRQST16_1_Msk (0xfffful << CAN_TXREQ1_TXRQST16_1_Pos) /*!< CAN_T::TXREQ1: TxRqst16_1 Mask */ - -#define CAN_TXREQ2_TXRQST32_17_Pos (0) /*!< CAN_T::TXREQ2: TxRqst32_17 Position */ -#define CAN_TXREQ2_TXRQST32_17_Msk (0xfffful << CAN_TXREQ2_TXRQST32_17_Pos) /*!< CAN_T::TXREQ2: TxRqst32_17 Mask */ - -#define CAN_NDAT1_NewData16_1_Pos (0) /*!< CAN_T::NDAT1: NewData16_1 Position */ -#define CAN_NDAT1_NewData16_1_Msk (0xfffful << CAN_NDAT1_NewData16_1_Pos) /*!< CAN_T::NDAT1: NewData16_1 Mask */ - -#define CAN_NDAT2_NewData32_17_Pos (0) /*!< CAN_T::NDAT2: NewData32_17 Position */ -#define CAN_NDAT2_NewData32_17_Msk (0xfffful << CAN_NDAT2_NewData32_17_Pos) /*!< CAN_T::NDAT2: NewData32_17 Mask */ - -#define CAN_IPND1_IntPnd16_1_Pos (0) /*!< CAN_T::IPND1: IntPnd16_1 Position */ -#define CAN_IPND1_IntPnd16_1_Msk (0xfffful << CAN_IPND1_IntPnd16_1_Pos) /*!< CAN_T::IPND1: IntPnd16_1 Mask */ - -#define CAN_IPND2_IntPnd32_17_Pos (0) /*!< CAN_T::IPND2: IntPnd32_17 Position */ -#define CAN_IPND2_IntPnd32_17_Msk (0xfffful << CAN_IPND2_IntPnd32_17_Pos) /*!< CAN_T::IPND2: IntPnd32_17 Mask */ - -#define CAN_MVLD1_MsgVal16_1_Pos (0) /*!< CAN_T::MVLD1: MsgVal16_1 Position */ -#define CAN_MVLD1_MsgVal16_1_Msk (0xfffful << CAN_MVLD1_MsgVal16_1_Pos) /*!< CAN_T::MVLD1: MsgVal16_1 Mask */ - -#define CAN_MVLD2_MsgVal32_17_Pos (0) /*!< CAN_T::MVLD2: MsgVal32_17 Position */ -#define CAN_MVLD2_MsgVal32_17_Msk (0xfffful << CAN_MVLD2_MsgVal32_17_Pos) /*!< CAN_T::MVLD2: MsgVal32_17 Mask */ - -#define CAN_WU_EN_WAKUP_EN_Pos (0) /*!< CAN_T::WU_EN: WAKUP_EN Position */ -#define CAN_WU_EN_WAKUP_EN_Msk (0x1ul << CAN_WU_EN_WAKUP_EN_Pos) /*!< CAN_T::WU_EN: WAKUP_EN Mask */ - -#define CAN_WU_STATUS_WAKUP_STS_Pos (0) /*!< CAN_T::WU_STATUS: WAKUP_STS Position */ -#define CAN_WU_STATUS_WAKUP_STS_Msk (0x1ul << CAN_WU_STATUS_WAKUP_STS_Pos) /*!< CAN_T::WU_STATUS: WAKUP_STS Mask */ - -/**@}*/ /* CAN_CONST */ -/**@}*/ /* end of CAN register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CAN_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ccap_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ccap_reg.h deleted file mode 100644 index 3798f50b96e..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ccap_reg.h +++ /dev/null @@ -1,496 +0,0 @@ -/**************************************************************************//** - * @file ccap_reg.h - * @version V1.00 - * @brief CCAP register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CCAP_REG_H__ -#define __CCAP_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CCAP Camera Capture Interface Controller (CCAP) - Memory Mapped Structure for CCAP Controller -@{ */ - - -typedef struct { - - - /** - * @var CCAP_T::CTL - * Offset: 0x00 Camera Capture Interface Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCAPEN |Camera Capture Interface Enable - * | | |0 = Camera Capture Interface Disabled. - * | | |1 = Camera Capture Interface Enabled. - * |[3] |ADDRSW |Packet Buffer Address Switch - * | | |0 = Packet buffer address switch Disabled. - * | | |1 = Packet buffer address switch Enabled. - * |[6] |PKTEN |Packet Output Enable - * | | |0 = Packet output Disabled. - * | | |1 = Packet output Enabled. - * |[7] |MONO |Monochrome CMOS Sensor Select - * | | |0 = Color CMOS Sensor. - * | | |1 = Monochrome CMOS Sensor. The U/V components are ignored when the MONO is enabled. - * |[16] |SHUTTER |Image Capture Interface Automatically Disable The Capture Interface After A Frame Had Been Captured - * | | |0 = Shutter Disabled. - * | | |1 = Shutter Enabled. - * |[20] |UPDATE |Update Register At New Frame - * | | |0 = Update register at new frame Disabled. - * | | |1 = Update register at new frame Enabled (Auto clear to 0 when register updated). - * |[24] |VPRST |Capture Interface Reset - * | | |0 = Capture interface reset Disabled. - * | | |1 = Capture interface reset Enabled. - * @var CCAP_T::PAR - * Offset: 0x04 Camera Capture Interface Parameter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INFMT |Sensor Input Data Format - * | | |0 = YCbCr422. - * | | |1 = RGB565. - * |[1] |SENTYPE |Sensor Input Type - * | | |0 = CCIR601. - * | | |1 = CCIR656, VSync & Hsync embedded in the data signal. - * |[2:3] |INDATORD |Sensor Input Data Order - * | | |If INFMT = 0 (YCbCr),. - * | | | Byte 0 1 2 3 - * | | |00 = Y0 U0 Y1 V0. - * | | |01 = Y0 V0 Y1 U0. - * | | |10 = U0 Y0 V0 Y1. - * | | |11 = V0 Y0 U0 Y1. - * | | |If INFMT = 1 (RGB565),. - * | | |00 = Byte0[R[4:0] G[5:3]] Byte1[G[2:0] B[4:0]] - * | | |01 = Byte0[B[4:0] G[5:3]] Byte1[G[2:0] R[4:0]] - * | | |10 = Byte0[G[2:0] B[4:0]] Byte1[R[4:0] G[5:3]] - * | | |11 = Byte0[G[2:0] R[4:0]] Byte1[B[4:0] G[5:3]] - * |[4:5] |OUTFMT |Image Data Format Output To System Memory - * | | |00 = YCbCr422. - * | | |01 = Only output Y. - * | | |10 = RGB555. - * | | |11 = RGB565. - * |[6] |RANGE |Scale Input YUV CCIR601 Color Range To Full Range - * | | |0 = default. - * | | |1 = Scale to full range. - * |[8] |PCLKP |Sensor Pixel Clock Polarity - * | | |0 = Input video data and signals are latched by falling edge of Pixel Clock. - * | | |1 = Input video data and signals are latched by rising edge of Pixel Clock. - * |[9] |HSP |Sensor Hsync Polarity - * | | |0 = Sync Low. - * | | |1 = Sync High. - * |[10] |VSP |Sensor Vsync Polarity - * | | |0 = Sync Low. - * | | |1 = Sync High. - * |[18] |FBB |Field By Blank - * | | |Hardware will tag field0 or field1 by vertical blanking instead of FIELD flag in CCIR-656 mode. - * | | |0 = Field by blank Disabled. - * | | |1 = Field by blank Enabled. - * @var CCAP_T::INT - * Offset: 0x08 Camera Capture Interface Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VINTF |Video Frame End Interrupt - * | | |If this bit shows 1, receiving a frame completed. - * | | |Write 1 to clear it. - * |[1] |MEINTF |Bus Master Transfer Error Interrupt - * | | |If this bit shows 1, Transfer Error occurred. Write 1 to clear it. - * |[3] |ADDRMINTF |Memory Address Match Interrupt - * | | |If this bit shows 1, Memory Address Match Interrupt occurred. - * | | |Write 1 to clear it. - * |[4] |MDINTF |Motion Detection Output Finish Interrupt - * | | |If this bit shows 1, Motion Detection Output Finish Interrupt occurred. - * | | |Write 1 to clear it. - * |[16] |VIEN |Video Frame End Interrupt Enable - * | | |0 = Video frame end interrupt Disabled. - * | | |1 = Video frame end interrupt Enabled. - * |[17] |MEIEN |System Memory Error Interrupt Enable - * | | |0 = System memory error interrupt Disabled. - * | | |1 = System memory error interrupt Enabled. - * |[19] |ADDRMIEN |Address Match Interrupt Enable - * | | |0 = Address match interrupt Disabled. - * | | |1 = Address match interrupt Enabled. - * @var CCAP_T::POSTERIZE - * Offset: 0x0C YUV Component Posterizing Factor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:7] |VCOMP |V Component Posterizing Factor - * | | |Final_V_Out = Original_V[7:0] & V_Posterizing_Factor. - * |[8:15] |UCOMP |U Component Posterizing Factor - * | | |Final_U_Out = Original_U[7:0] & U_Posterizing_Factor. - * |[16:23] |YCOMP |Y Component Posterizing Factor - * | | |Final_Y_Out = Original_Y[7:0] & Y_Posterizing_Factor. - * @var CCAP_T::MD - * Offset: 0x10 Motion Detection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MDEN |Motion Detection Enable - * | | |0 = CCAP_MD Disabled. - * | | |1 = CCAP_MD Enabled. - * |[8] |MDBS |Motion Detection Block Size - * | | |0 = 16x16. - * | | |1 = 8x8. - * |[9] |MDSM |Motion Detection Save Mode - * | | |0 = 1 bit DIFF + 7 bit Y Differential. - * | | |1 = 1 bit DIFF only. - * |[10:11] |MDDF |Motion Detection Detect Frequency - * | | |00 = Each frame. - * | | |01 = Every 2 frame. - * | | |10 = Every 3 frame. - * | | |11 = Every 4 frame. - * |[16:20] |MDTHR |Motion Detection Differential Threshold - * @var CCAP_T::MDADDR - * Offset: 0x14 Motion Detection Output Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:31] |MDADDR |Motion Detection Output Address Register (Word Alignment) - * @var CCAP_T::MDYADDR - * Offset: 0x18 Motion Detection Temp Y Output Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:31] |MDYADDR |Motion Detection Temp Y Output Address Register (Word Alignment) - * @var CCAP_T::SEPIA - * Offset: 0x1C Sepia Effect Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:7] |VCOMP |Define the constant V component while Sepia color effect is turned on. - * |[8:15] |UCOMP |Define the constant U component while Sepia color effect is turned on. - * @var CCAP_T::CWSP - * Offset: 0x20 Cropping Window Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:11] |CWSADDRH |Cropping Window Horizontal Starting Address - * |[16:26] |CWSADDRV |Cropping Window Vertical Starting Address - * @var CCAP_T::CWS - * Offset: 0x24 Cropping Window Size Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:11] |CIWW |Cropping Image Window Width - * |[16:26] |CIWH |Cropping Image Window Height - * @var CCAP_T::PKTSL - * Offset: 0x28 Packet Scaling Vertical/Horizontal Factor Register (LSB) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:7] |PKTSHML |Packet Scaling Horizontal Factor M (Lower 8-Bit) - * | | |Specifies the lower 8-bit of denominator part (M) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSHMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image width * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[8:15] |PKTSHNL |Packet Scaling Horizontal Factor N (Lower 8-Bit) - * | | |Specify the lower 8-bit of numerator part (N) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSHNH) to form a 16-bit numerator of horizontal factor. - * |[16:23] |PKTSVML |Packet Scaling Vertical Factor M (Lower 8-Bit) - * | | |Specify the lower 8-bit of denominator part (M) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSVMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image height * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[24:31] |PKTSVNL |Packet Scaling Vertical Factor N (Lower 8-Bit) - * | | |Specify the lower 8-bit of numerator part (N) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSVNH) to form a 16-bit numerator of vertical factor - * @var CCAP_T::PLNSL - * Offset: 0x2C Planar Scaling Vertical/Horizontal Factor Register (LSB) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:7] |PLNSHML |Planar Scaling Horizontal Factor M (Lower 8-Bit) - * | | |Specify the lower 8-bit of denominator part (M) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PNDSHMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image width * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[8:15] |PLNSHNL |Planar Scaling Horizontal Factor N (Lower 8-Bit) - * | | |Specify the lower 8-bit of numerator part (N) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PNDSHNH) to form a 16-bit numerator of horizontal factor. - * |[16:23] |PLNSVML |Planar Scaling Vertical Factor M (Lower 8-Bit) - * | | |Specify the lower 8-bit of denominator part (M) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PNDSVMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image height * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[24:31] |PLNSVNL |Planar Scaling Vertical Factor N (Lower 8-Bit) - * | | |Specify the lower 8-bit of numerator part (N) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PNDSVNH) to form a 16-bit numerator of vertical factor. - * @var CCAP_T::FRCTL - * Offset: 0x30 Scaling Frame Rate Factor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:5] |FRM |Scaling Frame Rate Factor M - * | | |Specify the denominator part (M) of the frame rate scaling factor. - * | | |The output image frame rate will be equal to input image frame rate * (N/M). - * | | |Note: The value of N must be equal to or less than M. - * |[8:13] |FRN |Scaling Frame Rate Factor N - * | | |Specify the denominator part (N) of the frame rate scaling factor. - * @var CCAP_T::STRIDE - * Offset: 0x34 Frame Output Pixel Stride Width Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:13] |PKTSTRIDE |Packet Frame Output Pixel Stride Width - * | | |The output pixel stride size of packet pipe. - * |[16:29] |PLNSTRIDE |Planar Frame Output Pixel Stride Width - * | | |The output pixel stride size of planar pipe. - * @var CCAP_T::FIFOTH - * Offset: 0x3C FIFO Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:3] |PLNVFTH |Planar V FIFO Threshold - * |[8:11] |PLNUFTH |Planar U FIFO Threshold - * |[16:20] |PLNYFTH |Planar Y FIFO Threshold - * |[24:28] |PKTFTH |Packet FIFO Threshold - * |[31] |OVF |FIFO Overflow Flag - * @var CCAP_T::CMPADDR - * Offset: 0x40 Compare Memory Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:31] |CMPADDR |Compare Memory Base Address - * | | |Word aligns address; ignore the bits [1:0]. - * @var CCAP_T::LUMA_Y1_THD - * Offset: 0x44 Luminance Y8 to Y1 Threshold Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :-----------: | :---- | - * |[0:8] |LUMA_Y1_THRESH |Luminance Y8 to Y1 Threshold Value - * | | |Specify the 8-bit threshold value for the luminance Y bit-8 to the luminance Y 1-bit conversion. - * @var CCAP_T::PKTSM - * Offset: 0x48 Packet Scaling Vertical/Horizontal Factor Register (MSB) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:7] |PKTSHMH |Packet Scaling Horizontal Factor M (Higher 8-Bit) - * | | |Specify the lower 8-bit of denominator part (M) of the horizontal scaling factor. - * | | |Please refer to the register CCAP_PKTSL?for the detailed operation. - * |[8:15] |PKTSHNH |Packet Scaling Horizontal Factor N (Higher 8-Bit) - * | | |Specify the lower 8-bit of numerator part (N) of the horizontal scaling factor. - * | | |Please refer to the register CCAP_PKTSL for the detailed operation. - * |[16:23] |PKTSVMH |Packet Scaling Vertical Factor M (Higher 8-Bit) - * | | |Specify the lower 8-bit of denominator part (M) of the vertical scaling factor. - * | | |Please refer to the register CCAP_PKTSL to check the cooperation between these two registers. - * |[24:31] |PKTSVNH |Packet Scaling Vertical Factor N (Higher 8-Bit) - * | | |Specify the higher 8-bit of numerator part (N) of the vertical scaling factor. - * | | |Please refer to the register CCAP_PKTSL?to check the cooperation between these two registers. - * @var CCAP_T::PKTBA0 - * Offset: 0x60 System Memory Packet Base Address 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0:31] |BASEADDR |System Memory Packet Base Address 0 - * | | |Word aligns address; ignore the bits [1:0]. - */ - __IO uint32_t CTL; - __IO uint32_t PAR; - __IO uint32_t INT; - __IO uint32_t POSTERIZE; - __IO uint32_t MD; - __IO uint32_t MDADDR; - __IO uint32_t MDYADDR; - __IO uint32_t SEPIA; - __IO uint32_t CWSP; - __IO uint32_t CWS; - __IO uint32_t PKTSL; - __IO uint32_t PLNSL; - __IO uint32_t FRCTL; - __IO uint32_t STRIDE; - /// @cond HIDDEN_SYMBOLS - uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t FIFOTH; - __IO uint32_t CMPADDR; - __IO uint32_t LUMA_Y1_THD; - __IO uint32_t PKTSM; - /// @cond HIDDEN_SYMBOLS - uint32_t RESERVE2[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PKTBA0; -} CCAP_T; - -/** - @addtogroup CCAP_CONST CCAP Bit Field Definition - Constant Definitions for CCAP Controller -@{ */ - -#define CCAP_CTL_CCAPEN_Pos (0) /*!< CCAP_T::CTL: CCAPEN Position */ -#define CCAP_CTL_CCAPEN_Msk (0x1ul << CCAP_CTL_CCAPEN_Pos) /*!< CCAP_T::CTL: CCAPEN Mask */ - -#define CCAP_CTL_ADDRSW_Pos (3) /*!< CCAP_T::CTL: ADDRSW Position */ -#define CCAP_CTL_ADDRSW_Msk (0x1ul << CCAP_CTL_ADDRSW_Pos) /*!< CCAP_T::CTL: ADDRSW Mask */ - -#define CCAP_CTL_PLNEN_Pos (5) /*!< CCAP_T::CTL: PLNEN Position */ -#define CCAP_CTL_PLNEN_Msk (0x1ul << CCAP_CTL_PLNEN_Pos) /*!< CCAP_T::CTL: PLNEN Mask */ - -#define CCAP_CTL_PKTEN_Pos (6) /*!< CCAP_T::CTL: PKTEN Position */ -#define CCAP_CTL_PKTEN_Msk (0x1ul << CCAP_CTL_PKTEN_Pos) /*!< CCAP_T::CTL: PKTEN Mask */ - -#define CCAP_CTL_MONO_Pos (7) /*!< CCAP_T::CTL: MONO Position */ -#define CCAP_CTL_MONO_Msk (0x1ul << CCAP_CTL_MONO_Pos) /*!< CCAP_T::CTL: MONO Mask */ - -#define CCAP_CTL_SHUTTER_Pos (16) /*!< CCAP_T::CTL: SHUTTER Position */ -#define CCAP_CTL_SHUTTER_Msk (0x1ul << CCAP_CTL_SHUTTER_Pos) /*!< CCAP_T::CTL: SHUTTER Mask */ - -#define CCAP_CTL_MY4_SWAP_Pos (17) /*!< CCAP_T::CTL: MY4_SWAP Position */ -#define CCAP_CTL_MY4_SWAP_Msk (0x1ul << CCAP_CTL_MY4_SWAP_Pos) /*!< CCAP_T::CTL: MY4_SWAP Mask */ - -#define CCAP_CTL_MY8_MY4_Pos (18) /*!< CCAP_T::CTL: MY8_MY4 Position */ -#define CCAP_CTL_MY8_MY4_Msk (0x1ul << CCAP_CTL_MY8_MY4_Pos) /*!< CCAP_T::CTL: MY8_MY4 Mask */ - -#define CCAP_CTL_Luma_Y_One_Pos (19) /*!< CCAP_T::CTL: Luma_Y_One Position */ -#define CCAP_CTL_Luma_Y_One_Msk (0x1ul << CCAP_CTL_Luma_Y_One_Pos) /*!< CCAP_T::CTL: Luma_Y_One Mask */ - -#define CCAP_CTL_UPDATE_Pos (20) /*!< CCAP_T::CTL: UPDATE Position */ -#define CCAP_CTL_UPDATE_Msk (0x1ul << CCAP_CTL_UPDATE_Pos) /*!< CCAP_T::CTL: UPDATE Mask */ - -#define CCAP_CTL_VPRST_Pos (24) /*!< CCAP_T::CTL: VPRST Position */ -#define CCAP_CTL_VPRST_Msk (0x1ul << CCAP_CTL_VPRST_Pos) /*!< CCAP_T::CTL: VPRST Mask */ - -#define CCAP_PAR_INFMT_Pos (0) /*!< CCAP_T::PAR: INFMT Position */ -#define CCAP_PAR_INFMT_Msk (0x1ul << CCAP_PAR_INFMT_Pos) /*!< CCAP_T::PAR: INFMT Mask */ - -#define CCAP_PAR_SENTYPE_Pos (1) /*!< CCAP_T::PAR: SENTYPE Position */ -#define CCAP_PAR_SENTYPE_Msk (0x1ul << CCAP_PAR_SENTYPE_Pos) /*!< CCAP_T::PAR: SENTYPE Mask */ - -#define CCAP_PAR_INDATORD_Pos (2) /*!< CCAP_T::PAR: INDATORD Position */ -#define CCAP_PAR_INDATORD_Msk (0x3ul << CCAP_PAR_INDATORD_Pos) /*!< CCAP_T::PAR: INDATORD Mask */ - -#define CCAP_PAR_OUTFMT_Pos (4) /*!< CCAP_T::PAR: OUTFMT Position */ -#define CCAP_PAR_OUTFMT_Msk (0x3ul << CCAP_PAR_OUTFMT_Pos) /*!< CCAP_T::PAR: OUTFMT Mask */ - -#define CCAP_PAR_RANGE_Pos (6) /*!< CCAP_T::PAR: RANGE Position */ -#define CCAP_PAR_RANGE_Msk (0x1ul << CCAP_PAR_RANGE_Pos) /*!< CCAP_T::PAR: RANGE Mask */ - -#define CCAP_PAR_PLNFMT_Pos (7) /*!< CCAP_T::PAR: PLNFMT Position */ -#define CCAP_PAR_PLNFMT_Msk (0x1ul << CCAP_PAR_PLNFMT_Pos) /*!< CCAP_T::PAR: PLNFMT Mask */ - -#define CCAP_PAR_PCLKP_Pos (8) /*!< CCAP_T::PAR: PCLKP Position */ -#define CCAP_PAR_PCLKP_Msk (0x1ul << CCAP_PAR_PCLKP_Pos) /*!< CCAP_T::PAR: PCLKP Mask */ - -#define CCAP_PAR_HSP_Pos (9) /*!< CCAP_T::PAR: HSP Position */ -#define CCAP_PAR_HSP_Msk (0x1ul << CCAP_PAR_HSP_Pos) /*!< CCAP_T::PAR: HSP Mask */ - -#define CCAP_PAR_VSP_Pos (10) /*!< CCAP_T::PAR: VSP Position */ -#define CCAP_PAR_VSP_Msk (0x1ul << CCAP_PAR_VSP_Pos) /*!< CCAP_T::PAR: VSP Mask */ - -#define CCAP_PAR_COLORCTL_Pos (11) /*!< CCAP_T::PAR: COLORCTL Position */ -#define CCAP_PAR_COLORCTL_Msk (0x3ul << CCAP_PAR_COLORCTL_Pos) /*!< CCAP_T::PAR: COLORCTL Mask */ - -#define CCAP_PAR_FBB_Pos (18) /*!< CCAP_T::PAR: FBB Position */ -#define CCAP_PAR_FBB_Msk (0x1ul << CCAP_PAR_FBB_Pos) /*!< CCAP_T::PAR: FBB Mask */ - -#define CCAP_INT_VINTF_Pos (0) /*!< CCAP_T::INT: VINTF Position */ -#define CCAP_INT_VINTF_Msk (0x1ul << CCAP_INT_VINTF_Pos) /*!< CCAP_T::INT: VINTF Mask */ - -#define CCAP_INT_MEINTF_Pos (1) /*!< CCAP_T::INT: MEINTF Position */ -#define CCAP_INT_MEINTF_Msk (0x1ul << CCAP_INT_MEINTF_Pos) /*!< CCAP_T::INT: MEINTF Mask */ - -#define CCAP_INT_ADDRMINTF_Pos (3) /*!< CCAP_T::INT: ADDRMINTF Position */ -#define CCAP_INT_ADDRMINTF_Msk (0x1ul << CCAP_INT_ADDRMINTF_Pos) /*!< CCAP_T::INT: ADDRMINTF Mask */ - -#define CCAP_INT_MDINTF_Pos (4) /*!< CCAP_T::INT: MDINTF Position */ -#define CCAP_INT_MDINTF_Msk (0x1ul << CCAP_INT_MDINTF_Pos) /*!< CCAP_T::INT: MDINTF Mask */ - -#define CCAP_INT_VIEN_Pos (16) /*!< CCAP_T::INT: VIEN Position */ -#define CCAP_INT_VIEN_Msk (0x1ul << CCAP_INT_VIEN_Pos) /*!< CCAP_T::INT: VIEN Mask */ - -#define CCAP_INT_MEIEN_Pos (17) /*!< CCAP_T::INT: MEIEN Position */ -#define CCAP_INT_MEIEN_Msk (0x1ul << CCAP_INT_MEIEN_Pos) /*!< CCAP_T::INT: MEIEN Mask */ - -#define CCAP_INT_ADDRMIEN_Pos (19) /*!< CCAP_T::INT: ADDRMIEN Position */ -#define CCAP_INT_ADDRMIEN_Msk (0x1ul << CCAP_INT_ADDRMIEN_Pos) /*!< CCAP_T::INT: ADDRMIEN Mask */ - -#define CCAP_CWSP_CWSADDRH_Pos (0) /*!< CCAP_T::CWSP: CWSADDRH Position */ -#define CCAP_CWSP_CWSADDRH_Msk (0xffful << CCAP_CWSP_CWSADDRH_Pos) /*!< CCAP_T::CWSP: CWSADDRH Mask */ - -#define CCAP_CWSP_CWSADDRV_Pos (16) /*!< CCAP_T::CWSP: CWSADDRV Position */ -#define CCAP_CWSP_CWSADDRV_Msk (0x7fful << CCAP_CWSP_CWSADDRV_Pos) /*!< CCAP_T::CWSP: CWSADDRV Mask */ - -#define CCAP_CWS_CWW_Pos (0) /*!< CCAP_T::CWS: CWW Position */ -#define CCAP_CWS_CWW_Msk (0xffful << CCAP_CWS_CWW_Pos) /*!< CCAP_T::CWS: CWW Mask */ -#define CCAP_CWS_CWH_Pos (16) /*!< CCAP_T::CWS: CIWH Position */ -#define CCAP_CWS_CWH_Msk (0x7fful << CCAP_CWS_CWH_Pos) /*!< CCAP_T::CWS: CIWH Mask */ - -#define CCAP_PKTSL_PKTSHML_Pos (0) /*!< CCAP_T::PKTSL: PKTSHML Position */ -#define CCAP_PKTSL_PKTSHML_Msk (0xfful << CCAP_PKTSL_PKTSHML_Pos) /*!< CCAP_T::PKTSL: PKTSHML Mask */ - -#define CCAP_PKTSL_PKTSHNL_Pos (8) /*!< CCAP_T::PKTSL: PKTSHNL Position */ -#define CCAP_PKTSL_PKTSHNL_Msk (0xfful << CCAP_PKTSL_PKTSHNL_Pos) /*!< CCAP_T::PKTSL: PKTSHNL Mask */ - -#define CCAP_PKTSL_PKTSVML_Pos (16) /*!< CCAP_T::PKTSL: PKTSVML Position */ -#define CCAP_PKTSL_PKTSVML_Msk (0xfful << CCAP_PKTSL_PKTSVML_Pos) /*!< CCAP_T::PKTSL: PKTSVML Mask */ - -#define CCAP_PKTSL_PKTSVNL_Pos (24) /*!< CCAP_T::PKTSL: PKTSVNL Position */ -#define CCAP_PKTSL_PKTSVNL_Msk (0xfful << CCAP_PKTSL_PKTSVNL_Pos) /*!< CCAP_T::PKTSL: PKTSVNL Mask */ - -#define CCAP_FRCTL_FRM_Pos (0) /*!< CCAP_T::FRCTL: FRM Position */ -#define CCAP_FRCTL_FRM_Msk (0x3ful << CCAP_FRCTL_FRM_Pos) /*!< CCAP_T::FRCTL: FRM Mask */ - -#define CCAP_FRCTL_FRN_Pos (8) /*!< CCAP_T::FRCTL: FRN Position */ -#define CCAP_FRCTL_FRN_Msk (0x3ful << CCAP_FRCTL_FRN_Pos) /*!< CCAP_T::FRCTL: FRN Mask */ - -#define CCAP_STRIDE_PKTSTRIDE_Pos (0) /*!< CCAP_T::STRIDE: PKTSTRIDE Position */ -#define CCAP_STRIDE_PKTSTRIDE_Msk (0x3ffful << CCAP_STRIDE_PKTSTRIDE_Pos) /*!< CCAP_T::STRIDE: PKTSTRIDE Mask */ - -#define CCAP_STRIDE_PLNSTRIDE_Pos (16) /*!< CCAP_T::STRIDE: PLNSTRIDE Position */ -#define CCAP_STRIDE_PLNSTRIDE_Msk (0x3ffful << CCAP_STRIDE_PLNSTRIDE_Pos) /*!< CCAP_T::STRIDE: PLNSTRIDE Mask */ - -#define CCAP_FIFOTH_PLNVFTH_Pos (0) /*!< CCAP_T::FIFOTH: PLNVFTH Position */ -#define CCAP_FIFOTH_PLNVFTH_Msk (0xful << CCAP_FIFOTH_PLNVFTH_Pos) /*!< CCAP_T::FIFOTH: PLNVFTH Mask */ - -#define CCAP_FIFOTH_PLNUFTH_Pos (8) /*!< CCAP_T::FIFOTH: PLNUFTH Position */ -#define CCAP_FIFOTH_PLNUFTH_Msk (0xful << CCAP_FIFOTH_PLNUFTH_Pos) /*!< CCAP_T::FIFOTH: PLNUFTH Mask */ - -#define CCAP_FIFOTH_PLNYFTH_Pos (16) /*!< CCAP_T::FIFOTH: PLNYFTH Position */ -#define CCAP_FIFOTH_PLNYFTH_Msk (0x1ful << CCAP_FIFOTH_PLNYFTH_Pos) /*!< CCAP_T::FIFOTH: PLNYFTH Mask */ - -#define CCAP_FIFOTH_PKTFTH_Pos (24) /*!< CCAP_T::FIFOTH: PKTFTH Position */ -#define CCAP_FIFOTH_PKTFTH_Msk (0x1ful << CCAP_FIFOTH_PKTFTH_Pos) /*!< CCAP_T::FIFOTH: PKTFTH Mask */ - -#define CCAP_FIFOTH_OVF_Pos (31) /*!< CCAP_T::FIFOTH: OVF Position */ -#define CCAP_FIFOTH_OVF_Msk (0x1ul << CCAP_FIFOTH_OVF_Pos) /*!< CCAP_T::FIFOTH: OVF Mask */ - -#define CCAP_CMPADDR_CMPADDR_Pos (0) /*!< CCAP_T::CMPADDR: CMPADDR Position */ -#define CCAP_CMPADDR_CMPADDR_Msk (0xfffffffful << CCAP_CMPADDR_CMPADDR_Pos) /*!< CCAP_T::CMPADDR: CMPADDR Mask */ - -#define CCAP_PKTSM_PKTSHMH_Pos (0) /*!< CCAP_T::PKTSM: PKTSHMH Position */ -#define CCAP_PKTSM_PKTSHMH_Msk (0xfful << CCAP_PKTSM_PKTSHMH_Pos) /*!< CCAP_T::PKTSM: PKTSHMH Mask */ - -#define CCAP_PKTSM_PKTSHNH_Pos (8) /*!< CCAP_T::PKTSM: PKTSHNH Position */ -#define CCAP_PKTSM_PKTSHNH_Msk (0xfful << CCAP_PKTSM_PKTSHNH_Pos) /*!< CCAP_T::PKTSM: PKTSHNH Mask */ - -#define CCAP_PKTSM_PKTSVMH_Pos (16) /*!< CCAP_T::PKTSM: PKTSVMH Position */ -#define CCAP_PKTSM_PKTSVMH_Msk (0xfful << CCAP_PKTSM_PKTSVMH_Pos) /*!< CCAP_T::PKTSM: PKTSVMH Mask */ - -#define CCAP_PKTSM_PKTSVNH_Pos (24) /*!< CCAP_T::PKTSM: PKTSVNH Position */ -#define CCAP_PKTSM_PKTSVNH_Msk (0xfful << CCAP_PKTSM_PKTSVNH_Pos) /*!< CCAP_T::PKTSM: PKTSVNH Mask */ - -#define CCAP_PKTBA0_BASEADDR_Pos (0) /*!< CCAP_T::PKTBA0: BASEADDR Position */ -#define CCAP_PKTBA0_BASEADDR_Msk (0xfffffffful << CCAP_PKTBA0_BASEADDR_Pos) /*!< CCAP_T::PKTBA0: BASEADDR Mask */ - -/**@}*/ /* CCAP_CONST */ -/**@}*/ /* end of CCAP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __CCAP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/clk_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/clk_reg.h deleted file mode 100644 index 68016d805c5..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/clk_reg.h +++ /dev/null @@ -1,1698 +0,0 @@ -/**************************************************************************//** - * @file clk_reg.h - * @version V1.00 - * @brief CLK register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CLK_REG_H__ -#define __CLK_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CLK System Clock Controller(CLK) - Memory Mapped Structure for CLK Controller -@{ */ - -typedef struct -{ - - - /** - * @var CLK_T::PWRCTL - * Offset: 0x00 System Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTEN |HXT Enable Bit (Write Protect) - * | | |The bit default value is set by flash controller user configuration register CONFIG0 [26] - * | | |When the default clock source is from HXT, this bit is set to 1 automatically. - * | | |0 = 4~24 MHz external high speed crystal (HXT) Disabled. - * | | |1 = 4~24 MHz external high speed crystal (HXT) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |LXTEN |LXT Enable Bit (Write Protect) - * | | |0 = 32.768 kHz external low speed crystal (LXT) Disabled. - * | | |1 = 32.768 kHz external low speed crystal (LXT) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |HIRCEN |HIRC Enable Bit (Write Protect) - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) Disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |LIRCEN |LIRC Enable Bit (Write Protect) - * | | |0 = 10 kHz internal low speed RC oscillator (LIRC) Disabled. - * | | |1 = 10 kHz internal low speed RC oscillator (LIRC) Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |PDWKDLY |Enable the Wake-up Delay Counter (Write Protect) - * | | |When the chip wakes up from Power-down mode, the clock control will delay certain clock cycles to wait system clock stable. - * | | |The delayed clock cycle is 4096 clock cycles when chip works at 4~24 MHz external high speed crystal oscillator (HXT), and 256 clock cycles when chip works at 12 MHz internal high speed RC oscillator (HIRC). - * | | |0 = Clock cycles delay Disabled. - * | | |1 = Clock cycles delay Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |PDWKIEN |Power-down Mode Wake-up Interrupt Enable Bit (Write Protect) - * | | |0 = Power-down mode wake-up interrupt Disabled. - * | | |1 = Power-down mode wake-up interrupt Enabled. - * | | |Note1: The interrupt will occur when both PDWKIF and PDWKIEN are high. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |PDWKIF |Power-down Mode Wake-up Interrupt Status - * | | |Set by "Power-down wake-up event", it indicates that resume from Power-down mode. - * | | |The flag is set if any wake-up source is occurred. Refer Power Modes and Wake-up Sources chapter. - * | | |Note1: Write 1 to clear the bit to 0. - * | | |Note2: This bit works only if PDWKIEN (CLK_PWRCTL[5]) set to 1. - * |[7] |PDEN |System Power-down Enable (Write Protect) - * | | |When this bit is set to 1, Power-down mode is enabled and chip keeps active till the CPU sleep mode is also active and then the chip enters Power-down mode. - * | | |When chip wakes up from Power-down mode, this bit is auto cleared - * | | |Users need to set this bit again for next Power-down. - * | | |In Power-down mode, HXT and the HIRC will be disabled in this mode, but LXT and LIRC are not controlled by Power-down mode. - * | | |In Power-down mode, the PLL and system clock are disabled, and ignored the clock source selection - * | | |The clocks of peripheral are not controlled by Power-down mode, if the peripheral clock source is from LXT or LIRC. - * | | |0 = Chip will not enter Power-down mode after CPU sleep command WFI. - * | | |1 = Chip enters Power-down mode after CPU sleep command WFI. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11:10] |HXTGAIN |HXT Gain Control Bit (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |Gain control is used to enlarge the gain of crystal to make sure crystal work normally - * | | |If gain control is enabled, crystal will consume more power than gain control off. - * | | |00 = HXT frequency is lower than from 8 MHz. - * | | |01 = HXT frequency is from 8 MHz to 12 MHz. - * | | |10 = HXT frequency is from 12 MHz to 16 MHz. - * | | |11 = HXT frequency is higher than 16 MHz. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |HXTSELTYP |HXT Crystal Type Select Bit (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |0 = Select INV type. - * | | |1 = Select GM type. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |HXTTBEN |HXT Crystal TURBO Mode (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |0 = HXT Crystal TURBO mode disabled. - * | | |1 = HXT Crystal TURBO mode enabled. - * |[17:16] |HIRCSTBS |HIRC Stable Count Select (Write Protect) - * | | |00 = HIRC stable count is 64 clocks. - * | | |01 = HIRC stable count is 24 clocks. - * | | |others = Reserved. - * |[18] |HIRCEN |HIRC48M Enable Bit (Write Protect) - * | | |0 = 48 MHz internal high speed RC oscillator (HIRC) Disabled. - * | | |1 = 48 MHz internal high speed RC oscillator (HIRC) Enabled. - * @var CLK_T::AHBCLK - * Offset: 0x04 AHB Devices Clock Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |PDMACKEN |PDMA Controller Clock Enable Bit - * | | |0 = PDMA peripheral clock Disabled. - * | | |1 = PDMA peripheral clock Enabled. - * |[2] |ISPCKEN |Flash ISP Controller Clock Enable Bit - * | | |0 = Flash ISP peripheral clock Disabled. - * | | |1 = Flash ISP peripheral clock Enabled. - * |[3] |EBICKEN |EBI Controller Clock Enable Bit - * | | |0 = EBI peripheral clock Disabled. - * | | |1 = EBI peripheral clock Enabled. - * |[5] |EMACCKEN |Ethernet Controller Clock Enable Bit - * | | |0 = Ethernet Controller engine clock Disabled. - * | | |1 = Ethernet Controller engine clock Enabled. - * |[6] |SDH0CKEN |SD0 Controller Clock Enable Bit - * | | |0 = SD0 engine clock Disabled. - * | | |1 = SD0 engine clock Enabled. - * |[7] |CRCCKEN |CRC Generator Controller Clock Enable Bit - * | | |0 = CRC peripheral clock Disabled. - * | | |1 = CRC peripheral clock Enabled. - * |[10] |HSUSBDCKEN|HSUSB Device Clock Enable Bit - * | | |0 = HSUSB device controller's clock Disabled. - * | | |1 = HSUSB device controller's clock Enabled. - * |[12] |CRPTCKEN |Cryptographic Accelerator Clock Enable Bit - * | | |0 = Cryptographic Accelerator clock Disabled. - * | | |1 = Cryptographic Accelerator clock Enabled. - * |[14] |SPIMCKEN |SPIM Controller Clock Enable Bit - * | | |0 = SPIM controller clock Disabled. - * | | |1 = SPIM controller clock Enabled. - * |[15] |FMCIDLE |Flash Memory Controller Clock Enable Bit in IDLE Mode - * | | |0 = FMC clock Disabled when chip is under IDLE mode. - * | | |1 = FMC clock Enabled when chip is under IDLE mode. - * |[16] |USBHCKEN |USB HOST Controller Clock Enable Bit - * | | |0 = USB HOST peripheral clock Disabled. - * | | |1 = USB HOST peripheral clock Enabled. - * |[17] |SDH1CKEN |SD1 Controller Clock Enable Bit - * | | |0 = SD1 engine clock Disabled. - * | | |1 = SD1 engine clock Enabled. - * @var CLK_T::APBCLK0 - * Offset: 0x08 APB Devices Clock Enable Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDTCKEN |Watchdog Timer Clock Enable Bit (Write Protect) - * | | |0 = Watchdog timer clock Disabled. - * | | |1 = Watchdog timer clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |RTCCKEN |Real-time-clock APB Interface Clock Enable Bit - * | | |This bit is used to control the RTC APB clock only - * | | |The RTC peripheral clock source is selected from RTCSEL(CLK_CLKSEL3[8]) - * | | |It can be selected to 32.768 kHz external low speed crystal or 10 kHz internal low speed RC oscillator (LIRC). - * | | |0 = RTC clock Disabled. - * | | |1 = RTC clock Enabled. - * |[2] |TMR0CKEN |Timer0 Clock Enable Bit - * | | |0 = Timer0 clock Disabled. - * | | |1 = Timer0 clock Enabled. - * |[3] |TMR1CKEN |Timer1 Clock Enable Bit - * | | |0 = Timer1 clock Disabled. - * | | |1 = Timer1 clock Enabled. - * |[4] |TMR2CKEN |Timer2 Clock Enable Bit - * | | |0 = Timer2 clock Disabled. - * | | |1 = Timer2 clock Enabled. - * |[5] |TMR3CKEN |Timer3 Clock Enable Bit - * | | |0 = Timer3 clock Disabled. - * | | |1 = Timer3 clock Enabled. - * |[6] |CLKOCKEN |CLKO Clock Enable Bit - * | | |0 = CLKO clock Disabled. - * | | |1 = CLKO clock Enabled. - * |[7] |ACMP01CKEN|Analog Comparator 0/1 Clock Enable Bit - * | | |0 = Analog comparator 0/1 clock Disabled. - * | | |1 = Analog comparator 0/1 clock Enabled. - * |[8] |I2C0CKEN |I2C0 Clock Enable Bit - * | | |0 = I2C0 clock Disabled. - * | | |1 = I2C0 clock Enabled. - * |[9] |I2C1CKEN |I2C1 Clock Enable Bit - * | | |0 = I2C1 clock Disabled. - * | | |1 = I2C1 clock Enabled. - * |[10] |I2C2CKEN |I2C2 Clock Enable Bit - * | | |0 = I2C2 clock Disabled. - * | | |1 = I2C2 clock Enabled. - * |[12] |QSPI0CKEN |QSPI0 Clock Enable Bit - * | | |0 = QSPI0 clock Disabled. - * | | |1 = QSPI0 clock Enabled. - * |[13] |SPI0CKEN |SPI0 Clock Enable Bit - * | | |0 = SPI0 clock Disabled. - * | | |1 = SPI0 clock Enabled. - * |[14] |SPI1CKEN |SPI1 Clock Enable Bit - * | | |0 = SPI1 clock Disabled. - * | | |1 = SPI1 clock Enabled. - * |[15] |SPI2CKEN |SPI2 Clock Enable Bit - * | | |0 = SPI2 clock Disabled. - * | | |1 = SPI2 clock Enabled. - * |[16] |UART0CKEN |UART0 Clock Enable Bit - * | | |0 = UART0 clock Disabled. - * | | |1 = UART0 clock Enabled. - * |[17] |UART1CKEN |UART1 Clock Enable Bit - * | | |0 = UART1 clock Disabled. - * | | |1 = UART1 clock Enabled. - * |[18] |UART2CKEN |UART2 Clock Enable Bit - * | | |0 = UART2 clock Disabled. - * | | |1 = UART2 clock Enabled. - * |[19] |UART3CKEN |UART3 Clock Enable Bit - * | | |0 = UART3 clock Disabled. - * | | |1 = UART3 clock Enabled. - * |[20] |UART4CKEN |UART4 Clock Enable Bit - * | | |0 = UART4 clock Disabled. - * | | |1 = UART4 clock Enabled. - * |[21] |UART5CKEN |UART5 Clock Enable Bit - * | | |0 = UART5 clock Disabled. - * | | |1 = UART5 clock Enabled. - * |[24] |CAN0CKEN |CAN0 Clock Enable Bit - * | | |0 = CAN0 clock Disabled. - * | | |1 = CAN0 clock Enabled. - * |[25] |CAN1CKEN |CAN1 Clock Enable Bit - * | | |0 = CAN1 clock Disabled. - * | | |1 = CAN1 clock Enabled. - * |[26] |OTGCKEN |USB OTG Clock Enable Bit - * | | |0 = USB OTG clock Disabled. - * | | |1 = USB OTG clock Enabled. - * |[27] |USBDCKEN |USB Device Clock Enable Bit - * | | |0 = USB Device clock Disabled. - * | | |1 = USB Device clock Enabled. - * |[28] |EADCCKEN |Enhanced Analog-digital-converter (EADC) Clock Enable Bit - * | | |0 = EADC clock Disabled. - * | | |1 = EADC clock Enabled. - * |[29] |I2S0CKEN |I2S0 Clock Enable Bit - * | | |0 = I2S0 Clock Disabled. - * | | |1 = I2S0 Clock Enabled. - * |[30] |HSOTGCKEN |HSUSB OTG Clock Enable Bit - * | | |0 = HSUSB OTG clock Disabled. - * | | |1 = HSUSB OTG clock Enabled. - * @var CLK_T::APBCLK1 - * Offset: 0x0C APB Devices Clock Enable Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SC0CKEN |SC0 Clock Enable Bit - * | | |0 = SC0 clock Disabled. - * | | |1 = SC0 clock Enabled. - * |[1] |SC1CKEN |SC1 Clock Enable Bit - * | | |0 = SC1 clock Disabled. - * | | |1 = SC1 clock Enabled. - * |[2] |SC2CKEN |SC2 Clock Enable Bit - * | | |0 = SC2 clock Disabled. - * | | |1 = SC2 clock Enabled. - * |[6] |SPI3CKEN |SPI3 Clock Enable Bit - * | | |0 = SPI3 clock Disabled. - * | | |1 = SPI3 clock Enabled. - * |[8] |USCI0CKEN |USCI0 Clock Enable Bit - * | | |0 = USCI0 clock Disabled. - * | | |1 = USCI0 clock Enabled. - * |[9] |USCI1CKEN |USCI1 Clock Enable Bit - * | | |0 = USCI1 clock Disabled. - * | | |1 = USCI1 clock Enabled. - * |[12] |DACCKEN |DAC Clock Enable Bit - * | | |0 = DAC clock Disabled. - * | | |1 = DAC clock Enabled. - * |[16] |EPWM0CKEN |EPWM0 Clock Enable Bit - * | | |0 = EPWM0 clock Disabled. - * | | |1 = EPWM0 clock Enabled. - * |[17] |EPWM1CKEN |EPWM1 Clock Enable Bit - * | | |0 = EPWM1 clock Disabled. - * | | |1 = EPWM1 clock Enabled. - * |[18] |BPWM0CKEN |BPWM0 Clock Enable Bit - * | | |0 = BPWM0 clock Disabled. - * | | |1 = BPWM0 clock Enabled. - * |[19] |BPWM1CKEN |BPWM1 Clock Enable Bit - * | | |0 = BPWM1 clock Disabled. - * | | |1 = BPWM1 clock Enabled. - * |[22] |QEI0CKEN |QEI0 Clock Enable Bit - * | | |0 = QEI0 clock Disabled. - * | | |1 = QEI0 clock Enabled. - * |[23] |QEI1CKEN |QEI1 Clock Enable Bit - * | | |0 = QEI1 clock Disabled. - * | | |1 = QEI1 clock Enabled. - * |[26] |ECAP0CKEN |ECAP0 Clock Enable Bit - * | | |0 = ECAP0 clock Disabled. - * | | |1 = ECAP0 clock Enabled. - * |[27] |ECAP1CKEN |ECAP1 Clock Enable Bit - * | | |0 = ECAP1 clock Disabled. - * | | |1 = ECAP1 clock Enabled. - * |[30] |OPACKEN |OP Amplifier (OPA) Clock Enable Bit - * | | |0 = OPA clock Disabled. - * | | |1 = OPA clock Enabled. - * @var CLK_T::CLKSEL0 - * Offset: 0x10 Clock Source Select Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |HCLKSEL |HCLK Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |The default value is reloaded from the value of CFOSC (CONFIG0[26]) in user configuration register of Flash controller by any reset - * | | |Therefore the default value is either 000b or 111b. - * | | |000 = Clock source from HXT. - * | | |001 = Clock source from LXT. - * | | |010 = Clock source from PLL. - * | | |011 = Clock source from LIRC. - * | | |111 = Clock source from HIRC. - * | | |Other = Reserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5:3] |STCLKSEL |Cortex-M4 SysTick Clock Source Selection (Write Protect) - * | | |If SYST_CTRL[2]=0, SysTick uses listed clock source below. - * | | |000 = Clock source from HXT. - * | | |001 = Clock source from LXT. - * | | |010 = Clock source from HXT/2. - * | | |011 = Clock source from HCLK/2. - * | | |111 = Clock source from HIRC/2. - * | | |Note: if SysTick clock source is not from HCLK (i.e - * | | |SYST_CTRL[2] = 0), SysTick clock source must less than or equal to HCLK/2. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |USBSEL |USB Clock Source Selection (Write Protect) - * | | |0 = Clock source from RC48M. - * | | |1 = Clock source from PLL. - * |[21:20] |SDH0SEL |SD0 Engine Clock Source Selection (Write Protect) - * | | |00 = Clock source from HXT clock. - * | | |01 = Clock source from PLL clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from HIRC clock. - * |[23:22] |SDH1SEL |SD1 Engine Clock Source Selection (Write Protect) - * | | |00 = Clock source from HXT clock. - * | | |01 = Clock source from PLL clock. - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from HIRC clock. - * @var CLK_T::CLKSEL1 - * Offset: 0x14 Clock Source Select Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WDTSEL |Watchdog Timer Clock Source Selection (Write Protect) - * | | |00 = Reserved. - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10:8] |TMR0SEL |TIMER0 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM0 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[14:12] |TMR1SEL |TIMER1 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM1 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[18:16] |TMR2SEL |TIMER2 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM2 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[22:20] |TMR3SEL |TIMER3 Clock Source Selection - * | | |000 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM3 pin. - * | | |101 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[25:24] |UART0SEL |UART0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[27:26] |UART1SEL |UART1 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[29:28] |CLKOSEL |Clock Divider Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from HCLK. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[31:30] |WWDTSEL |Window Watchdog Timer Clock Source Selection - * | | |10 = Clock source from HCLK/2048. - * | | |11 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * @var CLK_T::CLKSEL2 - * Offset: 0x18 Clock Source Select Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EPWM0SEL |EPWM0 Clock Source Selection - * | | |The peripheral clock source of EPWM0 is defined by EPWM0SEL. - * | | |0 = Clock source from PLL. - * | | |1 = Clock source from PCLK0. - * |[1] |EPWM1SEL |EPWM1 Clock Source Selection - * | | |The peripheral clock source of EPWM1 is defined by EPWM1SEL. - * | | |0 = Clock source from PLL. - * | | |1 = Clock source from PCLK1. - * |[3:2] |QSPI0SEL |QSPI0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[5:4] |SPI0SEL |SPI0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[7:6] |SPI1SEL |SPI1 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[8] |BPWM0SEL |BPWM0 Clock Source Selection - * | | |The peripheral clock source of BPWM0 is defined by BPWM0SEL. - * | | |0 = Clock source from PLL. - * | | |1 = Clock source from PCLK0. - * |[9] |BPWM1SEL |BPWM1 Clock Source Selection - * | | |The peripheral clock source of BPWM1 is defined by BPWM1SEL. - * | | |0 = Clock source from PLL. - * | | |1 = Clock source from PCLK1. - * |[11:10] |SPI2SEL |SPI2 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[13:12] |SPI3SEL |SPI3 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * @var CLK_T::CLKSEL3 - * Offset: 0x1C Clock Source Select Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SC0SEL |SC0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[3:2] |SC1SEL |SC0 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[5:4] |SC2SEL |SC2 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[8] |RTCSEL |RTC Clock Source Selection - * | | |0 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |1 = Clock source from 10 kHz internal low speed RC oscillator (LIRC). - * |[17:16] |I2S0SEL |I2S0 Clock Source Selection - * | | |00 = Clock source from HXT clock. - * | | |01 = Clock source from PLL clock. - * | | |10 = Clock source from PCLK. - * | | |11 = Clock source from HIRC clock. - * |[25:24] |UART2SEL |UART2 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[27:26] |UART3SEL |UART3 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[29:28] |UART4SEL |UART4 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[31:30] |UART5SEL |UART5 Clock Source Selection - * | | |00 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from PLL. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * @var CLK_T::CLKDIV0 - * Offset: 0x20 Clock Divider Number Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |HCLKDIV |HCLK Clock Divide Number From HCLK Clock Source - * | | |HCLK clock frequency = (HCLK clock source frequency) / (HCLKDIV + 1). - * |[7:4] |USBDIV |USB Clock Divide Number From PLL Clock - * | | |USB clock frequency = (PLL frequency) / (USBDIV + 1). - * |[11:8] |UART0DIV |UART0 Clock Divide Number From UART0 Clock Source - * | | |UART0 clock frequency = (UART0 clock source frequency) / (UART0DIV + 1). - * |[15:12] |UART1DIV |UART1 Clock Divide Number From UART1 Clock Source - * | | |UART1 clock frequency = (UART1 clock source frequency) / (UART1DIV + 1). - * |[23:16] |EADCDIV |EADC Clock Divide Number From EADC Clock Source - * | | |EADC clock frequency = (EADC clock source frequency) / (EADCDIV + 1). - * |[31:24] |SDH0DIV |SD0 Clock Divide Number From SD0 Clock Source - * | | |SD0 clock frequency = (SD0 clock source frequency) / (SDH0DIV + 1). - * @var CLK_T::CLKDIV1 - * Offset: 0x24 Clock Divider Number Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SC0DIV |SC0 Clock Divide Number From SC0 Clock Source - * | | |SC0 clock frequency = (SC0 clock source frequency ) / (SC0DIV + 1). - * |[15:8] |SC1DIV |SC1 Clock Divide Number From SC1 Clock Source - * | | |SC1 clock frequency = (SC1 clock source frequency ) / (SC1DIV + 1). - * |[23:16] |SC2DIV |SC2 Clock Divide Number From SC2 Clock Source - * | | |SC2 clock frequency = (SC2 clock source frequency ) / (SC2DIV + 1). - * @var CLK_T::CLKDIV3 - * Offset: 0x2C Clock Divider Number Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |EMACDIV |Ethernet Clock Divide Number Form HCLK - * | | |EMAC MDCLK clock frequency = (HCLK) / (EMACDIV + 1). - * |[31:24] |SDH1DIV |SD1 Clock Divide Number From SD1 Clock Source - * | | |SD1 clock frequency = (SD1 clock source frequency) / (SDH1DIV + 1). - * @var CLK_T::CLKDIV4 - * Offset: 0x30 Clock Divider Number Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |UART2DIV |UART2 Clock Divide Number From UART2 Clock Source - * | | |UART2 clock frequency = (UART2 clock source frequency) / (UART2DIV + 1). - * |[7:4] |UART3DIV |UART3 Clock Divide Number From UART3 Clock Source - * | | |UART3 clock frequency = (UART3 clock source frequency) / (UART3DIV + 1). - * |[11:8] |UART4DIV |UART4 Clock Divide Number From UART4 Clock Source - * | | |UART4 clock frequency = (UART4 clock source frequency) / (UART4DIV + 1). - * |[15:12] |UART5DIV |UART5 Clock Divide Number From UART5 Clock Source - * | | |UART5 clock frequency = (UART5 clock source frequency) / (UART5DIV + 1). - * @var CLK_T::PCLKDIV - * Offset: 0x34 APB Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |APB0DIV |APB0 Clock Divider - * | | |APB0 clock can be divided from HCLK - * | | |000: PCLK0 = HCLK. - * | | |001: PCLK0 = 1/2 HCLK. - * | | |010: PCLK0 = 1/4 HCLK. - * | | |011: PCLK0 = 1/8 HCLK. - * | | |100: PCLK0 = 1/16 HCLK. - * | | |Others: Reserved. - * |[6:4] |APB1DIV |APB1 Clock Divider - * | | |APB1 clock can be divided from HCLK - * | | |000: PCLK1 = HCLK. - * | | |001: PCLK1 = 1/2 HCLK. - * | | |010: PCLK1 = 1/4 HCLK. - * | | |011: PCLK1 = 1/8 HCLK. - * | | |100: PCLK1 = 1/16 HCLK. - * | | |Others: Reserved. - * @var CLK_T::PLLCTL - * Offset: 0x40 PLL Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Refer to the formulas below the table. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13:9] |INDIV |PLL Input Divider Control (Write Protect) - * | | |Refer to the formulas below the table. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[15:14] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Refer to the formulas below the table. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |PD |Power-down Mode (Write Protect) - * | | |If set the PDEN bit to 1 in CLK_PWRCTL register, the PLL will enter Power-down mode, too. - * | | |0 = PLL is in normal mode. - * | | |1 = PLL is in Power-down mode (default). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock FIN. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[18] |OE |PLL OE (FOUT Enable) Pin Control (Write Protect) - * | | |0 = PLL FOUT Enabled. - * | | |1 = PLL FOUT is fixed low. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[19] |PLLSRC |PLL Source Clock Selection (Write Protect) - * | | |0 = PLL source clock from 4~24 MHz external high-speed crystal oscillator (HXT). - * | | |1 = PLL source clock from 12 MHz internal high-speed oscillator (HIRC). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |STBSEL |PLL Stable Counter Selection (Write Protect) - * | | |0 = PLL stable time is 6144 PLL source clock (suitable for source clock is equal to or less than 12 MHz). - * | | |1 = PLL stable time is 12288 PLL source clock (suitable for source clock is larger than 12 MHz). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::STATUS - * Offset: 0x50 Clock Status Monitor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTSTB |HXT Clock Source Stable Flag (Read Only) - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock is not stable or disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock is stable and enabled. - * |[1] |LXTSTB |LXT Clock Source Stable Flag (Read Only) - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is not stable or disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock is stabled and enabled. - * |[2] |PLLSTB |Internal PLL Clock Source Stable Flag (Read Only) - * | | |0 = Internal PLL clock is not stable or disabled. - * | | |1 = Internal PLL clock is stable and enabled. - * |[3] |LIRCSTB |LIRC Clock Source Stable Flag (Read Only) - * | | |0 = 10 kHz internal low speed RC oscillator (LIRC) clock is not stable or disabled. - * | | |1 = 10 kHz internal low speed RC oscillator (LIRC) clock is stable and enabled. - * |[4] |HIRCSTB |HIRC Clock Source Stable Flag (Read Only) - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) clock is not stable or disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) clock is stable and enabled. - * | | |Note: This bit is read only. - * |[6] |HIRC48MSTB|HIRC 48MHz Clock Source Stable Flag (Read Only) - * | | |0 = 48 MHz internal high speed RC oscillator (HIRC) clock is not stable or disabled. - * | | |1 = 48 MHz internal high speed RC oscillator (HIRC) clock is stable and enabled. - * | | |Note: This bit is read only. - * |[7] |CLKSFAIL |Clock Switching Fail Flag (Read Only) - * | | |This bit is updated when software switches system clock source - * | | |If switch target clock is stable, this bit will be set to 0 - * | | |If switch target clock is not stable, this bit will be set to 1. - * | | |0 = Clock switching success. - * | | |1 = Clock switching failure. - * | | |Note: Write 1 to clear the bit to 0. - * @var CLK_T::CLKOCTL - * Offset: 0x60 Clock Output Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |FREQSEL |Clock Output Frequency Selection - * | | |The formula of output frequency is - * | | |Fout = Fin/2(N+1). - * | | |Fin is the input clock frequency. - * | | |Fout is the frequency of divider output clock. - * | | |N is the 4-bit value of FREQSEL[3:0]. - * |[4] |CLKOEN |Clock Output Enable Bit - * | | |0 = Clock Output function Disabled. - * | | |1 = Clock Output function Enabled. - * |[5] |DIV1EN |Clock Output Divide One Enable Bit - * | | |0 = Clock Output will output clock with source frequency divided by FREQSEL. - * | | |1 = Clock Output will output clock with source frequency. - * |[6] |CLK1HZEN |Clock Output 1Hz Enable Bit - * | | |0 = 1 Hz clock output for 32.768 kHz frequency compensation Disabled. - * | | |1 = 1 Hz clock output for 32.768 kHz frequency compensation Enabled. - * @var CLK_T::CLKDCTL - * Offset: 0x70 Clock Fail Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |HXTFDEN |HXT Clock Fail Detector Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail detector Enabled. - * |[5] |HXTFIEN |HXT Clock Fail Interrupt Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Enabled. - * |[12] |LXTFDEN |LXT Clock Fail Detector Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Enabled. - * |[13] |LXTFIEN |LXT Clock Fail Interrupt Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Enabled. - * |[16] |HXTFQDEN |HXT Clock Frequency Range Detector Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector Enabled. - * |[17] |HXTFQIEN |HXT Clock Frequency Range Detector Interrupt Enable Bit - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector fail interrupt Disabled. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency range detector fail interrupt Enabled. - * @var CLK_T::CLKDSTS - * Offset: 0x74 Clock Fail Detector Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFIF |HXT Clock Fail Interrupt Flag - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock is normal. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock stops. - * | | |Note: Write 1 to clear the bit to 0. - * |[1] |LXTFIF |LXT Clock Fail Interrupt Flag - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is normal. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) stops. - * | | |Note: Write 1 to clear the bit to 0. - * |[8] |HXTFQIF |HXT Clock Frequency Range Detector Interrupt Flag - * | | |0 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency is normal. - * | | |1 = 4~24 MHz external high speed crystal oscillator (HXT) clock frequency is abnormal. - * | | |Note: Write 1 to clear the bit to 0. - * @var CLK_T::CDUPB - * Offset: 0x78 Clock Frequency Range Detector Upper Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |UPERBD |HXT Clock Frequency Range Detector Upper Boundary Value - * | | |The bits define the maximum value of frequency range detector window. - * | | |When HXT frequency higher than this maximum frequency value, the HXT Clock Frequency Range Detector Interrupt Flag will set to 1. - * @var CLK_T::CDLOWB - * Offset: 0x7C Clock Frequency Range Detector Lower Boundary Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |LOWERBD |HXT Clock Frequency Range Detector Lower Boundary Value - * | | |The bits define the minimum value of frequency range detector window. - * | | |When HXT frequency lower than this minimum frequency value, the HXT Clock Frequency Range Detector Interrupt Flag will set to 1. - * @var CLK_T::PMUCTL - * Offset: 0x90 Power Manager Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |PDMSEL |Power-down Mode Selection (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |These bits control chip power-down mode grade selection when CPU execute WFI/WFE instruction. - * | | |000 = Power-down mode is selected. (PD) - * | | |001 = Low leakage Power-down mode is selected (LLPD). - * | | |010 =Fast wake-up Power-down mode is selected (FWPD). - * | | |011 = Reserved. - * | | |100 = Standby Power-down mode 0 is selected (SPD0) (SRAM retention). - * | | |101 = Standby Power-down mode 1 is selected (SPD1). - * | | |110 = Deep Power-down mode is selected (DPD). - * | | |111 = Reserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |DPDHOLDEN |Deep-Power-Down Mode GPIO Hold Enable - * | | |0 = When GPIO enters deep power-down mode, all I/O status are tri-state. - * | | |1 = When GPIO enters deep power-down mode, all I/O status are hold to keep normal operating status. - * | | | After chip was waked up from deep power-down mode, the I/O are still keep hold status until user set CLK_IOPDCTL[0] - * | | | to release I/O hold status. - * |[8] |WKTMREN |Wake-up Timer Enable (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |0 = Wake-up timer disable at DPD/SPD mode. - * | | |1 = Wake-up timer enabled at DPD/SPD mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11:9] |WKTMRIS |Wake-up Timer Time-out Interval Select (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |These bits control wake-up timer time-out interval when chip at DPD/SPD mode. - * | | |000 = Time-out interval is 128 OSC10K clocks (12.8 ms). - * | | |001 = Time-out interval is 256 OSC10K clocks (25.6 ms). - * | | |010 = Time-out interval is 512 OSC10K clocks (51.2 ms). - * | | |011 = Time-out interval is 1024 OSC10K clocks (102.4ms). - * | | |100 = Time-out interval is 4096 OSC10K clocks (409.6ms). - * | | |101 = Time-out interval is 8192 OSC10K clocks (819.2ms). - * | | |110 = Time-out interval is 16384 OSC10K clocks (1638.4ms). - * | | |111 = Time-out interval is 65536 OSC10K clocks (6553.6ms). - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17:16] |WKPINEN |Wake-up Pin Enable (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |00 = Wake-up pin disable at Deep Power-down mode. - * | | |01 = Wake-up pin rising edge enabled at Deep Power-down mode. - * | | |10 = Wake-up pin falling edge enabled at Deep Power-down mode. - * | | |11 = Wake-up pin both edge enabled at Deep Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[18] |ACMPSPWK |ACMP Standby Power-down Mode Wake-up Enable (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |0 = ACMP wake-up disable at Standby Power-down mode. - * | | |1 = ACMP wake-up enabled at Standby Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[23] |RTCWKEN |RTC Wake-up Enable (Write Protect) - * | | |This is a protected register. Please refer to open lock sequence to program it. - * | | |0 = RTC wake-up disable at Deep Power-down mode or Standby Power-down mode. - * | | |1 = RTC wake-up enabled at Deep Power-down mode or Standby Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var CLK_T::PMUSTS - * Offset: 0x94 Power Manager Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINWK |Pin Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode was requested by a transition of the WAKEUP pin (GPC.0) - * | | |This flag is cleared when DPD mode is entered. - * |[1] |TMRWK |Timer Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Deep Power-down mode (DPD) or Standby Power-down (SPD) mode was requested by wakeup timer time-out - * | | |This flag is cleared when DPD or SPD mode is entered. - * |[2] |RTCWK |RTC Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Deep Power-down mode (DPD) or Standby Power-down (SPD) mode was requested with a RTC alarm, tick time or tamper happened - * | | |This flag is cleared when DPD or SPD mode is entered. - * |[8] |GPAWK |GPA Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPA group pins - * | | |This flag is cleared when SPD mode is entered. - * |[9] |GPBWK |GPB Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPB group pins - * | | |This flag is cleared when SPD mode is entered. - * |[10] |GPCWK |GPC Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPC group pins - * | | |This flag is cleared when SPD mode is entered. - * |[11] |GPDWK |GPD Wake-up Flag (Read Only) - * | | |This flag indicates that wake-up of chip from Standby Power-down mode was requested by a transition of selected one GPD group pins - * | | |This flag is cleared when SPD mode is entered. - * |[12] |LVRWK |LVR Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode was requested with a LVR happened - * | | |This flag is cleared when SPD mode is entered. - * |[13] |BODWK |BOD Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with a BOD happened - * | | |This flag is cleared when SPD mode is entered. - * |[14] |ACMPWK |ACMP Wake-up Flag (Read Only) - * | | |This flag indicates that wakeup of device from Standby Power-down mode (SPD) was requested with a ACMP transition - * | | |This flag is cleared when SPD mode is entered. - * |[31] |CLRWK |Clear Wake-up Flag - * | | |0 = No clear. - * | | |1 = Clear all wake-up flag. - * @var CLK_T::LDOCTL - * Offset: 0x98 LDO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18] |PDBIASEN |Power-down Bias Enable Bit - * | | |0 = Reserved. - * | | |1 = Power-down bias enabled. - * | | |Note: This bit should set to 1 before chip enter power-down mode. - * @var CLK_T::SWKDBCTL - * Offset: 0x9C Standby Power-down Wake-up De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SWKDBCLKSEL|Standby Power-down Wake-up De-bounce Sampling Cycle Selection - * | | |0000 = Sample wake-up input once per 1 clocks. - * | | |0001 = Sample wake-up input once per 2 clocks. - * | | |0010 = Sample wake-up input once per 4 clocks. - * | | |0011 = Sample wake-up input once per 8 clocks. - * | | |0100 = Sample wake-up input once per 16 clocks. - * | | |0101 = Sample wake-up input once per 32 clocks. - * | | |0110 = Sample wake-up input once per 64 clocks. - * | | |0111 = Sample wake-up input once per 128 clocks. - * | | |1000 = Sample wake-up input once per 256 clocks. - * | | |1001 = Sample wake-up input once per 2*256 clocks. - * | | |1010 = Sample wake-up input once per 4*256 clocks. - * | | |1011 = Sample wake-up input once per 8*256 clocks. - * | | |1100 = Sample wake-up input once per 16*256 clocks. - * | | |1101 = Sample wake-up input once per 32*256 clocks. - * | | |1110 = Sample wake-up input once per 64*256 clocks. - * | | |1111 = Sample wake-up input once per 128*256 clocks. - * | | |Note: De-bounce counter clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * @var CLK_T::PASWKCTL - * Offset: 0xA0 GPA Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPA group pin wake-up function disabled. - * | | |1 = GPA group pin wake-up function enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPA group pin rising edge wake-up function disabled. - * | | |1 = GPA group pin rising edge wake-up function enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPA group pin falling edge wake-up function disabled. - * | | |1 = GPA group pin falling edge wake-up function enabled. - * |[7:4] |WKPSEL |GPA Standby Power-down Wake-up Pin Select - * | | |0000 = GPA.0 wake-up function enabled. - * | | |0001 = GPA.1 wake-up function enabled. - * | | |0010 = GPA.2 wake-up function enabled. - * | | |0011 = GPA.3 wake-up function enabled. - * | | |0100 = GPA.4 wake-up function enabled. - * | | |0101 = GPA.5 wake-up function enabled. - * | | |0110 = GPA.6 wake-up function enabled. - * | | |0111 = GPA.7 wake-up function enabled. - * | | |1000 = GPA.8 wake-up function enabled. - * | | |1001 = GPA.9 wake-up function enabled. - * | | |1010 = GPA.10 wake-up function enabled. - * | | |1011 = GPA.11 wake-up function enabled. - * | | |1100 = GPA.12 wake-up function enabled. - * | | |1101 = GPA.13 wake-up function enabled. - * | | |1110 = GPA.14 wake-up function enabled. - * | | |1111 = GPA.15 wake-up function enabled. - * |[8] |DBEN |GPA Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator. - * | | |0 = Standby power-down wake-up pin De-bounce function disable. - * | | |1 = Standby power-down wake-up pin De-bounce function enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PBSWKCTL - * Offset: 0xA4 GPB Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPB group pin wake-up function disabled. - * | | |1 = GPB group pin wake-up function enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPB group pin rising edge wake-up function disabled. - * | | |1 = GPB group pin rising edge wake-up function enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPB group pin falling edge wake-up function disabled. - * | | |1 = GPB group pin falling edge wake-up function enabled. - * |[7:4] |WKPSEL |GPB Standby Power-down Wake-up Pin Select - * | | |0000 = GPB.0 wake-up function enabled. - * | | |0001 = GPB.1 wake-up function enabled. - * | | |0010 = GPB.2 wake-up function enabled. - * | | |0011 = GPB.3 wake-up function enabled. - * | | |0100 = GPB.4 wake-up function enabled. - * | | |0101 = GPB.5 wake-up function enabled. - * | | |0110 = GPB.6 wake-up function enabled. - * | | |0111 = GPB.7 wake-up function enabled. - * | | |1000 = GPB.8 wake-up function enabled. - * | | |1001 = GPB.9 wake-up function enabled. - * | | |1010 = GPB.10 wake-up function enabled. - * | | |1011 = GPB.11 wake-up function enabled. - * | | |1100 = GPB.12 wake-up function enabled. - * | | |1101 = GPB.13 wake-up function enabled. - * | | |1110 = GPB.14 wake-up function enabled. - * | | |1111 = GPB.15 wake-up function enabled. - * |[8] |DBEN |GPB Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator. - * | | |0 = Standby power-down wake-up pin De-bounce function disable. - * | | |1 = Standby power-down wake-up pin De-bounce function enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PCSWKCTL - * Offset: 0xA8 GPC Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPC group pin wake-up function disabled. - * | | |1 = GPC group pin wake-up function enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPC group pin rising edge wake-up function disabled. - * | | |1 = GPC group pin rising edge wake-up function enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPC group pin falling edge wake-up function disabled. - * | | |1 = GPC group pin falling edge wake-up function enabled. - * |[7:4] |WKPSEL |GPC Standby Power-down Wake-up Pin Select - * | | |0000 = GPC.0 wake-up function enabled. - * | | |0001 = GPC.1 wake-up function enabled. - * | | |0010 = GPC.2 wake-up function enabled. - * | | |0011 = GPC.3 wake-up function enabled. - * | | |0100 = GPC.4 wake-up function enabled. - * | | |0101 = GPC.5 wake-up function enabled. - * | | |0110 = GPC.6 wake-up function enabled. - * | | |0111 = GPC.7 wake-up function enabled. - * | | |1000 = GPC.8 wake-up function enabled. - * | | |1001 = GPC.9 wake-up function enabled. - * | | |1010 = GPC.10 wake-up function enabled. - * | | |1011 = GPC.11 wake-up function enabled. - * | | |1100 = GPC.12 wake-up function enabled. - * | | |1101 = GPC.13 wake-up function enabled. - * | | |1110 = GPC.14 wake-up function enabled. - * | | |1111 = GPC.15 wake-up function enabled. - * |[8] |DBEN |GPC Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator. - * | | |0 = Standby power-down wake-up pin De-bounce function disable. - * | | |1 = Standby power-down wake-up pin De-bounce function enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::PDSWKCTL - * Offset: 0xAC GPD Standby Power-down Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Standby Power-down Pin Wake-up Enable Bit - * | | |0 = GPD group pin wake-up function disabled. - * | | |1 = GPD group pin wake-up function enabled. - * |[1] |PRWKEN |Pin Rising Edge Wake-up Enable Bit - * | | |0 = GPD group pin rising edge wake-up function disabled. - * | | |1 = GPD group pin rising edge wake-up function enabled. - * |[2] |PFWKEN |Pin Falling Edge Wake-up Enable Bit - * | | |0 = GPD group pin falling edge wake-up function disabled. - * | | |1 = GPD group pin falling edge wake-up function enabled. - * |[7:4] |WKPSEL |GPD Standby Power-down Wake-up Pin Select - * | | |0000 = GPD.0 wake-up function enabled. - * | | |0001 = GPD.1 wake-up function enabled. - * | | |0010 = GPD.2 wake-up function enabled. - * | | |0011 = GPD.3 wake-up function enabled. - * | | |0100 = GPD.4 wake-up function enabled. - * | | |0101 = GPD.5 wake-up function enabled. - * | | |0110 = GPD.6 wake-up function enabled. - * | | |0111 = GPD.7 wake-up function enabled. - * | | |1000 = GPD.8 wake-up function enabled. - * | | |1001 = GPD.9 wake-up function enabled. - * | | |1010 = GPD.10 wake-up function enabled. - * | | |1011 = GPD.11 wake-up function enabled. - * | | |1100 = GPD.12 wake-up function enabled. - * | | |1101 = GPD.13 wake-up function enabled. - * | | |1110 = GPD.14 wake-up function enabled. - * | | |1111 = GPD.15 wake-up function enabled. - * |[8] |DBEN |GPD Input Signal De-bounce Enable Bit - * | | |The DBEN bit is used to enable the de-bounce function for each corresponding IO - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the wake-up - * | | |The de-bounce clock source is the 10 kHz internal low speed RC oscillator. - * | | |0 = Standby power-down wake-up pin De-bounce function disable. - * | | |1 = Standby power-down wake-up pin De-bounce function enable. - * | | |The de-bounce function is valid only for edge triggered. - * @var CLK_T::IOPDCTL - * Offset: 0xB0 GPIO Standby Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IOHR |GPIO Hold Release - * | | |When GPIO enter standby power-down mode, all I/O status are hold to keep normal operating status - * | | |After chip was waked up from standby power-down mode, the I/O are still keep hold status until user set this bit to release I/O hold status. - * | | |This bit is auto cleared by hardware. - */ - __IO uint32_t PWRCTL; /*!< [0x0000] System Power-down Control Register */ - __IO uint32_t AHBCLK; /*!< [0x0004] AHB Devices Clock Enable Control Register */ - __IO uint32_t APBCLK0; /*!< [0x0008] APB Devices Clock Enable Control Register 0 */ - __IO uint32_t APBCLK1; /*!< [0x000c] APB Devices Clock Enable Control Register 1 */ - __IO uint32_t CLKSEL0; /*!< [0x0010] Clock Source Select Control Register 0 */ - __IO uint32_t CLKSEL1; /*!< [0x0014] Clock Source Select Control Register 1 */ - __IO uint32_t CLKSEL2; /*!< [0x0018] Clock Source Select Control Register 2 */ - __IO uint32_t CLKSEL3; /*!< [0x001c] Clock Source Select Control Register 3 */ - __IO uint32_t CLKDIV0; /*!< [0x0020] Clock Divider Number Register 0 */ - __IO uint32_t CLKDIV1; /*!< [0x0024] Clock Divider Number Register 1 */ - __IO uint32_t CLKDIV2; /*!< [0x0028] Clock Divider Number Register 2 */ - __IO uint32_t CLKDIV3; /*!< [0x002c] Clock Divider Number Register 3 */ - __IO uint32_t CLKDIV4; /*!< [0x0030] Clock Divider Number Register 4 */ - __IO uint32_t PCLKDIV; /*!< [0x0034] APB Clock Divider Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE1[2]; - /** @endcond */ - __IO uint32_t PLLCTL; /*!< [0x0040] PLL Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE2[3]; - /** @endcond */ - __I uint32_t STATUS; /*!< [0x0050] Clock Status Monitor Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE3[3]; - /** @endcond */ - __IO uint32_t CLKOCTL; /*!< [0x0060] Clock Output Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE4[3]; - /** @endcond */ - __IO uint32_t CLKDCTL; /*!< [0x0070] Clock Fail Detector Control Register */ - __IO uint32_t CLKDSTS; /*!< [0x0074] Clock Fail Detector Status Register */ - __IO uint32_t CDUPB; /*!< [0x0078] Clock Frequency Range Detector Upper Boundary Register */ - __IO uint32_t CDLOWB; /*!< [0x007c] Clock Frequency Range Detector Lower Boundary Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE5[4]; - /** @endcond */ - __IO uint32_t PMUCTL; /*!< [0x0090] Power Manager Control Register */ - __IO uint32_t PMUSTS; /*!< [0x0094] Power Manager Status Register */ - __IO uint32_t LDOCTL; /*!< [0x0098] LDO Control Register */ - __IO uint32_t SWKDBCTL; /*!< [0x009c] Standby Power-down Wake-up De-bounce Control Register */ - __IO uint32_t PASWKCTL; /*!< [0x00a0] GPA Standby Power-down Wake-up Control Register */ - __IO uint32_t PBSWKCTL; /*!< [0x00a4] GPB Standby Power-down Wake-up Control Register */ - __IO uint32_t PCSWKCTL; /*!< [0x00a8] GPC Standby Power-down Wake-up Control Register */ - __IO uint32_t PDSWKCTL; /*!< [0x00ac] GPD Standby Power-down Wake-up Control Register */ - __IO uint32_t IOPDCTL; /*!< [0x00b0] GPIO Standby Power-down Control Register */ - -} CLK_T; - -/** - @addtogroup CLK_CONST CLK Bit Field Definition - Constant Definitions for CLK Controller -@{ */ - -#define CLK_PWRCTL_HXTEN_Pos (0) /*!< CLK_T::PWRCTL: HXTEN Position */ -#define CLK_PWRCTL_HXTEN_Msk (0x1ul << CLK_PWRCTL_HXTEN_Pos) /*!< CLK_T::PWRCTL: HXTEN Mask */ - -#define CLK_PWRCTL_LXTEN_Pos (1) /*!< CLK_T::PWRCTL: LXTEN Position */ -#define CLK_PWRCTL_LXTEN_Msk (0x1ul << CLK_PWRCTL_LXTEN_Pos) /*!< CLK_T::PWRCTL: LXTEN Mask */ - -#define CLK_PWRCTL_HIRCEN_Pos (2) /*!< CLK_T::PWRCTL: HIRCEN Position */ -#define CLK_PWRCTL_HIRCEN_Msk (0x1ul << CLK_PWRCTL_HIRCEN_Pos) /*!< CLK_T::PWRCTL: HIRCEN Mask */ - -#define CLK_PWRCTL_LIRCEN_Pos (3) /*!< CLK_T::PWRCTL: LIRCEN Position */ -#define CLK_PWRCTL_LIRCEN_Msk (0x1ul << CLK_PWRCTL_LIRCEN_Pos) /*!< CLK_T::PWRCTL: LIRCEN Mask */ - -#define CLK_PWRCTL_PDWKDLY_Pos (4) /*!< CLK_T::PWRCTL: PDWKDLY Position */ -#define CLK_PWRCTL_PDWKDLY_Msk (0x1ul << CLK_PWRCTL_PDWKDLY_Pos) /*!< CLK_T::PWRCTL: PDWKDLY Mask */ - -#define CLK_PWRCTL_PDWKIEN_Pos (5) /*!< CLK_T::PWRCTL: PDWKIEN Position */ -#define CLK_PWRCTL_PDWKIEN_Msk (0x1ul << CLK_PWRCTL_PDWKIEN_Pos) /*!< CLK_T::PWRCTL: PDWKIEN Mask */ - -#define CLK_PWRCTL_PDWKIF_Pos (6) /*!< CLK_T::PWRCTL: PDWKIF Position */ -#define CLK_PWRCTL_PDWKIF_Msk (0x1ul << CLK_PWRCTL_PDWKIF_Pos) /*!< CLK_T::PWRCTL: PDWKIF Mask */ - -#define CLK_PWRCTL_PDEN_Pos (7) /*!< CLK_T::PWRCTL: PDEN Position */ -#define CLK_PWRCTL_PDEN_Msk (0x1ul << CLK_PWRCTL_PDEN_Pos) /*!< CLK_T::PWRCTL: PDEN Mask */ - -#define CLK_PWRCTL_HXTGAIN_Pos (10) /*!< CLK_T::PWRCTL: HXTGAIN Position */ -#define CLK_PWRCTL_HXTGAIN_Msk (0x3ul << CLK_PWRCTL_HXTGAIN_Pos) /*!< CLK_T::PWRCTL: HXTGAIN Mask */ - -#define CLK_PWRCTL_HXTSELTYP_Pos (12) /*!< CLK_T::PWRCTL: HXTSELTYP Position */ -#define CLK_PWRCTL_HXTSELTYP_Msk (0x1ul << CLK_PWRCTL_HXTSELTYP_Pos) /*!< CLK_T::PWRCTL: HXTSELTYP Mask */ - -#define CLK_PWRCTL_HXTTBEN_Pos (13) /*!< CLK_T::PWRCTL: HXTTBEN Position */ -#define CLK_PWRCTL_HXTTBEN_Msk (0x1ul << CLK_PWRCTL_HXTTBEN_Pos) /*!< CLK_T::PWRCTL: HXTTBEN Mask */ - -#define CLK_PWRCTL_HIRCSTBS_Pos (16) /*!< CLK_T::PWRCTL: HIRCSTBS Position */ -#define CLK_PWRCTL_HIRCSTBS_Msk (0x3ul << CLK_PWRCTL_HIRCSTBS_Pos) /*!< CLK_T::PWRCTL: HIRCSTBS Mask */ - -#define CLK_PWRCTL_HIRC48MEN_Pos (18) /*!< CLK_T::PWRCTL: HIRC48MEN Position */ -#define CLK_PWRCTL_HIRC48MEN_Msk (0x1ul << CLK_PWRCTL_HIRC48MEN_Pos) /*!< CLK_T::PWRCTL: HIRC48MEN Mask */ - -#define CLK_AHBCLK_PDMACKEN_Pos (1) /*!< CLK_T::AHBCLK: PDMACKEN Position */ -#define CLK_AHBCLK_PDMACKEN_Msk (0x1ul << CLK_AHBCLK_PDMACKEN_Pos) /*!< CLK_T::AHBCLK: PDMACKEN Mask */ - -#define CLK_AHBCLK_ISPCKEN_Pos (2) /*!< CLK_T::AHBCLK: ISPCKEN Position */ -#define CLK_AHBCLK_ISPCKEN_Msk (0x1ul << CLK_AHBCLK_ISPCKEN_Pos) /*!< CLK_T::AHBCLK: ISPCKEN Mask */ - -#define CLK_AHBCLK_EBICKEN_Pos (3) /*!< CLK_T::AHBCLK: EBICKEN Position */ -#define CLK_AHBCLK_EBICKEN_Msk (0x1ul << CLK_AHBCLK_EBICKEN_Pos) /*!< CLK_T::AHBCLK: EBICKEN Mask */ - -#define CLK_AHBCLK_EMACCKEN_Pos (5) /*!< CLK_T::AHBCLK: EMACCKEN Position */ -#define CLK_AHBCLK_EMACCKEN_Msk (0x1ul << CLK_AHBCLK_EMACCKEN_Pos) /*!< CLK_T::AHBCLK: EMACCKEN Mask */ - -#define CLK_AHBCLK_SDH0CKEN_Pos (6) /*!< CLK_T::AHBCLK: SDH0CKEN Position */ -#define CLK_AHBCLK_SDH0CKEN_Msk (0x1ul << CLK_AHBCLK_SDH0CKEN_Pos) /*!< CLK_T::AHBCLK: SDH0CKEN Mask */ - -#define CLK_AHBCLK_CRCCKEN_Pos (7) /*!< CLK_T::AHBCLK: CRCCKEN Position */ -#define CLK_AHBCLK_CRCCKEN_Msk (0x1ul << CLK_AHBCLK_CRCCKEN_Pos) /*!< CLK_T::AHBCLK: CRCCKEN Mask */ - -#define CLK_AHBCLK_CCAPCKEN_Pos (8) /*!< CLK_T::AHBCLK: CCAPCKEN Position */ -#define CLK_AHBCLK_CCAPCKEN_Msk (0x1ul << CLK_AHBCLK_CCAPCKEN_Pos) /*!< CLK_T::AHBCLK: CCAPCKEN Mask */ - -#define CLK_AHBCLK_SENCKEN_Pos (9) /*!< CLK_T::AHBCLK: SENCKEN Position */ -#define CLK_AHBCLK_SENCKEN_Msk (0x1ul << CLK_AHBCLK_SENCKEN_Pos) /*!< CLK_T::AHBCLK: SENCKEN Mask */ - -#define CLK_AHBCLK_HSUSBDCKEN_Pos (10) /*!< CLK_T::AHBCLK: HSUSBDCKEN Position */ -#define CLK_AHBCLK_HSUSBDCKEN_Msk (0x1ul << CLK_AHBCLK_HSUSBDCKEN_Pos) /*!< CLK_T::AHBCLK: HSUSBDCKEN Mask */ - -#define CLK_AHBCLK_CRPTCKEN_Pos (12) /*!< CLK_T::AHBCLK: CRPTCKEN Position */ -#define CLK_AHBCLK_CRPTCKEN_Msk (0x1ul << CLK_AHBCLK_CRPTCKEN_Pos) /*!< CLK_T::AHBCLK: CRPTCKEN Mask */ - -#define CLK_AHBCLK_SPIMCKEN_Pos (14) /*!< CLK_T::AHBCLK: SPIMCKEN Position */ -#define CLK_AHBCLK_SPIMCKEN_Msk (0x1ul << CLK_AHBCLK_SPIMCKEN_Pos) /*!< CLK_T::AHBCLK: SPIMCKEN Mask */ - -#define CLK_AHBCLK_FMCIDLE_Pos (15) /*!< CLK_T::AHBCLK: FMCIDLE Position */ -#define CLK_AHBCLK_FMCIDLE_Msk (0x1ul << CLK_AHBCLK_FMCIDLE_Pos) /*!< CLK_T::AHBCLK: FMCIDLE Mask */ - -#define CLK_AHBCLK_USBHCKEN_Pos (16) /*!< CLK_T::AHBCLK: USBHCKEN Position */ -#define CLK_AHBCLK_USBHCKEN_Msk (0x1ul << CLK_AHBCLK_USBHCKEN_Pos) /*!< CLK_T::AHBCLK: USBHCKEN Mask */ - -#define CLK_AHBCLK_SDH1CKEN_Pos (17) /*!< CLK_T::AHBCLK: SDH1CKEN Position */ -#define CLK_AHBCLK_SDH1CKEN_Msk (0x1ul << CLK_AHBCLK_SDH1CKEN_Pos) /*!< CLK_T::AHBCLK: SDH1CKEN Mask */ - -#define CLK_APBCLK0_WDTCKEN_Pos (0) /*!< CLK_T::APBCLK0: WDTCKEN Position */ -#define CLK_APBCLK0_WDTCKEN_Msk (0x1ul << CLK_APBCLK0_WDTCKEN_Pos) /*!< CLK_T::APBCLK0: WDTCKEN Mask */ - -#define CLK_APBCLK0_RTCCKEN_Pos (1) /*!< CLK_T::APBCLK0: RTCCKEN Position */ -#define CLK_APBCLK0_RTCCKEN_Msk (0x1ul << CLK_APBCLK0_RTCCKEN_Pos) /*!< CLK_T::APBCLK0: RTCCKEN Mask */ - -#define CLK_APBCLK0_TMR0CKEN_Pos (2) /*!< CLK_T::APBCLK0: TMR0CKEN Position */ -#define CLK_APBCLK0_TMR0CKEN_Msk (0x1ul << CLK_APBCLK0_TMR0CKEN_Pos) /*!< CLK_T::APBCLK0: TMR0CKEN Mask */ - -#define CLK_APBCLK0_TMR1CKEN_Pos (3) /*!< CLK_T::APBCLK0: TMR1CKEN Position */ -#define CLK_APBCLK0_TMR1CKEN_Msk (0x1ul << CLK_APBCLK0_TMR1CKEN_Pos) /*!< CLK_T::APBCLK0: TMR1CKEN Mask */ - -#define CLK_APBCLK0_TMR2CKEN_Pos (4) /*!< CLK_T::APBCLK0: TMR2CKEN Position */ -#define CLK_APBCLK0_TMR2CKEN_Msk (0x1ul << CLK_APBCLK0_TMR2CKEN_Pos) /*!< CLK_T::APBCLK0: TMR2CKEN Mask */ - -#define CLK_APBCLK0_TMR3CKEN_Pos (5) /*!< CLK_T::APBCLK0: TMR3CKEN Position */ -#define CLK_APBCLK0_TMR3CKEN_Msk (0x1ul << CLK_APBCLK0_TMR3CKEN_Pos) /*!< CLK_T::APBCLK0: TMR3CKEN Mask */ - -#define CLK_APBCLK0_CLKOCKEN_Pos (6) /*!< CLK_T::APBCLK0: CLKOCKEN Position */ -#define CLK_APBCLK0_CLKOCKEN_Msk (0x1ul << CLK_APBCLK0_CLKOCKEN_Pos) /*!< CLK_T::APBCLK0: CLKOCKEN Mask */ - -#define CLK_APBCLK0_ACMP01CKEN_Pos (7) /*!< CLK_T::APBCLK0: ACMP01CKEN Position */ -#define CLK_APBCLK0_ACMP01CKEN_Msk (0x1ul << CLK_APBCLK0_ACMP01CKEN_Pos) /*!< CLK_T::APBCLK0: ACMP01CKEN Mask */ - -#define CLK_APBCLK0_I2C0CKEN_Pos (8) /*!< CLK_T::APBCLK0: I2C0CKEN Position */ -#define CLK_APBCLK0_I2C0CKEN_Msk (0x1ul << CLK_APBCLK0_I2C0CKEN_Pos) /*!< CLK_T::APBCLK0: I2C0CKEN Mask */ - -#define CLK_APBCLK0_I2C1CKEN_Pos (9) /*!< CLK_T::APBCLK0: I2C1CKEN Position */ -#define CLK_APBCLK0_I2C1CKEN_Msk (0x1ul << CLK_APBCLK0_I2C1CKEN_Pos) /*!< CLK_T::APBCLK0: I2C1CKEN Mask */ - -#define CLK_APBCLK0_I2C2CKEN_Pos (10) /*!< CLK_T::APBCLK0: I2C2CKEN Position */ -#define CLK_APBCLK0_I2C2CKEN_Msk (0x1ul << CLK_APBCLK0_I2C2CKEN_Pos) /*!< CLK_T::APBCLK0: I2C2CKEN Mask */ - -#define CLK_APBCLK0_QSPI0CKEN_Pos (12) /*!< CLK_T::APBCLK0: QSPI0CKEN Position */ -#define CLK_APBCLK0_QSPI0CKEN_Msk (0x1ul << CLK_APBCLK0_QSPI0CKEN_Pos) /*!< CLK_T::APBCLK0: QSPI0CKEN Mask */ - -#define CLK_APBCLK0_SPI0CKEN_Pos (13) /*!< CLK_T::APBCLK0: SPI0CKEN Position */ -#define CLK_APBCLK0_SPI0CKEN_Msk (0x1ul << CLK_APBCLK0_SPI0CKEN_Pos) /*!< CLK_T::APBCLK0: SPI0CKEN Mask */ - -#define CLK_APBCLK0_SPI1CKEN_Pos (14) /*!< CLK_T::APBCLK0: SPI1CKEN Position */ -#define CLK_APBCLK0_SPI1CKEN_Msk (0x1ul << CLK_APBCLK0_SPI1CKEN_Pos) /*!< CLK_T::APBCLK0: SPI1CKEN Mask */ - -#define CLK_APBCLK0_SPI2CKEN_Pos (15) /*!< CLK_T::APBCLK0: SPI2CKEN Position */ -#define CLK_APBCLK0_SPI2CKEN_Msk (0x1ul << CLK_APBCLK0_SPI2CKEN_Pos) /*!< CLK_T::APBCLK0: SPI2CKEN Mask */ - -#define CLK_APBCLK0_UART0CKEN_Pos (16) /*!< CLK_T::APBCLK0: UART0CKEN Position */ -#define CLK_APBCLK0_UART0CKEN_Msk (0x1ul << CLK_APBCLK0_UART0CKEN_Pos) /*!< CLK_T::APBCLK0: UART0CKEN Mask */ - -#define CLK_APBCLK0_UART1CKEN_Pos (17) /*!< CLK_T::APBCLK0: UART1CKEN Position */ -#define CLK_APBCLK0_UART1CKEN_Msk (0x1ul << CLK_APBCLK0_UART1CKEN_Pos) /*!< CLK_T::APBCLK0: UART1CKEN Mask */ - -#define CLK_APBCLK0_UART2CKEN_Pos (18) /*!< CLK_T::APBCLK0: UART2CKEN Position */ -#define CLK_APBCLK0_UART2CKEN_Msk (0x1ul << CLK_APBCLK0_UART2CKEN_Pos) /*!< CLK_T::APBCLK0: UART2CKEN Mask */ - -#define CLK_APBCLK0_UART3CKEN_Pos (19) /*!< CLK_T::APBCLK0: UART3CKEN Position */ -#define CLK_APBCLK0_UART3CKEN_Msk (0x1ul << CLK_APBCLK0_UART3CKEN_Pos) /*!< CLK_T::APBCLK0: UART3CKEN Mask */ - -#define CLK_APBCLK0_UART4CKEN_Pos (20) /*!< CLK_T::APBCLK0: UART4CKEN Position */ -#define CLK_APBCLK0_UART4CKEN_Msk (0x1ul << CLK_APBCLK0_UART4CKEN_Pos) /*!< CLK_T::APBCLK0: UART4CKEN Mask */ - -#define CLK_APBCLK0_UART5CKEN_Pos (21) /*!< CLK_T::APBCLK0: UART5CKEN Position */ -#define CLK_APBCLK0_UART5CKEN_Msk (0x1ul << CLK_APBCLK0_UART5CKEN_Pos) /*!< CLK_T::APBCLK0: UART5CKEN Mask */ - -#define CLK_APBCLK0_UART6CKEN_Pos (22) /*!< CLK_T::APBCLK0: UART6CKEN Position */ -#define CLK_APBCLK0_UART6CKEN_Msk (0x1ul << CLK_APBCLK0_UART6CKEN_Pos) /*!< CLK_T::APBCLK0: UART6CKEN Mask */ - -#define CLK_APBCLK0_UART7CKEN_Pos (23) /*!< CLK_T::APBCLK0: UART7CKEN Position */ -#define CLK_APBCLK0_UART7CKEN_Msk (0x1ul << CLK_APBCLK0_UART7CKEN_Pos) /*!< CLK_T::APBCLK0: UART7CKEN Mask */ - -#define CLK_APBCLK0_CAN0CKEN_Pos (24) /*!< CLK_T::APBCLK0: CAN0CKEN Position */ -#define CLK_APBCLK0_CAN0CKEN_Msk (0x1ul << CLK_APBCLK0_CAN0CKEN_Pos) /*!< CLK_T::APBCLK0: CAN0CKEN Mask */ - -#define CLK_APBCLK0_CAN1CKEN_Pos (25) /*!< CLK_T::APBCLK0: CAN1CKEN Position */ -#define CLK_APBCLK0_CAN1CKEN_Msk (0x1ul << CLK_APBCLK0_CAN1CKEN_Pos) /*!< CLK_T::APBCLK0: CAN1CKEN Mask */ - -#define CLK_APBCLK0_OTGCKEN_Pos (26) /*!< CLK_T::APBCLK0: OTGCKEN Position */ -#define CLK_APBCLK0_OTGCKEN_Msk (0x1ul << CLK_APBCLK0_OTGCKEN_Pos) /*!< CLK_T::APBCLK0: OTGCKEN Mask */ - -#define CLK_APBCLK0_USBDCKEN_Pos (27) /*!< CLK_T::APBCLK0: USBDCKEN Position */ -#define CLK_APBCLK0_USBDCKEN_Msk (0x1ul << CLK_APBCLK0_USBDCKEN_Pos) /*!< CLK_T::APBCLK0: USBDCKEN Mask */ - -#define CLK_APBCLK0_EADCCKEN_Pos (28) /*!< CLK_T::APBCLK0: EADCCKEN Position */ -#define CLK_APBCLK0_EADCCKEN_Msk (0x1ul << CLK_APBCLK0_EADCCKEN_Pos) /*!< CLK_T::APBCLK0: EADCCKEN Mask */ - -#define CLK_APBCLK0_I2S0CKEN_Pos (29) /*!< CLK_T::APBCLK0: I2S0CKEN Position */ -#define CLK_APBCLK0_I2S0CKEN_Msk (0x1ul << CLK_APBCLK0_I2S0CKEN_Pos) /*!< CLK_T::APBCLK0: I2S0CKEN Mask */ - -#define CLK_APBCLK0_HSOTGCKEN_Pos (30) /*!< CLK_T::APBCLK0: HSOTGCKEN Position */ -#define CLK_APBCLK0_HSOTGCKEN_Msk (0x1ul << CLK_APBCLK0_HSOTGCKEN_Pos) /*!< CLK_T::APBCLK0: HSOTGCKEN Mask */ - -#define CLK_APBCLK1_SC0CKEN_Pos (0) /*!< CLK_T::APBCLK1: SC0CKEN Position */ -#define CLK_APBCLK1_SC0CKEN_Msk (0x1ul << CLK_APBCLK1_SC0CKEN_Pos) /*!< CLK_T::APBCLK1: SC0CKEN Mask */ - -#define CLK_APBCLK1_SC1CKEN_Pos (1) /*!< CLK_T::APBCLK1: SC1CKEN Position */ -#define CLK_APBCLK1_SC1CKEN_Msk (0x1ul << CLK_APBCLK1_SC1CKEN_Pos) /*!< CLK_T::APBCLK1: SC1CKEN Mask */ - -#define CLK_APBCLK1_SC2CKEN_Pos (2) /*!< CLK_T::APBCLK1: SC2CKEN Position */ -#define CLK_APBCLK1_SC2CKEN_Msk (0x1ul << CLK_APBCLK1_SC2CKEN_Pos) /*!< CLK_T::APBCLK1: SC2CKEN Mask */ - -#define CLK_APBCLK1_QSPI1CKEN_Pos (4) /*!< CLK_T::APBCLK1: QSPI1CKEN Position */ -#define CLK_APBCLK1_QSPI1CKEN_Msk (0x1ul << CLK_APBCLK1_QSPI1CKEN_Pos) /*!< CLK_T::APBCLK1: QSPI1CKEN Mask */ - -#define CLK_APBCLK1_SPI3CKEN_Pos (6) /*!< CLK_T::APBCLK1: SPI3CKEN Position */ -#define CLK_APBCLK1_SPI3CKEN_Msk (0x1ul << CLK_APBCLK1_SPI3CKEN_Pos) /*!< CLK_T::APBCLK1: SPI3CKEN Mask */ - -#define CLK_APBCLK1_USCI0CKEN_Pos (8) /*!< CLK_T::APBCLK1: USCI0CKEN Position */ -#define CLK_APBCLK1_USCI0CKEN_Msk (0x1ul << CLK_APBCLK1_USCI0CKEN_Pos) /*!< CLK_T::APBCLK1: USCI0CKEN Mask */ - -#define CLK_APBCLK1_USCI1CKEN_Pos (9) /*!< CLK_T::APBCLK1: USCI1CKEN Position */ -#define CLK_APBCLK1_USCI1CKEN_Msk (0x1ul << CLK_APBCLK1_USCI1CKEN_Pos) /*!< CLK_T::APBCLK1: USCI1CKEN Mask */ - -#define CLK_APBCLK1_DACCKEN_Pos (12) /*!< CLK_T::APBCLK1: DACCKEN Position */ -#define CLK_APBCLK1_DACCKEN_Msk (0x1ul << CLK_APBCLK1_DACCKEN_Pos) /*!< CLK_T::APBCLK1: DACCKEN Mask */ - -#define CLK_APBCLK1_EPWM0CKEN_Pos (16) /*!< CLK_T::APBCLK1: EPWM0CKEN Position */ -#define CLK_APBCLK1_EPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM0CKEN Mask */ - -#define CLK_APBCLK1_EPWM1CKEN_Pos (17) /*!< CLK_T::APBCLK1: EPWM1CKEN Position */ -#define CLK_APBCLK1_EPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM1CKEN Mask */ - -#define CLK_APBCLK1_BPWM0CKEN_Pos (18) /*!< CLK_T::APBCLK1: BPWM0CKEN Position */ -#define CLK_APBCLK1_BPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM0CKEN Mask */ - -#define CLK_APBCLK1_BPWM1CKEN_Pos (19) /*!< CLK_T::APBCLK1: BPWM1CKEN Position */ -#define CLK_APBCLK1_BPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_BPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: BPWM1CKEN Mask */ - -#define CLK_APBCLK1_QEI0CKEN_Pos (22) /*!< CLK_T::APBCLK1: QEI0CKEN Position */ -#define CLK_APBCLK1_QEI0CKEN_Msk (0x1ul << CLK_APBCLK1_QEI0CKEN_Pos) /*!< CLK_T::APBCLK1: QEI0CKEN Mask */ - -#define CLK_APBCLK1_QEI1CKEN_Pos (23) /*!< CLK_T::APBCLK1: QEI1CKEN Position */ -#define CLK_APBCLK1_QEI1CKEN_Msk (0x1ul << CLK_APBCLK1_QEI1CKEN_Pos) /*!< CLK_T::APBCLK1: QEI1CKEN Mask */ - -#define CLK_APBCLK1_TRNGCKEN_Pos (25) /*!< CLK_T::APBCLK1: TRNGCKEN Position */ -#define CLK_APBCLK1_TRNGCKEN_Msk (0x1ul << CLK_APBCLK1_TRNGCKEN_Pos) /*!< CLK_T::APBCLK1: TRNGCKEN Mask */ - -#define CLK_APBCLK1_ECAP0CKEN_Pos (26) /*!< CLK_T::APBCLK1: ECAP0CKEN Position */ -#define CLK_APBCLK1_ECAP0CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP0CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP0CKEN Mask */ - -#define CLK_APBCLK1_ECAP1CKEN_Pos (27) /*!< CLK_T::APBCLK1: ECAP1CKEN Position */ -#define CLK_APBCLK1_ECAP1CKEN_Msk (0x1ul << CLK_APBCLK1_ECAP1CKEN_Pos) /*!< CLK_T::APBCLK1: ECAP1CKEN Mask */ - -#define CLK_APBCLK1_CAN2CKEN_Pos (28) /*!< CLK_T::APBCLK1: CAN2CKEN Position */ -#define CLK_APBCLK1_CAN2CKEN_Msk (0x1ul << CLK_APBCLK1_CAN2CKEN_Pos) /*!< CLK_T::APBCLK1: CAN2CKEN Mask */ - -#define CLK_APBCLK1_OPACKEN_Pos (30) /*!< CLK_T::APBCLK1: OPACKEN Position */ -#define CLK_APBCLK1_OPACKEN_Msk (0x1ul << CLK_APBCLK1_OPACKEN_Pos) /*!< CLK_T::APBCLK1: OPACKEN Mask */ - -#define CLK_APBCLK1_EADC1CKEN_Pos (31) /*!< CLK_T::APBCLK1: EADC1CKEN Position */ -#define CLK_APBCLK1_EADC1CKEN_Msk (0x1ul << CLK_APBCLK1_EADC1CKEN_Pos) /*!< CLK_T::APBCLK1: EADC1CKEN Mask */ - -#define CLK_CLKSEL0_HCLKSEL_Pos (0) /*!< CLK_T::CLKSEL0: HCLKSEL Position */ -#define CLK_CLKSEL0_HCLKSEL_Msk (0x7ul << CLK_CLKSEL0_HCLKSEL_Pos) /*!< CLK_T::CLKSEL0: HCLKSEL Mask */ - -#define CLK_CLKSEL0_STCLKSEL_Pos (3) /*!< CLK_T::CLKSEL0: STCLKSEL Position */ -#define CLK_CLKSEL0_STCLKSEL_Msk (0x7ul << CLK_CLKSEL0_STCLKSEL_Pos) /*!< CLK_T::CLKSEL0: STCLKSEL Mask */ - -#define CLK_CLKSEL0_USBSEL_Pos (8) /*!< CLK_T::CLKSEL0: PCLK0SEL Position */ -#define CLK_CLKSEL0_USBSEL_Msk (0x1ul << CLK_CLKSEL0_USBSEL_Pos) /*!< CLK_T::CLKSEL0: PCLK0SEL Mask */ - -#define CLK_CLKSEL0_CCAPSEL_Pos (16) /*!< CLK_T::CLKSEL0: CCAPSEL Position */ -#define CLK_CLKSEL0_CCAPSEL_Msk (0x3ul << CLK_CLKSEL0_CCAPSEL_Pos) /*!< CLK_T::CLKSEL0: CCAPSEL Mask */ - -#define CLK_CLKSEL0_SDH0SEL_Pos (20) /*!< CLK_T::CLKSEL0: SDH0SEL Position */ -#define CLK_CLKSEL0_SDH0SEL_Msk (0x3ul << CLK_CLKSEL0_SDH0SEL_Pos) /*!< CLK_T::CLKSEL0: SDH0SEL Mask */ - -#define CLK_CLKSEL0_SDH1SEL_Pos (22) /*!< CLK_T::CLKSEL0: SDH1SEL Position */ -#define CLK_CLKSEL0_SDH1SEL_Msk (0x3ul << CLK_CLKSEL0_SDH1SEL_Pos) /*!< CLK_T::CLKSEL0: SDH1SEL Mask */ - -#define CLK_CLKSEL1_WDTSEL_Pos (0) /*!< CLK_T::CLKSEL1: WDTSEL Position */ -#define CLK_CLKSEL1_WDTSEL_Msk (0x3ul << CLK_CLKSEL1_WDTSEL_Pos) /*!< CLK_T::CLKSEL1: WDTSEL Mask */ - -#define CLK_CLKSEL1_TMR0SEL_Pos (8) /*!< CLK_T::CLKSEL1: TMR0SEL Position */ -#define CLK_CLKSEL1_TMR0SEL_Msk (0x7ul << CLK_CLKSEL1_TMR0SEL_Pos) /*!< CLK_T::CLKSEL1: TMR0SEL Mask */ - -#define CLK_CLKSEL1_TMR1SEL_Pos (12) /*!< CLK_T::CLKSEL1: TMR1SEL Position */ -#define CLK_CLKSEL1_TMR1SEL_Msk (0x7ul << CLK_CLKSEL1_TMR1SEL_Pos) /*!< CLK_T::CLKSEL1: TMR1SEL Mask */ - -#define CLK_CLKSEL1_TMR2SEL_Pos (16) /*!< CLK_T::CLKSEL1: TMR2SEL Position */ -#define CLK_CLKSEL1_TMR2SEL_Msk (0x7ul << CLK_CLKSEL1_TMR2SEL_Pos) /*!< CLK_T::CLKSEL1: TMR2SEL Mask */ - -#define CLK_CLKSEL1_TMR3SEL_Pos (20) /*!< CLK_T::CLKSEL1: TMR3SEL Position */ -#define CLK_CLKSEL1_TMR3SEL_Msk (0x7ul << CLK_CLKSEL1_TMR3SEL_Pos) /*!< CLK_T::CLKSEL1: TMR3SEL Mask */ - -#define CLK_CLKSEL1_UART0SEL_Pos (24) /*!< CLK_T::CLKSEL1: UART0SEL Position */ -#define CLK_CLKSEL1_UART0SEL_Msk (0x3ul << CLK_CLKSEL1_UART0SEL_Pos) /*!< CLK_T::CLKSEL1: UART0SEL Mask */ - -#define CLK_CLKSEL1_UART1SEL_Pos (26) /*!< CLK_T::CLKSEL1: UART1SEL Position */ -#define CLK_CLKSEL1_UART1SEL_Msk (0x3ul << CLK_CLKSEL1_UART1SEL_Pos) /*!< CLK_T::CLKSEL1: UART1SEL Mask */ - -#define CLK_CLKSEL1_CLKOSEL_Pos (28) /*!< CLK_T::CLKSEL1: CLKOSEL Position */ -#define CLK_CLKSEL1_CLKOSEL_Msk (0x3ul << CLK_CLKSEL1_CLKOSEL_Pos) /*!< CLK_T::CLKSEL1: CLKOSEL Mask */ - -#define CLK_CLKSEL1_WWDTSEL_Pos (30) /*!< CLK_T::CLKSEL1: WWDTSEL Position */ -#define CLK_CLKSEL1_WWDTSEL_Msk (0x3ul << CLK_CLKSEL1_WWDTSEL_Pos) /*!< CLK_T::CLKSEL1: WWDTSEL Mask */ - -#define CLK_CLKSEL2_EPWM0SEL_Pos (0) /*!< CLK_T::CLKSEL2: EPWM0SEL Position */ -#define CLK_CLKSEL2_EPWM0SEL_Msk (0x1ul << CLK_CLKSEL2_EPWM0SEL_Pos) /*!< CLK_T::CLKSEL2: EPWM0SEL Mask */ - -#define CLK_CLKSEL2_EPWM1SEL_Pos (1) /*!< CLK_T::CLKSEL2: EPWM1SEL Position */ -#define CLK_CLKSEL2_EPWM1SEL_Msk (0x1ul << CLK_CLKSEL2_EPWM1SEL_Pos) /*!< CLK_T::CLKSEL2: EPWM1SEL Mask */ - -#define CLK_CLKSEL2_QSPI0SEL_Pos (2) /*!< CLK_T::CLKSEL2: QSPI0SEL Position */ -#define CLK_CLKSEL2_QSPI0SEL_Msk (0x3ul << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< CLK_T::CLKSEL2: QSPI0SEL Mask */ - -#define CLK_CLKSEL2_SPI0SEL_Pos (4) /*!< CLK_T::CLKSEL2: SPI0SEL Position */ -#define CLK_CLKSEL2_SPI0SEL_Msk (0x3ul << CLK_CLKSEL2_SPI0SEL_Pos) /*!< CLK_T::CLKSEL2: SPI0SEL Mask */ - -#define CLK_CLKSEL2_SPI1SEL_Pos (6) /*!< CLK_T::CLKSEL2: SPI1SEL Position */ -#define CLK_CLKSEL2_SPI1SEL_Msk (0x3ul << CLK_CLKSEL2_SPI1SEL_Pos) /*!< CLK_T::CLKSEL2: SPI1SEL Mask */ - -#define CLK_CLKSEL2_BPWM0SEL_Pos (8) /*!< CLK_T::CLKSEL2: BPWM0SEL Position */ -#define CLK_CLKSEL2_BPWM0SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM0SEL Mask */ - -#define CLK_CLKSEL2_BPWM1SEL_Pos (9) /*!< CLK_T::CLKSEL2: BPWM1SEL Position */ -#define CLK_CLKSEL2_BPWM1SEL_Msk (0x1ul << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< CLK_T::CLKSEL2: BPWM1SEL Mask */ - -#define CLK_CLKSEL2_SPI2SEL_Pos (10) /*!< CLK_T::CLKSEL2: SPI2SEL Position */ -#define CLK_CLKSEL2_SPI2SEL_Msk (0x3ul << CLK_CLKSEL2_SPI2SEL_Pos) /*!< CLK_T::CLKSEL2: SPI2SEL Mask */ - -#define CLK_CLKSEL2_SPI3SEL_Pos (12) /*!< CLK_T::CLKSEL2: SPI3SEL Position */ -#define CLK_CLKSEL2_SPI3SEL_Msk (0x3ul << CLK_CLKSEL2_SPI3SEL_Pos) /*!< CLK_T::CLKSEL2: SPI3SEL Mask */ - -#define CLK_CLKSEL3_SC0SEL_Pos (0) /*!< CLK_T::CLKSEL3: SC0SEL Position */ -#define CLK_CLKSEL3_SC0SEL_Msk (0x3ul << CLK_CLKSEL3_SC0SEL_Pos) /*!< CLK_T::CLKSEL3: SC0SEL Mask */ - -#define CLK_CLKSEL3_SC1SEL_Pos (2) /*!< CLK_T::CLKSEL3: SC1SEL Position */ -#define CLK_CLKSEL3_SC1SEL_Msk (0x3ul << CLK_CLKSEL3_SC1SEL_Pos) /*!< CLK_T::CLKSEL3: SC1SEL Mask */ - -#define CLK_CLKSEL3_SC2SEL_Pos (4) /*!< CLK_T::CLKSEL3: SC2SEL Position */ -#define CLK_CLKSEL3_SC2SEL_Msk (0x3ul << CLK_CLKSEL3_SC2SEL_Pos) /*!< CLK_T::CLKSEL3: SC2SEL Mask */ - -#define CLK_CLKSEL3_RTCSEL_Pos (8) /*!< CLK_T::CLKSEL3: RTCSEL Position */ -#define CLK_CLKSEL3_RTCSEL_Msk (0x1ul << CLK_CLKSEL3_RTCSEL_Pos) /*!< CLK_T::CLKSEL3: RTCSEL Mask */ - -#define CLK_CLKSEL3_QSPI1SEL_Pos (12) /*!< CLK_T::CLKSEL3: QSPI1SEL Position */ -#define CLK_CLKSEL3_QSPI1SEL_Msk (0x3ul << CLK_CLKSEL3_QSPI1SEL_Pos) /*!< CLK_T::CLKSEL3: QSPI1SEL Mask */ - -#define CLK_CLKSEL3_I2S0SEL_Pos (16) /*!< CLK_T::CLKSEL3: I2S0SEL Position */ -#define CLK_CLKSEL3_I2S0SEL_Msk (0x3ul << CLK_CLKSEL3_I2S0SEL_Pos) /*!< CLK_T::CLKSEL3: I2S0SEL Mask */ - -#define CLK_CLKSEL3_UART6SEL_Pos (20) /*!< CLK_T::CLKSEL3: UART6SEL Position */ -#define CLK_CLKSEL3_UART6SEL_Msk (0x3ul << CLK_CLKSEL3_UART6SEL_Pos) /*!< CLK_T::CLKSEL3: UART6SEL Mask */ - -#define CLK_CLKSEL3_UART7SEL_Pos (22) /*!< CLK_T::CLKSEL3: UART7SEL Position */ -#define CLK_CLKSEL3_UART7SEL_Msk (0x3ul << CLK_CLKSEL3_UART7SEL_Pos) /*!< CLK_T::CLKSEL3: UART7SEL Mask */ - -#define CLK_CLKSEL3_UART2SEL_Pos (24) /*!< CLK_T::CLKSEL3: UART2SEL Position */ -#define CLK_CLKSEL3_UART2SEL_Msk (0x3ul << CLK_CLKSEL3_UART2SEL_Pos) /*!< CLK_T::CLKSEL3: UART2SEL Mask */ - -#define CLK_CLKSEL3_UART3SEL_Pos (26) /*!< CLK_T::CLKSEL3: UART3SEL Position */ -#define CLK_CLKSEL3_UART3SEL_Msk (0x3ul << CLK_CLKSEL3_UART3SEL_Pos) /*!< CLK_T::CLKSEL3: UART3SEL Mask */ - -#define CLK_CLKSEL3_UART4SEL_Pos (28) /*!< CLK_T::CLKSEL3: UART4SEL Position */ -#define CLK_CLKSEL3_UART4SEL_Msk (0x3ul << CLK_CLKSEL3_UART4SEL_Pos) /*!< CLK_T::CLKSEL3: UART4SEL Mask */ - -#define CLK_CLKSEL3_UART5SEL_Pos (30) /*!< CLK_T::CLKSEL3: UART5SEL Position */ -#define CLK_CLKSEL3_UART5SEL_Msk (0x3ul << CLK_CLKSEL3_UART5SEL_Pos) /*!< CLK_T::CLKSEL3: UART5SEL Mask */ - -#define CLK_CLKDIV0_HCLKDIV_Pos (0) /*!< CLK_T::CLKDIV0: HCLKDIV Position */ -#define CLK_CLKDIV0_HCLKDIV_Msk (0xful << CLK_CLKDIV0_HCLKDIV_Pos) /*!< CLK_T::CLKDIV0: HCLKDIV Mask */ - -#define CLK_CLKDIV0_USBDIV_Pos (4) /*!< CLK_T::CLKDIV0: USBDIV Position */ -#define CLK_CLKDIV0_USBDIV_Msk (0xful << CLK_CLKDIV0_USBDIV_Pos) /*!< CLK_T::CLKDIV0: USBDIV Mask */ - -#define CLK_CLKDIV0_UART0DIV_Pos (8) /*!< CLK_T::CLKDIV0: UART0DIV Position */ -#define CLK_CLKDIV0_UART0DIV_Msk (0xful << CLK_CLKDIV0_UART0DIV_Pos) /*!< CLK_T::CLKDIV0: UART0DIV Mask */ - -#define CLK_CLKDIV0_UART1DIV_Pos (12) /*!< CLK_T::CLKDIV0: UART1DIV Position */ -#define CLK_CLKDIV0_UART1DIV_Msk (0xful << CLK_CLKDIV0_UART1DIV_Pos) /*!< CLK_T::CLKDIV0: UART1DIV Mask */ - -#define CLK_CLKDIV0_EADCDIV_Pos (16) /*!< CLK_T::CLKDIV0: EADCDIV Position */ -#define CLK_CLKDIV0_EADCDIV_Msk (0xfful << CLK_CLKDIV0_EADCDIV_Pos) /*!< CLK_T::CLKDIV0: EADCDIV Mask */ - -#define CLK_CLKDIV0_SDH0DIV_Pos (24) /*!< CLK_T::CLKDIV0: SDH0DIV Position */ -#define CLK_CLKDIV0_SDH0DIV_Msk (0xfful << CLK_CLKDIV0_SDH0DIV_Pos) /*!< CLK_T::CLKDIV0: SDH0DIV Mask */ - -#define CLK_CLKDIV1_SC0DIV_Pos (0) /*!< CLK_T::CLKDIV1: SC0DIV Position */ -#define CLK_CLKDIV1_SC0DIV_Msk (0xfful << CLK_CLKDIV1_SC0DIV_Pos) /*!< CLK_T::CLKDIV1: SC0DIV Mask */ - -#define CLK_CLKDIV1_SC1DIV_Pos (8) /*!< CLK_T::CLKDIV1: SC1DIV Position */ -#define CLK_CLKDIV1_SC1DIV_Msk (0xfful << CLK_CLKDIV1_SC1DIV_Pos) /*!< CLK_T::CLKDIV1: SC1DIV Mask */ - -#define CLK_CLKDIV1_SC2DIV_Pos (16) /*!< CLK_T::CLKDIV1: SC2DIV Position */ -#define CLK_CLKDIV1_SC2DIV_Msk (0xfful << CLK_CLKDIV1_SC2DIV_Pos) /*!< CLK_T::CLKDIV1: SC2DIV Mask */ - -#define CLK_CLKDIV2_I2SDIV_Pos (0) /*!< CLK_T::CLKDIV2: I2SDIV Position */ -#define CLK_CLKDIV2_I2SDIV_Msk (0xful << CLK_CLKDIV2_I2SDIV_Pos) /*!< CLK_T::CLKDIV2: I2SDIV Mask */ - -#define CLK_CLKDIV2_EADC1DIV_Pos (24) /*!< CLK_T::CLKDIV2: EADC1DIV Position */ -#define CLK_CLKDIV2_EADC1DIV_Msk (0xfful << CLK_CLKDIV2_EADC1DIV_Pos) /*!< CLK_T::CLKDIV2: EADC1DIV Mask */ - -#define CLK_CLKDIV3_CCAPDIV_Pos (0) /*!< CLK_T::CLKDIV3: CCAPDIV Position */ -#define CLK_CLKDIV3_CCAPDIV_Msk (0xfful << CLK_CLKDIV3_CCAPDIV_Pos) /*!< CLK_T::CLKDIV3: CCAPDIV Mask */ - -#define CLK_CLKDIV3_VSENSEDIV_Pos (8) /*!< CLK_T::CLKDIV3: VSENSEDIV Position */ -#define CLK_CLKDIV3_VSENSEDIV_Msk (0xfful << CLK_CLKDIV3_VSENSEDIV_Pos) /*!< CLK_T::CLKDIV3: VSENSEDIV Mask */ - -#define CLK_CLKDIV3_EMACDIV_Pos (16) /*!< CLK_T::CLKDIV3: EMACDIV Position */ -#define CLK_CLKDIV3_EMACDIV_Msk (0xfful << CLK_CLKDIV3_EMACDIV_Pos) /*!< CLK_T::CLKDIV3: EMACDIV Mask */ - -#define CLK_CLKDIV3_SDH1DIV_Pos (24) /*!< CLK_T::CLKDIV3: SDH1DIV Position */ -#define CLK_CLKDIV3_SDH1DIV_Msk (0xfful << CLK_CLKDIV3_SDH1DIV_Pos) /*!< CLK_T::CLKDIV3: SDH1DIV Mask */ - -#define CLK_CLKDIV4_UART2DIV_Pos (0) /*!< CLK_T::CLKDIV4: UART2DIV Position */ -#define CLK_CLKDIV4_UART2DIV_Msk (0xful << CLK_CLKDIV4_UART2DIV_Pos) /*!< CLK_T::CLKDIV4: UART2DIV Mask */ - -#define CLK_CLKDIV4_UART3DIV_Pos (4) /*!< CLK_T::CLKDIV4: UART3DIV Position */ -#define CLK_CLKDIV4_UART3DIV_Msk (0xful << CLK_CLKDIV4_UART3DIV_Pos) /*!< CLK_T::CLKDIV4: UART3DIV Mask */ - -#define CLK_CLKDIV4_UART4DIV_Pos (8) /*!< CLK_T::CLKDIV4: UART4DIV Position */ -#define CLK_CLKDIV4_UART4DIV_Msk (0xful << CLK_CLKDIV4_UART4DIV_Pos) /*!< CLK_T::CLKDIV4: UART4DIV Mask */ - -#define CLK_CLKDIV4_UART5DIV_Pos (12) /*!< CLK_T::CLKDIV4: UART5DIV Position */ -#define CLK_CLKDIV4_UART5DIV_Msk (0xful << CLK_CLKDIV4_UART5DIV_Pos) /*!< CLK_T::CLKDIV4: UART5DIV Mask */ - -#define CLK_CLKDIV4_UART6DIV_Pos (16) /*!< CLK_T::CLKDIV4: UART6DIV Position */ -#define CLK_CLKDIV4_UART6DIV_Msk (0xful << CLK_CLKDIV4_UART6DIV_Pos) /*!< CLK_T::CLKDIV4: UART6DIV Mask */ - -#define CLK_CLKDIV4_UART7DIV_Pos (20) /*!< CLK_T::CLKDIV4: UART7DIV Position */ -#define CLK_CLKDIV4_UART7DIV_Msk (0xful << CLK_CLKDIV4_UART7DIV_Pos) /*!< CLK_T::CLKDIV4: UART7DIV Mask */ - -#define CLK_PCLKDIV_APB0DIV_Pos (0) /*!< CLK_T::PCLKDIV: APB0DIV Position */ -#define CLK_PCLKDIV_APB0DIV_Msk (0x7ul << CLK_PCLKDIV_APB0DIV_Pos) /*!< CLK_T::PCLKDIV: APB0DIV Mask */ - -#define CLK_PCLKDIV_APB1DIV_Pos (4) /*!< CLK_T::PCLKDIV: APB1DIV Position */ -#define CLK_PCLKDIV_APB1DIV_Msk (0x7ul << CLK_PCLKDIV_APB1DIV_Pos) /*!< CLK_T::PCLKDIV: APB1DIV Mask */ - -#define CLK_PLLCTL_FBDIV_Pos (0) /*!< CLK_T::PLLCTL: FBDIV Position */ -#define CLK_PLLCTL_FBDIV_Msk (0x1fful << CLK_PLLCTL_FBDIV_Pos) /*!< CLK_T::PLLCTL: FBDIV Mask */ - -#define CLK_PLLCTL_INDIV_Pos (9) /*!< CLK_T::PLLCTL: INDIV Position */ -#define CLK_PLLCTL_INDIV_Msk (0x1ful << CLK_PLLCTL_INDIV_Pos) /*!< CLK_T::PLLCTL: INDIV Mask */ - -#define CLK_PLLCTL_OUTDIV_Pos (14) /*!< CLK_T::PLLCTL: OUTDIV Position */ -#define CLK_PLLCTL_OUTDIV_Msk (0x3ul << CLK_PLLCTL_OUTDIV_Pos) /*!< CLK_T::PLLCTL: OUTDIV Mask */ - -#define CLK_PLLCTL_PD_Pos (16) /*!< CLK_T::PLLCTL: PD Position */ -#define CLK_PLLCTL_PD_Msk (0x1ul << CLK_PLLCTL_PD_Pos) /*!< CLK_T::PLLCTL: PD Mask */ - -#define CLK_PLLCTL_BP_Pos (17) /*!< CLK_T::PLLCTL: BP Position */ -#define CLK_PLLCTL_BP_Msk (0x1ul << CLK_PLLCTL_BP_Pos) /*!< CLK_T::PLLCTL: BP Mask */ - -#define CLK_PLLCTL_OE_Pos (18) /*!< CLK_T::PLLCTL: OE Position */ -#define CLK_PLLCTL_OE_Msk (0x1ul << CLK_PLLCTL_OE_Pos) /*!< CLK_T::PLLCTL: OE Mask */ - -#define CLK_PLLCTL_PLLSRC_Pos (19) /*!< CLK_T::PLLCTL: PLLSRC Position */ -#define CLK_PLLCTL_PLLSRC_Msk (0x1ul << CLK_PLLCTL_PLLSRC_Pos) /*!< CLK_T::PLLCTL: PLLSRC Mask */ - -#define CLK_PLLCTL_STBSEL_Pos (23) /*!< CLK_T::PLLCTL: STBSEL Position */ -#define CLK_PLLCTL_STBSEL_Msk (0x1ul << CLK_PLLCTL_STBSEL_Pos) /*!< CLK_T::PLLCTL: STBSEL Mask */ - -#define CLK_STATUS_HXTSTB_Pos (0) /*!< CLK_T::STATUS: HXTSTB Position */ -#define CLK_STATUS_HXTSTB_Msk (0x1ul << CLK_STATUS_HXTSTB_Pos) /*!< CLK_T::STATUS: HXTSTB Mask */ - -#define CLK_STATUS_LXTSTB_Pos (1) /*!< CLK_T::STATUS: LXTSTB Position */ -#define CLK_STATUS_LXTSTB_Msk (0x1ul << CLK_STATUS_LXTSTB_Pos) /*!< CLK_T::STATUS: LXTSTB Mask */ - -#define CLK_STATUS_PLLSTB_Pos (2) /*!< CLK_T::STATUS: PLLSTB Position */ -#define CLK_STATUS_PLLSTB_Msk (0x1ul << CLK_STATUS_PLLSTB_Pos) /*!< CLK_T::STATUS: PLLSTB Mask */ - -#define CLK_STATUS_LIRCSTB_Pos (3) /*!< CLK_T::STATUS: LIRCSTB Position */ -#define CLK_STATUS_LIRCSTB_Msk (0x1ul << CLK_STATUS_LIRCSTB_Pos) /*!< CLK_T::STATUS: LIRCSTB Mask */ - -#define CLK_STATUS_HIRCSTB_Pos (4) /*!< CLK_T::STATUS: HIRCSTB Position */ -#define CLK_STATUS_HIRCSTB_Msk (0x1ul << CLK_STATUS_HIRCSTB_Pos) /*!< CLK_T::STATUS: HIRCSTB Mask */ - -#define CLK_STATUS_HIRC48MSTB_Pos (6) /*!< CLK_T::STATUS: HIRC48MSTB Position */ -#define CLK_STATUS_HIRC48MSTB_Msk (0x1ul << CLK_STATUS_HIRC48MSTB_Pos) /*!< CLK_T::STATUS: HIRC48MSTB Mask */ - -#define CLK_STATUS_CLKSFAIL_Pos (7) /*!< CLK_T::STATUS: CLKSFAIL Position */ -#define CLK_STATUS_CLKSFAIL_Msk (0x1ul << CLK_STATUS_CLKSFAIL_Pos) /*!< CLK_T::STATUS: CLKSFAIL Mask */ - -#define CLK_CLKOCTL_FREQSEL_Pos (0) /*!< CLK_T::CLKOCTL: FREQSEL Position */ -#define CLK_CLKOCTL_FREQSEL_Msk (0xful << CLK_CLKOCTL_FREQSEL_Pos) /*!< CLK_T::CLKOCTL: FREQSEL Mask */ - -#define CLK_CLKOCTL_CLKOEN_Pos (4) /*!< CLK_T::CLKOCTL: CLKOEN Position */ -#define CLK_CLKOCTL_CLKOEN_Msk (0x1ul << CLK_CLKOCTL_CLKOEN_Pos) /*!< CLK_T::CLKOCTL: CLKOEN Mask */ - -#define CLK_CLKOCTL_DIV1EN_Pos (5) /*!< CLK_T::CLKOCTL: DIV1EN Position */ -#define CLK_CLKOCTL_DIV1EN_Msk (0x1ul << CLK_CLKOCTL_DIV1EN_Pos) /*!< CLK_T::CLKOCTL: DIV1EN Mask */ - -#define CLK_CLKOCTL_CLK1HZEN_Pos (6) /*!< CLK_T::CLKOCTL: CLK1HZEN Position */ -#define CLK_CLKOCTL_CLK1HZEN_Msk (0x1ul << CLK_CLKOCTL_CLK1HZEN_Pos) /*!< CLK_T::CLKOCTL: CLK1HZEN Mask */ - -#define CLK_CLKDCTL_HXTFDEN_Pos (4) /*!< CLK_T::CLKDCTL: HXTFDEN Position */ -#define CLK_CLKDCTL_HXTFDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFDEN Mask */ - -#define CLK_CLKDCTL_HXTFIEN_Pos (5) /*!< CLK_T::CLKDCTL: HXTFIEN Position */ -#define CLK_CLKDCTL_HXTFIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFIEN Mask */ - -#define CLK_CLKDCTL_LXTFDEN_Pos (12) /*!< CLK_T::CLKDCTL: LXTFDEN Position */ -#define CLK_CLKDCTL_LXTFDEN_Msk (0x1ul << CLK_CLKDCTL_LXTFDEN_Pos) /*!< CLK_T::CLKDCTL: LXTFDEN Mask */ - -#define CLK_CLKDCTL_LXTFIEN_Pos (13) /*!< CLK_T::CLKDCTL: LXTFIEN Position */ -#define CLK_CLKDCTL_LXTFIEN_Msk (0x1ul << CLK_CLKDCTL_LXTFIEN_Pos) /*!< CLK_T::CLKDCTL: LXTFIEN Mask */ - -#define CLK_CLKDCTL_HXTFQDEN_Pos (16) /*!< CLK_T::CLKDCTL: HXTFQDEN Position */ -#define CLK_CLKDCTL_HXTFQDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQDEN Mask */ - -#define CLK_CLKDCTL_HXTFQIEN_Pos (17) /*!< CLK_T::CLKDCTL: HXTFQIEN Position */ -#define CLK_CLKDCTL_HXTFQIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQIEN Mask */ - -#define CLK_CLKDSTS_HXTFIF_Pos (0) /*!< CLK_T::CLKDSTS: HXTFIF Position */ -#define CLK_CLKDSTS_HXTFIF_Msk (0x1ul << CLK_CLKDSTS_HXTFIF_Pos) /*!< CLK_T::CLKDSTS: HXTFIF Mask */ - -#define CLK_CLKDSTS_LXTFIF_Pos (1) /*!< CLK_T::CLKDSTS: LXTFIF Position */ -#define CLK_CLKDSTS_LXTFIF_Msk (0x1ul << CLK_CLKDSTS_LXTFIF_Pos) /*!< CLK_T::CLKDSTS: LXTFIF Mask */ - -#define CLK_CLKDSTS_HXTFQIF_Pos (8) /*!< CLK_T::CLKDSTS: HXTFQIF Position */ -#define CLK_CLKDSTS_HXTFQIF_Msk (0x1ul << CLK_CLKDSTS_HXTFQIF_Pos) /*!< CLK_T::CLKDSTS: HXTFQIF Mask */ - -#define CLK_CDUPB_UPERBD_Pos (0) /*!< CLK_T::CDUPB: UPERBD Position */ -#define CLK_CDUPB_UPERBD_Msk (0x3fful << CLK_CDUPB_UPERBD_Pos) /*!< CLK_T::CDUPB: UPERBD Mask */ - -#define CLK_CDLOWB_LOWERBD_Pos (0) /*!< CLK_T::CDLOWB: LOWERBD Position */ -#define CLK_CDLOWB_LOWERBD_Msk (0x3fful << CLK_CDLOWB_LOWERBD_Pos) /*!< CLK_T::CDLOWB: LOWERBD Mask */ - -#define CLK_PMUCTL_PDMSEL_Pos (0) /*!< CLK_T::PMUCTL: PDMSEL Position */ -#define CLK_PMUCTL_PDMSEL_Msk (0x7ul << CLK_PMUCTL_PDMSEL_Pos) /*!< CLK_T::PMUCTL: PDMSEL Mask */ - -#define CLK_PMUCTL_DPDHOLDEN_Pos (3) /*!< CLK_T::PMUCTL: DPDHOLDEN Position */ -#define CLK_PMUCTL_DPDHOLDEN_Msk (0x1ul << CLK_PMUCTL_DPDHOLDEN_Pos) /*!< CLK_T::PMUCTL: DPDHOLDEN Mask */ - -#define CLK_PMUCTL_SRETSEL_Pos (4) /*!< CLK_T::PMUCTL: SRETSEL Position */ -#define CLK_PMUCTL_SRETSEL_Msk (0x7ul << CLK_PMUCTL_SRETSEL_Pos) /*!< CLK_T::PMUCTL: SRETSEL Mask */ - -#define CLK_PMUCTL_WKTMREN_Pos (8) /*!< CLK_T::PMUCTL: WKTMREN Position */ -#define CLK_PMUCTL_WKTMREN_Msk (0x1ul << CLK_PMUCTL_WKTMREN_Pos) /*!< CLK_T::PMUCTL: WKTMREN Mask */ - -#define CLK_PMUCTL_WKTMRIS_Pos (9) /*!< CLK_T::PMUCTL: WKTMRIS Position */ -#define CLK_PMUCTL_WKTMRIS_Msk (0xful << CLK_PMUCTL_WKTMRIS_Pos) /*!< CLK_T::PMUCTL: WKTMRIS Mask */ - -#define CLK_PMUCTL_WKPINEN_Pos (16) /*!< CLK_T::PMUCTL: WKPINEN Position */ -#define CLK_PMUCTL_WKPINEN_Msk (0x3ul << CLK_PMUCTL_WKPINEN_Pos) /*!< CLK_T::PMUCTL: WKPINEN Mask */ - -#define CLK_PMUCTL_ACMPSPWK_Pos (18) /*!< CLK_T::PMUCTL: ACMPSPWK Position */ -#define CLK_PMUCTL_ACMPSPWK_Msk (0x1ul << CLK_PMUCTL_ACMPSPWK_Pos) /*!< CLK_T::PMUCTL: ACMPSPWK Mask */ - -#define CLK_PMUCTL_RTCWKEN_Pos (23) /*!< CLK_T::PMUCTL: RTCWKEN Position */ -#define CLK_PMUCTL_RTCWKEN_Msk (0x1ul << CLK_PMUCTL_RTCWKEN_Pos) /*!< CLK_T::PMUCTL: RTCWKEN Mask */ - -#define CLK_PMUCTL_WKPINEN1_Pos (24) /*!< CLK_T::PMUCTL: WKPINEN1 Position */ -#define CLK_PMUCTL_WKPINEN1_Msk (0x3ul << CLK_PMUCTL_WKPINEN1_Pos) /*!< CLK_T::PMUCTL: WKPINEN1 Mask */ - -#define CLK_PMUCTL_WKPINEN2_Pos (26) /*!< CLK_T::PMUCTL: WKPINEN2 Position */ -#define CLK_PMUCTL_WKPINEN2_Msk (0x3ul << CLK_PMUCTL_WKPINEN2_Pos) /*!< CLK_T::PMUCTL: WKPINEN2 Mask */ - -#define CLK_PMUCTL_WKPINEN3_Pos (28) /*!< CLK_T::PMUCTL: WKPINEN3 Position */ -#define CLK_PMUCTL_WKPINEN3_Msk (0x3ul << CLK_PMUCTL_WKPINEN3_Pos) /*!< CLK_T::PMUCTL: WKPINEN3 Mask */ - -#define CLK_PMUCTL_WKPINEN4_Pos (30) /*!< CLK_T::PMUCTL: WKPINEN4 Position */ -#define CLK_PMUCTL_WKPINEN4_Msk (0x3ul << CLK_PMUCTL_WKPINEN4_Pos) /*!< CLK_T::PMUCTL: WKPINEN4 Mask */ - -#define CLK_PMUSTS_PINWK_Pos (0) /*!< CLK_T::PMUSTS: PINWK Position */ -#define CLK_PMUSTS_PINWK_Msk (0x1ul << CLK_PMUSTS_PINWK_Pos) /*!< CLK_T::PMUSTS: PINWK Mask */ - -#define CLK_PMUSTS_TMRWK_Pos (1) /*!< CLK_T::PMUSTS: TMRWK Position */ -#define CLK_PMUSTS_TMRWK_Msk (0x1ul << CLK_PMUSTS_TMRWK_Pos) /*!< CLK_T::PMUSTS: TMRWK Mask */ - -#define CLK_PMUSTS_RTCWK_Pos (2) /*!< CLK_T::PMUSTS: RTCWK Position */ -#define CLK_PMUSTS_RTCWK_Msk (0x1ul << CLK_PMUSTS_RTCWK_Pos) /*!< CLK_T::PMUSTS: RTCWK Mask */ - -#define CLK_PMUSTS_PINWK1_Pos (3) /*!< CLK_T::PMUSTS: PINWK1 Position */ -#define CLK_PMUSTS_PINWK1_Msk (0x1ul << CLK_PMUSTS_PINWK1_Pos) /*!< CLK_T::PMUSTS: PINWK1 Mask */ - -#define CLK_PMUSTS_PINWK2_Pos (4) /*!< CLK_T::PMUSTS: PINWK2 Position */ -#define CLK_PMUSTS_PINWK2_Msk (0x1ul << CLK_PMUSTS_PINWK2_Pos) /*!< CLK_T::PMUSTS: PINWK2 Mask */ - -#define CLK_PMUSTS_PINWK3_Pos (5) /*!< CLK_T::PMUSTS: PINWK3 Position */ -#define CLK_PMUSTS_PINWK3_Msk (0x1ul << CLK_PMUSTS_PINWK3_Pos) /*!< CLK_T::PMUSTS: PINWK3 Mask */ - -#define CLK_PMUSTS_PINWK4_Pos (6) /*!< CLK_T::PMUSTS: PINWK4 Position */ -#define CLK_PMUSTS_PINWK4_Msk (0x1ul << CLK_PMUSTS_PINWK4_Pos) /*!< CLK_T::PMUSTS: PINWK4 Mask */ - -#define CLK_PMUSTS_GPAWK_Pos (8) /*!< CLK_T::PMUSTS: GPAWK Position */ -#define CLK_PMUSTS_GPAWK_Msk (0x1ul << CLK_PMUSTS_GPAWK_Pos) /*!< CLK_T::PMUSTS: GPAWK Mask */ - -#define CLK_PMUSTS_GPBWK_Pos (9) /*!< CLK_T::PMUSTS: GPBWK Position */ -#define CLK_PMUSTS_GPBWK_Msk (0x1ul << CLK_PMUSTS_GPBWK_Pos) /*!< CLK_T::PMUSTS: GPBWK Mask */ - -#define CLK_PMUSTS_GPCWK_Pos (10) /*!< CLK_T::PMUSTS: GPCWK Position */ -#define CLK_PMUSTS_GPCWK_Msk (0x1ul << CLK_PMUSTS_GPCWK_Pos) /*!< CLK_T::PMUSTS: GPCWK Mask */ - -#define CLK_PMUSTS_GPDWK_Pos (11) /*!< CLK_T::PMUSTS: GPDWK Position */ -#define CLK_PMUSTS_GPDWK_Msk (0x1ul << CLK_PMUSTS_GPDWK_Pos) /*!< CLK_T::PMUSTS: GPDWK Mask */ - -#define CLK_PMUSTS_LVRWK_Pos (12) /*!< CLK_T::PMUSTS: LVRWK Position */ -#define CLK_PMUSTS_LVRWK_Msk (0x1ul << CLK_PMUSTS_LVRWK_Pos) /*!< CLK_T::PMUSTS: LVRWK Mask */ - -#define CLK_PMUSTS_BODWK_Pos (13) /*!< CLK_T::PMUSTS: BODWK Position */ -#define CLK_PMUSTS_BODWK_Msk (0x1ul << CLK_PMUSTS_BODWK_Pos) /*!< CLK_T::PMUSTS: BODWK Mask */ - -#define CLK_PMUSTS_ACMPWK_Pos (14) /*!< CLK_T::PMUSTS: ACMPWK Position */ -#define CLK_PMUSTS_ACMPWK_Msk (0x1ul << CLK_PMUSTS_ACMPWK_Pos) /*!< CLK_T::PMUSTS: ACMPWK Mask */ - -#define CLK_PMUSTS_CLRWK_Pos (31) /*!< CLK_T::PMUSTS: CLRWK Position */ -#define CLK_PMUSTS_CLRWK_Msk (0x1ul << CLK_PMUSTS_CLRWK_Pos) /*!< CLK_T::PMUSTS: CLRWK Mask */ - -#define CLK_LDOCTL_PDBIASEN_Pos (18) /*!< CLK_T::LDOCTL: PDBIASEN Position */ -#define CLK_LDOCTL_PDBIASEN_Msk (0x1ul << CLK_LDOCTL_PDBIASEN_Pos) /*!< CLK_T::LDOCTL: PDBIASEN Mask */ - -#define CLK_SWKDBCTL_SWKDBCLKSEL_Pos (0) /*!< CLK_T::SWKDBCTL: SWKDBCLKSEL Position */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_Msk (0xful << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< CLK_T::SWKDBCTL: SWKDBCLKSEL Mask */ - -#define CLK_PASWKCTL_WKEN_Pos (0) /*!< CLK_T::PASWKCTL: WKEN Position */ -#define CLK_PASWKCTL_WKEN_Msk (0x1ul << CLK_PASWKCTL_WKEN_Pos) /*!< CLK_T::PASWKCTL: WKEN Mask */ - -#define CLK_PASWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PASWKCTL: PRWKEN Position */ -#define CLK_PASWKCTL_PRWKEN_Msk (0x1ul << CLK_PASWKCTL_PRWKEN_Pos) /*!< CLK_T::PASWKCTL: PRWKEN Mask */ - -#define CLK_PASWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PASWKCTL: PFWKEN Position */ -#define CLK_PASWKCTL_PFWKEN_Msk (0x1ul << CLK_PASWKCTL_PFWKEN_Pos) /*!< CLK_T::PASWKCTL: PFWKEN Mask */ - -#define CLK_PASWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PASWKCTL: WKPSEL Position */ -#define CLK_PASWKCTL_WKPSEL_Msk (0xful << CLK_PASWKCTL_WKPSEL_Pos) /*!< CLK_T::PASWKCTL: WKPSEL Mask */ - -#define CLK_PASWKCTL_DBEN_Pos (8) /*!< CLK_T::PASWKCTL: DBEN Position */ -#define CLK_PASWKCTL_DBEN_Msk (0x1ul << CLK_PASWKCTL_DBEN_Pos) /*!< CLK_T::PASWKCTL: DBEN Mask */ - -#define CLK_PBSWKCTL_WKEN_Pos (0) /*!< CLK_T::PBSWKCTL: WKEN Position */ -#define CLK_PBSWKCTL_WKEN_Msk (0x1ul << CLK_PBSWKCTL_WKEN_Pos) /*!< CLK_T::PBSWKCTL: WKEN Mask */ - -#define CLK_PBSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PBSWKCTL: PRWKEN Position */ -#define CLK_PBSWKCTL_PRWKEN_Msk (0x1ul << CLK_PBSWKCTL_PRWKEN_Pos) /*!< CLK_T::PBSWKCTL: PRWKEN Mask */ - -#define CLK_PBSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PBSWKCTL: PFWKEN Position */ -#define CLK_PBSWKCTL_PFWKEN_Msk (0x1ul << CLK_PBSWKCTL_PFWKEN_Pos) /*!< CLK_T::PBSWKCTL: PFWKEN Mask */ - -#define CLK_PBSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PBSWKCTL: WKPSEL Position */ -#define CLK_PBSWKCTL_WKPSEL_Msk (0xful << CLK_PBSWKCTL_WKPSEL_Pos) /*!< CLK_T::PBSWKCTL: WKPSEL Mask */ - -#define CLK_PBSWKCTL_DBEN_Pos (8) /*!< CLK_T::PBSWKCTL: DBEN Position */ -#define CLK_PBSWKCTL_DBEN_Msk (0x1ul << CLK_PBSWKCTL_DBEN_Pos) /*!< CLK_T::PBSWKCTL: DBEN Mask */ - -#define CLK_PCSWKCTL_WKEN_Pos (0) /*!< CLK_T::PCSWKCTL: WKEN Position */ -#define CLK_PCSWKCTL_WKEN_Msk (0x1ul << CLK_PCSWKCTL_WKEN_Pos) /*!< CLK_T::PCSWKCTL: WKEN Mask */ - -#define CLK_PCSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PCSWKCTL: PRWKEN Position */ -#define CLK_PCSWKCTL_PRWKEN_Msk (0x1ul << CLK_PCSWKCTL_PRWKEN_Pos) /*!< CLK_T::PCSWKCTL: PRWKEN Mask */ - -#define CLK_PCSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PCSWKCTL: PFWKEN Position */ -#define CLK_PCSWKCTL_PFWKEN_Msk (0x1ul << CLK_PCSWKCTL_PFWKEN_Pos) /*!< CLK_T::PCSWKCTL: PFWKEN Mask */ - -#define CLK_PCSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PCSWKCTL: WKPSEL Position */ -#define CLK_PCSWKCTL_WKPSEL_Msk (0xful << CLK_PCSWKCTL_WKPSEL_Pos) /*!< CLK_T::PCSWKCTL: WKPSEL Mask */ - -#define CLK_PCSWKCTL_DBEN_Pos (8) /*!< CLK_T::PCSWKCTL: DBEN Position */ -#define CLK_PCSWKCTL_DBEN_Msk (0x1ul << CLK_PCSWKCTL_DBEN_Pos) /*!< CLK_T::PCSWKCTL: DBEN Mask */ - -#define CLK_PDSWKCTL_WKEN_Pos (0) /*!< CLK_T::PDSWKCTL: WKEN Position */ -#define CLK_PDSWKCTL_WKEN_Msk (0x1ul << CLK_PDSWKCTL_WKEN_Pos) /*!< CLK_T::PDSWKCTL: WKEN Mask */ - -#define CLK_PDSWKCTL_PRWKEN_Pos (1) /*!< CLK_T::PDSWKCTL: PRWKEN Position */ -#define CLK_PDSWKCTL_PRWKEN_Msk (0x1ul << CLK_PDSWKCTL_PRWKEN_Pos) /*!< CLK_T::PDSWKCTL: PRWKEN Mask */ - -#define CLK_PDSWKCTL_PFWKEN_Pos (2) /*!< CLK_T::PDSWKCTL: PFWKEN Position */ -#define CLK_PDSWKCTL_PFWKEN_Msk (0x1ul << CLK_PDSWKCTL_PFWKEN_Pos) /*!< CLK_T::PDSWKCTL: PFWKEN Mask */ - -#define CLK_PDSWKCTL_WKPSEL_Pos (4) /*!< CLK_T::PDSWKCTL: WKPSEL Position */ -#define CLK_PDSWKCTL_WKPSEL_Msk (0xful << CLK_PDSWKCTL_WKPSEL_Pos) /*!< CLK_T::PDSWKCTL: WKPSEL Mask */ - -#define CLK_PDSWKCTL_DBEN_Pos (8) /*!< CLK_T::PDSWKCTL: DBEN Position */ -#define CLK_PDSWKCTL_DBEN_Msk (0x1ul << CLK_PDSWKCTL_DBEN_Pos) /*!< CLK_T::PDSWKCTL: DBEN Mask */ - -#define CLK_IOPDCTL_IOHR_Pos (0) /*!< CLK_T::IOPDCTL: IOHR Position */ -#define CLK_IOPDCTL_IOHR_Msk (0x1ul << CLK_IOPDCTL_IOHR_Pos) /*!< CLK_T::IOPDCTL: IOHR Mask */ - -/**@}*/ /* CLK_CONST */ -/**@}*/ /* end of CLK register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __CLK_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crc_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crc_reg.h deleted file mode 100644 index 118f79739a3..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crc_reg.h +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************//** - * @file crc_reg.h - * @version V1.00 - * @brief CRC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CRC_REG_H__ -#define __CRC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CRC Cyclic Redundancy Check Controller(CRC) - Memory Mapped Structure for CRC Controller -@{ */ - -typedef struct -{ - - - /** - * @var CRC_T::CTL - * Offset: 0x00 CRC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRCEN |CRC Channel Enable Bit - * | | |0 = No effect. - * | | |1 = CRC operation Enabled. - * |[1] |CHKSINIT |Checksum Initialization - * | | |0 = No effect. - * | | |1 = Initial checksum value by auto reload CRC_SEED register value to CRC_CHECKSUM register value. - * | | |Note: This bit will be cleared automatically. - * |[24] |DATREV |Write Data Bit Order Reverse - * | | |This bit is used to enable the bit order reverse function per byte for write data value in CRC_DAT register. - * | | |0 = Bit order reversed for CRC write data in Disabled. - * | | |1 = Bit order reversed for CRC write data in Enabled (per byte). - * | | |Note: If the write data is 0xAABBCCDD, the bit order reverse for CRC write data in is 0x55DD33BB. - * |[25] |CHKSREV |Checksum Bit Order Reverse - * | | |This bit is used to enable the bit order reverse function for checksum result in CRC_CHECKSUM register. - * | | |0 = Bit order reverse for CRC checksum Disabled. - * | | |1 = Bit order reverse for CRC checksum Enabled. - * | | |Note: If the checksum result is 0xDD7B0F2E, the bit order reverse for CRC checksum is 0x74F0DEBB. - * |[26] |DATFMT |Write Data 1's Complement - * | | |This bit is used to enable the 1's complement function for write data value in CRC_DAT register. - * | | |0 = 1's complement for CRC writes data in Disabled. - * | | |1 = 1's complement for CRC writes data in Enabled. - * |[27] |CHKSFMT |Checksum 1's Complement - * | | |This bit is used to enable the 1's complement function for checksum result in CRC_CHECKSUM register. - * | | |0 = 1's complement for CRC checksum Disabled. - * | | |1 = 1's complement for CRC checksum Enabled. - * |[29:28] |DATLEN |CPU Write Data Length - * | | |This field indicates the write data length. - * | | |00 = Data length is 8-bit mode. - * | | |01 = Data length is 16-bit mode. - * | | |1x = Data length is 32-bit mode. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0] - * |[31:30] |CRCMODE |CRC Polynomial Mode - * | | |This field indicates the CRC operation polynomial mode. - * | | |00 = CRC-CCITT Polynomial mode. - * | | |01 = CRC-8 Polynomial mode. - * | | |10 = CRC-16 Polynomial mode. - * | | |11 = CRC-32 Polynomial mode. - * @var CRC_T::DAT - * Offset: 0x04 CRC Write Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |CRC Write Data Bits - * | | |User can write data directly by CPU mode or use PDMA function to write data to this field to perform CRC operation. - * | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0]. - * @var CRC_T::SEED - * Offset: 0x08 CRC Seed Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |CRC Seed Value - * | | |This field indicates the CRC seed value. - * | | |Note: This field will be reloaded as checksum initial value (CRC_CHECKSUM register) after perform CHKSINIT (CRC_CTL[1]). - * @var CRC_T::CHECKSUM - * Offset: 0x0C CRC Checksum Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CHECKSUM |CRC Checksum Results - * | | |This field indicates the CRC checksum result. - */ - __IO uint32_t CTL; /*!< [0x0000] CRC Control Register */ - __IO uint32_t DAT; /*!< [0x0004] CRC Write Data Register */ - __IO uint32_t SEED; /*!< [0x0008] CRC Seed Register */ - __I uint32_t CHECKSUM; /*!< [0x000c] CRC Checksum Register */ - -} CRC_T; - -/** - @addtogroup CRC_CONST CRC Bit Field Definition - Constant Definitions for CRC Controller -@{ */ - -#define CRC_CTL_CRCEN_Pos (0) /*!< CRC_T::CTL: CRCEN Position */ -#define CRC_CTL_CRCEN_Msk (0x1ul << CRC_CTL_CRCEN_Pos) /*!< CRC_T::CTL: CRCEN Mask */ - -#define CRC_CTL_CHKSINIT_Pos (1) /*!< CRC_T::CTL: CHKSINIT Position */ -#define CRC_CTL_CHKSINIT_Msk (0x1ul << CRC_CTL_CHKSINIT_Pos) /*!< CRC_T::CTL: CHKSINIT Mask */ - -#define CRC_CTL_DATREV_Pos (24) /*!< CRC_T::CTL: DATREV Position */ -#define CRC_CTL_DATREV_Msk (0x1ul << CRC_CTL_DATREV_Pos) /*!< CRC_T::CTL: DATREV Mask */ - -#define CRC_CTL_CHKSREV_Pos (25) /*!< CRC_T::CTL: CHKSREV Position */ -#define CRC_CTL_CHKSREV_Msk (0x1ul << CRC_CTL_CHKSREV_Pos) /*!< CRC_T::CTL: CHKSREV Mask */ - -#define CRC_CTL_DATFMT_Pos (26) /*!< CRC_T::CTL: DATFMT Position */ -#define CRC_CTL_DATFMT_Msk (0x1ul << CRC_CTL_DATFMT_Pos) /*!< CRC_T::CTL: DATFMT Mask */ - -#define CRC_CTL_CHKSFMT_Pos (27) /*!< CRC_T::CTL: CHKSFMT Position */ -#define CRC_CTL_CHKSFMT_Msk (0x1ul << CRC_CTL_CHKSFMT_Pos) /*!< CRC_T::CTL: CHKSFMT Mask */ - -#define CRC_CTL_DATLEN_Pos (28) /*!< CRC_T::CTL: DATLEN Position */ -#define CRC_CTL_DATLEN_Msk (0x3ul << CRC_CTL_DATLEN_Pos) /*!< CRC_T::CTL: DATLEN Mask */ - -#define CRC_CTL_CRCMODE_Pos (30) /*!< CRC_T::CTL: CRCMODE Position */ -#define CRC_CTL_CRCMODE_Msk (0x3ul << CRC_CTL_CRCMODE_Pos) /*!< CRC_T::CTL: CRCMODE Mask */ - -#define CRC_DAT_DATA_Pos (0) /*!< CRC_T::DAT: DATA Position */ -#define CRC_DAT_DATA_Msk (0xfffffffful << CRC_DAT_DATA_Pos) /*!< CRC_T::DAT: DATA Mask */ - -#define CRC_SEED_SEED_Pos (0) /*!< CRC_T::SEED: SEED Position */ -#define CRC_SEED_SEED_Msk (0xfffffffful << CRC_SEED_SEED_Pos) /*!< CRC_T::SEED: SEED Mask */ - -#define CRC_CHECKSUM_CHECKSUM_Pos (0) /*!< CRC_T::CHECKSUM: CHECKSUM Position */ -#define CRC_CHECKSUM_CHECKSUM_Msk (0xfffffffful << CRC_CHECKSUM_CHECKSUM_Pos) /*!< CRC_T::CHECKSUM: CHECKSUM Mask */ - -/**@}*/ /* CRC_CONST */ -/**@}*/ /* end of CRC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __CRC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crypto_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crypto_reg.h deleted file mode 100644 index f385975cb4d..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/crypto_reg.h +++ /dev/null @@ -1,2219 +0,0 @@ -/**************************************************************************//** - * @file crypto_reg.h - * @version V1.00 - * @brief CRYPTO register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CRYPTO_REG_H__ -#define __CRYPTO_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CRPT Cryptographic Accelerator(CRPT) - Memory Mapped Structure for Cryptographic Accelerator -@{ */ - -typedef struct -{ - - /** - * @var CRPT_T::INTEN - * Offset: 0x00 Crypto Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIEN |AES Interrupt Enable Control - * | | |0 = AES interrupt Disabled. - * | | |1 = AES interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in AES_DMA_CNT is fed into the AES engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the AES engine finishes the operation. - * |[1] |AESEIEN |AES Error Flag Enable Control - * | | |0 = AES error interrupt flag Disabled. - * | | |1 = AES error interrupt flag Enabled. - * |[8] |TDESIEN |TDES/DES Interrupt Enable Control - * | | |0 = TDES/DES interrupt Disabled. - * | | |1 = TDES/DES interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in TDES_DMA_CNT is fed into the TDES engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the TDES engine finishes the operation. - * |[9] |TDESEIEN |TDES/DES Error Flag Enable Control - * | | |0 = TDES/DES error interrupt flag Disabled. - * | | |1 = TDES/DES error interrupt flag Enabled. - * |[16] |PRNGIEN |PRNG Interrupt Enable Control - * | | |0 = PRNG interrupt Disabled. - * | | |1 = PRNG interrupt Enabled. - * |[22] |ECCIEN |ECC Interrupt Enable Control - * | | |0 = ECC interrupt Disabled. - * | | |1 = ECC interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in ECC_DMA_CNT is fed into the ECC engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the ECC engine finishes the operation. - * |[23] |ECCEIEN |ECC Error Interrupt Enable Control - * | | |0 = ECC error interrupt flag Disabled. - * | | |1 = ECC error interrupt flag Enabled. - * |[24] |HMACIEN |SHA/HMAC Interrupt Enable Control - * | | |0 = SHA/HMAC interrupt Disabled. - * | | |1 = SHA/HMAC interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in SHA _DMA_CNT is fed into the SHA/HMAC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the SHA/HMAC engine finishes the operation. - * |[25] |HMACEIEN |SHA/HMAC Error Interrupt Enable Control - * | | |0 = SHA/HMAC error interrupt flag Disabled. - * | | |1 = SHA/HMAC error interrupt flag Enabled. - * @var CRPT_T::INTSTS - * Offset: 0x04 Crypto Interrupt Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIF |AES Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No AES interrupt. - * | | |= AES encryption/decryption done interrupt. - * |[1] |AESEIF |AES Error Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No AES error. - * | | |1 = AES encryption/decryption done interrupt. - * |[8] |TDESIF |TDES/DES Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No TDES/DES interrupt. - * | | |1 = TDES/DES encryption/decryption done interrupt. - * |[9] |TDESEIF |TDES/DES Error Flag - * | | |This bit includes the operating and setting error - * | | |The detailed flag is shown in the CRPT_TDES_STS register - * | | |This includes operating and setting error. - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No TDES/DES error. - * | | |1 = TDES/DES encryption/decryption error interrupt. - * |[16] |PRNGIF |PRNG Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No PRNG interrupt. - * | | |1 = PRNG key generation done interrupt. - * |[22] |ECCIF |ECC Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No ECC interrupt. - * | | |1 = ECC operation done interrupt. - * |[23] |ECCEIF |ECC Error Flag - * | | |This register includes operating and setting error. The detail flag is shown in CRPT_ECC_STS register. - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No ECC error. - * | | |1 = ECC error interrupt. - * |[24] |HMACIF |SHA/HMAC Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No SHA/HMAC interrupt. - * | | |1 = SHA/HMAC operation done interrupt. - * |[25] |HMACEIF |SHA/HMAC Error Flag - * | | |This register includes operating and setting error. The detail flag is shown in CRPT_HMAC_STS register. - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No SHA/HMAC error. - * | | |1 = SHA/HMAC error interrupt. - * @var CRPT_T::PRNG_CTL - * Offset: 0x08 PRNG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Start PRNG Engine - * | | |0 = Stop PRNG engine. - * | | |1 = Generate new key and store the new key to register CRPT_PRNG_KEYx , which will be cleared when the new key is generated. - * |[1] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * |[3:2] |KEYSZ |PRNG Generate Key Size - * | | |00 = 64 bits. - * | | |01 = 128 bits. - * | | |10 = 192 bits. - * | | |11 = 256 bits. - * |[8] |BUSY |PRNG Busy (Read Only) - * | | |0 = PRNG engine is idle. - * | | |1 = Indicate that the PRNG engine is generating CRPT_PRNG_KEYx. - * @var CRPT_T::PRNG_SEED - * Offset: 0x0C Seed for PRNG - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed for PRNG (Write Only) - * | | |The bits store the seed for PRNG engine. - * @var CRPT_T::PRNG_KEY[8] - * Offset: 0x10 ~ 0x2C PRNG Generated Key0 ~ Key7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::AES_FDBCK[4] - * Offset: 0x50 ~ 0x5C AES Engine Output Feedback Data after Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AESn_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to this register in the same channel operation, and then continue the operation with the original setting. - * @var CRPT_T::TDES_FDBCKH - * Offset: 0x60 TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |TDES/DES Feedback - * | | |The feedback value is 64 bits in size. - * | | |The TDES/DES engine uses the data from {CRPT_TDES_FDBCKH, CRPT_TDES_FDBCKL} as the data inputted to {CRPT_TDESn_IVH, CRPT_TDESn_IVL} for the next block in DMA cascade mode - * | | |The feedback register is for CBC, CFB, and OFB mode. - * | | |TDES/DES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to this register in the same channel operation - * | | |Then can continue the operation with the original setting. - * @var CRPT_T::TDES_FDBCKL - * Offset: 0x64 TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |TDES/DES Feedback - * | | |The feedback value is 64 bits in size. - * | | |The TDES/DES engine uses the data from {CRPT_TDES_FDBCKH, CRPT_TDES_FDBCKL} as the data inputted to {CRPT_TDESn_IVH, CRPT_TDESn_IVL} for the next block in DMA cascade mode - * | | |The feedback register is for CBC, CFB, and OFB mode. - * | | |TDES/DES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to this register in the same channel operation - * | | |Then can continue the operation with the original setting. - * @var CRPT_T::AES_CTL - * Offset: 0x100 AES Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |AES Engine Start - * | | |0 = No effect. - * | | |1 = Start AES engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it's read back. - * |[1] |STOP |AES Engine Stop - * | | |0 = No effect. - * | | |1 = Stop AES engine. - * | | |Note: This bit is always 0 when it's read back. - * |[3:2] |KEYSZ |AES Key Size - * | | |This bit defines three different key size for AES operation. - * | | |2'b00 = 128 bits key. - * | | |2'b01 = 192 bits key. - * | | |2'b10 = 256 bits key. - * | | |2'b11 = Reserved. - * | | |If the AES accelerator is operating and the corresponding flag BUSY is 1, updating this register has no effect. - * |[5] |DMALAST |AES Last Block - * | | |In DMA mode, this bit must be set as beginning the last DMA cascade round. - * | | |In Non-DMA mode, this bit must be set when feeding in the last block of data in ECB, CBC, CTR, OFB, and CFB mode, and feeding in the (last-1) block of data at CBC-CS1, CBC-CS2, and CBC-CS3 mode. - * | | |This bit is always 0 when it's read back. Must be written again once START is triggered. - * |[6] |DMACSCAD |AES Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |AES Engine DMA Enable Control - * | | |0 = AES DMA engine Disabled. - * | | |The AES engine operates in Non-DMA mode, and gets data from the port CRPT_AES_DATIN. - * | | |1 = AES_DMA engine Enabled. - * | | |The AES engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[15:8] |OPMODE |AES Engine Operation Modes - * | | |0x00 = ECB (Electronic Codebook Mode) 0x01 = CBC (Cipher Block Chaining Mode). - * | | |0x02 = CFB (Cipher Feedback Mode). - * | | |0x03 = OFB (Output Feedback Mode). - * | | |0x04 = CTR (Counter Mode). - * | | |0x10 = CBC-CS1 (CBC Ciphertext-Stealing 1 Mode). - * | | |0x11 = CBC-CS2 (CBC Ciphertext-Stealing 2 Mode). - * | | |0x12 = CBC-CS3 (CBC Ciphertext-Stealing 3 Mode). - * |[16] |ENCRPT |AES Encryption/Decryption - * | | |0 = AES engine executes decryption operation. - * | | |1 = AES engine executes encryption operation. - * |[22] |OUTSWAP |AES Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU outputs data from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |AES Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[25:24] |CHANNEL |AES Engine Working Channel - * | | |00 = Current control register setting is for channel 0. - * | | |01 = Current control register setting is for channel 1. - * | | |10 = Current control register setting is for channel 2. - * | | |11 = Current control register setting is for channel 3. - * |[30:26] |KEYUNPRT |Unprotect Key - * | | |Writing 0 to CRPT_AES_CTL[31] and "10110" to CRPT_AES_CTL[30:26] is to unprotect the AES key. - * | | |The KEYUNPRT can be read and written - * | | |When it is written as the AES engine is operating, BUSY flag is 1, there would be no effect on KEYUNPRT. - * |[31] |KEYPRT |Protect Key - * | | |Read as a flag to reflect KEYPRT. - * | | |0 = No effect. - * | | |1 = Protect the content of the AES key from reading - * | | |The return value for reading CRPT_AESn_KEYx is not the content of the registers CRPT_AESn_KEYx - * | | |Once it is set, it can be cleared by asserting KEYUNPRT - * | | |And the key content would be cleared as well. - * @var CRPT_T::AES_STS - * Offset: 0x104 AES Engine Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |AES Engine Busy - * | | |0 = The AES engine is idle or finished. - * | | |1 = The AES engine is under processing. - * |[8] |INBUFEMPTY|AES Input Buffer Empty - * | | |0 = There are some data in input buffer waiting for the AES engine to process. - * | | |1 = AES input buffer is empty - * | | |Software needs to feed data to the AES engine - * | | |Otherwise, the AES engine will be pending to wait for input data. - * |[9] |INBUFFULL |AES Input Buffer Full Flag - * | | |0 = AES input buffer is not full. Software can feed the data into the AES engine. - * | | |1 = AES input buffer is full - * | | |Software cannot feed data to the AES engine - * | | |Otherwise, the flag INBUFERR will be set to 1. - * |[10] |INBUFERR |AES Input Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during feeding data to the AES engine. - * |[12] |CNTERR |CRPT_AESn_CNT Setting Error - * | | |0 = No error in CRPT_AESn_CNT setting. - * | | |1 = CRPT_AESn_CNT is not a multiply of 16 in ECB, CBC, CFB, OFB, and CTR mode. - * |[16] |OUTBUFEMPTY|AES Out Buffer Empty - * | | |0 = AES output buffer is not empty. There are some valid data kept in output buffer. - * | | |1 = AES output buffer is empty - * | | |Software cannot get data from CRPT_AES_DATOUT - * | | |Otherwise, the flag OUTBUFERR will be set to 1 since the output buffer is empty. - * |[17] |OUTBUFFULL|AES Out Buffer Full Flag - * | | |0 = AES output buffer is not full. - * | | |1 = AES output buffer is full, and software needs to get data from CRPT_AES_DATOUT - * | | |Otherwise, the AES engine will be pending since the output buffer is full. - * |[18] |OUTBUFERR |AES Out Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during getting the result from AES engine. - * |[20] |BUSERR |AES DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and AES engine. - * @var CRPT_T::AES_DATIN - * Offset: 0x108 AES Engine Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |AES Engine Input Port - * | | |CPU feeds data to AES engine through this port by checking CRPT_AES_STS. Feed data as INBUFFULL is 0. - * @var CRPT_T::AES_DATOUT - * Offset: 0x10C AES Engine Data Output Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATOUT |AES Engine Output Port - * | | |CPU gets results from the AES engine through this port by checking CRPT_AES_STS - * | | |Get data as OUTBUFEMPTY is 0. - * @var CRPT_T::AES0_KEY[8] - * Offset: 0x110 ~ 0x12C AES Key Word 0 ~ 7 Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AESn_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |n = 0, 1..3. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key - * | | |{CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 128-bit security key for AES operation - * | | |{CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 192-bit security key for AES operation - * | | |{CRPT_AESn_KEY7, CRPT_AESn_KEY6, CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES0_IV[4] - * Offset: 0x130 ~ 0x13C AES Initial Vector Word 0 ~ 3 Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |n = 0, 1..3. - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES0_SADDR - * Offset: 0x140 AES DMA Source Address Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text from system memory and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_SADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES0_DADDR - * Offset: 0x144 AES DMA Destination Address Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text back to system memory after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_DADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES0_CNT - * Offset: 0x148 AES Byte Count Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRPT_AESn_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRPT_AESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_AESn_CNT can be read and written - * | | |Writing to CRPT_AESn_CNT while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of CRPT_AESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be at least one block - * | | |Operations that are less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_AESn_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AESn_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * @var CRPT_T::AES1_KEY[8] - * Offset: 0x14C ~ 0x168 AES Key Word 0 ~ 7 Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AESn_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |n = 0, 1..3. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key - * | | |{CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 128-bit security key for AES operation - * | | |{CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 192-bit security key for AES operation - * | | |{CRPT_AESn_KEY7, CRPT_AESn_KEY6, CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES1_IV[4] - * Offset: 0x16C ~ 0x178 AES Initial Vector Word 0 ~ 3 Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |n = 0, 1..3. - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES1_SADDR - * Offset: 0x17C AES DMA Source Address Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text from system memory and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_SADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES1_DADDR - * Offset: 0x180 AES DMA Destination Address Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text back to system memory after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_DADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES1_CNT - * Offset: 0x184 AES Byte Count Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRPT_AESn_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRPT_AESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_AESn_CNT can be read and written - * | | |Writing to CRPT_AESn_CNT while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of CRPT_AESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be at least one block - * | | |Operations that are less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_AESn_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AESn_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * @var CRPT_T::AES2_KEY[8] - * Offset: 0x188 ~ 0x1A4 AES Key Word 0 ~ 7 Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AESn_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |n = 0, 1..3. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key - * | | |{CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 128-bit security key for AES operation - * | | |{CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 192-bit security key for AES operation - * | | |{CRPT_AESn_KEY7, CRPT_AESn_KEY6, CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES2_IV[4] - * Offset: 0x1A8 ~ 0x1B4 AES Initial Vector Word 0 ~ 3 Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |n = 0, 1..3. - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES2_SADDR - * Offset: 0x1B8 AES DMA Source Address Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text from system memory and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_SADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES2_DADDR - * Offset: 0x1BC AES DMA Destination Address Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text back to system memory after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_DADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES2_CNT - * Offset: 0x1C0 AES Byte Count Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRPT_AESn_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRPT_AESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_AESn_CNT can be read and written - * | | |Writing to CRPT_AESn_CNT while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of CRPT_AESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be at least one block - * | | |Operations that are less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_AESn_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AESn_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * @var CRPT_T::AES3_KEY[8] - * Offset: 0x1C4 ~ 0x1E0 AES Key Word 0 ~ 7 Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AESn_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |n = 0, 1..3. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key - * | | |{CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 128-bit security key for AES operation - * | | |{CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 192-bit security key for AES operation - * | | |{CRPT_AESn_KEY7, CRPT_AESn_KEY6, CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES3_IV[4] - * Offset: 0x1E4 ~ 0x1F0 AES Initial Vector Word 0 ~ 3 Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |n = 0, 1..3. - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES3_SADDR - * Offset: 0x1F4 AES DMA Source Address Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text from system memory and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_SADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES3_DADDR - * Offset: 0x1F8 AES DMA Destination Address Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text back to system memory after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_DADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES3_CNT - * Offset: 0x1FC AES Byte Count Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRPT_AESn_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRPT_AESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_AESn_CNT can be read and written - * | | |Writing to CRPT_AESn_CNT while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of CRPT_AESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be at least one block - * | | |Operations that are less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_AESn_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AESn_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * @var CRPT_T::TDES_CTL - * Offset: 0x200 TDES/DES Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |TDES/DES Engine Start - * | | |0 = No effect. - * | | |1 = Start TDES/DES engine. The flag BUSY would be set. - * | | |Note: The bit is always 0 when it's read back. - * |[1] |STOP |TDES/DES Engine Stop - * | | |0 = No effect. - * | | |1 = Stop TDES/DES engine. - * | | |Note: The bit is always 0 when it's read back. - * |[2] |TMODE |TDES/DES Engine Operating Mode - * | | |0 = Set DES mode for TDES/DES engine. - * | | |1 = Set Triple DES mode for TDES/DES engine. - * |[3] |3KEYS |TDES/DES Key Number - * | | |0 = Select KEY1 and KEY2 in TDES/DES engine. - * | | |1 = Triple keys in TDES/DES engine Enabled. - * |[5] |DMALAST |TDES/DES Engine Start for the Last Block - * | | |In DMA mode, this bit must be set as beginning the last DMA cascade round. - * | | |In Non-DMA mode, this bit must be set as feeding in last block of data. - * |[6] |DMACSCAD |TDES/DES Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA Cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |TDES/DES Engine DMA Enable Control - * | | |0 = TDES_DMA engine Disabled. - * | | |TDES engine operates in Non-DMA mode, and get data from the port CRPT_TDES_DATIN. - * | | |1 = TDES_DMA engine Enabled. - * | | |TDES engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[10:8] |OPMODE |TDES/DES Engine Operation Mode - * | | |0x00 = ECB (Electronic Codebook Mode). - * | | |0x01 = CBC (Cipher Block Chaining Mode). - * | | |0x02 = CFB (Cipher Feedback Mode). - * | | |0x03 = OFB (Output Feedback Mode). - * | | |0x04 = CTR (Counter Mode). - * | | |Others = CTR (Counter Mode). - * |[16] |ENCRPT |TDES/DES Encryption/Decryption - * | | |0 = TDES engine executes decryption operation. - * | | |1 = TDES engine executes encryption operation. - * |[21] |BLKSWAP |TDES/DES Engine Block Double Word Endian Swap - * | | |0 = Keep the original order, e.g. {WORD_H, WORD_L}. - * | | |1 = When this bit is set to 1, the TDES engine would exchange high and low word in the sequence {WORD_L, WORD_H}. - * |[22] |OUTSWAP |TDES/DES Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU outputs data from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |TDES/DES Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[25:24] |CHANNEL |TDES/DES Engine Working Channel - * | | |00 = Current control register setting is for channel 0. - * | | |01 = Current control register setting is for channel 1. - * | | |10 = Current control register setting is for channel 2. - * | | |11 = Current control register setting is for channel 3. - * |[30:26] |KEYUNPRT |Unprotect Key - * | | |Writing 0 to CRPT_TDES_CTL [31] and "10110" to CRPT_TDES_CTL [30:26] is to unprotect TDES key. - * | | |The KEYUNPRT can be read and written - * | | |When it is written as the TDES engine is operating, BUSY flag is 1, there would be no effect on KEYUNPRT. - * |[31] |KEYPRT |Protect Key - * | | |Read as a flag to reflect KEYPRT. - * | | |0 = No effect. - * | | |1 = This bit is to protect the content of TDES key from reading - * | | |The return value for reading CRPT_ TDESn_KEYxH/L is not the content in the registers CRPT_ TDESn_KEYxH/L - * | | |Once it is set, it can be cleared by asserting KEYUNPRT - * | | |The key content would be cleared as well. - * @var CRPT_T::TDES_STS - * Offset: 0x204 TDES/DES Engine Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |TDES/DES Engine Busy - * | | |0 = TDES/DES engine is idle or finished. - * | | |1 = TDES/DES engine is under processing. - * |[8] |INBUFEMPTY|TDES/DES in Buffer Empty - * | | |0 = There are some data in input buffer waiting for the TDES/DES engine to process. - * | | |1 = TDES/DES input buffer is empty - * | | |Software needs to feed data to the TDES/DES engine - * | | |Otherwise, the TDES/DES engine will be pending to wait for input data. - * |[9] |INBUFFULL |TDES/DES in Buffer Full Flag - * | | |0 = TDES/DES input buffer is not full. Software can feed the data into the TDES/DES engine. - * | | |1 = TDES input buffer is full - * | | |Software cannot feed data to the TDES/DES engine - * | | |Otherwise, the flag INBUFERR will be set to 1. - * |[10] |INBUFERR |TDES/DES in Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during feeding data to the TDES/DES engine. - * |[16] |OUTBUFEMPTY|TDES/DES Output Buffer Empty Flag - * | | |0 = TDES/DES output buffer is not empty. There are some valid data kept in output buffer. - * | | |1 = TDES/DES output buffer is empty, Software cannot get data from TDES_DATA_OUT - * | | |Otherwise the flag OUTBUFERR will be set to 1, since output buffer is empty. - * |[17] |OUTBUFFULL|TDES/DES Output Buffer Full Flag - * | | |0 = TDES/DES output buffer is not full. - * | | |1 = TDES/DES output buffer is full, and software needs to get data from TDES_DATA_OUT - * | | |Otherwise, the TDES/DES engine will be pending since output buffer is full. - * |[18] |OUTBUFERR |TDES/DES Out Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during getting test result from TDES/DES engine. - * |[20] |BUSERR |TDES/DES DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and TDES/DES engine. - * @var CRPT_T::TDES0_KEY1H - * Offset: 0x208 TDES/DES Key 1 High Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES0_KEY1L - * Offset: 0x20C TDES/DES Key 1 Low Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES0_KEY2H - * Offset: 0x210 TDES Key 2 High Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES0_KEY2L - * Offset: 0x214 TDES Key 2 Low Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES0_KEY3H - * Offset: 0x218 TDES Key 3 High Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES0_KEY3L - * Offset: 0x21C TDES Key 3 Low Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES0_IVH - * Offset: 0x220 TDES/DES Initial Vector High Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector High Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES0_IVL - * Offset: 0x224 TDES/DES Initial Vector Low Word Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector Low Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES0_SA - * Offset: 0x228 TDES/DES DMA Source Address Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |TDES/DES DMA Source Address - * | | |The TDES/DES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The CRPT_TDESn_SA keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the TDES/DES accelerator can read the plain text from system memory and do TDES/DES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_SA are ignored. - * | | |CRPT_TDESn_SA can be read and written - * | | |Writing to CRPT_TDESn_SA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_SA will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_SA before triggering START. - * | | |CRPT_TDESn_SA and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES0_DA - * Offset: 0x22C TDES/DES DMA Destination Address Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |TDES/DES DMA Destination Address - * | | |The TDES/DES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The CRPT_TDESn_DA keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the TDES/DES accelerator can write the cipher text back to system memory after the TDES/DES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_DA are ignored. - * | | |CRPT_TDESn_DA can be read and written - * | | |Writing to CRPT_TDESn_DA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_DA will be updated later on - * | | |Consequently, software can prepare the destination address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_DA before triggering START. - * | | |CRPT_TDESn_SAD and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES0_CNT - * Offset: 0x230 TDES/DES Byte Count Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |TDES/DES Byte Count - * | | |The CRPT_TDESn_CNT keeps the byte count of source text that is for the TDES/DES engine operating in DMA mode - * | | |The CRPT_TDESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_TDESn_CNT can be read and written - * | | |Writing to CRPT_TDESn_CNT while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next TDES /DES operation. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_TDESn_CNT must be set as byte count for the last block of data before feeding in the last block of data. - * @var CRPT_T::TDES_DATIN - * Offset: 0x234 TDES/DES Engine Input data Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |TDES/DES Engine Input Port - * | | |CPU feeds data to TDES/DES engine through this port by checking CRPT_TDES_STS - * | | |Feed data as INBUFFULL is 0. - * @var CRPT_T::TDES_DATOUT - * Offset: 0x238 TDES/DES Engine Output data Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATOUT |TDES/DES Engine Output Port - * | | |CPU gets result from the TDES/DES engine through this port by checking CRPT_TDES_STS - * | | |Get data as OUTBUFEMPTY is 0. - * @var CRPT_T::TDES1_KEY1H - * Offset: 0x248 TDES/DES Key 1 High Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES1_KEY1L - * Offset: 0x24C TDES/DES Key 1 Low Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES1_KEY2H - * Offset: 0x250 TDES Key 2 High Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES1_KEY2L - * Offset: 0x254 TDES Key 2 Low Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES1_KEY3H - * Offset: 0x258 TDES Key 3 High Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES1_KEY3L - * Offset: 0x25C TDES Key 3 Low Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES1_IVH - * Offset: 0x260 TDES/DES Initial Vector High Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector High Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES1_IVL - * Offset: 0x264 TDES/DES Initial Vector Low Word Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector Low Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES1_SA - * Offset: 0x268 TDES/DES DMA Source Address Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |TDES/DES DMA Source Address - * | | |The TDES/DES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The CRPT_TDESn_SA keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the TDES/DES accelerator can read the plain text from system memory and do TDES/DES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_SA are ignored. - * | | |CRPT_TDESn_SA can be read and written - * | | |Writing to CRPT_TDESn_SA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_SA will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_SA before triggering START. - * | | |CRPT_TDESn_SA and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES1_DA - * Offset: 0x26C TDES/DES DMA Destination Address Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |TDES/DES DMA Destination Address - * | | |The TDES/DES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The CRPT_TDESn_DA keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the TDES/DES accelerator can write the cipher text back to system memory after the TDES/DES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_DA are ignored. - * | | |CRPT_TDESn_DA can be read and written - * | | |Writing to CRPT_TDESn_DA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_DA will be updated later on - * | | |Consequently, software can prepare the destination address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_DA before triggering START. - * | | |CRPT_TDESn_SAD and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES1_CNT - * Offset: 0x270 TDES/DES Byte Count Register for Channel 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |TDES/DES Byte Count - * | | |The CRPT_TDESn_CNT keeps the byte count of source text that is for the TDES/DES engine operating in DMA mode - * | | |The CRPT_TDESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_TDESn_CNT can be read and written - * | | |Writing to CRPT_TDESn_CNT while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next TDES /DES operation. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_TDESn_CNT must be set as byte count for the last block of data before feeding in the last block of data. - * @var CRPT_T::TDES2_KEY1H - * Offset: 0x288 TDES/DES Key 1 High Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES2_KEY1L - * Offset: 0x28C TDES/DES Key 1 Low Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES2_KEY2H - * Offset: 0x290 TDES Key 2 High Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES2_KEY2L - * Offset: 0x294 TDES Key 2 Low Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES2_KEY3H - * Offset: 0x298 TDES Key 3 High Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES2_KEY3L - * Offset: 0x29C TDES Key 3 Low Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES2_IVH - * Offset: 0x2A0 TDES/DES Initial Vector High Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector High Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES2_IVL - * Offset: 0x2A4 TDES/DES Initial Vector Low Word Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector Low Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES2_SA - * Offset: 0x2A8 TDES/DES DMA Source Address Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |TDES/DES DMA Source Address - * | | |The TDES/DES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The CRPT_TDESn_SA keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the TDES/DES accelerator can read the plain text from system memory and do TDES/DES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_SA are ignored. - * | | |CRPT_TDESn_SA can be read and written - * | | |Writing to CRPT_TDESn_SA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_SA will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_SA before triggering START. - * | | |CRPT_TDESn_SA and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES2_DA - * Offset: 0x2AC TDES/DES DMA Destination Address Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |TDES/DES DMA Destination Address - * | | |The TDES/DES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The CRPT_TDESn_DA keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the TDES/DES accelerator can write the cipher text back to system memory after the TDES/DES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_DA are ignored. - * | | |CRPT_TDESn_DA can be read and written - * | | |Writing to CRPT_TDESn_DA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_DA will be updated later on - * | | |Consequently, software can prepare the destination address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_DA before triggering START. - * | | |CRPT_TDESn_SAD and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES2_CNT - * Offset: 0x2B0 TDES/DES Byte Count Register for Channel 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |TDES/DES Byte Count - * | | |The CRPT_TDESn_CNT keeps the byte count of source text that is for the TDES/DES engine operating in DMA mode - * | | |The CRPT_TDESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_TDESn_CNT can be read and written - * | | |Writing to CRPT_TDESn_CNT while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next TDES /DES operation. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_TDESn_CNT must be set as byte count for the last block of data before feeding in the last block of data. - * @var CRPT_T::TDES3_KEY1H - * Offset: 0x2C8 TDES/DES Key 1 High Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES3_KEY1L - * Offset: 0x2CC TDES/DES Key 1 Low Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 1 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES3_KEY2H - * Offset: 0x2D0 TDES Key 2 High Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES3_KEY2L - * Offset: 0x2D4 TDES Key 2 Low Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 2 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES3_KEY3H - * Offset: 0x2D8 TDES Key 3 High Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 High Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES3_KEY3L - * Offset: 0x2DC TDES Key 3 Low Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |TDES/DES Key 3 Low Word - * | | |The key registers for TDES/DES algorithm calculation - * | | |The security key for the TDES/DES accelerator is 64 bits - * | | |Thus, it needs two 32-bit registers to store a security key - * | | |The register CRPT_TDESn_KEYxH is used to keep the bit [63:32] of security key for the TDES/DES operation, while the register CRPT_TDESn_KEYxL is used to keep the bit [31:0]. - * @var CRPT_T::TDES3_IVH - * Offset: 0x2E0 TDES/DES Initial Vector High Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector High Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES3_IVL - * Offset: 0x2E4 TDES/DES Initial Vector Low Word Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |TDES/DES Initial Vector Low Word - * | | |Initial vector (IV) is for TDES/DES engine in CBC, CFB, and OFB mode - * | | |IV is Nonce counter for TDES/DES engine in CTR mode. - * @var CRPT_T::TDES3_SA - * Offset: 0x2E8 TDES/DES DMA Source Address Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |TDES/DES DMA Source Address - * | | |The TDES/DES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The CRPT_TDESn_SA keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the TDES/DES accelerator can read the plain text from system memory and do TDES/DES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_SA are ignored. - * | | |CRPT_TDESn_SA can be read and written - * | | |Writing to CRPT_TDESn_SA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_SA will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_SA before triggering START. - * | | |CRPT_TDESn_SA and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES3_DA - * Offset: 0x2EC TDES/DES DMA Destination Address Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |TDES/DES DMA Destination Address - * | | |The TDES/DES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The CRPT_TDESn_DA keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the TDES/DES accelerator can write the cipher text back to system memory after the TDES/DES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_TDESn_DA are ignored. - * | | |CRPT_TDESn_DA can be read and written - * | | |Writing to CRPT_TDESn_DA while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_DA will be updated later on - * | | |Consequently, software can prepare the destination address for the next TDES/DES operation. - * | | |In DMA mode, software can update the next CRPT_TDESn_DA before triggering START. - * | | |CRPT_TDESn_SAD and CRPT_TDESn_DA can be the same in the value. - * @var CRPT_T::TDES3_CNT - * Offset: 0x2F0 TDES/DES Byte Count Register for Channel 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |TDES/DES Byte Count - * | | |The CRPT_TDESn_CNT keeps the byte count of source text that is for the TDES/DES engine operating in DMA mode - * | | |The CRPT_TDESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_TDESn_CNT can be read and written - * | | |Writing to CRPT_TDESn_CNT while the TDES/DES accelerator is operating doesn't affect the current TDES/DES operation - * | | |But the value of CRPT_TDESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next TDES /DES operation. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_TDESn_CNT must be set as byte count for the last block of data before feeding in the last block of data. - * @var CRPT_T::HMAC_CTL - * Offset: 0x300 SHA/HMAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |SHA/HMAC Engine Start - * | | |0 = No effect. - * | | |1 = Start SHA/HMAC engine. BUSY flag will be set. - * | | |This bit is always 0 when it's read back. - * |[1] |STOP |SHA/HMAC Engine Stop - * | | |0 = No effect. - * | | |1 = Stop SHA/HMAC engine. - * | | |This bit is always 0 when it's read back. - * |[4] |HMACEN |HMAC_SHA Engine Operating Mode - * | | |0 = execute SHA function. - * | | |1 = execute HMAC function. - * |[5] |DMALAST |SHA/HMAC Last Block - * | | |This bit must be set as feeding in last byte of data. - * |[7] |DMAEN |SHA/HMAC Engine DMA Enable Control - * | | |0 = SHA/HMAC DMA engine Disabled. - * | | |SHA/HMAC engine operates in Non-DMA mode, and gets data from the port CRPT_HMAC_DATIN. - * | | |1 = SHA/HMAC DMA engine Enabled. - * | | |SHA/HMAC engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[10:8] |OPMODE |SHA/HMAC Engine Operation Modes - * | | |0x0xx: SHA160 - * | | |0x100: SHA256 - * | | |0x101: SHA224 - * | | |0x110: SHA512 - * | | |0x111: SHA384 - * | | |These bits can be read and written. But writing to them wouldn't take effect as BUSY is 1. - * |[22] |OUTSWAP |SHA/HMAC Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |SHA/HMAC Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * @var CRPT_T::HMAC_STS - * Offset: 0x304 SHA/HMAC Status Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |SHA/HMAC Engine Busy - * | | |0 = SHA/HMAC engine is idle or finished. - * | | |1 = SHA/HMAC engine is busy. - * |[1] |DMABUSY |SHA/HMAC Engine DMA Busy Flag - * | | |0 = SHA/HMAC DMA engine is idle or finished. - * | | |1 = SHA/HMAC DMA engine is busy. - * |[8] |DMAERR |SHA/HMAC Engine DMA Error Flag - * | | |0 = Show the SHA/HMAC engine access normal. - * | | |1 = Show the SHA/HMAC engine access error. - * |[16] |DATINREQ |SHA/HMAC Non-DMA Mode Data Input Request - * | | |0 = No effect. - * | | |1 = Request SHA/HMAC Non-DMA mode data input. - * @var CRPT_T::HMAC_DGST[16] - * Offset: 0x308 ~ 0x344 SHA/HMAC Digest Message 0 ~ 15 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Digest Message Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_KEYCNT - * Offset: 0x348 SHA/HMAC Key Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEYCNT |SHA/HMAC Key Byte Count - * | | |The CRPT_HMAC_KEYCNT keeps the byte count of key that SHA/HMAC engine operates - * | | |The register is 32-bit and the maximum byte count is 4G bytes - * | | |It can be read and written. - * | | |Writing to the register CRPT_HMAC_KEYCNT as the SHA/HMAC accelerator operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRPT_SHA _KEYCNT will be updated later on - * | | |Consequently, software can prepare the key count for the next SHA/HMAC operation. - * @var CRPT_T::HMAC_SADDR - * Offset: 0x34C SHA/HMAC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |SHA/HMAC DMA Source Address - * | | |The SHA/HMAC accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The CRPT_HMAC_SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the SHA/HMAC accelerator can read the plain text from system memory and do SHA/HMAC operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_HMAC_SADDR are ignored. - * | | |CRPT_HMAC_SADDR can be read and written - * | | |Writing to CRPT_HMAC_SADDR while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next SHA/HMAC operation. - * | | |In DMA mode, software can update the next CRPT_HMAC_SADDR before triggering START. - * | | |CRPT_HMAC_SADDR and CRPT_HMAC_DADDR can be the same in the value. - * @var CRPT_T::HMAC_DMACNT - * Offset: 0x350 SHA/HMAC Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMACNT |SHA/HMAC Operation Byte Count - * | | |The CRPT_HMAC_DMACNT keeps the byte count of source text that is for the SHA/HMAC engine operating in DMA mode - * | | |The CRPT_HMAC_DMACNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_HMAC_DMACNT can be read and written - * | | |Writing to CRPT_HMAC_DMACNT while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_DMACNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next SHA/HMAC operation. - * | | |In Non-DMA mode, CRPT_HMAC_DMACNT must be set as the byte count of the last block before feeding in the last block of data. - * @var CRPT_T::HMAC_DATIN - * Offset: 0x354 SHA/HMAC Engine Non-DMA Mode Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |SHA/HMAC Engine Input Port - * | | |CPU feeds data to SHA/HMAC engine through this port by checking CRPT_HMAC_STS - * | | |Feed data as DATINREQ is 1. - * @var CRPT_T::ECC_CTL - * Offset: 0x800 ECC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |ECC Accelerator Start - * | | |0 = No effect. - * | | |1 = Start ECC accelerator. BUSY flag will be set. - * | | |This bit is always 0 when it's read back. - * | | |ECC accelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |ECC Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort ECC accelerator and make it into idle state. - * | | |This bit is always 0 when it's read back. - * | | |Remember to clear ECC interrupt flag after stopping ECC accelerator. - * |[7] |DMAEN |ECC Accelerator DMA Enable Control - * | | |0 = ECC DMA engine Disabled. - * | | |1 = ECC DMA engine Enabled. - * | | |Only when START and DMAEN are 1, ECC DMA engine will be active - * |[8] |FSEL |Field Selection - * | | |0 = Binary Field (GF(2^m)). - * | | |1 = Prime Field (GF(p)). - * |[10:9] |ECCOP |Point Operation for BF and PF - * | | |00 = Point multiplication :. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * | | |01 = Modulus operation : choose by MODOP (CRPT_ECC_CTL[12:11]). - * | | |10 = Point addition :. - * | | |(POINTX1, POINTY1) = (POINTX1, POINTY1) +. - * | | |(POINTX2, POINTY2) - * | | |11 = Point doubling :. - * | | |(POINTX1, POINTY1) = 2 * (POINTX1, POINTY1). - * | | |Besides above three input data, point operations still need the parameters of elliptic curve (CURVEA, CURVEB, CURVEN and CURVEM) as shown in Figure 6.27-11 - * |[12:11] |MODOP |Modulus Operation for PF - * | | |00 = Division :. - * | | |POINTX1 = (POINTY1 / POINTX1) % CURVEN. - * | | |01 = Multiplication :. - * | | |POINTX1 = (POINTX1 * POINTY1) % CURVEN. - * | | |10 = Addition :. - * | | |POINTX1 = (POINTX1 + POINTY1) % CURVEN. - * | | |11 = Subtraction :. - * | | |POINTX1 = (POINTX1 - POINTY1) % CURVEN. - * | | |MODOP is active only when ECCOP = 01. - * |[16] |LDP1 |The Control Signal of Register for the X and Y Coordinate of the First Point (POINTX1, POINTY1) - * | | |0 = The register for POINTX1 and POINTY1 is not modified by DMA or user. - * | | |1 = The register for POINTX1 and POINTY1 is modified by DMA or user. - * |[17] |LDP2 |The Control Signal of Register for the X and Y Coordinate of the Second Point (POINTX2, POINTY2) - * | | |0 = The register for POINTX2 and POINTY2 is not modified by DMA or user. - * | | |1 = The register for POINTX2 and POINTY2 is modified by DMA or user. - * |[18] |LDA |The Control Signal of Register for the Parameter CURVEA of Elliptic Curve - * | | |0 = The register for CURVEA is not modified by DMA or user. - * | | |1 = The register for CURVEA is modified by DMA or user. - * |[19] |LDB |The Control Signal of Register for the Parameter CURVEB of Elliptic Curve - * | | |0 = The register for CURVEB is not modified by DMA or user. - * | | |1 = The register for CURVEB is modified by DMA or user. - * |[20] |LDN |The Control Signal of Register for the Parameter CURVEN of Elliptic Curve - * | | |0 = The register for CURVEN is not modified by DMA or user. - * | | |1 = The register for CURVEN is modified by DMA or user. - * |[21] |LDK |The Control Signal of Register for SCALARK - * | | |0 = The register for SCALARK is not modified by DMA or user. - * | | |1 = The register for SCALARK is modified by DMA or user. - * |[31:22] |CURVEM |The key length of elliptic curve. - * @var CRPT_T::ECC_STS - * Offset: 0x804 ECC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |ECC Accelerator Busy Flag - * | | |0 = The ECC accelerator is idle or finished. - * | | |1 = The ECC accelerator is under processing and protects all registers. - * | | |Remember to clear ECC interrupt flag after ECC accelerator finished - * |[1] |DMABUSY |ECC DMA Busy Flag - * | | |0 = ECC DMA is idle or finished. - * | | |1 = ECC DMA is busy. - * |[16] |BUSERR |ECC DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and ECC accelerator. - * @var CRPT_T::ECC_X1[18] - * Offset: 0x808 ~ 0x84C ECC The X-coordinate word 0 ~ 17 of the first point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the x-coordinate Value of the First Point (POINTX1) - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_Y1[18] - * Offset: 0x850 ~ 0x894 ECC The Y-coordinate word 0 ~ 17 of the first point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point (POINTY1) - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_X2[18] - * Offset: 0x898 ~ 0x8DC ECC The X-coordinate word 0 ~ 17 of the second point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the x-coordinate Value of the Second Point (POINTX2) - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_Y2[18] - * Offset: 0x8E0 ~ 0x924 ECC The Y-coordinate word 0 ~ 17 of the second point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point (POINTY2) - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_A[18] - * Offset: 0x928 ~ 0x96C ECC The parameter CURVEA word 0 ~ 17 of elliptic curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve (CURVEA) - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2^m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_B[18] - * Offset: 0x970 ~ 0x9B4 ECC The parameter CURVEB word 0 ~ 17 of elliptic curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve (CURVEA) - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2^m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_N[18] - * Offset: 0x9B8 ~ 0x9FC ECC The parameter CURVEN word 0 ~ 17 of elliptic curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve (CURVEN) - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2^m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_K[18] - * Offset: 0xA00 ~ 0xA44 ECC The scalar SCALARK word0 of point multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication(SCALARK) - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_SADDR - * Offset: 0xA48 ECC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |ECC DMA Source Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between - * | | |SRAM memory space and ECC accelerator. The SADDR keeps the source address of the data - * | | |buffer where the source text is stored. Based on the source address, the ECC accelerator - * | | |can read the DATA and PARAMETER from SRAM memory space and do ECC operation. The start - * | | |of source address should be located at word boundary. That is, bit 1 and 0 of SADDR are - * | | |ignored. SADDR can be read and written. In DMA mode, software must update the CRPT_ECC_SADDR - * | | |before triggering START. - * @var CRPT_T::ECC_DADDR - * Offset: 0xA4C ECC DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |ECC DMA Destination Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between system memory and ECC accelerator - * | | |The DADDR keeps the destination address of the data buffer where output data of ECC engine will be stored - * | | |Based on the destination address, the ECC accelerator can write the result data back to system memory after the ECC operation is finished - * | | |The start of destination address should be located at word boundary - * | | |That is, bit 1 and 0 of DADDR are ignored - * | | |DADDR can be read and written - * | | |In DMA mode, software must update the CRPT_ECC_DADDR before triggering START - * @var CRPT_T::ECC_STARTREG - * Offset: 0xA50 ECC Starting Address of Updated Registers - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |STARTREG |ECC Starting Address of Updated Registers - * | | |The address of the updated registers that DMA feeds the first data or parameter to ECC engine - * | | |When ECC engine is active, ECC accelerator does not allow users to modify STARTREG - * | | |For example, we want to updated input data from register CRPT_ECC POINTX1 - * | | |Thus, the value of STARTREG is 0x808. - * @var CRPT_T::ECC_WORDCNT - * Offset: 0xA54 ECC DMA Word Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WORDCNT |ECC DMA Word Count - * | | |The CRPT_ECC_WORDCNT keeps the word count of source data that is for the required input data of ECC accelerator with various operations in DMA mode - * | | |Although CRPT_ECC_WORDCNT is 32-bit, the maximum of word count in ECC accelerator is 144 words - * | | |CRPT_ECC_WORDCNT can be read and written - */ - __IO uint32_t INTEN; /*!< [0x0000] Crypto Interrupt Enable Control Register */ - __IO uint32_t INTSTS; /*!< [0x0004] Crypto Interrupt Flag */ - __IO uint32_t PRNG_CTL; /*!< [0x0008] PRNG Control Register */ - __O uint32_t PRNG_SEED; /*!< [0x000c] Seed for PRNG */ - __I uint32_t PRNG_KEY[8]; /*!< [0x0010] ~ [0x002c] PRNG Generated Key0 ~ Key7 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[8]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t AES_FDBCK[4]; /*!< [0x0050] ~ [0x005c] AES Engine Output Feedback Data after Cryptographic Operation */ - __I uint32_t TDES_FDBCKH; /*!< [0x0060] TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation */ - __I uint32_t TDES_FDBCKL; /*!< [0x0064] TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[38]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t AES_CTL; /*!< [0x0100] AES Control Register */ - __I uint32_t AES_STS; /*!< [0x0104] AES Engine Flag */ - __IO uint32_t AES_DATIN; /*!< [0x0108] AES Engine Data Input Port Register */ - __I uint32_t AES_DATOUT; /*!< [0x010c] AES Engine Data Output Port Register */ - __IO uint32_t AES0_KEY[8]; /*!< [0x0110] ~ [0x012c] AES Key Word 0~7 Register for Channel 0 */ - __IO uint32_t AES0_IV[4]; /*!< [0x0130] ~ [0x013c] AES Initial Vector Word 0 ~ 3 Register for Channel 0 */ - __IO uint32_t AES0_SADDR; /*!< [0x0140] AES DMA Source Address Register for Channel 0 */ - __IO uint32_t AES0_DADDR; /*!< [0x0144] AES DMA Destination Address Register for Channel 0 */ - __IO uint32_t AES0_CNT; /*!< [0x0148] AES Byte Count Register for Channel 0 */ - __IO uint32_t AES1_KEY[8]; /*!< [0x014c] ~ [0x0168] AES Key Word 0~7 Register for Channel 1 */ - __IO uint32_t AES1_IV[4]; /*!< [0x016c] ~ [0x0178] AES Initial Vector Word 0~3 Register for Channel 1 */ - __IO uint32_t AES1_SADDR; /*!< [0x017c] AES DMA Source Address Register for Channel 1 */ - __IO uint32_t AES1_DADDR; /*!< [0x0180] AES DMA Destination Address Register for Channel 1 */ - __IO uint32_t AES1_CNT; /*!< [0x0184] AES Byte Count Register for Channel 1 */ - __IO uint32_t AES2_KEY[8]; /*!< [0x0188] ~ [0x01a4] AES Key Word 0~7 Register for Channel 2 */ - __IO uint32_t AES2_IV[4]; /*!< [0x01a8] ~ [0x01b4] AES Initial Vector Word 0~3 Register for Channel 2 */ - __IO uint32_t AES2_SADDR; /*!< [0x01b8] AES DMA Source Address Register for Channel 2 */ - __IO uint32_t AES2_DADDR; /*!< [0x01bc] AES DMA Destination Address Register for Channel 2 */ - __IO uint32_t AES2_CNT; /*!< [0x01c0] AES Byte Count Register for Channel 2 */ - __IO uint32_t AES3_KEY[8]; /*!< [0x01c4] ~ [0x01e0] AES Key Word 0~7 Register for Channel 3 */ - __IO uint32_t AES3_IV[4]; /*!< [0x01e4] ~ [0x01f0] AES Initial Vector Word 0~3 Register for Channel 3 */ - __IO uint32_t AES3_SADDR; /*!< [0x01f4] AES DMA Source Address Register for Channel 3 */ - __IO uint32_t AES3_DADDR; /*!< [0x01f8] AES DMA Destination Address Register for Channel 3 */ - __IO uint32_t AES3_CNT; /*!< [0x01fc] AES Byte Count Register for Channel 3 */ - __IO uint32_t TDES_CTL; /*!< [0x0200] TDES/DES Control Register */ - __I uint32_t TDES_STS; /*!< [0x0204] TDES/DES Engine Flag */ - __IO uint32_t TDES0_KEY1H; /*!< [0x0208] TDES/DES Key 1 High Word Register for Channel 0 */ - __IO uint32_t TDES0_KEY1L; /*!< [0x020c] TDES/DES Key 1 Low Word Register for Channel 0 */ - __IO uint32_t TDES0_KEY2H; /*!< [0x0210] TDES Key 2 High Word Register for Channel 0 */ - __IO uint32_t TDES0_KEY2L; /*!< [0x0214] TDES Key 2 Low Word Register for Channel 0 */ - __IO uint32_t TDES0_KEY3H; /*!< [0x0218] TDES Key 3 High Word Register for Channel 0 */ - __IO uint32_t TDES0_KEY3L; /*!< [0x021c] TDES Key 3 Low Word Register for Channel 0 */ - __IO uint32_t TDES0_IVH; /*!< [0x0220] TDES/DES Initial Vector High Word Register for Channel 0 */ - __IO uint32_t TDES0_IVL; /*!< [0x0224] TDES/DES Initial Vector Low Word Register for Channel 0 */ - __IO uint32_t TDES0_SA; /*!< [0x0228] TDES/DES DMA Source Address Register for Channel 0 */ - __IO uint32_t TDES0_DA; /*!< [0x022c] TDES/DES DMA Destination Address Register for Channel 0 */ - __IO uint32_t TDES0_CNT; /*!< [0x0230] TDES/DES Byte Count Register for Channel 0 */ - __IO uint32_t TDES_DATIN; /*!< [0x0234] TDES/DES Engine Input data Word Register */ - __I uint32_t TDES_DATOUT; /*!< [0x0238] TDES/DES Engine Output data Word Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t TDES1_KEY1H; /*!< [0x0248] TDES/DES Key 1 High Word Register for Channel 1 */ - __IO uint32_t TDES1_KEY1L; /*!< [0x024c] TDES/DES Key 1 Low Word Register for Channel 1 */ - __IO uint32_t TDES1_KEY2H; /*!< [0x0250] TDES Key 2 High Word Register for Channel 1 */ - __IO uint32_t TDES1_KEY2L; /*!< [0x0254] TDES Key 2 Low Word Register for Channel 1 */ - __IO uint32_t TDES1_KEY3H; /*!< [0x0258] TDES Key 3 High Word Register for Channel 1 */ - __IO uint32_t TDES1_KEY3L; /*!< [0x025c] TDES Key 3 Low Word Register for Channel 1 */ - __IO uint32_t TDES1_IVH; /*!< [0x0260] TDES/DES Initial Vector High Word Register for Channel 1 */ - __IO uint32_t TDES1_IVL; /*!< [0x0264] TDES/DES Initial Vector Low Word Register for Channel 1 */ - __IO uint32_t TDES1_SA; /*!< [0x0268] TDES/DES DMA Source Address Register for Channel 1 */ - __IO uint32_t TDES1_DA; /*!< [0x026c] TDES/DES DMA Destination Address Register for Channel 1 */ - __IO uint32_t TDES1_CNT; /*!< [0x0270] TDES/DES Byte Count Register for Channel 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t TDES2_KEY1H; /*!< [0x0288] TDES/DES Key 1 High Word Register for Channel 2 */ - __IO uint32_t TDES2_KEY1L; /*!< [0x028c] TDES/DES Key 1 Low Word Register for Channel 2 */ - __IO uint32_t TDES2_KEY2H; /*!< [0x0290] TDES Key 2 High Word Register for Channel 2 */ - __IO uint32_t TDES2_KEY2L; /*!< [0x0294] TDES Key 2 Low Word Register for Channel 2 */ - __IO uint32_t TDES2_KEY3H; /*!< [0x0298] TDES Key 3 High Word Register for Channel 2 */ - __IO uint32_t TDES2_KEY3L; /*!< [0x029c] TDES Key 3 Low Word Register for Channel 2 */ - __IO uint32_t TDES2_IVH; /*!< [0x02a0] TDES/DES Initial Vector High Word Register for Channel 2 */ - __IO uint32_t TDES2_IVL; /*!< [0x02a4] TDES/DES Initial Vector Low Word Register for Channel 2 */ - __IO uint32_t TDES2_SA; /*!< [0x02a8] TDES/DES DMA Source Address Register for Channel 2 */ - __IO uint32_t TDES2_DA; /*!< [0x02ac] TDES/DES DMA Destination Address Register for Channel 2 */ - __IO uint32_t TDES2_CNT; /*!< [0x02b0] TDES/DES Byte Count Register for Channel 2 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t TDES3_KEY1H; /*!< [0x02c8] TDES/DES Key 1 High Word Register for Channel 3 */ - __IO uint32_t TDES3_KEY1L; /*!< [0x02cc] TDES/DES Key 1 Low Word Register for Channel 3 */ - __IO uint32_t TDES3_KEY2H; /*!< [0x02d0] TDES Key 2 High Word Register for Channel 3 */ - __IO uint32_t TDES3_KEY2L; /*!< [0x02d4] TDES Key 2 Low Word Register for Channel 3 */ - __IO uint32_t TDES3_KEY3H; /*!< [0x02d8] TDES Key 3 High Word Register for Channel 3 */ - __IO uint32_t TDES3_KEY3L; /*!< [0x02dc] TDES Key 3 Low Word Register for Channel 3 */ - __IO uint32_t TDES3_IVH; /*!< [0x02e0] TDES/DES Initial Vector High Word Register for Channel 3 */ - __IO uint32_t TDES3_IVL; /*!< [0x02e4] TDES/DES Initial Vector Low Word Register for Channel 3 */ - __IO uint32_t TDES3_SA; /*!< [0x02e8] TDES/DES DMA Source Address Register for Channel 3 */ - __IO uint32_t TDES3_DA; /*!< [0x02ec] TDES/DES DMA Destination Address Register for Channel 3 */ - __IO uint32_t TDES3_CNT; /*!< [0x02f0] TDES/DES Byte Count Register for Channel 3 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t HMAC_CTL; /*!< [0x0300] SHA/HMAC Control Register */ - __I uint32_t HMAC_STS; /*!< [0x0304] SHA/HMAC Status Flag */ - __I uint32_t HMAC_DGST[16]; /*!< [0x0308] ~ [0x0344] SHA/HMAC Digest Message 0~15 */ - __IO uint32_t HMAC_KEYCNT; /*!< [0x0348] SHA/HMAC Key Byte Count Register */ - __IO uint32_t HMAC_SADDR; /*!< [0x034c] SHA/HMAC DMA Source Address Register */ - __IO uint32_t HMAC_DMACNT; /*!< [0x0350] SHA/HMAC Byte Count Register */ - __IO uint32_t HMAC_DATIN; /*!< [0x0354] SHA/HMAC Engine Non-DMA Mode Data Input Port Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE6[298]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ECC_CTL; /*!< [0x0800] ECC Control Register */ - __I uint32_t ECC_STS; /*!< [0x0804] ECC Status Register */ - __IO uint32_t ECC_X1[18]; /*!< [0x0808] ~ [0x084c] ECC The X-coordinate word 0~17 of the first point */ - __IO uint32_t ECC_Y1[18]; /*!< [0x0850] ~ [0x0894] ECC The Y-coordinate word 0~17 of the first point */ - __IO uint32_t ECC_X2[18]; /*!< [0x0898] ~ [0x08dc] ECC The X-coordinate word 0~17 of the second point */ - __IO uint32_t ECC_Y2[18]; /*!< [0x08e0] ~ [0x0924] ECC The Y-coordinate word 0~17 of the second point */ - __IO uint32_t ECC_A[18]; /*!< [0x0928] ~ [0x096c] ECC The parameter CURVEA word 0~17 of elliptic curve */ - __IO uint32_t ECC_B[18]; /*!< [0x0970] ~ [0x09b4] ECC The parameter CURVEB word 0~17 of elliptic curve */ - __IO uint32_t ECC_N[18]; /*!< [0x09b8] ~ [0x09fc] ECC The parameter CURVEN word 0~17 of elliptic curve */ - __O uint32_t ECC_K[18]; /*!< [0x0a00] ~ [0x0a44] ECC The scalar SCALARK word 0~17 of point multiplication */ - __IO uint32_t ECC_SADDR; /*!< [0x0a48] ECC DMA Source Address Register */ - __IO uint32_t ECC_DADDR; /*!< [0x0a4c] ECC DMA Destination Address Register */ - __IO uint32_t ECC_STARTREG; /*!< [0x0a50] ECC Starting Address of Updated Registers */ - __IO uint32_t ECC_WORDCNT; /*!< [0x0a54] ECC DMA Word Count */ - -} CRPT_T; - -/** - @addtogroup CRPT_CONST CRPT Bit Field Definition - Constant Definitions for CRPT Controller -@{ */ - -#define CRPT_INTEN_AESIEN_Pos (0) /*!< CRPT_T::INTEN: AESIEN Position */ -#define CRPT_INTEN_AESIEN_Msk (0x1ul << CRPT_INTEN_AESIEN_Pos) /*!< CRPT_T::INTEN: AESIEN Mask */ - -#define CRPT_INTEN_AESEIEN_Pos (1) /*!< CRPT_T::INTEN: AESEIEN Position */ -#define CRPT_INTEN_AESEIEN_Msk (0x1ul << CRPT_INTEN_AESEIEN_Pos) /*!< CRPT_T::INTEN: AESEIEN Mask */ - -#define CRPT_INTEN_TDESIEN_Pos (8) /*!< CRPT_T::INTEN: TDESIEN Position */ -#define CRPT_INTEN_TDESIEN_Msk (0x1ul << CRPT_INTEN_TDESIEN_Pos) /*!< CRPT_T::INTEN: TDESIEN Mask */ - -#define CRPT_INTEN_TDESEIEN_Pos (9) /*!< CRPT_T::INTEN: TDESEIEN Position */ -#define CRPT_INTEN_TDESEIEN_Msk (0x1ul << CRPT_INTEN_TDESEIEN_Pos) /*!< CRPT_T::INTEN: TDESEIEN Mask */ - -#define CRPT_INTEN_PRNGIEN_Pos (16) /*!< CRPT_T::INTEN: PRNGIEN Position */ -#define CRPT_INTEN_PRNGIEN_Msk (0x1ul << CRPT_INTEN_PRNGIEN_Pos) /*!< CRPT_T::INTEN: PRNGIEN Mask */ - -#define CRPT_INTEN_ECCIEN_Pos (22) /*!< CRPT_T::INTEN: ECCIEN Position */ -#define CRPT_INTEN_ECCIEN_Msk (0x1ul << CRPT_INTEN_ECCIEN_Pos) /*!< CRPT_T::INTEN: ECCIEN Mask */ - -#define CRPT_INTEN_ECCEIEN_Pos (23) /*!< CRPT_T::INTEN: ECCEIEN Position */ -#define CRPT_INTEN_ECCEIEN_Msk (0x1ul << CRPT_INTEN_ECCEIEN_Pos) /*!< CRPT_T::INTEN: ECCEIEN Mask */ - -#define CRPT_INTEN_HMACIEN_Pos (24) /*!< CRPT_T::INTEN: HMACIEN Position */ -#define CRPT_INTEN_HMACIEN_Msk (0x1ul << CRPT_INTEN_HMACIEN_Pos) /*!< CRPT_T::INTEN: HMACIEN Mask */ - -#define CRPT_INTEN_HMACEIEN_Pos (25) /*!< CRPT_T::INTEN: HMACEIEN Position */ -#define CRPT_INTEN_HMACEIEN_Msk (0x1ul << CRPT_INTEN_HMACEIEN_Pos) /*!< CRPT_T::INTEN: HMACEIEN Mask */ - -#define CRPT_INTSTS_AESIF_Pos (0) /*!< CRPT_T::INTSTS: AESIF Position */ -#define CRPT_INTSTS_AESIF_Msk (0x1ul << CRPT_INTSTS_AESIF_Pos) /*!< CRPT_T::INTSTS: AESIF Mask */ - -#define CRPT_INTSTS_AESEIF_Pos (1) /*!< CRPT_T::INTSTS: AESEIF Position */ -#define CRPT_INTSTS_AESEIF_Msk (0x1ul << CRPT_INTSTS_AESEIF_Pos) /*!< CRPT_T::INTSTS: AESEIF Mask */ - -#define CRPT_INTSTS_TDESIF_Pos (8) /*!< CRPT_T::INTSTS: TDESIF Position */ -#define CRPT_INTSTS_TDESIF_Msk (0x1ul << CRPT_INTSTS_TDESIF_Pos) /*!< CRPT_T::INTSTS: TDESIF Mask */ - -#define CRPT_INTSTS_TDESEIF_Pos (9) /*!< CRPT_T::INTSTS: TDESEIF Position */ -#define CRPT_INTSTS_TDESEIF_Msk (0x1ul << CRPT_INTSTS_TDESEIF_Pos) /*!< CRPT_T::INTSTS: TDESEIF Mask */ - -#define CRPT_INTSTS_PRNGIF_Pos (16) /*!< CRPT_T::INTSTS: PRNGIF Position */ -#define CRPT_INTSTS_PRNGIF_Msk (0x1ul << CRPT_INTSTS_PRNGIF_Pos) /*!< CRPT_T::INTSTS: PRNGIF Mask */ - -#define CRPT_INTSTS_ECCIF_Pos (22) /*!< CRPT_T::INTSTS: ECCIF Position */ -#define CRPT_INTSTS_ECCIF_Msk (0x1ul << CRPT_INTSTS_ECCIF_Pos) /*!< CRPT_T::INTSTS: ECCIF Mask */ - -#define CRPT_INTSTS_ECCEIF_Pos (23) /*!< CRPT_T::INTSTS: ECCEIF Position */ -#define CRPT_INTSTS_ECCEIF_Msk (0x1ul << CRPT_INTSTS_ECCEIF_Pos) /*!< CRPT_T::INTSTS: ECCEIF Mask */ - -#define CRPT_INTSTS_HMACIF_Pos (24) /*!< CRPT_T::INTSTS: HMACIF Position */ -#define CRPT_INTSTS_HMACIF_Msk (0x1ul << CRPT_INTSTS_HMACIF_Pos) /*!< CRPT_T::INTSTS: HMACIF Mask */ - -#define CRPT_INTSTS_HMACEIF_Pos (25) /*!< CRPT_T::INTSTS: HMACEIF Position */ -#define CRPT_INTSTS_HMACEIF_Msk (0x1ul << CRPT_INTSTS_HMACEIF_Pos) /*!< CRPT_T::INTSTS: HMACEIF Mask */ - -#define CRPT_PRNG_CTL_START_Pos (0) /*!< CRPT_T::PRNG_CTL: START Position */ -#define CRPT_PRNG_CTL_START_Msk (0x1ul << CRPT_PRNG_CTL_START_Pos) /*!< CRPT_T::PRNG_CTL: START Mask */ - -#define CRPT_PRNG_CTL_SEEDRLD_Pos (1) /*!< CRPT_T::PRNG_CTL: SEEDRLD Position */ -#define CRPT_PRNG_CTL_SEEDRLD_Msk (0x1ul << CRPT_PRNG_CTL_SEEDRLD_Pos) /*!< CRPT_T::PRNG_CTL: SEEDRLD Mask */ - -#define CRPT_PRNG_CTL_KEYSZ_Pos (2) /*!< CRPT_T::PRNG_CTL: KEYSZ Position */ -#define CRPT_PRNG_CTL_KEYSZ_Msk (0x3ul << CRPT_PRNG_CTL_KEYSZ_Pos) /*!< CRPT_T::PRNG_CTL: KEYSZ Mask */ - -#define CRPT_PRNG_CTL_BUSY_Pos (8) /*!< CRPT_T::PRNG_CTL: BUSY Position */ -#define CRPT_PRNG_CTL_BUSY_Msk (0x1ul << CRPT_PRNG_CTL_BUSY_Pos) /*!< CRPT_T::PRNG_CTL: BUSY Mask */ - -#define CRPT_PRNG_SEED_SEED_Pos (0) /*!< CRPT_T::PRNG_SEED: SEED Position */ -#define CRPT_PRNG_SEED_SEED_Msk (0xfffffffful << CRPT_PRNG_SEED_SEED_Pos) /*!< CRPT_T::PRNG_SEED: SEED Mask */ - -#define CRPT_PRNG_KEYx_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY[8]: KEY Position */ -#define CRPT_PRNG_KEYx_KEY_Msk (0xfffffffful << CRPT_PRNG_KEYx_KEY_Pos) /*!< CRPT_T::PRNG_KEY[8]: KEY Mask */ - -#define CRPT_AES_FDBCKx_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK[4]: FDBCK Position */ -#define CRPT_AES_FDBCKx_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCKx_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK[4]: FDBCK Mask */ - -#define CRPT_TDES_FDBCKH_FDBCK_Pos (0) /*!< CRPT_T::TDES_FDBCKH: FDBCK Position */ -#define CRPT_TDES_FDBCKH_FDBCK_Msk (0xfffffffful << CRPT_TDES_FDBCKH_FDBCK_Pos) /*!< CRPT_T::TDES_FDBCKH: FDBCK Mask */ - -#define CRPT_TDES_FDBCKL_FDBCK_Pos (0) /*!< CRPT_T::TDES_FDBCKL: FDBCK Position */ -#define CRPT_TDES_FDBCKL_FDBCK_Msk (0xfffffffful << CRPT_TDES_FDBCKL_FDBCK_Pos) /*!< CRPT_T::TDES_FDBCKL: FDBCK Mask */ - -#define CRPT_AES_CTL_START_Pos (0) /*!< CRPT_T::AES_CTL: START Position */ -#define CRPT_AES_CTL_START_Msk (0x1ul << CRPT_AES_CTL_START_Pos) /*!< CRPT_T::AES_CTL: START Mask */ - -#define CRPT_AES_CTL_STOP_Pos (1) /*!< CRPT_T::AES_CTL: STOP Position */ -#define CRPT_AES_CTL_STOP_Msk (0x1ul << CRPT_AES_CTL_STOP_Pos) /*!< CRPT_T::AES_CTL: STOP Mask */ - -#define CRPT_AES_CTL_KEYSZ_Pos (2) /*!< CRPT_T::AES_CTL: KEYSZ Position */ -#define CRPT_AES_CTL_KEYSZ_Msk (0x3ul << CRPT_AES_CTL_KEYSZ_Pos) /*!< CRPT_T::AES_CTL: KEYSZ Mask */ - -#define CRPT_AES_CTL_DMALAST_Pos (5) /*!< CRPT_T::AES_CTL: DMALAST Position */ -#define CRPT_AES_CTL_DMALAST_Msk (0x1ul << CRPT_AES_CTL_DMALAST_Pos) /*!< CRPT_T::AES_CTL: DMALAST Mask */ - -#define CRPT_AES_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::AES_CTL: DMACSCAD Position */ -#define CRPT_AES_CTL_DMACSCAD_Msk (0x1ul << CRPT_AES_CTL_DMACSCAD_Pos) /*!< CRPT_T::AES_CTL: DMACSCAD Mask */ - -#define CRPT_AES_CTL_DMAEN_Pos (7) /*!< CRPT_T::AES_CTL: DMAEN Position */ -#define CRPT_AES_CTL_DMAEN_Msk (0x1ul << CRPT_AES_CTL_DMAEN_Pos) /*!< CRPT_T::AES_CTL: DMAEN Mask */ - -#define CRPT_AES_CTL_OPMODE_Pos (8) /*!< CRPT_T::AES_CTL: OPMODE Position */ -#define CRPT_AES_CTL_OPMODE_Msk (0xfful << CRPT_AES_CTL_OPMODE_Pos) /*!< CRPT_T::AES_CTL: OPMODE Mask */ - -#define CRPT_AES_CTL_ENCRPT_Pos (16) /*!< CRPT_T::AES_CTL: ENCRPT Position */ -#define CRPT_AES_CTL_ENCRPT_Msk (0x1ul << CRPT_AES_CTL_ENCRPT_Pos) /*!< CRPT_T::AES_CTL: ENCRPT Mask */ - -#define CRPT_AES_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::AES_CTL: OUTSWAP Position */ -#define CRPT_AES_CTL_OUTSWAP_Msk (0x1ul << CRPT_AES_CTL_OUTSWAP_Pos) /*!< CRPT_T::AES_CTL: OUTSWAP Mask */ - -#define CRPT_AES_CTL_INSWAP_Pos (23) /*!< CRPT_T::AES_CTL: INSWAP Position */ -#define CRPT_AES_CTL_INSWAP_Msk (0x1ul << CRPT_AES_CTL_INSWAP_Pos) /*!< CRPT_T::AES_CTL: INSWAP Mask */ - -#define CRPT_AES_CTL_CHANNEL_Pos (24) /*!< CRPT_T::AES_CTL: CHANNEL Position */ -#define CRPT_AES_CTL_CHANNEL_Msk (0x3ul << CRPT_AES_CTL_CHANNEL_Pos) /*!< CRPT_T::AES_CTL: CHANNEL Mask */ - -#define CRPT_AES_CTL_KEYUNPRT_Pos (26) /*!< CRPT_T::AES_CTL: KEYUNPRT Position */ -#define CRPT_AES_CTL_KEYUNPRT_Msk (0x1ful << CRPT_AES_CTL_KEYUNPRT_Pos) /*!< CRPT_T::AES_CTL: KEYUNPRT Mask */ - -#define CRPT_AES_CTL_KEYPRT_Pos (31) /*!< CRPT_T::AES_CTL: KEYPRT Position */ -#define CRPT_AES_CTL_KEYPRT_Msk (0x1ul << CRPT_AES_CTL_KEYPRT_Pos) /*!< CRPT_T::AES_CTL: KEYPRT Mask */ - -#define CRPT_AES_STS_BUSY_Pos (0) /*!< CRPT_T::AES_STS: BUSY Position */ -#define CRPT_AES_STS_BUSY_Msk (0x1ul << CRPT_AES_STS_BUSY_Pos) /*!< CRPT_T::AES_STS: BUSY Mask */ - -#define CRPT_AES_STS_INBUFEMPTY_Pos (8) /*!< CRPT_T::AES_STS: INBUFEMPTY Position */ -#define CRPT_AES_STS_INBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_INBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: INBUFEMPTY Mask */ - -#define CRPT_AES_STS_INBUFFULL_Pos (9) /*!< CRPT_T::AES_STS: INBUFFULL Position */ -#define CRPT_AES_STS_INBUFFULL_Msk (0x1ul << CRPT_AES_STS_INBUFFULL_Pos) /*!< CRPT_T::AES_STS: INBUFFULL Mask */ - -#define CRPT_AES_STS_INBUFERR_Pos (10) /*!< CRPT_T::AES_STS: INBUFERR Position */ -#define CRPT_AES_STS_INBUFERR_Msk (0x1ul << CRPT_AES_STS_INBUFERR_Pos) /*!< CRPT_T::AES_STS: INBUFERR Mask */ - -#define CRPT_AES_STS_CNTERR_Pos (12) /*!< CRPT_T::AES_STS: CNTERR Position */ -#define CRPT_AES_STS_CNTERR_Msk (0x1ul << CRPT_AES_STS_CNTERR_Pos) /*!< CRPT_T::AES_STS: CNTERR Mask */ - -#define CRPT_AES_STS_OUTBUFEMPTY_Pos (16) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Position */ -#define CRPT_AES_STS_OUTBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_OUTBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Mask */ - -#define CRPT_AES_STS_OUTBUFFULL_Pos (17) /*!< CRPT_T::AES_STS: OUTBUFFULL Position */ -#define CRPT_AES_STS_OUTBUFFULL_Msk (0x1ul << CRPT_AES_STS_OUTBUFFULL_Pos) /*!< CRPT_T::AES_STS: OUTBUFFULL Mask */ - -#define CRPT_AES_STS_OUTBUFERR_Pos (18) /*!< CRPT_T::AES_STS: OUTBUFERR Position */ -#define CRPT_AES_STS_OUTBUFERR_Msk (0x1ul << CRPT_AES_STS_OUTBUFERR_Pos) /*!< CRPT_T::AES_STS: OUTBUFERR Mask */ - -#define CRPT_AES_STS_BUSERR_Pos (20) /*!< CRPT_T::AES_STS: BUSERR Position */ -#define CRPT_AES_STS_BUSERR_Msk (0x1ul << CRPT_AES_STS_BUSERR_Pos) /*!< CRPT_T::AES_STS: BUSERR Mask */ - -#define CRPT_AES_DATIN_DATIN_Pos (0) /*!< CRPT_T::AES_DATIN: DATIN Position */ -#define CRPT_AES_DATIN_DATIN_Msk (0xfffffffful << CRPT_AES_DATIN_DATIN_Pos) /*!< CRPT_T::AES_DATIN: DATIN Mask */ - -#define CRPT_AES_DATOUT_DATOUT_Pos (0) /*!< CRPT_T::AES_DATOUT: DATOUT Position */ -#define CRPT_AES_DATOUT_DATOUT_Msk (0xfffffffful << CRPT_AES_DATOUT_DATOUT_Pos) /*!< CRPT_T::AES_DATOUT: DATOUT Mask */ - -#define CRPT_AES0_KEYx_KEY_Pos (0) /*!< CRPT_T::AES0_KEY[8]: KEY Position */ -#define CRPT_AES0_KEYx_KEY_Msk (0xfffffffful << CRPT_AES0_KEYx_KEY_Pos) /*!< CRPT_T::AES0_KEY[8]: KEY Mask */ - -#define CRPT_AES0_IVx_IV_Pos (0) /*!< CRPT_T::AES0_IV[4]: IV Position */ -#define CRPT_AES0_IVx_IV_Msk (0xfffffffful << CRPT_AES0_IVx_IV_Pos) /*!< CRPT_T::AES0_IV[4]: IV Mask */ - -#define CRPT_AES0_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES0_SADDR: SADDR Position */ -#define CRPT_AES0_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES0_SADDR_SADDR_Pos) /*!< CRPT_T::AES0_SADDR: SADDR Mask */ - -#define CRPT_AES0_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES0_DADDR: DADDR Position */ -#define CRPT_AES0_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES0_DADDR_DADDR_Pos) /*!< CRPT_T::AES0_DADDR: DADDR Mask */ - -#define CRPT_AES0_CNT_CNT_Pos (0) /*!< CRPT_T::AES0_CNT: CNT Position */ -#define CRPT_AES0_CNT_CNT_Msk (0xfffffffful << CRPT_AES0_CNT_CNT_Pos) /*!< CRPT_T::AES0_CNT: CNT Mask */ - -#define CRPT_AES1_KEYx_KEY_Pos (0) /*!< CRPT_T::AES1_KEY[8]: KEY Position */ -#define CRPT_AES1_KEYx_KEY_Msk (0xfffffffful << CRPT_AES1_KEYx_KEY_Pos) /*!< CRPT_T::AES1_KEY[8]: KEY Mask */ - -#define CRPT_AES1_IVx_IV_Pos (0) /*!< CRPT_T::AES1_IV[4]: IV Position */ -#define CRPT_AES1_IVx_IV_Msk (0xfffffffful << CRPT_AES1_IVx_IV_Pos) /*!< CRPT_T::AES1_IV[4]: IV Mask */ - -#define CRPT_AES1_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES1_SADDR: SADDR Position */ -#define CRPT_AES1_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES1_SADDR_SADDR_Pos) /*!< CRPT_T::AES1_SADDR: SADDR Mask */ - -#define CRPT_AES1_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES1_DADDR: DADDR Position */ -#define CRPT_AES1_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES1_DADDR_DADDR_Pos) /*!< CRPT_T::AES1_DADDR: DADDR Mask */ - -#define CRPT_AES1_CNT_CNT_Pos (0) /*!< CRPT_T::AES1_CNT: CNT Position */ -#define CRPT_AES1_CNT_CNT_Msk (0xfffffffful << CRPT_AES1_CNT_CNT_Pos) /*!< CRPT_T::AES1_CNT: CNT Mask */ - -#define CRPT_AES2_KEYx_KEY_Pos (0) /*!< CRPT_T::AES2_KEY[8]: KEY Position */ -#define CRPT_AES2_KEYx_KEY_Msk (0xfffffffful << CRPT_AES2_KEYx_KEY_Pos) /*!< CRPT_T::AES2_KEY[8]: KEY Mask */ - -#define CRPT_AES2_IVx_IV_Pos (0) /*!< CRPT_T::AES2_IV[4]: IV Position */ -#define CRPT_AES2_IVx_IV_Msk (0xfffffffful << CRPT_AES2_IVx_IV_Pos) /*!< CRPT_T::AES2_IV[4]: IV Mask */ - -#define CRPT_AES2_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES2_SADDR: SADDR Position */ -#define CRPT_AES2_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES2_SADDR_SADDR_Pos) /*!< CRPT_T::AES2_SADDR: SADDR Mask */ - -#define CRPT_AES2_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES2_DADDR: DADDR Position */ -#define CRPT_AES2_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES2_DADDR_DADDR_Pos) /*!< CRPT_T::AES2_DADDR: DADDR Mask */ - -#define CRPT_AES2_CNT_CNT_Pos (0) /*!< CRPT_T::AES2_CNT: CNT Position */ -#define CRPT_AES2_CNT_CNT_Msk (0xfffffffful << CRPT_AES2_CNT_CNT_Pos) /*!< CRPT_T::AES2_CNT: CNT Mask */ - -#define CRPT_AES3_KEYx_KEY_Pos (0) /*!< CRPT_T::AES3_KEY[8]: KEY Position */ -#define CRPT_AES3_KEYx_KEY_Msk (0xfffffffful << CRPT_AES3_KEYx_KEY_Pos) /*!< CRPT_T::AES3_KEY[8]: KEY Mask */ - -#define CRPT_AES3_IVx_IV_Pos (0) /*!< CRPT_T::AES3_IV[4]: IV Position */ -#define CRPT_AES3_IVx_IV_Msk (0xfffffffful << CRPT_AES3_IVx_IV_Pos) /*!< CRPT_T::AES3_IV[4]: IV Mask */ - -#define CRPT_AES3_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES3_SADDR: SADDR Position */ -#define CRPT_AES3_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES3_SADDR_SADDR_Pos) /*!< CRPT_T::AES3_SADDR: SADDR Mask */ - -#define CRPT_AES3_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES3_DADDR: DADDR Position */ -#define CRPT_AES3_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES3_DADDR_DADDR_Pos) /*!< CRPT_T::AES3_DADDR: DADDR Mask */ - -#define CRPT_AES3_CNT_CNT_Pos (0) /*!< CRPT_T::AES3_CNT: CNT Position */ -#define CRPT_AES3_CNT_CNT_Msk (0xfffffffful << CRPT_AES3_CNT_CNT_Pos) /*!< CRPT_T::AES3_CNT: CNT Mask */ - -#define CRPT_TDES_CTL_START_Pos (0) /*!< CRPT_T::TDES_CTL: START Position */ -#define CRPT_TDES_CTL_START_Msk (0x1ul << CRPT_TDES_CTL_START_Pos) /*!< CRPT_T::TDES_CTL: START Mask */ - -#define CRPT_TDES_CTL_STOP_Pos (1) /*!< CRPT_T::TDES_CTL: STOP Position */ -#define CRPT_TDES_CTL_STOP_Msk (0x1ul << CRPT_TDES_CTL_STOP_Pos) /*!< CRPT_T::TDES_CTL: STOP Mask */ - -#define CRPT_TDES_CTL_TMODE_Pos (2) /*!< CRPT_T::TDES_CTL: TMODE Position */ -#define CRPT_TDES_CTL_TMODE_Msk (0x1ul << CRPT_TDES_CTL_TMODE_Pos) /*!< CRPT_T::TDES_CTL: TMODE Mask */ - -#define CRPT_TDES_CTL_3KEYS_Pos (3) /*!< CRPT_T::TDES_CTL: 3KEYS Position */ -#define CRPT_TDES_CTL_3KEYS_Msk (0x1ul << CRPT_TDES_CTL_3KEYS_Pos) /*!< CRPT_T::TDES_CTL: 3KEYS Mask */ - -#define CRPT_TDES_CTL_DMALAST_Pos (5) /*!< CRPT_T::TDES_CTL: DMALAST Position */ -#define CRPT_TDES_CTL_DMALAST_Msk (0x1ul << CRPT_TDES_CTL_DMALAST_Pos) /*!< CRPT_T::TDES_CTL: DMALAST Mask */ - -#define CRPT_TDES_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::TDES_CTL: DMACSCAD Position */ -#define CRPT_TDES_CTL_DMACSCAD_Msk (0x1ul << CRPT_TDES_CTL_DMACSCAD_Pos) /*!< CRPT_T::TDES_CTL: DMACSCAD Mask */ - -#define CRPT_TDES_CTL_DMAEN_Pos (7) /*!< CRPT_T::TDES_CTL: DMAEN Position */ -#define CRPT_TDES_CTL_DMAEN_Msk (0x1ul << CRPT_TDES_CTL_DMAEN_Pos) /*!< CRPT_T::TDES_CTL: DMAEN Mask */ - -#define CRPT_TDES_CTL_OPMODE_Pos (8) /*!< CRPT_T::TDES_CTL: OPMODE Position */ -#define CRPT_TDES_CTL_OPMODE_Msk (0x7ul << CRPT_TDES_CTL_OPMODE_Pos) /*!< CRPT_T::TDES_CTL: OPMODE Mask */ - -#define CRPT_TDES_CTL_ENCRPT_Pos (16) /*!< CRPT_T::TDES_CTL: ENCRPT Position */ -#define CRPT_TDES_CTL_ENCRPT_Msk (0x1ul << CRPT_TDES_CTL_ENCRPT_Pos) /*!< CRPT_T::TDES_CTL: ENCRPT Mask */ - -#define CRPT_TDES_CTL_BLKSWAP_Pos (21) /*!< CRPT_T::TDES_CTL: BLKSWAP Position */ -#define CRPT_TDES_CTL_BLKSWAP_Msk (0x1ul << CRPT_TDES_CTL_BLKSWAP_Pos) /*!< CRPT_T::TDES_CTL: BLKSWAP Mask */ - -#define CRPT_TDES_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::TDES_CTL: OUTSWAP Position */ -#define CRPT_TDES_CTL_OUTSWAP_Msk (0x1ul << CRPT_TDES_CTL_OUTSWAP_Pos) /*!< CRPT_T::TDES_CTL: OUTSWAP Mask */ - -#define CRPT_TDES_CTL_INSWAP_Pos (23) /*!< CRPT_T::TDES_CTL: INSWAP Position */ -#define CRPT_TDES_CTL_INSWAP_Msk (0x1ul << CRPT_TDES_CTL_INSWAP_Pos) /*!< CRPT_T::TDES_CTL: INSWAP Mask */ - -#define CRPT_TDES_CTL_CHANNEL_Pos (24) /*!< CRPT_T::TDES_CTL: CHANNEL Position */ -#define CRPT_TDES_CTL_CHANNEL_Msk (0x3ul << CRPT_TDES_CTL_CHANNEL_Pos) /*!< CRPT_T::TDES_CTL: CHANNEL Mask */ - -#define CRPT_TDES_CTL_KEYUNPRT_Pos (26) /*!< CRPT_T::TDES_CTL: KEYUNPRT Position */ -#define CRPT_TDES_CTL_KEYUNPRT_Msk (0x1ful << CRPT_TDES_CTL_KEYUNPRT_Pos) /*!< CRPT_T::TDES_CTL: KEYUNPRT Mask */ - -#define CRPT_TDES_CTL_KEYPRT_Pos (31) /*!< CRPT_T::TDES_CTL: KEYPRT Position */ -#define CRPT_TDES_CTL_KEYPRT_Msk (0x1ul << CRPT_TDES_CTL_KEYPRT_Pos) /*!< CRPT_T::TDES_CTL: KEYPRT Mask */ - -#define CRPT_TDES_STS_BUSY_Pos (0) /*!< CRPT_T::TDES_STS: BUSY Position */ -#define CRPT_TDES_STS_BUSY_Msk (0x1ul << CRPT_TDES_STS_BUSY_Pos) /*!< CRPT_T::TDES_STS: BUSY Mask */ - -#define CRPT_TDES_STS_INBUFEMPTY_Pos (8) /*!< CRPT_T::TDES_STS: INBUFEMPTY Position */ -#define CRPT_TDES_STS_INBUFEMPTY_Msk (0x1ul << CRPT_TDES_STS_INBUFEMPTY_Pos) /*!< CRPT_T::TDES_STS: INBUFEMPTY Mask */ - -#define CRPT_TDES_STS_INBUFFULL_Pos (9) /*!< CRPT_T::TDES_STS: INBUFFULL Position */ -#define CRPT_TDES_STS_INBUFFULL_Msk (0x1ul << CRPT_TDES_STS_INBUFFULL_Pos) /*!< CRPT_T::TDES_STS: INBUFFULL Mask */ - -#define CRPT_TDES_STS_INBUFERR_Pos (10) /*!< CRPT_T::TDES_STS: INBUFERR Position */ -#define CRPT_TDES_STS_INBUFERR_Msk (0x1ul << CRPT_TDES_STS_INBUFERR_Pos) /*!< CRPT_T::TDES_STS: INBUFERR Mask */ - -#define CRPT_TDES_STS_OUTBUFEMPTY_Pos (16) /*!< CRPT_T::TDES_STS: OUTBUFEMPTY Position */ -#define CRPT_TDES_STS_OUTBUFEMPTY_Msk (0x1ul << CRPT_TDES_STS_OUTBUFEMPTY_Pos) /*!< CRPT_T::TDES_STS: OUTBUFEMPTY Mask */ - -#define CRPT_TDES_STS_OUTBUFFULL_Pos (17) /*!< CRPT_T::TDES_STS: OUTBUFFULL Position */ -#define CRPT_TDES_STS_OUTBUFFULL_Msk (0x1ul << CRPT_TDES_STS_OUTBUFFULL_Pos) /*!< CRPT_T::TDES_STS: OUTBUFFULL Mask */ - -#define CRPT_TDES_STS_OUTBUFERR_Pos (18) /*!< CRPT_T::TDES_STS: OUTBUFERR Position */ -#define CRPT_TDES_STS_OUTBUFERR_Msk (0x1ul << CRPT_TDES_STS_OUTBUFERR_Pos) /*!< CRPT_T::TDES_STS: OUTBUFERR Mask */ - -#define CRPT_TDES_STS_BUSERR_Pos (20) /*!< CRPT_T::TDES_STS: BUSERR Position */ -#define CRPT_TDES_STS_BUSERR_Msk (0x1ul << CRPT_TDES_STS_BUSERR_Pos) /*!< CRPT_T::TDES_STS: BUSERR Mask */ - -#define CRPT_TDES0_KEYxH_KEY_Pos (0) /*!< CRPT_T::TDES0_KEYxH: KEY Position */ -#define CRPT_TDES0_KEYxH_KEY_Msk (0xfffffffful << CRPT_TDES0_KEYxH_KEY_Pos) /*!< CRPT_T::TDES0_KEYxH: KEY Mask */ - -#define CRPT_TDES0_KEYxL_KEY_Pos (0) /*!< CRPT_T::TDES0_KEYxL: KEY Position */ -#define CRPT_TDES0_KEYxL_KEY_Msk (0xfffffffful << CRPT_TDES0_KEYxL_KEY_Pos) /*!< CRPT_T::TDES0_KEYxL: KEY Mask */ - -#define CRPT_TDES0_IVH_IV_Pos (0) /*!< CRPT_T::TDES0_IVH: IV Position */ -#define CRPT_TDES0_IVH_IV_Msk (0xfffffffful << CRPT_TDES0_IVH_IV_Pos) /*!< CRPT_T::TDES0_IVH: IV Mask */ - -#define CRPT_TDES0_IVL_IV_Pos (0) /*!< CRPT_T::TDES0_IVL: IV Position */ -#define CRPT_TDES0_IVL_IV_Msk (0xfffffffful << CRPT_TDES0_IVL_IV_Pos) /*!< CRPT_T::TDES0_IVL: IV Mask */ - -#define CRPT_TDES0_SADDR_SADDR_Pos (0) /*!< CRPT_T::TDES0_SADDR: SADDR Position */ -#define CRPT_TDES0_SADDR_SADDR_Msk (0xfffffffful << CRPT_TDES0_SADDR_SADDR_Pos) /*!< CRPT_T::TDES0_SADDR: SADDR Mask */ - -#define CRPT_TDES0_DADDR_DADDR_Pos (0) /*!< CRPT_T::TDES0_DADDR: DADDR Position */ -#define CRPT_TDES0_DADDR_DADDR_Msk (0xfffffffful << CRPT_TDES0_DADDR_DADDR_Pos) /*!< CRPT_T::TDES0_DADDR: DADDR Mask */ - -#define CRPT_TDES0_CNT_CNT_Pos (0) /*!< CRPT_T::TDES0_CNT: CNT Position */ -#define CRPT_TDES0_CNT_CNT_Msk (0xfffffffful << CRPT_TDES0_CNT_CNT_Pos) /*!< CRPT_T::TDES0_CNT: CNT Mask */ - -#define CRPT_TDES_DATIN_DATIN_Pos (0) /*!< CRPT_T::TDES_DATIN: DATIN Position */ -#define CRPT_TDES_DATIN_DATIN_Msk (0xfffffffful << CRPT_TDES_DATIN_DATIN_Pos) /*!< CRPT_T::TDES_DATIN: DATIN Mask */ - -#define CRPT_TDES_DATOUT_DATOUT_Pos (0) /*!< CRPT_T::TDES_DATOUT: DATOUT Position */ -#define CRPT_TDES_DATOUT_DATOUT_Msk (0xfffffffful << CRPT_TDES_DATOUT_DATOUT_Pos) /*!< CRPT_T::TDES_DATOUT: DATOUT Mask */ - -#define CRPT_TDES1_KEYxH_KEY_Pos (0) /*!< CRPT_T::TDES1_KEYxH: KEY Position */ -#define CRPT_TDES1_KEYxH_KEY_Msk (0xfffffffful << CRPT_TDES1_KEYxH_KEY_Pos) /*!< CRPT_T::TDES1_KEYxH: KEY Mask */ - -#define CRPT_TDES1_KEYxL_KEY_Pos (0) /*!< CRPT_T::TDES1_KEYxL: KEY Position */ -#define CRPT_TDES1_KEYxL_KEY_Msk (0xfffffffful << CRPT_TDES1_KEY1L_KEY_Pos) /*!< CRPT_T::TDES1_KEYxL: KEY Mask */ - -#define CRPT_TDES1_IVH_IV_Pos (0) /*!< CRPT_T::TDES1_IVH: IV Position */ -#define CRPT_TDES1_IVH_IV_Msk (0xfffffffful << CRPT_TDES1_IVH_IV_Pos) /*!< CRPT_T::TDES1_IVH: IV Mask */ - -#define CRPT_TDES1_IVL_IV_Pos (0) /*!< CRPT_T::TDES1_IVL: IV Position */ -#define CRPT_TDES1_IVL_IV_Msk (0xfffffffful << CRPT_TDES1_IVL_IV_Pos) /*!< CRPT_T::TDES1_IVL: IV Mask */ - -#define CRPT_TDES1_SADDR_SADDR_Pos (0) /*!< CRPT_T::TDES1_SADDR: SADDR Position */ -#define CRPT_TDES1_SADDR_SADDR_Msk (0xfffffffful << CRPT_TDES1_SADDR_SADDR_Pos) /*!< CRPT_T::TDES1_SADDR: SADDR Mask */ - -#define CRPT_TDES1_DADDR_DADDR_Pos (0) /*!< CRPT_T::TDES1_DADDR: DADDR Position */ -#define CRPT_TDES1_DADDR_DADDR_Msk (0xfffffffful << CRPT_TDES1_DADDR_DADDR_Pos) /*!< CRPT_T::TDES1_DADDR: DADDR Mask */ - -#define CRPT_TDES1_CNT_CNT_Pos (0) /*!< CRPT_T::TDES1_CNT: CNT Position */ -#define CRPT_TDES1_CNT_CNT_Msk (0xfffffffful << CRPT_TDES1_CNT_CNT_Pos) /*!< CRPT_T::TDES1_CNT: CNT Mask */ - -#define CRPT_TDES2_KEYxH_KEY_Pos (0) /*!< CRPT_T::TDES2_KEYxH: KEY Position */ -#define CRPT_TDES2_KEYxH_KEY_Msk (0xfffffffful << CRPT_TDES2_KEYxH_KEY_Pos) /*!< CRPT_T::TDES2_KEYxH: KEY Mask */ - -#define CRPT_TDES2_KEYxL_KEY_Pos (0) /*!< CRPT_T::TDES2_KEYxL: KEY Position */ -#define CRPT_TDES2_KEYxL_KEY_Msk (0xfffffffful << CRPT_TDES2_KEYxL_KEY_Pos) /*!< CRPT_T::TDES2_KEYxL: KEY Mask */ - -#define CRPT_TDES2_IVH_IV_Pos (0) /*!< CRPT_T::TDES2_IVH: IV Position */ -#define CRPT_TDES2_IVH_IV_Msk (0xfffffffful << CRPT_TDES2_IVH_IV_Pos) /*!< CRPT_T::TDES2_IVH: IV Mask */ - -#define CRPT_TDES2_IVL_IV_Pos (0) /*!< CRPT_T::TDES2_IVL: IV Position */ -#define CRPT_TDES2_IVL_IV_Msk (0xfffffffful << CRPT_TDES2_IVL_IV_Pos) /*!< CRPT_T::TDES2_IVL: IV Mask */ - -#define CRPT_TDES2_SADDR_SADDR_Pos (0) /*!< CRPT_T::TDES2_SADDR: SADDR Position */ -#define CRPT_TDES2_SADDR_SADDR_Msk (0xfffffffful << CRPT_TDES2_SADDR_SADDR_Pos) /*!< CRPT_T::TDES2_SADDR: SADDR Mask */ - -#define CRPT_TDES2_DADDR_DADDR_Pos (0) /*!< CRPT_T::TDES2_DADDR: DADDR Position */ -#define CRPT_TDES2_DADDR_DADDR_Msk (0xfffffffful << CRPT_TDES2_DADDR_DADDR_Pos) /*!< CRPT_T::TDES2_DADDR: DADDR Mask */ - -#define CRPT_TDES2_CNT_CNT_Pos (0) /*!< CRPT_T::TDES2_CNT: CNT Position */ -#define CRPT_TDES2_CNT_CNT_Msk (0xfffffffful << CRPT_TDES2_CNT_CNT_Pos) /*!< CRPT_T::TDES2_CNT: CNT Mask */ - -#define CRPT_TDES3_KEYxH_KEY_Pos (0) /*!< CRPT_T::TDES3_KEYxH: KEY Position */ -#define CRPT_TDES3_KEYxH_KEY_Msk (0xfffffffful << CRPT_TDES3_KEYxH_KEY_Pos) /*!< CRPT_T::TDES3_KEYxH: KEY Mask */ - -#define CRPT_TDES3_KEYxL_KEY_Pos (0) /*!< CRPT_T::TDES3_KEYxL: KEY Position */ -#define CRPT_TDES3_KEYxL_KEY_Msk (0xfffffffful << CRPT_TDES3_KEYxL_KEY_Pos) /*!< CRPT_T::TDES3_KEYxL: KEY Mask */ - -#define CRPT_TDES3_IVH_IV_Pos (0) /*!< CRPT_T::TDES3_IVH: IV Position */ -#define CRPT_TDES3_IVH_IV_Msk (0xfffffffful << CRPT_TDES3_IVH_IV_Pos) /*!< CRPT_T::TDES3_IVH: IV Mask */ - -#define CRPT_TDES3_IVL_IV_Pos (0) /*!< CRPT_T::TDES3_IVL: IV Position */ -#define CRPT_TDES3_IVL_IV_Msk (0xfffffffful << CRPT_TDES3_IVL_IV_Pos) /*!< CRPT_T::TDES3_IVL: IV Mask */ - -#define CRPT_TDES3_SADDR_SADDR_Pos (0) /*!< CRPT_T::TDES3_SADDR: SADDR Position */ -#define CRPT_TDES3_SADDR_SADDR_Msk (0xfffffffful << CRPT_TDES3_SADDR_SADDR_Pos) /*!< CRPT_T::TDES3_SADDR: SADDR Mask */ - -#define CRPT_TDES3_DADDR_DADDR_Pos (0) /*!< CRPT_T::TDES3_DADDR: DADDR Position */ -#define CRPT_TDES3_DADDR_DADDR_Msk (0xfffffffful << CRPT_TDES3_DADDR_DADDR_Pos) /*!< CRPT_T::TDES3_DADDR: DADDR Mask */ - -#define CRPT_TDES3_CNT_CNT_Pos (0) /*!< CRPT_T::TDES3_CNT: CNT Position */ -#define CRPT_TDES3_CNT_CNT_Msk (0xfffffffful << CRPT_TDES3_CNT_CNT_Pos) /*!< CRPT_T::TDES3_CNT: CNT Mask */ - -#define CRPT_HMAC_CTL_START_Pos (0) /*!< CRPT_T::HMAC_CTL: START Position */ -#define CRPT_HMAC_CTL_START_Msk (0x1ul << CRPT_HMAC_CTL_START_Pos) /*!< CRPT_T::HMAC_CTL: START Mask */ - -#define CRPT_HMAC_CTL_STOP_Pos (1) /*!< CRPT_T::HMAC_CTL: STOP Position */ -#define CRPT_HMAC_CTL_STOP_Msk (0x1ul << CRPT_HMAC_CTL_STOP_Pos) /*!< CRPT_T::HMAC_CTL: STOP Mask */ - -#define CRPT_HMAC_CTL_HMACEN_Pos (4) /*!< CRPT_T::HMAC_CTL: HMACEN Position */ -#define CRPT_HMAC_CTL_HMACEN_Msk (0x1ul << CRPT_HMAC_CTL_HMACEN_Pos) /*!< CRPT_T::HMAC_CTL: HMACEN Mask */ - -#define CRPT_HMAC_CTL_DMALAST_Pos (5) /*!< CRPT_T::HMAC_CTL: DMALAST Position */ -#define CRPT_HMAC_CTL_DMALAST_Msk (0x1ul << CRPT_HMAC_CTL_DMALAST_Pos) /*!< CRPT_T::HMAC_CTL: DMALAST Mask */ - -#define CRPT_HMAC_CTL_DMAEN_Pos (7) /*!< CRPT_T::HMAC_CTL: DMAEN Position */ -#define CRPT_HMAC_CTL_DMAEN_Msk (0x1ul << CRPT_HMAC_CTL_DMAEN_Pos) /*!< CRPT_T::HMAC_CTL: DMAEN Mask */ - -#define CRPT_HMAC_CTL_OPMODE_Pos (8) /*!< CRPT_T::HMAC_CTL: OPMODE Position */ -#define CRPT_HMAC_CTL_OPMODE_Msk (0x7ul << CRPT_HMAC_CTL_OPMODE_Pos) /*!< CRPT_T::HMAC_CTL: OPMODE Mask */ - -#define CRPT_HMAC_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::HMAC_CTL: OUTSWAP Position */ -#define CRPT_HMAC_CTL_OUTSWAP_Msk (0x1ul << CRPT_HMAC_CTL_OUTSWAP_Pos) /*!< CRPT_T::HMAC_CTL: OUTSWAP Mask */ - -#define CRPT_HMAC_CTL_INSWAP_Pos (23) /*!< CRPT_T::HMAC_CTL: INSWAP Position */ -#define CRPT_HMAC_CTL_INSWAP_Msk (0x1ul << CRPT_HMAC_CTL_INSWAP_Pos) /*!< CRPT_T::HMAC_CTL: INSWAP Mask */ - -#define CRPT_HMAC_STS_BUSY_Pos (0) /*!< CRPT_T::HMAC_STS: BUSY Position */ -#define CRPT_HMAC_STS_BUSY_Msk (0x1ul << CRPT_HMAC_STS_BUSY_Pos) /*!< CRPT_T::HMAC_STS: BUSY Mask */ - -#define CRPT_HMAC_STS_DMABUSY_Pos (1) /*!< CRPT_T::HMAC_STS: DMABUSY Position */ -#define CRPT_HMAC_STS_DMABUSY_Msk (0x1ul << CRPT_HMAC_STS_DMABUSY_Pos) /*!< CRPT_T::HMAC_STS: DMABUSY Mask */ - -#define CRPT_HMAC_STS_DMAERR_Pos (8) /*!< CRPT_T::HMAC_STS: DMAERR Position */ -#define CRPT_HMAC_STS_DMAERR_Msk (0x1ul << CRPT_HMAC_STS_DMAERR_Pos) /*!< CRPT_T::HMAC_STS: DMAERR Mask */ - -#define CRPT_HMAC_STS_DATINREQ_Pos (16) /*!< CRPT_T::HMAC_STS: DATINREQ Position */ -#define CRPT_HMAC_STS_DATINREQ_Msk (0x1ul << CRPT_HMAC_STS_DATINREQ_Pos) /*!< CRPT_T::HMAC_STS: DATINREQ Mask */ - -#define CRPT_HMAC_DGSTx_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST[16]: DGST Position */ -#define CRPT_HMAC_DGSTx_DGST_Msk (0xfffffffful << CRPT_HMAC_DGSTx_DGST_Pos) /*!< CRPT_T::HMAC_DGST[16]: DGST Mask */ - -#define CRPT_HMAC_KEYCNT_KEYCNT_Pos (0) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Position */ -#define CRPT_HMAC_KEYCNT_KEYCNT_Msk (0xfffffffful << CRPT_HMAC_KEYCNT_KEYCNT_Pos) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Mask */ - -#define CRPT_HMAC_SADDR_SADDR_Pos (0) /*!< CRPT_T::HMAC_SADDR: SADDR Position */ -#define CRPT_HMAC_SADDR_SADDR_Msk (0xfffffffful << CRPT_HMAC_SADDR_SADDR_Pos) /*!< CRPT_T::HMAC_SADDR: SADDR Mask */ - -#define CRPT_HMAC_DMACNT_DMACNT_Pos (0) /*!< CRPT_T::HMAC_DMACNT: DMACNT Position */ -#define CRPT_HMAC_DMACNT_DMACNT_Msk (0xfffffffful << CRPT_HMAC_DMACNT_DMACNT_Pos) /*!< CRPT_T::HMAC_DMACNT: DMACNT Mask */ - -#define CRPT_HMAC_DATIN_DATIN_Pos (0) /*!< CRPT_T::HMAC_DATIN: DATIN Position */ -#define CRPT_HMAC_DATIN_DATIN_Msk (0xfffffffful << CRPT_HMAC_DATIN_DATIN_Pos) /*!< CRPT_T::HMAC_DATIN: DATIN Mask */ - -#define CRPT_ECC_CTL_START_Pos (0) /*!< CRPT_T::ECC_CTL: START Position */ -#define CRPT_ECC_CTL_START_Msk (0x1ul << CRPT_ECC_CTL_START_Pos) /*!< CRPT_T::ECC_CTL: START Mask */ - -#define CRPT_ECC_CTL_STOP_Pos (1) /*!< CRPT_T::ECC_CTL: STOP Position */ -#define CRPT_ECC_CTL_STOP_Msk (0x1ul << CRPT_ECC_CTL_STOP_Pos) /*!< CRPT_T::ECC_CTL: STOP Mask */ - -#define CRPT_ECC_CTL_DMAEN_Pos (7) /*!< CRPT_T::ECC_CTL: DMAEN Position */ -#define CRPT_ECC_CTL_DMAEN_Msk (0x1ul << CRPT_ECC_CTL_DMAEN_Pos) /*!< CRPT_T::ECC_CTL: DMAEN Mask */ - -#define CRPT_ECC_CTL_FSEL_Pos (8) /*!< CRPT_T::ECC_CTL: FSEL Position */ -#define CRPT_ECC_CTL_FSEL_Msk (0x1ul << CRPT_ECC_CTL_FSEL_Pos) /*!< CRPT_T::ECC_CTL: FSEL Mask */ - -#define CRPT_ECC_CTL_ECCOP_Pos (9) /*!< CRPT_T::ECC_CTL: ECCOP Position */ -#define CRPT_ECC_CTL_ECCOP_Msk (0x3ul << CRPT_ECC_CTL_ECCOP_Pos) /*!< CRPT_T::ECC_CTL: ECCOP Mask */ - -#define CRPT_ECC_CTL_MODOP_Pos (11) /*!< CRPT_T::ECC_CTL: MODOP Position */ -#define CRPT_ECC_CTL_MODOP_Msk (0x3ul << CRPT_ECC_CTL_MODOP_Pos) /*!< CRPT_T::ECC_CTL: MODOP Mask */ - -#define CRPT_ECC_CTL_LDP1_Pos (16) /*!< CRPT_T::ECC_CTL: LDP1 Position */ -#define CRPT_ECC_CTL_LDP1_Msk (0x1ul << CRPT_ECC_CTL_LDP1_Pos) /*!< CRPT_T::ECC_CTL: LDP1 Mask */ - -#define CRPT_ECC_CTL_LDP2_Pos (17) /*!< CRPT_T::ECC_CTL: LDP2 Position */ -#define CRPT_ECC_CTL_LDP2_Msk (0x1ul << CRPT_ECC_CTL_LDP2_Pos) /*!< CRPT_T::ECC_CTL: LDP2 Mask */ - -#define CRPT_ECC_CTL_LDA_Pos (18) /*!< CRPT_T::ECC_CTL: LDA Position */ -#define CRPT_ECC_CTL_LDA_Msk (0x1ul << CRPT_ECC_CTL_LDA_Pos) /*!< CRPT_T::ECC_CTL: LDA Mask */ - -#define CRPT_ECC_CTL_LDB_Pos (19) /*!< CRPT_T::ECC_CTL: LDB Position */ -#define CRPT_ECC_CTL_LDB_Msk (0x1ul << CRPT_ECC_CTL_LDB_Pos) /*!< CRPT_T::ECC_CTL: LDB Mask */ - -#define CRPT_ECC_CTL_LDN_Pos (20) /*!< CRPT_T::ECC_CTL: LDN Position */ -#define CRPT_ECC_CTL_LDN_Msk (0x1ul << CRPT_ECC_CTL_LDN_Pos) /*!< CRPT_T::ECC_CTL: LDN Mask */ - -#define CRPT_ECC_CTL_LDK_Pos (21) /*!< CRPT_T::ECC_CTL: LDK Position */ -#define CRPT_ECC_CTL_LDK_Msk (0x1ul << CRPT_ECC_CTL_LDK_Pos) /*!< CRPT_T::ECC_CTL: LDK Mask */ - -#define CRPT_ECC_CTL_CURVEM_Pos (22) /*!< CRPT_T::ECC_CTL: CURVEM Position */ -#define CRPT_ECC_CTL_CURVEM_Msk (0x3fful << CRPT_ECC_CTL_CURVEM_Pos) /*!< CRPT_T::ECC_CTL: CURVEM Mask */ - -#define CRPT_ECC_STS_BUSY_Pos (0) /*!< CRPT_T::ECC_STS: BUSY Position */ -#define CRPT_ECC_STS_BUSY_Msk (0x1ul << CRPT_ECC_STS_BUSY_Pos) /*!< CRPT_T::ECC_STS: BUSY Mask */ - -#define CRPT_ECC_STS_DMABUSY_Pos (1) /*!< CRPT_T::ECC_STS: DMABUSY Position */ -#define CRPT_ECC_STS_DMABUSY_Msk (0x1ul << CRPT_ECC_STS_DMABUSY_Pos) /*!< CRPT_T::ECC_STS: DMABUSY Mask */ - -#define CRPT_ECC_STS_BUSERR_Pos (16) /*!< CRPT_T::ECC_STS: BUSERR Position */ -#define CRPT_ECC_STS_BUSERR_Msk (0x1ul << CRPT_ECC_STS_BUSERR_Pos) /*!< CRPT_T::ECC_STS: BUSERR Mask */ - -#define CRPT_ECC_X1_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1[18]: POINTX1 Position */ -#define CRPT_ECC_X1_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_POINTX1_Pos) /*!< CRPT_T::ECC_X1[18]: POINTX1 Mask */ - -#define CRPT_ECC_Y1_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1[18]: POINTY1 Position */ -#define CRPT_ECC_Y1_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_POINTY1_Pos) /*!< CRPT_T::ECC_Y1[18]: POINTY1 Mask */ - -#define CRPT_ECC_X2_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2[18]: POINTX2 Position */ -#define CRPT_ECC_X2_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_POINTX2_Pos) /*!< CRPT_T::ECC_X2[18]: POINTX2 Mask */ - -#define CRPT_ECC_Y2_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2[18]: POINTY2 Position */ -#define CRPT_ECC_Y2_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_POINTY2_Pos) /*!< CRPT_T::ECC_Y2[18]: POINTY2 Mask */ - -#define CRPT_ECC_A_CURVEA_Pos (0) /*!< CRPT_T::ECC_A[18]: CURVEA Position */ -#define CRPT_ECC_A_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_CURVEA_Pos) /*!< CRPT_T::ECC_A[18]: CURVEA Mask */ - -#define CRPT_ECC_B_CURVEB_Pos (0) /*!< CRPT_T::ECC_B[18]: CURVEB Position */ -#define CRPT_ECC_B_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_CURVEB_Pos) /*!< CRPT_T::ECC_B[18]: CURVEB Mask */ - -#define CRPT_ECC_N_CURVEN_Pos (0) /*!< CRPT_T::ECC_N[18]: CURVEN Position */ -#define CRPT_ECC_N_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_CURVEN_Pos) /*!< CRPT_T::ECC_N[18]: CURVEN Mask */ - -#define CRPT_ECC_K_SCALARK_Pos (0) /*!< CRPT_T::ECC_K[18]: SCALARK Position */ -#define CRPT_ECC_K_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_SCALARK_Pos) /*!< CRPT_T::ECC_K[18]: SCALARK Mask */ - -#define CRPT_ECC_DADDR_DADDR_Pos (0) /*!< CRPT_T::ECC_DADDR: DADDR Position */ -#define CRPT_ECC_DADDR_DADDR_Msk (0xfffffffful << CRPT_ECC_DADDR_DADDR_Pos) /*!< CRPT_T::ECC_DADDR: DADDR Mask */ - -#define CRPT_ECC_STARTREG_STARTREG_Pos (0) /*!< CRPT_T::ECC_STARTREG: STARTREG Position*/ -#define CRPT_ECC_STARTREG_STARTREG_Msk (0xfffffffful << CRPT_ECC_STARTREG_STARTREG_Pos) /*!< CRPT_T::ECC_STARTREG: STARTREG Mask */ - -#define CRPT_ECC_WORDCNT_WORDCNT_Pos (0) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Position */ -#define CRPT_ECC_WORDCNT_WORDCNT_Msk (0xfffffffful << CRPT_ECC_WORDCNT_WORDCNT_Pos) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Mask */ - -/**@}*/ /* CRPT_CONST CRYPTO */ -/**@}*/ /* end of CRYPTO register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __CRYPTO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/dac_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/dac_reg.h deleted file mode 100644 index bf2f67a5f1f..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/dac_reg.h +++ /dev/null @@ -1,210 +0,0 @@ -/**************************************************************************//** - * @file dac_reg.h - * @version V1.00 - * @brief DAC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __DAC_REG_H__ -#define __DAC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup DAC Digital to Analog Converter(DAC) - Memory Mapped Structure for DAC Controller -@{ */ - -typedef struct -{ - - - /** - * @var DAC_T::CTL - * Offset: 0x00 DAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DACEN |DAC Enable Bit - * | | |0 = DAC is Disabled. - * | | |1 = DAC is Enabled. - * |[1] |DACIEN |DAC Interrupt Enable Bit - * | | |0 = Interrupt is Disabled. - * | | |1 = Interrupt is Enabled. - * |[2] |DMAEN |DMA Mode Enable Bit - * | | |0 = DMA mode Disabled. - * | | |1 = DMA mode Enabled. - * |[3] |DMAURIEN |DMA Under-run Interrupt Enable Bit - * | | |0 = DMA under-run interrupt Disabled. - * | | |1 = DMA under-run interrupt Enabled. - * |[4] |TRGEN |Trigger Mode Enable Bit - * | | |0 = DAC event trigger mode Disabled. - * | | |1 = DAC event trigger mode Enabled. - * |[7:5] |TRGSEL |Trigger Source Selection - * | | |000 = Software trigger. - * | | |001 = External pin DAC0_ST trigger. - * | | |010 = Timer 0 trigger. - * | | |011 = Timer 1 trigger. - * | | |100 = Timer 2 trigger. - * | | |101 = Timer 3 trigger. - * | | |110 = EPWM0 trigger. - * | | |111 = EPWM1 trigger. - * |[8] |BYPASS |Bypass Buffer Mode - * | | |0 = Output voltage buffer Enabled. - * | | |1 = Output voltage buffer Disabled. - * |[10] |LALIGN |DAC Data Left-aligned Enabled Control - * | | |0 = Right alignment. - * | | |1 = Left alignment. - * |[13:12] |ETRGSEL |External Pin Trigger Selection - * | | |00 = Low level trigger. - * | | |01 = High level trigger. - * | | |10 = Falling edge trigger. - * | | |11 = Rising edge trigger. - * |[15:14] |BWSEL |DAC Data Bit-width Selection - * | | |00 = data is 12 bits. - * | | |01 = data is 8 bits. - * | | |Others = reserved. - * |[16] |GRPEN |DAC Group Mode Enable Bit - * | | |0 = DAC0 and DAC1 are not grouped. - * | | |1 = DAC0 and DAC1 are grouped. - * @var DAC_T::SWTRG - * Offset: 0x04 DAC Software Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWTRG |Software Trigger - * | | |0 = Software trigger Disabled. - * | | |1 = Software trigger Enabled. - * | | |User writes this bit to generate one shot pulse and it is cleared to 0 by hardware automatically; Reading this bit will always get 0. - * @var DAC_T::DAT - * Offset: 0x08 DAC Data Holding Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DACDAT |DAC 12-bit Holding Data - * | | |These bits are written by user software which specifies 12-bit conversion data for DAC output - * | | |The unused bits (DAC_DAT[3:0] in left-alignment mode and DAC_DAT[15:12] in right alignment mode) are ignored by DAC controller hardware. - * | | |12 bit left alignment: user has to load data into DAC_DAT[15:4] bits. - * | | |12 bit right alignment: user has to load data into DAC_DAT[11:0] bits. - * @var DAC_T::DATOUT - * Offset: 0x0C DAC Data Output Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DATOUT |DAC 12-bit Output Data - * | | |These bits are current digital data for DAC output conversion. - * | | |It is loaded from DAC_DAT register and user cannot write it directly. - * @var DAC_T::STATUS - * Offset: 0x10 DAC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FINISH |DAC Conversion Complete Finish Flag - * | | |0 = DAC is in conversion state. - * | | |1 = DAC conversion finish. - * | | |This bit set to 1 when conversion time counter counts to SETTLET - * | | |It is cleared to 0 when DAC starts a new conversion - * | | |User writes 1 to clear this bit to 0. - * |[1] |DMAUDR |DMA Under-run Interrupt Flag - * | | |0 = No DMA under-run error condition occurred. - * | | |1 = DMA under-run error condition occurred. - * | | |User writes 1 to clear this bit. - * |[8] |BUSY |DAC Busy Flag (Read Only) - * | | |0 = DAC is ready for next conversion. - * | | |1 = DAC is busy in conversion. - * | | |This is read only bit. - * @var DAC_T::TCTL - * Offset: 0x14 DAC Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |SETTLET |DAC Output Settling Time - * | | |User software needs to write appropriate value to these bits to meet DAC conversion settling time base on PCLK (APB clock) speed. - * | | |For example, DAC controller clock speed is 80MHz and DAC conversion settling time is 1 us, SETTLETvalue must be greater than 0x50. - * | | |SELTTLET = DAC controller clock speed x settling time. - */ - __IO uint32_t CTL; /*!< [0x0000] DAC Control Register */ - __IO uint32_t SWTRG; /*!< [0x0004] DAC Software Trigger Control Register */ - __IO uint32_t DAT; /*!< [0x0008] DAC Data Holding Register */ - __I uint32_t DATOUT; /*!< [0x000c] DAC Data Output Register */ - __IO uint32_t STATUS; /*!< [0x0010] DAC Status Register */ - __IO uint32_t TCTL; /*!< [0x0014] DAC Timing Control Register */ - -} DAC_T; - -/** - @addtogroup DAC_CONST DAC Bit Field Definition - Constant Definitions for DAC Controller -@{ */ - -#define DAC_CTL_DACEN_Pos (0) /*!< DAC_T::CTL: DACEN Position */ -#define DAC_CTL_DACEN_Msk (0x1ul << DAC_CTL_DACEN_Pos) /*!< DAC_T::CTL: DACEN Mask */ - -#define DAC_CTL_DACIEN_Pos (1) /*!< DAC_T::CTL: DACIEN Position */ -#define DAC_CTL_DACIEN_Msk (0x1ul << DAC_CTL_DACIEN_Pos) /*!< DAC_T::CTL: DACIEN Mask */ - -#define DAC_CTL_DMAEN_Pos (2) /*!< DAC_T::CTL: DMAEN Position */ -#define DAC_CTL_DMAEN_Msk (0x1ul << DAC_CTL_DMAEN_Pos) /*!< DAC_T::CTL: DMAEN Mask */ - -#define DAC_CTL_DMAURIEN_Pos (3) /*!< DAC_T::CTL: DMAURIEN Position */ -#define DAC_CTL_DMAURIEN_Msk (0x1ul << DAC_CTL_DMAURIEN_Pos) /*!< DAC_T::CTL: DMAURIEN Mask */ - -#define DAC_CTL_TRGEN_Pos (4) /*!< DAC_T::CTL: TRGEN Position */ -#define DAC_CTL_TRGEN_Msk (0x1ul << DAC_CTL_TRGEN_Pos) /*!< DAC_T::CTL: TRGEN Mask */ - -#define DAC_CTL_TRGSEL_Pos (5) /*!< DAC_T::CTL: TRGSEL Position */ -#define DAC_CTL_TRGSEL_Msk (0x7ul << DAC_CTL_TRGSEL_Pos) /*!< DAC_T::CTL: TRGSEL Mask */ - -#define DAC_CTL_BYPASS_Pos (8) /*!< DAC_T::CTL: BYPASS Position */ -#define DAC_CTL_BYPASS_Msk (0x1ul << DAC_CTL_BYPASS_Pos) /*!< DAC_T::CTL: BYPASS Mask */ - -#define DAC_CTL_LALIGN_Pos (10) /*!< DAC_T::CTL: LALIGN Position */ -#define DAC_CTL_LALIGN_Msk (0x1ul << DAC_CTL_LALIGN_Pos) /*!< DAC_T::CTL: LALIGN Mask */ - -#define DAC_CTL_ETRGSEL_Pos (12) /*!< DAC_T::CTL: ETRGSEL Position */ -#define DAC_CTL_ETRGSEL_Msk (0x3ul << DAC_CTL_ETRGSEL_Pos) /*!< DAC_T::CTL: ETRGSEL Mask */ - -#define DAC_CTL_BWSEL_Pos (14) /*!< DAC_T::CTL: BWSEL Position */ -#define DAC_CTL_BWSEL_Msk (0x3ul << DAC_CTL_BWSEL_Pos) /*!< DAC_T::CTL: BWSEL Mask */ - -#define DAC_CTL_GRPEN_Pos (16) /*!< DAC_T::CTL: GRPEN Position */ -#define DAC_CTL_GRPEN_Msk (0x1ul << DAC_CTL_GRPEN_Pos) /*!< DAC_T::CTL: GRPEN Mask */ - -#define DAC_SWTRG_SWTRG_Pos (0) /*!< DAC_T::SWTRG: SWTRG Position */ -#define DAC_SWTRG_SWTRG_Msk (0x1ul << DAC_SWTRG_SWTRG_Pos) /*!< DAC_T::SWTRG: SWTRG Mask */ - -#define DAC_DAT_DACDAT_Pos (0) /*!< DAC_T::DAT: DACDAT Position */ -#define DAC_DAT_DACDAT_Msk (0xfffful << DAC_DAT_DACDAT_Pos) /*!< DAC_T::DAT: DACDAT Mask */ - -#define DAC_DATOUT_DATOUT_Pos (0) /*!< DAC_T::DATOUT: DATOUT Position */ -#define DAC_DATOUT_DATOUT_Msk (0xffful << DAC_DATOUT_DATOUT_Pos) /*!< DAC_T::DATOUT: DATOUT Mask */ - -#define DAC_STATUS_FINISH_Pos (0) /*!< DAC_T::STATUS: FINISH Position */ -#define DAC_STATUS_FINISH_Msk (0x1ul << DAC_STATUS_FINISH_Pos) /*!< DAC_T::STATUS: FINISH Mask */ - -#define DAC_STATUS_DMAUDR_Pos (1) /*!< DAC_T::STATUS: DMAUDR Position */ -#define DAC_STATUS_DMAUDR_Msk (0x1ul << DAC_STATUS_DMAUDR_Pos) /*!< DAC_T::STATUS: DMAUDR Mask */ - -#define DAC_STATUS_BUSY_Pos (8) /*!< DAC_T::STATUS: BUSY Position */ -#define DAC_STATUS_BUSY_Msk (0x1ul << DAC_STATUS_BUSY_Pos) /*!< DAC_T::STATUS: BUSY Mask */ - -#define DAC_TCTL_SETTLET_Pos (0) /*!< DAC_T::TCTL: SETTLET Position */ -#define DAC_TCTL_SETTLET_Msk (0x3fful << DAC_TCTL_SETTLET_Pos) /*!< DAC_T::TCTL: SETTLET Mask */ - -/**@}*/ /* DAC_CONST */ -/**@}*/ /* end of DAC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __DAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/eadc_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/eadc_reg.h deleted file mode 100644 index ee500f6ec90..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/eadc_reg.h +++ /dev/null @@ -1,1714 +0,0 @@ -/**************************************************************************//** - * @file eadc_reg.h - * @version V1.00 - * @brief EADC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EADC_REG_H__ -#define __EADC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EADC Enhanced Analog to Digital Converter(EADC) - Memory Mapped Structure for EADC Controller -@{ */ - -typedef struct -{ - - - /** - * @var EADC_T::DAT[19] - * Offset: 0x00 ADC Data Register 0~18 for Sample Module 0~18 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2'complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::CURDAT - * Offset: 0x4C ADC PDMA Current Transfer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |CURDAT |ADC PDMA Current Transfer Data Register - * | | |This register is a shadow register of EADC_DATn (n=0~18) for PDMA support. - * | | |This is a read only register. - * @var EADC_T::CTL - * Offset: 0x50 ADC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCEN |ADC Converter Enable Bit - * | | |0 = Disabled EADC. - * | | |1 = Enabled EADC. - * | | |Note: Before starting ADC conversion function, this bit should be set to 1 - * | | |Clear it to 0 to disable ADC converter analog circuit power consumption. - * |[1] |ADCRST |ADC Converter Control Circuits Reset - * | | |0 = No effect. - * | | |1 = Cause ADC control circuits reset to initial state, but not change the ADC registers value. - * | | |Note: ADCRST bit remains 1 during ADC reset, when ADC reset end, the ADCRST bit is automatically cleared to 0. - * |[2] |ADCIEN0 |Specific Sample Module ADC ADINT0 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF0 (EADC_STATUS2[0]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN0 bit is set then conversion end interrupt request ADINT0 is generated. - * | | |0 = Specific sample module ADC ADINT0 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT0 interrupt function Enabled. - * |[3] |ADCIEN1 |Specific Sample Module ADC ADINT1 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF1 (EADC_STATUS2[1]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN1 bit is set then conversion end interrupt request ADINT1 is generated. - * | | |0 = Specific sample module ADC ADINT1 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT1 interrupt function Enabled. - * |[4] |ADCIEN2 |Specific Sample Module ADC ADINT2 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF2 (EADC_STATUS2[2]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN2 bit is set then conversion end interrupt request ADINT2 is generated. - * | | |0 = Specific sample module ADC ADINT2 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT2 interrupt function Enabled. - * |[5] |ADCIEN3 |Specific Sample Module ADC ADINT3 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF3 (EADC_STATUS2[3]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN3 bit is set then conversion end interrupt request ADINT3 is generated. - * | | |0 = Specific sample module ADC ADINT3 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT3 interrupt function Enabled. - * |[7:6] |RESSEL |Resolution Selection - * | | |00 = 6-bit ADC result will be put at RESULT (EADC_DATn[5:0]). - * | | |01 = 8-bit ADC result will be put at RESULT (EADC_DATn[7:0]). - * | | |10 = 10-bit ADC result will be put at RESULT (EADC_DATn[9:0]). - * | | |11 = 12-bit ADC result will be put at RESULT (EADC_DATn[11:0]). - * |[8] |DIFFEN |Differential Analog Input Mode Enable Bit - * | | |0 = Single-end analog input mode. - * | | |1 = Differential analog input mode. - * |[9] |DMOF |ADC Differential Input Mode Output Format - * | | |0 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0] , n= 0 ~18) with unsigned format. - * | | |1 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0] , n= 0 ~18) with 2'complement format. - * |[11] |PDMAEN |PDMA Transfer Enable Bit - * | | |When ADC conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, user can enable this bit to generate a PDMA data transfer request. - * | | |0 = PDMA data transfer Disabled. - * | | |1 = PDMA data transfer Enabled. - * | | |Note: When set this bit field to 1, user must set ADCIENn (EADC_CTL[5:2], n=0~3) = 0 to disable interrupt. - * @var EADC_T::SWTRG - * Offset: 0x54 ADC Sample Module Software Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |SWTRG |ADC Sample Module 0~18 Software Force to Start ADC Conversion - * | | |0 = No effect. - * | | |1 = Cause an ADC conversion when the priority is given to sample module. - * | | |Note: After write this register to start ADC conversion, the EADC_PENDSTS register will show which sample module will conversion - * | | |If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - * @var EADC_T::PENDSTS - * Offset: 0x58 ADC Start of Conversion Pending Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |STPF |ADC Sample Module 0~18 Start of Conversion Pending Flag - * | | |Read: - * | | |0 = There is no pending conversion for sample module. - * | | |1 = Sample module ADC start of conversion is pending. - * | | |Write: - * | | |1 = clear pending flag & cancel the conversion for sample module. - * | | |Note: This bit remains 1 during pending state, when the respective ADC conversion is end, the STPFn (n=0~18) bit is automatically cleared to 0 - * @var EADC_T::OVSTS - * Offset: 0x5C ADC Sample Module Start of Conversion Overrun Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[18:0] |SPOVF |ADC SAMPLE0~18 Overrun Flag - * | | |0 = No sample module event overrun. - * | | |1 = Indicates a new sample module event is generated while an old one event is pending. - * | | |Note: This bit is cleared by writing 1 to it. - * @var EADC_T::SCTL[19] - * Offset: 0x80 ADC Sample Module 0~18 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0 (slow channel). - * | | |01H = EADC_CH1 (slow channel). - * | | |02H = EADC_CH2 (slow channel). - * | | |03H = EADC_CH3 (slow channel). - * | | |04H = EADC_CH4 (slow channel). - * | | |05H = EADC_CH5 (slow channel). - * | | |06H = EADC_CH6 (slow channel). - * | | |07H = EADC_CH7 (slow channel). - * | | |08H = EADC_CH8 (slow channel). - * | | |09H = EADC_CH9 (slow channel). - * | | |0AH = EADC_CH10 (fast channel). - * | | |0BH = EADC_CH11 (fast channel). - * | | |0CH = EADC_CH12 (fast channel). - * | | |0DH = EADC_CH13 (fast channel). - * | | |0EH = EADC_CH14 (fast channel). - * | | |0FH = EADC_CH15 (fast channel). - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK x n (n=1,2,4,16 from TRGDLYDIV setting). - * |[20:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = EPWM0TG0. - * | | |9H = EPWM0TG1. - * | | |AH = EPWM0TG2. - * | | |BH = EPWM0TG3. - * | | |CH = EPWM0TG4. - * | | |DH = EPWM0TG5. - * | | |EH = EPWM1TG0. - * | | |FH = EPWM1TG1. - * | | |10H = EPWM1TG2. - * | | |11H = EPWM1TG3. - * | | |12H = EPWM1TG4. - * | | |13H = EPWM1TG5. - * | | |14H = BPWM0TG. - * | | |15H = BPWM1TG. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * |[23] |DBMEN |Double Buffer Mode Enable Bit - * | | |0 = Sample has one sample result register. (default). - * | | |1 = Sample has two sample result registers. - * |[31:24] |EXTSMPT |ADC Sampling Time Extend - * | | |When ADC converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, user can extend ADC sampling time after trigger source is coming to get enough sampling time. - * | | |The range of start delay time is from 0~255 ADC clock. - * @var EADC_T::INTSRC[4] - * Offset: 0xD0 ADC interrupt 0~3 Source Enable Control Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPLIE0 |Sample Module 0 Interrupt Enable Bit - * | | |0 = Sample Module 0 interrupt Disabled. - * | | |1 = Sample Module 0 interrupt Enabled. - * |[1] |SPLIE1 |Sample Module 1 Interrupt Enable Bit - * | | |0 = Sample Module 1 interrupt Disabled. - * | | |1 = Sample Module 1 interrupt Enabled. - * |[2] |SPLIE2 |Sample Module 2 Interrupt Enable Bit - * | | |0 = Sample Module 2 interrupt Disabled. - * | | |1 = Sample Module 2 interrupt Enabled. - * |[3] |SPLIE3 |Sample Module 3 Interrupt Enable Bit - * | | |0 = Sample Module 3 interrupt Disabled. - * | | |1 = Sample Module 3 interrupt Enabled. - * |[4] |SPLIE4 |Sample Module 4 Interrupt Enable Bit - * | | |0 = Sample Module 4 interrupt Disabled. - * | | |1 = Sample Module 4 interrupt Enabled. - * |[5] |SPLIE5 |Sample Module 5 Interrupt Enable Bit - * | | |0 = Sample Module 5 interrupt Disabled. - * | | |1 = Sample Module 5 interrupt Enabled. - * |[6] |SPLIE6 |Sample Module 6 Interrupt Enable Bit - * | | |0 = Sample Module 6 interrupt Disabled. - * | | |1 = Sample Module 6 interrupt Enabled. - * |[7] |SPLIE7 |Sample Module 7 Interrupt Enable Bit - * | | |0 = Sample Module 7 interrupt Disabled. - * | | |1 = Sample Module 7 interrupt Enabled. - * |[8] |SPLIE8 |Sample Module 8 Interrupt Enable Bit - * | | |0 = Sample Module 8 interrupt Disabled. - * | | |1 = Sample Module 8 interrupt Enabled. - * |[9] |SPLIE9 |Sample Module 9 Interrupt Enable Bit - * | | |0 = Sample Module 9 interrupt Disabled. - * | | |1 = Sample Module 9 interrupt Enabled. - * |[10] |SPLIE10 |Sample Module 10 Interrupt Enable Bit - * | | |0 = Sample Module 10 interrupt Disabled. - * | | |1 = Sample Module 10 interrupt Enabled. - * |[11] |SPLIE11 |Sample Module 11 Interrupt Enable Bit - * | | |0 = Sample Module 11 interrupt Disabled. - * | | |1 = Sample Module 11 interrupt Enabled. - * |[12] |SPLIE12 |Sample Module 12 Interrupt Enable Bit - * | | |0 = Sample Module 12 interrupt Disabled. - * | | |1 = Sample Module 12 interrupt Enabled. - * |[13] |SPLIE13 |Sample Module 13 Interrupt Enable Bit - * | | |0 = Sample Module 13 interrupt Disabled. - * | | |1 = Sample Module 13 interrupt Enabled. - * |[14] |SPLIE14 |Sample Module 14 Interrupt Enable Bit - * | | |0 = Sample Module 14 interrupt Disabled. - * | | |1 = Sample Module 14 interrupt Enabled. - * |[15] |SPLIE15 |Sample Module 15 Interrupt Enable Bit - * | | |0 = Sample Module 15 interrupt Disabled. - * | | |1 = Sample Module 15 interrupt Enabled. - * |[16] |SPLIE16 |Sample Module 16 Interrupt Enable Bit - * | | |0 = Sample Module 16 interrupt Disabled. - * | | |1 = Sample Module 16 interrupt Enabled. - * |[17] |SPLIE17 |Sample Module 17 Interrupt Enable Bit - * | | |0 = Sample Module 17 interrupt Disabled. - * | | |1 = Sample Module 17 interrupt Enabled. - * |[18] |SPLIE18 |Sample Module 18 Interrupt Enable Bit - * | | |0 = Sample Module 18 interrupt Disabled. - * | | |1 = Sample Module 18 interrupt Enabled. - * @var EADC_T::CMP[4] - * Offset: 0xE0 ADC Result Compare Register 0~3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCMPEN |ADC Result Compare Enable Bit - * | | |0 = Compare Disabled. - * | | |1 = Compare Enabled. - * | | |Set this bit to 1 to enable compare CMPDAT (EADC_CMPn[27:16], n=0~3) with specified sample module conversion result when converted data is loaded into EADC_DAT register. - * |[1] |ADCMPIE |ADC Result Compare Interrupt Enable Bit - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, if ADCMPIE is set to 1, a compare interrupt request is generated. - * |[2] |CMPCOND |Compare Condition - * | | |0= Set the compare condition as that when a 12-bit ADC conversion result is less than the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |1= Set the compare condition as that when a 12-bit ADC conversion result is greater or equal to the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |Note: When the internal counter reaches the value to (CMPMCNT (EADC_CMPn[11:8], n=0~3) +1), the CMPF bit will be set. - * |[7:3] |CMPSPL |Compare Sample Module Selection - * | | |00000 = Sample Module 0 conversion result EADC_DAT0 is selected to be compared. - * | | |00001 = Sample Module 1 conversion result EADC_DAT1 is selected to be compared. - * | | |00010 = Sample Module 2 conversion result EADC_DAT2 is selected to be compared. - * | | |00011 = Sample Module 3 conversion result EADC_DAT3 is selected to be compared. - * | | |00100 = Sample Module 4 conversion result EADC_DAT4 is selected to be compared. - * | | |00101 = Sample Module 5 conversion result EADC_DAT5 is selected to be compared. - * | | |00110 = Sample Module 6 conversion result EADC_DAT6 is selected to be compared. - * | | |00111 = Sample Module 7 conversion result EADC_DAT7 is selected to be compared. - * | | |01000 = Sample Module 8 conversion result EADC_DAT8 is selected to be compared. - * | | |01001 = Sample Module 9 conversion result EADC_DAT9 is selected to be compared. - * | | |01010 = Sample Module 10 conversion result EADC_DAT10 is selected to be compared. - * | | |01011 = Sample Module 11 conversion result EADC_DAT11 is selected to be compared. - * | | |01100 = Sample Module 12 conversion result EADC_DAT12 is selected to be compared. - * | | |01101 = Sample Module 13 conversion result EADC_DAT13 is selected to be compared. - * | | |01110 = Sample Module 14 conversion result EADC_DAT14 is selected to be compared. - * | | |01111 = Sample Module 15 conversion result EADC_DAT15 is selected to be compared. - * | | |10000 = Sample Module 16 conversion result EADC_DAT16 is selected to be compared. - * | | |10001 = Sample Module 17 conversion result EADC_DAT17 is selected to be compared. - * | | |10010 = Sample Module 18 conversion result EADC_DAT18 is selected to be compared. - * |[11:8] |CMPMCNT |Compare Match Count - * | | |When the specified ADC sample module analog conversion result matches the compare condition defined by CMPCOND (EADC_CMPn[2], n=0~3), the internal match counter will increase 1 - * | | |If the compare result does not meet the compare condition, the internal compare match counter will reset to 0 - * | | |When the internal counter reaches the value to (CMPMCNT +1), the ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = ADCMPF0 (EADC_STATUS2[4]) will be set when EADC_CMP0 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when EADC_CMP2 compared condition matched - * | | |1 = ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * | | |Note: This bit is only present in EADC_CMP0 and EADC_CMP2 register. - * |[27:16] |CMPDAT |Comparison Data - * | | |The 12 bits data is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage transition without imposing a load on software. - * @var EADC_T::STATUS0 - * Offset: 0xF0 ADC Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |VALID |EADC_DAT0~15 Data Valid Flag - * | | |It is a mirror of VALID bit in sample module ADC result data register EADC_DATn. (n=0~18). - * |[31:16] |OV |EADC_DAT0~15 Overrun Flag - * | | |It is a mirror to OV bit in sample module ADC result data register EADC_DATn. (n=0~18). - * @var EADC_T::STATUS1 - * Offset: 0xF4 ADC Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |VALID |EADC_DAT16~18 Data Valid Flag - * | | |It is a mirror of VALID bit in sample module ADC result data register EADC_DATn. (n=0~18). - * |[18:16] |OV |EADC_DAT16~18 Overrun Flag - * | | |It is a mirror to OV bit in sample module ADC result data register EADC_DATn. (n=0~18). - * @var EADC_T::STATUS2 - * Offset: 0xF8 ADC Status Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADIF0 |ADC ADINT0 Interrupt Flag - * | | |0 = No ADINT0 interrupt pulse received. - * | | |1 = ADINT0 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[1] |ADIF1 |ADC ADINT1 Interrupt Flag - * | | |0 = No ADINT1 interrupt pulse received. - * | | |1 = ADINT1 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[2] |ADIF2 |ADC ADINT2 Interrupt Flag - * | | |0 = No ADINT2 interrupt pulse received. - * | | |1 = ADINT2 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[3] |ADIF3 |ADC ADINT3 Interrupt Flag - * | | |0 = No ADINT3 interrupt pulse received. - * | | |1 = ADINT3 interrupt pulse has been received. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[4] |ADCMPF0 |ADC Compare 0 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP0 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP0 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP0 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[5] |ADCMPF1 |ADC Compare 1 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP1 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP1 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP1 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |ADCMPF2 |ADC Compare 2 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP2 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP2 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP2 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[7] |ADCMPF3 |ADC Compare 3 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP3 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP3 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP3 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[8] |ADOVIF0 |ADC ADINT0 Interrupt Flag Overrun - * | | |0 = ADINT0 interrupt flag is not overwritten to 1. - * | | |1 = ADINT0 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[9] |ADOVIF1 |ADC ADINT1 Interrupt Flag Overrun - * | | |0 = ADINT1 interrupt flag is not overwritten to 1. - * | | |1 = ADINT1 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[10] |ADOVIF2 |ADC ADINT2 Interrupt Flag Overrun - * | | |0 = ADINT2 interrupt flag is not overwritten to 1. - * | | |1 = ADINT2 interrupt flag is s overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[11] |ADOVIF3 |ADC ADINT3 Interrupt Flag Overrun - * | | |0 = ADINT3 interrupt flag is not overwritten to 1. - * | | |1 = ADINT3 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[12] |ADCMPO0 |ADC Compare 0 Output Status (Read Only) - * | | |The 12 bits compare0 data CMPDAT0 (EADC_CMP0[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT0 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT0 setting. - * |[13] |ADCMPO1 |ADC Compare 1 Output Status (Read Only) - * | | |The 12 bits compare1 data CMPDAT1 (EADC_CMP1[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT1 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT1 setting. - * |[14] |ADCMPO2 |ADC Compare 2 Output Status (Read Only) - * | | |The 12 bits compare2 data CMPDAT2 (EADC_CMP2[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT2 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT2 setting. - * |[15] |ADCMPO3 |ADC Compare 3 Output Status (Read Only) - * | | |The 12 bits compare3 data CMPDAT3 (EADC_CMP3[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT less than CMPDAT3 setting. - * | | |1 = Conversion result in EADC_DAT great than or equal CMPDAT3 setting. - * |[20:16] |CHANNEL |Current Conversion Channel (Read Only) - * | | |This filed reflects ADC current conversion channel when BUSY=1. - * | | |It is read only. - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = EADC_CH8. - * | | |09H = EADC_CH9. - * | | |0AH = EADC_CH10. - * | | |0BH = EADC_CH11. - * | | |0CH = EADC_CH12. - * | | |0DH = EADC_CH13. - * | | |0EH = EADC_CH14. - * | | |0FH = EADC_CH15. - * | | |10H = VBG. - * | | |11H = VTEMP. - * | | |12H = VBAT/4. - * |[23] |BUSY |Busy/Idle (Read Only) - * | | |0 = EADC is in idle state. - * | | |1 = EADC is busy at conversion. - * |[24] |ADOVIF |All ADC Interrupt Flag Overrun Bits Check (Read Only) - * | | |n=0~3. - * | | |0 = None of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * | | |1 = Any one of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * | | |Note: This bit will keep 1 when any ADOVIFn Flag is equal to 1. - * |[25] |STOVF |for All ADC Sample Module Start of Conversion Overrun Flags Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * | | |1 = Any one of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * | | |Note: This bit will keep 1 when any SPOVFn Flag is equal to 1. - * |[26] |AVALID |for All Sample Module ADC Result Data Register EADC_DAT Data Valid Flag Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * | | |1 = Any one of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * | | |Note: This bit will keep 1 when any VALIDn Flag is equal to 1. - * |[27] |AOV |for All Sample Module ADC Result Data Register Overrun Flags Check (Read Only) - * | | |n=0~18. - * | | |0 = None of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * | | |1 = Any one of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * | | |Note: This bit will keep 1 when any OVn Flag is equal to 1. - * @var EADC_T::STATUS3 - * Offset: 0xFC ADC Status Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CURSPL |ADC Current Sample Module - * | | |This register show the current ADC is controlled by which sample module control logic modules. - * | | |If the ADC is Idle, this bit filed will set to 0x1F. - * | | |This is a read only register. - * @var EADC_T::DDAT[4] - * Offset: 0x100 ADC Double Data Register 0 for Sample Module 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Results - * | | |This field contains 12 bits conversion results. - * | | |When the DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT [11:0] and zero will be filled in RESULT [15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2'complement format will be filled in RESULT [11:0] and signed bits to will be filled in RESULT [15:12]. - * |[16] |OV |Overrun Flag - * | | |0 = Data in RESULT (EADC_DATn[15:0], n=0~3) is recent conversion result. - * | | |1 = Data in RESULT (EADC_DATn[15:0], n=0~3) is overwrite. - * | | |If converted data in RESULT[15:0] has not been read before new conversion result is loaded to this register, OV is set to 1 - * | | |It is cleared by hardware after EADC_DDAT register is read. - * |[17] |VALID |Valid Flag - * | | |0 = Double data in RESULT (EADC_DDATn[15:0]) is not valid. - * | | |1 = Double data in RESULT (EADC_DDATn[15:0]) is valid. - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DDATn register is read - * | | |(n=0~3). - * @var EADC_T::PWRM - * Offset: 0x110 ADC Power Management Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWUPRDY |ADC Power-up Sequence Completed and Ready for Conversion (Read Only) - * | | |0 = ADC is not ready for conversion may be in power down state or in the progress of start up. - * | | |1 = ADC is ready for conversion. - * |[1] |PWUCALEN |Power Up Calibration Function Enable Control - * | | |0 = Disable the function of calibration at power up. - * | | |1 = Enable the function of calibration at power up. - * | | |Note: This bit work together with CALSEL (EADC_CALCTL [3]), see the following - * | | |{PWUCALEN, CALSEL } Description: - * | | |PWUCALEN is 0 and CALSEL is 0: No need to calibrate. - * | | |PWUCALEN is 0 and CALSEL is 1: No need to calibrate. - * | | |PWUCALEN is 1 and CALSEL is 0: Load calibration word when power up. - * | | |PWUCALEN is 1 and CALSEL is 1: Calibrate when power up. - * |[3:2] |PWDMOD |ADC Power-down Mode - * | | |Set this bit fields to select ADC power down mode when system power-down. - * | | |00 = ADC Deep power down mode. - * | | |01 = ADC Power down. - * | | |10 = ADC Standby mode. - * | | |11 = ADC Deep power down mode. - * | | |Note: Different PWDMOD has different power down/up sequence, in order to avoid ADC powering up with wrong sequence; user must keep PWMOD consistent each time in power down and start up - * |[19:8] |LDOSUT |ADC Internal LDO Start-up Time - * | | |Set this bit fields to control LDO start-up time - * | | |The minimum required LDO start-up time is 20us - * | | |LDO start-up time = (1/ADC_CLK) x LDOSUT. - * @var EADC_T::CALCTL - * Offset: 0x114 ADC Calibration Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |CALSTART |Calibration Functional Block Start - * | | |0 = Stops calibration functional block. - * | | |1 = Starts calibration functional block. - * | | |Note: This bit is set by SW and clear by HW after re-calibration finish - * |[2] |CALDONE |Calibration Functional Block Complete (Read Only) - * | | |0 = During a calibration. - * | | |1 = Calibration is completed. - * |[3] |CALSEL |Select Calibration Functional Block - * | | |0 = Load calibration word when calibration functional block is active. - * | | |1 = Execute calibration when calibration functional block is active. - * @var EADC_T::CALDWRD - * Offset: 0x118 ADC Calibration Load Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |CALWORD |Calibration Word Bits - * | | |Write to this register with the previous calibration word before load calibration action. - * | | |Read this register after calibration done. - * | | |Note: The calibration block contains two parts CALIBRATION and LOAD CALIBRATION; if the calibration block configure as CALIBRATION; then this register represent the result of calibration when calibration is completed; if configure as LOAD CALIBRATION ; configure this register before loading calibration action, after loading calibration complete, the laoded calibration word will apply to the ADC; while in loading calibration function the loaded value will not be equal to the original CALWORD until calibration is done. - */ - __I uint32_t DAT[19]; /*!< [0x0000] ADC Data Register 0~18 for Sample Module 0~18 */ - __I uint32_t CURDAT; /*!< [0x004c] ADC PDMA Current Transfer Data Register */ - __IO uint32_t CTL; /*!< [0x0050] ADC Control Register */ - __O uint32_t SWTRG; /*!< [0x0054] ADC Sample Module Software Start Register */ - __IO uint32_t PENDSTS; /*!< [0x0058] ADC Start of Conversion Pending Flag Register */ - __IO uint32_t OVSTS; /*!< [0x005c] ADC Sample Module Start of Conversion Overrun Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SCTL[19]; /*!< [0x0080] ADC Sample Module 0~18 Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t INTSRC[4]; /*!< [0x00d0] ADC interrupt 0~3 Source Enable Control Register. */ - __IO uint32_t CMP[4]; /*!< [0x00e0] ADC Result Compare Register 0~3 */ - __I uint32_t STATUS0; /*!< [0x00f0] ADC Status Register 0 */ - __I uint32_t STATUS1; /*!< [0x00f4] ADC Status Register 1 */ - __IO uint32_t STATUS2; /*!< [0x00f8] ADC Status Register 2 */ - __I uint32_t STATUS3; /*!< [0x00fc] ADC Status Register 3 */ - __I uint32_t DDAT[4]; /*!< [0x0100] ADC Double Data Register 0~3 for Sample Module 0~3 */ - __IO uint32_t PWRM; /*!< [0x0110] ADC Power Management Register */ - __IO uint32_t CALCTL; /*!< [0x0114] ADC Calibration Control Register */ - __IO uint32_t CALDWRD; /*!< [0x0118] ADC Calibration Load Word Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PDMACTL; /*!< [0x0130] ADC PDMA Control Register */ -} EADC_T; - -/** - @addtogroup EADC_CONST EADC Bit Field Definition - Constant Definitions for EADC Controller -@{ */ - -#define EADC_DAT_RESULT_Pos (0) /*!< EADC_T::DAT: RESULT Position */ -#define EADC_DAT_RESULT_Msk (0xfffful << EADC_DAT_RESULT_Pos) /*!< EADC_T::DAT: RESULT Mask */ - -#define EADC_DAT_OV_Pos (16) /*!< EADC_T::DAT: OV Position */ -#define EADC_DAT_OV_Msk (0x1ul << EADC_DAT_OV_Pos) /*!< EADC_T::DAT: OV Mask */ - -#define EADC_DAT_VALID_Pos (17) /*!< EADC_T::DAT: VALID Position */ -#define EADC_DAT_VALID_Msk (0x1ul << EADC_DAT_VALID_Pos) /*!< EADC_T::DAT: VALID Mask */ - -#define EADC_DAT0_RESULT_Pos (0) /*!< EADC_T::DAT0: RESULT Position */ -#define EADC_DAT0_RESULT_Msk (0xfffful << EADC_DAT0_RESULT_Pos) /*!< EADC_T::DAT0: RESULT Mask */ - -#define EADC_DAT0_OV_Pos (16) /*!< EADC_T::DAT0: OV Position */ -#define EADC_DAT0_OV_Msk (0x1ul << EADC_DAT0_OV_Pos) /*!< EADC_T::DAT0: OV Mask */ - -#define EADC_DAT0_VALID_Pos (17) /*!< EADC_T::DAT0: VALID Position */ -#define EADC_DAT0_VALID_Msk (0x1ul << EADC_DAT0_VALID_Pos) /*!< EADC_T::DAT0: VALID Mask */ - -#define EADC_DAT1_RESULT_Pos (0) /*!< EADC_T::DAT1: RESULT Position */ -#define EADC_DAT1_RESULT_Msk (0xfffful << EADC_DAT1_RESULT_Pos) /*!< EADC_T::DAT1: RESULT Mask */ - -#define EADC_DAT1_OV_Pos (16) /*!< EADC_T::DAT1: OV Position */ -#define EADC_DAT1_OV_Msk (0x1ul << EADC_DAT1_OV_Pos) /*!< EADC_T::DAT1: OV Mask */ - -#define EADC_DAT1_VALID_Pos (17) /*!< EADC_T::DAT1: VALID Position */ -#define EADC_DAT1_VALID_Msk (0x1ul << EADC_DAT1_VALID_Pos) /*!< EADC_T::DAT1: VALID Mask */ - -#define EADC_DAT2_RESULT_Pos (0) /*!< EADC_T::DAT2: RESULT Position */ -#define EADC_DAT2_RESULT_Msk (0xfffful << EADC_DAT2_RESULT_Pos) /*!< EADC_T::DAT2: RESULT Mask */ - -#define EADC_DAT2_OV_Pos (16) /*!< EADC_T::DAT2: OV Position */ -#define EADC_DAT2_OV_Msk (0x1ul << EADC_DAT2_OV_Pos) /*!< EADC_T::DAT2: OV Mask */ - -#define EADC_DAT2_VALID_Pos (17) /*!< EADC_T::DAT2: VALID Position */ -#define EADC_DAT2_VALID_Msk (0x1ul << EADC_DAT2_VALID_Pos) /*!< EADC_T::DAT2: VALID Mask */ - -#define EADC_DAT3_RESULT_Pos (0) /*!< EADC_T::DAT3: RESULT Position */ -#define EADC_DAT3_RESULT_Msk (0xfffful << EADC_DAT3_RESULT_Pos) /*!< EADC_T::DAT3: RESULT Mask */ - -#define EADC_DAT3_OV_Pos (16) /*!< EADC_T::DAT3: OV Position */ -#define EADC_DAT3_OV_Msk (0x1ul << EADC_DAT3_OV_Pos) /*!< EADC_T::DAT3: OV Mask */ - -#define EADC_DAT3_VALID_Pos (17) /*!< EADC_T::DAT3: VALID Position */ -#define EADC_DAT3_VALID_Msk (0x1ul << EADC_DAT3_VALID_Pos) /*!< EADC_T::DAT3: VALID Mask */ - -#define EADC_DAT4_RESULT_Pos (0) /*!< EADC_T::DAT4: RESULT Position */ -#define EADC_DAT4_RESULT_Msk (0xfffful << EADC_DAT4_RESULT_Pos) /*!< EADC_T::DAT4: RESULT Mask */ - -#define EADC_DAT4_OV_Pos (16) /*!< EADC_T::DAT4: OV Position */ -#define EADC_DAT4_OV_Msk (0x1ul << EADC_DAT4_OV_Pos) /*!< EADC_T::DAT4: OV Mask */ - -#define EADC_DAT4_VALID_Pos (17) /*!< EADC_T::DAT4: VALID Position */ -#define EADC_DAT4_VALID_Msk (0x1ul << EADC_DAT4_VALID_Pos) /*!< EADC_T::DAT4: VALID Mask */ - -#define EADC_DAT5_RESULT_Pos (0) /*!< EADC_T::DAT5: RESULT Position */ -#define EADC_DAT5_RESULT_Msk (0xfffful << EADC_DAT5_RESULT_Pos) /*!< EADC_T::DAT5: RESULT Mask */ - -#define EADC_DAT5_OV_Pos (16) /*!< EADC_T::DAT5: OV Position */ -#define EADC_DAT5_OV_Msk (0x1ul << EADC_DAT5_OV_Pos) /*!< EADC_T::DAT5: OV Mask */ - -#define EADC_DAT5_VALID_Pos (17) /*!< EADC_T::DAT5: VALID Position */ -#define EADC_DAT5_VALID_Msk (0x1ul << EADC_DAT5_VALID_Pos) /*!< EADC_T::DAT5: VALID Mask */ - -#define EADC_DAT6_RESULT_Pos (0) /*!< EADC_T::DAT6: RESULT Position */ -#define EADC_DAT6_RESULT_Msk (0xfffful << EADC_DAT6_RESULT_Pos) /*!< EADC_T::DAT6: RESULT Mask */ - -#define EADC_DAT6_OV_Pos (16) /*!< EADC_T::DAT6: OV Position */ -#define EADC_DAT6_OV_Msk (0x1ul << EADC_DAT6_OV_Pos) /*!< EADC_T::DAT6: OV Mask */ - -#define EADC_DAT6_VALID_Pos (17) /*!< EADC_T::DAT6: VALID Position */ -#define EADC_DAT6_VALID_Msk (0x1ul << EADC_DAT6_VALID_Pos) /*!< EADC_T::DAT6: VALID Mask */ - -#define EADC_DAT7_RESULT_Pos (0) /*!< EADC_T::DAT7: RESULT Position */ -#define EADC_DAT7_RESULT_Msk (0xfffful << EADC_DAT7_RESULT_Pos) /*!< EADC_T::DAT7: RESULT Mask */ - -#define EADC_DAT7_OV_Pos (16) /*!< EADC_T::DAT7: OV Position */ -#define EADC_DAT7_OV_Msk (0x1ul << EADC_DAT7_OV_Pos) /*!< EADC_T::DAT7: OV Mask */ - -#define EADC_DAT7_VALID_Pos (17) /*!< EADC_T::DAT7: VALID Position */ -#define EADC_DAT7_VALID_Msk (0x1ul << EADC_DAT7_VALID_Pos) /*!< EADC_T::DAT7: VALID Mask */ - -#define EADC_DAT8_RESULT_Pos (0) /*!< EADC_T::DAT8: RESULT Position */ -#define EADC_DAT8_RESULT_Msk (0xfffful << EADC_DAT8_RESULT_Pos) /*!< EADC_T::DAT8: RESULT Mask */ - -#define EADC_DAT8_OV_Pos (16) /*!< EADC_T::DAT8: OV Position */ -#define EADC_DAT8_OV_Msk (0x1ul << EADC_DAT8_OV_Pos) /*!< EADC_T::DAT8: OV Mask */ - -#define EADC_DAT8_VALID_Pos (17) /*!< EADC_T::DAT8: VALID Position */ -#define EADC_DAT8_VALID_Msk (0x1ul << EADC_DAT8_VALID_Pos) /*!< EADC_T::DAT8: VALID Mask */ - -#define EADC_DAT9_RESULT_Pos (0) /*!< EADC_T::DAT9: RESULT Position */ -#define EADC_DAT9_RESULT_Msk (0xfffful << EADC_DAT9_RESULT_Pos) /*!< EADC_T::DAT9: RESULT Mask */ - -#define EADC_DAT9_OV_Pos (16) /*!< EADC_T::DAT9: OV Position */ -#define EADC_DAT9_OV_Msk (0x1ul << EADC_DAT9_OV_Pos) /*!< EADC_T::DAT9: OV Mask */ - -#define EADC_DAT9_VALID_Pos (17) /*!< EADC_T::DAT9: VALID Position */ -#define EADC_DAT9_VALID_Msk (0x1ul << EADC_DAT9_VALID_Pos) /*!< EADC_T::DAT9: VALID Mask */ - -#define EADC_DAT10_RESULT_Pos (0) /*!< EADC_T::DAT10: RESULT Position */ -#define EADC_DAT10_RESULT_Msk (0xfffful << EADC_DAT10_RESULT_Pos) /*!< EADC_T::DAT10: RESULT Mask */ - -#define EADC_DAT10_OV_Pos (16) /*!< EADC_T::DAT10: OV Position */ -#define EADC_DAT10_OV_Msk (0x1ul << EADC_DAT10_OV_Pos) /*!< EADC_T::DAT10: OV Mask */ - -#define EADC_DAT10_VALID_Pos (17) /*!< EADC_T::DAT10: VALID Position */ -#define EADC_DAT10_VALID_Msk (0x1ul << EADC_DAT10_VALID_Pos) /*!< EADC_T::DAT10: VALID Mask */ - -#define EADC_DAT11_RESULT_Pos (0) /*!< EADC_T::DAT11: RESULT Position */ -#define EADC_DAT11_RESULT_Msk (0xfffful << EADC_DAT11_RESULT_Pos) /*!< EADC_T::DAT11: RESULT Mask */ - -#define EADC_DAT11_OV_Pos (16) /*!< EADC_T::DAT11: OV Position */ -#define EADC_DAT11_OV_Msk (0x1ul << EADC_DAT11_OV_Pos) /*!< EADC_T::DAT11: OV Mask */ - -#define EADC_DAT11_VALID_Pos (17) /*!< EADC_T::DAT11: VALID Position */ -#define EADC_DAT11_VALID_Msk (0x1ul << EADC_DAT11_VALID_Pos) /*!< EADC_T::DAT11: VALID Mask */ - -#define EADC_DAT12_RESULT_Pos (0) /*!< EADC_T::DAT12: RESULT Position */ -#define EADC_DAT12_RESULT_Msk (0xfffful << EADC_DAT12_RESULT_Pos) /*!< EADC_T::DAT12: RESULT Mask */ - -#define EADC_DAT12_OV_Pos (16) /*!< EADC_T::DAT12: OV Position */ -#define EADC_DAT12_OV_Msk (0x1ul << EADC_DAT12_OV_Pos) /*!< EADC_T::DAT12: OV Mask */ - -#define EADC_DAT12_VALID_Pos (17) /*!< EADC_T::DAT12: VALID Position */ -#define EADC_DAT12_VALID_Msk (0x1ul << EADC_DAT12_VALID_Pos) /*!< EADC_T::DAT12: VALID Mask */ - -#define EADC_DAT13_RESULT_Pos (0) /*!< EADC_T::DAT13: RESULT Position */ -#define EADC_DAT13_RESULT_Msk (0xfffful << EADC_DAT13_RESULT_Pos) /*!< EADC_T::DAT13: RESULT Mask */ - -#define EADC_DAT13_OV_Pos (16) /*!< EADC_T::DAT13: OV Position */ -#define EADC_DAT13_OV_Msk (0x1ul << EADC_DAT13_OV_Pos) /*!< EADC_T::DAT13: OV Mask */ - -#define EADC_DAT13_VALID_Pos (17) /*!< EADC_T::DAT13: VALID Position */ -#define EADC_DAT13_VALID_Msk (0x1ul << EADC_DAT13_VALID_Pos) /*!< EADC_T::DAT13: VALID Mask */ - -#define EADC_DAT14_RESULT_Pos (0) /*!< EADC_T::DAT14: RESULT Position */ -#define EADC_DAT14_RESULT_Msk (0xfffful << EADC_DAT14_RESULT_Pos) /*!< EADC_T::DAT14: RESULT Mask */ - -#define EADC_DAT14_OV_Pos (16) /*!< EADC_T::DAT14: OV Position */ -#define EADC_DAT14_OV_Msk (0x1ul << EADC_DAT14_OV_Pos) /*!< EADC_T::DAT14: OV Mask */ - -#define EADC_DAT14_VALID_Pos (17) /*!< EADC_T::DAT14: VALID Position */ -#define EADC_DAT14_VALID_Msk (0x1ul << EADC_DAT14_VALID_Pos) /*!< EADC_T::DAT14: VALID Mask */ - -#define EADC_DAT15_RESULT_Pos (0) /*!< EADC_T::DAT15: RESULT Position */ -#define EADC_DAT15_RESULT_Msk (0xfffful << EADC_DAT15_RESULT_Pos) /*!< EADC_T::DAT15: RESULT Mask */ - -#define EADC_DAT15_OV_Pos (16) /*!< EADC_T::DAT15: OV Position */ -#define EADC_DAT15_OV_Msk (0x1ul << EADC_DAT15_OV_Pos) /*!< EADC_T::DAT15: OV Mask */ - -#define EADC_DAT15_VALID_Pos (17) /*!< EADC_T::DAT15: VALID Position */ -#define EADC_DAT15_VALID_Msk (0x1ul << EADC_DAT15_VALID_Pos) /*!< EADC_T::DAT15: VALID Mask */ - -#define EADC_DAT16_RESULT_Pos (0) /*!< EADC_T::DAT16: RESULT Position */ -#define EADC_DAT16_RESULT_Msk (0xfffful << EADC_DAT16_RESULT_Pos) /*!< EADC_T::DAT16: RESULT Mask */ - -#define EADC_DAT16_OV_Pos (16) /*!< EADC_T::DAT16: OV Position */ -#define EADC_DAT16_OV_Msk (0x1ul << EADC_DAT16_OV_Pos) /*!< EADC_T::DAT16: OV Mask */ - -#define EADC_DAT16_VALID_Pos (17) /*!< EADC_T::DAT16: VALID Position */ -#define EADC_DAT16_VALID_Msk (0x1ul << EADC_DAT16_VALID_Pos) /*!< EADC_T::DAT16: VALID Mask */ - -#define EADC_DAT17_RESULT_Pos (0) /*!< EADC_T::DAT17: RESULT Position */ -#define EADC_DAT17_RESULT_Msk (0xfffful << EADC_DAT17_RESULT_Pos) /*!< EADC_T::DAT17: RESULT Mask */ - -#define EADC_DAT17_OV_Pos (16) /*!< EADC_T::DAT17: OV Position */ -#define EADC_DAT17_OV_Msk (0x1ul << EADC_DAT17_OV_Pos) /*!< EADC_T::DAT17: OV Mask */ - -#define EADC_DAT17_VALID_Pos (17) /*!< EADC_T::DAT17: VALID Position */ -#define EADC_DAT17_VALID_Msk (0x1ul << EADC_DAT17_VALID_Pos) /*!< EADC_T::DAT17: VALID Mask */ - -#define EADC_DAT18_RESULT_Pos (0) /*!< EADC_T::DAT18: RESULT Position */ -#define EADC_DAT18_RESULT_Msk (0xfffful << EADC_DAT18_RESULT_Pos) /*!< EADC_T::DAT18: RESULT Mask */ - -#define EADC_DAT18_OV_Pos (16) /*!< EADC_T::DAT18: OV Position */ -#define EADC_DAT18_OV_Msk (0x1ul << EADC_DAT18_OV_Pos) /*!< EADC_T::DAT18: OV Mask */ - -#define EADC_DAT18_VALID_Pos (17) /*!< EADC_T::DAT18: VALID Position */ -#define EADC_DAT18_VALID_Msk (0x1ul << EADC_DAT18_VALID_Pos) /*!< EADC_T::DAT18: VALID Mask */ - -#define EADC_CURDAT_CURDAT_Pos (0) /*!< EADC_T::CURDAT: CURDAT Position */ -#define EADC_CURDAT_CURDAT_Msk (0x3fffful << EADC_CURDAT_CURDAT_Pos) /*!< EADC_T::CURDAT: CURDAT Mask */ - -#define EADC_CTL_ADCEN_Pos (0) /*!< EADC_T::CTL: ADCEN Position */ -#define EADC_CTL_ADCEN_Msk (0x1ul << EADC_CTL_ADCEN_Pos) /*!< EADC_T::CTL: ADCEN Mask */ - -#define EADC_CTL_ADCRST_Pos (1) /*!< EADC_T::CTL: ADCRST Position */ -#define EADC_CTL_ADCRST_Msk (0x1ul << EADC_CTL_ADCRST_Pos) /*!< EADC_T::CTL: ADCRST Mask */ - -#define EADC_CTL_ADCIEN0_Pos (2) /*!< EADC_T::CTL: ADCIEN0 Position */ -#define EADC_CTL_ADCIEN0_Msk (0x1ul << EADC_CTL_ADCIEN0_Pos) /*!< EADC_T::CTL: ADCIEN0 Mask */ - -#define EADC_CTL_ADCIEN1_Pos (3) /*!< EADC_T::CTL: ADCIEN1 Position */ -#define EADC_CTL_ADCIEN1_Msk (0x1ul << EADC_CTL_ADCIEN1_Pos) /*!< EADC_T::CTL: ADCIEN1 Mask */ - -#define EADC_CTL_ADCIEN2_Pos (4) /*!< EADC_T::CTL: ADCIEN2 Position */ -#define EADC_CTL_ADCIEN2_Msk (0x1ul << EADC_CTL_ADCIEN2_Pos) /*!< EADC_T::CTL: ADCIEN2 Mask */ - -#define EADC_CTL_ADCIEN3_Pos (5) /*!< EADC_T::CTL: ADCIEN3 Position */ -#define EADC_CTL_ADCIEN3_Msk (0x1ul << EADC_CTL_ADCIEN3_Pos) /*!< EADC_T::CTL: ADCIEN3 Mask */ - -#define EADC_CTL_RESSEL_Pos (6) /*!< EADC_T::CTL: RESSEL Position */ -#define EADC_CTL_RESSEL_Msk (0x3ul << EADC_CTL_RESSEL_Pos) /*!< EADC_T::CTL: RESSEL Mask */ - -#define EADC_CTL_DIFFEN_Pos (8) /*!< EADC_T::CTL: DIFFEN Position */ -#define EADC_CTL_DIFFEN_Msk (0x1ul << EADC_CTL_DIFFEN_Pos) /*!< EADC_T::CTL: DIFFEN Mask */ - -#define EADC_CTL_DMOF_Pos (9) /*!< EADC_T::CTL: DMOF Position */ -#define EADC_CTL_DMOF_Msk (0x1ul << EADC_CTL_DMOF_Pos) /*!< EADC_T::CTL: DMOF Mask */ - -#define EADC_CTL_PDMAEN_Pos (11) /*!< EADC_T::CTL: PDMAEN Position */ -#define EADC_CTL_PDMAEN_Msk (0x1ul << EADC_CTL_PDMAEN_Pos) /*!< EADC_T::CTL: PDMAEN Mask */ - -#define EADC_SWTRG_SWTRG_Pos (0) /*!< EADC_T::SWTRG: SWTRG Position */ -#define EADC_SWTRG_SWTRG_Msk (0x7fffful << EADC_SWTRG_SWTRG_Pos) /*!< EADC_T::SWTRG: SWTRG Mask */ - -#define EADC_PENDSTS_STPF_Pos (0) /*!< EADC_T::PENDSTS: STPF Position */ -#define EADC_PENDSTS_STPF_Msk (0x7fffful << EADC_PENDSTS_STPF_Pos) /*!< EADC_T::PENDSTS: STPF Mask */ - -#define EADC_OVSTS_SPOVF_Pos (0) /*!< EADC_T::OVSTS: SPOVF Position */ -#define EADC_OVSTS_SPOVF_Msk (0x7fffful << EADC_OVSTS_SPOVF_Pos) /*!< EADC_T::OVSTS: SPOVF Mask */ - -#define EADC_SCTL_CHSEL_Pos (0) /*!< EADC_T::SCTL: CHSEL Position */ -#define EADC_SCTL_CHSEL_Msk (0xful << EADC_SCTL_CHSEL_Pos) /*!< EADC_T::SCTL: CHSEL Mask */ - -#define EADC_SCTL_EXTREN_Pos (4) /*!< EADC_T::SCTL: EXTREN Position */ -#define EADC_SCTL_EXTREN_Msk (0x1ul << EADC_SCTL_EXTREN_Pos) /*!< EADC_T::SCTL: EXTREN Mask */ - -#define EADC_SCTL_EXTFEN_Pos (5) /*!< EADC_T::SCTL: EXTFEN Position */ -#define EADC_SCTL_EXTFEN_Msk (0x1ul << EADC_SCTL_EXTFEN_Pos) /*!< EADC_T::SCTL: EXTFEN Mask */ - -#define EADC_SCTL_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL: TRGDLYDIV Position */ -#define EADC_SCTL_TRGDLYDIV_Msk (0x3ul << EADC_SCTL_TRGDLYDIV_Pos) /*!< EADC_T::SCTL: TRGDLYDIV Mask */ - -#define EADC_SCTL_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL: TRGDLYCNT Position */ -#define EADC_SCTL_TRGDLYCNT_Msk (0xfful << EADC_SCTL_TRGDLYCNT_Pos) /*!< EADC_T::SCTL: TRGDLYCNT Mask */ - -#define EADC_SCTL_TRGSEL_Pos (16) /*!< EADC_T::SCTL: TRGSEL Position */ -#define EADC_SCTL_TRGSEL_Msk (0x1ful << EADC_SCTL_TRGSEL_Pos) /*!< EADC_T::SCTL: TRGSEL Mask */ - -#define EADC_SCTL_INTPOS_Pos (22) /*!< EADC_T::SCTL: INTPOS Position */ -#define EADC_SCTL_INTPOS_Msk (0x1ul << EADC_SCTL_INTPOS_Pos) /*!< EADC_T::SCTL: INTPOS Mask */ - -#define EADC_SCTL_DBMEN_Pos (23) /*!< EADC_T::SCTL: DBMEN Position */ -#define EADC_SCTL_DBMEN_Msk (0x1ul << EADC_SCTL_DBMEN_Pos) /*!< EADC_T::SCTL: DBMEN Mask */ - -#define EADC_SCTL_EXTSMPT_Pos (24) /*!< EADC_T::SCTL: EXTSMPT Position */ -#define EADC_SCTL_EXTSMPT_Msk (0xfful << EADC_SCTL_EXTSMPT_Pos) /*!< EADC_T::SCTL: EXTSMPT Mask */ - -#define EADC_SCTL0_CHSEL_Pos (0) /*!< EADC_T::SCTL0: CHSEL Position */ -#define EADC_SCTL0_CHSEL_Msk (0xful << EADC_SCTL0_CHSEL_Pos) /*!< EADC_T::SCTL0: CHSEL Mask */ - -#define EADC_SCTL0_EXTREN_Pos (4) /*!< EADC_T::SCTL0: EXTREN Position */ -#define EADC_SCTL0_EXTREN_Msk (0x1ul << EADC_SCTL0_EXTREN_Pos) /*!< EADC_T::SCTL0: EXTREN Mask */ - -#define EADC_SCTL0_EXTFEN_Pos (5) /*!< EADC_T::SCTL0: EXTFEN Position */ -#define EADC_SCTL0_EXTFEN_Msk (0x1ul << EADC_SCTL0_EXTFEN_Pos) /*!< EADC_T::SCTL0: EXTFEN Mask */ - -#define EADC_SCTL0_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL0: TRGDLYDIV Position */ -#define EADC_SCTL0_TRGDLYDIV_Msk (0x3ul << EADC_SCTL0_TRGDLYDIV_Pos) /*!< EADC_T::SCTL0: TRGDLYDIV Mask */ - -#define EADC_SCTL0_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL0: TRGDLYCNT Position */ -#define EADC_SCTL0_TRGDLYCNT_Msk (0xfful << EADC_SCTL0_TRGDLYCNT_Pos) /*!< EADC_T::SCTL0: TRGDLYCNT Mask */ - -#define EADC_SCTL0_TRGSEL_Pos (16) /*!< EADC_T::SCTL0: TRGSEL Position */ -#define EADC_SCTL0_TRGSEL_Msk (0x1ful << EADC_SCTL0_TRGSEL_Pos) /*!< EADC_T::SCTL0: TRGSEL Mask */ - -#define EADC_SCTL0_INTPOS_Pos (22) /*!< EADC_T::SCTL0: INTPOS Position */ -#define EADC_SCTL0_INTPOS_Msk (0x1ul << EADC_SCTL0_INTPOS_Pos) /*!< EADC_T::SCTL0: INTPOS Mask */ - -#define EADC_SCTL0_DBMEN_Pos (23) /*!< EADC_T::SCTL0: DBMEN Position */ -#define EADC_SCTL0_DBMEN_Msk (0x1ul << EADC_SCTL0_DBMEN_Pos) /*!< EADC_T::SCTL0: DBMEN Mask */ - -#define EADC_SCTL0_EXTSMPT_Pos (24) /*!< EADC_T::SCTL0: EXTSMPT Position */ -#define EADC_SCTL0_EXTSMPT_Msk (0xfful << EADC_SCTL0_EXTSMPT_Pos) /*!< EADC_T::SCTL0: EXTSMPT Mask */ - -#define EADC_SCTL1_CHSEL_Pos (0) /*!< EADC_T::SCTL1: CHSEL Position */ -#define EADC_SCTL1_CHSEL_Msk (0xful << EADC_SCTL1_CHSEL_Pos) /*!< EADC_T::SCTL1: CHSEL Mask */ - -#define EADC_SCTL1_EXTREN_Pos (4) /*!< EADC_T::SCTL1: EXTREN Position */ -#define EADC_SCTL1_EXTREN_Msk (0x1ul << EADC_SCTL1_EXTREN_Pos) /*!< EADC_T::SCTL1: EXTREN Mask */ - -#define EADC_SCTL1_EXTFEN_Pos (5) /*!< EADC_T::SCTL1: EXTFEN Position */ -#define EADC_SCTL1_EXTFEN_Msk (0x1ul << EADC_SCTL1_EXTFEN_Pos) /*!< EADC_T::SCTL1: EXTFEN Mask */ - -#define EADC_SCTL1_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL1: TRGDLYDIV Position */ -#define EADC_SCTL1_TRGDLYDIV_Msk (0x3ul << EADC_SCTL1_TRGDLYDIV_Pos) /*!< EADC_T::SCTL1: TRGDLYDIV Mask */ - -#define EADC_SCTL1_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL1: TRGDLYCNT Position */ -#define EADC_SCTL1_TRGDLYCNT_Msk (0xfful << EADC_SCTL1_TRGDLYCNT_Pos) /*!< EADC_T::SCTL1: TRGDLYCNT Mask */ - -#define EADC_SCTL1_TRGSEL_Pos (16) /*!< EADC_T::SCTL1: TRGSEL Position */ -#define EADC_SCTL1_TRGSEL_Msk (0x1ful << EADC_SCTL1_TRGSEL_Pos) /*!< EADC_T::SCTL1: TRGSEL Mask */ - -#define EADC_SCTL1_INTPOS_Pos (22) /*!< EADC_T::SCTL1: INTPOS Position */ -#define EADC_SCTL1_INTPOS_Msk (0x1ul << EADC_SCTL1_INTPOS_Pos) /*!< EADC_T::SCTL1: INTPOS Mask */ - -#define EADC_SCTL1_DBMEN_Pos (23) /*!< EADC_T::SCTL1: DBMEN Position */ -#define EADC_SCTL1_DBMEN_Msk (0x1ul << EADC_SCTL1_DBMEN_Pos) /*!< EADC_T::SCTL1: DBMEN Mask */ - -#define EADC_SCTL1_EXTSMPT_Pos (24) /*!< EADC_T::SCTL1: EXTSMPT Position */ -#define EADC_SCTL1_EXTSMPT_Msk (0xfful << EADC_SCTL1_EXTSMPT_Pos) /*!< EADC_T::SCTL1: EXTSMPT Mask */ - -#define EADC_SCTL2_CHSEL_Pos (0) /*!< EADC_T::SCTL2: CHSEL Position */ -#define EADC_SCTL2_CHSEL_Msk (0xful << EADC_SCTL2_CHSEL_Pos) /*!< EADC_T::SCTL2: CHSEL Mask */ - -#define EADC_SCTL2_EXTREN_Pos (4) /*!< EADC_T::SCTL2: EXTREN Position */ -#define EADC_SCTL2_EXTREN_Msk (0x1ul << EADC_SCTL2_EXTREN_Pos) /*!< EADC_T::SCTL2: EXTREN Mask */ - -#define EADC_SCTL2_EXTFEN_Pos (5) /*!< EADC_T::SCTL2: EXTFEN Position */ -#define EADC_SCTL2_EXTFEN_Msk (0x1ul << EADC_SCTL2_EXTFEN_Pos) /*!< EADC_T::SCTL2: EXTFEN Mask */ - -#define EADC_SCTL2_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL2: TRGDLYDIV Position */ -#define EADC_SCTL2_TRGDLYDIV_Msk (0x3ul << EADC_SCTL2_TRGDLYDIV_Pos) /*!< EADC_T::SCTL2: TRGDLYDIV Mask */ - -#define EADC_SCTL2_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL2: TRGDLYCNT Position */ -#define EADC_SCTL2_TRGDLYCNT_Msk (0xfful << EADC_SCTL2_TRGDLYCNT_Pos) /*!< EADC_T::SCTL2: TRGDLYCNT Mask */ - -#define EADC_SCTL2_TRGSEL_Pos (16) /*!< EADC_T::SCTL2: TRGSEL Position */ -#define EADC_SCTL2_TRGSEL_Msk (0x1ful << EADC_SCTL2_TRGSEL_Pos) /*!< EADC_T::SCTL2: TRGSEL Mask */ - -#define EADC_SCTL2_INTPOS_Pos (22) /*!< EADC_T::SCTL2: INTPOS Position */ -#define EADC_SCTL2_INTPOS_Msk (0x1ul << EADC_SCTL2_INTPOS_Pos) /*!< EADC_T::SCTL2: INTPOS Mask */ - -#define EADC_SCTL2_DBMEN_Pos (23) /*!< EADC_T::SCTL2: DBMEN Position */ -#define EADC_SCTL2_DBMEN_Msk (0x1ul << EADC_SCTL2_DBMEN_Pos) /*!< EADC_T::SCTL2: DBMEN Mask */ - -#define EADC_SCTL2_EXTSMPT_Pos (24) /*!< EADC_T::SCTL2: EXTSMPT Position */ -#define EADC_SCTL2_EXTSMPT_Msk (0xfful << EADC_SCTL2_EXTSMPT_Pos) /*!< EADC_T::SCTL2: EXTSMPT Mask */ - -#define EADC_SCTL3_CHSEL_Pos (0) /*!< EADC_T::SCTL3: CHSEL Position */ -#define EADC_SCTL3_CHSEL_Msk (0xful << EADC_SCTL3_CHSEL_Pos) /*!< EADC_T::SCTL3: CHSEL Mask */ - -#define EADC_SCTL3_EXTREN_Pos (4) /*!< EADC_T::SCTL3: EXTREN Position */ -#define EADC_SCTL3_EXTREN_Msk (0x1ul << EADC_SCTL3_EXTREN_Pos) /*!< EADC_T::SCTL3: EXTREN Mask */ - -#define EADC_SCTL3_EXTFEN_Pos (5) /*!< EADC_T::SCTL3: EXTFEN Position */ -#define EADC_SCTL3_EXTFEN_Msk (0x1ul << EADC_SCTL3_EXTFEN_Pos) /*!< EADC_T::SCTL3: EXTFEN Mask */ - -#define EADC_SCTL3_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL3: TRGDLYDIV Position */ -#define EADC_SCTL3_TRGDLYDIV_Msk (0x3ul << EADC_SCTL3_TRGDLYDIV_Pos) /*!< EADC_T::SCTL3: TRGDLYDIV Mask */ - -#define EADC_SCTL3_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL3: TRGDLYCNT Position */ -#define EADC_SCTL3_TRGDLYCNT_Msk (0xfful << EADC_SCTL3_TRGDLYCNT_Pos) /*!< EADC_T::SCTL3: TRGDLYCNT Mask */ - -#define EADC_SCTL3_TRGSEL_Pos (16) /*!< EADC_T::SCTL3: TRGSEL Position */ -#define EADC_SCTL3_TRGSEL_Msk (0x1ful << EADC_SCTL3_TRGSEL_Pos) /*!< EADC_T::SCTL3: TRGSEL Mask */ - -#define EADC_SCTL3_INTPOS_Pos (22) /*!< EADC_T::SCTL3: INTPOS Position */ -#define EADC_SCTL3_INTPOS_Msk (0x1ul << EADC_SCTL3_INTPOS_Pos) /*!< EADC_T::SCTL3: INTPOS Mask */ - -#define EADC_SCTL3_DBMEN_Pos (23) /*!< EADC_T::SCTL3: DBMEN Position */ -#define EADC_SCTL3_DBMEN_Msk (0x1ul << EADC_SCTL3_DBMEN_Pos) /*!< EADC_T::SCTL3: DBMEN Mask */ - -#define EADC_SCTL3_EXTSMPT_Pos (24) /*!< EADC_T::SCTL3: EXTSMPT Position */ -#define EADC_SCTL3_EXTSMPT_Msk (0xfful << EADC_SCTL3_EXTSMPT_Pos) /*!< EADC_T::SCTL3: EXTSMPT Mask */ - -#define EADC_SCTL4_CHSEL_Pos (0) /*!< EADC_T::SCTL4: CHSEL Position */ -#define EADC_SCTL4_CHSEL_Msk (0xful << EADC_SCTL4_CHSEL_Pos) /*!< EADC_T::SCTL4: CHSEL Mask */ - -#define EADC_SCTL4_EXTREN_Pos (4) /*!< EADC_T::SCTL4: EXTREN Position */ -#define EADC_SCTL4_EXTREN_Msk (0x1ul << EADC_SCTL4_EXTREN_Pos) /*!< EADC_T::SCTL4: EXTREN Mask */ - -#define EADC_SCTL4_EXTFEN_Pos (5) /*!< EADC_T::SCTL4: EXTFEN Position */ -#define EADC_SCTL4_EXTFEN_Msk (0x1ul << EADC_SCTL4_EXTFEN_Pos) /*!< EADC_T::SCTL4: EXTFEN Mask */ - -#define EADC_SCTL4_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL4: TRGDLYDIV Position */ -#define EADC_SCTL4_TRGDLYDIV_Msk (0x3ul << EADC_SCTL4_TRGDLYDIV_Pos) /*!< EADC_T::SCTL4: TRGDLYDIV Mask */ - -#define EADC_SCTL4_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL4: TRGDLYCNT Position */ -#define EADC_SCTL4_TRGDLYCNT_Msk (0xfful << EADC_SCTL4_TRGDLYCNT_Pos) /*!< EADC_T::SCTL4: TRGDLYCNT Mask */ - -#define EADC_SCTL4_TRGSEL_Pos (16) /*!< EADC_T::SCTL4: TRGSEL Position */ -#define EADC_SCTL4_TRGSEL_Msk (0x1ful << EADC_SCTL4_TRGSEL_Pos) /*!< EADC_T::SCTL4: TRGSEL Mask */ - -#define EADC_SCTL4_INTPOS_Pos (22) /*!< EADC_T::SCTL4: INTPOS Position */ -#define EADC_SCTL4_INTPOS_Msk (0x1ul << EADC_SCTL4_INTPOS_Pos) /*!< EADC_T::SCTL4: INTPOS Mask */ - -#define EADC_SCTL4_EXTSMPT_Pos (24) /*!< EADC_T::SCTL4: EXTSMPT Position */ -#define EADC_SCTL4_EXTSMPT_Msk (0xfful << EADC_SCTL4_EXTSMPT_Pos) /*!< EADC_T::SCTL4: EXTSMPT Mask */ - -#define EADC_SCTL5_CHSEL_Pos (0) /*!< EADC_T::SCTL5: CHSEL Position */ -#define EADC_SCTL5_CHSEL_Msk (0xful << EADC_SCTL5_CHSEL_Pos) /*!< EADC_T::SCTL5: CHSEL Mask */ - -#define EADC_SCTL5_EXTREN_Pos (4) /*!< EADC_T::SCTL5: EXTREN Position */ -#define EADC_SCTL5_EXTREN_Msk (0x1ul << EADC_SCTL5_EXTREN_Pos) /*!< EADC_T::SCTL5: EXTREN Mask */ - -#define EADC_SCTL5_EXTFEN_Pos (5) /*!< EADC_T::SCTL5: EXTFEN Position */ -#define EADC_SCTL5_EXTFEN_Msk (0x1ul << EADC_SCTL5_EXTFEN_Pos) /*!< EADC_T::SCTL5: EXTFEN Mask */ - -#define EADC_SCTL5_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL5: TRGDLYDIV Position */ -#define EADC_SCTL5_TRGDLYDIV_Msk (0x3ul << EADC_SCTL5_TRGDLYDIV_Pos) /*!< EADC_T::SCTL5: TRGDLYDIV Mask */ - -#define EADC_SCTL5_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL5: TRGDLYCNT Position */ -#define EADC_SCTL5_TRGDLYCNT_Msk (0xfful << EADC_SCTL5_TRGDLYCNT_Pos) /*!< EADC_T::SCTL5: TRGDLYCNT Mask */ - -#define EADC_SCTL5_TRGSEL_Pos (16) /*!< EADC_T::SCTL5: TRGSEL Position */ -#define EADC_SCTL5_TRGSEL_Msk (0x1ful << EADC_SCTL5_TRGSEL_Pos) /*!< EADC_T::SCTL5: TRGSEL Mask */ - -#define EADC_SCTL5_INTPOS_Pos (22) /*!< EADC_T::SCTL5: INTPOS Position */ -#define EADC_SCTL5_INTPOS_Msk (0x1ul << EADC_SCTL5_INTPOS_Pos) /*!< EADC_T::SCTL5: INTPOS Mask */ - -#define EADC_SCTL5_EXTSMPT_Pos (24) /*!< EADC_T::SCTL5: EXTSMPT Position */ -#define EADC_SCTL5_EXTSMPT_Msk (0xfful << EADC_SCTL5_EXTSMPT_Pos) /*!< EADC_T::SCTL5: EXTSMPT Mask */ - -#define EADC_SCTL6_CHSEL_Pos (0) /*!< EADC_T::SCTL6: CHSEL Position */ -#define EADC_SCTL6_CHSEL_Msk (0xful << EADC_SCTL6_CHSEL_Pos) /*!< EADC_T::SCTL6: CHSEL Mask */ - -#define EADC_SCTL6_EXTREN_Pos (4) /*!< EADC_T::SCTL6: EXTREN Position */ -#define EADC_SCTL6_EXTREN_Msk (0x1ul << EADC_SCTL6_EXTREN_Pos) /*!< EADC_T::SCTL6: EXTREN Mask */ - -#define EADC_SCTL6_EXTFEN_Pos (5) /*!< EADC_T::SCTL6: EXTFEN Position */ -#define EADC_SCTL6_EXTFEN_Msk (0x1ul << EADC_SCTL6_EXTFEN_Pos) /*!< EADC_T::SCTL6: EXTFEN Mask */ - -#define EADC_SCTL6_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL6: TRGDLYDIV Position */ -#define EADC_SCTL6_TRGDLYDIV_Msk (0x3ul << EADC_SCTL6_TRGDLYDIV_Pos) /*!< EADC_T::SCTL6: TRGDLYDIV Mask */ - -#define EADC_SCTL6_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL6: TRGDLYCNT Position */ -#define EADC_SCTL6_TRGDLYCNT_Msk (0xfful << EADC_SCTL6_TRGDLYCNT_Pos) /*!< EADC_T::SCTL6: TRGDLYCNT Mask */ - -#define EADC_SCTL6_TRGSEL_Pos (16) /*!< EADC_T::SCTL6: TRGSEL Position */ -#define EADC_SCTL6_TRGSEL_Msk (0x1ful << EADC_SCTL6_TRGSEL_Pos) /*!< EADC_T::SCTL6: TRGSEL Mask */ - -#define EADC_SCTL6_INTPOS_Pos (22) /*!< EADC_T::SCTL6: INTPOS Position */ -#define EADC_SCTL6_INTPOS_Msk (0x1ul << EADC_SCTL6_INTPOS_Pos) /*!< EADC_T::SCTL6: INTPOS Mask */ - -#define EADC_SCTL6_EXTSMPT_Pos (24) /*!< EADC_T::SCTL6: EXTSMPT Position */ -#define EADC_SCTL6_EXTSMPT_Msk (0xfful << EADC_SCTL6_EXTSMPT_Pos) /*!< EADC_T::SCTL6: EXTSMPT Mask */ - -#define EADC_SCTL7_CHSEL_Pos (0) /*!< EADC_T::SCTL7: CHSEL Position */ -#define EADC_SCTL7_CHSEL_Msk (0xful << EADC_SCTL7_CHSEL_Pos) /*!< EADC_T::SCTL7: CHSEL Mask */ - -#define EADC_SCTL7_EXTREN_Pos (4) /*!< EADC_T::SCTL7: EXTREN Position */ -#define EADC_SCTL7_EXTREN_Msk (0x1ul << EADC_SCTL7_EXTREN_Pos) /*!< EADC_T::SCTL7: EXTREN Mask */ - -#define EADC_SCTL7_EXTFEN_Pos (5) /*!< EADC_T::SCTL7: EXTFEN Position */ -#define EADC_SCTL7_EXTFEN_Msk (0x1ul << EADC_SCTL7_EXTFEN_Pos) /*!< EADC_T::SCTL7: EXTFEN Mask */ - -#define EADC_SCTL7_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL7: TRGDLYDIV Position */ -#define EADC_SCTL7_TRGDLYDIV_Msk (0x3ul << EADC_SCTL7_TRGDLYDIV_Pos) /*!< EADC_T::SCTL7: TRGDLYDIV Mask */ - -#define EADC_SCTL7_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL7: TRGDLYCNT Position */ -#define EADC_SCTL7_TRGDLYCNT_Msk (0xfful << EADC_SCTL7_TRGDLYCNT_Pos) /*!< EADC_T::SCTL7: TRGDLYCNT Mask */ - -#define EADC_SCTL7_TRGSEL_Pos (16) /*!< EADC_T::SCTL7: TRGSEL Position */ -#define EADC_SCTL7_TRGSEL_Msk (0x1ful << EADC_SCTL7_TRGSEL_Pos) /*!< EADC_T::SCTL7: TRGSEL Mask */ - -#define EADC_SCTL7_INTPOS_Pos (22) /*!< EADC_T::SCTL7: INTPOS Position */ -#define EADC_SCTL7_INTPOS_Msk (0x1ul << EADC_SCTL7_INTPOS_Pos) /*!< EADC_T::SCTL7: INTPOS Mask */ - -#define EADC_SCTL7_EXTSMPT_Pos (24) /*!< EADC_T::SCTL7: EXTSMPT Position */ -#define EADC_SCTL7_EXTSMPT_Msk (0xfful << EADC_SCTL7_EXTSMPT_Pos) /*!< EADC_T::SCTL7: EXTSMPT Mask */ - -#define EADC_SCTL8_CHSEL_Pos (0) /*!< EADC_T::SCTL8: CHSEL Position */ -#define EADC_SCTL8_CHSEL_Msk (0xful << EADC_SCTL8_CHSEL_Pos) /*!< EADC_T::SCTL8: CHSEL Mask */ - -#define EADC_SCTL8_EXTREN_Pos (4) /*!< EADC_T::SCTL8: EXTREN Position */ -#define EADC_SCTL8_EXTREN_Msk (0x1ul << EADC_SCTL8_EXTREN_Pos) /*!< EADC_T::SCTL8: EXTREN Mask */ - -#define EADC_SCTL8_EXTFEN_Pos (5) /*!< EADC_T::SCTL8: EXTFEN Position */ -#define EADC_SCTL8_EXTFEN_Msk (0x1ul << EADC_SCTL8_EXTFEN_Pos) /*!< EADC_T::SCTL8: EXTFEN Mask */ - -#define EADC_SCTL8_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL8: TRGDLYDIV Position */ -#define EADC_SCTL8_TRGDLYDIV_Msk (0x3ul << EADC_SCTL8_TRGDLYDIV_Pos) /*!< EADC_T::SCTL8: TRGDLYDIV Mask */ - -#define EADC_SCTL8_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL8: TRGDLYCNT Position */ -#define EADC_SCTL8_TRGDLYCNT_Msk (0xfful << EADC_SCTL8_TRGDLYCNT_Pos) /*!< EADC_T::SCTL8: TRGDLYCNT Mask */ - -#define EADC_SCTL8_TRGSEL_Pos (16) /*!< EADC_T::SCTL8: TRGSEL Position */ -#define EADC_SCTL8_TRGSEL_Msk (0x1ful << EADC_SCTL8_TRGSEL_Pos) /*!< EADC_T::SCTL8: TRGSEL Mask */ - -#define EADC_SCTL8_INTPOS_Pos (22) /*!< EADC_T::SCTL8: INTPOS Position */ -#define EADC_SCTL8_INTPOS_Msk (0x1ul << EADC_SCTL8_INTPOS_Pos) /*!< EADC_T::SCTL8: INTPOS Mask */ - -#define EADC_SCTL8_EXTSMPT_Pos (24) /*!< EADC_T::SCTL8: EXTSMPT Position */ -#define EADC_SCTL8_EXTSMPT_Msk (0xfful << EADC_SCTL8_EXTSMPT_Pos) /*!< EADC_T::SCTL8: EXTSMPT Mask */ - -#define EADC_SCTL9_CHSEL_Pos (0) /*!< EADC_T::SCTL9: CHSEL Position */ -#define EADC_SCTL9_CHSEL_Msk (0xful << EADC_SCTL9_CHSEL_Pos) /*!< EADC_T::SCTL9: CHSEL Mask */ - -#define EADC_SCTL9_EXTREN_Pos (4) /*!< EADC_T::SCTL9: EXTREN Position */ -#define EADC_SCTL9_EXTREN_Msk (0x1ul << EADC_SCTL9_EXTREN_Pos) /*!< EADC_T::SCTL9: EXTREN Mask */ - -#define EADC_SCTL9_EXTFEN_Pos (5) /*!< EADC_T::SCTL9: EXTFEN Position */ -#define EADC_SCTL9_EXTFEN_Msk (0x1ul << EADC_SCTL9_EXTFEN_Pos) /*!< EADC_T::SCTL9: EXTFEN Mask */ - -#define EADC_SCTL9_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL9: TRGDLYDIV Position */ -#define EADC_SCTL9_TRGDLYDIV_Msk (0x3ul << EADC_SCTL9_TRGDLYDIV_Pos) /*!< EADC_T::SCTL9: TRGDLYDIV Mask */ - -#define EADC_SCTL9_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL9: TRGDLYCNT Position */ -#define EADC_SCTL9_TRGDLYCNT_Msk (0xfful << EADC_SCTL9_TRGDLYCNT_Pos) /*!< EADC_T::SCTL9: TRGDLYCNT Mask */ - -#define EADC_SCTL9_TRGSEL_Pos (16) /*!< EADC_T::SCTL9: TRGSEL Position */ -#define EADC_SCTL9_TRGSEL_Msk (0x1ful << EADC_SCTL9_TRGSEL_Pos) /*!< EADC_T::SCTL9: TRGSEL Mask */ - -#define EADC_SCTL9_INTPOS_Pos (22) /*!< EADC_T::SCTL9: INTPOS Position */ -#define EADC_SCTL9_INTPOS_Msk (0x1ul << EADC_SCTL9_INTPOS_Pos) /*!< EADC_T::SCTL9: INTPOS Mask */ - -#define EADC_SCTL9_EXTSMPT_Pos (24) /*!< EADC_T::SCTL9: EXTSMPT Position */ -#define EADC_SCTL9_EXTSMPT_Msk (0xfful << EADC_SCTL9_EXTSMPT_Pos) /*!< EADC_T::SCTL9: EXTSMPT Mask */ - -#define EADC_SCTL10_CHSEL_Pos (0) /*!< EADC_T::SCTL10: CHSEL Position */ -#define EADC_SCTL10_CHSEL_Msk (0xful << EADC_SCTL10_CHSEL_Pos) /*!< EADC_T::SCTL10: CHSEL Mask */ - -#define EADC_SCTL10_EXTREN_Pos (4) /*!< EADC_T::SCTL10: EXTREN Position */ -#define EADC_SCTL10_EXTREN_Msk (0x1ul << EADC_SCTL10_EXTREN_Pos) /*!< EADC_T::SCTL10: EXTREN Mask */ - -#define EADC_SCTL10_EXTFEN_Pos (5) /*!< EADC_T::SCTL10: EXTFEN Position */ -#define EADC_SCTL10_EXTFEN_Msk (0x1ul << EADC_SCTL10_EXTFEN_Pos) /*!< EADC_T::SCTL10: EXTFEN Mask */ - -#define EADC_SCTL10_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL10: TRGDLYDIV Position */ -#define EADC_SCTL10_TRGDLYDIV_Msk (0x3ul << EADC_SCTL10_TRGDLYDIV_Pos) /*!< EADC_T::SCTL10: TRGDLYDIV Mask */ - -#define EADC_SCTL10_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL10: TRGDLYCNT Position */ -#define EADC_SCTL10_TRGDLYCNT_Msk (0xfful << EADC_SCTL10_TRGDLYCNT_Pos) /*!< EADC_T::SCTL10: TRGDLYCNT Mask */ - -#define EADC_SCTL10_TRGSEL_Pos (16) /*!< EADC_T::SCTL10: TRGSEL Position */ -#define EADC_SCTL10_TRGSEL_Msk (0x1ful << EADC_SCTL10_TRGSEL_Pos) /*!< EADC_T::SCTL10: TRGSEL Mask */ - -#define EADC_SCTL10_INTPOS_Pos (22) /*!< EADC_T::SCTL10: INTPOS Position */ -#define EADC_SCTL10_INTPOS_Msk (0x1ul << EADC_SCTL10_INTPOS_Pos) /*!< EADC_T::SCTL10: INTPOS Mask */ - -#define EADC_SCTL10_EXTSMPT_Pos (24) /*!< EADC_T::SCTL10: EXTSMPT Position */ -#define EADC_SCTL10_EXTSMPT_Msk (0xfful << EADC_SCTL10_EXTSMPT_Pos) /*!< EADC_T::SCTL10: EXTSMPT Mask */ - -#define EADC_SCTL11_CHSEL_Pos (0) /*!< EADC_T::SCTL11: CHSEL Position */ -#define EADC_SCTL11_CHSEL_Msk (0xful << EADC_SCTL11_CHSEL_Pos) /*!< EADC_T::SCTL11: CHSEL Mask */ - -#define EADC_SCTL11_EXTREN_Pos (4) /*!< EADC_T::SCTL11: EXTREN Position */ -#define EADC_SCTL11_EXTREN_Msk (0x1ul << EADC_SCTL11_EXTREN_Pos) /*!< EADC_T::SCTL11: EXTREN Mask */ - -#define EADC_SCTL11_EXTFEN_Pos (5) /*!< EADC_T::SCTL11: EXTFEN Position */ -#define EADC_SCTL11_EXTFEN_Msk (0x1ul << EADC_SCTL11_EXTFEN_Pos) /*!< EADC_T::SCTL11: EXTFEN Mask */ - -#define EADC_SCTL11_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL11: TRGDLYDIV Position */ -#define EADC_SCTL11_TRGDLYDIV_Msk (0x3ul << EADC_SCTL11_TRGDLYDIV_Pos) /*!< EADC_T::SCTL11: TRGDLYDIV Mask */ - -#define EADC_SCTL11_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL11: TRGDLYCNT Position */ -#define EADC_SCTL11_TRGDLYCNT_Msk (0xfful << EADC_SCTL11_TRGDLYCNT_Pos) /*!< EADC_T::SCTL11: TRGDLYCNT Mask */ - -#define EADC_SCTL11_TRGSEL_Pos (16) /*!< EADC_T::SCTL11: TRGSEL Position */ -#define EADC_SCTL11_TRGSEL_Msk (0x1ful << EADC_SCTL11_TRGSEL_Pos) /*!< EADC_T::SCTL11: TRGSEL Mask */ - -#define EADC_SCTL11_INTPOS_Pos (22) /*!< EADC_T::SCTL11: INTPOS Position */ -#define EADC_SCTL11_INTPOS_Msk (0x1ul << EADC_SCTL11_INTPOS_Pos) /*!< EADC_T::SCTL11: INTPOS Mask */ - -#define EADC_SCTL11_EXTSMPT_Pos (24) /*!< EADC_T::SCTL11: EXTSMPT Position */ -#define EADC_SCTL11_EXTSMPT_Msk (0xfful << EADC_SCTL11_EXTSMPT_Pos) /*!< EADC_T::SCTL11: EXTSMPT Mask */ - -#define EADC_SCTL12_CHSEL_Pos (0) /*!< EADC_T::SCTL12: CHSEL Position */ -#define EADC_SCTL12_CHSEL_Msk (0xful << EADC_SCTL12_CHSEL_Pos) /*!< EADC_T::SCTL12: CHSEL Mask */ - -#define EADC_SCTL12_EXTREN_Pos (4) /*!< EADC_T::SCTL12: EXTREN Position */ -#define EADC_SCTL12_EXTREN_Msk (0x1ul << EADC_SCTL12_EXTREN_Pos) /*!< EADC_T::SCTL12: EXTREN Mask */ - -#define EADC_SCTL12_EXTFEN_Pos (5) /*!< EADC_T::SCTL12: EXTFEN Position */ -#define EADC_SCTL12_EXTFEN_Msk (0x1ul << EADC_SCTL12_EXTFEN_Pos) /*!< EADC_T::SCTL12: EXTFEN Mask */ - -#define EADC_SCTL12_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL12: TRGDLYDIV Position */ -#define EADC_SCTL12_TRGDLYDIV_Msk (0x3ul << EADC_SCTL12_TRGDLYDIV_Pos) /*!< EADC_T::SCTL12: TRGDLYDIV Mask */ - -#define EADC_SCTL12_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL12: TRGDLYCNT Position */ -#define EADC_SCTL12_TRGDLYCNT_Msk (0xfful << EADC_SCTL12_TRGDLYCNT_Pos) /*!< EADC_T::SCTL12: TRGDLYCNT Mask */ - -#define EADC_SCTL12_TRGSEL_Pos (16) /*!< EADC_T::SCTL12: TRGSEL Position */ -#define EADC_SCTL12_TRGSEL_Msk (0x1ful << EADC_SCTL12_TRGSEL_Pos) /*!< EADC_T::SCTL12: TRGSEL Mask */ - -#define EADC_SCTL12_INTPOS_Pos (22) /*!< EADC_T::SCTL12: INTPOS Position */ -#define EADC_SCTL12_INTPOS_Msk (0x1ul << EADC_SCTL12_INTPOS_Pos) /*!< EADC_T::SCTL12: INTPOS Mask */ - -#define EADC_SCTL12_EXTSMPT_Pos (24) /*!< EADC_T::SCTL12: EXTSMPT Position */ -#define EADC_SCTL12_EXTSMPT_Msk (0xfful << EADC_SCTL12_EXTSMPT_Pos) /*!< EADC_T::SCTL12: EXTSMPT Mask */ - -#define EADC_SCTL13_CHSEL_Pos (0) /*!< EADC_T::SCTL13: CHSEL Position */ -#define EADC_SCTL13_CHSEL_Msk (0xful << EADC_SCTL13_CHSEL_Pos) /*!< EADC_T::SCTL13: CHSEL Mask */ - -#define EADC_SCTL13_EXTREN_Pos (4) /*!< EADC_T::SCTL13: EXTREN Position */ -#define EADC_SCTL13_EXTREN_Msk (0x1ul << EADC_SCTL13_EXTREN_Pos) /*!< EADC_T::SCTL13: EXTREN Mask */ - -#define EADC_SCTL13_EXTFEN_Pos (5) /*!< EADC_T::SCTL13: EXTFEN Position */ -#define EADC_SCTL13_EXTFEN_Msk (0x1ul << EADC_SCTL13_EXTFEN_Pos) /*!< EADC_T::SCTL13: EXTFEN Mask */ - -#define EADC_SCTL13_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL13: TRGDLYDIV Position */ -#define EADC_SCTL13_TRGDLYDIV_Msk (0x3ul << EADC_SCTL13_TRGDLYDIV_Pos) /*!< EADC_T::SCTL13: TRGDLYDIV Mask */ - -#define EADC_SCTL13_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL13: TRGDLYCNT Position */ -#define EADC_SCTL13_TRGDLYCNT_Msk (0xfful << EADC_SCTL13_TRGDLYCNT_Pos) /*!< EADC_T::SCTL13: TRGDLYCNT Mask */ - -#define EADC_SCTL13_TRGSEL_Pos (16) /*!< EADC_T::SCTL13: TRGSEL Position */ -#define EADC_SCTL13_TRGSEL_Msk (0x1ful << EADC_SCTL13_TRGSEL_Pos) /*!< EADC_T::SCTL13: TRGSEL Mask */ - -#define EADC_SCTL13_INTPOS_Pos (22) /*!< EADC_T::SCTL13: INTPOS Position */ -#define EADC_SCTL13_INTPOS_Msk (0x1ul << EADC_SCTL13_INTPOS_Pos) /*!< EADC_T::SCTL13: INTPOS Mask */ - -#define EADC_SCTL13_EXTSMPT_Pos (24) /*!< EADC_T::SCTL13: EXTSMPT Position */ -#define EADC_SCTL13_EXTSMPT_Msk (0xfful << EADC_SCTL13_EXTSMPT_Pos) /*!< EADC_T::SCTL13: EXTSMPT Mask */ - -#define EADC_SCTL14_CHSEL_Pos (0) /*!< EADC_T::SCTL14: CHSEL Position */ -#define EADC_SCTL14_CHSEL_Msk (0xful << EADC_SCTL14_CHSEL_Pos) /*!< EADC_T::SCTL14: CHSEL Mask */ - -#define EADC_SCTL14_EXTREN_Pos (4) /*!< EADC_T::SCTL14: EXTREN Position */ -#define EADC_SCTL14_EXTREN_Msk (0x1ul << EADC_SCTL14_EXTREN_Pos) /*!< EADC_T::SCTL14: EXTREN Mask */ - -#define EADC_SCTL14_EXTFEN_Pos (5) /*!< EADC_T::SCTL14: EXTFEN Position */ -#define EADC_SCTL14_EXTFEN_Msk (0x1ul << EADC_SCTL14_EXTFEN_Pos) /*!< EADC_T::SCTL14: EXTFEN Mask */ - -#define EADC_SCTL14_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL14: TRGDLYDIV Position */ -#define EADC_SCTL14_TRGDLYDIV_Msk (0x3ul << EADC_SCTL14_TRGDLYDIV_Pos) /*!< EADC_T::SCTL14: TRGDLYDIV Mask */ - -#define EADC_SCTL14_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL14: TRGDLYCNT Position */ -#define EADC_SCTL14_TRGDLYCNT_Msk (0xfful << EADC_SCTL14_TRGDLYCNT_Pos) /*!< EADC_T::SCTL14: TRGDLYCNT Mask */ - -#define EADC_SCTL14_TRGSEL_Pos (16) /*!< EADC_T::SCTL14: TRGSEL Position */ -#define EADC_SCTL14_TRGSEL_Msk (0x1ful << EADC_SCTL14_TRGSEL_Pos) /*!< EADC_T::SCTL14: TRGSEL Mask */ - -#define EADC_SCTL14_INTPOS_Pos (22) /*!< EADC_T::SCTL14: INTPOS Position */ -#define EADC_SCTL14_INTPOS_Msk (0x1ul << EADC_SCTL14_INTPOS_Pos) /*!< EADC_T::SCTL14: INTPOS Mask */ - -#define EADC_SCTL14_EXTSMPT_Pos (24) /*!< EADC_T::SCTL14: EXTSMPT Position */ -#define EADC_SCTL14_EXTSMPT_Msk (0xfful << EADC_SCTL14_EXTSMPT_Pos) /*!< EADC_T::SCTL14: EXTSMPT Mask */ - -#define EADC_SCTL15_CHSEL_Pos (0) /*!< EADC_T::SCTL15: CHSEL Position */ -#define EADC_SCTL15_CHSEL_Msk (0xful << EADC_SCTL15_CHSEL_Pos) /*!< EADC_T::SCTL15: CHSEL Mask */ - -#define EADC_SCTL15_EXTREN_Pos (4) /*!< EADC_T::SCTL15: EXTREN Position */ -#define EADC_SCTL15_EXTREN_Msk (0x1ul << EADC_SCTL15_EXTREN_Pos) /*!< EADC_T::SCTL15: EXTREN Mask */ - -#define EADC_SCTL15_EXTFEN_Pos (5) /*!< EADC_T::SCTL15: EXTFEN Position */ -#define EADC_SCTL15_EXTFEN_Msk (0x1ul << EADC_SCTL15_EXTFEN_Pos) /*!< EADC_T::SCTL15: EXTFEN Mask */ - -#define EADC_SCTL15_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL15: TRGDLYDIV Position */ -#define EADC_SCTL15_TRGDLYDIV_Msk (0x3ul << EADC_SCTL15_TRGDLYDIV_Pos) /*!< EADC_T::SCTL15: TRGDLYDIV Mask */ - -#define EADC_SCTL15_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL15: TRGDLYCNT Position */ -#define EADC_SCTL15_TRGDLYCNT_Msk (0xfful << EADC_SCTL15_TRGDLYCNT_Pos) /*!< EADC_T::SCTL15: TRGDLYCNT Mask */ - -#define EADC_SCTL15_TRGSEL_Pos (16) /*!< EADC_T::SCTL15: TRGSEL Position */ -#define EADC_SCTL15_TRGSEL_Msk (0x1ful << EADC_SCTL15_TRGSEL_Pos) /*!< EADC_T::SCTL15: TRGSEL Mask */ - -#define EADC_SCTL15_INTPOS_Pos (22) /*!< EADC_T::SCTL15: INTPOS Position */ -#define EADC_SCTL15_INTPOS_Msk (0x1ul << EADC_SCTL15_INTPOS_Pos) /*!< EADC_T::SCTL15: INTPOS Mask */ - -#define EADC_SCTL15_EXTSMPT_Pos (24) /*!< EADC_T::SCTL15: EXTSMPT Position */ -#define EADC_SCTL15_EXTSMPT_Msk (0xfful << EADC_SCTL15_EXTSMPT_Pos) /*!< EADC_T::SCTL15: EXTSMPT Mask */ - -#define EADC_SCTL16_EXTSMPT_Pos (24) /*!< EADC_T::SCTL16: EXTSMPT Position */ -#define EADC_SCTL16_EXTSMPT_Msk (0xfful << EADC_SCTL16_EXTSMPT_Pos) /*!< EADC_T::SCTL16: EXTSMPT Mask */ - -#define EADC_SCTL17_EXTSMPT_Pos (24) /*!< EADC_T::SCTL17: EXTSMPT Position */ -#define EADC_SCTL17_EXTSMPT_Msk (0xfful << EADC_SCTL17_EXTSMPT_Pos) /*!< EADC_T::SCTL17: EXTSMPT Mask */ - -#define EADC_SCTL18_EXTSMPT_Pos (24) /*!< EADC_T::SCTL18: EXTSMPT Position */ -#define EADC_SCTL18_EXTSMPT_Msk (0xfful << EADC_SCTL18_EXTSMPT_Pos) /*!< EADC_T::SCTL18: EXTSMPT Mask */ - -#define EADC_INTSRC0_SPLIE0_Pos (0) /*!< EADC_T::INTSRC0: SPLIE0 Position */ -#define EADC_INTSRC0_SPLIE0_Msk (0x1ul << EADC_INTSRC0_SPLIE0_Pos) /*!< EADC_T::INTSRC0: SPLIE0 Mask */ - -#define EADC_INTSRC0_SPLIE1_Pos (1) /*!< EADC_T::INTSRC0: SPLIE1 Position */ -#define EADC_INTSRC0_SPLIE1_Msk (0x1ul << EADC_INTSRC0_SPLIE1_Pos) /*!< EADC_T::INTSRC0: SPLIE1 Mask */ - -#define EADC_INTSRC0_SPLIE2_Pos (2) /*!< EADC_T::INTSRC0: SPLIE2 Position */ -#define EADC_INTSRC0_SPLIE2_Msk (0x1ul << EADC_INTSRC0_SPLIE2_Pos) /*!< EADC_T::INTSRC0: SPLIE2 Mask */ - -#define EADC_INTSRC0_SPLIE3_Pos (3) /*!< EADC_T::INTSRC0: SPLIE3 Position */ -#define EADC_INTSRC0_SPLIE3_Msk (0x1ul << EADC_INTSRC0_SPLIE3_Pos) /*!< EADC_T::INTSRC0: SPLIE3 Mask */ - -#define EADC_INTSRC0_SPLIE4_Pos (4) /*!< EADC_T::INTSRC0: SPLIE4 Position */ -#define EADC_INTSRC0_SPLIE4_Msk (0x1ul << EADC_INTSRC0_SPLIE4_Pos) /*!< EADC_T::INTSRC0: SPLIE4 Mask */ - -#define EADC_INTSRC0_SPLIE5_Pos (5) /*!< EADC_T::INTSRC0: SPLIE5 Position */ -#define EADC_INTSRC0_SPLIE5_Msk (0x1ul << EADC_INTSRC0_SPLIE5_Pos) /*!< EADC_T::INTSRC0: SPLIE5 Mask */ - -#define EADC_INTSRC0_SPLIE6_Pos (6) /*!< EADC_T::INTSRC0: SPLIE6 Position */ -#define EADC_INTSRC0_SPLIE6_Msk (0x1ul << EADC_INTSRC0_SPLIE6_Pos) /*!< EADC_T::INTSRC0: SPLIE6 Mask */ - -#define EADC_INTSRC0_SPLIE7_Pos (7) /*!< EADC_T::INTSRC0: SPLIE7 Position */ -#define EADC_INTSRC0_SPLIE7_Msk (0x1ul << EADC_INTSRC0_SPLIE7_Pos) /*!< EADC_T::INTSRC0: SPLIE7 Mask */ - -#define EADC_INTSRC0_SPLIE8_Pos (8) /*!< EADC_T::INTSRC0: SPLIE8 Position */ -#define EADC_INTSRC0_SPLIE8_Msk (0x1ul << EADC_INTSRC0_SPLIE8_Pos) /*!< EADC_T::INTSRC0: SPLIE8 Mask */ - -#define EADC_INTSRC0_SPLIE9_Pos (9) /*!< EADC_T::INTSRC0: SPLIE9 Position */ -#define EADC_INTSRC0_SPLIE9_Msk (0x1ul << EADC_INTSRC0_SPLIE9_Pos) /*!< EADC_T::INTSRC0: SPLIE9 Mask */ - -#define EADC_INTSRC0_SPLIE10_Pos (10) /*!< EADC_T::INTSRC0: SPLIE10 Position */ -#define EADC_INTSRC0_SPLIE10_Msk (0x1ul << EADC_INTSRC0_SPLIE10_Pos) /*!< EADC_T::INTSRC0: SPLIE10 Mask */ - -#define EADC_INTSRC0_SPLIE11_Pos (11) /*!< EADC_T::INTSRC0: SPLIE11 Position */ -#define EADC_INTSRC0_SPLIE11_Msk (0x1ul << EADC_INTSRC0_SPLIE11_Pos) /*!< EADC_T::INTSRC0: SPLIE11 Mask */ - -#define EADC_INTSRC0_SPLIE12_Pos (12) /*!< EADC_T::INTSRC0: SPLIE12 Position */ -#define EADC_INTSRC0_SPLIE12_Msk (0x1ul << EADC_INTSRC0_SPLIE12_Pos) /*!< EADC_T::INTSRC0: SPLIE12 Mask */ - -#define EADC_INTSRC0_SPLIE13_Pos (13) /*!< EADC_T::INTSRC0: SPLIE13 Position */ -#define EADC_INTSRC0_SPLIE13_Msk (0x1ul << EADC_INTSRC0_SPLIE13_Pos) /*!< EADC_T::INTSRC0: SPLIE13 Mask */ - -#define EADC_INTSRC0_SPLIE14_Pos (14) /*!< EADC_T::INTSRC0: SPLIE14 Position */ -#define EADC_INTSRC0_SPLIE14_Msk (0x1ul << EADC_INTSRC0_SPLIE14_Pos) /*!< EADC_T::INTSRC0: SPLIE14 Mask */ - -#define EADC_INTSRC0_SPLIE15_Pos (15) /*!< EADC_T::INTSRC0: SPLIE15 Position */ -#define EADC_INTSRC0_SPLIE15_Msk (0x1ul << EADC_INTSRC0_SPLIE15_Pos) /*!< EADC_T::INTSRC0: SPLIE15 Mask */ - -#define EADC_INTSRC0_SPLIE16_Pos (16) /*!< EADC_T::INTSRC0: SPLIE16 Position */ -#define EADC_INTSRC0_SPLIE16_Msk (0x1ul << EADC_INTSRC0_SPLIE16_Pos) /*!< EADC_T::INTSRC0: SPLIE16 Mask */ - -#define EADC_INTSRC0_SPLIE17_Pos (17) /*!< EADC_T::INTSRC0: SPLIE17 Position */ -#define EADC_INTSRC0_SPLIE17_Msk (0x1ul << EADC_INTSRC0_SPLIE17_Pos) /*!< EADC_T::INTSRC0: SPLIE17 Mask */ - -#define EADC_INTSRC0_SPLIE18_Pos (18) /*!< EADC_T::INTSRC0: SPLIE18 Position */ -#define EADC_INTSRC0_SPLIE18_Msk (0x1ul << EADC_INTSRC0_SPLIE18_Pos) /*!< EADC_T::INTSRC0: SPLIE18 Mask */ - -#define EADC_INTSRC1_SPLIE0_Pos (0) /*!< EADC_T::INTSRC1: SPLIE0 Position */ -#define EADC_INTSRC1_SPLIE0_Msk (0x1ul << EADC_INTSRC1_SPLIE0_Pos) /*!< EADC_T::INTSRC1: SPLIE0 Mask */ - -#define EADC_INTSRC1_SPLIE1_Pos (1) /*!< EADC_T::INTSRC1: SPLIE1 Position */ -#define EADC_INTSRC1_SPLIE1_Msk (0x1ul << EADC_INTSRC1_SPLIE1_Pos) /*!< EADC_T::INTSRC1: SPLIE1 Mask */ - -#define EADC_INTSRC1_SPLIE2_Pos (2) /*!< EADC_T::INTSRC1: SPLIE2 Position */ -#define EADC_INTSRC1_SPLIE2_Msk (0x1ul << EADC_INTSRC1_SPLIE2_Pos) /*!< EADC_T::INTSRC1: SPLIE2 Mask */ - -#define EADC_INTSRC1_SPLIE3_Pos (3) /*!< EADC_T::INTSRC1: SPLIE3 Position */ -#define EADC_INTSRC1_SPLIE3_Msk (0x1ul << EADC_INTSRC1_SPLIE3_Pos) /*!< EADC_T::INTSRC1: SPLIE3 Mask */ - -#define EADC_INTSRC1_SPLIE4_Pos (4) /*!< EADC_T::INTSRC1: SPLIE4 Position */ -#define EADC_INTSRC1_SPLIE4_Msk (0x1ul << EADC_INTSRC1_SPLIE4_Pos) /*!< EADC_T::INTSRC1: SPLIE4 Mask */ - -#define EADC_INTSRC1_SPLIE5_Pos (5) /*!< EADC_T::INTSRC1: SPLIE5 Position */ -#define EADC_INTSRC1_SPLIE5_Msk (0x1ul << EADC_INTSRC1_SPLIE5_Pos) /*!< EADC_T::INTSRC1: SPLIE5 Mask */ - -#define EADC_INTSRC1_SPLIE6_Pos (6) /*!< EADC_T::INTSRC1: SPLIE6 Position */ -#define EADC_INTSRC1_SPLIE6_Msk (0x1ul << EADC_INTSRC1_SPLIE6_Pos) /*!< EADC_T::INTSRC1: SPLIE6 Mask */ - -#define EADC_INTSRC1_SPLIE7_Pos (7) /*!< EADC_T::INTSRC1: SPLIE7 Position */ -#define EADC_INTSRC1_SPLIE7_Msk (0x1ul << EADC_INTSRC1_SPLIE7_Pos) /*!< EADC_T::INTSRC1: SPLIE7 Mask */ - -#define EADC_INTSRC1_SPLIE8_Pos (8) /*!< EADC_T::INTSRC1: SPLIE8 Position */ -#define EADC_INTSRC1_SPLIE8_Msk (0x1ul << EADC_INTSRC1_SPLIE8_Pos) /*!< EADC_T::INTSRC1: SPLIE8 Mask */ - -#define EADC_INTSRC1_SPLIE9_Pos (9) /*!< EADC_T::INTSRC1: SPLIE9 Position */ -#define EADC_INTSRC1_SPLIE9_Msk (0x1ul << EADC_INTSRC1_SPLIE9_Pos) /*!< EADC_T::INTSRC1: SPLIE9 Mask */ - -#define EADC_INTSRC1_SPLIE10_Pos (10) /*!< EADC_T::INTSRC1: SPLIE10 Position */ -#define EADC_INTSRC1_SPLIE10_Msk (0x1ul << EADC_INTSRC1_SPLIE10_Pos) /*!< EADC_T::INTSRC1: SPLIE10 Mask */ - -#define EADC_INTSRC1_SPLIE11_Pos (11) /*!< EADC_T::INTSRC1: SPLIE11 Position */ -#define EADC_INTSRC1_SPLIE11_Msk (0x1ul << EADC_INTSRC1_SPLIE11_Pos) /*!< EADC_T::INTSRC1: SPLIE11 Mask */ - -#define EADC_INTSRC1_SPLIE12_Pos (12) /*!< EADC_T::INTSRC1: SPLIE12 Position */ -#define EADC_INTSRC1_SPLIE12_Msk (0x1ul << EADC_INTSRC1_SPLIE12_Pos) /*!< EADC_T::INTSRC1: SPLIE12 Mask */ - -#define EADC_INTSRC1_SPLIE13_Pos (13) /*!< EADC_T::INTSRC1: SPLIE13 Position */ -#define EADC_INTSRC1_SPLIE13_Msk (0x1ul << EADC_INTSRC1_SPLIE13_Pos) /*!< EADC_T::INTSRC1: SPLIE13 Mask */ - -#define EADC_INTSRC1_SPLIE14_Pos (14) /*!< EADC_T::INTSRC1: SPLIE14 Position */ -#define EADC_INTSRC1_SPLIE14_Msk (0x1ul << EADC_INTSRC1_SPLIE14_Pos) /*!< EADC_T::INTSRC1: SPLIE14 Mask */ - -#define EADC_INTSRC1_SPLIE15_Pos (15) /*!< EADC_T::INTSRC1: SPLIE15 Position */ -#define EADC_INTSRC1_SPLIE15_Msk (0x1ul << EADC_INTSRC1_SPLIE15_Pos) /*!< EADC_T::INTSRC1: SPLIE15 Mask */ - -#define EADC_INTSRC1_SPLIE16_Pos (16) /*!< EADC_T::INTSRC1: SPLIE16 Position */ -#define EADC_INTSRC1_SPLIE16_Msk (0x1ul << EADC_INTSRC1_SPLIE16_Pos) /*!< EADC_T::INTSRC1: SPLIE16 Mask */ - -#define EADC_INTSRC1_SPLIE17_Pos (17) /*!< EADC_T::INTSRC1: SPLIE17 Position */ -#define EADC_INTSRC1_SPLIE17_Msk (0x1ul << EADC_INTSRC1_SPLIE17_Pos) /*!< EADC_T::INTSRC1: SPLIE17 Mask */ - -#define EADC_INTSRC1_SPLIE18_Pos (18) /*!< EADC_T::INTSRC1: SPLIE18 Position */ -#define EADC_INTSRC1_SPLIE18_Msk (0x1ul << EADC_INTSRC1_SPLIE18_Pos) /*!< EADC_T::INTSRC1: SPLIE18 Mask */ - -#define EADC_INTSRC2_SPLIE0_Pos (0) /*!< EADC_T::INTSRC2: SPLIE0 Position */ -#define EADC_INTSRC2_SPLIE0_Msk (0x1ul << EADC_INTSRC2_SPLIE0_Pos) /*!< EADC_T::INTSRC2: SPLIE0 Mask */ - -#define EADC_INTSRC2_SPLIE1_Pos (1) /*!< EADC_T::INTSRC2: SPLIE1 Position */ -#define EADC_INTSRC2_SPLIE1_Msk (0x1ul << EADC_INTSRC2_SPLIE1_Pos) /*!< EADC_T::INTSRC2: SPLIE1 Mask */ - -#define EADC_INTSRC2_SPLIE2_Pos (2) /*!< EADC_T::INTSRC2: SPLIE2 Position */ -#define EADC_INTSRC2_SPLIE2_Msk (0x1ul << EADC_INTSRC2_SPLIE2_Pos) /*!< EADC_T::INTSRC2: SPLIE2 Mask */ - -#define EADC_INTSRC2_SPLIE3_Pos (3) /*!< EADC_T::INTSRC2: SPLIE3 Position */ -#define EADC_INTSRC2_SPLIE3_Msk (0x1ul << EADC_INTSRC2_SPLIE3_Pos) /*!< EADC_T::INTSRC2: SPLIE3 Mask */ - -#define EADC_INTSRC2_SPLIE4_Pos (4) /*!< EADC_T::INTSRC2: SPLIE4 Position */ -#define EADC_INTSRC2_SPLIE4_Msk (0x1ul << EADC_INTSRC2_SPLIE4_Pos) /*!< EADC_T::INTSRC2: SPLIE4 Mask */ - -#define EADC_INTSRC2_SPLIE5_Pos (5) /*!< EADC_T::INTSRC2: SPLIE5 Position */ -#define EADC_INTSRC2_SPLIE5_Msk (0x1ul << EADC_INTSRC2_SPLIE5_Pos) /*!< EADC_T::INTSRC2: SPLIE5 Mask */ - -#define EADC_INTSRC2_SPLIE6_Pos (6) /*!< EADC_T::INTSRC2: SPLIE6 Position */ -#define EADC_INTSRC2_SPLIE6_Msk (0x1ul << EADC_INTSRC2_SPLIE6_Pos) /*!< EADC_T::INTSRC2: SPLIE6 Mask */ - -#define EADC_INTSRC2_SPLIE7_Pos (7) /*!< EADC_T::INTSRC2: SPLIE7 Position */ -#define EADC_INTSRC2_SPLIE7_Msk (0x1ul << EADC_INTSRC2_SPLIE7_Pos) /*!< EADC_T::INTSRC2: SPLIE7 Mask */ - -#define EADC_INTSRC2_SPLIE8_Pos (8) /*!< EADC_T::INTSRC2: SPLIE8 Position */ -#define EADC_INTSRC2_SPLIE8_Msk (0x1ul << EADC_INTSRC2_SPLIE8_Pos) /*!< EADC_T::INTSRC2: SPLIE8 Mask */ - -#define EADC_INTSRC2_SPLIE9_Pos (9) /*!< EADC_T::INTSRC2: SPLIE9 Position */ -#define EADC_INTSRC2_SPLIE9_Msk (0x1ul << EADC_INTSRC2_SPLIE9_Pos) /*!< EADC_T::INTSRC2: SPLIE9 Mask */ - -#define EADC_INTSRC2_SPLIE10_Pos (10) /*!< EADC_T::INTSRC2: SPLIE10 Position */ -#define EADC_INTSRC2_SPLIE10_Msk (0x1ul << EADC_INTSRC2_SPLIE10_Pos) /*!< EADC_T::INTSRC2: SPLIE10 Mask */ - -#define EADC_INTSRC2_SPLIE11_Pos (11) /*!< EADC_T::INTSRC2: SPLIE11 Position */ -#define EADC_INTSRC2_SPLIE11_Msk (0x1ul << EADC_INTSRC2_SPLIE11_Pos) /*!< EADC_T::INTSRC2: SPLIE11 Mask */ - -#define EADC_INTSRC2_SPLIE12_Pos (12) /*!< EADC_T::INTSRC2: SPLIE12 Position */ -#define EADC_INTSRC2_SPLIE12_Msk (0x1ul << EADC_INTSRC2_SPLIE12_Pos) /*!< EADC_T::INTSRC2: SPLIE12 Mask */ - -#define EADC_INTSRC2_SPLIE13_Pos (13) /*!< EADC_T::INTSRC2: SPLIE13 Position */ -#define EADC_INTSRC2_SPLIE13_Msk (0x1ul << EADC_INTSRC2_SPLIE13_Pos) /*!< EADC_T::INTSRC2: SPLIE13 Mask */ - -#define EADC_INTSRC2_SPLIE14_Pos (14) /*!< EADC_T::INTSRC2: SPLIE14 Position */ -#define EADC_INTSRC2_SPLIE14_Msk (0x1ul << EADC_INTSRC2_SPLIE14_Pos) /*!< EADC_T::INTSRC2: SPLIE14 Mask */ - -#define EADC_INTSRC2_SPLIE15_Pos (15) /*!< EADC_T::INTSRC2: SPLIE15 Position */ -#define EADC_INTSRC2_SPLIE15_Msk (0x1ul << EADC_INTSRC2_SPLIE15_Pos) /*!< EADC_T::INTSRC2: SPLIE15 Mask */ - -#define EADC_INTSRC2_SPLIE16_Pos (16) /*!< EADC_T::INTSRC2: SPLIE16 Position */ -#define EADC_INTSRC2_SPLIE16_Msk (0x1ul << EADC_INTSRC2_SPLIE16_Pos) /*!< EADC_T::INTSRC2: SPLIE16 Mask */ - -#define EADC_INTSRC2_SPLIE17_Pos (17) /*!< EADC_T::INTSRC2: SPLIE17 Position */ -#define EADC_INTSRC2_SPLIE17_Msk (0x1ul << EADC_INTSRC2_SPLIE17_Pos) /*!< EADC_T::INTSRC2: SPLIE17 Mask */ - -#define EADC_INTSRC2_SPLIE18_Pos (18) /*!< EADC_T::INTSRC2: SPLIE18 Position */ -#define EADC_INTSRC2_SPLIE18_Msk (0x1ul << EADC_INTSRC2_SPLIE18_Pos) /*!< EADC_T::INTSRC2: SPLIE18 Mask */ - -#define EADC_INTSRC3_SPLIE0_Pos (0) /*!< EADC_T::INTSRC3: SPLIE0 Position */ -#define EADC_INTSRC3_SPLIE0_Msk (0x1ul << EADC_INTSRC3_SPLIE0_Pos) /*!< EADC_T::INTSRC3: SPLIE0 Mask */ - -#define EADC_INTSRC3_SPLIE1_Pos (1) /*!< EADC_T::INTSRC3: SPLIE1 Position */ -#define EADC_INTSRC3_SPLIE1_Msk (0x1ul << EADC_INTSRC3_SPLIE1_Pos) /*!< EADC_T::INTSRC3: SPLIE1 Mask */ - -#define EADC_INTSRC3_SPLIE2_Pos (2) /*!< EADC_T::INTSRC3: SPLIE2 Position */ -#define EADC_INTSRC3_SPLIE2_Msk (0x1ul << EADC_INTSRC3_SPLIE2_Pos) /*!< EADC_T::INTSRC3: SPLIE2 Mask */ - -#define EADC_INTSRC3_SPLIE3_Pos (3) /*!< EADC_T::INTSRC3: SPLIE3 Position */ -#define EADC_INTSRC3_SPLIE3_Msk (0x1ul << EADC_INTSRC3_SPLIE3_Pos) /*!< EADC_T::INTSRC3: SPLIE3 Mask */ - -#define EADC_INTSRC3_SPLIE4_Pos (4) /*!< EADC_T::INTSRC3: SPLIE4 Position */ -#define EADC_INTSRC3_SPLIE4_Msk (0x1ul << EADC_INTSRC3_SPLIE4_Pos) /*!< EADC_T::INTSRC3: SPLIE4 Mask */ - -#define EADC_INTSRC3_SPLIE5_Pos (5) /*!< EADC_T::INTSRC3: SPLIE5 Position */ -#define EADC_INTSRC3_SPLIE5_Msk (0x1ul << EADC_INTSRC3_SPLIE5_Pos) /*!< EADC_T::INTSRC3: SPLIE5 Mask */ - -#define EADC_INTSRC3_SPLIE6_Pos (6) /*!< EADC_T::INTSRC3: SPLIE6 Position */ -#define EADC_INTSRC3_SPLIE6_Msk (0x1ul << EADC_INTSRC3_SPLIE6_Pos) /*!< EADC_T::INTSRC3: SPLIE6 Mask */ - -#define EADC_INTSRC3_SPLIE7_Pos (7) /*!< EADC_T::INTSRC3: SPLIE7 Position */ -#define EADC_INTSRC3_SPLIE7_Msk (0x1ul << EADC_INTSRC3_SPLIE7_Pos) /*!< EADC_T::INTSRC3: SPLIE7 Mask */ - -#define EADC_INTSRC3_SPLIE8_Pos (8) /*!< EADC_T::INTSRC3: SPLIE8 Position */ -#define EADC_INTSRC3_SPLIE8_Msk (0x1ul << EADC_INTSRC3_SPLIE8_Pos) /*!< EADC_T::INTSRC3: SPLIE8 Mask */ - -#define EADC_INTSRC3_SPLIE9_Pos (9) /*!< EADC_T::INTSRC3: SPLIE9 Position */ -#define EADC_INTSRC3_SPLIE9_Msk (0x1ul << EADC_INTSRC3_SPLIE9_Pos) /*!< EADC_T::INTSRC3: SPLIE9 Mask */ - -#define EADC_INTSRC3_SPLIE10_Pos (10) /*!< EADC_T::INTSRC3: SPLIE10 Position */ -#define EADC_INTSRC3_SPLIE10_Msk (0x1ul << EADC_INTSRC3_SPLIE10_Pos) /*!< EADC_T::INTSRC3: SPLIE10 Mask */ - -#define EADC_INTSRC3_SPLIE11_Pos (11) /*!< EADC_T::INTSRC3: SPLIE11 Position */ -#define EADC_INTSRC3_SPLIE11_Msk (0x1ul << EADC_INTSRC3_SPLIE11_Pos) /*!< EADC_T::INTSRC3: SPLIE11 Mask */ - -#define EADC_INTSRC3_SPLIE12_Pos (12) /*!< EADC_T::INTSRC3: SPLIE12 Position */ -#define EADC_INTSRC3_SPLIE12_Msk (0x1ul << EADC_INTSRC3_SPLIE12_Pos) /*!< EADC_T::INTSRC3: SPLIE12 Mask */ - -#define EADC_INTSRC3_SPLIE13_Pos (13) /*!< EADC_T::INTSRC3: SPLIE13 Position */ -#define EADC_INTSRC3_SPLIE13_Msk (0x1ul << EADC_INTSRC3_SPLIE13_Pos) /*!< EADC_T::INTSRC3: SPLIE13 Mask */ - -#define EADC_INTSRC3_SPLIE14_Pos (14) /*!< EADC_T::INTSRC3: SPLIE14 Position */ -#define EADC_INTSRC3_SPLIE14_Msk (0x1ul << EADC_INTSRC3_SPLIE14_Pos) /*!< EADC_T::INTSRC3: SPLIE14 Mask */ - -#define EADC_INTSRC3_SPLIE15_Pos (15) /*!< EADC_T::INTSRC3: SPLIE15 Position */ -#define EADC_INTSRC3_SPLIE15_Msk (0x1ul << EADC_INTSRC3_SPLIE15_Pos) /*!< EADC_T::INTSRC3: SPLIE15 Mask */ - -#define EADC_INTSRC3_SPLIE16_Pos (16) /*!< EADC_T::INTSRC3: SPLIE16 Position */ -#define EADC_INTSRC3_SPLIE16_Msk (0x1ul << EADC_INTSRC3_SPLIE16_Pos) /*!< EADC_T::INTSRC3: SPLIE16 Mask */ - -#define EADC_INTSRC3_SPLIE17_Pos (17) /*!< EADC_T::INTSRC3: SPLIE17 Position */ -#define EADC_INTSRC3_SPLIE17_Msk (0x1ul << EADC_INTSRC3_SPLIE17_Pos) /*!< EADC_T::INTSRC3: SPLIE17 Mask */ - -#define EADC_INTSRC3_SPLIE18_Pos (18) /*!< EADC_T::INTSRC3: SPLIE18 Position */ -#define EADC_INTSRC3_SPLIE18_Msk (0x1ul << EADC_INTSRC3_SPLIE18_Pos) /*!< EADC_T::INTSRC3: SPLIE18 Mask */ - -#define EADC_CMP_ADCMPEN_Pos (0) /*!< EADC_T::CMP: ADCMPEN Position */ -#define EADC_CMP_ADCMPEN_Msk (0x1ul << EADC_CMP_ADCMPEN_Pos) /*!< EADC_T::CMP: ADCMPEN Mask */ - -#define EADC_CMP_ADCMPIE_Pos (1) /*!< EADC_T::CMP: ADCMPIE Position */ -#define EADC_CMP_ADCMPIE_Msk (0x1ul << EADC_CMP_ADCMPIE_Pos) /*!< EADC_T::CMP: ADCMPIE Mask */ - -#define EADC_CMP_CMPCOND_Pos (2) /*!< EADC_T::CMP: CMPCOND Position */ -#define EADC_CMP_CMPCOND_Msk (0x1ul << EADC_CMP_CMPCOND_Pos) /*!< EADC_T::CMP: CMPCOND Mask */ - -#define EADC_CMP_CMPSPL_Pos (3) /*!< EADC_T::CMP: CMPSPL Position */ -#define EADC_CMP_CMPSPL_Msk (0x1ful << EADC_CMP_CMPSPL_Pos) /*!< EADC_T::CMP: CMPSPL Mask */ - -#define EADC_CMP_CMPMCNT_Pos (8) /*!< EADC_T::CMP: CMPMCNT Position */ -#define EADC_CMP_CMPMCNT_Msk (0xful << EADC_CMP_CMPMCNT_Pos) /*!< EADC_T::CMP: CMPMCNT Mask */ - -#define EADC_CMP_CMPWEN_Pos (15) /*!< EADC_T::CMP: CMPWEN Position */ -#define EADC_CMP_CMPWEN_Msk (0x1ul << EADC_CMP_CMPWEN_Pos) /*!< EADC_T::CMP: CMPWEN Mask */ - -#define EADC_CMP_CMPDAT_Pos (16) /*!< EADC_T::CMP: CMPDAT Position */ -#define EADC_CMP_CMPDAT_Msk (0xffful << EADC_CMP_CMPDAT_Pos) /*!< EADC_T::CMP: CMPDAT Mask */ - -#define EADC_CMP0_ADCMPEN_Pos (0) /*!< EADC_T::CMP0: ADCMPEN Position */ -#define EADC_CMP0_ADCMPEN_Msk (0x1ul << EADC_CMP0_ADCMPEN_Pos) /*!< EADC_T::CMP0: ADCMPEN Mask */ - -#define EADC_CMP0_ADCMPIE_Pos (1) /*!< EADC_T::CMP0: ADCMPIE Position */ -#define EADC_CMP0_ADCMPIE_Msk (0x1ul << EADC_CMP0_ADCMPIE_Pos) /*!< EADC_T::CMP0: ADCMPIE Mask */ - -#define EADC_CMP0_CMPCOND_Pos (2) /*!< EADC_T::CMP0: CMPCOND Position */ -#define EADC_CMP0_CMPCOND_Msk (0x1ul << EADC_CMP0_CMPCOND_Pos) /*!< EADC_T::CMP0: CMPCOND Mask */ - -#define EADC_CMP0_CMPSPL_Pos (3) /*!< EADC_T::CMP0: CMPSPL Position */ -#define EADC_CMP0_CMPSPL_Msk (0x1ful << EADC_CMP0_CMPSPL_Pos) /*!< EADC_T::CMP0: CMPSPL Mask */ - -#define EADC_CMP0_CMPMCNT_Pos (8) /*!< EADC_T::CMP0: CMPMCNT Position */ -#define EADC_CMP0_CMPMCNT_Msk (0xful << EADC_CMP0_CMPMCNT_Pos) /*!< EADC_T::CMP0: CMPMCNT Mask */ - -#define EADC_CMP0_CMPWEN_Pos (15) /*!< EADC_T::CMP0: CMPWEN Position */ -#define EADC_CMP0_CMPWEN_Msk (0x1ul << EADC_CMP0_CMPWEN_Pos) /*!< EADC_T::CMP0: CMPWEN Mask */ - -#define EADC_CMP0_CMPDAT_Pos (16) /*!< EADC_T::CMP0: CMPDAT Position */ -#define EADC_CMP0_CMPDAT_Msk (0xffful << EADC_CMP0_CMPDAT_Pos) /*!< EADC_T::CMP0: CMPDAT Mask */ - -#define EADC_CMP1_ADCMPEN_Pos (0) /*!< EADC_T::CMP1: ADCMPEN Position */ -#define EADC_CMP1_ADCMPEN_Msk (0x1ul << EADC_CMP1_ADCMPEN_Pos) /*!< EADC_T::CMP1: ADCMPEN Mask */ - -#define EADC_CMP1_ADCMPIE_Pos (1) /*!< EADC_T::CMP1: ADCMPIE Position */ -#define EADC_CMP1_ADCMPIE_Msk (0x1ul << EADC_CMP1_ADCMPIE_Pos) /*!< EADC_T::CMP1: ADCMPIE Mask */ - -#define EADC_CMP1_CMPCOND_Pos (2) /*!< EADC_T::CMP1: CMPCOND Position */ -#define EADC_CMP1_CMPCOND_Msk (0x1ul << EADC_CMP1_CMPCOND_Pos) /*!< EADC_T::CMP1: CMPCOND Mask */ - -#define EADC_CMP1_CMPSPL_Pos (3) /*!< EADC_T::CMP1: CMPSPL Position */ -#define EADC_CMP1_CMPSPL_Msk (0x1ful << EADC_CMP1_CMPSPL_Pos) /*!< EADC_T::CMP1: CMPSPL Mask */ - -#define EADC_CMP1_CMPMCNT_Pos (8) /*!< EADC_T::CMP1: CMPMCNT Position */ -#define EADC_CMP1_CMPMCNT_Msk (0xful << EADC_CMP1_CMPMCNT_Pos) /*!< EADC_T::CMP1: CMPMCNT Mask */ - -#define EADC_CMP1_CMPWEN_Pos (15) /*!< EADC_T::CMP1: CMPWEN Position */ -#define EADC_CMP1_CMPWEN_Msk (0x1ul << EADC_CMP1_CMPWEN_Pos) /*!< EADC_T::CMP1: CMPWEN Mask */ - -#define EADC_CMP1_CMPDAT_Pos (16) /*!< EADC_T::CMP1: CMPDAT Position */ -#define EADC_CMP1_CMPDAT_Msk (0xffful << EADC_CMP1_CMPDAT_Pos) /*!< EADC_T::CMP1: CMPDAT Mask */ - -#define EADC_CMP2_ADCMPEN_Pos (0) /*!< EADC_T::CMP2: ADCMPEN Position */ -#define EADC_CMP2_ADCMPEN_Msk (0x1ul << EADC_CMP2_ADCMPEN_Pos) /*!< EADC_T::CMP2: ADCMPEN Mask */ - -#define EADC_CMP2_ADCMPIE_Pos (1) /*!< EADC_T::CMP2: ADCMPIE Position */ -#define EADC_CMP2_ADCMPIE_Msk (0x1ul << EADC_CMP2_ADCMPIE_Pos) /*!< EADC_T::CMP2: ADCMPIE Mask */ - -#define EADC_CMP2_CMPCOND_Pos (2) /*!< EADC_T::CMP2: CMPCOND Position */ -#define EADC_CMP2_CMPCOND_Msk (0x1ul << EADC_CMP2_CMPCOND_Pos) /*!< EADC_T::CMP2: CMPCOND Mask */ - -#define EADC_CMP2_CMPSPL_Pos (3) /*!< EADC_T::CMP2: CMPSPL Position */ -#define EADC_CMP2_CMPSPL_Msk (0x1ful << EADC_CMP2_CMPSPL_Pos) /*!< EADC_T::CMP2: CMPSPL Mask */ - -#define EADC_CMP2_CMPMCNT_Pos (8) /*!< EADC_T::CMP2: CMPMCNT Position */ -#define EADC_CMP2_CMPMCNT_Msk (0xful << EADC_CMP2_CMPMCNT_Pos) /*!< EADC_T::CMP2: CMPMCNT Mask */ - -#define EADC_CMP2_CMPWEN_Pos (15) /*!< EADC_T::CMP2: CMPWEN Position */ -#define EADC_CMP2_CMPWEN_Msk (0x1ul << EADC_CMP2_CMPWEN_Pos) /*!< EADC_T::CMP2: CMPWEN Mask */ - -#define EADC_CMP2_CMPDAT_Pos (16) /*!< EADC_T::CMP2: CMPDAT Position */ -#define EADC_CMP2_CMPDAT_Msk (0xffful << EADC_CMP2_CMPDAT_Pos) /*!< EADC_T::CMP2: CMPDAT Mask */ - -#define EADC_CMP3_ADCMPEN_Pos (0) /*!< EADC_T::CMP3: ADCMPEN Position */ -#define EADC_CMP3_ADCMPEN_Msk (0x1ul << EADC_CMP3_ADCMPEN_Pos) /*!< EADC_T::CMP3: ADCMPEN Mask */ - -#define EADC_CMP3_ADCMPIE_Pos (1) /*!< EADC_T::CMP3: ADCMPIE Position */ -#define EADC_CMP3_ADCMPIE_Msk (0x1ul << EADC_CMP3_ADCMPIE_Pos) /*!< EADC_T::CMP3: ADCMPIE Mask */ - -#define EADC_CMP3_CMPCOND_Pos (2) /*!< EADC_T::CMP3: CMPCOND Position */ -#define EADC_CMP3_CMPCOND_Msk (0x1ul << EADC_CMP3_CMPCOND_Pos) /*!< EADC_T::CMP3: CMPCOND Mask */ - -#define EADC_CMP3_CMPSPL_Pos (3) /*!< EADC_T::CMP3: CMPSPL Position */ -#define EADC_CMP3_CMPSPL_Msk (0x1ful << EADC_CMP3_CMPSPL_Pos) /*!< EADC_T::CMP3: CMPSPL Mask */ - -#define EADC_CMP3_CMPMCNT_Pos (8) /*!< EADC_T::CMP3: CMPMCNT Position */ -#define EADC_CMP3_CMPMCNT_Msk (0xful << EADC_CMP3_CMPMCNT_Pos) /*!< EADC_T::CMP3: CMPMCNT Mask */ - -#define EADC_CMP3_CMPWEN_Pos (15) /*!< EADC_T::CMP3: CMPWEN Position */ -#define EADC_CMP3_CMPWEN_Msk (0x1ul << EADC_CMP3_CMPWEN_Pos) /*!< EADC_T::CMP3: CMPWEN Mask */ - -#define EADC_CMP3_CMPDAT_Pos (16) /*!< EADC_T::CMP3: CMPDAT Position */ -#define EADC_CMP3_CMPDAT_Msk (0xffful << EADC_CMP3_CMPDAT_Pos) /*!< EADC_T::CMP3: CMPDAT Mask */ - -#define EADC_STATUS0_VALID_Pos (0) /*!< EADC_T::STATUS0: VALID Position */ -#define EADC_STATUS0_VALID_Msk (0xfffful << EADC_STATUS0_VALID_Pos) /*!< EADC_T::STATUS0: VALID Mask */ - -#define EADC_STATUS0_OV_Pos (16) /*!< EADC_T::STATUS0: OV Position */ -#define EADC_STATUS0_OV_Msk (0xfffful << EADC_STATUS0_OV_Pos) /*!< EADC_T::STATUS0: OV Mask */ - -#define EADC_STATUS1_VALID_Pos (0) /*!< EADC_T::STATUS1: VALID Position */ -#define EADC_STATUS1_VALID_Msk (0x7ul << EADC_STATUS1_VALID_Pos) /*!< EADC_T::STATUS1: VALID Mask */ - -#define EADC_STATUS1_OV_Pos (16) /*!< EADC_T::STATUS1: OV Position */ -#define EADC_STATUS1_OV_Msk (0x7ul << EADC_STATUS1_OV_Pos) /*!< EADC_T::STATUS1: OV Mask */ - -#define EADC_STATUS2_ADIF0_Pos (0) /*!< EADC_T::STATUS2: ADIF0 Position */ -#define EADC_STATUS2_ADIF0_Msk (0x1ul << EADC_STATUS2_ADIF0_Pos) /*!< EADC_T::STATUS2: ADIF0 Mask */ - -#define EADC_STATUS2_ADIF1_Pos (1) /*!< EADC_T::STATUS2: ADIF1 Position */ -#define EADC_STATUS2_ADIF1_Msk (0x1ul << EADC_STATUS2_ADIF1_Pos) /*!< EADC_T::STATUS2: ADIF1 Mask */ - -#define EADC_STATUS2_ADIF2_Pos (2) /*!< EADC_T::STATUS2: ADIF2 Position */ -#define EADC_STATUS2_ADIF2_Msk (0x1ul << EADC_STATUS2_ADIF2_Pos) /*!< EADC_T::STATUS2: ADIF2 Mask */ - -#define EADC_STATUS2_ADIF3_Pos (3) /*!< EADC_T::STATUS2: ADIF3 Position */ -#define EADC_STATUS2_ADIF3_Msk (0x1ul << EADC_STATUS2_ADIF3_Pos) /*!< EADC_T::STATUS2: ADIF3 Mask */ - -#define EADC_STATUS2_ADCMPF0_Pos (4) /*!< EADC_T::STATUS2: ADCMPF0 Position */ -#define EADC_STATUS2_ADCMPF0_Msk (0x1ul << EADC_STATUS2_ADCMPF0_Pos) /*!< EADC_T::STATUS2: ADCMPF0 Mask */ - -#define EADC_STATUS2_ADCMPF1_Pos (5) /*!< EADC_T::STATUS2: ADCMPF1 Position */ -#define EADC_STATUS2_ADCMPF1_Msk (0x1ul << EADC_STATUS2_ADCMPF1_Pos) /*!< EADC_T::STATUS2: ADCMPF1 Mask */ - -#define EADC_STATUS2_ADCMPF2_Pos (6) /*!< EADC_T::STATUS2: ADCMPF2 Position */ -#define EADC_STATUS2_ADCMPF2_Msk (0x1ul << EADC_STATUS2_ADCMPF2_Pos) /*!< EADC_T::STATUS2: ADCMPF2 Mask */ - -#define EADC_STATUS2_ADCMPF3_Pos (7) /*!< EADC_T::STATUS2: ADCMPF3 Position */ -#define EADC_STATUS2_ADCMPF3_Msk (0x1ul << EADC_STATUS2_ADCMPF3_Pos) /*!< EADC_T::STATUS2: ADCMPF3 Mask */ - -#define EADC_STATUS2_ADOVIF0_Pos (8) /*!< EADC_T::STATUS2: ADOVIF0 Position */ -#define EADC_STATUS2_ADOVIF0_Msk (0x1ul << EADC_STATUS2_ADOVIF0_Pos) /*!< EADC_T::STATUS2: ADOVIF0 Mask */ - -#define EADC_STATUS2_ADOVIF1_Pos (9) /*!< EADC_T::STATUS2: ADOVIF1 Position */ -#define EADC_STATUS2_ADOVIF1_Msk (0x1ul << EADC_STATUS2_ADOVIF1_Pos) /*!< EADC_T::STATUS2: ADOVIF1 Mask */ - -#define EADC_STATUS2_ADOVIF2_Pos (10) /*!< EADC_T::STATUS2: ADOVIF2 Position */ -#define EADC_STATUS2_ADOVIF2_Msk (0x1ul << EADC_STATUS2_ADOVIF2_Pos) /*!< EADC_T::STATUS2: ADOVIF2 Mask */ - -#define EADC_STATUS2_ADOVIF3_Pos (11) /*!< EADC_T::STATUS2: ADOVIF3 Position */ -#define EADC_STATUS2_ADOVIF3_Msk (0x1ul << EADC_STATUS2_ADOVIF3_Pos) /*!< EADC_T::STATUS2: ADOVIF3 Mask */ - -#define EADC_STATUS2_ADCMPO0_Pos (12) /*!< EADC_T::STATUS2: ADCMPO0 Position */ -#define EADC_STATUS2_ADCMPO0_Msk (0x1ul << EADC_STATUS2_ADCMPO0_Pos) /*!< EADC_T::STATUS2: ADCMPO0 Mask */ - -#define EADC_STATUS2_ADCMPO1_Pos (13) /*!< EADC_T::STATUS2: ADCMPO1 Position */ -#define EADC_STATUS2_ADCMPO1_Msk (0x1ul << EADC_STATUS2_ADCMPO1_Pos) /*!< EADC_T::STATUS2: ADCMPO1 Mask */ - -#define EADC_STATUS2_ADCMPO2_Pos (14) /*!< EADC_T::STATUS2: ADCMPO2 Position */ -#define EADC_STATUS2_ADCMPO2_Msk (0x1ul << EADC_STATUS2_ADCMPO2_Pos) /*!< EADC_T::STATUS2: ADCMPO2 Mask */ - -#define EADC_STATUS2_ADCMPO3_Pos (15) /*!< EADC_T::STATUS2: ADCMPO3 Position */ -#define EADC_STATUS2_ADCMPO3_Msk (0x1ul << EADC_STATUS2_ADCMPO3_Pos) /*!< EADC_T::STATUS2: ADCMPO3 Mask */ - -#define EADC_STATUS2_CHANNEL_Pos (16) /*!< EADC_T::STATUS2: CHANNEL Position */ -#define EADC_STATUS2_CHANNEL_Msk (0x1ful << EADC_STATUS2_CHANNEL_Pos) /*!< EADC_T::STATUS2: CHANNEL Mask */ - -#define EADC_STATUS2_BUSY_Pos (23) /*!< EADC_T::STATUS2: BUSY Position */ -#define EADC_STATUS2_BUSY_Msk (0x1ul << EADC_STATUS2_BUSY_Pos) /*!< EADC_T::STATUS2: BUSY Mask */ - -#define EADC_STATUS2_ADOVIF_Pos (24) /*!< EADC_T::STATUS2: ADOVIF Position */ -#define EADC_STATUS2_ADOVIF_Msk (0x1ul << EADC_STATUS2_ADOVIF_Pos) /*!< EADC_T::STATUS2: ADOVIF Mask */ - -#define EADC_STATUS2_STOVF_Pos (25) /*!< EADC_T::STATUS2: STOVF Position */ -#define EADC_STATUS2_STOVF_Msk (0x1ul << EADC_STATUS2_STOVF_Pos) /*!< EADC_T::STATUS2: STOVF Mask */ - -#define EADC_STATUS2_AVALID_Pos (26) /*!< EADC_T::STATUS2: AVALID Position */ -#define EADC_STATUS2_AVALID_Msk (0x1ul << EADC_STATUS2_AVALID_Pos) /*!< EADC_T::STATUS2: AVALID Mask */ - -#define EADC_STATUS2_AOV_Pos (27) /*!< EADC_T::STATUS2: AOV Position */ -#define EADC_STATUS2_AOV_Msk (0x1ul << EADC_STATUS2_AOV_Pos) /*!< EADC_T::STATUS2: AOV Mask */ - -#define EADC_STATUS3_CURSPL_Pos (0) /*!< EADC_T::STATUS3: CURSPL Position */ -#define EADC_STATUS3_CURSPL_Msk (0x1ful << EADC_STATUS3_CURSPL_Pos) /*!< EADC_T::STATUS3: CURSPL Mask */ - -#define EADC_DDAT0_RESULT_Pos (0) /*!< EADC_T::DDAT0: RESULT Position */ -#define EADC_DDAT0_RESULT_Msk (0xfffful << EADC_DDAT0_RESULT_Pos) /*!< EADC_T::DDAT0: RESULT Mask */ - -#define EADC_DDAT0_OV_Pos (16) /*!< EADC_T::DDAT0: OV Position */ -#define EADC_DDAT0_OV_Msk (0x1ul << EADC_DDAT0_OV_Pos) /*!< EADC_T::DDAT0: OV Mask */ - -#define EADC_DDAT0_VALID_Pos (17) /*!< EADC_T::DDAT0: VALID Position */ -#define EADC_DDAT0_VALID_Msk (0x1ul << EADC_DDAT0_VALID_Pos) /*!< EADC_T::DDAT0: VALID Mask */ - -#define EADC_DDAT1_RESULT_Pos (0) /*!< EADC_T::DDAT1: RESULT Position */ -#define EADC_DDAT1_RESULT_Msk (0xfffful << EADC_DDAT1_RESULT_Pos) /*!< EADC_T::DDAT1: RESULT Mask */ - -#define EADC_DDAT1_OV_Pos (16) /*!< EADC_T::DDAT1: OV Position */ -#define EADC_DDAT1_OV_Msk (0x1ul << EADC_DDAT1_OV_Pos) /*!< EADC_T::DDAT1: OV Mask */ - -#define EADC_DDAT1_VALID_Pos (17) /*!< EADC_T::DDAT1: VALID Position */ -#define EADC_DDAT1_VALID_Msk (0x1ul << EADC_DDAT1_VALID_Pos) /*!< EADC_T::DDAT1: VALID Mask */ - -#define EADC_DDAT2_RESULT_Pos (0) /*!< EADC_T::DDAT2: RESULT Position */ -#define EADC_DDAT2_RESULT_Msk (0xfffful << EADC_DDAT2_RESULT_Pos) /*!< EADC_T::DDAT2: RESULT Mask */ - -#define EADC_DDAT2_OV_Pos (16) /*!< EADC_T::DDAT2: OV Position */ -#define EADC_DDAT2_OV_Msk (0x1ul << EADC_DDAT2_OV_Pos) /*!< EADC_T::DDAT2: OV Mask */ - -#define EADC_DDAT2_VALID_Pos (17) /*!< EADC_T::DDAT2: VALID Position */ -#define EADC_DDAT2_VALID_Msk (0x1ul << EADC_DDAT2_VALID_Pos) /*!< EADC_T::DDAT2: VALID Mask */ - -#define EADC_DDAT3_RESULT_Pos (0) /*!< EADC_T::DDAT3: RESULT Position */ -#define EADC_DDAT3_RESULT_Msk (0xfffful << EADC_DDAT3_RESULT_Pos) /*!< EADC_T::DDAT3: RESULT Mask */ - -#define EADC_DDAT3_OV_Pos (16) /*!< EADC_T::DDAT3: OV Position */ -#define EADC_DDAT3_OV_Msk (0x1ul << EADC_DDAT3_OV_Pos) /*!< EADC_T::DDAT3: OV Mask */ - -#define EADC_DDAT3_VALID_Pos (17) /*!< EADC_T::DDAT3: VALID Position */ -#define EADC_DDAT3_VALID_Msk (0x1ul << EADC_DDAT3_VALID_Pos) /*!< EADC_T::DDAT3: VALID Mask */ - -#define EADC_PWRM_PWUPRDY_Pos (0) /*!< EADC_T::PWRM: PWUPRDY Position */ -#define EADC_PWRM_PWUPRDY_Msk (0x1ul << EADC_PWRM_PWUPRDY_Pos) /*!< EADC_T::PWRM: PWUPRDY Mask */ - -#define EADC_PWRM_PWUCALEN_Pos (1) /*!< EADC_T::PWRM: PWUCALEN Position */ -#define EADC_PWRM_PWUCALEN_Msk (0x1ul << EADC_PWRM_PWUCALEN_Pos) /*!< EADC_T::PWRM: PWUCALEN Mask */ - -#define EADC_PWRM_PWDMOD_Pos (2) /*!< EADC_T::PWRM: PWDMOD Position */ -#define EADC_PWRM_PWDMOD_Msk (0x3ul << EADC_PWRM_PWDMOD_Pos) /*!< EADC_T::PWRM: PWDMOD Mask */ - -#define EADC_PWRM_LDOSUT_Pos (8) /*!< EADC_T::PWRM: LDOSUT Position */ -#define EADC_PWRM_LDOSUT_Msk (0xffful << EADC_PWRM_LDOSUT_Pos) /*!< EADC_T::PWRM: LDOSUT Mask */ - -#define EADC_CALCTL_CALSTART_Pos (1) /*!< EADC_T::CALCTL: CALSTART Position */ -#define EADC_CALCTL_CALSTART_Msk (0x1ul << EADC_CALCTL_CALSTART_Pos) /*!< EADC_T::CALCTL: CALSTART Mask */ - -#define EADC_CALCTL_CALDONE_Pos (2) /*!< EADC_T::CALCTL: CALDONE Position */ -#define EADC_CALCTL_CALDONE_Msk (0x1ul << EADC_CALCTL_CALDONE_Pos) /*!< EADC_T::CALCTL: CALDONE Mask */ - -#define EADC_CALCTL_CALSEL_Pos (3) /*!< EADC_T::CALCTL: CALSEL Position */ -#define EADC_CALCTL_CALSEL_Msk (0x1ul << EADC_CALCTL_CALSEL_Pos) /*!< EADC_T::CALCTL: CALSEL Mask */ - -#define EADC_CALDWRD_CALWORD_Pos (0) /*!< EADC_T::CALDWRD: CALWORD Position */ -#define EADC_CALDWRD_CALWORD_Msk (0x7ful << EADC_CALDWRD_CALWORD_Pos) /*!< EADC_T::CALDWRD: CALWORD Mask */ - -/**@}*/ /* EADC_CONST */ -/**@}*/ /* end of EADC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __EADC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ebi_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ebi_reg.h deleted file mode 100644 index 9a48d3c286d..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ebi_reg.h +++ /dev/null @@ -1,429 +0,0 @@ -/**************************************************************************//** - * @file ebi_reg.h - * @version V1.00 - * @brief EBI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EBI_REG_H__ -#define __EBI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller -@{ */ - -typedef struct -{ - - - /** - * @var EBI_T::CTL0 - * Offset: 0x00 External Bus Interface Bank0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separating Mode Enable Bit - * | | |0 = Address/Data Bus Separating Mode Disabled. - * | | |1 = Address/Data Bus Separating Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When con tenuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register - * @var EBI_T::TCTL0 - * Offset: 0x04 External Bus Interface Bank0 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC define data access time (tACC). - * | | |tACC = (TACC +1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD define data access hold time (tAHD). - * | | |tAHD = (TAHD +1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - * @var EBI_T::CTL1 - * Offset: 0x10 External Bus Interface Bank1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separating Mode Enable Bit - * | | |0 = Address/Data Bus Separating Mode Disabled. - * | | |1 = Address/Data Bus Separating Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When con tenuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register - * @var EBI_T::TCTL1 - * Offset: 0x14 External Bus Interface Bank1 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC define data access time (tACC). - * | | |tACC = (TACC +1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD define data access hold time (tAHD). - * | | |tAHD = (TAHD +1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - * @var EBI_T::CTL2 - * Offset: 0x20 External Bus Interface Bank2 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separating Mode Enable Bit - * | | |0 = Address/Data Bus Separating Mode Disabled. - * | | |1 = Address/Data Bus Separating Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When con tenuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register - * @var EBI_T::TCTL2 - * Offset: 0x24 External Bus Interface Bank2 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC define data access time (tACC). - * | | |tACC = (TACC +1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD define data access hold time (tAHD). - * | | |tAHD = (TAHD +1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled. - * | | |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - */ - __IO uint32_t CTL0; /*!< [0x0000] External Bus Interface Bank0 Control Register */ - __IO uint32_t TCTL0; /*!< [0x0004] External Bus Interface Bank0 Timing Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL1; /*!< [0x0010] External Bus Interface Bank1 Control Register */ - __IO uint32_t TCTL1; /*!< [0x0014] External Bus Interface Bank1 Timing Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL2; /*!< [0x0020] External Bus Interface Bank2 Control Register */ - __IO uint32_t TCTL2; /*!< [0x0024] External Bus Interface Bank2 Timing Control Register */ - -} EBI_T; - -/** - @addtogroup EBI_CONST EBI Bit Field Definition - Constant Definitions for EBI Controller -@{ */ - -#define EBI_CTL_EN_Pos (0) /*!< EBI_T::CTL: EN Position */ -#define EBI_CTL_EN_Msk (0x1ul << EBI_CTL_EN_Pos) /*!< EBI_T::CTL: EN Mask */ - -#define EBI_CTL_DW16_Pos (1) /*!< EBI_T::CTL: DW16 Position */ -#define EBI_CTL_DW16_Msk (0x1ul << EBI_CTL_DW16_Pos) /*!< EBI_T::CTL: DW16 Mask */ - -#define EBI_CTL_CSPOLINV_Pos (2) /*!< EBI_T::CTL: CSPOLINV Position */ -#define EBI_CTL_CSPOLINV_Msk (0x1ul << EBI_CTL_CSPOLINV_Pos) /*!< EBI_T::CTL: CSPOLINV Mask */ - -#define EBI_CTL_ADSEPEN_Pos (3) /*!< EBI_T::CTL: ADSEPEN Position */ -#define EBI_CTL_ADSEPEN_Msk (0x1ul << EBI_CTL_ADSEPEN_Pos) /*!< EBI_T::CTL: ADSEPEN Mask */ - -#define EBI_CTL_CACCESS_Pos (4) /*!< EBI_T::CTL: CACCESS Position */ -#define EBI_CTL_CACCESS_Msk (0x1ul << EBI_CTL_CACCESS_Pos) /*!< EBI_T::CTL: CACCESS Mask */ - -#define EBI_CTL_MCLKDIV_Pos (8) /*!< EBI_T::CTL: MCLKDIV Position */ -#define EBI_CTL_MCLKDIV_Msk (0x7ul << EBI_CTL_MCLKDIV_Pos) /*!< EBI_T::CTL: MCLKDIV Mask */ - -#define EBI_CTL_TALE_Pos (16) /*!< EBI_T::CTL: TALE Position */ -#define EBI_CTL_TALE_Msk (0x7ul << EBI_CTL_TALE_Pos) /*!< EBI_T::CTL: TALE Mask */ - -#define EBI_CTL_WBUFEN_Pos (24) /*!< EBI_T::CTL: WBUFEN Position */ -#define EBI_CTL_WBUFEN_Msk (0x1ul << EBI_CTL_WBUFEN_Pos) /*!< EBI_T::CTL: WBUFEN Mask */ - -#define EBI_TCTL_TACC_Pos (3) /*!< EBI_T::TCTL: TACC Position */ -#define EBI_TCTL_TACC_Msk (0x1ful << EBI_TCTL_TACC_Pos) /*!< EBI_T::TCTL: TACC Mask */ - -#define EBI_TCTL_TAHD_Pos (8) /*!< EBI_T::TCTL: TAHD Position */ -#define EBI_TCTL_TAHD_Msk (0x7ul << EBI_TCTL_TAHD_Pos) /*!< EBI_T::TCTL: TAHD Mask */ - -#define EBI_TCTL_W2X_Pos (12) /*!< EBI_T::TCTL: W2X Position */ -#define EBI_TCTL_W2X_Msk (0xful << EBI_TCTL_W2X_Pos) /*!< EBI_T::TCTL: W2X Mask */ - -#define EBI_TCTL_RAHDOFF_Pos (22) /*!< EBI_T::TCTL: RAHDOFF Position */ -#define EBI_TCTL_RAHDOFF_Msk (0x1ul << EBI_TCTL_RAHDOFF_Pos) /*!< EBI_T::TCTL: RAHDOFF Mask */ - -#define EBI_TCTL_WAHDOFF_Pos (23) /*!< EBI_T::TCTL: WAHDOFF Position */ -#define EBI_TCTL_WAHDOFF_Msk (0x1ul << EBI_TCTL_WAHDOFF_Pos) /*!< EBI_T::TCTL: WAHDOFF Mask */ - -#define EBI_TCTL_R2R_Pos (24) /*!< EBI_T::TCTL: R2R Position */ -#define EBI_TCTL_R2R_Msk (0xful << EBI_TCTL_R2R_Pos) /*!< EBI_T::TCTL: R2R Mask */ - -#define EBI_CTL0_EN_Pos (0) /*!< EBI_T::CTL0: EN Position */ -#define EBI_CTL0_EN_Msk (0x1ul << EBI_CTL0_EN_Pos) /*!< EBI_T::CTL0: EN Mask */ - -#define EBI_CTL0_DW16_Pos (1) /*!< EBI_T::CTL0: DW16 Position */ -#define EBI_CTL0_DW16_Msk (0x1ul << EBI_CTL0_DW16_Pos) /*!< EBI_T::CTL0: DW16 Mask */ - -#define EBI_CTL0_CSPOLINV_Pos (2) /*!< EBI_T::CTL0: CSPOLINV Position */ -#define EBI_CTL0_CSPOLINV_Msk (0x1ul << EBI_CTL0_CSPOLINV_Pos) /*!< EBI_T::CTL0: CSPOLINV Mask */ - -#define EBI_CTL0_ADSEPEN_Pos (3) /*!< EBI_T::CTL0: ADSEPEN Position */ -#define EBI_CTL0_ADSEPEN_Msk (0x1ul << EBI_CTL0_ADSEPEN_Pos) /*!< EBI_T::CTL0: ADSEPEN Mask */ - -#define EBI_CTL0_CACCESS_Pos (4) /*!< EBI_T::CTL0: CACCESS Position */ -#define EBI_CTL0_CACCESS_Msk (0x1ul << EBI_CTL0_CACCESS_Pos) /*!< EBI_T::CTL0: CACCESS Mask */ - -#define EBI_CTL0_MCLKDIV_Pos (8) /*!< EBI_T::CTL0: MCLKDIV Position */ -#define EBI_CTL0_MCLKDIV_Msk (0x7ul << EBI_CTL0_MCLKDIV_Pos) /*!< EBI_T::CTL0: MCLKDIV Mask */ - -#define EBI_CTL0_TALE_Pos (16) /*!< EBI_T::CTL0: TALE Position */ -#define EBI_CTL0_TALE_Msk (0x7ul << EBI_CTL0_TALE_Pos) /*!< EBI_T::CTL0: TALE Mask */ - -#define EBI_CTL0_WBUFEN_Pos (24) /*!< EBI_T::CTL0: WBUFEN Position */ -#define EBI_CTL0_WBUFEN_Msk (0x1ul << EBI_CTL0_WBUFEN_Pos) /*!< EBI_T::CTL0: WBUFEN Mask */ - -#define EBI_TCTL0_TACC_Pos (3) /*!< EBI_T::TCTL0: TACC Position */ -#define EBI_TCTL0_TACC_Msk (0x1ful << EBI_TCTL0_TACC_Pos) /*!< EBI_T::TCTL0: TACC Mask */ - -#define EBI_TCTL0_TAHD_Pos (8) /*!< EBI_T::TCTL0: TAHD Position */ -#define EBI_TCTL0_TAHD_Msk (0x7ul << EBI_TCTL0_TAHD_Pos) /*!< EBI_T::TCTL0: TAHD Mask */ - -#define EBI_TCTL0_W2X_Pos (12) /*!< EBI_T::TCTL0: W2X Position */ -#define EBI_TCTL0_W2X_Msk (0xful << EBI_TCTL0_W2X_Pos) /*!< EBI_T::TCTL0: W2X Mask */ - -#define EBI_TCTL0_RAHDOFF_Pos (22) /*!< EBI_T::TCTL0: RAHDOFF Position */ -#define EBI_TCTL0_RAHDOFF_Msk (0x1ul << EBI_TCTL0_RAHDOFF_Pos) /*!< EBI_T::TCTL0: RAHDOFF Mask */ - -#define EBI_TCTL0_WAHDOFF_Pos (23) /*!< EBI_T::TCTL0: WAHDOFF Position */ -#define EBI_TCTL0_WAHDOFF_Msk (0x1ul << EBI_TCTL0_WAHDOFF_Pos) /*!< EBI_T::TCTL0: WAHDOFF Mask */ - -#define EBI_TCTL0_R2R_Pos (24) /*!< EBI_T::TCTL0: R2R Position */ -#define EBI_TCTL0_R2R_Msk (0xful << EBI_TCTL0_R2R_Pos) /*!< EBI_T::TCTL0: R2R Mask */ - -#define EBI_CTL1_EN_Pos (0) /*!< EBI_T::CTL1: EN Position */ -#define EBI_CTL1_EN_Msk (0x1ul << EBI_CTL1_EN_Pos) /*!< EBI_T::CTL1: EN Mask */ - -#define EBI_CTL1_DW16_Pos (1) /*!< EBI_T::CTL1: DW16 Position */ -#define EBI_CTL1_DW16_Msk (0x1ul << EBI_CTL1_DW16_Pos) /*!< EBI_T::CTL1: DW16 Mask */ - -#define EBI_CTL1_CSPOLINV_Pos (2) /*!< EBI_T::CTL1: CSPOLINV Position */ -#define EBI_CTL1_CSPOLINV_Msk (0x1ul << EBI_CTL1_CSPOLINV_Pos) /*!< EBI_T::CTL1: CSPOLINV Mask */ - -#define EBI_CTL1_ADSEPEN_Pos (3) /*!< EBI_T::CTL1: ADSEPEN Position */ -#define EBI_CTL1_ADSEPEN_Msk (0x1ul << EBI_CTL1_ADSEPEN_Pos) /*!< EBI_T::CTL1: ADSEPEN Mask */ - -#define EBI_CTL1_CACCESS_Pos (4) /*!< EBI_T::CTL1: CACCESS Position */ -#define EBI_CTL1_CACCESS_Msk (0x1ul << EBI_CTL1_CACCESS_Pos) /*!< EBI_T::CTL1: CACCESS Mask */ - -#define EBI_CTL1_MCLKDIV_Pos (8) /*!< EBI_T::CTL1: MCLKDIV Position */ -#define EBI_CTL1_MCLKDIV_Msk (0x7ul << EBI_CTL1_MCLKDIV_Pos) /*!< EBI_T::CTL1: MCLKDIV Mask */ - -#define EBI_CTL1_TALE_Pos (16) /*!< EBI_T::CTL1: TALE Position */ -#define EBI_CTL1_TALE_Msk (0x7ul << EBI_CTL1_TALE_Pos) /*!< EBI_T::CTL1: TALE Mask */ - -#define EBI_CTL1_WBUFEN_Pos (24) /*!< EBI_T::CTL1: WBUFEN Position */ -#define EBI_CTL1_WBUFEN_Msk (0x1ul << EBI_CTL1_WBUFEN_Pos) /*!< EBI_T::CTL1: WBUFEN Mask */ - -#define EBI_TCTL1_TACC_Pos (3) /*!< EBI_T::TCTL1: TACC Position */ -#define EBI_TCTL1_TACC_Msk (0x1ful << EBI_TCTL1_TACC_Pos) /*!< EBI_T::TCTL1: TACC Mask */ - -#define EBI_TCTL1_TAHD_Pos (8) /*!< EBI_T::TCTL1: TAHD Position */ -#define EBI_TCTL1_TAHD_Msk (0x7ul << EBI_TCTL1_TAHD_Pos) /*!< EBI_T::TCTL1: TAHD Mask */ - -#define EBI_TCTL1_W2X_Pos (12) /*!< EBI_T::TCTL1: W2X Position */ -#define EBI_TCTL1_W2X_Msk (0xful << EBI_TCTL1_W2X_Pos) /*!< EBI_T::TCTL1: W2X Mask */ - -#define EBI_TCTL1_RAHDOFF_Pos (22) /*!< EBI_T::TCTL1: RAHDOFF Position */ -#define EBI_TCTL1_RAHDOFF_Msk (0x1ul << EBI_TCTL1_RAHDOFF_Pos) /*!< EBI_T::TCTL1: RAHDOFF Mask */ - -#define EBI_TCTL1_WAHDOFF_Pos (23) /*!< EBI_T::TCTL1: WAHDOFF Position */ -#define EBI_TCTL1_WAHDOFF_Msk (0x1ul << EBI_TCTL1_WAHDOFF_Pos) /*!< EBI_T::TCTL1: WAHDOFF Mask */ - -#define EBI_TCTL1_R2R_Pos (24) /*!< EBI_T::TCTL1: R2R Position */ -#define EBI_TCTL1_R2R_Msk (0xful << EBI_TCTL1_R2R_Pos) /*!< EBI_T::TCTL1: R2R Mask */ - -#define EBI_CTL2_EN_Pos (0) /*!< EBI_T::CTL2: EN Position */ -#define EBI_CTL2_EN_Msk (0x1ul << EBI_CTL2_EN_Pos) /*!< EBI_T::CTL2: EN Mask */ - -#define EBI_CTL2_DW16_Pos (1) /*!< EBI_T::CTL2: DW16 Position */ -#define EBI_CTL2_DW16_Msk (0x1ul << EBI_CTL2_DW16_Pos) /*!< EBI_T::CTL2: DW16 Mask */ - -#define EBI_CTL2_CSPOLINV_Pos (2) /*!< EBI_T::CTL2: CSPOLINV Position */ -#define EBI_CTL2_CSPOLINV_Msk (0x1ul << EBI_CTL2_CSPOLINV_Pos) /*!< EBI_T::CTL2: CSPOLINV Mask */ - -#define EBI_CTL2_ADSEPEN_Pos (3) /*!< EBI_T::CTL2: ADSEPEN Position */ -#define EBI_CTL2_ADSEPEN_Msk (0x1ul << EBI_CTL2_ADSEPEN_Pos) /*!< EBI_T::CTL2: ADSEPEN Mask */ - -#define EBI_CTL2_CACCESS_Pos (4) /*!< EBI_T::CTL2: CACCESS Position */ -#define EBI_CTL2_CACCESS_Msk (0x1ul << EBI_CTL2_CACCESS_Pos) /*!< EBI_T::CTL2: CACCESS Mask */ - -#define EBI_CTL2_MCLKDIV_Pos (8) /*!< EBI_T::CTL2: MCLKDIV Position */ -#define EBI_CTL2_MCLKDIV_Msk (0x7ul << EBI_CTL2_MCLKDIV_Pos) /*!< EBI_T::CTL2: MCLKDIV Mask */ - -#define EBI_CTL2_TALE_Pos (16) /*!< EBI_T::CTL2: TALE Position */ -#define EBI_CTL2_TALE_Msk (0x7ul << EBI_CTL2_TALE_Pos) /*!< EBI_T::CTL2: TALE Mask */ - -#define EBI_CTL2_WBUFEN_Pos (24) /*!< EBI_T::CTL2: WBUFEN Position */ -#define EBI_CTL2_WBUFEN_Msk (0x1ul << EBI_CTL2_WBUFEN_Pos) /*!< EBI_T::CTL2: WBUFEN Mask */ - -#define EBI_TCTL2_TACC_Pos (3) /*!< EBI_T::TCTL2: TACC Position */ -#define EBI_TCTL2_TACC_Msk (0x1ful << EBI_TCTL2_TACC_Pos) /*!< EBI_T::TCTL2: TACC Mask */ - -#define EBI_TCTL2_TAHD_Pos (8) /*!< EBI_T::TCTL2: TAHD Position */ -#define EBI_TCTL2_TAHD_Msk (0x7ul << EBI_TCTL2_TAHD_Pos) /*!< EBI_T::TCTL2: TAHD Mask */ - -#define EBI_TCTL2_W2X_Pos (12) /*!< EBI_T::TCTL2: W2X Position */ -#define EBI_TCTL2_W2X_Msk (0xful << EBI_TCTL2_W2X_Pos) /*!< EBI_T::TCTL2: W2X Mask */ - -#define EBI_TCTL2_RAHDOFF_Pos (22) /*!< EBI_T::TCTL2: RAHDOFF Position */ -#define EBI_TCTL2_RAHDOFF_Msk (0x1ul << EBI_TCTL2_RAHDOFF_Pos) /*!< EBI_T::TCTL2: RAHDOFF Mask */ - -#define EBI_TCTL2_WAHDOFF_Pos (23) /*!< EBI_T::TCTL2: WAHDOFF Position */ -#define EBI_TCTL2_WAHDOFF_Msk (0x1ul << EBI_TCTL2_WAHDOFF_Pos) /*!< EBI_T::TCTL2: WAHDOFF Mask */ - -#define EBI_TCTL2_R2R_Pos (24) /*!< EBI_T::TCTL2: R2R Position */ -#define EBI_TCTL2_R2R_Msk (0xful << EBI_TCTL2_R2R_Pos) /*!< EBI_T::TCTL2: R2R Mask */ - -/**@}*/ /* EBI_CONST */ -/**@}*/ /* end of EBI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __EBI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ecap_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ecap_reg.h deleted file mode 100644 index d22d9dc4de8..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ecap_reg.h +++ /dev/null @@ -1,390 +0,0 @@ -/**************************************************************************//** - * @file ecap_reg.h - * @version V1.00 - * @brief ECAP register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ECAP_REG_H__ -#define __ECAP_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ECAP Enhanced Input Capture Timer(ECAP) - Memory Mapped Structure for ECAP Controller -@{ */ - -typedef struct -{ - - /** - * @var ECAP_T::CNT - * Offset: 0x00 Input Capture Counter (24-bit up counter) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Input Capture Timer/Counter - * | | |The input Capture Timer/Counter is a 24-bit up-counting counter - * | | |The clock source for the counter is from the clock divider - * @var ECAP_T::HLD0 - * Offset: 0x04 Input Capture Hold Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD1 - * Offset: 0x08 Input Capture Hold Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD2 - * Offset: 0x0C Input Capture Hold Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::CNTCMP - * Offset: 0x10 Input Capture Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNTCMP |Input Capture Counter Compare Register - * | | |If the compare function is enabled (CMPEN = 1), this register (ECAP_CNTCMP) is used to compare with the capture counter (ECAP_CNT). - * | | |If the reload control is enabled (RLDEN[n] = 1, n=0~3), an overflow event or capture events will trigger the hardware to load the value of this register (ECAP_CNTCMP) into ECAP_CNT. - * @var ECAP_T::CTL0 - * Offset: 0x14 Input Capture Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection - * | | |To determine the sampling frequency of the Noise Filter clock - * | | |000 = CAP_CLK. - * | | |001 = CAP_CLK/2. - * | | |010 = CAP_CLK/4. - * | | |011 = CAP_CLK/16. - * | | |100 = CAP_CLK/32. - * | | |101 = CAP_CLK/64. - * |[3] |CAPNFDIS |Input Capture Noise Filter Disable Control - * | | |0 = Noise filter of Input Capture Enabled. - * | | |1 = Noise filter of Input Capture Disabled (Bypass). - * |[4] |IC0EN |Port Pin IC0 Input to Input Capture Unit Enable Control - * | | |0 = IC0 input to Input Capture Unit Disabled. - * | | |1 = IC0 input to Input Capture Unit Enabled. - * |[5] |IC1EN |Port Pin IC1 Input to Input Capture Unit Enable Control - * | | |0 = IC1 input to Input Capture Unit Disabled. - * | | |1 = IC1 input to Input Capture Unit Enabled. - * |[6] |IC2EN |Port Pin IC2 Input to Input Capture Unit Enable Control - * | | |0 = IC2 input to Input Capture Unit Disabled. - * | | |1 = IC2 input to Input Capture Unit Enabled. - * |[9:8] |CAPSEL0 |CAP0 Input Source Selection - * | | |00 = CAP0 input is from port pin ICAP0. - * | | |01 = Reserved. - * | | |10 = CAP0 input is from signal CHA of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[11:10] |CAPSEL1 |CAP1 Input Source Selection - * | | |00 = CAP1 input is from port pin ICAP1. - * | | |01 = Reserved. - * | | |10 = CAP1 input is from signal CHB of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[13:12] |CAPSEL2 |CAP2 Input Source Selection - * | | |00 = CAP2 input is from port pin ICAP2. - * | | |01 = Reserved. - * | | |10 = CAP2 input is from signal CHX of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[16] |CAPIEN0 |Input Capture Channel 0 Interrupt Enable Control - * | | |0 = The flag CAPTF0 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF0 can trigger Input Capture interrupt Enabled. - * |[17] |CAPIEN1 |Input Capture Channel 1 Interrupt Enable Control - * | | |0 = The flag CAPTF1 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF1 can trigger Input Capture interrupt Enabled. - * |[18] |CAPIEN2 |Input Capture Channel 2 Interrupt Enable Control - * | | |0 = The flag CAPTF2 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF2 can trigger Input Capture interrupt Enabled. - * |[20] |OVIEN |CAPOVF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPOVF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPOVF can trigger Input Capture interrupt Enabled. - * |[21] |CMPIEN |CAPCMPF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPCMPF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPCMPF can trigger Input Capture interrupt Enabled. - * |[24] |CNTEN |Input Capture Counter Start Counting Control - * | | |Setting this bit to 1, the capture counter (ECAP_CNT) starts up-counting synchronously with the clock from the . - * | | |0 = ECAP_CNT stop counting. - * | | |1 = ECAP_CNT starts up-counting. - * |[25] |CMPCLREN |Input Capture Counter Cleared by Compare-match Control - * | | |If this bit is set to 1, the capture counter (ECAP_CNT) will be cleared to 0 when the compare-match event (CAPCMPF = 1) occurs. - * | | |0 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Enabled. - * |[28] |CMPEN |Compare Function Enable Control - * | | |The compare function in input capture timer/counter is to compare the dynamic counting ECAP_CNT with the compare register ECAP_CNTCMP, if ECAP_CNT value reaches ECAP_CNTCMP, the flag CAPCMPF will be set. - * | | |0 = The compare function Disabled. - * | | |1 = The compare function Enabled. - * |[29] |CAPEN |Input Capture Timer/Counter Enable Control - * | | |0 = Input Capture function Disabled. - * | | |1 = Input Capture function Enabled. - * @var ECAP_T::CTL1 - * Offset: 0x18 Input Capture Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |EDGESEL0 |Channel 0 Captured Edge Selection - * | | |Input capture0 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[3:2] |EDGESEL1 |Channel 1 Captured Edge Selection - * | | |Input capture1 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[5:4] |EDGESEL2 |Channel 2 Captured Edge Selection - * | | |Input capture2 can detect falling edge change only, rising edge change only or both edge changes - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[8] |CAP0RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE0 Enable Bit - * | | |0 = The reload triggered by Event CAPTE0 Disabled. - * | | |1 = The reload triggered by Event CAPTE0 Enabled. - * |[9] |CAP1RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE1 Enable Bit - * | | |0 = The reload triggered by Event CAPTE1 Disabled. - * | | |1 = The reload triggered by Event CAPTE1 Enabled. - * |[10] |CAP2RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE2 Enable Bit - * | | |0 = The reload triggered by Event CAPTE2 Disabled. - * | | |1 = The reload triggered by Event CAPTE2 Enabled. - * |[11] |OVRLDEN |Capture Counteru2019s Reload Function Triggered by Overflow Enable Bit - * | | |0 = The reload triggered by CAPOV Disabled. - * | | |1 = The reload triggered by CAPOV Enabled. - * |[14:12] |CLKSEL |Capture Timer Clock Divide Selection - * | | |The capture timer clock has a pre-divider with eight divided options controlled by CLKSEL[2:0]. - * | | |000 = CAP_CLK/1. - * | | |001 = CAP_CLK/4. - * | | |010 = CAP_CLK/16. - * | | |011 = CAP_CLK/32. - * | | |100 = CAP_CLK/64. - * | | |101 = CAP_CLK/96. - * | | |110 = CAP_CLK/112. - * | | |111 = CAP_CLK/128. - * |[17:16] |CNTSRCSEL |Capture Timer/Counter Clock Source Selection - * | | |Select the capture timer/counter clock source. - * | | |00 = CAP_CLK (default). - * | | |01 = CAP0. - * | | |10 = CAP1. - * | | |11 = CAP2. - * |[20] |CAP0CLREN |Capture Counter Cleared by Capture Event0 Control - * | | |0 = Event CAPTE0 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE0 can clear capture counter (ECAP_CNT) Enabled. - * |[21] |CAP1CLREN |Capture Counter Cleared by Capture Event1 Control - * | | |0 = Event CAPTE1 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE1 can clear capture counter (ECAP_CNT) Enabled. - * |[22] |CAP2CLREN |Capture Counter Cleared by Capture Event2 Control - * | | |0 = Event CAPTE2 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE2 can clear capture counter (ECAP_CNT) Enabled. - * @var ECAP_T::STATUS - * Offset: 0x1C Input Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPTF0 |Input Capture Channel 0 Triggered Flag - * | | |When the input capture channel 0 detects a valid edge change at CAP0 input, it will set flag CAPTF0 to high. - * | | |0 = No valid edge change has been detected at CAP0 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP0 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[1] |CAPTF1 |Input Capture Channel 1 Triggered Flag - * | | |When the input capture channel 1 detects a valid edge change at CAP1 input, it will set flag CAPTF1 to high. - * | | |0 = No valid edge change has been detected at CAP1 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP1 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[2] |CAPTF2 |Input Capture Channel 2 Triggered Flag - * | | |When the input capture channel 2 detects a valid edge change at CAP2 input, it will set flag CAPTF2 to high. - * | | |0 = No valid edge change has been detected at CAP2 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP2 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[4] |CAPCMPF |Input Capture Compare-match Flag - * | | |If the input capture compare function is enabled, the flag is set by hardware when capture counter (ECAP_CNT) up counts and reaches the ECAP_CNTCMP value. - * | | |0 = ECAP_CNT has not matched ECAP_CNTCMP value since last clear. - * | | |1 = ECAP_CNT has matched ECAP_CNTCMP value at least once since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[5] |CAPOVF |Input Capture Counter Overflow Flag - * | | |Flag is set by hardware when counter (ECAP_CNT) overflows from 0x00FF_FFFF to zero. - * | | |0 = No overflow event has occurred since last clear. - * | | |1 = Overflow event(s) has/have occurred since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[6] |CAP0 |Value of Input Channel 0, CAP0 (Read Only) - * | | |Reflecting the value of input channel 0, CAP0 - * | | |(The bit is read only and write is ignored) - * |[7] |CAP1 |Value of Input Channel 1, CAP1 (Read Only) - * | | |Reflecting the value of input channel 1, CAP1 - * | | |(The bit is read only and write is ignored) - * |[8] |CAP2 |Value of Input Channel 2, CAP2 (Read Only) - * | | |Reflecting the value of input channel 2, CAP2. - * | | |(The bit is read only and write is ignored) - */ - __IO uint32_t CNT; /*!< [0x0000] Input Capture Counter */ - __IO uint32_t HLD0; /*!< [0x0004] Input Capture Hold Register 0 */ - __IO uint32_t HLD1; /*!< [0x0008] Input Capture Hold Register 1 */ - __IO uint32_t HLD2; /*!< [0x000c] Input Capture Hold Register 2 */ - __IO uint32_t CNTCMP; /*!< [0x0010] Input Capture Compare Register */ - __IO uint32_t CTL0; /*!< [0x0014] Input Capture Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0018] Input Capture Control Register 1 */ - __IO uint32_t STATUS; /*!< [0x001c] Input Capture Status Register */ - -} ECAP_T; - -/** - @addtogroup ECAP_CONST ECAP Bit Field Definition - Constant Definitions for ECAP Controller -@{ */ - -#define ECAP_CNT_CNT_Pos (0) /*!< ECAP_T::CNT: CNT Position */ -#define ECAP_CNT_CNT_Msk (0xfffffful << ECAP_CNT_CNT_Pos) /*!< ECAP_T::CNT: CNT Mask */ - -#define ECAP_HLD0_HOLD_Pos (0) /*!< ECAP_T::HLD0: HOLD Position */ -#define ECAP_HLD0_HOLD_Msk (0xfffffful << ECAP_HLD0_HOLD_Pos) /*!< ECAP_T::HLD0: HOLD Mask */ - -#define ECAP_HLD1_HOLD_Pos (0) /*!< ECAP_T::HLD1: HOLD Position */ -#define ECAP_HLD1_HOLD_Msk (0xfffffful << ECAP_HLD1_HOLD_Pos) /*!< ECAP_T::HLD1: HOLD Mask */ - -#define ECAP_HLD2_HOLD_Pos (0) /*!< ECAP_T::HLD2: HOLD Position */ -#define ECAP_HLD2_HOLD_Msk (0xfffffful << ECAP_HLD2_HOLD_Pos) /*!< ECAP_T::HLD2: HOLD Mask */ - -#define ECAP_CNTCMP_CNTCMP_Pos (0) /*!< ECAP_T::CNTCMP: CNTCMP Position */ -#define ECAP_CNTCMP_CNTCMP_Msk (0xfffffful << ECAP_CNTCMP_CNTCMP_Pos) /*!< ECAP_T::CNTCMP: CNTCMP Mask */ - -#define ECAP_CTL0_NFCLKSEL_Pos (0) /*!< ECAP_T::CTL0: NFCLKSEL Position */ -#define ECAP_CTL0_NFCLKSEL_Msk (0x7ul << ECAP_CTL0_NFCLKSEL_Pos) /*!< ECAP_T::CTL0: NFCLKSEL Mask */ - -#define ECAP_CTL0_CAPNFDIS_Pos (3) /*!< ECAP_T::CTL0: CAPNFDIS Position */ -#define ECAP_CTL0_CAPNFDIS_Msk (0x1ul << ECAP_CTL0_CAPNFDIS_Pos) /*!< ECAP_T::CTL0: CAPNFDIS Mask */ - -#define ECAP_CTL0_IC0EN_Pos (4) /*!< ECAP_T::CTL0: IC0EN Position */ -#define ECAP_CTL0_IC0EN_Msk (0x1ul << ECAP_CTL0_IC0EN_Pos) /*!< ECAP_T::CTL0: IC0EN Mask */ - -#define ECAP_CTL0_IC1EN_Pos (5) /*!< ECAP_T::CTL0: IC1EN Position */ -#define ECAP_CTL0_IC1EN_Msk (0x1ul << ECAP_CTL0_IC1EN_Pos) /*!< ECAP_T::CTL0: IC1EN Mask */ - -#define ECAP_CTL0_IC2EN_Pos (6) /*!< ECAP_T::CTL0: IC2EN Position */ -#define ECAP_CTL0_IC2EN_Msk (0x1ul << ECAP_CTL0_IC2EN_Pos) /*!< ECAP_T::CTL0: IC2EN Mask */ - -#define ECAP_CTL0_CAPSEL0_Pos (8) /*!< ECAP_T::CTL0: CAPSEL0 Position */ -#define ECAP_CTL0_CAPSEL0_Msk (0x3ul << ECAP_CTL0_CAPSEL0_Pos) /*!< ECAP_T::CTL0: CAPSEL0 Mask */ - -#define ECAP_CTL0_CAPSEL1_Pos (10) /*!< ECAP_T::CTL0: CAPSEL1 Position */ -#define ECAP_CTL0_CAPSEL1_Msk (0x3ul << ECAP_CTL0_CAPSEL1_Pos) /*!< ECAP_T::CTL0: CAPSEL1 Mask */ - -#define ECAP_CTL0_CAPSEL2_Pos (12) /*!< ECAP_T::CTL0: CAPSEL2 Position */ -#define ECAP_CTL0_CAPSEL2_Msk (0x3ul << ECAP_CTL0_CAPSEL2_Pos) /*!< ECAP_T::CTL0: CAPSEL2 Mask */ - -#define ECAP_CTL0_CAPIEN0_Pos (16) /*!< ECAP_T::CTL0: CAPIEN0 Position */ -#define ECAP_CTL0_CAPIEN0_Msk (0x1ul << ECAP_CTL0_CAPIEN0_Pos) /*!< ECAP_T::CTL0: CAPIEN0 Mask */ - -#define ECAP_CTL0_CAPIEN1_Pos (17) /*!< ECAP_T::CTL0: CAPIEN1 Position */ -#define ECAP_CTL0_CAPIEN1_Msk (0x1ul << ECAP_CTL0_CAPIEN1_Pos) /*!< ECAP_T::CTL0: CAPIEN1 Mask */ - -#define ECAP_CTL0_CAPIEN2_Pos (18) /*!< ECAP_T::CTL0: CAPIEN2 Position */ -#define ECAP_CTL0_CAPIEN2_Msk (0x1ul << ECAP_CTL0_CAPIEN2_Pos) /*!< ECAP_T::CTL0: CAPIEN2 Mask */ - -#define ECAP_CTL0_OVIEN_Pos (20) /*!< ECAP_T::CTL0: OVIEN Position */ -#define ECAP_CTL0_OVIEN_Msk (0x1ul << ECAP_CTL0_OVIEN_Pos) /*!< ECAP_T::CTL0: OVIEN Mask */ - -#define ECAP_CTL0_CMPIEN_Pos (21) /*!< ECAP_T::CTL0: CMPIEN Position */ -#define ECAP_CTL0_CMPIEN_Msk (0x1ul << ECAP_CTL0_CMPIEN_Pos) /*!< ECAP_T::CTL0: CMPIEN Mask */ - -#define ECAP_CTL0_CNTEN_Pos (24) /*!< ECAP_T::CTL0: CNTEN Position */ -#define ECAP_CTL0_CNTEN_Msk (0x1ul << ECAP_CTL0_CNTEN_Pos) /*!< ECAP_T::CTL0: CNTEN Mask */ - -#define ECAP_CTL0_CMPCLREN_Pos (25) /*!< ECAP_T::CTL0: CMPCLREN Position */ -#define ECAP_CTL0_CMPCLREN_Msk (0x1ul << ECAP_CTL0_CMPCLREN_Pos) /*!< ECAP_T::CTL0: CMPCLREN Mask */ - -#define ECAP_CTL0_CMPEN_Pos (28) /*!< ECAP_T::CTL0: CMPEN Position */ -#define ECAP_CTL0_CMPEN_Msk (0x1ul << ECAP_CTL0_CMPEN_Pos) /*!< ECAP_T::CTL0: CMPEN Mask */ - -#define ECAP_CTL0_CAPEN_Pos (29) /*!< ECAP_T::CTL0: CAPEN Position */ -#define ECAP_CTL0_CAPEN_Msk (0x1ul << ECAP_CTL0_CAPEN_Pos) /*!< ECAP_T::CTL0: CAPEN Mask */ - -#define ECAP_CTL1_EDGESEL0_Pos (0) /*!< ECAP_T::CTL1: EDGESEL0 Position */ -#define ECAP_CTL1_EDGESEL0_Msk (0x3ul << ECAP_CTL1_EDGESEL0_Pos) /*!< ECAP_T::CTL1: EDGESEL0 Mask */ - -#define ECAP_CTL1_EDGESEL1_Pos (2) /*!< ECAP_T::CTL1: EDGESEL1 Position */ -#define ECAP_CTL1_EDGESEL1_Msk (0x3ul << ECAP_CTL1_EDGESEL1_Pos) /*!< ECAP_T::CTL1: EDGESEL1 Mask */ - -#define ECAP_CTL1_EDGESEL2_Pos (4) /*!< ECAP_T::CTL1: EDGESEL2 Position */ -#define ECAP_CTL1_EDGESEL2_Msk (0x3ul << ECAP_CTL1_EDGESEL2_Pos) /*!< ECAP_T::CTL1: EDGESEL2 Mask */ - -#define ECAP_CTL1_CAP0RLDEN_Pos (8) /*!< ECAP_T::CTL1: CAP0RLDEN Position */ -#define ECAP_CTL1_CAP0RLDEN_Msk (0x1ul << ECAP_CTL1_CAP0RLDEN_Pos) /*!< ECAP_T::CTL1: CAP0RLDEN Mask */ - -#define ECAP_CTL1_CAP1RLDEN_Pos (9) /*!< ECAP_T::CTL1: CAP1RLDEN Position */ -#define ECAP_CTL1_CAP1RLDEN_Msk (0x1ul << ECAP_CTL1_CAP1RLDEN_Pos) /*!< ECAP_T::CTL1: CAP1RLDEN Mask */ - -#define ECAP_CTL1_CAP2RLDEN_Pos (10) /*!< ECAP_T::CTL1: CAP2RLDEN Position */ -#define ECAP_CTL1_CAP2RLDEN_Msk (0x1ul << ECAP_CTL1_CAP2RLDEN_Pos) /*!< ECAP_T::CTL1: CAP2RLDEN Mask */ - -#define ECAP_CTL1_OVRLDEN_Pos (11) /*!< ECAP_T::CTL1: OVRLDEN Position */ -#define ECAP_CTL1_OVRLDEN_Msk (0x1ul << ECAP_CTL1_OVRLDEN_Pos) /*!< ECAP_T::CTL1: OVRLDEN Mask */ - -#define ECAP_CTL1_CLKSEL_Pos (12) /*!< ECAP_T::CTL1: CLKSEL Position */ -#define ECAP_CTL1_CLKSEL_Msk (0x7ul << ECAP_CTL1_CLKSEL_Pos) /*!< ECAP_T::CTL1: CLKSEL Mask */ - -#define ECAP_CTL1_CNTSRCSEL_Pos (16) /*!< ECAP_T::CTL1: CNTSRCSEL Position */ -#define ECAP_CTL1_CNTSRCSEL_Msk (0x3ul << ECAP_CTL1_CNTSRCSEL_Pos) /*!< ECAP_T::CTL1: CNTSRCSEL Mask */ - -#define ECAP_CTL1_CAP0CLREN_Pos (20) /*!< ECAP_T::CTL1: CAP0CLREN Position */ -#define ECAP_CTL1_CAP0CLREN_Msk (0x1ul << ECAP_CTL1_CAP0CLREN_Pos) /*!< ECAP_T::CTL1: CAP0CLREN Mask */ - -#define ECAP_CTL1_CAP1CLREN_Pos (21) /*!< ECAP_T::CTL1: CAP1CLREN Position */ -#define ECAP_CTL1_CAP1CLREN_Msk (0x1ul << ECAP_CTL1_CAP1CLREN_Pos) /*!< ECAP_T::CTL1: CAP1CLREN Mask */ - -#define ECAP_CTL1_CAP2CLREN_Pos (22) /*!< ECAP_T::CTL1: CAP2CLREN Position */ -#define ECAP_CTL1_CAP2CLREN_Msk (0x1ul << ECAP_CTL1_CAP2CLREN_Pos) /*!< ECAP_T::CTL1: CAP2CLREN Mask */ - -#define ECAP_STATUS_CAPTF0_Pos (0) /*!< ECAP_T::STATUS: CAPTF0 Position */ -#define ECAP_STATUS_CAPTF0_Msk (0x1ul << ECAP_STATUS_CAPTF0_Pos) /*!< ECAP_T::STATUS: CAPTF0 Mask */ - -#define ECAP_STATUS_CAPTF1_Pos (1) /*!< ECAP_T::STATUS: CAPTF1 Position */ -#define ECAP_STATUS_CAPTF1_Msk (0x1ul << ECAP_STATUS_CAPTF1_Pos) /*!< ECAP_T::STATUS: CAPTF1 Mask */ - -#define ECAP_STATUS_CAPTF2_Pos (2) /*!< ECAP_T::STATUS: CAPTF2 Position */ -#define ECAP_STATUS_CAPTF2_Msk (0x1ul << ECAP_STATUS_CAPTF2_Pos) /*!< ECAP_T::STATUS: CAPTF2 Mask */ - -#define ECAP_STATUS_CAPCMPF_Pos (4) /*!< ECAP_T::STATUS: CAPCMPF Position */ -#define ECAP_STATUS_CAPCMPF_Msk (0x1ul << ECAP_STATUS_CAPCMPF_Pos) /*!< ECAP_T::STATUS: CAPCMPF Mask */ - -#define ECAP_STATUS_CAPOVF_Pos (5) /*!< ECAP_T::STATUS: CAPOVF Position */ -#define ECAP_STATUS_CAPOVF_Msk (0x1ul << ECAP_STATUS_CAPOVF_Pos) /*!< ECAP_T::STATUS: CAPOVF Mask */ - -#define ECAP_STATUS_CAP0_Pos (8) /*!< ECAP_T::STATUS: CAP0 Position */ -#define ECAP_STATUS_CAP0_Msk (0x1ul << ECAP_STATUS_CAP0_Pos) /*!< ECAP_T::STATUS: CAP0 Mask */ - -#define ECAP_STATUS_CAP1_Pos (9) /*!< ECAP_T::STATUS: CAP1 Position */ -#define ECAP_STATUS_CAP1_Msk (0x1ul << ECAP_STATUS_CAP1_Pos) /*!< ECAP_T::STATUS: CAP1 Mask */ - -#define ECAP_STATUS_CAP2_Pos (10) /*!< ECAP_T::STATUS: CAP2 Position */ -#define ECAP_STATUS_CAP2_Msk (0x1ul << ECAP_STATUS_CAP2_Pos) /*!< ECAP_T::STATUS: CAP2 Mask */ - -/**@}*/ /* ECAP_CONST */ -/**@}*/ /* end of ECAP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __ECAP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/emac_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/emac_reg.h deleted file mode 100644 index 831df4a3a1f..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/emac_reg.h +++ /dev/null @@ -1,2063 +0,0 @@ -/**************************************************************************//** - * @file emac_reg.h - * @version V1.00 - * @brief EMAC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EMAC_REG_H__ -#define __EMAC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EMAC Ethernet MAC Controller(EMAC) - Memory Mapped Structure for EMAC Controller -@{ */ - -typedef struct -{ - - /** - * @var EMAC_T::CAMCTL - * Offset: 0x00 CAM Comparison Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AUP |Accept Unicast Packet - * | | |The AUP controls the unicast packet reception - * | | |If AUP is enabled, EMAC receives all incoming packet its destination MAC address is a unicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all unicast packets. - * |[1] |AMP |Accept Multicast Packet - * | | |The AMP controls the multicast packet reception - * | | |If AMP is enabled, EMAC receives all incoming packet its destination MAC address is a multicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all multicast packets. - * |[2] |ABP |Accept Broadcast Packet - * | | |The ABP controls the broadcast packet reception - * | | |If ABP is enabled, EMAC receives all incoming packet its destination MAC address is a broadcast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all broadcast packets. - * |[3] |COMPEN |Complement CAM Comparison Enable Bit - * | | |The COMPEN controls the complement of the CAM comparison result - * | | |If the CMPEN and COMPEN are both enabled, the incoming packet with specific destination MAC address - * | | |configured in CAM entry will be dropped - * | | |And the incoming packet with destination MAC address does not configured in any CAM entry will be received. - * | | |0 = Complement CAM comparison result Disabled. - * | | |1 = Complement CAM comparison result Enabled. - * |[4] |CMPEN |CAM Compare Enable Bit - * | | |The CMPEN controls the enable of CAM comparison function for destination MAC address recognition - * | | |If software wants to receive a packet with specific destination MAC address, configures the MAC address - * | | |into CAM 12~0, then enables that CAM entry and set CMPEN to 1. - * | | |0 = CAM comparison function for destination MAC address recognition Disabled. - * | | |1 = CAM comparison function for destination MAC address recognition Enabled. - * @var EMAC_T::CAMEN - * Offset: 0x04 CAM Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAMxEN |CAM Entry X Enable Bit - * | | |The CAMxEN controls the validation of CAM entry x. - * | | |The CAM entry 13, 14 and 15 are for PAUSE control frame transmission - * | | |If software wants to transmit a PAUSE control frame out to network, the enable bits of these three CAM - * | | |entries all must be enabled first. - * | | |0 = CAM entry x Disabled. - * | | |1 = CAM entry x Enabled. - * @var EMAC_T::CAM0M - * Offset: 0x08 CAM0 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM0L - * Offset: 0x0C CAM0 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1M - * Offset: 0x10 CAM1 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1L - * Offset: 0x14 CAM1 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2M - * Offset: 0x18 CAM2 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2L - * Offset: 0x1C CAM2 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3M - * Offset: 0x20 CAM3 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3L - * Offset: 0x24 CAM3 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4M - * Offset: 0x28 CAM4 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4L - * Offset: 0x2C CAM4 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5M - * Offset: 0x30 CAM5 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5L - * Offset: 0x34 CAM5 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6M - * Offset: 0x38 CAM6 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6L - * Offset: 0x3C CAM6 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7M - * Offset: 0x40 CAM7 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7L - * Offset: 0x44 CAM7 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8M - * Offset: 0x48 CAM8 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8L - * Offset: 0x4C CAM8 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9M - * Offset: 0x50 CAM9 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9L - * Offset: 0x54 CAM9 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10M - * Offset: 0x58 CAM10 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10L - * Offset: 0x5C CAM10 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11M - * Offset: 0x60 CAM11 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11L - * Offset: 0x64 CAM11 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12M - * Offset: 0x68 CAM12 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12L - * Offset: 0x6C CAM12 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13M - * Offset: 0x70 CAM13 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13L - * Offset: 0x74 CAM13 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14M - * Offset: 0x78 CAM14 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14L - * Offset: 0x7C CAM14 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM15MSB - * Offset: 0x80 CAM15 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |OPCODE |OP Code Field of PAUSE Control Frame - * | | |In the PAUSE control frame, an op code field defined and is 0x0001. - * |[31:16] |LENGTH |LENGTH Field of PAUSE Control Frame - * | | |In the PAUSE control frame, a LENGTH field defined and is 0x8808. - * @var EMAC_T::CAM15LSB - * Offset: 0x84 CAM15 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:24] |OPERAND |Pause Parameter - * | | |In the PAUSE control frame, an OPERAND field defined and controls how much time the destination - * | | |Ethernet MAC Controller paused - * | | |The unit of the OPERAND is a slot time, the 512-bit time. - * @var EMAC_T::TXDSA - * Offset: 0x88 Transmit Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXDSA |Transmit Descriptor Link-list Start Address - * | | |The TXDSA keeps the start address of transmit descriptor link-list - * | | |If the software enables the bit TXON (EMAC_CTL[8]), the content of TXDSA will be loaded into the - * | | |current transmit descriptor start address register (EMAC_CTXDSA) - * | | |The TXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of TXDSA - * | | |This means that TX descriptors must locate at word boundary memory address. - * @var EMAC_T::RXDSA - * Offset: 0x8C Receive Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXDSA |Receive Descriptor Link-list Start Address - * | | |The RXDSA keeps the start address of receive descriptor link-list - * | | |If the S/W enables the bit RXON (EMAC_CTL[0]), the content of RXDSA will be loaded into the current - * | | |receive descriptor start address register (EMAC_CRXDSA) - * | | |The RXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of RXDSA - * | | |This means that RX descriptors must locate at word boundary memory address. - * @var EMAC_T::CTL - * Offset: 0x90 MAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXON |Frame Reception ON - * | | |The RXON controls the normal packet reception of EMAC - * | | |If the RXON is set to high, the EMAC starts the packet reception process, including the RX - * | | |descriptor fetching, packet reception and RX descriptor modification. - * | | |It is necessary to finish EMAC initial sequence before enable RXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the RXON is disabled during EMAC is receiving an incoming packet, the EMAC stops the packet - * | | |reception process after the current packet reception finished. - * | | |0 = Packet reception process stopped. - * | | |1 = Packet reception process started. - * |[1] |ALP |Accept Long Packet - * | | |The ALP controls the long packet, which packet length is greater than 1518 bytes, reception - * | | |If the ALP is set to high, the EMAC will accept the long packet. - * | | |Otherwise, the long packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the long packet. - * | | |1 = Ethernet MAC controller received the long packet. - * |[2] |ARP |Accept Runt Packet - * | | |The ARP controls the runt packet, which length is less than 64 bytes, reception - * | | |If the ARP is set to high, the EMAC will accept the runt packet. - * | | |Otherwise, the runt packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the runt packet. - * | | |1 = Ethernet MAC controller received the runt packet. - * |[3] |ACP |Accept Control Packet - * | | |The ACP controls the control frame reception - * | | |If the ACP is set to high, the EMAC will accept the control frame - * | | |Otherwise, the control frame will be dropped - * | | |It is recommended that S/W only enable ACP while EMAC is operating on full duplex mode. - * | | |0 = Ethernet MAC controller dropped the control frame. - * | | |1 = Ethernet MAC controller received the control frame. - * |[4] |AEP |Accept CRC Error Packet - * | | |The AEP controls the EMAC accepts or drops the CRC error packet - * | | |If the AEP is set to high, the incoming packet with CRC error will be received by EMAC as a good packet. - * | | |0 = Ethernet MAC controller dropped the CRC error packet. - * | | |1 = Ethernet MAC controller received the CRC error packet. - * |[5] |STRIPCRC |Strip CRC Checksum - * | | |The STRIPCRC controls if the length of incoming packet is calculated with 4 bytes CRC checksum - * | | |If the STRIPCRC is set to high, 4 bytes CRC checksum is excluded from length calculation of incoming packet. - * | | |0 = The 4 bytes CRC checksum is included in packet length calculation. - * | | |1 = The 4 bytes CRC checksum is excluded in packet length calculation. - * |[6] |WOLEN |Wake on LAN Enable Bit - * | | |The WOLEN high enables the functionality that Ethernet MAC controller checked if the incoming packet - * | | |is Magic Packet and wakeup system from Power-down mode. - * | | |If incoming packet was a Magic Packet and the system was in Power-down, the Ethernet MAC controller - * | | |would generate a wakeup event to wake system up from Power-down mode. - * | | |0 = Wake-up by Magic Packet function Disabled. - * | | |1 = Wake-up by Magic Packet function Enabled. - * |[8] |TXON |Frame Transmission ON - * | | |The TXON controls the normal packet transmission of EMAC - * | | |If the TXON is set to high, the EMAC starts the packet transmission process, including the TX - * | | |descriptor fetching, packet transmission and TX descriptor modification. - * | | |It is must to finish EMAC initial sequence before enable TXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the TXON is disabled during EMAC is transmitting a packet out, the EMAC stops the packet - * | | |transmission process after the current packet transmission finished. - * | | |0 = Packet transmission process stopped. - * | | |1 = Packet transmission process started. - * |[9] |NODEF |No Deferral - * | | |The NODEF controls the enable of deferral exceed counter - * | | |If NODEF is set to high, the deferral exceed counter is disabled - * | | |The NODEF is only useful while EMAC is operating on half duplex mode. - * | | |0 = The deferral exceed counter Enabled. - * | | |1 = The deferral exceed counter Disabled. - * |[16] |SDPZ |Send PAUSE Frame - * | | |The SDPZ controls the PAUSE control frame transmission. - * | | |If S/W wants to send a PAUSE control frame out, the CAM entry 13, 14 and 15 must be configured - * | | |first and the corresponding CAM enable bit of CAMEN register also must be set. - * | | |Then, set SDPZ to 1 enables the PAUSE control frame transmission. - * | | |The SDPZ is a self-clear bit - * | | |This means after the PAUSE control frame transmission has completed, the SDPZ will be cleared automatically. - * | | |It is recommended that only enabling SNDPAUSE while EMAC is operating in Full Duplex mode. - * | | |0 = PAUSE control frame transmission completed. - * | | |1 = PAUSE control frame transmission Enabled. - * |[17] |SQECHKEN |SQE Checking Enable Bit - * | | |The SQECHKEN controls the enable of SQE checking - * | | |The SQE checking is only available while EMAC is operating on 10M bps and half duplex mode - * | | |In other words, the SQECHKEN cannot affect EMAC operation, if the EMAC is operating on 100Mbps - * | | |or full duplex mode. - * | | |0 = SQE checking Disabled while EMAC is operating in 10Mbps and Half Duplex mode. - * | | |1 = SQE checking Enabled while EMAC is operating in 10Mbps and Half Duplex mode. - * |[18] |FUDUP |Full Duplex Mode Selection - * | | |The FUDUP controls that if EMAC is operating on full or half duplex mode. - * | | |0 = EMAC operates in half duplex mode. - * | | |1 = EMAC operates in full duplex mode. - * |[19] |RMIIRXCTL |RMII RX Control - * | | |The RMIIRXCTL control the receive data sample in RMII mode - * | | |It's necessary to set this bit high when RMIIEN (EMAC_CTL[ [22]) is high. - * | | |0 = RMII RX control disabled. - * | | |1 = RMII RX control enabled. - * |[20] |OPMODE |Operation Mode Selection - * | | |The OPMODE defines that if the EMAC is operating on 10M or 100M bps mode - * | | |The RST (EMAC_CTL[24]) would not affect OPMODE value. - * | | |0 = EMAC operates in 10Mbps mode. - * | | |1 = EMAC operates in 100Mbps mode. - * |[22] |RMIIEN |RMII Mode Enable Bit - * | | |This bit controls if Ethernet MAC controller connected with off-chip Ethernet PHY by MII - * | | |interface or RMII interface - * | | |The RST (EMAC_CTL[24]) would not affect RMIIEN value. - * | | |0 = Ethernet MAC controller RMII mode Disabled. - * | | |1 = Ethernet MAC controller RMII mode Enabled. - * | | |NOTE: This field must keep 1. - * |[24] |RST |Software Reset - * | | |The RST implements a reset function to make the EMAC return default state - * | | |The RST is a self-clear bit - * | | |This means after the software reset finished, the RST will be cleared automatically - * | | |Enable RST can also reset all control and status registers, exclusive of the control bits - * | | |RMIIEN (EMAC_CTL[22]), and OPMODE (EMAC_CTL[20]). - * | | |The EMAC re-initial is necessary after the software reset completed. - * | | |0 = Software reset completed. - * | | |1 = Software reset Enabled. - * @var EMAC_T::MIIMDAT - * Offset: 0x94 MII Management Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATA |MII Management Data - * | | |The DATA is the 16 bits data that will be written into the registers of external PHY for MII - * | | |Management write command or the data from the registers of external PHY for MII Management read command. - * @var EMAC_T::MIIMCTL - * Offset: 0x98 MII Management Control and Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PHYREG |PHY Register Address - * | | |The PHYREG keeps the address to indicate which register of external PHY is the target of the - * | | |MII management command. - * |[12:8] |PHYADDR |PHY Address - * | | |The PHYADDR keeps the address to differentiate which external PHY is the target of the MII management command. - * |[16] |WRITE |Write Command - * | | |The Write defines the MII management command is a read or write. - * | | |0 = MII management command is a read command. - * | | |1 = MII management command is a write command. - * |[17] |BUSY |Busy Bit - * | | |The BUSY controls the enable of the MII management frame generation - * | | |If S/W wants to access registers of external PHY, it set BUSY to high and EMAC generates - * | | |the MII management frame to external PHY through MII Management I/F - * | | |The BUSY is a self-clear bit - * | | |This means the BUSY will be cleared automatically after the MII management command finished. - * | | |0 = MII management command generation finished. - * | | |1 = MII management command generation Enabled. - * |[18] |PREAMSP |Preamble Suppress - * | | |The PREAMSP controls the preamble field generation of MII management frame - * | | |If the PREAMSP is set to high, the preamble field generation of MII management frame is skipped. - * | | |0 = Preamble field generation of MII management frame not skipped. - * | | |1 = Preamble field generation of MII management frame skipped. - * |[19] |MDCON |MDC Clock ON - * | | |The MDC controls the MDC clock generation. If the MDCON is set to high, the MDC clock is turned on. - * | | |0 = MDC clock off. - * | | |1 = MDC clock on. - * @var EMAC_T::FIFOCTL - * Offset: 0x9C FIFO Threshold Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RXFIFOTH |RXFIFO Low Threshold - * | | |The RXFIFOTH controls when RXDMA requests internal arbiter for data transfer between RXFIFO - * | | |and system memory - * | | |The RXFIFOTH defines not only the high threshold of RXFIFO, but also the low threshold - * | | |The low threshold is the half of high threshold always - * | | |During the packet reception, if the RXFIFO reaches the high threshold, the RXDMA starts to - * | | |transfer frame data from RXFIFO to system memory - * | | |If the frame data in RXFIFO is less than low threshold, RXDMA stops to transfer the frame - * | | |data to system memory. - * | | |00 = Depend on the burst length setting - * | | |If the burst length is 8 words, high threshold is 8 words, too. - * | | |01 = RXFIFO high threshold is 64B and low threshold is 32B. - * | | |10 = RXFIFO high threshold is 128B and low threshold is 64B. - * | | |11 = RXFIFO high threshold is 192B and low threshold is 96B. - * |[9:8] |TXFIFOTH |TXFIFO Low Threshold - * | | |The TXFIFOTH controls when TXDMA requests internal arbiter for data transfer between system - * | | |memory and TXFIFO - * | | |The TXFIFOTH defines not only the low threshold of TXFIFO, but also the high threshold - * | | |The high threshold is the twice of low threshold always - * | | |During the packet transmission, if the TXFIFO reaches the high threshold, the TXDMA stops - * | | |generate request to transfer frame data from system memory to TXFIFO - * | | |If the frame data in TXFIFO is less than low threshold, TXDMA starts to transfer frame data - * | | |from system memory to TXFIFO. - * | | |The TXFIFOTH also defines when the TXMAC starts to transmit frame out to network - * | | |The TXMAC starts to transmit the frame out while the TXFIFO first time reaches the high threshold - * | | |during the transmission of the frame - * | | |If the frame data length is less than TXFIFO high threshold, the TXMAC starts to transmit the frame - * | | |out after the frame data are all inside the TXFIFO. - * | | |00 = Undefined. - * | | |01 = TXFIFO low threshold is 64B and high threshold is 128B. - * | | |10 = TXFIFO low threshold is 80B and high threshold is 160B. - * | | |11 = TXFIFO low threshold is 96B and high threshold is 192B. - * |[21:20] |BURSTLEN |DMA Burst Length - * | | |This defines the burst length of AHB bus cycle while EMAC accesses system memory. - * | | |00 = 4 words. - * | | |01 = 8 words. - * | | |10 = 16 words. - * | | |11 = 16 words. - * @var EMAC_T::TXST - * Offset: 0xA0 Transmit Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXST |Transmit Start Demand - * | | |If the TX descriptor is not available for use of TXDMA after the TXON (EMAC_CTL[8]) is enabled, - * | | |the FSM (Finite State Machine) of TXDMA enters the Halt state and the frame transmission is halted - * | | |After the S/W has prepared the new TX descriptor for frame transmission, it must issue a write - * | | |command to EMAC_TXST register to make TXDMA to leave Halt state and continue the frame transmission. - * | | |The EMAC_TXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_TXST register takes effect only when TXDMA stayed at Halt state. - * @var EMAC_T::RXST - * Offset: 0xA4 Receive Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXST |Receive Start Demand - * | | |If the RX descriptor is not available for use of RXDMA after the RXON (EMAC_CTL[0]) is enabled, - * | | |the FSM (Finite State Machine) of RXDMA enters the Halt state and the frame reception is halted - * | | |After the S/W has prepared the new RX descriptor for frame reception, it must issue a write - * | | |command to EMAC_RXST register to make RXDMA to leave Halt state and continue the frame reception. - * | | |The EMAC_RXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_RXST register take effect only when RXDMA stayed at Halt state. - * @var EMAC_T::MRFL - * Offset: 0xA8 Maximum Receive Frame Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MRFL |Maximum Receive Frame Length - * | | |The MRFL defines the maximum frame length for received frame - * | | |If the frame length of received frame is greater than MRFL, and bit MFLEIEN (EMAC_INTEN[8]) - * | | |is also enabled, the bit MFLEIF (EMAC_INTSTS[8]) is set and the RX interrupt is triggered. - * | | |It is recommended that only use MRFL to qualify the length of received frame while S/W wants to - * | | |receive a frame which length is greater than 1518 bytes. - * @var EMAC_T::INTEN - * Offset: 0xAC MAC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIEN |Receive Interrupt Enable Bit - * | | |The RXIEN controls the RX interrupt generation. - * | | |If RXIEN is enabled and RXIF (EMAC_INTSTS[0]) is high, EMAC generates the RX interrupt to CPU - * | | |If RXIEN is disabled, no RX interrupt is generated to CPU even any status bit EMAC_INTSTS[15:1] - * | | |is set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive RX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any RX interrupt from EMAC, disables this bit. - * | | |0 = RXIF (EMAC_INTSTS[0]) is masked and RX interrupt generation Disabled. - * | | |1 = RXIF (EMAC_INTSTS[0]) is not masked and RX interrupt generation Enabled. - * |[1] |CRCEIEN |CRC Error Interrupt Enable Bit - * | | |The CRCEIEN controls the CRCEIF (EMAC_INTSTS[1]) interrupt generation - * | | |If CRCEIF (EMAC_INTSTS[1]) is set, and both CRCEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CRCEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CRCEIF (EMAC_INTSTS[1]) is set. - * | | |0 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Disabled. - * | | |1 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Enabled. - * |[2] |RXOVIEN |Receive FIFO Overflow Interrupt Enable Bit - * | | |The RXOVIEN controls the RXOVIF (EMAC_INTSTS[2]) interrupt generation - * | | |If RXOVIF (EMAC_INTSTS[2]) is set, and both RXOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXOVIF (EMAC_INTSTS[2]) is set. - * | | |0 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Disabled. - * | | |1 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Enabled. - * |[3] |LPIEN |Long Packet Interrupt Enable Bit - * | | |The LPIEN controls the LPIF (EMAC_INTSTS[3]) interrupt generation - * | | |If LPIF (EMAC_INTSTS[3]) is set, and both LPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If LPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the LPIF - * | | |(EMAC_INTSTS[3]) is set. - * | | |0 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Disabled. - * | | |1 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Enabled. - * |[4] |RXGDIEN |Receive Good Interrupt Enable Bit - * | | |The RXGDIEN controls the RXGDIF (EMAC_INTSTS[4]) interrupt generation - * | | |If RXGDIF (EMAC_INTSTS[4]) is set, and both RXGDIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXGDIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXGDIF (EMAC_INTSTS[4]) is set. - * | | |0 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Disabled. - * | | |1 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Enabled. - * |[5] |ALIEIEN |Alignment Error Interrupt Enable Bit - * | | |The ALIEIEN controls the ALIEIF (EMAC_INTSTS[5]) interrupt generation - * | | |If ALIEIF (EMAC_INTSTS[5]) is set, and both ALIEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If ALIEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |ALIEIF (EMAC_INTSTS[5]) is set. - * | | |0 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Disabled. - * | | |1 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Enabled. - * |[6] |RPIEN |Runt Packet Interrupt Enable Bit - * | | |The RPIEN controls the RPIF (EMAC_INTSTS[6]) interrupt generation - * | | |If RPIF (EMAC_INTSTS[6]) is set, and both RPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If RPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RPIF (EMAC_INTSTS[6]) is set. - * | | |0 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Disabled. - * | | |1 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Enabled. - * |[7] |MPCOVIEN |Miss Packet Counter Overrun Interrupt Enable Bit - * | | |The MPCOVIEN controls the MPCOVIF (EMAC_INTSTS[7]) interrupt generation - * | | |If MPCOVIF (EMAC_INTSTS[7]) is set, and both MPCOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If MPCOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MPCOVIF (EMAC_INTSTS[7]) is set. - * | | |0 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Disabled. - * | | |1 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Enabled. - * |[8] |MFLEIEN |Maximum Frame Length Exceed Interrupt Enable Bit - * | | |The MFLEIEN controls the MFLEIF (EMAC_INTSTS[8]) interrupt generation - * | | |If MFLEIF (EMAC_INTSTS[8]) is set, and both MFLEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If MFLEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MFLEIF (EMAC_INTSTS[8]) is set. - * | | |0 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Disabled. - * | | |1 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Enabled. - * |[9] |DENIEN |DMA Early Notification Interrupt Enable Bit - * | | |The DENIEN controls the DENIF (EMAC_INTSTS[9]) interrupt generation - * | | |If DENIF (EMAC_INTSTS[9]) is set, and both DENIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If DENIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |DENIF (EMAC_INTSTS[9]) is set. - * | | |0 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Disabled. - * | | |1 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Enabled. - * |[10] |RDUIEN |Receive Descriptor Unavailable Interrupt Enable Bit - * | | |The RDUIEN controls the RDUIF (EMAC_INTSTS[10]) interrupt generation - * | | |If RDUIF (EMAC_INTSTS[10]) is set, and both RDUIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RDUIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RDUIF (EMAC_MIOSTA[10]) register is set. - * | | |0 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Disabled. - * | | |1 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Enabled. - * |[11] |RXBEIEN |Receive Bus Error Interrupt Enable Bit - * | | |The RXBEIEN controls the RXBEIF (EMAC_INTSTS[11]) interrupt generation - * | | |If RXBEIF (EMAC_INTSTS[11]) is set, and both RXBEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXBEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXBEIF (EMAC_INTSTS[11]) is set. - * | | |0 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Disabled. - * | | |1 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Enabled. - * |[14] |CFRIEN |Control Frame Receive Interrupt Enable Bit - * | | |The CFRIEN controls the CFRIF (EMAC_INTSTS[14]) interrupt generation - * | | |If CFRIF (EMAC_INTSTS[14]) is set, and both CFRIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CFRIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CFRIF (EMAC_INTSTS[14]) register is set. - * | | |0 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Disabled. - * | | |1 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Enabled. - * |[15] |WOLIEN |Wake on LAN Interrupt Enable Bit - * | | |The WOLIEN controls the WOLIF (EMAC_INTSTS[15]) interrupt generation - * | | |If WOLIF (EMAC_INTSTS[15]) is set, and both WOLIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If WOLIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |WOLIF (EMAC_INTSTS[15]) is set. - * | | |0 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Disabled. - * | | |1 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Enabled. - * |[16] |TXIEN |Transmit Interrupt Enable Bit - * | | |The TXIEN controls the TX interrupt generation. - * | | |If TXIEN is enabled and TXIF (EMAC_INTSTS[16]) is high, EMAC generates the TX interrupt to CPU - * | | |If TXIEN is disabled, no TX interrupt is generated to CPU even any status bit of - * | | |EMAC_INTSTS[24:17] set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive TX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any TX interrupt from EMAC, disables this bit. - * | | |0 = TXIF (EMAC_INTSTS[16]) is masked and TX interrupt generation Disabled. - * | | |1 = TXIF (EMAC_INTSTS[16]) is not masked and TX interrupt generation Enabled. - * |[17] |TXUDIEN |Transmit FIFO Underflow Interrupt Enable Bit - * | | |The TXUDIEN controls the TXUDIF (EMAC_INTSTS[17]) interrupt generation - * | | |If TXUDIF (EMAC_INTSTS[17]) is set, and both TXUDIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXUDIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even - * | | |the TXUDIF (EMAC_INTSTS[17]) is set. - * | | |0 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Disabled. - * | | |1 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Enabled. - * |[18] |TXCPIEN |Transmit Completion Interrupt Enable Bit - * | | |The TXCPIEN controls the TXCPIF (EMAC_INTSTS[18]) interrupt generation - * | | |If TXCPIF (EMAC_INTSTS[18]) is set, and both TXCPIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXCPIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXCPIF (EMAC_INTSTS[18]) is set. - * | | |0 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Disabled. - * | | |1 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Enabled. - * |[19] |EXDEFIEN |Defer Exceed Interrupt Enable Bit - * | | |The EXDEFIEN controls the EXDEFIF (EMAC_INTSTS[19]) interrupt generation - * | | |If EXDEFIF (EMAC_INTSTS[19]) is set, and both EXDEFIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If EXDEFIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |EXDEFIF (EMAC_INTSTS[19]) is set. - * | | |0 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Disabled. - * | | |1 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Enabled. - * |[20] |NCSIEN |No Carrier Sense Interrupt Enable Bit - * | | |The NCSIEN controls the NCSIF (EMAC_INTSTS[20]) interrupt generation - * | | |If NCSIF (EMAC_INTSTS[20]) is set, and both NCSIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If NCSIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |NCSIF (EMAC_INTSTS[20]) is set. - * | | |0 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Disabled. - * | | |1 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Enabled. - * |[21] |TXABTIEN |Transmit Abort Interrupt Enable Bit - * | | |The TXABTIEN controls the TXABTIF (EMAC_INTSTS[21]) interrupt generation - * | | |If TXABTIF (EMAC_INTSTS[21]) is set, and both TXABTIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXABTIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXABTIF (EMAC_INTSTS[21]) is set. - * | | |0 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Disabled. - * | | |1 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Enabled. - * |[22] |LCIEN |Late Collision Interrupt Enable Bit - * | | |The LCIEN controls the LCIF (EMAC_INTSTS[22]) interrupt generation - * | | |If LCIF (EMAC_INTSTS[22]) is set, and both LCIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If LCIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |LCIF (EMAC_INTSTS[22]) is set. - * | | |0 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Disabled. - * | | |1 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Enabled. - * |[23] |TDUIEN |Transmit Descriptor Unavailable Interrupt Enable Bit - * | | |The TDUIEN controls the TDUIF (EMAC_INTSTS[23]) interrupt generation - * | | |If TDUIF (EMAC_INTSTS[23]) is set, and both TDUIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TDUIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TDUIF (EMAC_INTSTS[23]) is set. - * | | |0 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Disabled. - * | | |1 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Enabled. - * |[24] |TXBEIEN |Transmit Bus Error Interrupt Enable Bit - * | | |The TXBEIEN controls the TXBEIF (EMAC_INTSTS[24]) interrupt generation - * | | |If TXBEIF (EMAC_INTSTS[24]) is set, and both TXBEIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TXBEIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXBEIF (EMAC_INTSTS[24]) is set. - * | | |0 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Disabled. - * | | |1 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Enabled. - * |[28] |TSALMIEN |Time Stamp Alarm Interrupt Enable Bit - * | | |The TSALMIEN controls the TSALMIF (EMAC_INTSTS[28]) interrupt generation - * | | |If TSALMIF (EMAC_INTSTS[28]) is set, and both TSALMIEN and TXIEN (EMAC_INTEN[16]) enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TSALMIEN or TXIEN (EMAC_INTEN[16]) disabled, no TX interrupt generated to CPU even the - * | | |TXTSALMIF (EMAC_INTEN[28]) is set. - * | | |0 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Disabled. - * | | |1 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Enabled. - * @var EMAC_T::INTSTS - * Offset: 0xB0 MAC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIF |Receive Interrupt - * | | |The RXIF indicates the RX interrupt status. - * | | |If RXIF high and its corresponding enable bit, RXIEN (EMAC_INTEN[0]), is also high indicates - * | | |the EMAC generates RX interrupt to CPU - * | | |If RXIF is high but RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated. - * | | |The RXIF is logic OR result of bit logic AND result of EMAC_INTSTS[15:1] and EMAC_INTEN[15:1] - * | | |In other words, if any bit of EMAC_INTSTS[15:1] is high and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is also enabled, the RXIF will be high. - * | | |Because the RXIF is a logic OR result, clears EMAC_INTSTS[15:1] makes RXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[15:1] is set or no enable bit in EMAC_INTEN[15:1] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[15:1] is set and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is enabled, too. - * |[1] |CRCEIF |CRC Error Interrupt - * | | |The CRCEIF high indicates the incoming packet incurred the CRC error and the packet is dropped - * | | |If the AEP (EMAC_CTL[4]) is set, the CRC error packet will be regarded as a good packet and - * | | |CRCEIF will not be set. - * | | |If the CRCEIF is high and CRCEIEN (EMAC_INTEN[1]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CRCEIF status. - * | | |0 = The frame does not incur CRC error. - * | | |1 = The frame incurred CRC error. - * |[2] |RXOVIF |Receive FIFO Overflow Interrupt - * | | |The RXOVIF high indicates the RXFIFO overflow occurred during packet reception - * | | |While the RXFIFO overflow occurred, the EMAC drops the current receiving packer - * | | |If the RXFIFO overflow occurred often, it is recommended that modify RXFIFO threshold control, - * | | |the RXFIFOTH of FFTCR register, to higher level. - * | | |If the RXOVIF is high and RXOVIEN (EMAC_INTEN[2]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXOVIF status. - * | | |0 = No RXFIFO overflow occurred during packet reception. - * | | |1 = RXFIFO overflow occurred during packet reception. - * |[3] |LPIF |Long Packet Interrupt Flag - * | | |The LPIF high indicates the length of the incoming packet is greater than 1518 bytes and the - * | | |incoming packet is dropped - * | | |If the ALP (EMAC_CTL[1]) is set, the long packet will be regarded as a good packet and LPIF will not be set. - * | | |If the LPIF is high and LPIEN (EMAC_INTEN[3]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the LPIF status. - * | | |0 = The incoming frame is not a long frame or S/W wants to receive a long frame. - * | | |1 = The incoming frame is a long frame and dropped. - * |[4] |RXGDIF |Receive Good Interrupt - * | | |The RXGDIF high indicates the frame reception has completed. - * | | |If the RXGDIF is high and RXGDIEN (EAMC_MIEN[4]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXGDIF status. - * | | |0 = The frame reception has not complete yet. - * | | |1 = The frame reception has completed. - * |[5] |ALIEIF |Alignment Error Interrupt - * | | |The ALIEIF high indicates the length of the incoming frame is not a multiple of byte - * | | |If the ALIEIF is high and ALIEIEN (EMAC_INTEN[5]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the ALIEIF status. - * | | |0 = The frame length is a multiple of byte. - * | | |1 = The frame length is not a multiple of byte. - * |[6] |RPIF |Runt Packet Interrupt - * | | |The RPIF high indicates the length of the incoming packet is less than 64 bytes and the packet is dropped - * | | |If the ARP (EMAC_CTL[2]) is set, the short packet is regarded as a good packet and RPIF will not be set. - * | | |If the RPIF is high and RPIEN (EMAC_INTEN[6]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RPIF status. - * | | |0 = The incoming frame is not a short frame or S/W wants to receive a short frame. - * | | |1 = The incoming frame is a short frame and dropped. - * |[7] |MPCOVIF |Missed Packet Counter Overrun Interrupt Flag - * | | |The MPCOVIF high indicates the MPCNT, Missed Packet Count, has overflow - * | | |If the MPCOVIF is high and MPCOVIEN (EMAC_INTEN[7]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MPCOVIF status. - * | | |0 = The MPCNT has not rolled over yet. - * | | |1 = The MPCNT has rolled over yet. - * |[8] |MFLEIF |Maximum Frame Length Exceed Interrupt Flag - * | | |The MFLEIF high indicates the length of the incoming packet has exceeded the length limitation - * | | |configured in DMARFC register and the incoming packet is dropped - * | | |If the MFLEIF is high and MFLEIEN (EMAC_INTEN[8]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MFLEIF status. - * | | |0 = The length of the incoming packet does not exceed the length limitation configured in DMARFC. - * | | |1 = The length of the incoming packet has exceeded the length limitation configured in DMARFC. - * |[9] |DENIF |DMA Early Notification Interrupt - * | | |The DENIF high indicates the EMAC has received the LENGTH field of the incoming packet. - * | | |If the DENIF is high and DENIENI (EMAC_INTEN[9]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the DENIF status. - * | | |0 = The LENGTH field of incoming packet has not received yet. - * | | |1 = The LENGTH field of incoming packet has received. - * |[10] |RDUIF |Receive Descriptor Unavailable Interrupt - * | | |The RDUIF high indicates that there is no available RX descriptor for packet reception and - * | | |RXDMA will stay at Halt state - * | | |Once, the RXDMA enters the Halt state, S/W must issues a write command to RSDR register to - * | | |make RXDMA leave Halt state while new RX descriptor is available. - * | | |If the RDUIF is high and RDUIEN (EMAC_INTEN[10]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RDUIF status. - * | | |0 = RX descriptor is available. - * | | |1 = RX descriptor is unavailable. - * |[11] |RXBEIF |Receive Bus Error Interrupt - * | | |The RXBEIF high indicates the memory controller replies ERROR response while EMAC access - * | | |system memory through RXDMA during packet reception process - * | | |Reset EMAC is recommended while RXBEIF status is high. - * | | |If the RXBEIF is high and RXBEIEN (EMAC_INTEN[11]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[14] |CFRIF |Control Frame Receive Interrupt - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |If the CFRIF is high and CFRIEN (EMAC_INTEN[14]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CFRIF status. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[15] |WOLIF |Wake on LAN Interrupt Flag - * | | |The WOLIF high indicates EMAC receives a Magic Packet - * | | |The CFRIF only available while system is in power down mode and WOLEN is set high. - * | | |If the WOLIF is high and WOLIEN (EMAC_INTEN[15]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the WOLIF status. - * | | |0 = The EMAC does not receive the Magic Packet. - * | | |1 = The EMAC receives a Magic Packet. - * |[16] |TXIF |Transmit Interrupt - * | | |The TXIF indicates the TX interrupt status. - * | | |If TXIF high and its corresponding enable bit, TXIEN (EMAC_INTEN[16]), is also high indicates - * | | |the EMAC generates TX interrupt to CPU - * | | |If TXIF is high but TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated. - * | | |The TXIF is logic OR result of bit logic AND result of EMAC_INTSTS[28:17] and EMAC_INTEN[28:17] - * | | |In other words, if any bit of EMAC_INTSTS[28:17] is high and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is also enabled, the TXIF will be high - * | | |Because the TXIF is a logic OR result, clears EMAC_INTSTS[28:17] makes TXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[28:17] is set or no enable bit in EMAC_INTEN[28:17] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[28:17] is set and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is enabled, too. - * |[17] |TXUDIF |Transmit FIFO Underflow Interrupt - * | | |The TXUDIF high indicates the TXFIFO underflow occurred during packet transmission - * | | |While the TXFIFO underflow occurred, the EMAC will retransmit the packet automatically - * | | |without S/W intervention - * | | |If the TXFIFO underflow occurred often, it is recommended that modify TXFIFO threshold control, - * | | |the TXFIFOTH of FFTCR register, to higher level. - * | | |If the TXUDIF is high and TXUDIEN (EMAC_INTEN[17]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXUDIF status. - * | | |0 = No TXFIFO underflow occurred during packet transmission. - * | | |1 = TXFIFO underflow occurred during packet transmission. - * |[18] |TXCPIF |Transmit Completion Interrupt - * | | |The TXCPIF indicates the packet transmission has completed correctly. - * | | |If the TXCPIF is high and TXCPIEN (EMAC_INTEN[18]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXCPIF status. - * | | |0 = The packet transmission not completed. - * | | |1 = The packet transmission has completed. - * |[19] |EXDEFIF |Defer Exceed Interrupt - * | | |The EXDEFIF high indicates the frame waiting for transmission has deferred over 0.32768ms - * | | |on 100Mbps mode, or 3.2768ms on 10Mbps mode. - * | | |The deferral exceed check will only be done while bit NODEF of MCMDR is disabled, and EMAC - * | | |is operating on half-duplex mode. - * | | |If the EXDEFIF is high and EXDEFIEN (EMAC_INTEN[19]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the EXDEFIF status. - * | | |0 = Frame waiting for transmission has not deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * | | |1 = Frame waiting for transmission has deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * |[20] |NCSIF |No Carrier Sense Interrupt - * | | |The NCSIF high indicates the MII I/F signal CRS does not active at the start of or during - * | | |the packet transmission - * | | |The NCSIF is only available while EMAC is operating on half-duplex mode - * | | |If the NCSIF is high and NCSIEN (EMAC_INTEN[20]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the NCSIF status. - * | | |0 = CRS signal actives correctly. - * | | |1 = CRS signal does not active at the start of or during the packet transmission. - * |[21] |TXABTIF |Transmit Abort Interrupt - * | | |The TXABTIF high indicates the packet incurred 16 consecutive collisions during transmission, - * | | |and then the transmission process for this packet is aborted - * | | |The transmission abort is only available while EMAC is operating on half-duplex mode. - * | | |If the TXABTIF is high and TXABTIEN (EMAC_INTEN[21]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXABTIF status. - * | | |0 = Packet does not incur 16 consecutive collisions during transmission. - * | | |1 = Packet incurred 16 consecutive collisions during transmission. - * |[22] |LCIF |Late Collision Interrupt - * | | |The LCIF high indicates the collision occurred in the outside of 64 bytes collision window - * | | |This means after the 64 bytes of a frame has been transmitted out to the network, the collision - * | | |still occurred. - * | | |The late collision check will only be done while EMAC is operating on half-duplex mode - * | | |If the LCIF is high and LCIEN (EMAC_INTEN[22]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the LCIF status. - * | | |0 = No collision occurred in the outside of 64 bytes collision window. - * | | |1 = Collision occurred in the outside of 64 bytes collision window. - * |[23] |TDUIF |Transmit Descriptor Unavailable Interrupt - * | | |The TDUIF high indicates that there is no available TX descriptor for packet transmission and - * | | |TXDMA will stay at Halt state. - * | | |Once, the TXDMA enters the Halt state, S/W must issues a write command to TSDR register to make - * | | |TXDMA leave Halt state while new TX descriptor is available. - * | | |If the TDUIF is high and TDUIEN (EMAC_INTEN[23]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TDUIF status. - * | | |0 = TX descriptor is available. - * | | |1 = TX descriptor is unavailable. - * |[24] |TXBEIF |Transmit Bus Error Interrupt - * | | |The TXBEIF high indicates the memory controller replies ERROR response while EMAC access system - * | | |memory through TXDMA during packet transmission process - * | | |Reset EMAC is recommended while TXBEIF status is high. - * | | |If the TXBEIF is high and TXBEIEN (EMAC_INTEN[24]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[28] |TSALMIF |Time Stamp Alarm Interrupt - * | | |The TSALMIF high indicates the EMAC_TSSEC register value equals to EMAC_ALMSEC register and - * | | |EMAC_TSSUBSEC register value equals to register EMAC_ALMSUBLSR. - * | | |If TSALMIF is high and TSALMIEN (EMAC_INTEN[28]) enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TSALMIF status. - * | | |0 = EMAC_TSSEC did not equal EMAC_ALMSEC or EMAC_TSSUBSEC did not equal EMAC_ALMSUBSEC. - * | | |1 = EMAC_TSSEC equals EMAC_ALMSEC and EMAC_TSSUBSEC equals EMAC_ALMSUBSEC. - * @var EMAC_T::GENSTS - * Offset: 0xB4 MAC General Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CFR |Control Frame Received - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[1] |RXHALT |Receive Halted - * | | |The RXHALT high indicates the next normal packet reception process will be halted because - * | | |the bit RXON of MCMDR is disabled be S/W. - * | | |0 = Next normal packet reception process will go on. - * | | |1 = Next normal packet reception process will be halted. - * |[2] |RXFFULL |RXFIFO Full - * | | |The RXFFULL indicates the RXFIFO is full due to four 64-byte packets are kept in RXFIFO - * | | |and the following incoming packet will be dropped. - * | | |0 = The RXFIFO is not full. - * | | |1 = The RXFIFO is full and the following incoming packet will be dropped. - * |[7:4] |COLCNT |Collision Count - * | | |The COLCNT indicates that how many collisions occurred consecutively during a packet transmission - * | | |If the packet incurred 16 consecutive collisions during transmission, the COLCNT will be - * | | |0 and bit TXABTIF will be set to 1. - * |[8] |DEF |Deferred Transmission - * | | |The DEF high indicates the packet transmission has deferred once - * | | |The DEF is only available while EMAC is operating on half-duplex mode. - * | | |0 = Packet transmission does not defer. - * | | |1 = Packet transmission has deferred once. - * |[9] |TXPAUSED |Transmission Paused - * | | |The TXPAUSED high indicates the next normal packet transmission process will be paused temporally - * | | |because EMAC received a PAUSE control frame. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be paused. - * |[10] |SQE |Signal Quality Error - * | | |The SQE high indicates the SQE error found at end of packet transmission on 10Mbps half-duplex mode - * | | |The SQE error check will only be done while both bit SQECHKEN (EMAC_CTL[17]) is enabled and EMAC - * | | |is operating on 10Mbps half-duplex mode. - * | | |0 = No SQE error found at end of packet transmission. - * | | |1 = SQE error found at end of packet transmission. - * |[11] |TXHALT |Transmission Halted - * | | |The TXHALT high indicates the next normal packet transmission process will be halted because - * | | |the bit TXON (EMAC_CTL[8]) is disabled be S/W. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be halted. - * |[12] |RPSTS |Remote Pause Status - * | | |The RPSTS indicates that remote pause counter down counting actives. - * | | |After Ethernet MAC controller sent PAUSE frame out successfully, it starts the remote pause - * | | |counter down counting - * | | |When this bit high, it's predictable that remote Ethernet MAC controller wouldn't start the packet - * | | |transmission until the down counting done. - * | | |0 = Remote pause counter down counting done. - * | | |1 = Remote pause counter down counting actives. - * @var EMAC_T::MPCNT - * Offset: 0xB8 Missed Packet Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MPCNT |Miss Packet Count - * | | |The MPCNT indicates the number of packets that were dropped due to various types of receive errors - * | | |The following type of receiving error makes missed packet counter increase: - * | | |1. Incoming packet is incurred RXFIFO overflow. - * | | |2. Incoming packet is dropped due to RXON is disabled. - * | | |3. Incoming packet is incurred CRC error. - * @var EMAC_T::RPCNT - * Offset: 0xBC MAC Receive Pause Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RPCNT |MAC Receive Pause Count - * | | |The RPCNT keeps the OPERAND field of the PAUSE control frame - * | | |It indicates how many slot time (512 bit time) the TX of EMAC will be paused. - * @var EMAC_T::FRSTS - * Offset: 0xC8 DMA Receive Frame Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXFLT |Receive Frame LENGTH - * | | |The RXFLT keeps the LENGTH field of each incoming Ethernet packet - * | | |If the bit DENIEN (EMAC_INTEN[9]) is enabled and the LENGTH field of incoming packet has - * | | |received, the bit DENIF (EMAC_INTSTS[9]) will be set and trigger interrupt. - * | | |And, the content of LENGTH field will be stored in RXFLT. - * @var EMAC_T::CTXDSA - * Offset: 0xCC Current Transmit Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXDSA |Current Transmit Descriptor Start Address - * | | |The CTXDSA keeps the start address of TX descriptor that is used by TXDMA currently - * | | |The CTXDSA is read only and write to this register has no effect. - * @var EMAC_T::CTXBSA - * Offset: 0xD0 Current Transmit Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXBSA |Current Transmit Buffer Start Address - * | | |The CTXDSA keeps the start address of TX frame buffer that is used by TXDMA currently - * | | |The CTXBSA is read only and write to this register has no effect. - * @var EMAC_T::CRXDSA - * Offset: 0xD4 Current Receive Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXDSA |Current Receive Descriptor Start Address - * | | |The CRXDSA keeps the start address of RX descriptor that is used by RXDMA currently - * | | |The CRXDSA is read only and write to this register has no effect. - * @var EMAC_T::CRXBSA - * Offset: 0xD8 Current Receive Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXBSA |Current Receive Buffer Start Address - * | | |The CRXBSA keeps the start address of RX frame buffer that is used by RXDMA currently - * | | |The CRXBSA is read only and write to this register has no effect. - * @var EMAC_T::TSCTL - * Offset: 0x100 Time Stamp Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TSEN |Time Stamp Function Enable Bit - * | | |This bit controls if the IEEE 1588 PTP time stamp function is enabled or not. - * | | |Set this bit high to enable IEEE 1588 PTP time stamp function while set this bit low - * | | |to disable IEEE 1588 PTP time stamp function. - * | | |0 = I EEE 1588 PTP time stamp function Disabled. - * | | |1 = IEEE 1588 PTP time stamp function Enabled. - * |[1] |TSIEN |Time Stamp Counter Initialization Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to load value of register EMAC_UPDSEC - * | | |and EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the load operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = Time stamp counter initialization done. - * | | |1 = Time stamp counter initialization Enabled. - * |[2] |TSMODE |Time Stamp Fine Update Enable Bit - * | | |This bit chooses the time stamp counter update mode. - * | | |0 = Time stamp counter is in coarse update mode. - * | | |1 = Time stamp counter is in fine update mode. - * |[3] |TSUPDATE |Time Stamp Counter Time Update Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to add value of register EMAC_UPDSEC and - * | | |EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the add operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = No action. - * | | |1 = EMAC_UPDSEC updated to EMAC_TSSEC and EMAC_UPDSUBSEC updated to EMAC_TSSUBSEC. - * |[5] |TSALMEN |Time Stamp Alarm Enable Bit - * | | |Set this bit high enable Ethernet MAC controller to set TSALMIF (EMAC_INTSTS[28]) high when - * | | |EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |0 = Alarm disabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |1 = Alarm enabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * @var EMAC_T::TSSEC - * Offset: 0x110 Time Stamp Counter Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second - * | | |This register reflects the bit [63:32] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSSUBSEC - * Offset: 0x114 Time Stamp Counter Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second - * | | |This register reflects the bit [31:0] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the sub-second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSINC - * Offset: 0x118 Time Stamp Increment Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNTINC |Time Stamp Counter Increment - * | | |Time stamp counter increment value. - * | | |If TSEN (EMAC_TSCTL[0]) is high, EMAC adds EMAC_TSSUBSEC with this 8-bit value every - * | | |time when it wants to increase the EMAC_TSSUBSEC value. - * @var EMAC_T::TSADDEND - * Offset: 0x11C Time Stamp Addend Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDEND |Time Stamp Counter Addend - * | | |This register keeps a 32-bit value for accumulator to enable increment of EMAC_TSSUBSEC. - * | | |If TSEN (EMAC_TSCTL[0]) and TSMODE (EMAC_TSCTL[2]) are both high, EMAC increases accumulator - * | | |with this 32-bit value in each HCLK - * | | |Once the accumulator is overflow, it generates a enable to increase EMAC_TSSUBSEC with an 8-bit - * | | |value kept in register EMAC_TSINC. - * @var EMAC_T::UPDSEC - * Offset: 0x120 Time Stamp Update Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSEC with this 32-bit value. - * @var EMAC_T::UPDSUBSEC - * Offset: 0x124 Time Stamp Update Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSUBSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSUBSEC with this 32-bit value. - * @var EMAC_T::ALMSEC - * Offset: 0x128 Time Stamp Alarm Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Alarm - * | | |Time stamp counter second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - * @var EMAC_T::ALMSUBSEC - * Offset: 0x12C Time Stamp Alarm Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Alarm - * | | |Time stamp counter sub-second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - */ - __IO uint32_t CAMCTL; /*!< [0x0000] CAM Comparison Control Register */ - __IO uint32_t CAMEN; /*!< [0x0004] CAM Enable Register */ - __IO uint32_t CAM0M; /*!< [0x0008] CAM0 Most Significant Word Register */ - __IO uint32_t CAM0L; /*!< [0x000c] CAM0 Least Significant Word Register */ - __IO uint32_t CAM1M; /*!< [0x0010] CAM1 Most Significant Word Register */ - __IO uint32_t CAM1L; /*!< [0x0014] CAM1 Least Significant Word Register */ - __IO uint32_t CAM2M; /*!< [0x0018] CAM2 Most Significant Word Register */ - __IO uint32_t CAM2L; /*!< [0x001c] CAM2 Least Significant Word Register */ - __IO uint32_t CAM3M; /*!< [0x0020] CAM3 Most Significant Word Register */ - __IO uint32_t CAM3L; /*!< [0x0024] CAM3 Least Significant Word Register */ - __IO uint32_t CAM4M; /*!< [0x0028] CAM4 Most Significant Word Register */ - __IO uint32_t CAM4L; /*!< [0x002c] CAM4 Least Significant Word Register */ - __IO uint32_t CAM5M; /*!< [0x0030] CAM5 Most Significant Word Register */ - __IO uint32_t CAM5L; /*!< [0x0034] CAM5 Least Significant Word Register */ - __IO uint32_t CAM6M; /*!< [0x0038] CAM6 Most Significant Word Register */ - __IO uint32_t CAM6L; /*!< [0x003c] CAM6 Least Significant Word Register */ - __IO uint32_t CAM7M; /*!< [0x0040] CAM7 Most Significant Word Register */ - __IO uint32_t CAM7L; /*!< [0x0044] CAM7 Least Significant Word Register */ - __IO uint32_t CAM8M; /*!< [0x0048] CAM8 Most Significant Word Register */ - __IO uint32_t CAM8L; /*!< [0x004c] CAM8 Least Significant Word Register */ - __IO uint32_t CAM9M; /*!< [0x0050] CAM9 Most Significant Word Register */ - __IO uint32_t CAM9L; /*!< [0x0054] CAM9 Least Significant Word Register */ - __IO uint32_t CAM10M; /*!< [0x0058] CAM10 Most Significant Word Register */ - __IO uint32_t CAM10L; /*!< [0x005c] CAM10 Least Significant Word Register */ - __IO uint32_t CAM11M; /*!< [0x0060] CAM11 Most Significant Word Register */ - __IO uint32_t CAM11L; /*!< [0x0064] CAM11 Least Significant Word Register */ - __IO uint32_t CAM12M; /*!< [0x0068] CAM12 Most Significant Word Register */ - __IO uint32_t CAM12L; /*!< [0x006c] CAM12 Least Significant Word Register */ - __IO uint32_t CAM13M; /*!< [0x0070] CAM13 Most Significant Word Register */ - __IO uint32_t CAM13L; /*!< [0x0074] CAM13 Least Significant Word Register */ - __IO uint32_t CAM14M; /*!< [0x0078] CAM14 Most Significant Word Register */ - __IO uint32_t CAM14L; /*!< [0x007c] CAM14 Least Significant Word Register */ - __IO uint32_t CAM15MSB; /*!< [0x0080] CAM15 Most Significant Word Register */ - __IO uint32_t CAM15LSB; /*!< [0x0084] CAM15 Least Significant Word Register */ - __IO uint32_t TXDSA; /*!< [0x0088] Transmit Descriptor Link List Start Address Register */ - __IO uint32_t RXDSA; /*!< [0x008c] Receive Descriptor Link List Start Address Register */ - __IO uint32_t CTL; /*!< [0x0090] MAC Control Register */ - __IO uint32_t MIIMDAT; /*!< [0x0094] MII Management Data Register */ - __IO uint32_t MIIMCTL; /*!< [0x0098] MII Management Control and Address Register */ - __IO uint32_t FIFOCTL; /*!< [0x009c] FIFO Threshold Control Register */ - __O uint32_t TXST; /*!< [0x00a0] Transmit Start Demand Register */ - __O uint32_t RXST; /*!< [0x00a4] Receive Start Demand Register */ - __IO uint32_t MRFL; /*!< [0x00a8] Maximum Receive Frame Control Register */ - __IO uint32_t INTEN; /*!< [0x00ac] MAC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x00b0] MAC Interrupt Status Register */ - __IO uint32_t GENSTS; /*!< [0x00b4] MAC General Status Register */ - __IO uint32_t MPCNT; /*!< [0x00b8] Missed Packet Count Register */ - __I uint32_t RPCNT; /*!< [0x00bc] MAC Receive Pause Count Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[2]; - /** @endcond */ - __IO uint32_t FRSTS; /*!< [0x00c8] DMA Receive Frame Status Register */ - __I uint32_t CTXDSA; /*!< [0x00cc] Current Transmit Descriptor Start Address Register */ - __I uint32_t CTXBSA; /*!< [0x00d0] Current Transmit Buffer Start Address Register */ - __I uint32_t CRXDSA; /*!< [0x00d4] Current Receive Descriptor Start Address Register */ - __I uint32_t CRXBSA; /*!< [0x00d8] Current Receive Buffer Start Address Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE1[9]; - /** @endcond */ - __IO uint32_t TSCTL; /*!< [0x0100] Time Stamp Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE2[3]; - /** @endcond */ - __I uint32_t TSSEC; /*!< [0x0110] Time Stamp Counter Second Register */ - __I uint32_t TSSUBSEC; /*!< [0x0114] Time Stamp Counter Sub Second Register */ - __IO uint32_t TSINC; /*!< [0x0118] Time Stamp Increment Register */ - __IO uint32_t TSADDEND; /*!< [0x011c] Time Stamp Addend Register */ - __IO uint32_t UPDSEC; /*!< [0x0120] Time Stamp Update Second Register */ - __IO uint32_t UPDSUBSEC; /*!< [0x0124] Time Stamp Update Sub Second Register */ - __IO uint32_t ALMSEC; /*!< [0x0128] Time Stamp Alarm Second Register */ - __IO uint32_t ALMSUBSEC; /*!< [0x012c] Time Stamp Alarm Sub Second Register */ - -} EMAC_T; - -/** - @addtogroup EMAC_CONST EMAC Bit Field Definition - Constant Definitions for EMAC Controller -@{ */ - -#define EMAC_CAMCTL_AUP_Pos (0) /*!< EMAC_T::CAMCTL: AUP Position */ -#define EMAC_CAMCTL_AUP_Msk (0x1ul << EMAC_CAMCTL_AUP_Pos) /*!< EMAC_T::CAMCTL: AUP Mask */ - -#define EMAC_CAMCTL_AMP_Pos (1) /*!< EMAC_T::CAMCTL: AMP Position */ -#define EMAC_CAMCTL_AMP_Msk (0x1ul << EMAC_CAMCTL_AMP_Pos) /*!< EMAC_T::CAMCTL: AMP Mask */ - -#define EMAC_CAMCTL_ABP_Pos (2) /*!< EMAC_T::CAMCTL: ABP Position */ -#define EMAC_CAMCTL_ABP_Msk (0x1ul << EMAC_CAMCTL_ABP_Pos) /*!< EMAC_T::CAMCTL: ABP Mask */ - -#define EMAC_CAMCTL_COMPEN_Pos (3) /*!< EMAC_T::CAMCTL: COMPEN Position */ -#define EMAC_CAMCTL_COMPEN_Msk (0x1ul << EMAC_CAMCTL_COMPEN_Pos) /*!< EMAC_T::CAMCTL: COMPEN Mask */ - -#define EMAC_CAMCTL_CMPEN_Pos (4) /*!< EMAC_T::CAMCTL: CMPEN Position */ -#define EMAC_CAMCTL_CMPEN_Msk (0x1ul << EMAC_CAMCTL_CMPEN_Pos) /*!< EMAC_T::CAMCTL: CMPEN Mask */ - -#define EMAC_CAMEN_CAMxEN_Pos (0) /*!< EMAC_T::CAMEN: CAMxEN Position */ -#define EMAC_CAMEN_CAMxEN_Msk (0x1ul << EMAC_CAMEN_CAMxEN_Pos) /*!< EMAC_T::CAMEN: CAMxEN Mask */ - -#define EMAC_CAM0M_MACADDR2_Pos (0) /*!< EMAC_T::CAM0M: MACADDR2 Position */ -#define EMAC_CAM0M_MACADDR2_Msk (0xfful << EMAC_CAM0M_MACADDR2_Pos) /*!< EMAC_T::CAM0M: MACADDR2 Mask */ - -#define EMAC_CAM0M_MACADDR3_Pos (8) /*!< EMAC_T::CAM0M: MACADDR3 Position */ -#define EMAC_CAM0M_MACADDR3_Msk (0xfful << EMAC_CAM0M_MACADDR3_Pos) /*!< EMAC_T::CAM0M: MACADDR3 Mask */ - -#define EMAC_CAM0M_MACADDR4_Pos (16) /*!< EMAC_T::CAM0M: MACADDR4 Position */ -#define EMAC_CAM0M_MACADDR4_Msk (0xfful << EMAC_CAM0M_MACADDR4_Pos) /*!< EMAC_T::CAM0M: MACADDR4 Mask */ - -#define EMAC_CAM0M_MACADDR5_Pos (24) /*!< EMAC_T::CAM0M: MACADDR5 Position */ -#define EMAC_CAM0M_MACADDR5_Msk (0xfful << EMAC_CAM0M_MACADDR5_Pos) /*!< EMAC_T::CAM0M: MACADDR5 Mask */ - -#define EMAC_CAM0L_MACADDR0_Pos (16) /*!< EMAC_T::CAM0L: MACADDR0 Position */ -#define EMAC_CAM0L_MACADDR0_Msk (0xfful << EMAC_CAM0L_MACADDR0_Pos) /*!< EMAC_T::CAM0L: MACADDR0 Mask */ - -#define EMAC_CAM0L_MACADDR1_Pos (24) /*!< EMAC_T::CAM0L: MACADDR1 Position */ -#define EMAC_CAM0L_MACADDR1_Msk (0xfful << EMAC_CAM0L_MACADDR1_Pos) /*!< EMAC_T::CAM0L: MACADDR1 Mask */ - -#define EMAC_CAM1M_MACADDR2_Pos (0) /*!< EMAC_T::CAM1M: MACADDR2 Position */ -#define EMAC_CAM1M_MACADDR2_Msk (0xfful << EMAC_CAM1M_MACADDR2_Pos) /*!< EMAC_T::CAM1M: MACADDR2 Mask */ - -#define EMAC_CAM1M_MACADDR3_Pos (8) /*!< EMAC_T::CAM1M: MACADDR3 Position */ -#define EMAC_CAM1M_MACADDR3_Msk (0xfful << EMAC_CAM1M_MACADDR3_Pos) /*!< EMAC_T::CAM1M: MACADDR3 Mask */ - -#define EMAC_CAM1M_MACADDR4_Pos (16) /*!< EMAC_T::CAM1M: MACADDR4 Position */ -#define EMAC_CAM1M_MACADDR4_Msk (0xfful << EMAC_CAM1M_MACADDR4_Pos) /*!< EMAC_T::CAM1M: MACADDR4 Mask */ - -#define EMAC_CAM1M_MACADDR5_Pos (24) /*!< EMAC_T::CAM1M: MACADDR5 Position */ -#define EMAC_CAM1M_MACADDR5_Msk (0xfful << EMAC_CAM1M_MACADDR5_Pos) /*!< EMAC_T::CAM1M: MACADDR5 Mask */ - -#define EMAC_CAM1L_MACADDR0_Pos (16) /*!< EMAC_T::CAM1L: MACADDR0 Position */ -#define EMAC_CAM1L_MACADDR0_Msk (0xfful << EMAC_CAM1L_MACADDR0_Pos) /*!< EMAC_T::CAM1L: MACADDR0 Mask */ - -#define EMAC_CAM1L_MACADDR1_Pos (24) /*!< EMAC_T::CAM1L: MACADDR1 Position */ -#define EMAC_CAM1L_MACADDR1_Msk (0xfful << EMAC_CAM1L_MACADDR1_Pos) /*!< EMAC_T::CAM1L: MACADDR1 Mask */ - -#define EMAC_CAM2M_MACADDR2_Pos (0) /*!< EMAC_T::CAM2M: MACADDR2 Position */ -#define EMAC_CAM2M_MACADDR2_Msk (0xfful << EMAC_CAM2M_MACADDR2_Pos) /*!< EMAC_T::CAM2M: MACADDR2 Mask */ - -#define EMAC_CAM2M_MACADDR3_Pos (8) /*!< EMAC_T::CAM2M: MACADDR3 Position */ -#define EMAC_CAM2M_MACADDR3_Msk (0xfful << EMAC_CAM2M_MACADDR3_Pos) /*!< EMAC_T::CAM2M: MACADDR3 Mask */ - -#define EMAC_CAM2M_MACADDR4_Pos (16) /*!< EMAC_T::CAM2M: MACADDR4 Position */ -#define EMAC_CAM2M_MACADDR4_Msk (0xfful << EMAC_CAM2M_MACADDR4_Pos) /*!< EMAC_T::CAM2M: MACADDR4 Mask */ - -#define EMAC_CAM2M_MACADDR5_Pos (24) /*!< EMAC_T::CAM2M: MACADDR5 Position */ -#define EMAC_CAM2M_MACADDR5_Msk (0xfful << EMAC_CAM2M_MACADDR5_Pos) /*!< EMAC_T::CAM2M: MACADDR5 Mask */ - -#define EMAC_CAM2L_MACADDR0_Pos (16) /*!< EMAC_T::CAM2L: MACADDR0 Position */ -#define EMAC_CAM2L_MACADDR0_Msk (0xfful << EMAC_CAM2L_MACADDR0_Pos) /*!< EMAC_T::CAM2L: MACADDR0 Mask */ - -#define EMAC_CAM2L_MACADDR1_Pos (24) /*!< EMAC_T::CAM2L: MACADDR1 Position */ -#define EMAC_CAM2L_MACADDR1_Msk (0xfful << EMAC_CAM2L_MACADDR1_Pos) /*!< EMAC_T::CAM2L: MACADDR1 Mask */ - -#define EMAC_CAM3M_MACADDR2_Pos (0) /*!< EMAC_T::CAM3M: MACADDR2 Position */ -#define EMAC_CAM3M_MACADDR2_Msk (0xfful << EMAC_CAM3M_MACADDR2_Pos) /*!< EMAC_T::CAM3M: MACADDR2 Mask */ - -#define EMAC_CAM3M_MACADDR3_Pos (8) /*!< EMAC_T::CAM3M: MACADDR3 Position */ -#define EMAC_CAM3M_MACADDR3_Msk (0xfful << EMAC_CAM3M_MACADDR3_Pos) /*!< EMAC_T::CAM3M: MACADDR3 Mask */ - -#define EMAC_CAM3M_MACADDR4_Pos (16) /*!< EMAC_T::CAM3M: MACADDR4 Position */ -#define EMAC_CAM3M_MACADDR4_Msk (0xfful << EMAC_CAM3M_MACADDR4_Pos) /*!< EMAC_T::CAM3M: MACADDR4 Mask */ - -#define EMAC_CAM3M_MACADDR5_Pos (24) /*!< EMAC_T::CAM3M: MACADDR5 Position */ -#define EMAC_CAM3M_MACADDR5_Msk (0xfful << EMAC_CAM3M_MACADDR5_Pos) /*!< EMAC_T::CAM3M: MACADDR5 Mask */ - -#define EMAC_CAM3L_MACADDR0_Pos (16) /*!< EMAC_T::CAM3L: MACADDR0 Position */ -#define EMAC_CAM3L_MACADDR0_Msk (0xfful << EMAC_CAM3L_MACADDR0_Pos) /*!< EMAC_T::CAM3L: MACADDR0 Mask */ - -#define EMAC_CAM3L_MACADDR1_Pos (24) /*!< EMAC_T::CAM3L: MACADDR1 Position */ -#define EMAC_CAM3L_MACADDR1_Msk (0xfful << EMAC_CAM3L_MACADDR1_Pos) /*!< EMAC_T::CAM3L: MACADDR1 Mask */ - -#define EMAC_CAM4M_MACADDR2_Pos (0) /*!< EMAC_T::CAM4M: MACADDR2 Position */ -#define EMAC_CAM4M_MACADDR2_Msk (0xfful << EMAC_CAM4M_MACADDR2_Pos) /*!< EMAC_T::CAM4M: MACADDR2 Mask */ - -#define EMAC_CAM4M_MACADDR3_Pos (8) /*!< EMAC_T::CAM4M: MACADDR3 Position */ -#define EMAC_CAM4M_MACADDR3_Msk (0xfful << EMAC_CAM4M_MACADDR3_Pos) /*!< EMAC_T::CAM4M: MACADDR3 Mask */ - -#define EMAC_CAM4M_MACADDR4_Pos (16) /*!< EMAC_T::CAM4M: MACADDR4 Position */ -#define EMAC_CAM4M_MACADDR4_Msk (0xfful << EMAC_CAM4M_MACADDR4_Pos) /*!< EMAC_T::CAM4M: MACADDR4 Mask */ - -#define EMAC_CAM4M_MACADDR5_Pos (24) /*!< EMAC_T::CAM4M: MACADDR5 Position */ -#define EMAC_CAM4M_MACADDR5_Msk (0xfful << EMAC_CAM4M_MACADDR5_Pos) /*!< EMAC_T::CAM4M: MACADDR5 Mask */ - -#define EMAC_CAM4L_MACADDR0_Pos (16) /*!< EMAC_T::CAM4L: MACADDR0 Position */ -#define EMAC_CAM4L_MACADDR0_Msk (0xfful << EMAC_CAM4L_MACADDR0_Pos) /*!< EMAC_T::CAM4L: MACADDR0 Mask */ - -#define EMAC_CAM4L_MACADDR1_Pos (24) /*!< EMAC_T::CAM4L: MACADDR1 Position */ -#define EMAC_CAM4L_MACADDR1_Msk (0xfful << EMAC_CAM4L_MACADDR1_Pos) /*!< EMAC_T::CAM4L: MACADDR1 Mask */ - -#define EMAC_CAM5M_MACADDR2_Pos (0) /*!< EMAC_T::CAM5M: MACADDR2 Position */ -#define EMAC_CAM5M_MACADDR2_Msk (0xfful << EMAC_CAM5M_MACADDR2_Pos) /*!< EMAC_T::CAM5M: MACADDR2 Mask */ - -#define EMAC_CAM5M_MACADDR3_Pos (8) /*!< EMAC_T::CAM5M: MACADDR3 Position */ -#define EMAC_CAM5M_MACADDR3_Msk (0xfful << EMAC_CAM5M_MACADDR3_Pos) /*!< EMAC_T::CAM5M: MACADDR3 Mask */ - -#define EMAC_CAM5M_MACADDR4_Pos (16) /*!< EMAC_T::CAM5M: MACADDR4 Position */ -#define EMAC_CAM5M_MACADDR4_Msk (0xfful << EMAC_CAM5M_MACADDR4_Pos) /*!< EMAC_T::CAM5M: MACADDR4 Mask */ - -#define EMAC_CAM5M_MACADDR5_Pos (24) /*!< EMAC_T::CAM5M: MACADDR5 Position */ -#define EMAC_CAM5M_MACADDR5_Msk (0xfful << EMAC_CAM5M_MACADDR5_Pos) /*!< EMAC_T::CAM5M: MACADDR5 Mask */ - -#define EMAC_CAM5L_MACADDR0_Pos (16) /*!< EMAC_T::CAM5L: MACADDR0 Position */ -#define EMAC_CAM5L_MACADDR0_Msk (0xfful << EMAC_CAM5L_MACADDR0_Pos) /*!< EMAC_T::CAM5L: MACADDR0 Mask */ - -#define EMAC_CAM5L_MACADDR1_Pos (24) /*!< EMAC_T::CAM5L: MACADDR1 Position */ -#define EMAC_CAM5L_MACADDR1_Msk (0xfful << EMAC_CAM5L_MACADDR1_Pos) /*!< EMAC_T::CAM5L: MACADDR1 Mask */ - -#define EMAC_CAM6M_MACADDR2_Pos (0) /*!< EMAC_T::CAM6M: MACADDR2 Position */ -#define EMAC_CAM6M_MACADDR2_Msk (0xfful << EMAC_CAM6M_MACADDR2_Pos) /*!< EMAC_T::CAM6M: MACADDR2 Mask */ - -#define EMAC_CAM6M_MACADDR3_Pos (8) /*!< EMAC_T::CAM6M: MACADDR3 Position */ -#define EMAC_CAM6M_MACADDR3_Msk (0xfful << EMAC_CAM6M_MACADDR3_Pos) /*!< EMAC_T::CAM6M: MACADDR3 Mask */ - -#define EMAC_CAM6M_MACADDR4_Pos (16) /*!< EMAC_T::CAM6M: MACADDR4 Position */ -#define EMAC_CAM6M_MACADDR4_Msk (0xfful << EMAC_CAM6M_MACADDR4_Pos) /*!< EMAC_T::CAM6M: MACADDR4 Mask */ - -#define EMAC_CAM6M_MACADDR5_Pos (24) /*!< EMAC_T::CAM6M: MACADDR5 Position */ -#define EMAC_CAM6M_MACADDR5_Msk (0xfful << EMAC_CAM6M_MACADDR5_Pos) /*!< EMAC_T::CAM6M: MACADDR5 Mask */ - -#define EMAC_CAM6L_MACADDR0_Pos (16) /*!< EMAC_T::CAM6L: MACADDR0 Position */ -#define EMAC_CAM6L_MACADDR0_Msk (0xfful << EMAC_CAM6L_MACADDR0_Pos) /*!< EMAC_T::CAM6L: MACADDR0 Mask */ - -#define EMAC_CAM6L_MACADDR1_Pos (24) /*!< EMAC_T::CAM6L: MACADDR1 Position */ -#define EMAC_CAM6L_MACADDR1_Msk (0xfful << EMAC_CAM6L_MACADDR1_Pos) /*!< EMAC_T::CAM6L: MACADDR1 Mask */ - -#define EMAC_CAM7M_MACADDR2_Pos (0) /*!< EMAC_T::CAM7M: MACADDR2 Position */ -#define EMAC_CAM7M_MACADDR2_Msk (0xfful << EMAC_CAM7M_MACADDR2_Pos) /*!< EMAC_T::CAM7M: MACADDR2 Mask */ - -#define EMAC_CAM7M_MACADDR3_Pos (8) /*!< EMAC_T::CAM7M: MACADDR3 Position */ -#define EMAC_CAM7M_MACADDR3_Msk (0xfful << EMAC_CAM7M_MACADDR3_Pos) /*!< EMAC_T::CAM7M: MACADDR3 Mask */ - -#define EMAC_CAM7M_MACADDR4_Pos (16) /*!< EMAC_T::CAM7M: MACADDR4 Position */ -#define EMAC_CAM7M_MACADDR4_Msk (0xfful << EMAC_CAM7M_MACADDR4_Pos) /*!< EMAC_T::CAM7M: MACADDR4 Mask */ - -#define EMAC_CAM7M_MACADDR5_Pos (24) /*!< EMAC_T::CAM7M: MACADDR5 Position */ -#define EMAC_CAM7M_MACADDR5_Msk (0xfful << EMAC_CAM7M_MACADDR5_Pos) /*!< EMAC_T::CAM7M: MACADDR5 Mask */ - -#define EMAC_CAM7L_MACADDR0_Pos (16) /*!< EMAC_T::CAM7L: MACADDR0 Position */ -#define EMAC_CAM7L_MACADDR0_Msk (0xfful << EMAC_CAM7L_MACADDR0_Pos) /*!< EMAC_T::CAM7L: MACADDR0 Mask */ - -#define EMAC_CAM7L_MACADDR1_Pos (24) /*!< EMAC_T::CAM7L: MACADDR1 Position */ -#define EMAC_CAM7L_MACADDR1_Msk (0xfful << EMAC_CAM7L_MACADDR1_Pos) /*!< EMAC_T::CAM7L: MACADDR1 Mask */ - -#define EMAC_CAM8M_MACADDR2_Pos (0) /*!< EMAC_T::CAM8M: MACADDR2 Position */ -#define EMAC_CAM8M_MACADDR2_Msk (0xfful << EMAC_CAM8M_MACADDR2_Pos) /*!< EMAC_T::CAM8M: MACADDR2 Mask */ - -#define EMAC_CAM8M_MACADDR3_Pos (8) /*!< EMAC_T::CAM8M: MACADDR3 Position */ -#define EMAC_CAM8M_MACADDR3_Msk (0xfful << EMAC_CAM8M_MACADDR3_Pos) /*!< EMAC_T::CAM8M: MACADDR3 Mask */ - -#define EMAC_CAM8M_MACADDR4_Pos (16) /*!< EMAC_T::CAM8M: MACADDR4 Position */ -#define EMAC_CAM8M_MACADDR4_Msk (0xfful << EMAC_CAM8M_MACADDR4_Pos) /*!< EMAC_T::CAM8M: MACADDR4 Mask */ - -#define EMAC_CAM8M_MACADDR5_Pos (24) /*!< EMAC_T::CAM8M: MACADDR5 Position */ -#define EMAC_CAM8M_MACADDR5_Msk (0xfful << EMAC_CAM8M_MACADDR5_Pos) /*!< EMAC_T::CAM8M: MACADDR5 Mask */ - -#define EMAC_CAM8L_MACADDR0_Pos (16) /*!< EMAC_T::CAM8L: MACADDR0 Position */ -#define EMAC_CAM8L_MACADDR0_Msk (0xfful << EMAC_CAM8L_MACADDR0_Pos) /*!< EMAC_T::CAM8L: MACADDR0 Mask */ - -#define EMAC_CAM8L_MACADDR1_Pos (24) /*!< EMAC_T::CAM8L: MACADDR1 Position */ -#define EMAC_CAM8L_MACADDR1_Msk (0xfful << EMAC_CAM8L_MACADDR1_Pos) /*!< EMAC_T::CAM8L: MACADDR1 Mask */ - -#define EMAC_CAM9M_MACADDR2_Pos (0) /*!< EMAC_T::CAM9M: MACADDR2 Position */ -#define EMAC_CAM9M_MACADDR2_Msk (0xfful << EMAC_CAM9M_MACADDR2_Pos) /*!< EMAC_T::CAM9M: MACADDR2 Mask */ - -#define EMAC_CAM9M_MACADDR3_Pos (8) /*!< EMAC_T::CAM9M: MACADDR3 Position */ -#define EMAC_CAM9M_MACADDR3_Msk (0xfful << EMAC_CAM9M_MACADDR3_Pos) /*!< EMAC_T::CAM9M: MACADDR3 Mask */ - -#define EMAC_CAM9M_MACADDR4_Pos (16) /*!< EMAC_T::CAM9M: MACADDR4 Position */ -#define EMAC_CAM9M_MACADDR4_Msk (0xfful << EMAC_CAM9M_MACADDR4_Pos) /*!< EMAC_T::CAM9M: MACADDR4 Mask */ - -#define EMAC_CAM9M_MACADDR5_Pos (24) /*!< EMAC_T::CAM9M: MACADDR5 Position */ -#define EMAC_CAM9M_MACADDR5_Msk (0xfful << EMAC_CAM9M_MACADDR5_Pos) /*!< EMAC_T::CAM9M: MACADDR5 Mask */ - -#define EMAC_CAM9L_MACADDR0_Pos (16) /*!< EMAC_T::CAM9L: MACADDR0 Position */ -#define EMAC_CAM9L_MACADDR0_Msk (0xfful << EMAC_CAM9L_MACADDR0_Pos) /*!< EMAC_T::CAM9L: MACADDR0 Mask */ - -#define EMAC_CAM9L_MACADDR1_Pos (24) /*!< EMAC_T::CAM9L: MACADDR1 Position */ -#define EMAC_CAM9L_MACADDR1_Msk (0xfful << EMAC_CAM9L_MACADDR1_Pos) /*!< EMAC_T::CAM9L: MACADDR1 Mask */ - -#define EMAC_CAM10M_MACADDR2_Pos (0) /*!< EMAC_T::CAM10M: MACADDR2 Position */ -#define EMAC_CAM10M_MACADDR2_Msk (0xfful << EMAC_CAM10M_MACADDR2_Pos) /*!< EMAC_T::CAM10M: MACADDR2 Mask */ - -#define EMAC_CAM10M_MACADDR3_Pos (8) /*!< EMAC_T::CAM10M: MACADDR3 Position */ -#define EMAC_CAM10M_MACADDR3_Msk (0xfful << EMAC_CAM10M_MACADDR3_Pos) /*!< EMAC_T::CAM10M: MACADDR3 Mask */ - -#define EMAC_CAM10M_MACADDR4_Pos (16) /*!< EMAC_T::CAM10M: MACADDR4 Position */ -#define EMAC_CAM10M_MACADDR4_Msk (0xfful << EMAC_CAM10M_MACADDR4_Pos) /*!< EMAC_T::CAM10M: MACADDR4 Mask */ - -#define EMAC_CAM10M_MACADDR5_Pos (24) /*!< EMAC_T::CAM10M: MACADDR5 Position */ -#define EMAC_CAM10M_MACADDR5_Msk (0xfful << EMAC_CAM10M_MACADDR5_Pos) /*!< EMAC_T::CAM10M: MACADDR5 Mask */ - -#define EMAC_CAM10L_MACADDR0_Pos (16) /*!< EMAC_T::CAM10L: MACADDR0 Position */ -#define EMAC_CAM10L_MACADDR0_Msk (0xfful << EMAC_CAM10L_MACADDR0_Pos) /*!< EMAC_T::CAM10L: MACADDR0 Mask */ - -#define EMAC_CAM10L_MACADDR1_Pos (24) /*!< EMAC_T::CAM10L: MACADDR1 Position */ -#define EMAC_CAM10L_MACADDR1_Msk (0xfful << EMAC_CAM10L_MACADDR1_Pos) /*!< EMAC_T::CAM10L: MACADDR1 Mask */ - -#define EMAC_CAM11M_MACADDR2_Pos (0) /*!< EMAC_T::CAM11M: MACADDR2 Position */ -#define EMAC_CAM11M_MACADDR2_Msk (0xfful << EMAC_CAM11M_MACADDR2_Pos) /*!< EMAC_T::CAM11M: MACADDR2 Mask */ - -#define EMAC_CAM11M_MACADDR3_Pos (8) /*!< EMAC_T::CAM11M: MACADDR3 Position */ -#define EMAC_CAM11M_MACADDR3_Msk (0xfful << EMAC_CAM11M_MACADDR3_Pos) /*!< EMAC_T::CAM11M: MACADDR3 Mask */ - -#define EMAC_CAM11M_MACADDR4_Pos (16) /*!< EMAC_T::CAM11M: MACADDR4 Position */ -#define EMAC_CAM11M_MACADDR4_Msk (0xfful << EMAC_CAM11M_MACADDR4_Pos) /*!< EMAC_T::CAM11M: MACADDR4 Mask */ - -#define EMAC_CAM11M_MACADDR5_Pos (24) /*!< EMAC_T::CAM11M: MACADDR5 Position */ -#define EMAC_CAM11M_MACADDR5_Msk (0xfful << EMAC_CAM11M_MACADDR5_Pos) /*!< EMAC_T::CAM11M: MACADDR5 Mask */ - -#define EMAC_CAM11L_MACADDR0_Pos (16) /*!< EMAC_T::CAM11L: MACADDR0 Position */ -#define EMAC_CAM11L_MACADDR0_Msk (0xfful << EMAC_CAM11L_MACADDR0_Pos) /*!< EMAC_T::CAM11L: MACADDR0 Mask */ - -#define EMAC_CAM11L_MACADDR1_Pos (24) /*!< EMAC_T::CAM11L: MACADDR1 Position */ -#define EMAC_CAM11L_MACADDR1_Msk (0xfful << EMAC_CAM11L_MACADDR1_Pos) /*!< EMAC_T::CAM11L: MACADDR1 Mask */ - -#define EMAC_CAM12M_MACADDR2_Pos (0) /*!< EMAC_T::CAM12M: MACADDR2 Position */ -#define EMAC_CAM12M_MACADDR2_Msk (0xfful << EMAC_CAM12M_MACADDR2_Pos) /*!< EMAC_T::CAM12M: MACADDR2 Mask */ - -#define EMAC_CAM12M_MACADDR3_Pos (8) /*!< EMAC_T::CAM12M: MACADDR3 Position */ -#define EMAC_CAM12M_MACADDR3_Msk (0xfful << EMAC_CAM12M_MACADDR3_Pos) /*!< EMAC_T::CAM12M: MACADDR3 Mask */ - -#define EMAC_CAM12M_MACADDR4_Pos (16) /*!< EMAC_T::CAM12M: MACADDR4 Position */ -#define EMAC_CAM12M_MACADDR4_Msk (0xfful << EMAC_CAM12M_MACADDR4_Pos) /*!< EMAC_T::CAM12M: MACADDR4 Mask */ - -#define EMAC_CAM12M_MACADDR5_Pos (24) /*!< EMAC_T::CAM12M: MACADDR5 Position */ -#define EMAC_CAM12M_MACADDR5_Msk (0xfful << EMAC_CAM12M_MACADDR5_Pos) /*!< EMAC_T::CAM12M: MACADDR5 Mask */ - -#define EMAC_CAM12L_MACADDR0_Pos (16) /*!< EMAC_T::CAM12L: MACADDR0 Position */ -#define EMAC_CAM12L_MACADDR0_Msk (0xfful << EMAC_CAM12L_MACADDR0_Pos) /*!< EMAC_T::CAM12L: MACADDR0 Mask */ - -#define EMAC_CAM12L_MACADDR1_Pos (24) /*!< EMAC_T::CAM12L: MACADDR1 Position */ -#define EMAC_CAM12L_MACADDR1_Msk (0xfful << EMAC_CAM12L_MACADDR1_Pos) /*!< EMAC_T::CAM12L: MACADDR1 Mask */ - -#define EMAC_CAM13M_MACADDR2_Pos (0) /*!< EMAC_T::CAM13M: MACADDR2 Position */ -#define EMAC_CAM13M_MACADDR2_Msk (0xfful << EMAC_CAM13M_MACADDR2_Pos) /*!< EMAC_T::CAM13M: MACADDR2 Mask */ - -#define EMAC_CAM13M_MACADDR3_Pos (8) /*!< EMAC_T::CAM13M: MACADDR3 Position */ -#define EMAC_CAM13M_MACADDR3_Msk (0xfful << EMAC_CAM13M_MACADDR3_Pos) /*!< EMAC_T::CAM13M: MACADDR3 Mask */ - -#define EMAC_CAM13M_MACADDR4_Pos (16) /*!< EMAC_T::CAM13M: MACADDR4 Position */ -#define EMAC_CAM13M_MACADDR4_Msk (0xfful << EMAC_CAM13M_MACADDR4_Pos) /*!< EMAC_T::CAM13M: MACADDR4 Mask */ - -#define EMAC_CAM13M_MACADDR5_Pos (24) /*!< EMAC_T::CAM13M: MACADDR5 Position */ -#define EMAC_CAM13M_MACADDR5_Msk (0xfful << EMAC_CAM13M_MACADDR5_Pos) /*!< EMAC_T::CAM13M: MACADDR5 Mask */ - -#define EMAC_CAM13L_MACADDR0_Pos (16) /*!< EMAC_T::CAM13L: MACADDR0 Position */ -#define EMAC_CAM13L_MACADDR0_Msk (0xfful << EMAC_CAM13L_MACADDR0_Pos) /*!< EMAC_T::CAM13L: MACADDR0 Mask */ - -#define EMAC_CAM13L_MACADDR1_Pos (24) /*!< EMAC_T::CAM13L: MACADDR1 Position */ -#define EMAC_CAM13L_MACADDR1_Msk (0xfful << EMAC_CAM13L_MACADDR1_Pos) /*!< EMAC_T::CAM13L: MACADDR1 Mask */ - -#define EMAC_CAM14M_MACADDR2_Pos (0) /*!< EMAC_T::CAM14M: MACADDR2 Position */ -#define EMAC_CAM14M_MACADDR2_Msk (0xfful << EMAC_CAM14M_MACADDR2_Pos) /*!< EMAC_T::CAM14M: MACADDR2 Mask */ - -#define EMAC_CAM14M_MACADDR3_Pos (8) /*!< EMAC_T::CAM14M: MACADDR3 Position */ -#define EMAC_CAM14M_MACADDR3_Msk (0xfful << EMAC_CAM14M_MACADDR3_Pos) /*!< EMAC_T::CAM14M: MACADDR3 Mask */ - -#define EMAC_CAM14M_MACADDR4_Pos (16) /*!< EMAC_T::CAM14M: MACADDR4 Position */ -#define EMAC_CAM14M_MACADDR4_Msk (0xfful << EMAC_CAM14M_MACADDR4_Pos) /*!< EMAC_T::CAM14M: MACADDR4 Mask */ - -#define EMAC_CAM14M_MACADDR5_Pos (24) /*!< EMAC_T::CAM14M: MACADDR5 Position */ -#define EMAC_CAM14M_MACADDR5_Msk (0xfful << EMAC_CAM14M_MACADDR5_Pos) /*!< EMAC_T::CAM14M: MACADDR5 Mask */ - -#define EMAC_CAM14L_MACADDR0_Pos (16) /*!< EMAC_T::CAM14L: MACADDR0 Position */ -#define EMAC_CAM14L_MACADDR0_Msk (0xfful << EMAC_CAM14L_MACADDR0_Pos) /*!< EMAC_T::CAM14L: MACADDR0 Mask */ - -#define EMAC_CAM14L_MACADDR1_Pos (24) /*!< EMAC_T::CAM14L: MACADDR1 Position */ -#define EMAC_CAM14L_MACADDR1_Msk (0xfful << EMAC_CAM14L_MACADDR1_Pos) /*!< EMAC_T::CAM14L: MACADDR1 Mask */ - -#define EMAC_CAM15MSB_OPCODE_Pos (0) /*!< EMAC_T::CAM15MSB: OPCODE Position */ -#define EMAC_CAM15MSB_OPCODE_Msk (0xfffful << EMAC_CAM15MSB_OPCODE_Pos) /*!< EMAC_T::CAM15MSB: OPCODE Mask */ - -#define EMAC_CAM15MSB_LENGTH_Pos (16) /*!< EMAC_T::CAM15MSB: LENGTH Position */ -#define EMAC_CAM15MSB_LENGTH_Msk (0xfffful << EMAC_CAM15MSB_LENGTH_Pos) /*!< EMAC_T::CAM15MSB: LENGTH Mask */ - -#define EMAC_CAM15LSB_OPERAND_Pos (24) /*!< EMAC_T::CAM15LSB: OPERAND Position */ -#define EMAC_CAM15LSB_OPERAND_Msk (0xfful << EMAC_CAM15LSB_OPERAND_Pos) /*!< EMAC_T::CAM15LSB: OPERAND Mask */ - -#define EMAC_TXDSA_TXDSA_Pos (0) /*!< EMAC_T::TXDSA: TXDSA Position */ -#define EMAC_TXDSA_TXDSA_Msk (0xfffffffful << EMAC_TXDSA_TXDSA_Pos) /*!< EMAC_T::TXDSA: TXDSA Mask */ - -#define EMAC_RXDSA_RXDSA_Pos (0) /*!< EMAC_T::RXDSA: RXDSA Position */ -#define EMAC_RXDSA_RXDSA_Msk (0xfffffffful << EMAC_RXDSA_RXDSA_Pos) /*!< EMAC_T::RXDSA: RXDSA Mask */ - -#define EMAC_CTL_RXON_Pos (0) /*!< EMAC_T::CTL: RXON Position */ -#define EMAC_CTL_RXON_Msk (0x1ul << EMAC_CTL_RXON_Pos) /*!< EMAC_T::CTL: RXON Mask */ - -#define EMAC_CTL_ALP_Pos (1) /*!< EMAC_T::CTL: ALP Position */ -#define EMAC_CTL_ALP_Msk (0x1ul << EMAC_CTL_ALP_Pos) /*!< EMAC_T::CTL: ALP Mask */ - -#define EMAC_CTL_ARP_Pos (2) /*!< EMAC_T::CTL: ARP Position */ -#define EMAC_CTL_ARP_Msk (0x1ul << EMAC_CTL_ARP_Pos) /*!< EMAC_T::CTL: ARP Mask */ - -#define EMAC_CTL_ACP_Pos (3) /*!< EMAC_T::CTL: ACP Position */ -#define EMAC_CTL_ACP_Msk (0x1ul << EMAC_CTL_ACP_Pos) /*!< EMAC_T::CTL: ACP Mask */ - -#define EMAC_CTL_AEP_Pos (4) /*!< EMAC_T::CTL: AEP Position */ -#define EMAC_CTL_AEP_Msk (0x1ul << EMAC_CTL_AEP_Pos) /*!< EMAC_T::CTL: AEP Mask */ - -#define EMAC_CTL_STRIPCRC_Pos (5) /*!< EMAC_T::CTL: STRIPCRC Position */ -#define EMAC_CTL_STRIPCRC_Msk (0x1ul << EMAC_CTL_STRIPCRC_Pos) /*!< EMAC_T::CTL: STRIPCRC Mask */ - -#define EMAC_CTL_WOLEN_Pos (6) /*!< EMAC_T::CTL: WOLEN Position */ -#define EMAC_CTL_WOLEN_Msk (0x1ul << EMAC_CTL_WOLEN_Pos) /*!< EMAC_T::CTL: WOLEN Mask */ - -#define EMAC_CTL_TXON_Pos (8) /*!< EMAC_T::CTL: TXON Position */ -#define EMAC_CTL_TXON_Msk (0x1ul << EMAC_CTL_TXON_Pos) /*!< EMAC_T::CTL: TXON Mask */ - -#define EMAC_CTL_NODEF_Pos (9) /*!< EMAC_T::CTL: NODEF Position */ -#define EMAC_CTL_NODEF_Msk (0x1ul << EMAC_CTL_NODEF_Pos) /*!< EMAC_T::CTL: NODEF Mask */ - -#define EMAC_CTL_SDPZ_Pos (16) /*!< EMAC_T::CTL: SDPZ Position */ -#define EMAC_CTL_SDPZ_Msk (0x1ul << EMAC_CTL_SDPZ_Pos) /*!< EMAC_T::CTL: SDPZ Mask */ - -#define EMAC_CTL_SQECHKEN_Pos (17) /*!< EMAC_T::CTL: SQECHKEN Position */ -#define EMAC_CTL_SQECHKEN_Msk (0x1ul << EMAC_CTL_SQECHKEN_Pos) /*!< EMAC_T::CTL: SQECHKEN Mask */ - -#define EMAC_CTL_FUDUP_Pos (18) /*!< EMAC_T::CTL: FUDUP Position */ -#define EMAC_CTL_FUDUP_Msk (0x1ul << EMAC_CTL_FUDUP_Pos) /*!< EMAC_T::CTL: FUDUP Mask */ - -#define EMAC_CTL_RMIIRXCTL_Pos (19) /*!< EMAC_T::CTL: RMIIRXCTL Position */ -#define EMAC_CTL_RMIIRXCTL_Msk (0x1ul << EMAC_CTL_RMIIRXCTL_Pos) /*!< EMAC_T::CTL: RMIIRXCTL Mask */ - -#define EMAC_CTL_OPMODE_Pos (20) /*!< EMAC_T::CTL: OPMODE Position */ -#define EMAC_CTL_OPMODE_Msk (0x1ul << EMAC_CTL_OPMODE_Pos) /*!< EMAC_T::CTL: OPMODE Mask */ - -#define EMAC_CTL_RMIIEN_Pos (22) /*!< EMAC_T::CTL: RMIIEN Position */ -#define EMAC_CTL_RMIIEN_Msk (0x1ul << EMAC_CTL_RMIIEN_Pos) /*!< EMAC_T::CTL: RMIIEN Mask */ - -#define EMAC_CTL_RST_Pos (24) /*!< EMAC_T::CTL: RST Position */ -#define EMAC_CTL_RST_Msk (0x1ul << EMAC_CTL_RST_Pos) /*!< EMAC_T::CTL: RST Mask */ - -#define EMAC_MIIMDAT_DATA_Pos (0) /*!< EMAC_T::MIIMDAT: DATA Position */ -#define EMAC_MIIMDAT_DATA_Msk (0xfffful << EMAC_MIIMDAT_DATA_Pos) /*!< EMAC_T::MIIMDAT: DATA Mask */ - -#define EMAC_MIIMCTL_PHYREG_Pos (0) /*!< EMAC_T::MIIMCTL: PHYREG Position */ -#define EMAC_MIIMCTL_PHYREG_Msk (0x1ful << EMAC_MIIMCTL_PHYREG_Pos) /*!< EMAC_T::MIIMCTL: PHYREG Mask */ - -#define EMAC_MIIMCTL_PHYADDR_Pos (8) /*!< EMAC_T::MIIMCTL: PHYADDR Position */ -#define EMAC_MIIMCTL_PHYADDR_Msk (0x1ful << EMAC_MIIMCTL_PHYADDR_Pos) /*!< EMAC_T::MIIMCTL: PHYADDR Mask */ - -#define EMAC_MIIMCTL_WRITE_Pos (16) /*!< EMAC_T::MIIMCTL: WRITE Position */ -#define EMAC_MIIMCTL_WRITE_Msk (0x1ul << EMAC_MIIMCTL_WRITE_Pos) /*!< EMAC_T::MIIMCTL: WRITE Mask */ - -#define EMAC_MIIMCTL_BUSY_Pos (17) /*!< EMAC_T::MIIMCTL: BUSY Position */ -#define EMAC_MIIMCTL_BUSY_Msk (0x1ul << EMAC_MIIMCTL_BUSY_Pos) /*!< EMAC_T::MIIMCTL: BUSY Mask */ - -#define EMAC_MIIMCTL_PREAMSP_Pos (18) /*!< EMAC_T::MIIMCTL: PREAMSP Position */ -#define EMAC_MIIMCTL_PREAMSP_Msk (0x1ul << EMAC_MIIMCTL_PREAMSP_Pos) /*!< EMAC_T::MIIMCTL: PREAMSP Mask */ - -#define EMAC_MIIMCTL_MDCON_Pos (19) /*!< EMAC_T::MIIMCTL: MDCON Position */ -#define EMAC_MIIMCTL_MDCON_Msk (0x1ul << EMAC_MIIMCTL_MDCON_Pos) /*!< EMAC_T::MIIMCTL: MDCON Mask */ - -#define EMAC_FIFOCTL_RXFIFOTH_Pos (0) /*!< EMAC_T::FIFOCTL: RXFIFOTH Position */ -#define EMAC_FIFOCTL_RXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_RXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: RXFIFOTH Mask */ - -#define EMAC_FIFOCTL_TXFIFOTH_Pos (8) /*!< EMAC_T::FIFOCTL: TXFIFOTH Position */ -#define EMAC_FIFOCTL_TXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_TXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: TXFIFOTH Mask */ - -#define EMAC_FIFOCTL_BURSTLEN_Pos (20) /*!< EMAC_T::FIFOCTL: BURSTLEN Position */ -#define EMAC_FIFOCTL_BURSTLEN_Msk (0x3ul << EMAC_FIFOCTL_BURSTLEN_Pos) /*!< EMAC_T::FIFOCTL: BURSTLEN Mask */ - -#define EMAC_TXST_TXST_Pos (0) /*!< EMAC_T::TXST: TXST Position */ -#define EMAC_TXST_TXST_Msk (0xfffffffful << EMAC_TXST_TXST_Pos) /*!< EMAC_T::TXST: TXST Mask */ - -#define EMAC_RXST_RXST_Pos (0) /*!< EMAC_T::RXST: RXST Position */ -#define EMAC_RXST_RXST_Msk (0xfffffffful << EMAC_RXST_RXST_Pos) /*!< EMAC_T::RXST: RXST Mask */ - -#define EMAC_MRFL_MRFL_Pos (0) /*!< EMAC_T::MRFL: MRFL Position */ -#define EMAC_MRFL_MRFL_Msk (0xfffful << EMAC_MRFL_MRFL_Pos) /*!< EMAC_T::MRFL: MRFL Mask */ - -#define EMAC_INTEN_RXIEN_Pos (0) /*!< EMAC_T::INTEN: RXIEN Position */ -#define EMAC_INTEN_RXIEN_Msk (0x1ul << EMAC_INTEN_RXIEN_Pos) /*!< EMAC_T::INTEN: RXIEN Mask */ - -#define EMAC_INTEN_CRCEIEN_Pos (1) /*!< EMAC_T::INTEN: CRCEIEN Position */ -#define EMAC_INTEN_CRCEIEN_Msk (0x1ul << EMAC_INTEN_CRCEIEN_Pos) /*!< EMAC_T::INTEN: CRCEIEN Mask */ - -#define EMAC_INTEN_RXOVIEN_Pos (2) /*!< EMAC_T::INTEN: RXOVIEN Position */ -#define EMAC_INTEN_RXOVIEN_Msk (0x1ul << EMAC_INTEN_RXOVIEN_Pos) /*!< EMAC_T::INTEN: RXOVIEN Mask */ - -#define EMAC_INTEN_LPIEN_Pos (3) /*!< EMAC_T::INTEN: LPIEN Position */ -#define EMAC_INTEN_LPIEN_Msk (0x1ul << EMAC_INTEN_LPIEN_Pos) /*!< EMAC_T::INTEN: LPIEN Mask */ - -#define EMAC_INTEN_RXGDIEN_Pos (4) /*!< EMAC_T::INTEN: RXGDIEN Position */ -#define EMAC_INTEN_RXGDIEN_Msk (0x1ul << EMAC_INTEN_RXGDIEN_Pos) /*!< EMAC_T::INTEN: RXGDIEN Mask */ - -#define EMAC_INTEN_ALIEIEN_Pos (5) /*!< EMAC_T::INTEN: ALIEIEN Position */ -#define EMAC_INTEN_ALIEIEN_Msk (0x1ul << EMAC_INTEN_ALIEIEN_Pos) /*!< EMAC_T::INTEN: ALIEIEN Mask */ - -#define EMAC_INTEN_RPIEN_Pos (6) /*!< EMAC_T::INTEN: RPIEN Position */ -#define EMAC_INTEN_RPIEN_Msk (0x1ul << EMAC_INTEN_RPIEN_Pos) /*!< EMAC_T::INTEN: RPIEN Mask */ - -#define EMAC_INTEN_MPCOVIEN_Pos (7) /*!< EMAC_T::INTEN: MPCOVIEN Position */ -#define EMAC_INTEN_MPCOVIEN_Msk (0x1ul << EMAC_INTEN_MPCOVIEN_Pos) /*!< EMAC_T::INTEN: MPCOVIEN Mask */ - -#define EMAC_INTEN_MFLEIEN_Pos (8) /*!< EMAC_T::INTEN: MFLEIEN Position */ -#define EMAC_INTEN_MFLEIEN_Msk (0x1ul << EMAC_INTEN_MFLEIEN_Pos) /*!< EMAC_T::INTEN: MFLEIEN Mask */ - -#define EMAC_INTEN_DENIEN_Pos (9) /*!< EMAC_T::INTEN: DENIEN Position */ -#define EMAC_INTEN_DENIEN_Msk (0x1ul << EMAC_INTEN_DENIEN_Pos) /*!< EMAC_T::INTEN: DENIEN Mask */ - -#define EMAC_INTEN_RDUIEN_Pos (10) /*!< EMAC_T::INTEN: RDUIEN Position */ -#define EMAC_INTEN_RDUIEN_Msk (0x1ul << EMAC_INTEN_RDUIEN_Pos) /*!< EMAC_T::INTEN: RDUIEN Mask */ - -#define EMAC_INTEN_RXBEIEN_Pos (11) /*!< EMAC_T::INTEN: RXBEIEN Position */ -#define EMAC_INTEN_RXBEIEN_Msk (0x1ul << EMAC_INTEN_RXBEIEN_Pos) /*!< EMAC_T::INTEN: RXBEIEN Mask */ - -#define EMAC_INTEN_CFRIEN_Pos (14) /*!< EMAC_T::INTEN: CFRIEN Position */ -#define EMAC_INTEN_CFRIEN_Msk (0x1ul << EMAC_INTEN_CFRIEN_Pos) /*!< EMAC_T::INTEN: CFRIEN Mask */ - -#define EMAC_INTEN_WOLIEN_Pos (15) /*!< EMAC_T::INTEN: WOLIEN Position */ -#define EMAC_INTEN_WOLIEN_Msk (0x1ul << EMAC_INTEN_WOLIEN_Pos) /*!< EMAC_T::INTEN: WOLIEN Mask */ - -#define EMAC_INTEN_TXIEN_Pos (16) /*!< EMAC_T::INTEN: TXIEN Position */ -#define EMAC_INTEN_TXIEN_Msk (0x1ul << EMAC_INTEN_TXIEN_Pos) /*!< EMAC_T::INTEN: TXIEN Mask */ - -#define EMAC_INTEN_TXUDIEN_Pos (17) /*!< EMAC_T::INTEN: TXUDIEN Position */ -#define EMAC_INTEN_TXUDIEN_Msk (0x1ul << EMAC_INTEN_TXUDIEN_Pos) /*!< EMAC_T::INTEN: TXUDIEN Mask */ - -#define EMAC_INTEN_TXCPIEN_Pos (18) /*!< EMAC_T::INTEN: TXCPIEN Position */ -#define EMAC_INTEN_TXCPIEN_Msk (0x1ul << EMAC_INTEN_TXCPIEN_Pos) /*!< EMAC_T::INTEN: TXCPIEN Mask */ - -#define EMAC_INTEN_EXDEFIEN_Pos (19) /*!< EMAC_T::INTEN: EXDEFIEN Position */ -#define EMAC_INTEN_EXDEFIEN_Msk (0x1ul << EMAC_INTEN_EXDEFIEN_Pos) /*!< EMAC_T::INTEN: EXDEFIEN Mask */ - -#define EMAC_INTEN_NCSIEN_Pos (20) /*!< EMAC_T::INTEN: NCSIEN Position */ -#define EMAC_INTEN_NCSIEN_Msk (0x1ul << EMAC_INTEN_NCSIEN_Pos) /*!< EMAC_T::INTEN: NCSIEN Mask */ - -#define EMAC_INTEN_TXABTIEN_Pos (21) /*!< EMAC_T::INTEN: TXABTIEN Position */ -#define EMAC_INTEN_TXABTIEN_Msk (0x1ul << EMAC_INTEN_TXABTIEN_Pos) /*!< EMAC_T::INTEN: TXABTIEN Mask */ - -#define EMAC_INTEN_LCIEN_Pos (22) /*!< EMAC_T::INTEN: LCIEN Position */ -#define EMAC_INTEN_LCIEN_Msk (0x1ul << EMAC_INTEN_LCIEN_Pos) /*!< EMAC_T::INTEN: LCIEN Mask */ - -#define EMAC_INTEN_TDUIEN_Pos (23) /*!< EMAC_T::INTEN: TDUIEN Position */ -#define EMAC_INTEN_TDUIEN_Msk (0x1ul << EMAC_INTEN_TDUIEN_Pos) /*!< EMAC_T::INTEN: TDUIEN Mask */ - -#define EMAC_INTEN_TXBEIEN_Pos (24) /*!< EMAC_T::INTEN: TXBEIEN Position */ -#define EMAC_INTEN_TXBEIEN_Msk (0x1ul << EMAC_INTEN_TXBEIEN_Pos) /*!< EMAC_T::INTEN: TXBEIEN Mask */ - -#define EMAC_INTEN_TSALMIEN_Pos (28) /*!< EMAC_T::INTEN: TSALMIEN Position */ -#define EMAC_INTEN_TSALMIEN_Msk (0x1ul << EMAC_INTEN_TSALMIEN_Pos) /*!< EMAC_T::INTEN: TSALMIEN Mask */ - -#define EMAC_INTSTS_RXIF_Pos (0) /*!< EMAC_T::INTSTS: RXIF Position */ -#define EMAC_INTSTS_RXIF_Msk (0x1ul << EMAC_INTSTS_RXIF_Pos) /*!< EMAC_T::INTSTS: RXIF Mask */ - -#define EMAC_INTSTS_CRCEIF_Pos (1) /*!< EMAC_T::INTSTS: CRCEIF Position */ -#define EMAC_INTSTS_CRCEIF_Msk (0x1ul << EMAC_INTSTS_CRCEIF_Pos) /*!< EMAC_T::INTSTS: CRCEIF Mask */ - -#define EMAC_INTSTS_RXOVIF_Pos (2) /*!< EMAC_T::INTSTS: RXOVIF Position */ -#define EMAC_INTSTS_RXOVIF_Msk (0x1ul << EMAC_INTSTS_RXOVIF_Pos) /*!< EMAC_T::INTSTS: RXOVIF Mask */ - -#define EMAC_INTSTS_LPIF_Pos (3) /*!< EMAC_T::INTSTS: LPIF Position */ -#define EMAC_INTSTS_LPIF_Msk (0x1ul << EMAC_INTSTS_LPIF_Pos) /*!< EMAC_T::INTSTS: LPIF Mask */ - -#define EMAC_INTSTS_RXGDIF_Pos (4) /*!< EMAC_T::INTSTS: RXGDIF Position */ -#define EMAC_INTSTS_RXGDIF_Msk (0x1ul << EMAC_INTSTS_RXGDIF_Pos) /*!< EMAC_T::INTSTS: RXGDIF Mask */ - -#define EMAC_INTSTS_ALIEIF_Pos (5) /*!< EMAC_T::INTSTS: ALIEIF Position */ -#define EMAC_INTSTS_ALIEIF_Msk (0x1ul << EMAC_INTSTS_ALIEIF_Pos) /*!< EMAC_T::INTSTS: ALIEIF Mask */ - -#define EMAC_INTSTS_RPIF_Pos (6) /*!< EMAC_T::INTSTS: RPIF Position */ -#define EMAC_INTSTS_RPIF_Msk (0x1ul << EMAC_INTSTS_RPIF_Pos) /*!< EMAC_T::INTSTS: RPIF Mask */ - -#define EMAC_INTSTS_MPCOVIF_Pos (7) /*!< EMAC_T::INTSTS: MPCOVIF Position */ -#define EMAC_INTSTS_MPCOVIF_Msk (0x1ul << EMAC_INTSTS_MPCOVIF_Pos) /*!< EMAC_T::INTSTS: MPCOVIF Mask */ - -#define EMAC_INTSTS_MFLEIF_Pos (8) /*!< EMAC_T::INTSTS: MFLEIF Position */ -#define EMAC_INTSTS_MFLEIF_Msk (0x1ul << EMAC_INTSTS_MFLEIF_Pos) /*!< EMAC_T::INTSTS: MFLEIF Mask */ - -#define EMAC_INTSTS_DENIF_Pos (9) /*!< EMAC_T::INTSTS: DENIF Position */ -#define EMAC_INTSTS_DENIF_Msk (0x1ul << EMAC_INTSTS_DENIF_Pos) /*!< EMAC_T::INTSTS: DENIF Mask */ - -#define EMAC_INTSTS_RDUIF_Pos (10) /*!< EMAC_T::INTSTS: RDUIF Position */ -#define EMAC_INTSTS_RDUIF_Msk (0x1ul << EMAC_INTSTS_RDUIF_Pos) /*!< EMAC_T::INTSTS: RDUIF Mask */ - -#define EMAC_INTSTS_RXBEIF_Pos (11) /*!< EMAC_T::INTSTS: RXBEIF Position */ -#define EMAC_INTSTS_RXBEIF_Msk (0x1ul << EMAC_INTSTS_RXBEIF_Pos) /*!< EMAC_T::INTSTS: RXBEIF Mask */ - -#define EMAC_INTSTS_CFRIF_Pos (14) /*!< EMAC_T::INTSTS: CFRIF Position */ -#define EMAC_INTSTS_CFRIF_Msk (0x1ul << EMAC_INTSTS_CFRIF_Pos) /*!< EMAC_T::INTSTS: CFRIF Mask */ - -#define EMAC_INTSTS_WOLIF_Pos (15) /*!< EMAC_T::INTSTS: WOLIF Position */ -#define EMAC_INTSTS_WOLIF_Msk (0x1ul << EMAC_INTSTS_WOLIF_Pos) /*!< EMAC_T::INTSTS: WOLIF Mask */ - -#define EMAC_INTSTS_TXIF_Pos (16) /*!< EMAC_T::INTSTS: TXIF Position */ -#define EMAC_INTSTS_TXIF_Msk (0x1ul << EMAC_INTSTS_TXIF_Pos) /*!< EMAC_T::INTSTS: TXIF Mask */ - -#define EMAC_INTSTS_TXUDIF_Pos (17) /*!< EMAC_T::INTSTS: TXUDIF Position */ -#define EMAC_INTSTS_TXUDIF_Msk (0x1ul << EMAC_INTSTS_TXUDIF_Pos) /*!< EMAC_T::INTSTS: TXUDIF Mask */ - -#define EMAC_INTSTS_TXCPIF_Pos (18) /*!< EMAC_T::INTSTS: TXCPIF Position */ -#define EMAC_INTSTS_TXCPIF_Msk (0x1ul << EMAC_INTSTS_TXCPIF_Pos) /*!< EMAC_T::INTSTS: TXCPIF Mask */ - -#define EMAC_INTSTS_EXDEFIF_Pos (19) /*!< EMAC_T::INTSTS: EXDEFIF Position */ -#define EMAC_INTSTS_EXDEFIF_Msk (0x1ul << EMAC_INTSTS_EXDEFIF_Pos) /*!< EMAC_T::INTSTS: EXDEFIF Mask */ - -#define EMAC_INTSTS_NCSIF_Pos (20) /*!< EMAC_T::INTSTS: NCSIF Position */ -#define EMAC_INTSTS_NCSIF_Msk (0x1ul << EMAC_INTSTS_NCSIF_Pos) /*!< EMAC_T::INTSTS: NCSIF Mask */ - -#define EMAC_INTSTS_TXABTIF_Pos (21) /*!< EMAC_T::INTSTS: TXABTIF Position */ -#define EMAC_INTSTS_TXABTIF_Msk (0x1ul << EMAC_INTSTS_TXABTIF_Pos) /*!< EMAC_T::INTSTS: TXABTIF Mask */ - -#define EMAC_INTSTS_LCIF_Pos (22) /*!< EMAC_T::INTSTS: LCIF Position */ -#define EMAC_INTSTS_LCIF_Msk (0x1ul << EMAC_INTSTS_LCIF_Pos) /*!< EMAC_T::INTSTS: LCIF Mask */ - -#define EMAC_INTSTS_TDUIF_Pos (23) /*!< EMAC_T::INTSTS: TDUIF Position */ -#define EMAC_INTSTS_TDUIF_Msk (0x1ul << EMAC_INTSTS_TDUIF_Pos) /*!< EMAC_T::INTSTS: TDUIF Mask */ - -#define EMAC_INTSTS_TXBEIF_Pos (24) /*!< EMAC_T::INTSTS: TXBEIF Position */ -#define EMAC_INTSTS_TXBEIF_Msk (0x1ul << EMAC_INTSTS_TXBEIF_Pos) /*!< EMAC_T::INTSTS: TXBEIF Mask */ - -#define EMAC_INTSTS_TSALMIF_Pos (28) /*!< EMAC_T::INTSTS: TSALMIF Position */ -#define EMAC_INTSTS_TSALMIF_Msk (0x1ul << EMAC_INTSTS_TSALMIF_Pos) /*!< EMAC_T::INTSTS: TSALMIF Mask */ - -#define EMAC_GENSTS_CFR_Pos (0) /*!< EMAC_T::GENSTS: CFR Position */ -#define EMAC_GENSTS_CFR_Msk (0x1ul << EMAC_GENSTS_CFR_Pos) /*!< EMAC_T::GENSTS: CFR Mask */ - -#define EMAC_GENSTS_RXHALT_Pos (1) /*!< EMAC_T::GENSTS: RXHALT Position */ -#define EMAC_GENSTS_RXHALT_Msk (0x1ul << EMAC_GENSTS_RXHALT_Pos) /*!< EMAC_T::GENSTS: RXHALT Mask */ - -#define EMAC_GENSTS_RXFFULL_Pos (2) /*!< EMAC_T::GENSTS: RXFFULL Position */ -#define EMAC_GENSTS_RXFFULL_Msk (0x1ul << EMAC_GENSTS_RXFFULL_Pos) /*!< EMAC_T::GENSTS: RXFFULL Mask */ - -#define EMAC_GENSTS_COLCNT_Pos (4) /*!< EMAC_T::GENSTS: COLCNT Position */ -#define EMAC_GENSTS_COLCNT_Msk (0xful << EMAC_GENSTS_COLCNT_Pos) /*!< EMAC_T::GENSTS: COLCNT Mask */ - -#define EMAC_GENSTS_DEF_Pos (8) /*!< EMAC_T::GENSTS: DEF Position */ -#define EMAC_GENSTS_DEF_Msk (0x1ul << EMAC_GENSTS_DEF_Pos) /*!< EMAC_T::GENSTS: DEF Mask */ - -#define EMAC_GENSTS_TXPAUSED_Pos (9) /*!< EMAC_T::GENSTS: TXPAUSED Position */ -#define EMAC_GENSTS_TXPAUSED_Msk (0x1ul << EMAC_GENSTS_TXPAUSED_Pos) /*!< EMAC_T::GENSTS: TXPAUSED Mask */ - -#define EMAC_GENSTS_SQE_Pos (10) /*!< EMAC_T::GENSTS: SQE Position */ -#define EMAC_GENSTS_SQE_Msk (0x1ul << EMAC_GENSTS_SQE_Pos) /*!< EMAC_T::GENSTS: SQE Mask */ - -#define EMAC_GENSTS_TXHALT_Pos (11) /*!< EMAC_T::GENSTS: TXHALT Position */ -#define EMAC_GENSTS_TXHALT_Msk (0x1ul << EMAC_GENSTS_TXHALT_Pos) /*!< EMAC_T::GENSTS: TXHALT Mask */ - -#define EMAC_GENSTS_RPSTS_Pos (12) /*!< EMAC_T::GENSTS: RPSTS Position */ -#define EMAC_GENSTS_RPSTS_Msk (0x1ul << EMAC_GENSTS_RPSTS_Pos) /*!< EMAC_T::GENSTS: RPSTS Mask */ - -#define EMAC_MPCNT_MPCNT_Pos (0) /*!< EMAC_T::MPCNT: MPCNT Position */ -#define EMAC_MPCNT_MPCNT_Msk (0xfffful << EMAC_MPCNT_MPCNT_Pos) /*!< EMAC_T::MPCNT: MPCNT Mask */ - -#define EMAC_RPCNT_RPCNT_Pos (0) /*!< EMAC_T::RPCNT: RPCNT Position */ -#define EMAC_RPCNT_RPCNT_Msk (0xfffful << EMAC_RPCNT_RPCNT_Pos) /*!< EMAC_T::RPCNT: RPCNT Mask */ - -#define EMAC_FRSTS_RXFLT_Pos (0) /*!< EMAC_T::FRSTS: RXFLT Position */ -#define EMAC_FRSTS_RXFLT_Msk (0xfffful << EMAC_FRSTS_RXFLT_Pos) /*!< EMAC_T::FRSTS: RXFLT Mask */ - -#define EMAC_CTXDSA_CTXDSA_Pos (0) /*!< EMAC_T::CTXDSA: CTXDSA Position */ -#define EMAC_CTXDSA_CTXDSA_Msk (0xfffffffful << EMAC_CTXDSA_CTXDSA_Pos) /*!< EMAC_T::CTXDSA: CTXDSA Mask */ - -#define EMAC_CTXBSA_CTXBSA_Pos (0) /*!< EMAC_T::CTXBSA: CTXBSA Position */ -#define EMAC_CTXBSA_CTXBSA_Msk (0xfffffffful << EMAC_CTXBSA_CTXBSA_Pos) /*!< EMAC_T::CTXBSA: CTXBSA Mask */ - -#define EMAC_CRXDSA_CRXDSA_Pos (0) /*!< EMAC_T::CRXDSA: CRXDSA Position */ -#define EMAC_CRXDSA_CRXDSA_Msk (0xfffffffful << EMAC_CRXDSA_CRXDSA_Pos) /*!< EMAC_T::CRXDSA: CRXDSA Mask */ - -#define EMAC_CRXBSA_CRXBSA_Pos (0) /*!< EMAC_T::CRXBSA: CRXBSA Position */ -#define EMAC_CRXBSA_CRXBSA_Msk (0xfffffffful << EMAC_CRXBSA_CRXBSA_Pos) /*!< EMAC_T::CRXBSA: CRXBSA Mask */ - -#define EMAC_TSCTL_TSEN_Pos (0) /*!< EMAC_T::TSCTL: TSEN Position */ -#define EMAC_TSCTL_TSEN_Msk (0x1ul << EMAC_TSCTL_TSEN_Pos) /*!< EMAC_T::TSCTL: TSEN Mask */ - -#define EMAC_TSCTL_TSIEN_Pos (1) /*!< EMAC_T::TSCTL: TSIEN Position */ -#define EMAC_TSCTL_TSIEN_Msk (0x1ul << EMAC_TSCTL_TSIEN_Pos) /*!< EMAC_T::TSCTL: TSIEN Mask */ - -#define EMAC_TSCTL_TSMODE_Pos (2) /*!< EMAC_T::TSCTL: TSMODE Position */ -#define EMAC_TSCTL_TSMODE_Msk (0x1ul << EMAC_TSCTL_TSMODE_Pos) /*!< EMAC_T::TSCTL: TSMODE Mask */ - -#define EMAC_TSCTL_TSUPDATE_Pos (3) /*!< EMAC_T::TSCTL: TSUPDATE Position */ -#define EMAC_TSCTL_TSUPDATE_Msk (0x1ul << EMAC_TSCTL_TSUPDATE_Pos) /*!< EMAC_T::TSCTL: TSUPDATE Mask */ - -#define EMAC_TSCTL_TSALMEN_Pos (5) /*!< EMAC_T::TSCTL: TSALMEN Position */ -#define EMAC_TSCTL_TSALMEN_Msk (0x1ul << EMAC_TSCTL_TSALMEN_Pos) /*!< EMAC_T::TSCTL: TSALMEN Mask */ - -#define EMAC_TSSEC_SEC_Pos (0) /*!< EMAC_T::TSSEC: SEC Position */ -#define EMAC_TSSEC_SEC_Msk (0xfffffffful << EMAC_TSSEC_SEC_Pos) /*!< EMAC_T::TSSEC: SEC Mask */ - -#define EMAC_TSSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::TSSUBSEC: SUBSEC Position */ -#define EMAC_TSSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_TSSUBSEC_SUBSEC_Pos) /*!< EMAC_T::TSSUBSEC: SUBSEC Mask */ - -#define EMAC_TSINC_CNTINC_Pos (0) /*!< EMAC_T::TSINC: CNTINC Position */ -#define EMAC_TSINC_CNTINC_Msk (0xfful << EMAC_TSINC_CNTINC_Pos) /*!< EMAC_T::TSINC: CNTINC Mask */ - -#define EMAC_TSADDEND_ADDEND_Pos (0) /*!< EMAC_T::TSADDEND: ADDEND Position */ -#define EMAC_TSADDEND_ADDEND_Msk (0xfffffffful << EMAC_TSADDEND_ADDEND_Pos) /*!< EMAC_T::TSADDEND: ADDEND Mask */ - -#define EMAC_UPDSEC_SEC_Pos (0) /*!< EMAC_T::UPDSEC: SEC Position */ -#define EMAC_UPDSEC_SEC_Msk (0xfffffffful << EMAC_UPDSEC_SEC_Pos) /*!< EMAC_T::UPDSEC: SEC Mask */ - -#define EMAC_UPDSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::UPDSUBSEC: SUBSEC Position */ -#define EMAC_UPDSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_UPDSUBSEC_SUBSEC_Pos) /*!< EMAC_T::UPDSUBSEC: SUBSEC Mask */ - -#define EMAC_ALMSEC_SEC_Pos (0) /*!< EMAC_T::ALMSEC: SEC Position */ -#define EMAC_ALMSEC_SEC_Msk (0xfffffffful << EMAC_ALMSEC_SEC_Pos) /*!< EMAC_T::ALMSEC: SEC Mask */ - -#define EMAC_ALMSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::ALMSUBSEC: SUBSEC Position */ -#define EMAC_ALMSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_ALMSUBSEC_SUBSEC_Pos) /*!< EMAC_T::ALMSUBSEC: SUBSEC Mask */ - -/**@}*/ /* EMAC_CONST */ -/**@}*/ /* end of EMAC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __EMAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/epwm_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/epwm_reg.h deleted file mode 100644 index aa4ba4a478b..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/epwm_reg.h +++ /dev/null @@ -1,4023 +0,0 @@ -/**************************************************************************//** - * @file epwm_reg.h - * @version V1.00 - * @brief EPWM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EPWM_REG_H__ -#define __EPWM_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EPWM Pulse Width Modulation Controller(EPWM) - Memory Mapped Structure for EPWM Controller -@{ */ - -typedef struct -{ - /** - * @var ECAPDAT_T::RCAPDAT - * Offset: 0x20C EPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var ECAPDAT_T::FCAPDAT - * Offset: 0x210 EPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] EPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] EPWM Falling Capture Data Register 0~5 */ -} ECAPDAT_T; - -typedef struct -{ - - - /** - * @var EPWM_T::CTL0 - * Offset: 0x00 EPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[1] |CTRLD1 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[2] |CTRLD2 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[3] |CTRLD3 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[4] |CTRLD4 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[5] |CTRLD5 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[8] |WINLDEN0 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[9] |WINLDEN1 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[10] |WINLDEN2 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[11] |WINLDEN3 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[12] |WINLDEN4 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[13] |WINLDEN5 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[16] |IMMLDEN0 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[24] |GROUPEN |Group Function Enable Bit(S) - * | | |0 = The output waveform of each EPWM channel are independent. - * | | |1 = Unify the EPWM_CH2 and EPWM_CH4 to output the same waveform as EPWM_CH0 and unify the EPWM_CH3 and EPWM_CH5 to output the same waveform as EPWM_CH1. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, EPWM all counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt disable. - * | | |1 = ICE debug mode counter halt enable. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects EPWM output. - * | | |EPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |EPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var EPWM_T::CTL1 - * Offset: 0x04 EPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[3:2] |CNTTYPE1 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[5:4] |CNTTYPE2 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[7:6] |CNTTYPE3 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[9:8] |CNTTYPE4 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[11:10] |CNTTYPE5 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supports in capture mode). - * | | |01 = Down count type (supports in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[16] |CNTMODE0 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[17] |CNTMODE1 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[18] |CNTMODE2 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[19] |CNTMODE3 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[20] |CNTMODE4 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[21] |CNTMODE5 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[24] |OUTMODE0 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[25] |OUTMODE2 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[26] |OUTMODE4 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * @var EPWM_T::SYNC - * Offset: 0x08 EPWM Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PHSEN0 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[1] |PHSEN2 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[2] |PHSEN4 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disable to load PHS value. - * | | |1 = EPWM counter enable to load PHS value. - * |[9:8] |SINSRC0 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[11:10] |SINSRC2 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[13:12] |SINSRC4 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[16] |SNFLTEN |EPWM0_SYNC_IN Noise Filter Enable Bits - * | | |0 = Noise filter of input pin EPWM0_SYNC_IN is Disabled. - * | | |1 = Noise filter of input pin EPWM0_SYNC_IN is Enabled. - * |[19:17] |SFLTCSEL |SYNC Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[22:20] |SFLTCNT |SYNC Edge Detector Filter Count - * | | |The register bits control the counter number of edge detector. - * |[23] |SINPINV |SYNC Input Pin Inverse - * | | |0 = The state of pin SYNC is passed to the negative edge detector. - * | | |1 = The inversed state of pin SYNC is passed to the negative edge detector. - * |[24] |PHSDIR0 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[25] |PHSDIR2 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[26] |PHSDIR4 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * @var EPWM_T::SWSYNC - * Offset: 0x0C EPWM Software Control Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWSYNC0 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source is come from SYNC_IN or this bit. - * |[1] |SWSYNC2 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source is come from SYNC_IN or this bit. - * |[2] |SWSYNC4 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source is come from SYNC_IN or this bit. - * @var EPWM_T::CLKSRC - * Offset: 0x10 EPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |ECLKSRC0 |EPWM_CH01 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[10:8] |ECLKSRC2 |EPWM_CH23 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * |[18:16] |ECLKSRC4 |EPWM_CH45 External Clock Source Select - * | | |000 = EPWMx_CLK, x denotes 0 or 1. - * | | |001 = TIMER0 overflow. - * | | |010 = TIMER1 overflow. - * | | |011 = TIMER2 overflow. - * | | |100 = TIMER3 overflow. - * | | |Others = Reserved. - * @var EPWM_T::CLKPSC[3] - * Offset: 0x14 EPWM Clock Prescale Register 0/1, 2/3, 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair share one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CNTEN - * Offset: 0x20 EPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[1] |CNTEN1 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[2] |CNTEN2 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[3] |CNTEN3 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[4] |CNTEN4 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * |[5] |CNTEN5 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler Stop Running. - * | | |1 = EPWM Counter and clock prescaler Start Running. - * @var EPWM_T::CNTCLR - * Offset: 0x24 EPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[1] |CNTCLR1 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[2] |CNTCLR2 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[3] |CNTCLR3 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[4] |CNTCLR4 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[5] |CNTCLR5 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * @var EPWM_T::LOAD - * Offset: 0x28 EPWM Load Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LOAD0 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[1] |LOAD1 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[2] |LOAD2 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[3] |LOAD3 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[4] |LOAD4 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[5] |LOAD5 |Re-load EPWM Comparator Register (CMPDAT) Control Bit - * | | |This bit is software write, hardware clear when current EPWM period end. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit only use in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * @var EPWM_T::PERIOD[6] - * Offset: 0x30 EPWM Period Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |Down-Count mode: In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * EPWM_CLK period. - * | | |Up-Down-Count mode: In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * EPWM_CLK period. - * @var EPWM_T::CMPDAT[6] - * Offset: 0x50 EPWM Comparator Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP use to compare with CNTR to generate EPWM waveform, interrupt and trigger EADC/DAC. - * | | |In independent mode, CMPDAT0~5 denote as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 denote as first compared point, and CMPDAT1, 3, 5 denote as second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::DTCTL[3] - * Offset: 0x70 EPWM Dead-Time Control Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[16] |DTEN |Enable Dead-time Insertion for EPWM Pair (EPWM_CH0, EPWM_CH1) (EPWM_CH2, EPWM_CH3) (EPWM_CH4, EPWM_CH5) (Write Protect) - * | | |Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Dead-time insertion Disabled on the pin pair. - * | | |1 = Dead-time insertion Enabled on the pin pair. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from EPWM_CLK. - * | | |1 = Dead-time clock source from prescaler output. - * | | |Note: This register is write protected. Refer toREGWRPROT register. - * @var EPWM_T::PHS[3] - * Offset: 0x80 EPWM Counter Phase Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PHS |EPWM Synchronous Start Phase Bits - * | | |PHS determines the EPWM synchronous start phase value. These bits only use in synchronous function. - * @var EPWM_T::CNT[6] - * Offset: 0x90 EPWM Counter Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNTR to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is Down count. - * | | |1 = Counter is UP count. - * @var EPWM_T::WGCTL0 - * Offset: 0xB0 EPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[3:2] |ZPCTL1 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[5:4] |ZPCTL2 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[7:6] |ZPCTL3 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[9:8] |ZPCTL4 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[11:10] |ZPCTL5 |EPWM Zero Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * | | |EPWM can control output level when EPWM counter count to zero. - * |[17:16] |PRDPCTL0 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIODn+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIODn+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIODn+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIODn+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIODn+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |EPWM Period (Center) Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |EPWM can control output level when EPWM counter count to (PERIODn+1). - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * @var EPWM_T::WGCTL1 - * Offset: 0xB4 EPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[3:2] |CMPUCTL1 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[5:4] |CMPUCTL2 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[7:6] |CMPUCTL3 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[9:8] |CMPUCTL4 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[11:10] |CMPUCTL5 |EPWM Compare Up Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |EPWM can control output level when EPWM counter up count to CMPDAT. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 use as another CMPUCTL for channel 0, 2, 4. - * |[17:16] |CMPDCTL0 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[19:18] |CMPDCTL1 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[21:20] |CMPDCTL2 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[23:22] |CMPDCTL3 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[25:24] |CMPDCTL4 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * |[27:26] |CMPDCTL5 |EPWM Compare Down Point Control - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |EPWM can control output level when EPWM counter down count to CMPDAT. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 use as another CMPDCTL for channel 0, 2, 4. - * @var EPWM_T::MSKEN - * Offset: 0xB8 EPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[1] |MSKEN1 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[2] |MSKEN2 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[3] |MSKEN3 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[4] |MSKEN4 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[5] |MSKEN5 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * @var EPWM_T::MSK - * Offset: 0xBC EPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[1] |MSKDAT1 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[2] |MSKDAT2 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[3] |MSKDAT3 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[4] |MSKDAT4 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[5] |MSKDAT5 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * @var EPWM_T::BNF - * Offset: 0xC0 EPWM Brake Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRK0NFEN |EPWM Brake 0 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 0 Disabled. - * | | |1 = Noise filter of EPWM Brake 0 Enabled. - * |[3:1] |BRK0NFSEL |Brake 0 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[6:4] |BRK0FCNT |Brake 0 Edge Detector Filter Count - * | | |The register bits control the Brake0 filter counter to count from 0 to BRK1FCNT. - * |[7] |BRK0PINV |Brake 0 Pin Inverse - * | | |0 = The state of pin EPWMx_BRAKE0 is passed to the negative edge detector. - * | | |1 = The inversed state of pin EPWMx_BRAKE10 is passed to the negative edge detector. - * |[8] |BRK1NFEN |EPWM Brake 1 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 1 Disabled. - * | | |1 = Noise filter of EPWM Brake 1 Enabled. - * |[11:9] |BRK1NFSEL |Brake 1 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[14:12] |BRK1FCNT |Brake 1 Edge Detector Filter Count - * | | |The register bits control the Brake1 filter counter to count from 0 to BRK1FCNT. - * |[15] |BRK1PINV |Brake 1 Pin Inverse - * | | |0 = The state of pin EPWMx_BRAKE1 is passed to the negative edge detector. - * | | |1 = The inversed state of pin EPWMx_BRAKE1 is passed to the negative edge detector. - * |[16] |BK0SRC |Brake 0 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 0 pin source come from EPWM0_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |For EPWM1 setting: - * | | |0 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM0_BRAKE0. - * |[24] |BK1SRC |Brake 1 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 1 pin source come from EPWM0_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |For EPWM1 setting: - * | | |0 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM0_BRAKE1. - * @var EPWM_T::FAILBRK - * Offset: 0xC4 EPWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by CSS detection Disabled. - * | | |1 = Brake Function triggered by CSS detection Enabled. - * |[1] |BODBRKEN |Brown-out Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by BOD Disabled. - * | | |1 = Brake Function triggered by BOD Enabled. - * |[2] |RAMBRKEN |SRAM Parity Error Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by SRAM parity error detection Disabled. - * | | |1 = Brake Function triggered by SRAM parity error detection Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by Core lockup detection Disabled. - * | | |1 = Brake Function triggered by Core lockup detection Enabled. - * @var EPWM_T::BRKCTL[3] - * Offset: 0xC8 EPWM Brake Edge Detect Control Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CPO0EBEN |Enable ACMP0_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as edge-detect brake source Disabled. - * | | |1 = ACMP0_O as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |CPO1EBEN |Enable ACMP1_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as edge-detect brake source Disabled. - * | | |1 = ACMP1_O as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[4] |BRKP0EEN |Enable EPWMx_BRAKE0 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[5] |BRKP1EEN |Enable EPWMx_BRAKE1 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as edge-detect brake source Disabled. - * | | |1 = System Fail condition as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |CPO0LBEN |Enable ACMP0_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP0_O as level-detect brake source Disabled. - * | | |1 = ACMP0_O as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |CPO1LBEN |Enable ACMP1_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = ACMP1_O as level-detect brake source Disabled. - * | | |1 = ACMP1_O as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[12] |BRKP0LEN |Enable BKP0 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[13] |BRKP1LEN |Enable BKP1 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as level-detect brake source Disabled. - * | | |1 = System Fail condition as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[17:16] |BRKAEVEN |EPWM Brake Action Select for Even Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect even channels output. - * | | |01 = EPWM even channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM even channel output low level when EPWMx brake event happened. - * | | |11 = EPWM even channel output high level when EPWMx brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[19:18] |BRKAODD |EPWM Brake Action Select for Odd Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect odd channels output. - * | | |01 = EPWM odd channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM odd channel output low level when EPWMx brake event happened. - * | | |11 = EPWM odd channel output high level when EPWMx brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[20] |EADCEBEN |Enable EADC Result Monitor (EADCRM) As Edge-detect Brake Source (Write Protect) - * | | |0 = EADCRM as edge-detect brake source Disabled. - * | | |1 = EADCRM as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[28] |EADCLBEN |Enable EADC Result Monitor (EADCRM) As Level-detect Brake Source (Write Protect) - * | | |0 = EADCRM as level-detect brake source Disabled. - * | | |1 = EADCRM as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var EPWM_T::POLCTL - * Offset: 0xD4 EPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM output. - * | | |0 = EPWM output polar inverse Disabled. - * | | |1 = EPWM output polar inverse Enabled. - * |[1] |PINV1 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM output. - * | | |0 = EPWM output polar inverse Disabled. - * | | |1 = EPWM output polar inverse Enabled. - * |[2] |PINV2 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM output. - * | | |0 = EPWM output polar inverse Disabled. - * | | |1 = EPWM output polar inverse Enabled. - * |[3] |PINV3 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM output. - * | | |0 = EPWM output polar inverse Disabled. - * | | |1 = EPWM output polar inverse Enabled. - * |[4] |PINV4 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM output. - * | | |0 = EPWM output polar inverse Disabled. - * | | |1 = EPWM output polar inverse Enabled. - * |[5] |PINV5 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWM output. - * | | |0 = EPWM output polar inverse Disabled. - * | | |1 = EPWM output polar inverse Enabled. - * @var EPWM_T::POEN - * Offset: 0xD8 EPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |EPWM Pin Output Enable Bits - * | | |0 = EPWM pin at tri-state. - * | | |1 = EPWM pin in output mode. - * |[1] |POEN1 |EPWM Pin Output Enable Bits - * | | |0 = EPWM pin at tri-state. - * | | |1 = EPWM pin in output mode. - * |[2] |POEN2 |EPWM Pin Output Enable Bits - * | | |0 = EPWM pin at tri-state. - * | | |1 = EPWM pin in output mode. - * |[3] |POEN3 |EPWM Pin Output Enable Bits - * | | |0 = EPWM pin at tri-state. - * | | |1 = EPWM pin in output mode. - * |[4] |POEN4 |EPWM Pin Output Enable Bits - * | | |0 = EPWM pin at tri-state. - * | | |1 = EPWM pin in output mode. - * |[5] |POEN5 |EPWM Pin Output Enable Bits - * | | |0 = EPWM pin at tri-state. - * | | |1 = EPWM pin in output mode. - * @var EPWM_T::SWBRK - * Offset: 0xDC EPWM Software Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG0 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |BRKETRG2 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[2] |BRKETRG4 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLTRG0 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |BRKLTRG2 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[10] |BRKLTRG4 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var EPWM_T::INTEN0 - * Offset: 0xE0 EPWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[1] |ZIEN1 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[2] |ZIEN2 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[3] |ZIEN3 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[4] |ZIEN4 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[5] |ZIEN5 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[8] |PIEN0 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[9] |PIEN1 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[10] |PIEN2 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[11] |PIEN3 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[12] |PIEN4 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[13] |PIEN5 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note1: When up-down counter type period point means center point. - * | | |Note2: Odd channels will read always 0 at complementary mode. - * |[16] |CMPUIEN0 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[17] |CMPUIEN1 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[18] |CMPUIEN2 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[19] |CMPUIEN3 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[20] |CMPUIEN4 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[21] |CMPUIEN5 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 use as another CMPUIEN for channel 0, 2, 4. - * |[24] |CMPDIEN0 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[25] |CMPDIEN1 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[26] |CMPDIEN2 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[27] |CMPDIEN3 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[28] |CMPDIEN4 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * |[29] |CMPDIEN5 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 use as another CMPDIEN for channel 0, 2, 4. - * @var EPWM_T::INTEN1 - * Offset: 0xE4 EPWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN0_1|EPWM Edge-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |BRKEIEN2_3|EPWM Edge-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[2] |BRKEIEN4_5|EPWM Edge-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIEN0_1|EPWM Level-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Level-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |BRKLIEN2_3|EPWM Level-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Level-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[10] |BRKLIEN4_5|EPWM Level-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Level-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var EPWM_T::INTSTS0 - * Offset: 0xE8 EPWM Interrupt Flag Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[1] |ZIF1 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[2] |ZIF2 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[3] |ZIF3 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[4] |ZIF4 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[5] |ZIF5 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches zero, software can write 1 to clear this bit to zero. - * |[8] |PIF0 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn, software can write 1 to clear this bit to zero. - * |[9] |PIF1 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn, software can write 1 to clear this bit to zero. - * |[10] |PIF2 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn, software can write 1 to clear this bit to zero. - * |[11] |PIF3 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn, software can write 1 to clear this bit to zero. - * |[12] |PIF4 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn, software can write 1 to clear this bit to zero. - * |[13] |PIF5 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn, software can write 1 to clear this bit to zero. - * |[16] |CMPUIF0 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[17] |CMPUIF1 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[18] |CMPUIF2 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[19] |CMPUIF3 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[20] |CMPUIF4 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[21] |CMPUIF5 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in up counter type selection. - * | | |Note2: In complementary mode, CMPUIF1, 3, 5 use as another CMPUIF for channel 0, 2, 4. - * |[24] |CMPDIF0 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[25] |CMPDIF1 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[26] |CMPDIF2 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[27] |CMPDIF3 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[28] |CMPDIF4 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * |[29] |CMPDIF5 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note1: If CMPDAT equal to PERIOD, this flag is not working in down counter type selection. - * | | |Note2: In complementary mode, CMPDIF1, 3, 5 use as another CMPDIF for channel 0, 2, 4. - * @var EPWM_T::INTSTS1 - * Offset: 0xEC EPWM Interrupt Flag Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |EPWM Channel0 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel0 edge-detect brake event do not happened. - * | | |1 = When EPWM channel0 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |BRKEIF1 |EPWM Channel1 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel1 edge-detect brake event do not happened. - * | | |1 = When EPWM channel1 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[2] |BRKEIF2 |EPWM Channel2 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel2 edge-detect brake event do not happened. - * | | |1 = When EPWM channel2 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[3] |BRKEIF3 |EPWM Channel3 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel3 edge-detect brake event do not happened. - * | | |1 = When EPWM channel3 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[4] |BRKEIF4 |EPWM Channel4 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel4 edge-detect brake event do not happened. - * | | |1 = When EPWM channel4 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[5] |BRKEIF5 |EPWM Channel5 Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel5 edge-detect brake event do not happened. - * | | |1 = When EPWM channel5 edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIF0 |EPWM Channel0 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel0 level-detect brake event do not happened. - * | | |1 = When EPWM channel0 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |BRKLIF1 |EPWM Channel1 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel1 level-detect brake event do not happened. - * | | |1 = When EPWM channel1 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[10] |BRKLIF2 |EPWM Channel2 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel2 level-detect brake event do not happened. - * | | |1 = When EPWM channel2 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[11] |BRKLIF3 |EPWM Channel3 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel3 level-detect brake event do not happened. - * | | |1 = When EPWM channel3 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[12] |BRKLIF4 |EPWM Channel4 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel4 level-detect brake event do not happened. - * | | |1 = When EPWM channel4 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[13] |BRKLIF5 |EPWM Channel5 Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel5 level-detect brake event do not happened. - * | | |1 = When EEPWM channel5 level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[16] |BRKESTS0 |EPWM Channel0 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel0 edge-detect brake state is released. - * | | |1 = When EPWM channel0 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel0 at brake state, writing 1 to clear. - * |[17] |BRKESTS1 |EPWM Channel1 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel1 edge-detect brake state is released. - * | | |1 = When EPWM channel1 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel1 at brake state, writing 1 to clear. - * |[18] |BRKESTS2 |EPWM Channel2 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel2 edge-detect brake state is released. - * | | |1 = When EPWM channel2 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel2 at brake state, writing 1 to clear. - * |[19] |BRKESTS3 |EPWM Channel3 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel3 edge-detect brake state is released. - * | | |1 = When EPWM channel3 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel3 at brake state, writing 1 to clear. - * |[20] |BRKESTS4 |EPWM Channel4 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel4 edge-detect brake state is released. - * | | |1 = When EPWM channel4 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel4 at brake state, writing 1 to clear. - * |[21] |BRKESTS5 |EPWM Channel5 Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel5 edge-detect brake state is released. - * | | |1 = When EPWM channel5 edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel5 at brake state, writing 1 to clear. - * |[24] |BRKLSTS0 |EPWM Channel0 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel0 level-detect brake state is released. - * | | |1 = When EPWM channel0 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel0 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[25] |BRKLSTS1 |EPWM Channel1 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel1 level-detect brake state is released. - * | | |1 = When EPWM channel1 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel1 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[26] |BRKLSTS2 |EPWM Channel2 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel2 level-detect brake state is released. - * | | |1 = When EPWM channel2 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel2 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[27] |BRKLSTS3 |EPWM Channel3 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel3 level-detect brake state is released. - * | | |1 = When EPWM channel3 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel3 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[28] |BRKLSTS4 |EPWM Channel4 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel4 level-detect brake state is released. - * | | |1 = When EPWM channel4 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel4 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[29] |BRKLSTS5 |EPWM Channel5 Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel5 level-detect brake state is released. - * | | |1 = When EPWM channel5 level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel5 at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * @var EPWM_T::DACTRGEN - * Offset: 0xF4 EPWM Trigger DAC Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZTE0 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[1] |ZTE1 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[2] |ZTE2 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[3] |ZTE3 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[4] |ZTE4 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[5] |ZTE5 |EPWM Zero Point Trigger DAC Enable Bits - * | | |EPWM can trigger EADC/DAC/DMA to start action when EPWM counter down count to zero if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[8] |PTE0 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[9] |PTE1 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[10] |PTE2 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[11] |PTE3 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[12] |PTE4 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[13] |PTE5 |EPWM Period Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to (PERIODn+1) if this bit is set to1. - * | | |0 = EPWM period point trigger DAC function Disabled. - * | | |1 = EPWM period point trigger DAC function Enabled. - * |[16] |CUTRGE0 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[17] |CUTRGE1 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[18] |CUTRGE2 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[19] |CUTRGE3 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[20] |CUTRGE4 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[21] |CUTRGE5 |EPWM Compare Up Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter up count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Up point trigger DAC function Disabled. - * | | |1 = EPWM Compare Up point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in down counter type. - * | | |Note2: In complementary mode, CUTRGE1, 3, 5 use as another CUTRGE for channel 0, 2, 4. - * |[24] |CDTRGE0 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[25] |CDTRGE1 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[26] |CDTRGE2 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[27] |CDTRGE3 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[28] |CDTRGE4 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * |[29] |CDTRGE5 |EPWM Compare Down Count Point Trigger DAC Enable Bits - * | | |EPWM can trigger DAC to start action when EPWM counter down count to CMPDAT if this bit is set to1. - * | | |0 = EPWM Compare Down count point trigger DAC function Disabled. - * | | |1 = EPWM Compare Down count point trigger DAC function Enabled. - * | | |Note1: This bit should keep at 0 when EPWM counter operating in up counter type. - * | | |Note2: In complementary mode, CDTRGE1, 3, 5 use as another CDTRGE for channel 0, 2, 4. - * @var EPWM_T::EADCTS0 - * Offset: 0xF8 EPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |EPWM_CH0 Trigger EADC Source Select - * | | |0000 = EPWM_CH0 zero point. - * | | |0001 = EPWM_CH0 period point. - * | | |0010 = EPWM_CH0 zero or period point. - * | | |0011 = EPWM_CH0 up-count CMPDAT point. - * | | |0100 = EPWM_CH0 down-count CMPDAT point. - * | | |0101 = EPWM_CH1 zero point. - * | | |0110 = EPWM_CH1 period point. - * | | |0111 = EPWM_CH1 zero or period point. - * | | |1000 = EPWM_CH1 up-count CMPDAT point. - * | | |1001 = EPWM_CH1 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[7] |TRGEN0 |EPWM_CH0 Trigger EADC enable bit - * |[11:8] |TRGSEL1 |EPWM_CH1 Trigger EADC Source Select - * | | |0000 = EPWM_CH0 zero point. - * | | |0001 = EPWM_CH0 period point. - * | | |0010 = EPWM_CH0 zero or period point. - * | | |0011 = EPWM_CH0 up-count CMPDAT point. - * | | |0100 = EPWM_CH0 down-count CMPDAT point. - * | | |0101 = EPWM_CH1 zero point. - * | | |0110 = EPWM_CH1 period point. - * | | |0111 = EPWM_CH1 zero or period point. - * | | |1000 = EPWM_CH1 up-count CMPDAT point. - * | | |1001 = EPWM_CH1 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[15] |TRGEN1 |EPWM_CH1 Trigger EADC enable bit - * |[19:16] |TRGSEL2 |EPWM_CH2 Trigger EADC Source Select - * | | |0000 = EPWM_CH2 zero point. - * | | |0001 = EPWM_CH2 period point. - * | | |0010 = EPWM_CH2 zero or period point. - * | | |0011 = EPWM_CH2 up-count CMPDAT point. - * | | |0100 = EPWM_CH2 down-count CMPDAT point. - * | | |0101 = EPWM_CH3 zero point. - * | | |0110 = EPWM_CH3 period point. - * | | |0111 = EPWM_CH3 zero or period point. - * | | |1000 = EPWM_CH3 up-count CMPDAT point. - * | | |1001 = EPWM_CH3 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[23] |TRGEN2 |EPWM_CH2 Trigger EADC enable bit - * |[27:24] |TRGSEL3 |EPWM_CH3 Trigger EADC Source Select - * | | |0000 = EPWM_CH2 zero point. - * | | |0001 = EPWM_CH2 period point. - * | | |0010 = EPWM_CH2 zero or period point. - * | | |0011 = EPWM_CH2 up-count CMPDAT point. - * | | |0100 = EPWM_CH2 down-count CMPDAT point. - * | | |0101 = EPWM_CH3 zero point. - * | | |0110 = EPWM_CH3 period point. - * | | |0111 = EPWM_CH3 zero or period point. - * | | |1000 = EPWM_CH3 up-count CMPDAT point. - * | | |1001 = EPWM_CH3 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[31] |TRGEN3 |EPWM_CH3 Trigger EADC enable bit - * @var EPWM_T::EADCTS1 - * Offset: 0xFC EPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |EPWM_CH4 Trigger EADC Source Select - * | | |0000 = EPWM_CH4 zero point. - * | | |0001 = EPWM_CH4 period point. - * | | |0010 = EPWM_CH4 zero or period point. - * | | |0011 = EPWM_CH4 up-count CMPDAT point. - * | | |0100 = EPWM_CH4 down-count CMPDAT point. - * | | |0101 = EPWM_CH5 zero point. - * | | |0110 = EPWM_CH5 period point. - * | | |0111 = EPWM_CH5 zero or period point. - * | | |1000 = EPWM_CH5 up-count CMPDAT point. - * | | |1001 = EPWM_CH5 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[7] |TRGEN4 |EPWM_CH4 Trigger EADC enable bit - * |[11:8] |TRGSEL5 |EPWM_CH5 Trigger EADC Source Select - * | | |0000 = EPWM_CH4 zero point. - * | | |0001 = EPWM_CH4 period point. - * | | |0010 = EPWM_CH4 zero or period point. - * | | |0011 = EPWM_CH4 up-count CMPDAT point. - * | | |0100 = EPWM_CH4 down-count CMPDAT point. - * | | |0101 = EPWM_CH5 zero point. - * | | |0110 = EPWM_CH5 period point. - * | | |0111 = EPWM_CH5 zero or period point. - * | | |1000 = EPWM_CH5 up-count CMPDAT point. - * | | |1001 = EPWM_CH5 down-count CMPDAT point. - * | | |1010 = EPWM_CH0 up-count free CMPDAT point. - * | | |1011 = EPWM_CH0 down-count free CMPDAT point. - * | | |1100 = EPWM_CH2 up-count free CMPDAT point. - * | | |1101 = EPWM_CH2 down-count free CMPDAT point. - * | | |1110 = EPWM_CH4 up-count free CMPDAT point. - * | | |1111 = EPWM_CH4 down-count free CMPDAT point. - * |[15] |TRGEN5 |EPWM_CH5 Trigger EADC enable bit - * @var EPWM_T::FTCMPDAT[3] - * Offset: 0x100 EPWM Free Trigger Compare Register 0/1,2/3,4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMP |EPWM Free Trigger Compare Register - * | | |FTCMP use to compare with even CNTR to trigger EADC - * | | |FTCMPDAT0, 2, 4 corresponding complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::SSCTL - * Offset: 0x110 EPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[1] |SSEN1 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[2] |SSEN2 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[3] |SSEN3 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[4] |SSEN4 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[5] |SSEN5 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[9:8] |SSRC |EPWM Synchronous Start Source Select Bits - * | | |00 = Synchronous start source come from EPWM0. - * | | |01 = Synchronous start source come from EPWM1. - * | | |10 = Synchronous start source come from BPWM0. - * | | |11 = Synchronous start source come from BPWM1. - * @var EPWM_T::SSTRG - * Offset: 0x114 EPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |EPWM Counter Synchronous Start Enable (Write Only) - * | | |PMW counter synchronous enable function is used to make selected EPWM channels (include EPWM0_CHx and EPWM1_CHx) start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit (CNTENn, n denotes channel 0 to 5) if correlated EPWM channel counter synchronous start function is enabled. - * @var EPWM_T::LEBCTL - * Offset: 0x118 EPWM Leading Edge Blanking Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LEBEN |EPWM Leading Edge Blanking Enable Bit - * | | |0 = EPWM Leading Edge Blanking Disabled. - * | | |1 = EPWM Leading Edge Blanking Enabled. - * |[8] |SRCEN0 |EPWM Leading Edge Blanking Source From EPWM_CH0 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH0 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH0 Enabled. - * |[9] |SRCEN2 |EPWM Leading Edge Blanking Source From EPWM_CH2 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH2 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH2 Enabled. - * |[10] |SRCEN4 |EPWM Leading Edge Blanking Source From EPWM_CH4 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH4 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH4 Enabled. - * |[17:16] |TRGTYPE |EPWM Leading Edge Blanking Trigger Type - * | | |0 = When detect leading edge blanking source rising edge, blanking counter start counting. - * | | |1 = When detect leading edge blanking source falling edge, blanking counter start counting. - * | | |2 = When detect leading edge blanking source rising or falling edge, blanking counter start counting. - * | | |3 = Reserved. - * @var EPWM_T::LEBCNT - * Offset: 0x11C EPWM Leading Edge Blanking Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |LEBCNT |EPWM Leading Edge Blanking Counter - * | | |This counter value decides leading edge blanking window size - * | | |Blanking window size = LEBCNT+1, and LEB counter clock base is ECLK. - * @var EPWM_T::STATUS - * Offset: 0x120 EPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF0 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[1] |CNTMAXF1 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[2] |CNTMAXF2 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[3] |CNTMAXF3 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[4] |CNTMAXF4 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[5] |CNTMAXF5 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = indicates the time-base counter never reached its maximum value 0xFFFF. - * | | |1 = indicates the time-base counter reached its maximum value, software can write 1 to clear this bit. - * |[8] |SYNCINF0 |Input Synchronization Latched Flag - * | | |0 = Indicates no SYNC_IN event has occurred. - * | | |1 = Indicates an SYNC_IN event has occurred, software can write 1 to clear this bit. - * |[9] |SYNCINF2 |Input Synchronization Latched Flag - * | | |0 = Indicates no SYNC_IN event has occurred. - * | | |1 = Indicates an SYNC_IN event has occurred, software can write 1 to clear this bit. - * |[10] |SYNCINF4 |Input Synchronization Latched Flag - * | | |0 = Indicates no SYNC_IN event has occurred. - * | | |1 = Indicates an SYNC_IN event has occurred, software can write 1 to clear this bit. - * |[16] |EADCTRGF0 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[17] |EADCTRGF1 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[18] |EADCTRGF2 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[19] |EADCTRGF3 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[20] |EADCTRGF4 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[21] |EADCTRGF5 |EADC Start of Conversion Flag - * | | |0 = Indicates no EADC start of conversion trigger event has occurred. - * | | |1 = Indicates an EADC start of conversion trigger event has occurred, software can write 1 to clear this bit. - * |[24] |DACTRGF |DAC Start of Conversion Flag - * | | |0 = Indicates no DAC start of conversion trigger event has occurred. - * | | |1 = Indicates an DAC start of conversion trigger event has occurred, software can write 1 to clear this bit - * @var EPWM_T::IFA[6] - * Offset: 0x130 EPWM Interrupt Flag Accumulator Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Interrupt Flag Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator stop mode disable. - * | | |1 = EPWM_CHn interrupt flag accumulator stop mode enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = CNT equal to Zero in channel n. - * | | |01 = CNT equal to PERIOD in channel n. - * | | |10 = CNT equal to CMPU in channel n. - * | | |11 = CNT equal to CMPD in channel n. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator disable. - * | | |1 = EPWM_CHn interrupt flag accumulator enable. - * @var EPWM_T::AINTSTS - * Offset: 0x150 EPWM Accumulator Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIF0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[1] |IFAIF1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[2] |IFAIF2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[3] |IFAIF3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[4] |IFAIF4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[5] |IFAIF5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition match IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * @var EPWM_T::AINTEN - * Offset: 0x154 EPWM Accumulator Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIEN0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[1] |IFAIEN1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[2] |IFAIEN2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[3] |IFAIEN3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[4] |IFAIEN4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[5] |IFAIEN5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * @var EPWM_T::APDMACTL - * Offset: 0x158 EPWM Accumulator PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APDMAEN0 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[1] |APDMAEN1 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[2] |APDMAEN2 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[3] |APDMAEN3 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[4] |APDMAEN4 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[5] |APDMAEN5 |Channel N Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * @var EPWM_T::CAPINEN - * Offset: 0x200 EPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * @var EPWM_T::CAPCTL - * Offset: 0x204 EPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var EPWM_T::CAPSTS - * Offset: 0x208 EPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIFOV0 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[1] |CRLIFOV1 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[2] |CRLIFOV2 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[3] |CRLIFOV3 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[4] |CRLIFOV4 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[5] |CRLIFOV5 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[8] |CFLIFOV0 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[9] |CFLIFOV1 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[10] |CFLIFOV2 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[11] |CFLIFOV3 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[12] |CFLIFOV4 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[13] |CFLIFOV5 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * @var EPWM_T::PDMACTL - * Offset: 0x23C EPWM PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHEN0_1 |Channel 0/1 PDMA Enable - * | | |0 = Channel 0/1 PDMA function Disabled. - * | | |1 = Channel 0/1 PDMA function Enabled for the channel 0/1 captured data and transfer to memory. - * |[2:1] |CAPMOD0_1 |Select EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT0/1. - * | | |10 = EPWM_FCAPDAT0/1. - * | | |11 = Both EPWM_RCAPDAT0/1 and EPWM_FCAPDAT0/1. - * |[3] |CAPORD0_1 |Capture Channel 0/1 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 is the first captured data transferred to memory through PDMA when CAPMOD0_1 =11. - * | | |0 = EPWM_FCAPDAT0/1 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT0/1 is the first captured data to memory. - * |[4] |CHSEL0_1 |Select Channel 0/1 to Do PDMA Transfer - * | | |0 = Channel0. - * | | |1 = Channel1. - * |[8] |CHEN2_3 |Channel 2/3 PDMA Enable - * | | |0 = Channel 2/3 PDMA function Disabled. - * | | |1 = Channel 2/3 PDMA function Enabled for the channel 2/3 captured data and transfer to memory. - * |[10:9] |CAPMOD2_3 |Select EPWM_RCAPDAT2/3 or EPWM_FCAODAT2/3 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT2/3. - * | | |10 = EPWM_FCAPDAT2/3. - * | | |11 = Both EPWM_RCAPDAT2/3 and EPWM_FCAPDAT2/3. - * |[11] |CAPORD2_3 |Capture Channel 2/3 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT2/3 or EPWM_FCAPDAT2/3 is the first captured data transferred to memory through PDMA when CAPMOD2_3 =11. - * | | |0 = EPWM_FCAPDAT2/3 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT2/3 is the first captured data to memory. - * |[12] |CHSEL2_3 |Select Channel 2/3 to Do PDMA Transfer - * | | |0 = Channel2. - * | | |1 = Channel3. - * |[16] |CHEN4_5 |Channel 4/5 PDMA Enable - * | | |0 = Channel 4/5 PDMA function Disabled. - * | | |1 = Channel 4/5 PDMA function Enabled for the channel 4/5 captured data and transfer to memory. - * |[18:17] |CAPMOD4_5 |Select EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT4/5. - * | | |10 = EPWM_FCAPDAT4/5. - * | | |11 = Both EPWM_RCAPDAT4/5 and EPWM_FCAPDAT4/5. - * |[19] |CAPORD4_5 |Capture Channel 4/5 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 is the first captured data transferred to memory through PDMA when CAPMOD4_5 =11. - * | | |0 = EPWM_FCAPDAT4/5 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT4/5 is the first captured data to memory. - * |[20] |CHSEL4_5 |Select Channel 4/5 to Do PDMA Transfer - * | | |0 = Channel4. - * | | |1 = Channel5. - * @var EPWM_T::PDMACAP[3] - * Offset: 0x240 EPWM Capture Channel 01 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |EPWM Capture PDMA Register (Read Only) - * | | |This register is use as a buffer to transfer EPWM capture rising or falling data to memory by PDMA. - * @var EPWM_T::CAPIEN - * Offset: 0x250 EPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIEN0 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[1] |CAPRIEN1 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[2] |CAPRIEN2 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[3] |CAPRIEN3 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[4] |CAPRIEN4 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[5] |CAPRIEN5 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[8] |CAPFIEN0 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[9] |CAPFIEN1 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[10] |CAPFIEN2 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[11] |CAPFIEN3 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[12] |CAPFIEN4 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[13] |CAPFIEN5 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var EPWM_T::CAPIF - * Offset: 0x254 EPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIF0 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will cleared by hardware after PDMA transfer data. - * |[1] |CRLIF1 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will cleared by hardware after PDMA transfer data. - * |[2] |CRLIF2 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will cleared by hardware after PDMA transfer data. - * |[3] |CRLIF3 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will cleared by hardware after PDMA transfer data. - * |[4] |CRLIF4 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will cleared by hardware after PDMA transfer data. - * |[5] |CRLIF5 |EPWM Capture Rising Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will cleared by hardware after PDMA transfer data. - * |[8] |CFLIF0 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will cleared by hardware after PDMA transfer data. - * |[9] |CFLIF1 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will cleared by hardware after PDMA transfer data. - * |[10] |CFLIF2 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will cleared by hardware after PDMA transfer data. - * |[11] |CFLIF3 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will cleared by hardware after PDMA transfer data. - * |[12] |CFLIF4 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will cleared by hardware after PDMA transfer data. - * |[13] |CFLIF5 |EPWM Capture Falling Latch Interrupt Flag - * | | |This bit is writing 1 to clear. - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will cleared by hardware after PDMA transfer data. - * @var EPWM_T::PBUF[6] - * Offset: 0x304 EPWM PERIOD0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::CMPBUF[6] - * Offset: 0x31C EPWM CMPDAT0~5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CPSCBUF[3] - * Offset: 0x334 EPWM CLKPSC0_1/2_3/4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Use as EPWM counter clock prescale active register. - * @var EPWM_T::FTCBUF[3] - * Offset: 0x340 EPWM FTCMPDAT0_1/2_3/4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMPBUF |EPWM FTCMPDAT Buffer (Read Only) - * | | |Used as FTCMPDAT active register. - * @var EPWM_T::FTCI - * Offset: 0x34C EPWM FTCMPDAT Indicator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FTCMU0 |EPWM FTCMPDAT Up Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=1, software can write 1 to clear this bit. - * |[1] |FTCMU2 |EPWM FTCMPDAT Up Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=1, software can write 1 to clear this bit. - * |[2] |FTCMU4 |EPWM FTCMPDAT Up Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=1, software can write 1 to clear this bit. - * |[8] |FTCMD0 |EPWM FTCMPDAT Down Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=0, software can write 1 to clear this bit. - * |[9] |FTCMD2 |EPWM FTCMPDAT Down Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=0, software can write 1 to clear this bit. - * |[10] |FTCMD4 |EPWM FTCMPDAT Down Indicator - * | | |Indicator will be set to high when FTCMPDATn equal to CNTn and DIRF=0, software can write 1 to clear this bit. - */ - __IO uint32_t CTL0; /*!< [0x0000] EPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] EPWM Control Register 1 */ - __IO uint32_t SYNC; /*!< [0x0008] EPWM Synchronization Register */ - __IO uint32_t SWSYNC; /*!< [0x000c] EPWM Software Control Synchronization Register */ - __IO uint32_t CLKSRC; /*!< [0x0010] EPWM Clock Source Register */ - __IO uint32_t CLKPSC[3]; /*!< [0x0014] EPWM Clock Prescale Register 0/1,2/3,4/5 */ - __IO uint32_t CNTEN; /*!< [0x0020] EPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] EPWM Clear Counter Register */ - __IO uint32_t LOAD; /*!< [0x0028] EPWM Load Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PERIOD[6]; /*!< [0x0030] EPWM Period Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CMPDAT[6]; /*!< [0x0050] EPWM Comparator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DTCTL[3]; /*!< [0x0070] EPWM Dead-Time Control Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PHS[3]; /*!< [0x0080] EPWM Counter Phase Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[1]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t CNT[6]; /*!< [0x0090] EPWM Counter Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WGCTL0; /*!< [0x00b0] EPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] EPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] EPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] EPWM Mask Data Register */ - __IO uint32_t BNF; /*!< [0x00c0] EPWM Brake Noise Filter Register */ - __IO uint32_t FAILBRK; /*!< [0x00c4] EPWM System Fail Brake Control Register */ - __IO uint32_t BRKCTL[3]; /*!< [0x00c8] EPWM Brake Edge Detect Control Register 0/1,2/3,4/5 */ - __IO uint32_t POLCTL; /*!< [0x00d4] EPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] EPWM Output Enable Register */ - __O uint32_t SWBRK; /*!< [0x00dc] EPWM Software Brake Control Register */ - __IO uint32_t INTEN0; /*!< [0x00e0] EPWM Interrupt Enable Register 0 */ - __IO uint32_t INTEN1; /*!< [0x00e4] EPWM Interrupt Enable Register 1 */ - __IO uint32_t INTSTS0; /*!< [0x00e8] EPWM Interrupt Flag Register 0 */ - __IO uint32_t INTSTS1; /*!< [0x00ec] EPWM Interrupt Flag Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE6[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DACTRGEN; /*!< [0x00f4] EPWM Trigger DAC Enable Register */ - __IO uint32_t EADCTS0; /*!< [0x00f8] EPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] EPWM Trigger EADC Source Select Register 1 */ - __IO uint32_t FTCMPDAT[3]; /*!< [0x0100] EPWM Free Trigger Compare Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE7[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SSCTL; /*!< [0x0110] EPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] EPWM Synchronous Start Trigger Register */ - __IO uint32_t LEBCTL; /*!< [0x0118] EPWM Leading Edge Blanking Control Register */ - __IO uint32_t LEBCNT; /*!< [0x011c] EPWM Leading Edge Blanking Counter Register */ - __IO uint32_t STATUS; /*!< [0x0120] EPWM Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE8[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t IFA[6]; /*!< [0x0130] EPWM Interrupt Flag Accumulator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE9[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t AINTSTS; /*!< [0x0150] EPWM Accumulator Interrupt Flag Register */ - __IO uint32_t AINTEN; /*!< [0x0154] EPWM Accumulator Interrupt Enable Register */ - __IO uint32_t APDMACTL; /*!< [0x0158] EPWM Accumulator PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE10[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t FDEN; /*!< [0x0160] EPWM Fault Detect Enable Register */ - __IO uint32_t FDCTL[6]; /*!< [0x0164~0x178] EPWM Fault Detect Control Register 0~5 */ - __IO uint32_t FDIEN; /*!< [0x017C] EPWM Fault Detect Interrupt Enable Register */ - __IO uint32_t FDSTS; /*!< [0x0180] EPWM Fault Detect Interrupt Flag Register */ - __IO uint32_t EADCPSCCTL; /*!< [0x0184] EPWM Trigger EADC Prescale Control Register */ - __IO uint32_t EADCPSC0; /*!< [0x0188] EPWM Trigger EADC Prescale Register 0 */ - __IO uint32_t EADCPSC1; /*!< [0x018C] EPWM Trigger EADC Prescale Register 1 */ - __IO uint32_t EADCPSCNT0; /*!< [0x0190] EPWM Trigger EADC Prescale Counter Register 0 */ - __IO uint32_t EADCPSCNT1; /*!< [0x0194] EPWM Trigger EADC Prescale Counter Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE11[26]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPINEN; /*!< [0x0200] EPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] EPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] EPWM Capture Status Register */ - ECAPDAT_T CAPDAT[6]; /*!< [0x020C] EPWM Rising and Falling Capture Data Register 0~5 */ - __IO uint32_t PDMACTL; /*!< [0x023c] EPWM PDMA Control Register */ - __I uint32_t PDMACAP[3]; /*!< [0x0240] EPWM Capture Channel 01,23,45 PDMA Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE12[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPIEN; /*!< [0x0250] EPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] EPWM Capture Interrupt Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE13[43]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t PBUF[6]; /*!< [0x0304] EPWM PERIOD0~5 Buffer */ - __I uint32_t CMPBUF[6]; /*!< [0x031c] EPWM CMPDAT0~5 Buffer */ - __I uint32_t CPSCBUF[3]; /*!< [0x0334] EPWM CLKPSC0_1/2_3/4_5 Buffer */ - __I uint32_t FTCBUF[3]; /*!< [0x0340] EPWM FTCMPDAT0_1/2_3/4_5 Buffer */ - __IO uint32_t FTCI; /*!< [0x034c] EPWM FTCMPDAT Indicator Register */ - -} EPWM_T; - -/** - @addtogroup EPWM_CONST EPWM Bit Field Definition - Constant Definitions for EPWM Controller -@{ */ - -#define EPWM_CTL0_CTRLD0_Pos (0) /*!< EPWM_T::CTL0: CTRLD0 Position */ -#define EPWM_CTL0_CTRLD0_Msk (0x1ul << EPWM_CTL0_CTRLD0_Pos) /*!< EPWM_T::CTL0: CTRLD0 Mask */ - -#define EPWM_CTL0_CTRLD1_Pos (1) /*!< EPWM_T::CTL0: CTRLD1 Position */ -#define EPWM_CTL0_CTRLD1_Msk (0x1ul << EPWM_CTL0_CTRLD1_Pos) /*!< EPWM_T::CTL0: CTRLD1 Mask */ - -#define EPWM_CTL0_CTRLD2_Pos (2) /*!< EPWM_T::CTL0: CTRLD2 Position */ -#define EPWM_CTL0_CTRLD2_Msk (0x1ul << EPWM_CTL0_CTRLD2_Pos) /*!< EPWM_T::CTL0: CTRLD2 Mask */ - -#define EPWM_CTL0_CTRLD3_Pos (3) /*!< EPWM_T::CTL0: CTRLD3 Position */ -#define EPWM_CTL0_CTRLD3_Msk (0x1ul << EPWM_CTL0_CTRLD3_Pos) /*!< EPWM_T::CTL0: CTRLD3 Mask */ - -#define EPWM_CTL0_CTRLD4_Pos (4) /*!< EPWM_T::CTL0: CTRLD4 Position */ -#define EPWM_CTL0_CTRLD4_Msk (0x1ul << EPWM_CTL0_CTRLD4_Pos) /*!< EPWM_T::CTL0: CTRLD4 Mask */ - -#define EPWM_CTL0_CTRLD5_Pos (5) /*!< EPWM_T::CTL0: CTRLD5 Position */ -#define EPWM_CTL0_CTRLD5_Msk (0x1ul << EPWM_CTL0_CTRLD5_Pos) /*!< EPWM_T::CTL0: CTRLD5 Mask */ - -#define EPWM_CTL0_WINLDEN0_Pos (8) /*!< EPWM_T::CTL0: WINLDEN0 Position */ -#define EPWM_CTL0_WINLDEN0_Msk (0x1ul << EPWM_CTL0_WINLDEN0_Pos) /*!< EPWM_T::CTL0: WINLDEN0 Mask */ - -#define EPWM_CTL0_WINLDEN1_Pos (9) /*!< EPWM_T::CTL0: WINLDEN1 Position */ -#define EPWM_CTL0_WINLDEN1_Msk (0x1ul << EPWM_CTL0_WINLDEN1_Pos) /*!< EPWM_T::CTL0: WINLDEN1 Mask */ - -#define EPWM_CTL0_WINLDEN2_Pos (10) /*!< EPWM_T::CTL0: WINLDEN2 Position */ -#define EPWM_CTL0_WINLDEN2_Msk (0x1ul << EPWM_CTL0_WINLDEN2_Pos) /*!< EPWM_T::CTL0: WINLDEN2 Mask */ - -#define EPWM_CTL0_WINLDEN3_Pos (11) /*!< EPWM_T::CTL0: WINLDEN3 Position */ -#define EPWM_CTL0_WINLDEN3_Msk (0x1ul << EPWM_CTL0_WINLDEN3_Pos) /*!< EPWM_T::CTL0: WINLDEN3 Mask */ - -#define EPWM_CTL0_WINLDEN4_Pos (12) /*!< EPWM_T::CTL0: WINLDEN4 Position */ -#define EPWM_CTL0_WINLDEN4_Msk (0x1ul << EPWM_CTL0_WINLDEN4_Pos) /*!< EPWM_T::CTL0: WINLDEN4 Mask */ - -#define EPWM_CTL0_WINLDEN5_Pos (13) /*!< EPWM_T::CTL0: WINLDEN5 Position */ -#define EPWM_CTL0_WINLDEN5_Msk (0x1ul << EPWM_CTL0_WINLDEN5_Pos) /*!< EPWM_T::CTL0: WINLDEN5 Mask */ - -#define EPWM_CTL0_IMMLDEN0_Pos (16) /*!< EPWM_T::CTL0: IMMLDEN0 Position */ -#define EPWM_CTL0_IMMLDEN0_Msk (0x1ul << EPWM_CTL0_IMMLDEN0_Pos) /*!< EPWM_T::CTL0: IMMLDEN0 Mask */ - -#define EPWM_CTL0_IMMLDEN1_Pos (17) /*!< EPWM_T::CTL0: IMMLDEN1 Position */ -#define EPWM_CTL0_IMMLDEN1_Msk (0x1ul << EPWM_CTL0_IMMLDEN1_Pos) /*!< EPWM_T::CTL0: IMMLDEN1 Mask */ - -#define EPWM_CTL0_IMMLDEN2_Pos (18) /*!< EPWM_T::CTL0: IMMLDEN2 Position */ -#define EPWM_CTL0_IMMLDEN2_Msk (0x1ul << EPWM_CTL0_IMMLDEN2_Pos) /*!< EPWM_T::CTL0: IMMLDEN2 Mask */ - -#define EPWM_CTL0_IMMLDEN3_Pos (19) /*!< EPWM_T::CTL0: IMMLDEN3 Position */ -#define EPWM_CTL0_IMMLDEN3_Msk (0x1ul << EPWM_CTL0_IMMLDEN3_Pos) /*!< EPWM_T::CTL0: IMMLDEN3 Mask */ - -#define EPWM_CTL0_IMMLDEN4_Pos (20) /*!< EPWM_T::CTL0: IMMLDEN4 Position */ -#define EPWM_CTL0_IMMLDEN4_Msk (0x1ul << EPWM_CTL0_IMMLDEN4_Pos) /*!< EPWM_T::CTL0: IMMLDEN4 Mask */ - -#define EPWM_CTL0_IMMLDEN5_Pos (21) /*!< EPWM_T::CTL0: IMMLDEN5 Position */ -#define EPWM_CTL0_IMMLDEN5_Msk (0x1ul << EPWM_CTL0_IMMLDEN5_Pos) /*!< EPWM_T::CTL0: IMMLDEN5 Mask */ - -#define EPWM_CTL0_GROUPEN_Pos (24) /*!< EPWM_T::CTL0: GROUPEN Position */ -#define EPWM_CTL0_GROUPEN_Msk (0x1ul << EPWM_CTL0_GROUPEN_Pos) /*!< EPWM_T::CTL0: GROUPEN Mask */ - -#define EPWM_CTL0_DBGHALT_Pos (30) /*!< EPWM_T::CTL0: DBGHALT Position */ -#define EPWM_CTL0_DBGHALT_Msk (0x1ul << EPWM_CTL0_DBGHALT_Pos) /*!< EPWM_T::CTL0: DBGHALT Mask */ - -#define EPWM_CTL0_DBGTRIOFF_Pos (31) /*!< EPWM_T::CTL0: DBGTRIOFF Position */ -#define EPWM_CTL0_DBGTRIOFF_Msk (0x1ul << EPWM_CTL0_DBGTRIOFF_Pos) /*!< EPWM_T::CTL0: DBGTRIOFF Mask */ - -#define EPWM_CTL1_CNTTYPE0_Pos (0) /*!< EPWM_T::CTL1: CNTTYPE0 Position */ -#define EPWM_CTL1_CNTTYPE0_Msk (0x3ul << EPWM_CTL1_CNTTYPE0_Pos) /*!< EPWM_T::CTL1: CNTTYPE0 Mask */ - -#define EPWM_CTL1_CNTTYPE1_Pos (2) /*!< EPWM_T::CTL1: CNTTYPE1 Position */ -#define EPWM_CTL1_CNTTYPE1_Msk (0x3ul << EPWM_CTL1_CNTTYPE1_Pos) /*!< EPWM_T::CTL1: CNTTYPE1 Mask */ - -#define EPWM_CTL1_CNTTYPE2_Pos (4) /*!< EPWM_T::CTL1: CNTTYPE2 Position */ -#define EPWM_CTL1_CNTTYPE2_Msk (0x3ul << EPWM_CTL1_CNTTYPE2_Pos) /*!< EPWM_T::CTL1: CNTTYPE2 Mask */ - -#define EPWM_CTL1_CNTTYPE3_Pos (6) /*!< EPWM_T::CTL1: CNTTYPE3 Position */ -#define EPWM_CTL1_CNTTYPE3_Msk (0x3ul << EPWM_CTL1_CNTTYPE3_Pos) /*!< EPWM_T::CTL1: CNTTYPE3 Mask */ - -#define EPWM_CTL1_CNTTYPE4_Pos (8) /*!< EPWM_T::CTL1: CNTTYPE4 Position */ -#define EPWM_CTL1_CNTTYPE4_Msk (0x3ul << EPWM_CTL1_CNTTYPE4_Pos) /*!< EPWM_T::CTL1: CNTTYPE4 Mask */ - -#define EPWM_CTL1_CNTTYPE5_Pos (10) /*!< EPWM_T::CTL1: CNTTYPE5 Position */ -#define EPWM_CTL1_CNTTYPE5_Msk (0x3ul << EPWM_CTL1_CNTTYPE5_Pos) /*!< EPWM_T::CTL1: CNTTYPE5 Mask */ - -#define EPWM_CTL1_CNTMODE0_Pos (16) /*!< EPWM_T::CTL1: CNTMODE0 Position */ -#define EPWM_CTL1_CNTMODE0_Msk (0x1ul << EPWM_CTL1_CNTMODE0_Pos) /*!< EPWM_T::CTL1: CNTMODE0 Mask */ - -#define EPWM_CTL1_CNTMODE1_Pos (17) /*!< EPWM_T::CTL1: CNTMODE1 Position */ -#define EPWM_CTL1_CNTMODE1_Msk (0x1ul << EPWM_CTL1_CNTMODE1_Pos) /*!< EPWM_T::CTL1: CNTMODE1 Mask */ - -#define EPWM_CTL1_CNTMODE2_Pos (18) /*!< EPWM_T::CTL1: CNTMODE2 Position */ -#define EPWM_CTL1_CNTMODE2_Msk (0x1ul << EPWM_CTL1_CNTMODE2_Pos) /*!< EPWM_T::CTL1: CNTMODE2 Mask */ - -#define EPWM_CTL1_CNTMODE3_Pos (19) /*!< EPWM_T::CTL1: CNTMODE3 Position */ -#define EPWM_CTL1_CNTMODE3_Msk (0x1ul << EPWM_CTL1_CNTMODE3_Pos) /*!< EPWM_T::CTL1: CNTMODE3 Mask */ - -#define EPWM_CTL1_CNTMODE4_Pos (20) /*!< EPWM_T::CTL1: CNTMODE4 Position */ -#define EPWM_CTL1_CNTMODE4_Msk (0x1ul << EPWM_CTL1_CNTMODE4_Pos) /*!< EPWM_T::CTL1: CNTMODE4 Mask */ - -#define EPWM_CTL1_CNTMODE5_Pos (21) /*!< EPWM_T::CTL1: CNTMODE5 Position */ -#define EPWM_CTL1_CNTMODE5_Msk (0x1ul << EPWM_CTL1_CNTMODE5_Pos) /*!< EPWM_T::CTL1: CNTMODE5 Mask */ - -#define EPWM_CTL1_OUTMODE0_Pos (24) /*!< EPWM_T::CTL1: OUTMODE0 Position */ -#define EPWM_CTL1_OUTMODE0_Msk (0x1ul << EPWM_CTL1_OUTMODE0_Pos) /*!< EPWM_T::CTL1: OUTMODE0 Mask */ - -#define EPWM_CTL1_OUTMODE2_Pos (25) /*!< EPWM_T::CTL1: OUTMODE2 Position */ -#define EPWM_CTL1_OUTMODE2_Msk (0x1ul << EPWM_CTL1_OUTMODE2_Pos) /*!< EPWM_T::CTL1: OUTMODE2 Mask */ - -#define EPWM_CTL1_OUTMODE4_Pos (26) /*!< EPWM_T::CTL1: OUTMODE4 Position */ -#define EPWM_CTL1_OUTMODE4_Msk (0x1ul << EPWM_CTL1_OUTMODE4_Pos) /*!< EPWM_T::CTL1: OUTMODE4 Mask */ - -#define EPWM_SYNC_PHSEN0_Pos (0) /*!< EPWM_T::SYNC: PHSEN0 Position */ -#define EPWM_SYNC_PHSEN0_Msk (0x1ul << EPWM_SYNC_PHSEN0_Pos) /*!< EPWM_T::SYNC: PHSEN0 Mask */ - -#define EPWM_SYNC_PHSEN2_Pos (1) /*!< EPWM_T::SYNC: PHSEN2 Position */ -#define EPWM_SYNC_PHSEN2_Msk (0x1ul << EPWM_SYNC_PHSEN2_Pos) /*!< EPWM_T::SYNC: PHSEN2 Mask */ - -#define EPWM_SYNC_PHSEN4_Pos (2) /*!< EPWM_T::SYNC: PHSEN4 Position */ -#define EPWM_SYNC_PHSEN4_Msk (0x1ul << EPWM_SYNC_PHSEN4_Pos) /*!< EPWM_T::SYNC: PHSEN4 Mask */ - -#define EPWM_SYNC_SINSRC0_Pos (8) /*!< EPWM_T::SYNC: SINSRC0 Position */ -#define EPWM_SYNC_SINSRC0_Msk (0x3ul << EPWM_SYNC_SINSRC0_Pos) /*!< EPWM_T::SYNC: SINSRC0 Mask */ - -#define EPWM_SYNC_SINSRC2_Pos (10) /*!< EPWM_T::SYNC: SINSRC2 Position */ -#define EPWM_SYNC_SINSRC2_Msk (0x3ul << EPWM_SYNC_SINSRC2_Pos) /*!< EPWM_T::SYNC: SINSRC2 Mask */ - -#define EPWM_SYNC_SINSRC4_Pos (12) /*!< EPWM_T::SYNC: SINSRC4 Position */ -#define EPWM_SYNC_SINSRC4_Msk (0x3ul << EPWM_SYNC_SINSRC4_Pos) /*!< EPWM_T::SYNC: SINSRC4 Mask */ - -#define EPWM_SYNC_SNFLTEN_Pos (16) /*!< EPWM_T::SYNC: SNFLTEN Position */ -#define EPWM_SYNC_SNFLTEN_Msk (0x1ul << EPWM_SYNC_SNFLTEN_Pos) /*!< EPWM_T::SYNC: SNFLTEN Mask */ - -#define EPWM_SYNC_SFLTCSEL_Pos (17) /*!< EPWM_T::SYNC: SFLTCSEL Position */ -#define EPWM_SYNC_SFLTCSEL_Msk (0x7ul << EPWM_SYNC_SFLTCSEL_Pos) /*!< EPWM_T::SYNC: SFLTCSEL Mask */ - -#define EPWM_SYNC_SFLTCNT_Pos (20) /*!< EPWM_T::SYNC: SFLTCNT Position */ -#define EPWM_SYNC_SFLTCNT_Msk (0x7ul << EPWM_SYNC_SFLTCNT_Pos) /*!< EPWM_T::SYNC: SFLTCNT Mask */ - -#define EPWM_SYNC_SINPINV_Pos (23) /*!< EPWM_T::SYNC: SINPINV Position */ -#define EPWM_SYNC_SINPINV_Msk (0x1ul << EPWM_SYNC_SINPINV_Pos) /*!< EPWM_T::SYNC: SINPINV Mask */ - -#define EPWM_SYNC_PHSDIR0_Pos (24) /*!< EPWM_T::SYNC: PHSDIR0 Position */ -#define EPWM_SYNC_PHSDIR0_Msk (0x1ul << EPWM_SYNC_PHSDIR0_Pos) /*!< EPWM_T::SYNC: PHSDIR0 Mask */ - -#define EPWM_SYNC_PHSDIR2_Pos (25) /*!< EPWM_T::SYNC: PHSDIR2 Position */ -#define EPWM_SYNC_PHSDIR2_Msk (0x1ul << EPWM_SYNC_PHSDIR2_Pos) /*!< EPWM_T::SYNC: PHSDIR2 Mask */ - -#define EPWM_SYNC_PHSDIR4_Pos (26) /*!< EPWM_T::SYNC: PHSDIR4 Position */ -#define EPWM_SYNC_PHSDIR4_Msk (0x1ul << EPWM_SYNC_PHSDIR4_Pos) /*!< EPWM_T::SYNC: PHSDIR4 Mask */ - -#define EPWM_SWSYNC_SWSYNC0_Pos (0) /*!< EPWM_T::SWSYNC: SWSYNC0 Position */ -#define EPWM_SWSYNC_SWSYNC0_Msk (0x1ul << EPWM_SWSYNC_SWSYNC0_Pos) /*!< EPWM_T::SWSYNC: SWSYNC0 Mask */ - -#define EPWM_SWSYNC_SWSYNC2_Pos (1) /*!< EPWM_T::SWSYNC: SWSYNC2 Position */ -#define EPWM_SWSYNC_SWSYNC2_Msk (0x1ul << EPWM_SWSYNC_SWSYNC2_Pos) /*!< EPWM_T::SWSYNC: SWSYNC2 Mask */ - -#define EPWM_SWSYNC_SWSYNC4_Pos (2) /*!< EPWM_T::SWSYNC: SWSYNC4 Position */ -#define EPWM_SWSYNC_SWSYNC4_Msk (0x1ul << EPWM_SWSYNC_SWSYNC4_Pos) /*!< EPWM_T::SWSYNC: SWSYNC4 Mask */ - -#define EPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< EPWM_T::CLKSRC: ECLKSRC0 Position */ -#define EPWM_CLKSRC_ECLKSRC0_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC0_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define EPWM_CLKSRC_ECLKSRC2_Pos (8) /*!< EPWM_T::CLKSRC: ECLKSRC2 Position */ -#define EPWM_CLKSRC_ECLKSRC2_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC2_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC2 Mask */ - -#define EPWM_CLKSRC_ECLKSRC4_Pos (16) /*!< EPWM_T::CLKSRC: ECLKSRC4 Position */ -#define EPWM_CLKSRC_ECLKSRC4_Msk (0x7ul << EPWM_CLKSRC_ECLKSRC4_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC4 Mask */ - -#define EPWM_CLKPSC0_1_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC0_1: CLKPSC Position */ -#define EPWM_CLKPSC0_1_CLKPSC_Msk (0xffful << EPWM_CLKPSC0_1_CLKPSC_Pos) /*!< EPWM_T::CLKPSC0_1: CLKPSC Mask */ - -#define EPWM_CLKPSC2_3_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC2_3: CLKPSC Position */ -#define EPWM_CLKPSC2_3_CLKPSC_Msk (0xffful << EPWM_CLKPSC2_3_CLKPSC_Pos) /*!< EPWM_T::CLKPSC2_3: CLKPSC Mask */ - -#define EPWM_CLKPSC4_5_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC4_5: CLKPSC Position */ -#define EPWM_CLKPSC4_5_CLKPSC_Msk (0xffful << EPWM_CLKPSC4_5_CLKPSC_Pos) /*!< EPWM_T::CLKPSC4_5: CLKPSC Mask */ - -#define EPWM_CNTEN_CNTEN0_Pos (0) /*!< EPWM_T::CNTEN: CNTEN0 Position */ -#define EPWM_CNTEN_CNTEN0_Msk (0x1ul << EPWM_CNTEN_CNTEN0_Pos) /*!< EPWM_T::CNTEN: CNTEN0 Mask */ - -#define EPWM_CNTEN_CNTEN1_Pos (1) /*!< EPWM_T::CNTEN: CNTEN1 Position */ -#define EPWM_CNTEN_CNTEN1_Msk (0x1ul << EPWM_CNTEN_CNTEN1_Pos) /*!< EPWM_T::CNTEN: CNTEN1 Mask */ - -#define EPWM_CNTEN_CNTEN2_Pos (2) /*!< EPWM_T::CNTEN: CNTEN2 Position */ -#define EPWM_CNTEN_CNTEN2_Msk (0x1ul << EPWM_CNTEN_CNTEN2_Pos) /*!< EPWM_T::CNTEN: CNTEN2 Mask */ - -#define EPWM_CNTEN_CNTEN3_Pos (3) /*!< EPWM_T::CNTEN: CNTEN3 Position */ -#define EPWM_CNTEN_CNTEN3_Msk (0x1ul << EPWM_CNTEN_CNTEN3_Pos) /*!< EPWM_T::CNTEN: CNTEN3 Mask */ - -#define EPWM_CNTEN_CNTEN4_Pos (4) /*!< EPWM_T::CNTEN: CNTEN4 Position */ -#define EPWM_CNTEN_CNTEN4_Msk (0x1ul << EPWM_CNTEN_CNTEN4_Pos) /*!< EPWM_T::CNTEN: CNTEN4 Mask */ - -#define EPWM_CNTEN_CNTEN5_Pos (5) /*!< EPWM_T::CNTEN: CNTEN5 Position */ -#define EPWM_CNTEN_CNTEN5_Msk (0x1ul << EPWM_CNTEN_CNTEN5_Pos) /*!< EPWM_T::CNTEN: CNTEN5 Mask */ - -#define EPWM_CNTCLR_CNTCLR0_Pos (0) /*!< EPWM_T::CNTCLR: CNTCLR0 Position */ -#define EPWM_CNTCLR_CNTCLR0_Msk (0x1ul << EPWM_CNTCLR_CNTCLR0_Pos) /*!< EPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define EPWM_CNTCLR_CNTCLR1_Pos (1) /*!< EPWM_T::CNTCLR: CNTCLR1 Position */ -#define EPWM_CNTCLR_CNTCLR1_Msk (0x1ul << EPWM_CNTCLR_CNTCLR1_Pos) /*!< EPWM_T::CNTCLR: CNTCLR1 Mask */ - -#define EPWM_CNTCLR_CNTCLR2_Pos (2) /*!< EPWM_T::CNTCLR: CNTCLR2 Position */ -#define EPWM_CNTCLR_CNTCLR2_Msk (0x1ul << EPWM_CNTCLR_CNTCLR2_Pos) /*!< EPWM_T::CNTCLR: CNTCLR2 Mask */ - -#define EPWM_CNTCLR_CNTCLR3_Pos (3) /*!< EPWM_T::CNTCLR: CNTCLR3 Position */ -#define EPWM_CNTCLR_CNTCLR3_Msk (0x1ul << EPWM_CNTCLR_CNTCLR3_Pos) /*!< EPWM_T::CNTCLR: CNTCLR3 Mask */ - -#define EPWM_CNTCLR_CNTCLR4_Pos (4) /*!< EPWM_T::CNTCLR: CNTCLR4 Position */ -#define EPWM_CNTCLR_CNTCLR4_Msk (0x1ul << EPWM_CNTCLR_CNTCLR4_Pos) /*!< EPWM_T::CNTCLR: CNTCLR4 Mask */ - -#define EPWM_CNTCLR_CNTCLR5_Pos (5) /*!< EPWM_T::CNTCLR: CNTCLR5 Position */ -#define EPWM_CNTCLR_CNTCLR5_Msk (0x1ul << EPWM_CNTCLR_CNTCLR5_Pos) /*!< EPWM_T::CNTCLR: CNTCLR5 Mask */ - -#define EPWM_LOAD_LOAD0_Pos (0) /*!< EPWM_T::LOAD: LOAD0 Position */ -#define EPWM_LOAD_LOAD0_Msk (0x1ul << EPWM_LOAD_LOAD0_Pos) /*!< EPWM_T::LOAD: LOAD0 Mask */ - -#define EPWM_LOAD_LOAD1_Pos (1) /*!< EPWM_T::LOAD: LOAD1 Position */ -#define EPWM_LOAD_LOAD1_Msk (0x1ul << EPWM_LOAD_LOAD1_Pos) /*!< EPWM_T::LOAD: LOAD1 Mask */ - -#define EPWM_LOAD_LOAD2_Pos (2) /*!< EPWM_T::LOAD: LOAD2 Position */ -#define EPWM_LOAD_LOAD2_Msk (0x1ul << EPWM_LOAD_LOAD2_Pos) /*!< EPWM_T::LOAD: LOAD2 Mask */ - -#define EPWM_LOAD_LOAD3_Pos (3) /*!< EPWM_T::LOAD: LOAD3 Position */ -#define EPWM_LOAD_LOAD3_Msk (0x1ul << EPWM_LOAD_LOAD3_Pos) /*!< EPWM_T::LOAD: LOAD3 Mask */ - -#define EPWM_LOAD_LOAD4_Pos (4) /*!< EPWM_T::LOAD: LOAD4 Position */ -#define EPWM_LOAD_LOAD4_Msk (0x1ul << EPWM_LOAD_LOAD4_Pos) /*!< EPWM_T::LOAD: LOAD4 Mask */ - -#define EPWM_LOAD_LOAD5_Pos (5) /*!< EPWM_T::LOAD: LOAD5 Position */ -#define EPWM_LOAD_LOAD5_Msk (0x1ul << EPWM_LOAD_LOAD5_Pos) /*!< EPWM_T::LOAD: LOAD5 Mask */ - -#define EPWM_PERIOD0_PERIOD_Pos (0) /*!< EPWM_T::PERIOD0: PERIOD Position */ -#define EPWM_PERIOD0_PERIOD_Msk (0xfffful << EPWM_PERIOD0_PERIOD_Pos) /*!< EPWM_T::PERIOD0: PERIOD Mask */ - -#define EPWM_PERIOD1_PERIOD_Pos (0) /*!< EPWM_T::PERIOD1: PERIOD Position */ -#define EPWM_PERIOD1_PERIOD_Msk (0xfffful << EPWM_PERIOD1_PERIOD_Pos) /*!< EPWM_T::PERIOD1: PERIOD Mask */ - -#define EPWM_PERIOD2_PERIOD_Pos (0) /*!< EPWM_T::PERIOD2: PERIOD Position */ -#define EPWM_PERIOD2_PERIOD_Msk (0xfffful << EPWM_PERIOD2_PERIOD_Pos) /*!< EPWM_T::PERIOD2: PERIOD Mask */ - -#define EPWM_PERIOD3_PERIOD_Pos (0) /*!< EPWM_T::PERIOD3: PERIOD Position */ -#define EPWM_PERIOD3_PERIOD_Msk (0xfffful << EPWM_PERIOD3_PERIOD_Pos) /*!< EPWM_T::PERIOD3: PERIOD Mask */ - -#define EPWM_PERIOD4_PERIOD_Pos (0) /*!< EPWM_T::PERIOD4: PERIOD Position */ -#define EPWM_PERIOD4_PERIOD_Msk (0xfffful << EPWM_PERIOD4_PERIOD_Pos) /*!< EPWM_T::PERIOD4: PERIOD Mask */ - -#define EPWM_PERIOD5_PERIOD_Pos (0) /*!< EPWM_T::PERIOD5: PERIOD Position */ -#define EPWM_PERIOD5_PERIOD_Msk (0xfffful << EPWM_PERIOD5_PERIOD_Pos) /*!< EPWM_T::PERIOD5: PERIOD Mask */ - -#define EPWM_CMPDAT0_CMP_Pos (0) /*!< EPWM_T::CMPDAT0: CMP Position */ -#define EPWM_CMPDAT0_CMP_Msk (0xfffful << EPWM_CMPDAT0_CMP_Pos) /*!< EPWM_T::CMPDAT0: CMP Mask */ - -#define EPWM_CMPDAT1_CMP_Pos (0) /*!< EPWM_T::CMPDAT1: CMP Position */ -#define EPWM_CMPDAT1_CMP_Msk (0xfffful << EPWM_CMPDAT1_CMP_Pos) /*!< EPWM_T::CMPDAT1: CMP Mask */ - -#define EPWM_CMPDAT2_CMP_Pos (0) /*!< EPWM_T::CMPDAT2: CMP Position */ -#define EPWM_CMPDAT2_CMP_Msk (0xfffful << EPWM_CMPDAT2_CMP_Pos) /*!< EPWM_T::CMPDAT2: CMP Mask */ - -#define EPWM_CMPDAT3_CMP_Pos (0) /*!< EPWM_T::CMPDAT3: CMP Position */ -#define EPWM_CMPDAT3_CMP_Msk (0xfffful << EPWM_CMPDAT3_CMP_Pos) /*!< EPWM_T::CMPDAT3: CMP Mask */ - -#define EPWM_CMPDAT4_CMP_Pos (0) /*!< EPWM_T::CMPDAT4: CMP Position */ -#define EPWM_CMPDAT4_CMP_Msk (0xfffful << EPWM_CMPDAT4_CMP_Pos) /*!< EPWM_T::CMPDAT4: CMP Mask */ - -#define EPWM_CMPDAT5_CMP_Pos (0) /*!< EPWM_T::CMPDAT5: CMP Position */ -#define EPWM_CMPDAT5_CMP_Msk (0xfffful << EPWM_CMPDAT5_CMP_Pos) /*!< EPWM_T::CMPDAT5: CMP Mask */ - -#define EPWM_DTCTL0_1_DTCNT_Pos (0) /*!< EPWM_T::DTCTL0_1: DTCNT Position */ -#define EPWM_DTCTL0_1_DTCNT_Msk (0xffful << EPWM_DTCTL0_1_DTCNT_Pos) /*!< EPWM_T::DTCTL0_1: DTCNT Mask */ - -#define EPWM_DTCTL0_1_DTEN_Pos (16) /*!< EPWM_T::DTCTL0_1: DTEN Position */ -#define EPWM_DTCTL0_1_DTEN_Msk (0x1ul << EPWM_DTCTL0_1_DTEN_Pos) /*!< EPWM_T::DTCTL0_1: DTEN Mask */ - -#define EPWM_DTCTL0_1_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL0_1: DTCKSEL Position */ -#define EPWM_DTCTL0_1_DTCKSEL_Msk (0x1ul << EPWM_DTCTL0_1_DTCKSEL_Pos) /*!< EPWM_T::DTCTL0_1: DTCKSEL Mask */ - -#define EPWM_DTCTL2_3_DTCNT_Pos (0) /*!< EPWM_T::DTCTL2_3: DTCNT Position */ -#define EPWM_DTCTL2_3_DTCNT_Msk (0xffful << EPWM_DTCTL2_3_DTCNT_Pos) /*!< EPWM_T::DTCTL2_3: DTCNT Mask */ - -#define EPWM_DTCTL2_3_DTEN_Pos (16) /*!< EPWM_T::DTCTL2_3: DTEN Position */ -#define EPWM_DTCTL2_3_DTEN_Msk (0x1ul << EPWM_DTCTL2_3_DTEN_Pos) /*!< EPWM_T::DTCTL2_3: DTEN Mask */ - -#define EPWM_DTCTL2_3_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL2_3: DTCKSEL Position */ -#define EPWM_DTCTL2_3_DTCKSEL_Msk (0x1ul << EPWM_DTCTL2_3_DTCKSEL_Pos) /*!< EPWM_T::DTCTL2_3: DTCKSEL Mask */ - -#define EPWM_DTCTL4_5_DTCNT_Pos (0) /*!< EPWM_T::DTCTL4_5: DTCNT Position */ -#define EPWM_DTCTL4_5_DTCNT_Msk (0xffful << EPWM_DTCTL4_5_DTCNT_Pos) /*!< EPWM_T::DTCTL4_5: DTCNT Mask */ - -#define EPWM_DTCTL4_5_DTEN_Pos (16) /*!< EPWM_T::DTCTL4_5: DTEN Position */ -#define EPWM_DTCTL4_5_DTEN_Msk (0x1ul << EPWM_DTCTL4_5_DTEN_Pos) /*!< EPWM_T::DTCTL4_5: DTEN Mask */ - -#define EPWM_DTCTL4_5_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL4_5: DTCKSEL Position */ -#define EPWM_DTCTL4_5_DTCKSEL_Msk (0x1ul << EPWM_DTCTL4_5_DTCKSEL_Pos) /*!< EPWM_T::DTCTL4_5: DTCKSEL Mask */ - -#define EPWM_PHS0_1_PHS_Pos (0) /*!< EPWM_T::PHS0_1: PHS Position */ -#define EPWM_PHS0_1_PHS_Msk (0xfffful << EPWM_PHS0_1_PHS_Pos) /*!< EPWM_T::PHS0_1: PHS Mask */ - -#define EPWM_PHS2_3_PHS_Pos (0) /*!< EPWM_T::PHS2_3: PHS Position */ -#define EPWM_PHS2_3_PHS_Msk (0xfffful << EPWM_PHS2_3_PHS_Pos) /*!< EPWM_T::PHS2_3: PHS Mask */ - -#define EPWM_PHS4_5_PHS_Pos (0) /*!< EPWM_T::PHS4_5: PHS Position */ -#define EPWM_PHS4_5_PHS_Msk (0xfffful << EPWM_PHS4_5_PHS_Pos) /*!< EPWM_T::PHS4_5: PHS Mask */ - -#define EPWM_CNT0_CNT_Pos (0) /*!< EPWM_T::CNT0: CNT Position */ -#define EPWM_CNT0_CNT_Msk (0xfffful << EPWM_CNT0_CNT_Pos) /*!< EPWM_T::CNT0: CNT Mask */ - -#define EPWM_CNT0_DIRF_Pos (16) /*!< EPWM_T::CNT0: DIRF Position */ -#define EPWM_CNT0_DIRF_Msk (0x1ul << EPWM_CNT0_DIRF_Pos) /*!< EPWM_T::CNT0: DIRF Mask */ - -#define EPWM_CNT1_CNT_Pos (0) /*!< EPWM_T::CNT1: CNT Position */ -#define EPWM_CNT1_CNT_Msk (0xfffful << EPWM_CNT1_CNT_Pos) /*!< EPWM_T::CNT1: CNT Mask */ - -#define EPWM_CNT1_DIRF_Pos (16) /*!< EPWM_T::CNT1: DIRF Position */ -#define EPWM_CNT1_DIRF_Msk (0x1ul << EPWM_CNT1_DIRF_Pos) /*!< EPWM_T::CNT1: DIRF Mask */ - -#define EPWM_CNT2_CNT_Pos (0) /*!< EPWM_T::CNT2: CNT Position */ -#define EPWM_CNT2_CNT_Msk (0xfffful << EPWM_CNT2_CNT_Pos) /*!< EPWM_T::CNT2: CNT Mask */ - -#define EPWM_CNT2_DIRF_Pos (16) /*!< EPWM_T::CNT2: DIRF Position */ -#define EPWM_CNT2_DIRF_Msk (0x1ul << EPWM_CNT2_DIRF_Pos) /*!< EPWM_T::CNT2: DIRF Mask */ - -#define EPWM_CNT3_CNT_Pos (0) /*!< EPWM_T::CNT3: CNT Position */ -#define EPWM_CNT3_CNT_Msk (0xfffful << EPWM_CNT3_CNT_Pos) /*!< EPWM_T::CNT3: CNT Mask */ - -#define EPWM_CNT3_DIRF_Pos (16) /*!< EPWM_T::CNT3: DIRF Position */ -#define EPWM_CNT3_DIRF_Msk (0x1ul << EPWM_CNT3_DIRF_Pos) /*!< EPWM_T::CNT3: DIRF Mask */ - -#define EPWM_CNT4_CNT_Pos (0) /*!< EPWM_T::CNT4: CNT Position */ -#define EPWM_CNT4_CNT_Msk (0xfffful << EPWM_CNT4_CNT_Pos) /*!< EPWM_T::CNT4: CNT Mask */ - -#define EPWM_CNT4_DIRF_Pos (16) /*!< EPWM_T::CNT4: DIRF Position */ -#define EPWM_CNT4_DIRF_Msk (0x1ul << EPWM_CNT4_DIRF_Pos) /*!< EPWM_T::CNT4: DIRF Mask */ - -#define EPWM_CNT5_CNT_Pos (0) /*!< EPWM_T::CNT5: CNT Position */ -#define EPWM_CNT5_CNT_Msk (0xfffful << EPWM_CNT5_CNT_Pos) /*!< EPWM_T::CNT5: CNT Mask */ - -#define EPWM_CNT5_DIRF_Pos (16) /*!< EPWM_T::CNT5: DIRF Position */ -#define EPWM_CNT5_DIRF_Msk (0x1ul << EPWM_CNT5_DIRF_Pos) /*!< EPWM_T::CNT5: DIRF Mask */ - -#define EPWM_WGCTL0_ZPCTL0_Pos (0) /*!< EPWM_T::WGCTL0: ZPCTL0 Position */ -#define EPWM_WGCTL0_ZPCTL0_Msk (0x3ul << EPWM_WGCTL0_ZPCTL0_Pos) /*!< EPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define EPWM_WGCTL0_ZPCTL1_Pos (2) /*!< EPWM_T::WGCTL0: ZPCTL1 Position */ -#define EPWM_WGCTL0_ZPCTL1_Msk (0x3ul << EPWM_WGCTL0_ZPCTL1_Pos) /*!< EPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define EPWM_WGCTL0_ZPCTL2_Pos (4) /*!< EPWM_T::WGCTL0: ZPCTL2 Position */ -#define EPWM_WGCTL0_ZPCTL2_Msk (0x3ul << EPWM_WGCTL0_ZPCTL2_Pos) /*!< EPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define EPWM_WGCTL0_ZPCTL3_Pos (6) /*!< EPWM_T::WGCTL0: ZPCTL3 Position */ -#define EPWM_WGCTL0_ZPCTL3_Msk (0x3ul << EPWM_WGCTL0_ZPCTL3_Pos) /*!< EPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define EPWM_WGCTL0_ZPCTL4_Pos (8) /*!< EPWM_T::WGCTL0: ZPCTL4 Position */ -#define EPWM_WGCTL0_ZPCTL4_Msk (0x3ul << EPWM_WGCTL0_ZPCTL4_Pos) /*!< EPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define EPWM_WGCTL0_ZPCTL5_Pos (10) /*!< EPWM_T::WGCTL0: ZPCTL5 Position */ -#define EPWM_WGCTL0_ZPCTL5_Msk (0x3ul << EPWM_WGCTL0_ZPCTL5_Pos) /*!< EPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define EPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< EPWM_T::WGCTL0: PRDPCTL0 Position */ -#define EPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL0_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define EPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< EPWM_T::WGCTL0: PRDPCTL1 Position */ -#define EPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL1_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define EPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< EPWM_T::WGCTL0: PRDPCTL2 Position */ -#define EPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL2_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define EPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< EPWM_T::WGCTL0: PRDPCTL3 Position */ -#define EPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL3_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define EPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< EPWM_T::WGCTL0: PRDPCTL4 Position */ -#define EPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL4_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define EPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< EPWM_T::WGCTL0: PRDPCTL5 Position */ -#define EPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL5_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define EPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< EPWM_T::WGCTL1: CMPUCTL0 Position */ -#define EPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define EPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< EPWM_T::WGCTL1: CMPUCTL1 Position */ -#define EPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define EPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< EPWM_T::WGCTL1: CMPUCTL2 Position */ -#define EPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define EPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< EPWM_T::WGCTL1: CMPUCTL3 Position */ -#define EPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define EPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< EPWM_T::WGCTL1: CMPUCTL4 Position */ -#define EPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define EPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< EPWM_T::WGCTL1: CMPUCTL5 Position */ -#define EPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define EPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< EPWM_T::WGCTL1: CMPDCTL0 Position */ -#define EPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define EPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< EPWM_T::WGCTL1: CMPDCTL1 Position */ -#define EPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define EPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< EPWM_T::WGCTL1: CMPDCTL2 Position */ -#define EPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define EPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< EPWM_T::WGCTL1: CMPDCTL3 Position */ -#define EPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define EPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< EPWM_T::WGCTL1: CMPDCTL4 Position */ -#define EPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define EPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< EPWM_T::WGCTL1: CMPDCTL5 Position */ -#define EPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define EPWM_MSKEN_MSKEN0_Pos (0) /*!< EPWM_T::MSKEN: MSKEN0 Position */ -#define EPWM_MSKEN_MSKEN0_Msk (0x1ul << EPWM_MSKEN_MSKEN0_Pos) /*!< EPWM_T::MSKEN: MSKEN0 Mask */ - -#define EPWM_MSKEN_MSKEN1_Pos (1) /*!< EPWM_T::MSKEN: MSKEN1 Position */ -#define EPWM_MSKEN_MSKEN1_Msk (0x1ul << EPWM_MSKEN_MSKEN1_Pos) /*!< EPWM_T::MSKEN: MSKEN1 Mask */ - -#define EPWM_MSKEN_MSKEN2_Pos (2) /*!< EPWM_T::MSKEN: MSKEN2 Position */ -#define EPWM_MSKEN_MSKEN2_Msk (0x1ul << EPWM_MSKEN_MSKEN2_Pos) /*!< EPWM_T::MSKEN: MSKEN2 Mask */ - -#define EPWM_MSKEN_MSKEN3_Pos (3) /*!< EPWM_T::MSKEN: MSKEN3 Position */ -#define EPWM_MSKEN_MSKEN3_Msk (0x1ul << EPWM_MSKEN_MSKEN3_Pos) /*!< EPWM_T::MSKEN: MSKEN3 Mask */ - -#define EPWM_MSKEN_MSKEN4_Pos (4) /*!< EPWM_T::MSKEN: MSKEN4 Position */ -#define EPWM_MSKEN_MSKEN4_Msk (0x1ul << EPWM_MSKEN_MSKEN4_Pos) /*!< EPWM_T::MSKEN: MSKEN4 Mask */ - -#define EPWM_MSKEN_MSKEN5_Pos (5) /*!< EPWM_T::MSKEN: MSKEN5 Position */ -#define EPWM_MSKEN_MSKEN5_Msk (0x1ul << EPWM_MSKEN_MSKEN5_Pos) /*!< EPWM_T::MSKEN: MSKEN5 Mask */ - -#define EPWM_MSK_MSKDAT0_Pos (0) /*!< EPWM_T::MSK: MSKDAT0 Position */ -#define EPWM_MSK_MSKDAT0_Msk (0x1ul << EPWM_MSK_MSKDAT0_Pos) /*!< EPWM_T::MSK: MSKDAT0 Mask */ - -#define EPWM_MSK_MSKDAT1_Pos (1) /*!< EPWM_T::MSK: MSKDAT1 Position */ -#define EPWM_MSK_MSKDAT1_Msk (0x1ul << EPWM_MSK_MSKDAT1_Pos) /*!< EPWM_T::MSK: MSKDAT1 Mask */ - -#define EPWM_MSK_MSKDAT2_Pos (2) /*!< EPWM_T::MSK: MSKDAT2 Position */ -#define EPWM_MSK_MSKDAT2_Msk (0x1ul << EPWM_MSK_MSKDAT2_Pos) /*!< EPWM_T::MSK: MSKDAT2 Mask */ - -#define EPWM_MSK_MSKDAT3_Pos (3) /*!< EPWM_T::MSK: MSKDAT3 Position */ -#define EPWM_MSK_MSKDAT3_Msk (0x1ul << EPWM_MSK_MSKDAT3_Pos) /*!< EPWM_T::MSK: MSKDAT3 Mask */ - -#define EPWM_MSK_MSKDAT4_Pos (4) /*!< EPWM_T::MSK: MSKDAT4 Position */ -#define EPWM_MSK_MSKDAT4_Msk (0x1ul << EPWM_MSK_MSKDAT4_Pos) /*!< EPWM_T::MSK: MSKDAT4 Mask */ - -#define EPWM_MSK_MSKDAT5_Pos (5) /*!< EPWM_T::MSK: MSKDAT5 Position */ -#define EPWM_MSK_MSKDAT5_Msk (0x1ul << EPWM_MSK_MSKDAT5_Pos) /*!< EPWM_T::MSK: MSKDAT5 Mask */ - -#define EPWM_BNF_BRK0NFEN_Pos (0) /*!< EPWM_T::BNF: BRK0NFEN Position */ -#define EPWM_BNF_BRK0NFEN_Msk (0x1ul << EPWM_BNF_BRK0NFEN_Pos) /*!< EPWM_T::BNF: BRK0NFEN Mask */ - -#define EPWM_BNF_BRK0NFSEL_Pos (1) /*!< EPWM_T::BNF: BRK0NFSEL Position */ -#define EPWM_BNF_BRK0NFSEL_Msk (0x7ul << EPWM_BNF_BRK0NFSEL_Pos) /*!< EPWM_T::BNF: BRK0NFSEL Mask */ - -#define EPWM_BNF_BRK0FCNT_Pos (4) /*!< EPWM_T::BNF: BRK0FCNT Position */ -#define EPWM_BNF_BRK0FCNT_Msk (0x7ul << EPWM_BNF_BRK0FCNT_Pos) /*!< EPWM_T::BNF: BRK0FCNT Mask */ - -#define EPWM_BNF_BRK0PINV_Pos (7) /*!< EPWM_T::BNF: BRK0PINV Position */ -#define EPWM_BNF_BRK0PINV_Msk (0x1ul << EPWM_BNF_BRK0PINV_Pos) /*!< EPWM_T::BNF: BRK0PINV Mask */ - -#define EPWM_BNF_BRK1NFEN_Pos (8) /*!< EPWM_T::BNF: BRK1NFEN Position */ -#define EPWM_BNF_BRK1NFEN_Msk (0x1ul << EPWM_BNF_BRK1NFEN_Pos) /*!< EPWM_T::BNF: BRK1NFEN Mask */ - -#define EPWM_BNF_BRK1NFSEL_Pos (9) /*!< EPWM_T::BNF: BRK1NFSEL Position */ -#define EPWM_BNF_BRK1NFSEL_Msk (0x7ul << EPWM_BNF_BRK1NFSEL_Pos) /*!< EPWM_T::BNF: BRK1NFSEL Mask */ - -#define EPWM_BNF_BRK1FCNT_Pos (12) /*!< EPWM_T::BNF: BRK1FCNT Position */ -#define EPWM_BNF_BRK1FCNT_Msk (0x7ul << EPWM_BNF_BRK1FCNT_Pos) /*!< EPWM_T::BNF: BRK1FCNT Mask */ - -#define EPWM_BNF_BRK1PINV_Pos (15) /*!< EPWM_T::BNF: BRK1PINV Position */ -#define EPWM_BNF_BRK1PINV_Msk (0x1ul << EPWM_BNF_BRK1PINV_Pos) /*!< EPWM_T::BNF: BRK1PINV Mask */ - -#define EPWM_BNF_BK0SRC_Pos (16) /*!< EPWM_T::BNF: BK0SRC Position */ -#define EPWM_BNF_BK0SRC_Msk (0x1ul << EPWM_BNF_BK0SRC_Pos) /*!< EPWM_T::BNF: BK0SRC Mask */ - -#define EPWM_BNF_BK1SRC_Pos (24) /*!< EPWM_T::BNF: BK1SRC Position */ -#define EPWM_BNF_BK1SRC_Msk (0x1ul << EPWM_BNF_BK1SRC_Pos) /*!< EPWM_T::BNF: BK1SRC Mask */ - -#define EPWM_FAILBRK_CSSBRKEN_Pos (0) /*!< EPWM_T::FAILBRK: CSSBRKEN Position */ -#define EPWM_FAILBRK_CSSBRKEN_Msk (0x1ul << EPWM_FAILBRK_CSSBRKEN_Pos) /*!< EPWM_T::FAILBRK: CSSBRKEN Mask */ - -#define EPWM_FAILBRK_BODBRKEN_Pos (1) /*!< EPWM_T::FAILBRK: BODBRKEN Position */ -#define EPWM_FAILBRK_BODBRKEN_Msk (0x1ul << EPWM_FAILBRK_BODBRKEN_Pos) /*!< EPWM_T::FAILBRK: BODBRKEN Mask */ - -#define EPWM_FAILBRK_RAMBRKEN_Pos (2) /*!< EPWM_T::FAILBRK: RAMBRKEN Position */ -#define EPWM_FAILBRK_RAMBRKEN_Msk (0x1ul << EPWM_FAILBRK_RAMBRKEN_Pos) /*!< EPWM_T::FAILBRK: RAMBRKEN Mask */ - -#define EPWM_FAILBRK_CORBRKEN_Pos (3) /*!< EPWM_T::FAILBRK: CORBRKEN Position */ -#define EPWM_FAILBRK_CORBRKEN_Msk (0x1ul << EPWM_FAILBRK_CORBRKEN_Pos) /*!< EPWM_T::FAILBRK: CORBRKEN Mask */ - -#define EPWM_BRKCTL0_1_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL0_1: CPO0EBEN Position */ -#define EPWM_BRKCTL0_1_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO0EBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL0_1: CPO1EBEN Position */ -#define EPWM_BRKCTL0_1_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO1EBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Position */ -#define EPWM_BRKCTL0_1_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Position */ -#define EPWM_BRKCTL0_1_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Mask */ - -#define EPWM_BRKCTL0_1_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Position */ -#define EPWM_BRKCTL0_1_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL0_1: CPO0LBEN Position */ -#define EPWM_BRKCTL0_1_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO0LBEN Mask */ - -#define EPWM_BRKCTL0_1_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL0_1: CPO1LBEN Position */ -#define EPWM_BRKCTL0_1_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL0_1_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL0_1: CPO1LBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Position */ -#define EPWM_BRKCTL0_1_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Position */ -#define EPWM_BRKCTL0_1_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Mask */ - -#define EPWM_BRKCTL0_1_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Position */ -#define EPWM_BRKCTL0_1_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Position */ -#define EPWM_BRKCTL0_1_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL0_1: BRKAODD Position */ -#define EPWM_BRKCTL0_1_BRKAODD_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAODD_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAODD Mask */ - -#define EPWM_BRKCTL0_1_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL0_1: EADCEBEN Position */ -#define EPWM_BRKCTL0_1_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADCEBEN Mask */ - -#define EPWM_BRKCTL0_1_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL0_1: EADCLBEN Position */ -#define EPWM_BRKCTL0_1_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADCLBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL2_3: CPO0EBEN Position */ -#define EPWM_BRKCTL2_3_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO0EBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL2_3: CPO1EBEN Position */ -#define EPWM_BRKCTL2_3_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO1EBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Position */ -#define EPWM_BRKCTL2_3_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Position */ -#define EPWM_BRKCTL2_3_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Mask */ - -#define EPWM_BRKCTL2_3_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Position */ -#define EPWM_BRKCTL2_3_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL2_3: CPO0LBEN Position */ -#define EPWM_BRKCTL2_3_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO0LBEN Mask */ - -#define EPWM_BRKCTL2_3_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL2_3: CPO1LBEN Position */ -#define EPWM_BRKCTL2_3_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL2_3_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL2_3: CPO1LBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Position */ -#define EPWM_BRKCTL2_3_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Position */ -#define EPWM_BRKCTL2_3_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Mask */ - -#define EPWM_BRKCTL2_3_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Position */ -#define EPWM_BRKCTL2_3_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Position */ -#define EPWM_BRKCTL2_3_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL2_3: BRKAODD Position */ -#define EPWM_BRKCTL2_3_BRKAODD_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAODD_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAODD Mask */ - -#define EPWM_BRKCTL2_3_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL2_3: EADCEBEN Position */ -#define EPWM_BRKCTL2_3_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADCEBEN Mask */ - -#define EPWM_BRKCTL2_3_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL2_3: EADCLBEN Position */ -#define EPWM_BRKCTL2_3_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADCLBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO0EBEN_Pos (0) /*!< EPWM_T::BRKCTL4_5: CPO0EBEN Position */ -#define EPWM_BRKCTL4_5_CPO0EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO0EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO0EBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO1EBEN_Pos (1) /*!< EPWM_T::BRKCTL4_5: CPO1EBEN Position */ -#define EPWM_BRKCTL4_5_CPO1EBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO1EBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO1EBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Position */ -#define EPWM_BRKCTL4_5_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Position */ -#define EPWM_BRKCTL4_5_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Mask */ - -#define EPWM_BRKCTL4_5_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Position */ -#define EPWM_BRKCTL4_5_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO0LBEN_Pos (8) /*!< EPWM_T::BRKCTL4_5: CPO0LBEN Position */ -#define EPWM_BRKCTL4_5_CPO0LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO0LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO0LBEN Mask */ - -#define EPWM_BRKCTL4_5_CPO1LBEN_Pos (9) /*!< EPWM_T::BRKCTL4_5: CPO1LBEN Position */ -#define EPWM_BRKCTL4_5_CPO1LBEN_Msk (0x1ul << EPWM_BRKCTL4_5_CPO1LBEN_Pos) /*!< EPWM_T::BRKCTL4_5: CPO1LBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Position */ -#define EPWM_BRKCTL4_5_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Position */ -#define EPWM_BRKCTL4_5_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Mask */ - -#define EPWM_BRKCTL4_5_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Position */ -#define EPWM_BRKCTL4_5_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Position */ -#define EPWM_BRKCTL4_5_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL4_5: BRKAODD Position */ -#define EPWM_BRKCTL4_5_BRKAODD_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAODD_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAODD Mask */ - -#define EPWM_BRKCTL4_5_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL4_5: EADCEBEN Position */ -#define EPWM_BRKCTL4_5_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADCEBEN Mask */ - -#define EPWM_BRKCTL4_5_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL4_5: EADCLBEN Position */ -#define EPWM_BRKCTL4_5_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADCLBEN Mask */ - -#define EPWM_POLCTL_PINV0_Pos (0) /*!< EPWM_T::POLCTL: PINV0 Position */ -#define EPWM_POLCTL_PINV0_Msk (0x1ul << EPWM_POLCTL_PINV0_Pos) /*!< EPWM_T::POLCTL: PINV0 Mask */ - -#define EPWM_POLCTL_PINV1_Pos (1) /*!< EPWM_T::POLCTL: PINV1 Position */ -#define EPWM_POLCTL_PINV1_Msk (0x1ul << EPWM_POLCTL_PINV1_Pos) /*!< EPWM_T::POLCTL: PINV1 Mask */ - -#define EPWM_POLCTL_PINV2_Pos (2) /*!< EPWM_T::POLCTL: PINV2 Position */ -#define EPWM_POLCTL_PINV2_Msk (0x1ul << EPWM_POLCTL_PINV2_Pos) /*!< EPWM_T::POLCTL: PINV2 Mask */ - -#define EPWM_POLCTL_PINV3_Pos (3) /*!< EPWM_T::POLCTL: PINV3 Position */ -#define EPWM_POLCTL_PINV3_Msk (0x1ul << EPWM_POLCTL_PINV3_Pos) /*!< EPWM_T::POLCTL: PINV3 Mask */ - -#define EPWM_POLCTL_PINV4_Pos (4) /*!< EPWM_T::POLCTL: PINV4 Position */ -#define EPWM_POLCTL_PINV4_Msk (0x1ul << EPWM_POLCTL_PINV4_Pos) /*!< EPWM_T::POLCTL: PINV4 Mask */ - -#define EPWM_POLCTL_PINV5_Pos (5) /*!< EPWM_T::POLCTL: PINV5 Position */ -#define EPWM_POLCTL_PINV5_Msk (0x1ul << EPWM_POLCTL_PINV5_Pos) /*!< EPWM_T::POLCTL: PINV5 Mask */ - -#define EPWM_POEN_POEN0_Pos (0) /*!< EPWM_T::POEN: POEN0 Position */ -#define EPWM_POEN_POEN0_Msk (0x1ul << EPWM_POEN_POEN0_Pos) /*!< EPWM_T::POEN: POEN0 Mask */ - -#define EPWM_POEN_POEN1_Pos (1) /*!< EPWM_T::POEN: POEN1 Position */ -#define EPWM_POEN_POEN1_Msk (0x1ul << EPWM_POEN_POEN1_Pos) /*!< EPWM_T::POEN: POEN1 Mask */ - -#define EPWM_POEN_POEN2_Pos (2) /*!< EPWM_T::POEN: POEN2 Position */ -#define EPWM_POEN_POEN2_Msk (0x1ul << EPWM_POEN_POEN2_Pos) /*!< EPWM_T::POEN: POEN2 Mask */ - -#define EPWM_POEN_POEN3_Pos (3) /*!< EPWM_T::POEN: POEN3 Position */ -#define EPWM_POEN_POEN3_Msk (0x1ul << EPWM_POEN_POEN3_Pos) /*!< EPWM_T::POEN: POEN3 Mask */ - -#define EPWM_POEN_POEN4_Pos (4) /*!< EPWM_T::POEN: POEN4 Position */ -#define EPWM_POEN_POEN4_Msk (0x1ul << EPWM_POEN_POEN4_Pos) /*!< EPWM_T::POEN: POEN4 Mask */ - -#define EPWM_POEN_POEN5_Pos (5) /*!< EPWM_T::POEN: POEN5 Position */ -#define EPWM_POEN_POEN5_Msk (0x1ul << EPWM_POEN_POEN5_Pos) /*!< EPWM_T::POEN: POEN5 Mask */ - -#define EPWM_SWBRK_BRKETRG0_Pos (0) /*!< EPWM_T::SWBRK: BRKETRG0 Position */ -#define EPWM_SWBRK_BRKETRG0_Msk (0x1ul << EPWM_SWBRK_BRKETRG0_Pos) /*!< EPWM_T::SWBRK: BRKETRG0 Mask */ - -#define EPWM_SWBRK_BRKETRG2_Pos (1) /*!< EPWM_T::SWBRK: BRKETRG2 Position */ -#define EPWM_SWBRK_BRKETRG2_Msk (0x1ul << EPWM_SWBRK_BRKETRG2_Pos) /*!< EPWM_T::SWBRK: BRKETRG2 Mask */ - -#define EPWM_SWBRK_BRKETRG4_Pos (2) /*!< EPWM_T::SWBRK: BRKETRG4 Position */ -#define EPWM_SWBRK_BRKETRG4_Msk (0x1ul << EPWM_SWBRK_BRKETRG4_Pos) /*!< EPWM_T::SWBRK: BRKETRG4 Mask */ - -#define EPWM_SWBRK_BRKLTRG0_Pos (8) /*!< EPWM_T::SWBRK: BRKLTRG0 Position */ -#define EPWM_SWBRK_BRKLTRG0_Msk (0x1ul << EPWM_SWBRK_BRKLTRG0_Pos) /*!< EPWM_T::SWBRK: BRKLTRG0 Mask */ - -#define EPWM_SWBRK_BRKLTRG2_Pos (9) /*!< EPWM_T::SWBRK: BRKLTRG2 Position */ -#define EPWM_SWBRK_BRKLTRG2_Msk (0x1ul << EPWM_SWBRK_BRKLTRG2_Pos) /*!< EPWM_T::SWBRK: BRKLTRG2 Mask */ - -#define EPWM_SWBRK_BRKLTRG4_Pos (10) /*!< EPWM_T::SWBRK: BRKLTRG4 Position */ -#define EPWM_SWBRK_BRKLTRG4_Msk (0x1ul << EPWM_SWBRK_BRKLTRG4_Pos) /*!< EPWM_T::SWBRK: BRKLTRG4 Mask */ - -#define EPWM_INTEN0_ZIEN0_Pos (0) /*!< EPWM_T::INTEN0: ZIEN0 Position */ -#define EPWM_INTEN0_ZIEN0_Msk (0x1ul << EPWM_INTEN0_ZIEN0_Pos) /*!< EPWM_T::INTEN0: ZIEN0 Mask */ - -#define EPWM_INTEN0_ZIEN1_Pos (1) /*!< EPWM_T::INTEN0: ZIEN1 Position */ -#define EPWM_INTEN0_ZIEN1_Msk (0x1ul << EPWM_INTEN0_ZIEN1_Pos) /*!< EPWM_T::INTEN0: ZIEN1 Mask */ - -#define EPWM_INTEN0_ZIEN2_Pos (2) /*!< EPWM_T::INTEN0: ZIEN2 Position */ -#define EPWM_INTEN0_ZIEN2_Msk (0x1ul << EPWM_INTEN0_ZIEN2_Pos) /*!< EPWM_T::INTEN0: ZIEN2 Mask */ - -#define EPWM_INTEN0_ZIEN3_Pos (3) /*!< EPWM_T::INTEN0: ZIEN3 Position */ -#define EPWM_INTEN0_ZIEN3_Msk (0x1ul << EPWM_INTEN0_ZIEN3_Pos) /*!< EPWM_T::INTEN0: ZIEN3 Mask */ - -#define EPWM_INTEN0_ZIEN4_Pos (4) /*!< EPWM_T::INTEN0: ZIEN4 Position */ -#define EPWM_INTEN0_ZIEN4_Msk (0x1ul << EPWM_INTEN0_ZIEN4_Pos) /*!< EPWM_T::INTEN0: ZIEN4 Mask */ - -#define EPWM_INTEN0_ZIEN5_Pos (5) /*!< EPWM_T::INTEN0: ZIEN5 Position */ -#define EPWM_INTEN0_ZIEN5_Msk (0x1ul << EPWM_INTEN0_ZIEN5_Pos) /*!< EPWM_T::INTEN0: ZIEN5 Mask */ - -#define EPWM_INTEN0_PIEN0_Pos (8) /*!< EPWM_T::INTEN0: PIEN0 Position */ -#define EPWM_INTEN0_PIEN0_Msk (0x1ul << EPWM_INTEN0_PIEN0_Pos) /*!< EPWM_T::INTEN0: PIEN0 Mask */ - -#define EPWM_INTEN0_PIEN1_Pos (9) /*!< EPWM_T::INTEN0: PIEN1 Position */ -#define EPWM_INTEN0_PIEN1_Msk (0x1ul << EPWM_INTEN0_PIEN1_Pos) /*!< EPWM_T::INTEN0: PIEN1 Mask */ - -#define EPWM_INTEN0_PIEN2_Pos (10) /*!< EPWM_T::INTEN0: PIEN2 Position */ -#define EPWM_INTEN0_PIEN2_Msk (0x1ul << EPWM_INTEN0_PIEN2_Pos) /*!< EPWM_T::INTEN0: PIEN2 Mask */ - -#define EPWM_INTEN0_PIEN3_Pos (11) /*!< EPWM_T::INTEN0: PIEN3 Position */ -#define EPWM_INTEN0_PIEN3_Msk (0x1ul << EPWM_INTEN0_PIEN3_Pos) /*!< EPWM_T::INTEN0: PIEN3 Mask */ - -#define EPWM_INTEN0_PIEN4_Pos (12) /*!< EPWM_T::INTEN0: PIEN4 Position */ -#define EPWM_INTEN0_PIEN4_Msk (0x1ul << EPWM_INTEN0_PIEN4_Pos) /*!< EPWM_T::INTEN0: PIEN4 Mask */ - -#define EPWM_INTEN0_PIEN5_Pos (13) /*!< EPWM_T::INTEN0: PIEN5 Position */ -#define EPWM_INTEN0_PIEN5_Msk (0x1ul << EPWM_INTEN0_PIEN5_Pos) /*!< EPWM_T::INTEN0: PIEN5 Mask */ - -#define EPWM_INTEN0_CMPUIEN0_Pos (16) /*!< EPWM_T::INTEN0: CMPUIEN0 Position */ -#define EPWM_INTEN0_CMPUIEN0_Msk (0x1ul << EPWM_INTEN0_CMPUIEN0_Pos) /*!< EPWM_T::INTEN0: CMPUIEN0 Mask */ - -#define EPWM_INTEN0_CMPUIEN1_Pos (17) /*!< EPWM_T::INTEN0: CMPUIEN1 Position */ -#define EPWM_INTEN0_CMPUIEN1_Msk (0x1ul << EPWM_INTEN0_CMPUIEN1_Pos) /*!< EPWM_T::INTEN0: CMPUIEN1 Mask */ - -#define EPWM_INTEN0_CMPUIEN2_Pos (18) /*!< EPWM_T::INTEN0: CMPUIEN2 Position */ -#define EPWM_INTEN0_CMPUIEN2_Msk (0x1ul << EPWM_INTEN0_CMPUIEN2_Pos) /*!< EPWM_T::INTEN0: CMPUIEN2 Mask */ - -#define EPWM_INTEN0_CMPUIEN3_Pos (19) /*!< EPWM_T::INTEN0: CMPUIEN3 Position */ -#define EPWM_INTEN0_CMPUIEN3_Msk (0x1ul << EPWM_INTEN0_CMPUIEN3_Pos) /*!< EPWM_T::INTEN0: CMPUIEN3 Mask */ - -#define EPWM_INTEN0_CMPUIEN4_Pos (20) /*!< EPWM_T::INTEN0: CMPUIEN4 Position */ -#define EPWM_INTEN0_CMPUIEN4_Msk (0x1ul << EPWM_INTEN0_CMPUIEN4_Pos) /*!< EPWM_T::INTEN0: CMPUIEN4 Mask */ - -#define EPWM_INTEN0_CMPUIEN5_Pos (21) /*!< EPWM_T::INTEN0: CMPUIEN5 Position */ -#define EPWM_INTEN0_CMPUIEN5_Msk (0x1ul << EPWM_INTEN0_CMPUIEN5_Pos) /*!< EPWM_T::INTEN0: CMPUIEN5 Mask */ - -#define EPWM_INTEN0_CMPDIEN0_Pos (24) /*!< EPWM_T::INTEN0: CMPDIEN0 Position */ -#define EPWM_INTEN0_CMPDIEN0_Msk (0x1ul << EPWM_INTEN0_CMPDIEN0_Pos) /*!< EPWM_T::INTEN0: CMPDIEN0 Mask */ - -#define EPWM_INTEN0_CMPDIEN1_Pos (25) /*!< EPWM_T::INTEN0: CMPDIEN1 Position */ -#define EPWM_INTEN0_CMPDIEN1_Msk (0x1ul << EPWM_INTEN0_CMPDIEN1_Pos) /*!< EPWM_T::INTEN0: CMPDIEN1 Mask */ - -#define EPWM_INTEN0_CMPDIEN2_Pos (26) /*!< EPWM_T::INTEN0: CMPDIEN2 Position */ -#define EPWM_INTEN0_CMPDIEN2_Msk (0x1ul << EPWM_INTEN0_CMPDIEN2_Pos) /*!< EPWM_T::INTEN0: CMPDIEN2 Mask */ - -#define EPWM_INTEN0_CMPDIEN3_Pos (27) /*!< EPWM_T::INTEN0: CMPDIEN3 Position */ -#define EPWM_INTEN0_CMPDIEN3_Msk (0x1ul << EPWM_INTEN0_CMPDIEN3_Pos) /*!< EPWM_T::INTEN0: CMPDIEN3 Mask */ - -#define EPWM_INTEN0_CMPDIEN4_Pos (28) /*!< EPWM_T::INTEN0: CMPDIEN4 Position */ -#define EPWM_INTEN0_CMPDIEN4_Msk (0x1ul << EPWM_INTEN0_CMPDIEN4_Pos) /*!< EPWM_T::INTEN0: CMPDIEN4 Mask */ - -#define EPWM_INTEN0_CMPDIEN5_Pos (29) /*!< EPWM_T::INTEN0: CMPDIEN5 Position */ -#define EPWM_INTEN0_CMPDIEN5_Msk (0x1ul << EPWM_INTEN0_CMPDIEN5_Pos) /*!< EPWM_T::INTEN0: CMPDIEN5 Mask */ - -#define EPWM_INTEN1_BRKEIEN0_1_Pos (0) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Position */ -#define EPWM_INTEN1_BRKEIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKEIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKEIEN2_3_Pos (1) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Position */ -#define EPWM_INTEN1_BRKEIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKEIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKEIEN4_5_Pos (2) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Position */ -#define EPWM_INTEN1_BRKEIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKEIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Mask */ - -#define EPWM_INTEN1_BRKLIEN0_1_Pos (8) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Position */ -#define EPWM_INTEN1_BRKLIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKLIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKLIEN2_3_Pos (9) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Position */ -#define EPWM_INTEN1_BRKLIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKLIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKLIEN4_5_Pos (10) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Position */ -#define EPWM_INTEN1_BRKLIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKLIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Mask */ - -#define EPWM_INTSTS0_ZIF0_Pos (0) /*!< EPWM_T::INTSTS0: ZIF0 Position */ -#define EPWM_INTSTS0_ZIF0_Msk (0x1ul << EPWM_INTSTS0_ZIF0_Pos) /*!< EPWM_T::INTSTS0: ZIF0 Mask */ - -#define EPWM_INTSTS0_ZIF1_Pos (1) /*!< EPWM_T::INTSTS0: ZIF1 Position */ -#define EPWM_INTSTS0_ZIF1_Msk (0x1ul << EPWM_INTSTS0_ZIF1_Pos) /*!< EPWM_T::INTSTS0: ZIF1 Mask */ - -#define EPWM_INTSTS0_ZIF2_Pos (2) /*!< EPWM_T::INTSTS0: ZIF2 Position */ -#define EPWM_INTSTS0_ZIF2_Msk (0x1ul << EPWM_INTSTS0_ZIF2_Pos) /*!< EPWM_T::INTSTS0: ZIF2 Mask */ - -#define EPWM_INTSTS0_ZIF3_Pos (3) /*!< EPWM_T::INTSTS0: ZIF3 Position */ -#define EPWM_INTSTS0_ZIF3_Msk (0x1ul << EPWM_INTSTS0_ZIF3_Pos) /*!< EPWM_T::INTSTS0: ZIF3 Mask */ - -#define EPWM_INTSTS0_ZIF4_Pos (4) /*!< EPWM_T::INTSTS0: ZIF4 Position */ -#define EPWM_INTSTS0_ZIF4_Msk (0x1ul << EPWM_INTSTS0_ZIF4_Pos) /*!< EPWM_T::INTSTS0: ZIF4 Mask */ - -#define EPWM_INTSTS0_ZIF5_Pos (5) /*!< EPWM_T::INTSTS0: ZIF5 Position */ -#define EPWM_INTSTS0_ZIF5_Msk (0x1ul << EPWM_INTSTS0_ZIF5_Pos) /*!< EPWM_T::INTSTS0: ZIF5 Mask */ - -#define EPWM_INTSTS0_PIF0_Pos (8) /*!< EPWM_T::INTSTS0: PIF0 Position */ -#define EPWM_INTSTS0_PIF0_Msk (0x1ul << EPWM_INTSTS0_PIF0_Pos) /*!< EPWM_T::INTSTS0: PIF0 Mask */ - -#define EPWM_INTSTS0_PIF1_Pos (9) /*!< EPWM_T::INTSTS0: PIF1 Position */ -#define EPWM_INTSTS0_PIF1_Msk (0x1ul << EPWM_INTSTS0_PIF1_Pos) /*!< EPWM_T::INTSTS0: PIF1 Mask */ - -#define EPWM_INTSTS0_PIF2_Pos (10) /*!< EPWM_T::INTSTS0: PIF2 Position */ -#define EPWM_INTSTS0_PIF2_Msk (0x1ul << EPWM_INTSTS0_PIF2_Pos) /*!< EPWM_T::INTSTS0: PIF2 Mask */ - -#define EPWM_INTSTS0_PIF3_Pos (11) /*!< EPWM_T::INTSTS0: PIF3 Position */ -#define EPWM_INTSTS0_PIF3_Msk (0x1ul << EPWM_INTSTS0_PIF3_Pos) /*!< EPWM_T::INTSTS0: PIF3 Mask */ - -#define EPWM_INTSTS0_PIF4_Pos (12) /*!< EPWM_T::INTSTS0: PIF4 Position */ -#define EPWM_INTSTS0_PIF4_Msk (0x1ul << EPWM_INTSTS0_PIF4_Pos) /*!< EPWM_T::INTSTS0: PIF4 Mask */ - -#define EPWM_INTSTS0_PIF5_Pos (13) /*!< EPWM_T::INTSTS0: PIF5 Position */ -#define EPWM_INTSTS0_PIF5_Msk (0x1ul << EPWM_INTSTS0_PIF5_Pos) /*!< EPWM_T::INTSTS0: PIF5 Mask */ - -#define EPWM_INTSTS0_CMPUIF0_Pos (16) /*!< EPWM_T::INTSTS0: CMPUIF0 Position */ -#define EPWM_INTSTS0_CMPUIF0_Msk (0x1ul << EPWM_INTSTS0_CMPUIF0_Pos) /*!< EPWM_T::INTSTS0: CMPUIF0 Mask */ - -#define EPWM_INTSTS0_CMPUIF1_Pos (17) /*!< EPWM_T::INTSTS0: CMPUIF1 Position */ -#define EPWM_INTSTS0_CMPUIF1_Msk (0x1ul << EPWM_INTSTS0_CMPUIF1_Pos) /*!< EPWM_T::INTSTS0: CMPUIF1 Mask */ - -#define EPWM_INTSTS0_CMPUIF2_Pos (18) /*!< EPWM_T::INTSTS0: CMPUIF2 Position */ -#define EPWM_INTSTS0_CMPUIF2_Msk (0x1ul << EPWM_INTSTS0_CMPUIF2_Pos) /*!< EPWM_T::INTSTS0: CMPUIF2 Mask */ - -#define EPWM_INTSTS0_CMPUIF3_Pos (19) /*!< EPWM_T::INTSTS0: CMPUIF3 Position */ -#define EPWM_INTSTS0_CMPUIF3_Msk (0x1ul << EPWM_INTSTS0_CMPUIF3_Pos) /*!< EPWM_T::INTSTS0: CMPUIF3 Mask */ - -#define EPWM_INTSTS0_CMPUIF4_Pos (20) /*!< EPWM_T::INTSTS0: CMPUIF4 Position */ -#define EPWM_INTSTS0_CMPUIF4_Msk (0x1ul << EPWM_INTSTS0_CMPUIF4_Pos) /*!< EPWM_T::INTSTS0: CMPUIF4 Mask */ - -#define EPWM_INTSTS0_CMPUIF5_Pos (21) /*!< EPWM_T::INTSTS0: CMPUIF5 Position */ -#define EPWM_INTSTS0_CMPUIF5_Msk (0x1ul << EPWM_INTSTS0_CMPUIF5_Pos) /*!< EPWM_T::INTSTS0: CMPUIF5 Mask */ - -#define EPWM_INTSTS0_CMPDIF0_Pos (24) /*!< EPWM_T::INTSTS0: CMPDIF0 Position */ -#define EPWM_INTSTS0_CMPDIF0_Msk (0x1ul << EPWM_INTSTS0_CMPDIF0_Pos) /*!< EPWM_T::INTSTS0: CMPDIF0 Mask */ - -#define EPWM_INTSTS0_CMPDIF1_Pos (25) /*!< EPWM_T::INTSTS0: CMPDIF1 Position */ -#define EPWM_INTSTS0_CMPDIF1_Msk (0x1ul << EPWM_INTSTS0_CMPDIF1_Pos) /*!< EPWM_T::INTSTS0: CMPDIF1 Mask */ - -#define EPWM_INTSTS0_CMPDIF2_Pos (26) /*!< EPWM_T::INTSTS0: CMPDIF2 Position */ -#define EPWM_INTSTS0_CMPDIF2_Msk (0x1ul << EPWM_INTSTS0_CMPDIF2_Pos) /*!< EPWM_T::INTSTS0: CMPDIF2 Mask */ - -#define EPWM_INTSTS0_CMPDIF3_Pos (27) /*!< EPWM_T::INTSTS0: CMPDIF3 Position */ -#define EPWM_INTSTS0_CMPDIF3_Msk (0x1ul << EPWM_INTSTS0_CMPDIF3_Pos) /*!< EPWM_T::INTSTS0: CMPDIF3 Mask */ - -#define EPWM_INTSTS0_CMPDIF4_Pos (28) /*!< EPWM_T::INTSTS0: CMPDIF4 Position */ -#define EPWM_INTSTS0_CMPDIF4_Msk (0x1ul << EPWM_INTSTS0_CMPDIF4_Pos) /*!< EPWM_T::INTSTS0: CMPDIF4 Mask */ - -#define EPWM_INTSTS0_CMPDIF5_Pos (29) /*!< EPWM_T::INTSTS0: CMPDIF5 Position */ -#define EPWM_INTSTS0_CMPDIF5_Msk (0x1ul << EPWM_INTSTS0_CMPDIF5_Pos) /*!< EPWM_T::INTSTS0: CMPDIF5 Mask */ - -#define EPWM_INTSTS1_BRKEIF0_Pos (0) /*!< EPWM_T::INTSTS1: BRKEIF0 Position */ -#define EPWM_INTSTS1_BRKEIF0_Msk (0x1ul << EPWM_INTSTS1_BRKEIF0_Pos) /*!< EPWM_T::INTSTS1: BRKEIF0 Mask */ - -#define EPWM_INTSTS1_BRKEIF1_Pos (1) /*!< EPWM_T::INTSTS1: BRKEIF1 Position */ -#define EPWM_INTSTS1_BRKEIF1_Msk (0x1ul << EPWM_INTSTS1_BRKEIF1_Pos) /*!< EPWM_T::INTSTS1: BRKEIF1 Mask */ - -#define EPWM_INTSTS1_BRKEIF2_Pos (2) /*!< EPWM_T::INTSTS1: BRKEIF2 Position */ -#define EPWM_INTSTS1_BRKEIF2_Msk (0x1ul << EPWM_INTSTS1_BRKEIF2_Pos) /*!< EPWM_T::INTSTS1: BRKEIF2 Mask */ - -#define EPWM_INTSTS1_BRKEIF3_Pos (3) /*!< EPWM_T::INTSTS1: BRKEIF3 Position */ -#define EPWM_INTSTS1_BRKEIF3_Msk (0x1ul << EPWM_INTSTS1_BRKEIF3_Pos) /*!< EPWM_T::INTSTS1: BRKEIF3 Mask */ - -#define EPWM_INTSTS1_BRKEIF4_Pos (4) /*!< EPWM_T::INTSTS1: BRKEIF4 Position */ -#define EPWM_INTSTS1_BRKEIF4_Msk (0x1ul << EPWM_INTSTS1_BRKEIF4_Pos) /*!< EPWM_T::INTSTS1: BRKEIF4 Mask */ - -#define EPWM_INTSTS1_BRKEIF5_Pos (5) /*!< EPWM_T::INTSTS1: BRKEIF5 Position */ -#define EPWM_INTSTS1_BRKEIF5_Msk (0x1ul << EPWM_INTSTS1_BRKEIF5_Pos) /*!< EPWM_T::INTSTS1: BRKEIF5 Mask */ - -#define EPWM_INTSTS1_BRKLIF0_Pos (8) /*!< EPWM_T::INTSTS1: BRKLIF0 Position */ -#define EPWM_INTSTS1_BRKLIF0_Msk (0x1ul << EPWM_INTSTS1_BRKLIF0_Pos) /*!< EPWM_T::INTSTS1: BRKLIF0 Mask */ - -#define EPWM_INTSTS1_BRKLIF1_Pos (9) /*!< EPWM_T::INTSTS1: BRKLIF1 Position */ -#define EPWM_INTSTS1_BRKLIF1_Msk (0x1ul << EPWM_INTSTS1_BRKLIF1_Pos) /*!< EPWM_T::INTSTS1: BRKLIF1 Mask */ - -#define EPWM_INTSTS1_BRKLIF2_Pos (10) /*!< EPWM_T::INTSTS1: BRKLIF2 Position */ -#define EPWM_INTSTS1_BRKLIF2_Msk (0x1ul << EPWM_INTSTS1_BRKLIF2_Pos) /*!< EPWM_T::INTSTS1: BRKLIF2 Mask */ - -#define EPWM_INTSTS1_BRKLIF3_Pos (11) /*!< EPWM_T::INTSTS1: BRKLIF3 Position */ -#define EPWM_INTSTS1_BRKLIF3_Msk (0x1ul << EPWM_INTSTS1_BRKLIF3_Pos) /*!< EPWM_T::INTSTS1: BRKLIF3 Mask */ - -#define EPWM_INTSTS1_BRKLIF4_Pos (12) /*!< EPWM_T::INTSTS1: BRKLIF4 Position */ -#define EPWM_INTSTS1_BRKLIF4_Msk (0x1ul << EPWM_INTSTS1_BRKLIF4_Pos) /*!< EPWM_T::INTSTS1: BRKLIF4 Mask */ - -#define EPWM_INTSTS1_BRKLIF5_Pos (13) /*!< EPWM_T::INTSTS1: BRKLIF5 Position */ -#define EPWM_INTSTS1_BRKLIF5_Msk (0x1ul << EPWM_INTSTS1_BRKLIF5_Pos) /*!< EPWM_T::INTSTS1: BRKLIF5 Mask */ - -#define EPWM_INTSTS1_BRKESTS0_Pos (16) /*!< EPWM_T::INTSTS1: BRKESTS0 Position */ -#define EPWM_INTSTS1_BRKESTS0_Msk (0x1ul << EPWM_INTSTS1_BRKESTS0_Pos) /*!< EPWM_T::INTSTS1: BRKESTS0 Mask */ - -#define EPWM_INTSTS1_BRKESTS1_Pos (17) /*!< EPWM_T::INTSTS1: BRKESTS1 Position */ -#define EPWM_INTSTS1_BRKESTS1_Msk (0x1ul << EPWM_INTSTS1_BRKESTS1_Pos) /*!< EPWM_T::INTSTS1: BRKESTS1 Mask */ - -#define EPWM_INTSTS1_BRKESTS2_Pos (18) /*!< EPWM_T::INTSTS1: BRKESTS2 Position */ -#define EPWM_INTSTS1_BRKESTS2_Msk (0x1ul << EPWM_INTSTS1_BRKESTS2_Pos) /*!< EPWM_T::INTSTS1: BRKESTS2 Mask */ - -#define EPWM_INTSTS1_BRKESTS3_Pos (19) /*!< EPWM_T::INTSTS1: BRKESTS3 Position */ -#define EPWM_INTSTS1_BRKESTS3_Msk (0x1ul << EPWM_INTSTS1_BRKESTS3_Pos) /*!< EPWM_T::INTSTS1: BRKESTS3 Mask */ - -#define EPWM_INTSTS1_BRKESTS4_Pos (20) /*!< EPWM_T::INTSTS1: BRKESTS4 Position */ -#define EPWM_INTSTS1_BRKESTS4_Msk (0x1ul << EPWM_INTSTS1_BRKESTS4_Pos) /*!< EPWM_T::INTSTS1: BRKESTS4 Mask */ - -#define EPWM_INTSTS1_BRKESTS5_Pos (21) /*!< EPWM_T::INTSTS1: BRKESTS5 Position */ -#define EPWM_INTSTS1_BRKESTS5_Msk (0x1ul << EPWM_INTSTS1_BRKESTS5_Pos) /*!< EPWM_T::INTSTS1: BRKESTS5 Mask */ - -#define EPWM_INTSTS1_BRKLSTS0_Pos (24) /*!< EPWM_T::INTSTS1: BRKLSTS0 Position */ -#define EPWM_INTSTS1_BRKLSTS0_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS0_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS0 Mask */ - -#define EPWM_INTSTS1_BRKLSTS1_Pos (25) /*!< EPWM_T::INTSTS1: BRKLSTS1 Position */ -#define EPWM_INTSTS1_BRKLSTS1_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS1_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS1 Mask */ - -#define EPWM_INTSTS1_BRKLSTS2_Pos (26) /*!< EPWM_T::INTSTS1: BRKLSTS2 Position */ -#define EPWM_INTSTS1_BRKLSTS2_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS2_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS2 Mask */ - -#define EPWM_INTSTS1_BRKLSTS3_Pos (27) /*!< EPWM_T::INTSTS1: BRKLSTS3 Position */ -#define EPWM_INTSTS1_BRKLSTS3_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS3_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS3 Mask */ - -#define EPWM_INTSTS1_BRKLSTS4_Pos (28) /*!< EPWM_T::INTSTS1: BRKLSTS4 Position */ -#define EPWM_INTSTS1_BRKLSTS4_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS4_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS4 Mask */ - -#define EPWM_INTSTS1_BRKLSTS5_Pos (29) /*!< EPWM_T::INTSTS1: BRKLSTS5 Position */ -#define EPWM_INTSTS1_BRKLSTS5_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS5_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS5 Mask */ - -#define EPWM_DACTRGEN_ZTE0_Pos (0) /*!< EPWM_T::DACTRGEN: ZTE0 Position */ -#define EPWM_DACTRGEN_ZTE0_Msk (0x1ul << EPWM_DACTRGEN_ZTE0_Pos) /*!< EPWM_T::DACTRGEN: ZTE0 Mask */ - -#define EPWM_DACTRGEN_ZTE1_Pos (1) /*!< EPWM_T::DACTRGEN: ZTE1 Position */ -#define EPWM_DACTRGEN_ZTE1_Msk (0x1ul << EPWM_DACTRGEN_ZTE1_Pos) /*!< EPWM_T::DACTRGEN: ZTE1 Mask */ - -#define EPWM_DACTRGEN_ZTE2_Pos (2) /*!< EPWM_T::DACTRGEN: ZTE2 Position */ -#define EPWM_DACTRGEN_ZTE2_Msk (0x1ul << EPWM_DACTRGEN_ZTE2_Pos) /*!< EPWM_T::DACTRGEN: ZTE2 Mask */ - -#define EPWM_DACTRGEN_ZTE3_Pos (3) /*!< EPWM_T::DACTRGEN: ZTE3 Position */ -#define EPWM_DACTRGEN_ZTE3_Msk (0x1ul << EPWM_DACTRGEN_ZTE3_Pos) /*!< EPWM_T::DACTRGEN: ZTE3 Mask */ - -#define EPWM_DACTRGEN_ZTE4_Pos (4) /*!< EPWM_T::DACTRGEN: ZTE4 Position */ -#define EPWM_DACTRGEN_ZTE4_Msk (0x1ul << EPWM_DACTRGEN_ZTE4_Pos) /*!< EPWM_T::DACTRGEN: ZTE4 Mask */ - -#define EPWM_DACTRGEN_ZTE5_Pos (5) /*!< EPWM_T::DACTRGEN: ZTE5 Position */ -#define EPWM_DACTRGEN_ZTE5_Msk (0x1ul << EPWM_DACTRGEN_ZTE5_Pos) /*!< EPWM_T::DACTRGEN: ZTE5 Mask */ - -#define EPWM_DACTRGEN_PTE0_Pos (8) /*!< EPWM_T::DACTRGEN: PTE0 Position */ -#define EPWM_DACTRGEN_PTE0_Msk (0x1ul << EPWM_DACTRGEN_PTE0_Pos) /*!< EPWM_T::DACTRGEN: PTE0 Mask */ - -#define EPWM_DACTRGEN_PTE1_Pos (9) /*!< EPWM_T::DACTRGEN: PTE1 Position */ -#define EPWM_DACTRGEN_PTE1_Msk (0x1ul << EPWM_DACTRGEN_PTE1_Pos) /*!< EPWM_T::DACTRGEN: PTE1 Mask */ - -#define EPWM_DACTRGEN_PTE2_Pos (10) /*!< EPWM_T::DACTRGEN: PTE2 Position */ -#define EPWM_DACTRGEN_PTE2_Msk (0x1ul << EPWM_DACTRGEN_PTE2_Pos) /*!< EPWM_T::DACTRGEN: PTE2 Mask */ - -#define EPWM_DACTRGEN_PTE3_Pos (11) /*!< EPWM_T::DACTRGEN: PTE3 Position */ -#define EPWM_DACTRGEN_PTE3_Msk (0x1ul << EPWM_DACTRGEN_PTE3_Pos) /*!< EPWM_T::DACTRGEN: PTE3 Mask */ - -#define EPWM_DACTRGEN_PTE4_Pos (12) /*!< EPWM_T::DACTRGEN: PTE4 Position */ -#define EPWM_DACTRGEN_PTE4_Msk (0x1ul << EPWM_DACTRGEN_PTE4_Pos) /*!< EPWM_T::DACTRGEN: PTE4 Mask */ - -#define EPWM_DACTRGEN_PTE5_Pos (13) /*!< EPWM_T::DACTRGEN: PTE5 Position */ -#define EPWM_DACTRGEN_PTE5_Msk (0x1ul << EPWM_DACTRGEN_PTE5_Pos) /*!< EPWM_T::DACTRGEN: PTE5 Mask */ - -#define EPWM_DACTRGEN_CUTRGE0_Pos (16) /*!< EPWM_T::DACTRGEN: CUTRGE0 Position */ -#define EPWM_DACTRGEN_CUTRGE0_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE0_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE0 Mask */ - -#define EPWM_DACTRGEN_CUTRGE1_Pos (17) /*!< EPWM_T::DACTRGEN: CUTRGE1 Position */ -#define EPWM_DACTRGEN_CUTRGE1_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE1_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE1 Mask */ - -#define EPWM_DACTRGEN_CUTRGE2_Pos (18) /*!< EPWM_T::DACTRGEN: CUTRGE2 Position */ -#define EPWM_DACTRGEN_CUTRGE2_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE2_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE2 Mask */ - -#define EPWM_DACTRGEN_CUTRGE3_Pos (19) /*!< EPWM_T::DACTRGEN: CUTRGE3 Position */ -#define EPWM_DACTRGEN_CUTRGE3_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE3_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE3 Mask */ - -#define EPWM_DACTRGEN_CUTRGE4_Pos (20) /*!< EPWM_T::DACTRGEN: CUTRGE4 Position */ -#define EPWM_DACTRGEN_CUTRGE4_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE4_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE4 Mask */ - -#define EPWM_DACTRGEN_CUTRGE5_Pos (21) /*!< EPWM_T::DACTRGEN: CUTRGE5 Position */ -#define EPWM_DACTRGEN_CUTRGE5_Msk (0x1ul << EPWM_DACTRGEN_CUTRGE5_Pos) /*!< EPWM_T::DACTRGEN: CUTRGE5 Mask */ - -#define EPWM_DACTRGEN_CDTRGE0_Pos (24) /*!< EPWM_T::DACTRGEN: CDTRGE0 Position */ -#define EPWM_DACTRGEN_CDTRGE0_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE0_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE0 Mask */ - -#define EPWM_DACTRGEN_CDTRGE1_Pos (25) /*!< EPWM_T::DACTRGEN: CDTRGE1 Position */ -#define EPWM_DACTRGEN_CDTRGE1_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE1_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE1 Mask */ - -#define EPWM_DACTRGEN_CDTRGE2_Pos (26) /*!< EPWM_T::DACTRGEN: CDTRGE2 Position */ -#define EPWM_DACTRGEN_CDTRGE2_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE2_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE2 Mask */ - -#define EPWM_DACTRGEN_CDTRGE3_Pos (27) /*!< EPWM_T::DACTRGEN: CDTRGE3 Position */ -#define EPWM_DACTRGEN_CDTRGE3_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE3_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE3 Mask */ - -#define EPWM_DACTRGEN_CDTRGE4_Pos (28) /*!< EPWM_T::DACTRGEN: CDTRGE4 Position */ -#define EPWM_DACTRGEN_CDTRGE4_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE4_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE4 Mask */ - -#define EPWM_DACTRGEN_CDTRGE5_Pos (29) /*!< EPWM_T::DACTRGEN: CDTRGE5 Position */ -#define EPWM_DACTRGEN_CDTRGE5_Msk (0x1ul << EPWM_DACTRGEN_CDTRGE5_Pos) /*!< EPWM_T::DACTRGEN: CDTRGE5 Mask */ - -#define EPWM_EADCTS0_TRGSEL0_Pos (0) /*!< EPWM_T::EADCTS0: TRGSEL0 Position */ -#define EPWM_EADCTS0_TRGSEL0_Msk (0xful << EPWM_EADCTS0_TRGSEL0_Pos) /*!< EPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define EPWM_EADCTS0_TRGEN0_Pos (7) /*!< EPWM_T::EADCTS0: TRGEN0 Position */ -#define EPWM_EADCTS0_TRGEN0_Msk (0x1ul << EPWM_EADCTS0_TRGEN0_Pos) /*!< EPWM_T::EADCTS0: TRGEN0 Mask */ - -#define EPWM_EADCTS0_TRGSEL1_Pos (8) /*!< EPWM_T::EADCTS0: TRGSEL1 Position */ -#define EPWM_EADCTS0_TRGSEL1_Msk (0xful << EPWM_EADCTS0_TRGSEL1_Pos) /*!< EPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define EPWM_EADCTS0_TRGEN1_Pos (15) /*!< EPWM_T::EADCTS0: TRGEN1 Position */ -#define EPWM_EADCTS0_TRGEN1_Msk (0x1ul << EPWM_EADCTS0_TRGEN1_Pos) /*!< EPWM_T::EADCTS0: TRGEN1 Mask */ - -#define EPWM_EADCTS0_TRGSEL2_Pos (16) /*!< EPWM_T::EADCTS0: TRGSEL2 Position */ -#define EPWM_EADCTS0_TRGSEL2_Msk (0xful << EPWM_EADCTS0_TRGSEL2_Pos) /*!< EPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define EPWM_EADCTS0_TRGEN2_Pos (23) /*!< EPWM_T::EADCTS0: TRGEN2 Position */ -#define EPWM_EADCTS0_TRGEN2_Msk (0x1ul << EPWM_EADCTS0_TRGEN2_Pos) /*!< EPWM_T::EADCTS0: TRGEN2 Mask */ - -#define EPWM_EADCTS0_TRGSEL3_Pos (24) /*!< EPWM_T::EADCTS0: TRGSEL3 Position */ -#define EPWM_EADCTS0_TRGSEL3_Msk (0xful << EPWM_EADCTS0_TRGSEL3_Pos) /*!< EPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define EPWM_EADCTS0_TRGEN3_Pos (31) /*!< EPWM_T::EADCTS0: TRGEN3 Position */ -#define EPWM_EADCTS0_TRGEN3_Msk (0x1ul << EPWM_EADCTS0_TRGEN3_Pos) /*!< EPWM_T::EADCTS0: TRGEN3 Mask */ - -#define EPWM_EADCTS1_TRGSEL4_Pos (0) /*!< EPWM_T::EADCTS1: TRGSEL4 Position */ -#define EPWM_EADCTS1_TRGSEL4_Msk (0xful << EPWM_EADCTS1_TRGSEL4_Pos) /*!< EPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define EPWM_EADCTS1_TRGEN4_Pos (7) /*!< EPWM_T::EADCTS1: TRGEN4 Position */ -#define EPWM_EADCTS1_TRGEN4_Msk (0x1ul << EPWM_EADCTS1_TRGEN4_Pos) /*!< EPWM_T::EADCTS1: TRGEN4 Mask */ - -#define EPWM_EADCTS1_TRGSEL5_Pos (8) /*!< EPWM_T::EADCTS1: TRGSEL5 Position */ -#define EPWM_EADCTS1_TRGSEL5_Msk (0xful << EPWM_EADCTS1_TRGSEL5_Pos) /*!< EPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define EPWM_EADCTS1_TRGEN5_Pos (15) /*!< EPWM_T::EADCTS1: TRGEN5 Position */ -#define EPWM_EADCTS1_TRGEN5_Msk (0x1ul << EPWM_EADCTS1_TRGEN5_Pos) /*!< EPWM_T::EADCTS1: TRGEN5 Mask */ - -#define EPWM_FTCMPDAT0_1_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Position */ -#define EPWM_FTCMPDAT0_1_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT0_1_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Mask */ - -#define EPWM_FTCMPDAT2_3_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Position */ -#define EPWM_FTCMPDAT2_3_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT2_3_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Mask */ - -#define EPWM_FTCMPDAT4_5_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Position */ -#define EPWM_FTCMPDAT4_5_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT4_5_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Mask */ - -#define EPWM_SSCTL_SSEN0_Pos (0) /*!< EPWM_T::SSCTL: SSEN0 Position */ -#define EPWM_SSCTL_SSEN0_Msk (0x1ul << EPWM_SSCTL_SSEN0_Pos) /*!< EPWM_T::SSCTL: SSEN0 Mask */ - -#define EPWM_SSCTL_SSEN1_Pos (1) /*!< EPWM_T::SSCTL: SSEN1 Position */ -#define EPWM_SSCTL_SSEN1_Msk (0x1ul << EPWM_SSCTL_SSEN1_Pos) /*!< EPWM_T::SSCTL: SSEN1 Mask */ - -#define EPWM_SSCTL_SSEN2_Pos (2) /*!< EPWM_T::SSCTL: SSEN2 Position */ -#define EPWM_SSCTL_SSEN2_Msk (0x1ul << EPWM_SSCTL_SSEN2_Pos) /*!< EPWM_T::SSCTL: SSEN2 Mask */ - -#define EPWM_SSCTL_SSEN3_Pos (3) /*!< EPWM_T::SSCTL: SSEN3 Position */ -#define EPWM_SSCTL_SSEN3_Msk (0x1ul << EPWM_SSCTL_SSEN3_Pos) /*!< EPWM_T::SSCTL: SSEN3 Mask */ - -#define EPWM_SSCTL_SSEN4_Pos (4) /*!< EPWM_T::SSCTL: SSEN4 Position */ -#define EPWM_SSCTL_SSEN4_Msk (0x1ul << EPWM_SSCTL_SSEN4_Pos) /*!< EPWM_T::SSCTL: SSEN4 Mask */ - -#define EPWM_SSCTL_SSEN5_Pos (5) /*!< EPWM_T::SSCTL: SSEN5 Position */ -#define EPWM_SSCTL_SSEN5_Msk (0x1ul << EPWM_SSCTL_SSEN5_Pos) /*!< EPWM_T::SSCTL: SSEN5 Mask */ - -#define EPWM_SSCTL_SSRC_Pos (8) /*!< EPWM_T::SSCTL: SSRC Position */ -#define EPWM_SSCTL_SSRC_Msk (0x3ul << EPWM_SSCTL_SSRC_Pos) /*!< EPWM_T::SSCTL: SSRC Mask */ - -#define EPWM_SSTRG_CNTSEN_Pos (0) /*!< EPWM_T::SSTRG: CNTSEN Position */ -#define EPWM_SSTRG_CNTSEN_Msk (0x1ul << EPWM_SSTRG_CNTSEN_Pos) /*!< EPWM_T::SSTRG: CNTSEN Mask */ - -#define EPWM_LEBCTL_LEBEN_Pos (0) /*!< EPWM_T::LEBCTL: LEBEN Position */ -#define EPWM_LEBCTL_LEBEN_Msk (0x1ul << EPWM_LEBCTL_LEBEN_Pos) /*!< EPWM_T::LEBCTL: LEBEN Mask */ - -#define EPWM_LEBCTL_SRCEN0_Pos (8) /*!< EPWM_T::LEBCTL: SRCEN0 Position */ -#define EPWM_LEBCTL_SRCEN0_Msk (0x1ul << EPWM_LEBCTL_SRCEN0_Pos) /*!< EPWM_T::LEBCTL: SRCEN0 Mask */ - -#define EPWM_LEBCTL_SRCEN2_Pos (9) /*!< EPWM_T::LEBCTL: SRCEN2 Position */ -#define EPWM_LEBCTL_SRCEN2_Msk (0x1ul << EPWM_LEBCTL_SRCEN2_Pos) /*!< EPWM_T::LEBCTL: SRCEN2 Mask */ - -#define EPWM_LEBCTL_SRCEN4_Pos (10) /*!< EPWM_T::LEBCTL: SRCEN4 Position */ -#define EPWM_LEBCTL_SRCEN4_Msk (0x1ul << EPWM_LEBCTL_SRCEN4_Pos) /*!< EPWM_T::LEBCTL: SRCEN4 Mask */ - -#define EPWM_LEBCTL_TRGTYPE_Pos (16) /*!< EPWM_T::LEBCTL: TRGTYPE Position */ -#define EPWM_LEBCTL_TRGTYPE_Msk (0x3ul << EPWM_LEBCTL_TRGTYPE_Pos) /*!< EPWM_T::LEBCTL: TRGTYPE Mask */ - -#define EPWM_LEBCNT_LEBCNT_Pos (0) /*!< EPWM_T::LEBCNT: LEBCNT Position */ -#define EPWM_LEBCNT_LEBCNT_Msk (0x1fful << EPWM_LEBCNT_LEBCNT_Pos) /*!< EPWM_T::LEBCNT: LEBCNT Mask */ - -#define EPWM_STATUS_CNTMAXF0_Pos (0) /*!< EPWM_T::STATUS: CNTMAXF0 Position */ -#define EPWM_STATUS_CNTMAXF0_Msk (0x1ul << EPWM_STATUS_CNTMAXF0_Pos) /*!< EPWM_T::STATUS: CNTMAXF0 Mask */ - -#define EPWM_STATUS_CNTMAXF1_Pos (1) /*!< EPWM_T::STATUS: CNTMAXF1 Position */ -#define EPWM_STATUS_CNTMAXF1_Msk (0x1ul << EPWM_STATUS_CNTMAXF1_Pos) /*!< EPWM_T::STATUS: CNTMAXF1 Mask */ - -#define EPWM_STATUS_CNTMAXF2_Pos (2) /*!< EPWM_T::STATUS: CNTMAXF2 Position */ -#define EPWM_STATUS_CNTMAXF2_Msk (0x1ul << EPWM_STATUS_CNTMAXF2_Pos) /*!< EPWM_T::STATUS: CNTMAXF2 Mask */ - -#define EPWM_STATUS_CNTMAXF3_Pos (3) /*!< EPWM_T::STATUS: CNTMAXF3 Position */ -#define EPWM_STATUS_CNTMAXF3_Msk (0x1ul << EPWM_STATUS_CNTMAXF3_Pos) /*!< EPWM_T::STATUS: CNTMAXF3 Mask */ - -#define EPWM_STATUS_CNTMAXF4_Pos (4) /*!< EPWM_T::STATUS: CNTMAXF4 Position */ -#define EPWM_STATUS_CNTMAXF4_Msk (0x1ul << EPWM_STATUS_CNTMAXF4_Pos) /*!< EPWM_T::STATUS: CNTMAXF4 Mask */ - -#define EPWM_STATUS_CNTMAXF5_Pos (5) /*!< EPWM_T::STATUS: CNTMAXF5 Position */ -#define EPWM_STATUS_CNTMAXF5_Msk (0x1ul << EPWM_STATUS_CNTMAXF5_Pos) /*!< EPWM_T::STATUS: CNTMAXF5 Mask */ - -#define EPWM_STATUS_SYNCINF0_Pos (8) /*!< EPWM_T::STATUS: SYNCINF0 Position */ -#define EPWM_STATUS_SYNCINF0_Msk (0x1ul << EPWM_STATUS_SYNCINF0_Pos) /*!< EPWM_T::STATUS: SYNCINF0 Mask */ - -#define EPWM_STATUS_SYNCINF2_Pos (9) /*!< EPWM_T::STATUS: SYNCINF2 Position */ -#define EPWM_STATUS_SYNCINF2_Msk (0x1ul << EPWM_STATUS_SYNCINF2_Pos) /*!< EPWM_T::STATUS: SYNCINF2 Mask */ - -#define EPWM_STATUS_SYNCINF4_Pos (10) /*!< EPWM_T::STATUS: SYNCINF4 Position */ -#define EPWM_STATUS_SYNCINF4_Msk (0x1ul << EPWM_STATUS_SYNCINF4_Pos) /*!< EPWM_T::STATUS: SYNCINF4 Mask */ - -#define EPWM_STATUS_EADCTRGF0_Pos (16) /*!< EPWM_T::STATUS: EADCTRGF0 Position */ -#define EPWM_STATUS_EADCTRGF0_Msk (0x1ul << EPWM_STATUS_EADCTRGF0_Pos) /*!< EPWM_T::STATUS: EADCTRGF0 Mask */ - -#define EPWM_STATUS_EADCTRGF1_Pos (17) /*!< EPWM_T::STATUS: EADCTRGF1 Position */ -#define EPWM_STATUS_EADCTRGF1_Msk (0x1ul << EPWM_STATUS_EADCTRGF1_Pos) /*!< EPWM_T::STATUS: EADCTRGF1 Mask */ - -#define EPWM_STATUS_EADCTRGF2_Pos (18) /*!< EPWM_T::STATUS: EADCTRGF2 Position */ -#define EPWM_STATUS_EADCTRGF2_Msk (0x1ul << EPWM_STATUS_EADCTRGF2_Pos) /*!< EPWM_T::STATUS: EADCTRGF2 Mask */ - -#define EPWM_STATUS_EADCTRGF3_Pos (19) /*!< EPWM_T::STATUS: EADCTRGF3 Position */ -#define EPWM_STATUS_EADCTRGF3_Msk (0x1ul << EPWM_STATUS_EADCTRGF3_Pos) /*!< EPWM_T::STATUS: EADCTRGF3 Mask */ - -#define EPWM_STATUS_EADCTRGF4_Pos (20) /*!< EPWM_T::STATUS: EADCTRGF4 Position */ -#define EPWM_STATUS_EADCTRGF4_Msk (0x1ul << EPWM_STATUS_EADCTRGF4_Pos) /*!< EPWM_T::STATUS: EADCTRGF4 Mask */ - -#define EPWM_STATUS_EADCTRGF5_Pos (21) /*!< EPWM_T::STATUS: EADCTRGF5 Position */ -#define EPWM_STATUS_EADCTRGF5_Msk (0x1ul << EPWM_STATUS_EADCTRGF5_Pos) /*!< EPWM_T::STATUS: EADCTRGF5 Mask */ - -#define EPWM_STATUS_DACTRGF_Pos (24) /*!< EPWM_T::STATUS: DACTRGF Position */ -#define EPWM_STATUS_DACTRGF_Msk (0x1ul << EPWM_STATUS_DACTRGF_Pos) /*!< EPWM_T::STATUS: DACTRGF Mask */ - -#define EPWM_IFA0_IFACNT_Pos (0) /*!< EPWM_T::IFA0: IFACNT Position */ -#define EPWM_IFA0_IFACNT_Msk (0xfffful << EPWM_IFA0_IFACNT_Pos) /*!< EPWM_T::IFA0: IFACNT Mask */ - -#define EPWM_IFA0_STPMOD_Pos (24) /*!< EPWM_T::IFA0: STPMOD Position */ -#define EPWM_IFA0_STPMOD_Msk (0x1ul << EPWM_IFA0_STPMOD_Pos) /*!< EPWM_T::IFA0: STPMOD Mask */ - -#define EPWM_IFA0_IFASEL_Pos (28) /*!< EPWM_T::IFA0: IFASEL Position */ -#define EPWM_IFA0_IFASEL_Msk (0x3ul << EPWM_IFA0_IFASEL_Pos) /*!< EPWM_T::IFA0: IFASEL Mask */ - -#define EPWM_IFA0_IFAEN_Pos (31) /*!< EPWM_T::IFA0: IFAEN Position */ -#define EPWM_IFA0_IFAEN_Msk (0x1ul << EPWM_IFA0_IFAEN_Pos) /*!< EPWM_T::IFA0: IFAEN Mask */ - -#define EPWM_IFA1_IFACNT_Pos (0) /*!< EPWM_T::IFA1: IFACNT Position */ -#define EPWM_IFA1_IFACNT_Msk (0xfffful << EPWM_IFA1_IFACNT_Pos) /*!< EPWM_T::IFA1: IFACNT Mask */ - -#define EPWM_IFA1_STPMOD_Pos (24) /*!< EPWM_T::IFA1: STPMOD Position */ -#define EPWM_IFA1_STPMOD_Msk (0x1ul << EPWM_IFA1_STPMOD_Pos) /*!< EPWM_T::IFA1: STPMOD Mask */ - -#define EPWM_IFA1_IFASEL_Pos (28) /*!< EPWM_T::IFA1: IFASEL Position */ -#define EPWM_IFA1_IFASEL_Msk (0x3ul << EPWM_IFA1_IFASEL_Pos) /*!< EPWM_T::IFA1: IFASEL Mask */ - -#define EPWM_IFA1_IFAEN_Pos (31) /*!< EPWM_T::IFA1: IFAEN Position */ -#define EPWM_IFA1_IFAEN_Msk (0x1ul << EPWM_IFA1_IFAEN_Pos) /*!< EPWM_T::IFA1: IFAEN Mask */ - -#define EPWM_IFA2_IFACNT_Pos (0) /*!< EPWM_T::IFA2: IFACNT Position */ -#define EPWM_IFA2_IFACNT_Msk (0xfffful << EPWM_IFA2_IFACNT_Pos) /*!< EPWM_T::IFA2: IFACNT Mask */ - -#define EPWM_IFA2_STPMOD_Pos (24) /*!< EPWM_T::IFA2: STPMOD Position */ -#define EPWM_IFA2_STPMOD_Msk (0x1ul << EPWM_IFA2_STPMOD_Pos) /*!< EPWM_T::IFA2: STPMOD Mask */ - -#define EPWM_IFA2_IFASEL_Pos (28) /*!< EPWM_T::IFA2: IFASEL Position */ -#define EPWM_IFA2_IFASEL_Msk (0x3ul << EPWM_IFA2_IFASEL_Pos) /*!< EPWM_T::IFA2: IFASEL Mask */ - -#define EPWM_IFA2_IFAEN_Pos (31) /*!< EPWM_T::IFA2: IFAEN Position */ -#define EPWM_IFA2_IFAEN_Msk (0x1ul << EPWM_IFA2_IFAEN_Pos) /*!< EPWM_T::IFA2: IFAEN Mask */ - -#define EPWM_IFA3_IFACNT_Pos (0) /*!< EPWM_T::IFA3: IFACNT Position */ -#define EPWM_IFA3_IFACNT_Msk (0xfffful << EPWM_IFA3_IFACNT_Pos) /*!< EPWM_T::IFA3: IFACNT Mask */ - -#define EPWM_IFA3_STPMOD_Pos (24) /*!< EPWM_T::IFA3: STPMOD Position */ -#define EPWM_IFA3_STPMOD_Msk (0x1ul << EPWM_IFA3_STPMOD_Pos) /*!< EPWM_T::IFA3: STPMOD Mask */ - -#define EPWM_IFA3_IFASEL_Pos (28) /*!< EPWM_T::IFA3: IFASEL Position */ -#define EPWM_IFA3_IFASEL_Msk (0x3ul << EPWM_IFA3_IFASEL_Pos) /*!< EPWM_T::IFA3: IFASEL Mask */ - -#define EPWM_IFA3_IFAEN_Pos (31) /*!< EPWM_T::IFA3: IFAEN Position */ -#define EPWM_IFA3_IFAEN_Msk (0x1ul << EPWM_IFA3_IFAEN_Pos) /*!< EPWM_T::IFA3: IFAEN Mask */ - -#define EPWM_IFA4_IFACNT_Pos (0) /*!< EPWM_T::IFA4: IFACNT Position */ -#define EPWM_IFA4_IFACNT_Msk (0xfffful << EPWM_IFA4_IFACNT_Pos) /*!< EPWM_T::IFA4: IFACNT Mask */ - -#define EPWM_IFA4_STPMOD_Pos (24) /*!< EPWM_T::IFA4: STPMOD Position */ -#define EPWM_IFA4_STPMOD_Msk (0x1ul << EPWM_IFA4_STPMOD_Pos) /*!< EPWM_T::IFA4: STPMOD Mask */ - -#define EPWM_IFA4_IFASEL_Pos (28) /*!< EPWM_T::IFA4: IFASEL Position */ -#define EPWM_IFA4_IFASEL_Msk (0x3ul << EPWM_IFA4_IFASEL_Pos) /*!< EPWM_T::IFA4: IFASEL Mask */ - -#define EPWM_IFA4_IFAEN_Pos (31) /*!< EPWM_T::IFA4: IFAEN Position */ -#define EPWM_IFA4_IFAEN_Msk (0x1ul << EPWM_IFA4_IFAEN_Pos) /*!< EPWM_T::IFA4: IFAEN Mask */ - -#define EPWM_IFA5_IFACNT_Pos (0) /*!< EPWM_T::IFA5: IFACNT Position */ -#define EPWM_IFA5_IFACNT_Msk (0xfffful << EPWM_IFA5_IFACNT_Pos) /*!< EPWM_T::IFA5: IFACNT Mask */ - -#define EPWM_IFA5_STPMOD_Pos (24) /*!< EPWM_T::IFA5: STPMOD Position */ -#define EPWM_IFA5_STPMOD_Msk (0x1ul << EPWM_IFA5_STPMOD_Pos) /*!< EPWM_T::IFA5: STPMOD Mask */ - -#define EPWM_IFA5_IFASEL_Pos (28) /*!< EPWM_T::IFA5: IFASEL Position */ -#define EPWM_IFA5_IFASEL_Msk (0x3ul << EPWM_IFA5_IFASEL_Pos) /*!< EPWM_T::IFA5: IFASEL Mask */ - -#define EPWM_IFA5_IFAEN_Pos (31) /*!< EPWM_T::IFA5: IFAEN Position */ -#define EPWM_IFA5_IFAEN_Msk (0x1ul << EPWM_IFA5_IFAEN_Pos) /*!< EPWM_T::IFA5: IFAEN Mask */ - -#define EPWM_AINTSTS_IFAIF0_Pos (0) /*!< EPWM_T::AINTSTS: IFAIF0 Position */ -#define EPWM_AINTSTS_IFAIF0_Msk (0x1ul << EPWM_AINTSTS_IFAIF0_Pos) /*!< EPWM_T::AINTSTS: IFAIF0 Mask */ - -#define EPWM_AINTSTS_IFAIF1_Pos (1) /*!< EPWM_T::AINTSTS: IFAIF1 Position */ -#define EPWM_AINTSTS_IFAIF1_Msk (0x1ul << EPWM_AINTSTS_IFAIF1_Pos) /*!< EPWM_T::AINTSTS: IFAIF1 Mask */ - -#define EPWM_AINTSTS_IFAIF2_Pos (2) /*!< EPWM_T::AINTSTS: IFAIF2 Position */ -#define EPWM_AINTSTS_IFAIF2_Msk (0x1ul << EPWM_AINTSTS_IFAIF2_Pos) /*!< EPWM_T::AINTSTS: IFAIF2 Mask */ - -#define EPWM_AINTSTS_IFAIF3_Pos (3) /*!< EPWM_T::AINTSTS: IFAIF3 Position */ -#define EPWM_AINTSTS_IFAIF3_Msk (0x1ul << EPWM_AINTSTS_IFAIF3_Pos) /*!< EPWM_T::AINTSTS: IFAIF3 Mask */ - -#define EPWM_AINTSTS_IFAIF4_Pos (4) /*!< EPWM_T::AINTSTS: IFAIF4 Position */ -#define EPWM_AINTSTS_IFAIF4_Msk (0x1ul << EPWM_AINTSTS_IFAIF4_Pos) /*!< EPWM_T::AINTSTS: IFAIF4 Mask */ - -#define EPWM_AINTSTS_IFAIF5_Pos (5) /*!< EPWM_T::AINTSTS: IFAIF5 Position */ -#define EPWM_AINTSTS_IFAIF5_Msk (0x1ul << EPWM_AINTSTS_IFAIF5_Pos) /*!< EPWM_T::AINTSTS: IFAIF5 Mask */ - -#define EPWM_AINTEN_IFAIEN0_Pos (0) /*!< EPWM_T::AINTEN: IFAIEN0 Position */ -#define EPWM_AINTEN_IFAIEN0_Msk (0x1ul << EPWM_AINTEN_IFAIEN0_Pos) /*!< EPWM_T::AINTEN: IFAIEN0 Mask */ - -#define EPWM_AINTEN_IFAIEN1_Pos (1) /*!< EPWM_T::AINTEN: IFAIEN1 Position */ -#define EPWM_AINTEN_IFAIEN1_Msk (0x1ul << EPWM_AINTEN_IFAIEN1_Pos) /*!< EPWM_T::AINTEN: IFAIEN1 Mask */ - -#define EPWM_AINTEN_IFAIEN2_Pos (2) /*!< EPWM_T::AINTEN: IFAIEN2 Position */ -#define EPWM_AINTEN_IFAIEN2_Msk (0x1ul << EPWM_AINTEN_IFAIEN2_Pos) /*!< EPWM_T::AINTEN: IFAIEN2 Mask */ - -#define EPWM_AINTEN_IFAIEN3_Pos (3) /*!< EPWM_T::AINTEN: IFAIEN3 Position */ -#define EPWM_AINTEN_IFAIEN3_Msk (0x1ul << EPWM_AINTEN_IFAIEN3_Pos) /*!< EPWM_T::AINTEN: IFAIEN3 Mask */ - -#define EPWM_AINTEN_IFAIEN4_Pos (4) /*!< EPWM_T::AINTEN: IFAIEN4 Position */ -#define EPWM_AINTEN_IFAIEN4_Msk (0x1ul << EPWM_AINTEN_IFAIEN4_Pos) /*!< EPWM_T::AINTEN: IFAIEN4 Mask */ - -#define EPWM_AINTEN_IFAIEN5_Pos (5) /*!< EPWM_T::AINTEN: IFAIEN5 Position */ -#define EPWM_AINTEN_IFAIEN5_Msk (0x1ul << EPWM_AINTEN_IFAIEN5_Pos) /*!< EPWM_T::AINTEN: IFAIEN5 Mask */ - -#define EPWM_APDMACTL_APDMAEN0_Pos (0) /*!< EPWM_T::APDMACTL: APDMAEN0 Position */ -#define EPWM_APDMACTL_APDMAEN0_Msk (0x1ul << EPWM_APDMACTL_APDMAEN0_Pos) /*!< EPWM_T::APDMACTL: APDMAEN0 Mask */ - -#define EPWM_APDMACTL_APDMAEN1_Pos (1) /*!< EPWM_T::APDMACTL: APDMAEN1 Position */ -#define EPWM_APDMACTL_APDMAEN1_Msk (0x1ul << EPWM_APDMACTL_APDMAEN1_Pos) /*!< EPWM_T::APDMACTL: APDMAEN1 Mask */ - -#define EPWM_APDMACTL_APDMAEN2_Pos (2) /*!< EPWM_T::APDMACTL: APDMAEN2 Position */ -#define EPWM_APDMACTL_APDMAEN2_Msk (0x1ul << EPWM_APDMACTL_APDMAEN2_Pos) /*!< EPWM_T::APDMACTL: APDMAEN2 Mask */ - -#define EPWM_APDMACTL_APDMAEN3_Pos (3) /*!< EPWM_T::APDMACTL: APDMAEN3 Position */ -#define EPWM_APDMACTL_APDMAEN3_Msk (0x1ul << EPWM_APDMACTL_APDMAEN3_Pos) /*!< EPWM_T::APDMACTL: APDMAEN3 Mask */ - -#define EPWM_APDMACTL_APDMAEN4_Pos (4) /*!< EPWM_T::APDMACTL: APDMAEN4 Position */ -#define EPWM_APDMACTL_APDMAEN4_Msk (0x1ul << EPWM_APDMACTL_APDMAEN4_Pos) /*!< EPWM_T::APDMACTL: APDMAEN4 Mask */ - -#define EPWM_APDMACTL_APDMAEN5_Pos (5) /*!< EPWM_T::APDMACTL: APDMAEN5 Position */ -#define EPWM_APDMACTL_APDMAEN5_Msk (0x1ul << EPWM_APDMACTL_APDMAEN5_Pos) /*!< EPWM_T::APDMACTL: APDMAEN5 Mask */ - -#define EPWM_FDEN_FDEN0_Pos (0) /*!< EPWM_T::FDEN: FDEN0 Position */ -#define EPWM_FDEN_FDEN0_Msk (0x1ul << EPWM_FDEN_FDEN0_Pos) /*!< EPWM_T::FDEN: FDEN0 Mask */ - -#define EPWM_FDEN_FDEN1_Pos (1) /*!< EPWM_T::FDEN: FDEN1 Position */ -#define EPWM_FDEN_FDEN1_Msk (0x1ul << EPWM_FDEN_FDEN1_Pos) /*!< EPWM_T::FDEN: FDEN1 Mask */ - -#define EPWM_FDEN_FDEN2_Pos (2) /*!< EPWM_T::FDEN: FDEN2 Position */ -#define EPWM_FDEN_FDEN2_Msk (0x1ul << EPWM_FDEN_FDEN2_Pos) /*!< EPWM_T::FDEN: FDEN2 Mask */ - -#define EPWM_FDEN_FDEN3_Pos (3) /*!< EPWM_T::FDEN: FDEN3 Position */ -#define EPWM_FDEN_FDEN3_Msk (0x1ul << EPWM_FDEN_FDEN3_Pos) /*!< EPWM_T::FDEN: FDEN3 Mask */ - -#define EPWM_FDEN_FDEN4_Pos (4) /*!< EPWM_T::FDEN: FDEN4 Position */ -#define EPWM_FDEN_FDEN4_Msk (0x1ul << EPWM_FDEN_FDEN4_Pos) /*!< EPWM_T::FDEN: FDEN4 Mask */ - -#define EPWM_FDEN_FDEN5_Pos (5) /*!< EPWM_T::FDEN: FDEN5 Position */ -#define EPWM_FDEN_FDEN5_Msk (0x1ul << EPWM_FDEN_FDEN5_Pos) /*!< EPWM_T::FDEN: FDEN5 Mask */ - -#define EPWM_FDEN_FDODIS0_Pos (8) /*!< EPWM_T::FDEN: FDODIS0 Position */ -#define EPWM_FDEN_FDODIS0_Msk (0x1ul << EPWM_FDEN_FDODIS0_Pos) /*!< EPWM_T::FDEN: FDODIS0 Mask */ - -#define EPWM_FDEN_FDODIS1_Pos (9) /*!< EPWM_T::FDEN: FDODIS1 Position */ -#define EPWM_FDEN_FDODIS1_Msk (0x1ul << EPWM_FDEN_FDODIS1_Pos) /*!< EPWM_T::FDEN: FDODIS1 Mask */ - -#define EPWM_FDEN_FDODIS2_Pos (10) /*!< EPWM_T::FDEN: FDODIS2 Position */ -#define EPWM_FDEN_FDODIS2_Msk (0x1ul << EPWM_FDEN_FDODIS2_Pos) /*!< EPWM_T::FDEN: FDODIS2 Mask */ - -#define EPWM_FDEN_FDODIS3_Pos (11) /*!< EPWM_T::FDEN: FDODIS3 Position */ -#define EPWM_FDEN_FDODIS3_Msk (0x1ul << EPWM_FDEN_FDODIS3_Pos) /*!< EPWM_T::FDEN: FDODIS3 Mask */ - -#define EPWM_FDEN_FDODIS4_Pos (12) /*!< EPWM_T::FDEN: FDODIS4 Position */ -#define EPWM_FDEN_FDODIS4_Msk (0x1ul << EPWM_FDEN_FDODIS4_Pos) /*!< EPWM_T::FDEN: FDODIS4 Mask */ - -#define EPWM_FDEN_FDODIS5_Pos (13) /*!< EPWM_T::FDEN: FDODIS5 Position */ -#define EPWM_FDEN_FDODIS5_Msk (0x1ul << EPWM_FDEN_FDODIS5_Pos) /*!< EPWM_T::FDEN: FDODIS5 Mask */ - -#define EPWM_FDEN_FDCKS0_Pos (16) /*!< EPWM_T::FDEN: FDCKS0 Position */ -#define EPWM_FDEN_FDCKS0_Msk (0x1ul << EPWM_FDEN_FDCKS0_Pos) /*!< EPWM_T::FDEN: FDCKS0 Mask */ - -#define EPWM_FDEN_FDCKS1_Pos (17) /*!< EPWM_T::FDEN: FDCKS1 Position */ -#define EPWM_FDEN_FDCKS1_Msk (0x1ul << EPWM_FDEN_FDCKS1_Pos) /*!< EPWM_T::FDEN: FDCKS1 Mask */ - -#define EPWM_FDEN_FDCKS2_Pos (18) /*!< EPWM_T::FDEN: FDCKS2 Position */ -#define EPWM_FDEN_FDCKS2_Msk (0x1ul << EPWM_FDEN_FDCKS2_Pos) /*!< EPWM_T::FDEN: FDCKS2 Mask */ - -#define EPWM_FDEN_FDCKS3_Pos (19) /*!< EPWM_T::FDEN: FDCKS3 Position */ -#define EPWM_FDEN_FDCKS3_Msk (0x1ul << EPWM_FDEN_FDCKS3_Pos) /*!< EPWM_T::FDEN: FDCKS3 Mask */ - -#define EPWM_FDEN_FDCKS4_Pos (20) /*!< EPWM_T::FDEN: FDCKS4 Position */ -#define EPWM_FDEN_FDCKS4_Msk (0x1ul << EPWM_FDEN_FDCKS4_Pos) /*!< EPWM_T::FDEN: FDCKS4 Mask */ - -#define EPWM_FDEN_FDCKS5_Pos (21) /*!< EPWM_T::FDEN: FDCKS5 Position */ -#define EPWM_FDEN_FDCKS5_Msk (0x1ul << EPWM_FDEN_FDCKS5_Pos) /*!< EPWM_T::FDEN: FDCKS5 Mask */ - -#define EPWM_FDCTL0_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL0: TRMSKCNT Position */ -#define EPWM_FDCTL0_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL0_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL0: TRMSKCNT Mask */ - -#define EPWM_FDCTL0_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL0: FDMSKEN Position */ -#define EPWM_FDCTL0_FDMSKEN_Msk (0x1ul << EPWM_FDCTL0_FDMSKEN_Pos) /*!< EPWM_T::FDCTL0: FDMSKEN Mask */ - -#define EPWM_FDCTL0_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL0: DGSMPCYC Position */ -#define EPWM_FDCTL0_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL0_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL0: DGSMPCYC Mask */ - -#define EPWM_FDCTL0_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL0: FDCKSEL Position */ -#define EPWM_FDCTL0_FDCKSEL_Msk (0x3ul << EPWM_FDCTL0_FDCKSEL_Pos) /*!< EPWM_T::FDCTL0: FDCKSEL Mask */ - -#define EPWM_FDCTL0_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL0: FDDGEN Position */ -#define EPWM_FDCTL0_FDDGEN_Msk (0x1ul << EPWM_FDCTL0_FDDGEN_Pos) /*!< EPWM_T::FDCTL0: FDDGEN Mask */ - -#define EPWM_FDCTL1_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL1: TRMSKCNT Position */ -#define EPWM_FDCTL1_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL1_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL1: TRMSKCNT Mask */ - -#define EPWM_FDCTL1_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL1: FDMSKEN Position */ -#define EPWM_FDCTL1_FDMSKEN_Msk (0x1ul << EPWM_FDCTL1_FDMSKEN_Pos) /*!< EPWM_T::FDCTL1: FDMSKEN Mask */ - -#define EPWM_FDCTL1_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL1: DGSMPCYC Position */ -#define EPWM_FDCTL1_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL1_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL1: DGSMPCYC Mask */ - -#define EPWM_FDCTL1_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL1: FDCKSEL Position */ -#define EPWM_FDCTL1_FDCKSEL_Msk (0x3ul << EPWM_FDCTL1_FDCKSEL_Pos) /*!< EPWM_T::FDCTL1: FDCKSEL Mask */ - -#define EPWM_FDCTL1_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL1: FDDGEN Position */ -#define EPWM_FDCTL1_FDDGEN_Msk (0x1ul << EPWM_FDCTL1_FDDGEN_Pos) /*!< EPWM_T::FDCTL1: FDDGEN Mask */ - -#define EPWM_FDCTL2_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL2: TRMSKCNT Position */ -#define EPWM_FDCTL2_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL2_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL2: TRMSKCNT Mask */ - -#define EPWM_FDCTL2_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL2: FDMSKEN Position */ -#define EPWM_FDCTL2_FDMSKEN_Msk (0x1ul << EPWM_FDCTL2_FDMSKEN_Pos) /*!< EPWM_T::FDCTL2: FDMSKEN Mask */ - -#define EPWM_FDCTL2_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL2: DGSMPCYC Position */ -#define EPWM_FDCTL2_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL2_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL2: DGSMPCYC Mask */ - -#define EPWM_FDCTL2_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL2: FDCKSEL Position */ -#define EPWM_FDCTL2_FDCKSEL_Msk (0x3ul << EPWM_FDCTL2_FDCKSEL_Pos) /*!< EPWM_T::FDCTL2: FDCKSEL Mask */ - -#define EPWM_FDCTL2_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL2: FDDGEN Position */ -#define EPWM_FDCTL2_FDDGEN_Msk (0x1ul << EPWM_FDCTL2_FDDGEN_Pos) /*!< EPWM_T::FDCTL2: FDDGEN Mask */ - -#define EPWM_FDCTL3_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL3: TRMSKCNT Position */ -#define EPWM_FDCTL3_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL3_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL3: TRMSKCNT Mask */ - -#define EPWM_FDCTL3_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL3: FDMSKEN Position */ -#define EPWM_FDCTL3_FDMSKEN_Msk (0x1ul << EPWM_FDCTL3_FDMSKEN_Pos) /*!< EPWM_T::FDCTL3: FDMSKEN Mask */ - -#define EPWM_FDCTL3_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL3: DGSMPCYC Position */ -#define EPWM_FDCTL3_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL3_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL3: DGSMPCYC Mask */ - -#define EPWM_FDCTL3_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL3: FDCKSEL Position */ -#define EPWM_FDCTL3_FDCKSEL_Msk (0x3ul << EPWM_FDCTL3_FDCKSEL_Pos) /*!< EPWM_T::FDCTL3: FDCKSEL Mask */ - -#define EPWM_FDCTL3_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL3: FDDGEN Position */ -#define EPWM_FDCTL3_FDDGEN_Msk (0x1ul << EPWM_FDCTL3_FDDGEN_Pos) /*!< EPWM_T::FDCTL3: FDDGEN Mask */ - -#define EPWM_FDCTL4_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL4: TRMSKCNT Position */ -#define EPWM_FDCTL4_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL4_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL4: TRMSKCNT Mask */ - -#define EPWM_FDCTL4_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL4: FDMSKEN Position */ -#define EPWM_FDCTL4_FDMSKEN_Msk (0x1ul << EPWM_FDCTL4_FDMSKEN_Pos) /*!< EPWM_T::FDCTL4: FDMSKEN Mask */ - -#define EPWM_FDCTL4_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL4: DGSMPCYC Position */ -#define EPWM_FDCTL4_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL4_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL4: DGSMPCYC Mask */ - -#define EPWM_FDCTL4_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL4: FDCKSEL Position */ -#define EPWM_FDCTL4_FDCKSEL_Msk (0x3ul << EPWM_FDCTL4_FDCKSEL_Pos) /*!< EPWM_T::FDCTL4: FDCKSEL Mask */ - -#define EPWM_FDCTL4_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL4: FDDGEN Position */ -#define EPWM_FDCTL4_FDDGEN_Msk (0x1ul << EPWM_FDCTL4_FDDGEN_Pos) /*!< EPWM_T::FDCTL4: FDDGEN Mask */ - -#define EPWM_FDCTL5_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL5: TRMSKCNT Position */ -#define EPWM_FDCTL5_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL5_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL5: TRMSKCNT Mask */ - -#define EPWM_FDCTL5_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL5: FDMSKEN Position */ -#define EPWM_FDCTL5_FDMSKEN_Msk (0x1ul << EPWM_FDCTL5_FDMSKEN_Pos) /*!< EPWM_T::FDCTL5: FDMSKEN Mask */ - -#define EPWM_FDCTL5_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL5: DGSMPCYC Position */ -#define EPWM_FDCTL5_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL5_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL5: DGSMPCYC Mask */ - -#define EPWM_FDCTL5_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL5: FDCKSEL Position */ -#define EPWM_FDCTL5_FDCKSEL_Msk (0x3ul << EPWM_FDCTL5_FDCKSEL_Pos) /*!< EPWM_T::FDCTL5: FDCKSEL Mask */ - -#define EPWM_FDCTL5_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL5: FDDGEN Position */ -#define EPWM_FDCTL5_FDDGEN_Msk (0x1ul << EPWM_FDCTL5_FDDGEN_Pos) /*!< EPWM_T::FDCTL5: FDDGEN Mask */ - -#define EPWM_FDIEN_FDIEN0_Pos (0) /*!< EPWM_T::FDIEN: FDIEN0 Position */ -#define EPWM_FDIEN_FDIEN0_Msk (0x1ul << EPWM_FDIEN_FDIEN0_Pos) /*!< EPWM_T::FDIEN: FDIEN0 Mask */ - -#define EPWM_FDIEN_FDIEN1_Pos (1) /*!< EPWM_T::FDIEN: FDIEN1 Position */ -#define EPWM_FDIEN_FDIEN1_Msk (0x1ul << EPWM_FDIEN_FDIEN1_Pos) /*!< EPWM_T::FDIEN: FDIEN1 Mask */ - -#define EPWM_FDIEN_FDIEN2_Pos (2) /*!< EPWM_T::FDIEN: FDIEN2 Position */ -#define EPWM_FDIEN_FDIEN2_Msk (0x1ul << EPWM_FDIEN_FDIEN2_Pos) /*!< EPWM_T::FDIEN: FDIEN2 Mask */ - -#define EPWM_FDIEN_FDIEN3_Pos (3) /*!< EPWM_T::FDIEN: FDIEN3 Position */ -#define EPWM_FDIEN_FDIEN3_Msk (0x1ul << EPWM_FDIEN_FDIEN3_Pos) /*!< EPWM_T::FDIEN: FDIEN3 Mask */ - -#define EPWM_FDIEN_FDIEN4_Pos (4) /*!< EPWM_T::FDIEN: FDIEN4 Position */ -#define EPWM_FDIEN_FDIEN4_Msk (0x1ul << EPWM_FDIEN_FDIEN4_Pos) /*!< EPWM_T::FDIEN: FDIEN4 Mask */ - -#define EPWM_FDIEN_FDIEN5_Pos (5) /*!< EPWM_T::FDIEN: FDIEN5 Position */ -#define EPWM_FDIEN_FDIEN5_Msk (0x1ul << EPWM_FDIEN_FDIEN5_Pos) /*!< EPWM_T::FDIEN: FDIEN5 Mask */ - -#define EPWM_FDSTS_FDIF0_Pos (0) /*!< EPWM_T::FDSTS: FDIF0 Position */ -#define EPWM_FDSTS_FDIF0_Msk (0x1ul << EPWM_FDSTS_FDIF0_Pos) /*!< EPWM_T::FDSTS: FDIF0 Mask */ - -#define EPWM_FDSTS_FDIF1_Pos (1) /*!< EPWM_T::FDSTS: FDIF1 Position */ -#define EPWM_FDSTS_FDIF1_Msk (0x1ul << EPWM_FDSTS_FDIF1_Pos) /*!< EPWM_T::FDSTS: FDIF1 Mask */ - -#define EPWM_FDSTS_FDIF2_Pos (2) /*!< EPWM_T::FDSTS: FDIF2 Position */ -#define EPWM_FDSTS_FDIF2_Msk (0x1ul << EPWM_FDSTS_FDIF2_Pos) /*!< EPWM_T::FDSTS: FDIF2 Mask */ - -#define EPWM_FDSTS_FDIF3_Pos (3) /*!< EPWM_T::FDSTS: FDIF3 Position */ -#define EPWM_FDSTS_FDIF3_Msk (0x1ul << EPWM_FDSTS_FDIF3_Pos) /*!< EPWM_T::FDSTS: FDIF3 Mask */ - -#define EPWM_FDSTS_FDIF4_Pos (4) /*!< EPWM_T::FDSTS: FDIF4 Position */ -#define EPWM_FDSTS_FDIF4_Msk (0x1ul << EPWM_FDSTS_FDIF4_Pos) /*!< EPWM_T::FDSTS: FDIF4 Mask */ - -#define EPWM_FDSTS_FDIF5_Pos (5) /*!< EPWM_T::FDSTS: FDIF5 Position */ -#define EPWM_FDSTS_FDIF5_Msk (0x1ul << EPWM_FDSTS_FDIF5_Pos) /*!< EPWM_T::FDSTS: FDIF5 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN0_Pos (0) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Position */ -#define EPWM_EADCPSCCTL_PSCEN0_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN0_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN1_Pos (1) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Position */ -#define EPWM_EADCPSCCTL_PSCEN1_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN1_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN2_Pos (2) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Position */ -#define EPWM_EADCPSCCTL_PSCEN2_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN2_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN3_Pos (3) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Position */ -#define EPWM_EADCPSCCTL_PSCEN3_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN3_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN4_Pos (4) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Position */ -#define EPWM_EADCPSCCTL_PSCEN4_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN4_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN5_Pos (5) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Position */ -#define EPWM_EADCPSCCTL_PSCEN5_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN5_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Mask */ - -#define EPWM_EADCPSC0_EADCPSC0_Pos (0) /*!< EPWM_T::EADCPSC0: EADCPSC0 Position */ -#define EPWM_EADCPSC0_EADCPSC0_Msk (0xful << EPWM_EADCPSC0_EADCPSC0_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC0 Mask */ - -#define EPWM_EADCPSC0_EADCPSC1_Pos (8) /*!< EPWM_T::EADCPSC0: EADCPSC1 Position */ -#define EPWM_EADCPSC0_EADCPSC1_Msk (0xful << EPWM_EADCPSC0_EADCPSC1_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC1 Mask */ - -#define EPWM_EADCPSC0_EADCPSC2_Pos (16) /*!< EPWM_T::EADCPSC0: EADCPSC2 Position */ -#define EPWM_EADCPSC0_EADCPSC2_Msk (0xful << EPWM_EADCPSC0_EADCPSC2_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC2 Mask */ - -#define EPWM_EADCPSC0_EADCPSC3_Pos (24) /*!< EPWM_T::EADCPSC0: EADCPSC3 Position */ -#define EPWM_EADCPSC0_EADCPSC3_Msk (0xful << EPWM_EADCPSC0_EADCPSC3_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC3 Mask */ - -#define EPWM_EADCPSC1_EADCPSC4_Pos (0) /*!< EPWM_T::EADCPSC1: EADCPSC4 Position */ -#define EPWM_EADCPSC1_EADCPSC4_Msk (0xful << EPWM_EADCPSC1_EADCPSC4_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC4 Mask */ - -#define EPWM_EADCPSC1_EADCPSC5_Pos (8) /*!< EPWM_T::EADCPSC1: EADCPSC5 Position */ -#define EPWM_EADCPSC1_EADCPSC5_Msk (0xful << EPWM_EADCPSC1_EADCPSC5_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC5 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT0_Pos (0) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Position */ -#define EPWM_EADCPSCNT0_PSCNT0_Msk (0xful << EPWM_EADCPSCNT0_PSCNT0_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT1_Pos (8) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Position */ -#define EPWM_EADCPSCNT0_PSCNT1_Msk (0xful << EPWM_EADCPSCNT0_PSCNT1_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT2_Pos (16) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Position */ -#define EPWM_EADCPSCNT0_PSCNT2_Msk (0xful << EPWM_EADCPSCNT0_PSCNT2_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT3_Pos (24) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Position */ -#define EPWM_EADCPSCNT0_PSCNT3_Msk (0xful << EPWM_EADCPSCNT0_PSCNT3_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT4_Pos (0) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Position */ -#define EPWM_EADCPSCNT1_PSCNT4_Msk (0xful << EPWM_EADCPSCNT1_PSCNT4_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT5_Pos (8) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Position */ -#define EPWM_EADCPSCNT1_PSCNT5_Msk (0xful << EPWM_EADCPSCNT1_PSCNT5_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Mask */ - -#define EPWM_CAPINEN_CAPINEN0_Pos (0) /*!< EPWM_T::CAPINEN: CAPINEN0 Position */ -#define EPWM_CAPINEN_CAPINEN0_Msk (0x1ul << EPWM_CAPINEN_CAPINEN0_Pos) /*!< EPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define EPWM_CAPINEN_CAPINEN1_Pos (1) /*!< EPWM_T::CAPINEN: CAPINEN1 Position */ -#define EPWM_CAPINEN_CAPINEN1_Msk (0x1ul << EPWM_CAPINEN_CAPINEN1_Pos) /*!< EPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define EPWM_CAPINEN_CAPINEN2_Pos (2) /*!< EPWM_T::CAPINEN: CAPINEN2 Position */ -#define EPWM_CAPINEN_CAPINEN2_Msk (0x1ul << EPWM_CAPINEN_CAPINEN2_Pos) /*!< EPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define EPWM_CAPINEN_CAPINEN3_Pos (3) /*!< EPWM_T::CAPINEN: CAPINEN3 Position */ -#define EPWM_CAPINEN_CAPINEN3_Msk (0x1ul << EPWM_CAPINEN_CAPINEN3_Pos) /*!< EPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define EPWM_CAPINEN_CAPINEN4_Pos (4) /*!< EPWM_T::CAPINEN: CAPINEN4 Position */ -#define EPWM_CAPINEN_CAPINEN4_Msk (0x1ul << EPWM_CAPINEN_CAPINEN4_Pos) /*!< EPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define EPWM_CAPINEN_CAPINEN5_Pos (5) /*!< EPWM_T::CAPINEN: CAPINEN5 Position */ -#define EPWM_CAPINEN_CAPINEN5_Msk (0x1ul << EPWM_CAPINEN_CAPINEN5_Pos) /*!< EPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define EPWM_CAPCTL_CAPEN0_Pos (0) /*!< EPWM_T::CAPCTL: CAPEN0 Position */ -#define EPWM_CAPCTL_CAPEN0_Msk (0x1ul << EPWM_CAPCTL_CAPEN0_Pos) /*!< EPWM_T::CAPCTL: CAPEN0 Mask */ - -#define EPWM_CAPCTL_CAPEN1_Pos (1) /*!< EPWM_T::CAPCTL: CAPEN1 Position */ -#define EPWM_CAPCTL_CAPEN1_Msk (0x1ul << EPWM_CAPCTL_CAPEN1_Pos) /*!< EPWM_T::CAPCTL: CAPEN1 Mask */ - -#define EPWM_CAPCTL_CAPEN2_Pos (2) /*!< EPWM_T::CAPCTL: CAPEN2 Position */ -#define EPWM_CAPCTL_CAPEN2_Msk (0x1ul << EPWM_CAPCTL_CAPEN2_Pos) /*!< EPWM_T::CAPCTL: CAPEN2 Mask */ - -#define EPWM_CAPCTL_CAPEN3_Pos (3) /*!< EPWM_T::CAPCTL: CAPEN3 Position */ -#define EPWM_CAPCTL_CAPEN3_Msk (0x1ul << EPWM_CAPCTL_CAPEN3_Pos) /*!< EPWM_T::CAPCTL: CAPEN3 Mask */ - -#define EPWM_CAPCTL_CAPEN4_Pos (4) /*!< EPWM_T::CAPCTL: CAPEN4 Position */ -#define EPWM_CAPCTL_CAPEN4_Msk (0x1ul << EPWM_CAPCTL_CAPEN4_Pos) /*!< EPWM_T::CAPCTL: CAPEN4 Mask */ - -#define EPWM_CAPCTL_CAPEN5_Pos (5) /*!< EPWM_T::CAPCTL: CAPEN5 Position */ -#define EPWM_CAPCTL_CAPEN5_Msk (0x1ul << EPWM_CAPCTL_CAPEN5_Pos) /*!< EPWM_T::CAPCTL: CAPEN5 Mask */ - -#define EPWM_CAPCTL_CAPINV0_Pos (8) /*!< EPWM_T::CAPCTL: CAPINV0 Position */ -#define EPWM_CAPCTL_CAPINV0_Msk (0x1ul << EPWM_CAPCTL_CAPINV0_Pos) /*!< EPWM_T::CAPCTL: CAPINV0 Mask */ - -#define EPWM_CAPCTL_CAPINV1_Pos (9) /*!< EPWM_T::CAPCTL: CAPINV1 Position */ -#define EPWM_CAPCTL_CAPINV1_Msk (0x1ul << EPWM_CAPCTL_CAPINV1_Pos) /*!< EPWM_T::CAPCTL: CAPINV1 Mask */ - -#define EPWM_CAPCTL_CAPINV2_Pos (10) /*!< EPWM_T::CAPCTL: CAPINV2 Position */ -#define EPWM_CAPCTL_CAPINV2_Msk (0x1ul << EPWM_CAPCTL_CAPINV2_Pos) /*!< EPWM_T::CAPCTL: CAPINV2 Mask */ - -#define EPWM_CAPCTL_CAPINV3_Pos (11) /*!< EPWM_T::CAPCTL: CAPINV3 Position */ -#define EPWM_CAPCTL_CAPINV3_Msk (0x1ul << EPWM_CAPCTL_CAPINV3_Pos) /*!< EPWM_T::CAPCTL: CAPINV3 Mask */ - -#define EPWM_CAPCTL_CAPINV4_Pos (12) /*!< EPWM_T::CAPCTL: CAPINV4 Position */ -#define EPWM_CAPCTL_CAPINV4_Msk (0x1ul << EPWM_CAPCTL_CAPINV4_Pos) /*!< EPWM_T::CAPCTL: CAPINV4 Mask */ - -#define EPWM_CAPCTL_CAPINV5_Pos (13) /*!< EPWM_T::CAPCTL: CAPINV5 Position */ -#define EPWM_CAPCTL_CAPINV5_Msk (0x1ul << EPWM_CAPCTL_CAPINV5_Pos) /*!< EPWM_T::CAPCTL: CAPINV5 Mask */ - -#define EPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< EPWM_T::CAPCTL: RCRLDEN0 Position */ -#define EPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define EPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< EPWM_T::CAPCTL: RCRLDEN1 Position */ -#define EPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define EPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< EPWM_T::CAPCTL: RCRLDEN2 Position */ -#define EPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define EPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< EPWM_T::CAPCTL: RCRLDEN3 Position */ -#define EPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define EPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< EPWM_T::CAPCTL: RCRLDEN4 Position */ -#define EPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define EPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< EPWM_T::CAPCTL: RCRLDEN5 Position */ -#define EPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define EPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< EPWM_T::CAPCTL: FCRLDEN0 Position */ -#define EPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define EPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< EPWM_T::CAPCTL: FCRLDEN1 Position */ -#define EPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define EPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< EPWM_T::CAPCTL: FCRLDEN2 Position */ -#define EPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define EPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< EPWM_T::CAPCTL: FCRLDEN3 Position */ -#define EPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define EPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< EPWM_T::CAPCTL: FCRLDEN4 Position */ -#define EPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define EPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< EPWM_T::CAPCTL: FCRLDEN5 Position */ -#define EPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define EPWM_CAPSTS_CRLIFOV0_Pos (0) /*!< EPWM_T::CAPSTS: CRLIFOV0 Position */ -#define EPWM_CAPSTS_CRLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV0 Mask */ - -#define EPWM_CAPSTS_CRLIFOV1_Pos (1) /*!< EPWM_T::CAPSTS: CRLIFOV1 Position */ -#define EPWM_CAPSTS_CRLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV1 Mask */ - -#define EPWM_CAPSTS_CRLIFOV2_Pos (2) /*!< EPWM_T::CAPSTS: CRLIFOV2 Position */ -#define EPWM_CAPSTS_CRLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV2 Mask */ - -#define EPWM_CAPSTS_CRLIFOV3_Pos (3) /*!< EPWM_T::CAPSTS: CRLIFOV3 Position */ -#define EPWM_CAPSTS_CRLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV3 Mask */ - -#define EPWM_CAPSTS_CRLIFOV4_Pos (4) /*!< EPWM_T::CAPSTS: CRLIFOV4 Position */ -#define EPWM_CAPSTS_CRLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV4 Mask */ - -#define EPWM_CAPSTS_CRLIFOV5_Pos (5) /*!< EPWM_T::CAPSTS: CRLIFOV5 Position */ -#define EPWM_CAPSTS_CRLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV5 Mask */ - -#define EPWM_CAPSTS_CFLIFOV0_Pos (8) /*!< EPWM_T::CAPSTS: CFLIFOV0 Position */ -#define EPWM_CAPSTS_CFLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV0 Mask */ - -#define EPWM_CAPSTS_CFLIFOV1_Pos (9) /*!< EPWM_T::CAPSTS: CFLIFOV1 Position */ -#define EPWM_CAPSTS_CFLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV1 Mask */ - -#define EPWM_CAPSTS_CFLIFOV2_Pos (10) /*!< EPWM_T::CAPSTS: CFLIFOV2 Position */ -#define EPWM_CAPSTS_CFLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV2 Mask */ - -#define EPWM_CAPSTS_CFLIFOV3_Pos (11) /*!< EPWM_T::CAPSTS: CFLIFOV3 Position */ -#define EPWM_CAPSTS_CFLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV3 Mask */ - -#define EPWM_CAPSTS_CFLIFOV4_Pos (12) /*!< EPWM_T::CAPSTS: CFLIFOV4 Position */ -#define EPWM_CAPSTS_CFLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV4 Mask */ - -#define EPWM_CAPSTS_CFLIFOV5_Pos (13) /*!< EPWM_T::CAPSTS: CFLIFOV5 Position */ -#define EPWM_CAPSTS_CFLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV5 Mask */ - -#define EPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT0: RCAPDAT Position */ -#define EPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT0_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define EPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT0: FCAPDAT Position */ -#define EPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT0_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define EPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT1: RCAPDAT Position */ -#define EPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT1_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define EPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT1: FCAPDAT Position */ -#define EPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT1_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define EPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT2: RCAPDAT Position */ -#define EPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT2_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define EPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT2: FCAPDAT Position */ -#define EPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT2_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define EPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT3: RCAPDAT Position */ -#define EPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT3_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define EPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT3: FCAPDAT Position */ -#define EPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT3_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define EPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT4: RCAPDAT Position */ -#define EPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT4_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define EPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT4: FCAPDAT Position */ -#define EPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT4_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define EPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT5: RCAPDAT Position */ -#define EPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT5_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define EPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT5: FCAPDAT Position */ -#define EPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT5_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define EPWM_PDMACTL_CHEN0_1_Pos (0) /*!< EPWM_T::PDMACTL: CHEN0_1 Position */ -#define EPWM_PDMACTL_CHEN0_1_Msk (0x1ul << EPWM_PDMACTL_CHEN0_1_Pos) /*!< EPWM_T::PDMACTL: CHEN0_1 Mask */ - -#define EPWM_PDMACTL_CAPMOD0_1_Pos (1) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Position */ -#define EPWM_PDMACTL_CAPMOD0_1_Msk (0x3ul << EPWM_PDMACTL_CAPMOD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Mask */ - -#define EPWM_PDMACTL_CAPORD0_1_Pos (3) /*!< EPWM_T::PDMACTL: CAPORD0_1 Position */ -#define EPWM_PDMACTL_CAPORD0_1_Msk (0x1ul << EPWM_PDMACTL_CAPORD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPORD0_1 Mask */ - -#define EPWM_PDMACTL_CHSEL0_1_Pos (4) /*!< EPWM_T::PDMACTL: CHSEL0_1 Position */ -#define EPWM_PDMACTL_CHSEL0_1_Msk (0x1ul << EPWM_PDMACTL_CHSEL0_1_Pos) /*!< EPWM_T::PDMACTL: CHSEL0_1 Mask */ - -#define EPWM_PDMACTL_CHEN2_3_Pos (8) /*!< EPWM_T::PDMACTL: CHEN2_3 Position */ -#define EPWM_PDMACTL_CHEN2_3_Msk (0x1ul << EPWM_PDMACTL_CHEN2_3_Pos) /*!< EPWM_T::PDMACTL: CHEN2_3 Mask */ - -#define EPWM_PDMACTL_CAPMOD2_3_Pos (9) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Position */ -#define EPWM_PDMACTL_CAPMOD2_3_Msk (0x3ul << EPWM_PDMACTL_CAPMOD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Mask */ - -#define EPWM_PDMACTL_CAPORD2_3_Pos (11) /*!< EPWM_T::PDMACTL: CAPORD2_3 Position */ -#define EPWM_PDMACTL_CAPORD2_3_Msk (0x1ul << EPWM_PDMACTL_CAPORD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPORD2_3 Mask */ - -#define EPWM_PDMACTL_CHSEL2_3_Pos (12) /*!< EPWM_T::PDMACTL: CHSEL2_3 Position */ -#define EPWM_PDMACTL_CHSEL2_3_Msk (0x1ul << EPWM_PDMACTL_CHSEL2_3_Pos) /*!< EPWM_T::PDMACTL: CHSEL2_3 Mask */ - -#define EPWM_PDMACTL_CHEN4_5_Pos (16) /*!< EPWM_T::PDMACTL: CHEN4_5 Position */ -#define EPWM_PDMACTL_CHEN4_5_Msk (0x1ul << EPWM_PDMACTL_CHEN4_5_Pos) /*!< EPWM_T::PDMACTL: CHEN4_5 Mask */ - -#define EPWM_PDMACTL_CAPMOD4_5_Pos (17) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Position */ -#define EPWM_PDMACTL_CAPMOD4_5_Msk (0x3ul << EPWM_PDMACTL_CAPMOD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Mask */ - -#define EPWM_PDMACTL_CAPORD4_5_Pos (19) /*!< EPWM_T::PDMACTL: CAPORD4_5 Position */ -#define EPWM_PDMACTL_CAPORD4_5_Msk (0x1ul << EPWM_PDMACTL_CAPORD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPORD4_5 Mask */ - -#define EPWM_PDMACTL_CHSEL4_5_Pos (20) /*!< EPWM_T::PDMACTL: CHSEL4_5 Position */ -#define EPWM_PDMACTL_CHSEL4_5_Msk (0x1ul << EPWM_PDMACTL_CHSEL4_5_Pos) /*!< EPWM_T::PDMACTL: CHSEL4_5 Mask */ - -#define EPWM_PDMACAP0_1_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP0_1: CAPBUF Position */ -#define EPWM_PDMACAP0_1_CAPBUF_Msk (0xfffful << EPWM_PDMACAP0_1_CAPBUF_Pos) /*!< EPWM_T::PDMACAP0_1: CAPBUF Mask */ - -#define EPWM_PDMACAP2_3_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP2_3: CAPBUF Position */ -#define EPWM_PDMACAP2_3_CAPBUF_Msk (0xfffful << EPWM_PDMACAP2_3_CAPBUF_Pos) /*!< EPWM_T::PDMACAP2_3: CAPBUF Mask */ - -#define EPWM_PDMACAP4_5_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP4_5: CAPBUF Position */ -#define EPWM_PDMACAP4_5_CAPBUF_Msk (0xfffful << EPWM_PDMACAP4_5_CAPBUF_Pos) /*!< EPWM_T::PDMACAP4_5: CAPBUF Mask */ - -#define EPWM_CAPIEN_CAPRIEN0_Pos (0) /*!< EPWM_T::CAPIEN: CAPRIEN0 Position */ -#define EPWM_CAPIEN_CAPRIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN0 Mask */ - -#define EPWM_CAPIEN_CAPRIEN1_Pos (1) /*!< EPWM_T::CAPIEN: CAPRIEN1 Position */ -#define EPWM_CAPIEN_CAPRIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN1 Mask */ - -#define EPWM_CAPIEN_CAPRIEN2_Pos (2) /*!< EPWM_T::CAPIEN: CAPRIEN2 Position */ -#define EPWM_CAPIEN_CAPRIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN2 Mask */ - -#define EPWM_CAPIEN_CAPRIEN3_Pos (3) /*!< EPWM_T::CAPIEN: CAPRIEN3 Position */ -#define EPWM_CAPIEN_CAPRIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN3 Mask */ - -#define EPWM_CAPIEN_CAPRIEN4_Pos (4) /*!< EPWM_T::CAPIEN: CAPRIEN4 Position */ -#define EPWM_CAPIEN_CAPRIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN4 Mask */ - -#define EPWM_CAPIEN_CAPRIEN5_Pos (5) /*!< EPWM_T::CAPIEN: CAPRIEN5 Position */ -#define EPWM_CAPIEN_CAPRIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN5 Mask */ - -#define EPWM_CAPIEN_CAPFIEN0_Pos (8) /*!< EPWM_T::CAPIEN: CAPFIEN0 Position */ -#define EPWM_CAPIEN_CAPFIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN0 Mask */ - -#define EPWM_CAPIEN_CAPFIEN1_Pos (9) /*!< EPWM_T::CAPIEN: CAPFIEN1 Position */ -#define EPWM_CAPIEN_CAPFIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN1 Mask */ - -#define EPWM_CAPIEN_CAPFIEN2_Pos (10) /*!< EPWM_T::CAPIEN: CAPFIEN2 Position */ -#define EPWM_CAPIEN_CAPFIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN2 Mask */ - -#define EPWM_CAPIEN_CAPFIEN3_Pos (11) /*!< EPWM_T::CAPIEN: CAPFIEN3 Position */ -#define EPWM_CAPIEN_CAPFIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN3 Mask */ - -#define EPWM_CAPIEN_CAPFIEN4_Pos (12) /*!< EPWM_T::CAPIEN: CAPFIEN4 Position */ -#define EPWM_CAPIEN_CAPFIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN4 Mask */ - -#define EPWM_CAPIEN_CAPFIEN5_Pos (13) /*!< EPWM_T::CAPIEN: CAPFIEN5 Position */ -#define EPWM_CAPIEN_CAPFIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN5 Mask */ - -#define EPWM_CAPIF_CRLIF0_Pos (0) /*!< EPWM_T::CAPIF: CRLIF0 Position */ -#define EPWM_CAPIF_CRLIF0_Msk (0x1ul << EPWM_CAPIF_CRLIF0_Pos) /*!< EPWM_T::CAPIF: CRLIF0 Mask */ - -#define EPWM_CAPIF_CRLIF1_Pos (1) /*!< EPWM_T::CAPIF: CRLIF1 Position */ -#define EPWM_CAPIF_CRLIF1_Msk (0x1ul << EPWM_CAPIF_CRLIF1_Pos) /*!< EPWM_T::CAPIF: CRLIF1 Mask */ - -#define EPWM_CAPIF_CRLIF2_Pos (2) /*!< EPWM_T::CAPIF: CRLIF2 Position */ -#define EPWM_CAPIF_CRLIF2_Msk (0x1ul << EPWM_CAPIF_CRLIF2_Pos) /*!< EPWM_T::CAPIF: CRLIF2 Mask */ - -#define EPWM_CAPIF_CRLIF3_Pos (3) /*!< EPWM_T::CAPIF: CRLIF3 Position */ -#define EPWM_CAPIF_CRLIF3_Msk (0x1ul << EPWM_CAPIF_CRLIF3_Pos) /*!< EPWM_T::CAPIF: CRLIF3 Mask */ - -#define EPWM_CAPIF_CRLIF4_Pos (4) /*!< EPWM_T::CAPIF: CRLIF4 Position */ -#define EPWM_CAPIF_CRLIF4_Msk (0x1ul << EPWM_CAPIF_CRLIF4_Pos) /*!< EPWM_T::CAPIF: CRLIF4 Mask */ - -#define EPWM_CAPIF_CRLIF5_Pos (5) /*!< EPWM_T::CAPIF: CRLIF5 Position */ -#define EPWM_CAPIF_CRLIF5_Msk (0x1ul << EPWM_CAPIF_CRLIF5_Pos) /*!< EPWM_T::CAPIF: CRLIF5 Mask */ - -#define EPWM_CAPIF_CFLIF0_Pos (8) /*!< EPWM_T::CAPIF: CFLIF0 Position */ -#define EPWM_CAPIF_CFLIF0_Msk (0x1ul << EPWM_CAPIF_CFLIF0_Pos) /*!< EPWM_T::CAPIF: CFLIF0 Mask */ - -#define EPWM_CAPIF_CFLIF1_Pos (9) /*!< EPWM_T::CAPIF: CFLIF1 Position */ -#define EPWM_CAPIF_CFLIF1_Msk (0x1ul << EPWM_CAPIF_CFLIF1_Pos) /*!< EPWM_T::CAPIF: CFLIF1 Mask */ - -#define EPWM_CAPIF_CFLIF2_Pos (10) /*!< EPWM_T::CAPIF: CFLIF2 Position */ -#define EPWM_CAPIF_CFLIF2_Msk (0x1ul << EPWM_CAPIF_CFLIF2_Pos) /*!< EPWM_T::CAPIF: CFLIF2 Mask */ - -#define EPWM_CAPIF_CFLIF3_Pos (11) /*!< EPWM_T::CAPIF: CFLIF3 Position */ -#define EPWM_CAPIF_CFLIF3_Msk (0x1ul << EPWM_CAPIF_CFLIF3_Pos) /*!< EPWM_T::CAPIF: CFLIF3 Mask */ - -#define EPWM_CAPIF_CFLIF4_Pos (12) /*!< EPWM_T::CAPIF: CFLIF4 Position */ -#define EPWM_CAPIF_CFLIF4_Msk (0x1ul << EPWM_CAPIF_CFLIF4_Pos) /*!< EPWM_T::CAPIF: CFLIF4 Mask */ - -#define EPWM_CAPIF_CFLIF5_Pos (13) /*!< EPWM_T::CAPIF: CFLIF5 Position */ -#define EPWM_CAPIF_CFLIF5_Msk (0x1ul << EPWM_CAPIF_CFLIF5_Pos) /*!< EPWM_T::CAPIF: CFLIF5 Mask */ - -#define EPWM_PBUF0_PBUF_Pos (0) /*!< EPWM_T::PBUF0: PBUF Position */ -#define EPWM_PBUF0_PBUF_Msk (0xfffful << EPWM_PBUF0_PBUF_Pos) /*!< EPWM_T::PBUF0: PBUF Mask */ - -#define EPWM_PBUF1_PBUF_Pos (0) /*!< EPWM_T::PBUF1: PBUF Position */ -#define EPWM_PBUF1_PBUF_Msk (0xfffful << EPWM_PBUF1_PBUF_Pos) /*!< EPWM_T::PBUF1: PBUF Mask */ - -#define EPWM_PBUF2_PBUF_Pos (0) /*!< EPWM_T::PBUF2: PBUF Position */ -#define EPWM_PBUF2_PBUF_Msk (0xfffful << EPWM_PBUF2_PBUF_Pos) /*!< EPWM_T::PBUF2: PBUF Mask */ - -#define EPWM_PBUF3_PBUF_Pos (0) /*!< EPWM_T::PBUF3: PBUF Position */ -#define EPWM_PBUF3_PBUF_Msk (0xfffful << EPWM_PBUF3_PBUF_Pos) /*!< EPWM_T::PBUF3: PBUF Mask */ - -#define EPWM_PBUF4_PBUF_Pos (0) /*!< EPWM_T::PBUF4: PBUF Position */ -#define EPWM_PBUF4_PBUF_Msk (0xfffful << EPWM_PBUF4_PBUF_Pos) /*!< EPWM_T::PBUF4: PBUF Mask */ - -#define EPWM_PBUF5_PBUF_Pos (0) /*!< EPWM_T::PBUF5: PBUF Position */ -#define EPWM_PBUF5_PBUF_Msk (0xfffful << EPWM_PBUF5_PBUF_Pos) /*!< EPWM_T::PBUF5: PBUF Mask */ - -#define EPWM_CMPBUF0_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF0: CMPBUF Position */ -#define EPWM_CMPBUF0_CMPBUF_Msk (0xfffful << EPWM_CMPBUF0_CMPBUF_Pos) /*!< EPWM_T::CMPBUF0: CMPBUF Mask */ - -#define EPWM_CMPBUF1_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF1: CMPBUF Position */ -#define EPWM_CMPBUF1_CMPBUF_Msk (0xfffful << EPWM_CMPBUF1_CMPBUF_Pos) /*!< EPWM_T::CMPBUF1: CMPBUF Mask */ - -#define EPWM_CMPBUF2_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF2: CMPBUF Position */ -#define EPWM_CMPBUF2_CMPBUF_Msk (0xfffful << EPWM_CMPBUF2_CMPBUF_Pos) /*!< EPWM_T::CMPBUF2: CMPBUF Mask */ - -#define EPWM_CMPBUF3_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF3: CMPBUF Position */ -#define EPWM_CMPBUF3_CMPBUF_Msk (0xfffful << EPWM_CMPBUF3_CMPBUF_Pos) /*!< EPWM_T::CMPBUF3: CMPBUF Mask */ - -#define EPWM_CMPBUF4_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF4: CMPBUF Position */ -#define EPWM_CMPBUF4_CMPBUF_Msk (0xfffful << EPWM_CMPBUF4_CMPBUF_Pos) /*!< EPWM_T::CMPBUF4: CMPBUF Mask */ - -#define EPWM_CMPBUF5_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF5: CMPBUF Position */ -#define EPWM_CMPBUF5_CMPBUF_Msk (0xfffful << EPWM_CMPBUF5_CMPBUF_Pos) /*!< EPWM_T::CMPBUF5: CMPBUF Mask */ - -#define EPWM_CPSCBUF0_1_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF0_1: CPSCBUF Position */ -#define EPWM_CPSCBUF0_1_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF0_1_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF0_1: CPSCBUF Mask */ - -#define EPWM_CPSCBUF2_3_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF2_3: CPSCBUF Position */ -#define EPWM_CPSCBUF2_3_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF2_3_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF2_3: CPSCBUF Mask */ - -#define EPWM_CPSCBUF4_5_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF4_5: CPSCBUF Position */ -#define EPWM_CPSCBUF4_5_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF4_5_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF4_5: CPSCBUF Mask */ - -#define EPWM_FTCBUF0_1_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Position */ -#define EPWM_FTCBUF0_1_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF0_1_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Mask */ - -#define EPWM_FTCBUF2_3_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Position */ -#define EPWM_FTCBUF2_3_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF2_3_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Mask */ - -#define EPWM_FTCBUF4_5_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Position */ -#define EPWM_FTCBUF4_5_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF4_5_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Mask */ - -#define EPWM_FTCI_FTCMU0_Pos (0) /*!< EPWM_T::FTCI: FTCMU0 Position */ -#define EPWM_FTCI_FTCMU0_Msk (0x1ul << EPWM_FTCI_FTCMU0_Pos) /*!< EPWM_T::FTCI: FTCMU0 Mask */ - -#define EPWM_FTCI_FTCMU2_Pos (1) /*!< EPWM_T::FTCI: FTCMU2 Position */ -#define EPWM_FTCI_FTCMU2_Msk (0x1ul << EPWM_FTCI_FTCMU2_Pos) /*!< EPWM_T::FTCI: FTCMU2 Mask */ - -#define EPWM_FTCI_FTCMU4_Pos (2) /*!< EPWM_T::FTCI: FTCMU4 Position */ -#define EPWM_FTCI_FTCMU4_Msk (0x1ul << EPWM_FTCI_FTCMU4_Pos) /*!< EPWM_T::FTCI: FTCMU4 Mask */ - -#define EPWM_FTCI_FTCMD0_Pos (8) /*!< EPWM_T::FTCI: FTCMD0 Position */ -#define EPWM_FTCI_FTCMD0_Msk (0x1ul << EPWM_FTCI_FTCMD0_Pos) /*!< EPWM_T::FTCI: FTCMD0 Mask */ - -#define EPWM_FTCI_FTCMD2_Pos (9) /*!< EPWM_T::FTCI: FTCMD2 Position */ -#define EPWM_FTCI_FTCMD2_Msk (0x1ul << EPWM_FTCI_FTCMD2_Pos) /*!< EPWM_T::FTCI: FTCMD2 Mask */ - -#define EPWM_FTCI_FTCMD4_Pos (10) /*!< EPWM_T::FTCI: FTCMD4 Position */ -#define EPWM_FTCI_FTCMD4_Msk (0x1ul << EPWM_FTCI_FTCMD4_Pos) /*!< EPWM_T::FTCI: FTCMD4 Mask */ - -/**@}*/ /* EPWM_CONST */ -/**@}*/ /* end of EPWM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __EPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/fmc_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/fmc_reg.h deleted file mode 100644 index af50c0bfb39..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/fmc_reg.h +++ /dev/null @@ -1,688 +0,0 @@ -/**************************************************************************//** - * @file fmc_reg.h - * @version V1.00 - * @brief FMC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __FMC_REG_H__ -#define __FMC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup FMC Flash Memory Controller(FMC) - Memory Mapped Structure for FMC Controller -@{ */ - -typedef struct -{ - /** - * @var FMC_T::ISPCTL - * Offset: 0x00 ISP Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPEN |ISP Enable Bit (Write Protect) - * | | |ISP function enable bit. Set this bit to enable ISP function. - * | | |0 = ISP function Disabled. - * | | |1 = ISP function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |BS |Boot Select (Write Protect) - * | | |When MBS in CONFIG0 is 1, set/clear this bit to select next booting from LDROM/APROM, respectively - * | | |This bit also functions as chip booting status flag, which can be used to check where chip booted from - * | | |This bit is initiated with the inversed value of CBS[1] (CONFIG0[7]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened - * | | |0 = Booting from APROM when MBS (CONFIG0[5]) is 1. - * | | |1 = Booting from LDROM when MBS (CONFIG0[5]) is 1. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |SPUEN |SPROM Update Enable Bit (Write Protect) - * | | |0 = SPROM cannot be updated. - * | | |1 = SPROM can be updated. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |APUEN |APROM Update Enable Bit (Write Protect) - * | | |0 = APROM cannot be updated when the chip runs in APROM. - * | | |1 = APROM can be updated when the chip runs in APROM. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |CFGUEN |CONFIG Update Enable Bit (Write Protect) - * | | |0 = CONFIG cannot be updated. - * | | |1 = CONFIG can be updated. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |LDUEN |LDROM Update Enable Bit (Write Protect) - * | | |LDROM update enable bit. - * | | |0 = LDROM cannot be updated. - * | | |1 = LDROM can be updated. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |ISPFF |ISP Fail Flag (Write Protect) - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |This bit needs to be cleared by writing 1 to it. - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0 - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection - * | | |(7) Erase or Program command at brown-out detected - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands - * | | |(10) Vector address is mapping to SPROM region - * | | |(11) KPROM is erased/programmed if KEYLOCK is set to 1 - * | | |(12) APROM(except for Data Flash) is erased/programmed if KEYLOCK is set to 1 - * | | |(13) LDROM is erased/programmed if KEYLOCK is set to 1 - * | | |(14) SPROM is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1. - * | | |(15) CONFIG is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1 - * | | |(16) Invalid operations (except for chip erase) with ICE connection if SBLOCK is not 0x5A - * | | |(17) Read any content of boot loader with ICE connection - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |BL |Boot Loader Booting (Write Protect) - * | | |This bit is initiated with the inversed value of MBS (CONFIG0[5]) - * | | |Any reset, except CPU reset (CPU is 1) or system reset (SYS), BL will be reloaded - * | | |This bit is used to check chip boot from Boot Loader or not - * | | |User should keep original value of this bit when updating FMC_ISPCTL register. - * | | |0 = Booting from APROM or LDROM. - * | | |1 = Booting from Boot Loader. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::ISPADDR - * Offset: 0x04 ISP Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPADDR |ISP Address - * | | |The NuMicro M480 series is equipped with embedded flash - * | | |ISPADDR[1:0] must be kept 00 for ISP 32-bit operation - * | | |ISPADDR[2:0] must be kept 000 for ISP 64-bit operation. - * | | |For CRC32 Checksum Calculation command, this field is the flash starting address for checksum calculation, 4 Kbytes alignment is necessary for CRC32 checksum calculation. - * | | |For FLASH 32-bit Program, ISP address needs word alignment (4-byte) - * | | |For FLASH 64-bit Program, ISP address needs double word alignment (8-byte). - * @var FMC_T::ISPDAT - * Offset: 0x08 ISP Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT |ISP Data - * | | |Write data to this register before ISP program operation. - * | | |Read data from this register after ISP read operation. - * | | |When ISPFF (FMC_ISPCTL[6]) is 1, ISPDAT = 0xffff_ffff - * | | |For Run CRC32 Checksum Calculation command, ISPDAT is the memory size (byte) and 4 Kbytes alignment - * | | |For ISP Read CRC32 Checksum command, ISPDAT is the checksum result - * | | |If ISPDAT = 0x0000_0000, it means that (1) the checksum calculation is in progress, or (2) the memory range for checksum calculation is incorrect - * @var FMC_T::ISPCMD - * Offset: 0x0C ISP Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |CMD |ISP Command - * | | |ISP command table is shown below: - * | | |0x00= FLASH Read. - * | | |0x04= Read Unique ID. - * | | |0x08= Read Flash All-One Result. - * | | |0x0B= Read Company ID. - * | | |0x0C= Read Device ID. - * | | |0x0D= Read Checksum. - * | | |0x21= FLASH 32-bit Program. - * | | |0x22= FLASH Page Erase. Erase any page in two banks, except for OTP. - * | | |0x23= FLASH Bank Erase. Erase all pages of APROM in BANK0 or BANK1. - * | | |0x25= FLASH Block Erase. Erase four pages alignment of APROM in BANK0 or BANK1.. - * | | |0x27= FLASH Multi-Word Program. - * | | |0x28= Run Flash All-One Verification. - * | | |0x2D= Run Checksum Calculation. - * | | |0x2E= Vector Remap. - * | | |0x40= FLASH 64-bit Read. - * | | |0x61= FLASH 64-bit Program. - * | | |The other commands are invalid. - * @var FMC_T::ISPTRG - * Offset: 0x10 ISP Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPGO |ISP Start Trigger (Write Protect) - * | | |Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP operation is finished. - * | | |0 = ISP operation is finished. - * | | |1 = ISP is progressed. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::DFBA - * Offset: 0x14 Data Flash Base Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DFBA |Data Flash Base Address - * | | |This register indicates Data Flash start address. It is a read only register. - * | | |The Data Flash is shared with APROM. the content of this register is loaded from CONFIG1 - * | | |This register is valid when DFEN (CONFIG0[0]) =0 . - * @var FMC_T::ISPSTS - * Offset: 0x40 ISP Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ISPBUSY |ISP Busy Flag (Read Only) - * | | |Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP operation is finished. - * | | |This bit is the mirror of ISPGO(FMC_ISPTRG[0]). - * | | |0 = ISP operation is finished. - * | | |1 = ISP is progressed. - * |[2:1] |CBS |Boot Selection of CONFIG (Read Only) - * | | |This bit is initiated with the CBS (CONFIG0[7:6]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened. - * | | |The following function is valid when MBS (FMC_ISPSTS[3])= 1. - * | | |00 = LDROM with IAP mode. - * | | |01 = LDROM without IAP mode. - * | | |10 = APROM with IAP mode. - * | | |11 = APROM without IAP mode. - * |[3] |MBS |Boot From Boot Loader Selection Flag (Read Only) - * | | |This bit is initiated with the MBS (CONFIG0[5]) after any reset is happened except CPU reset (CPU is 1) or system reset (SYS) is happened - * | | |0 = Booting from Boot Loader. - * | | |1 = Booting from LDROM/APROM.(.see CBS bit setting) - * |[4] |FCYCDIS |Flash Access Cycle Auto-tuning Disabled Flag (Read Only) - * | | |This bit is set if flash access cycle auto-tuning function is disabled - * | | |The auto-tunning function is disabled by FADIS(FMC_CYCCTL[8]) or HIRC clock is not ready. - * | | |0 = Flash access cycle auto-tuning is enabled. - * | | |1 = Flash access cycle auto-tuning is disabled. - * |[5] |PGFF |Flash Program with Fast Verification Flag (Read Only) - * | | |This bit is set if data is mismatched at ISP programming verification - * | | |This bit is clear by performing ISP flash erase or ISP read CID operation - * | | |0 = Flash Program is success. - * | | |1 = Flash Program is fail. Program data is different with data in the flash memory - * |[6] |ISPFF |ISP Fail Flag (Write Protect) - * | | |This bit is the mirror of ISPFF (FMC_ISPCTL[6]), it needs to be cleared by writing 1 to FMC_ISPCTL[6] or FMC_ISPSTS[6] - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0 - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection - * | | |(7) Erase or Program command at brown-out detected - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands - * | | |(10) Vector address is mapping to SPROM region. - * | | |(11) KPROM is erased/programmed if KEYLOCK is set to 1 - * | | |(12) APROM(except for Data Flash) is erased/programmed if KEYLOCK is set to 1 - * | | |(13) LDROM is erased/programmed if KEYLOCK is set to 1 - * | | |(14) SPROM is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1. - * | | |(15) CONFIG is erased/programmed if KEYLOCK is set to 1 and KEYENROM[1:0] are 1. - * | | |(16) Invalid operations (except for chip erase) with ICE connection if SBLOCK is not 0x5A - * | | |(17) Read any content of boot loader with ICE connection - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |ALLONE |Flash All-one Verification Flag - * | | |This bit is set by hardware if all of flash bits are 1, and clear if flash bits are not all 1 after "Run Flash All-One Verification" complete; this bit also can be clear by writing 1 - * | | |0 = All of flash bits are 1 after "Run Flash All-One Verification" complete. - * | | |1 = Flash bits are not all 1 after "Run Flash All-One Verification" complete. - * |[23:9] |VECMAP |Vector Page Mapping Address (Read Only) - * | | |All access to 0x0000_0000~0x0000_01FF is remapped to the flash memory address {VECMAP[14:0], 9u2019h000} ~ {VECMAP[14:0], 9u2019h1FF} - * |[31] |SCODE |Security Code Active Flag - * | | |This bit is set by hardware when detecting SPROM secured code is active at flash initiation, or software writes 1 to this bit to make secured code active; this bit is clear by SPROM page erase operation. - * | | |0 = Secured code is inactive. - * | | |1 = Secured code is active. - * @var FMC_T::CYCCTL - * Offset: 0x4C Flash Access Cycle Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CYCLE |Flash Access Cycle Control (Write Protect) - * | | |0001 = CPU access with one wait cycle if cache miss; flash access cycle is 1;. - * | | |The HCLK working frequency range range is<27MHz - * | | |0010 = CPU access with two wait cycles if cache miss; flash access cycle is 2;. - * | | | The optimized HCLK working frequency range is 27~54 MHz - * | | |0011 = CPU access with three wait cycles if cache miss; flash access cycle is 3;. - * | | |The optimized HCLK working frequency range is 54~81MHz - * | | |0100 = CPU access with four wait cycles if cache miss; flash access cycle is 4;. - * | | | The optimized HCLK working frequency range is81~108MHz - * | | |0101 = CPU access with five wait cycles if cache miss; flash access cycle is 5;. - * | | |The optimized HCLK working frequency range is 108~135MHz - * | | |0110 = CPU access with six wait cycles if cache miss; flash access cycle is 6;. - * | | | The optimized HCLK working frequency range is 135~162MHz - * | | |0111 = CPU access with seven wait cycles if cache miss; flash access cycle is 7;. - * | | | The optimized HCLK working frequency range is 162~192MHz - * | | |1000 = CPU access with eight wait cycles if cache miss; flash access cycle is 8;. - * | | |The optimized HCLK working frequency range is >192MHz - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::KPKEY0 - * Offset: 0x50 KPROM KEY0 Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KPKEY0 |KPROM KEY0 Data (Write Only) - * | | |Write KPKEY0 data to this register before KEY Comparison operation. - * @var FMC_T::KPKEY1 - * Offset: 0x54 KPROM KEY1 Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KPKEY1 |KPROM KEY1 Data (Write Only) - * | | |Write KPKEY1 data to this register before KEY Comparison operation. - * @var FMC_T::KPKEY2 - * Offset: 0x58 KPROM KEY2 Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KPKEY2 |KPROM KEY2 Data (Write Only) - * | | |Write KPKEY2 data to this register before KEY Comparison operation. - * @var FMC_T::KPKEYTRG - * Offset: 0x5C KPROM KEY Comparison Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KPKEYGO |KPROM KEY Comparison Start Trigger (Write Protection) - * | | |Write 1 to start KEY comparison operation and this bit will be cleared to 0 by hardware automatically when KEY comparison operation is finished - * | | |This trigger operation is valid while FORBID (FMC_KPKEYSTS [3]) is 0. - * | | |0 = KEY comparison operation is finished. - * | | |1 = KEY comparison is progressed. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * |[1] |TCEN |Timeout Counting Enable (Write Protection) - * | | |0 = Timeout counting is disabled. - * | | |1 = Timeout counting is enabled if input key is matched after key comparison finish. - * | | |10 minutes is at least for timeout, and average is about 20 minutes. - * | | |Note: This bit is write-protected. Refer to the SYS_REGLCTL register. - * @var FMC_T::KPKEYSTS - * Offset: 0x60 KPROM KEY Comparison Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KEYBUSY |KEY Comparison Busy (Read Only) - * | | |0 = KEY comparison is finished. - * | | |1 = KEY comparison is busy. - * |[1] |KEYLOCK |KEY LOCK Flag - * | | |This bit is set to 1 if KEYMATCH (FMC_KPKEYSTS [2]) is 0 and cleared to 0 if KEYMATCH is 1 in Security Key protection - * | | |After Mass Erase operation, users must reset or power on /off to clear this bit to 0 - * | | |This bit also can be set to 1 while - * | | | - CPU write 1 to KEYLOCK(FMC_KPKEYSTS[1]) or - * | | | - KEYFLAG(FMC_KPKEYSTS[4]) is 1 at power-on or reset or - * | | | - KEYENROM is programmed a non-0xFF value or - * | | | - Timeout event or - * | | | - FORBID(FMC_KPKEYSTS[3]) is 1 - * | | |0 = KPROM, LDROM and APROM (not include Data Flash) is not in write protection. - * | | |1 = KPROM, LDROM and APROM (not include Data Flash) is in write protection. - * | | |SPROM write protect is depended on SPFLAG. - * | | |CONFIG write protect is depended on CFGFLAG - * |[2] |KEYMATCH |KEY Match Flag (Read Only) - * | | |This bit is set to 1 after KEY comparison complete if the KEY0, KEY1 and KEY2 are matched with the 96-bit security keys in KPROM; and cleared to 0 if KEYs are unmatched - * | | |This bit is also cleared to 0 while - * | | | - CPU writing 1 to KEYLOCK(FMC_KPKEYSTS[1]) or - * | | | - Timeout event or - * | | | - KPROM is erased or - * | | | - KEYENROM is programmed to a non-0xFF value. - * | | | - Chip is in power down mode. - * | | |0 = KEY0, KEY1, and KEY2 are unmatched with the KPROM setting. - * | | |1 = KEY0, KEY1, and KEY2 are matched with the KPROM setting. - * |[3] |FORBID |KEY Comparison Forbidden Flag (Read Only) - * | | |This bit is set to 1 when KPKECNT(FMC_KPKEY0[4:0]) is more than KPKEMAX (FMC_KPKEY0[12:8]) or KPCNT (FMC_KPCNT [2:0]) is more than KPMAX (FMC_KPCNT [10:8]). - * | | |0 = KEY comparison is not forbidden. - * | | |1 = KEY comparison is forbidden, KEYGO (FMC_KEYTRG [0]) cannot trigger. - * |[4] |KEYFLAG |KEY Protection Enabled Flag (Read Only) - * | | |This bit is set while the KEYENROM [7:0] is not 0xFF at power-on or reset - * | | |This bit is cleared to 0 by hardware while KPROM is erased - * | | |This bit is set to 1 by hardware while KEYENROM is programmed to a non-0xFF value. - * | | |0 = Security Key protection is disabled. - * | | |1 = Security Key protection is enabled. - * |[5] |CFGFLAG |CONFIG Write-protection Enabled Flag (Read Only) - * | | |This bit is set while the KEYENROM [0] is 0 at power-on or reset - * | | |This bit is cleared to 0 by hardware while KPROM is erased - * | | |This bit is set to 1 by hardware while KEYENROM[0] is programmed to 0. - * | | |0 = CONFIG write-protection is disabled. - * | | |1 = CONFIG write-protection is enabled. - * |[6] |SPFLAG |SPROM Write-protection Enabled Flag (Read Only) - * | | |This bit is set while the KEYENROM [1] is 0 at power-on or reset - * | | |This bit is cleared to 0 by hardware while KPROM is erased - * | | |This bit is set to 1 by hardware while KEYENROM[1] is programmed to 0. - * | | |0 = SPROM write-protection is disabled. - * | | |1 = SPROM write-protection is enabled. - * @var FMC_T::KPKEYCNT - * Offset: 0x64 KPROM KEY-Unmatched Counting Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |KPKECNT |Error Key Entry Counter at Each Power-on (Read Only) - * | | |KPKECNT is increased when entry keys is wrong in Security Key protection - * | | |KPKECNT is cleared to 0 if key comparison is matched or system power-on. - * |[13:8] |KPKEMAX |Maximum Number for Error Key Entry at Each Power-on (Read Only) - * | | |KPKEMAX is the maximum error key entry number at each power-on - * | | |When KPKEMAXROM of KPROM is erased or programmed, KPKEMAX will also be updated - * | | |KPKEMAX is used to limit KPKECNT(FMC_KPKEY0[5:0]) maximum counting - * | | |The FORBID (FMC_KPKEYSTS [3]) will be set to 1 when KPKECNT is more than KPKEMAX. - * @var FMC_T::KPCNT - * Offset: 0x68 KPROM KEY-Unmatched Power-On Counting Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |KPCNT |Power-on Counter for Error Key Entry(Read Only) - * | | |KPCNT is the power-on counting for error key entry in Security Key protection - * | | |KPCNT is cleared to 0 if key comparison is matched. - * |[11:8] |KPMAX |Power-on Maximum Number for Error Key Entry (Read Only) - * | | |KPMAX is the power-on maximum number for error key entry - * | | |When KPMAXROM of KPROM is erased or programmed, KPMAX will also be updated - * | | |KPMAX is used to limit KPCNT (FMC_KPCNT [3:0]) maximum counting - * | | |The FORBID(FMC_KPKEYSTS[3]) will be set to 1 when KPCNT is more than KPMAX - * @var FMC_T::MPDAT0 - * Offset: 0x80 ISP Data0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT0 |ISP Data 0 - * | | |This register is the first 32-bit data for 32-bit/64-bit/multi-word programming, and it is also the mirror of FMC_ISPDAT, both registers keep the same data - * @var FMC_T::MPDAT1 - * Offset: 0x84 ISP Data1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT1 |ISP Data 1 - * | | |This register is the second 32-bit data for 64-bit/multi-word programming. - * @var FMC_T::MPDAT2 - * Offset: 0x88 ISP Data2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT2 |ISP Data 2 - * | | |This register is the third 32-bit data for multi-word programming. - * @var FMC_T::MPDAT3 - * Offset: 0x8C ISP Data3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ISPDAT3 |ISP Data 3 - * | | |This register is the fourth 32-bit data for multi-word programming. - * @var FMC_T::MPSTS - * Offset: 0xC0 ISP Multi-Program Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MPBUSY |ISP Multi-word Program Busy Flag (Read Only) - * | | |Write 1 to start ISP Multi-Word program operation and this bit will be cleared to 0 by hardware automatically when ISP Multi-Word program operation is finished. - * | | |This bit is the mirror of ISPGO(FMC_ISPTRG[0]). - * | | |0 = ISP Multi-Word program operation is finished. - * | | |1 = ISP Multi-Word program operation is progressed. - * |[1] |PPGO |ISP Multi-program Status (Read Only) - * | | |0 = ISP multi-word program operation is not active. - * | | |1 = ISP multi-word program operation is in progress. - * |[2] |ISPFF |ISP Fail Flag (Read Only) - * | | |This bit is the mirror of ISPFF (FMC_ISPCTL[6]), it needs to be cleared by writing 1 to FMC_ISPCTL[6] or FMC_ISPSTS[6] - * | | |This bit is set by hardware when a triggered ISP meets any of the following conditions: - * | | |(1) APROM writes to itself if APUEN is set to 0. - * | | |(2) LDROM writes to itself if LDUEN is set to 0. - * | | |(3) CONFIG is erased/programmed if CFGUEN is set to 0. - * | | |(4) SPROM is erased/programmed if SPUEN is set to 0 - * | | |(5) SPROM is programmed at SPROM secured mode. - * | | |(6) Page Erase command at LOCK mode with ICE connection - * | | |(7) Erase or Program command at brown-out detected - * | | |(8) Destination address is illegal, such as over an available range. - * | | |(9) Invalid ISP commands - * | | |(10) Vector address is mapping to SPROM region. - * |[4] |D0 |ISP DATA 0 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT0 is written and auto-clear to 0 when the FMC_MPDAT0 data is programmed to flash complete. - * | | |0 = FMC_MPDAT0 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT0 register has been written, and not program to flash complete. - * |[5] |D1 |ISP DATA 1 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT1 is written and auto-clear to 0 when the FMC_MPDAT1 data is programmed to flash complete. - * | | |0 = FMC_MPDAT1 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT1 register has been written, and not program to flash complete. - * |[6] |D2 |ISP DATA 2 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT2 is written and auto-clear to 0 when the FMC_MPDAT2 data is programmed to flash complete. - * | | |0 = FMC_MPDAT2 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT2 register has been written, and not program to flash complete. - * |[7] |D3 |ISP DATA 3 Flag (Read Only) - * | | |This bit is set when FMC_MPDAT3 is written and auto-clear to 0 when the FMC_MPDAT3 data is programmed to flash complete. - * | | |0 = FMC_MPDAT3 register is empty, or program to flash complete. - * | | |1 = FMC_MPDAT3 register has been written, and not program to flash complete. - * @var FMC_T::MPADDR - * Offset: 0xC4 ISP Multi-Program Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MPADDR |ISP Multi-word Program Address - * | | |MPADDR is the address of ISP multi-word program operation when ISPGO flag is 1. - * | | |MPADDR will keep the final ISP address when ISP multi-word program is complete. - */ - __IO uint32_t ISPCTL; /*!< [0x0000] ISP Control Register */ - __IO uint32_t ISPADDR; /*!< [0x0004] ISP Address Register */ - __IO uint32_t ISPDAT; /*!< [0x0008] ISP Data Register */ - __IO uint32_t ISPCMD; /*!< [0x000c] ISP Command Register */ - __IO uint32_t ISPTRG; /*!< [0x0010] ISP Trigger Control Register */ - __I uint32_t DFBA; /*!< [0x0014] Data Flash Base Address */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[10]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ISPSTS; /*!< [0x0040] ISP Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CYCCTL; /*!< [0x004c] Flash Access Cycle Control Register */ - __O uint32_t KPKEY0; /*!< [0x0050] KPROM KEY0 Data Register */ - __O uint32_t KPKEY1; /*!< [0x0054] KPROM KEY1 Data Register */ - __O uint32_t KPKEY2; /*!< [0x0058] KPROM KEY2 Data Register */ - __IO uint32_t KPKEYTRG; /*!< [0x005c] KPROM KEY Comparison Trigger Control Register */ - __IO uint32_t KPKEYSTS; /*!< [0x0060] KPROM KEY Comparison Status Register */ - __I uint32_t KPKEYCNT; /*!< [0x0064] KPROM KEY-Unmatched Counting Register */ - __I uint32_t KPCNT; /*!< [0x0068] KPROM KEY-Unmatched Power-On Counting Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t MPDAT0; /*!< [0x0080] ISP Data0 Register */ - __IO uint32_t MPDAT1; /*!< [0x0084] ISP Data1 Register */ - __IO uint32_t MPDAT2; /*!< [0x0088] ISP Data2 Register */ - __IO uint32_t MPDAT3; /*!< [0x008c] ISP Data3 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[12]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t MPSTS; /*!< [0x00c0] ISP Multi-Program Status Register */ - __I uint32_t MPADDR; /*!< [0x00c4] ISP Multi-Program Address Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[2]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t XOMR0STS; /*!< [0x00d0] XOM Region 0 Status Register */ - __I uint32_t XOMR1STS; /*!< [0x00d4] XOM Region 1 Status Register */ - __I uint32_t XOMR2STS; /*!< [0x00d8] XOM Region 2 Status Register */ - __I uint32_t XOMR3STS; /*!< [0x00dc] XOM Region 3 Status Register */ - __I uint32_t XOMSTS; /*!< [0x00e0] XOM Status Register */ - -} FMC_T; - -/** - @addtogroup FMC_CONST FMC Bit Field Definition - Constant Definitions for FMC Controller -@{ */ - -#define FMC_ISPCTL_ISPEN_Pos (0) /*!< FMC_T::ISPCTL: ISPEN Position */ -#define FMC_ISPCTL_ISPEN_Msk (0x1ul << FMC_ISPCTL_ISPEN_Pos) /*!< FMC_T::ISPCTL: ISPEN Mask */ - -#define FMC_ISPCTL_BS_Pos (1) /*!< FMC_T::ISPCTL: BS Position */ -#define FMC_ISPCTL_BS_Msk (0x1ul << FMC_ISPCTL_BS_Pos) /*!< FMC_T::ISPCTL: BS Mask */ - -#define FMC_ISPCTL_SPUEN_Pos (2) /*!< FMC_T::ISPCTL: SPUEN Position */ -#define FMC_ISPCTL_SPUEN_Msk (0x1ul << FMC_ISPCTL_SPUEN_Pos) /*!< FMC_T::ISPCTL: SPUEN Mask */ - -#define FMC_ISPCTL_APUEN_Pos (3) /*!< FMC_T::ISPCTL: APUEN Position */ -#define FMC_ISPCTL_APUEN_Msk (0x1ul << FMC_ISPCTL_APUEN_Pos) /*!< FMC_T::ISPCTL: APUEN Mask */ - -#define FMC_ISPCTL_CFGUEN_Pos (4) /*!< FMC_T::ISPCTL: CFGUEN Position */ -#define FMC_ISPCTL_CFGUEN_Msk (0x1ul << FMC_ISPCTL_CFGUEN_Pos) /*!< FMC_T::ISPCTL: CFGUEN Mask */ - -#define FMC_ISPCTL_LDUEN_Pos (5) /*!< FMC_T::ISPCTL: LDUEN Position */ -#define FMC_ISPCTL_LDUEN_Msk (0x1ul << FMC_ISPCTL_LDUEN_Pos) /*!< FMC_T::ISPCTL: LDUEN Mask */ - -#define FMC_ISPCTL_ISPFF_Pos (6) /*!< FMC_T::ISPCTL: ISPFF Position */ -#define FMC_ISPCTL_ISPFF_Msk (0x1ul << FMC_ISPCTL_ISPFF_Pos) /*!< FMC_T::ISPCTL: ISPFF Mask */ - -#define FMC_ISPCTL_BL_Pos (16) /*!< FMC_T::ISPCTL: BL Position */ -#define FMC_ISPCTL_BL_Msk (0x1ul << FMC_ISPCTL_BL_Pos) /*!< FMC_T::ISPCTL: BL Mask */ - -#define FMC_ISPADDR_ISPADDR_Pos (0) /*!< FMC_T::ISPADDR: ISPADDR Position */ -#define FMC_ISPADDR_ISPADDR_Msk (0xfffffffful << FMC_ISPADDR_ISPADDR_Pos) /*!< FMC_T::ISPADDR: ISPADDR Mask */ - -#define FMC_ISPDAT_ISPDAT_Pos (0) /*!< FMC_T::ISPDAT: ISPDAT Position */ -#define FMC_ISPDAT_ISPDAT_Msk (0xfffffffful << FMC_ISPDAT_ISPDAT_Pos) /*!< FMC_T::ISPDAT: ISPDAT Mask */ - -#define FMC_ISPCMD_CMD_Pos (0) /*!< FMC_T::ISPCMD: CMD Position */ -#define FMC_ISPCMD_CMD_Msk (0x7ful << FMC_ISPCMD_CMD_Pos) /*!< FMC_T::ISPCMD: CMD Mask */ - -#define FMC_ISPTRG_ISPGO_Pos (0) /*!< FMC_T::ISPTRG: ISPGO Position */ -#define FMC_ISPTRG_ISPGO_Msk (0x1ul << FMC_ISPTRG_ISPGO_Pos) /*!< FMC_T::ISPTRG: ISPGO Mask */ - -#define FMC_DFBA_DFBA_Pos (0) /*!< FMC_T::DFBA: DFBA Position */ -#define FMC_DFBA_DFBA_Msk (0xfffffffful << FMC_DFBA_DFBA_Pos) /*!< FMC_T::DFBA: DFBA Mask */ - -#define FMC_ISPSTS_ISPBUSY_Pos (0) /*!< FMC_T::ISPSTS: ISPBUSY Position */ -#define FMC_ISPSTS_ISPBUSY_Msk (0x1ul << FMC_ISPSTS_ISPBUSY_Pos) /*!< FMC_T::ISPSTS: ISPBUSY Mask */ - -#define FMC_ISPSTS_CBS_Pos (1) /*!< FMC_T::ISPSTS: CBS Position */ -#define FMC_ISPSTS_CBS_Msk (0x3ul << FMC_ISPSTS_CBS_Pos) /*!< FMC_T::ISPSTS: CBS Mask */ - -#define FMC_ISPSTS_MBS_Pos (3) /*!< FMC_T::ISPSTS: MBS Position */ -#define FMC_ISPSTS_MBS_Msk (0x1ul << FMC_ISPSTS_MBS_Pos) /*!< FMC_T::ISPSTS: MBS Mask */ - -#define FMC_ISPSTS_FCYCDIS_Pos (4) /*!< FMC_T::ISPSTS: FCYCDIS Position */ -#define FMC_ISPSTS_FCYCDIS_Msk (0x1ul << FMC_ISPSTS_FCYCDIS_Pos) /*!< FMC_T::ISPSTS: FCYCDIS Mask */ - -#define FMC_ISPSTS_PGFF_Pos (5) /*!< FMC_T::ISPSTS: PGFF Position */ -#define FMC_ISPSTS_PGFF_Msk (0x1ul << FMC_ISPSTS_PGFF_Pos) /*!< FMC_T::ISPSTS: PGFF Mask */ - -#define FMC_ISPSTS_ISPFF_Pos (6) /*!< FMC_T::ISPSTS: ISPFF Position */ -#define FMC_ISPSTS_ISPFF_Msk (0x1ul << FMC_ISPSTS_ISPFF_Pos) /*!< FMC_T::ISPSTS: ISPFF Mask */ - -#define FMC_ISPSTS_ALLONE_Pos (7) /*!< FMC_T::ISPSTS: ALLONE Position */ -#define FMC_ISPSTS_ALLONE_Msk (0x1ul << FMC_ISPSTS_ALLONE_Pos) /*!< FMC_T::ISPSTS: ALLONE Mask */ - -#define FMC_ISPSTS_VECMAP_Pos (9) /*!< FMC_T::ISPSTS: VECMAP Position */ -#define FMC_ISPSTS_VECMAP_Msk (0x7ffful << FMC_ISPSTS_VECMAP_Pos) /*!< FMC_T::ISPSTS: VECMAP Mask */ - -#define FMC_ISPSTS_SCODE_Pos (31) /*!< FMC_T::ISPSTS: SCODE Position */ -#define FMC_ISPSTS_SCODE_Msk (0x1ul << FMC_ISPSTS_SCODE_Pos) /*!< FMC_T::ISPSTS: SCODE Mask */ - -#define FMC_CYCCTL_CYCLE_Pos (0) /*!< FMC_T::CYCCTL: CYCLE Position */ -#define FMC_CYCCTL_CYCLE_Msk (0xful << FMC_CYCCTL_CYCLE_Pos) /*!< FMC_T::CYCCTL: CYCLE Mask */ - -#define FMC_KPKEY0_KPKEY0_Pos (0) /*!< FMC_T::KPKEY0: KPKEY0 Position */ -#define FMC_KPKEY0_KPKEY0_Msk (0xfffffffful << FMC_KPKEY0_KPKEY0_Pos) /*!< FMC_T::KPKEY0: KPKEY0 Mask */ - -#define FMC_KPKEY1_KPKEY1_Pos (0) /*!< FMC_T::KPKEY1: KPKEY1 Position */ -#define FMC_KPKEY1_KPKEY1_Msk (0xfffffffful << FMC_KPKEY1_KPKEY1_Pos) /*!< FMC_T::KPKEY1: KPKEY1 Mask */ - -#define FMC_KPKEY2_KPKEY2_Pos (0) /*!< FMC_T::KPKEY2: KPKEY2 Position */ -#define FMC_KPKEY2_KPKEY2_Msk (0xfffffffful << FMC_KPKEY2_KPKEY2_Pos) /*!< FMC_T::KPKEY2: KPKEY2 Mask */ - -#define FMC_KPKEYTRG_KPKEYGO_Pos (0) /*!< FMC_T::KPKEYTRG: KPKEYGO Position */ -#define FMC_KPKEYTRG_KPKEYGO_Msk (0x1ul << FMC_KPKEYTRG_KPKEYGO_Pos) /*!< FMC_T::KPKEYTRG: KPKEYGO Mask */ - -#define FMC_KPKEYTRG_TCEN_Pos (1) /*!< FMC_T::KPKEYTRG: TCEN Position */ -#define FMC_KPKEYTRG_TCEN_Msk (0x1ul << FMC_KPKEYTRG_TCEN_Pos) /*!< FMC_T::KPKEYTRG: TCEN Mask */ - -#define FMC_KPKEYSTS_KEYBUSY_Pos (0) /*!< FMC_T::KPKEYSTS: KEYBUSY Position */ -#define FMC_KPKEYSTS_KEYBUSY_Msk (0x1ul << FMC_KPKEYSTS_KEYBUSY_Pos) /*!< FMC_T::KPKEYSTS: KEYBUSY Mask */ - -#define FMC_KPKEYSTS_KEYLOCK_Pos (1) /*!< FMC_T::KPKEYSTS: KEYLOCK Position */ -#define FMC_KPKEYSTS_KEYLOCK_Msk (0x1ul << FMC_KPKEYSTS_KEYLOCK_Pos) /*!< FMC_T::KPKEYSTS: KEYLOCK Mask */ - -#define FMC_KPKEYSTS_KEYMATCH_Pos (2) /*!< FMC_T::KPKEYSTS: KEYMATCH Position */ -#define FMC_KPKEYSTS_KEYMATCH_Msk (0x1ul << FMC_KPKEYSTS_KEYMATCH_Pos) /*!< FMC_T::KPKEYSTS: KEYMATCH Mask */ - -#define FMC_KPKEYSTS_FORBID_Pos (3) /*!< FMC_T::KPKEYSTS: FORBID Position */ -#define FMC_KPKEYSTS_FORBID_Msk (0x1ul << FMC_KPKEYSTS_FORBID_Pos) /*!< FMC_T::KPKEYSTS: FORBID Mask */ - -#define FMC_KPKEYSTS_KEYFLAG_Pos (4) /*!< FMC_T::KPKEYSTS: KEYFLAG Position */ -#define FMC_KPKEYSTS_KEYFLAG_Msk (0x1ul << FMC_KPKEYSTS_KEYFLAG_Pos) /*!< FMC_T::KPKEYSTS: KEYFLAG Mask */ - -#define FMC_KPKEYSTS_CFGFLAG_Pos (5) /*!< FMC_T::KPKEYSTS: CFGFLAG Position */ -#define FMC_KPKEYSTS_CFGFLAG_Msk (0x1ul << FMC_KPKEYSTS_CFGFLAG_Pos) /*!< FMC_T::KPKEYSTS: CFGFLAG Mask */ - -#define FMC_KPKEYSTS_SPFLAG_Pos (6) /*!< FMC_T::KPKEYSTS: SPFLAG Position */ -#define FMC_KPKEYSTS_SPFLAG_Msk (0x1ul << FMC_KPKEYSTS_SPFLAG_Pos) /*!< FMC_T::KPKEYSTS: SPFLAG Mask */ - -#define FMC_KPKEYCNT_KPKECNT_Pos (0) /*!< FMC_T::KPKEYCNT: KPKECNT Position */ -#define FMC_KPKEYCNT_KPKECNT_Msk (0x3ful << FMC_KPKEYCNT_KPKECNT_Pos) /*!< FMC_T::KPKEYCNT: KPKECNT Mask */ - -#define FMC_KPKEYCNT_KPKEMAX_Pos (8) /*!< FMC_T::KPKEYCNT: KPKEMAX Position */ -#define FMC_KPKEYCNT_KPKEMAX_Msk (0x3ful << FMC_KPKEYCNT_KPKEMAX_Pos) /*!< FMC_T::KPKEYCNT: KPKEMAX Mask */ - -#define FMC_KPCNT_KPCNT_Pos (0) /*!< FMC_T::KPCNT: KPCNT Position */ -#define FMC_KPCNT_KPCNT_Msk (0xful << FMC_KPCNT_KPCNT_Pos) /*!< FMC_T::KPCNT: KPCNT Mask */ - -#define FMC_KPCNT_KPMAX_Pos (8) /*!< FMC_T::KPCNT: KPMAX Position */ -#define FMC_KPCNT_KPMAX_Msk (0xful << FMC_KPCNT_KPMAX_Pos) /*!< FMC_T::KPCNT: KPMAX Mask */ - -#define FMC_MPDAT0_ISPDAT0_Pos (0) /*!< FMC_T::MPDAT0: ISPDAT0 Position */ -#define FMC_MPDAT0_ISPDAT0_Msk (0xfffffffful << FMC_MPDAT0_ISPDAT0_Pos) /*!< FMC_T::MPDAT0: ISPDAT0 Mask */ - -#define FMC_MPDAT1_ISPDAT1_Pos (0) /*!< FMC_T::MPDAT1: ISPDAT1 Position */ -#define FMC_MPDAT1_ISPDAT1_Msk (0xfffffffful << FMC_MPDAT1_ISPDAT1_Pos) /*!< FMC_T::MPDAT1: ISPDAT1 Mask */ - -#define FMC_MPDAT2_ISPDAT2_Pos (0) /*!< FMC_T::MPDAT2: ISPDAT2 Position */ -#define FMC_MPDAT2_ISPDAT2_Msk (0xfffffffful << FMC_MPDAT2_ISPDAT2_Pos) /*!< FMC_T::MPDAT2: ISPDAT2 Mask */ - -#define FMC_MPDAT3_ISPDAT3_Pos (0) /*!< FMC_T::MPDAT3: ISPDAT3 Position */ -#define FMC_MPDAT3_ISPDAT3_Msk (0xfffffffful << FMC_MPDAT3_ISPDAT3_Pos) /*!< FMC_T::MPDAT3: ISPDAT3 Mask */ - -#define FMC_MPSTS_MPBUSY_Pos (0) /*!< FMC_T::MPSTS: MPBUSY Position */ -#define FMC_MPSTS_MPBUSY_Msk (0x1ul << FMC_MPSTS_MPBUSY_Pos) /*!< FMC_T::MPSTS: MPBUSY Mask */ - -#define FMC_MPSTS_PPGO_Pos (1) /*!< FMC_T::MPSTS: PPGO Position */ -#define FMC_MPSTS_PPGO_Msk (0x1ul << FMC_MPSTS_PPGO_Pos) /*!< FMC_T::MPSTS: PPGO Mask */ - -#define FMC_MPSTS_ISPFF_Pos (2) /*!< FMC_T::MPSTS: ISPFF Position */ -#define FMC_MPSTS_ISPFF_Msk (0x1ul << FMC_MPSTS_ISPFF_Pos) /*!< FMC_T::MPSTS: ISPFF Mask */ - -#define FMC_MPSTS_D0_Pos (4) /*!< FMC_T::MPSTS: D0 Position */ -#define FMC_MPSTS_D0_Msk (0x1ul << FMC_MPSTS_D0_Pos) /*!< FMC_T::MPSTS: D0 Mask */ - -#define FMC_MPSTS_D1_Pos (5) /*!< FMC_T::MPSTS: D1 Position */ -#define FMC_MPSTS_D1_Msk (0x1ul << FMC_MPSTS_D1_Pos) /*!< FMC_T::MPSTS: D1 Mask */ - -#define FMC_MPSTS_D2_Pos (6) /*!< FMC_T::MPSTS: D2 Position */ -#define FMC_MPSTS_D2_Msk (0x1ul << FMC_MPSTS_D2_Pos) /*!< FMC_T::MPSTS: D2 Mask */ - -#define FMC_MPSTS_D3_Pos (7) /*!< FMC_T::MPSTS: D3 Position */ -#define FMC_MPSTS_D3_Msk (0x1ul << FMC_MPSTS_D3_Pos) /*!< FMC_T::MPSTS: D3 Mask */ - -#define FMC_MPADDR_MPADDR_Pos (0) /*!< FMC_T::MPADDR: MPADDR Position */ -#define FMC_MPADDR_MPADDR_Msk (0xfffffffful << FMC_MPADDR_MPADDR_Pos) /*!< FMC_T::MPADDR: MPADDR Mask */ - -#define FMC_XOMR0STS_SIZE_Pos (0) /*!< FMC_T::XOMR0STS: SIZE Position */ -#define FMC_XOMR0STS_SIZE_Msk (0xfful << FMC_XOMR0STS_SIZE_Pos) /*!< FMC_T::XOMR0STS: SIZE Mask */ - -#define FMC_XOMR0STS_BASE_Pos (8) /*!< FMC_T::XOMR0STS: BASE Position */ -#define FMC_XOMR0STS_BASE_Msk (0xfffffful << FMC_XOMR0STS_BASE_Pos) /*!< FMC_T::XOMR0STS: BASE Mask */ - -#define FMC_XOMR1STS_SIZE_Pos (0) /*!< FMC_T::XOMR1STS: SIZE Position */ -#define FMC_XOMR1STS_SIZE_Msk (0xfful << FMC_XOMR1STS_SIZE_Pos) /*!< FMC_T::XOMR1STS: SIZE Mask */ - -#define FMC_XOMR1STS_BASE_Pos (8) /*!< FMC_T::XOMR1STS: BASE Position */ -#define FMC_XOMR1STS_BASE_Msk (0xfffffful << FMC_XOMR1STS_BASE_Pos) /*!< FMC_T::XOMR1STS: BASE Mask */ - -#define FMC_XOMR2STS_SIZE_Pos (0) /*!< FMC_T::XOMR2STS: SIZE Position */ -#define FMC_XOMR2STS_SIZE_Msk (0xfful << FMC_XOMR2STS_SIZE_Pos) /*!< FMC_T::XOMR2STS: SIZE Mask */ - -#define FMC_XOMR2STS_BASE_Pos (8) /*!< FMC_T::XOMR2STS: BASE Position */ -#define FMC_XOMR2STS_BASE_Msk (0xfffffful << FMC_XOM20STS_BASE_Pos) /*!< FMC_T::XOMR2STS: BASE Mask */ - -#define FMC_XOMR3STS_SIZE_Pos (0) /*!< FMC_T::XOMR3STS: SIZE Position */ -#define FMC_XOMR3STS_SIZE_Msk (0xfful << FMC_XOMR3STS_SIZE_Pos) /*!< FMC_T::XOMR3STS: SIZE Mask */ - -#define FMC_XOMR3STS_BASE_Pos (8) /*!< FMC_T::XOMR3STS: BASE Position */ -#define FMC_XOMR3STS_BASE_Msk (0xfffffful << FMC_XOMR3STS_BASE_Pos) /*!< FMC_T::XOMR3STS: BASE Mask */ - -#define FMC_XOMSTS_XOMR0ON_Pos (0) /*!< FMC_T::XOMSTS: XOMR0ON Position */ -#define FMC_XOMSTS_XOMR0ON_Msk (0x1ul << FMC_XOMSTS_XOMR0ON_Pos) /*!< FMC_T::XOMSTS: XOMR0ON Mask */ - -#define FMC_XOMSTS_XOMR1ON_Pos (1) /*!< FMC_T::XOMSTS: XOMR1ON Position */ -#define FMC_XOMSTS_XOMR1ON_Msk (0x1ul << FMC_XOMSTS_XOMR1ON_Pos) /*!< FMC_T::XOMSTS: XOMR1ON Mask */ - -#define FMC_XOMSTS_XOMR2ON_Pos (2) /*!< FMC_T::XOMSTS: XOMR2ON Position */ -#define FMC_XOMSTS_XOMR2ON_Msk (0x1ul << FMC_XOMSTS_XOMR2ON_Pos) /*!< FMC_T::XOMSTS: XOMR2ON Mask */ - -#define FMC_XOMSTS_XOMR3ON_Pos (3) /*!< FMC_T::XOMSTS: XOMR3ON Position */ -#define FMC_XOMSTS_XOMR3ON_Msk (0x1ul << FMC_XOMSTS_XOMR3ON_Pos) /*!< FMC_T::XOMSTS: XOMR3ON Mask */ - -#define FMC_XOMSTS_XOMPEF_Pos (4) /*!< FMC_T::XOMSTS: XOMPEF Position */ -#define FMC_XOMSTS_XOMPEF_Msk (0x1ul << FMC_XOMSTS_XOMPEF_Pos) /*!< FMC_T::XOMSTS: XOMPEF Mask */ - -/**@}*/ /* FMC_CONST */ -/**@}*/ /* end of FMC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __FMC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/gpio_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/gpio_reg.h deleted file mode 100644 index 9876f972845..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/gpio_reg.h +++ /dev/null @@ -1,936 +0,0 @@ -/**************************************************************************//** - * @file gpio_reg.h - * @version V1.00 - * @brief GPIO register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __GPIO_REG_H__ -#define __GPIO_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup GPIO General Purpose Input/Output Controller(GPIO) - Memory Mapped Structure for GPIO Controller -@{ */ - - -typedef struct -{ - - /** - * @var GPIO_T::MODE - * Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0 Port A-H I/O Mode Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|MODEn |Port A-H I/O Pin[n] Mode Control - * | | |Determine each I/O mode of Px.n pins. - * | | |00 = Px.n is in Input mode. - * | | |01 = Px.n is in Push-pull Output mode. - * | | |10 = Px.n is in Open-drain Output mode. - * | | |11 = Px.n is in Quasi-bidirectional mode. - * | | |Note1: The initial value of this field is defined by CIOINI (CONFIG0 [10]). - * | | |If CIOINI is set to 0, the default value is 0xFFFF_FFFF and all pins will be quasi-bidirectional mode after chip powered on. - * | | |If CIOINI is set to 1, the default value is 0x0000_0000 and all pins will be input mode after chip powered on. - * | | |Note2: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DINOFF - * Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4 Port A-H Digital Input Path Disable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n+16] |DINOFFn |Port A-H Pin[n] Digital Input Path Disable Control - * | | |Each of these bits is used to control if the digital input path of corresponding Px.n pin is disabled. - * | | |If input is analog signal, users can disable Px.n digital input path to avoid input current leakage. - * | | |0 = Px.n digital input path Enabled. - * | | |1 = Px.n digital input path Disabled (digital input tied to low). - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DOUT - * Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8 Port A-H Data Output Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DOUTn |Port A-H Pin[n] Output Value - * | | |Each of these bits controls the status of a Px.n pin when the Px.n is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |0 = Px.n will drive Low if the Px.n pin is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |1 = Px.n will drive High if the Px.n pin is configured as Push-pull output or Quasi-bidirectional mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DATMSK - * Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC Port A-H Data Output Write Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DATMSKn |Port A-H Pin[n] Data Output Write Mask - * | | |These bits are used to protect the corresponding DOUT (Px_DOUT[n]) bit. - * | | |When the DATMSK (Px_DATMSK[n]) bit is set to 1, the corresponding DOUT (Px_DOUT[n]) bit is protected. - * | | |If the write signal is masked, writing data to the protect bit is ignored. - * | | |0 = Corresponding DOUT (Px_DOUT[n]) bit can be updated. - * | | |1 = Corresponding DOUT (Px_DOUT[n]) bit protected. - * | | |Note1: This function only protects the corresponding DOUT (Px_DOUT[n]) bit, and will not protect the corresponding PDIO (Pxn_PDIO[n]) bit. - * | | |Note2: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::PIN - * Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0 Port A-H Pin Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |PINn |Port A-H Pin[n] Pin Value - * | | |Each bit of the register reflects the actual status of the respective Px.n pin. - * | | |If the bit is 1, it indicates the corresponding pin status is high; else the pin status is low. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DBEN - * Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4 Port A-H De-Bounce Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DBENn |Port A-H Pin[n] Input Signal De-Bounce Enable Bit - * | | |The DBEN[n] bit is used to enable the de-bounce function for each corresponding bit. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the interrupt. - * | | |The de-bounce clock source is controlled by DBCLKSRC (GPIO_DBCTL [4]), one de-bounce sample cycle period is controlled by DBCLKSEL (GPIO_DBCTL [3:0]). - * | | |0 = Px.n de-bounce function Disabled. - * | | |1 = Px.n de-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::INTTYPE - * Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8 Port A-H Interrupt Trigger Type Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |TYPEn |Port A-H Pin[n] Edge or Level Detection Interrupt Trigger Type Control - * | | |TYPE (Px_INTTYPE[n]) bit is used to control the triggered interrupt is by level trigger or by edge trigger. - * | | |If the interrupt is by edge trigger, the trigger source can be controlled by de-bounce. - * | | |If the interrupt is by level trigger, the input source is sampled by one HCLK clock and generates the interrupt. - * | | |0 = Edge trigger interrupt. - * | | |1 = Level trigger interrupt. - * | | |If the pin is set as the level trigger interrupt, only one level can be set on the registers RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]). - * | | |If both levels to trigger interrupt are set, the setting is ignored and no interrupt will occur. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::INTEN - * Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC Port A-H Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |FLIENn |Port A-H Pin[n] Falling Edge or Low Level Interrupt Trigger Type Enable Bit - * | | |The FLIEN (Px_INTEN[n]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the FLIEN (Px_INTEN[n]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at low level. - * | | |If the interrupt is edge trigger(TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from high to low. - * | | |0 = Px.n level low or high to low interrupt Disabled. - * | | |1 = Px.n level low or high to low interrupt Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[n+16] |RHIENn |Port A-H Pin[n] Rising Edge or High Level Interrupt Trigger Type Enable Bit - * | | |The RHIEN (Px_INTEN[n+16]) bit is used to enable the interrupt for each of the corresponding input Px.n pin - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the RHIEN (Px_INTEN[n+16]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at high level. - * | | |If the interrupt is edge trigger (TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from low to high. - * | | |0 = Px.n level high or low to high interrupt Disabled. - * | | |1 = Px.n level high or low to high interrupt Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::INTSRC - * Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0 Port A-H Interrupt Source Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |INTSRCn |Port A-H Pin[n] Interrupt Source Flag - * | | |Write Operation : - * | | |0 = No action. - * | | |1 = Clear the corresponding pending interrupt. - * | | |Read Operation : - * | | |0 = No interrupt at Px.n. - * | | |1 = Px.n generates an interrupt. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::SMTEN - * Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4 Port A-H Input Schmitt Trigger Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |SMTENn |Port A-H Pin[n] Input Schmitt Trigger Enable Bit - * | | |0 = Px.n input Schmitt trigger function Disabled. - * | | |1 = Px.n input Schmitt trigger function Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::SLEWCTL - * Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8 Port A-H High Slew Rate Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|HSRENn |Port A-H Pin[n] High Slew Rate Control - * | | |00 = Px.n output with normal slew rate mode (maximum 40 MHz at 2.7V). - * | | |01 = Px.n output with high slew rate mode (maximum 80 MHz at 2.7V). - * | | |10 = Px.n output with fast slew rate mode (maximum 100 MHz at 2.7V. - * | | |11 = Reserved. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::PUSEL - * Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0 Port A-H Pull-up and Pull-down Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|PUSELn |Port A-H Pin[n] Pull-up and Pull-down Enable Register - * | | |Determine each I/O Pull-up/pull-down of Px.n pins. - * | | |00 = Px.n pull-up and pull-up disable. - * | | |01 = Px.n pull-up enable. - * | | |10 = Px.n pull-down enable. - * | | |11 = Reserved. - * | | |Note1: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation - * | | |The independent pull-up control register only valid when MODEn set as tri-state and open-drain mode - * | | |The independent pull-down control register only valid when MODEn set as tri-state mode - * | | |When both pull-up pull-down is set as 1 at tri-state mode, keep I/O in tri-state mode - * | | |Note2: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - */ - - __IO uint32_t MODE; /* Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0 Port A-H I/O Mode Control */ - __IO uint32_t DINOFF; /* Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4 Port A-H Digital Input Path Disable Control */ - __IO uint32_t DOUT; /* Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8 Port A-H Data Output Value */ - __IO uint32_t DATMSK; /* Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC Port A-H Data Output Write Mask */ - __I uint32_t PIN; /* Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0 Port A-H Pin Value */ - __IO uint32_t DBEN; /* Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4 Port A-H De-Bounce Enable Control Register */ - __IO uint32_t INTTYPE; /* Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8 Port A-H Interrupt Trigger Type Control */ - __IO uint32_t INTEN; /* Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC Port A-H Interrupt Enable Control Register */ - __IO uint32_t INTSRC; /* Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0 Port A-H Interrupt Source Flag */ - __IO uint32_t SMTEN; /* Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4 Port A-H Input Schmitt Trigger Enable Register */ - __IO uint32_t SLEWCTL; /* Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8 Port A-H High Slew Rate Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PUSEL; /* Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0 Port A-H Pull-up and Pull-down Enable Register */ - -} GPIO_T; - -typedef struct -{ - - /** - * @var GPIO_DBCTL_T::DBCTL - * Offset: 0x440 Interrupt De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DBCLKSEL |De-Bounce Sampling Cycle Selection - * | | |0000 = Sample interrupt input once per 1 clocks. - * | | |0001 = Sample interrupt input once per 2 clocks. - * | | |0010 = Sample interrupt input once per 4 clocks. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 2*256 clocks. - * | | |1010 = Sample interrupt input once per 4*256 clocks. - * | | |1011 = Sample interrupt input once per 8*256 clocks. - * | | |1100 = Sample interrupt input once per 16*256 clocks. - * | | |1101 = Sample interrupt input once per 32*256 clocks. - * | | |1110 = Sample interrupt input once per 64*256 clocks. - * | | |1111 = Sample interrupt input once per 128*256 clocks. - * |[4] |DBCLKSRC |De-Bounce Counter Clock Source Selection - * | | |0 = De-bounce counter clock source is the HCLK. - * | | |1 = De-bounce counter clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * |[5] |ICLKON |Interrupt Clock On Mode - * | | |0 = Edge detection circuit is active only if I/O pin corresponding RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]) bit is set to 1. - * | | |1 = All I/O pins edge detection circuit is always active after reset. - * | | |Note: It is recommended to disable this bit to save system power if no special application concern. - */ - - __IO uint32_t DBCTL; /* Offset: 0x440 Interrupt De-bounce Control Register */ - -} GPIO_DBCTL_T; - -/** - @addtogroup GPIO_CONST GPIO Bit Field Definition - Constant Definitions for GPIO Controller -@{ */ - -#define GPIO_MODE_MODE0_Pos (0) /*!< GPIO_T::MODE: MODE0 Position */ -#define GPIO_MODE_MODE0_Msk (0x3ul << GPIO_MODE_MODE0_Pos) /*!< GPIO_T::MODE: MODE0 Mask */ - -#define GPIO_MODE_MODE1_Pos (2) /*!< GPIO_T::MODE: MODE1 Position */ -#define GPIO_MODE_MODE1_Msk (0x3ul << GPIO_MODE_MODE1_Pos) /*!< GPIO_T::MODE: MODE1 Mask */ - -#define GPIO_MODE_MODE2_Pos (4) /*!< GPIO_T::MODE: MODE2 Position */ -#define GPIO_MODE_MODE2_Msk (0x3ul << GPIO_MODE_MODE2_Pos) /*!< GPIO_T::MODE: MODE2 Mask */ - -#define GPIO_MODE_MODE3_Pos (6) /*!< GPIO_T::MODE: MODE3 Position */ -#define GPIO_MODE_MODE3_Msk (0x3ul << GPIO_MODE_MODE3_Pos) /*!< GPIO_T::MODE: MODE3 Mask */ - -#define GPIO_MODE_MODE4_Pos (8) /*!< GPIO_T::MODE: MODE4 Position */ -#define GPIO_MODE_MODE4_Msk (0x3ul << GPIO_MODE_MODE4_Pos) /*!< GPIO_T::MODE: MODE4 Mask */ - -#define GPIO_MODE_MODE5_Pos (10) /*!< GPIO_T::MODE: MODE5 Position */ -#define GPIO_MODE_MODE5_Msk (0x3ul << GPIO_MODE_MODE5_Pos) /*!< GPIO_T::MODE: MODE5 Mask */ - -#define GPIO_MODE_MODE6_Pos (12) /*!< GPIO_T::MODE: MODE6 Position */ -#define GPIO_MODE_MODE6_Msk (0x3ul << GPIO_MODE_MODE6_Pos) /*!< GPIO_T::MODE: MODE6 Mask */ - -#define GPIO_MODE_MODE7_Pos (14) /*!< GPIO_T::MODE: MODE7 Position */ -#define GPIO_MODE_MODE7_Msk (0x3ul << GPIO_MODE_MODE7_Pos) /*!< GPIO_T::MODE: MODE7 Mask */ - -#define GPIO_MODE_MODE8_Pos (16) /*!< GPIO_T::MODE: MODE8 Position */ -#define GPIO_MODE_MODE8_Msk (0x3ul << GPIO_MODE_MODE8_Pos) /*!< GPIO_T::MODE: MODE8 Mask */ - -#define GPIO_MODE_MODE9_Pos (18) /*!< GPIO_T::MODE: MODE9 Position */ -#define GPIO_MODE_MODE9_Msk (0x3ul << GPIO_MODE_MODE9_Pos) /*!< GPIO_T::MODE: MODE9 Mask */ - -#define GPIO_MODE_MODE10_Pos (20) /*!< GPIO_T::MODE: MODE10 Position */ -#define GPIO_MODE_MODE10_Msk (0x3ul << GPIO_MODE_MODE10_Pos) /*!< GPIO_T::MODE: MODE10 Mask */ - -#define GPIO_MODE_MODE11_Pos (22) /*!< GPIO_T::MODE: MODE11 Position */ -#define GPIO_MODE_MODE11_Msk (0x3ul << GPIO_MODE_MODE11_Pos) /*!< GPIO_T::MODE: MODE11 Mask */ - -#define GPIO_MODE_MODE12_Pos (24) /*!< GPIO_T::MODE: MODE12 Position */ -#define GPIO_MODE_MODE12_Msk (0x3ul << GPIO_MODE_MODE12_Pos) /*!< GPIO_T::MODE: MODE12 Mask */ - -#define GPIO_MODE_MODE13_Pos (26) /*!< GPIO_T::MODE: MODE13 Position */ -#define GPIO_MODE_MODE13_Msk (0x3ul << GPIO_MODE_MODE13_Pos) /*!< GPIO_T::MODE: MODE13 Mask */ - -#define GPIO_MODE_MODE14_Pos (28) /*!< GPIO_T::MODE: MODE14 Position */ -#define GPIO_MODE_MODE14_Msk (0x3ul << GPIO_MODE_MODE14_Pos) /*!< GPIO_T::MODE: MODE14 Mask */ - -#define GPIO_MODE_MODE15_Pos (30) /*!< GPIO_T::MODE: MODE15 Position */ -#define GPIO_MODE_MODE15_Msk (0x3ul << GPIO_MODE_MODE15_Pos) /*!< GPIO_T::MODE: MODE15 Mask */ - -#define GPIO_DINOFF_DINOFF0_Pos (16) /*!< GPIO_T::DINOFF: DINOFF0 Position */ -#define GPIO_DINOFF_DINOFF0_Msk (0x1ul << GPIO_DINOFF_DINOFF0_Pos) /*!< GPIO_T::DINOFF: DINOFF0 Mask */ - -#define GPIO_DINOFF_DINOFF1_Pos (17) /*!< GPIO_T::DINOFF: DINOFF1 Position */ -#define GPIO_DINOFF_DINOFF1_Msk (0x1ul << GPIO_DINOFF_DINOFF1_Pos) /*!< GPIO_T::DINOFF: DINOFF1 Mask */ - -#define GPIO_DINOFF_DINOFF2_Pos (18) /*!< GPIO_T::DINOFF: DINOFF2 Position */ -#define GPIO_DINOFF_DINOFF2_Msk (0x1ul << GPIO_DINOFF_DINOFF2_Pos) /*!< GPIO_T::DINOFF: DINOFF2 Mask */ - -#define GPIO_DINOFF_DINOFF3_Pos (19) /*!< GPIO_T::DINOFF: DINOFF3 Position */ -#define GPIO_DINOFF_DINOFF3_Msk (0x1ul << GPIO_DINOFF_DINOFF3_Pos) /*!< GPIO_T::DINOFF: DINOFF3 Mask */ - -#define GPIO_DINOFF_DINOFF4_Pos (20) /*!< GPIO_T::DINOFF: DINOFF4 Position */ -#define GPIO_DINOFF_DINOFF4_Msk (0x1ul << GPIO_DINOFF_DINOFF4_Pos) /*!< GPIO_T::DINOFF: DINOFF4 Mask */ - -#define GPIO_DINOFF_DINOFF5_Pos (21) /*!< GPIO_T::DINOFF: DINOFF5 Position */ -#define GPIO_DINOFF_DINOFF5_Msk (0x1ul << GPIO_DINOFF_DINOFF5_Pos) /*!< GPIO_T::DINOFF: DINOFF5 Mask */ - -#define GPIO_DINOFF_DINOFF6_Pos (22) /*!< GPIO_T::DINOFF: DINOFF6 Position */ -#define GPIO_DINOFF_DINOFF6_Msk (0x1ul << GPIO_DINOFF_DINOFF6_Pos) /*!< GPIO_T::DINOFF: DINOFF6 Mask */ - -#define GPIO_DINOFF_DINOFF7_Pos (23) /*!< GPIO_T::DINOFF: DINOFF7 Position */ -#define GPIO_DINOFF_DINOFF7_Msk (0x1ul << GPIO_DINOFF_DINOFF7_Pos) /*!< GPIO_T::DINOFF: DINOFF7 Mask */ - -#define GPIO_DINOFF_DINOFF8_Pos (24) /*!< GPIO_T::DINOFF: DINOFF8 Position */ -#define GPIO_DINOFF_DINOFF8_Msk (0x1ul << GPIO_DINOFF_DINOFF8_Pos) /*!< GPIO_T::DINOFF: DINOFF8 Mask */ - -#define GPIO_DINOFF_DINOFF9_Pos (25) /*!< GPIO_T::DINOFF: DINOFF9 Position */ -#define GPIO_DINOFF_DINOFF9_Msk (0x1ul << GPIO_DINOFF_DINOFF9_Pos) /*!< GPIO_T::DINOFF: DINOFF9 Mask */ - -#define GPIO_DINOFF_DINOFF10_Pos (26) /*!< GPIO_T::DINOFF: DINOFF10 Position */ -#define GPIO_DINOFF_DINOFF10_Msk (0x1ul << GPIO_DINOFF_DINOFF10_Pos) /*!< GPIO_T::DINOFF: DINOFF10 Mask */ - -#define GPIO_DINOFF_DINOFF11_Pos (27) /*!< GPIO_T::DINOFF: DINOFF11 Position */ -#define GPIO_DINOFF_DINOFF11_Msk (0x1ul << GPIO_DINOFF_DINOFF11_Pos) /*!< GPIO_T::DINOFF: DINOFF11 Mask */ - -#define GPIO_DINOFF_DINOFF12_Pos (28) /*!< GPIO_T::DINOFF: DINOFF12 Position */ -#define GPIO_DINOFF_DINOFF12_Msk (0x1ul << GPIO_DINOFF_DINOFF12_Pos) /*!< GPIO_T::DINOFF: DINOFF12 Mask */ - -#define GPIO_DINOFF_DINOFF13_Pos (29) /*!< GPIO_T::DINOFF: DINOFF13 Position */ -#define GPIO_DINOFF_DINOFF13_Msk (0x1ul << GPIO_DINOFF_DINOFF13_Pos) /*!< GPIO_T::DINOFF: DINOFF13 Mask */ - -#define GPIO_DINOFF_DINOFF14_Pos (30) /*!< GPIO_T::DINOFF: DINOFF14 Position */ -#define GPIO_DINOFF_DINOFF14_Msk (0x1ul << GPIO_DINOFF_DINOFF14_Pos) /*!< GPIO_T::DINOFF: DINOFF14 Mask */ - -#define GPIO_DINOFF_DINOFF15_Pos (31) /*!< GPIO_T::DINOFF: DINOFF15 Position */ -#define GPIO_DINOFF_DINOFF15_Msk (0x1ul << GPIO_DINOFF_DINOFF15_Pos) /*!< GPIO_T::DINOFF: DINOFF15 Mask */ - -#define GPIO_DOUT_DOUT0_Pos (0) /*!< GPIO_T::DOUT: DOUT0 Position */ -#define GPIO_DOUT_DOUT0_Msk (0x1ul << GPIO_DOUT_DOUT0_Pos) /*!< GPIO_T::DOUT: DOUT0 Mask */ - -#define GPIO_DOUT_DOUT1_Pos (1) /*!< GPIO_T::DOUT: DOUT1 Position */ -#define GPIO_DOUT_DOUT1_Msk (0x1ul << GPIO_DOUT_DOUT1_Pos) /*!< GPIO_T::DOUT: DOUT1 Mask */ - -#define GPIO_DOUT_DOUT2_Pos (2) /*!< GPIO_T::DOUT: DOUT2 Position */ -#define GPIO_DOUT_DOUT2_Msk (0x1ul << GPIO_DOUT_DOUT2_Pos) /*!< GPIO_T::DOUT: DOUT2 Mask */ - -#define GPIO_DOUT_DOUT3_Pos (3) /*!< GPIO_T::DOUT: DOUT3 Position */ -#define GPIO_DOUT_DOUT3_Msk (0x1ul << GPIO_DOUT_DOUT3_Pos) /*!< GPIO_T::DOUT: DOUT3 Mask */ - -#define GPIO_DOUT_DOUT4_Pos (4) /*!< GPIO_T::DOUT: DOUT4 Position */ -#define GPIO_DOUT_DOUT4_Msk (0x1ul << GPIO_DOUT_DOUT4_Pos) /*!< GPIO_T::DOUT: DOUT4 Mask */ - -#define GPIO_DOUT_DOUT5_Pos (5) /*!< GPIO_T::DOUT: DOUT5 Position */ -#define GPIO_DOUT_DOUT5_Msk (0x1ul << GPIO_DOUT_DOUT5_Pos) /*!< GPIO_T::DOUT: DOUT5 Mask */ - -#define GPIO_DOUT_DOUT6_Pos (6) /*!< GPIO_T::DOUT: DOUT6 Position */ -#define GPIO_DOUT_DOUT6_Msk (0x1ul << GPIO_DOUT_DOUT6_Pos) /*!< GPIO_T::DOUT: DOUT6 Mask */ - -#define GPIO_DOUT_DOUT7_Pos (7) /*!< GPIO_T::DOUT: DOUT7 Position */ -#define GPIO_DOUT_DOUT7_Msk (0x1ul << GPIO_DOUT_DOUT7_Pos) /*!< GPIO_T::DOUT: DOUT7 Mask */ - -#define GPIO_DOUT_DOUT8_Pos (8) /*!< GPIO_T::DOUT: DOUT8 Position */ -#define GPIO_DOUT_DOUT8_Msk (0x1ul << GPIO_DOUT_DOUT8_Pos) /*!< GPIO_T::DOUT: DOUT8 Mask */ - -#define GPIO_DOUT_DOUT9_Pos (9) /*!< GPIO_T::DOUT: DOUT9 Position */ -#define GPIO_DOUT_DOUT9_Msk (0x1ul << GPIO_DOUT_DOUT9_Pos) /*!< GPIO_T::DOUT: DOUT9 Mask */ - -#define GPIO_DOUT_DOUT10_Pos (10) /*!< GPIO_T::DOUT: DOUT10 Position */ -#define GPIO_DOUT_DOUT10_Msk (0x1ul << GPIO_DOUT_DOUT10_Pos) /*!< GPIO_T::DOUT: DOUT10 Mask */ - -#define GPIO_DOUT_DOUT11_Pos (11) /*!< GPIO_T::DOUT: DOUT11 Position */ -#define GPIO_DOUT_DOUT11_Msk (0x1ul << GPIO_DOUT_DOUT11_Pos) /*!< GPIO_T::DOUT: DOUT11 Mask */ - -#define GPIO_DOUT_DOUT12_Pos (12) /*!< GPIO_T::DOUT: DOUT12 Position */ -#define GPIO_DOUT_DOUT12_Msk (0x1ul << GPIO_DOUT_DOUT12_Pos) /*!< GPIO_T::DOUT: DOUT12 Mask */ - -#define GPIO_DOUT_DOUT13_Pos (13) /*!< GPIO_T::DOUT: DOUT13 Position */ -#define GPIO_DOUT_DOUT13_Msk (0x1ul << GPIO_DOUT_DOUT13_Pos) /*!< GPIO_T::DOUT: DOUT13 Mask */ - -#define GPIO_DOUT_DOUT14_Pos (14) /*!< GPIO_T::DOUT: DOUT14 Position */ -#define GPIO_DOUT_DOUT14_Msk (0x1ul << GPIO_DOUT_DOUT14_Pos) /*!< GPIO_T::DOUT: DOUT14 Mask */ - -#define GPIO_DOUT_DOUT15_Pos (15) /*!< GPIO_T::DOUT: DOUT15 Position */ -#define GPIO_DOUT_DOUT15_Msk (0x1ul << GPIO_DOUT_DOUT15_Pos) /*!< GPIO_T::DOUT: DOUT15 Mask */ - -#define GPIO_DATMSK_DATMSK0_Pos (0) /*!< GPIO_T::DATMSK: DATMSK0 Position */ -#define GPIO_DATMSK_DATMSK0_Msk (0x1ul << GPIO_DATMSK_DATMSK0_Pos) /*!< GPIO_T::DATMSK: DATMSK0 Mask */ - -#define GPIO_DATMSK_DATMSK1_Pos (1) /*!< GPIO_T::DATMSK: DATMSK1 Position */ -#define GPIO_DATMSK_DATMSK1_Msk (0x1ul << GPIO_DATMSK_DATMSK1_Pos) /*!< GPIO_T::DATMSK: DATMSK1 Mask */ - -#define GPIO_DATMSK_DATMSK2_Pos (2) /*!< GPIO_T::DATMSK: DATMSK2 Position */ -#define GPIO_DATMSK_DATMSK2_Msk (0x1ul << GPIO_DATMSK_DATMSK2_Pos) /*!< GPIO_T::DATMSK: DATMSK2 Mask */ - -#define GPIO_DATMSK_DATMSK3_Pos (3) /*!< GPIO_T::DATMSK: DATMSK3 Position */ -#define GPIO_DATMSK_DATMSK3_Msk (0x1ul << GPIO_DATMSK_DATMSK3_Pos) /*!< GPIO_T::DATMSK: DATMSK3 Mask */ - -#define GPIO_DATMSK_DATMSK4_Pos (4) /*!< GPIO_T::DATMSK: DATMSK4 Position */ -#define GPIO_DATMSK_DATMSK4_Msk (0x1ul << GPIO_DATMSK_DATMSK4_Pos) /*!< GPIO_T::DATMSK: DATMSK4 Mask */ - -#define GPIO_DATMSK_DATMSK5_Pos (5) /*!< GPIO_T::DATMSK: DATMSK5 Position */ -#define GPIO_DATMSK_DATMSK5_Msk (0x1ul << GPIO_DATMSK_DATMSK5_Pos) /*!< GPIO_T::DATMSK: DATMSK5 Mask */ - -#define GPIO_DATMSK_DATMSK6_Pos (6) /*!< GPIO_T::DATMSK: DATMSK6 Position */ -#define GPIO_DATMSK_DATMSK6_Msk (0x1ul << GPIO_DATMSK_DATMSK6_Pos) /*!< GPIO_T::DATMSK: DATMSK6 Mask */ - -#define GPIO_DATMSK_DATMSK7_Pos (7) /*!< GPIO_T::DATMSK: DATMSK7 Position */ -#define GPIO_DATMSK_DATMSK7_Msk (0x1ul << GPIO_DATMSK_DATMSK7_Pos) /*!< GPIO_T::DATMSK: DATMSK7 Mask */ - -#define GPIO_DATMSK_DATMSK8_Pos (8) /*!< GPIO_T::DATMSK: DATMSK8 Position */ -#define GPIO_DATMSK_DATMSK8_Msk (0x1ul << GPIO_DATMSK_DATMSK8_Pos) /*!< GPIO_T::DATMSK: DATMSK8 Mask */ - -#define GPIO_DATMSK_DATMSK9_Pos (9) /*!< GPIO_T::DATMSK: DATMSK9 Position */ -#define GPIO_DATMSK_DATMSK9_Msk (0x1ul << GPIO_DATMSK_DATMSK9_Pos) /*!< GPIO_T::DATMSK: DATMSK9 Mask */ - -#define GPIO_DATMSK_DATMSK10_Pos (10) /*!< GPIO_T::DATMSK: DATMSK10 Position */ -#define GPIO_DATMSK_DATMSK10_Msk (0x1ul << GPIO_DATMSK_DATMSK10_Pos) /*!< GPIO_T::DATMSK: DATMSK10 Mask */ - -#define GPIO_DATMSK_DATMSK11_Pos (11) /*!< GPIO_T::DATMSK: DATMSK11 Position */ -#define GPIO_DATMSK_DATMSK11_Msk (0x1ul << GPIO_DATMSK_DATMSK11_Pos) /*!< GPIO_T::DATMSK: DATMSK11 Mask */ - -#define GPIO_DATMSK_DATMSK12_Pos (12) /*!< GPIO_T::DATMSK: DATMSK12 Position */ -#define GPIO_DATMSK_DATMSK12_Msk (0x1ul << GPIO_DATMSK_DATMSK12_Pos) /*!< GPIO_T::DATMSK: DATMSK12 Mask */ - -#define GPIO_DATMSK_DATMSK13_Pos (13) /*!< GPIO_T::DATMSK: DATMSK13 Position */ -#define GPIO_DATMSK_DATMSK13_Msk (0x1ul << GPIO_DATMSK_DATMSK13_Pos) /*!< GPIO_T::DATMSK: DATMSK13 Mask */ - -#define GPIO_DATMSK_DATMSK14_Pos (14) /*!< GPIO_T::DATMSK: DATMSK14 Position */ -#define GPIO_DATMSK_DATMSK14_Msk (0x1ul << GPIO_DATMSK_DATMSK14_Pos) /*!< GPIO_T::DATMSK: DATMSK14 Mask */ - -#define GPIO_DATMSK_DATMSK15_Pos (15) /*!< GPIO_T::DATMSK: DATMSK15 Position */ -#define GPIO_DATMSK_DATMSK15_Msk (0x1ul << GPIO_DATMSK_DATMSK15_Pos) /*!< GPIO_T::DATMSK: DATMSK15 Mask */ - -#define GPIO_PIN_PIN0_Pos (0) /*!< GPIO_T::PIN: PIN0 Position */ -#define GPIO_PIN_PIN0_Msk (0x1ul << GPIO_PIN_PIN0_Pos) /*!< GPIO_T::PIN: PIN0 Mask */ - -#define GPIO_PIN_PIN1_Pos (1) /*!< GPIO_T::PIN: PIN1 Position */ -#define GPIO_PIN_PIN1_Msk (0x1ul << GPIO_PIN_PIN1_Pos) /*!< GPIO_T::PIN: PIN1 Mask */ - -#define GPIO_PIN_PIN2_Pos (2) /*!< GPIO_T::PIN: PIN2 Position */ -#define GPIO_PIN_PIN2_Msk (0x1ul << GPIO_PIN_PIN2_Pos) /*!< GPIO_T::PIN: PIN2 Mask */ - -#define GPIO_PIN_PIN3_Pos (3) /*!< GPIO_T::PIN: PIN3 Position */ -#define GPIO_PIN_PIN3_Msk (0x1ul << GPIO_PIN_PIN3_Pos) /*!< GPIO_T::PIN: PIN3 Mask */ - -#define GPIO_PIN_PIN4_Pos (4) /*!< GPIO_T::PIN: PIN4 Position */ -#define GPIO_PIN_PIN4_Msk (0x1ul << GPIO_PIN_PIN4_Pos) /*!< GPIO_T::PIN: PIN4 Mask */ - -#define GPIO_PIN_PIN5_Pos (5) /*!< GPIO_T::PIN: PIN5 Position */ -#define GPIO_PIN_PIN5_Msk (0x1ul << GPIO_PIN_PIN5_Pos) /*!< GPIO_T::PIN: PIN5 Mask */ - -#define GPIO_PIN_PIN6_Pos (6) /*!< GPIO_T::PIN: PIN6 Position */ -#define GPIO_PIN_PIN6_Msk (0x1ul << GPIO_PIN_PIN6_Pos) /*!< GPIO_T::PIN: PIN6 Mask */ - -#define GPIO_PIN_PIN7_Pos (7) /*!< GPIO_T::PIN: PIN7 Position */ -#define GPIO_PIN_PIN7_Msk (0x1ul << GPIO_PIN_PIN7_Pos) /*!< GPIO_T::PIN: PIN7 Mask */ - -#define GPIO_PIN_PIN8_Pos (8) /*!< GPIO_T::PIN: PIN8 Position */ -#define GPIO_PIN_PIN8_Msk (0x1ul << GPIO_PIN_PIN8_Pos) /*!< GPIO_T::PIN: PIN8 Mask */ - -#define GPIO_PIN_PIN9_Pos (9) /*!< GPIO_T::PIN: PIN9 Position */ -#define GPIO_PIN_PIN9_Msk (0x1ul << GPIO_PIN_PIN9_Pos) /*!< GPIO_T::PIN: PIN9 Mask */ - -#define GPIO_PIN_PIN10_Pos (10) /*!< GPIO_T::PIN: PIN10 Position */ -#define GPIO_PIN_PIN10_Msk (0x1ul << GPIO_PIN_PIN10_Pos) /*!< GPIO_T::PIN: PIN10 Mask */ - -#define GPIO_PIN_PIN11_Pos (11) /*!< GPIO_T::PIN: PIN11 Position */ -#define GPIO_PIN_PIN11_Msk (0x1ul << GPIO_PIN_PIN11_Pos) /*!< GPIO_T::PIN: PIN11 Mask */ - -#define GPIO_PIN_PIN12_Pos (12) /*!< GPIO_T::PIN: PIN12 Position */ -#define GPIO_PIN_PIN12_Msk (0x1ul << GPIO_PIN_PIN12_Pos) /*!< GPIO_T::PIN: PIN12 Mask */ - -#define GPIO_PIN_PIN13_Pos (13) /*!< GPIO_T::PIN: PIN13 Position */ -#define GPIO_PIN_PIN13_Msk (0x1ul << GPIO_PIN_PIN13_Pos) /*!< GPIO_T::PIN: PIN13 Mask */ - -#define GPIO_PIN_PIN14_Pos (14) /*!< GPIO_T::PIN: PIN14 Position */ -#define GPIO_PIN_PIN14_Msk (0x1ul << GPIO_PIN_PIN14_Pos) /*!< GPIO_T::PIN: PIN14 Mask */ - -#define GPIO_PIN_PIN15_Pos (15) /*!< GPIO_T::PIN: PIN15 Position */ -#define GPIO_PIN_PIN15_Msk (0x1ul << GPIO_PIN_PIN15_Pos) /*!< GPIO_T::PIN: PIN15 Mask */ - -#define GPIO_DBEN_DBEN0_Pos (0) /*!< GPIO_T::DBEN: DBEN0 Position */ -#define GPIO_DBEN_DBEN0_Msk (0x1ul << GPIO_DBEN_DBEN0_Pos) /*!< GPIO_T::DBEN: DBEN0 Mask */ - -#define GPIO_DBEN_DBEN1_Pos (1) /*!< GPIO_T::DBEN: DBEN1 Position */ -#define GPIO_DBEN_DBEN1_Msk (0x1ul << GPIO_DBEN_DBEN1_Pos) /*!< GPIO_T::DBEN: DBEN1 Mask */ - -#define GPIO_DBEN_DBEN2_Pos (2) /*!< GPIO_T::DBEN: DBEN2 Position */ -#define GPIO_DBEN_DBEN2_Msk (0x1ul << GPIO_DBEN_DBEN2_Pos) /*!< GPIO_T::DBEN: DBEN2 Mask */ - -#define GPIO_DBEN_DBEN3_Pos (3) /*!< GPIO_T::DBEN: DBEN3 Position */ -#define GPIO_DBEN_DBEN3_Msk (0x1ul << GPIO_DBEN_DBEN3_Pos) /*!< GPIO_T::DBEN: DBEN3 Mask */ - -#define GPIO_DBEN_DBEN4_Pos (4) /*!< GPIO_T::DBEN: DBEN4 Position */ -#define GPIO_DBEN_DBEN4_Msk (0x1ul << GPIO_DBEN_DBEN4_Pos) /*!< GPIO_T::DBEN: DBEN4 Mask */ - -#define GPIO_DBEN_DBEN5_Pos (5) /*!< GPIO_T::DBEN: DBEN5 Position */ -#define GPIO_DBEN_DBEN5_Msk (0x1ul << GPIO_DBEN_DBEN5_Pos) /*!< GPIO_T::DBEN: DBEN5 Mask */ - -#define GPIO_DBEN_DBEN6_Pos (6) /*!< GPIO_T::DBEN: DBEN6 Position */ -#define GPIO_DBEN_DBEN6_Msk (0x1ul << GPIO_DBEN_DBEN6_Pos) /*!< GPIO_T::DBEN: DBEN6 Mask */ - -#define GPIO_DBEN_DBEN7_Pos (7) /*!< GPIO_T::DBEN: DBEN7 Position */ -#define GPIO_DBEN_DBEN7_Msk (0x1ul << GPIO_DBEN_DBEN7_Pos) /*!< GPIO_T::DBEN: DBEN7 Mask */ - -#define GPIO_DBEN_DBEN8_Pos (8) /*!< GPIO_T::DBEN: DBEN8 Position */ -#define GPIO_DBEN_DBEN8_Msk (0x1ul << GPIO_DBEN_DBEN8_Pos) /*!< GPIO_T::DBEN: DBEN8 Mask */ - -#define GPIO_DBEN_DBEN9_Pos (9) /*!< GPIO_T::DBEN: DBEN9 Position */ -#define GPIO_DBEN_DBEN9_Msk (0x1ul << GPIO_DBEN_DBEN9_Pos) /*!< GPIO_T::DBEN: DBEN9 Mask */ - -#define GPIO_DBEN_DBEN10_Pos (10) /*!< GPIO_T::DBEN: DBEN10 Position */ -#define GPIO_DBEN_DBEN10_Msk (0x1ul << GPIO_DBEN_DBEN10_Pos) /*!< GPIO_T::DBEN: DBEN10 Mask */ - -#define GPIO_DBEN_DBEN11_Pos (11) /*!< GPIO_T::DBEN: DBEN11 Position */ -#define GPIO_DBEN_DBEN11_Msk (0x1ul << GPIO_DBEN_DBEN11_Pos) /*!< GPIO_T::DBEN: DBEN11 Mask */ - -#define GPIO_DBEN_DBEN12_Pos (12) /*!< GPIO_T::DBEN: DBEN12 Position */ -#define GPIO_DBEN_DBEN12_Msk (0x1ul << GPIO_DBEN_DBEN12_Pos) /*!< GPIO_T::DBEN: DBEN12 Mask */ - -#define GPIO_DBEN_DBEN13_Pos (13) /*!< GPIO_T::DBEN: DBEN13 Position */ -#define GPIO_DBEN_DBEN13_Msk (0x1ul << GPIO_DBEN_DBEN13_Pos) /*!< GPIO_T::DBEN: DBEN13 Mask */ - -#define GPIO_DBEN_DBEN14_Pos (14) /*!< GPIO_T::DBEN: DBEN14 Position */ -#define GPIO_DBEN_DBEN14_Msk (0x1ul << GPIO_DBEN_DBEN14_Pos) /*!< GPIO_T::DBEN: DBEN14 Mask */ - -#define GPIO_DBEN_DBEN15_Pos (15) /*!< GPIO_T::DBEN: DBEN15 Position */ -#define GPIO_DBEN_DBEN15_Msk (0x1ul << GPIO_DBEN_DBEN15_Pos) /*!< GPIO_T::DBEN: DBEN15 Mask */ - -#define GPIO_INTTYPE_TYPE0_Pos (0) /*!< GPIO_T::INTTYPE: TYPE0 Position */ -#define GPIO_INTTYPE_TYPE0_Msk (0x1ul << GPIO_INTTYPE_TYPE0_Pos) /*!< GPIO_T::INTTYPE: TYPE0 Mask */ - -#define GPIO_INTTYPE_TYPE1_Pos (1) /*!< GPIO_T::INTTYPE: TYPE1 Position */ -#define GPIO_INTTYPE_TYPE1_Msk (0x1ul << GPIO_INTTYPE_TYPE1_Pos) /*!< GPIO_T::INTTYPE: TYPE1 Mask */ - -#define GPIO_INTTYPE_TYPE2_Pos (2) /*!< GPIO_T::INTTYPE: TYPE2 Position */ -#define GPIO_INTTYPE_TYPE2_Msk (0x1ul << GPIO_INTTYPE_TYPE2_Pos) /*!< GPIO_T::INTTYPE: TYPE2 Mask */ - -#define GPIO_INTTYPE_TYPE3_Pos (3) /*!< GPIO_T::INTTYPE: TYPE3 Position */ -#define GPIO_INTTYPE_TYPE3_Msk (0x1ul << GPIO_INTTYPE_TYPE3_Pos) /*!< GPIO_T::INTTYPE: TYPE3 Mask */ - -#define GPIO_INTTYPE_TYPE4_Pos (4) /*!< GPIO_T::INTTYPE: TYPE4 Position */ -#define GPIO_INTTYPE_TYPE4_Msk (0x1ul << GPIO_INTTYPE_TYPE4_Pos) /*!< GPIO_T::INTTYPE: TYPE4 Mask */ - -#define GPIO_INTTYPE_TYPE5_Pos (5) /*!< GPIO_T::INTTYPE: TYPE5 Position */ -#define GPIO_INTTYPE_TYPE5_Msk (0x1ul << GPIO_INTTYPE_TYPE5_Pos) /*!< GPIO_T::INTTYPE: TYPE5 Mask */ - -#define GPIO_INTTYPE_TYPE6_Pos (6) /*!< GPIO_T::INTTYPE: TYPE6 Position */ -#define GPIO_INTTYPE_TYPE6_Msk (0x1ul << GPIO_INTTYPE_TYPE6_Pos) /*!< GPIO_T::INTTYPE: TYPE6 Mask */ - -#define GPIO_INTTYPE_TYPE7_Pos (7) /*!< GPIO_T::INTTYPE: TYPE7 Position */ -#define GPIO_INTTYPE_TYPE7_Msk (0x1ul << GPIO_INTTYPE_TYPE7_Pos) /*!< GPIO_T::INTTYPE: TYPE7 Mask */ - -#define GPIO_INTTYPE_TYPE8_Pos (8) /*!< GPIO_T::INTTYPE: TYPE8 Position */ -#define GPIO_INTTYPE_TYPE8_Msk (0x1ul << GPIO_INTTYPE_TYPE8_Pos) /*!< GPIO_T::INTTYPE: TYPE8 Mask */ - -#define GPIO_INTTYPE_TYPE9_Pos (9) /*!< GPIO_T::INTTYPE: TYPE9 Position */ -#define GPIO_INTTYPE_TYPE9_Msk (0x1ul << GPIO_INTTYPE_TYPE9_Pos) /*!< GPIO_T::INTTYPE: TYPE9 Mask */ - -#define GPIO_INTTYPE_TYPE10_Pos (10) /*!< GPIO_T::INTTYPE: TYPE10 Position */ -#define GPIO_INTTYPE_TYPE10_Msk (0x1ul << GPIO_INTTYPE_TYPE10_Pos) /*!< GPIO_T::INTTYPE: TYPE10 Mask */ - -#define GPIO_INTTYPE_TYPE11_Pos (11) /*!< GPIO_T::INTTYPE: TYPE11 Position */ -#define GPIO_INTTYPE_TYPE11_Msk (0x1ul << GPIO_INTTYPE_TYPE11_Pos) /*!< GPIO_T::INTTYPE: TYPE11 Mask */ - -#define GPIO_INTTYPE_TYPE12_Pos (12) /*!< GPIO_T::INTTYPE: TYPE12 Position */ -#define GPIO_INTTYPE_TYPE12_Msk (0x1ul << GPIO_INTTYPE_TYPE12_Pos) /*!< GPIO_T::INTTYPE: TYPE12 Mask */ - -#define GPIO_INTTYPE_TYPE13_Pos (13) /*!< GPIO_T::INTTYPE: TYPE13 Position */ -#define GPIO_INTTYPE_TYPE13_Msk (0x1ul << GPIO_INTTYPE_TYPE13_Pos) /*!< GPIO_T::INTTYPE: TYPE13 Mask */ - -#define GPIO_INTTYPE_TYPE14_Pos (14) /*!< GPIO_T::INTTYPE: TYPE14 Position */ -#define GPIO_INTTYPE_TYPE14_Msk (0x1ul << GPIO_INTTYPE_TYPE14_Pos) /*!< GPIO_T::INTTYPE: TYPE14 Mask */ - -#define GPIO_INTTYPE_TYPE15_Pos (15) /*!< GPIO_T::INTTYPE: TYPE15 Position */ -#define GPIO_INTTYPE_TYPE15_Msk (0x1ul << GPIO_INTTYPE_TYPE15_Pos) /*!< GPIO_T::INTTYPE: TYPE15 Mask */ - -#define GPIO_INTEN_FLIEN0_Pos (0) /*!< GPIO_T::INTEN: FLIEN0 Position */ -#define GPIO_INTEN_FLIEN0_Msk (0x1ul << GPIO_INTEN_FLIEN0_Pos) /*!< GPIO_T::INTEN: FLIEN0 Mask */ - -#define GPIO_INTEN_FLIEN1_Pos (1) /*!< GPIO_T::INTEN: FLIEN1 Position */ -#define GPIO_INTEN_FLIEN1_Msk (0x1ul << GPIO_INTEN_FLIEN1_Pos) /*!< GPIO_T::INTEN: FLIEN1 Mask */ - -#define GPIO_INTEN_FLIEN2_Pos (2) /*!< GPIO_T::INTEN: FLIEN2 Position */ -#define GPIO_INTEN_FLIEN2_Msk (0x1ul << GPIO_INTEN_FLIEN2_Pos) /*!< GPIO_T::INTEN: FLIEN2 Mask */ - -#define GPIO_INTEN_FLIEN3_Pos (3) /*!< GPIO_T::INTEN: FLIEN3 Position */ -#define GPIO_INTEN_FLIEN3_Msk (0x1ul << GPIO_INTEN_FLIEN3_Pos) /*!< GPIO_T::INTEN: FLIEN3 Mask */ - -#define GPIO_INTEN_FLIEN4_Pos (4) /*!< GPIO_T::INTEN: FLIEN4 Position */ -#define GPIO_INTEN_FLIEN4_Msk (0x1ul << GPIO_INTEN_FLIEN4_Pos) /*!< GPIO_T::INTEN: FLIEN4 Mask */ - -#define GPIO_INTEN_FLIEN5_Pos (5) /*!< GPIO_T::INTEN: FLIEN5 Position */ -#define GPIO_INTEN_FLIEN5_Msk (0x1ul << GPIO_INTEN_FLIEN5_Pos) /*!< GPIO_T::INTEN: FLIEN5 Mask */ - -#define GPIO_INTEN_FLIEN6_Pos (6) /*!< GPIO_T::INTEN: FLIEN6 Position */ -#define GPIO_INTEN_FLIEN6_Msk (0x1ul << GPIO_INTEN_FLIEN6_Pos) /*!< GPIO_T::INTEN: FLIEN6 Mask */ - -#define GPIO_INTEN_FLIEN7_Pos (7) /*!< GPIO_T::INTEN: FLIEN7 Position */ -#define GPIO_INTEN_FLIEN7_Msk (0x1ul << GPIO_INTEN_FLIEN7_Pos) /*!< GPIO_T::INTEN: FLIEN7 Mask */ - -#define GPIO_INTEN_FLIEN8_Pos (8) /*!< GPIO_T::INTEN: FLIEN8 Position */ -#define GPIO_INTEN_FLIEN8_Msk (0x1ul << GPIO_INTEN_FLIEN8_Pos) /*!< GPIO_T::INTEN: FLIEN8 Mask */ - -#define GPIO_INTEN_FLIEN9_Pos (9) /*!< GPIO_T::INTEN: FLIEN9 Position */ -#define GPIO_INTEN_FLIEN9_Msk (0x1ul << GPIO_INTEN_FLIEN9_Pos) /*!< GPIO_T::INTEN: FLIEN9 Mask */ - -#define GPIO_INTEN_FLIEN10_Pos (10) /*!< GPIO_T::INTEN: FLIEN10 Position */ -#define GPIO_INTEN_FLIEN10_Msk (0x1ul << GPIO_INTEN_FLIEN10_Pos) /*!< GPIO_T::INTEN: FLIEN10 Mask */ - -#define GPIO_INTEN_FLIEN11_Pos (11) /*!< GPIO_T::INTEN: FLIEN11 Position */ -#define GPIO_INTEN_FLIEN11_Msk (0x1ul << GPIO_INTEN_FLIEN11_Pos) /*!< GPIO_T::INTEN: FLIEN11 Mask */ - -#define GPIO_INTEN_FLIEN12_Pos (12) /*!< GPIO_T::INTEN: FLIEN12 Position */ -#define GPIO_INTEN_FLIEN12_Msk (0x1ul << GPIO_INTEN_FLIEN12_Pos) /*!< GPIO_T::INTEN: FLIEN12 Mask */ - -#define GPIO_INTEN_FLIEN13_Pos (13) /*!< GPIO_T::INTEN: FLIEN13 Position */ -#define GPIO_INTEN_FLIEN13_Msk (0x1ul << GPIO_INTEN_FLIEN13_Pos) /*!< GPIO_T::INTEN: FLIEN13 Mask */ - -#define GPIO_INTEN_FLIEN14_Pos (14) /*!< GPIO_T::INTEN: FLIEN14 Position */ -#define GPIO_INTEN_FLIEN14_Msk (0x1ul << GPIO_INTEN_FLIEN14_Pos) /*!< GPIO_T::INTEN: FLIEN14 Mask */ - -#define GPIO_INTEN_FLIEN15_Pos (15) /*!< GPIO_T::INTEN: FLIEN15 Position */ -#define GPIO_INTEN_FLIEN15_Msk (0x1ul << GPIO_INTEN_FLIEN15_Pos) /*!< GPIO_T::INTEN: FLIEN15 Mask */ - -#define GPIO_INTEN_RHIEN0_Pos (16) /*!< GPIO_T::INTEN: RHIEN0 Position */ -#define GPIO_INTEN_RHIEN0_Msk (0x1ul << GPIO_INTEN_RHIEN0_Pos) /*!< GPIO_T::INTEN: RHIEN0 Mask */ - -#define GPIO_INTEN_RHIEN1_Pos (17) /*!< GPIO_T::INTEN: RHIEN1 Position */ -#define GPIO_INTEN_RHIEN1_Msk (0x1ul << GPIO_INTEN_RHIEN1_Pos) /*!< GPIO_T::INTEN: RHIEN1 Mask */ - -#define GPIO_INTEN_RHIEN2_Pos (18) /*!< GPIO_T::INTEN: RHIEN2 Position */ -#define GPIO_INTEN_RHIEN2_Msk (0x1ul << GPIO_INTEN_RHIEN2_Pos) /*!< GPIO_T::INTEN: RHIEN2 Mask */ - -#define GPIO_INTEN_RHIEN3_Pos (19) /*!< GPIO_T::INTEN: RHIEN3 Position */ -#define GPIO_INTEN_RHIEN3_Msk (0x1ul << GPIO_INTEN_RHIEN3_Pos) /*!< GPIO_T::INTEN: RHIEN3 Mask */ - -#define GPIO_INTEN_RHIEN4_Pos (20) /*!< GPIO_T::INTEN: RHIEN4 Position */ -#define GPIO_INTEN_RHIEN4_Msk (0x1ul << GPIO_INTEN_RHIEN4_Pos) /*!< GPIO_T::INTEN: RHIEN4 Mask */ - -#define GPIO_INTEN_RHIEN5_Pos (21) /*!< GPIO_T::INTEN: RHIEN5 Position */ -#define GPIO_INTEN_RHIEN5_Msk (0x1ul << GPIO_INTEN_RHIEN5_Pos) /*!< GPIO_T::INTEN: RHIEN5 Mask */ - -#define GPIO_INTEN_RHIEN6_Pos (22) /*!< GPIO_T::INTEN: RHIEN6 Position */ -#define GPIO_INTEN_RHIEN6_Msk (0x1ul << GPIO_INTEN_RHIEN6_Pos) /*!< GPIO_T::INTEN: RHIEN6 Mask */ - -#define GPIO_INTEN_RHIEN7_Pos (23) /*!< GPIO_T::INTEN: RHIEN7 Position */ -#define GPIO_INTEN_RHIEN7_Msk (0x1ul << GPIO_INTEN_RHIEN7_Pos) /*!< GPIO_T::INTEN: RHIEN7 Mask */ - -#define GPIO_INTEN_RHIEN8_Pos (24) /*!< GPIO_T::INTEN: RHIEN8 Position */ -#define GPIO_INTEN_RHIEN8_Msk (0x1ul << GPIO_INTEN_RHIEN8_Pos) /*!< GPIO_T::INTEN: RHIEN8 Mask */ - -#define GPIO_INTEN_RHIEN9_Pos (25) /*!< GPIO_T::INTEN: RHIEN9 Position */ -#define GPIO_INTEN_RHIEN9_Msk (0x1ul << GPIO_INTEN_RHIEN9_Pos) /*!< GPIO_T::INTEN: RHIEN9 Mask */ - -#define GPIO_INTEN_RHIEN10_Pos (26) /*!< GPIO_T::INTEN: RHIEN10 Position */ -#define GPIO_INTEN_RHIEN10_Msk (0x1ul << GPIO_INTEN_RHIEN10_Pos) /*!< GPIO_T::INTEN: RHIEN10 Mask */ - -#define GPIO_INTEN_RHIEN11_Pos (27) /*!< GPIO_T::INTEN: RHIEN11 Position */ -#define GPIO_INTEN_RHIEN11_Msk (0x1ul << GPIO_INTEN_RHIEN11_Pos) /*!< GPIO_T::INTEN: RHIEN11 Mask */ - -#define GPIO_INTEN_RHIEN12_Pos (28) /*!< GPIO_T::INTEN: RHIEN12 Position */ -#define GPIO_INTEN_RHIEN12_Msk (0x1ul << GPIO_INTEN_RHIEN12_Pos) /*!< GPIO_T::INTEN: RHIEN12 Mask */ - -#define GPIO_INTEN_RHIEN13_Pos (29) /*!< GPIO_T::INTEN: RHIEN13 Position */ -#define GPIO_INTEN_RHIEN13_Msk (0x1ul << GPIO_INTEN_RHIEN13_Pos) /*!< GPIO_T::INTEN: RHIEN13 Mask */ - -#define GPIO_INTEN_RHIEN14_Pos (30) /*!< GPIO_T::INTEN: RHIEN14 Position */ -#define GPIO_INTEN_RHIEN14_Msk (0x1ul << GPIO_INTEN_RHIEN14_Pos) /*!< GPIO_T::INTEN: RHIEN14 Mask */ - -#define GPIO_INTEN_RHIEN15_Pos (31) /*!< GPIO_T::INTEN: RHIEN15 Position */ -#define GPIO_INTEN_RHIEN15_Msk (0x1ul << GPIO_INTEN_RHIEN15_Pos) /*!< GPIO_T::INTEN: RHIEN15 Mask */ - -#define GPIO_INTSRC_INTSRC0_Pos (0) /*!< GPIO_T::INTSRC: INTSRC0 Position */ -#define GPIO_INTSRC_INTSRC0_Msk (0x1ul << GPIO_INTSRC_INTSRC0_Pos) /*!< GPIO_T::INTSRC: INTSRC0 Mask */ - -#define GPIO_INTSRC_INTSRC1_Pos (1) /*!< GPIO_T::INTSRC: INTSRC1 Position */ -#define GPIO_INTSRC_INTSRC1_Msk (0x1ul << GPIO_INTSRC_INTSRC1_Pos) /*!< GPIO_T::INTSRC: INTSRC1 Mask */ - -#define GPIO_INTSRC_INTSRC2_Pos (2) /*!< GPIO_T::INTSRC: INTSRC2 Position */ -#define GPIO_INTSRC_INTSRC2_Msk (0x1ul << GPIO_INTSRC_INTSRC2_Pos) /*!< GPIO_T::INTSRC: INTSRC2 Mask */ - -#define GPIO_INTSRC_INTSRC3_Pos (3) /*!< GPIO_T::INTSRC: INTSRC3 Position */ -#define GPIO_INTSRC_INTSRC3_Msk (0x1ul << GPIO_INTSRC_INTSRC3_Pos) /*!< GPIO_T::INTSRC: INTSRC3 Mask */ - -#define GPIO_INTSRC_INTSRC4_Pos (4) /*!< GPIO_T::INTSRC: INTSRC4 Position */ -#define GPIO_INTSRC_INTSRC4_Msk (0x1ul << GPIO_INTSRC_INTSRC4_Pos) /*!< GPIO_T::INTSRC: INTSRC4 Mask */ - -#define GPIO_INTSRC_INTSRC5_Pos (5) /*!< GPIO_T::INTSRC: INTSRC5 Position */ -#define GPIO_INTSRC_INTSRC5_Msk (0x1ul << GPIO_INTSRC_INTSRC5_Pos) /*!< GPIO_T::INTSRC: INTSRC5 Mask */ - -#define GPIO_INTSRC_INTSRC6_Pos (6) /*!< GPIO_T::INTSRC: INTSRC6 Position */ -#define GPIO_INTSRC_INTSRC6_Msk (0x1ul << GPIO_INTSRC_INTSRC6_Pos) /*!< GPIO_T::INTSRC: INTSRC6 Mask */ - -#define GPIO_INTSRC_INTSRC7_Pos (7) /*!< GPIO_T::INTSRC: INTSRC7 Position */ -#define GPIO_INTSRC_INTSRC7_Msk (0x1ul << GPIO_INTSRC_INTSRC7_Pos) /*!< GPIO_T::INTSRC: INTSRC7 Mask */ - -#define GPIO_INTSRC_INTSRC8_Pos (8) /*!< GPIO_T::INTSRC: INTSRC8 Position */ -#define GPIO_INTSRC_INTSRC8_Msk (0x1ul << GPIO_INTSRC_INTSRC8_Pos) /*!< GPIO_T::INTSRC: INTSRC8 Mask */ - -#define GPIO_INTSRC_INTSRC9_Pos (9) /*!< GPIO_T::INTSRC: INTSRC9 Position */ -#define GPIO_INTSRC_INTSRC9_Msk (0x1ul << GPIO_INTSRC_INTSRC9_Pos) /*!< GPIO_T::INTSRC: INTSRC9 Mask */ - -#define GPIO_INTSRC_INTSRC10_Pos (10) /*!< GPIO_T::INTSRC: INTSRC10 Position */ -#define GPIO_INTSRC_INTSRC10_Msk (0x1ul << GPIO_INTSRC_INTSRC10_Pos) /*!< GPIO_T::INTSRC: INTSRC10 Mask */ - -#define GPIO_INTSRC_INTSRC11_Pos (11) /*!< GPIO_T::INTSRC: INTSRC11 Position */ -#define GPIO_INTSRC_INTSRC11_Msk (0x1ul << GPIO_INTSRC_INTSRC11_Pos) /*!< GPIO_T::INTSRC: INTSRC11 Mask */ - -#define GPIO_INTSRC_INTSRC12_Pos (12) /*!< GPIO_T::INTSRC: INTSRC12 Position */ -#define GPIO_INTSRC_INTSRC12_Msk (0x1ul << GPIO_INTSRC_INTSRC12_Pos) /*!< GPIO_T::INTSRC: INTSRC12 Mask */ - -#define GPIO_INTSRC_INTSRC13_Pos (13) /*!< GPIO_T::INTSRC: INTSRC13 Position */ -#define GPIO_INTSRC_INTSRC13_Msk (0x1ul << GPIO_INTSRC_INTSRC13_Pos) /*!< GPIO_T::INTSRC: INTSRC13 Mask */ - -#define GPIO_INTSRC_INTSRC14_Pos (14) /*!< GPIO_T::INTSRC: INTSRC14 Position */ -#define GPIO_INTSRC_INTSRC14_Msk (0x1ul << GPIO_INTSRC_INTSRC14_Pos) /*!< GPIO_T::INTSRC: INTSRC14 Mask */ - -#define GPIO_INTSRC_INTSRC15_Pos (15) /*!< GPIO_T::INTSRC: INTSRC15 Position */ -#define GPIO_INTSRC_INTSRC15_Msk (0x1ul << GPIO_INTSRC_INTSRC15_Pos) /*!< GPIO_T::INTSRC: INTSRC15 Mask */ - -#define GPIO_SMTEN_SMTEN0_Pos (0) /*!< GPIO_T::SMTEN: SMTEN0 Position */ -#define GPIO_SMTEN_SMTEN0_Msk (0x1ul << GPIO_SMTEN_SMTEN0_Pos) /*!< GPIO_T::SMTEN: SMTEN0 Mask */ - -#define GPIO_SMTEN_SMTEN1_Pos (1) /*!< GPIO_T::SMTEN: SMTEN1 Position */ -#define GPIO_SMTEN_SMTEN1_Msk (0x1ul << GPIO_SMTEN_SMTEN1_Pos) /*!< GPIO_T::SMTEN: SMTEN1 Mask */ - -#define GPIO_SMTEN_SMTEN2_Pos (2) /*!< GPIO_T::SMTEN: SMTEN2 Position */ -#define GPIO_SMTEN_SMTEN2_Msk (0x1ul << GPIO_SMTEN_SMTEN2_Pos) /*!< GPIO_T::SMTEN: SMTEN2 Mask */ - -#define GPIO_SMTEN_SMTEN3_Pos (3) /*!< GPIO_T::SMTEN: SMTEN3 Position */ -#define GPIO_SMTEN_SMTEN3_Msk (0x1ul << GPIO_SMTEN_SMTEN3_Pos) /*!< GPIO_T::SMTEN: SMTEN3 Mask */ - -#define GPIO_SMTEN_SMTEN4_Pos (4) /*!< GPIO_T::SMTEN: SMTEN4 Position */ -#define GPIO_SMTEN_SMTEN4_Msk (0x1ul << GPIO_SMTEN_SMTEN4_Pos) /*!< GPIO_T::SMTEN: SMTEN4 Mask */ - -#define GPIO_SMTEN_SMTEN5_Pos (5) /*!< GPIO_T::SMTEN: SMTEN5 Position */ -#define GPIO_SMTEN_SMTEN5_Msk (0x1ul << GPIO_SMTEN_SMTEN5_Pos) /*!< GPIO_T::SMTEN: SMTEN5 Mask */ - -#define GPIO_SMTEN_SMTEN6_Pos (6) /*!< GPIO_T::SMTEN: SMTEN6 Position */ -#define GPIO_SMTEN_SMTEN6_Msk (0x1ul << GPIO_SMTEN_SMTEN6_Pos) /*!< GPIO_T::SMTEN: SMTEN6 Mask */ - -#define GPIO_SMTEN_SMTEN7_Pos (7) /*!< GPIO_T::SMTEN: SMTEN7 Position */ -#define GPIO_SMTEN_SMTEN7_Msk (0x1ul << GPIO_SMTEN_SMTEN7_Pos) /*!< GPIO_T::SMTEN: SMTEN7 Mask */ - -#define GPIO_SMTEN_SMTEN8_Pos (8) /*!< GPIO_T::SMTEN: SMTEN8 Position */ -#define GPIO_SMTEN_SMTEN8_Msk (0x1ul << GPIO_SMTEN_SMTEN8_Pos) /*!< GPIO_T::SMTEN: SMTEN8 Mask */ - -#define GPIO_SMTEN_SMTEN9_Pos (9) /*!< GPIO_T::SMTEN: SMTEN9 Position */ -#define GPIO_SMTEN_SMTEN9_Msk (0x1ul << GPIO_SMTEN_SMTEN9_Pos) /*!< GPIO_T::SMTEN: SMTEN9 Mask */ - -#define GPIO_SMTEN_SMTEN10_Pos (10) /*!< GPIO_T::SMTEN: SMTEN10 Position */ -#define GPIO_SMTEN_SMTEN10_Msk (0x1ul << GPIO_SMTEN_SMTEN10_Pos) /*!< GPIO_T::SMTEN: SMTEN10 Mask */ - -#define GPIO_SMTEN_SMTEN11_Pos (11) /*!< GPIO_T::SMTEN: SMTEN11 Position */ -#define GPIO_SMTEN_SMTEN11_Msk (0x1ul << GPIO_SMTEN_SMTEN11_Pos) /*!< GPIO_T::SMTEN: SMTEN11 Mask */ - -#define GPIO_SMTEN_SMTEN12_Pos (12) /*!< GPIO_T::SMTEN: SMTEN12 Position */ -#define GPIO_SMTEN_SMTEN12_Msk (0x1ul << GPIO_SMTEN_SMTEN12_Pos) /*!< GPIO_T::SMTEN: SMTEN12 Mask */ - -#define GPIO_SMTEN_SMTEN13_Pos (13) /*!< GPIO_T::SMTEN: SMTEN13 Position */ -#define GPIO_SMTEN_SMTEN13_Msk (0x1ul << GPIO_SMTEN_SMTEN13_Pos) /*!< GPIO_T::SMTEN: SMTEN13 Mask */ - -#define GPIO_SMTEN_SMTEN14_Pos (14) /*!< GPIO_T::SMTEN: SMTEN14 Position */ -#define GPIO_SMTEN_SMTEN14_Msk (0x1ul << GPIO_SMTEN_SMTEN14_Pos) /*!< GPIO_T::SMTEN: SMTEN14 Mask */ - -#define GPIO_SMTEN_SMTEN15_Pos (15) /*!< GPIO_T::SMTEN: SMTEN15 Position */ -#define GPIO_SMTEN_SMTEN15_Msk (0x1ul << GPIO_SMTEN_SMTEN15_Pos) /*!< GPIO_T::SMTEN: SMTEN15 Mask */ - -#define GPIO_SLEWCTL_HSREN0_Pos (0) /*!< GPIO_T::SLEWCTL: HSREN0 Position */ -#define GPIO_SLEWCTL_HSREN0_Msk (0x3ul << GPIO_SLEWCTL_HSREN0_Pos) /*!< GPIO_T::SLEWCTL: HSREN0 Mask */ - -#define GPIO_SLEWCTL_HSREN1_Pos (2) /*!< GPIO_T::SLEWCTL: HSREN1 Position */ -#define GPIO_SLEWCTL_HSREN1_Msk (0x3ul << GPIO_SLEWCTL_HSREN1_Pos) /*!< GPIO_T::SLEWCTL: HSREN1 Mask */ - -#define GPIO_SLEWCTL_HSREN2_Pos (4) /*!< GPIO_T::SLEWCTL: HSREN2 Position */ -#define GPIO_SLEWCTL_HSREN2_Msk (0x3ul << GPIO_SLEWCTL_HSREN2_Pos) /*!< GPIO_T::SLEWCTL: HSREN2 Mask */ - -#define GPIO_SLEWCTL_HSREN3_Pos (6) /*!< GPIO_T::SLEWCTL: HSREN3 Position */ -#define GPIO_SLEWCTL_HSREN3_Msk (0x3ul << GPIO_SLEWCTL_HSREN3_Pos) /*!< GPIO_T::SLEWCTL: HSREN3 Mask */ - -#define GPIO_SLEWCTL_HSREN4_Pos (8) /*!< GPIO_T::SLEWCTL: HSREN4 Position */ -#define GPIO_SLEWCTL_HSREN4_Msk (0x3ul << GPIO_SLEWCTL_HSREN4_Pos) /*!< GPIO_T::SLEWCTL: HSREN4 Mask */ - -#define GPIO_SLEWCTL_HSREN5_Pos (10) /*!< GPIO_T::SLEWCTL: HSREN5 Position */ -#define GPIO_SLEWCTL_HSREN5_Msk (0x3ul << GPIO_SLEWCTL_HSREN5_Pos) /*!< GPIO_T::SLEWCTL: HSREN5 Mask */ - -#define GPIO_SLEWCTL_HSREN6_Pos (12) /*!< GPIO_T::SLEWCTL: HSREN6 Position */ -#define GPIO_SLEWCTL_HSREN6_Msk (0x3ul << GPIO_SLEWCTL_HSREN6_Pos) /*!< GPIO_T::SLEWCTL: HSREN6 Mask */ - -#define GPIO_SLEWCTL_HSREN7_Pos (14) /*!< GPIO_T::SLEWCTL: HSREN7 Position */ -#define GPIO_SLEWCTL_HSREN7_Msk (0x3ul << GPIO_SLEWCTL_HSREN7_Pos) /*!< GPIO_T::SLEWCTL: HSREN7 Mask */ - -#define GPIO_SLEWCTL_HSREN8_Pos (16) /*!< GPIO_T::SLEWCTL: HSREN8 Position */ -#define GPIO_SLEWCTL_HSREN8_Msk (0x3ul << GPIO_SLEWCTL_HSREN8_Pos) /*!< GPIO_T::SLEWCTL: HSREN8 Mask */ - -#define GPIO_SLEWCTL_HSREN9_Pos (18) /*!< GPIO_T::SLEWCTL: HSREN9 Position */ -#define GPIO_SLEWCTL_HSREN9_Msk (0x3ul << GPIO_SLEWCTL_HSREN9_Pos) /*!< GPIO_T::SLEWCTL: HSREN9 Mask */ - -#define GPIO_SLEWCTL_HSREN10_Pos (20) /*!< GPIO_T::SLEWCTL: HSREN10 Position */ -#define GPIO_SLEWCTL_HSREN10_Msk (0x3ul << GPIO_SLEWCTL_HSREN10_Pos) /*!< GPIO_T::SLEWCTL: HSREN10 Mask */ - -#define GPIO_SLEWCTL_HSREN11_Pos (22) /*!< GPIO_T::SLEWCTL: HSREN11 Position */ -#define GPIO_SLEWCTL_HSREN11_Msk (0x3ul << GPIO_SLEWCTL_HSREN11_Pos) /*!< GPIO_T::SLEWCTL: HSREN11 Mask */ - -#define GPIO_SLEWCTL_HSREN12_Pos (24) /*!< GPIO_T::SLEWCTL: HSREN12 Position */ -#define GPIO_SLEWCTL_HSREN12_Msk (0x3ul << GPIO_SLEWCTL_HSREN12_Pos) /*!< GPIO_T::SLEWCTL: HSREN12 Mask */ - -#define GPIO_SLEWCTL_HSREN13_Pos (26) /*!< GPIO_T::SLEWCTL: HSREN13 Position */ -#define GPIO_SLEWCTL_HSREN13_Msk (0x3ul << GPIO_SLEWCTL_HSREN13_Pos) /*!< GPIO_T::SLEWCTL: HSREN13 Mask */ - -#define GPIO_SLEWCTL_HSREN14_Pos (28) /*!< GPIO_T::SLEWCTL: HSREN14 Position */ -#define GPIO_SLEWCTL_HSREN14_Msk (0x3ul << GPIO_SLEWCTL_HSREN14_Pos) /*!< GPIO_T::SLEWCTL: HSREN14 Mask */ - -#define GPIO_SLEWCTL_HSREN15_Pos (30) /*!< GPIO_T::SLEWCTL: HSREN15 Position */ -#define GPIO_SLEWCTL_HSREN15_Msk (0x3ul << GPIO_SLEWCTL_HSREN15_Pos) /*!< GPIO_T::SLEWCTL: HSREN15 Mask */ - -#define GPIO_PUSEL_PUSEL0_Pos (0) /*!< GPIO_T::PUSEL: PUSEL0 Position */ -#define GPIO_PUSEL_PUSEL0_Msk (0x3ul << GPIO_PUSEL_PUSEL0_Pos) /*!< GPIO_T::PUSEL: PUSEL0 Mask */ - -#define GPIO_PUSEL_PUSEL1_Pos (2) /*!< GPIO_T::PUSEL: PUSEL1 Position */ -#define GPIO_PUSEL_PUSEL1_Msk (0x3ul << GPIO_PUSEL_PUSEL1_Pos) /*!< GPIO_T::PUSEL: PUSEL1 Mask */ - -#define GPIO_PUSEL_PUSEL2_Pos (4) /*!< GPIO_T::PUSEL: PUSEL2 Position */ -#define GPIO_PUSEL_PUSEL2_Msk (0x3ul << GPIO_PUSEL_PUSEL2_Pos) /*!< GPIO_T::PUSEL: PUSEL2 Mask */ - -#define GPIO_PUSEL_PUSEL3_Pos (6) /*!< GPIO_T::PUSEL: PUSEL3 Position */ -#define GPIO_PUSEL_PUSEL3_Msk (0x3ul << GPIO_PUSEL_PUSEL3_Pos) /*!< GPIO_T::PUSEL: PUSEL3 Mask */ - -#define GPIO_PUSEL_PUSEL4_Pos (8) /*!< GPIO_T::PUSEL: PUSEL4 Position */ -#define GPIO_PUSEL_PUSEL4_Msk (0x3ul << GPIO_PUSEL_PUSEL4_Pos) /*!< GPIO_T::PUSEL: PUSEL4 Mask */ - -#define GPIO_PUSEL_PUSEL5_Pos (10) /*!< GPIO_T::PUSEL: PUSEL5 Position */ -#define GPIO_PUSEL_PUSEL5_Msk (0x3ul << GPIO_PUSEL_PUSEL5_Pos) /*!< GPIO_T::PUSEL: PUSEL5 Mask */ - -#define GPIO_PUSEL_PUSEL6_Pos (12) /*!< GPIO_T::PUSEL: PUSEL6 Position */ -#define GPIO_PUSEL_PUSEL6_Msk (0x3ul << GPIO_PUSEL_PUSEL6_Pos) /*!< GPIO_T::PUSEL: PUSEL6 Mask */ - -#define GPIO_PUSEL_PUSEL7_Pos (14) /*!< GPIO_T::PUSEL: PUSEL7 Position */ -#define GPIO_PUSEL_PUSEL7_Msk (0x3ul << GPIO_PUSEL_PUSEL7_Pos) /*!< GPIO_T::PUSEL: PUSEL7 Mask */ - -#define GPIO_PUSEL_PUSEL8_Pos (16) /*!< GPIO_T::PUSEL: PUSEL8 Position */ -#define GPIO_PUSEL_PUSEL8_Msk (0x3ul << GPIO_PUSEL_PUSEL8_Pos) /*!< GPIO_T::PUSEL: PUSEL8 Mask */ - -#define GPIO_PUSEL_PUSEL9_Pos (18) /*!< GPIO_T::PUSEL: PUSEL9 Position */ -#define GPIO_PUSEL_PUSEL9_Msk (0x3ul << GPIO_PUSEL_PUSEL9_Pos) /*!< GPIO_T::PUSEL: PUSEL9 Mask */ - -#define GPIO_PUSEL_PUSEL10_Pos (20) /*!< GPIO_T::PUSEL: PUSEL10 Position */ -#define GPIO_PUSEL_PUSEL10_Msk (0x3ul << GPIO_PUSEL_PUSEL10_Pos) /*!< GPIO_T::PUSEL: PUSEL10 Mask */ - -#define GPIO_PUSEL_PUSEL11_Pos (22) /*!< GPIO_T::PUSEL: PUSEL11 Position */ -#define GPIO_PUSEL_PUSEL11_Msk (0x3ul << GPIO_PUSEL_PUSEL11_Pos) /*!< GPIO_T::PUSEL: PUSEL11 Mask */ - -#define GPIO_PUSEL_PUSEL12_Pos (24) /*!< GPIO_T::PUSEL: PUSEL12 Position */ -#define GPIO_PUSEL_PUSEL12_Msk (0x3ul << GPIO_PUSEL_PUSEL12_Pos) /*!< GPIO_T::PUSEL: PUSEL12 Mask */ - -#define GPIO_PUSEL_PUSEL13_Pos (26) /*!< GPIO_T::PUSEL: PUSEL13 Position */ -#define GPIO_PUSEL_PUSEL13_Msk (0x3ul << GPIO_PUSEL_PUSEL13_Pos) /*!< GPIO_T::PUSEL: PUSEL13 Mask */ - -#define GPIO_PUSEL_PUSEL14_Pos (28) /*!< GPIO_T::PUSEL: PUSEL14 Position */ -#define GPIO_PUSEL_PUSEL14_Msk (0x3ul << GPIO_PUSEL_PUSEL14_Pos) /*!< GPIO_T::PUSEL: PUSEL14 Mask */ - -#define GPIO_PUSEL_PUSEL15_Pos (30) /*!< GPIO_T::PUSEL: PUSEL15 Position */ -#define GPIO_PUSEL_PUSEL15_Msk (0x3ul << GPIO_PUSEL_PUSEL15_Pos) /*!< GPIO_T::PUSEL: PUSEL15 Mask */ - -#define GPIO_DBCTL_DBCLKSEL_Pos (0) /*!< GPIO_T::DBCTL: DBCLKSEL Position */ -#define GPIO_DBCTL_DBCLKSEL_Msk (0xFul << GPIO_DBCTL_DBCLKSEL_Pos) /*!< GPIO_T::DBCTL: DBCLKSEL Mask */ - -#define GPIO_DBCTL_DBCLKSRC_Pos (4) /*!< GPIO_T::DBCTL: DBCLKSRC Position */ -#define GPIO_DBCTL_DBCLKSRC_Msk (1ul << GPIO_DBCTL_DBCLKSRC_Pos) /*!< GPIO_T::DBCTL: DBCLKSRC Mask */ - -#define GPIO_DBCTL_ICLKON_Pos (5) /*!< GPIO_T::DBCTL: ICLKON Position */ -#define GPIO_DBCTL_ICLKON_Msk (1ul << GPIO_DBCTL_ICLKON_Pos) /*!< GPIO_T::DBCTL: ICLKON Mask */ - -/**@}*/ /* GPIO_CONST */ -/**@}*/ /* end of GPIO register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __GPIO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsotg_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsotg_reg.h deleted file mode 100644 index 52c6a434155..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsotg_reg.h +++ /dev/null @@ -1,398 +0,0 @@ -/**************************************************************************//** - * @file hsotg_reg.h - * @version V1.00 - * @brief HSOTG register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HSOTG_REG_H__ -#define __HSOTG_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup HSOTG High Speed USB On-The-Go Controller(HSOTG) - Memory Mapped Structure for HSOTG Controller -@{ */ - -typedef struct -{ - - - /** - * @var HSOTG_T::CTL - * Offset: 0x00 HSOTG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDROP |Drop VBUS Control - * | | |If user application running on this OTG A-device wants to conserve power, set this bit to drop VBUS - * | | |BUSREQ (OTG_CTL[1]) will be also cleared no matter A-device or B-device. - * | | |0 = Not drop the VBUS. - * | | |1 = Drop the VBUS. - * |[1] |BUSREQ |OTG Bus Request - * | | |If OTG A-device wants to do data transfers via USB bus, setting this bit will drive VBUS high to detect USB device connection - * | | |If user won't use the bus any more, clearing this bit will drop VBUS to save power - * | | |This bit will be cleared when A-device goes to A_wait_vfall state - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set or IDSTS (OTG_STATUS[1]) changed. - * | | |If user of an OTG-B Device wants to request VBUS, setting this bit will run SRP protocol - * | | |This bit will be cleared if SRP failure (OTG A-device does not provide VBUS after B-device issues ARP in specified interval, defined in OTG specification) - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set IDSTS (OTG_STATUS[1]) changed. - * | | |0 = Not launch VBUS in OTG A-device or not request SRP in OTG B-device. - * | | |1 = Launch VBUS in OTG A-device or request SRP in OTG B-device. - * |[2] |HNPREQEN |OTG HNP Request Enable Bit - * | | |When USB frame as A-device, set this bit when A-device allows to process HNP protocol -- A-device changes role from Host to Peripheral - * | | |This bit will be cleared when OTG state changes from a_suspend to a_peripheral or goes back to a_idle state - * | | |When USB frame as B-device, set this bit after the OTG A-device successfully sends a SetFeature (b_hnp_enable) command to the OTG B-device to start role change -- B-device changes role from Peripheral to Host - * | | |This bit will be cleared when OTG state changes from b_peripheral to b_wait_acon or goes back to b_idle state. - * | | |0 = HNP request Disabled. - * | | |1 = HNP request Enabled (A-device can change role from Host to Peripheral or B-device can change role from Peripheral to Host). - * | | |Note: Refer to OTG specification to get a_suspend, a_peripheral, a_idle and b_idle state. - * |[4] |OTGEN |OTG Function Enable Bit - * | | |User needs to set this bit to enable OTG function while USB frame configured as OTG device - * | | |When USB frame not configured as OTG device, this bit is must be low. - * | | |0= OTG function Disabled. - * | | |1 = OTG function Enabled. - * |[5] |WKEN |OTG ID Pin Wake-up Enable Bit - * | | |0 = OTG ID pin status change wake-up function Disabled. - * | | |1 = OTG ID pin status change wake-up function Enabled. - * @var HSOTG_T::PHYCTL - * Offset: 0x04 HSOTG PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OTGPHYEN |OTG PHY Enable - * | | |When USB frame is configured as OTG-device or ID-dependent, user needs to set this bit before using OTG function - * | | |If device is not configured as OTG-device nor ID-dependent, this bit is "don't care". - * | | |0 = OTG PHY Disabled. - * | | |1 = OTG PHY Enabled. - * |[1] |IDDETEN |ID Detection Enable Bit - * | | |0 = Detect ID pin status Disabled. - * | | |1 = Detect ID pin status Enabled. - * |[4] |VBENPOL |Off-chip USB VBUS Power Switch Enable Polarity - * | | |The OTG controller will enable off-chip USB VBUS power switch to provide VBUS power when need - * | | |A USB_VBUS_EN pin is used to control the off-chip USB VBUS power switch. - * | | |The polarity of enabling off-chip USB VBUS power switch (high active or low active) depends on the selected component - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The off-chip USB VBUS power switch enable is active high. - * | | |1 = The off-chip USB VBUS power switch enable is active low. - * |[5] |VBSTSPOL |Off-chip USB VBUS Power Switch Status Polarity - * | | |The polarity of off-chip USB VBUS power switch valid signal depends on the selected component - * | | |A USB_VBUS_ST pin is used to monitor the valid signal of the off-chip USB VBUS power switch - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The polarity of off-chip USB VBUS power switch valid status is high. - * | | |1 = The polarity of off-chip USB VBUS power switch valid status is low. - * @var HSOTG_T::INTEN - * Offset: 0x08 HSOTG Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIEN|Role (Host or Peripheral) Changed Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[1] |VBEIEN |VBUS Error Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: VBUS error means going to a_vbus_err state. Please refer to A-device state diagram in OTG spec. - * |[2] |SRPFIEN |SRP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[3] |HNPFIEN |HNP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[4] |GOIDLEIEN |OTG Device Goes to IDLE State Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Going to idle state means going to a_idle or b_idle state - * | | |Please refer to A-device state diagram and B-device state diagram in OTG spec. - * |[5] |IDCHGIEN |IDSTS Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and IDSTS (OTG_STATUS[1]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[6] |PDEVIEN |Act As Peripheral Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a peripheral, a interrupt will be asserted. - * | | |0 = This device as a peripheral interrupt Disabled. - * | | |1 = This device as a peripheral interrupt Enabled. - * |[7] |HOSTIEN |Act As Host Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a host, a interrupt will be asserted. - * | | |0 = This device as a host interrupt Disabled. - * | | |1 = This device as a host interrupt Enabled. - * |[8] |BVLDCHGIEN|B-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and BVLD (OTG_STATUS[3]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[9] |AVLDCHGIEN|A-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and AVLD (OTG_STATUS[4]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[10] |VBCHGIEN |VBUSVLD Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and VBUSVLD (OTG_STATUS[5]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[11] |SECHGIEN |SESSEND Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and SESSEND (OTG_STATUS[2]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[13] |SRPDETIEN |SRP Detected Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * @var HSOTG_T::INTSTS - * Offset: 0x0C HSOTG Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIF |OTG Role Change Interrupt Status - * | | |This flag is set when the role of an OTG device changed from a host to a peripheral, or changed from a peripheral to a host while USB_ID pin status does not change. - * | | |0 = OTG device role not changed. - * | | |1 = OTG device role changed. - * | | |Note: Write 1 to clear this flag. - * |[1] |VBEIF |VBUS Error Interrupt Status - * | | |This bit will be set when voltage on VBUS cannot reach a minimum valid threshold 4.4V within a maximum time of 100ms after OTG A-device starting to drive VBUS high. - * | | |0 = OTG A-device drives VBUS over threshold voltage before this interval expires. - * | | |1 = OTG A-device cannot drive VBUS over threshold voltage before this interval expires. - * | | |Note: Write 1 to clear this flag and recover from the VBUS error state. - * |[2] |SRPFIF |SRP Fail Interrupt Status - * | | |After initiating SRP, an OTG B-device will wait for the OTG A-device to drive VBUS high at least TB_SRP_FAIL minimum, defined in OTG specification - * | | |This flag is set when the OTG B-device does not get VBUS high after this interval. - * | | |0 = OTG B-device gets VBUS high before this interval. - * | | |1 = OTG B-device does not get VBUS high before this interval. - * | | |Note: Write 1 to clear this flag. - * |[3] |HNPFIF |HNP Fail Interrupt Status - * | | |When A-device has granted B-device to be host and USB bus is in SE0 (both USB_D+ and USB_D- low) state, this bit will be set when A-device does not connect after specified interval expires. - * | | |0 = A-device connects to B-device before specified interval expires. - * | | |1 = A-device does not connect to B-device before specified interval expires. - * | | |Note: Write 1 to clear this flag. - * |[4] |GOIDLEIF |OTG Device Goes to IDLE Interrupt Status - * | | |Flag is set if the OTG device transfers from non-idle state to idle state - * | | |The OTG device will be neither a host nor a peripheral. - * | | |0 = OTG device does not go back to idle state (a_idle or b_idle). - * | | |1 = OTG device goes back to idle state(a_idle or b_idle). - * | | |Note 1: Going to idle state means going to a_idle or b_idle state. Please refer to OTG specification. - * | | |Note 2: Write 1 to clear this flag. - * |[5] |IDCHGIF |ID State Change Interrupt Status - * | | |0 = IDSTS (OTG_STATUS[1]) not toggled. - * | | |1 = IDSTS (OTG_STATUS[1]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[6] |PDEVIF |Act As Peripheral Interrupt Status - * | | |0= This device does not act as a peripheral. - * | | |1 = This device acts as a peripheral. - * | | |Note: Write 1 to clear this flag. - * |[7] |HOSTIF |Act As Host Interrupt Status - * | | |0= This device does not act as a host. - * | | |1 = This device acts as a host. - * | | |Note: Write 1 to clear this flag. - * |[8] |BVLDCHGIF |B-device Session Valid State Change Interrupt Status - * | | |0 = BVLD (OTG_STATUS[3]) is not toggled. - * | | |1 = BVLD (OTG_STATUS[3]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[9] |AVLDCHGIF |A-device Session Valid State Change Interrupt Status - * | | |0 = AVLD (OTG_STATUS[4]) not toggled. - * | | |1 = AVLD (OTG_STATUS[4]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[10] |VBCHGIF |VBUSVLD State Change Interrupt Status - * | | |0 = VBUSVLD (OTG_STATUS[5]) not toggled. - * | | |1 = VBUSVLD (OTG_STATUS[5]) from high to low or from low to high. - * | | |Note: Write 1 to clear this status. - * |[11] |SECHGIF |SESSEND State Change Interrupt Status - * | | |0 = SESSEND (OTG_STATUS[2]) not toggled. - * | | |1 = SESSEND (OTG_STATUS[2]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[13] |SRPDETIF |SRP Detected Interrupt Status - * | | |0 = SRP not detected. - * | | |1 = SRP detected. - * | | |Note: Write 1 to clear this status. - * @var HSOTG_T::STATUS - * Offset: 0x10 HSOTG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OVERCUR |over Current Condition - * | | |The voltage on VBUS cannot reach a minimum VBUS valid threshold, 4.4V minimum, within a maximum time of 100ms after OTG A-device drives VBUS high. - * | | |0 = OTG A-device drives VBUS successfully. - * | | |1 = OTG A-device cannot drives VBUS high in this interval. - * |[1] |IDSTS |USB_ID Pin State of Mini-b/Micro-plug - * | | |0 = Mini-A/Micro-A plug is attached. - * | | |1 = Mini-B/Micro-B plug is attached. - * |[2] |SESSEND |Session End Status - * | | |When VBUS voltage is lower than 0.4V, this bit will be set to 1 - * | | |Session end means no meaningful power on VBUS. - * | | |0 = Session is not end. - * | | |1 = Session is end. - * |[3] |BVLD |B-device Session Valid Status - * | | |0 = B-device session is not valid. - * | | |1 = B-device session is valid. - * |[4] |AVLD |A-device Session Valid Status - * | | |0 = A-device session is not valid. - * | | |1 = A-device session is valid. - * |[5] |VBUSVLD |VBUS Valid Status - * | | |When VBUS is larger than 4.7V and A-device drives VBUS , this bit will be set to 1. - * | | |0 = VBUS is not valid. - * | | |1 = VBUS is valid. - * |[6] |ASPERI |As Peripheral Status - * | | |When OTG as peripheral, this bit is set. - * | | |0: OTG not as peripheral - * | | |1: OTG as peripheral - * |[7] |ASHOST |As Host Status - * | | |When OTG as Host, this bit is set. - * | | |0: OTG not as Host - * | | |1: OTG as Host - */ - __IO uint32_t CTL; /*!< [0x0000] HSOTG Control Register */ - __IO uint32_t PHYCTL; /*!< [0x0004] HSOTG PHY Control Register */ - __IO uint32_t INTEN; /*!< [0x0008] HSOTG Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x000c] HSOTG Interrupt Status Register */ - __I uint32_t STATUS; /*!< [0x0010] HSOTG Status Register */ - -} HSOTG_T; - -/** - @addtogroup HSOTG_CONST HSOTG Bit Field Definition - Constant Definitions for HSOTG Controller -@{ */ - -#define HSOTG_CTL_VBUSDROP_Pos (0) /*!< HSOTG_T::CTL: VBUSDROP Position */ -#define HSOTG_CTL_VBUSDROP_Msk (0x1ul << HSOTG_CTL_VBUSDROP_Pos) /*!< HSOTG_T::CTL: VBUSDROP Mask */ - -#define HSOTG_CTL_BUSREQ_Pos (1) /*!< HSOTG_T::CTL: BUSREQ Position */ -#define HSOTG_CTL_BUSREQ_Msk (0x1ul << HSOTG_CTL_BUSREQ_Pos) /*!< HSOTG_T::CTL: BUSREQ Mask */ - -#define HSOTG_CTL_HNPREQEN_Pos (2) /*!< HSOTG_T::CTL: HNPREQEN Position */ -#define HSOTG_CTL_HNPREQEN_Msk (0x1ul << HSOTG_CTL_HNPREQEN_Pos) /*!< HSOTG_T::CTL: HNPREQEN Mask */ - -#define HSOTG_CTL_OTGEN_Pos (4) /*!< HSOTG_T::CTL: OTGEN Position */ -#define HSOTG_CTL_OTGEN_Msk (0x1ul << HSOTG_CTL_OTGEN_Pos) /*!< HSOTG_T::CTL: OTGEN Mask */ - -#define HSOTG_CTL_WKEN_Pos (5) /*!< HSOTG_T::CTL: WKEN Position */ -#define HSOTG_CTL_WKEN_Msk (0x1ul << HSOTG_CTL_WKEN_Pos) /*!< HSOTG_T::CTL: WKEN Mask */ - -#define HSOTG_PHYCTL_OTGPHYEN_Pos (0) /*!< HSOTG_T::PHYCTL: OTGPHYEN Position */ -#define HSOTG_PHYCTL_OTGPHYEN_Msk (0x1ul << HSOTG_PHYCTL_OTGPHYEN_Pos) /*!< HSOTG_T::PHYCTL: OTGPHYEN Mask */ - -#define HSOTG_PHYCTL_IDDETEN_Pos (1) /*!< HSOTG_T::PHYCTL: IDDETEN Position */ -#define HSOTG_PHYCTL_IDDETEN_Msk (0x1ul << HSOTG_PHYCTL_IDDETEN_Pos) /*!< HSOTG_T::PHYCTL: IDDETEN Mask */ - -#define HSOTG_PHYCTL_VBENPOL_Pos (4) /*!< HSOTG_T::PHYCTL: VBENPOL Position */ -#define HSOTG_PHYCTL_VBENPOL_Msk (0x1ul << HSOTG_PHYCTL_VBENPOL_Pos) /*!< HSOTG_T::PHYCTL: VBENPOL Mask */ - -#define HSOTG_PHYCTL_VBSTSPOL_Pos (5) /*!< HSOTG_T::PHYCTL: VBSTSPOL Position */ -#define HSOTG_PHYCTL_VBSTSPOL_Msk (0x1ul << HSOTG_PHYCTL_VBSTSPOL_Pos) /*!< HSOTG_T::PHYCTL: VBSTSPOL Mask */ - -#define HSOTG_INTEN_ROLECHGIEN_Pos (0) /*!< HSOTG_T::INTEN: ROLECHGIEN Position */ -#define HSOTG_INTEN_ROLECHGIEN_Msk (0x1ul << HSOTG_INTEN_ROLECHGIEN_Pos) /*!< HSOTG_T::INTEN: ROLECHGIEN Mask */ - -#define HSOTG_INTEN_VBEIEN_Pos (1) /*!< HSOTG_T::INTEN: VBEIEN Position */ -#define HSOTG_INTEN_VBEIEN_Msk (0x1ul << HSOTG_INTEN_VBEIEN_Pos) /*!< HSOTG_T::INTEN: VBEIEN Mask */ - -#define HSOTG_INTEN_SRPFIEN_Pos (2) /*!< HSOTG_T::INTEN: SRPFIEN Position */ -#define HSOTG_INTEN_SRPFIEN_Msk (0x1ul << HSOTG_INTEN_SRPFIEN_Pos) /*!< HSOTG_T::INTEN: SRPFIEN Mask */ - -#define HSOTG_INTEN_HNPFIEN_Pos (3) /*!< HSOTG_T::INTEN: HNPFIEN Position */ -#define HSOTG_INTEN_HNPFIEN_Msk (0x1ul << HSOTG_INTEN_HNPFIEN_Pos) /*!< HSOTG_T::INTEN: HNPFIEN Mask */ - -#define HSOTG_INTEN_GOIDLEIEN_Pos (4) /*!< HSOTG_T::INTEN: GOIDLEIEN Position */ -#define HSOTG_INTEN_GOIDLEIEN_Msk (0x1ul << HSOTG_INTEN_GOIDLEIEN_Pos) /*!< HSOTG_T::INTEN: GOIDLEIEN Mask */ - -#define HSOTG_INTEN_IDCHGIEN_Pos (5) /*!< HSOTG_T::INTEN: IDCHGIEN Position */ -#define HSOTG_INTEN_IDCHGIEN_Msk (0x1ul << HSOTG_INTEN_IDCHGIEN_Pos) /*!< HSOTG_T::INTEN: IDCHGIEN Mask */ - -#define HSOTG_INTEN_PDEVIEN_Pos (6) /*!< HSOTG_T::INTEN: PDEVIEN Position */ -#define HSOTG_INTEN_PDEVIEN_Msk (0x1ul << HSOTG_INTEN_PDEVIEN_Pos) /*!< HSOTG_T::INTEN: PDEVIEN Mask */ - -#define HSOTG_INTEN_HOSTIEN_Pos (7) /*!< HSOTG_T::INTEN: HOSTIEN Position */ -#define HSOTG_INTEN_HOSTIEN_Msk (0x1ul << HSOTG_INTEN_HOSTIEN_Pos) /*!< HSOTG_T::INTEN: HOSTIEN Mask */ - -#define HSOTG_INTEN_BVLDCHGIEN_Pos (8) /*!< HSOTG_T::INTEN: BVLDCHGIEN Position */ -#define HSOTG_INTEN_BVLDCHGIEN_Msk (0x1ul << HSOTG_INTEN_BVLDCHGIEN_Pos) /*!< HSOTG_T::INTEN: BVLDCHGIEN Mask */ - -#define HSOTG_INTEN_AVLDCHGIEN_Pos (9) /*!< HSOTG_T::INTEN: AVLDCHGIEN Position */ -#define HSOTG_INTEN_AVLDCHGIEN_Msk (0x1ul << HSOTG_INTEN_AVLDCHGIEN_Pos) /*!< HSOTG_T::INTEN: AVLDCHGIEN Mask */ - -#define HSOTG_INTEN_VBCHGIEN_Pos (10) /*!< HSOTG_T::INTEN: VBCHGIEN Position */ -#define HSOTG_INTEN_VBCHGIEN_Msk (0x1ul << HSOTG_INTEN_VBCHGIEN_Pos) /*!< HSOTG_T::INTEN: VBCHGIEN Mask */ - -#define HSOTG_INTEN_SECHGIEN_Pos (11) /*!< HSOTG_T::INTEN: SECHGIEN Position */ -#define HSOTG_INTEN_SECHGIEN_Msk (0x1ul << HSOTG_INTEN_SECHGIEN_Pos) /*!< HSOTG_T::INTEN: SECHGIEN Mask */ - -#define HSOTG_INTEN_SRPDETIEN_Pos (13) /*!< HSOTG_T::INTEN: SRPDETIEN Position */ -#define HSOTG_INTEN_SRPDETIEN_Msk (0x1ul << HSOTG_INTEN_SRPDETIEN_Pos) /*!< HSOTG_T::INTEN: SRPDETIEN Mask */ - -#define HSOTG_INTSTS_ROLECHGIF_Pos (0) /*!< HSOTG_T::INTSTS: ROLECHGIF Position */ -#define HSOTG_INTSTS_ROLECHGIF_Msk (0x1ul << HSOTG_INTSTS_ROLECHGIF_Pos) /*!< HSOTG_T::INTSTS: ROLECHGIF Mask */ - -#define HSOTG_INTSTS_VBEIF_Pos (1) /*!< HSOTG_T::INTSTS: VBEIF Position */ -#define HSOTG_INTSTS_VBEIF_Msk (0x1ul << HSOTG_INTSTS_VBEIF_Pos) /*!< HSOTG_T::INTSTS: VBEIF Mask */ - -#define HSOTG_INTSTS_SRPFIF_Pos (2) /*!< HSOTG_T::INTSTS: SRPFIF Position */ -#define HSOTG_INTSTS_SRPFIF_Msk (0x1ul << HSOTG_INTSTS_SRPFIF_Pos) /*!< HSOTG_T::INTSTS: SRPFIF Mask */ - -#define HSOTG_INTSTS_HNPFIF_Pos (3) /*!< HSOTG_T::INTSTS: HNPFIF Position */ -#define HSOTG_INTSTS_HNPFIF_Msk (0x1ul << HSOTG_INTSTS_HNPFIF_Pos) /*!< HSOTG_T::INTSTS: HNPFIF Mask */ - -#define HSOTG_INTSTS_GOIDLEIF_Pos (4) /*!< HSOTG_T::INTSTS: GOIDLEIF Position */ -#define HSOTG_INTSTS_GOIDLEIF_Msk (0x1ul << HSOTG_INTSTS_GOIDLEIF_Pos) /*!< HSOTG_T::INTSTS: GOIDLEIF Mask */ - -#define HSOTG_INTSTS_IDCHGIF_Pos (5) /*!< HSOTG_T::INTSTS: IDCHGIF Position */ -#define HSOTG_INTSTS_IDCHGIF_Msk (0x1ul << HSOTG_INTSTS_IDCHGIF_Pos) /*!< HSOTG_T::INTSTS: IDCHGIF Mask */ - -#define HSOTG_INTSTS_PDEVIF_Pos (6) /*!< HSOTG_T::INTSTS: PDEVIF Position */ -#define HSOTG_INTSTS_PDEVIF_Msk (0x1ul << HSOTG_INTSTS_PDEVIF_Pos) /*!< HSOTG_T::INTSTS: PDEVIF Mask */ - -#define HSOTG_INTSTS_HOSTIF_Pos (7) /*!< HSOTG_T::INTSTS: HOSTIF Position */ -#define HSOTG_INTSTS_HOSTIF_Msk (0x1ul << HSOTG_INTSTS_HOSTIF_Pos) /*!< HSOTG_T::INTSTS: HOSTIF Mask */ - -#define HSOTG_INTSTS_BVLDCHGIF_Pos (8) /*!< HSOTG_T::INTSTS: BVLDCHGIF Position */ -#define HSOTG_INTSTS_BVLDCHGIF_Msk (0x1ul << HSOTG_INTSTS_BVLDCHGIF_Pos) /*!< HSOTG_T::INTSTS: BVLDCHGIF Mask */ - -#define HSOTG_INTSTS_AVLDCHGIF_Pos (9) /*!< HSOTG_T::INTSTS: AVLDCHGIF Position */ -#define HSOTG_INTSTS_AVLDCHGIF_Msk (0x1ul << HSOTG_INTSTS_AVLDCHGIF_Pos) /*!< HSOTG_T::INTSTS: AVLDCHGIF Mask */ - -#define HSOTG_INTSTS_VBCHGIF_Pos (10) /*!< HSOTG_T::INTSTS: VBCHGIF Position */ -#define HSOTG_INTSTS_VBCHGIF_Msk (0x1ul << HSOTG_INTSTS_VBCHGIF_Pos) /*!< HSOTG_T::INTSTS: VBCHGIF Mask */ - -#define HSOTG_INTSTS_SECHGIF_Pos (11) /*!< HSOTG_T::INTSTS: SECHGIF Position */ -#define HSOTG_INTSTS_SECHGIF_Msk (0x1ul << HSOTG_INTSTS_SECHGIF_Pos) /*!< HSOTG_T::INTSTS: SECHGIF Mask */ - -#define HSOTG_INTSTS_SRPDETIF_Pos (13) /*!< HSOTG_T::INTSTS: SRPDETIF Position */ -#define HSOTG_INTSTS_SRPDETIF_Msk (0x1ul << HSOTG_INTSTS_SRPDETIF_Pos) /*!< HSOTG_T::INTSTS: SRPDETIF Mask */ - -#define HSOTG_STATUS_OVERCUR_Pos (0) /*!< HSOTG_T::STATUS: OVERCUR Position */ -#define HSOTG_STATUS_OVERCUR_Msk (0x1ul << HSOTG_STATUS_OVERCUR_Pos) /*!< HSOTG_T::STATUS: OVERCUR Mask */ - -#define HSOTG_STATUS_IDSTS_Pos (1) /*!< HSOTG_T::STATUS: IDSTS Position */ -#define HSOTG_STATUS_IDSTS_Msk (0x1ul << HSOTG_STATUS_IDSTS_Pos) /*!< HSOTG_T::STATUS: IDSTS Mask */ - -#define HSOTG_STATUS_SESSEND_Pos (2) /*!< HSOTG_T::STATUS: SESSEND Position */ -#define HSOTG_STATUS_SESSEND_Msk (0x1ul << HSOTG_STATUS_SESSEND_Pos) /*!< HSOTG_T::STATUS: SESSEND Mask */ - -#define HSOTG_STATUS_BVLD_Pos (3) /*!< HSOTG_T::STATUS: BVLD Position */ -#define HSOTG_STATUS_BVLD_Msk (0x1ul << HSOTG_STATUS_BVLD_Pos) /*!< HSOTG_T::STATUS: BVLD Mask */ - -#define HSOTG_STATUS_AVLD_Pos (4) /*!< HSOTG_T::STATUS: AVLD Position */ -#define HSOTG_STATUS_AVLD_Msk (0x1ul << HSOTG_STATUS_AVLD_Pos) /*!< HSOTG_T::STATUS: AVLD Mask */ - -#define HSOTG_STATUS_VBUSVLD_Pos (5) /*!< HSOTG_T::STATUS: VBUSVLD Position */ -#define HSOTG_STATUS_VBUSVLD_Msk (0x1ul << HSOTG_STATUS_VBUSVLD_Pos) /*!< HSOTG_T::STATUS: VBUSVLD Mask */ - -#define HSOTG_STATUS_ASPERI_Pos (6) /*!< HSOTG_T::STATUS: ASPERI Position */ -#define HSOTG_STATUS_ASPERI_Msk (0x1ul << HSOTG_STATUS_ASPERI_Pos) /*!< HSOTG_T::STATUS: ASPERI Mask */ - -#define HSOTG_STATUS_ASHOST_Pos (7) /*!< HSOTG_T::STATUS: ASHOST Position */ -#define HSOTG_STATUS_ASHOST_Msk (0x1ul << HSOTG_STATUS_ASHOST_Pos) /*!< HSOTG_T::STATUS: ASHOST Mask */ - -/**@}*/ /* HSOTG_CONST */ -/**@}*/ /* end of HSOTG register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __HSOTG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbd_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbd_reg.h deleted file mode 100644 index 7c301802397..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbd_reg.h +++ /dev/null @@ -1,1381 +0,0 @@ -/**************************************************************************//** - * @file hsusbd_reg.h - * @version V1.00 - * @brief HSUSBD register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HSUSBD_REG_H__ -#define __HSUSBD_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup HSUSBD USB 2.0 Device Controller(HSUSBD) - Memory Mapped Structure for HSUSBD Controller -@{ */ - -typedef struct -{ - - /** - * @var HSUSBD_EP_T::EPDAT - * Offset: 0x00 Endpoint n Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |EPDAT |Endpoint A~L Data Register - * | | |Endpoint A~L data buffer for the buffer transaction (read or write). - * | | |Note: Only word access is supported. - * @var HSUSBD_EP_T::EPDAT_BYTE - * Offset: 0x00 Endpoint n Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |EPDAT |Endpoint A~L Data Register - * | | |Endpoint A~L data buffer for the buffer transaction (read or write). - * | | |Note: Only byte access is supported. - * @var HSUSBD_EP_T::EPINTSTS - * Offset: 0x04 Endpoint n Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUFFULLIF |Buffer Full - * | | |For an IN endpoint, the currently selected buffer is full, or no buffer is available to the local side for writing (no space to write) - * | | |For an OUT endpoint, there is a buffer available on the local side, and there are FIFO full of bytes available to be read (entire packet is available for reading). - * | | |0 = The endpoint packet buffer is not full. - * | | |1 = The endpoint packet buffer is full. - * | | |Note: This bit is read-only. - * |[1] |BUFEMPTYIF|Buffer Empty - * | | |For an IN endpoint, a buffer is available to the local side for writing up to FIFO full of bytes. - * | | |0 = The endpoint buffer is not empty. - * | | |1 = The endpoint buffer is empty. - * | | |For an OUT endpoint: - * | | |0 = The currently selected buffer has not a count of 0. - * | | |1 = The currently selected buffer has a count of 0, or no buffer is available on the local side (nothing to read). - * | | |Note: This bit is read-only. - * |[2] |SHORTTXIF |Short Packet Transferred Interrupt - * | | |0 = The length of the last packet was not less than the Maximum Packet Size (EPMPS). - * | | |1 = The length of the last packet was less than the Maximum Packet Size (EPMPS). - * | | |Note: Write 1 to clear this bit to 0. - * |[3] |TXPKIF |Data Packet Transmitted Interrupt - * | | |0 = Not a data packet is transmitted from the endpoint to the host. - * | | |1 = A data packet is transmitted from the endpoint to the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |RXPKIF |Data Packet Received Interrupt - * | | |0 = No data packet is received from the host by the endpoint. - * | | |1 = A data packet is received from the host by the endpoint. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |OUTTKIF |Data OUT Token Interrupt - * | | |0 = A Data OUT token has not been received from the host. - * | | |1 = A Data OUT token has been received from the host - * | | |This bit also set by PING token (in high-speed only). - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |INTKIF |Data IN Token Interrupt - * | | |0 = Not Data IN token has been received from the host. - * | | |1 = A Data IN token has been received from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |PINGIF |PING Token Interrupt - * | | |0 = A Data PING token has not been received from the host. - * | | |1 = A Data PING token has been received from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |NAKIF |USB NAK Sent - * | | |0 = The last USB IN packet could be provided, and was acknowledged with an ACK. - * | | |1 = The last USB IN packet could not be provided, and was acknowledged with a NAK. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |STALLIF |USB STALL Sent - * | | |0 = The last USB packet could be accepted or provided because the endpoint was stalled, and was acknowledged with a STALL. - * | | |1 = The last USB packet could not be accepted or provided because the endpoint was stalled, and was acknowledged with a STALL. - * | | |Note: Write 1 to clear this bit to 0. - * |[10] |NYETIF |NYET Sent - * | | |0 = The space available in the RAM is sufficient to accommodate the next on coming data packet. - * | | |1 = The space available in the RAM is not sufficient to accommodate the next on coming data packet. - * | | |Note: Write 1 to clear this bit to 0. - * |[11] |ERRIF |ERR Sent - * | | |0 = No any error in the transaction. - * | | |1 = There occurs any error in the transaction. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |SHORTRXIF |Bulk Out Short Packet Received - * | | |0 = No bulk out short packet is received. - * | | |1 = Received bulk out short packet (including zero length packet). - * | | |Note: Write 1 to clear this bit to 0. - * @var HSUSBD_EP_T::EPINTEN - * Offset: 0x08 Endpoint n Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUFFULLIEN|Buffer Full Interrupt - * | | |When set, this bit enables a local interrupt to be set when a buffer full condition is detected on the bus. - * | | |0 = Buffer full interrupt Disabled. - * | | |1 = Buffer full interrupt Enabled. - * |[1] |BUFEMPTYIEN|Buffer Empty Interrupt - * | | |When set, this bit enables a local interrupt to be set when a buffer empty condition is detected on the bus. - * | | |0 = Buffer empty interrupt Disabled. - * | | |1 = Buffer empty interrupt Enabled. - * |[2] |SHORTTXIEN|Short Packet Transferred Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a short data packet has been transferred to/from the host. - * | | |0 = Short data packet interrupt Disabled. - * | | |1 = Short data packet interrupt Enabled. - * |[3] |TXPKIEN |Data Packet Transmitted Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a data packet has been received from the host. - * | | |0 = Data packet has been received from the host interrupt Disabled. - * | | |1 = Data packet has been received from the host interrupt Enabled. - * |[4] |RXPKIEN |Data Packet Received Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a data packet has been transmitted to the host. - * | | |0 = Data packet has been transmitted to the host interrupt Disabled. - * | | |1 = Data packet has been transmitted to the host interrupt Enabled. - * |[5] |OUTTKIEN |Data OUT Token Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a Data OUT token has been received from the host. - * | | |0 = Data OUT token interrupt Disabled. - * | | |1 = Data OUT token interrupt Enabled. - * |[6] |INTKIEN |Data IN Token Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a Data IN token has been received from the host. - * | | |0 = Data IN token interrupt Disabled. - * | | |1 = Data IN token interrupt Enabled. - * |[7] |PINGIEN |PING Token Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a PING token has been received from the host. - * | | |0 = PING token interrupt Disabled. - * | | |1 = PING token interrupt Enabled. - * |[8] |NAKIEN |USB NAK Sent Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a NAK token is sent to the host. - * | | |0 = NAK token interrupt Disabled. - * | | |1 = NAK token interrupt Enabled. - * |[9] |STALLIEN |USB STALL Sent Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set when a stall token is sent to the host. - * | | |0 = STALL token interrupt Disabled. - * | | |1 = STALL token interrupt Enabled. - * |[10] |NYETIEN |NYET Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set whenever NYET condition occurs on the bus for this endpoint. - * | | |0 = NYET condition interrupt Disabled. - * | | |1 = NYET condition interrupt Enabled. - * |[11] |ERRIEN |ERR Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set whenever ERR condition occurs on the bus for this endpoint. - * | | |0 = Error event interrupt Disabled. - * | | |1 = Error event interrupt Enabled. - * |[12] |SHORTRXIEN|Bulk Out Short Packet Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be set whenever bulk out short packet occurs on the bus for this endpoint. - * | | |0 = Bulk out interrupt Disabled. - * | | |1 = Bulk out interrupt Enabled. - * @var HSUSBD_EP_T::EPDATCNT - * Offset: 0x0C Endpoint n Data Available Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATCNT |Data Count - * | | |For an IN endpoint (EPDIR(USBD_EPxCFG[3] is high.), this register returns the number of valid bytes in the IN endpoint packet buffer. - * | | |For an OUT endpoint (EPDIR(USBD_EPxCFG[3] is low.), this register returns the number of received valid bytes in the Host OUT transfer. - * |[30:16] |DMALOOP |DMA Loop - * | | |This register is the remaining DMA loop to complete. Each loop means 32-byte transfer. - * @var HSUSBD_EP_T::EPRSPCTL - * Offset: 0x10 Endpoint n Response Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FLUSH |Buffer Flush - * | | |Writing 1 to this bit causes the packet buffer to be flushed and the corresponding EP_AVAIL register to be cleared - * | | |This bit is self-clearing - * | | |This bit should always be written after an configuration event. - * | | |0 = The packet buffer is not flushed. - * | | |1 = The packet buffer is flushed by user. - * |[2:1] |MODE |Mode Control - * | | |The two bits decide the operation mode of the in-endpoint. - * | | |00: Auto-Validate Mode - * | | |01: Manual-Validate Mode - * | | |10: Fly Mode - * | | |11: Reserved - * | | |These bits are not valid for an out-endpoint - * | | |The auto validate mode will be activated when the reserved mode is selected - * |[3] |TOGGLE |Endpoint Toggle - * | | |This bit is used to clear the endpoint data toggle bit - * | | |Reading this bit returns the current state of the endpoint data toggle bit. - * | | |The local CPU may use this bit to initialize the end-point's toggle in case of reception of a Set Interface request or a Clear Feature (ep_halt) request from the host - * | | |Only when toggle bit is "1", this bit can be written into the inversed write data bit[3]. - * | | |0 = Not clear the endpoint data toggle bit. - * | | |1 = Clear the endpoint data toggle bit. - * |[4] |HALT |Endpoint Halt - * | | |This bit is used to send a STALL handshake as response to the token from the host - * | | |When an Endpoint Set Feature (ep_halt) is detected by the local CPU, it must write a '1' to this bit. - * | | |0 = Not send a STALL handshake as response to the token from the host. - * | | |1 = Send a STALL handshake as response to the token from the host. - * |[5] |ZEROLEN |Zero Length - * | | |This bit is used to send a zero-length packet response to an IN-token - * | | |When this bit is set, a zero packet is sent to the host on reception of an IN-token - * | | |This bit gets cleared once the zero length data packet is sent. - * | | |0 = A zero packet is not sent to the host on reception of an IN-token. - * | | |1 = A zero packet is sent to the host on reception of an IN-token. - * |[6] |SHORTTXEN |Short Packet Transfer Enable - * | | |This bit is applicable only in case of Auto-Validate Method - * | | |This bit is set to validate any remaining data in the buffer which is not equal to the MPS of the endpoint, and happens to be the last transfer - * | | |This bit gets cleared once the data packet is sent. - * | | |0 = Not validate any remaining data in the buffer which is not equal to the MPS of the endpoint. - * | | |1 = Validate any remaining data in the buffer which is not equal to the MPS of the endpoint. - * |[7] |DISBUF |Buffer Disable Bit - * | | |This bit is used to receive unknown size OUT short packet - * | | |The received packet size is reference USBD_EPxDATCNT register. - * | | |0 = Buffer Not Disabled when Bulk-OUT short packet is received. - * | | |1 = Buffer Disabled when Bulk-OUT short packet is received. - * @var HSUSBD_EP_T::EPMPS - * Offset: 0x14 Endpoint n Maximum Packet Size Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |EPMPS |Endpoint Maximum Packet Size - * | | |This field determines the Maximum Packet Size of the Endpoint. - * @var HSUSBD_EP_T::EPTXCNT - * Offset: 0x18 Endpoint n Transfer Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |TXCNT |Endpoint Transfer Count - * | | |For IN endpoints, this field determines the total number of bytes to be sent to the host in case of manual validation method. - * | | |For OUT endpoints, this field has no effect. - * @var HSUSBD_EP_T::EPCFG - * Offset: 0x1C Endpoint n Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EPEN |Endpoint Valid - * | | |When set, this bit enables this endpoint - * | | |This bit has no effect on Endpoint 0, which is always enabled. - * | | |0 = The endpoint Disabled. - * | | |1 = The endpoint Enabled. - * |[2:1] |EPTYPE |Endpoint Type - * | | |This field selects the type of this endpoint. Endpoint 0 is forced to a Control type. - * | | |00 = Reserved. - * | | |01 = Bulk. - * | | |10 = Interrupt. - * | | |11 = Isochronous. - * |[3] |EPDIR |Endpoint Direction - * | | |0 = out-endpoint (Host OUT to Device). - * | | |1 = in-endpoint (Host IN to Device). - * | | |Note: A maximum of one OUT and IN endpoint is allowed for each endpoint number. - * |[7:4] |EPNUM |Endpoint Number - * | | |This field selects the number of the endpoint. Valid numbers 1 to 15. - * | | |Note: Do not support two endpoints have same endpoint number. - * @var HSUSBD_EP_T::EPBUFST - * Offset: 0x20 Endpoint n RAM Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |SADDR |Endpoint Start Address - * | | |This is the start-address of the RAM space allocated for the endpoint A~L. - * @var HSUSBD_EP_T::EPBUFEND - * Offset: 0x24 Endpoint n RAM End Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |EADDR |Endpoint End Address - * | | |This is the end-address of the RAM space allocated for the endpoint A~L. - */ - - union - { - __IO uint32_t EPDAT; - __IO uint8_t EPDAT_BYTE; - - }; /*!< [0x0000] Endpoint n Data Register */ - - __IO uint32_t EPINTSTS; /*!< [0x0004] Endpoint n Interrupt Status Register */ - __IO uint32_t EPINTEN; /*!< [0x0008] Endpoint n Interrupt Enable Register */ - __I uint32_t EPDATCNT; /*!< [0x000c] Endpoint n Data Available Count Register */ - __IO uint32_t EPRSPCTL; /*!< [0x0010] Endpoint n Response Control Register */ - __IO uint32_t EPMPS; /*!< [0x0014] Endpoint n Maximum Packet Size Register */ - __IO uint32_t EPTXCNT; /*!< [0x0018] Endpoint n Transfer Count Register */ - __IO uint32_t EPCFG; /*!< [0x001c] Endpoint n Configuration Register */ - __IO uint32_t EPBUFST; /*!< [0x0020] Endpoint n RAM Start Address Register */ - __IO uint32_t EPBUFEND; /*!< [0x0024] Endpoint n RAM End Address Register */ - -} HSUSBD_EP_T; - -typedef struct -{ - - /** - * @var HSUSBD_T::GINTSTS - * Offset: 0x00 Global Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIF |USB Interrupt - * | | |This bit conveys the interrupt status for USB specific events endpoint - * | | |When set, USB interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[1] |CEPIF |Control Endpoint Interrupt - * | | |This bit conveys the interrupt status for control endpoint - * | | |When set, Control-ep's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[2] |EPAIF |Endpoint a Interrupt - * | | |When set, the corresponding Endpoint A's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[3] |EPBIF |Endpoint B Interrupt - * | | |When set, the corresponding Endpoint B's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[4] |EPCIF |Endpoint C Interrupt - * | | |When set, the corresponding Endpoint C's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[5] |EPDIF |Endpoint D Interrupt - * | | |When set, the corresponding Endpoint D's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[6] |EPEIF |Endpoint E Interrupt - * | | |When set, the corresponding Endpoint E's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[7] |EPFIF |Endpoint F Interrupt - * | | |When set, the corresponding Endpoint F's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[8] |EPGIF |Endpoint G Interrupt - * | | |When set, the corresponding Endpoint G's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[9] |EPHIF |Endpoint H Interrupt - * | | |When set, the corresponding Endpoint H's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[10] |EPIIF |Endpoint I Interrupt - * | | |When set, the corresponding Endpoint I's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[11] |EPJIF |Endpoint J Interrupt - * | | |When set, the corresponding Endpoint J's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[12] |EPKIF |Endpoint K Interrupt - * | | |When set, the corresponding Endpoint K's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * |[13] |EPLIF |Endpoint L Interrupt - * | | |When set, the corresponding Endpoint L's interrupt status register should be read to determine the cause of the interrupt. - * | | |0 = No interrupt event occurred. - * | | |1 = The related interrupt event is occurred. - * @var HSUSBD_T::GINTEN - * Offset: 0x08 Global Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIEN |USB Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be generated when a USB event occurs on the bus. - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[1] |CEPIEN |Control Endpoint Interrupt Enable Bit - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the control endpoint. - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[2] |EPAIEN |Interrupt Enable Control for Endpoint a - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint A. - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[3] |EPBIEN |Interrupt Enable Control for Endpoint B - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint B - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[4] |EPCIEN |Interrupt Enable Control for Endpoint C - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint C - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[5] |EPDIEN |Interrupt Enable Control for Endpoint D - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint D - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[6] |EPEIEN |Interrupt Enable Control for Endpoint E - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint E - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[7] |EPFIEN |Interrupt Enable Control for Endpoint F - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint F - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[8] |EPGIEN |Interrupt Enable Control for Endpoint G - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint G - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[9] |EPHIEN |Interrupt Enable Control for Endpoint H - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint H - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[10] |EPIIEN |Interrupt Enable Control for Endpoint I - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint I - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[11] |EPJIEN |Interrupt Enable Control for Endpoint J - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint J - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[12] |EPKIEN |Interrupt Enable Control for Endpoint K - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint K - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * |[13] |EPLIEN |Interrupt Enable Control for Endpoint L - * | | |When set, this bit enables a local interrupt to be generated when an interrupt is pending for the endpoint L - * | | |0 = The related interrupt Disabled. - * | | |1 = The related interrupt Enabled. - * @var HSUSBD_T::BUSINTSTS - * Offset: 0x10 USB Bus Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SOFIF |SOF Receive Control - * | | |This bit indicates when a start-of-frame packet has been received. - * | | |0 = No start-of-frame packet has been received. - * | | |1 = Start-of-frame packet has been received. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |RSTIF |Reset Status - * | | |When set, this bit indicates that either the USB root port reset is end. - * | | |0 = No USB root port reset is end. - * | | |1 = USB root port reset is end. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |RESUMEIF |Resume - * | | |When set, this bit indicates that a device resume has occurred. - * | | |0 = No device resume has occurred. - * | | |1 = Device resume has occurred. - * | | |Note: Write 1 to clear this bit to 0. - * |[3] |SUSPENDIF |Suspend Request - * | | |This bit is set as default and it has to be cleared by writing '1' before the USB reset - * | | |This bit is also set when a USB Suspend request is detected from the host. - * | | |0 = No USB Suspend request is detected from the host. - * | | |1= USB Suspend request is detected from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |HISPDIF |High-speed Settle - * | | |0 = No valid high-speed reset protocol is detected. - * | | |1 = Valid high-speed reset protocol is over and the device has settled in high-speed. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |DMADONEIF |DMA Completion Interrupt - * | | |0 = No DMA transfer over. - * | | |1 = DMA transfer is over. - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |PHYCLKVLDIF|Usable Clock Interrupt - * | | |0 = Usable clock is not available. - * | | |1 = Usable clock is available from the transceiver. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |VBUSDETIF |VBUS Detection Interrupt Status - * | | |0 = No VBUS is plug-in. - * | | |1 = VBUS is plug-in. - * | | |Note: Write 1 to clear this bit to 0. - * @var HSUSBD_T::BUSINTEN - * Offset: 0x14 USB Bus Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SOFIEN |SOF Interrupt - * | | |This bit enables the SOF interrupt. - * | | |0 = SOF interrupt Disabled. - * | | |1 = SOF interrupt Enabled. - * |[1] |RSTIEN |Reset Status - * | | |This bit enables the USB-Reset interrupt. - * | | |0 = USB-Reset interrupt Disabled. - * | | |1 = USB-Reset interrupt Enabled. - * |[2] |RESUMEIEN |Resume - * | | |This bit enables the Resume interrupt. - * | | |0 = Resume interrupt Disabled. - * | | |1 = Resume interrupt Enabled. - * |[3] |SUSPENDIEN|Suspend Request - * | | |This bit enables the Suspend interrupt. - * | | |0 = Suspend interrupt Disabled. - * | | |1 = Suspend interrupt Enabled. - * |[4] |HISPDIEN |High-speed Settle - * | | |This bit enables the high-speed settle interrupt. - * | | |0 = High-speed settle interrupt Disabled. - * | | |1 = High-speed settle interrupt Enabled. - * |[5] |DMADONEIEN|DMA Completion Interrupt - * | | |This bit enables the DMA completion interrupt - * | | |0 = DMA completion interrupt Disabled. - * | | |1 = DMA completion interrupt Enabled. - * |[6] |PHYCLKVLDIEN|Usable Clock Interrupt - * | | |This bit enables the usable clock interrupt. - * | | |0 = Usable clock interrupt Disabled. - * | | |1 = Usable clock interrupt Enabled. - * |[8] |VBUSDETIEN|VBUS Detection Interrupt Enable Bit - * | | |This bit enables the VBUS floating detection interrupt. - * | | |0 = VBUS floating detection interrupt Disabled. - * | | |1 = VBUS floating detection interrupt Enabled. - * @var HSUSBD_T::OPER - * Offset: 0x18 USB Operational Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RESUMEEN |Generate Resume - * | | |0 = No Resume sequence to be initiated to the host. - * | | |1 = A Resume sequence to be initiated to the host if device remote wakeup is enabled - * | | |This bit is self-clearing. - * |[1] |HISPDEN |USB High-speed - * | | |0 = The USB device controller to suppress the chirp-sequence during reset protocol, thereby allowing the USB device controller to settle in full-speed, even though it is connected to a USB2.0 Host. - * | | |1 = The USB device controller to initiate a chirp-sequence during reset protocol. - * |[2] |CURSPD |USB Current Speed - * | | |0 = The device has settled in Full Speed. - * | | |1 = The USB device controller has settled in High-speed. - * @var HSUSBD_T::FRAMECNT - * Offset: 0x1C USB Frame Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |MFRAMECNT |Micro-frame Counter - * | | |This field contains the micro-frame number for the frame number in the frame counter field. - * |[13:3] |FRAMECNT |Frame Counter - * | | |This field contains the frame count from the most recent start-of-frame packet. - * @var HSUSBD_T::FADDR - * Offset: 0x20 USB Function Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |FADDR |USB Function Address - * | | |This field contains the current USB address of the device - * | | |This field is cleared when a root port reset is detected - * @var HSUSBD_T::TEST - * Offset: 0x24 USB Test Mode Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TESTMODE |Test Mode Selection - * | | |000 = Normal Operation. - * | | |001 = Test_J. - * | | |010 = Test_K. - * | | |011 = Test_SE0_NAK. - * | | |100 = Test_Packet. - * | | |101 = Test_Force_Enable. - * | | |110 = Reserved. - * | | |111 = Reserved. - * | | |Note: This field is cleared when root port reset is detected. - * @var HSUSBD_T::CEPDAT - * Offset: 0x28 Control-Endpoint Data Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DAT |Control-endpoint Data Buffer - * | | |Control endpoint data buffer for the buffer transaction (read or write). - * | | |Note: Only word access is supported. - * @var HSUSBD_T::CEPDAT_BYTE - * Offset: 0x28 Control-Endpoint Data Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Control-endpoint Data Buffer - * | | |Control endpoint data buffer for the buffer transaction (read or write). - * | | |Note: Only byte access is supported. - * @var HSUSBD_T::CEPCTL - * Offset: 0x2C Control-Endpoint Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |NAKCLR |No Acknowledge Control - * | | |This bit plays a crucial role in any control transfer. - * | | |0 = The bit is being cleared by the local CPU by writing zero, the USB device controller will be responding with NAKs for the subsequent status phase - * | | |This mechanism holds the host from moving to the next request, until the local CPU is also ready to process the next request. - * | | |1 = This bit is set to one by the USB device controller, whenever a setup token is received - * | | |The local CPU can take its own time to finish off any house-keeping work based on the request and then clear this bit. - * | | |Note: Only when CPU writes data[1:0] is 2'b10 or 2'b00, this bit can be updated. - * |[1] |STALLEN |Stall Enable Bit - * | | |When this stall bit is set, the control endpoint sends a stall handshake in response to any in or out token thereafter - * | | |This is typically used for response to invalid/unsupported requests - * | | |When this bit is being set the NAK clear bit has to be cleared at the same time since the NAK clear bit has highest priority than STALL - * | | |It is automatically cleared on receipt of a next setup-token - * | | |So, the local CPU need not write again to clear this bit. - * | | |0 = No sends a stall handshake in response to any in or out token thereafter. - * | | |1 = The control endpoint sends a stall handshake in response to any in or out token thereafter. - * | | |Note: Only when CPU writes data[1:0] is 2'b10 or 2'b00, this bit can be updated. - * |[2] |ZEROLEN |Zero Packet Length - * | | |This bit is valid for Auto Validation mode only. - * | | |0 = No zero length packet to the host during Data stage to an IN token. - * | | |1 = USB device controller can send a zero length packet to the host during Data stage to an IN token - * | | |This bit gets cleared once the zero length data packet is sent - * | | |So, the local CPU need not write again to clear this bit. - * |[3] |FLUSH |CEP-flush Bit - * | | |0 = No the packet buffer and its corresponding USBD_CEPDATCNT register to be cleared. - * | | |1 = The packet buffer and its corresponding USBD_CEPDATCNT register to be cleared - * | | |This bit is self-cleaning. - * @var HSUSBD_T::CEPINTEN - * Offset: 0x30 Control-Endpoint Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SETUPTKIEN|Setup Token Interrupt Enable Bit - * | | |0 = The SETUP token interrupt in Control Endpoint Disabled. - * | | |1 = The SETUP token interrupt in Control Endpoint Enabled. - * |[1] |SETUPPKIEN|Setup Packet Interrupt - * | | |0 = The SETUP packet interrupt in Control Endpoint Disabled. - * | | |1 = The SETUP packet interrupt in Control Endpoint Enabled. - * |[2] |OUTTKIEN |Out Token Interrupt - * | | |0 = The OUT token interrupt in Control Endpoint Disabled. - * | | |1 = The OUT token interrupt in Control Endpoint Enabled. - * |[3] |INTKIEN |In Token Interrupt - * | | |0 = The IN token interrupt in Control Endpoint Disabled. - * | | |1 = The IN token interrupt in Control Endpoint Enabled. - * |[4] |PINGIEN |Ping Token Interrupt - * | | |0 = The ping token interrupt in Control Endpoint Disabled. - * | | |1 = The ping token interrupt Control Endpoint Enabled. - * |[5] |TXPKIEN |Data Packet Transmitted Interrupt - * | | |0 = The data packet transmitted interrupt in Control Endpoint Disabled. - * | | |1 = The data packet transmitted interrupt in Control Endpoint Enabled. - * |[6] |RXPKIEN |Data Packet Received Interrupt - * | | |0 = The data received interrupt in Control Endpoint Disabled. - * | | |1 = The data received interrupt in Control Endpoint Enabled. - * |[7] |NAKIEN |NAK Sent Interrupt - * | | |0 = The NAK sent interrupt in Control Endpoint Disabled. - * | | |1 = The NAK sent interrupt in Control Endpoint Enabled. - * |[8] |STALLIEN |STALL Sent Interrupt - * | | |0 = The STALL sent interrupt in Control Endpoint Disabled. - * | | |1 = The STALL sent interrupt in Control Endpoint Enabled. - * |[9] |ERRIEN |USB Error Interrupt - * | | |0 = The USB Error interrupt in Control Endpoint Disabled. - * | | |1 = The USB Error interrupt in Control Endpoint Enabled. - * |[10] |STSDONEIEN|Status Completion Interrupt - * | | |0 = The Status Completion interrupt in Control Endpoint Disabled. - * | | |1 = The Status Completion interrupt in Control Endpoint Enabled. - * |[11] |BUFFULLIEN|Buffer Full Interrupt - * | | |0 = The buffer full interrupt in Control Endpoint Disabled. - * | | |1 = The buffer full interrupt in Control Endpoint Enabled. - * |[12] |BUFEMPTYIEN|Buffer Empty Interrupt - * | | |0 = The buffer empty interrupt in Control Endpoint Disabled. - * | | |1= The buffer empty interrupt in Control Endpoint Enabled. - * @var HSUSBD_T::CEPINTSTS - * Offset: 0x34 Control-Endpoint Interrupt Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SETUPTKIF |Setup Token Interrupt - * | | |0 = Not a Setup token is received. - * | | |1 = A Setup token is received. Writing 1 clears this status bit - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |SETUPPKIF |Setup Packet Interrupt - * | | |This bit must be cleared (by writing 1) before the next setup packet can be received - * | | |If the bit is not cleared, then the successive setup packets will be overwritten in the setup packet buffer. - * | | |0 = Not a Setup packet has been received from the host. - * | | |1 = A Setup packet has been received from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |OUTTKIF |Out Token Interrupt - * | | |0 = The control-endpoint does not received an OUT token from the host. - * | | |1 = The control-endpoint receives an OUT token from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[3] |INTKIF |in Token Interrupt - * | | |0 = The control-endpoint does not received an IN token from the host. - * | | |1 = The control-endpoint receives an IN token from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |PINGIF |Ping Token Interrupt - * | | |0 = The control-endpoint does not received a ping token from the host. - * | | |1 = The control-endpoint receives a ping token from the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |TXPKIF |Data Packet Transmitted Interrupt - * | | |0 = Not a data packet is successfully transmitted to the host in response to an IN-token and an ACK-token is received for the same. - * | | |1 = A data packet is successfully transmitted to the host in response to an IN-token and an ACK-token is received for the same. - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |RXPKIF |Data Packet Received Interrupt - * | | |0 = Not a data packet is successfully received from the host for an OUT-token and an ACK is sent to the host. - * | | |1 = A data packet is successfully received from the host for an OUT-token and an ACK is sent to the host. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |NAKIF |NAK Sent Interrupt - * | | |0 = Not a NAK-token is sent in response to an IN/OUT token. - * | | |1 = A NAK-token is sent in response to an IN/OUT token. - * | | |Note: Write 1 to clear this bit to 0. - * |[8] |STALLIF |STALL Sent Interrupt - * | | |0 = Not a stall-token is sent in response to an IN/OUT token. - * | | |1 = A stall-token is sent in response to an IN/OUT token. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |ERRIF |USB Error Interrupt - * | | |0 = No error had occurred during the transaction. - * | | |1 = An error had occurred during the transaction. - * | | |Note: Write 1 to clear this bit to 0. - * |[10] |STSDONEIF |Status Completion Interrupt - * | | |0 = Not a USB transaction has completed successfully. - * | | |1 = The status stage of a USB transaction has completed successfully. - * | | |Note: Write 1 to clear this bit to 0. - * |[11] |BUFFULLIF |Buffer Full Interrupt - * | | |0 = The control-endpoint buffer is not full. - * | | |1 = The control-endpoint buffer is full. - * | | |Note: Write 1 to clear this bit to 0. - * |[12] |BUFEMPTYIF|Buffer Empty Interrupt - * | | |0 = The control-endpoint buffer is not empty. - * | | |1 = The control-endpoint buffer is empty. - * | | |Note: Write 1 to clear this bit to 0. - * @var HSUSBD_T::CEPTXCNT - * Offset: 0x38 Control-Endpoint In-transfer Data Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TXCNT |In-transfer Data Count - * | | |There is no mode selection for the control endpoint (but it operates like manual mode).The local-CPU has to fill the control-endpoint buffer with the data to be sent for an in-token and to write the count of bytes in this register - * | | |When zero is written into this field, a zero length packet is sent to the host - * | | |When the count written in the register is more than the MPS, the data sent will be of only MPS. - * @var HSUSBD_T::CEPRXCNT - * Offset: 0x3C Control-Endpoint Out-transfer Data Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RXCNT |Out-transfer Data Count - * | | |The USB device controller maintains the count of the data received in case of an out transfer, during the control transfer. - * @var HSUSBD_T::CEPDATCNT - * Offset: 0x40 Control-Endpoint data count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATCNT |Control-endpoint Data Count - * | | |The USB device controller maintains the count of the data of control-endpoint. - * @var HSUSBD_T::SETUP1_0 - * Offset: 0x44 Setup1 & Setup0 bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP0 |Setup Byte 0[7:0] - * | | |This register provides byte 0 of the last setup packet received - * | | |For a Standard Device Request, the following bmRequestType information is returned. - * | | |Bit 7(Direction): - * | | | 0: Host to device - * | | | 1: Device to host - * | | |Bit 6-5 (Type): - * | | | 00: Standard - * | | | 01: Class - * | | | 10: Vendor - * | | | 11: Reserved - * | | |Bit 4-0 (Recipient) - * | | | 00000: Device - * | | | 00001: Interface - * | | | 00010: Endpoint - * | | | 00011: Other - * | | | Others: Reserved - * |[15:8] |SETUP1 |Setup Byte 1[15:8] - * | | |This register provides byte 1 of the last setup packet received - * | | |For a Standard Device Request, the following bRequest Code information is returned. - * | | |00000000 = Get Status. - * | | |00000001 = Clear Feature. - * | | |00000010 = Reserved. - * | | |00000011 = Set Feature. - * | | |00000100 = Reserved. - * | | |00000101 = Set Address. - * | | |00000110 = Get Descriptor. - * | | |00000111 = Set Descriptor. - * | | |00001000 = Get Configuration. - * | | |00001001 = Set Configuration. - * | | |00001010 = Get Interface. - * | | |00001011 = Set Interface. - * | | |00001100 = Sync Frame. - * @var HSUSBD_T::SETUP3_2 - * Offset: 0x48 Setup3 & Setup2 Bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP2 |Setup Byte 2 [7:0] - * | | |This register provides byte 2 of the last setup packet received - * | | |For a Standard Device Request, the least significant byte of the wValue field is returned - * |[15:8] |SETUP3 |Setup Byte 3 [15:8] - * | | |This register provides byte 3 of the last setup packet received - * | | |For a Standard Device Request, the most significant byte of the wValue field is returned. - * @var HSUSBD_T::SETUP5_4 - * Offset: 0x4C Setup5 & Setup4 Bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP4 |Setup Byte 4[7:0] - * | | |This register provides byte 4 of the last setup packet received - * | | |For a Standard Device Request, the least significant byte of the wIndex is returned. - * |[15:8] |SETUP5 |Setup Byte 5[15:8] - * | | |This register provides byte 5 of the last setup packet received - * | | |For a Standard Device Request, the most significant byte of the wIndex field is returned. - * @var HSUSBD_T::SETUP7_6 - * Offset: 0x50 Setup7 & Setup6 Bytes - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SETUP6 |Setup Byte 6[7:0] - * | | |This register provides byte 6 of the last setup packet received - * | | |For a Standard Device Request, the least significant byte of the wLength field is returned. - * |[15:8] |SETUP7 |Setup Byte 7[15:8] - * | | |This register provides byte 7 of the last setup packet received - * | | |For a Standard Device Request, the most significant byte of the wLength field is returned. - * @var HSUSBD_T::CEPBUFST - * Offset: 0x54 Control Endpoint RAM Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |SADDR |Control-endpoint Start Address - * | | |This is the start-address of the RAM space allocated for the control-endpoint. - * @var HSUSBD_T::CEPBUFEND - * Offset: 0x58 Control Endpoint RAM End Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |EADDR |Control-endpoint End Address - * | | |This is the end-address of the RAM space allocated for the control-endpoint. - * @var HSUSBD_T::DMACTL - * Offset: 0x5C DMA Control Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNUM |DMA Endpoint Address Bits - * | | |Used to define the Endpoint Address - * |[4] |DMARD |DMA Operation - * | | |0 : The operation is a DMA write (read from USB buffer) - * | | |DMA will check endpoint data available count (USBD_EPxDATCNT) according to EPNM setting before to perform DMA write operation. - * | | |1 : The operation is a DMA read (write to USB buffer). - * |[5] |DMAEN |DMA Enable Bit - * | | |0 : DMA function Disabled. - * | | |1 : DMA function Enabled. - * |[6] |SGEN |Scatter Gather Function Enable Bit - * | | |0 : Scatter gather function Disabled. - * | | |1 : Scatter gather function Enabled. - * |[7] |DMARST |Reset DMA State Machine - * | | |0 : No reset the DMA state machine. - * | | |1 : Reset the DMA state machine. - * |[8] |SVINEP |Serve IN Endpoint - * | | |This bit is used to specify DMA serving endpoint-IN endpoint or OUT endpoint. - * | | |0: DMA serves OUT endpoint - * | | |1: DMA serves IN endpoint - * @var HSUSBD_T::DMACNT - * Offset: 0x60 DMA Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[19:0] |DMACNT |DMA Transfer Count - * | | |The transfer count of the DMA operation to be performed is written to this register. - * @var HSUSBD_T::DMAADDR - * Offset: 0x700 AHB DMA Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMAADDR |DMAADDR - * | | |The register specifies the address from which the DMA has to read / write - * | | |The address must WORD (32-bit) aligned. - * @var HSUSBD_T::PHYCTL - * Offset: 0x704 USB PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |DPPUEN |DP Pull-up - * | | |0 = Pull-up resistor on D+ Disabled. - * | | |1 = Pull-up resistor on D+ Enabled. - * |[9] |PHYEN |PHY Suspend Enable Bit - * | | |0 = The USB PHY is suspend. - * | | |1 = The USB PHY is not suspend. - * |[24] |WKEN |Wake-up Enable Bit - * | | |0 = The wake-up function Disabled. - * | | |1 = The wake-up function Enabled. - * |[31] |VBUSDET |VBUS Status - * | | |0 = The VBUS is not detected yet. - * | | |1 = The VBUS is detected. - */ - - __I uint32_t GINTSTS; /*!< [0x0000] Global Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t GINTEN; /*!< [0x0008] Global Interrupt Enable Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t BUSINTSTS; /*!< [0x0010] USB Bus Interrupt Status Register */ - __IO uint32_t BUSINTEN; /*!< [0x0014] USB Bus Interrupt Enable Register */ - __IO uint32_t OPER; /*!< [0x0018] USB Operational Register */ - __I uint32_t FRAMECNT; /*!< [0x001c] USB Frame Count Register */ - __IO uint32_t FADDR; /*!< [0x0020] USB Function Address Register */ - __IO uint32_t TEST; /*!< [0x0024] USB Test Mode Register */ - - union - { - __IO uint32_t CEPDAT; - __IO uint8_t CEPDAT_BYTE; - - }; /*!< [0x0028] Control-Endpoint Data Buffer */ - - __IO uint32_t CEPCTL; /*!< [0x002c] Control-Endpoint Control Register */ - __IO uint32_t CEPINTEN; /*!< [0x0030] Control-Endpoint Interrupt Enable */ - __IO uint32_t CEPINTSTS; /*!< [0x0034] Control-Endpoint Interrupt Status */ - __IO uint32_t CEPTXCNT; /*!< [0x0038] Control-Endpoint In-transfer Data Count */ - __I uint32_t CEPRXCNT; /*!< [0x003c] Control-Endpoint Out-transfer Data Count */ - __I uint32_t CEPDATCNT; /*!< [0x0040] Control-Endpoint data count */ - __I uint32_t SETUP1_0; /*!< [0x0044] Setup1 & Setup0 bytes */ - __I uint32_t SETUP3_2; /*!< [0x0048] Setup3 & Setup2 Bytes */ - __I uint32_t SETUP5_4; /*!< [0x004c] Setup5 & Setup4 Bytes */ - __I uint32_t SETUP7_6; /*!< [0x0050] Setup7 & Setup6 Bytes */ - __IO uint32_t CEPBUFST; /*!< [0x0054] Control Endpoint RAM Start Address Register */ - __IO uint32_t CEPBUFEND; /*!< [0x0058] Control Endpoint RAM End Address Register */ - __IO uint32_t DMACTL; /*!< [0x005c] DMA Control Status Register */ - __IO uint32_t DMACNT; /*!< [0x0060] DMA Count Register */ - - HSUSBD_EP_T EP[12]; - - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[303]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMAADDR; /*!< [0x0700] AHB DMA Address Register */ - __IO uint32_t PHYCTL; /*!< [0x0704] USB PHY Control Register */ - -} HSUSBD_T; - -/** - @addtogroup HSUSBD_CONST HSUSBD Bit Field Definition - Constant Definitions for HSUSBD Controller -@{ */ - -#define HSUSBD_GINTSTS_USBIF_Pos (0) /*!< HSUSBD_T::GINTSTS: USBIF Position */ -#define HSUSBD_GINTSTS_USBIF_Msk (0x1ul << HSUSBD_GINTSTS_USBIF_Pos) /*!< HSUSBD_T::GINTSTS: USBIF Mask */ - -#define HSUSBD_GINTSTS_CEPIF_Pos (1) /*!< HSUSBD_T::GINTSTS: CEPIF Position */ -#define HSUSBD_GINTSTS_CEPIF_Msk (0x1ul << HSUSBD_GINTSTS_CEPIF_Pos) /*!< HSUSBD_T::GINTSTS: CEPIF Mask */ - -#define HSUSBD_GINTSTS_EPAIF_Pos (2) /*!< HSUSBD_T::GINTSTS: EPAIF Position */ -#define HSUSBD_GINTSTS_EPAIF_Msk (0x1ul << HSUSBD_GINTSTS_EPAIF_Pos) /*!< HSUSBD_T::GINTSTS: EPAIF Mask */ - -#define HSUSBD_GINTSTS_EPBIF_Pos (3) /*!< HSUSBD_T::GINTSTS: EPBIF Position */ -#define HSUSBD_GINTSTS_EPBIF_Msk (0x1ul << HSUSBD_GINTSTS_EPBIF_Pos) /*!< HSUSBD_T::GINTSTS: EPBIF Mask */ - -#define HSUSBD_GINTSTS_EPCIF_Pos (4) /*!< HSUSBD_T::GINTSTS: EPCIF Position */ -#define HSUSBD_GINTSTS_EPCIF_Msk (0x1ul << HSUSBD_GINTSTS_EPCIF_Pos) /*!< HSUSBD_T::GINTSTS: EPCIF Mask */ - -#define HSUSBD_GINTSTS_EPDIF_Pos (5) /*!< HSUSBD_T::GINTSTS: EPDIF Position */ -#define HSUSBD_GINTSTS_EPDIF_Msk (0x1ul << HSUSBD_GINTSTS_EPDIF_Pos) /*!< HSUSBD_T::GINTSTS: EPDIF Mask */ - -#define HSUSBD_GINTSTS_EPEIF_Pos (6) /*!< HSUSBD_T::GINTSTS: EPEIF Position */ -#define HSUSBD_GINTSTS_EPEIF_Msk (0x1ul << HSUSBD_GINTSTS_EPEIF_Pos) /*!< HSUSBD_T::GINTSTS: EPEIF Mask */ - -#define HSUSBD_GINTSTS_EPFIF_Pos (7) /*!< HSUSBD_T::GINTSTS: EPFIF Position */ -#define HSUSBD_GINTSTS_EPFIF_Msk (0x1ul << HSUSBD_GINTSTS_EPFIF_Pos) /*!< HSUSBD_T::GINTSTS: EPFIF Mask */ - -#define HSUSBD_GINTSTS_EPGIF_Pos (8) /*!< HSUSBD_T::GINTSTS: EPGIF Position */ -#define HSUSBD_GINTSTS_EPGIF_Msk (0x1ul << HSUSBD_GINTSTS_EPGIF_Pos) /*!< HSUSBD_T::GINTSTS: EPGIF Mask */ - -#define HSUSBD_GINTSTS_EPHIF_Pos (9) /*!< HSUSBD_T::GINTSTS: EPHIF Position */ -#define HSUSBD_GINTSTS_EPHIF_Msk (0x1ul << HSUSBD_GINTSTS_EPHIF_Pos) /*!< HSUSBD_T::GINTSTS: EPHIF Mask */ - -#define HSUSBD_GINTSTS_EPIIF_Pos (10) /*!< HSUSBD_T::GINTSTS: EPIIF Position */ -#define HSUSBD_GINTSTS_EPIIF_Msk (0x1ul << HSUSBD_GINTSTS_EPIIF_Pos) /*!< HSUSBD_T::GINTSTS: EPIIF Mask */ - -#define HSUSBD_GINTSTS_EPJIF_Pos (11) /*!< HSUSBD_T::GINTSTS: EPJIF Position */ -#define HSUSBD_GINTSTS_EPJIF_Msk (0x1ul << HSUSBD_GINTSTS_EPJIF_Pos) /*!< HSUSBD_T::GINTSTS: EPJIF Mask */ - -#define HSUSBD_GINTSTS_EPKIF_Pos (12) /*!< HSUSBD_T::GINTSTS: EPKIF Position */ -#define HSUSBD_GINTSTS_EPKIF_Msk (0x1ul << HSUSBD_GINTSTS_EPKIF_Pos) /*!< HSUSBD_T::GINTSTS: EPKIF Mask */ - -#define HSUSBD_GINTSTS_EPLIF_Pos (13) /*!< HSUSBD_T::GINTSTS: EPLIF Position */ -#define HSUSBD_GINTSTS_EPLIF_Msk (0x1ul << HSUSBD_GINTSTS_EPLIF_Pos) /*!< HSUSBD_T::GINTSTS: EPLIF Mask */ - -#define HSUSBD_GINTEN_USBIEN_Pos (0) /*!< HSUSBD_T::GINTEN: USBIEN Position */ -#define HSUSBD_GINTEN_USBIEN_Msk (0x1ul << HSUSBD_GINTEN_USBIEN_Pos) /*!< HSUSBD_T::GINTEN: USBIEN Mask */ - -#define HSUSBD_GINTEN_CEPIEN_Pos (1) /*!< HSUSBD_T::GINTEN: CEPIEN Position */ -#define HSUSBD_GINTEN_CEPIEN_Msk (0x1ul << HSUSBD_GINTEN_CEPIEN_Pos) /*!< HSUSBD_T::GINTEN: CEPIEN Mask */ - -#define HSUSBD_GINTEN_EPAIEN_Pos (2) /*!< HSUSBD_T::GINTEN: EPAIEN Position */ -#define HSUSBD_GINTEN_EPAIEN_Msk (0x1ul << HSUSBD_GINTEN_EPAIEN_Pos) /*!< HSUSBD_T::GINTEN: EPAIEN Mask */ - -#define HSUSBD_GINTEN_EPBIEN_Pos (3) /*!< HSUSBD_T::GINTEN: EPBIEN Position */ -#define HSUSBD_GINTEN_EPBIEN_Msk (0x1ul << HSUSBD_GINTEN_EPBIEN_Pos) /*!< HSUSBD_T::GINTEN: EPBIEN Mask */ - -#define HSUSBD_GINTEN_EPCIEN_Pos (4) /*!< HSUSBD_T::GINTEN: EPCIEN Position */ -#define HSUSBD_GINTEN_EPCIEN_Msk (0x1ul << HSUSBD_GINTEN_EPCIEN_Pos) /*!< HSUSBD_T::GINTEN: EPCIEN Mask */ - -#define HSUSBD_GINTEN_EPDIEN_Pos (5) /*!< HSUSBD_T::GINTEN: EPDIEN Position */ -#define HSUSBD_GINTEN_EPDIEN_Msk (0x1ul << HSUSBD_GINTEN_EPDIEN_Pos) /*!< HSUSBD_T::GINTEN: EPDIEN Mask */ - -#define HSUSBD_GINTEN_EPEIEN_Pos (6) /*!< HSUSBD_T::GINTEN: EPEIEN Position */ -#define HSUSBD_GINTEN_EPEIEN_Msk (0x1ul << HSUSBD_GINTEN_EPEIEN_Pos) /*!< HSUSBD_T::GINTEN: EPEIEN Mask */ - -#define HSUSBD_GINTEN_EPFIEN_Pos (7) /*!< HSUSBD_T::GINTEN: EPFIEN Position */ -#define HSUSBD_GINTEN_EPFIEN_Msk (0x1ul << HSUSBD_GINTEN_EPFIEN_Pos) /*!< HSUSBD_T::GINTEN: EPFIEN Mask */ - -#define HSUSBD_GINTEN_EPGIEN_Pos (8) /*!< HSUSBD_T::GINTEN: EPGIEN Position */ -#define HSUSBD_GINTEN_EPGIEN_Msk (0x1ul << HSUSBD_GINTEN_EPGIEN_Pos) /*!< HSUSBD_T::GINTEN: EPGIEN Mask */ - -#define HSUSBD_GINTEN_EPHIEN_Pos (9) /*!< HSUSBD_T::GINTEN: EPHIEN Position */ -#define HSUSBD_GINTEN_EPHIEN_Msk (0x1ul << HSUSBD_GINTEN_EPHIEN_Pos) /*!< HSUSBD_T::GINTEN: EPHIEN Mask */ - -#define HSUSBD_GINTEN_EPIIEN_Pos (10) /*!< HSUSBD_T::GINTEN: EPIIEN Position */ -#define HSUSBD_GINTEN_EPIIEN_Msk (0x1ul << HSUSBD_GINTEN_EPIIEN_Pos) /*!< HSUSBD_T::GINTEN: EPIIEN Mask */ - -#define HSUSBD_GINTEN_EPJIEN_Pos (11) /*!< HSUSBD_T::GINTEN: EPJIEN Position */ -#define HSUSBD_GINTEN_EPJIEN_Msk (0x1ul << HSUSBD_GINTEN_EPJIEN_Pos) /*!< HSUSBD_T::GINTEN: EPJIEN Mask */ - -#define HSUSBD_GINTEN_EPKIEN_Pos (12) /*!< HSUSBD_T::GINTEN: EPKIEN Position */ -#define HSUSBD_GINTEN_EPKIEN_Msk (0x1ul << HSUSBD_GINTEN_EPKIEN_Pos) /*!< HSUSBD_T::GINTEN: EPKIEN Mask */ - -#define HSUSBD_GINTEN_EPLIEN_Pos (13) /*!< HSUSBD_T::GINTEN: EPLIEN Position */ -#define HSUSBD_GINTEN_EPLIEN_Msk (0x1ul << HSUSBD_GINTEN_EPLIEN_Pos) /*!< HSUSBD_T::GINTEN: EPLIEN Mask */ - -#define HSUSBD_BUSINTSTS_SOFIF_Pos (0) /*!< HSUSBD_T::BUSINTSTS: SOFIF Position */ -#define HSUSBD_BUSINTSTS_SOFIF_Msk (0x1ul << HSUSBD_BUSINTSTS_SOFIF_Pos) /*!< HSUSBD_T::BUSINTSTS: SOFIF Mask */ - -#define HSUSBD_BUSINTSTS_RSTIF_Pos (1) /*!< HSUSBD_T::BUSINTSTS: RSTIF Position */ -#define HSUSBD_BUSINTSTS_RSTIF_Msk (0x1ul << HSUSBD_BUSINTSTS_RSTIF_Pos) /*!< HSUSBD_T::BUSINTSTS: RSTIF Mask */ - -#define HSUSBD_BUSINTSTS_RESUMEIF_Pos (2) /*!< HSUSBD_T::BUSINTSTS: RESUMEIF Position */ -#define HSUSBD_BUSINTSTS_RESUMEIF_Msk (0x1ul << HSUSBD_BUSINTSTS_RESUMEIF_Pos) /*!< HSUSBD_T::BUSINTSTS: RESUMEIF Mask */ - -#define HSUSBD_BUSINTSTS_SUSPENDIF_Pos (3) /*!< HSUSBD_T::BUSINTSTS: SUSPENDIF Position*/ -#define HSUSBD_BUSINTSTS_SUSPENDIF_Msk (0x1ul << HSUSBD_BUSINTSTS_SUSPENDIF_Pos) /*!< HSUSBD_T::BUSINTSTS: SUSPENDIF Mask */ - -#define HSUSBD_BUSINTSTS_HISPDIF_Pos (4) /*!< HSUSBD_T::BUSINTSTS: HISPDIF Position */ -#define HSUSBD_BUSINTSTS_HISPDIF_Msk (0x1ul << HSUSBD_BUSINTSTS_HISPDIF_Pos) /*!< HSUSBD_T::BUSINTSTS: HISPDIF Mask */ - -#define HSUSBD_BUSINTSTS_DMADONEIF_Pos (5) /*!< HSUSBD_T::BUSINTSTS: DMADONEIF Position*/ -#define HSUSBD_BUSINTSTS_DMADONEIF_Msk (0x1ul << HSUSBD_BUSINTSTS_DMADONEIF_Pos) /*!< HSUSBD_T::BUSINTSTS: DMADONEIF Mask */ - -#define HSUSBD_BUSINTSTS_PHYCLKVLDIF_Pos (6) /*!< HSUSBD_T::BUSINTSTS: PHYCLKVLDIF Position*/ -#define HSUSBD_BUSINTSTS_PHYCLKVLDIF_Msk (0x1ul << HSUSBD_BUSINTSTS_PHYCLKVLDIF_Pos) /*!< HSUSBD_T::BUSINTSTS: PHYCLKVLDIF Mask */ - -#define HSUSBD_BUSINTSTS_VBUSDETIF_Pos (8) /*!< HSUSBD_T::BUSINTSTS: VBUSDETIF Position*/ -#define HSUSBD_BUSINTSTS_VBUSDETIF_Msk (0x1ul << HSUSBD_BUSINTSTS_VBUSDETIF_Pos) /*!< HSUSBD_T::BUSINTSTS: VBUSDETIF Mask */ - -#define HSUSBD_BUSINTEN_SOFIEN_Pos (0) /*!< HSUSBD_T::BUSINTEN: SOFIEN Position */ -#define HSUSBD_BUSINTEN_SOFIEN_Msk (0x1ul << HSUSBD_BUSINTEN_SOFIEN_Pos) /*!< HSUSBD_T::BUSINTEN: SOFIEN Mask */ - -#define HSUSBD_BUSINTEN_RSTIEN_Pos (1) /*!< HSUSBD_T::BUSINTEN: RSTIEN Position */ -#define HSUSBD_BUSINTEN_RSTIEN_Msk (0x1ul << HSUSBD_BUSINTEN_RSTIEN_Pos) /*!< HSUSBD_T::BUSINTEN: RSTIEN Mask */ - -#define HSUSBD_BUSINTEN_RESUMEIEN_Pos (2) /*!< HSUSBD_T::BUSINTEN: RESUMEIEN Position */ -#define HSUSBD_BUSINTEN_RESUMEIEN_Msk (0x1ul << HSUSBD_BUSINTEN_RESUMEIEN_Pos) /*!< HSUSBD_T::BUSINTEN: RESUMEIEN Mask */ - -#define HSUSBD_BUSINTEN_SUSPENDIEN_Pos (3) /*!< HSUSBD_T::BUSINTEN: SUSPENDIEN Position*/ -#define HSUSBD_BUSINTEN_SUSPENDIEN_Msk (0x1ul << HSUSBD_BUSINTEN_SUSPENDIEN_Pos) /*!< HSUSBD_T::BUSINTEN: SUSPENDIEN Mask */ - -#define HSUSBD_BUSINTEN_HISPDIEN_Pos (4) /*!< HSUSBD_T::BUSINTEN: HISPDIEN Position */ -#define HSUSBD_BUSINTEN_HISPDIEN_Msk (0x1ul << HSUSBD_BUSINTEN_HISPDIEN_Pos) /*!< HSUSBD_T::BUSINTEN: HISPDIEN Mask */ - -#define HSUSBD_BUSINTEN_DMADONEIEN_Pos (5) /*!< HSUSBD_T::BUSINTEN: DMADONEIEN Position*/ -#define HSUSBD_BUSINTEN_DMADONEIEN_Msk (0x1ul << HSUSBD_BUSINTEN_DMADONEIEN_Pos) /*!< HSUSBD_T::BUSINTEN: DMADONEIEN Mask */ - -#define HSUSBD_BUSINTEN_PHYCLKVLDIEN_Pos (6) /*!< HSUSBD_T::BUSINTEN: PHYCLKVLDIEN Position*/ -#define HSUSBD_BUSINTEN_PHYCLKVLDIEN_Msk (0x1ul << HSUSBD_BUSINTEN_PHYCLKVLDIEN_Pos) /*!< HSUSBD_T::BUSINTEN: PHYCLKVLDIEN Mask */ - -#define HSUSBD_BUSINTEN_VBUSDETIEN_Pos (8) /*!< HSUSBD_T::BUSINTEN: VBUSDETIEN Position*/ -#define HSUSBD_BUSINTEN_VBUSDETIEN_Msk (0x1ul << HSUSBD_BUSINTEN_VBUSDETIEN_Pos) /*!< HSUSBD_T::BUSINTEN: VBUSDETIEN Mask */ - -#define HSUSBD_OPER_RESUMEEN_Pos (0) /*!< HSUSBD_T::OPER: RESUMEEN Position */ -#define HSUSBD_OPER_RESUMEEN_Msk (0x1ul << HSUSBD_OPER_RESUMEEN_Pos) /*!< HSUSBD_T::OPER: RESUMEEN Mask */ - -#define HSUSBD_OPER_HISPDEN_Pos (1) /*!< HSUSBD_T::OPER: HISPDEN Position */ -#define HSUSBD_OPER_HISPDEN_Msk (0x1ul << HSUSBD_OPER_HISPDEN_Pos) /*!< HSUSBD_T::OPER: HISPDEN Mask */ - -#define HSUSBD_OPER_CURSPD_Pos (2) /*!< HSUSBD_T::OPER: CURSPD Position */ -#define HSUSBD_OPER_CURSPD_Msk (0x1ul << HSUSBD_OPER_CURSPD_Pos) /*!< HSUSBD_T::OPER: CURSPD Mask */ - -#define HSUSBD_FRAMECNT_MFRAMECNT_Pos (0) /*!< HSUSBD_T::FRAMECNT: MFRAMECNT Position */ -#define HSUSBD_FRAMECNT_MFRAMECNT_Msk (0x7ul << HSUSBD_FRAMECNT_MFRAMECNT_Pos) /*!< HSUSBD_T::FRAMECNT: MFRAMECNT Mask */ - -#define HSUSBD_FRAMECNT_FRAMECNT_Pos (3) /*!< HSUSBD_T::FRAMECNT: FRAMECNT Position */ -#define HSUSBD_FRAMECNT_FRAMECNT_Msk (0x7fful << HSUSBD_FRAMECNT_FRAMECNT_Pos) /*!< HSUSBD_T::FRAMECNT: FRAMECNT Mask */ - -#define HSUSBD_FADDR_FADDR_Pos (0) /*!< HSUSBD_T::FADDR: FADDR Position */ -#define HSUSBD_FADDR_FADDR_Msk (0x7ful << HSUSBD_FADDR_FADDR_Pos) /*!< HSUSBD_T::FADDR: FADDR Mask */ - -#define HSUSBD_TEST_TESTMODE_Pos (0) /*!< HSUSBD_T::TEST: TESTMODE Position */ -#define HSUSBD_TEST_TESTMODE_Msk (0x7ul << HSUSBD_TEST_TESTMODE_Pos) /*!< HSUSBD_T::TEST: TESTMODE Mask */ - -#define HSUSBD_CEPDAT_DAT_Pos (0) /*!< HSUSBD_T::CEPDAT: DAT Position */ -#define HSUSBD_CEPDAT_DAT_Msk (0xfffffffful << HSUSBD_CEPDAT_DAT_Pos) /*!< HSUSBD_T::CEPDAT: DAT Mask */ - -#define HSUSBD_CEPCTL_NAKCLR_Pos (0) /*!< HSUSBD_T::CEPCTL: NAKCLR Position */ -#define HSUSBD_CEPCTL_NAKCLR_Msk (0x1ul << HSUSBD_CEPCTL_NAKCLR_Pos) /*!< HSUSBD_T::CEPCTL: NAKCLR Mask */ - -#define HSUSBD_CEPCTL_STALLEN_Pos (1) /*!< HSUSBD_T::CEPCTL: STALLEN Position */ -#define HSUSBD_CEPCTL_STALLEN_Msk (0x1ul << HSUSBD_CEPCTL_STALLEN_Pos) /*!< HSUSBD_T::CEPCTL: STALLEN Mask */ - -#define HSUSBD_CEPCTL_ZEROLEN_Pos (2) /*!< HSUSBD_T::CEPCTL: ZEROLEN Position */ -#define HSUSBD_CEPCTL_ZEROLEN_Msk (0x1ul << HSUSBD_CEPCTL_ZEROLEN_Pos) /*!< HSUSBD_T::CEPCTL: ZEROLEN Mask */ - -#define HSUSBD_CEPCTL_FLUSH_Pos (3) /*!< HSUSBD_T::CEPCTL: FLUSH Position */ -#define HSUSBD_CEPCTL_FLUSH_Msk (0x1ul << HSUSBD_CEPCTL_FLUSH_Pos) /*!< HSUSBD_T::CEPCTL: FLUSH Mask */ - -#define HSUSBD_CEPINTEN_SETUPTKIEN_Pos (0) /*!< HSUSBD_T::CEPINTEN: SETUPTKIEN Position*/ -#define HSUSBD_CEPINTEN_SETUPTKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_SETUPTKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: SETUPTKIEN Mask */ - -#define HSUSBD_CEPINTEN_SETUPPKIEN_Pos (1) /*!< HSUSBD_T::CEPINTEN: SETUPPKIEN Position*/ -#define HSUSBD_CEPINTEN_SETUPPKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_SETUPPKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: SETUPPKIEN Mask */ - -#define HSUSBD_CEPINTEN_OUTTKIEN_Pos (2) /*!< HSUSBD_T::CEPINTEN: OUTTKIEN Position */ -#define HSUSBD_CEPINTEN_OUTTKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_OUTTKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: OUTTKIEN Mask */ - -#define HSUSBD_CEPINTEN_INTKIEN_Pos (3) /*!< HSUSBD_T::CEPINTEN: INTKIEN Position */ -#define HSUSBD_CEPINTEN_INTKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_INTKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: INTKIEN Mask */ - -#define HSUSBD_CEPINTEN_PINGIEN_Pos (4) /*!< HSUSBD_T::CEPINTEN: PINGIEN Position */ -#define HSUSBD_CEPINTEN_PINGIEN_Msk (0x1ul << HSUSBD_CEPINTEN_PINGIEN_Pos) /*!< HSUSBD_T::CEPINTEN: PINGIEN Mask */ - -#define HSUSBD_CEPINTEN_TXPKIEN_Pos (5) /*!< HSUSBD_T::CEPINTEN: TXPKIEN Position */ -#define HSUSBD_CEPINTEN_TXPKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_TXPKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: TXPKIEN Mask */ - -#define HSUSBD_CEPINTEN_RXPKIEN_Pos (6) /*!< HSUSBD_T::CEPINTEN: RXPKIEN Position */ -#define HSUSBD_CEPINTEN_RXPKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_RXPKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: RXPKIEN Mask */ - -#define HSUSBD_CEPINTEN_NAKIEN_Pos (7) /*!< HSUSBD_T::CEPINTEN: NAKIEN Position */ -#define HSUSBD_CEPINTEN_NAKIEN_Msk (0x1ul << HSUSBD_CEPINTEN_NAKIEN_Pos) /*!< HSUSBD_T::CEPINTEN: NAKIEN Mask */ - -#define HSUSBD_CEPINTEN_STALLIEN_Pos (8) /*!< HSUSBD_T::CEPINTEN: STALLIEN Position */ -#define HSUSBD_CEPINTEN_STALLIEN_Msk (0x1ul << HSUSBD_CEPINTEN_STALLIEN_Pos) /*!< HSUSBD_T::CEPINTEN: STALLIEN Mask */ - -#define HSUSBD_CEPINTEN_ERRIEN_Pos (9) /*!< HSUSBD_T::CEPINTEN: ERRIEN Position */ -#define HSUSBD_CEPINTEN_ERRIEN_Msk (0x1ul << HSUSBD_CEPINTEN_ERRIEN_Pos) /*!< HSUSBD_T::CEPINTEN: ERRIEN Mask */ - -#define HSUSBD_CEPINTEN_STSDONEIEN_Pos (10) /*!< HSUSBD_T::CEPINTEN: STSDONEIEN Position*/ -#define HSUSBD_CEPINTEN_STSDONEIEN_Msk (0x1ul << HSUSBD_CEPINTEN_STSDONEIEN_Pos) /*!< HSUSBD_T::CEPINTEN: STSDONEIEN Mask */ - -#define HSUSBD_CEPINTEN_BUFFULLIEN_Pos (11) /*!< HSUSBD_T::CEPINTEN: BUFFULLIEN Position*/ -#define HSUSBD_CEPINTEN_BUFFULLIEN_Msk (0x1ul << HSUSBD_CEPINTEN_BUFFULLIEN_Pos) /*!< HSUSBD_T::CEPINTEN: BUFFULLIEN Mask */ - -#define HSUSBD_CEPINTEN_BUFEMPTYIEN_Pos (12) /*!< HSUSBD_T::CEPINTEN: BUFEMPTYIEN Position*/ -#define HSUSBD_CEPINTEN_BUFEMPTYIEN_Msk (0x1ul << HSUSBD_CEPINTEN_BUFEMPTYIEN_Pos) /*!< HSUSBD_T::CEPINTEN: BUFEMPTYIEN Mask */ - -#define HSUSBD_CEPINTSTS_SETUPTKIF_Pos (0) /*!< HSUSBD_T::CEPINTSTS: SETUPTKIF Position*/ -#define HSUSBD_CEPINTSTS_SETUPTKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_SETUPTKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: SETUPTKIF Mask */ - -#define HSUSBD_CEPINTSTS_SETUPPKIF_Pos (1) /*!< HSUSBD_T::CEPINTSTS: SETUPPKIF Position*/ -#define HSUSBD_CEPINTSTS_SETUPPKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_SETUPPKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: SETUPPKIF Mask */ - -#define HSUSBD_CEPINTSTS_OUTTKIF_Pos (2) /*!< HSUSBD_T::CEPINTSTS: OUTTKIF Position */ -#define HSUSBD_CEPINTSTS_OUTTKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_OUTTKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: OUTTKIF Mask */ - -#define HSUSBD_CEPINTSTS_INTKIF_Pos (3) /*!< HSUSBD_T::CEPINTSTS: INTKIF Position */ -#define HSUSBD_CEPINTSTS_INTKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_INTKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: INTKIF Mask */ - -#define HSUSBD_CEPINTSTS_PINGIF_Pos (4) /*!< HSUSBD_T::CEPINTSTS: PINGIF Position */ -#define HSUSBD_CEPINTSTS_PINGIF_Msk (0x1ul << HSUSBD_CEPINTSTS_PINGIF_Pos) /*!< HSUSBD_T::CEPINTSTS: PINGIF Mask */ - -#define HSUSBD_CEPINTSTS_TXPKIF_Pos (5) /*!< HSUSBD_T::CEPINTSTS: TXPKIF Position */ -#define HSUSBD_CEPINTSTS_TXPKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_TXPKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: TXPKIF Mask */ - -#define HSUSBD_CEPINTSTS_RXPKIF_Pos (6) /*!< HSUSBD_T::CEPINTSTS: RXPKIF Position */ -#define HSUSBD_CEPINTSTS_RXPKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_RXPKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: RXPKIF Mask */ - -#define HSUSBD_CEPINTSTS_NAKIF_Pos (7) /*!< HSUSBD_T::CEPINTSTS: NAKIF Position */ -#define HSUSBD_CEPINTSTS_NAKIF_Msk (0x1ul << HSUSBD_CEPINTSTS_NAKIF_Pos) /*!< HSUSBD_T::CEPINTSTS: NAKIF Mask */ - -#define HSUSBD_CEPINTSTS_STALLIF_Pos (8) /*!< HSUSBD_T::CEPINTSTS: STALLIF Position */ -#define HSUSBD_CEPINTSTS_STALLIF_Msk (0x1ul << HSUSBD_CEPINTSTS_STALLIF_Pos) /*!< HSUSBD_T::CEPINTSTS: STALLIF Mask */ - -#define HSUSBD_CEPINTSTS_ERRIF_Pos (9) /*!< HSUSBD_T::CEPINTSTS: ERRIF Position */ -#define HSUSBD_CEPINTSTS_ERRIF_Msk (0x1ul << HSUSBD_CEPINTSTS_ERRIF_Pos) /*!< HSUSBD_T::CEPINTSTS: ERRIF Mask */ - -#define HSUSBD_CEPINTSTS_STSDONEIF_Pos (10) /*!< HSUSBD_T::CEPINTSTS: STSDONEIF Position*/ -#define HSUSBD_CEPINTSTS_STSDONEIF_Msk (0x1ul << HSUSBD_CEPINTSTS_STSDONEIF_Pos) /*!< HSUSBD_T::CEPINTSTS: STSDONEIF Mask */ - -#define HSUSBD_CEPINTSTS_BUFFULLIF_Pos (11) /*!< HSUSBD_T::CEPINTSTS: BUFFULLIF Position*/ -#define HSUSBD_CEPINTSTS_BUFFULLIF_Msk (0x1ul << HSUSBD_CEPINTSTS_BUFFULLIF_Pos) /*!< HSUSBD_T::CEPINTSTS: BUFFULLIF Mask */ - -#define HSUSBD_CEPINTSTS_BUFEMPTYIF_Pos (12) /*!< HSUSBD_T::CEPINTSTS: BUFEMPTYIF Position*/ -#define HSUSBD_CEPINTSTS_BUFEMPTYIF_Msk (0x1ul << HSUSBD_CEPINTSTS_BUFEMPTYIF_Pos) /*!< HSUSBD_T::CEPINTSTS: BUFEMPTYIF Mask */ - -#define HSUSBD_CEPTXCNT_TXCNT_Pos (0) /*!< HSUSBD_T::CEPTXCNT: TXCNT Position */ -#define HSUSBD_CEPTXCNT_TXCNT_Msk (0xfful << HSUSBD_CEPTXCNT_TXCNT_Pos) /*!< HSUSBD_T::CEPTXCNT: TXCNT Mask */ - -#define HSUSBD_CEPRXCNT_RXCNT_Pos (0) /*!< HSUSBD_T::CEPRXCNT: RXCNT Position */ -#define HSUSBD_CEPRXCNT_RXCNT_Msk (0xfful << HSUSBD_CEPRXCNT_RXCNT_Pos) /*!< HSUSBD_T::CEPRXCNT: RXCNT Mask */ - -#define HSUSBD_CEPDATCNT_DATCNT_Pos (0) /*!< HSUSBD_T::CEPDATCNT: DATCNT Position */ -#define HSUSBD_CEPDATCNT_DATCNT_Msk (0xfffful << HSUSBD_CEPDATCNT_DATCNT_Pos) /*!< HSUSBD_T::CEPDATCNT: DATCNT Mask */ - -#define HSUSBD_SETUP1_0_SETUP0_Pos (0) /*!< HSUSBD_T::SETUP1_0: SETUP0 Position */ -#define HSUSBD_SETUP1_0_SETUP0_Msk (0xfful << HSUSBD_SETUP1_0_SETUP0_Pos) /*!< HSUSBD_T::SETUP1_0: SETUP0 Mask */ - -#define HSUSBD_SETUP1_0_SETUP1_Pos (8) /*!< HSUSBD_T::SETUP1_0: SETUP1 Position */ -#define HSUSBD_SETUP1_0_SETUP1_Msk (0xfful << HSUSBD_SETUP1_0_SETUP1_Pos) /*!< HSUSBD_T::SETUP1_0: SETUP1 Mask */ - -#define HSUSBD_SETUP3_2_SETUP2_Pos (0) /*!< HSUSBD_T::SETUP3_2: SETUP2 Position */ -#define HSUSBD_SETUP3_2_SETUP2_Msk (0xfful << HSUSBD_SETUP3_2_SETUP2_Pos) /*!< HSUSBD_T::SETUP3_2: SETUP2 Mask */ - -#define HSUSBD_SETUP3_2_SETUP3_Pos (8) /*!< HSUSBD_T::SETUP3_2: SETUP3 Position */ -#define HSUSBD_SETUP3_2_SETUP3_Msk (0xfful << HSUSBD_SETUP3_2_SETUP3_Pos) /*!< HSUSBD_T::SETUP3_2: SETUP3 Mask */ - -#define HSUSBD_SETUP5_4_SETUP4_Pos (0) /*!< HSUSBD_T::SETUP5_4: SETUP4 Position */ -#define HSUSBD_SETUP5_4_SETUP4_Msk (0xfful << HSUSBD_SETUP5_4_SETUP4_Pos) /*!< HSUSBD_T::SETUP5_4: SETUP4 Mask */ - -#define HSUSBD_SETUP5_4_SETUP5_Pos (8) /*!< HSUSBD_T::SETUP5_4: SETUP5 Position */ -#define HSUSBD_SETUP5_4_SETUP5_Msk (0xfful << HSUSBD_SETUP5_4_SETUP5_Pos) /*!< HSUSBD_T::SETUP5_4: SETUP5 Mask */ - -#define HSUSBD_SETUP7_6_SETUP6_Pos (0) /*!< HSUSBD_T::SETUP7_6: SETUP6 Position */ -#define HSUSBD_SETUP7_6_SETUP6_Msk (0xfful << HSUSBD_SETUP7_6_SETUP6_Pos) /*!< HSUSBD_T::SETUP7_6: SETUP6 Mask */ - -#define HSUSBD_SETUP7_6_SETUP7_Pos (8) /*!< HSUSBD_T::SETUP7_6: SETUP7 Position */ -#define HSUSBD_SETUP7_6_SETUP7_Msk (0xfful << HSUSBD_SETUP7_6_SETUP7_Pos) /*!< HSUSBD_T::SETUP7_6: SETUP7 Mask */ - -#define HSUSBD_CEPBUFST_SADDR_Pos (0) /*!< HSUSBD_T::CEPBUFST: SADDR Position */ -#define HSUSBD_CEPBUFST_SADDR_Msk (0xffful << HSUSBD_CEPBUFST_SADDR_Pos) /*!< HSUSBD_T::CEPBUFST: SADDR Mask */ - -#define HSUSBD_CEPBUFEND_EADDR_Pos (0) /*!< HSUSBD_T::CEPBUFEND: EADDR Position */ -#define HSUSBD_CEPBUFEND_EADDR_Msk (0xffful << HSUSBD_CEPBUFEND_EADDR_Pos) /*!< HSUSBD_T::CEPBUFEND: EADDR Mask */ - -#define HSUSBD_DMACTL_EPNUM_Pos (0) /*!< HSUSBD_T::DMACTL: EPNUM Position */ -#define HSUSBD_DMACTL_EPNUM_Msk (0xful << HSUSBD_DMACTL_EPNUM_Pos) /*!< HSUSBD_T::DMACTL: EPNUM Mask */ - -#define HSUSBD_DMACTL_DMARD_Pos (4) /*!< HSUSBD_T::DMACTL: DMARD Position */ -#define HSUSBD_DMACTL_DMARD_Msk (0x1ul << HSUSBD_DMACTL_DMARD_Pos) /*!< HSUSBD_T::DMACTL: DMARD Mask */ - -#define HSUSBD_DMACTL_DMAEN_Pos (5) /*!< HSUSBD_T::DMACTL: DMAEN Position */ -#define HSUSBD_DMACTL_DMAEN_Msk (0x1ul << HSUSBD_DMACTL_DMAEN_Pos) /*!< HSUSBD_T::DMACTL: DMAEN Mask */ - -#define HSUSBD_DMACTL_SGEN_Pos (6) /*!< HSUSBD_T::DMACTL: SGEN Position */ -#define HSUSBD_DMACTL_SGEN_Msk (0x1ul << HSUSBD_DMACTL_SGEN_Pos) /*!< HSUSBD_T::DMACTL: SGEN Mask */ - -#define HSUSBD_DMACTL_DMARST_Pos (7) /*!< HSUSBD_T::DMACTL: DMARST Position */ -#define HSUSBD_DMACTL_DMARST_Msk (0x1ul << HSUSBD_DMACTL_DMARST_Pos) /*!< HSUSBD_T::DMACTL: DMARST Mask */ - -#define HSUSBD_DMACTL_SVINEP_Pos (8) /*!< HSUSBD_T::DMACTL: SVINEP Position */ -#define HSUSBD_DMACTL_SVINEP_Msk (0x1ul << HSUSBD_DMACTL_SVINEP_Pos) /*!< HSUSBD_T::DMACTL: SVINEP Mask */ - -#define HSUSBD_DMACNT_DMACNT_Pos (0) /*!< HSUSBD_T::DMACNT: DMACNT Position */ -#define HSUSBD_DMACNT_DMACNT_Msk (0xffffful << HSUSBD_DMACNT_DMACNT_Pos) /*!< HSUSBD_T::DMACNT: DMACNT Mask */ - -#define HSUSBD_EPDAT_EPDAT_Pos (0) /*!< HSUSBD_T::EPDAT: EPDAT Position */ -#define HSUSBD_EPDAT_EPDAT_Msk (0xfffffffful << HSUSBD_EPDAT_EPDAT_Pos) /*!< HSUSBD_T::EPDAT: EPDAT Mask */ - -#define HSUSBD_EPINTSTS_BUFFULLIF_Pos (0) /*!< HSUSBD_T::EPINTSTS: BUFFULLIF Position */ -#define HSUSBD_EPINTSTS_BUFFULLIF_Msk (0x1ul << HSUSBD_EPINTSTS_BUFFULLIF_Pos) /*!< HSUSBD_T::EPINTSTS: BUFFULLIF Mask */ - -#define HSUSBD_EPINTSTS_BUFEMPTYIF_Pos (1) /*!< HSUSBD_T::EPINTSTS: BUFEMPTYIF Position*/ -#define HSUSBD_EPINTSTS_BUFEMPTYIF_Msk (0x1ul << HSUSBD_EPINTSTS_BUFEMPTYIF_Pos) /*!< HSUSBD_T::EPINTSTS: BUFEMPTYIF Mask */ - -#define HSUSBD_EPINTSTS_SHORTTXIF_Pos (2) /*!< HSUSBD_T::EPINTSTS: SHORTTXIF Position */ -#define HSUSBD_EPINTSTS_SHORTTXIF_Msk (0x1ul << HSUSBD_EPINTSTS_SHORTTXIF_Pos) /*!< HSUSBD_T::EPINTSTS: SHORTTXIF Mask */ - -#define HSUSBD_EPINTSTS_TXPKIF_Pos (3) /*!< HSUSBD_T::EPINTSTS: TXPKIF Position */ -#define HSUSBD_EPINTSTS_TXPKIF_Msk (0x1ul << HSUSBD_EPINTSTS_TXPKIF_Pos) /*!< HSUSBD_T::EPINTSTS: TXPKIF Mask */ - -#define HSUSBD_EPINTSTS_RXPKIF_Pos (4) /*!< HSUSBD_T::EPINTSTS: RXPKIF Position */ -#define HSUSBD_EPINTSTS_RXPKIF_Msk (0x1ul << HSUSBD_EPINTSTS_RXPKIF_Pos) /*!< HSUSBD_T::EPINTSTS: RXPKIF Mask */ - -#define HSUSBD_EPINTSTS_OUTTKIF_Pos (5) /*!< HSUSBD_T::EPINTSTS: OUTTKIF Position */ -#define HSUSBD_EPINTSTS_OUTTKIF_Msk (0x1ul << HSUSBD_EPINTSTS_OUTTKIF_Pos) /*!< HSUSBD_T::EPINTSTS: OUTTKIF Mask */ - -#define HSUSBD_EPINTSTS_INTKIF_Pos (6) /*!< HSUSBD_T::EPINTSTS: INTKIF Position */ -#define HSUSBD_EPINTSTS_INTKIF_Msk (0x1ul << HSUSBD_EPINTSTS_INTKIF_Pos) /*!< HSUSBD_T::EPINTSTS: INTKIF Mask */ - -#define HSUSBD_EPINTSTS_PINGIF_Pos (7) /*!< HSUSBD_T::EPINTSTS: PINGIF Position */ -#define HSUSBD_EPINTSTS_PINGIF_Msk (0x1ul << HSUSBD_EPINTSTS_PINGIF_Pos) /*!< HSUSBD_T::EPINTSTS: PINGIF Mask */ - -#define HSUSBD_EPINTSTS_NAKIF_Pos (8) /*!< HSUSBD_T::EPINTSTS: NAKIF Position */ -#define HSUSBD_EPINTSTS_NAKIF_Msk (0x1ul << HSUSBD_EPINTSTS_NAKIF_Pos) /*!< HSUSBD_T::EPINTSTS: NAKIF Mask */ - -#define HSUSBD_EPINTSTS_STALLIF_Pos (9) /*!< HSUSBD_T::EPINTSTS: STALLIF Position */ -#define HSUSBD_EPINTSTS_STALLIF_Msk (0x1ul << HSUSBD_EPINTSTS_STALLIF_Pos) /*!< HSUSBD_T::EPINTSTS: STALLIF Mask */ - -#define HSUSBD_EPINTSTS_NYETIF_Pos (10) /*!< HSUSBD_T::EPINTSTS: NYETIF Position */ -#define HSUSBD_EPINTSTS_NYETIF_Msk (0x1ul << HSUSBD_EPINTSTS_NYETIF_Pos) /*!< HSUSBD_T::EPINTSTS: NYETIF Mask */ - -#define HSUSBD_EPINTSTS_ERRIF_Pos (11) /*!< HSUSBD_T::EPINTSTS: ERRIF Position */ -#define HSUSBD_EPINTSTS_ERRIF_Msk (0x1ul << HSUSBD_EPINTSTS_ERRIF_Pos) /*!< HSUSBD_T::EPINTSTS: ERRIF Mask */ - -#define HSUSBD_EPINTSTS_SHORTRXIF_Pos (12) /*!< HSUSBD_T::EPINTSTS: SHORTRXIF Position */ -#define HSUSBD_EPINTSTS_SHORTRXIF_Msk (0x1ul << HSUSBD_EPINTSTS_SHORTRXIF_Pos) /*!< HSUSBD_T::EPINTSTS: SHORTRXIF Mask */ - -#define HSUSBD_EPINTEN_BUFFULLIEN_Pos (0) /*!< HSUSBD_T::EPINTEN: BUFFULLIEN Position */ -#define HSUSBD_EPINTEN_BUFFULLIEN_Msk (0x1ul << HSUSBD_EPINTEN_BUFFULLIEN_Pos) /*!< HSUSBD_T::EPINTEN: BUFFULLIEN Mask */ - -#define HSUSBD_EPINTEN_BUFEMPTYIEN_Pos (1) /*!< HSUSBD_T::EPINTEN: BUFEMPTYIEN Position*/ -#define HSUSBD_EPINTEN_BUFEMPTYIEN_Msk (0x1ul << HSUSBD_EPINTEN_BUFEMPTYIEN_Pos) /*!< HSUSBD_T::EPINTEN: BUFEMPTYIEN Mask */ - -#define HSUSBD_EPINTEN_SHORTTXIEN_Pos (2) /*!< HSUSBD_T::EPINTEN: SHORTTXIEN Position */ -#define HSUSBD_EPINTEN_SHORTTXIEN_Msk (0x1ul << HSUSBD_EPINTEN_SHORTTXIEN_Pos) /*!< HSUSBD_T::EPINTEN: SHORTTXIEN Mask */ - -#define HSUSBD_EPINTEN_TXPKIEN_Pos (3) /*!< HSUSBD_T::EPINTEN: TXPKIEN Position */ -#define HSUSBD_EPINTEN_TXPKIEN_Msk (0x1ul << HSUSBD_EPINTEN_TXPKIEN_Pos) /*!< HSUSBD_T::EPINTEN: TXPKIEN Mask */ - -#define HSUSBD_EPINTEN_RXPKIEN_Pos (4) /*!< HSUSBD_T::EPINTEN: RXPKIEN Position */ -#define HSUSBD_EPINTEN_RXPKIEN_Msk (0x1ul << HSUSBD_EPINTEN_RXPKIEN_Pos) /*!< HSUSBD_T::EPINTEN: RXPKIEN Mask */ - -#define HSUSBD_EPINTEN_OUTTKIEN_Pos (5) /*!< HSUSBD_T::EPINTEN: OUTTKIEN Position */ -#define HSUSBD_EPINTEN_OUTTKIEN_Msk (0x1ul << HSUSBD_EPINTEN_OUTTKIEN_Pos) /*!< HSUSBD_T::EPINTEN: OUTTKIEN Mask */ - -#define HSUSBD_EPINTEN_INTKIEN_Pos (6) /*!< HSUSBD_T::EPINTEN: INTKIEN Position */ -#define HSUSBD_EPINTEN_INTKIEN_Msk (0x1ul << HSUSBD_EPINTEN_INTKIEN_Pos) /*!< HSUSBD_T::EPINTEN: INTKIEN Mask */ - -#define HSUSBD_EPINTEN_PINGIEN_Pos (7) /*!< HSUSBD_T::EPINTEN: PINGIEN Position */ -#define HSUSBD_EPINTEN_PINGIEN_Msk (0x1ul << HSUSBD_EPINTEN_PINGIEN_Pos) /*!< HSUSBD_T::EPINTEN: PINGIEN Mask */ - -#define HSUSBD_EPINTEN_NAKIEN_Pos (8) /*!< HSUSBD_T::EPINTEN: NAKIEN Position */ -#define HSUSBD_EPINTEN_NAKIEN_Msk (0x1ul << HSUSBD_EPINTEN_NAKIEN_Pos) /*!< HSUSBD_T::EPINTEN: NAKIEN Mask */ - -#define HSUSBD_EPINTEN_STALLIEN_Pos (9) /*!< HSUSBD_T::EPINTEN: STALLIEN Position */ -#define HSUSBD_EPINTEN_STALLIEN_Msk (0x1ul << HSUSBD_EPINTEN_STALLIEN_Pos) /*!< HSUSBD_T::EPINTEN: STALLIEN Mask */ - -#define HSUSBD_EPINTEN_NYETIEN_Pos (10) /*!< HSUSBD_T::EPINTEN: NYETIEN Position */ -#define HSUSBD_EPINTEN_NYETIEN_Msk (0x1ul << HSUSBD_EPINTEN_NYETIEN_Pos) /*!< HSUSBD_T::EPINTEN: NYETIEN Mask */ - -#define HSUSBD_EPINTEN_ERRIEN_Pos (11) /*!< HSUSBD_T::EPINTEN: ERRIEN Position */ -#define HSUSBD_EPINTEN_ERRIEN_Msk (0x1ul << HSUSBD_EPINTEN_ERRIEN_Pos) /*!< HSUSBD_T::EPINTEN: ERRIEN Mask */ - -#define HSUSBD_EPINTEN_SHORTRXIEN_Pos (12) /*!< HSUSBD_T::EPINTEN: SHORTRXIEN Position */ -#define HSUSBD_EPINTEN_SHORTRXIEN_Msk (0x1ul << HSUSBD_EPINTEN_SHORTRXIEN_Pos) /*!< HSUSBD_T::EPINTEN: SHORTRXIEN Mask */ - -#define HSUSBD_EPDATCNT_DATCNT_Pos (0) /*!< HSUSBD_T::EPDATCNT: DATCNT Position */ -#define HSUSBD_EPDATCNT_DATCNT_Msk (0xfffful << HSUSBD_EPDATCNT_DATCNT_Pos) /*!< HSUSBD_T::EPDATCNT: DATCNT Mask */ - -#define HSUSBD_EPDATCNT_DMALOOP_Pos (16) /*!< HSUSBD_T::EPDATCNT: DMALOOP Position */ -#define HSUSBD_EPDATCNT_DMALOOP_Msk (0x7ffful << HSUSBD_EPDATCNT_DMALOOP_Pos) /*!< HSUSBD_T::EPDATCNT: DMALOOP Mask */ - -#define HSUSBD_EPRSPCTL_FLUSH_Pos (0) /*!< HSUSBD_T::EPRSPCTL: FLUSH Position */ -#define HSUSBD_EPRSPCTL_FLUSH_Msk (0x1ul << HSUSBD_EPRSPCTL_FLUSH_Pos) /*!< HSUSBD_T::EPRSPCTL: FLUSH Mask */ - -#define HSUSBD_EPRSPCTL_MODE_Pos (1) /*!< HSUSBD_T::EPRSPCTL: MODE Position */ -#define HSUSBD_EPRSPCTL_MODE_Msk (0x3ul << HSUSBD_EPRSPCTL_MODE_Pos) /*!< HSUSBD_T::EPRSPCTL: MODE Mask */ - -#define HSUSBD_EPRSPCTL_TOGGLE_Pos (3) /*!< HSUSBD_T::EPRSPCTL: TOGGLE Position */ -#define HSUSBD_EPRSPCTL_TOGGLE_Msk (0x1ul << HSUSBD_EPRSPCTL_TOGGLE_Pos) /*!< HSUSBD_T::EPRSPCTL: TOGGLE Mask */ - -#define HSUSBD_EPRSPCTL_HALT_Pos (4) /*!< HSUSBD_T::EPRSPCTL: HALT Position */ -#define HSUSBD_EPRSPCTL_HALT_Msk (0x1ul << HSUSBD_EPRSPCTL_HALT_Pos) /*!< HSUSBD_T::EPRSPCTL: HALT Mask */ - -#define HSUSBD_EPRSPCTL_ZEROLEN_Pos (5) /*!< HSUSBD_T::EPRSPCTL: ZEROLEN Position */ -#define HSUSBD_EPRSPCTL_ZEROLEN_Msk (0x1ul << HSUSBD_EPRSPCTL_ZEROLEN_Pos) /*!< HSUSBD_T::EPRSPCTL: ZEROLEN Mask */ - -#define HSUSBD_EPRSPCTL_SHORTTXEN_Pos (6) /*!< HSUSBD_T::EPRSPCTL: SHORTTXEN Position */ -#define HSUSBD_EPRSPCTL_SHORTTXEN_Msk (0x1ul << HSUSBD_EPRSPCTL_SHORTTXEN_Pos) /*!< HSUSBD_T::EPRSPCTL: SHORTTXEN Mask */ - -#define HSUSBD_EPRSPCTL_DISBUF_Pos (7) /*!< HSUSBD_T::EPRSPCTL: DISBUF Position */ -#define HSUSBD_EPRSPCTL_DISBUF_Msk (0x1ul << HSUSBD_EPRSPCTL_DISBUF_Pos) /*!< HSUSBD_T::EPRSPCTL: DISBUF Mask */ - -#define HSUSBD_EPMPS_EPMPS_Pos (0) /*!< HSUSBD_T::EPMPS: EPMPS Position */ -#define HSUSBD_EPMPS_EPMPS_Msk (0x7fful << HSUSBD_EPMPS_EPMPS_Pos) /*!< HSUSBD_T::EPMPS: EPMPS Mask */ - -#define HSUSBD_EPTXCNT_TXCNT_Pos (0) /*!< HSUSBD_T::EPTXCNT: TXCNT Position */ -#define HSUSBD_EPTXCNT_TXCNT_Msk (0x7fful << HSUSBD_EPTXCNT_TXCNT_Pos) /*!< HSUSBD_T::EPTXCNT: TXCNT Mask */ - -#define HSUSBD_EPCFG_EPEN_Pos (0) /*!< HSUSBD_T::EPCFG: EPEN Position */ -#define HSUSBD_EPCFG_EPEN_Msk (0x1ul << HSUSBD_EPCFG_EPEN_Pos) /*!< HSUSBD_T::EPCFG: EPEN Mask */ - -#define HSUSBD_EPCFG_EPTYPE_Pos (1) /*!< HSUSBD_T::EPCFG: EPTYPE Position */ -#define HSUSBD_EPCFG_EPTYPE_Msk (0x3ul << HSUSBD_EPCFG_EPTYPE_Pos) /*!< HSUSBD_T::EPCFG: EPTYPE Mask */ - -#define HSUSBD_EPCFG_EPDIR_Pos (3) /*!< HSUSBD_T::EPCFG: EPDIR Position */ -#define HSUSBD_EPCFG_EPDIR_Msk (0x1ul << HSUSBD_EPCFG_EPDIR_Pos) /*!< HSUSBD_T::EPCFG: EPDIR Mask */ - -#define HSUSBD_EPCFG_EPNUM_Pos (4) /*!< HSUSBD_T::EPCFG: EPNUM Position */ -#define HSUSBD_EPCFG_EPNUM_Msk (0xful << HSUSBD_EPCFG_EPNUM_Pos) /*!< HSUSBD_T::EPCFG: EPNUM Mask */ - -#define HSUSBD_EPBUFST_SADDR_Pos (0) /*!< HSUSBD_T::EPBUFST: SADDR Position */ -#define HSUSBD_EPBUFST_SADDR_Msk (0xffful << HSUSBD_EPBUFST_SADDR_Pos) /*!< HSUSBD_T::EPBUFST: SADDR Mask */ - -#define HSUSBD_EPBUFEND_EADDR_Pos (0) /*!< HSUSBD_T::EPBUFEND: EADDR Position */ -#define HSUSBD_EPBUFEND_EADDR_Msk (0xffful << HSUSBD_EPBUFEND_EADDR_Pos) /*!< HSUSBD_T::EPBUFEND: EADDR Mask */ - -#define HSUSBD_DMAADDR_DMAADDR_Pos (0) /*!< HSUSBD_T::DMAADDR: DMAADDR Position */ -#define HSUSBD_DMAADDR_DMAADDR_Msk (0xfffffffful << HSUSBD_DMAADDR_DMAADDR_Pos) /*!< HSUSBD_T::DMAADDR: DMAADDR Mask */ - -#define HSUSBD_PHYCTL_DPPUEN_Pos (8) /*!< HSUSBD_T::PHYCTL: DPPUEN Position */ -#define HSUSBD_PHYCTL_DPPUEN_Msk (0x1ul << HSUSBD_PHYCTL_DPPUEN_Pos) /*!< HSUSBD_T::PHYCTL: DPPUEN Mask */ - -#define HSUSBD_PHYCTL_PHYEN_Pos (9) /*!< HSUSBD_T::PHYCTL: PHYEN Position */ -#define HSUSBD_PHYCTL_PHYEN_Msk (0x1ul << HSUSBD_PHYCTL_PHYEN_Pos) /*!< HSUSBD_T::PHYCTL: PHYEN Mask */ - -#define HSUSBD_PHYCTL_WKEN_Pos (24) /*!< HSUSBD_T::PHYCTL: WKEN Position */ -#define HSUSBD_PHYCTL_WKEN_Msk (0x1ul << HSUSBD_PHYCTL_WKEN_Pos) /*!< HSUSBD_T::PHYCTL: WKEN Mask */ - -#define HSUSBD_PHYCTL_VBUSDET_Pos (31) /*!< HSUSBD_T::PHYCTL: VBUSDET Position */ -#define HSUSBD_PHYCTL_VBUSDET_Msk (0x1ul << HSUSBD_PHYCTL_VBUSDET_Pos) /*!< HSUSBD_T::PHYCTL: VBUSDET Mask */ - -/**@}*/ /* HSUSBD_CONST */ -/**@}*/ /* end of HSUSBD register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __HSUSBD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbh_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbh_reg.h deleted file mode 100644 index 57cc5d03760..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/hsusbh_reg.h +++ /dev/null @@ -1,653 +0,0 @@ -/**************************************************************************//** - * @file hsusbh_reg.h - * @version V1.00 - * @brief HSUSBH register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HSUSBH_REG_H__ -#define __HSUSBH_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup HSUSBH High Speed USB Host Controller (HSUSBH) - Memory Mapped Structure for HSUSBH Controller -@{ */ - -typedef struct -{ - - - /** - * @var HSUSBH_T::EHCVNR - * Offset: 0x00 EHCI Version Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CRLEN |Capability Registers Length - * | | |This register is used as an offset to add to register base to find the beginning of the Operational Register Space. - * |[31:16] |VERSION |Host Controller Interface Version Number - * | | |This is a two-byte register containing a BCD encoding of the EHCI revision number supported by this host controller - * | | |The most significant byte of this register represents a major revision and the least significant byte is the minor revision. - * @var HSUSBH_T::EHCSPR - * Offset: 0x04 EHCI Structural Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |N_PORTS |Number of Physical Downstream Ports - * | | |This field specifies the number of physical downstream ports implemented on this host controller - * | | |The value of this field determines how many port registers are addressable in the Operational Register Space (see Table 2-8) - * | | |Valid values are in the range of 1H to FH. - * | | |A zero in this field is undefined. - * |[4] |PPC |Port Power Control - * | | |This field indicates whether the host controller implementation includes port power control - * | | |A one in this bit indicates the ports have port power switches - * | | |A zero in this bit indicates the port do not have port power stitches - * | | |The value of this field affects the functionality of the Port Power field in each port status and control register. - * |[11:8] |N_PCC |Number of Ports Per Companion Controller - * | | |This field indicates the number of ports supported per companion host controller - * | | |It is used to indicate the port routing configuration to system software. - * | | |For example, if N_PORTS has a value of 6 and N_CC has a value of 2 then N_PCC could have a value of 3 - * | | |The convention is that the first N_PCC ports are assumed to be routed to companion controller 1, the next N_PCC ports to companion controller 2, etc - * | | |In the previous example, the N_PCC could have been 4, where the first 4 are routed to companion controller 1 and the last two are routed to companion controller 2. - * | | |The number in this field must be consistent with N_PORTS and N_CC. - * |[15:12] |N_CC |Number of Companion Controller - * | | |This field indicates the number of companion controllers associated with this USB 2.0 host controller. - * | | |A zero in this field indicates there are no companion host controllers - * | | |Port-ownership hand-off is not supported - * | | |Only high-speed devices are supported on the host controller root ports. - * | | |A value larger than zero in this field indicates there are companion USB 1.1 host controller(s) - * | | |Port-ownership hand-offs are supported - * | | |High, Full- and Low-speed devices are supported on the host controller root ports. - * @var HSUSBH_T::EHCCPR - * Offset: 0x08 EHCI Capability Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AC64 |64-bit Addressing Capability - * | | |0 = Data structure using 32-bit address memory pointers. - * |[1] |PFLF |Programmable Frame List Flag - * | | |0 = System software must use a frame list length of 1024 elements with this EHCI host controller. - * |[2] |ASPC |Asynchronous Schedule Park Capability - * | | |0 = This EHCI host controller doesn't support park feature of high-speed queue heads in the Asynchronous Schedule. - * |[7:4] |IST |Isochronous Scheduling Threshold - * | | |This field indicates, relative to the current position of the executing host controller, where software can reliably update the isochronous schedule. - * | | |When bit [7] is zero, the value of the least significant 3 bits indicates the number of micro-frames a host controller can hold a set of isochronous data structures (one or more) before flushing the state. - * |[15:8] |EECP |EHCI Extended Capabilities Pointer (EECP) - * | | |0 = No extended capabilities are implemented. - * @var HSUSBH_T::UCMDR - * Offset: 0x20 USB Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RUN |Run/Stop (R/W) - * | | |When set to a 1, the Host Controller proceeds with execution of the schedule - * | | |The Host Controller continues execution as long as this bit is set to a 1 - * | | |When this bit is set to 0, the Host Controller completes the current and any actively pipelined transactions on the USB and then halts - * | | |The Host Controller must halt within 16 micro-frames after software clears the Run bit - * | | |The HC Halted bit in the status register indicates when the Host Controller has finished its pending pipelined transactions and has entered the stopped state - * | | |Software must not write a one to this field unless the host controller is in the Halted state (i.e. - * | | |HCHalted in the USBSTS register is a one) - * | | |Doing so will yield undefined results. - * | | |0 = Stop. - * | | |1 = Run. - * |[1] |HCRST |Host Controller Reset (HCRESET) (R/W) - * | | |This control bit is used by software to reset the host controller - * | | |The effects of this on Root Hub registers are similar to a Chip Hardware Reset. - * | | |When software writes a one to this bit, the Host Controller resets its internal pipelines, timers, counters, state machines, etc - * | | |to their initial value - * | | |Any transaction currently in progress on USB is immediately terminated - * | | |A USB reset is not driven on downstream ports. - * | | |All operational registers, including port registers and port state machines are set to their initial values - * | | |Port ownership reverts to the companion host controller(s), with the side effects - * | | |Software must reinitialize the host controller in order to return the host controller to an operational state. - * | | |This bit is set to zero by the Host Controller when the reset process is complete - * | | |Software cannot terminate the reset process early by writing a zero to this register. - * | | |Software should not set this bit to a one when the HCHalted bit in the USBSTS register is a zero - * | | |Attempting to reset an actively running host controller will result in undefined behavior. - * |[3:2] |FLSZ |Frame List Size (R/W or RO) - * | | |This field is R/W only if Programmable Frame List Flag in the HCCPARAMS registers is set to a one - * | | |This field specifies the size of the frame list - * | | |The size the frame list controls which bits in the Frame Index Register should be used for the Frame List Current index - * | | |Values mean: - * | | |00 = 1024 elements (4096 bytes) Default value. - * | | |01 = 512 elements (2048 bytes). - * | | |10 = 256 elements (1024 bytes) u2013 for resource-constrained environment. - * | | |11 = Reserved. - * |[4] |PSEN |Periodic Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Periodic Schedule. Values mean: - * | | |0 = Do not process the Periodic Schedule. - * | | |1 = Use the PERIODICLISTBASE register to access the Periodic Schedule. - * |[5] |ASEN |Asynchronous Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Asynchronous Schedule. Values mean: - * | | |0 = Do not process the Asynchronous Schedule. - * | | |1 = Use the ASYNCLISTADDR register to access the Asynchronous Schedule. - * |[6] |IAAD |Interrupt on Asynchronous Advance Doorbell (R/W) - * | | |This bit is used as a doorbell by software to tell the host controller to issue an interrupt the next time it advances asynchronous schedule - * | | |Software must write a 1 to this bit to ring the doorbell. - * | | |When the host controller has evicted all appropriate cached schedule state, it sets the Interrupt on Asynchronous Advance status bit in the USBSTS register - * | | |If the Interrupt on Asynchronous Advance Enable bit in the USBINTR register is a one then the host controller will assert an interrupt at the next interrupt threshold. - * | | |The host controller sets this bit to a zero after it has set the Interrupt on Asynchronous Advance status bit in the USBSTS register to a one. - * | | |Software should not write a one to this bit when the asynchronous schedule is disabled - * | | |Doing so will yield undefined results. - * |[23:16] |ITC |Interrupt Threshold Control (R/W) - * | | |This field is used by system software to select the maximum rate at which the host controller will issue interrupts - * | | |The only valid values are defined below - * | | |If software writes an invalid value to this register, the results are undefined - * | | |Value Maximum Interrupt Interval - * | | |0x00 = Reserved. - * | | |0x01 = 1 micro-frame. - * | | |0x02 = 2 micro-frames. - * | | |0x04 = 4 micro-frames. - * | | |0x08 = 8 micro-frames (default, equates to 1 ms). - * | | |0x10 = 16 micro-frames (2 ms). - * | | |0x20 = 32 micro-frames (4 ms). - * | | |0x40 = 64 micro-frames (8 ms). - * | | |Any other value in this register yields undefined results. - * | | |Software modifications to this bit while HCHalted bit is equal to zero results in undefined behavior. - * @var HSUSBH_T::USTSR - * Offset: 0x24 USB Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBINT |USB Interrupt (USBINT) (R/WC) - * | | |The Host Controller sets this bit to 1 on the completion of a USB transaction, which results in the retirement of a Transfer Descriptor that had its IOC bit set. - * | | |The Host Controller also sets this bit to 1 when a short packet is detected (actual number of bytes received was less than the expected number of bytes). - * |[1] |UERRINT |USB Error Interrupt (USBERRINT) (R/WC) - * | | |The Host Controller sets this bit to 1 when completion of a USB transaction results in an error condition (e.g., error counter underflow) - * | | |If the TD on which the error interrupt occurred also had its IOC bit set, both this bit and USBINT bit are set. - * |[2] |PCD |Port Change Detect (R/WC) - * | | |The Host Controller sets this bit to a one when any port for which the Port Owner bit is set to zero has a change bit transition from a zero to a one or a Force Port Resume bit transition from a zero to a one as a result of a J-K transition detected on a suspended port - * | | |This bit will also be set as a result of the Connect Status Change being set to a one after system software has relinquished ownership of a connected port by writing a one to a port's Port Owner bit. - * | | |This bit is allowed to be maintained in the Auxiliary power well - * | | |Alternatively, it is also acceptable that on a D3 to D0 transition of the EHCI HC device, this bit is loaded with the OR of all of the PORTSC change bits (including: Force port resume, over-current change, enable/disable change and connect status change). - * |[3] |FLR |Frame List Rollover (R/WC) - * | | |The Host Controller sets this bit to a one when the Frame List Index rolls over from its maximum value to zero - * | | |The exact value at which the rollover occurs depends on the frame list size - * | | |For example, if the frame list size (as programmed in the Frame List Size field of the USBCMD register) is 1024, the Frame Index Register rolls over every time FRINDEX[13] toggles - * | | |Similarly, if the size is 512, the Host Controller sets this bit to a one every time FRINDEX[12] toggles. - * |[4] |HSERR |Host System Error (R/WC) - * | | |The Host Controller sets this bit to 1 when a serious error occurs during a host system access involving the Host Controller module. - * |[5] |IAA |Interrupt on Asynchronous Advance (R/WC) - * | | |System software can force the host controller to issue an interrupt the next time the host controller advances the asynchronous schedule by writing a one to the Interrupt on Asynchronous Advance Doorbell bit in the USBCMD register - * | | |This status bit indicates the assertion of that interrupt source. - * |[12] |HCHalted |HCHalted (RO) - * | | |This bit is a zero whenever the Run/Stop bit is a one - * | | |The Host Controller sets this bit to one after it has stopped executing as a result of the Run/Stop bit being set to 0, either by software or by the Host Controller hardware (e.g. - * | | |internal error). - * |[13] |RECLA |Reclamation (RO) - * | | |This is a read-only status bit, which is used to detect an empty asynchronous schedule. - * |[14] |PSS |Periodic Schedule Status (RO) - * | | |The bit reports the current real status of the Periodic Schedule - * | | |If this bit is a zero then the status of the Periodic Schedule is disabled - * | | |If this bit is a one then the status of the Periodic Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Periodic Schedule when software transitions the Periodic Schedule Enable bit in the USBCMD register - * | | |When this bit and the Periodic Schedule Enable bit are the same value, the Periodic Schedule is either enabled (1) or disabled (0). - * |[15] |ASS |Asynchronous Schedule Status (RO) - * | | |The bit reports the current real status of the Asynchronous Schedule - * | | |If this bit is a zero then the status of them Asynchronous Schedule is disabled - * | | |If this bit is a one then the status of the Asynchronous Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Asynchronous Schedule when software transitions the Asynchronous Schedule Enable bit in the USBCMD register - * | | |When this bit and the Asynchronous Schedule Enable bit are the same value, the Asynchronous Schedule is either enabled (1) or disabled (0). - * @var HSUSBH_T::UIENR - * Offset: 0x28 USB Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIEN |USB Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBINT bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBINT bit. - * | | |0 = USB interrupt Disabled. - * | | |1 = USB interrupt Enabled. - * |[1] |UERRIEN |USB Error Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBERRINT bit in the USBSTS register is a one, the host t controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBERRINT bit. - * | | |0 = USB Error interrupt Disabled. - * | | |1 = USB Error interrupt Enabled. - * |[2] |PCIEN |Port Change Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the Port Change Detect bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Port Change Detect bit. - * | | |0 = Port Change interrupt Disabled. - * | | |1 = Port Change interrupt Enabled. - * |[3] |FLREN |Frame List Rollover Enable or Disable Bit - * | | |When this bit is a one, and the Frame List Rollover bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Frame List Rollover bit. - * | | |0 = Frame List Rollover interrupt Disabled. - * | | |1 = Frame List Rollover interrupt Enabled. - * |[4] |HSERREN |Host System Error Enable or Disable Bit - * | | |When this bit is a one, and the Host System Error Status bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Host System Error bit. - * | | |0 = Host System Error interrupt Disabled. - * | | |1 = Host System Error interrupt Enabled. - * |[5] |IAAEN |Interrupt on Asynchronous Advance Enable or Disable Bit - * | | |When this bit is a one, and the Interrupt on Asynchronous Advance bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the Interrupt on Asynchronous Advance bit. - * | | |0 = Interrupt on Asynchronous Advance Disabled. - * | | |1 = Interrupt on Asynchronous Advance Enabled. - * @var HSUSBH_T::UFINDR - * Offset: 0x2C USB Frame Index Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Index - * | | |The value in this register increment at the end of each time frame (e.g. - * | | |micro-frame) - * | | |Bits [N:3] are used for the Frame List current index - * | | |This means that each location of the frame list is accessed 8 times (frames or micro-frames) before moving to the next index - * | | |The following illustrates values of N based on the value of the Frame List Size field in the USBCMD register. - * | | |FLSZ (UCMDR[3:2] Number Elements N - * | | |0x0 1024 12 - * | | |0x1 512 11 - * | | |0x2 256 10 - * | | |0x3 Reserved - * @var HSUSBH_T::UPFLBAR - * Offset: 0x34 USB Periodic Frame List Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |BADDR |Base Address - * | | |These bits correspond to memory address signals [31:12], respectively. - * @var HSUSBH_T::UCALAR - * Offset: 0x38 USB Current Asynchronous List Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:5] |LPL |Link Pointer Low (LPL) - * | | |These bits correspond to memory address signals [31:5], respectively - * | | |This field may only reference a Queue Head (QH). - * @var HSUSBH_T::UASSTR - * Offset: 0x3C USB Asynchronous Schedule Sleep Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ASSTMR |Asynchronous Schedule Sleep Timer - * | | |This field defines the AsyncSchedSleepTime of EHCI spec. - * | | |The asynchronous schedule sleep timer is used to control how often the host controller fetches asynchronous schedule list from system memory while the asynchronous schedule is empty. - * | | |The default value of this timer is 12'hBD6 - * | | |Because this timer is implemented in UTMI clock (30MHz) domain, the default sleeping time will be about 100us. - * @var HSUSBH_T::UCFGR - * Offset: 0x60 USB Configure Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CF |Configure Flag (CF) - * | | |Host software sets this bit as the last action in its process of configuring the Host Controller - * | | |This bit controls the default port-routing control logic - * | | |Bit values and side-effects are listed below. - * | | |0 = Port routing control logic default-routes each port to an implementation dependent classic host controller. - * | | |1 = Port routing control logic default-routes all ports to this host controller. - * @var HSUSBH_T::UPSCR[2] - * Offset: 0x64~0x68 USB Port 0~1 Status and Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |Current Connect Status (RO) - * | | |This value reflects the current state of the port, and may not correspond directly to the event that caused the Connect Status Change bit (Bit 1) to be set. - * | | |This field is zero if Port Power is zero. - * | | |0 = No device is present. - * | | |1 = Device is present on port. - * |[1] |CSC |Connect Status Change (R/W) - * | | |Indicates a change has occurred in the port's Current Connect Status - * | | |The host controller sets this bit for all changes to the port device connect status, even if system software has not cleared an existing connect status change - * | | |For example, the insertion status changes twice before system software has cleared the changed condition, hub hardware will be "setting" an already-set bit (i.e., the bit will remain set).Software sets this bit to 0 by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Change in Current Connect Status. - * |[2] |PE |Port Enabled/Disabled (R/W) - * | | |Ports can only be enabled by the host controller as a part of the reset and enable - * | | |Software cannot enable a port by writing a one to this field - * | | |The host controller will only set this bit to a one when the reset sequence determines that the attached device is a high-speed device. - * | | |Ports can be disabled by either a fault condition (disconnect event or other fault condition) or by host software - * | | |Note that the bit status does not change until the port state actually changes - * | | |There may be a delay in disabling or enabling a port due to other host controller and bus events. - * | | |When the port is disabled (0b) downstream propagation of data is blocked on this port, except for reset. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[3] |PEC |Port Enable/Disable Change (R/WC) - * | | |For the root hub, this bit gets set to a one only when a port is disabled due to the appropriate conditions existing at the EOF2 point (See Chapter 11 of the USB Specification for the definition of a Port Error) - * | | |Software clears this bit by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Port enabled/disabled status has changed. - * |[4] |OCA |Over-current Active (RO) - * | | |This bit will automatically transition from a one to a zero when the over current condition is removed. - * | | |0 = This port does not have an over-current condition. - * | | |1 = This port currently has an over-current condition. - * |[5] |OCC |Over-current Change (R/WC) - * | | |1 = This bit gets set to a one when there is a change to Over-current Active - * | | |Software clears this bit by writing a one to this bit position. - * |[6] |FPR |Force Port Resume (R/W) - * | | |This functionality defined for manipulating this bit depends on the value of the Suspend bit - * | | |For example, if the port is not suspended (Suspend and Enabled bits are a one) and software transitions this bit to a one, then the effects on the bus are undefined. - * | | |Software sets this bit to a 1 to drive resume signaling - * | | |The Host Controller sets this bit to a 1 if a J-to-K transition is detected while the port is in the Suspend state - * | | |When this bit transitions to a one because a J-to-K transition is detected, the Port Change Detect bit in the USBSTS register is also set to a one - * | | |If software sets this bit to a one, the host controller must not set the Port Change Detect bit. - * | | |Note that when the EHCI controller owns the port, the resume sequence follows the defined sequence documented in the USB Specification Revision 2.0 - * | | |The resume signaling (Full-speed 'K') is driven on the port as long as this bit remains a one - * | | |Software must appropriately time the Resume and set this bit to a zero when the appropriate amount of time has elapsed - * | | |Writing a zero (from one) causes the port to return to high-speed mode (forcing the bus below the port into a high-speed idle) - * | | |This bit will remain a one until the port has switched to the high-speed idle - * | | |The host controller must complete this transition within 2 milliseconds of software setting this bit to a zero. - * | | |This field is zero if Port Power is zero. - * | | |0 = No resume (K-state) detected/driven on port. - * | | |1 = Resume detected/driven on port. - * |[7] |SUSPEND |Suspend (R/W) - * | | |Port Enabled Bit and Suspend bit of this register define the port states as follows: - * | | |Port enable is 0 and suspend is 0 = Disable. - * | | |Port enable is 0 and suspend is 1 = Disable. - * | | |Port enable is 1 and suspend is 0 = Enable. - * | | |Port enable is 1 and suspend is 1 = Suspend. - * | | |When in suspend state, downstream propagation of data is blocked on this port, except for port reset - * | | |The blocking occurs at the end of the current transaction, if a transaction was in progress when this bit was written to 1 - * | | |In the suspend state, the port is sensitive to resume detection - * | | |Note that the bit status does not change until the port is suspended and that there may be a delay in suspending a port if there is a transaction currently in progress on the USB. - * | | |A write of zero to this bit is ignored by the host controller - * | | |The host controller will unconditionally set this bit to a zero when: - * | | |Software sets the Force Port Resume bit to a zero (from a one). - * | | |Software sets the Port Reset bit to a one (from a zero). - * | | |If host software sets this bit to a one when the port is not enabled (i.e. - * | | |Port enabled bit is a zero) the results are undefined. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port not in suspend state. - * | | |1 = Port in suspend state. - * |[8] |PRST |Port Reset (R/W) - * | | |When software writes a one to this bit (from a zero), the bus reset sequence as defined in the USB Specification Revision 2.0 is started - * | | |Software writes a zero to this bit to terminate the bus reset sequence - * | | |Software must keep this bit at a one long enough to ensure the reset sequence, as specified in the USB Specification Revision 2.0, completes - * | | |Note: when software writes this bit to a one, it must also write a zero to the Port Enable bit. - * | | |Note that when software writes a zero to this bit there may be a delay before the bit status changes to a zero - * | | |The bit status will not read as a zero until after the reset has completed - * | | |If the port is in high-speed mode after reset is complete, the host controller will automatically enable this port (e.g. - * | | |set the Port Enable bit to a one) - * | | |A host controller must terminate the reset and stabilize the state of the port within 2 milliseconds of software transitioning this bit from a one to a zero - * | | |For example: if the port detects that the attached device is high-speed during reset, then the host controller must have the port in the enabled state within 2ms of software writing this bit to a zero. - * | | |The HCHalted bit in the USBSTS register should be a zero before software attempts to use this bit - * | | |The host controller may hold Port Reset asserted to a one when the HCHalted bit is a one. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port is not in Reset. - * | | |1 = Port is in Reset. - * |[11:10] |LSTS |Line Status (RO) - * | | |These bits reflect the current logical levels of the D+ (bit 11) and D- (bit 10) signal lines - * | | |These bits are used for detection of low-speed USB devices prior to the port reset and enable sequence - * | | |This field is valid only when the port enable bit is zero and the current connect status bit is set to a one. - * | | |The encoding of the bits are: - * | | |Bits[11:10] USB State Interpretation - * | | |00 = SE0 Not Low-speed device, perform EHCI reset. - * | | |01 = K-state Low-speed device, release ownership of port. - * | | |10 = J-state Not Low-speed device, perform EHCI reset. - * | | |11 = Undefined Not Low-speed device, perform EHCI reset. - * | | |This value of this field is undefined if Port Power is zero. - * |[12] |PP |Port Power (PP) - * | | |Host controller has port power control switches - * | | |This bit represents the Current setting of the switch (0 = off, 1 = on) - * | | |When power is not available on a port (i.e. - * | | |PP equals a 0), the port is nonfunctional and will not report attaches, detaches, etc. - * | | |When an over-current condition is detected on a powered port and PPC is a one, the PP bit in each affected port may be transitioned by the host controller from a 1 to 0 (removing power from the port). - * |[13] |PO |Port Owner (R/W) - * | | |This bit unconditionally goes to a 0b when the Configured bit in the CONFIGFLAG register makes a 0 to 1 transition - * | | |This bit unconditionally goes to 1 whenever the Configured bit is zero. - * | | |System software uses this field to release ownership of the port to a selected host controller (in the event that the attached device is not a high-speed device) - * | | |Software writes a one to this bit when the attached device is not a high-speed device - * | | |A one in this bit means that a companion host controller owns and controls the port. - * |[19:16] |PTC |Port Test Control (R/W) - * | | |When this field is zero, the port is NOT operating in a test mode - * | | |A non-zero value indicates that it is operating in test mode and the specific test mode is indicated by the specific value - * | | |The encoding of the test mode bits are (0x6 ~ 0xF are reserved): - * | | |Bits Test Mode - * | | |0x0 = Test mode not enabled. - * | | |0x1 = Test J_STATE. - * | | |0x2 = Test K_STATE. - * | | |0x3 = Test SE0_NAK. - * | | |0x4 = Test Packet. - * | | |0x5 = Test FORCE_ENABLE. - * @var HSUSBH_T::USBPCR0 - * Offset: 0xC4 USB PHY 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 0. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 0 was suspended. - * | | |1 = USB PHY 0 was not suspended. - * |[11] |CLKVALID |UTMI Clock Valid - * | | |This bit is a flag to indicate if the UTMI clock from USB 2.0 PHY is ready - * | | |S/W program must prevent to write other control registers before this UTMI clock valid flag is active. - * | | |0 = UTMI clock is not valid. - * | | |1 = UTMI clock is valid. - * @var HSUSBH_T::USBPCR1 - * Offset: 0xC8 USB PHY 1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 1. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 1 was suspended. - * | | |1 = USB PHY 1 was not suspended. - */ - __I uint32_t EHCVNR; /*!< [0x0000] EHCI Version Number Register */ - __I uint32_t EHCSPR; /*!< [0x0004] EHCI Structural Parameters Register */ - __I uint32_t EHCCPR; /*!< [0x0008] EHCI Capability Parameters Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t UCMDR; /*!< [0x0020] USB Command Register */ - __IO uint32_t USTSR; /*!< [0x0024] USB Status Register */ - __IO uint32_t UIENR; /*!< [0x0028] USB Interrupt Enable Register */ - __IO uint32_t UFINDR; /*!< [0x002c] USB Frame Index Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t UPFLBAR; /*!< [0x0034] USB Periodic Frame List Base Address Register */ - __IO uint32_t UCALAR; /*!< [0x0038] USB Current Asynchronous List Address Register */ - __IO uint32_t UASSTR; /*!< [0x003c] USB Asynchronous Schedule Sleep Timer Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t UCFGR; /*!< [0x0060] USB Configure Flag Register */ - __IO uint32_t UPSCR[2]; /*!< [0x0064] ~ [0x0068] USB Port 0 & 1 Status and Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[22]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t USBPCR0; /*!< [0x00c4] USB PHY 0 Control Register */ - __IO uint32_t USBPCR1; /*!< [0x00c8] USB PHY 1 Control Register */ - -} HSUSBH_T; - -/** - @addtogroup HSUSBH_CONST HSUSBH Bit Field Definition - Constant Definitions for HSUSBH Controller -@{ */ - -#define HSUSBH_EHCVNR_CRLEN_Pos (0) /*!< HSUSBH_T::EHCVNR: CRLEN Position */ -#define HSUSBH_EHCVNR_CRLEN_Msk (0xfful << HSUSBH_EHCVNR_CRLEN_Pos) /*!< HSUSBH_T::EHCVNR: CRLEN Mask */ - -#define HSUSBH_EHCVNR_VERSION_Pos (16) /*!< HSUSBH_T::EHCVNR: VERSION Position */ -#define HSUSBH_EHCVNR_VERSION_Msk (0xfffful << HSUSBH_EHCVNR_VERSION_Pos) /*!< HSUSBH_T::EHCVNR: VERSION Mask */ - -#define HSUSBH_EHCSPR_N_PORTS_Pos (0) /*!< HSUSBH_T::EHCSPR: N_PORTS Position */ -#define HSUSBH_EHCSPR_N_PORTS_Msk (0xful << HSUSBH_EHCSPR_N_PORTS_Pos) /*!< HSUSBH_T::EHCSPR: N_PORTS Mask */ - -#define HSUSBH_EHCSPR_PPC_Pos (4) /*!< HSUSBH_T::EHCSPR: PPC Position */ -#define HSUSBH_EHCSPR_PPC_Msk (0x1ul << HSUSBH_EHCSPR_PPC_Pos) /*!< HSUSBH_T::EHCSPR: PPC Mask */ - -#define HSUSBH_EHCSPR_N_PCC_Pos (8) /*!< HSUSBH_T::EHCSPR: N_PCC Position */ -#define HSUSBH_EHCSPR_N_PCC_Msk (0xful << HSUSBH_EHCSPR_N_PCC_Pos) /*!< HSUSBH_T::EHCSPR: N_PCC Mask */ - -#define HSUSBH_EHCSPR_N_CC_Pos (12) /*!< HSUSBH_T::EHCSPR: N_CC Position */ -#define HSUSBH_EHCSPR_N_CC_Msk (0xful << HSUSBH_EHCSPR_N_CC_Pos) /*!< HSUSBH_T::EHCSPR: N_CC Mask */ - -#define HSUSBH_EHCCPR_AC64_Pos (0) /*!< HSUSBH_T::EHCCPR: AC64 Position */ -#define HSUSBH_EHCCPR_AC64_Msk (0x1ul << HSUSBH_EHCCPR_AC64_Pos) /*!< HSUSBH_T::EHCCPR: AC64 Mask */ - -#define HSUSBH_EHCCPR_PFLF_Pos (1) /*!< HSUSBH_T::EHCCPR: PFLF Position */ -#define HSUSBH_EHCCPR_PFLF_Msk (0x1ul << HSUSBH_EHCCPR_PFLF_Pos) /*!< HSUSBH_T::EHCCPR: PFLF Mask */ - -#define HSUSBH_EHCCPR_ASPC_Pos (2) /*!< HSUSBH_T::EHCCPR: ASPC Position */ -#define HSUSBH_EHCCPR_ASPC_Msk (0x1ul << HSUSBH_EHCCPR_ASPC_Pos) /*!< HSUSBH_T::EHCCPR: ASPC Mask */ - -#define HSUSBH_EHCCPR_IST_Pos (4) /*!< HSUSBH_T::EHCCPR: IST Position */ -#define HSUSBH_EHCCPR_IST_Msk (0xful << HSUSBH_EHCCPR_IST_Pos) /*!< HSUSBH_T::EHCCPR: IST Mask */ - -#define HSUSBH_EHCCPR_EECP_Pos (8) /*!< HSUSBH_T::EHCCPR: EECP Position */ -#define HSUSBH_EHCCPR_EECP_Msk (0xfful << HSUSBH_EHCCPR_EECP_Pos) /*!< HSUSBH_T::EHCCPR: EECP Mask */ - -#define HSUSBH_UCMDR_RUN_Pos (0) /*!< HSUSBH_T::UCMDR: RUN Position */ -#define HSUSBH_UCMDR_RUN_Msk (0x1ul << HSUSBH_UCMDR_RUN_Pos) /*!< HSUSBH_T::UCMDR: RUN Mask */ - -#define HSUSBH_UCMDR_HCRST_Pos (1) /*!< HSUSBH_T::UCMDR: HCRST Position */ -#define HSUSBH_UCMDR_HCRST_Msk (0x1ul << HSUSBH_UCMDR_HCRST_Pos) /*!< HSUSBH_T::UCMDR: HCRST Mask */ - -#define HSUSBH_UCMDR_FLSZ_Pos (2) /*!< HSUSBH_T::UCMDR: FLSZ Position */ -#define HSUSBH_UCMDR_FLSZ_Msk (0x3ul << HSUSBH_UCMDR_FLSZ_Pos) /*!< HSUSBH_T::UCMDR: FLSZ Mask */ - -#define HSUSBH_UCMDR_PSEN_Pos (4) /*!< HSUSBH_T::UCMDR: PSEN Position */ -#define HSUSBH_UCMDR_PSEN_Msk (0x1ul << HSUSBH_UCMDR_PSEN_Pos) /*!< HSUSBH_T::UCMDR: PSEN Mask */ - -#define HSUSBH_UCMDR_ASEN_Pos (5) /*!< HSUSBH_T::UCMDR: ASEN Position */ -#define HSUSBH_UCMDR_ASEN_Msk (0x1ul << HSUSBH_UCMDR_ASEN_Pos) /*!< HSUSBH_T::UCMDR: ASEN Mask */ - -#define HSUSBH_UCMDR_IAAD_Pos (6) /*!< HSUSBH_T::UCMDR: IAAD Position */ -#define HSUSBH_UCMDR_IAAD_Msk (0x1ul << HSUSBH_UCMDR_IAAD_Pos) /*!< HSUSBH_T::UCMDR: IAAD Mask */ - -#define HSUSBH_UCMDR_ITC_Pos (16) /*!< HSUSBH_T::UCMDR: ITC Position */ -#define HSUSBH_UCMDR_ITC_Msk (0xfful << HSUSBH_UCMDR_ITC_Pos) /*!< HSUSBH_T::UCMDR: ITC Mask */ - -#define HSUSBH_USTSR_USBINT_Pos (0) /*!< HSUSBH_T::USTSR: USBINT Position */ -#define HSUSBH_USTSR_USBINT_Msk (0x1ul << HSUSBH_USTSR_USBINT_Pos) /*!< HSUSBH_T::USTSR: USBINT Mask */ - -#define HSUSBH_USTSR_UERRINT_Pos (1) /*!< HSUSBH_T::USTSR: UERRINT Position */ -#define HSUSBH_USTSR_UERRINT_Msk (0x1ul << HSUSBH_USTSR_UERRINT_Pos) /*!< HSUSBH_T::USTSR: UERRINT Mask */ - -#define HSUSBH_USTSR_PCD_Pos (2) /*!< HSUSBH_T::USTSR: PCD Position */ -#define HSUSBH_USTSR_PCD_Msk (0x1ul << HSUSBH_USTSR_PCD_Pos) /*!< HSUSBH_T::USTSR: PCD Mask */ - -#define HSUSBH_USTSR_FLR_Pos (3) /*!< HSUSBH_T::USTSR: FLR Position */ -#define HSUSBH_USTSR_FLR_Msk (0x1ul << HSUSBH_USTSR_FLR_Pos) /*!< HSUSBH_T::USTSR: FLR Mask */ - -#define HSUSBH_USTSR_HSERR_Pos (4) /*!< HSUSBH_T::USTSR: HSERR Position */ -#define HSUSBH_USTSR_HSERR_Msk (0x1ul << HSUSBH_USTSR_HSERR_Pos) /*!< HSUSBH_T::USTSR: HSERR Mask */ - -#define HSUSBH_USTSR_IAA_Pos (5) /*!< HSUSBH_T::USTSR: IAA Position */ -#define HSUSBH_USTSR_IAA_Msk (0x1ul << HSUSBH_USTSR_IAA_Pos) /*!< HSUSBH_T::USTSR: IAA Mask */ - -#define HSUSBH_USTSR_HCHalted_Pos (12) /*!< HSUSBH_T::USTSR: HCHalted Position */ -#define HSUSBH_USTSR_HCHalted_Msk (0x1ul << HSUSBH_USTSR_HCHalted_Pos) /*!< HSUSBH_T::USTSR: HCHalted Mask */ - -#define HSUSBH_USTSR_RECLA_Pos (13) /*!< HSUSBH_T::USTSR: RECLA Position */ -#define HSUSBH_USTSR_RECLA_Msk (0x1ul << HSUSBH_USTSR_RECLA_Pos) /*!< HSUSBH_T::USTSR: RECLA Mask */ - -#define HSUSBH_USTSR_PSS_Pos (14) /*!< HSUSBH_T::USTSR: PSS Position */ -#define HSUSBH_USTSR_PSS_Msk (0x1ul << HSUSBH_USTSR_PSS_Pos) /*!< HSUSBH_T::USTSR: PSS Mask */ - -#define HSUSBH_USTSR_ASS_Pos (15) /*!< HSUSBH_T::USTSR: ASS Position */ -#define HSUSBH_USTSR_ASS_Msk (0x1ul << HSUSBH_USTSR_ASS_Pos) /*!< HSUSBH_T::USTSR: ASS Mask */ - -#define HSUSBH_UIENR_USBIEN_Pos (0) /*!< HSUSBH_T::UIENR: USBIEN Position */ -#define HSUSBH_UIENR_USBIEN_Msk (0x1ul << HSUSBH_UIENR_USBIEN_Pos) /*!< HSUSBH_T::UIENR: USBIEN Mask */ - -#define HSUSBH_UIENR_UERRIEN_Pos (1) /*!< HSUSBH_T::UIENR: UERRIEN Position */ -#define HSUSBH_UIENR_UERRIEN_Msk (0x1ul << HSUSBH_UIENR_UERRIEN_Pos) /*!< HSUSBH_T::UIENR: UERRIEN Mask */ - -#define HSUSBH_UIENR_PCIEN_Pos (2) /*!< HSUSBH_T::UIENR: PCIEN Position */ -#define HSUSBH_UIENR_PCIEN_Msk (0x1ul << HSUSBH_UIENR_PCIEN_Pos) /*!< HSUSBH_T::UIENR: PCIEN Mask */ - -#define HSUSBH_UIENR_FLREN_Pos (3) /*!< HSUSBH_T::UIENR: FLREN Position */ -#define HSUSBH_UIENR_FLREN_Msk (0x1ul << HSUSBH_UIENR_FLREN_Pos) /*!< HSUSBH_T::UIENR: FLREN Mask */ - -#define HSUSBH_UIENR_HSERREN_Pos (4) /*!< HSUSBH_T::UIENR: HSERREN Position */ -#define HSUSBH_UIENR_HSERREN_Msk (0x1ul << HSUSBH_UIENR_HSERREN_Pos) /*!< HSUSBH_T::UIENR: HSERREN Mask */ - -#define HSUSBH_UIENR_IAAEN_Pos (5) /*!< HSUSBH_T::UIENR: IAAEN Position */ -#define HSUSBH_UIENR_IAAEN_Msk (0x1ul << HSUSBH_UIENR_IAAEN_Pos) /*!< HSUSBH_T::UIENR: IAAEN Mask */ - -#define HSUSBH_UFINDR_FI_Pos (0) /*!< HSUSBH_T::UFINDR: FI Position */ -#define HSUSBH_UFINDR_FI_Msk (0x3ffful << HSUSBH_UFINDR_FI_Pos) /*!< HSUSBH_T::UFINDR: FI Mask */ - -#define HSUSBH_UPFLBAR_BADDR_Pos (12) /*!< HSUSBH_T::UPFLBAR: BADDR Position */ -#define HSUSBH_UPFLBAR_BADDR_Msk (0xffffful << HSUSBH_UPFLBAR_BADDR_Pos) /*!< HSUSBH_T::UPFLBAR: BADDR Mask */ - -#define HSUSBH_UCALAR_LPL_Pos (5) /*!< HSUSBH_T::UCALAR: LPL Position */ -#define HSUSBH_UCALAR_LPL_Msk (0x7fffffful << HSUSBH_UCALAR_LPL_Pos) /*!< HSUSBH_T::UCALAR: LPL Mask */ - -#define HSUSBH_UASSTR_ASSTMR_Pos (0) /*!< HSUSBH_T::UASSTR: ASSTMR Position */ -#define HSUSBH_UASSTR_ASSTMR_Msk (0xffful << HSUSBH_UASSTR_ASSTMR_Pos) /*!< HSUSBH_T::UASSTR: ASSTMR Mask */ - -#define HSUSBH_UCFGR_CF_Pos (0) /*!< HSUSBH_T::UCFGR: CF Position */ -#define HSUSBH_UCFGR_CF_Msk (0x1ul << HSUSBH_UCFGR_CF_Pos) /*!< HSUSBH_T::UCFGR: CF Mask */ - -#define HSUSBH_UPSCR_CCS_Pos (0) /*!< HSUSBH_T::UPSCR[2]: CCS Position */ -#define HSUSBH_UPSCR_CCS_Msk (0x1ul << HSUSBH_UPSCR_CCS_Pos) /*!< HSUSBH_T::UPSCR[2]: CCS Mask */ - -#define HSUSBH_UPSCR_CSC_Pos (1) /*!< HSUSBH_T::UPSCR[2]: CSC Position */ -#define HSUSBH_UPSCR_CSC_Msk (0x1ul << HSUSBH_UPSCR_CSC_Pos) /*!< HSUSBH_T::UPSCR[2]: CSC Mask */ - -#define HSUSBH_UPSCR_PE_Pos (2) /*!< HSUSBH_T::UPSCR[2]: PE Position */ -#define HSUSBH_UPSCR_PE_Msk (0x1ul << HSUSBH_UPSCR_PE_Pos) /*!< HSUSBH_T::UPSCR[2]: PE Mask */ - -#define HSUSBH_UPSCR_PEC_Pos (3) /*!< HSUSBH_T::UPSCR[2]: PEC Position */ -#define HSUSBH_UPSCR_PEC_Msk (0x1ul << HSUSBH_UPSCR_PEC_Pos) /*!< HSUSBH_T::UPSCR[2]: PEC Mask */ - -#define HSUSBH_UPSCR_OCA_Pos (4) /*!< HSUSBH_T::UPSCR[2]: OCA Position */ -#define HSUSBH_UPSCR_OCA_Msk (0x1ul << HSUSBH_UPSCR_OCA_Pos) /*!< HSUSBH_T::UPSCR[2]: OCA Mask */ - -#define HSUSBH_UPSCR_OCC_Pos (5) /*!< HSUSBH_T::UPSCR[2]: OCC Position */ -#define HSUSBH_UPSCR_OCC_Msk (0x1ul << HSUSBH_UPSCR_OCC_Pos) /*!< HSUSBH_T::UPSCR[2]: OCC Mask */ - -#define HSUSBH_UPSCR_FPR_Pos (6) /*!< HSUSBH_T::UPSCR[2]: FPR Position */ -#define HSUSBH_UPSCR_FPR_Msk (0x1ul << HSUSBH_UPSCR_FPR_Pos) /*!< HSUSBH_T::UPSCR[2]: FPR Mask */ - -#define HSUSBH_UPSCR_SUSPEND_Pos (7) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Position */ -#define HSUSBH_UPSCR_SUSPEND_Msk (0x1ul << HSUSBH_UPSCR_SUSPEND_Pos) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Mask */ - -#define HSUSBH_UPSCR_PRST_Pos (8) /*!< HSUSBH_T::UPSCR[2]: PRST Position */ -#define HSUSBH_UPSCR_PRST_Msk (0x1ul << HSUSBH_UPSCR_PRST_Pos) /*!< HSUSBH_T::UPSCR[2]: PRST Mask */ - -#define HSUSBH_UPSCR_LSTS_Pos (10) /*!< HSUSBH_T::UPSCR[2]: LSTS Position */ -#define HSUSBH_UPSCR_LSTS_Msk (0x3ul << HSUSBH_UPSCR_LSTS_Pos) /*!< HSUSBH_T::UPSCR[2]: LSTS Mask */ - -#define HSUSBH_UPSCR_PP_Pos (12) /*!< HSUSBH_T::UPSCR[2]: PP Position */ -#define HSUSBH_UPSCR_PP_Msk (0x1ul << HSUSBH_UPSCR_PP_Pos) /*!< HSUSBH_T::UPSCR[2]: PP Mask */ - -#define HSUSBH_UPSCR_PO_Pos (13) /*!< HSUSBH_T::UPSCR[2]: PO Position */ -#define HSUSBH_UPSCR_PO_Msk (0x1ul << HSUSBH_UPSCR_PO_Pos) /*!< HSUSBH_T::UPSCR[2]: PO Mask */ - -#define HSUSBH_UPSCR_PTC_Pos (16) /*!< HSUSBH_T::UPSCR[2]: PTC Position */ -#define HSUSBH_UPSCR_PTC_Msk (0xful << HSUSBH_UPSCR_PTC_Pos) /*!< HSUSBH_T::UPSCR[2]: PTC Mask */ - -#define HSUSBH_USBPCR0_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR0: SUSPEND Position */ -#define HSUSBH_USBPCR0_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR0_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR0: SUSPEND Mask */ - -#define HSUSBH_USBPCR0_CLKVALID_Pos (11) /*!< HSUSBH_T::USBPCR0: CLKVALID Position */ -#define HSUSBH_USBPCR0_CLKVALID_Msk (0x1ul << HSUSBH_USBPCR0_CLKVALID_Pos) /*!< HSUSBH_T::USBPCR0: CLKVALID Mask */ - -#define HSUSBH_USBPCR1_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR1: SUSPEND Position */ -#define HSUSBH_USBPCR1_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR1_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR1: SUSPEND Mask */ - -/**@}*/ /* HSUSBH_CONST */ -/**@}*/ /* end of HSUSBH register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __HSUSBH_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2c_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2c_reg.h deleted file mode 100644 index adbd03fa572..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2c_reg.h +++ /dev/null @@ -1,725 +0,0 @@ -/**************************************************************************//** - * @file i2c_reg.h - * @version V1.00 - * @brief I2C register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __I2C_REG_H__ -#define __I2C_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup I2C Inter-IC Bus Controller(I2C) - Memory Mapped Structure for I2C Controller -@{ */ - -typedef struct -{ - - - /** - * @var I2C_T::CTL0 - * Offset: 0x00 I2C Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |AA |Assert Acknowledge Control - * | | |When AA =1 prior to address or data is received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line - * |[3] |SI |I2C Interrupt Flag - * | | |When a new I2C state is present in the I2C_STATUS register, the SI flag is set by hardware - * | | |If bit INTEN (I2C_CTL [7]) is set, the I2C interrupt is requested - * | | |SI must be cleared by software - * | | |Clear SI by writing 1 to this bit. - * | | |For ACKMEN is set in slave read mode, the SI flag is set in 8th clock period for user to confirm the acknowledge bit and 9th clock period for user to read the data in the data buffer. - * |[4] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C controller will check the bus condition if a STOP condition is detected - * | | |This bit will be cleared by hardware automatically. - * |[5] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[6] |I2CEN |I2C Controller Enable Bit - * | | |Set to enable I2C serial function controller - * | | |When I2CEN=1 the I2C serial function enable - * | | |The multi-function pin function must set to SDA, and SCL of I2C function first. - * | | |0 = I2C controller Disabled. - * | | |1 = I2C controller Enabled. - * |[7] |INTEN |Enable Interrupt - * | | |0 = I2C interrupt Disabled. - * | | |1 = I2C interrupt Enabled. - * @var I2C_T::ADDR0 - * Offset: 0x04 I2C Slave Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::DAT - * Offset: 0x08 I2C Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |I2C Data - * | | |Bit [7:0] is located with the 8-bit transferred/received data of I2C serial port. - * @var I2C_T::STATUS0 - * Offset: 0x0C I2C Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |STATUS |I2C Status - * | | |The three least significant bits are always 0 - * | | |The five most significant bits contain the status code - * | | |There are 28 possible status codes - * | | |When the content of I2C_STATUS is F8H, no serial interrupt is requested - * | | |Others I2C_STATUS values correspond to defined I2C states - * | | |When each of these states is entered, a status interrupt is requested (SI = 1) - * | | |A valid status code is present in I2C_STATUS one cycle after SI is set by hardware and is still present one cycle after SI has been reset by software - * | | |In addition, states 00H stands for a Bus Error - * | | |A Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit. - * @var I2C_T::CLKDIV - * Offset: 0x10 I2C Clock Divided Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DIVIDER |I2C Clock Divided - * | | |Indicates the I2C clock rate: Data Baud Rate of I2C = (system clock) / (4x (I2C_CLKDIV+1)). - * | | |Note: The minimum value of I2C_CLKDIV is 4. - * @var I2C_T::TOCTL - * Offset: 0x14 I2C Time-out Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIF |Time-out Flag - * | | |This bit is set by hardware when I2C time-out happened and it can interrupt CPU if I2C interrupt enable bit (INTEN) is set to 1. - * | | |Note: Software can write 1 to clear this bit. - * |[1] |TOCDIV4 |Time-out Counter Input Clock Divided by 4 - * | | |When Enabled, The time-out period is extend 4 times. - * | | |0 = Time-out period is extend 4 times Disabled. - * | | |1 = Time-out period is extend 4 times Enabled. - * |[2] |TOCEN |Time-out Counter Enable Bit - * | | |When Enabled, the 14-bit time-out counter will start counting when SI is clear - * | | |Setting flag SI to '1' will reset counter and re-start up counting after SI is cleared. - * | | |0 = Time-out counter Disabled. - * | | |1 = Time-out counter Enabled. - * @var I2C_T::ADDR1 - * Offset: 0x18 I2C Slave Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::ADDR2 - * Offset: 0x1C I2C Slave Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::ADDR3 - * Offset: 0x20 I2C Slave Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[10:1] |ADDR |I2C Address - * | | |The content of this register is irrelevant when I2C is in Master mode - * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address - * | | |The I2C hardware will react if either of the address is matched. - * | | |Note: When software set 10'h000, the address can not be used. - * @var I2C_T::ADDRMSK0 - * Offset: 0x24 I2C Slave Address Mask Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK1 - * Offset: 0x28 I2C Slave Address Mask Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK2 - * Offset: 0x2C I2C Slave Address Mask Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::ADDRMSK3 - * Offset: 0x30 I2C Slave Address Mask Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:1] |ADDRMSK |I2C Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |I2C bus controllers support multiple address recognition with four address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var I2C_T::WKCTL - * Offset: 0x3C I2C Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |I2C Wake-up Enable Bit - * | | |0 = I2C wake-up function Disabled. - * | | |1 = I2C wake-up function Enabled. - * |[7] |NHDBUSEN |I2C No Hold BUS Enable Bit - * | | |0 = I2C hold bus after wake-up. - * | | |1 = I2C don't hold bus after wake-up. - * | | |Note: I2C controller could response when WKIF event is not clear, it may cause error data transmitted or received - * | | |If data transmitted or received when WKIF event is not clear, user must reset I2C controller and execute the original operation again. - * @var I2C_T::WKSTS - * Offset: 0x40 I2C Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKIF |I2C Wake-up Flag - * | | |When chip is woken up from Power-down mode by I2C, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * |[1] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release WKIF. Software can write 1 to clear this bit. - * |[2] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame - * | | |0 = Write command be record on the address match wakeup frame. - * | | |1 = Read command be record on the address match wakeup frame. - * | | |Note: This bit will be cleared when software can write 1 to WKAKDONE bit. - * @var I2C_T::CTL1 - * Offset: 0x44 I2C Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function disable. - * | | |1 = Transmit PDMA function enable. - * |[1] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function disable. - * | | |1 = Receive PDMA function enable. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the I2C request to PDMA. - * |[8] |PDMASTR |PDMA Stretch Bit - * | | |0 = I2C send STOP automatically after PDMA transfer done. (only master TX) - * | | |1 = I2C SCL bus is stretched by hardware after PDMA transfer done if the SI is not cleared - * | | |(only master TX) - * |[9] |ADDR10EN |Address 10-bit Function Enable - * | | |0 = Address match 10-bit function is disabled. - * | | |1 = Address match 10-bit function is enabled. - * @var I2C_T::STATUS1 - * Offset: 0x48 I2C Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADMAT0 |I2C Address 0 Match Status Register - * | | |When address 0 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[1] |ADMAT1 |I2C Address 1 Match Status Register - * | | |When address 1 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[2] |ADMAT2 |I2C Address 2 Match Status Register - * | | |When address 2 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[3] |ADMAT3 |I2C Address 3 Match Status Register - * | | |When address 3 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[8] |ONBUSY |On Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected. - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * | | |Note:This bit is read only. - * @var I2C_T::TMCTL - * Offset: 0x4C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control Register - * | | |This field is used to generate a delay timing between SDA falling edge and SCL rising edge in transmission mode. - * | | |The delay setup time is numbers of peripheral clock = STCTL x PCLK. - * | | |Note: Setup time setting should not make SCL output less than three PCLKs. - * |[24:16] |HTCTL |Hold Time Configure Control Register - * | | |This field is used to generate the delay timing between SCL falling edge and SDA rising edge in transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x PCLK. - * @var I2C_T::BUSCTL - * Offset: 0x50 I2C Bus Management Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACKMEN |Acknowledge Control by Manual - * | | |In order to allow ACK control in slave reception including the command and data, slave byte control mode must be enabled by setting the ACKMEN bit. - * | | |0 = Slave byte control Disabled. - * | | |1 = Slave byte control Enabled - * | | |The 9th bit can response the ACK or NACK according the received data by user - * | | |When the byte is received, stretching the SCLK signal low between the 8th and 9th SCLK pulse. - * | | |Note: If the BMDEN=1 and this bit is enabled, the information of I2C_STATUS will be fixed as 0xF0 in slave receive condition. - * |[1] |PECEN |Packet Error Checking Calculation Enable Bit - * | | |0 = Packet Error Checking Calculation Disabled. - * | | |1 = Packet Error Checking Calculation Enabled. - * | | |Note: When I2C enter power down mode, the bit should be enabled after wake-up if needed PEC calculation. - * |[2] |BMDEN |Bus Management Device Default Address Enable Bit - * | | |0 = Device default address Disable - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses NACKed - * | | |1 = Device default address Enabled - * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses ACKed. - * |[3] |BMHEN |Bus Management Host Enable Bit - * | | |0 = Host function Disabled. - * | | |1 = Host function Enabled. - * |[4] |ALERTEN |Bus Management Alert Enable Bit - * | | |Device Mode (BMHEN=0). - * | | |0 = Release the BM_ALERT pin high and Alert Response Header disabled: 0001100x followed by NACK if both of BMDEN and ACKMEN are enabled. - * | | |1 = Drive BM_ALERT pin low and Alert Response Address Header enables: 0001100x followed by ACK if both of BMDEN and ACKMEN are enabled. - * | | |Host Mode (BMHEN=1). - * | | |0 = BM_ALERT pin not supported. - * | | |1 = BM_ALERT pin supported. - * |[5] |SCTLOSTS |Suspend/Control Data Output Status - * | | |0 = The output of SUSCON pin is low. - * | | |1 = The output of SUSCON pin is high. - * |[6] |SCTLOEN |Suspend or Control Pin Output Enable Bit - * | | |0 = The SUSCON pin in input. - * | | |1 = The output enable is active on the SUSCON pin. - * |[7] |BUSEN |BUS Enable Bit - * | | |0 = The system management function is Disabled. - * | | |1 = The system management function is Enable. - * | | |Note: When the bit is enabled, the internal 14-bit counter is used to calculate the time out event of clock low condition. - * |[8] |PECTXEN |Packet Error Checking Byte Transmission/Reception - * | | |0 = No PEC transfer. - * | | |1 = PEC transmission is requested. - * | | |Note: This bit has no effect in slave mode when ACKMEN=0. - * |[9] |TIDLE |Timer Check in Idle State - * | | |The BUSTOUT is used to calculate the time-out of clock low in bus active and the idle period in bus Idle - * | | |This bit is used to define which condition is enabled. - * | | |0 = The BUSTOUT is used to calculate the clock low period in bus active. - * | | |1 = The BUSTOUT is used to calculate the IDLE period in bus Idle. - * | | |Note: The BUSY (I2C_BUSSTS[0]) indicate the current bus state. - * |[10] |PECCLR |PEC Clear at Repeat Start - * | | |The calculation of PEC starts when PECEN is set to 1 and it is clear when the STA or STO bit is detected - * | | |This PECCLR bit is used to enable the condition of REPEAT START can clear the PEC calculation. - * | | |0 = The PEC calculation is cleared by "Repeat Start" function is Disabled. - * | | |1 = The PEC calculation is cleared by "Repeat Start"" function is Enabled. - * |[11] |ACKM9SI |Acknowledge Manual Enable Extra SI Interrupt - * | | |0 = There is no SI interrupt in the 9th clock cycle when the BUSEN=1 and ACKMEN=1. - * | | |1 = There is SI interrupt in the 9th clock cycle when the BUSEN=1 and ACKMEN=1. - * |[12] |BCDIEN |Packet Error Checking Byte Count Done Interrupt Enable Bit - * | | |0 = Indicates the byte count done interrupt is Disabled. - * | | |1 = Indicates the byte count done interrupt is Enabled. - * | | |Note: This bit is used in PECEN=1. - * |[13] |PECDIEN |Packet Error Checking Byte Transfer Done Interrupt Enable Bit - * | | |0 = Indicates the PEC transfer done interrupt is Disabled. - * | | |1 = Indicates the PEC transfer done interrupt is Enabled. - * | | |Note: This bit is used in PECEN=1. - * @var I2C_T::BUSTCTL - * Offset: 0x54 I2C Bus Management Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSTOEN |Bus Time Out Enable Bit - * | | |0 = Indicates the bus clock low time-out detection is Disabled. - * | | |1 = Indicates the bus clock low time-out detection is Enabled (bus clock is low for more than TTime-out (in BIDLE=0) or high more than TTime-out(in BIDLE =1) - * |[1] |CLKTOEN |Cumulative Clock Low Time Out Enable Bit - * | | |0 = Indicates the cumulative clock low time-out detection is Disabled. - * | | |1 = Indicates the cumulative clock low time-out detection is Enabled. - * | | |For Master, it calculates the period from START to ACK - * | | |For Slave, it calculates the period from START to STOP - * |[2] |BUSTOIEN |Time-out Interrupt Enable Bit - * | | |BUSY =1. - * | | |0 = Indicates the SCLK low time-out interrupt is Disabled. - * | | |1 = Indicates the SCLK low time-out interrupt is Enabled. - * | | |BUSY =0. - * | | |0 = Indicates the bus IDLE time-out interrupt is Disabled. - * | | |1 = Indicates the bus IDLE time-out interrupt is Enabled. - * |[3] |CLKTOIEN |Extended Clock Time Out Interrupt Enable Bit - * | | |0 = Indicates the clock time out interrupt is Disabled. - * | | |1 = Indicates the clock time out interrupt is Enabled. - * |[4] |TORSTEN |Time Out Reset Enable Bit - * | | |0 = Indicates the I2C state machine reset is Disable. - * | | |1 = Indicates the I2C state machine reset is Enable. (The clock and data bus will be released to high) - * @var I2C_T::BUSSTS - * Offset: 0x58 I2C Bus Management Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * |[1] |BCDONE |Byte Count Transmission/Receive Done - * | | |0 = Indicates the byte count transmission/ receive is not finished when the PECEN is set. - * | | |1 = Indicates the byte count transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * |[2] |PECERR |PEC Error in Reception - * | | |0 = Indicates the PEC value equal the received PEC data packet. - * | | |1 = Indicates the PEC value doesn't match the receive PEC data packet. - * | | |Note: Software can write 1 to clear this bit. - * |[3] |ALERT |SMBus Alert Status - * | | |Device Mode (BMHEN =0). - * | | |0 = Indicates SMBALERT pin state is low. - * | | |1 = Indicates SMBALERT pin state is high. - * | | |Host Mode (BMHEN =1). - * | | |0 = No SMBALERT event. - * | | |1 = Indicates there is SMBALERT event (falling edge) is detected in SMALERT pin when the BMHEN = 1 (SMBus host configuration) and the ALERTEN = 1. - * | | |Note: - * | | |1. The SMBALERT pin is an open-drain pin, the pull-high resistor is must in the system - * | | |2. Software can write 1 to clear this bit. - * |[4] |SCTLDIN |Bus Suspend or Control Signal Input Status - * | | |0 = The input status of SUSCON pin is 0. - * | | |1 = The input status of SUSCON pin is 1. - * |[5] |BUSTO |Bus Time-out Status - * | | |0 = Indicates that there is no any time-out or external clock time-out. - * | | |1 = Indicates that a time-out or external clock time-out occurred. - * | | |In bus busy, the bit indicates the total clock low time-out event occurred otherwise, it indicates the bus idle time-out event occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[6] |CLKTO |Clock Low Cumulate Time-out Status - * | | |0 = Indicates that the cumulative clock low is no any time-out. - * | | |1 = Indicates that the cumulative clock low time-out occurred. - * | | |Note: Software can write 1 to clear this bit. - * |[7] |PECDONE |PEC Byte Transmission/Receive Done - * | | |0 = Indicates the PEC transmission/ receive is not finished when the PECEN is set. - * | | |1 = Indicates the PEC transmission/ receive is finished when the PECEN is set. - * | | |Note: Software can write 1 to clear this bit. - * @var I2C_T::PKTSIZE - * Offset: 0x5C I2C Packet Error Checking Byte Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |PLDSIZE |Transfer Byte Number - * | | |The transmission or receive byte number in one transaction when the PECEN is set - * | | |The maximum transaction or receive byte is 256 Bytes. - * | | |Notice: The byte number counting includes address, command code, and data frame. - * @var I2C_T::PKTCRC - * Offset: 0x60 I2C Packet Error Checking Byte Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PECCRC |Packet Error Checking Byte Value - * | | |This byte indicates the packet error checking content after transmission or receive byte count by using the C(x) = X8 + X2 + X + 1 - * | | |It is read only. - * @var I2C_T::BUSTOUT - * Offset: 0x64 I2C Bus Management Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BUSTO |Bus Management Time-out Value - * | | |Indicate the bus time-out value in bus is IDLE or SCLK low. - * | | |Note: If the user wants to revise the value of BUSTOUT, the TORSTEN (I2C_BUSTCTL[4]) bit shall be set to 1 and clear to 0 first in the BUSEN(I2C_BUSCTL[7]) is set. - * @var I2C_T::CLKTOUT - * Offset: 0x68 I2C Bus Management Clock Low Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CLKTO |Bus Clock Low Timer - * | | |The field is used to configure the cumulative clock extension time-out. - * | | |Note: If the user wants to revise the value of CLKLTOUT, the TORSTEN bit shall be set to 1 and clear to 0 first in the BUSEN is set. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2C Control Register 0 */ - __IO uint32_t ADDR0; /*!< [0x0004] I2C Slave Address Register0 */ - __IO uint32_t DAT; /*!< [0x0008] I2C Data Register */ - __I uint32_t STATUS0; /*!< [0x000c] I2C Status Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0010] I2C Clock Divided Register */ - __IO uint32_t TOCTL; /*!< [0x0014] I2C Time-out Control Register */ - __IO uint32_t ADDR1; /*!< [0x0018] I2C Slave Address Register1 */ - __IO uint32_t ADDR2; /*!< [0x001c] I2C Slave Address Register2 */ - __IO uint32_t ADDR3; /*!< [0x0020] I2C Slave Address Register3 */ - __IO uint32_t ADDRMSK0; /*!< [0x0024] I2C Slave Address Mask Register0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0028] I2C Slave Address Mask Register1 */ - __IO uint32_t ADDRMSK2; /*!< [0x002c] I2C Slave Address Mask Register2 */ - __IO uint32_t ADDRMSK3; /*!< [0x0030] I2C Slave Address Mask Register3 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WKCTL; /*!< [0x003c] I2C Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0040] I2C Wake-up Status Register */ - __IO uint32_t CTL1; /*!< [0x0044] I2C Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0048] I2C Status Register 1 */ - __IO uint32_t TMCTL; /*!< [0x004c] I2C Timing Configure Control Register */ - __IO uint32_t BUSCTL; /*!< [0x0050] I2C Bus Management Control Register */ - __IO uint32_t BUSTCTL; /*!< [0x0054] I2C Bus Management Timer Control Register */ - __IO uint32_t BUSSTS; /*!< [0x0058] I2C Bus Management Status Register */ - __IO uint32_t PKTSIZE; /*!< [0x005c] I2C Packet Error Checking Byte Number Register */ - __I uint32_t PKTCRC; /*!< [0x0060] I2C Packet Error Checking Byte Value Register */ - __IO uint32_t BUSTOUT; /*!< [0x0064] I2C Bus Management Timer Register */ - __IO uint32_t CLKTOUT; /*!< [0x0068] I2C Bus Management Clock Low Timer Register */ - -} I2C_T; - -/** - @addtogroup I2C_CONST I2C Bit Field Definition - Constant Definitions for I2C Controller -@{ */ - -#define I2C_CTL0_AA_Pos (2) /*!< I2C_T::CTL: AA Position */ -#define I2C_CTL0_AA_Msk (0x1ul << I2C_CTL0_AA_Pos) /*!< I2C_T::CTL: AA Mask */ - -#define I2C_CTL0_SI_Pos (3) /*!< I2C_T::CTL: SI Position */ -#define I2C_CTL0_SI_Msk (0x1ul << I2C_CTL0_SI_Pos) /*!< I2C_T::CTL: SI Mask */ - -#define I2C_CTL0_STO_Pos (4) /*!< I2C_T::CTL: STO Position */ -#define I2C_CTL0_STO_Msk (0x1ul << I2C_CTL0_STO_Pos) /*!< I2C_T::CTL: STO Mask */ - -#define I2C_CTL0_STA_Pos (5) /*!< I2C_T::CTL: STA Position */ -#define I2C_CTL0_STA_Msk (0x1ul << I2C_CTL0_STA_Pos) /*!< I2C_T::CTL: STA Mask */ - -#define I2C_CTL0_I2CEN_Pos (6) /*!< I2C_T::CTL: I2CEN Position */ -#define I2C_CTL0_I2CEN_Msk (0x1ul << I2C_CTL0_I2CEN_Pos) /*!< I2C_T::CTL: I2CEN Mask */ - -#define I2C_CTL0_INTEN_Pos (7) /*!< I2C_T::CTL: INTEN Position */ -#define I2C_CTL0_INTEN_Msk (0x1ul << I2C_CTL0_INTEN_Pos) /*!< I2C_T::CTL: INTEN Mask */ - -#define I2C_ADDR0_GC_Pos (0) /*!< I2C_T::ADDR0: GC Position */ -#define I2C_ADDR0_GC_Msk (0x1ul << I2C_ADDR0_GC_Pos) /*!< I2C_T::ADDR0: GC Mask */ - -#define I2C_ADDR0_ADDR_Pos (1) /*!< I2C_T::ADDR0: ADDR Position */ -#define I2C_ADDR0_ADDR_Msk (0x3fful << I2C_ADDR0_ADDR_Pos) /*!< I2C_T::ADDR0: ADDR Mask */ - -#define I2C_DAT_DAT_Pos (0) /*!< I2C_T::DAT: DAT Position */ -#define I2C_DAT_DAT_Msk (0xfful << I2C_DAT_DAT_Pos) /*!< I2C_T::DAT: DAT Mask */ - -#define I2C_STATUS0_STATUS_Pos (0) /*!< I2C_T::STATUS: STATUS Position */ -#define I2C_STATUS0_STATUS_Msk (0xfful << I2C_STATUS_STATUS0_Pos) /*!< I2C_T::STATUS: STATUS Mask */ - -#define I2C_CLKDIV_DIVIDER_Pos (0) /*!< I2C_T::CLKDIV: DIVIDER Position */ -#define I2C_CLKDIV_DIVIDER_Msk (0x3fful << I2C_CLKDIV_DIVIDER_Pos) /*!< I2C_T::CLKDIV: DIVIDER Mask */ - -#define I2C_TOCTL_TOIF_Pos (0) /*!< I2C_T::TOCTL: TOIF Position */ -#define I2C_TOCTL_TOIF_Msk (0x1ul << I2C_TOCTL_TOIF_Pos) /*!< I2C_T::TOCTL: TOIF Mask */ - -#define I2C_TOCTL_TOCDIV4_Pos (1) /*!< I2C_T::TOCTL: TOCDIV4 Position */ -#define I2C_TOCTL_TOCDIV4_Msk (0x1ul << I2C_TOCTL_TOCDIV4_Pos) /*!< I2C_T::TOCTL: TOCDIV4 Mask */ - -#define I2C_TOCTL_TOCEN_Pos (2) /*!< I2C_T::TOCTL: TOCEN Position */ -#define I2C_TOCTL_TOCEN_Msk (0x1ul << I2C_TOCTL_TOCEN_Pos) /*!< I2C_T::TOCTL: TOCEN Mask */ - -#define I2C_ADDR1_GC_Pos (0) /*!< I2C_T::ADDR1: GC Position */ -#define I2C_ADDR1_GC_Msk (0x1ul << I2C_ADDR1_GC_Pos) /*!< I2C_T::ADDR1: GC Mask */ - -#define I2C_ADDR1_ADDR_Pos (1) /*!< I2C_T::ADDR1: ADDR Position */ -#define I2C_ADDR1_ADDR_Msk (0x3fful << I2C_ADDR1_ADDR_Pos) /*!< I2C_T::ADDR1: ADDR Mask */ - -#define I2C_ADDR2_GC_Pos (0) /*!< I2C_T::ADDR2: GC Position */ -#define I2C_ADDR2_GC_Msk (0x1ul << I2C_ADDR2_GC_Pos) /*!< I2C_T::ADDR2: GC Mask */ - -#define I2C_ADDR2_ADDR_Pos (1) /*!< I2C_T::ADDR2: ADDR Position */ -#define I2C_ADDR2_ADDR_Msk (0x3fful << I2C_ADDR2_ADDR_Pos) /*!< I2C_T::ADDR2: ADDR Mask */ - -#define I2C_ADDR3_GC_Pos (0) /*!< I2C_T::ADDR3: GC Position */ -#define I2C_ADDR3_GC_Msk (0x1ul << I2C_ADDR3_GC_Pos) /*!< I2C_T::ADDR3: GC Mask */ - -#define I2C_ADDR3_ADDR_Pos (1) /*!< I2C_T::ADDR3: ADDR Position */ -#define I2C_ADDR3_ADDR_Msk (0x3fful << I2C_ADDR3_ADDR_Pos) /*!< I2C_T::ADDR3: ADDR Mask */ - -#define I2C_ADDRMSK0_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK0: ADDRMSK Position */ -#define I2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK0_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define I2C_ADDRMSK1_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK1: ADDRMSK Position */ -#define I2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK1_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define I2C_ADDRMSK2_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK2: ADDRMSK Position */ -#define I2C_ADDRMSK2_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK2_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK2: ADDRMSK Mask */ - -#define I2C_ADDRMSK3_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK3: ADDRMSK Position */ -#define I2C_ADDRMSK3_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK3_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK3: ADDRMSK Mask */ - -#define I2C_WKCTL_WKEN_Pos (0) /*!< I2C_T::WKCTL: WKEN Position */ -#define I2C_WKCTL_WKEN_Msk (0x1ul << I2C_WKCTL_WKEN_Pos) /*!< I2C_T::WKCTL: WKEN Mask */ - -#define I2C_WKCTL_NHDBUSEN_Pos (7) /*!< I2C_T::WKCTL: NHDBUSEN Position */ -#define I2C_WKCTL_NHDBUSEN_Msk (0x1ul << I2C_WKCTL_NHDBUSEN_Pos) /*!< I2C_T::WKCTL: NHDBUSEN Mask */ - -#define I2C_WKSTS_WKIF_Pos (0) /*!< I2C_T::WKSTS: WKIF Position */ -#define I2C_WKSTS_WKIF_Msk (0x1ul << I2C_WKSTS_WKIF_Pos) /*!< I2C_T::WKSTS: WKIF Mask */ - -#define I2C_WKSTS_WKAKDONE_Pos (1) /*!< I2C_T::WKSTS: WKAKDONE Position */ -#define I2C_WKSTS_WKAKDONE_Msk (0x1ul << I2C_WKSTS_WKAKDONE_Pos) /*!< I2C_T::WKSTS: WKAKDONE Mask */ - -#define I2C_WKSTS_WRSTSWK_Pos (2) /*!< I2C_T::WKSTS: WRSTSWK Position */ -#define I2C_WKSTS_WRSTSWK_Msk (0x1ul << I2C_WKSTS_WRSTSWK_Pos) /*!< I2C_T::WKSTS: WRSTSWK Mask */ - -#define I2C_CTL1_TXPDMAEN_Pos (0) /*!< I2C_T::CTL1: TXPDMAEN Position */ -#define I2C_CTL1_TXPDMAEN_Msk (0x1ul << I2C_CTL1_TXPDMAEN_Pos) /*!< I2C_T::CTL1: TXPDMAEN Mask */ - -#define I2C_CTL1_RXPDMAEN_Pos (1) /*!< I2C_T::CTL1: RXPDMAEN Position */ -#define I2C_CTL1_RXPDMAEN_Msk (0x1ul << I2C_CTL1_RXPDMAEN_Pos) /*!< I2C_T::CTL1: RXPDMAEN Mask */ - -#define I2C_CTL1_PDMARST_Pos (2) /*!< I2C_T::CTL1: PDMARST Position */ -#define I2C_CTL1_PDMARST_Msk (0x1ul << I2C_CTL1_PDMARST_Pos) /*!< I2C_T::CTL1: PDMARST Mask */ - -#define I2C_CTL1_PDMASTR_Pos (8) /*!< I2C_T::CTL1: PDMASTR Position */ -#define I2C_CTL1_PDMASTR_Msk (0x1ul << I2C_CTL1_PDMASTR_Pos) /*!< I2C_T::CTL1: PDMASTR Mask */ - -#define I2C_CTL1_ADDR10EN_Pos (9) /*!< I2C_T::CTL1: ADDR10EN Position */ -#define I2C_CTL1_ADDR10EN_Msk (0x1ul << I2C_CTL1_ADDR10EN_Pos) /*!< I2C_T::CTL1: ADDR10EN Mask */ - -#define I2C_STATUS1_ADMAT0_Pos (0) /*!< I2C_T::STATUS1: ADMAT0 Position */ -#define I2C_STATUS1_ADMAT0_Msk (0x1ul << I2C_STATUS1_ADMAT0_Pos) /*!< I2C_T::STATUS1: ADMAT0 Mask */ - -#define I2C_STATUS1_ADMAT1_Pos (1) /*!< I2C_T::STATUS1: ADMAT1 Position */ -#define I2C_STATUS1_ADMAT1_Msk (0x1ul << I2C_STATUS1_ADMAT1_Pos) /*!< I2C_T::STATUS1: ADMAT1 Mask */ - -#define I2C_STATUS1_ADMAT2_Pos (2) /*!< I2C_T::STATUS1: ADMAT2 Position */ -#define I2C_STATUS1_ADMAT2_Msk (0x1ul << I2C_STATUS1_ADMAT2_Pos) /*!< I2C_T::STATUS1: ADMAT2 Mask */ - -#define I2C_STATUS1_ADMAT3_Pos (3) /*!< I2C_T::STATUS1: ADMAT3 Position */ -#define I2C_STATUS1_ADMAT3_Msk (0x1ul << I2C_STATUS1_ADMAT3_Pos) /*!< I2C_T::STATUS1: ADMAT3 Mask */ - -#define I2C_STATUS1_ONBUSY_Pos (8) /*!< I2C_T::STATUS1: ONBUSY Position */ -#define I2C_STATUS1_ONBUSY_Msk (0x1ul << I2C_STATUS1_ONBUSY_Pos) /*!< I2C_T::STATUS1: ONBUSY Mask */ - -#define I2C_TMCTL_STCTL_Pos (0) /*!< I2C_T::TMCTL: STCTL Position */ -#define I2C_TMCTL_STCTL_Msk (0x1fful << I2C_TMCTL_STCTL_Pos) /*!< I2C_T::TMCTL: STCTL Mask */ - -#define I2C_TMCTL_HTCTL_Pos (16) /*!< I2C_T::TMCTL: HTCTL Position */ -#define I2C_TMCTL_HTCTL_Msk (0x1fful << I2C_TMCTL_HTCTL_Pos) /*!< I2C_T::TMCTL: HTCTL Mask */ - -#define I2C_BUSCTL_ACKMEN_Pos (0) /*!< I2C_T::BUSCTL: ACKMEN Position */ -#define I2C_BUSCTL_ACKMEN_Msk (0x1ul << I2C_BUSCTL_ACKMEN_Pos) /*!< I2C_T::BUSCTL: ACKMEN Mask */ - -#define I2C_BUSCTL_PECEN_Pos (1) /*!< I2C_T::BUSCTL: PECEN Position */ -#define I2C_BUSCTL_PECEN_Msk (0x1ul << I2C_BUSCTL_PECEN_Pos) /*!< I2C_T::BUSCTL: PECEN Mask */ - -#define I2C_BUSCTL_BMDEN_Pos (2) /*!< I2C_T::BUSCTL: BMDEN Position */ -#define I2C_BUSCTL_BMDEN_Msk (0x1ul << I2C_BUSCTL_BMDEN_Pos) /*!< I2C_T::BUSCTL: BMDEN Mask */ - -#define I2C_BUSCTL_BMHEN_Pos (3) /*!< I2C_T::BUSCTL: BMHEN Position */ -#define I2C_BUSCTL_BMHEN_Msk (0x1ul << I2C_BUSCTL_BMHEN_Pos) /*!< I2C_T::BUSCTL: BMHEN Mask */ - -#define I2C_BUSCTL_ALERTEN_Pos (4) /*!< I2C_T::BUSCTL: ALERTEN Position */ -#define I2C_BUSCTL_ALERTEN_Msk (0x1ul << I2C_BUSCTL_ALERTEN_Pos) /*!< I2C_T::BUSCTL: ALERTEN Mask */ - -#define I2C_BUSCTL_SCTLOSTS_Pos (5) /*!< I2C_T::BUSCTL: SCTLOSTS Position */ -#define I2C_BUSCTL_SCTLOSTS_Msk (0x1ul << I2C_BUSCTL_SCTLOSTS_Pos) /*!< I2C_T::BUSCTL: SCTLOSTS Mask */ - -#define I2C_BUSCTL_SCTLOEN_Pos (6) /*!< I2C_T::BUSCTL: SCTLOEN Position */ -#define I2C_BUSCTL_SCTLOEN_Msk (0x1ul << I2C_BUSCTL_SCTLOEN_Pos) /*!< I2C_T::BUSCTL: SCTLOEN Mask */ - -#define I2C_BUSCTL_BUSEN_Pos (7) /*!< I2C_T::BUSCTL: BUSEN Position */ -#define I2C_BUSCTL_BUSEN_Msk (0x1ul << I2C_BUSCTL_BUSEN_Pos) /*!< I2C_T::BUSCTL: BUSEN Mask */ - -#define I2C_BUSCTL_PECTXEN_Pos (8) /*!< I2C_T::BUSCTL: PECTXEN Position */ -#define I2C_BUSCTL_PECTXEN_Msk (0x1ul << I2C_BUSCTL_PECTXEN_Pos) /*!< I2C_T::BUSCTL: PECTXEN Mask */ - -#define I2C_BUSCTL_TIDLE_Pos (9) /*!< I2C_T::BUSCTL: TIDLE Position */ -#define I2C_BUSCTL_TIDLE_Msk (0x1ul << I2C_BUSCTL_TIDLE_Pos) /*!< I2C_T::BUSCTL: TIDLE Mask */ - -#define I2C_BUSCTL_PECCLR_Pos (10) /*!< I2C_T::BUSCTL: PECCLR Position */ -#define I2C_BUSCTL_PECCLR_Msk (0x1ul << I2C_BUSCTL_PECCLR_Pos) /*!< I2C_T::BUSCTL: PECCLR Mask */ - -#define I2C_BUSCTL_ACKM9SI_Pos (11) /*!< I2C_T::BUSCTL: ACKM9SI Position */ -#define I2C_BUSCTL_ACKM9SI_Msk (0x1ul << I2C_BUSCTL_ACKM9SI_Pos) /*!< I2C_T::BUSCTL: ACKM9SI Mask */ - -#define I2C_BUSCTL_BCDIEN_Pos (12) /*!< I2C_T::BUSCTL: BCDIEN Position */ -#define I2C_BUSCTL_BCDIEN_Msk (0x1ul << I2C_BUSCTL_BCDIEN_Pos) /*!< I2C_T::BUSCTL: BCDIEN Mask */ - -#define I2C_BUSCTL_PECDIEN_Pos (13) /*!< I2C_T::BUSCTL: PECDIEN Position */ -#define I2C_BUSCTL_PECDIEN_Msk (0x1ul << I2C_BUSCTL_PECDIEN_Pos) /*!< I2C_T::BUSCTL: PECDIEN Mask */ - -#define I2C_BUSTCTL_BUSTOEN_Pos (0) /*!< I2C_T::BUSTCTL: BUSTOEN Position */ -#define I2C_BUSTCTL_BUSTOEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOEN Mask */ - -#define I2C_BUSTCTL_CLKTOEN_Pos (1) /*!< I2C_T::BUSTCTL: CLKTOEN Position */ -#define I2C_BUSTCTL_CLKTOEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOEN Mask */ - -#define I2C_BUSTCTL_BUSTOIEN_Pos (2) /*!< I2C_T::BUSTCTL: BUSTOIEN Position */ -#define I2C_BUSTCTL_BUSTOIEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOIEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOIEN Mask */ - -#define I2C_BUSTCTL_CLKTOIEN_Pos (3) /*!< I2C_T::BUSTCTL: CLKTOIEN Position */ -#define I2C_BUSTCTL_CLKTOIEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOIEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOIEN Mask */ - -#define I2C_BUSTCTL_TORSTEN_Pos (4) /*!< I2C_T::BUSTCTL: TORSTEN Position */ -#define I2C_BUSTCTL_TORSTEN_Msk (0x1ul << I2C_BUSTCTL_TORSTEN_Pos) /*!< I2C_T::BUSTCTL: TORSTEN Mask */ - -#define I2C_BUSSTS_BUSY_Pos (0) /*!< I2C_T::BUSSTS: BUSY Position */ -#define I2C_BUSSTS_BUSY_Msk (0x1ul << I2C_BUSSTS_BUSY_Pos) /*!< I2C_T::BUSSTS: BUSY Mask */ - -#define I2C_BUSSTS_BCDONE_Pos (1) /*!< I2C_T::BUSSTS: BCDONE Position */ -#define I2C_BUSSTS_BCDONE_Msk (0x1ul << I2C_BUSSTS_BCDONE_Pos) /*!< I2C_T::BUSSTS: BCDONE Mask */ - -#define I2C_BUSSTS_PECERR_Pos (2) /*!< I2C_T::BUSSTS: PECERR Position */ -#define I2C_BUSSTS_PECERR_Msk (0x1ul << I2C_BUSSTS_PECERR_Pos) /*!< I2C_T::BUSSTS: PECERR Mask */ - -#define I2C_BUSSTS_ALERT_Pos (3) /*!< I2C_T::BUSSTS: ALERT Position */ -#define I2C_BUSSTS_ALERT_Msk (0x1ul << I2C_BUSSTS_ALERT_Pos) /*!< I2C_T::BUSSTS: ALERT Mask */ - -#define I2C_BUSSTS_SCTLDIN_Pos (4) /*!< I2C_T::BUSSTS: SCTLDIN Position */ -#define I2C_BUSSTS_SCTLDIN_Msk (0x1ul << I2C_BUSSTS_SCTLDIN_Pos) /*!< I2C_T::BUSSTS: SCTLDIN Mask */ - -#define I2C_BUSSTS_BUSTO_Pos (5) /*!< I2C_T::BUSSTS: BUSTO Position */ -#define I2C_BUSSTS_BUSTO_Msk (0x1ul << I2C_BUSSTS_BUSTO_Pos) /*!< I2C_T::BUSSTS: BUSTO Mask */ - -#define I2C_BUSSTS_CLKTO_Pos (6) /*!< I2C_T::BUSSTS: CLKTO Position */ -#define I2C_BUSSTS_CLKTO_Msk (0x1ul << I2C_BUSSTS_CLKTO_Pos) /*!< I2C_T::BUSSTS: CLKTO Mask */ - -#define I2C_BUSSTS_PECDONE_Pos (7) /*!< I2C_T::BUSSTS: PECDONE Position */ -#define I2C_BUSSTS_PECDONE_Msk (0x1ul << I2C_BUSSTS_PECDONE_Pos) /*!< I2C_T::BUSSTS: PECDONE Mask */ - -#define I2C_PKTSIZE_PLDSIZE_Pos (0) /*!< I2C_T::PKTSIZE: PLDSIZE Position */ -#define I2C_PKTSIZE_PLDSIZE_Msk (0x1fful << I2C_PKTSIZE_PLDSIZE_Pos) /*!< I2C_T::PKTSIZE: PLDSIZE Mask */ - -#define I2C_PKTCRC_PECCRC_Pos (0) /*!< I2C_T::PKTCRC: PECCRC Position */ -#define I2C_PKTCRC_PECCRC_Msk (0xfful << I2C_PKTCRC_PECCRC_Pos) /*!< I2C_T::PKTCRC: PECCRC Mask */ - -#define I2C_BUSTOUT_BUSTO_Pos (0) /*!< I2C_T::BUSTOUT: BUSTO Position */ -#define I2C_BUSTOUT_BUSTO_Msk (0xfful << I2C_BUSTOUT_BUSTO_Pos) /*!< I2C_T::BUSTOUT: BUSTO Mask */ - -#define I2C_CLKTOUT_CLKTO_Pos (0) /*!< I2C_T::CLKTOUT: CLKTO Position */ -#define I2C_CLKTOUT_CLKTO_Msk (0xfful << I2C_CLKTOUT_CLKTO_Pos) /*!< I2C_T::CLKTOUT: CLKTO Mask */ - -/**@}*/ /* I2C_CONST */ -/**@}*/ /* end of I2C register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __I2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2s_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2s_reg.h deleted file mode 100644 index ed8e34b6c32..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/i2s_reg.h +++ /dev/null @@ -1,707 +0,0 @@ -/**************************************************************************//** - * @file i2s_reg.h - * @version V1.00 - * @brief I2S register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __I2S_REG_H__ -#define __I2S_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup I2S I2S Interface Controller(I2S) - Memory Mapped Structure for I2S Controller -@{ */ - -typedef struct -{ - - - /** - * @var I2S_T::CTL0 - * Offset: 0x00 I2S Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SEN |I2S Controller Enable Control - * | | |0 = I2S controller Disabled. - * | | |1 = I2S controller Enabled. - * |[1] |TXEN |Transmit Enable Control - * | | |0 = Data transmission Disabled. - * | | |1 = Data transmission Enabled. - * |[2] |RXEN |Receive Enable Control - * | | |0 = Data receiving Disabled. - * | | |1 = Data receiving Enabled. - * |[3] |MUTE |Transmit Mute Enable Control - * | | |0 = Transmit data is shifted from buffer. - * | | |1 = Send zero on transmit channel. - * |[5:4] |DATWIDTH |Data Width - * | | |This bit field is used to define the bit-width of data word in each audio channel - * | | |00 = The bit-width of data word is 8-bit. - * | | |01 = The bit-width of data word is 16-bit. - * | | |10 = The bit-width of data word is 24-bit. - * | | |11 = The bit-width of data word is 32-bit. - * |[6] |MONO |Monaural Data Control - * | | |0 = Data is stereo format. - * | | |1 = Data is monaural format. - * | | |Note: when chip records data, RXLCH (I2S_CTL0[23]) indicates which channel data will be saved if monaural format is selected. - * |[7] |ORDER |Stereo Data Order in FIFO - * | | |In 8-bit/16-bit data width, this bit is used to select whether the even or odd channel data is stored in higher byte - * | | |In 24-bit data width, this is used to select the left/right alignment method of audio data which is stored in data memory consisted of 32-bit FIFO entries. - * | | |0 = Even channel data at high byte in 8-bit/16-bit data width. - * | | |LSB of 24-bit audio data in each channel is aligned to right side in 32-bit FIFO entries. - * | | |1 = Even channel data at low byte. - * | | | MSB of 24-bit audio data in each channel is aligned to left side in 32-bit FIFO entries. - * |[8] |SLAVE |Slave Mode Enable Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * | | |Note: I2S can operate as master or slave - * | | |For Master mode, I2S_BCLK and I2S_LRCLK pins are output mode and send out bit clock to Audio CODEC chip - * | | |In Slave mode, I2S_BCLK and I2S_LRCLK pins are input mode and I2S_BCLK and I2S_LRCLK signals are received from outer Audio CODEC chip. - * |[15] |MCLKEN |Master Clock Enable Control - * | | |If MCLKEN is set to 1, I2S controller will generate master clock on I2S_MCLK pin for external audio devices. - * | | |0 = Master clock Disabled. - * | | |1 = Master clock Enabled. - * |[18] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No Effect. - * | | |1 = Clear TX FIFO. - * | | |Note1: Write 1 to clear transmit FIFO, internal pointer is reset to FIFO start point, and TXCNT (I2S_STATUS1[12:8]) returns 0 and transmit FIFO becomes empty but data in transmit FIFO is not changed. - * | | |Note2: This bit is clear by hardware automatically, read it return zero. - * |[19] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No Effect. - * | | |1 = Clear RX FIFO. - * | | |Note1: Write 1 to clear receive FIFO, internal pointer is reset to FIFO start point, and RXCNT (I2S_STATUS1[20:16]) returns 0 and receive FIFO becomes empty. - * | | |Note2: This bit is cleared by hardware automatically, read it return zero. - * |[20] |TXPDMAEN |Transmit PDMA Enable Control - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[21] |RXPDMAEN |Receive PDMA Enable Control - * | | |0 = Receiver PDMA function Disabled. - * | | |1 = Receiver PDMA function Enabled. - * |[23] |RXLCH |Receive Left Channel Enable Control - * | | |When monaural format is selected (MONO = 1), I2S will receive channel1 data if RXLCH is set to 0, and receive channel0 data if RXLCH is set to 1. - * | | |0 = Receives channel1 data in MONO mode. - * | | |1 = Receives channel0 data in MONO mode. - * |[26:24] |FORMAT |Data Format Selection - * | | |000 = I2S standard data format. - * | | |001 = I2S with MSB justified. - * | | |010 = I2S with LSB justified. - * | | |011 = Reserved. - * | | |100 = PCM standard data format. - * | | |101 = PCM with MSB justified. - * | | |110 = PCM with LSB justified. - * | | |111 = Reserved. - * |[27] |PCMSYNC |PCM Synchronization Pulse Length Selection - * | | |This bit field is used to select the high pulse length of frame synchronization signal in PCM protocol - * | | |0 = One BCLK period. - * | | |1 = One channel period. - * | | |Note: This bit is only available in master mode - * |[29:28] |CHWIDTH |Channel Width - * | | |This bit fields are used to define the length of audio channel - * | | |If CHWIDTH < DATWIDTH, the hardware will set the real channel length as the bit-width of audio data which is defined by DATWIDTH. - * | | |00 = The bit-width of each audio channel is 8-bit. - * | | |01 = The bit-width of each audio channel is 16-bit. - * | | |10 = The bit-width of each audio channel is 24-bit. - * | | |11 = The bit-width of each audio channel is 32-bit. - * |[31:30] |TDMCHNUM |TDM Channel Number - * | | |This bit fields are used to define the TDM channel number in one audio frame while PCM mode (FORMAT[2] = 1). - * | | |00 = 2 channels in audio frame. - * | | |01 = 4 channels in audio frame. - * | | |10 = 6 channels in audio frame. - * | | |11 = 8 channels in audio frame. - * @var I2S_T::CLKDIV - * Offset: 0x04 I2S Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |MCLKDIV |Master Clock Divider - * | | |If chip external crystal frequency is (2xMCLKDIV)*256fs then software can program these bits to generate 256fs clock frequency to audio codec chip - * | | |If MCLKDIV is set to 0, MCLK is the same as external clock input. - * | | |For example, sampling rate is 24 kHz and chip external crystal clock is 12.288 MHz, set MCLKDIV = 1. - * | | |F_MCLK = F_I2SCLK/(2x(MCLKDIV)) (When MCLKDIV is >= 1 ). - * | | |F_MCLK = F_I2SCLK (When MCLKDIV is set to 0 ). - * | | |Note: F_MCLK is the frequency of MCLK, and F_I2SCLK is the frequency of the I2S_CLK - * |[16:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode - * | | |Software can program these bit fields to generate sampling rate clock frequency. - * | | |F_BCLK= F_I2SCLK / (2*(BCLKDIV + 1)). - * | | |Note: F_BCLK is the frequency of BCLK and F_I2SCLK is the frequency of I2S_CLK - * @var I2S_T::IEN - * Offset: 0x08 I2S Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXUDFIEN |Receive FIFO Underflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: If software reads receive FIFO when it is empty then RXUDIF (I2S_STATUS0[8]) flag is set to 1. - * |[1] |RXOVFIEN |Receive FIFO Overflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and RXOVIF (I2S_STATUS0[9]) flag is set to 1 - * |[2] |RXTHIEN |Receive FIFO Threshold Level Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: When data word in receive FIFO is equal or higher than RXTH (I2S_CTL1[19:16]) and the RXTHIF (I2S_STATUS0[10]) bit is set to 1 - * | | |If RXTHIEN bit is enabled, interrupt occur. - * |[8] |TXUDFIEN |Transmit FIFO Underflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occur if this bit is set to 1 and TXUDIF (I2S_STATUS0[16]) flag is set to 1. - * |[9] |TXOVFIEN |Transmit FIFO Overflow Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and TXOVIF (I2S_STATUS0[17]) flag is set to 1 - * |[10] |TXTHIEN |Transmit FIFO Threshold Level Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and data words in transmit FIFO is less than TXTH (I2S_CTL1[11:8]). - * |[16] |CH0ZCIEN |Channel0 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel0 zero-cross - * | | |Note2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[17] |CH1ZCIEN |Channel1 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel1 zero-cross - * | | |Note2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[18] |CH2ZCIEN |Channel2 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel2 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[19] |CH3ZCIEN |Channel3 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel3 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[20] |CH4ZCIEN |Channel4 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel4 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[21] |CH5ZCIEN |Channel5 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel5 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[22] |CH6ZCIEN |Channel6 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel6 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[23] |CH7ZCIEN |Channel7 Zero-cross Interrupt Enable Control - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note1: Interrupt occurs if this bit is set to 1 and channel7 zero-cross - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * @var I2S_T::STATUS0 - * Offset: 0x0C I2S Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SINT |I2S Interrupt Flag (Read Only) - * | | |0 = No I2S interrupt. - * | | |1 = I2S interrupt. - * | | |Note: It is wire-OR of I2STXINT and I2SRXINT bits. - * |[1] |I2SRXINT |I2S Receive Interrupt (Read Only) - * | | |0 = No receive interrupt. - * | | |1 = Receive interrupt. - * |[2] |I2STXINT |I2S Transmit Interrupt (Read Only) - * | | |0 = No transmit interrupt. - * | | |1 = Transmit interrupt. - * |[5:3] |DATACH |Transmission Data Channel (Read Only) - * | | |This bit fields are used to indicate which audio channel is current transmit data belong. - * | | |000 = channel0 (means left channel while 2-channel I2S/PCM mode). - * | | |001 = channel1 (means right channel while 2-channel I2S/PCM mode). - * | | |010 = channel2 (available while 4-channel TDM PCM mode). - * | | |011 = channel3 (available while 4-channel TDM PCM mode). - * | | |100 = channel4 (available while 6-channel TDM PCM mode). - * | | |101 = channel5 (available while 6-channel TDM PCM mode). - * | | |110 = channel6 (available while 8-channel TDM PCM mode). - * | | |111 = channel7 (available while 8-channel TDM PCM mode). - * |[8] |RXUDIF |Receive FIFO Underflow Interrupt Flag - * | | |0 = No underflow occur. - * | | |1 = Underflow occur. - * | | |Note1: When receive FIFO is empty, and software reads the receive FIFO again - * | | |This bit will be set to 1, and it indicates underflow situation occurs. - * | | |Note2: Write 1 to clear this bit to zero - * |[9] |RXOVIF |Receive FIFO Overflow Interrupt Flag - * | | |0 = No overflow occur. - * | | |1 = Overflow occur. - * | | |Note1: When receive FIFO is full and receive hardware attempt to write data into receive FIFO then this bit is set to 1, data in 1st buffer is overwrote. - * | | |Note2: Write 1 to clear this bit to 0. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is not higher than threshold level. - * | | |1 = Data word(s) in FIFO is higher than threshold level. - * | | |Note: When data word(s) in receive FIFO is higher than threshold value set in RXTH (I2S_CTL1[19:16]) the RXTHIF bit becomes to 1 - * | | |It keeps at 1 till RXCNT (I2S_STATUS1[20:16]) is not higher than RXTH (I2S_CTL1[19:16]) after software read RXFIFO register. - * |[11] |RXFULL |Receive FIFO Full (Read Only) - * | | |0 = Not full. - * | | |1 = Full. - * | | |Note: This bit reflects data words number in receive FIFO is 16. - * |[12] |RXEMPTY |Receive FIFO Empty (Read Only) - * | | |0 = Not empty. - * | | |1 = Empty. - * | | |Note: This bit reflects data words number in receive FIFO is zero - * |[16] |TXUDIF |Transmit FIFO Underflow Interrupt Flag - * | | |0 = No underflow. - * | | |1 = Underflow. - * | | |Note1: This bit will be set to 1 when shift logic hardware read data from transmitting FIFO and the filling data level in transmitting FIFO is not enough for one audio frame. - * | | |Note2: Write 1 to clear this bit to 0. - * |[17] |TXOVIF |Transmit FIFO Overflow Interrupt Flag - * | | |0 = No overflow. - * | | |1 = Overflow. - * | | |Note1: Write data to transmit FIFO when it is full and this bit set to 1 - * | | |Note2: Write 1 to clear this bit to 0. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is higher than threshold level. - * | | |1 = Data word(s) in FIFO is equal or lower than threshold level. - * | | |Note: When data word(s) in transmit FIFO is equal or lower than threshold value set in TXTH (I2S_CTL1[11:8]) the TXTHIF bit becomes to 1 - * | | |It keeps at 1 till TXCNT (I2S_STATUS1[12:8]) is higher than TXTH (I2S_CTL1[11:8]) after software write TXFIFO register. - * |[19] |TXFULL |Transmit FIFO Full (Read Only) - * | | |This bit reflect data word number in transmit FIFO is 16 - * | | |0 = Not full. - * | | |1 = Full. - * |[20] |TXEMPTY |Transmit FIFO Empty (Read Only) - * | | |This bit reflect data word number in transmit FIFO is zero - * | | |0 = Not empty. - * | | |1 = Empty. - * |[21] |TXBUSY |Transmit Busy (Read Only) - * | | |0 = Transmit shift buffer is empty. - * | | |1 = Transmit shift buffer is busy. - * | | |Note: This bit is cleared to 0 when all data in transmit FIFO and shift buffer is shifted out - * | | |And set to 1 when 1st data is load to shift buffer - * @var I2S_T::TXFIFO - * Offset: 0x10 I2S Transmit FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXFIFO |Transmit FIFO Bits - * | | |I2S contains 16 words (16x32 bit) data buffer for data transmit - * | | |Write data to this register to prepare data for transmit - * | | |The remaining word number is indicated by TXCNT (I2S_STATUS1[12:8]). - * @var I2S_T::RXFIFO - * Offset: 0x14 I2S Receive FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXFIFO |Receive FIFO Bits - * | | |I2S contains 16 words (16x32 bit) data buffer for data receive - * | | |Read this register to get data in FIFO - * | | |The remaining data word number is indicated by RXCNT (I2S_STATUS1[20:16]). - * @var I2S_T::CTL1 - * Offset: 0x20 I2S Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCEN |Channel0 Zero-cross Detection Enable Control - * | | |0 = channel0 zero-cross detect Disabled. - * | | |1 = channel0 zero-cross detect Enabled. - * | | |Note1: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note2: If this bit is set to 1, when channel0 data sign bit change or next shift data bits are all zero then CH0ZCIF(I2S_STATUS1[0]) flag is set to 1. - * | | |Note3: If CH0ZCIF Flag is set to 1, the channel0 will be mute. - * |[1] |CH1ZCEN |Channel1 Zero-cross Detect Enable Control - * | | |0 = channel1 zero-cross detect Disabled. - * | | |1 = channel1 zero-cross detect Enabled. - * | | |Note1: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note2: If this bit is set to 1, when channel1 data sign bit change or next shift data bits are all zero then CH1ZCIF(I2S_STATUS1[1]) flag is set to 1. - * | | |Note3: If CH1ZCIF Flag is set to 1, the channel1 will be mute. - * |[2] |CH2ZCEN |Channel2 Zero-cross Detect Enable Control - * | | |0 = channel2 zero-cross detect Disabled. - * | | |1 = channel2 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel2 data sign bit change or next shift data bits are all zero then CH2ZCIF(I2S_STATUS1[2]) flag is set to 1. - * | | |Note3: If CH2ZCIF Flag is set to 1, the channel2 will be mute. - * |[3] |CH3ZCEN |Channel3 Zero-cross Detect Enable Control - * | | |0 = channel3 zero-cross detect Disabled. - * | | |1 = channel3 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel3 data sign bit change or next shift data bits are all zero then CH3ZCIF(I2S_STATUS1[3]) flag is set to 1. - * | | |Note3: If CH3ZCIF Flag is set to 1, the channel3 will be mute. - * |[4] |CH4ZCEN |Channel4 Zero-cross Detect Enable Control - * | | |0 = channel4 zero-cross detect Disabled. - * | | |1 = channel4 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel4 data sign bit change or next shift data bits are all zero then CH4ZCIF(I2S_STATUS1[4]) flag is set to 1. - * | | |Note3: If CH4ZCIF Flag is set to 1, the channel4 will be mute. - * |[5] |CH5ZCEN |Channel5 Zero-cross Detect Enable Control - * | | |0 = channel5 zero-cross detect Disabled. - * | | |1 = channel5 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel5 data sign bit change or next shift data bits are all zero then CH5ZCIF(I2S_STATUS1[5]) flag is set to 1. - * | | |Note3: If CH5ZCIF Flag is set to 1, the channel5 will be mute. - * |[6] |CH6ZCEN |Channel6 Zero-cross Detect Enable Control - * | | |0 = channel6 zero-cross detect Disabled. - * | | |1 = channel6 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel6 data sign bit change or next shift data bits are all zero then CH6ZCIF(I2S_STATUS1[6]) flag is set to 1. - * | | |Note3: If CH6ZCIF Flag is set to 1, the channel6 will be mute. - * |[7] |CH7ZCEN |Channel7 Zero-cross Detect Enable Control - * | | |0 = channel7 zero-cross detect Disabled. - * | | |1 = channel7 zero-cross detect Enabled. - * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note2: If this bit is set to 1, when channel7 data sign bit change or next shift data bits are all zero then CH7ZCIF (I2S_STATUS1[7]) flag is set to 1. - * | | |Note3: If CH7ZCIF Flag is set to 1, the channel7 will be mute. - * |[11:8] |TXTH |Transmit FIFO Threshold Level - * | | |0000 = 0 data word in transmit FIFO. - * | | |0001 = 1 data word in transmit FIFO. - * | | |0010 = 2 data words in transmit FIFO. - * | | |... - * | | |1110 = 14 data words in transmit FIFO. - * | | |1111 = 15 data words in transmit FIFO. - * | | |Note: If remain data word number in transmit FIFO is the same or less than threshold level then TXTHIF (I2S_STATUS0[18]) flag is set. - * |[19:16] |RXTH |Receive FIFO Threshold Level - * | | |0000 = 1 data word in receive FIFO. - * | | |0001 = 2 data words in receive FIFO. - * | | |0010 = 3 data words in receive FIFO. - * | | |... - * | | |1110 = 15 data words in receive FIFO. - * | | |1111 = 16 data words in receive FIFO. - * | | |Note: When received data word number in receive buffer is greater than threshold level then RXTHIF (I2S_STATUS0[10]) flag is set. - * |[24] |PBWIDTH |Peripheral Bus Data Width Selection - * | | |This bit is used to choice the available data width of APB bus - * | | |It must be set to 1 while PDMA function is enable and it is set to 16-bit transmission mode - * | | |0 = 32 bits data width. - * | | |1 = 16 bits data width. - * | | |Note1: If PBWIDTH=1, the low 16 bits of 32-bit data bus are available. - * | | |Note2: If PBWIDTH=1, the transmitting FIFO level will be increased after two FIFO write operations. - * | | |Note3: If PBWIDTH=1, the receiving FIFO level will be decreased after two FIFO read operations. - * |[25] |PB16ORD |FIFO Read/Write Order in 16-bit Width of Peripheral Bus - * | | |When PBWIDTH = 1, the data FIFO will be increased or decreased by two peripheral bus access - * | | |This bit is used to select the order of FIFO access operations to meet the 32-bit transmitting/receiving FIFO entries. - * | | |0 = Low 16-bit read/write access first. - * | | |1 = High 16-bit read/write access first. - * | | |Note: This bit is available while PBWIDTH = 1. - * @var I2S_T::STATUS1 - * Offset: 0x24 I2S Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCIF |Channel0 Zero-cross Interrupt Flag - * | | |It indicates channel0 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel0. - * | | |1 = Channel0 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[1] |CH1ZCIF |Channel1 Zero-cross Interrupt Flag - * | | |It indicates channel1 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel1. - * | | |1 = Channel1 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[2] |CH2ZCIF |Channel2 Zero-cross Interrupt Flag - * | | |It indicates channel2 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel2. - * | | |1 = Channel2 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[3] |CH3ZCIF |Channel3 Zero-cross Interrupt Flag - * | | |It indicates channel3 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel3. - * | | |1 = Channel3 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[4] |CH4ZCIF |Channel4 Zero-cross Interrupt Flag - * | | |It indicates channel4 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel4. - * | | |1 = Channel4 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[5] |CH5ZCIF |Channel5 Zero-cross Interrupt Flag - * | | |It indicates channel5 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel5. - * | | |1 = Channel5 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[6] |CH6ZCIF |Channel6 Zero-cross Interrupt Flag - * | | |It indicates channel6 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel6. - * | | |1 = Channel6 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[7] |CH7ZCIF |Channel7 Zero-cross Interrupt Flag - * | | |It indicates channel7 next sample data sign bit is changed or all data bits are zero. - * | | |0 = No zero-cross in channel7. - * | | |1 = Channel7 zero-cross is detected. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[12:8] |TXCNT |Transmit FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in transmit FIFO - * | | |00000 = No data. - * | | |00001 = 1 word in transmit FIFO. - * | | |00010 = 2 words in transmit FIFO. - * | | |... - * | | |01110 = 14 words in transmit FIFO. - * | | |01111 = 15 words in transmit FIFO. - * | | |10000 = 16 words in transmit FIFO. - * | | |Others are reserved. - * |[20:16] |RXCNT |Receive FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in receive FIFO - * | | |00000 = No data. - * | | |00001 = 1 word in receive FIFO. - * | | |00010 = 2 words in receive FIFO. - * | | |... - * | | |01110 = 14 words in receive FIFO. - * | | |01111 = 15 words in receive FIFO. - * | | |10000 = 16 words in receive FIFO. - * | | |Others are reserved. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2S Control Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0004] I2S Clock Divider Register */ - __IO uint32_t IEN; /*!< [0x0008] I2S Interrupt Enable Register */ - __IO uint32_t STATUS0; /*!< [0x000c] I2S Status Register 0 */ - __O uint32_t TXFIFO; /*!< [0x0010] I2S Transmit FIFO Register */ - __I uint32_t RXFIFO; /*!< [0x0014] I2S Receive FIFO Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL1; /*!< [0x0020] I2S Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0024] I2S Status Register 1 */ - -} I2S_T; - -/** - @addtogroup I2S_CONST I2S Bit Field Definition - Constant Definitions for I2S Controller -@{ */ - -#define I2S_CTL0_I2SEN_Pos (0) /*!< I2S_T::CTL0: I2SEN Position */ -#define I2S_CTL0_I2SEN_Msk (0x1ul << I2S_CTL0_I2SEN_Pos) /*!< I2S_T::CTL0: I2SEN Mask */ - -#define I2S_CTL0_TXEN_Pos (1) /*!< I2S_T::CTL0: TXEN Position */ -#define I2S_CTL0_TXEN_Msk (0x1ul << I2S_CTL0_TXEN_Pos) /*!< I2S_T::CTL0: TXEN Mask */ - -#define I2S_CTL0_RXEN_Pos (2) /*!< I2S_T::CTL0: RXEN Position */ -#define I2S_CTL0_RXEN_Msk (0x1ul << I2S_CTL0_RXEN_Pos) /*!< I2S_T::CTL0: RXEN Mask */ - -#define I2S_CTL0_MUTE_Pos (3) /*!< I2S_T::CTL0: MUTE Position */ -#define I2S_CTL0_MUTE_Msk (0x1ul << I2S_CTL0_MUTE_Pos) /*!< I2S_T::CTL0: MUTE Mask */ - -#define I2S_CTL0_DATWIDTH_Pos (4) /*!< I2S_T::CTL0: DATWIDTH Position */ -#define I2S_CTL0_DATWIDTH_Msk (0x3ul << I2S_CTL0_DATWIDTH_Pos) /*!< I2S_T::CTL0: DATWIDTH Mask */ - -#define I2S_CTL0_MONO_Pos (6) /*!< I2S_T::CTL0: MONO Position */ -#define I2S_CTL0_MONO_Msk (0x1ul << I2S_CTL0_MONO_Pos) /*!< I2S_T::CTL0: MONO Mask */ - -#define I2S_CTL0_ORDER_Pos (7) /*!< I2S_T::CTL0: ORDER Position */ -#define I2S_CTL0_ORDER_Msk (0x1ul << I2S_CTL0_ORDER_Pos) /*!< I2S_T::CTL0: ORDER Mask */ - -#define I2S_CTL0_SLAVE_Pos (8) /*!< I2S_T::CTL0: SLAVE Position */ -#define I2S_CTL0_SLAVE_Msk (0x1ul << I2S_CTL0_SLAVE_Pos) /*!< I2S_T::CTL0: SLAVE Mask */ - -#define I2S_CTL0_MCLKEN_Pos (15) /*!< I2S_T::CTL0: MCLKEN Position */ -#define I2S_CTL0_MCLKEN_Msk (0x1ul << I2S_CTL0_MCLKEN_Pos) /*!< I2S_T::CTL0: MCLKEN Mask */ - -#define I2S_CTL0_TXFBCLR_Pos (18) /*!< I2S_T::CTL0: TXFBCLR Position */ -#define I2S_CTL0_TXFBCLR_Msk (0x1ul << I2S_CTL0_TXFBCLR_Pos) /*!< I2S_T::CTL0: TXFBCLR Mask */ - -#define I2S_CTL0_RXFBCLR_Pos (19) /*!< I2S_T::CTL0: RXFBCLR Position */ -#define I2S_CTL0_RXFBCLR_Msk (0x1ul << I2S_CTL0_RXFBCLR_Pos) /*!< I2S_T::CTL0: RXFBCLR Mask */ - -#define I2S_CTL0_TXPDMAEN_Pos (20) /*!< I2S_T::CTL0: TXPDMAEN Position */ -#define I2S_CTL0_TXPDMAEN_Msk (0x1ul << I2S_CTL0_TXPDMAEN_Pos) /*!< I2S_T::CTL0: TXPDMAEN Mask */ - -#define I2S_CTL0_RXPDMAEN_Pos (21) /*!< I2S_T::CTL0: RXPDMAEN Position */ -#define I2S_CTL0_RXPDMAEN_Msk (0x1ul << I2S_CTL0_RXPDMAEN_Pos) /*!< I2S_T::CTL0: RXPDMAEN Mask */ - -#define I2S_CTL0_RXLCH_Pos (23) /*!< I2S_T::CTL0: RXLCH Position */ -#define I2S_CTL0_RXLCH_Msk (0x1ul << I2S_CTL0_RXLCH_Pos) /*!< I2S_T::CTL0: RXLCH Mask */ - -#define I2S_CTL0_FORMAT_Pos (24) /*!< I2S_T::CTL0: FORMAT Position */ -#define I2S_CTL0_FORMAT_Msk (0x7ul << I2S_CTL0_FORMAT_Pos) /*!< I2S_T::CTL0: FORMAT Mask */ - -#define I2S_CTL0_PCMSYNC_Pos (27) /*!< I2S_T::CTL0: PCMSYNC Position */ -#define I2S_CTL0_PCMSYNC_Msk (0x1ul << I2S_CTL0_PCMSYNC_Pos) /*!< I2S_T::CTL0: PCMSYNC Mask */ - -#define I2S_CTL0_CHWIDTH_Pos (28) /*!< I2S_T::CTL0: CHWIDTH Position */ -#define I2S_CTL0_CHWIDTH_Msk (0x3ul << I2S_CTL0_CHWIDTH_Pos) /*!< I2S_T::CTL0: CHWIDTH Mask */ - -#define I2S_CTL0_TDMCHNUM_Pos (30) /*!< I2S_T::CTL0: TDMCHNUM Position */ -#define I2S_CTL0_TDMCHNUM_Msk (0x3ul << I2S_CTL0_TDMCHNUM_Pos) /*!< I2S_T::CTL0: TDMCHNUM Mask */ - -#define I2S_CLKDIV_MCLKDIV_Pos (0) /*!< I2S_T::CLKDIV: MCLKDIV Position */ -#define I2S_CLKDIV_MCLKDIV_Msk (0x3ful << I2S_CLKDIV_MCLKDIV_Pos) /*!< I2S_T::CLKDIV: MCLKDIV Mask */ - -#define I2S_CLKDIV_BCLKDIV_Pos (8) /*!< I2S_T::CLKDIV: BCLKDIV Position */ -#define I2S_CLKDIV_BCLKDIV_Msk (0x1fful << I2S_CLKDIV_BCLKDIV_Pos) /*!< I2S_T::CLKDIV: BCLKDIV Mask */ - -#define I2S_IEN_RXUDFIEN_Pos (0) /*!< I2S_T::IEN: RXUDFIEN Position */ -#define I2S_IEN_RXUDFIEN_Msk (0x1ul << I2S_IEN_RXUDFIEN_Pos) /*!< I2S_T::IEN: RXUDFIEN Mask */ - -#define I2S_IEN_RXOVFIEN_Pos (1) /*!< I2S_T::IEN: RXOVFIEN Position */ -#define I2S_IEN_RXOVFIEN_Msk (0x1ul << I2S_IEN_RXOVFIEN_Pos) /*!< I2S_T::IEN: RXOVFIEN Mask */ - -#define I2S_IEN_RXTHIEN_Pos (2) /*!< I2S_T::IEN: RXTHIEN Position */ -#define I2S_IEN_RXTHIEN_Msk (0x1ul << I2S_IEN_RXTHIEN_Pos) /*!< I2S_T::IEN: RXTHIEN Mask */ - -#define I2S_IEN_TXUDFIEN_Pos (8) /*!< I2S_T::IEN: TXUDFIEN Position */ -#define I2S_IEN_TXUDFIEN_Msk (0x1ul << I2S_IEN_TXUDFIEN_Pos) /*!< I2S_T::IEN: TXUDFIEN Mask */ - -#define I2S_IEN_TXOVFIEN_Pos (9) /*!< I2S_T::IEN: TXOVFIEN Position */ -#define I2S_IEN_TXOVFIEN_Msk (0x1ul << I2S_IEN_TXOVFIEN_Pos) /*!< I2S_T::IEN: TXOVFIEN Mask */ - -#define I2S_IEN_TXTHIEN_Pos (10) /*!< I2S_T::IEN: TXTHIEN Position */ -#define I2S_IEN_TXTHIEN_Msk (0x1ul << I2S_IEN_TXTHIEN_Pos) /*!< I2S_T::IEN: TXTHIEN Mask */ - -#define I2S_IEN_CH0ZCIEN_Pos (16) /*!< I2S_T::IEN: CH0ZCIEN Position */ -#define I2S_IEN_CH0ZCIEN_Msk (0x1ul << I2S_IEN_CH0ZCIEN_Pos) /*!< I2S_T::IEN: CH0ZCIEN Mask */ - -#define I2S_IEN_CH1ZCIEN_Pos (17) /*!< I2S_T::IEN: CH1ZCIEN Position */ -#define I2S_IEN_CH1ZCIEN_Msk (0x1ul << I2S_IEN_CH1ZCIEN_Pos) /*!< I2S_T::IEN: CH1ZCIEN Mask */ - -#define I2S_IEN_CH2ZCIEN_Pos (18) /*!< I2S_T::IEN: CH2ZCIEN Position */ -#define I2S_IEN_CH2ZCIEN_Msk (0x1ul << I2S_IEN_CH2ZCIEN_Pos) /*!< I2S_T::IEN: CH2ZCIEN Mask */ - -#define I2S_IEN_CH3ZCIEN_Pos (19) /*!< I2S_T::IEN: CH3ZCIEN Position */ -#define I2S_IEN_CH3ZCIEN_Msk (0x1ul << I2S_IEN_CH3ZCIEN_Pos) /*!< I2S_T::IEN: CH3ZCIEN Mask */ - -#define I2S_IEN_CH4ZCIEN_Pos (20) /*!< I2S_T::IEN: CH4ZCIEN Position */ -#define I2S_IEN_CH4ZCIEN_Msk (0x1ul << I2S_IEN_CH4ZCIEN_Pos) /*!< I2S_T::IEN: CH4ZCIEN Mask */ - -#define I2S_IEN_CH5ZCIEN_Pos (21) /*!< I2S_T::IEN: CH5ZCIEN Position */ -#define I2S_IEN_CH5ZCIEN_Msk (0x1ul << I2S_IEN_CH5ZCIEN_Pos) /*!< I2S_T::IEN: CH5ZCIEN Mask */ - -#define I2S_IEN_CH6ZCIEN_Pos (22) /*!< I2S_T::IEN: CH6ZCIEN Position */ -#define I2S_IEN_CH6ZCIEN_Msk (0x1ul << I2S_IEN_CH6ZCIEN_Pos) /*!< I2S_T::IEN: CH6ZCIEN Mask */ - -#define I2S_IEN_CH7ZCIEN_Pos (23) /*!< I2S_T::IEN: CH7ZCIEN Position */ -#define I2S_IEN_CH7ZCIEN_Msk (0x1ul << I2S_IEN_CH7ZCIEN_Pos) /*!< I2S_T::IEN: CH7ZCIEN Mask */ - -#define I2S_STATUS0_I2SINT_Pos (0) /*!< I2S_T::STATUS0: I2SINT Position */ -#define I2S_STATUS0_I2SINT_Msk (0x1ul << I2S_STATUS0_I2SINT_Pos) /*!< I2S_T::STATUS0: I2SINT Mask */ - -#define I2S_STATUS0_I2SRXINT_Pos (1) /*!< I2S_T::STATUS0: I2SRXINT Position */ -#define I2S_STATUS0_I2SRXINT_Msk (0x1ul << I2S_STATUS0_I2SRXINT_Pos) /*!< I2S_T::STATUS0: I2SRXINT Mask */ - -#define I2S_STATUS0_I2STXINT_Pos (2) /*!< I2S_T::STATUS0: I2STXINT Position */ -#define I2S_STATUS0_I2STXINT_Msk (0x1ul << I2S_STATUS0_I2STXINT_Pos) /*!< I2S_T::STATUS0: I2STXINT Mask */ - -#define I2S_STATUS0_DATACH_Pos (3) /*!< I2S_T::STATUS0: DATACH Position */ -#define I2S_STATUS0_DATACH_Msk (0x7ul << I2S_STATUS0_DATACH_Pos) /*!< I2S_T::STATUS0: DATACH Mask */ - -#define I2S_STATUS0_RXUDIF_Pos (8) /*!< I2S_T::STATUS0: RXUDIF Position */ -#define I2S_STATUS0_RXUDIF_Msk (0x1ul << I2S_STATUS0_RXUDIF_Pos) /*!< I2S_T::STATUS0: RXUDIF Mask */ - -#define I2S_STATUS0_RXOVIF_Pos (9) /*!< I2S_T::STATUS0: RXOVIF Position */ -#define I2S_STATUS0_RXOVIF_Msk (0x1ul << I2S_STATUS0_RXOVIF_Pos) /*!< I2S_T::STATUS0: RXOVIF Mask */ - -#define I2S_STATUS0_RXTHIF_Pos (10) /*!< I2S_T::STATUS0: RXTHIF Position */ -#define I2S_STATUS0_RXTHIF_Msk (0x1ul << I2S_STATUS0_RXTHIF_Pos) /*!< I2S_T::STATUS0: RXTHIF Mask */ - -#define I2S_STATUS0_RXFULL_Pos (11) /*!< I2S_T::STATUS0: RXFULL Position */ -#define I2S_STATUS0_RXFULL_Msk (0x1ul << I2S_STATUS0_RXFULL_Pos) /*!< I2S_T::STATUS0: RXFULL Mask */ - -#define I2S_STATUS0_RXEMPTY_Pos (12) /*!< I2S_T::STATUS0: RXEMPTY Position */ -#define I2S_STATUS0_RXEMPTY_Msk (0x1ul << I2S_STATUS0_RXEMPTY_Pos) /*!< I2S_T::STATUS0: RXEMPTY Mask */ - -#define I2S_STATUS0_TXUDIF_Pos (16) /*!< I2S_T::STATUS0: TXUDIF Position */ -#define I2S_STATUS0_TXUDIF_Msk (0x1ul << I2S_STATUS0_TXUDIF_Pos) /*!< I2S_T::STATUS0: TXUDIF Mask */ - -#define I2S_STATUS0_TXOVIF_Pos (17) /*!< I2S_T::STATUS0: TXOVIF Position */ -#define I2S_STATUS0_TXOVIF_Msk (0x1ul << I2S_STATUS0_TXOVIF_Pos) /*!< I2S_T::STATUS0: TXOVIF Mask */ - -#define I2S_STATUS0_TXTHIF_Pos (18) /*!< I2S_T::STATUS0: TXTHIF Position */ -#define I2S_STATUS0_TXTHIF_Msk (0x1ul << I2S_STATUS0_TXTHIF_Pos) /*!< I2S_T::STATUS0: TXTHIF Mask */ - -#define I2S_STATUS0_TXFULL_Pos (19) /*!< I2S_T::STATUS0: TXFULL Position */ -#define I2S_STATUS0_TXFULL_Msk (0x1ul << I2S_STATUS0_TXFULL_Pos) /*!< I2S_T::STATUS0: TXFULL Mask */ - -#define I2S_STATUS0_TXEMPTY_Pos (20) /*!< I2S_T::STATUS0: TXEMPTY Position */ -#define I2S_STATUS0_TXEMPTY_Msk (0x1ul << I2S_STATUS0_TXEMPTY_Pos) /*!< I2S_T::STATUS0: TXEMPTY Mask */ - -#define I2S_STATUS0_TXBUSY_Pos (21) /*!< I2S_T::STATUS0: TXBUSY Position */ -#define I2S_STATUS0_TXBUSY_Msk (0x1ul << I2S_STATUS0_TXBUSY_Pos) /*!< I2S_T::STATUS0: TXBUSY Mask */ - -#define I2S_TXFIFO_TXFIFO_Pos (0) /*!< I2S_T::TXFIFO: TXFIFO Position */ -#define I2S_TXFIFO_TXFIFO_Msk (0xfffffffful << I2S_TXFIFO_TXFIFO_Pos) /*!< I2S_T::TXFIFO: TXFIFO Mask */ - -#define I2S_RXFIFO_RXFIFO_Pos (0) /*!< I2S_T::RXFIFO: RXFIFO Position */ -#define I2S_RXFIFO_RXFIFO_Msk (0xfffffffful << I2S_RXFIFO_RXFIFO_Pos) /*!< I2S_T::RXFIFO: RXFIFO Mask */ - -#define I2S_CTL1_CH0ZCEN_Pos (0) /*!< I2S_T::CTL1: CH0ZCEN Position */ -#define I2S_CTL1_CH0ZCEN_Msk (0x1ul << I2S_CTL1_CH0ZCEN_Pos) /*!< I2S_T::CTL1: CH0ZCEN Mask */ - -#define I2S_CTL1_CH1ZCEN_Pos (1) /*!< I2S_T::CTL1: CH1ZCEN Position */ -#define I2S_CTL1_CH1ZCEN_Msk (0x1ul << I2S_CTL1_CH1ZCEN_Pos) /*!< I2S_T::CTL1: CH1ZCEN Mask */ - -#define I2S_CTL1_CH2ZCEN_Pos (2) /*!< I2S_T::CTL1: CH2ZCEN Position */ -#define I2S_CTL1_CH2ZCEN_Msk (0x1ul << I2S_CTL1_CH2ZCEN_Pos) /*!< I2S_T::CTL1: CH2ZCEN Mask */ - -#define I2S_CTL1_CH3ZCEN_Pos (3) /*!< I2S_T::CTL1: CH3ZCEN Position */ -#define I2S_CTL1_CH3ZCEN_Msk (0x1ul << I2S_CTL1_CH3ZCEN_Pos) /*!< I2S_T::CTL1: CH3ZCEN Mask */ - -#define I2S_CTL1_CH4ZCEN_Pos (4) /*!< I2S_T::CTL1: CH4ZCEN Position */ -#define I2S_CTL1_CH4ZCEN_Msk (0x1ul << I2S_CTL1_CH4ZCEN_Pos) /*!< I2S_T::CTL1: CH4ZCEN Mask */ - -#define I2S_CTL1_CH5ZCEN_Pos (5) /*!< I2S_T::CTL1: CH5ZCEN Position */ -#define I2S_CTL1_CH5ZCEN_Msk (0x1ul << I2S_CTL1_CH5ZCEN_Pos) /*!< I2S_T::CTL1: CH5ZCEN Mask */ - -#define I2S_CTL1_CH6ZCEN_Pos (6) /*!< I2S_T::CTL1: CH6ZCEN Position */ -#define I2S_CTL1_CH6ZCEN_Msk (0x1ul << I2S_CTL1_CH6ZCEN_Pos) /*!< I2S_T::CTL1: CH6ZCEN Mask */ - -#define I2S_CTL1_CH7ZCEN_Pos (7) /*!< I2S_T::CTL1: CH7ZCEN Position */ -#define I2S_CTL1_CH7ZCEN_Msk (0x1ul << I2S_CTL1_CH7ZCEN_Pos) /*!< I2S_T::CTL1: CH7ZCEN Mask */ - -#define I2S_CTL1_TXTH_Pos (8) /*!< I2S_T::CTL1: TXTH Position */ -#define I2S_CTL1_TXTH_Msk (0xful << I2S_CTL1_TXTH_Pos) /*!< I2S_T::CTL1: TXTH Mask */ - -#define I2S_CTL1_RXTH_Pos (16) /*!< I2S_T::CTL1: RXTH Position */ -#define I2S_CTL1_RXTH_Msk (0xful << I2S_CTL1_RXTH_Pos) /*!< I2S_T::CTL1: RXTH Mask */ - -#define I2S_CTL1_PBWIDTH_Pos (24) /*!< I2S_T::CTL1: PBWIDTH Position */ -#define I2S_CTL1_PBWIDTH_Msk (0x1ul << I2S_CTL1_PBWIDTH_Pos) /*!< I2S_T::CTL1: PBWIDTH Mask */ - -#define I2S_CTL1_PB16ORD_Pos (25) /*!< I2S_T::CTL1: PB16ORD Position */ -#define I2S_CTL1_PB16ORD_Msk (0x1ul << I2S_CTL1_PB16ORD_Pos) /*!< I2S_T::CTL1: PB16ORD Mask */ - -#define I2S_STATUS1_CH0ZCIF_Pos (0) /*!< I2S_T::STATUS1: CH0ZCIF Position */ -#define I2S_STATUS1_CH0ZCIF_Msk (0x1ul << I2S_STATUS1_CH0ZCIF_Pos) /*!< I2S_T::STATUS1: CH0ZCIF Mask */ - -#define I2S_STATUS1_CH1ZCIF_Pos (1) /*!< I2S_T::STATUS1: CH1ZCIF Position */ -#define I2S_STATUS1_CH1ZCIF_Msk (0x1ul << I2S_STATUS1_CH1ZCIF_Pos) /*!< I2S_T::STATUS1: CH1ZCIF Mask */ - -#define I2S_STATUS1_CH2ZCIF_Pos (2) /*!< I2S_T::STATUS1: CH2ZCIF Position */ -#define I2S_STATUS1_CH2ZCIF_Msk (0x1ul << I2S_STATUS1_CH2ZCIF_Pos) /*!< I2S_T::STATUS1: CH2ZCIF Mask */ - -#define I2S_STATUS1_CH3ZCIF_Pos (3) /*!< I2S_T::STATUS1: CH3ZCIF Position */ -#define I2S_STATUS1_CH3ZCIF_Msk (0x1ul << I2S_STATUS1_CH3ZCIF_Pos) /*!< I2S_T::STATUS1: CH3ZCIF Mask */ - -#define I2S_STATUS1_CH4ZCIF_Pos (4) /*!< I2S_T::STATUS1: CH4ZCIF Position */ -#define I2S_STATUS1_CH4ZCIF_Msk (0x1ul << I2S_STATUS1_CH4ZCIF_Pos) /*!< I2S_T::STATUS1: CH4ZCIF Mask */ - -#define I2S_STATUS1_CH5ZCIF_Pos (5) /*!< I2S_T::STATUS1: CH5ZCIF Position */ -#define I2S_STATUS1_CH5ZCIF_Msk (0x1ul << I2S_STATUS1_CH5ZCIF_Pos) /*!< I2S_T::STATUS1: CH5ZCIF Mask */ - -#define I2S_STATUS1_CH6ZCIF_Pos (6) /*!< I2S_T::STATUS1: CH6ZCIF Position */ -#define I2S_STATUS1_CH6ZCIF_Msk (0x1ul << I2S_STATUS1_CH6ZCIF_Pos) /*!< I2S_T::STATUS1: CH6ZCIF Mask */ - -#define I2S_STATUS1_CH7ZCIF_Pos (7) /*!< I2S_T::STATUS1: CH7ZCIF Position */ -#define I2S_STATUS1_CH7ZCIF_Msk (0x1ul << I2S_STATUS1_CH7ZCIF_Pos) /*!< I2S_T::STATUS1: CH7ZCIF Mask */ - -#define I2S_STATUS1_TXCNT_Pos (8) /*!< I2S_T::STATUS1: TXCNT Position */ -#define I2S_STATUS1_TXCNT_Msk (0x1ful << I2S_STATUS1_TXCNT_Pos) /*!< I2S_T::STATUS1: TXCNT Mask */ - -#define I2S_STATUS1_RXCNT_Pos (16) /*!< I2S_T::STATUS1: RXCNT Position */ -#define I2S_STATUS1_RXCNT_Msk (0x1ful << I2S_STATUS1_RXCNT_Pos) /*!< I2S_T::STATUS1: RXCNT Mask */ - -/**@}*/ /* I2S_CONST */ -/**@}*/ /* end of I2S register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __I2S_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/opa_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/opa_reg.h deleted file mode 100644 index c28268a8236..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/opa_reg.h +++ /dev/null @@ -1,268 +0,0 @@ -/**************************************************************************//** - * @file opa_reg.h - * @version V1.00 - * @brief OPA register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __OPA_REG_H__ -#define __OPA_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup OPA OP Amplifier(OPA) - Memory Mapped Structure for OPA Controller -@{ */ - -typedef struct -{ - - - /** - * @var OPA_T::CTL - * Offset: 0x00 OP Amplifier Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OPEN0 |OP Amplifier 0 Enable Bit - * | | |0 = OP amplifier0 Disabled. - * | | |1 = OP amplifier0 Enabled. - * | | |Note: OP Amplifier 0 output needs wait stable 20u03BCs after OPEN0 is set. - * |[1] |OPEN1 |OP Amplifier 1 Enable Bit - * | | |0 = OP amplifier1 Disabled. - * | | |1 = OP amplifier1 Enabled. - * | | |Note: OP Amplifier 1 output needs wait stable 20u03BCs after OPEN1 is set. - * |[2] |OPEN2 |OP Amplifier 2 Enable Bit - * | | |0 = OP amplifier2 Disabled. - * | | |1 = OP amplifier2 Enabled. - * | | |Note: OP Amplifier 2 output needs wait stable 20u03BCs after OPEN2 is set. - * |[4] |OPDOEN0 |OP Amplifier 0 Schmitt Trigger Non-inverting Buffer Enable Bit - * | | |0 = OP amplifier0 Schmitt Trigger non-invert buffer Disabled. - * | | |1 = OP amplifier0 Schmitt Trigger non-invert buffer Enabled. - * |[5] |OPDOEN1 |OP Amplifier 1 Schmitt Trigger Non-inverting Buffer Enable Bit - * | | |0 = OP amplifier1 Schmitt Trigger non-invert buffer Disabled. - * | | |1 = OP amplifier1 Schmitt Trigger non-invert buffer Enabled. - * |[6] |OPDOEN2 |OP Amplifier 2 Schmitt Trigger Non-inverting Buffer Enable Bit - * | | |0 = OP amplifier2 Schmitt Trigger non-invert buffer Disabled. - * | | |1 = OP amplifier2 Schmitt Trigger non-invert buffer Enabled. - * |[8] |OPDOIEN0 |OP Amplifier 0 Schmitt Trigger Digital Output Interrupt Enable Bit - * | | |0 = OP Amplifier 0 digital output interrupt function Disabled. - * | | |1 = OP Amplifier 0 digital output interrupt function Enabled. - * | | |The OPDOIF0 interrupt flag is set by hardware whenever the OP amplifier 0 Schmitt Trigger non-inverting buffer digital output changes state, in the meanwhile, if OPDOIEN0 is set to 1, a comparator interrupt request is generated. - * |[9] |OPDOIEN1 |OP Amplifier 1 Schmitt Trigger Digital Output Interrupt Enable Bit - * | | |0 = OP Amplifier 1 digital output interrupt function Disabled. - * | | |1 = OP Amplifier 1 digital output interrupt function Enabled. - * | | |OPDOIF1 interrupt flag is set by hardware whenever the OP amplifier 1 Schmitt trigger non-inverting buffer digital output changes state, in the meanwhile, if OPDOIEN1 is set to 1, a comparator interrupt request is generated. - * |[10] |OPDOIEN2 |OP Amplifier 2 Schmitt Trigger Digital Output Interrupt Enable Bit - * | | |0 = OP Amplifier 2 digital output interrupt function Disabled. - * | | |1 = OP Amplifier 2 digital output interrupt function Enabled. - * | | |OPDOIF2 interrupt flag is set by hardware whenever the OP amplifier 2 Schmitt Trigger non-inverting buffer digital output changes state, in the meanwhile, if OPDOIEN2 is set to 1, a comparator interrupt request is generated. - * @var OPA_T::STATUS - * Offset: 0x04 OP Amplifier Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OPDO0 |OP Amplifier 0 Digital Output - * | | |Synchronized to the APB clock to allow reading by software - * | | |Cleared when the Schmitt Trigger buffer is disabled (OPDOEN0 = 0) - * |[1] |OPDO1 |OP Amplifier 1 Digital Output - * | | |Synchronized to the APB clock to allow reading by software - * | | |Cleared when the Schmitt Trigger buffer is disabled (OPDOEN1 = 0) - * |[2] |OPDO2 |OP Amplifier 2 Digital Output - * | | |Synchronized to the APB clock to allow reading by software - * | | |Cleared when the Schmitt Trigger buffer is disabled (OPDOEN2 = 0) - * |[4] |OPDOIF0 |OP Amplifier 0 Schmitt Trigger Digital Output Interrupt Flag - * | | |OPDOIF0 interrupt flag is set by hardware whenever the OP amplifier 0 Schmitt Trigger non-inverting buffer digital output changes state - * | | |This bit is cleared by writing 1 to it. - * |[5] |OPDOIF1 |OP Amplifier 1 Schmitt Trigger Digital Output Interrupt Flag - * | | |OPDOIF1 interrupt flag is set by hardware whenever the OP amplifier 1 Schmitt Trigger non-inverting buffer digital output changes state - * | | |This bit is cleared by writing 1 to it. - * |[6] |OPDOIF2 |OP Amplifier 2 Schmitt Trigger Digital Output Interrupt Flag - * | | |OPDOIF2 interrupt flag is set by hardware whenever the OP amplifier 2 Schmitt Trigger non-inverting buffer digital output changes state - * | | |This bit is cleared by writing 1 to it. - * @var OPA_T::CALCTL - * Offset: 0x08 OP Amplifier Calibration Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CALTRG0 |OP Amplifier 0 Calibration Trigger Bit - * | | |0 = Stop, hardware auto clear. - * | | |1 = Start. Note: Before enable this bit, it should set OPEN0 in advance. - * |[1] |CALTRG1 |OP Amplifier 1 Calibration Trigger Bit - * | | |0 = Stop, hardware auto clear. - * | | |1 = Start. Note: Before enable this bit, it should set OPEN1 in advance. - * |[2] |CALTRG2 |OP Amplifier 2 Calibration Trigger Bit - * | | |0 = Stop, hardware auto clear. - * | | |1 = Start. Note: Before enable this bit, it should set OPEN2 in advance. - * |[16] |CALRVS0 |OPA0 Calibration Reference Voltage Selection - * | | |0 = VREF is AVDD. - * | | |1 = VREF from high vcm to low vcm. - * |[17] |CALRVS1 |OPA1 Calibration Reference Voltage Selection - * | | |0 = VREF is AVDD. - * | | |1 = VREF from high vcm to low vcm. - * |[18] |CALRVS2 |OPA2 Calibration Reference Voltage Selection - * | | |0 = VREF is AVDD. - * | | |1 = VREF from high vcm to low vcm. - * @var OPA_T::CALST - * Offset: 0x0C OP Amplifier Calibration Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DONE0 |OP Amplifier 0 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Done. - * |[1] |CALNS0 |OP Amplifier 0 Calibration Result Status for NMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[2] |CALPS0 |OP Amplifier 0 Calibration Result Status for PMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[4] |DONE1 |OP Amplifier 1 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Done. - * |[5] |CALNS1 |OP Amplifier 1 Calibration Result Status for NMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[6] |CALPS1 |OP Amplifier 1 Calibration Result Status for PMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[8] |DONE2 |OP Amplifier 2 Calibration Done Status - * | | |0 = Calibrating. - * | | |1 = Calibration Done. - * |[9] |CALNS2 |OP Amplifier 2 Calibration Result Status for NMOS - * | | |0 = Pass. - * | | |1 = Fail. - * |[10] |CALPS2 |OP Amplifier 2 Calibration Result Status for PMOS - * | | |0 = Pass. - * | | |1 = Fail. - */ - __IO uint32_t CTL; /*!< [0x0000] OP Amplifier Control Register */ - __IO uint32_t STATUS; /*!< [0x0004] OP Amplifier Status Register */ - __IO uint32_t CALCTL; /*!< [0x0008] OP Amplifier Calibration Control Register */ - __I uint32_t CALST; /*!< [0x000c] OP Amplifier Calibration Status Register */ - -} OPA_T; - -/** - @addtogroup OPA_CONST OPA Bit Field Definition - Constant Definitions for OPA Controller -@{ */ - -#define OPA_CTL_OPEN0_Pos (0) /*!< OPA_T::CTL: OPEN0 Position */ -#define OPA_CTL_OPEN0_Msk (0x1ul << OPA_CTL_OPEN0_Pos) /*!< OPA_T::CTL: OPEN0 Mask */ - -#define OPA_CTL_OPEN1_Pos (1) /*!< OPA_T::CTL: OPEN1 Position */ -#define OPA_CTL_OPEN1_Msk (0x1ul << OPA_CTL_OPEN1_Pos) /*!< OPA_T::CTL: OPEN1 Mask */ - -#define OPA_CTL_OPEN2_Pos (2) /*!< OPA_T::CTL: OPEN2 Position */ -#define OPA_CTL_OPEN2_Msk (0x1ul << OPA_CTL_OPEN2_Pos) /*!< OPA_T::CTL: OPEN2 Mask */ - -#define OPA_CTL_OPDOEN0_Pos (4) /*!< OPA_T::CTL: OPDOEN0 Position */ -#define OPA_CTL_OPDOEN0_Msk (0x1ul << OPA_CTL_OPDOEN0_Pos) /*!< OPA_T::CTL: OPDOEN0 Mask */ - -#define OPA_CTL_OPDOEN1_Pos (5) /*!< OPA_T::CTL: OPDOEN1 Position */ -#define OPA_CTL_OPDOEN1_Msk (0x1ul << OPA_CTL_OPDOEN1_Pos) /*!< OPA_T::CTL: OPDOEN1 Mask */ - -#define OPA_CTL_OPDOEN2_Pos (6) /*!< OPA_T::CTL: OPDOEN2 Position */ -#define OPA_CTL_OPDOEN2_Msk (0x1ul << OPA_CTL_OPDOEN2_Pos) /*!< OPA_T::CTL: OPDOEN2 Mask */ - -#define OPA_CTL_OPDOIEN0_Pos (8) /*!< OPA_T::CTL: OPDOIEN0 Position */ -#define OPA_CTL_OPDOIEN0_Msk (0x1ul << OPA_CTL_OPDOIEN0_Pos) /*!< OPA_T::CTL: OPDOIEN0 Mask */ - -#define OPA_CTL_OPDOIEN1_Pos (9) /*!< OPA_T::CTL: OPDOIEN1 Position */ -#define OPA_CTL_OPDOIEN1_Msk (0x1ul << OPA_CTL_OPDOIEN1_Pos) /*!< OPA_T::CTL: OPDOIEN1 Mask */ - -#define OPA_CTL_OPDOIEN2_Pos (10) /*!< OPA_T::CTL: OPDOIEN2 Position */ -#define OPA_CTL_OPDOIEN2_Msk (0x1ul << OPA_CTL_OPDOIEN2_Pos) /*!< OPA_T::CTL: OPDOIEN2 Mask */ - -#define OPA_STATUS_OPDO0_Pos (0) /*!< OPA_T::STATUS: OPDO0 Position */ -#define OPA_STATUS_OPDO0_Msk (0x1ul << OPA_STATUS_OPDO0_Pos) /*!< OPA_T::STATUS: OPDO0 Mask */ - -#define OPA_STATUS_OPDO1_Pos (1) /*!< OPA_T::STATUS: OPDO1 Position */ -#define OPA_STATUS_OPDO1_Msk (0x1ul << OPA_STATUS_OPDO1_Pos) /*!< OPA_T::STATUS: OPDO1 Mask */ - -#define OPA_STATUS_OPDO2_Pos (2) /*!< OPA_T::STATUS: OPDO2 Position */ -#define OPA_STATUS_OPDO2_Msk (0x1ul << OPA_STATUS_OPDO2_Pos) /*!< OPA_T::STATUS: OPDO2 Mask */ - -#define OPA_STATUS_OPDOIF0_Pos (4) /*!< OPA_T::STATUS: OPDOIF0 Position */ -#define OPA_STATUS_OPDOIF0_Msk (0x1ul << OPA_STATUS_OPDOIF0_Pos) /*!< OPA_T::STATUS: OPDOIF0 Mask */ - -#define OPA_STATUS_OPDOIF1_Pos (5) /*!< OPA_T::STATUS: OPDOIF1 Position */ -#define OPA_STATUS_OPDOIF1_Msk (0x1ul << OPA_STATUS_OPDOIF1_Pos) /*!< OPA_T::STATUS: OPDOIF1 Mask */ - -#define OPA_STATUS_OPDOIF2_Pos (6) /*!< OPA_T::STATUS: OPDOIF2 Position */ -#define OPA_STATUS_OPDOIF2_Msk (0x1ul << OPA_STATUS_OPDOIF2_Pos) /*!< OPA_T::STATUS: OPDOIF2 Mask */ - -#define OPA_CALCTL_CALTRG0_Pos (0) /*!< OPA_T::CALCTL: CALTRG0 Position */ -#define OPA_CALCTL_CALTRG0_Msk (0x1ul << OPA_CALCTL_CALTRG0_Pos) /*!< OPA_T::CALCTL: CALTRG0 Mask */ - -#define OPA_CALCTL_CALTRG1_Pos (1) /*!< OPA_T::CALCTL: CALTRG1 Position */ -#define OPA_CALCTL_CALTRG1_Msk (0x1ul << OPA_CALCTL_CALTRG1_Pos) /*!< OPA_T::CALCTL: CALTRG1 Mask */ - -#define OPA_CALCTL_CALTRG2_Pos (2) /*!< OPA_T::CALCTL: CALTRG2 Position */ -#define OPA_CALCTL_CALTRG2_Msk (0x1ul << OPA_CALCTL_CALTRG2_Pos) /*!< OPA_T::CALCTL: CALTRG2 Mask */ - -#define OPA_CALCTL_CALCLK0_Pos (4) /*!< OPA_T::CALCTL: CALCLK0 Position */ -#define OPA_CALCTL_CALCLK0_Msk (0x3ul << OPA_CALCTL_CALCLK0_Pos) /*!< OPA_T::CALCTL: CALCLK0 Mask */ - -#define OPA_CALCTL_CALCLK1_Pos (6) /*!< OPA_T::CALCTL: CALCLK1 Position */ -#define OPA_CALCTL_CALCLK1_Msk (0x3ul << OPA_CALCTL_CALCLK1_Pos) /*!< OPA_T::CALCTL: CALCLK1 Mask */ - -#define OPA_CALCTL_CALCLK2_Pos (8) /*!< OPA_T::CALCTL: CALCLK2 Position */ -#define OPA_CALCTL_CALCLK2_Msk (0x3ul << OPA_CALCTL_CALCLK2_Pos) /*!< OPA_T::CALCTL: CALCLK2 Mask */ - -#define OPA_CALCTL_CALRVS0_Pos (16) /*!< OPA_T::CALCTL: CALRVS0 Position */ -#define OPA_CALCTL_CALRVS0_Msk (0x1ul << OPA_CALCTL_CALRVS0_Pos) /*!< OPA_T::CALCTL: CALRVS0 Mask */ - -#define OPA_CALCTL_CALRVS1_Pos (17) /*!< OPA_T::CALCTL: CALRVS1 Position */ -#define OPA_CALCTL_CALRVS1_Msk (0x1ul << OPA_CALCTL_CALRVS1_Pos) /*!< OPA_T::CALCTL: CALRVS1 Mask */ - -#define OPA_CALCTL_CALRVS2_Pos (18) /*!< OPA_T::CALCTL: CALRVS2 Position */ -#define OPA_CALCTL_CALRVS2_Msk (0x1ul << OPA_CALCTL_CALRVS2_Pos) /*!< OPA_T::CALCTL: CALRVS2 Mask */ - -#define OPA_CALST_DONE0_Pos (0) /*!< OPA_T::CALST: DONE0 Position */ -#define OPA_CALST_DONE0_Msk (0x1ul << OPA_CALST_DONE0_Pos) /*!< OPA_T::CALST: DONE0 Mask */ - -#define OPA_CALST_CALNS0_Pos (1) /*!< OPA_T::CALST: CALNS0 Position */ -#define OPA_CALST_CALNS0_Msk (0x1ul << OPA_CALST_CALNS0_Pos) /*!< OPA_T::CALST: CALNS0 Mask */ - -#define OPA_CALST_CALPS0_Pos (2) /*!< OPA_T::CALST: CALPS0 Position */ -#define OPA_CALST_CALPS0_Msk (0x1ul << OPA_CALST_CALPS0_Pos) /*!< OPA_T::CALST: CALPS0 Mask */ - -#define OPA_CALST_DONE1_Pos (4) /*!< OPA_T::CALST: DONE1 Position */ -#define OPA_CALST_DONE1_Msk (0x1ul << OPA_CALST_DONE1_Pos) /*!< OPA_T::CALST: DONE1 Mask */ - -#define OPA_CALST_CALNS1_Pos (5) /*!< OPA_T::CALST: CALNS1 Position */ -#define OPA_CALST_CALNS1_Msk (0x1ul << OPA_CALST_CALNS1_Pos) /*!< OPA_T::CALST: CALNS1 Mask */ - -#define OPA_CALST_CALPS1_Pos (6) /*!< OPA_T::CALST: CALPS1 Position */ -#define OPA_CALST_CALPS1_Msk (0x1ul << OPA_CALST_CALPS1_Pos) /*!< OPA_T::CALST: CALPS1 Mask */ - -#define OPA_CALST_DONE2_Pos (8) /*!< OPA_T::CALST: DONE2 Position */ -#define OPA_CALST_DONE2_Msk (0x1ul << OPA_CALST_DONE2_Pos) /*!< OPA_T::CALST: DONE2 Mask */ - -#define OPA_CALST_CALNS2_Pos (9) /*!< OPA_T::CALST: CALNS2 Position */ -#define OPA_CALST_CALNS2_Msk (0x1ul << OPA_CALST_CALNS2_Pos) /*!< OPA_T::CALST: CALNS2 Mask */ - -#define OPA_CALST_CALPS2_Pos (10) /*!< OPA_T::CALST: CALPS2 Position */ -#define OPA_CALST_CALPS2_Msk (0x1ul << OPA_CALST_CALPS2_Pos) /*!< OPA_T::CALST: CALPS2 Mask */ - -/**@}*/ /* OPA_CONST */ -/**@}*/ /* end of OPA register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __OPA_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/otg_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/otg_reg.h deleted file mode 100644 index 03900262008..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/otg_reg.h +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************//** - * @file otg_reg.h - * @version V1.00 - * @brief OTG register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __OTG_REG_H__ -#define __OTG_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup OTG USB On-The-Go Controller(OTG) - Memory Mapped Structure for OTG Controller -@{ */ - -typedef struct -{ - - - /** - * @var OTG_T::CTL - * Offset: 0x00 OTG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDROP |Drop VBUS Control - * | | |If user application running on this OTG A-device wants to conserve power, set this bit to drop VBUS - * | | |BUSREQ (OTG_CTL[1]) will be also cleared no matter A-device or B-device. - * | | |0 = Not drop the VBUS. - * | | |1 = Drop the VBUS. - * |[1] |BUSREQ |OTG Bus Request - * | | |If OTG A-device wants to do data transfers via USB bus, setting this bit will drive VBUS high to detect USB device connection - * | | |If user won't use the bus any more, clearing this bit will drop VBUS to save power - * | | |This bit will be cleared when A-device goes to A_wait_vfall state - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set or IDSTS (OTG_STATUS[1]) changed. - * | | |If user of an OTG-B Device wants to request VBUS, setting this bit will run SRP protocol - * | | |This bit will be cleared if SRP failure (OTG A-device does not provide VBUS after B-device issues ARP in specified interval, defined in OTG specification) - * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set IDSTS (OTG_STATUS[1]) changed. - * | | |0 = Not launch VBUS in OTG A-device or not request SRP in OTG B-device. - * | | |1 = Launch VBUS in OTG A-device or request SRP in OTG B-device. - * |[2] |HNPREQEN |OTG HNP Request Enable Bit - * | | |When USB frame as A-device, set this bit when A-device allows to process HNP protocol -- A-device changes role from Host to Peripheral - * | | |This bit will be cleared when OTG state changes from a_suspend to a_peripheral or goes back to a_idle state - * | | |When USB frame as B-device, set this bit after the OTG A-device successfully sends a SetFeature (b_hnp_enable) command to the OTG B-device to start role change -- B-device changes role from Peripheral to Host - * | | |This bit will be cleared when OTG state changes from b_peripheral to b_wait_acon or goes back to b_idle state. - * | | |0 = HNP request Disabled. - * | | |1 = HNP request Enabled (A-device can change role from Host to Peripheral or B-device can change role from Peripheral to Host). - * | | |Note: Refer to OTG specification to get a_suspend, a_peripheral, a_idle and b_idle state. - * |[4] |OTGEN |OTG Function Enable Bit - * | | |User needs to set this bit to enable OTG function while USB frame configured as OTG device - * | | |When USB frame not configured as OTG device, this bit is must be low. - * | | |0= OTG function Disabled. - * | | |1 = OTG function Enabled. - * |[5] |WKEN |OTG ID Pin Wake-up Enable Bit - * | | |0 = OTG ID pin status change wake-up function Disabled. - * | | |1 = OTG ID pin status change wake-up function Enabled. - * @var OTG_T::PHYCTL - * Offset: 0x04 OTG PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OTGPHYEN |OTG PHY Enable - * | | |When USB frame is configured as OTG-device or ID-dependent, user needs to set this bit before using OTG function - * | | |If device is not configured as OTG-device nor ID-dependent , this bit is "don't care". - * | | |0 = OTG PHY Disabled. - * | | |1 = OTG PHY Enabled. - * |[1] |IDDETEN |ID Detection Enable Bit - * | | |0 = Detect ID pin status Disabled. - * | | |1 = Detect ID pin status Enabled. - * |[4] |VBENPOL |Off-chip USB VBUS Power Switch Enable Polarity - * | | |The OTG controller will enable off-chip USB VBUS power switch to provide VBUS power when need - * | | |A USB_VBUS_EN pin is used to control the off-chip USB VBUS power switch. - * | | |The polarity of enabling off-chip USB VBUS power switch (high active or low active) depends on the selected component - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The off-chip USB VBUS power switch enable is active high. - * | | |1 = The off-chip USB VBUS power switch enable is active low. - * |[5] |VBSTSPOL |Off-chip USB VBUS Power Switch Status Polarity - * | | |The polarity of off-chip USB VBUS power switch valid signal depends on the selected component - * | | |A USB_VBUS_ST pin is used to monitor the valid signal of the off-chip USB VBUS power switch - * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch. - * | | |0 = The polarity of off-chip USB VBUS power switch valid status is high. - * | | |1 = The polarity of off-chip USB VBUS power switch valid status is low. - * @var OTG_T::INTEN - * Offset: 0x08 OTG Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIEN|Role (Host or Peripheral) Changed Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[1] |VBEIEN |VBUS Error Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: VBUS error means going to a_vbus_err state. Please refer to A-device state diagram in OTG spec. - * |[2] |SRPFIEN |SRP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[3] |HNPFIEN |HNP Fail Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[4] |GOIDLEIEN |OTG Device Goes to IDLE State Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Going to idle state means going to a_idle or b_idle state - * | | |Please refer to A-device state diagram and B-device state diagram in OTG spec. - * |[5] |IDCHGIEN |IDSTS Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and IDSTS (OTG_STATUS[1]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[6] |PDEVIEN |Act As Peripheral Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a peripheral, a interrupt will be asserted. - * | | |0 = This device as a peripheral interrupt Disabled. - * | | |1 = This device as a peripheral interrupt Enabled. - * |[7] |HOSTIEN |Act As Host Interrupt Enable Bit - * | | |If this bit is set to 1 and the device is changed as a host, a interrupt will be asserted. - * | | |0 = This device as a host interrupt Disabled. - * | | |1 = This device as a host interrupt Enabled. - * |[8] |BVLDCHGIEN|B-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and BVLD (OTG_STATUS[3]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[9] |AVLDCHGIEN|A-device Session Valid Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and AVLD (OTG_STATUS[4]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[10] |VBCHGIEN |VBUSVLD Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and VBUSVLD (OTG_STATUS[5]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[11] |SECHGIEN |SESSEND Status Changed Interrupt Enable Bit - * | | |If this bit is set to 1 and SESSEND (OTG_STATUS[2]) status is changed from high to low or from low to high, a interrupt will be asserted. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[13] |SRPDETIEN |SRP Detected Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * @var OTG_T::INTSTS - * Offset: 0x0C OTG Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ROLECHGIF |OTG Role Change Interrupt Status - * | | |This flag is set when the role of an OTG device changed from a host to a peripheral, or changed from a peripheral to a host while USB_ID pin status does not change. - * | | |0 = OTG device role not changed. - * | | |1 = OTG device role changed. - * | | |Note: Write 1 to clear this flag. - * |[1] |VBEIF |VBUS Error Interrupt Status - * | | |This bit will be set when voltage on VBUS cannot reach a minimum valid threshold 4.4V within a maximum time of 100ms after OTG A-device starting to drive VBUS high. - * | | |0 = OTG A-device drives VBUS over threshold voltage before this interval expires. - * | | |1 = OTG A-device cannot drive VBUS over threshold voltage before this interval expires. - * | | |Note: Write 1 to clear this flag and recover from the VBUS error state. - * |[2] |SRPFIF |SRP Fail Interrupt Status - * | | |After initiating SRP, an OTG B-device will wait for the OTG A-device to drive VBUS high at least TB_SRP_FAIL minimum, defined in OTG specification - * | | |This flag is set when the OTG B-device does not get VBUS high after this interval. - * | | |0 = OTG B-device gets VBUS high before this interval. - * | | |1 = OTG B-device does not get VBUS high before this interval. - * | | |Note: Write 1 to clear this flag. - * |[3] |HNPFIF |HNP Fail Interrupt Status - * | | |When A-device has granted B-device to be host and USB bus is in SE0 (both USB_D+ and USB_D- low) state, this bit will be set when A-device does not connect after specified interval expires. - * | | |0 = A-device connects to B-device before specified interval expires. - * | | |1 = A-device does not connect to B-device before specified interval expires. - * | | |Note: Write 1 to clear this flag. - * |[4] |GOIDLEIF |OTG Device Goes to IDLE Interrupt Status - * | | |Flag is set if the OTG device transfers from non-idle state to idle state - * | | |The OTG device will be neither a host nor a peripheral. - * | | |0 = OTG device does not go back to idle state (a_idle or b_idle). - * | | |1 = OTG device goes back to idle state(a_idle or b_idle). - * | | |Note 1: Going to idle state means going to a_idle or b_idle state. Please refer to OTG specification. - * | | |Note 2: Write 1 to clear this flag. - * |[5] |IDCHGIF |ID State Change Interrupt Status - * | | |0 = IDSTS (OTG_STATUS[1]) not toggled. - * | | |1 = IDSTS (OTG_STATUS[1]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[6] |PDEVIF |Act As Peripheral Interrupt Status - * | | |0= This device does not act as a peripheral. - * | | |1 = This device acts as a peripheral. - * | | |Note: Write 1 to clear this flag. - * |[7] |HOSTIF |Act As Host Interrupt Status - * | | |0= This device does not act as a host. - * | | |1 = This device acts as a host. - * | | |Note: Write 1 to clear this flag. - * |[8] |BVLDCHGIF |B-device Session Valid State Change Interrupt Status - * | | |0 = BVLD (OTG_STATUS[3]) is not toggled. - * | | |1 = BVLD (OTG_STATUS[3]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[9] |AVLDCHGIF |A-device Session Valid State Change Interrupt Status - * | | |0 = AVLD (OTG_STATUS[4]) not toggled. - * | | |1 = AVLD (OTG_STATUS[4]) from high to low or low to high. - * | | |Note: Write 1 to clear this status. - * |[10] |VBCHGIF |VBUSVLD State Change Interrupt Status - * | | |0 = VBUSVLD (OTG_STATUS[5]) not toggled. - * | | |1 = VBUSVLD (OTG_STATUS[5]) from high to low or from low to high. - * | | |Note: Write 1 to clear this status. - * |[11] |SECHGIF |SESSEND State Change Interrupt Status - * | | |0 = SESSEND (OTG_STATUS[2]) not toggled. - * | | |1 = SESSEND (OTG_STATUS[2]) from high to low or from low to high. - * | | |Note: Write 1 to clear this flag. - * |[13] |SRPDETIF |SRP Detected Interrupt Status - * | | |0 = SRP not detected. - * | | |1 = SRP detected. - * | | |Note: Write 1 to clear this status. - * @var OTG_T::STATUS - * Offset: 0x10 OTG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OVERCUR |over Current Condition - * | | |The voltage on VBUS cannot reach a minimum VBUS valid threshold, 4.4V minimum, within a maximum time of 100ms after OTG A-device drives VBUS high. - * | | |0 = OTG A-device drives VBUS successfully. - * | | |1 = OTG A-device cannot drives VBUS high in this interval. - * |[1] |IDSTS |USB_ID Pin State of Mini-b/Micro-plug - * | | |0 = Mini-A/Micro-A plug is attached. - * | | |1 = Mini-B/Micro-B plug is attached. - * |[2] |SESSEND |Session End Status - * | | |When VBUS voltage is lower than 0.4V, this bit will be set to 1 - * | | |Session end means no meaningful power on VBUS. - * | | |0 = Session is not end. - * | | |1 = Session is end. - * |[3] |BVLD |B-device Session Valid Status - * | | |0 = B-device session is not valid. - * | | |1 = B-device session is valid. - * |[4] |AVLD |A-device Session Valid Status - * | | |0 = A-device session is not valid. - * | | |1 = A-device session is valid. - * |[5] |VBUSVLD |VBUS Valid Status - * | | |When VBUS is larger than 4.7V, this bit will be set to 1. - * | | |0 = VBUS is not valid. - * | | |1 = VBUS is valid. - * |[6] |ASPERI |As Peripheral Status - * | | |When OTG as peripheral, this bit is set. - * | | |0: OTG not as peripheral - * | | |1: OTG as peripheral - * |[7] |ASHOST |As Host Status - * | | |When OTG as Host, this bit is set. - * | | |0: OTG not as Host - * | | |1: OTG as Host - */ - __IO uint32_t CTL; /*!< [0x0000] OTG Control Register */ - __IO uint32_t PHYCTL; /*!< [0x0004] OTG PHY Control Register */ - __IO uint32_t INTEN; /*!< [0x0008] OTG Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x000c] OTG Interrupt Status Register */ - __I uint32_t STATUS; /*!< [0x0010] OTG Status Register */ - -} OTG_T; - - -/** - @addtogroup OTG_CONST OTG Bit Field Definition - Constant Definitions for OTG Controller -@{ */ - -#define OTG_CTL_VBUSDROP_Pos (0) /*!< OTG_T::CTL: VBUSDROP Position */ -#define OTG_CTL_VBUSDROP_Msk (0x1ul << OTG_CTL_VBUSDROP_Pos) /*!< OTG_T::CTL: VBUSDROP Mask */ - -#define OTG_CTL_BUSREQ_Pos (1) /*!< OTG_T::CTL: BUSREQ Position */ -#define OTG_CTL_BUSREQ_Msk (0x1ul << OTG_CTL_BUSREQ_Pos) /*!< OTG_T::CTL: BUSREQ Mask */ - -#define OTG_CTL_HNPREQEN_Pos (2) /*!< OTG_T::CTL: HNPREQEN Position */ -#define OTG_CTL_HNPREQEN_Msk (0x1ul << OTG_CTL_HNPREQEN_Pos) /*!< OTG_T::CTL: HNPREQEN Mask */ - -#define OTG_CTL_OTGEN_Pos (4) /*!< OTG_T::CTL: OTGEN Position */ -#define OTG_CTL_OTGEN_Msk (0x1ul << OTG_CTL_OTGEN_Pos) /*!< OTG_T::CTL: OTGEN Mask */ - -#define OTG_CTL_WKEN_Pos (5) /*!< OTG_T::CTL: WKEN Position */ -#define OTG_CTL_WKEN_Msk (0x1ul << OTG_CTL_WKEN_Pos) /*!< OTG_T::CTL: WKEN Mask */ - -#define OTG_PHYCTL_OTGPHYEN_Pos (0) /*!< OTG_T::PHYCTL: OTGPHYEN Position */ -#define OTG_PHYCTL_OTGPHYEN_Msk (0x1ul << OTG_PHYCTL_OTGPHYEN_Pos) /*!< OTG_T::PHYCTL: OTGPHYEN Mask */ - -#define OTG_PHYCTL_IDDETEN_Pos (1) /*!< OTG_T::PHYCTL: IDDETEN Position */ -#define OTG_PHYCTL_IDDETEN_Msk (0x1ul << OTG_PHYCTL_IDDETEN_Pos) /*!< OTG_T::PHYCTL: IDDETEN Mask */ - -#define OTG_PHYCTL_VBENPOL_Pos (4) /*!< OTG_T::PHYCTL: VBENPOL Position */ -#define OTG_PHYCTL_VBENPOL_Msk (0x1ul << OTG_PHYCTL_VBENPOL_Pos) /*!< OTG_T::PHYCTL: VBENPOL Mask */ - -#define OTG_PHYCTL_VBSTSPOL_Pos (5) /*!< OTG_T::PHYCTL: VBSTSPOL Position */ -#define OTG_PHYCTL_VBSTSPOL_Msk (0x1ul << OTG_PHYCTL_VBSTSPOL_Pos) /*!< OTG_T::PHYCTL: VBSTSPOL Mask */ - -#define OTG_INTEN_ROLECHGIEN_Pos (0) /*!< OTG_T::INTEN: ROLECHGIEN Position */ -#define OTG_INTEN_ROLECHGIEN_Msk (0x1ul << OTG_INTEN_ROLECHGIEN_Pos) /*!< OTG_T::INTEN: ROLECHGIEN Mask */ - -#define OTG_INTEN_VBEIEN_Pos (1) /*!< OTG_T::INTEN: VBEIEN Position */ -#define OTG_INTEN_VBEIEN_Msk (0x1ul << OTG_INTEN_VBEIEN_Pos) /*!< OTG_T::INTEN: VBEIEN Mask */ - -#define OTG_INTEN_SRPFIEN_Pos (2) /*!< OTG_T::INTEN: SRPFIEN Position */ -#define OTG_INTEN_SRPFIEN_Msk (0x1ul << OTG_INTEN_SRPFIEN_Pos) /*!< OTG_T::INTEN: SRPFIEN Mask */ - -#define OTG_INTEN_HNPFIEN_Pos (3) /*!< OTG_T::INTEN: HNPFIEN Position */ -#define OTG_INTEN_HNPFIEN_Msk (0x1ul << OTG_INTEN_HNPFIEN_Pos) /*!< OTG_T::INTEN: HNPFIEN Mask */ - -#define OTG_INTEN_GOIDLEIEN_Pos (4) /*!< OTG_T::INTEN: GOIDLEIEN Position */ -#define OTG_INTEN_GOIDLEIEN_Msk (0x1ul << OTG_INTEN_GOIDLEIEN_Pos) /*!< OTG_T::INTEN: GOIDLEIEN Mask */ - -#define OTG_INTEN_IDCHGIEN_Pos (5) /*!< OTG_T::INTEN: IDCHGIEN Position */ -#define OTG_INTEN_IDCHGIEN_Msk (0x1ul << OTG_INTEN_IDCHGIEN_Pos) /*!< OTG_T::INTEN: IDCHGIEN Mask */ - -#define OTG_INTEN_PDEVIEN_Pos (6) /*!< OTG_T::INTEN: PDEVIEN Position */ -#define OTG_INTEN_PDEVIEN_Msk (0x1ul << OTG_INTEN_PDEVIEN_Pos) /*!< OTG_T::INTEN: PDEVIEN Mask */ - -#define OTG_INTEN_HOSTIEN_Pos (7) /*!< OTG_T::INTEN: HOSTIEN Position */ -#define OTG_INTEN_HOSTIEN_Msk (0x1ul << OTG_INTEN_HOSTIEN_Pos) /*!< OTG_T::INTEN: HOSTIEN Mask */ - -#define OTG_INTEN_BVLDCHGIEN_Pos (8) /*!< OTG_T::INTEN: BVLDCHGIEN Position */ -#define OTG_INTEN_BVLDCHGIEN_Msk (0x1ul << OTG_INTEN_BVLDCHGIEN_Pos) /*!< OTG_T::INTEN: BVLDCHGIEN Mask */ - -#define OTG_INTEN_AVLDCHGIEN_Pos (9) /*!< OTG_T::INTEN: AVLDCHGIEN Position */ -#define OTG_INTEN_AVLDCHGIEN_Msk (0x1ul << OTG_INTEN_AVLDCHGIEN_Pos) /*!< OTG_T::INTEN: AVLDCHGIEN Mask */ - -#define OTG_INTEN_VBCHGIEN_Pos (10) /*!< OTG_T::INTEN: VBCHGIEN Position */ -#define OTG_INTEN_VBCHGIEN_Msk (0x1ul << OTG_INTEN_VBCHGIEN_Pos) /*!< OTG_T::INTEN: VBCHGIEN Mask */ - -#define OTG_INTEN_SECHGIEN_Pos (11) /*!< OTG_T::INTEN: SECHGIEN Position */ -#define OTG_INTEN_SECHGIEN_Msk (0x1ul << OTG_INTEN_SECHGIEN_Pos) /*!< OTG_T::INTEN: SECHGIEN Mask */ - -#define OTG_INTEN_SRPDETIEN_Pos (13) /*!< OTG_T::INTEN: SRPDETIEN Position */ -#define OTG_INTEN_SRPDETIEN_Msk (0x1ul << OTG_INTEN_SRPDETIEN_Pos) /*!< OTG_T::INTEN: SRPDETIEN Mask */ - -#define OTG_INTSTS_ROLECHGIF_Pos (0) /*!< OTG_T::INTSTS: ROLECHGIF Position */ -#define OTG_INTSTS_ROLECHGIF_Msk (0x1ul << OTG_INTSTS_ROLECHGIF_Pos) /*!< OTG_T::INTSTS: ROLECHGIF Mask */ - -#define OTG_INTSTS_VBEIF_Pos (1) /*!< OTG_T::INTSTS: VBEIF Position */ -#define OTG_INTSTS_VBEIF_Msk (0x1ul << OTG_INTSTS_VBEIF_Pos) /*!< OTG_T::INTSTS: VBEIF Mask */ - -#define OTG_INTSTS_SRPFIF_Pos (2) /*!< OTG_T::INTSTS: SRPFIF Position */ -#define OTG_INTSTS_SRPFIF_Msk (0x1ul << OTG_INTSTS_SRPFIF_Pos) /*!< OTG_T::INTSTS: SRPFIF Mask */ - -#define OTG_INTSTS_HNPFIF_Pos (3) /*!< OTG_T::INTSTS: HNPFIF Position */ -#define OTG_INTSTS_HNPFIF_Msk (0x1ul << OTG_INTSTS_HNPFIF_Pos) /*!< OTG_T::INTSTS: HNPFIF Mask */ - -#define OTG_INTSTS_GOIDLEIF_Pos (4) /*!< OTG_T::INTSTS: GOIDLEIF Position */ -#define OTG_INTSTS_GOIDLEIF_Msk (0x1ul << OTG_INTSTS_GOIDLEIF_Pos) /*!< OTG_T::INTSTS: GOIDLEIF Mask */ - -#define OTG_INTSTS_IDCHGIF_Pos (5) /*!< OTG_T::INTSTS: IDCHGIF Position */ -#define OTG_INTSTS_IDCHGIF_Msk (0x1ul << OTG_INTSTS_IDCHGIF_Pos) /*!< OTG_T::INTSTS: IDCHGIF Mask */ - -#define OTG_INTSTS_PDEVIF_Pos (6) /*!< OTG_T::INTSTS: PDEVIF Position */ -#define OTG_INTSTS_PDEVIF_Msk (0x1ul << OTG_INTSTS_PDEVIF_Pos) /*!< OTG_T::INTSTS: PDEVIF Mask */ - -#define OTG_INTSTS_HOSTIF_Pos (7) /*!< OTG_T::INTSTS: HOSTIF Position */ -#define OTG_INTSTS_HOSTIF_Msk (0x1ul << OTG_INTSTS_HOSTIF_Pos) /*!< OTG_T::INTSTS: HOSTIF Mask */ - -#define OTG_INTSTS_BVLDCHGIF_Pos (8) /*!< OTG_T::INTSTS: BVLDCHGIF Position */ -#define OTG_INTSTS_BVLDCHGIF_Msk (0x1ul << OTG_INTSTS_BVLDCHGIF_Pos) /*!< OTG_T::INTSTS: BVLDCHGIF Mask */ - -#define OTG_INTSTS_AVLDCHGIF_Pos (9) /*!< OTG_T::INTSTS: AVLDCHGIF Position */ -#define OTG_INTSTS_AVLDCHGIF_Msk (0x1ul << OTG_INTSTS_AVLDCHGIF_Pos) /*!< OTG_T::INTSTS: AVLDCHGIF Mask */ - -#define OTG_INTSTS_VBCHGIF_Pos (10) /*!< OTG_T::INTSTS: VBCHGIF Position */ -#define OTG_INTSTS_VBCHGIF_Msk (0x1ul << OTG_INTSTS_VBCHGIF_Pos) /*!< OTG_T::INTSTS: VBCHGIF Mask */ - -#define OTG_INTSTS_SECHGIF_Pos (11) /*!< OTG_T::INTSTS: SECHGIF Position */ -#define OTG_INTSTS_SECHGIF_Msk (0x1ul << OTG_INTSTS_SECHGIF_Pos) /*!< OTG_T::INTSTS: SECHGIF Mask */ - -#define OTG_INTSTS_SRPDETIF_Pos (13) /*!< OTG_T::INTSTS: SRPDETIF Position */ -#define OTG_INTSTS_SRPDETIF_Msk (0x1ul << OTG_INTSTS_SRPDETIF_Pos) /*!< OTG_T::INTSTS: SRPDETIF Mask */ - -#define OTG_STATUS_OVERCUR_Pos (0) /*!< OTG_T::STATUS: OVERCUR Position */ -#define OTG_STATUS_OVERCUR_Msk (0x1ul << OTG_STATUS_OVERCUR_Pos) /*!< OTG_T::STATUS: OVERCUR Mask */ - -#define OTG_STATUS_IDSTS_Pos (1) /*!< OTG_T::STATUS: IDSTS Position */ -#define OTG_STATUS_IDSTS_Msk (0x1ul << OTG_STATUS_IDSTS_Pos) /*!< OTG_T::STATUS: IDSTS Mask */ - -#define OTG_STATUS_SESSEND_Pos (2) /*!< OTG_T::STATUS: SESSEND Position */ -#define OTG_STATUS_SESSEND_Msk (0x1ul << OTG_STATUS_SESSEND_Pos) /*!< OTG_T::STATUS: SESSEND Mask */ - -#define OTG_STATUS_BVLD_Pos (3) /*!< OTG_T::STATUS: BVLD Position */ -#define OTG_STATUS_BVLD_Msk (0x1ul << OTG_STATUS_BVLD_Pos) /*!< OTG_T::STATUS: BVLD Mask */ - -#define OTG_STATUS_AVLD_Pos (4) /*!< OTG_T::STATUS: AVLD Position */ -#define OTG_STATUS_AVLD_Msk (0x1ul << OTG_STATUS_AVLD_Pos) /*!< OTG_T::STATUS: AVLD Mask */ - -#define OTG_STATUS_VBUSVLD_Pos (5) /*!< OTG_T::STATUS: VBUSVLD Position */ -#define OTG_STATUS_VBUSVLD_Msk (0x1ul << OTG_STATUS_VBUSVLD_Pos) /*!< OTG_T::STATUS: VBUSVLD Mask */ - -#define OTG_STATUS_ASPERI_Pos (6) /*!< OTG_T::STATUS: ASPERI Position */ -#define OTG_STATUS_ASPERI_Msk (0x1ul << OTG_STATUS_ASPERI_Pos) /*!< OTG_T::STATUS: ASPERI Mask */ - -#define OTG_STATUS_ASHOST_Pos (7) /*!< OTG_T::STATUS: ASHOST Position */ -#define OTG_STATUS_ASHOST_Msk (0x1ul << OTG_STATUS_ASHOST_Pos) /*!< OTG_T::STATUS: ASHOST Mask */ - -/**@}*/ /* OTG_CONST */ -/**@}*/ /* end of OTG register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __OTG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/pdma_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/pdma_reg.h deleted file mode 100644 index a849d6bdcf5..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/pdma_reg.h +++ /dev/null @@ -1,886 +0,0 @@ -/**************************************************************************//** - * @file pdma_reg.h - * @version V1.00 - * @brief PDMA register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __PDMA_REG_H__ -#define __PDMA_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup PDMA Peripheral Direct Memory Access Controller(PDMA) - Memory Mapped Structure for PDMA Controller -@{ */ - - -typedef struct -{ - - /** - * @var DSCT_T::CTL - * Offset: 0x00 Descriptor Table Control Register of PDMA Channel n. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE |PDMA Operation Mode Selection - * | | |00 = Idle state: Channel is stopped or this table is complete, when PDMA finish channel table task, OPMODE will be cleared to idle state automatically. - * | | |01 = Basic mode: The descriptor table only has one task - * | | |When this task is finished, the PDMA_INTSTS[n] will be asserted. - * | | |10 = Scatter-Gather mode: When operating in this mode, user must give the next descriptor table address in PDMA_DSCT_NEXT register; PDMA controller will ignore this task, then load the next task to execute. - * | | |11 = Reserved. - * | | |Note: Before filling transfer task in the Descriptor Table, user must check if the descriptor table is complete. - * |[2] |TXTYPE |Transfer Type - * | | |0 = Burst transfer type. - * | | |1 = Single transfer type. - * |[6:4] |BURSIZE |Burst Size - * | | |This field is used for peripheral to determine the burst size or used for determine the re-arbitration size. - * | | |000 = 128 Transfers. - * | | |001 = 64 Transfers. - * | | |010 = 32 Transfers. - * | | |011 = 16 Transfers. - * | | |100 = 8 Transfers. - * | | |101 = 4 Transfers. - * | | |110 = 2 Transfers. - * | | |111 = 1 Transfers. - * | | |Note: This field is only useful in burst transfer type. - * |[7] |TBINTDIS |Table Interrupt Disable Bit - * | | |This field can be used to decide whether to enable table interrupt or not - * | | |If the TBINTDIS bit is enabled when PDMA controller finishes transfer task, it will not generates transfer done interrupt. - * | | |0 = Table interrupt Enabled. - * | | |1 = Table interrupt Disabled. - * |[9:8] |SAINC |Source Address Increment - * | | |This field is used to set the source address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * |[11:10] |DAINC |Destination Address Increment - * | | |This field is used to set the destination address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * |[13:12] |TXWIDTH |Transfer Width Selection - * | | |This field is used for transfer width. - * | | |00 = One byte (8 bit) is transferred for every operation. - * | | |01= One half-word (16 bit) is transferred for every operation. - * | | |10 = One word (32-bit) is transferred for every operation. - * | | |11 = Reserved. - * | | |Note: The PDMA transfer source address (PDMA_DSCT_SA) and PDMA transfer destination address (PDMA_DSCT_DA) should be alignment under the TXWIDTH selection - * |[14] |TXACK |Transfer Acknowledge Selection - * | | |0 = transfer ack when transfer done. - * | | |1 = transfer ack when PDMA get transfer data. - * |[15] |STRIDEEN |Stride Mode Enable Bit - * | | |0 = Stride transfer mode Disabled. - * | | |1 = Stride transfer mode Enabled. - * |[31:16] |TXCNT |Transfer Count - * | | |The TXCNT represents the required number of PDMA transfer, the real transfer count is (TXCNT + 1); The maximum transfer count is 16384 , every transfer may be byte, half-word or word that is dependent on TXWIDTH field. - * | | |Note: When PDMA finish each transfer data, this field will be decrease immediately. - * @var DSCT_T::SA - * Offset: 0x04 Source Address Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SA |PDMA Transfer Source Address Register - * | | |This field indicates a 32-bit source address of PDMA controller. - * @var DSCT_T::DA - * Offset: 0x08 Destination Address Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DA |PDMA Transfer Destination Address Register - * | | |This field indicates a 32-bit destination address of PDMA controller. - * @var DSCT_T::NEXT - * Offset: 0x0C Next Scatter-Gather Descriptor Table Offset Address of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |EXENEXT |PDMA Execution Next Descriptor Table Offset - * | | |This field indicates the offset of next descriptor table address of current execution descriptor table in system memory. - * | | |Note: write operation is useless in this field. - * |[31:16] |NEXT |PDMA Next Descriptor Table Offset. - * | | |This field indicates the offset of the next descriptor table address in system memory. - * | | |Write Operation: - * | | |If the system memory based address is 0x2000_0000 (PDMA_SCATBA), and the next descriptor table is start from 0x2000_0100, then this field must fill in 0x0100. - * | | |Read Operation: - * | | |When operating in scatter-gather mode, the last two bits NEXT[1:0] will become reserved, and indicate the first next address of system memory. - * | | |Note1: The descriptor table address must be word boundary. - * | | |Note2: Before filled transfer task in the descriptor table, user must check if the descriptor table is complete. - */ - __IO uint32_t CTL; /*!< [0x0000] Descriptor Table Control Register of PDMA Channel n. */ - __IO uint32_t SA; /*!< [0x0004] Source Address Register of PDMA Channel n */ - __IO uint32_t DA; /*!< [0x0008] Destination Address Register of PDMA Channel n */ - __IO uint32_t NEXT; /*!< [0x000c] First Scatter-Gather Descriptor Table Offset Address of PDMA Channel n */ -} DSCT_T; - - -typedef struct -{ - /** - * @var STRIDE_T::STCR - * Offset: 0x500 Stride Transfer Count Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STC |PDMA Stride Transfer Count - * | | |The 16-bit register defines the stride transfer count of each row. - * @var STRIDE_T::ASOCR - * Offset: 0x504 Address Stride Offset Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SASOL |VDMA Source Address Stride Offset Length - * | | |The 16-bit register defines the source address stride transfer offset count of each row. - * |[31:16] |DASOL |VDMA Destination Address Stride Offset Length - * | | |The 16-bit register defines the destination address stride transfer offset count of each row. - */ - __IO uint32_t STCR; /*!< [0x0500] Stride Transfer Count Register of PDMA Channel 0 */ - __IO uint32_t ASOCR; /*!< [0x0504] Address Stride Offset Register of PDMA Channel 0 */ -} STRIDE_T; - -typedef struct -{ - /** - * @var REPEAT_T::AICTL - * Offset: 0x600 Address Interval Control Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SAICNT |PDMA Source Address Interval Count - * | | |The 16-bit register defines the source address interval count of each row. - * |[31:16] |DAICNT |PDMA Destination Address Interval Count - * | | |The 16-bit register defines the destination address interval count of each row. - * @var REPEAT_T::RCNT - * Offset: 0x604 Repeat Count Register of PDMA Channe n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCNT |PDMA Repeat Count - * | | |The 16-bit register defines the repeat times of block transfer. - */ - __IO uint32_t AICTL; /*!< [0x0600] Address Interval Control Register of PDMA Channel 0 */ - __IO uint32_t RCNT; /*!< [0x0604] Repeat Count Register of PDMA Channel 0 */ -} REPEAT_T; - -typedef struct -{ - - - /** - * @var PDMA_T::CURSCAT - * Offset: 0x100 Current Scatter-Gather Descriptor Table Address of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURADDR |PDMA Current Description Address Register (Read Only) - * | | |This field indicates a 32-bit current external description address of PDMA controller. - * | | |Note: This field is read only and only used for Scatter-Gather mode to indicate the current external description address. - * @var PDMA_T::CHCTL - * Offset: 0x400 PDMA Channel Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CHENn |PDMA Channel Enable Bit - * | | |Set this bit to 1 to enable PDMAn operation. Channel cannot be active if it is not set as enabled. - * | | |0 = PDMA channel [n] Disabled. - * | | |1 = PDMA channel [n] Enabled. - * | | |Note: Set corresponding bit of PDMA_PAUSE or PDMA_CHRST register will also clear this bit. - * @var PDMA_T::PAUSE - * Offset: 0x404 PDMA Transfer Stop Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PAUSEn |PDMA Transfer Pause Control Register (Write Only) - * | | |User can set PAUSEn bit field to pause the PDMA transfer - * | | |When user sets PAUSEn bit, the PDMA controller will pause the on-going transfer, then clear the channel enable bit CHEN(PDMA_CHCTL [n], n=0,1..7) and clear request active flag - * | | |If re-enable the paused channel again, the remaining transfers will be processed. - * | | |0 = No effect. - * | | |1 = Pause PDMA channel n transfer. - * @var PDMA_T::SWREQ - * Offset: 0x408 PDMA Software Request Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SWREQn |PDMA Software Request Register (Write Only) - * | | |Set this bit to 1 to generate a software request to PDMA [n]. - * | | |0 = No effect. - * | | |1 = Generate a software request. - * | | |Note1: User can read PDMA_TRGSTS register to know which channel is on active - * | | |Active flag may be triggered by software request or peripheral request. - * | | |Note2: If user does not enable corresponding PDMA channel, the software request will be ignored. - * @var PDMA_T::TRGSTS - * Offset: 0x40C PDMA Channel Request Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |REQSTSn |PDMA Channel Request Status (Read Only) - * | | |This flag indicates whether channel[n] have a request or not, no matter request from software or peripheral - * | | |When PDMA controller finishes channel transfer, this bit will be cleared automatically. - * | | |0 = PDMA Channel n has no request. - * | | |1 = PDMA Channel n has a request. - * | | |Note: If user pauses or resets each PDMA transfer by setting PDMA_PAUSE or PDMA_CHRST register respectively, this bit will be cleared automatically after finishing current transfer. - * @var PDMA_T::PRISET - * Offset: 0x410 PDMA Fixed Priority Setting Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FPRISETn |PDMA Fixed Priority Setting Register - * | | |Set this bit to 1 to enable fixed priority level. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set PDMA channel [n] to fixed priority channel. - * | | |Read Operation: - * | | |0 = Corresponding PDMA channel is round-robin priority. - * | | |1 = Corresponding PDMA channel is fixed priority. - * | | |Note: This field only set to fixed priority, clear fixed priority use PDMA_PRICLR register. - * @var PDMA_T::PRICLR - * Offset: 0x414 PDMA Fixed Priority Clear Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FPRICLRn |PDMA Fixed Priority Clear Register (Write Only) - * | | |Set this bit to 1 to clear fixed priority level. - * | | |0 = No effect. - * | | |1 = Clear PDMA channel [n] fixed priority setting. - * | | |Note: User can read PDMA_PRISET register to know the channel priority. - * @var PDMA_T::INTEN - * Offset: 0x418 PDMA Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |INTENn |PDMA Interrupt Enable Register - * | | |This field is used for enabling PDMA channel[n] interrupt. - * | | |0 = PDMA channel n interrupt Disabled. - * | | |1 = PDMA channel n interrupt Enabled. - * @var PDMA_T::INTSTS - * Offset: 0x41C PDMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABTIF |PDMA Read/Write Target Abort Interrupt Flag (Read-only) - * | | |This bit indicates that PDMA has target abort error; Software can read PDMA_ABTSTS register to find which channel has target abort error. - * | | |0 = No AHB bus ERROR response received. - * | | |1 = AHB bus ERROR response received. - * |[1] |TDIF |Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that PDMA controller has finished transmission; User can read PDMA_TDSTS register to indicate which channel finished transfer. - * | | |0 = Not finished yet. - * | | |1 = PDMA channel has finished transmission. - * |[2] |ALIGNF |Transfer Alignment Interrupt Flag (Read Only) - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * |[8] |REQTOF0 |Request Time-out Flag for Channel 0 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC0, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * |[9] |REQTOF1 |Request Time-out Flag for Channel 1 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC1, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * @var PDMA_T::ABTSTS - * Offset: 0x420 PDMA Channel Read/Write Target Abort Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ABTIFn |PDMA Read/Write Target Abort Interrupt Status Flag - * | | |This bit indicates which PDMA controller has target abort error; User can write 1 to clear these bits. - * | | |0 = No AHB bus ERROR response received when channel n transfer. - * | | |1 = AHB bus ERROR response received when channel n transfer. - * @var PDMA_T::TDSTS - * Offset: 0x424 PDMA Channel Transfer Done Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TDIFn |Transfer Done Flag Register - * | | |This bit indicates whether PDMA controller channel transfer has been finished or not, user can write 1 to clear these bits. - * | | |0 = PDMA channel transfer has not finished. - * | | |1 = PDMA channel has finished transmission. - * @var PDMA_T::ALIGN - * Offset: 0x428 PDMA Transfer Alignment Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ALIGNn |Transfer Alignment Flag Register - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * @var PDMA_T::TACTSTS - * Offset: 0x42C PDMA Transfer Active Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXACTFn |Transfer on Active Flag Register (Read Only) - * | | |This bit indicates which PDMA channel is in active. - * | | |0 = PDMA channel is not finished. - * | | |1 = PDMA channel is active. - * @var PDMA_T::TOUTPSC - * Offset: 0x430 PDMA Time-out Prescaler Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TOUTPSC0 |PDMA Channel 0 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 0 time-out clock source is HCLK/28. - * | | |001 = PDMA channel 0 time-out clock source is HCLK/29. - * | | |010 = PDMA channel 0 time-out clock source is HCLK/210. - * | | |011 = PDMA channel 0 time-out clock source is HCLK/211. - * | | |100 = PDMA channel 0 time-out clock source is HCLK/212. - * | | |101 = PDMA channel 0 time-out clock source is HCLK/213. - * | | |110 = PDMA channel 0 time-out clock source is HCLK/214. - * | | |111 = PDMA channel 0 time-out clock source is HCLK/215. - * |[6:4] |TOUTPSC1 |PDMA Channel 1 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 1 time-out clock source is HCLK/28. - * | | |001 = PDMA channel 1 time-out clock source is HCLK/29. - * | | |010 = PDMA channel 1 time-out clock source is HCLK/210. - * | | |011 = PDMA channel 1 time-out clock source is HCLK/211. - * | | |100 = PDMA channel 1 time-out clock source is HCLK/212. - * | | |101 = PDMA channel 1 time-out clock source is HCLK/213. - * | | |110 = PDMA channel 1 time-out clock source is HCLK/214. - * | | |111 = PDMA channel 1 time-out clock source is HCLK/215. - * @var PDMA_T::TOUTEN - * Offset: 0x434 PDMA Time-out Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TOUTENn |PDMA Time-out Enable Bits - * | | |0 = PDMA Channel n time-out function Disable. - * | | |1 = PDMA Channel n time-out function Enable. - * @var PDMA_T::TOUTIEN - * Offset: 0x438 PDMA Time-out Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TOUTIENn |PDMA Time-out Interrupt Enable Bits - * | | |0 = PDMA Channel n time-out interrupt Disable. - * | | |1 = PDMA Channel n time-out interrupt Enable. - * @var PDMA_T::SCATBA - * Offset: 0x43C PDMA Scatter-Gather Descriptor Table Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |SCATBA |PDMA Scatter-gather Descriptor Table Address Register - * | | |In Scatter-Gather mode, this is the base address for calculating the next link - list address - * | | |The next link address equation is - * | | |Next Link Address = PDMA_SCATBA + PDMA_DSCT_NEXT. - * | | |Note: Only useful in Scatter-Gather mode. - * @var PDMA_T::TOC0_1 - * Offset: 0x440 PDMA Time-out Counter Ch1 and Ch0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TOC0 |Time-out Counter for Channel 0 - * | | |This controls the period of time-out function for channel 0 - * | | |The calculation unit is based on 10 kHz clock. - * |[31:16] |TOC1 |Time-out Counter for Channel 1 - * | | |This controls the period of time-out function for channel 1 - * | | |The calculation unit is based on 10 kHz clock. - * @var PDMA_T::CHRST - * Offset: 0x460 PDMA Channel Reset Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CHnRST |Channel N Reset - * | | |0 = corresponding channel n not reset. - * | | |1 = corresponding channel n is reset. - * @var PDMA_T::REQSEL0_3 - * Offset: 0x480 PDMA Request Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC0 |Channel 0 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 0 - * | | |User can configure the peripheral by setting REQSRC0. - * | | |0 = Disable PDMA peripheral request. - * | | |1 = Reserved. - * | | |2 = Channel connects to USB_TX. - * | | |3 = Channel connects to USB_RX. - * | | |4 = Channel connects to UART0_TX. - * | | |5 = Channel connects to UART0_RX. - * | | |6 = Channel connects to UART1_TX. - * | | |7 = Channel connects to UART1_RX. - * | | |8 = Channel connects to UART2_TX. - * | | |9 = Channel connects to UART2_RX. - * | | |10=Channel connects to UART3_TX. - * | | |11 = Channel connects to UART3_RX. - * | | |12 = Channel connects to UART4_TX. - * | | |13 = Channel connects to UART4_RX. - * | | |14 = Channel connects to UART5_TX. - * | | |15 = Channel connects to UART5_RX. - * | | |16 = Channel connects to USCI0_TX. - * | | |17 = Channel connects to USCI0_RX. - * | | |18 = Channel connects to USCI1_TX. - * | | |19 = Channel connects to USCI1_RX. - * | | |20 = Channel connects to QSPI0_TX. - * | | |21 = Channel connects to QSPI0_RX. - * | | |22 = Channel connects to SPI0_TX. - * | | |23 = Channel connects to SPI0_RX. - * | | |24 = Channel connects to SPI1_TX. - * | | |25 = Channel connects to SPI1_RX. - * | | |26 = Channel connects to SPI2_TX. - * | | |27 = Channel connects to SPI2_RX. - * | | |28 = Channel connects to SPI3_TX. - * | | |29 = Channel connects to SPI3_RX. - * | | |30 = Reserved. - * | | |31 = Reserved. - * | | |32 = Channel connects to EPWM0_P1_RX. - * | | |33 = Channel connects to EPWM0_P2_RX. - * | | |34 = Channel connects to EPWM0_P3_RX. - * | | |35 = Channel connects to EPWM1_P1_RX. - * | | |36 = Channel connects to EPWM1_P2_RX. - * | | |37 = Channel connects to EPWM1_P3_RX. - * | | |38 = Channel connects to I2C0_TX. - * | | |39 = Channel connects to I2C0_RX. - * | | |40 = Channel connects to I2C1_TX. - * | | |41 = Channel connects to I2C1_RX. - * | | |42 = Channel connects to I2C2_TX. - * | | |43 = Channel connects to I2C2_RX. - * | | |44 = Channel connects to I2S0_TX. - * | | |45 = Channel connects to I2S0_RX. - * | | |46 = Channel connects to TMR0. - * | | |47 = Channel connects to TMR1. - * | | |48 = Channel connects to TMR2. - * | | |49 = Channel connects to TMR3. - * | | |50 = Channel connects to ADC_RX. - * | | |51 = Channel connects to DAC0_TX. - * | | |52 = Channel connects to DAC1_TX. - * | | |53 = Channel connects to EPWM0_CH0_TX. - * | | |54 = Channel connects to EPWM0_CH1_TX. - * | | |55 = Channel connects to EPWM0_CH2_TX. - * | | |56 = Channel connects to EPWM0_CH3_TX. - * | | |57 = Channel connects to EPWM0_CH4_TX. - * | | |58 = Channel connects to EPWM0_CH5_TX. - * | | |59 = Channel connects to EPWM1_CH0_TX. - * | | |60 = Channel connects to EPWM1_CH1_TX. - * | | |61 = Channel connects to EPWM1_CH2_TX. - * | | |62 = Channel connects to EPWM1_CH3_TX. - * | | |63 = Channel connects to EPWM1_CH4_TX. - * | | |64 = Channel connects to EPWM1_CH5_TX. - * | | |65 = Channel connects to ETMC_RX. - * | | |Others = Reserved. - * | | |Note 1: A peripheral can't assign to two channels at the same time. - * | | |Note 2: This field is useless when transfer between memory and memory. - * |[14:8] |REQSRC1 |Channel 1 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 1 - * | | |User can configure the peripheral setting by REQSRC1. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC2 |Channel 2 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 2 - * | | |User can configure the peripheral setting by REQSRC2. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC3 |Channel 3 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 3 - * | | |User can configure the peripheral setting by REQSRC3. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL4_7 - * Offset: 0x484 PDMA Request Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC4 |Channel 4 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 4 - * | | |User can configure the peripheral setting by REQSRC4. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[14:8] |REQSRC5 |Channel 5 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 5 - * | | |User can configure the peripheral setting by REQSRC5. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC6 |Channel 6 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 6 - * | | |User can configure the peripheral setting by REQSRC6. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC7 |Channel 7 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 7 - * | | |User can configure the peripheral setting by REQSRC7. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL8_11 - * Offset: 0x488 PDMA Request Source Select Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC8 |Channel 8 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 8 - * | | |User can configure the peripheral setting by REQSRC8. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[14:8] |REQSRC9 |Channel 9 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 9 - * | | |User can configure the peripheral setting by REQSRC9. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC10 |Channel 10 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 10 - * | | |User can configure the peripheral setting by REQSRC10. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC11 |Channel 11 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 11 - * | | |User can configure the peripheral setting by REQSRC11. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL12_15 - * Offset: 0x48C PDMA Request Source Select Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC12 |Channel 12 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 12 - * | | |User can configure the peripheral setting by REQSRC12. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[14:8] |REQSRC13 |Channel 13 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 13 - * | | |User can configure the peripheral setting by REQSRC13. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC14 |Channel 14 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 14 - * | | |User can configure the peripheral setting by REQSRC14. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC15 |Channel 15 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 15 - * | | |User can configure the peripheral setting by REQSRC15. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - */ - DSCT_T DSCT[16]; - __I uint32_t CURSCAT[16]; /*!< [0x0100] Current Scatter-Gather Descriptor Table Address of PDMA Channel n */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[176]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CHCTL; /*!< [0x0400] PDMA Channel Control Register */ - __O uint32_t PAUSE; /*!< [0x0404] PDMA Transfer Pause Control Register */ - __O uint32_t SWREQ; /*!< [0x0408] PDMA Software Request Register */ - __I uint32_t TRGSTS; /*!< [0x040c] PDMA Channel Request Status Register */ - __IO uint32_t PRISET; /*!< [0x0410] PDMA Fixed Priority Setting Register */ - __O uint32_t PRICLR; /*!< [0x0414] PDMA Fixed Priority Clear Register */ - __IO uint32_t INTEN; /*!< [0x0418] PDMA Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x041c] PDMA Interrupt Status Register */ - __IO uint32_t ABTSTS; /*!< [0x0420] PDMA Channel Read/Write Target Abort Flag Register */ - __IO uint32_t TDSTS; /*!< [0x0424] PDMA Channel Transfer Done Flag Register */ - __IO uint32_t ALIGN; /*!< [0x0428] PDMA Transfer Alignment Status Register */ - __I uint32_t TACTSTS; /*!< [0x042c] PDMA Transfer Active Flag Register */ - __IO uint32_t TOUTPSC; /*!< [0x0430] PDMA Time-out Prescaler Register */ - __IO uint32_t TOUTEN; /*!< [0x0434] PDMA Time-out Enable Register */ - __IO uint32_t TOUTIEN; /*!< [0x0438] PDMA Time-out Interrupt Enable Register */ - __IO uint32_t SCATBA; /*!< [0x043c] PDMA Scatter-Gather Descriptor Table Base Address Register */ - __IO uint32_t TOC0_1; /*!< [0x0440] PDMA Time-out Counter Ch1 and Ch0 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[7]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CHRST; /*!< [0x0460] PDMA Channel Reset Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[7]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t REQSEL0_3; /*!< [0x0480] PDMA Request Source Select Register 0 */ - __IO uint32_t REQSEL4_7; /*!< [0x0484] PDMA Request Source Select Register 1 */ - __IO uint32_t REQSEL8_11; /*!< [0x0488] PDMA Request Source Select Register 2 */ - __IO uint32_t REQSEL12_15; /*!< [0x048c] PDMA Request Source Select Register 3 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[28]; - /// @endcond //HIDDEN_SYMBOLS - STRIDE_T STRIDE[6]; - /// @cond HIDDEN_SYMBOLS - __IO uint32_t RESERVE5[52]; - /// @endcond //HIDDEN_SYMBOLS - REPEAT_T REPEAT[2]; -} PDMA_T; - -/** - @addtogroup PDMA_CONST PDMA Bit Field Definition - Constant Definitions for PDMA Controller -@{ */ - -#define PDMA_DSCT_CTL_OPMODE_Pos (0) /*!< PDMA_T::DSCT_CTL: OPMODE Position */ -#define PDMA_DSCT_CTL_OPMODE_Msk (0x3ul << PDMA_DSCT_CTL_OPMODE_Pos) /*!< PDMA_T::DSCT_CTL: OPMODE Mask */ - -#define PDMA_DSCT_CTL_TXTYPE_Pos (2) /*!< PDMA_T::DSCT_CTL: TXTYPE Position */ -#define PDMA_DSCT_CTL_TXTYPE_Msk (0x1ul << PDMA_DSCT_CTL_TXTYPE_Pos) /*!< PDMA_T::DSCT_CTL: TXTYPE Mask */ - -#define PDMA_DSCT_CTL_BURSIZE_Pos (4) /*!< PDMA_T::DSCT_CTL: BURSIZE Position */ -#define PDMA_DSCT_CTL_BURSIZE_Msk (0x7ul << PDMA_DSCT_CTL_BURSIZE_Pos) /*!< PDMA_T::DSCT_CTL: BURSIZE Mask */ - -#define PDMA_DSCT_CTL_TBINTDIS_Pos (7) /*!< PDMA_T::DSCT_CTL: TBINTDIS Position */ -#define PDMA_DSCT_CTL_TBINTDIS_Msk (0x1ul << PDMA_DSCT_CTL_TBINTDIS_Pos) /*!< PDMA_T::DSCT_CTL: TBINTDIS Mask */ - -#define PDMA_DSCT_CTL_SAINC_Pos (8) /*!< PDMA_T::DSCT_CTL: SAINC Position */ -#define PDMA_DSCT_CTL_SAINC_Msk (0x3ul << PDMA_DSCT_CTL_SAINC_Pos) /*!< PDMA_T::DSCT_CTL: SAINC Mask */ - -#define PDMA_DSCT_CTL_DAINC_Pos (10) /*!< PDMA_T::DSCT_CTL: DAINC Position */ -#define PDMA_DSCT_CTL_DAINC_Msk (0x3ul << PDMA_DSCT_CTL_DAINC_Pos) /*!< PDMA_T::DSCT_CTL: DAINC Mask */ - -#define PDMA_DSCT_CTL_TXWIDTH_Pos (12) /*!< PDMA_T::DSCT_CTL: TXWIDTH Position */ -#define PDMA_DSCT_CTL_TXWIDTH_Msk (0x3ul << PDMA_DSCT_CTL_TXWIDTH_Pos) /*!< PDMA_T::DSCT_CTL: TXWIDTH Mask */ - -#define PDMA_DSCT_CTL_TXACK_Pos (14) /*!< PDMA_T::DSCT_CTL: TXACK Position */ -#define PDMA_DSCT_CTL_TXACK_Msk (0x1ul << PDMA_DSCT_CTL_TXACK_Pos) /*!< PDMA_T::DSCT_CTL: TXACK Mask */ - -#define PDMA_DSCT_CTL_STRIDEEN_Pos (15) /*!< PDMA_T::DSCT_CTL: STRIDEEN Position */ -#define PDMA_DSCT_CTL_STRIDEEN_Msk (0x1ul << PDMA_DSCT_CTL_STRIDEEN_Pos) /*!< PDMA_T::DSCT_CTL: STRIDEEN Mask */ - -#define PDMA_DSCT_CTL_TXCNT_Pos (16) /*!< PDMA_T::DSCT_CTL: TXCNT Position */ -#define PDMA_DSCT_CTL_TXCNT_Msk (0xfffful << PDMA_DSCT_CTL_TXCNT_Pos) /*!< PDMA_T::DSCT_CTL: TXCNT Mask */ - -#define PDMA_DSCT_SA_SA_Pos (0) /*!< PDMA_T::DSCT_SA: SA Position */ -#define PDMA_DSCT_SA_SA_Msk (0xfffffffful << PDMA_DSCT_SA_SA_Pos) /*!< PDMA_T::DSCT_SA: SA Mask */ - -#define PDMA_DSCT_DA_DA_Pos (0) /*!< PDMA_T::DSCT_DA: DA Position */ -#define PDMA_DSCT_DA_DA_Msk (0xfffffffful << PDMA_DSCT_DA_DA_Pos) /*!< PDMA_T::DSCT_DA: DA Mask */ - -#define PDMA_DSCT_NEXT_NEXT_Pos (0) /*!< PDMA_T::DSCT_NEXT: NEXT Position */ -#define PDMA_DSCT_NEXT_NEXT_Msk (0xfffful << PDMA_DSCT_NEXT_NEXT_Pos) /*!< PDMA_T::DSCT_NEXT: NEXT Mask */ - -#define PDMA_DSCT_NEXT_EXENEXT_Pos (16) /*!< PDMA_T::DSCT_FIRST: NEXT Position */ -#define PDMA_DSCT_NEXT_EXENEXT_Msk (0xfffful << PDMA_DSCT_NEXT_EXENEXT_Pos) /*!< PDMA_T::DSCT_FIRST: NEXT Mask */ - -#define PDMA_CURSCAT_CURADDR_Pos (0) /*!< PDMA_T::CURSCAT: CURADDR Position */ -#define PDMA_CURSCAT_CURADDR_Msk (0xfffffffful << PDMA_CURSCAT_CURADDR_Pos) /*!< PDMA_T::CURSCAT: CURADDR Mask */ - -#define PDMA_CHCTL_CHENn_Pos (0) /*!< PDMA_T::CHCTL: CHENn Position */ -#define PDMA_CHCTL_CHENn_Msk (0xfffful << PDMA_CHCTL_CHENn_Pos) /*!< PDMA_T::CHCTL: CHENn Mask */ - -#define PDMA_PAUSE_PAUSEn_Pos (0) /*!< PDMA_T::PAUSE: PAUSEn Position */ -#define PDMA_PAUSE_PAUSEn_Msk (0xfffful << PDMA_PAUSE_PAUSEn_Pos) /*!< PDMA_T::PAUSE: PAUSEn Mask */ - -#define PDMA_SWREQ_SWREQn_Pos (0) /*!< PDMA_T::SWREQ: SWREQn Position */ -#define PDMA_SWREQ_SWREQn_Msk (0xfffful << PDMA_SWREQ_SWREQn_Pos) /*!< PDMA_T::SWREQ: SWREQn Mask */ - -#define PDMA_TRGSTS_REQSTSn_Pos (0) /*!< PDMA_T::TRGSTS: REQSTSn Position */ -#define PDMA_TRGSTS_REQSTSn_Msk (0xfffful << PDMA_TRGSTS_REQSTSn_Pos) /*!< PDMA_T::TRGSTS: REQSTSn Mask */ - -#define PDMA_PRISET_FPRISETn_Pos (0) /*!< PDMA_T::PRISET: FPRISETn Position */ -#define PDMA_PRISET_FPRISETn_Msk (0xfffful << PDMA_PRISET_FPRISETn_Pos) /*!< PDMA_T::PRISET: FPRISETn Mask */ - -#define PDMA_PRICLR_FPRICLRn_Pos (0) /*!< PDMA_T::PRICLR: FPRICLRn Position */ -#define PDMA_PRICLR_FPRICLRn_Msk (0xfffful << PDMA_PRICLR_FPRICLRn_Pos) /*!< PDMA_T::PRICLR: FPRICLRn Mask */ - -#define PDMA_INTEN_INTENn_Pos (0) /*!< PDMA_T::INTEN: INTENn Position */ -#define PDMA_INTEN_INTENn_Msk (0xfffful << PDMA_INTEN_INTENn_Pos) /*!< PDMA_T::INTEN: INTENn Mask */ - -#define PDMA_INTSTS_ABTIF_Pos (0) /*!< PDMA_T::INTSTS: ABTIF Position */ -#define PDMA_INTSTS_ABTIF_Msk (0x1ul << PDMA_INTSTS_ABTIF_Pos) /*!< PDMA_T::INTSTS: ABTIF Mask */ - -#define PDMA_INTSTS_TDIF_Pos (1) /*!< PDMA_T::INTSTS: TDIF Position */ -#define PDMA_INTSTS_TDIF_Msk (0x1ul << PDMA_INTSTS_TDIF_Pos) /*!< PDMA_T::INTSTS: TDIF Mask */ - -#define PDMA_INTSTS_ALIGNF_Pos (2) /*!< PDMA_T::INTSTS: ALIGNF Position */ -#define PDMA_INTSTS_ALIGNF_Msk (0x1ul << PDMA_INTSTS_ALIGNF_Pos) /*!< PDMA_T::INTSTS: ALIGNF Mask */ - -#define PDMA_INTSTS_REQTOF0_Pos (8) /*!< PDMA_T::INTSTS: REQTOF0 Position */ -#define PDMA_INTSTS_REQTOF0_Msk (0x1ul << PDMA_INTSTS_REQTOF0_Pos) /*!< PDMA_T::INTSTS: REQTOF0 Mask */ - -#define PDMA_INTSTS_REQTOF1_Pos (9) /*!< PDMA_T::INTSTS: REQTOF1 Position */ -#define PDMA_INTSTS_REQTOF1_Msk (0x1ul << PDMA_INTSTS_REQTOF1_Pos) /*!< PDMA_T::INTSTS: REQTOF1 Mask */ - -#define PDMA_ABTSTS_ABTIF0_Pos (0) /*!< PDMA_T::ABTSTS: ABTIF0 Position */ -#define PDMA_ABTSTS_ABTIF0_Msk (0x1ul << PDMA_ABTSTS_ABTIF0_Pos) /*!< PDMA_T::ABTSTS: ABTIF0 Mask */ - -#define PDMA_ABTSTS_ABTIF1_Pos (1) /*!< PDMA_T::ABTSTS: ABTIF1 Position */ -#define PDMA_ABTSTS_ABTIF1_Msk (0x1ul << PDMA_ABTSTS_ABTIF1_Pos) /*!< PDMA_T::ABTSTS: ABTIF1 Mask */ - -#define PDMA_ABTSTS_ABTIF2_Pos (2) /*!< PDMA_T::ABTSTS: ABTIF2 Position */ -#define PDMA_ABTSTS_ABTIF2_Msk (0x1ul << PDMA_ABTSTS_ABTIF2_Pos) /*!< PDMA_T::ABTSTS: ABTIF2 Mask */ - -#define PDMA_ABTSTS_ABTIF3_Pos (3) /*!< PDMA_T::ABTSTS: ABTIF3 Position */ -#define PDMA_ABTSTS_ABTIF3_Msk (0x1ul << PDMA_ABTSTS_ABTIF3_Pos) /*!< PDMA_T::ABTSTS: ABTIF3 Mask */ - -#define PDMA_ABTSTS_ABTIF4_Pos (4) /*!< PDMA_T::ABTSTS: ABTIF4 Position */ -#define PDMA_ABTSTS_ABTIF4_Msk (0x1ul << PDMA_ABTSTS_ABTIF4_Pos) /*!< PDMA_T::ABTSTS: ABTIF4 Mask */ - -#define PDMA_ABTSTS_ABTIF5_Pos (5) /*!< PDMA_T::ABTSTS: ABTIF5 Position */ -#define PDMA_ABTSTS_ABTIF5_Msk (0x1ul << PDMA_ABTSTS_ABTIF5_Pos) /*!< PDMA_T::ABTSTS: ABTIF5 Mask */ - -#define PDMA_ABTSTS_ABTIF6_Pos (6) /*!< PDMA_T::ABTSTS: ABTIF6 Position */ -#define PDMA_ABTSTS_ABTIF6_Msk (0x1ul << PDMA_ABTSTS_ABTIF6_Pos) /*!< PDMA_T::ABTSTS: ABTIF6 Mask */ - -#define PDMA_ABTSTS_ABTIF7_Pos (7) /*!< PDMA_T::ABTSTS: ABTIF7 Position */ -#define PDMA_ABTSTS_ABTIF7_Msk (0x1ul << PDMA_ABTSTS_ABTIF7_Pos) /*!< PDMA_T::ABTSTS: ABTIF7 Mask */ - -#define PDMA_ABTSTS_ABTIF8_Pos (8) /*!< PDMA_T::ABTSTS: ABTIF8 Position */ -#define PDMA_ABTSTS_ABTIF8_Msk (0x1ul << PDMA_ABTSTS_ABTIF8_Pos) /*!< PDMA_T::ABTSTS: ABTIF8 Mask */ - -#define PDMA_ABTSTS_ABTIF9_Pos (9) /*!< PDMA_T::ABTSTS: ABTIF9 Position */ -#define PDMA_ABTSTS_ABTIF9_Msk (0x1ul << PDMA_ABTSTS_ABTIF9_Pos) /*!< PDMA_T::ABTSTS: ABTIF9 Mask */ - -#define PDMA_ABTSTS_ABTIF10_Pos (10) /*!< PDMA_T::ABTSTS: ABTIF10 Position */ -#define PDMA_ABTSTS_ABTIF10_Msk (0x1ul << PDMA_ABTSTS_ABTIF10_Pos) /*!< PDMA_T::ABTSTS: ABTIF10 Mask */ - -#define PDMA_ABTSTS_ABTIF11_Pos (11) /*!< PDMA_T::ABTSTS: ABTIF11 Position */ -#define PDMA_ABTSTS_ABTIF11_Msk (0x1ul << PDMA_ABTSTS_ABTIF11_Pos) /*!< PDMA_T::ABTSTS: ABTIF11 Mask */ - -#define PDMA_ABTSTS_ABTIF12_Pos (12) /*!< PDMA_T::ABTSTS: ABTIF12 Position */ -#define PDMA_ABTSTS_ABTIF12_Msk (0x1ul << PDMA_ABTSTS_ABTIF12_Pos) /*!< PDMA_T::ABTSTS: ABTIF12 Mask */ - -#define PDMA_ABTSTS_ABTIF13_Pos (13) /*!< PDMA_T::ABTSTS: ABTIF13 Position */ -#define PDMA_ABTSTS_ABTIF13_Msk (0x1ul << PDMA_ABTSTS_ABTIF13_Pos) /*!< PDMA_T::ABTSTS: ABTIF13 Mask */ - -#define PDMA_ABTSTS_ABTIF14_Pos (14) /*!< PDMA_T::ABTSTS: ABTIF14 Position */ -#define PDMA_ABTSTS_ABTIF14_Msk (0x1ul << PDMA_ABTSTS_ABTIF14_Pos) /*!< PDMA_T::ABTSTS: ABTIF14 Mask */ - -#define PDMA_ABTSTS_ABTIF15_Pos (15) /*!< PDMA_T::ABTSTS: ABTIF15 Position */ -#define PDMA_ABTSTS_ABTIF15_Msk (0x1ul << PDMA_ABTSTS_ABTIF15_Pos) /*!< PDMA_T::ABTSTS: ABTIF15 Mask */ - -#define PDMA_TDSTS_TDIF0_Pos (0) /*!< PDMA_T::TDSTS: TDIF0 Position */ -#define PDMA_TDSTS_TDIF0_Msk (0x1ul << PDMA_TDSTS_TDIF0_Pos) /*!< PDMA_T::TDSTS: TDIF0 Mask */ - -#define PDMA_TDSTS_TDIF1_Pos (1) /*!< PDMA_T::TDSTS: TDIF1 Position */ -#define PDMA_TDSTS_TDIF1_Msk (0x1ul << PDMA_TDSTS_TDIF1_Pos) /*!< PDMA_T::TDSTS: TDIF1 Mask */ - -#define PDMA_TDSTS_TDIF2_Pos (2) /*!< PDMA_T::TDSTS: TDIF2 Position */ -#define PDMA_TDSTS_TDIF2_Msk (0x1ul << PDMA_TDSTS_TDIF2_Pos) /*!< PDMA_T::TDSTS: TDIF2 Mask */ - -#define PDMA_TDSTS_TDIF3_Pos (3) /*!< PDMA_T::TDSTS: TDIF3 Position */ -#define PDMA_TDSTS_TDIF3_Msk (0x1ul << PDMA_TDSTS_TDIF3_Pos) /*!< PDMA_T::TDSTS: TDIF3 Mask */ - -#define PDMA_TDSTS_TDIF4_Pos (4) /*!< PDMA_T::TDSTS: TDIF4 Position */ -#define PDMA_TDSTS_TDIF4_Msk (0x1ul << PDMA_TDSTS_TDIF4_Pos) /*!< PDMA_T::TDSTS: TDIF4 Mask */ - -#define PDMA_TDSTS_TDIF5_Pos (5) /*!< PDMA_T::TDSTS: TDIF5 Position */ -#define PDMA_TDSTS_TDIF5_Msk (0x1ul << PDMA_TDSTS_TDIF5_Pos) /*!< PDMA_T::TDSTS: TDIF5 Mask */ - -#define PDMA_TDSTS_TDIF6_Pos (6) /*!< PDMA_T::TDSTS: TDIF6 Position */ -#define PDMA_TDSTS_TDIF6_Msk (0x1ul << PDMA_TDSTS_TDIF6_Pos) /*!< PDMA_T::TDSTS: TDIF6 Mask */ - -#define PDMA_TDSTS_TDIF7_Pos (7) /*!< PDMA_T::TDSTS: TDIF7 Position */ -#define PDMA_TDSTS_TDIF7_Msk (0x1ul << PDMA_TDSTS_TDIF7_Pos) /*!< PDMA_T::TDSTS: TDIF7 Mask */ - -#define PDMA_TDSTS_TDIF8_Pos (8) /*!< PDMA_T::TDSTS: TDIF8 Position */ -#define PDMA_TDSTS_TDIF8_Msk (0x1ul << PDMA_TDSTS_TDIF8_Pos) /*!< PDMA_T::TDSTS: TDIF8 Mask */ - -#define PDMA_TDSTS_TDIF9_Pos (9) /*!< PDMA_T::TDSTS: TDIF9 Position */ -#define PDMA_TDSTS_TDIF9_Msk (0x1ul << PDMA_TDSTS_TDIF9_Pos) /*!< PDMA_T::TDSTS: TDIF9 Mask */ - -#define PDMA_TDSTS_TDIF10_Pos (10) /*!< PDMA_T::TDSTS: TDIF10 Position */ -#define PDMA_TDSTS_TDIF10_Msk (0x1ul << PDMA_TDSTS_TDIF10_Pos) /*!< PDMA_T::TDSTS: TDIF10 Mask */ - -#define PDMA_TDSTS_TDIF11_Pos (11) /*!< PDMA_T::TDSTS: TDIF11 Position */ -#define PDMA_TDSTS_TDIF11_Msk (0x1ul << PDMA_TDSTS_TDIF11_Pos) /*!< PDMA_T::TDSTS: TDIF11 Mask */ - -#define PDMA_TDSTS_TDIF12_Pos (12) /*!< PDMA_T::TDSTS: TDIF12 Position */ -#define PDMA_TDSTS_TDIF12_Msk (0x1ul << PDMA_TDSTS_TDIF12_Pos) /*!< PDMA_T::TDSTS: TDIF12 Mask */ - -#define PDMA_TDSTS_TDIF13_Pos (13) /*!< PDMA_T::TDSTS: TDIF13 Position */ -#define PDMA_TDSTS_TDIF13_Msk (0x1ul << PDMA_TDSTS_TDIF13_Pos) /*!< PDMA_T::TDSTS: TDIF13 Mask */ - -#define PDMA_TDSTS_TDIF14_Pos (14) /*!< PDMA_T::TDSTS: TDIF14 Position */ -#define PDMA_TDSTS_TDIF14_Msk (0x1ul << PDMA_TDSTS_TDIF14_Pos) /*!< PDMA_T::TDSTS: TDIF14 Mask */ - -#define PDMA_TDSTS_TDIF15_Pos (15) /*!< PDMA_T::TDSTS: TDIF15 Position */ -#define PDMA_TDSTS_TDIF15_Msk (0x1ul << PDMA_TDSTS_TDIF15_Pos) /*!< PDMA_T::TDSTS: TDIF15 Mask */ - -#define PDMA_ALIGN_ALIGNn_Pos (0) /*!< PDMA_T::ALIGN: ALIGNn Position */ -#define PDMA_ALIGN_ALIGNn_Msk (0xfffful << PDMA_ALIGN_ALIGNn_Pos) /*!< PDMA_T::ALIGN: ALIGNn Mask */ - -#define PDMA_TACTSTS_TXACTFn_Pos (0) /*!< PDMA_T::TACTSTS: TXACTFn Position */ -#define PDMA_TACTSTS_TXACTFn_Msk (0xfffful << PDMA_TACTSTS_TXACTFn_Pos) /*!< PDMA_T::TACTSTS: TXACTFn Mask */ - -#define PDMA_TOUTPSC_TOUTPSC0_Pos (0) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Position */ -#define PDMA_TOUTPSC_TOUTPSC0_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC0_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Mask */ - -#define PDMA_TOUTPSC_TOUTPSC1_Pos (4) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Position */ -#define PDMA_TOUTPSC_TOUTPSC1_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC1_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Mask */ - -#define PDMA_TOUTEN_TOUTENn_Pos (0) /*!< PDMA_T::TOUTEN: TOUTENn Position */ -#define PDMA_TOUTEN_TOUTENn_Msk (0x3ul << PDMA_TOUTEN_TOUTENn_Pos) /*!< PDMA_T::TOUTEN: TOUTENn Mask */ - -#define PDMA_TOUTIEN_TOUTIENn_Pos (0) /*!< PDMA_T::TOUTIEN: TOUTIENn Position */ -#define PDMA_TOUTIEN_TOUTIENn_Msk (0x3ul << PDMA_TOUTIEN_TOUTIENn_Pos) /*!< PDMA_T::TOUTIEN: TOUTIENn Mask */ - -#define PDMA_SCATBA_SCATBA_Pos (16) /*!< PDMA_T::SCATBA: SCATBA Position */ -#define PDMA_SCATBA_SCATBA_Msk (0xfffful << PDMA_SCATBA_SCATBA_Pos) /*!< PDMA_T::SCATBA: SCATBA Mask */ - -#define PDMA_TOC0_1_TOC0_Pos (0) /*!< PDMA_T::TOC0_1: TOC0 Position */ -#define PDMA_TOC0_1_TOC0_Msk (0xfffful << PDMA_TOC0_1_TOC0_Pos) /*!< PDMA_T::TOC0_1: TOC0 Mask */ - -#define PDMA_TOC0_1_TOC1_Pos (16) /*!< PDMA_T::TOC0_1: TOC1 Position */ -#define PDMA_TOC0_1_TOC1_Msk (0xfffful << PDMA_TOC0_1_TOC1_Pos) /*!< PDMA_T::TOC0_1: TOC1 Mask */ - -#define PDMA_CHRST_CHnRST_Pos (0) /*!< PDMA_T::CHRST: CHnRST Position */ -#define PDMA_CHRST_CHnRST_Msk (0xfffful << PDMA_CHRST_CHnRST_Pos) /*!< PDMA_T::CHRST: CHnRST Mask */ - -#define PDMA_REQSEL0_3_REQSRC0_Pos (0) /*!< PDMA_T::REQSEL0_3: REQSRC0 Position */ -#define PDMA_REQSEL0_3_REQSRC0_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC0_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC0 Mask */ - -#define PDMA_REQSEL0_3_REQSRC1_Pos (8) /*!< PDMA_T::REQSEL0_3: REQSRC1 Position */ -#define PDMA_REQSEL0_3_REQSRC1_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC1_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC1 Mask */ - -#define PDMA_REQSEL0_3_REQSRC2_Pos (16) /*!< PDMA_T::REQSEL0_3: REQSRC2 Position */ -#define PDMA_REQSEL0_3_REQSRC2_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC2_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC2 Mask */ - -#define PDMA_REQSEL0_3_REQSRC3_Pos (24) /*!< PDMA_T::REQSEL0_3: REQSRC3 Position */ -#define PDMA_REQSEL0_3_REQSRC3_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC3_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC3 Mask */ - -#define PDMA_REQSEL4_7_REQSRC4_Pos (0) /*!< PDMA_T::REQSEL4_7: REQSRC4 Position */ -#define PDMA_REQSEL4_7_REQSRC4_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC4_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC4 Mask */ - -#define PDMA_REQSEL4_7_REQSRC5_Pos (8) /*!< PDMA_T::REQSEL4_7: REQSRC5 Position */ -#define PDMA_REQSEL4_7_REQSRC5_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC5_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC5 Mask */ - -#define PDMA_REQSEL4_7_REQSRC6_Pos (16) /*!< PDMA_T::REQSEL4_7: REQSRC6 Position */ -#define PDMA_REQSEL4_7_REQSRC6_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC6_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC6 Mask */ - -#define PDMA_REQSEL4_7_REQSRC7_Pos (24) /*!< PDMA_T::REQSEL4_7: REQSRC7 Position */ -#define PDMA_REQSEL4_7_REQSRC7_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC7_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC7 Mask */ - -#define PDMA_REQSEL8_11_REQSRC8_Pos (0) /*!< PDMA_T::REQSEL8_11: REQSRC8 Position */ -#define PDMA_REQSEL8_11_REQSRC8_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC8_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC8 Mask */ - -#define PDMA_REQSEL8_11_REQSRC9_Pos (8) /*!< PDMA_T::REQSEL8_11: REQSRC9 Position */ -#define PDMA_REQSEL8_11_REQSRC9_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC9_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC9 Mask */ - -#define PDMA_REQSEL8_11_REQSRC10_Pos (16) /*!< PDMA_T::REQSEL8_11: REQSRC10 Position */ -#define PDMA_REQSEL8_11_REQSRC10_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC10_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC10 Mask */ - -#define PDMA_REQSEL8_11_REQSRC11_Pos (24) /*!< PDMA_T::REQSEL8_11: REQSRC11 Position */ -#define PDMA_REQSEL8_11_REQSRC11_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC11_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC11 Mask */ - -#define PDMA_REQSEL12_15_REQSRC12_Pos (0) /*!< PDMA_T::REQSEL12_15: REQSRC12 Position */ -#define PDMA_REQSEL12_15_REQSRC12_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC12_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC12 Mask */ - -#define PDMA_REQSEL12_15_REQSRC13_Pos (8) /*!< PDMA_T::REQSEL12_15: REQSRC13 Position */ -#define PDMA_REQSEL12_15_REQSRC13_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC13_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC13 Mask */ - -#define PDMA_REQSEL12_15_REQSRC14_Pos (16) /*!< PDMA_T::REQSEL12_15: REQSRC14 Position */ -#define PDMA_REQSEL12_15_REQSRC14_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC14_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC14 Mask */ - -#define PDMA_REQSEL12_15_REQSRC15_Pos (24) /*!< PDMA_T::REQSEL12_15: REQSRC15 Position */ -#define PDMA_REQSEL12_15_REQSRC15_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC15_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC15 Mask */ - -#define PDMA_STCRn_STC_Pos (0) /*!< PDMA_T::STCRn: STC Position */ -#define PDMA_STCRn_STC_Msk (0xfffful << PDMA_STCRn_STC_Pos) /*!< PDMA_T::STCRn: STC Mask */ - -#define PDMA_ASOCRn_SASOL_Pos (0) /*!< PDMA_T::ASOCRn: SASOL Position */ -#define PDMA_ASOCRn_SASOL_Msk (0xfffful << PDMA_ASOCRn_SASOL_Pos) /*!< PDMA_T::ASOCRn: SASOL Mask */ - -#define PDMA_ASOCRn_DASOL_Pos (16) /*!< PDMA_T::ASOCRn: DASOL Position */ -#define PDMA_ASOCRn_DASOL_Msk (0xfffful << PDMA_ASOCRn_DASOL_Pos) /*!< PDMA_T::ASOCRn: DASOL Mask */ - -#define PDMA_RCNTn_RCNT_Pos (0) /*!< PDMA_T::RCNTn: RCNT Position */ -#define PDMA_RCNTn_RCNT_Msk (0xfffful << PDMA_STCRn_RCNT_Pos) /*!< PDMA_T::RCNTn: RCNT Mask */ - -#define PDMA_AICTLn_SAICNT_Pos (0) /*!< PDMA_T::AICTLn: SAICNT Position */ -#define PDMA_AICTLn_SAICNT_Msk (0xfffful << PDMA_ASOCRn_SASOL_Pos) /*!< PDMA_T::AICTLn: SAICNT Mask */ - -#define PDMA_AICTLn_DAICNT_Pos (16) /*!< PDMA_T::AICTLn: DAICNT Position */ -#define PDMA_AICTLn_DAICNT_Msk (0xfffful << PDMA_ASOCRn_DASOL_Pos) /*!< PDMA_T::AICTLn: DAICNT Mask */ - -/**@}*/ /* PDMA_CONST */ -/**@}*/ /* end of PDMA register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __PDMA_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qei_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qei_reg.h deleted file mode 100644 index 19de07545e2..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qei_reg.h +++ /dev/null @@ -1,315 +0,0 @@ -/**************************************************************************//** - * @file qei_reg.h - * @version V1.00 - * @brief QEI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __QEI_REG_H__ -#define __QEI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup QEI Quadrature Encoder Interface(QEI) - Memory Mapped Structure for QEI Controller -@{ */ - -typedef struct -{ - - - /** - * @var QEI_T::CNT - * Offset: 0x00 QEI Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |Quadrature Encoder Interface Counter - * | | |A 32-bit up/down counter - * | | |When an effective phase pulse is detected, this counter is increased by one if the bit DIRF (QEI_STATUS[8]) is one or decreased by one if the bit DIRF(QEI_STATUS[8]) is zero - * | | |This register performs an integrator which count value is proportional to the encoder position - * | | |The pulse counter may be initialized to a predetermined value by one of three events occurs: - * | | |1. Software is written if QEIEN (QEI_CTL[29]) = 0. - * | | |2. Compare-match event if QEIEN(QEI_CTL[29])=1 and QEI is in compare-counting mode. - * | | |3. Index signal change if QEIEN(QEI_CTL[29])=1 and IDXRLDEN (QEI_CTL[27])=1. - * @var QEI_T::CNTHOLD - * Offset: 0x04 QEI Counter Hold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTHOLD |Quadrature Encoder Interface Counter Hold - * | | |When bit HOLDCNT (QEI_CTL[24]) goes from low to high, the CNT(QEI_CNT[31:0]) is copied into CNTHOLD (QEI_CNTHOLD[31:0]) register. - * @var QEI_T::CNTLATCH - * Offset: 0x08 QEI Counter Index Latch Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTLATCH |Quadrature Encoder Interface Counter Index Latch - * | | |When the IDXF (QEI_STATUS[0]) bit is set, the CNT(QEI_CNT[31:0]) is copied into CNTLATCH (QEI_CNTLATCH[31:0]) register. - * @var QEI_T::CNTCMP - * Offset: 0x0C QEI Counter Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTCMP |Quadrature Encoder Interface Counter Compare - * | | |If the QEI controller is in the compare-counting mode CMPEN (QEI_CTL[28]) =1, when the value of CNT(QEI_CNT[31:0]) matches CNTCMP(QEI_CNTCMP[31:0]), CMPF will be set - * | | |This register is software writable. - * @var QEI_T::CNTMAX - * Offset: 0x14 QEI Pre-set Maximum Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNTMAX |Quadrature Encoder Interface Preset Maximum Count - * | | |This register value determined by user stores the maximum value which may be the number of the QEI counter for the QEI controller compare-counting mode - * @var QEI_T::CTL - * Offset: 0x18 QEI Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection - * | | |To determine the sampling frequency of the Noise Filter clock . - * | | |000 = QEI_CLK. - * | | |001 = QEI_CLK/2. - * | | |010 = QEI_CLK/4. - * | | |011 = QEI_CLK/16. - * | | |100 = QEI_CLK/32. - * | | |101 = QEI_CLK/64. - * |[3] |NFDIS |QEI Controller Input Noise Filter Disable Bit - * | | |0 = The noise filter of QEI controller Enabled. - * | | |1 = The noise filter of QEI controller Disabled. - * |[4] |CHAEN |QEA Input to QEI Controller Enable Bit - * | | |0 = QEA input to QEI Controller Disabled. - * | | |1 = QEA input to QEI Controller Enabled. - * |[5] |CHBEN |QEB Input to QEI Controller Enable Bit - * | | |0 = QEB input to QEI Controller Disabled. - * | | |1 = QEB input to QEI Controller Enabled. - * |[6] |IDXEN |IDX Input to QEI Controller Enable Bit - * | | |0 = IDX input to QEI Controller Disabled. - * | | |1 = IDX input to QEI Controller Enabled. - * |[9:8] |MODE |QEI Counting Mode Selection - * | | |There are four quadrature encoder pulse counter operation modes. - * | | |00 = X4 Free-counting Mode. - * | | |01 = X2 Free-counting Mode. - * | | |10 = X4 Compare-counting Mode. - * | | |11 = X2 Compare-counting Mode. - * |[12] |CHAINV |Inverse QEA Input Polarity - * | | |0 = Not inverse QEA input polarity. - * | | |1 = QEA input polarity is inversed to QEI controller. - * |[13] |CHBINV |Inverse QEB Input Polarity - * | | |0 = Not inverse QEB input polarity. - * | | |1 = QEB input polarity is inversed to QEI controller. - * |[14] |IDXINV |Inverse IDX Input Polarity - * | | |0 = Not inverse IDX input polarity. - * | | |1 = IDX input polarity is inversed to QEI controller. - * |[16] |OVUNIEN |OVUNF Trigger QEI Interrupt Enable Bit - * | | |0 = OVUNF can trigger QEI controller interrupt Disabled. - * | | |1 = OVUNF can trigger QEI controller interrupt Enabled. - * |[17] |DIRIEN |DIRCHGF Trigger QEI Interrupt Enable Bit - * | | |0 = DIRCHGF can trigger QEI controller interrupt Disabled. - * | | |1 = DIRCHGF can trigger QEI controller interrupt Enabled. - * |[18] |CMPIEN |CMPF Trigger QEI Interrupt Enable Bit - * | | |0 = CMPF can trigger QEI controller interrupt Disabled. - * | | |1 = CMPF can trigger QEI controller interrupt Enabled. - * |[19] |IDXIEN |IDXF Trigger QEI Interrupt Enable Bit - * | | |0 = The IDXF can trigger QEI interrupt Disabled. - * | | |1 = The IDXF can trigger QEI interrupt Enabled. - * |[20] |HOLDTMR0 |Hold QEI_CNT by Timer 0 - * | | |0 = TIF (TIMER0_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER0_INTSTS[0]) in timer 0 sets HOLDCNT to 1. - * |[21] |HOLDTMR1 |Hold QEI_CNT by Timer 1 - * | | |0 = TIF(TIMER1_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF (TIMER1_INTSTS[0]) in timer 1 sets HOLDCNT to 1. - * |[22] |HOLDTMR2 |Hold QEI_CNT by Timer 2 - * | | |0 = TIF(TIMER2_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER2_INTSTS[0]) in timer 2 sets HOLDCNT to 1. - * |[23] |HOLDTMR3 |Hold QEI_CNT by Timer 3 - * | | |0 = TIF (TIMER3_INTSTS[0]) has no effect on HOLDCNT. - * | | |1 = A rising edge of bit TIF(TIMER3_INTSTS[0]) in timer 3 sets HOLDCNT to 1. - * |[24] |HOLDCNT |Hold QEI_CNT Control - * | | |When this bit is set from low to high, the CNT(QEI_CNT[31:0]) is copied into CNTHOLD(QEI_CNTHOLD[31:0]) - * | | |This bit may be set by writing 1 to it or Timer0~Timer3 interrupt flag TIF (TIMERx_INTSTS[0]). - * | | |0 = No operation. - * | | |1 = QEI_CNT content is captured and stored in CNTHOLD(QEI_CNTHOLD[31:0]). - * | | |Note: This bit is automatically cleared after QEI_CNTHOLD holds QEI_CNT value. - * |[25] |IDXLATEN |Index Latch QEI_CNT Enable Bit - * | | |If this bit is set to high, the CNT(QEI_CNT[31:0]) content will be latched into CNTLATCH (QEI_CNTLATCH[31:0]) at every rising on signal CHX. - * | | |0 = The index signal latch QEI counter function Disabled. - * | | |1 = The index signal latch QEI counter function Enabled. - * |[27] |IDXRLDEN |Index Trigger QEI_CNT Reload Enable Bit - * | | |When this bit is high and a rising edge comes on signal CHX, the CNT(QEI_CNT[31:0]) will be reset to zero if the counter is in up-counting type (DIRF(QEI_STATUS[8]) = 1); while the CNT(QEI_CNT[31:0]) will be reloaded with CNTMAX (QEI_CNTMAX[31:0]) content if the counter is in down-counting type (DIRF(QEI_STATUS[8]) = 0). - * | | |0 = Reload function Disabled. - * | | |1 = QEI_CNT re-initialized by Index signal Enabled. - * |[28] |CMPEN |The Compare Function Enable Bit - * | | |The compare function in QEI controller is to compare the dynamic counting QEI_CNT with the compare register CNTCMP( QEI_CNTCMP[31:0]), if CNT(QEI_CNT[31:0]) reaches CNTCMP( QEI_CNTCMP[31:0]), the flag CMPF will be set. - * | | |0 = Compare function Disabled. - * | | |1 = Compare function Enabled. - * |[29] |QEIEN |Quadrature Encoder Interface Controller Enable Bit - * | | |0 = QEI controller function Disabled. - * | | |1 = QEI controller function Enabled. - * @var QEI_T::STATUS - * Offset: 0x2C QEI Controller Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IDXF |IDX Detected Flag - * | | |When the QEI controller detects a rising edge on signal CHX it will set flag IDXF to high. - * | | |0 = No rising edge detected on signal CHX. - * | | |1 = A rising edge occurs on signal CHX. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[1] |CMPF |Compare-match Flag - * | | |If the QEI compare function is enabled, the flag is set by hardware while QEI counter up or down counts and reach to the CNTCMP(QEI_CNTCMP[31:0]). - * | | |0 = QEI counter does not match with CNTCMP(QEI_CNTCMP[31:0]). - * | | |1 = QEI counter counts to the same as CNTCMP(QEI_CNTCMP[31:0]). - * | | |Note: This bit is only cleared by writing 1 to it. - * |[2] |OVUNF |QEI Counter Overflow or Underflow Flag - * | | |Flag is set by hardware while CNT(QEI_CNT[31:0]) overflows from 0xFFFF_FFFF to zero in free-counting mode or from the CNTMAX (QEI_CNTMAX[31:0]) to zero in compare-counting mode - * | | |Similarly, the flag is set while QEI counter underflows from zero to 0xFFFF_FFFF or CNTMAX (QEI_CNTMAX[31:0]). - * | | |0 = No overflow or underflow occurs in QEI counter. - * | | |1 = QEI counter occurs counting overflow or underflow. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[3] |DIRCHGF |Direction Change Flag - * | | |Flag is set by hardware while QEI counter counting direction is changed. - * | | |Software can clear this bit by writing 1 to it. - * | | |0 = No change in QEI counter counting direction. - * | | |1 = QEI counter counting direction is changed. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[8] |DIRF |QEI Counter Counting Direction Indication - * | | |0 = QEI Counter is in down-counting. - * | | |1 = QEI Counter is in up-counting. - * | | |Note: This bit is set/reset by hardware according to the phase detection between CHA and CHB. - */ - __IO uint32_t CNT; /*!< [0x0000] QEI Counter Register */ - __IO uint32_t CNTHOLD; /*!< [0x0004] QEI Counter Hold Register */ - __IO uint32_t CNTLATCH; /*!< [0x0008] QEI Counter Index Latch Register */ - __IO uint32_t CNTCMP; /*!< [0x000c] QEI Counter Compare Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CNTMAX; /*!< [0x0014] QEI Pre-set Maximum Count Register */ - __IO uint32_t CTL; /*!< [0x0018] QEI Controller Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[4]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t STATUS; /*!< [0x002c] QEI Controller Status Register */ - -} QEI_T; - -/** - @addtogroup QEI_CONST QEI Bit Field Definition - Constant Definitions for QEI Controller -@{ */ - -#define QEI_CNT_CNT_Pos (0) /*!< QEI_T::CNT: CNT Position */ -#define QEI_CNT_CNT_Msk (0xfffffffful << QEI_CNT_CNT_Pos) /*!< QEI_T::CNT: CNT Mask */ - -#define QEI_CNTHOLD_CNTHOLD_Pos (0) /*!< QEI_T::CNTHOLD: CNTHOLD Position */ -#define QEI_CNTHOLD_CNTHOLD_Msk (0xfffffffful << QEI_CNTHOLD_CNTHOLD_Pos) /*!< QEI_T::CNTHOLD: CNTHOLD Mask */ - -#define QEI_CNTLATCH_CNTLATCH_Pos (0) /*!< QEI_T::CNTLATCH: CNTLATCH Position */ -#define QEI_CNTLATCH_CNTLATCH_Msk (0xfffffffful << QEI_CNTLATCH_CNTLATCH_Pos) /*!< QEI_T::CNTLATCH: CNTLATCH Mask */ - -#define QEI_CNTCMP_CNTCMP_Pos (0) /*!< QEI_T::CNTCMP: CNTCMP Position */ -#define QEI_CNTCMP_CNTCMP_Msk (0xfffffffful << QEI_CNTCMP_CNTCMP_Pos) /*!< QEI_T::CNTCMP: CNTCMP Mask */ - -#define QEI_CNTMAX_CNTMAX_Pos (0) /*!< QEI_T::CNTMAX: CNTMAX Position */ -#define QEI_CNTMAX_CNTMAX_Msk (0xfffffffful << QEI_CNTMAX_CNTMAX_Pos) /*!< QEI_T::CNTMAX: CNTMAX Mask */ - -#define QEI_CTL_NFCLKSEL_Pos (0) /*!< QEI_T::CTL: NFCLKSEL Position */ -#define QEI_CTL_NFCLKSEL_Msk (0x7ul << QEI_CTL_NFCLKSEL_Pos) /*!< QEI_T::CTL: NFCLKSEL Mask */ - -#define QEI_CTL_NFDIS_Pos (3) /*!< QEI_T::CTL: NFDIS Position */ -#define QEI_CTL_NFDIS_Msk (0x1ul << QEI_CTL_NFDIS_Pos) /*!< QEI_T::CTL: NFDIS Mask */ - -#define QEI_CTL_CHAEN_Pos (4) /*!< QEI_T::CTL: CHAEN Position */ -#define QEI_CTL_CHAEN_Msk (0x1ul << QEI_CTL_CHAEN_Pos) /*!< QEI_T::CTL: CHAEN Mask */ - -#define QEI_CTL_CHBEN_Pos (5) /*!< QEI_T::CTL: CHBEN Position */ -#define QEI_CTL_CHBEN_Msk (0x1ul << QEI_CTL_CHBEN_Pos) /*!< QEI_T::CTL: CHBEN Mask */ - -#define QEI_CTL_IDXEN_Pos (6) /*!< QEI_T::CTL: IDXEN Position */ -#define QEI_CTL_IDXEN_Msk (0x1ul << QEI_CTL_IDXEN_Pos) /*!< QEI_T::CTL: IDXEN Mask */ - -#define QEI_CTL_MODE_Pos (8) /*!< QEI_T::CTL: MODE Position */ -#define QEI_CTL_MODE_Msk (0x3ul << QEI_CTL_MODE_Pos) /*!< QEI_T::CTL: MODE Mask */ - -#define QEI_CTL_CHAINV_Pos (12) /*!< QEI_T::CTL: CHAINV Position */ -#define QEI_CTL_CHAINV_Msk (0x1ul << QEI_CTL_CHAINV_Pos) /*!< QEI_T::CTL: CHAINV Mask */ - -#define QEI_CTL_CHBINV_Pos (13) /*!< QEI_T::CTL: CHBINV Position */ -#define QEI_CTL_CHBINV_Msk (0x1ul << QEI_CTL_CHBINV_Pos) /*!< QEI_T::CTL: CHBINV Mask */ - -#define QEI_CTL_IDXINV_Pos (14) /*!< QEI_T::CTL: IDXINV Position */ -#define QEI_CTL_IDXINV_Msk (0x1ul << QEI_CTL_IDXINV_Pos) /*!< QEI_T::CTL: IDXINV Mask */ - -#define QEI_CTL_OVUNIEN_Pos (16) /*!< QEI_T::CTL: OVUNIEN Position */ -#define QEI_CTL_OVUNIEN_Msk (0x1ul << QEI_CTL_OVUNIEN_Pos) /*!< QEI_T::CTL: OVUNIEN Mask */ - -#define QEI_CTL_DIRIEN_Pos (17) /*!< QEI_T::CTL: DIRIEN Position */ -#define QEI_CTL_DIRIEN_Msk (0x1ul << QEI_CTL_DIRIEN_Pos) /*!< QEI_T::CTL: DIRIEN Mask */ - -#define QEI_CTL_CMPIEN_Pos (18) /*!< QEI_T::CTL: CMPIEN Position */ -#define QEI_CTL_CMPIEN_Msk (0x1ul << QEI_CTL_CMPIEN_Pos) /*!< QEI_T::CTL: CMPIEN Mask */ - -#define QEI_CTL_IDXIEN_Pos (19) /*!< QEI_T::CTL: IDXIEN Position */ -#define QEI_CTL_IDXIEN_Msk (0x1ul << QEI_CTL_IDXIEN_Pos) /*!< QEI_T::CTL: IDXIEN Mask */ - -#define QEI_CTL_HOLDTMR0_Pos (20) /*!< QEI_T::CTL: HOLDTMR0 Position */ -#define QEI_CTL_HOLDTMR0_Msk (0x1ul << QEI_CTL_HOLDTMR0_Pos) /*!< QEI_T::CTL: HOLDTMR0 Mask */ - -#define QEI_CTL_HOLDTMR1_Pos (21) /*!< QEI_T::CTL: HOLDTMR1 Position */ -#define QEI_CTL_HOLDTMR1_Msk (0x1ul << QEI_CTL_HOLDTMR1_Pos) /*!< QEI_T::CTL: HOLDTMR1 Mask */ - -#define QEI_CTL_HOLDTMR2_Pos (22) /*!< QEI_T::CTL: HOLDTMR2 Position */ -#define QEI_CTL_HOLDTMR2_Msk (0x1ul << QEI_CTL_HOLDTMR2_Pos) /*!< QEI_T::CTL: HOLDTMR2 Mask */ - -#define QEI_CTL_HOLDTMR3_Pos (23) /*!< QEI_T::CTL: HOLDTMR3 Position */ -#define QEI_CTL_HOLDTMR3_Msk (0x1ul << QEI_CTL_HOLDTMR3_Pos) /*!< QEI_T::CTL: HOLDTMR3 Mask */ - -#define QEI_CTL_HOLDCNT_Pos (24) /*!< QEI_T::CTL: HOLDCNT Position */ -#define QEI_CTL_HOLDCNT_Msk (0x1ul << QEI_CTL_HOLDCNT_Pos) /*!< QEI_T::CTL: HOLDCNT Mask */ - -#define QEI_CTL_IDXLATEN_Pos (25) /*!< QEI_T::CTL: IDXLATEN Position */ -#define QEI_CTL_IDXLATEN_Msk (0x1ul << QEI_CTL_IDXLATEN_Pos) /*!< QEI_T::CTL: IDXLATEN Mask */ - -#define QEI_CTL_IDXRLDEN_Pos (27) /*!< QEI_T::CTL: IDXRLDEN Position */ -#define QEI_CTL_IDXRLDEN_Msk (0x1ul << QEI_CTL_IDXRLDEN_Pos) /*!< QEI_T::CTL: IDXRLDEN Mask */ - -#define QEI_CTL_CMPEN_Pos (28) /*!< QEI_T::CTL: CMPEN Position */ -#define QEI_CTL_CMPEN_Msk (0x1ul << QEI_CTL_CMPEN_Pos) /*!< QEI_T::CTL: CMPEN Mask */ - -#define QEI_CTL_QEIEN_Pos (29) /*!< QEI_T::CTL: QEIEN Position */ -#define QEI_CTL_QEIEN_Msk (0x1ul << QEI_CTL_QEIEN_Pos) /*!< QEI_T::CTL: QEIEN Mask */ - -#define QEI_STATUS_IDXF_Pos (0) /*!< QEI_T::STATUS: IDXF Position */ -#define QEI_STATUS_IDXF_Msk (0x1ul << QEI_STATUS_IDXF_Pos) /*!< QEI_T::STATUS: IDXF Mask */ - -#define QEI_STATUS_CMPF_Pos (1) /*!< QEI_T::STATUS: CMPF Position */ -#define QEI_STATUS_CMPF_Msk (0x1ul << QEI_STATUS_CMPF_Pos) /*!< QEI_T::STATUS: CMPF Mask */ - -#define QEI_STATUS_OVUNF_Pos (2) /*!< QEI_T::STATUS: OVUNF Position */ -#define QEI_STATUS_OVUNF_Msk (0x1ul << QEI_STATUS_OVUNF_Pos) /*!< QEI_T::STATUS: OVUNF Mask */ - -#define QEI_STATUS_DIRCHGF_Pos (3) /*!< QEI_T::STATUS: DIRCHGF Position */ -#define QEI_STATUS_DIRCHGF_Msk (0x1ul << QEI_STATUS_DIRCHGF_Pos) /*!< QEI_T::STATUS: DIRCHGF Mask */ - -#define QEI_STATUS_DIRF_Pos (8) /*!< QEI_T::STATUS: DIRF Position */ -#define QEI_STATUS_DIRF_Msk (0x1ul << QEI_STATUS_DIRF_Pos) /*!< QEI_T::STATUS: DIRF Mask */ - -/**@}*/ /* QEI_CONST */ -/**@}*/ /* end of QEI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __QEI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qspi_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qspi_reg.h deleted file mode 100644 index 890fe5c78de..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/qspi_reg.h +++ /dev/null @@ -1,592 +0,0 @@ -/**************************************************************************//** - * @file qspi_reg.h - * @version V1.00 - * @brief QSPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __QSPI_REG_H__ -#define __QSPI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup QSPI Serial Peripheral Interface Controller(QSPI) - Memory Mapped Structure for QSPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var QSPI_T::CTL - * Offset: 0x00 QSPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |QSPIEN |QSPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1 - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of QSPIx_CTL, QSPIx_CLKDIV, QSPIx_SSCTL and QSPIx_FIFOCTL registers, user shall clear the QSPIEN (QSPIx_CTL[0]) and confirm the QSPIENSTS (QSPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of QSPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of QSPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of QSPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of QSPI bus clock. - * |[3] |CLKPOL |Clock Polarity - * | | |0 = QSPI bus clock is idle low. - * | | |1 = QSPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval (Master Only) - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of QSPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 .... 0.5 QSPICLK clock cycle. - * | | |SUSPITV = 0x1 .... 1.5 QSPICLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE .... 14.5 QSPICLK clock cycle. - * | | |SUSPITV = 0xF .... 15.5 QSPICLK clock cycle. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 .... 8 bits. - * | | |DWIDTH = 0x09 .... 9 bits. - * | | |..... - * | | |DWIDTH = 0x1F .... 31 bits. - * | | |DWIDTH = 0x00 .... 32 bits. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the QSPI TX register, is sent first to the QSPI data output pin, and the first bit received from the QSPI data input pin will be put in the LSB position of the RX register (bit 0 of QSPI_RX). - * |[14] |HALFDPX |QSPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for QSPI transfer - * | | |The bit field DATDIR (QSPIx_CTL[20]) can be used to set the data direction in half-duplex transfer. - * | | |0 = QSPI operates in full-duplex transfer. - * | | |1 = QSPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only Mode Enable Bit (Master Only) - * | | |This bit field is only available in Master mode - * | | |In receive-only mode, QSPI Master will generate QSPI bus clock continuously for receiving data bit from QSPI slave device and assert the BUSY status. - * | | |0 = Receive-only mode Disabled. - * | | |1 = Receive-only mode Enabled. - * |[16] |TWOBIT |2-bit Transfer Mode Enable Bit (Only Supported in QSPI0) - * | | |0 = 2-Bit Transfer mode Disabled. - * | | |1 = 2-Bit Transfer mode Enabled. - * | | |Note: When 2-Bit Transfer mode is enabled, the first serial transmitted bit data is from the first FIFO buffer data, and the 2nd serial transmitted bit data is from the second FIFO buffer data - * | | |As the same as transmitted function, the first received bit data is stored into the first FIFO buffer and the 2nd received bit data is stored into the second FIFO buffer at the same time. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = QSPI unit transfer interrupt Disabled. - * | | |1 = QSPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled - * | | |A byte suspend interval will be inserted among each byte - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction in half-duplex transfer and Dual/Quad transfer - * | | |0 = QSPI data is input direction. - * | | |1 = QSPI data is output direction. - * |[21] |DUALIOEN |Dual I/O Mode Enable Bit (Only Supported in QSPI0) - * | | |0 = Dual I/O mode Disabled. - * | | |1 = Dual I/O mode Enabled. - * |[22] |QUADIOEN |Quad I/O Mode Enable Bit (Only Supported in QSPI0) - * | | |0 = Quad I/O mode Disabled. - * | | |1 = Quad I/O mode Enabled. - * @var QSPI_T::CLKDIV - * Offset: 0x04 QSPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the QSPI bus clock of QSPI Master - * | | |The frequency is obtained according to the following equation. - * | | |where - * | | |is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * @var QSPI_T::SSCTL - * Offset: 0x08 QSPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control (Master Only) - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = set the QSPIx_SS line to inactive state. - * | | |1 = set the QSPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the QSPIx_SS line at inactive state. - * | | |1 = QSPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time - * | | |The active state of QSPIx_SS is specified in SSACTPOL (QSPIx_SSCTL[2]). - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (QSPIx_SS). - * | | |0 = The slave selection signal QSPIx_SS is active low. - * | | |1 = The slave selection signal QSPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit (Master Only) - * | | |0 = Automatic slave selection function Disabled - * | | |Slave selection signal will be asserted/de-asserted according to SS (QSPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * |[4] |SLV3WIRE |Slave 3-wire Mode Enable Bit (Only Supported in QSPI0) - * | | |Slave 3-wire mode is only available in QSPI0 - * | | |In Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPI0_CLK, QSPI0_MISO and QSPI0_MOSI pins. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[5] |SLVTOIEN |Slave Mode Time-out Interrupt Enable Bit (Only Supported in QSPI0) - * | | |0 = Slave mode time-out interrupt Disabled. - * | | |1 = Slave mode time-out interrupt Enabled. - * |[6] |SLVTORST |Slave Mode Time-out Reset Control (Only Supported in QSPI0) - * | | |0 = When Slave mode time-out event occurs, the TX and RX control circuit will not be reset. - * | | |1 = When Slave mode time-out event occurs, the TX and RX control circuit will be reset by hardware. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * |[31:16] |SLVTOCNT |Slave Mode Time-out Period (Only Supported in QSPI0) - * | | |In Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active - * | | |The clock source of the time-out counter is Slave peripheral clock - * | | |If the value is 0, it indicates the slave mode time-out function is disabled. - * @var QSPI_T::PDMACTL - * Offset: 0x0C QSPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In QSPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the QSPI controller. This bit will be automatically cleared to 0. - * @var QSPI_T::FIFOCTL - * Offset: 0x10 QSPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * | | |Note: If TX underflow event occurs in QSPI Slave mode, this bit can be used to make QSPI return to idle state. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Slave Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The QSPI data out is keep 0 if there is TX underflow event in Slave mode. - * | | |1 = The QSPI data out is keep 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is no any data in TX FIFO when the slave selection signal is active. - * | | |2. When TX underflow event occurs, QSPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward - * | | |Data stored in TX FIFO will be sent through QSPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |When TX underflow event occurs in Slave mode, TXUFIF (QSPIx_STATUS[19]) will be set to 1 - * | | |This bit is used to enable the TX underflow interrupt. - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[26:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0 - * |[30:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0 - * @var QSPI_T::STATUS - * Offset: 0x14 QSPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = QSPI controller is in idle state. - * | | |1 = QSPI controller is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. QSPIx_CTL[0] = 1 and TXEMPTY = 0. - * | | |b - * | | |For QSPI Master mode, QSPIx_CTL[0] = 1 and TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For QSPI Master mode, QSPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d - * | | |For QSPI Slave mode, the QSPIx_CTL[0] = 1 and there is serial clock input into the QSPI core logic when slave select is active. - * | | |For QSPI Slave mode, the QSPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = QSPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode - * | | |If SSACTPOL (QSPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the QSPI slave select is in inactive status. - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag (Only Supported in QSPI0) - * | | |When the slave select is active and the value of SLVTOCNT is not 0, as the bus clock is detected, the slave time-out counter in QSPI controller logic will be started - * | | |When the value of time-out counter is greater than or equal to the value of SLVTOCNT (QSPI_SSCTL[31:16]) before one transaction is done, the slave time-out interrupt event will be asserted. - * | | |0 = Slave time-out is not active. - * | | |1 = Slave time-out is active. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBEIF also active when the slave select goes to inactive state - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is overrun. - * | | |1 = Receive FIFO is overrun. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 QSPI peripheral clock periods in Master mode or over 576 QSPI peripheral clock periods in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |QSPIENSTS |QSPI Enable Status (Read Only) - * | | |0 = The QSPI controller is disabled. - * | | |1 = The QSPI controller is enabled. - * | | |Note: The QSPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the QSPI control logic is disabled, this bit indicates the real status of QSPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slave's transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var QSPI_T::TX - * Offset: 0x20 QSPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 4-level transmit FIFO buffers - * | | |The number of valid bits depends on the setting of DWIDTH (QSPIx_CTL[12:8]) in SPI mode. - * | | |In SPI mode, if DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted - * | | |If DWIDTH is set to 0x00 , the QSPI controller will perform a 32-bit transfer. - * | | |If WDWIDTH is set as 0x0, 0x1, or 0x3, all bits of this field are valid - * | | |Note: In Master mode, QSPI controller will start to transfer the QSPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var QSPI_T::RX - * Offset: 0x30 QSPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register - * | | |There are 4-level FIFO buffers in this controller - * | | |The data receive register holds the data received from QSPI data input pin - * | | |This is a read only register. - */ - __IO uint32_t CTL; /*!< [0x0000] QSPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] QSPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] QSPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] QSPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] QSPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] QSPI Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __O uint32_t TX; /*!< [0x0020] QSPI Data Transmit Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t RX; /*!< [0x0030] QSPI Data Receive Register */ - -} QSPI_T; - -/** - @addtogroup QSPI_CONST QSPI Bit Field Definition - Constant Definitions for QSPI Controller -@{ */ - -#define QSPI_CTL_QSPIEN_Pos (0) /*!< QSPI_T::CTL: QSPIEN Position */ -#define QSPI_CTL_QSPIEN_Msk (0x1ul << QSPI_CTL_QSPIEN_Pos) /*!< QSPI_T::CTL: QSPIEN Mask */ - -#define QSPI_CTL_RXNEG_Pos (1) /*!< QSPI_T::CTL: RXNEG Position */ -#define QSPI_CTL_RXNEG_Msk (0x1ul << QSPI_CTL_RXNEG_Pos) /*!< QSPI_T::CTL: RXNEG Mask */ - -#define QSPI_CTL_TXNEG_Pos (2) /*!< QSPI_T::CTL: TXNEG Position */ -#define QSPI_CTL_TXNEG_Msk (0x1ul << QSPI_CTL_TXNEG_Pos) /*!< QSPI_T::CTL: TXNEG Mask */ - -#define QSPI_CTL_CLKPOL_Pos (3) /*!< QSPI_T::CTL: CLKPOL Position */ -#define QSPI_CTL_CLKPOL_Msk (0x1ul << QSPI_CTL_CLKPOL_Pos) /*!< QSPI_T::CTL: CLKPOL Mask */ - -#define QSPI_CTL_SUSPITV_Pos (4) /*!< QSPI_T::CTL: SUSPITV Position */ -#define QSPI_CTL_SUSPITV_Msk (0xful << QSPI_CTL_SUSPITV_Pos) /*!< QSPI_T::CTL: SUSPITV Mask */ - -#define QSPI_CTL_DWIDTH_Pos (8) /*!< QSPI_T::CTL: DWIDTH Position */ -#define QSPI_CTL_DWIDTH_Msk (0x1ful << QSPI_CTL_DWIDTH_Pos) /*!< QSPI_T::CTL: DWIDTH Mask */ - -#define QSPI_CTL_LSB_Pos (13) /*!< QSPI_T::CTL: LSB Position */ -#define QSPI_CTL_LSB_Msk (0x1ul << QSPI_CTL_LSB_Pos) /*!< QSPI_T::CTL: LSB Mask */ - -#define QSPI_CTL_HALFDPX_Pos (14) /*!< QSPI_T::CTL: HALFDPX Position */ -#define QSPI_CTL_HALFDPX_Msk (0x1ul << QSPI_CTL_HALFDPX_Pos) /*!< QSPI_T::CTL: HALFDPX Mask */ - -#define QSPI_CTL_RXONLY_Pos (15) /*!< QSPI_T::CTL: RXONLY Position */ -#define QSPI_CTL_RXONLY_Msk (0x1ul << QSPI_CTL_RXONLY_Pos) /*!< QSPI_T::CTL: RXONLY Mask */ - -#define QSPI_CTL_TWOBIT_Pos (16) /*!< QSPI_T::CTL: TWOBIT Position */ -#define QSPI_CTL_TWOBIT_Msk (0x1ul << QSPI_CTL_TWOBIT_Pos) /*!< QSPI_T::CTL: TWOBIT Mask */ - -#define QSPI_CTL_UNITIEN_Pos (17) /*!< QSPI_T::CTL: UNITIEN Position */ -#define QSPI_CTL_UNITIEN_Msk (0x1ul << QSPI_CTL_UNITIEN_Pos) /*!< QSPI_T::CTL: UNITIEN Mask */ - -#define QSPI_CTL_SLAVE_Pos (18) /*!< QSPI_T::CTL: SLAVE Position */ -#define QSPI_CTL_SLAVE_Msk (0x1ul << QSPI_CTL_SLAVE_Pos) /*!< QSPI_T::CTL: SLAVE Mask */ - -#define QSPI_CTL_REORDER_Pos (19) /*!< QSPI_T::CTL: REORDER Position */ -#define QSPI_CTL_REORDER_Msk (0x1ul << QSPI_CTL_REORDER_Pos) /*!< QSPI_T::CTL: REORDER Mask */ - -#define QSPI_CTL_DATDIR_Pos (20) /*!< QSPI_T::CTL: DATDIR Position */ -#define QSPI_CTL_DATDIR_Msk (0x1ul << QSPI_CTL_DATDIR_Pos) /*!< QSPI_T::CTL: DATDIR Mask */ - -#define QSPI_CTL_DUALIOEN_Pos (21) /*!< QSPI_T::CTL: DUALIOEN Position */ -#define QSPI_CTL_DUALIOEN_Msk (0x1ul << QSPI_CTL_DUALIOEN_Pos) /*!< QSPI_T::CTL: DUALIOEN Mask */ - -#define QSPI_CTL_QUADIOEN_Pos (22) /*!< QSPI_T::CTL: QUADIOEN Position */ -#define QSPI_CTL_QUADIOEN_Msk (0x1ul << QSPI_CTL_QUADIOEN_Pos) /*!< QSPI_T::CTL: QUADIOEN Mask */ - -#define QSPI_CLKDIV_DIVIDER_Pos (0) /*!< QSPI_T::CLKDIV: DIVIDER Position */ -#define QSPI_CLKDIV_DIVIDER_Msk (0x1fful << QSPI_CLKDIV_DIVIDER_Pos) /*!< QSPI_T::CLKDIV: DIVIDER Mask */ - -#define QSPI_SSCTL_SS_Pos (0) /*!< QSPI_T::SSCTL: SS Position */ -#define QSPI_SSCTL_SS_Msk (0x1ul << QSPI_SSCTL_SS_Pos) /*!< QSPI_T::SSCTL: SS Mask */ - -#define QSPI_SSCTL_SSACTPOL_Pos (2) /*!< QSPI_T::SSCTL: SSACTPOL Position */ -#define QSPI_SSCTL_SSACTPOL_Msk (0x1ul << QSPI_SSCTL_SSACTPOL_Pos) /*!< QSPI_T::SSCTL: SSACTPOL Mask */ - -#define QSPI_SSCTL_AUTOSS_Pos (3) /*!< QSPI_T::SSCTL: AUTOSS Position */ -#define QSPI_SSCTL_AUTOSS_Msk (0x1ul << QSPI_SSCTL_AUTOSS_Pos) /*!< QSPI_T::SSCTL: AUTOSS Mask */ - -#define QSPI_SSCTL_SLV3WIRE_Pos (4) /*!< QSPI_T::SSCTL: SLV3WIRE Position */ -#define QSPI_SSCTL_SLV3WIRE_Msk (0x1ul << QSPI_SSCTL_SLV3WIRE_Pos) /*!< QSPI_T::SSCTL: SLV3WIRE Mask */ - -#define QSPI_SSCTL_SLVTOIEN_Pos (5) /*!< QSPI_T::SSCTL: SLVTOIEN Position */ -#define QSPI_SSCTL_SLVTOIEN_Msk (0x1ul << QSPI_SSCTL_SLVTOIEN_Pos) /*!< QSPI_T::SSCTL: SLVTOIEN Mask */ - -#define QSPI_SSCTL_SLVTORST_Pos (6) /*!< QSPI_T::SSCTL: SLVTORST Position */ -#define QSPI_SSCTL_SLVTORST_Msk (0x1ul << QSPI_SSCTL_SLVTORST_Pos) /*!< QSPI_T::SSCTL: SLVTORST Mask */ - -#define QSPI_SSCTL_SLVBEIEN_Pos (8) /*!< QSPI_T::SSCTL: SLVBEIEN Position */ -#define QSPI_SSCTL_SLVBEIEN_Msk (0x1ul << QSPI_SSCTL_SLVBEIEN_Pos) /*!< QSPI_T::SSCTL: SLVBEIEN Mask */ - -#define QSPI_SSCTL_SLVURIEN_Pos (9) /*!< QSPI_T::SSCTL: SLVURIEN Position */ -#define QSPI_SSCTL_SLVURIEN_Msk (0x1ul << QSPI_SSCTL_SLVURIEN_Pos) /*!< QSPI_T::SSCTL: SLVURIEN Mask */ - -#define QSPI_SSCTL_SSACTIEN_Pos (12) /*!< QSPI_T::SSCTL: SSACTIEN Position */ -#define QSPI_SSCTL_SSACTIEN_Msk (0x1ul << QSPI_SSCTL_SSACTIEN_Pos) /*!< QSPI_T::SSCTL: SSACTIEN Mask */ - -#define QSPI_SSCTL_SSINAIEN_Pos (13) /*!< QSPI_T::SSCTL: SSINAIEN Position */ -#define QSPI_SSCTL_SSINAIEN_Msk (0x1ul << QSPI_SSCTL_SSINAIEN_Pos) /*!< QSPI_T::SSCTL: SSINAIEN Mask */ - -#define QSPI_SSCTL_SLVTOCNT_Pos (16) /*!< QSPI_T::SSCTL: SLVTOCNT Position */ -#define QSPI_SSCTL_SLVTOCNT_Msk (0xfffful << QSPI_SSCTL_SLVTOCNT_Pos) /*!< QSPI_T::SSCTL: SLVTOCNT Mask */ - -#define QSPI_PDMACTL_TXPDMAEN_Pos (0) /*!< QSPI_T::PDMACTL: TXPDMAEN Position */ -#define QSPI_PDMACTL_TXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_TXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: TXPDMAEN Mask */ - -#define QSPI_PDMACTL_RXPDMAEN_Pos (1) /*!< QSPI_T::PDMACTL: RXPDMAEN Position */ -#define QSPI_PDMACTL_RXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_RXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: RXPDMAEN Mask */ - -#define QSPI_PDMACTL_PDMARST_Pos (2) /*!< QSPI_T::PDMACTL: PDMARST Position */ -#define QSPI_PDMACTL_PDMARST_Msk (0x1ul << QSPI_PDMACTL_PDMARST_Pos) /*!< QSPI_T::PDMACTL: PDMARST Mask */ - -#define QSPI_FIFOCTL_RXRST_Pos (0) /*!< QSPI_T::FIFOCTL: RXRST Position */ -#define QSPI_FIFOCTL_RXRST_Msk (0x1ul << QSPI_FIFOCTL_RXRST_Pos) /*!< QSPI_T::FIFOCTL: RXRST Mask */ - -#define QSPI_FIFOCTL_TXRST_Pos (1) /*!< QSPI_T::FIFOCTL: TXRST Position */ -#define QSPI_FIFOCTL_TXRST_Msk (0x1ul << QSPI_FIFOCTL_TXRST_Pos) /*!< QSPI_T::FIFOCTL: TXRST Mask */ - -#define QSPI_FIFOCTL_RXTHIEN_Pos (2) /*!< QSPI_T::FIFOCTL: RXTHIEN Position */ -#define QSPI_FIFOCTL_RXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTHIEN Mask */ - -#define QSPI_FIFOCTL_TXTHIEN_Pos (3) /*!< QSPI_T::FIFOCTL: TXTHIEN Position */ -#define QSPI_FIFOCTL_TXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_TXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: TXTHIEN Mask */ - -#define QSPI_FIFOCTL_RXTOIEN_Pos (4) /*!< QSPI_T::FIFOCTL: RXTOIEN Position */ -#define QSPI_FIFOCTL_RXTOIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTOIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTOIEN Mask */ - -#define QSPI_FIFOCTL_RXOVIEN_Pos (5) /*!< QSPI_T::FIFOCTL: RXOVIEN Position */ -#define QSPI_FIFOCTL_RXOVIEN_Msk (0x1ul << QSPI_FIFOCTL_RXOVIEN_Pos) /*!< QSPI_T::FIFOCTL: RXOVIEN Mask */ - -#define QSPI_FIFOCTL_TXUFPOL_Pos (6) /*!< QSPI_T::FIFOCTL: TXUFPOL Position */ -#define QSPI_FIFOCTL_TXUFPOL_Msk (0x1ul << QSPI_FIFOCTL_TXUFPOL_Pos) /*!< QSPI_T::FIFOCTL: TXUFPOL Mask */ - -#define QSPI_FIFOCTL_TXUFIEN_Pos (7) /*!< QSPI_T::FIFOCTL: TXUFIEN Position */ -#define QSPI_FIFOCTL_TXUFIEN_Msk (0x1ul << QSPI_FIFOCTL_TXUFIEN_Pos) /*!< QSPI_T::FIFOCTL: TXUFIEN Mask */ - -#define QSPI_FIFOCTL_RXFBCLR_Pos (8) /*!< QSPI_T::FIFOCTL: RXFBCLR Position */ -#define QSPI_FIFOCTL_RXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_RXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: RXFBCLR Mask */ - -#define QSPI_FIFOCTL_TXFBCLR_Pos (9) /*!< QSPI_T::FIFOCTL: TXFBCLR Position */ -#define QSPI_FIFOCTL_TXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_TXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: TXFBCLR Mask */ - -#define QSPI_FIFOCTL_RXTH_Pos (24) /*!< QSPI_T::FIFOCTL: RXTH Position */ -#define QSPI_FIFOCTL_RXTH_Msk (0x7ul << QSPI_FIFOCTL_RXTH_Pos) /*!< QSPI_T::FIFOCTL: RXTH Mask */ - -#define QSPI_FIFOCTL_TXTH_Pos (28) /*!< QSPI_T::FIFOCTL: TXTH Position */ -#define QSPI_FIFOCTL_TXTH_Msk (0x7ul << QSPI_FIFOCTL_TXTH_Pos) /*!< QSPI_T::FIFOCTL: TXTH Mask */ - -#define QSPI_STATUS_BUSY_Pos (0) /*!< QSPI_T::STATUS: BUSY Position */ -#define QSPI_STATUS_BUSY_Msk (0x1ul << QSPI_STATUS_BUSY_Pos) /*!< QSPI_T::STATUS: BUSY Mask */ - -#define QSPI_STATUS_UNITIF_Pos (1) /*!< QSPI_T::STATUS: UNITIF Position */ -#define QSPI_STATUS_UNITIF_Msk (0x1ul << QSPI_STATUS_UNITIF_Pos) /*!< QSPI_T::STATUS: UNITIF Mask */ - -#define QSPI_STATUS_SSACTIF_Pos (2) /*!< QSPI_T::STATUS: SSACTIF Position */ -#define QSPI_STATUS_SSACTIF_Msk (0x1ul << QSPI_STATUS_SSACTIF_Pos) /*!< QSPI_T::STATUS: SSACTIF Mask */ - -#define QSPI_STATUS_SSINAIF_Pos (3) /*!< QSPI_T::STATUS: SSINAIF Position */ -#define QSPI_STATUS_SSINAIF_Msk (0x1ul << QSPI_STATUS_SSINAIF_Pos) /*!< QSPI_T::STATUS: SSINAIF Mask */ - -#define QSPI_STATUS_SSLINE_Pos (4) /*!< QSPI_T::STATUS: SSLINE Position */ -#define QSPI_STATUS_SSLINE_Msk (0x1ul << QSPI_STATUS_SSLINE_Pos) /*!< QSPI_T::STATUS: SSLINE Mask */ - -#define QSPI_STATUS_SLVTOIF_Pos (5) /*!< QSPI_T::STATUS: SLVTOIF Position */ -#define QSPI_STATUS_SLVTOIF_Msk (0x1ul << QSPI_STATUS_SLVTOIF_Pos) /*!< QSPI_T::STATUS: SLVTOIF Mask */ - -#define QSPI_STATUS_SLVBEIF_Pos (6) /*!< QSPI_T::STATUS: SLVBEIF Position */ -#define QSPI_STATUS_SLVBEIF_Msk (0x1ul << QSPI_STATUS_SLVBEIF_Pos) /*!< QSPI_T::STATUS: SLVBEIF Mask */ - -#define QSPI_STATUS_SLVURIF_Pos (7) /*!< QSPI_T::STATUS: SLVURIF Position */ -#define QSPI_STATUS_SLVURIF_Msk (0x1ul << QSPI_STATUS_SLVURIF_Pos) /*!< QSPI_T::STATUS: SLVURIF Mask */ - -#define QSPI_STATUS_RXEMPTY_Pos (8) /*!< QSPI_T::STATUS: RXEMPTY Position */ -#define QSPI_STATUS_RXEMPTY_Msk (0x1ul << QSPI_STATUS_RXEMPTY_Pos) /*!< QSPI_T::STATUS: RXEMPTY Mask */ - -#define QSPI_STATUS_RXFULL_Pos (9) /*!< QSPI_T::STATUS: RXFULL Position */ -#define QSPI_STATUS_RXFULL_Msk (0x1ul << QSPI_STATUS_RXFULL_Pos) /*!< QSPI_T::STATUS: RXFULL Mask */ - -#define QSPI_STATUS_RXTHIF_Pos (10) /*!< QSPI_T::STATUS: RXTHIF Position */ -#define QSPI_STATUS_RXTHIF_Msk (0x1ul << QSPI_STATUS_RXTHIF_Pos) /*!< QSPI_T::STATUS: RXTHIF Mask */ - -#define QSPI_STATUS_RXOVIF_Pos (11) /*!< QSPI_T::STATUS: RXOVIF Position */ -#define QSPI_STATUS_RXOVIF_Msk (0x1ul << QSPI_STATUS_RXOVIF_Pos) /*!< QSPI_T::STATUS: RXOVIF Mask */ - -#define QSPI_STATUS_RXTOIF_Pos (12) /*!< QSPI_T::STATUS: RXTOIF Position */ -#define QSPI_STATUS_RXTOIF_Msk (0x1ul << QSPI_STATUS_RXTOIF_Pos) /*!< QSPI_T::STATUS: RXTOIF Mask */ - -#define QSPI_STATUS_QSPIENSTS_Pos (15) /*!< QSPI_T::STATUS: QSPIENSTS Position */ -#define QSPI_STATUS_QSPIENSTS_Msk (0x1ul << QSPI_STATUS_QSPIENSTS_Pos) /*!< QSPI_T::STATUS: QSPIENSTS Mask */ - -#define QSPI_STATUS_TXEMPTY_Pos (16) /*!< QSPI_T::STATUS: TXEMPTY Position */ -#define QSPI_STATUS_TXEMPTY_Msk (0x1ul << QSPI_STATUS_TXEMPTY_Pos) /*!< QSPI_T::STATUS: TXEMPTY Mask */ - -#define QSPI_STATUS_TXFULL_Pos (17) /*!< QSPI_T::STATUS: TXFULL Position */ -#define QSPI_STATUS_TXFULL_Msk (0x1ul << QSPI_STATUS_TXFULL_Pos) /*!< QSPI_T::STATUS: TXFULL Mask */ - -#define QSPI_STATUS_TXTHIF_Pos (18) /*!< QSPI_T::STATUS: TXTHIF Position */ -#define QSPI_STATUS_TXTHIF_Msk (0x1ul << QSPI_STATUS_TXTHIF_Pos) /*!< QSPI_T::STATUS: TXTHIF Mask */ - -#define QSPI_STATUS_TXUFIF_Pos (19) /*!< QSPI_T::STATUS: TXUFIF Position */ -#define QSPI_STATUS_TXUFIF_Msk (0x1ul << QSPI_STATUS_TXUFIF_Pos) /*!< QSPI_T::STATUS: TXUFIF Mask */ - -#define QSPI_STATUS_TXRXRST_Pos (23) /*!< QSPI_T::STATUS: TXRXRST Position */ -#define QSPI_STATUS_TXRXRST_Msk (0x1ul << QSPI_STATUS_TXRXRST_Pos) /*!< QSPI_T::STATUS: TXRXRST Mask */ - -#define QSPI_STATUS_RXCNT_Pos (24) /*!< QSPI_T::STATUS: RXCNT Position */ -#define QSPI_STATUS_RXCNT_Msk (0xful << QSPI_STATUS_RXCNT_Pos) /*!< QSPI_T::STATUS: RXCNT Mask */ - -#define QSPI_STATUS_TXCNT_Pos (28) /*!< QSPI_T::STATUS: TXCNT Position */ -#define QSPI_STATUS_TXCNT_Msk (0xful << QSPI_STATUS_TXCNT_Pos) /*!< QSPI_T::STATUS: TXCNT Mask */ - -#define QSPI_TX_TX_Pos (0) /*!< QSPI_T::TX: TX Position */ -#define QSPI_TX_TX_Msk (0xfffffffful << QSPI_TX_TX_Pos) /*!< QSPI_T::TX: TX Mask */ - -#define QSPI_RX_RX_Pos (0) /*!< QSPI_T::RX: RX Position */ -#define QSPI_RX_RX_Msk (0xfffffffful << QSPI_RX_RX_Pos) /*!< QSPI_T::RX: RX Mask */ - - -/**@}*/ /* QSPI_CONST */ -/**@}*/ /* end of QSPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __QSPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/rtc_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/rtc_reg.h deleted file mode 100644 index 644d8e48566..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/rtc_reg.h +++ /dev/null @@ -1,1274 +0,0 @@ -/**************************************************************************//** - * @file rtc_reg.h - * @version V1.00 - * @brief RTC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __RTC_REG_H__ -#define __RTC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup RTC Real Time Clock Controller(RTC) - Memory Mapped Structure for RTC Controller -@{ */ - -typedef struct -{ - - - /** - * @var RTC_T::INIT - * Offset: 0x00 RTC Initiation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INIT_ACTIVE|RTC Active Status (Read Only) - * | | |0 = RTC is at reset state. - * | | |1 = RTC is at normal active state. - * |[31:1] |INIT |RTC Initiation (Write Only) - * | | |When RTC block is powered on, RTC is at reset state - * | | |User has to write a number (0xa5eb1357) to INIT to make RTC leaving reset state - * | | |Once the INIT is written as 0xa5eb1357, the RTC will be in un-reset state permanently. - * | | |The INIT is a write-only field and read value will be always 0. - * @var RTC_T::RWEN - * Offset: 0x04 RTC Access Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16] |RWENF |RTC Register Access Enable Flag (Read Only) - * | | |0 = RTC register read/write Disabled. - * | | |1 = RTC register read/write Enabled. - * | | |Note: RWENF will be mask to 0 during RTCBUSY is 1, and first turn on RTCCKEN (CLK_APBCLK[1]) also. - * |[24] |RTCBUSY |RTC Write Busy Flag - * | | |This bit indicates RTC registers are writable or not. - * | | |0: RTC registers are writable. - * | | |1: RTC registers can't write, RTC under Busy Status. - * | | |Note: RTCBUSY flag will be set when execute write RTC register command exceed 6 times within 1120 PCLK cycles. - * @var RTC_T::FREQADJ - * Offset: 0x08 RTC Frequency Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[21:0] |FREQADJ |Frequency Compensation Register (M480) - * | | |User must to get actual LXT frequency for RTC application. - * | | |FCR = 0x200000 * (32768 / LXT frequency). - * | | |Note: This formula is suitable only when RTC clock source is from LXT, RTCSEL (CLK_CLKSEL3[8]) is 0. - * |[5:0] |FRACTION |Fraction Part (M480LD) - * | | |Formula: FRACTION = (fraction part of detected value) X 64. - * | | |Note: Digit in FCR must be expressed as hexadecimal number. - * |[12:8] |INTEGER |Integer Part (M480LD) - * | | |00000 = Integer part of detected value is 32752. - * | | |00001 = Integer part of detected value is 32753. - * | | |00010 = Integer part of detected value is 32754. - * | | |00011 = Integer part of detected value is 32755. - * | | |00100 = Integer part of detected value is 32756. - * | | |00101 = Integer part of detected value is 32757. - * | | |00110 = Integer part of detected value is 32758. - * | | |00111 = Integer part of detected value is 32759. - * | | |01000 = Integer part of detected value is 32760. - * | | |01001 = Integer part of detected value is 32761. - * | | |01010 = Integer part of detected value is 32762. - * | | |01011 = Integer part of detected value is 32763. - * | | |01100 = Integer part of detected value is 32764. - * | | |01101 = Integer part of detected value is 32765. - * | | |01110 = Integer part of detected value is 32766. - * | | |01111 = Integer part of detected value is 32767. - * | | |10000 = Integer part of detected value is 32768. - * | | |10001 = Integer part of detected value is 32769. - * | | |10010 = Integer part of detected value is 32770. - * | | |10011 = Integer part of detected value is 32771. - * | | |10100 = Integer part of detected value is 32772. - * | | |10101 = Integer part of detected value is 32773. - * | | |10110 = Integer part of detected value is 32774. - * | | |10111 = Integer part of detected value is 32775. - * | | |11000 = Integer part of detected value is 32776. - * | | |11001 = Integer part of detected value is 32777. - * | | |11010 = Integer part of detected value is 32778. - * | | |11011 = Integer part of detected value is 32779. - * | | |11100 = Integer part of detected value is 32780. - * | | |11101 = Integer part of detected value is 32781. - * | | |11110 = Integer part of detected value is 32782. - * | | |11111 = Integer part of detected value is 32783. - * |[31] |FCR_BUSY |Frequency Compensation Register Write Operation Busy (Read Only) (M480LD) - * | | |0 = The new register write operation is acceptable. - * | | |1 = The last write operation is in progress and new register write operation prohibited. - * | | |Note: This bit is only used when DYN_COMP_EN(RTC_CLKFMT[16]) enabled. - * @var RTC_T::TIME - * Offset: 0x0C RTC Time Loading Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit (0~5) - * |[11:8] |MIN |1-Min Time Digit (0~9) - * |[14:12] |TENMIN |10-Min Time Digit (0~5) - * |[19:16] |HR |1-Hour Time Digit (0~9) - * |[21:20] |TENHR |10-Hour Time Digit (0~2) - * | | |When RTC runs as 12-hour time scale mode, RTC_TIME[21] (the high bit of TENHR[1:0]) means AM/PM indication - * | | |(If RTC_TIME[21] is 1, it indicates PM time message). - * @var RTC_T::CAL - * Offset: 0x10 RTC Calendar Loading Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit (0~3) - * |[11:8] |MON |1-Month Calendar Digit (0~9) - * |[12] |TENMON |10-Month Calendar Digit (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit (0~9) - * @var RTC_T::CLKFMT - * Offset: 0x14 RTC Time Scale Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |24HEN |24-hour / 12-hour Time Scale Selection - * | | |Indicates that RTC_TIME and RTC_TALM are in 24-hour time scale or 12-hour time scale - * | | |0 = 12-hour time scale with AM and PM indication selected. - * | | |1 = 24-hour time scale selected. - * @var RTC_T::WEEKDAY - * Offset: 0x18 RTC Day of the Week Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |WEEKDAY |Day of the Week Register - * | | |000 = Sunday. - * | | |001 = Monday. - * | | |010 = Tuesday. - * | | |011 = Wednesday. - * | | |100 = Thursday. - * | | |101 = Friday. - * | | |110 = Saturday. - * | | |111 = Reserved. - * @var RTC_T::TALM - * Offset: 0x1C RTC Time Alarm Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit of Alarm Setting (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit of Alarm Setting (0~5) - * |[11:8] |MIN |1-Min Time Digit of Alarm Setting (0~9) - * |[14:12] |TENMIN |10-Min Time Digit of Alarm Setting (0~5) - * |[19:16] |HR |1-Hour Time Digit of Alarm Setting (0~9) - * |[21:20] |TENHR |10-Hour Time Digit of Alarm Setting (0~2) - * | | |When RTC runs as 12-hour time scale mode, RTC_TIME[21] (the high bit of TENHR[1:0]) means AM/PM indication - * | | |(If RTC_TIME[21] is 1, it indicates PM time message). - * @var RTC_T::CALM - * Offset: 0x20 RTC Calendar Alarm Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit of Alarm Setting (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit of Alarm Setting (0~3) - * |[11:8] |MON |1-Month Calendar Digit of Alarm Setting (0~9) - * |[12] |TENMON |10-Month Calendar Digit of Alarm Setting (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit of Alarm Setting (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit of Alarm Setting (0~9) - * @var RTC_T::LEAPYEAR - * Offset: 0x24 RTC Leap Year Indicator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LEAPYEAR |Leap Year Indication Register (Read Only) - * | | |0 = This year is not a leap year. - * | | |1 = This year is leap year. - * @var RTC_T::INTEN - * Offset: 0x28 RTC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALMIEN |Alarm Interrupt Enable Bit - * | | |Set ALMIEN to 1 can also enable chip wake-up function when RTC alarm interrupt event is generated. - * | | |0 = RTC Alarm interrupt Disabled. - * | | |1 = RTC Alarm interrupt Enabled. - * |[1] |TICKIEN |Time Tick Interrupt Enable Bit - * | | |Set TICKIEN to 1 can also enable chip wake-up function when RTC tick interrupt event is generated. - * | | |0 = RTC Time Tick interrupt Disabled. - * | | |1 = RTC Time Tick interrupt Enabled. - * |[8] |TAMP0IEN |Tamper 0 Interrupt Enable Bit - * | | |Set TAMP0IEN to 1 can also enable chip wake-up function when tamper 0 interrupt event is generated. - * | | |0 = Tamper 0 interrupt Disabled. - * | | |1 = Tamper 0 interrupt Enabled. - * |[9] |TAMP1IEN |Tamper 1 or Pair 0 Interrupt Enable Bit - * | | |Set TAMP1IEN to 1 can also enable chip wake-up function when tamper 1 interrupt event is generated. - * | | |0 = Tamper 1 or Pair 0 interrupt Disabled. - * | | |1 = Tamper 1 or Pair 0 interrupt Enabled. - * |[10] |TAMP2IEN |Tamper 2 Interrupt Enable Bit - * | | |Set TAMP2IEN to 1 can also enable chip wake-up function when tamper 2 interrupt event is generated. - * | | |0 = Tamper 2 interrupt Disabled. - * | | |1 = Tamper 2 interrupt Enabled. - * |[11] |TAMP3IEN |Tamper 3 or Pair 1 Interrupt Enable Bit - * | | |Set TAMP3IEN to 1 can also enable chip wake-up function when tamper 3 interrupt event is generated. - * | | |0 = Tamper 3 or Pair 1 interrupt Disabled. - * | | |1 = Tamper 3 or Pair 1 interrupt Enabled. - * |[12] |TAMP4IEN |Tamper 4 Interrupt Enable Bit - * | | |Set TAMP4IEN to 1 can also enable chip wake-up function when tamper 4 interrupt event is generated. - * | | |0 = Tamper 4 interrupt Disabled. - * | | |1 = Tamper 4 interrupt Enabled. - * |[13] |TAMP5IEN |Tamper 5 or Pair 2 Interrupt Enable Bit - * | | |Set TAMP5IEN to 1 can also enable chip wake-up function when tamper 5 interrupt event is generated. - * | | |0 = Tamper 5 or Pair 2 interrupt Disabled. - * | | |1 = Tamper 5 or Pair 2 interrupt Enabled. - * @var RTC_T::INTSTS - * Offset: 0x2C RTC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ALMIF |RTC Alarm Interrupt Flag - * | | |0 = Alarm condition is not matched. - * | | |1 = Alarm condition is matched. - * | | |Note: Write 1 to clear this bit. - * |[1] |TICKIF |RTC Time Tick Interrupt Flag - * | | |0 = Tick condition does not occur. - * | | |1 = Tick condition occur. - * | | |Note: Write 1 to clear this bit. - * |[8] |TAMP0IF |Tamper 0 Interrupt Flag - * | | |This bit is set when TAMP0_PIN detected level non-equal TAMP0LV (RTC_TAMPCTL[9]). - * | | |0 = No Tamper 0 interrupt flag is generated. - * | | |1 = Tamper 0 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: Clear all TAPMxIF will clear RTC_TAMPTIME and RTC_TAMPCAL automatically. - * |[9] |TAMP1IF |Tamper 1 or Pair 0 Interrupt Flag - * | | |This bit is set when TAMP1_PIN detected level non-equal TAMP1LV (RTC_TAMPCTL[13]) - * | | |or TAMP0_PIN and TAMP1_PIN disconnected during DYNPR0EN (RTC_TAMPCTL[15]) is activated. - * | | |0 = No Tamper 1 or Pair 0 interrupt flag is generated. - * | | |1 = Tamper 1 or Pair 0 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: Clear all TAPMxIF will clear RTC_TAMPTIME and RTC_TAMPCAL automatically. - * |[10] |TAMP2IF |Tamper 2 Interrupt Flag - * | | |This bit is set when TAMP2_PIN detected level non-equal TAMP2LV (RTC_TAMPCTL[17]). - * | | |0 = No Tamper 2 interrupt flag is generated. - * | | |1 = Tamper 2 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: Clear all TAPMxIF will clear RTC_TAMPTIME and RTC_TAMPCAL automatically. - * |[11] |TAMP3IF |Tamper 3 or Pair 1 Interrupt Flag - * | | |This bit is set when TAMP3_PIN detected level non-equal TAMP3LV (RTC_TAMPCTL[21]) - * | | |or TAMP2_PIN and TAMP3_PIN disconnected during DYNPR1EN (RTC_TAMPCTL[23]) is activated - * | | |or TAMP0_PIN and TAMP3_PIN disconnected during DYNPR1EN (RTC_TAMPCTL[23]) and DYN1ISS (RTC_TAMPCTL[0]) are activated. - * | | |0 = No Tamper 3 or Pair 1 interrupt flag is generated. - * | | |1 = Tamper 3 or Pair 1 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: Clear all TAPMxIF will clear RTC_TAMPTIME and RTC_TAMPCAL automatically. - * |[12] |TAMP4IF |Tamper 4 Interrupt Flag - * | | |This bit is set when TAMP4_PIN detected level non-equal TAMP4LV (RTC_TAMPCTL[25]). - * | | |0 = No Tamper 4 interrupt flag is generated. - * | | |1 = Tamper 4 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: Clear all TAPMxIF will clear RTC_TAMPTIME and RTC_TAMPCAL automatically. - * |[13] |TAMP5IF |Tamper 5 or Pair 2 Interrupt Flag - * | | |This bit is set when TAMP5_PIN detected level non-equal TAMP5LV (RTC_TAMPCTL[29]) - * | | |or TAMP4_PIN and TAMP5_PIN disconnected during DYNPR2EN (RTC_TAMPCTL[31]) is activated - * | | |or TAMP0_PIN and TAMP5_PIN disconnected during DYNPR2EN (RTC_TAMPCTL[31]) and DYN2ISS (RTC_TAMPCTL[1]) are activated. - * | | |0 = No Tamper 5 or Pair 2 interrupt flag is generated. - * | | |1 = Tamper 5 or Pair 2 interrupt flag is generated. - * | | |Note1: Write 1 to clear this bit. - * | | |Note2: Clear all TAPMxIF will clear RTC_TAMPTIME and RTC_TAMPCAL automatically. - * @var RTC_T::TICK - * Offset: 0x30 RTC Time Tick Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TICK |Time Tick Register - * | | |These bits are used to select RTC time tick period for Periodic Time Tick Interrupt request. - * | | |000 = Time tick is 1 second. - * | | |001 = Time tick is 1/2 second. - * | | |010 = Time tick is 1/4 second. - * | | |011 = Time tick is 1/8 second. - * | | |100 = Time tick is 1/16 second. - * | | |101 = Time tick is 1/32 second. - * | | |110 = Time tick is 1/64 second. - * | | |111 = Time tick is 1/128 second. - * | | |Note: This register can be read back after the RTC register access enable bit RWENF (RTC_RWEN[16]) is active. - * @var RTC_T::TAMSK - * Offset: 0x34 RTC Time Alarm Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSEC |Mask 1-Sec Time Digit of Alarm Setting (0~9) - * |[1] |MTENSEC |Mask 10-Sec Time Digit of Alarm Setting (0~5) - * |[2] |MMIN |Mask 1-Min Time Digit of Alarm Setting (0~9) - * |[3] |MTENMIN |Mask 10-Min Time Digit of Alarm Setting (0~5) - * |[4] |MHR |Mask 1-Hour Time Digit of Alarm Setting (0~9) - * |[5] |MTENHR |Mask 10-Hour Time Digit of Alarm Setting (0~2) - * @var RTC_T::CAMSK - * Offset: 0x38 RTC Calendar Alarm Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MDAY |Mask 1-Day Calendar Digit of Alarm Setting (0~9) - * |[1] |MTENDAY |Mask 10-Day Calendar Digit of Alarm Setting (0~3) - * |[2] |MMON |Mask 1-Month Calendar Digit of Alarm Setting (0~9) - * |[3] |MTENMON |Mask 10-Month Calendar Digit of Alarm Setting (0~1) - * |[4] |MYEAR |Mask 1-Year Calendar Digit of Alarm Setting (0~9) - * |[5] |MTENYEAR |Mask 10-Year Calendar Digit of Alarm Setting (0~9) - * @var RTC_T::SPRCTL - * Offset: 0x3C RTC Spare Functional Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |SPRRWEN |Spare Register Enable Bit - * | | |0 = Spare register is Disabled. - * | | |1 = Spare register is Enabled. - * | | |Note: When spare register is disabled, RTC_SPR0 ~ RTC_SPR19 cannot be accessed. - * |[5] |SPRCSTS |SPR Clear Flag - * | | |This bit indicates if the RTC_SPR0 ~RTC_SPR19 content is cleared when specify tamper event is detected. - * | | |0 = Spare register content is not cleared. - * | | |1 = Spare register content is cleared. - * | | |Writes 1 to clear this bit. - * | | |Note: This bit keep 1 when RTC_INTSTS[13:8] not equal zero. - * @var RTC_T::SPR[20] - * Offset: 0x40 ~ 0x8C RTC Spare Register 0 ~ 19 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SPARE |Spare Register - * | | |This field is used to store back-up information defined by user. - * | | |This field will be cleared by hardware automatically once a tamper pin event is detected. - * | | |Before storing back-up information in to RTC_SPRx register, - * | | |user should check REWNF (RTC_RWEN[16]) is enabled. - * @var RTC_T::LXTCTL - * Offset: 0x100 RTC 32.768 kHz Oscillator Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:1] |GAIN |Oscillator Gain Option - * | | |User can select oscillator gain according to crystal external loading and operating temperature range - * | | |The larger gain value corresponding to stronger driving capability and higher power consumption. - * | | |00 = L0 mode. - * | | |01 = L1 mode. - * | | |10 = L2 mode. - * | | |11 = L3 mode. - * @var RTC_T::GPIOCTL0 - * Offset: 0x104 RTC GPIO Control 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE0 |IO Operation Mode - * | | |00 = PF.4 is input only mode, without pull-up resistor. - * | | |01 = PF.4 is output push pull mode. - * | | |10 = PF.4 is open drain mode. - * | | |11 = PF.4 is quasi-bidirectional mode with internal pull up. - * |[2] |DOUT0 |IO Output Data - * | | |0 = PF.4 output low. - * | | |1 = PF.4 output high. - * |[3] |CTLSEL0 |IO Pin State Backup Selection - * | | |When low speed 32 kHz oscillator is disabled, PF.4 pin (X32KO pin) can be used as GPIO function - * | | |User can program CTLSEL0 to decide PF.4 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL0 control register. - * | | |0 = PF.4 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL0 = 1 when system power is turned off. - * | | |1 = PF.4 pin I/O function is controlled by VBAT power domain. - * | | |PF.4 pin function and I/O status are controlled by OPMODE0[1:0] and DOUT0 after CTLSEL0 is set to 1. - * | | |Note: CTLSEL0 will automatically be set by hardware to 1 when system power is off and INIT[0] (RTC_INIT[0]) is 1. - * |[5:4] |PUSEL0 |IO Pull-up and Pull-down Enable - * | | |Determine PF.4 I/O pull-up or pull-down. - * | | |00 = PF.4 pull-up and pull-up disable. - * | | |01 = PF.4 pull-down enable. - * | | |10 = PF.4 pull-up enable. - * | | |11 = PF.4 pull-up and pull-up disable. - * | | |Note: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE0 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE0 set as input tri-state mode. - * |[9:8] |OPMODE1 |IO Operation Mode - * | | |00 = PF.5 is input only mode, without pull-up resistor. - * | | |01 = PF.5 is output push pull mode. - * | | |10 = PF.5 is open drain mode. - * | | |11 = PF.5 is quasi-bidirectional mode with internal pull up. - * |[10] |DOUT1 |IO Output Data - * | | |0 = PF.5 output low. - * | | |1 = PF.5 output high. - * |[11] |CTLSEL1 |IO Pin State Backup Selection - * | | |When low speed 32 kHz oscillator is disabled, PF.5 pin (X32KI pin) can be used as GPIO function - * | | |User can program CTLSEL1 to decide PF.5 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL0 control register. - * | | |0 = PF.5 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL1 = 1 when system power is turned off. - * | | |1 = PF.5 pin I/O function is controlled by VBAT power domain. - * | | |PF.5 pin function and I/O status are controlled by OPMODE1[1:0] and DOUT1 after CTLSEL1 is set to 1. - * | | |Note: CTLSEL1 will automatically be set by hardware to 1 when system power is off and INIT[0] (RTC_INIT[0]) is 1. - * |[13:12] |PUSEL1 |IO Pull-up and Pull-down Enable - * | | |Determine PF.5 I/O pull-up or pull-down. - * | | |00 = PF.5 pull-up and pull-up disable. - * | | |01 = PF.5 pull-down enable. - * | | |10 = PF.5 pull-up enable. - * | | |11 = PF.5 pull-up and pull-up disable. - * | | |Note: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE1 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE1 set as input tri-state mode. - * |[17:16] |OPMODE2 |IO Operation Mode - * | | |00 = PF.6 is input only mode, without pull-up resistor. - * | | |01 = PF.6 is output push pull mode. - * | | |10 = PF.6 is open drain mode. - * | | |11 = PF.6 is quasi-bidirectional mode with internal pull up. - * |[18] |DOUT2 |IO Output Data - * | | |0 = PF.6 output low. - * | | |1 = PF.6 output high. - * |[19] |CTLSEL2 |IO Pin State Backup Selection - * | | |When TAMP0EN is disabled, PF.6 pin (TAMPER0 pin) can be used as GPIO function - * | | |User can program CTLSEL2 to decide PF.6 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL0 control register. - * | | |0 = PF.6 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL2 = 1 when system power is turned off. - * | | |1 = PF.6 pin I/O function is controlled by VBAT power domain. - * | | |PF.6 pin function and I/O status are controlled by OPMODE2[1:0] and DOUT2 after CTLSEL2 is set to 1. - * | | |Note: CTLSEL2 will automatically be set by hardware to 1 when system power is off and INIT[0] (RTC_INIT[0]) is 1. - * |[21:20] |PUSEL2 |IO Pull-up and Pull-down Enable - * | | |Determine PF.6 I/O pull-up or pull-down. - * | | |00 = PF.6 pull-up and pull-up disable. - * | | |01 = PF.6 pull-down enable. - * | | |10 = PF.6 pull-up enable. - * | | |11 = PF.6 pull-up and pull-up disable. - * | | |Note1: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE2 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE2 set as input tri-state mode. - * |[25:24] |OPMODE3 |IO Operation Mode - * | | |00 = PF.7 is input only mode, without pull-up resistor. - * | | |01 = PF.7 is output push pull mode. - * | | |10 = PF.7 is open drain mode. - * | | |11 = PF.7 is quasi-bidirectional mode. - * |[26] |DOUT3 |IO Output Data - * | | |0 = PF.7 output low. - * | | |1 = PF.7 output high. - * |[27] |CTLSEL3 |IO Pin State Backup Selection - * | | |When TAMP1EN is disabled, PF.7 pin (TAMPER1 pin) can be used as GPIO function - * | | |User can program CTLSEL3 to decide PF.7 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL0 control register. - * | | |0 = PF.7 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL3 = 1 when system power is turned off. - * | | |1 = PF.7 pin I/O function is controlled by VBAT power domain. - * | | |PF.7 pin function and I/O status are controlled by OPMODE3[1:0] and DOUT3 after CTLSEL3 is set to 1. - * | | |Note: CTLSEL3 will automatically be set by hardware to 1 when system power is off and RTC_INIT[0] (RTC Active Status) is 1. - * |[29:28] |PUSEL3 |IO Pull-up and Pull-down Enable - * | | |Determine PF.7 I/O pull-up or pull-down. - * | | |00 = PF.7 pull-up and pull-down disable. - * | | |01 = PF.7 pull-down enable. - * | | |10 = PF.7 pull-up enable. - * | | |11 = PF.7 pull-up and pull-down disable. - * | | |Note: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE3 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE3 set as input tri-state mode. - * @var RTC_T::GPIOCTL1 - * Offset: 0x108 RTC GPIO Control 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE4 |IO Operation Mode - * | | |00 = PF.8 is input only mode, without pull-up resistor. - * | | |01 = PF.8 is output push pull mode. - * | | |10 = PF.8 is open drain mode. - * | | |11 = PF.8 is quasi-bidirectional mode. - * |[2] |DOUT4 |IO Output Data - * | | |0 = PF.8 output low. - * | | |1 = PF.8 output high. - * |[3] |CTLSEL4 |IO Pin State Backup Selection - * | | |When TAMP2EN is disabled, PF.8 pin (TAMPER2 pin) can be used as GPIO function - * | | |User can program CTLSEL4 to decide PF.8 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL1 control register. - * | | |0 = PF.8 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL4 = 1 when system power is turned off. - * | | |1 = PF.8 pin I/O function is controlled by VBAT power domain. - * | | |PF.8 pin function and I/O status are controlled by OPMODE4[1:0] and DOUT4 after CTLSEL4 is set to 1. - * | | |Note: CTLSEL4 will automatically be set by hardware to 1 when system power is off and RTC_INIT[0] (RTC Active Status) is 1. - * |[5:4] |PUSEL4 |IO Pull-up and Pull-down Enable - * | | |Determine PF.8 I/O pull-up or pull-down. - * | | |00 = PF.8 pull-up and pull-down disable. - * | | |01 = PF.8 pull-down enable. - * | | |10 = PF.8 pull-up enable. - * | | |11 = PF.8 pull-up and pull-down disable. - * | | |Note: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE4 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE4 set as input tri-state mode. - * |[9:8] |OPMODE5 |IO Operation Mode - * | | |00 = PF.9 is input only mode, without pull-up resistor. - * | | |01 = PF.9 is output push pull mode. - * | | |10 = PF.9 is open drain mode. - * | | |11 = PF.9 is quasi-bidirectional mode. - * |[10] |DOUT5 |IO Output Data - * | | |0 = PF.9 output low. - * | | |1 = PF.9 output high. - * |[11] |CTLSEL5 |IO Pin State Backup Selection - * | | |When TAMP3EN is disabled, PF.9 pin (TAMPER3 pin) can be used as GPIO function - * | | |User can program CTLSEL5 to decide PF.9 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL1 control register. - * | | |0 = PF.9 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL5 = 1 when system power is turned off. - * | | |1 = PF.9 pin I/O function is controlled by VBAT power domain. - * | | |PF.9 pin function and I/O status are controlled by OPMODE5[1:0] and DOUT5 after CTLSEL5 is set to 1. - * | | |Note: CTLSEL5 will automatically be set by hardware to 1 when system power is off and INIT[0] (RTC_INIT[0]) is 1. - * |[13:12] |PUSEL5 |IO Pull-up and Pull-down Enable - * | | |Determine PF.9 I/O pull-up or pull-down. - * | | |00 = PF.9 pull-up and pull-down disable. - * | | |01 = PF.9 pull-down enable. - * | | |10 = PF.9 pull-up enable. - * | | |11 = PF.9 pull-up and pull-down disable. - * | | |Note: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE5 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE5 set as input tri-state mode. - * |[17:16] |OPMODE6 |IO Operation Mode - * | | |00 = PF.10 is input only mode, without pull-up resistor. - * | | |01 = PF.10 is output push pull mode. - * | | |10 = PF.10 is open drain mode. - * | | |11 = PF.10 is quasi-bidirectional mode. - * |[18] |DOUT6 |IO Output Data - * | | |0 = PF.10 output low. - * | | |1 = PF.10 output high. - * |[19] |CTLSEL6 |IO Pin State Backup Selection - * | | |When TAMP4EN is disabled, PF.10 pin (TAMPER4 pin) can be used as GPIO function - * | | |User can program CTLSEL6 to decide PF.10 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL1 control register. - * | | |0 = PF.10 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL6 = 1 when system power is turned off. - * | | |1 = PF.10 pin I/O function is controlled by VBAT power domain. - * | | |PF.10 pin function and I/O status are controlled by OPMODE6[1:0] and DOUT6 after CTLSEL6 is set to 1. - * | | |Note: CTLSEL6 will automatically be set by hardware to 1 when system power is off and INIT[0] (RTC_INIT[0]) is 1. - * |[21:20] |PUSEL6 |IO Pull-up and Pull-down Enable - * | | |Determine PF.10 I/O pull-up or pull-down. - * | | |00 = PF.10 pull-up and pull-down disable. - * | | |01 = PF.10 pull-down enable. - * | | |10 = PF.10 pull-up enable. - * | | |11 = PF.10 pull-up and pull-down disable. - * | | |Note: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE6 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE6 set as input tri-state mode. - * |[25:24] |OPMODE7 |IO Operation Mode - * | | |00 = PF.11 is input only mode, without pull-up resistor. - * | | |01 = PF.11 is output push pull mode. - * | | |10 = PF.11 is open drain mode. - * | | |11 = PF.11 is quasi-bidirectional mode. - * |[26] |DOUT7 |IO Output Data - * | | |0 = PF.11 output low. - * | | |1 = PF.11 output high. - * |[27] |CTLSEL7 |IO Pin State Backup Selection - * | | |When TAMP5EN is disabled, PF.11 pin (TAMPER5 pin) can be used as GPIO function - * | | |User can program CTLSEL7 to decide PF.11 I/O function is controlled by system power domain GPIO module or - * | | |VBAT power domain RTC_GPIOCTL1 control register. - * | | |0 = PF.11 pin I/O function is controlled by GPIO module. - * | | |Hardware auto becomes CTLSEL7 = 1 when system power is turned off. - * | | |1 = PF.11 pin I/O function is controlled by VBAT power domain. - * | | |PF.11 pin function and I/O status are controlled by OPMODE7[1:0] and DOUT7 after CTLSEL7 is set to 1. - * | | |Note: CTLSEL7 will automatically be set by hardware to 1 when system power is off and INIT[0] (RTC_INIT[0]) is 1. - * |[29:28] |PUSEL7 |IO Pull-up and Pull-down Enable - * | | |Determine PF.11 I/O pull-up or pull-down. - * | | |00 = PF.11 pull-up and pull-down disable. - * | | |01 = PF.11 pull-down enable. - * | | |10 = PF.11 pull-up enable. - * | | |11 = PF.11 pull-up and pull-down disable. - * | | |Note: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when OPMODE7 set as input tri-state and open-drain mode. - * | | |The independent pull-down control register only valid when OPMODE7 set as input tri-state mode. - * @var RTC_T::DSTCTL - * Offset: 0x110 RTC Daylight Saving Time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADDHR |Add 1 Hour - * | | |0 = No effect. - * | | |1 = Indicates RTC hour digit has been added one hour for summer time change. - * |[1] |SUBHR |Subtract 1 Hour - * | | |0 = No effect. - * | | |1 = Indicates RTC hour digit has been subtracted one hour for winter time change. - * |[2] |DSBAK |Daylight Saving Back - * | | |0= Normal mode. - * | | |1= Daylight saving mode. - * @var RTC_T::TAMPCTL - * Offset: 0x120 RTC Tamper Pin Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DYN1ISS |Dynamic Pair 1 Input Source Select - * | | |This bit determine Tamper 3 input is from Tamper 2 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 2. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit has effect only when DYNPR1EN (RTC_TAMPCTL[16]) and DYNPR0EN (RTC_TAMPCTL[15]) are set - * |[1] |DYN2ISS |Dynamic Pair 2 Input Source Select - * | | |This bit determine Tamper 5 input is from Tamper 4 or Tamper 0 in dynamic mode. - * | | |0 = Tamper input is from Tamper 4. - * | | |1 = Tamper input is from Tamper 0. - * | | |Note: This bit has effect only when DYNPR2EN (RTC_TAMPCTL[24]) and DYNPR0EN (RTC_TAMPCTL[15]) are set - * |[3:2] |DYNSRC |Dynamic Reference Pattern - * | | |This fields determine the new reference pattern when current pattern run out in dynamic pair mode. - * | | |00 or 10 = The new reference pattern is generated by random number generator when the reference pattern run out. - * | | |01 = The new reference pattern is repeated previous random value when the reference pattern run out. - * | | |11 = The new reference pattern is repeated from SEED (RTC_TAMPSEED[31:0]) when the reference pattern run out. - * | | |Note: After revise this bit, the SEEDRLD (RTC_TAMPCTL[4]) should be set. - * |[4] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |Setting this bit, the tamper configuration will be reload. - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * | | |Note: Before set this bit, the tamper configuration should be set to complete. - * |[7:5] |DYNRATE |Dynamic Change Rate - * | | |This item is choice the dynamic tamper output change rate. - * | | |000 = 210 * RTC_CLK. - * | | |001 = 211 * RTC_CLK. - * | | |010 = 212 * RTC_CLK. - * | | |011 = 213 * RTC_CLK. - * | | |100 = 214 * RTC_CLK. - * | | |101 = 215 * RTC_CLK. - * | | |110 = 216 * RTC_CLK. - * | | |111 = 217 * RTC_CLK. - * | | |Note: After revise this field, set SEEDRLD (RTC_TAMPCTL[4]) can reload change rate immediately. - * |[8] |TAMP0EN |Tamper0 Detect Enable Bit - * | | |0 = Tamper 0 detect Disabled. - * | | |1 = Tamper 0 detect Enabled. - * | | |Note1: The reference is RTC-clock . Tamper detector need sync 2 ~ 3 RTC-clock. - * |[9] |TAMP0LV |Tamper 0 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[10] |TAMP0DBEN |Tamper 0 De-bounce Enable Bit - * | | |0 = Tamper 0 de-bounce Disabled. - * | | |1 = Tamper 0 de-bounce Enabled. - * |[12] |TAMP1EN |Tamper 1 Detect Enable Bit - * | | |0 = Tamper 1 detect Disabled. - * | | |1 = Tamper 1 detect Enabled. - * | | |Note1: The reference is RTC-clock . Tamper detector need sync 2 ~ 3 RTC-clock. - * |[13] |TAMP1LV |Tamper 1 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[14] |TAMP1DBEN |Tamper 1 De-bounce Enable Bit - * | | |0 = Tamper 1 de-bounce Disabled. - * | | |1 = Tamper 1 de-bounce Enabled. - * |[15] |DYNPR0EN |Dynamic Pair 0 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * |[16] |TAMP2EN |Tamper 2 Detect Enable Bit - * | | |0 = Tamper 2 detect Disabled. - * | | |1 = Tamper 2 detect Enabled. - * | | |Note1: The reference is RTC-clock . Tamper detector need sync 2 ~ 3 RTC-clock. - * |[17] |TAMP2LV |Tamper 2 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[18] |TAMP2DBEN |Tamper 2 De-bounce Enable Bit - * | | |0 = Tamper 2 de-bounce Disabled. - * | | |1 = Tamper 2 de-bounce Enabled. - * |[20] |TAMP3EN |Tamper 3 Detect Enable Bit - * | | |0 = Tamper 3 detect Disabled. - * | | |1 = Tamper 3 detect Enabled. - * | | |Note1: The reference is RTC-clock . Tamper detector need sync 2 ~ 3 RTC-clock. - * |[21] |TAMP3LV |Tamper 3 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[22] |TAMP3DBEN |Tamper 3 De-bounce Enable Bit - * | | |0 = Tamper 3 de-bounce Disabled. - * | | |1 = Tamper 3 de-bounce Enabled. - * |[23] |DYNPR1EN |Dynamic Pair 1 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * |[24] |TAMP4EN |Tamper4 Detect Enable Bit - * | | |0 = Tamper 4 detect Disabled. - * | | |1 = Tamper 4 detect Enabled. - * | | |Note1: The reference is RTC-clock . Tamper detector need sync 2 ~ 3 RTC-clock. - * |[25] |TAMP4LV |Tamper 4 Level - * | | |This bit depends on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[26] |TAMP4DBEN |Tamper 4 De-bounce Enable Bit - * | | |0 = Tamper 4 de-bounce Disabled. - * | | |1 = Tamper 4 de-bounce Enabled. - * |[28] |TAMP5EN |Tamper 5 Detect Enable Bit - * | | |0 = Tamper 5 detect Disabled. - * | | |1 = Tamper 5 detect Enabled. - * | | |Note1: The reference is RTC-clock . Tamper detector need sync 2 ~ 3 RTC-clock. - * |[29] |TAMP5LV |Tamper 5 Level - * | | |This bit depend on level attribute of tamper pin for static tamper detection. - * | | |0 = Detect voltage level is low. - * | | |1 = Detect voltage level is high. - * |[30] |TAMP5DBEN |Tamper 5 De-bounce Enable Bit - * | | |0 = Tamper 5 de-bounce Disabled. - * | | |1 = Tamper 5 de-bounce Enabled. - * |[31] |DYNPR2EN |Dynamic Pair 2 Enable Bit - * | | |0 = Static detect. - * | | |1 = Dynamic detect. - * @var RTC_T::TAMPSEED - * Offset: 0x128 RTC Tamper Dynamic Seed Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed Value - * @var RTC_T::TAMPTIME - * Offset: 0x130 RTC Tamper Time Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SEC |1-Sec Time Digit of TAMPER Time (0~9) - * |[6:4] |TENSEC |10-Sec Time Digit of TAMPER Time (0~5) - * |[11:8] |MIN |1-Min Time Digit of TAMPER Time (0~9) - * |[14:12] |TENMIN |10-Min Time Digit of TAMPER Time (0~5) - * |[19:16] |HR |1-Hour Time Digit of TAMPER Time (0~9) - * |[21:20] |TENHR |10-Hour Time Digit of TAMPER Time (0~2) - * | | |Note: 24-hour time scale only. - * @var RTC_T::TAMPCAL - * Offset: 0x134 RTC Tamper Calendar Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DAY |1-Day Calendar Digit of TAMPER Calendar (0~9) - * |[5:4] |TENDAY |10-Day Calendar Digit of TAMPER Calendar (0~3) - * |[11:8] |MON |1-Month Calendar Digit of TAMPER Calendar (0~9) - * |[12] |TENMON |10-Month Calendar Digit of TAMPER Calendar (0~1) - * |[19:16] |YEAR |1-Year Calendar Digit of TAMPER Calendar (0~9) - * |[23:20] |TENYEAR |10-Year Calendar Digit of TAMPER Calendar (0~9) - */ - __IO uint32_t INIT; /*!< [0x0000] RTC Initiation Register */ - __IO uint32_t RWEN; /*!< [0x0004] RTC Access Enable Register */ - __IO uint32_t FREQADJ; /*!< [0x0008] RTC Frequency Compensation Register */ - __IO uint32_t TIME; /*!< [0x000c] RTC Time Loading Register */ - __IO uint32_t CAL; /*!< [0x0010] RTC Calendar Loading Register */ - __IO uint32_t CLKFMT; /*!< [0x0014] RTC Time Scale Selection Register */ - __IO uint32_t WEEKDAY; /*!< [0x0018] RTC Day of the Week Register */ - __IO uint32_t TALM; /*!< [0x001c] RTC Time Alarm Register */ - __IO uint32_t CALM; /*!< [0x0020] RTC Calendar Alarm Register */ - __I uint32_t LEAPYEAR; /*!< [0x0024] RTC Leap Year Indicator Register */ - __IO uint32_t INTEN; /*!< [0x0028] RTC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x002c] RTC Interrupt Status Register */ - __IO uint32_t TICK; /*!< [0x0030] RTC Time Tick Register */ - __IO uint32_t TAMSK; /*!< [0x0034] RTC Time Alarm Mask Register */ - __IO uint32_t CAMSK; /*!< [0x0038] RTC Calendar Alarm Mask Register */ - __IO uint32_t SPRCTL; /*!< [0x003c] RTC Spare Functional Control Register */ - __IO uint32_t SPR[20]; /*!< [0x0040] ~ [0x008c] RTC Spare Register 0 ~ 19 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[28]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t LXTCTL; /*!< [0x0100] RTC 32.768 kHz Oscillator Control Register */ - __IO uint32_t GPIOCTL0; /*!< [0x0104] RTC GPIO Control 0 Register */ - __IO uint32_t GPIOCTL1; /*!< [0x0108] RTC GPIO Control 1 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DSTCTL; /*!< [0x0110] RTC Daylight Saving Time Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t TAMPCTL; /*!< [0x0120] RTC Tamper Pin Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t TAMPSEED; /*!< [0x0128] RTC Tamper Dynamic Seed Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[1]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t TAMPTIME; /*!< [0x0130] RTC Tamper Time Register */ - __I uint32_t TAMPCAL; /*!< [0x0134] RTC Tamper Calendar Register */ - -} RTC_T; - -/** - @addtogroup RTC_CONST RTC Bit Field Definition - Constant Definitions for RTC Controller -@{ */ - -#define RTC_INIT_ACTIVE_Pos (0) /*!< RTC_T::INIT: INIT_ACTIVE Position */ -#define RTC_INIT_ACTIVE_Msk (0x1ul << RTC_INIT_ACTIVE_Pos) /*!< RTC_T::INIT: INIT_ACTIVE Mask */ - -#define RTC_INIT_INIT_Pos (1) /*!< RTC_T::INIT: INIT Position */ -#define RTC_INIT_INIT_Msk (0x7ffffffful << RTC_INIT_INIT_Pos) /*!< RTC_T::INIT: INIT Mask */ - -#define RTC_RWEN_RWENF_Pos (16) /*!< RTC_T::RWEN: RWENF Position */ -#define RTC_RWEN_RWENF_Msk (0x1ul << RTC_RWEN_RWENF_Pos) /*!< RTC_T::RWEN: RWENF Mask */ - -#define RTC_RWEN_RTCBUSY_Pos (24) /*!< RTC_T::RWEN: RTCBUSY Position */ -#define RTC_RWEN_RTCBUSY_Msk (0x1ul << RTC_RWEN_RTCBUSY_Pos) /*!< RTC_T::RWEN: RTCBUSY Mask */ - -#define RTC_FREQADJ_FREQADJ_Pos (0) /*!< RTC_T::FREQADJ: FREQADJ Position */ -#define RTC_FREQADJ_FREQADJ_Msk (0x3ffffful << RTC_FREQADJ_FREQADJ_Pos) /*!< RTC_T::FREQADJ: FREQADJ Mask */ - -#define RTC_FREQADJ_FRACTION_Pos (0) /*!< RTC_T::FREQADJ: FRACTION Position */ -#define RTC_FREQADJ_FRACTION_Msk (0x3ful << RTC_FREQADJ_FRACTION_Pos) /*!< RTC_T::FREQADJ: FRACTION Mask */ - -#define RTC_FREQADJ_INTEGER_Pos (8) /*!< RTC_T::FREQADJ: INTEGER Position */ -#define RTC_FREQADJ_INTEGER_Msk (0x1ful << RTC_FREQADJ_INTEGER_Pos) /*!< RTC_T::FREQADJ: INTEGER Mask */ - -#define RTC_FREQADJ_FCR_BUSY_Pos (31) /*!< RTC_T::FREQADJ: FCR_BUSY Position */ -#define RTC_FREQADJ_FCR_BUSY_Msk (0x1ul << RTC_FREQADJ_FCR_BUSY_Pos) /*!< RTC_T::FREQADJ: FCR_BUSY Mask */ - -#define RTC_TIME_SEC_Pos (0) /*!< RTC_T::TIME: SEC Position */ -#define RTC_TIME_SEC_Msk (0xful << RTC_TIME_SEC_Pos) /*!< RTC_T::TIME: SEC Mask */ - -#define RTC_TIME_TENSEC_Pos (4) /*!< RTC_T::TIME: TENSEC Position */ -#define RTC_TIME_TENSEC_Msk (0x7ul << RTC_TIME_TENSEC_Pos) /*!< RTC_T::TIME: TENSEC Mask */ - -#define RTC_TIME_MIN_Pos (8) /*!< RTC_T::TIME: MIN Position */ -#define RTC_TIME_MIN_Msk (0xful << RTC_TIME_MIN_Pos) /*!< RTC_T::TIME: MIN Mask */ - -#define RTC_TIME_TENMIN_Pos (12) /*!< RTC_T::TIME: TENMIN Position */ -#define RTC_TIME_TENMIN_Msk (0x7ul << RTC_TIME_TENMIN_Pos) /*!< RTC_T::TIME: TENMIN Mask */ - -#define RTC_TIME_HR_Pos (16) /*!< RTC_T::TIME: HR Position */ -#define RTC_TIME_HR_Msk (0xful << RTC_TIME_HR_Pos) /*!< RTC_T::TIME: HR Mask */ - -#define RTC_TIME_TENHR_Pos (20) /*!< RTC_T::TIME: TENHR Position */ -#define RTC_TIME_TENHR_Msk (0x3ul << RTC_TIME_TENHR_Pos) /*!< RTC_T::TIME: TENHR Mask */ - -#define RTC_CAL_DAY_Pos (0) /*!< RTC_T::CAL: DAY Position */ -#define RTC_CAL_DAY_Msk (0xful << RTC_CAL_DAY_Pos) /*!< RTC_T::CAL: DAY Mask */ - -#define RTC_CAL_TENDAY_Pos (4) /*!< RTC_T::CAL: TENDAY Position */ -#define RTC_CAL_TENDAY_Msk (0x3ul << RTC_CAL_TENDAY_Pos) /*!< RTC_T::CAL: TENDAY Mask */ - -#define RTC_CAL_MON_Pos (8) /*!< RTC_T::CAL: MON Position */ -#define RTC_CAL_MON_Msk (0xful << RTC_CAL_MON_Pos) /*!< RTC_T::CAL: MON Mask */ - -#define RTC_CAL_TENMON_Pos (12) /*!< RTC_T::CAL: TENMON Position */ -#define RTC_CAL_TENMON_Msk (0x1ul << RTC_CAL_TENMON_Pos) /*!< RTC_T::CAL: TENMON Mask */ - -#define RTC_CAL_YEAR_Pos (16) /*!< RTC_T::CAL: YEAR Position */ -#define RTC_CAL_YEAR_Msk (0xful << RTC_CAL_YEAR_Pos) /*!< RTC_T::CAL: YEAR Mask */ - -#define RTC_CAL_TENYEAR_Pos (20) /*!< RTC_T::CAL: TENYEAR Position */ -#define RTC_CAL_TENYEAR_Msk (0xful << RTC_CAL_TENYEAR_Pos) /*!< RTC_T::CAL: TENYEAR Mask */ - -#define RTC_CLKFMT_24HEN_Pos (0) /*!< RTC_T::CLKFMT: 24HEN Position */ -#define RTC_CLKFMT_24HEN_Msk (0x1ul << RTC_CLKFMT_24HEN_Pos) /*!< RTC_T::CLKFMT: 24HEN Mask */ - -#define RTC_WEEKDAY_WEEKDAY_Pos (0) /*!< RTC_T::WEEKDAY: WEEKDAY Position */ -#define RTC_WEEKDAY_WEEKDAY_Msk (0x7ul << RTC_WEEKDAY_WEEKDAY_Pos) /*!< RTC_T::WEEKDAY: WEEKDAY Mask */ - -#define RTC_TALM_SEC_Pos (0) /*!< RTC_T::TALM: SEC Position */ -#define RTC_TALM_SEC_Msk (0xful << RTC_TALM_SEC_Pos) /*!< RTC_T::TALM: SEC Mask */ - -#define RTC_TALM_TENSEC_Pos (4) /*!< RTC_T::TALM: TENSEC Position */ -#define RTC_TALM_TENSEC_Msk (0x7ul << RTC_TALM_TENSEC_Pos) /*!< RTC_T::TALM: TENSEC Mask */ - -#define RTC_TALM_MIN_Pos (8) /*!< RTC_T::TALM: MIN Position */ -#define RTC_TALM_MIN_Msk (0xful << RTC_TALM_MIN_Pos) /*!< RTC_T::TALM: MIN Mask */ - -#define RTC_TALM_TENMIN_Pos (12) /*!< RTC_T::TALM: TENMIN Position */ -#define RTC_TALM_TENMIN_Msk (0x7ul << RTC_TALM_TENMIN_Pos) /*!< RTC_T::TALM: TENMIN Mask */ - -#define RTC_TALM_HR_Pos (16) /*!< RTC_T::TALM: HR Position */ -#define RTC_TALM_HR_Msk (0xful << RTC_TALM_HR_Pos) /*!< RTC_T::TALM: HR Mask */ - -#define RTC_TALM_TENHR_Pos (20) /*!< RTC_T::TALM: TENHR Position */ -#define RTC_TALM_TENHR_Msk (0x3ul << RTC_TALM_TENHR_Pos) /*!< RTC_T::TALM: TENHR Mask */ - -#define RTC_CALM_DAY_Pos (0) /*!< RTC_T::CALM: DAY Position */ -#define RTC_CALM_DAY_Msk (0xful << RTC_CALM_DAY_Pos) /*!< RTC_T::CALM: DAY Mask */ - -#define RTC_CALM_TENDAY_Pos (4) /*!< RTC_T::CALM: TENDAY Position */ -#define RTC_CALM_TENDAY_Msk (0x3ul << RTC_CALM_TENDAY_Pos) /*!< RTC_T::CALM: TENDAY Mask */ - -#define RTC_CALM_MON_Pos (8) /*!< RTC_T::CALM: MON Position */ -#define RTC_CALM_MON_Msk (0xful << RTC_CALM_MON_Pos) /*!< RTC_T::CALM: MON Mask */ - -#define RTC_CALM_TENMON_Pos (12) /*!< RTC_T::CALM: TENMON Position */ -#define RTC_CALM_TENMON_Msk (0x1ul << RTC_CALM_TENMON_Pos) /*!< RTC_T::CALM: TENMON Mask */ - -#define RTC_CALM_YEAR_Pos (16) /*!< RTC_T::CALM: YEAR Position */ -#define RTC_CALM_YEAR_Msk (0xful << RTC_CALM_YEAR_Pos) /*!< RTC_T::CALM: YEAR Mask */ - -#define RTC_CALM_TENYEAR_Pos (20) /*!< RTC_T::CALM: TENYEAR Position */ -#define RTC_CALM_TENYEAR_Msk (0xful << RTC_CALM_TENYEAR_Pos) /*!< RTC_T::CALM: TENYEAR Mask */ - -#define RTC_LEAPYEAR_LEAPYEAR_Pos (0) /*!< RTC_T::LEAPYEAR: LEAPYEAR Position */ -#define RTC_LEAPYEAR_LEAPYEAR_Msk (0x1ul << RTC_LEAPYEAR_LEAPYEAR_Pos) /*!< RTC_T::LEAPYEAR: LEAPYEAR Mask */ - -#define RTC_INTEN_ALMIEN_Pos (0) /*!< RTC_T::INTEN: ALMIEN Position */ -#define RTC_INTEN_ALMIEN_Msk (0x1ul << RTC_INTEN_ALMIEN_Pos) /*!< RTC_T::INTEN: ALMIEN Mask */ - -#define RTC_INTEN_TICKIEN_Pos (1) /*!< RTC_T::INTEN: TICKIEN Position */ -#define RTC_INTEN_TICKIEN_Msk (0x1ul << RTC_INTEN_TICKIEN_Pos) /*!< RTC_T::INTEN: TICKIEN Mask */ - -#define RTC_INTEN_TAMP0IEN_Pos (8) /*!< RTC_T::INTEN: TAMP0IEN Position */ -#define RTC_INTEN_TAMP0IEN_Msk (0x1ul << RTC_INTEN_TAMP0IEN_Pos) /*!< RTC_T::INTEN: TAMP0IEN Mask */ - -#define RTC_INTEN_TAMP1IEN_Pos (9) /*!< RTC_T::INTEN: TAMP1IEN Position */ -#define RTC_INTEN_TAMP1IEN_Msk (0x1ul << RTC_INTEN_TAMP1IEN_Pos) /*!< RTC_T::INTEN: TAMP1IEN Mask */ - -#define RTC_INTEN_TAMP2IEN_Pos (10) /*!< RTC_T::INTEN: TAMP2IEN Position */ -#define RTC_INTEN_TAMP2IEN_Msk (0x1ul << RTC_INTEN_TAMP2IEN_Pos) /*!< RTC_T::INTEN: TAMP2IEN Mask */ - -#define RTC_INTEN_TAMP3IEN_Pos (11) /*!< RTC_T::INTEN: TAMP3IEN Position */ -#define RTC_INTEN_TAMP3IEN_Msk (0x1ul << RTC_INTEN_TAMP3IEN_Pos) /*!< RTC_T::INTEN: TAMP3IEN Mask */ - -#define RTC_INTEN_TAMP4IEN_Pos (12) /*!< RTC_T::INTEN: TAMP4IEN Position */ -#define RTC_INTEN_TAMP4IEN_Msk (0x1ul << RTC_INTEN_TAMP4IEN_Pos) /*!< RTC_T::INTEN: TAMP4IEN Mask */ - -#define RTC_INTEN_TAMP5IEN_Pos (13) /*!< RTC_T::INTEN: TAMP5IEN Position */ -#define RTC_INTEN_TAMP5IEN_Msk (0x1ul << RTC_INTEN_TAMP5IEN_Pos) /*!< RTC_T::INTEN: TAMP5IEN Mask */ - -#define RTC_INTSTS_ALMIF_Pos (0) /*!< RTC_T::INTSTS: ALMIF Position */ -#define RTC_INTSTS_ALMIF_Msk (0x1ul << RTC_INTSTS_ALMIF_Pos) /*!< RTC_T::INTSTS: ALMIF Mask */ - -#define RTC_INTSTS_TICKIF_Pos (1) /*!< RTC_T::INTSTS: TICKIF Position */ -#define RTC_INTSTS_TICKIF_Msk (0x1ul << RTC_INTSTS_TICKIF_Pos) /*!< RTC_T::INTSTS: TICKIF Mask */ - -#define RTC_INTSTS_TAMP0IF_Pos (8) /*!< RTC_T::INTSTS: TAMP0IF Position */ -#define RTC_INTSTS_TAMP0IF_Msk (0x1ul << RTC_INTSTS_TAMP0IF_Pos) /*!< RTC_T::INTSTS: TAMP0IF Mask */ - -#define RTC_INTSTS_TAMP1IF_Pos (9) /*!< RTC_T::INTSTS: TAMP1IF Position */ -#define RTC_INTSTS_TAMP1IF_Msk (0x1ul << RTC_INTSTS_TAMP1IF_Pos) /*!< RTC_T::INTSTS: TAMP1IF Mask */ - -#define RTC_INTSTS_TAMP2IF_Pos (10) /*!< RTC_T::INTSTS: TAMP2IF Position */ -#define RTC_INTSTS_TAMP2IF_Msk (0x1ul << RTC_INTSTS_TAMP2IF_Pos) /*!< RTC_T::INTSTS: TAMP2IF Mask */ - -#define RTC_INTSTS_TAMP3IF_Pos (11) /*!< RTC_T::INTSTS: TAMP3IF Position */ -#define RTC_INTSTS_TAMP3IF_Msk (0x1ul << RTC_INTSTS_TAMP3IF_Pos) /*!< RTC_T::INTSTS: TAMP3IF Mask */ - -#define RTC_INTSTS_TAMP4IF_Pos (12) /*!< RTC_T::INTSTS: TAMP4IF Position */ -#define RTC_INTSTS_TAMP4IF_Msk (0x1ul << RTC_INTSTS_TAMP4IF_Pos) /*!< RTC_T::INTSTS: TAMP4IF Mask */ - -#define RTC_INTSTS_TAMP5IF_Pos (13) /*!< RTC_T::INTSTS: TAMP5IF Position */ -#define RTC_INTSTS_TAMP5IF_Msk (0x1ul << RTC_INTSTS_TAMP5IF_Pos) /*!< RTC_T::INTSTS: TAMP5IF Mask */ - -#define RTC_TICK_TICK_Pos (0) /*!< RTC_T::TICK: TICK Position */ -#define RTC_TICK_TICK_Msk (0x7ul << RTC_TICK_TICK_Pos) /*!< RTC_T::TICK: TICK Mask */ - -#define RTC_TAMSK_MSEC_Pos (0) /*!< RTC_T::TAMSK: MSEC Position */ -#define RTC_TAMSK_MSEC_Msk (0x1ul << RTC_TAMSK_MSEC_Pos) /*!< RTC_T::TAMSK: MSEC Mask */ - -#define RTC_TAMSK_MTENSEC_Pos (1) /*!< RTC_T::TAMSK: MTENSEC Position */ -#define RTC_TAMSK_MTENSEC_Msk (0x1ul << RTC_TAMSK_MTENSEC_Pos) /*!< RTC_T::TAMSK: MTENSEC Mask */ - -#define RTC_TAMSK_MMIN_Pos (2) /*!< RTC_T::TAMSK: MMIN Position */ -#define RTC_TAMSK_MMIN_Msk (0x1ul << RTC_TAMSK_MMIN_Pos) /*!< RTC_T::TAMSK: MMIN Mask */ - -#define RTC_TAMSK_MTENMIN_Pos (3) /*!< RTC_T::TAMSK: MTENMIN Position */ -#define RTC_TAMSK_MTENMIN_Msk (0x1ul << RTC_TAMSK_MTENMIN_Pos) /*!< RTC_T::TAMSK: MTENMIN Mask */ - -#define RTC_TAMSK_MHR_Pos (4) /*!< RTC_T::TAMSK: MHR Position */ -#define RTC_TAMSK_MHR_Msk (0x1ul << RTC_TAMSK_MHR_Pos) /*!< RTC_T::TAMSK: MHR Mask */ - -#define RTC_TAMSK_MTENHR_Pos (5) /*!< RTC_T::TAMSK: MTENHR Position */ -#define RTC_TAMSK_MTENHR_Msk (0x1ul << RTC_TAMSK_MTENHR_Pos) /*!< RTC_T::TAMSK: MTENHR Mask */ - -#define RTC_CAMSK_MDAY_Pos (0) /*!< RTC_T::CAMSK: MDAY Position */ -#define RTC_CAMSK_MDAY_Msk (0x1ul << RTC_CAMSK_MDAY_Pos) /*!< RTC_T::CAMSK: MDAY Mask */ - -#define RTC_CAMSK_MTENDAY_Pos (1) /*!< RTC_T::CAMSK: MTENDAY Position */ -#define RTC_CAMSK_MTENDAY_Msk (0x1ul << RTC_CAMSK_MTENDAY_Pos) /*!< RTC_T::CAMSK: MTENDAY Mask */ - -#define RTC_CAMSK_MMON_Pos (2) /*!< RTC_T::CAMSK: MMON Position */ -#define RTC_CAMSK_MMON_Msk (0x1ul << RTC_CAMSK_MMON_Pos) /*!< RTC_T::CAMSK: MMON Mask */ - -#define RTC_CAMSK_MTENMON_Pos (3) /*!< RTC_T::CAMSK: MTENMON Position */ -#define RTC_CAMSK_MTENMON_Msk (0x1ul << RTC_CAMSK_MTENMON_Pos) /*!< RTC_T::CAMSK: MTENMON Mask */ - -#define RTC_CAMSK_MYEAR_Pos (4) /*!< RTC_T::CAMSK: MYEAR Position */ -#define RTC_CAMSK_MYEAR_Msk (0x1ul << RTC_CAMSK_MYEAR_Pos) /*!< RTC_T::CAMSK: MYEAR Mask */ - -#define RTC_CAMSK_MTENYEAR_Pos (5) /*!< RTC_T::CAMSK: MTENYEAR Position */ -#define RTC_CAMSK_MTENYEAR_Msk (0x1ul << RTC_CAMSK_MTENYEAR_Pos) /*!< RTC_T::CAMSK: MTENYEAR Mask */ - -#define RTC_SPRCTL_SPRRWEN_Pos (2) /*!< RTC_T::SPRCTL: SPRRWEN Position */ -#define RTC_SPRCTL_SPRRWEN_Msk (0x1ul << RTC_SPRCTL_SPRRWEN_Pos) /*!< RTC_T::SPRCTL: SPRRWEN Mask */ - -#define RTC_SPRCTL_SPRCSTS_Pos (5) /*!< RTC_T::SPRCTL: SPRCSTS Position */ -#define RTC_SPRCTL_SPRCSTS_Msk (0x1ul << RTC_SPRCTL_SPRCSTS_Pos) /*!< RTC_T::SPRCTL: SPRCSTS Mask */ - -#define RTC_SPR0_SPARE_Pos (0) /*!< RTC_T::SPR0: SPARE Position */ -#define RTC_SPR0_SPARE_Msk (0xfffffffful << RTC_SPR0_SPARE_Pos) /*!< RTC_T::SPR0: SPARE Mask */ - -#define RTC_SPR1_SPARE_Pos (0) /*!< RTC_T::SPR1: SPARE Position */ -#define RTC_SPR1_SPARE_Msk (0xfffffffful << RTC_SPR1_SPARE_Pos) /*!< RTC_T::SPR1: SPARE Mask */ - -#define RTC_SPR2_SPARE_Pos (0) /*!< RTC_T::SPR2: SPARE Position */ -#define RTC_SPR2_SPARE_Msk (0xfffffffful << RTC_SPR2_SPARE_Pos) /*!< RTC_T::SPR2: SPARE Mask */ - -#define RTC_SPR3_SPARE_Pos (0) /*!< RTC_T::SPR3: SPARE Position */ -#define RTC_SPR3_SPARE_Msk (0xfffffffful << RTC_SPR3_SPARE_Pos) /*!< RTC_T::SPR3: SPARE Mask */ - -#define RTC_SPR4_SPARE_Pos (0) /*!< RTC_T::SPR4: SPARE Position */ -#define RTC_SPR4_SPARE_Msk (0xfffffffful << RTC_SPR4_SPARE_Pos) /*!< RTC_T::SPR4: SPARE Mask */ - -#define RTC_SPR5_SPARE_Pos (0) /*!< RTC_T::SPR5: SPARE Position */ -#define RTC_SPR5_SPARE_Msk (0xfffffffful << RTC_SPR5_SPARE_Pos) /*!< RTC_T::SPR5: SPARE Mask */ - -#define RTC_SPR6_SPARE_Pos (0) /*!< RTC_T::SPR6: SPARE Position */ -#define RTC_SPR6_SPARE_Msk (0xfffffffful << RTC_SPR6_SPARE_Pos) /*!< RTC_T::SPR6: SPARE Mask */ - -#define RTC_SPR7_SPARE_Pos (0) /*!< RTC_T::SPR7: SPARE Position */ -#define RTC_SPR7_SPARE_Msk (0xfffffffful << RTC_SPR7_SPARE_Pos) /*!< RTC_T::SPR7: SPARE Mask */ - -#define RTC_SPR8_SPARE_Pos (0) /*!< RTC_T::SPR8: SPARE Position */ -#define RTC_SPR8_SPARE_Msk (0xfffffffful << RTC_SPR8_SPARE_Pos) /*!< RTC_T::SPR8: SPARE Mask */ - -#define RTC_SPR9_SPARE_Pos (0) /*!< RTC_T::SPR9: SPARE Position */ -#define RTC_SPR9_SPARE_Msk (0xfffffffful << RTC_SPR9_SPARE_Pos) /*!< RTC_T::SPR9: SPARE Mask */ - -#define RTC_SPR10_SPARE_Pos (0) /*!< RTC_T::SPR10: SPARE Position */ -#define RTC_SPR10_SPARE_Msk (0xfffffffful << RTC_SPR10_SPARE_Pos) /*!< RTC_T::SPR10: SPARE Mask */ - -#define RTC_SPR11_SPARE_Pos (0) /*!< RTC_T::SPR11: SPARE Position */ -#define RTC_SPR11_SPARE_Msk (0xfffffffful << RTC_SPR11_SPARE_Pos) /*!< RTC_T::SPR11: SPARE Mask */ - -#define RTC_SPR12_SPARE_Pos (0) /*!< RTC_T::SPR12: SPARE Position */ -#define RTC_SPR12_SPARE_Msk (0xfffffffful << RTC_SPR12_SPARE_Pos) /*!< RTC_T::SPR12: SPARE Mask */ - -#define RTC_SPR13_SPARE_Pos (0) /*!< RTC_T::SPR13: SPARE Position */ -#define RTC_SPR13_SPARE_Msk (0xfffffffful << RTC_SPR13_SPARE_Pos) /*!< RTC_T::SPR13: SPARE Mask */ - -#define RTC_SPR14_SPARE_Pos (0) /*!< RTC_T::SPR14: SPARE Position */ -#define RTC_SPR14_SPARE_Msk (0xfffffffful << RTC_SPR14_SPARE_Pos) /*!< RTC_T::SPR14: SPARE Mask */ - -#define RTC_SPR15_SPARE_Pos (0) /*!< RTC_T::SPR15: SPARE Position */ -#define RTC_SPR15_SPARE_Msk (0xfffffffful << RTC_SPR15_SPARE_Pos) /*!< RTC_T::SPR15: SPARE Mask */ - -#define RTC_SPR16_SPARE_Pos (0) /*!< RTC_T::SPR16: SPARE Position */ -#define RTC_SPR16_SPARE_Msk (0xfffffffful << RTC_SPR16_SPARE_Pos) /*!< RTC_T::SPR16: SPARE Mask */ - -#define RTC_SPR17_SPARE_Pos (0) /*!< RTC_T::SPR17: SPARE Position */ -#define RTC_SPR17_SPARE_Msk (0xfffffffful << RTC_SPR17_SPARE_Pos) /*!< RTC_T::SPR17: SPARE Mask */ - -#define RTC_SPR18_SPARE_Pos (0) /*!< RTC_T::SPR18: SPARE Position */ -#define RTC_SPR18_SPARE_Msk (0xfffffffful << RTC_SPR18_SPARE_Pos) /*!< RTC_T::SPR18: SPARE Mask */ - -#define RTC_SPR19_SPARE_Pos (0) /*!< RTC_T::SPR19: SPARE Position */ -#define RTC_SPR19_SPARE_Msk (0xfffffffful << RTC_SPR19_SPARE_Pos) /*!< RTC_T::SPR19: SPARE Mask */ - -#define RTC_LXTCTL_GAIN_Pos (1) /*!< RTC_T::LXTCTL: GAIN Position */ -#define RTC_LXTCTL_GAIN_Msk (0x3ul << RTC_LXTCTL_GAIN_Pos) /*!< RTC_T::LXTCTL: GAIN Mask */ - -#define RTC_GPIOCTL0_OPMODE0_Pos (0) /*!< RTC_T::GPIOCTL0: OPMODE0 Position */ -#define RTC_GPIOCTL0_OPMODE0_Msk (0x3ul << RTC_GPIOCTL0_OPMODE0_Pos) /*!< RTC_T::GPIOCTL0: OPMODE0 Mask */ - -#define RTC_GPIOCTL0_DOUT0_Pos (2) /*!< RTC_T::GPIOCTL0: DOUT0 Position */ -#define RTC_GPIOCTL0_DOUT0_Msk (0x1ul << RTC_GPIOCTL0_DOUT0_Pos) /*!< RTC_T::GPIOCTL0: DOUT0 Mask */ - -#define RTC_GPIOCTL0_CTLSEL0_Pos (3) /*!< RTC_T::GPIOCTL0: CTLSEL0 Position */ -#define RTC_GPIOCTL0_CTLSEL0_Msk (0x1ul << RTC_GPIOCTL0_CTLSEL0_Pos) /*!< RTC_T::GPIOCTL0: CTLSEL0 Mask */ - -#define RTC_GPIOCTL0_PUSEL0_Pos (4) /*!< RTC_T::GPIOCTL0: PUSEL0 Position */ -#define RTC_GPIOCTL0_PUSEL0_Msk (0x3ul << RTC_GPIOCTL0_PUSEL0_Pos) /*!< RTC_T::GPIOCTL0: PUSEL0 Mask */ - -#define RTC_GPIOCTL0_OPMODE1_Pos (8) /*!< RTC_T::GPIOCTL0: OPMODE1 Position */ -#define RTC_GPIOCTL0_OPMODE1_Msk (0x3ul << RTC_GPIOCTL0_OPMODE1_Pos) /*!< RTC_T::GPIOCTL0: OPMODE1 Mask */ - -#define RTC_GPIOCTL0_DOUT1_Pos (10) /*!< RTC_T::GPIOCTL0: DOUT1 Position */ -#define RTC_GPIOCTL0_DOUT1_Msk (0x1ul << RTC_GPIOCTL0_DOUT1_Pos) /*!< RTC_T::GPIOCTL0: DOUT1 Mask */ - -#define RTC_GPIOCTL0_CTLSEL1_Pos (11) /*!< RTC_T::GPIOCTL0: CTLSEL1 Position */ -#define RTC_GPIOCTL0_CTLSEL1_Msk (0x1ul << RTC_GPIOCTL0_CTLSEL1_Pos) /*!< RTC_T::GPIOCTL0: CTLSEL1 Mask */ - -#define RTC_GPIOCTL0_PUSEL1_Pos (12) /*!< RTC_T::GPIOCTL0: PUSEL1 Position */ -#define RTC_GPIOCTL0_PUSEL1_Msk (0x3ul << RTC_GPIOCTL0_PUSEL1_Pos) /*!< RTC_T::GPIOCTL0: PUSEL1 Mask */ - -#define RTC_GPIOCTL0_OPMODE2_Pos (16) /*!< RTC_T::GPIOCTL0: OPMODE2 Position */ -#define RTC_GPIOCTL0_OPMODE2_Msk (0x3ul << RTC_GPIOCTL0_OPMODE2_Pos) /*!< RTC_T::GPIOCTL0: OPMODE2 Mask */ - -#define RTC_GPIOCTL0_DOUT2_Pos (18) /*!< RTC_T::GPIOCTL0: DOUT2 Position */ -#define RTC_GPIOCTL0_DOUT2_Msk (0x1ul << RTC_GPIOCTL0_DOUT2_Pos) /*!< RTC_T::GPIOCTL0: DOUT2 Mask */ - -#define RTC_GPIOCTL0_CTLSEL2_Pos (19) /*!< RTC_T::GPIOCTL0: CTLSEL2 Position */ -#define RTC_GPIOCTL0_CTLSEL2_Msk (0x1ul << RTC_GPIOCTL0_CTLSEL2_Pos) /*!< RTC_T::GPIOCTL0: CTLSEL2 Mask */ - -#define RTC_GPIOCTL0_PUSEL2_Pos (20) /*!< RTC_T::GPIOCTL0: PUSEL2 Position */ -#define RTC_GPIOCTL0_PUSEL2_Msk (0x3ul << RTC_GPIOCTL0_PUSEL2_Pos) /*!< RTC_T::GPIOCTL0: PUSEL2 Mask */ - -#define RTC_GPIOCTL0_OPMODE3_Pos (24) /*!< RTC_T::GPIOCTL0: OPMODE3 Position */ -#define RTC_GPIOCTL0_OPMODE3_Msk (0x3ul << RTC_GPIOCTL0_OPMODE3_Pos) /*!< RTC_T::GPIOCTL0: OPMODE3 Mask */ - -#define RTC_GPIOCTL0_DOUT3_Pos (26) /*!< RTC_T::GPIOCTL0: DOUT3 Position */ -#define RTC_GPIOCTL0_DOUT3_Msk (0x1ul << RTC_GPIOCTL0_DOUT3_Pos) /*!< RTC_T::GPIOCTL0: DOUT3 Mask */ - -#define RTC_GPIOCTL0_CTLSEL3_Pos (27) /*!< RTC_T::GPIOCTL0: CTLSEL3 Position */ -#define RTC_GPIOCTL0_CTLSEL3_Msk (0x1ul << RTC_GPIOCTL0_CTLSEL3_Pos) /*!< RTC_T::GPIOCTL0: CTLSEL3 Mask */ - -#define RTC_GPIOCTL0_PUSEL3_Pos (28) /*!< RTC_T::GPIOCTL0: PUSEL3 Position */ -#define RTC_GPIOCTL0_PUSEL3_Msk (0x3ul << RTC_GPIOCTL0_PUSEL3_Pos) /*!< RTC_T::GPIOCTL0: PUSEL3 Mask */ - -#define RTC_GPIOCTL1_OPMODE4_Pos (0) /*!< RTC_T::GPIOCTL1: OPMODE4 Position */ -#define RTC_GPIOCTL1_OPMODE4_Msk (0x3ul << RTC_GPIOCTL1_OPMODE4_Pos) /*!< RTC_T::GPIOCTL1: OPMODE4 Mask */ - -#define RTC_GPIOCTL1_DOUT4_Pos (2) /*!< RTC_T::GPIOCTL1: DOUT4 Position */ -#define RTC_GPIOCTL1_DOUT4_Msk (0x1ul << RTC_GPIOCTL1_DOUT4_Pos) /*!< RTC_T::GPIOCTL1: DOUT4 Mask */ - -#define RTC_GPIOCTL1_CTLSEL4_Pos (3) /*!< RTC_T::GPIOCTL1: CTLSEL4 Position */ -#define RTC_GPIOCTL1_CTLSEL4_Msk (0x1ul << RTC_GPIOCTL1_CTLSEL4_Pos) /*!< RTC_T::GPIOCTL1: CTLSEL4 Mask */ - -#define RTC_GPIOCTL1_PUSEL4_Pos (4) /*!< RTC_T::GPIOCTL1: PUSEL4 Position */ -#define RTC_GPIOCTL1_PUSEL4_Msk (0x3ul << RTC_GPIOCTL1_PUSEL4_Pos) /*!< RTC_T::GPIOCTL1: PUSEL4 Mask */ - -#define RTC_GPIOCTL1_OPMODE5_Pos (8) /*!< RTC_T::GPIOCTL1: OPMODE5 Position */ -#define RTC_GPIOCTL1_OPMODE5_Msk (0x3ul << RTC_GPIOCTL1_OPMODE5_Pos) /*!< RTC_T::GPIOCTL1: OPMODE5 Mask */ - -#define RTC_GPIOCTL1_DOUT5_Pos (10) /*!< RTC_T::GPIOCTL1: DOUT5 Position */ -#define RTC_GPIOCTL1_DOUT5_Msk (0x1ul << RTC_GPIOCTL1_DOUT5_Pos) /*!< RTC_T::GPIOCTL1: DOUT5 Mask */ - -#define RTC_GPIOCTL1_CTLSEL5_Pos (11) /*!< RTC_T::GPIOCTL1: CTLSEL5 Position */ -#define RTC_GPIOCTL1_CTLSEL5_Msk (0x1ul << RTC_GPIOCTL1_CTLSEL5_Pos) /*!< RTC_T::GPIOCTL1: CTLSEL5 Mask */ - -#define RTC_GPIOCTL1_PUSEL5_Pos (12) /*!< RTC_T::GPIOCTL1: PUSEL5 Position */ -#define RTC_GPIOCTL1_PUSEL5_Msk (0x3ul << RTC_GPIOCTL1_PUSEL5_Pos) /*!< RTC_T::GPIOCTL1: PUSEL5 Mask */ - -#define RTC_GPIOCTL1_OPMODE6_Pos (16) /*!< RTC_T::GPIOCTL1: OPMODE6 Position */ -#define RTC_GPIOCTL1_OPMODE6_Msk (0x3ul << RTC_GPIOCTL1_OPMODE6_Pos) /*!< RTC_T::GPIOCTL1: OPMODE6 Mask */ - -#define RTC_GPIOCTL1_DOUT6_Pos (18) /*!< RTC_T::GPIOCTL1: DOUT6 Position */ -#define RTC_GPIOCTL1_DOUT6_Msk (0x1ul << RTC_GPIOCTL1_DOUT6_Pos) /*!< RTC_T::GPIOCTL1: DOUT6 Mask */ - -#define RTC_GPIOCTL1_CTLSEL6_Pos (19) /*!< RTC_T::GPIOCTL1: CTLSEL6 Position */ -#define RTC_GPIOCTL1_CTLSEL6_Msk (0x1ul << RTC_GPIOCTL1_CTLSEL6_Pos) /*!< RTC_T::GPIOCTL1: CTLSEL6 Mask */ - -#define RTC_GPIOCTL1_PUSEL6_Pos (20) /*!< RTC_T::GPIOCTL1: PUSEL6 Position */ -#define RTC_GPIOCTL1_PUSEL6_Msk (0x3ul << RTC_GPIOCTL1_PUSEL6_Pos) /*!< RTC_T::GPIOCTL1: PUSEL6 Mask */ - -#define RTC_GPIOCTL1_OPMODE7_Pos (24) /*!< RTC_T::GPIOCTL1: OPMODE7 Position */ -#define RTC_GPIOCTL1_OPMODE7_Msk (0x3ul << RTC_GPIOCTL1_OPMODE7_Pos) /*!< RTC_T::GPIOCTL1: OPMODE7 Mask */ - -#define RTC_GPIOCTL1_DOUT7_Pos (26) /*!< RTC_T::GPIOCTL1: DOUT7 Position */ -#define RTC_GPIOCTL1_DOUT7_Msk (0x1ul << RTC_GPIOCTL1_DOUT7_Pos) /*!< RTC_T::GPIOCTL1: DOUT7 Mask */ - -#define RTC_GPIOCTL1_CTLSEL7_Pos (27) /*!< RTC_T::GPIOCTL1: CTLSEL7 Position */ -#define RTC_GPIOCTL1_CTLSEL7_Msk (0x1ul << RTC_GPIOCTL1_CTLSEL7_Pos) /*!< RTC_T::GPIOCTL1: CTLSEL7 Mask */ - -#define RTC_GPIOCTL1_PUSEL7_Pos (28) /*!< RTC_T::GPIOCTL1: PUSEL7 Position */ -#define RTC_GPIOCTL1_PUSEL7_Msk (0x3ul << RTC_GPIOCTL1_PUSEL7_Pos) /*!< RTC_T::GPIOCTL1: PUSEL7 Mask */ - -#define RTC_DSTCTL_ADDHR_Pos (0) /*!< RTC_T::DSTCTL: ADDHR Position */ -#define RTC_DSTCTL_ADDHR_Msk (0x1ul << RTC_DSTCTL_ADDHR_Pos) /*!< RTC_T::DSTCTL: ADDHR Mask */ - -#define RTC_DSTCTL_SUBHR_Pos (1) /*!< RTC_T::DSTCTL: SUBHR Position */ -#define RTC_DSTCTL_SUBHR_Msk (0x1ul << RTC_DSTCTL_SUBHR_Pos) /*!< RTC_T::DSTCTL: SUBHR Mask */ - -#define RTC_DSTCTL_DSBAK_Pos (2) /*!< RTC_T::DSTCTL: DSBAK Position */ -#define RTC_DSTCTL_DSBAK_Msk (0x1ul << RTC_DSTCTL_DSBAK_Pos) /*!< RTC_T::DSTCTL: DSBAK Mask */ - -#define RTC_TAMPCTL_DYN1ISS_Pos (0) /*!< RTC_T::TAMPCTL: DYN1ISS Position */ -#define RTC_TAMPCTL_DYN1ISS_Msk (0x1ul << RTC_TAMPCTL_DYN1ISS_Pos) /*!< RTC_T::TAMPCTL: DYN1ISS Mask */ - -#define RTC_TAMPCTL_DYN2ISS_Pos (1) /*!< RTC_T::TAMPCTL: DYN2ISS Position */ -#define RTC_TAMPCTL_DYN2ISS_Msk (0x1ul << RTC_TAMPCTL_DYN2ISS_Pos) /*!< RTC_T::TAMPCTL: DYN2ISS Mask */ - -#define RTC_TAMPCTL_DYNSRC_Pos (2) /*!< RTC_T::TAMPCTL: DYNSRC Position */ -#define RTC_TAMPCTL_DYNSRC_Msk (0x3ul << RTC_TAMPCTL_DYNSRC_Pos) /*!< RTC_T::TAMPCTL: DYNSRC Mask */ - -#define RTC_TAMPCTL_SEEDRLD_Pos (4) /*!< RTC_T::TAMPCTL: SEEDRLD Position */ -#define RTC_TAMPCTL_SEEDRLD_Msk (0x1ul << RTC_TAMPCTL_SEEDRLD_Pos) /*!< RTC_T::TAMPCTL: SEEDRLD Mask */ - -#define RTC_TAMPCTL_DYNRATE_Pos (5) /*!< RTC_T::TAMPCTL: DYNRATE Position */ -#define RTC_TAMPCTL_DYNRATE_Msk (0x7ul << RTC_TAMPCTL_DYNRATE_Pos) /*!< RTC_T::TAMPCTL: DYNRATE Mask */ - -#define RTC_TAMPCTL_TAMP0EN_Pos (8) /*!< RTC_T::TAMPCTL: TAMP0EN Position */ -#define RTC_TAMPCTL_TAMP0EN_Msk (0x1ul << RTC_TAMPCTL_TAMP0EN_Pos) /*!< RTC_T::TAMPCTL: TAMP0EN Mask */ - -#define RTC_TAMPCTL_TAMP0LV_Pos (9) /*!< RTC_T::TAMPCTL: TAMP0LV Position */ -#define RTC_TAMPCTL_TAMP0LV_Msk (0x1ul << RTC_TAMPCTL_TAMP0LV_Pos) /*!< RTC_T::TAMPCTL: TAMP0LV Mask */ - -#define RTC_TAMPCTL_TAMP0DBEN_Pos (10) /*!< RTC_T::TAMPCTL: TAMP0DBEN Position */ -#define RTC_TAMPCTL_TAMP0DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP0DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP0DBEN Mask */ - -#define RTC_TAMPCTL_TAMP1EN_Pos (12) /*!< RTC_T::TAMPCTL: TAMP1EN Position */ -#define RTC_TAMPCTL_TAMP1EN_Msk (0x1ul << RTC_TAMPCTL_TAMP1EN_Pos) /*!< RTC_T::TAMPCTL: TAMP1EN Mask */ - -#define RTC_TAMPCTL_TAMP1LV_Pos (13) /*!< RTC_T::TAMPCTL: TAMP1LV Position */ -#define RTC_TAMPCTL_TAMP1LV_Msk (0x1ul << RTC_TAMPCTL_TAMP1LV_Pos) /*!< RTC_T::TAMPCTL: TAMP1LV Mask */ - -#define RTC_TAMPCTL_TAMP1DBEN_Pos (14) /*!< RTC_T::TAMPCTL: TAMP1DBEN Position */ -#define RTC_TAMPCTL_TAMP1DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP1DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP1DBEN Mask */ - -#define RTC_TAMPCTL_DYNPR0EN_Pos (15) /*!< RTC_T::TAMPCTL: DYNPR0EN Position */ -#define RTC_TAMPCTL_DYNPR0EN_Msk (0x1ul << RTC_TAMPCTL_DYNPR0EN_Pos) /*!< RTC_T::TAMPCTL: DYNPR0EN Mask */ - -#define RTC_TAMPCTL_TAMP2EN_Pos (16) /*!< RTC_T::TAMPCTL: TAMP2EN Position */ -#define RTC_TAMPCTL_TAMP2EN_Msk (0x1ul << RTC_TAMPCTL_TAMP2EN_Pos) /*!< RTC_T::TAMPCTL: TAMP2EN Mask */ - -#define RTC_TAMPCTL_TAMP2LV_Pos (17) /*!< RTC_T::TAMPCTL: TAMP2LV Position */ -#define RTC_TAMPCTL_TAMP2LV_Msk (0x1ul << RTC_TAMPCTL_TAMP2LV_Pos) /*!< RTC_T::TAMPCTL: TAMP2LV Mask */ - -#define RTC_TAMPCTL_TAMP2DBEN_Pos (18) /*!< RTC_T::TAMPCTL: TAMP2DBEN Position */ -#define RTC_TAMPCTL_TAMP2DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP2DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP2DBEN Mask */ - -#define RTC_TAMPCTL_TAMP3EN_Pos (20) /*!< RTC_T::TAMPCTL: TAMP3EN Position */ -#define RTC_TAMPCTL_TAMP3EN_Msk (0x1ul << RTC_TAMPCTL_TAMP3EN_Pos) /*!< RTC_T::TAMPCTL: TAMP3EN Mask */ - -#define RTC_TAMPCTL_TAMP3LV_Pos (21) /*!< RTC_T::TAMPCTL: TAMP3LV Position */ -#define RTC_TAMPCTL_TAMP3LV_Msk (0x1ul << RTC_TAMPCTL_TAMP3LV_Pos) /*!< RTC_T::TAMPCTL: TAMP3LV Mask */ - -#define RTC_TAMPCTL_TAMP3DBEN_Pos (22) /*!< RTC_T::TAMPCTL: TAMP3DBEN Position */ -#define RTC_TAMPCTL_TAMP3DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP3DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP3DBEN Mask */ - -#define RTC_TAMPCTL_DYNPR1EN_Pos (23) /*!< RTC_T::TAMPCTL: DYNPR1EN Position */ -#define RTC_TAMPCTL_DYNPR1EN_Msk (0x1ul << RTC_TAMPCTL_DYNPR1EN_Pos) /*!< RTC_T::TAMPCTL: DYNPR1EN Mask */ - -#define RTC_TAMPCTL_TAMP4EN_Pos (24) /*!< RTC_T::TAMPCTL: TAMP4EN Position */ -#define RTC_TAMPCTL_TAMP4EN_Msk (0x1ul << RTC_TAMPCTL_TAMP4EN_Pos) /*!< RTC_T::TAMPCTL: TAMP4EN Mask */ - -#define RTC_TAMPCTL_TAMP4LV_Pos (25) /*!< RTC_T::TAMPCTL: TAMP4LV Position */ -#define RTC_TAMPCTL_TAMP4LV_Msk (0x1ul << RTC_TAMPCTL_TAMP4LV_Pos) /*!< RTC_T::TAMPCTL: TAMP4LV Mask */ - -#define RTC_TAMPCTL_TAMP4DBEN_Pos (26) /*!< RTC_T::TAMPCTL: TAMP4DBEN Position */ -#define RTC_TAMPCTL_TAMP4DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP4DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP4DBEN Mask */ - -#define RTC_TAMPCTL_TAMP5EN_Pos (28) /*!< RTC_T::TAMPCTL: TAMP5EN Position */ -#define RTC_TAMPCTL_TAMP5EN_Msk (0x1ul << RTC_TAMPCTL_TAMP5EN_Pos) /*!< RTC_T::TAMPCTL: TAMP5EN Mask */ - -#define RTC_TAMPCTL_TAMP5LV_Pos (29) /*!< RTC_T::TAMPCTL: TAMP5LV Position */ -#define RTC_TAMPCTL_TAMP5LV_Msk (0x1ul << RTC_TAMPCTL_TAMP5LV_Pos) /*!< RTC_T::TAMPCTL: TAMP5LV Mask */ - -#define RTC_TAMPCTL_TAMP5DBEN_Pos (30) /*!< RTC_T::TAMPCTL: TAMP5DBEN Position */ -#define RTC_TAMPCTL_TAMP5DBEN_Msk (0x1ul << RTC_TAMPCTL_TAMP5DBEN_Pos) /*!< RTC_T::TAMPCTL: TAMP5DBEN Mask */ - -#define RTC_TAMPCTL_DYNPR2EN_Pos (31) /*!< RTC_T::TAMPCTL: DYNPR2EN Position */ -#define RTC_TAMPCTL_DYNPR2EN_Msk (0x1ul << RTC_TAMPCTL_DYNPR2EN_Pos) /*!< RTC_T::TAMPCTL: DYNPR2EN Mask */ - -#define RTC_TAMPSEED_SEED_Pos (0) /*!< RTC_T::TAMPSEED: SEED Position */ -#define RTC_TAMPSEED_SEED_Msk (0xfffffffful << RTC_TAMPSEED_SEED_Pos) /*!< RTC_T::TAMPSEED: SEED Mask */ - -#define RTC_TAMPTIME_SEC_Pos (0) /*!< RTC_T::TAMPTIME: SEC Position */ -#define RTC_TAMPTIME_SEC_Msk (0xful << RTC_TAMPTIME_SEC_Pos) /*!< RTC_T::TAMPTIME: SEC Mask */ - -#define RTC_TAMPTIME_TENSEC_Pos (4) /*!< RTC_T::TAMPTIME: TENSEC Position */ -#define RTC_TAMPTIME_TENSEC_Msk (0x7ul << RTC_TAMPTIME_TENSEC_Pos) /*!< RTC_T::TAMPTIME: TENSEC Mask */ - -#define RTC_TAMPTIME_MIN_Pos (8) /*!< RTC_T::TAMPTIME: MIN Position */ -#define RTC_TAMPTIME_MIN_Msk (0xful << RTC_TAMPTIME_MIN_Pos) /*!< RTC_T::TAMPTIME: MIN Mask */ - -#define RTC_TAMPTIME_TENMIN_Pos (12) /*!< RTC_T::TAMPTIME: TENMIN Position */ -#define RTC_TAMPTIME_TENMIN_Msk (0x7ul << RTC_TAMPTIME_TENMIN_Pos) /*!< RTC_T::TAMPTIME: TENMIN Mask */ - -#define RTC_TAMPTIME_HR_Pos (16) /*!< RTC_T::TAMPTIME: HR Position */ -#define RTC_TAMPTIME_HR_Msk (0xful << RTC_TAMPTIME_HR_Pos) /*!< RTC_T::TAMPTIME: HR Mask */ - -#define RTC_TAMPTIME_TENHR_Pos (20) /*!< RTC_T::TAMPTIME: TENHR Position */ -#define RTC_TAMPTIME_TENHR_Msk (0x3ul << RTC_TAMPTIME_TENHR_Pos) /*!< RTC_T::TAMPTIME: TENHR Mask */ - -#define RTC_TAMPCAL_DAY_Pos (0) /*!< RTC_T::TAMPCAL: DAY Position */ -#define RTC_TAMPCAL_DAY_Msk (0xful << RTC_TAMPCAL_DAY_Pos) /*!< RTC_T::TAMPCAL: DAY Mask */ - -#define RTC_TAMPCAL_TENDAY_Pos (4) /*!< RTC_T::TAMPCAL: TENDAY Position */ -#define RTC_TAMPCAL_TENDAY_Msk (0x3ul << RTC_TAMPCAL_TENDAY_Pos) /*!< RTC_T::TAMPCAL: TENDAY Mask */ - -#define RTC_TAMPCAL_MON_Pos (8) /*!< RTC_T::TAMPCAL: MON Position */ -#define RTC_TAMPCAL_MON_Msk (0xful << RTC_TAMPCAL_MON_Pos) /*!< RTC_T::TAMPCAL: MON Mask */ - -#define RTC_TAMPCAL_TENMON_Pos (12) /*!< RTC_T::TAMPCAL: TENMON Position */ -#define RTC_TAMPCAL_TENMON_Msk (0x1ul << RTC_TAMPCAL_TENMON_Pos) /*!< RTC_T::TAMPCAL: TENMON Mask */ - -#define RTC_TAMPCAL_YEAR_Pos (16) /*!< RTC_T::TAMPCAL: YEAR Position */ -#define RTC_TAMPCAL_YEAR_Msk (0xful << RTC_TAMPCAL_YEAR_Pos) /*!< RTC_T::TAMPCAL: YEAR Mask */ - -#define RTC_TAMPCAL_TENYEAR_Pos (20) /*!< RTC_T::TAMPCAL: TENYEAR Position */ -#define RTC_TAMPCAL_TENYEAR_Msk (0xful << RTC_TAMPCAL_TENYEAR_Pos) /*!< RTC_T::TAMPCAL: TENYEAR Mask */ - - -/**@}*/ /* RTC_CONST */ -/**@}*/ /* end of RTC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __RTC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sc_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sc_reg.h deleted file mode 100644 index af930b950d1..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sc_reg.h +++ /dev/null @@ -1,1019 +0,0 @@ -/**************************************************************************//** - * @file sc_reg.h - * @version V1.00 - * @brief SC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SC_REG_H__ -#define __SC_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SC Smart Card Host Interface Controller(SC) - Memory Mapped Structure for SC Controller -@{ */ - -typedef struct -{ - - - /** - * @var SC_T::DAT - * Offset: 0x00 SC Receive/Transmit Holding Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Receive/Transmit Holding Buffer - * | | |Write Operation: - * | | |By writing data to DAT, the SC will send out an 8-bit data. - * | | |Note: If SCEN (SCn_CTL[0]) is not enabled, DAT cannot be programmed. - * | | |Read Operation: - * | | |By reading DAT, the SC will return an 8-bit received data. - * @var SC_T::CTL - * Offset: 0x04 SC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SCEN |SC Controller Enable Bit - * | | |Set this bit to 1 to enable SC operation. If this bit is cleared, - * | | |0 = SC will force all transition to IDLE state. - * | | |1 = SC controller is enabled and all function can work correctly. - * | | |Note1: SCEN must be set to 1 before filling in other SC registers, or smart card will not work properly. - * |[1] |RXOFF |RX Transition Disable Control Bit - * | | |This bit is used for disable Rx transition function. - * | | |0 = The receiver Enabled. - * | | |1 = The receiver Disabled. - * | | |Note1: If AUTOCEN (SCn_CTL[3]) is enabled, this field is ignored. - * |[2] |TXOFF |TX Transition Disable Control Bit - * | | |This bit is used for disable Tx transition function. - * | | |0 = The transceiver Enabled. - * | | |1 = The transceiver Disabled. - * |[3] |AUTOCEN |Auto Convention Enable Bit - * | | |This bit is used for enable auto convention function. - * | | |0 = Auto-convention Disabled. - * | | |1 = Auto-convention Enabled. - * | | |If user enables auto convention function, the setting step must be done before Answer to Reset (ATR) - * | | |state and the first data must be 0x3B or 0x3F. - * | | |After hardware received first data and stored it at buffer, hardware will decided the convention and - * | | |change the CONSEL (SCn_CTL[5:4]) bits automatically when received first data is 0x3B or 0x3F. - * | | |If received first byte is 0x3B, TS is direct convention, CONSEL (SCn_CTL[5:4]) will be set to 00 - * | | |automatically, otherwise the TS is inverse convention, and CONSEL (SCn_CTL[5:4]) will be set to 11. - * | | |If the first data is not 0x3B or 0x3F, hardware will set ACERRIF (SCn_INTSTS[10]) and generate an - * | | |interrupt to CPU when ACERRIEN (SCn_INTEN[10]) is enabled. - * |[5:4] |CONSEL |Convention Selection - * | | |00 = Direct convention. - * | | |01 = Reserved. - * | | |10 = Reserved. - * | | |11 = Inverse convention. - * | | |Note: If AUTOCEN (SCn_CTL[3]) is enabled, this field is ignored. - * |[7:6] |RXTRGLV |Rx Buffer Trigger Level - * | | |When the number of bytes in the receiving buffer equals the RXTRGLV, the RDAIF will be set - * | | |If RDAIEN (SCn_INTEN[0]) is enabled, an interrupt will be generated to CPU. - * | | |00 = Rx Buffer Trigger Level with 01 bytes. - * | | |01 = Rx Buffer Trigger Level with 02 bytes. - * | | |10 = Rx Buffer Trigger Level with 03 bytes. - * | | |11 = Reserved. - * |[12:8] |BGT |Block Guard Time (BGT) - * | | |Block guard time means the minimum interval between the leading edges of two consecutive characters - * | | |between different transfer directions - * | | |This field indicates the counter for the bit length of block guard time - * | | |According to ISO 7816-3, in T = 0 mode, user must fill 15 (real block guard time = 16.5) to this - * | | |field; in T = 1 mode, user must fill 21 (real block guard time = 22.5) to it. - * | | |Note: The real block guard time is BGT + 1. - * |[14:13] |TMRSEL |Timer Channel Selection - * | | |00 = All internal timer function Disabled. - * | | |11 = Internal 24 bit timer and two 8 bit timers Enabled - * | | |User can configure them by setting SCn_TMRCTL0[23:0], SCn_TMRCTL1[7:0] and SCn_TMRCTL2[7:0]. - * | | |Other configurations are reserved - * |[15] |NSB |Stop Bit Length - * | | |This field indicates the length of stop bit. - * | | |0 = The stop bit length is 2 ETU. - * | | |1= The stop bit length is 1 ETU. - * | | |Note1: The default stop bit length is 2. SC and UART adopts NSB to program the stop bit length. - * | | |Note2: In UART mode, RX can receive the data sequence in 1 stop bit or 2 stop bits with NSB is set to 0. - * |[18:16] |RXRTY |RX Error Retry Count Number - * | | |This field indicates the maximum number of receiver retries that are allowed when parity error has occurred. - * | | |Note1: The real retry number is RXRTY + 1, so 8 is the maximum retry number. - * | | |Note2: This field cannot be changed when RXRTYEN enabled - * | | |The change flow is to disable RXRTYEN first and then fill in new retry value. - * |[19] |RXRTYEN |RX Error Retry Enable Bit - * | | |This bit enables receiver retry function when parity error has occurred. - * | | |0 = RX error retry function Disabled. - * | | |1 = RX error retry function Enabled. - * | | |Note: User must fill in the RXRTY value before enabling this bit. - * |[22:20] |TXRTY |TX Error Retry Count Number - * | | |This field indicates the maximum number of transmitter retries that are allowed when parity - * | | |error has occurred. - * | | |Note1: The real retry number is TXRTY + 1, so 8 is the maximum retry number. - * | | |Note2: This field cannot be changed when TXRTYEN enabled - * | | |The change flow is to disable TXRTYEN first and then fill in new retry value. - * |[23] |TXRTYEN |TX Error Retry Enable Bit - * | | |This bit enables transmitter retry function when parity error has occurred. - * | | |0 = TX error retry function Disabled. - * | | |1 = TX error retry function Enabled. - * |[25:24] |CDDBSEL |Card Detect De-bounce Selection - * | | |This field indicates the card detect de-bounce selection. - * | | |00 = De-bounce sample card insert once per 384 (128 * 3) SC module clocks and de-bounce - * | | |sample card removal once per 128 SC module clocks. - * | | |Other configurations are reserved. - * |[26] |CDLV |Card Detect Level Selection - * | | |0 = When hardware detects the card detect pin (SCn_CD) from high to low, it indicates a card is detected. - * | | |1 = When hardware detects the card detect pin (SCn_CD) from low to high, it indicates a card is detected. - * | | |Note: User must select card detect level before Smart Card controller enabled. - * |[30] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit before writing a new value to RXRTY and TXRTY fields. - * | | |0 = Synchronizing is completion, user can write new data to RXRTY and TXRTY. - * | | |1 = Last value is synchronizing. - * @var SC_T::ALTCTL - * Offset: 0x08 SC Alternate Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXRST |TX Software Reset - * | | |When TXRST is set, all the bytes in the transmit buffer and TX internal state machine will be cleared. - * | | |0 = No effect. - * | | |1 = Reset the TX internal state machine and pointers. - * | | |Note: This bit will be auto cleared after reset is complete. - * |[1] |RXRST |Rx Software Reset - * | | |When RXRST is set, all the bytes in the receive buffer and Rx internal state machine will be cleared. - * | | |0 = No effect. - * | | |1 = Reset the Rx internal state machine and pointers. - * | | |Note: This bit will be auto cleared after reset is complete. - * |[2] |DACTEN |Deactivation Sequence Generator Enable Bit - * | | |This bit enables SC controller to initiate the card by deactivation sequence. - * | | |0 = No effect. - * | | |1 = Deactivation sequence generator Enabled. - * | | |Note1: When the deactivation sequence completed, this bit will be cleared automatically and - * | | |the INITIF (SCn_INTSTS[8]) will be set to 1. - * | | |Note2: This field will be cleared by TXRST (SCn_ALTCTL[0]) and RXRST (SCn_ALTCTL[1]) - * | | |Thus, do not fill in this bit DACTEN, TXRST and RXRST at the same time. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * |[3] |ACTEN |Activation Sequence Generator Enable Bit - * | | |This bit enables SC controller to initiate the card by activation sequence. - * | | |0 = No effect. - * | | |1 = Activation sequence generator Enabled. - * | | |Note1: When the activation sequence completed, this bit will be cleared automatically and the - * | | |INITIF (SCn_INTSTS[8]) will be set to 1. - * | | |Note2: This field will be cleared by TXRST (SCn_ALTCTL[0]) and RXRST (SCn_ALTCTL[1]) - * | | |Thus, do not fill in this bit ACTEN, TXRST and RXRST at the same time. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * | | |Note4: During the activation sequence, RX is disabled automatically and can not receive data - * | | |After the activation sequence completion, RXOFF (SCn_CTL[1]) keeps the state before hardware activation. - * |[4] |WARSTEN |Warm Reset Sequence Generator Enable Bit - * | | |This bit enables SC controller to initiate the card by warm reset sequence. - * | | |0 = No effect. - * | | |1 = Warm reset sequence generator Enabled. - * | | |Note1: When the warm reset sequence completed, this bit will be cleared automatically and the - * | | |INITIF (SCn_INTSTS[8]) will be set to 1. - * | | |Note2: This field will be cleared by TXRST (SCn_ALTCTL[0]) and RXRST (SCn_ALTCTL[1]) - * | | |Thus, do not fill in this bit WARSTEN, TXRST and RXRST at the same time. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * | | |Note4: During the warm reset sequence, RX is disabled automatically and can not receive data - * | | |After the warm reset sequence completion, RXOFF (SCn_CTL[1]) keeps the state before perform - * | | |warm reset sequence. - * |[5] |CNTEN0 |Internal Timer0 Start Enable Bit - * | | |This bit enables Timer 0 to start counting - * | | |User can fill 0 to stop it and set 1 to reload and count - * | | |The counter unit is ETU base. - * | | |0 = Stops counting. - * | | |1 = Start counting. - * | | |Note1: This field is used for internal 24 bit timer when TMRSEL (SCn_CTL[14:13]) is 11 only. - * | | |Note2: If the operation mode is not in auto-reload mode (SCn_TMRCTL0[26] = 0), this bit will - * | | |be auto-cleared by hardware. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * |[6] |CNTEN1 |Internal Timer1 Start Enable Bit - * | | |This bit enables Timer 1 to start counting - * | | |User can fill 0 to stop it and set 1 to reload and count - * | | |The counter unit is ETU base. - * | | |0 = Stops counting. - * | | |1 = Start counting. - * | | |Note1: This field is used for internal 8 bit timer when TMRSEL(SCn_CTL[14:13]) is 11 only - * | | |Do not fill CNTEN1 when TMRSEL (SCn_CTL[14:13]) is not equal to 11. - * | | |Note2: If the operation mode is not in auto-reload mode (SCn_TMRCTL1[26] = 0), this bit will - * | | |be auto-cleared by hardware. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * |[7] |CNTEN2 |Internal Timer2 Start Enable Bit - * | | |This bit enables Timer 2 to start counting - * | | |User can fill 0 to stop it and set 1 to reload and count - * | | |The counter unit is ETU base. - * | | |0 = Stops counting. - * | | |1 = Start counting. - * | | |Note1: This field is used for internal 8 bit timer when TMRSEL (SCn_CTL[14:13]) is 11 only - * | | |Do not fill in CNTEN2 when TMRSEL (SCn_CTL[14:13]) is not equal to 11. - * | | |Note2: If the operation mode is not in auto-reload mode (SCn_TMRCTL2[26] = 0), this bit will - * | | |be auto-cleared by hardware. - * | | |Note3: If SCEN (SCn_CTL[0]) is not enabled, this filed cannot be programmed. - * |[9:8] |INITSEL |Initial Timing Selection - * | | |This fields indicates the initial timing of hardware activation, warm-reset or deactivation. - * | | |The unit of initial timing is SC module clock. - * | | |Activation: refer to SC Activation Sequence in Figure 7.17-54. - * | | |Warm-reset: refer to Warm-Reset Sequence in Figure 7.17-5. - * | | |Deactivation: refer to Deactivation Sequence in Figure 7.17-56. - * | | |Note: When set activation and warm reset in Timer0 operation mode 0011, it may have deviation - * | | |at most 128 SC module clock cycles. - * |[11] |ADACEN |Auto Deactivation When Card Removal - * | | |This bit is used for enable hardware auto deactivation when smart card is removed. - * | | |0 = Auto deactivation Disabled. - * | | |1 = Auto deactivation Enabled. - * | | |Note: When the card is removed, hardware will stop any process and then do deactivation sequence - * | | |if this bit is set - * | | |If auto deactivation process completes, hardware will set INITIF (SCn_INTSTS[8]) also. - * |[12] |RXBGTEN |Receiver Block Guard Time Function Enable Bit - * | | |This bit enables the receiver block guard time function. - * | | |0 = Receiver block guard time function Disabled. - * | | |1 = Receiver block guard time function Enabled. - * |[13] |ACTSTS0 |Internal Timer0 Active Status (Read Only) - * | | |This bit indicates the timer counter status of timer0. - * | | |0 = Timer0 is not active. - * | | |1 = Timer0 is active. - * | | |Note: Timer0 is active does not always mean timer0 is counting the CNT (SCn_TMRCTL0[23:0]). - * |[14] |ACTSTS1 |Internal Timer1 Active Status (Read Only) - * | | |This bit indicates the timer counter status of timer1. - * | | |0 = Timer1 is not active. - * | | |1 = Timer1 is active. - * | | |Note: Timer1 is active does not always mean timer1 is counting the CNT (SCn_TMRCTL1[7:0]). - * |[15] |ACTSTS2 |Internal Timer2 Active Status (Read Only) - * | | |This bit indicates the timer counter status of timer2. - * | | |0 = Timer2 is not active. - * | | |1 = Timer2 is active. - * | | |Note: Timer2 is active does not always mean timer2 is counting the CNT (SCn_TMRCTL2[7:0]). - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to SCn_ALTCTL register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_ALTCTL register. - * | | |1 = Last value is synchronizing. - * @var SC_T::EGT - * Offset: 0x0C SC Extra Guard Time Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |EGT |Extra Guard Time - * | | |This field indicates the extra guard time value. - * | | |Note: The extra guard time unit is ETU base. - * @var SC_T::RXTOUT - * Offset: 0x10 SC Receive Buffer Time-out Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |RFTM |SC Receiver FIFO Time-out Counter - * | | |The time-out down counter resets and starts counting whenever the RX buffer received a new data - * | | |Once the counter decrease to 1 and no new data is received or CPU does not read data by - * | | |reading SCn_DAT, a receiver time-out flag RBTOIF (SCn_INTSTS[9]) will be set, and hardware will - * | | |generate an interrupt to CPU when RBTOIEN (SCn_INTEN[9]) is enabled. - * | | |Note1: The counter unit is ETU based and the interval of time-out is RFTM + 0.5. - * | | |Note2: Filling in all 0 to this field indicates to disable this function. - * @var SC_T::ETUCTL - * Offset: 0x14 SC Element Time Unit Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ETURDIV |ETU Rate Divider - * | | |The field is used for ETU clock rate divider. - * | | |The real ETU is ETURDIV + 1. - * | | |Note: User can configure this field, but this field must be greater than 0x04. - * @var SC_T::INTEN - * Offset: 0x18 SC Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIEN |Receive Data Reach Interrupt Enable Bit - * | | |This field is used to enable received data reaching trigger level RXTRGLV (SCn_CTL[7:6]) interrupt. - * | | |0 = Receive data reach trigger level interrupt Disabled. - * | | |1 = Receive data reach trigger level interrupt Enabled. - * |[1] |TBEIEN |Transmit Buffer Empty Interrupt Enable Bit - * | | |This field is used to enable transmit buffer empty interrupt. - * | | |0 = Transmit buffer empty interrupt Disabled. - * | | |1 = Transmit buffer empty interrupt Enabled. - * |[2] |TERRIEN |Transfer Error Interrupt Enable Bit - * | | |This field is used to enable transfer error interrupt - * | | |The transfer error states is at SCn_STATUS register which includes receiver break error - * | | |BEF (SCn_STATUS[6]), frame error FEF (SCn_STATUS[5]), parity error PEF (SCn_STATUS[4]), receive - * | | |buffer overflow error RXOV (SCn_STATUS[0]), transmit buffer overflow error TXOV (SCn_STATUS[8]), - * | | |receiver retry over limit error RXOVERR (SCn_STATUS[22]) and transmitter retry over limit error - * | | |TXOVERR (SCn_STATUS[30]). - * | | |0 = Transfer error interrupt Disabled. - * | | |1 = Transfer error interrupt Enabled. - * |[3] |TMR0IEN |Timer0 Interrupt Enable Bit - * | | |This field is used to enable Timer0 interrupt function. - * | | |0 = Timer0 interrupt Disabled. - * | | |1 = Timer0 interrupt Enabled. - * |[4] |TMR1IEN |Timer1 Interrupt Enable Bit - * | | |This field is used to enable the Timer1 interrupt function. - * | | |0 = Timer1 interrupt Disabled. - * | | |1 = Timer1 interrupt Enabled. - * |[5] |TMR2IEN |Timer2 Interrupt Enable Bit - * | | |This field is used to enable Timer2 interrupt function. - * | | |0 = Timer2 interrupt Disabled. - * | | |1 = Timer2 interrupt Enabled. - * |[6] |BGTIEN |Block Guard Time Interrupt Enable Bit - * | | |This field is used to enable block guard time interrupt in receive direction. - * | | |0 = Block guard time interrupt Disabled. - * | | |1 = Block guard time interrupt Enabled. - * | | |Note: This bit is valid only for receive direction block guard time. - * |[7] |CDIEN |Card Detect Interrupt Enable Bit - * | | |This field is used to enable card detect interrupt - * | | |The card detect status is CDPINSTS (SCn_STATUS[13]). - * | | |0 = Card detect interrupt Disabled. - * | | |1 = Card detect interrupt Enabled. - * |[8] |INITIEN |Initial End Interrupt Enable Bit - * | | |This field is used to enable activation (ACTEN (SCn_ALTCTL[3] = 1)), deactivation - * | | |(DACTEN (SCn_ALTCTL[2] = 1)) and warm reset (WARSTEN (SCn_ALTCTL [4])) sequence complete interrupt. - * | | |0 = Initial end interrupt Disabled. - * | | |1 = Initial end interrupt Enabled. - * |[9] |RXTOIEN |Receiver Buffer Time-out Interrupt Enable Bit - * | | |This field is used to enable receiver buffer time-out interrupt. - * | | |0 = Receiver buffer time-out interrupt Disabled. - * | | |1 = Receiver buffer time-out interrupt Enabled. - * |[10] |ACERRIEN |Auto Convention Error Interrupt Enable Bit - * | | |This field is used to enable auto-convention error interrupt. - * | | |0 = Auto-convention error interrupt Disabled. - * | | |1 = Auto-convention error interrupt Enabled. - * @var SC_T::INTSTS - * Offset: 0x1C SC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIF |Receive Data Reach Interrupt Status Flag (Read Only) - * | | |This field is used for received data reaching trigger level RXTRGLV (SCn_CTL[7:6]) interrupt status flag. - * | | |0 = Number of receive buffer is less than RXTRGLV setting. - * | | |1 = Number of receive buffer data equals the RXTRGLV setting. - * | | |Note: This bit is read only - * | | |If user reads data from SCn_DAT and receiver buffer data byte number is less than RXTRGLV, - * | | |this bit will be cleared automatically. - * |[1] |TBEIF |Transmit Buffer Empty Interrupt Status Flag (Read Only) - * | | |This field is used for transmit buffer empty interrupt status flag. - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty. - * | | |Note: This bit is read only - * | | |If user wants to clear this bit, user must write data to DAT (SCn_DAT[7:0]) and then this bit - * | | |will be cleared automatically. - * |[2] |TERRIF |Transfer Error Interrupt Status Flag - * | | |This field is used for transfer error interrupt status flag - * | | |The transfer error states is at SCn_STATUS register which includes receiver break error - * | | |BEF (SCn_STATUS[6]), frame error FEF (SCn_STATUS[5], parity error PEF (SCn_STATUS[4] and receive - * | | |buffer overflow error RXOV (SCn_STATUS[0]), transmit buffer overflow error TXOV (SCn_STATUS[8]), - * | | |receiver retry over limit error RXOVERR (SCn_STATUS[22] or transmitter retry over limit error - * | | |TXOVERR (SCn_STATUS[30]). - * | | |0 = Transfer error interrupt did not occur. - * | | |1 = Transfer error interrupt occurred. - * | | |Note1: This field is the status flag of BEF, FEF, PEF, RXOV, TXOV, RXOVERR or TXOVERR. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[3] |TMR0IF |Timer0 Interrupt Status Flag - * | | |This field is used for Timer0 interrupt status flag. - * | | |0 = Timer0 interrupt did not occur. - * | | |1 = Timer0 interrupt occurred. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[4] |TMR1IF |Timer1 Interrupt Status Flag - * | | |This field is used for Timer1 interrupt status flag. - * | | |0 = Timer1 interrupt did not occur. - * | | |1 = Timer1 interrupt occurred. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[5] |TMR2IF |Timer2 Interrupt Status Flag - * | | |This field is used for Timer2 interrupt status flag. - * | | |0 = Timer2 interrupt did not occur. - * | | |1 = Timer2 interrupt occurred. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[6] |BGTIF |Block Guard Time Interrupt Status Flag - * | | |This field is used for indicate block guard time interrupt status flag in receive direction. - * | | |0 = Block guard time interrupt did not occur. - * | | |1 = Block guard time interrupt occurred. - * | | |Note1: This bit is valid only when RXBGTEN (SCn_ALTCTL[12]) is enabled. - * | | |Note2: This bit can be cleared by writing 1 to it. - * |[7] |CDIF |Card Detect Interrupt Status Flag (Read Only) - * | | |This field is used for card detect interrupt status flag - * | | |The card detect status is CINSERT (SCn_STATUS[12]) and CREMOVE (SCn_STATUS[11]). - * | | |0 = Card detect event did not occur. - * | | |1 = Card detect event occurred. - * | | |Note: This bit is read only, user must to clear CINSERT or CREMOVE status to clear it. - * |[8] |INITIF |Initial End Interrupt Status Flag - * | | |This field is used for activation (ACTEN (SCn_ALTCTL[3])), deactivation (DACTEN (SCn_ALTCTL[2])) - * | | |and warm reset (WARSTEN (SCn_ALTCTL[4])) sequence interrupt status flag. - * | | |0 = Initial sequence is not complete. - * | | |1 = Initial sequence is completed. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[9] |RXTOIF |Receive Buffer Time-out Interrupt Status Flag (Read Only) - * | | |This field is used for indicate receive buffer time-out interrupt status flag. - * | | |0 = Receive buffer time-out interrupt did not occur. - * | | |1 = Receive buffer time-out interrupt occurred. - * | | |Note: This bit is read only, user must read all receive buffer remaining data by reading SCn_DAT - * | | |register to clear it. - * |[10] |ACERRIF |Auto Convention Error Interrupt Status Flag - * | | |This field indicates auto convention sequence error. - * | | |0 = Received TS at ATR state is 0x3B or 0x3F. - * | | |1 = Received TS at ATR state is neither 0x3B nor 0x3F. - * | | |Note: This bit can be cleared by writing 1 to it. - * @var SC_T::STATUS - * Offset: 0x20 SC Transfer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXOV |Receive Overflow Error Status Flag - * | | |This bit is set when Rx buffer overflow. - * | | |0 = Rx buffer is not overflow. - * | | |1 = Rx buffer is overflow when the number of received bytes is greater than Rx buffer size (4 bytes). - * | | |Note: This bit can be cleared by writing 1 to it. - * |[1] |RXEMPTY |Receive Buffer Empty Status Flag (Read Only) - * | | |This bit indicates Rx buffer empty or not. - * | | |0 = Rx buffer is not empty. - * | | |1 = Rx buffer is empty, it means the last byte of Rx buffer has read from DAT (SCn_DAT[7:0]) by CPU. - * |[2] |RXFULL |Receive Buffer Full Status Flag (Read Only) - * | | |This bit indicates Rx buffer full or not. - * | | |0 = Rx buffer count is less than 4. - * | | |1 = Rx buffer count equals to 4. - * |[4] |PEF |Receiver Parity Error Status Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid parity bit. - * | | |0 = Receiver parity error flag did not occur. - * | | |1 = Receiver parity error flag occurred. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU sets receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not - * | | |set this flag. - * |[5] |FEF |Receiver Frame Error Status Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid stop bit (that is, - * | | |the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = Receiver frame error flag did not occur. - * | | |1 = Receiver frame error flag occurred. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU sets receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not - * | | |set this flag. - * |[6] |BEF |Receiver Break Error Status Flag - * | | |This bit is set to logic 1 whenever the received data input (Rx) held in the spacing state - * | | |(logic 0) is longer than a full word transmission time (that is, the total time of start bit + - * | | |data bits + parity bit + stop bit). - * | | |0 = Receiver break error flag did not occur. - * | | |1 = Receiver break error flag occurred. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU sets receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware will not set - * | | |this flag. - * |[8] |TXOV |Transmit Overflow Error Interrupt Status Flag - * | | |This bit is set when Tx buffer overflow. - * | | |0 = Tx buffer is not overflow. - * | | |1 = Tx buffer is overflow when Tx buffer is full and an additional write operation to DAT (SCn_DAT[7:0]). - * | | |Note: This bit can be cleared by writing 1 to it. - * |[9] |TXEMPTY |Transmit Buffer Empty Status Flag (Read Only) - * | | |This bit indicates TX buffer empty or not. - * | | |0 = Tx buffer is not empty. - * | | |1 = Tx buffer is empty, it means the last byte of Tx buffer has been transferred to Transmitter - * | | |Shift Register. - * | | |Note: This bit will be cleared when writing data into DAT (SCn_DAT[7:0]). - * |[10] |TXFULL |Transmit Buffer Full Status Flag (Read Only) - * | | |This bit indicates Tx buffer full or not. - * | | |0 = Tx buffer count is less than 4. - * | | |1 = Tx buffer count equals to 4. - * |[11] |CREMOVE |Card Removal Status of SCn_CD Pin - * | | |This bit is set whenever card has been removal. - * | | |0 = No effect. - * | | |1 = Card removed. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: Card detect function will start after SCEN (SCn_CTL[0]) set. - * |[12] |CINSERT |Card Insert Status of SCn_CD Pin - * | | |This bit is set whenever card has been inserted. - * | | |0 = No effect. - * | | |1 = Card insert. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: The card detect function will start after SCEN (SCn_CTL[0]) set. - * |[13] |CDPINSTS |Card Detect Pin Status (Read Only) - * | | |This bit is the pin status of SCn_CD. - * | | |0 = The SCn_CD pin state at low. - * | | |1 = The SCn_CD pin state at high. - * |[18:16] |RXPOINT |Receive Buffer Pointer Status (Read Only) - * | | |This field indicates the Rx buffer pointer status - * | | |When SC controller receives one byte from external device, RXPOINT increases one - * | | |When one byte of Rx buffer is read by CPU, RXPOINT decreases one. - * |[21] |RXRERR |Receiver Retry Error - * | | |This bit is used for receiver error retry and set by hardware. - * | | |0 = No Rx retry transfer. - * | | |1 = Rx has any error and retries transfer. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2 This bit is a flag and cannot generate any interrupt to CPU. - * | | |Note3: If CPU enables receiver retries function by setting RXRTYEN (SCn_CTL[19]), - * | | |hardware will not set this flag. - * |[22] |RXOVERR |Receiver over Retry Error - * | | |This bit is used for receiver retry counts over than retry number limitation. - * | | |0 = Receiver retries counts is not over than RXRTY (SCn_CTL[18:16]) + 1. - * | | |1 = Receiver retries counts over than RXRTY (SCn_CTL[18:16]) + 1. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: If CPU enables receiver retries function by setting RXRTYEN (SCn_CTL[19]), hardware - * | | |will not set this flag. - * |[23] |RXACT |Receiver in Active Status Flag (Read Only) - * | | |This bit indicates Rx transfer status. - * | | |0 = This bit is cleared automatically when Rx transfer is finished. - * | | |1 = This bit is set by hardware when Rx transfer is in active. - * | | |Note: This bit is read only. - * |[26:24] |TXPOINT |Transmit Buffer Pointer Status (Read Only) - * | | |This field indicates the Tx buffer pointer status - * | | |When CPU writes data into SCn_DAT, TXPOINT increases one - * | | |When one byte of Tx buffer is transferred to transmitter shift register, TXPOINT decreases one. - * |[29] |TXRERR |Transmitter Retry Error - * | | |This bit is used for indicate transmitter error retry and set by hardware. - * | | |0 = No Tx retry transfer. - * | | |1 = Tx has any error and retries transfer. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is a flag and cannot generate any interrupt to CPU. - * |[30] |TXOVERR |Transmitter over Retry Error - * | | |This bit is used for transmitter retry counts over than retry number limitation. - * | | |0 = Transmitter retries counts is not over than TXRTY (SCn_CTL[22:20]) + 1. - * | | |1 = Transmitter retries counts over than TXRTY (SCn_CTL[22:20]) + 1. - * | | |Note: This bit can be cleared by writing 1 to it. - * |[31] |TXACT |Transmit in Active Status Flag (Read Only) - * | | |This bit indicates Tx transmit status. - * | | |0 = This bit is cleared automatically when Tx transfer is finished or the last byte transmission - * | | |has completed. - * | | |1 = Transmit is active and this bit is set by hardware when Tx transfer is in active and the STOP - * | | |bit of the last byte has not been transmitted. - * | | |Note: This bit is read only. - * @var SC_T::PINCTL - * Offset: 0x24 SC Pin Control State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWREN |SCn_PWR Pin Signal - * | | |User can set PWRINV (SCn_PINCTL[11]) and PWREN (SCn_PINCTL[0]) to decide SCn_PWR pin is in high or low level. - * | | |Write this field to drive SCn_PWR pin - * | | |Refer PWRINV (SCn_PINCTL[11]) description for programming SCn_PWR pin voltage level. - * | | |Read this field to get SCn_PWR signal status. - * | | |0 = SCn_PWR signal status is low. - * | | |1 = SCn_PWR signal status is high. - * | | |Note: When operating at activation, warm reset or deactivation mode, this bit will be changed automatically. - * | | |Thus, do not fill in this field when operating in these modes. - * |[1] |RSTEN |SCn_RST Pin Signal - * | | |User can set RSTEN (SCn_PINCTL[1]) to decide SCn_RST pin is in high or low level. - * | | |Write this field to drive SCn_RST pin. - * | | |0 = Drive SCn_RST pin to low. - * | | |1 = Drive SCn_RST pin to high. - * | | |Read this field to get SCn_RST signal status. - * | | |0 = SCn_RST signal status is low. - * | | |1 = SCn_RST signal status is high. - * | | |Note: When operating at activation, warm reset or deactivation mode, this bit will be changed automatically. - * | | |Thus, do not fill in this field when operating in these modes. - * |[6] |CLKKEEP |SC Clock Enable Bit - * | | |0 = SC clock generation Disabled. - * | | |1 = SC clock always keeps free running. - * | | |Note: When operating in activation, warm reset or deactivation mode, this bit will be changed automatically. - * | | |Thus, do not fill in this field when operating in these modes. - * |[9] |SCDATA |SCn_DATA Pin Signal - * | | |This bit is the signal status of SCn_DATA but user can drive SCn_DATA pin to high or low by setting this bit. - * | | |0 = Drive SCn_DATA pin to low. - * | | |1 = Drive SCn_DATA pin to high. - * | | |Read this field to get SCn_DATA signal status. - * | | |0 = SCn_DATA signal status is low. - * | | |1 = SCn_DATA signal status is high. - * | | |Note: When SC is at activation, warm reset or deactivation mode, this bit will be changed automatically. - * | | |Thus, do not fill in this field when SC is in these modes. - * |[11] |PWRINV |SCn_PWR Pin Inverse - * | | |This bit is used for inverse the SCn_PWR pin. - * | | |There are four kinds of combination for SCn_PWR pin setting by PWRINV (SCn_PINCTL[11]) and PWREN (SCn_PINCTL[0]). - * | | |PWRINV is 0 and PWREN is 0, SCn_PWR pin is 0. - * | | |PWRINV is 0 and PWREN is 1, SCn_PWR pin is 1. - * | | |PWRINV is 1 and PWREN is 0, SCn_PWR pin is 1. - * | | |PWRINV is 1 and PWREN is 1, SCn_PWR pin is 0. - * | | |Note: User must select PWRINV (SCn_PINCTL[11]) before smart card is enabled by SCEN (SCn_CTL[0]). - * |[16] |DATASTS |SCn_DATA Pin Status (Read Only) - * | | |This bit is the pin status of SCn_DATA. - * | | |0 = The SCn_DATA pin status is low. - * | | |1 = The SCn_DATA pin status is high. - * |[17] |PWRSTS |SCn_PWR Pin Status (Read Only) - * | | |This bit is the pin status of SCn_PWR. - * | | |0 = SCn_PWR pin to low. - * | | |1 = SCn_PWR pin to high. - * |[18] |RSTSTS |SCn_RST Pin Status (Read Only) - * | | |This bit is the pin status of SCn_RST. - * | | |0 = SCn_RST pin is low. - * | | |1 = SCn_RST pin is high. - * |[30] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to SCn_PINCTL register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_PINCTL register. - * | | |1 = Last value is synchronizing. - * @var SC_T::TMRCTL0 - * Offset: 0x28 SC Internal Timer0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Timer0 Counter Value - * | | |This field indicates the internal Timer0 counter values. - * | | |Note: Unit of Timer0 counter is ETU base. - * |[27:24] |OPMODE |Timer0 Operation Mode Selection - * | | |This field indicates the internal 24-bit Timer0 operation selection. - * | | |Refer to Table 7.17-3 for programming Timer0. - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to the SCn_TMRCTL0 register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_TMRCTL0 register. - * | | |1 = Last value is synchronizing. - * @var SC_T::TMRCTL1 - * Offset: 0x2C SC Internal Timer1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNT |Timer 1 Counter Value - * | | |This field indicates the internal Timer1 counter values. - * | | |Note: Unit of Timer1 counter is ETU base. - * |[27:24] |OPMODE |Timer 1 Operation Mode Selection - * | | |This field indicates the internal 8-bit Timer1 operation selection. - * | | |Refer to Table 7.17-3 for programming Timer1. - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, software should check this bit when writing a new value to SCn_TMRCTL1 register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_TMRCTL1 register. - * | | |1 = Last value is synchronizing. - * @var SC_T::TMRCTL2 - * Offset: 0x30 SC Internal Timer2 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNT |Timer 2 Counter Value - * | | |This field indicates the internal Timer2 counter values. - * | | |Note: Unit of Timer2 counter is ETU base. - * |[27:24] |OPMODE |Timer 2 Operation Mode Selection - * | | |This field indicates the internal 8-bit Timer2 operation selection - * | | |Refer to Table 7.17-3 for programming Timer2. - * |[31] |SYNC |SYNC Flag Indicator (Read Only) - * | | |Due to synchronization, user should check this bit when writing a new value to SCn_TMRCTL2 register. - * | | |0 = Synchronizing is completion, user can write new data to SCn_TMRCTL2 register. - * | | |1 = Last value is synchronizing. - * @var SC_T::UARTCTL - * Offset: 0x34 SC UART Mode Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |UARTEN |UART Mode Enable Bit - * | | |Sets this bit to enable UART mode function. - * | | |0 = Smart Card mode. - * | | |1 = UART mode. - * | | |Note1: When operating in UART mode, user must set CONSEL (SCn_CTL[5:4]) = 00 and AUTOCEN (SCn_CTL[3]) = 0. - * | | |Note2: When operating in Smart Card mode, user must set UARTEN (SCn_UARTCTL[0]) = 0. - * | | |Note3: When UART mode is enabled, hardware will generate a reset to reset FIFO and internal state machine. - * |[5:4] |WLS |Word Length Selection - * | | |This field is used for select UART data length. - * | | |00 = Word length is 8 bits. - * | | |01 = Word length is 7 bits. - * | | |10 = Word length is 6 bits. - * | | |11 = Word length is 5 bits. - * | | |Note: In smart card mode, this WLS must be '00'. - * |[6] |PBOFF |Parity Bit Disable Control - * | | |Sets this bit is used for disable parity check function. - * | | |0 = Parity bit is generated or checked between the last data word bit and stop bit of the serial data. - * | | |1 = Parity bit is not generated (transmitting data) or checked (receiving data) during transfer. - * | | |Note: In smart card mode, this field must be '0' (default setting is with parity bit). - * |[7] |OPE |Odd Parity Enable Bit - * | | |This is used for odd/even parity selection. - * | | |0 = Even number of logic 1's are transmitted or check the data word and parity bits in receiving mode. - * | | |1 = Odd number of logic 1's are transmitted or check the data word and parity bits in receiving mode. - * | | |Note: This bit has effect only when PBOFF bit is '0'. - * @var SC_T::ACTCTL - * Offset: 0x4C SC Activation Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |T1EXT |T1 Extend Time of Hardware Activation - * | | |This field provide the configurable cycles to extend the activation time T1 period. - * | | |The cycle scaling factor is 2048. - * | | |Extend cycles = (filled value * 2048) cycles. - * | | |Refer to SC activation sequence in Figure 7.17-4. - * | | |For example, - * | | |SCLK = 4MHz, each cycle = 0.25us,. - * | | |Filled 20 to this field - * | | |Extend time = 20 * 2048 * 0.25us = 10.24 ms. - * | | |Note: Setting 0 to this field conforms to the protocol ISO/IEC 7816-3 - */ - __IO uint32_t DAT; /*!< [0x0000] SC Receive/Transmit Holding Buffer Register */ - __IO uint32_t CTL; /*!< [0x0004] SC Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0008] SC Alternate Control Register */ - __IO uint32_t EGT; /*!< [0x000c] SC Extra Guard Time Register */ - __IO uint32_t RXTOUT; /*!< [0x0010] SC Receive Buffer Time-out Counter Register */ - __IO uint32_t ETUCTL; /*!< [0x0014] SC Element Time Unit Control Register */ - __IO uint32_t INTEN; /*!< [0x0018] SC Interrupt Enable Control Register */ - __IO uint32_t INTSTS; /*!< [0x001c] SC Interrupt Status Register */ - __IO uint32_t STATUS; /*!< [0x0020] SC Transfer Status Register */ - __IO uint32_t PINCTL; /*!< [0x0024] SC Pin Control State Register */ - __IO uint32_t TMRCTL0; /*!< [0x0028] SC Internal Timer0 Control Register */ - __IO uint32_t TMRCTL1; /*!< [0x002c] SC Internal Timer1 Control Register */ - __IO uint32_t TMRCTL2; /*!< [0x0030] SC Internal Timer2 Control Register */ - __IO uint32_t UARTCTL; /*!< [0x0034] SC UART Mode Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[5]; - /** @endcond */ - __IO uint32_t ACTCTL; /*!< [0x004c] SC Activation Control Register */ - -} SC_T; - -/** - @addtogroup SC_CONST SC Bit Field Definition - Constant Definitions for SC Controller -@{ */ - -#define SC_DAT_DAT_Pos (0) /*!< SC_T::DAT: DAT Position */ -#define SC_DAT_DAT_Msk (0xfful << SC_DAT_DAT_Pos) /*!< SC_T::DAT: DAT Mask */ - -#define SC_CTL_SCEN_Pos (0) /*!< SC_T::CTL: SCEN Position */ -#define SC_CTL_SCEN_Msk (0x1ul << SC_CTL_SCEN_Pos) /*!< SC_T::CTL: SCEN Mask */ - -#define SC_CTL_RXOFF_Pos (1) /*!< SC_T::CTL: RXOFF Position */ -#define SC_CTL_RXOFF_Msk (0x1ul << SC_CTL_RXOFF_Pos) /*!< SC_T::CTL: RXOFF Mask */ - -#define SC_CTL_TXOFF_Pos (2) /*!< SC_T::CTL: TXOFF Position */ -#define SC_CTL_TXOFF_Msk (0x1ul << SC_CTL_TXOFF_Pos) /*!< SC_T::CTL: TXOFF Mask */ - -#define SC_CTL_AUTOCEN_Pos (3) /*!< SC_T::CTL: AUTOCEN Position */ -#define SC_CTL_AUTOCEN_Msk (0x1ul << SC_CTL_AUTOCEN_Pos) /*!< SC_T::CTL: AUTOCEN Mask */ - -#define SC_CTL_CONSEL_Pos (4) /*!< SC_T::CTL: CONSEL Position */ -#define SC_CTL_CONSEL_Msk (0x3ul << SC_CTL_CONSEL_Pos) /*!< SC_T::CTL: CONSEL Mask */ - -#define SC_CTL_RXTRGLV_Pos (6) /*!< SC_T::CTL: RXTRGLV Position */ -#define SC_CTL_RXTRGLV_Msk (0x3ul << SC_CTL_RXTRGLV_Pos) /*!< SC_T::CTL: RXTRGLV Mask */ - -#define SC_CTL_BGT_Pos (8) /*!< SC_T::CTL: BGT Position */ -#define SC_CTL_BGT_Msk (0x1ful << SC_CTL_BGT_Pos) /*!< SC_T::CTL: BGT Mask */ - -#define SC_CTL_TMRSEL_Pos (13) /*!< SC_T::CTL: TMRSEL Position */ -#define SC_CTL_TMRSEL_Msk (0x3ul << SC_CTL_TMRSEL_Pos) /*!< SC_T::CTL: TMRSEL Mask */ - -#define SC_CTL_NSB_Pos (15) /*!< SC_T::CTL: NSB Position */ -#define SC_CTL_NSB_Msk (0x1ul << SC_CTL_NSB_Pos) /*!< SC_T::CTL: NSB Mask */ - -#define SC_CTL_RXRTY_Pos (16) /*!< SC_T::CTL: RXRTY Position */ -#define SC_CTL_RXRTY_Msk (0x7ul << SC_CTL_RXRTY_Pos) /*!< SC_T::CTL: RXRTY Mask */ - -#define SC_CTL_RXRTYEN_Pos (19) /*!< SC_T::CTL: RXRTYEN Position */ -#define SC_CTL_RXRTYEN_Msk (0x1ul << SC_CTL_RXRTYEN_Pos) /*!< SC_T::CTL: RXRTYEN Mask */ - -#define SC_CTL_TXRTY_Pos (20) /*!< SC_T::CTL: TXRTY Position */ -#define SC_CTL_TXRTY_Msk (0x7ul << SC_CTL_TXRTY_Pos) /*!< SC_T::CTL: TXRTY Mask */ - -#define SC_CTL_TXRTYEN_Pos (23) /*!< SC_T::CTL: TXRTYEN Position */ -#define SC_CTL_TXRTYEN_Msk (0x1ul << SC_CTL_TXRTYEN_Pos) /*!< SC_T::CTL: TXRTYEN Mask */ - -#define SC_CTL_CDDBSEL_Pos (24) /*!< SC_T::CTL: CDDBSEL Position */ -#define SC_CTL_CDDBSEL_Msk (0x3ul << SC_CTL_CDDBSEL_Pos) /*!< SC_T::CTL: CDDBSEL Mask */ - -#define SC_CTL_CDLV_Pos (26) /*!< SC_T::CTL: CDLV Position */ -#define SC_CTL_CDLV_Msk (0x1ul << SC_CTL_CDLV_Pos) /*!< SC_T::CTL: CDLV Mask */ - -#define SC_CTL_SYNC_Pos (30) /*!< SC_T::CTL: SYNC Position */ -#define SC_CTL_SYNC_Msk (0x1ul << SC_CTL_SYNC_Pos) /*!< SC_T::CTL: SYNC Mask */ - -#define SC_ALTCTL_TXRST_Pos (0) /*!< SC_T::ALTCTL: TXRST Position */ -#define SC_ALTCTL_TXRST_Msk (0x1ul << SC_ALTCTL_TXRST_Pos) /*!< SC_T::ALTCTL: TXRST Mask */ - -#define SC_ALTCTL_RXRST_Pos (1) /*!< SC_T::ALTCTL: RXRST Position */ -#define SC_ALTCTL_RXRST_Msk (0x1ul << SC_ALTCTL_RXRST_Pos) /*!< SC_T::ALTCTL: RXRST Mask */ - -#define SC_ALTCTL_DACTEN_Pos (2) /*!< SC_T::ALTCTL: DACTEN Position */ -#define SC_ALTCTL_DACTEN_Msk (0x1ul << SC_ALTCTL_DACTEN_Pos) /*!< SC_T::ALTCTL: DACTEN Mask */ - -#define SC_ALTCTL_ACTEN_Pos (3) /*!< SC_T::ALTCTL: ACTEN Position */ -#define SC_ALTCTL_ACTEN_Msk (0x1ul << SC_ALTCTL_ACTEN_Pos) /*!< SC_T::ALTCTL: ACTEN Mask */ - -#define SC_ALTCTL_WARSTEN_Pos (4) /*!< SC_T::ALTCTL: WARSTEN Position */ -#define SC_ALTCTL_WARSTEN_Msk (0x1ul << SC_ALTCTL_WARSTEN_Pos) /*!< SC_T::ALTCTL: WARSTEN Mask */ - -#define SC_ALTCTL_CNTEN0_Pos (5) /*!< SC_T::ALTCTL: CNTEN0 Position */ -#define SC_ALTCTL_CNTEN0_Msk (0x1ul << SC_ALTCTL_CNTEN0_Pos) /*!< SC_T::ALTCTL: CNTEN0 Mask */ - -#define SC_ALTCTL_CNTEN1_Pos (6) /*!< SC_T::ALTCTL: CNTEN1 Position */ -#define SC_ALTCTL_CNTEN1_Msk (0x1ul << SC_ALTCTL_CNTEN1_Pos) /*!< SC_T::ALTCTL: CNTEN1 Mask */ - -#define SC_ALTCTL_CNTEN2_Pos (7) /*!< SC_T::ALTCTL: CNTEN2 Position */ -#define SC_ALTCTL_CNTEN2_Msk (0x1ul << SC_ALTCTL_CNTEN2_Pos) /*!< SC_T::ALTCTL: CNTEN2 Mask */ - -#define SC_ALTCTL_INITSEL_Pos (8) /*!< SC_T::ALTCTL: INITSEL Position */ -#define SC_ALTCTL_INITSEL_Msk (0x3ul << SC_ALTCTL_INITSEL_Pos) /*!< SC_T::ALTCTL: INITSEL Mask */ - -#define SC_ALTCTL_ADACEN_Pos (11) /*!< SC_T::ALTCTL: ADACEN Position */ -#define SC_ALTCTL_ADACEN_Msk (0x1ul << SC_ALTCTL_ADACEN_Pos) /*!< SC_T::ALTCTL: ADACEN Mask */ - -#define SC_ALTCTL_RXBGTEN_Pos (12) /*!< SC_T::ALTCTL: RXBGTEN Position */ -#define SC_ALTCTL_RXBGTEN_Msk (0x1ul << SC_ALTCTL_RXBGTEN_Pos) /*!< SC_T::ALTCTL: RXBGTEN Mask */ - -#define SC_ALTCTL_ACTSTS0_Pos (13) /*!< SC_T::ALTCTL: ACTSTS0 Position */ -#define SC_ALTCTL_ACTSTS0_Msk (0x1ul << SC_ALTCTL_ACTSTS0_Pos) /*!< SC_T::ALTCTL: ACTSTS0 Mask */ - -#define SC_ALTCTL_ACTSTS1_Pos (14) /*!< SC_T::ALTCTL: ACTSTS1 Position */ -#define SC_ALTCTL_ACTSTS1_Msk (0x1ul << SC_ALTCTL_ACTSTS1_Pos) /*!< SC_T::ALTCTL: ACTSTS1 Mask */ - -#define SC_ALTCTL_ACTSTS2_Pos (15) /*!< SC_T::ALTCTL: ACTSTS2 Position */ -#define SC_ALTCTL_ACTSTS2_Msk (0x1ul << SC_ALTCTL_ACTSTS2_Pos) /*!< SC_T::ALTCTL: ACTSTS2 Mask */ - -#define SC_ALTCTL_SYNC_Pos (31) /*!< SC_T::ALTCTL: SYNC Position */ -#define SC_ALTCTL_SYNC_Msk (0x1ul << SC_ALTCTL_SYNC_Pos) /*!< SC_T::ALTCTL: SYNC Mask */ - -#define SC_EGT_EGT_Pos (0) /*!< SC_T::EGT: EGT Position */ -#define SC_EGT_EGT_Msk (0xfful << SC_EGT_EGT_Pos) /*!< SC_T::EGT: EGT Mask */ - -#define SC_RXTOUT_RFTM_Pos (0) /*!< SC_T::RXTOUT: RFTM Position */ -#define SC_RXTOUT_RFTM_Msk (0x1fful << SC_RXTOUT_RFTM_Pos) /*!< SC_T::RXTOUT: RFTM Mask */ - -#define SC_ETUCTL_ETURDIV_Pos (0) /*!< SC_T::ETUCTL: ETURDIV Position */ -#define SC_ETUCTL_ETURDIV_Msk (0xffful << SC_ETUCTL_ETURDIV_Pos) /*!< SC_T::ETUCTL: ETURDIV Mask */ - -#define SC_INTEN_RDAIEN_Pos (0) /*!< SC_T::INTEN: RDAIEN Position */ -#define SC_INTEN_RDAIEN_Msk (0x1ul << SC_INTEN_RDAIEN_Pos) /*!< SC_T::INTEN: RDAIEN Mask */ - -#define SC_INTEN_TBEIEN_Pos (1) /*!< SC_T::INTEN: TBEIEN Position */ -#define SC_INTEN_TBEIEN_Msk (0x1ul << SC_INTEN_TBEIEN_Pos) /*!< SC_T::INTEN: TBEIEN Mask */ - -#define SC_INTEN_TERRIEN_Pos (2) /*!< SC_T::INTEN: TERRIEN Position */ -#define SC_INTEN_TERRIEN_Msk (0x1ul << SC_INTEN_TERRIEN_Pos) /*!< SC_T::INTEN: TERRIEN Mask */ - -#define SC_INTEN_TMR0IEN_Pos (3) /*!< SC_T::INTEN: TMR0IEN Position */ -#define SC_INTEN_TMR0IEN_Msk (0x1ul << SC_INTEN_TMR0IEN_Pos) /*!< SC_T::INTEN: TMR0IEN Mask */ - -#define SC_INTEN_TMR1IEN_Pos (4) /*!< SC_T::INTEN: TMR1IEN Position */ -#define SC_INTEN_TMR1IEN_Msk (0x1ul << SC_INTEN_TMR1IEN_Pos) /*!< SC_T::INTEN: TMR1IEN Mask */ - -#define SC_INTEN_TMR2IEN_Pos (5) /*!< SC_T::INTEN: TMR2IEN Position */ -#define SC_INTEN_TMR2IEN_Msk (0x1ul << SC_INTEN_TMR2IEN_Pos) /*!< SC_T::INTEN: TMR2IEN Mask */ - -#define SC_INTEN_BGTIEN_Pos (6) /*!< SC_T::INTEN: BGTIEN Position */ -#define SC_INTEN_BGTIEN_Msk (0x1ul << SC_INTEN_BGTIEN_Pos) /*!< SC_T::INTEN: BGTIEN Mask */ - -#define SC_INTEN_CDIEN_Pos (7) /*!< SC_T::INTEN: CDIEN Position */ -#define SC_INTEN_CDIEN_Msk (0x1ul << SC_INTEN_CDIEN_Pos) /*!< SC_T::INTEN: CDIEN Mask */ - -#define SC_INTEN_INITIEN_Pos (8) /*!< SC_T::INTEN: INITIEN Position */ -#define SC_INTEN_INITIEN_Msk (0x1ul << SC_INTEN_INITIEN_Pos) /*!< SC_T::INTEN: INITIEN Mask */ - -#define SC_INTEN_RXTOIEN_Pos (9) /*!< SC_T::INTEN: RXTOIEN Position */ -#define SC_INTEN_RXTOIEN_Msk (0x1ul << SC_INTEN_RXTOIEN_Pos) /*!< SC_T::INTEN: RXTOIEN Mask */ - -#define SC_INTEN_ACERRIEN_Pos (10) /*!< SC_T::INTEN: ACERRIEN Position */ -#define SC_INTEN_ACERRIEN_Msk (0x1ul << SC_INTEN_ACERRIEN_Pos) /*!< SC_T::INTEN: ACERRIEN Mask */ - -#define SC_INTSTS_RDAIF_Pos (0) /*!< SC_T::INTSTS: RDAIF Position */ -#define SC_INTSTS_RDAIF_Msk (0x1ul << SC_INTSTS_RDAIF_Pos) /*!< SC_T::INTSTS: RDAIF Mask */ - -#define SC_INTSTS_TBEIF_Pos (1) /*!< SC_T::INTSTS: TBEIF Position */ -#define SC_INTSTS_TBEIF_Msk (0x1ul << SC_INTSTS_TBEIF_Pos) /*!< SC_T::INTSTS: TBEIF Mask */ - -#define SC_INTSTS_TERRIF_Pos (2) /*!< SC_T::INTSTS: TERRIF Position */ -#define SC_INTSTS_TERRIF_Msk (0x1ul << SC_INTSTS_TERRIF_Pos) /*!< SC_T::INTSTS: TERRIF Mask */ - -#define SC_INTSTS_TMR0IF_Pos (3) /*!< SC_T::INTSTS: TMR0IF Position */ -#define SC_INTSTS_TMR0IF_Msk (0x1ul << SC_INTSTS_TMR0IF_Pos) /*!< SC_T::INTSTS: TMR0IF Mask */ - -#define SC_INTSTS_TMR1IF_Pos (4) /*!< SC_T::INTSTS: TMR1IF Position */ -#define SC_INTSTS_TMR1IF_Msk (0x1ul << SC_INTSTS_TMR1IF_Pos) /*!< SC_T::INTSTS: TMR1IF Mask */ - -#define SC_INTSTS_TMR2IF_Pos (5) /*!< SC_T::INTSTS: TMR2IF Position */ -#define SC_INTSTS_TMR2IF_Msk (0x1ul << SC_INTSTS_TMR2IF_Pos) /*!< SC_T::INTSTS: TMR2IF Mask */ - -#define SC_INTSTS_BGTIF_Pos (6) /*!< SC_T::INTSTS: BGTIF Position */ -#define SC_INTSTS_BGTIF_Msk (0x1ul << SC_INTSTS_BGTIF_Pos) /*!< SC_T::INTSTS: BGTIF Mask */ - -#define SC_INTSTS_CDIF_Pos (7) /*!< SC_T::INTSTS: CDIF Position */ -#define SC_INTSTS_CDIF_Msk (0x1ul << SC_INTSTS_CDIF_Pos) /*!< SC_T::INTSTS: CDIF Mask */ - -#define SC_INTSTS_INITIF_Pos (8) /*!< SC_T::INTSTS: INITIF Position */ -#define SC_INTSTS_INITIF_Msk (0x1ul << SC_INTSTS_INITIF_Pos) /*!< SC_T::INTSTS: INITIF Mask */ - -#define SC_INTSTS_RXTOIF_Pos (9) /*!< SC_T::INTSTS: RXTOIF Position */ -#define SC_INTSTS_RXTOIF_Msk (0x1ul << SC_INTSTS_RXTOIF_Pos) /*!< SC_T::INTSTS: RXTOIF Mask */ - -#define SC_INTSTS_ACERRIF_Pos (10) /*!< SC_T::INTSTS: ACERRIF Position */ -#define SC_INTSTS_ACERRIF_Msk (0x1ul << SC_INTSTS_ACERRIF_Pos) /*!< SC_T::INTSTS: ACERRIF Mask */ - -#define SC_STATUS_RXOV_Pos (0) /*!< SC_T::STATUS: RXOV Position */ -#define SC_STATUS_RXOV_Msk (0x1ul << SC_STATUS_RXOV_Pos) /*!< SC_T::STATUS: RXOV Mask */ - -#define SC_STATUS_RXEMPTY_Pos (1) /*!< SC_T::STATUS: RXEMPTY Position */ -#define SC_STATUS_RXEMPTY_Msk (0x1ul << SC_STATUS_RXEMPTY_Pos) /*!< SC_T::STATUS: RXEMPTY Mask */ - -#define SC_STATUS_RXFULL_Pos (2) /*!< SC_T::STATUS: RXFULL Position */ -#define SC_STATUS_RXFULL_Msk (0x1ul << SC_STATUS_RXFULL_Pos) /*!< SC_T::STATUS: RXFULL Mask */ - -#define SC_STATUS_PEF_Pos (4) /*!< SC_T::STATUS: PEF Position */ -#define SC_STATUS_PEF_Msk (0x1ul << SC_STATUS_PEF_Pos) /*!< SC_T::STATUS: PEF Mask */ - -#define SC_STATUS_FEF_Pos (5) /*!< SC_T::STATUS: FEF Position */ -#define SC_STATUS_FEF_Msk (0x1ul << SC_STATUS_FEF_Pos) /*!< SC_T::STATUS: FEF Mask */ - -#define SC_STATUS_BEF_Pos (6) /*!< SC_T::STATUS: BEF Position */ -#define SC_STATUS_BEF_Msk (0x1ul << SC_STATUS_BEF_Pos) /*!< SC_T::STATUS: BEF Mask */ - -#define SC_STATUS_TXOV_Pos (8) /*!< SC_T::STATUS: TXOV Position */ -#define SC_STATUS_TXOV_Msk (0x1ul << SC_STATUS_TXOV_Pos) /*!< SC_T::STATUS: TXOV Mask */ - -#define SC_STATUS_TXEMPTY_Pos (9) /*!< SC_T::STATUS: TXEMPTY Position */ -#define SC_STATUS_TXEMPTY_Msk (0x1ul << SC_STATUS_TXEMPTY_Pos) /*!< SC_T::STATUS: TXEMPTY Mask */ - -#define SC_STATUS_TXFULL_Pos (10) /*!< SC_T::STATUS: TXFULL Position */ -#define SC_STATUS_TXFULL_Msk (0x1ul << SC_STATUS_TXFULL_Pos) /*!< SC_T::STATUS: TXFULL Mask */ - -#define SC_STATUS_CREMOVE_Pos (11) /*!< SC_T::STATUS: CREMOVE Position */ -#define SC_STATUS_CREMOVE_Msk (0x1ul << SC_STATUS_CREMOVE_Pos) /*!< SC_T::STATUS: CREMOVE Mask */ - -#define SC_STATUS_CINSERT_Pos (12) /*!< SC_T::STATUS: CINSERT Position */ -#define SC_STATUS_CINSERT_Msk (0x1ul << SC_STATUS_CINSERT_Pos) /*!< SC_T::STATUS: CINSERT Mask */ - -#define SC_STATUS_CDPINSTS_Pos (13) /*!< SC_T::STATUS: CDPINSTS Position */ -#define SC_STATUS_CDPINSTS_Msk (0x1ul << SC_STATUS_CDPINSTS_Pos) /*!< SC_T::STATUS: CDPINSTS Mask */ - -#define SC_STATUS_RXPOINT_Pos (16) /*!< SC_T::STATUS: RXPOINT Position */ -#define SC_STATUS_RXPOINT_Msk (0x7ul << SC_STATUS_RXPOINT_Pos) /*!< SC_T::STATUS: RXPOINT Mask */ - -#define SC_STATUS_RXRERR_Pos (21) /*!< SC_T::STATUS: RXRERR Position */ -#define SC_STATUS_RXRERR_Msk (0x1ul << SC_STATUS_RXRERR_Pos) /*!< SC_T::STATUS: RXRERR Mask */ - -#define SC_STATUS_RXOVERR_Pos (22) /*!< SC_T::STATUS: RXOVERR Position */ -#define SC_STATUS_RXOVERR_Msk (0x1ul << SC_STATUS_RXOVERR_Pos) /*!< SC_T::STATUS: RXOVERR Mask */ - -#define SC_STATUS_RXACT_Pos (23) /*!< SC_T::STATUS: RXACT Position */ -#define SC_STATUS_RXACT_Msk (0x1ul << SC_STATUS_RXACT_Pos) /*!< SC_T::STATUS: RXACT Mask */ - -#define SC_STATUS_TXPOINT_Pos (24) /*!< SC_T::STATUS: TXPOINT Position */ -#define SC_STATUS_TXPOINT_Msk (0x7ul << SC_STATUS_TXPOINT_Pos) /*!< SC_T::STATUS: TXPOINT Mask */ - -#define SC_STATUS_TXRERR_Pos (29) /*!< SC_T::STATUS: TXRERR Position */ -#define SC_STATUS_TXRERR_Msk (0x1ul << SC_STATUS_TXRERR_Pos) /*!< SC_T::STATUS: TXRERR Mask */ - -#define SC_STATUS_TXOVERR_Pos (30) /*!< SC_T::STATUS: TXOVERR Position */ -#define SC_STATUS_TXOVERR_Msk (0x1ul << SC_STATUS_TXOVERR_Pos) /*!< SC_T::STATUS: TXOVERR Mask */ - -#define SC_STATUS_TXACT_Pos (31) /*!< SC_T::STATUS: TXACT Position */ -#define SC_STATUS_TXACT_Msk (0x1ul << SC_STATUS_TXACT_Pos) /*!< SC_T::STATUS: TXACT Mask */ - -#define SC_PINCTL_PWREN_Pos (0) /*!< SC_T::PINCTL: PWREN Position */ -#define SC_PINCTL_PWREN_Msk (0x1ul << SC_PINCTL_PWREN_Pos) /*!< SC_T::PINCTL: PWREN Mask */ - -#define SC_PINCTL_RSTEN_Pos (1) /*!< SC_T::PINCTL: RSTEN Position */ -#define SC_PINCTL_RSTEN_Msk (0x1ul << SC_PINCTL_RSTEN_Pos) /*!< SC_T::PINCTL: RSTEN Mask */ - -#define SC_PINCTL_CLKKEEP_Pos (6) /*!< SC_T::PINCTL: CLKKEEP Position */ -#define SC_PINCTL_CLKKEEP_Msk (0x1ul << SC_PINCTL_CLKKEEP_Pos) /*!< SC_T::PINCTL: CLKKEEP Mask */ - -#define SC_PINCTL_SCDATA_Pos (9) /*!< SC_T::PINCTL: SCDATA Position */ -#define SC_PINCTL_SCDATA_Msk (0x1ul << SC_PINCTL_SCDATA_Pos) /*!< SC_T::PINCTL: SCDATA Mask */ - -#define SC_PINCTL_PWRINV_Pos (11) /*!< SC_T::PINCTL: PWRINV Position */ -#define SC_PINCTL_PWRINV_Msk (0x1ul << SC_PINCTL_PWRINV_Pos) /*!< SC_T::PINCTL: PWRINV Mask */ - -#define SC_PINCTL_DATASTS_Pos (16) /*!< SC_T::PINCTL: DATASTS Position */ -#define SC_PINCTL_DATASTS_Msk (0x1ul << SC_PINCTL_DATASTS_Pos) /*!< SC_T::PINCTL: DATASTS Mask */ - -#define SC_PINCTL_PWRSTS_Pos (17) /*!< SC_T::PINCTL: PWRSTS Position */ -#define SC_PINCTL_PWRSTS_Msk (0x1ul << SC_PINCTL_PWRSTS_Pos) /*!< SC_T::PINCTL: PWRSTS Mask */ - -#define SC_PINCTL_RSTSTS_Pos (18) /*!< SC_T::PINCTL: RSTSTS Position */ -#define SC_PINCTL_RSTSTS_Msk (0x1ul << SC_PINCTL_RSTSTS_Pos) /*!< SC_T::PINCTL: RSTSTS Mask */ - -#define SC_PINCTL_SYNC_Pos (30) /*!< SC_T::PINCTL: SYNC Position */ -#define SC_PINCTL_SYNC_Msk (0x1ul << SC_PINCTL_SYNC_Pos) /*!< SC_T::PINCTL: SYNC Mask */ - -#define SC_TMRCTL0_CNT_Pos (0) /*!< SC_T::TMRCTL0: CNT Position */ -#define SC_TMRCTL0_CNT_Msk (0xfffffful << SC_TMRCTL0_CNT_Pos) /*!< SC_T::TMRCTL0: CNT Mask */ - -#define SC_TMRCTL0_OPMODE_Pos (24) /*!< SC_T::TMRCTL0: OPMODE Position */ -#define SC_TMRCTL0_OPMODE_Msk (0xful << SC_TMRCTL0_OPMODE_Pos) /*!< SC_T::TMRCTL0: OPMODE Mask */ - -#define SC_TMRCTL0_SYNC_Pos (31) /*!< SC_T::TMRCTL0: SYNC Position */ -#define SC_TMRCTL0_SYNC_Msk (0x1ul << SC_TMRCTL0_SYNC_Pos) /*!< SC_T::TMRCTL0: SYNC Mask */ - -#define SC_TMRCTL1_CNT_Pos (0) /*!< SC_T::TMRCTL1: CNT Position */ -#define SC_TMRCTL1_CNT_Msk (0xfful << SC_TMRCTL1_CNT_Pos) /*!< SC_T::TMRCTL1: CNT Mask */ - -#define SC_TMRCTL1_OPMODE_Pos (24) /*!< SC_T::TMRCTL1: OPMODE Position */ -#define SC_TMRCTL1_OPMODE_Msk (0xful << SC_TMRCTL1_OPMODE_Pos) /*!< SC_T::TMRCTL1: OPMODE Mask */ - -#define SC_TMRCTL1_SYNC_Pos (31) /*!< SC_T::TMRCTL1: SYNC Position */ -#define SC_TMRCTL1_SYNC_Msk (0x1ul << SC_TMRCTL1_SYNC_Pos) /*!< SC_T::TMRCTL1: SYNC Mask */ - -#define SC_TMRCTL2_CNT_Pos (0) /*!< SC_T::TMRCTL2: CNT Position */ -#define SC_TMRCTL2_CNT_Msk (0xfful << SC_TMRCTL2_CNT_Pos) /*!< SC_T::TMRCTL2: CNT Mask */ - -#define SC_TMRCTL2_OPMODE_Pos (24) /*!< SC_T::TMRCTL2: OPMODE Position */ -#define SC_TMRCTL2_OPMODE_Msk (0xful << SC_TMRCTL2_OPMODE_Pos) /*!< SC_T::TMRCTL2: OPMODE Mask */ - -#define SC_TMRCTL2_SYNC_Pos (31) /*!< SC_T::TMRCTL2: SYNC Position */ -#define SC_TMRCTL2_SYNC_Msk (0x1ul << SC_TMRCTL2_SYNC_Pos) /*!< SC_T::TMRCTL2: SYNC Mask */ - -#define SC_UARTCTL_UARTEN_Pos (0) /*!< SC_T::UARTCTL: UARTEN Position */ -#define SC_UARTCTL_UARTEN_Msk (0x1ul << SC_UARTCTL_UARTEN_Pos) /*!< SC_T::UARTCTL: UARTEN Mask */ - -#define SC_UARTCTL_WLS_Pos (4) /*!< SC_T::UARTCTL: WLS Position */ -#define SC_UARTCTL_WLS_Msk (0x3ul << SC_UARTCTL_WLS_Pos) /*!< SC_T::UARTCTL: WLS Mask */ - -#define SC_UARTCTL_PBOFF_Pos (6) /*!< SC_T::UARTCTL: PBOFF Position */ -#define SC_UARTCTL_PBOFF_Msk (0x1ul << SC_UARTCTL_PBOFF_Pos) /*!< SC_T::UARTCTL: PBOFF Mask */ - -#define SC_UARTCTL_OPE_Pos (7) /*!< SC_T::UARTCTL: OPE Position */ -#define SC_UARTCTL_OPE_Msk (0x1ul << SC_UARTCTL_OPE_Pos) /*!< SC_T::UARTCTL: OPE Mask */ - -#define SC_ACTCTL_T1EXT_Pos (0) /*!< SC_T::ACTCTL: T1EXT Position */ -#define SC_ACTCTL_T1EXT_Msk (0x1ful << SC_ACTCTL_T1EXT_Pos) /*!< SC_T::ACTCTL: T1EXT Mask */ - -/**@}*/ /* SC_CONST */ -/**@}*/ /* end of SC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __SC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sdh_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sdh_reg.h deleted file mode 100644 index 27420cbdf70..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sdh_reg.h +++ /dev/null @@ -1,541 +0,0 @@ -/**************************************************************************//** - * @file sdh_reg.h - * @version V1.00 - * @brief SDH register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SDH_REG_H__ -#define __SDH_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SDH SD Card Host Interface(SDH) - Memory Mapped Structure for SDH Controller -@{ */ - -typedef struct -{ - - /** - * @var SDH_T::FB - * Offset: 0x00~0x7C Shared Buffer (FIFO) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |BUFFER |Shared Buffer - * | | |Buffer for DMA transfer - * @var SDH_T::DMACTL - * Offset: 0x400 DMA Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMAEN |DMA Engine Enable Bit - * | | |0 = DMA Disabled. - * | | |1 = DMA Enabled. - * | | |If this bit is cleared, DMA will ignore all requests from SD host and force bus master into IDLE state. - * | | |Note: If target abort is occurred, DMAEN will be cleared. - * |[1] |DMARST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset internal state machine and pointers - * | | |The contents of control register will not be cleared - * | | |This bit will auto be cleared after few clock cycles. - * | | |Note: The software reset DMA related registers. - * |[3] |SGEN |Scatter-gather Function Enable Bit - * | | |0 = Scatter-gather function Disabled (DMA will treat the starting address in DMASAR as starting pointer of a single block memory). - * | | |1 = Scatter-gather function Enabled (DMA will treat the starting address in DMASAR as a starting address of Physical Address Descriptor (PAD) table - * | | |The format of these Pads' will be described later). - * |[9] |DMABUSY |DMA Transfer Is in Progress - * | | |This bit indicates if SD Host is granted and doing DMA transfer or not. - * | | |0 = DMA transfer is not in progress. - * | | |1 = DMA transfer is in progress. - * @var SDH_T::DMASA - * Offset: 0x408 DMA Transfer Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ORDER |Determined to the PAD Table Fetching Is in Order or Out of Order - * | | |0 = PAD table is fetched in order. - * | | |1 = PAD table is fetched out of order. - * | | |Note: the bit0 is valid in scatter-gather mode when SGEN = 1. - * |[31:1] |DMASA |DMA Transfer Starting Address - * | | |This field pads 0 as least significant bit indicates a 32-bit starting address of system memory (SRAM) for DMA to retrieve or fill in data. - * | | |If DMA is not in normal mode, this field will be interpreted as a starting address of Physical Address Descriptor (PAD) table. - * | | |Note: Starting address of the SRAM must be word aligned, for example, 0x0000_0000, 0x0000_0004. - * @var SDH_T::DMABCNT - * Offset: 0x40C DMA Transfer Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[25:0] |BCNT |DMA Transfer Byte Count (Read Only) - * | | |This field indicates the remained byte count of DMA transfer - * | | |The value of this field is valid only when DMA is busy; otherwise, it is 0. - * @var SDH_T::DMAINTEN - * Offset: 0x410 DMA Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIEN |DMA Read/Write Target Abort Interrupt Enable Bit - * | | |0 = Target abort interrupt generation Disabled during DMA transfer. - * | | |1 = Target abort interrupt generation Enabled during DMA transfer. - * |[1] |WEOTIEN |Wrong EOT Encountered Interrupt Enable Bit - * | | |0 = Interrupt generation Disabled when wrong EOT is encountered. - * | | |1 = Interrupt generation Enabled when wrong EOT is encountered. - * @var SDH_T::DMAINTSTS - * Offset: 0x414 DMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIF |DMA Read/Write Target Abort Interrupt Flag - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note1: This bit is read only, but can be cleared by writing '1' to it. - * | | |Note2: When DMA's bus master received ERROR response, it means that target abort is happened - * | | |DMA will stop transfer and respond this event and then go to IDLE state - * | | |When target abort occurred or WEOTIF is set, software must reset DMA and SD host, and then transfer those data again. - * |[1] |WEOTIF |Wrong EOT Encountered Interrupt Flag - * | | |When DMA Scatter-Gather function is enabled, and EOT of the descriptor is encountered before DMA transfer finished (that means the total sector count of all PAD is less than the sector count of SD host), this bit will be set. - * | | |0 = No EOT encountered before DMA transfer finished. - * | | |1 = EOT encountered before DMA transfer finished. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::GCTL - * Offset: 0x800 Global Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset SD host - * | | |The contents of control register will not be cleared - * | | |This bit will auto cleared after reset complete. - * |[1] |SDEN |Secure Digital Functionality Enable Bit - * | | |0 = SD functionality disabled. - * | | |1 = SD functionality enabled. - * @var SDH_T::GINTEN - * Offset: 0x804 Global Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIEN |DMA READ/WRITE Target Abort Interrupt Enable Bit - * | | |0 = DMA READ/WRITE target abort interrupt generation disabled. - * | | |1 = DMA READ/WRITE target abort interrupt generation enabled. - * @var SDH_T::GINTSTS - * Offset: 0x808 Global Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIF |DMA READ/WRITE Target Abort Interrupt Flag (Read Only) - * | | |This bit indicates DMA received an ERROR response from internal AHB bus during DMA read/write operation - * | | |When Target Abort is occurred, please reset all engine. - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::CTL - * Offset: 0x820 SD Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |COEN |Command Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output a command to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[1] |RIEN |Response Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[2] |DIEN |Data Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive block data and the CRC16 value from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[3] |DOEN |Data Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will transfer block data and the CRC16 value to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[4] |R2EN |Response R2 Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response R2 from SD card and store the response data into DMC's flash buffer (exclude CRC7). - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[5] |CLK74OEN |Initial 74 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 74 clock cycles to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[6] |CLK8OEN |Generating 8 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 8 clock cycles. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[7] |CLKKEEP |SD Clock Enable Control - * | | |0 = SD host decided when to output clock and when to disable clock output automatically. - * | | |1 = SD clock always keeps free running. - * |[13:8] |CMDCODE |SD Command Code - * | | |This register contains the SD command code (0x00 - 0x3F). - * |[14] |CTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset the internal state machine and counters - * | | |The contents of control register will not be cleared (but RIEN, DIEN, DOEN and R2_EN will be cleared) - * | | |This bit will be auto cleared after few clock cycles. - * |[15] |DBW |SD Data Bus Width (for 1-bit / 4-bit Selection) - * | | |0 = Data bus width is 1-bit. - * | | |1 = Data bus width is 4-bit. - * |[23:16] |BLKCNT |Block Counts to Be Transferred or Received - * | | |This field contains the block counts for data-in and data-out transfer - * | | |For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, software can use this function to accelerate data transfer and improve performance - * | | |Don't fill 0x0 to this field. - * | | |Note: For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, the actual total length is BLKCNT * (BLKLEN +1). - * |[27:24] |SDNWR |NWR Parameter for Block Write Operation - * | | |This value indicates the NWR parameter for data block write operation in SD clock counts - * | | |The actual clock cycle will be SDNWR+1. - * @var SDH_T::CMDARG - * Offset: 0x824 SD Command Argument Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ARGUMENT |SD Command Argument - * | | |This register contains a 32-bit value specifies the argument of SD command from host controller to SD card - * | | |Before trigger COEN (SDH_CTL [0]), software should fill argument in this field. - * @var SDH_T::INTEN - * Offset: 0x828 SD Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIEN |Block Transfer Done Interrupt Enable Bit - * | | |0 = BLKDIF (SDH_INTEN[0]) trigger interrupt Disable. - * | | |1 = BLKDIF (SDH_INTEN[0]) trigger interrupt Enabled. - * |[1] |CRCIEN |CRC7, CRC16 and CRC Status Error Interrupt Enable Bit - * | | |0 = CRCIF (SDH_INTEN[1]) trigger interrupt Disable. - * | | |1 = CRCIF (SDH_INTEN[1]) trigger interrupt Enabled. - * |[8] |CDIEN |SD Card Detection Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when card is inserted or removed. - * | | |0 = CDIF (SDH_INTEN[8]) trigger interrupt Disable. - * | | |1 = CDIF (SDH_INTEN[8]) trigger interrupt Enabled. - * |[12] |RTOIEN |Response Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when receiving response or R2 time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = RTOIF (SDH_INTEN[12]) trigger interrupt Disabled. - * | | |1 = RTOIF (SDH_INTEN[12]) trigger interrupt Enabled. - * |[13] |DITOIEN |Data Input Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when data input time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = DITOIF (SDH_INTEN[13]) trigger interrupt Disabled. - * | | |1 = DITOIF (SDH_INTEN[13]) trigger interrupt Enabled. - * |[14] |WKIEN |Wake-up Signal Generating Enable Bit - * | | |Enable/Disable wake-up signal generating of SD host when current using SD card issues an interrupt (wake-up) via DAT [1] to host. - * | | |0 = SD Card interrupt to wake-up chip Disabled. - * | | |1 = SD Card interrupt to wake-up chip Enabled. - * |[30] |CDSRC |SD Card Detect Source Selection - * | | |0 = From SD card's DAT3 pin. - * | | |Host need clock to got data on pin DAT3 - * | | |Please make sure CLKKEEP (SDH_CTL[7]) is 1 in order to generate free running clock for DAT3 pin. - * | | |1 = From GPIO pin. - * @var SDH_T::INTSTS - * Offset: 0x82C SD Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIF |Block Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has finished all data-in or data-out block transfer - * | | |If there is a CRC16 error or incorrect CRC status during multiple block data transfer, the transfer will be broken and this bit will also be set. - * | | |0 = Not finished yet. - * | | |1 = Done. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[1] |CRCIF |CRC7, CRC16 and CRC Status Error Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has occurred CRC error during response in, data-in or data-out (CRC status error) transfer - * | | |When CRC error is occurred, software should reset SD engine - * | | |Some response (ex - * | | |R3) doesn't have CRC7 information with it; SD host will still calculate CRC7, get CRC error and set this flag - * | | |In this condition, software should ignore CRC error and clears this bit manually. - * | | |0 = No CRC error is occurred. - * | | |1 = CRC error is occurred. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[2] |CRC7 |CRC7 Check Status (Read Only) - * | | |SD host will check CRC7 correctness during each response in - * | | |If that response does not contain CRC7 information (ex - * | | |R3), then software should turn off CRCIEN (SDH_INTEN[1]) and ignore this bit. - * | | |0 = Fault. - * | | |1 = OK. - * |[3] |CRC16 |CRC16 Check Status of Data-in Transfer (Read Only) - * | | |SD host will check CRC16 correctness after data-in transfer. - * | | |0 = Fault. - * | | |1 = OK. - * |[6:4] |CRCSTS |CRC Status Value of Data-out Transfer (Read Only) - * | | |SD host will record CRC status of data-out transfer - * | | |Software could use this value to identify what type of error is during data-out transfer. - * | | |010 = Positive CRC status. - * | | |101 = Negative CRC status. - * | | |111 = SD card programming error occurs. - * |[7] |DAT0STS |DAT0 Pin Status of Current Selected SD Port (Read Only) - * | | |This bit is the DAT0 pin status of current selected SD port. - * |[8] |CDIF |SD Card Detection Interrupt Flag (Read Only) - * | | |This bit indicates that SD card is inserted or removed - * | | |Only when CDIEN (SDH_INTEN[8]) is set to 1, this bit is active. - * | | |0 = No card is inserted or removed. - * | | |1 = There is a card inserted in or removed from SD. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[12] |RTOIF |Response Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving response or R2 (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Response time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[13] |DITOIF |Data Input Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving data (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Data input time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[16] |CDSTS |Card Detect Status of SD (Read Only) - * | | |This bit indicates the card detect pin status of SD, and is used for card detection - * | | |When there is a card inserted in or removed from SD, software should check this bit to confirm if there is really a card insertion or removal. - * | | |If CDSRC (SDH_INTEN[30]) = 0, to select DAT3 for card detection:. - * | | |0 = Card removed. - * | | |1 = Card inserted. - * | | |If CDSRC (SDH_INTEN[30]) = 1, to select GPIO for card detection:. - * | | |0 = Card inserted. - * | | |1 = Card removed. - * |[18] |DAT1STS |DAT1 Pin Status of SD Port (Read Only) - * | | |This bit indicates the DAT1 pin status of SD port. - * @var SDH_T::RESP0 - * Offset: 0x830 SD Receiving Response Token Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RESPTK0 |SD Receiving Response Token 0 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This field contains response bit 47-16 of the response token. - * @var SDH_T::RESP1 - * Offset: 0x834 SD Receiving Response Token Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RESPTK1 |SD Receiving Response Token 1 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This register contains the bit 15-8 of the response token. - * @var SDH_T::BLEN - * Offset: 0x838 SD Block Length Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |BLKLEN |SD BLOCK LENGTH in Byte Unit - * | | |An 11-bit value specifies the SD transfer byte count of a block - * | | |The actual byte count is equal to BLKLEN+1. - * | | |Note: The default SD block length is 512 bytes - * @var SDH_T::TOUT - * Offset: 0x83C SD Response/Data-in Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |TOUT |SD Response/Data-in Time-out Value - * | | |A 24-bit value specifies the time-out counts of response and data input - * | | |SD host controller will wait start bit of response or data-in until this value reached - * | | |The time period depends on SD engine clock frequency - * | | |Do not write a small number into this field, or you may never get response or data due to time-out. - * | | |Note: Filling 0x0 into this field will disable hardware time-out function. - */ - - __IO uint32_t FB[32]; /*!< Shared Buffer (FIFO) */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[224]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMACTL; /*!< [0x0400] DMA Control and Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMASA; /*!< [0x0408] DMA Transfer Starting Address Register */ - __I uint32_t DMABCNT; /*!< [0x040c] DMA Transfer Byte Count Register */ - __IO uint32_t DMAINTEN; /*!< [0x0410] DMA Interrupt Enable Control Register */ - __IO uint32_t DMAINTSTS; /*!< [0x0414] DMA Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[250]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t GCTL; /*!< [0x0800] Global Control and Status Register */ - __IO uint32_t GINTEN; /*!< [0x0804] Global Interrupt Control Register */ - __IO uint32_t GINTSTS; /*!< [0x0808] Global Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL; /*!< [0x0820] SD Control and Status Register */ - __IO uint32_t CMDARG; /*!< [0x0824] SD Command Argument Register */ - __IO uint32_t INTEN; /*!< [0x0828] SD Interrupt Control Register */ - __IO uint32_t INTSTS; /*!< [0x082c] SD Interrupt Status Register */ - __I uint32_t RESP0; /*!< [0x0830] SD Receiving Response Token Register 0 */ - __I uint32_t RESP1; /*!< [0x0834] SD Receiving Response Token Register 1 */ - __IO uint32_t BLEN; /*!< [0x0838] SD Block Length Register */ - __IO uint32_t TOUT; /*!< [0x083c] SD Response/Data-in Time-out Register */ - -} SDH_T; - - -/** - @addtogroup SDH_CONST SDH Bit Field Definition - Constant Definitions for SDH Controller -@{ */ - -#define SDH_DMACTL_DMAEN_Pos (0) /*!< SDH_T::DMACTL: DMAEN Position */ -#define SDH_DMACTL_DMAEN_Msk (0x1ul << SDH_DMACTL_DMAEN_Pos) /*!< SDH_T::DMACTL: DMAEN Mask */ - -#define SDH_DMACTL_DMARST_Pos (1) /*!< SDH_T::DMACTL: DMARST Position */ -#define SDH_DMACTL_DMARST_Msk (0x1ul << SDH_DMACTL_DMARST_Pos) /*!< SDH_T::DMACTL: DMARST Mask */ - -#define SDH_DMACTL_SGEN_Pos (3) /*!< SDH_T::DMACTL: SGEN Position */ -#define SDH_DMACTL_SGEN_Msk (0x1ul << SDH_DMACTL_SGEN_Pos) /*!< SDH_T::DMACTL: SGEN Mask */ - -#define SDH_DMACTL_DMABUSY_Pos (9) /*!< SDH_T::DMACTL: DMABUSY Position */ -#define SDH_DMACTL_DMABUSY_Msk (0x1ul << SDH_DMACTL_DMABUSY_Pos) /*!< SDH_T::DMACTL: DMABUSY Mask */ - -#define SDH_DMASA_ORDER_Pos (0) /*!< SDH_T::DMASA: ORDER Position */ -#define SDH_DMASA_ORDER_Msk (0x1ul << SDH_DMASA_ORDER_Pos) /*!< SDH_T::DMASA: ORDER Mask */ - -#define SDH_DMASA_DMASA_Pos (1) /*!< SDH_T::DMASA: DMASA Position */ -#define SDH_DMASA_DMASA_Msk (0x7ffffffful << SDH_DMASA_DMASA_Pos) /*!< SDH_T::DMASA: DMASA Mask */ - -#define SDH_DMABCNT_BCNT_Pos (0) /*!< SDH_T::DMABCNT: BCNT Position */ -#define SDH_DMABCNT_BCNT_Msk (0x3fffffful << SDH_DMABCNT_BCNT_Pos) /*!< SDH_T::DMABCNT: BCNT Mask */ - -#define SDH_DMAINTEN_ABORTIEN_Pos (0) /*!< SDH_T::DMAINTEN: ABORTIEN Position */ -#define SDH_DMAINTEN_ABORTIEN_Msk (0x1ul << SDH_DMAINTEN_ABORTIEN_Pos) /*!< SDH_T::DMAINTEN: ABORTIEN Mask */ - -#define SDH_DMAINTEN_WEOTIEN_Pos (1) /*!< SDH_T::DMAINTEN: WEOTIEN Position */ -#define SDH_DMAINTEN_WEOTIEN_Msk (0x1ul << SDH_DMAINTEN_WEOTIEN_Pos) /*!< SDH_T::DMAINTEN: WEOTIEN Mask */ - -#define SDH_DMAINTSTS_ABORTIF_Pos (0) /*!< SDH_T::DMAINTSTS: ABORTIF Position */ -#define SDH_DMAINTSTS_ABORTIF_Msk (0x1ul << SDH_DMAINTSTS_ABORTIF_Pos) /*!< SDH_T::DMAINTSTS: ABORTIF Mask */ - -#define SDH_DMAINTSTS_WEOTIF_Pos (1) /*!< SDH_T::DMAINTSTS: WEOTIF Position */ -#define SDH_DMAINTSTS_WEOTIF_Msk (0x1ul << SDH_DMAINTSTS_WEOTIF_Pos) /*!< SDH_T::DMAINTSTS: WEOTIF Mask */ - -#define SDH_GCTL_GCTLRST_Pos (0) /*!< SDH_T::GCTL: GCTLRST Position */ -#define SDH_GCTL_GCTLRST_Msk (0x1ul << SDH_GCTL_GCTLRST_Pos) /*!< SDH_T::GCTL: GCTLRST Mask */ - -#define SDH_GCTL_SDEN_Pos (1) /*!< SDH_T::GCTL: SDEN Position */ -#define SDH_GCTL_SDEN_Msk (0x1ul << SDH_GCTL_SDEN_Pos) /*!< SDH_T::GCTL: SDEN Mask */ - -#define SDH_GINTEN_DTAIEN_Pos (0) /*!< SDH_T::GINTEN: DTAIEN Position */ -#define SDH_GINTEN_DTAIEN_Msk (0x1ul << SDH_GINTEN_DTAIEN_Pos) /*!< SDH_T::GINTEN: DTAIEN Mask */ - -#define SDH_GINTSTS_DTAIF_Pos (0) /*!< SDH_T::GINTSTS: DTAIF Position */ -#define SDH_GINTSTS_DTAIF_Msk (0x1ul << SDH_GINTSTS_DTAIF_Pos) /*!< SDH_T::GINTSTS: DTAIF Mask */ - -#define SDH_CTL_COEN_Pos (0) /*!< SDH_T::CTL: COEN Position */ -#define SDH_CTL_COEN_Msk (0x1ul << SDH_CTL_COEN_Pos) /*!< SDH_T::CTL: COEN Mask */ - -#define SDH_CTL_RIEN_Pos (1) /*!< SDH_T::CTL: RIEN Position */ -#define SDH_CTL_RIEN_Msk (0x1ul << SDH_CTL_RIEN_Pos) /*!< SDH_T::CTL: RIEN Mask */ - -#define SDH_CTL_DIEN_Pos (2) /*!< SDH_T::CTL: DIEN Position */ -#define SDH_CTL_DIEN_Msk (0x1ul << SDH_CTL_DIEN_Pos) /*!< SDH_T::CTL: DIEN Mask */ - -#define SDH_CTL_DOEN_Pos (3) /*!< SDH_T::CTL: DOEN Position */ -#define SDH_CTL_DOEN_Msk (0x1ul << SDH_CTL_DOEN_Pos) /*!< SDH_T::CTL: DOEN Mask */ - -#define SDH_CTL_R2EN_Pos (4) /*!< SDH_T::CTL: R2EN Position */ -#define SDH_CTL_R2EN_Msk (0x1ul << SDH_CTL_R2EN_Pos) /*!< SDH_T::CTL: R2EN Mask */ - -#define SDH_CTL_CLK74OEN_Pos (5) /*!< SDH_T::CTL: CLK74OEN Position */ -#define SDH_CTL_CLK74OEN_Msk (0x1ul << SDH_CTL_CLK74OEN_Pos) /*!< SDH_T::CTL: CLK74OEN Mask */ - -#define SDH_CTL_CLK8OEN_Pos (6) /*!< SDH_T::CTL: CLK8OEN Position */ -#define SDH_CTL_CLK8OEN_Msk (0x1ul << SDH_CTL_CLK8OEN_Pos) /*!< SDH_T::CTL: CLK8OEN Mask */ - -#define SDH_CTL_CLKKEEP_Pos (7) /*!< SDH_T::CTL: CLKKEEP Position */ -#define SDH_CTL_CLKKEEP_Msk (0x1ul << SDH_CTL_CLKKEEP_Pos) /*!< SDH_T::CTL: CLKKEEP Mask */ - -#define SDH_CTL_CMDCODE_Pos (8) /*!< SDH_T::CTL: CMDCODE Position */ -#define SDH_CTL_CMDCODE_Msk (0x3ful << SDH_CTL_CMDCODE_Pos) /*!< SDH_T::CTL: CMDCODE Mask */ - -#define SDH_CTL_CTLRST_Pos (14) /*!< SDH_T::CTL: CTLRST Position */ -#define SDH_CTL_CTLRST_Msk (0x1ul << SDH_CTL_CTLRST_Pos) /*!< SDH_T::CTL: CTLRST Mask */ - -#define SDH_CTL_DBW_Pos (15) /*!< SDH_T::CTL: DBW Position */ -#define SDH_CTL_DBW_Msk (0x1ul << SDH_CTL_DBW_Pos) /*!< SDH_T::CTL: DBW Mask */ - -#define SDH_CTL_BLKCNT_Pos (16) /*!< SDH_T::CTL: BLKCNT Position */ -#define SDH_CTL_BLKCNT_Msk (0xfful << SDH_CTL_BLKCNT_Pos) /*!< SDH_T::CTL: BLKCNT Mask */ - -#define SDH_CTL_SDNWR_Pos (24) /*!< SDH_T::CTL: SDNWR Position */ -#define SDH_CTL_SDNWR_Msk (0xful << SDH_CTL_SDNWR_Pos) /*!< SDH_T::CTL: SDNWR Mask */ - -#define SDH_CMDARG_ARGUMENT_Pos (0) /*!< SDH_T::CMDARG: ARGUMENT Position */ -#define SDH_CMDARG_ARGUMENT_Msk (0xfffffffful << SDH_CMDARG_ARGUMENT_Pos) /*!< SDH_T::CMDARG: ARGUMENT Mask */ - -#define SDH_INTEN_BLKDIEN_Pos (0) /*!< SDH_T::INTEN: BLKDIEN Position */ -#define SDH_INTEN_BLKDIEN_Msk (0x1ul << SDH_INTEN_BLKDIEN_Pos) /*!< SDH_T::INTEN: BLKDIEN Mask */ - -#define SDH_INTEN_CRCIEN_Pos (1) /*!< SDH_T::INTEN: CRCIEN Position */ -#define SDH_INTEN_CRCIEN_Msk (0x1ul << SDH_INTEN_CRCIEN_Pos) /*!< SDH_T::INTEN: CRCIEN Mask */ - -#define SDH_INTEN_CDIEN_Pos (8) /*!< SDH_T::INTEN: CDIEN Position */ -#define SDH_INTEN_CDIEN_Msk (0x1ul << SDH_INTEN_CDIEN_Pos) /*!< SDH_T::INTEN: CDIEN Mask */ - -#define SDH_INTEN_RTOIEN_Pos (12) /*!< SDH_T::INTEN: RTOIEN Position */ -#define SDH_INTEN_RTOIEN_Msk (0x1ul << SDH_INTEN_RTOIEN_Pos) /*!< SDH_T::INTEN: RTOIEN Mask */ - -#define SDH_INTEN_DITOIEN_Pos (13) /*!< SDH_T::INTEN: DITOIEN Position */ -#define SDH_INTEN_DITOIEN_Msk (0x1ul << SDH_INTEN_DITOIEN_Pos) /*!< SDH_T::INTEN: DITOIEN Mask */ - -#define SDH_INTEN_WKIEN_Pos (14) /*!< SDH_T::INTEN: WKIEN Position */ -#define SDH_INTEN_WKIEN_Msk (0x1ul << SDH_INTEN_WKIEN_Pos) /*!< SDH_T::INTEN: WKIEN Mask */ - -#define SDH_INTEN_CDSRC_Pos (30) /*!< SDH_T::INTEN: CDSRC Position */ -#define SDH_INTEN_CDSRC_Msk (0x1ul << SDH_INTEN_CDSRC_Pos) /*!< SDH_T::INTEN: CDSRC Mask */ - -#define SDH_INTSTS_BLKDIF_Pos (0) /*!< SDH_T::INTSTS: BLKDIF Position */ -#define SDH_INTSTS_BLKDIF_Msk (0x1ul << SDH_INTSTS_BLKDIF_Pos) /*!< SDH_T::INTSTS: BLKDIF Mask */ - -#define SDH_INTSTS_CRCIF_Pos (1) /*!< SDH_T::INTSTS: CRCIF Position */ -#define SDH_INTSTS_CRCIF_Msk (0x1ul << SDH_INTSTS_CRCIF_Pos) /*!< SDH_T::INTSTS: CRCIF Mask */ - -#define SDH_INTSTS_CRC7_Pos (2) /*!< SDH_T::INTSTS: CRC7 Position */ -#define SDH_INTSTS_CRC7_Msk (0x1ul << SDH_INTSTS_CRC7_Pos) /*!< SDH_T::INTSTS: CRC7 Mask */ - -#define SDH_INTSTS_CRC16_Pos (3) /*!< SDH_T::INTSTS: CRC16 Position */ -#define SDH_INTSTS_CRC16_Msk (0x1ul << SDH_INTSTS_CRC16_Pos) /*!< SDH_T::INTSTS: CRC16 Mask */ - -#define SDH_INTSTS_CRCSTS_Pos (4) /*!< SDH_T::INTSTS: CRCSTS Position */ -#define SDH_INTSTS_CRCSTS_Msk (0x7ul << SDH_INTSTS_CRCSTS_Pos) /*!< SDH_T::INTSTS: CRCSTS Mask */ - -#define SDH_INTSTS_DAT0STS_Pos (7) /*!< SDH_T::INTSTS: DAT0STS Position */ -#define SDH_INTSTS_DAT0STS_Msk (0x1ul << SDH_INTSTS_DAT0STS_Pos) /*!< SDH_T::INTSTS: DAT0STS Mask */ - -#define SDH_INTSTS_CDIF_Pos (8) /*!< SDH_T::INTSTS: CDIF Position */ -#define SDH_INTSTS_CDIF_Msk (0x1ul << SDH_INTSTS_CDIF_Pos) /*!< SDH_T::INTSTS: CDIF Mask */ - -#define SDH_INTSTS_RTOIF_Pos (12) /*!< SDH_T::INTSTS: RTOIF Position */ -#define SDH_INTSTS_RTOIF_Msk (0x1ul << SDH_INTSTS_RTOIF_Pos) /*!< SDH_T::INTSTS: RTOIF Mask */ - -#define SDH_INTSTS_DITOIF_Pos (13) /*!< SDH_T::INTSTS: DITOIF Position */ -#define SDH_INTSTS_DITOIF_Msk (0x1ul << SDH_INTSTS_DITOIF_Pos) /*!< SDH_T::INTSTS: DITOIF Mask */ - -#define SDH_INTSTS_CDSTS_Pos (16) /*!< SDH_T::INTSTS: CDSTS Position */ -#define SDH_INTSTS_CDSTS_Msk (0x1ul << SDH_INTSTS_CDSTS_Pos) /*!< SDH_T::INTSTS: CDSTS Mask */ - -#define SDH_INTSTS_DAT1STS_Pos (18) /*!< SDH_T::INTSTS: DAT1STS Position */ -#define SDH_INTSTS_DAT1STS_Msk (0x1ul << SDH_INTSTS_DAT1STS_Pos) /*!< SDH_T::INTSTS: DAT1STS Mask */ - -#define SDH_RESP0_RESPTK0_Pos (0) /*!< SDH_T::RESP0: RESPTK0 Position */ -#define SDH_RESP0_RESPTK0_Msk (0xfffffffful << SDH_RESP0_RESPTK0_Pos) /*!< SDH_T::RESP0: RESPTK0 Mask */ - -#define SDH_RESP1_RESPTK1_Pos (0) /*!< SDH_T::RESP1: RESPTK1 Position */ -#define SDH_RESP1_RESPTK1_Msk (0xfful << SDH_RESP1_RESPTK1_Pos) /*!< SDH_T::RESP1: RESPTK1 Mask */ - -#define SDH_BLEN_BLKLEN_Pos (0) /*!< SDH_T::BLEN: BLKLEN Position */ -#define SDH_BLEN_BLKLEN_Msk (0x7fful << SDH_BLEN_BLKLEN_Pos) /*!< SDH_T::BLEN: BLKLEN Mask */ - -#define SDH_TOUT_TOUT_Pos (0) /*!< SDH_T::TOUT: TOUT Position */ -#define SDH_TOUT_TOUT_Msk (0xfffffful << SDH_TOUT_TOUT_Pos) /*!< SDH_T::TOUT: TOUT Mask */ - -/**@}*/ /* SDH_CONST */ -/**@}*/ /* end of SDH register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SDH_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spi_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spi_reg.h deleted file mode 100644 index 9bb647fe144..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spi_reg.h +++ /dev/null @@ -1,800 +0,0 @@ -/**************************************************************************//** - * @file spi_reg.h - * @version V1.00 - * @brief SPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SPI_REG_H__ -#define __SPI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SPI Serial Peripheral Interface Controller(SPI) - Memory Mapped Structure for SPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var SPI_T::CTL - * Offset: 0x00 SPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIEN |SPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1 - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of SPIx_CTL, SPIx_CLKDIV, SPIx_SSCTL and SPIx_FIFOCTL registers, user shall clear the SPIEN (SPIx_CTL[0]) and confirm the SPIENSTS (SPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of SPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of SPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of SPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of SPI bus clock. - * |[3] |CLKPOL |Clock Polarity - * | | |0 = SPI bus clock is idle low. - * | | |1 = SPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval (Master Only) - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 .... 0.5 SPICLK clock cycle. - * | | |SUSPITV = 0x1 .... 1.5 SPICLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE .... 14.5 SPICLK clock cycle. - * | | |SUSPITV = 0xF .... 15.5 SPICLK clock cycle. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 .... 8 bits. - * | | |DWIDTH = 0x09 .... 9 bits. - * | | |..... - * | | |DWIDTH = 0x1F .... 31 bits. - * | | |DWIDTH = 0x00 .... 32 bits. - * | | |Note: For SPI1~SPI4, this bit field will decide the depth of TX/RX FIFO configuration in SPI mode - * | | |Therefore, changing this bit field will clear TX/RX FIFO by hardware automatically in SPI1~SPI4. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the SPI TX register, is sent first to the SPI data output pin, and the first bit received from the SPI data input pin will be put in the LSB position of the RX register (bit 0 of SPI_RX). - * |[14] |HALFDPX |SPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for SPI transfer - * | | |The bit field DATDIR (SPIx_CTL[20]) can be used to set the data direction in half-duplex transfer. - * | | |0 = SPI operates in full-duplex transfer. - * | | |1 = SPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only Mode Enable Bit (Master Only) - * | | |This bit field is only available in Master mode - * | | |In receive-only mode, SPI Master will generate SPI bus clock continuously for receiving data bit from SPI slave device and assert the BUSY status. - * | | |0 = Receive-only mode Disabled. - * | | |1 = Receive-only mode Enabled. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = SPI unit transfer interrupt Disabled. - * | | |1 = SPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled - * | | |A byte suspend interval will be inserted among each byte - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction in half-duplex transfer and Dual/Quad transfer - * | | |0 = SPI data is input direction. - * | | |1 = SPI data is output direction. - * @var SPI_T::CLKDIV - * Offset: 0x04 SPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the SPI bus clock of SPI Master - * | | |The frequency is obtained according to the following equation. - * | | |where - * | | |is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * | | |Note: Not supported in I2S mode. - * @var SPI_T::SSCTL - * Offset: 0x08 SPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control (Master Only) - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = set the SPIx_SS line to inactive state. - * | | |1 = set the SPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the SPIx_SS line at inactive state. - * | | |1 = SPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time - * | | |The active state of SPIx_SS is specified in SSACTPOL (SPIx_SSCTL[2]). - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (SPIx_SS). - * | | |0 = The slave selection signal SPIx_SS is active low. - * | | |1 = The slave selection signal SPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit (Master Only) - * | | |0 = Automatic slave selection function Disabled - * | | |Slave selection signal will be asserted/de-asserted according to SS (SPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * @var SPI_T::PDMACTL - * Offset: 0x0C SPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In SPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the SPI controller. This bit will be automatically cleared to 0. - * @var SPI_T::FIFOCTL - * Offset: 0x10 SPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * | | |Note: If TX underflow event occurs in SPI Slave mode, this bit can be used to make SPI return to idle state. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Slave Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The SPI data out is keep 0 if there is TX underflow event in Slave mode. - * | | |1 = The SPI data out is keep 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is no any data in TX FIFO when the slave selection signal is active. - * | | |2. This bit should be set as 0 in I2S mode. - * | | |3. When TX underflow event occurs, SPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward - * | | |Data stored in TX FIFO will be sent through SPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |When TX underflow event occurs in Slave mode, TXUFIF (SPIx_STATUS[19]) will be set to 1 - * | | |This bit is used to enable the TX underflow interrupt. - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[26:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0 - * | | |For SPI1~SPI4, the MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length. - * |[30:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0 - * | | |For SPI1~SPI4, the MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length - * @var SPI_T::STATUS - * Offset: 0x14 SPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = SPI controller is in idle state. - * | | |1 = SPI controller is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. SPIx_CTL[0] = 1 and TXEMPTY = 0. - * | | |b - * | | |For SPI Master mode, SPIx_CTL[0] = 1 and TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Master mode, SPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d - * | | |For SPI Slave mode, the SPIx_CTL[0] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |For SPI Slave mode, the SPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = SPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode - * | | |If SSACTPOL (SPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the SPI slave select is in inactive status. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBEIF also active when the slave select goes to inactive state - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is overrun. - * | | |1 = Receive FIFO is overrun. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock periods in Master mode or over 576 SPI peripheral clock periods in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |SPIENSTS |SPI Enable Status (Read Only) - * | | |0 = The SPI controller is disabled. - * | | |1 = The SPI controller is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI control logic is disabled, this bit indicates the real status of SPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slave's transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var SPI_T::TX - * Offset: 0x20 SPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 4-level transmit FIFO buffers - * | | |The number of valid bits depends on the setting of DWIDTH (SPIx_CTL[12:8]) in SPI mode or WDWIDTH (SPIx_I2SCTL[5:4]) in I2S mode. - * | | |In SPI mode, if DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted - * | | |If DWIDTH is set to 0x00 , the SPI controller will perform a 32-bit transfer. - * | | |In I2S mode, if WDWIDTH (SPIx_I2SCTL[5:4]) is set to 0x2, the data width of audio channel is 24-bit and corresponding to TX[23:0] - * | | |If WDWIDTH is set as 0x0, 0x1, or 0x3, all bits of this field are valid and referred to the data arrangement in I2S mode FIFO operation section - * | | |Note: In Master mode, SPI controller will start to transfer the SPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var SPI_T::RX - * Offset: 0x30 SPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register - * | | |There are 4-level FIFO buffers in this controller - * | | |The data receive register holds the data received from SPI data input pin - * | | |If the RXEMPTY (SPIx_STATUS[8] or SPIx_I2SSTS[8]) is not set to 1, the receive FIFO buffers can be accessed through software by reading this register - * | | |This is a read only register. - * @var SPI_T::I2SCTL - * Offset: 0x60 I2S Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SEN |I2S Controller Enable Bit - * | | |0 = Disabled I2S mode. - * | | |1 = Enabled I2S mode. - * | | |Note: - * | | |1. If enable this bit, I2Sx_BCLK will start to output in Master mode. - * | | |2 - * | | |Before changing the configurations of SPIx_I2SCTL, SPIx_I2SCLK, and SPIx_FIFOCTL registers, user shall clear the I2SEN (SPIx_I2SCTL[0]) and confirm the I2SENSTS (SPIx_I2SSTS[15]) is 0. - * |[1] |TXEN |Transmit Enable Bit - * | | |0 = Data transmit Disabled. - * | | |1 = Data transmit Enabled. - * |[2] |RXEN |Receive Enable Bit - * | | |0 = Data receive Disabled. - * | | |1 = Data receive Enabled. - * |[3] |MUTE |Transmit Mute Enable Bit - * | | |0 = Transmit data is shifted from buffer. - * | | |1 = Transmit channel zero. - * |[5:4] |WDWIDTH |Word Width - * | | |00 = data size is 8-bit. - * | | |01 = data size is 16-bit. - * | | |10 = data size is 24-bit. - * | | |11 = data size is 32-bit. - * |[6] |MONO |Monaural Data - * | | |0 = Data is stereo format. - * | | |1 = Data is monaural format. - * |[7] |ORDER |Stereo Data Order in FIFO - * | | |0 = Left channel data at high byte. - * | | |1 = Left channel data at low byte. - * |[8] |SLAVE |Slave Mode - * | | |I2S can operate as master or slave - * | | |For Master mode, I2Sx_BCLK and I2Sx_LRCLK pins are output mode and send bit clock from NuMicro M480 series to audio CODEC chip - * | | |In Slave mode, I2Sx_BCLK and I2Sx_LRCLK pins are input mode and I2Sx_BCLK and I2Sx_LRCLK signals are received from outer audio CODEC chip. - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[15] |MCLKEN |Master Clock Enable Bit - * | | |If MCLKEN is set to 1, I2S controller will generate master clock on SPIx_I2SMCLK pin for external audio devices. - * | | |0 = Master clock Disabled. - * | | |1 = Master clock Enabled. - * |[16] |RZCEN |Right Channel Zero Cross Detection Enable Bit - * | | |If this bit is set to 1, when right channel data sign bit change or next shift data bits are all 0 then RZCIF flag in SPIx_I2SSTS register is set to 1 - * | | |This function is only available in transmit operation. - * | | |0 = Right channel zero cross detection Disabled. - * | | |1 = Right channel zero cross detection Enabled. - * |[17] |LZCEN |Left Channel Zero Cross Detection Enable Bit - * | | |If this bit is set to 1, when left channel data sign bit changes or next shift data bits are all 0 then LZCIF flag in SPIx_I2SSTS register is set to 1 - * | | |This function is only available in transmit operation. - * | | |0 = Left channel zero cross detection Disabled. - * | | |1 = Left channel zero cross detection Enabled. - * |[23] |RXLCH |Receive Left Channel Enable Bit - * | | |When monaural format is selected (MONO = 1), I2S controller will receive right channel data if RXLCH is set to 0, and receive left channel data if RXLCH is set to 1. - * | | |0 = Receive right channel data in Mono mode. - * | | |1 = Receive left channel data in Mono mode. - * |[24] |RZCIEN |Right Channel Zero Cross Interrupt Enable Bit - * | | |Interrupt occurs if this bit is set to 1 and right channel zero cross event occurs. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[25] |LZCIEN |Left Channel Zero Cross Interrupt Enable Bit - * | | |Interrupt occurs if this bit is set to 1 and left channel zero cross event occurs. - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[29:28] |FORMAT |Data Format Selection - * | | |00 = I2S data format. - * | | |01 = MSB justified data format. - * | | |10 = PCM mode A. - * | | |11 = PCM mode B. - * @var SPI_T::I2SCLK - * Offset: 0x64 I2S Clock Divider Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |MCLKDIV |Master Clock Divider - * | | |If MCLKEN is set to 1, I2S controller will generate master clock for external audio devices - * | | |The frequency of master clock, fMCLK, is determined by the following expressions: - * | | |If MCLKDIV >= 1,. - * | | |If MCLKDIV = 0,. - * | | |where - * | | |is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL2 - * | | |In general, the master clock rate is 256 times sampling clock rate. - * |[17:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode - * | | |The clock frequency of bit clock , fBCLK, is determined by the following expression: - * | | |where - * | | |is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL2. - * | | |In I2S Slave mode, this field is used to define the frequency of peripheral clock and it's determined by . - * | | |The peripheral clock frequency in I2S Slave mode must be equal to or faster than 6 times of input bit clock. - * @var SPI_T::I2SSTS - * Offset: 0x68 I2S Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |RIGHT |Right Channel (Read Only) - * | | |This bit indicates the current transmit data is belong to which channel. - * | | |0 = Left channel. - * | | |1 = Right channel. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * | | |Note: If RXTHIEN = 1 and RXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock period in Master mode or over 576 SPI peripheral clock period in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |I2SENSTS |I2S Enable Status (Read Only) - * | | |0 = The SPI/I2S control logic is disabled. - * | | |1 = The SPI/I2S control logic is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI/I2S control logic is disabled, this bit indicates the real status of SPI/I2S control logic for user. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * | | |Note: If TXTHIEN = 1 and TXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[19] |TXUFIF |Transmit FIFO Underflow Interrupt Flag - * | | |When the transmit FIFO buffer is empty and there is no datum written into the FIFO buffer, if there is more bus clock input, this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[20] |RZCIF |Right Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on right channel. - * | | |1 = Zero cross event occurred on right channel. - * |[21] |LZCIF |Left Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on left channel. - * | | |1 = Zero cross event occurred on left channel. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[26:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[30:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - */ - __IO uint32_t CTL; /*!< [0x0000] SPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] SPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] SPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] SPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] SPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] SPI Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __O uint32_t TX; /*!< [0x0020] SPI Data Transmit Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t RX; /*!< [0x0030] SPI Data Receive Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[11]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t I2SCTL; /*!< [0x0060] I2S Control Register */ - __IO uint32_t I2SCLK; /*!< [0x0064] I2S Clock Divider Control Register */ - __IO uint32_t I2SSTS; /*!< [0x0068] I2S Status Register */ - -} SPI_T; - -/** - @addtogroup SPI_CONST SPI Bit Field Definition - Constant Definitions for SPI Controller -@{ */ - -#define SPI_CTL_SPIEN_Pos (0) /*!< SPI_T::CTL: SPIEN Position */ -#define SPI_CTL_SPIEN_Msk (0x1ul << SPI_CTL_SPIEN_Pos) /*!< SPI_T::CTL: SPIEN Mask */ - -#define SPI_CTL_RXNEG_Pos (1) /*!< SPI_T::CTL: RXNEG Position */ -#define SPI_CTL_RXNEG_Msk (0x1ul << SPI_CTL_RXNEG_Pos) /*!< SPI_T::CTL: RXNEG Mask */ - -#define SPI_CTL_TXNEG_Pos (2) /*!< SPI_T::CTL: TXNEG Position */ -#define SPI_CTL_TXNEG_Msk (0x1ul << SPI_CTL_TXNEG_Pos) /*!< SPI_T::CTL: TXNEG Mask */ - -#define SPI_CTL_CLKPOL_Pos (3) /*!< SPI_T::CTL: CLKPOL Position */ -#define SPI_CTL_CLKPOL_Msk (0x1ul << SPI_CTL_CLKPOL_Pos) /*!< SPI_T::CTL: CLKPOL Mask */ - -#define SPI_CTL_SUSPITV_Pos (4) /*!< SPI_T::CTL: SUSPITV Position */ -#define SPI_CTL_SUSPITV_Msk (0xful << SPI_CTL_SUSPITV_Pos) /*!< SPI_T::CTL: SUSPITV Mask */ - -#define SPI_CTL_DWIDTH_Pos (8) /*!< SPI_T::CTL: DWIDTH Position */ -#define SPI_CTL_DWIDTH_Msk (0x1ful << SPI_CTL_DWIDTH_Pos) /*!< SPI_T::CTL: DWIDTH Mask */ - -#define SPI_CTL_LSB_Pos (13) /*!< SPI_T::CTL: LSB Position */ -#define SPI_CTL_LSB_Msk (0x1ul << SPI_CTL_LSB_Pos) /*!< SPI_T::CTL: LSB Mask */ - -#define SPI_CTL_HALFDPX_Pos (14) /*!< SPI_T::CTL: HALFDPX Position */ -#define SPI_CTL_HALFDPX_Msk (0x1ul << SPI_CTL_HALFDPX_Pos) /*!< SPI_T::CTL: HALFDPX Mask */ - -#define SPI_CTL_RXONLY_Pos (15) /*!< SPI_T::CTL: RXONLY Position */ -#define SPI_CTL_RXONLY_Msk (0x1ul << SPI_CTL_RXONLY_Pos) /*!< SPI_T::CTL: RXONLY Mask */ - -#define SPI_CTL_UNITIEN_Pos (17) /*!< SPI_T::CTL: UNITIEN Position */ -#define SPI_CTL_UNITIEN_Msk (0x1ul << SPI_CTL_UNITIEN_Pos) /*!< SPI_T::CTL: UNITIEN Mask */ - -#define SPI_CTL_SLAVE_Pos (18) /*!< SPI_T::CTL: SLAVE Position */ -#define SPI_CTL_SLAVE_Msk (0x1ul << SPI_CTL_SLAVE_Pos) /*!< SPI_T::CTL: SLAVE Mask */ - -#define SPI_CTL_REORDER_Pos (19) /*!< SPI_T::CTL: REORDER Position */ -#define SPI_CTL_REORDER_Msk (0x1ul << SPI_CTL_REORDER_Pos) /*!< SPI_T::CTL: REORDER Mask */ - -#define SPI_CTL_DATDIR_Pos (20) /*!< SPI_T::CTL: DATDIR Position */ -#define SPI_CTL_DATDIR_Msk (0x1ul << SPI_CTL_DATDIR_Pos) /*!< SPI_T::CTL: DATDIR Mask */ - -#define SPI_CLKDIV_DIVIDER_Pos (0) /*!< SPI_T::CLKDIV: DIVIDER Position */ -#define SPI_CLKDIV_DIVIDER_Msk (0x1fful << SPI_CLKDIV_DIVIDER_Pos) /*!< SPI_T::CLKDIV: DIVIDER Mask */ - -#define SPI_SSCTL_SS_Pos (0) /*!< SPI_T::SSCTL: SS Position */ -#define SPI_SSCTL_SS_Msk (0x1ul << SPI_SSCTL_SS_Pos) /*!< SPI_T::SSCTL: SS Mask */ - -#define SPI_SSCTL_SSACTPOL_Pos (2) /*!< SPI_T::SSCTL: SSACTPOL Position */ -#define SPI_SSCTL_SSACTPOL_Msk (0x1ul << SPI_SSCTL_SSACTPOL_Pos) /*!< SPI_T::SSCTL: SSACTPOL Mask */ - -#define SPI_SSCTL_AUTOSS_Pos (3) /*!< SPI_T::SSCTL: AUTOSS Position */ -#define SPI_SSCTL_AUTOSS_Msk (0x1ul << SPI_SSCTL_AUTOSS_Pos) /*!< SPI_T::SSCTL: AUTOSS Mask */ - -#define SPI_SSCTL_SLVBEIEN_Pos (8) /*!< SPI_T::SSCTL: SLVBEIEN Position */ -#define SPI_SSCTL_SLVBEIEN_Msk (0x1ul << SPI_SSCTL_SLVBEIEN_Pos) /*!< SPI_T::SSCTL: SLVBEIEN Mask */ - -#define SPI_SSCTL_SLVURIEN_Pos (9) /*!< SPI_T::SSCTL: SLVURIEN Position */ -#define SPI_SSCTL_SLVURIEN_Msk (0x1ul << SPI_SSCTL_SLVURIEN_Pos) /*!< SPI_T::SSCTL: SLVURIEN Mask */ - -#define SPI_SSCTL_SSACTIEN_Pos (12) /*!< SPI_T::SSCTL: SSACTIEN Position */ -#define SPI_SSCTL_SSACTIEN_Msk (0x1ul << SPI_SSCTL_SSACTIEN_Pos) /*!< SPI_T::SSCTL: SSACTIEN Mask */ - -#define SPI_SSCTL_SSINAIEN_Pos (13) /*!< SPI_T::SSCTL: SSINAIEN Position */ -#define SPI_SSCTL_SSINAIEN_Msk (0x1ul << SPI_SSCTL_SSINAIEN_Pos) /*!< SPI_T::SSCTL: SSINAIEN Mask */ - -#define SPI_SSCTL_SLVTOCNT_Pos (16) /*!< SPI_T::SSCTL: SLVTOCNT Position */ -#define SPI_SSCTL_SLVTOCNT_Msk (0xfffful << SPI_SSCTL_SLVTOCNT_Pos) /*!< SPI_T::SSCTL: SLVTOCNT Mask */ - -#define SPI_PDMACTL_TXPDMAEN_Pos (0) /*!< SPI_T::PDMACTL: TXPDMAEN Position */ -#define SPI_PDMACTL_TXPDMAEN_Msk (0x1ul << SPI_PDMACTL_TXPDMAEN_Pos) /*!< SPI_T::PDMACTL: TXPDMAEN Mask */ - -#define SPI_PDMACTL_RXPDMAEN_Pos (1) /*!< SPI_T::PDMACTL: RXPDMAEN Position */ -#define SPI_PDMACTL_RXPDMAEN_Msk (0x1ul << SPI_PDMACTL_RXPDMAEN_Pos) /*!< SPI_T::PDMACTL: RXPDMAEN Mask */ - -#define SPI_PDMACTL_PDMARST_Pos (2) /*!< SPI_T::PDMACTL: PDMARST Position */ -#define SPI_PDMACTL_PDMARST_Msk (0x1ul << SPI_PDMACTL_PDMARST_Pos) /*!< SPI_T::PDMACTL: PDMARST Mask */ - -#define SPI_FIFOCTL_RXRST_Pos (0) /*!< SPI_T::FIFOCTL: RXRST Position */ -#define SPI_FIFOCTL_RXRST_Msk (0x1ul << SPI_FIFOCTL_RXRST_Pos) /*!< SPI_T::FIFOCTL: RXRST Mask */ - -#define SPI_FIFOCTL_TXRST_Pos (1) /*!< SPI_T::FIFOCTL: TXRST Position */ -#define SPI_FIFOCTL_TXRST_Msk (0x1ul << SPI_FIFOCTL_TXRST_Pos) /*!< SPI_T::FIFOCTL: TXRST Mask */ - -#define SPI_FIFOCTL_RXTHIEN_Pos (2) /*!< SPI_T::FIFOCTL: RXTHIEN Position */ -#define SPI_FIFOCTL_RXTHIEN_Msk (0x1ul << SPI_FIFOCTL_RXTHIEN_Pos) /*!< SPI_T::FIFOCTL: RXTHIEN Mask */ - -#define SPI_FIFOCTL_TXTHIEN_Pos (3) /*!< SPI_T::FIFOCTL: TXTHIEN Position */ -#define SPI_FIFOCTL_TXTHIEN_Msk (0x1ul << SPI_FIFOCTL_TXTHIEN_Pos) /*!< SPI_T::FIFOCTL: TXTHIEN Mask */ - -#define SPI_FIFOCTL_RXTOIEN_Pos (4) /*!< SPI_T::FIFOCTL: RXTOIEN Position */ -#define SPI_FIFOCTL_RXTOIEN_Msk (0x1ul << SPI_FIFOCTL_RXTOIEN_Pos) /*!< SPI_T::FIFOCTL: RXTOIEN Mask */ - -#define SPI_FIFOCTL_RXOVIEN_Pos (5) /*!< SPI_T::FIFOCTL: RXOVIEN Position */ -#define SPI_FIFOCTL_RXOVIEN_Msk (0x1ul << SPI_FIFOCTL_RXOVIEN_Pos) /*!< SPI_T::FIFOCTL: RXOVIEN Mask */ - -#define SPI_FIFOCTL_TXUFPOL_Pos (6) /*!< SPI_T::FIFOCTL: TXUFPOL Position */ -#define SPI_FIFOCTL_TXUFPOL_Msk (0x1ul << SPI_FIFOCTL_TXUFPOL_Pos) /*!< SPI_T::FIFOCTL: TXUFPOL Mask */ - -#define SPI_FIFOCTL_TXUFIEN_Pos (7) /*!< SPI_T::FIFOCTL: TXUFIEN Position */ -#define SPI_FIFOCTL_TXUFIEN_Msk (0x1ul << SPI_FIFOCTL_TXUFIEN_Pos) /*!< SPI_T::FIFOCTL: TXUFIEN Mask */ - -#define SPI_FIFOCTL_RXFBCLR_Pos (8) /*!< SPI_T::FIFOCTL: RXFBCLR Position */ -#define SPI_FIFOCTL_RXFBCLR_Msk (0x1ul << SPI_FIFOCTL_RXFBCLR_Pos) /*!< SPI_T::FIFOCTL: RXFBCLR Mask */ - -#define SPI_FIFOCTL_TXFBCLR_Pos (9) /*!< SPI_T::FIFOCTL: TXFBCLR Position */ -#define SPI_FIFOCTL_TXFBCLR_Msk (0x1ul << SPI_FIFOCTL_TXFBCLR_Pos) /*!< SPI_T::FIFOCTL: TXFBCLR Mask */ - -#define SPI_FIFOCTL_RXTH_Pos (24) /*!< SPI_T::FIFOCTL: RXTH Position */ -#define SPI_FIFOCTL_RXTH_Msk (0x7ul << SPI_FIFOCTL_RXTH_Pos) /*!< SPI_T::FIFOCTL: RXTH Mask */ - -#define SPI_FIFOCTL_TXTH_Pos (28) /*!< SPI_T::FIFOCTL: TXTH Position */ -#define SPI_FIFOCTL_TXTH_Msk (0x7ul << SPI_FIFOCTL_TXTH_Pos) /*!< SPI_T::FIFOCTL: TXTH Mask */ - -#define SPI_STATUS_BUSY_Pos (0) /*!< SPI_T::STATUS: BUSY Position */ -#define SPI_STATUS_BUSY_Msk (0x1ul << SPI_STATUS_BUSY_Pos) /*!< SPI_T::STATUS: BUSY Mask */ - -#define SPI_STATUS_UNITIF_Pos (1) /*!< SPI_T::STATUS: UNITIF Position */ -#define SPI_STATUS_UNITIF_Msk (0x1ul << SPI_STATUS_UNITIF_Pos) /*!< SPI_T::STATUS: UNITIF Mask */ - -#define SPI_STATUS_SSACTIF_Pos (2) /*!< SPI_T::STATUS: SSACTIF Position */ -#define SPI_STATUS_SSACTIF_Msk (0x1ul << SPI_STATUS_SSACTIF_Pos) /*!< SPI_T::STATUS: SSACTIF Mask */ - -#define SPI_STATUS_SSINAIF_Pos (3) /*!< SPI_T::STATUS: SSINAIF Position */ -#define SPI_STATUS_SSINAIF_Msk (0x1ul << SPI_STATUS_SSINAIF_Pos) /*!< SPI_T::STATUS: SSINAIF Mask */ - -#define SPI_STATUS_SSLINE_Pos (4) /*!< SPI_T::STATUS: SSLINE Position */ -#define SPI_STATUS_SSLINE_Msk (0x1ul << SPI_STATUS_SSLINE_Pos) /*!< SPI_T::STATUS: SSLINE Mask */ - -#define SPI_STATUS_SLVBEIF_Pos (6) /*!< SPI_T::STATUS: SLVBEIF Position */ -#define SPI_STATUS_SLVBEIF_Msk (0x1ul << SPI_STATUS_SLVBEIF_Pos) /*!< SPI_T::STATUS: SLVBEIF Mask */ - -#define SPI_STATUS_SLVURIF_Pos (7) /*!< SPI_T::STATUS: SLVURIF Position */ -#define SPI_STATUS_SLVURIF_Msk (0x1ul << SPI_STATUS_SLVURIF_Pos) /*!< SPI_T::STATUS: SLVURIF Mask */ - -#define SPI_STATUS_RXEMPTY_Pos (8) /*!< SPI_T::STATUS: RXEMPTY Position */ -#define SPI_STATUS_RXEMPTY_Msk (0x1ul << SPI_STATUS_RXEMPTY_Pos) /*!< SPI_T::STATUS: RXEMPTY Mask */ - -#define SPI_STATUS_RXFULL_Pos (9) /*!< SPI_T::STATUS: RXFULL Position */ -#define SPI_STATUS_RXFULL_Msk (0x1ul << SPI_STATUS_RXFULL_Pos) /*!< SPI_T::STATUS: RXFULL Mask */ - -#define SPI_STATUS_RXTHIF_Pos (10) /*!< SPI_T::STATUS: RXTHIF Position */ -#define SPI_STATUS_RXTHIF_Msk (0x1ul << SPI_STATUS_RXTHIF_Pos) /*!< SPI_T::STATUS: RXTHIF Mask */ - -#define SPI_STATUS_RXOVIF_Pos (11) /*!< SPI_T::STATUS: RXOVIF Position */ -#define SPI_STATUS_RXOVIF_Msk (0x1ul << SPI_STATUS_RXOVIF_Pos) /*!< SPI_T::STATUS: RXOVIF Mask */ - -#define SPI_STATUS_RXTOIF_Pos (12) /*!< SPI_T::STATUS: RXTOIF Position */ -#define SPI_STATUS_RXTOIF_Msk (0x1ul << SPI_STATUS_RXTOIF_Pos) /*!< SPI_T::STATUS: RXTOIF Mask */ - -#define SPI_STATUS_SPIENSTS_Pos (15) /*!< SPI_T::STATUS: SPIENSTS Position */ -#define SPI_STATUS_SPIENSTS_Msk (0x1ul << SPI_STATUS_SPIENSTS_Pos) /*!< SPI_T::STATUS: SPIENSTS Mask */ - -#define SPI_STATUS_TXEMPTY_Pos (16) /*!< SPI_T::STATUS: TXEMPTY Position */ -#define SPI_STATUS_TXEMPTY_Msk (0x1ul << SPI_STATUS_TXEMPTY_Pos) /*!< SPI_T::STATUS: TXEMPTY Mask */ - -#define SPI_STATUS_TXFULL_Pos (17) /*!< SPI_T::STATUS: TXFULL Position */ -#define SPI_STATUS_TXFULL_Msk (0x1ul << SPI_STATUS_TXFULL_Pos) /*!< SPI_T::STATUS: TXFULL Mask */ - -#define SPI_STATUS_TXTHIF_Pos (18) /*!< SPI_T::STATUS: TXTHIF Position */ -#define SPI_STATUS_TXTHIF_Msk (0x1ul << SPI_STATUS_TXTHIF_Pos) /*!< SPI_T::STATUS: TXTHIF Mask */ - -#define SPI_STATUS_TXUFIF_Pos (19) /*!< SPI_T::STATUS: TXUFIF Position */ -#define SPI_STATUS_TXUFIF_Msk (0x1ul << SPI_STATUS_TXUFIF_Pos) /*!< SPI_T::STATUS: TXUFIF Mask */ - -#define SPI_STATUS_TXRXRST_Pos (23) /*!< SPI_T::STATUS: TXRXRST Position */ -#define SPI_STATUS_TXRXRST_Msk (0x1ul << SPI_STATUS_TXRXRST_Pos) /*!< SPI_T::STATUS: TXRXRST Mask */ - -#define SPI_STATUS_RXCNT_Pos (24) /*!< SPI_T::STATUS: RXCNT Position */ -#define SPI_STATUS_RXCNT_Msk (0xful << SPI_STATUS_RXCNT_Pos) /*!< SPI_T::STATUS: RXCNT Mask */ - -#define SPI_STATUS_TXCNT_Pos (28) /*!< SPI_T::STATUS: TXCNT Position */ -#define SPI_STATUS_TXCNT_Msk (0xful << SPI_STATUS_TXCNT_Pos) /*!< SPI_T::STATUS: TXCNT Mask */ - -#define SPI_TX_TX_Pos (0) /*!< SPI_T::TX: TX Position */ -#define SPI_TX_TX_Msk (0xfffffffful << SPI_TX_TX_Pos) /*!< SPI_T::TX: TX Mask */ - -#define SPI_RX_RX_Pos (0) /*!< SPI_T::RX: RX Position */ -#define SPI_RX_RX_Msk (0xfffffffful << SPI_RX_RX_Pos) /*!< SPI_T::RX: RX Mask */ - -#define SPI_I2SCTL_I2SEN_Pos (0) /*!< SPI_T::I2SCTL: I2SEN Position */ -#define SPI_I2SCTL_I2SEN_Msk (0x1ul << SPI_I2SCTL_I2SEN_Pos) /*!< SPI_T::I2SCTL: I2SEN Mask */ - -#define SPI_I2SCTL_TXEN_Pos (1) /*!< SPI_T::I2SCTL: TXEN Position */ -#define SPI_I2SCTL_TXEN_Msk (0x1ul << SPI_I2SCTL_TXEN_Pos) /*!< SPI_T::I2SCTL: TXEN Mask */ - -#define SPI_I2SCTL_RXEN_Pos (2) /*!< SPI_T::I2SCTL: RXEN Position */ -#define SPI_I2SCTL_RXEN_Msk (0x1ul << SPI_I2SCTL_RXEN_Pos) /*!< SPI_T::I2SCTL: RXEN Mask */ - -#define SPI_I2SCTL_MUTE_Pos (3) /*!< SPI_T::I2SCTL: MUTE Position */ -#define SPI_I2SCTL_MUTE_Msk (0x1ul << SPI_I2SCTL_MUTE_Pos) /*!< SPI_T::I2SCTL: MUTE Mask */ - -#define SPI_I2SCTL_WDWIDTH_Pos (4) /*!< SPI_T::I2SCTL: WDWIDTH Position */ -#define SPI_I2SCTL_WDWIDTH_Msk (0x3ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPI_T::I2SCTL: WDWIDTH Mask */ - -#define SPI_I2SCTL_MONO_Pos (6) /*!< SPI_T::I2SCTL: MONO Position */ -#define SPI_I2SCTL_MONO_Msk (0x1ul << SPI_I2SCTL_MONO_Pos) /*!< SPI_T::I2SCTL: MONO Mask */ - -#define SPI_I2SCTL_ORDER_Pos (7) /*!< SPI_T::I2SCTL: ORDER Position */ -#define SPI_I2SCTL_ORDER_Msk (0x1ul << SPI_I2SCTL_ORDER_Pos) /*!< SPI_T::I2SCTL: ORDER Mask */ - -#define SPI_I2SCTL_SLAVE_Pos (8) /*!< SPI_T::I2SCTL: SLAVE Position */ -#define SPI_I2SCTL_SLAVE_Msk (0x1ul << SPI_I2SCTL_SLAVE_Pos) /*!< SPI_T::I2SCTL: SLAVE Mask */ - -#define SPI_I2SCTL_MCLKEN_Pos (15) /*!< SPI_T::I2SCTL: MCLKEN Position */ -#define SPI_I2SCTL_MCLKEN_Msk (0x1ul << SPI_I2SCTL_MCLKEN_Pos) /*!< SPI_T::I2SCTL: MCLKEN Mask */ - -#define SPI_I2SCTL_RZCEN_Pos (16) /*!< SPI_T::I2SCTL: RZCEN Position */ -#define SPI_I2SCTL_RZCEN_Msk (0x1ul << SPI_I2SCTL_RZCEN_Pos) /*!< SPI_T::I2SCTL: RZCEN Mask */ - -#define SPI_I2SCTL_LZCEN_Pos (17) /*!< SPI_T::I2SCTL: LZCEN Position */ -#define SPI_I2SCTL_LZCEN_Msk (0x1ul << SPI_I2SCTL_LZCEN_Pos) /*!< SPI_T::I2SCTL: LZCEN Mask */ - -#define SPI_I2SCTL_RXLCH_Pos (23) /*!< SPI_T::I2SCTL: RXLCH Position */ -#define SPI_I2SCTL_RXLCH_Msk (0x1ul << SPI_I2SCTL_RXLCH_Pos) /*!< SPI_T::I2SCTL: RXLCH Mask */ - -#define SPI_I2SCTL_RZCIEN_Pos (24) /*!< SPI_T::I2SCTL: RZCIEN Position */ -#define SPI_I2SCTL_RZCIEN_Msk (0x1ul << SPI_I2SCTL_RZCIEN_Pos) /*!< SPI_T::I2SCTL: RZCIEN Mask */ - -#define SPI_I2SCTL_LZCIEN_Pos (25) /*!< SPI_T::I2SCTL: LZCIEN Position */ -#define SPI_I2SCTL_LZCIEN_Msk (0x1ul << SPI_I2SCTL_LZCIEN_Pos) /*!< SPI_T::I2SCTL: LZCIEN Mask */ - -#define SPI_I2SCTL_FORMAT_Pos (28) /*!< SPI_T::I2SCTL: FORMAT Position */ -#define SPI_I2SCTL_FORMAT_Msk (0x3ul << SPI_I2SCTL_FORMAT_Pos) /*!< SPI_T::I2SCTL: FORMAT Mask */ - -#define SPI_I2SCLK_MCLKDIV_Pos (0) /*!< SPI_T::I2SCLK: MCLKDIV Position */ -#define SPI_I2SCLK_MCLKDIV_Msk (0x7ful << SPI_I2SCLK_MCLKDIV_Pos) /*!< SPI_T::I2SCLK: MCLKDIV Mask */ - -#define SPI_I2SCLK_BCLKDIV_Pos (8) /*!< SPI_T::I2SCLK: BCLKDIV Position */ -#define SPI_I2SCLK_BCLKDIV_Msk (0x3fful << SPI_I2SCLK_BCLKDIV_Pos) /*!< SPI_T::I2SCLK: BCLKDIV Mask */ - -#define SPI_I2SSTS_RIGHT_Pos (4) /*!< SPI_T::I2SSTS: RIGHT Position */ -#define SPI_I2SSTS_RIGHT_Msk (0x1ul << SPI_I2SSTS_RIGHT_Pos) /*!< SPI_T::I2SSTS: RIGHT Mask */ - -#define SPI_I2SSTS_RXEMPTY_Pos (8) /*!< SPI_T::I2SSTS: RXEMPTY Position */ -#define SPI_I2SSTS_RXEMPTY_Msk (0x1ul << SPI_I2SSTS_RXEMPTY_Pos) /*!< SPI_T::I2SSTS: RXEMPTY Mask */ - -#define SPI_I2SSTS_RXFULL_Pos (9) /*!< SPI_T::I2SSTS: RXFULL Position */ -#define SPI_I2SSTS_RXFULL_Msk (0x1ul << SPI_I2SSTS_RXFULL_Pos) /*!< SPI_T::I2SSTS: RXFULL Mask */ - -#define SPI_I2SSTS_RXTHIF_Pos (10) /*!< SPI_T::I2SSTS: RXTHIF Position */ -#define SPI_I2SSTS_RXTHIF_Msk (0x1ul << SPI_I2SSTS_RXTHIF_Pos) /*!< SPI_T::I2SSTS: RXTHIF Mask */ - -#define SPI_I2SSTS_RXOVIF_Pos (11) /*!< SPI_T::I2SSTS: RXOVIF Position */ -#define SPI_I2SSTS_RXOVIF_Msk (0x1ul << SPI_I2SSTS_RXOVIF_Pos) /*!< SPI_T::I2SSTS: RXOVIF Mask */ - -#define SPI_I2SSTS_RXTOIF_Pos (12) /*!< SPI_T::I2SSTS: RXTOIF Position */ -#define SPI_I2SSTS_RXTOIF_Msk (0x1ul << SPI_I2SSTS_RXTOIF_Pos) /*!< SPI_T::I2SSTS: RXTOIF Mask */ - -#define SPI_I2SSTS_I2SENSTS_Pos (15) /*!< SPI_T::I2SSTS: I2SENSTS Position */ -#define SPI_I2SSTS_I2SENSTS_Msk (0x1ul << SPI_I2SSTS_I2SENSTS_Pos) /*!< SPI_T::I2SSTS: I2SENSTS Mask */ - -#define SPI_I2SSTS_TXEMPTY_Pos (16) /*!< SPI_T::I2SSTS: TXEMPTY Position */ -#define SPI_I2SSTS_TXEMPTY_Msk (0x1ul << SPI_I2SSTS_TXEMPTY_Pos) /*!< SPI_T::I2SSTS: TXEMPTY Mask */ - -#define SPI_I2SSTS_TXFULL_Pos (17) /*!< SPI_T::I2SSTS: TXFULL Position */ -#define SPI_I2SSTS_TXFULL_Msk (0x1ul << SPI_I2SSTS_TXFULL_Pos) /*!< SPI_T::I2SSTS: TXFULL Mask */ - -#define SPI_I2SSTS_TXTHIF_Pos (18) /*!< SPI_T::I2SSTS: TXTHIF Position */ -#define SPI_I2SSTS_TXTHIF_Msk (0x1ul << SPI_I2SSTS_TXTHIF_Pos) /*!< SPI_T::I2SSTS: TXTHIF Mask */ - -#define SPI_I2SSTS_TXUFIF_Pos (19) /*!< SPI_T::I2SSTS: TXUFIF Position */ -#define SPI_I2SSTS_TXUFIF_Msk (0x1ul << SPI_I2SSTS_TXUFIF_Pos) /*!< SPI_T::I2SSTS: TXUFIF Mask */ - -#define SPI_I2SSTS_RZCIF_Pos (20) /*!< SPI_T::I2SSTS: RZCIF Position */ -#define SPI_I2SSTS_RZCIF_Msk (0x1ul << SPI_I2SSTS_RZCIF_Pos) /*!< SPI_T::I2SSTS: RZCIF Mask */ - -#define SPI_I2SSTS_LZCIF_Pos (21) /*!< SPI_T::I2SSTS: LZCIF Position */ -#define SPI_I2SSTS_LZCIF_Msk (0x1ul << SPI_I2SSTS_LZCIF_Pos) /*!< SPI_T::I2SSTS: LZCIF Mask */ - -#define SPI_I2SSTS_TXRXRST_Pos (23) /*!< SPI_T::I2SSTS: TXRXRST Position */ -#define SPI_I2SSTS_TXRXRST_Msk (0x1ul << SPI_I2SSTS_TXRXRST_Pos) /*!< SPI_T::I2SSTS: TXRXRST Mask */ - -#define SPI_I2SSTS_RXCNT_Pos (24) /*!< SPI_T::I2SSTS: RXCNT Position */ -#define SPI_I2SSTS_RXCNT_Msk (0x7ul << SPI_I2SSTS_RXCNT_Pos) /*!< SPI_T::I2SSTS: RXCNT Mask */ - -#define SPI_I2SSTS_TXCNT_Pos (28) /*!< SPI_T::I2SSTS: TXCNT Position */ -#define SPI_I2SSTS_TXCNT_Msk (0x7ul << SPI_I2SSTS_TXCNT_Pos) /*!< SPI_T::I2SSTS: TXCNT Mask */ - -/**@}*/ /* SPI_CONST */ -/**@}*/ /* end of SPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __SPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spim_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spim_reg.h deleted file mode 100644 index 59a9a343f18..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/spim_reg.h +++ /dev/null @@ -1,557 +0,0 @@ -/**************************************************************************//** - * @file spim_reg.h - * @version V1.00 - * @brief SPIM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SPIM_REG_H__ -#define __SPIM_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SPIM Serial Peripheral Interface Controller Master Mode (SPIM) - Memory Mapped Structure for SPIM Controller -@{ */ - -typedef struct -{ - - - /** - * @var SPIM_T::CTL0 - * Offset: 0x00 Control and Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CIPHOFF |Cipher Disable Control - * | | |0 = Cipher function Enabled. - * | | |1 = Cipher function Disabled. - * | | |Note1: If there is not any KEY1(SPIM_KEY1[31:0]) or KEY2(SPIM_KEY2[31:0]) (KEY1 is 0x0000_0000 or KEY2 is 0x0000_0000), the cipher function will be disabled automatically. - * | | |Note2: When CIPHOFF(SPIM_CTL0[0]) is 0, both of KEY1(SPIM_KEY1[31:0]) and KEY2(SPIM_KEY2[31:0]) do not equal to 0x0000_0000 (i.e. - * | | |KEY1 != 0x0000_0000 and KEY2 != 0x0000_0000), cipher encryption/decryption is enabled. - * | | |Note3 : When cipher encryption/decryption is enabled, please set DESELTIM (SPIM_DMMCTL[20:16]) >= 0x10. - * | | |When cipher encryption/decryption is disabled, please set DESELTIM(SPIM_DMMCTL[20:16]) >= 0x8. - * |[2] |BALEN |Balance the AHB Control Time Between Cipher Enable and Disable Control - * | | |When cipher is enabled, the AHB control signal will delay some time caused by the encoding or decoding calculation - * | | |Therefore, if set BALEN to 1, it will make the AHB signal processing time with cipher disabled be equal to that with cipher enabled. - * | | |Note: Only useful when cipher is disabled. - * |[5] |B4ADDREN |4-byte Address Mode Enable Control - * | | |0 = 4-byte address mode is disabled, and 3-byte address mode is enabled. - * | | |1 = 4-byte address mode is enabled. - * | | |Note: Used for DMA write mode, DMA read mode, and DMM mode. - * |[6] |IEN |Interrupt Enable Control - * | | |0 = SPIM Interrupt Disabled. - * | | |1 = SPIM Interrupt Enabled. - * |[7] |IF |Interrupt Flag - * | | |(1) Write Operation : - * | | |0 = No effect. - * | | |1 = Write 1 to clear. - * | | |(2) Read Operation : - * | | |0 = The transfer has not finished yet. - * | | |1 = The transfer has done. - * |[12:8] |DWIDTH |Transmit/Receive Bit Length - * | | |This specifies how many bits are transmitted/received in one transmit/receive transaction. - * | | |0x7 = 8 bits. - * | | |0xF = 16 bits. - * | | |0x17 = 24 bits. - * | | |0x1F = 32 bits. - * | | |Others = Incorrect transfer result. - * | | |Note1: Only used for normal I/O mode. - * | | |Note2: Only 8, 16, 24, and 32 bits are allowed. Other bit length will result in incorrect transfer. - * |[14:13] |BURSTNUM |Transmit/Receive Burst Number - * | | |This field specifies how many transmit/receive transactions should be executed continuously in one transfer. - * | | |0x0 = Only one transmit/receive transaction will be executed in one transfer. - * | | |0x1 = Two successive transmit/receive transactions will be executed in one transfer. - * | | |0x2 = Three successive transmit/receive transactions will be executed in one transfer. - * | | |0x3 = Four successive transmit/receive transactions will be executed in one transfer. - * | | |Note: Only used for normal I/O Mode. - * |[15] |QDIODIR |SPI Interface Direction Select for Quad/Dual Mode - * | | |0 = Interface signals are input. - * | | |1 = Interface signals are output. - * | | |Note: Only used for normal I/O mode. - * |[19:16] |SUSPITV |Suspend Interval - * | | |These four bits provide the configuration of suspend interval between two successive transmit/receive transactions in a transfer - * | | |The default value is 0x00 - * | | |When BURSTNUM = 00, setting this field has no effect on transfer - * | | |The desired interval is obtained according to the following equation (from the last falling edge of current SPI clock to the first rising edge of next SPI clock): - * | | | (SUSPITV+2)*period of AHB clock - * | | | 0x0 = 2 AHB clock cycles. - * | | | 0x1 = 3 AHB clock cycles. - * | | | ...... - * | | | 0xE = 16 AHB clock cycles. - * | | | 0xF = 17 AHB clock cycles. - * | | | Note: Only used for normal I/O mode. - * |[21:20] |BITMODE |SPI Interface Bit Mode - * | | |0x0 = Standard mode. - * | | |0x1 = Dual mode. - * | | |0x2 = Quad mode. - * | | |0x3 = Reserved. - * | | |Note: Only used for normal I/O mode. - * |[23:22] |OPMODE |SPI Function Operation Mode - * | | |0x0 = Normal I/O mode. (Note1) (Note3) - * | | |0x1 = DMA write mode. (Note2) (Note3) - * | | |0x2 = DMA read mode. (Note3) - * | | |0x3 = Direct Memory Mapping mode (DMM mode) (Default). (Note4) - * | | |Note1 : After user uses Normal I/O mode of SPI flash controller to program the content of external SPI flash, please set CDINVAL(SPIM_CTL1[3]) to 0x1 (Set all cache data to be invalid). - * | | |Note2 : In DMA write mode, hardware will send just one page program command per operation - * | | |Users must take care of cross-page cases - * | | |After user uses DMA write mode of SPI flash controller to program the content of external SPI flash, please set CDINVAL(SPIM_CTL1[3]) to 0x1 (Set all cache data to be invalid). - * | | |Note3 : For external SPI flash with 32 MB, access address range of external SPI flash address is from 0x00000000 to 0x01FFFFFF when user uses Normal I/O mode, DMA write mode, and DMA read mode to write/read external SPI flash data - * | | |Please user check size of used SPI flash component to know access address range of external SPI flash. - * | | |Note4 : For external SPI flash with 32 MB, access address range of external SPI flash address is from 0x08000000 to 0x09FFFFFF when user uses Direct Memory mapping mode (DMM mode) to read external SPI flash data - * | | |Please user check size of used SPI flash component to know access address range of external SPI flash. - * |[31:24] |CMDCODE |Page Program Command Code (Note4) - * | | |(1) 0x02 = Page program (Used for DMA Write mode). - * | | |(2) 0x32 = Quad page program with TYPE_1 program flow (Used for DMA Write mode). (Note3) - * | | |(3) 0x38 = Quad page program with TYPE_2 program flow (Used for DMA Write mode). (Note3) - * | | |(4) 0x40 = Quad page program with TYPE_3 program flow (Used for DMA Write mode). (Note3) - * | | |The Others = Reserved. - * | | |Read Command Code : - * | | |(1) 0x03 = Standard Read (Used for DMA Read/DMM mode). - * | | |(2) 0x0B = Fast Read (Used for DMA Read/DMM mode). - * | | |The fast read command code "0x0B" is similar to command code of standard read "0x03" except it can operate at highest possible frequency - * | | |(Note2) - * | | |(3) 0x3B = Fast Read Dual Output (Used for DMA Read/DMM mode). - * | | |(4) 0xBB = Fast Read Dual I/O (Used for DMA Read/DMM mode). - * | | |The fast read dual I/O command code "0xBB" is similar to command code of fast read dual output "0x3B" but with capability to input the address bits two bits per clock - * | | |(Note2) - * | | |(5) 0xEB = Fast quad read (Used for DMA Read/DMM mode). - * | | |(6) 0xE7 = Word quad read (Used for DMA Read/DMM mode). - * | | |The command code of word quad read "0xE7" is similar to command code of fast quad read "0xEB" except that the lowest address bit must equal to 0 and the number of dummy cycles is less than fast quad read - * | | |(Note2) - * | | |(7) 0x0D = DTR/DDR Fast read (Used for DMA Read/DMM mode). - * | | |(8) 0xBD = DTR/DDR dual read (Used for DMA Read/DMM mode). - * | | |(9) 0xED = DTR/DDR quad read (Used for DMA Read/DMM mode). - * | | |The Others command codes are Reserved. - * | | |The DTR/DDR read commands "0x0D,0xBD,0xED" improves throughput by transferring address and data on both the falling and rising edge of SPI flash clock (SPIM_CLK) - * | | |It is similar to those commands "0x0B, 0xBB, 0xEB" but allows transfer of address and data on rising edge and falling edge of SPI flash output clock - * | | |(Note2) - * | | |Note1: Quad mode of SPI Flash must be enabled first by normal I/O mode before using quad page program/quad read commands. - * | | |Note2: See SPI flash specifications for support items. - * | | |Note3: For TYPE_1, TYPE_2, and TYPE_3 of page program command code, refer to Figure 7.19-3, Figure 7.19-4, and Figure 7.19-5. - * | | |Note4: Please disable "continuous read mode" and "burst wrap mode" before DMA write mode of SPI flash controller is used to program data of external SPI flash - * | | |After user uses DMA write mode of SPI flash controller to program the content of external SPI flash, please set CDINVAL(SPIM_CTL1[3]) to 0x1 (Set all cache data to be invalid). - * @var SPIM_T::CTL1 - * Offset: 0x04 Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIMEN |Go and Busy Status - * | | |(1) Write Operation : - * | | |0 = No effect. - * | | |1 = Start the transfer - * | | |This bit remains set during the transfer and is automatically cleared after transfer finished. - * | | |(2) Read Operation : - * | | |0 = The transfer has done. - * | | |1 = The transfer has not finished yet. - * | | |Note: All registers should be set before writing 1 to the SPIMEN bit - * | | |When a transfer is in progress, you should not write to any register of this peripheral. - * |[1] |CACHEOFF |Cache Memory Function Disable Control - * | | |0 = Cache memory function enable. (Default value) - * | | |1 = Cache memory function disable. - * | | |Note: When CCM mode is enabled, the cache function will be disable by hardware automatically - * | | |When CCM mode is disabled, the cache function can be enable or disable by user. - * |[2] |CCMEN |CCM (Core Coupled Memory) Mode Enable Control - * | | |0 = CCM mode disable. (Default value) - * | | |1 = CCM mode enable. - * | | |Note1: When CCM mode is enabled, the cache function will be disable by hardware automatically - * | | |When CCM mode is disabled, the cache function can be enabled or disabled by user. - * | | |Note2: When CCM mode is disabled, user accesses the core coupled memory by bus master - * | | |In this case, the SPI flash controller will send error response via HRESP bus signal to bus master. - * | | |Note3: When CCM mode needs to be enabled, user sets CCMEN to 1 and needs to read this register to show the current hardware status - * | | |When reading data of CCMEN is 1, MCU can start to read data from CCM memory space or write data to CCM memory space. - * |[3] |CDINVAL |Cache Data Invalid Enable Control - * | | |(1) Write Operation: - * | | |0 = No effect. - * | | |1 = Set all cache data to be invalid. This bit is cleared by hardware automatically. - * | | |(2) Read Operation : No effect - * | | |Note: When SPI flash memory is page erasing or whole flash erasing, please set CDINVAL to 0x1 - * | | |After user uses normal I/O mode or DMA write mode of SPI flash controller to program or erase the content of external SPI flash, please set CDINVAL to 0x1. - * |[4] |SS |Slave Select Active Enable Control - * | | |0 = SPIM_SS is in active level. - * | | |1 = SPIM_SS is in inactive level (Default). - * | | |Note: This interface can only drive one device/slave at a given time - * | | |Therefore, the slave selects of the selected device must be set to its active level before starting any read or write transfer - * | | |Functional description of SSACTPOL(SPIM_CTL1[5]) and SS is shown in Table 2. - * |[5] |SSACTPOL |Slave Select Active Level - * | | |It defines the active level of device/slave select signal (SPIM_SS), and we show in Table 2. - * | | |0 = The SPIM_SS slave select signal is active low. - * | | |1 = The SPIM_SS slave select signal is active high. - * |[11:8] |IDLETIME |Idle Time Interval - * | | |In DMM mode, IDLETIME is set to control the minimum idle time between two SPI Flash accesses. - * | | |Minimum idle time = (IDLETIME + 1) * AHB clock cycle time. - * | | |Note1: Only used for DMM mode. - * | | |Note2 : AHB clock cycle time = 1/AHB clock frequency. - * |[31:16] |DIVIDER |Clock Divider Register - * | | |The value in this field is the frequency divider of the AHB clock (HCLK) to generate the serial SPI output clock "SCLK" on the output SPIM_CLK pin - * | | |The desired frequency is obtained according to the following equation: - * | | |Note1: When set DIVIDER to zero, the frequency of SPIM_CLK will be equal to the frequency of HCLK. - * | | |Note2: SCLK is serial SPI output clock. - * | | |Note3: Please check the specification of the used SPI flash component to decide the frequency of SPI flash clock. - * | | |Note4: For DTR/DDR read commands "0x0D, 0xBD, 0xED", the setting values of DIVIDER are only 1,2,4,8,16,32,..., where n = 0,1,2,3,4, ... - * @var SPIM_T::RXCLKDLY - * Offset: 0x0C RX Clock Delay Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DWDELSEL |SPI flash deselect time interval of DMA write mode - * | | |For DMA write mode only - * | | |This register sets the deselect time interval of SPI flash (i.e. - * | | |time interval of inactive level of SPIM_SS) when SPI flash controller operates on DMA write mode - * | | |(Note1) - * | | |Deselect time interval of DMA write mode = (DWDELSEL + 1) * AHB clock cycle time (Note2). - * | | |Note1: Please user check the used external SPI flash component to set this register value - * | | |In general case, the deselect time interval of SPI flash is greater than 50 ns when SPI flash performs the program operation. - * | | |Note2: AHB clock cycle time = 1/AHB clock frequency. - * |[18:16] |RDDLYSEL |Sampling Clock Delay Selection for Received Data - * | | |For Normal I/O mode, DMA read mode, DMA write mode, and direct memory mapping mode - * | | |Determine the number of inserted delay cycles - * | | |Used to adjust the sampling clock of received data to latch the correct data. - * | | |0x0 : No delay. (Default Value) - * | | |0x1 : Delay 1 SPI flash clock. - * | | |0x2 : Delay 2 SPI flash clocks. - * | | |0x3 : Delay 3 SPI flash clocks. - * | | |... - * | | |0x7 : Delay 7 SPI flash clocks - * | | |Note : We can use manufacturer id or device id of external SPI flash component to determine the correct setting value of RDDLYSEL, and we give example as follows. - * | | |For example, manufacturer id and device id of external SPI flash for some vendor are 0xEF and 0x1234 separately - * | | |Firstly, we set RDDLYSEL to 0x0, and use read manufacturer id/device id command to read the manufacturer id of external SPI flash by using normal I/O mode (the manufacturer id is 0xEF (1110_1111) in this example). - * | | |If manufacturer id which reads from external SPI flash is 0xF7 (1111_0111), it denotes that manufacturer id is shifted the right by 1 bit and most significant bit (MSB) of manufacturer id is assigned to 1 - * | | |According to manufacturer id reads from external SPI flash, we need to set RDDLYSEL to 0x1 to receive SPI flash data correctly. - * |[20] |RDEDGE |Sampling Clock Edge Selection for Received Data - * | | |For Normal I/O mode, DMA read mode, DMA write mode, and direct memory mapping mode - * | | |0 : Use SPI input clock rising edge to sample received data. (Default Value) - * | | |1 : Use SPI input clock falling edge to sample received data. - * @var SPIM_T::RX[4] - * Offset: 0x10 ~ 0x1C Data Receive Register 0 ~ 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXDAT |Data Receive Register - * | | |The Data Receive Registers hold the received data of the last executed transfer. - * | | |Number of valid RX registers is specified in SPIM_CTL0[BURSTNUM] - * | | |If BURSTNUM > 0, received data are held in the most significant RXDAT register first. - * | | |Number of valid-bit is specified in SPIM_CTL0[DWIDTH] - * | | |If DWIDTH is 16, 24, or 32, received data are held in the least significant byte of RXDAT register first. - * | | |In a byte, received data are held in the most significant bit of RXDAT register first. - * | | |Example 1: If SPIM_CTL0[BURSTNUM] = 0x3 and SPIM_CTL1[DWIDTH] = 0x17, received data will be held in the order SPIM_RX3[23:0], SPIM_RX2[23:0], SPIM_RX1[23:0], SPIM_RX0[23:0]. - * | | |Example 2: If SPIM_CTL0[BURSTNUM = 0x0 and SPIM_CTL0[DWIDTH] = 0x17, received data will be held in the order SPIM_RX0[7:0], SPIM_RX0[15:8], SPIM_RX0[23:16]. - * | | |Example 3: If SPIM_CTL0[BURSTNUM = 0x0 and SPIM_CTL0[DWIDTH] = 0x07, received data will be held in the order SPIM_RX0[7], SPIM_RX0[6], ..., - * | | |SPIM_RX0[0]. - * @var SPIM_T::TX[4] - * Offset: 0x20 ~ 0x2C Data Transmit Register 0 ~ 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXDAT |Data Transmit Register - * | | |The Data Transmit Registers hold the data to be transmitted in next transfer. - * | | |Number of valid TXDAT registers is specified in SPIM_CTL0[BURSTNUM] - * | | |If BURSTNUM > 0, data are transmitted in the most significant TXDAT register first. - * | | |Number of valid-bit is specified in SPIM_CTL0[DWIDTH] - * | | |If DWIDTH is 16, 24, or 32, data are transmitted in the least significant byte of TXDAT register first. - * | | |In a byte, data are transmitted in the most significant bit of TXDAT register first. - * | | |Example 1: If SPIM_CTL0[BURSTNUM] = 0x3 and SPIM_CTL1[DWIDTH] = 0x17, data will be transmitted in the order SPIM_TX3[23:0], SPIM_TX2[23:0], SPIM_TX1[23:0], SPIM_TX0[23:0] in next transfer. - * | | |Example 2: If SPIM_CTL0[BURSTNUM] = 0x0 and SPIM_CTL0[DWIDTH] = 0x17, data will be transmitted in the order SPIM_TX0[7:0], SPIM_TX0[15:8], SPIM_TX0[23:16] in next transfer. - * | | |Example 3: If SPIM_CTL0[BURSTNUM] = 0x0 and SPIM_CTL0[DWIDTH] = 0x07, data will be transmitted in the order SPIM_TX0[7], SPIM_TX0[6], ..., - * | | |SPIM_TX0[0] in next transfer. - * @var SPIM_T::SRAMADDR - * Offset: 0x30 SRAM Memory Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDR |SRAM Memory Address - * | | |For DMA Read mode, this is the destination address for DMA transfer. - * | | |For DMA Write mode, this is the source address for DMA transfer. - * | | |Note: This address must be word-aligned. - * @var SPIM_T::DMACNT - * Offset: 0x34 DMA Transfer Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |DMACNT |DMA Transfer Byte Count Register - * | | |It indicates the transfer length for DMA process. - * | | |Note1: The unit for counting is byte. - * | | |Note2: The number must be the multiple of 4. - * | | |Note3: Please check specification of used SPI flash to know maximum byte length of page program. - * @var SPIM_T::FADDR - * Offset: 0x38 SPI Flash Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDR |SPI Flash Address Register - * | | |For DMA Read mode, this is the source address for DMA transfer. - * | | |For DMA Write mode, this is the destination address for DMA transfer. - * | | |Note 1 : This address must be word-aligned. - * | | |Note 2 : For external SPI flash with 32 MB, the value of this SPI flash address register "ADDR" is from 0x00000000 to 0x01FFFFFF when user uses DMA write mode and DMA read mode to write/read external SPI flash data - * | | |Please user check size of used SPI flash component to know access address range of external SPI flash. - * @var SPIM_T::KEY1 - * Offset: 0x3C Cipher Key1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY1 |Cipher Key1 Register - * | | |This is the KEY1 data for cipher function. - * | | |Note1: If there is not any KEY1(SPIM_KEY1[31:0]) or KEY2(SPIM_KEY2[31:0]) (KEY1 is 0x0000_0000 or KEY2 is 0x0000_0000), the cipher function will be disabled automatically. - * | | |Note2: When CIPHOFF(SPIM_CTL0[0]) is 0, both of KEY1(SPIM_KEY1[31:0]) and KEY2(SPIM_KEY2[31:0]) do not equal to 0x0000_0000 (i.e. - * | | |KEY1 != 0x0000_0000 and KEY2 != 0x0000_0000), cipher encryption/decryption is enabled. - * @var SPIM_T::KEY2 - * Offset: 0x40 Cipher Key2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY2 |Cipher Key2 Register - * | | |This is the KEY2 data for cipher function. - * | | |Note1: If there is not any KEY1(SPIM_KEY1[31:0]) or KEY2(SPIM_KEY2[31:0]) (KEY1 is 0x0000_0000 or KEY2 is 0x0000_0000), the cipher function will be disabled automatically. - * | | |Note2: When CIPHOFF(SPIM_CTL0[0]) is 0, both of KEY1(SPIM_KEY1[31:0]) and KEY2(SPIM_KEY2[31:0]) do not equal to 0x0000_0000 (i.e. - * | | |KEY1 != 0x0000_0000 and KEY2 != 0x0000_0000), cipher encryption/decryption is enabled. - * @var SPIM_T::DMMCTL - * Offset: 0x44 Direct Memory Mapping Mode Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:8] |CRMDAT |Mode bits data for Continuous Read Mode (or performance enhance mode) (Default value = 0) - * | | |Only for direct memory mapping mode - * | | |Set the mode bits data for continuous read mode (or performance enhance mode). - * | | |When we set this mode bits currently (Note1) and set CREN(SPIM_DMMCTL[25]), this reduces the command phase by eight clocks and allows the read address to be immediately entered after SPIM_SS asserted to active - * | | |(Note1) - * | | |Note1 : Please check the used SPI flash specification to know the setting value of this mode bits data, and different SPI flash vendor may use different setting values. - * | | |Note2 : CRMDAT needs to used with CREN(SPIM_DMMCTL[25]). - * |[20:16] |DESELTIM |SPI Flash Deselect Time - * | | |Only for direct memory mapping mode - * | | |Set the minimum time width of SPI flash deselect time (i.e. - * | | |Minimum SPIM_SS deselect time), and we show in Figure 7.19-8. - * | | |(1) Cache function disable : - * | | |Minimum time width of SPIM_SS deselect time = (DESELTIM + 1) * AHB clock cycle time. - * | | |(2) Cache function enable : - * | | |Minimum time width of SPIM_SS deselect time = (DESELTIM + 4) * AHB clock cycle time. - * | | |Note1 : AHB clock cycle time = 1/AHB clock frequency. - * | | |Note2 : When cipher encryption/decryption is enabled, please set this register value >= 0x10 - * | | |When cipher encryption/decryption is disabled, please set this register value >= 0x8. - * | | |Note3 : Please check the used SPI flash specification to know the setting value of this register, and different SPI flash vendor may use different setting values. - * |[24] |BWEN |16 bytes Burst Wrap Mode Enable Control Register (Default value = 0) - * | | |Only for WINBOND SPI flash, direct memory mapping mode, Cache enable, and read command code "0xEB, and 0xE7" - * | | |0 = Burst Wrap Mode Disable. (Default) - * | | |1 = Burst Wrap Mode Enable. - * | | |In direct memory mapping mode, both of quad read commands "0xEB" and "0xE7" support burst wrap mode for cache application and performance enhance - * | | |For cache application, the burst wrap mode can be used to fill the cache line quickly (In this SPI flash controller, we use cache data line with 16 bytes size) - * | | |For performance enhance with direct memory mapping mode and cache enable, when cache data is miss, the burst wrap mode can let MCU get the required SPI flash data quickly. - * |[25] |CREN |Continuous Read Mode Enable Control - * | | |Only for direct memory mapping mode, read command codes 0xBB, 0xEB, 0xE7, 0x0D, 0xBD, 0xED (Note2) - * | | |0 = Continuous Read Mode Disable. (Default) - * | | |1 = Continuous Read Mode Enable. - * | | |For read operations of SPI flash, commands of fast read quad I/O (0xEB), word read quad I/O (0xE7 in Winbond SPI flash), fast read dual I/O (0xBB), DTR/DDR fast read (0x0D), DTR/DDR fast read dual I/O (0xBD), and DTR/DDR fast read quad I/O (0xED) can further reduce command overhead through setting the "continuous read mode" bits (8 bits) after the input address data. - * | | |Note: When user uses function of continuous read mode and sets USETEN (SPIM_CTL2[16]) to 1, CRMDAT(SPIM_DMMCTL[15:8]) must be set by used SPI flash specifications - * | | |When user uses function of continuous read mode and sets USETEN(SPIM_CTL2[16]) to 0, CRMDAT(SPIM_DMMCTL[15:8]) is set by default value of WINBOND SPI flash. - * |[26] |UACTSCLK |User Sets SPI Flash Active SCLK Time - * | | |Only for direct memory mapping mode, DMA write mode, and DMA read mode - * | | |0 = According to DIVIDER(SPIM_CTL1[31:16]), ACTSCLKT(SPIM_DMMCTL[31:28]) is set by hardware automatically - * | | |(Default value) - * | | |1 = Set ACTSCLKT(SPIM_DMMCTL[31:28]) by user manually. - * | | |When user wants to set ACTSCLKT(SPIM_DMMCTL[31:28]) manually, please set UACTSCLK to 1. - * |[31:28] |ACTSCLKT |SPI Flash Active SCLK Time - * | | |Only for direct memory mapping mode, DMA write mode, and DMA read mode - * | | |This register sets time interval between SPIM SS active edge and the position edge of the first serial SPI output clock, and we show in Figure 7.19-8. - * | | |(1) ACTSCLKT = 0 (function disable) :. - * | | |Time interval = 1 AHB clock cycle time. - * | | |(2) ACTSCLKT != 0 (function enable) : - * | | |Time interval = (ACTSCLKT + 3) * AHB clock cycle time. - * | | |Note1 : AHB clock cycle time = 1/AHB clock frequency. - * | | |Note2 : SCLK is SPI output clock - * | | |Note3 : Please check the used SPI flash specification to know the setting value of this register, and different SPI flash vendor may use different setting values. - * @var SPIM_T::CTL2 - * Offset: 0x48 Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16] |USETEN |User Set Value Enable Control - * | | |Only for direct memory mapping mode and DMA read mode with read commands 0x03,0x0B,0x3B,0xBB,0xEB,0xE7 - * | | |0 = Hardware circuit of SPI flash controller will use the following default values of DCNUM(SPIM_CTL2[28:24]) and CRMDAT(SPIM_DMMCTL[15:8]) to configure SPI flash operations automatically. - * | | |Dummy cycle number (DCNUM) : - * | | |Dummy cycle number for read command 0x03 : 0x0 - * | | |Dummy cycle number for read command 0x0B : 0x8 - * | | |Dummy cycle number for read command 0x3B : 0x8 - * | | |Dummy cycle number for read command 0xBB : 0x0 - * | | |Dummy cycle number for read command 0xEB : 0x4 - * | | |Dummy cycle number for read command 0xE7 : 0x2 - * | | |Mode bits data for continuous read mode (CRMDAT) : 0x20 - * | | |1 = If DCNUM(SPIM_CTL2[28:24]) and CRMDAT(SPIM_DMMCTL[15:8]) are not set as above default values, user must set USETEN to 0x1, DCNUM(SPIM_CTL2[28:24]) and CRMDAT(SPIM_DMMCTL[15:8]) to configure SPI flash operations manually. - * | | |For DTR/DDR command codes 0x0D, 0xBD, and 0xED, please set USETEN to 0x1. - * |[20] |DTRMPOFF |Mode Phase OFF for DTR/DDR Command Codes 0x0D, 0xBD, and 0xED - * | | |Only for direct memory mapping mode and DMA read mode (Note1) - * | | |0 = mode cycle number (or performance enhance cycle number) does not equal to 0x0 in DTR/DDR read command codes 0x0D, 0xBD, and 0xED. - * | | |1 = mode cycle number (or performance enhance cycle number) equals to 0x0 in DTR/DDR read command codes 0x0D, 0xBD, and 0xED. - * | | |Note1 : Please check the used SPI flash specification to know the mode cycle number (or performance enhance cycle number) for DTR/DDR command codes 0x0D, 0xBD, and 0xED. - * |[28:24] |DCNUM |Dummy Cycle Number - * | | |Only for direct memory mapping mode and DMA read mode (Note1) - * | | |Set number of dummy cycles - * | | |(1) For non-DTR/non-DDR command codes 0x03, 0x0B, 0x3B, 0xBB, 0xEB, and 0xE7 : - * | | |When read command code do not need any dummy cycles (i.e. - * | | |dummy cycle number = 0x0), user must set DCNUM to 0x0. - * | | |For command code 0xBB, if both mode cycle number (or performance enhance cycle number) and dummy cycle number do not equal to 0x0 simultaneously, user must set DCNUM to "mode cycle number + dummy cycle number" by used SPI flash specification. - * | | |For command code 0xBB, if there is only dummy cycle number (i.e. - * | | |dummy cycle number != 0x0 and mode cycle number = 0x0 (or performance enhance cycle number = 0x0)), user set DCNUM to dummy cycle number by used SPI flash specification. - * | | |For command codes 0x0B, 0x3B, 0xEB, and 0xE7, user only set DCNUM to dummy cycle number by used SPI flash specification. - * | | |(2) For DTR/DDR command codes 0x0D, 0xBD, and 0xED : - * | | |user sets DCNUM to dummy cycle number and DTRMPOFF(SPIM_CTL2[20]) by used SPI flash specification. - * | | |Note1 : Number of dummy cycles depends on the frequency of SPI output clock, SPI flash vendor, and read command types - * | | |Please check the used SPI flash specification to know the setting value of this number of dummy cycles. - */ - __IO uint32_t CTL0; /*!< [0x0000] Control and Status Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] Control Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t RXCLKDLY; /*!< [0x000c] RX Clock Delay Control Register */ - __I uint32_t RX[4]; /*!< [0x0010] ~ [0x001C] Data Receive Register 0~3 */ - __IO uint32_t TX[4]; /*!< [0x0020] ~ [0x002C] Data Transmit Register 0~3 */ - __IO uint32_t SRAMADDR; /*!< [0x0030] SRAM Memory Address Register */ - __IO uint32_t DMACNT; /*!< [0x0034] DMA Transfer Byte Count Register */ - __IO uint32_t FADDR; /*!< [0x0038] SPI Flash Address Register */ - __O uint32_t KEY1; /*!< [0x003c] Cipher Key1 Register */ - __O uint32_t KEY2; /*!< [0x0040] Cipher Key2 Register */ - __IO uint32_t DMMCTL; /*!< [0x0044] Direct Memory Mapping Mode Control Register */ - __IO uint32_t CTL2; /*!< [0x0048] Control Register 2 */ - -} SPIM_T; - -/** - @addtogroup SPIM_CONST SPIM Bit Field Definition - Constant Definitions for SPIM Controller -@{ */ - -#define SPIM_CTL0_CIPHOFF_Pos (0) /*!< SPIM_T::CTL0: CIPHOFF Position */ -#define SPIM_CTL0_CIPHOFF_Msk (0x1ul << SPIM_CTL0_CIPHOFF_Pos) /*!< SPIM_T::CTL0: CIPHOFF Mask */ - -#define SPIM_CTL0_BALEN_Pos (2) /*!< SPIM_T::CTL0: BALEN Position */ -#define SPIM_CTL0_BALEN_Msk (0x1ul << SPIM_CTL0_BALEN_Pos) /*!< SPIM_T::CTL0: BALEN Mask */ - -#define SPIM_CTL0_B4ADDREN_Pos (5) /*!< SPIM_T::CTL0: B4ADDREN Position */ -#define SPIM_CTL0_B4ADDREN_Msk (0x1ul << SPIM_CTL0_B4ADDREN_Pos) /*!< SPIM_T::CTL0: B4ADDREN Mask */ - -#define SPIM_CTL0_IEN_Pos (6) /*!< SPIM_T::CTL0: IEN Position */ -#define SPIM_CTL0_IEN_Msk (0x1ul << SPIM_CTL0_IEN_Pos) /*!< SPIM_T::CTL0: IEN Mask */ - -#define SPIM_CTL0_IF_Pos (7) /*!< SPIM_T::CTL0: IF Position */ -#define SPIM_CTL0_IF_Msk (0x1ul << SPIM_CTL0_IF_Pos) /*!< SPIM_T::CTL0: IF Mask */ - -#define SPIM_CTL0_DWIDTH_Pos (8) /*!< SPIM_T::CTL0: DWIDTH Position */ -#define SPIM_CTL0_DWIDTH_Msk (0x1ful << SPIM_CTL0_DWIDTH_Pos) /*!< SPIM_T::CTL0: DWIDTH Mask */ - -#define SPIM_CTL0_BURSTNUM_Pos (13) /*!< SPIM_T::CTL0: BURSTNUM Position */ -#define SPIM_CTL0_BURSTNUM_Msk (0x3ul << SPIM_CTL0_BURSTNUM_Pos) /*!< SPIM_T::CTL0: BURSTNUM Mask */ - -#define SPIM_CTL0_QDIODIR_Pos (15) /*!< SPIM_T::CTL0: QDIODIR Position */ -#define SPIM_CTL0_QDIODIR_Msk (0x1ul << SPIM_CTL0_QDIODIR_Pos) /*!< SPIM_T::CTL0: QDIODIR Mask */ - -#define SPIM_CTL0_SUSPITV_Pos (16) /*!< SPIM_T::CTL0: SUSPITV Position */ -#define SPIM_CTL0_SUSPITV_Msk (0xful << SPIM_CTL0_SUSPITV_Pos) /*!< SPIM_T::CTL0: SUSPITV Mask */ - -#define SPIM_CTL0_BITMODE_Pos (20) /*!< SPIM_T::CTL0: BITMODE Position */ -#define SPIM_CTL0_BITMODE_Msk (0x3ul << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_T::CTL0: BITMODE Mask */ - -#define SPIM_CTL0_OPMODE_Pos (22) /*!< SPIM_T::CTL0: OPMODE Position */ -#define SPIM_CTL0_OPMODE_Msk (0x3ul << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_T::CTL0: OPMODE Mask */ - -#define SPIM_CTL0_CMDCODE_Pos (24) /*!< SPIM_T::CTL0: CMDCODE Position */ -#define SPIM_CTL0_CMDCODE_Msk (0xfful << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_T::CTL0: CMDCODE Mask */ - -#define SPIM_CTL1_SPIMEN_Pos (0) /*!< SPIM_T::CTL1: SPIMEN Position */ -#define SPIM_CTL1_SPIMEN_Msk (0x1ul << SPIM_CTL1_SPIMEN_Pos) /*!< SPIM_T::CTL1: SPIMEN Mask */ - -#define SPIM_CTL1_CACHEOFF_Pos (1) /*!< SPIM_T::CTL1: CACHEOFF Position */ -#define SPIM_CTL1_CACHEOFF_Msk (0x1ul << SPIM_CTL1_CACHEOFF_Pos) /*!< SPIM_T::CTL1: CACHEOFF Mask */ - -#define SPIM_CTL1_CCMEN_Pos (2) /*!< SPIM_T::CTL1: CCMEN Position */ -#define SPIM_CTL1_CCMEN_Msk (0x1ul << SPIM_CTL1_CCMEN_Pos) /*!< SPIM_T::CTL1: CCMEN Mask */ - -#define SPIM_CTL1_CDINVAL_Pos (3) /*!< SPIM_T::CTL1: CDINVAL Position */ -#define SPIM_CTL1_CDINVAL_Msk (0x1ul << SPIM_CTL1_CDINVAL_Pos) /*!< SPIM_T::CTL1: CDINVAL Mask */ - -#define SPIM_CTL1_SS_Pos (4) /*!< SPIM_T::CTL1: SS Position */ -#define SPIM_CTL1_SS_Msk (0x1ul << SPIM_CTL1_SS_Pos) /*!< SPIM_T::CTL1: SS Mask */ - -#define SPIM_CTL1_SSACTPOL_Pos (5) /*!< SPIM_T::CTL1: SSACTPOL Position */ -#define SPIM_CTL1_SSACTPOL_Msk (0x1ul << SPIM_CTL1_SSACTPOL_Pos) /*!< SPIM_T::CTL1: SSACTPOL Mask */ - -#define SPIM_CTL1_IDLETIME_Pos (8) /*!< SPIM_T::CTL1: IDLETIME Position */ -#define SPIM_CTL1_IDLETIME_Msk (0xful << SPIM_CTL1_IDLETIME_Pos) /*!< SPIM_T::CTL1: IDLETIME Mask */ - -#define SPIM_CTL1_DIVIDER_Pos (16) /*!< SPIM_T::CTL1: DIVIDER Position */ -#define SPIM_CTL1_DIVIDER_Msk (0xfffful << SPIM_CTL1_DIVIDER_Pos) /*!< SPIM_T::CTL1: DIVIDER Mask */ - -#define SPIM_RXCLKDLY_DWDELSEL_Pos (0) /*!< SPIM_T::RXCLKDLY: DWDELSEL Position */ -#define SPIM_RXCLKDLY_DWDELSEL_Msk (0xfful << SPIM_RXCLKDLY_DWDELSEL_Pos) /*!< SPIM_T::RXCLKDLY: DWDELSEL Mask */ - -#define SPIM_RXCLKDLY_RDDLYSEL_Pos (16) /*!< SPIM_T::RXCLKDLY: RDDLYSEL Position */ -#define SPIM_RXCLKDLY_RDDLYSEL_Msk (0x7ul << SPIM_RXCLKDLY_RDDLYSEL_Pos) /*!< SPIM_T::RXCLKDLY: RDDLYSEL Mask */ - -#define SPIM_RXCLKDLY_RDEDGE_Pos (20) /*!< SPIM_T::RXCLKDLY: RDEDGE Position */ -#define SPIM_RXCLKDLY_RDEDGE_Msk (0x1ul << SPIM_RXCLKDLY_RDEDGE_Pos) /*!< SPIM_T::RXCLKDLY: RDEDGE Mask */ - -#define SPIM_RX_RXDAT_Pos (0) /*!< SPIM_T::RX[4]: RXDAT Position */ -#define SPIM_RX_RXDAT_Msk (0xfffffffful << SPIM_RX_RXDAT_Pos) /*!< SPIM_T::RX[4]: RXDAT Mask */ - -#define SPIM_TX_TXDAT_Pos (0) /*!< SPIM_T::TX[4]: TXDAT Position */ -#define SPIM_TX_TXDAT_Msk (0xfffffffful << SPIM_TX_TXDAT_Pos) /*!< SPIM_T::TX[4]: TXDAT Mask */ - -#define SPIM_SRAMADDR_ADDR_Pos (0) /*!< SPIM_T::SRAMADDR: ADDR Position */ -#define SPIM_SRAMADDR_ADDR_Msk (0xfffffffful << SPIM_SRAMADDR_ADDR_Pos) /*!< SPIM_T::SRAMADDR: ADDR Mask */ - -#define SPIM_DMACNT_DMACNT_Pos (0) /*!< SPIM_T::DMACNT: DMACNT Position */ -#define SPIM_DMACNT_DMACNT_Msk (0xfffffful << SPIM_DMACNT_DMACNT_Pos) /*!< SPIM_T::DMACNT: DMACNT Mask */ - -#define SPIM_FADDR_ADDR_Pos (0) /*!< SPIM_T::FADDR: ADDR Position */ -#define SPIM_FADDR_ADDR_Msk (0xfffffffful << SPIM_FADDR_ADDR_Pos) /*!< SPIM_T::FADDR: ADDR Mask */ - -#define SPIM_KEY1_KEY1_Pos (0) /*!< SPIM_T::KEY1: KEY1 Position */ -#define SPIM_KEY1_KEY1_Msk (0xfffffffful << SPIM_KEY1_KEY1_Pos) /*!< SPIM_T::KEY1: KEY1 Mask */ - -#define SPIM_KEY2_KEY2_Pos (0) /*!< SPIM_T::KEY2: KEY2 Position */ -#define SPIM_KEY2_KEY2_Msk (0xfffffffful << SPIM_KEY2_KEY2_Pos) /*!< SPIM_T::KEY2: KEY2 Mask */ - -#define SPIM_DMMCTL_CRMDAT_Pos (8) /*!< SPIM_T::DMMCTL: CRMDAT Position */ -#define SPIM_DMMCTL_CRMDAT_Msk (0xfful << SPIM_DMMCTL_CRMDAT_Pos) /*!< SPIM_T::DMMCTL: CRMDAT Mask */ - -#define SPIM_DMMCTL_DESELTIM_Pos (16) /*!< SPIM_T::DMMCTL: DESELTIM Position */ -#define SPIM_DMMCTL_DESELTIM_Msk (0x1ful << SPIM_DMMCTL_DESELTIM_Pos) /*!< SPIM_T::DMMCTL: DESELTIM Mask */ - -#define SPIM_DMMCTL_BWEN_Pos (24) /*!< SPIM_T::DMMCTL: BWEN Position */ -#define SPIM_DMMCTL_BWEN_Msk (0x1ul << SPIM_DMMCTL_BWEN_Pos) /*!< SPIM_T::DMMCTL: BWEN Mask */ - -#define SPIM_DMMCTL_CREN_Pos (25) /*!< SPIM_T::DMMCTL: CREN Position */ -#define SPIM_DMMCTL_CREN_Msk (0x1ul << SPIM_DMMCTL_CREN_Pos) /*!< SPIM_T::DMMCTL: CREN Mask */ - -#define SPIM_DMMCTL_UACTSCLK_Pos (26) /*!< SPIM_T::DMMCTL: UACTSCLK Position */ -#define SPIM_DMMCTL_UACTSCLK_Msk (0x1ul << SPIM_DMMCTL_UACTSCLK_Pos) /*!< SPIM_T::DMMCTL: UACTSCLK Mask */ - -#define SPIM_DMMCTL_ACTSCLKT_Pos (28) /*!< SPIM_T::DMMCTL: ACTSCLKT Position */ -#define SPIM_DMMCTL_ACTSCLKT_Msk (0xful << SPIM_DMMCTL_ACTSCLKT_Pos) /*!< SPIM_T::DMMCTL: ACTSCLKT Mask */ - -#define SPIM_CTL2_USETEN_Pos (16) /*!< SPIM_T::CTL2: USETEN Position */ -#define SPIM_CTL2_USETEN_Msk (0x1ul << SPIM_CTL2_USETEN_Pos) /*!< SPIM_T::CTL2: USETEN Mask */ - -#define SPIM_CTL2_DTRMPOFF_Pos (20) /*!< SPIM_T::CTL2: DTRMPOFF Position */ -#define SPIM_CTL2_DTRMPOFF_Msk (0x1ul << SPIM_CTL2_DTRMPOFF_Pos) /*!< SPIM_T::CTL2: DTRMPOFF Mask */ - -#define SPIM_CTL2_DCNUM_Pos (24) /*!< SPIM_T::CTL2: DCNUM Position */ -#define SPIM_CTL2_DCNUM_Msk (0x1ful << SPIM_CTL2_DCNUM_Pos) /*!< SPIM_T::CTL2: DCNUM Mask */ - -/**@}*/ /* SPIM_CONST */ -/**@}*/ /* end of SPIM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __SPIM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sys_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sys_reg.h deleted file mode 100644 index b9bde8aa154..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/sys_reg.h +++ /dev/null @@ -1,3662 +0,0 @@ -/**************************************************************************//** - * @file sys_reg.h - * @version V1.00 - * @brief SYS register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SYS_REG_H__ -#define __SYS_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SYS System Manger Controller(SYS) - Memory Mapped Structure for SYS Controller -@{ */ - -typedef struct -{ - - - /** - * @var SYS_T::PDID - * Offset: 0x00 Part Device Identification Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PDID |Part Device Identification Number (Read Only) - * | | |This register reflects device part number code - * | | |Software can read this register to identify which device is used. - * @var SYS_T::RSTSTS - * Offset: 0x04 System Reset Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PORF |POR Reset Flag - * | | |The POR reset flag is set by the "Reset Signal" from the Power-on Reset (POR) Controller or bit CHIPRST (SYS_IPRST0[0]) to indicate the previous reset source. - * | | |0 = No reset from POR or CHIPRST. - * | | |1 = Power-on Reset (POR) or CHIPRST had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |PINRF |NRESET Pin Reset Flag - * | | |The nRESET pin reset flag is set by the "Reset Signal" from the nRESET Pin to indicate the previous reset source. - * | | |0 = No reset from nRESET pin. - * | | |1 = Pin nRESET had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |WDTRF |WDT Reset Flag - * | | |The WDT reset flag is set by the "Reset Signal" from the Watchdog Timer or Window Watchdog Timer to indicate the previous reset source. - * | | |0 = No reset from watchdog timer or window watchdog timer. - * | | |1 = The watchdog timer or window watchdog timer had issued the reset signal to reset the system. - * | | |Note1: Write 1 to clear this bit to 0. - * | | |Note2: Watchdog Timer register RSTF(WDT_CTL[2]) bit is set if the system has been reset by WDT time-out reset - * | | |Window Watchdog Timer register WWDTRF(WWDT_STATUS[1]) bit is set if the system has been reset by WWDT time-out reset. - * |[3] |LVRF |LVR Reset Flag - * | | |The LVR reset flag is set by the "Reset Signal" from the Low Voltage Reset Controller to indicate the previous reset source. - * | | |0 = No reset from LVR. - * | | |1 = LVR controller had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |BODRF |BOD Reset Flag - * | | |The BOD reset flag is set by the "Reset Signal" from the Brown-Out Detector to indicate the previous reset source. - * | | |0 = No reset from BOD. - * | | |1 = The BOD had issued the reset signal to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |SYSRF |System Reset Flag - * | | |The system reset flag is set by the "Reset Signal" from the Cortex-M4 Core to indicate the previous reset source. - * | | |0 = No reset from Cortex-M4. - * | | |1 = The Cortex-M4 had issued the reset signal to reset the system by writing 1 to the bit SYSRESETREQ(AIRCR[2], Application Interrupt and Reset Control Register, address = 0xE000ED0C) in system control registers of Cortex-M4 core. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |CPURF |CPU Reset Flag - * | | |The CPU reset flag is set by hardware if software writes CPURST (SYS_IPRST0[1]) 1 to reset Cortex-M4 Core and Flash Memory Controller (FMC). - * | | |0 = No reset from CPU. - * | | |1 = The Cortex-M4 Core and FMC are reset by software setting CPURST to 1. - * | | |Note: Write to clear this bit to 0. - * |[8] |CPULKRF |CPU Lock-up Reset Flag - * | | |0 = No reset from CPU lock-up happened. - * | | |1 = The Cortex-M4 lock-up happened and chip is reset. - * | | |Note: Write 1 to clear this bit to 0. - * | | |Note2: When CPU lock-up happened under ICE is connected, This flag will set to 1 but chip will not reset. - * @var SYS_T::IPRST0 - * Offset: 0x08 Peripheral Reset Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHIPRST |Chip One-shot Reset (Write Protect) - * | | |Setting this bit will reset the whole chip, including Processor core and all peripherals, and this bit will automatically return to 0 after the 2 clock cycles. - * | | |The CHIPRST is same as the POR reset, all the chip controllers is reset and the chip setting from flash are also reload. - * | | |About the difference between CHIPRST and SYSRESETREQ(AIRCR[2]), please refer to section 6.2.2 - * | | |0 = Chip normal operation. - * | | |1 = Chip one-shot reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |CPURST |Processor Core One-shot Reset (Write Protect) - * | | |Setting this bit will only reset the processor core and Flash Memory Controller(FMC), and this bit will automatically return to 0 after the 2 clock cycles. - * | | |0 = Processor core normal operation. - * | | |1 = Processor core one-shot reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PDMARST |PDMA Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the PDMA - * | | |User needs to set this bit to 0 to release from reset state. - * | | |0 = PDMA controller normal operation. - * | | |1 = PDMA controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |EBIRST |EBI Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the EBI - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = EBI controller normal operation. - * | | |1 = EBI controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |EMACRST |EMAC Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the EMAC controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = EMAC controller normal operation. - * | | |1 = EMAC controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |SDH0RST |SDHOST0 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the SDHOST0 controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = SDHOST0 controller normal operation. - * | | |1 = SDHOST0 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |CRCRST |CRC Calculation Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the CRC calculation controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CRC calculation controller normal operation. - * | | |1 = CRC calculation controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |CCAPRST |CCAP Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the CCAP controller. - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CCAP controller normal operation. - * | | |1 = CCAP controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10] |HSUSBDRST |HSUSBD Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the HSUSBD controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = HSUSBD controller normal operation. - * | | |1 = HSUSBD controller reset. - * |[12] |CRPTRST |CRYPTO Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the CRYPTO controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = CRYPTO controller normal operation. - * | | |1 = CRYPTO controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[14] |SPIMRST |SPIM Controller Reset - * | | |Setting this bit to 1 will generate a reset signal to the SPIM controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = SPIM controller normal operation. - * | | |1 = SPIM controller reset. - * |[16] |USBHRST |USBH Controller Reset (Write Protect) - * | | |Set this bit to 1 will generate a reset signal to the USBH controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = USBH controller normal operation. - * | | |1 = USBH controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[17] |SDH1RST |SDHOST1 Controller Reset (Write Protect) - * | | |Setting this bit to 1 will generate a reset signal to the SDHOST1 controller - * | | |User needs to set this bit to 0 to release from the reset state. - * | | |0 = SDHOST1 controller normal operation. - * | | |1 = SDHOST1 controller reset. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::IPRST1 - * Offset: 0x0C Peripheral Reset Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |GPIORST |GPIO Controller Reset - * | | |0 = GPIO controller normal operation. - * | | |1 = GPIO controller reset. - * |[2] |TMR0RST |Timer0 Controller Reset - * | | |0 = Timer0 controller normal operation. - * | | |1 = Timer0 controller reset. - * |[3] |TMR1RST |Timer1 Controller Reset - * | | |0 = Timer1 controller normal operation. - * | | |1 = Timer1 controller reset. - * |[4] |TMR2RST |Timer2 Controller Reset - * | | |0 = Timer2 controller normal operation. - * | | |1 = Timer2 controller reset. - * |[5] |TMR3RST |Timer3 Controller Reset - * | | |0 = Timer3 controller normal operation. - * | | |1 = Timer3 controller reset. - * |[7] |ACMP01RST |Analog Comparator 0/1 Controller Reset - * | | |0 = Analog Comparator 0/1 controller normal operation. - * | | |1 = Analog Comparator 0/1 controller reset. - * |[8] |I2C0RST |I2C0 Controller Reset - * | | |0 = I2C0 controller normal operation. - * | | |1 = I2C0 controller reset. - * |[9] |I2C1RST |I2C1 Controller Reset - * | | |0 = I2C1 controller normal operation. - * | | |1 = I2C1 controller reset. - * |[10] |I2C2RST |I2C2 Controller Reset - * | | |0 = I2C2 controller normal operation. - * | | |1 = I2C2 controller reset. - * |[12] |QSPI0RST |QSPI0 Controller Reset - * | | |0 = QSPI0 controller normal operation. - * | | |1 = QSPI0 controller reset. - * |[13] |SPI0RST |SPI0 Controller Reset - * | | |0 = SPI0 controller normal operation. - * | | |1 = SPI0 controller reset. - * |[14] |SPI1RST |SPI1 Controller Reset - * | | |0 = SPI1 controller normal operation. - * | | |1 = SPI1 controller reset. - * |[15] |SPI2RST |SPI2 Controller Reset - * | | |0 = SPI2 controller normal operation. - * | | |1 = SPI2 controller reset. - * |[16] |UART0RST |UART0 Controller Reset - * | | |0 = UART0 controller normal operation. - * | | |1 = UART0 controller reset. - * |[17] |UART1RST |UART1 Controller Reset - * | | |0 = UART1 controller normal operation. - * | | |1 = UART1 controller reset. - * |[18] |UART2RST |UART2 Controller Reset - * | | |0 = UART2 controller normal operation. - * | | |1 = UART2 controller reset. - * |[19] |UART3RST |UART3 Controller Reset - * | | |0 = UART3 controller normal operation. - * | | |1 = UART3 controller reset. - * |[20] |UART4RST |UART4 Controller Reset - * | | |0 = UART4 controller normal operation. - * | | |1 = UART4 controller reset. - * |[21] |UART5RST |UART5 Controller Reset - * | | |0 = UART5 controller normal operation. - * | | |1 = UART5 controller reset. - * |[24] |CAN0RST |CAN0 Controller Reset - * | | |0 = CAN0 controller normal operation. - * | | |1 = CAN0 controller reset. - * |[25] |CAN1RST |CAN1 Controller Reset - * | | |0 = CAN1 controller normal operation. - * | | |1 = CAN1 controller reset. - * |[27] |USBDRST |USBD Controller Reset - * | | |0 = USBD controller normal operation. - * | | |1 = USBD controller reset. - * |[28] |EADCRST |EADC Controller Reset - * | | |0 = EADC controller normal operation. - * | | |1 = EADC controller reset. - * |[29] |I2S0RST |I2S0 Controller Reset - * | | |0 = I2S0 controller normal operation. - * | | |1 = I2S0 controller reset. - * @var SYS_T::IPRST2 - * Offset: 0x10 Peripheral Reset Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SC0RST |SC0 Controller Reset - * | | |0 = SC0 controller normal operation. - * | | |1 = SC0 controller reset. - * |[1] |SC1RST |SC1 Controller Reset - * | | |0 = SC1 controller normal operation. - * | | |1 = SC1 controller reset. - * |[2] |SC2RST |SC2 Controller Reset - * | | |0 = SC2 controller normal operation. - * | | |1 = SC2 controller reset. - * |[6] |SPI3RST |SPI3 Controller Reset - * | | |0 = SPI3 controller normal operation. - * | | |1 = SPI3 controller reset. - * |[8] |USCI0RST |USCI0 Controller Reset - * | | |0 = USCI0 controller normal operation. - * | | |1 = USCI0 controller reset. - * |[9] |USCI1RST |USCI1 Controller Reset - * | | |0 = USCI1 controller normal operation. - * | | |1 = USCI1 controller reset. - * |[12] |DACRST |DAC Controller Reset - * | | |0 = DAC controller normal operation. - * | | |1 = DAC controller reset. - * |[16] |EPWM0RST |EPWM0 Controller Reset - * | | |0 = EPWM0 controller normal operation. - * | | |1 = EPWM0 controller reset. - * |[17] |EPWM1RST |EPWM1 Controller Reset - * | | |0 = EPWM1 controller normal operation. - * | | |1 = EPWM1 controller reset. - * |[18] |BPWM0RST |BPWM0 Controller Reset - * | | |0 = BPWM0 controller normal operation. - * | | |1 = BPWM0 controller reset. - * |[19] |BPWM1RST |BPWM1 Controller Reset - * | | |0 = BPWM1 controller normal operation. - * | | |1 = BPWM1 controller reset. - * |[22] |QEI0RST |QEI0 Controller Reset - * | | |0 = QEI0 controller normal operation. - * | | |1 = QEI0 controller reset. - * |[23] |QEI1RST |QEI1 Controller Reset - * | | |0 = QEI1 controller normal operation. - * | | |1 = QEI1 controller reset. - * |[26] |ECAP0RST |ECAP0 Controller Reset - * | | |0 = ECAP0 controller normal operation. - * | | |1 = ECAP0 controller reset. - * |[27] |ECAP1RST |ECAP1 Controller Reset - * | | |0 = ECAP1 controller normal operation. - * | | |1 = ECAP1 controller reset. - * |[28] |CAN2RST |CAN2 Controller Reset - * | | |0 = CAN2 controller normal operation. - * | | |1 = CAN2 controller reset. - * |[30] |OPARST |OP Amplifier (OPA) Controller Reset - * | | |0 = OPA controller normal operation. - * | | |1 = OPA controller reset. - * @var SYS_T::BODCTL - * Offset: 0x18 Brown-Out Detector Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODEN |Brown-out Detector Enable Bit (Write Protect) - * | | |The default value is set by flash controller user configuration register CBODEN(CONFIG0 [19]). - * | | |0 = Brown-out Detector function Disabled. - * | | |1 = Brown-out Detector function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |BODRSTEN |Brown-out Reset Enable Bit (Write Protect) - * | | |The default value is set by flash controller user configuration register CBORST(CONFIG0[20]) bit . - * | | |0 = Brown-out INTERRUPT function Enabled. - * | | |1 = Brown-out RESET function Enabled. - * | | |Note1: - * | | |While the Brown-out Detector function is enabled (BODEN high) and BOD reset function is enabled (BODRSTEN high), BOD will assert a signal to reset chip when the detected voltage is lower than the threshold (BODOUT high). - * | | |While the BOD function is enabled (BODEN high) and BOD interrupt function is enabled (BODRSTEN low), BOD will assert an interrupt if BODOUT is high - * | | |BOD interrupt will keep till to the BODEN set to 0 - * | | |BOD interrupt can be blocked by disabling the NVIC BOD interrupt or disabling BOD function (set BODEN low). - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |BODIF |Brown-out Detector Interrupt Flag - * | | |0 = Brown-out Detector does not detect any voltage draft at VDD down through or up through the voltage of BODVL setting. - * | | |1 = When Brown-out Detector detects the VDD is dropped down through the voltage of BODVL setting or the VDD is raised up through the voltage of BODVL setting, this bit is set to 1 and the brown-out interrupt is requested if brown-out interrupt is enabled. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |BODLPM |Brown-out Detector Low Power Mode (Write Protect) - * | | |0 = BOD operate in normal mode (default). - * | | |1 = BOD Low Power mode Enabled. - * | | |Note1: The BOD consumes about 100uA in normal mode, the low power mode can reduce the current to about 1/10 but slow the BOD response. - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |BODOUT |Brown-out Detector Output Status - * | | |0 = Brown-out Detector output status is 0. - * | | |It means the detected voltage is higher than BODVL setting or BODEN is 0. - * | | |1 = Brown-out Detector output status is 1. - * | | |It means the detected voltage is lower than BODVL setting - * | | |If the BODEN is 0, BOD function disabled , this bit always responds 0000. - * |[7] |LVREN |Low Voltage Reset Enable Bit (Write Protect) - * | | |The LVR function resets the chip when the input power voltage is lower than LVR circuit setting - * | | |LVR function is enabled by default. - * | | |0 = Low Voltage Reset function Disabled. - * | | |1 = Low Voltage Reset function Enabled. - * | | |Note1: After enabling the bit, the LVR function will be active with 100us delay for LVR output stable (default). - * | | |Note2: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10:8] |BODDGSEL |Brown-out Detector Output De-glitch Time Select (Write Protect) - * | | |000 = BOD output is sampled by RC10K clock. - * | | |001 = 4 system clock (HCLK). - * | | |010 = 8 system clock (HCLK). - * | | |011 = 16 system clock (HCLK). - * | | |100 = 32 system clock (HCLK). - * | | |101 = 64 system clock (HCLK). - * | | |110 = 128 system clock (HCLK). - * | | |111 = 256 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[14:12] |LVRDGSEL |LVR Output De-glitch Time Select (Write Protect) - * | | |000 = Without de-glitch function. - * | | |001 = 4 system clock (HCLK). - * | | |010 = 8 system clock (HCLK). - * | | |011 = 16 system clock (HCLK). - * | | |100 = 32 system clock (HCLK). - * | | |101 = 64 system clock (HCLK). - * | | |110 = 128 system clock (HCLK). - * | | |111 = 256 system clock (HCLK). - * | | |Note: These bits are write protected. Refer to the SYS_REGLCTL register. - * |[18:16] |BODVL |Brown-out Detector Threshold Voltage Selection (Write Protect) - * | | |The default value is set by flash controller user configuration register CBOV (CONFIG0 [23:21]). - * | | |000 = Brown-Out Detector threshold voltage is 1.6V. - * | | |001 = Brown-Out Detector threshold voltage is 1.8V. - * | | |010 = Brown-Out Detector threshold voltage is 2.0V. - * | | |011 = Brown-Out Detector threshold voltage is 2.2V. - * | | |100 = Brown-Out Detector threshold voltage is 2.4V. - * | | |101 = Brown-Out Detector threshold voltage is 2.6V. - * | | |110 = Brown-Out Detector threshold voltage is 2.8V. - * | | |111 = Brown-Out Detector threshold voltage is 3.0V. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::IVSCTL - * Offset: 0x1C Internal Voltage Source Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VTEMPEN |Temperature Sensor Enable Bit - * | | |This bit is used to enable/disable temperature sensor function. - * | | |0 = Temperature sensor function Disabled (default). - * | | |1 = Temperature sensor function Enabled. - * | | |Note: After this bit is set to 1, the value of temperature sensor output can be obtained through GPC.9. - * |[1] |VBATUGEN |VBAT Unity Gain Buffer Enable Bit - * | | |This bit is used to enable/disable VBAT unity gain buffer function. - * | | |0 = VBAT unity gain buffer function Disabled (default). - * | | |1 = VBAT unity gain buffer function Enabled. - * | | |Note: After this bit is set to 1, the value of VBAT unity gain buffer output voltage can be obtained from ADC conversion result - * @var SYS_T::PORCTL - * Offset: 0x24 Power-On-Reset Controller Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |POROFF |Power-on Reset Enable Bit (Write Protect) - * | | |When powered on, the POR circuit generates a reset signal to reset the whole chip function, but noise on the power may cause the POR active again - * | | |User can disable internal POR circuit to avoid unpredictable noise to cause chip reset by writing 0x5AA5 to this field. - * | | |The POR function will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::VREFCTL - * Offset: 0x28 VREF Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |VREFCTL |VREF Control Bits (Write Protect) - * | | |00000 = VREF is from external pin. - * | | |00011 = VREF is internal 1.6V. - * | | |00111 = VREF is internal 2.0V. - * | | |01011 = VREF is internal 2.5V. - * | | |01111 = VREF is internal 3.0V. - * | | |Others = Reserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7:6] |PRELOAD_SEL|Pre-load Timing Selection. - * | | |00 = pre-load time is 60us for 0.1uF Capacitor. - * | | |01 = pre-load time is 310us for 1uF Capacitor. - * | | |10 = pre-load time is 1270us for 4.7uF Capacitor. - * | | |11 = pre-load time is 2650us for 10uF Capacitor. - * @var SYS_T::USBPHY - * Offset: 0x2C USB PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |USBROLE |USB Role Option (Write Protect) - * | | |These two bits are used to select the role of USB. - * | | |00 = Standard USB Device mode. - * | | |01 = Standard USB Host mode. - * | | |10 = ID dependent mode. - * | | |11 = Reserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |SBO |Note: This bit must always be kept 1. If set to 0, the result is unpredictable - * |[8] |USBEN |USB PHY Enable (Write Protect) - * | | |This bit is used to enable/disable USB PHY. - * | | |0 = USB PHY Disabled. - * | | |1 = USB PHY Enabled. - * |[17:16] |HSUSBROLE |HSUSB Role Option (Write Protect) - * | | |These two bits are used to select the role of HSUSB - * | | |00 = Standard HSUSB Device mode. - * | | |01 = Standard HSUSB Host mode. - * | | |10 = ID dependent mode. - * | | |11 = Reserved. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[24] |HSUSBEN |HSUSB PHY Enable (Write Protect) - * | | |This bit is used to enable/disable HSUSB PHY. - * | | |0 = HSUSB PHY Disabled. - * | | |1 = HSUSB PHY Enabled. - * |[25] |HSUSBACT |HSUSB PHY Active Control - * | | |This bit is used to control HSUSB PHY at reset state or active state. - * | | |0 = HSUSB PHY at reset state. - * | | |1 = HSUSB PHY at active state. - * | | |Note: After set HSUSBEN (SYS_USBPHY[24]) to enable HSUSB PHY, user should keep HSUSB PHY at reset mode at lease 10uS before changing to active mode. - * @var SYS_T::GPA_MFPL - * Offset: 0x30 GPIOA Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA0MFP |PA.0 Multi-function Pin Selection - * |[7:4] |PA1MFP |PA.1 Multi-function Pin Selection - * |[11:8] |PA2MFP |PA.2 Multi-function Pin Selection - * |[15:12] |PA3MFP |PA.3 Multi-function Pin Selection - * |[19:16] |PA4MFP |PA.4 Multi-function Pin Selection - * |[23:20] |PA5MFP |PA.5 Multi-function Pin Selection - * |[27:24] |PA6MFP |PA.6 Multi-function Pin Selection - * |[31:28] |PA7MFP |PA.7 Multi-function Pin Selection - * @var SYS_T::GPA_MFPH - * Offset: 0x34 GPIOA High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA8MFP |PA.8 Multi-function Pin Selection - * |[7:4] |PA9MFP |PA.9 Multi-function Pin Selection - * |[11:8] |PA10MFP |PA.10 Multi-function Pin Selection - * |[15:12] |PA11MFP |PA.11 Multi-function Pin Selection - * |[19:16] |PA12MFP |PA.12 Multi-function Pin Selection - * |[23:20] |PA13MFP |PA.13 Multi-function Pin Selection - * |[27:24] |PA14MFP |PA.14 Multi-function Pin Selection - * |[31:28] |PA15MFP |PA.15 Multi-function Pin Selection - * @var SYS_T::GPB_MFPL - * Offset: 0x38 GPIOB Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB0MFP |PB.0 Multi-function Pin Selection - * |[7:4] |PB1MFP |PB.1 Multi-function Pin Selection - * |[11:8] |PB2MFP |PB.2 Multi-function Pin Selection - * |[15:12] |PB3MFP |PB.3 Multi-function Pin Selection - * |[19:16] |PB4MFP |PB.4 Multi-function Pin Selection - * |[23:20] |PB5MFP |PB.5 Multi-function Pin Selection - * |[27:24] |PB6MFP |PB.6 Multi-function Pin Selection - * |[31:28] |PB7MFP |PB.7 Multi-function Pin Selection - * @var SYS_T::GPB_MFPH - * Offset: 0x3C GPIOB High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB8MFP |PB.8 Multi-function Pin Selection - * |[7:4] |PB9MFP |PB.9 Multi-function Pin Selection - * |[11:8] |PB10MFP |PB.10 Multi-function Pin Selection - * |[15:12] |PB11MFP |PB.11 Multi-function Pin Selection - * |[19:16] |PB12MFP |PB.12 Multi-function Pin Selection - * |[23:20] |PB13MFP |PB.13 Multi-function Pin Selection - * |[27:24] |PB14MFP |PB.14 Multi-function Pin Selection - * |[31:28] |PB15MFP |PB.15 Multi-function Pin Selection - * @var SYS_T::GPC_MFPL - * Offset: 0x40 GPIOC Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC0MFP |PC.0 Multi-function Pin Selection - * |[7:4] |PC1MFP |PC.1 Multi-function Pin Selection - * |[11:8] |PC2MFP |PC.2 Multi-function Pin Selection - * |[15:12] |PC3MFP |PC.3 Multi-function Pin Selection - * |[19:16] |PC4MFP |PC.4 Multi-function Pin Selection - * |[23:20] |PC5MFP |PC.5 Multi-function Pin Selection - * |[27:24] |PC6MFP |PC.6 Multi-function Pin Selection - * |[31:28] |PC7MFP |PC.7 Multi-function Pin Selection - * @var SYS_T::GPC_MFPH - * Offset: 0x44 GPIOC High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC8MFP |PC.8 Multi-function Pin Selection - * |[7:4] |PC9MFP |PC.9 Multi-function Pin Selection - * |[11:8] |PC10MFP |PC.10 Multi-function Pin Selection - * |[15:12] |PC11MFP |PC.11 Multi-function Pin Selection - * |[19:16] |PC12MFP |PC.12 Multi-function Pin Selection - * |[23:20] |PC13MFP |PC.13 Multi-function Pin Selection - * |[27:24] |PC14MFP |PC.14 Multi-function Pin Selection - * |[31:28] |PC15MFP |PC.15 Multi-function Pin Selection - * @var SYS_T::GPD_MFPL - * Offset: 0x48 GPIOD Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD0MFP |PD.0 Multi-function Pin Selection - * |[7:4] |PD1MFP |PD.1 Multi-function Pin Selection - * |[11:8] |PD2MFP |PD.2 Multi-function Pin Selection - * |[15:12] |PD3MFP |PD.3 Multi-function Pin Selection - * |[19:16] |PD4MFP |PD.4 Multi-function Pin Selection - * |[23:20] |PD5MFP |PD.5 Multi-function Pin Selection - * |[27:24] |PD6MFP |PD.6 Multi-function Pin Selection - * |[31:28] |PD7MFP |PD.7 Multi-function Pin Selection - * @var SYS_T::GPD_MFPH - * Offset: 0x4C GPIOD High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD8MFP |PD.8 Multi-function Pin Selection - * |[7:4] |PD9MFP |PD.9 Multi-function Pin Selection - * |[11:8] |PD10MFP |PD.10 Multi-function Pin Selection - * |[15:12] |PD11MFP |PD.11 Multi-function Pin Selection - * |[19:16] |PD12MFP |PD.12 Multi-function Pin Selection - * |[23:20] |PD13MFP |PD.13 Multi-function Pin Selection - * |[27:24] |PD14MFP |PD.14 Multi-function Pin Selection - * |[31:28] |PD15MFP |PD.15 Multi-function Pin Selection - * @var SYS_T::GPE_MFPL - * Offset: 0x50 GPIOE Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PE0MFP |PE.0 Multi-function Pin Selection - * |[7:4] |PE1MFP |PE.1 Multi-function Pin Selection - * |[11:8] |PE2MFP |PE.2 Multi-function Pin Selection - * |[15:12] |PE3MFP |PE.3 Multi-function Pin Selection - * |[19:16] |PE4MFP |PE.4 Multi-function Pin Selection - * |[23:20] |PE5MFP |PE.5 Multi-function Pin Selection - * |[27:24] |PE6MFP |PE.6 Multi-function Pin Selection - * |[31:28] |PE7MFP |PE.7 Multi-function Pin Selection - * @var SYS_T::GPE_MFPH - * Offset: 0x54 GPIOE High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PE8MFP |PE.8 Multi-function Pin Selection - * |[7:4] |PE9MFP |PE.9 Multi-function Pin Selection - * |[11:8] |PE10MFP |PE.10 Multi-function Pin Selection - * |[15:12] |PE11MFP |PE.11 Multi-function Pin Selection - * |[19:16] |PE12MFP |PE.12 Multi-function Pin Selection - * |[23:20] |PE13MFP |PE.13 Multi-function Pin Selection - * |[27:24] |PE14MFP |PE.14 Multi-function Pin Selection - * |[31:28] |PE15MFP |PE.15 Multi-function Pin Selection - * @var SYS_T::GPF_MFPL - * Offset: 0x58 GPIOF Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF0MFP |PF.0 Multi-function Pin Selection - * |[7:4] |PF1MFP |PF.1 Multi-function Pin Selection - * |[11:8] |PF2MFP |PF.2 Multi-function Pin Selection - * |[15:12] |PF3MFP |PF.3 Multi-function Pin Selection - * |[19:16] |PF4MFP |PF.4 Multi-function Pin Selection - * |[23:20] |PF5MFP |PF.5 Multi-function Pin Selection - * |[27:24] |PF6MFP |PF.6 Multi-function Pin Selection - * |[31:28] |PF7MFP |PF.7 Multi-function Pin Selection - * @var SYS_T::GPF_MFPH - * Offset: 0x5C GPIOF High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF8MFP |PF.8 Multi-function Pin Selection - * |[7:4] |PF9MFP |PF.9 Multi-function Pin Selection - * |[11:8] |PF10MFP |PF.10 Multi-function Pin Selection - * |[15:12] |PF11MFP |PF.11 Multi-function Pin Selection - * |[19:16] |PF12MFP |PF.12 Multi-function Pin Selection - * |[23:20] |PF13MFP |PF.13 Multi-function Pin Selection - * |[27:24] |PF14MFP |PF.14 Multi-function Pin Selection - * |[31:28] |PF15MFP |PF.15 Multi-function Pin Selection - * @var SYS_T::GPG_MFPL - * Offset: 0x60 GPIOG Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PG0MFP |PG.0 Multi-function Pin Selection - * |[7:4] |PG1MFP |PG.1 Multi-function Pin Selection - * |[11:8] |PG2MFP |PG.2 Multi-function Pin Selection - * |[15:12] |PG3MFP |PG.3 Multi-function Pin Selection - * |[19:16] |PG4MFP |PG.4 Multi-function Pin Selection - * |[23:20] |PG5MFP |PG.5 Multi-function Pin Selection - * |[27:24] |PG6MFP |PG.6 Multi-function Pin Selection - * |[31:28] |PG7MFP |PG.7 Multi-function Pin Selection - * @var SYS_T::GPG_MFPH - * Offset: 0x64 GPIOG High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PG8MFP |PG.8 Multi-function Pin Selection - * |[7:4] |PG9MFP |PG.9 Multi-function Pin Selection - * |[11:8] |PG10MFP |PG.10 Multi-function Pin Selection - * |[15:12] |PG11MFP |PG.11 Multi-function Pin Selection - * |[19:16] |PG12MFP |PG.12 Multi-function Pin Selection - * |[23:20] |PG13MFP |PG.13 Multi-function Pin Selection - * |[27:24] |PG14MFP |PG.14 Multi-function Pin Selection - * |[31:28] |PG15MFP |PG.15 Multi-function Pin Selection - * @var SYS_T::GPH_MFPL - * Offset: 0x68 GPIOH Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PH0MFP |PH.0 Multi-function Pin Selection - * |[7:4] |PH1MFP |PH.1 Multi-function Pin Selection - * |[11:8] |PH2MFP |PH.2 Multi-function Pin Selection - * |[15:12] |PH3MFP |PH.3 Multi-function Pin Selection - * |[19:16] |PH4MFP |PH.4 Multi-function Pin Selection - * |[23:20] |PH5MFP |PH.5 Multi-function Pin Selection - * |[27:24] |PH6MFP |PH.6 Multi-function Pin Selection - * |[31:28] |PH7MFP |PH.7 Multi-function Pin Selection - * @var SYS_T::GPH_MFPH - * Offset: 0x6C GPIOH High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PH8MFP |PH.8 Multi-function Pin Selection - * |[7:4] |PH9MFP |PH.9 Multi-function Pin Selection - * |[11:8] |PH10MFP |PH.10 Multi-function Pin Selection - * |[15:12] |PH11MFP |PH.11 Multi-function Pin Selection - * |[19:16] |PH12MFP |PH.12 Multi-function Pin Selection - * |[23:20] |PH13MFP |PH.13 Multi-function Pin Selection - * |[27:24] |PH14MFP |PH.14 Multi-function Pin Selection - * |[31:28] |PH15MFP |PH.15 Multi-function Pin Selection - * @var SYS_T::GPA_MFOS - * Offset: 0x80 GPIOA Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::GPB_MFOS - * Offset: 0x84 GPIOB Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::GPC_MFOS - * Offset: 0x88 GPIOC Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::GPD_MFOS - * Offset: 0x8C GPIOD Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::GPE_MFOS - * Offset: 0x90 GPIOE Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::GPF_MFOS - * Offset: 0x94 GPIOF Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::GPG_MFOS - * Offset: 0x98 GPIOG Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::GPH_MFOS - * Offset: 0x9C GPIOH Multiple Function Output Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MFOS0 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[1] |MFOS1 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[2] |MFOS2 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[3] |MFOS3 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[4] |MFOS4 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[5] |MFOS5 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[6] |MFOS6 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[7] |MFOS7 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[8] |MFOS8 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[9] |MFOS9 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[10] |MFOS10 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[11] |MFOS11 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[12] |MFOS12 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[13] |MFOS13 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[14] |MFOS14 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[15] |MFOS15 |GPIOA-H Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var SYS_T::SRAM_INTCTL - * Offset: 0xC0 System SRAM Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PERRIEN |SRAM Parity Check Error Interrupt Enable Bit - * | | |0 = SRAM parity check error interrupt Disabled. - * | | |1 = SRAM parity check error interrupt Enabled. - * @var SYS_T::SRAM_STATUS - * Offset: 0xC4 System SRAM Parity Error Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PERRIF |SRAM Parity Check Error Flag - * | | |This bit indicates the System SRAM parity error occurred. Write 1 to clear this to 0. - * | | |0 = No System SRAM parity error. - * | | |1 = System SRAM parity error occur. - * @var SYS_T::SRAM_ERRADDR - * Offset: 0xC8 System SRAM Parity Check Error Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ERRADDR |System SRAM Parity Error Address - * | | |This register shows system SRAM parity error byte address. - * @var SYS_T::SRAM_BISTCTL - * Offset: 0xD0 System SRAM BIST Test Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SRBIST0 |SRAM Bank0 BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for SRAM bank0. - * | | |0 = system SRAM bank0 BIST Disabled. - * | | |1 = system SRAM bank0 BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |SRBIST1 |SRAM Bank1 BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for SRAM bank1. - * | | |0 = system SRAM bank1 BIST Disabled. - * | | |1 = system SRAM bank1 BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |CRBIST |CACHE BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for CACHE RAM - * | | |0 = system CACHE BIST Disabled. - * | | |1 = system CACHE BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |CANBIST |CAN BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for CAN RAM - * | | |0 = system CAN BIST Disabled. - * | | |1 = system CAN BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |USBBIST |USB BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for USB RAM - * | | |0 = system USB BIST Disabled. - * | | |1 = system USB BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[5] |SPIMBIST |SPIM BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for SPIM RAM - * | | |0 = system SPIM BIST Disabled. - * | | |1 = system SPIM BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |EMCBIST |EMC BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for EMC RAM - * | | |0 = system EMC BIST Disabled. - * | | |1 = system EMC BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |PDMABIST |PDMA BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for PDMA RAM - * | | |0 = system PDMA BIST Disabled. - * | | |1 = system PDMA BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |HSUSBDBIST|HSUSBD BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for HSUSBD RAM - * | | |0 = system HSUSBD BIST Disabled. - * | | |1 = system HSUSBD BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[9] |HSUSBHBIST|HSUSBH BIST Enable Bit (Write Protect) - * | | |This bit enables BIST test for HSUSBH RAM - * | | |0 = system HSUSBH BIST Disabled. - * | | |1 = system HSUSBH BIST Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[16] |SRB0S0 |SRAM Bank0 Section 0 BIST Select (Write Protect) - * | | |This bit define if the first 16KB section of SRAM bank0 is selected or not when doing bist test. - * | | |0 = SRAM bank0 section 0 is deselected when doing bist test. - * | | |1 = SRAM bank0 section 0 is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank0 should be selected when doing SRAM bank0 bist test. - * |[17] |SRB0S1 |SRAM Bank0 Section 1 BIST Select (Write Protect) - * | | |This bit define if the second 16KB section of SRAM bank0 is selected or not when doing bist test. - * | | |0 = SRAM bank0 section 1 is deselected when doing bist test. - * | | |1 = SRAM bank0 section 1 is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank0 should be selected when doing SRAM bank0 bist test. - * |[18] |SRB1S0 |SRAM Bank1 Section 0 BIST Select (Write Protect) - * | | |This bit define if the first 16KB section of SRAM bank1 is selected or not when doing bist test. - * | | |0 = SRAM bank1 first 16KB section is deselected when doing bist test. - * | | |1 = SRAM bank1 first 16KB section is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank1 should be selected when doing SRAM bank1 bist test. - * |[19] |SRB1S1 |SRAM Bank1 Section 1 BIST Select (Write Protect) - * | | |This bit define if the second 16KB section of SRAM bank1 is selected or not when doing bist test. - * | | |0 = SRAM bank1 second 16KB section is deselected when doing bist test. - * | | |1 = SRAM bank1 second 16KB section is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank1 should be selected when doing SRAM bank1 bist test. - * |[20] |SRB1S2 |SRAM Bank1 Section 0 BIST Select (Write Protect) - * | | |This bit define if the third 16KB section of SRAM bank1 is selected or not when doing bist test. - * | | |0 = SRAM bank1 third 16KB section is deselected when doing bist test. - * | | |1 = SRAM bank1 third 16KB section is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank1 should be selected when doing SRAM bank1 bist test. - * |[21] |SRB1S3 |SRAM Bank1 Section 1 BIST Select (Write Protect) - * | | |This bit define if the fourth 16KB section of SRAM bank1 is selected or not when doing bist test. - * | | |0 = SRAM bank1 fourth 16KB section is deselected when doing bist test. - * | | |1 = SRAM bank1 fourth 16KB section is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank1 should be selected when doing SRAM bank1 bist test. - * |[22] |SRB1S4 |SRAM Bank1 Section 0 BIST Select (Write Protect) - * | | |This bit define if the fifth 16KB section of SRAM bank1 is selected or not when doing bist test. - * | | |0 = SRAM bank1 fifth 16KB section is deselected when doing bist test. - * | | |1 = SRAM bank1 fifth 16KB section is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank1 should be selected when doing SRAM bank1 bist test. - * |[23] |SRB1S5 |SRAM Bank1 Section 1 BIST Select (Write Protect) - * | | |This bit define if the sixth 16KB section of SRAM bank1 is selected or not when doing bist test. - * | | |0 = SRAM bank1 sixth 16KB section is deselected when doing bist test. - * | | |1 = SRAM bank1 sixth 16KB section is selected when doing bist test. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note: At least one section of SRAM bank1 should be selected when doing SRAM bank1 bist test. - * @var SYS_T::SRAM_BISTSTS - * Offset: 0xD4 System SRAM BIST Test Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SRBISTEF0 |1st System SRAM BIST Fail Flag - * | | |0 = 1st system SRAM BIST test pass. - * | | |1 = 1st system SRAM BIST test fail. - * |[1] |SRBISTEF1 |2nd System SRAM BIST Fail Flag - * | | |0 = 2nd system SRAM BIST test pass. - * | | |1 = 2nd system SRAM BIST test fail. - * |[2] |CRBISTEF |CACHE SRAM BIST Fail Flag - * | | |0 = System CACHE RAM BIST test pass. - * | | |1 = System CACHE RAM BIST test fail. - * |[3] |CANBEF |CAN SRAM BIST Fail Flag - * | | |0 = CAN SRAM BIST test pass. - * | | |1 = CAN SRAM BIST test fail. - * |[4] |USBBEF |USB SRAM BIST Fail Flag - * | | |0 = USB SRAM BIST test pass. - * | | |1 = USB SRAM BIST test fail. - * |[16] |SRBEND0 |1st SRAM BIST Test Finish - * | | |0 = 1st system SRAM BIST active. - * | | |1 =1st system SRAM BIST finish. - * |[17] |SRBEND1 |2nd SRAM BIST Test Finish - * | | |0 = 2nd system SRAM BIST is active. - * | | |1 = 2nd system SRAM BIST finish. - * |[18] |CRBEND |CACHE SRAM BIST Test Finish - * | | |0 = System CACHE RAM BIST is active. - * | | |1 = System CACHE RAM BIST test finish. - * |[19] |CANBEND |CAN SRAM BIST Test Finish - * | | |0 = CAN SRAM BIST is active. - * | | |1 = CAN SRAM BIST test finish. - * |[20] |USBBEND |USB SRAM BIST Test Finish - * | | |0 = USB SRAM BIST is active. - * | | |1 = USB SRAM BIST test finish. - * @var SYS_T::HIRCTCTL - * Offset: 0xE4 HIRC48M Trim Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FREQSEL |Trim Frequency Selection - * | | |This field indicates the target frequency of 48 MHz internal high speed RC oscillator (HIRC) auto trim. - * | | |During auto trim operation, if clock error detected with CESTOPEN is set to 1 or trim retry limitation count reached, this field will be cleared to 00 automatically. - * | | |00 = Disable HIRC auto trim function. - * | | |01 = Enable HIRC auto trim function and trim HIRC to 48 MHz. - * | | |10 = Reserved.. - * | | |11 = Reserved. - * |[5:4] |LOOPSEL |Trim Calculation Loop Selection - * | | |This field defines that trim value calculation is based on how many reference clocks. - * | | |00 = Trim value calculation is based on average difference in 4 clocks of reference clock. - * | | |01 = Trim value calculation is based on average difference in 8 clocks of reference clock. - * | | |10 = Trim value calculation is based on average difference in 16 clocks of reference clock. - * | | |11 = Trim value calculation is based on average difference in 32 clocks of reference clock. - * | | |Note: For example, if LOOPSEL is set as 00, auto trim circuit will calculate trim value based on the average frequency difference in 4 clocks of reference clock. - * |[7:6] |RETRYCNT |Trim Value Update Limitation Count - * | | |This field defines that how many times the auto trim circuit will try to update the HIRC trim value before the frequency of HIRC locked. - * | | |Once the HIRC locked, the internal trim value update counter will be reset. - * | | |If the trim value update counter reached this limitation value and frequency of HIRC still doesn't lock, the auto trim operation will be disabled and FREQSEL will be cleared to 00. - * | | |00 = Trim retry count limitation is 64 loops. - * | | |01 = Trim retry count limitation is 128 loops. - * | | |10 = Trim retry count limitation is 256 loops. - * | | |11 = Trim retry count limitation is 512 loops. - * |[8] |CESTOPEN |Clock Error Stop Enable Bit - * | | |0 = The trim operation is keep going if clock is inaccuracy. - * | | |1 = The trim operation is stopped if clock is inaccuracy. - * |[9] |BOUNDEN |Boundary Enable Bit - * | | |0 = Boundary function is disable. - * | | |1 = Boundary function is enable. - * |[10] |REFCKSEL |Reference Clock Selection - * | | |0 = HIRC trim reference from external 32.768 kHz crystal oscillator. - * | | |1 = HIRC trim reference from internal USB synchronous mode. - * | | |Note: HIRC trim reference clock is 20Khz in test mode. - * |[20:16 |BOUNDARY |Boundary Selection - * | | |Fill the boundary range from 0x1 to 0x31, 0x0 is reserved. - * | | |Note1: This field is effective only when the BOUNDEN(SYS_HIRCTRIMCTL[9]) is enable. - * @var SYS_T::HIRCTIEN - * Offset: 0xE8 HIRC48M Trim Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TFAILIEN |Trim Failure Interrupt Enable Bit - * | | |This bit controls if an interrupt will be triggered while HIRC trim value update limitation count reached and HIRC frequency still not locked on target frequency set by FREQSEL(SYS_HIRCTCTL[1:0]). - * | | |If this bit is high and TFAILIF(SYS_HIRCTISTS[1]) is set during auto trim operation, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |0 = Disable TFAILIF(SYS_HIRCTISTS[1]) status to trigger an interrupt to CPU. - * | | |1 = Enable TFAILIF(SYS_HIRCTISTS[1]) status to trigger an interrupt to CPU. - * |[2] |CLKEIEN |Clock Error Interrupt Enable Bit - * | | |This bit controls if CPU would get an interrupt while clock is inaccuracy during auto trim operation. - * | | |If this bit is set to1, and CLKERRIF(SYS_HIRCTISTS[2]) is set during auto trim operation, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |0 = Disable CLKERRIF(SYS_HIRCTISTS[2]) status to trigger an interrupt to CPU. - * | | |1 = Enable CLKERRIF(SYS_HIRCTISTS[2]) status to trigger an interrupt to CPU. - * @var SYS_T::HIRCTISTS - * Offset: 0xEC HIRC48M Trim Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FREQLOCK |HIRC Frequency Lock Status - * | | |This bit indicates the HIRC frequency is locked. - * | | |This is a status bit and doesn't trigger any interrupt - * | | |Write 1 to clear this to 0 - * | | |This bit will be set automatically, if the frequency is lock and the RC_TRIM is enabled. - * | | |0 = The internal high-speed oscillator frequency doesn't lock at 48 MHz yet. - * | | |1 = The internal high-speed oscillator frequency locked at 48 MHz. - * |[1] |TFAILIF |Trim Failure Interrupt Status - * | | |This bit indicates that HIRC trim value update limitation count reached and the HIRC clock frequency still doesn't be locked - * | | |Once this bit is set, the auto trim operation stopped and FREQSEL(SYS_HIRCTCTL[1:0]) will be cleared to 00 by hardware automatically. - * | | |If this bit is set and TFAILIEN(SYS_HIRCTIEN[1]) is high, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached - * | | |Write 1 to clear this to 0. - * | | |0 = Trim value update limitation count does not reach. - * | | |1 = Trim value update limitation count reached and HIRC frequency still not locked. - * |[2] |CLKERRIF |Clock Error Interrupt Status - * | | |When the frequency of 32.768 kHz external low speed crystal oscillator (LXT) or 48MHz internal high speed RC oscillator (HIRC) is shift larger to unreasonable value, this bit will be set and to be an indicate that clock frequency is inaccuracy. - * | | |Once this bit is set to 1, the auto trim operation stopped and FREQSEL(SYS_HIRCTCL[1:0]) will be cleared to 00 by hardware automatically if CESTOPEN(SYS_HIRCTCTL[8]) is set to 1. - * | | |If this bit is set and CLKEIEN(SYS_HIRCTIEN[2]) is high, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |Write 1 to clear this to 0. - * | | |0 = Clock frequency is accurate. - * | | |1 = Clock frequency is inaccurate. - * |[3] |OVBDIF |Over Boundary Status - * | | |When the over boundary function is set, if there occurs the over boundary condition, this flag will be set. - * | | |Note1: Write 1 to clear this flag. - * | | |Note2: This function is only supported in M48xGC/M48xG8. - * | | |0 = Over boundary condition did not occur. - * | | |1 = Over boundary condition occurred. - * @var SYS_T::IRCTCTL - * Offset: 0xF0 HIRC Trim Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FREQSEL |Trim Frequency Selection - * | | |This field indicates the target frequency of 12 MHz internal high speed RC oscillator (HIRC) auto trim. - * | | |During auto trim operation, if clock error detected with CESTOPEN is set to 1 or trim retry limitation count reached, this field will be cleared to 00 automatically. - * | | |00 = Disable HIRC auto trim function. - * | | |01 = Enable HIRC auto trim function and trim HIRC to 12 MHz. - * | | |10 = Reserved.. - * | | |11 = Reserved. - * |[5:4] |LOOPSEL |Trim Calculation Loop Selection - * | | |This field defines that trim value calculation is based on how many reference clocks. - * | | |00 = Trim value calculation is based on average difference in 4 clocks of reference clock. - * | | |01 = Trim value calculation is based on average difference in 8 clocks of reference clock. - * | | |10 = Trim value calculation is based on average difference in 16 clocks of reference clock. - * | | |11 = Trim value calculation is based on average difference in 32 clocks of reference clock. - * | | |Note: For example, if LOOPSEL is set as 00, auto trim circuit will calculate trim value based on the average frequency difference in 4 clocks of reference clock. - * |[7:6] |RETRYCNT |Trim Value Update Limitation Count - * | | |This field defines that how many times the auto trim circuit will try to update the HIRC trim value before the frequency of HIRC locked. - * | | |Once the HIRC locked, the internal trim value update counter will be reset. - * | | |If the trim value update counter reached this limitation value and frequency of HIRC still doesn't lock, the auto trim operation will be disabled and FREQSEL will be cleared to 00. - * | | |00 = Trim retry count limitation is 64 loops. - * | | |01 = Trim retry count limitation is 128 loops. - * | | |10 = Trim retry count limitation is 256 loops. - * | | |11 = Trim retry count limitation is 512 loops. - * |[8] |CESTOPEN |Clock Error Stop Enable Bit - * | | |0 = The trim operation is keep going if clock is inaccuracy. - * | | |1 = The trim operation is stopped if clock is inaccuracy. - * |[10] |REFCKSEL |Reference Clock Selection - * | | |0 = HIRC trim reference from external 32.768 kHz crystal oscillator. - * | | |1 = HIRC trim reference from internal USB synchronous mode. - * | | |Note: HIRC trim reference clock is 20Khz in test mode. - * @var SYS_T::IRCTIEN - * Offset: 0xF4 HIRC Trim Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TFAILIEN |Trim Failure Interrupt Enable Bit - * | | |This bit controls if an interrupt will be triggered while HIRC trim value update limitation count reached and HIRC frequency still not locked on target frequency set by FREQSEL(SYS_IRCTCTL[1:0]). - * | | |If this bit is high and TFAILIF(SYS_IRCTISTS[1]) is set during auto trim operation, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached. - * | | |0 = Disable TFAILIF(SYS_IRCTISTS[1]) status to trigger an interrupt to CPU. - * | | |1 = Enable TFAILIF(SYS_IRCTISTS[1]) status to trigger an interrupt to CPU. - * |[2] |CLKEIEN |Clock Error Interrupt Enable Bit - * | | |This bit controls if CPU would get an interrupt while clock is inaccuracy during auto trim operation. - * | | |If this bit is set to1, and CLKERRIF(SYS_IRCTISTS[2]) is set during auto trim operation, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |0 = Disable CLKERRIF(SYS_IRCTISTS[2]) status to trigger an interrupt to CPU. - * | | |1 = Enable CLKERRIF(SYS_IRCTISTS[2]) status to trigger an interrupt to CPU. - * @var SYS_T::IRCTISTS - * Offset: 0xF8 HIRC Trim Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FREQLOCK |HIRC Frequency Lock Status - * | | |This bit indicates the HIRC frequency is locked. - * | | |This is a status bit and doesn't trigger any interrupt - * | | |Write 1 to clear this to 0 - * | | |This bit will be set automatically, if the frequency is lock and the RC_TRIM is enabled. - * | | |0 = The internal high-speed oscillator frequency doesn't lock at 12 MHz yet. - * | | |1 = The internal high-speed oscillator frequency locked at 12 MHz. - * |[1] |TFAILIF |Trim Failure Interrupt Status - * | | |This bit indicates that HIRC trim value update limitation count reached and the HIRC clock frequency still doesn't be locked - * | | |Once this bit is set, the auto trim operation stopped and FREQSEL(SYS_IRCTCTL[1:0]) will be cleared to 00 by hardware automatically. - * | | |If this bit is set and TFAILIEN(SYS_IRCTIEN[1]) is high, an interrupt will be triggered to notify that HIRC trim value update limitation count was reached - * | | |Write 1 to clear this to 0. - * | | |0 = Trim value update limitation count does not reach. - * | | |1 = Trim value update limitation count reached and HIRC frequency still not locked. - * |[2] |CLKERRIF |Clock Error Interrupt Status - * | | |When the frequency of 32.768 kHz external low speed crystal oscillator (LXT) or 12MHz internal high speed RC oscillator (HIRC) is shift larger to unreasonable value, this bit will be set and to be an indicate that clock frequency is inaccuracy. - * | | |Once this bit is set to 1, the auto trim operation stopped and FREQSEL(SYS_IRCTCL[1:0]) will be cleared to 00 by hardware automatically if CESTOPEN(SYS_IRCTCTL[8]) is set to 1. - * | | |If this bit is set and CLKEIEN(SYS_IRCTIEN[2]) is high, an interrupt will be triggered to notify the clock frequency is inaccuracy. - * | | |Write 1 to clear this to 0. - * | | |0 = Clock frequency is accurate. - * | | |1 = Clock frequency is inaccurate. - * @var SYS_T::REGLCTL - * Offset: 0x100 Register Lock Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REGLCTL |Register Lock Control Code - * | | |Some registers have write-protection function - * | | |Writing these registers have to disable the protected function by writing the sequence value "59h", "16h", "88h" to this field. - * | | |After this sequence is completed, the REGLCTL bit will be set to 1 and write-protection registers can be normal write. - * | | |Register Lock Control Code - * | | |0 = Write-protection Enabled for writing protected registers - * | | |Any write to the protected register is ignored. - * | | |1 = Write-protection Disabled for writing protected registers. - * @var SYS_T::PORDISAN - * Offset: 0x1EC Analog POR Disable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |POROFFAN |Power-on Reset Enable Bit (Write Protect) - * | | |After powered on, User can turn off internal analog POR circuit to save power by writing 0x5AA5 to this field. - * | | |The analog POR circuit will be active again when this field is set to another value or chip is reset by other reset source, including: - * | | |nRESET, Watchdog, LVR reset, BOD reset, ICE reset command and the software-chip reset function. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var SYS_T::PLCTL - * Offset: 0x1F8 Power Level Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PLSEL |Power Level Select(Write Protect) - * | | |00 = Power level is PL0. - * | | |01 = Power level is PL1. - * | | |Others = Reserved. - * |[21:16] |LVSSTEP |LDO Voltage Scaling Step(Write Protect) - * | | |The LVSSTEP value is LDO voltage rising step. - * | | |Core voltage scaling voltage step = (LVSSTEP + 1) * 10mV. - * |[31:24] |LVSPRD |LDO Voltage Scaling Period(Write Protect) - * | | |The LVSPRD value is the period of each LDO voltage rising step. - * | | |LDO voltage scaling period = (LVSPRD + 1) * 1us. - * @var SYS_T::PLSTS - * Offset: 0x1FC Power Level Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PLCBUSY |Power Level Change Busy Bit (Read Only) - * | | |This bit is set by hardware when core voltage is changing - * | | |After core voltage change is completed, this bit will be cleared automatically by hardware. - * | | |0 = Core voltage change is completed. - * | | |1 = Core voltage change is ongoing. - * |[9:8] |PLSTATUS |Power Level Status (Read Only) - * | | |00 = Power level is PL0. - * | | |01 = Power level is PL1. - * | | |Others = Reserved. - * @var SYS_T::AHBMCTL - * Offset: 0x400 AHB Bus Matrix Priority Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INTACTEN |Highest AHB Bus Priority of Cortex M4 Core Enable Bit (Write Protect) - * | | |Enable Cortex-M4 Core With Highest AHB Bus Priority In AHB Bus Matrix - * | | |0 = Run robin mode. - * | | |1 = Cortex-M4 CPU with highest bus priority when interrupt occurred. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - */ - __I uint32_t PDID; /*!< [0x0000] Part Device Identification Number Register */ - __IO uint32_t RSTSTS; /*!< [0x0004] System Reset Status Register */ - __IO uint32_t IPRST0; /*!< [0x0008] Peripheral Reset Control Register 0 */ - __IO uint32_t IPRST1; /*!< [0x000c] Peripheral Reset Control Register 1 */ - __IO uint32_t IPRST2; /*!< [0x0010] Peripheral Reset Control Register 2 */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[1]; - /** @endcond */ - __IO uint32_t BODCTL; /*!< [0x0018] Brown-Out Detector Control Register */ - __IO uint32_t IVSCTL; /*!< [0x001c] Internal Voltage Source Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE1[1]; - /** @endcond */ - __IO uint32_t PORCTL; /*!< [0x0024] Power-On-Reset Controller Register */ - __IO uint32_t VREFCTL; /*!< [0x0028] VREF Control Register */ - __IO uint32_t USBPHY; /*!< [0x002c] USB PHY Control Register */ - __IO uint32_t GPA_MFPL; /*!< [0x0030] GPIOA Low Byte Multiple Function Control Register */ - __IO uint32_t GPA_MFPH; /*!< [0x0034] GPIOA High Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPL; /*!< [0x0038] GPIOB Low Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPH; /*!< [0x003c] GPIOB High Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPL; /*!< [0x0040] GPIOC Low Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPH; /*!< [0x0044] GPIOC High Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPL; /*!< [0x0048] GPIOD Low Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPH; /*!< [0x004c] GPIOD High Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPL; /*!< [0x0050] GPIOE Low Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPH; /*!< [0x0054] GPIOE High Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPL; /*!< [0x0058] GPIOF Low Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPH; /*!< [0x005c] GPIOF High Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPL; /*!< [0x0060] GPIOG Low Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPH; /*!< [0x0064] GPIOG High Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPL; /*!< [0x0068] GPIOH Low Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPH; /*!< [0x006c] GPIOH High Byte Multiple Function Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE2[4]; - /** @endcond */ - __IO uint32_t GPA_MFOS; /*!< [0x0080] GPIOA Multiple Function Output Select Register */ - __IO uint32_t GPB_MFOS; /*!< [0x0084] GPIOB Multiple Function Output Select Register */ - __IO uint32_t GPC_MFOS; /*!< [0x0088] GPIOC Multiple Function Output Select Register */ - __IO uint32_t GPD_MFOS; /*!< [0x008c] GPIOD Multiple Function Output Select Register */ - __IO uint32_t GPE_MFOS; /*!< [0x0090] GPIOE Multiple Function Output Select Register */ - __IO uint32_t GPF_MFOS; /*!< [0x0094] GPIOF Multiple Function Output Select Register */ - __IO uint32_t GPG_MFOS; /*!< [0x0098] GPIOG Multiple Function Output Select Register */ - __IO uint32_t GPH_MFOS; /*!< [0x009c] GPIOH Multiple Function Output Select Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE3[8]; - /** @endcond */ - __IO uint32_t SRAM_INTCTL; /*!< [0x00c0] System SRAM Interrupt Enable Control Register */ - __IO uint32_t SRAM_STATUS; /*!< [0x00c4] System SRAM Parity Error Status Register */ - __I uint32_t SRAM_ERRADDR; /*!< [0x00c8] System SRAM Parity Check Error Address Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE4[1]; - /** @endcond */ - __IO uint32_t SRAM_BISTCTL; /*!< [0x00d0] System SRAM BIST Test Control Register */ - __I uint32_t SRAM_BISTSTS; /*!< [0x00d4] System SRAM BIST Test Status Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE5[3]; - /** @endcond */ - __IO uint32_t HIRCTCTL; /*!< [0x00e4] HIRC48M Trim Control Register */ - __IO uint32_t HIRCTIEN; /*!< [0x00e8] HIRC48M Trim Interrupt Enable Register */ - __IO uint32_t HIRCTISTS; /*!< [0x00ec] HIRC48M Trim Interrupt Status Register */ - __IO uint32_t IRCTCTL; /*!< [0x00f0] HIRC Trim Control Register */ - __IO uint32_t IRCTIEN; /*!< [0x00f4] HIRC Trim Interrupt Enable Register */ - __IO uint32_t IRCTISTS; /*!< [0x00f8] HIRC Trim Interrupt Status Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE6[1]; - /** @endcond */ - __IO uint32_t REGLCTL; /*!< [0x0100] Register Lock Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE7[58]; - /** @endcond */ - __IO uint32_t PORDISAN; /*!< [0x01ec] Analog POR Disable Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE8; - /** @endcond */ - __I uint32_t CSERVER; /*!< [0x01f4] Chip Series Version Register */ - __IO uint32_t PLCTL; /*!< [0x01f8] Power Level Control Register */ - __I uint32_t PLSTS; /*!< [0x01fc] Power Level Status Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE9[128]; - /** @endcond */ - __IO uint32_t AHBMCTL; /*!< [0x0400] AHB Bus Matrix Priority Control Register */ - -} SYS_T; - -/** - @addtogroup SYS_CONST SYS Bit Field Definition - Constant Definitions for SYS Controller -@{ */ - -#define SYS_PDID_PDID_Pos (0) /*!< SYS_T::PDID: PDID Position */ -#define SYS_PDID_PDID_Msk (0xfffffffful << SYS_PDID_PDID_Pos) /*!< SYS_T::PDID: PDID Mask */ - -#define SYS_RSTSTS_PORF_Pos (0) /*!< SYS_T::RSTSTS: PORF Position */ -#define SYS_RSTSTS_PORF_Msk (0x1ul << SYS_RSTSTS_PORF_Pos) /*!< SYS_T::RSTSTS: PORF Mask */ - -#define SYS_RSTSTS_PINRF_Pos (1) /*!< SYS_T::RSTSTS: PINRF Position */ -#define SYS_RSTSTS_PINRF_Msk (0x1ul << SYS_RSTSTS_PINRF_Pos) /*!< SYS_T::RSTSTS: PINRF Mask */ - -#define SYS_RSTSTS_WDTRF_Pos (2) /*!< SYS_T::RSTSTS: WDTRF Position */ -#define SYS_RSTSTS_WDTRF_Msk (0x1ul << SYS_RSTSTS_WDTRF_Pos) /*!< SYS_T::RSTSTS: WDTRF Mask */ - -#define SYS_RSTSTS_LVRF_Pos (3) /*!< SYS_T::RSTSTS: LVRF Position */ -#define SYS_RSTSTS_LVRF_Msk (0x1ul << SYS_RSTSTS_LVRF_Pos) /*!< SYS_T::RSTSTS: LVRF Mask */ - -#define SYS_RSTSTS_BODRF_Pos (4) /*!< SYS_T::RSTSTS: BODRF Position */ -#define SYS_RSTSTS_BODRF_Msk (0x1ul << SYS_RSTSTS_BODRF_Pos) /*!< SYS_T::RSTSTS: BODRF Mask */ - -#define SYS_RSTSTS_SYSRF_Pos (5) /*!< SYS_T::RSTSTS: SYSRF Position */ -#define SYS_RSTSTS_SYSRF_Msk (0x1ul << SYS_RSTSTS_SYSRF_Pos) /*!< SYS_T::RSTSTS: SYSRF Mask */ - -#define SYS_RSTSTS_CPURF_Pos (7) /*!< SYS_T::RSTSTS: CPURF Position */ -#define SYS_RSTSTS_CPURF_Msk (0x1ul << SYS_RSTSTS_CPURF_Pos) /*!< SYS_T::RSTSTS: CPURF Mask */ - -#define SYS_RSTSTS_CPULKRF_Pos (8) /*!< SYS_T::RSTSTS: CPULKRF Position */ -#define SYS_RSTSTS_CPULKRF_Msk (0x1ul << SYS_RSTSTS_CPULKRF_Pos) /*!< SYS_T::RSTSTS: CPULKRF Mask */ - -#define SYS_IPRST0_CHIPRST_Pos (0) /*!< SYS_T::IPRST0: CHIPRST Position */ -#define SYS_IPRST0_CHIPRST_Msk (0x1ul << SYS_IPRST0_CHIPRST_Pos) /*!< SYS_T::IPRST0: CHIPRST Mask */ - -#define SYS_IPRST0_CPURST_Pos (1) /*!< SYS_T::IPRST0: CPURST Position */ -#define SYS_IPRST0_CPURST_Msk (0x1ul << SYS_IPRST0_CPURST_Pos) /*!< SYS_T::IPRST0: CPURST Mask */ - -#define SYS_IPRST0_PDMARST_Pos (2) /*!< SYS_T::IPRST0: PDMARST Position */ -#define SYS_IPRST0_PDMARST_Msk (0x1ul << SYS_IPRST0_PDMARST_Pos) /*!< SYS_T::IPRST0: PDMARST Mask */ - -#define SYS_IPRST0_EBIRST_Pos (3) /*!< SYS_T::IPRST0: EBIRST Position */ -#define SYS_IPRST0_EBIRST_Msk (0x1ul << SYS_IPRST0_EBIRST_Pos) /*!< SYS_T::IPRST0: EBIRST Mask */ - -#define SYS_IPRST0_EMACRST_Pos (5) /*!< SYS_T::IPRST0: EMACRST Position */ -#define SYS_IPRST0_EMACRST_Msk (0x1ul << SYS_IPRST0_EMACRST_Pos) /*!< SYS_T::IPRST0: EMACRST Mask */ - -#define SYS_IPRST0_SDH0RST_Pos (6) /*!< SYS_T::IPRST0: SDH0RST Position */ -#define SYS_IPRST0_SDH0RST_Msk (0x1ul << SYS_IPRST0_SDH0RST_Pos) /*!< SYS_T::IPRST0: SDH0RST Mask */ - -#define SYS_IPRST0_CRCRST_Pos (7) /*!< SYS_T::IPRST0: CRCRST Position */ -#define SYS_IPRST0_CRCRST_Msk (0x1ul << SYS_IPRST0_CRCRST_Pos) /*!< SYS_T::IPRST0: CRCRST Mask */ - -#define SYS_IPRST0_CCAPRST_Pos (8) /*!< SYS_T::IPRST0: CCAPRST Position */ -#define SYS_IPRST0_CCAPRST_Msk (0x1ul << SYS_IPRST0_CCAPRST_Pos) /*!< SYS_T::IPRST0: CCAPRST Mask */ - -#define SYS_IPRST0_HSUSBDRST_Pos (10) /*!< SYS_T::IPRST0: HSUSBDRST Position */ -#define SYS_IPRST0_HSUSBDRST_Msk (0x1ul << SYS_IPRST0_HSUSBDRST_Pos) /*!< SYS_T::IPRST0: HSUSBDRST Mask */ - -#define SYS_IPRST0_CRPTRST_Pos (12) /*!< SYS_T::IPRST0: CRPTRST Position */ -#define SYS_IPRST0_CRPTRST_Msk (0x1ul << SYS_IPRST0_CRPTRST_Pos) /*!< SYS_T::IPRST0: CRPTRST Mask */ - -#define SYS_IPRST0_SPIMRST_Pos (14) /*!< SYS_T::IPRST0: SPIMRST Position */ -#define SYS_IPRST0_SPIMRST_Msk (0x1ul << SYS_IPRST0_SPIMRST_Pos) /*!< SYS_T::IPRST0: SPIMRST Mask */ - -#define SYS_IPRST0_USBHRST_Pos (16) /*!< SYS_T::IPRST0: USBHRST Position */ -#define SYS_IPRST0_USBHRST_Msk (0x1ul << SYS_IPRST0_USBHRST_Pos) /*!< SYS_T::IPRST0: USBHRST Mask */ - -#define SYS_IPRST0_SDH1RST_Pos (17) /*!< SYS_T::IPRST0: SDH1RST Position */ -#define SYS_IPRST0_SDH1RST_Msk (0x1ul << SYS_IPRST0_SDH1RST_Pos) /*!< SYS_T::IPRST0: SDH1RST Mask */ - -#define SYS_IPRST1_GPIORST_Pos (1) /*!< SYS_T::IPRST1: GPIORST Position */ -#define SYS_IPRST1_GPIORST_Msk (0x1ul << SYS_IPRST1_GPIORST_Pos) /*!< SYS_T::IPRST1: GPIORST Mask */ - -#define SYS_IPRST1_TMR0RST_Pos (2) /*!< SYS_T::IPRST1: TMR0RST Position */ -#define SYS_IPRST1_TMR0RST_Msk (0x1ul << SYS_IPRST1_TMR0RST_Pos) /*!< SYS_T::IPRST1: TMR0RST Mask */ - -#define SYS_IPRST1_TMR1RST_Pos (3) /*!< SYS_T::IPRST1: TMR1RST Position */ -#define SYS_IPRST1_TMR1RST_Msk (0x1ul << SYS_IPRST1_TMR1RST_Pos) /*!< SYS_T::IPRST1: TMR1RST Mask */ - -#define SYS_IPRST1_TMR2RST_Pos (4) /*!< SYS_T::IPRST1: TMR2RST Position */ -#define SYS_IPRST1_TMR2RST_Msk (0x1ul << SYS_IPRST1_TMR2RST_Pos) /*!< SYS_T::IPRST1: TMR2RST Mask */ - -#define SYS_IPRST1_TMR3RST_Pos (5) /*!< SYS_T::IPRST1: TMR3RST Position */ -#define SYS_IPRST1_TMR3RST_Msk (0x1ul << SYS_IPRST1_TMR3RST_Pos) /*!< SYS_T::IPRST1: TMR3RST Mask */ - -#define SYS_IPRST1_ACMP01RST_Pos (7) /*!< SYS_T::IPRST1: ACMP01RST Position */ -#define SYS_IPRST1_ACMP01RST_Msk (0x1ul << SYS_IPRST1_ACMP01RST_Pos) /*!< SYS_T::IPRST1: ACMP01RST Mask */ - -#define SYS_IPRST1_I2C0RST_Pos (8) /*!< SYS_T::IPRST1: I2C0RST Position */ -#define SYS_IPRST1_I2C0RST_Msk (0x1ul << SYS_IPRST1_I2C0RST_Pos) /*!< SYS_T::IPRST1: I2C0RST Mask */ - -#define SYS_IPRST1_I2C1RST_Pos (9) /*!< SYS_T::IPRST1: I2C1RST Position */ -#define SYS_IPRST1_I2C1RST_Msk (0x1ul << SYS_IPRST1_I2C1RST_Pos) /*!< SYS_T::IPRST1: I2C1RST Mask */ - -#define SYS_IPRST1_I2C2RST_Pos (10) /*!< SYS_T::IPRST1: I2C2RST Position */ -#define SYS_IPRST1_I2C2RST_Msk (0x1ul << SYS_IPRST1_I2C2RST_Pos) /*!< SYS_T::IPRST1: I2C2RST Mask */ - -#define SYS_IPRST1_QSPI0RST_Pos (12) /*!< SYS_T::IPRST1: QSPI0RST Position */ -#define SYS_IPRST1_QSPI0RST_Msk (0x1ul << SYS_IPRST1_QSPI0RST_Pos) /*!< SYS_T::IPRST1: QSPI0RST Mask */ - -#define SYS_IPRST1_SPI0RST_Pos (13) /*!< SYS_T::IPRST1: SPI0RST Position */ -#define SYS_IPRST1_SPI0RST_Msk (0x1ul << SYS_IPRST1_SPI0RST_Pos) /*!< SYS_T::IPRST1: SPI0RST Mask */ - -#define SYS_IPRST1_SPI1RST_Pos (14) /*!< SYS_T::IPRST1: SPI1RST Position */ -#define SYS_IPRST1_SPI1RST_Msk (0x1ul << SYS_IPRST1_SPI1RST_Pos) /*!< SYS_T::IPRST1: SPI1RST Mask */ - -#define SYS_IPRST1_SPI2RST_Pos (15) /*!< SYS_T::IPRST1: SPI2RST Position */ -#define SYS_IPRST1_SPI2RST_Msk (0x1ul << SYS_IPRST1_SPI2RST_Pos) /*!< SYS_T::IPRST1: SPI2RST Mask */ - -#define SYS_IPRST1_UART0RST_Pos (16) /*!< SYS_T::IPRST1: UART0RST Position */ -#define SYS_IPRST1_UART0RST_Msk (0x1ul << SYS_IPRST1_UART0RST_Pos) /*!< SYS_T::IPRST1: UART0RST Mask */ - -#define SYS_IPRST1_UART1RST_Pos (17) /*!< SYS_T::IPRST1: UART1RST Position */ -#define SYS_IPRST1_UART1RST_Msk (0x1ul << SYS_IPRST1_UART1RST_Pos) /*!< SYS_T::IPRST1: UART1RST Mask */ - -#define SYS_IPRST1_UART2RST_Pos (18) /*!< SYS_T::IPRST1: UART2RST Position */ -#define SYS_IPRST1_UART2RST_Msk (0x1ul << SYS_IPRST1_UART2RST_Pos) /*!< SYS_T::IPRST1: UART2RST Mask */ - -#define SYS_IPRST1_UART3RST_Pos (19) /*!< SYS_T::IPRST1: UART3RST Position */ -#define SYS_IPRST1_UART3RST_Msk (0x1ul << SYS_IPRST1_UART3RST_Pos) /*!< SYS_T::IPRST1: UART3RST Mask */ - -#define SYS_IPRST1_UART4RST_Pos (20) /*!< SYS_T::IPRST1: UART4RST Position */ -#define SYS_IPRST1_UART4RST_Msk (0x1ul << SYS_IPRST1_UART4RST_Pos) /*!< SYS_T::IPRST1: UART4RST Mask */ - -#define SYS_IPRST1_UART5RST_Pos (21) /*!< SYS_T::IPRST1: UART5RST Position */ -#define SYS_IPRST1_UART5RST_Msk (0x1ul << SYS_IPRST1_UART5RST_Pos) /*!< SYS_T::IPRST1: UART5RST Mask */ - -#define SYS_IPRST1_UART6RST_Pos (22) /*!< SYS_T::IPRST1: UART6RST Position */ -#define SYS_IPRST1_UART6RST_Msk (0x1ul << SYS_IPRST1_UART6RST_Pos) /*!< SYS_T::IPRST1: UART6RST Mask */ - -#define SYS_IPRST1_UART7RST_Pos (23) /*!< SYS_T::IPRST1: UART7RST Position */ -#define SYS_IPRST1_UART7RST_Msk (0x1ul << SYS_IPRST1_UART7RST_Pos) /*!< SYS_T::IPRST1: UART7RST Mask */ - -#define SYS_IPRST1_CAN0RST_Pos (24) /*!< SYS_T::IPRST1: CAN0RST Position */ -#define SYS_IPRST1_CAN0RST_Msk (0x1ul << SYS_IPRST1_CAN0RST_Pos) /*!< SYS_T::IPRST1: CAN0RST Mask */ - -#define SYS_IPRST1_CAN1RST_Pos (25) /*!< SYS_T::IPRST1: CAN1RST Position */ -#define SYS_IPRST1_CAN1RST_Msk (0x1ul << SYS_IPRST1_CAN1RST_Pos) /*!< SYS_T::IPRST1: CAN1RST Mask */ - -#define SYS_IPRST1_OTGRST_Pos (26) /*!< SYS_T::IPRST1: OTGRST Position */ -#define SYS_IPRST1_OTGRST_Msk (0x1ul << SYS_IPRST1_OTGRST_Pos) /*!< SYS_T::IPRST1: OTGRST Mask */ - -#define SYS_IPRST1_USBDRST_Pos (27) /*!< SYS_T::IPRST1: USBDRST Position */ -#define SYS_IPRST1_USBDRST_Msk (0x1ul << SYS_IPRST1_USBDRST_Pos) /*!< SYS_T::IPRST1: USBDRST Mask */ - -#define SYS_IPRST1_EADCRST_Pos (28) /*!< SYS_T::IPRST1: EADCRST Position */ -#define SYS_IPRST1_EADCRST_Msk (0x1ul << SYS_IPRST1_EADCRST_Pos) /*!< SYS_T::IPRST1: EADCRST Mask */ - -#define SYS_IPRST1_I2S0RST_Pos (29) /*!< SYS_T::IPRST1: I2S0RST Position */ -#define SYS_IPRST1_I2S0RST_Msk (0x1ul << SYS_IPRST1_I2S0RST_Pos) /*!< SYS_T::IPRST1: I2S0RST Mask */ - -#define SYS_IPRST1_HSOTGRST_Pos (30) /*!< SYS_T::IPRST1: HSOTGRST Position */ -#define SYS_IPRST1_HSOTGRST_Msk (0x1ul << SYS_IPRST1_HSOTGRST_Pos) /*!< SYS_T::IPRST1: HSOTGRST Mask */ - -#define SYS_IPRST1_TRNGRST_Pos (31) /*!< SYS_T::IPRST1: TRNGRST Position */ -#define SYS_IPRST1_TRNGRST_Msk (0x1ul << SYS_IPRST1_TRNGRST_Pos) /*!< SYS_T::IPRST1: TRNGRST Mask */ - -#define SYS_IPRST2_SC0RST_Pos (0) /*!< SYS_T::IPRST2: SC0RST Position */ -#define SYS_IPRST2_SC0RST_Msk (0x1ul << SYS_IPRST2_SC0RST_Pos) /*!< SYS_T::IPRST2: SC0RST Mask */ - -#define SYS_IPRST2_SC1RST_Pos (1) /*!< SYS_T::IPRST2: SC1RST Position */ -#define SYS_IPRST2_SC1RST_Msk (0x1ul << SYS_IPRST2_SC1RST_Pos) /*!< SYS_T::IPRST2: SC1RST Mask */ - -#define SYS_IPRST2_SC2RST_Pos (2) /*!< SYS_T::IPRST2: SC2RST Position */ -#define SYS_IPRST2_SC2RST_Msk (0x1ul << SYS_IPRST2_SC2RST_Pos) /*!< SYS_T::IPRST2: SC2RST Mask */ - -#define SYS_IPRST2_QSPI1RST_Pos (4) /*!< SYS_T::IPRST2: QSPI1RST Position */ -#define SYS_IPRST2_QSPI1RST_Msk (0x1ul << SYS_IPRST2_QSPI1RST_Pos) /*!< SYS_T::IPRST2: QSPI1RST Mask */ - -#define SYS_IPRST2_SPI3RST_Pos (6) /*!< SYS_T::IPRST2: SPI3RST Position */ -#define SYS_IPRST2_SPI3RST_Msk (0x1ul << SYS_IPRST2_SPI3RST_Pos) /*!< SYS_T::IPRST2: SPI3RST Mask */ - -#define SYS_IPRST2_USCI0RST_Pos (8) /*!< SYS_T::IPRST2: USCI0RST Position */ -#define SYS_IPRST2_USCI0RST_Msk (0x1ul << SYS_IPRST2_USCI0RST_Pos) /*!< SYS_T::IPRST2: USCI0RST Mask */ - -#define SYS_IPRST2_USCI1RST_Pos (9) /*!< SYS_T::IPRST2: USCI1RST Position */ -#define SYS_IPRST2_USCI1RST_Msk (0x1ul << SYS_IPRST2_USCI1RST_Pos) /*!< SYS_T::IPRST2: USCI1RST Mask */ - -#define SYS_IPRST2_DACRST_Pos (12) /*!< SYS_T::IPRST2: DACRST Position */ -#define SYS_IPRST2_DACRST_Msk (0x1ul << SYS_IPRST2_DACRST_Pos) /*!< SYS_T::IPRST2: DACRST Mask */ - -#define SYS_IPRST2_EPWM0RST_Pos (16) /*!< SYS_T::IPRST2: EPWM0RST Position */ -#define SYS_IPRST2_EPWM0RST_Msk (0x1ul << SYS_IPRST2_EPWM0RST_Pos) /*!< SYS_T::IPRST2: EPWM0RST Mask */ - -#define SYS_IPRST2_EPWM1RST_Pos (17) /*!< SYS_T::IPRST2: EPWM1RST Position */ -#define SYS_IPRST2_EPWM1RST_Msk (0x1ul << SYS_IPRST2_EPWM1RST_Pos) /*!< SYS_T::IPRST2: EPWM1RST Mask */ - -#define SYS_IPRST2_BPWM0RST_Pos (18) /*!< SYS_T::IPRST2: BPWM0RST Position */ -#define SYS_IPRST2_BPWM0RST_Msk (0x1ul << SYS_IPRST2_BPWM0RST_Pos) /*!< SYS_T::IPRST2: BPWM0RST Mask */ - -#define SYS_IPRST2_BPWM1RST_Pos (19) /*!< SYS_T::IPRST2: BPWM1RST Position */ -#define SYS_IPRST2_BPWM1RST_Msk (0x1ul << SYS_IPRST2_BPWM1RST_Pos) /*!< SYS_T::IPRST2: BPWM1RST Mask */ - -#define SYS_IPRST2_QEI0RST_Pos (22) /*!< SYS_T::IPRST2: QEI0RST Position */ -#define SYS_IPRST2_QEI0RST_Msk (0x1ul << SYS_IPRST2_QEI0RST_Pos) /*!< SYS_T::IPRST2: QEI0RST Mask */ - -#define SYS_IPRST2_QEI1RST_Pos (23) /*!< SYS_T::IPRST2: QEI1RST Position */ -#define SYS_IPRST2_QEI1RST_Msk (0x1ul << SYS_IPRST2_QEI1RST_Pos) /*!< SYS_T::IPRST2: QEI1RST Mask */ - -#define SYS_IPRST2_ECAP0RST_Pos (26) /*!< SYS_T::IPRST2: ECAP0RST Position */ -#define SYS_IPRST2_ECAP0RST_Msk (0x1ul << SYS_IPRST2_ECAP0RST_Pos) /*!< SYS_T::IPRST2: ECAP0RST Mask */ - -#define SYS_IPRST2_ECAP1RST_Pos (27) /*!< SYS_T::IPRST2: ECAP1RST Position */ -#define SYS_IPRST2_ECAP1RST_Msk (0x1ul << SYS_IPRST2_ECAP1RST_Pos) /*!< SYS_T::IPRST2: ECAP1RST Mask */ - -#define SYS_IPRST2_CAN2RST_Pos (28) /*!< SYS_T::IPRST2: CAN2RST Position */ -#define SYS_IPRST2_CAN2RST_Msk (0x1ul << SYS_IPRST2_CAN2RST_Pos) /*!< SYS_T::IPRST2: CAN2RST Mask */ - -#define SYS_IPRST2_OPARST_Pos (30) /*!< SYS_T::IPRST2: OPARST Position */ -#define SYS_IPRST2_OPARST_Msk (0x1ul << SYS_IPRST2_OPARST_Pos) /*!< SYS_T::IPRST2: OPARST Mask */ - -#define SYS_IPRST2_EADC1RST_Pos (31) /*!< SYS_T::IPRST2: EADC1RST Position */ -#define SYS_IPRST2_EADC1RST_Msk (0x1ul << SYS_IPRST2_EADC1RST_Pos) /*!< SYS_T::IPRST2: EADC1RST Mask */ - -#define SYS_BODCTL_BODEN_Pos (0) /*!< SYS_T::BODCTL: BODEN Position */ -#define SYS_BODCTL_BODEN_Msk (0x1ul << SYS_BODCTL_BODEN_Pos) /*!< SYS_T::BODCTL: BODEN Mask */ - -#define SYS_BODCTL_BODRSTEN_Pos (3) /*!< SYS_T::BODCTL: BODRSTEN Position */ -#define SYS_BODCTL_BODRSTEN_Msk (0x1ul << SYS_BODCTL_BODRSTEN_Pos) /*!< SYS_T::BODCTL: BODRSTEN Mask */ - -#define SYS_BODCTL_BODIF_Pos (4) /*!< SYS_T::BODCTL: BODIF Position */ -#define SYS_BODCTL_BODIF_Msk (0x1ul << SYS_BODCTL_BODIF_Pos) /*!< SYS_T::BODCTL: BODIF Mask */ - -#define SYS_BODCTL_BODLPM_Pos (5) /*!< SYS_T::BODCTL: BODLPM Position */ -#define SYS_BODCTL_BODLPM_Msk (0x1ul << SYS_BODCTL_BODLPM_Pos) /*!< SYS_T::BODCTL: BODLPM Mask */ - -#define SYS_BODCTL_BODOUT_Pos (6) /*!< SYS_T::BODCTL: BODOUT Position */ -#define SYS_BODCTL_BODOUT_Msk (0x1ul << SYS_BODCTL_BODOUT_Pos) /*!< SYS_T::BODCTL: BODOUT Mask */ - -#define SYS_BODCTL_LVREN_Pos (7) /*!< SYS_T::BODCTL: LVREN Position */ -#define SYS_BODCTL_LVREN_Msk (0x1ul << SYS_BODCTL_LVREN_Pos) /*!< SYS_T::BODCTL: LVREN Mask */ - -#define SYS_BODCTL_BODDGSEL_Pos (8) /*!< SYS_T::BODCTL: BODDGSEL Position */ -#define SYS_BODCTL_BODDGSEL_Msk (0x7ul << SYS_BODCTL_BODDGSEL_Pos) /*!< SYS_T::BODCTL: BODDGSEL Mask */ - -#define SYS_BODCTL_LVRDGSEL_Pos (12) /*!< SYS_T::BODCTL: LVRDGSEL Position */ -#define SYS_BODCTL_LVRDGSEL_Msk (0x7ul << SYS_BODCTL_LVRDGSEL_Pos) /*!< SYS_T::BODCTL: LVRDGSEL Mask */ - -#define SYS_BODCTL_BODVL_Pos (16) /*!< SYS_T::BODCTL: BODVL Position */ -#define SYS_BODCTL_BODVL_Msk (0x7ul << SYS_BODCTL_BODVL_Pos) /*!< SYS_T::BODCTL: BODVL Mask */ - -#define SYS_IVSCTL_VTEMPEN_Pos (0) /*!< SYS_T::IVSCTL: VTEMPEN Position */ -#define SYS_IVSCTL_VTEMPEN_Msk (0x1ul << SYS_IVSCTL_VTEMPEN_Pos) /*!< SYS_T::IVSCTL: VTEMPEN Mask */ - -#define SYS_IVSCTL_VBATUGEN_Pos (1) /*!< SYS_T::IVSCTL: VBATUGEN Position */ -#define SYS_IVSCTL_VBATUGEN_Msk (0x1ul << SYS_IVSCTL_VBATUGEN_Pos) /*!< SYS_T::IVSCTL: VBATUGEN Mask */ - -#define SYS_PORCTL_POROFF_Pos (0) /*!< SYS_T::PORCTL: POROFF Position */ -#define SYS_PORCTL_POROFF_Msk (0xfffful << SYS_PORCTL_POROFF_Pos) /*!< SYS_T::PORCTL: POROFF Mask */ - -#define SYS_VREFCTL_VREFCTL_Pos (0) /*!< SYS_T::VREFCTL: VREFCTL Position */ -#define SYS_VREFCTL_VREFCTL_Msk (0x1ful << SYS_VREFCTL_VREFCTL_Pos) /*!< SYS_T::VREFCTL: VREFCTL Mask */ - -#define SYS_VREFCTL_PRELOAD_SEL_Pos (6) /*!< SYS_T::VREFCTL: PRELOAD_SEL Position */ -#define SYS_VREFCTL_PRELOAD_SEL_Msk (0x3ul << SYS_VREFCTL_PRELOAD_SEL_Pos) /*!< SYS_T::VREFCTL: PRELOAD_SEL Mask */ - -#define SYS_USBPHY_USBROLE_Pos (0) /*!< SYS_T::USBPHY: USBROLE Position */ -#define SYS_USBPHY_USBROLE_Msk (0x3ul << SYS_USBPHY_USBROLE_Pos) /*!< SYS_T::USBPHY: USBROLE Mask */ - -#define SYS_USBPHY_SBO_Pos (2) /*!< SYS_T::USBPHY: SBO Position */ -#define SYS_USBPHY_SBO_Msk (0x1ul << SYS_USBPHY_SBO_Pos) /*!< SYS_T::USBPHY: SBO Mask */ - -#define SYS_USBPHY_USBEN_Pos (8) /*!< SYS_T::USBPHY: USBEN Position */ -#define SYS_USBPHY_USBEN_Msk (0x1ul << SYS_USBPHY_USBEN_Pos) /*!< SYS_T::USBPHY: USBEN Mask */ - -#define SYS_USBPHY_HSUSBROLE_Pos (16) /*!< SYS_T::USBPHY: HSUSBROLE Position */ -#define SYS_USBPHY_HSUSBROLE_Msk (0x3ul << SYS_USBPHY_HSUSBROLE_Pos) /*!< SYS_T::USBPHY: HSUSBROLE Mask */ - -#define SYS_USBPHY_HSUSBEN_Pos (24) /*!< SYS_T::USBPHY: HSUSBEN Position */ -#define SYS_USBPHY_HSUSBEN_Msk (0x1ul << SYS_USBPHY_HSUSBEN_Pos) /*!< SYS_T::USBPHY: HSUSBEN Mask */ - -#define SYS_USBPHY_HSUSBACT_Pos (25) /*!< SYS_T::USBPHY: HSUSBACT Position */ -#define SYS_USBPHY_HSUSBACT_Msk (0x1ul << SYS_USBPHY_HSUSBACT_Pos) /*!< SYS_T::USBPHY: HSUSBACT Mask */ - -#define SYS_GPA_MFPL_PA0MFP_Pos (0) /*!< SYS_T::GPA_MFPL: PA0MFP Position */ -#define SYS_GPA_MFPL_PA0MFP_Msk (0xful << SYS_GPA_MFPL_PA0MFP_Pos) /*!< SYS_T::GPA_MFPL: PA0MFP Mask */ - -#define SYS_GPA_MFPL_PA1MFP_Pos (4) /*!< SYS_T::GPA_MFPL: PA1MFP Position */ -#define SYS_GPA_MFPL_PA1MFP_Msk (0xful << SYS_GPA_MFPL_PA1MFP_Pos) /*!< SYS_T::GPA_MFPL: PA1MFP Mask */ - -#define SYS_GPA_MFPL_PA2MFP_Pos (8) /*!< SYS_T::GPA_MFPL: PA2MFP Position */ -#define SYS_GPA_MFPL_PA2MFP_Msk (0xful << SYS_GPA_MFPL_PA2MFP_Pos) /*!< SYS_T::GPA_MFPL: PA2MFP Mask */ - -#define SYS_GPA_MFPL_PA3MFP_Pos (12) /*!< SYS_T::GPA_MFPL: PA3MFP Position */ -#define SYS_GPA_MFPL_PA3MFP_Msk (0xful << SYS_GPA_MFPL_PA3MFP_Pos) /*!< SYS_T::GPA_MFPL: PA3MFP Mask */ - -#define SYS_GPA_MFPL_PA4MFP_Pos (16) /*!< SYS_T::GPA_MFPL: PA4MFP Position */ -#define SYS_GPA_MFPL_PA4MFP_Msk (0xful << SYS_GPA_MFPL_PA4MFP_Pos) /*!< SYS_T::GPA_MFPL: PA4MFP Mask */ - -#define SYS_GPA_MFPL_PA5MFP_Pos (20) /*!< SYS_T::GPA_MFPL: PA5MFP Position */ -#define SYS_GPA_MFPL_PA5MFP_Msk (0xful << SYS_GPA_MFPL_PA5MFP_Pos) /*!< SYS_T::GPA_MFPL: PA5MFP Mask */ - -#define SYS_GPA_MFPL_PA6MFP_Pos (24) /*!< SYS_T::GPA_MFPL: PA6MFP Position */ -#define SYS_GPA_MFPL_PA6MFP_Msk (0xful << SYS_GPA_MFPL_PA6MFP_Pos) /*!< SYS_T::GPA_MFPL: PA6MFP Mask */ - -#define SYS_GPA_MFPL_PA7MFP_Pos (28) /*!< SYS_T::GPA_MFPL: PA7MFP Position */ -#define SYS_GPA_MFPL_PA7MFP_Msk (0xful << SYS_GPA_MFPL_PA7MFP_Pos) /*!< SYS_T::GPA_MFPL: PA7MFP Mask */ - -#define SYS_GPA_MFPH_PA8MFP_Pos (0) /*!< SYS_T::GPA_MFPH: PA8MFP Position */ -#define SYS_GPA_MFPH_PA8MFP_Msk (0xful << SYS_GPA_MFPH_PA8MFP_Pos) /*!< SYS_T::GPA_MFPH: PA8MFP Mask */ - -#define SYS_GPA_MFPH_PA9MFP_Pos (4) /*!< SYS_T::GPA_MFPH: PA9MFP Position */ -#define SYS_GPA_MFPH_PA9MFP_Msk (0xful << SYS_GPA_MFPH_PA9MFP_Pos) /*!< SYS_T::GPA_MFPH: PA9MFP Mask */ - -#define SYS_GPA_MFPH_PA10MFP_Pos (8) /*!< SYS_T::GPA_MFPH: PA10MFP Position */ -#define SYS_GPA_MFPH_PA10MFP_Msk (0xful << SYS_GPA_MFPH_PA10MFP_Pos) /*!< SYS_T::GPA_MFPH: PA10MFP Mask */ - -#define SYS_GPA_MFPH_PA11MFP_Pos (12) /*!< SYS_T::GPA_MFPH: PA11MFP Position */ -#define SYS_GPA_MFPH_PA11MFP_Msk (0xful << SYS_GPA_MFPH_PA11MFP_Pos) /*!< SYS_T::GPA_MFPH: PA11MFP Mask */ - -#define SYS_GPA_MFPH_PA12MFP_Pos (16) /*!< SYS_T::GPA_MFPH: PA12MFP Position */ -#define SYS_GPA_MFPH_PA12MFP_Msk (0xful << SYS_GPA_MFPH_PA12MFP_Pos) /*!< SYS_T::GPA_MFPH: PA12MFP Mask */ - -#define SYS_GPA_MFPH_PA13MFP_Pos (20) /*!< SYS_T::GPA_MFPH: PA13MFP Position */ -#define SYS_GPA_MFPH_PA13MFP_Msk (0xful << SYS_GPA_MFPH_PA13MFP_Pos) /*!< SYS_T::GPA_MFPH: PA13MFP Mask */ - -#define SYS_GPA_MFPH_PA14MFP_Pos (24) /*!< SYS_T::GPA_MFPH: PA14MFP Position */ -#define SYS_GPA_MFPH_PA14MFP_Msk (0xful << SYS_GPA_MFPH_PA14MFP_Pos) /*!< SYS_T::GPA_MFPH: PA14MFP Mask */ - -#define SYS_GPA_MFPH_PA15MFP_Pos (28) /*!< SYS_T::GPA_MFPH: PA15MFP Position */ -#define SYS_GPA_MFPH_PA15MFP_Msk (0xful << SYS_GPA_MFPH_PA15MFP_Pos) /*!< SYS_T::GPA_MFPH: PA15MFP Mask */ - -#define SYS_GPB_MFPL_PB0MFP_Pos (0) /*!< SYS_T::GPB_MFPL: PB0MFP Position */ -#define SYS_GPB_MFPL_PB0MFP_Msk (0xful << SYS_GPB_MFPL_PB0MFP_Pos) /*!< SYS_T::GPB_MFPL: PB0MFP Mask */ - -#define SYS_GPB_MFPL_PB1MFP_Pos (4) /*!< SYS_T::GPB_MFPL: PB1MFP Position */ -#define SYS_GPB_MFPL_PB1MFP_Msk (0xful << SYS_GPB_MFPL_PB1MFP_Pos) /*!< SYS_T::GPB_MFPL: PB1MFP Mask */ - -#define SYS_GPB_MFPL_PB2MFP_Pos (8) /*!< SYS_T::GPB_MFPL: PB2MFP Position */ -#define SYS_GPB_MFPL_PB2MFP_Msk (0xful << SYS_GPB_MFPL_PB2MFP_Pos) /*!< SYS_T::GPB_MFPL: PB2MFP Mask */ - -#define SYS_GPB_MFPL_PB3MFP_Pos (12) /*!< SYS_T::GPB_MFPL: PB3MFP Position */ -#define SYS_GPB_MFPL_PB3MFP_Msk (0xful << SYS_GPB_MFPL_PB3MFP_Pos) /*!< SYS_T::GPB_MFPL: PB3MFP Mask */ - -#define SYS_GPB_MFPL_PB4MFP_Pos (16) /*!< SYS_T::GPB_MFPL: PB4MFP Position */ -#define SYS_GPB_MFPL_PB4MFP_Msk (0xful << SYS_GPB_MFPL_PB4MFP_Pos) /*!< SYS_T::GPB_MFPL: PB4MFP Mask */ - -#define SYS_GPB_MFPL_PB5MFP_Pos (20) /*!< SYS_T::GPB_MFPL: PB5MFP Position */ -#define SYS_GPB_MFPL_PB5MFP_Msk (0xful << SYS_GPB_MFPL_PB5MFP_Pos) /*!< SYS_T::GPB_MFPL: PB5MFP Mask */ - -#define SYS_GPB_MFPL_PB6MFP_Pos (24) /*!< SYS_T::GPB_MFPL: PB6MFP Position */ -#define SYS_GPB_MFPL_PB6MFP_Msk (0xful << SYS_GPB_MFPL_PB6MFP_Pos) /*!< SYS_T::GPB_MFPL: PB6MFP Mask */ - -#define SYS_GPB_MFPL_PB7MFP_Pos (28) /*!< SYS_T::GPB_MFPL: PB7MFP Position */ -#define SYS_GPB_MFPL_PB7MFP_Msk (0xful << SYS_GPB_MFPL_PB7MFP_Pos) /*!< SYS_T::GPB_MFPL: PB7MFP Mask */ - -#define SYS_GPB_MFPH_PB8MFP_Pos (0) /*!< SYS_T::GPB_MFPH: PB8MFP Position */ -#define SYS_GPB_MFPH_PB8MFP_Msk (0xful << SYS_GPB_MFPH_PB8MFP_Pos) /*!< SYS_T::GPB_MFPH: PB8MFP Mask */ - -#define SYS_GPB_MFPH_PB9MFP_Pos (4) /*!< SYS_T::GPB_MFPH: PB9MFP Position */ -#define SYS_GPB_MFPH_PB9MFP_Msk (0xful << SYS_GPB_MFPH_PB9MFP_Pos) /*!< SYS_T::GPB_MFPH: PB9MFP Mask */ - -#define SYS_GPB_MFPH_PB10MFP_Pos (8) /*!< SYS_T::GPB_MFPH: PB10MFP Position */ -#define SYS_GPB_MFPH_PB10MFP_Msk (0xful << SYS_GPB_MFPH_PB10MFP_Pos) /*!< SYS_T::GPB_MFPH: PB10MFP Mask */ - -#define SYS_GPB_MFPH_PB11MFP_Pos (12) /*!< SYS_T::GPB_MFPH: PB11MFP Position */ -#define SYS_GPB_MFPH_PB11MFP_Msk (0xful << SYS_GPB_MFPH_PB11MFP_Pos) /*!< SYS_T::GPB_MFPH: PB11MFP Mask */ - -#define SYS_GPB_MFPH_PB12MFP_Pos (16) /*!< SYS_T::GPB_MFPH: PB12MFP Position */ -#define SYS_GPB_MFPH_PB12MFP_Msk (0xful << SYS_GPB_MFPH_PB12MFP_Pos) /*!< SYS_T::GPB_MFPH: PB12MFP Mask */ - -#define SYS_GPB_MFPH_PB13MFP_Pos (20) /*!< SYS_T::GPB_MFPH: PB13MFP Position */ -#define SYS_GPB_MFPH_PB13MFP_Msk (0xful << SYS_GPB_MFPH_PB13MFP_Pos) /*!< SYS_T::GPB_MFPH: PB13MFP Mask */ - -#define SYS_GPB_MFPH_PB14MFP_Pos (24) /*!< SYS_T::GPB_MFPH: PB14MFP Position */ -#define SYS_GPB_MFPH_PB14MFP_Msk (0xful << SYS_GPB_MFPH_PB14MFP_Pos) /*!< SYS_T::GPB_MFPH: PB14MFP Mask */ - -#define SYS_GPB_MFPH_PB15MFP_Pos (28) /*!< SYS_T::GPB_MFPH: PB15MFP Position */ -#define SYS_GPB_MFPH_PB15MFP_Msk (0xful << SYS_GPB_MFPH_PB15MFP_Pos) /*!< SYS_T::GPB_MFPH: PB15MFP Mask */ - -#define SYS_GPC_MFPL_PC0MFP_Pos (0) /*!< SYS_T::GPC_MFPL: PC0MFP Position */ -#define SYS_GPC_MFPL_PC0MFP_Msk (0xful << SYS_GPC_MFPL_PC0MFP_Pos) /*!< SYS_T::GPC_MFPL: PC0MFP Mask */ - -#define SYS_GPC_MFPL_PC1MFP_Pos (4) /*!< SYS_T::GPC_MFPL: PC1MFP Position */ -#define SYS_GPC_MFPL_PC1MFP_Msk (0xful << SYS_GPC_MFPL_PC1MFP_Pos) /*!< SYS_T::GPC_MFPL: PC1MFP Mask */ - -#define SYS_GPC_MFPL_PC2MFP_Pos (8) /*!< SYS_T::GPC_MFPL: PC2MFP Position */ -#define SYS_GPC_MFPL_PC2MFP_Msk (0xful << SYS_GPC_MFPL_PC2MFP_Pos) /*!< SYS_T::GPC_MFPL: PC2MFP Mask */ - -#define SYS_GPC_MFPL_PC3MFP_Pos (12) /*!< SYS_T::GPC_MFPL: PC3MFP Position */ -#define SYS_GPC_MFPL_PC3MFP_Msk (0xful << SYS_GPC_MFPL_PC3MFP_Pos) /*!< SYS_T::GPC_MFPL: PC3MFP Mask */ - -#define SYS_GPC_MFPL_PC4MFP_Pos (16) /*!< SYS_T::GPC_MFPL: PC4MFP Position */ -#define SYS_GPC_MFPL_PC4MFP_Msk (0xful << SYS_GPC_MFPL_PC4MFP_Pos) /*!< SYS_T::GPC_MFPL: PC4MFP Mask */ - -#define SYS_GPC_MFPL_PC5MFP_Pos (20) /*!< SYS_T::GPC_MFPL: PC5MFP Position */ -#define SYS_GPC_MFPL_PC5MFP_Msk (0xful << SYS_GPC_MFPL_PC5MFP_Pos) /*!< SYS_T::GPC_MFPL: PC5MFP Mask */ - -#define SYS_GPC_MFPL_PC6MFP_Pos (24) /*!< SYS_T::GPC_MFPL: PC6MFP Position */ -#define SYS_GPC_MFPL_PC6MFP_Msk (0xful << SYS_GPC_MFPL_PC6MFP_Pos) /*!< SYS_T::GPC_MFPL: PC6MFP Mask */ - -#define SYS_GPC_MFPL_PC7MFP_Pos (28) /*!< SYS_T::GPC_MFPL: PC7MFP Position */ -#define SYS_GPC_MFPL_PC7MFP_Msk (0xful << SYS_GPC_MFPL_PC7MFP_Pos) /*!< SYS_T::GPC_MFPL: PC7MFP Mask */ - -#define SYS_GPC_MFPH_PC8MFP_Pos (0) /*!< SYS_T::GPC_MFPH: PC8MFP Position */ -#define SYS_GPC_MFPH_PC8MFP_Msk (0xful << SYS_GPC_MFPH_PC8MFP_Pos) /*!< SYS_T::GPC_MFPH: PC8MFP Mask */ - -#define SYS_GPC_MFPH_PC9MFP_Pos (4) /*!< SYS_T::GPC_MFPH: PC9MFP Position */ -#define SYS_GPC_MFPH_PC9MFP_Msk (0xful << SYS_GPC_MFPH_PC9MFP_Pos) /*!< SYS_T::GPC_MFPH: PC9MFP Mask */ - -#define SYS_GPC_MFPH_PC10MFP_Pos (8) /*!< SYS_T::GPC_MFPH: PC10MFP Position */ -#define SYS_GPC_MFPH_PC10MFP_Msk (0xful << SYS_GPC_MFPH_PC10MFP_Pos) /*!< SYS_T::GPC_MFPH: PC10MFP Mask */ - -#define SYS_GPC_MFPH_PC11MFP_Pos (12) /*!< SYS_T::GPC_MFPH: PC11MFP Position */ -#define SYS_GPC_MFPH_PC11MFP_Msk (0xful << SYS_GPC_MFPH_PC11MFP_Pos) /*!< SYS_T::GPC_MFPH: PC11MFP Mask */ - -#define SYS_GPC_MFPH_PC12MFP_Pos (16) /*!< SYS_T::GPC_MFPH: PC12MFP Position */ -#define SYS_GPC_MFPH_PC12MFP_Msk (0xful << SYS_GPC_MFPH_PC12MFP_Pos) /*!< SYS_T::GPC_MFPH: PC12MFP Mask */ - -#define SYS_GPC_MFPH_PC13MFP_Pos (20) /*!< SYS_T::GPC_MFPH: PC13MFP Position */ -#define SYS_GPC_MFPH_PC13MFP_Msk (0xful << SYS_GPC_MFPH_PC13MFP_Pos) /*!< SYS_T::GPC_MFPH: PC13MFP Mask */ - -#define SYS_GPC_MFPH_PC14MFP_Pos (24) /*!< SYS_T::GPC_MFPH: PC14MFP Position */ -#define SYS_GPC_MFPH_PC14MFP_Msk (0xful << SYS_GPC_MFPH_PC14MFP_Pos) /*!< SYS_T::GPC_MFPH: PC14MFP Mask */ - -#define SYS_GPC_MFPH_PC15MFP_Pos (28) /*!< SYS_T::GPC_MFPH: PC15MFP Position */ -#define SYS_GPC_MFPH_PC15MFP_Msk (0xful << SYS_GPC_MFPH_PC15MFP_Pos) /*!< SYS_T::GPC_MFPH: PC15MFP Mask */ - -#define SYS_GPD_MFPL_PD0MFP_Pos (0) /*!< SYS_T::GPD_MFPL: PD0MFP Position */ -#define SYS_GPD_MFPL_PD0MFP_Msk (0xful << SYS_GPD_MFPL_PD0MFP_Pos) /*!< SYS_T::GPD_MFPL: PD0MFP Mask */ - -#define SYS_GPD_MFPL_PD1MFP_Pos (4) /*!< SYS_T::GPD_MFPL: PD1MFP Position */ -#define SYS_GPD_MFPL_PD1MFP_Msk (0xful << SYS_GPD_MFPL_PD1MFP_Pos) /*!< SYS_T::GPD_MFPL: PD1MFP Mask */ - -#define SYS_GPD_MFPL_PD2MFP_Pos (8) /*!< SYS_T::GPD_MFPL: PD2MFP Position */ -#define SYS_GPD_MFPL_PD2MFP_Msk (0xful << SYS_GPD_MFPL_PD2MFP_Pos) /*!< SYS_T::GPD_MFPL: PD2MFP Mask */ - -#define SYS_GPD_MFPL_PD3MFP_Pos (12) /*!< SYS_T::GPD_MFPL: PD3MFP Position */ -#define SYS_GPD_MFPL_PD3MFP_Msk (0xful << SYS_GPD_MFPL_PD3MFP_Pos) /*!< SYS_T::GPD_MFPL: PD3MFP Mask */ - -#define SYS_GPD_MFPL_PD4MFP_Pos (16) /*!< SYS_T::GPD_MFPL: PD4MFP Position */ -#define SYS_GPD_MFPL_PD4MFP_Msk (0xful << SYS_GPD_MFPL_PD4MFP_Pos) /*!< SYS_T::GPD_MFPL: PD4MFP Mask */ - -#define SYS_GPD_MFPL_PD5MFP_Pos (20) /*!< SYS_T::GPD_MFPL: PD5MFP Position */ -#define SYS_GPD_MFPL_PD5MFP_Msk (0xful << SYS_GPD_MFPL_PD5MFP_Pos) /*!< SYS_T::GPD_MFPL: PD5MFP Mask */ - -#define SYS_GPD_MFPL_PD6MFP_Pos (24) /*!< SYS_T::GPD_MFPL: PD6MFP Position */ -#define SYS_GPD_MFPL_PD6MFP_Msk (0xful << SYS_GPD_MFPL_PD6MFP_Pos) /*!< SYS_T::GPD_MFPL: PD6MFP Mask */ - -#define SYS_GPD_MFPL_PD7MFP_Pos (28) /*!< SYS_T::GPD_MFPL: PD7MFP Position */ -#define SYS_GPD_MFPL_PD7MFP_Msk (0xful << SYS_GPD_MFPL_PD7MFP_Pos) /*!< SYS_T::GPD_MFPL: PD7MFP Mask */ - -#define SYS_GPD_MFPH_PD8MFP_Pos (0) /*!< SYS_T::GPD_MFPH: PD8MFP Position */ -#define SYS_GPD_MFPH_PD8MFP_Msk (0xful << SYS_GPD_MFPH_PD8MFP_Pos) /*!< SYS_T::GPD_MFPH: PD8MFP Mask */ - -#define SYS_GPD_MFPH_PD9MFP_Pos (4) /*!< SYS_T::GPD_MFPH: PD9MFP Position */ -#define SYS_GPD_MFPH_PD9MFP_Msk (0xful << SYS_GPD_MFPH_PD9MFP_Pos) /*!< SYS_T::GPD_MFPH: PD9MFP Mask */ - -#define SYS_GPD_MFPH_PD10MFP_Pos (8) /*!< SYS_T::GPD_MFPH: PD10MFP Position */ -#define SYS_GPD_MFPH_PD10MFP_Msk (0xful << SYS_GPD_MFPH_PD10MFP_Pos) /*!< SYS_T::GPD_MFPH: PD10MFP Mask */ - -#define SYS_GPD_MFPH_PD11MFP_Pos (12) /*!< SYS_T::GPD_MFPH: PD11MFP Position */ -#define SYS_GPD_MFPH_PD11MFP_Msk (0xful << SYS_GPD_MFPH_PD11MFP_Pos) /*!< SYS_T::GPD_MFPH: PD11MFP Mask */ - -#define SYS_GPD_MFPH_PD12MFP_Pos (16) /*!< SYS_T::GPD_MFPH: PD12MFP Position */ -#define SYS_GPD_MFPH_PD12MFP_Msk (0xful << SYS_GPD_MFPH_PD12MFP_Pos) /*!< SYS_T::GPD_MFPH: PD12MFP Mask */ - -#define SYS_GPD_MFPH_PD13MFP_Pos (20) /*!< SYS_T::GPD_MFPH: PD13MFP Position */ -#define SYS_GPD_MFPH_PD13MFP_Msk (0xful << SYS_GPD_MFPH_PD13MFP_Pos) /*!< SYS_T::GPD_MFPH: PD13MFP Mask */ - -#define SYS_GPD_MFPH_PD14MFP_Pos (24) /*!< SYS_T::GPD_MFPH: PD14MFP Position */ -#define SYS_GPD_MFPH_PD14MFP_Msk (0xful << SYS_GPD_MFPH_PD14MFP_Pos) /*!< SYS_T::GPD_MFPH: PD14MFP Mask */ - -#define SYS_GPD_MFPH_PD15MFP_Pos (28) /*!< SYS_T::GPD_MFPH: PD15MFP Position */ -#define SYS_GPD_MFPH_PD15MFP_Msk (0xful << SYS_GPD_MFPH_PD15MFP_Pos) /*!< SYS_T::GPD_MFPH: PD15MFP Mask */ - -#define SYS_GPE_MFPL_PE0MFP_Pos (0) /*!< SYS_T::GPE_MFPL: PE0MFP Position */ -#define SYS_GPE_MFPL_PE0MFP_Msk (0xful << SYS_GPE_MFPL_PE0MFP_Pos) /*!< SYS_T::GPE_MFPL: PE0MFP Mask */ - -#define SYS_GPE_MFPL_PE1MFP_Pos (4) /*!< SYS_T::GPE_MFPL: PE1MFP Position */ -#define SYS_GPE_MFPL_PE1MFP_Msk (0xful << SYS_GPE_MFPL_PE1MFP_Pos) /*!< SYS_T::GPE_MFPL: PE1MFP Mask */ - -#define SYS_GPE_MFPL_PE2MFP_Pos (8) /*!< SYS_T::GPE_MFPL: PE2MFP Position */ -#define SYS_GPE_MFPL_PE2MFP_Msk (0xful << SYS_GPE_MFPL_PE2MFP_Pos) /*!< SYS_T::GPE_MFPL: PE2MFP Mask */ - -#define SYS_GPE_MFPL_PE3MFP_Pos (12) /*!< SYS_T::GPE_MFPL: PE3MFP Position */ -#define SYS_GPE_MFPL_PE3MFP_Msk (0xful << SYS_GPE_MFPL_PE3MFP_Pos) /*!< SYS_T::GPE_MFPL: PE3MFP Mask */ - -#define SYS_GPE_MFPL_PE4MFP_Pos (16) /*!< SYS_T::GPE_MFPL: PE4MFP Position */ -#define SYS_GPE_MFPL_PE4MFP_Msk (0xful << SYS_GPE_MFPL_PE4MFP_Pos) /*!< SYS_T::GPE_MFPL: PE4MFP Mask */ - -#define SYS_GPE_MFPL_PE5MFP_Pos (20) /*!< SYS_T::GPE_MFPL: PE5MFP Position */ -#define SYS_GPE_MFPL_PE5MFP_Msk (0xful << SYS_GPE_MFPL_PE5MFP_Pos) /*!< SYS_T::GPE_MFPL: PE5MFP Mask */ - -#define SYS_GPE_MFPL_PE6MFP_Pos (24) /*!< SYS_T::GPE_MFPL: PE6MFP Position */ -#define SYS_GPE_MFPL_PE6MFP_Msk (0xful << SYS_GPE_MFPL_PE6MFP_Pos) /*!< SYS_T::GPE_MFPL: PE6MFP Mask */ - -#define SYS_GPE_MFPL_PE7MFP_Pos (28) /*!< SYS_T::GPE_MFPL: PE7MFP Position */ -#define SYS_GPE_MFPL_PE7MFP_Msk (0xful << SYS_GPE_MFPL_PE7MFP_Pos) /*!< SYS_T::GPE_MFPL: PE7MFP Mask */ - -#define SYS_GPE_MFPH_PE8MFP_Pos (0) /*!< SYS_T::GPE_MFPH: PE8MFP Position */ -#define SYS_GPE_MFPH_PE8MFP_Msk (0xful << SYS_GPE_MFPH_PE8MFP_Pos) /*!< SYS_T::GPE_MFPH: PE8MFP Mask */ - -#define SYS_GPE_MFPH_PE9MFP_Pos (4) /*!< SYS_T::GPE_MFPH: PE9MFP Position */ -#define SYS_GPE_MFPH_PE9MFP_Msk (0xful << SYS_GPE_MFPH_PE9MFP_Pos) /*!< SYS_T::GPE_MFPH: PE9MFP Mask */ - -#define SYS_GPE_MFPH_PE10MFP_Pos (8) /*!< SYS_T::GPE_MFPH: PE10MFP Position */ -#define SYS_GPE_MFPH_PE10MFP_Msk (0xful << SYS_GPE_MFPH_PE10MFP_Pos) /*!< SYS_T::GPE_MFPH: PE10MFP Mask */ - -#define SYS_GPE_MFPH_PE11MFP_Pos (12) /*!< SYS_T::GPE_MFPH: PE11MFP Position */ -#define SYS_GPE_MFPH_PE11MFP_Msk (0xful << SYS_GPE_MFPH_PE11MFP_Pos) /*!< SYS_T::GPE_MFPH: PE11MFP Mask */ - -#define SYS_GPE_MFPH_PE12MFP_Pos (16) /*!< SYS_T::GPE_MFPH: PE12MFP Position */ -#define SYS_GPE_MFPH_PE12MFP_Msk (0xful << SYS_GPE_MFPH_PE12MFP_Pos) /*!< SYS_T::GPE_MFPH: PE12MFP Mask */ - -#define SYS_GPE_MFPH_PE13MFP_Pos (20) /*!< SYS_T::GPE_MFPH: PE13MFP Position */ -#define SYS_GPE_MFPH_PE13MFP_Msk (0xful << SYS_GPE_MFPH_PE13MFP_Pos) /*!< SYS_T::GPE_MFPH: PE13MFP Mask */ - -#define SYS_GPE_MFPH_PE14MFP_Pos (24) /*!< SYS_T::GPE_MFPH: PE14MFP Position */ -#define SYS_GPE_MFPH_PE14MFP_Msk (0xful << SYS_GPE_MFPH_PE14MFP_Pos) /*!< SYS_T::GPE_MFPH: PE14MFP Mask */ - -#define SYS_GPE_MFPH_PE15MFP_Pos (28) /*!< SYS_T::GPE_MFPH: PE15MFP Position */ -#define SYS_GPE_MFPH_PE15MFP_Msk (0xful << SYS_GPE_MFPH_PE15MFP_Pos) /*!< SYS_T::GPE_MFPH: PE15MFP Mask */ - -#define SYS_GPF_MFPL_PF0MFP_Pos (0) /*!< SYS_T::GPF_MFPL: PF0MFP Position */ -#define SYS_GPF_MFPL_PF0MFP_Msk (0xful << SYS_GPF_MFPL_PF0MFP_Pos) /*!< SYS_T::GPF_MFPL: PF0MFP Mask */ - -#define SYS_GPF_MFPL_PF1MFP_Pos (4) /*!< SYS_T::GPF_MFPL: PF1MFP Position */ -#define SYS_GPF_MFPL_PF1MFP_Msk (0xful << SYS_GPF_MFPL_PF1MFP_Pos) /*!< SYS_T::GPF_MFPL: PF1MFP Mask */ - -#define SYS_GPF_MFPL_PF2MFP_Pos (8) /*!< SYS_T::GPF_MFPL: PF2MFP Position */ -#define SYS_GPF_MFPL_PF2MFP_Msk (0xful << SYS_GPF_MFPL_PF2MFP_Pos) /*!< SYS_T::GPF_MFPL: PF2MFP Mask */ - -#define SYS_GPF_MFPL_PF3MFP_Pos (12) /*!< SYS_T::GPF_MFPL: PF3MFP Position */ -#define SYS_GPF_MFPL_PF3MFP_Msk (0xful << SYS_GPF_MFPL_PF3MFP_Pos) /*!< SYS_T::GPF_MFPL: PF3MFP Mask */ - -#define SYS_GPF_MFPL_PF4MFP_Pos (16) /*!< SYS_T::GPF_MFPL: PF4MFP Position */ -#define SYS_GPF_MFPL_PF4MFP_Msk (0xful << SYS_GPF_MFPL_PF4MFP_Pos) /*!< SYS_T::GPF_MFPL: PF4MFP Mask */ - -#define SYS_GPF_MFPL_PF5MFP_Pos (20) /*!< SYS_T::GPF_MFPL: PF5MFP Position */ -#define SYS_GPF_MFPL_PF5MFP_Msk (0xful << SYS_GPF_MFPL_PF5MFP_Pos) /*!< SYS_T::GPF_MFPL: PF5MFP Mask */ - -#define SYS_GPF_MFPL_PF6MFP_Pos (24) /*!< SYS_T::GPF_MFPL: PF6MFP Position */ -#define SYS_GPF_MFPL_PF6MFP_Msk (0xful << SYS_GPF_MFPL_PF6MFP_Pos) /*!< SYS_T::GPF_MFPL: PF6MFP Mask */ - -#define SYS_GPF_MFPL_PF7MFP_Pos (28) /*!< SYS_T::GPF_MFPL: PF7MFP Position */ -#define SYS_GPF_MFPL_PF7MFP_Msk (0xful << SYS_GPF_MFPL_PF7MFP_Pos) /*!< SYS_T::GPF_MFPL: PF7MFP Mask */ - -#define SYS_GPF_MFPH_PF8MFP_Pos (0) /*!< SYS_T::GPF_MFPH: PF8MFP Position */ -#define SYS_GPF_MFPH_PF8MFP_Msk (0xful << SYS_GPF_MFPH_PF8MFP_Pos) /*!< SYS_T::GPF_MFPH: PF8MFP Mask */ - -#define SYS_GPF_MFPH_PF9MFP_Pos (4) /*!< SYS_T::GPF_MFPH: PF9MFP Position */ -#define SYS_GPF_MFPH_PF9MFP_Msk (0xful << SYS_GPF_MFPH_PF9MFP_Pos) /*!< SYS_T::GPF_MFPH: PF9MFP Mask */ - -#define SYS_GPF_MFPH_PF10MFP_Pos (8) /*!< SYS_T::GPF_MFPH: PF10MFP Position */ -#define SYS_GPF_MFPH_PF10MFP_Msk (0xful << SYS_GPF_MFPH_PF10MFP_Pos) /*!< SYS_T::GPF_MFPH: PF10MFP Mask */ - -#define SYS_GPF_MFPH_PF11MFP_Pos (12) /*!< SYS_T::GPF_MFPH: PF11MFP Position */ -#define SYS_GPF_MFPH_PF11MFP_Msk (0xful << SYS_GPF_MFPH_PF11MFP_Pos) /*!< SYS_T::GPF_MFPH: PF11MFP Mask */ - -#define SYS_GPF_MFPH_PF12MFP_Pos (16) /*!< SYS_T::GPF_MFPH: PF12MFP Position */ -#define SYS_GPF_MFPH_PF12MFP_Msk (0xful << SYS_GPF_MFPH_PF12MFP_Pos) /*!< SYS_T::GPF_MFPH: PF12MFP Mask */ - -#define SYS_GPF_MFPH_PF13MFP_Pos (20) /*!< SYS_T::GPF_MFPH: PF13MFP Position */ -#define SYS_GPF_MFPH_PF13MFP_Msk (0xful << SYS_GPF_MFPH_PF13MFP_Pos) /*!< SYS_T::GPF_MFPH: PF13MFP Mask */ - -#define SYS_GPF_MFPH_PF14MFP_Pos (24) /*!< SYS_T::GPF_MFPH: PF14MFP Position */ -#define SYS_GPF_MFPH_PF14MFP_Msk (0xful << SYS_GPF_MFPH_PF14MFP_Pos) /*!< SYS_T::GPF_MFPH: PF14MFP Mask */ - -#define SYS_GPF_MFPH_PF15MFP_Pos (28) /*!< SYS_T::GPF_MFPH: PF15MFP Position */ -#define SYS_GPF_MFPH_PF15MFP_Msk (0xful << SYS_GPF_MFPH_PF15MFP_Pos) /*!< SYS_T::GPF_MFPH: PF15MFP Mask */ - -#define SYS_GPG_MFPL_PG0MFP_Pos (0) /*!< SYS_T::GPG_MFPL: PG0MFP Position */ -#define SYS_GPG_MFPL_PG0MFP_Msk (0xful << SYS_GPG_MFPL_PG0MFP_Pos) /*!< SYS_T::GPG_MFPL: PG0MFP Mask */ - -#define SYS_GPG_MFPL_PG1MFP_Pos (4) /*!< SYS_T::GPG_MFPL: PG1MFP Position */ -#define SYS_GPG_MFPL_PG1MFP_Msk (0xful << SYS_GPG_MFPL_PG1MFP_Pos) /*!< SYS_T::GPG_MFPL: PG1MFP Mask */ - -#define SYS_GPG_MFPL_PG2MFP_Pos (8) /*!< SYS_T::GPG_MFPL: PG2MFP Position */ -#define SYS_GPG_MFPL_PG2MFP_Msk (0xful << SYS_GPG_MFPL_PG2MFP_Pos) /*!< SYS_T::GPG_MFPL: PG2MFP Mask */ - -#define SYS_GPG_MFPL_PG3MFP_Pos (12) /*!< SYS_T::GPG_MFPL: PG3MFP Position */ -#define SYS_GPG_MFPL_PG3MFP_Msk (0xful << SYS_GPG_MFPL_PG3MFP_Pos) /*!< SYS_T::GPG_MFPL: PG3MFP Mask */ - -#define SYS_GPG_MFPL_PG4MFP_Pos (16) /*!< SYS_T::GPG_MFPL: PG4MFP Position */ -#define SYS_GPG_MFPL_PG4MFP_Msk (0xful << SYS_GPG_MFPL_PG4MFP_Pos) /*!< SYS_T::GPG_MFPL: PG4MFP Mask */ - -#define SYS_GPG_MFPL_PG5MFP_Pos (20) /*!< SYS_T::GPG_MFPL: PG5MFP Position */ -#define SYS_GPG_MFPL_PG5MFP_Msk (0xful << SYS_GPG_MFPL_PG5MFP_Pos) /*!< SYS_T::GPG_MFPL: PG5MFP Mask */ - -#define SYS_GPG_MFPL_PG6MFP_Pos (24) /*!< SYS_T::GPG_MFPL: PG6MFP Position */ -#define SYS_GPG_MFPL_PG6MFP_Msk (0xful << SYS_GPG_MFPL_PG6MFP_Pos) /*!< SYS_T::GPG_MFPL: PG6MFP Mask */ - -#define SYS_GPG_MFPL_PG7MFP_Pos (28) /*!< SYS_T::GPG_MFPL: PG7MFP Position */ -#define SYS_GPG_MFPL_PG7MFP_Msk (0xful << SYS_GPG_MFPL_PG7MFP_Pos) /*!< SYS_T::GPG_MFPL: PG7MFP Mask */ - -#define SYS_GPG_MFPH_PG8MFP_Pos (0) /*!< SYS_T::GPG_MFPH: PG8MFP Position */ -#define SYS_GPG_MFPH_PG8MFP_Msk (0xful << SYS_GPG_MFPH_PG8MFP_Pos) /*!< SYS_T::GPG_MFPH: PG8MFP Mask */ - -#define SYS_GPG_MFPH_PG9MFP_Pos (4) /*!< SYS_T::GPG_MFPH: PG9MFP Position */ -#define SYS_GPG_MFPH_PG9MFP_Msk (0xful << SYS_GPG_MFPH_PG9MFP_Pos) /*!< SYS_T::GPG_MFPH: PG9MFP Mask */ - -#define SYS_GPG_MFPH_PG10MFP_Pos (8) /*!< SYS_T::GPG_MFPH: PG10MFP Position */ -#define SYS_GPG_MFPH_PG10MFP_Msk (0xful << SYS_GPG_MFPH_PG10MFP_Pos) /*!< SYS_T::GPG_MFPH: PG10MFP Mask */ - -#define SYS_GPG_MFPH_PG11MFP_Pos (12) /*!< SYS_T::GPG_MFPH: PG11MFP Position */ -#define SYS_GPG_MFPH_PG11MFP_Msk (0xful << SYS_GPG_MFPH_PG11MFP_Pos) /*!< SYS_T::GPG_MFPH: PG11MFP Mask */ - -#define SYS_GPG_MFPH_PG12MFP_Pos (16) /*!< SYS_T::GPG_MFPH: PG12MFP Position */ -#define SYS_GPG_MFPH_PG12MFP_Msk (0xful << SYS_GPG_MFPH_PG12MFP_Pos) /*!< SYS_T::GPG_MFPH: PG12MFP Mask */ - -#define SYS_GPG_MFPH_PG13MFP_Pos (20) /*!< SYS_T::GPG_MFPH: PG13MFP Position */ -#define SYS_GPG_MFPH_PG13MFP_Msk (0xful << SYS_GPG_MFPH_PG13MFP_Pos) /*!< SYS_T::GPG_MFPH: PG13MFP Mask */ - -#define SYS_GPG_MFPH_PG14MFP_Pos (24) /*!< SYS_T::GPG_MFPH: PG14MFP Position */ -#define SYS_GPG_MFPH_PG14MFP_Msk (0xful << SYS_GPG_MFPH_PG14MFP_Pos) /*!< SYS_T::GPG_MFPH: PG14MFP Mask */ - -#define SYS_GPG_MFPH_PG15MFP_Pos (28) /*!< SYS_T::GPG_MFPH: PG15MFP Position */ -#define SYS_GPG_MFPH_PG15MFP_Msk (0xful << SYS_GPG_MFPH_PG15MFP_Pos) /*!< SYS_T::GPG_MFPH: PG15MFP Mask */ - -#define SYS_GPH_MFPL_PH0MFP_Pos (0) /*!< SYS_T::GPH_MFPL: PH0MFP Position */ -#define SYS_GPH_MFPL_PH0MFP_Msk (0xful << SYS_GPH_MFPL_PH0MFP_Pos) /*!< SYS_T::GPH_MFPL: PH0MFP Mask */ - -#define SYS_GPH_MFPL_PH1MFP_Pos (4) /*!< SYS_T::GPH_MFPL: PH1MFP Position */ -#define SYS_GPH_MFPL_PH1MFP_Msk (0xful << SYS_GPH_MFPL_PH1MFP_Pos) /*!< SYS_T::GPH_MFPL: PH1MFP Mask */ - -#define SYS_GPH_MFPL_PH2MFP_Pos (8) /*!< SYS_T::GPH_MFPL: PH2MFP Position */ -#define SYS_GPH_MFPL_PH2MFP_Msk (0xful << SYS_GPH_MFPL_PH2MFP_Pos) /*!< SYS_T::GPH_MFPL: PH2MFP Mask */ - -#define SYS_GPH_MFPL_PH3MFP_Pos (12) /*!< SYS_T::GPH_MFPL: PH3MFP Position */ -#define SYS_GPH_MFPL_PH3MFP_Msk (0xful << SYS_GPH_MFPL_PH3MFP_Pos) /*!< SYS_T::GPH_MFPL: PH3MFP Mask */ - -#define SYS_GPH_MFPL_PH4MFP_Pos (16) /*!< SYS_T::GPH_MFPL: PH4MFP Position */ -#define SYS_GPH_MFPL_PH4MFP_Msk (0xful << SYS_GPH_MFPL_PH4MFP_Pos) /*!< SYS_T::GPH_MFPL: PH4MFP Mask */ - -#define SYS_GPH_MFPL_PH5MFP_Pos (20) /*!< SYS_T::GPH_MFPL: PH5MFP Position */ -#define SYS_GPH_MFPL_PH5MFP_Msk (0xful << SYS_GPH_MFPL_PH5MFP_Pos) /*!< SYS_T::GPH_MFPL: PH5MFP Mask */ - -#define SYS_GPH_MFPL_PH6MFP_Pos (24) /*!< SYS_T::GPH_MFPL: PH6MFP Position */ -#define SYS_GPH_MFPL_PH6MFP_Msk (0xful << SYS_GPH_MFPL_PH6MFP_Pos) /*!< SYS_T::GPH_MFPL: PH6MFP Mask */ - -#define SYS_GPH_MFPL_PH7MFP_Pos (28) /*!< SYS_T::GPH_MFPL: PH7MFP Position */ -#define SYS_GPH_MFPL_PH7MFP_Msk (0xful << SYS_GPH_MFPL_PH7MFP_Pos) /*!< SYS_T::GPH_MFPL: PH7MFP Mask */ - -#define SYS_GPH_MFPH_PH8MFP_Pos (0) /*!< SYS_T::GPH_MFPH: PH8MFP Position */ -#define SYS_GPH_MFPH_PH8MFP_Msk (0xful << SYS_GPH_MFPH_PH8MFP_Pos) /*!< SYS_T::GPH_MFPH: PH8MFP Mask */ - -#define SYS_GPH_MFPH_PH9MFP_Pos (4) /*!< SYS_T::GPH_MFPH: PH9MFP Position */ -#define SYS_GPH_MFPH_PH9MFP_Msk (0xful << SYS_GPH_MFPH_PH9MFP_Pos) /*!< SYS_T::GPH_MFPH: PH9MFP Mask */ - -#define SYS_GPH_MFPH_PH10MFP_Pos (8) /*!< SYS_T::GPH_MFPH: PH10MFP Position */ -#define SYS_GPH_MFPH_PH10MFP_Msk (0xful << SYS_GPH_MFPH_PH10MFP_Pos) /*!< SYS_T::GPH_MFPH: PH10MFP Mask */ - -#define SYS_GPH_MFPH_PH11MFP_Pos (12) /*!< SYS_T::GPH_MFPH: PH11MFP Position */ -#define SYS_GPH_MFPH_PH11MFP_Msk (0xful << SYS_GPH_MFPH_PH11MFP_Pos) /*!< SYS_T::GPH_MFPH: PH11MFP Mask */ - -#define SYS_GPH_MFPH_PH12MFP_Pos (16) /*!< SYS_T::GPH_MFPH: PH12MFP Position */ -#define SYS_GPH_MFPH_PH12MFP_Msk (0xful << SYS_GPH_MFPH_PH12MFP_Pos) /*!< SYS_T::GPH_MFPH: PH12MFP Mask */ - -#define SYS_GPH_MFPH_PH13MFP_Pos (20) /*!< SYS_T::GPH_MFPH: PH13MFP Position */ -#define SYS_GPH_MFPH_PH13MFP_Msk (0xful << SYS_GPH_MFPH_PH13MFP_Pos) /*!< SYS_T::GPH_MFPH: PH13MFP Mask */ - -#define SYS_GPH_MFPH_PH14MFP_Pos (24) /*!< SYS_T::GPH_MFPH: PH14MFP Position */ -#define SYS_GPH_MFPH_PH14MFP_Msk (0xful << SYS_GPH_MFPH_PH14MFP_Pos) /*!< SYS_T::GPH_MFPH: PH14MFP Mask */ - -#define SYS_GPH_MFPH_PH15MFP_Pos (28) /*!< SYS_T::GPH_MFPH: PH15MFP Position */ -#define SYS_GPH_MFPH_PH15MFP_Msk (0xful << SYS_GPH_MFPH_PH15MFP_Pos) /*!< SYS_T::GPH_MFPH: PH15MFP Mask */ - -#define SYS_GPA_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPA_MFOS: MFOS0 Position */ -#define SYS_GPA_MFOS_MFOS0_Msk (0x1ul << SYS_GPA_MFOS_MFOS0_Pos) /*!< SYS_T::GPA_MFOS: MFOS0 Mask */ - -#define SYS_GPA_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPA_MFOS: MFOS1 Position */ -#define SYS_GPA_MFOS_MFOS1_Msk (0x1ul << SYS_GPA_MFOS_MFOS1_Pos) /*!< SYS_T::GPA_MFOS: MFOS1 Mask */ - -#define SYS_GPA_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPA_MFOS: MFOS2 Position */ -#define SYS_GPA_MFOS_MFOS2_Msk (0x1ul << SYS_GPA_MFOS_MFOS2_Pos) /*!< SYS_T::GPA_MFOS: MFOS2 Mask */ - -#define SYS_GPA_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPA_MFOS: MFOS3 Position */ -#define SYS_GPA_MFOS_MFOS3_Msk (0x1ul << SYS_GPA_MFOS_MFOS3_Pos) /*!< SYS_T::GPA_MFOS: MFOS3 Mask */ - -#define SYS_GPA_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPA_MFOS: MFOS4 Position */ -#define SYS_GPA_MFOS_MFOS4_Msk (0x1ul << SYS_GPA_MFOS_MFOS4_Pos) /*!< SYS_T::GPA_MFOS: MFOS4 Mask */ - -#define SYS_GPA_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPA_MFOS: MFOS5 Position */ -#define SYS_GPA_MFOS_MFOS5_Msk (0x1ul << SYS_GPA_MFOS_MFOS5_Pos) /*!< SYS_T::GPA_MFOS: MFOS5 Mask */ - -#define SYS_GPA_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPA_MFOS: MFOS6 Position */ -#define SYS_GPA_MFOS_MFOS6_Msk (0x1ul << SYS_GPA_MFOS_MFOS6_Pos) /*!< SYS_T::GPA_MFOS: MFOS6 Mask */ - -#define SYS_GPA_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPA_MFOS: MFOS7 Position */ -#define SYS_GPA_MFOS_MFOS7_Msk (0x1ul << SYS_GPA_MFOS_MFOS7_Pos) /*!< SYS_T::GPA_MFOS: MFOS7 Mask */ - -#define SYS_GPA_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPA_MFOS: MFOS8 Position */ -#define SYS_GPA_MFOS_MFOS8_Msk (0x1ul << SYS_GPA_MFOS_MFOS8_Pos) /*!< SYS_T::GPA_MFOS: MFOS8 Mask */ - -#define SYS_GPA_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPA_MFOS: MFOS9 Position */ -#define SYS_GPA_MFOS_MFOS9_Msk (0x1ul << SYS_GPA_MFOS_MFOS9_Pos) /*!< SYS_T::GPA_MFOS: MFOS9 Mask */ - -#define SYS_GPA_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPA_MFOS: MFOS10 Position */ -#define SYS_GPA_MFOS_MFOS10_Msk (0x1ul << SYS_GPA_MFOS_MFOS10_Pos) /*!< SYS_T::GPA_MFOS: MFOS10 Mask */ - -#define SYS_GPA_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPA_MFOS: MFOS11 Position */ -#define SYS_GPA_MFOS_MFOS11_Msk (0x1ul << SYS_GPA_MFOS_MFOS11_Pos) /*!< SYS_T::GPA_MFOS: MFOS11 Mask */ - -#define SYS_GPA_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPA_MFOS: MFOS12 Position */ -#define SYS_GPA_MFOS_MFOS12_Msk (0x1ul << SYS_GPA_MFOS_MFOS12_Pos) /*!< SYS_T::GPA_MFOS: MFOS12 Mask */ - -#define SYS_GPA_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPA_MFOS: MFOS13 Position */ -#define SYS_GPA_MFOS_MFOS13_Msk (0x1ul << SYS_GPA_MFOS_MFOS13_Pos) /*!< SYS_T::GPA_MFOS: MFOS13 Mask */ - -#define SYS_GPA_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPA_MFOS: MFOS14 Position */ -#define SYS_GPA_MFOS_MFOS14_Msk (0x1ul << SYS_GPA_MFOS_MFOS14_Pos) /*!< SYS_T::GPA_MFOS: MFOS14 Mask */ - -#define SYS_GPA_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPA_MFOS: MFOS15 Position */ -#define SYS_GPA_MFOS_MFOS15_Msk (0x1ul << SYS_GPA_MFOS_MFOS15_Pos) /*!< SYS_T::GPA_MFOS: MFOS15 Mask */ - -#define SYS_GPB_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPB_MFOS: MFOS0 Position */ -#define SYS_GPB_MFOS_MFOS0_Msk (0x1ul << SYS_GPB_MFOS_MFOS0_Pos) /*!< SYS_T::GPB_MFOS: MFOS0 Mask */ - -#define SYS_GPB_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPB_MFOS: MFOS1 Position */ -#define SYS_GPB_MFOS_MFOS1_Msk (0x1ul << SYS_GPB_MFOS_MFOS1_Pos) /*!< SYS_T::GPB_MFOS: MFOS1 Mask */ - -#define SYS_GPB_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPB_MFOS: MFOS2 Position */ -#define SYS_GPB_MFOS_MFOS2_Msk (0x1ul << SYS_GPB_MFOS_MFOS2_Pos) /*!< SYS_T::GPB_MFOS: MFOS2 Mask */ - -#define SYS_GPB_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPB_MFOS: MFOS3 Position */ -#define SYS_GPB_MFOS_MFOS3_Msk (0x1ul << SYS_GPB_MFOS_MFOS3_Pos) /*!< SYS_T::GPB_MFOS: MFOS3 Mask */ - -#define SYS_GPB_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPB_MFOS: MFOS4 Position */ -#define SYS_GPB_MFOS_MFOS4_Msk (0x1ul << SYS_GPB_MFOS_MFOS4_Pos) /*!< SYS_T::GPB_MFOS: MFOS4 Mask */ - -#define SYS_GPB_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPB_MFOS: MFOS5 Position */ -#define SYS_GPB_MFOS_MFOS5_Msk (0x1ul << SYS_GPB_MFOS_MFOS5_Pos) /*!< SYS_T::GPB_MFOS: MFOS5 Mask */ - -#define SYS_GPB_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPB_MFOS: MFOS6 Position */ -#define SYS_GPB_MFOS_MFOS6_Msk (0x1ul << SYS_GPB_MFOS_MFOS6_Pos) /*!< SYS_T::GPB_MFOS: MFOS6 Mask */ - -#define SYS_GPB_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPB_MFOS: MFOS7 Position */ -#define SYS_GPB_MFOS_MFOS7_Msk (0x1ul << SYS_GPB_MFOS_MFOS7_Pos) /*!< SYS_T::GPB_MFOS: MFOS7 Mask */ - -#define SYS_GPB_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPB_MFOS: MFOS8 Position */ -#define SYS_GPB_MFOS_MFOS8_Msk (0x1ul << SYS_GPB_MFOS_MFOS8_Pos) /*!< SYS_T::GPB_MFOS: MFOS8 Mask */ - -#define SYS_GPB_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPB_MFOS: MFOS9 Position */ -#define SYS_GPB_MFOS_MFOS9_Msk (0x1ul << SYS_GPB_MFOS_MFOS9_Pos) /*!< SYS_T::GPB_MFOS: MFOS9 Mask */ - -#define SYS_GPB_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPB_MFOS: MFOS10 Position */ -#define SYS_GPB_MFOS_MFOS10_Msk (0x1ul << SYS_GPB_MFOS_MFOS10_Pos) /*!< SYS_T::GPB_MFOS: MFOS10 Mask */ - -#define SYS_GPB_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPB_MFOS: MFOS11 Position */ -#define SYS_GPB_MFOS_MFOS11_Msk (0x1ul << SYS_GPB_MFOS_MFOS11_Pos) /*!< SYS_T::GPB_MFOS: MFOS11 Mask */ - -#define SYS_GPB_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPB_MFOS: MFOS12 Position */ -#define SYS_GPB_MFOS_MFOS12_Msk (0x1ul << SYS_GPB_MFOS_MFOS12_Pos) /*!< SYS_T::GPB_MFOS: MFOS12 Mask */ - -#define SYS_GPB_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPB_MFOS: MFOS13 Position */ -#define SYS_GPB_MFOS_MFOS13_Msk (0x1ul << SYS_GPB_MFOS_MFOS13_Pos) /*!< SYS_T::GPB_MFOS: MFOS13 Mask */ - -#define SYS_GPB_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPB_MFOS: MFOS14 Position */ -#define SYS_GPB_MFOS_MFOS14_Msk (0x1ul << SYS_GPB_MFOS_MFOS14_Pos) /*!< SYS_T::GPB_MFOS: MFOS14 Mask */ - -#define SYS_GPB_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPB_MFOS: MFOS15 Position */ -#define SYS_GPB_MFOS_MFOS15_Msk (0x1ul << SYS_GPB_MFOS_MFOS15_Pos) /*!< SYS_T::GPB_MFOS: MFOS15 Mask */ - -#define SYS_GPC_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPC_MFOS: MFOS0 Position */ -#define SYS_GPC_MFOS_MFOS0_Msk (0x1ul << SYS_GPC_MFOS_MFOS0_Pos) /*!< SYS_T::GPC_MFOS: MFOS0 Mask */ - -#define SYS_GPC_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPC_MFOS: MFOS1 Position */ -#define SYS_GPC_MFOS_MFOS1_Msk (0x1ul << SYS_GPC_MFOS_MFOS1_Pos) /*!< SYS_T::GPC_MFOS: MFOS1 Mask */ - -#define SYS_GPC_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPC_MFOS: MFOS2 Position */ -#define SYS_GPC_MFOS_MFOS2_Msk (0x1ul << SYS_GPC_MFOS_MFOS2_Pos) /*!< SYS_T::GPC_MFOS: MFOS2 Mask */ - -#define SYS_GPC_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPC_MFOS: MFOS3 Position */ -#define SYS_GPC_MFOS_MFOS3_Msk (0x1ul << SYS_GPC_MFOS_MFOS3_Pos) /*!< SYS_T::GPC_MFOS: MFOS3 Mask */ - -#define SYS_GPC_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPC_MFOS: MFOS4 Position */ -#define SYS_GPC_MFOS_MFOS4_Msk (0x1ul << SYS_GPC_MFOS_MFOS4_Pos) /*!< SYS_T::GPC_MFOS: MFOS4 Mask */ - -#define SYS_GPC_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPC_MFOS: MFOS5 Position */ -#define SYS_GPC_MFOS_MFOS5_Msk (0x1ul << SYS_GPC_MFOS_MFOS5_Pos) /*!< SYS_T::GPC_MFOS: MFOS5 Mask */ - -#define SYS_GPC_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPC_MFOS: MFOS6 Position */ -#define SYS_GPC_MFOS_MFOS6_Msk (0x1ul << SYS_GPC_MFOS_MFOS6_Pos) /*!< SYS_T::GPC_MFOS: MFOS6 Mask */ - -#define SYS_GPC_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPC_MFOS: MFOS7 Position */ -#define SYS_GPC_MFOS_MFOS7_Msk (0x1ul << SYS_GPC_MFOS_MFOS7_Pos) /*!< SYS_T::GPC_MFOS: MFOS7 Mask */ - -#define SYS_GPC_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPC_MFOS: MFOS8 Position */ -#define SYS_GPC_MFOS_MFOS8_Msk (0x1ul << SYS_GPC_MFOS_MFOS8_Pos) /*!< SYS_T::GPC_MFOS: MFOS8 Mask */ - -#define SYS_GPC_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPC_MFOS: MFOS9 Position */ -#define SYS_GPC_MFOS_MFOS9_Msk (0x1ul << SYS_GPC_MFOS_MFOS9_Pos) /*!< SYS_T::GPC_MFOS: MFOS9 Mask */ - -#define SYS_GPC_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPC_MFOS: MFOS10 Position */ -#define SYS_GPC_MFOS_MFOS10_Msk (0x1ul << SYS_GPC_MFOS_MFOS10_Pos) /*!< SYS_T::GPC_MFOS: MFOS10 Mask */ - -#define SYS_GPC_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPC_MFOS: MFOS11 Position */ -#define SYS_GPC_MFOS_MFOS11_Msk (0x1ul << SYS_GPC_MFOS_MFOS11_Pos) /*!< SYS_T::GPC_MFOS: MFOS11 Mask */ - -#define SYS_GPC_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPC_MFOS: MFOS12 Position */ -#define SYS_GPC_MFOS_MFOS12_Msk (0x1ul << SYS_GPC_MFOS_MFOS12_Pos) /*!< SYS_T::GPC_MFOS: MFOS12 Mask */ - -#define SYS_GPC_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPC_MFOS: MFOS13 Position */ -#define SYS_GPC_MFOS_MFOS13_Msk (0x1ul << SYS_GPC_MFOS_MFOS13_Pos) /*!< SYS_T::GPC_MFOS: MFOS13 Mask */ - -#define SYS_GPC_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPC_MFOS: MFOS14 Position */ -#define SYS_GPC_MFOS_MFOS14_Msk (0x1ul << SYS_GPC_MFOS_MFOS14_Pos) /*!< SYS_T::GPC_MFOS: MFOS14 Mask */ - -#define SYS_GPC_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPC_MFOS: MFOS15 Position */ -#define SYS_GPC_MFOS_MFOS15_Msk (0x1ul << SYS_GPC_MFOS_MFOS15_Pos) /*!< SYS_T::GPC_MFOS: MFOS15 Mask */ - -#define SYS_GPD_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPD_MFOS: MFOS0 Position */ -#define SYS_GPD_MFOS_MFOS0_Msk (0x1ul << SYS_GPD_MFOS_MFOS0_Pos) /*!< SYS_T::GPD_MFOS: MFOS0 Mask */ - -#define SYS_GPD_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPD_MFOS: MFOS1 Position */ -#define SYS_GPD_MFOS_MFOS1_Msk (0x1ul << SYS_GPD_MFOS_MFOS1_Pos) /*!< SYS_T::GPD_MFOS: MFOS1 Mask */ - -#define SYS_GPD_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPD_MFOS: MFOS2 Position */ -#define SYS_GPD_MFOS_MFOS2_Msk (0x1ul << SYS_GPD_MFOS_MFOS2_Pos) /*!< SYS_T::GPD_MFOS: MFOS2 Mask */ - -#define SYS_GPD_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPD_MFOS: MFOS3 Position */ -#define SYS_GPD_MFOS_MFOS3_Msk (0x1ul << SYS_GPD_MFOS_MFOS3_Pos) /*!< SYS_T::GPD_MFOS: MFOS3 Mask */ - -#define SYS_GPD_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPD_MFOS: MFOS4 Position */ -#define SYS_GPD_MFOS_MFOS4_Msk (0x1ul << SYS_GPD_MFOS_MFOS4_Pos) /*!< SYS_T::GPD_MFOS: MFOS4 Mask */ - -#define SYS_GPD_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPD_MFOS: MFOS5 Position */ -#define SYS_GPD_MFOS_MFOS5_Msk (0x1ul << SYS_GPD_MFOS_MFOS5_Pos) /*!< SYS_T::GPD_MFOS: MFOS5 Mask */ - -#define SYS_GPD_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPD_MFOS: MFOS6 Position */ -#define SYS_GPD_MFOS_MFOS6_Msk (0x1ul << SYS_GPD_MFOS_MFOS6_Pos) /*!< SYS_T::GPD_MFOS: MFOS6 Mask */ - -#define SYS_GPD_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPD_MFOS: MFOS7 Position */ -#define SYS_GPD_MFOS_MFOS7_Msk (0x1ul << SYS_GPD_MFOS_MFOS7_Pos) /*!< SYS_T::GPD_MFOS: MFOS7 Mask */ - -#define SYS_GPD_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPD_MFOS: MFOS8 Position */ -#define SYS_GPD_MFOS_MFOS8_Msk (0x1ul << SYS_GPD_MFOS_MFOS8_Pos) /*!< SYS_T::GPD_MFOS: MFOS8 Mask */ - -#define SYS_GPD_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPD_MFOS: MFOS9 Position */ -#define SYS_GPD_MFOS_MFOS9_Msk (0x1ul << SYS_GPD_MFOS_MFOS9_Pos) /*!< SYS_T::GPD_MFOS: MFOS9 Mask */ - -#define SYS_GPD_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPD_MFOS: MFOS10 Position */ -#define SYS_GPD_MFOS_MFOS10_Msk (0x1ul << SYS_GPD_MFOS_MFOS10_Pos) /*!< SYS_T::GPD_MFOS: MFOS10 Mask */ - -#define SYS_GPD_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPD_MFOS: MFOS11 Position */ -#define SYS_GPD_MFOS_MFOS11_Msk (0x1ul << SYS_GPD_MFOS_MFOS11_Pos) /*!< SYS_T::GPD_MFOS: MFOS11 Mask */ - -#define SYS_GPD_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPD_MFOS: MFOS12 Position */ -#define SYS_GPD_MFOS_MFOS12_Msk (0x1ul << SYS_GPD_MFOS_MFOS12_Pos) /*!< SYS_T::GPD_MFOS: MFOS12 Mask */ - -#define SYS_GPD_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPD_MFOS: MFOS13 Position */ -#define SYS_GPD_MFOS_MFOS13_Msk (0x1ul << SYS_GPD_MFOS_MFOS13_Pos) /*!< SYS_T::GPD_MFOS: MFOS13 Mask */ - -#define SYS_GPD_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPD_MFOS: MFOS14 Position */ -#define SYS_GPD_MFOS_MFOS14_Msk (0x1ul << SYS_GPD_MFOS_MFOS14_Pos) /*!< SYS_T::GPD_MFOS: MFOS14 Mask */ - -#define SYS_GPD_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPD_MFOS: MFOS15 Position */ -#define SYS_GPD_MFOS_MFOS15_Msk (0x1ul << SYS_GPD_MFOS_MFOS15_Pos) /*!< SYS_T::GPD_MFOS: MFOS15 Mask */ - -#define SYS_GPE_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPE_MFOS: MFOS0 Position */ -#define SYS_GPE_MFOS_MFOS0_Msk (0x1ul << SYS_GPE_MFOS_MFOS0_Pos) /*!< SYS_T::GPE_MFOS: MFOS0 Mask */ - -#define SYS_GPE_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPE_MFOS: MFOS1 Position */ -#define SYS_GPE_MFOS_MFOS1_Msk (0x1ul << SYS_GPE_MFOS_MFOS1_Pos) /*!< SYS_T::GPE_MFOS: MFOS1 Mask */ - -#define SYS_GPE_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPE_MFOS: MFOS2 Position */ -#define SYS_GPE_MFOS_MFOS2_Msk (0x1ul << SYS_GPE_MFOS_MFOS2_Pos) /*!< SYS_T::GPE_MFOS: MFOS2 Mask */ - -#define SYS_GPE_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPE_MFOS: MFOS3 Position */ -#define SYS_GPE_MFOS_MFOS3_Msk (0x1ul << SYS_GPE_MFOS_MFOS3_Pos) /*!< SYS_T::GPE_MFOS: MFOS3 Mask */ - -#define SYS_GPE_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPE_MFOS: MFOS4 Position */ -#define SYS_GPE_MFOS_MFOS4_Msk (0x1ul << SYS_GPE_MFOS_MFOS4_Pos) /*!< SYS_T::GPE_MFOS: MFOS4 Mask */ - -#define SYS_GPE_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPE_MFOS: MFOS5 Position */ -#define SYS_GPE_MFOS_MFOS5_Msk (0x1ul << SYS_GPE_MFOS_MFOS5_Pos) /*!< SYS_T::GPE_MFOS: MFOS5 Mask */ - -#define SYS_GPE_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPE_MFOS: MFOS6 Position */ -#define SYS_GPE_MFOS_MFOS6_Msk (0x1ul << SYS_GPE_MFOS_MFOS6_Pos) /*!< SYS_T::GPE_MFOS: MFOS6 Mask */ - -#define SYS_GPE_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPE_MFOS: MFOS7 Position */ -#define SYS_GPE_MFOS_MFOS7_Msk (0x1ul << SYS_GPE_MFOS_MFOS7_Pos) /*!< SYS_T::GPE_MFOS: MFOS7 Mask */ - -#define SYS_GPE_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPE_MFOS: MFOS8 Position */ -#define SYS_GPE_MFOS_MFOS8_Msk (0x1ul << SYS_GPE_MFOS_MFOS8_Pos) /*!< SYS_T::GPE_MFOS: MFOS8 Mask */ - -#define SYS_GPE_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPE_MFOS: MFOS9 Position */ -#define SYS_GPE_MFOS_MFOS9_Msk (0x1ul << SYS_GPE_MFOS_MFOS9_Pos) /*!< SYS_T::GPE_MFOS: MFOS9 Mask */ - -#define SYS_GPE_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPE_MFOS: MFOS10 Position */ -#define SYS_GPE_MFOS_MFOS10_Msk (0x1ul << SYS_GPE_MFOS_MFOS10_Pos) /*!< SYS_T::GPE_MFOS: MFOS10 Mask */ - -#define SYS_GPE_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPE_MFOS: MFOS11 Position */ -#define SYS_GPE_MFOS_MFOS11_Msk (0x1ul << SYS_GPE_MFOS_MFOS11_Pos) /*!< SYS_T::GPE_MFOS: MFOS11 Mask */ - -#define SYS_GPE_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPE_MFOS: MFOS12 Position */ -#define SYS_GPE_MFOS_MFOS12_Msk (0x1ul << SYS_GPE_MFOS_MFOS12_Pos) /*!< SYS_T::GPE_MFOS: MFOS12 Mask */ - -#define SYS_GPE_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPE_MFOS: MFOS13 Position */ -#define SYS_GPE_MFOS_MFOS13_Msk (0x1ul << SYS_GPE_MFOS_MFOS13_Pos) /*!< SYS_T::GPE_MFOS: MFOS13 Mask */ - -#define SYS_GPE_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPE_MFOS: MFOS14 Position */ -#define SYS_GPE_MFOS_MFOS14_Msk (0x1ul << SYS_GPE_MFOS_MFOS14_Pos) /*!< SYS_T::GPE_MFOS: MFOS14 Mask */ - -#define SYS_GPE_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPE_MFOS: MFOS15 Position */ -#define SYS_GPE_MFOS_MFOS15_Msk (0x1ul << SYS_GPE_MFOS_MFOS15_Pos) /*!< SYS_T::GPE_MFOS: MFOS15 Mask */ - -#define SYS_GPF_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPF_MFOS: MFOS0 Position */ -#define SYS_GPF_MFOS_MFOS0_Msk (0x1ul << SYS_GPF_MFOS_MFOS0_Pos) /*!< SYS_T::GPF_MFOS: MFOS0 Mask */ - -#define SYS_GPF_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPF_MFOS: MFOS1 Position */ -#define SYS_GPF_MFOS_MFOS1_Msk (0x1ul << SYS_GPF_MFOS_MFOS1_Pos) /*!< SYS_T::GPF_MFOS: MFOS1 Mask */ - -#define SYS_GPF_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPF_MFOS: MFOS2 Position */ -#define SYS_GPF_MFOS_MFOS2_Msk (0x1ul << SYS_GPF_MFOS_MFOS2_Pos) /*!< SYS_T::GPF_MFOS: MFOS2 Mask */ - -#define SYS_GPF_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPF_MFOS: MFOS3 Position */ -#define SYS_GPF_MFOS_MFOS3_Msk (0x1ul << SYS_GPF_MFOS_MFOS3_Pos) /*!< SYS_T::GPF_MFOS: MFOS3 Mask */ - -#define SYS_GPF_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPF_MFOS: MFOS4 Position */ -#define SYS_GPF_MFOS_MFOS4_Msk (0x1ul << SYS_GPF_MFOS_MFOS4_Pos) /*!< SYS_T::GPF_MFOS: MFOS4 Mask */ - -#define SYS_GPF_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPF_MFOS: MFOS5 Position */ -#define SYS_GPF_MFOS_MFOS5_Msk (0x1ul << SYS_GPF_MFOS_MFOS5_Pos) /*!< SYS_T::GPF_MFOS: MFOS5 Mask */ - -#define SYS_GPF_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPF_MFOS: MFOS6 Position */ -#define SYS_GPF_MFOS_MFOS6_Msk (0x1ul << SYS_GPF_MFOS_MFOS6_Pos) /*!< SYS_T::GPF_MFOS: MFOS6 Mask */ - -#define SYS_GPF_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPF_MFOS: MFOS7 Position */ -#define SYS_GPF_MFOS_MFOS7_Msk (0x1ul << SYS_GPF_MFOS_MFOS7_Pos) /*!< SYS_T::GPF_MFOS: MFOS7 Mask */ - -#define SYS_GPF_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPF_MFOS: MFOS8 Position */ -#define SYS_GPF_MFOS_MFOS8_Msk (0x1ul << SYS_GPF_MFOS_MFOS8_Pos) /*!< SYS_T::GPF_MFOS: MFOS8 Mask */ - -#define SYS_GPF_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPF_MFOS: MFOS9 Position */ -#define SYS_GPF_MFOS_MFOS9_Msk (0x1ul << SYS_GPF_MFOS_MFOS9_Pos) /*!< SYS_T::GPF_MFOS: MFOS9 Mask */ - -#define SYS_GPF_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPF_MFOS: MFOS10 Position */ -#define SYS_GPF_MFOS_MFOS10_Msk (0x1ul << SYS_GPF_MFOS_MFOS10_Pos) /*!< SYS_T::GPF_MFOS: MFOS10 Mask */ - -#define SYS_GPF_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPF_MFOS: MFOS11 Position */ -#define SYS_GPF_MFOS_MFOS11_Msk (0x1ul << SYS_GPF_MFOS_MFOS11_Pos) /*!< SYS_T::GPF_MFOS: MFOS11 Mask */ - -#define SYS_GPF_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPF_MFOS: MFOS12 Position */ -#define SYS_GPF_MFOS_MFOS12_Msk (0x1ul << SYS_GPF_MFOS_MFOS12_Pos) /*!< SYS_T::GPF_MFOS: MFOS12 Mask */ - -#define SYS_GPF_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPF_MFOS: MFOS13 Position */ -#define SYS_GPF_MFOS_MFOS13_Msk (0x1ul << SYS_GPF_MFOS_MFOS13_Pos) /*!< SYS_T::GPF_MFOS: MFOS13 Mask */ - -#define SYS_GPF_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPF_MFOS: MFOS14 Position */ -#define SYS_GPF_MFOS_MFOS14_Msk (0x1ul << SYS_GPF_MFOS_MFOS14_Pos) /*!< SYS_T::GPF_MFOS: MFOS14 Mask */ - -#define SYS_GPF_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPF_MFOS: MFOS15 Position */ -#define SYS_GPF_MFOS_MFOS15_Msk (0x1ul << SYS_GPF_MFOS_MFOS15_Pos) /*!< SYS_T::GPF_MFOS: MFOS15 Mask */ - -#define SYS_GPG_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPG_MFOS: MFOS0 Position */ -#define SYS_GPG_MFOS_MFOS0_Msk (0x1ul << SYS_GPG_MFOS_MFOS0_Pos) /*!< SYS_T::GPG_MFOS: MFOS0 Mask */ - -#define SYS_GPG_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPG_MFOS: MFOS1 Position */ -#define SYS_GPG_MFOS_MFOS1_Msk (0x1ul << SYS_GPG_MFOS_MFOS1_Pos) /*!< SYS_T::GPG_MFOS: MFOS1 Mask */ - -#define SYS_GPG_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPG_MFOS: MFOS2 Position */ -#define SYS_GPG_MFOS_MFOS2_Msk (0x1ul << SYS_GPG_MFOS_MFOS2_Pos) /*!< SYS_T::GPG_MFOS: MFOS2 Mask */ - -#define SYS_GPG_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPG_MFOS: MFOS3 Position */ -#define SYS_GPG_MFOS_MFOS3_Msk (0x1ul << SYS_GPG_MFOS_MFOS3_Pos) /*!< SYS_T::GPG_MFOS: MFOS3 Mask */ - -#define SYS_GPG_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPG_MFOS: MFOS4 Position */ -#define SYS_GPG_MFOS_MFOS4_Msk (0x1ul << SYS_GPG_MFOS_MFOS4_Pos) /*!< SYS_T::GPG_MFOS: MFOS4 Mask */ - -#define SYS_GPG_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPG_MFOS: MFOS5 Position */ -#define SYS_GPG_MFOS_MFOS5_Msk (0x1ul << SYS_GPG_MFOS_MFOS5_Pos) /*!< SYS_T::GPG_MFOS: MFOS5 Mask */ - -#define SYS_GPG_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPG_MFOS: MFOS6 Position */ -#define SYS_GPG_MFOS_MFOS6_Msk (0x1ul << SYS_GPG_MFOS_MFOS6_Pos) /*!< SYS_T::GPG_MFOS: MFOS6 Mask */ - -#define SYS_GPG_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPG_MFOS: MFOS7 Position */ -#define SYS_GPG_MFOS_MFOS7_Msk (0x1ul << SYS_GPG_MFOS_MFOS7_Pos) /*!< SYS_T::GPG_MFOS: MFOS7 Mask */ - -#define SYS_GPG_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPG_MFOS: MFOS8 Position */ -#define SYS_GPG_MFOS_MFOS8_Msk (0x1ul << SYS_GPG_MFOS_MFOS8_Pos) /*!< SYS_T::GPG_MFOS: MFOS8 Mask */ - -#define SYS_GPG_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPG_MFOS: MFOS9 Position */ -#define SYS_GPG_MFOS_MFOS9_Msk (0x1ul << SYS_GPG_MFOS_MFOS9_Pos) /*!< SYS_T::GPG_MFOS: MFOS9 Mask */ - -#define SYS_GPG_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPG_MFOS: MFOS10 Position */ -#define SYS_GPG_MFOS_MFOS10_Msk (0x1ul << SYS_GPG_MFOS_MFOS10_Pos) /*!< SYS_T::GPG_MFOS: MFOS10 Mask */ - -#define SYS_GPG_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPG_MFOS: MFOS11 Position */ -#define SYS_GPG_MFOS_MFOS11_Msk (0x1ul << SYS_GPG_MFOS_MFOS11_Pos) /*!< SYS_T::GPG_MFOS: MFOS11 Mask */ - -#define SYS_GPG_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPG_MFOS: MFOS12 Position */ -#define SYS_GPG_MFOS_MFOS12_Msk (0x1ul << SYS_GPG_MFOS_MFOS12_Pos) /*!< SYS_T::GPG_MFOS: MFOS12 Mask */ - -#define SYS_GPG_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPG_MFOS: MFOS13 Position */ -#define SYS_GPG_MFOS_MFOS13_Msk (0x1ul << SYS_GPG_MFOS_MFOS13_Pos) /*!< SYS_T::GPG_MFOS: MFOS13 Mask */ - -#define SYS_GPG_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPG_MFOS: MFOS14 Position */ -#define SYS_GPG_MFOS_MFOS14_Msk (0x1ul << SYS_GPG_MFOS_MFOS14_Pos) /*!< SYS_T::GPG_MFOS: MFOS14 Mask */ - -#define SYS_GPG_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPG_MFOS: MFOS15 Position */ -#define SYS_GPG_MFOS_MFOS15_Msk (0x1ul << SYS_GPG_MFOS_MFOS15_Pos) /*!< SYS_T::GPG_MFOS: MFOS15 Mask */ - -#define SYS_GPH_MFOS_MFOS0_Pos (0) /*!< SYS_T::GPH_MFOS: MFOS0 Position */ -#define SYS_GPH_MFOS_MFOS0_Msk (0x1ul << SYS_GPH_MFOS_MFOS0_Pos) /*!< SYS_T::GPH_MFOS: MFOS0 Mask */ - -#define SYS_GPH_MFOS_MFOS1_Pos (1) /*!< SYS_T::GPH_MFOS: MFOS1 Position */ -#define SYS_GPH_MFOS_MFOS1_Msk (0x1ul << SYS_GPH_MFOS_MFOS1_Pos) /*!< SYS_T::GPH_MFOS: MFOS1 Mask */ - -#define SYS_GPH_MFOS_MFOS2_Pos (2) /*!< SYS_T::GPH_MFOS: MFOS2 Position */ -#define SYS_GPH_MFOS_MFOS2_Msk (0x1ul << SYS_GPH_MFOS_MFOS2_Pos) /*!< SYS_T::GPH_MFOS: MFOS2 Mask */ - -#define SYS_GPH_MFOS_MFOS3_Pos (3) /*!< SYS_T::GPH_MFOS: MFOS3 Position */ -#define SYS_GPH_MFOS_MFOS3_Msk (0x1ul << SYS_GPH_MFOS_MFOS3_Pos) /*!< SYS_T::GPH_MFOS: MFOS3 Mask */ - -#define SYS_GPH_MFOS_MFOS4_Pos (4) /*!< SYS_T::GPH_MFOS: MFOS4 Position */ -#define SYS_GPH_MFOS_MFOS4_Msk (0x1ul << SYS_GPH_MFOS_MFOS4_Pos) /*!< SYS_T::GPH_MFOS: MFOS4 Mask */ - -#define SYS_GPH_MFOS_MFOS5_Pos (5) /*!< SYS_T::GPH_MFOS: MFOS5 Position */ -#define SYS_GPH_MFOS_MFOS5_Msk (0x1ul << SYS_GPH_MFOS_MFOS5_Pos) /*!< SYS_T::GPH_MFOS: MFOS5 Mask */ - -#define SYS_GPH_MFOS_MFOS6_Pos (6) /*!< SYS_T::GPH_MFOS: MFOS6 Position */ -#define SYS_GPH_MFOS_MFOS6_Msk (0x1ul << SYS_GPH_MFOS_MFOS6_Pos) /*!< SYS_T::GPH_MFOS: MFOS6 Mask */ - -#define SYS_GPH_MFOS_MFOS7_Pos (7) /*!< SYS_T::GPH_MFOS: MFOS7 Position */ -#define SYS_GPH_MFOS_MFOS7_Msk (0x1ul << SYS_GPH_MFOS_MFOS7_Pos) /*!< SYS_T::GPH_MFOS: MFOS7 Mask */ - -#define SYS_GPH_MFOS_MFOS8_Pos (8) /*!< SYS_T::GPH_MFOS: MFOS8 Position */ -#define SYS_GPH_MFOS_MFOS8_Msk (0x1ul << SYS_GPH_MFOS_MFOS8_Pos) /*!< SYS_T::GPH_MFOS: MFOS8 Mask */ - -#define SYS_GPH_MFOS_MFOS9_Pos (9) /*!< SYS_T::GPH_MFOS: MFOS9 Position */ -#define SYS_GPH_MFOS_MFOS9_Msk (0x1ul << SYS_GPH_MFOS_MFOS9_Pos) /*!< SYS_T::GPH_MFOS: MFOS9 Mask */ - -#define SYS_GPH_MFOS_MFOS10_Pos (10) /*!< SYS_T::GPH_MFOS: MFOS10 Position */ -#define SYS_GPH_MFOS_MFOS10_Msk (0x1ul << SYS_GPH_MFOS_MFOS10_Pos) /*!< SYS_T::GPH_MFOS: MFOS10 Mask */ - -#define SYS_GPH_MFOS_MFOS11_Pos (11) /*!< SYS_T::GPH_MFOS: MFOS11 Position */ -#define SYS_GPH_MFOS_MFOS11_Msk (0x1ul << SYS_GPH_MFOS_MFOS11_Pos) /*!< SYS_T::GPH_MFOS: MFOS11 Mask */ - -#define SYS_GPH_MFOS_MFOS12_Pos (12) /*!< SYS_T::GPH_MFOS: MFOS12 Position */ -#define SYS_GPH_MFOS_MFOS12_Msk (0x1ul << SYS_GPH_MFOS_MFOS12_Pos) /*!< SYS_T::GPH_MFOS: MFOS12 Mask */ - -#define SYS_GPH_MFOS_MFOS13_Pos (13) /*!< SYS_T::GPH_MFOS: MFOS13 Position */ -#define SYS_GPH_MFOS_MFOS13_Msk (0x1ul << SYS_GPH_MFOS_MFOS13_Pos) /*!< SYS_T::GPH_MFOS: MFOS13 Mask */ - -#define SYS_GPH_MFOS_MFOS14_Pos (14) /*!< SYS_T::GPH_MFOS: MFOS14 Position */ -#define SYS_GPH_MFOS_MFOS14_Msk (0x1ul << SYS_GPH_MFOS_MFOS14_Pos) /*!< SYS_T::GPH_MFOS: MFOS14 Mask */ - -#define SYS_GPH_MFOS_MFOS15_Pos (15) /*!< SYS_T::GPH_MFOS: MFOS15 Position */ -#define SYS_GPH_MFOS_MFOS15_Msk (0x1ul << SYS_GPH_MFOS_MFOS15_Pos) /*!< SYS_T::GPH_MFOS: MFOS15 Mask */ - -#define SYS_SRAM_INTCTL_PERRIEN_Pos (0) /*!< SYS_T::SRAM_INTCTL: PERRIEN Position */ -#define SYS_SRAM_INTCTL_PERRIEN_Msk (0x1ul << SYS_SRAM_INTCTL_PERRIEN_Pos) /*!< SYS_T::SRAM_INTCTL: PERRIEN Mask */ - -#define SYS_SRAM_STATUS_PERRIF_Pos (0) /*!< SYS_T::SRAM_STATUS: PERRIF Position */ -#define SYS_SRAM_STATUS_PERRIF_Msk (0x1ul << SYS_SRAM_STATUS_PERRIF_Pos) /*!< SYS_T::SRAM_STATUS: PERRIF Mask */ - -#define SYS_SRAM_ERRADDR_ERRADDR_Pos (0) /*!< SYS_T::SRAM_ERRADDR: ERRADDR Position */ -#define SYS_SRAM_ERRADDR_ERRADDR_Msk (0xfffffffful << SYS_SRAM_ERRADDR_ERRADDR_Pos) /*!< SYS_T::SRAM_ERRADDR: ERRADDR Mask */ - -#define SYS_SRAM_BISTCTL_SRBIST0_Pos (0) /*!< SYS_T::SRAM_BISTCTL: SRBIST0 Position */ -#define SYS_SRAM_BISTCTL_SRBIST0_Msk (0x1ul << SYS_SRAM_BISTCTL_SRBIST0_Pos) /*!< SYS_T::SRAM_BISTCTL: SRBIST0 Mask */ - -#define SYS_SRAM_BISTCTL_SRBIST1_Pos (1) /*!< SYS_T::SRAM_BISTCTL: SRBIST1 Position */ -#define SYS_SRAM_BISTCTL_SRBIST1_Msk (0x1ul << SYS_SRAM_BISTCTL_SRBIST1_Pos) /*!< SYS_T::SRAM_BISTCTL: SRBIST1 Mask */ - -#define SYS_SRAM_BISTCTL_CRBIST_Pos (2) /*!< SYS_T::SRAM_BISTCTL: CRBIST Position */ -#define SYS_SRAM_BISTCTL_CRBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_CRBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: CRBIST Mask */ - -#define SYS_SRAM_BISTCTL_CANBIST_Pos (3) /*!< SYS_T::SRAM_BISTCTL: CANBIST Position */ -#define SYS_SRAM_BISTCTL_CANBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_CANBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: CANBIST Mask */ - -#define SYS_SRAM_BISTCTL_USBBIST_Pos (4) /*!< SYS_T::SRAM_BISTCTL: USBBIST Position */ -#define SYS_SRAM_BISTCTL_USBBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_USBBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: USBBIST Mask */ - -#define SYS_SRAM_BISTCTL_SPIMBIST_Pos (5) /*!< SYS_T::SRAM_BISTCTL: SPIMBIST Position */ -#define SYS_SRAM_BISTCTL_SPIMBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_SPIMBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: SPIMBIST Mask */ - -#define SYS_SRAM_BISTCTL_EMCBIST_Pos (6) /*!< SYS_T::SRAM_BISTCTL: EMCBIST Position */ -#define SYS_SRAM_BISTCTL_EMCBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_EMCBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: EMCBIST Mask */ - -#define SYS_SRAM_BISTCTL_PDMABIST_Pos (7) /*!< SYS_T::SRAM_BISTCTL: PDMABIST Position */ -#define SYS_SRAM_BISTCTL_PDMABIST_Msk (0x1ul << SYS_SRAM_BISTCTL_PDMABIST_Pos) /*!< SYS_T::SRAM_BISTCTL: PDMABIST Mask */ - -#define SYS_SRAM_BISTCTL_HSUSBDBIST_Pos (8) /*!< SYS_T::SRAM_BISTCTL: HSUSBDBIST Position*/ -#define SYS_SRAM_BISTCTL_HSUSBDBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_HSUSBDBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: HSUSBDBIST Mask */ - -#define SYS_SRAM_BISTCTL_HSUSBHBIST_Pos (9) /*!< SYS_T::SRAM_BISTCTL: HSUSBHBIST Position*/ -#define SYS_SRAM_BISTCTL_HSUSBHBIST_Msk (0x1ul << SYS_SRAM_BISTCTL_HSUSBHBIST_Pos) /*!< SYS_T::SRAM_BISTCTL: HSUSBHBIST Mask */ - -#define SYS_SRAM_BISTCTL_SRB0S0_Pos (16) /*!< SYS_T::SRAM_BISTCTL: SRB0S0 Position */ -#define SYS_SRAM_BISTCTL_SRB0S0_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB0S0_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB0S0 Mask */ - -#define SYS_SRAM_BISTCTL_SRB0S1_Pos (17) /*!< SYS_T::SRAM_BISTCTL: SRB0S1 Position */ -#define SYS_SRAM_BISTCTL_SRB0S1_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB0S1_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB0S1 Mask */ - -#define SYS_SRAM_BISTCTL_SRB1S0_Pos (18) /*!< SYS_T::SRAM_BISTCTL: SRB1S0 Position */ -#define SYS_SRAM_BISTCTL_SRB1S0_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB1S0_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB1S0 Mask */ - -#define SYS_SRAM_BISTCTL_SRB1S1_Pos (19) /*!< SYS_T::SRAM_BISTCTL: SRB1S1 Position */ -#define SYS_SRAM_BISTCTL_SRB1S1_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB1S1_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB1S1 Mask */ - -#define SYS_SRAM_BISTCTL_SRB1S2_Pos (20) /*!< SYS_T::SRAM_BISTCTL: SRB1S2 Position */ -#define SYS_SRAM_BISTCTL_SRB1S2_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB1S2_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB1S2 Mask */ - -#define SYS_SRAM_BISTCTL_SRB1S3_Pos (21) /*!< SYS_T::SRAM_BISTCTL: SRB1S3 Position */ -#define SYS_SRAM_BISTCTL_SRB1S3_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB1S3_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB1S3 Mask */ - -#define SYS_SRAM_BISTCTL_SRB1S4_Pos (22) /*!< SYS_T::SRAM_BISTCTL: SRB1S4 Position */ -#define SYS_SRAM_BISTCTL_SRB1S4_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB1S4_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB1S4 Mask */ - -#define SYS_SRAM_BISTCTL_SRB1S5_Pos (23) /*!< SYS_T::SRAM_BISTCTL: SRB1S5 Position */ -#define SYS_SRAM_BISTCTL_SRB1S5_Msk (0x1ul << SYS_SRAM_BISTCTL_SRB1S5_Pos) /*!< SYS_T::SRAM_BISTCTL: SRB1S5 Mask */ - -#define SYS_SRAM_BISTSTS_SRBISTEF0_Pos (0) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF0 Position*/ -#define SYS_SRAM_BISTSTS_SRBISTEF0_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBISTEF0_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF0 Mask */ - -#define SYS_SRAM_BISTSTS_SRBISTEF1_Pos (1) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF1 Position*/ -#define SYS_SRAM_BISTSTS_SRBISTEF1_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBISTEF1_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBISTEF1 Mask */ - -#define SYS_SRAM_BISTSTS_CRBISTEF_Pos (2) /*!< SYS_T::SRAM_BISTSTS: CRBISTEF Position */ -#define SYS_SRAM_BISTSTS_CRBISTEF_Msk (0x1ul << SYS_SRAM_BISTSTS_CRBISTEF_Pos) /*!< SYS_T::SRAM_BISTSTS: CRBISTEF Mask */ - -#define SYS_SRAM_BISTSTS_CANBEF_Pos (3) /*!< SYS_T::SRAM_BISTSTS: CANBEF Position */ -#define SYS_SRAM_BISTSTS_CANBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_CANBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: CANBEF Mask */ - -#define SYS_SRAM_BISTSTS_USBBEF_Pos (4) /*!< SYS_T::SRAM_BISTSTS: USBBEF Position */ -#define SYS_SRAM_BISTSTS_USBBEF_Msk (0x1ul << SYS_SRAM_BISTSTS_USBBEF_Pos) /*!< SYS_T::SRAM_BISTSTS: USBBEF Mask */ - -#define SYS_SRAM_BISTSTS_SRBEND0_Pos (16) /*!< SYS_T::SRAM_BISTSTS: SRBEND0 Position */ -#define SYS_SRAM_BISTSTS_SRBEND0_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBEND0_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBEND0 Mask */ - -#define SYS_SRAM_BISTSTS_SRBEND1_Pos (17) /*!< SYS_T::SRAM_BISTSTS: SRBEND1 Position */ -#define SYS_SRAM_BISTSTS_SRBEND1_Msk (0x1ul << SYS_SRAM_BISTSTS_SRBEND1_Pos) /*!< SYS_T::SRAM_BISTSTS: SRBEND1 Mask */ - -#define SYS_SRAM_BISTSTS_CRBEND_Pos (18) /*!< SYS_T::SRAM_BISTSTS: CRBEND Position */ -#define SYS_SRAM_BISTSTS_CRBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_CRBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: CRBEND Mask */ - -#define SYS_SRAM_BISTSTS_CANBEND_Pos (19) /*!< SYS_T::SRAM_BISTSTS: CANBEND Position */ -#define SYS_SRAM_BISTSTS_CANBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_CANBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: CANBEND Mask */ - -#define SYS_SRAM_BISTSTS_USBBEND_Pos (20) /*!< SYS_T::SRAM_BISTSTS: USBBEND Position */ -#define SYS_SRAM_BISTSTS_USBBEND_Msk (0x1ul << SYS_SRAM_BISTSTS_USBBEND_Pos) /*!< SYS_T::SRAM_BISTSTS: USBBEND Mask */ - -#define SYS_HIRCTCTL_FREQSEL_Pos (0) /*!< SYS_T::HIRCTCTL: FREQSEL Position */ -#define SYS_HIRCTCTL_FREQSEL_Msk (0x3ul << SYS_HIRCTCTL_FREQSEL_Pos) /*!< SYS_T::HIRCTCTL: FREQSEL Mask */ - -#define SYS_HIRCTCTL_LOOPSEL_Pos (4) /*!< SYS_T::HIRCTCTL: LOOPSEL Position */ -#define SYS_HIRCTCTL_LOOPSEL_Msk (0x3ul << SYS_HIRCTCTL_LOOPSEL_Pos) /*!< SYS_T::HIRCTCTL: LOOPSEL Mask */ - -#define SYS_HIRCTCTL_RETRYCNT_Pos (6) /*!< SYS_T::HIRCTCTL: RETRYCNT Position */ -#define SYS_HIRCTCTL_RETRYCNT_Msk (0x3ul << SYS_HIRCTCTL_RETRYCNT_Pos) /*!< SYS_T::HIRCTCTL: RETRYCNT Mask */ - -#define SYS_HIRCTCTL_CESTOPEN_Pos (8) /*!< SYS_T::HIRCTCTL: CESTOPEN Position */ -#define SYS_HIRCTCTL_CESTOPEN_Msk (0x1ul << SYS_HIRCTCTL_CESTOPEN_Pos) /*!< SYS_T::HIRCTCTL: CESTOPEN Mask */ - -#define SYS_HIRCTCTL_BOUNDEN_Pos (9) /*!< SYS_T::HIRCTCTL: BOUNDEN Position */ -#define SYS_HIRCTCTL_BOUNDEN_Msk (0x1ul << SYS_HIRCTCTL_BOUNDEN_Pos) /*!< SYS_T::HIRCTCTL: BOUNDEN Mask */ - -#define SYS_HIRCTCTL_REFCKSEL_Pos (10) /*!< SYS_T::HIRCTCTL: REFCKSEL Position */ -#define SYS_HIRCTCTL_REFCKSEL_Msk (0x1ul << SYS_HIRCTCTL_REFCKSEL_Pos) /*!< SYS_T::HIRCTCTL: REFCKSEL Mask */ - -#define SYS_HIRCTCTL_BOUNDARY_Pos (16) /*!< SYS_T::HIRCTCTL: BOUNDARY Position */ -#define SYS_HIRCTCTL_BOUNDARY_Msk (0x1ful << SYS_HIRCTCTL_BOUNDARY_Pos) /*!< SYS_T::HIRCTCTL: BOUNDARY Mask */ - -#define SYS_HIRCTIEN_TFAILIEN_Pos (1) /*!< SYS_T::HIRCTIEN: TFAILIEN Position */ -#define SYS_HIRCTIEN_TFAILIEN_Msk (0x1ul << SYS_HIRCTIEN_TFAILIEN_Pos) /*!< SYS_T::HIRCTIEN: TFAILIEN Mask */ - -#define SYS_HIRCTIEN_CLKEIEN_Pos (2) /*!< SYS_T::HIRCTIEN: CLKEIEN Position */ -#define SYS_HIRCTIEN_CLKEIEN_Msk (0x1ul << SYS_HIRCTIEN_CLKEIEN_Pos) /*!< SYS_T::HIRCTIEN: CLKEIEN Mask */ - -#define SYS_HIRCTISTS_FREQLOCK_Pos (0) /*!< SYS_T::HIRCTISTS: FREQLOCK Position */ -#define SYS_HIRCTISTS_FREQLOCK_Msk (0x1ul << SYS_HIRCTISTS_FREQLOCK_Pos) /*!< SYS_T::HIRCTISTS: FREQLOCK Mask */ - -#define SYS_HIRCTISTS_TFAILIF_Pos (1) /*!< SYS_T::HIRCTISTS: TFAILIF Position */ -#define SYS_HIRCTISTS_TFAILIF_Msk (0x1ul << SYS_HIRCTISTS_TFAILIF_Pos) /*!< SYS_T::HIRCTISTS: TFAILIF Mask */ - -#define SYS_HIRCTISTS_CLKERRIF_Pos (2) /*!< SYS_T::HIRCTISTS: CLKERRIF Position */ -#define SYS_HIRCTISTS_CLKERRIF_Msk (0x1ul << SYS_HIRCTISTS_CLKERRIF_Pos) /*!< SYS_T::HIRCTISTS: CLKERRIF Mask */ - -#define SYS_HIRCTISTS_OVBDIF_Pos (3) /*!< SYS_T::HIRCTISTS: OVBDIF Position */ -#define SYS_HIRCTISTS_OVBDIF_Msk (0x1ul << SYS_HIRCTISTS_OVBDIF_Pos) /*!< SYS_T::HIRCTISTS: OVBDIF Mask */ - -#define SYS_IRCTCTL_FREQSEL_Pos (0) /*!< SYS_T::IRCTCTL: FREQSEL Position */ -#define SYS_IRCTCTL_FREQSEL_Msk (0x3ul << SYS_IRCTCTL_FREQSEL_Pos) /*!< SYS_T::IRCTCTL: FREQSEL Mask */ - -#define SYS_IRCTCTL_LOOPSEL_Pos (4) /*!< SYS_T::IRCTCTL: LOOPSEL Position */ -#define SYS_IRCTCTL_LOOPSEL_Msk (0x3ul << SYS_IRCTCTL_LOOPSEL_Pos) /*!< SYS_T::IRCTCTL: LOOPSEL Mask */ - -#define SYS_IRCTCTL_RETRYCNT_Pos (6) /*!< SYS_T::IRCTCTL: RETRYCNT Position */ -#define SYS_IRCTCTL_RETRYCNT_Msk (0x3ul << SYS_IRCTCTL_RETRYCNT_Pos) /*!< SYS_T::IRCTCTL: RETRYCNT Mask */ - -#define SYS_IRCTCTL_CESTOPEN_Pos (8) /*!< SYS_T::IRCTCTL: CESTOPEN Position */ -#define SYS_IRCTCTL_CESTOPEN_Msk (0x1ul << SYS_IRCTCTL_CESTOPEN_Pos) /*!< SYS_T::IRCTCTL: CESTOPEN Mask */ - -#define SYS_IRCTCTL_REFCKSEL_Pos (10) /*!< SYS_T::IRCTCTL: REFCKSEL Position */ -#define SYS_IRCTCTL_REFCKSEL_Msk (0x1ul << SYS_IRCTCTL_REFCKSEL_Pos) /*!< SYS_T::IRCTCTL: REFCKSEL Mask */ - -#define SYS_IRCTIEN_TFAILIEN_Pos (1) /*!< SYS_T::IRCTIEN: TFAILIEN Position */ -#define SYS_IRCTIEN_TFAILIEN_Msk (0x1ul << SYS_IRCTIEN_TFAILIEN_Pos) /*!< SYS_T::IRCTIEN: TFAILIEN Mask */ - -#define SYS_IRCTIEN_CLKEIEN_Pos (2) /*!< SYS_T::IRCTIEN: CLKEIEN Position */ -#define SYS_IRCTIEN_CLKEIEN_Msk (0x1ul << SYS_IRCTIEN_CLKEIEN_Pos) /*!< SYS_T::IRCTIEN: CLKEIEN Mask */ - -#define SYS_IRCTISTS_FREQLOCK_Pos (0) /*!< SYS_T::IRCTISTS: FREQLOCK Position */ -#define SYS_IRCTISTS_FREQLOCK_Msk (0x1ul << SYS_IRCTISTS_FREQLOCK_Pos) /*!< SYS_T::IRCTISTS: FREQLOCK Mask */ - -#define SYS_IRCTISTS_TFAILIF_Pos (1) /*!< SYS_T::IRCTISTS: TFAILIF Position */ -#define SYS_IRCTISTS_TFAILIF_Msk (0x1ul << SYS_IRCTISTS_TFAILIF_Pos) /*!< SYS_T::IRCTISTS: TFAILIF Mask */ - -#define SYS_IRCTISTS_CLKERRIF_Pos (2) /*!< SYS_T::IRCTISTS: CLKERRIF Position */ -#define SYS_IRCTISTS_CLKERRIF_Msk (0x1ul << SYS_IRCTISTS_CLKERRIF_Pos) /*!< SYS_T::IRCTISTS: CLKERRIF Mask */ - -#define SYS_REGLCTL_REGLCTL_Pos (0) /*!< SYS_T::REGLCTL: REGLCTL Position */ -#define SYS_REGLCTL_REGLCTL_Msk (0x1ul << SYS_REGLCTL_REGLCTL_Pos) /*!< SYS_T::REGLCTL: REGLCTL Mask */ - -#define SYS_PORDISAN_POROFFAN_Pos (0) /*!< SYS_T::PORDISAN: POROFFAN Position */ -#define SYS_PORDISAN_POROFFAN_Msk (0xfffful << SYS_PORDISAN_POROFFAN_Pos) /*!< SYS_T::PORDISAN: POROFFAN Mask */ - -#define SYS_CSERVER_VERSION_Pos (0) /*!< SYS_T::CSERVER: VERSION Position */ -#define SYS_CSERVER_VERSION_Msk (0xfful << SYS_CSERVER_VERSION_Pos) /*!< SYS_T::CSERVER: VERSION Mask */ - -#define SYS_PLCTL_PLSEL_Pos (0) /*!< SYS_T::PLCTL: PLSEL Position */ -#define SYS_PLCTL_PLSEL_Msk (0x3ul << SYS_PLCTL_PLSEL_Pos) /*!< SYS_T::PLCTL: PLSEL Mask */ - -#define SYS_PLCTL_LVSSTEP_Pos (16) /*!< SYS_T::PLCTL: LVSSTEP Position */ -#define SYS_PLCTL_LVSSTEP_Msk (0x3ful << SYS_PLCTL_LVSSTEP_Pos) /*!< SYS_T::PLCTL: LVSSTEP Mask */ - -#define SYS_PLCTL_LVSPRD_Pos (24) /*!< SYS_T::PLCTL: LVSPRD Position */ -#define SYS_PLCTL_LVSPRD_Msk (0xfful << SYS_PLCTL_LVSPRD_Pos) /*!< SYS_T::PLCTL: LVSPRD Mask */ - -#define SYS_PLSTS_PLCBUSY_Pos (0) /*!< SYS_T::PLSTS: PLCBUSY Position */ -#define SYS_PLSTS_PLCBUSY_Msk (0x1ul << SYS_PLSTS_PLCBUSY_Pos) /*!< SYS_T::PLSTS: PLCBUSY Mask */ - -#define SYS_PLSTS_PLSTATUS_Pos (8) /*!< SYS_T::PLSTS: PLSTATUS Position */ -#define SYS_PLSTS_PLSTATUS_Msk (0x3ul << SYS_PLSTS_PLSTATUS_Pos) /*!< SYS_T::PLSTS: PLSTATUS Mask */ - -#define SYS_AHBMCTL_INTACTEN_Pos (0) /*!< SYS_T::AHBMCTL: INTACTEN Position */ -#define SYS_AHBMCTL_INTACTEN_Msk (0x1ul << SYS_AHBMCTL_INTACTEN_Pos) /*!< SYS_T::AHBMCTL: INTACTEN Mask */ - -/**@}*/ /* SYS_CONST */ -/**@}*/ /* end of SYS register group */ - -/** - @addtogroup NMI NMI Controller (NMI) - Memory Mapped Structure for NMI Controller -@{ */ - -typedef struct -{ - - - /** - * @var NMI_T::NMIEN - * Offset: 0x00 NMI Source Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD NMI Source Enable (Write Protect) - * | | |0 = BOD NMI source Disabled. - * | | |1 = BOD NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[1] |IRC_INT |IRC TRIM NMI Source Enable (Write Protect) - * | | |0 = IRC TRIM NMI source Disabled. - * | | |1 = IRC TRIM NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |PWRWU_INT |Power-down Mode Wake-up NMI Source Enable (Write Protect) - * | | |0 = Power-down mode wake-up NMI source Disabled. - * | | |1 = Power-down mode wake-up NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[3] |SRAM_PERR |SRAM Parity Check NMI Source Enable (Write Protect) - * | | |0 = SRAM parity check error NMI source Disabled. - * | | |1 = SRAM parity check error NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[4] |CLKFAIL |Clock Fail Detected and IRC Auto Trim Interrupt NMI Source Enable (Write Protect) - * | | |0 = Clock fail detected and IRC Auto Trim interrupt NMI source Disabled. - * | | |1 = Clock fail detected and IRC Auto Trim interrupt NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[6] |RTC_INT |RTC NMI Source Enable (Write Protect) - * | | |0 = RTC NMI source Disabled. - * | | |1 = RTC NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |TAMPER_INT|TAMPER_INT NMI Source Enable (Write Protect) - * | | |0 = Backup register tamper detected NMI source Disabled. - * | | |1 = Backup register tamper detected NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[8] |EINT0 |External Interrupt From PA.6 or PB.5 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.6 or PB.5 pin NMI source Disabled. - * | | |1 = External interrupt from PA.6 or PB.5 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[9] |EINT1 |External Interrupt From PA.7, PB.4 or PD.15 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.7, PB.4 or PD.15 pin NMI source Disabled. - * | | |1 = External interrupt from PA.7, PB.4 or PD.15 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[10] |EINT2 |External Interrupt From PB.3 or PC.6 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.3 or PC.6 pin NMI source Disabled. - * | | |1 = External interrupt from PB.3 or PC.6 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[11] |EINT3 |External Interrupt From PB.2 or PC.7 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.2 or PC.7 pin NMI source Disabled. - * | | |1 = External interrupt from PB.2 or PC.7 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[12] |EINT4 |External Interrupt From PA.8, PB.6 or PF.15 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PA.8, PB.6 or PF.15 pin NMI source Disabled. - * | | |1 = External interrupt from PA.8, PB.6 or PF.15 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[13] |EINT5 |External Interrupt From PB.7 or PF.14 Pin NMI Source Enable (Write Protect) - * | | |0 = External interrupt from PB.7 or PF.14 pin NMI source Disabled. - * | | |1 = External interrupt from PB.7 or PF.14 pin NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[14] |UART0_INT |UART0 NMI Source Enable (Write Protect) - * | | |0 = UART0 NMI source Disabled. - * | | |1 = UART0 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[15] |UART1_INT |UART1 NMI Source Enable (Write Protect) - * | | |0 = UART1 NMI source Disabled. - * | | |1 = UART1 NMI source Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var NMI_T::NMISTS - * Offset: 0x04 NMI Source Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BODOUT |BOD Interrupt Flag (Read Only) - * | | |0 = BOD interrupt is deasserted. - * | | |1 = BOD interrupt is asserted. - * |[1] |IRC_INT |IRC TRIM Interrupt Flag (Read Only) - * | | |0 = HIRC TRIM interrupt is deasserted. - * | | |1 = HIRC TRIM interrupt is asserted. - * |[2] |PWRWU_INT |Power-down Mode Wake-up Interrupt Flag (Read Only) - * | | |0 = Power-down mode wake-up interrupt is deasserted. - * | | |1 = Power-down mode wake-up interrupt is asserted. - * |[3] |SRAM_PERR |SRAM ParityCheck Error Interrupt Flag (Read Only) - * | | |0 = SRAM parity check error interrupt is deasserted. - * | | |1 = SRAM parity check error interrupt is asserted. - * |[4] |CLKFAIL |Clock Fail Detected or IRC Auto Trim Interrupt Flag (Read Only) - * | | |0 = Clock fail detected or IRC Auto Trim interrupt is deasserted. - * | | |1 = Clock fail detected or IRC Auto Trim interrupt is asserted. - * |[6] |RTC_INT |RTC Interrupt Flag (Read Only) - * | | |0 = RTC interrupt is deasserted. - * | | |1 = RTC interrupt is asserted. - * |[7] |TAMPER_INT|TAMPER_INT Interrupt Flag (Read Only) - * | | |0 = Backup register tamper detected interrupt is deasserted. - * | | |1 = Backup register tamper detected interrupt is asserted. - * |[8] |EINT0 |External Interrupt From PA.6 or PB.5 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.6 or PB.5 interrupt is deasserted. - * | | |1 = External Interrupt from PA.6 or PB.5 interrupt is asserted. - * |[9] |EINT1 |External Interrupt From PA.7, PB.4 or PD.15 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.7, PB.4 or PD.15 interrupt is deasserted. - * | | |1 = External Interrupt from PA.7, PB.4 or PD.15 interrupt is asserted. - * |[10] |EINT2 |External Interrupt From PB.3 or PC.6 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.3 or PC.6 interrupt is deasserted. - * | | |1 = External Interrupt from PB.3 or PC.6 interrupt is asserted. - * |[11] |EINT3 |External Interrupt From PB.2 or PC.7 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.2 or PC.7 interrupt is deasserted. - * | | |1 = External Interrupt from PB.2 or PC.7 interrupt is asserted. - * |[12] |EINT4 |External Interrupt From PA.8, PB.6 or PF.15 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PA.8, PB.6 or PF.15 interrupt is deasserted. - * | | |1 = External Interrupt from PA.8, PB.6 or PF.15 interrupt is asserted. - * |[13] |EINT5 |External Interrupt From PB.7 or PF.14 Pin Interrupt Flag (Read Only) - * | | |0 = External Interrupt from PB.7 or PF.14 interrupt is deasserted. - * | | |1 = External Interrupt from PB.7 or PF.14 interrupt is asserted. - * |[14] |UART0_INT |UART0 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is deasserted. - * | | |1 = UART1 interrupt is asserted. - * |[15] |UART1_INT |UART1 Interrupt Flag (Read Only) - * | | |0 = UART1 interrupt is deasserted. - * | | |1 = UART1 interrupt is asserted. - */ - __IO uint32_t NMIEN; /*!< [0x0000] NMI Source Interrupt Enable Register */ - __I uint32_t NMISTS; /*!< [0x0004] NMI Source Interrupt Status Register */ - -} NMI_T; - -/** - @addtogroup NMI_CONST NMI Bit Field Definition - Constant Definitions for NMI Controller -@{ */ - -#define NMI_NMIEN_BODOUT_Pos (0) /*!< NMI_T::NMIEN: BODOUT Position */ -#define NMI_NMIEN_BODOUT_Msk (0x1ul << NMI_NMIEN_BODOUT_Pos) /*!< NMI_T::NMIEN: BODOUT Mask */ - -#define NMI_NMIEN_IRC_INT_Pos (1) /*!< NMI_T::NMIEN: IRC_INT Position */ -#define NMI_NMIEN_IRC_INT_Msk (0x1ul << NMI_NMIEN_IRC_INT_Pos) /*!< NMI_T::NMIEN: IRC_INT Mask */ - -#define NMI_NMIEN_PWRWU_INT_Pos (2) /*!< NMI_T::NMIEN: PWRWU_INT Position */ -#define NMI_NMIEN_PWRWU_INT_Msk (0x1ul << NMI_NMIEN_PWRWU_INT_Pos) /*!< NMI_T::NMIEN: PWRWU_INT Mask */ - -#define NMI_NMIEN_SRAM_PERR_Pos (3) /*!< NMI_T::NMIEN: SRAM_PERR Position */ -#define NMI_NMIEN_SRAM_PERR_Msk (0x1ul << NMI_NMIEN_SRAM_PERR_Pos) /*!< NMI_T::NMIEN: SRAM_PERR Mask */ - -#define NMI_NMIEN_CLKFAIL_Pos (4) /*!< NMI_T::NMIEN: CLKFAIL Position */ -#define NMI_NMIEN_CLKFAIL_Msk (0x1ul << NMI_NMIEN_CLKFAIL_Pos) /*!< NMI_T::NMIEN: CLKFAIL Mask */ - -#define NMI_NMIEN_RTC_INT_Pos (6) /*!< NMI_T::NMIEN: RTC_INT Position */ -#define NMI_NMIEN_RTC_INT_Msk (0x1ul << NMI_NMIEN_RTC_INT_Pos) /*!< NMI_T::NMIEN: RTC_INT Mask */ - -#define NMI_NMIEN_TAMPER_INT_Pos (7) /*!< NMI_T::NMIEN: TAMPER_INT Position */ -#define NMI_NMIEN_TAMPER_INT_Msk (0x1ul << NMI_NMIEN_TAMPER_INT_Pos) /*!< NMI_T::NMIEN: TAMPER_INT Mask */ - -#define NMI_NMIEN_EINT0_Pos (8) /*!< NMI_T::NMIEN: EINT0 Position */ -#define NMI_NMIEN_EINT0_Msk (0x1ul << NMI_NMIEN_EINT0_Pos) /*!< NMI_T::NMIEN: EINT0 Mask */ - -#define NMI_NMIEN_EINT1_Pos (9) /*!< NMI_T::NMIEN: EINT1 Position */ -#define NMI_NMIEN_EINT1_Msk (0x1ul << NMI_NMIEN_EINT1_Pos) /*!< NMI_T::NMIEN: EINT1 Mask */ - -#define NMI_NMIEN_EINT2_Pos (10) /*!< NMI_T::NMIEN: EINT2 Position */ -#define NMI_NMIEN_EINT2_Msk (0x1ul << NMI_NMIEN_EINT2_Pos) /*!< NMI_T::NMIEN: EINT2 Mask */ - -#define NMI_NMIEN_EINT3_Pos (11) /*!< NMI_T::NMIEN: EINT3 Position */ -#define NMI_NMIEN_EINT3_Msk (0x1ul << NMI_NMIEN_EINT3_Pos) /*!< NMI_T::NMIEN: EINT3 Mask */ - -#define NMI_NMIEN_EINT4_Pos (12) /*!< NMI_T::NMIEN: EINT4 Position */ -#define NMI_NMIEN_EINT4_Msk (0x1ul << NMI_NMIEN_EINT4_Pos) /*!< NMI_T::NMIEN: EINT4 Mask */ - -#define NMI_NMIEN_EINT5_Pos (13) /*!< NMI_T::NMIEN: EINT5 Position */ -#define NMI_NMIEN_EINT5_Msk (0x1ul << NMI_NMIEN_EINT5_Pos) /*!< NMI_T::NMIEN: EINT5 Mask */ - -#define NMI_NMIEN_UART0_INT_Pos (14) /*!< NMI_T::NMIEN: UART0_INT Position */ -#define NMI_NMIEN_UART0_INT_Msk (0x1ul << NMI_NMIEN_UART0_INT_Pos) /*!< NMI_T::NMIEN: UART0_INT Mask */ - -#define NMI_NMIEN_UART1_INT_Pos (15) /*!< NMI_T::NMIEN: UART1_INT Position */ -#define NMI_NMIEN_UART1_INT_Msk (0x1ul << NMI_NMIEN_UART1_INT_Pos) /*!< NMI_T::NMIEN: UART1_INT Mask */ - -#define NMI_NMISTS_BODOUT_Pos (0) /*!< NMI_T::NMISTS: BODOUT Position */ -#define NMI_NMISTS_BODOUT_Msk (0x1ul << NMI_NMISTS_BODOUT_Pos) /*!< NMI_T::NMISTS: BODOUT Mask */ - -#define NMI_NMISTS_IRC_INT_Pos (1) /*!< NMI_T::NMISTS: IRC_INT Position */ -#define NMI_NMISTS_IRC_INT_Msk (0x1ul << NMI_NMISTS_IRC_INT_Pos) /*!< NMI_T::NMISTS: IRC_INT Mask */ - -#define NMI_NMISTS_PWRWU_INT_Pos (2) /*!< NMI_T::NMISTS: PWRWU_INT Position */ -#define NMI_NMISTS_PWRWU_INT_Msk (0x1ul << NMI_NMISTS_PWRWU_INT_Pos) /*!< NMI_T::NMISTS: PWRWU_INT Mask */ - -#define NMI_NMISTS_SRAM_PERR_Pos (3) /*!< NMI_T::NMISTS: SRAM_PERR Position */ -#define NMI_NMISTS_SRAM_PERR_Msk (0x1ul << NMI_NMISTS_SRAM_PERR_Pos) /*!< NMI_T::NMISTS: SRAM_PERR Mask */ - -#define NMI_NMISTS_CLKFAIL_Pos (4) /*!< NMI_T::NMISTS: CLKFAIL Position */ -#define NMI_NMISTS_CLKFAIL_Msk (0x1ul << NMI_NMISTS_CLKFAIL_Pos) /*!< NMI_T::NMISTS: CLKFAIL Mask */ - -#define NMI_NMISTS_RTC_INT_Pos (6) /*!< NMI_T::NMISTS: RTC_INT Position */ -#define NMI_NMISTS_RTC_INT_Msk (0x1ul << NMI_NMISTS_RTC_INT_Pos) /*!< NMI_T::NMISTS: RTC_INT Mask */ - -#define NMI_NMISTS_TAMPER_INT_Pos (7) /*!< NMI_T::NMISTS: TAMPER_INT Position */ -#define NMI_NMISTS_TAMPER_INT_Msk (0x1ul << NMI_NMISTS_TAMPER_INT_Pos) /*!< NMI_T::NMISTS: TAMPER_INT Mask */ - -#define NMI_NMISTS_EINT0_Pos (8) /*!< NMI_T::NMISTS: EINT0 Position */ -#define NMI_NMISTS_EINT0_Msk (0x1ul << NMI_NMISTS_EINT0_Pos) /*!< NMI_T::NMISTS: EINT0 Mask */ - -#define NMI_NMISTS_EINT1_Pos (9) /*!< NMI_T::NMISTS: EINT1 Position */ -#define NMI_NMISTS_EINT1_Msk (0x1ul << NMI_NMISTS_EINT1_Pos) /*!< NMI_T::NMISTS: EINT1 Mask */ - -#define NMI_NMISTS_EINT2_Pos (10) /*!< NMI_T::NMISTS: EINT2 Position */ -#define NMI_NMISTS_EINT2_Msk (0x1ul << NMI_NMISTS_EINT2_Pos) /*!< NMI_T::NMISTS: EINT2 Mask */ - -#define NMI_NMISTS_EINT3_Pos (11) /*!< NMI_T::NMISTS: EINT3 Position */ -#define NMI_NMISTS_EINT3_Msk (0x1ul << NMI_NMISTS_EINT3_Pos) /*!< NMI_T::NMISTS: EINT3 Mask */ - -#define NMI_NMISTS_EINT4_Pos (12) /*!< NMI_T::NMISTS: EINT4 Position */ -#define NMI_NMISTS_EINT4_Msk (0x1ul << NMI_NMISTS_EINT4_Pos) /*!< NMI_T::NMISTS: EINT4 Mask */ - -#define NMI_NMISTS_EINT5_Pos (13) /*!< NMI_T::NMISTS: EINT5 Position */ -#define NMI_NMISTS_EINT5_Msk (0x1ul << NMI_NMISTS_EINT5_Pos) /*!< NMI_T::NMISTS: EINT5 Mask */ - -#define NMI_NMISTS_UART0_INT_Pos (14) /*!< NMI_T::NMISTS: UART0_INT Position */ -#define NMI_NMISTS_UART0_INT_Msk (0x1ul << NMI_NMISTS_UART0_INT_Pos) /*!< NMI_T::NMISTS: UART0_INT Mask */ - -#define NMI_NMISTS_UART1_INT_Pos (15) /*!< NMI_T::NMISTS: UART1_INT Position */ -#define NMI_NMISTS_UART1_INT_Msk (0x1ul << NMI_NMISTS_UART1_INT_Pos) /*!< NMI_T::NMISTS: UART1_INT Mask */ - -/**@}*/ /* NMI_CONST */ -/**@}*/ /* end of NMI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SYS_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/system_M480.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/system_M480.h deleted file mode 100644 index fe12ac2f5fe..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/system_M480.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************//** - * @file system_M480.h - * @version V1.00 - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File for M480 - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __SYSTEM_M480_H__ -#define __SYSTEM_M480_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - -/*---------------------------------------------------------------------------- - Define clocks - *----------------------------------------------------------------------------*/ - -#ifndef __HSI -#define __HSI (12000000UL) /*!< PLL default output is 50MHz */ -#endif - -#ifndef __HXT -#define __HXT (12000000UL) /*!< External Crystal Clock Frequency */ -#endif - -#ifndef __LXT -#define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */ -#endif - -#define __HIRC (12000000UL) /*!< Internal 12M RC Oscillator Frequency */ -#define __LIRC (10000UL) /*!< Internal 10K RC Oscillator Frequency */ -#define __SYS_OSC_CLK ( ___HSI) /* Main oscillator frequency */ - - -#define __SYSTEM_CLOCK (1UL*__HXT) - -extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ -extern uint32_t CyclesPerUs; /*!< Cycles per micro second */ -extern uint32_t PllClock; /*!< PLL Output Clock Frequency */ - - -/** - * Initialize the system - * - * @param none - * @return none - * - * @brief Setup the micro controller system. - * Initialize the System and update the SystemCoreClock variable. - */ -extern void SystemInit (void); - -/** - * Update SystemCoreClock variable - * - * @param none - * @return none - * - * @brief Updates the SystemCoreClock with current core Clock - * retrieved from cpu registers. - */ -extern void SystemCoreClockUpdate (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __SYSTEM_M480_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/timer_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/timer_reg.h deleted file mode 100644 index 7c3b4acdac6..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/timer_reg.h +++ /dev/null @@ -1,1094 +0,0 @@ -/**************************************************************************//** - * @file timer_reg.h - * @version V1.00 - * @brief TIMER register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TIMER_REG_H__ -#define __TIMER_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup TIMER Timer Controller(TIMER) - Memory Mapped Structure for TIMER Controller -@{ */ - -typedef struct -{ - - - /** - * @var TIMER_T::CTL - * Offset: 0x00 Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PSC |Prescale Counter - * | | |Timer input clock or event source is divided by (PSC+1) before it is fed to the timer up counter - * | | |If this field is 0 (PSC = 0), then there is no scaling. - * | | |Note: Update prescale counter value will reset internal 8-bit prescale counter and 24-bit up counter value. - * |[19] |INTRGEN |Inter-timer Trigger Mode Enable Control - * | | |Setting this bit will enable the inter-timer trigger capture function. - * | | |The Timer0/2 will be in event counter mode and counting with external clock source or event - * | | |Also, Timer1/3 will be in trigger-counting mode of capture function. - * | | |0 = Inter-Timer Trigger Capture mode Disabled. - * | | |1 = Inter-Timer Trigger Capture mode Enabled. - * | | |Note: For Timer1/3, this bit is ignored and the read back value is always 0. - * |[20] |PERIOSEL |Periodic Mode Behavior Selection Enable Bit - * | | |0 = The behavior selection in periodic mode is Disabled. - * | | |When user updates CMPDAT while timer is running in periodic mode, - * | | |CNT will be reset to default value. - * | | |1 = The behavior selection in periodic mode is Enabled. - * | | |When user update CMPDAT while timer is running in periodic mode, the limitations as bellows list, - * | | |If updated CMPDAT value > CNT, CMPDAT will be updated and CNT keep running continually. - * | | |If updated CMPDAT value = CNT, timer time-out interrupt will be asserted immediately. - * | | |If updated CMPDAT value < CNT, CNT will be reset to default value. - * |[21] |TGLPINSEL |Toggle-output Pin Select - * | | |0 = Toggle mode output to TMx (Timer Event Counter Pin). - * | | |1 = Toggle mode output to TMx_EXT (Timer External Capture Pin). - * |[22] |CAPSRC |Capture Pin Source Selection - * | | |0 = Capture Function source is from TMx_EXT (x= 0~3) pin. - * | | |1 = Capture Function source is from internal ACMP output signal - * | | |User can set ACMPSSEL (TIMERx_EXTCTL[8]) to decide which internal ACMP output signal as timer capture source. - * |[23] |WKEN |Wake-up Function Enable Bit - * | | |If this bit is set to 1, while timer interrupt flag TIF (TIMERx_INTSTS[0]) is 1 and INTEN (TIMERx_CTL[29]) is enabled, the timer interrupt signal will generate a wake-up trigger event to CPU. - * | | |0 = Wake-up function Disabled if timer interrupt signal generated. - * | | |1 = Wake-up function Enabled if timer interrupt signal generated. - * |[24] |EXTCNTEN |Event Counter Mode Enable Bit - * | | |This bit is for external counting pin function enabled. - * | | |0 = Event counter mode Disabled. - * | | |1 = Event counter mode Enabled. - * | | |Note: When timer is used as an event counter, this bit should be set to 1 and select PCLK as timer clock source. - * |[25] |ACTSTS |Timer Active Status Bit (Read Only) - * | | |This bit indicates the 24-bit up counter status. - * | | |0 = 24-bit up counter is not active. - * | | |1 = 24-bit up counter is active. - * | | |Note: This bit may active when CNT 0 transition to CNT 1. - * |[28:27] |OPMODE |Timer Counting Mode Select - * | | |00 = The Timer controller is operated in One-shot mode. - * | | |01 = The Timer controller is operated in Periodic mode. - * | | |10 = The Timer controller is operated in Toggle-output mode. - * | | |11 = The Timer controller is operated in Continuous Counting mode. - * |[29] |INTEN |Timer Interrupt Enable Bit - * | | |0 = Timer time-out interrupt Disabled. - * | | |1 = Timer time-out interrupt Enabled. - * | | |Note: If this bit is enabled, when the timer time-out interrupt flag TIF is set to 1, the timer interrupt signal is generated and inform to CPU. - * |[30] |CNTEN |Timer Counting Enable Bit - * | | |0 = Stops/Suspends counting. - * | | |1 = Starts counting. - * | | |Note1: In stop status, and then set CNTEN to 1 will enable the 24-bit up counter to keep counting from the last stop counting value. - * | | |Note2: This bit is auto-cleared by hardware in one-shot mode (TIMER_CTL[28:27] = 00) when the timer time-out interrupt flag TIF (TIMERx_INTSTS[0]) is generated. - * | | |Note3: Set enable/disable this bit needs 2 * TMR_CLK period to become active, user can read ACTSTS (TIMERx_CTL[25]) to check enable/disable command is completed or not. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects TIMER counting. - * | | |TIMER counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |TIMER counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var TIMER_T::CMP - * Offset: 0x04 Timer Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CMPDAT |Timer Comparator Value - * | | |CMPDAT is a 24-bit compared value register - * | | |When the internal 24-bit up counter value is equal to CMPDAT value, the TIF (TIMERx_INTSTS[0] Timer Interrupt Flag) will set to 1. - * | | |Time-out period = (Period of timer clock input) * (8-bit PSC + 1) * (24-bit CMPDAT). - * | | |Note1: Never write 0x0 or 0x1 in CMPDAT field, or the core will run into unknown state. - * | | |Note2: When timer is operating at continuous counting mode, the 24-bit up counter will keep counting continuously even if user writes a new value into CMPDAT field - * | | |But if timer is operating at other modes, the 24-bit up counter will restart counting from 0 and using newest CMPDAT value to be the timer compared value while user writes a new value into CMPDAT field. - * @var TIMER_T::INTSTS - * Offset: 0x08 Timer Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TIF |Timer Interrupt Flag - * | | |This bit indicates the interrupt flag status of Timer while 24-bit timer up counter CNT (TIMERx_CNT[23:0]) value reaches to CMPDAT (TIMERx_CMP[23:0]) value. - * | | |0 = No effect. - * | | |1 = CNT value matches the CMPDAT value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |TWKF |Timer Wake-up Flag - * | | |This bit indicates the interrupt wake-up flag status of timer. - * | | |0 = Timer does not cause CPU wake-up. - * | | |1 = CPU wake-up from Idle or Power-down mode if timer time-out interrupt signal generated. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::CNT - * Offset: 0x0C Timer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Timer Data Register - * | | |Read operation. - * | | |Read this register to get CNT value. For example: - * | | |If EXTCNTEN (TIMERx_CTL[24] ) is 0, user can read CNT value for getting current 24-bit counter value. - * | | |If EXTCNTEN (TIMERx_CTL[24] ) is 1, user can read CNT value for getting current 24-bit event input counter value. - * | | |Write operation. - * | | |Writing any value to this register will reset current CNT value to 0 and reload internal 8-bit prescale counter. - * |[31] |RSTACT |Timer Data Register Reset Active (Read Only) - * | | |This bit indicates if the counter reset operation active. - * | | |When user writes this CNT register, timer starts to reset its internal 24-bit timer up-counter to 0 and reload 8-bit pre-scale counter - * | | |At the same time, timer set this flag to 1 to indicate the counter reset operation is in progress - * | | |Once the counter reset operation done, timer clear this bit to 0 automatically. - * | | |0 = Reset operation is done. - * | | |1 = Reset operation triggered by writing TIMERx_CNT is in progress. - * | | |Note: This bit is read only. - * @var TIMER_T::CAP - * Offset: 0x10 Timer Capture Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CAPDAT |Timer Capture Data Register - * | | |When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT pin matched the CAPEDGE (TIMERx_EXTCTL[14:12]) setting, CAPIF (TIMERx_EINTSTS[0]) will set to 1 and the current timer counter value CNT (TIMERx_CNT[23:0]) will be auto-loaded into this CAPDAT field. - * @var TIMER_T::EXTCTL - * Offset: 0x14 Timer External Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTPHASE |Timer External Count Phase - * | | |This bit indicates the detection phase of external counting pin TMx (x= 0~3). - * | | |0 = A falling edge of external counting pin will be counted. - * | | |1 = A rising edge of external counting pin will be counted. - * |[3] |CAPEN |Timer External Capture Pin Enable Bit - * | | |This bit enables the TMx_EXT capture pin input function. - * | | |0 =TMx_EXT (x= 0~3) pin Disabled. - * | | |1 =TMx_EXT (x= 0~3) pin Enabled. - * |[4] |CAPFUNCS |Capture Function Selection - * | | |0 = External Capture Mode Enabled. - * | | |1 = External Reset Mode Enabled. - * | | |Note1: When CAPFUNCS is 0, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field. - * | | |Note2: When CAPFUNCS is 1, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field then CNT value will be reset immediately. - * |[5] |CAPIEN |Timer External Capture Interrupt Enable Bit - * | | |0 = TMx_EXT (x= 0~3) pin detection Interrupt Disabled. - * | | |1 = TMx_EXT (x= 0~3) pin detection Interrupt Enabled. - * | | |Note: CAPIEN is used to enable timer external interrupt - * | | |If CAPIEN enabled, timer will rise an interrupt when CAPIF (TIMERx_EINTSTS[0]) is 1. - * | | |For example, while CAPIEN = 1, CAPEN = 1, and CAPEDGE = 00, a 1 to 0 transition on the TMx_EXT pin will cause the CAPIF to be set then the interrupt signal is generated and sent to NVIC to inform CPU. - * |[6] |CAPDBEN |Timer External Capture Pin De-bounce Enable Bit - * | | |0 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Disabled. - * | | |1 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx_EXT pin or ACMP output is detected with de-bounce circuit. - * |[7] |CNTDBEN |Timer Counter Pin De-bounce Enable Bit - * | | |0 = TMx (x= 0~3) pin de-bounce Disabled. - * | | |1 = TMx (x= 0~3) pin de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx pin is detected with de-bounce circuit. - * |[8:10] |ICAPSEL |Internal Capture Source Select - * | | |000 = Capture Function source is from internal ACMP0 output signal. - * | | |001 = Capture Function source is from internal ACMP1 output signal. - * | | |010 = Capture Function source is from HXT. - * | | |011 = Capture Function source is from LXT. - * | | |100 = Capture Function source is from HIRC. - * | | |101 = Capture Function source is from LIRC. - * | | |110 = Reserved. - * | | |111 = Reserved. - * | | |Note: these bits only available when CAPSRC (TIMERx_CTL[22]) is 1. - * |[14:12] |CAPEDGE |Timer External Capture Pin Edge Detect - * | | |When first capture event is generated, the CNT (TIMERx_CNT[23:0]) will be reset to 0 and first CAPDAT (TIMERx_CAP[23:0]) should be to 0. - * | | |000 = Capture event occurred when detect falling edge transfer on TMx_EXT (x= 0~3) pin. - * | | |001 = Capture event occurred when detect rising edge transfer on TMx_EXT (x= 0~3) pin. - * | | |010 = Capture event occurred when detect both falling and rising edge transfer on TMx_EXT (x= 0~3) pin, and first capture event occurred at falling edge transfer. - * | | |011 = Capture event occurred when detect both rising and falling edge transfer on TMx_EXT (x= 0~3) pin, and first capture event occurred at rising edge transfer.. - * | | |110 = First capture event occurred at falling edge, follows capture events are at rising edge transfer on TMx_EXT (x= 0~3) pin. - * | | |111 = First capture event occurred at rising edge, follows capture events are at falling edge transfer on TMx_EXT (x= 0~3) pin. - * | | |100, 101 = Reserved. - * |[16] |ECNTSSEL |Event Counter Source Selection to Trigger Event Counter Function - * | | |0 = Event Counter input source is from TMx (x= 0~3) pin. - * | | |1 = Event Counter input source is from USB internal SOF output signal. - * |[31:28] |CAPDIVSCL |Timer Capture Source Divider - * | | |This bits indicate the divide scale for capture source divider - * | | |0000 = Capture source/1. - * | | |0001 = Capture source/2. - * | | |0010 = Capture source/4. - * | | |0011 = Capture source/8. - * | | |0100 = Capture source/16. - * | | |0101 = Capture source/32. - * | | |0110 = Capture source/64. - * | | |0111 = Capture source/128. - * | | |1000 = Capture source/256. - * | | |1001~1111 = Reserved. - * | | |Note: Sets INTERCAPSEL (TIMERx_EXTCTL[10:8]) and CAPSRC (TIMERx_CTL[22]) to select capture source. * @var TIMER_T::EINTSTS - * Offset: 0x18 Timer External Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPIF |Timer External Capture Interrupt Flag - * | | |This bit indicates the timer external capture interrupt flag status. - * | | |0 = TMx_EXT (x= 0~3) pin interrupt did not occur. - * | | |1 = TMx_EXT (x= 0~3) pin interrupt occurred. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT (x= 0~3) pin matched the CAPEDGE (TIMERx_EXTCTL[2:1]) setting, this bit will set to 1 by hardware. - * | | |Note3: There is a new incoming capture event detected before CPU clearing the CAPIF status - * | | |If the above condition occurred, the Timer will keep register TIMERx_CAP unchanged and drop the new capture value. - * @var TIMER_T::TRGCTL - * Offset: 0x1C Timer Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRGSSEL |Trigger Source Select Bit - * | | |This bit is used to select internal trigger source is form timer time-out interrupt signal or - * | | |capture interrupt signal. - * | | |0 = Time-out interrupt signal is used to internal trigger EPWM, BPWM, PDMA, DAC, and EADC. - * | | |1 = Capture interrupt signal is used to internal trigger EPWM, BPWM, PDMA, DAC, and EADC. - * |[1] |TRGEPWM |Trigger EPWM and BPWM Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be as EPWM and BPWM counter clock source. - * | | |0 = Timer interrupt trigger EPWM and BPWM Disabled. - * | | |1 = Timer interrupt trigger EPWM and BPWM Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal as EPWM and BPWM counter clock source. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal as EPWM counter clock source. - * |[2] |TRGEADC |Trigger EADC Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered EADC conversion. - * | | |0 = Timer interrupt trigger EADC Disabled. - * | | |1 = Timer interrupt trigger EADC Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger EADC conversion. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger EADC conversion. - * |[3] |TRGDAC |Trigger DAC Enable Bit - * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can be triggered DAC. - * | | |0 = Timer interrupt trigger DAC Disabled. - * | | |1 = Timer interrupt trigger DAC Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger DAC. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger DAC. - * |[4] |TRGPDMA |Trigger PDMA Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered PDMA transfer. - * | | |0 = Timer interrupt trigger PDMA Disabled. - * | | |1 = Timer interrupt trigger PDMA Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger PDMA transfer. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger PDMA transfer. - * @var TIMER_T::ALTCTL - * Offset: 0x20 Timer Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FUNCSEL |Function Selection - * | | |0 = Timer controller is used as timer function. - * | | |1 = Timer controller is used as PWM function. - * | | |Note: When timer is used as PWM, the clock source of time controller will be forced to PCLKx automatically. - * @var TIMER_T::PWMCTL - * Offset: 0x40 Timer PWM Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN |PWM Counter Enable Bit - * | | |0 = PWM counter and clock prescale Stop Running. - * | | |1 = PWM counter and clock prescale Start Running. - * |[2:1] |CNTTYPE |PWM Counter Behavior Type - * | | |00 = Up count type. - * | | |01 = Down count type. - * | | |10 = Up-down count type. - * | | |11 = Reserved. - * |[3] |CNTMODE |PWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[8] |CTRLD |Center Re-load - * | | |In up-down count type, PERIOD will load to PBUF when current PWM period is completed always and CMP will load to CMPBUF at the center point of current period. - * |[9] |IMMLDEN |Immediately Load Enable Bit - * | | |0 = PERIOD will load to PBUF when current PWM period is completed no matter CTRLD is enabled/disabled - * | | |If CTRLD is disabled, CMP will load to CMPBUF when current PWM period is completed; if CTRLD is enabled in up-down count type, CMP will load to CMPBUF at the center point of current period. - * | | |1 = PERIOD/CMP will load to PBUF/CMPBUF immediately when user update PERIOD/CMP. - * | | |Note: If IMMLDEN is enabled, CTRLD will be invalid. - * |[16] |OUTMODE |PWM Output Mode - * | | |This bit controls the output mode of corresponding PWM channel. - * | | |0 = PWM independent mode. - * | | |1 = PWM complementary mode. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If debug mode counter halt is enabled, PWM counter will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt disable. - * | | |1 = ICE debug mode counter halt enable. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects PWM output. - * | | |PWM output pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |PWM output pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMCLKSRC - * Offset: 0x44 Timer PWM Counter Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |CLKSRC |PWM Counter Clock Source Select - * | | |The PWM counter clock source can be selected from TMRx_CLK or internal timer time-out or capture event. - * | | |000 = TMRx_CLK. - * | | |001 = Internal TIMER0 time-out or capture event. - * | | |010 = Internal TIMER1 time-out or capture event. - * | | |011 = Internal TIMER2 time-out or capture event. - * | | |100 = Internal TIMER3 time-out or capture event. - * | | |Others = Reserved. - * | | |Note: If TIMER0 PWM function is enabled, the PWM counter clock source can be selected from TMR0_CLK, TIMER1 interrupt events, TIMER2 interrupt events, or TIMER3 interrupt events. - * @var TIMER_T::PWMCLKPSC - * Offset: 0x48 Timer PWM Counter Clock Pre-scale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |PWM Counter Clock Pre-scale - * | | |The active clock of PWM counter is decided by counter clock prescale and divided by (CLKPSC + 1) - * | | |If CLKPSC is 0, then there is no scaling in PWM counter clock source. - * @var TIMER_T::PWMCNTCLR - * Offset: 0x4C Timer PWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR |Clear PWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit PWM counter to 0x10000 in up and up-down count type and reset counter value to PERIOD in down count type. - * @var TIMER_T::PWMPERIOD - * Offset: 0x50 Timer PWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |PWM Period Register - * | | |In up count type: PWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |In down count type: PWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |In up-down count type: PWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |In up and down count type: - * | | |PWM period time = (PERIOD + 1) * (CLKPSC + 1) * TMRx_PWMCLK. - * | | |In up-down count type: - * | | |PWM period time = 2 * PERIOD * (CLKPSC+ 1) * TMRx_PWMCLK. - * | | |Note: User should take care DIRF (TIMERx_PWMCNT[16]) bit in up/down/up-down count type to monitor current counter direction in each count type. - * @var TIMER_T::PWMCMPDAT - * Offset: 0x54 Timer PWM Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |PWM Comparator Register - * | | |PWM CMP is used to compare with PWM CNT to generate PWM output waveform, interrupt events and trigger ADC to start convert. - * @var TIMER_T::PWMDTCTL - * Offset: 0x58 Timer PWM Dead-Time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following two formulas: - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK, if DTCKSEL is 0. - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK * (CLKPSC + 1), if DTCKSEL is 1. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[16] |DTEN |Enable Dead-time Insertion for PWMx_CH0 and PWMx_CH1 (Write Protect) - * | | |Dead-time insertion function is only active when PWM complementary mode is enabled - * | | |If dead- time insertion is inactive, the outputs of PWMx_CH0 and PWMx_CH1 are complementary without any delay. - * | | |0 = Dead-time insertion Disabled on the pin pair. - * | | |1 = Dead-time insertion Enabled on the pin pair. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from TMRx_PWMCLK without counter clock prescale. - * | | |1 = Dead-time clock source from TMRx_PWMCLK with counter clock prescale. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMCNT - * Offset: 0x5C Timer PWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |PWM Counter Value Register (Read Only) - * | | |User can monitor CNT to know the current counter value in 16-bit period counter. - * |[16] |DIRF |PWM Counter Direction Indicator Flag (Read Only) - * | | |0 = Counter is active in down count. - * | | |1 = Counter is active up count. - * @var TIMER_T::PWMMSKEN - * Offset: 0x60 Timer PWM Output Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |PWMx_CH0 Output Mask Enable Bit - * | | |The PWMx_CH0 output signal will be masked when this bit is enabled - * | | |The PWMx_CH0 will output MSKDAT0 (TIMER_PWMMSK[0]) data. - * | | |0 = PWMx_CH0 output signal is non-masked. - * | | |1 = PWMx_CH0 output signal is masked and output MSKDAT0 data. - * |[1] |MSKEN1 |PWMx_CH1 Output Mask Enable Bit - * | | |The PWMx_CH1 output signal will be masked when this bit is enabled - * | | |The PWMx_CH1 will output MSKDAT1 (TIMER_PWMMSK[1]) data. - * | | |0 = PWMx_CH1 output signal is non-masked. - * | | |1 = PWMx_CH1 output signal is masked and output MSKDAT1 data. - * @var TIMER_T::PWMMSK - * Offset: 0x64 Timer PWM Output Mask Data Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |PWMx_CH0 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH0 pin when PWMx_CH0 output mask function is enabled (MSKEN0 = 1). - * | | |0 = Output logic Low to PWMx_CH0. - * | | |1 = Output logic High to PWMx_CH0. - * |[1] |MSKDAT1 |PWMx_CH1 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH1 pin when PWMx_CH1 output mask function is enabled (MSKEN1 = 1). - * | | |0 = Output logic Low to PWMx_CH1. - * | | |1 = Output logic High to PWMx_CH1. - * @var TIMER_T::PWMBNF - * Offset: 0x68 Timer PWM Brake Pin Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKNFEN |Brake Pin Noise Filter Enable Bit - * | | |0 = Pin noise filter detect of PWMx_BRAKEy Disabled. - * | | |1 = Pin noise filter detect of PWMx_BRAKEy Enabled. - * |[3:1] |BRKNFSEL |Brake Pin Noise Filter Clock Selection - * | | |000 = Noise filter clock is PCLKx. - * | | |001 = Noise filter clock is PCLKx/2. - * | | |010 = Noise filter clock is PCLKx/4. - * | | |011 = Noise filter clock is PCLKx/8. - * | | |100 = Noise filter clock is PCLKx/16. - * | | |101 = Noise filter clock is PCLKx/32. - * | | |110 = Noise filter clock is PCLKx/64. - * | | |111 = Noise filter clock is PCLKx/128. - * |[6:4] |BRKFCNT |Brake Pin Noise Filter Count - * | | |The fields is used to control the active noise filter sample time. - * | | |Once noise filter sample time = (Period time of BRKDBCS) * BRKFCNT. - * |[7] |BRKPINV |Brake Pin Detection Control Bit - * | | |0 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from high to low in edge-detect, or pin status is low in level-detect . - * |[17:16] |BKPINSRC |Brake Pin Source Select - * | | |00 = Brake pin source comes from PWM0_BRAKE0 pin. - * | | |01 = Brake pin source comes from PWM0_BRAKE1 pin. - * | | |10 = Brake pin source comes from PWM1_BRAKE0 pin. - * | | |11 = Brake pin source comes from PWM1_BRAKE1 pin. - * @var TIMER_T::PWMFAILBRK - * Offset: 0x6C Timer PWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by clock fail detection Disabled. - * | | |1 = Brake Function triggered by clock fail detection Enabled. - * |[1] |BODBRKEN |Brown-out Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by BOD event Disabled. - * | | |1 = Brake Function triggered by BOD event Enabled. - * |[2] |RAMBRKEN |SRAM Parity Error Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by SRAM parity error detection Disabled. - * | | |1 = Brake Function triggered by SRAM parity error detection Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by core lockup event Disabled. - * | | |1 = Brake Function triggered by core lockup event Enabled. - * @var TIMER_T::PWMBRKCTL - * Offset: 0x70 Timer PWM Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CPO0EBEN |Enable Internal ACMP0_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP0_O signal as edge-detect brake source Disabled. - * | | |1 = Internal ACMP0_O signal as edge-detect brake source Enabled. - * | | |Note1: Only internal ACMP0_O signal from low to high will be detected as brake event. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |CPO1EBEN |Enable Internal ACMP1_O Digital Output As Edge-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP1_O signal as edge-detect brake source Disabled. - * | | |1 = Internal ACMP1_O signal as edge-detect brake source Enabled. - * | | |Note1: Only internal ACMP1_O signal from low to high will be detected as brake event. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[4] |BRKPEEN |Enable TM_BRAKEx Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as edge-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System fail condition as edge-detect brake source Disabled. - * | | |1 = System fail condition as edge-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |CPO0LBEN |Enable Internal ACMP0_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP0_O signal as level-detect brake source Disabled. - * | | |1 = Internal ACMP0_O signal as level-detect brake source Enabled. - * | | |Note1: Only internal ACMP0_O signal from low to high will be detected as brake event. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |CPO1LBEN |Enable Internal ACMP1_O Digital Output As Level-detect Brake Source (Write Protect) - * | | |0 = Internal ACMP1_O signal as level-detect brake source Disabled. - * | | |1 = Internal ACMP1_O signal as level-detect brake source Enabled. - * | | |Note1: Only internal ACMP1_O signal from low to high will be detected as brake event. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[12] |BRKPLEN |Enable TM_BRAKEx Pin As Level-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as level-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System fail condition as level-detect brake source Disabled. - * | | |1 = System fail condition as level-detect brake source Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[17:16] |BRKAEVEN |PWM Brake Action Select for PWMx_CH0 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH0 output. - * | | |01 = PWMx_CH0 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH0 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH0 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[19:18] |BRKAODD |PWM Brake Action Select for PWMx_CH1 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH1 output. - * | | |01 = PWMx_CH1 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH1 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH1 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMPOLCTL - * Offset: 0x74 Timer PWM Pin Output Polar Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |PWMx_CH0 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH0 output pin. - * | | |0 = PWMx_CH0 output pin polar inverse Disabled. - * | | |1 = PWMx_CH0 output pin polar inverse Enabled. - * |[1] |PINV1 |PWMx_CH1 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH1 output pin. - * | | |0 = PWMx_CH1 output pin polar inverse Disabled. - * | | |1 = PWMx_CH1 output pin polar inverse Enabled. - * @var TIMER_T::PWMPOEN - * Offset: 0x78 Timer PWM Pin Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |PWMx_CH0 Output Pin Enable Bit - * | | |0 = PWMx_CH0 pin at tri-state mode. - * | | |1 = PWMx_CH0 pin in output mode. - * |[1] |POEN1 |PWMx_CH1 Output Pin Enable Bit - * | | |0 = PWMx_CH1 pin at tri-state mode. - * | | |1 = PWMx_CH1 pin in output mode. - * @var TIMER_T::PWMSWBRK - * Offset: 0x7C Timer PWM Software Trigger Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG |Software Trigger Edge-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM edge-detect brake source, then BRKEIF0 and BRKEIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLTRG |Software Trigger Level-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM level-detect brake source, then BRKLIF0 and BRKLIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMINTEN0 - * Offset: 0x80 Timer PWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN |PWM Zero Point Interrupt Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * |[1] |PIEN |PWM Period Point Interrupt Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: When in up-down count type, period point means the center point of current PWM period. - * |[2] |CMPUIEN |PWM Compare Up Count Interrupt Enable Bit - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[3] |CMPDIEN |PWM Compare Down Count Interrupt Enable Bit - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * @var TIMER_T::PWMINTEN1 - * Offset: 0x84 Timer PWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN |PWM Edge-detect Brake Interrupt Enable (Write Protect) - * | | |0 = PWM edge-detect brake interrupt Disabled. - * | | |1 = PWM edge-detect brake interrupt Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIEN |PWM Level-detect Brake Interrupt Enable (Write Protect) - * | | |0 = PWM level-detect brake interrupt Disabled. - * | | |1 = PWM level-detect brake interrupt Enabled. - * | | |Note: This register is write protected. Refer toSYS_REGLCTL register. - * @var TIMER_T::PWMINTSTS0 - * Offset: 0x88 Timer PWM Interrupt Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF |PWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches zero. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |PIF |PWM Period Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches PERIOD. - * | | |Note1: When in up-down count type, PIF flag means the center point flag of current PWM period. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[2] |CMPUIF |PWM Compare Up Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in up count direction and reaches CMP. - * | | |Note1: If CMP equal to PERIOD, there is no CMPUIF flag in up count type and up-down count type. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[3] |CMPDIF |PWM Compare Down Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in down count direction and reaches CMP. - * | | |Note1: If CMP equal to PERIOD, there is no CMPDIF flag in down count type. - * | | |Note2: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMINTSTS1 - * Offset: 0x8C Timer PWM Interrupt Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |Edge-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 edge-detect brake event do not happened. - * | | |1 = PWMx_CH0 edge-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[1] |BRKEIF1 |Edge-detect Brake Interrupt Flag PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 edge-detect brake event do not happened. - * | | |1 = PWMx_CH1 edge-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[8] |BRKLIF0 |Level-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 level-detect brake event do not happened. - * | | |1 = PWMx_CH0 level-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[9] |BRKLIF1 |Level-detect Brake Interrupt Flag on PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 level-detect brake event do not happened. - * | | |1 = PWMx_CH1 level-detect brake event happened. - * | | |Note1: This bit is cleared by writing 1 to it. - * | | |Note2: This register is write protected. Refer toSYS_REGLCTL register. - * |[16] |BRKESTS0 |Edge -detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 edge-detect brake state is released. - * | | |1 = PWMx_CH0 at edge-detect brake state. - * | | |Note: User can set BRKEIF0 1 to clear BRKEIF0 flag and PWMx_CH0 will release brake state when current PWM period finished and resume PWMx_CH0 output waveform start from next full PWM period. - * |[17] |BRKESTS1 |Edge-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 edge-detect brake state is released. - * | | |1 = PWMx_CH1 at edge-detect brake state. - * | | |Note: User can set BRKEIF1 1 to clear BRKEIF1 flag and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH1 output waveform start from next full PWM period. - * |[24] |BRKLSTS0 |Level-detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 level-detect brake state is released. - * | | |1 = PWMx_CH0 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * |[25] |BRKLSTS1 |Level-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 level-detect brake state is released. - * | | |1 = PWMx_CH1 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * @var TIMER_T::PWMEADCTS - * Offset: 0x90 Timer PWM ADC Trigger Source Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TRGSEL |PWM Counter Event Source Select to Trigger EADC Conversion - * | | |000 = Trigger EADC conversion at zero point (ZIF). - * | | |001 = Trigger EADC conversion at period point (PIF). - * | | |010 = Trigger EADC conversion at zero or period point (ZIF or PIF). - * | | |011 = Trigger EADC conversion at compare up count point (CMPUIF). - * | | |100 = Trigger EADC conversion at compare down count point (CMPDIF). - * | | |Others = Reserved. - * |[7] |TRGEN |PWM Counter Event Trigger EADC Conversion Enable Bit - * | | |0 = PWM counter event trigger EADC conversion Disabled. - * | | |1 = PWM counter event trigger EADC conversion Enabled. - * @var TIMER_T::PWMSCTL - * Offset: 0x94 Timer PWM Synchronous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SYNCMODE |PWM Synchronous Mode Enable Select - * | | |00 = PWM synchronous function Disabled. - * | | |01 = PWM synchronous counter start function Enabled. - * | | |10 = Reserved. - * | | |11 = PWM synchronous counter clear function Enabled. - * |[8] |SYNCSRC |PWM Synchronous Counter Start/Clear Source Select - * | | |0 = Counter synchronous start/clear by trigger TIMER0_PWMSTRG STRGEN. - * | | |1 = Counter synchronous start/clear by trigger TIMER2_PWMSTRG STRGEN. - * | | |Note1: If TIMER0/1/2/3 PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8], TIMER1_PWMSCTL[8], TIMER2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be 0. - * | | |Note2: If TIMER0/1/ PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8] and TIMER1_PWMSCTL[8] should be set 0, and TIMER2/3/ PWM counter synchronous source are from TIMER2, TIME2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be set 1. - * @var TIMER_T::PWMSTRG - * Offset: 0x98 Timer PWM Synchronous Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STRGEN |PWM Counter Synchronous Trigger Enable Bit (Write Only) - * | | |PMW counter synchronous function is used to make selected PWM channels (include TIMER0/1/2/3 PWM, TIMER0/1 PWM and TIMER2/3 PWM) start counting or clear counter at the same time according to TIMERx_PWMSCTL setting. - * | | |Note: This bit is only available in TIMER0 and TIMER2. - * @var TIMER_T::PWMSTATUS - * Offset: 0x9C Timer PWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF |PWM Counter Equal to 0xFFFF Flag - * | | |0 = Indicates the PWM counter value never reached its maximum value 0xFFFF. - * | | |1 = Indicates the PWM counter value has reached its maximum value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[16] |EADCTRGF |Trigger EADC Start Conversion Flag - * | | |0 = PWM counter event trigger EADC start conversion is not occurred. - * | | |1 = PWM counter event trigger EADC start conversion has occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMPBUF - * Offset: 0xA0 Timer PWM Period Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |PWM Period Buffer Register (Read Only) - * | | |Used as PERIOD active register. - * @var TIMER_T::PWMCMPBUF - * Offset: 0xA4 Timer PWM Comparator Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |PWM Comparator Buffer Register (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL; /*!< [0x0000] Timer Control Register */ - __IO uint32_t CMP; /*!< [0x0004] Timer Comparator Register */ - __IO uint32_t INTSTS; /*!< [0x0008] Timer Interrupt Status Register */ - __IO uint32_t CNT; /*!< [0x000c] Timer Data Register */ - __I uint32_t CAP; /*!< [0x0010] Timer Capture Data Register */ - __IO uint32_t EXTCTL; /*!< [0x0014] Timer External Control Register */ - __IO uint32_t EINTSTS; /*!< [0x0018] Timer External Interrupt Status Register */ - __IO uint32_t TRGCTL; /*!< [0x001c] Timer Trigger Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0020] Timer Alternative Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[7]; - /** @endcond */ - __IO uint32_t PWMCTL; /*!< [0x0040] Timer PWM Control Register */ - __IO uint32_t PWMCLKSRC; /*!< [0x0044] Timer PWM Counter Clock Source Register */ - __IO uint32_t PWMCLKPSC; /*!< [0x0048] Timer PWM Counter Clock Pre-scale Register */ - __IO uint32_t PWMCNTCLR; /*!< [0x004c] Timer PWM Clear Counter Register */ - __IO uint32_t PWMPERIOD; /*!< [0x0050] Timer PWM Period Register */ - __IO uint32_t PWMCMPDAT; /*!< [0x0054] Timer PWM Comparator Register */ - __IO uint32_t PWMDTCTL; /*!< [0x0058] Timer PWM Dead-Time Control Register */ - __I uint32_t PWMCNT; /*!< [0x005c] Timer PWM Counter Register */ - __IO uint32_t PWMMSKEN; /*!< [0x0060] Timer PWM Output Mask Enable Register */ - __IO uint32_t PWMMSK; /*!< [0x0064] Timer PWM Output Mask Data Control Register */ - __IO uint32_t PWMBNF; /*!< [0x0068] Timer PWM Brake Pin Noise Filter Register */ - __IO uint32_t PWMFAILBRK; /*!< [0x006c] Timer PWM System Fail Brake Control Register */ - __IO uint32_t PWMBRKCTL; /*!< [0x0070] Timer PWM Brake Control Register */ - __IO uint32_t PWMPOLCTL; /*!< [0x0074] Timer PWM Pin Output Polar Control Register */ - __IO uint32_t PWMPOEN; /*!< [0x0078] Timer PWM Pin Output Enable Register */ - __O uint32_t PWMSWBRK; /*!< [0x007c] Timer PWM Software Trigger Brake Control Register */ - __IO uint32_t PWMINTEN0; /*!< [0x0080] Timer PWM Interrupt Enable Register 0 */ - __IO uint32_t PWMINTEN1; /*!< [0x0084] Timer PWM Interrupt Enable Register 1 */ - __IO uint32_t PWMINTSTS0; /*!< [0x0088] Timer PWM Interrupt Status Register 0 */ - __IO uint32_t PWMINTSTS1; /*!< [0x008c] Timer PWM Interrupt Status Register 1 */ - __IO uint32_t PWMEADCTS; /*!< [0x0090] Timer PWM EADC Trigger Source Select Register */ - __IO uint32_t PWMSCTL; /*!< [0x0094] Timer PWM Synchronous Control Register */ - __O uint32_t PWMSTRG; /*!< [0x0098] Timer PWM Synchronous Trigger Register */ - __IO uint32_t PWMSTATUS; /*!< [0x009c] Timer PWM Status Register */ - __I uint32_t PWMPBUF; /*!< [0x00a0] Timer PWM Period Buffer Register */ - __I uint32_t PWMCMPBUF; /*!< [0x00a4] Timer PWM Comparator Buffer Register */ - -} TIMER_T; - -/** - @addtogroup TIMER_CONST TIMER Bit Field Definition - Constant Definitions for TIMER Controller -@{ */ - -#define TIMER_CTL_PSC_Pos (0) /*!< TIMER_T::CTL: PSC Position */ -#define TIMER_CTL_PSC_Msk (0xfful << TIMER_CTL_PSC_Pos) /*!< TIMER_T::CTL: PSC Mask */ - -#define TIMER_CTL_INTRGEN_Pos (19) /*!< TIMER_T::CTL: INTRGEN Position */ -#define TIMER_CTL_INTRGEN_Msk (0x1ul << TIMER_CTL_INTRGEN_Pos) /*!< TIMER_T::CTL: INTRGEN Mask */ - -#define TIMER_CTL_PERIOSEL_Pos (20) /*!< TIMER_T::CTL: PERIOSEL Position */ -#define TIMER_CTL_PERIOSEL_Msk (0x1ul << TIMER_CTL_PERIOSEL_Pos) /*!< TIMER_T::CTL: PERIOSEL Mask */ - -#define TIMER_CTL_TGLPINSEL_Pos (21) /*!< TIMER_T::CTL: TGLPINSEL Position */ -#define TIMER_CTL_TGLPINSEL_Msk (0x1ul << TIMER_CTL_TGLPINSEL_Pos) /*!< TIMER_T::CTL: TGLPINSEL Mask */ - -#define TIMER_CTL_CAPSRC_Pos (22) /*!< TIMER_T::CTL: CAPSRC Position */ -#define TIMER_CTL_CAPSRC_Msk (0x1ul << TIMER_CTL_CAPSRC_Pos) /*!< TIMER_T::CTL: CAPSRC Mask */ - -#define TIMER_CTL_WKEN_Pos (23) /*!< TIMER_T::CTL: WKEN Position */ -#define TIMER_CTL_WKEN_Msk (0x1ul << TIMER_CTL_WKEN_Pos) /*!< TIMER_T::CTL: WKEN Mask */ - -#define TIMER_CTL_EXTCNTEN_Pos (24) /*!< TIMER_T::CTL: EXTCNTEN Position */ -#define TIMER_CTL_EXTCNTEN_Msk (0x1ul << TIMER_CTL_EXTCNTEN_Pos) /*!< TIMER_T::CTL: EXTCNTEN Mask */ - -#define TIMER_CTL_ACTSTS_Pos (25) /*!< TIMER_T::CTL: ACTSTS Position */ -#define TIMER_CTL_ACTSTS_Msk (0x1ul << TIMER_CTL_ACTSTS_Pos) /*!< TIMER_T::CTL: ACTSTS Mask */ - -#define TIMER_CTL_OPMODE_Pos (27) /*!< TIMER_T::CTL: OPMODE Position */ -#define TIMER_CTL_OPMODE_Msk (0x3ul << TIMER_CTL_OPMODE_Pos) /*!< TIMER_T::CTL: OPMODE Mask */ - -#define TIMER_CTL_INTEN_Pos (29) /*!< TIMER_T::CTL: INTEN Position */ -#define TIMER_CTL_INTEN_Msk (0x1ul << TIMER_CTL_INTEN_Pos) /*!< TIMER_T::CTL: INTEN Mask */ - -#define TIMER_CTL_CNTEN_Pos (30) /*!< TIMER_T::CTL: CNTEN Position */ -#define TIMER_CTL_CNTEN_Msk (0x1ul << TIMER_CTL_CNTEN_Pos) /*!< TIMER_T::CTL: CNTEN Mask */ - -#define TIMER_CTL_ICEDEBUG_Pos (31) /*!< TIMER_T::CTL: ICEDEBUG Position */ -#define TIMER_CTL_ICEDEBUG_Msk (0x1ul << TIMER_CTL_ICEDEBUG_Pos) /*!< TIMER_T::CTL: ICEDEBUG Mask */ - -#define TIMER_CMP_CMPDAT_Pos (0) /*!< TIMER_T::CMP: CMPDAT Position */ -#define TIMER_CMP_CMPDAT_Msk (0xfffffful << TIMER_CMP_CMPDAT_Pos) /*!< TIMER_T::CMP: CMPDAT Mask */ - -#define TIMER_INTSTS_TIF_Pos (0) /*!< TIMER_T::INTSTS: TIF Position */ -#define TIMER_INTSTS_TIF_Msk (0x1ul << TIMER_INTSTS_TIF_Pos) /*!< TIMER_T::INTSTS: TIF Mask */ - -#define TIMER_INTSTS_TWKF_Pos (1) /*!< TIMER_T::INTSTS: TWKF Position */ -#define TIMER_INTSTS_TWKF_Msk (0x1ul << TIMER_INTSTS_TWKF_Pos) /*!< TIMER_T::INTSTS: TWKF Mask */ - -#define TIMER_CNT_CNT_Pos (0) /*!< TIMER_T::CNT: CNT Position */ -#define TIMER_CNT_CNT_Msk (0xfffffful << TIMER_CNT_CNT_Pos) /*!< TIMER_T::CNT: CNT Mask */ - -#define TIMER_CNT_RSTACT_Pos (31) /*!< TIMER_T::CNT: RSTACT Position */ -#define TIMER_CNT_RSTACT_Msk (0x1ul << TIMER_CNT_RSTACT_Pos) /*!< TIMER_T::CNT: RSTACT Mask */ - -#define TIMER_CAP_CAPDAT_Pos (0) /*!< TIMER_T::CAP: CAPDAT Position */ -#define TIMER_CAP_CAPDAT_Msk (0xfffffful << TIMER_CAP_CAPDAT_Pos) /*!< TIMER_T::CAP: CAPDAT Mask */ - -#define TIMER_EXTCTL_CNTPHASE_Pos (0) /*!< TIMER_T::EXTCTL: CNTPHASE Position */ -#define TIMER_EXTCTL_CNTPHASE_Msk (0x1ul << TIMER_EXTCTL_CNTPHASE_Pos) /*!< TIMER_T::EXTCTL: CNTPHASE Mask */ - -#define TIMER_EXTCTL_CAPEN_Pos (3) /*!< TIMER_T::EXTCTL: CAPEN Position */ -#define TIMER_EXTCTL_CAPEN_Msk (0x1ul << TIMER_EXTCTL_CAPEN_Pos) /*!< TIMER_T::EXTCTL: CAPEN Mask */ - -#define TIMER_EXTCTL_CAPFUNCS_Pos (4) /*!< TIMER_T::EXTCTL: CAPFUNCS Position */ -#define TIMER_EXTCTL_CAPFUNCS_Msk (0x1ul << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< TIMER_T::EXTCTL: CAPFUNCS Mask */ - -#define TIMER_EXTCTL_CAPIEN_Pos (5) /*!< TIMER_T::EXTCTL: CAPIEN Position */ -#define TIMER_EXTCTL_CAPIEN_Msk (0x1ul << TIMER_EXTCTL_CAPIEN_Pos) /*!< TIMER_T::EXTCTL: CAPIEN Mask */ - -#define TIMER_EXTCTL_CAPDBEN_Pos (6) /*!< TIMER_T::EXTCTL: CAPDBEN Position */ -#define TIMER_EXTCTL_CAPDBEN_Msk (0x1ul << TIMER_EXTCTL_CAPDBEN_Pos) /*!< TIMER_T::EXTCTL: CAPDBEN Mask */ - -#define TIMER_EXTCTL_CNTDBEN_Pos (7) /*!< TIMER_T::EXTCTL: CNTDBEN Position */ -#define TIMER_EXTCTL_CNTDBEN_Msk (0x1ul << TIMER_EXTCTL_CNTDBEN_Pos) /*!< TIMER_T::EXTCTL: CNTDBEN Mask */ - -#define TIMER_EXTCTL_ICAPSEL_Pos (8) /*!< TIMER_T::EXTCTL: ICAPSEL Position */ -#define TIMER_EXTCTL_ICAPSEL_Msk (0x7ul << TIMER_EXTCTL_ICAPSEL_Pos) /*!< TIMER_T::EXTCTL: ICAPSEL Mask */ - -#define TIMER_EXTCTL_CAPEDGE_Pos (12) /*!< TIMER_T::EXTCTL: CAPEDGE Position */ -#define TIMER_EXTCTL_CAPEDGE_Msk (0x7ul << TIMER_EXTCTL_CAPEDGE_Pos) /*!< TIMER_T::EXTCTL: CAPEDGE Mask */ - -#define TIMER_EXTCTL_ECNTSSEL_Pos (16) /*!< TIMER_T::EXTCTL: ECNTSSEL Position */ -#define TIMER_EXTCTL_ECNTSSEL_Msk (0x1ul << TIMER_EXTCTL_ECNTSSEL_Pos) /*!< TIMER_T::EXTCTL: ECNTSSEL Mask */ - -#define TIMER_EXTCTL_CAPDIVSCL_Pos (28) /*!< TIMER_T::EXTCTL: CAPDIVSCL Position */ -#define TIMER_EXTCTL_CAPDIVSCL_Msk (0xful << TIMER_EXTCTL_CAPDIVSCL_Pos) /*!< TIMER_T::EXTCTL: CAPDIVSCL Mask */ - -#define TIMER_EINTSTS_CAPIF_Pos (0) /*!< TIMER_T::EINTSTS: CAPIF Position */ -#define TIMER_EINTSTS_CAPIF_Msk (0x1ul << TIMER_EINTSTS_CAPIF_Pos) /*!< TIMER_T::EINTSTS: CAPIF Mask */ - -#define TIMER_TRGCTL_TRGSSEL_Pos (0) /*!< TIMER_T::TRGCTL: TRGSSEL Position */ -#define TIMER_TRGCTL_TRGSSEL_Msk (0x1ul << TIMER_TRGCTL_TRGSSEL_Pos) /*!< TIMER_T::TRGCTL: TRGSSEL Mask */ - -#define TIMER_TRGCTL_TRGEPWM_Pos (1) /*!< TIMER_T::TRGCTL: TRGEPWM Position */ -#define TIMER_TRGCTL_TRGEPWM_Msk (0x1ul << TIMER_TRGCTL_TRGEPWM_Pos) /*!< TIMER_T::TRGCTL: TRGEPWM Mask */ - -#define TIMER_TRGCTL_TRGEADC_Pos (2) /*!< TIMER_T::TRGCTL: TRGEADC Position */ -#define TIMER_TRGCTL_TRGEADC_Msk (0x1ul << TIMER_TRGCTL_TRGEADC_Pos) /*!< TIMER_T::TRGCTL: TRGEADC Mask */ - -#define TIMER_TRGCTL_TRGDAC_Pos (3) /*!< TIMER_T::TRGCTL: TRGDAC Position */ -#define TIMER_TRGCTL_TRGDAC_Msk (0x1ul << TIMER_TRGCTL_TRGDAC_Pos) /*!< TIMER_T::TRGCTL: TRGDAC Mask */ - -#define TIMER_TRGCTL_TRGPDMA_Pos (4) /*!< TIMER_T::TRGCTL: TRGPDMA Position */ -#define TIMER_TRGCTL_TRGPDMA_Msk (0x1ul << TIMER_TRGCTL_TRGPDMA_Pos) /*!< TIMER_T::TRGCTL: TRGPDMA Mask */ - -#define TIMER_ALTCTL_FUNCSEL_Pos (0) /*!< TIMER_T::ALTCTL: FUNCSEL Position */ -#define TIMER_ALTCTL_FUNCSEL_Msk (0x1ul << TIMER_ALTCTL_FUNCSEL_Pos) /*!< TIMER_T::ALTCTL: FUNCSEL Mask */ - -#define TIMER_PWMCTL_CNTEN_Pos (0) /*!< TIMER_T::PWMCTL: CNTEN Position */ -#define TIMER_PWMCTL_CNTEN_Msk (0x1ul << TIMER_PWMCTL_CNTEN_Pos) /*!< TIMER_T::PWMCTL: CNTEN Mask */ - -#define TIMER_PWMCTL_CNTTYPE_Pos (1) /*!< TIMER_T::PWMCTL: CNTTYPE Position */ -#define TIMER_PWMCTL_CNTTYPE_Msk (0x3ul << TIMER_PWMCTL_CNTTYPE_Pos) /*!< TIMER_T::PWMCTL: CNTTYPE Mask */ - -#define TIMER_PWMCTL_CNTMODE_Pos (3) /*!< TIMER_T::PWMCTL: CNTMODE Position */ -#define TIMER_PWMCTL_CNTMODE_Msk (0x1ul << TIMER_PWMCTL_CNTMODE_Pos) /*!< TIMER_T::PWMCTL: CNTMODE Mask */ - -#define TIMER_PWMCTL_CTRLD_Pos (8) /*!< TIMER_T::PWMCTL: CTRLD Position */ -#define TIMER_PWMCTL_CTRLD_Msk (0x1ul << TIMER_PWMCTL_CTRLD_Pos) /*!< TIMER_T::PWMCTL: CTRLD Mask */ - -#define TIMER_PWMCTL_IMMLDEN_Pos (9) /*!< TIMER_T::PWMCTL: IMMLDEN Position */ -#define TIMER_PWMCTL_IMMLDEN_Msk (0x1ul << TIMER_PWMCTL_IMMLDEN_Pos) /*!< TIMER_T::PWMCTL: IMMLDEN Mask */ - -#define TIMER_PWMCTL_OUTMODE_Pos (16) /*!< TIMER_T::PWMCTL: OUTMODE Position */ -#define TIMER_PWMCTL_OUTMODE_Msk (0x1ul << TIMER_PWMCTL_OUTMODE_Pos) /*!< TIMER_T::PWMCTL: OUTMODE Mask */ - -#define TIMER_PWMCTL_DBGHALT_Pos (30) /*!< TIMER_T::PWMCTL: DBGHALT Position */ -#define TIMER_PWMCTL_DBGHALT_Msk (0x1ul << TIMER_PWMCTL_DBGHALT_Pos) /*!< TIMER_T::PWMCTL: DBGHALT Mask */ - -#define TIMER_PWMCTL_DBGTRIOFF_Pos (31) /*!< TIMER_T::PWMCTL: DBGTRIOFF Position */ -#define TIMER_PWMCTL_DBGTRIOFF_Msk (0x1ul << TIMER_PWMCTL_DBGTRIOFF_Pos) /*!< TIMER_T::PWMCTL: DBGTRIOFF Mask */ - -#define TIMER_PWMCLKSRC_CLKSRC_Pos (0) /*!< TIMER_T::PWMCLKSRC: CLKSRC Position */ -#define TIMER_PWMCLKSRC_CLKSRC_Msk (0x7ul << TIMER_PWMCLKSRC_CLKSRC_Pos) /*!< TIMER_T::PWMCLKSRC: CLKSRC Mask */ - -#define TIMER_PWMCLKPSC_CLKPSC_Pos (0) /*!< TIMER_T::PWMCLKPSC: CLKPSC Position */ -#define TIMER_PWMCLKPSC_CLKPSC_Msk (0xffful << TIMER_PWMCLKPSC_CLKPSC_Pos) /*!< TIMER_T::PWMCLKPSC: CLKPSC Mask */ - -#define TIMER_PWMCNTCLR_CNTCLR_Pos (0) /*!< TIMER_T::PWMCNTCLR: CNTCLR Position */ -#define TIMER_PWMCNTCLR_CNTCLR_Msk (0x1ul << TIMER_PWMCNTCLR_CNTCLR_Pos) /*!< TIMER_T::PWMCNTCLR: CNTCLR Mask */ - -#define TIMER_PWMPERIOD_PERIOD_Pos (0) /*!< TIMER_T::PWMPERIOD: PERIOD Position */ -#define TIMER_PWMPERIOD_PERIOD_Msk (0xfffful << TIMER_PWMPERIOD_PERIOD_Pos) /*!< TIMER_T::PWMPERIOD: PERIOD Mask */ - -#define TIMER_PWMCMPDAT_CMP_Pos (0) /*!< TIMER_T::PWMCMPDAT: CMP Position */ -#define TIMER_PWMCMPDAT_CMP_Msk (0xfffful << TIMER_PWMCMPDAT_CMP_Pos) /*!< TIMER_T::PWMCMPDAT: CMP Mask */ - -#define TIMER_PWMDTCTL_DTCNT_Pos (0) /*!< TIMER_T::PWMDTCTL: DTCNT Position */ -#define TIMER_PWMDTCTL_DTCNT_Msk (0xffful << TIMER_PWMDTCTL_DTCNT_Pos) /*!< TIMER_T::PWMDTCTL: DTCNT Mask */ - -#define TIMER_PWMDTCTL_DTEN_Pos (16) /*!< TIMER_T::PWMDTCTL: DTEN Position */ -#define TIMER_PWMDTCTL_DTEN_Msk (0x1ul << TIMER_PWMDTCTL_DTEN_Pos) /*!< TIMER_T::PWMDTCTL: DTEN Mask */ - -#define TIMER_PWMDTCTL_DTCKSEL_Pos (24) /*!< TIMER_T::PWMDTCTL: DTCKSEL Position */ -#define TIMER_PWMDTCTL_DTCKSEL_Msk (0x1ul << TIMER_PWMDTCTL_DTCKSEL_Pos) /*!< TIMER_T::PWMDTCTL: DTCKSEL Mask */ - -#define TIMER_PWMCNT_CNT_Pos (0) /*!< TIMER_T::PWMCNT: CNT Position */ -#define TIMER_PWMCNT_CNT_Msk (0xfffful << TIMER_PWMCNT_CNT_Pos) /*!< TIMER_T::PWMCNT: CNT Mask */ - -#define TIMER_PWMCNT_DIRF_Pos (16) /*!< TIMER_T::PWMCNT: DIRF Position */ -#define TIMER_PWMCNT_DIRF_Msk (0x1ul << TIMER_PWMCNT_DIRF_Pos) /*!< TIMER_T::PWMCNT: DIRF Mask */ - -#define TIMER_PWMMSKEN_MSKEN0_Pos (0) /*!< TIMER_T::PWMMSKEN: MSKEN0 Position */ -#define TIMER_PWMMSKEN_MSKEN0_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN0_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN0 Mask */ - -#define TIMER_PWMMSKEN_MSKEN1_Pos (1) /*!< TIMER_T::PWMMSKEN: MSKEN1 Position */ -#define TIMER_PWMMSKEN_MSKEN1_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN1_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN1 Mask */ - -#define TIMER_PWMMSK_MSKDAT0_Pos (0) /*!< TIMER_T::PWMMSK: MSKDAT0 Position */ -#define TIMER_PWMMSK_MSKDAT0_Msk (0x1ul << TIMER_PWMMSK_MSKDAT0_Pos) /*!< TIMER_T::PWMMSK: MSKDAT0 Mask */ - -#define TIMER_PWMMSK_MSKDAT1_Pos (1) /*!< TIMER_T::PWMMSK: MSKDAT1 Position */ -#define TIMER_PWMMSK_MSKDAT1_Msk (0x1ul << TIMER_PWMMSK_MSKDAT1_Pos) /*!< TIMER_T::PWMMSK: MSKDAT1 Mask */ - -#define TIMER_PWMBNF_BRKNFEN_Pos (0) /*!< TIMER_T::PWMBNF: BRKNFEN Position */ -#define TIMER_PWMBNF_BRKNFEN_Msk (0x1ul << TIMER_PWMBNF_BRKNFEN_Pos) /*!< TIMER_T::PWMBNF: BRKNFEN Mask */ - -#define TIMER_PWMBNF_BRKNFSEL_Pos (1) /*!< TIMER_T::PWMBNF: BRKNFSEL Position */ -#define TIMER_PWMBNF_BRKNFSEL_Msk (0x7ul << TIMER_PWMBNF_BRKNFSEL_Pos) /*!< TIMER_T::PWMBNF: BRKNFSEL Mask */ - -#define TIMER_PWMBNF_BRKFCNT_Pos (4) /*!< TIMER_T::PWMBNF: BRKFCNT Position */ -#define TIMER_PWMBNF_BRKFCNT_Msk (0x7ul << TIMER_PWMBNF_BRKFCNT_Pos) /*!< TIMER_T::PWMBNF: BRKFCNT Mask */ - -#define TIMER_PWMBNF_BRKPINV_Pos (7) /*!< TIMER_T::PWMBNF: BRKPINV Position */ -#define TIMER_PWMBNF_BRKPINV_Msk (0x1ul << TIMER_PWMBNF_BRKPINV_Pos) /*!< TIMER_T::PWMBNF: BRKPINV Mask */ - -#define TIMER_PWMBNF_BKPINSRC_Pos (16) /*!< TIMER_T::PWMBNF: BKPINSRC Position */ -#define TIMER_PWMBNF_BKPINSRC_Msk (0x3ul << TIMER_PWMBNF_BKPINSRC_Pos) /*!< TIMER_T::PWMBNF: BKPINSRC Mask */ - -#define TIMER_PWMFAILBRK_CSSBRKEN_Pos (0) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Position */ -#define TIMER_PWMFAILBRK_CSSBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CSSBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Mask */ - -#define TIMER_PWMFAILBRK_BODBRKEN_Pos (1) /*!< TIMER_T::PWMFAILBRK: BODBRKEN Position */ -#define TIMER_PWMFAILBRK_BODBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_BODBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: BODBRKEN Mask */ - -#define TIMER_PWMFAILBRK_RAMBRKEN_Pos (2) /*!< TIMER_T::PWMFAILBRK: RAMBRKEN Position */ -#define TIMER_PWMFAILBRK_RAMBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_RAMBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: RAMBRKEN Mask */ - -#define TIMER_PWMFAILBRK_CORBRKEN_Pos (3) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Position */ -#define TIMER_PWMFAILBRK_CORBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CORBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Mask */ - -#define TIMER_PWMBRKCTL_CPO0EBEN_Pos (0) /*!< TIMER_T::PWMBRKCTL: CPO0EBEN Position */ -#define TIMER_PWMBRKCTL_CPO0EBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO0EBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO0EBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO1EBEN_Pos (1) /*!< TIMER_T::PWMBRKCTL: CPO1EBEN Position */ -#define TIMER_PWMBRKCTL_CPO1EBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO1EBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO1EBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPEEN_Pos (4) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Position */ -#define TIMER_PWMBRKCTL_BRKPEEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPEEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Mask */ - -#define TIMER_PWMBRKCTL_SYSEBEN_Pos (7) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Position */ -#define TIMER_PWMBRKCTL_SYSEBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSEBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO0LBEN_Pos (8) /*!< TIMER_T::PWMBRKCTL: CPO0LBEN Position */ -#define TIMER_PWMBRKCTL_CPO0LBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO0LBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO0LBEN Mask */ - -#define TIMER_PWMBRKCTL_CPO1LBEN_Pos (9) /*!< TIMER_T::PWMBRKCTL: CPO1LBEN Position */ -#define TIMER_PWMBRKCTL_CPO1LBEN_Msk (0x1ul << TIMER_PWMBRKCTL_CPO1LBEN_Pos) /*!< TIMER_T::PWMBRKCTL: CPO1LBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPLEN_Pos (12) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Position */ -#define TIMER_PWMBRKCTL_BRKPLEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPLEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Mask */ - -#define TIMER_PWMBRKCTL_SYSLBEN_Pos (15) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Position */ -#define TIMER_PWMBRKCTL_SYSLBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSLBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAEVEN_Pos (16) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Position */ -#define TIMER_PWMBRKCTL_BRKAEVEN_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAEVEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAODD_Pos (18) /*!< TIMER_T::PWMBRKCTL: BRKAODD Position */ -#define TIMER_PWMBRKCTL_BRKAODD_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAODD_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAODD Mask */ - -#define TIMER_PWMPOLCTL_PINV0_Pos (0) /*!< TIMER_T::PWMPOLCTL: PINV0 Position */ -#define TIMER_PWMPOLCTL_PINV0_Msk (0x1ul << TIMER_PWMPOLCTL_PINV0_Pos) /*!< TIMER_T::PWMPOLCTL: PINV0 Mask */ - -#define TIMER_PWMPOLCTL_PINV1_Pos (1) /*!< TIMER_T::PWMPOLCTL: PINV1 Position */ -#define TIMER_PWMPOLCTL_PINV1_Msk (0x1ul << TIMER_PWMPOLCTL_PINV1_Pos) /*!< TIMER_T::PWMPOLCTL: PINV1 Mask */ - -#define TIMER_PWMPOEN_POEN0_Pos (0) /*!< TIMER_T::PWMPOEN: POEN0 Position */ -#define TIMER_PWMPOEN_POEN0_Msk (0x1ul << TIMER_PWMPOEN_POEN0_Pos) /*!< TIMER_T::PWMPOEN: POEN0 Mask */ - -#define TIMER_PWMPOEN_POEN1_Pos (1) /*!< TIMER_T::PWMPOEN: POEN1 Position */ -#define TIMER_PWMPOEN_POEN1_Msk (0x1ul << TIMER_PWMPOEN_POEN1_Pos) /*!< TIMER_T::PWMPOEN: POEN1 Mask */ - -#define TIMER_PWMSWBRK_BRKETRG_Pos (0) /*!< TIMER_T::PWMSWBRK: BRKETRG Position */ -#define TIMER_PWMSWBRK_BRKETRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKETRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKETRG Mask */ - -#define TIMER_PWMSWBRK_BRKLTRG_Pos (8) /*!< TIMER_T::PWMSWBRK: BRKLTRG Position */ -#define TIMER_PWMSWBRK_BRKLTRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKLTRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKLTRG Mask */ - -#define TIMER_PWMINTEN0_ZIEN_Pos (0) /*!< TIMER_T::PWMINTEN0: ZIEN Position */ -#define TIMER_PWMINTEN0_ZIEN_Msk (0x1ul << TIMER_PWMINTEN0_ZIEN_Pos) /*!< TIMER_T::PWMINTEN0: ZIEN Mask */ - -#define TIMER_PWMINTEN0_PIEN_Pos (1) /*!< TIMER_T::PWMINTEN0: PIEN Position */ -#define TIMER_PWMINTEN0_PIEN_Msk (0x1ul << TIMER_PWMINTEN0_PIEN_Pos) /*!< TIMER_T::PWMINTEN0: PIEN Mask */ - -#define TIMER_PWMINTEN0_CMPUIEN_Pos (2) /*!< TIMER_T::PWMINTEN0: CMPUIEN Position */ -#define TIMER_PWMINTEN0_CMPUIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPUIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPUIEN Mask */ - -#define TIMER_PWMINTEN0_CMPDIEN_Pos (3) /*!< TIMER_T::PWMINTEN0: CMPDIEN Position */ -#define TIMER_PWMINTEN0_CMPDIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPDIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPDIEN Mask */ - -#define TIMER_PWMINTEN1_BRKEIEN_Pos (0) /*!< TIMER_T::PWMINTEN1: BRKEIEN Position */ -#define TIMER_PWMINTEN1_BRKEIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKEIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKEIEN Mask */ - -#define TIMER_PWMINTEN1_BRKLIEN_Pos (8) /*!< TIMER_T::PWMINTEN1: BRKLIEN Position */ -#define TIMER_PWMINTEN1_BRKLIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKLIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKLIEN Mask */ - -#define TIMER_PWMINTSTS0_ZIF_Pos (0) /*!< TIMER_T::PWMINTSTS0: ZIF Position */ -#define TIMER_PWMINTSTS0_ZIF_Msk (0x1ul << TIMER_PWMINTSTS0_ZIF_Pos) /*!< TIMER_T::PWMINTSTS0: ZIF Mask */ - -#define TIMER_PWMINTSTS0_PIF_Pos (1) /*!< TIMER_T::PWMINTSTS0: PIF Position */ -#define TIMER_PWMINTSTS0_PIF_Msk (0x1ul << TIMER_PWMINTSTS0_PIF_Pos) /*!< TIMER_T::PWMINTSTS0: PIF Mask */ - -#define TIMER_PWMINTSTS0_CMPUIF_Pos (2) /*!< TIMER_T::PWMINTSTS0: CMPUIF Position */ -#define TIMER_PWMINTSTS0_CMPUIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPUIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPUIF Mask */ - -#define TIMER_PWMINTSTS0_CMPDIF_Pos (3) /*!< TIMER_T::PWMINTSTS0: CMPDIF Position */ -#define TIMER_PWMINTSTS0_CMPDIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPDIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPDIF Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF0_Pos (0) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Position */ -#define TIMER_PWMINTSTS1_BRKEIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF1_Pos (1) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Position */ -#define TIMER_PWMINTSTS1_BRKEIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF0_Pos (8) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Position */ -#define TIMER_PWMINTSTS1_BRKLIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF1_Pos (9) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Position */ -#define TIMER_PWMINTSTS1_BRKLIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS0_Pos (16) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Position */ -#define TIMER_PWMINTSTS1_BRKESTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS1_Pos (17) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Position */ -#define TIMER_PWMINTSTS1_BRKESTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS0_Pos (24) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS1_Pos (25) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Mask */ - -#define TIMER_PWMEADCTS_TRGSEL_Pos (0) /*!< TIMER_T::PWMEADCTS: TRGSEL Position */ -#define TIMER_PWMEADCTS_TRGSEL_Msk (0x7ul << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< TIMER_T::PWMEADCTS: TRGSEL Mask */ - -#define TIMER_PWMEADCTS_TRGEN_Pos (7) /*!< TIMER_T::PWMEADCTS: TRGEN Position */ -#define TIMER_PWMEADCTS_TRGEN_Msk (0x1ul << TIMER_PWMEADCTS_TRGEN_Pos) /*!< TIMER_T::PWMEADCTS: TRGEN Mask */ - -#define TIMER_PWMSCTL_SYNCMODE_Pos (0) /*!< TIMER_T::PWMSCTL: SYNCMODE Position */ -#define TIMER_PWMSCTL_SYNCMODE_Msk (0x3ul << TIMER_PWMSCTL_SYNCMODE_Pos) /*!< TIMER_T::PWMSCTL: SYNCMODE Mask */ - -#define TIMER_PWMSCTL_SYNCSRC_Pos (8) /*!< TIMER_T::PWMSCTL: SYNCSRC Position */ -#define TIMER_PWMSCTL_SYNCSRC_Msk (0x1ul << TIMER_PWMSCTL_SYNCSRC_Pos) /*!< TIMER_T::PWMSCTL: SYNCSRC Mask */ - -#define TIMER_PWMSTRG_STRGEN_Pos (0) /*!< TIMER_T::PWMSTRG: STRGEN Position */ -#define TIMER_PWMSTRG_STRGEN_Msk (0x1ul << TIMER_PWMSTRG_STRGEN_Pos) /*!< TIMER_T::PWMSTRG: STRGEN Mask */ - -#define TIMER_PWMSTATUS_CNTMAXF_Pos (0) /*!< TIMER_T::PWMSTATUS: CNTMAXF Position */ -#define TIMER_PWMSTATUS_CNTMAXF_Msk (0x1ul << TIMER_PWMSTATUS_CNTMAXF_Pos) /*!< TIMER_T::PWMSTATUS: CNTMAXF Mask */ - -#define TIMER_PWMSTATUS_EADCTRGF_Pos (16) /*!< TIMER_T::PWMSTATUS: EADCTRGF Position */ -#define TIMER_PWMSTATUS_EADCTRGF_Msk (0x1ul << TIMER_PWMSTATUS_EADCTRGF_Pos) /*!< TIMER_T::PWMSTATUS: EADCTRGF Mask */ - -#define TIMER_PWMPBUF_PBUF_Pos (0) /*!< TIMER_T::PWMPBUF: PBUF Position */ -#define TIMER_PWMPBUF_PBUF_Msk (0xfffful << TIMER_PWMPBUF_PBUF_Pos) /*!< TIMER_T::PWMPBUF: PBUF Mask */ - -#define TIMER_PWMCMPBUF_CMPBUF_Pos (0) /*!< TIMER_T::PWMCMPBUF: CMPBUF Position */ -#define TIMER_PWMCMPBUF_CMPBUF_Msk (0xfffful << TIMER_PWMCMPBUF_CMPBUF_Pos) /*!< TIMER_T::PWMCMPBUF: CMPBUF Mask */ - -/**@}*/ /* TIMER_CONST */ -/**@}*/ /* end of TIMER register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __TIMER_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/trng_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/trng_reg.h deleted file mode 100644 index ede3dfa65ba..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/trng_reg.h +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************//** - * @file trng_reg.h - * @version V1.00 - * @brief TRNG register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TRNG_REG_H__ -#define __TRNG_REG_H__ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- True Random Number Generator -------------------------*/ -/** - @addtogroup TRNG True Random Number Generator(TRNG) - Memory Mapped Structure for TRNG Controller -@{ */ - -typedef struct -{ - - - /** - * @var TRNG_T::CTL - * Offset: 0x00 TRNG Control Register and Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRNGEN |Random Number Generator Enable Bit - * | | |This bit can be set to 1 only after ACT (TRNG_ACT[7]) bit was set to 1 and READY (TRNG_CTL[7]) bit became 1. - * | | |0 = TRNG disabled. - * | | |1 = TRNG enabled. - * | | |Note: TRNGEN is an enable bit of digital part - * | | |When TRNG is not required to generate random number, TRNGEN bit and ACT (TRNG_ACT[7]) bit should be set to 0 to reduce power consumption. - * |[1] |DVIF |Data Valid (Read Only) - * | | |0 = Data is not valid. Reading from RNGD returns 0x00000000. - * | | |1 = Data is valid. A valid random number can be read form RNGD. - * | | |This bit is cleared to u20180u2019 by read TRNG_DATA. - * |[5:2] |CLKP |Clock Prescaler - * | | |The CLKP is the peripheral clock frequency range for the selected value , the CLKP must higher than or equal to the actual peripheral clock frequency (for correct random bit generation) - * | | |To change the CLKP contents, first set TRNGEN bit to 0 and then change CLKP; finally, set TRNGEN bit to 1 to re-enable the TRNG module. - * | | |0000 = 80 ~ 100 MHz. - * | | |0001 = 60 ~ 80 MHz. - * | | |0010 = 50 ~60 MHz. - * | | |0011 = 40 ~50 MHz. - * | | |0100 = 30 ~40 MHz. - * | | |0101 = 25 ~30 MHz. - * | | |0110 = 20 ~25 MHz. - * | | |0111 = 15 ~20 MHz. - * | | |1000 = 12 ~15 MHz. - * | | |1001 = 9 ~12 MHz. - * | | |1010 = 7 ~9 MHz. - * | | |1011 = 6 ~7 MHz. - * | | |1100 = 5 ~6 MHz. - * | | |1101 = 4 ~5 MHz. - * | | |1111 = Reserved. - * |[6] |DVIEN |Data Valid Interrupt Enable Bit - * | | |0 = Interrupt disabled.. - * | | |1 = Interrupt enabled. - * |[7] |READY |Random Number Generator Ready (Read Only) - * | | |After ACT (TRNG_ACT[7]) bit is set, the READY bit become to 1 after a delay of 90us~120us. - * | | |0 = RNG is not ready or was not activated. - * | | |1 = RNG is ready to be enabled.. - * |[31:8] |Reversed |Reversed - * @var TRNG_T::DATA - * Offset: 0x04 TRNG Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DATA |Random Number Generator Data (Read Only) - * | | |The DATA store the random number generated by TRNG and can be read only once. - * @var TRNG_T::ACT - * Offset: 0x0C TRNG Activation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |VER |TRNG Version - * | | |TRNG version number is dependent on TRNG module. - * | | |0x02:(Current Version Number) - * |[7] |ACT |Random Number Generator Activation - * | | |After enable the ACT bit, it will active the TRNG module and wait the READY (TRNG_CTL[7]) bit to become 1. - * | | |0 = TRNG inactive. - * | | |1 = TRNG active. - * | | |Note: ACT is an enable bit of analog part - * | | |When TRNG is not required to generate random number, TRNGEN (TRNG_CTL[0]) bit and ACT bit should be set to 0 to reduce power consumption. - */ - __IO uint32_t CTL; /*!< [0x0000] TRNG Control Register and Status */ - __I uint32_t DATA; /*!< [0x0004] TRNG Data Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ACT; /*!< [0x000c] TRNG Activation Register */ - -} TRNG_T; - -/** - @addtogroup TRNG_CONST TRNG Bit Field Definition - Constant Definitions for TRNG Controller -@{ */ - -#define TRNG_CTL_TRNGEN_Pos (0) /*!< TRNG_T::CTL: TRNGEN Position */ -#define TRNG_CTL_TRNGEN_Msk (0x1ul << TRNG_CTL_TRNGEN_Pos) /*!< TRNG_T::CTL: TRNGEN Mask */ - -#define TRNG_CTL_DVIF_Pos (1) /*!< TRNG_T::CTL: DVIF Position */ -#define TRNG_CTL_DVIF_Msk (0x1ul << TRNG_CTL_DVIF_Pos) /*!< TRNG_T::CTL: DVIF Mask */ - -#define TRNG_CTL_CLKP_Pos (2) /*!< TRNG_T::CTL: CLKP Position */ -#define TRNG_CTL_CLKP_Msk (0xful << TRNG_CTL_CLKP_Pos) /*!< TRNG_T::CTL: CLKP Mask */ - -#define TRNG_CTL_DVIEN_Pos (6) /*!< TRNG_T::CTL: DVIEN Position */ -#define TRNG_CTL_DVIEN_Msk (0x1ul << TRNG_CTL_DVIEN_Pos) /*!< TRNG_T::CTL: DVIEN Mask */ - -#define TRNG_CTL_READY_Pos (7) /*!< TRNG_T::CTL: READY Position */ -#define TRNG_CTL_READY_Msk (0x1ul << TRNG_CTL_READY_Pos) /*!< TRNG_T::CTL: READY Mask */ - -#define TRNG_CTL_Reversed_Pos (8) /*!< TRNG_T::CTL: Reversed Position */ -#define TRNG_CTL_Reversed_Msk (0xfffffful << TRNG_CTL_Reversed_Pos) /*!< TRNG_T::CTL: Reversed Mask */ - -#define TRNG_DATA_DATA_Pos (0) /*!< TRNG_T::DATA: DATA Position */ -#define TRNG_DATA_DATA_Msk (0xfful << TRNG_DATA_DATA_Pos) /*!< TRNG_T::DATA: DATA Mask */ - -#define TRNG_ACT_VER_Pos (0) /*!< TRNG_T::ACT: VER Position */ -#define TRNG_ACT_VER_Msk (0x7ful << TRNG_ACT_VER_Pos) /*!< TRNG_T::ACT: VER Mask */ - -#define TRNG_ACT_ACT_Pos (7) /*!< TRNG_T::ACT: ACT Position */ -#define TRNG_ACT_ACT_Msk (0x1ul << TRNG_ACT_ACT_Pos) /*!< TRNG_T::ACT: ACT Mask */ - -/**@}*/ /* TRNG_CONST */ -/**@}*/ /* end of TRNG register group */ -/**@}*/ /* end of REGISTER group */ - - -#endif /* __TRNG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uart_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uart_reg.h deleted file mode 100644 index 3524551a7a1..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uart_reg.h +++ /dev/null @@ -1,1273 +0,0 @@ -/**************************************************************************//** - * @file uart_reg.h - * @version V1.00 - * @brief UART register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UART_REG_H__ -#define __UART_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UART Universal Asynchronous Receiver/Transmitter Controller(UART) - Memory Mapped Structure for UART Controller -@{ */ - -typedef struct -{ - - - /** - * @var UART_T::DAT - * Offset: 0x00 UART Receive/Transmit Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Data Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing one byte to this register, the data byte will be stored in transmitter FIFO - * | | |The UART controller will send out the data stored in transmitter FIFO top location through the UART_TXD. - * | | |Read Operation: - * | | |By reading this register, the UART controller will return an 8-bit data received from receiver FIFO. - * |[8] |PARITY |Parity Bit Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing to this bit, the parity bit will be stored in transmitter FIFO - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set, - * | | |the UART controller will send out this bit follow the DAT (UART_DAT[7:0]) through the UART_TXD. - * | | |Read Operation: - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are enabled, the parity bit can be read by this bit. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set. - * @var UART_T::INTEN - * Offset: 0x04 UART Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIEN |Receive Data Available Interrupt Enable Bit - * | | |0 = Receive data available interrupt Disabled. - * | | |1 = Receive data available interrupt Enabled. - * |[1] |THREIEN |Transmit Holding Register Empty Interrupt Enable Bit - * | | |0 = Transmit holding register empty interrupt Disabled. - * | | |1 = Transmit holding register empty interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive Line Status interrupt Disabled. - * | | |1 = Receive Line Status interrupt Enabled. - * |[3] |MODEMIEN |Modem Status Interrupt Enable Bit - * | | |0 = Modem status interrupt Disabled. - * | | |1 = Modem status interrupt Enabled. - * |[4] |RXTOIEN |RX Time-out Interrupt Enable Bit - * | | |0 = RX time-out interrupt Disabled. - * | | |1 = RX time-out interrupt Enabled. - * |[5] |BUFERRIEN |Buffer Error Interrupt Enable Bit - * | | |0 = Buffer error interrupt Disabled. - * | | |1 = Buffer error interrupt Enabled. - * |[6] |WKIEN |Wake-up Interrupt Enable Bit - * | | |0 = Wake-up Interrupt Disabled. - * | | |1 = Wake-up Interrupt Enabled. - * |[8] |LINIEN |LIN Bus Interrupt Enable Bit - * | | |0 = LIN bus interrupt Disabled. - * | | |1 = LIN bus interrupt Enabled. - * | | |Note: This bit is used for LIN function mode. - * |[11] |TOCNTEN |Receive Buffer Time-out Counter Enable Bit - * | | |0 = Receive Buffer Time-out counter Disabled. - * | | |1 = Receive Buffer Time-out counter Enabled. - * |[12] |ATORTSEN |nRTS Auto-flow Control Enable Bit - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: When nRTS auto-flow is enabled, if the number of bytes in the RX FIFO equals the RTSTRGLV (UART_FIFO[19:16]), the UART will de-assert nRTS signal. - * |[13] |ATOCTSEN |nCTS Auto-flow Control Enable Bit - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * | | |Note: When nCTS auto-flow is enabled, the UART will send data to external device if nCTS input assert (UART will not send data to device until nCTS is asserted). - * |[14] |TXPDMAEN |TX PDMA Enable Bit - * | | |This bit can enable or disable TX PDMA service. - * | | |0 = TX PDMA Disabled. - * | | |1 = TX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]) , UART PDMA transmit request operation is stop - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing '1' to corresponding BIF, FEF and PEF to make UART PDMA transmit request operation continue. - * |[15] |RXPDMAEN |RX PDMA Enable Bit - * | | |This bit can enable or disable RX PDMA service. - * | | |0 = RX PDMA Disabled. - * | | |1 = RX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]) , UART PDMA receive request operation is stop - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing '1' to corresponding BIF, FEF and PEF to make UART PDMA receive request operation continue. - * |[18] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[22] |TXENDIEN |Transmitter Empty Interrupt Enable Bit - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt TXENDINT (UART_INTSTS[30]) will be generated when TXENDIF (UART_INTSTS[22]) is set (TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted). - * | | |0 = Transmitter empty interrupt Disabled. - * | | |1 = Transmitter empty interrupt Enabled. - * @var UART_T::FIFO - * Offset: 0x08 UART FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RXRST |RX Field Software Reset - * | | |When RXRST (UART_FIFO[1]) is set, all the byte in the receiver FIFO and RX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the RX internal state machine and pointers. - * | | |Note1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note2: Before setting this bit, it should wait for the RXIDLE (UART_FIFOSTS[29]) be set. - * |[2] |TXRST |TX Field Software Reset - * | | |When TXRST (UART_FIFO[2]) is set, all the byte in the transmit FIFO and TX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the TX internal state machine and pointers. - * | | |Note1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note2: Before setting this bit, it should wait for the TXEMPTYF (UART_FIFOSTS[28]) be set. - * |[7:4] |RFITL |RX FIFO Interrupt Trigger Level - * | | |When the number of bytes in the receive FIFO equals the RFITL, the RDAIF (UART_INTSTS[0]) will be set (if RDAIEN (UART_INTEN [0]) enabled, and an interrupt will be generated). - * | | |0000 = RX FIFO Interrupt Trigger Level is 1 byte. - * | | |0001 = RX FIFO Interrupt Trigger Level is 4 bytes. - * | | |0010 = RX FIFO Interrupt Trigger Level is 8 bytes. - * | | |0011 = RX FIFO Interrupt Trigger Level is 14 bytes. - * | | |Others = Reserved. - * |[8] |RXOFF |Receiver Disable Bit - * | | |The receiver is disabled or not (set 1 to disable receiver). - * | | |0 = Receiver Enabled. - * | | |1 = Receiver Disabled. - * | | |Note: This bit is used for RS-485 Normal Multi-drop mode - * | | |It should be programmed before RS485NMM (UART_ALTCTL [8]) is programmed. - * |[19:16] |RTSTRGLV |nRTS Trigger Level for Auto-flow Control Use - * | | |0000 = nRTS Trigger Level is 1 byte. - * | | |0001 = nRTS Trigger Level is 4 bytes. - * | | |0010 = nRTS Trigger Level is 8 bytes. - * | | |0011 = nRTS Trigger Level is 14 bytes. - * | | |Others = Reserved. - * | | |Note: This field is used for auto nRTS flow control. - * @var UART_T::LINE - * Offset: 0x0C UART Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WLS |Word Length Selection - * | | |This field sets UART word length. - * | | |00 = 5 bits. - * | | |01 = 6 bits. - * | | |10 = 7 bits. - * | | |11 = 8 bits. - * |[2] |NSB |Number of 'STOP Bit' - * | | |0 = One 'STOP bit' is generated in the transmitted data. - * | | |1 = When select 5-bit word length, 1.5 'STOP bit' is generated in the transmitted data - * | | |When select 6-, 7- and 8-bit word length, 2 'STOP bit' is generated in the transmitted data. - * |[3] |PBE |Parity Bit Enable Bit - * | | |0 = Parity bit generated Disabled. - * | | |1 = Parity bit generated Enabled. - * | | |Note: Parity bit is generated on each outgoing character and is checked on each incoming data. - * |[4] |EPE |Even Parity Enable Bit - * | | |0 = Odd number of logic '1's is transmitted and checked in each word. - * | | |1 = Even number of logic '1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) is set. - * |[5] |SPE |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: If PBE (UART_LINE[3]) and EPE (UART_LINE[4]) are logic 1, the parity bit is transmitted and checked as logic 0 - * | | |If PBE (UART_LINE[3]) is 1 and EPE (UART_LINE[4]) is 0 then the parity bit is transmitted and checked as 1. - * |[6] |BCB |Break Control Bit - * | | |0 = Break Control Disabled. - * | | |1 = Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the transmitted serial data output (TX) is forced to the Spacing State (logic 0) - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[7] |PSS |Parity Bit Source Selection - * | | |The parity bit can be selected to be generated and checked automatically or by software. - * | | |0 = Parity bit is generated by EPE (UART_LINE[4]) and SPE (UART_LINE[5]) setting and checked automatically. - * | | |1 = Parity bit generated and checked by software. - * | | |Note1: This bit has effect only when PBE (UART_LINE[3]) is set. - * | | |Note2: If PSS is 0, the parity bit is transmitted and checked automatically - * | | |If PSS is 1, the transmitted parity bit value can be determined by writing PARITY (UART_DAT[8]) and the parity bit can be read by reading PARITY (UART_DAT[8]). - * |[8] |TXDINV |TX Data Inverted - * | | |0 = Transmitted data signal inverted Disabled. - * | | |1 = Transmitted data signal inverted Enabled. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select UART, LIN or RS485 function. - * |[9] |RXDINV |RX Data Inverted - * | | |0 = Received data signal inverted Disabled. - * | | |1 = Received data signal inverted Enabled. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select UART, LIN or RS485 function. - * @var UART_T::MODEM - * Offset: 0x10 UART Modem Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RTS |nRTS (Request-to-send) Signal Control - * | | |This bit is direct control internal nRTS signal active or not, and then drive the nRTS pin output with RTSACTLV bit configuration. - * | | |0 = nRTS signal is active. - * | | |1 = nRTS signal is inactive. - * | | |Note1: This nRTS signal control bit is not effective when nRTS auto-flow control is enabled in UART function mode. - * | | |Note2: This nRTS signal control bit is not effective when RS-485 auto direction mode (AUD) is enabled in RS-485 function mode. - * |[9] |RTSACTLV |nRTS Pin Active Level - * | | |This bit defines the active level state of nRTS pin output. - * | | |0 = nRTS pin output is high level active. - * | | |1 = nRTS pin output is low level active. (Default) - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * |[13] |RTSSTS |nRTS Pin Status (Read Only) - * | | |This bit mirror from nRTS pin output of voltage logic status. - * | | |0 = nRTS pin output is low level voltage logic state. - * | | |1 = nRTS pin output is high level voltage logic state. - * @var UART_T::MODEMSTS - * Offset: 0x14 UART Modem Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSDETF |Detect nCTS State Change Flag - * | | |This bit is set whenever nCTS input has change state, and it will generate Modem interrupt to CPU when MODEMIEN (UART_INTEN [3]) is set to 1. - * | | |0 = nCTS input has not change state. - * | | |1 = nCTS input has change state. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[4] |CTSSTS |nCTS Pin Status (Read Only) - * | | |This bit mirror from nCTS pin input of voltage logic status. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - * | | |Note: This bit echoes when UART controller peripheral clock is enabled, and nCTS multi-function port is selected. - * |[8] |CTSACTLV |nCTS Pin Active Level - * | | |This bit defines the active level state of nCTS pin input. - * | | |0 = nCTS pin input is high level active. - * | | |1 = nCTS pin input is low level active. (Default) - * | | |Note: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * @var UART_T::FIFOSTS - * Offset: 0x18 UART FIFO Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXOVIF |RX Overflow Error Interrupt Flag - * | | |This bit is set when RX FIFO overflow. - * | | |If the number of bytes of received data is greater than RX_FIFO (UART_DAT) size 16 bytes, this bit will be set. - * | | |0 = RX FIFO is not overflow. - * | | |1 = RX FIFO is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[1] |ABRDIF |Auto-baud Rate Detect Interrupt Flag - * | | |This bit is set to logic '1' when auto-baud rate detect function is finished. - * | | |0 = Auto-baud rate detect function is not finished. - * | | |1 = Auto-baud rate detect function is finished. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[2] |ABRDTOIF |Auto-baud Rate Detect Time-out Interrupt Flag - * | | |This bit is set to logic '1' in Auto-baud Rate Detect mode when the baud rate counter is overflow. - * | | |0 = Auto-baud rate counter is underflow. - * | | |1 = Auto-baud rate counter is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[3] |ADDRDETF |RS-485 Address Byte Detect Flag - * | | |0 = Receiver detects a data that is not an address bit (bit 9 ='0'). - * | | |1 = Receiver detects a data that is an address bit (bit 9 ='1'). - * | | |Note1: This field is used for RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1 to enable Address detection mode. - * | | |Note2: This bit can be cleared by writing '1' to it. - * |[4] |PEF |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'parity bit'. - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[5] |FEF |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'stop bit' - * | | |(that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[6] |BIF |Break Interrupt Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the 'spacing state' (logic 0) - * | | |for longer than a full word transmission time (that is, the total time of start bit + data bits + parity + stop bits). - * | | |0 = No Break interrupt is generated. - * | | |1 = Break interrupt is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[13:8] |RXPTR |RX FIFO Pointer (Read Only) - * | | |This field indicates the RX FIFO Buffer Pointer - * | | |When UART receives one byte from external device, RXPTR increases one - * | | |When one byte of RX FIFO is read by CPU, RXPTR decreases one. - * | | |The Maximum value shown in RXPTR is 15 - * | | |When the using level of RX FIFO Buffer equal to 16, the RXFULL bit is set to 1 and RXPTR will show 0 - * | | |As one byte of RX FIFO is read by CPU, the RXFULL bit is cleared to 0 and RXPTR will show 15 - * |[14] |RXEMPTY |Receiver FIFO Empty (Read Only) - * | | |This bit initiate RX FIFO empty or not. - * | | |0 = RX FIFO is not empty. - * | | |1 = RX FIFO is empty. - * | | |Note: When the last byte of RX FIFO has been read by CPU, hardware sets this bit high - * | | |It will be cleared when UART receives any new data. - * |[15] |RXFULL |Receiver FIFO Full (Read Only) - * | | |This bit initiates RX FIFO full or not. - * | | |0 = RX FIFO is not full. - * | | |1 = RX FIFO is full. - * | | |Note: This bit is set when the number of usage in RX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[21:16] |TXPTR |TX FIFO Pointer (Read Only) - * | | |This field indicates the TX FIFO Buffer Pointer - * | | |When CPU writes one byte into UART_DAT, TXPTR increases one - * | | |When one byte of TX FIFO is transferred to Transmitter Shift Register, TXPTR decreases one. - * | | |The Maximum value shown in TXPTR is 15 - * | | |When the using level of TX FIFO Buffer equal to 16, the TXFULL bit is set to 1 and TXPTR will show 0 - * | | |As one byte of TX FIFO is transferred to Transmitter Shift Register, the TXFULL bit is cleared to 0 and TXPTR will show 15 - * |[22] |TXEMPTY |Transmitter FIFO Empty (Read Only) - * | | |This bit indicates TX FIFO empty or not. - * | | |0 = TX FIFO is not empty. - * | | |1 = TX FIFO is empty. - * | | |Note: When the last byte of TX FIFO has been transferred to Transmitter Shift Register, hardware sets this bit high - * | | |It will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[23] |TXFULL |Transmitter FIFO Full (Read Only) - * | | |This bit indicates TX FIFO full or not. - * | | |0 = TX FIFO is not full. - * | | |1 = TX FIFO is full. - * | | |Note: This bit is set when the number of usage in TX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[24] |TXOVIF |TX Overflow Error Interrupt Flag - * | | |If TX FIFO (UART_DAT) is full, an additional write to UART_DAT will cause this bit to logic 1. - * | | |0 = TX FIFO is not overflow. - * | | |1 = TX FIFO is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[28] |TXEMPTYF |Transmitter Empty Flag (Read Only) - * | | |This bit is set by hardware when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted. - * | | |0 = TX FIFO is not empty or the STOP bit of the last byte has been not transmitted. - * | | |1 = TX FIFO is empty and the STOP bit of the last byte has been transmitted. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[29] |RXIDLE |RX Idle Status (Read Only) - * | | |This bit is set by hardware when RX is idle. - * | | |0 = RX is busy. - * | | |1 = RX is idle. (Default) - * |[31] |TXRXACT |TX and RX Active Status (Read Only) - * | | |This bit indicates TX and RX are active or inactive. - * | | |0 = TX and RX are inactive. - * | | |1 = TX and RX are active. (Default) - * | | |Note: When TXRXDIS (UART_FUNCSEL[3]) is set and both TX and RX are in idle state, this bit is cleared - * | | |The UART controller can not transmit or receive data at this moment - * | | |Otherwise this bit is set. - * @var UART_T::INTSTS - * Offset: 0x1C UART Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIF |Receive Data Available Interrupt Flag - * | | |When the number of bytes in the RX FIFO equals the RFITL then the RDAIF(UART_INTSTS[0]) will be set - * | | |If RDAIEN (UART_INTEN [0]) is enabled, the RDA interrupt will be generated. - * | | |0 = No RDA interrupt flag is generated. - * | | |1 = RDA interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when the number of unread bytes of RX FIFO drops below the threshold level (RFITL(UART_FIFO[7:4]). - * |[1] |THREIF |Transmit Holding Register Empty Interrupt Flag - * | | |This bit is set when the last data of TX FIFO is transferred to Transmitter Shift Register - * | | |If THREIEN (UART_INTEN[1]) is enabled, the THRE interrupt will be generated. - * | | |0 = No THRE interrupt flag is generated. - * | | |1 = THRE interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[2] |RLSIF |Receive Line Interrupt Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]), is set) - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated. - * | | |1 = RLS interrupt flag is generated. - * | | |Note1: In RS-485 function mode, this field is set include "receiver detect and received address byte character (bit9 = '1') bit" - * | | |At the same time, the bit of ADDRDETF (UART_FIFOSTS[3]) is also set. - * | | |Note2: This bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]) , FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[3] |MODEMIF |MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS[0]) = 1) - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated. - * | | |1 = Modem interrupt flag is generated. - * | | |Note: This bit is read only and reset to 0 when bit CTSDETF is cleared by a write 1 on CTSDETF(UART_MODEMSTS[0]). - * |[4] |RXTOIF |RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]) - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated. - * | | |0 = No RX time-out interrupt flag is generated. - * | | |1 = RX time-out interrupt flag is generated. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[5] |BUFERRIF |Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX FIFO or RX FIFO overflows (TXOVIF (UART_FIFOSTS[24]) or RXOVIF (UART_FIFOSTS[0]) is set) - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer is not correct - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated. - * | | |1 = Buffer error interrupt flag is generated. - * | | |Note: This bit is cleared if both of RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]) are cleared to 0 by writing 1 to RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]). - * |[6] |WKIF |UART Wake-up Interrupt Flag (Read Only) - * | | |This bit is set when TOUTWKF (UART_WKSTS[4]), RS485WKF (UART_WKSTS[3]), RFRTWKF (UART_WKSTS[2]), DATWKF (UART_WKSTS[1]) or CTSWKF(UART_WKSTS[0]) is set to 1. - * | | |0 = No UART wake-up interrupt flag is generated. - * | | |1 = UART wake-up interrupt flag is generated. - * | | |Note: This bit is cleared if all of TOUTWKF, RS485WKF, RFRTWKF, DATWKF and CTSWKF are cleared to 0 by writing 1 to the corresponding interrupt flag. - * |[7] |LINIF |LIN Bus Interrupt Flag - * | | |This bit is set when LIN slave header detect (SLVHDETF (UART_LINSTS[0] = 1)), LIN break detect (BRKDETF(UART_LINSTS[8]=1)), bit error detect (BITEF(UART_LINSTS[9]=1)), LIN slave ID parity error (SLVIDPEF(UART_LINSTS[2] = 1)) or LIN slave header error detect (SLVHEF (UART_LINSTS[1])) - * | | |If LINIEN (UART_INTEN [8]) is enabled the LIN interrupt will be generated. - * | | |0 = None of SLVHDETF, BRKDETF, BITEF, SLVIDPEF and SLVHEF is generated. - * | | |1 = At least one of SLVHDETF, BRKDETF, BITEF, SLVIDPEF and SLVHEF is generated. - * | | |Note: This bit is cleared when SLVHDETF(UART_LINSTS[0]), BRKDETF(UART_LINSTS[8]), BITEF(UART_LINSTS[9]), SLVIDPEF (UART_LINSTS[2]) and SLVHEF(UART_LINSTS[1]) all are cleared and software writing '1' to LINIF(UART_INTSTS[7]). - * |[8] |RDAINT |Receive Data Available Interrupt Indicator (Read Only) - * | | |This bit is set if RDAIEN (UART_INTEN[0]) and RDAIF (UART_INTSTS[0]) are both set to 1. - * | | |0 = No RDA interrupt is generated. - * | | |1 = RDA interrupt is generated. - * |[9] |THREINT |Transmit Holding Register Empty Interrupt Indicator (Read Only) - * | | |This bit is set if THREIEN (UART_INTEN[1]) and THREIF(UART_INTSTS[1]) are both set to 1. - * | | |0 = No THRE interrupt is generated. - * | | |1 = THRE interrupt is generated. - * |[10] |RLSINT |Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and RLSIF(UART_INTSTS[2]) are both set to 1. - * | | |0 = No RLS interrupt is generated. - * | | |1 = RLS interrupt is generated. - * |[11] |MODEMINT |MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN(UART_INTEN[3]) and MODEMIF(UART_INTSTS[3]) are both set to 1 - * | | |0 = No Modem interrupt is generated. - * | | |1 = Modem interrupt is generated. - * |[12] |RXTOINT |RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and RXTOIF(UART_INTSTS[4]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated. - * | | |1 = RX time-out interrupt is generated. - * |[13] |BUFERRINT |Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN(UART_INTEN[5]) and BUFERRIF(UART_ INTSTS[5]) are both set to 1. - * | | |0 = No buffer error interrupt is generated. - * | | |1 = Buffer error interrupt is generated. - * |[14] |WKINT |UART Wake-up Interrupt Indicator (Read Only) - * | | |This bit is set if WKIEN (UART_INTEN[6]) and WKIF (UART_INTSTS[6]) are both set to 1. - * | | |0 = No UART wake-up interrupt is generated. - * | | |1 = UART wake-up interrupt is generated. - * |[15] |LININT |LIN Bus Interrupt Indicator (Read Only) - * | | |This bit is set if LINIEN (UART_INTEN[8]) and LINIF(UART_INTSTS[7]) are both set to 1. - * | | |0 = No LIN Bus interrupt is generated. - * | | |1 = The LIN Bus interrupt is generated. - * |[18] |HWRLSIF |PDMA Mode Receive Line Status Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF (UART_FIFOSTS[6]), FEF (UART_FIFOSTS[5]) and PEF (UART_FIFOSTS[4]) is set) - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated in PDMA mode. - * | | |1 = RLS interrupt flag is generated in PDMA mode. - * | | |Note1: In RS-485 function mode, this field include "receiver detect any address byte received address byte character (bit9 = '1') bit". - * | | |Note2: In UART function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]) , FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared - * |[19] |HWMODIF |PDMA Mode MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS [0] =1)) - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated in PDMA mode. - * | | |1 = Modem interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and reset to 0 when the bit CTSDETF (UART_MODEMSTS[0]) is cleared by writing 1 on CTSDETF (UART_MODEMSTS [0]). - * |[20] |HWTOIF |PDMA Mode RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]) - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated . - * | | |0 = No RX time-out interrupt flag is generated in PDMA mode. - * | | |1 = RX time-out interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[21] |HWBUFEIF |PDMA Mode Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX or RX FIFO overflows (TXOVIF (UART_FIFOSTS [24]) or RXOVIF (UART_FIFOSTS[0]) is set) - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer maybe is not correct - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated in PDMA mode. - * | | |1 = Buffer error interrupt flag is generated in PDMA mode. - * | | |Note: This bit is cleared when both TXOVIF (UART_FIFOSTS[24]]) and RXOVIF (UART_FIFOSTS[0]) are cleared. - * |[22] |TXENDIF |Transmitter Empty Interrupt Flag - * | | |This bit is set when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted (TXEMPTYF (UART_FIFOSTS[28]) is set) - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt will be generated. - * | | |0 = No transmitter empty interrupt flag is generated. - * | | |1 = Transmitter empty interrupt flag is generated. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[26] |HWRLSINT |PDMA Mode Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and HWRLSIF(UART_INTSTS[18]) are both set to 1. - * | | |0 = No RLS interrupt is generated in PDMA mode. - * | | |1 = RLS interrupt is generated in PDMA mode. - * |[27] |HWMODINT |PDMA Mode MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN (UART_INTEN[3]) and HWMODIF(UART_INTSTS[19]) are both set to 1. - * | | |0 = No Modem interrupt is generated in PDMA mode. - * | | |1 = Modem interrupt is generated in PDMA mode. - * |[28] |HWTOINT |PDMA Mode RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and HWTOIF(UART_INTSTS[20]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated in PDMA mode. - * | | |1 = RX time-out interrupt is generated in PDMA mode. - * |[29] |HWBUFEINT |PDMA Mode Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN (UART_INTEN[5]) and HWBUFEIF (UART_INTSTS[21]) are both set to 1. - * | | |0 = No buffer error interrupt is generated in PDMA mode. - * | | |1 = Buffer error interrupt is generated in PDMA mode. - * |[30] |TXENDINT |Transmitter Empty Interrupt Indicator (Read Only) - * | | |This bit is set if TXENDIEN (UART_INTEN[22]) and TXENDIF(UART_INTSTS[22]) are both set to 1. - * | | |0 = No Transmitter Empty interrupt is generated. - * | | |1 = Transmitter Empty interrupt is generated. - * |[31] |ABRINT |Auto-baud Rate Interrupt Indicator (Read Only) - * | | |This bit is set if ABRIEN (UART_INTEN[18]) and ABRIF (UART_ALTCTL[17]) are both set to 1. - * | | |0 = No Auto-baud Rate interrupt is generated. - * | | |1 = The Auto-baud Rate interrupt is generated. - * @var UART_T::TOUT - * Offset: 0x20 UART Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TOIC |Time-out Interrupt Comparator - * | | |The time-out counter resets and starts counting (the counting clock = baud rate) whenever the RX FIFO receives a new data word if time out counter is enabled by setting TOCNTEN (UART_INTEN[11]) - * | | |Once the content of time-out counter is equal to that of time-out interrupt comparator (TOIC (UART_TOUT[7:0])), a receiver time-out interrupt (RXTOINT(UART_INTSTS[12])) is generated if RXTOIEN (UART_INTEN [4]) enabled - * | | |A new incoming data word or RX FIFO empty will clear RXTOIF (UART_INTSTS[4]) - * | | |In order to avoid receiver time-out interrupt generation immediately during one character is being received, TOIC value should be set between 40 and 255 - * | | |So, for example, if TOIC is set with 40, the time-out interrupt is generated after four characters are not received when 1 stop bit and no parity check is set for UART transfer. - * |[15:8] |DLY |TX Delay Time Value - * | | |This field is used to programming the transfer delay time between the last stop bit and next start bit - * | | |The unit is bit time. - * @var UART_T::BAUD - * Offset: 0x24 UART Baud Rate Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |BRD |Baud Rate Divider - * | | |The field indicates the baud rate divider - * | | |This filed is used in baud rate calculation - * | | |The detail description is shown in Table 7.15-4. - * |[27:24] |EDIVM1 |Extra Divider for BAUD Rate Mode 1 - * | | |This field is used for baud rate calculation in mode 1 and has no effect for baud rate calculation in mode 0 and mode 2 - * | | |The detail description is shown in Table 7.15-4 - * |[28] |BAUDM0 |BAUD Rate Mode Selection Bit 0 - * | | |This bit is baud rate mode selection bit 0 - * | | |UART provides three baud rate calculation modes - * | | |This bit combines with BAUDM1 (UART_BAUD[29]) to select baud rate calculation mode - * | | |The detail description is shown in Table 7.15-4. - * |[29] |BAUDM1 |BAUD Rate Mode Selection Bit 1 - * | | |This bit is baud rate mode selection bit 1 - * | | |UART provides three baud rate calculation modes - * | | |This bit combines with BAUDM0 (UART_BAUD[28]) to select baud rate calculation mode - * | | |The detail description is shown in Table 7.15-4. - * | | |Note: In IrDA mode must be operated in mode 0. - * @var UART_T::IRDA - * Offset: 0x28 UART IrDA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXEN |IrDA Receiver/Transmitter Selection Enable Bit - * | | |0 = IrDA Transmitter Disabled and Receiver Enabled. (Default) - * | | |1 = IrDA Transmitter Enabled and Receiver Disabled. - * |[5] |TXINV |IrDA Inverse Transmitting Output Signal - * | | |0 = None inverse transmitting signal. (Default). - * | | |1 = Inverse transmitting output signal. - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select IrDA function. - * |[6] |RXINV |IrDA Inverse Receive Input Signal - * | | |0 = None inverse receiving input signal. - * | | |1 = Inverse receiving input signal. (Default) - * | | |Note1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note2: This bit is valid when FUNCSEL (UART_FUNCSEL[1:0]) is select IrDA function. - * @var UART_T::ALTCTL - * Offset: 0x2C UART Alternate Control/Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |BRKFL |UART LIN Break Field Length - * | | |This field indicates a 4-bit LIN TX break field count. - * | | |Note1: This break field length is BRKFL + 1. - * | | |Note2: According to LIN spec, the reset value is 0xC (break field length = 13). - * |[6] |LINRXEN |LIN RX Enable Bit - * | | |0 = LIN RX mode Disabled. - * | | |1 = LIN RX mode Enabled. - * |[7] |LINTXEN |LIN TX Break Mode Enable Bit - * | | |0 = LIN TX Break mode Disabled. - * | | |1 = LIN TX Break mode Enabled. - * | | |Note: When TX break field transfer operation finished, this bit will be cleared automatically. - * |[8] |RS485NMM |RS-485 Normal Multi-drop Operation Mode (NMM) - * | | |0 = RS-485 Normal Multi-drop Operation mode (NMM) Disabled. - * | | |1 = RS-485 Normal Multi-drop Operation mode (NMM) Enabled. - * | | |Note: It cannot be active with RS-485_AAD operation mode. - * |[9] |RS485AAD |RS-485 Auto Address Detection Operation Mode (AAD) - * | | |0 = RS-485 Auto Address Detection Operation mode (AAD) Disabled. - * | | |1 = RS-485 Auto Address Detection Operation mode (AAD) Enabled. - * | | |Note: It cannot be active with RS-485_NMM operation mode. - * |[10] |RS485AUD |RS-485 Auto Direction Function (AUD) - * | | |0 = RS-485 Auto Direction Operation function (AUD) Disabled. - * | | |1 = RS-485 Auto Direction Operation function (AUD) Enabled. - * | | |Note: It can be active with RS-485_AAD or RS-485_NMM operation mode. - * |[15] |ADDRDEN |RS-485 Address Detection Enable Bit - * | | |This bit is used to enable RS-485 Address Detection mode. - * | | |0 = Address detection mode Disabled. - * | | |1 = Address detection mode Enabled. - * | | |Note: This bit is used for RS-485 any operation mode. - * |[17] |ABRIF |Auto-baud Rate Interrupt Flag (Read Only) - * | | |This bit is set when auto-baud rate detection function finished or the auto-baud rate counter was overflow and if ABRIEN(UART_INTEN [18]) is set then the auto-baud rate interrupt will be generated. - * | | |0 = No auto-baud rate interrupt flag is generated. - * | | |1 = Auto-baud rate interrupt flag is generated. - * | | |Note: This bit is read only, but it can be cleared by writing '1' to ABRDTOIF (UART_FIFOSTS[2]) and ABRDIF(UART_FIFOSTS[1]) - * |[18] |ABRDEN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note : This bit is cleared automatically after auto-baud detection is finished. - * |[20:19] |ABRDBITS |Auto-baud Rate Detect Bit Length - * | | |00 = 1-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x01. - * | | |01 = 2-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x02. - * | | |10 = 4-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x08. - * | | |11 = 8-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x80. - * | | |Note : The calculation of bit number includes the START bit. - * |[31:24] |ADDRMV |Address Match Value - * | | |This field contains the RS-485 address match values. - * | | |Note: This field is used for RS-485 auto address detection mode. - * @var UART_T::FUNCSEL - * Offset: 0x30 UART Function Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FUNCSEL |Function Select - * | | |00 = UART function. - * | | |01 = LIN function. - * | | |10 = IrDA function. - * | | |11 = RS-485 function. - * |[3] |TXRXDIS |TX and RX Disable Bit - * | | |Setting this bit can disable TX and RX. - * | | |0 = TX and RX Enabled. - * | | |1 = TX and RX Disabled. - * | | |Note: The TX and RX will not disable immediately when this bit is set - * | | |The TX and RX complete current task before disable TX and RX - * | | |When TX and RX disable, the TXRXACT (UART_FIFOSTS[31]) is cleared. - * @var UART_T::LINCTL - * Offset: 0x34 UART LIN Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLVEN |LIN Slave Mode Enable Bit - * | | |0 = LIN slave mode Disabled. - * | | |1 = LIN slave mode Enabled. - * |[1] |SLVHDEN |LIN Slave Header Detection Enable Bit - * | | |0 = LIN slave header detection Disabled. - * | | |1 = LIN slave header detection Enabled. - * | | |Note1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note2: In LIN function mode, when detect header field (break + sync + frame ID), SLVHDETF (UART_LINSTS [0]) flag will be asserted - * | | |If the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * |[2] |SLVAREN |LIN Slave Automatic Resynchronization Mode Enable Bit - * | | |0 = LIN automatic resynchronization Disabled. - * | | |1 = LIN automatic resynchronization Enabled. - * | | |Note1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note2: When operation in Automatic Resynchronization mode, the baud rate setting must be mode2 (BAUDM1 (UART_BAUD [29]) and BAUDM0 (UART_BAUD [28]) must be 1). - * | | |Note3: The control and interactions of this field are explained in 7.15.5.9 (Slave mode with automatic resynchronization). - * |[3] |SLVDUEN |LIN Slave Divider Update Method Enable Bit - * | | |0 = UART_BAUD updated is written by software (if no automatic resynchronization update occurs at the same time). - * | | |1 = UART_BAUD is updated at the next received character - * | | |User must set the bit before checksum reception. - * | | |Note1: This bit only valid when in LIN slave mode (SLVEN (UART_LINCTL[0]) = 1). - * | | |Note2: This bit used for LIN Slave Automatic Resynchronization mode - * | | |(for Non-Automatic Resynchronization mode, this bit should be kept cleared) - * | | |Note3: The control and interactions of this field are explained in 7.15.5.9 (Slave mode with automatic resynchronization). - * |[4] |MUTE |LIN Mute Mode Enable Bit - * | | |0 = LIN mute mode Disabled. - * | | |1 = LIN mute mode Enabled. - * | | |Note: The exit from mute mode condition and each control and interactions of this field are explained in 7.15.5.9 (LIN slave mode). - * |[8] |SENDH |LIN TX Send Header Enable Bit - * | | |The LIN TX header can be break field or 'break and sync field' or 'break, sync and frame ID field', it is depend on setting HSEL (UART_LINCTL[23:22]). - * | | |0 = Send LIN TX header Disabled. - * | | |1 = Send LIN TX header Enabled. - * | | |Note1: This bit is shadow bit of LINTXEN (UART_ALTCTL [7]); user can read/write it by setting LINTXEN (UART_ALTCTL [7]) or SENDH (UART_LINCTL [8]). - * | | |Note2: When transmitter header field (it may be 'break' or 'break + sync' or 'break + sync + frame ID' selected by HSEL (UART_LINCTL[23:22]) field) transfer operation finished, this bit will be cleared automatically. - * |[9] |IDPEN |LIN ID Parity Enable Bit - * | | |0 = LIN frame ID parity Disabled. - * | | |1 = LIN frame ID parity Enabled. - * | | |Note1: This bit can be used for LIN master to sending header field (SENDH (UART_LINCTL[8])) = 1 and HSEL (UART_LINCTL[23:22]) = 10 or be used for enable LIN slave received frame ID parity checked. - * | | |Note2: This bit is only used when the operation header transmitter is in HSEL (UART_LINCTL[23:22]) = 10 - * |[10] |BRKDETEN |LIN Break Detection Enable Bit - * | | |When detect consecutive dominant greater than 11 bits, and are followed by a delimiter character, the BRKDETF (UART_LINSTS[8]) flag is set at the end of break field - * | | |If the LINIEN (UART_INTEN [8])=1, an interrupt will be generated. - * | | |0 = LIN break detection Disabled . - * | | |1 = LIN break detection Enabled. - * |[11] |LINRXOFF |LIN Receiver Disable Bit - * | | |If the receiver is enabled (LINRXOFF (UART_LINCTL[11] ) = 0), all received byte data will be accepted and stored in the RX FIFO, and if the receiver is disabled (LINRXOFF (UART_LINCTL[11] = 1), all received byte data will be ignore. - * | | |0 = LIN receiver Enabled. - * | | |1 = LIN receiver Disabled. - * | | |Note: This bit is only valid when operating in LIN function mode (FUNCSEL (UART_FUNCSEL[1:0]) = 01). - * |[12] |BITERREN |Bit Error Detect Enable Bit - * | | |0 = Bit error detection function Disabled. - * | | |1 = Bit error detection function Enabled. - * | | |Note: In LIN function mode, when occur bit error, the BITEF (UART_LINSTS[9]) flag will be asserted - * | | |If the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * |[19:16] |BRKFL |LIN Break Field Length - * | | |This field indicates a 4-bit LIN TX break field count. - * | | |Note1: These registers are shadow registers of BRKFL (UART_ALTCTL[3:0]), User can read/write it by setting BRKFL (UART_ALTCTL[3:0]) or BRKFL (UART_LINCTL[19:16]). - * | | |Note2: This break field length is BRKFL + 1. - * | | |Note3: According to LIN spec, the reset value is 12 (break field length = 13). - * |[21:20] |BSL |LIN Break/Sync Delimiter Length - * | | |00 = The LIN break/sync delimiter length is 1-bit time. - * | | |01 = The LIN break/sync delimiter length is 2-bit time. - * | | |10 = The LIN break/sync delimiter length is 3-bit time. - * | | |11 = The LIN break/sync delimiter length is 4-bit time. - * | | |Note: This bit used for LIN master to sending header field. - * |[23:22] |HSEL |LIN Header Select - * | | |00 = The LIN header includes 'break field'. - * | | |01 = The LIN header includes 'break field' and 'sync field'. - * | | |10 = The LIN header includes 'break field', 'sync field' and 'frame ID field'. - * | | |11 = Reserved. - * | | |Note: This bit is used to master mode for LIN to send header field (SENDH (UART_LINCTL [8]) = 1) or used to slave to indicates exit from mute mode condition (MUTE (UART_LINCTL[4] = 1). - * |[31:24] |PID |LIN PID Bits - * | | |This field contains the LIN frame ID value when in LIN function mode, the frame ID parity can be generated by software or hardware depends on IDPEN (UART_LINCTL[9]) = 1. - * | | |If the parity generated by hardware, user fill ID0~ID5 (PID [29:24] ), hardware will calculate P0 (PID[30]) and P1 (PID[31]), otherwise user must filled frame ID and parity in this field. - * | | |Note1: User can fill any 8-bit value to this field and the bit 24 indicates ID0 (LSB first). - * | | |Note2: This field can be used for LIN master mode or slave mode. - * @var UART_T::LINSTS - * Offset: 0x38 UART LIN Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLVHDETF |LIN Slave Header Detection Flag - * | | |This bit is set by hardware when a LIN header is detected in LIN slave mode and be cleared by writing 1 to it. - * | | |0 = LIN header not detected. - * | | |1 = LIN header detected (break + sync + frame ID). - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when in LIN slave mode (SLVEN (UART_LINCTL [0]) = 1) and enable LIN slave header detection function (SLVHDEN (UART_LINCTL [1])). - * | | |Note3: When enable ID parity check IDPEN (UART_LINCTL [9]), if hardware detect complete header ('break + sync + frame ID'), the SLVHDETF will be set whether the frame ID correct or not. - * |[1] |SLVHEF |LIN Slave Header Error Flag - * | | |This bit is set by hardware when a LIN header error is detected in LIN slave mode and be cleared by writing 1 to it - * | | |The header errors include 'break delimiter is too short (less than 0.5 bit time)', 'frame error in sync field or Identifier field', - * | | |'sync field data is not 0x55 in Non-Automatic Resynchronization mode', 'sync field deviation error with Automatic Resynchronization mode', - * | | |'sync field measure time-out with Automatic Resynchronization mode' and 'LIN header reception time-out'. - * | | |0 = LIN header error not detected. - * | | |1 = LIN header error detected. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when UART is operated in LIN slave mode (SLVEN (UART_LINCTL [0]) = 1) and - * | | |enables LIN slave header detection function (SLVHDEN (UART_LINCTL [1])). - * |[2] |SLVIDPEF |LIN Slave ID Parity Error Flag - * | | |This bit is set by hardware when receipted frame ID parity is not correct. - * | | |0 = No active. - * | | |1 = Receipted frame ID parity is not correct. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when in LIN slave mode (SLVEN (UART_LINCTL [0])= 1) and enable LIN frame ID parity check function IDPEN (UART_LINCTL [9]). - * |[3] |SLVSYNCF |LIN Slave Sync Field - * | | |This bit indicates that the LIN sync field is being analyzed in Automatic Resynchronization mode - * | | |When the receiver header have some error been detect, user must reset the internal circuit to re-search new frame header by writing 1 to this bit. - * | | |0 = The current character is not at LIN sync state. - * | | |1 = The current character is at LIN sync state. - * | | |Note1: This bit is only valid when in LIN Slave mode (SLVEN(UART_LINCTL[0]) = 1). - * | | |Note2: This bit can be cleared by writing 1 to it. - * | | |Note3: When writing 1 to it, hardware will reload the initial baud rate and re-search a new frame header. - * |[8] |BRKDETF |LIN Break Detection Flag - * | | |This bit is set by hardware when a break is detected and be cleared by writing 1 to it through software. - * | | |0 = LIN break not detected. - * | | |1 = LIN break detected. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when LIN break detection function is enabled (BRKDETEN (UART_LINCTL[10]) =1). - * |[9] |BITEF |Bit Error Detect Status Flag - * | | |At TX transfer state, hardware will monitor the bus state, if the input pin (UART_RXD) state not equals to the output pin (UART_TXD) state, BITEF (UART_LINSTS[9]) will be set. - * | | |When occur bit error, if the LINIEN (UART_INTEN[8]) = 1, an interrupt will be generated. - * | | |0 = Bit error not detected. - * | | |1 = Bit error detected. - * | | |Note1: This bit can be cleared by writing 1 to it. - * | | |Note2: This bit is only valid when enable bit error detection function (BITERREN (UART_LINCTL [12]) = 1). - * @var UART_T::BRCOMP - * Offset: 0x3C UART Baud Rate Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |BRCOMP |Baud Rate Compensation Patten - * | | |These 9-bits are used to define the relative bit is compensated or not. - * | | |BRCOMP[7:0] is used to define the compensation of UART_DAT[7:0] and BRCOM[8] is used to define the parity bit. - * |[31] |BRCOMPDEC |Baud Rate Compensation Decrease - * | | |0 = Positive (increase one module clock) compensation for each compensated bit. - * | | |1 = Negative (decrease one module clock) compensation for each compensated bit. - * @var UART_T::WKCTL - * Offset: 0x40 UART Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKCTSEN |nCTS Wake-up Enable Bit - * | | |0 = nCTS Wake-up system function Disabled. - * | | |1 = nCTS Wake-up system function Enabled, when the system is in Power-down mode, an external. - * | | |nCTS change will wake-up system from Power-down mode. - * |[1] |WKDATEN |Incoming Data Wake-up Enable Bit - * | | |0 = Incoming data wake-up system function Disabled. - * | | |1 = Incoming data wake-up system function Enabled, when the system is in Power-down mode,. - * | | |incoming data will wake-up system from Power-down mode. - * |[2] |WKRFRTEN |Received Data FIFO Reached Threshold Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold wake-up system function Enabled, when the system is. - * | | |in Power-down mode, Received Data FIFO reached threshold will wake-up system from - * | | |Power-down mode. - * |[3] |WKRS485EN |RS-485 Address Match (AAD Mode) Wake-up Enable Bit - * | | |0 = RS-485 Address Match (AAD mode) wake-up system function Disabled. - * | | |1 = RS-485 Address Match (AAD mode) wake-up system function Enabled, when the system is in. - * | | |Power-down mode, RS-485 Address Match will wake-up system from Power-down mode. - * | | |Note: This bit is used for RS-485 Auto Address Detection (AAD) mode in RS-485 function mode - * | | |and ADDRDEN (UART_ALTCTL[15]) is set to 1. - * |[4] |WKTOUTEN |Received Data FIFO Reached Threshold Time-out Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold time-out wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold time-out wake-up system function Enabled, when the. - * | | |system is in Power-down mode, Received Data FIFO reached threshold time-out will wake-up - * | | |system from Power-down mode. - * | | |Note: It is suggest the function is enabled when the WKRFRTEN (UART_WKCTL[2]) is set to 1. - * @var UART_T::WKSTS - * Offset: 0x44 UART Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSWKF |nCTS Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by nCTS wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by nCTS wake-up. - * | | |Note1: If WKCTSEN (UART_WKCTL[0]) is enabled, the nCTS wake-up cause this bit is set to '1'. - * | | |Note2: This bit can be cleared by writing '1' to it. - * |[1] |DATWKF |Incoming Data Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by data wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Incoming Data wake-up. - * | | |Note1: If WKDATEN (UART_WKCTL[1]) is enabled, the Incoming Data wake-up cause this bit is set to '1'. - * | | |Note2: This bit can be cleared by writing '1' to it. - * |[2] |RFRTWKF |Received Data FIFO Reached Threshold Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO reached threshold - * | | |wake-up . - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO Reached Threshold wake-up. - * | | |Note1: If WKRFRTEN (UART_WKCTL[2]) is enabled, the Received Data FIFO Reached Threshold wake-up cause this bit is set to '1'. - * | | |Note2: This bit can be cleared by writing '1' to it. - * |[3] |RS485WKF |RS-485 Address Match (AAD Mode) Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by RS-485 Address Match (AAD mode). - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by RS-485 Address Match (AAD mode) wake-up. - * | | |Note1: If WKRS485EN (UART_WKCTL[3]) is enabled, the RS-485 Address Match (AAD mode) wake-up cause this bit is set to '1'. - * | | |Note2: This bit can be cleared by writing '1' to it. - * |[4] |TOUTWKF |Received Data FIFO Threshold Time-out Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO Threshold Time-out - * | | |wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO reached threshold time-out. - * | | |wake-up. - * | | |Note1: If WKTOUTEN (UART_WKCTL[4]) is enabled, the Received Data FIFO reached threshold time-out wake-up cause this bit is set to '1'. - * | | |Note2: This bit can be cleared by writing '1' to it. - * @var UART_T::DWKCOMP - * Offset: 0x48 UART Incoming Data Wake-up Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STCOMP |Start Bit Compensation Value - * | | |These bits field indicate how many clock cycle selected by UART_CLK do the UART controller can get the 1st bit (start bit) when the device is wake-up from power-down mode. - * | | |Note: It is valid only when WKDATEN (UART_WKCTL[1]) is set. - */ - __IO uint32_t DAT; /*!< [0x0000] UART Receive/Transmit Buffer Register */ - __IO uint32_t INTEN; /*!< [0x0004] UART Interrupt Enable Register */ - __IO uint32_t FIFO; /*!< [0x0008] UART FIFO Control Register */ - __IO uint32_t LINE; /*!< [0x000c] UART Line Control Register */ - __IO uint32_t MODEM; /*!< [0x0010] UART Modem Control Register */ - __IO uint32_t MODEMSTS; /*!< [0x0014] UART Modem Status Register */ - __IO uint32_t FIFOSTS; /*!< [0x0018] UART FIFO Status Register */ - __IO uint32_t INTSTS; /*!< [0x001c] UART Interrupt Status Register */ - __IO uint32_t TOUT; /*!< [0x0020] UART Time-out Register */ - __IO uint32_t BAUD; /*!< [0x0024] UART Baud Rate Divider Register */ - __IO uint32_t IRDA; /*!< [0x0028] UART IrDA Control Register */ - __IO uint32_t ALTCTL; /*!< [0x002c] UART Alternate Control/Status Register */ - __IO uint32_t FUNCSEL; /*!< [0x0030] UART Function Select Register */ - __IO uint32_t LINCTL; /*!< [0x0034] UART LIN Control Register */ - __IO uint32_t LINSTS; /*!< [0x0038] UART LIN Status Register */ - __IO uint32_t BRCOMP; /*!< [0x003c] UART Baud Rate Compensation Register */ - __IO uint32_t WKCTL; /*!< [0x0040] UART Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0044] UART Wake-up Status Register */ - __IO uint32_t DWKCOMP; /*!< [0x0048] UART Incoming Data Wake-up Compensation Register */ - -} UART_T; - -/** - @addtogroup UART_CONST UART Bit Field Definition - Constant Definitions for UART Controller -@{ */ - -#define UART_DAT_DAT_Pos (0) /*!< UART_T::DAT: DAT Position */ -#define UART_DAT_DAT_Msk (0xfful << UART_DAT_DAT_Pos) /*!< UART_T::DAT: DAT Mask */ - -#define UART_DAT_PARITY_Pos (8) /*!< UART_T::DAT: PARITY Position */ -#define UART_DAT_PARITY_Msk (0x1ul << UART_DAT_PARITY_Pos) /*!< UART_T::DAT: PARITY Mask */ - -#define UART_INTEN_RDAIEN_Pos (0) /*!< UART_T::INTEN: RDAIEN Position */ -#define UART_INTEN_RDAIEN_Msk (0x1ul << UART_INTEN_RDAIEN_Pos) /*!< UART_T::INTEN: RDAIEN Mask */ - -#define UART_INTEN_THREIEN_Pos (1) /*!< UART_T::INTEN: THREIEN Position */ -#define UART_INTEN_THREIEN_Msk (0x1ul << UART_INTEN_THREIEN_Pos) /*!< UART_T::INTEN: THREIEN Mask */ - -#define UART_INTEN_RLSIEN_Pos (2) /*!< UART_T::INTEN: RLSIEN Position */ -#define UART_INTEN_RLSIEN_Msk (0x1ul << UART_INTEN_RLSIEN_Pos) /*!< UART_T::INTEN: RLSIEN Mask */ - -#define UART_INTEN_MODEMIEN_Pos (3) /*!< UART_T::INTEN: MODEMIEN Position */ -#define UART_INTEN_MODEMIEN_Msk (0x1ul << UART_INTEN_MODEMIEN_Pos) /*!< UART_T::INTEN: MODEMIEN Mask */ - -#define UART_INTEN_RXTOIEN_Pos (4) /*!< UART_T::INTEN: RXTOIEN Position */ -#define UART_INTEN_RXTOIEN_Msk (0x1ul << UART_INTEN_RXTOIEN_Pos) /*!< UART_T::INTEN: RXTOIEN Mask */ - -#define UART_INTEN_BUFERRIEN_Pos (5) /*!< UART_T::INTEN: BUFERRIEN Position */ -#define UART_INTEN_BUFERRIEN_Msk (0x1ul << UART_INTEN_BUFERRIEN_Pos) /*!< UART_T::INTEN: BUFERRIEN Mask */ - -#define UART_INTEN_WKIEN_Pos (6) /*!< UART_T::INTEN: WKIEN Position */ -#define UART_INTEN_WKIEN_Msk (0x1ul << UART_INTEN_WKIEN_Pos) /*!< UART_T::INTEN: WKIEN Mask */ - -#define UART_INTEN_LINIEN_Pos (8) /*!< UART_T::INTEN: LINIEN Position */ -#define UART_INTEN_LINIEN_Msk (0x1ul << UART_INTEN_LINIEN_Pos) /*!< UART_T::INTEN: LINIEN Mask */ - -#define UART_INTEN_TOCNTEN_Pos (11) /*!< UART_T::INTEN: TOCNTEN Position */ -#define UART_INTEN_TOCNTEN_Msk (0x1ul << UART_INTEN_TOCNTEN_Pos) /*!< UART_T::INTEN: TOCNTEN Mask */ - -#define UART_INTEN_ATORTSEN_Pos (12) /*!< UART_T::INTEN: ATORTSEN Position */ -#define UART_INTEN_ATORTSEN_Msk (0x1ul << UART_INTEN_ATORTSEN_Pos) /*!< UART_T::INTEN: ATORTSEN Mask */ - -#define UART_INTEN_ATOCTSEN_Pos (13) /*!< UART_T::INTEN: ATOCTSEN Position */ -#define UART_INTEN_ATOCTSEN_Msk (0x1ul << UART_INTEN_ATOCTSEN_Pos) /*!< UART_T::INTEN: ATOCTSEN Mask */ - -#define UART_INTEN_TXPDMAEN_Pos (14) /*!< UART_T::INTEN: TXPDMAEN Position */ -#define UART_INTEN_TXPDMAEN_Msk (0x1ul << UART_INTEN_TXPDMAEN_Pos) /*!< UART_T::INTEN: TXPDMAEN Mask */ - -#define UART_INTEN_RXPDMAEN_Pos (15) /*!< UART_T::INTEN: RXPDMAEN Position */ -#define UART_INTEN_RXPDMAEN_Msk (0x1ul << UART_INTEN_RXPDMAEN_Pos) /*!< UART_T::INTEN: RXPDMAEN Mask */ - -#define UART_INTEN_ABRIEN_Pos (18) /*!< UART_T::INTEN: ABRIEN Position */ -#define UART_INTEN_ABRIEN_Msk (0x1ul << UART_INTEN_ABRIEN_Pos) /*!< UART_T::INTEN: ABRIEN Mask */ - -#define UART_INTEN_TXENDIEN_Pos (22) /*!< UART_T::INTEN: TXENDIEN Position */ -#define UART_INTEN_TXENDIEN_Msk (0x1ul << UART_INTEN_TXENDIEN_Pos) /*!< UART_T::INTEN: TXENDIEN Mask */ - -#define UART_FIFO_RXRST_Pos (1) /*!< UART_T::FIFO: RXRST Position */ -#define UART_FIFO_RXRST_Msk (0x1ul << UART_FIFO_RXRST_Pos) /*!< UART_T::FIFO: RXRST Mask */ - -#define UART_FIFO_TXRST_Pos (2) /*!< UART_T::FIFO: TXRST Position */ -#define UART_FIFO_TXRST_Msk (0x1ul << UART_FIFO_TXRST_Pos) /*!< UART_T::FIFO: TXRST Mask */ - -#define UART_FIFO_RFITL_Pos (4) /*!< UART_T::FIFO: RFITL Position */ -#define UART_FIFO_RFITL_Msk (0xful << UART_FIFO_RFITL_Pos) /*!< UART_T::FIFO: RFITL Mask */ - -#define UART_FIFO_RXOFF_Pos (8) /*!< UART_T::FIFO: RXOFF Position */ -#define UART_FIFO_RXOFF_Msk (0x1ul << UART_FIFO_RXOFF_Pos) /*!< UART_T::FIFO: RXOFF Mask */ - -#define UART_FIFO_RTSTRGLV_Pos (16) /*!< UART_T::FIFO: RTSTRGLV Position */ -#define UART_FIFO_RTSTRGLV_Msk (0xful << UART_FIFO_RTSTRGLV_Pos) /*!< UART_T::FIFO: RTSTRGLV Mask */ - -#define UART_LINE_WLS_Pos (0) /*!< UART_T::LINE: WLS Position */ -#define UART_LINE_WLS_Msk (0x3ul << UART_LINE_WLS_Pos) /*!< UART_T::LINE: WLS Mask */ - -#define UART_LINE_NSB_Pos (2) /*!< UART_T::LINE: NSB Position */ -#define UART_LINE_NSB_Msk (0x1ul << UART_LINE_NSB_Pos) /*!< UART_T::LINE: NSB Mask */ - -#define UART_LINE_PBE_Pos (3) /*!< UART_T::LINE: PBE Position */ -#define UART_LINE_PBE_Msk (0x1ul << UART_LINE_PBE_Pos) /*!< UART_T::LINE: PBE Mask */ - -#define UART_LINE_EPE_Pos (4) /*!< UART_T::LINE: EPE Position */ -#define UART_LINE_EPE_Msk (0x1ul << UART_LINE_EPE_Pos) /*!< UART_T::LINE: EPE Mask */ - -#define UART_LINE_SPE_Pos (5) /*!< UART_T::LINE: SPE Position */ -#define UART_LINE_SPE_Msk (0x1ul << UART_LINE_SPE_Pos) /*!< UART_T::LINE: SPE Mask */ - -#define UART_LINE_BCB_Pos (6) /*!< UART_T::LINE: BCB Position */ -#define UART_LINE_BCB_Msk (0x1ul << UART_LINE_BCB_Pos) /*!< UART_T::LINE: BCB Mask */ - -#define UART_LINE_PSS_Pos (7) /*!< UART_T::LINE: PSS Position */ -#define UART_LINE_PSS_Msk (0x1ul << UART_LINE_PSS_Pos) /*!< UART_T::LINE: PSS Mask */ - -#define UART_LINE_TXDINV_Pos (8) /*!< UART_T::LINE: TXDINV Position */ -#define UART_LINE_TXDINV_Msk (0x1ul << UART_LINE_TXDINV_Pos) /*!< UART_T::LINE: TXDINV Mask */ - -#define UART_LINE_RXDINV_Pos (9) /*!< UART_T::LINE: RXDINV Position */ -#define UART_LINE_RXDINV_Msk (0x1ul << UART_LINE_RXDINV_Pos) /*!< UART_T::LINE: RXDINV Mask */ - -#define UART_MODEM_RTS_Pos (1) /*!< UART_T::MODEM: RTS Position */ -#define UART_MODEM_RTS_Msk (0x1ul << UART_MODEM_RTS_Pos) /*!< UART_T::MODEM: RTS Mask */ - -#define UART_MODEM_RTSACTLV_Pos (9) /*!< UART_T::MODEM: RTSACTLV Position */ -#define UART_MODEM_RTSACTLV_Msk (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< UART_T::MODEM: RTSACTLV Mask */ - -#define UART_MODEM_RTSSTS_Pos (13) /*!< UART_T::MODEM: RTSSTS Position */ -#define UART_MODEM_RTSSTS_Msk (0x1ul << UART_MODEM_RTSSTS_Pos) /*!< UART_T::MODEM: RTSSTS Mask */ - -#define UART_MODEMSTS_CTSDETF_Pos (0) /*!< UART_T::MODEMSTS: CTSDETF Position */ -#define UART_MODEMSTS_CTSDETF_Msk (0x1ul << UART_MODEMSTS_CTSDETF_Pos) /*!< UART_T::MODEMSTS: CTSDETF Mask */ - -#define UART_MODEMSTS_CTSSTS_Pos (4) /*!< UART_T::MODEMSTS: CTSSTS Position */ -#define UART_MODEMSTS_CTSSTS_Msk (0x1ul << UART_MODEMSTS_CTSSTS_Pos) /*!< UART_T::MODEMSTS: CTSSTS Mask */ - -#define UART_MODEMSTS_CTSACTLV_Pos (8) /*!< UART_T::MODEMSTS: CTSACTLV Position */ -#define UART_MODEMSTS_CTSACTLV_Msk (0x1ul << UART_MODEMSTS_CTSACTLV_Pos) /*!< UART_T::MODEMSTS: CTSACTLV Mask */ - -#define UART_FIFOSTS_RXOVIF_Pos (0) /*!< UART_T::FIFOSTS: RXOVIF Position */ -#define UART_FIFOSTS_RXOVIF_Msk (0x1ul << UART_FIFOSTS_RXOVIF_Pos) /*!< UART_T::FIFOSTS: RXOVIF Mask */ - -#define UART_FIFOSTS_ABRDIF_Pos (1) /*!< UART_T::FIFOSTS: ABRDIF Position */ -#define UART_FIFOSTS_ABRDIF_Msk (0x1ul << UART_FIFOSTS_ABRDIF_Pos) /*!< UART_T::FIFOSTS: ABRDIF Mask */ - -#define UART_FIFOSTS_ABRDTOIF_Pos (2) /*!< UART_T::FIFOSTS: ABRDTOIF Position */ -#define UART_FIFOSTS_ABRDTOIF_Msk (0x1ul << UART_FIFOSTS_ABRDTOIF_Pos) /*!< UART_T::FIFOSTS: ABRDTOIF Mask */ - -#define UART_FIFOSTS_ADDRDETF_Pos (3) /*!< UART_T::FIFOSTS: ADDRDETF Position */ -#define UART_FIFOSTS_ADDRDETF_Msk (0x1ul << UART_FIFOSTS_ADDRDETF_Pos) /*!< UART_T::FIFOSTS: ADDRDETF Mask */ - -#define UART_FIFOSTS_PEF_Pos (4) /*!< UART_T::FIFOSTS: PEF Position */ -#define UART_FIFOSTS_PEF_Msk (0x1ul << UART_FIFOSTS_PEF_Pos) /*!< UART_T::FIFOSTS: PEF Mask */ - -#define UART_FIFOSTS_FEF_Pos (5) /*!< UART_T::FIFOSTS: FEF Position */ -#define UART_FIFOSTS_FEF_Msk (0x1ul << UART_FIFOSTS_FEF_Pos) /*!< UART_T::FIFOSTS: FEF Mask */ - -#define UART_FIFOSTS_BIF_Pos (6) /*!< UART_T::FIFOSTS: BIF Position */ -#define UART_FIFOSTS_BIF_Msk (0x1ul << UART_FIFOSTS_BIF_Pos) /*!< UART_T::FIFOSTS: BIF Mask */ - -#define UART_FIFOSTS_RXPTR_Pos (8) /*!< UART_T::FIFOSTS: RXPTR Position */ -#define UART_FIFOSTS_RXPTR_Msk (0x3ful << UART_FIFOSTS_RXPTR_Pos) /*!< UART_T::FIFOSTS: RXPTR Mask */ - -#define UART_FIFOSTS_RXEMPTY_Pos (14) /*!< UART_T::FIFOSTS: RXEMPTY Position */ -#define UART_FIFOSTS_RXEMPTY_Msk (0x1ul << UART_FIFOSTS_RXEMPTY_Pos) /*!< UART_T::FIFOSTS: RXEMPTY Mask */ - -#define UART_FIFOSTS_RXFULL_Pos (15) /*!< UART_T::FIFOSTS: RXFULL Position */ -#define UART_FIFOSTS_RXFULL_Msk (0x1ul << UART_FIFOSTS_RXFULL_Pos) /*!< UART_T::FIFOSTS: RXFULL Mask */ - -#define UART_FIFOSTS_TXPTR_Pos (16) /*!< UART_T::FIFOSTS: TXPTR Position */ -#define UART_FIFOSTS_TXPTR_Msk (0x3ful << UART_FIFOSTS_TXPTR_Pos) /*!< UART_T::FIFOSTS: TXPTR Mask */ - -#define UART_FIFOSTS_TXEMPTY_Pos (22) /*!< UART_T::FIFOSTS: TXEMPTY Position */ -#define UART_FIFOSTS_TXEMPTY_Msk (0x1ul << UART_FIFOSTS_TXEMPTY_Pos) /*!< UART_T::FIFOSTS: TXEMPTY Mask */ - -#define UART_FIFOSTS_TXFULL_Pos (23) /*!< UART_T::FIFOSTS: TXFULL Position */ -#define UART_FIFOSTS_TXFULL_Msk (0x1ul << UART_FIFOSTS_TXFULL_Pos) /*!< UART_T::FIFOSTS: TXFULL Mask */ - -#define UART_FIFOSTS_TXOVIF_Pos (24) /*!< UART_T::FIFOSTS: TXOVIF Position */ -#define UART_FIFOSTS_TXOVIF_Msk (0x1ul << UART_FIFOSTS_TXOVIF_Pos) /*!< UART_T::FIFOSTS: TXOVIF Mask */ - -#define UART_FIFOSTS_TXEMPTYF_Pos (28) /*!< UART_T::FIFOSTS: TXEMPTYF Position */ -#define UART_FIFOSTS_TXEMPTYF_Msk (0x1ul << UART_FIFOSTS_TXEMPTYF_Pos) /*!< UART_T::FIFOSTS: TXEMPTYF Mask */ - -#define UART_FIFOSTS_RXIDLE_Pos (29) /*!< UART_T::FIFOSTS: RXIDLE Position */ -#define UART_FIFOSTS_RXIDLE_Msk (0x1ul << UART_FIFOSTS_RXIDLE_Pos) /*!< UART_T::FIFOSTS: RXIDLE Mask */ - -#define UART_FIFOSTS_TXRXACT_Pos (31) /*!< UART_T::FIFOSTS: TXRXACT Position */ -#define UART_FIFOSTS_TXRXACT_Msk (0x1ul << UART_FIFOSTS_TXRXACT_Pos) /*!< UART_T::FIFOSTS: TXRXACT Mask */ - -#define UART_INTSTS_RDAIF_Pos (0) /*!< UART_T::INTSTS: RDAIF Position */ -#define UART_INTSTS_RDAIF_Msk (0x1ul << UART_INTSTS_RDAIF_Pos) /*!< UART_T::INTSTS: RDAIF Mask */ - -#define UART_INTSTS_THREIF_Pos (1) /*!< UART_T::INTSTS: THREIF Position */ -#define UART_INTSTS_THREIF_Msk (0x1ul << UART_INTSTS_THREIF_Pos) /*!< UART_T::INTSTS: THREIF Mask */ - -#define UART_INTSTS_RLSIF_Pos (2) /*!< UART_T::INTSTS: RLSIF Position */ -#define UART_INTSTS_RLSIF_Msk (0x1ul << UART_INTSTS_RLSIF_Pos) /*!< UART_T::INTSTS: RLSIF Mask */ - -#define UART_INTSTS_MODEMIF_Pos (3) /*!< UART_T::INTSTS: MODEMIF Position */ -#define UART_INTSTS_MODEMIF_Msk (0x1ul << UART_INTSTS_MODEMIF_Pos) /*!< UART_T::INTSTS: MODEMIF Mask */ - -#define UART_INTSTS_RXTOIF_Pos (4) /*!< UART_T::INTSTS: RXTOIF Position */ -#define UART_INTSTS_RXTOIF_Msk (0x1ul << UART_INTSTS_RXTOIF_Pos) /*!< UART_T::INTSTS: RXTOIF Mask */ - -#define UART_INTSTS_BUFERRIF_Pos (5) /*!< UART_T::INTSTS: BUFERRIF Position */ -#define UART_INTSTS_BUFERRIF_Msk (0x1ul << UART_INTSTS_BUFERRIF_Pos) /*!< UART_T::INTSTS: BUFERRIF Mask */ - -#define UART_INTSTS_WKIF_Pos (6) /*!< UART_T::INTSTS: WKIF Position */ -#define UART_INTSTS_WKIF_Msk (0x1ul << UART_INTSTS_WKIF_Pos) /*!< UART_T::INTSTS: WKIF Mask */ - -#define UART_INTSTS_LINIF_Pos (7) /*!< UART_T::INTSTS: LINIF Position */ -#define UART_INTSTS_LINIF_Msk (0x1ul << UART_INTSTS_LINIF_Pos) /*!< UART_T::INTSTS: LINIF Mask */ - -#define UART_INTSTS_RDAINT_Pos (8) /*!< UART_T::INTSTS: RDAINT Position */ -#define UART_INTSTS_RDAINT_Msk (0x1ul << UART_INTSTS_RDAINT_Pos) /*!< UART_T::INTSTS: RDAINT Mask */ - -#define UART_INTSTS_THREINT_Pos (9) /*!< UART_T::INTSTS: THREINT Position */ -#define UART_INTSTS_THREINT_Msk (0x1ul << UART_INTSTS_THREINT_Pos) /*!< UART_T::INTSTS: THREINT Mask */ - -#define UART_INTSTS_RLSINT_Pos (10) /*!< UART_T::INTSTS: RLSINT Position */ -#define UART_INTSTS_RLSINT_Msk (0x1ul << UART_INTSTS_RLSINT_Pos) /*!< UART_T::INTSTS: RLSINT Mask */ - -#define UART_INTSTS_MODEMINT_Pos (11) /*!< UART_T::INTSTS: MODEMINT Position */ -#define UART_INTSTS_MODEMINT_Msk (0x1ul << UART_INTSTS_MODEMINT_Pos) /*!< UART_T::INTSTS: MODEMINT Mask */ - -#define UART_INTSTS_RXTOINT_Pos (12) /*!< UART_T::INTSTS: RXTOINT Position */ -#define UART_INTSTS_RXTOINT_Msk (0x1ul << UART_INTSTS_RXTOINT_Pos) /*!< UART_T::INTSTS: RXTOINT Mask */ - -#define UART_INTSTS_BUFERRINT_Pos (13) /*!< UART_T::INTSTS: BUFERRINT Position */ -#define UART_INTSTS_BUFERRINT_Msk (0x1ul << UART_INTSTS_BUFERRINT_Pos) /*!< UART_T::INTSTS: BUFERRINT Mask */ - -#define UART_INTSTS_WKINT_Pos (14) /*!< UART_T::INTSTS: WKINT Position */ -#define UART_INTSTS_WKINT_Msk (0x1ul << UART_INTSTS_WKINT_Pos) /*!< UART_T::INTSTS: WKINT Mask */ - -#define UART_INTSTS_LININT_Pos (15) /*!< UART_T::INTSTS: LININT Position */ -#define UART_INTSTS_LININT_Msk (0x1ul << UART_INTSTS_LININT_Pos) /*!< UART_T::INTSTS: LININT Mask */ - -#define UART_INTSTS_HWRLSIF_Pos (18) /*!< UART_T::INTSTS: HWRLSIF Position */ -#define UART_INTSTS_HWRLSIF_Msk (0x1ul << UART_INTSTS_HWRLSIF_Pos) /*!< UART_T::INTSTS: HWRLSIF Mask */ - -#define UART_INTSTS_HWMODIF_Pos (19) /*!< UART_T::INTSTS: HWMODIF Position */ -#define UART_INTSTS_HWMODIF_Msk (0x1ul << UART_INTSTS_HWMODIF_Pos) /*!< UART_T::INTSTS: HWMODIF Mask */ - -#define UART_INTSTS_HWTOIF_Pos (20) /*!< UART_T::INTSTS: HWTOIF Position */ -#define UART_INTSTS_HWTOIF_Msk (0x1ul << UART_INTSTS_HWTOIF_Pos) /*!< UART_T::INTSTS: HWTOIF Mask */ - -#define UART_INTSTS_HWBUFEIF_Pos (21) /*!< UART_T::INTSTS: HWBUFEIF Position */ -#define UART_INTSTS_HWBUFEIF_Msk (0x1ul << UART_INTSTS_HWBUFEIF_Pos) /*!< UART_T::INTSTS: HWBUFEIF Mask */ - -#define UART_INTSTS_TXENDIF_Pos (22) /*!< UART_T::INTSTS: TXENDIF Position */ -#define UART_INTSTS_TXENDIF_Msk (0x1ul << UART_INTSTS_TXENDIF_Pos) /*!< UART_T::INTSTS: TXENDIF Mask */ - -#define UART_INTSTS_HWRLSINT_Pos (26) /*!< UART_T::INTSTS: HWRLSINT Position */ -#define UART_INTSTS_HWRLSINT_Msk (0x1ul << UART_INTSTS_HWRLSINT_Pos) /*!< UART_T::INTSTS: HWRLSINT Mask */ - -#define UART_INTSTS_HWMODINT_Pos (27) /*!< UART_T::INTSTS: HWMODINT Position */ -#define UART_INTSTS_HWMODINT_Msk (0x1ul << UART_INTSTS_HWMODINT_Pos) /*!< UART_T::INTSTS: HWMODINT Mask */ - -#define UART_INTSTS_HWTOINT_Pos (28) /*!< UART_T::INTSTS: HWTOINT Position */ -#define UART_INTSTS_HWTOINT_Msk (0x1ul << UART_INTSTS_HWTOINT_Pos) /*!< UART_T::INTSTS: HWTOINT Mask */ - -#define UART_INTSTS_HWBUFEINT_Pos (29) /*!< UART_T::INTSTS: HWBUFEINT Position */ -#define UART_INTSTS_HWBUFEINT_Msk (0x1ul << UART_INTSTS_HWBUFEINT_Pos) /*!< UART_T::INTSTS: HWBUFEINT Mask */ - -#define UART_INTSTS_TXENDINT_Pos (30) /*!< UART_T::INTSTS: TXENDINT Position */ -#define UART_INTSTS_TXENDINT_Msk (0x1ul << UART_INTSTS_TXENDINT_Pos) /*!< UART_T::INTSTS: TXENDINT Mask */ - -#define UART_INTSTS_ABRINT_Pos (31) /*!< UART_T::INTSTS: ABRINT Position */ -#define UART_INTSTS_ABRINT_Msk (0x1ul << UART_INTSTS_ABRINT_Pos) /*!< UART_T::INTSTS: ABRINT Mask */ - -#define UART_TOUT_TOIC_Pos (0) /*!< UART_T::TOUT: TOIC Position */ -#define UART_TOUT_TOIC_Msk (0xfful << UART_TOUT_TOIC_Pos) /*!< UART_T::TOUT: TOIC Mask */ - -#define UART_TOUT_DLY_Pos (8) /*!< UART_T::TOUT: DLY Position */ -#define UART_TOUT_DLY_Msk (0xfful << UART_TOUT_DLY_Pos) /*!< UART_T::TOUT: DLY Mask */ - -#define UART_BAUD_BRD_Pos (0) /*!< UART_T::BAUD: BRD Position */ -#define UART_BAUD_BRD_Msk (0xfffful << UART_BAUD_BRD_Pos) /*!< UART_T::BAUD: BRD Mask */ - -#define UART_BAUD_EDIVM1_Pos (24) /*!< UART_T::BAUD: EDIVM1 Position */ -#define UART_BAUD_EDIVM1_Msk (0xful << UART_BAUD_EDIVM1_Pos) /*!< UART_T::BAUD: EDIVM1 Mask */ - -#define UART_BAUD_BAUDM0_Pos (28) /*!< UART_T::BAUD: BAUDM0 Position */ -#define UART_BAUD_BAUDM0_Msk (0x1ul << UART_BAUD_BAUDM0_Pos) /*!< UART_T::BAUD: BAUDM0 Mask */ - -#define UART_BAUD_BAUDM1_Pos (29) /*!< UART_T::BAUD: BAUDM1 Position */ -#define UART_BAUD_BAUDM1_Msk (0x1ul << UART_BAUD_BAUDM1_Pos) /*!< UART_T::BAUD: BAUDM1 Mask */ - -#define UART_IRDA_TXEN_Pos (1) /*!< UART_T::IRDA: TXEN Position */ -#define UART_IRDA_TXEN_Msk (0x1ul << UART_IRDA_TXEN_Pos) /*!< UART_T::IRDA: TXEN Mask */ - -#define UART_IRDA_TXINV_Pos (5) /*!< UART_T::IRDA: TXINV Position */ -#define UART_IRDA_TXINV_Msk (0x1ul << UART_IRDA_TXINV_Pos) /*!< UART_T::IRDA: TXINV Mask */ - -#define UART_IRDA_RXINV_Pos (6) /*!< UART_T::IRDA: RXINV Position */ -#define UART_IRDA_RXINV_Msk (0x1ul << UART_IRDA_RXINV_Pos) /*!< UART_T::IRDA: RXINV Mask */ - -#define UART_ALTCTL_BRKFL_Pos (0) /*!< UART_T::ALTCTL: BRKFL Position */ -#define UART_ALTCTL_BRKFL_Msk (0xful << UART_ALTCTL_BRKFL_Pos) /*!< UART_T::ALTCTL: BRKFL Mask */ - -#define UART_ALTCTL_LINRXEN_Pos (6) /*!< UART_T::ALTCTL: LINRXEN Position */ -#define UART_ALTCTL_LINRXEN_Msk (0x1ul << UART_ALTCTL_LINRXEN_Pos) /*!< UART_T::ALTCTL: LINRXEN Mask */ - -#define UART_ALTCTL_LINTXEN_Pos (7) /*!< UART_T::ALTCTL: LINTXEN Position */ -#define UART_ALTCTL_LINTXEN_Msk (0x1ul << UART_ALTCTL_LINTXEN_Pos) /*!< UART_T::ALTCTL: LINTXEN Mask */ - -#define UART_ALTCTL_RS485NMM_Pos (8) /*!< UART_T::ALTCTL: RS485NMM Position */ -#define UART_ALTCTL_RS485NMM_Msk (0x1ul << UART_ALTCTL_RS485NMM_Pos) /*!< UART_T::ALTCTL: RS485NMM Mask */ - -#define UART_ALTCTL_RS485AAD_Pos (9) /*!< UART_T::ALTCTL: RS485AAD Position */ -#define UART_ALTCTL_RS485AAD_Msk (0x1ul << UART_ALTCTL_RS485AAD_Pos) /*!< UART_T::ALTCTL: RS485AAD Mask */ - -#define UART_ALTCTL_RS485AUD_Pos (10) /*!< UART_T::ALTCTL: RS485AUD Position */ -#define UART_ALTCTL_RS485AUD_Msk (0x1ul << UART_ALTCTL_RS485AUD_Pos) /*!< UART_T::ALTCTL: RS485AUD Mask */ - -#define UART_ALTCTL_ADDRDEN_Pos (15) /*!< UART_T::ALTCTL: ADDRDEN Position */ -#define UART_ALTCTL_ADDRDEN_Msk (0x1ul << UART_ALTCTL_ADDRDEN_Pos) /*!< UART_T::ALTCTL: ADDRDEN Mask */ - -#define UART_ALTCTL_ABRIF_Pos (17) /*!< UART_T::ALTCTL: ABRIF Position */ -#define UART_ALTCTL_ABRIF_Msk (0x1ul << UART_ALTCTL_ABRIF_Pos) /*!< UART_T::ALTCTL: ABRIF Mask */ - -#define UART_ALTCTL_ABRDEN_Pos (18) /*!< UART_T::ALTCTL: ABRDEN Position */ -#define UART_ALTCTL_ABRDEN_Msk (0x1ul << UART_ALTCTL_ABRDEN_Pos) /*!< UART_T::ALTCTL: ABRDEN Mask */ - -#define UART_ALTCTL_ABRDBITS_Pos (19) /*!< UART_T::ALTCTL: ABRDBITS Position */ -#define UART_ALTCTL_ABRDBITS_Msk (0x3ul << UART_ALTCTL_ABRDBITS_Pos) /*!< UART_T::ALTCTL: ABRDBITS Mask */ - -#define UART_ALTCTL_ADDRMV_Pos (24) /*!< UART_T::ALTCTL: ADDRMV Position */ -#define UART_ALTCTL_ADDRMV_Msk (0xfful << UART_ALTCTL_ADDRMV_Pos) /*!< UART_T::ALTCTL: ADDRMV Mask */ - -#define UART_FUNCSEL_FUNCSEL_Pos (0) /*!< UART_T::FUNCSEL: FUNCSEL Position */ -#define UART_FUNCSEL_FUNCSEL_Msk (0x3ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_T::FUNCSEL: FUNCSEL Mask */ - -#define UART_FUNCSEL_TXRXDIS_Pos (3) /*!< UART_T::FUNCSEL: TXRXDIS Position */ -#define UART_FUNCSEL_TXRXDIS_Msk (0x1ul << UART_FUNCSEL_TXRXDIS_Pos) /*!< UART_T::FUNCSEL: TXRXDIS Mask */ - -#define UART_LINCTL_SLVEN_Pos (0) /*!< UART_T::LINCTL: SLVEN Position */ -#define UART_LINCTL_SLVEN_Msk (0x1ul << UART_LINCTL_SLVEN_Pos) /*!< UART_T::LINCTL: SLVEN Mask */ - -#define UART_LINCTL_SLVHDEN_Pos (1) /*!< UART_T::LINCTL: SLVHDEN Position */ -#define UART_LINCTL_SLVHDEN_Msk (0x1ul << UART_LINCTL_SLVHDEN_Pos) /*!< UART_T::LINCTL: SLVHDEN Mask */ - -#define UART_LINCTL_SLVAREN_Pos (2) /*!< UART_T::LINCTL: SLVAREN Position */ -#define UART_LINCTL_SLVAREN_Msk (0x1ul << UART_LINCTL_SLVAREN_Pos) /*!< UART_T::LINCTL: SLVAREN Mask */ - -#define UART_LINCTL_SLVDUEN_Pos (3) /*!< UART_T::LINCTL: SLVDUEN Position */ -#define UART_LINCTL_SLVDUEN_Msk (0x1ul << UART_LINCTL_SLVDUEN_Pos) /*!< UART_T::LINCTL: SLVDUEN Mask */ - -#define UART_LINCTL_MUTE_Pos (4) /*!< UART_T::LINCTL: MUTE Position */ -#define UART_LINCTL_MUTE_Msk (0x1ul << UART_LINCTL_MUTE_Pos) /*!< UART_T::LINCTL: MUTE Mask */ - -#define UART_LINCTL_SENDH_Pos (8) /*!< UART_T::LINCTL: SENDH Position */ -#define UART_LINCTL_SENDH_Msk (0x1ul << UART_LINCTL_SENDH_Pos) /*!< UART_T::LINCTL: SENDH Mask */ - -#define UART_LINCTL_IDPEN_Pos (9) /*!< UART_T::LINCTL: IDPEN Position */ -#define UART_LINCTL_IDPEN_Msk (0x1ul << UART_LINCTL_IDPEN_Pos) /*!< UART_T::LINCTL: IDPEN Mask */ - -#define UART_LINCTL_BRKDETEN_Pos (10) /*!< UART_T::LINCTL: BRKDETEN Position */ -#define UART_LINCTL_BRKDETEN_Msk (0x1ul << UART_LINCTL_BRKDETEN_Pos) /*!< UART_T::LINCTL: BRKDETEN Mask */ - -#define UART_LINCTL_LINRXOFF_Pos (11) /*!< UART_T::LINCTL: LINRXOFF Position */ -#define UART_LINCTL_LINRXOFF_Msk (0x1ul << UART_LINCTL_LINRXOFF_Pos) /*!< UART_T::LINCTL: LINRXOFF Mask */ - -#define UART_LINCTL_BITERREN_Pos (12) /*!< UART_T::LINCTL: BITERREN Position */ -#define UART_LINCTL_BITERREN_Msk (0x1ul << UART_LINCTL_BITERREN_Pos) /*!< UART_T::LINCTL: BITERREN Mask */ - -#define UART_LINCTL_BRKFL_Pos (16) /*!< UART_T::LINCTL: BRKFL Position */ -#define UART_LINCTL_BRKFL_Msk (0xful << UART_LINCTL_BRKFL_Pos) /*!< UART_T::LINCTL: BRKFL Mask */ - -#define UART_LINCTL_BSL_Pos (20) /*!< UART_T::LINCTL: BSL Position */ -#define UART_LINCTL_BSL_Msk (0x3ul << UART_LINCTL_BSL_Pos) /*!< UART_T::LINCTL: BSL Mask */ - -#define UART_LINCTL_HSEL_Pos (22) /*!< UART_T::LINCTL: HSEL Position */ -#define UART_LINCTL_HSEL_Msk (0x3ul << UART_LINCTL_HSEL_Pos) /*!< UART_T::LINCTL: HSEL Mask */ - -#define UART_LINCTL_PID_Pos (24) /*!< UART_T::LINCTL: PID Position */ -#define UART_LINCTL_PID_Msk (0xfful << UART_LINCTL_PID_Pos) /*!< UART_T::LINCTL: PID Mask */ - -#define UART_LINSTS_SLVHDETF_Pos (0) /*!< UART_T::LINSTS: SLVHDETF Position */ -#define UART_LINSTS_SLVHDETF_Msk (0x1ul << UART_LINSTS_SLVHDETF_Pos) /*!< UART_T::LINSTS: SLVHDETF Mask */ - -#define UART_LINSTS_SLVHEF_Pos (1) /*!< UART_T::LINSTS: SLVHEF Position */ -#define UART_LINSTS_SLVHEF_Msk (0x1ul << UART_LINSTS_SLVHEF_Pos) /*!< UART_T::LINSTS: SLVHEF Mask */ - -#define UART_LINSTS_SLVIDPEF_Pos (2) /*!< UART_T::LINSTS: SLVIDPEF Position */ -#define UART_LINSTS_SLVIDPEF_Msk (0x1ul << UART_LINSTS_SLVIDPEF_Pos) /*!< UART_T::LINSTS: SLVIDPEF Mask */ - -#define UART_LINSTS_SLVSYNCF_Pos (3) /*!< UART_T::LINSTS: SLVSYNCF Position */ -#define UART_LINSTS_SLVSYNCF_Msk (0x1ul << UART_LINSTS_SLVSYNCF_Pos) /*!< UART_T::LINSTS: SLVSYNCF Mask */ - -#define UART_LINSTS_BRKDETF_Pos (8) /*!< UART_T::LINSTS: BRKDETF Position */ -#define UART_LINSTS_BRKDETF_Msk (0x1ul << UART_LINSTS_BRKDETF_Pos) /*!< UART_T::LINSTS: BRKDETF Mask */ - -#define UART_LINSTS_BITEF_Pos (9) /*!< UART_T::LINSTS: BITEF Position */ -#define UART_LINSTS_BITEF_Msk (0x1ul << UART_LINSTS_BITEF_Pos) /*!< UART_T::LINSTS: BITEF Mask */ - -#define UART_BRCOMP_BRCOMP_Pos (0) /*!< UART_T::BRCOMP: BRCOMP Position */ -#define UART_BRCOMP_BRCOMP_Msk (0x1fful << UART_BRCOMP_BRCOMP_Pos) /*!< UART_T::BRCOMP: BRCOMP Mask */ - -#define UART_BRCOMP_BRCOMPDEC_Pos (31) /*!< UART_T::BRCOMP: BRCOMPDEC Position */ -#define UART_BRCOMP_BRCOMPDEC_Msk (0x1ul << UART_BRCOMP_BRCOMPDEC_Pos) /*!< UART_T::BRCOMP: BRCOMPDEC Mask */ - -#define UART_WKCTL_WKCTSEN_Pos (0) /*!< UART_T::WKCTL: WKCTSEN Position */ -#define UART_WKCTL_WKCTSEN_Msk (0x1ul << UART_WKCTL_WKCTSEN_Pos) /*!< UART_T::WKCTL: WKCTSEN Mask */ - -#define UART_WKCTL_WKDATEN_Pos (1) /*!< UART_T::WKCTL: WKDATEN Position */ -#define UART_WKCTL_WKDATEN_Msk (0x1ul << UART_WKCTL_WKDATEN_Pos) /*!< UART_T::WKCTL: WKDATEN Mask */ - -#define UART_WKCTL_WKRFRTEN_Pos (2) /*!< UART_T::WKCTL: WKRFRTEN Position */ -#define UART_WKCTL_WKRFRTEN_Msk (0x1ul << UART_WKCTL_WKRFRTEN_Pos) /*!< UART_T::WKCTL: WKRFRTEN Mask */ - -#define UART_WKCTL_WKRS485EN_Pos (3) /*!< UART_T::WKCTL: WKRS485EN Position */ -#define UART_WKCTL_WKRS485EN_Msk (0x1ul << UART_WKCTL_WKRS485EN_Pos) /*!< UART_T::WKCTL: WKRS485EN Mask */ - -#define UART_WKCTL_WKTOUTEN_Pos (4) /*!< UART_T::WKCTL: WKTOUTEN Position */ -#define UART_WKCTL_WKTOUTEN_Msk (0x1ul << UART_WKCTL_WKTOUTEN_Pos) /*!< UART_T::WKCTL: WKTOUTEN Mask */ - -#define UART_WKSTS_CTSWKF_Pos (0) /*!< UART_T::WKSTS: CTSWKF Position */ -#define UART_WKSTS_CTSWKF_Msk (0x1ul << UART_WKSTS_CTSWKF_Pos) /*!< UART_T::WKSTS: CTSWKF Mask */ - -#define UART_WKSTS_DATWKF_Pos (1) /*!< UART_T::WKSTS: DATWKF Position */ -#define UART_WKSTS_DATWKF_Msk (0x1ul << UART_WKSTS_DATWKF_Pos) /*!< UART_T::WKSTS: DATWKF Mask */ - -#define UART_WKSTS_RFRTWKF_Pos (2) /*!< UART_T::WKSTS: RFRTWKF Position */ -#define UART_WKSTS_RFRTWKF_Msk (0x1ul << UART_WKSTS_RFRTWKF_Pos) /*!< UART_T::WKSTS: RFRTWKF Mask */ - -#define UART_WKSTS_RS485WKF_Pos (3) /*!< UART_T::WKSTS: RS485WKF Position */ -#define UART_WKSTS_RS485WKF_Msk (0x1ul << UART_WKSTS_RS485WKF_Pos) /*!< UART_T::WKSTS: RS485WKF Mask */ - -#define UART_WKSTS_TOUTWKF_Pos (4) /*!< UART_T::WKSTS: TOUTWKF Position */ -#define UART_WKSTS_TOUTWKF_Msk (0x1ul << UART_WKSTS_TOUTWKF_Pos) /*!< UART_T::WKSTS: TOUTWKF Mask */ - -#define UART_DWKCOMP_STCOMP_Pos (0) /*!< UART_T::DWKCOMP: STCOMP Position */ -#define UART_DWKCOMP_STCOMP_Msk (0xfffful << UART_DWKCOMP_STCOMP_Pos) /*!< UART_T::DWKCOMP: STCOMP Mask */ - -/**@}*/ /* UART_CONST */ -/**@}*/ /* end of UART register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __UART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ui2c_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ui2c_reg.h deleted file mode 100644 index 04222bcf978..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/ui2c_reg.h +++ /dev/null @@ -1,583 +0,0 @@ -/**************************************************************************//** - * @file ui2c_reg.h - * @version V1.00 - * @brief UI2C register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UI2C_REG_H__ -#define __UI2C_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UI2C I2C Mode of USCI Controller(UI2C) - Memory Mapped Structure for UI2C Controller -@{ */ - -typedef struct -{ - - - /** - * @var UI2C_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var UI2C_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK = fDIV_CLK. - * | | |01 = fSAMP_CLK = fPROT_CLK. - * | | |10 = fSAMP_CLK = fSCLK. - * | | |11 = fSAMP_CLK = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter is Disabled. - * | | |1 = Time measurement counter is Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * | | |Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(USCI_PROTCTL[6])) is enabled - * | | |The revised value is the average bit time between bit 5 and bit 6 - * | | |The user can use revised CLKDIV and new BRDETITV (USCI_PROTCTL[24:16]) to calculate the precise baud rate. - * @var UI2C_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * | | |Note: In UART protocol, the length can be configured as 6~13 bits - * | | |And in I2C protocol, the length fixed as 8 bits. - * @var UI2C_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UI2C_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note 1: In I2C protocol, RXDAT[12:8] indicate the different transmission conditions which defined in I2C. - * | | |Note 2: In UART protocol, RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (USCI_PROTSTS[7:5]). - * @var UI2C_T::DEVADDR0 - * Offset: 0x44 USCI Device Address Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note 1: The DEVADDR [9:7] must be set 3'b000 when I2C operating in 7-bit address mode. - * | | |Note 2: When software set 10'h000, the address can not be used. - * @var UI2C_T::DEVADDR1 - * Offset: 0x48 USCI Device Address Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |DEVADDR |Device Address - * | | |In I2C protocol, this bit field contains the programmed slave address - * | | |If the first received address byte are 1111 0AAXB, the AA bits are compared to the bits DEVADDR[9:8] to check for address match, where the X is R/W bit - * | | |Then the second address byte is also compared to DEVADDR[7:0]. - * | | |Note 1: The DEVADDR [9:7] must be set 3'000 when I2C operating in 7-bit address mode. - * | | |Note 2: When software set 10'h000, the address can not be used. - * @var UI2C_T::ADDRMSK0 - * Offset: 0x4C USCI Device Address Mask Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |USCI support multiple address recognition with two address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var UI2C_T::ADDRMSK1 - * Offset: 0x50 USCI Device Address Mask Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |ADDRMSK |USCI Device Address Mask - * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). - * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). - * | | |USCI support multiple address recognition with two address mask register - * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care - * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. - * | | |Note: The wake-up function can not use address mask. - * @var UI2C_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[1] |WKADDREN |Wake-up Address Match Enable Bit - * | | |0 = The chip is woken up according data toggle. - * | | |1 = The chip is woken up according address match. - * @var UI2C_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var UI2C_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCFUNC |General Call Function - * | | |0 = General Call Function Disabled. - * | | |1 = General Call Function Enabled. - * |[1] |AA |Assert Acknowledge Control - * | | |When AA=1 prior to address or data received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter - * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line. - * |[2] |STO |I2C STOP Control - * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C hardware will check the bus condition if a STOP condition is detected this bit will be cleared by hardware automatically - * | | |In a slave mode, setting STO resets I2C hardware to the defined "not addressed" slave mode when bus error (USCI_PROTSTS.ERRIF = 1). - * |[3] |STA |I2C START Control - * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. - * |[4] |ADDR10EN |Address 10-bit Function Enable Bit - * | | |0 = Address match 10 bit function is disabled. - * | | |1 = Address match 10 bit function is enabled. - * |[5] |PTRG |I2C Protocol Trigger (Write Only) - * | | |When a new state is present in the USCI_PROTSTS register, if the related interrupt enable bits are set, the I2C interrupt is requested - * | | |It must write one by software to this bit after the related interrupt flags are set to 1 and the I2C protocol function will go ahead until the STOP is active or the PROTEN is disabled. - * | | |0 = I2C's stretch disabled and the I2C protocol function will go ahead. - * | | |1 = I2C's stretch active. - * |[8] |SCLOUTEN |SCL Output Enable Bit - * | | |This bit enables monitor pulling SCL to low - * | | |This monitor will pull SCL to low until it has had time to respond to an I2C interrupt. - * | | |0 = SCL output will be forced high due to open drain mechanism. - * | | |1 = I2C module may act as a slave peripheral just like in normal operation, the I2C holds the clock line low until it has had time to clear I2C interrupt. - * |[9] |MONEN |Monitor Mode Enable Bit - * | | |This bit enables monitor mode - * | | |In monitor mode the SDA output will be put in high impedance mode - * | | |This prevents the I2C module from outputting data of any kind (including ACK) onto the I2C data bus. - * | | |0 = The monitor mode is disabled. - * | | |1 = The monitor mode is enabled. - * | | |Note: Depending on the state of the SCLOUTEN bit, the SCL output may be also forced high, preventing the module from having control over the I2C clock line. - * |[25:16] |TOCNT |Time-out Clock Cycle - * | | |This bit field indicates how many clock cycle selected by TMCNTSRC (USCI_BRGEN [5]) when each interrupt flags are clear - * | | |The time-out is enable when TOCNT bigger than 0. - * | | |Note: The TMCNTSRC (USCI_BRGEN [5]) must be set zero on I2C mode. - * |[31] |PROTEN |I2C Protocol Enable Bit - * | | |0 = I2C Protocol disable. - * | | |1 = I2C Protocol enable. - * @var UI2C_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TOIEN |Time-out Interrupt Enable Control - * | | |In I2C protocol, this bit enables the interrupt generation in case of a time-out event. - * | | |0 = The time-out interrupt is disabled. - * | | |1 = The time-out interrupt is enabled. - * |[1] |STARIEN |Start Condition Received Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a start condition is detected. - * | | |0 = The start condition interrupt is disabled. - * | | |1 = The start condition interrupt is enabled. - * |[2] |STORIEN |Stop Condition Received Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a stop condition is detected. - * | | |0 = The stop condition interrupt is disabled. - * | | |1 = The stop condition interrupt is enabled. - * |[3] |NACKIEN |Non - Acknowledge Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if a non - acknowledge is detected by a master. - * | | |0 = The non - acknowledge interrupt is disabled. - * | | |1 = The non - acknowledge interrupt is enabled. - * |[4] |ARBLOIEN |Arbitration Lost Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an arbitration lost event is detected. - * | | |0 = The arbitration lost interrupt is disabled. - * | | |1 = The arbitration lost interrupt is enabled. - * |[5] |ERRIEN |Error Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an I2C error condition is detected (indicated by ERR (USCI_PROTSTS [16])). - * | | |0 = The error interrupt is disabled. - * | | |1 = The error interrupt is enabled. - * |[6] |ACKIEN |Acknowledge Interrupt Enable Control - * | | |This bit enables the generation of a protocol interrupt if an acknowledge is detected by a master. - * | | |0 = The acknowledge interrupt is disabled. - * | | |1 = The acknowledge interrupt is enabled. - * @var UI2C_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5] |TOIF |Time-out Interrupt Flag - * | | |0 = A time-out interrupt status has not occurred. - * | | |1 = A time-out interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit - * |[6] |ONBUSY |On Bus Busy - * | | |Indicates that a communication is in progress on the bus - * | | |It is set by hardware when a START condition is detected - * | | |It is cleared by hardware when a STOP condition is detected - * | | |0 = The bus is IDLE (both SCLK and SDA High). - * | | |1 = The bus is busy. - * |[8] |STARIF |Start Condition Received Interrupt Flag - * | | |This bit indicates that a start condition or repeated start condition has been detected on master mode - * | | |However, this bit also indicates that a repeated start condition has been detected on slave mode. - * | | |A protocol interrupt can be generated if USCI_PROTCTL.STARIEN = 1. - * | | |0 = A start condition has not yet been detected. - * | | |1 = A start condition has been detected. - * | | |It is cleared by software writing one into this bit - * |[9] |STORIF |Stop Condition Received Interrupt Flag - * | | |This bit indicates that a stop condition has been detected on the I2C bus lines - * | | |A protocol interrupt can be generated if USCI_PROTCTL.STORIEN = 1. - * | | |0 = A stop condition has not yet been detected. - * | | |1 = A stop condition has been detected. - * | | |It is cleared by software writing one into this bit - * | | |Note: This bit is set when slave RX mode. - * |[10] |NACKIF |Non - Acknowledge Received Interrupt Flag - * | | |This bit indicates that a non - acknowledge has been received in master mode - * | | |A protocol interrupt can be generated if USCI_PROTCTL.NACKIEN = 1. - * | | |0 = A non - acknowledge has not been received. - * | | |1 = A non - acknowledge has been received. - * | | |It is cleared by software writing one into this bit - * |[11] |ARBLOIF |Arbitration Lost Interrupt Flag - * | | |This bit indicates that an arbitration has been lost - * | | |A protocol interrupt can be generated if USCI_PROTCTL.ARBLOIEN = 1. - * | | |0 = An arbitration has not been lost. - * | | |1 = An arbitration has been lost. - * | | |It is cleared by software writing one into this bit - * |[12] |ERRIF |Error Interrupt Flag - * | | |This bit indicates that a Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame - * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit - * | | |A protocol interrupt can be generated if USCI_PROTCTL.ERRIEN = 1. - * | | |0 = An I2C error has not been detected. - * | | |1 = An I2C error has been detected. - * | | |It is cleared by software writing one into this bit - * | | |Note: This bit is set when slave mode, user must write one into STO register to the defined "not addressed" slave mode. - * |[13] |ACKIF |Acknowledge Received Interrupt Flag - * | | |This bit indicates that an acknowledge has been received in master mode - * | | |A protocol interrupt can be generated if USCI_PROTCTL.ACKIEN = 1. - * | | |0 = An acknowledge has not been received. - * | | |1 = An acknowledge has been received. - * | | |It is cleared by software writing one into this bit - * |[14] |SLASEL |Slave Select Status - * | | |This bit indicates that this device has been selected as slave. - * | | |0 = The device is not selected as slave. - * | | |1 = The device is selected as slave. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[15] |SLAREAD |Slave Read Request Status - * | | |This bit indicates that a slave read request has been detected. - * | | |0 = A slave R/W bit is 1 has not been detected. - * | | |1 = A slave R/W bit is 1 has been detected. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware. - * |[16] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done - * | | |0 = The ACK bit cycle of address match frame isn't done. - * | | |1 = The ACK bit cycle of address match frame is done in power-down. - * | | |Note: This bit can't release when WKUPIF is set. - * |[17] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame - * | | |0 = Write command be record on the address match wakeup frame. - * | | |1 = Read command be record on the address match wakeup frame. - * |[18] |BUSHANG |Bus Hang-up - * | | |This bit indicates bus hang-up status - * | | |There is 4-bit counter count when SCL hold high and refer fSAMP_CLK - * | | |The hang-up counter will count to overflow and set this bit when SDA is low - * | | |The counter will be reset by falling edge of SCL signal. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is hang-up status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * |[19] |ERRARBLO |Error Arbitration Lost - * | | |This bit indicates bus arbitration lost due to bigger noise which is can't be filtered by input processor - * | | |The I2C can send start condition when ERRARBLO is set - * | | |Thus this bit doesn't be cared on slave mode. - * | | |0 = The bus is normal status for transmission. - * | | |1 = The bus is error arbitration lost status for transmission. - * | | |Note: This bit has no interrupt signal, and it will be cleared automatically by hardware when a START condition is present. - * @var UI2C_T::ADMAT - * Offset: 0x88 I2C Slave Match Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADMAT0 |USCI Address 0 Match Status Register - * | | |When address 0 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * |[1] |ADMAT1 |USCI Address 1 Match Status Register - * | | |When address 1 is matched, hardware will inform which address used - * | | |This bit will set to 1, and software can write 1 to clear this bit. - * @var UI2C_T::TMCTL - * Offset: 0x8C I2C Timing Configure Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STCTL |Setup Time Configure Control Register - * | | |This field is used to generate a delay timing between SDA edge and SCL rising edge in transmission mode. - * | | |The delay setup time is numbers of peripheral clock = STCTL x fPCLK. - * |[24:16] |HTCTL |Hold Time Configure Control Register - * | | |This field is used to generate the delay timing between SCL falling edge SDA edge in - * | | |transmission mode. - * | | |The delay hold time is numbers of peripheral clock = HTCTL x fPCLK. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DEVADDR0; /*!< [0x0044] USCI Device Address Register 0 */ - __IO uint32_t DEVADDR1; /*!< [0x0048] USCI Device Address Register 1 */ - __IO uint32_t ADDRMSK0; /*!< [0x004c] USCI Device Address Mask Register 0 */ - __IO uint32_t ADDRMSK1; /*!< [0x0050] USCI Device Address Mask Register 1 */ - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ADMAT; /*!< [0x0088] I2C Slave Match Address Register */ - __IO uint32_t TMCTL; /*!< [0x008c] I2C Timing Configure Control Register */ - -} UI2C_T; - -/** - @addtogroup UI2C_CONST UI2C Bit Field Definition - Constant Definitions for UI2C Controller -@{ */ - -#define UI2C_CTL_FUNMODE_Pos (0) /*!< UI2C_T::CTL: FUNMODE Position */ -#define UI2C_CTL_FUNMODE_Msk (0x7ul << UI2C_CTL_FUNMODE_Pos) /*!< UI2C_T::CTL: FUNMODE Mask */ - -#define UI2C_BRGEN_RCLKSEL_Pos (0) /*!< UI2C_T::BRGEN: RCLKSEL Position */ -#define UI2C_BRGEN_RCLKSEL_Msk (0x1ul << UI2C_BRGEN_RCLKSEL_Pos) /*!< UI2C_T::BRGEN: RCLKSEL Mask */ - -#define UI2C_BRGEN_PTCLKSEL_Pos (1) /*!< UI2C_T::BRGEN: PTCLKSEL Position */ -#define UI2C_BRGEN_PTCLKSEL_Msk (0x1ul << UI2C_BRGEN_PTCLKSEL_Pos) /*!< UI2C_T::BRGEN: PTCLKSEL Mask */ - -#define UI2C_BRGEN_SPCLKSEL_Pos (2) /*!< UI2C_T::BRGEN: SPCLKSEL Position */ -#define UI2C_BRGEN_SPCLKSEL_Msk (0x3ul << UI2C_BRGEN_SPCLKSEL_Pos) /*!< UI2C_T::BRGEN: SPCLKSEL Mask */ - -#define UI2C_BRGEN_TMCNTEN_Pos (4) /*!< UI2C_T::BRGEN: TMCNTEN Position */ -#define UI2C_BRGEN_TMCNTEN_Msk (0x1ul << UI2C_BRGEN_TMCNTEN_Pos) /*!< UI2C_T::BRGEN: TMCNTEN Mask */ - -#define UI2C_BRGEN_TMCNTSRC_Pos (5) /*!< UI2C_T::BRGEN: TMCNTSRC Position */ -#define UI2C_BRGEN_TMCNTSRC_Msk (0x1ul << UI2C_BRGEN_TMCNTSRC_Pos) /*!< UI2C_T::BRGEN: TMCNTSRC Mask */ - -#define UI2C_BRGEN_PDSCNT_Pos (8) /*!< UI2C_T::BRGEN: PDSCNT Position */ -#define UI2C_BRGEN_PDSCNT_Msk (0x3ul << UI2C_BRGEN_PDSCNT_Pos) /*!< UI2C_T::BRGEN: PDSCNT Mask */ - -#define UI2C_BRGEN_DSCNT_Pos (10) /*!< UI2C_T::BRGEN: DSCNT Position */ -#define UI2C_BRGEN_DSCNT_Msk (0x1ful << UI2C_BRGEN_DSCNT_Pos) /*!< UI2C_T::BRGEN: DSCNT Mask */ - -#define UI2C_BRGEN_CLKDIV_Pos (16) /*!< UI2C_T::BRGEN: CLKDIV Position */ -#define UI2C_BRGEN_CLKDIV_Msk (0x3fful << UI2C_BRGEN_CLKDIV_Pos) /*!< UI2C_T::BRGEN: CLKDIV Mask */ - -#define UI2C_LINECTL_LSB_Pos (0) /*!< UI2C_T::LINECTL: LSB Position */ -#define UI2C_LINECTL_LSB_Msk (0x1ul << UI2C_LINECTL_LSB_Pos) /*!< UI2C_T::LINECTL: LSB Mask */ - -#define UI2C_LINECTL_DWIDTH_Pos (8) /*!< UI2C_T::LINECTL: DWIDTH Position */ -#define UI2C_LINECTL_DWIDTH_Msk (0xful << UI2C_LINECTL_DWIDTH_Pos) /*!< UI2C_T::LINECTL: DWIDTH Mask */ - -#define UI2C_TXDAT_TXDAT_Pos (0) /*!< UI2C_T::TXDAT: TXDAT Position */ -#define UI2C_TXDAT_TXDAT_Msk (0xfffful << UI2C_TXDAT_TXDAT_Pos) /*!< UI2C_T::TXDAT: TXDAT Mask */ - -#define UI2C_RXDAT_RXDAT_Pos (0) /*!< UI2C_T::RXDAT: RXDAT Position */ -#define UI2C_RXDAT_RXDAT_Msk (0xfffful << UI2C_RXDAT_RXDAT_Pos) /*!< UI2C_T::RXDAT: RXDAT Mask */ - -#define UI2C_DEVADDR0_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR0: DEVADDR Position */ -#define UI2C_DEVADDR0_DEVADDR_Msk (0x3fful << UI2C_DEVADDR0_DEVADDR_Pos) /*!< UI2C_T::DEVADDR0: DEVADDR Mask */ - -#define UI2C_DEVADDR1_DEVADDR_Pos (0) /*!< UI2C_T::DEVADDR1: DEVADDR Position */ -#define UI2C_DEVADDR1_DEVADDR_Msk (0x3fful << UI2C_DEVADDR1_DEVADDR_Pos) /*!< UI2C_T::DEVADDR1: DEVADDR Mask */ - -#define UI2C_ADDRMSK0_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK0: ADDRMSK Position */ -#define UI2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK0_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define UI2C_ADDRMSK1_ADDRMSK_Pos (0) /*!< UI2C_T::ADDRMSK1: ADDRMSK Position */ -#define UI2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << UI2C_ADDRMSK1_ADDRMSK_Pos) /*!< UI2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define UI2C_WKCTL_WKEN_Pos (0) /*!< UI2C_T::WKCTL: WKEN Position */ -#define UI2C_WKCTL_WKEN_Msk (0x1ul << UI2C_WKCTL_WKEN_Pos) /*!< UI2C_T::WKCTL: WKEN Mask */ - -#define UI2C_WKCTL_WKADDREN_Pos (1) /*!< UI2C_T::WKCTL: WKADDREN Position */ -#define UI2C_WKCTL_WKADDREN_Msk (0x1ul << UI2C_WKCTL_WKADDREN_Pos) /*!< UI2C_T::WKCTL: WKADDREN Mask */ - -#define UI2C_WKSTS_WKF_Pos (0) /*!< UI2C_T::WKSTS: WKF Position */ -#define UI2C_WKSTS_WKF_Msk (0x1ul << UI2C_WKSTS_WKF_Pos) /*!< UI2C_T::WKSTS: WKF Mask */ - -#define UI2C_PROTCTL_GCFUNC_Pos (0) /*!< UI2C_T::PROTCTL: GCFUNC Position */ -#define UI2C_PROTCTL_GCFUNC_Msk (0x1ul << UI2C_PROTCTL_GCFUNC_Pos) /*!< UI2C_T::PROTCTL: GCFUNC Mask */ - -#define UI2C_PROTCTL_AA_Pos (1) /*!< UI2C_T::PROTCTL: AA Position */ -#define UI2C_PROTCTL_AA_Msk (0x1ul << UI2C_PROTCTL_AA_Pos) /*!< UI2C_T::PROTCTL: AA Mask */ - -#define UI2C_PROTCTL_STO_Pos (2) /*!< UI2C_T::PROTCTL: STO Position */ -#define UI2C_PROTCTL_STO_Msk (0x1ul << UI2C_PROTCTL_STO_Pos) /*!< UI2C_T::PROTCTL: STO Mask */ - -#define UI2C_PROTCTL_STA_Pos (3) /*!< UI2C_T::PROTCTL: STA Position */ -#define UI2C_PROTCTL_STA_Msk (0x1ul << UI2C_PROTCTL_STA_Pos) /*!< UI2C_T::PROTCTL: STA Mask */ - -#define UI2C_PROTCTL_ADDR10EN_Pos (4) /*!< UI2C_T::PROTCTL: ADDR10EN Position */ -#define UI2C_PROTCTL_ADDR10EN_Msk (0x1ul << UI2C_PROTCTL_ADDR10EN_Pos) /*!< UI2C_T::PROTCTL: ADDR10EN Mask */ - -#define UI2C_PROTCTL_PTRG_Pos (5) /*!< UI2C_T::PROTCTL: PTRG Position */ -#define UI2C_PROTCTL_PTRG_Msk (0x1ul << UI2C_PROTCTL_PTRG_Pos) /*!< UI2C_T::PROTCTL: PTRG Mask */ - -#define UI2C_PROTCTL_SCLOUTEN_Pos (8) /*!< UI2C_T::PROTCTL: SCLOUTEN Position */ -#define UI2C_PROTCTL_SCLOUTEN_Msk (0x1ul << UI2C_PROTCTL_SCLOUTEN_Pos) /*!< UI2C_T::PROTCTL: SCLOUTEN Mask */ - -#define UI2C_PROTCTL_MONEN_Pos (9) /*!< UI2C_T::PROTCTL: MONEN Position */ -#define UI2C_PROTCTL_MONEN_Msk (0x1ul << UI2C_PROTCTL_MONEN_Pos) /*!< UI2C_T::PROTCTL: MONEN Mask */ - -#define UI2C_PROTCTL_TOCNT_Pos (16) /*!< UI2C_T::PROTCTL: TOCNT Position */ -#define UI2C_PROTCTL_TOCNT_Msk (0x3fful << UI2C_PROTCTL_TOCNT_Pos) /*!< UI2C_T::PROTCTL: TOCNT Mask */ - -#define UI2C_PROTCTL_PROTEN_Pos (31) /*!< UI2C_T::PROTCTL: PROTEN Position */ -#define UI2C_PROTCTL_PROTEN_Msk (0x1ul << UI2C_PROTCTL_PROTEN_Pos) /*!< UI2C_T::PROTCTL: PROTEN Mask */ - -#define UI2C_PROTIEN_TOIEN_Pos (0) /*!< UI2C_T::PROTIEN: TOIEN Position */ -#define UI2C_PROTIEN_TOIEN_Msk (0x1ul << UI2C_PROTIEN_TOIEN_Pos) /*!< UI2C_T::PROTIEN: TOIEN Mask */ - -#define UI2C_PROTIEN_STARIEN_Pos (1) /*!< UI2C_T::PROTIEN: STARIEN Position */ -#define UI2C_PROTIEN_STARIEN_Msk (0x1ul << UI2C_PROTIEN_STARIEN_Pos) /*!< UI2C_T::PROTIEN: STARIEN Mask */ - -#define UI2C_PROTIEN_STORIEN_Pos (2) /*!< UI2C_T::PROTIEN: STORIEN Position */ -#define UI2C_PROTIEN_STORIEN_Msk (0x1ul << UI2C_PROTIEN_STORIEN_Pos) /*!< UI2C_T::PROTIEN: STORIEN Mask */ - -#define UI2C_PROTIEN_NACKIEN_Pos (3) /*!< UI2C_T::PROTIEN: NACKIEN Position */ -#define UI2C_PROTIEN_NACKIEN_Msk (0x1ul << UI2C_PROTIEN_NACKIEN_Pos) /*!< UI2C_T::PROTIEN: NACKIEN Mask */ - -#define UI2C_PROTIEN_ARBLOIEN_Pos (4) /*!< UI2C_T::PROTIEN: ARBLOIEN Position */ -#define UI2C_PROTIEN_ARBLOIEN_Msk (0x1ul << UI2C_PROTIEN_ARBLOIEN_Pos) /*!< UI2C_T::PROTIEN: ARBLOIEN Mask */ - -#define UI2C_PROTIEN_ERRIEN_Pos (5) /*!< UI2C_T::PROTIEN: ERRIEN Position */ -#define UI2C_PROTIEN_ERRIEN_Msk (0x1ul << UI2C_PROTIEN_ERRIEN_Pos) /*!< UI2C_T::PROTIEN: ERRIEN Mask */ - -#define UI2C_PROTIEN_ACKIEN_Pos (6) /*!< UI2C_T::PROTIEN: ACKIEN Position */ -#define UI2C_PROTIEN_ACKIEN_Msk (0x1ul << UI2C_PROTIEN_ACKIEN_Pos) /*!< UI2C_T::PROTIEN: ACKIEN Mask */ - -#define UI2C_PROTSTS_TOIF_Pos (5) /*!< UI2C_T::PROTSTS: TOIF Position */ -#define UI2C_PROTSTS_TOIF_Msk (0x1ul << UI2C_PROTSTS_TOIF_Pos) /*!< UI2C_T::PROTSTS: TOIF Mask */ - -#define UI2C_PROTSTS_ONBUSY_Pos (6) /*!< UI2C_T::PROTSTS: ONBUSY Position */ -#define UI2C_PROTSTS_ONBUSY_Msk (0x1ul << UI2C_PROTSTS_ONBUSY_Pos) /*!< UI2C_T::PROTSTS: ONBUSY Mask */ - -#define UI2C_PROTSTS_STARIF_Pos (8) /*!< UI2C_T::PROTSTS: STARIF Position */ -#define UI2C_PROTSTS_STARIF_Msk (0x1ul << UI2C_PROTSTS_STARIF_Pos) /*!< UI2C_T::PROTSTS: STARIF Mask */ - -#define UI2C_PROTSTS_STORIF_Pos (9) /*!< UI2C_T::PROTSTS: STORIF Position */ -#define UI2C_PROTSTS_STORIF_Msk (0x1ul << UI2C_PROTSTS_STORIF_Pos) /*!< UI2C_T::PROTSTS: STORIF Mask */ - -#define UI2C_PROTSTS_NACKIF_Pos (10) /*!< UI2C_T::PROTSTS: NACKIF Position */ -#define UI2C_PROTSTS_NACKIF_Msk (0x1ul << UI2C_PROTSTS_NACKIF_Pos) /*!< UI2C_T::PROTSTS: NACKIF Mask */ - -#define UI2C_PROTSTS_ARBLOIF_Pos (11) /*!< UI2C_T::PROTSTS: ARBLOIF Position */ -#define UI2C_PROTSTS_ARBLOIF_Msk (0x1ul << UI2C_PROTSTS_ARBLOIF_Pos) /*!< UI2C_T::PROTSTS: ARBLOIF Mask */ - -#define UI2C_PROTSTS_ERRIF_Pos (12) /*!< UI2C_T::PROTSTS: ERRIF Position */ -#define UI2C_PROTSTS_ERRIF_Msk (0x1ul << UI2C_PROTSTS_ERRIF_Pos) /*!< UI2C_T::PROTSTS: ERRIF Mask */ - -#define UI2C_PROTSTS_ACKIF_Pos (13) /*!< UI2C_T::PROTSTS: ACKIF Position */ -#define UI2C_PROTSTS_ACKIF_Msk (0x1ul << UI2C_PROTSTS_ACKIF_Pos) /*!< UI2C_T::PROTSTS: ACKIF Mask */ - -#define UI2C_PROTSTS_SLASEL_Pos (14) /*!< UI2C_T::PROTSTS: SLASEL Position */ -#define UI2C_PROTSTS_SLASEL_Msk (0x1ul << UI2C_PROTSTS_SLASEL_Pos) /*!< UI2C_T::PROTSTS: SLASEL Mask */ - -#define UI2C_PROTSTS_SLAREAD_Pos (15) /*!< UI2C_T::PROTSTS: SLAREAD Position */ -#define UI2C_PROTSTS_SLAREAD_Msk (0x1ul << UI2C_PROTSTS_SLAREAD_Pos) /*!< UI2C_T::PROTSTS: SLAREAD Mask */ - -#define UI2C_PROTSTS_WKAKDONE_Pos (16) /*!< UI2C_T::PROTSTS: WKAKDONE Position */ -#define UI2C_PROTSTS_WKAKDONE_Msk (0x1ul << UI2C_PROTSTS_WKAKDONE_Pos) /*!< UI2C_T::PROTSTS: WKAKDONE Mask */ - -#define UI2C_PROTSTS_WRSTSWK_Pos (17) /*!< UI2C_T::PROTSTS: WRSTSWK Position */ -#define UI2C_PROTSTS_WRSTSWK_Msk (0x1ul << UI2C_PROTSTS_WRSTSWK_Pos) /*!< UI2C_T::PROTSTS: WRSTSWK Mask */ - -#define UI2C_PROTSTS_BUSHANG_Pos (18) /*!< UI2C_T::PROTSTS: BUSHANG Position */ -#define UI2C_PROTSTS_BUSHANG_Msk (0x1ul << UI2C_PROTSTS_BUSHANG_Pos) /*!< UI2C_T::PROTSTS: BUSHANG Mask */ - -#define UI2C_PROTSTS_ERRARBLO_Pos (19) /*!< UI2C_T::PROTSTS: ERRARBLO Position */ -#define UI2C_PROTSTS_ERRARBLO_Msk (0x1ul << UI2C_PROTSTS_ERRARBLO_Pos) /*!< UI2C_T::PROTSTS: ERRARBLO Mask */ - -#define UI2C_ADMAT_ADMAT0_Pos (0) /*!< UI2C_T::ADMAT: ADMAT0 Position */ -#define UI2C_ADMAT_ADMAT0_Msk (0x1ul << UI2C_ADMAT_ADMAT0_Pos) /*!< UI2C_T::ADMAT: ADMAT0 Mask */ - -#define UI2C_ADMAT_ADMAT1_Pos (1) /*!< UI2C_T::ADMAT: ADMAT1 Position */ -#define UI2C_ADMAT_ADMAT1_Msk (0x1ul << UI2C_ADMAT_ADMAT1_Pos) /*!< UI2C_T::ADMAT: ADMAT1 Mask */ - -#define UI2C_TMCTL_STCTL_Pos (0) /*!< UI2C_T::TMCTL: STCTL Position */ -#define UI2C_TMCTL_STCTL_Msk (0x1fful << UI2C_TMCTL_STCTL_Pos) /*!< UI2C_T::TMCTL: STCTL Mask */ - -#define UI2C_TMCTL_HTCTL_Pos (16) /*!< UI2C_T::TMCTL: HTCTL Position */ -#define UI2C_TMCTL_HTCTL_Msk (0x1fful << UI2C_TMCTL_HTCTL_Pos) /*!< UI2C_T::TMCTL: HTCTL Mask */ - -/**@}*/ /* UI2C_CONST */ -/**@}*/ /* end of UI2C register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __UI2C_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbd_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbd_reg.h deleted file mode 100644 index 5638db70e6e..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbd_reg.h +++ /dev/null @@ -1,649 +0,0 @@ -/**************************************************************************//** - * @file usbd_reg.h - * @version V1.00 - * @brief USBD register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBD_REG_H__ -#define __USBD_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USBD USB Device Controller(USBD) - Memory Mapped Structure for USBD Controller -@{ */ - -typedef struct -{ - - /** - * @var USBD_EP_T::BUFSEG - * Offset: 0x000 Endpoint n Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |BUFSEG |Endpoint Buffer Segmentation - * | | |It is used to indicate the offset address for each endpoint with the USB SRAM starting address The effective starting address of the endpoint is - * | | |USBD_SRAM address + { BUFSEG, 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Refer to the section 7.29.5.7 for the endpoint SRAM structure and its description. - * @var USBD_EP_T::MXPLD - * Offset: 0x004 Endpoint n Maximal Payload Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |MXPLD |Maximal Payload - * | | |Define the data length which is transmitted to host (IN token) or the actual data length which is received from the host (OUT token) - * | | |It also used to indicate that the endpoint is ready to be transmitted in IN token or received in OUT token. - * | | |(1) When the register is written by CPU, - * | | |For IN token, the value of MXPLD is used to define the data length to be transmitted and indicate the data buffer is ready. - * | | |For OUT token, it means that the controller is ready to receive data from the host and the value of MXPLD is the maximal data length comes from host. - * | | |(2) When the register is read by CPU, - * | | |For IN token, the value of MXPLD is indicated by the data length be transmitted to host - * | | |For OUT token, the value of MXPLD is indicated the actual data length receiving from host. - * | | |Note: Once MXPLD is written, the data packets will be transmitted/received immediately after IN/OUT token arrived. - * @var USBD_EP_T::CFG - * Offset: 0x008 Endpoint n Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNUM |Endpoint Number - * | | |These bits are used to define the endpoint number of the current endpoint - * |[4] |ISOCH |Isochronous Endpoint - * | | |This bit is used to set the endpoint as Isochronous endpoint, no handshake. - * | | |0 = No Isochronous endpoint. - * | | |1 = Isochronous endpoint. - * |[6:5] |STATE |Endpoint STATE - * | | |00 = Endpoint is Disabled. - * | | |01 = Out endpoint. - * | | |10 = IN endpoint. - * | | |11 = Undefined. - * |[7] |DSQSYNC |Data Sequence Synchronization - * | | |0 = DATA0 PID. - * | | |1 = DATA1 PID. - * | | |Note: It is used to specify the DATA0 or DATA1 PID in the following IN token transaction - * | | |hardware will toggle automatically in IN token base on the bit. - * |[9] |CSTALL |Clear STALL Response - * | | |0 = Disable the device to clear the STALL handshake in setup stage. - * | | |1 = Clear the device to response STALL handshake in setup stage. - * @var USBD_EP_T::CFGP - * Offset: 0x00C Endpoint n Set Stall and Clear In/Out Ready Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CLRRDY |Clear Ready - * | | |When the USBD_MXPLDx register is set by user, it means that the endpoint is ready to transmit or receive data - * | | |If the user wants to disable this transaction before the transaction start, users can set this bit to 1 to disable it and it is auto clear to 0. - * | | |For IN token, write '1' to clear the IN token had ready to transmit the data to USB. - * | | |For OUT token, write '1' to clear the OUT token had ready to receive the data from USB. - * | | |This bit is write 1 only and is always 0 when it is read back. - * |[1] |SSTALL |Set STALL - * | | |0 = Disable the device to response STALL. - * | | |1 = Set the device to respond STALL automatically. - */ - __IO uint32_t BUFSEG; /*!< [0x0000] Endpoint n Buffer Segmentation Register */ - __IO uint32_t MXPLD; /*!< [0x0004] Endpoint n Maximal Payload Register */ - __IO uint32_t CFG; /*!< [0x0008] Endpoint n Configuration Register */ - __IO uint32_t CFGP; /*!< [0x000c] Endpoint n Set Stall and Clear In/Out Ready Control Register */ - -} USBD_EP_T; - -typedef struct -{ - - - /** - * @var USBD_T::INTEN - * Offset: 0x00 USB Device Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIEN |Bus Event Interrupt Enable Bit - * | | |0 = BUS event interrupt Disabled. - * | | |1 = BUS event interrupt Enabled. - * |[1] |USBIEN |USB Event Interrupt Enable Bit - * | | |0 = USB event interrupt Disabled. - * | | |1 = USB event interrupt Enabled. - * |[2] |VBDETIEN |VBUS Detection Interrupt Enable Bit - * | | |0 = VBUS detection Interrupt Disabled. - * | | |1 = VBUS detection Interrupt Enabled. - * |[3] |NEVWKIEN |USB No-event-wake-up Interrupt Enable Bit - * | | |0 = No-event-wake-up Interrupt Disabled. - * | | |1 = No-event-wake-up Interrupt Enabled. - * |[4] |SOFIEN |Start of Frame Interrupt Enable Bit - * | | |0 = SOF Interrupt Disabled. - * | | |1 = SOF Interrupt Enabled. - * |[8] |WKEN |Wake-up Function Enable Bit - * | | |0 = USB wake-up function Disabled. - * | | |1 = USB wake-up function Enabled. - * |[15] |INNAKEN |Active NAK Function and Its Status in IN Token - * | | |0 = When device responds NAK after receiving IN token, IN NAK status will not be updated to USBD_EPSTS0 and USBD_EPSTS1register, so that the USB interrupt event will not be asserted. - * | | |1 = IN NAK status will be updated to USBD_EPSTS0 and USBD_EPSTS1 register and the USB interrupt event will be asserted, when the device responds NAK after receiving IN token. - * @var USBD_T::INTSTS - * Offset: 0x04 USB Device Interrupt Event Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSIF |BUS Interrupt Status - * | | |The BUS event means that there is one of the suspense or the resume function in the bus. - * | | |0 = No BUS event occurred. - * | | |1 = Bus event occurred; check USBD_ATTR[3:0] to know which kind of bus event was occurred, cleared by write 1 to USBD_INTSTS[0]. - * |[1] |USBIF |USB Event Interrupt Status - * | | |The USB event includes the SETUP Token, IN Token, OUT ACK, ISO IN, or ISO OUT events in the bus. - * | | |0 = No USB event occurred. - * | | |1 = USB event occurred, check EPSTS0~5[2:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[1] or EPSTS0~11 and SETUP (USBD_INTSTS[31]). - * |[2] |VBDETIF |VBUS Detection Interrupt Status - * | | |0 = There is not attached/detached event in the USB. - * | | |1 = There is attached/detached event in the USB bus and it is cleared by write 1 to USBD_INTSTS[2]. - * |[3] |NEVWKIF |No-event-wake-up Interrupt Status - * | | |0 = NEVWK event does not occur. - * | | |1 = No-event-wake-up event occurred, cleared by write 1 to USBD_INTSTS[3]. - * |[4] |SOFIF |Start of Frame Interrupt Status - * | | |0 = SOF event does not occur. - * | | |1 = SOF event occurred, cleared by write 1 to USBD_INTSTS[4]. - * |[16] |EPEVT0 |Endpoint 0's USB Event Status - * | | |0 = No event occurred in endpoint 0. - * | | |1 = USB event occurred on Endpoint 0, check USBD_EPSTS0[3:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[16] or USBD_INTSTS[1]. - * |[17] |EPEVT1 |Endpoint 1's USB Event Status - * | | |0 = No event occurred in endpoint 1. - * | | |1 = USB event occurred on Endpoint 1, check USBD_EPSTS0[7:4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[17] or USBD_INTSTS[1]. - * |[18] |EPEVT2 |Endpoint 2's USB Event Status - * | | |0 = No event occurred in endpoint 2. - * | | |1 = USB event occurred on Endpoint 2, check USBD_EPSTS0[11:8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[18] or USBD_INTSTS[1]. - * |[19] |EPEVT3 |Endpoint 3's USB Event Status - * | | |0 = No event occurred in endpoint 3. - * | | |1 = USB event occurred on Endpoint 3, check USBD_EPSTS0[15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[19] or USBD_INTSTS[1]. - * |[20] |EPEVT4 |Endpoint 4's USB Event Status - * | | |0 = No event occurred in endpoint 4. - * | | |1 = USB event occurred on Endpoint 4, check USBD_EPSTS0[19:16] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[20] or USBD_INTSTS[1]. - * |[21] |EPEVT5 |Endpoint 5's USB Event Status - * | | |0 = No event occurred in endpoint 5. - * | | |1 = USB event occurred on Endpoint 5, check USBD_EPSTS0[23:20] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[21] or USBD_INTSTS[1]. - * |[22] |EPEVT6 |Endpoint 6's USB Event Status - * | | |0 = No event occurred in endpoint 6. - * | | |1 = USB event occurred on Endpoint 6, check USBD_EPSTS0[27:24] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[22] or USBD_INTSTS[1]. - * |[23] |EPEVT7 |Endpoint 7's USB Event Status - * | | |0 = No event occurred in endpoint 7. - * | | |1 = USB event occurred on Endpoint 7, check USBD_EPSTS0[31:28] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[23] or USBD_INTSTS[1]. - * |[24] |EPEVT8 |Endpoint 8's USB Event Status - * | | |0 = No event occurred in endpoint 8. - * | | |1 = USB event occurred on Endpoint 8, check USBD_EPSTS1[3 :0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[24] or USBD_INTSTS[1]. - * |[25] |EPEVT9 |Endpoint 9's USB Event Status - * | | |0 = No event occurred in endpoint 9. - * | | |1 = USB event occurred on Endpoint 9, check USBD_EPSTS1[7 :4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[25] or USBD_INTSTS[1]. - * |[26] |EPEVT10 |Endpoint 10's USB Event Status - * | | |0 = No event occurred in endpoint 10. - * | | |1 = USB event occurred on Endpoint 10, check USBD_EPSTS1[11 :8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[26] or USBD_INTSTS[1]. - * |[27] |EPEVT11 |Endpoint 11's USB Event Status - * | | |0 = No event occurred in endpoint 11. - * | | |1 = USB event occurred on Endpoint 11, check USBD_EPSTS1[ 15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[27] or USBD_INTSTS[1]. - * |[31] |SETUP |Setup Event Status - * | | |0 = No Setup event. - * | | |1 = Setup event occurred, cleared by write 1 to USBD_INTSTS[31]. - * @var USBD_T::FADDR - * Offset: 0x08 USB Device Function Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |FADDR |USB Device Function Address - * @var USBD_T::EPSTS - * Offset: 0x0C USB Device Endpoint Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |OV |Overrun - * | | |It indicates that the received data is over the maximum payload number or not. - * | | |0 = No overrun. - * | | |1 = Out Data is more than the Max Payload in MXPLD register or the Setup Data is more than 8 Bytes. - * @var USBD_T::ATTR - * Offset: 0x10 USB Device Bus Status and Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBRST |USB Reset Status - * | | |0 = Bus no reset. - * | | |1 = Bus reset when SE0 (single-ended 0) more than 2.5us. - * | | |Note: This bit is read only. - * |[1] |SUSPEND |Suspend Status - * | | |0 = Bus no suspend. - * | | |1 = Bus idle more than 3ms, either cable is plugged off or host is sleeping. - * | | |Note: This bit is read only. - * |[2] |RESUME |Resume Status - * | | |0 = No bus resume. - * | | |1 = Resume from suspend. - * | | |Note: This bit is read only. - * |[3] |TOUT |Time-out Status - * | | |0 = No time-out. - * | | |1 = No Bus response more than 18 bits time. - * | | |Note: This bit is read only. - * |[4] |PHYEN |PHY Transceiver Function Enable Bit - * | | |0 = PHY transceiver function Disabled. - * | | |1 = PHY transceiver function Enabled. - * |[5] |RWAKEUP |Remote Wake-up - * | | |0 = Release the USB bus from K state. - * | | |1 = Force USB bus to K (USB_D+ low, USB_D-: high) state, used for remote wake-up. - * |[7] |USBEN |USB Controller Enable Bit - * | | |0 = USB Controller Disabled. - * | | |1 = USB Controller Enabled. - * |[8] |DPPUEN |Pull-up Resistor on USB_DP Enable Bit - * | | |0 = Pull-up resistor in USB_D+ bus Disabled. - * | | |1 = Pull-up resistor in USB_D+ bus Active. - * |[10] |BYTEM |CPU Access USB SRAM Size Mode Selection - * | | |0 = Word mode: The size of the transfer from CPU to USB SRAM can be Word only. - * | | |1 = Byte mode: The size of the transfer from CPU to USB SRAM can be Byte only. - * |[11] |LPMACK |LPM Token Acknowledge Enable Bit - * | | |The NYET/ACK will be returned only on a successful LPM transaction if no errors in both the EXT token and the LPM token and a valid bLinkState = 0001 (L1) is received, else ERROR and STALL will be returned automatically, respectively. - * | | |0= the valid LPM Token will be NYET. - * | | |1= the valid LPM Token will be ACK. - * |[12] |L1SUSPEND |LPM L1 Suspend - * | | |0 = Bus no L1 state suspend. - * | | |1 = This bit is set by the hardware when LPM command to enter the L1 state is successfully received and acknowledged. - * | | |Note: This bit is read only. - * |[13] |L1RESUME |LPM L1 Resume - * | | |0 = Bus no LPM L1 state resume. - * | | |1 = LPM L1 state Resume from LPM L1 state suspend. - * | | |Note: This bit is read only. - * @var USBD_T::VBUSDET - * Offset: 0x14 USB Device VBUS Detection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VBUSDET |Device VBUS Detection - * | | |0 = Controller is not attached to the USB host. - * | | |1 = Controller is attached to the USB host. - * @var USBD_T::STBUFSEG - * Offset: 0x18 SETUP Token Buffer Segmentation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:3] |STBUFSEG |SETUP Token Buffer Segmentation - * | | |It is used to indicate the offset address for the SETUP token with the USB Device SRAM starting address The effective starting address is - * | | |USBD_SRAM address + {STBUFSEG, 3'b000} - * | | |Where the USBD_SRAM address = USBD_BA+0x100h. - * | | |Note: It is used for SETUP token only. - * @var USBD_T::EPSTS0 - * Offset: 0x20 USB Device Endpoint Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[03:00] |EPSTS0 |Endpoint 0 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[07:04] |EPSTS1 |Endpoint 1 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[11:08] |EPSTS2 |Endpoint 2 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[15:12] |EPSTS3 |Endpoint 3 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[19:16] |EPSTS4 |Endpoint 4 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[23:20] |EPSTS5 |Endpoint 5 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[27:24] |EPSTS6 |Endpoint 6 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[31:28] |EPSTS7 |Endpoint 7 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * @var USBD_T::EPSTS1 - * Offset: 0x24 USB Device Endpoint Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPSTS8 |Endpoint 8 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[7:4] |EPSTS9 |Endpoint 9 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[11:8] |EPSTS10 |Endpoint 10 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * |[15:12] |EPSTS11 |Endpoint 11 Status - * | | |These bits are used to indicate the current status of this endpoint - * | | |0000 = In ACK. - * | | |0001 = In NAK. - * | | |0010 = Out Packet Data0 ACK. - * | | |0011 = Setup ACK. - * | | |0110 = Out Packet Data1 ACK. - * | | |0111 = Isochronous transfer end. - * @var USBD_T::LPMATTR - * Offset: 0x88 USB LPM Attribution Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |LPMLINKSTS|LPM Link State - * | | |These bits contain the bLinkState received with last ACK LPM Token - * |[7:4] |LPMBESL |LPM Best Effort Service Latency - * | | |These bits contain the BESL value received with last ACK LPM Token - * |[8] |LPMRWAKUP |LPM Remote Wakeup - * | | |This bit contains the bRemoteWake value received with last ACK LPM Token - * @var USBD_T::FN - * Offset: 0x8C USB Frame number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FN |Frame Number - * | | |These bits contain the 11-bits frame number in the last received SOF packet. - * @var USBD_T::SE0 - * Offset: 0x90 USB Device Drive SE0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SE0 |Drive Single Ended Zero in USB Bus - * | | |The Single Ended Zero (SE0) is when both lines (USB_D+ and USB_D-) are being pulled low. - * | | |0 = Normal operation. - * | | |1 = Force USB PHY transceiver to drive SE0. - */ - - __IO uint32_t INTEN; /*!< [0x0000] USB Device Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0004] USB Device Interrupt Event Status Register */ - __IO uint32_t FADDR; /*!< [0x0008] USB Device Function Address Register */ - __I uint32_t EPSTS; /*!< [0x000c] USB Device Endpoint Status Register */ - __IO uint32_t ATTR; /*!< [0x0010] USB Device Bus Status and Attribution Register */ - __I uint32_t VBUSDET; /*!< [0x0014] USB Device VBUS Detection Register */ - __IO uint32_t STBUFSEG; /*!< [0x0018] SETUP Token Buffer Segmentation Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t EPSTS0; /*!< [0x0020] USB Device Endpoint Status Register 0 */ - __I uint32_t EPSTS1; /*!< [0x0024] USB Device Endpoint Status Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[24]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t LPMATTR; /*!< [0x0088] USB LPM Attribution Register */ - __I uint32_t FN; /*!< [0x008c] USB Frame number Register */ - __IO uint32_t SE0; /*!< [0x0090] USB Device Drive SE0 Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[283]; - /// @endcond //HIDDEN_SYMBOLS - USBD_EP_T EP[12]; /*!< [0x500~0x5bc] USB End Point 0 ~ 11 Configuration Register */ - -} USBD_T; - - -/** - @addtogroup USBD_CONST USBD Bit Field Definition - Constant Definitions for USBD Controller -@{ */ - -#define USBD_INTEN_BUSIEN_Pos (0) /*!< USBD_T::INTEN: BUSIEN Position */ -#define USBD_INTEN_BUSIEN_Msk (0x1ul << USBD_INTEN_BUSIEN_Pos) /*!< USBD_T::INTEN: BUSIEN Mask */ - -#define USBD_INTEN_USBIEN_Pos (1) /*!< USBD_T::INTEN: USBIEN Position */ -#define USBD_INTEN_USBIEN_Msk (0x1ul << USBD_INTEN_USBIEN_Pos) /*!< USBD_T::INTEN: USBIEN Mask */ - -#define USBD_INTEN_VBDETIEN_Pos (2) /*!< USBD_T::INTEN: VBDETIEN Position */ -#define USBD_INTEN_VBDETIEN_Msk (0x1ul << USBD_INTEN_VBDETIEN_Pos) /*!< USBD_T::INTEN: VBDETIEN Mask */ - -#define USBD_INTEN_NEVWKIEN_Pos (3) /*!< USBD_T::INTEN: NEVWKIEN Position */ -#define USBD_INTEN_NEVWKIEN_Msk (0x1ul << USBD_INTEN_NEVWKIEN_Pos) /*!< USBD_T::INTEN: NEVWKIEN Mask */ - -#define USBD_INTEN_SOFIEN_Pos (4) /*!< USBD_T::INTEN: SOFIEN Position */ -#define USBD_INTEN_SOFIEN_Msk (0x1ul << USBD_INTEN_SOFIEN_Pos) /*!< USBD_T::INTEN: SOFIEN Mask */ - -#define USBD_INTEN_WKEN_Pos (8) /*!< USBD_T::INTEN: WKEN Position */ -#define USBD_INTEN_WKEN_Msk (0x1ul << USBD_INTEN_WKEN_Pos) /*!< USBD_T::INTEN: WKEN Mask */ - -#define USBD_INTEN_INNAKEN_Pos (15) /*!< USBD_T::INTEN: INNAKEN Position */ -#define USBD_INTEN_INNAKEN_Msk (0x1ul << USBD_INTEN_INNAKEN_Pos) /*!< USBD_T::INTEN: INNAKEN Mask */ - -#define USBD_INTSTS_BUSIF_Pos (0) /*!< USBD_T::INTSTS: BUSIF Position */ -#define USBD_INTSTS_BUSIF_Msk (0x1ul << USBD_INTSTS_BUSIF_Pos) /*!< USBD_T::INTSTS: BUSIF Mask */ - -#define USBD_INTSTS_USBIF_Pos (1) /*!< USBD_T::INTSTS: USBIF Position */ -#define USBD_INTSTS_USBIF_Msk (0x1ul << USBD_INTSTS_USBIF_Pos) /*!< USBD_T::INTSTS: USBIF Mask */ - -#define USBD_INTSTS_VBDETIF_Pos (2) /*!< USBD_T::INTSTS: VBDETIF Position */ -#define USBD_INTSTS_VBDETIF_Msk (0x1ul << USBD_INTSTS_VBDETIF_Pos) /*!< USBD_T::INTSTS: VBDETIF Mask */ - -#define USBD_INTSTS_NEVWKIF_Pos (3) /*!< USBD_T::INTSTS: NEVWKIF Position */ -#define USBD_INTSTS_NEVWKIF_Msk (0x1ul << USBD_INTSTS_NEVWKIF_Pos) /*!< USBD_T::INTSTS: NEVWKIF Mask */ - -#define USBD_INTSTS_SOFIF_Pos (4) /*!< USBD_T::INTSTS: SOFIF Position */ -#define USBD_INTSTS_SOFIF_Msk (0x1ul << USBD_INTSTS_SOFIF_Pos) /*!< USBD_T::INTSTS: SOFIF Mask */ - -#define USBD_INTSTS_EPEVT0_Pos (16) /*!< USBD_T::INTSTS: EPEVT0 Position */ -#define USBD_INTSTS_EPEVT0_Msk (0x1ul << USBD_INTSTS_EPEVT0_Pos) /*!< USBD_T::INTSTS: EPEVT0 Mask */ - -#define USBD_INTSTS_EPEVT1_Pos (17) /*!< USBD_T::INTSTS: EPEVT1 Position */ -#define USBD_INTSTS_EPEVT1_Msk (0x1ul << USBD_INTSTS_EPEVT1_Pos) /*!< USBD_T::INTSTS: EPEVT1 Mask */ - -#define USBD_INTSTS_EPEVT2_Pos (18) /*!< USBD_T::INTSTS: EPEVT2 Position */ -#define USBD_INTSTS_EPEVT2_Msk (0x1ul << USBD_INTSTS_EPEVT2_Pos) /*!< USBD_T::INTSTS: EPEVT2 Mask */ - -#define USBD_INTSTS_EPEVT3_Pos (19) /*!< USBD_T::INTSTS: EPEVT3 Position */ -#define USBD_INTSTS_EPEVT3_Msk (0x1ul << USBD_INTSTS_EPEVT3_Pos) /*!< USBD_T::INTSTS: EPEVT3 Mask */ - -#define USBD_INTSTS_EPEVT4_Pos (20) /*!< USBD_T::INTSTS: EPEVT4 Position */ -#define USBD_INTSTS_EPEVT4_Msk (0x1ul << USBD_INTSTS_EPEVT4_Pos) /*!< USBD_T::INTSTS: EPEVT4 Mask */ - -#define USBD_INTSTS_EPEVT5_Pos (21) /*!< USBD_T::INTSTS: EPEVT5 Position */ -#define USBD_INTSTS_EPEVT5_Msk (0x1ul << USBD_INTSTS_EPEVT5_Pos) /*!< USBD_T::INTSTS: EPEVT5 Mask */ - -#define USBD_INTSTS_EPEVT6_Pos (22) /*!< USBD_T::INTSTS: EPEVT6 Position */ -#define USBD_INTSTS_EPEVT6_Msk (0x1ul << USBD_INTSTS_EPEVT6_Pos) /*!< USBD_T::INTSTS: EPEVT6 Mask */ - -#define USBD_INTSTS_EPEVT7_Pos (23) /*!< USBD_T::INTSTS: EPEVT7 Position */ -#define USBD_INTSTS_EPEVT7_Msk (0x1ul << USBD_INTSTS_EPEVT7_Pos) /*!< USBD_T::INTSTS: EPEVT7 Mask */ - -#define USBD_INTSTS_EPEVT8_Pos (24) /*!< USBD_T::INTSTS: EPEVT8 Position */ -#define USBD_INTSTS_EPEVT8_Msk (0x1ul << USBD_INTSTS_EPEVT8_Pos) /*!< USBD_T::INTSTS: EPEVT8 Mask */ - -#define USBD_INTSTS_EPEVT9_Pos (25) /*!< USBD_T::INTSTS: EPEVT9 Position */ -#define USBD_INTSTS_EPEVT9_Msk (0x1ul << USBD_INTSTS_EPEVT9_Pos) /*!< USBD_T::INTSTS: EPEVT9 Mask */ - -#define USBD_INTSTS_EPEVT10_Pos (26) /*!< USBD_T::INTSTS: EPEVT10 Position */ -#define USBD_INTSTS_EPEVT10_Msk (0x1ul << USBD_INTSTS_EPEVT10_Pos) /*!< USBD_T::INTSTS: EPEVT10 Mask */ - -#define USBD_INTSTS_EPEVT11_Pos (27) /*!< USBD_T::INTSTS: EPEVT11 Position */ -#define USBD_INTSTS_EPEVT11_Msk (0x1ul << USBD_INTSTS_EPEVT11_Pos) /*!< USBD_T::INTSTS: EPEVT11 Mask */ - -#define USBD_INTSTS_SETUP_Pos (31) /*!< USBD_T::INTSTS: SETUP Position */ -#define USBD_INTSTS_SETUP_Msk (0x1ul << USBD_INTSTS_SETUP_Pos) /*!< USBD_T::INTSTS: SETUP Mask */ - -#define USBD_FADDR_FADDR_Pos (0) /*!< USBD_T::FADDR: FADDR Position */ -#define USBD_FADDR_FADDR_Msk (0x7ful << USBD_FADDR_FADDR_Pos) /*!< USBD_T::FADDR: FADDR Mask */ - -#define USBD_EPSTS_OV_Pos (7) /*!< USBD_T::EPSTS: OV Position */ -#define USBD_EPSTS_OV_Msk (0x1ul << USBD_EPSTS_OV_Pos) /*!< USBD_T::EPSTS: OV Mask */ - -#define USBD_ATTR_USBRST_Pos (0) /*!< USBD_T::ATTR: USBRST Position */ -#define USBD_ATTR_USBRST_Msk (0x1ul << USBD_ATTR_USBRST_Pos) /*!< USBD_T::ATTR: USBRST Mask */ - -#define USBD_ATTR_SUSPEND_Pos (1) /*!< USBD_T::ATTR: SUSPEND Position */ -#define USBD_ATTR_SUSPEND_Msk (0x1ul << USBD_ATTR_SUSPEND_Pos) /*!< USBD_T::ATTR: SUSPEND Mask */ - -#define USBD_ATTR_RESUME_Pos (2) /*!< USBD_T::ATTR: RESUME Position */ -#define USBD_ATTR_RESUME_Msk (0x1ul << USBD_ATTR_RESUME_Pos) /*!< USBD_T::ATTR: RESUME Mask */ - -#define USBD_ATTR_TOUT_Pos (3) /*!< USBD_T::ATTR: TOUT Position */ -#define USBD_ATTR_TOUT_Msk (0x1ul << USBD_ATTR_TOUT_Pos) /*!< USBD_T::ATTR: TOUT Mask */ - -#define USBD_ATTR_PHYEN_Pos (4) /*!< USBD_T::ATTR: PHYEN Position */ -#define USBD_ATTR_PHYEN_Msk (0x1ul << USBD_ATTR_PHYEN_Pos) /*!< USBD_T::ATTR: PHYEN Mask */ - -#define USBD_ATTR_RWAKEUP_Pos (5) /*!< USBD_T::ATTR: RWAKEUP Position */ -#define USBD_ATTR_RWAKEUP_Msk (0x1ul << USBD_ATTR_RWAKEUP_Pos) /*!< USBD_T::ATTR: RWAKEUP Mask */ - -#define USBD_ATTR_USBEN_Pos (7) /*!< USBD_T::ATTR: USBEN Position */ -#define USBD_ATTR_USBEN_Msk (0x1ul << USBD_ATTR_USBEN_Pos) /*!< USBD_T::ATTR: USBEN Mask */ - -#define USBD_ATTR_DPPUEN_Pos (8) /*!< USBD_T::ATTR: DPPUEN Position */ -#define USBD_ATTR_DPPUEN_Msk (0x1ul << USBD_ATTR_DPPUEN_Pos) /*!< USBD_T::ATTR: DPPUEN Mask */ - -#define USBD_ATTR_BYTEM_Pos (10) /*!< USBD_T::ATTR: BYTEM Position */ -#define USBD_ATTR_BYTEM_Msk (0x1ul << USBD_ATTR_BYTEM_Pos) /*!< USBD_T::ATTR: BYTEM Mask */ - -#define USBD_ATTR_LPMACK_Pos (11) /*!< USBD_T::ATTR: LPMACK Position */ -#define USBD_ATTR_LPMACK_Msk (0x1ul << USBD_ATTR_LPMACK_Pos) /*!< USBD_T::ATTR: LPMACK Mask */ - -#define USBD_ATTR_L1SUSPEND_Pos (12) /*!< USBD_T::ATTR: L1SUSPEND Position */ -#define USBD_ATTR_L1SUSPEND_Msk (0x1ul << USBD_ATTR_L1SUSPEND_Pos) /*!< USBD_T::ATTR: L1SUSPEND Mask */ - -#define USBD_ATTR_L1RESUME_Pos (13) /*!< USBD_T::ATTR: L1RESUME Position */ -#define USBD_ATTR_L1RESUME_Msk (0x1ul << USBD_ATTR_L1RESUME_Pos) /*!< USBD_T::ATTR: L1RESUME Mask */ - -#define USBD_VBUSDET_VBUSDET_Pos (0) /*!< USBD_T::VBUSDET: VBUSDET Position */ -#define USBD_VBUSDET_VBUSDET_Msk (0x1ul << USBD_VBUSDET_VBUSDET_Pos) /*!< USBD_T::VBUSDET: VBUSDET Mask */ - -#define USBD_STBUFSEG_STBUFSEG_Pos (3) /*!< USBD_T::STBUFSEG: STBUFSEG Position */ -#define USBD_STBUFSEG_STBUFSEG_Msk (0x3ful << USBD_STBUFSEG_STBUFSEG_Pos) /*!< USBD_T::STBUFSEG: STBUFSEG Mask */ - -#define USBD_EPSTS0_EPSTS0_Pos (0) /*!< USBD_T::EPSTS0: EPSTS0 Position */ -#define USBD_EPSTS0_EPSTS0_Msk (0xful << USBD_EPSTS0_EPSTS0_Pos) /*!< USBD_T::EPSTS0: EPSTS0 Mask */ - -#define USBD_EPSTS0_EPSTS1_Pos (4) /*!< USBD_T::EPSTS0: EPSTS1 Position */ -#define USBD_EPSTS0_EPSTS1_Msk (0xful << USBD_EPSTS0_EPSTS1_Pos) /*!< USBD_T::EPSTS0: EPSTS1 Mask */ - -#define USBD_EPSTS0_EPSTS2_Pos (8) /*!< USBD_T::EPSTS0: EPSTS2 Position */ -#define USBD_EPSTS0_EPSTS2_Msk (0xful << USBD_EPSTS0_EPSTS2_Pos) /*!< USBD_T::EPSTS0: EPSTS2 Mask */ - -#define USBD_EPSTS0_EPSTS3_Pos (12) /*!< USBD_T::EPSTS0: EPSTS3 Position */ -#define USBD_EPSTS0_EPSTS3_Msk (0xful << USBD_EPSTS0_EPSTS3_Pos) /*!< USBD_T::EPSTS0: EPSTS3 Mask */ - -#define USBD_EPSTS0_EPSTS4_Pos (16) /*!< USBD_T::EPSTS0: EPSTS4 Position */ -#define USBD_EPSTS0_EPSTS4_Msk (0xful << USBD_EPSTS0_EPSTS4_Pos) /*!< USBD_T::EPSTS0: EPSTS4 Mask */ - -#define USBD_EPSTS0_EPSTS5_Pos (20) /*!< USBD_T::EPSTS0: EPSTS5 Position */ -#define USBD_EPSTS0_EPSTS5_Msk (0xful << USBD_EPSTS0_EPSTS5_Pos) /*!< USBD_T::EPSTS0: EPSTS5 Mask */ - -#define USBD_EPSTS0_EPSTS6_Pos (24) /*!< USBD_T::EPSTS0: EPSTS6 Position */ -#define USBD_EPSTS0_EPSTS6_Msk (0xful << USBD_EPSTS0_EPSTS6_Pos) /*!< USBD_T::EPSTS0: EPSTS6 Mask */ - -#define USBD_EPSTS0_EPSTS7_Pos (28) /*!< USBD_T::EPSTS0: EPSTS7 Position */ -#define USBD_EPSTS0_EPSTS7_Msk (0xful << USBD_EPSTS0_EPSTS7_Pos) /*!< USBD_T::EPSTS0: EPSTS7 Mask */ - -#define USBD_EPSTS1_EPSTS8_Pos (0) /*!< USBD_T::EPSTS1: EPSTS8 Position */ -#define USBD_EPSTS1_EPSTS8_Msk (0xful << USBD_EPSTS1_EPSTS8_Pos) /*!< USBD_T::EPSTS1: EPSTS8 Mask */ - -#define USBD_EPSTS1_EPSTS9_Pos (4) /*!< USBD_T::EPSTS1: EPSTS9 Position */ -#define USBD_EPSTS1_EPSTS9_Msk (0xful << USBD_EPSTS1_EPSTS9_Pos) /*!< USBD_T::EPSTS1: EPSTS9 Mask */ - -#define USBD_EPSTS1_EPSTS10_Pos (8) /*!< USBD_T::EPSTS1: EPSTS10 Position */ -#define USBD_EPSTS1_EPSTS10_Msk (0xful << USBD_EPSTS1_EPSTS10_Pos) /*!< USBD_T::EPSTS1: EPSTS10 Mask */ - -#define USBD_EPSTS1_EPSTS11_Pos (12) /*!< USBD_T::EPSTS1: EPSTS11 Position */ -#define USBD_EPSTS1_EPSTS11_Msk (0xful << USBD_EPSTS1_EPSTS11_Pos) /*!< USBD_T::EPSTS1: EPSTS11 Mask */ - -#define USBD_LPMATTR_LPMLINKSTS_Pos (0) /*!< USBD_T::LPMATTR: LPMLINKSTS Position */ -#define USBD_LPMATTR_LPMLINKSTS_Msk (0xful << USBD_LPMATTR_LPMLINKSTS_Pos) /*!< USBD_T::LPMATTR: LPMLINKSTS Mask */ - -#define USBD_LPMATTR_LPMBESL_Pos (4) /*!< USBD_T::LPMATTR: LPMBESL Position */ -#define USBD_LPMATTR_LPMBESL_Msk (0xful << USBD_LPMATTR_LPMBESL_Pos) /*!< USBD_T::LPMATTR: LPMBESL Mask */ - -#define USBD_LPMATTR_LPMRWAKUP_Pos (8) /*!< USBD_T::LPMATTR: LPMRWAKUP Position */ -#define USBD_LPMATTR_LPMRWAKUP_Msk (0x1ul << USBD_LPMATTR_LPMRWAKUP_Pos) /*!< USBD_T::LPMATTR: LPMRWAKUP Mask */ - -#define USBD_FN_FN_Pos (0) /*!< USBD_T::FN: FN Position */ -#define USBD_FN_FN_Msk (0x7fful << USBD_FN_FN_Pos) /*!< USBD_T::FN: FN Mask */ - -#define USBD_SE0_SE0_Pos (0) /*!< USBD_T::SE0: SE0 Position */ -#define USBD_SE0_SE0_Msk (0x1ul << USBD_SE0_SE0_Pos) /*!< USBD_T::SE0: SE0 Mask */ - -#define USBD_BUFSEG_BUFSEG_Pos (3) /*!< USBD_EP_T::BUFSEG: BUFSEG Position */ -#define USBD_BUFSEG_BUFSEG_Msk (0x3ful << USBD_BUFSEG_BUFSEG_Pos) /*!< USBD_EP_T::BUFSEG: BUFSEG Mask */ - -#define USBD_MXPLD_MXPLD_Pos (0) /*!< USBD_EP_T::MXPLD: MXPLD Position */ -#define USBD_MXPLD_MXPLD_Msk (0x1fful << USBD_MXPLD_MXPLD_Pos) /*!< USBD_EP_T::MXPLD: MXPLD Mask */ - -#define USBD_CFG_EPNUM_Pos (0) /*!< USBD_EP_T::CFG: EPNUM Position */ -#define USBD_CFG_EPNUM_Msk (0xful << USBD_CFG_EPNUM_Pos) /*!< USBD_EP_T::CFG: EPNUM Mask */ - -#define USBD_CFG_ISOCH_Pos (4) /*!< USBD_EP_T::CFG: ISOCH Position */ -#define USBD_CFG_ISOCH_Msk (0x1ul << USBD_CFG_ISOCH_Pos) /*!< USBD_EP_T::CFG: ISOCH Mask */ - -#define USBD_CFG_STATE_Pos (5) /*!< USBD_EP_T::CFG: STATE Position */ -#define USBD_CFG_STATE_Msk (0x3ul << USBD_CFG_STATE_Pos) /*!< USBD_EP_T::CFG: STATE Mask */ - -#define USBD_CFG_DSQSYNC_Pos (7) /*!< USBD_EP_T::CFG: DSQSYNC Position */ -#define USBD_CFG_DSQSYNC_Msk (0x1ul << USBD_CFG_DSQSYNC_Pos) /*!< USBD_EP_T::CFG: DSQSYNC Mask */ - -#define USBD_CFG_CSTALL_Pos (9) /*!< USBD_EP_T::CFG: CSTALL Position */ -#define USBD_CFG_CSTALL_Msk (0x1ul << USBD_CFG_CSTALL_Pos) /*!< USBD_EP_T::CFG: CSTALL Mask */ - -#define USBD_CFGP_CLRRDY_Pos (0) /*!< USBD_EP_T::CFGP: CLRRDY Position */ -#define USBD_CFGP_CLRRDY_Msk (0x1ul << USBD_CFGP_CLRRDY_Pos) /*!< USBD_EP_T::CFGP: CLRRDY Mask */ - -#define USBD_CFGP_SSTALL_Pos (1) /*!< USBD_EP_T::CFGP: SSTALL Position */ -#define USBD_CFGP_SSTALL_Msk (0x1ul << USBD_CFGP_SSTALL_Pos) /*!< USBD_EP_T::CFGP: SSTALL Mask */ - -/**@}*/ /* USBD_CONST */ -/**@}*/ /* end of USBD register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __USBD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbh_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbh_reg.h deleted file mode 100644 index 01dcffeaf70..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/usbh_reg.h +++ /dev/null @@ -1,797 +0,0 @@ -/**************************************************************************//** - * @file usbh_reg.h - * @version V1.00 - * @brief USBH register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBH_REG_H__ -#define __USBH_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USBH USB Host Controller(USBH) - Memory Mapped Structure for USBH Controller -@{ */ - -typedef struct -{ - - /** - * @var USBH_T::HcRevision - * Offset: 0x00 Host Controller Revision Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REV |Revision Number - * | | |Indicates the Open HCI Specification revision number implemented by the Hardware - * | | |Host Controller supports 1.1 specification. - * | | |(X.Y = XYh). - * @var USBH_T::HcControl - * Offset: 0x04 Host Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CBSR |Control Bulk Service Ratio - * | | |This specifies the service ratio between Control and Bulk EDs - * | | |Before processing any of the non-periodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs - * | | |The internal count will be retained when crossing the frame boundary - * | | |In case of reset, HCD is responsible for restoring this - * | | |Value. - * | | |00 = Number of Control EDs over Bulk EDs served is 1:1. - * | | |01 = Number of Control EDs over Bulk EDs served is 2:1. - * | | |10 = Number of Control EDs over Bulk EDs served is 3:1. - * | | |11 = Number of Control EDs over Bulk EDs served is 4:1. - * |[2] |PLE |Periodic List Enable Bit - * | | |When set, this bit enables processing of the Periodic (interrupt and isochronous) list - * | | |The Host Controller checks this bit prior to attempting any periodic transfers in a frame. - * | | |0 = Processing of the Periodic (Interrupt and Isochronous) list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Periodic (Interrupt and Isochronous) list in the next frame Enabled. - * | | |Note: To enable the processing of the Isochronous list, user has to set both PLE and IE (HcControl[3]) high. - * |[3] |IE |Isochronous List Enable Bit - * | | |Both ISOEn and PLE (HcControl[2]) high enables Host Controller to process the Isochronous list - * | | |Either ISOEn or PLE (HcControl[2]) is low disables Host Controller to process the Isochronous list. - * | | |0 = Processing of the Isochronous list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Isochronous list in the next frame Enabled, if the PLE (HcControl[2]) is high, too. - * |[4] |CLE |Control List Enable Bit - * | | |0 = Processing of the Control list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Control list in the next frame Enabled. - * |[5] |BLE |Bulk List Enable Bit - * | | |0 = Processing of the Bulk list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Bulk list in the next frame Enabled. - * |[7:6] |HCFS |Host Controller Functional State - * | | |This field sets the Host Controller state - * | | |The Controller may force a state change from USBSUSPEND to USBRESUME after detecting resume signaling from a downstream port - * | | |States are: - * | | |00 = USBSUSPEND. - * | | |01 = USBOPERATIONAL. - * | | |10 = USBRESUME. - * | | |11 = USBRESET. - * @var USBH_T::HcCommandStatus - * Offset: 0x08 Host Controller Command Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HCR |Host Controller Reset - * | | |This bit is set to initiate the software reset of Host Controller - * | | |This bit is cleared by the Host Controller, upon completed of the reset operation. - * | | |This bit, when set, didn't reset the Root Hub and no subsequent reset signaling be asserted to its downstream ports. - * | | |0 = Host Controller is not in software reset state. - * | | |1 = Host Controller is in software reset state. - * |[1] |CLF |Control List Filled - * | | |Set high to indicate there is an active TD on the Control List - * | | |It may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Control List. - * | | |0 = No active TD found or Host Controller begins to process the head of the Control list. - * | | |1 = An active TD added or found on the Control list. - * |[2] |BLF |Bulk List Filled - * | | |Set high to indicate there is an active TD on the Bulk list - * | | |This bit may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Bulk list. - * | | |0 = No active TD found or Host Controller begins to process the head of the Bulk list. - * | | |1 = An active TD added or found on the Bulk list. - * |[17:16] |SOC |Schedule Overrun Count - * | | |These bits are incremented on each scheduling overrun error - * | | |It is initialized to 00b and wraps around at 11b - * | | |This will be incremented when a scheduling overrun is detected even if SO (HcInterruptStatus[0]) has already been set. - * @var USBH_T::HcInterruptStatus - * Offset: 0x0C Host Controller Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun - * | | |Set when the List Processor determines a Schedule Overrun has occurred. - * | | |0 = Schedule Overrun didn't occur. - * | | |1 = Schedule Overrun has occurred. - * |[1] |WDH |Write Back Done Head - * | | |Set after the Host Controller has written HcDoneHead to HccaDoneHead - * | | |Further updates of the HccaDoneHead will not occur until this bit has been cleared. - * | | |0 =.Host Controller didn't update HccaDoneHead. - * | | |1 =.Host Controller has written HcDoneHead to HccaDoneHead. - * |[2] |SF |Start of Frame - * | | |Set when the Frame Management functional block signals a 'Start of Frame' event - * | | |Host Control generates a SOF token at the same time. - * | | |0 =.Not the start of a frame. - * | | |1 =.Indicate the start of a frame and Host Controller generates a SOF token. - * |[3] |RD |Resume Detected - * | | |Set when Host Controller detects resume signaling on a downstream port. - * | | |0 = No resume signaling detected on a downstream port. - * | | |1 = Resume signaling detected on a downstream port. - * |[5] |FNO |Frame Number Overflow - * | | |This bit is set when bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |0 = The bit 15 of Frame Number didn't change. - * | | |1 = The bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * |[6] |RHSC |Root Hub Status Change - * | | |This bit is set when the content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |0 = The content of HcRhStatus and the content of HcRhPortStatus register didn't change. - * | | |1 = The content of HcRhStatus or the content of HcRhPortStatus register has changed. - * @var USBH_T::HcInterruptEnable - * Offset: 0x10 Host Controller Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Enable Bit - * | | |This bit is a global interrupt enable - * | | |A write of '1' allows interrupts to be enabled via the specific enable bits listed above. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcInterruptDisable - * Offset: 0x14 Host Controller Interrupt Disable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Disable Bit - * | | |Global interrupt disable. Writing '1' to disable all interrupts. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcHCCA - * Offset: 0x18 Host Controller Communication Area Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:8] |HCCA |Host Controller Communication Area - * | | |Pointer to indicate base address of the Host Controller Communication Area (HCCA). - * @var USBH_T::HcPeriodCurrentED - * Offset: 0x1C Host Controller Period Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |PCED |Periodic Current ED - * | | |Pointer to indicate physical address of the current Isochronous or Interrupt Endpoint Descriptor. - * @var USBH_T::HcControlHeadED - * Offset: 0x20 Host Controller Control Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CHED |Control Head ED - * | | |Pointer to indicate physical address of the first Endpoint Descriptor of the Control list. - * @var USBH_T::HcControlCurrentED - * Offset: 0x24 Host Controller Control Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CCED |Control Current Head ED - * | | |Pointer to indicate the physical address of the current Endpoint Descriptor of the Control list. - * @var USBH_T::HcBulkHeadED - * Offset: 0x28 Host Controller Bulk Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BHED |Bulk Head ED - * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Bulk list. - * @var USBH_T::HcBulkCurrentED - * Offset: 0x2C Host Controller Bulk Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BCED |Bulk Current Head ED - * | | |Pointer to indicate the physical address of the current endpoint of the Bulk list. - * @var USBH_T::HcDoneHead - * Offset: 0x30 Host Controller Done Head Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |DH |Done Head - * | | |Pointer to indicate the physical address of the last completed Transfer Descriptor that was added to the Done queue. - * @var USBH_T::HcFmInterval - * Offset: 0x34 Host Controller Frame Interval Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Interval - * | | |This field specifies the length of a frame as (bit times - 1) - * | | |For 12,000 bit times in a frame, a value of 11,999 is stored here. - * |[30:16] |FSMPS |FS Largest Data Packet - * | | |This field specifies a value that is loaded into the Largest Data Packet Counter at the beginning of each frame. - * |[31] |FIT |Frame Interval Toggle - * | | |This bit is toggled by Host Controller Driver when it loads a new value into FI (HcFmInterval[13:0]). - * | | |0 = Host Controller Driver didn't load new value into FI (HcFmInterval[13:0]). - * | | |1 = Host Controller Driver loads a new value into FI (HcFmInterval[13:0]). - * @var USBH_T::HcFmRemaining - * Offset: 0x38 Host Controller Frame Remaining Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FR |Frame Remaining - * | | |When the Host Controller is in the USBOPERATIONAL state, this 14-bit field decrements each 12 MHz clock period - * | | |When the count reaches 0, (end of frame) the counter reloads with Frame Interval - * | | |In addition, the counter loads when the Host Controller transitions into USBOPERATIONAL. - * |[31] |FRT |Frame Remaining Toggle - * | | |This bit is loaded from the FIT (HcFmInterval[31]) whenever FR (HcFmRemaining[13:0]) reaches 0. - * @var USBH_T::HcFmNumber - * Offset: 0x3C Host Controller Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FN |Frame Number - * | | |This 16-bit incrementing counter field is incremented coincident with the re-load of FR (HcFmRemaining[13:0]) - * | | |The count rolls over from 'FFFFh' to '0h.' - * @var USBH_T::HcPeriodicStart - * Offset: 0x40 Host Controller Periodic Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PS |Periodic Start - * | | |This field contains a value used by the List Processor to determine where in a frame the Periodic List processing must begin. - * @var USBH_T::HcLSThreshold - * Offset: 0x44 Host Controller Low-speed Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |LST |Low-speed Threshold - * | | |This field contains a value which is compared to the FR (HcFmRemaining[13:0]) field prior to initiating a Low-speed transaction - * | | |The transaction is started only if FR (HcFmRemaining[13:0]) >= this field - * | | |The value is calculated by Host Controller Driver with the consideration of transmission and setup overhead. - * @var USBH_T::HcRhDescriptorA - * Offset: 0x48 Host Controller Root Hub Descriptor A Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |NDP |Number Downstream Ports - * | | |USB host control supports two downstream ports and only one port is available in this series of chip. - * |[8] |PSM |Power Switching Mode - * | | |This bit is used to specify how the power switching of the Root Hub ports is controlled. - * | | |0 = Global Switching. - * | | |1 = Individual Switching. - * |[11] |OCPM |over Current Protection Mode - * | | |This bit describes how the over current status for the Root Hub ports reported - * | | |This bit is only valid when NOCP (HcRhDescriptorA[12]) is cleared. - * | | |0 = Global Over current. - * | | |1 = Individual Over current. - * |[12] |NOCP |No over Current Protection - * | | |This bit describes how the over current status for the Root Hub ports reported. - * | | |0 = Over current status is reported. - * | | |1 = Over current status is not reported. - * @var USBH_T::HcRhDescriptorB - * Offset: 0x4C Host Controller Root Hub Descriptor B Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |PPCM |Port Power Control Mask - * | | |Global power switching - * | | |This field is only valid if PowerSwitchingMode is set (individual port switching) - * | | |When set, the port only responds to individual port power switching commands (Set/ClearPortPower) - * | | |When cleared, the port only responds to global power switching commands (Set/ClearGlobalPower). - * | | |0 = Port power controlled by global power switching. - * | | |1 = Port power controlled by port power switching. - * | | |Note: PPCM[15:2] and PPCM[0] are reserved. - * @var USBH_T::HcRhStatus - * Offset: 0x50 Host Controller Root Hub Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPS |Clear Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to clear all ports' power. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear global power. - * |[1] |OCI |over Current Indicator - * | | |This bit reflects the state of the over current status pin - * | | |This field is only valid if NOCP (HcRhDesA[12]) and OCPM (HcRhDesA[11]) are cleared. - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[15] |DRWE |Device Remote Wakeup Enable Bit - * | | |This bit controls if port's Connect Status Change as a remote wake-up event. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * | | |Read Operation: - * | | |0 = Connect Status Change as a remote wake-up event Disabled. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * |[16] |LPSC |Set Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to enable power to all ports. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set global power. - * |[17] |OCIC |over Current Indicator Change - * | | |This bit is set by hardware when a change has occurred in OCI (HcRhStatus[1]). - * | | |Write 1 to clear this bit to zero. - * | | |0 = OCI (HcRhStatus[1]) didn't change. - * | | |1 = OCI (HcRhStatus[1]) change. - * |[31] |CRWE |Clear Remote Wake-up Enable Bit - * | | |This bit is use to clear DRWE (HcRhStatus[15]). - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear DRWE (HcRhStatus[15]). - * @var USBH_T::HcRhPortStatus[2] - * Offset: 0x54 Host Controller Root Hub Port Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |CurrentConnectStatus (Read) or ClearPortEnable Bit (Write) - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port enable. - * | | |Read Operation: - * | | |0 = No device connected. - * | | |1 = Device connected. - * |[1] |PES |Port Enable Status - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port enable. - * | | |Read Operation: - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[2] |PSS |Port Suspend Status - * | | |This bit indicates the port is suspended - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port suspend. - * | | |Read Operation: - * | | |0 = Port is not suspended. - * | | |1 = Port is selectively suspended. - * |[3] |POCI |Port over Current Indicator (Read) or Clear Port Suspend (Write) - * | | |This bit reflects the state of the over current status pin dedicated to this port - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) is cleared and OCPM (HcRhDescriptorA[11]) is set. - * | | |This bit is also used to initiate the selective result sequence for the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port suspend. - * | | |Read Operation: - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[4] |PRS |Port Reset Status - * | | |This bit reflects the reset state of the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port reset. - * | | |Read Operation - * | | |0 = Port reset signal is not active. - * | | |1 = Port reset signal is active. - * |[8] |PPS |Port Power Status - * | | |This bit reflects the power state of the port regardless of the power switching mode. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Port Power Enabled. - * | | |Read Operation: - * | | |0 = Port power is Disabled. - * | | |1 = Port power is Enabled. - * |[9] |LSDA |Low Speed Device Attached (Read) or Clear Port Power (Write) - * | | |This bit defines the speed (and bud idle) of the attached device - * | | |It is only valid when CCS (HcRhPortStatus1[0]) is set. - * | | |This bit is also used to clear port power. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear PPS (HcRhPortStatus1[8]). - * | | |Read Operation: - * | | |0 = Full Speed device. - * | | |1 = Low-speed device. - * |[16] |CSC |Connect Status Change - * | | |This bit indicates connect or disconnect event has been detected (CCS (HcRhPortStatus1[0]) changed). - * | | |Write 1 to clear this bit to zero. - * | | |0 = No connect/disconnect event (CCS (HcRhPortStatus1[0]) didn't change). - * | | |1 = Hardware detection of connect/disconnect event (CCS (HcRhPortStatus1[0]) changed). - * |[17] |PESC |Port Enable Status Change - * | | |This bit indicates that the port has been disabled (PES (HcRhPortStatus1[1]) cleared) due to a hardware event. - * | | |Write 1 to clear this bit to zero. - * | | |0 = PES (HcRhPortStatus1[1]) didn't change. - * | | |1 = PES (HcRhPortStatus1[1]) changed. - * |[18] |PSSC |Port Suspend Status Change - * | | |This bit indicates the completion of the selective resume sequence for the port. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port resume is not completed. - * | | |1 = Port resume completed. - * |[19] |OCIC |Port over Current Indicator Change - * | | |This bit is set when POCI (HcRhPortStatus1[3]) changes. - * | | |Write 1 to clear this bit to zero. - * | | |0 = POCI (HcRhPortStatus1[3]) didn't change. - * | | |1 = POCI (HcRhPortStatus1[3]) changes. - * |[20] |PRSC |Port Reset Status Change - * | | |This bit indicates that the port reset signal has completed. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port reset is not complete. - * | | |1 = Port reset is complete. - * @var USBH_T::HcPhyControl - * Offset: 0x200 Host Controller PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27] |STBYEN |USB Transceiver Standby Enable Bit - * | | |This bit controls if USB transceiver could enter the standby mode to reduce power consumption. - * | | |0 = The USB transceiver would never enter the standby mode. - * | | |1 = The USB transceiver will enter standby mode while port is in power off state (port power is inactive). - * @var USBH_T::HcMiscControl - * Offset: 0x204 Host Controller Miscellaneous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABORT |AHB Bus ERROR Response - * | | |This bit indicates there is an ERROR response received in AHB bus. - * | | |0 = No ERROR response received. - * | | |1 = ERROR response received. - * |[3] |OCAL |over Current Active Low - * | | |This bit controls the polarity of over current flag from external power IC. - * | | |0 = Over current flag is high active. - * | | |1 = Over current flag is low active. - * |[16] |DPRT1 |Disable Port 1 - * | | |This bit controls if the connection between USB host controller and transceiver of port 1 is disabled - * | | |If the connection is disabled, the USB host controller will not recognize any event of USB bus. - * | | |Set this bit high, the transceiver of port 1 will also be forced into the standby mode no matter what USB host controller operation is. - * | | |0 = The connection between USB host controller and transceiver of port 1 Enabled. - * | | |1 = The connection between USB host controller and transceiver of port 1 Disabled and the transceiver of port 1 will also be forced into the standby mode. - */ - __I uint32_t HcRevision; /*!< [0x0000] Host Controller Revision Register */ - __IO uint32_t HcControl; /*!< [0x0004] Host Controller Control Register */ - __IO uint32_t HcCommandStatus; /*!< [0x0008] Host Controller Command Status Register */ - __IO uint32_t HcInterruptStatus; /*!< [0x000c] Host Controller Interrupt Status Register */ - __IO uint32_t HcInterruptEnable; /*!< [0x0010] Host Controller Interrupt Enable Register */ - __IO uint32_t HcInterruptDisable; /*!< [0x0014] Host Controller Interrupt Disable Register */ - __IO uint32_t HcHCCA; /*!< [0x0018] Host Controller Communication Area Register */ - __IO uint32_t HcPeriodCurrentED; /*!< [0x001c] Host Controller Period Current ED Register */ - __IO uint32_t HcControlHeadED; /*!< [0x0020] Host Controller Control Head ED Register */ - __IO uint32_t HcControlCurrentED; /*!< [0x0024] Host Controller Control Current ED Register */ - __IO uint32_t HcBulkHeadED; /*!< [0x0028] Host Controller Bulk Head ED Register */ - __IO uint32_t HcBulkCurrentED; /*!< [0x002c] Host Controller Bulk Current ED Register */ - __IO uint32_t HcDoneHead; /*!< [0x0030] Host Controller Done Head Register */ - __IO uint32_t HcFmInterval; /*!< [0x0034] Host Controller Frame Interval Register */ - __I uint32_t HcFmRemaining; /*!< [0x0038] Host Controller Frame Remaining Register */ - __I uint32_t HcFmNumber; /*!< [0x003c] Host Controller Frame Number Register */ - __IO uint32_t HcPeriodicStart; /*!< [0x0040] Host Controller Periodic Start Register */ - __IO uint32_t HcLSThreshold; /*!< [0x0044] Host Controller Low-speed Threshold Register */ - __IO uint32_t HcRhDescriptorA; /*!< [0x0048] Host Controller Root Hub Descriptor A Register */ - __IO uint32_t HcRhDescriptorB; /*!< [0x004c] Host Controller Root Hub Descriptor B Register */ - __IO uint32_t HcRhStatus; /*!< [0x0050] Host Controller Root Hub Status Register */ - __IO uint32_t HcRhPortStatus[2]; /*!< [0x0054] Host Controller Root Hub Port Status [1] */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[105]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t HcPhyControl; /*!< [0x0200] Host Controller PHY Control Register */ - __IO uint32_t HcMiscControl; /*!< [0x0204] Host Controller Miscellaneous Control Register */ - -} USBH_T; - -/** - @addtogroup USBH_CONST USBH Bit Field Definition - Constant Definitions for USBH Controller -@{ */ - -#define USBH_HcRevision_REV_Pos (0) /*!< USBH_T::HcRevision: REV Position */ -#define USBH_HcRevision_REV_Msk (0xfful << USBH_HcRevision_REV_Pos) /*!< USBH_T::HcRevision: REV Mask */ - -#define USBH_HcControl_CBSR_Pos (0) /*!< USBH_T::HcControl: CBSR Position */ -#define USBH_HcControl_CBSR_Msk (0x3ul << USBH_HcControl_CBSR_Pos) /*!< USBH_T::HcControl: CBSR Mask */ - -#define USBH_HcControl_PLE_Pos (2) /*!< USBH_T::HcControl: PLE Position */ -#define USBH_HcControl_PLE_Msk (0x1ul << USBH_HcControl_PLE_Pos) /*!< USBH_T::HcControl: PLE Mask */ - -#define USBH_HcControl_IE_Pos (3) /*!< USBH_T::HcControl: IE Position */ -#define USBH_HcControl_IE_Msk (0x1ul << USBH_HcControl_IE_Pos) /*!< USBH_T::HcControl: IE Mask */ - -#define USBH_HcControl_CLE_Pos (4) /*!< USBH_T::HcControl: CLE Position */ -#define USBH_HcControl_CLE_Msk (0x1ul << USBH_HcControl_CLE_Pos) /*!< USBH_T::HcControl: CLE Mask */ - -#define USBH_HcControl_BLE_Pos (5) /*!< USBH_T::HcControl: BLE Position */ -#define USBH_HcControl_BLE_Msk (0x1ul << USBH_HcControl_BLE_Pos) /*!< USBH_T::HcControl: BLE Mask */ - -#define USBH_HcControl_HCFS_Pos (6) /*!< USBH_T::HcControl: HCFS Position */ -#define USBH_HcControl_HCFS_Msk (0x3ul << USBH_HcControl_HCFS_Pos) /*!< USBH_T::HcControl: HCFS Mask */ - -#define USBH_HcCommandStatus_HCR_Pos (0) /*!< USBH_T::HcCommandStatus: HCR Position */ -#define USBH_HcCommandStatus_HCR_Msk (0x1ul << USBH_HcCommandStatus_HCR_Pos) /*!< USBH_T::HcCommandStatus: HCR Mask */ - -#define USBH_HcCommandStatus_CLF_Pos (1) /*!< USBH_T::HcCommandStatus: CLF Position */ -#define USBH_HcCommandStatus_CLF_Msk (0x1ul << USBH_HcCommandStatus_CLF_Pos) /*!< USBH_T::HcCommandStatus: CLF Mask */ - -#define USBH_HcCommandStatus_BLF_Pos (2) /*!< USBH_T::HcCommandStatus: BLF Position */ -#define USBH_HcCommandStatus_BLF_Msk (0x1ul << USBH_HcCommandStatus_BLF_Pos) /*!< USBH_T::HcCommandStatus: BLF Mask */ - -#define USBH_HcCommandStatus_SOC_Pos (16) /*!< USBH_T::HcCommandStatus: SOC Position */ -#define USBH_HcCommandStatus_SOC_Msk (0x3ul << USBH_HcCommandStatus_SOC_Pos) /*!< USBH_T::HcCommandStatus: SOC Mask */ - -#define USBH_HcInterruptStatus_SO_Pos (0) /*!< USBH_T::HcInterruptStatus: SO Position */ -#define USBH_HcInterruptStatus_SO_Msk (0x1ul << USBH_HcInterruptStatus_SO_Pos) /*!< USBH_T::HcInterruptStatus: SO Mask */ - -#define USBH_HcInterruptStatus_WDH_Pos (1) /*!< USBH_T::HcInterruptStatus: WDH Position*/ -#define USBH_HcInterruptStatus_WDH_Msk (0x1ul << USBH_HcInterruptStatus_WDH_Pos) /*!< USBH_T::HcInterruptStatus: WDH Mask */ - -#define USBH_HcInterruptStatus_SF_Pos (2) /*!< USBH_T::HcInterruptStatus: SF Position */ -#define USBH_HcInterruptStatus_SF_Msk (0x1ul << USBH_HcInterruptStatus_SF_Pos) /*!< USBH_T::HcInterruptStatus: SF Mask */ - -#define USBH_HcInterruptStatus_RD_Pos (3) /*!< USBH_T::HcInterruptStatus: RD Position */ -#define USBH_HcInterruptStatus_RD_Msk (0x1ul << USBH_HcInterruptStatus_RD_Pos) /*!< USBH_T::HcInterruptStatus: RD Mask */ - -#define USBH_HcInterruptStatus_FNO_Pos (5) /*!< USBH_T::HcInterruptStatus: FNO Position*/ -#define USBH_HcInterruptStatus_FNO_Msk (0x1ul << USBH_HcInterruptStatus_FNO_Pos) /*!< USBH_T::HcInterruptStatus: FNO Mask */ - -#define USBH_HcInterruptStatus_RHSC_Pos (6) /*!< USBH_T::HcInterruptStatus: RHSC Position*/ -#define USBH_HcInterruptStatus_RHSC_Msk (0x1ul << USBH_HcInterruptStatus_RHSC_Pos) /*!< USBH_T::HcInterruptStatus: RHSC Mask */ - -#define USBH_HcInterruptEnable_SO_Pos (0) /*!< USBH_T::HcInterruptEnable: SO Position */ -#define USBH_HcInterruptEnable_SO_Msk (0x1ul << USBH_HcInterruptEnable_SO_Pos) /*!< USBH_T::HcInterruptEnable: SO Mask */ - -#define USBH_HcInterruptEnable_WDH_Pos (1) /*!< USBH_T::HcInterruptEnable: WDH Position*/ -#define USBH_HcInterruptEnable_WDH_Msk (0x1ul << USBH_HcInterruptEnable_WDH_Pos) /*!< USBH_T::HcInterruptEnable: WDH Mask */ - -#define USBH_HcInterruptEnable_SF_Pos (2) /*!< USBH_T::HcInterruptEnable: SF Position */ -#define USBH_HcInterruptEnable_SF_Msk (0x1ul << USBH_HcInterruptEnable_SF_Pos) /*!< USBH_T::HcInterruptEnable: SF Mask */ - -#define USBH_HcInterruptEnable_RD_Pos (3) /*!< USBH_T::HcInterruptEnable: RD Position */ -#define USBH_HcInterruptEnable_RD_Msk (0x1ul << USBH_HcInterruptEnable_RD_Pos) /*!< USBH_T::HcInterruptEnable: RD Mask */ - -#define USBH_HcInterruptEnable_FNO_Pos (5) /*!< USBH_T::HcInterruptEnable: FNO Position*/ -#define USBH_HcInterruptEnable_FNO_Msk (0x1ul << USBH_HcInterruptEnable_FNO_Pos) /*!< USBH_T::HcInterruptEnable: FNO Mask */ - -#define USBH_HcInterruptEnable_RHSC_Pos (6) /*!< USBH_T::HcInterruptEnable: RHSC Position*/ -#define USBH_HcInterruptEnable_RHSC_Msk (0x1ul << USBH_HcInterruptEnable_RHSC_Pos) /*!< USBH_T::HcInterruptEnable: RHSC Mask */ - -#define USBH_HcInterruptEnable_MIE_Pos (31) /*!< USBH_T::HcInterruptEnable: MIE Position*/ -#define USBH_HcInterruptEnable_MIE_Msk (0x1ul << USBH_HcInterruptEnable_MIE_Pos) /*!< USBH_T::HcInterruptEnable: MIE Mask */ - -#define USBH_HcInterruptDisable_SO_Pos (0) /*!< USBH_T::HcInterruptDisable: SO Position*/ -#define USBH_HcInterruptDisable_SO_Msk (0x1ul << USBH_HcInterruptDisable_SO_Pos) /*!< USBH_T::HcInterruptDisable: SO Mask */ - -#define USBH_HcInterruptDisable_WDH_Pos (1) /*!< USBH_T::HcInterruptDisable: WDH Position*/ -#define USBH_HcInterruptDisable_WDH_Msk (0x1ul << USBH_HcInterruptDisable_WDH_Pos) /*!< USBH_T::HcInterruptDisable: WDH Mask */ - -#define USBH_HcInterruptDisable_SF_Pos (2) /*!< USBH_T::HcInterruptDisable: SF Position*/ -#define USBH_HcInterruptDisable_SF_Msk (0x1ul << USBH_HcInterruptDisable_SF_Pos) /*!< USBH_T::HcInterruptDisable: SF Mask */ - -#define USBH_HcInterruptDisable_RD_Pos (3) /*!< USBH_T::HcInterruptDisable: RD Position*/ -#define USBH_HcInterruptDisable_RD_Msk (0x1ul << USBH_HcInterruptDisable_RD_Pos) /*!< USBH_T::HcInterruptDisable: RD Mask */ - -#define USBH_HcInterruptDisable_FNO_Pos (5) /*!< USBH_T::HcInterruptDisable: FNO Position*/ -#define USBH_HcInterruptDisable_FNO_Msk (0x1ul << USBH_HcInterruptDisable_FNO_Pos) /*!< USBH_T::HcInterruptDisable: FNO Mask */ - -#define USBH_HcInterruptDisable_RHSC_Pos (6) /*!< USBH_T::HcInterruptDisable: RHSC Position*/ -#define USBH_HcInterruptDisable_RHSC_Msk (0x1ul << USBH_HcInterruptDisable_RHSC_Pos) /*!< USBH_T::HcInterruptDisable: RHSC Mask */ - -#define USBH_HcInterruptDisable_MIE_Pos (31) /*!< USBH_T::HcInterruptDisable: MIE Position*/ -#define USBH_HcInterruptDisable_MIE_Msk (0x1ul << USBH_HcInterruptDisable_MIE_Pos) /*!< USBH_T::HcInterruptDisable: MIE Mask */ - -#define USBH_HcHCCA_HCCA_Pos (8) /*!< USBH_T::HcHCCA: HCCA Position */ -#define USBH_HcHCCA_HCCA_Msk (0xfffffful << USBH_HcHCCA_HCCA_Pos) /*!< USBH_T::HcHCCA: HCCA Mask */ - -#define USBH_HcPeriodCurrentED_PCED_Pos (4) /*!< USBH_T::HcPeriodCurrentED: PCED Position*/ -#define USBH_HcPeriodCurrentED_PCED_Msk (0xffffffful << USBH_HcPeriodCurrentED_PCED_Pos) /*!< USBH_T::HcPeriodCurrentED: PCED Mask */ - -#define USBH_HcControlHeadED_CHED_Pos (4) /*!< USBH_T::HcControlHeadED: CHED Position */ -#define USBH_HcControlHeadED_CHED_Msk (0xffffffful << USBH_HcControlHeadED_CHED_Pos) /*!< USBH_T::HcControlHeadED: CHED Mask */ - -#define USBH_HcControlCurrentED_CCED_Pos (4) /*!< USBH_T::HcControlCurrentED: CCED Position*/ -#define USBH_HcControlCurrentED_CCED_Msk (0xffffffful << USBH_HcControlCurrentED_CCED_Pos) /*!< USBH_T::HcControlCurrentED: CCED Mask */ - -#define USBH_HcBulkHeadED_BHED_Pos (4) /*!< USBH_T::HcBulkHeadED: BHED Position */ -#define USBH_HcBulkHeadED_BHED_Msk (0xffffffful << USBH_HcBulkHeadED_BHED_Pos) /*!< USBH_T::HcBulkHeadED: BHED Mask */ - -#define USBH_HcBulkCurrentED_BCED_Pos (4) /*!< USBH_T::HcBulkCurrentED: BCED Position */ -#define USBH_HcBulkCurrentED_BCED_Msk (0xffffffful << USBH_HcBulkCurrentED_BCED_Pos) /*!< USBH_T::HcBulkCurrentED: BCED Mask */ - -#define USBH_HcDoneHead_DH_Pos (4) /*!< USBH_T::HcDoneHead: DH Position */ -#define USBH_HcDoneHead_DH_Msk (0xffffffful << USBH_HcDoneHead_DH_Pos) /*!< USBH_T::HcDoneHead: DH Mask */ - -#define USBH_HcFmInterval_FI_Pos (0) /*!< USBH_T::HcFmInterval: FI Position */ -#define USBH_HcFmInterval_FI_Msk (0x3ffful << USBH_HcFmInterval_FI_Pos) /*!< USBH_T::HcFmInterval: FI Mask */ - -#define USBH_HcFmInterval_FSMPS_Pos (16) /*!< USBH_T::HcFmInterval: FSMPS Position */ -#define USBH_HcFmInterval_FSMPS_Msk (0x7ffful << USBH_HcFmInterval_FSMPS_Pos) /*!< USBH_T::HcFmInterval: FSMPS Mask */ - -#define USBH_HcFmInterval_FIT_Pos (31) /*!< USBH_T::HcFmInterval: FIT Position */ -#define USBH_HcFmInterval_FIT_Msk (0x1ul << USBH_HcFmInterval_FIT_Pos) /*!< USBH_T::HcFmInterval: FIT Mask */ - -#define USBH_HcFmRemaining_FR_Pos (0) /*!< USBH_T::HcFmRemaining: FR Position */ -#define USBH_HcFmRemaining_FR_Msk (0x3ffful << USBH_HcFmRemaining_FR_Pos) /*!< USBH_T::HcFmRemaining: FR Mask */ - -#define USBH_HcFmRemaining_FRT_Pos (31) /*!< USBH_T::HcFmRemaining: FRT Position */ -#define USBH_HcFmRemaining_FRT_Msk (0x1ul << USBH_HcFmRemaining_FRT_Pos) /*!< USBH_T::HcFmRemaining: FRT Mask */ - -#define USBH_HcFmNumber_FN_Pos (0) /*!< USBH_T::HcFmNumber: FN Position */ -#define USBH_HcFmNumber_FN_Msk (0xfffful << USBH_HcFmNumber_FN_Pos) /*!< USBH_T::HcFmNumber: FN Mask */ - -#define USBH_HcPeriodicStart_PS_Pos (0) /*!< USBH_T::HcPeriodicStart: PS Position */ -#define USBH_HcPeriodicStart_PS_Msk (0x3ffful << USBH_HcPeriodicStart_PS_Pos) /*!< USBH_T::HcPeriodicStart: PS Mask */ - -#define USBH_HcLSThreshold_LST_Pos (0) /*!< USBH_T::HcLSThreshold: LST Position */ -#define USBH_HcLSThreshold_LST_Msk (0xffful << USBH_HcLSThreshold_LST_Pos) /*!< USBH_T::HcLSThreshold: LST Mask */ - -#define USBH_HcRhDescriptorA_NDP_Pos (0) /*!< USBH_T::HcRhDescriptorA: NDP Position */ -#define USBH_HcRhDescriptorA_NDP_Msk (0xfful << USBH_HcRhDescriptorA_NDP_Pos) /*!< USBH_T::HcRhDescriptorA: NDP Mask */ - -#define USBH_HcRhDescriptorA_PSM_Pos (8) /*!< USBH_T::HcRhDescriptorA: PSM Position */ -#define USBH_HcRhDescriptorA_PSM_Msk (0x1ul << USBH_HcRhDescriptorA_PSM_Pos) /*!< USBH_T::HcRhDescriptorA: PSM Mask */ - -#define USBH_HcRhDescriptorA_OCPM_Pos (11) /*!< USBH_T::HcRhDescriptorA: OCPM Position */ -#define USBH_HcRhDescriptorA_OCPM_Msk (0x1ul << USBH_HcRhDescriptorA_OCPM_Pos) /*!< USBH_T::HcRhDescriptorA: OCPM Mask */ - -#define USBH_HcRhDescriptorA_NOCP_Pos (12) /*!< USBH_T::HcRhDescriptorA: NOCP Position */ -#define USBH_HcRhDescriptorA_NOCP_Msk (0x1ul << USBH_HcRhDescriptorA_NOCP_Pos) /*!< USBH_T::HcRhDescriptorA: NOCP Mask */ - -#define USBH_HcRhDescriptorB_PPCM_Pos (16) /*!< USBH_T::HcRhDescriptorB: PPCM Position */ -#define USBH_HcRhDescriptorB_PPCM_Msk (0xfffful << USBH_HcRhDescriptorB_PPCM_Pos) /*!< USBH_T::HcRhDescriptorB: PPCM Mask */ - -#define USBH_HcRhStatus_LPS_Pos (0) /*!< USBH_T::HcRhStatus: LPS Position */ -#define USBH_HcRhStatus_LPS_Msk (0x1ul << USBH_HcRhStatus_LPS_Pos) /*!< USBH_T::HcRhStatus: LPS Mask */ - -#define USBH_HcRhStatus_OCI_Pos (1) /*!< USBH_T::HcRhStatus: OCI Position */ -#define USBH_HcRhStatus_OCI_Msk (0x1ul << USBH_HcRhStatus_OCI_Pos) /*!< USBH_T::HcRhStatus: OCI Mask */ - -#define USBH_HcRhStatus_DRWE_Pos (15) /*!< USBH_T::HcRhStatus: DRWE Position */ -#define USBH_HcRhStatus_DRWE_Msk (0x1ul << USBH_HcRhStatus_DRWE_Pos) /*!< USBH_T::HcRhStatus: DRWE Mask */ - -#define USBH_HcRhStatus_LPSC_Pos (16) /*!< USBH_T::HcRhStatus: LPSC Position */ -#define USBH_HcRhStatus_LPSC_Msk (0x1ul << USBH_HcRhStatus_LPSC_Pos) /*!< USBH_T::HcRhStatus: LPSC Mask */ - -#define USBH_HcRhStatus_OCIC_Pos (17) /*!< USBH_T::HcRhStatus: OCIC Position */ -#define USBH_HcRhStatus_OCIC_Msk (0x1ul << USBH_HcRhStatus_OCIC_Pos) /*!< USBH_T::HcRhStatus: OCIC Mask */ - -#define USBH_HcRhStatus_CRWE_Pos (31) /*!< USBH_T::HcRhStatus: CRWE Position */ -#define USBH_HcRhStatus_CRWE_Msk (0x1ul << USBH_HcRhStatus_CRWE_Pos) /*!< USBH_T::HcRhStatus: CRWE Mask */ - -#define USBH_HcRhPortStatus_CCS_Pos (0) /*!< USBH_T::HcRhPortStatus1: CCS Position */ -#define USBH_HcRhPortStatus_CCS_Msk (0x1ul << USBH_HcRhPortStatus_CCS_Pos) /*!< USBH_T::HcRhPortStatus1: CCS Mask */ - -#define USBH_HcRhPortStatus_PES_Pos (1) /*!< USBH_T::HcRhPortStatus1: PES Position */ -#define USBH_HcRhPortStatus_PES_Msk (0x1ul << USBH_HcRhPortStatus_PES_Pos) /*!< USBH_T::HcRhPortStatus1: PES Mask */ - -#define USBH_HcRhPortStatus_PSS_Pos (2) /*!< USBH_T::HcRhPortStatus1: PSS Position */ -#define USBH_HcRhPortStatus_PSS_Msk (0x1ul << USBH_HcRhPortStatus_PSS_Pos) /*!< USBH_T::HcRhPortStatus1: PSS Mask */ - -#define USBH_HcRhPortStatus_POCI_Pos (3) /*!< USBH_T::HcRhPortStatus1: POCI Position */ -#define USBH_HcRhPortStatus_POCI_Msk (0x1ul << USBH_HcRhPortStatus_POCI_Pos) /*!< USBH_T::HcRhPortStatus1: POCI Mask */ - -#define USBH_HcRhPortStatus_PRS_Pos (4) /*!< USBH_T::HcRhPortStatus1: PRS Position */ -#define USBH_HcRhPortStatus_PRS_Msk (0x1ul << USBH_HcRhPortStatus_PRS_Pos) /*!< USBH_T::HcRhPortStatus1: PRS Mask */ - -#define USBH_HcRhPortStatus_PPS_Pos (8) /*!< USBH_T::HcRhPortStatus1: PPS Position */ -#define USBH_HcRhPortStatus_PPS_Msk (0x1ul << USBH_HcRhPortStatus_PPS_Pos) /*!< USBH_T::HcRhPortStatus1: PPS Mask */ - -#define USBH_HcRhPortStatus_LSDA_Pos (9) /*!< USBH_T::HcRhPortStatus1: LSDA Position */ -#define USBH_HcRhPortStatus_LSDA_Msk (0x1ul << USBH_HcRhPortStatus_LSDA_Pos) /*!< USBH_T::HcRhPortStatus1: LSDA Mask */ - -#define USBH_HcRhPortStatus_CSC_Pos (16) /*!< USBH_T::HcRhPortStatus1: CSC Position */ -#define USBH_HcRhPortStatus_CSC_Msk (0x1ul << USBH_HcRhPortStatus_CSC_Pos) /*!< USBH_T::HcRhPortStatus1: CSC Mask */ - -#define USBH_HcRhPortStatus_PESC_Pos (17) /*!< USBH_T::HcRhPortStatus1: PESC Position */ -#define USBH_HcRhPortStatus_PESC_Msk (0x1ul << USBH_HcRhPortStatus_PESC_Pos) /*!< USBH_T::HcRhPortStatus1: PESC Mask */ - -#define USBH_HcRhPortStatus_PSSC_Pos (18) /*!< USBH_T::HcRhPortStatus1: PSSC Position */ -#define USBH_HcRhPortStatus_PSSC_Msk (0x1ul << USBH_HcRhPortStatus_PSSC_Pos) /*!< USBH_T::HcRhPortStatus1: PSSC Mask */ - -#define USBH_HcRhPortStatus_OCIC_Pos (19) /*!< USBH_T::HcRhPortStatus1: OCIC Position */ -#define USBH_HcRhPortStatus_OCIC_Msk (0x1ul << USBH_HcRhPortStatus_OCIC_Pos) /*!< USBH_T::HcRhPortStatus1: OCIC Mask */ - -#define USBH_HcRhPortStatus_PRSC_Pos (20) /*!< USBH_T::HcRhPortStatus1: PRSC Position */ -#define USBH_HcRhPortStatus_PRSC_Msk (0x1ul << USBH_HcRhPortStatus_PRSC_Pos) /*!< USBH_T::HcRhPortStatus1: PRSC Mask */ - -#define USBH_HcPhyControl_STBYEN_Pos (27) /*!< USBH_T::HcPhyControl: STBYEN Position */ -#define USBH_HcPhyControl_STBYEN_Msk (0x1ul << USBH_HcPhyControl_STBYEN_Pos) /*!< USBH_T::HcPhyControl: STBYEN Mask */ - -#define USBH_HcMiscControl_ABORT_Pos (1) /*!< USBH_T::HcMiscControl: ABORT Position */ -#define USBH_HcMiscControl_ABORT_Msk (0x1ul << USBH_HcMiscControl_ABORT_Pos) /*!< USBH_T::HcMiscControl: ABORT Mask */ - -#define USBH_HcMiscControl_OCAL_Pos (3) /*!< USBH_T::HcMiscControl: OCAL Position */ -#define USBH_HcMiscControl_OCAL_Msk (0x1ul << USBH_HcMiscControl_OCAL_Pos) /*!< USBH_T::HcMiscControl: OCAL Mask */ - -#define USBH_HcMiscControl_DPRT1_Pos (16) /*!< USBH_T::HcMiscControl: DPRT1 Position */ -#define USBH_HcMiscControl_DPRT1_Msk (0x1ul << USBH_HcMiscControl_DPRT1_Pos) /*!< USBH_T::HcMiscControl: DPRT1 Mask */ - -/**@}*/ /* USBH_CONST */ -/**@}*/ /* end of USBH register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __USBH_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uspi_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uspi_reg.h deleted file mode 100644 index d9a2d3077a3..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uspi_reg.h +++ /dev/null @@ -1,677 +0,0 @@ -/**************************************************************************//** - * @file uspi_reg.h - * @version V1.00 - * @brief USPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USPI_REG_H__ -#define __USPI_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USPI SPI Mode of USCI Controller(USPI) - Memory Mapped Structure for USPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var USPI_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var USPI_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt is disabled. - * | | |1 = The transmit start interrupt is enabled. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt is disabled. - * | | |1 = The transmit finish interrupt is enabled. - * |[3] |RXSTIEN |Receive Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt is disabled. - * | | |1 = The receive start interrupt is enabled. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt is disabled. - * | | |1 = The receive end interrupt is enabled. - * @var USPI_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fDIV_CLK. - * | | |01 = fPROT_CLK. - * | | |10 = fSCLK. - * | | |11 = fREF_CLK. - * |[4] |TMCNTEN |Time Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Time measurement counter is Disabled. - * | | |1 = Time measurement counter is Enabled. - * |[5] |TMCNTSRC |Time Measurement Counter Clock Source Selection - * | | |0 = Time measurement counter with fPROT_CLK. - * | | |1 = Time measurement counter with fDIV_CLK. - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(USPI_PROTCTL[6])) is enabled - * | | |The revised value is the average bit time between bit 5 and bit 6 - * | | |The user can use revised CLKDIV and new BRDETITV (USPI_PROTCTL[24:16]) to calculate the precise baud rate. - * @var USPI_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * @var USPI_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var USPI_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * | | |Note: In SPI protocol, we suggest this bit should be set as 0. - * @var USPI_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT0/1 pin. - * | | |0 = Data output level is not inverted. - * | | |1 = Data output level is inverted. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: The control signal has different definitions in different protocol - * | | |In SPI protocol, the control signal means slave select signal - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |... - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * @var USPI_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission - * | | |In order to avoid overwriting the transmit data, user have to check TXEMPTY (USPI_BUFSTS[8]) status before writing transmit data into this bit field. - * |[16] |PORTDIR |Port Direction Control - * | | |This bit field is only available while USCI operates in SPI protocol (FUNMODE = 0x1) with half-duplex transfer - * | | |It is used to define the direction of the data port pin - * | | |When software writes USPI_TXDAT register, the transmit data and its port direction are settled simultaneously. - * | | |0 = The data pin is configured as output mode. - * | | |1 = The data pin is configured as input mode. - * @var USPI_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * @var USPI_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6] |TXUDRIEN |Slave Transmit Under Run Interrupt Enable Bit - * | | |0 = Transmit under-run interrupt Disabled. - * | | |1 = Transmit under-run interrupt Enabled. - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Interrupt Enable Bit - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * @var USPI_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Over-run Interrupt Status - * | | |This bit indicates that a receive buffer overrun event has been detected - * | | |If RXOVIEN (USPI_BUFCTL[14]) is enabled, the corresponding interrupt request is activated - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun event has not been detected. - * | | |1 = A receive buffer overrun event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty and available for the next transmission datum. - * |[9] |TXFULL |Transmit Buffer Full Indicator - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * |[11] |TXUDRIF |Transmit Buffer Under-run Interrupt Status - * | | |This bit indicates that a transmit buffer under-run event has been detected - * | | |If enabled by TXUDRIEN (USPI_BUFCTL[6]), the corresponding interrupt request is activated - * | | |It is cleared by software writes 1 to this bit - * | | |0 = A transmit buffer under-run event has not been detected. - * | | |1 = A transmit buffer under-run event has been detected. - * @var USPI_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * | | |Notice: The I2C is not supporting PDMA function. - * @var USPI_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[1] |WKADDREN |Wake-up Address Match Enable Bit - * | | |0 = The chip is woken up according data toggle. - * | | |1 = The chip is woken up according address match. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var USPI_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var USPI_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SLAVE |Slave Mode Selection - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[1] |SLV3WIRE |Slave 3-wire Mode Selection (Slave Only) - * | | |The SPI protocol can work with 3-wire interface (without slave select signal) in Slave mode. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[2] |SS |Slave Select Control (Master Only) - * | | |If AUTOSS bit is cleared, setting this bit to 1 will set the slave select signal to active state, and setting this bit to 0 will set the slave select signal back to inactive state. - * | | |If the AUTOSS function is enabled (AUTOSS = 1), the setting value of this bit will not affect the current state of slave select signal. - * | | |Note: In SPI protocol, the internal slave select signal is active high. - * |[3] |AUTOSS |Automatic Slave Select Function Enable (Master Only) - * | | |0 = Slave select signal will be controlled by the setting value of SS (USPI_PROTCTL[2]) bit. - * | | |1 = Slave select signal will be generated automatically - * | | |The slave select signal will be asserted by the SPI controller when transmit/receive is started, and will be de-asserted after each transmit/receive is finished. - * |[7:6] |SCLKMODE |Serial Bus Clock Mode - * | | |This bit field defines the SCLK idle status, data transmit, and data receive edge. - * | | |MODE0 = The idle state of SPI clock is low level - * | | |Data is transmitted with falling edge and received with rising edge. - * | | |MODE1 = The idle state of SPI clock is low level - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |MODE2 = The idle state of SPI clock is high level - * | | |Data is transmitted with rising edge and received with falling edge. - * | | |MODE3 = The idle state of SPI clock is high level - * | | |Data is transmitted with falling edge and received with rising edge. - * |[11:8] |SUSPITV |Suspend Interval (Master Only) - * | | |This bit field provides the configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPI_CLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 ... 0.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0x1 ... 1.5 SPI_CLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE ... 14.5 SPI_CLK clock cycle. - * | | |SUSPITV = 0xF ... 15.5 SPI_CLK clock cycle. - * |[14:12] |TSMSEL |Transmit Data Mode Selection - * | | |This bit field describes how receive and transmit data is shifted in and out. - * | | |TSMSEL = 000b: Full-duplex SPI. - * | | |TSMSEL = 100b: Half-duplex SPI. - * | | |Other values are reserved. - * | | |Note: Changing the value of this bit field will produce the TXRST and RXRST to clear the TX/RX data buffer automatically. - * |[25:16] |SLVTOCNT |Slave Mode Time-out Period (Slave Only) - * | | |In Slave mode, this bit field is used for Slave time-out period - * | | |This bit field indicates how many clock periods (selected by TMCNTSRC, USPI_BRGEN[5]) between the two edges of input SCLK will assert the Slave time-out event - * | | |Writing 0x0 into this bit field will disable the Slave time-out function. - * | | |Example: Assume SLVTOCNT is 0x0A and TMCNTSRC (USPI_BRGEN[5]) is 1, it means the time-out event will occur if the state of SPI bus clock pin is not changed more than (10+1) periods of fDIV_CLK. - * |[28] |TXUDRPOL |Transmit Under-run Data Polarity (for Slave) - * | | |This bit defines the transmitting data level when no data is available for transferring. - * | | |0 = The output data level is 0 if TX under run event occurs. - * | | |1 = The output data level is 1 if TX under run event occurs. - * |[31] |PROTEN |SPI Protocol Enable Bit - * | | |0 = SPI Protocol Disabled. - * | | |1 = SPI Protocol Enabled. - * @var USPI_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSINAIEN |Slave Select Inactive Interrupt Enable Control - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to inactive. - * | | |0 = Slave select inactive interrupt generation Disabled. - * | | |1 = Slave select inactive interrupt generation Enabled. - * |[1] |SSACTIEN |Slave Select Active Interrupt Enable Control - * | | |This bit enables/disables the generation of a slave select interrupt if the slave select changes to active. - * | | |0 = Slave select active interrupt generation Disabled. - * | | |1 = Slave select active interrupt generation Enabled. - * |[2] |SLVTOIEN |Slave Time-out Interrupt Enable Control - * | | |In SPI protocol, this bit enables the interrupt generation in case of a Slave time-out event. - * | | |0 = The Slave time-out interrupt Disabled. - * | | |1 = The Slave time-out interrupt Enabled. - * |[3] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Control - * | | |If data transfer is terminated by slave time-out or slave select inactive event in Slave mode, so that the transmit/receive data bit count does not match the setting of DWIDTH (USPI_LINECTL[11:8]) - * | | |Bit count error event occurs. - * | | |0 = The Slave mode bit count error interrupt Disabled. - * | | |1 = The Slave mode bit count error interrupt Enabled. - * @var USPI_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = Transmit start event does not occur. - * | | |1 = Transmit start event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = Transmit end event does not occur. - * | | |1 = Transmit end event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = Receive start event does not occur. - * | | |1 = Receive start event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = Receive end event does not occur. - * | | |1 = Receive end event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag (for Slave Only) - * | | |0 = Slave time-out event does not occur. - * | | |1 = Slave time-out event occurs. - * | | |Note: It is cleared by software writes 1 to this bit - * |[6] |SLVBEIF |Slave Bit Count Error Interrupt Flag (for Slave Only) - * | | |0 = Slave bit count error event does not occur. - * | | |1 = Slave bit count error event occurs. - * | | |Note: It is cleared by software writes 1 to this bit. - * |[8] |SSINAIF |Slave Select Inactive Interrupt Flag (for Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to inactive - * | | |It is cleared by software writes 1 to this bit - * | | |0 = The slave select signal has not changed to inactive. - * | | |1 = The slave select signal has changed to inactive. - * | | |Note: The internal slave select signal is active high. - * |[9] |SSACTIF |Slave Select Active Interrupt Flag (for Slave Only) - * | | |This bit indicates that the internal slave select signal has changed to active - * | | |It is cleared by software writes one to this bit - * | | |0 = The slave select signal has not changed to active. - * | | |1 = The slave select signal has changed to active. - * | | |Note: The internal slave select signal is active high. - * |[16] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |This bit is only available in Slave mode - * | | |It used to monitor the current status of the input slave select signal on the bus. - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * |[17] |BUSY |Busy Status (Read Only) - * | | |0 = SPI is in idle state. - * | | |1 = SPI is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. USPI_PROTCTL[31] = 1 and the TXEMPTY = 0. - * | | |b. For SPI Master mode, the TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |d. For SPI Slave mode, the USPI_PROTCTL[31] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[18] |SLVUDR |Slave Mode Transmit Under-run Status (Read Only) - * | | |In Slave mode, if there is no available transmit data in buffer while transmit data shift out caused by input serial bus clock, this status flag will be set to 1 - * | | |This bit indicates whether the current shift-out data of word transmission is switched to TXUDRPOL (USPI_PROTCTL[28]) or not. - * | | |0 = Slave transmit under-run event does not occur. - * | | |1 = Slave transmit under-run event occurs. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __O uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __I uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[4]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} USPI_T; - -/** - @addtogroup USPI_CONST USPI Bit Field Definition - Constant Definitions for USPI Controller -@{ */ - -#define USPI_CTL_FUNMODE_Pos (0) /*!< USPI_T::CTL: FUNMODE Position */ -#define USPI_CTL_FUNMODE_Msk (0x7ul << USPI_CTL_FUNMODE_Pos) /*!< USPI_T::CTL: FUNMODE Mask */ - -#define USPI_INTEN_TXSTIEN_Pos (1) /*!< USPI_T::INTEN: TXSTIEN Position */ -#define USPI_INTEN_TXSTIEN_Msk (0x1ul << USPI_INTEN_TXSTIEN_Pos) /*!< USPI_T::INTEN: TXSTIEN Mask */ - -#define USPI_INTEN_TXENDIEN_Pos (2) /*!< USPI_T::INTEN: TXENDIEN Position */ -#define USPI_INTEN_TXENDIEN_Msk (0x1ul << USPI_INTEN_TXENDIEN_Pos) /*!< USPI_T::INTEN: TXENDIEN Mask */ - -#define USPI_INTEN_RXSTIEN_Pos (3) /*!< USPI_T::INTEN: RXSTIEN Position */ -#define USPI_INTEN_RXSTIEN_Msk (0x1ul << USPI_INTEN_RXSTIEN_Pos) /*!< USPI_T::INTEN: RXSTIEN Mask */ - -#define USPI_INTEN_RXENDIEN_Pos (4) /*!< USPI_T::INTEN: RXENDIEN Position */ -#define USPI_INTEN_RXENDIEN_Msk (0x1ul << USPI_INTEN_RXENDIEN_Pos) /*!< USPI_T::INTEN: RXENDIEN Mask */ - -#define USPI_BRGEN_RCLKSEL_Pos (0) /*!< USPI_T::BRGEN: RCLKSEL Position */ -#define USPI_BRGEN_RCLKSEL_Msk (0x1ul << USPI_BRGEN_RCLKSEL_Pos) /*!< USPI_T::BRGEN: RCLKSEL Mask */ - -#define USPI_BRGEN_PTCLKSEL_Pos (1) /*!< USPI_T::BRGEN: PTCLKSEL Position */ -#define USPI_BRGEN_PTCLKSEL_Msk (0x1ul << USPI_BRGEN_PTCLKSEL_Pos) /*!< USPI_T::BRGEN: PTCLKSEL Mask */ - -#define USPI_BRGEN_SPCLKSEL_Pos (2) /*!< USPI_T::BRGEN: SPCLKSEL Position */ -#define USPI_BRGEN_SPCLKSEL_Msk (0x3ul << USPI_BRGEN_SPCLKSEL_Pos) /*!< USPI_T::BRGEN: SPCLKSEL Mask */ - -#define USPI_BRGEN_TMCNTEN_Pos (4) /*!< USPI_T::BRGEN: TMCNTEN Position */ -#define USPI_BRGEN_TMCNTEN_Msk (0x1ul << USPI_BRGEN_TMCNTEN_Pos) /*!< USPI_T::BRGEN: TMCNTEN Mask */ - -#define USPI_BRGEN_TMCNTSRC_Pos (5) /*!< USPI_T::BRGEN: TMCNTSRC Position */ -#define USPI_BRGEN_TMCNTSRC_Msk (0x1ul << USPI_BRGEN_TMCNTSRC_Pos) /*!< USPI_T::BRGEN: TMCNTSRC Mask */ - -#define USPI_BRGEN_CLKDIV_Pos (16) /*!< USPI_T::BRGEN: CLKDIV Position */ -#define USPI_BRGEN_CLKDIV_Msk (0x3fful << USPI_BRGEN_CLKDIV_Pos) /*!< USPI_T::BRGEN: CLKDIV Mask */ - -#define USPI_DATIN0_SYNCSEL_Pos (0) /*!< USPI_T::DATIN0: SYNCSEL Position */ -#define USPI_DATIN0_SYNCSEL_Msk (0x1ul << USPI_DATIN0_SYNCSEL_Pos) /*!< USPI_T::DATIN0: SYNCSEL Mask */ - -#define USPI_DATIN0_ININV_Pos (2) /*!< USPI_T::DATIN0: ININV Position */ -#define USPI_DATIN0_ININV_Msk (0x1ul << USPI_DATIN0_ININV_Pos) /*!< USPI_T::DATIN0: ININV Mask */ - -#define USPI_CTLIN0_SYNCSEL_Pos (0) /*!< USPI_T::CTLIN0: SYNCSEL Position */ -#define USPI_CTLIN0_SYNCSEL_Msk (0x1ul << USPI_CTLIN0_SYNCSEL_Pos) /*!< USPI_T::CTLIN0: SYNCSEL Mask */ - -#define USPI_CTLIN0_ININV_Pos (2) /*!< USPI_T::CTLIN0: ININV Position */ -#define USPI_CTLIN0_ININV_Msk (0x1ul << USPI_CTLIN0_ININV_Pos) /*!< USPI_T::CTLIN0: ININV Mask */ - -#define USPI_CLKIN_SYNCSEL_Pos (0) /*!< USPI_T::CLKIN: SYNCSEL Position */ -#define USPI_CLKIN_SYNCSEL_Msk (0x1ul << USPI_CLKIN_SYNCSEL_Pos) /*!< USPI_T::CLKIN: SYNCSEL Mask */ - -#define USPI_LINECTL_LSB_Pos (0) /*!< USPI_T::LINECTL: LSB Position */ -#define USPI_LINECTL_LSB_Msk (0x1ul << USPI_LINECTL_LSB_Pos) /*!< USPI_T::LINECTL: LSB Mask */ - -#define USPI_LINECTL_DATOINV_Pos (5) /*!< USPI_T::LINECTL: DATOINV Position */ -#define USPI_LINECTL_DATOINV_Msk (0x1ul << USPI_LINECTL_DATOINV_Pos) /*!< USPI_T::LINECTL: DATOINV Mask */ - -#define USPI_LINECTL_CTLOINV_Pos (7) /*!< USPI_T::LINECTL: CTLOINV Position */ -#define USPI_LINECTL_CTLOINV_Msk (0x1ul << USPI_LINECTL_CTLOINV_Pos) /*!< USPI_T::LINECTL: CTLOINV Mask */ - -#define USPI_LINECTL_DWIDTH_Pos (8) /*!< USPI_T::LINECTL: DWIDTH Position */ -#define USPI_LINECTL_DWIDTH_Msk (0xful << USPI_LINECTL_DWIDTH_Pos) /*!< USPI_T::LINECTL: DWIDTH Mask */ - -#define USPI_TXDAT_TXDAT_Pos (0) /*!< USPI_T::TXDAT: TXDAT Position */ -#define USPI_TXDAT_TXDAT_Msk (0xfffful << USPI_TXDAT_TXDAT_Pos) /*!< USPI_T::TXDAT: TXDAT Mask */ - -#define USPI_TXDAT_PORTDIR_Pos (16) /*!< USPI_T::TXDAT: PORTDIR Position */ -#define USPI_TXDAT_PORTDIR_Msk (0x1ul << USPI_TXDAT_PORTDIR_Pos) /*!< USPI_T::TXDAT: PORTDIR Mask */ - -#define USPI_RXDAT_RXDAT_Pos (0) /*!< USPI_T::RXDAT: RXDAT Position */ -#define USPI_RXDAT_RXDAT_Msk (0xfffful << USPI_RXDAT_RXDAT_Pos) /*!< USPI_T::RXDAT: RXDAT Mask */ - -#define USPI_BUFCTL_TXUDRIEN_Pos (6) /*!< USPI_T::BUFCTL: TXUDRIEN Position */ -#define USPI_BUFCTL_TXUDRIEN_Msk (0x1ul << USPI_BUFCTL_TXUDRIEN_Pos) /*!< USPI_T::BUFCTL: TXUDRIEN Mask */ - -#define USPI_BUFCTL_TXCLR_Pos (7) /*!< USPI_T::BUFCTL: TXCLR Position */ -#define USPI_BUFCTL_TXCLR_Msk (0x1ul << USPI_BUFCTL_TXCLR_Pos) /*!< USPI_T::BUFCTL: TXCLR Mask */ - -#define USPI_BUFCTL_RXOVIEN_Pos (14) /*!< USPI_T::BUFCTL: RXOVIEN Position */ -#define USPI_BUFCTL_RXOVIEN_Msk (0x1ul << USPI_BUFCTL_RXOVIEN_Pos) /*!< USPI_T::BUFCTL: RXOVIEN Mask */ - -#define USPI_BUFCTL_RXCLR_Pos (15) /*!< USPI_T::BUFCTL: RXCLR Position */ -#define USPI_BUFCTL_RXCLR_Msk (0x1ul << USPI_BUFCTL_RXCLR_Pos) /*!< USPI_T::BUFCTL: RXCLR Mask */ - -#define USPI_BUFCTL_TXRST_Pos (16) /*!< USPI_T::BUFCTL: TXRST Position */ -#define USPI_BUFCTL_TXRST_Msk (0x1ul << USPI_BUFCTL_TXRST_Pos) /*!< USPI_T::BUFCTL: TXRST Mask */ - -#define USPI_BUFCTL_RXRST_Pos (17) /*!< USPI_T::BUFCTL: RXRST Position */ -#define USPI_BUFCTL_RXRST_Msk (0x1ul << USPI_BUFCTL_RXRST_Pos) /*!< USPI_T::BUFCTL: RXRST Mask */ - -#define USPI_BUFSTS_RXEMPTY_Pos (0) /*!< USPI_T::BUFSTS: RXEMPTY Position */ -#define USPI_BUFSTS_RXEMPTY_Msk (0x1ul << USPI_BUFSTS_RXEMPTY_Pos) /*!< USPI_T::BUFSTS: RXEMPTY Mask */ - -#define USPI_BUFSTS_RXFULL_Pos (1) /*!< USPI_T::BUFSTS: RXFULL Position */ -#define USPI_BUFSTS_RXFULL_Msk (0x1ul << USPI_BUFSTS_RXFULL_Pos) /*!< USPI_T::BUFSTS: RXFULL Mask */ - -#define USPI_BUFSTS_RXOVIF_Pos (3) /*!< USPI_T::BUFSTS: RXOVIF Position */ -#define USPI_BUFSTS_RXOVIF_Msk (0x1ul << USPI_BUFSTS_RXOVIF_Pos) /*!< USPI_T::BUFSTS: RXOVIF Mask */ - -#define USPI_BUFSTS_TXEMPTY_Pos (8) /*!< USPI_T::BUFSTS: TXEMPTY Position */ -#define USPI_BUFSTS_TXEMPTY_Msk (0x1ul << USPI_BUFSTS_TXEMPTY_Pos) /*!< USPI_T::BUFSTS: TXEMPTY Mask */ - -#define USPI_BUFSTS_TXFULL_Pos (9) /*!< USPI_T::BUFSTS: TXFULL Position */ -#define USPI_BUFSTS_TXFULL_Msk (0x1ul << USPI_BUFSTS_TXFULL_Pos) /*!< USPI_T::BUFSTS: TXFULL Mask */ - -#define USPI_BUFSTS_TXUDRIF_Pos (11) /*!< USPI_T::BUFSTS: TXUDRIF Position */ -#define USPI_BUFSTS_TXUDRIF_Msk (0x1ul << USPI_BUFSTS_TXUDRIF_Pos) /*!< USPI_T::BUFSTS: TXUDRIF Mask */ - -#define USPI_PDMACTL_PDMARST_Pos (0) /*!< USPI_T::PDMACTL: PDMARST Position */ -#define USPI_PDMACTL_PDMARST_Msk (0x1ul << USPI_PDMACTL_PDMARST_Pos) /*!< USPI_T::PDMACTL: PDMARST Mask */ - -#define USPI_PDMACTL_TXPDMAEN_Pos (1) /*!< USPI_T::PDMACTL: TXPDMAEN Position */ -#define USPI_PDMACTL_TXPDMAEN_Msk (0x1ul << USPI_PDMACTL_TXPDMAEN_Pos) /*!< USPI_T::PDMACTL: TXPDMAEN Mask */ - -#define USPI_PDMACTL_RXPDMAEN_Pos (2) /*!< USPI_T::PDMACTL: RXPDMAEN Position */ -#define USPI_PDMACTL_RXPDMAEN_Msk (0x1ul << USPI_PDMACTL_RXPDMAEN_Pos) /*!< USPI_T::PDMACTL: RXPDMAEN Mask */ - -#define USPI_PDMACTL_PDMAEN_Pos (3) /*!< USPI_T::PDMACTL: PDMAEN Position */ -#define USPI_PDMACTL_PDMAEN_Msk (0x1ul << USPI_PDMACTL_PDMAEN_Pos) /*!< USPI_T::PDMACTL: PDMAEN Mask */ - -#define USPI_WKCTL_WKEN_Pos (0) /*!< USPI_T::WKCTL: WKEN Position */ -#define USPI_WKCTL_WKEN_Msk (0x1ul << USPI_WKCTL_WKEN_Pos) /*!< USPI_T::WKCTL: WKEN Mask */ - -#define USPI_WKCTL_WKADDREN_Pos (1) /*!< USPI_T::WKCTL: WKADDREN Position */ -#define USPI_WKCTL_WKADDREN_Msk (0x1ul << USPI_WKCTL_WKADDREN_Pos) /*!< USPI_T::WKCTL: WKADDREN Mask */ - -#define USPI_WKCTL_PDBOPT_Pos (2) /*!< USPI_T::WKCTL: PDBOPT Position */ -#define USPI_WKCTL_PDBOPT_Msk (0x1ul << USPI_WKCTL_PDBOPT_Pos) /*!< USPI_T::WKCTL: PDBOPT Mask */ - -#define USPI_WKSTS_WKF_Pos (0) /*!< USPI_T::WKSTS: WKF Position */ -#define USPI_WKSTS_WKF_Msk (0x1ul << USPI_WKSTS_WKF_Pos) /*!< USPI_T::WKSTS: WKF Mask */ - -#define USPI_PROTCTL_SLAVE_Pos (0) /*!< USPI_T::PROTCTL: SLAVE Position */ -#define USPI_PROTCTL_SLAVE_Msk (0x1ul << USPI_PROTCTL_SLAVE_Pos) /*!< USPI_T::PROTCTL: SLAVE Mask */ - -#define USPI_PROTCTL_SLV3WIRE_Pos (1) /*!< USPI_T::PROTCTL: SLV3WIRE Position */ -#define USPI_PROTCTL_SLV3WIRE_Msk (0x1ul << USPI_PROTCTL_SLV3WIRE_Pos) /*!< USPI_T::PROTCTL: SLV3WIRE Mask */ - -#define USPI_PROTCTL_SS_Pos (2) /*!< USPI_T::PROTCTL: SS Position */ -#define USPI_PROTCTL_SS_Msk (0x1ul << USPI_PROTCTL_SS_Pos) /*!< USPI_T::PROTCTL: SS Mask */ - -#define USPI_PROTCTL_AUTOSS_Pos (3) /*!< USPI_T::PROTCTL: AUTOSS Position */ -#define USPI_PROTCTL_AUTOSS_Msk (0x1ul << USPI_PROTCTL_AUTOSS_Pos) /*!< USPI_T::PROTCTL: AUTOSS Mask */ - -#define USPI_PROTCTL_SCLKMODE_Pos (6) /*!< USPI_T::PROTCTL: SCLKMODE Position */ -#define USPI_PROTCTL_SCLKMODE_Msk (0x3ul << USPI_PROTCTL_SCLKMODE_Pos) /*!< USPI_T::PROTCTL: SCLKMODE Mask */ - -#define USPI_PROTCTL_SUSPITV_Pos (8) /*!< USPI_T::PROTCTL: SUSPITV Position */ -#define USPI_PROTCTL_SUSPITV_Msk (0xful << USPI_PROTCTL_SUSPITV_Pos) /*!< USPI_T::PROTCTL: SUSPITV Mask */ - -#define USPI_PROTCTL_TSMSEL_Pos (12) /*!< USPI_T::PROTCTL: TSMSEL Position */ -#define USPI_PROTCTL_TSMSEL_Msk (0x7ul << USPI_PROTCTL_TSMSEL_Pos) /*!< USPI_T::PROTCTL: TSMSEL Mask */ - -#define USPI_PROTCTL_SLVTOCNT_Pos (16) /*!< USPI_T::PROTCTL: SLVTOCNT Position */ -#define USPI_PROTCTL_SLVTOCNT_Msk (0x3fful << USPI_PROTCTL_SLVTOCNT_Pos) /*!< USPI_T::PROTCTL: SLVTOCNT Mask */ - -#define USPI_PROTCTL_TXUDRPOL_Pos (28) /*!< USPI_T::PROTCTL: TXUDRPOL Position */ -#define USPI_PROTCTL_TXUDRPOL_Msk (0x1ul << USPI_PROTCTL_TXUDRPOL_Pos) /*!< USPI_T::PROTCTL: TXUDRPOL Mask */ - -#define USPI_PROTCTL_PROTEN_Pos (31) /*!< USPI_T::PROTCTL: PROTEN Position */ -#define USPI_PROTCTL_PROTEN_Msk (0x1ul << USPI_PROTCTL_PROTEN_Pos) /*!< USPI_T::PROTCTL: PROTEN Mask */ - -#define USPI_PROTIEN_SSINAIEN_Pos (0) /*!< USPI_T::PROTIEN: SSINAIEN Position */ -#define USPI_PROTIEN_SSINAIEN_Msk (0x1ul << USPI_PROTIEN_SSINAIEN_Pos) /*!< USPI_T::PROTIEN: SSINAIEN Mask */ - -#define USPI_PROTIEN_SSACTIEN_Pos (1) /*!< USPI_T::PROTIEN: SSACTIEN Position */ -#define USPI_PROTIEN_SSACTIEN_Msk (0x1ul << USPI_PROTIEN_SSACTIEN_Pos) /*!< USPI_T::PROTIEN: SSACTIEN Mask */ - -#define USPI_PROTIEN_SLVTOIEN_Pos (2) /*!< USPI_T::PROTIEN: SLVTOIEN Position */ -#define USPI_PROTIEN_SLVTOIEN_Msk (0x1ul << USPI_PROTIEN_SLVTOIEN_Pos) /*!< USPI_T::PROTIEN: SLVTOIEN Mask */ - -#define USPI_PROTIEN_SLVBEIEN_Pos (3) /*!< USPI_T::PROTIEN: SLVBEIEN Position */ -#define USPI_PROTIEN_SLVBEIEN_Msk (0x1ul << USPI_PROTIEN_SLVBEIEN_Pos) /*!< USPI_T::PROTIEN: SLVBEIEN Mask */ - -#define USPI_PROTSTS_TXSTIF_Pos (1) /*!< USPI_T::PROTSTS: TXSTIF Position */ -#define USPI_PROTSTS_TXSTIF_Msk (0x1ul << USPI_PROTSTS_TXSTIF_Pos) /*!< USPI_T::PROTSTS: TXSTIF Mask */ - -#define USPI_PROTSTS_TXENDIF_Pos (2) /*!< USPI_T::PROTSTS: TXENDIF Position */ -#define USPI_PROTSTS_TXENDIF_Msk (0x1ul << USPI_PROTSTS_TXENDIF_Pos) /*!< USPI_T::PROTSTS: TXENDIF Mask */ - -#define USPI_PROTSTS_RXSTIF_Pos (3) /*!< USPI_T::PROTSTS: RXSTIF Position */ -#define USPI_PROTSTS_RXSTIF_Msk (0x1ul << USPI_PROTSTS_RXSTIF_Pos) /*!< USPI_T::PROTSTS: RXSTIF Mask */ - -#define USPI_PROTSTS_RXENDIF_Pos (4) /*!< USPI_T::PROTSTS: RXENDIF Position */ -#define USPI_PROTSTS_RXENDIF_Msk (0x1ul << USPI_PROTSTS_RXENDIF_Pos) /*!< USPI_T::PROTSTS: RXENDIF Mask */ - -#define USPI_PROTSTS_SLVTOIF_Pos (5) /*!< USPI_T::PROTSTS: SLVTOIF Position */ -#define USPI_PROTSTS_SLVTOIF_Msk (0x1ul << USPI_PROTSTS_SLVTOIF_Pos) /*!< USPI_T::PROTSTS: SLVTOIF Mask */ - -#define USPI_PROTSTS_SLVBEIF_Pos (6) /*!< USPI_T::PROTSTS: SLVBEIF Position */ -#define USPI_PROTSTS_SLVBEIF_Msk (0x1ul << USPI_PROTSTS_SLVBEIF_Pos) /*!< USPI_T::PROTSTS: SLVBEIF Mask */ - -#define USPI_PROTSTS_SSINAIF_Pos (8) /*!< USPI_T::PROTSTS: SSINAIF Position */ -#define USPI_PROTSTS_SSINAIF_Msk (0x1ul << USPI_PROTSTS_SSINAIF_Pos) /*!< USPI_T::PROTSTS: SSINAIF Mask */ - -#define USPI_PROTSTS_SSACTIF_Pos (9) /*!< USPI_T::PROTSTS: SSACTIF Position */ -#define USPI_PROTSTS_SSACTIF_Msk (0x1ul << USPI_PROTSTS_SSACTIF_Pos) /*!< USPI_T::PROTSTS: SSACTIF Mask */ - -#define USPI_PROTSTS_SSLINE_Pos (16) /*!< USPI_T::PROTSTS: SSLINE Position */ -#define USPI_PROTSTS_SSLINE_Msk (0x1ul << USPI_PROTSTS_SSLINE_Pos) /*!< USPI_T::PROTSTS: SSLINE Mask */ - -#define USPI_PROTSTS_BUSY_Pos (17) /*!< USPI_T::PROTSTS: BUSY Position */ -#define USPI_PROTSTS_BUSY_Msk (0x1ul << USPI_PROTSTS_BUSY_Pos) /*!< USPI_T::PROTSTS: BUSY Mask */ - -#define USPI_PROTSTS_SLVUDR_Pos (18) /*!< USPI_T::PROTSTS: SLVUDR Position */ -#define USPI_PROTSTS_SLVUDR_Msk (0x1ul << USPI_PROTSTS_SLVUDR_Pos) /*!< USPI_T::PROTSTS: SLVUDR Mask */ - -/**@}*/ /* USPI_CONST */ -/**@}*/ /* end of USPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __USPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uuart_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uuart_reg.h deleted file mode 100644 index 3ebce1d6f31..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/uuart_reg.h +++ /dev/null @@ -1,679 +0,0 @@ -/**************************************************************************//** - * @file uuart_reg.h - * @version V1.00 - * @brief UUART register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UUART_REG_H__ -#define __UUART_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UUART UART Mode of USCI Controller(UUART) - Memory Mapped Structure for UUART Controller -@{ */ - -typedef struct -{ - - - /** - * @var UUART_T::CTL - * Offset: 0x00 USCI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNMODE |Function Mode - * | | |This bit field selects the protocol for this USCI controller - * | | |Selecting a protocol that is not available or a reserved combination disables the USCI - * | | |When switching between two protocols, the USCI has to be disabled before selecting a new protocol - * | | |Simultaneously, the USCI will be reset when user write 000 to FUNMODE. - * | | |000 = The USCI is disabled. All protocol related state machines are set to idle state. - * | | |001 = The SPI protocol is selected. - * | | |010 = The UART protocol is selected. - * | | |100 = The I2C protocol is selected. - * | | |Note: Other bit combinations are reserved. - * @var UUART_T::INTEN - * Offset: 0x04 USCI Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIEN |Transmit Start Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit start event. - * | | |0 = The transmit start interrupt is disabled. - * | | |1 = The transmit start interrupt is enabled. - * |[2] |TXENDIEN |Transmit End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a transmit finish event. - * | | |0 = The transmit finish interrupt is disabled. - * | | |1 = The transmit finish interrupt is enabled. - * |[3] |RXSTIEN |Receive Start Interrupt Enable BIt - * | | |This bit enables the interrupt generation in case of a receive start event. - * | | |0 = The receive start interrupt is disabled. - * | | |1 = The receive start interrupt is enabled. - * |[4] |RXENDIEN |Receive End Interrupt Enable Bit - * | | |This bit enables the interrupt generation in case of a receive finish event. - * | | |0 = The receive end interrupt is disabled. - * | | |1 = The receive end interrupt is enabled. - * @var UUART_T::BRGEN - * Offset: 0x08 USCI Baud Rate Generator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RCLKSEL |Reference Clock Source Selection - * | | |This bit selects the source signal of reference clock (fREF_CLK). - * | | |0 = Peripheral device clock fPCLK. - * | | |1 = Reserved. - * |[1] |PTCLKSEL |Protocol Clock Source Selection - * | | |This bit selects the source signal of protocol clock (fPROT_CLK). - * | | |0 = Reference clock fREF_CLK. - * | | |1 = fREF_CLK2 (its frequency is half of fREF_CLK). - * |[3:2] |SPCLKSEL |Sample Clock Source Selection - * | | |This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. - * | | |00 = fSAMP_CLK = fDIV_CLK. - * | | |01 = fSAMP_CLK = fPROT_CLK. - * | | |10 = fSAMP_CLK = fSCLK. - * | | |11 = fSAMP_CLK = fREF_CLK. - * |[4] |TMCNTEN |Timing Measurement Counter Enable Bit - * | | |This bit enables the 10-bit timing measurement counter. - * | | |0 = Timing measurement counter is Disabled. - * | | |1 = Timing measurement counter is Enabled. - * |[5] |TMCNTSRC |Timing Measurement Counter Clock Source Selection - * | | |0 = Timing measurement counter with fPROT_CLK. - * | | |1 = Timing measurement counter with fDIV_CLK. - * |[9:8] |PDSCNT |Pre-divider for Sample Counter - * | | |This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK - * | | |The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). - * |[14:10] |DSCNT |Denominator for Sample Counter - * | | |This bit field defines the divide ratio of the sample clock fSAMP_CLK. - * | | |The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). - * | | |Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value - * |[25:16] |CLKDIV |Clock Divider - * | | |This bit field defines the ratio between the protocol clock frequency fPROT_CLK and - * | | |the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). - * | | |Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 - * | | |when the auto baud rate function (ABREN(USCI_PROTCTL[6])) is enabled - * | | |The revised value is the average bit time between bit 5 and bit 6 - * | | |The user can use revised CLKDIV and new BRDETITV (USCI_PROTCTL[24:16]) to calculate the precise baud rate. - * @var UUART_T::DATIN0 - * Offset: 0x10 USCI Input Data Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Signal Synchronization Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or - * | | |the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * |[4:3] |EDGEDET |Input Signal Edge Detection Mode - * | | |This bit field selects which edge actives the trigger event of input data signal. - * | | |00 = The trigger event activation is disabled. - * | | |01 = A rising edge activates the trigger event of input data signal. - * | | |10 = A falling edge activates the trigger event of input data signal. - * | | |11 = Both edges activate the trigger event of input data signal. - * | | |Note: In UART function mode, it is suggested to set this bit field as 10. - * @var UUART_T::CTLIN0 - * Offset: 0x20 USCI Input Control Signal Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal (with optionally inverted) or - * | | |the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * |[2] |ININV |Input Signal Inverse Selection - * | | |This bit defines the inverter enable of the input asynchronous signal. - * | | |0 = The un-synchronized input signal will not be inverted. - * | | |1 = The un-synchronized input signal will be inverted. - * @var UUART_T::CLKIN - * Offset: 0x28 USCI Input Clock Signal Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SYNCSEL |Input Synchronization Signal Selection - * | | |This bit selects if the un-synchronized input signal or - * | | |the synchronized (and optionally filtered) signal can be used as input for the data shift unit. - * | | |0 = The un-synchronized signal can be taken as input for the data shift unit. - * | | |1 = The synchronized signal can be taken as input for the data shift unit. - * @var UUART_T::LINECTL - * Offset: 0x2C USCI Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LSB |LSB First Transmission Selection - * | | |0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. - * |[5] |DATOINV |Data Output Inverse Selection - * | | |This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT1 pin. - * | | |0 = The value of USCIx_DAT1 is equal to the data shift register. - * | | |1 = The value of USCIx_DAT1 is the inversion of data shift register. - * |[7] |CTLOINV |Control Signal Output Inverse Selection - * | | |This bit defines the relation between the internal control signal and the output control signal. - * | | |0 = No effect. - * | | |1 = The control signal will be inverted before its output. - * | | |Note: In UART protocol, the control signal means nRTS signal. - * |[11:8] |DWIDTH |Word Length of Transmission - * | | |This bit field defines the data word length (amount of bits) for reception and transmission - * | | |The data word is always right-aligned in the data buffer - * | | |USCI support word length from 4 to 16 bits. - * | | |0x0: The data word contains 16 bits located at bit positions [15:0]. - * | | |0x1: Reserved. - * | | |0x2: Reserved. - * | | |0x3: Reserved. - * | | |0x4: The data word contains 4 bits located at bit positions [3:0]. - * | | |0x5: The data word contains 5 bits located at bit positions [4:0]. - * | | |.. - * | | |0xF: The data word contains 15 bits located at bit positions [14:0]. - * | | |Note: In UART protocol, the length can be configured as 6~13 bits. - * @var UUART_T::TXDAT - * Offset: 0x30 USCI Transmit Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXDAT |Transmit Data - * | | |Software can use this bit field to write 16-bit transmit data for transmission. - * @var UUART_T::RXDAT - * Offset: 0x34 USCI Receive Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXDAT |Received Data - * | | |This bit field monitors the received data which stored in receive data buffer. - * | | |Note: RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (USCI_PROTSTS[7:5]). - * @var UUART_T::BUFCTL - * Offset: 0x38 USCI Transmit/Receive Buffer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7] |TXCLR |Clear Transmit Buffer - * | | |0 = No effect. - * | | |1 = The transmit buffer is cleared (filling level is cleared and output pointer is set to input pointer value) - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[14] |RXOVIEN |Receive Buffer Overrun Error Interrupt Enable Control - * | | |0 = Receive overrun interrupt Disabled. - * | | |1 = Receive overrun interrupt Enabled. - * |[15] |RXCLR |Clear Receive Buffer - * | | |0 = No effect. - * | | |1 = The receive buffer is cleared (filling level is cleared and output pointer is set to input pointer value) - * | | |Should only be used while the buffer is not taking part in data traffic. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[16] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. - * | | |Note: It is cleared automatically after one PCLK cycle. - * |[17] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. - * | | |Note 1: It is cleared automatically after one PCLK cycle. - * | | |Note 2: It is suggest to check the RXBUSY (USCI_PROTSTS[10]) before this bit will be set to 1. - * @var UUART_T::BUFSTS - * Offset: 0x3C USCI Transmit/Receive Buffer Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXEMPTY |Receive Buffer Empty Indicator - * | | |0 = Receive buffer is not empty. - * | | |1 = Receive buffer is empty. - * |[1] |RXFULL |Receive Buffer Full Indicator - * | | |0 = Receive buffer is not full. - * | | |1 = Receive buffer is full. - * |[3] |RXOVIF |Receive Buffer Over-run Error Interrupt Status - * | | |This bit indicates that a receive buffer overrun error event has been detected - * | | |If RXOVIEN (USCI_BUFCTL[14]) is enabled, the corresponding interrupt request is activated - * | | |It is cleared by software writes 1 to this bit. - * | | |0 = A receive buffer overrun error event has not been detected. - * | | |1 = A receive buffer overrun error event has been detected. - * |[8] |TXEMPTY |Transmit Buffer Empty Indicator - * | | |0 = Transmit buffer is not empty. - * | | |1 = Transmit buffer is empty. - * |[9] |TXFULL |Transmit Buffer Full Indicator - * | | |0 = Transmit buffer is not full. - * | | |1 = Transmit buffer is full. - * @var UUART_T::PDMACTL - * Offset: 0x40 USCI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. - * |[1] |TXPDMAEN |PDMA Transmit Channel Available - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * |[2] |RXPDMAEN |PDMA Receive Channel Available - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[3] |PDMAEN |PDMA Mode Enable Bit - * | | |0 = PDMA function Disabled. - * | | |1 = PDMA function Enabled. - * @var UUART_T::WKCTL - * Offset: 0x54 USCI Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKEN |Wake-up Enable Bit - * | | |0 = Wake-up function Disabled. - * | | |1 = Wake-up function Enabled. - * |[2] |PDBOPT |Power Down Blocking Option - * | | |0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. - * | | |1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. - * @var UUART_T::WKSTS - * Offset: 0x58 USCI Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKF |Wake-up Flag - * | | |When chip is woken up from Power-down mode, this bit is set to 1 - * | | |Software can write 1 to clear this bit. - * @var UUART_T::PROTCTL - * Offset: 0x5C USCI Protocol Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STOPB |Stop Bits - * | | |This bit defines the number of stop bits in an UART frame. - * | | |0 = The number of stop bits is 1. - * | | |1 = The number of stop bits is 2. - * |[1] |PARITYEN |Parity Enable Bit - * | | |This bit defines the parity bit is enabled in an UART frame. - * | | |0 = The parity bit Disabled. - * | | |1 = The parity bit Enabled. - * |[2] |EVENPARITY|Even Parity Enable Bit - * | | |0 = Odd number of logic 1's is transmitted and checked in each word. - * | | |1 = Even number of logic 1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PARITYEN is set. - * |[3] |RTSAUTOEN |nRTS Auto-flow Control Enable Bit - * | | |When nRTS auto-flow is enabled, if the receiver buffer is full (RXFULL (USCI_BUFSTS[1] = 1'b1)), the UART will de-assert nRTS signal. - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: This bit has effect only when the RTSAUDIREN is not set. - * |[4] |CTSAUTOEN |nCTS Auto-flow Control Enable Bit - * | | |When nCTS auto-flow is enabled, the UART will send data to external device when nCTS input assert (UART will not send data to device if nCTS input is dis-asserted). - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * |[5] |RTSAUDIREN|nRTS Auto Direction Enable Bit - * | | |When nRTS auto direction is enabled, if the transmitted bytes in the TX buffer is empty, the UART asserted nRTS signal automatically. - * | | |0 = nRTS auto direction control Disabled. - * | | |1 = nRTS auto direction control Enabled. - * | | |Note 1: This bit is used for nRTS auto direction control for RS485. - * | | |Note 2: This bit has effect only when the RTSAUTOEN is not set. - * |[6] |ABREN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note: When the auto - baud rate detect operation finishes, hardware will clear this bit - * | | |The associated interrupt ABRDETIF (USCI_PROTST[9]) will be generated (If ARBIEN (USCI_PROTIEN [1]) is enabled). - * |[9] |DATWKEN |Data Wake-up Mode Enable Bit - * | | |0 = Data wake-up mode Disabled. - * | | |1 = Data wake-up mode Enabled. - * |[10] |CTSWKEN |nCTS Wake-up Mode Enable Bit - * | | |0 = nCTS wake-up mode Disabled. - * | | |1 = nCTS wake-up mode Enabled. - * |[14:11] |WAKECNT |Wake-up Counter - * | | |These bits field indicate how many clock cycle selected by fPDS_CNT do the slave can get the 1st bit (start bit) when the device is wake-up from Power-down mode. - * |[24:16] |BRDETITV |Baud Rate Detection Interval - * | | |This bit fields indicate how many clock cycle selected by TMCNTSRC (USCI_BRGEN [5]) does the slave calculates the baud rate in one bits - * | | |The order of the bus shall be 1 and 0 step by step (e.g. the input data pattern shall be 0x55) - * | | |The user can read the value to know the current input baud rate of the bus whenever the ABRDETIF (USCI_PROTCTL[9]) is set. - * | | |Note: This bit can be cleared to 0 by software writing '0' to the BRDETITV. - * |[26] |STICKEN |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: Refer to RS-485 Support section for detail information. - * |[29] |BCEN |Transmit Break Control Enable Bit - * | | |0 = Transmit Break Control Disabled. - * | | |1 = Transmit Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the serial data output (TX) is forced to the Spacing State (logic 0) - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[31] |PROTEN |UART Protocol Enable Bit - * | | |0 = UART Protocol Disabled. - * | | |1 = UART Protocol Enabled. - * @var UUART_T::PROTIEN - * Offset: 0x60 USCI Protocol Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive line status interrupt Disabled. - * | | |1 = Receive line status interrupt Enabled. - * | | |Note: USCI_PROTSTS[7:5] indicates the current interrupt event for receive line status interrupt. - * @var UUART_T::PROTSTS - * Offset: 0x64 USCI Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXSTIF |Transmit Start Interrupt Flag - * | | |0 = A transmit start interrupt status has not occurred. - * | | |1 = A transmit start interrupt status has occurred. - * | | |Note 1: It is cleared by software writing one into this bit. - * | | |Note 2: Used for user to load next transmit data when there is no data in transmit buffer. - * |[2] |TXENDIF |Transmit End Interrupt Flag - * | | |0 = A transmit end interrupt status has not occurred. - * | | |1 = A transmit end interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[3] |RXSTIF |Receive Start Interrupt Flag - * | | |0 = A receive start interrupt status has not occurred. - * | | |1 = A receive start interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[4] |RXENDIF |Receive End Interrupt Flag - * | | |0 = A receive finish interrupt status has not occurred. - * | | |1 = A receive finish interrupt status has occurred. - * | | |Note: It is cleared by software writing one into this bit. - * |[5] |PARITYERR |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'parity bit'. - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. - * |[6] |FRMERR |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'stop bit' - * | | |(that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. - * |[7] |BREAK |Break Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the 'spacing state' - * | | |(logic 0) for longer than a full word transmission time (that is, the total time of start bit + data bits + parity + stop bits). - * | | |0 = No Break is generated. - * | | |1 = Break is generated in the receiver bus. - * | | |Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. - * |[9] |ABRDETIF |Auto-baud Rate Interrupt Flag - * | | |This bit is set when auto-baud rate detection is done among the falling edge of the input data - * | | |If the ABRIEN (USCI_PROTCTL[6]) is set, the auto-baud rate interrupt will be generated - * | | |This bit can be set 4 times when the input data pattern is 0x55 and it is cleared before the next falling edge of the input bus. - * | | |0 = Auto-baud rate detect function is not done. - * | | |1 = One Bit auto-baud rate detect function is done. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[10] |RXBUSY |RX Bus Status Flag (Read Only) - * | | |This bit indicates the busy status of the receiver. - * | | |0 = The receiver is Idle. - * | | |1 = The receiver is BUSY. - * |[11] |ABERRSTS |Auto-baud Rate Error Status - * | | |This bit is set when auto-baud rate detection counter overrun - * | | |When the auto-baud rate counter overrun, the user shall revise the CLKDIV (USCI_BRGEN[25:16]) value and - * | | |enable ABREN (USCI_PROTCTL[6]) to detect the correct baud rate again. - * | | |0 = Auto-baud rate detect counter is not overrun. - * | | |1 = Auto-baud rate detect counter is overrun. - * | | |Note 1: This bit is set at the same time of ABRDETIF. - * | | |Note 2: This bit can be cleared by writing '1' to ABRDETIF or ABERRSTS. - * |[16] |CTSSYNCLV |nCTS Synchronized Level Status (Read Only) - * | | |This bit used to indicate the current status of the internal synchronized nCTS signal. - * | | |0 = The internal synchronized nCTS is low. - * | | |1 = The internal synchronized nCTS is high. - * |[17] |CTSLV |nCTS Pin Status (Read Only) - * | | |This bit used to monitor the current status of nCTS pin input. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - */ - __IO uint32_t CTL; /*!< [0x0000] USCI Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] USCI Interrupt Enable Register */ - __IO uint32_t BRGEN; /*!< [0x0008] USCI Baud Rate Generator Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DATIN0; /*!< [0x0010] USCI Input Data Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTLIN0; /*!< [0x0020] USCI Input Control Signal Configuration Register 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CLKIN; /*!< [0x0028] USCI Input Clock Signal Configuration Register */ - __IO uint32_t LINECTL; /*!< [0x002c] USCI Line Control Register */ - __IO uint32_t TXDAT; /*!< [0x0030] USCI Transmit Data Register */ - __IO uint32_t RXDAT; /*!< [0x0034] USCI Receive Data Register */ - __IO uint32_t BUFCTL; /*!< [0x0038] USCI Transmit/Receive Buffer Control Register */ - __IO uint32_t BUFSTS; /*!< [0x003c] USCI Transmit/Receive Buffer Status Register */ - __IO uint32_t PDMACTL; /*!< [0x0040] USCI PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[4]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WKCTL; /*!< [0x0054] USCI Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0058] USCI Wake-up Status Register */ - __IO uint32_t PROTCTL; /*!< [0x005c] USCI Protocol Control Register */ - __IO uint32_t PROTIEN; /*!< [0x0060] USCI Protocol Interrupt Enable Register */ - __IO uint32_t PROTSTS; /*!< [0x0064] USCI Protocol Status Register */ - -} UUART_T; - -/** - @addtogroup UUART_CONST UUART Bit Field Definition - Constant Definitions for UUART Controller -@{ */ - -#define UUART_CTL_FUNMODE_Pos (0) /*!< UUART_T::CTL: FUNMODE Position */ -#define UUART_CTL_FUNMODE_Msk (0x7ul << UUART_CTL_FUNMODE_Pos) /*!< UUART_T::CTL: FUNMODE Mask */ - -#define UUART_INTEN_TXSTIEN_Pos (1) /*!< UUART_T::INTEN: TXSTIEN Position */ -#define UUART_INTEN_TXSTIEN_Msk (0x1ul << UUART_INTEN_TXSTIEN_Pos) /*!< UUART_T::INTEN: TXSTIEN Mask */ - -#define UUART_INTEN_TXENDIEN_Pos (2) /*!< UUART_T::INTEN: TXENDIEN Position */ -#define UUART_INTEN_TXENDIEN_Msk (0x1ul << UUART_INTEN_TXENDIEN_Pos) /*!< UUART_T::INTEN: TXENDIEN Mask */ - -#define UUART_INTEN_RXSTIEN_Pos (3) /*!< UUART_T::INTEN: RXSTIEN Position */ -#define UUART_INTEN_RXSTIEN_Msk (0x1ul << UUART_INTEN_RXSTIEN_Pos) /*!< UUART_T::INTEN: RXSTIEN Mask */ - -#define UUART_INTEN_RXENDIEN_Pos (4) /*!< UUART_T::INTEN: RXENDIEN Position */ -#define UUART_INTEN_RXENDIEN_Msk (0x1ul << UUART_INTEN_RXENDIEN_Pos) /*!< UUART_T::INTEN: RXENDIEN Mask */ - -#define UUART_BRGEN_RCLKSEL_Pos (0) /*!< UUART_T::BRGEN: RCLKSEL Position */ -#define UUART_BRGEN_RCLKSEL_Msk (0x1ul << UUART_BRGEN_RCLKSEL_Pos) /*!< UUART_T::BRGEN: RCLKSEL Mask */ - -#define UUART_BRGEN_PTCLKSEL_Pos (1) /*!< UUART_T::BRGEN: PTCLKSEL Position */ -#define UUART_BRGEN_PTCLKSEL_Msk (0x1ul << UUART_BRGEN_PTCLKSEL_Pos) /*!< UUART_T::BRGEN: PTCLKSEL Mask */ - -#define UUART_BRGEN_SPCLKSEL_Pos (2) /*!< UUART_T::BRGEN: SPCLKSEL Position */ -#define UUART_BRGEN_SPCLKSEL_Msk (0x3ul << UUART_BRGEN_SPCLKSEL_Pos) /*!< UUART_T::BRGEN: SPCLKSEL Mask */ - -#define UUART_BRGEN_TMCNTEN_Pos (4) /*!< UUART_T::BRGEN: TMCNTEN Position */ -#define UUART_BRGEN_TMCNTEN_Msk (0x1ul << UUART_BRGEN_TMCNTEN_Pos) /*!< UUART_T::BRGEN: TMCNTEN Mask */ - -#define UUART_BRGEN_TMCNTSRC_Pos (5) /*!< UUART_T::BRGEN: TMCNTSRC Position */ -#define UUART_BRGEN_TMCNTSRC_Msk (0x1ul << UUART_BRGEN_TMCNTSRC_Pos) /*!< UUART_T::BRGEN: TMCNTSRC Mask */ - -#define UUART_BRGEN_PDSCNT_Pos (8) /*!< UUART_T::BRGEN: PDSCNT Position */ -#define UUART_BRGEN_PDSCNT_Msk (0x3ul << UUART_BRGEN_PDSCNT_Pos) /*!< UUART_T::BRGEN: PDSCNT Mask */ - -#define UUART_BRGEN_DSCNT_Pos (10) /*!< UUART_T::BRGEN: DSCNT Position */ -#define UUART_BRGEN_DSCNT_Msk (0x1ful << UUART_BRGEN_DSCNT_Pos) /*!< UUART_T::BRGEN: DSCNT Mask */ - -#define UUART_BRGEN_CLKDIV_Pos (16) /*!< UUART_T::BRGEN: CLKDIV Position */ -#define UUART_BRGEN_CLKDIV_Msk (0x3fful << UUART_BRGEN_CLKDIV_Pos) /*!< UUART_T::BRGEN: CLKDIV Mask */ - -#define UUART_DATIN0_SYNCSEL_Pos (0) /*!< UUART_T::DATIN0: SYNCSEL Position */ -#define UUART_DATIN0_SYNCSEL_Msk (0x1ul << UUART_DATIN0_SYNCSEL_Pos) /*!< UUART_T::DATIN0: SYNCSEL Mask */ - -#define UUART_DATIN0_ININV_Pos (2) /*!< UUART_T::DATIN0: ININV Position */ -#define UUART_DATIN0_ININV_Msk (0x1ul << UUART_DATIN0_ININV_Pos) /*!< UUART_T::DATIN0: ININV Mask */ - -#define UUART_DATIN0_EDGEDET_Pos (3) /*!< UUART_T::DATIN0: EDGEDET Position */ -#define UUART_DATIN0_EDGEDET_Msk (0x3ul << UUART_DATIN0_EDGEDET_Pos) /*!< UUART_T::DATIN0: EDGEDET Mask */ - -#define UUART_CTLIN0_SYNCSEL_Pos (0) /*!< UUART_T::CTLIN0: SYNCSEL Position */ -#define UUART_CTLIN0_SYNCSEL_Msk (0x1ul << UUART_CTLIN0_SYNCSEL_Pos) /*!< UUART_T::CTLIN0: SYNCSEL Mask */ - -#define UUART_CTLIN0_ININV_Pos (2) /*!< UUART_T::CTLIN0: ININV Position */ -#define UUART_CTLIN0_ININV_Msk (0x1ul << UUART_CTLIN0_ININV_Pos) /*!< UUART_T::CTLIN0: ININV Mask */ - -#define UUART_CLKIN_SYNCSEL_Pos (0) /*!< UUART_T::CLKIN: SYNCSEL Position */ -#define UUART_CLKIN_SYNCSEL_Msk (0x1ul << UUART_CLKIN_SYNCSEL_Pos) /*!< UUART_T::CLKIN: SYNCSEL Mask */ - -#define UUART_LINECTL_LSB_Pos (0) /*!< UUART_T::LINECTL: LSB Position */ -#define UUART_LINECTL_LSB_Msk (0x1ul << UUART_LINECTL_LSB_Pos) /*!< UUART_T::LINECTL: LSB Mask */ - -#define UUART_LINECTL_DATOINV_Pos (5) /*!< UUART_T::LINECTL: DATOINV Position */ -#define UUART_LINECTL_DATOINV_Msk (0x1ul << UUART_LINECTL_DATOINV_Pos) /*!< UUART_T::LINECTL: DATOINV Mask */ - -#define UUART_LINECTL_CTLOINV_Pos (7) /*!< UUART_T::LINECTL: CTLOINV Position */ -#define UUART_LINECTL_CTLOINV_Msk (0x1ul << UUART_LINECTL_CTLOINV_Pos) /*!< UUART_T::LINECTL: CTLOINV Mask */ - -#define UUART_LINECTL_DWIDTH_Pos (8) /*!< UUART_T::LINECTL: DWIDTH Position */ -#define UUART_LINECTL_DWIDTH_Msk (0xful << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_T::LINECTL: DWIDTH Mask */ - -#define UUART_TXDAT_TXDAT_Pos (0) /*!< UUART_T::TXDAT: TXDAT Position */ -#define UUART_TXDAT_TXDAT_Msk (0xfffful << UUART_TXDAT_TXDAT_Pos) /*!< UUART_T::TXDAT: TXDAT Mask */ - -#define UUART_RXDAT_RXDAT_Pos (0) /*!< UUART_T::RXDAT: RXDAT Position */ -#define UUART_RXDAT_RXDAT_Msk (0xfffful << UUART_RXDAT_RXDAT_Pos) /*!< UUART_T::RXDAT: RXDAT Mask */ - -#define UUART_BUFCTL_TXCLR_Pos (7) /*!< UUART_T::BUFCTL: TXCLR Position */ -#define UUART_BUFCTL_TXCLR_Msk (0x1ul << UUART_BUFCTL_TXCLR_Pos) /*!< UUART_T::BUFCTL: TXCLR Mask */ - -#define UUART_BUFCTL_RXOVIEN_Pos (14) /*!< UUART_T::BUFCTL: RXOVIEN Position */ -#define UUART_BUFCTL_RXOVIEN_Msk (0x1ul << UUART_BUFCTL_RXOVIEN_Pos) /*!< UUART_T::BUFCTL: RXOVIEN Mask */ - -#define UUART_BUFCTL_RXCLR_Pos (15) /*!< UUART_T::BUFCTL: RXCLR Position */ -#define UUART_BUFCTL_RXCLR_Msk (0x1ul << UUART_BUFCTL_RXCLR_Pos) /*!< UUART_T::BUFCTL: RXCLR Mask */ - -#define UUART_BUFCTL_TXRST_Pos (16) /*!< UUART_T::BUFCTL: TXRST Position */ -#define UUART_BUFCTL_TXRST_Msk (0x1ul << UUART_BUFCTL_TXRST_Pos) /*!< UUART_T::BUFCTL: TXRST Mask */ - -#define UUART_BUFCTL_RXRST_Pos (17) /*!< UUART_T::BUFCTL: RXRST Position */ -#define UUART_BUFCTL_RXRST_Msk (0x1ul << UUART_BUFCTL_RXRST_Pos) /*!< UUART_T::BUFCTL: RXRST Mask */ - -#define UUART_BUFSTS_RXEMPTY_Pos (0) /*!< UUART_T::BUFSTS: RXEMPTY Position */ -#define UUART_BUFSTS_RXEMPTY_Msk (0x1ul << UUART_BUFSTS_RXEMPTY_Pos) /*!< UUART_T::BUFSTS: RXEMPTY Mask */ - -#define UUART_BUFSTS_RXFULL_Pos (1) /*!< UUART_T::BUFSTS: RXFULL Position */ -#define UUART_BUFSTS_RXFULL_Msk (0x1ul << UUART_BUFSTS_RXFULL_Pos) /*!< UUART_T::BUFSTS: RXFULL Mask */ - -#define UUART_BUFSTS_RXOVIF_Pos (3) /*!< UUART_T::BUFSTS: RXOVIF Position */ -#define UUART_BUFSTS_RXOVIF_Msk (0x1ul << UUART_BUFSTS_RXOVIF_Pos) /*!< UUART_T::BUFSTS: RXOVIF Mask */ - -#define UUART_BUFSTS_TXEMPTY_Pos (8) /*!< UUART_T::BUFSTS: TXEMPTY Position */ -#define UUART_BUFSTS_TXEMPTY_Msk (0x1ul << UUART_BUFSTS_TXEMPTY_Pos) /*!< UUART_T::BUFSTS: TXEMPTY Mask */ - -#define UUART_BUFSTS_TXFULL_Pos (9) /*!< UUART_T::BUFSTS: TXFULL Position */ -#define UUART_BUFSTS_TXFULL_Msk (0x1ul << UUART_BUFSTS_TXFULL_Pos) /*!< UUART_T::BUFSTS: TXFULL Mask */ - -#define UUART_PDMACTL_PDMARST_Pos (0) /*!< UUART_T::PDMACTL: PDMARST Position */ -#define UUART_PDMACTL_PDMARST_Msk (0x1ul << UUART_PDMACTL_PDMARST_Pos) /*!< UUART_T::PDMACTL: PDMARST Mask */ - -#define UUART_PDMACTL_TXPDMAEN_Pos (1) /*!< UUART_T::PDMACTL: TXPDMAEN Position */ -#define UUART_PDMACTL_TXPDMAEN_Msk (0x1ul << UUART_PDMACTL_TXPDMAEN_Pos) /*!< UUART_T::PDMACTL: TXPDMAEN Mask */ - -#define UUART_PDMACTL_RXPDMAEN_Pos (2) /*!< UUART_T::PDMACTL: RXPDMAEN Position */ -#define UUART_PDMACTL_RXPDMAEN_Msk (0x1ul << UUART_PDMACTL_RXPDMAEN_Pos) /*!< UUART_T::PDMACTL: RXPDMAEN Mask */ - -#define UUART_PDMACTL_PDMAEN_Pos (3) /*!< UUART_T::PDMACTL: PDMAEN Position */ -#define UUART_PDMACTL_PDMAEN_Msk (0x1ul << UUART_PDMACTL_PDMAEN_Pos) /*!< UUART_T::PDMACTL: PDMAEN Mask */ - -#define UUART_WKCTL_WKEN_Pos (0) /*!< UUART_T::WKCTL: WKEN Position */ -#define UUART_WKCTL_WKEN_Msk (0x1ul << UUART_WKCTL_WKEN_Pos) /*!< UUART_T::WKCTL: WKEN Mask */ - -#define UUART_WKCTL_PDBOPT_Pos (2) /*!< UUART_T::WKCTL: PDBOPT Position */ -#define UUART_WKCTL_PDBOPT_Msk (0x1ul << UUART_WKCTL_PDBOPT_Pos) /*!< UUART_T::WKCTL: PDBOPT Mask */ - -#define UUART_WKSTS_WKF_Pos (0) /*!< UUART_T::WKSTS: WKF Position */ -#define UUART_WKSTS_WKF_Msk (0x1ul << UUART_WKSTS_WKF_Pos) /*!< UUART_T::WKSTS: WKF Mask */ - -#define UUART_PROTCTL_STOPB_Pos (0) /*!< UUART_T::PROTCTL: STOPB Position */ -#define UUART_PROTCTL_STOPB_Msk (0x1ul << UUART_PROTCTL_STOPB_Pos) /*!< UUART_T::PROTCTL: STOPB Mask */ - -#define UUART_PROTCTL_PARITYEN_Pos (1) /*!< UUART_T::PROTCTL: PARITYEN Position */ -#define UUART_PROTCTL_PARITYEN_Msk (0x1ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_T::PROTCTL: PARITYEN Mask */ - -#define UUART_PROTCTL_EVENPARITY_Pos (2) /*!< UUART_T::PROTCTL: EVENPARITY Position */ -#define UUART_PROTCTL_EVENPARITY_Msk (0x1ul << UUART_PROTCTL_EVENPARITY_Pos) /*!< UUART_T::PROTCTL: EVENPARITY Mask */ - -#define UUART_PROTCTL_RTSAUTOEN_Pos (3) /*!< UUART_T::PROTCTL: RTSAUTOEN Position */ -#define UUART_PROTCTL_RTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_RTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: RTSAUTOEN Mask */ - -#define UUART_PROTCTL_CTSAUTOEN_Pos (4) /*!< UUART_T::PROTCTL: CTSAUTOEN Position */ -#define UUART_PROTCTL_CTSAUTOEN_Msk (0x1ul << UUART_PROTCTL_CTSAUTOEN_Pos) /*!< UUART_T::PROTCTL: CTSAUTOEN Mask */ - -#define UUART_PROTCTL_RTSAUDIREN_Pos (5) /*!< UUART_T::PROTCTL: RTSAUDIREN Position */ -#define UUART_PROTCTL_RTSAUDIREN_Msk (0x1ul << UUART_PROTCTL_RTSAUDIREN_Pos) /*!< UUART_T::PROTCTL: RTSAUDIREN Mask */ - -#define UUART_PROTCTL_ABREN_Pos (6) /*!< UUART_T::PROTCTL: ABREN Position */ -#define UUART_PROTCTL_ABREN_Msk (0x1ul << UUART_PROTCTL_ABREN_Pos) /*!< UUART_T::PROTCTL: ABREN Mask */ - -#define UUART_PROTCTL_DATWKEN_Pos (9) /*!< UUART_T::PROTCTL: DATWKEN Position */ -#define UUART_PROTCTL_DATWKEN_Msk (0x1ul << UUART_PROTCTL_DATWKEN_Pos) /*!< UUART_T::PROTCTL: DATWKEN Mask */ - -#define UUART_PROTCTL_CTSWKEN_Pos (10) /*!< UUART_T::PROTCTL: CTSWKEN Position */ -#define UUART_PROTCTL_CTSWKEN_Msk (0x1ul << UUART_PROTCTL_CTSWKEN_Pos) /*!< UUART_T::PROTCTL: CTSWKEN Mask */ - -#define UUART_PROTCTL_WAKECNT_Pos (11) /*!< UUART_T::PROTCTL: WAKECNT Position */ -#define UUART_PROTCTL_WAKECNT_Msk (0xful << UUART_PROTCTL_WAKECNT_Pos) /*!< UUART_T::PROTCTL: WAKECNT Mask */ - -#define UUART_PROTCTL_BRDETITV_Pos (16) /*!< UUART_T::PROTCTL: BRDETITV Position */ -#define UUART_PROTCTL_BRDETITV_Msk (0x1fful << UUART_PROTCTL_BRDETITV_Pos) /*!< UUART_T::PROTCTL: BRDETITV Mask */ - -#define UUART_PROTCTL_STICKEN_Pos (26) /*!< UUART_T::PROTCTL: STICKEN Position */ -#define UUART_PROTCTL_STICKEN_Msk (0x1ul << UUART_PROTCTL_STICKEN_Pos) /*!< UUART_T::PROTCTL: STICKEN Mask */ - -#define UUART_PROTCTL_BCEN_Pos (29) /*!< UUART_T::PROTCTL: BCEN Position */ -#define UUART_PROTCTL_BCEN_Msk (0x1ul << UUART_PROTCTL_BCEN_Pos) /*!< UUART_T::PROTCTL: BCEN Mask */ - -#define UUART_PROTCTL_PROTEN_Pos (31) /*!< UUART_T::PROTCTL: PROTEN Position */ -#define UUART_PROTCTL_PROTEN_Msk (0x1ul << UUART_PROTCTL_PROTEN_Pos) /*!< UUART_T::PROTCTL: PROTEN Mask */ - -#define UUART_PROTIEN_ABRIEN_Pos (1) /*!< UUART_T::PROTIEN: ABRIEN Position */ -#define UUART_PROTIEN_ABRIEN_Msk (0x1ul << UUART_PROTIEN_ABRIEN_Pos) /*!< UUART_T::PROTIEN: ABRIEN Mask */ - -#define UUART_PROTIEN_RLSIEN_Pos (2) /*!< UUART_T::PROTIEN: RLSIEN Position */ -#define UUART_PROTIEN_RLSIEN_Msk (0x1ul << UUART_PROTIEN_RLSIEN_Pos) /*!< UUART_T::PROTIEN: RLSIEN Mask */ - -#define UUART_PROTSTS_TXSTIF_Pos (1) /*!< UUART_T::PROTSTS: TXSTIF Position */ -#define UUART_PROTSTS_TXSTIF_Msk (0x1ul << UUART_PROTSTS_TXSTIF_Pos) /*!< UUART_T::PROTSTS: TXSTIF Mask */ - -#define UUART_PROTSTS_TXENDIF_Pos (2) /*!< UUART_T::PROTSTS: TXENDIF Position */ -#define UUART_PROTSTS_TXENDIF_Msk (0x1ul << UUART_PROTSTS_TXENDIF_Pos) /*!< UUART_T::PROTSTS: TXENDIF Mask */ - -#define UUART_PROTSTS_RXSTIF_Pos (3) /*!< UUART_T::PROTSTS: RXSTIF Position */ -#define UUART_PROTSTS_RXSTIF_Msk (0x1ul << UUART_PROTSTS_RXSTIF_Pos) /*!< UUART_T::PROTSTS: RXSTIF Mask */ - -#define UUART_PROTSTS_RXENDIF_Pos (4) /*!< UUART_T::PROTSTS: RXENDIF Position */ -#define UUART_PROTSTS_RXENDIF_Msk (0x1ul << UUART_PROTSTS_RXENDIF_Pos) /*!< UUART_T::PROTSTS: RXENDIF Mask */ - -#define UUART_PROTSTS_PARITYERR_Pos (5) /*!< UUART_T::PROTSTS: PARITYERR Position */ -#define UUART_PROTSTS_PARITYERR_Msk (0x1ul << UUART_PROTSTS_PARITYERR_Pos) /*!< UUART_T::PROTSTS: PARITYERR Mask */ - -#define UUART_PROTSTS_FRMERR_Pos (6) /*!< UUART_T::PROTSTS: FRMERR Position */ -#define UUART_PROTSTS_FRMERR_Msk (0x1ul << UUART_PROTSTS_FRMERR_Pos) /*!< UUART_T::PROTSTS: FRMERR Mask */ - -#define UUART_PROTSTS_BREAK_Pos (7) /*!< UUART_T::PROTSTS: BREAK Position */ -#define UUART_PROTSTS_BREAK_Msk (0x1ul << UUART_PROTSTS_BREAK_Pos) /*!< UUART_T::PROTSTS: BREAK Mask */ - -#define UUART_PROTSTS_ABRDETIF_Pos (9) /*!< UUART_T::PROTSTS: ABRDETIF Position */ -#define UUART_PROTSTS_ABRDETIF_Msk (0x1ul << UUART_PROTSTS_ABRDETIF_Pos) /*!< UUART_T::PROTSTS: ABRDETIF Mask */ - -#define UUART_PROTSTS_RXBUSY_Pos (10) /*!< UUART_T::PROTSTS: RXBUSY Position */ -#define UUART_PROTSTS_RXBUSY_Msk (0x1ul << UUART_PROTSTS_RXBUSY_Pos) /*!< UUART_T::PROTSTS: RXBUSY Mask */ - -#define UUART_PROTSTS_ABERRSTS_Pos (11) /*!< UUART_T::PROTSTS: ABERRSTS Position */ -#define UUART_PROTSTS_ABERRSTS_Msk (0x1ul << UUART_PROTSTS_ABERRSTS_Pos) /*!< UUART_T::PROTSTS: ABERRSTS Mask */ - -#define UUART_PROTSTS_CTSSYNCLV_Pos (16) /*!< UUART_T::PROTSTS: CTSSYNCLV Position */ -#define UUART_PROTSTS_CTSSYNCLV_Msk (0x1ul << UUART_PROTSTS_CTSSYNCLV_Pos) /*!< UUART_T::PROTSTS: CTSSYNCLV Mask */ - -#define UUART_PROTSTS_CTSLV_Pos (17) /*!< UUART_T::PROTSTS: CTSLV Position */ -#define UUART_PROTSTS_CTSLV_Msk (0x1ul << UUART_PROTSTS_CTSLV_Pos) /*!< UUART_T::PROTSTS: CTSLV Mask */ - -/**@}*/ /* UUART_CONST */ -/**@}*/ /* end of UUART register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __UUART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wdt_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wdt_reg.h deleted file mode 100644 index 2bead168677..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wdt_reg.h +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************//** - * @file wdt_reg.h - * @version V1.00 - * @brief WDT register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WDT_REG_H__ -#define __WDT_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup WDT Watch Dog Timer Controller(WDT) - Memory Mapped Structure for WDT Controller -@{ */ - -typedef struct -{ - - - /** - * @var WDT_T::CTL - * Offset: 0x00 WDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RSTCNT |Reset WDT Up Counter (Write Protect) - * | | |0 = No effect. - * | | |1 = Reset the internal 18-bit WDT up counter value. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This bit will be automatically cleared by hardware. - * |[1] |RSTEN |WDT Time-out Reset Enable Control (Write Protect) - * | | |Setting this bit will enable the WDT time-out reset function If the WDT up counter value has not been cleared after the specific WDT reset delay period expires. - * | | |0 = WDT time-out reset function Disabled. - * | | |1 = WDT time-out reset function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[2] |RSTF |WDT Time-out Reset Flag - * | | |This bit indicates the system has been reset by WDT time-out reset or not. - * | | |0 = WDT time-out reset did not occur. - * | | |1 = WDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |IF |WDT Time-out Interrupt Flag - * | | |This bit will set to 1 while WDT up counter value reaches the selected WDT time-out interval - * | | |0 = WDT time-out interrupt did not occur. - * | | |1 = WDT time-out interrupt occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[4] |WKEN |WDT Time-out Wake-up Function Control (Write Protect) - * | | |If this bit is set to 1, while WDT time-out interrupt flag IF (WDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (WDT_CTL[6]) is enabled, the WDT time-out interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event Disabled if WDT time-out interrupt signal generated. - * | | |1 = Wake-up trigger event Enabled if WDT time-out interrupt signal generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: Chip can be woken-up by WDT time-out interrupt signal generated only if WDT clock source is selected to 10 kHz internal low speed RC oscillator (LIRC) or LXT. - * |[5] |WKF |WDT Time-out Wake-up Flag (Write Protect) - * | | |This bit indicates the interrupt wake-up flag status of WDT - * | | |0 = WDT does not cause chip wake-up. - * | | |1 = Chip wake-up from Idle or Power-down mode if WDT time-out interrupt signal generated. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This bit is cleared by writing 1 to it. - * |[6] |INTEN |WDT Time-out Interrupt Enable Control (Write Protect) - * | | |If this bit is enabled, the WDT time-out interrupt signal is generated and inform to CPU. - * | | |0 = WDT time-out interrupt Disabled. - * | | |1 = WDT time-out interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[7] |WDTEN |WDT Enable Control (Write Protect) - * | | |0 = WDT Disabled (This action will reset the internal up counter value). - * | | |1 = WDT Enabled. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: If CWDTEN[2:0] (combined by Config0[31] and Config0[4:3]) bits is not configure to 111, this bit is forced as 1 and user cannot change this bit to 0. - * |[10:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect) - * | | |These three bits select the time-out interval period for the WDT. - * | | |000 = 24 * WDT_CLK. - * | | |001 = 26 * WDT_CLK. - * | | |010 = 28 * WDT_CLK. - * | | |011 = 210 * WDT_CLK. - * | | |100 = 212 * WDT_CLK. - * | | |101 = 214 * WDT_CLK. - * | | |110 = 216 * WDT_CLK. - * | | |111 = 218 * WDT_CLK. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * |[30] |SYNC |WDT Enable Control SYNC Flag Indicator (Read Only) - * | | |If user execute enable/disable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is completed or not. - * | | |0 = Set WDTEN bit is completed. - * | | |1 = Set WDTEN bit is synchronizing and not become active yet.. - * | | |Note: Perform enable or disable WDTEN bit needs 2 * WDT_CLK period to become active. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect) - * | | |0 = ICE debug mode acknowledgement affects WDT counting. - * | | |WDT up counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |WDT up counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register. - * @var WDT_T::ALTCTL - * Offset: 0x04 WDT Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RSTDSEL |WDT Reset Delay Selection (Write Protect) - * | | |When WDT time-out happened, user has a time named WDT Reset Delay Period to clear WDT counter by setting RSTCNT (WDT_CTL[0]) to prevent WDT time-out reset happened - * | | |User can select a suitable setting of RSTDSEL for different WDT Reset Delay Period. - * | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK. - * | | |01 = WDT Reset Delay Period is 130 * WDT_CLK. - * | | |10 = WDT Reset Delay Period is 18 * WDT_CLK. - * | | |11 = WDT Reset Delay Period is 3 * WDT_CLK. - * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register. - * | | |Note2: This register will be reset to 0 if WDT time-out reset happened. - * @var WDT_T::RSTCNT - * Offset: 0x08 WDT Reset Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RSTCNT |WDT Reset Counter Register - * | | |Writing 0x00005AA5 to this field will reset the internal 18-bit WDT up counter value to 0. - * | | |Note: Perform RSTCNT to reset counter needs 2 * WDT_CLK period to become active. - * | | |Note: RSTCNT (WDT_CTL[0]) bit is a write protected bit - * | | |RSTCNT (WDT_RSTCNT[31:0]) bits are not write protected. - */ - __IO uint32_t CTL; /*!< [0x0000] WDT Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0004] WDT Alternative Control Register */ - __O uint32_t RSTCNT; /*!< [0x0008] WDT Reset Counter Register */ - -} WDT_T; - -/** - @addtogroup WDT_CONST WDT Bit Field Definition - Constant Definitions for WDT Controller -@{ */ - -#define WDT_CTL_RSTCNT_Pos (0) /*!< WDT_T::CTL: RSTCNT Position */ -#define WDT_CTL_RSTCNT_Msk (0x1ul << WDT_CTL_RSTCNT_Pos) /*!< WDT_T::CTL: RSTCNT Mask */ - -#define WDT_CTL_RSTEN_Pos (1) /*!< WDT_T::CTL: RSTEN Position */ -#define WDT_CTL_RSTEN_Msk (0x1ul << WDT_CTL_RSTEN_Pos) /*!< WDT_T::CTL: RSTEN Mask */ - -#define WDT_CTL_RSTF_Pos (2) /*!< WDT_T::CTL: RSTF Position */ -#define WDT_CTL_RSTF_Msk (0x1ul << WDT_CTL_RSTF_Pos) /*!< WDT_T::CTL: RSTF Mask */ - -#define WDT_CTL_IF_Pos (3) /*!< WDT_T::CTL: IF Position */ -#define WDT_CTL_IF_Msk (0x1ul << WDT_CTL_IF_Pos) /*!< WDT_T::CTL: IF Mask */ - -#define WDT_CTL_WKEN_Pos (4) /*!< WDT_T::CTL: WKEN Position */ -#define WDT_CTL_WKEN_Msk (0x1ul << WDT_CTL_WKEN_Pos) /*!< WDT_T::CTL: WKEN Mask */ - -#define WDT_CTL_WKF_Pos (5) /*!< WDT_T::CTL: WKF Position */ -#define WDT_CTL_WKF_Msk (0x1ul << WDT_CTL_WKF_Pos) /*!< WDT_T::CTL: WKF Mask */ - -#define WDT_CTL_INTEN_Pos (6) /*!< WDT_T::CTL: INTEN Position */ -#define WDT_CTL_INTEN_Msk (0x1ul << WDT_CTL_INTEN_Pos) /*!< WDT_T::CTL: INTEN Mask */ - -#define WDT_CTL_WDTEN_Pos (7) /*!< WDT_T::CTL: WDTEN Position */ -#define WDT_CTL_WDTEN_Msk (0x1ul << WDT_CTL_WDTEN_Pos) /*!< WDT_T::CTL: WDTEN Mask */ - -#define WDT_CTL_TOUTSEL_Pos (8) /*!< WDT_T::CTL: TOUTSEL Position */ -#define WDT_CTL_TOUTSEL_Msk (0x7ul << WDT_CTL_TOUTSEL_Pos) /*!< WDT_T::CTL: TOUTSEL Mask */ - -#define WDT_CTL_SYNC_Pos (30) /*!< WDT_T::CTL: SYNC Position */ -#define WDT_CTL_SYNC_Msk (0x1ul << WDT_CTL_SYNC_Pos) /*!< WDT_T::CTL: SYNC Mask */ - -#define WDT_CTL_ICEDEBUG_Pos (31) /*!< WDT_T::CTL: ICEDEBUG Position */ -#define WDT_CTL_ICEDEBUG_Msk (0x1ul << WDT_CTL_ICEDEBUG_Pos) /*!< WDT_T::CTL: ICEDEBUG Mask */ - -#define WDT_ALTCTL_RSTDSEL_Pos (0) /*!< WDT_T::ALTCTL: RSTDSEL Position */ -#define WDT_ALTCTL_RSTDSEL_Msk (0x3ul << WDT_ALTCTL_RSTDSEL_Pos) /*!< WDT_T::ALTCTL: RSTDSEL Mask */ - -#define WDT_RSTCNT_RSTCNT_Pos (0) /*!< WDT_T::RSTCNT: RSTCNT Position */ -#define WDT_RSTCNT_RSTCNT_Msk (0xfffffffful << WDT_RSTCNT_RSTCNT_Pos) /*!< WDT_T::RSTCNT: RSTCNT Mask */ - -/**@}*/ /* WDT_CONST */ -/**@}*/ /* end of WDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __WDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wwdt_reg.h b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wwdt_reg.h deleted file mode 100644 index 67f5748826a..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Include/wwdt_reg.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************//** - * @file wwdt_reg.h - * @version V1.00 - * @brief WWDT register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WWDT_REG_H__ -#define __WWDT_REG_H__ - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup WWDT Window Watchdog Timer(WWDT) - Memory Mapped Structure for WWDT Controller -@{ */ - -typedef struct -{ - - - /** - * @var WWDT_T::RLDCNT - * Offset: 0x00 WWDT Reload Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RLDCNT |WWDT Reload Counter Register - * | | |Writing 0x00005AA5 to this register will reload the WWDT counter value to 0x3F. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT (WWDT_CTL[21:16]) - * | | |If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT , WWDT reset signal will generate immediately. - * @var WWDT_T::CTL - * Offset: 0x04 WWDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTEN |WWDT Enable Control Bit - * | | |Set this bit to enable WWDT counter counting. - * | | |0 = WWDT counter is stopped. - * | | |1 = WWDT counter is starting counting. - * |[1] |INTEN |WWDT Interrupt Enable Control Bit - * | | |If this bit is enabled, the WWDT counter compare match interrupt signal is generated and inform to CPU. - * | | |0 = WWDT counter compare match interrupt Disabled. - * | | |1 = WWDT counter compare match interrupt Enabled. - * |[11:8] |PSCSEL |WWDT Counter Prescale Period Selection - * | | |0000 = Pre-scale is 1; Max time-out period is 1 * 64 * WWDT_CLK. - * | | |0001 = Pre-scale is 2; Max time-out period is 2 * 64 * WWDT_CLK. - * | | |0010 = Pre-scale is 4; Max time-out period is 4 * 64 * WWDT_CLK. - * | | |0011 = Pre-scale is 8; Max time-out period is 8 * 64 * WWDT_CLK. - * | | |0100 = Pre-scale is 16; Max time-out period is 16 * 64 * WWDT_CLK. - * | | |0101 = Pre-scale is 32; Max time-out period is 32 * 64 * WWDT_CLK. - * | | |0110 = Pre-scale is 64; Max time-out period is 64 * 64 * WWDT_CLK. - * | | |0111 = Pre-scale is 128; Max time-out period is 128 * 64 * WWDT_CLK. - * | | |1000 = Pre-scale is 192; Max time-out period is 192 * 64 * WWDT_CLK. - * | | |1001 = Pre-scale is 256; Max time-out period is 256 * 64 * WWDT_CLK. - * | | |1010 = Pre-scale is 384; Max time-out period is 384 * 64 * WWDT_CLK. - * | | |1011 = Pre-scale is 512; Max time-out period is 512 * 64 * WWDT_CLK. - * | | |1100 = Pre-scale is 768; Max time-out period is 768 * 64 * WWDT_CLK. - * | | |1101 = Pre-scale is 1024; Max time-out period is 1024 * 64 * WWDT_CLK. - * | | |1110 = Pre-scale is 1536; Max time-out period is 1536 * 64 * WWDT_CLK. - * | | |1111 = Pre-scale is 2048; Max time-out period is 2048 * 64 * WWDT_CLK. - * |[21:16] |CMPDAT |WWDT Window Compare Register - * | | |Set this register to adjust the valid reload window. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT - * | | |If user writes WWDT_RLDCNT register when current WWDT counter value larger than CMPDAT, WWDT reset signal will generate immediately. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control - * | | |0 = ICE debug mode acknowledgement effects WWDT counting. - * | | |WWDT down counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |WWDT down counter will keep going no matter CPU is held by ICE or not. - * @var WWDT_T::STATUS - * Offset: 0x08 WWDT Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTIF |WWDT Compare Match Interrupt Flag - * | | |This bit indicates the interrupt flag status of WWDT while WWDT counter value matches CMPDAT (WWDT_CTL[21:16]). - * | | |0 = No effect. - * | | |1 = WWDT counter value matches CMPDAT. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WWDTRF |WWDT Timer-out Reset Flag - * | | |This bit indicates the system has been reset by WWDT time-out reset or not. - * | | |0 = WWDT time-out reset did not occur. - * | | |1 = WWDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var WWDT_T::CNT - * Offset: 0x0C WWDT Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CNTDAT |WWDT Counter Value - * | | |CNTDAT will be updated continuously to monitor 6-bit WWDT down counter value. - */ - __O uint32_t RLDCNT; /*!< [0x0000] WWDT Reload Counter Register */ - __IO uint32_t CTL; /*!< [0x0004] WWDT Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] WWDT Status Register */ - __I uint32_t CNT; /*!< [0x000c] WWDT Counter Value Register */ - -} WWDT_T; - -/** - @addtogroup WWDT_CONST WWDT Bit Field Definition - Constant Definitions for WWDT Controller -@{ */ - -#define WWDT_RLDCNT_RLDCNT_Pos (0) /*!< WWDT_T::RLDCNT: RLDCNT Position */ -#define WWDT_RLDCNT_RLDCNT_Msk (0xfffffffful << WWDT_RLDCNT_RLDCNT_Pos) /*!< WWDT_T::RLDCNT: RLDCNT Mask */ - -#define WWDT_CTL_WWDTEN_Pos (0) /*!< WWDT_T::CTL: WWDTEN Position */ -#define WWDT_CTL_WWDTEN_Msk (0x1ul << WWDT_CTL_WWDTEN_Pos) /*!< WWDT_T::CTL: WWDTEN Mask */ - -#define WWDT_CTL_INTEN_Pos (1) /*!< WWDT_T::CTL: INTEN Position */ -#define WWDT_CTL_INTEN_Msk (0x1ul << WWDT_CTL_INTEN_Pos) /*!< WWDT_T::CTL: INTEN Mask */ - -#define WWDT_CTL_PSCSEL_Pos (8) /*!< WWDT_T::CTL: PSCSEL Position */ -#define WWDT_CTL_PSCSEL_Msk (0xful << WWDT_CTL_PSCSEL_Pos) /*!< WWDT_T::CTL: PSCSEL Mask */ - -#define WWDT_CTL_CMPDAT_Pos (16) /*!< WWDT_T::CTL: CMPDAT Position */ -#define WWDT_CTL_CMPDAT_Msk (0x3ful << WWDT_CTL_CMPDAT_Pos) /*!< WWDT_T::CTL: CMPDAT Mask */ - -#define WWDT_CTL_ICEDEBUG_Pos (31) /*!< WWDT_T::CTL: ICEDEBUG Position */ -#define WWDT_CTL_ICEDEBUG_Msk (0x1ul << WWDT_CTL_ICEDEBUG_Pos) /*!< WWDT_T::CTL: ICEDEBUG Mask */ - -#define WWDT_STATUS_WWDTIF_Pos (0) /*!< WWDT_T::STATUS: WWDTIF Position */ -#define WWDT_STATUS_WWDTIF_Msk (0x1ul << WWDT_STATUS_WWDTIF_Pos) /*!< WWDT_T::STATUS: WWDTIF Mask */ - -#define WWDT_STATUS_WWDTRF_Pos (1) /*!< WWDT_T::STATUS: WWDTRF Position */ -#define WWDT_STATUS_WWDTRF_Msk (0x1ul << WWDT_STATUS_WWDTRF_Pos) /*!< WWDT_T::STATUS: WWDTRF Mask */ - -#define WWDT_CNT_CNTDAT_Pos (0) /*!< WWDT_T::CNT: CNTDAT Position */ -#define WWDT_CNT_CNTDAT_Msk (0x3ful << WWDT_CNT_CNTDAT_Pos) /*!< WWDT_T::CNT: CNTDAT Mask */ - -/**@}*/ /* WWDT_CONST */ -/**@}*/ /* end of WWDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) -#pragma no_anon_unions -#endif - -#endif /* __WWDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/ARM/startup_M480.s b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/ARM/startup_M480.s deleted file mode 100644 index 3e31df75cb5..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/ARM/startup_M480.s +++ /dev/null @@ -1,514 +0,0 @@ -;/****************************************************************************** -; * @file startup_M480.s -; * @version V1.00 -; * @brief CMSIS Cortex-M4 Core Device Startup File for M480 -; * -; * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -;*****************************************************************************/ -;/* -;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ -;*/ - - -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Stack_Size -Stack_Size EQU 0x00000800 - ENDIF - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Heap_Size -Heap_Size EQU 0x00000100 - ENDIF - - 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 - - ; External Interrupts - DCD BOD_IRQHandler ; 0: Brown Out detection - DCD IRC_IRQHandler ; 1: Internal RC - DCD PWRWU_IRQHandler ; 2: Power down wake up - DCD RAMPE_IRQHandler ; 3: RAM parity error - DCD CKFAIL_IRQHandler ; 4: Clock detection fail - DCD Default_Handler ; 5: Reserved - DCD RTC_IRQHandler ; 6: Real Time Clock - DCD TAMPER_IRQHandler ; 7: Tamper detection - DCD WDT_IRQHandler ; 8: Watchdog timer - DCD WWDT_IRQHandler ; 9: Window watchdog timer - DCD EINT0_IRQHandler ; 10: External Input 0 - DCD EINT1_IRQHandler ; 11: External Input 1 - DCD EINT2_IRQHandler ; 12: External Input 2 - DCD EINT3_IRQHandler ; 13: External Input 3 - DCD EINT4_IRQHandler ; 14: External Input 4 - DCD EINT5_IRQHandler ; 15: External Input 5 - DCD GPA_IRQHandler ; 16: GPIO Port A - DCD GPB_IRQHandler ; 17: GPIO Port B - DCD GPC_IRQHandler ; 18: GPIO Port C - DCD GPD_IRQHandler ; 19: GPIO Port D - DCD GPE_IRQHandler ; 20: GPIO Port E - DCD GPF_IRQHandler ; 21: GPIO Port F - DCD QSPI0_IRQHandler ; 22: QSPI0 - DCD SPI0_IRQHandler ; 23: SPI0 - DCD BRAKE0_IRQHandler ; 24: - DCD EPWM0P0_IRQHandler ; 25: - DCD EPWM0P1_IRQHandler ; 26: - DCD EPWM0P2_IRQHandler ; 27: - DCD BRAKE1_IRQHandler ; 28: - DCD EPWM1P0_IRQHandler ; 29: - DCD EPWM1P1_IRQHandler ; 30: - DCD EPWM1P2_IRQHandler ; 31: - DCD TMR0_IRQHandler ; 32: Timer 0 - DCD TMR1_IRQHandler ; 33: Timer 1 - DCD TMR2_IRQHandler ; 34: Timer 2 - DCD TMR3_IRQHandler ; 35: Timer 3 - DCD UART0_IRQHandler ; 36: UART0 - DCD UART1_IRQHandler ; 37: UART1 - DCD I2C0_IRQHandler ; 38: I2C0 - DCD I2C1_IRQHandler ; 39: I2C1 - DCD PDMA_IRQHandler ; 40: Peripheral DMA - DCD DAC_IRQHandler ; 41: DAC - DCD EADC00_IRQHandler ; 42: EADC0 interrupt source 0 - DCD EADC01_IRQHandler ; 43: EADC0 interrupt source 1 - DCD ACMP01_IRQHandler ; 44: ACMP0 and ACMP1 - DCD Default_Handler ; 45: Reserved - DCD EADC02_IRQHandler ; 46: EADC0 interrupt source 2 - DCD EADC03_IRQHandler ; 47: EADC0 interrupt source 3 - DCD UART2_IRQHandler ; 48: UART2 - DCD UART3_IRQHandler ; 49: UART3 - DCD QSPI1_IRQHandler ; 50: QSPI1 - DCD SPI1_IRQHandler ; 51: SPI1 - DCD SPI2_IRQHandler ; 52: SPI2 - DCD USBD_IRQHandler ; 53: USB device - DCD OHCI_IRQHandler ; 54: OHCI - DCD USBOTG_IRQHandler ; 55: USB OTG - DCD CAN0_IRQHandler ; 56: CAN0 - DCD CAN1_IRQHandler ; 57: CAN1 - DCD SC0_IRQHandler ; 58: - DCD SC1_IRQHandler ; 59: - DCD SC2_IRQHandler ; 60: - DCD Default_Handler ; 61: - DCD SPI3_IRQHandler ; 62: SPI3 - DCD Default_Handler ; 63: - DCD SDH0_IRQHandler ; 64: SDH0 - DCD USBD20_IRQHandler ; 65: USBD20 - DCD EMAC_TX_IRQHandler ; 66: EMAC_TX - DCD EMAC_RX_IRQHandler ; 67: EMAX_RX - DCD I2S0_IRQHandler ; 68: I2S0 - DCD Default_Handler ; 69: ToDo: Add description to this Interrupt - DCD OPA0_IRQHandler ; 70: OPA0 - DCD CRYPTO_IRQHandler ; 71: CRYPTO - DCD GPG_IRQHandler ; 72: - DCD EINT6_IRQHandler ; 73: - DCD UART4_IRQHandler ; 74: UART4 - DCD UART5_IRQHandler ; 75: UART5 - DCD USCI0_IRQHandler ; 76: USCI0 - DCD USCI1_IRQHandler ; 77: USCI1 - DCD BPWM0_IRQHandler ; 78: BPWM0 - DCD BPWM1_IRQHandler ; 79: BPWM1 - DCD SPIM_IRQHandler ; 80: SPIM - DCD CCAP_IRQHandler ; 81: CCAP - DCD I2C2_IRQHandler ; 82: I2C2 - DCD Default_Handler ; 83: - DCD QEI0_IRQHandler ; 84: QEI0 - DCD QEI1_IRQHandler ; 85: QEI1 - DCD ECAP0_IRQHandler ; 86: ECAP0 - DCD ECAP1_IRQHandler ; 87: ECAP1 - DCD GPH_IRQHandler ; 88: - DCD EINT7_IRQHandler ; 89: - DCD SDH1_IRQHandler ; 90: SDH1 - DCD Default_Handler ; 91: - DCD EHCI_IRQHandler ; 92: EHCI - DCD USBOTG20_IRQHandler ; 93: - DCD Default_Handler ; 94: - DCD Default_Handler ; 95: - DCD Default_Handler ; 96: - DCD Default_Handler ; 97: - DCD Default_Handler ; 98: - DCD Default_Handler ; 99: - DCD Default_Handler ; 100: - DCD TRNG_IRQHandler ; 101: TRNG - DCD UART6_IRQHandler ; 102: UART6 - DCD UART7_IRQHandler ; 103: UART7 - DCD EADC10_IRQHandler ; 104: EADC1 interrupt source 0 - DCD EADC11_IRQHandler ; 105: EADC1 interrupt source 1 - DCD EADC12_IRQHandler ; 106: EADC1 interrupt source 2 - DCD EADC13_IRQHandler ; 107: EADC1 interrupt source 3 - DCD CAN2_IRQHandler ; 108: CAN2 - - -__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 - - ; Unlock Register - LDR R0, =0x40000100 - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - IF :LNOT: :DEF: ENABLE_SPIM_CACHE - LDR R0, =0x40000200 ; R0 = Clock Controller Register Base Address - LDR R1, [R0,#0x4] ; R1 = 0x40000204 (AHBCLK) - ORR R1, R1, #0x4000 - STR R1, [R0,#0x4] ; CLK->AHBCLK |= CLK_AHBCLK_SPIMCKEN_Msk; - - LDR R0, =0x40007000 ; R0 = SPIM Register Base Address - LDR R1, [R0,#4] ; R1 = SPIM->CTL1 - ORR R1, R1,#2 ; R1 |= SPIM_CTL1_CACHEOFF_Msk - STR R1, [R0,#4] ; _SPIM_DISABLE_CACHE() - LDR R1, [R0,#4] ; R1 = SPIM->CTL1 - ORR R1, R1, #4 ; R1 |= SPIM_CTL1_CCMEN_Msk - STR R1, [R0,#4] ; _SPIM_ENABLE_CCM() - ENDIF - - LDR R0, =SystemInit - BLX R0 - - ; Init POR - ; LDR R2, =0x40000024 - ; LDR R1, =0x00005AA5 - ; STR R1, [R2] - - ; Lock - LDR R0, =0x40000100 - LDR R1, =0 - STR R1, [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 BOD_IRQHandler [WEAK] - EXPORT IRC_IRQHandler [WEAK] - EXPORT PWRWU_IRQHandler [WEAK] - EXPORT RAMPE_IRQHandler [WEAK] - EXPORT CKFAIL_IRQHandler [WEAK] - EXPORT RTC_IRQHandler [WEAK] - EXPORT TAMPER_IRQHandler [WEAK] - EXPORT WDT_IRQHandler [WEAK] - EXPORT WWDT_IRQHandler [WEAK] - EXPORT EINT0_IRQHandler [WEAK] - EXPORT EINT1_IRQHandler [WEAK] - EXPORT EINT2_IRQHandler [WEAK] - EXPORT EINT3_IRQHandler [WEAK] - EXPORT EINT4_IRQHandler [WEAK] - EXPORT EINT5_IRQHandler [WEAK] - EXPORT GPA_IRQHandler [WEAK] - EXPORT GPB_IRQHandler [WEAK] - EXPORT GPC_IRQHandler [WEAK] - EXPORT GPD_IRQHandler [WEAK] - EXPORT GPE_IRQHandler [WEAK] - EXPORT GPF_IRQHandler [WEAK] - EXPORT QSPI0_IRQHandler [WEAK] - EXPORT SPI0_IRQHandler [WEAK] - EXPORT BRAKE0_IRQHandler [WEAK] - EXPORT EPWM0P0_IRQHandler [WEAK] - EXPORT EPWM0P1_IRQHandler [WEAK] - EXPORT EPWM0P2_IRQHandler [WEAK] - EXPORT BRAKE1_IRQHandler [WEAK] - EXPORT EPWM1P0_IRQHandler [WEAK] - EXPORT EPWM1P1_IRQHandler [WEAK] - EXPORT EPWM1P2_IRQHandler [WEAK] - EXPORT TMR0_IRQHandler [WEAK] - EXPORT TMR1_IRQHandler [WEAK] - EXPORT TMR2_IRQHandler [WEAK] - EXPORT TMR3_IRQHandler [WEAK] - EXPORT UART0_IRQHandler [WEAK] - EXPORT UART1_IRQHandler [WEAK] - EXPORT I2C0_IRQHandler [WEAK] - EXPORT I2C1_IRQHandler [WEAK] - EXPORT PDMA_IRQHandler [WEAK] - EXPORT DAC_IRQHandler [WEAK] - EXPORT EADC00_IRQHandler [WEAK] - EXPORT EADC01_IRQHandler [WEAK] - EXPORT ACMP01_IRQHandler [WEAK] - EXPORT EADC02_IRQHandler [WEAK] - EXPORT EADC03_IRQHandler [WEAK] - EXPORT UART2_IRQHandler [WEAK] - EXPORT UART3_IRQHandler [WEAK] - EXPORT QSPI1_IRQHandler [WEAK] - EXPORT SPI1_IRQHandler [WEAK] - EXPORT SPI2_IRQHandler [WEAK] - EXPORT USBD_IRQHandler [WEAK] - EXPORT OHCI_IRQHandler [WEAK] - EXPORT USBOTG_IRQHandler [WEAK] - EXPORT CAN0_IRQHandler [WEAK] - EXPORT CAN1_IRQHandler [WEAK] - EXPORT SC0_IRQHandler [WEAK] - EXPORT SC1_IRQHandler [WEAK] - EXPORT SC2_IRQHandler [WEAK] - EXPORT SPI3_IRQHandler [WEAK] - EXPORT SDH0_IRQHandler [WEAK] - EXPORT USBD20_IRQHandler [WEAK] - EXPORT EMAC_TX_IRQHandler [WEAK] - EXPORT EMAC_RX_IRQHandler [WEAK] - EXPORT I2S0_IRQHandler [WEAK] - EXPORT OPA0_IRQHandler [WEAK] - EXPORT CRYPTO_IRQHandler [WEAK] - EXPORT GPG_IRQHandler [WEAK] - EXPORT EINT6_IRQHandler [WEAK] - EXPORT UART4_IRQHandler [WEAK] - EXPORT UART5_IRQHandler [WEAK] - EXPORT USCI0_IRQHandler [WEAK] - EXPORT USCI1_IRQHandler [WEAK] - EXPORT BPWM0_IRQHandler [WEAK] - EXPORT BPWM1_IRQHandler [WEAK] - EXPORT SPIM_IRQHandler [WEAK] - EXPORT CCAP_IRQHandler [WEAK] - EXPORT I2C2_IRQHandler [WEAK] - EXPORT QEI0_IRQHandler [WEAK] - EXPORT QEI1_IRQHandler [WEAK] - EXPORT ECAP0_IRQHandler [WEAK] - EXPORT ECAP1_IRQHandler [WEAK] - EXPORT GPH_IRQHandler [WEAK] - EXPORT EINT7_IRQHandler [WEAK] - EXPORT SDH1_IRQHandler [WEAK] - EXPORT EHCI_IRQHandler [WEAK] - EXPORT USBOTG20_IRQHandler [WEAK] - EXPORT TRNG_IRQHandler [WEAK] - EXPORT UART6_IRQHandler [WEAK] - EXPORT UART7_IRQHandler [WEAK] - EXPORT EADC10_IRQHandler [WEAK] - EXPORT EADC11_IRQHandler [WEAK] - EXPORT EADC12_IRQHandler [WEAK] - EXPORT EADC13_IRQHandler [WEAK] - EXPORT CAN2_IRQHandler [WEAK] - -Default__IRQHandler -BOD_IRQHandler -IRC_IRQHandler -PWRWU_IRQHandler -RAMPE_IRQHandler -CKFAIL_IRQHandler -RTC_IRQHandler -TAMPER_IRQHandler -WDT_IRQHandler -WWDT_IRQHandler -EINT0_IRQHandler -EINT1_IRQHandler -EINT2_IRQHandler -EINT3_IRQHandler -EINT4_IRQHandler -EINT5_IRQHandler -GPA_IRQHandler -GPB_IRQHandler -GPC_IRQHandler -GPD_IRQHandler -GPE_IRQHandler -GPF_IRQHandler -QSPI0_IRQHandler -SPI0_IRQHandler -BRAKE0_IRQHandler -EPWM0P0_IRQHandler -EPWM0P1_IRQHandler -EPWM0P2_IRQHandler -BRAKE1_IRQHandler -EPWM1P0_IRQHandler -EPWM1P1_IRQHandler -EPWM1P2_IRQHandler -TMR0_IRQHandler -TMR1_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -UART0_IRQHandler -UART1_IRQHandler -I2C0_IRQHandler -I2C1_IRQHandler -PDMA_IRQHandler -DAC_IRQHandler -EADC00_IRQHandler -EADC01_IRQHandler -ACMP01_IRQHandler -EADC02_IRQHandler -EADC03_IRQHandler -UART2_IRQHandler -UART3_IRQHandler -QSPI1_IRQHandler -SPI1_IRQHandler -SPI2_IRQHandler -USBD_IRQHandler -OHCI_IRQHandler -USBOTG_IRQHandler -CAN0_IRQHandler -CAN1_IRQHandler -SC0_IRQHandler -SC1_IRQHandler -SC2_IRQHandler -SPI3_IRQHandler -SDH0_IRQHandler -USBD20_IRQHandler -EMAC_TX_IRQHandler -EMAC_RX_IRQHandler -I2S0_IRQHandler -OPA0_IRQHandler -CRYPTO_IRQHandler -GPG_IRQHandler -EINT6_IRQHandler -UART4_IRQHandler -UART5_IRQHandler -USCI0_IRQHandler -USCI1_IRQHandler -BPWM0_IRQHandler -BPWM1_IRQHandler -SPIM_IRQHandler -CCAP_IRQHandler -I2C2_IRQHandler -QEI0_IRQHandler -QEI1_IRQHandler -ECAP0_IRQHandler -ECAP1_IRQHandler -GPH_IRQHandler -EINT7_IRQHandler -SDH1_IRQHandler -EHCI_IRQHandler -USBOTG20_IRQHandler -TRNG_IRQHandler -UART6_IRQHandler -UART7_IRQHandler -EADC10_IRQHandler -EADC11_IRQHandler -EADC12_IRQHandler -EADC13_IRQHandler -CAN2_IRQHandler - - - - 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 PROC - LDR R0, = Heap_Mem - LDR R1, =(Stack_Mem + Stack_Size) - LDR R2, = (Heap_Mem + Heap_Size) - LDR R3, = Stack_Mem - BX LR - ENDP - - ALIGN - - ENDIF - - - END -;/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/GCC/startup_M480.S b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/GCC/startup_M480.S deleted file mode 100644 index a4eb650ee2c..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/GCC/startup_M480.S +++ /dev/null @@ -1,375 +0,0 @@ -/****************************************************************************//** - * @file startup_M480.S - * @version V1.00 - * @brief CMSIS Cortex-M4 Core Device Startup File for M480 - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - - // Unlock Register - ldr r0, =0x40000100 - ldr r1, =0x59 - str r1, [r0] - ldr r1, =0x16 - str r1, [r0] - ldr r1, =0x88 - str r1, [r0] - -#ifndef ENABLE_SPIM_CACHE - ldr r0, =0x40000200 // R0 = Clock Controller Register Base Address - ldr r1, [r0,#0x4] // R1 = 0x40000204 (AHBCLK) - orr r1, r1, #0x4000 - str r1, [r0,#0x4] // CLK->AHBCLK |= CLK_AHBCLK_SPIMCKEN_Msk// - - ldr r0, =0x40007000 // R0 = SPIM Register Base Address - ldr r1, [r0,#4] // R1 = SPIM->CTL1 - orr r1, r1,#2 // R1 |= SPIM_CTL1_CACHEOFF_Msk - str r1, [r0,#4] // _SPIM_DISABLE_CACHE() - ldr r1, [r0,#4] // R1 = SPIM->CTL1 - orr r1, r1, #4 // R1 |= SPIM_CTL1_CCMEN_Msk - str r1, [r0,#4] // _SPIM_ENABLE_CCM() -#endif - -#ifndef __NO_SYSTEM_INIT - bl SystemInit -#endif - - // Lock - ldr r0, =0x40000100 - ldr r1, =0 - str r1, [r0] - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the application's entry point.*/ - bl entry - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M4. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - -g_pfnVectors: - .word _estack // Top of Stack - .word Reset_Handler // Reset Handler - .word NMI_Handler // NMI Handler - .word HardFault_Handler // Hard Fault Handler - .word MemManage_Handler // MPU Fault Handler - .word BusFault_Handler // Bus Fault Handler - .word UsageFault_Handler // Usage Fault Handler - .word 0 // Reserved - .word 0 // DCDReserved - .word 0 // Reserved - .word 0 // Reserved - .word SVC_Handler // SVCall Handler - .word DebugMon_Handler // Debug Monitor Handler - .word 0 // Reserved - .word PendSV_Handler // PendSV Handler - .word SysTick_Handler // SysTick Handler - - // External Interrupts - .word BOD_IRQHandler /* 0: BOD */ - .word IRC_IRQHandler /* 1: IRC */ - .word PWRWU_IRQHandler /* 2: PWRWU */ - .word RAMPE_IRQHandler /* 3: RAMPE */ - .word CKFAIL_IRQHandler /* 4: CKFAIL */ - .word 0 /* 5: Reserved */ - .word RTC_IRQHandler /* 6: RTC */ - .word TAMPER_IRQHandler /* 7: TAMPER */ - .word WDT_IRQHandler /* 8: WDT */ - .word WWDT_IRQHandler /* 9: WWDT */ - .word EINT0_IRQHandler /* 10: EINT0 */ - .word EINT1_IRQHandler /* 11: EINT1 */ - .word EINT2_IRQHandler /* 12: EINT2 */ - .word EINT3_IRQHandler /* 13: EINT3 */ - .word EINT4_IRQHandler /* 14: EINT4 */ - .word EINT5_IRQHandler /* 15: EINT5 */ - .word GPA_IRQHandler /* 16: GPA */ - .word GPB_IRQHandler /* 17: GPB */ - .word GPC_IRQHandler /* 18: GPC */ - .word GPD_IRQHandler /* 19: GPD */ - .word GPE_IRQHandler /* 20: GPE */ - .word GPF_IRQHandler /* 21: GPF */ - .word QSPI0_IRQHandler /* 22: QSPI0 */ - .word SPI0_IRQHandler /* 23: SPI0 */ - .word BRAKE0_IRQHandler /* 24: BRAKE0 */ - .word EPWM0P0_IRQHandler /* 25: EPWM0P0 */ - .word EPWM0P1_IRQHandler /* 26: EPWM0P1 */ - .word EPWM0P2_IRQHandler /* 27: EPWM0P2 */ - .word BRAKE1_IRQHandler /* 28: BRAKE1 */ - .word EPWM1P0_IRQHandler /* 29: EPWM1P0 */ - .word EPWM1P1_IRQHandler /* 30: EPWM1P1 */ - .word EPWM1P2_IRQHandler /* 31: EPWM1P2 */ - .word TMR0_IRQHandler /* 32: TIMER0 */ - .word TMR1_IRQHandler /* 33: TIMER1 */ - .word TMR2_IRQHandler /* 34: TIMER2 */ - .word TMR3_IRQHandler /* 35: TIMER3 */ - .word UART0_IRQHandler /* 36: UART0 */ - .word UART1_IRQHandler /* 37: UART1 */ - .word I2C0_IRQHandler /* 38: I2C0 */ - .word I2C1_IRQHandler /* 39: I2C1 */ - .word PDMA_IRQHandler /* 40: PDMA */ - .word DAC_IRQHandler /* 41: DAC */ - .word EADC00_IRQHandler /* 42: EADC00 */ - .word EADC01_IRQHandler /* 43: EADC01 */ - .word ACMP01_IRQHandler /* 44: ACMP */ - .word 0 /* 45: Reserved */ - .word EADC02_IRQHandler /* 46: EADC02 */ - .word EADC03_IRQHandler /* 47: EADC03 */ - .word UART2_IRQHandler /* 48: UART2 */ - .word UART3_IRQHandler /* 49: UART3 */ - .word QSPI1_IRQHandler /* 50: QSPI1 */ - .word SPI1_IRQHandler /* 51: SPI1 */ - .word SPI2_IRQHandler /* 52: SPI2 */ - .word USBD_IRQHandler /* 53: USBD */ - .word OHCI_IRQHandler /* 54: OHCI */ - .word USBOTG_IRQHandler /* 55: OTG */ - .word CAN0_IRQHandler /* 56: CAN0 */ - .word CAN1_IRQHandler /* 57: CAN1 */ - .word SC0_IRQHandler /* 58: SC0 */ - .word SC1_IRQHandler /* 59: SC1 */ - .word SC2_IRQHandler /* 60: SC2 */ - .word 0 /* 61: Reserved */ - .word SPI3_IRQHandler /* 62: SPI3 */ - .word 0 /* 63: Reserved */ - .word SDH0_IRQHandler /* 64: SDH0 */ - .word USBD20_IRQHandler /* 65: HSUSBD */ - .word EMAC_TX_IRQHandler /* 66: EMAC_TX */ - .word EMAC_RX_IRQHandler /* 67: EMAC_RX */ - .word I2S0_IRQHandler /* 68: I2S */ - .word 0 /* 69: Reserved */ - .word OPA0_IRQHandler /* 70: OPA */ - .word CRYPTO_IRQHandler /* 71: CRYPTO */ - .word GPG_IRQHandler /* 72: GPG */ - .word EINT6_IRQHandler /* 73: EINT6 */ - .word UART4_IRQHandler /* 74: UART4 */ - .word UART5_IRQHandler /* 75: UART5 */ - .word USCI0_IRQHandler /* 76: USCI0 */ - .word USCI1_IRQHandler /* 77: USCI1 */ - .word BPWM0_IRQHandler /* 78: BPWM0 */ - .word BPWM1_IRQHandler /* 79: BPWM1 */ - .word SPIM_IRQHandler /* 80: SPIM */ - .word CCAP_IRQHandler /* 81: CCAP */ - .word I2C2_IRQHandler /* 82: I2C2 */ - .word 0 /* 83: Reserved */ - .word QEI0_IRQHandler /* 84: QEI0 */ - .word QEI1_IRQHandler /* 85: QEI1 */ - .word ECAP0_IRQHandler /* 86: ECAP0 */ - .word ECAP1_IRQHandler /* 87: ECAP1 */ - .word GPH_IRQHandler /* 88: GPH */ - .word EINT7_IRQHandler /* 89: EINT7 */ - .word SDH1_IRQHandler /* 90: SDH1 */ - .word 0 /* 91: Reserved */ - .word EHCI_IRQHandler /* 92: EHCI */ - .word USBOTG20_IRQHandler /* 93: HSOTG */ - .word 0 /* 94: Reserved */ - .word 0 /* 95: Reserved */ - .word 0 /* 96: Reserved */ - .word 0 /* 97: Reserved */ - .word 0 /* 98: Reserved */ - .word 0 /* 99: Reserved */ - .word 0 /* 100: Reserved */ - .word TRNG_IRQHandler /* 101: TRNG */ - .word UART6_IRQHandler /* 102: UART6 */ - .word UART7_IRQHandler /* 103: UART7 */ - .word EADC10_IRQHandler /* 104: EADC10 */ - .word EADC11_IRQHandler /* 105: EADC11 */ - .word EADC12_IRQHandler /* 106: EADC12 */ - .word EADC13_IRQHandler /* 107: EADC13 */ - .word CAN2_IRQHandler /* 108: CAN2 */ - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, Default_Handler - .endm - - def_irq_handler NMI_Handler - def_irq_handler HardFault_Handler - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SVC_Handler - def_irq_handler DebugMon_Handler - def_irq_handler PendSV_Handler - def_irq_handler SysTick_Handler - - def_irq_handler BOD_IRQHandler - def_irq_handler IRC_IRQHandler - def_irq_handler PWRWU_IRQHandler - def_irq_handler RAMPE_IRQHandler - def_irq_handler CKFAIL_IRQHandler - def_irq_handler RTC_IRQHandler - def_irq_handler TAMPER_IRQHandler - def_irq_handler WDT_IRQHandler - def_irq_handler WWDT_IRQHandler - def_irq_handler EINT0_IRQHandler - def_irq_handler EINT1_IRQHandler - def_irq_handler EINT2_IRQHandler - def_irq_handler EINT3_IRQHandler - def_irq_handler EINT4_IRQHandler - def_irq_handler EINT5_IRQHandler - def_irq_handler GPA_IRQHandler - def_irq_handler GPB_IRQHandler - def_irq_handler GPC_IRQHandler - def_irq_handler GPD_IRQHandler - def_irq_handler GPE_IRQHandler - def_irq_handler GPF_IRQHandler - def_irq_handler QSPI0_IRQHandler - def_irq_handler SPI0_IRQHandler - def_irq_handler BRAKE0_IRQHandler - def_irq_handler EPWM0P0_IRQHandler - def_irq_handler EPWM0P1_IRQHandler - def_irq_handler EPWM0P2_IRQHandler - def_irq_handler BRAKE1_IRQHandler - def_irq_handler EPWM1P0_IRQHandler - def_irq_handler EPWM1P1_IRQHandler - def_irq_handler EPWM1P2_IRQHandler - def_irq_handler TMR0_IRQHandler - def_irq_handler TMR1_IRQHandler - def_irq_handler TMR2_IRQHandler - def_irq_handler TMR3_IRQHandler - def_irq_handler UART0_IRQHandler - def_irq_handler UART1_IRQHandler - def_irq_handler I2C0_IRQHandler - def_irq_handler I2C1_IRQHandler - def_irq_handler PDMA_IRQHandler - def_irq_handler DAC_IRQHandler - def_irq_handler EADC00_IRQHandler - def_irq_handler EADC01_IRQHandler - def_irq_handler ACMP01_IRQHandler - def_irq_handler EADC02_IRQHandler - def_irq_handler EADC03_IRQHandler - def_irq_handler UART2_IRQHandler - def_irq_handler UART3_IRQHandler - def_irq_handler QSPI1_IRQHandler - def_irq_handler SPI1_IRQHandler - def_irq_handler SPI2_IRQHandler - def_irq_handler USBD_IRQHandler - def_irq_handler OHCI_IRQHandler - def_irq_handler USBOTG_IRQHandler - def_irq_handler CAN0_IRQHandler - def_irq_handler CAN1_IRQHandler - def_irq_handler SC0_IRQHandler - def_irq_handler SC1_IRQHandler - def_irq_handler SC2_IRQHandler - def_irq_handler SPI3_IRQHandler - def_irq_handler SDH0_IRQHandler - def_irq_handler USBD20_IRQHandler - def_irq_handler EMAC_TX_IRQHandler - def_irq_handler EMAC_RX_IRQHandler - def_irq_handler I2S0_IRQHandler - def_irq_handler OPA0_IRQHandler - def_irq_handler CRYPTO_IRQHandler - def_irq_handler GPG_IRQHandler - def_irq_handler EINT6_IRQHandler - def_irq_handler UART4_IRQHandler - def_irq_handler UART5_IRQHandler - def_irq_handler USCI0_IRQHandler - def_irq_handler USCI1_IRQHandler - def_irq_handler BPWM0_IRQHandler - def_irq_handler BPWM1_IRQHandler - def_irq_handler SPIM_IRQHandler - def_irq_handler CCAP_IRQHandler - def_irq_handler I2C2_IRQHandler - def_irq_handler QEI0_IRQHandler - def_irq_handler QEI1_IRQHandler - def_irq_handler ECAP0_IRQHandler - def_irq_handler ECAP1_IRQHandler - def_irq_handler GPH_IRQHandler - def_irq_handler EINT7_IRQHandler - def_irq_handler SDH1_IRQHandler - def_irq_handler EHCI_IRQHandler - def_irq_handler USBOTG20_IRQHandler - def_irq_handler TRNG_IRQHandler - def_irq_handler UART6_IRQHandler - def_irq_handler UART7_IRQHandler - def_irq_handler EADC10_IRQHandler - def_irq_handler EADC11_IRQHandler - def_irq_handler EADC12_IRQHandler - def_irq_handler EADC13_IRQHandler - def_irq_handler CAN2_IRQHandler diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/IAR/startup_M480.s b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/IAR/startup_M480.s deleted file mode 100644 index 9aa379a7584..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/IAR/startup_M480.s +++ /dev/null @@ -1,451 +0,0 @@ -;/****************************************************************************** -; * @file startup_M480.s -; * @version V1.00 -; * @brief CMSIS Cortex-M4 Core Device Startup File for M480 -; * -; * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. -;*****************************************************************************/ - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN HardFault_Handler - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler - DCD HardFault_Handler - DCD MemManage_Handler - DCD BusFault_Handler - DCD UsageFault_Handler -__vector_table_0x1c - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD SVC_Handler - DCD DebugMon_Handler - DCD 0 - DCD PendSV_Handler - DCD SysTick_Handler - - ; External Interrupts - DCD BOD_IRQHandler ; 0: Brown Out detection - DCD IRC_IRQHandler ; 1: Internal RC - DCD PWRWU_IRQHandler ; 2: Power down wake up - DCD RAMPE_IRQHandler ; 3: RAM parity error - DCD CKFAIL_IRQHandler ; 4: Clock detection fail - DCD Default_Handler ; 5: Reserved - DCD RTC_IRQHandler ; 6: Real Time Clock - DCD TAMPER_IRQHandler ; 7: Tamper detection - DCD WDT_IRQHandler ; 8: Watchdog timer - DCD WWDT_IRQHandler ; 9: Window watchdog timer - DCD EINT0_IRQHandler ; 10: External Input 0 - DCD EINT1_IRQHandler ; 11: External Input 1 - DCD EINT2_IRQHandler ; 12: External Input 2 - DCD EINT3_IRQHandler ; 13: External Input 3 - DCD EINT4_IRQHandler ; 14: External Input 4 - DCD EINT5_IRQHandler ; 15: External Input 5 - DCD GPA_IRQHandler ; 16: GPIO Port A - DCD GPB_IRQHandler ; 17: GPIO Port B - DCD GPC_IRQHandler ; 18: GPIO Port C - DCD GPD_IRQHandler ; 19: GPIO Port D - DCD GPE_IRQHandler ; 20: GPIO Port E - DCD GPF_IRQHandler ; 21: GPIO Port F - DCD QSPI0_IRQHandler ; 22: QSPI0 - DCD SPI0_IRQHandler ; 23: SPI0 - DCD BRAKE0_IRQHandler ; 24: - DCD PWM0P0_IRQHandler ; 25: - DCD PWM0P1_IRQHandler ; 26: - DCD PWM0P2_IRQHandler ; 27: - DCD BRAKE1_IRQHandler ; 28: - DCD PWM1P0_IRQHandler ; 29: - DCD PWM1P1_IRQHandler ; 30: - DCD PWM1P2_IRQHandler ; 31: - DCD TMR0_IRQHandler ; 32: Timer 0 - DCD TMR1_IRQHandler ; 33: Timer 1 - DCD TMR2_IRQHandler ; 34: Timer 2 - DCD TMR3_IRQHandler ; 35: Timer 3 - DCD UART0_IRQHandler ; 36: UART0 - DCD UART1_IRQHandler ; 37: UART1 - DCD I2C0_IRQHandler ; 38: I2C0 - DCD I2C1_IRQHandler ; 39: I2C1 - DCD PDMA_IRQHandler ; 40: Peripheral DMA - DCD DAC_IRQHandler ; 41: DAC - DCD EADC00_IRQHandler ; 42: EADC0 interrupt source 0 - DCD EADC01_IRQHandler ; 43: EADC0 interrupt source 1 - DCD ACMP01_IRQHandler ; 44: ACMP0 and ACMP1 - DCD Default_Handler ; 45: Reserved - DCD EADC02_IRQHandler ; 46: EADC0 interrupt source 2 - DCD EADC03_IRQHandler ; 47: EADC0 interrupt source 3 - DCD UART2_IRQHandler ; 48: UART2 - DCD UART3_IRQHandler ; 49: UART3 - DCD QSPI1_IRQHandler ; 50: QSPI1 - DCD SPI1_IRQHandler ; 51: SPI1 - DCD SPI2_IRQHandler ; 52: SPI2 - DCD USBD_IRQHandler ; 53: USB device - DCD OHCI_IRQHandler ; 54: OHCI - DCD USBOTG_IRQHandler ; 55: USB OTG - DCD CAN0_IRQHandler ; 56: CAN0 - DCD CAN1_IRQHandler ; 57: CAN1 - DCD SC0_IRQHandler ; 58: - DCD SC1_IRQHandler ; 59: - DCD SC2_IRQHandler ; 60: - DCD Default_Handler ; 61: - DCD SPI3_IRQHandler ; 62: SPI3 - DCD Default_Handler ; 63: - DCD SDH0_IRQHandler ; 64: SDH0 - DCD USBD20_IRQHandler ; 65: USBD20 - DCD EMAC_TX_IRQHandler ; 66: EMAC_TX - DCD EMAC_RX_IRQHandler ; 67: EMAX_RX - DCD I2S0_IRQHandler ; 68: I2S0 - DCD Default_Handler ; 69: ToDo: Add description to this Interrupt - DCD OPA0_IRQHandler ; 70: OPA0 - DCD CRYPTO_IRQHandler ; 71: CRYPTO - DCD GPG_IRQHandler ; 72: - DCD EINT6_IRQHandler ; 73: - DCD UART4_IRQHandler ; 74: UART4 - DCD UART5_IRQHandler ; 75: UART5 - DCD USCI0_IRQHandler ; 76: USCI0 - DCD USCI1_IRQHandler ; 77: USCI1 - DCD BPWM0_IRQHandler ; 78: BPWM0 - DCD BPWM1_IRQHandler ; 79: BPWM1 - DCD SPIM_IRQHandler ; 80: SPIM - DCD CCAP_IRQHandler ; 81: CCAP - DCD I2C2_IRQHandler ; 82: I2C2 - DCD Default_Handler ; 83: - DCD QEI0_IRQHandler ; 84: QEI0 - DCD QEI1_IRQHandler ; 85: QEI1 - DCD ECAP0_IRQHandler ; 86: ECAP0 - DCD ECAP1_IRQHandler ; 87: ECAP1 - DCD GPH_IRQHandler ; 88: - DCD EINT7_IRQHandler ; 89: - DCD SDH1_IRQHandler ; 90: SDH1 - DCD Default_Handler ; 91: - DCD EHCI_IRQHandler ; 92: EHCI - DCD USBOTG20_IRQHandler ; 93: - DCD Default_Handler ; 94: - DCD Default_Handler ; 95: - DCD Default_Handler ; 96: - DCD Default_Handler ; 97: - DCD Default_Handler ; 98: - DCD Default_Handler ; 99: - DCD Default_Handler ; 100: - DCD TRNG_IRQHandler ; 101: TRNG - DCD UART6_IRQHandler ; 102: UART6 - DCD UART7_IRQHandler ; 103: UART7 - DCD EADC10_IRQHandler ; 104: EADC1 interrupt source 0 - DCD EADC11_IRQHandler ; 105: EADC1 interrupt source 1 - DCD EADC12_IRQHandler ; 106: EADC1 interrupt source 2 - DCD EADC13_IRQHandler ; 107: EADC1 interrupt source 3 - DCD CAN2_IRQHandler ; 108: CAN2 -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - ; Unlock Register - LDR R0, =0x40000100 - LDR R1, =0x59 - STR R1, [R0] - LDR R1, =0x16 - STR R1, [R0] - LDR R1, =0x88 - STR R1, [R0] - - #ifndef ENABLE_SPIM_CACHE - LDR R0, =0x40000200 ; R0 = Clock Controller Register Base Address - LDR R1, [R0,#0x4] ; R1 = 0x40000204 (AHBCLK) - ORR R1, R1, #0x4000 - STR R1, [R0,#0x4] ; CLK->AHBCLK |= CLK_AHBCLK_SPIMCKEN_Msk; - - LDR R0, =0x40007000 ; R0 = SPIM Register Base Address - LDR R1, [R0,#4] ; R1 = SPIM->CTL1 - ORR R1, R1,#2 ; R1 |= SPIM_CTL1_CACHEOFF_Msk - STR R1, [R0,#4] ; _SPIM_DISABLE_CACHE() - LDR R1, [R0,#4] ; R1 = SPIM->CTL1 - ORR R1, R1, #4 ; R1 |= SPIM_CTL1_CCMEN_Msk - STR R1, [R0,#4] ; _SPIM_ENABLE_CCM() - #endif - - LDR R0, =SystemInit - BLX R0 - - ; Init POR - ; LDR R2, =0x40000024 - ; LDR R1, =0x00005AA5 - ; STR R1, [R2] - - ; Lock register - LDR R0, =0x40000100 - MOVS R1, #0 - STR R1, [R0] - - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B NMI_Handler - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B MemManage_Handler - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B BusFault_Handler - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B UsageFault_Handler - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B SVC_Handler - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B DebugMon_Handler - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B PendSV_Handler - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B SysTick_Handler - - PUBWEAK BOD_IRQHandler - PUBWEAK IRC_IRQHandler - PUBWEAK PWRWU_IRQHandler - PUBWEAK RAMPE_IRQHandler - PUBWEAK CKFAIL_IRQHandler - PUBWEAK RTC_IRQHandler - PUBWEAK TAMPER_IRQHandler - PUBWEAK WDT_IRQHandler - PUBWEAK WWDT_IRQHandler - PUBWEAK EINT0_IRQHandler - PUBWEAK EINT1_IRQHandler - PUBWEAK EINT2_IRQHandler - PUBWEAK EINT3_IRQHandler - PUBWEAK EINT4_IRQHandler - PUBWEAK EINT5_IRQHandler - PUBWEAK GPA_IRQHandler - PUBWEAK GPB_IRQHandler - PUBWEAK GPC_IRQHandler - PUBWEAK GPD_IRQHandler - PUBWEAK GPE_IRQHandler - PUBWEAK GPF_IRQHandler - PUBWEAK QSPI0_IRQHandler - PUBWEAK SPI0_IRQHandler - PUBWEAK BRAKE0_IRQHandler - PUBWEAK PWM0P0_IRQHandler - PUBWEAK PWM0P1_IRQHandler - PUBWEAK PWM0P2_IRQHandler - PUBWEAK BRAKE1_IRQHandler - PUBWEAK PWM1P0_IRQHandler - PUBWEAK PWM1P1_IRQHandler - PUBWEAK PWM1P2_IRQHandler - PUBWEAK TMR0_IRQHandler - PUBWEAK TMR1_IRQHandler - PUBWEAK TMR2_IRQHandler - PUBWEAK TMR3_IRQHandler - PUBWEAK UART0_IRQHandler - PUBWEAK UART1_IRQHandler - PUBWEAK I2C0_IRQHandler - PUBWEAK I2C1_IRQHandler - PUBWEAK PDMA_IRQHandler - PUBWEAK DAC_IRQHandler - PUBWEAK EADC00_IRQHandler - PUBWEAK EADC01_IRQHandler - PUBWEAK ACMP01_IRQHandler - PUBWEAK EADC02_IRQHandler - PUBWEAK EADC03_IRQHandler - PUBWEAK UART2_IRQHandler - PUBWEAK UART3_IRQHandler - PUBWEAK QSPI1_IRQHandler - PUBWEAK SPI1_IRQHandler - PUBWEAK SPI2_IRQHandler - PUBWEAK USBD_IRQHandler - PUBWEAK OHCI_IRQHandler - PUBWEAK USBOTG_IRQHandler - PUBWEAK CAN0_IRQHandler - PUBWEAK CAN1_IRQHandler - PUBWEAK SC0_IRQHandler - PUBWEAK SC1_IRQHandler - PUBWEAK SC2_IRQHandler - PUBWEAK SPI3_IRQHandler - PUBWEAK SDH0_IRQHandler - PUBWEAK USBD20_IRQHandler - PUBWEAK EMAC_TX_IRQHandler - PUBWEAK EMAC_RX_IRQHandler - PUBWEAK I2S0_IRQHandler - PUBWEAK OPA0_IRQHandler - PUBWEAK CRYPTO_IRQHandler - PUBWEAK GPG_IRQHandler - PUBWEAK EINT6_IRQHandler - PUBWEAK UART4_IRQHandler - PUBWEAK UART5_IRQHandler - PUBWEAK USCI0_IRQHandler - PUBWEAK USCI1_IRQHandler - PUBWEAK BPWM0_IRQHandler - PUBWEAK BPWM1_IRQHandler - PUBWEAK SPIM_IRQHandler - PUBWEAK CCAP_IRQHandler - PUBWEAK I2C2_IRQHandler - PUBWEAK QEI0_IRQHandler - PUBWEAK QEI1_IRQHandler - PUBWEAK ECAP0_IRQHandler - PUBWEAK ECAP1_IRQHandler - PUBWEAK GPH_IRQHandler - PUBWEAK EINT7_IRQHandler - PUBWEAK SDH1_IRQHandler - PUBWEAK EHCI_IRQHandler - PUBWEAK USBOTG20_IRQHandler - PUBWEAK TRNG_IRQHandler - PUBWEAK UART6_IRQHandler - PUBWEAK UART7_IRQHandler - PUBWEAK EADC10_IRQHandler - PUBWEAK EADC11_IRQHandler - PUBWEAK EADC12_IRQHandler - PUBWEAK EADC13_IRQHandler - PUBWEAK CAN2_IRQHandler - SECTION .text:CODE:REORDER:NOROOT(1) - -BOD_IRQHandler -IRC_IRQHandler -PWRWU_IRQHandler -RAMPE_IRQHandler -CKFAIL_IRQHandler -RTC_IRQHandler -TAMPER_IRQHandler -WDT_IRQHandler -WWDT_IRQHandler -EINT0_IRQHandler -EINT1_IRQHandler -EINT2_IRQHandler -EINT3_IRQHandler -EINT4_IRQHandler -EINT5_IRQHandler -GPA_IRQHandler -GPB_IRQHandler -GPC_IRQHandler -GPD_IRQHandler -GPE_IRQHandler -GPF_IRQHandler -QSPI0_IRQHandler -SPI0_IRQHandler -BRAKE0_IRQHandler -PWM0P0_IRQHandler -PWM0P1_IRQHandler -PWM0P2_IRQHandler -BRAKE1_IRQHandler -PWM1P0_IRQHandler -PWM1P1_IRQHandler -PWM1P2_IRQHandler -TMR0_IRQHandler -TMR1_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -UART0_IRQHandler -UART1_IRQHandler -I2C0_IRQHandler -I2C1_IRQHandler -PDMA_IRQHandler -DAC_IRQHandler -EADC00_IRQHandler -EADC01_IRQHandler -ACMP01_IRQHandler -EADC02_IRQHandler -EADC03_IRQHandler -UART2_IRQHandler -UART3_IRQHandler -QSPI1_IRQHandler -SPI1_IRQHandler -SPI2_IRQHandler -USBD_IRQHandler -OHCI_IRQHandler -USBOTG_IRQHandler -CAN0_IRQHandler -CAN1_IRQHandler -SC0_IRQHandler -SC1_IRQHandler -SC2_IRQHandler -SPI3_IRQHandler -SDH0_IRQHandler -USBD20_IRQHandler -EMAC_TX_IRQHandler -EMAC_RX_IRQHandler -I2S0_IRQHandler -OPA0_IRQHandler -CRYPTO_IRQHandler -GPG_IRQHandler -EINT6_IRQHandler -UART4_IRQHandler -UART5_IRQHandler -USCI0_IRQHandler -USCI1_IRQHandler -BPWM0_IRQHandler -BPWM1_IRQHandler -SPIM_IRQHandler -CCAP_IRQHandler -I2C2_IRQHandler -QEI0_IRQHandler -QEI1_IRQHandler -ECAP0_IRQHandler -ECAP1_IRQHandler -GPH_IRQHandler -EINT7_IRQHandler -SDH1_IRQHandler -EHCI_IRQHandler -USBOTG20_IRQHandler -TRNG_IRQHandler -UART6_IRQHandler -UART7_IRQHandler -EADC10_IRQHandler -EADC11_IRQHandler -EADC12_IRQHandler -EADC13_IRQHandler -CAN2_IRQHandler -Default_Handler - B Default_Handler - - - - - END -;/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/system_M480.c b/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/system_M480.c deleted file mode 100644 index 76573a4a3e4..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/Nuvoton/M480/Source/system_M480.c +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************//** - * @file system_M480.c - * @version V1.000 - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Source File for M480 - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - - -/*---------------------------------------------------------------------------- - DEFINES - *----------------------------------------------------------------------------*/ - - -/*---------------------------------------------------------------------------- - Clock Variable definitions - *----------------------------------------------------------------------------*/ -uint32_t SystemCoreClock = __SYSTEM_CLOCK; /*!< System Clock Frequency (Core Clock)*/ -uint32_t CyclesPerUs = (__HSI / 1000000UL); /* Cycles per micro second */ -uint32_t PllClock = __HSI; /*!< PLL Output Clock Frequency */ -uint32_t gau32ClkSrcTbl[] = {__HXT, __LXT, 0UL, __LIRC, 0UL, 0UL, 0UL, __HIRC}; - -/*---------------------------------------------------------------------------- - Clock functions - *----------------------------------------------------------------------------*/ -void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */ -{ - uint32_t u32Freq, u32ClkSrc; - uint32_t u32HclkDiv; - - /* Update PLL Clock */ - PllClock = CLK_GetPLLClockFreq(); - - u32ClkSrc = CLK->CLKSEL0 & CLK_CLKSEL0_HCLKSEL_Msk; - - if(u32ClkSrc == CLK_CLKSEL0_HCLKSEL_PLL) - { - /* Use PLL clock */ - u32Freq = PllClock; - } - else - { - /* Use the clock sources directly */ - u32Freq = gau32ClkSrcTbl[u32ClkSrc]; - } - - u32HclkDiv = (CLK->CLKDIV0 & CLK_CLKDIV0_HCLKDIV_Msk) + 1UL; - - /* Update System Core Clock */ - SystemCoreClock = u32Freq / u32HclkDiv; - - - //if(SystemCoreClock == 0) - // __BKPT(0); - - CyclesPerUs = (SystemCoreClock + 500000UL) / 1000000UL; -} - -/** - * @brief Set PF.2 and PF.3 to input mode - * @param None - * @return None - * @details GPIO default state could be configured as input or quasi through user config. - * To use HXT, PF.2 and PF.3 must not set as quasi mode. This function changes - * PF.2 and PF.3 to input mode no matter which mode they are working at. - */ -static __INLINE void HXTInit(void) -{ - PF->MODE &= ~(GPIO_MODE_MODE2_Msk | GPIO_MODE_MODE3_Msk); - -} - -/** - * @brief Initialize the System - * - * @param none - * @return none - */ -void SystemInit (void) -{ - /* Add your system initialize code here. - Do not use global variables because this function is called before - reaching pre-main. RW section maybe overwritten afterwards. */ - - - /* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - SCB->CPACR |= ((3UL << 10*2) | /* set CP10 Full Access */ - (3UL << 11*2) ); /* set CP11 Full Access */ -#endif - - /* Set access cycle for CPU @ 192MHz */ - FMC->CYCCTL = (FMC->CYCCTL & ~FMC_CYCCTL_CYCLE_Msk) | (8 << FMC_CYCCTL_CYCLE_Pos); - /* Configure power down bias, must set 1 before entering power down mode. - So set it at the very beginning */ - CLK->LDOCTL |= CLK_LDOCTL_PDBIASEN_Msk; - /* Hand over the control of PF.4~11 I/O function from RTC module to GPIO module */ - CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk; - RTC->GPIOCTL0 &= ~(RTC_GPIOCTL0_CTLSEL0_Msk | RTC_GPIOCTL0_CTLSEL1_Msk | - RTC_GPIOCTL0_CTLSEL2_Msk | RTC_GPIOCTL0_CTLSEL3_Msk); - RTC->GPIOCTL1 &= ~(RTC_GPIOCTL1_CTLSEL4_Msk | RTC_GPIOCTL1_CTLSEL5_Msk | - RTC_GPIOCTL1_CTLSEL6_Msk | RTC_GPIOCTL1_CTLSEL7_Msk); - CLK->APBCLK0 &= ~CLK_APBCLK0_RTCCKEN_Msk; - HXTInit(); - -} -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/Device/SConscript b/bsp/nuvoton/libraries/m480/Device/SConscript deleted file mode 100644 index df9500d0628..00000000000 --- a/bsp/nuvoton/libraries/m480/Device/SConscript +++ /dev/null @@ -1,25 +0,0 @@ -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(""" -Nuvoton/M480/Source/system_M480.c -""") - -# add for startup script -if rtconfig.PLATFORM in ['gcc']: - src = src + ['Nuvoton/M480/Source/GCC/startup_M480.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src = src + ['Nuvoton/M480/Source/ARM/startup_M480.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src = src + ['Nuvoton/M480/Source/IAR/startup_M480.s'] - -path = [cwd + '/Nuvoton/M480/Include',] - -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/m480/StdDriver/SConscript b/bsp/nuvoton/libraries/m480/StdDriver/SConscript deleted file mode 100644 index b8c471cad1a..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/SConscript +++ /dev/null @@ -1,28 +0,0 @@ -# RT-Thread building script for component -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -libs = [] -src = Glob('*src/*.c') + Glob('src/*.cpp') -cpppath = [cwd + '/inc'] -libpath = [cwd + '/lib'] - -if not GetDepend('BSP_USE_STDDRIVER_SOURCE'): - if rtconfig.PLATFORM in ['armcc', 'armclang']: - if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'): - libs += ['libstddriver_keil'] - elif GetOption('target') == 'mdk4' and os.path.isfile('./lib/libstddriver_keil4.lib'): - libs += ['libstddriver_keil4'] - elif rtconfig.PLATFORM in ['gcc'] and os.path.isfile('./lib/libstddriver_gcc.a'): - libs += ['libstddriver_gcc'] - elif os.path.isfile('./lib/libstddriver_iar.a'): - libs += ['libstddriver_iar'] - -if not libs: - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath) -else: - src = [] - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath) - -Return('group') diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_acmp.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_acmp.h deleted file mode 100644 index 23db060037d..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_acmp.h +++ /dev/null @@ -1,415 +0,0 @@ -/**************************************************************************//** - * @file ACMP.h - * @version V1.00 - * @brief M480 Series ACMP Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_ACMP_H__ -#define __NU_ACMP_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_CONSTANTS ACMP Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_CTL_FILTSEL_OFF (0UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for filter function disabled. \hideinitializer */ -#define ACMP_CTL_FILTSEL_1PCLK (1UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 1 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_2PCLK (2UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 2 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_4PCLK (3UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 4 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_8PCLK (4UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 8 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_16PCLK (5UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 16 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_32PCLK (6UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 32 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_FILTSEL_64PCLK (7UL << ACMP_CTL_FILTSEL_Pos) /*!< ACMP_CTL setting for 64 PCLK filter count. \hideinitializer */ -#define ACMP_CTL_INTPOL_RF (0UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting rising edge and falling edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_INTPOL_R (1UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting rising edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_INTPOL_F (2UL << ACMP_CTL_INTPOL_Pos) /*!< ACMP_CTL setting for selecting falling edge as interrupt condition. \hideinitializer */ -#define ACMP_CTL_POSSEL_P0 (0UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P0 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P1 (1UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P1 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P2 (2UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P2 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_POSSEL_P3 (3UL << ACMP_CTL_POSSEL_Pos) /*!< ACMP_CTL setting for selecting ACMPx_P3 pin as the source of ACMP V+. \hideinitializer */ -#define ACMP_CTL_NEGSEL_PIN (0UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting the voltage of ACMP negative input pin as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_CRV (1UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting internal comparator reference voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_VBG (2UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting internal Band-gap voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_NEGSEL_DAC (3UL << ACMP_CTL_NEGSEL_Pos) /*!< ACMP_CTL setting for selecting DAC output voltage as the source of ACMP V-. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_30MV (3UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for enabling the hysteresis function at 30mV. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_20MV (2UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for enabling the hysteresis function at 20mV. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_10MV (1UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for enabling the hysteresis function at 10mV. \hideinitializer */ -#define ACMP_CTL_HYSTERESIS_DISABLE (0UL << ACMP_CTL_HYSSEL_Pos) /*!< ACMP_CTL setting for disabling the hysteresis function. \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ACMP_VREF constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ACMP_VREF_CRVSSEL_VDDA (0UL << ACMP_VREF_CRVSSEL_Pos) /*!< ACMP_VREF setting for selecting analog supply voltage VDDA as the CRV source voltage \hideinitializer */ -#define ACMP_VREF_CRVSSEL_INTVREF (1UL << ACMP_VREF_CRVSSEL_Pos) /*!< ACMP_VREF setting for selecting internal reference voltage as the CRV source voltage \hideinitializer */ - - -/*@}*/ /* end of group ACMP_EXPORTED_CONSTANTS */ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPOINV bit of ACMP_CTL register to enable output inverse function. - * \hideinitializer - */ -#define ACMP_ENABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to disable output inverse function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPOINV bit of ACMP_CTL register to disable output inverse function. - * \hideinitializer - */ -#define ACMP_DISABLE_OUTPUT_INVERSE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPOINV_Msk) - -/** - * @brief This macro is used to select ACMP negative input source - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Src is comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * - \ref ACMP_CTL_NEGSEL_DAC - * @return None - * @details This macro will set NEGSEL (ACMP_CTL[5:4]) to determine the source of negative input. - * \hideinitializer - */ -#define ACMP_SET_NEG_SRC(acmp, u32ChNum, u32Src) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_NEGSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to enable hysteresis function and set hysteresis to 30mV - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * \hideinitializer - */ -#define ACMP_ENABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_HYSTERESIS_30MV) - -/** - * @brief This macro is used to disable hysteresis function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear HYSEL bits of ACMP_CTL register to disable hysteresis function. - * \hideinitializer - */ -#define ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_HYSSEL_Msk) - -/** - * @brief This macro is used to select hysteresis level - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32HysSel The hysteresis function option. Including: - * - \ref ACMP_CTL_HYSTERESIS_30MV - * - \ref ACMP_CTL_HYSTERESIS_20MV - * - \ref ACMP_CTL_HYSTERESIS_10MV - * - \ref ACMP_CTL_HYSTERESIS_DISABLE - * \hideinitializer - * @return None - */ -#define ACMP_CONFIG_HYSTERESIS(acmp, u32ChNum, u32HysSel) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_HYSSEL_Msk) | (u32HysSel)) - -/** - * @brief This macro is used to enable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPIE bit of ACMP_CTL register to enable interrupt function. - * If wake-up function is enabled, the wake-up interrupt will be enabled as well. - * \hideinitializer - */ -#define ACMP_ENABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to disable interrupt - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPIE bit of ACMP_CTL register to disable interrupt function. - * \hideinitializer - */ -#define ACMP_DISABLE_INT(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPIE_Msk) - -/** - * @brief This macro is used to enable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set ACMPEN bit of ACMP_CTL register to enable analog comparator. - * \hideinitializer - */ -#define ACMP_ENABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to disable ACMP - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - * \hideinitializer - */ -#define ACMP_DISABLE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_ACMPEN_Msk) - -/** - * @brief This macro is used to get ACMP output value - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP output value - * @details This macro will return the ACMP output value. - * \hideinitializer - */ -#define ACMP_GET_OUTPUT(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPO0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to get ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return ACMP interrupt occurred (1) or not (0) - * @details This macro will return the ACMP interrupt flag. - * \hideinitializer - */ -#define ACMP_GET_INT_FLAG(acmp, u32ChNum) (((acmp)->STATUS & (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum))))?1:0) - -/** - * @brief This macro is used to clear ACMP interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to ACMPIFn bit of ACMP_STATUS register to clear interrupt flag. - * \hideinitializer - */ -#define ACMP_CLR_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_ACMPIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to clear ACMP wake-up interrupt flag - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will write 1 to WKIFn bit of ACMP_STATUS register to clear interrupt flag. - * \hideinitializer - */ -#define ACMP_CLR_WAKEUP_INT_FLAG(acmp, u32ChNum) ((acmp)->STATUS = (ACMP_STATUS_WKIF0_Msk<<((u32ChNum)))) - -/** - * @brief This macro is used to enable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WKEN (ACMP_CTL[16]) to enable ACMP wake-up function. - * \hideinitializer - */ -#define ACMP_ENABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable ACMP wake-up function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WKEN (ACMP_CTL[16]) to disable ACMP wake-up function. - * \hideinitializer - */ -#define ACMP_DISABLE_WAKEUP(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WKEN_Msk) - -/** - * @brief This macro is used to select ACMP positive input pin - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Pin Comparator positive pin selection. Including: - * - \ref ACMP_CTL_POSSEL_P0 - * - \ref ACMP_CTL_POSSEL_P1 - * - \ref ACMP_CTL_POSSEL_P2 - * - \ref ACMP_CTL_POSSEL_P3 - * @return None - * @details This macro will set POSSEL (ACMP_CTL[7:6]) to determine the comparator positive input pin. - * \hideinitializer - */ -#define ACMP_SELECT_P(acmp, u32ChNum, u32Pin) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_POSSEL_Msk) | (u32Pin)) - -/** - * @brief This macro is used to enable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set OUTSEL (ACMP_CTL[12]) to enable output filter function. - * \hideinitializer - */ -#define ACMP_ENABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to disable ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear OUTSEL (ACMP_CTL[12]) to disable output filter function. - * \hideinitializer - */ -#define ACMP_DISABLE_FILTER(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_OUTSEL_Msk) - -/** - * @brief This macro is used to set ACMP filter function - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cnt is comparator filter count setting. - * - \ref ACMP_CTL_FILTSEL_OFF - * - \ref ACMP_CTL_FILTSEL_1PCLK - * - \ref ACMP_CTL_FILTSEL_2PCLK - * - \ref ACMP_CTL_FILTSEL_4PCLK - * - \ref ACMP_CTL_FILTSEL_8PCLK - * - \ref ACMP_CTL_FILTSEL_16PCLK - * - \ref ACMP_CTL_FILTSEL_32PCLK - * - \ref ACMP_CTL_FILTSEL_64PCLK - * @return None - * @details When ACMP output filter function is enabled, the output sampling count is determined by FILTSEL (ACMP_CTL[15:13]). - * \hideinitializer - */ -#define ACMP_SET_FILTER(acmp, u32ChNum, u32Cnt) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_FILTSEL_Msk) | (u32Cnt)) - -/** - * @brief This macro is used to select comparator reference voltage - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32Level The comparator reference voltage setting. - * The formula is: - * comparator reference voltage = CRV source voltage x (1/6 + u32Level/24) - * The range of u32Level is 0 ~ 15. - * @return None - * @details When CRV is selected as ACMP negative input source, the CRV level is determined by CRVCTL (ACMP_VREF[3:0]). - * \hideinitializer - */ -#define ACMP_CRV_SEL(acmp, u32Level) ((acmp)->VREF = ((acmp)->VREF & ~ACMP_VREF_CRVCTL_Msk) | ((u32Level)<VREF = ((acmp)->VREF & ~ACMP_VREF_CRVSSEL_Msk) | (u32Src)) - -/** - * @brief This macro is used to select ACMP interrupt condition - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @param[in] u32Cond Comparator interrupt condition selection. Including: - * - \ref ACMP_CTL_INTPOL_RF - * - \ref ACMP_CTL_INTPOL_R - * - \ref ACMP_CTL_INTPOL_F - * @return None - * @details The ACMP output interrupt condition can be rising edge, falling edge or any edge. - * \hideinitializer - */ -#define ACMP_SELECT_INT_COND(acmp, u32ChNum, u32Cond) ((acmp)->CTL[(u32ChNum)] = ((acmp)->CTL[(u32ChNum)] & ~ACMP_CTL_INTPOL_Msk) | (u32Cond)) - -/** - * @brief This macro is used to enable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WLATEN (ACMP_CTL[17]) to enable ACMP window latch mode. - * When ACMP0/1_WLAT pin is at high level, ACMPO0/1 passes through window latch - * block; when ACMP0/1_WLAT pin is at low level, the output of window latch block, - * WLATOUT, is frozen. - * \hideinitializer - */ -#define ACMP_ENABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to disable ACMP window latch mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WLATEN (ACMP_CTL[17]) to disable ACMP window latch mode. - * \hideinitializer - */ -#define ACMP_DISABLE_WINDOW_LATCH(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WLATEN_Msk) - -/** - * @brief This macro is used to enable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will set WCMPSEL (ACMP_CTL[18]) to enable ACMP window compare mode. - * When window compare mode is enabled, user can connect the specific analog voltage - * source to either the positive inputs of both comparators or the negative inputs of - * both comparators. The upper bound and lower bound of the designated range are - * determined by the voltages applied to the other inputs of both comparators. If the - * output of a comparator is low and the other comparator outputs high, which means two - * comparators implies the upper and lower bound. User can directly monitor a specific - * analog voltage source via ACMPWO (ACMP_STATUS[16]). - * \hideinitializer - */ -#define ACMP_ENABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] |= ACMP_CTL_WCMPSEL_Msk) - -/** - * @brief This macro is used to disable ACMP window compare mode - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum The ACMP number - * @return None - * @details This macro will clear WCMPSEL (ACMP_CTL[18]) to disable ACMP window compare mode. - * \hideinitializer - */ -#define ACMP_DISABLE_WINDOW_COMPARE(acmp, u32ChNum) ((acmp)->CTL[(u32ChNum)] &= ~ACMP_CTL_WCMPSEL_Msk) - - - - -/* Function prototype declaration */ -void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel); -void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum); - - - -/*@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ACMP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - - -#endif /* __NU_ACMP_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_bpwm.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_bpwm.h deleted file mode 100644 index 04e65f601a5..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_bpwm.h +++ /dev/null @@ -1,361 +0,0 @@ -/**************************************************************************//** - * @file nu_bpwm.h - * @version V1.00 - * @brief M480 series PWM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_BPWM_H__ -#define __NU_BPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - -/** @addtogroup BPWM_EXPORTED_CONSTANTS BPWM Exported Constants - @{ -*/ -#define BPWM_CHANNEL_NUM (6) /*!< BPWM channel number \hideinitializer */ -#define BPWM_CH_0_MASK (0x1UL) /*!< BPWM channel 0 mask \hideinitializer */ -#define BPWM_CH_1_MASK (0x2UL) /*!< BPWM channel 1 mask \hideinitializer */ -#define BPWM_CH_2_MASK (0x4UL) /*!< BPWM channel 2 mask \hideinitializer */ -#define BPWM_CH_3_MASK (0x8UL) /*!< BPWM channel 3 mask \hideinitializer */ -#define BPWM_CH_4_MASK (0x10UL) /*!< BPWM channel 4 mask \hideinitializer */ -#define BPWM_CH_5_MASK (0x20UL) /*!< BPWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_UP_COUNTER (0UL) /*!< Up counter type \hideinitializer */ -#define BPWM_DOWN_COUNTER (1UL) /*!< Down counter type \hideinitializer */ -#define BPWM_UP_DOWN_COUNTER (2UL) /*!< Up-Down counter type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_EDGE_ALIGNED (1UL) /*!< BPWM working in edge aligned type(down count) \hideinitializer */ -#define BPWM_CENTER_ALIGNED (2UL) /*!< BPWM working in center aligned type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_OUTPUT_NOTHING (0UL) /*!< BPWM output nothing \hideinitializer */ -#define BPWM_OUTPUT_LOW (1UL) /*!< BPWM output low \hideinitializer */ -#define BPWM_OUTPUT_HIGH (2UL) /*!< BPWM output high \hideinitializer */ -#define BPWM_OUTPUT_TOGGLE (3UL) /*!< BPWM output toggle \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define BPWM_SSCTL_SSRC_PWM0 (0UL<SSCTL = ((bpwm)->SSCTL & ~BPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_DISABLE_TIMER_SYNC(bpwm, u32ChannelMask) ((bpwm)->SSCTL &= ~BPWM_SSCTL_SSEN0_Msk) - -/** - * @brief This macro enable BPWM counter synchronous start counting function. - * @param[in] bpwm The pointer of the specified BPWM module - * @return None - * @details This macro is used to make selected BPWM0 and BPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by BPWM_ENABLE_TIMER_SYNC() and BPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define BPWM_TRIGGER_SYNC_START(bpwm) ((bpwm)->SSTRG = BPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * \hideinitializer - */ -#define BPWM_ENABLE_OUTPUT_INVERTER(bpwm, u32ChannelMask) ((bpwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_RISING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CAPTURE_FALLING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define BPWM_MASK_OUTPUT(bpwm, u32ChannelMask, u32LevelMask) \ - { \ - (bpwm)->MSKEN = (u32ChannelMask); \ - (bpwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 1 ~ 0xFFF - * @return None - * \hideinitializer - */ -#define BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescaler) ((bpwm)->CLKPSC = (u32Prescaler)) - -/** - * @brief This macro set the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Duty of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * \hideinitializer - */ -#define BPWM_SET_CMR(bpwm, u32ChannelNum, u32CMR) ((bpwm)->CMPDAT[(u32ChannelNum)] = (u32CMR)) - -/** - * @brief This macro get the duty of the selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * \hideinitializer - */ -#define BPWM_GET_CMR(bpwm, u32ChannelNum) ((bpwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @note This new setting will take effect on next BPWM period - * @note BPWM counter will stop if period length set to 0 - * \hideinitializer - */ -#define BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR) ((bpwm)->PERIOD = (u32CNR)) - -/** - * @brief This macro get the period of all channels - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * \hideinitializer - */ -#define BPWM_GET_CNR(bpwm, u32ChannelNum) ((bpwm)->PERIOD) - -/** - * @brief This macro set the BPWM aligned type - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @param[in] u32AlignedType BPWM aligned type, valid values are: - * - \ref BPWM_EDGE_ALIGNED - * - \ref BPWM_CENTER_ALIGNED - * @return None - * @note All channels share channel 0's setting. - * \hideinitializer - */ -#define BPWM_SET_ALIGNED_TYPE(bpwm, u32ChannelMask, u32AlignedType) ((bpwm)->CTL1 = (u32AlignedType)) - -/** - * @brief Clear counter of channel 0 - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This macro is used to clear counter of channel 0 - * \hideinitializer - */ -#define BPWM_CLR_COUNTER(bpwm, u32ChannelMask) ((bpwm)->CNTCLR = (BPWM_CNTCLR_CNTCLR0_Msk)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref BPWM_OUTPUT_NOTHING - * - \ref BPWM_OUTPUT_LOW - * - \ref BPWM_OUTPUT_HIGH - * - \ref BPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * \hideinitializer - */ -#define BPWM_SET_OUTPUT_LEVEL(bpwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) { \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (2 * i))) | ((u32ZeroLevel) << (2 * i))); \ - (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (BPWM_WGCTL0_PRDPCTLn_Pos + (2 * i)))) | ((u32PeriodLevel) << (BPWM_WGCTL0_PRDPCTLn_Pos + (2 * i)))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (2 * i))) | ((u32CmpUpLevel) << (2 * i))); \ - (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (BPWM_WGCTL1_CMPDCTLn_Pos + (2 * i)))) | ((u32CmpDownLevel) << (BPWM_WGCTL1_CMPDCTLn_Pos + (2 * i)))); \ - } \ - } \ - }while(0) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define BPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask); -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum); - - -/*@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_BPWM_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_can.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_can.h deleted file mode 100644 index cfc1c1fd163..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_can.h +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************//** - * @file nu_can.h - * @version V2.00 - * @brief M480 Series CAN Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CAN_H__ -#define __NU_CAN_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CAN_Driver CAN Driver - @{ -*/ - -/** @addtogroup CAN_EXPORTED_CONSTANTS CAN Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* CAN Test Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAN_NORMAL_MODE 0ul /*!< CAN select normal mode \hideinitializer */ -#define CAN_BASIC_MODE 1ul /*!< CAN select basic mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Message ID Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAN_STD_ID 0ul /*!< CAN select standard ID \hideinitializer */ -#define CAN_EXT_ID 1ul /*!< CAN select extended ID \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Message Frame Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAN_REMOTE_FRAME 0ul /*!< CAN frame select remote frame \hideinitializer */ -#define CAN_DATA_FRAME 1ul /*!< CAN frame select data frame \hideinitializer */ - -/*@}*/ /* end of group CAN_EXPORTED_CONSTANTS */ - - -/** @addtogroup CAN_EXPORTED_STRUCTS CAN Exported Structs - @{ -*/ -/** - * @details CAN message structure - */ -typedef struct -{ - uint32_t IdType; /*!< ID type */ - uint32_t FrameType; /*!< Frame type */ - uint32_t Id; /*!< Message ID */ - uint8_t DLC; /*!< Data length */ - uint8_t Data[8]; /*!< Data */ -} STR_CANMSG_T; - -/** - * @details CAN mask message structure - */ -typedef struct -{ - uint8_t u8Xtd; /*!< Extended ID */ - uint8_t u8Dir; /*!< Direction */ - uint32_t u32Id; /*!< Message ID */ - uint8_t u8IdType; /*!< ID type*/ -} STR_CANMASK_T; - -/*@}*/ /* end of group CAN_EXPORTED_STRUCTS */ - -/** @cond HIDDEN_SYMBOLS */ -#define MSG(id) (id) -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup CAN_EXPORTED_FUNCTIONS CAN Exported Functions - @{ -*/ - -/** - * @brief Get interrupt status. - * - * @param[in] can The base address of can module. - * - * @return CAN module status register value. - * - * @details Status Interrupt is generated by bits BOff (CAN_STATUS[7]), EWarn (CAN_STATUS[6]), - * EPass (CAN_STATUS[5]), RxOk (CAN_STATUS[4]), TxOk (CAN_STATUS[3]), and LEC (CAN_STATUS[2:0]). - * \hideinitializer - */ -#define CAN_GET_INT_STATUS(can) ((can)->STATUS) - -/** - * @brief Get specified interrupt pending status. - * - * @param[in] can The base address of can module. - * - * @return The source of the interrupt. - * - * @details If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt - * with the highest priority, disregarding their chronological order. - * \hideinitializer - */ -#define CAN_GET_INT_PENDING_STATUS(can) ((can)->IIDR) - -/** - * @brief Disable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details The macro is used to disable wake-up function. - * \hideinitializer - */ -#define CAN_DISABLE_WAKEUP(can) ((can)->WU_EN = 0ul) - -/** - * @brief Enable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details User can wake-up system when there is a falling edge in the CAN_Rx pin. - * \hideinitializer - */ -#define CAN_ENABLE_WAKEUP(can) ((can)->WU_EN = CAN_WU_EN_WAKUP_EN_Msk) - -/** - * @brief Get specified Message Object new data into bit value. - * - * @param[in] can The base address of can module. - * @param[in] u32MsgNum Specified Message Object number, valid value are from 0 to 31. - * - * @return Specified Message Object new data into bit value. - * - * @details The NewDat bit (CAN_IFn_MCON[15]) of a specific Message Object can be set/reset by the software through the IFn Message Interface Registers - * or by the Message Handler after reception of a Data Frame or after a successful transmission. - * \hideinitializer - */ -#define CAN_GET_NEW_DATA_IN_BIT(can, u32MsgNum) ((u32MsgNum) < 16 ? (can)->NDAT1 & (1 << (u32MsgNum)) : (can)->NDAT2 & (1 << ((u32MsgNum)-16))) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define CAN functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate); -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode); -void CAN_Close(CAN_T *tCAN); -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum); -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask); -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask); -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg); -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg); -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask); -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg); -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum); -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg); -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg); -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask); -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask); -void CAN_LeaveTestMode(CAN_T *tCAN); -uint32_t CAN_GetCANBitRate(CAN_T *tCAN); -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj); -void CAN_LeaveInitMode(CAN_T *tCAN); -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast); -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast); -void CAN_WaitMsg(CAN_T *tCAN); -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T* pCanMsg); - -/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CAN_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_CAN_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ccap.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ccap.h deleted file mode 100644 index a7927f36b71..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ccap.h +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************//** - * @file nu_ccap.h - * @version V1.00 - * @brief M480 Series CCAP Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CCAP_H__ -#define __NU_CCAP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CCAP_Driver CCAP Driver - @{ -*/ - -/** @addtogroup CCAP_EXPORTED_CONSTANTS CCAP Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CCAP_CTL_CCAPEN (1ul<CTL & CCAP_CTL_CCAPEN_Msk)?0:1) - -/** - * @brief Clear CCAP flag - * - * @param[in] u32IntMask interrupt flags settings. It could be - * - \ref CCAP_INT_VINTF_Msk - * - \ref CCAP_INT_MEINTF_Msk - * - \ref CCAP_INT_ADDRMINTF_Msk - * - \ref CCAP_INT_MDINTF_Msk - * - * @return TRUE(Enable) or FALSE(Disable) - * - * @details Clear Image Capture Interface interrupt flag - * \hideinitializer - */ -#define CCAP_CLR_INT_FLAG(u32IntMask) (CCAP->INT |=u32IntMask) - -/** - * @brief Get CCAP Interrupt status - * - * @return TRUE(Enable) or FALSE(Disable) - * - * @details Get Image Capture Interface interrupt status. - * \hideinitializer - */ -#define CCAP_GET_INT_STS() (CCAP->INT) - -void CCAP_Open(uint32_t u32InFormat, uint32_t u32OutFormet); -void CCAP_SetCroppingWindow(uint32_t u32VStart,uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width); -void CCAP_SetPacketBuf(uint32_t u32Address ); -void CCAP_Close(void); -void CCAP_EnableInt(uint32_t u32IntMask); -void CCAP_DisableInt(uint32_t u32IntMask); -void CCAP_Start(void); -void CCAP_Stop(uint32_t u32FrameComplete); -void CCAP_SetPacketScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator); -void CCAP_SetPacketStride(uint32_t u32Stride ); -void CCAP_EnableMono(uint32_t u32Interface); -void CCAP_DisableMono(void); -void CCAP_EnableLumaYOne(uint32_t u32th); -void CCAP_DisableLumaYOne(void); - -/*@}*/ /* end of group CCAP_EXPORTED_FUNCTIONS */ - - - -/*@}*/ /* end of group CCAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_CCAP_H__ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_clk.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_clk.h deleted file mode 100644 index a95a3f36189..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_clk.h +++ /dev/null @@ -1,714 +0,0 @@ -/**************************************************************************//** - * @file CLK.h - * @version V1.0 - * @brief M480 Series CLK Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CLK_H__ -#define __NU_CLK_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_CONSTANTS CLK Exported Constants - @{ -*/ - - -#define FREQ_25MHZ 25000000UL /*!< 25 MHz \hideinitializer */ -#define FREQ_50MHZ 50000000UL /*!< 50 MHz \hideinitializer */ -#define FREQ_72MHZ 72000000UL /*!< 72 MHz \hideinitializer */ -#define FREQ_80MHZ 80000000UL /*!< 80 MHz \hideinitializer */ -#define FREQ_100MHZ 100000000UL /*!< 100 MHz \hideinitializer */ -#define FREQ_125MHZ 125000000UL /*!< 125 MHz \hideinitializer */ -#define FREQ_160MHZ 160000000UL /*!< 160 MHz \hideinitializer */ -#define FREQ_192MHZ 192000000UL /*!< 192 MHz \hideinitializer */ -#define FREQ_200MHZ 200000000UL /*!< 200 MHz \hideinitializer */ -#define FREQ_250MHZ 250000000UL /*!< 250 MHz \hideinitializer */ -#define FREQ_500MHZ 500000000UL /*!< 500 MHz \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL0 constant definitions. (Write-protection) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL0_HCLKSEL_HXT (0x0UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_LXT (0x1UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_PLL (0x2UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from PLL \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_LIRC (0x3UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL0_HCLKSEL_HIRC (0x7UL << CLK_CLKSEL0_HCLKSEL_Pos) /*!< Select HCLK clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL0_STCLKSEL_HXT (0x0UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_LXT (0x1UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HXT_DIV2 (0x2UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from HXT/2 \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 (0x3UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from HCLK/2 \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 (0x7UL << CLK_CLKSEL0_STCLKSEL_Pos) /*!< Select SysTick clock source from HIRC/2 \hideinitializer */ -#define CLK_CLKSEL0_STCLKSEL_HCLK (0x01UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< Select SysTick clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_CCAPSEL_HXT (0x0UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from HXT \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_PLL (0x1UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from PLL \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_HCLK (0x2UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_HIRC (0x3UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from HIRC \hideinitializer */ - - -#if(0) -#define CLK_CLKSEL0_PCLK0DIV1 (0x0UL << CLK_CLKSEL0_PCLK0SEL_Pos) /*!< Select PCLK0 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_PCLK0DIV2 (0x1UL << CLK_CLKSEL0_PCLK0SEL_Pos) /*!< Select PCLK0 clock source from 1/2 HCLK \hideinitializer */ - -#define CLK_CLKSEL0_PCLK1DIV1 (0x0UL << CLK_CLKSEL0_PCLK1SEL_Pos) /*!< Select PCLK1 clock source from HCLK \hideinitializer */ -#define CLK_CLKSEL0_PCLK1DIV2 (0x1UL << CLK_CLKSEL0_PCLK1SEL_Pos) /*!< Select PCLK1 clock source from 1/2 HCLK \hideinitializer */ -#endif - -#define CLK_CLKSEL0_CCAPSEL_HXT (0x0UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_PLL (0x1UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from PLL \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_HIRC (0x3UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL0_CCAPSEL_HCLK (0x2UL << CLK_CLKSEL0_CCAPSEL_Pos) /*!< Select CCAP clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_SDH0SEL_HXT (0x0UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_SDH0SEL_PLL (0x1UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL0_SDH0SEL_HIRC (0x3UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL0_SDH0SEL_HCLK (0x2UL << CLK_CLKSEL0_SDH0SEL_Pos) /*!< Select SDH0 clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_SDH1SEL_HXT (0x0UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL0_SDH1SEL_PLL (0x1UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL0_SDH1SEL_HIRC (0x3UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL0_SDH1SEL_HCLK (0x2UL << CLK_CLKSEL0_SDH1SEL_Pos) /*!< Select SDH1 clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL0_USBSEL_RC48M (0x0UL << CLK_CLKSEL0_USBSEL_Pos) /*!< Select USB clock source from RC48M \hideinitializer */ -#define CLK_CLKSEL0_USBSEL_PLL (0x1UL << CLK_CLKSEL0_USBSEL_Pos) /*!< Select USB clock source from PLL \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL1 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL1_WDTSEL_LXT (0x1UL << CLK_CLKSEL1_WDTSEL_Pos) /*!< Select WDT clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_WDTSEL_LIRC (0x3UL << CLK_CLKSEL1_WDTSEL_Pos) /*!< Select WDT clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_WDTSEL_HCLK_DIV2048 (0x2UL << CLK_CLKSEL1_WDTSEL_Pos) /*!< Select WDT clock source from HCLK/2048 \hideinitializer */ - -#define CLK_CLKSEL1_TMR0SEL_HXT (0x0UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_LXT (0x1UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_PCLK0 (0x2UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL1_TMR0SEL_EXT (0x3UL << CLK_CLKSEL1_TMR0SEL_Pos) /*!< Select TMR0 clock source from external trigger \hideinitializer */ - -#define CLK_CLKSEL1_TMR1SEL_HXT (0x0UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_LXT (0x1UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_PCLK0 (0x2UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from PCLK0 \hideinitializer */ -#define CLK_CLKSEL1_TMR1SEL_EXT (0x3UL << CLK_CLKSEL1_TMR1SEL_Pos) /*!< Select TMR1 clock source from external trigger \hideinitializer */ - -#define CLK_CLKSEL1_TMR2SEL_HXT (0x0UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_LXT (0x1UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_PCLK1 (0x2UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL1_TMR2SEL_EXT (0x3UL << CLK_CLKSEL1_TMR2SEL_Pos) /*!< Select TMR2 clock source from external trigger \hideinitializer */ - -#define CLK_CLKSEL1_TMR3SEL_HXT (0x0UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_LXT (0x1UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_LIRC (0x5UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_HIRC (0x7UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_PCLK1 (0x2UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from PCLK1 \hideinitializer */ -#define CLK_CLKSEL1_TMR3SEL_EXT (0x3UL << CLK_CLKSEL1_TMR3SEL_Pos) /*!< Select TMR3 clock source from external trigger \hideinitializer */ - -#define CLK_CLKSEL1_UART0SEL_HXT (0x0UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART0SEL_LXT (0x2UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART0SEL_PLL (0x1UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL1_UART0SEL_HIRC (0x3UL << CLK_CLKSEL1_UART0SEL_Pos) /*!< Select UART0 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_UART1SEL_HXT (0x0UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART1SEL_LXT (0x2UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_UART1SEL_PLL (0x1UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL1_UART1SEL_HIRC (0x3UL << CLK_CLKSEL1_UART1SEL_Pos) /*!< Select UART1 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL1_CLKOSEL_HXT (0x0UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_LXT (0x1UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_HIRC (0x3UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_CLKOSEL_HCLK (0x2UL << CLK_CLKSEL1_CLKOSEL_Pos) /*!< Select CLKO clock source from HCLK \hideinitializer */ - -#define CLK_CLKSEL1_WWDTSEL_LIRC (0x3UL << CLK_CLKSEL1_WWDTSEL_Pos) /*!< Select WWDT clock source from low speed oscillator \hideinitializer */ -#define CLK_CLKSEL1_WWDTSEL_HCLK_DIV2048 (0x2UL << CLK_CLKSEL1_WWDTSEL_Pos) /*!< Select WWDT clock source from HCLK/2048 \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL2 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL2_QSPI0SEL_HXT (0x0UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_QSPI0SEL_PLL (0x1UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_QSPI0SEL_HIRC (0x3UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL2_QSPI0SEL_PCLK0 (0x2UL << CLK_CLKSEL2_QSPI0SEL_Pos) /*!< Select QSPI0 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL2_SPI0SEL_HXT (0x0UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_PLL (0x1UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_HIRC (0x3UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL2_SPI0SEL_PCLK1 (0x2UL << CLK_CLKSEL2_SPI0SEL_Pos) /*!< Select SPI0 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL2_SPI1SEL_HXT (0x0UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_PLL (0x1UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_HIRC (0x3UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL2_SPI1SEL_PCLK0 (0x2UL << CLK_CLKSEL2_SPI1SEL_Pos) /*!< Select SPI1 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL2_EPWM0SEL_PLL (0x0UL << CLK_CLKSEL2_EPWM0SEL_Pos) /*!< Select EPWM0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_EPWM0SEL_PCLK0 (0x1UL << CLK_CLKSEL2_EPWM0SEL_Pos) /*!< Select EPWM0 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL2_EPWM1SEL_PLL (0x0UL << CLK_CLKSEL2_EPWM1SEL_Pos) /*!< Select EPWM1 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_EPWM1SEL_PCLK1 (0x1UL << CLK_CLKSEL2_EPWM1SEL_Pos) /*!< Select EPWM1 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL2_BPWM0SEL_PLL (0x0UL << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< Select BPWM0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_BPWM0SEL_PCLK0 (0x1UL << CLK_CLKSEL2_BPWM0SEL_Pos) /*!< Select BPWM0 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL2_BPWM1SEL_PLL (0x0UL << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< Select BPWM1 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_BPWM1SEL_PCLK1 (0x1UL << CLK_CLKSEL2_BPWM1SEL_Pos) /*!< Select BPWM1 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL2_SPI2SEL_HXT (0x0UL << CLK_CLKSEL2_SPI2SEL_Pos) /*!< Select SPI2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_SPI2SEL_PLL (0x1UL << CLK_CLKSEL2_SPI2SEL_Pos) /*!< Select SPI2 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_SPI2SEL_HIRC (0x3UL << CLK_CLKSEL2_SPI2SEL_Pos) /*!< Select SPI2 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL2_SPI2SEL_PCLK1 (0x2UL << CLK_CLKSEL2_SPI2SEL_Pos) /*!< Select SPI2 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL2_SPI3SEL_HXT (0x0UL << CLK_CLKSEL2_SPI3SEL_Pos) /*!< Select SPI3 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL2_SPI3SEL_PLL (0x1UL << CLK_CLKSEL2_SPI3SEL_Pos) /*!< Select SPI3 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL2_SPI3SEL_HIRC (0x3UL << CLK_CLKSEL2_SPI3SEL_Pos) /*!< Select SPI3 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL2_SPI3SEL_PCLK0 (0x2UL << CLK_CLKSEL2_SPI3SEL_Pos) /*!< Select SPI3 clock source from PCLK0 \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL3 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL3_SC0SEL_HXT (0x0UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SC0SEL_PLL (0x1UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_SC0SEL_HIRC (0x3UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_SC0SEL_PCLK0 (0x2UL << CLK_CLKSEL3_SC0SEL_Pos) /*!< Select SC0 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL3_SC1SEL_HXT (0x0UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SC1SEL_PLL (0x1UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_SC1SEL_HIRC (0x3UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_SC1SEL_PCLK1 (0x2UL << CLK_CLKSEL3_SC1SEL_Pos) /*!< Select SC1 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL3_SC2SEL_HXT (0x0UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_SC2SEL_PLL (0x1UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_SC2SEL_HIRC (0x3UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_SC2SEL_PCLK0 (0x2UL << CLK_CLKSEL3_SC2SEL_Pos) /*!< Select SC2 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL3_RTCSEL_LXT (0x0UL << CLK_CLKSEL3_RTCSEL_Pos) /*!< Select RTC clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_RTCSEL_LIRC (0x1UL << CLK_CLKSEL3_RTCSEL_Pos) /*!< Select RTC clock source from low speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_QSPI1SEL_HXT (0x0UL << CLK_CLKSEL3_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_QSPI1SEL_PLL (0x1UL << CLK_CLKSEL3_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_QSPI1SEL_HIRC (0x3UL << CLK_CLKSEL3_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_QSPI1SEL_PCLK1 (0x2UL << CLK_CLKSEL3_QSPI1SEL_Pos) /*!< Select QSPI1 clock source from PCLK1 \hideinitializer */ - -#define CLK_CLKSEL3_I2S0SEL_HXT (0x0UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_PLL (0x1UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_HIRC (0x3UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from high speed oscillator \hideinitializer */ -#define CLK_CLKSEL3_I2S0SEL_PCLK0 (0x2UL << CLK_CLKSEL3_I2S0SEL_Pos) /*!< Select I2S0 clock source from PCLK0 \hideinitializer */ - -#define CLK_CLKSEL3_UART2SEL_HXT (0x0UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART2SEL_LXT (0x2UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART2SEL_PLL (0x1UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_UART2SEL_HIRC (0x3UL << CLK_CLKSEL3_UART2SEL_Pos) /*!< Select UART2 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART3SEL_HXT (0x0UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART3SEL_LXT (0x2UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART3SEL_PLL (0x1UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_UART3SEL_HIRC (0x3UL << CLK_CLKSEL3_UART3SEL_Pos) /*!< Select UART3 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART4SEL_HXT (0x0UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART4SEL_LXT (0x2UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART4SEL_PLL (0x1UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_UART4SEL_HIRC (0x3UL << CLK_CLKSEL3_UART4SEL_Pos) /*!< Select UART4 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART5SEL_HXT (0x0UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART5SEL_LXT (0x2UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART5SEL_PLL (0x1UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_UART5SEL_HIRC (0x3UL << CLK_CLKSEL3_UART5SEL_Pos) /*!< Select UART5 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART6SEL_HXT (0x0UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART6SEL_LXT (0x2UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART6SEL_PLL (0x1UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_UART6SEL_HIRC (0x3UL << CLK_CLKSEL3_UART6SEL_Pos) /*!< Select UART6 clock source from high speed oscillator \hideinitializer */ - -#define CLK_CLKSEL3_UART7SEL_HXT (0x0UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from high speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART7SEL_LXT (0x2UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from low speed crystal \hideinitializer */ -#define CLK_CLKSEL3_UART7SEL_PLL (0x1UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from PLL \hideinitializer */ -#define CLK_CLKSEL3_UART7SEL_HIRC (0x3UL << CLK_CLKSEL3_UART7SEL_Pos) /*!< Select UART7 clock source from high speed oscillator \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKDIV0 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKDIV0_HCLK(x) (((x) - 1UL) << CLK_CLKDIV0_HCLKDIV_Pos) /*!< CLKDIV0 Setting for HCLK clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV0_USB(x) (((x) - 1UL) << CLK_CLKDIV0_USBDIV_Pos) /*!< CLKDIV0 Setting for USB clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV0_SDH0(x) (((x) - 1UL) << CLK_CLKDIV0_SDH0DIV_Pos) /*!< CLKDIV0 Setting for SDH0 clock divider. It could be 1~256 \hideinitializer */ -#define CLK_CLKDIV0_UART0(x) (((x) - 1UL) << CLK_CLKDIV0_UART0DIV_Pos) /*!< CLKDIV0 Setting for UART0 clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV0_UART1(x) (((x) - 1UL) << CLK_CLKDIV0_UART1DIV_Pos) /*!< CLKDIV0 Setting for UART1 clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV0_EADC(x) (((x) - 1UL) << CLK_CLKDIV0_EADCDIV_Pos) /*!< CLKDIV0 Setting for EADC clock divider. It could be 1~256 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKDIV1 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKDIV1_SC0(x) (((x) - 1UL) << CLK_CLKDIV1_SC0DIV_Pos) /*!< CLKDIV1 Setting for SC0 clock divider. It could be 1~256 \hideinitializer */ -#define CLK_CLKDIV1_SC1(x) (((x) - 1UL) << CLK_CLKDIV1_SC1DIV_Pos) /*!< CLKDIV1 Setting for SC1 clock divider. It could be 1~256 \hideinitializer */ -#define CLK_CLKDIV1_SC2(x) (((x) - 1UL) << CLK_CLKDIV1_SC2DIV_Pos) /*!< CLKDIV1 Setting for SC2 clock divider. It could be 1~256 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKDIV2 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKDIV2_I2S0(x) (((x) - 1UL) << CLK_CLKDIV2_I2SDIV_Pos) /*!< CLKDIV2 Setting for I2S0 clock divider. It could be 1~16 */ -#define CLK_CLKDIV2_EADC1(x) (((x) - 1UL) << CLK_CLKDIV2_EADC1DIV_Pos) /*!< CLKDIV2 Setting for EADC1 clock divider. It could be 1~256 */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKDIV3 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKDIV3_CCAP(x) (((x) - 1UL) << CLK_CLKDIV3_CCAPDIV_Pos) /*!< CLKDIV3 Setting for CCAP clock divider. It could be 1~256 */ -#define CLK_CLKDIV3_VSENSE(x) (((x) - 1UL) << CLK_CLKDIV3_VSENSEDIV_Pos) /*!< CLKDIV3 Setting for VSENSE clock divider. It could be 1~256 */ -#define CLK_CLKDIV3_EMAC(x) (((x) - 1UL) << CLK_CLKDIV3_EMACDIV_Pos) /*!< CLKDIV3 Setting for EMAC clock divider. It could be 1~256 \hideinitializer */ -#define CLK_CLKDIV3_SDH1(x) (((x) - 1UL) << CLK_CLKDIV3_SDH1DIV_Pos) /*!< CLKDIV3 Setting for SDH1 clock divider. It could be 1~256 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKDIV4 constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKDIV4_UART2(x) (((x) - 1UL) << CLK_CLKDIV4_UART2DIV_Pos) /*!< CLKDIV4 Setting for UART2 clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV4_UART3(x) (((x) - 1UL) << CLK_CLKDIV4_UART3DIV_Pos) /*!< CLKDIV4 Setting for UART3 clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV4_UART4(x) (((x) - 1UL) << CLK_CLKDIV4_UART4DIV_Pos) /*!< CLKDIV4 Setting for UART4 clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV4_UART5(x) (((x) - 1UL) << CLK_CLKDIV4_UART5DIV_Pos) /*!< CLKDIV4 Setting for UART5 clock divider. It could be 1~16 \hideinitializer */ -#define CLK_CLKDIV4_UART6(x) (((x) - 1UL) << CLK_CLKDIV4_UART6DIV_Pos) /*!< CLKDIV4 Setting for UART6 clock divider. It could be 1~16 */ -#define CLK_CLKDIV4_UART7(x) (((x) - 1UL) << CLK_CLKDIV4_UART7DIV_Pos) /*!< CLKDIV4 Setting for UART7 clock divider. It could be 1~16 */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* PCLKDIV constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PCLKDIV_PCLK0DIV1 (0x0UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK0DIV2 (0x1UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/2 HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK0DIV4 (0x2UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/4 HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK0DIV8 (0x3UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/8 HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK0DIV16 (0x4UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/16 HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK1DIV1 (0x0UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK1DIV2 (0x1UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/2 HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK1DIV4 (0x2UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/4 HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK1DIV8 (0x3UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/8 HCLK \hideinitializer */ -#define CLK_PCLKDIV_PCLK1DIV16 (0x4UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/16 HCLK \hideinitializer */ -// -#define CLK_PCLKDIV_APB0DIV_DIV1 (0x0UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB0DIV_DIV2 (0x1UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/2 HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB0DIV_DIV4 (0x2UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/4 HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB0DIV_DIV8 (0x3UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/8 HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB0DIV_DIV16 (0x4UL << CLK_PCLKDIV_APB0DIV_Pos) /*!< PCLKDIV Setting for PCLK0 = 1/16 HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB1DIV_DIV1 (0x0UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB1DIV_DIV2 (0x1UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/2 HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB1DIV_DIV4 (0x2UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/4 HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB1DIV_DIV8 (0x3UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/8 HCLK \hideinitializer */ -#define CLK_PCLKDIV_APB1DIV_DIV16 (0x4UL << CLK_PCLKDIV_APB1DIV_Pos) /*!< PCLKDIV Setting for PCLK1 = 1/16 HCLK \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* PLLCTL constant definitions. PLL = FIN * 2 * NF / NR / NO */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PLLCTL_PLLSRC_HXT 0x00000000UL /*!< For PLL clock source is HXT. 4MHz < FIN/NR < 8MHz \hideinitializer */ -#define CLK_PLLCTL_PLLSRC_HIRC 0x00080000UL /*!< For PLL clock source is HIRC. 4MHz < FIN/NR < 8MHz \hideinitializer */ - -#define CLK_PLLCTL_NF(x) (((x)-2UL)) /*!< x must be constant and 2 <= x <= 513. 200MHz < FIN*2*NF/NR < 500MHz. \hideinitializer */ -#define CLK_PLLCTL_NR(x) (((x)-1UL)<<9) /*!< x must be constant and 1 <= x <= 32. 4MHz < FIN/NR < 8MHz \hideinitializer */ - -#define CLK_PLLCTL_NO_1 0x0000UL /*!< For output divider is 1 \hideinitializer */ -#define CLK_PLLCTL_NO_2 0x4000UL /*!< For output divider is 2 \hideinitializer */ -#define CLK_PLLCTL_NO_4 0xC000UL /*!< For output divider is 4 \hideinitializer */ - -#define CLK_PLLCTL_72MHz_HXT (CLK_PLLCTL_PLLSRC_HXT | CLK_PLLCTL_NR(3UL) | CLK_PLLCTL_NF( 36UL) | CLK_PLLCTL_NO_4) /*!< Predefined PLLCTL setting for 72MHz PLL output with HXT(12MHz X'tal) \hideinitializer */ -#define CLK_PLLCTL_80MHz_HXT (CLK_PLLCTL_PLLSRC_HXT | CLK_PLLCTL_NR(3UL) | CLK_PLLCTL_NF( 40UL) | CLK_PLLCTL_NO_4) /*!< Predefined PLLCTL setting for 80MHz PLL output with HXT(12MHz X'tal) \hideinitializer */ -#define CLK_PLLCTL_144MHz_HXT (CLK_PLLCTL_PLLSRC_HXT | CLK_PLLCTL_NR(2UL) | CLK_PLLCTL_NF( 24UL) | CLK_PLLCTL_NO_2) /*!< Predefined PLLCTL setting for 144MHz PLL output with HXT(12MHz X'tal) \hideinitializer */ -#define CLK_PLLCTL_160MHz_HXT (CLK_PLLCTL_PLLSRC_HXT | CLK_PLLCTL_NR(3UL) | CLK_PLLCTL_NF( 40UL) | CLK_PLLCTL_NO_2) /*!< Predefined PLLCTL setting for 160MHz PLL output with HXT(12MHz X'tal) \hideinitializer */ -#define CLK_PLLCTL_192MHz_HXT (CLK_PLLCTL_PLLSRC_HXT | CLK_PLLCTL_NR(2UL) | CLK_PLLCTL_NF( 32UL) | CLK_PLLCTL_NO_2) /*!< Predefined PLLCTL setting for 192MHz PLL output with HXT(12MHz X'tal) \hideinitializer */ - -#define CLK_PLLCTL_72MHz_HIRC (CLK_PLLCTL_PLLSRC_HIRC | CLK_PLLCTL_NR(3UL) | CLK_PLLCTL_NF( 36UL) | CLK_PLLCTL_NO_4) /*!< Predefined PLLCTL setting for 72MHz PLL output with HIRC(12MHz IRC) \hideinitializer */ -#define CLK_PLLCTL_80MHz_HIRC (CLK_PLLCTL_PLLSRC_HIRC | CLK_PLLCTL_NR(3UL) | CLK_PLLCTL_NF( 40UL) | CLK_PLLCTL_NO_4) /*!< Predefined PLLCTL setting for 80MHz PLL output with HIRC(12MHz IRC) \hideinitializer */ -#define CLK_PLLCTL_144MHz_HIRC (CLK_PLLCTL_PLLSRC_HIRC | CLK_PLLCTL_NR(2UL) | CLK_PLLCTL_NF( 24UL) | CLK_PLLCTL_NO_2) /*!< Predefined PLLCTL setting for 144MHz PLL output with HIRC(12MHz IRC) \hideinitializer */ -#define CLK_PLLCTL_160MHz_HIRC (CLK_PLLCTL_PLLSRC_HIRC | CLK_PLLCTL_NR(3UL) | CLK_PLLCTL_NF( 40UL) | CLK_PLLCTL_NO_2) /*!< Predefined PLLCTL setting for 160MHz PLL output with HIRC(12MHz IRC) \hideinitializer */ -#define CLK_PLLCTL_192MHz_HIRC (CLK_PLLCTL_PLLSRC_HIRC | CLK_PLLCTL_NR(2UL) | CLK_PLLCTL_NF( 32UL) | CLK_PLLCTL_NO_2) /*!< Predefined PLLCTL setting for 192MHz PLL output with HIRC(12MHz IRC) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* MODULE constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ - -/* APBCLK(31:30)|CLKSEL(29:28)|CLKSEL_Msk(27:25) |CLKSEL_Pos(24:20)|CLKDIV(19:18)|CLKDIV_Msk(17:10)|CLKDIV_Pos(9:5)|IP_EN_Pos(4:0) */ - -#define MODULE_APBCLK(x) (((x) >>30) & 0x3UL) /*!< Calculate AHBCLK/APBCLK offset on MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 \hideinitializer */ -#define MODULE_CLKSEL(x) (((x) >>28) & 0x3UL) /*!< Calculate CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3 \hideinitializer */ -#define MODULE_CLKSEL_Msk(x) (((x) >>25) & 0x7UL) /*!< Calculate CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos(x) (((x) >>20) & 0x1fUL) /*!< Calculate CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV(x) (((x) >>18) & 0x3UL) /*!< Calculate APBCLK CLKDIV on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV3, 0x3:CLKDIV4 \hideinitializer */ -#define MODULE_CLKDIV_Msk(x) (((x) >>10) & 0xffUL) /*!< Calculate CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos(x) (((x) >>5 ) & 0x1fUL) /*!< Calculate CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos(x) (((x) >>0 ) & 0x1fUL) /*!< Calculate APBCLK offset on MODULE index \hideinitializer */ -#define MODULE_NoMsk 0x0UL /*!< Not mask on MODULE index \hideinitializer */ -#define NA MODULE_NoMsk /*!< Not Available \hideinitializer */ - -#define MODULE_APBCLK_ENC(x) (((x) & 0x03UL) << 30) /*!< MODULE index, 0x0:AHBCLK, 0x1:APBCLK0, 0x2:APBCLK1 \hideinitializer */ -#define MODULE_CLKSEL_ENC(x) (((x) & 0x03UL) << 28) /*!< CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3 \hideinitializer */ -#define MODULE_CLKSEL_Msk_ENC(x) (((x) & 0x07UL) << 25) /*!< CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos_ENC(x) (((x) & 0x1fUL) << 20) /*!< CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_ENC(x) (((x) & 0x03UL) << 18) /*!< APBCLK CLKDIV on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV3, 0x3:CLKDIV4 \hideinitializer */ -#define MODULE_CLKDIV_Msk_ENC(x) (((x) & 0xffUL) << 10) /*!< CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos_ENC(x) (((x) & 0x1fUL) << 5) /*!< CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos_ENC(x) (((x) & 0x1fUL) << 0) /*!< AHBCLK/APBCLK offset on MODULE index \hideinitializer */ - -#define PDMA_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(1UL<<0)) /*!< PDMA Module \hideinitializer */ -#define ISP_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(2UL<<0)) /*!< ISP Module \hideinitializer */ -#define EBI_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(3UL<<0)) /*!< EBI Module \hideinitializer */ -#define USBH_MODULE ((0UL<<30)|(0UL<<28) |(0x1UL<<25) |(8UL<<20) |(0UL<<18) |(0xFUL<<10) |(4UL<<5) |(16UL<<0)) /*!< USBH Module \hideinitializer */ -#define EMAC_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(2UL<<18) |(0xFFUL<<10) |(16UL<<5) |(5UL<<0)) /*!< EMAC Module \hideinitializer */ -#define SDH0_MODULE ((0UL<<30)|(0UL<<28) |(0x3UL<<25) |(20UL<<20) |(0UL<<18) |(0xFFUL<<10) |(24UL<<5) |(6UL<<0)) /*!< SDH0 Module \hideinitializer */ -#define CRC_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(7UL<<0)) /*!< CRC Module \hideinitializer */ -#define CCAP_MODULE ((0UL<<30)|(0UL<<28) |(0x3UL<<25) |(16UL<<20) |(2UL<<18) |(0xFFUL<<10) |(0UL<<5) |(8UL<<0)) /*!< CCAP Module \hideinitializer */ -#define SEN_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(9UL<<0)) /*!< SEN Module \hideinitializer */ -#define HSUSBD_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(10UL<<0)) /*!< HSUSBD Module \hideinitializer */ -#define CRPT_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(12UL<<0)) /*!< CRPT Module \hideinitializer */ -#define SPIM_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(14UL<<0)) /*!< SPIM Module \hideinitializer */ -#define FMCIDLE_MODULE ((0UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(15UL<<0)) /*!< FMCIDLE Module \hideinitializer */ -#define SDH1_MODULE ((0UL<<30)|(0UL<<28) |(0x3UL<<25) |(22UL<<20) |(2UL<<18) |(0xFFUL<<10) |(24UL<<5) |(17UL<<0)) /*!< SDH1 Module \hideinitializer */ -#define WDT_MODULE ((1UL<<30)|(1UL<<28) |(0x3UL<<25) |(0UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(0UL<<0)) /*!< WDT Module \hideinitializer */ -#define RTC_MODULE ((1UL<<30)|(3UL<<28) |(0x1UL<<25) |(8UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(1UL<<0)) /*!< RTC Module \hideinitializer */ -#define TMR0_MODULE ((1UL<<30)|(1UL<<28) |(0x7UL<<25) |(8UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(2UL<<0)) /*!< TMR0 Module \hideinitializer */ -#define TMR1_MODULE ((1UL<<30)|(1UL<<28) |(0x7UL<<25) |(12UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(3UL<<0)) /*!< TMR1 Module \hideinitializer */ -#define TMR2_MODULE ((1UL<<30)|(1UL<<28) |(0x7UL<<25) |(16UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(4UL<<0)) /*!< TMR2 Module \hideinitializer */ -#define TMR3_MODULE ((1UL<<30)|(1UL<<28) |(0x7UL<<25) |(20UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(5UL<<0)) /*!< TMR3 Module \hideinitializer */ -#define CLKO_MODULE ((1UL<<30)|(1UL<<28) |(0x3UL<<25) |(28UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(6UL<<0)) /*!< CLKO Module \hideinitializer */ -#define WWDT_MODULE ((1UL<<30)|(1UL<<28) |(0x3UL<<25) |(30UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(0UL<<0)) /*!< WWDT Module \hideinitializer */ -#define ACMP01_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(7UL<<0)) /*!< ACMP01 Module \hideinitializer */ -#define I2C0_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(8UL<<0)) /*!< I2C0 Module \hideinitializer */ -#define I2C1_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(9UL<<0)) /*!< I2C1 Module \hideinitializer */ -#define I2C2_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(10UL<<0)) /*!< I2C2 Module \hideinitializer */ -#define QSPI0_MODULE ((1UL<<30)|(2UL<<28) |(0x3UL<<25) |(2UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(12UL<<0)) /*!< QSPI0 Module \hideinitializer */ -#define SPI0_MODULE ((1UL<<30)|(2UL<<28) |(0x3UL<<25) |(4UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(13UL<<0)) /*!< SPI0 Module \hideinitializer */ -#define SPI1_MODULE ((1UL<<30)|(2UL<<28) |(0x3UL<<25) |(6UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(14UL<<0)) /*!< SPI1 Module \hideinitializer */ -#define SPI2_MODULE ((1UL<<30)|(2UL<<28) |(0x3UL<<25) |(10UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(15UL<<0)) /*!< SPI2 Module \hideinitializer */ -#define UART0_MODULE ((1UL<<30)|(1UL<<28) |(0x3UL<<25) |(24UL<<20) |(0UL<<18) |(0xFUL<<10) |(8UL<<5) |(16UL<<0)) /*!< UART0 Module \hideinitializer */ -#define UART1_MODULE ((1UL<<30)|(1UL<<28) |(0x3UL<<25) |(26UL<<20) |(0UL<<18) |(0xFUL<<10) |(12UL<<5) |(17UL<<0)) /*!< UART1 Module \hideinitializer */ -#define UART2_MODULE ((1UL<<30)|(3UL<<28) |(0x3UL<<25) |(24UL<<20) |(3UL<<18) |(0xFUL<<10) |(0UL<<5) |(18UL<<0)) /*!< UART2 Module \hideinitializer */ -#define UART3_MODULE ((1UL<<30)|(3UL<<28) |(0x3UL<<25) |(26UL<<20) |(3UL<<18) |(0xFUL<<10) |(4UL<<5) |(19UL<<0)) /*!< UART3 Module \hideinitializer */ -#define UART4_MODULE ((1UL<<30)|(3UL<<28) |(0x3UL<<25) |(28UL<<20) |(3UL<<18) |(0xFUL<<10) |(8UL<<5) |(20UL<<0)) /*!< UART4 Module \hideinitializer */ -#define UART5_MODULE ((1UL<<30)|(3UL<<28) |(0x3UL<<25) |(30UL<<20) |(3UL<<18) |(0xFUL<<10) |(12UL<<5) |(21UL<<0)) /*!< UART5 Module \hideinitializer */ -#define UART6_MODULE ((1UL<<30)|(3UL<<28) |(0x3UL<<25) |(20UL<<20) |(3UL<<18) |(0xFUL<<10) |(16UL<<5) |(22UL<<0)) /*!< UART6 Module \hideinitializer */ -#define UART7_MODULE ((1UL<<30)|(3UL<<28) |(0x3UL<<25) |(22UL<<20) |(3UL<<18) |(0xFUL<<10) |(20UL<<5) |(23UL<<0)) /*!< UART7 Module \hideinitializer */ -#define CAN0_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(24UL<<0)) /*!< CAN0 Module \hideinitializer */ -#define CAN1_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(25UL<<0)) /*!< CAN1 Module \hideinitializer */ -#define OTG_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(26UL<<0)) /*!< OTG Module \hideinitializer */ -#define USBD_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(1UL<<25) |(8UL<<20) |(MODULE_NoMsk<<18)|(0xFUL<<10) |(4UL<<5) |(27UL<<0)) /*!< USBD Module \hideinitializer */ -#define EADC_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(0UL<<18) |(0xFFUL<<10) |(16UL<<5) |(28UL<<0)) /*!< EADC Module \hideinitializer */ -#define I2S0_MODULE ((1UL<<30)|(3UL<<28) |(0x3UL<<25) |(16UL<<20) |(2UL<<18) |(0xFUL<<10) |(0UL<<5) |(29UL<<0)) /*!< I2S0 Module \hideinitializer */ -#define HSOTG_MODULE ((1UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(30UL<<0)) /*!< HSOTG Module \hideinitializer */ -#define SC0_MODULE ((2UL<<30)|(3UL<<28) |(0x3UL<<25) |(0UL<<20) |(1UL<<18) |(0xFFUL<<10) |(0UL<<5) |(0UL<<0)) /*!< SC0 Module \hideinitializer */ -#define SC1_MODULE ((2UL<<30)|(3UL<<28) |(0x3UL<<25) |(2UL<<20) |(1UL<<18) |(0xFFUL<<10) |(8UL<<5) |(1UL<<0)) /*!< SC1 Module \hideinitializer */ -#define SC2_MODULE ((2UL<<30)|(3UL<<28) |(0x3UL<<25) |(4UL<<20) |(1UL<<18) |(0xFFUL<<10) |(16UL<<5) |(2UL<<0)) /*!< SC2 Module \hideinitializer */ -#define QSPI1_MODULE ((2UL<<30)|(3UL<<28) |(0x3UL<<25) |(12UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(4UL<<0)) /*!< QSPI1 Module \hideinitializer */ -#define SPI3_MODULE ((2UL<<30)|(2UL<<28) |(0x3UL<<25) |(12UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(6UL<<0)) /*!< SPI3 Module \hideinitializer */ -#define USCI0_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(8UL<<0)) /*!< USCI0 Module \hideinitializer */ -#define USCI1_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(9UL<<0)) /*!< USCI1 Module \hideinitializer */ -#define DAC_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(12UL<<0)) /*!< DAC Module \hideinitializer */ -#define CAN2_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(28UL<<0)) /*!< CAN2 Module \hideinitializer */ -#define EPWM0_MODULE ((2UL<<30)|(2UL<<28) |(0x1UL<<25) |(0UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(16UL<<0)) /*!< EPWM0 Module \hideinitializer */ -#define EPWM1_MODULE ((2UL<<30)|(2UL<<28) |(0x1UL<<25) |(1UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(17UL<<0)) /*!< EPWM1 Module \hideinitializer */ -#define BPWM0_MODULE ((2UL<<30)|(2UL<<28) |(0x1UL<<25) |(8UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(18UL<<0)) /*!< BPWM0 Module \hideinitializer */ -#define BPWM1_MODULE ((2UL<<30)|(2UL<<28) |(0x1UL<<25) |(9UL<<20) |(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(19UL<<0)) /*!< BPWM1 Module \hideinitializer */ -#define QEI0_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(22UL<<0)) /*!< QEI0 Module \hideinitializer */ -#define QEI1_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(23UL<<0)) /*!< QEI1 Module \hideinitializer */ -#define TRNG_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(25UL<<0)) /*!< TRNG Module \hideinitializer */ -#define ECAP0_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(26UL<<0)) /*!< ECAP0 Module \hideinitializer */ -#define ECAP1_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(27UL<<0)) /*!< ECAP1 Module \hideinitializer */ -#define OPA_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(MODULE_NoMsk<<18)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(30UL<<0)) /*!< OPA Module \hideinitializer */ -#define EADC1_MODULE ((2UL<<30)|(MODULE_NoMsk<<28)|(MODULE_NoMsk<<25)|(MODULE_NoMsk<<20)|(2UL<<18) |(0xFFUL<<10) |(24UL<<5) |(31UL<<0)) /*!< EADC1 Module \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* PDMSEL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PMUCTL_PDMSEL_PD (0x0UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Power-down mode \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_LLPD (0x1UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Low leakage Power-down mode \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_FWPD (0x2UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Fast wake-up Power-down mode \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_SPD0 (0x4UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Standby Power-down mode 0 \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_SPD1 (0x5UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Standby Power-down mode 1 \hideinitializer */ -#define CLK_PMUCTL_PDMSEL_DPD (0x6UL << CLK_PMUCTL_PDMSEL_Pos) /*!< Select power down mode is Deep Power-down mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WKTMRIS constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_PMUCTL_WKTMRIS_128 (0x0UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 128 OSC10K clocks (12.8 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_256 (0x1UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 256 OSC10K clocks (25.6 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_512 (0x2UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 512 OSC10K clocks (51.2 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_1024 (0x3UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 1024 OSC10K clocks (102.4ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_4096 (0x4UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 4096 OSC10K clocks (409.6ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_8192 (0x5UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 8192 OSC10K clocks (819.2ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_16384 (0x6UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 16384 OSC10K clocks (1638.4ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_65536 (0x7UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 65536 OSC10K clocks (6553.6ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_131072 (0x8UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 131072 OSC10K clocks (13107.2 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_262144 (0x9UL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 262144 OSC10K clocks (26214.4 ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_524288 (0xaUL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 524288 OSC10K clocks (52428.8ms) \hideinitializer */ -#define CLK_PMUCTL_WKTMRIS_1048576 (0xbUL << CLK_PMUCTL_WKTMRIS_Pos) /*!< Select Wake-up Timer Time-out Interval is 1048576 OSC10K clocks (104857.6ms) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SWKDBCLKSEL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_SWKDBCTL_SWKDBCLKSEL_1 (0x0UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 1 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_2 (0x1UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 2 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_4 (0x2UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 4 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_8 (0x3UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 8 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_16 (0x4UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 16 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_32 (0x5UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 32 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_64 (0x6UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 64 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_128 (0x7UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 128 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_256 (0x8UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_2x256 (0x9UL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 2x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_4x256 (0xaUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 4x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_8x256 (0xbUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 8x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_16x256 (0xcUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 16x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_32x256 (0xdUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 32x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_64x256 (0xeUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 64x256 clocks \hideinitializer */ -#define CLK_SWKDBCTL_SWKDBCLKSEL_128x256 (0xfUL << CLK_SWKDBCTL_SWKDBCLKSEL_Pos) /*!< Select Standby Power-down Pin De-bounce Sampling Cycle is 128x256 clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* DPD Pin Rising/Falling Edge Wake-up Enable constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_DPDWKPIN_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Disable Wake-up pin at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN_RISING (0x1UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN_FALLING (0x2UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN0_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Disable Wake-up pin0 (GPC.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_RISING (0x1UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin0 (GPC.0) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_FALLING (0x2UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin0 (GPC.0) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN0_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN_Pos) /*!< Enable Wake-up pin0 (GPC.0) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN1_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Disable Wake-up pin1 (GPB.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_RISING (0x1UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_FALLING (0x2UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN1_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN1_Pos) /*!< Enable Wake-up pin1 (GPB.0) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN2_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Disable Wake-up pin2 (GPB.2) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_RISING (0x1UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_FALLING (0x2UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN2_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN2_Pos) /*!< Enable Wake-up pin2 (GPB.2) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN3_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Disable Wake-up pin3 (GPB.12) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_RISING (0x1UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_FALLING (0x2UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN3_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN3_Pos) /*!< Enable Wake-up pin3 (GPB.12) both edge at Deep Power-down mode \hideinitializer */ - -#define CLK_DPDWKPIN4_DISABLE (0x0UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Disable Wake-up pin4 (GPF.6) at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_RISING (0x1UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) rising edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_FALLING (0x2UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) falling edge at Deep Power-down mode \hideinitializer */ -#define CLK_DPDWKPIN4_BOTHEDGE (0x3UL << CLK_PMUCTL_WKPINEN4_Pos) /*!< Enable Wake-up pin4 (GPF.6) both edge at Deep Power-down mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SPD Pin Rising/Falling Edge Wake-up Enable constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_SPDWKPIN_ENABLE (0x1UL << 0) /*!< Enable Standby Power-down Pin Wake-up \hideinitializer */ -#define CLK_SPDWKPIN_RISING (0x1UL << 1) /*!< Standby Power-down Wake-up on Standby Power-down Pin rising edge \hideinitializer */ -#define CLK_SPDWKPIN_FALLING (0x1UL << 2) /*!< Standby Power-down Wake-up on Standby Power-down Pin falling edge \hideinitializer */ -#define CLK_SPDWKPIN_DEBOUNCEEN (0x1UL << 8) /*!< Enable Standby power-down pin De-bounce function \hideinitializer */ -#define CLK_SPDWKPIN_DEBOUNCEDIS (0x0UL << 8) /*!< Disable Standby power-down pin De-bounce function \hideinitializer */ - -#define CLK_SPDSRETSEL_NO (0x0UL << CLK_PMUCTL_SRETSEL_Pos) /*!< No SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_16K (0x1UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 16K SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_32K (0x2UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 32K SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_64K (0x3UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 64K SRAM retention when chip enter SPD mode \hideinitializer */ -#define CLK_SPDSRETSEL_128K (0x4UL << CLK_PMUCTL_SRETSEL_Pos) /*!< 128K SRAM retention when chip enter SPD mode \hideinitializer */ - -#define CLK_DISABLE_WKTMR(void) (CLK->PMUCTL &= ~CLK_PMUCTL_WKTMREN_Msk) /*!< Disable Wake-up timer at Standby or Deep Power-down mode \hideinitializer */ -#define CLK_ENABLE_WKTMR(void) (CLK->PMUCTL |= CLK_PMUCTL_WKTMREN_Msk) /*!< Enable Wake-up timer at Standby or Deep Power-down mode \hideinitializer */ -#define CLK_DISABLE_DPDWKPIN(void) (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN_Msk) /*!< Disable Wake-up pin at Deep Power-down mode \hideinitializer */ -#define CLK_DISABLE_DPDWKPIN0(void) (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN_Msk) /*!< Disable Wake-up pin0 (GPC.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DISABLE_DPDWKPIN1(void) (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN1_Msk) /*!< Disable Wake-up pin1 (GPB.0) at Deep Power-down mode \hideinitializer */ -#define CLK_DISABLE_DPDWKPIN2(void) (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN2_Msk) /*!< Disable Wake-up pin2 (GPB.2) at Deep Power-down mode \hideinitializer */ -#define CLK_DISABLE_DPDWKPIN3(void) (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN3_Msk) /*!< Disable Wake-up pin3 (GPB.12) at Deep Power-down mode \hideinitializer */ -#define CLK_DISABLE_DPDWKPIN4(void) (CLK->PMUCTL &= ~CLK_PMUCTL_WKPINEN4_Msk) /*!< Disable Wake-up pin4 (GPF.6) at Deep Power-down mode \hideinitializer */ -#define CLK_DISABLE_SPDACMP(void) (CLK->PMUCTL &= ~CLK_PMUCTL_ACMPSPWK_Msk) /*!< Disable ACMP wake-up at Standby Power-down mode \hideinitializer */ -#define CLK_ENABLE_SPDACMP(void) (CLK->PMUCTL |= CLK_PMUCTL_ACMPSPWK_Msk) /*!< Enable ACMP wake-up at Standby Power-down mode \hideinitializer */ -#define CLK_DISABLE_RTCWK(void) (CLK->PMUCTL &= ~CLK_PMUCTL_RTCWKEN_Msk) /*!< Disable RTC Wake-up at Standby or Deep Power-down mode \hideinitializer */ -#define CLK_ENABLE_RTCWK(void) (CLK->PMUCTL |= CLK_PMUCTL_RTCWKEN_Msk) /*!< Enable RTC Wake-up at Standby or Deep Power-down mode \hideinitializer */ - -/*@}*/ /* end of group CLK_EXPORTED_CONSTANTS */ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - -/** - * @brief Set Wake-up Timer Time-out Interval - * - * @param[in] u32Interval The Wake-up Timer Time-out Interval selection. It could be - * - \ref CLK_PMUCTL_WKTMRIS_128 - * - \ref CLK_PMUCTL_WKTMRIS_256 - * - \ref CLK_PMUCTL_WKTMRIS_512 - * - \ref CLK_PMUCTL_WKTMRIS_1024 - * - \ref CLK_PMUCTL_WKTMRIS_4096 - * - \ref CLK_PMUCTL_WKTMRIS_8192 - * - \ref CLK_PMUCTL_WKTMRIS_16384 - * - \ref CLK_PMUCTL_WKTMRIS_65536 - * - \ref CLK_PMUCTL_WKTMRIS_131072 - * - \ref CLK_PMUCTL_WKTMRIS_262144 - * - \ref CLK_PMUCTL_WKTMRIS_524288 - * - \ref CLK_PMUCTL_WKTMRIS_1048576 - * - * @return None - * - * @details This function set Wake-up Timer Time-out Interval. - * - * \hideinitializer - */ -#define CLK_SET_WKTMR_INTERVAL(u32Interval) (CLK->PMUCTL |= (u32Interval)) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] u32CycleSel The de-bounce sampling cycle selection. It could be - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_1 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_2 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_4 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_8 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_16 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_32 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_64 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_128 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_2x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_4x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_8x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_16x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_32x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_64x256 - * - \ref CLK_SWKDBCTL_SWKDBCLKSEL_128x256 - * - * @return None - * - * @details This function set Set De-bounce Sampling Cycle Time. - * - * \hideinitializer - */ -#define CLK_SET_SPDDEBOUNCETIME(u32CycleSel) (CLK->SWKDBCTL = (u32CycleSel)) - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void CLK_SysTickDelay(uint32_t us); -__STATIC_INLINE void CLK_SysTickLongDelay(uint32_t us); - -/** - * @brief This function execute delay function. - * @param[in] us Delay time. The Max value is 2^24 / CPU Clock(MHz). Ex: - * 72MHz => 233016us, 50MHz => 335544us, - * 48MHz => 349525us, 28MHz => 699050us ... - * @return None - * @details Use the SysTick to generate the delay time and the unit is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - */ -__STATIC_INLINE void CLK_SysTickDelay(uint32_t us) -{ - SysTick->LOAD = us * CyclesPerUs; - SysTick->VAL = 0x0UL; - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0UL) - { - } - - /* Disable SysTick counter */ - SysTick->CTRL = 0UL; -} - -/** - * @brief This function execute long delay function. - * @param[in] us Delay time. - * @return None - * @details Use the SysTick to generate the long delay time and the UNIT is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - * User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function. - */ -__STATIC_INLINE void CLK_SysTickLongDelay(uint32_t us) -{ - uint32_t delay; - - /* It should <= 349525us for each delay loop */ - delay = 349525UL; - - do - { - if (us > delay) - { - us -= delay; - } - else - { - delay = us; - us = 0UL; - } - - SysTick->LOAD = delay * CyclesPerUs; - SysTick->VAL = (0x0UL); - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0UL); - - /* Disable SysTick counter */ - SysTick->CTRL = 0UL; - - } - while (us > 0UL); - -} - - -void CLK_DisableCKO(void); -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En); -void CLK_PowerDown(void); -void CLK_Idle(void); -uint32_t CLK_GetHXTFreq(void); -uint32_t CLK_GetLXTFreq(void); -uint32_t CLK_GetHCLKFreq(void); -uint32_t CLK_GetPCLK0Freq(void); -uint32_t CLK_GetPCLK1Freq(void); -uint32_t CLK_GetCPUFreq(void); -uint32_t CLK_SetCoreClock(uint32_t u32Hclk); -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc); -void CLK_EnableXtalRC(uint32_t u32ClkMask); -void CLK_DisableXtalRC(uint32_t u32ClkMask); -void CLK_EnableModuleClock(uint32_t u32ModuleIdx); -void CLK_DisableModuleClock(uint32_t u32ModuleIdx); -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq); -void CLK_DisablePLL(void); -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask); -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count); -void CLK_DisableSysTick(void); -void CLK_SetPowerDownMode(uint32_t u32PDMode); -void CLK_EnableDPDWKPin(uint32_t u32TriggerType); -uint32_t CLK_GetPMUWKSrc(void); -void CLK_EnableSPDWKPin(uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerType, uint32_t u32DebounceEn); -uint32_t CLK_GetPLLClockFreq(void); -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx); -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx); - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CLK_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crc.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crc.h deleted file mode 100644 index 2dc6afca049..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crc.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************//** - * @file nu_crc.h - * @version V1.00 - * @brief M480 series CRC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_CRC_H__ -#define __NU_CRC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_CONSTANTS CRC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* CRC Polynomial Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CRC_CCITT (0UL << CRC_CTL_CRCMODE_Pos) /*!SEED = (u32Seed); CRC->CTL |= CRC_CTL_CHKSINIT_Msk; }while(0) - -/** - * @brief Get CRC Seed Value - * - * @param None - * - * @return CRC seed value - * - * @details This macro gets the current CRC seed value. - * \hideinitializer - */ -#define CRC_GET_SEED() (CRC->SEED) - -/** - * @brief CRC Write Data - * - * @param[in] u32Data Write data - * - * @return None - * - * @details User can write data directly to CRC Write Data Register(CRC_DAT) by this macro to perform CRC operation. - * \hideinitializer - */ -#define CRC_WRITE_DATA(u32Data) (CRC->DAT = (u32Data)) - -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen); -uint32_t CRC_GetChecksum(void); - -/*@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CRC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crypto.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crypto.h deleted file mode 100644 index 6b0ccb27d0a..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_crypto.h +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************//** - * @file nu_crypto.h - * @version V1.10 - * @brief Cryptographic Accelerator driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CRYPTO_H__ -#define __NU_CRYPTO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup CRYPTO_EXPORTED_CONSTANTS CRYPTO Exported Constants - @{ -*/ - -#define PRNG_KEY_SIZE_64 0UL /*!< Select to generate 64-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_128 1UL /*!< Select to generate 128-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_192 2UL /*!< Select to generate 192-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_256 3UL /*!< Select to generate 256-bit random key \hideinitializer */ - -#define PRNG_SEED_CONT 0UL /*!< PRNG using current seed \hideinitializer */ -#define PRNG_SEED_RELOAD 1UL /*!< PRNG reload new seed \hideinitializer */ - -#define AES_KEY_SIZE_128 0UL /*!< AES select 128-bit key length \hideinitializer */ -#define AES_KEY_SIZE_192 1UL /*!< AES select 192-bit key length \hideinitializer */ -#define AES_KEY_SIZE_256 2UL /*!< AES select 256-bit key length \hideinitializer */ - -#define AES_MODE_ECB 0UL /*!< AES select ECB mode \hideinitializer */ -#define AES_MODE_CBC 1UL /*!< AES select CBC mode \hideinitializer */ -#define AES_MODE_CFB 2UL /*!< AES select CFB mode \hideinitializer */ -#define AES_MODE_OFB 3UL /*!< AES select OFB mode \hideinitializer */ -#define AES_MODE_CTR 4UL /*!< AES select CTR mode \hideinitializer */ -#define AES_MODE_CBC_CS1 0x10UL /*!< AES select CBC CS1 mode \hideinitializer */ -#define AES_MODE_CBC_CS2 0x11UL /*!< AES select CBC CS2 mode \hideinitializer */ -#define AES_MODE_CBC_CS3 0x12UL /*!< AES select CBC CS3 mode \hideinitializer */ - -#define AES_NO_SWAP 0UL /*!< AES do not swap input and output data \hideinitializer */ -#define AES_OUT_SWAP 1UL /*!< AES swap output data \hideinitializer */ -#define AES_IN_SWAP 2UL /*!< AES swap input data \hideinitializer */ -#define AES_IN_OUT_SWAP 3UL /*!< AES swap both input and output data \hideinitializer */ - -#define DES_MODE_ECB 0x000UL /*!< DES select ECB mode \hideinitializer */ -#define DES_MODE_CBC 0x100UL /*!< DES select CBC mode \hideinitializer */ -#define DES_MODE_CFB 0x200UL /*!< DES select CFB mode \hideinitializer */ -#define DES_MODE_OFB 0x300UL /*!< DES select OFB mode \hideinitializer */ -#define DES_MODE_CTR 0x400UL /*!< DES select CTR mode \hideinitializer */ -#define TDES_MODE_ECB 0x004UL /*!< TDES select ECB mode \hideinitializer */ -#define TDES_MODE_CBC 0x104UL /*!< TDES select CBC mode \hideinitializer */ -#define TDES_MODE_CFB 0x204UL /*!< TDES select CFB mode \hideinitializer */ -#define TDES_MODE_OFB 0x304UL /*!< TDES select OFB mode \hideinitializer */ -#define TDES_MODE_CTR 0x404UL /*!< TDES select CTR mode \hideinitializer */ - -#define TDES_NO_SWAP 0UL /*!< TDES do not swap data \hideinitializer */ -#define TDES_WHL_SWAP 1UL /*!< TDES swap high-low word \hideinitializer */ -#define TDES_OUT_SWAP 2UL /*!< TDES swap output data \hideinitializer */ -#define TDES_OUT_WHL_SWAP 3UL /*!< TDES swap output data and high-low word \hideinitializer */ -#define TDES_IN_SWAP 4UL /*!< TDES swap input data \hideinitializer */ -#define TDES_IN_WHL_SWAP 5UL /*!< TDES swap input data and high-low word \hideinitializer */ -#define TDES_IN_OUT_SWAP 6UL /*!< TDES swap both input and output data \hideinitializer */ -#define TDES_IN_OUT_WHL_SWAP 7UL /*!< TDES swap input, output and high-low word \hideinitializer */ - -#define SHA_MODE_SHA1 0UL /*!< SHA select SHA-1 160-bit \hideinitializer */ -#define SHA_MODE_SHA224 5UL /*!< SHA select SHA-224 224-bit \hideinitializer */ -#define SHA_MODE_SHA256 4UL /*!< SHA select SHA-256 256-bit \hideinitializer */ -#define SHA_MODE_SHA384 7UL /*!< SHA select SHA-384 384-bit \hideinitializer */ -#define SHA_MODE_SHA512 6UL /*!< SHA select SHA-512 512-bit \hideinitializer */ - -#define SHA_NO_SWAP 0UL /*!< SHA do not swap input and output data \hideinitializer */ -#define SHA_OUT_SWAP 1UL /*!< SHA swap output data \hideinitializer */ -#define SHA_IN_SWAP 2UL /*!< SHA swap input data \hideinitializer */ -#define SHA_IN_OUT_SWAP 3UL /*!< SHA swap both input and output data \hideinitializer */ - -#define CRYPTO_DMA_FIRST 0x4UL /*!< Do first encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_ONE_SHOT 0x5UL /*!< Do one shot encrypt/decrypt with DMA \hideinitializer */ -#define CRYPTO_DMA_CONTINUE 0x6UL /*!< Do continuous encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_LAST 0x7UL /*!< Do last encrypt/decrypt in DMA cascade \hideinitializer */ - -typedef enum -{ - /*!< ECC curve \hideinitializer */ - CURVE_P_192, /*!< ECC curve P-192 \hideinitializer */ - CURVE_P_224, /*!< ECC curve P-224 \hideinitializer */ - CURVE_P_256, /*!< ECC curve P-256 \hideinitializer */ - CURVE_P_384, /*!< ECC curve P-384 \hideinitializer */ - CURVE_P_521, /*!< ECC curve P-521 \hideinitializer */ - CURVE_K_163, /*!< ECC curve K-163 \hideinitializer */ - CURVE_K_233, /*!< ECC curve K-233 \hideinitializer */ - CURVE_K_283, /*!< ECC curve K-283 \hideinitializer */ - CURVE_K_409, /*!< ECC curve K-409 \hideinitializer */ - CURVE_K_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_B_163, /*!< ECC curve B-163 \hideinitializer */ - CURVE_B_233, /*!< ECC curve B-233 \hideinitializer */ - CURVE_B_283, /*!< ECC curve B-283 \hideinitializer */ - CURVE_B_409, /*!< ECC curve B-409 \hideinitializer */ - CURVE_B_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_KO_192, /*!< ECC 192-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_224, /*!< ECC 224-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_256, /*!< ECC 256-bits "Koblitz" curve \hideinitializer */ - CURVE_BP_256, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_384, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_512, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_UNDEF, /*!< Invalid curve \hideinitializer */ -} -E_ECC_CURVE; /*!< ECC curve \hideinitializer */ - - -/*@}*/ /* end of group CRYPTO_EXPORTED_CONSTANTS */ - - -/** @addtogroup M480_CRYPTO_EXPORTED_MACROS CRYPTO Exported Macros - @{ -*/ - -/*----------------------------------------------------------------------------------------------*/ -/* Macros */ -/*----------------------------------------------------------------------------------------------*/ - -/** - * @brief This macro enables PRNG interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define PRNG_ENABLE_INT(crpt) ((crpt)->INTEN |= CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro disables PRNG interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define PRNG_DISABLE_INT(crpt) ((crpt)->INTEN &= ~CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro gets PRNG interrupt flag. - * @param crpt Specified cripto module - * @return PRNG interrupt flag. - * \hideinitializer - */ -#define PRNG_GET_INT_FLAG(crpt) ((crpt)->INTSTS & CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro clears PRNG interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define PRNG_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro enables AES interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro disables AES interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro gets AES interrupt flag. - * @param crpt Specified cripto module - * @return AES interrupt flag. - * \hideinitializer - */ -#define AES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro clears AES interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro enables AES key protection. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL |= CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables AES key protection. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL = ((crpt)->AES_CTL & ~CRPT_AES_CTL_KEYPRT_Msk) | (0x16UL<AES_CTL &= ~CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro enables TDES interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define TDES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESEIEN_Msk)) - -/** - * @brief This macro disables TDES interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESEIEN_Msk)) - -/** - * @brief This macro gets TDES interrupt flag. - * @param crpt Specified cripto module - * @return TDES interrupt flag. - * \hideinitializer - */ -#define TDES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESEIF_Msk)) - -/** - * @brief This macro clears TDES interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define TDES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESEIF_Msk)) - -/** - * @brief This macro enables TDES key protection. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define TDES_ENABLE_KEY_PROTECT(crpt) ((crpt)->TDES_CTL |= CRPT_TDES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables TDES key protection. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_KEY_PROTECT(crpt) ((crpt)->TDES_CTL = ((crpt)->TDES_CTL & ~CRPT_TDES_CTL_KEYPRT_Msk) | (0x16UL<TDES_CTL &= ~CRPT_TDES_CTL_KEYPRT_Msk) - -/** - * @brief This macro enables SHA interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define SHA_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro disables SHA interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define SHA_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro gets SHA interrupt flag. - * @param crpt Specified cripto module - * @return SHA interrupt flag. - * \hideinitializer - */ -#define SHA_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro clears SHA interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define SHA_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro enables ECC interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define ECC_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro disables ECC interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define ECC_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro gets ECC interrupt flag. - * @param crpt Specified cripto module - * @return ECC interrupt flag. - * \hideinitializer - */ -#define ECC_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - -/** - * @brief This macro clears ECC interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define ECC_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - - -/*@}*/ /* end of group M480_CRYPTO_EXPORTED_MACROS */ - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed); -void PRNG_Start(CRPT_T *crpt); -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]); -void AES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType); -void AES_Start(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32DMAMode); -void AES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize); -void AES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32IV[]); -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt); -void TDES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, int32_t Is3DES, int32_t Is3Key, uint32_t u32OpMode, uint32_t u32SwapType); -void TDES_Start(CRPT_T *crpt, int32_t u32Channel, uint32_t u32DMAMode); -void TDES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[3][2]); -void TDES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32IVH, uint32_t u32IVL); -void TDES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt); -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len); -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode); -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt); -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]); -void ECC_Complete(CRPT_T *crpt); -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]); -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]); -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]); -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]); -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *d, char *k, char *R, char *S); -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *public_k1, char *public_k2, char *R, char *S); - - -/*@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CRYPTO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CRYPTO_H__ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_dac.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_dac.h deleted file mode 100644 index 71c22f4e4a0..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_dac.h +++ /dev/null @@ -1,269 +0,0 @@ -/**************************************************************************//** - * @file nu_dac.h - * @version V1.00 - * @brief M480 series DAC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_DAC_H__ -#define __NU_DAC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DAC_Driver DAC Driver - @{ -*/ - - -/** @addtogroup DAC_EXPORTED_CONSTANTS DAC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* DAC_CTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define DAC_CTL_LALIGN_RIGHT_ALIGN (0UL<SWTRG = DAC_SWTRG_SWTRG_Msk) - -/** - * @brief Enable DAC data left-aligned. - * @param[in] dac Base address of DAC module. - * @return None - * @details User has to load data into DAC_DAT[15:4] bits. DAC_DAT[31:16] and DAC_DAT[3:0] are ignored in DAC conversion. - * \hideinitializer - */ -#define DAC_ENABLE_LEFT_ALIGN(dac) ((dac)->CTL |= DAC_CTL_LALIGN_Msk) - -/** - * @brief Enable DAC data right-aligned. - * @param[in] dac Base address of DAC module. - * @return None - * @details User has to load data into DAC_DAT[11:0] bits, DAC_DAT[31:12] are ignored in DAC conversion. - * \hideinitializer - */ -#define DAC_ENABLE_RIGHT_ALIGN(dac) ((dac)->CTL &= ~DAC_CTL_LALIGN_Msk) - -/** - * @brief Enable output voltage buffer. - * @param[in] dac Base address of DAC module. - * @return None - * @details The DAC integrates a voltage output buffer that can be used to reduce output impedance and - * drive external loads directly without having to add an external operational amplifier. - * \hideinitializer - */ -#define DAC_ENABLE_BYPASS_BUFFER(dac) ((dac)->CTL |= DAC_CTL_BYPASS_Msk) - -/** - * @brief Disable output voltage buffer. - * @param[in] dac Base address of DAC module. - * @return None - * @details This macro is used to disable output voltage buffer. - * \hideinitializer - */ -#define DAC_DISABLE_BYPASS_BUFFER(dac) ((dac)->CTL &= ~DAC_CTL_BYPASS_Msk) - -/** - * @brief Enable the interrupt. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @return None - * @details This macro is used to enable DAC interrupt. - * \hideinitializer - */ -#define DAC_ENABLE_INT(dac, u32Ch) ((dac)->CTL |= DAC_CTL_DACIEN_Msk) - -/** - * @brief Disable the interrupt. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @return None - * @details This macro is used to disable DAC interrupt. - * \hideinitializer - */ -#define DAC_DISABLE_INT(dac, u32Ch) ((dac)->CTL &= ~DAC_CTL_DACIEN_Msk) - -/** - * @brief Enable DMA under-run interrupt. - * @param[in] dac Base address of DAC module. - * @return None - * @details This macro is used to enable DMA under-run interrupt. - * \hideinitializer - */ -#define DAC_ENABLE_DMAUDR_INT(dac) ((dac)->CTL |= DAC_CTL_DMAURIEN_Msk) - -/** - * @brief Disable DMA under-run interrupt. - * @param[in] dac Base address of DAC module. - * @return None - * @details This macro is used to disable DMA under-run interrupt. - * \hideinitializer - */ -#define DAC_DISABLE_DMAUDR_INT(dac) ((dac)->CTL &= ~DAC_CTL_DMAURIEN_Msk) - -/** - * @brief Enable PDMA mode. - * @param[in] dac Base address of DAC module. - * @return None - * @details DAC DMA request is generated when a hardware trigger event occurs while DMAEN (DAC_CTL[2]) is set. - * \hideinitializer - */ -#define DAC_ENABLE_PDMA(dac) ((dac)->CTL |= DAC_CTL_DMAEN_Msk) - -/** - * @brief Disable PDMA mode. - * @param[in] dac Base address of DAC module. - * @return None - * @details This macro is used to disable DMA mode. - * \hideinitializer - */ -#define DAC_DISABLE_PDMA(dac) ((dac)->CTL &= ~DAC_CTL_DMAEN_Msk) - -/** - * @brief Write data for conversion. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @param[in] u32Data Decides the data for conversion, valid range are between 0~0xFFF. - * @return None - * @details 12 bit left alignment: user has to load data into DAC_DAT[15:4] bits. - * 12 bit right alignment: user has to load data into DAC_DAT[11:0] bits. - * \hideinitializer - */ -#define DAC_WRITE_DATA(dac, u32Ch, u32Data) ((dac)->DAT = (u32Data)) - -/** - * @brief Read DAC 12-bit holding data. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @return Return DAC 12-bit holding data. - * @details This macro is used to read DAC_DAT register. - * \hideinitializer - */ -#define DAC_READ_DATA(dac, u32Ch) ((dac)->DAT) - -/** - * @brief Get the busy state of DAC. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @retval 0 Idle state. - * @retval 1 Busy state. - * @details This macro is used to read BUSY bit (DAC_STATUS[8]) to get busy state. - * \hideinitializer - */ -#define DAC_IS_BUSY(dac, u32Ch) (((dac)->STATUS & DAC_STATUS_BUSY_Msk) >> DAC_STATUS_BUSY_Pos) - -/** - * @brief Get the interrupt flag. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @retval 0 DAC is in conversion state. - * @retval 1 DAC conversion finish. - * @details This macro is used to read FINISH bit (DAC_STATUS[0]) to get DAC conversion complete finish flag. - * \hideinitializer - */ -#define DAC_GET_INT_FLAG(dac, u32Ch) ((dac)->STATUS & DAC_STATUS_FINISH_Msk) - -/** - * @brief Get the DMA under-run flag. - * @param[in] dac Base address of DAC module. - * @retval 0 No DMA under-run error condition occurred. - * @retval 1 DMA under-run error condition occurred. - * @details This macro is used to read DMAUDR bit (DAC_STATUS[1]) to get DMA under-run state. - * \hideinitializer - */ -#define DAC_GET_DMAUDR_FLAG(dac) (((dac)->STATUS & DAC_STATUS_DMAUDR_Msk) >> DAC_STATUS_DMAUDR_Pos) - -/** - * @brief This macro clear the interrupt status bit. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @return None - * @details User writes FINISH bit (DAC_STATUS[0]) to clear DAC conversion complete finish flag. - * \hideinitializer - */ -#define DAC_CLR_INT_FLAG(dac, u32Ch) ((dac)->STATUS = DAC_STATUS_FINISH_Msk) - -/** - * @brief This macro clear the DMA under-run flag. - * @param[in] dac Base address of DAC module. - * @return None - * @details User writes DMAUDR bit (DAC_STATUS[1]) to clear DMA under-run flag. - * \hideinitializer - */ -#define DAC_CLR_DMAUDR_FLAG(dac) ((dac)->STATUS = DAC_STATUS_DMAUDR_Msk) - - -/** - * @brief Enable DAC group mode - * @param[in] dac Base address of DAC module. - * @return None - * \hideinitializer - */ -#define DAC_ENABLE_GROUP_MODE(dac) (DAC0->CTL |= DAC_CTL_GRPEN_Msk) - -/** - * @brief Disable DAC group mode - * @param[in] dac Base address of DAC module. - * @return None - * \hideinitializer - */ -#define DAC_DISABLE_GROUP_MODE(dac) (DAC0->CTL &= ~DAC_CTL_GRPEN_Msk) - -void DAC_Open(DAC_T *dac, uint32_t u32Ch, uint32_t u32TrgSrc); -void DAC_Close(DAC_T *dac, uint32_t u32Ch); -uint32_t DAC_SetDelayTime(DAC_T *dac, uint32_t u32Delay); - -/*@}*/ /* end of group DAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group DAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_DAC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_eadc.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_eadc.h deleted file mode 100644 index c19021fed95..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_eadc.h +++ /dev/null @@ -1,620 +0,0 @@ -/**************************************************************************//** - * @file nu_eadc.h - * @version V0.10 - * @brief M480 series EADC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_EADC_H__ -#define __NU_EADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_CONSTANTS EADC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EADC_CTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EADC_CTL_DIFFEN_SINGLE_END (0UL<CTL |= EADC_CTL_ADCRST_Msk) - -/** - * @brief Enable PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details When A/D conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, - * user can enable this bit to generate a PDMA data transfer request. - * @note When set PDMAEN bit (EADC_CTL[11]), user must set ADINTENn (EADC_CTL[5:2], n=0~3) = 0 to disable interrupt. - * \hideinitializer - */ -#define EADC_ENABLE_PDMA(eadc) ((eadc)->CTL |= EADC_CTL_PDMAEN_Msk) - -/** - * @brief Disable PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable PDMA transfer. - * \hideinitializer - */ -#define EADC_DISABLE_PDMA(eadc) ((eadc)->CTL &= (~EADC_CTL_PDMAEN_Msk)) - -/** - * @brief Enable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details When A/D conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, - * user can enable this bit to generate a PDMA data transfer request. - * \hideinitializer - */ -#define EADC_ENABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL |= u32ModuleMask) - -/** - * @brief Disable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details This macro is used to disable sample module PDMA transfer. - * \hideinitializer - */ -#define EADC_DISABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL &= (~u32ModuleMask)) - -/** - * @brief Enable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details The ADC controller supports a double buffer mode in sample module 0~3. - * If user enable DBMEN (EADC_SCTLn[23], n=0~3), the double buffer mode will enable. - * \hideinitializer - */ -#define EADC_ENABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_DBMEN_Msk) - -/** - * @brief Disable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details Sample has one sample result register. - * \hideinitializer - */ -#define EADC_DISABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_DBMEN_Msk) - -/** - * @brief Set ADIFn at A/D end of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the start of conversion. - * \hideinitializer - */ -#define EADC_ENABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_INTPOS_Msk) - -/** - * @brief Set ADIFn at A/D start of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the end of conversion. - * \hideinitializer - */ -#define EADC_DISABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_INTPOS_Msk) - -/** - * @brief Enable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be enabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details The A/D converter generates a conversion end ADIFn (EADC_STATUS2[n]) upon the end of specific sample module A/D conversion. - * If ADCIENn bit (EADC_CTL[n+2]) is set then conversion end interrupt request ADINTn is generated (n=0~3). - * \hideinitializer - */ -#define EADC_ENABLE_INT(eadc, u32Mask) ((eadc)->CTL |= ((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Disable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be disabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details Specific sample module A/D ADINT0 interrupt function Disabled. - * \hideinitializer - */ -#define EADC_DISABLE_INT(eadc, u32Mask) ((eadc)->CTL &= ~((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Enable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be enabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 ADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - * \hideinitializer - */ -#define EADC_ENABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] |= (u32ModuleMask)) - -/** - * @brief Disable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 ADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - * \hideinitializer - */ -#define EADC_DISABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] &= ~(u32ModuleMask)) - -/** - * @brief Set the input mode output format. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Format Decides the output format. Valid values are: - * - EADC_CTL_DMOF_STRAIGHT_BINARY :Select the straight binary format as the output format of the conversion result. - * - EADC_CTL_DMOF_TWOS_COMPLEMENT :Select the 2's complement format as the output format of the conversion result. - * @return None - * @details The macro is used to set A/D input mode output format. - * \hideinitializer - */ -#define EADC_SET_DMOF(eadc, u32Format) ((eadc)->CTL = ((eadc)->CTL & ~EADC_CTL_DMOF_Msk) | (u32Format)) - -/** - * @brief Start the A/D conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will be conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module 18. - * @return None - * @details After write EADC_SWTRG register to start ADC conversion, the EADC_PENDSTS register will show which SAMPLE will conversion. - * \hideinitializer - */ -#define EADC_START_CONV(eadc, u32ModuleMask) ((eadc)->SWTRG = (u32ModuleMask)) - -/** - * @brief Cancel the conversion for sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will stop the conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module18. - * @return None - * @details If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - * \hideinitializer - */ -#define EADC_STOP_CONV(eadc, u32ModuleMask) ((eadc)->PENDSTS = (u32ModuleMask)) - -/** - * @brief Get the conversion pending flag. - * @param[in] eadc The pointer of the specified EADC module. - * @return Return the conversion pending sample module. - * @details This STPFn(EADC_PENDSTS[18:0]) bit remains 1 during pending state, when the respective ADC conversion is end, - * the STPFn (n=0~18) bit is automatically cleared to 0. - * \hideinitializer - */ -#define EADC_GET_PENDING_CONV(eadc) ((eadc)->PENDSTS) - -/** - * @brief Get the conversion data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the conversion data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DATn[15:0], n=0~18) field to get conversion data. - * \hideinitializer - */ -#define EADC_GET_CONV_DATA(eadc, u32ModuleNum) ((eadc)->DAT[(u32ModuleNum)] & EADC_DAT_RESULT_Msk) - -/** - * @brief Get the data overrun flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data overrun status bits. Each bit corresponds to a data overrun status, valid range are between 1~0x7FFFF. - * @return Return the data overrun flag of the user-specified sample module. - * @details This macro is used to read OV bit (EADC_STATUS0[31:16], EADC_STATUS1[18:16]) field to get data overrun status. - * \hideinitializer - */ -#define EADC_GET_DATA_OVERRUN_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 >> EADC_STATUS0_OV_Pos) | ((eadc)->STATUS1 & EADC_STATUS1_OV_Msk)) & (u32ModuleMask)) - -/** - * @brief Get the data valid flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data valid status bits. Each bit corresponds to a data valid status, valid range are between 1~0x7FFFF. - * @return Return the data valid flag of the user-specified sample module. - * @details This macro is used to read VALID bit (EADC_STATUS0[15:0], EADC_STATUS1[2:0]) field to get data valid status. - * \hideinitializer - */ -#define EADC_GET_DATA_VALID_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 & EADC_STATUS0_VALID_Msk) | (((eadc)->STATUS1 & EADC_STATUS1_VALID_Msk) << 16)) & (u32ModuleMask)) - -/** - * @brief Get the double data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the double data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DDATn[15:0], n=0~3) field to get conversion data. - * \hideinitializer - */ -#define EADC_GET_DOUBLE_DATA(eadc, u32ModuleNum) ((eadc)->DDAT[(u32ModuleNum)] & EADC_DDAT0_RESULT_Msk) - -/** - * @brief Get the user-specified interrupt flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of interrupt status bits. Each bit corresponds to a interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return Return the user-specified interrupt flags. - * @details This macro is used to get the user-specified interrupt flags. - * \hideinitializer - */ -#define EADC_GET_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 & (u32Mask)) - -/** - * @brief Get the user-specified sample module overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status, valid range are between 1~0x7FFFF. - * @return Return the user-specified sample module overrun flags. - * @details This macro is used to get the user-specified sample module overrun flags. - * \hideinitializer - */ -#define EADC_GET_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS & (u32ModuleMask)) - -/** - * @brief Clear the selected interrupt status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of compare interrupt status bits. Each bit corresponds to a compare interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return None - * @details This macro is used to clear clear the selected interrupt status bits. - * \hideinitializer - */ -#define EADC_CLR_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 = (u32Mask)) - -/** - * @brief Clear the selected sample module overrun status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status. - * Bit 0 is SPOVF0, bit 1 is SPOVF1..., bit 18 is SPOVF18. - * @return None - * @details This macro is used to clear the selected sample module overrun status bits. - * \hideinitializer - */ -#define EADC_CLR_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS = (u32ModuleMask)) - -/** - * @brief Check all sample module A/D result data register overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register overrun flag is set to 1. - * @retval 1 Any one of sample module data register overrun flag is set to 1. - * @details The AOV bit (EADC_STATUS2[27]) will keep 1 when any one of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_DATA_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AOV_Msk) >> EADC_STATUS2_AOV_Pos) - -/** - * @brief Check all sample module A/D result data register valid flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register valid flag is set to 1. - * @retval 1 Any one of sample module data register valid flag is set to 1. - * @details The AVALID bit (EADC_STATUS2[26]) will keep 1 when any one of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_DATA_VALID(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AVALID_Msk) >> EADC_STATUS2_AVALID_Pos) - -/** - * @brief Check all A/D sample module start of conversion overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module event overrun flag is set to 1. - * @retval 1 Any one of sample module event overrun flag is set to 1. - * @details The STOVF bit (EADC_STATUS2[25]) will keep 1 when any one of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_SAMPLE_MODULE_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_STOVF_Msk) >> EADC_STATUS2_STOVF_Pos) - -/** - * @brief Check all A/D interrupt flag overrun bits. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of ADINT interrupt flag is overwritten to 1. - * @retval 1 Any one of ADINT interrupt flag is overwritten to 1. - * @details The ADOVIF bit (EADC_STATUS2[24]) will keep 1 when any one of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * \hideinitializer - */ -#define EADC_IS_INT_FLAG_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_ADOVIF_Msk) >> EADC_STATUS2_ADOVIF_Pos) - -/** - * @brief Get the busy state of EADC. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 Idle state. - * @retval 1 Busy state. - * @details This macro is used to read BUSY bit (EADC_STATUS2[23]) to get busy state. - * \hideinitializer - */ -#define EADC_IS_BUSY(eadc) (((eadc)->STATUS2 & EADC_STATUS2_BUSY_Msk) >> EADC_STATUS2_BUSY_Pos) - -/** - * @brief Configure the comparator 0 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP0(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 0 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP0(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[0] = (((eadc)->CMP[0] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 1 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP1(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 1 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP1(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[1] = (((eadc)->CMP[1] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 2 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP2(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 2 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP2(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[2] = (((eadc)->CMP[2] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 3 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 1~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP3(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 3 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP3(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[3] = (((eadc)->CMP[3] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Enable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched. - * \hideinitializer - */ -#define EADC_ENABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_CMPWEN_Msk) - -/** - * @brief Disable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * \hideinitializer - */ -#define EADC_DISABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_CMPWEN_Msk) - -/** - * @brief Enable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) - * and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, - * if ADCMPIE is set to 1, a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details This macro is used to disable the compare interrupt. - * \hideinitializer - */ -#define EADC_DISABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable comparator 0. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 0. - * \hideinitializer - */ -#define EADC_DISABLE_CMP0(eadc) ((eadc)->CMP[0] = 0) - -/** - * @brief Disable comparator 1. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 1. - * \hideinitializer - */ -#define EADC_DISABLE_CMP1(eadc) ((eadc)->CMP[1] = 0) - -/** - * @brief Disable comparator 2. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 2. - * \hideinitializer - */ -#define EADC_DISABLE_CMP2(eadc) ((eadc)->CMP[2] = 0) - -/** - * @brief Disable comparator 3. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 3. - * \hideinitializer - */ -#define EADC_DISABLE_CMP3(eadc) ((eadc)->CMP[3] = 0) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EADC functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode); -void EADC_Close(EADC_T *eadc); -void EADC_ConfigSampleModule(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerSrc, uint32_t u32Channel); -void EADC_SetTriggerDelayTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerDelayTime, uint32_t u32DelayClockDivider); -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime); - -/*@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EADC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ebi.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ebi.h deleted file mode 100644 index cd9c4998122..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ebi.h +++ /dev/null @@ -1,352 +0,0 @@ -/**************************************************************************//** - * @file nu_ebi.h - * @version V3.00 - * @brief M480 series External Bus Interface(EBI) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EBI_H__ -#define __NU_EBI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_CONSTANTS EBI Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0_BASE_ADDR 0x60000000UL /*!< EBI bank0 base address \hideinitializer */ -#define EBI_BANK1_BASE_ADDR 0x60100000UL /*!< EBI bank1 base address \hideinitializer */ -#define EBI_BANK2_BASE_ADDR 0x60200000UL /*!< EBI bank2 base address \hideinitializer */ -#define EBI_MAX_SIZE 0x00100000UL /*!< Maximum EBI size for each bank is 1 MB \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI bank number */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0 0UL /*!< EBI bank 0 \hideinitializer */ -#define EBI_BANK1 1UL /*!< EBI bank 1 \hideinitializer */ -#define EBI_BANK2 2UL /*!< EBI bank 2 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI data bus width */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BUSWIDTH_8BIT 8UL /*!< EBI bus width is 8-bit \hideinitializer */ -#define EBI_BUSWIDTH_16BIT 16UL /*!< EBI bus width is 16-bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI CS Active Level */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_CS_ACTIVE_LOW 0UL /*!< EBI CS active level is low \hideinitializer */ -#define EBI_CS_ACTIVE_HIGH 1UL /*!< EBI CS active level is high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI MCLK divider and Timing */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_MCLKDIV_1 0x0UL /*!< EBI output clock(MCLK) is HCLK/1 \hideinitializer */ -#define EBI_MCLKDIV_2 0x1UL /*!< EBI output clock(MCLK) is HCLK/2 \hideinitializer */ -#define EBI_MCLKDIV_4 0x2UL /*!< EBI output clock(MCLK) is HCLK/4 \hideinitializer */ -#define EBI_MCLKDIV_8 0x3UL /*!< EBI output clock(MCLK) is HCLK/8 \hideinitializer */ -#define EBI_MCLKDIV_16 0x4UL /*!< EBI output clock(MCLK) is HCLK/16 \hideinitializer */ -#define EBI_MCLKDIV_32 0x5UL /*!< EBI output clock(MCLK) is HCLK/32 \hideinitializer */ -#define EBI_MCLKDIV_64 0x6UL /*!< EBI output clock(MCLK) is HCLK/64 \hideinitializer */ -#define EBI_MCLKDIV_128 0x7UL /*!< EBI output clock(MCLK) is HCLK/128 \hideinitializer */ - -#define EBI_TIMING_FASTEST 0x0UL /*!< EBI timing is the fastest \hideinitializer */ -#define EBI_TIMING_VERYFAST 0x1UL /*!< EBI timing is very fast \hideinitializer */ -#define EBI_TIMING_FAST 0x2UL /*!< EBI timing is fast \hideinitializer */ -#define EBI_TIMING_NORMAL 0x3UL /*!< EBI timing is normal \hideinitializer */ -#define EBI_TIMING_SLOW 0x4UL /*!< EBI timing is slow \hideinitializer */ -#define EBI_TIMING_VERYSLOW 0x5UL /*!< EBI timing is very slow \hideinitializer */ -#define EBI_TIMING_SLOWEST 0x6UL /*!< EBI timing is the slowest \hideinitializer */ - -#define EBI_OPMODE_NORMAL 0x0UL /*!< EBI bus operate in normal mode \hideinitializer */ -#define EBI_OPMODE_CACCESS (EBI_CTL_CACCESS_Msk) /*!< EBI bus operate in Continuous Data Access mode \hideinitializer */ -#define EBI_OPMODE_ADSEPARATE (EBI_CTL_ADSEPEN_Msk) /*!< EBI bus operate in AD Separate mode \hideinitializer */ - -/*@}*/ /* end of group EBI_EXPORTED_CONSTANTS */ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Read 8-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Enable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to improve EBI write operation for all EBI banks. - * \hideinitializer - */ -#define EBI_ENABLE_WRITE_BUFFER() (EBI->CTL0 |= EBI_CTL_WBUFEN_Msk); - -/** - * @brief Disable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to disable EBI write buffer function. - * \hideinitializer - */ -#define EBI_DISABLE_WRITE_BUFFER() (EBI->CTL0 &= ~EBI_CTL_WBUFEN_Msk); - -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel); -void EBI_Close(uint32_t u32Bank); -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv); - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ecap.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ecap.h deleted file mode 100644 index ebcf061ac06..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_ecap.h +++ /dev/null @@ -1,458 +0,0 @@ -/**************************************************************************//** - * @file nu_ecap.h - * @version V3.00 - * @brief EnHanced Input Capture Timer(ECAP) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_ECAP_H__ -#define __NU_ECAP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_CONSTANTS ECAP Exported Constants - @{ -*/ - -#define ECAP_IC0 (0UL) /*!< ECAP IC0 Unit \hideinitializer */ -#define ECAP_IC1 (1UL) /*!< ECAP IC1 Unit \hideinitializer */ -#define ECAP_IC2 (2UL) /*!< ECAP IC2 Unit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ECAP CTL0 constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ECAP_NOISE_FILTER_CLKDIV_1 (0UL<CTL0 = ((ecap)->CTL0 & ~ECAP_CTL0_NFCLKSEL_Msk)|(u32ClkSel)) - -/** - * @brief This macro is used to disable noise filter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the noise filter of input capture. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_DISABLE(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPNFDIS_Msk) - -/** - * @brief This macro is used to enable noise filter - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSel Select noise filter clock divide number - * - \ref ECAP_NOISE_FILTER_CLKDIV_1 - * - \ref ECAP_NOISE_FILTER_CLKDIV_2 - * - \ref ECAP_NOISE_FILTER_CLKDIV_4 - * - \ref ECAP_NOISE_FILTER_CLKDIV_16 - * - \ref ECAP_NOISE_FILTER_CLKDIV_32 - * - \ref ECAP_NOISE_FILTER_CLKDIV_64 - * @return None - * @details This macro will enable the noise filter of input capture and set noise filter clock divide. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_ENABLE(ecap, u32ClkSel) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPNFDIS_Msk|ECAP_CTL0_NFCLKSEL_Msk))|(u32ClkSel)) - -/** - * @brief This macro is used to enable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will enable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_ENABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will disable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_DISABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to select input channel source - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Src The input source - * - \ref ECAP_CAP_INPUT_SRC_FROM_IC - * - \ref ECAP_CAP_INPUT_SRC_FROM_CH - * @return None - * @details This macro will select the input source from ICx, CHx. - * \hideinitializer - */ -#define ECAP_SEL_INPUT_SRC(ecap, u32Index, u32Src) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPSEL0_Msk<<((u32Index)<<1)))|(((u32Src)<CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return None - * @details This macro will disable the input channel_n interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_INT(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to enable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_OVF_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to disable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_OVF_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to enable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to disable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to start capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will start capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_START(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to stop capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will stop capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_STOP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to set event to clear capture counter - * @param[in] ecap Specify ECAP port - * @param[in] u32Event The input channel number - * - \ref ECAP_CTL0_CMPCLREN_Msk - * - \ref ECAP_CTL1_CAP0RLDEN_Msk - * - \ref ECAP_CTL1_CAP1RLDEN_Msk - * - \ref ECAP_CTL1_CAP2RLDEN_Msk - * - \ref ECAP_CTL1_OVRLDEN_Msk - - * @return None - * @details This macro will enable and select compare or capture event that can clear capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CLEAR_EVENT(ecap, u32Event) do{ \ - if((u32Event) & ECAP_CTL0_CMPCLREN_Msk) \ - (ecap)->CTL0 |= ECAP_CTL0_CMPCLREN_Msk; \ - else \ - (ecap)->CTL0 &= ~ECAP_CTL0_CMPCLREN_Msk; \ - (ecap)->CTL1 = ((ecap)->CTL1 &~0xF00) | ((u32Event) & 0xF00); \ - }while(0); - -/** - * @brief This macro is used to enable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the compare function. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to disable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the compare function. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to enable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_ENABLE_CNT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to disable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_DISABLE_CNT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to select input channel edge detection - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Edge The input source - * - \ref ECAP_RISING_EDGE - * - \ref ECAP_FALLING_EDGE - * - \ref ECAP_RISING_FALLING_EDGE - * @return None - * @details This macro will select input capture can detect falling edge, rising edge or either rising or falling edge change. - * \hideinitializer - */ -#define ECAP_SEL_CAPTURE_EDGE(ecap, u32Index, u32Edge) ((ecap)->CTL1 = ((ecap)->CTL1 & ~(ECAP_CTL1_EDGESEL0_Msk<<((u32Index)<<1)))|((u32Edge)<<((u32Index)<<1))) - -/** - * @brief This macro is used to select ECAP counter reload trigger source - * @param[in] ecap Specify ECAP port - * @param[in] u32TrigSrc The input source - * - \ref ECAP_CTL1_CAP0RLDEN_Msk - * - \ref ECAP_CTL1_CAP1RLDEN_Msk - * - \ref ECAP_CTL1_CAP2RLDEN_Msk - * - \ref ECAP_CTL1_OVRLDEN_Msk - * @return None - * @details This macro will select capture counter reload trigger source. - * \hideinitializer - */ -#define ECAP_SEL_RELOAD_TRIG_SRC(ecap, u32TrigSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~0xF00)|(u32TrigSrc)) - -/** - * @brief This macro is used to select capture timer clock divide. - * @param[in] ecap Specify ECAP port - * @param[in] u32Clkdiv The input source - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_1 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_4 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_16 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_32 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_64 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_96 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_112 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_128 - * @return None - * @details This macro will select capture timer clock has a pre-divider with eight divided option. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_DIV(ecap, u32Clkdiv) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CLKSEL_Msk)|(u32Clkdiv)) - -/** - * @brief This macro is used to select capture timer/counter clock source - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSrc The input source - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP_CLK - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP0 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP1 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP2 - * @return None - * @details This macro will select capture timer/clock clock source. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_SRC(ecap, u32ClkSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CNTSRCSEL_Msk)|(u32ClkSrc)) - -/** - * @brief This macro is used to read input capture status - * @param[in] ecap Specify ECAP port - * @return Input capture status flags - * @details This macro will get the input capture interrupt status. - * \hideinitializer - */ -#define ECAP_GET_INT_STATUS(ecap) ((ecap)->STATUS) - -/** - * @brief This macro is used to get input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to get the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_GET_CAPTURE_FLAG(ecap, u32Mask) (((ecap)->STATUS & (u32Mask))?1:0) - -/** - * @brief This macro is used to clear input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to clear the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_CLR_CAPTURE_FLAG(ecap, u32Mask) ((ecap)->STATUS = (u32Mask)) - -/** - * @brief This macro is used to set input capture counter value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Counter value - * @return None - * @details This macro will set a counter value of input capture. - * \hideinitializer - */ -#define ECAP_SET_CNT_VALUE(ecap, u32Val) ((ecap)->CNT = (u32Val)) - -/** - * @brief This macro is used to get input capture counter value - * @param[in] ecap Specify ECAP port - * @return Capture counter value - * @details This macro will get a counter value of input capture. - * \hideinitializer - */ -#define ECAP_GET_CNT_VALUE(ecap) ((ecap)->CNT) - -/** - * @brief This macro is used to get input capture counter hold value - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return Capture counter hold value - * @details This macro will get a hold value of input capture channel_n. - * \hideinitializer - */ -#define ECAP_GET_CNT_HOLD_VALUE(ecap, u32Index) (*(__IO uint32_t *) (&((ecap)->HLD0) + (u32Index))) - -/** - * @brief This macro is used to set input capture counter compare value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Input capture compare value - * @return None - * @details This macro will set a compare value of input capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CMP(ecap, u32Val) ((ecap)->CNTCMP = (u32Val)) - -void ECAP_Open(ECAP_T* ecap, uint32_t u32FuncMask); -void ECAP_Close(ECAP_T* ecap); -void ECAP_EnableINT(ECAP_T* ecap, uint32_t u32Mask); -void ECAP_DisableINT(ECAP_T* ecap, uint32_t u32Mask); -/*@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ECAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_ECAP_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_emac.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_emac.h deleted file mode 100644 index 152873d76ac..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_emac.h +++ /dev/null @@ -1,357 +0,0 @@ -/**************************************************************************//** - * @file nu_emac.h - * @version V1.00 - * @brief M480 EMAC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_EMAC_H__ -#define __NU_EMAC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EMAC_Driver EMAC Driver - @{ -*/ - -/** @addtogroup EMAC_EXPORTED_CONSTANTS EMAC Exported Constants - @{ -*/ - -#define EMAC_PHY_ADDR 1UL /*!< PHY address, this address is board dependent \hideinitializer */ -#define EMAC_RX_DESC_SIZE 4UL /*!< Number of Rx Descriptors, should be 2 at least \hideinitializer */ -#define EMAC_TX_DESC_SIZE 4UL /*!< Number of Tx Descriptors, should be 2 at least \hideinitializer */ -#define EMAC_CAMENTRY_NB 16UL /*!< Number of CAM \hideinitializer */ -#define EMAC_MAX_PKT_SIZE 1524UL /*!< Number of HDR + EXTRA + VLAN_TAG + PAYLOAD + CRC \hideinitializer */ - -#define EMAC_LINK_DOWN 0UL /*!< Ethernet link is down \hideinitializer */ -#define EMAC_LINK_100F 1UL /*!< Ethernet link is 100Mbps full duplex \hideinitializer */ -#define EMAC_LINK_100H 2UL /*!< Ethernet link is 100Mbps half duplex \hideinitializer */ -#define EMAC_LINK_10F 3UL /*!< Ethernet link is 10Mbps full duplex \hideinitializer */ -#define EMAC_LINK_10H 4UL /*!< Ethernet link is 10Mbps half duplex \hideinitializer */ - -/*@}*/ /* end of group EMAC_EXPORTED_CONSTANTS */ - - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Enable EMAC Tx function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_TX() (EMAC->CTL |= EMAC_CTL_TXON_Msk) - - -/** - * @brief Enable EMAC Rx function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RX() do{EMAC->CTL |= EMAC_CTL_RXON_Msk; EMAC->RXST = 0;}while(0) - -/** - * @brief Disable EMAC Tx function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_TX() (EMAC->CTL &= ~EMAC_CTL_TXON_Msk) - - -/** - * @brief Disable EMAC Rx function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RX() (EMAC->CTL &= ~EMAC_CTL_RXON_Msk) - -/** - * @brief Enable EMAC Magic Packet Wakeup function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_MAGIC_PKT_WAKEUP() (EMAC->CTL |= EMAC_CTL_WOLEN_Msk) - -/** - * @brief Disable EMAC Magic Packet Wakeup function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_MAGIC_PKT_WAKEUP() (EMAC->CTL &= ~EMAC_CTL_WOLEN_Msk) - -/** - * @brief Enable EMAC to receive broadcast packets - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RECV_BCASTPKT() (EMAC->CAMCTL |= EMAC_CAMCTL_ABP_Msk) - -/** - * @brief Disable EMAC to receive broadcast packets - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RECV_BCASTPKT() (EMAC->CAMCTL &= ~EMAC_CAMCTL_ABP_Msk) - -/** - * @brief Enable EMAC to receive multicast packets - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RECV_MCASTPKT() (EMAC->CAMCTL |= EMAC_CAMCTL_AMP_Msk) - -/** - * @brief Disable EMAC Magic Packet Wakeup function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RECV_MCASTPKT() (EMAC->CAMCTL &= ~EMAC_CAMCTL_AMP_Msk) - -/** - * @brief Check if EMAC time stamp alarm interrupt occurred or not - * @param None - * @return If time stamp alarm interrupt occurred or not - * @retval 0 Alarm interrupt does not occur - * @retval 1 Alarm interrupt occurred - * \hideinitializer - */ -#define EMAC_GET_ALARM_FLAG() (EMAC->INTSTS & EMAC_INTSTS_TSALMIF_Msk ? 1 : 0) - -/** - * @brief Clear EMAC time stamp alarm interrupt flag - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_CLR_ALARM_FLAG() (EMAC->INTSTS = EMAC_INTSTS_TSALMIF_Msk) - -/** - * @brief Trigger EMAC Rx function - * @param None - * @return None - */ -#define EMAC_TRIGGER_RX() do{EMAC->RXST = 0UL;}while(0) - -/** - * @brief Trigger EMAC Tx function - * @param None - * @return None - */ -#define EMAC_TRIGGER_TX() do{EMAC->TXST = 0UL;}while(0) - -/** - * @brief Enable specified EMAC interrupt - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntSel Interrupt type select - * - \ref EMAC_INTEN_RXIEN_Msk : Receive - * - \ref EMAC_INTEN_CRCEIEN_Msk : CRC Error - * - \ref EMAC_INTEN_RXOVIEN_Msk : Receive FIFO Overflow - * - \ref EMAC_INTEN_LPIEN_Msk : Long Packet - * - \ref EMAC_INTEN_RXGDIEN_Msk : Receive Good - * - \ref EMAC_INTEN_ALIEIEN_Msk : Alignment Error - * - \ref EMAC_INTEN_RPIEN_Msk : Runt Packet - * - \ref EMAC_INTEN_MPCOVIEN_Msk : Miss Packet Counter Overrun - * - \ref EMAC_INTEN_MFLEIEN_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTEN_DENIEN_Msk : DMA Early Notification - * - \ref EMAC_INTEN_RDUIEN_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTEN_RXBEIEN_Msk : Receive Bus Error - * - \ref EMAC_INTEN_CFRIEN_Msk : Control Frame Receive - * - \ref EMAC_INTEN_WOLIEN_Msk : Wake on LAN Interrupt - * - \ref EMAC_INTEN_TXIEN_Msk : Transmit - * - \ref EMAC_INTEN_TXUDIEN_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTEN_TXCPIEN_Msk : Transmit Completion - * - \ref EMAC_INTEN_EXDEFIEN_Msk : Defer Exceed - * - \ref EMAC_INTEN_NCSIEN_Msk : No Carrier Sense - * - \ref EMAC_INTEN_TXABTIEN_Msk : Transmit Abort - * - \ref EMAC_INTEN_LCIEN_Msk : Late Collision - * - \ref EMAC_INTEN_TDUIEN_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTEN_TXBEIEN_Msk : Transmit Bus Error - * - \ref EMAC_INTEN_TSALMIEN_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro enable specified EMAC interrupt. - * \hideinitializer - */ -#define EMAC_ENABLE_INT(emac, u32eIntSel) ((emac)->INTEN |= (u32eIntSel)) - -/** - * @brief Disable specified EMAC interrupt - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntSel Interrupt type select - * - \ref EMAC_INTEN_RXIEN_Msk : Receive - * - \ref EMAC_INTEN_CRCEIEN_Msk : CRC Error - * - \ref EMAC_INTEN_RXOVIEN_Msk : Receive FIFO Overflow - * - \ref EMAC_INTEN_LPIEN_Msk : Long Packet - * - \ref EMAC_INTEN_RXGDIEN_Msk : Receive Good - * - \ref EMAC_INTEN_ALIEIEN_Msk : Alignment Error - * - \ref EMAC_INTEN_RPIEN_Msk : Runt Packet - * - \ref EMAC_INTEN_MPCOVIEN_Msk : Miss Packet Counter Overrun - * - \ref EMAC_INTEN_MFLEIEN_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTEN_DENIEN_Msk : DMA Early Notification - * - \ref EMAC_INTEN_RDUIEN_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTEN_RXBEIEN_Msk : Receive Bus Error - * - \ref EMAC_INTEN_CFRIEN_Msk : Control Frame Receive - * - \ref EMAC_INTEN_WOLIEN_Msk : Wake on LAN Interrupt - * - \ref EMAC_INTEN_TXIEN_Msk : Transmit - * - \ref EMAC_INTEN_TXUDIEN_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTEN_TXCPIEN_Msk : Transmit Completion - * - \ref EMAC_INTEN_EXDEFIEN_Msk : Defer Exceed - * - \ref EMAC_INTEN_NCSIEN_Msk : No Carrier Sense - * - \ref EMAC_INTEN_TXABTIEN_Msk : Transmit Abort - * - \ref EMAC_INTEN_LCIEN_Msk : Late Collision - * - \ref EMAC_INTEN_TDUIEN_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTEN_TXBEIEN_Msk : Transmit Bus Error - * - \ref EMAC_INTEN_TSALMIEN_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro disable specified EMAC interrupt. - * \hideinitializer - */ -#define EMAC_DISABLE_INT(emac, u32eIntSel) ((emac)->INTEN &= ~ (u32eIntSel)) - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref EMAC_INTSTS_RXIF_Msk : Receive - * - \ref EMAC_INTSTS_CRCEIF_Msk : CRC Error - * - \ref EMAC_INTSTS_RXOVIF_Msk : Receive FIFO Overflow - * - \ref EMAC_INTSTS_LPIF_Msk : Long Packet - * - \ref EMAC_INTSTS_RXGDIF_Msk : Receive Good - * - \ref EMAC_INTSTS_ALIEIF_Msk : Alignment Error - * - \ref EMAC_INTSTS_RPIF_Msk : Runt Packet - * - \ref EMAC_INTSTS_MPCOVIF_Msk : Missed Packet Counter - * - \ref EMAC_INTSTS_MFLEIF_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTSTS_DENIF_Msk : DMA Early Notification - * - \ref EMAC_INTSTS_RDUIF_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTSTS_RXBEIF_Msk : Receive Bus Error - * - \ref EMAC_INTSTS_CFRIF_Msk : Control Frame Receive - * - \ref EMAC_INTSTS_WOLIF_Msk : Wake on LAN - * - \ref EMAC_INTSTS_TXIF_Msk : Transmit - * - \ref EMAC_INTSTS_TXUDIF_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTSTS_TXCPIF_Msk : Transmit Completion - * - \ref EMAC_INTSTS_EXDEFIF_Msk : Defer Exceed - * - \ref EMAC_INTSTS_NCSIF_Msk : No Carrier Sense - * - \ref EMAC_INTSTS_TXABTIF_Msk : Transmit Abort - * - \ref EMAC_INTSTS_LCIF_Msk : Late Collision - * - \ref EMAC_INTSTS_TDUIF_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTSTS_TXBEIF_Msk : Transmit Bus Error - * - \ref EMAC_INTSTS_TSALMIF_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define EMAC_GET_INT_FLAG(emac, u32eIntTypeFlag) (((emac)->INTSTS & (u32eIntTypeFlag))?1:0) - -/** - * @brief Clear specified interrupt flag/status - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref EMAC_INTSTS_RXIF_Msk : Receive - * - \ref EMAC_INTSTS_CRCEIF_Msk : CRC Error - * - \ref EMAC_INTSTS_RXOVIF_Msk : Receive FIFO Overflow - * - \ref EMAC_INTSTS_LPIF_Msk : Long Packet - * - \ref EMAC_INTSTS_RXGDIF_Msk : Receive Good - * - \ref EMAC_INTSTS_ALIEIF_Msk : Alignment Error - * - \ref EMAC_INTSTS_RPIF_Msk : Runt Packet - * - \ref EMAC_INTSTS_MPCOVIF_Msk : Missed Packet Counter - * - \ref EMAC_INTSTS_MFLEIF_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTSTS_DENIF_Msk : DMA Early Notification - * - \ref EMAC_INTSTS_RDUIF_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTSTS_RXBEIF_Msk : Receive Bus Error - * - \ref EMAC_INTSTS_CFRIF_Msk : Control Frame Receive - * - \ref EMAC_INTSTS_WOLIF_Msk : Wake on LAN - * - \ref EMAC_INTSTS_TXIF_Msk : Transmit - * - \ref EMAC_INTSTS_TXUDIF_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTSTS_TXCPIF_Msk : Transmit Completion - * - \ref EMAC_INTSTS_EXDEFIF_Msk : Defer Exceed - * - \ref EMAC_INTSTS_NCSIF_Msk : No Carrier Sense - * - \ref EMAC_INTSTS_TXABTIF_Msk : Transmit Abort - * - \ref EMAC_INTSTS_LCIF_Msk : Late Collision - * - \ref EMAC_INTSTS_TDUIF_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTSTS_TXBEIF_Msk : Transmit Bus Error - * - \ref EMAC_INTSTS_TSALMIF_Msk : Time Stamp Alarm - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro clear specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define EMAC_CLEAR_INT_FLAG(emac, u32eIntTypeFlag) ((emac)->INTSTS |= (u32eIntTypeFlag)) - -void EMAC_Open(uint8_t *pu8MacAddr); -void EMAC_Close(void); -void EMAC_SetMacAddr(uint8_t *pu8MacAddr); -void EMAC_EnableCamEntry(uint32_t u32Entry, uint8_t pu8MacAddr[]); -void EMAC_DisableCamEntry(uint32_t u32Entry); - -uint32_t EMAC_RecvPkt(uint8_t *pu8Data, uint32_t *pu32Size); -uint32_t EMAC_RecvPktTS(uint8_t *pu8Data, uint32_t *pu32Size, uint32_t *pu32Sec, uint32_t *pu32Nsec); -void EMAC_RecvPktDone(void); - -uint32_t EMAC_SendPkt(uint8_t *pu8Data, uint32_t u32Size); -uint32_t EMAC_SendPktDone(void); -uint32_t EMAC_SendPktDoneTS(uint32_t *pu32Sec, uint32_t *pu32Nsec); - -void EMAC_EnableTS(uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_DisableTS(void); -void EMAC_GetTime(uint32_t *pu32Sec, uint32_t *pu32Nsec); -void EMAC_SetTime(uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_UpdateTime(uint32_t u32Neg, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_EnableAlarm(uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_DisableAlarm(void); - -uint32_t EMAC_CheckLinkStatus(void); - -void EMAC_PhyInit(void); -int32_t EMAC_FillCamEntry(uint8_t pu8MacAddr[]); -uint8_t *EMAC_ClaimFreeTXBuf(void); -uint32_t EMAC_GetAvailRXBufSize(uint8_t** ppuDataBuf); -uint32_t EMAC_SendPktWoCopy(uint32_t u32Size); -void EMAC_RecvPktDoneWoRxTrigger(void); - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EMAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EMAC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_epwm.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_epwm.h deleted file mode 100644 index 01557f8054e..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_epwm.h +++ /dev/null @@ -1,645 +0,0 @@ -/**************************************************************************//** - * @file nu_epwm.h - * @version V3.00 - * @brief M480 series EPWM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EPWM_H__ -#define __NU_EPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - -/** @addtogroup EPWM_EXPORTED_CONSTANTS EPWM Exported Constants - @{ -*/ -#define EPWM_CHANNEL_NUM (6U) /*!< EPWM channel number \hideinitializer */ -#define EPWM_CH_0_MASK (0x1U) /*!< EPWM channel 0 mask \hideinitializer */ -#define EPWM_CH_1_MASK (0x2U) /*!< EPWM channel 1 mask \hideinitializer */ -#define EPWM_CH_2_MASK (0x4U) /*!< EPWM channel 2 mask \hideinitializer */ -#define EPWM_CH_3_MASK (0x8U) /*!< EPWM channel 3 mask \hideinitializer */ -#define EPWM_CH_4_MASK (0x10U) /*!< EPWM channel 4 mask \hideinitializer */ -#define EPWM_CH_5_MASK (0x20U) /*!< EPWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_UP_COUNTER (0U) /*!< Up counter type \hideinitializer */ -#define EPWM_DOWN_COUNTER (1U) /*!< Down counter type \hideinitializer */ -#define EPWM_UP_DOWN_COUNTER (2U) /*!< Up-Down counter type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_EDGE_ALIGNED (1U) /*!< EPWM working in edge aligned type(down count) \hideinitializer */ -#define EPWM_CENTER_ALIGNED (2U) /*!< EPWM working in center aligned type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_OUTPUT_NOTHING (0U) /*!< EPWM output nothing \hideinitializer */ -#define EPWM_OUTPUT_LOW (1U) /*!< EPWM output low \hideinitializer */ -#define EPWM_OUTPUT_HIGH (2U) /*!< EPWM output high \hideinitializer */ -#define EPWM_OUTPUT_TOGGLE (3U) /*!< EPWM output toggle \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_SSCTL_SSRC_EPWM0 (0U<CTL1 = (epwm)->CTL1 | (0x7ul<CTL1 = (epwm)->CTL1 & ~(0x7ul<CTL0 = (epwm)->CTL0 | EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief This macro disable group mode - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to disable group mode of EPWM module. - * \hideinitializer - */ -#define EPWM_DISABLE_GROUP_MODE(epwm) ((epwm)->CTL0 = (epwm)->CTL0 & ~EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief Enable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32SyncSrc Synchronous start source selection, valid values are: - * - \ref EPWM_SSCTL_SSRC_EPWM0 - * - \ref EPWM_SSCTL_SSRC_EPWM1 - * - \ref EPWM_SSCTL_SSRC_BPWM0 - * - \ref EPWM_SSCTL_SSRC_BPWM1 - * @return None - * @details This macro is used to enable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_TIMER_SYNC(epwm, u32ChannelMask, u32SyncSrc) ((epwm)->SSCTL = ((epwm)->SSCTL & ~EPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | (u32ChannelMask)) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_DISABLE_TIMER_SYNC(epwm, u32ChannelMask) \ - do{ \ - int i;\ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (epwm)->SSCTL &= ~(1UL << i); \ - } \ - }while(0) - -/** - * @brief This macro enable EPWM counter synchronous start counting function. - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to make selected EPWM0 and EPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by EPWM_ENABLE_TIMER_SYNC() and EPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC_START(epwm) ((epwm)->SSTRG = EPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to enable output inverter of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_OUTPUT_INVERTER(epwm, u32ChannelMask) ((epwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured rising data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_RISING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured falling data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_FALLING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define EPWM_MASK_OUTPUT(epwm, u32ChannelMask, u32LevelMask) \ - { \ - (epwm)->MSKEN = (u32ChannelMask); \ - (epwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @return None - * @details This macro is used to set the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescaler) ((epwm)->CLKPSC[(u32ChannelNum) >> 1] = (u32Prescaler)) - -/** - * @brief This macro get the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @details This macro is used to get the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_GET_PRESCALER(epwm, u32ChannelNum) ((epwm)->CLKPSC[(u32ChannelNum) >> 1U]) - -/** - * @brief This macro set the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_CMR(epwm, u32ChannelNum, u32CMR) ((epwm)->CMPDAT[(u32ChannelNum)]= (u32CMR)) - -/** - * @brief This macro get the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the comparator of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the comparator of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CMR(epwm, u32ChannelNum) ((epwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the free trigger comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32FTCMR Free trigger comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the free trigger comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_FTCMR(epwm, u32ChannelNum, u32FTCMR) (((epwm)->FTCMPDAT[((u32ChannelNum) >> 1U)]) = (u32FTCMR)) - -/** - * @brief This macro set the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the period of specified channel. - * @note This new setting will take effect on next EPWM period. - * @note EPWM counter will stop if period length set to 0. - * \hideinitializer - */ -#define EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR) ((epwm)->PERIOD[(u32ChannelNum)] = (u32CNR)) - -/** - * @brief This macro get the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the period of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the period of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CNR(epwm, u32ChannelNum) ((epwm)->PERIOD[(u32ChannelNum)]) - -/** - * @brief This macro set the EPWM aligned type - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32AlignedType EPWM aligned type, valid values are: - * - \ref EPWM_EDGE_ALIGNED - * - \ref EPWM_CENTER_ALIGNED - * @return None - * @details This macro is used to set the EPWM aligned type of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_ALIGNED_TYPE(epwm, u32ChannelMask, u32AlignedType) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (epwm)->CTL1 = (((epwm)->CTL1 & ~(3UL << (i << 1))) | ((u32AlignedType) << (i << 1))); \ - } \ - }while(0) - -/** - * @brief Set load window of window loading mode for specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to set load window of window loading mode for specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_LOAD_WINDOW(epwm, u32ChannelMask) ((epwm)->LOAD |= (u32ChannelMask)) - -/** - * @brief Trigger synchronous event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are 0, 2, 4 - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @return None - * @details This macro is used to trigger synchronous event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC(epwm, u32ChannelNum) ((epwm)->SWSYNC |= (1 << ((u32ChannelNum) >> 1))) - -/** - * @brief Clear counter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to clear counter of specified channel(s). - * \hideinitializer - */ -#define EPWM_CLR_COUNTER(epwm, u32ChannelMask) ((epwm)->CNTCLR |= (u32ChannelMask)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_OUTPUT_LEVEL(epwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) { \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (i << 1))) | ((u32ZeroLevel) << (i << 1))); \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))) | ((u32PeriodLevel) << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (i << 1))) | ((u32CmpUpLevel) << (i << 1))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))) | ((u32CmpDownLevel) << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))); \ - } \ - } \ - }while(0) - -/** - * @brief Trigger brake event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @param[in] u32BrakeType Type of brake trigger. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This macro is used to trigger brake event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_BRAKE(epwm, u32ChannelMask, u32BrakeType) ((epwm)->SWBRK |= ((u32ChannelMask) << (u32BrakeType))) - -/** - * @brief Set Dead zone clock source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32AfterPrescaler Dead zone clock source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @return None - * @details This macro is used to set Dead zone clock source. Every two channels share the same setting. - * @note The write-protection function should be disabled before using this function. - * \hideinitializer - */ -#define EPWM_SET_DEADZONE_CLK_SRC(epwm, u32ChannelNum, u32AfterPrescaler) \ - ((epwm)->DTCTL[(u32ChannelNum) >> 1] = (((epwm)->DTCTL[(u32ChannelNum) >> 1] & ~EPWM_DTCTL0_1_DTCKSEL_Msk) | \ - ((u32AfterPrescaler) << EPWM_DTCTL0_1_DTCKSEL_Pos))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt); -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource); -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode); -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration); -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc); -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase); -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm); -void EPWM_EnableSyncPinInverse(EPWM_T *epwm); -void EPWM_DisableSyncPinInverse(EPWM_T *epwm); -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule); -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable); -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel); -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle); -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt); -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); - -/*@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EPWM_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_fmc.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_fmc.h deleted file mode 100644 index 3c4197eeaff..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_fmc.h +++ /dev/null @@ -1,302 +0,0 @@ -/**************************************************************************//** - * @file nu_fmc.h - * @version V1.00 - * @brief M480 Series Flash Memory Controller Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_FMC_H__ -#define __NU_FMC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - - -/** @addtogroup FMC_EXPORTED_CONSTANTS FMC Exported Constants - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Base Address */ -/*---------------------------------------------------------------------------------------------------------*/ -#define FMC_APROM_BASE 0x00000000UL /*!< APROM base address \hideinitializer */ -#define FMC_APROM_END 0x00080000UL /*!< APROM end address \hideinitializer */ -#define FMC_APROM_BANK0_END (FMC_APROM_END/2UL) /*!< APROM bank0 end address \hideinitializer */ -#define FMC_LDROM_BASE 0x00100000UL /*!< LDROM base address \hideinitializer */ -#define FMC_LDROM_END 0x00101000UL /*!< LDROM end address \hideinitializer */ -#define FMC_SPROM_BASE 0x00200000UL /*!< SPROM base address \hideinitializer */ -#define FMC_SPROM_END 0x00201000UL /*!< SPROM end address \hideinitializer */ -#define FMC_XOM_BASE 0x00200000UL /*!< XOM Base Address \hideinitializer */ -#define FMC_XOMR0_BASE 0x00200000UL /*!< XOMR 0 Base Address \hideinitializer */ -#define FMC_XOMR1_BASE 0x00200010UL /*!< XOMR 1 Base Address \hideinitializer */ -#define FMC_XOMR2_BASE 0x00200020UL /*!< XOMR 2 Base Address \hideinitializer */ -#define FMC_XOMR3_BASE 0x00200030UL /*!< XOMR 3 Base Address \hideinitializer */ -#define FMC_CONFIG_BASE 0x00300000UL /*!< User Configuration address \hideinitializer */ -#define FMC_USER_CONFIG_0 0x00300000UL /*!< User Config 0 address \hideinitializer */ -#define FMC_USER_CONFIG_1 0x00300004UL /*!< User Config 1 address \hideinitializer */ -#define FMC_USER_CONFIG_2 0x00300008UL /*!< User Config 2 address \hideinitializer */ -#define FMC_KPROM_BASE 0x00301000UL /*!< Security ROM base address \hideinitializer */ -#define FMC_OTP_BASE 0x00310000UL /*!< OTP flash base address \hideinitializer */ - -#define FMC_FLASH_PAGE_SIZE 0x1000UL /*!< Flash Page Size (4K bytes) \hideinitializer */ -#define FMC_PAGE_ADDR_MASK 0xFFFFF000UL /*!< Flash page address mask \hideinitializer */ -#define FMC_MULTI_WORD_PROG_LEN 512 /*!< The maximum length of a multi-word program. */ - -#define FMC_APROM_SIZE FMC_APROM_END /*!< APROM Size \hideinitializer */ -#define FMC_BANK_SIZE (FMC_APROM_SIZE/2UL) /*!< APROM Bank Size \hideinitializer */ -#define FMC_LDROM_SIZE 0x1000UL /*!< LDROM Size (4 Kbytes) \hideinitializer */ -#define FMC_SPROM_SIZE 0x1000UL /*!< SPROM Size (4 Kbytes) \hideinitializer */ -#define FMC_OTP_ENTRY_CNT 256UL /*!< OTP entry number \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* XOM region number constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define XOMR0 0UL /*!< XOM region 0 */ -#define XOMR1 1UL /*!< XOM region 1 */ -#define XOMR2 2UL /*!< XOM region 2 */ -#define XOMR3 3UL /*!< XOM region 3 */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ISPCTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define IS_BOOT_FROM_LDROM 0x1UL /*!< ISPCTL setting to select to boot from LDROM */ -#define IS_BOOT_FROM_APROM 0x0UL /*!< ISPCTL setting to select to boot from APROM */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ISPCMD constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define FMC_ISPCMD_READ 0x00UL /*!< ISP Command: Read flash word \hideinitializer */ -#define FMC_ISPCMD_READ_UID 0x04UL /*!< ISP Command: Read Unique ID \hideinitializer */ -#define FMC_ISPCMD_READ_ALL1 0x08UL /*!< ISP Command: Read all-one result \hideinitializer */ -#define FMC_ISPCMD_READ_CID 0x0BUL /*!< ISP Command: Read Company ID \hideinitializer */ -#define FMC_ISPCMD_READ_DID 0x0CUL /*!< ISP Command: Read Device ID \hideinitializer */ -#define FMC_ISPCMD_READ_CKS 0x0DUL /*!< ISP Command: Read checksum \hideinitializer */ -#define FMC_ISPCMD_PROGRAM 0x21UL /*!< ISP Command: Write flash word \hideinitializer */ -#define FMC_ISPCMD_PAGE_ERASE 0x22UL /*!< ISP Command: Page Erase Flash \hideinitializer */ -#define FMC_ISPCMD_BANK_ERASE 0x23UL /*!< ISP Command: Erase Flash bank 0 or 1 \hideinitializer */ -#define FMC_ISPCMD_BLOCK_ERASE 0x25UL /*!< ISP Command: Erase 4 pages alignment of APROM in bank 0 or 1 \hideinitializer */ -#define FMC_ISPCMD_PROGRAM_MUL 0x27UL /*!< ISP Command: Multuple word program \hideinitializer */ -#define FMC_ISPCMD_RUN_ALL1 0x28UL /*!< ISP Command: Run all-one verification \hideinitializer */ -#define FMC_ISPCMD_RUN_CKS 0x2DUL /*!< ISP Command: Run checksum calculation \hideinitializer */ -#define FMC_ISPCMD_VECMAP 0x2EUL /*!< ISP Command: Vector Page Remap \hideinitializer */ -#define FMC_ISPCMD_READ_64 0x40UL /*!< ISP Command: Read double flash word \hideinitializer */ -#define FMC_ISPCMD_PROGRAM_64 0x61UL /*!< ISP Command: Write double flash word \hideinitializer */ - -#define READ_ALLONE_YES 0xA11FFFFFUL /*!< Check-all-one result is all one. \hideinitializer */ -#define READ_ALLONE_NOT 0xA1100000UL /*!< Check-all-one result is not all one. \hideinitializer */ -#define READ_ALLONE_CMD_FAIL 0xFFFFFFFFUL /*!< Check-all-one command failed. \hideinitializer */ - - -/*@}*/ /* end of group FMC_EXPORTED_CONSTANTS */ - - -/** @addtogroup FMC_EXPORTED_MACROS FMC Exported Macros - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macros */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define FMC_SET_APROM_BOOT() (FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk) /*!< Select booting from APROM \hideinitializer */ -#define FMC_SET_LDROM_BOOT() (FMC->ISPCTL |= FMC_ISPCTL_BS_Msk) /*!< Select booting from LDROM \hideinitializer */ -#define FMC_ENABLE_AP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk) /*!< Enable APROM update \hideinitializer */ -#define FMC_DISABLE_AP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk) /*!< Disable APROM update \hideinitializer */ -#define FMC_ENABLE_CFG_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) /*!< Enable User Config update \hideinitializer */ -#define FMC_DISABLE_CFG_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk) /*!< Disable User Config update \hideinitializer */ -#define FMC_ENABLE_LD_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) /*!< Enable LDROM update \hideinitializer */ -#define FMC_DISABLE_LD_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk) /*!< Disable LDROM update \hideinitializer */ -#define FMC_ENABLE_SP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_SPUEN_Msk) /*!< Enable SPROM update \hideinitializer */ -#define FMC_DISABLE_SP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_SPUEN_Msk) /*!< Disable SPROM update \hideinitializer */ -#define FMC_DISABLE_ISP() (FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk) /*!< Disable ISP function \hideinitializer */ -#define FMC_ENABLE_ISP() (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) /*!< Enable ISP function \hideinitializer */ -#define FMC_GET_FAIL_FLAG() ((FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) ? 1UL : 0UL) /*!< Get ISP fail flag \hideinitializer */ -#define FMC_CLR_FAIL_FLAG() (FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk) /*!< Clear ISP fail flag \hideinitializer */ - -/*@}*/ /* end of group FMC_EXPORTED_MACROS */ - - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -__STATIC_INLINE uint32_t FMC_ReadCID(void); -__STATIC_INLINE uint32_t FMC_ReadPID(void); -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index); -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index); -__STATIC_INLINE void FMC_SetVectorPageAddr(uint32_t u32PageAddr); -__STATIC_INLINE uint32_t FMC_GetVECMAP(void); - -/** - * @brief Get current vector mapping address. - * @param None - * @return The current vector mapping address. - * @details To get VECMAP value which is the page address for remapping to vector page (0x0). - * @note - * VECMAP only valid when new IAP function is enabled. (CBS = 10'b or 00'b) - */ -__STATIC_INLINE uint32_t FMC_GetVECMAP(void) -{ - return (FMC->ISPSTS & FMC_ISPSTS_VECMAP_Msk); -} - -/** - * @brief Read company ID - * @param None - * @return The company ID (32-bit) - * @details The company ID of Nuvoton is fixed to be 0xDA - */ -__STATIC_INLINE uint32_t FMC_ReadCID(void) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_CID; /* Set ISP Command Code */ - FMC->ISPADDR = 0x0u; /* Must keep 0x0 when read CID */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC->ISPDAT; -} - -/** - * @brief Read product ID - * @param None - * @return The product ID (32-bit) - * @details This function is used to read product ID. - */ -__STATIC_INLINE uint32_t FMC_ReadPID(void) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_DID; /* Set ISP Command Code */ - FMC->ISPADDR = 0x04u; /* Must keep 0x4 when read PID */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC->ISPDAT; -} - -/** - * @brief Read Unique ID - * @param[in] u8Index UID index. 0 = UID[31:0], 1 = UID[63:32], 2 = UID[95:64] - * @return The 32-bit unique ID data of specified UID index. - * @details To read out 96-bit Unique ID. - */ -__STATIC_INLINE uint32_t FMC_ReadUID(uint8_t u8Index) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_UID; - FMC->ISPADDR = ((uint32_t)u8Index << 2u); - FMC->ISPDAT = 0u; - FMC->ISPTRG = 0x1u; -#if ISBEN - __ISB(); -#endif - while(FMC->ISPTRG) {} - - return FMC->ISPDAT; -} - -/** - * @brief To read UCID - * @param[in] u32Index Index of the UCID to read. u32Index must be 0, 1, 2, or 3. - * @return The UCID of specified index - * @details This function is used to read unique chip ID (UCID). - */ -__STATIC_INLINE uint32_t FMC_ReadUCID(uint32_t u32Index) -{ - FMC->ISPCMD = FMC_ISPCMD_READ_UID; /* Set ISP Command Code */ - FMC->ISPADDR = (0x04u * u32Index) + 0x10u; /* The UCID is at offset 0x10 with word alignment. */ - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} /* Waiting for ISP Done */ - - return FMC->ISPDAT; -} - -/** - * @brief Set vector mapping address - * @param[in] u32PageAddr The page address to remap to address 0x0. The address must be page alignment. - * @return To set VECMAP to remap specified page address to 0x0. - * @details This function is used to set VECMAP to map specified page to vector page (0x0). - * @note - * VECMAP only valid when new IAP function is enabled. (CBS = 10'b or 00'b) - */ -__STATIC_INLINE void FMC_SetVectorPageAddr(uint32_t u32PageAddr) -{ - FMC->ISPCMD = FMC_ISPCMD_VECMAP; /* Set ISP Command Code */ - FMC->ISPADDR = u32PageAddr; /* The address of specified page which will be map to address 0x0. It must be page alignment. */ - FMC->ISPTRG = 0x1u; /* Trigger to start ISP procedure */ -#if ISBEN - __ISB(); -#endif /* To make sure ISP/CPU be Synchronized */ - while(FMC->ISPTRG) {} /* Waiting for ISP Done */ -} - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -void FMC_Close(void); -int32_t FMC_ConfigXOM(uint32_t xom_num, uint32_t xom_base, uint8_t xom_page); -int32_t FMC_Erase(uint32_t u32PageAddr); -int32_t FMC_Erase_SPROM(void); -int32_t FMC_Erase_Block(uint32_t u32BlockAddr); -int32_t FMC_Erase_Bank(uint32_t u32BankAddr); -int32_t FMC_EraseXOM(uint32_t xom_num); -int32_t FMC_GetXOMState(uint32_t xom_num); -int32_t FMC_GetBootSource(void); -void FMC_Open(void); -uint32_t FMC_Read(uint32_t u32Addr); -int32_t FMC_Read_64(uint32_t u32addr, uint32_t * u32data0, uint32_t * u32data1); -uint32_t FMC_ReadDataFlashBaseAddr(void); -void FMC_SetBootSource(int32_t i32BootSrc); -void FMC_Write(uint32_t u32Addr, uint32_t u32Data); -int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1); -int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len); -int32_t FMC_Write_OTP(uint32_t otp_num, uint32_t low_word, uint32_t high_word); -int32_t FMC_Read_OTP(uint32_t otp_num, uint32_t *low_word, uint32_t *high_word); -int32_t FMC_Lock_OTP(uint32_t otp_num); -int32_t FMC_Is_OTP_Locked(uint32_t otp_num); -int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count); -int32_t FMC_WriteConfig(uint32_t u32Config[], uint32_t u32Count); -uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count); -uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count); -int32_t FMC_SetSPKey(uint32_t key[3], uint32_t kpmax, uint32_t kemax, const int32_t lock_CONFIG, const int32_t lock_SPROM); -int32_t FMC_CompareSPKey(uint32_t key[3]); - - -/*@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group FMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_FMC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_gpio.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_gpio.h deleted file mode 100644 index 08ce10ce59e..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_gpio.h +++ /dev/null @@ -1,497 +0,0 @@ -/**************************************************************************//** - * @file GPIO.h - * @version V3.00 - * @brief M480 series GPIO driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_GPIO_H__ -#define __NU_GPIO_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_CONSTANTS GPIO Exported Constants - @{ -*/ - - -#define GPIO_PIN_MAX 16UL /*!< Specify Maximum Pins of Each GPIO Port \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_MODE_INPUT 0x0UL /*!< Input Mode \hideinitializer */ -#define GPIO_MODE_OUTPUT 0x1UL /*!< Output Mode \hideinitializer */ -#define GPIO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode \hideinitializer */ -#define GPIO_MODE_QUASI 0x3UL /*!< Quasi-bidirectional Mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Interrupt Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INT_RISING 0x00010000UL /*!< Interrupt enable by Input Rising Edge \hideinitializer */ -#define GPIO_INT_FALLING 0x00000001UL /*!< Interrupt enable by Input Falling Edge \hideinitializer */ -#define GPIO_INT_BOTH_EDGE 0x00010001UL /*!< Interrupt enable by both Rising Edge and Falling Edge \hideinitializer */ -#define GPIO_INT_HIGH 0x01010000UL /*!< Interrupt enable by Level-High \hideinitializer */ -#define GPIO_INT_LOW 0x01000001UL /*!< Interrupt enable by Level-Level \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_INTTYPE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INTTYPE_EDGE 0UL /*!< GPIO_INTTYPE Setting for Edge Trigger Mode \hideinitializer */ -#define GPIO_INTTYPE_LEVEL 1UL /*!< GPIO_INTTYPE Setting for Edge Level Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Slew Rate Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_SLEWCTL_NORMAL 0x0UL /*!< GPIO slew setting for normal Mode \hideinitializer */ -#define GPIO_SLEWCTL_HIGH 0x1UL /*!< GPIO slew setting for high Mode \hideinitializer */ -#define GPIO_SLEWCTL_FAST 0x2UL /*!< GPIO slew setting for fast Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Pull-up And Pull-down Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_PUSEL_DISABLE 0x0UL /*!< GPIO PUSEL setting for Disable Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_UP 0x1UL /*!< GPIO PUSEL setting for Pull-up Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_DOWN 0x2UL /*!< GPIO PUSEL setting for Pull-down Mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_DBCTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_DBCTL_ICLK_ON 0x00000020UL /*!< GPIO_DBCTL setting for all IO pins edge detection circuit is always active after reset \hideinitializer */ -#define GPIO_DBCTL_ICLK_OFF 0x00000000UL /*!< GPIO_DBCTL setting for edge detection circuit is active only if IO pin corresponding GPIOx_IEN bit is set to 1 \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSRC_LIRC 0x00000010UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the internal 10 kHz \hideinitializer */ -#define GPIO_DBCTL_DBCLKSRC_HCLK 0x00000000UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the HCLK \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSEL_1 0x00000000UL /*!< GPIO_DBCTL setting for sampling cycle = 1 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2 0x00000001UL /*!< GPIO_DBCTL setting for sampling cycle = 2 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4 0x00000002UL /*!< GPIO_DBCTL setting for sampling cycle = 4 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8 0x00000003UL /*!< GPIO_DBCTL setting for sampling cycle = 8 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16 0x00000004UL /*!< GPIO_DBCTL setting for sampling cycle = 16 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32 0x00000005UL /*!< GPIO_DBCTL setting for sampling cycle = 32 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_64 0x00000006UL /*!< GPIO_DBCTL setting for sampling cycle = 64 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_128 0x00000007UL /*!< GPIO_DBCTL setting for sampling cycle = 128 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_256 0x00000008UL /*!< GPIO_DBCTL setting for sampling cycle = 256 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_512 0x00000009UL /*!< GPIO_DBCTL setting for sampling cycle = 512 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_1024 0x0000000AUL /*!< GPIO_DBCTL setting for sampling cycle = 1024 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2048 0x0000000BUL /*!< GPIO_DBCTL setting for sampling cycle = 2048 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4096 0x0000000CUL /*!< GPIO_DBCTL setting for sampling cycle = 4096 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8192 0x0000000DUL /*!< GPIO_DBCTL setting for sampling cycle = 8192 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16384 0x0000000EUL /*!< GPIO_DBCTL setting for sampling cycle = 16384 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32768 0x0000000FUL /*!< GPIO_DBCTL setting for sampling cycle = 32768 clocks \hideinitializer */ - - -/* Define GPIO Pin Data Input/Output. It could be used to control each I/O pin by pin address mapping. - Example 1: - - PA0 = 1; - - It is used to set GPIO PA.0 to high; - - Example 2: - - if (PA0) - PA0 = 0; - - If GPIO PA.0 pin status is high, then set GPIO PA.0 data output to low. - */ -#define GPIO_PIN_DATA(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2)))) /*!< Pin Data Input/Output \hideinitializer */ -#define PA0 GPIO_PIN_DATA(0, 0 ) /*!< Specify PA.0 Pin Data Input/Output \hideinitializer */ -#define PA1 GPIO_PIN_DATA(0, 1 ) /*!< Specify PA.1 Pin Data Input/Output \hideinitializer */ -#define PA2 GPIO_PIN_DATA(0, 2 ) /*!< Specify PA.2 Pin Data Input/Output \hideinitializer */ -#define PA3 GPIO_PIN_DATA(0, 3 ) /*!< Specify PA.3 Pin Data Input/Output \hideinitializer */ -#define PA4 GPIO_PIN_DATA(0, 4 ) /*!< Specify PA.4 Pin Data Input/Output \hideinitializer */ -#define PA5 GPIO_PIN_DATA(0, 5 ) /*!< Specify PA.5 Pin Data Input/Output \hideinitializer */ -#define PA6 GPIO_PIN_DATA(0, 6 ) /*!< Specify PA.6 Pin Data Input/Output \hideinitializer */ -#define PA7 GPIO_PIN_DATA(0, 7 ) /*!< Specify PA.7 Pin Data Input/Output \hideinitializer */ -#define PA8 GPIO_PIN_DATA(0, 8 ) /*!< Specify PA.8 Pin Data Input/Output \hideinitializer */ -#define PA9 GPIO_PIN_DATA(0, 9 ) /*!< Specify PA.9 Pin Data Input/Output \hideinitializer */ -#define PA10 GPIO_PIN_DATA(0, 10) /*!< Specify PA.10 Pin Data Input/Output \hideinitializer */ -#define PA11 GPIO_PIN_DATA(0, 11) /*!< Specify PA.11 Pin Data Input/Output \hideinitializer */ -#define PA12 GPIO_PIN_DATA(0, 12) /*!< Specify PA.12 Pin Data Input/Output \hideinitializer */ -#define PA13 GPIO_PIN_DATA(0, 13) /*!< Specify PA.13 Pin Data Input/Output \hideinitializer */ -#define PA14 GPIO_PIN_DATA(0, 14) /*!< Specify PA.14 Pin Data Input/Output \hideinitializer */ -#define PA15 GPIO_PIN_DATA(0, 15) /*!< Specify PA.15 Pin Data Input/Output \hideinitializer */ -#define PB0 GPIO_PIN_DATA(1, 0 ) /*!< Specify PB.0 Pin Data Input/Output \hideinitializer */ -#define PB1 GPIO_PIN_DATA(1, 1 ) /*!< Specify PB.1 Pin Data Input/Output \hideinitializer */ -#define PB2 GPIO_PIN_DATA(1, 2 ) /*!< Specify PB.2 Pin Data Input/Output \hideinitializer */ -#define PB3 GPIO_PIN_DATA(1, 3 ) /*!< Specify PB.3 Pin Data Input/Output \hideinitializer */ -#define PB4 GPIO_PIN_DATA(1, 4 ) /*!< Specify PB.4 Pin Data Input/Output \hideinitializer */ -#define PB5 GPIO_PIN_DATA(1, 5 ) /*!< Specify PB.5 Pin Data Input/Output \hideinitializer */ -#define PB6 GPIO_PIN_DATA(1, 6 ) /*!< Specify PB.6 Pin Data Input/Output \hideinitializer */ -#define PB7 GPIO_PIN_DATA(1, 7 ) /*!< Specify PB.7 Pin Data Input/Output \hideinitializer */ -#define PB8 GPIO_PIN_DATA(1, 8 ) /*!< Specify PB.8 Pin Data Input/Output \hideinitializer */ -#define PB9 GPIO_PIN_DATA(1, 9 ) /*!< Specify PB.9 Pin Data Input/Output \hideinitializer */ -#define PB10 GPIO_PIN_DATA(1, 10) /*!< Specify PB.10 Pin Data Input/Output \hideinitializer */ -#define PB11 GPIO_PIN_DATA(1, 11) /*!< Specify PB.11 Pin Data Input/Output \hideinitializer */ -#define PB12 GPIO_PIN_DATA(1, 12) /*!< Specify PB.12 Pin Data Input/Output \hideinitializer */ -#define PB13 GPIO_PIN_DATA(1, 13) /*!< Specify PB.13 Pin Data Input/Output \hideinitializer */ -#define PB14 GPIO_PIN_DATA(1, 14) /*!< Specify PB.14 Pin Data Input/Output \hideinitializer */ -#define PB15 GPIO_PIN_DATA(1, 15) /*!< Specify PB.15 Pin Data Input/Output \hideinitializer */ -#define PC0 GPIO_PIN_DATA(2, 0 ) /*!< Specify PC.0 Pin Data Input/Output \hideinitializer */ -#define PC1 GPIO_PIN_DATA(2, 1 ) /*!< Specify PC.1 Pin Data Input/Output \hideinitializer */ -#define PC2 GPIO_PIN_DATA(2, 2 ) /*!< Specify PC.2 Pin Data Input/Output \hideinitializer */ -#define PC3 GPIO_PIN_DATA(2, 3 ) /*!< Specify PC.3 Pin Data Input/Output \hideinitializer */ -#define PC4 GPIO_PIN_DATA(2, 4 ) /*!< Specify PC.4 Pin Data Input/Output \hideinitializer */ -#define PC5 GPIO_PIN_DATA(2, 5 ) /*!< Specify PC.5 Pin Data Input/Output \hideinitializer */ -#define PC6 GPIO_PIN_DATA(2, 6 ) /*!< Specify PC.6 Pin Data Input/Output \hideinitializer */ -#define PC7 GPIO_PIN_DATA(2, 7 ) /*!< Specify PC.7 Pin Data Input/Output \hideinitializer */ -#define PC8 GPIO_PIN_DATA(2, 8 ) /*!< Specify PC.8 Pin Data Input/Output \hideinitializer */ -#define PC9 GPIO_PIN_DATA(2, 9 ) /*!< Specify PC.9 Pin Data Input/Output \hideinitializer */ -#define PC10 GPIO_PIN_DATA(2, 10) /*!< Specify PC.10 Pin Data Input/Output \hideinitializer */ -#define PC11 GPIO_PIN_DATA(2, 11) /*!< Specify PC.11 Pin Data Input/Output \hideinitializer */ -#define PC12 GPIO_PIN_DATA(2, 12) /*!< Specify PC.12 Pin Data Input/Output \hideinitializer */ -#define PC13 GPIO_PIN_DATA(2, 13) /*!< Specify PC.13 Pin Data Input/Output \hideinitializer */ -#define PC14 GPIO_PIN_DATA(2, 14) /*!< Specify PC.14 Pin Data Input/Output \hideinitializer */ -#define PD0 GPIO_PIN_DATA(3, 0 ) /*!< Specify PD.0 Pin Data Input/Output \hideinitializer */ -#define PD1 GPIO_PIN_DATA(3, 1 ) /*!< Specify PD.1 Pin Data Input/Output \hideinitializer */ -#define PD2 GPIO_PIN_DATA(3, 2 ) /*!< Specify PD.2 Pin Data Input/Output \hideinitializer */ -#define PD3 GPIO_PIN_DATA(3, 3 ) /*!< Specify PD.3 Pin Data Input/Output \hideinitializer */ -#define PD4 GPIO_PIN_DATA(3, 4 ) /*!< Specify PD.4 Pin Data Input/Output \hideinitializer */ -#define PD5 GPIO_PIN_DATA(3, 5 ) /*!< Specify PD.5 Pin Data Input/Output \hideinitializer */ -#define PD6 GPIO_PIN_DATA(3, 6 ) /*!< Specify PD.6 Pin Data Input/Output \hideinitializer */ -#define PD7 GPIO_PIN_DATA(3, 7 ) /*!< Specify PD.7 Pin Data Input/Output \hideinitializer */ -#define PD8 GPIO_PIN_DATA(3, 8 ) /*!< Specify PD.8 Pin Data Input/Output \hideinitializer */ -#define PD9 GPIO_PIN_DATA(3, 9 ) /*!< Specify PD.9 Pin Data Input/Output \hideinitializer */ -#define PD10 GPIO_PIN_DATA(3, 10) /*!< Specify PD.10 Pin Data Input/Output \hideinitializer */ -#define PD11 GPIO_PIN_DATA(3, 11) /*!< Specify PD.11 Pin Data Input/Output \hideinitializer */ -#define PD12 GPIO_PIN_DATA(3, 12) /*!< Specify PD.12 Pin Data Input/Output \hideinitializer */ -#define PD13 GPIO_PIN_DATA(3, 13) /*!< Specify PD.13 Pin Data Input/Output \hideinitializer */ -#define PD14 GPIO_PIN_DATA(3, 14) /*!< Specify PD.14 Pin Data Input/Output \hideinitializer */ -#define PE0 GPIO_PIN_DATA(4, 0 ) /*!< Specify PE.0 Pin Data Input/Output \hideinitializer */ -#define PE1 GPIO_PIN_DATA(4, 1 ) /*!< Specify PE.1 Pin Data Input/Output \hideinitializer */ -#define PE2 GPIO_PIN_DATA(4, 2 ) /*!< Specify PE.2 Pin Data Input/Output \hideinitializer */ -#define PE3 GPIO_PIN_DATA(4, 3 ) /*!< Specify PE.3 Pin Data Input/Output \hideinitializer */ -#define PE4 GPIO_PIN_DATA(4, 4 ) /*!< Specify PE.4 Pin Data Input/Output \hideinitializer */ -#define PE5 GPIO_PIN_DATA(4, 5 ) /*!< Specify PE.5 Pin Data Input/Output \hideinitializer */ -#define PE6 GPIO_PIN_DATA(4, 6 ) /*!< Specify PE.6 Pin Data Input/Output \hideinitializer */ -#define PE7 GPIO_PIN_DATA(4, 7 ) /*!< Specify PE.7 Pin Data Input/Output \hideinitializer */ -#define PE8 GPIO_PIN_DATA(4, 8 ) /*!< Specify PE.8 Pin Data Input/Output \hideinitializer */ -#define PE9 GPIO_PIN_DATA(4, 9 ) /*!< Specify PE.9 Pin Data Input/Output \hideinitializer */ -#define PE10 GPIO_PIN_DATA(4, 10) /*!< Specify PE.10 Pin Data Input/Output \hideinitializer */ -#define PE11 GPIO_PIN_DATA(4, 11) /*!< Specify PE.11 Pin Data Input/Output \hideinitializer */ -#define PE12 GPIO_PIN_DATA(4, 12) /*!< Specify PE.12 Pin Data Input/Output \hideinitializer */ -#define PE13 GPIO_PIN_DATA(4, 13) /*!< Specify PE.13 Pin Data Input/Output \hideinitializer */ -#define PE14 GPIO_PIN_DATA(4, 14) /*!< Specify PE.14 Pin Data Input/Output \hideinitializer */ -#define PE15 GPIO_PIN_DATA(4, 15) /*!< Specify PE.15 Pin Data Input/Output \hideinitializer */ -#define PF0 GPIO_PIN_DATA(5, 0 ) /*!< Specify PF.0 Pin Data Input/Output \hideinitializer */ -#define PF1 GPIO_PIN_DATA(5, 1 ) /*!< Specify PF.1 Pin Data Input/Output \hideinitializer */ -#define PF2 GPIO_PIN_DATA(5, 2 ) /*!< Specify PF.2 Pin Data Input/Output \hideinitializer */ -#define PF3 GPIO_PIN_DATA(5, 3 ) /*!< Specify PF.3 Pin Data Input/Output \hideinitializer */ -#define PF4 GPIO_PIN_DATA(5, 4 ) /*!< Specify PF.4 Pin Data Input/Output \hideinitializer */ -#define PF5 GPIO_PIN_DATA(5, 5 ) /*!< Specify PF.5 Pin Data Input/Output \hideinitializer */ -#define PF6 GPIO_PIN_DATA(5, 6 ) /*!< Specify PF.6 Pin Data Input/Output \hideinitializer */ -#define PF7 GPIO_PIN_DATA(5, 7 ) /*!< Specify PF.7 Pin Data Input/Output \hideinitializer */ -#define PF8 GPIO_PIN_DATA(5, 8 ) /*!< Specify PF.8 Pin Data Input/Output \hideinitializer */ -#define PF9 GPIO_PIN_DATA(5, 9 ) /*!< Specify PF.9 Pin Data Input/Output \hideinitializer */ -#define PF10 GPIO_PIN_DATA(5, 10) /*!< Specify PF.10 Pin Data Input/Output \hideinitializer */ -#define PF11 GPIO_PIN_DATA(5, 11) /*!< Specify PF.11 Pin Data Input/Output \hideinitializer */ -#define PG0 GPIO_PIN_DATA(6, 0 ) /*!< Specify PG.0 Pin Data Input/Output \hideinitializer */ -#define PG1 GPIO_PIN_DATA(6, 1 ) /*!< Specify PG.1 Pin Data Input/Output \hideinitializer */ -#define PG2 GPIO_PIN_DATA(6, 2 ) /*!< Specify PG.2 Pin Data Input/Output \hideinitializer */ -#define PG3 GPIO_PIN_DATA(6, 3 ) /*!< Specify PG.3 Pin Data Input/Output \hideinitializer */ -#define PG4 GPIO_PIN_DATA(6, 4 ) /*!< Specify PG.4 Pin Data Input/Output \hideinitializer */ -#define PG5 GPIO_PIN_DATA(6, 5 ) /*!< Specify PG.5 Pin Data Input/Output \hideinitializer */ -#define PG6 GPIO_PIN_DATA(6, 6 ) /*!< Specify PG.6 Pin Data Input/Output \hideinitializer */ -#define PG7 GPIO_PIN_DATA(6, 7 ) /*!< Specify PG.7 Pin Data Input/Output \hideinitializer */ -#define PG8 GPIO_PIN_DATA(6, 8 ) /*!< Specify PG.8 Pin Data Input/Output \hideinitializer */ -#define PG9 GPIO_PIN_DATA(6, 9 ) /*!< Specify PG.9 Pin Data Input/Output \hideinitializer */ -#define PG10 GPIO_PIN_DATA(6, 10) /*!< Specify PG.10 Pin Data Input/Output \hideinitializer */ -#define PG11 GPIO_PIN_DATA(6, 11) /*!< Specify PG.11 Pin Data Input/Output \hideinitializer */ -#define PG12 GPIO_PIN_DATA(6, 12) /*!< Specify PG.12 Pin Data Input/Output \hideinitializer */ -#define PG13 GPIO_PIN_DATA(6, 13) /*!< Specify PG.13 Pin Data Input/Output \hideinitializer */ -#define PG14 GPIO_PIN_DATA(6, 14) /*!< Specify PG.14 Pin Data Input/Output \hideinitializer */ -#define PG15 GPIO_PIN_DATA(6, 15) /*!< Specify PG.15 Pin Data Input/Output \hideinitializer */ -#define PH0 GPIO_PIN_DATA(7, 0 ) /*!< Specify PH.0 Pin Data Input/Output \hideinitializer */ -#define PH1 GPIO_PIN_DATA(7, 1 ) /*!< Specify PH.1 Pin Data Input/Output \hideinitializer */ -#define PH2 GPIO_PIN_DATA(7, 2 ) /*!< Specify PH.2 Pin Data Input/Output \hideinitializer */ -#define PH3 GPIO_PIN_DATA(7, 3 ) /*!< Specify PH.3 Pin Data Input/Output \hideinitializer */ -#define PH4 GPIO_PIN_DATA(7, 4 ) /*!< Specify PH.4 Pin Data Input/Output \hideinitializer */ -#define PH5 GPIO_PIN_DATA(7, 5 ) /*!< Specify PH.5 Pin Data Input/Output \hideinitializer */ -#define PH6 GPIO_PIN_DATA(7, 6 ) /*!< Specify PH.6 Pin Data Input/Output \hideinitializer */ -#define PH7 GPIO_PIN_DATA(7, 7 ) /*!< Specify PH.7 Pin Data Input/Output \hideinitializer */ -#define PH8 GPIO_PIN_DATA(7, 8 ) /*!< Specify PH.8 Pin Data Input/Output \hideinitializer */ -#define PH9 GPIO_PIN_DATA(7, 9 ) /*!< Specify PH.9 Pin Data Input/Output \hideinitializer */ -#define PH10 GPIO_PIN_DATA(7, 10) /*!< Specify PH.10 Pin Data Input/Output \hideinitializer */ -#define PH11 GPIO_PIN_DATA(7, 11) /*!< Specify PH.11 Pin Data Input/Output \hideinitializer */ - - -/*@}*/ /* end of group GPIO_EXPORTED_CONSTANTS */ - - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Clear GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Clear the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_CLR_INT_FLAG(port, u32PinMask) ((port)->INTSRC = (u32PinMask)) - -/** - * @brief Disable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask)) - -/** - * @brief Enable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * @return None - * - * @details Enable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask)) - -/** - * @brief Disable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16)) - -/** - * @brief Enable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Enable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16)) - -/** - * @brief Disable I/O DOUT mask - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask)) - -/** - * @brief Enable I/O DOUT mask - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Enable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask)) - -/** - * @brief Get GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @retval 0 No interrupt at specified GPIO pin - * @retval 1 The specified GPIO pin generate an interrupt - * - * @details Get the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask)) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] u32ClkSrc The de-bounce counter clock source. It could be GPIO_DBCTL_DBCLKSRC_HCLK or GPIO_DBCTL_DBCLKSRC_LIRC. - * @param[in] u32ClkSel The de-bounce sampling cycle selection. It could be - * - \ref GPIO_DBCTL_DBCLKSEL_1 - * - \ref GPIO_DBCTL_DBCLKSEL_2 - * - \ref GPIO_DBCTL_DBCLKSEL_4 - * - \ref GPIO_DBCTL_DBCLKSEL_8 - * - \ref GPIO_DBCTL_DBCLKSEL_16 - * - \ref GPIO_DBCTL_DBCLKSEL_32 - * - \ref GPIO_DBCTL_DBCLKSEL_64 - * - \ref GPIO_DBCTL_DBCLKSEL_128 - * - \ref GPIO_DBCTL_DBCLKSEL_256 - * - \ref GPIO_DBCTL_DBCLKSEL_512 - * - \ref GPIO_DBCTL_DBCLKSEL_1024 - * - \ref GPIO_DBCTL_DBCLKSEL_2048 - * - \ref GPIO_DBCTL_DBCLKSEL_4096 - * - \ref GPIO_DBCTL_DBCLKSEL_8192 - * - \ref GPIO_DBCTL_DBCLKSEL_16384 - * - \ref GPIO_DBCTL_DBCLKSEL_32768 - * - * @return None - * - * @details Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source. \n - * Example: _GPIO_SET_DEBOUNCE_TIME(GPIO_DBCTL_DBCLKSRC_LIRC, GPIO_DBCTL_DBCLKSEL_4). \n - * It's meaning the De-debounce counter clock source is internal 10 KHz and sampling cycle selection is 4. \n - * Then the target de-bounce sampling cycle time is (4)*(1/(10*1000)) s = 4*0.0001 s = 400 us, - * and system will sampling interrupt input once per 00 us. - * \hideinitializer - */ -#define GPIO_SET_DEBOUNCE_TIME(u32ClkSrc, u32ClkSel) (GPIO->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) - -/** - * @brief Get GPIO Port IN Data - * -* @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * - * @return The specified port data - * - * @details Get the PIN register of specified GPIO port. - * \hideinitializer - */ -#define GPIO_GET_IN_DATA(port) ((port)->PIN) - -/** - * @brief Set GPIO Port OUT Data - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Data GPIO port data. - * - * @return None - * - * @details Set the Data into specified GPIO port. - * \hideinitializer - */ -#define GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data)) - -/** - * @brief Toggle Specified GPIO pin - * - * @param[in] u32Pin Pxy - * - * @return None - * - * @details Toggle the specified GPIO pint. - * \hideinitializer - */ -#define GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1) - - -/** - * @brief Enable External GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be \n - * GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_EnableEINT GPIO_EnableInt - -/** - * @brief Disable External GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_DisableEINT GPIO_DisableInt - - -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs); -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin); -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_GPIO_H__ */ - -/*** (C) COPYRIGHT 2013~2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsotg.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsotg.h deleted file mode 100644 index b561f226748..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsotg.h +++ /dev/null @@ -1,268 +0,0 @@ -/**************************************************************************//** - * @file nu_hsotg.h - * @version V0.10 - * @brief M480 Series HSOTG Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_HSOTG_H__ -#define __NU_HSOTG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HSOTG_Driver HSOTG Driver - @{ -*/ - - -/** @addtogroup HSOTG_EXPORTED_CONSTANTS HSOTG Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* HSOTG constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define HSOTG_VBUS_EN_ACTIVE_HIGH (0UL) /*!< USB VBUS power switch enable signal is active high. \hideinitializer */ -#define HSOTG_VBUS_EN_ACTIVE_LOW (1UL) /*!< USB VBUS power switch enable signal is active low. \hideinitializer */ -#define HSOTG_VBUS_ST_VALID_HIGH (0UL) /*!< USB VBUS power switch valid status is high. \hideinitializer */ -#define HSOTG_VBUS_ST_VALID_LOW (1UL) /*!< USB VBUS power switch valid status is low. \hideinitializer */ - - -/*@}*/ /* end of group HSOTG_EXPORTED_CONSTANTS */ - - -/** @addtogroup HSOTG_EXPORTED_FUNCTIONS HSOTG Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable HSOTG function - * @param None - * @return None - * @details This macro will set OTGEN bit of HSOTG_CTL register to enable HSOTG function. - * \hideinitializer - */ -#define HSOTG_ENABLE() (HSOTG->CTL |= HSOTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to disable HSOTG function - * @param None - * @return None - * @details This macro will clear OTGEN bit of HSOTG_CTL register to disable HSOTG function. - * \hideinitializer - */ -#define HSOTG_DISABLE() (HSOTG->CTL &= ~HSOTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to enable USB PHY - * @param None - * @return None - * @details When the USB role is selected as HSOTG device, use this macro to enable USB PHY. - * This macro will set OTGPHYEN bit of HSOTG_PHYCTL register to enable USB PHY. - * \hideinitializer - */ -#define HSOTG_ENABLE_PHY() (HSOTG->PHYCTL |= HSOTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to disable USB PHY - * @param None - * @return None - * @details This macro will clear OTGPHYEN bit of HSOTG_PHYCTL register to disable USB PHY. - * \hideinitializer - */ -#define HSOTG_DISABLE_PHY() (HSOTG->PHYCTL &= ~HSOTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to enable ID detection function - * @param None - * @return None - * @details This macro will set IDDETEN bit of HSOTG_PHYCTL register to enable ID detection function. - * \hideinitializer - */ -#define HSOTG_ENABLE_ID_DETECT() (HSOTG->PHYCTL |= HSOTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to disable ID detection function - * @param None - * @return None - * @details This macro will clear IDDETEN bit of HSOTG_PHYCTL register to disable ID detection function. - * \hideinitializer - */ -#define HSOTG_DISABLE_ID_DETECT() (HSOTG->PHYCTL &= ~HSOTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to enable HSOTG wake-up function - * @param None - * @return None - * @details This macro will set WKEN bit of HSOTG_CTL register to enable HSOTG wake-up function. - * \hideinitializer - */ -#define HSOTG_ENABLE_WAKEUP() (HSOTG->CTL |= HSOTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable HSOTG wake-up function - * @param None - * @return None - * @details This macro will clear WKEN bit of HSOTG_CTL register to disable HSOTG wake-up function. - * \hideinitializer - */ -#define HSOTG_DISABLE_WAKEUP() (HSOTG->CTL &= ~HSOTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to set the polarity of USB_VBUS_EN pin - * @param[in] u32Pol The polarity selection. Valid values are listed below. - * - \ref HSOTG_VBUS_EN_ACTIVE_HIGH - * - \ref HSOTG_VBUS_EN_ACTIVE_LOW - * @return None - * @details This macro is used to set the polarity of external USB VBUS power switch enable signal. - * \hideinitializer - */ -#define HSOTG_SET_VBUS_EN_POL(u32Pol) (HSOTG->PHYCTL = (HSOTG->PHYCTL & (~HSOTG_PHYCTL_VBENPOL_Msk)) | ((u32Pol)<PHYCTL = (HSOTG->PHYCTL & (~HSOTG_PHYCTL_VBSTSPOL_Msk)) | ((u32Pol)<INTEN |= (u32Mask)) - -/** - * @brief This macro is used to disable HSOTG related interrupts - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref HSOTG_INTEN_ROLECHGIEN_Msk - * - \ref HSOTG_INTEN_VBEIEN_Msk - * - \ref HSOTG_INTEN_SRPFIEN_Msk - * - \ref HSOTG_INTEN_HNPFIEN_Msk - * - \ref HSOTG_INTEN_GOIDLEIEN_Msk - * - \ref HSOTG_INTEN_IDCHGIEN_Msk - * - \ref HSOTG_INTEN_PDEVIEN_Msk - * - \ref HSOTG_INTEN_HOSTIEN_Msk - * - \ref HSOTG_INTEN_BVLDCHGIEN_Msk - * - \ref HSOTG_INTEN_AVLDCHGIEN_Msk - * - \ref HSOTG_INTEN_VBCHGIEN_Msk - * - \ref HSOTG_INTEN_SECHGIEN_Msk - * - \ref HSOTG_INTEN_SRPDETIEN_Msk - * @return None - * @details This macro will disable HSOTG related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_DISABLE_INT(u32Mask) (HSOTG->INTEN &= ~(u32Mask)) - -/** - * @brief This macro is used to get HSOTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref HSOTG_INTSTS_ROLECHGIF_Msk - * - \ref HSOTG_INTSTS_VBEIF_Msk - * - \ref HSOTG_INTSTS_SRPFIF_Msk - * - \ref HSOTG_INTSTS_HNPFIF_Msk - * - \ref HSOTG_INTSTS_GOIDLEIF_Msk - * - \ref HSOTG_INTSTS_IDCHGIF_Msk - * - \ref HSOTG_INTSTS_PDEVIF_Msk - * - \ref HSOTG_INTSTS_HOSTIF_Msk - * - \ref HSOTG_INTSTS_BVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_AVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_VBCHGIF_Msk - * - \ref HSOTG_INTSTS_SECHGIF_Msk - * - \ref HSOTG_INTSTS_SRPDETIF_Msk - * @return Interrupt flags of selected sources. - * @details This macro will return HSOTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_GET_INT_FLAG(u32Mask) (HSOTG->INTSTS & (u32Mask)) - -/** - * @brief This macro is used to clear HSOTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref HSOTG_INTSTS_ROLECHGIF_Msk - * - \ref HSOTG_INTSTS_VBEIF_Msk - * - \ref HSOTG_INTSTS_SRPFIF_Msk - * - \ref HSOTG_INTSTS_HNPFIF_Msk - * - \ref HSOTG_INTSTS_GOIDLEIF_Msk - * - \ref HSOTG_INTSTS_IDCHGIF_Msk - * - \ref HSOTG_INTSTS_PDEVIF_Msk - * - \ref HSOTG_INTSTS_HOSTIF_Msk - * - \ref HSOTG_INTSTS_BVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_AVLDCHGIF_Msk - * - \ref HSOTG_INTSTS_VBCHGIF_Msk - * - \ref HSOTG_INTSTS_SECHGIF_Msk - * - \ref HSOTG_INTSTS_SRPDETIF_Msk - * @return None - * @details This macro will clear HSOTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_CLR_INT_FLAG(u32Mask) (HSOTG->INTSTS = (u32Mask)) - -/** - * @brief This macro is used to get HSOTG related status - * @param[in] u32Mask The combination of user specified source. Valid values are listed below. - * - \ref HSOTG_STATUS_OVERCUR_Msk - * - \ref HSOTG_STATUS_IDSTS_Msk - * - \ref HSOTG_STATUS_SESSEND_Msk - * - \ref HSOTG_STATUS_BVLD_Msk - * - \ref HSOTG_STATUS_AVLD_Msk - * - \ref HSOTG_STATUS_VBUSVLD_Msk - * @return The user specified status. - * @details This macro will return HSOTG related status specified by u32Mask parameter. - * \hideinitializer - */ -#define HSOTG_GET_STATUS(u32Mask) (HSOTG->STATUS & (u32Mask)) - - - -/*@}*/ /* end of group HSOTG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HSOTG_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - - -#endif /* __NU_HSOTG_H__ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsusbd.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsusbd.h deleted file mode 100644 index 3fcebb1b2da..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_hsusbd.h +++ /dev/null @@ -1,382 +0,0 @@ -/**************************************************************************//** - * @file nu_hsusbd.h - * @version V1.00 - * @brief M480 HSUSBD driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_HSUSBD_H__ -#define __NU_HSUSBD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HSUSBD_Driver HSUSBD Driver - @{ -*/ - -/** @addtogroup HSUSBD_EXPORTED_CONSTANTS HSUSBD Exported Constants - @{ -*/ -/** @cond HIDDEN_SYMBOLS */ -#define HSUSBD_MAX_EP 12ul - -#define Maximum(a,b) (a)>(b) ? (a) : (b) -#define Minimum(a,b) (((a)<(b)) ? (a) : (b)) - - -#define CEP 0xfful /*!< Control Endpoint \hideinitializer */ -#define EPA 0ul /*!< Endpoint A \hideinitializer */ -#define EPB 1ul /*!< Endpoint B \hideinitializer */ -#define EPC 2ul /*!< Endpoint C \hideinitializer */ -#define EPD 3ul /*!< Endpoint D \hideinitializer */ -#define EPE 4ul /*!< Endpoint E \hideinitializer */ -#define EPF 5ul /*!< Endpoint F \hideinitializer */ -#define EPG 6ul /*!< Endpoint G \hideinitializer */ -#define EPH 7ul /*!< Endpoint H \hideinitializer */ -#define EPI 8ul /*!< Endpoint I \hideinitializer */ -#define EPJ 9ul /*!< Endpoint J \hideinitializer */ -#define EPK 10ul /*!< Endpoint K \hideinitializer */ -#define EPL 11ul /*!< Endpoint L \hideinitializer */ - -/** @endcond HIDDEN_SYMBOLS */ -/********************* Bit definition of CEPCTL register **********************/ -#define HSUSBD_CEPCTL_NAKCLR ((uint32_t)0x00000000ul) /*!PHYCTL |= (HSUSBD_PHYCTL_PHYEN_Msk|HSUSBD_PHYCTL_DPPUEN_Msk))) /*!PHYCTL &= ~HSUSBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= HSUSBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~HSUSBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~HSUSBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= HSUSBD_PHYCTL_DPPUEN_Msk)) /*!FADDR = (addr)) /*!FADDR)) /*!GINTEN = (intr)) /*!BUSINTEN = (intr)) /*!BUSINTSTS) /*!BUSINTSTS = (flag)) /*!CEPINTEN = (intr)) /*!CEPINTSTS = (flag)) /*!CEPCTL = (flag)) /*!CEPTXCNT = (size)) /*!EP[(ep)].EPMPS = (size)) /*!EP[(ep)].EPINTEN = (intr)) /*!EP[(ep)].EPINTSTS) /*!EP[(ep)].EPINTSTS = (flag)) /*!DMACNT = (len)) /*!DMAADDR = (addr)) /*!DMACTL = (HSUSBD->DMACTL & ~HSUSBD_DMACTL_EPNUM_Msk) | HSUSBD_DMACTL_DMARD_Msk | (epnum) | 0x100) /*!DMACTL = (HSUSBD->DMACTL & ~(HSUSBD_DMACTL_EPNUM_Msk | HSUSBD_DMACTL_DMARD_Msk | 0x100)) | (epnum)) /*!DMACTL |= HSUSBD_DMACTL_DMAEN_Msk) /*!PHYCTL & HSUSBD_PHYCTL_VBUSDET_Msk)) /*!DMACNT = 0ul; - HSUSBD->DMACTL = 0x80ul; - HSUSBD->DMACTL = 0x00ul; -} -/** - * @brief HSUSBD_SetEpBufAddr, Set Endpoint buffer address - * @param[in] u32Ep Endpoint Number - * @param[in] u32Base Buffer Start Address - * @param[in] u32Len Buffer length - * @retval None. - */ -__STATIC_INLINE void HSUSBD_SetEpBufAddr(uint32_t u32Ep, uint32_t u32Base, uint32_t u32Len) -{ - if (u32Ep == CEP) - { - HSUSBD->CEPBUFST = u32Base; - HSUSBD->CEPBUFEND = u32Base + u32Len - 1ul; - } - else - { - HSUSBD->EP[u32Ep].EPBUFST = u32Base; - HSUSBD->EP[u32Ep].EPBUFEND = u32Base + u32Len - 1ul; - } -} - -/** - * @brief HSUSBD_ConfigEp, Config Endpoint - * @param[in] u32Ep USB endpoint - * @param[in] u32EpNum Endpoint number - * @param[in] u32EpType Endpoint type - * @param[in] u32EpDir Endpoint direction - * @retval None. - */ -__STATIC_INLINE void HSUSBD_ConfigEp(uint32_t u32Ep, uint32_t u32EpNum, uint32_t u32EpType, uint32_t u32EpDir) -{ - if (u32EpType == HSUSBD_EP_CFG_TYPE_BULK) - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD_EP_RSPCTL_FLUSH|HSUSBD_EP_RSPCTL_MODE_AUTO); - } - else if (u32EpType == HSUSBD_EP_CFG_TYPE_INT) - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD_EP_RSPCTL_FLUSH|HSUSBD_EP_RSPCTL_MODE_MANUAL); - } - else if (u32EpType == HSUSBD_EP_CFG_TYPE_ISO) - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD_EP_RSPCTL_FLUSH|HSUSBD_EP_RSPCTL_MODE_FLY); - } - - HSUSBD->EP[u32Ep].EPCFG = (u32EpType|u32EpDir|HSUSBD_EP_CFG_VALID|(u32EpNum << 4)); -} - -/** - * @brief Set USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - */ -__STATIC_INLINE void HSUSBD_SetEpStall(uint32_t u32Ep) -{ - if (u32Ep == CEP) - { - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALL); - } - else - { - HSUSBD->EP[u32Ep].EPRSPCTL = (HSUSBD->EP[u32Ep].EPRSPCTL & 0xf7ul) | HSUSBD_EP_RSPCTL_HALT; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Set USB endpoint stall state, endpoint will return STALL token. - */ -__STATIC_INLINE void HSUSBD_SetStall(uint32_t u32EpNum) -{ - uint32_t i; - - if (u32EpNum == 0ul) - { - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALL); - } - else - { - for (i=0ul; iEP[i].EPCFG & 0xf0ul) >> 4) == u32EpNum) - { - HSUSBD->EP[i].EPRSPCTL = (HSUSBD->EP[i].EPRSPCTL & 0xf7ul) | HSUSBD_EP_RSPCTL_HALT; - } - } - } -} - -/** - * @brief Clear USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - */ -__STATIC_INLINE void HSUSBD_ClearEpStall(uint32_t u32Ep) -{ - HSUSBD->EP[u32Ep].EPRSPCTL = HSUSBD_EP_RSPCTL_TOGGLE; -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Clear USB endpoint stall state, endpoint will return ACK/NAK token. - */ -__STATIC_INLINE void HSUSBD_ClearStall(uint32_t u32EpNum) -{ - uint32_t i; - - for (i=0ul; iEP[i].EPCFG & 0xf0ul) >> 4) == u32EpNum) - { - HSUSBD->EP[i].EPRSPCTL = HSUSBD_EP_RSPCTL_TOGGLE; - } - } -} - -/** - * @brief Get USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * @details Get USB endpoint stall state of the specified endpoint ID. - */ -__STATIC_INLINE uint32_t HSUSBD_GetEpStall(uint32_t u32Ep) -{ - return (HSUSBD->EP[u32Ep].EPRSPCTL & HSUSBD_EP_RSPCTL_HALT); -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @retval 0: USB endpoint is not stalled. - * @retval non-0: USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - */ -__STATIC_INLINE uint32_t HSUSBD_GetStall(uint32_t u32EpNum) -{ - uint32_t i; - uint32_t val = 0ul; - - for (i=0ul; iEP[i].EPCFG & 0xf0ul) >> 4) == u32EpNum) - { - val = (HSUSBD->EP[i].EPRSPCTL & HSUSBD_EP_RSPCTL_HALT); - break; - } - } - return val; -} - - -/*-------------------------------------------------------------------------------------------*/ -typedef void (*HSUSBD_VENDOR_REQ)(void); /*!CTL0 = ((i2c)->CTL0 & ~0x3c) | (u8Ctrl)) - -/** - * @brief The macro is used to set START condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus START condition in I2C_CTL register. - * \hideinitializer - */ -#define I2C_START(i2c) ((i2c)->CTL0 = ((i2c)->CTL0 & ~I2C_CTL0_SI_Msk) | I2C_CTL0_STA_Msk) - -/** - * @brief The macro is used to wait I2C bus status get ready - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When a new status is presented of I2C bus, the SI flag will be set in I2C_CTL register. - * \hideinitializer - */ -#define I2C_WAIT_READY(i2c) while(!((i2c)->CTL0 & I2C_CTL0_SI_Msk)) - -/** - * @brief The macro is used to Read I2C Bus Data Register - * - * @param[in] i2c Specify I2C port - * - * @return A byte of I2C data register - * - * @details I2C controller read data from bus and save it in I2CDAT register. - * \hideinitializer - */ -#define I2C_GET_DATA(i2c) ((i2c)->DAT) - -/** - * @brief Write a Data to I2C Data Register - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data A byte that writes to data register - * - * @return None - * - * @details When write a data to I2C_DAT register, the I2C controller will shift it to I2C bus. - * \hideinitializer - */ -#define I2C_SET_DATA(i2c, u8Data) ((i2c)->DAT = (u8Data)) - -/** - * @brief Get I2C Bus status code - * - * @param[in] i2c Specify I2C port - * - * @return I2C status code - * - * @details To get this status code to monitor I2C bus event. - * \hideinitializer - */ -#define I2C_GET_STATUS(i2c) ((i2c)->STATUS0) - -/** - * @brief Get Time-out flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 I2C Bus time-out is not happened - * @retval 1 I2C Bus time-out is happened - * - * @details When I2C bus occurs time-out event, the time-out flag will be set. - * \hideinitializer - */ -#define I2C_GET_TIMEOUT_FLAG(i2c) ( ((i2c)->TOCTL & I2C_TOCTL_TOIF_Msk) == I2C_TOCTL_TOIF_Msk ? 1:0 ) - -/** - * @brief To get wake-up flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details I2C bus occurs wake-up event, wake-up flag will be set. - * \hideinitializer - */ -#define I2C_GET_WAKEUP_FLAG(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKIF_Msk) == I2C_WKSTS_WKIF_Msk ? 1:0 ) - -/** - * @brief To clear wake-up flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define I2C_CLEAR_WAKEUP_FLAG(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKIF_Msk) - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * \hideinitializer - * - */ -#define I2C_SMBUS_GET_STATUS(i2c) ((i2c)->BUSSTS) - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return Packet error check byte value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * \hideinitializer - */ -#define I2C_SMBUS_GET_PEC_VALUE(i2c) ((i2c)->PKTCRC) - -/** - * @brief Set SMBus Bytes number of Transmission or reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * \hideinitializer - */ -#define I2C_SMBUS_SET_PACKET_BYTE_COUNT(i2c, u32PktSize) ((i2c)->PKTSIZE = (u32PktSize)) - -/** - * @brief Enable SMBus Alert function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin will pull lo, and reply ACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is set, the Alert pin is supported to receive alert state(Lo trigger) - * \hideinitializer - */ -#define I2C_SMBUS_ENABLE_ALERT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Disable SMBus Alert pin function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Device Mode(BMHEN=0): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin will pull hi, and reply NACK when get ARP from host - * Host Mode(BMHEN=1): If ALERTEN(I2C_BUSCTL[4]) is clear, the Alert pin is not supported to receive alert state(Lo trigger) - * \hideinitializer - */ -#define I2C_SMBUS_DISABLE_ALERT(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ALERTEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is output mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output mode. - * - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_OUT(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin is input mode - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is input mode. - * - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_IN(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOEN_Msk) - -/** - * @brief Set SMBus SUSCON pin output high state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output hi state. - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_HIGH(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_SCTLOSTS_Msk) - - -/** - * @brief Set SMBus SUSCON pin output low state - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function to set SUSCON(I2C_BUSCTL[6]) pin is output lo state. - * \hideinitializer - */ -#define I2C_SMBUS_SET_SUSCON_LOW(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_SCTLOSTS_Msk) - -/** - * @brief Enable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The 9th bit can response the ACK or NACK according the received data by user. When the byte is received, SCLK line stretching to low between the 8th and 9th SCLK pulse. - * \hideinitializer - */ -#define I2C_SMBUS_ACK_MANUAL(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Disable SMBus Acknowledge control by manual - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable acknowledge response control by user. - * \hideinitializer - */ -#define I2C_SMBUS_ACK_AUTO(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKMEN_Msk) - -/** - * @brief Enable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * \hideinitializer - */ -#define I2C_SMBUS_9THBIT_INT_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Disable SMBus Acknowledge manual interrupt - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable SMBUS acknowledge manual interrupt on the 9th clock cycle when SMBUS=1 and ACKMEN=1 - * \hideinitializer - */ -#define I2C_SMBUS_9THBIT_INT_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_ACKM9SI_Msk) - -/** - * @brief Enable SMBus PEC clear at REPEAT START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to enable the condition of REAEAT START can clear the PEC calculation. - * \hideinitializer - */ -#define I2C_SMBUS_RST_PEC_AT_START_ENABLE(i2c) ((i2c)->BUSCTL |= I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Disable SMBus PEC clear at Repeat START - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details This function is used to disable the condition of Repeat START can clear the PEC calculation. - * \hideinitializer - */ -#define I2C_SMBUS_RST_PEC_AT_START_DISABLE(i2c) ((i2c)->BUSCTL &= ~I2C_BUSCTL_PECCLR_Msk) - -/** - * @brief Enable RX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set RXPDMAEN bit of I2C_CTL1 register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_RX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Enable TX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set TXPDMAEN bit of I2C_CTL1 register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_TX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear RXPDMAEN bit of I2C_CTL1 register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_RX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear TXPDMAEN bit of I2C_CTL1 register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_TX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Enable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Enable this function is to stretch bus by hardware after PDMA transfer is done if SI is not cleared. - * \hideinitializer - */ -#define I2C_ENABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Disable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C will send STOP after PDMA transfers done automatically. - * \hideinitializer - */ -#define I2C_DISABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Reset PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C PDMA engine will be reset after this function is called. - * \hideinitializer - */ -#define I2C_DISABLE_RST_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMARST_Msk) - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c); - -/** - * @brief The macro is used to set STOP condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus STOP condition in I2C_CTL register. - */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c) -{ - - (i2c)->CTL0 |= (I2C_CTL0_SI_Msk | I2C_CTL0_STO_Msk); - while(i2c->CTL0 & I2C_CTL0_STO_Msk) - { - } -} - -void I2C_ClearTimeoutFlag(I2C_T *i2c); -void I2C_Close(I2C_T *i2c); -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack); -void I2C_DisableInt(I2C_T *i2c); -void I2C_EnableInt(I2C_T *i2c); -uint32_t I2C_GetBusClockFreq(I2C_T *i2c); -uint32_t I2C_GetIntFlag(I2C_T *i2c); -uint32_t I2C_GetStatus(I2C_T *i2c); -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock); -uint8_t I2C_GetData(I2C_T *i2c); -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode); -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask); -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock); -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout); -void I2C_DisableTimeout(I2C_T *i2c); -void I2C_EnableWakeup(I2C_T *i2c); -void I2C_DisableWakeup(I2C_T *i2c); -void I2C_SetData(I2C_T *i2c, uint8_t u8Data); -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag); -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr); -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint32_t I2C_SMBusGetStatus(I2C_T *i2c); -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize); -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice); -void I2C_SMBusClose(I2C_T *i2c); -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn); -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c); -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk); -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk); - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_i2s.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_i2s.h deleted file mode 100644 index 096c6c0d1ae..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_i2s.h +++ /dev/null @@ -1,353 +0,0 @@ -/****************************************************************************//** - * @file nu_i2s.h - * @version V0.10 - * @brief M480 I2S driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_I2S_H__ -#define __NU_I2S_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ -#define I2S_DATABIT_8 (0U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 8-bit \hideinitializer */ -#define I2S_DATABIT_16 (1U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 16-bit \hideinitializer */ -#define I2S_DATABIT_24 (2U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 24-bit \hideinitializer */ -#define I2S_DATABIT_32 (3U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 32-bit \hideinitializer */ - -/* Audio Format */ -#define I2S_ENABLE_MONO I2S_CTL0_MONO_Msk /*!< Mono channel \hideinitializer */ -#define I2S_DISABLE_MONO (0U) /*!< Stereo channel \hideinitializer */ - -/* I2S Data Format */ -#define I2S_FORMAT_I2S (0U << I2S_CTL0_FORMAT_Pos) /*!< I2S data format \hideinitializer */ -#define I2S_FORMAT_I2S_MSB (1U << I2S_CTL0_FORMAT_Pos) /*!< I2S MSB data format \hideinitializer */ -#define I2S_FORMAT_I2S_LSB (2U << I2S_CTL0_FORMAT_Pos) /*!< I2S LSB data format \hideinitializer */ -#define I2S_FORMAT_PCM (4U << I2S_CTL0_FORMAT_Pos) /*!< PCM data format \hideinitializer */ -#define I2S_FORMAT_PCM_MSB (5U << I2S_CTL0_FORMAT_Pos) /*!< PCM MSB data format \hideinitializer */ -#define I2S_FORMAT_PCM_LSB (6U << I2S_CTL0_FORMAT_Pos) /*!< PCM LSB data format \hideinitializer */ - -/* I2S Data Format */ -#define I2S_ORDER_AT_MSB (0U) /*!< Channel data is at MSB \hideinitializer */ -#define I2S_ORDER_AT_LSB I2S_CTL0_ORDER_Msk /*!< Channel data is at LSB \hideinitializer */ - -/* I2S TDM Channel Number */ -#define I2S_TDM_2CH 0U /*!< Use TDM 2 channel \hideinitializer */ -#define I2S_TDM_4CH 1U /*!< Use TDM 4 channel \hideinitializer */ -#define I2S_TDM_6CH 2U /*!< Use TDM 6 channel \hideinitializer */ -#define I2S_TDM_8CH 3U /*!< Use TDM 8 channel \hideinitializer */ - -/* I2S TDM Channel Width */ -#define I2S_TDM_WIDTH_8BIT 0U /*!< TDM channel witch is 8-bit \hideinitializer */ -#define I2S_TDM_WIDTH_16BIT 1U /*!< TDM channel witch is 16-bit \hideinitializer */ -#define I2S_TDM_WIDTH_24BIT 2U /*!< TDM channel witch is 24-bit \hideinitializer */ -#define I2S_TDM_WIDTH_32BIT 3U /*!< TDM channel witch is 32-bit \hideinitializer */ - -/* I2S TDM Sync Width */ -#define I2S_TDM_SYNC_ONE_BCLK 0U /*!< TDM sync widht is one BLCK period \hideinitializer */ -#define I2S_TDM_SYNC_ONE_CHANNEL 1U /*!< TDM sync widht is one channel period \hideinitializer */ - -/* I2S Operation mode */ -#define I2S_MODE_SLAVE I2S_CTL0_SLAVE_Msk /*!< As slave mode \hideinitializer */ -#define I2S_MODE_MASTER (0u) /*!< As master mode \hideinitializer */ - -/* I2S FIFO Threshold */ -#define I2S_FIFO_TX_LEVEL_WORD_0 (0U) /*!< TX threshold is 0 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_1 (1U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_2 (2U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_3 (3U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_4 (4U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_5 (5U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_6 (6U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_7 (7U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_8 (8U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_9 (9U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_10 (10U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_11 (11U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_12 (12U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_13 (13U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_14 (14U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_15 (15U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 15 words \hideinitializer */ - -#define I2S_FIFO_RX_LEVEL_WORD_1 (0U) /*!< RX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_2 (1U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_3 (2U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_4 (3U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_5 (4U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_6 (5U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_7 (6U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_8 (7U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_9 (8U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_10 (9U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_11 (10U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_12 (11U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_13 (12U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_14 (13U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_15 (14U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 15 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_16 (15U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 16 words \hideinitializer */ - -/* I2S Record Channel */ -#define I2S_MONO_RIGHT (0U) /*!< Record mono right channel \hideinitializer */ -#define I2S_MONO_LEFT I2S_CTL0_RXLCH_Msk /*!< Record mono left channel \hideinitializer */ - -/* I2S Channel */ -#define I2S_RIGHT (0U) /*!< Select right channel \hideinitializer */ -#define I2S_LEFT (1U) /*!< Select left channel \hideinitializer */ - -/*@}*/ /* end of group I2S_EXPORTED_CONSTANTS */ - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/** - * @brief Enable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_ENABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if((u32ChMask > 0U) && (u32ChMask < 9U)) - { - i2s->CTL1 |= ((uint32_t)1U << (u32ChMask-1U)); - } -} - -/** - * @brief Disable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_DISABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if((u32ChMask > 0U) && (u32ChMask < 9U)) - { - i2s->CTL1 &= ~((uint32_t)1U << (u32ChMask-1U)); - } -} - -/** - * @brief Enable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXEN_Msk ) - -/** - * @brief Disable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXEN_Msk ) - -/** - * @brief Enable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXEN_Msk ) - -/** - * @brief Disable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXEN_Msk ) - -/** - * @brief Enable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX_MUTE(i2s) ( (i2s)->CTL0 |= I2S_CTL0_MUTE_Msk ) - -/** - * @brief Disable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX_MUTE(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_MUTE_Msk ) - -/** - * @brief Clear Tx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_TX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXFBCLR_Msk ) - -/** - * @brief Clear Rx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_RX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref I2S_MONO_LEFT - * - \ref I2S_MONO_RIGHT - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_SET_MONO_RX_CHANNEL(I2S_T *i2s, uint32_t u32Ch) -{ - u32Ch == I2S_MONO_LEFT ? - (i2s->CTL0 |= I2S_CTL0_RXLCH_Msk) : - (i2s->CTL0 &= ~I2S_CTL0_RXLCH_Msk); -} - -/** - * @brief Write data to I2S Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Data: The data written to FIFO. - * @return none - * \hideinitializer - */ -#define I2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TXFIFO = (u32Data) ) - -/** - * @brief Read Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return Data in Rx FIFO. - * \hideinitializer - */ -#define I2S_READ_RX_FIFO(i2s) ( (i2s)->RXFIFO ) - -/** - * @brief This function gets the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 & (u32Mask) ) - -/** - * @brief This function clears the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 |= (u32Mask) ) - -/** - * @brief This function gets the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 & (u32Mask) ) - -/** - * @brief This function clears the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 |= (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_TX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_TXCNT_Msk) >> I2S_STATUS1_TXCNT_Pos) & 0xF ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_RX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_RXCNT_Msk) >> I2S_STATUS1_RXCNT_Pos) & 0xF ) - -void I2S_Close(I2S_T *i2s); -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask); -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask); -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock); -void I2S_DisableMCLK(I2S_T *i2s); -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth); -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat); - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_opa.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_opa.h deleted file mode 100644 index 8d2baa9d180..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_opa.h +++ /dev/null @@ -1,209 +0,0 @@ -/**************************************************************************//** - * @file nu_opa.h - * @version V3.00 - * @brief M480 series OPA driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_OPA_H__ -#define __NU_OPA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup OPA_Driver OPA Driver - @{ -*/ - -/** @addtogroup OPA_EXPORTED_CONSTANTS OPA Exported Constants - @{ -*/ -#define OPA_CALIBRATION_CLK_1K (0UL) /*!< OPA calibration clock select 1 KHz \hideinitializer */ -#define OPA_CALIBRATION_RV_1_2_AVDD (0UL) /*!< OPA calibration reference voltage select 1/2 AVDD \hideinitializer */ -#define OPA_CALIBRATION_RV_H_L_VCM (1UL) /*!< OPA calibration reference voltage select from high vcm to low vcm \hideinitializer */ - -/*@}*/ /* end of group OPA_EXPORTED_CONSTANTS */ - -/** @addtogroup OPA_EXPORTED_FUNCTIONS OPA Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define OPA functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -__STATIC_INLINE int32_t OPA_Calibration(OPA_T *opa, uint32_t u32OpaNum, uint32_t u32ClockSel, uint32_t u32LevelSel); - -/** - * @brief This macro is used to power on the OPA circuit - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will set OPx_EN (x=0, 1) bit of OPACR register to power on the OPA circuit. - * @note Remember to enable HIRC clock while power on the OPA circuit. - * \hideinitializer - */ -#define OPA_POWER_ON(opa, u32OpaNum) ((opa)->CTL |= (1UL<<(OPA_CTL_OPEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to power down the OPA circuit - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will clear OPx_EN (x=0, 1) bit of OPACR register to power down the OPA circuit. - * \hideinitializer - */ -#define OPA_POWER_DOWN(opa, u32OpaNum) ((opa)->CTL &= ~(1UL<<(OPA_CTL_OPEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to enable the OPA Schmitt trigger buffer - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will set OPSCHx_EN (x=0, 1) bit of OPACR register to enable the OPA Schmitt trigger buffer. - * \hideinitializer - */ -#define OPA_ENABLE_SCH_TRIGGER(opa, u32OpaNum) ((opa)->CTL |= (1UL<<(OPA_CTL_OPDOEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to disable the OPA Schmitt trigger buffer - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will clear OPSCHx_EN (x=0, 1) bit of OPACR register to disable the OPA Schmitt trigger buffer. - * \hideinitializer - */ -#define OPA_DISABLE_SCH_TRIGGER(opa, u32OpaNum) ((opa)->CTL &= ~(1UL<<(OPA_CTL_OPDOEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to enable OPA Schmitt trigger digital output interrupt - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will set OPDIEx (x=0, 1) bit of OPACR register to enable the OPA Schmitt trigger digital output interrupt. - * \hideinitializer - */ -#define OPA_ENABLE_INT(opa, u32OpaNum) ((opa)->CTL |= (1UL<<(OPA_CTL_OPDOIEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to disable OPA Schmitt trigger digital output interrupt - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will clear OPDIEx (x=0, 1) bit of OPACR register to disable the OPA Schmitt trigger digital output interrupt. - * \hideinitializer - */ -#define OPA_DISABLE_INT(opa, u32OpaNum) ((opa)->CTL &= ~(1UL<<(OPA_CTL_OPDOIEN0_Pos+(u32OpaNum)))) - -/** - * @brief This macro is used to get OPA digital output state - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return OPA digital output state - * @details This macro will return the OPA digital output value. - * \hideinitializer - */ -#define OPA_GET_DIGITAL_OUTPUT(opa, u32OpaNum) (((opa)->STATUS & (OPA_STATUS_OPDO0_Msk<<(u32OpaNum)))?1UL:0UL) - -/** - * @brief This macro is used to get OPA interrupt flag - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @retval 0 OPA interrupt does not occur. - * @retval 1 OPA interrupt occurs. - * @details This macro will return the ACMP interrupt flag. - * \hideinitializer - */ -#define OPA_GET_INT_FLAG(opa, u32OpaNum) (((opa)->STATUS & (OPA_STATUS_OPDOIF0_Msk<<(u32OpaNum)))?1UL:0UL) - -/** - * @brief This macro is used to clear OPA interrupt flag - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @return None - * @details This macro will write 1 to OPDFx (x=0,1) bit of OPASR register to clear interrupt flag. - * \hideinitializer - */ -#define OPA_CLR_INT_FLAG(opa, u32OpaNum) ((opa)->STATUS = (OPA_STATUS_OPDOIF0_Msk<<(u32OpaNum))) - - -/** - * @brief This function is used to configure and start OPA calibration - * @param[in] opa The pointer of the specified OPA module - * @param[in] u32OpaNum The OPA number. 0 for OPA0; 1 for OPA1; 2 for OPA2. - * @param[in] u32ClockSel Select OPA calibration clock - * - \ref OPA_CALIBRATION_CLK_1K - * @param[in] u32RefVol Select OPA reference voltage - * - \ref OPA_CALIBRATION_RV_1_2_AVDD - * - \ref OPA_CALIBRATION_RV_H_L_VCM - * @retval 0 PMOS and NMOS calibration successfully. - * @retval -1 only PMOS calibration failed. - * @retval -2 only NMOS calibration failed. - * @retval -3 PMOS and NMOS calibration failed. - */ -__STATIC_INLINE int32_t OPA_Calibration(OPA_T *opa, - uint32_t u32OpaNum, - uint32_t u32ClockSel, - uint32_t u32RefVol) -{ - uint32_t u32CALResult; - int32_t i32Ret = 0L; - - (opa)->CALCTL = (((opa)->CALCTL) & ~(OPA_CALCTL_CALCLK0_Msk << (u32OpaNum << 1))); - (opa)->CALCTL = (((opa)->CALCTL) & ~(OPA_CALCTL_CALRVS0_Msk << (u32OpaNum))) | (((u32RefVol) << OPA_CALCTL_CALRVS0_Pos) << (u32OpaNum)); - (opa)->CALCTL |= (OPA_CALCTL_CALTRG0_Msk << (u32OpaNum)); - while((opa)->CALCTL & (OPA_CALCTL_CALTRG0_Msk << (u32OpaNum))) {} - - u32CALResult = ((opa)->CALST >> ((u32OpaNum)*4U)) & (OPA_CALST_CALNS0_Msk|OPA_CALST_CALPS0_Msk); - if (u32CALResult == 0U) - { - i32Ret = 0L; - } - else if (u32CALResult == OPA_CALST_CALNS0_Msk) - { - i32Ret = -2L; - } - else if (u32CALResult == OPA_CALST_CALPS0_Msk) - { - i32Ret = -1L; - } - else if (u32CALResult == (OPA_CALST_CALNS0_Msk|OPA_CALST_CALPS0_Msk)) - { - i32Ret = -3L; - } - - return i32Ret; -} - -/** - * @brief This macro is used to generate asynchronous reset signals to OPA controller - * @param None - * @return None - * \hideinitializer - */ -#define OPA_Reset() \ -do { \ - SYS->IPRST2 |= SYS_IPRST2_OPARST_Msk; \ - SYS->IPRST2 &= ~SYS_IPRST2_OPARST_Msk; \ -} while(0) - -/*@}*/ /* end of group OPA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group OPA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_OPA_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_otg.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_otg.h deleted file mode 100644 index 21c4b8be240..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_otg.h +++ /dev/null @@ -1,268 +0,0 @@ -/**************************************************************************//** - * @file nu_otg.h - * @version V0.10 - * @brief M480 Series OTG Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_OTG_H__ -#define __NU_OTG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup OTG_Driver OTG Driver - @{ -*/ - - -/** @addtogroup OTG_EXPORTED_CONSTANTS OTG Exported Constants - @{ -*/ - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* OTG constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define OTG_VBUS_EN_ACTIVE_HIGH (0UL) /*!< USB VBUS power switch enable signal is active high. \hideinitializer */ -#define OTG_VBUS_EN_ACTIVE_LOW (1UL) /*!< USB VBUS power switch enable signal is active low. \hideinitializer */ -#define OTG_VBUS_ST_VALID_HIGH (0UL) /*!< USB VBUS power switch valid status is high. \hideinitializer */ -#define OTG_VBUS_ST_VALID_LOW (1UL) /*!< USB VBUS power switch valid status is low. \hideinitializer */ - - -/*@}*/ /* end of group OTG_EXPORTED_CONSTANTS */ - - -/** @addtogroup OTG_EXPORTED_FUNCTIONS OTG Exported Functions - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - - -/** - * @brief This macro is used to enable OTG function - * @param None - * @return None - * @details This macro will set OTGEN bit of OTG_CTL register to enable OTG function. - * \hideinitializer - */ -#define OTG_ENABLE() (OTG->CTL |= OTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to disable OTG function - * @param None - * @return None - * @details This macro will clear OTGEN bit of OTG_CTL register to disable OTG function. - * \hideinitializer - */ -#define OTG_DISABLE() (OTG->CTL &= ~OTG_CTL_OTGEN_Msk) - -/** - * @brief This macro is used to enable USB PHY - * @param None - * @return None - * @details When the USB role is selected as OTG device, use this macro to enable USB PHY. - * This macro will set OTGPHYEN bit of OTG_PHYCTL register to enable USB PHY. - * \hideinitializer - */ -#define OTG_ENABLE_PHY() (OTG->PHYCTL |= OTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to disable USB PHY - * @param None - * @return None - * @details This macro will clear OTGPHYEN bit of OTG_PHYCTL register to disable USB PHY. - * \hideinitializer - */ -#define OTG_DISABLE_PHY() (OTG->PHYCTL &= ~OTG_PHYCTL_OTGPHYEN_Msk) - -/** - * @brief This macro is used to enable ID detection function - * @param None - * @return None - * @details This macro will set IDDETEN bit of OTG_PHYCTL register to enable ID detection function. - * \hideinitializer - */ -#define OTG_ENABLE_ID_DETECT() (OTG->PHYCTL |= OTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to disable ID detection function - * @param None - * @return None - * @details This macro will clear IDDETEN bit of OTG_PHYCTL register to disable ID detection function. - * \hideinitializer - */ -#define OTG_DISABLE_ID_DETECT() (OTG->PHYCTL &= ~OTG_PHYCTL_IDDETEN_Msk) - -/** - * @brief This macro is used to enable OTG wake-up function - * @param None - * @return None - * @details This macro will set WKEN bit of OTG_CTL register to enable OTG wake-up function. - * \hideinitializer - */ -#define OTG_ENABLE_WAKEUP() (OTG->CTL |= OTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to disable OTG wake-up function - * @param None - * @return None - * @details This macro will clear WKEN bit of OTG_CTL register to disable OTG wake-up function. - * \hideinitializer - */ -#define OTG_DISABLE_WAKEUP() (OTG->CTL &= ~OTG_CTL_WKEN_Msk) - -/** - * @brief This macro is used to set the polarity of USB_VBUS_EN pin - * @param[in] u32Pol The polarity selection. Valid values are listed below. - * - \ref OTG_VBUS_EN_ACTIVE_HIGH - * - \ref OTG_VBUS_EN_ACTIVE_LOW - * @return None - * @details This macro is used to set the polarity of external USB VBUS power switch enable signal. - * \hideinitializer - */ -#define OTG_SET_VBUS_EN_POL(u32Pol) (OTG->PHYCTL = (OTG->PHYCTL & (~OTG_PHYCTL_VBENPOL_Msk)) | ((u32Pol)<PHYCTL = (OTG->PHYCTL & (~OTG_PHYCTL_VBSTSPOL_Msk)) | ((u32Pol)<INTEN |= (u32Mask)) - -/** - * @brief This macro is used to disable OTG related interrupts - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTEN_ROLECHGIEN_Msk - * - \ref OTG_INTEN_VBEIEN_Msk - * - \ref OTG_INTEN_SRPFIEN_Msk - * - \ref OTG_INTEN_HNPFIEN_Msk - * - \ref OTG_INTEN_GOIDLEIEN_Msk - * - \ref OTG_INTEN_IDCHGIEN_Msk - * - \ref OTG_INTEN_PDEVIEN_Msk - * - \ref OTG_INTEN_HOSTIEN_Msk - * - \ref OTG_INTEN_BVLDCHGIEN_Msk - * - \ref OTG_INTEN_AVLDCHGIEN_Msk - * - \ref OTG_INTEN_VBCHGIEN_Msk - * - \ref OTG_INTEN_SECHGIEN_Msk - * - \ref OTG_INTEN_SRPDETIEN_Msk - * @return None - * @details This macro will disable OTG related interrupts specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_DISABLE_INT(u32Mask) (OTG->INTEN &= ~(u32Mask)) - -/** - * @brief This macro is used to get OTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTSTS_ROLECHGIF_Msk - * - \ref OTG_INTSTS_VBEIF_Msk - * - \ref OTG_INTSTS_SRPFIF_Msk - * - \ref OTG_INTSTS_HNPFIF_Msk - * - \ref OTG_INTSTS_GOIDLEIF_Msk - * - \ref OTG_INTSTS_IDCHGIF_Msk - * - \ref OTG_INTSTS_PDEVIF_Msk - * - \ref OTG_INTSTS_HOSTIF_Msk - * - \ref OTG_INTSTS_BVLDCHGIF_Msk - * - \ref OTG_INTSTS_AVLDCHGIF_Msk - * - \ref OTG_INTSTS_VBCHGIF_Msk - * - \ref OTG_INTSTS_SECHGIF_Msk - * - \ref OTG_INTSTS_SRPDETIF_Msk - * @return Interrupt flags of selected sources. - * @details This macro will return OTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_GET_INT_FLAG(u32Mask) (OTG->INTSTS & (u32Mask)) - -/** - * @brief This macro is used to clear OTG related interrupt flags - * @param[in] u32Mask The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref OTG_INTSTS_ROLECHGIF_Msk - * - \ref OTG_INTSTS_VBEIF_Msk - * - \ref OTG_INTSTS_SRPFIF_Msk - * - \ref OTG_INTSTS_HNPFIF_Msk - * - \ref OTG_INTSTS_GOIDLEIF_Msk - * - \ref OTG_INTSTS_IDCHGIF_Msk - * - \ref OTG_INTSTS_PDEVIF_Msk - * - \ref OTG_INTSTS_HOSTIF_Msk - * - \ref OTG_INTSTS_BVLDCHGIF_Msk - * - \ref OTG_INTSTS_AVLDCHGIF_Msk - * - \ref OTG_INTSTS_VBCHGIF_Msk - * - \ref OTG_INTSTS_SECHGIF_Msk - * - \ref OTG_INTSTS_SRPDETIF_Msk - * @return None - * @details This macro will clear OTG related interrupt flags specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_CLR_INT_FLAG(u32Mask) (OTG->INTSTS = (u32Mask)) - -/** - * @brief This macro is used to get OTG related status - * @param[in] u32Mask The combination of user specified source. Valid values are listed below. - * - \ref OTG_STATUS_OVERCUR_Msk - * - \ref OTG_STATUS_IDSTS_Msk - * - \ref OTG_STATUS_SESSEND_Msk - * - \ref OTG_STATUS_BVLD_Msk - * - \ref OTG_STATUS_AVLD_Msk - * - \ref OTG_STATUS_VBUSVLD_Msk - * @return The user specified status. - * @details This macro will return OTG related status specified by u32Mask parameter. - * \hideinitializer - */ -#define OTG_GET_STATUS(u32Mask) (OTG->STATUS & (u32Mask)) - - - -/*@}*/ /* end of group OTG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group OTG_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - - -#endif /*__NU_OTG_H__ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_pdma.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_pdma.h deleted file mode 100644 index 8579994db78..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_pdma.h +++ /dev/null @@ -1,391 +0,0 @@ -/**************************************************************************//** - * @file nu_pdma.h - * @version V1.00 - * @brief M480 series PDMA driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PDMA_H__ -#define __NU_PDMA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - -/** @addtogroup PDMA_EXPORTED_CONSTANTS PDMA Exported Constants - @{ -*/ -#define PDMA_CH_MAX 16UL /*!< Specify Maximum Channels of PDMA \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Operation Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_OP_STOP 0x00000000UL /*!INTSTS)) - -/** - * @brief Get Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_TD_STS(pdma) ((uint32_t)(pdma->TDSTS)) - -/** - * @brief Clear Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TD_FLAG(pdma,u32Mask) ((uint32_t)(pdma->TDSTS = (u32Mask))) - -/** - * @brief Get Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ABORT_STS(pdma) ((uint32_t)(pdma->ABTSTS)) - -/** - * @brief Clear Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ABORT_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ABTSTS = (u32Mask))) - -/** - * @brief Get Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ALIGN_STS(pdma) ((uint32_t)(PDMA->ALIGN)) - -/** - * @brief Clear Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ALIGN_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ALIGN = (u32Mask))) - -/** - * @brief Clear Timeout Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details Clear the selected channel timeout interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TMOUT_FLAG(pdma,u32Ch) ((uint32_t)(pdma->INTSTS = (1 << ((u32Ch) + 8)))) - -/** - * @brief Check Channel Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @retval 0 Idle state - * @retval 1 Busy state - * - * @details Check the selected channel is busy or not. - * \hideinitializer - */ -#define PDMA_IS_CH_BUSY(pdma,u32Ch) ((uint32_t)(pdma->TRGSTS & (1 << (u32Ch)))? 1 : 0) - -/** - * @brief Set Source Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel source address. - * \hideinitializer - */ -#define PDMA_SET_SRC_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].SA = (u32Addr))) - -/** - * @brief Set Destination Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel destination address. - * \hideinitializer - */ -#define PDMA_SET_DST_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].DA = (u32Addr))) - -/** - * @brief Set Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32TransCount Transfer Count - * - * @return None - * - * @details This macro set the selected channel transfer count. - * \hideinitializer - */ -#define PDMA_SET_TRANS_CNT(pdma,u32Ch, u32TransCount) ((uint32_t)(pdma->DSCT[(u32Ch)].CTL=(pdma->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1) << PDMA_DSCT_CTL_TXCNT_Pos))) - -/** - * @brief Set Scatter-gather descriptor Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The descriptor address - * - * @return None - * - * @details This macro set the selected channel scatter-gather descriptor address. - * \hideinitializer - */ -#define PDMA_SET_SCATTER_DESC(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].NEXT = (u32Addr) - (pdma->SCATBA))) - -/** - * @brief Stop the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro stop the selected channel. - * \hideinitializer - */ -#define PDMA_STOP(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch)))) - -/** - * @brief Pause the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro pause the selected channel. - * \hideinitializer - */ -#define PDMA_PAUSE(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch)))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define PDMA functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void PDMA_Open(PDMA_T * pdma,uint32_t u32Mask); -void PDMA_Close(PDMA_T * pdma); -void PDMA_SetTransferCnt(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount); -void PDMA_SetTransferAddr(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl); -void PDMA_SetTransferMode(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr); -void PDMA_SetBurstType(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize); -void PDMA_EnableTimeout(PDMA_T * pdma,uint32_t u32Mask); -void PDMA_DisableTimeout(PDMA_T * pdma,uint32_t u32Mask); -void PDMA_SetTimeOut(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt); -void PDMA_Trigger(PDMA_T * pdma,uint32_t u32Ch); -void PDMA_EnableInt(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32Mask); -void PDMA_DisableInt(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32Mask); -void PDMA_SetStride(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount); -void PDMA_SetRepeat(PDMA_T * pdma,uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount); - - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_PDMA_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qei.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qei.h deleted file mode 100644 index 217d506fd2a..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qei.h +++ /dev/null @@ -1,390 +0,0 @@ -/**************************************************************************//** - * @file nu_qei.h - * @version V3.00 - * @brief Quadrature Encoder Interface (QEI) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_QEI_H__ -#define __NU_QEI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QEI_Driver QEI Driver - @{ -*/ - -/** @addtogroup QEI_EXPORTED_CONSTANTS QEI Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* QEI counting mode selection constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define QEI_CTL_X4_FREE_COUNTING_MODE (0x0<CTL &= (~QEI_CTL_CMPEN_Msk)) - -/** - * @brief Enable QEI compare function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI counter compare function. - * \hideinitializer - */ -#define QEI_ENABLE_CNT_CMP(qei) ((qei)->CTL |= QEI_CTL_CMPEN_Msk) - -/** - * @brief Disable QEI index latch function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI index trigger counter latch function. - * \hideinitializer - */ -#define QEI_DISABLE_INDEX_LATCH(qei) ((qei)->CTL &= (~QEI_CTL_IDXLATEN_Msk)) - -/** - * @brief Enable QEI index latch function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI index trigger counter latch function. - * \hideinitializer - */ -#define QEI_ENABLE_INDEX_LATCH(qei) ((qei)->CTL |= QEI_CTL_IDXLATEN_Msk) - -/** - * @brief Disable QEI index reload function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI index trigger counter reload function. - * \hideinitializer - */ -#define QEI_DISABLE_INDEX_RELOAD(qei) ((qei)->CTL &= (~QEI_CTL_IDXRLDEN_Msk)) - -/** - * @brief Enable QEI index reload function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI index trigger counter reload function. - * \hideinitializer - */ -#define QEI_ENABLE_INDEX_RELOAD(qei) ((qei)->CTL |= QEI_CTL_IDXRLDEN_Msk) - -/** - * @brief Disable QEI input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type. - * - \ref QEI_CTL_CHAEN_Msk : QEA input - * - \ref QEI_CTL_CHAEN_Msk : QEB input - * - \ref QEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro disable specified QEI signal input. - * \hideinitializer - */ -#define QEI_DISABLE_INPUT(qei, u32InputType) ((qei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable QEI input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type . - * - \ref QEI_CTL_CHAEN_Msk : QEA input - * - \ref QEI_CTL_CHBEN_Msk : QEB input - * - \ref QEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro enable specified QEI signal input. - * \hideinitializer - */ -#define QEI_ENABLE_INPUT(qei, u32InputType) ((qei)->CTL |= (u32InputType)) - -/** - * @brief Disable inverted input polarity - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type . - * - \ref QEI_CTL_CHAINV_Msk : QEA Input - * - \ref QEI_CTL_CHBINV_Msk : QEB Input - * - \ref QEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro disable specified QEI signal inverted input polarity. - * \hideinitializer - */ -#define QEI_DISABLE_INPUT_INV(qei, u32InputType) ((qei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable inverted input polarity - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type. - * - \ref QEI_CTL_CHAINV_Msk : QEA Input - * - \ref QEI_CTL_CHBINV_Msk : QEB Input - * - \ref QEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro inverse specified QEI signal input polarity. - * \hideinitializer - */ -#define QEI_ENABLE_INPUT_INV(qei, u32InputType) ((qei)->CTL |= (u32InputType)) - -/** - * @brief Disable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro disable specified QEI interrupt. - * \hideinitializer - */ -#define QEI_DISABLE_INT(qei, u32IntSel) ((qei)->CTL &= ~(u32IntSel)) - -/** - * @brief Enable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro enable specified QEI interrupt. - * \hideinitializer - */ -#define QEI_ENABLE_INT(qei, u32IntSel) ((qei)->CTL |= (u32IntSel)) - -/** - * @brief Disable QEI noise filter - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI noise filter function. - * \hideinitializer - */ -#define QEI_DISABLE_NOISE_FILTER(qei) ((qei)->CTL |= QEI_CTL_NFDIS_Msk) - -/** - * @brief Enable QEI noise filter - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32ClkSel The sampling frequency of the noise filter clock. - * - \ref QEI_CTL_NFCLKSEL_DIV1 - * - \ref QEI_CTL_NFCLKSEL_DIV2 - * - \ref QEI_CTL_NFCLKSEL_DIV4 - * - \ref QEI_CTL_NFCLKSEL_DIV16 - * - \ref QEI_CTL_NFCLKSEL_DIV32 - * - \ref QEI_CTL_NFCLKSEL_DIV64 - * @return None - * @details This macro enable QEI noise filter function and select noise filter clock. - * \hideinitializer - */ -#define QEI_ENABLE_NOISE_FILTER(qei, u32ClkSel) ((qei)->CTL = ((qei)->CTL & (~(QEI_CTL_NFDIS_Msk|QEI_CTL_NFCLKSEL_Msk))) | (u32ClkSel)) - -/** - * @brief Get QEI counter value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter register value. - * @details This macro get QEI pulse counter value. - * \hideinitializer - */ -#define QEI_GET_CNT_VALUE(qei) ((qei)->CNT) - -/** - * @brief Get QEI counting direction - * @param[in] qei The pointer of the specified QEI module. - * @retval 0 QEI counter is in down-counting. - * @retval 1 QEI counter is in up-counting. - * @details This macro get QEI counting direction. - * \hideinitializer - */ -#define QEI_GET_DIR(qei) (((qei)->STATUS & (QEI_STATUS_DIRF_Msk))?1:0) - -/** - * @brief Get QEI counter hold value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter hold register value. - * @details This macro get QEI pulse counter hold value, which is updated with counter value in hold counter value control. - * \hideinitializer - */ -#define QEI_GET_HOLD_VALUE(qei) ((qei)->CNTHOLD) - -/** - * @brief Get QEI counter index latch value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter index latch value - * @details This macro get QEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define QEI_GET_INDEX_LATCH_VALUE(qei) ((qei)->CNTLATCH) - -/** - * @brief Set QEI counter index latch value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Val The latch value. - * @return QEI pulse counter index latch value - * @details This macro set QEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define QEI_SET_INDEX_LATCH_VALUE(qei,u32Val) ((qei)->CNTLATCH = (u32Val)) - -/** - * @brief Get QEI interrupt flag status - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. -* - \ref QEI_STATUS_DIRF_Msk : Counting direction flag - * - \ref QEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref QEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref QEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref QEI_STATUS_IDXF_Msk : Index detected flag - * @retval 0 QEI specified interrupt flag is not set. - * @retval 1 QEI specified interrupt flag is set. - * @details This macro get QEI specified interrupt flag status. - * \hideinitializer - */ -#define QEI_GET_INT_FLAG(qei, u32IntSel) (((qei)->STATUS & (u32IntSel))?1:0) - - -/** - * @brief Clear QEI interrupt flag - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref QEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref QEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref QEI_STATUS_IDXF_Msk : Index detected flag - * @return None - * @details This macro clear QEI specified interrupt flag. - * \hideinitializer - */ -#define QEI_CLR_INT_FLAG(qei, u32IntSel) ((qei)->STATUS = (u32IntSel)) - -/** - * @brief Set QEI counter compare value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set QEI pulse counter compare value. - * \hideinitializer - */ -#define QEI_SET_CNT_CMP(qei, u32Value) ((qei)->CNTCMP = (u32Value)) - -/** - * @brief Set QEI counter value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set QEI pulse counter value. - * \hideinitializer - */ -#define QEI_SET_CNT_VALUE(qei, u32Value) ((qei)->CNT = (u32Value)) - -/** - * @brief Enable QEI counter hold mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Type The triggered type. - * - \ref QEI_CTL_HOLDCNT_Msk : Hold QEI_CNT control - * - \ref QEI_CTL_HOLDTMR0_Msk : Hold QEI_CNT by Timer0 - * - \ref QEI_CTL_HOLDTMR1_Msk : Hold QEI_CNT by Timer1 - * - \ref QEI_CTL_HOLDTMR2_Msk : Hold QEI_CNT by Timer2 - * - \ref QEI_CTL_HOLDTMR3_Msk : Hold QEI_CNT by Timer3 - * @return None - * @details This macro enable QEI counter hold mode. - * \hideinitializer - */ -#define QEI_ENABLE_HOLD_TRG_SRC(qei, u32Type) ((qei)->CTL |= (u32Type)) - -/** - * @brief Disable QEI counter hold mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Type The triggered type. - * - \ref QEI_CTL_HOLDCNT_Msk : Hold QEI_CNT control - * - \ref QEI_CTL_HOLDTMR0_Msk : Hold QEI_CNT by Timer0 - * - \ref QEI_CTL_HOLDTMR1_Msk : Hold QEI_CNT by Timer1 - * - \ref QEI_CTL_HOLDTMR2_Msk : Hold QEI_CNT by Timer2 - * - \ref QEI_CTL_HOLDTMR3_Msk : Hold QEI_CNT by Timer3 - * @return None - * @details This macro disable QEI counter hold mode. - * \hideinitializer - */ -#define QEI_DISABLE_HOLD_TRG_SRC(qei, u32Type) ((qei)->CTL &= ~(u32Type)) - -/** - * @brief Set QEI maximum count value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter maximum value. - * @return QEI maximum count value - * @details This macro set QEI maximum count value. - * \hideinitializer - */ -#define QEI_SET_CNT_MAX(qei, u32Value) ((qei)->CNTMAX = (u32Value)) - -/** - * @brief Set QEI counting mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Mode QEI counting mode. - * - \ref QEI_CTL_X4_FREE_COUNTING_MODE - * - \ref QEI_CTL_X2_FREE_COUNTING_MODE - * - \ref QEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref QEI_CTL_X2_COMPARE_COUNTING_MODE - * @return None - * @details This macro set QEI counting mode. - * \hideinitializer - */ -#define QEI_SET_CNT_MODE(qei, u32Mode) ((qei)->CTL = ((qei)->CTL & (~QEI_CTL_MODE_Msk)) | (u32Mode)) - - -void QEI_Close(QEI_T* qei); -void QEI_DisableInt(QEI_T* qei, uint32_t u32IntSel); -void QEI_EnableInt(QEI_T* qei, uint32_t u32IntSel); -void QEI_Open(QEI_T* qei, uint32_t u32Mode, uint32_t u32Value); -void QEI_Start(QEI_T* qei); -void QEI_Stop(QEI_T* qei); - - -/*@}*/ /* end of group QEI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QEI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_QEI_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qspi.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qspi.h deleted file mode 100644 index 10b52c030f7..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_qspi.h +++ /dev/null @@ -1,375 +0,0 @@ -/**************************************************************************//** - * @file nu_qspi.h - * @version V3.00 - * @brief M480 series QSPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_QSPI_H__ -#define __NU_QSPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - -/** @addtogroup QSPI_EXPORTED_CONSTANTS QSPI Exported Constants - @{ -*/ - -#define QSPI_MODE_0 (QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define QSPI_MODE_1 (QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_2 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_3 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define QSPI_SLAVE (QSPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define QSPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define QSPI_SS (QSPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define QSPI_SS_ACTIVE_HIGH (QSPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define QSPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* QSPI Interrupt Mask */ -#define QSPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define QSPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define QSPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define QSPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define QSPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define QSPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define QSPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* QSPI Status Mask */ -#define QSPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define QSPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define QSPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define QSPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define QSPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define QSPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define QSPI_QSPIEN_STS_MASK (0x40U) /*!< QSPIEN status mask \hideinitializer */ -#define QSPI_SSLINE_STS_MASK (0x80U) /*!< QSPIx_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group QSPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Write 1 to UNITIF bit of QSPI_STATUS register to clear the unit transfer interrupt flag. - * \hideinitializer - */ -#define QSPI_CLR_UNIT_TRANS_INT_FLAG(qspi) ((qspi)->STATUS = QSPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set RXPDMAEN bit of QSPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_RX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit of QSPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_RX_PDMA(qspi) ((qspi)->PDMACTL |= (QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk)) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear RXPDMAEN bit of QSPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit of QSPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~(QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] qspi The pointer of the specified QSPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (QSPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_COUNT(qspi) (((qspi)->STATUS & QSPI_STATUS_RXCNT_Msk) >> QSPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of QSPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_RXEMPTY_Msk)>>QSPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of QSPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXEMPTY_Msk)>>QSPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of QSPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_FULL_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXFULL_Msk)>>QSPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Data in RX register. - * @details Read QSPI_RX register to get the received datum. - * \hideinitializer - */ -#define QSPI_READ_RX(qspi) ((qspi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxData The datum which user attempt to transfer through QSPI bus. - * @return None. - * @details Write u32TxData to QSPI_TX register. - * \hideinitializer - */ -#define QSPI_WRITE_TX(qspi, u32TxData) ((qspi)->TX = (u32TxData)) - -/** - * @brief Set QSPIx_SS pin to high state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to high state. - * \hideinitializer - */ -#define QSPI_SET_SS_HIGH(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~QSPI_SSCTL_AUTOSS_Msk)) | (QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk)) - -/** - * @brief Set QSPIx_SS pin to low state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to low state. - * \hideinitializer - */ -#define QSPI_SET_SS_LOW(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk))) | QSPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (QSPI_CTL[7:4]). - * \hideinitializer - */ -#define QSPI_ENABLE_BYTE_REORDER(qspi) ((qspi)->CTL |= QSPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear REORDER bit field of QSPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define QSPI_DISABLE_BYTE_REORDER(qspi) ((qspi)->CTL &= ~QSPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one QSPI bus clock cycle). - * \hideinitializer - */ -#define QSPI_SET_SUSPEND_CYCLE(qspi, u32SuspCycle) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << QSPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the QSPI transfer sequence with LSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set LSB bit of QSPI_CTL register to set the QSPI transfer sequence with LSB first. - * \hideinitializer - */ -#define QSPI_SET_LSB_FIRST(qspi) ((qspi)->CTL |= QSPI_CTL_LSB_Msk) - -/** - * @brief Set the QSPI transfer sequence with MSB first. - * @param[in] qspi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of QSPI_CTL register to set the QSPI transfer sequence with MSB first. - * \hideinitializer - */ -#define QSPI_SET_MSB_FIRST(qspi) ((qspi)->CTL &= ~QSPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a QSPI transaction. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define QSPI_SET_DATA_WIDTH(qspi, u32Width) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << QSPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the QSPI busy state. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 QSPI controller is not busy. - * @retval 1 QSPI controller is busy. - * @details This macro will return the busy state of QSPI controller. - * \hideinitializer - */ -#define QSPI_IS_BUSY(qspi) ( ((qspi)->STATUS & QSPI_STATUS_BUSY_Msk)>>QSPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set QSPIEN (QSPI_CTL[0]) to enable QSPI controller. - * \hideinitializer - */ -#define QSPI_ENABLE(qspi) ((qspi)->CTL |= QSPI_CTL_QSPIEN_Msk) - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear QSPIEN (QSPI_CTL[0]) to disable QSPI controller. - * \hideinitializer - */ -#define QSPI_DISABLE(qspi) ((qspi)->CTL &= ~QSPI_CTL_QSPIEN_Msk) - -/** - * @brief Disable QSPI Dual IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_DUAL_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Disable QSPI Dual IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_QUAD_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_QUADIOEN_Msk ) - - - - -/* Function prototype declaration */ -uint32_t QSPI_Open(QSPI_T *qspi, uint32_t u32MasterSlave, uint32_t u32QSPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void QSPI_Close(QSPI_T *qspi); -void QSPI_ClearRxFIFO(QSPI_T *qspi); -void QSPI_ClearTxFIFO(QSPI_T *qspi); -void QSPI_DisableAutoSS(QSPI_T *qspi); -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock); -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t QSPI_GetBusClock(QSPI_T *qspi); -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask); - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_rtc.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_rtc.h deleted file mode 100644 index f416519b67d..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_rtc.h +++ /dev/null @@ -1,342 +0,0 @@ -/**************************************************************************//** - * @file nu_rtc.h - * @version V3.00 - * @brief M480 series RTC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_RTC_H__ -#define __NU_RTC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_CONSTANTS RTC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Initial Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_INIT_KEY 0xA5EB1357UL /*!< RTC Initiation Key to make RTC leaving reset state \hideinitializer */ -#define RTC_WRITE_KEY 0x0000A965UL /*!< RTC Register Access Enable Key to enable RTC read/write accessible and kept 1024 RTC clock \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Time Attribute Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_12 0UL /*!< RTC as 12-hour time scale with AM and PM indication \hideinitializer */ -#define RTC_CLOCK_24 1UL /*!< RTC as 24-hour time scale \hideinitializer */ -#define RTC_AM 1UL /*!< RTC as AM indication \hideinitializer */ -#define RTC_PM 2UL /*!< RTC as PM indication \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tick Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TICK_1_SEC 0x0UL /*!< RTC time tick period is 1 second \hideinitializer */ -#define RTC_TICK_1_2_SEC 0x1UL /*!< RTC time tick period is 1/2 second \hideinitializer */ -#define RTC_TICK_1_4_SEC 0x2UL /*!< RTC time tick period is 1/4 second \hideinitializer */ -#define RTC_TICK_1_8_SEC 0x3UL /*!< RTC time tick period is 1/8 second \hideinitializer */ -#define RTC_TICK_1_16_SEC 0x4UL /*!< RTC time tick period is 1/16 second \hideinitializer */ -#define RTC_TICK_1_32_SEC 0x5UL /*!< RTC time tick period is 1/32 second \hideinitializer */ -#define RTC_TICK_1_64_SEC 0x6UL /*!< RTC time tick period is 1/64 second \hideinitializer */ -#define RTC_TICK_1_128_SEC 0x7UL /*!< RTC time tick period is 1/128 second \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Day of Week Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_SUNDAY 0x0UL /*!< Day of the Week is Sunday \hideinitializer */ -#define RTC_MONDAY 0x1UL /*!< Day of the Week is Monday \hideinitializer */ -#define RTC_TUESDAY 0x2UL /*!< Day of the Week is Tuesday \hideinitializer */ -#define RTC_WEDNESDAY 0x3UL /*!< Day of the Week is Wednesday \hideinitializer */ -#define RTC_THURSDAY 0x4UL /*!< Day of the Week is Thursday \hideinitializer */ -#define RTC_FRIDAY 0x5UL /*!< Day of the Week is Friday \hideinitializer */ -#define RTC_SATURDAY 0x6UL /*!< Day of the Week is Saturday \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_WAIT_COUNT 0xFFFFFFFFUL /*!< Initial Time-out Value \hideinitializer */ -#define RTC_YEAR2000 2000UL /*!< RTC Reference for compute year data \hideinitializer */ -#define RTC_FCR_REFERENCE 32761UL /*!< RTC Reference for frequency compensation \hideinitializer */ - - -#define RTC_TAMPER0_SELECT (0x1ul << 0) /*!< Select Tamper 0 \hideinitializer */ -#define RTC_TAMPER1_SELECT (0x1ul << 1) /*!< Select Tamper 1 \hideinitializer */ -#define RTC_TAMPER2_SELECT (0x1ul << 2) /*!< Select Tamper 2 \hideinitializer */ -#define RTC_TAMPER3_SELECT (0x1ul << 3) /*!< Select Tamper 3 \hideinitializer */ -#define RTC_TAMPER4_SELECT (0x1ul << 4) /*!< Select Tamper 4 \hideinitializer */ -#define RTC_TAMPER5_SELECT (0x1ul << 5) /*!< Select Tamper 5 \hideinitializer */ -#define MAX_TAMPER_PIN_NUM 6ul /*!< Tamper Pin number \hideinitializer */ - -#define RTC_TAMPER_HIGH_LEVEL_DETECT 1ul /*!< Tamper pin detect voltage level is high \hideinitializer */ -#define RTC_TAMPER_LOW_LEVEL_DETECT 0ul /*!< Tamper pin detect voltage level is low \hideinitializer */ - -#define RTC_TAMPER_DEBOUNCE_ENABLE 1ul /*!< Enable RTC tamper pin de-bounce function \hideinitializer */ -#define RTC_TAMPER_DEBOUNCE_DISABLE 0ul /*!< Disable RTC tamper pin de-bounce function \hideinitializer */ - -#define RTC_PAIR0_SELECT (0x1ul << 0) /*!< Select Pair 0 \hideinitializer */ -#define RTC_PAIR1_SELECT (0x1ul << 1) /*!< Select Pair 1 \hideinitializer */ -#define RTC_PAIR2_SELECT (0x1ul << 2) /*!< Select Pair 2 \hideinitializer */ -#define MAX_PAIR_NUM 3ul /*!< Pair number \hideinitializer */ - -#define RTC_2POW10_CLK (0x0 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 RTC clock cycles \hideinitializer */ -#define RTC_2POW11_CLK (0x1 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 2 RTC clock cycles \hideinitializer */ -#define RTC_2POW12_CLK (0x2 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 4 RTC clock cycles \hideinitializer */ -#define RTC_2POW13_CLK (0x3 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 6 RTC clock cycles \hideinitializer */ -#define RTC_2POW14_CLK (0x4 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 8 RTC clock cycles \hideinitializer */ -#define RTC_2POW15_CLK (0x5 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 16 RTC clock cycles \hideinitializer */ -#define RTC_2POW16_CLK (0x6 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 32 RTC clock cycles \hideinitializer */ -#define RTC_2POW17_CLK (0x7 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 64 RTC clock cycles \hideinitializer */ - -#define REF_RANDOM_PATTERN 0x0 /*!< The new reference pattern is generated by random number generator when the reference pattern run out \hideinitializer */ -#define REF_PREVIOUS_PATTERN 0x1 /*!< The new reference pattern is repeated previous random value when the reference pattern run out \hideinitializer */ -#define REF_SEED 0x3 /*!< The new reference pattern is repeated from SEED (RTC_TAMPSEED[31:0]) when the reference pattern run out \hideinitializer */ - -/*@}*/ /* end of group RTC_EXPORTED_CONSTANTS */ - - -/** @addtogroup RTC_EXPORTED_STRUCTS RTC Exported Structs - @{ -*/ -/** - * @details RTC define Time Data Struct - */ -typedef struct -{ - uint32_t u32Year; /*!< Year value */ - uint32_t u32Month; /*!< Month value */ - uint32_t u32Day; /*!< Day value */ - uint32_t u32DayOfWeek; /*!< Day of week value */ - uint32_t u32Hour; /*!< Hour value */ - uint32_t u32Minute; /*!< Minute value */ - uint32_t u32Second; /*!< Second value */ - uint32_t u32TimeScale; /*!< 12-Hour, 24-Hour */ - uint32_t u32AmPm; /*!< Only Time Scale select 12-hr used */ -} S_RTC_TIME_DATA_T; - -/*@}*/ /* end of group RTC_EXPORTED_STRUCTS */ - - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Indicate is Leap Year or not - * - * @param None - * - * @retval 0 This year is not a leap year - * @retval 1 This year is a leap year - * - * @details According to current date, return this year is leap year or not. - * \hideinitializer - */ -#define RTC_IS_LEAP_YEAR() (RTC->LEAPYEAR & RTC_LEAPYEAR_LEAPYEAR_Msk ? 1:0) - -/** - * @brief Clear RTC Alarm Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC alarm interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_ALARM_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_ALMIF_Msk) - -/** - * @brief Clear RTC Tick Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC tick interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TICK_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_TICKIF_Msk) - -/** - * @brief Clear RTC Tamper Interrupt Flag - * - * @param u32TamperFlag Tamper interrupt flag. It consists of: \n - * - \ref RTC_INTSTS_TAMP0IF_Msk \n - * - \ref RTC_INTSTS_TAMP1IF_Msk \n - * - \ref RTC_INTSTS_TAMP2IF_Msk \n - * - \ref RTC_INTSTS_TAMP3IF_Msk \n - * - \ref RTC_INTSTS_TAMP4IF_Msk \n - * - \ref RTC_INTSTS_TAMP5IF_Msk - * - * @return None - * - * @details This macro is used to clear RTC snooper pin interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TAMPER_INT_FLAG(u32TamperFlag) (RTC->INTSTS = (u32TamperFlag)) - -/** - * @brief Get RTC Alarm Interrupt Flag - * - * @param None - * - * @retval 0 RTC alarm interrupt did not occur - * @retval 1 RTC alarm interrupt occurred - * - * @details This macro indicates RTC alarm interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_ALARM_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_ALMIF_Msk)? 1:0) - -/** - * @brief Get RTC Time Tick Interrupt Flag - * - * @param None - * - * @retval 0 RTC time tick interrupt did not occur - * @retval 1 RTC time tick interrupt occurred - * - * @details This macro indicates RTC time tick interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TICK_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_TICKIF_Msk)? 1:0) - -/** - * @brief Get RTC Tamper Interrupt Flag - * - * @param None - * - * @retval 0 RTC snooper pin interrupt did not occur - * @retval 1 RTC snooper pin interrupt occurred - * - * @details This macro indicates RTC snooper pin interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TAMPER_INT_FLAG() ((RTC->INTSTS & (0x3F00))? 1:0) - -/** - * @brief Get RTC TAMPER Interrupt Status - * - * @param None - * - * @retval RTC_INTSTS_TAMP0IF_Msk Tamper 0 interrupt flag is generated - * @retval RTC_INTSTS_TAMP1IF_Msk Tamper 1 interrupt flag is generated - * @retval RTC_INTSTS_TAMP2IF_Msk Tamper 2 interrupt flag is generated - * @retval RTC_INTSTS_TAMP3IF_Msk Tamper 3 interrupt flag is generated - * @retval RTC_INTSTS_TAMP4IF_Msk Tamper 4 interrupt flag is generated - * @retval RTC_INTSTS_TAMP5IF_Msk Tamper 5 interrupt flag is generated - * - * @details This macro indicates RTC snooper pin interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TAMPER_INT_STATUS() ((RTC->INTSTS & (0x3F00))) - -/** - * @brief Read Spare Register - * - * @param[in] u32RegNum The spare register number, 0~19. - * - * @return Spare register content - * - * @details Read the specify spare register content. - * @note The returned value is valid only when SPRRDY(SPRCTL[7] SPR Register Ready) bit is set. \n - * And its controlled by RTC Access Enable Register. - * \hideinitializer - */ -#define RTC_READ_SPARE_REGISTER(u32RegNum) (RTC->SPR[(u32RegNum)]) - -/** - * @brief Write Spare Register - * - * @param[in] u32RegNum The spare register number, 0~19. - * @param[in] u32RegValue The spare register value. - * - * @return None - * - * @details Write specify data to spare register. - * @note This macro is effect only when SPRRDY(SPRCTL[7] SPR Register Ready) bit is set. \n - * And its controlled by RTC Access Enable Register(RTC_RWEN). - * \hideinitializer - */ -#define RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue) (RTC->SPR[(u32RegNum)] = (u32RegValue)) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void RTC_WaitAccessEnable(void); - -/** - * @brief Wait RTC Access Enable - * - * @param None - * - * @return None - * - * @details This function is used to enable the maximum RTC read/write accessible time. - */ -__STATIC_INLINE void RTC_WaitAccessEnable(void) -{ - while((RTC->RWEN & RTC_RWEN_RTCBUSY_Msk) == RTC_RWEN_RTCBUSY_Msk) - { - } - - if(!(SYS->CSERVER & 0x1)) - { - /* To wait RWENF bit is cleared and enable RWENF bit (Access Enable bit) again */ - RTC->RWEN = RTC_WRITE_KEY; - } - - /* To wait RWENF bit is set and user can access the protected-register of RTC from now on */ - while((RTC->RWEN & RTC_RWEN_RWENF_Msk) == (uint32_t)0x0) - { - } -} - -void RTC_Open(S_RTC_TIME_DATA_T *sPt); -void RTC_Close(void); -void RTC_32KCalibration(int32_t i32FrequencyX10000); -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek); -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day); -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk); -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk); -uint32_t RTC_GetDayOfWeek(void); -void RTC_SetTickPeriod(uint32_t u32TickSelection); -void RTC_EnableInt(uint32_t u32IntFlagMask); -void RTC_DisableInt(uint32_t u32IntFlagMask); -void RTC_EnableSpareAccess(void); -void RTC_DisableSpareRegister(void); -void RTC_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn); -void RTC_StaticTamperDisable(uint32_t u32TamperSelect); -void RTC_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source); -void RTC_DynamicTamperDisable(uint32_t u32PairSel); -void RTC_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed); - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RTC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sc.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sc.h deleted file mode 100644 index ac778b66442..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sc.h +++ /dev/null @@ -1,268 +0,0 @@ -/**************************************************************************//** - * @file nu_sc.h - * @version V1.00 - * @brief M480 Smartcard (SC) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SC_H__ -#define __NU_SC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_CONSTANTS SC Exported Constants - @{ -*/ -#define SC_INTERFACE_NUM 3 /*!< Smartcard interface numbers \hideinitializer */ -#define SC_PIN_STATE_HIGH 1 /*!< Smartcard pin status high \hideinitializer */ -#define SC_PIN_STATE_LOW 0 /*!< Smartcard pin status low \hideinitializer */ -#define SC_PIN_STATE_IGNORE 0xFFFFFFFF /*!< Ignore pin status \hideinitializer */ -#define SC_CLK_ON 1 /*!< Smartcard clock on \hideinitializer */ -#define SC_CLK_OFF 0 /*!< Smartcard clock off \hideinitializer */ - -#define SC_TMR_MODE_0 (0ul << SC_TMRCTL0_OPMODE_Pos) /*!INTEN |= (u32Mask)) - -/** - * @brief This macro disable smartcard interrupt - * @param[in] sc Base address of smartcard module - * @param[in] u32Mask Interrupt mask to be disabled. A combination of - * - \ref SC_INTEN_ACERRIEN_Msk - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_INITIEN_Msk - * - \ref SC_INTEN_CDIEN_Msk - * - \ref SC_INTEN_BGTIEN_Msk - * - \ref SC_INTEN_TMR2IEN_Msk - * - \ref SC_INTEN_TMR1IEN_Msk - * - \ref SC_INTEN_TMR0IEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * \hideinitializer - */ -#define SC_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief This macro set VCC pin state of smartcard interface - * @param[in] sc Base address of smartcard module - * @param[in] u32State Pin state of VCC pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW - * @return None - * \hideinitializer - */ -#define SC_SET_VCC_PIN(sc, u32State) \ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_PWREN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_PWREN_Msk;\ - }while(0) - - -/** - * @brief This macro turns CLK output on or off - * @param[in] sc Base address of smartcard module - * @param[in] u32OnOff Clock on or off for selected smartcard module, valid values are \ref SC_CLK_ON and \ref SC_CLK_OFF - * @return None - * \hideinitializer - */ -#define SC_SET_CLK_PIN(sc, u32OnOff)\ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32OnOff)\ - (sc)->PINCTL |= SC_PINCTL_CLKKEEP_Msk;\ - else\ - (sc)->PINCTL &= ~(SC_PINCTL_CLKKEEP_Msk);\ - }while(0) - -/** - * @brief This macro set I/O pin state of smartcard interface - * @param[in] sc Base address of smartcard module - * @param[in] u32State Pin state of I/O pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW - * @return None - * \hideinitializer - */ -#define SC_SET_IO_PIN(sc, u32State)\ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_SCDATA_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_SCDATA_Msk;\ - }while(0) - -/** - * @brief This macro set RST pin state of smartcard interface - * @param[in] sc Base address of smartcard module - * @param[in] u32State Pin state of RST pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW - * @return None - * \hideinitializer - */ -#define SC_SET_RST_PIN(sc, u32State)\ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_RSTEN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_RSTEN_Msk;\ - }while(0) - -/** - * @brief This macro read one byte from smartcard module receive FIFO - * @param[in] sc Base address of smartcard module - * @return One byte read from receive FIFO - * \hideinitializer - */ -#define SC_READ(sc) ((char)((sc)->DAT)) - -/** - * @brief This macro write one byte to smartcard module transmit FIFO - * @param[in] sc Base address of smartcard module - * @param[in] u8Data Data to write to transmit FIFO - * @return None - * \hideinitializer - */ -#define SC_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief This macro set smartcard stop bit length - * @param[in] sc Base address of smartcard module - * @param[in] u32Len Stop bit length, ether 1 or 2. - * @return None - * @details Stop bit length must be 1 for T = 1 protocol and 2 for T = 0 protocol. - * \hideinitializer - */ -#define SC_SET_STOP_BIT_LEN(sc, u32Len) ((sc)->CTL = ((sc)->CTL & ~SC_CTL_NSB_Msk) | ((u32Len) == 1 ? SC_CTL_NSB_Msk : 0)) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count); -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count); - -/** - * @brief Enable/Disable Tx error retry, and set Tx error retry count - * @param[in] sc Base address of smartcard module - * @param[in] u32Count The number of times of Tx error retry count, between 0~8. 0 means disable Tx error retry - * @return None - */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count) -{ - while((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_TXRTY_Msk | SC_CTL_TXRTYEN_Msk); - - if((u32Count) != 0UL) - { - while((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_TXRTY_Pos) | SC_CTL_TXRTYEN_Msk; - } -} - -/** - * @brief Enable/Disable Rx error retry, and set Rx error retry count - * @param[in] sc Base address of smartcard module - * @param[in] u32Count The number of times of Rx error retry count, between 0~8. 0 means disable Rx error retry - * @return None - */ -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count) -{ - while((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_RXRTY_Msk | SC_CTL_RXRTYEN_Msk); - - if((u32Count) != 0UL) - { - while((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_RXRTY_Pos) | SC_CTL_RXRTYEN_Msk; - } - -} - - -uint32_t SC_IsCardInserted(SC_T *sc); -void SC_ClearFIFO(SC_T *sc); -void SC_Close(SC_T *sc); -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR); -void SC_ResetReader(SC_T *sc); -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT); -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT); -void SC_StopAllTimer(SC_T *sc); -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount); -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum); -uint32_t SC_GetInterfaceClock(SC_T *sc); - - -/*@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SC_H__ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_scuart.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_scuart.h deleted file mode 100644 index e5e9e7831ae..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_scuart.h +++ /dev/null @@ -1,267 +0,0 @@ -/**************************************************************************//** - * @file nu_scuart.h - * @version V1.00 - * @brief M480 Smartcard UART mode (SCUART) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SCUART_H__ -#define __NU_SCUART_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - -/** @addtogroup SCUART_EXPORTED_CONSTANTS SCUART Exported Constants - @{ -*/ -#define SCUART_CHAR_LEN_5 (0x3ul << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 5 bits \hideinitializer */ -#define SCUART_CHAR_LEN_6 (0x2ul << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 6 bits \hideinitializer */ -#define SCUART_CHAR_LEN_7 (0x1ul << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 7 bits \hideinitializer */ -#define SCUART_CHAR_LEN_8 (0UL) /*!< Set SCUART word length to 8 bits \hideinitializer */ - -#define SCUART_PARITY_NONE (SC_UARTCTL_PBOFF_Msk) /*!< Set SCUART transfer with no parity \hideinitializer */ -#define SCUART_PARITY_ODD (SC_UARTCTL_OPE_Msk) /*!< Set SCUART transfer with odd parity \hideinitializer */ -#define SCUART_PARITY_EVEN (0UL) /*!< Set SCUART transfer with even parity \hideinitializer */ - -#define SCUART_STOP_BIT_1 (SC_CTL_NSB_Msk) /*!< Set SCUART transfer with one stop bit \hideinitializer */ -#define SCUART_STOP_BIT_2 (0UL) /*!< Set SCUART transfer with two stop bits \hideinitializer */ - - -/*@}*/ /* end of group SCUART_EXPORTED_CONSTANTS */ - - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/* TX Macros */ -/** - * @brief Write Data to Tx data register - * @param[in] sc The base address of smartcard module. - * @param[in] u8Data Data byte to transmit - * @return None - * \hideinitializer - */ -#define SCUART_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief Get TX FIFO empty flag status from register - * @param[in] sc The base address of smartcard module - * @return Transmit FIFO empty status - * @retval 0 Transmit FIFO is not empty - * @retval SC_STATUS_TXEMPTY_Msk Transmit FIFO is empty - * \hideinitializer - */ -#define SCUART_GET_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXEMPTY_Msk) - -/** - * @brief Get TX FIFO full flag status from register - * @param[in] sc The base address of smartcard module - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval SC_STATUS_TXFULL_Msk Transmit FIFO is full - * \hideinitializer - */ -#define SCUART_GET_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk) - -/** - * @brief Wait specified smartcard port transmission complete - * @param[in] sc The base address of smartcard module - * @return None - * @note This Macro blocks until transmit complete. - * \hideinitializer - */ -#define SCUART_WAIT_TX_EMPTY(sc) while((sc)->STATUS & SC_STATUS_TXACT_Msk) - -/** - * @brief Check specified smartcard port transmit FIFO is full or not - * @param[in] sc The base address of smartcard module - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval 1 Transmit FIFO is full - * \hideinitializer - */ -#define SCUART_IS_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk ? 1 : 0) - -/** - * @brief Check specified smartcard port transmission is over - * @param[in] sc The base address of smartcard module - * @return Transmit complete status - * @retval 0 Transmit is not complete - * @retval 1 Transmit complete - * \hideinitializer - */ -#define SCUART_IS_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXACT_Msk ? 0 : 1) - -/** - * @brief Check specified Smartcard port Transmission Status - * @param[in] sc The pointer of smartcard module. - * @retval 0 Transmit is completed - * @retval 1 Transmit is active - * @details TXACT (SC_STATUS[31]) is set by hardware when Tx transfer is in active and the STOP bit of the last byte has been transmitted. - * \hideinitializer - */ -#define SCUART_IS_TX_ACTIVE(sc) (((sc)->STATUS & SC_STATUS_TXACT_Msk)? 1 : 0) - -/* RX Macros */ - -/** - * @brief Read Rx data register - * @param[in] sc The base address of smartcard module - * @return The oldest data byte in RX FIFO - * \hideinitializer - */ -#define SCUART_READ(sc) ((sc)->DAT) - -/** - * @brief Get RX FIFO empty flag status from register - * @param[in] sc The base address of smartcard module - * @return Receive FIFO empty status - * @retval 0 Receive FIFO is not empty - * @retval SC_STATUS_RXEMPTY_Msk Receive FIFO is empty - * \hideinitializer - */ -#define SCUART_GET_RX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_RXEMPTY_Msk) - - -/** - * @brief Get RX FIFO full flag status from register - * @param[in] sc The base address of smartcard module - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval SC_STATUS_RXFULLF_Msk Receive FIFO is full - * \hideinitializer - */ -#define SCUART_GET_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk) - -/** - * @brief Check if receive data number in FIFO reach FIFO trigger level or not - * @param[in] sc The base address of smartcard module - * @return Receive FIFO data status - * @retval 0 The number of bytes in receive FIFO is less than trigger level - * @retval 1 The number of bytes in receive FIFO equals or larger than trigger level - * @note If receive trigger level is \b not 1 byte, this macro return 0 does not necessary indicates there is \b no data in FIFO - * \hideinitializer - */ -#define SCUART_IS_RX_READY(sc) ((sc)->INTSTS & SC_INTSTS_RDAIF_Msk ? 1 : 0) - -/** - * @brief Check specified smartcard port receive FIFO is full or not - * @param[in] sc The base address of smartcard module - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval 1 Receive FIFO is full - * \hideinitializer - */ -#define SCUART_IS_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk ? 1 : 0) - -/* Interrupt Macros */ - -/** - * @brief Enable specified interrupts - * @param[in] sc The base address of smartcard module - * @param[in] u32Mask Interrupt masks to enable, a combination of following bits - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * \hideinitializer - */ -#define SCUART_ENABLE_INT(sc, u32Mask) ((sc)->INTEN |= (u32Mask)) - -/** - * @brief Disable specified interrupts - * @param[in] sc The base address of smartcard module - * @param[in] u32Mask Interrupt masks to disable, a combination of following bits - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * \hideinitializer - */ -#define SCUART_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief Get specified interrupt flag/status - * @param[in] sc The base address of smartcard module - * @param[in] u32Type Interrupt flag/status to check, could be one of following value - * - \ref SC_INTSTS_RXTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * - \ref SC_INTSTS_RDAIF_Msk - * @return The status of specified interrupt - * @retval 0 Specified interrupt does not happened - * @retval 1 Specified interrupt happened - * \hideinitializer - */ -#define SCUART_GET_INT_FLAG(sc, u32Type) ((sc)->INTSTS & (u32Type) ? 1 : 0) - -/** - * @brief Clear specified interrupt flag/status - * @param[in] sc The base address of smartcard module - * @param[in] u32Type Interrupt flag/status to clear, could be the combination of following values - * - \ref SC_INTSTS_RXTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * @return None - * \hideinitializer - */ -#define SCUART_CLR_INT_FLAG(sc, u32Type) ((sc)->INTSTS = (u32Type)) - -/** - * @brief Get receive error flag/status - * @param[in] sc The base address of smartcard module - * @return Current receive error status, could one of following errors: - * @retval SC_STATUS_PEF_Msk Parity error - * @retval SC_STATUS_FEF_Msk Frame error - * @retval SC_STATUS_BEF_Msk Break error - * \hideinitializer - */ -#define SCUART_GET_ERR_FLAG(sc) ((sc)->STATUS & (SC_STATUS_PEF_Msk | SC_STATUS_FEF_Msk | SC_STATUS_BEF_Msk)) - -/** - * @brief Clear specified receive error flag/status - * @param[in] sc The base address of smartcard module - * @param[in] u32Mask Receive error flag/status to clear, combination following values - * - \ref SC_STATUS_PEF_Msk - * - \ref SC_STATUS_FEF_Msk - * - \ref SC_STATUS_BEF_Msk - * @return None - * \hideinitializer - */ -#define SCUART_CLR_ERR_FLAG(sc, u32Mask) ((sc)->STATUS = (u32Mask)) - -void SCUART_Close(SC_T* sc); -uint32_t SCUART_Open(SC_T* sc, uint32_t u32baudrate); -uint32_t SCUART_Read(SC_T* sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t SCUART_SetLineConfig(SC_T* sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits); -void SCUART_SetTimeoutCnt(SC_T* sc, uint32_t u32TOC); -void SCUART_Write(SC_T* sc,uint8_t pu8TxBuf[], uint32_t u32WriteBytes); - -/*@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SCUART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SCUART_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sdh.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sdh.h deleted file mode 100644 index 9a9ea574d7d..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sdh.h +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************//** - * @file nu_sdh.h - * @version V1.00 - * @brief M480 SDH driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include - -#ifndef __NU_SDH_H__ -#define __NU_SDH_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup SDH_EXPORTED_CONSTANTS SDH Exported Constants - @{ -*/ - -#define SDH_ERR_ID 0xFFFF0100ul /*!< SDH error ID \hideinitializer */ - -#define SDH_TIMEOUT (SDH_ERR_ID|0x01ul) /*!< Timeout \hideinitializer */ -#define SDH_NO_MEMORY (SDH_ERR_ID|0x02ul) /*!< OOM \hideinitializer */ - -/*-- function return value */ -#define Successful 0ul /*!< Success \hideinitializer */ -#define Fail 1ul /*!< Failed \hideinitializer */ - -/*--- define type of SD card or MMC */ -#define SDH_TYPE_UNKNOWN 0ul /*!< Unknown card type \hideinitializer */ -#define SDH_TYPE_SD_HIGH 1ul /*!< SDHC card \hideinitializer */ -#define SDH_TYPE_SD_LOW 2ul /*!< SD card \hideinitializer */ -#define SDH_TYPE_MMC 3ul /*!< MMC card \hideinitializer */ -#define SDH_TYPE_EMMC 4ul /*!< eMMC card \hideinitializer */ - -/* SD error */ -#define SDH_NO_SD_CARD (SDH_ERR_ID|0x10ul) /*!< Card removed \hideinitializer */ -#define SDH_ERR_DEVICE (SDH_ERR_ID|0x11ul) /*!< Device error \hideinitializer */ -#define SDH_INIT_TIMEOUT (SDH_ERR_ID|0x12ul) /*!< Card init timeout \hideinitializer */ -#define SDH_SELECT_ERROR (SDH_ERR_ID|0x13ul) /*!< Card select error \hideinitializer */ -#define SDH_WRITE_PROTECT (SDH_ERR_ID|0x14ul) /*!< Card write protect \hideinitializer */ -#define SDH_INIT_ERROR (SDH_ERR_ID|0x15ul) /*!< Card init error \hideinitializer */ -#define SDH_CRC7_ERROR (SDH_ERR_ID|0x16ul) /*!< CRC 7 error \hideinitializer */ -#define SDH_CRC16_ERROR (SDH_ERR_ID|0x17ul) /*!< CRC 16 error \hideinitializer */ -#define SDH_CRC_ERROR (SDH_ERR_ID|0x18ul) /*!< CRC error \hideinitializer */ -#define SDH_CMD8_ERROR (SDH_ERR_ID|0x19ul) /*!< Command 8 error \hideinitializer */ - -#define MMC_FREQ 20000ul /*!< output 20MHz to MMC \hideinitializer */ -#define SD_FREQ 25000ul /*!< output 25MHz to SD \hideinitializer */ -#define SDHC_FREQ 50000ul /*!< output 50MHz to SDH \hideinitializer */ - -#define SD_PORT0 (1 << 0) /*!< Card select SD0 \hideinitializer */ -#define SD_PORT1 (1 << 2) /*!< Card select SD1 \hideinitializer */ -#define CardDetect_From_GPIO (1ul << 8) /*!< Card detection pin is GPIO \hideinitializer */ -#define CardDetect_From_DAT3 (1ul << 9) /*!< Card detection pin is DAT3 \hideinitializer */ - -/*@}*/ /* end of group SDH_EXPORTED_CONSTANTS */ - -/** @addtogroup SDH_EXPORTED_TYPEDEF SDH Exported Type Defines - @{ -*/ -typedef struct SDH_info_t -{ - unsigned char IsCardInsert; /*!< Card insert state */ - unsigned char R3Flag; - unsigned char R7Flag; - unsigned char volatile DataReadyFlag; - unsigned int CardType; /*!< SDHC, SD, or MMC */ - unsigned int RCA; /*!< Relative card address */ - unsigned int totalSectorN; /*!< Total sector number */ - unsigned int diskSize; /*!< Disk size in K bytes */ - int sectorSize; /*!< Sector size in bytes */ - unsigned char *dmabuf; -} SDH_INFO_T; /*!< Structure holds SD card info */ - -/*@}*/ /* end of group SDH_EXPORTED_TYPEDEF */ - -/** @cond HIDDEN_SYMBOLS */ -extern SDH_INFO_T SD0, SD1; -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ - -/** - * @brief Enable specified interrupt. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_CDSRC_Msk \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / - * \ref SDH_INTEN_WKIEN_Msk - * - * @return None. - * \hideinitializer - */ -#define SDH_ENABLE_INT(sdh, u32IntMask) ((sdh)->INTEN |= (u32IntMask)) - -/** - * @brief Disable specified interrupt. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / \ref SDH_INTEN_WKIEN_Msk / \ref SDH_INTEN_CDSRC_Msk / - * - * @return None. - * \hideinitializer - */ -#define SDH_DISABLE_INT(sdh, u32IntMask) ((sdh)->INTEN &= ~(u32IntMask)) - -/** - * @brief Get specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CRC7_Msk / - * \ref SDH_INTSTS_CRC16_Msk / \ref SDH_INTSTS_CRCSTS_Msk / \ref SDH_INTSTS_DAT0STS_Msk / - * \ref SDH_INTSTS_CDIF_Msk \ref SDH_INTSTS_RTOIF_Msk / - * \ref SDH_INTSTS_DITOIF_Msk / \ref SDH_INTSTS_CDSTS_Msk / - * \ref SDH_INTSTS_DAT1STS_Msk - * - * - * @return 0 = The specified interrupt is not happened. - * 1 = The specified interrupt is happened. - * \hideinitializer - */ -#define SDH_GET_INT_FLAG(sdh, u32IntMask) (((sdh)->INTSTS & (u32IntMask))?1:0) - - -/** - * @brief Clear specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CDIF_Msk / - * \ref SDH_INTSTS_RTOIF_Msk / \ref SDH_INTSTS_DITOIF_Msk - * - * - * @return None. - * \hideinitializer - */ -#define SDH_CLR_INT_FLAG(sdh, u32IntMask) ((sdh)->INTSTS = (u32IntMask)) - - -/** - * @brief Check SD Card inserted or removed. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return 1: Card inserted. - * 0: Card removed. - * \hideinitializer - */ -#define SDH_IS_CARD_PRESENT(sdh) (((sdh) == SDH0)? SD0.IsCardInsert : SD1.IsCardInsert) - -/** - * @brief Get SD Card capacity. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return SD Card capacity. (unit: KByte) - * \hideinitializer - */ -#define SDH_GET_CARD_CAPACITY(sdh) (((sdh) == SDH0)? SD0.diskSize : SD1.diskSize) - - -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc); -uint32_t SDH_Probe(SDH_T *sdh); -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -void SDH_Set_clock(SDH_T *sdh, uint32_t u32SDClockKhz); -uint32_t SDH_CardDetection(SDH_T *sdh); -void SDH_Open_Disk(SDH_T *sdh, uint32_t u32CardDetSrc); -void SDH_Close_Disk(SDH_T *sdh); - - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SDH_H__ */ -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spi.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spi.h deleted file mode 100644 index 4a1e23ec433..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spi.h +++ /dev/null @@ -1,602 +0,0 @@ -/**************************************************************************//** - * @file nu_spi.h - * @version V3.00 - * @brief M480 series SPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SPI_H__ -#define __NU_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ - -#define SPI_MODE_0 (SPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define SPI_MODE_1 (SPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_2 (SPI_CTL_CLKPOL_Msk | SPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_3 (SPI_CTL_CLKPOL_Msk | SPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define SPI_SLAVE (SPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define SPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define SPI_SS (SPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define SPI_SS_ACTIVE_HIGH (SPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define SPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* SPI Interrupt Mask */ -#define SPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define SPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define SPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define SPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define SPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define SPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define SPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* SPI Status Mask */ -#define SPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define SPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define SPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define SPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define SPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define SPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define SPI_SPIEN_STS_MASK (0x40U) /*!< SPIEN status mask \hideinitializer */ -#define SPI_SSLINE_STS_MASK (0x80U) /*!< SPIx_SS line status mask \hideinitializer */ - - -/* I2S Data Width */ -#define SPII2S_DATABIT_8 (0U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 8-bit \hideinitializer */ -#define SPII2S_DATABIT_16 (1U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 16-bit \hideinitializer */ -#define SPII2S_DATABIT_24 (2U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 24-bit \hideinitializer */ -#define SPII2S_DATABIT_32 (3U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 32-bit \hideinitializer */ - -/* I2S Audio Format */ -#define SPII2S_MONO SPI_I2SCTL_MONO_Msk /*!< Monaural channel \hideinitializer */ -#define SPII2S_STEREO (0U) /*!< Stereo channel \hideinitializer */ - -/* I2S Data Format */ -#define SPII2S_FORMAT_I2S (0U<STATUS = SPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set RXPDMAEN bit of SPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_RX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit of SPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_RX_PDMA(spi) ((spi)->PDMACTL |= (SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk)) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear RXPDMAEN bit of SPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_RX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit of SPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_RX_PDMA(spi) ( (spi)->PDMACTL &= ~(SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] spi The pointer of the specified SPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (SPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_COUNT(spi) (((spi)->STATUS & SPI_STATUS_RXCNT_Msk) >> SPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of SPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_RXEMPTY_Msk)>>SPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of SPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXEMPTY_Msk)>>SPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of SPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_FULL_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXFULL_Msk)>>SPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] spi The pointer of the specified SPI module. - * @return Data in RX register. - * @details Read SPI_RX register to get the received datum. - * \hideinitializer - */ -#define SPI_READ_RX(spi) ((spi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through SPI bus. - * @return None. - * @details Write u32TxData to SPI_TX register. - * \hideinitializer - */ -#define SPI_WRITE_TX(spi, u32TxData) ((spi)->TX = (u32TxData)) - -/** - * @brief Set SPIx_SS pin to high state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to high state. - * \hideinitializer - */ -#define SPI_SET_SS_HIGH(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~SPI_SSCTL_AUTOSS_Msk)) | (SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk)) - -/** - * @brief Set SPIx_SS pin to low state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to low state. - * \hideinitializer - */ -#define SPI_SET_SS_LOW(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk))) | SPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (SPI_CTL[7:4]). - * \hideinitializer - */ -#define SPI_ENABLE_BYTE_REORDER(spi) ((spi)->CTL |= SPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear REORDER bit field of SPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define SPI_DISABLE_BYTE_REORDER(spi) ((spi)->CTL &= ~SPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one SPI bus clock cycle). - * \hideinitializer - */ -#define SPI_SET_SUSPEND_CYCLE(spi, u32SuspCycle) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << SPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the SPI transfer sequence with LSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set LSB bit of SPI_CTL register to set the SPI transfer sequence with LSB first. - * \hideinitializer - */ -#define SPI_SET_LSB_FIRST(spi) ((spi)->CTL |= SPI_CTL_LSB_Msk) - -/** - * @brief Set the SPI transfer sequence with MSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of SPI_CTL register to set the SPI transfer sequence with MSB first. - * \hideinitializer - */ -#define SPI_SET_MSB_FIRST(spi) ((spi)->CTL &= ~SPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a SPI transaction. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define SPI_SET_DATA_WIDTH(spi, u32Width) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << SPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the SPI busy state. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 SPI controller is not busy. - * @retval 1 SPI controller is busy. - * @details This macro will return the busy state of SPI controller. - * \hideinitializer - */ -#define SPI_IS_BUSY(spi) ( ((spi)->STATUS & SPI_STATUS_BUSY_Msk)>>SPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SPIEN (SPI_CTL[0]) to enable SPI controller. - * \hideinitializer - */ -#define SPI_ENABLE(spi) ((spi)->CTL |= SPI_CTL_SPIEN_Msk) - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SPIEN (SPI_CTL[0]) to disable SPI controller. - * \hideinitializer - */ -#define SPI_DISABLE(spi) ((spi)->CTL &= ~SPI_CTL_SPIEN_Msk) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SPII2S_ENABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask); -__STATIC_INLINE void SPII2S_DISABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask); -__STATIC_INLINE void SPII2S_SET_MONO_RX_CHANNEL(SPI_T *i2s, uint32_t u32Ch); - -/** - * @brief Enable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will set RZCEN or LZCEN bit of SPI_I2SCTL register to enable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_ENABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if(u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL |= SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Disable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will clear RZCEN or LZCEN bit of SPI_I2SCTL register to disable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_DISABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if(u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Enable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXPDMAEN bit of SPI_PDMACTL register to transmit data with PDMA. - * \hideinitializer - */ -#define SPII2S_ENABLE_TXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXPDMAEN bit of SPI_PDMACTL register to disable TX DMA function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXPDMAEN bit of SPI_PDMACTL register to receive data with PDMA. - * \hideinitializer - */ -#define SPII2S_ENABLE_RXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXPDMAEN bit of SPI_PDMACTL register to disable RX DMA function. - * \hideinitializer - */ -#define SPII2S_DISABLE_RXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXEN bit of SPI_I2SCTL register to enable I2S TX function. - * \hideinitializer - */ -#define SPII2S_ENABLE_TX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Disable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXEN bit of SPI_I2SCTL register to disable I2S TX function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Enable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXEN bit of SPI_I2SCTL register to enable I2S RX function. - * \hideinitializer - */ -#define SPII2S_ENABLE_RX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Disable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXEN bit of SPI_I2SCTL register to disable I2S RX function. - * \hideinitializer - */ -#define SPII2S_DISABLE_RX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Enable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set MUTE bit of SPI_I2SCTL register to enable I2S TX mute function. - * \hideinitializer - */ -#define SPII2S_ENABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Disable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear MUTE bit of SPI_I2SCTL register to disable I2S TX mute function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Clear TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TX FIFO. The internal TX FIFO pointer will be reset to FIFO start point. - * \hideinitializer - */ -#define SPII2S_CLR_TX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk ) - -/** - * @brief Clear RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RX FIFO. The internal RX FIFO pointer will be reset to FIFO start point. - * \hideinitializer - */ -#define SPII2S_CLR_RX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref SPII2S_MONO_LEFT - * - \ref SPII2S_MONO_RIGHT - * @return None - * @details This function selects the recording source channel of monaural mode. - * \hideinitializer - */ -__STATIC_INLINE void SPII2S_SET_MONO_RX_CHANNEL(SPI_T *i2s, uint32_t u32Ch) -{ - u32Ch == SPII2S_MONO_LEFT ? - (i2s->I2SCTL |= SPI_I2SCTL_RXLCH_Msk) : - (i2s->I2SCTL &= ~SPI_I2SCTL_RXLCH_Msk); -} - -/** - * @brief Write data to I2S TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Data The value written to TX FIFO. - * @return None - * @details This macro will write a value to TX FIFO. - * \hideinitializer - */ -#define SPII2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TX = (u32Data) ) - -/** - * @brief Read RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return The value read from RX FIFO. - * @details This function will return a value read from RX FIFO. - * \hideinitializer - */ -#define SPII2S_READ_RX_FIFO(i2s) ( (i2s)->RX ) - -/** - * @brief Get the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return The interrupt flags specified by the u32mask parameter. - * @details This macro will return the combination interrupt flags of SPI_I2SSTS register. The flags are specified by the u32mask parameter. - * \hideinitializer - */ -#define SPII2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS & (u32Mask) ) - -/** - * @brief Clear the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return None - * @details This macro will clear the interrupt flags specified by the u32mask parameter. - * @note Except TX and RX FIFO threshold interrupt flags, the other interrupt flags can be cleared by writing 1 to itself. - * \hideinitializer - */ -#define SPII2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS = (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return TX FIFO level - * @details This macro will return the number of available words in TX FIFO. - * \hideinitializer - */ -#define SPII2S_GET_TX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_TXCNT_Msk) >> SPI_I2SSTS_TXCNT_Pos ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return RX FIFO level - * @details This macro will return the number of available words in RX FIFO. - * \hideinitializer - */ -#define SPII2S_GET_RX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_RXCNT_Msk) >> SPI_I2SSTS_RXCNT_Pos ) - - - -/* Function prototype declaration */ -uint32_t SPI_Open(SPI_T *spi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void SPI_Close(SPI_T *spi); -void SPI_ClearRxFIFO(SPI_T *spi); -void SPI_ClearTxFIFO(SPI_T *spi); -void SPI_DisableAutoSS(SPI_T *spi); -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock); -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t SPI_GetBusClock(SPI_T *spi); -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask); -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask); -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask); - -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat); -void SPII2S_Close(SPI_T *i2s); -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask); -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask); -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock); -void SPII2S_DisableMCLK(SPI_T *i2s); -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); - - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spim.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spim.h deleted file mode 100644 index 84a0d98ffba..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_spim.h +++ /dev/null @@ -1,634 +0,0 @@ -/**************************************************************************//** - * @file nu_spim.h - * @version V1.00 - * @brief M480 series SPIM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SPIM_H__ -#define __NU_SPIM_H__ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Include related headers */ -/*---------------------------------------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPIM_Driver SPIM Driver - @{ -*/ - - -/** @addtogroup SPIM_EXPORTED_CONSTANTS SPIM Exported Constants - @{ -*/ - -#define SPIM_DMM_MAP_ADDR 0x8000000UL /*!< DMM mode memory map base address \hideinitializer */ -#define SPIM_DMM_SIZE 0x2000000UL /*!< DMM mode memory mapping size \hideinitializer */ -#define SPIM_CCM_ADDR 0x20020000UL /*!< CCM mode memory map base address \hideinitializer */ -#define SPIM_CCM_SIZE 0x8000UL /*!< CCM mode memory size \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* SPIM_CTL0 constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SPIM_CTL0_RW_IN(x) ((x) ? 0UL : (0x1UL << SPIM_CTL0_QDIODIR_Pos)) /*!< SPIM_CTL0: SPI Interface Direction Select \hideinitializer */ -#define SPIM_CTL0_BITMODE_SING (0UL << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_CTL0: One bit mode (SPI Interface including DO, DI, HOLD, WP) \hideinitializer */ -#define SPIM_CTL0_BITMODE_DUAL (1UL << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_CTL0: Two bits mode (SPI Interface including D0, D1, HOLD, WP) \hideinitializer */ -#define SPIM_CTL0_BITMODE_QUAD (2UL << SPIM_CTL0_BITMODE_Pos) /*!< SPIM_CTL0: Four bits mode (SPI Interface including D0, D1, D2, D3) \hideinitializer */ -#define SPIM_CTL0_OPMODE_IO (0UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: I/O Mode \hideinitializer */ -#define SPIM_CTL0_OPMODE_PAGEWRITE (1UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: Page Write Mode \hideinitializer */ -#define SPIM_CTL0_OPMODE_PAGEREAD (2UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: Page Read Mode \hideinitializer */ -#define SPIM_CTL0_OPMODE_DIRECTMAP (3UL << SPIM_CTL0_OPMODE_Pos) /*!< SPIM_CTL0: Direct Map Mode \hideinitializer */ - -#define CMD_NORMAL_PAGE_PROGRAM (0x02UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Page Program (Page Write Mode Use) \hideinitializer */ -#define CMD_NORMAL_PAGE_PROGRAM_4B (0x12UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Page Program (Page Write Mode Use) \hideinitializer */ -#define CMD_QUAD_PAGE_PROGRAM_WINBOND (0x32UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Quad Page program (for Winbond) (Page Write Mode Use) \hideinitializer */ -#define CMD_QUAD_PAGE_PROGRAM_MXIC (0x38UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Quad Page program (for MXIC) (Page Write Mode Use) \hideinitializer */ -#define CMD_QUAD_PAGE_PROGRAM_EON (0x40UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Quad Page Program (for EON) (Page Write Mode Use) \hideinitializer */ - -#define CMD_DMA_NORMAL_READ (0x03UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Read Data (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_READ (0x0BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_NORMAL_DUAL_READ (0x3BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_READ_DUAL_OUTPUT (0x3BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_READ_QUAD_OUTPUT (0x6BUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_DUAL_READ (0xBBUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Dual Output (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_NORMAL_QUAD_READ (0xE7UL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Quad I/O (Page Read Mode Use) \hideinitializer */ -#define CMD_DMA_FAST_QUAD_READ (0xEBUL << SPIM_CTL0_CMDCODE_Pos) /*!< SPIM_CTL0: Fast Read Quad I/O (Page Read Mode Use) \hideinitializer */ - -/** @cond HIDDEN_SYMBOLS */ - -typedef enum -{ - MFGID_UNKNOW = 0x00U, - MFGID_SPANSION = 0x01U, - MFGID_EON = 0x1CU, - MFGID_ISSI = 0x7FU, - MFGID_MXIC = 0xC2U, - MFGID_WINBOND = 0xEFU -} -E_MFGID; - -/* Flash opcodes. */ -#define OPCODE_WREN 0x06U /* Write enable */ -#define OPCODE_RDSR 0x05U /* Read status register #1*/ -#define OPCODE_WRSR 0x01U /* Write status register #1 */ -#define OPCODE_RDSR2 0x35U /* Read status register #2*/ -#define OPCODE_WRSR2 0x31U /* Write status register #2 */ -#define OPCODE_RDSR3 0x15U /* Read status register #3*/ -#define OPCODE_WRSR3 0x11U /* Write status register #3 */ -#define OPCODE_PP 0x02U /* Page program (up to 256 bytes) */ -#define OPCODE_SE_4K 0x20U /* Erase 4KB sector */ -#define OPCODE_BE_32K 0x52U /* Erase 32KB block */ -#define OPCODE_CHIP_ERASE 0xc7U /* Erase whole flash chip */ -#define OPCODE_BE_64K 0xd8U /* Erase 64KB block */ -#define OPCODE_READ_ID 0x90U /* Read ID */ -#define OPCODE_RDID 0x9fU /* Read JEDEC ID */ -#define OPCODE_BRRD 0x16U /* SPANSION flash - Bank Register Read command */ -#define OPCODE_BRWR 0x17U /* SPANSION flash - Bank Register write command */ -#define OPCODE_NORM_READ 0x03U /* Read data bytes */ -#define OPCODE_FAST_READ 0x0bU /* Read data bytes */ -#define OPCODE_FAST_DUAL_READ 0x3bU /* Read data bytes */ -#define OPCODE_FAST_QUAD_READ 0x6bU /* Read data bytes */ - -/* Used for SST flashes only. */ -#define OPCODE_BP 0x02U /* Byte program */ -#define OPCODE_WRDI 0x04U /* Write disable */ -#define OPCODE_AAI_WP 0xadU /* Auto u32Address increment word program */ - -/* Used for Macronix flashes only. */ -#define OPCODE_EN4B 0xb7U /* Enter 4-byte mode */ -#define OPCODE_EX4B 0xe9U /* Exit 4-byte mode */ - -#define OPCODE_RDSCUR 0x2bU -#define OPCODE_WRSCUR 0x2fU - -#define OPCODE_RSTEN 0x66U -#define OPCODE_RST 0x99U - -#define OPCODE_ENQPI 0x38U -#define OPCODE_EXQPI 0xFFU - -/* Status Register bits. */ -#define SR_WIP 0x1U /* Write in progress */ -#define SR_WEL 0x2U /* Write enable latch */ -#define SR_QE 0x40U /* Quad Enable for MXIC */ -/* Status Register #2 bits. */ -#define SR2_QE 0x2U /* Quad Enable for Winbond */ -/* meaning of other SR_* bits may differ between vendors */ -#define SR_BP0 0x4U /* Block protect 0 */ -#define SR_BP1 0x8U /* Block protect 1 */ -#define SR_BP2 0x10U /* Block protect 2 */ -#define SR_SRWD 0x80U /* SR write protect */ -#define SR3_ADR 0x01U /* 4-byte u32Address mode */ - -#define SCUR_4BYTE 0x04U /* 4-byte u32Address mode */ - -/** @endcond HIDDEN_SYMBOLS */ - -/*@}*/ /* end of group SPIM_EXPORTED_CONSTANTS */ - - -/** @addtogroup SPIM_EXPORTED_FUNCTIONS SPIM Exported Functions - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Macros and functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/** - * @details Enable cipher. - * \hideinitializer - */ -#define SPIM_ENABLE_CIPHER() (SPIM->CTL0 &= ~SPIM_CTL0_CIPHOFF_Msk) - -/** - * @details Disable cipher. - * \hideinitializer - */ -#define SPIM_DISABLE_CIPHER() (SPIM->CTL0 |= SPIM_CTL0_CIPHOFF_Msk) - -/** - * @details Enable cipher balance - * \hideinitializer - */ -#define SPIM_ENABLE_BALEN() (SPIM->CTL0 |= SPIM_CTL0_BALEN_Msk) - -/** - * @details Disable cipher balance - * \hideinitializer - */ -#define SPIM_DISABLE_BALEN() (SPIM->CTL0 &= ~SPIM_CTL0_BALEN_Msk) - -/** - * @details Set 4-byte address to be enabled/disabled. - * \hideinitializer - */ -#define SPIM_SET_4BYTE_ADDR_EN(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_B4ADDREN_Msk)) | (((x) ? 1UL : 0UL) << SPIM_CTL0_B4ADDREN_Pos); \ - } while (0) - -/** - * @details Enable SPIM interrupt - * \hideinitializer - */ -#define SPIM_ENABLE_INT() (SPIM->CTL0 |= SPIM_CTL0_IEN_Msk) - -/** - * @details Disable SPIM interrupt - * \hideinitializer - */ -#define SPIM_DISABLE_INT() (SPIM->CTL0 &= ~SPIM_CTL0_IEN_Msk) - -/** - * @details Is interrupt flag on. - * \hideinitializer - */ -#define SPIM_IS_IF_ON() ((SPIM->CTL0 & SPIM_CTL0_IF_Msk) != 0UL) - -/** - * @details Clear interrupt flag. - * \hideinitializer - */ -#define SPIM_CLR_INT() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_IF_Msk)) | (1UL << SPIM_CTL0_IF_Pos); \ - } while (0) - -/** - * @details Set transmit/receive bit length - * \hideinitializer - */ -#define SPIM_SET_DATA_WIDTH(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_DWIDTH_Msk)) | (((x) - 1U) << SPIM_CTL0_DWIDTH_Pos); \ - } while (0) - -/** - * @details Get data transmit/receive bit length setting - * \hideinitializer - */ -#define SPIM_GET_DATA_WIDTH() \ - (((SPIM->CTL0 & SPIM_CTL0_DWIDTH_Msk) >> SPIM_CTL0_DWIDTH_Pos)+1U) - -/** - * @details Set data transmit/receive burst number - * \hideinitializer - */ -#define SPIM_SET_DATA_NUM(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_BURSTNUM_Msk)) | (((x) - 1U) << SPIM_CTL0_BURSTNUM_Pos); \ - } while (0) - -/** - * @details Get data transmit/receive burst number - * \hideinitializer - */ -#define SPIM_GET_DATA_NUM() \ - (((SPIM->CTL0 & SPIM_CTL0_BURSTNUM_Msk) >> SPIM_CTL0_BURSTNUM_Pos)+1U) - -/** - * @details Enable Single Input mode. - * \hideinitializer - */ -#define SPIM_ENABLE_SING_INPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_SING | SPIM_CTL0_RW_IN(1)); \ - } while (0) - -/** - * @details Enable Single Output mode. - * \hideinitializer - */ -#define SPIM_ENABLE_SING_OUTPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_SING | SPIM_CTL0_RW_IN(0)); \ - } while (0) - -/** - * @details Enable Dual Input mode. - * \hideinitializer - */ -#define SPIM_ENABLE_DUAL_INPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_DUAL | SPIM_CTL0_RW_IN(1U)); \ - } while (0) - -/** - * @details Enable Dual Output mode. - * \hideinitializer - */ -#define SPIM_ENABLE_DUAL_OUTPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_DUAL | SPIM_CTL0_RW_IN(0U)); \ - } while (0) - -/** - * @details Enable Quad Input mode. - * \hideinitializer - */ -#define SPIM_ENABLE_QUAD_INPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_QUAD | SPIM_CTL0_RW_IN(1U)); \ - } while (0) - -/** - * @details Enable Quad Output mode. - * \hideinitializer - */ -#define SPIM_ENABLE_QUAD_OUTPUT_MODE() \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~(SPIM_CTL0_BITMODE_Msk | SPIM_CTL0_QDIODIR_Msk))) | (SPIM_CTL0_BITMODE_QUAD | SPIM_CTL0_RW_IN(0U)); \ - } while (0) - -/** - * @details Set suspend interval which ranges between 0 and 15. - * \hideinitializer - */ -#define SPIM_SET_SUSP_INTVL(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_SUSPITV_Msk)) | ((x) << SPIM_CTL0_SUSPITV_Pos); \ - } while (0) - -/** - * @details Get suspend interval setting - * \hideinitializer - */ -#define SPIM_GET_SUSP_INTVL() \ - ((SPIM->CTL0 & SPIM_CTL0_SUSPITV_Msk) >> SPIM_CTL0_SUSPITV_Pos) - -/** - * @details Set operation mode. - * \hideinitializer - */ -#define SPIM_SET_OPMODE(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_OPMODE_Msk)) | (x); \ - } while (0) - -/** - * @details Get operation mode. - * \hideinitializer - */ -#define SPIM_GET_OP_MODE() (SPIM->CTL0 & SPIM_CTL0_OPMODE_Msk) - -/** - * @details Set SPIM mode. - * \hideinitializer - */ -#define SPIM_SET_SPIM_MODE(x) \ - do { \ - SPIM->CTL0 = (SPIM->CTL0 & (~SPIM_CTL0_CMDCODE_Msk)) | (x); \ - } while (0) - -/** - * @details Get SPIM mode. - * \hideinitializer - */ -#define SPIM_GET_SPIM_MODE() (SPIM->CTL0 & SPIM_CTL0_CMDCODE_Msk) - -/** - * @details Start operation. - * \hideinitializer - */ -#define SPIM_SET_GO() (SPIM->CTL1 |= SPIM_CTL1_SPIMEN_Msk) - -/** - * @details Is engine busy. - * \hideinitializer - */ -#define SPIM_IS_BUSY() (SPIM->CTL1 & SPIM_CTL1_SPIMEN_Msk) - -/** - * @details Wait for free. - * \hideinitializer - */ -#define SPIM_WAIT_FREE() \ - do { \ - while (SPIM->CTL1 & SPIM_CTL1_SPIMEN_Msk) { } \ - } while (0) - -/** - * @details Enable cache. - * \hideinitializer - */ -#define SPIM_ENABLE_CACHE() (SPIM->CTL1 &= ~SPIM_CTL1_CACHEOFF_Msk) - -/** - * @details Disable cache. - * \hideinitializer - */ -#define SPIM_DISABLE_CACHE() (SPIM->CTL1 |= SPIM_CTL1_CACHEOFF_Msk) - -/** - * @details Is cache enabled. - * \hideinitializer - */ -#define SPIM_IS_CACHE_EN() ((SPIM->CTL1 & SPIM_CTL1_CACHEOFF_Msk) ? 0 : 1) - -/** - * @details Enable CCM - * \hideinitializer - */ -#define SPIM_ENABLE_CCM() (SPIM->CTL1 |= SPIM_CTL1_CCMEN_Msk) - -/** - * @details Disable CCM. - * \hideinitializer - */ -#define SPIM_DISABLE_CCM() (SPIM->CTL1 &= ~SPIM_CTL1_CCMEN_Msk) - -/** - * @details Is CCM enabled. - * \hideinitializer - */ -#define SPIM_IS_CCM_EN() ((SPIM->CTL1 & SPIM_CTL1_CCMEN_Msk) >> SPIM_CTL1_CCMEN_Pos) - -/** - * @details Invalidate cache. - * \hideinitializer - */ -#define SPIM_INVALID_CACHE() (SPIM->CTL1 |= SPIM_CTL1_CDINVAL_Msk) - -/** - * @details Set SS(Select Active) to active level. - * \hideinitializer - */ -#define SPIM_SET_SS_EN(x) \ - do { \ - (SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_SS_Msk)) | ((! (x) ? 1UL : 0UL) << SPIM_CTL1_SS_Pos)); \ - } while (0) - -/** - * @details Is SS(Select Active) in active level. - * \hideinitializer - */ -#define SPIM_GET_SS_EN() \ - (!(SPIM->CTL1 & SPIM_CTL1_SS_Msk)) - -/** - * @details Set active level of slave select to be high/low. - * \hideinitializer - */ -#define SPIM_SET_SS_ACTLVL(x) \ - do { \ - (SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_SSACTPOL_Msk)) | ((!! (x) ? 1UL : 0UL) << SPIM_CTL1_SSACTPOL_Pos)); \ - } while (0) - -/** - * @details Set idle time interval - * \hideinitializer - */ -#define SPIM_SET_IDL_INTVL(x) \ - do { \ - SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_IDLETIME_Msk)) | ((x) << SPIM_CTL1_IDLETIME_Pos); \ - } while (0) - -/** - * @details Get idle time interval setting - * \hideinitializer - */ -#define SPIM_GET_IDL_INTVL() \ - ((SPIM->CTL1 & SPIM_CTL1_IDLETIME_Msk) >> SPIM_CTL1_IDLETIME_Pos) - -/** - * @details Set SPIM clock divider - * \hideinitializer - */ -#define SPIM_SET_CLOCK_DIVIDER(x) \ - do { \ - SPIM->CTL1 = (SPIM->CTL1 & (~SPIM_CTL1_DIVIDER_Msk)) | ((x) << SPIM_CTL1_DIVIDER_Pos); \ - } while (0) - -/** - * @details Get SPIM current clock divider setting - * \hideinitializer - */ -#define SPIM_GET_CLOCK_DIVIDER() \ - ((SPIM->CTL1 & SPIM_CTL1_DIVIDER_Msk) >> SPIM_CTL1_DIVIDER_Pos) - -/** - * @details Set SPI flash deselect time interval of DMA write mode - * \hideinitializer - */ -#define SPIM_SET_RXCLKDLY_DWDELSEL(x) \ - do { \ - (SPIM->RXCLKDLY = (SPIM->RXCLKDLY & (~SPIM_RXCLKDLY_DWDELSEL_Msk)) | ((x) << SPIM_RXCLKDLY_DWDELSEL_Pos)); \ - } while (0) - -/** - * @details Get SPI flash deselect time interval of DMA write mode - * \hideinitializer - */ -#define SPIM_GET_RXCLKDLY_DWDELSEL() \ - ((SPIM->RXCLKDLY & SPIM_RXCLKDLY_DWDELSEL_Msk) >> SPIM_RXCLKDLY_DWDELSEL_Pos) - -/** - * @details Set sampling clock delay selection for received data - * \hideinitializer - */ -#define SPIM_SET_RXCLKDLY_RDDLYSEL(x) \ - do { \ - (SPIM->RXCLKDLY = (SPIM->RXCLKDLY & (~SPIM_RXCLKDLY_RDDLYSEL_Msk)) | ((x) << SPIM_RXCLKDLY_RDDLYSEL_Pos)); \ - } while (0) - -/** - * @details Get sampling clock delay selection for received data - * \hideinitializer - */ -#define SPIM_GET_RXCLKDLY_RDDLYSEL() \ - ((SPIM->RXCLKDLY & SPIM_RXCLKDLY_RDDLYSEL_Msk) >> SPIM_RXCLKDLY_RDDLYSEL_Pos) - -/** - * @details Set sampling clock edge selection for received data - * \hideinitializer - */ -#define SPIM_SET_RXCLKDLY_RDEDGE() \ - (SPIM->RXCLKDLY |= SPIM_RXCLKDLY_RDEDGE_Msk); \ - -/** - * @details Get sampling clock edge selection for received data - * \hideinitializer - */ -#define SPIM_CLR_RXCLKDLY_RDEDGE() \ - (SPIM->RXCLKDLY &= ~SPIM_RXCLKDLY_RDEDGE_Msk) - -/** - * @details Set mode bits data for continuous read mode - * \hideinitializer - */ -#define SPIM_SET_DMMCTL_CRMDAT(x) \ - do { \ - (SPIM->DMMCTL = (SPIM->DMMCTL & (~SPIM_DMMCTL_CRMDAT_Msk)) | ((x) << SPIM_DMMCTL_CRMDAT_Pos)) | SPIM_DMMCTL_CREN_Msk; \ - } while (0) - -/** - * @details Get mode bits data for continuous read mode - * \hideinitializer - */ -#define SPIM_GET_DMMCTL_CRMDAT() \ - ((SPIM->DMMCTL & SPIM_DMMCTL_CRMDAT_Msk) >> SPIM_DMMCTL_CRMDAT_Pos) - -/** - * @details Set DMM mode SPI flash deselect time - * \hideinitializer - */ -#define SPIM_DMM_SET_DESELTIM(x) \ - do { \ - SPIM->DMMCTL = (SPIM->DMMCTL & ~SPIM_DMMCTL_DESELTIM_Msk) | (((x) & 0x1FUL) << SPIM_DMMCTL_DESELTIM_Pos); \ - } while (0) - -/** - * @details Get current DMM mode SPI flash deselect time setting - * \hideinitializer - */ -#define SPIM_DMM_GET_DESELTIM() \ - ((SPIM->DMMCTL & SPIM_DMMCTL_DESELTIM_Msk) >> SPIM_DMMCTL_DESELTIM_Pos) - -/** - * @details Enable DMM mode burst wrap mode - * \hideinitializer - */ -#define SPIM_DMM_ENABLE_BWEN() (SPIM->DMMCTL |= SPIM_DMMCTL_BWEN_Msk) - -/** - * @details Disable DMM mode burst wrap mode - * \hideinitializer - */ -#define SPIM_DMM_DISABLE_BWEN() (SPIM->DMMCTL &= ~SPIM_DMMCTL_BWEN_Msk) - -/** - * @details Enable DMM mode continuous read mode - * \hideinitializer - */ -#define SPIM_DMM_ENABLE_CREN() (SPIM->DMMCTL |= SPIM_DMMCTL_CREN_Msk) - -/** - * @details Disable DMM mode continuous read mode - * \hideinitializer - */ -#define SPIM_DMM_DISABLE_CREN() (SPIM->DMMCTL &= ~SPIM_DMMCTL_CREN_Msk) - -/** - * @details Set DMM mode SPI flash active SCLK time - * \hideinitializer - */ -#define SPIM_DMM_SET_ACTSCLKT(x) \ - do { \ - SPIM->DMMCTL = (SPIM->DMMCTL & ~SPIM_DMMCTL_ACTSCLKT_Msk) | (((x) & 0xFUL) << SPIM_DMMCTL_ACTSCLKT_Pos) | SPIM_DMMCTL_UACTSCLK_Msk; \ - } while (0) - -/** - * @details Set SPI flash active SCLK time as SPIM default - * \hideinitializer - */ -#define SPIM_DMM_SET_DEFAULT_ACTSCLK() (SPIM->DMMCTL &= ~SPIM_DMMCTL_UACTSCLK_Msk) - -/** - * @details Set dummy cycle number (Only for DMM mode and DMA mode) - * \hideinitializer - */ -#define SPIM_SET_DCNUM(x) \ - do { \ - SPIM->CTL2 = (SPIM->CTL2 & ~SPIM_CTL2_DCNUM_Msk) | (((x) & 0x1FUL) << SPIM_CTL2_DCNUM_Pos) | SPIM_CTL2_USETEN_Msk; \ - } while (0) - -/** - * @details Set dummy cycle number (Only for DMM mode and DMA mode) as SPIM default - * \hideinitializer - */ -#define SPIM_SET_DEFAULT_DCNUM(x) (SPIM->CTL2 &= ~SPIM_CTL2_USETEN_Msk) - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Function Prototypes */ -/*---------------------------------------------------------------------------------------------------------*/ - - -int SPIM_InitFlash(int clrWP); -uint32_t SPIM_GetSClkFreq(void); -void SPIM_ReadJedecId(uint8_t idBuf[], uint32_t u32NRx, uint32_t u32NBit); -int SPIM_Enable_4Bytes_Mode(int isEn, uint32_t u32NBit); -int SPIM_Is4ByteModeEnable(uint32_t u32NBit); - -void SPIM_ChipErase(uint32_t u32NBit, int isSync); -void SPIM_EraseBlock(uint32_t u32Addr, int is4ByteAddr, uint8_t u8ErsCmd, uint32_t u32NBit, int isSync); - -void SPIM_IO_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat); -void SPIM_IO_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint8_t rdCmd, uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int u32NDummy); - -void SPIM_DMA_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint32_t wrCmd); -void SPIM_DMA_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint32_t u32RdCmd, int isSync); - -void SPIM_EnterDirectMapMode(int is4ByteAddr, uint32_t u32RdCmd, uint32_t u32IdleIntvl); -void SPIM_ExitDirectMapMode(void); - -void SPIM_SetQuadEnable(int isEn, uint32_t u32NBit); - -void SPIM_WinbondUnlock(uint32_t u32NBit); - -/*@}*/ /* end of group SPIM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPIM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SPIM_H__ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sys.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sys.h deleted file mode 100644 index a476699c2af..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_sys.h +++ /dev/null @@ -1,1636 +0,0 @@ -/**************************************************************************//** - * @file SYS.h - * @version V3.0 - * @brief M480 Series SYS Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ - -#ifndef __NU_SYS_H__ -#define __NU_SYS_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - -/** @addtogroup SYS_EXPORTED_CONSTANTS SYS Exported Constants - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Module Reset Control Resister constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_RST ((0UL<<24) | SYS_IPRST0_PDMARST_Pos) /*!< Reset PDMA \hideinitializer*/ -#define EBI_RST ((0UL<<24) | SYS_IPRST0_EBIRST_Pos) /*!< Reset EBI \hideinitializer*/ -#define EMAC_RST ((0UL<<24) | SYS_IPRST0_EMACRST_Pos) /*!< Reset EMAC \hideinitializer */ -#define SDH0_RST ((0UL<<24) | SYS_IPRST0_SDH0RST_Pos) /*!< Reset SDH0 \hideinitializer */ -#define CRC_RST ((0UL<<24) | SYS_IPRST0_CRCRST_Pos) /*!< Reset CRC \hideinitializer */ -#define CCAP_RST ((0UL<<24) | SYS_IPRST0_CCAPRST_Pos) /*!< Reset ICAP \hideinitializer */ -#define HSUSBD_RST ((0UL<<24) | SYS_IPRST0_HSUSBDRST_Pos) /*!< Reset HSUSBD \hideinitializer */ -#define CRPT_RST ((0UL<<24) | SYS_IPRST0_CRPTRST_Pos) /*!< Reset CRPT \hideinitializer */ -#define SPIM_RST ((0UL<<24) | SYS_IPRST0_SPIMRST_Pos) /*!< Reset SPIM \hideinitializer */ -#define USBH_RST ((0UL<<24) | SYS_IPRST0_USBHRST_Pos) /*!< Reset USBH \hideinitializer */ -#define SDH1_RST ((0UL<<24) | SYS_IPRST0_SDH1RST_Pos) /*!< Reset SDH1 \hideinitializer */ - -#define GPIO_RST ((4UL<<24) | SYS_IPRST1_GPIORST_Pos) /*!< Reset GPIO \hideinitializer */ -#define TMR0_RST ((4UL<<24) | SYS_IPRST1_TMR0RST_Pos) /*!< Reset TMR0 \hideinitializer */ -#define TMR1_RST ((4UL<<24) | SYS_IPRST1_TMR1RST_Pos) /*!< Reset TMR1 \hideinitializer */ -#define TMR2_RST ((4UL<<24) | SYS_IPRST1_TMR2RST_Pos) /*!< Reset TMR2 \hideinitializer */ -#define TMR3_RST ((4UL<<24) | SYS_IPRST1_TMR3RST_Pos) /*!< Reset TMR3 \hideinitializer */ -#define ACMP01_RST ((4UL<<24) | SYS_IPRST1_ACMP01RST_Pos) /*!< Reset ACMP01 \hideinitializer */ -#define I2C0_RST ((4UL<<24) | SYS_IPRST1_I2C0RST_Pos) /*!< Reset I2C0 \hideinitializer */ -#define I2C1_RST ((4UL<<24) | SYS_IPRST1_I2C1RST_Pos) /*!< Reset I2C1 \hideinitializer */ -#define I2C2_RST ((4UL<<24) | SYS_IPRST1_I2C2RST_Pos) /*!< Reset I2C2 \hideinitializer */ -#define QSPI0_RST ((4UL<<24) | SYS_IPRST1_QSPI0RST_Pos) /*!< Reset QSPI0 \hideinitializer */ -#define SPI0_RST ((4UL<<24) | SYS_IPRST1_SPI0RST_Pos) /*!< Reset SPI0 \hideinitializer */ -#define SPI1_RST ((4UL<<24) | SYS_IPRST1_SPI1RST_Pos) /*!< Reset SPI1 \hideinitializer */ -#define SPI2_RST ((4UL<<24) | SYS_IPRST1_SPI2RST_Pos) /*!< Reset SPI2 \hideinitializer */ -#define UART0_RST ((4UL<<24) | SYS_IPRST1_UART0RST_Pos) /*!< Reset UART0 \hideinitializer */ -#define UART1_RST ((4UL<<24) | SYS_IPRST1_UART1RST_Pos) /*!< Reset UART1 \hideinitializer */ -#define UART2_RST ((4UL<<24) | SYS_IPRST1_UART2RST_Pos) /*!< Reset UART2 \hideinitializer */ -#define UART3_RST ((4UL<<24) | SYS_IPRST1_UART3RST_Pos) /*!< Reset UART3 \hideinitializer */ -#define UART4_RST ((4UL<<24) | SYS_IPRST1_UART4RST_Pos) /*!< Reset UART4 \hideinitializer */ -#define UART5_RST ((4UL<<24) | SYS_IPRST1_UART5RST_Pos) /*!< Reset UART5 \hideinitializer */ -#define UART6_RST ((4UL<<24) | SYS_IPRST1_UART6RST_Pos) /*!< Reset UART6 \hideinitializer */ -#define UART7_RST ((4UL<<24) | SYS_IPRST1_UART7RST_Pos) /*!< Reset UART7 \hideinitializer */ -#define CAN0_RST ((4UL<<24) | SYS_IPRST1_CAN0RST_Pos) /*!< Reset CAN0 \hideinitializer */ -#define CAN1_RST ((4UL<<24) | SYS_IPRST1_CAN1RST_Pos) /*!< Reset CAN1 \hideinitializer */ -#define OTG_RST ((4UL<<24) | SYS_IPRST1_OTGRST_Pos) /*!< Reset OTG \hideinitializer */ -#define USBD_RST ((4UL<<24) | SYS_IPRST1_USBDRST_Pos) /*!< Reset USBD \hideinitializer */ -#define EADC_RST ((4UL<<24) | SYS_IPRST1_EADCRST_Pos) /*!< Reset EADC \hideinitializer */ -#define I2S0_RST ((4UL<<24) | SYS_IPRST1_I2S0RST_Pos) /*!< Reset I2S0 \hideinitializer */ -#define HSOTG_RST ((4UL<<24) | SYS_IPRST1_HSOTGRST_Pos) /*!< Reset HSOTG \hideinitializer */ -#define TRNG_RST ((4UL<<24) | SYS_IPRST1_TRNGRST_Pos) /*!< Reset TRNG \hideinitializer */ - -#define SC0_RST ((8UL<<24) | SYS_IPRST2_SC0RST_Pos) /*!< Reset SC0 \hideinitializer */ -#define SC1_RST ((8UL<<24) | SYS_IPRST2_SC1RST_Pos) /*!< Reset SC1 \hideinitializer */ -#define SC2_RST ((8UL<<24) | SYS_IPRST2_SC2RST_Pos) /*!< Reset SC2 \hideinitializer */ -#define QSPI1_RST ((8UL<<24) | SYS_IPRST2_QSPI1RST_Pos) /*!< Reset QSPI1 \hideinitializer */ -#define SPI3_RST ((8UL<<24) | SYS_IPRST2_SPI3RST_Pos) /*!< Reset SPI3 \hideinitializer */ -#define USCI0_RST ((8UL<<24) | SYS_IPRST2_USCI0RST_Pos) /*!< Reset USCI0 \hideinitializer */ -#define USCI1_RST ((8UL<<24) | SYS_IPRST2_USCI1RST_Pos) /*!< Reset USCI1 \hideinitializer */ -#define DAC_RST ((8UL<<24) | SYS_IPRST2_DACRST_Pos) /*!< Reset DAC \hideinitializer */ -#define EPWM0_RST ((8UL<<24) | SYS_IPRST2_EPWM0RST_Pos) /*!< Reset EPWM0 \hideinitializer */ -#define EPWM1_RST ((8UL<<24) | SYS_IPRST2_EPWM1RST_Pos) /*!< Reset EPWM1 \hideinitializer */ -#define BPWM0_RST ((8UL<<24) | SYS_IPRST2_BPWM0RST_Pos) /*!< Reset BPWM0 \hideinitializer */ -#define BPWM1_RST ((8UL<<24) | SYS_IPRST2_BPWM1RST_Pos) /*!< Reset BPWM1 \hideinitializer */ -#define QEI0_RST ((8UL<<24) | SYS_IPRST2_QEI0RST_Pos) /*!< Reset QEI0 \hideinitializer */ -#define QEI1_RST ((8UL<<24) | SYS_IPRST2_QEI1RST_Pos) /*!< Reset QEI1 \hideinitializer */ -#define ECAP0_RST ((8UL<<24) | SYS_IPRST2_ECAP0RST_Pos) /*!< Reset ECAP0 \hideinitializer */ -#define ECAP1_RST ((8UL<<24) | SYS_IPRST2_ECAP1RST_Pos) /*!< Reset ECAP1 \hideinitializer */ -#define CAN2_RST ((8UL<<24) | SYS_IPRST2_CAN2RST_Pos) /*!< Reset CAN2 \hideinitializer */ -#define OPA_RST ((8UL<<24) | SYS_IPRST2_OPARST_Pos) /*!< Reset OPA \hideinitializer */ -#define EADC1_RST ((8UL<<24) | SYS_IPRST2_EADC1RST_Pos) /*!< Reset EADC1 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brown Out Detector Threshold Voltage Selection constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_BODCTL_BOD_RST_EN (1UL << SYS_BODCTL_BODRSTEN_Pos) /*!< Brown-out Reset Enable \hideinitializer */ -#define SYS_BODCTL_BOD_INTERRUPT_EN (0UL << SYS_BODCTL_BODRSTEN_Pos) /*!< Brown-out Interrupt Enable \hideinitializer */ -#define SYS_BODCTL_BODVL_3_0V (7UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 3.0V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_8V (6UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.8V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_6V (5UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.6V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_4V (4UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.4V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_2V (3UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.2V \hideinitializer */ -#define SYS_BODCTL_BODVL_2_0V (2UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 2.0V \hideinitializer */ -#define SYS_BODCTL_BODVL_1_8V (1UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 1.8V \hideinitializer */ -#define SYS_BODCTL_BODVL_1_6V (0UL << SYS_BODCTL_BODVL_Pos) /*!< Setting Brown Out Detector Threshold Voltage as 1.6V \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* VREFCTL constant definitions. (Write-Protection Register) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_VREFCTL_VREF_PIN (0x0UL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = Vref pin \hideinitializer */ -#define SYS_VREFCTL_VREF_1_6V (0x3UL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 1.6V \hideinitializer */ -#define SYS_VREFCTL_VREF_2_0V (0x7UL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 2.0V \hideinitializer */ -#define SYS_VREFCTL_VREF_2_5V (0xBUL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 2.5V \hideinitializer */ -#define SYS_VREFCTL_VREF_3_0V (0xFUL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = 3.0V \hideinitializer */ -#define SYS_VREFCTL_VREF_AVDD (0x10UL << SYS_VREFCTL_VREFCTL_Pos) /*!< Vref = AVDD \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* USBPHY constant definitions. (Write-Protection Register) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_USBPHY_USBROLE_STD_USBD (0x0UL << SYS_USBPHY_USBROLE_Pos) /*!< Standard USB device \hideinitializer */ -#define SYS_USBPHY_USBROLE_STD_USBH (0x1UL << SYS_USBPHY_USBROLE_Pos) /*!< Standard USB host \hideinitializer */ -#define SYS_USBPHY_USBROLE_ID_DEPH (0x2UL << SYS_USBPHY_USBROLE_Pos) /*!< ID dependent device \hideinitializer */ -#define SYS_USBPHY_USBROLE_ON_THE_GO (0x3UL << SYS_USBPHY_USBROLE_Pos) /*!< On-The-Go device \hideinitializer */ -#define SYS_USBPHY_HSUSBROLE_STD_USBD (0x0UL << SYS_USBPHY_HSUSBROLE_Pos) /*!< Standard HSUSB device \hideinitializer */ -#define SYS_USBPHY_HSUSBROLE_STD_USBH (0x1UL << SYS_USBPHY_HSUSBROLE_Pos) /*!< Standard HSUSB host \hideinitializer */ -#define SYS_USBPHY_HSUSBROLE_ID_DEPH (0x2UL << SYS_USBPHY_HSUSBROLE_Pos) /*!< ID dependent device \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* PLCTL constant definitions. (Write-Protection Register) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define SYS_PLCTL_PLSEL_PL0 (0x0UL<GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA0MFP_Msk) ) | SYS_GPA_MFPL_PA0_MFP_SC0_CLK ; - -*/ -/********************* Bit definition of GPA_MFPL register **********************/ -#define SYS_GPA_MFPL_PA0MFP_GPIO (0x00UL<BODCTL |= SYS_BODCTL_BODIF_Msk) - -/** - * @brief Set Brown-out detector function to normal mode - * @param None - * @return None - * @details This macro set Brown-out detector to normal mode. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_CLEAR_BOD_LPM() (SYS->BODCTL &= ~SYS_BODCTL_BODLPM_Msk) - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This macro disable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_BOD() (SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk) - -/** - * @brief Enable Brown-out detector function - * @param None - * @return None - * @details This macro enable Brown-out detector function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_BOD() (SYS->BODCTL |= SYS_BODCTL_BODEN_Msk) - -/** - * @brief Get Brown-out detector interrupt flag - * @param None - * @retval 0 Brown-out detect interrupt flag is not set. - * @retval >=1 Brown-out detect interrupt flag is set. - * @details This macro get Brown-out detector interrupt flag. - * \hideinitializer - */ -#define SYS_GET_BOD_INT_FLAG() (SYS->BODCTL & SYS_BODCTL_BODIF_Msk) - -/** - * @brief Get Brown-out detector status - * @param None - * @retval 0 System voltage is higher than BOD threshold voltage setting or BOD function is disabled. - * @retval >=1 System voltage is lower than BOD threshold voltage setting. - * @details This macro get Brown-out detector output status. - * If the BOD function is disabled, this function always return 0. - * \hideinitializer - */ -#define SYS_GET_BOD_OUTPUT() (SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) - -/** - * @brief Enable Brown-out detector interrupt function - * @param None - * @return None - * @details This macro enable Brown-out detector interrupt function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_BOD_RST() (SYS->BODCTL &= ~SYS_BODCTL_BODRSTEN_Msk) - -/** - * @brief Enable Brown-out detector reset function - * @param None - * @return None - * @details This macro enable Brown-out detect reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_BOD_RST() (SYS->BODCTL |= SYS_BODCTL_BODRSTEN_Msk) - -/** - * @brief Set Brown-out detector function low power mode - * @param None - * @return None - * @details This macro set Brown-out detector to low power mode. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_SET_BOD_LPM() (SYS->BODCTL |= SYS_BODCTL_BODLPM_Msk) - -/** - * @brief Set Brown-out detector voltage level - * @param[in] u32Level is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_3_0V - * - \ref SYS_BODCTL_BODVL_2_8V - * - \ref SYS_BODCTL_BODVL_2_6V - * - \ref SYS_BODCTL_BODVL_2_4V - * - \ref SYS_BODCTL_BODVL_2_2V - * - \ref SYS_BODCTL_BODVL_2_0V - * - \ref SYS_BODCTL_BODVL_1_8V - * - \ref SYS_BODCTL_BODVL_1_6V - * @return None - * @details This macro set Brown-out detector voltage level. - * The write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_SET_BOD_LEVEL(u32Level) (SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | (u32Level)) - -/** - * @brief Get reset source is from Brown-out detector reset - * @param None - * @retval 0 Previous reset source is not from Brown-out detector reset - * @retval >=1 Previous reset source is from Brown-out detector reset - * @details This macro get previous reset source is from Brown-out detect reset or not. - * \hideinitializer - */ -#define SYS_IS_BOD_RST() (SYS->RSTSTS & SYS_RSTSTS_BODRF_Msk) - -/** - * @brief Get reset source is from CPU reset - * @param None - * @retval 0 Previous reset source is not from CPU reset - * @retval >=1 Previous reset source is from CPU reset - * @details This macro get previous reset source is from CPU reset. - * \hideinitializer - */ -#define SYS_IS_CPU_RST() (SYS->RSTSTS & SYS_RSTSTS_CPURF_Msk) - -/** - * @brief Get reset source is from LVR Reset - * @param None - * @retval 0 Previous reset source is not from Low-Voltage-Reset - * @retval >=1 Previous reset source is from Low-Voltage-Reset - * @details This macro get previous reset source is from Low-Voltage-Reset. - * \hideinitializer - */ -#define SYS_IS_LVR_RST() (SYS->RSTSTS & SYS_RSTSTS_LVRF_Msk) - -/** - * @brief Get reset source is from Power-on Reset - * @param None - * @retval 0 Previous reset source is not from Power-on Reset - * @retval >=1 Previous reset source is from Power-on Reset - * @details This macro get previous reset source is from Power-on Reset. - * \hideinitializer - */ -#define SYS_IS_POR_RST() (SYS->RSTSTS & SYS_RSTSTS_PORF_Msk) - -/** - * @brief Get reset source is from reset pin reset - * @param None - * @retval 0 Previous reset source is not from reset pin reset - * @retval >=1 Previous reset source is from reset pin reset - * @details This macro get previous reset source is from reset pin reset. - * \hideinitializer - */ -#define SYS_IS_RSTPIN_RST() (SYS->RSTSTS & SYS_RSTSTS_PINRF_Msk) - -/** - * @brief Get reset source is from system reset - * @param None - * @retval 0 Previous reset source is not from system reset - * @retval >=1 Previous reset source is from system reset - * @details This macro get previous reset source is from system reset. - * \hideinitializer - */ -#define SYS_IS_SYSTEM_RST() (SYS->RSTSTS & SYS_RSTSTS_SYSRF_Msk) - -/** - * @brief Get reset source is from window watch dog reset - * @param None - * @retval 0 Previous reset source is not from window watch dog reset - * @retval >=1 Previous reset source is from window watch dog reset - * @details This macro get previous reset source is from window watch dog reset. - * \hideinitializer - */ -#define SYS_IS_WDT_RST() (SYS->RSTSTS & SYS_RSTSTS_WDTRF_Msk) - -/** - * @brief Disable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro disable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_LVR() (SYS->BODCTL &= ~SYS_BODCTL_LVREN_Msk) - -/** - * @brief Enable Low-Voltage-Reset function - * @param None - * @return None - * @details This macro enable Low-Voltage-Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_LVR() (SYS->BODCTL |= SYS_BODCTL_LVREN_Msk) - -/** - * @brief Disable Power-on Reset function - * @param None - * @return None - * @details This macro disable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_DISABLE_POR() (((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0) ? (SYS->PORCTL = 0x5AA5):(SYS->PORDISAN = 0x5AA5)) - -/** - * @brief Enable Power-on Reset function - * @param None - * @return None - * @details This macro enable Power-on Reset function. - * The register write-protection function should be disabled before using this macro. - * \hideinitializer - */ -#define SYS_ENABLE_POR() (((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0) ? (SYS->PORCTL = 0):(SYS->PORDISAN = 0)) - -/** - * @brief Clear reset source flag - * @param[in] u32RstSrc is reset source. Including : - * - \ref SYS_RSTSTS_PORF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_SYSRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_CPULKRF_Msk - * @return None - * @details This macro clear reset source flag. - * \hideinitializer - */ -#define SYS_CLEAR_RST_SOURCE(u32RstSrc) ((SYS->RSTSTS) = (u32RstSrc) ) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SYS_UnlockReg(void); -__STATIC_INLINE void SYS_LockReg(void); - -/** - * @brief Disable register write-protection function - * @param None - * @return None - * @details This function disable register write-protection function. - * To unlock the protected register to allow write access. - */ -__STATIC_INLINE void SYS_UnlockReg(void) -{ - do - { - SYS->REGLCTL = 0x59UL; - SYS->REGLCTL = 0x16UL; - SYS->REGLCTL = 0x88UL; - } - while(SYS->REGLCTL == 0UL); -} - -/** - * @brief Enable register write-protection function - * @param None - * @return None - * @details This function is used to enable register write-protection function. - * To lock the protected register to forbid write access. - */ -__STATIC_INLINE void SYS_LockReg(void) -{ - SYS->REGLCTL = 0UL; -} - - -void SYS_ClearResetSrc(uint32_t u32Src); -uint32_t SYS_GetBODStatus(void); -uint32_t SYS_GetResetSrc(void); -uint32_t SYS_IsRegLocked(void); -uint32_t SYS_ReadPDID(void); -void SYS_ResetChip(void); -void SYS_ResetCPU(void); -void SYS_ResetModule(uint32_t u32ModuleIndex); -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel); -void SYS_DisableBOD(void); -void SYS_SetPowerLevel(uint32_t u32PowerLevel); -void SYS_SetVRef(uint32_t u32VRefCTL); - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SYS_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer.h deleted file mode 100644 index f889abf09f0..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer.h +++ /dev/null @@ -1,523 +0,0 @@ -/**************************************************************************//** - * @file nu_timer.h - * @version V1.00 - * @brief M480 series Timer Controller(Timer) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_H__ -#define __NU_TIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_CONSTANTS TIMER Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* TIMER Operation Mode, External Counter and Capture Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TIMER_ONESHOT_MODE (0UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in one-shot mode \hideinitializer */ -#define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in periodic mode \hideinitializer */ -#define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in toggle-output mode \hideinitializer */ -#define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in continuous counting mode \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX (0UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx pin \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX_EXT (1UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx_EXT pin \hideinitializer */ - -#define TIMER_COUNTER_EVENT_FALLING (0UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on falling edge detection \hideinitializer */ -#define TIMER_COUNTER_EVENT_RISING (1UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on rising edge detection \hideinitializer */ -#define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to get timer counter value \hideinitializer */ -#define TIMER_CAPTURE_COUNTER_RESET_MODE (1UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to reset timer counter \hideinitializer */ - -#define TIMER_CAPTURE_EVENT_FALLING (0UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Falling edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING (1UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Rising edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_FALLING_RISING (2UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both falling and rising edge detection to trigger capture event, and first event at falling edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING_FALLING (3UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both rising and falling edge detection to trigger capture event, and first event at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_LOW_PERIOD (6UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at falling edge, follows are at at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_HIGH_PERIOD (7UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at rising edge, follows are at at falling edge \hideinitializer */ - -#define TIMER_TRGSRC_TIMEOUT_EVENT (0UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer time-out event \hideinitializer */ -#define TIMER_TRGSRC_CAPTURE_EVENT (1UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer capture event \hideinitializer */ -#define TIMER_TRG_TO_EPWM (TIMER_TRGCTL_TRGEPWM_Msk) /*!< Each timer event as EPWM counter clock source \hideinitializer */ -#define TIMER_TRG_TO_EADC (TIMER_TRGCTL_TRGEADC_Msk) /*!< Each timer event to start ADC conversion \hideinitializer */ -#define TIMER_TRG_TO_DAC (TIMER_TRGCTL_TRGDAC_Msk) /*!< Each timer event to start DAC conversion \hideinitializer */ -#define TIMER_TRG_TO_PDMA (TIMER_TRGCTL_TRGPDMA_Msk) /*!< Each timer event to trigger PDMA transfer \hideinitializer */ - -/*@}*/ /* end of group TIMER_EXPORTED_CONSTANTS */ - - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Set Timer Compared Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Value Timer compare value. Valid values are between 2 to 0xFFFFFF. - * - * @return None - * - * @details This macro is used to set timer compared value to adjust timer time-out interval. - * @note 1. Never write 0x0 or 0x1 in this field, or the core will run into unknown state. \n - * 2. If update timer compared value in continuous counting mode, timer counter value will keep counting continuously. \n - * But if timer is operating at other modes, the timer up counter will restart counting and start from 0. - * \hideinitializer - */ -#define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMP = (u32Value)) - -/** - * @brief Set Timer Prescale Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Value Timer prescale value. Valid values are between 0 to 0xFF. - * - * @return None - * - * @details This macro is used to set timer prescale value and timer source clock will be divided by (prescale + 1) \n - * before it is fed into timer. - * \hideinitializer - */ -#define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_PSC_Msk) | (u32Value)) - -/** - * @brief Check specify Timer Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer 24-bit up counter is inactive - * @retval 1 Timer 24-bit up counter is active - * - * @details This macro is used to check if specify Timer counter is inactive or active. - * \hideinitializer - */ -#define TIMER_IS_ACTIVE(timer) (((timer)->CTL & TIMER_CTL_ACTSTS_Msk)? 1 : 0) - -/** - * @brief Select Toggle-output Pin - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32ToutSel Toggle-output pin selection, valid values are: - * - \ref TIMER_TOUT_PIN_FROM_TMX - * - \ref TIMER_TOUT_PIN_FROM_TMX_EXT - * - * @return None - * - * @details This macro is used to select timer toggle-output pin is output on TMx or TMx_EXT pin. - * \hideinitializer - */ -#define TIMER_SELECT_TOUT_PIN(timer, u32ToutSel) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_TGLPINSEL_Msk) | (u32ToutSel)) - -/** - * @brief Select Timer operating mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32OpMode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * - * @return None - * \hideinitializer - */ -#define TIMER_SET_OPMODE(timer, u32OpMode) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_OPMODE_Msk) | (u32OpMode)) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer); -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer); -__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer); - -/** - * @brief Start Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to start Timer counting. - */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to stop/suspend Timer counting. - */ -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Enable Timer Interrupt Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer interrupt wake-up function and interrupt source could be time-out interrupt, \n - * counter event interrupt or capture trigger interrupt. - * @note To wake the system from Power-down mode, timer clock source must be ether LXT or LIRC. - */ -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Disable Timer Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer interrupt wake-up function. - */ -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Start Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to start Timer capture function. - */ -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Stop Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to stop Timer capture function. - */ -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Disable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Enable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Disable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Enable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Disable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Enable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Disable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Get Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer time-out interrupt did not occur - * @retval 1 Timer time-out interrupt occurred - * - * @details This function indicates timer time-out interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer) -{ - return ((timer->INTSTS & TIMER_INTSTS_TIF_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears timer time-out interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TIF_Msk; -} - -/** - * @brief Get Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer capture interrupt did not occur - * @retval 1 Timer capture interrupt occurred - * - * @details This function indicates timer capture trigger interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer) -{ - return timer->EINTSTS; -} - -/** - * @brief Clear Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears timer capture trigger interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer) -{ - timer->EINTSTS = TIMER_EINTSTS_CAPIF_Msk; -} - -/** - * @brief Get Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer does not cause CPU wake-up - * @retval 1 Timer interrupt event cause CPU wake-up - * - * @details This function indicates timer interrupt event has waked up system or not. - */ -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer) -{ - return (timer->INTSTS & TIMER_INTSTS_TWKF_Msk ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears the timer wake-up system flag to 0. - */ -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TWKF_Msk; -} - -/** - * @brief Get Capture value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return 24-bit Capture Value - * - * @details This function reports the current 24-bit timer capture value. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer) -{ - return timer->CAP; -} - -/** - * @brief Get Counter value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return 24-bit Counter Value - * - * @details This function reports the current 24-bit timer counter value. - */ -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer) -{ - return timer->CNT; -} - -/** - * @brief Reset Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to reset current counter value and internal prescale counter value. - */ -__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer) -{ - timer->CNT = 0UL; - while((timer->CNT&TIMER_CNT_RSTACT_Msk) == TIMER_CNT_RSTACT_Msk) - { - ; - } -} - - -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq); -void TIMER_Close(TIMER_T *timer); -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec); -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge); -void TIMER_DisableCapture(TIMER_T *timer); -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge); -void TIMER_DisableEventCounter(TIMER_T *timer); -uint32_t TIMER_GetModuleClock(TIMER_T *timer); -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt); -void TIMER_DisableFreqCounter(TIMER_T *timer); -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src); -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask); - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_TIMER_H__ */ - - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer_pwm.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer_pwm.h deleted file mode 100644 index c7b122ff911..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_timer_pwm.h +++ /dev/null @@ -1,746 +0,0 @@ -/**************************************************************************//** - * @file nu_timer_pwm.h - * @version V1.00 - * @brief M480 series Timer PWM Controller(Timer PWM) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_PWM_H__ -#define __NU_TIMER_PWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_CONSTANTS TIMER PWM Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Channel Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CH0 (BIT0) /*!< Indicate PWMx_CH0 \hideinitializer */ -#define TPWM_CH1 (BIT1) /*!< Indicate PWMx_CH1 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_UP_COUNT (0UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up count type \hideinitializer */ -#define TPWM_DOWN_COUNT (1UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Down count type \hideinitializer */ -#define TPWM_UP_DOWN_COUNT (2UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up-Down count type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_AUTO_RELOAD_MODE (0UL) /*!< Auto-reload mode \hideinitializer */ -#define TPWM_ONE_SHOT_MODE (TIMER_PWMCTL_CNTMODE_Msk) /*!< One-shot mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_OUTPUT_TOGGLE (0UL) /*!< Timer PWM output toggle \hideinitializer */ -#define TPWM_OUTPUT_NOTHING (1UL) /*!< Timer PWM output nothing \hideinitializer */ -#define TPWM_OUTPUT_LOW (2UL) /*!< Timer PWM output low \hideinitializer */ -#define TPWM_OUTPUT_HIGH (3UL) /*!< Timer PWM output high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Trigger ADC Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TRIGGER_ADC_AT_ZERO_POINT (0UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter zero point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_PERIOD_POINT (1UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_ZERO_OR_PERIOD_POINT (2UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter zero or period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_COMPARE_UP_COUNT_POINT (3UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter up count compare point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_COMPARE_DOWN_COUNT_POINT (4UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter down count compare point event occurred \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP0 (TIMER_PWMBRKCTL_CPO0EBEN_Msk) /*!< Comparator 0 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP1 (TIMER_PWMBRKCTL_CPO1EBEN_Msk) /*!< Comparator 1 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_BKPIN (TIMER_PWMBRKCTL_BRKPEEN_Msk) /*!< Brake pin as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_CSS (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_BOD (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_COR (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_RAM (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as edge-detect fault brake source \hideinitializer */ - - -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP0 (TIMER_PWMBRKCTL_CPO0LBEN_Msk) /*!< Comparator 0 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP1 (TIMER_PWMBRKCTL_CPO1LBEN_Msk) /*!< Comparator 1 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_BKPIN (TIMER_PWMBRKCTL_BRKPLEN_Msk) /*!< Brake pin as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_COR (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as level-detect fault brake source \hideinitializer */ - -#define TPWM_BRAKE_EDGE (TIMER_PWMSWBRK_BRKETRG_Msk) /*!< Edge-detect fault brake \hideinitializer */ -#define TPWM_BRAKE_LEVEL (TIMER_PWMSWBRK_BRKLTRG_Msk) /*!< Level-detect fault brake \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Load Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_LOAD_MODE_PERIOD (0UL) /*!< Timer PWM period load mode \hideinitializer */ -#define TPWM_LOAD_MODE_IMMEDIATE (TIMER_PWMCTL_IMMLDEN_Msk) /*!< Timer PWM immediately load mode \hideinitializer */ -#define TPWM_LOAD_MODE_CENTER (TIMER_PWMCTL_CTRLD_Msk) /*!< Timer PWM center load mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin De-bounce Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BKP_DBCLK_PCLK_DIV_1 (0UL) /*!< De-bounce clock is PCLK divide by 1 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_2 (1UL) /*!< De-bounce clock is PCLK divide by 2 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_4 (2UL) /*!< De-bounce clock is PCLK divide by 4 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_8 (3UL) /*!< De-bounce clock is PCLK divide by 8 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_16 (4UL) /*!< De-bounce clock is PCLK divide by 16 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_32 (5UL) /*!< De-bounce clock is PCLK divide by 32 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_64 (6UL) /*!< De-bounce clock is PCLK divide by 64 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_128 (7UL) /*!< De-bounce clock is PCLK divide by 128 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TM_BRAKE0 (0UL) /*!< Brake pin source comes from TM_BRAKE0 \hideinitializer */ -#define TPWM_TM_BRAKE1 (1UL) /*!< Brake pin source comes from TM_BRAKE1 \hideinitializer */ -#define TPWM_TM_BRAKE2 (2UL) /*!< Brake pin source comes from TM_BRAKE2 \hideinitializer */ -#define TPWM_TM_BRAKE3 (3UL) /*!< Brake pin source comes from TM_BRAKE3 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_CLKSRC_TMR_CLK (0UL) /*!< Timer PWM Clock source selects to TMR_CLK \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER0_INT (1UL) /*!< Timer PWM Clock source selects to TIMER0 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER1_INT (2UL) /*!< Timer PWM Clock source selects to TIMER1 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER2_INT (3UL) /*!< Timer PWM Clock source selects to TIMER2 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER3_INT (4UL) /*!< Timer PWM Clock source selects to TIMER3 interrupt event \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Synchronous Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_SYNC_DISABLE (0UL) /*!< Disable TIMER PWM synchronous function \hideinitializer */ -#define TPWM_CNTR_SYNC_START_BY_TIMER0 ((0<ALTCTL = (1 << TIMER_ALTCTL_FUNCSEL_Pos)) - -/** - * @brief Disable PWM Counter Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable specified Timer channel as PWM counter mode, then timer counter mode is available. - * @note All registers about PWM counter function will be cleared to 0 after executing this macro. - * \hideinitializer - */ -#define TPWM_DISABLE_PWM_MODE(timer) ((timer)->ALTCTL = (0 << TIMER_ALTCTL_FUNCSEL_Pos)) - -/** - * @brief Enable Independent Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable independent mode of TIMER PWM module and complementary mode will be disabled. - * \hideinitializer - */ -#define TPWM_ENABLE_INDEPENDENT_MODE(timer) ((timer)->PWMCTL &= ~(1 << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Enable Complementary Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable complementary mode of Timer PWM module and independent mode will be disabled. - * \hideinitializer - */ -#define TPWM_ENABLE_COMPLEMENTARY_MODE(timer) ((timer)->PWMCTL |= (1 << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Set Counter Type - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] type Timer PWM count type, could be one of the following type - * - \ref TPWM_UP_COUNT - * - \ref TPWM_DOWN_COUNT - * - \ref TPWM_UP_DOWN_COUNT - * - * @return None - * - * @details This macro is used to set Timer PWM counter type. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_TYPE(timer, type) ((timer)->PWMCTL = ((timer)->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (type)) - -/** - * @brief Start PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable PWM generator and start counter counting. - * \hideinitializer - */ -#define TPWM_START_COUNTER(timer) ((timer)->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk) - -/** - * @brief Stop PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to stop PWM counter after current period is completed. - * \hideinitializer - */ -#define TPWM_STOP_COUNTER(timer) ((timer)->PWMPERIOD = 0x0) - -/** - * @brief Set Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] prescaler Clock prescaler of specified channel. Valid values are between 0x0~0xFFF. - * - * @return None - * - * @details This macro is used to set the prescaler of specified TIMER PWM. - * @note If prescaler is 0, then there is no scaling in counter clock source. - * \hideinitializer - */ -#define TPWM_SET_PRESCALER(timer, prescaler) ((timer)->PWMCLKPSC = (prescaler)) - -/** - * @brief Get Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target prescaler setting, CLKPSC (TIMERx_PWMCLKPSC[11:0]) - * - * @details Get the prescaler setting, the target counter clock divider is (CLKPSC + 1). - * \hideinitializer - */ -#define TPWM_GET_PRESCALER(timer) ((timer)->PWMCLKPSC) - -/** - * @brief Set Counter Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] period Period of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_PERIOD(timer, period) ((timer)->PWMPERIOD = (period)) - -/** - * @brief Get Counter Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target period setting, PERIOD (TIMERx_PWMPERIOD[15:0]) - * - * @details This macro is used to get the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_PERIOD(timer) ((timer)->PWMPERIOD) - -/** - * @brief Set Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] cmp Comparator of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_CMPDAT(timer, cmp) ((timer)->PWMCMPDAT = (cmp)) - -/** - * @brief Get Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target comparator setting, CMPDAT (TIMERx_PWMCMPDAT[15:0]) - * - * @details This macro is used to get the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_CMPDAT(timer) ((timer)->PWMCMPDAT) - -/** - * @brief Clear Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to clear counter of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_CLEAR_COUNTER(timer) ((timer)->PWMCNTCLR = TIMER_PWMCNTCLR_CNTCLR_Msk) - -/** - * @brief Software Trigger Brake Event - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] type Type of brake trigger. Valid values are: - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This macro is used to trigger brake event by writing PWMSWBRK register. - * \hideinitializer - */ -#define TPWM_SW_TRIGGER_BRAKE(timer, type) ((timer)->PWMSWBRK = (type)) - -/** - * @brief Enable Output Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Enable specified channel output function. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @return None - * - * @details This macro is used to enable output function of specified output pins. - * @note If the corresponding bit in ch parameter is 0, then output function will be disabled in this channel. - * \hideinitializer - */ -#define TPWM_ENABLE_OUTPUT(timer, ch) ((timer)->PWMPOEN = (ch)) - -/** - * @brief Set Output Inverse - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Set specified channel output is inversed or not. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @return None - * - * @details This macro is used to enable output inverse of specified output pins. - * @note If ch parameter is 0, then output inverse function will be disabled. - * \hideinitializer - */ -#define TPWM_SET_OUTPUT_INVERSE(timer, ch) ((timer)->PWMPOLCTL = (ch)) - -/** - * @brief Enable Output Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Enable specified channel output mask function. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @param[in] level Output to high or low on specified mask channel. - * - * @return None - * - * @details This macro is used to enable output function of specified output pins. - * @note If ch parameter is 0, then output mask function will be disabled. - * \hideinitializer - */ -#define TPWM_SET_MASK_OUTPUT(timer, ch, level) do {(timer)->PWMMSKEN = (ch); (timer)->PWMMSK = (level); }while(0) - -/** - * @brief Set Counter Synchronous Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] mode Synchronous mode. Possible options are: - * - \ref TPWM_CNTR_SYNC_DISABLE - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER2 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER2 - * - * @return None - * - * @details This macro is used to set counter synchronous mode of specified Timer PWM module. - * @note Only support all PWM counters are synchronous by TIMER0 PWM or TIMER0~1 PWM counter synchronous by TIMER0 PWM and - * TIMER2~3 PWM counter synchronous by TIMER2 PWM. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_SYNC_MODE(timer, mode) ((timer)->PWMSCTL = (mode)) - -/** - * @brief Trigger Counter Synchronous - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to trigger synchronous event by specified TIMER PWM. - * @note 1. This macro is only available for TIMER0 PWM and TIMER2 PWM. \n - * 2. STRGEN (PWMSTRG[0]) is write only and always read as 0. - * \hideinitializer - */ -#define TPWM_TRIGGER_COUNTER_SYNC(timer) ((timer)->PWMSTRG = TIMER_PWMSTRG_STRGEN_Msk) - -/** - * @brief Enable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the zero event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Disable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the zero event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Get Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Zero event interrupt did not occur - * @retval 1 Zero event interrupt occurred - * - * @details This macro indicates zero event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_ZERO_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_ZIF_Msk)? 1 : 0) - -/** - * @brief Clear Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears zero event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_ZERO_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_ZIF_Msk) - -/** - * @brief Enable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Disable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Get Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Period event interrupt did not occur - * @retval 1 Period event interrupt occurred - * - * @details This macro indicates period event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_PERIOD_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_PIF_Msk)? 1 : 0) - -/** - * @brief Clear Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears period event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_PERIOD_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_PIF_Msk) - -/** - * @brief Enable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Disable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Get Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Compare up event interrupt did not occur - * @retval 1 Compare up event interrupt occurred - * - * @details This macro indicates compare up event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_CMP_UP_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPUIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears compare up event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_UP_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPUIF_Msk) - -/** - * @brief Enable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the compare down event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Disable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the compare down event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Get Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Compare down event interrupt did not occur - * @retval 1 Compare down event interrupt occurred - * - * @details This macro indicates compare down event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_CMP_DOWN_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPDIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears compare down event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_DOWN_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPDIF_Msk) - -/** - * @brief Get Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer PWM counter never counts to maximum value - * @retval 1 Timer PWM counter counts to maximum value, 0xFFFF - * - * @details This macro indicates Timer PWM counter has count to 0xFFFF or not. - * \hideinitializer - */ -#define TPWM_GET_REACH_MAX_CNT_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_CNTMAXF_Msk)? 1 : 0) - -/** - * @brief Clear Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears reach maximum count status. - * \hideinitializer - */ -#define TPWM_CLEAR_REACH_MAX_CNT_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_CNTMAXF_Msk) - -/** - * @brief Get Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Trigger ADC start conversion is not occur - * @retval 1 Specified counter compare event has trigger ADC start conversion - * - * @details This macro is used to indicate PWM counter compare event has triggered ADC start conversion. - * \hideinitializer - */ -#define TPWM_GET_TRG_ADC_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_EADCTRGF_Msk)? 1 : 0) - -/** - * @brief Clear Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to clear PWM counter compare event trigger ADC status. - * \hideinitializer - */ -#define TPWM_CLEAR_TRG_ADC_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_EADCTRGF_Msk) - -/** - * @brief Set Brake Event at Brake Pin High or Low-to-High - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * @note The default brake pin detection is high level or from low to high. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_HIGH_DETECT(timer) ((timer)->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set Brake Event at Brake Pin Low or High-to-Low - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at low level or transfer from high to low. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_LOW_DETECT(timer) ((timer)->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set External Brake Pin Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] pin The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_SOURCE(timer, pin) ((timer)->PWMBNF = ((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | ((pin)<CTL = (TRNG->CTL&~TRNG_CTL_CLKP_Msk)|((clkpsc & 0xf)<> 4ul)-2ul) - - -/** - * @brief Calculate UART baudrate mode2 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode2 divider - * - * @details This macro calculate UART baudrate mode2 divider. - * \hideinitializer - */ -#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)/2ul)) / (u32BaudRate))-2ul) - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UART_WRITE(uart, u8Data) ((uart)->DAT = (u8Data)) - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module - * - * @return The oldest data byte in RX FIFO. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UART_READ(uart) ((uart)->DAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not empty - * @retval >=1 Tx FIFO is empty - * - * @details This macro get Transmitter FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_TX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not empty - * @retval >=1 Rx FIFO is empty - * - * @details This macro get Receiver FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_RX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified UART port transmission is over. - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. - * It indicates if specified UART port transmission is over nor not. - * \hideinitializer - */ -#define UART_IS_TX_EMPTY(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos) - - -/** - * @brief Wait specified UART port transmission is over - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro wait specified UART port transmission is over. - * \hideinitializer - */ -#define UART_WAIT_TX_EMPTY(uart) while(!((((uart)->FIFOSTS) & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos)) - - -/** - * @brief Check RX is ready or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 The number of bytes in the RX FIFO is less than the RFITL - * @retval 1 The number of bytes in the RX FIFO equals or larger than RFITL - * - * @details This macro check receive data available interrupt flag is set or not. - * \hideinitializer - */ -#define UART_IS_RX_READY(uart) (((uart)->INTSTS & UART_INTSTS_RDAIF_Msk)>>UART_INTSTS_RDAIF_Pos) - - -/** - * @brief Check TX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 TX FIFO is full - * @retval 0 TX FIFO is not full - * - * @details This macro check TX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_TX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk)>>UART_FIFOSTS_TXFULL_Pos) - - -/** - * @brief Check RX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 RX FIFO is full - * @retval 0 RX FIFO is not full - * - * @details This macro check RX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_RX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk)>>UART_FIFOSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not full. - * @retval >=1 Tx FIFO is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UART_GET_TX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not full. - * @retval >=1 Rx FIFO is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UART_GET_RX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk) - - -/** - * @brief Enable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_ENABLE_INT(uart, u32eIntSel) ((uart)->INTEN |= (u32eIntSel)) - - -/** - * @brief Disable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_DISABLE_INT(uart, u32eIntSel) ((uart)->INTEN &= ~ (u32eIntSel)) - - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref UART_INTSTS_HWBUFEINT_Msk : In DMA Mode, Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_HWTOINT_Msk : In DMA Mode, Time-out Interrupt Indicator - * - \ref UART_INTSTS_HWMODINT_Msk : In DMA Mode, MODEM Status Interrupt Indicator - * - \ref UART_INTSTS_HWRLSINT_Msk : In DMA Mode, Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_HWBUFEIF_Msk : In DMA Mode, Buffer Error Interrupt Flag - * - \ref UART_INTSTS_HWTOIF_Msk : In DMA Mode, Time-out Interrupt Flag - * - \ref UART_INTSTS_HWMODIF_Msk : In DMA Mode, MODEM Interrupt Flag - * - \ref UART_INTSTS_HWRLSIF_Msk : In DMA Mode, Receive Line Status Flag - * - \ref UART_INTSTS_LININT_Msk : LIN Bus Interrupt Indicator - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_RXTOINT_Msk : Time-out Interrupt Indicator - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status Interrupt Indicator - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_THREINT_Msk : Transmit Holding Register Empty Interrupt Indicator - * - \ref UART_INTSTS_RDAINT_Msk : Receive Data Available Interrupt Indicator - * - \ref UART_INTSTS_LINIF_Msk : LIN Bus Flag - * - \ref UART_INTSTS_BUFERRIF_Msk : Buffer Error Interrupt Flag - * - \ref UART_INTSTS_RXTOIF_Msk : Rx Time-out Interrupt Flag - * - \ref UART_INTSTS_MODEMIF_Msk : Modem Interrupt Flag - * - \ref UART_INTSTS_RLSIF_Msk : Receive Line Status Interrupt Flag - * - \ref UART_INTSTS_THREIF_Msk : Tx Empty Interrupt Flag - * - \ref UART_INTSTS_RDAIF_Msk : Rx Ready Interrupt Flag - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define UART_GET_INT_FLAG(uart,u32eIntTypeFlag) (((uart)->INTSTS & (u32eIntTypeFlag))?1:0) - - -/** - * @brief Clear RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro clear RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_CLEAR_ADDR_FLAG(uart) ((uart)->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk) - - -/** - * @brief Get RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Receiver detects a data that is not an address bit. - * @retval 1 Receiver detects a data that is an address bit. - * - * @details This macro get RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_GET_ADDR_FLAG(uart) (((uart)->FIFOSTS & UART_FIFOSTS_ADDRDETF_Msk) >> UART_FIFOSTS_ADDRDETF_Pos) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T* uart); -__STATIC_INLINE void UART_SET_RTS(UART_T* uart); - - -/** - * @brief Set RTS pin to low - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to low. - */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T* uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - uart->MODEM &= ~UART_MODEM_RTS_Msk; -} - - -/** - * @brief Set RTS pin to high - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to high. - */ -__STATIC_INLINE void UART_SET_RTS(UART_T* uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk | UART_MODEM_RTS_Msk; -} - -/** - * @brief Enable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UART_PDMA_ENABLE(uart, u32FuncSel) ((uart)->INTEN |= (u32FuncSel)) -/** - * @brief Disable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UART_PDMA_DISABLE(uart, u32FuncSel) ((uart)->INTEN &= ~(u32FuncSel)) - - -void UART_ClearIntFlag(UART_T* uart, uint32_t u32InterruptFlag); -void UART_Close(UART_T* uart); -void UART_DisableFlowCtrl(UART_T* uart); -void UART_DisableInt(UART_T* uart, uint32_t u32InterruptFlag); -void UART_EnableFlowCtrl(UART_T* uart); -void UART_EnableInt(UART_T* uart, uint32_t u32InterruptFlag); -void UART_Open(UART_T* uart, uint32_t u32baudrate); -uint32_t UART_Read(UART_T* uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -void UART_SetLineConfig(UART_T* uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -void UART_SetTimeoutCnt(UART_T* uart, uint32_t u32TOC); -void UART_SelectIrDAMode(UART_T* uart, uint32_t u32Buadrate, uint32_t u32Direction); -void UART_SelectRS485Mode(UART_T* uart, uint32_t u32Mode, uint32_t u32Addr); -void UART_SelectLINMode(UART_T* uart, uint32_t u32Mode, uint32_t u32BreakLength); -uint32_t UART_Write(UART_T* uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); - - - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_UART_H__*/ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usbd.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usbd.h deleted file mode 100644 index cc03314b85e..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usbd.h +++ /dev/null @@ -1,693 +0,0 @@ -/**************************************************************************//** - * @file nu_usbd.h - * @version V1.00 - * @brief M480 series USB driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_USBD_H__ -#define __NU_USBD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - -/** @addtogroup USBD_EXPORTED_STRUCT USBD Exported Struct - @{ -*/ -typedef struct s_usbd_info -{ - uint8_t *gu8DevDesc; /*!< Pointer for USB Device Descriptor */ - uint8_t *gu8ConfigDesc; /*!< Pointer for USB Configuration Descriptor */ - uint8_t **gu8StringDesc; /*!< Pointer for USB String Descriptor pointers */ - uint8_t **gu8HidReportDesc; /*!< Pointer for USB HID Report Descriptor */ - uint8_t *gu8BosDesc; /*!< Pointer for USB BOS Descriptor */ - uint32_t *gu32HidReportSize; /*!< Pointer for HID Report descriptor Size */ - uint32_t *gu32ConfigHidDescIdx; /*!< Pointer for HID Descriptor start index */ - -} S_USBD_INFO_T; /*!< Device description structure */ - -extern const S_USBD_INFO_T gsInfo; - -/*@}*/ /* end of group USBD_EXPORTED_STRUCT */ - - - - -/** @addtogroup USBD_EXPORTED_CONSTANTS USBD Exported Constants - @{ -*/ -#define USBD_BUF_BASE (USBD_BASE+0x100ul) /*!< USBD buffer base address \hideinitializer */ -#define USBD_MAX_EP 12ul /*!< Total EP number \hideinitializer */ - -#define EP0 0ul /*!< Endpoint 0 \hideinitializer */ -#define EP1 1ul /*!< Endpoint 1 \hideinitializer */ -#define EP2 2ul /*!< Endpoint 2 \hideinitializer */ -#define EP3 3ul /*!< Endpoint 3 \hideinitializer */ -#define EP4 4ul /*!< Endpoint 4 \hideinitializer */ -#define EP5 5ul /*!< Endpoint 5 \hideinitializer */ -#define EP6 6ul /*!< Endpoint 6 \hideinitializer */ -#define EP7 7ul /*!< Endpoint 7 \hideinitializer */ -#define EP8 8ul /*!< Endpoint 8 \hideinitializer */ -#define EP9 9ul /*!< Endpoint 9 \hideinitializer */ -#define EP10 10ul /*!< Endpoint 10 \hideinitializer */ -#define EP11 11ul /*!< Endpoint 11 \hideinitializer */ - -/** @cond HIDDEN_SYMBOLS */ -/* USB Request Type */ -#define REQ_STANDARD 0x00ul -#define REQ_CLASS 0x20ul -#define REQ_VENDOR 0x40ul - -/* USB Standard Request */ -#define GET_STATUS 0x00ul -#define CLEAR_FEATURE 0x01ul -#define SET_FEATURE 0x03ul -#define SET_ADDRESS 0x05ul -#define GET_DESCRIPTOR 0x06ul -#define SET_DESCRIPTOR 0x07ul -#define GET_CONFIGURATION 0x08ul -#define SET_CONFIGURATION 0x09ul -#define GET_INTERFACE 0x0Aul -#define SET_INTERFACE 0x0Bul -#define SYNC_FRAME 0x0Cul - -/* USB Descriptor Type */ -#define DESC_DEVICE 0x01ul -#define DESC_CONFIG 0x02ul -#define DESC_STRING 0x03ul -#define DESC_INTERFACE 0x04ul -#define DESC_ENDPOINT 0x05ul -#define DESC_QUALIFIER 0x06ul -#define DESC_OTHERSPEED 0x07ul -#define DESC_IFPOWER 0x08ul -#define DESC_OTG 0x09ul -#define DESC_BOS 0x0Ful -#define DESC_CAPABILITY 0x10ul - -/* USB Device Capability Type */ -#define CAP_WIRELESS 0x01ul -#define CAP_USB20_EXT 0x02ul - -/* USB HID Descriptor Type */ -#define DESC_HID 0x21ul -#define DESC_HID_RPT 0x22ul - -/* USB Descriptor Length */ -#define LEN_DEVICE 18ul -#define LEN_QUALIFIER 10ul -#define LEN_CONFIG 9ul -#define LEN_INTERFACE 9ul -#define LEN_ENDPOINT 7ul -#define LEN_OTG 5ul -#define LEN_BOS 5ul -#define LEN_HID 9ul -#define LEN_CCID 0x36ul -#define LEN_BOSCAP 7ul - -/* USB Endpoint Type */ -#define EP_ISO 0x01 -#define EP_BULK 0x02 -#define EP_INT 0x03 - -#define EP_INPUT 0x80 -#define EP_OUTPUT 0x00 - -/* USB Feature Selector */ -#define FEATURE_DEVICE_REMOTE_WAKEUP 0x01ul -#define FEATURE_ENDPOINT_HALT 0x00ul -/** @endcond HIDDEN_SYMBOLS */ - -/******************************************************************************/ -/* USB Specific Macros */ -/******************************************************************************/ - -#define USBD_WAKEUP_EN USBD_INTEN_WKEN_Msk /*!< USB Wake-up Enable \hideinitializer */ -#define USBD_DRVSE0 USBD_SE0_SE0_Msk /*!< Drive SE0 \hideinitializer */ - -#define USBD_DPPU_EN USBD_ATTR_DPPUEN_Msk /*!< USB D+ Pull-up Enable \hideinitializer */ -#define USBD_PWRDN USBD_ATTR_PWRDN_Msk /*!< PHY Turn-On \hideinitializer */ -#define USBD_PHY_EN USBD_ATTR_PHYEN_Msk /*!< PHY Enable \hideinitializer */ -#define USBD_USB_EN USBD_ATTR_USBEN_Msk /*!< USB Enable \hideinitializer */ - -#define USBD_INT_BUS USBD_INTEN_BUSIEN_Msk /*!< USB Bus Event Interrupt \hideinitializer */ -#define USBD_INT_USB USBD_INTEN_USBIEN_Msk /*!< USB Event Interrupt \hideinitializer */ -#define USBD_INT_FLDET USBD_INTEN_VBDETIEN_Msk /*!< USB VBUS Detection Interrupt \hideinitializer */ -#define USBD_INT_WAKEUP (USBD_INTEN_NEVWKIEN_Msk | USBD_INTEN_WKEN_Msk) /*!< USB No-Event-Wake-Up Interrupt \hideinitializer */ - -#define USBD_INTSTS_WAKEUP USBD_INTSTS_NEVWKIF_Msk /*!< USB No-Event-Wake-Up Interrupt Status \hideinitializer */ -#define USBD_INTSTS_FLDET USBD_INTSTS_VBDETIF_Msk /*!< USB Float Detect Interrupt Status \hideinitializer */ -#define USBD_INTSTS_BUS USBD_INTSTS_BUSIF_Msk /*!< USB Bus Event Interrupt Status \hideinitializer */ -#define USBD_INTSTS_USB USBD_INTSTS_USBIF_Msk /*!< USB Event Interrupt Status \hideinitializer */ -#define USBD_INTSTS_SETUP USBD_INTSTS_SETUP_Msk /*!< USB Setup Event \hideinitializer */ -#define USBD_INTSTS_EP0 USBD_INTSTS_EPEVT0_Msk /*!< USB Endpoint 0 Event \hideinitializer */ -#define USBD_INTSTS_EP1 USBD_INTSTS_EPEVT1_Msk /*!< USB Endpoint 1 Event \hideinitializer */ -#define USBD_INTSTS_EP2 USBD_INTSTS_EPEVT2_Msk /*!< USB Endpoint 2 Event \hideinitializer */ -#define USBD_INTSTS_EP3 USBD_INTSTS_EPEVT3_Msk /*!< USB Endpoint 3 Event \hideinitializer */ -#define USBD_INTSTS_EP4 USBD_INTSTS_EPEVT4_Msk /*!< USB Endpoint 4 Event \hideinitializer */ -#define USBD_INTSTS_EP5 USBD_INTSTS_EPEVT5_Msk /*!< USB Endpoint 5 Event \hideinitializer */ -#define USBD_INTSTS_EP6 USBD_INTSTS_EPEVT6_Msk /*!< USB Endpoint 6 Event \hideinitializer */ -#define USBD_INTSTS_EP7 USBD_INTSTS_EPEVT7_Msk /*!< USB Endpoint 7 Event \hideinitializer */ -#define USBD_INTSTS_EP8 USBD_INTSTS_EPEVT8_Msk /*!< USB Endpoint 8 Event \hideinitializer */ -#define USBD_INTSTS_EP9 USBD_INTSTS_EPEVT9_Msk /*!< USB Endpoint 9 Event \hideinitializer */ -#define USBD_INTSTS_EP10 USBD_INTSTS_EPEVT10_Msk /*!< USB Endpoint 10 Event \hideinitializer */ -#define USBD_INTSTS_EP11 USBD_INTSTS_EPEVT11_Msk /*!< USB Endpoint 11 Event \hideinitializer */ - -#define USBD_STATE_USBRST USBD_ATTR_USBRST_Msk /*!< USB Bus Reset \hideinitializer */ -#define USBD_STATE_SUSPEND USBD_ATTR_SUSPEND_Msk /*!< USB Bus Suspend \hideinitializer */ -#define USBD_STATE_RESUME USBD_ATTR_RESUME_Msk /*!< USB Bus Resume \hideinitializer */ -#define USBD_STATE_TIMEOUT USBD_ATTR_TOUT_Msk /*!< USB Bus Timeout \hideinitializer */ - -#define USBD_CFGP_SSTALL USBD_CFGP_SSTALL_Msk /*!< Set Stall \hideinitializer */ -#define USBD_CFG_CSTALL USBD_CFG_CSTALL_Msk /*!< Clear Stall \hideinitializer */ - -#define USBD_CFG_EPMODE_DISABLE (0ul << USBD_CFG_STATE_Pos)/*!< Endpoint Disable \hideinitializer */ -#define USBD_CFG_EPMODE_OUT (1ul << USBD_CFG_STATE_Pos)/*!< Out Endpoint \hideinitializer */ -#define USBD_CFG_EPMODE_IN (2ul << USBD_CFG_STATE_Pos)/*!< In Endpoint \hideinitializer */ -#define USBD_CFG_TYPE_ISO (1ul << USBD_CFG_ISOCH_Pos) /*!< Isochronous \hideinitializer */ - - - -/*@}*/ /* end of group USBD_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBD_EXPORTED_FUNCTIONS USBD Exported Functions - @{ -*/ -/** - * @brief Compare two input numbers and return maximum one. - * - * @param[in] a First number to be compared. - * @param[in] b Second number to be compared. - * - * @return Maximum value between a and b. - * - * @details If a > b, then return a. Otherwise, return b. - * \hideinitializer - */ -#define USBD_Maximum(a,b) ((a)>(b) ? (a) : (b)) - - -/** - * @brief Compare two input numbers and return minimum one - * - * @param[in] a First number to be compared - * @param[in] b Second number to be compared - * - * @return Minimum value between a and b - * - * @details If a < b, then return a. Otherwise, return b. - * \hideinitializer - */ -#define USBD_Minimum(a,b) ((a)<(b) ? (a) : (b)) - - -/** - * @brief Enable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB and PHY. - * \hideinitializer - */ -#define USBD_ENABLE_USB() ((uint32_t)(USBD->ATTR |= 0x7D0)) - -/** - * @brief Disable USB - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB. - * \hideinitializer - */ -#define USBD_DISABLE_USB() ((uint32_t)(USBD->ATTR &= ~USBD_USB_EN)) - -/** - * @brief Enable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to enable USB PHY. - * \hideinitializer - */ -#define USBD_ENABLE_PHY() ((uint32_t)(USBD->ATTR |= USBD_PHY_EN)) - -/** - * @brief Disable USB PHY - * - * @param None - * - * @return None - * - * @details To set USB ATTR control register to disable USB PHY. - * \hideinitializer - */ -#define USBD_DISABLE_PHY() ((uint32_t)(USBD->ATTR &= ~USBD_PHY_EN)) - -/** - * @brief Enable SE0. Force USB PHY transceiver to drive SE0. - * - * @param None - * - * @return None - * - * @details Set DRVSE0 bit of USB_DRVSE0 register to enable software-disconnect function. Force USB PHY transceiver to drive SE0 to bus. - * \hideinitializer - */ -#define USBD_SET_SE0() ((uint32_t)(USBD->SE0 |= USBD_DRVSE0)) - -/** - * @brief Disable SE0 - * - * @param None - * - * @return None - * - * @details Clear DRVSE0 bit of USB_DRVSE0 register to disable software-disconnect function. - * \hideinitializer - */ -#define USBD_CLR_SE0() ((uint32_t)(USBD->SE0 &= ~USBD_DRVSE0)) - -/** - * @brief Set USB device address - * - * @param[in] addr The USB device address. - * - * @return None - * - * @details Write USB device address to USB_FADDR register. - * \hideinitializer - */ -#define USBD_SET_ADDR(addr) (USBD->FADDR = (addr)) - -/** - * @brief Get USB device address - * - * @param None - * - * @return USB device address - * - * @details Read USB_FADDR register to get USB device address. - * \hideinitializer - */ -#define USBD_GET_ADDR() ((uint32_t)(USBD->FADDR)) - -/** - * @brief Enable USB interrupt function - * - * @param[in] intr The combination of the specified interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. - * (USBD_INT_WAKEUP, USBD_INT_FLDET, USBD_INT_USB, USBD_INT_BUS) - * - * @return None - * - * @details Enable USB related interrupt functions specified by intr parameter. - * \hideinitializer - */ -#define USBD_ENABLE_INT(intr) (USBD->INTEN |= (intr)) - -/** - * @brief Get interrupt status - * - * @param None - * - * @return The value of USB_INTSTS register - * - * @details Return all interrupt flags of USB_INTSTS register. - * \hideinitializer - */ -#define USBD_GET_INT_FLAG() ((uint32_t)(USBD->INTSTS)) - -/** - * @brief Clear USB interrupt flag - * - * @param[in] flag The combination of the specified interrupt flags. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. - * (USBD_INTSTS_WAKEUP, USBD_INTSTS_FLDET, USBD_INTSTS_BUS, USBD_INTSTS_USB) - * - * @return None - * - * @details Clear USB related interrupt flags specified by flag parameter. - * \hideinitializer - */ -#define USBD_CLR_INT_FLAG(flag) (USBD->INTSTS = (flag)) - -/** - * @brief Get endpoint status - * - * @param None - * - * @return The value of USB_EPSTS register. - * - * @details Return all endpoint status. - * \hideinitializer - */ -#define USBD_GET_EP_FLAG() ((uint32_t)(USBD->EPSTS)) - -/** - * @brief Get USB bus state - * - * @param None - * - * @return The value of USB_ATTR[3:0]. - * Bit 0 indicates USB bus reset status. - * Bit 1 indicates USB bus suspend status. - * Bit 2 indicates USB bus resume status. - * Bit 3 indicates USB bus time-out status. - * - * @details Return USB_ATTR[3:0] for USB bus events. - * \hideinitializer - */ -#define USBD_GET_BUS_STATE() ((uint32_t)(USBD->ATTR & 0xf)) - -/** - * @brief Check cable connection state - * - * @param None - * - * @retval 0 USB cable is not attached. - * @retval 1 USB cable is attached. - * - * @details Check the connection state by FLDET bit of USB_FLDET register. - * \hideinitializer - */ -#define USBD_IS_ATTACHED() ((uint32_t)(USBD->VBUSDET & USBD_VBUSDET_VBUSDET_Msk)) - -/** - * @brief Stop USB transaction of the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Write 1 to CLRRDY bit of USB_CFGPx register to stop USB transaction of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_STOP_TRANSACTION(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_CLRRDY_Msk) - -/** - * @brief Set USB DATA1 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Set DSQ_SYNC bit of USB_CFGx register to specify the DATA1 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions. - * \hideinitializer - */ -#define USBD_SET_DATA1(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) |= USBD_CFG_DSQSYNC_Msk) - -/** - * @brief Set USB DATA0 PID for the specified endpoint ID - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Clear DSQ_SYNC bit of USB_CFGx register to specify the DATA0 PID for the following IN token transaction. - * Base on this setting, hardware will toggle PID between DATA0 and DATA1 automatically for IN token transactions. - * \hideinitializer - */ -#define USBD_SET_DATA0(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) &= (~USBD_CFG_DSQSYNC_Msk)) - -/** - * @brief Set USB payload size (IN data) - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @param[in] size The transfer length. - * - * @return None - * - * @details This macro will write the transfer length to USB_MXPLDx register for IN data transaction. - * \hideinitializer - */ -#define USBD_SET_PAYLOAD_LEN(ep, size) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4))) = (size)) - -/** - * @brief Get USB payload size (OUT data) - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 endpoint ID. This parameter could be 0 ~ 11. - * - * @return The value of USB_MXPLDx register. - * - * @details Get the data length of OUT data transaction by reading USB_MXPLDx register. - * \hideinitializer - */ -#define USBD_GET_PAYLOAD_LEN(ep) ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].MXPLD + (uint32_t)((ep) << 4)))) - -/** - * @brief Configure endpoint - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @param[in] config The USB configuration. - * - * @return None - * - * @details This macro will write config parameter to USB_CFGx register of specified endpoint ID. - * \hideinitializer - */ -#define USBD_CONFIG_EP(ep, config) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFG + (uint32_t)((ep) << 4))) = (config)) - -/** - * @brief Set USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @param[in] offset The SRAM offset. - * - * @return None - * - * @details This macro will set the SRAM offset for the specified endpoint ID. - * \hideinitializer - */ -#define USBD_SET_EP_BUF_ADDR(ep, offset) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4))) = (offset)) - -/** - * @brief Get the offset of the specified USB endpoint buffer - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return The offset of the specified endpoint buffer. - * - * @details This macro will return the SRAM offset of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_GET_EP_BUF_ADDR(ep) ((uint32_t)*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].BUFSEG + (uint32_t)((ep) << 4)))) - -/** - * @brief Set USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - * \hideinitializer - */ -#define USBD_SET_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0ul].CFGP + (uint32_t)((ep) << 4))) |= USBD_CFGP_SSTALL_Msk) - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @return None - * - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - * \hideinitializer - */ -#define USBD_CLR_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) &= ~USBD_CFGP_SSTALL_Msk) - -/** - * @brief Get USB endpoint stall state - * - * @param[in] ep The USB endpoint ID. M480 Series supports 8 hardware endpoint ID. This parameter could be 0 ~ 11. - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state of the specified endpoint ID. - * \hideinitializer - */ -#define USBD_GET_EP_STALL(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EP[0].CFGP + (uint32_t)((ep) << 4))) & USBD_CFGP_SSTALL_Msk) - -/** - * @brief To support byte access between USB SRAM and system SRAM - * - * @param[in] dest Destination pointer. - * - * @param[in] src Source pointer. - * - * @param[in] size Byte count. - * - * @return None - * - * @details This function will copy the number of data specified by size and src parameters to the address specified by dest parameter. - * - */ -__STATIC_INLINE void USBD_MemCopy(uint8_t dest[], uint8_t src[], uint32_t size) -{ - uint32_t volatile i=0ul; - - while(size--) - { - dest[i] = src[i]; - i++; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Set USB endpoint stall state. Endpoint will respond STALL token automatically. - * - */ -__STATIC_INLINE void USBD_SetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for(i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg | USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @return None - * - * @details Clear USB endpoint stall state. Endpoint will respond ACK/NAK token. - */ -__STATIC_INLINE void USBD_ClearStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for(i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - *((__IO uint32_t *)(u32CfgAddr)) = (u32Cfg & ~USBD_CFGP_SSTALL); - break; - } - } -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] epnum USB endpoint number - * - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - * - */ -__STATIC_INLINE uint32_t USBD_GetStall(uint8_t epnum) -{ - uint32_t u32CfgAddr; - uint32_t u32Cfg; - uint32_t i; - - for(i = 0ul; i < USBD_MAX_EP; i++) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFG; /* USBD_CFG0 */ - u32Cfg = *((__IO uint32_t *)(u32CfgAddr)); - - if((u32Cfg & 0xful) == epnum) - { - u32CfgAddr = (uint32_t)(i << 4) + (uint32_t)&USBD->EP[0].CFGP; /* USBD_CFGP0 */ - break; - } - } - - return ((*((__IO uint32_t *)(u32CfgAddr))) & USBD_CFGP_SSTALL); -} - - -extern volatile uint8_t g_usbd_RemoteWakeupEn; - - -typedef void (*VENDOR_REQ)(void); /*!< Functional pointer type definition for Vendor class */ -typedef void (*CLASS_REQ)(void); /*!< Functional pointer type declaration for USB class request callback handler */ -typedef void (*SET_INTERFACE_REQ)(uint32_t u32AltInterface); /*!< Functional pointer type declaration for USB set interface request callback handler */ -typedef void (*SET_CONFIG_CB)(void); /*!< Functional pointer type declaration for USB set configuration request callback handler */ - - -/*--------------------------------------------------------------------*/ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface); -void USBD_Start(void); -void USBD_GetSetupPacket(uint8_t *buf); -void USBD_ProcessSetupPacket(void); -void USBD_StandardRequest(void); -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size); -void USBD_CtrlIn(void); -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size); -void USBD_CtrlOut(void); -void USBD_SwReset(void); -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq); -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback); -void USBD_LockEpStall(uint32_t u32EpBitmap); - -/*@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_USBD_H__*/ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_i2c.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_i2c.h deleted file mode 100644 index 55508d5e77e..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_i2c.h +++ /dev/null @@ -1,332 +0,0 @@ -/**************************************************************************//** - * @file USCI_I2C.h - * @version V3.0 - * @brief M480 series USCI I2C(UI2C) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_USCI_I2C_H__ -#define __NU_USCI_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - -/** @addtogroup USCI_I2C_EXPORTED_CONSTANTS USCI_I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C master event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_MASTER_EVENT -{ - MASTER_SEND_ADDRESS = 10, /*!< Master send address to Slave */ - MASTER_SEND_H_WR_ADDRESS, /*!< Master send High address to Slave */ - MASTER_SEND_H_RD_ADDRESS, /*!< Master send address to Slave (Read ADDR) */ - MASTER_SEND_L_ADDRESS, /*!< Master send Low address to Slave */ - MASTER_SEND_DATA, /*!< Master Send Data to Slave */ - MASTER_SEND_REPEAT_START, /*!< Master send repeat start to Slave */ - MASTER_READ_DATA, /*!< Master Get Data from Slave */ - MASTER_STOP, /*!< Master send stop to Slave */ - MASTER_SEND_START /*!< Master send start to Slave */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C slave event definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -enum UI2C_SLAVE_EVENT -{ - SLAVE_ADDRESS_ACK = 100, /*!< Slave send address ACK */ - SLAVE_H_WR_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_WR_ADDRESS_ACK, /*!< Slave send Low address ACK */ - SLAVE_GET_DATA, /*!< Slave Get Data from Master (Write CMD) */ - SLAVE_SEND_DATA, /*!< Slave Send Data to Master (Read CMD) */ - SLAVE_H_RD_ADDRESS_ACK, /*!< Slave send High address ACK */ - SLAVE_L_RD_ADDRESS_ACK /*!< Slave send Low address ACK */ -}; - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_CTL_PTRG 0x20UL /*!< USCI_CTL setting for I2C control bits. It would set PTRG bit \hideinitializer */ -#define UI2C_CTL_STA 0x08UL /*!< USCI_CTL setting for I2C control bits. It would set STA bit \hideinitializer */ -#define UI2C_CTL_STO 0x04UL /*!< USCI_CTL setting for I2C control bits. It would set STO bit \hideinitializer */ -#define UI2C_CTL_AA 0x02UL /*!< USCI_CTL setting for I2C control bits. It would set AA bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_GCMODE_ENABLE (1U) /*!< Enable USCI_I2C GC Mode \hideinitializer */ -#define UI2C_GCMODE_DISABLE (0U) /*!< Disable USCI_I2C GC Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C Wakeup Mode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_DATA_TOGGLE_WK (0x0U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according data toggle \hideinitializer */ -#define UI2C_ADDR_MATCH_WK (0x1U << UI2C_WKCTL_WKADDREN_Pos) /*!< Wakeup according address match \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI_I2C interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UI2C_TO_INT_MASK (0x001U) /*!< Time-out interrupt mask \hideinitializer */ -#define UI2C_STAR_INT_MASK (0x002U) /*!< Start condition received interrupt mask \hideinitializer */ -#define UI2C_STOR_INT_MASK (0x004U) /*!< Stop condition received interrupt mask \hideinitializer */ -#define UI2C_NACK_INT_MASK (0x008U) /*!< Non-acknowledge interrupt mask \hideinitializer */ -#define UI2C_ARBLO_INT_MASK (0x010U) /*!< Arbitration lost interrupt mask \hideinitializer */ -#define UI2C_ERR_INT_MASK (0x020U) /*!< Error interrupt mask \hideinitializer */ -#define UI2C_ACK_INT_MASK (0x040U) /*!< Acknowledge interrupt mask \hideinitializer */ - -/*@}*/ /* end of group USCI_I2C_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This macro sets the USCI_I2C protocol control register at one time - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Ctrl Set the register value of USCI_I2C control register. - * - * @return None - * - * @details Set UI2C_PROTCTL register to control USCI_I2C bus conditions of START, STOP, SI, ACK. - * \hideinitializer - */ -#define UI2C_SET_CONTROL_REG(ui2c, u8Ctrl) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2EU) | (u8Ctrl)) - -/** - * @brief This macro only set START bit to protocol control register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus START condition in UI2C_PROTCTL register. - * \hideinitializer - */ -#define UI2C_START(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~UI2C_PROTCTL_PTRG_Msk) | UI2C_PROTCTL_STA_Msk) - -/** - * @brief This macro only set STOP bit to the control register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Set the USCI_I2C bus STOP condition in UI2C_PROTCTL register. - * \hideinitializer - */ -#define UI2C_STOP(ui2c) ((ui2c)->PROTCTL = ((ui2c)->PROTCTL & ~0x2E) | (UI2C_PROTCTL_PTRG_Msk | UI2C_PROTCTL_STO_Msk)) - -/** - * @brief This macro returns the data stored in data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Data - * - * @details Read a byte data value of UI2C_RXDAT register from USCI_I2C bus - * \hideinitializer - */ -#define UI2C_GET_DATA(ui2c) ((ui2c)->RXDAT) - -/** - * @brief This macro writes the data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details Write a byte data value of UI2C_TXDAT register, then sends address or data to USCI I2C bus - * \hideinitializer - */ -#define UI2C_SET_DATA(ui2c, u8Data) ((ui2c)->TXDAT = (u8Data)) - -/** - * @brief This macro returns time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 USCI_I2C bus time-out is not happened - * @retval 1 USCI_I2C bus time-out is happened - * - * @details USCI_I2C bus occurs time-out event, the time-out flag will be set. If not occurs time-out event, this bit is cleared. - * \hideinitializer - */ -#define UI2C_GET_TIMEOUT_FLAG(ui2c) (((ui2c)->PROTSTS & UI2C_PROTSTS_TOIF_Msk) == UI2C_PROTSTS_TOIF_Msk ? 1:0) - -/** - * @brief This macro returns wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details USCI_I2C controller wake-up flag will be set when USCI_I2C bus occurs wake-up from deep-sleep. - * \hideinitializer - */ -#define UI2C_GET_WAKEUP_FLAG(ui2c) (((ui2c)->WKSTS & UI2C_WKSTS_WKF_Msk) == UI2C_WKSTS_WKF_Msk ? 1:0) - -/** - * @brief This macro is used to clear USCI_I2C wake-up flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details If USCI_I2C wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define UI2C_CLR_WAKEUP_FLAG(ui2c) ((ui2c)->WKSTS = UI2C_WKSTS_WKF_Msk) - -/** - * @brief This macro disables the USCI_I2C 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details The UI2C_I2C is 7-bit address mode, when disable USCI_I2C 10-bit address match function. - * \hideinitializer - */ -#define UI2C_DISABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL &= ~(UI2C_PROTCTL_ADDR10EN_Msk)) - -/** - * @brief This macro enables the 10-bit address mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To enable USCI_I2C 10-bit address match function. - * \hideinitializer - */ -#define UI2C_ENABLE_10BIT_ADDR_MODE(ui2c) ((ui2c)->PROTCTL |= UI2C_PROTCTL_ADDR10EN_Msk) - -/** - * @brief This macro gets USCI_I2C protocol interrupt flag or bus status - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return A word data of USCI_I2C_PROTSTS register - * - * @details Read a word data of USCI_I2C PROTSTS register to get USCI_I2C bus Interrupt flags or status. - * \hideinitializer - */ -#define UI2C_GET_PROT_STATUS(ui2c) ((ui2c)->PROTSTS) - -/** - * @brief This macro clears specified protocol interrupt flag - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UI2C_PROTSTS_ACKIF_Msk - * - \ref UI2C_PROTSTS_ERRIF_Msk - * - \ref UI2C_PROTSTS_ARBLOIF_Msk - * - \ref UI2C_PROTSTS_NACKIF_Msk - * - \ref UI2C_PROTSTS_STORIF_Msk - * - \ref UI2C_PROTSTS_STARIF_Msk - * - \ref UI2C_PROTSTS_TOIF_Msk - * @return None - * - * @details To clear interrupt flag when USCI_I2C occurs interrupt and set interrupt flag. - * \hideinitializer - */ -#define UI2C_CLR_PROT_INT_FLAG(ui2c,u32IntTypeFlag) ((ui2c)->PROTSTS = (u32IntTypeFlag)) - -/** - * @brief This macro enables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Set specified USCI_I2C protocol interrupt bits to enable interrupt function. - * \hideinitializer - */ -#define UI2C_ENABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN |= (u32IntSel)) - -/** - * @brief This macro disables specified protocol interrupt - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref UI2C_PROTIEN_ACKIEN_Msk - * - \ref UI2C_PROTIEN_ERRIEN_Msk - * - \ref UI2C_PROTIEN_ARBLOIEN_Msk - * - \ref UI2C_PROTIEN_NACKIEN_Msk - * - \ref UI2C_PROTIEN_STORIEN_Msk - * - \ref UI2C_PROTIEN_STARIEN_Msk - * - \ref UI2C_PROTIEN_TOIEN_Msk - * @return None - * - * @details Clear specified USCI_I2C protocol interrupt bits to disable interrupt function. - * \hideinitializer - */ -#define UI2C_DISABLE_PROT_INT(ui2c, u32IntSel) ((ui2c)->PROTIEN &= ~ (u32IntSel)) - - -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock); -void UI2C_Close(UI2C_T *ui2c); -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c); -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack); -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask); -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c); -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock); -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask); -void UI2C_ClearIntFlag(UI2C_T* ui2c, uint32_t u32Mask); -uint32_t UI2C_GetData(UI2C_T *ui2c); -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data); -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode); -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask); -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt); -void UI2C_DisableTimeout(UI2C_T *ui2c); -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode); -void UI2C_DisableWakeup(UI2C_T *ui2c); -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *data, uint32_t u32wLen); -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr); -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen); -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen); -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen); - -/*@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_spi.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_spi.h deleted file mode 100644 index 002076027ee..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_spi.h +++ /dev/null @@ -1,429 +0,0 @@ -/****************************************************************************//** - * @file nu_usci_spi.h - * @version V3.00 - * @brief M480 series USCI_SPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_USCI_SPI_H__ -#define __NU_USCI_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - -/** @addtogroup USCI_SPI_EXPORTED_CONSTANTS USCI_SPI Exported Constants - @{ -*/ - -#define USPI_MODE_0 (0x0 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with falling edge and receive with rising edge \hideinitializer */ -#define USPI_MODE_1 (0x1 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with rising edge and receive with falling edge \hideinitializer */ -#define USPI_MODE_2 (0x2 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with rising edge and receive with falling edge \hideinitializer */ -#define USPI_MODE_3 (0x3 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with falling edge and receive with rising edge \hideinitializer */ - -#define USPI_SLAVE (USPI_PROTCTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define USPI_MASTER (0x0ul) /*!< Set as master \hideinitializer */ - -#define USPI_SS (USPI_PROTCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define USPI_SS_ACTIVE_HIGH (0x0ul) /*!< SS active high \hideinitializer */ -#define USPI_SS_ACTIVE_LOW (USPI_LINECTL_CTLOINV_Msk) /*!< SS active low \hideinitializer */ - -/* USCI_SPI Interrupt Mask */ -#define USPI_SSINACT_INT_MASK (0x001ul) /*!< Slave Slave Inactive interrupt mask \hideinitializer */ -#define USPI_SSACT_INT_MASK (0x002ul) /*!< Slave Slave Active interrupt mask \hideinitializer */ -#define USPI_SLVTO_INT_MASK (0x004ul) /*!< Slave Mode Time-out interrupt mask \hideinitializer */ -#define USPI_SLVBE_INT_MASK (0x008ul) /*!< Slave Mode Bit Count Error interrupt mask \hideinitializer */ -#define USPI_TXUDR_INT_MASK (0x010ul) /*!< Slave Transmit Under Run interrupt mask \hideinitializer */ -#define USPI_RXOV_INT_MASK (0x020ul) /*!< Receive Buffer Overrun interrupt mask \hideinitializer */ -#define USPI_TXST_INT_MASK (0x040ul) /*!< Transmit Start interrupt mask \hideinitializer */ -#define USPI_TXEND_INT_MASK (0x080ul) /*!< Transmit End interrupt mask \hideinitializer */ -#define USPI_RXST_INT_MASK (0x100ul) /*!< Receive Start interrupt mask \hideinitializer */ -#define USPI_RXEND_INT_MASK (0x200ul) /*!< Receive End interrupt mask \hideinitializer */ - -/* USCI_SPI Status Mask */ -#define USPI_BUSY_MASK (0x01ul) /*!< Busy status mask \hideinitializer */ -#define USPI_RX_EMPTY_MASK (0x02ul) /*!< RX empty status mask \hideinitializer */ -#define USPI_RX_FULL_MASK (0x04ul) /*!< RX full status mask \hideinitializer */ -#define USPI_TX_EMPTY_MASK (0x08ul) /*!< TX empty status mask \hideinitializer */ -#define USPI_TX_FULL_MASK (0x10ul) /*!< TX full status mask \hideinitializer */ -#define USPI_SSLINE_STS_MASK (0x20ul) /*!< USCI_SPI_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group USCI_SPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief Disable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL &= ~USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Enable slave 3-wire mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL |= USPI_PROTCTL_SLV3WIRE_Msk ) - -/** - * @brief Get the Rx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Rx buffer flag - * @retval 0: Rx buffer is not empty - * @retval 1: Rx buffer is empty - * \hideinitializer - */ -#define USPI_GET_RX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_RXEMPTY_Msk) == USPI_BUFSTS_RXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer empty flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not empty - * @retval 1: Tx buffer is empty - * \hideinitializer - */ -#define USPI_GET_TX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXEMPTY_Msk) == USPI_BUFSTS_TXEMPTY_Msk ? 1:0 ) - -/** - * @brief Get the Tx buffer full flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Tx buffer flag - * @retval 0: Tx buffer is not full - * @retval 1: Tx buffer is full - * \hideinitializer - */ -#define USPI_GET_TX_FULL_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXFULL_Msk) == USPI_BUFSTS_TXFULL_Msk ? 1:0 ) - -/** - * @brief Get the datum read from RX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return data in Rx register - * \hideinitializer - */ -#define USPI_READ_RX(uspi) ((uspi)->RXDAT) - -/** - * @brief Write datum to TX register. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through USCI_SPI bus. - * @return None - * \hideinitializer - */ -#define USPI_WRITE_TX(uspi, u32TxData) ( (uspi)->TXDAT = (u32TxData) ) - -/** - * @brief Set USCI_SPI_SS pin to high state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to high state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_HIGH(uspi) \ - do{ \ - (uspi)->LINECTL &= ~(USPI_LINECTL_CTLOINV_Msk); \ - (uspi)->PROTCTL = ((uspi)->PROTCTL & ~(USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SS_Msk)); \ - }while(0) - -/** - * @brief Set USCI_SPI_SS pin to low state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Disable automatic slave selection function and set USCI_SPI_SS pin to low state. Only available in Master mode. - * \hideinitializer - */ -#define USPI_SET_SS_LOW(uspi) \ - do{ \ - (uspi)->LINECTL |= (USPI_LINECTL_CTLOINV_Msk); \ - (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \ - }while(0) - -/** - * @brief Set the length of suspend interval. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SuspCycle Decide the length of suspend interval. - * @return None - * \hideinitializer - */ -#define USPI_SET_SUSPEND_CYCLE(uspi, u32SuspCycle) ( (uspi)->PROTCTL = ((uspi)->PROTCTL & ~USPI_PROTCTL_SUSPITV_Msk) | ((u32SuspCycle) << USPI_PROTCTL_SUSPITV_Pos) ) - -/** - * @brief Set the USCI_SPI transfer sequence with LSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_LSB_FIRST(uspi) ( (uspi)->LINECTL |= USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the USCI_SPI transfer sequence with MSB first. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_SET_MSB_FIRST(uspi) ( (uspi)->LINECTL &= ~USPI_LINECTL_LSB_Msk ) - -/** - * @brief Set the data width of a USCI_SPI transaction. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Width The data width - * @return None - * \hideinitializer - */ -#define USPI_SET_DATA_WIDTH(uspi,u32Width) \ - do{ \ - if((u32Width) == 16ul){ \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | (0 << USPI_LINECTL_DWIDTH_Pos); \ - }else { \ - (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | ((u32Width) << USPI_LINECTL_DWIDTH_Pos); \ - } \ - }while(0) - -/** - * @brief Get the USCI_SPI busy state. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return USCI_SPI busy status - * @retval 0: USCI_SPI module is not busy - * @retval 1: USCI_SPI module is busy - * \hideinitializer - */ -#define USPI_IS_BUSY(uspi) ( ((uspi)->PROTSTS & USPI_PROTSTS_BUSY_Msk) == USPI_PROTSTS_BUSY_Msk ? 1:0 ) - -/** - * @brief Get the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Wakeup status. - * @retval 0 Flag is not set. - * @retval 1 Flag is set. - * \hideinitializer - */ -#define USPI_GET_WAKEUP_FLAG(uspi) ( ((uspi)->WKSTS & USPI_WKSTS_WKF_Msk) == USPI_WKSTS_WKF_Msk ? 1:0) - -/** - * @brief Clear the USCI_SPI wakeup flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - * \hideinitializer - */ -#define USPI_CLR_WAKEUP_FLAG(uspi) ( (uspi)->WKSTS |= USPI_WKSTS_WKF_Msk) - -/** - * @brief Get protocol interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of protocol status register. - * \hideinitializer - */ -#define USPI_GET_PROT_STATUS(uspi) ( (uspi)->PROTSTS) - -/** - * @brief Clear specified protocol interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_PROTSTS_SSACTIF_Msk - * - \ref USPI_PROTSTS_SSINAIF_Msk - * - \ref USPI_PROTSTS_SLVBEIF_Msk - * - \ref USPI_PROTSTS_SLVTOIF_Msk - * - \ref USPI_PROTSTS_RXENDIF_Msk - * - \ref USPI_PROTSTS_RXSTIF_Msk - * - \ref USPI_PROTSTS_TXENDIF_Msk - * - \ref USPI_PROTSTS_TXSTIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_PROT_INT_FLAG(uspi,u32IntTypeFlag) ( (uspi)->PROTSTS = (u32IntTypeFlag)) - -/** - * @brief Get buffer interrupt flag/status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return The interrupt flag/status of buffer status register. - * \hideinitializer - */ -#define USPI_GET_BUF_STATUS(uspi) ( (uspi)->BUFSTS) - -/** - * @brief Clear specified buffer interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref USPI_BUFSTS_TXUDRIF_Msk - * - \ref USPI_BUFSTS_RXOVIF_Msk - * @return None - * \hideinitializer - */ -#define USPI_CLR_BUF_INT_FLAG(uspi,u32IntTypeFlag) ( (uspi)->BUFSTS = (u32IntTypeFlag)) - -/** - * @brief Enable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_PROT_INT(uspi, u32IntSel) ((uspi)->PROTIEN |= (u32IntSel)) - -/** - * @brief Disable specified protocol interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_PROTIEN_SLVBEIEN_Msk - * - \ref USPI_PROTIEN_SLVTOIEN_Msk - * - \ref USPI_PROTIEN_SSACTIEN_Msk - * - \ref USPI_PROTIEN_SSINAIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_PROT_INT(uspi, u32IntSel) ((uspi)->PROTIEN &= ~ (u32IntSel)) - -/** - * @brief Enable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_BUF_INT(uspi, u32IntSel) ((uspi)->BUFCTL |= (u32IntSel)) - -/** - * @brief Disable specified buffer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_BUFCTL_RXOVIEN_Msk - * - \ref USPI_BUFCTL_TXUDRIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_BUF_INT(uspi, u32IntSel) ((uspi)->BUFCTL &= ~ (u32IntSel)) - -/** - * @brief Enable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_ENABLE_TRANS_INT(uspi, u32IntSel) ((uspi)->INTEN |= (u32IntSel)) - -/** - * @brief Disable specified transfer interrupt. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32IntSel Interrupt Type, should be - * - \ref USPI_INTEN_RXENDIEN_Msk - * - \ref USPI_INTEN_RXSTIEN_Msk - * - \ref USPI_INTEN_TXENDIEN_Msk - * - \ref USPI_INTEN_TXSTIEN_Msk - * @return None - * \hideinitializer - */ -#define USPI_DISABLE_TRANS_INT(uspi, u32IntSel) ((uspi)->INTEN &= ~ (u32IntSel)) - - -/** - * @brief Trigger RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set RXPDMAEN bit of USPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_RX_PDMA(uspi) ((uspi)->PDMACTL |= USPI_PDMACTL_RXPDMAEN_Msk|USPI_PDMACTL_PDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit of USPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_TX_PDMA(uspi) ((uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk|USPI_PDMACTL_PDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_TRIGGER_TX_RX_PDMA(uspi) ((uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk|USPI_PDMACTL_RXPDMAEN_Msk|USPI_PDMACTL_PDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear RXPDMAEN bit of USPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit of USPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_TX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define USPI_DISABLE_TX_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~(USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_RXPDMAEN_Msk)) - -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void USPI_Close(USPI_T *uspi); -void USPI_ClearRxBuf(USPI_T *uspi); -void USPI_ClearTxBuf(USPI_T *uspi); -void USPI_DisableAutoSS(USPI_T *uspi); -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock); -uint32_t USPI_GetBusClock(USPI_T *uspi); -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask); -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask); -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask); -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask); -void USPI_EnableWakeup(USPI_T *uspi); -void USPI_DisableWakeup(USPI_T *uspi); - - -/*@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_SPI_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_uart.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_uart.h deleted file mode 100644 index e1402a19115..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_usci_uart.h +++ /dev/null @@ -1,520 +0,0 @@ -/**************************************************************************//** - * @file nu_usci_uart.h - * @version V3.00 - * @brief M480 series USCI UART (UUART) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_USCI_UART_H__ -#define __NU_USCI_UART_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_CONSTANTS USCI_UART Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_LINECTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_WORD_LEN_6 (6ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 6 bits \hideinitializer */ -#define UUART_WORD_LEN_7 (7ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 7 bits \hideinitializer */ -#define UUART_WORD_LEN_8 (8ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 8 bits \hideinitializer */ -#define UUART_WORD_LEN_9 (9ul << UUART_LINECTL_DWIDTH_Pos) /*!< UUART_LINECTL setting to set UART word length to 9 bits \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UUART_PROTCTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_PARITY_NONE (0x0ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as no parity \hideinitializer */ -#define UUART_PARITY_ODD (0x1ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as odd parity \hideinitializer */ -#define UUART_PARITY_EVEN (0x3ul << UUART_PROTCTL_PARITYEN_Pos) /*!< UUART_PROTCTL setting to set UART as even parity \hideinitializer */ - -#define UUART_STOP_BIT_1 (0x0ul) /*!< UUART_PROTCTL setting for one stop bit \hideinitializer */ -#define UUART_STOP_BIT_2 (0x1ul) /*!< UUART_PROTCTL setting for two stop bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* USCI UART interrupt mask definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UUART_ABR_INT_MASK (0x002ul) /*!< Auto-baud rate interrupt mask \hideinitializer */ -#define UUART_RLS_INT_MASK (0x004ul) /*!< Receive line status interrupt mask \hideinitializer */ -#define UUART_BUF_RXOV_INT_MASK (0x008ul) /*!< Buffer RX overrun interrupt mask \hideinitializer */ -#define UUART_TXST_INT_MASK (0x010ul) /*!< TX start interrupt mask \hideinitializer */ -#define UUART_TXEND_INT_MASK (0x020ul) /*!< Tx end interrupt mask \hideinitializer */ -#define UUART_RXST_INT_MASK (0x040ul) /*!< RX start interrupt mask \hideinitializer */ -#define UUART_RXEND_INT_MASK (0x080ul) /*!< RX end interrupt mask \hideinitializer */ - - -/*@}*/ /* end of group USCI_UART_EXPORTED_CONSTANTS */ - - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UUART_WRITE(uuart, u8Data) ((uuart)->TXDAT = (u8Data)) - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The oldest data byte in RX buffer. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UUART_READ(uuart) ((uuart)->RXDAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not empty - * @retval >=1 Tx buffer is empty - * - * @details This macro get Transmitter buffer empty register value. - * \hideinitializer - */ -#define UUART_GET_TX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not empty - * @retval >=1 Rx buffer is empty - * - * @details This macro get Receiver buffer empty register value. - * \hideinitializer - */ -#define UUART_GET_RX_EMPTY(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified usci_uart port transmission is over. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. \n - * It indicates if specified usci_uart port transmission is over nor not. - * \hideinitializer - */ -#define UUART_IS_TX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos) - - -/** - * @brief Check specified usci_uart port receiver is empty. - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx receiver is not empty - * @retval 1 Rx receiver is empty - * - * @details This macro return Receive Empty Flag register bit value. \n - * It indicates if specified usci_uart port receiver is empty nor not. - * \hideinitializer - */ -#define UUART_IS_RX_EMPTY(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) >> UUART_BUFSTS_RXEMPTY_Pos) - - -/** - * @brief Wait specified usci_uart port transmission is over - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro wait specified usci_uart port transmission is over. - * \hideinitializer - */ -#define UUART_WAIT_TX_EMPTY(uuart) while(!((((uuart)->BUFSTS) & UUART_BUFSTS_TXEMPTY_Msk) >> UUART_BUFSTS_TXEMPTY_Pos)) - - -/** - * @brief Check TX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 TX buffer is full - * @retval 0 TX buffer is not full - * - * @details This macro check TX buffer is full or not. - * \hideinitializer - */ -#define UUART_IS_TX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk)>>UUART_BUFSTS_TXFULL_Pos) - - -/** - * @brief Check RX buffer is full or not - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 1 RX buffer is full - * @retval 0 RX buffer is not full - * - * @details This macro check RX buffer is full or not. - * \hideinitializer - */ -#define UUART_IS_RX_FULL(uuart) (((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk)>>UUART_BUFSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Tx buffer is not full. - * @retval >=1 Tx buffer is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UUART_GET_TX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Rx buffer is not full. - * @retval >=1 Rx buffer is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UUART_GET_RX_FULL(uuart) ((uuart)->BUFSTS & UUART_BUFSTS_RXFULL_Msk) - - -/** - * @brief Enable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART protocol interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART protocol interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_PROTIEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UUART_PROTIEN_ABRIEN_Msk : Auto-baud rate interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART protocol interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_PROT_INT(uuart, u32IntSel) ((uuart)->PROTIEN &= ~(u32IntSel)) - - -/** - * @brief Enable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART buffer interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART buffer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_BUFCTL_RXOVIEN_Msk : Receive buffer overrun error interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART buffer interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_BUF_INT(uuart, u32IntSel) ((uuart)->BUFCTL &= ~ (u32IntSel)) - - -/** - * @brief Enable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro enable specified USCI_UART transfer interrupt. - * \hideinitializer - */ -#define UUART_ENABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN |= (u32IntSel)) - - -/** - * @brief Disable specified USCI_UART transfer interrupt - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntSel Interrupt type select - * - \ref UUART_INTEN_RXENDIEN_Msk : Receive end interrupt - * - \ref UUART_INTEN_RXSTIEN_Msk : Receive start interrupt - * - \ref UUART_INTEN_TXENDIEN_Msk : Transmit end interrupt - * - \ref UUART_INTEN_TXSTIEN_Msk : Transmit start interrupt - * - * @return None - * - * @details This macro disable specified USCI_UART transfer interrupt. - * \hideinitializer - */ -#define UUART_DISABLE_TRANS_INT(uuart, u32IntSel) ((uuart)->INTEN &= ~(u32IntSel)) - - -/** - * @brief Get protocol interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of protocol status register. - * - * @details This macro get protocol status register value. - * \hideinitializer - */ -#define UUART_GET_PROT_STATUS(uuart) ((uuart)->PROTSTS) - - -/** - * @brief Clear specified protocol interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_PROTSTS_ABERRSTS_Msk : Auto-baud Rate Error Interrupt Indicator - * - \ref UUART_PROTSTS_ABRDETIF_Msk : Auto-baud Rate Detected Interrupt Flag - * - \ref UUART_PROTSTS_BREAK_Msk : Break Flag - * - \ref UUART_PROTSTS_FRMERR_Msk : Framing Error Flag - * - \ref UUART_PROTSTS_PARITYERR_Msk : Parity Error Flag - * - \ref UUART_PROTSTS_RXENDIF_Msk : Receive End Interrupt Flag - * - \ref UUART_PROTSTS_RXSTIF_Msk : Receive Start Interrupt Flag - * - \ref UUART_PROTSTS_TXENDIF_Msk : Transmit End Interrupt Flag - * - \ref UUART_PROTSTS_TXSTIF_Msk : Transmit Start Interrupt Flag - * - * @return None - * - * @details This macro clear specified protocol interrupt flag. - * \hideinitializer - */ -#define UUART_CLR_PROT_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->PROTSTS = (u32IntTypeFlag)) - - -/** - * @brief Get transmit/receive buffer interrupt flag/status - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return The interrupt flag/status of buffer status register. - * - * @details This macro get buffer status register value. - * \hideinitializer - */ -#define UUART_GET_BUF_STATUS(uuart) ((uuart)->BUFSTS) - - -/** - * @brief Clear specified buffer interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref UUART_BUFSTS_RXOVIF_Msk : Receive Buffer Over-run Error Interrupt Indicator - * - * @return None - * - * @details This macro clear specified buffer interrupt flag. - * \hideinitializer - */ -#define UUART_CLR_BUF_INT_FLAG(uuart,u32IntTypeFlag) ((uuart)->BUFSTS = (u32IntTypeFlag)) - - -/** - * @brief Get wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @retval 0 Chip did not wake up from power-down mode. - * @retval 1 Chip waked up from power-down mode. - * - * @details This macro get wakeup flag. - * \hideinitializer - */ -#define UUART_GET_WAKEUP_FLAG(uuart) ((uuart)->WKSTS & UUART_WKSTS_WKF_Msk ? 1: 0 ) - - -/** - * @brief Clear wakeup flag - * - * @param[in] uuart The pointer of the specified USCI_UART module - * - * @return None - * - * @details This macro clear wakeup flag. - * \hideinitializer - */ -#define UUART_CLR_WAKEUP_FLAG(uuart) ((uuart)->WKSTS = UUART_WKSTS_WKF_Msk) - -/** - * @brief Trigger RX PDMA function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Set RXPDMAEN bit of UUART_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define UUART_TRIGGER_RX_PDMA(uuart) ((uuart)->PDMACTL |= UUART_PDMACTL_RXPDMAEN_Msk|UUART_PDMACTL_PDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Set TXPDMAEN bit of UUART_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define UUART_TRIGGER_TX_PDMA(uuart) ((uuart)->PDMACTL |= UUART_PDMACTL_TXPDMAEN_Msk|UUART_PDMACTL_PDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Clear RXPDMAEN bit of UUART_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define UUART_DISABLE_RX_PDMA(uuart) ( (uuart)->PDMACTL &= ~UUART_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None. - * - * @details Clear TXPDMAEN bit of UUART_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define UUART_DISABLE_TX_PDMA(uuart) ( (uuart)->PDMACTL &= ~UUART_PDMACTL_TXPDMAEN_Msk ) - - -/** - * @brief Enable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UUART_PDMA_ENABLE(uuart, u32FuncSel) ((uuart)->PDMACTL |= (u32FuncSel)) - -/** - * @brief Disable specified USCI_UART PDMA function - * - * @param[in] uuart The pointer of the specified USCI_UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UUART_PDMACTL_TXPDMAEN_Msk - * - \ref UUART_PDMACTL_RXPDMAEN_Msk - * - \ref UUART_PDMACTL_PDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UUART_PDMA_DISABLE(uuart, u32FuncSel) ((uuart)->PDMACTL &= ~(u32FuncSel)) - - - - -void UUART_ClearIntFlag(UUART_T* uuart, uint32_t u32Mask); -uint32_t UUART_GetIntFlag(UUART_T* uuart, uint32_t u32Mask); -void UUART_Close(UUART_T* uuart); -void UUART_DisableInt(UUART_T* uuart, uint32_t u32Mask); -void UUART_EnableInt(UUART_T* uuart, uint32_t u32Mask); -uint32_t UUART_Open(UUART_T* uuart, uint32_t u32baudrate); -uint32_t UUART_Read(UUART_T* uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t UUART_SetLine_Config(UUART_T* uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -uint32_t UUART_Write(UUART_T* uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); -void UUART_EnableWakeup(UUART_T* uuart, uint32_t u32WakeupMode); -void UUART_DisableWakeup(UUART_T* uuart); -void UUART_EnableFlowCtrl(UUART_T* uuart); -void UUART_DisableFlowCtrl(UUART_T* uuart); - - -/*@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_USCI_UART_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wdt.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wdt.h deleted file mode 100644 index 634d73f8028..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wdt.h +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************//** - * @file nu_wdt.h - * @version V3.00 - * @brief M480 series WDT driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WDT_H__ -#define __NU_WDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_CONSTANTS WDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Time-out Interval Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_TIMEOUT_2POW4 (0UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^4 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW6 (1UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^6 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW8 (2UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^8 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW10 (3UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^10 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW12 (4UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^12 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW14 (5UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^14 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW16 (6UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^16 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW18 (7UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^18 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Reset Delay Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_DELAY_1026CLK (0UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 1026 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_130CLK (1UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 130 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_18CLK (2UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 18 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_3CLK (3UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 3 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Free Reset Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_COUNTER_KEYWORD (0x00005AA5UL) /*!< Fill this value to WDT_RSTCNT register to free reset WDT counter \hideinitializer */ - -/*@}*/ /* end of group WDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Clear WDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out reset system flag. - * \hideinitializer - */ -#define WDT_CLEAR_RESET_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_RSTF_Msk) - -/** - * @brief Clear WDT Time-out Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out interrupt flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_INT_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_IF_Msk) - -/** - * @brief Clear WDT Wake-up Flag - * - * @param None - * - * @return None - * - * @details This macro clears WDT time-out wake-up system flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (WDT->CTL = (WDT->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk)) | WDT_CTL_WKF_Msk) - -/** - * @brief Get WDT Time-out Reset Flag - * - * @param None - * - * @retval 0 WDT time-out reset system did not occur - * @retval 1 WDT time-out reset system occurred - * - * @details This macro indicates system has been reset by WDT time-out reset or not. - * \hideinitializer - */ -#define WDT_GET_RESET_FLAG() ((WDT->CTL & WDT_CTL_RSTF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Interrupt Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt did not occur - * @retval 1 WDT time-out interrupt occurred - * - * @details This macro indicates WDT time-out interrupt occurred or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_INT_FLAG() ((WDT->CTL & WDT_CTL_IF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Wake-up Flag - * - * @param None - * - * @retval 0 WDT time-out interrupt does not cause CPU wake-up - * @retval 1 WDT time-out interrupt event cause CPU wake-up - * - * @details This macro indicates WDT time-out interrupt event has waked up system or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_WAKEUP_FLAG() ((WDT->CTL & WDT_CTL_WKF_Msk)? 1UL : 0UL) - -/** - * @brief Reset WDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reset the internal 18-bit WDT up counter value. - * @note If WDT is activated and time-out reset system function is enabled also, user should \n - * reset the 18-bit WDT up counter value to avoid generate WDT time-out reset signal to \n - * reset system before the WDT time-out reset delay period expires. - * \hideinitializer - */ -#define WDT_RESET_COUNTER() (WDT->RSTCNT = WDT_RESET_COUNTER_KEYWORD) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void WDT_Close(void); -__STATIC_INLINE void WDT_EnableInt(void); -__STATIC_INLINE void WDT_DisableInt(void); - -/** - * @brief Stop WDT Counting - * - * @param None - * - * @return None - * - * @details This function will stop WDT counting and disable WDT module. - */ -__STATIC_INLINE void WDT_Close(void) -{ - WDT->CTL = 0UL; - return; -} - -/** - * @brief Enable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will enable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_EnableInt(void) -{ - WDT->CTL |= WDT_CTL_INTEN_Msk; - return; -} - -/** - * @brief Disable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will disable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_DisableInt(void) -{ - /* Do not touch another write 1 clear bits */ - WDT->CTL &= ~(WDT_CTL_INTEN_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk); - return; -} - -void WDT_Open(uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup); - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WDT_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wwdt.h b/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wwdt.h deleted file mode 100644 index a15ae1446b2..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/inc/nu_wwdt.h +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************//** - * @file nu_wwdt.h - * @version V3.00 - * @brief M480 series WWDT driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WWDT_H__ -#define __NU_WWDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_CONSTANTS WWDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Prescale Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_PRESCALER_1 (0 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2 (1 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_4 (2 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 4 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_8 (3 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 8 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_16 (4 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 16 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_32 (5 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 32 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_64 (6 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 64 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_128 (7 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 128 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_192 (8 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 192 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_256 (9 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 256 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_384 (10 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 384 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_512 (11 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 512 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_768 (12 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 768 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1024 (13 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1024 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1536 (14 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1536 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2048 (15 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2048 * (64*WWDT_CLK) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Reload Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_RELOAD_WORD (0x00005AA5) /*!< Fill this value to WWDT_RLDCNT register to reload WWDT counter \hideinitializer */ - -/*@}*/ /* end of group WWDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Clear WWDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT time-out reset system flag. - * \hideinitializer - */ -#define WWDT_CLEAR_RESET_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTRF_Msk) - -/** - * @brief Clear WWDT Compared Match Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT compared match interrupt flag. - * \hideinitializer - */ -#define WWDT_CLEAR_INT_FLAG() (WWDT->STATUS = WWDT_STATUS_WWDTIF_Msk) - -/** - * @brief Get WWDT Reset System Flag - * - * @param None - * - * @retval 0 WWDT time-out reset system did not occur - * @retval 1 WWDT time-out reset system occurred - * - * @details This macro is used to indicate system has been reset by WWDT time-out reset or not. - * \hideinitializer - */ -#define WWDT_GET_RESET_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTRF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Compared Match Interrupt Flag - * - * @param None - * - * @retval 0 WWDT compare match interrupt did not occur - * @retval 1 WWDT compare match interrupt occurred - * - * @details This macro is used to indicate WWDT counter value matches CMPDAT value or not. - * \hideinitializer - */ -#define WWDT_GET_INT_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTIF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Counter - * - * @param None - * - * @return WWDT Counter Value - * - * @details This macro reflects the current WWDT counter value. - * \hideinitializer - */ -#define WWDT_GET_COUNTER() (WWDT->CNT) - -/** - * @brief Reload WWDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reload the WWDT counter value to 0x3F. - * @note User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value \n - * between 0 and CMPDAT value. If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, \n - * WWDT reset signal will generate immediately to reset system. - * \hideinitializer - */ -#define WWDT_RELOAD_COUNTER() (WWDT->RLDCNT = WWDT_RELOAD_WORD) - -void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt); - -/*@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WWDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WWDT_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewd b/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewd deleted file mode 100644 index 4990af44b47..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewd +++ /dev/null @@ -1,3285 +0,0 @@ - - - - 2 - - Debug - - ARM - - 1 - - C-SPY - 2 - - 28 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 1 - 1 - 1 - - - - - - - - ANGEL_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - CADI_ID - 2 - - 0 - 1 - 1 - - - - - - - - - CMSISDAP_ID - 2 - - 4 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GDBSERVER_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - IARROM_ID - 2 - - 1 - 1 - 1 - - - - - - - - - IJET_ID - 2 - - 8 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JLINK_ID - 2 - - 16 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 2 - 1 - 1 - - - - - - - - - - MACRAIGOR_ID - 2 - - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - PEMICRO_ID - 2 - - 3 - 1 - 1 - - - - - - - - RDI_ID - 2 - - 2 - 1 - 1 - - - - - - - - - - - - - - - - STLINK_ID - 2 - - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - TIFET_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - - - XDS100_ID - 2 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $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 - - - - - 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 - - 6 - 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/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewp b/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewp deleted file mode 100644 index 8759c80add9..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.ewp +++ /dev/null @@ -1,2197 +0,0 @@ - - - 3 - - Debug - - ARM - - 1 - - General - 3 - - 31 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 35 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 10 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 1 - - - - - - - - - CUSTOM - 3 - - - - 0 - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 22 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - Release - - ARM - - 0 - - General - 3 - - 31 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 35 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 10 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 0 - - - - - - - - - CUSTOM - 3 - - - - 0 - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 22 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 0 - - - - - - - BILINK - 0 - - - - - src - - $PROJ_DIR$\..\src\nu_acmp.c - - - $PROJ_DIR$\..\src\nu_bpwm.c - - - $PROJ_DIR$\..\src\nu_can.c - - - $PROJ_DIR$\..\src\nu_ccap.c - - - $PROJ_DIR$\..\src\nu_clk.c - - - $PROJ_DIR$\..\src\nu_crc.c - - - $PROJ_DIR$\..\src\nu_crypto.c - - - $PROJ_DIR$\..\src\nu_dac.c - - - $PROJ_DIR$\..\src\nu_eadc.c - - - $PROJ_DIR$\..\src\nu_ebi.c - - - $PROJ_DIR$\..\src\nu_ecap.c - - - $PROJ_DIR$\..\src\nu_emac.c - - - $PROJ_DIR$\..\src\nu_epwm.c - - - $PROJ_DIR$\..\src\nu_fmc.c - - - $PROJ_DIR$\..\src\nu_gpio.c - - - $PROJ_DIR$\..\src\nu_hsusbd.c - - - $PROJ_DIR$\..\src\nu_i2c.c - - - $PROJ_DIR$\..\src\nu_i2s.c - - - $PROJ_DIR$\..\src\nu_pdma.c - - - $PROJ_DIR$\..\src\nu_qei.c - - - $PROJ_DIR$\..\src\nu_qspi.c - - - $PROJ_DIR$\..\src\nu_rtc.c - - - $PROJ_DIR$\..\src\nu_sc.c - - - $PROJ_DIR$\..\src\nu_scuart.c - - - $PROJ_DIR$\..\src\nu_sdh.c - - - $PROJ_DIR$\..\src\nu_spi.c - - - $PROJ_DIR$\..\src\nu_spim.c - - - $PROJ_DIR$\..\src\nu_sys.c - - - $PROJ_DIR$\..\src\nu_timer.c - - - $PROJ_DIR$\..\src\nu_timer_pwm.c - - - $PROJ_DIR$\..\src\nu_trng.c - - - $PROJ_DIR$\..\src\nu_uart.c - - - $PROJ_DIR$\..\src\nu_usbd.c - - - $PROJ_DIR$\..\src\nu_usci_i2c.c - - - $PROJ_DIR$\..\src\nu_usci_spi.c - - - $PROJ_DIR$\..\src\nu_usci_uart.c - - - $PROJ_DIR$\..\src\nu_wdt.c - - - $PROJ_DIR$\..\src\nu_wwdt.c - - - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.eww b/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.eww deleted file mode 100644 index fcdfcdfe308..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.eww +++ /dev/null @@ -1,10 +0,0 @@ - - - - - $WS_DIR$\libStdDriver.ewp - - - - - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.uvprojx b/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.uvprojx deleted file mode 100644 index c447d034e0a..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver.uvprojx +++ /dev/null @@ -1,587 +0,0 @@ - - - - 2.1 - -
### uVision Project, (C) Keil Software
- - - - libstddriver-m480 - 0x4 - ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC - 0 - - - M487JIDAE - Nuvoton - Nuvoton.NuMicro_DFP.1.3.9 - http://www.nuvoton.com/hq/enu/Documents/KEILSoftwarePack - IRAM(0x20000000,0x28000) IROM(0x00000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) - - - UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M481_AP_512 -FS00 -FL080000 -FP0($$Device:M487JIDAE$Flash\M481_AP_512.FLM)) - 0 - $$Device:M487JIDAE$Device\M480\Include\M480.h - - - - - - - - - - $$Device:M487JIDAE$SVD\Nuvoton\M481_v1.svd - 0 - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - .\build\keil5\ - libstddriver_keil - 0 - 1 - 1 - 1 - 1 - .\build\keil5\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 1 - 0 - xcopy /y ".\build\keil5\@L.lib" "." - - 0 - 0 - 0 - 0 - - 1 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - 1 - - - SARMCM3.DLL - - DCM.DLL - -pCM4 - SARMCM3.DLL - - TCM.DLL - -pCM4 - - - - 1 - 0 - 0 - 0 - 16 - - - - - 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 - 2 - 0 - 0 - 0 - 8 - 1 - 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 - 0x20000000 - 0x28000 - - - 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 - 0x20000000 - 0x28000 - - - 0 - 0x0 - 0x0 - - - - - - 1 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 5 - 3 - 0 - 0 - 0 - 1 - 0 - - - - - ..\inc;..\lib;..\..\CMSIS\Include;..\..\Device\Nuvoton\M480\Include - - - - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - 0 - 1 - 0 - 0x00000000 - 0x20000000 - - - - - - - - - - - - - src - - - nu_acmp.c - 1 - ..\src\nu_acmp.c - - - nu_bpwm.c - 1 - ..\src\nu_bpwm.c - - - nu_can.c - 1 - ..\src\nu_can.c - - - nu_ccap.c - 1 - ..\src\nu_ccap.c - - - nu_clk.c - 1 - ..\src\nu_clk.c - - - nu_crc.c - 1 - ..\src\nu_crc.c - - - nu_crypto.c - 1 - ..\src\nu_crypto.c - - - nu_dac.c - 1 - ..\src\nu_dac.c - - - nu_eadc.c - 1 - ..\src\nu_eadc.c - - - nu_ebi.c - 1 - ..\src\nu_ebi.c - - - nu_ecap.c - 1 - ..\src\nu_ecap.c - - - nu_emac.c - 1 - ..\src\nu_emac.c - - - nu_epwm.c - 1 - ..\src\nu_epwm.c - - - nu_fmc.c - 1 - ..\src\nu_fmc.c - - - nu_gpio.c - 1 - ..\src\nu_gpio.c - - - nu_hsusbd.c - 1 - ..\src\nu_hsusbd.c - - - nu_i2c.c - 1 - ..\src\nu_i2c.c - - - nu_i2s.c - 1 - ..\src\nu_i2s.c - - - nu_pdma.c - 1 - ..\src\nu_pdma.c - - - nu_qei.c - 1 - ..\src\nu_qei.c - - - nu_qspi.c - 1 - ..\src\nu_qspi.c - - - nu_rtc.c - 1 - ..\src\nu_rtc.c - - - nu_sc.c - 1 - ..\src\nu_sc.c - - - nu_scuart.c - 1 - ..\src\nu_scuart.c - - - nu_sdh.c - 1 - ..\src\nu_sdh.c - - - nu_spi.c - 1 - ..\src\nu_spi.c - - - nu_spim.c - 1 - ..\src\nu_spim.c - - - nu_sys.c - 1 - ..\src\nu_sys.c - - - nu_timer.c - 1 - ..\src\nu_timer.c - - - nu_timer_pwm.c - 1 - ..\src\nu_timer_pwm.c - - - nu_trng.c - 1 - ..\src\nu_trng.c - - - nu_uart.c - 1 - ..\src\nu_uart.c - - - nu_usbd.c - 1 - ..\src\nu_usbd.c - - - nu_usci_i2c.c - 1 - ..\src\nu_usci_i2c.c - - - nu_usci_spi.c - 1 - ..\src\nu_usci_spi.c - - - nu_usci_uart.c - 1 - ..\src\nu_usci_uart.c - - - nu_wdt.c - 1 - ..\src\nu_wdt.c - - - nu_wwdt.c - 1 - ..\src\nu_wwdt.c - - - - - - - - - - - - - -
diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver_4.uvproj b/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver_4.uvproj deleted file mode 100644 index 3f834f0d1b6..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/lib/libStdDriver_4.uvproj +++ /dev/null @@ -1,591 +0,0 @@ - - - - 1.1 - -
### uVision Project, (C) Keil Software
- - - - libStdDriver_4 - 0x4 - ARM-ADS - - - M487JIDAE - Nuvoton - IRAM(0x20000000-0x20027FFF) IROM(0-0x7FFFF) CLOCK(192000000) CPUTYPE("Cortex-M4") FPU2 - - undefined - - 0 - - - - - - - - - - - SFD\Nuvoton\M481_v1.SFR - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - .\build\keil4\ - libstddriver_keil4 - 0 - 1 - 1 - 1 - 1 - .\build\keil4\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - - - 1 - 0 - xcopy /y ".\build\keil4\@L.lib" "." - - 0 - 0 - - 0 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - - - SARMCM3.DLL - - DARMCM1.DLL - - SARMCM3.DLL - - TARMCM1.DLL - - - - - 1 - 0 - 0 - 0 - 16 - - - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - - - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - 1 - - 0 - 11 - - - - - - - - - - - - - - NULink\Nu_Link.dll - - - - - 1 - 0 - 0 - 1 - 1 - 4101 - - 0 - NULink\Nu_Link.dll - "" () - - - - - 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 - 0 - 0 - 8 - 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 - 0x20000000 - 0x28000 - - - 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 - 0x20000000 - 0x28000 - - - 0 - 0x0 - 0x0 - - - - - - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - --c99 - - - ..\lib;..\inc;..\..\CMSIS\Include;..\..\Device\Nuvoton\M480\Include - - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - 0 - 1 - 0 - 0x00000000 - 0x20000000 - .\linking_scripts\m480_flash.sct - - - - - - - - - - - src - - - nu_acmp.c - 1 - ..\src\nu_acmp.c - - - nu_bpwm.c - 1 - ..\src\nu_bpwm.c - - - nu_can.c - 1 - ..\src\nu_can.c - - - nu_ccap.c - 1 - ..\src\nu_ccap.c - - - nu_clk.c - 1 - ..\src\nu_clk.c - - - nu_crc.c - 1 - ..\src\nu_crc.c - - - nu_crypto.c - 1 - ..\src\nu_crypto.c - - - nu_dac.c - 1 - ..\src\nu_dac.c - - - nu_eadc.c - 1 - ..\src\nu_eadc.c - - - nu_ebi.c - 1 - ..\src\nu_ebi.c - - - nu_ecap.c - 1 - ..\src\nu_ecap.c - - - nu_emac.c - 1 - ..\src\nu_emac.c - - - nu_epwm.c - 1 - ..\src\nu_epwm.c - - - nu_fmc.c - 1 - ..\src\nu_fmc.c - - - nu_gpio.c - 1 - ..\src\nu_gpio.c - - - nu_hsusbd.c - 1 - ..\src\nu_hsusbd.c - - - nu_i2c.c - 1 - ..\src\nu_i2c.c - - - nu_i2s.c - 1 - ..\src\nu_i2s.c - - - nu_pdma.c - 1 - ..\src\nu_pdma.c - - - nu_qei.c - 1 - ..\src\nu_qei.c - - - nu_qspi.c - 1 - ..\src\nu_qspi.c - - - nu_rtc.c - 1 - ..\src\nu_rtc.c - - - nu_sc.c - 1 - ..\src\nu_sc.c - - - nu_scuart.c - 1 - ..\src\nu_scuart.c - - - nu_sdh.c - 1 - ..\src\nu_sdh.c - - - nu_spi.c - 1 - ..\src\nu_spi.c - - - nu_spim.c - 1 - ..\src\nu_spim.c - - - nu_sys.c - 1 - ..\src\nu_sys.c - - - nu_timer.c - 1 - ..\src\nu_timer.c - - - nu_timer_pwm.c - 1 - ..\src\nu_timer_pwm.c - - - nu_trng.c - 1 - ..\src\nu_trng.c - - - nu_uart.c - 1 - ..\src\nu_uart.c - - - nu_usbd.c - 1 - ..\src\nu_usbd.c - - - nu_usci_i2c.c - 1 - ..\src\nu_usci_i2c.c - - - nu_usci_spi.c - 1 - ..\src\nu_usci_spi.c - - - nu_usci_uart.c - 1 - ..\src\nu_usci_uart.c - - - nu_wdt.c - 1 - ..\src\nu_wdt.c - - - nu_wwdt.c - 1 - ..\src\nu_wwdt.c - - - - - - - -
diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/nutool_clkcfg.h b/bsp/nuvoton/libraries/m480/StdDriver/lib/nutool_clkcfg.h deleted file mode 100644 index 950b09946e2..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/lib/nutool_clkcfg.h +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************************** - * @file nutool_clkcfg.h - * @version V1.05 - * @Date 2020/04/15-11:28:38 - * @brief NuMicro generated code file - * - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2013-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NUTOOL_CLKCFG_H__ -#define __NUTOOL_CLKCFG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif -#undef __HXT -#define __HXT (12000000UL) /*!< High Speed External Crystal Clock Frequency */ - -#ifdef __cplusplus -} -#endif -#endif /*__NUTOOL_CLKCFG_H__*/ - -/*** (C) COPYRIGHT 2013-2020 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_acmp.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_acmp.c deleted file mode 100644 index 6e42fd7a61c..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_acmp.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************//** - * @file acmp.c - * @version V1.00 - * @brief M480 series Analog Comparator(ACMP) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ACMP_Driver ACMP Driver - @{ -*/ - - -/** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions - @{ -*/ - - -/** - * @brief Configure the specified ACMP module - * - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * @param[in] u32NegSrc Comparator negative input selection. Including: - * - \ref ACMP_CTL_NEGSEL_PIN - * - \ref ACMP_CTL_NEGSEL_CRV - * - \ref ACMP_CTL_NEGSEL_VBG - * - \ref ACMP_CTL_NEGSEL_DAC - * @param[in] u32HysSel The hysteresis function option. Including: - * - \ref ACMP_CTL_HYSTERESIS_30MV - * - \ref ACMP_CTL_HYSTERESIS_20MV - * - \ref ACMP_CTL_HYSTERESIS_10MV - * - \ref ACMP_CTL_HYSTERESIS_DISABLE - * - * @return None - * - * @details Configure hysteresis function, select the source of negative input and enable analog comparator. - */ -void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel) -{ - acmp->CTL[u32ChNum] = (acmp->CTL[u32ChNum] & (~(ACMP_CTL_NEGSEL_Msk | ACMP_CTL_HYSSEL_Msk))) | (u32NegSrc | u32HysSel | ACMP_CTL_ACMPEN_Msk); -} - -/** - * @brief Close analog comparator - * - * @param[in] acmp The pointer of the specified ACMP module - * @param[in] u32ChNum Comparator number. - * - * @return None - * - * @details This function will clear ACMPEN bit of ACMP_CTL register to disable analog comparator. - */ -void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum) -{ - acmp->CTL[u32ChNum] &= (~ACMP_CTL_ACMPEN_Msk); -} - - - -/*@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ACMP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_bpwm.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_bpwm.c deleted file mode 100644 index 4a6b08fbea6..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_bpwm.c +++ /dev/null @@ -1,745 +0,0 @@ -/**************************************************************************//** - * @file bpwm.c - * @version V1.00 - * @brief M480 series BPWM driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup BPWM_Driver BPWM Driver - @{ -*/ - - -/** @addtogroup BPWM_EXPORTED_FUNCTIONS BPWM Exported Functions - @{ -*/ - -/** - * @brief Configure BPWM capture and get the nearest unit time. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure BPWM capture and get the nearest unit time. - */ -uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32Src; - uint32_t u32PWMClockSrc; - uint32_t u32NearestUnitTimeNsec; - uint16_t u16Prescale = 1U, u16CNR = 0xFFFFU; - - if(bpwm == BPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk; - } - else /* (bpwm == BPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk; - } - - if(u32Src == 0U) - { - /* clock source is from PLL clock */ - u32PWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if(bpwm == BPWM0) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (bpwm == BPWM1) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - u32PWMClockSrc /= 1000UL; - for(u16Prescale = 1U; u16Prescale <= 0x1000U; u16Prescale++) - { - uint32_t u32Exit = 0U; - u32NearestUnitTimeNsec = (1000000UL * u16Prescale) / u32PWMClockSrc; - if(u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if (u16Prescale == 0x1000U) /* limit to the maximum unit time(nano second) */ - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - if (!(1000000UL * (u16Prescale + 1UL) > (u32NearestUnitTimeNsec * u32PWMClockSrc))) - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - } - else - { - u32Exit = 1U; - } - if (u32Exit == 1U) - { - break; - } - else {} - } - - /* convert to real register value */ - /* all channels share a prescaler */ - u16Prescale -= 1U; - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u16Prescale); - - /* set BPWM to down count type(edge aligned) */ - (bpwm)->CTL1 = (1UL); - - BPWM_SET_CNR(bpwm, u32ChannelNum, u16CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure BPWM generator and get the nearest frequency in edge aligned auto-reload mode - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since all channels shares a prescaler. Call this API to configure BPWM frequency may affect - * existing frequency of other channel. - */ -uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32Src; - uint32_t u32PWMClockSrc; - uint32_t i; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - if(bpwm == BPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk; - } - else /* (bpwm == BPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk; - } - - if(u32Src == 0U) - { - /* clock source is from PLL clock */ - u32PWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if(bpwm == BPWM0) - { - u32PWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (bpwm == BPWM1) */ - { - u32PWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - for(u32Prescale = 1U; u32Prescale < 0xFFFU; u32Prescale++) /* prescale could be 0~0xFFF */ - { - i = (u32PWMClockSrc / u32Frequency) / u32Prescale; - /* If target value is larger than CNR, need to use a larger prescaler */ - if(i < (0x10000U)) - { - u32CNR = i; - break; - } - } - /* Store return value here 'cos we're gonna change u16Prescale & u16CNR to the real value to fill into register */ - i = u32PWMClockSrc / (u32Prescale * u32CNR); - - /* convert to real register value */ - /* all channels share a prescaler */ - u32Prescale -= 1U; - BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescale); - /* set BPWM to down count type(edge aligned) */ - (bpwm)->CTL1 = (1UL); - - u32CNR -= 1U; - BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR); - if(u32DutyCycle) - { - BPWM_SET_CMR(bpwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1UL) / 100UL - 1UL); - (bpwm)->WGCTL0 &= ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum * 2U)); - (bpwm)->WGCTL0 |= (BPWM_OUTPUT_LOW << ((u32ChannelNum * (2U)) + (uint32_t)BPWM_WGCTL0_PRDPCTL0_Pos)); - (bpwm)->WGCTL1 &= ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum * 2U)); - (bpwm)->WGCTL1 |= (BPWM_OUTPUT_HIGH << (u32ChannelNum * (2U) + (uint32_t)BPWM_WGCTL1_CMPDCTL0_Pos)); - } - else - { - BPWM_SET_CMR(bpwm, u32ChannelNum, 0U); - (bpwm)->WGCTL0 &= ~((BPWM_WGCTL0_PRDPCTL0_Msk | BPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum * 2U)); - (bpwm)->WGCTL0 |= (BPWM_OUTPUT_LOW << (u32ChannelNum * 2U + (uint32_t)BPWM_WGCTL0_ZPCTL0_Pos)); - (bpwm)->WGCTL1 &= ~((BPWM_WGCTL1_CMPDCTL0_Msk | BPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum * 2U)); - (bpwm)->WGCTL1 |= (BPWM_OUTPUT_HIGH << (u32ChannelNum * 2U + (uint32_t)BPWM_WGCTL1_CMPDCTL0_Pos)); - } - - return(i); -} - -/** - * @brief Start BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to start BPWM module. - * @note All channels share one counter. - */ -void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CNTEN = BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Stop BPWM module - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM module. - * @note All channels share one period. - */ -void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->PERIOD = 0U; -} - -/** - * @brief Stop BPWM generation immediately by clear channel enable bit - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used. - * @return None - * @details This function is used to stop BPWM generation immediately by clear channel enable bit. - * @note All channels share one counter. - */ -void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CNTEN &= ~BPWM_CNTEN_CNTEN0_Msk; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_ZERO_OR_PERIOD_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_EVEN_CMP_DOWN_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_UP_COUNT_POINT - * - \ref BPWM_TRIGGER_ADC_ODD_CMP_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable selected channel to trigger ADC - */ -void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if(u32ChannelNum < 4U) - { - (bpwm)->EADCTS0 &= ~((BPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum * 8U)); - (bpwm)->EADCTS0 |= ((BPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum * 8U)); - } - else - { - (bpwm)->EADCTS1 &= ~((BPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4U) * 8U)); - (bpwm)->EADCTS1 |= ((BPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4U) * 8U)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~3 - * @return None - * @details This function is used to disable selected channel to trigger ADC - */ -void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - if(u32ChannelNum < 4U) - { - (bpwm)->EADCTS0 &= ~(BPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum * 8U)); - } - else - { - (bpwm)->EADCTS1 &= ~(BPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4U) * 8U)); - } -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag - */ -void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (bpwm)->STATUS = (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get BPWM trigger ADC to start of conversion flag for specified channel - */ -uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->STATUS & (BPWM_STATUS_EADCTRG0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s) - */ -void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN |= u32ChannelMask; - (bpwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s) - */ -void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->CAPINEN &= ~u32ChannelMask; - (bpwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enables BPWM output generation of selected channel(s) - */ -void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables BPWM output generation of selected channel(s) - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disables BPWM output generation of selected channel(s) - */ -void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask) -{ - (bpwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref BPWM_CAPTURE_INT_RISING_LATCH - * - \ref BPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (bpwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((((bpwm)->CAPIF & (BPWM_CAPIF_CAPFIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1) | \ - (((bpwm)->CAPIF & (BPWM_CAPIF_CAPRIF0_Msk << u32ChannelNum)) ? 1UL : 0UL)); -} -/** - * @brief Enable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref BPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (bpwm)->INTEN |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel - */ -void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - - (bpwm)->INTEN &= ~((uint32_t)(BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | BPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel - */ -void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = (BPWM_INTSTS_CMPUIF0_Msk | BPWM_INTSTS_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel - */ -uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return ((((bpwm)->INTSTS & ((BPWM_INTSTS_CMPDIF0_Msk | BPWM_INTSTS_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (bpwm)->INTEN |= BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable period interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN &= ~BPWM_INTEN_PIEN0_Msk; -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = BPWM_INTSTS_PIF0_Msk; -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->INTSTS & BPWM_INTSTS_PIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to enable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN |= BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to disable zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTEN &= ~BPWM_INTEN_ZIEN0_Msk; -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->INTSTS = BPWM_INTSTS_ZIF0_Msk; -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return zero interrupt flag of specified channel - * @retval 0 zero interrupt did not occur - * @retval 1 zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->INTSTS & BPWM_INTSTS_ZIF0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode BPWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode PWM counter loading mode. - * - \ref BPWM_LOAD_MODE_IMMEDIATE - * - \ref BPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (bpwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Set BPWM clock source - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @param[in] u32ClkSrcSel BPWM external clock source. - * - \ref BPWM_CLKSRC_BPWM_CLK - * - \ref BPWM_CLKSRC_TIMER0 - * - \ref BPWM_CLKSRC_TIMER1 - * - \ref BPWM_CLKSRC_TIMER2 - * - \ref BPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set BPWM clock source. - * @note All channels share channel 0's setting. - */ -void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (bpwm)->CLKSRC = (u32ClkSrcSel); -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - return (((bpwm)->STATUS & BPWM_STATUS_CNTMAX0_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] bpwm The pointer of the specified BPWM module - * - BPWM0 : BPWM Group 0 - * - BPWM1 : BPWM Group 1 - * @param[in] u32ChannelNum BPWM channel number. This parameter is not used. - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - * @note All channels share channel 0's setting. - */ -void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum) -{ - (bpwm)->STATUS = BPWM_STATUS_CNTMAX0_Msk; -} - - -/*@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group BPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_can.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_can.c deleted file mode 100644 index 081fe440568..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_can.c +++ /dev/null @@ -1,1292 +0,0 @@ -/**************************************************************************//** - * @file can.c - * @version V2.00 - * @brief M480 series CAN driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CAN_Driver CAN Driver - @{ -*/ - -/** @addtogroup CAN_EXPORTED_FUNCTIONS CAN Exported Functions - @{ -*/ - -/** @cond HIDDEN_SYMBOLS */ - -#if defined(CAN2) -static uint8_t gu8LockCanIf[3ul][2ul] = {0ul}; /* The chip has three CANs. */ -#elif defined(CAN1) -static uint8_t gu8LockCanIf[2ul][2ul] = {0ul}; /* The chip has two CANs. */ -#elif defined(CAN0) || defined(CAN) -static uint8_t gu8LockCanIf[1ul][2ul] = {0ul}; /* The chip only has one CAN. */ -#endif - -#define RETRY_COUNTS (0x10000000ul) - -#define TSEG1_MIN 2ul -#define TSEG1_MAX 16ul -#define TSEG2_MIN 1ul -#define TSEG2_MAX 8ul -#define BRP_MIN 1ul -#define BRP_MAX 1024ul /* 6-bit BRP field + 4-bit BRPE field*/ -#define SJW_MAX 4ul -#define BRP_INC 1ul - -/* #define DEBUG_PRINTF printf */ -#define DEBUG_PRINTF(...) - -static uint32_t LockIF(CAN_T *tCAN); -static uint32_t LockIF_TL(CAN_T *tCAN); -static void ReleaseIF(CAN_T *tCAN, uint32_t u32IfNo); -static int can_update_spt(int sampl_pt, int tseg, int *tseg1, int *tseg2); - -/** - * @brief Check if any interface is available then lock it for usage. - * @param[in] tCAN The pointer to CAN module base address. - * @retval 0 IF0 is free - * @retval 1 IF1 is free - * @retval 2 No IF is free - * @details Search the first free message interface, starting from 0. If a interface is - * available, set a flag to lock the interface. - */ -static uint32_t LockIF(CAN_T *tCAN) -{ - uint32_t u32CanNo = 0ul; - uint32_t u32FreeIfNo; - uint32_t u32IntMask; - -#if defined(CAN1) - if (tCAN == CAN0) - u32CanNo = 0ul; - else if (tCAN == CAN1) - u32CanNo = 1ul; -#if defined(CAN2) - else if (tCAN == CAN2) - u32CanNo = 2ul; -#endif -#else /* defined(CAN0) || defined(CAN) */ - u32CanNo = 0ul; -#endif - - u32FreeIfNo = 2ul; - - /* Disable CAN interrupt */ - u32IntMask = tCAN->CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - /* Check interface 1 is available or not */ - if ((tCAN->IF[0ul].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - if (gu8LockCanIf[u32CanNo][0ul] == 0ul) - { - gu8LockCanIf[u32CanNo][0ul] = 1u; - u32FreeIfNo = 0ul; - } - else - { - } - } - else - { - } - - /* Or check interface 2 is available or not */ - if (u32FreeIfNo == 2ul) - { - if ((tCAN->IF[1ul].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - if (gu8LockCanIf[u32CanNo][1ul] == 0ul) - { - gu8LockCanIf[u32CanNo][1ul] = 1u; - u32FreeIfNo = 1ul; - } - else - { - } - } - else - { - } - } - else - { - } - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - - return u32FreeIfNo; -} - -/** - * @brief Check if any interface is available in a time limitation then lock it for usage. - * @param[in] tCAN The pointer to CAN module base address. - * @retval 0 IF0 is free - * @retval 1 IF1 is free - * @retval 2 No IF is free - * @details Search the first free message interface, starting from 0. If no interface is - * it will try again until time out. If a interface is available, set a flag to - * lock the interface. - */ -static uint32_t LockIF_TL(CAN_T *tCAN) -{ - uint32_t u32Count; - uint32_t u32FreeIfNo; - - for (u32Count = 0ul; u32Count < RETRY_COUNTS; u32Count++) - { - if ((u32FreeIfNo = LockIF(tCAN)) != 2ul) - { - break; - } - else - { - } - } - - return u32FreeIfNo; -} - -/** - * @brief Release locked interface. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Info The interface number, 0 or 1. - * @return none - * @details Release the locked interface. - */ -static void ReleaseIF(CAN_T *tCAN, uint32_t u32IfNo) -{ - uint32_t u32IntMask; - uint32_t u32CanNo = 0ul; - - if (u32IfNo >= 2ul) - { - } - else - { -#if defined(CAN1) - if (tCAN == CAN0) - u32CanNo = 0ul; - else if (tCAN == CAN1) - u32CanNo = 1ul; -#if defined(CAN2) - else if (tCAN == CAN2) - u32CanNo = 2ul; -#endif -#else /* defined(CAN0) || defined(CAN) */ - u32CanNo = 0ul; -#endif - - /* Disable CAN interrupt */ - u32IntMask = tCAN->CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - gu8LockCanIf[u32CanNo][u32IfNo] = 0u; - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - } -} - -static int can_update_spt(int sampl_pt, int tseg, int *tseg1, int *tseg2) -{ - *tseg2 = tseg + 1 - (sampl_pt * (tseg + 1)) / 1000; - if (*tseg2 < TSEG2_MIN) - { - *tseg2 = TSEG2_MIN; - } - else - { - } - - if (*tseg2 > TSEG2_MAX) - { - *tseg2 = TSEG2_MAX; - } - else - { - } - - *tseg1 = tseg - *tseg2; - if (*tseg1 > TSEG1_MAX) - { - *tseg1 = TSEG1_MAX; - *tseg2 = tseg - *tseg1; - } - else - { - } - - return 1000 * (tseg + 1 - *tseg2) / (tseg + 1); -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Enter initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8Mask Following values can be used. - * \ref CAN_CON_DAR_Msk Disable automatic retransmission. - * \ref CAN_CON_EIE_Msk Enable error interrupt. - * \ref CAN_CON_SIE_Msk Enable status interrupt. - * \ref CAN_CON_IE_Msk CAN interrupt. - * @return None - * @details This function is used to set CAN to enter initialization mode and enable access bit timing - * register. After bit timing configuration ready, user must call CAN_LeaveInitMode() - * to leave initialization mode and lock bit timing register to let new configuration - * take effect. - */ -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask) -{ - tCAN->CON = u8Mask | (CAN_CON_INIT_Msk | CAN_CON_CCE_Msk); -} - - -/** - * @brief Leave initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to set CAN to leave initialization mode to let - * bit timing configuration take effect after configuration ready. - */ -void CAN_LeaveInitMode(CAN_T *tCAN) -{ - tCAN->CON &= (~(CAN_CON_INIT_Msk | CAN_CON_CCE_Msk)); - while (tCAN->CON & CAN_CON_INIT_Msk) - { - /* Check INIT bit is released */ - } -} - -/** - * @brief Wait message into message buffer in basic mode. - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to wait message into message buffer in basic mode. Please notice the - * function is polling NEWDAT bit of MCON register by while loop and it is used in basic mode. - */ -void CAN_WaitMsg(CAN_T *tCAN) -{ - tCAN->STATUS = 0x0ul; /* clr status */ - - while (1) - { - if (tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) /* check new data */ - { - /* New Data IN */ - break; - } - else - { - } - - if (tCAN->STATUS & CAN_STATUS_RXOK_Msk) - { - /* Rx OK */ - } - else - { - } - - if (tCAN->STATUS & CAN_STATUS_LEC_Msk) - { - /* Error */ - } - else - { - } - } -} - -/** - * @brief Get current bit rate - * @param[in] tCAN The pointer to CAN module base address. - * @return Current Bit-Rate (kilo bit per second) - * @details Return current CAN bit rate according to the user bit-timing parameter settings - */ -uint32_t CAN_GetCANBitRate(CAN_T *tCAN) -{ - uint32_t u32Tseg1, u32Tseg2; - uint32_t u32Bpr; - - u32Tseg1 = (tCAN->BTIME & CAN_BTIME_TSEG1_Msk) >> CAN_BTIME_TSEG1_Pos; - u32Tseg2 = (tCAN->BTIME & CAN_BTIME_TSEG2_Msk) >> CAN_BTIME_TSEG2_Pos; - u32Bpr = (tCAN->BTIME & CAN_BTIME_BRP_Msk) | (tCAN->BRPE << 6ul); - - return (SystemCoreClock / (u32Bpr + 1ul) / (u32Tseg1 + u32Tseg2 + 3ul)); -} - -/** - * @brief Switch the CAN into test mode. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8TestMask Specifies the configuration in test modes - * \ref CAN_TEST_BASIC_Msk Enable basic mode of test mode - * \ref CAN_TEST_SILENT_Msk Enable silent mode of test mode - * \ref CAN_TEST_LBACK_Msk Enable Loop Back Mode of test mode - * \ref CAN_TEST_Tx_Msk Control CAN_TX pin bit field - * @return None - * @details Switch the CAN into test mode. There are four test mode (BASIC/SILENT/LOOPBACK/ - * LOOPBACK combined SILENT/CONTROL_TX_PIN)could be selected. After setting test mode,user - * must call CAN_LeaveInitMode() to let the setting take effect. - */ -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST = u8TestMask; -} - - -/** - * @brief Leave the test mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to Leave the test mode (switch into normal mode). - */ -void CAN_LeaveTestMode(CAN_T *tCAN) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST &= ~(CAN_TEST_LBACK_Msk | CAN_TEST_SILENT_Msk | CAN_TEST_BASIC_Msk); - tCAN->CON &= (~CAN_CON_TEST_Msk); -} - -/** - * @brief Get the waiting status of a received message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @retval non-zero The corresponding message object has a new data bit is set. - * @retval 0 No message object has new data. - * @details This function is used to get the waiting status of a received message. - */ -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj) -{ - return (u8MsgObj < 16ul ? tCAN->NDAT1 & (1ul << u8MsgObj) : tCAN->NDAT2 & (1ul << (u8MsgObj - 16ul))); -} - - -/** - * @brief Send CAN message in BASIC mode of test mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure containing data to transmit. - * @return TRUE: Transmission OK - * FALSE: Check busy flag of interface 0 is timeout - * @details The function is used to send CAN message in BASIC mode of test mode. Before call the API, - * the user should be call CAN_EnterTestMode(CAN_TEST_BASIC) and let CAN controller enter - * basic mode of test mode. Please notice IF1 Registers used as Tx Buffer in basic mode. - */ -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg) -{ - uint32_t i = 0ul; - int32_t rev = 1l; - - while (tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - } - - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - if (pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[0].ARB1 = 0ul; - tCAN->IF[0].ARB2 = (((pCanMsg->Id) & 0x7FFul) << 2ul) ; - } - else - { - /* extended ID*/ - tCAN->IF[0].ARB1 = (pCanMsg->Id) & 0xFFFFul; - tCAN->IF[0].ARB2 = ((pCanMsg->Id) & 0x1FFF0000ul) >> 16ul | CAN_IF_ARB2_XTD_Msk; - - } - - if (pCanMsg->FrameType) - { - tCAN->IF[0].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[0].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - tCAN->IF[0].MCON = (tCAN->IF[0].MCON & (~CAN_IF_MCON_DLC_Msk)) | pCanMsg->DLC; - tCAN->IF[0].DAT_A1 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[1] << 8) | pCanMsg->Data[0]); - tCAN->IF[0].DAT_A2 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[3] << 8) | pCanMsg->Data[2]); - tCAN->IF[0].DAT_B1 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[5] << 8) | pCanMsg->Data[4]); - tCAN->IF[0].DAT_B2 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[7] << 8) | pCanMsg->Data[6]); - - /* request transmission*/ - tCAN->IF[0].CREQ &= (~CAN_IF_CREQ_BUSY_Msk); - if (tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /* Cannot clear busy for sending ...*/ - rev = 0l; /* return FALSE */ - } - else - { - tCAN->IF[0].CREQ |= CAN_IF_CREQ_BUSY_Msk; /* sending */ - - for (i = 0ul; i < 0xFFFFFul; i++) - { - if ((tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - break; - } - else - { - } - } - - if (i >= 0xFFFFFul) - { - /* Cannot send out... */ - rev = 0l; /* return FALSE */ - } - else - { - } - } - - return rev; -} - -/** - * @brief Get a message information in BASIC mode. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @return FALSE No any message received. - * TRUE Receive a message success. - * - */ -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - - if ((tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) == 0ul) - { - /* In basic mode, receive data always save in IF2 */ - rev = 0; /* return FALSE */ - } - else - { - - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - tCAN->IF[1].CMASK = CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - if ((tCAN->IF[1].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0ul) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 >> 2) & 0x07FFul; - - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 & 0x1FFFul) << 16; - pCanMsg->Id |= (uint32_t)tCAN->IF[1].ARB1; - } - - pCanMsg->FrameType = (((tCAN->IF[1].ARB2 & CAN_IF_ARB2_DIR_Msk) >> CAN_IF_ARB2_DIR_Pos)) ? 0ul : 1ul; - - pCanMsg->DLC = (uint8_t)(tCAN->IF[1].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - } - - return rev; -} - -/** - * @brief Set Rx message object, include ID mask. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u32idmask Specifies the identifier mask used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* Command Setting */ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFul) << 2; - } - else - { - tCAN->IF[u32MsgIfNum].ARB1 = u32id & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000ul) >> 16; - } - - tCAN->IF[u32MsgIfNum].MASK1 = (u32idmask & 0xFFFFul); - tCAN->IF[u32MsgIfNum].MASK2 = (u32idmask >> 16) & 0xFFFFul; - - /* tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; */ - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if (u8singleOrFifoLast) - { - tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_A2 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B2 = 0ul; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Set Rx message object - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* Command Setting */ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFul) << 2; - } - else - { - tCAN->IF[u32MsgIfNum].ARB1 = u32id & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000ul) >> 16; - } - - /* tCAN->IF[u8MsgIfNum].MCON |= CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; */ - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if (u8singleOrFifoLast) - { - tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_A2 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B2 = 0ul; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Gets the message - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8Release Specifies the message release indicator. - * This parameter can be one of the following values: - * TRUE: the message object is released when getting the data. - * FALSE:the message object is not released. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * @retval TRUE Success - * @retval FALSE No any message received - * @details Gets the message, if received. - */ -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if (!CAN_IsNewDataReceived(tCAN, u8MsgObj)) - { - rev = 0; /* return FALSE */ - } - else - { - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_MASK_Msk - | CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_CLRINTPND_Msk - | (u8Release ? CAN_IF_CMASK_TXRQSTNEWDAT_Msk : 0ul) - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - - while (tCAN->IF[u32MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - - if ((tCAN->IF[u32MsgIfNum].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0ul) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[u32MsgIfNum].ARB2 & CAN_IF_ARB2_ID_Msk) >> 2ul; - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = (((tCAN->IF[u32MsgIfNum].ARB2) & 0x1FFFul) << 16) | tCAN->IF[u32MsgIfNum].ARB1; - } - - pCanMsg->DLC = (uint8_t)(tCAN->IF[u32MsgIfNum].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - - ReleaseIF(tCAN, u32MsgIfNum); - } - } - - return rev; -} - - -/** - * @brief Set bus baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * - * @return u32CurrentBitRate Real baud-rate value. - * - * @details The function is used to set bus timing parameter according current clock and target baud-rate. - */ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate) -{ - long rate; - long best_error = 1000000000, error = 0; - int best_tseg = 0, best_brp = 0, brp = 0; - int tsegall, tseg = 0, tseg1 = 0, tseg2 = 0; - int spt_error = 1000, spt = 0, sampl_pt; - uint64_t clock_freq = (uint64_t)0, u64PCLK_DIV = (uint64_t)1; - uint32_t sjw = (uint32_t)1; - - CAN_EnterInitMode(tCAN, (uint8_t)0); - - SystemCoreClockUpdate(); - if ((tCAN == CAN0) || (tCAN == CAN2)) - { - u64PCLK_DIV = (uint64_t)(CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk); - u64PCLK_DIV = (uint64_t)(1 << u64PCLK_DIV); - } - else if (tCAN == CAN1) - { - u64PCLK_DIV = (uint64_t)((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) >> CLK_PCLKDIV_APB1DIV_Pos); - u64PCLK_DIV = (uint64_t)(1 << u64PCLK_DIV); - } - - clock_freq = SystemCoreClock / u64PCLK_DIV; - - if (u32BaudRate >= (uint32_t)1000000) - { - u32BaudRate = (uint32_t)1000000; - } - - /* Use CIA recommended sample points */ - if (u32BaudRate > (uint32_t)800000) - { - sampl_pt = (int)750; - } - else if (u32BaudRate > (uint32_t)500000) - { - sampl_pt = (int)800; - } - else - { - sampl_pt = (int)875; - } - - /* tseg even = round down, odd = round up */ - for (tseg = (TSEG1_MAX + TSEG2_MAX) * 2ul + 1ul; tseg >= (TSEG1_MIN + TSEG2_MIN) * 2ul; tseg--) - { - tsegall = 1ul + tseg / 2ul; - /* Compute all possible tseg choices (tseg=tseg1+tseg2) */ - brp = clock_freq / (tsegall * u32BaudRate) + tseg % 2; - /* chose brp step which is possible in system */ - brp = (brp / BRP_INC) * BRP_INC; - - if ((brp < BRP_MIN) || (brp > BRP_MAX)) - { - continue; - } - rate = clock_freq / (brp * tsegall); - - error = u32BaudRate - rate; - - /* tseg brp biterror */ - if (error < 0) - { - error = -error; - } - if (error > best_error) - { - continue; - } - best_error = error; - if (error == 0) - { - spt = can_update_spt(sampl_pt, tseg / 2, &tseg1, &tseg2); - error = sampl_pt - spt; - if (error < 0) - { - error = -error; - } - if (error > spt_error) - { - continue; - } - spt_error = error; - } - best_tseg = tseg / 2; - best_brp = brp; - - if (error == 0) - { - break; - } - } - - spt = can_update_spt(sampl_pt, best_tseg, &tseg1, &tseg2); - - /* check for sjw user settings */ - /* bt->sjw is at least 1 -> sanitize upper bound to sjw_max */ - if (sjw > SJW_MAX) - { - sjw = SJW_MAX; - } - /* bt->sjw must not be higher than tseg2 */ - if (tseg2 < sjw) - { - sjw = tseg2; - } - - /* real bit-rate */ - u32BaudRate = clock_freq / (best_brp * (tseg1 + tseg2 + 1)); - - tCAN->BTIME = ((uint32_t)(tseg2 - 1ul) << CAN_BTIME_TSEG2_Pos) | ((uint32_t)(tseg1 - 1ul) << CAN_BTIME_TSEG1_Pos) | - ((uint32_t)(best_brp - 1ul) & CAN_BTIME_BRP_Msk) | (sjw << CAN_BTIME_SJW_Pos); - tCAN->BRPE = ((uint32_t)(best_brp - 1ul) >> 6) & 0x0Ful; - - /* printf("\n bitrate = %d \n", CAN_GetCANBitRate(tCAN)); */ - - CAN_LeaveInitMode(tCAN); - - return u32BaudRate; -} - -/** - * @brief The function is used to disable all CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * - * @return None - * - * @details No Status Change Interrupt and Error Status Interrupt will be generated. - */ -void CAN_Close(CAN_T *tCAN) -{ - CAN_DisableInt(tCAN, (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - -/** - * @brief Set CAN operation mode and target baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * @param[in] u32Mode The CAN operation mode. Valid values are: - * - \ref CAN_NORMAL_MODE Normal operation. - * - \ref CAN_BASIC_MODE Basic mode. - * @return u32CurrentBitRate Real baud-rate value. - * - * @details Set bus timing parameter according current clock and target baud-rate. - * In Basic mode, IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer. - */ -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode) -{ - uint32_t u32CurrentBitRate; - - u32CurrentBitRate = CAN_SetBaudRate(tCAN, u32BaudRate); - - if (u32Mode == CAN_BASIC_MODE) - { - CAN_EnterTestMode(tCAN, (uint8_t)CAN_TEST_BASIC_Msk); - } - else - { - } - - return u32CurrentBitRate; -} - -/** - * @brief The function is used to configure a transmit object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No useful interface. - * @retval TRUE Config message object success. - * - * @details The two sets of interface registers (IF1 and IF2) control the software access to the Message RAM. - * They buffer the data to be transferred to and from the RAM, avoiding conflicts between software accesses and message reception/transmission. - */ -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* update the contents needed for transmission*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = (((pCanMsg->Id) & 0x7FFul) << 2) | CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - else - { - /* extended ID*/ - tCAN->IF[u32MsgIfNum].ARB1 = (pCanMsg->Id) & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = ((pCanMsg->Id) & 0x1FFF0000ul) >> 16 | - CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_XTD_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - - if (pCanMsg->FrameType) - { - tCAN->IF[u32MsgIfNum].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[1] << 8)) | pCanMsg->Data[0]); - tCAN->IF[u32MsgIfNum].DAT_A2 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[3] << 8)) | pCanMsg->Data[2]); - tCAN->IF[u32MsgIfNum].DAT_B1 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[5] << 8)) | pCanMsg->Data[4]); - tCAN->IF[u32MsgIfNum].DAT_B2 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[7] << 8)) | pCanMsg->Data[6]); - - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_NEWDAT_Msk | pCanMsg->DLC | CAN_IF_MCON_TXIE_Msk | CAN_IF_MCON_EOB_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Set transmit request bit. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return TRUE: Start transmit message. - * - * @details If a transmission is requested by programming bit TxRqst/NewDat (IFn_CMASK[2]), the TxRqst (IFn_MCON[8]) will be ignored. - */ -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk - | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - while (tCAN->IF[u32MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Enable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. Valid values are: - * - \ref CAN_CON_IE_Msk Module interrupt enable. - * - \ref CAN_CON_SIE_Msk Status change interrupt enable. - * - \ref CAN_CON_EIE_Msk Error interrupt enable. - * - * @return None - * - * @details The application software has two possibilities to follow the source of a message interrupt. - * First, it can follow the IntId in the Interrupt Register and second it can poll the Interrupt Pending Register. - */ -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = (tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)) | - (u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - -/** - * @brief Disable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. (CAN_CON_IE_Msk / CAN_CON_SIE_Msk / CAN_CON_EIE_Msk). - * - * @return None - * - * @details The interrupt remains active until the Interrupt Register is back to value zero (the cause of the interrupt is reset) or until IE is reset. - */ -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = tCAN->CON & ~((u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk))); -} - - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32TimeOutCount = 0ul; - - while (CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)TRUE) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)(FALSE); /* return FALSE */ - break; - } - else - { - } - } - - return rev; -} - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * @param[in] u32IDMask Specifies the identifier mask used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32TimeOutCount = 0ul; - - while (CAN_SetRxMsgObjAndMsk(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, u32IDMask, (uint8_t)TRUE) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)FALSE; - break; - } - else - { - } - } - - return rev; -} - -/** - * @brief The function is used to configure several receive message objects. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum The starting MSG RAM number(0 ~ 31). - * @param[in] u32MsgCount the number of MSG RAM of the FIFO. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure receive message objects success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID) -{ - int32_t rev = (int32_t)TRUE; - uint32_t i; - uint32_t u32TimeOutCount; - uint32_t u32EOB_Flag = 0ul; - - for (i = 1ul; i <= u32MsgCount; i++) - { - u32TimeOutCount = 0ul; - - u32MsgNum += (i - 1ul); - - if (i == u32MsgCount) - { - u32EOB_Flag = 1ul; - } - else - { - } - - while (CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)u32EOB_Flag) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)FALSE; - break; - } - else - { - } - } - } - - return rev; -} - - -/** - * @brief Send CAN message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE 1. When operation in basic mode: Transmit message time out. \n - * 2. When operation in normal mode: No useful interface. \n - * @retval TRUE Transmit Message success. - * - * @details The receive/transmit priority for the Message Objects is attached to the message number. - * Message Object 1 has the highest priority, while Message Object 32 has the lowest priority. - */ -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32Tmp; - - u32Tmp = (tCAN->TEST & CAN_TEST_BASIC_Msk); - - if ((tCAN->CON & CAN_CON_TEST_Msk) && u32Tmp) - { - rev = CAN_BasicSendMsg(tCAN, pCanMsg); - } - else - { - if (CAN_SetTxMsg(tCAN, u32MsgNum, pCanMsg) == FALSE) - { - rev = (int32_t)FALSE; - } - else - { - CAN_TriggerTxMsg(tCAN, u32MsgNum); - } - } - - return rev; -} - - -/** - * @brief Gets the message, if received. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No any message received. - * @retval TRUE Receive Message success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32Tmp; - - u32Tmp = (tCAN->TEST & CAN_TEST_BASIC_Msk); - - if ((tCAN->CON & CAN_CON_TEST_Msk) && u32Tmp) - { - rev = CAN_BasicReceiveMsg(tCAN, pCanMsg); - } - else - { - rev = CAN_ReadMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)TRUE, pCanMsg); - } - - return rev; -} - -/** - * @brief Clear interrupt pending bit. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return None - * - * @details An interrupt remains pending until the application software has cleared it. - */ -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum) -{ - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - u32MsgIfNum = 0ul; - } - else - { - } - - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); -} - - -/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CAN_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ccap.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ccap.c deleted file mode 100644 index 5da53eb79b5..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ccap.c +++ /dev/null @@ -1,296 +0,0 @@ -/**************************************************************************//** - * @file ccap.c - * @version V1.00 - * @brief M480 Series CCAP Driver Source File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CCAP_Driver CCAP Driver - @{ -*/ - - -/** @addtogroup CCAP_EXPORTED_FUNCTIONS CCAP Exported Functions - @{ -*/ - -/** - * @brief Open engine clock and sensor clock - * - * @param[in] u32InFormat The bits corresponding VSP, HSP, PCLK, INFMT, SNRTYPE, OUTFMT, PDORD and PNFMT configurations. - * - VSP should be ether \ref CCAP_PAR_VSP_LOW or \ref CCAP_PAR_VSP_HIGH - * - HSP should be ether \ref CCAP_PAR_HSP_LOW or \ref CCAP_PAR_HSP_HIGH - * - PCLK should be ether \ref CCAP_PAR_PCLKP_LOW or \ref CCAP_PAR_PCLKP_HIGH - * - INFMT should be ether \ref CCAP_PAR_INFMT_YUV422 or \ref CCAP_PAR_INFMT_RGB565 - * - SNRTYPE should be ether \ref CCAP_PAR_SENTYPE_CCIR601 or \ref CCAP_PAR_SENTYPE_CCIR656 - * - OUTFMT should be one of the following setting - * - \ref CCAP_PAR_OUTFMT_YUV422 - * - \ref CCAP_PAR_OUTFMT_ONLY_Y - * - \ref CCAP_PAR_OUTFMT_RGB555 - * - \ref CCAP_PAR_OUTFMT_RGB565 - * - PDORD should be one of the following setting - * - \ref CCAP_PAR_INDATORD_YUYV - * - \ref CCAP_PAR_INDATORD_YVYU - * - \ref CCAP_PAR_INDATORD_UYVY - * - \ref CCAP_PAR_INDATORD_VYUY - * - \ref CCAP_PAR_INDATORD_RGGB - * - \ref CCAP_PAR_INDATORD_BGGR - * - \ref CCAP_PAR_INDATORD_GBRG - * - \ref CCAP_PAR_INDATORD_GRBG - * - PNFMT should be one of the following setting - * - \ref CCAP_PAR_PLNFMT_YUV422 - * - \ref CCAP_PAR_PLNFMT_YUV420 - * - * @param[in] u32OutFormet Capture output format, should be one of following setting - * - \ref CCAP_CTL_PKTEN - * - * @return None - * - * @details Initialize the Image Capture Interface. Register a call back for driver internal using - */ -void CCAP_Open(uint32_t u32InFormat, uint32_t u32OutFormet) -{ - CCAP->PAR = (CCAP->PAR & ~(0x000007BFUL)) | u32InFormat; - CCAP->CTL = (CCAP->CTL & ~(0x00000040UL)) | u32OutFormet; -} - -/** - * @brief Set Cropping Window Starting Address and Size - * - * @param[in] u32VStart: Cropping Window Vertical Starting Address. It should be 0 ~ 0x7FF. - * - * @param[in] u32HStart: Cropping Window Horizontal Starting Address. It should be 0 ~ 0x7FF. - * - * @param[in] u32Height: Cropping Window Height . It should be 0 ~ 0x7FF. - * - * @param[in] u32Width: Cropping Window Width. It should be 0 ~ 0x7FF. - * - * @return None - * - * @details Set Cropping Window Starting Address Register - */ -void CCAP_SetCroppingWindow(uint32_t u32VStart,uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width) -{ - CCAP->CWSP = (CCAP->CWSP & ~(CCAP_CWSP_CWSADDRV_Msk | CCAP_CWSP_CWSADDRH_Msk)) - | (((u32VStart << 16) | u32HStart)); - - CCAP->CWS = (CCAP->CWS & ~(CCAP_CWS_CWH_Msk | CCAP_CWS_CWW_Msk)) - | ((u32Height << 16)| u32Width); -} - - -/** - * @brief Set System Memory Packet Base Address0 Register - * - * @param[in] u32Address : set PKTBA0 register, It should be 0x0 ~ 0xFFFFFFFF - * - * @return None - * - * @details Set System Memory Packet Base Address Register - */ -void CCAP_SetPacketBuf(uint32_t u32Address ) -{ - CCAP->PKTBA0 = u32Address; - CCAP->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Close Camera Capture Interface - * - * @return None - */ -void CCAP_Close(void) -{ - CCAP->CTL &= ~CCAP_CTL_CCAPEN; -} - - -/** - * @brief Set CCAP Interrupt - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CCAP_INT_VIEN_Msk - * - \ref CCAP_INT_MEIEN_Msk - * - \ref CCAP_INT_ADDRMIEN_Msk - * @return None - * - * @details Set Video Frame End Interrupt Enable, - * System Memory Error Interrupt Enable, - * Address Match Interrupt Enable, - * Motion Detection Output Finish Interrupt Enable. - */ -void CCAP_EnableInt(uint32_t u32IntMask) -{ - CCAP->INT = (CCAP->INT & ~(CCAP_INT_VIEN_Msk | CCAP_INT_MEIEN_Msk | CCAP_INT_ADDRMIEN_Msk ) ) - | u32IntMask; -} - -/** - * @brief Disable CCAP Interrupt - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CCAP_INT_VINTF_Msk - * - \ref CCAP_INT_MEINTF_Msk - * - \ref CCAP_INT_ADDRMINTF_Msk - - * @return None - * - * @details Disable Video Frame End Interrupt , - * System Memory Error Interrupt , - * Address Match Interrupt and - * Motion Detection Output Finish Interrupt . - */ -void CCAP_DisableInt(uint32_t u32IntMask) -{ - CCAP->INT = (CCAP->INT & ~(u32IntMask) ) ; -} - - -/** - * @brief Enable Monochrome CMOS Sensor - * - * @param[in] u32Interface I/O interface settings. It could be - * - \ref CCAP_CTL_MY8_MY4 - * - \ref CCAP_CTL_MY8_MY8 - * @return None - * - */ -void CCAP_EnableMono(uint32_t u32Interface) -{ - CCAP->CTL = (CCAP->CTL & ~CCAP_CTL_MY8_MY4) | CCAP_CTL_MONO_Msk |u32Interface; -} - -/** - * @brief Disable Monochrome CMOS Sensor - * - * @return None - * - */ -void CCAP_DisableMono(void) -{ - CCAP->CTL |= CCAP_CTL_MONO_Msk; -} - -/** - * @brief Enable Luminance 8-bit Y to 1-bit Y Conversion - * - * @param[in] u32th Luminance Y8 to Y1 Threshold Value, It should be 0 ~ 255. - * - * @return None - * - */ -void CCAP_EnableLumaYOne(uint32_t u32th) -{ - CCAP->CTL |= CCAP_CTL_Luma_Y_One_Msk; - CCAP->LUMA_Y1_THD = u32th & 0xff; -} - -/** - * @brief Disable Luminance 8-bit Y to 1-bit Y Conversion - * - * @return None - * - */ -void CCAP_DisableLumaYOne(void) -{ - CCAP->CTL &= ~CCAP_CTL_Luma_Y_One_Msk; -} - -/** - * @brief Start Camera Capture Interface - * - * @return None - */ -void CCAP_Start(void) -{ - CCAP->CTL |= CCAP_CTL_CCAPEN; -} - -/** - * @brief Stop Camera Capture Interface - * - * @param[in] u32FrameComplete : - * TRUE: Capture module automatically disable the CCAP module after a frame had been captured - * FALSE: Stop Capture module now - * @return None - * - * @details if u32FrameComplete is set to TRUE then get a new frame and disable CCAP module - */ -void CCAP_Stop(uint32_t u32FrameComplete) -{ - if(u32FrameComplete==FALSE) - CCAP->CTL &= ~CCAP_CTL_CCAPEN; - else - { - CCAP->CTL |= CCAP_CTL_SHUTTER_Msk; - while(CCAP_IS_STOPPED()); - } -} - -/** - * @brief Set Packet Scaling Vertical and Horizontal Factor Register - * - * @param[in] u32VNumerator: Packet Scaling Vertical Factor N. It should be 0 ~ FFFF. - * - * @param[in] u32VDenominator: Packet Scaling Vertical Factor M. It should be 0 ~ FFFF. - * - * @param[in] u32HNumerator: Packet Scaling Vertical Factor N. It should be 0 ~ FFFF. - * - * @param[in] u32HDenominator: Packet Scaling Vertical Factor M. It should be 0 ~ FFFF. - * - * @return None - * - */ -void CCAP_SetPacketScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator) -{ - uint32_t u32NumeratorL, u32NumeratorH; - uint32_t u32DenominatorL, u32DenominatorH; - - u32NumeratorL = u32VNumerator&0xFF; - u32NumeratorH=u32VNumerator>>8; - u32DenominatorL = u32VDenominator&0xFF; - u32DenominatorH = u32VDenominator>>8; - CCAP->PKTSL = (CCAP->PKTSL & ~(CCAP_PKTSL_PKTSVNL_Msk | CCAP_PKTSL_PKTSVML_Msk)) - | ((u32NumeratorL << 24)| (u32DenominatorL << 16)); - CCAP->PKTSM = (CCAP->PKTSM & ~(CCAP_PKTSM_PKTSVNH_Msk | CCAP_PKTSM_PKTSVMH_Msk)) - | ((u32NumeratorH << 24) | (u32DenominatorH << 16)); - - u32NumeratorL = u32HNumerator&0xFF; - u32NumeratorH=u32HNumerator>>8; - u32DenominatorL = u32HDenominator&0xFF; - u32DenominatorH = u32HDenominator>>8; - CCAP->PKTSL = (CCAP->PKTSL & ~(CCAP_PKTSL_PKTSHNL_Msk | CCAP_PKTSL_PKTSHML_Msk)) - | ((u32NumeratorL << 8)| u32DenominatorL); - CCAP->PKTSM = (CCAP->PKTSM & ~(CCAP_PKTSM_PKTSHNH_Msk | CCAP_PKTSM_PKTSHMH_Msk)) - | ((u32NumeratorH << 8) | u32DenominatorH); -} - -/** - * @brief Set Packet Frame Output Pixel Stride Width. - * - * @param[in] u32Stride : set PKTSTRIDE register, It should be 0x0 ~ 0x3FFF - * - * @return None - * - * @details Set Packet Frame Output Pixel Stride Width - */ -void CCAP_SetPacketStride(uint32_t u32Stride ) -{ - CCAP->STRIDE = (CCAP->STRIDE & ~CCAP_STRIDE_PKTSTRIDE_Msk) | u32Stride; -} - - -/*@}*/ /* end of group CCAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CCAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_clk.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_clk.c deleted file mode 100644 index 1a23b44e10e..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_clk.c +++ /dev/null @@ -1,1353 +0,0 @@ -/**************************************************************************//** - * @file clk.c - * @version V3.00 - * @brief M480 series CLK driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - -/** - * @brief Disable clock divider output function - * @param None - * @return None - * @details This function disable clock divider output function. - */ -void CLK_DisableCKO(void) -{ - /* Disable CKO clock source */ - CLK_DisableModuleClock(CLKO_MODULE); -} - -/** - * @brief This function enable clock divider output module clock, - * enable clock divider output function and set frequency selection. - * @param[in] u32ClkSrc is frequency divider function clock source. Including : - * - \ref CLK_CLKSEL1_CLKOSEL_HXT - * - \ref CLK_CLKSEL1_CLKOSEL_LXT - * - \ref CLK_CLKSEL1_CLKOSEL_HCLK - * - \ref CLK_CLKSEL1_CLKOSEL_HIRC - * @param[in] u32ClkDiv is divider output frequency selection. It could be 0~15. - * @param[in] u32ClkDivBy1En is clock divided by one enabled. - * @return None - * @details Output selected clock to CKO. The output clock frequency is divided by u32ClkDiv. \n - * The formula is: \n - * CKO frequency = (Clock source frequency) / 2^(u32ClkDiv + 1) \n - * This function is just used to set CKO clock. - * User must enable I/O for CKO clock output pin by themselves. \n - */ -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) -{ - /* CKO = clock source / 2^(u32ClkDiv + 1) */ - CLK->CLKOCTL = CLK_CLKOCTL_CLKOEN_Msk | (u32ClkDiv) | (u32ClkDivBy1En << CLK_CLKOCTL_DIV1EN_Pos); - - /* Enable CKO clock source */ - CLK_EnableModuleClock(CLKO_MODULE); - - /* Select CKO clock source */ - CLK_SetModuleClock(CLKO_MODULE, u32ClkSrc, 0UL); -} - -/** - * @brief Enter to Power-down mode - * @param None - * @return None - * @details This function is used to let system enter to Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_PowerDown(void) -{ - uint32_t u32HIRCTRIMCTL; - - /* Set the processor uses deep sleep as its low power mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* Set system Power-down enabled */ - CLK->PWRCTL |= (CLK_PWRCTL_PDEN_Msk); - - /* Store HIRC control register */ - u32HIRCTRIMCTL = SYS->IRCTCTL; - - /* Disable HIRC auto trim */ - SYS->IRCTCTL &= (~SYS_IRCTCTL_FREQSEL_Msk); - - /* Chip enter Power-down mode after CPU run WFI instruction */ - __WFI(); - - /* Restore HIRC control register */ - SYS->IRCTCTL = u32HIRCTRIMCTL; -} - -/** - * @brief Enter to Idle mode - * @param None - * @return None - * @details This function let system enter to Idle mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_Idle(void) -{ - /* Set the processor uses sleep as its low power mode */ - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - - /* Set chip in idle mode because of WFI command */ - CLK->PWRCTL &= ~CLK_PWRCTL_PDEN_Msk; - - /* Chip enter idle mode after CPU run WFI instruction */ - __WFI(); -} - -/** - * @brief Get external high speed crystal clock frequency - * @param None - * @return External high frequency crystal frequency - * @details This function get external high frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetHXTFreq(void) -{ - uint32_t u32Freq; - - if((CLK->PWRCTL & CLK_PWRCTL_HXTEN_Msk) == CLK_PWRCTL_HXTEN_Msk) - { - u32Freq = __HXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - - -/** - * @brief Get external low speed crystal clock frequency - * @param None - * @return External low speed crystal clock frequency - * @details This function get external low frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetLXTFreq(void) -{ - uint32_t u32Freq; - if((CLK->PWRCTL & CLK_PWRCTL_LXTEN_Msk) == CLK_PWRCTL_LXTEN_Msk) - { - u32Freq = __LXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - -/** - * @brief Get PCLK0 frequency - * @param None - * @return PCLK0 frequency - * @details This function get PCLK0 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPCLK0Freq(void) -{ - uint32_t u32Freq; - SystemCoreClockUpdate(); - - if((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV1) - { - u32Freq = SystemCoreClock; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV2) - { - u32Freq = SystemCoreClock / 2UL; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV4) - { - u32Freq = SystemCoreClock / 4UL; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV8) - { - u32Freq = SystemCoreClock / 8UL; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB0DIV_Msk) == CLK_PCLKDIV_APB0DIV_DIV16) - { - u32Freq = SystemCoreClock / 16UL; - } - else - { - u32Freq = SystemCoreClock; - } - - return u32Freq; -} - - -/** - * @brief Get PCLK1 frequency - * @param None - * @return PCLK1 frequency - * @details This function get PCLK1 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPCLK1Freq(void) -{ - uint32_t u32Freq; - SystemCoreClockUpdate(); - - if((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV1) - { - u32Freq = SystemCoreClock; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV2) - { - u32Freq = SystemCoreClock / 2UL; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV4) - { - u32Freq = SystemCoreClock / 4UL; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV8) - { - u32Freq = SystemCoreClock / 8UL; - } - else if((CLK->PCLKDIV & CLK_PCLKDIV_APB1DIV_Msk) == CLK_PCLKDIV_APB1DIV_DIV16) - { - u32Freq = SystemCoreClock / 16UL; - } - else - { - u32Freq = SystemCoreClock; - } - - return u32Freq; -} - - -/** - * @brief Get HCLK frequency - * @param None - * @return HCLK frequency - * @details This function get HCLK frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetHCLKFreq(void) -{ - SystemCoreClockUpdate(); - return SystemCoreClock; -} - - -/** - * @brief Get CPU frequency - * @param None - * @return CPU frequency - * @details This function get CPU frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetCPUFreq(void) -{ - SystemCoreClockUpdate(); - return SystemCoreClock; -} - - -/** - * @brief Set HCLK frequency - * @param[in] u32Hclk is HCLK frequency. The range of u32Hclk is running up to 192MHz. - * @return HCLK frequency - * @details This function is used to set HCLK frequency. The frequency unit is Hz. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_SetCoreClock(uint32_t u32Hclk) -{ - uint32_t u32HIRCSTB; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* The range of u32Hclk is running up to 192 MHz */ - if(u32Hclk > FREQ_192MHZ) - { - u32Hclk = FREQ_192MHZ; - } - - /* Switch HCLK clock source to HIRC clock for safe */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_Msk; - CLK->CLKDIV0 &= (~CLK_CLKDIV0_HCLKDIV_Msk); - - /* Configure PLL setting if HXT clock is enabled */ - if((CLK->PWRCTL & CLK_PWRCTL_HXTEN_Msk) == CLK_PWRCTL_HXTEN_Msk) - { - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HXT, u32Hclk); - } - /* Configure PLL setting if HXT clock is not enabled */ - else - { - u32Hclk = CLK_EnablePLL(CLK_PLLCTL_PLLSRC_HIRC, u32Hclk); - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - } - - /* Select HCLK clock source to PLL, - and update system core clock - */ - CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_PLL, CLK_CLKDIV0_HCLK(1UL)); - - /* Disable HIRC if HIRC is disabled before setting core clock */ - if(u32HIRCSTB == 0UL) - { - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; - } - - /* Return actually HCLK frequency is PLL frequency divide 1 */ - return u32Hclk; -} - -/** - * @brief This function set HCLK clock source and HCLK clock divider - * @param[in] u32ClkSrc is HCLK clock source. Including : - * - \ref CLK_CLKSEL0_HCLKSEL_HXT - * - \ref CLK_CLKSEL0_HCLKSEL_LXT - * - \ref CLK_CLKSEL0_HCLKSEL_PLL - * - \ref CLK_CLKSEL0_HCLKSEL_LIRC - * - \ref CLK_CLKSEL0_HCLKSEL_HIRC - * @param[in] u32ClkDiv is HCLK clock divider. Including : - * - \ref CLK_CLKDIV0_HCLK(x) - * @return None - * @details This function set HCLK clock source and HCLK clock divider. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32HIRCSTB; - - /* Read HIRC clock source stable flag */ - u32HIRCSTB = CLK->STATUS & CLK_STATUS_HIRCSTB_Msk; - - /* Switch to HIRC for Safe. Avoid HCLK too high when applying new divider. */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & (~CLK_CLKSEL0_HCLKSEL_Msk)) | CLK_CLKSEL0_HCLKSEL_HIRC; - - /* Apply new Divider */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & (~CLK_CLKDIV0_HCLKDIV_Msk)) | u32ClkDiv; - - /* Switch HCLK to new HCLK source */ - CLK->CLKSEL0 = (CLK->CLKSEL0 & (~CLK_CLKSEL0_HCLKSEL_Msk)) | u32ClkSrc; - - /* Update System Core Clock */ - SystemCoreClockUpdate(); - - /* Disable HIRC if HIRC is disabled before switching HCLK source */ - if(u32HIRCSTB == 0UL) - { - CLK->PWRCTL &= ~CLK_PWRCTL_HIRCEN_Msk; - } -} - -/** - * @brief This function set selected module clock source and module clock divider - * @param[in] u32ModuleIdx is module index. - * @param[in] u32ClkSrc is module clock source. - * @param[in] u32ClkDiv is module clock divider. - * @return None - * @details Valid parameter combinations listed in following table: - * - * |Module index |Clock source |Divider | - * | :---------------- | :----------------------------------- | :-------------------------- | - * |\ref CCAP_MODULE |\ref CLK_CLKSEL0_CCAPSEL_HXT |\ref CLK_CLKDIV3_CCAP(x) | - * |\ref CCAP_MODULE |\ref CLK_CLKSEL0_CCAPSEL_PLL |\ref CLK_CLKDIV3_CCAP(x) | - * |\ref CCAP_MODULE |\ref CLK_CLKSEL0_CCAPSEL_HIRC |\ref CLK_CLKDIV3_CCAP(x) | - * |\ref CCAP_MODULE |\ref CLK_CLKSEL0_CCAPSEL_HCLK |\ref CLK_CLKDIV3_CCAP(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HXT |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_PLL |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HIRC |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH0_MODULE |\ref CLK_CLKSEL0_SDH0SEL_HCLK |\ref CLK_CLKDIV0_SDH0(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_HXT |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_PLL |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_HIRC |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref SDH1_MODULE |\ref CLK_CLKSEL0_SDH1SEL_HCLK |\ref CLK_CLKDIV3_SDH1(x) | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LXT | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_LIRC | x | - * |\ref WDT_MODULE |\ref CLK_CLKSEL1_WDTSEL_HCLK_DIV2048 | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LIRC | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HIRC | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_PCLK0 | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_EXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_PCLK0 | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_EXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_PCLK1 | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_EXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_PCLK1 | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_EXT | x | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_HXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_LXT |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_PLL |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL1_UART0SEL_HIRC |\ref CLK_CLKDIV0_UART0(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_HXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_LXT |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_PLL |\ref CLK_CLKDIV0_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL1_UART1SEL_HIRC |\ref CLK_CLKDIV0_UART1(x) | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_LXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL1_CLKOSEL_HCLK | x | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_LIRC | x | - * |\ref WWDT_MODULE |\ref CLK_CLKSEL1_WWDTSEL_HCLK_DIV2048 | x | - * |\ref EPWM0_MODULE |\ref CLK_CLKSEL2_EPWM0SEL_PLL | x | - * |\ref EPWM0_MODULE |\ref CLK_CLKSEL2_EPWM0SEL_PCLK0 | x | - * |\ref EPWM1_MODULE |\ref CLK_CLKSEL2_EPWM1SEL_PLL | x | - * |\ref EPWM1_MODULE |\ref CLK_CLKSEL2_EPWM1SEL_PCLK1 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HXT | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PLL | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_HIRC | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL2_QSPI0SEL_PCLK0 | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HXT | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PLL | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_HIRC | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL2_SPI0SEL_PCLK1 | x | - * |\ref BPWM0_MODULE |\ref CLK_CLKSEL2_BPWM0SEL_PLL | x | - * |\ref BPWM0_MODULE |\ref CLK_CLKSEL2_BPWM0SEL_PCLK0 | x | - * |\ref BPWM1_MODULE |\ref CLK_CLKSEL2_BPWM1SEL_PLL | x | - * |\ref BPWM1_MODULE |\ref CLK_CLKSEL2_BPWM1SEL_PCLK1 | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_HXT | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_PLL | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_HIRC | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL2_SPI1SEL_PCLK0 | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_HXT | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_PLL | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_HIRC | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL2_SPI2SEL_PCLK1 | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_HXT | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_PLL | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_HIRC | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL2_SPI3SEL_PCLK0 | x | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_HXT |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_PLL |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_HIRC |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL3_SC0SEL_PCLK0 |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_HXT |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_PLL |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_HIRC |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL3_SC1SEL_PCLK1 |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_HXT |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_PLL |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_HIRC |\ref CLK_CLKDIV1_SC2(x) | - * |\ref SC2_MODULE |\ref CLK_CLKSEL3_SC2SEL_PCLK0 |\ref CLK_CLKDIV1_SC2(x) | - * |\ref RTC_MODULE |\ref CLK_CLKSEL3_RTCSEL_LXT | x | - * |\ref RTC_MODULE |\ref CLK_CLKSEL3_RTCSEL_LIRC | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_HXT | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_PLL | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_HIRC | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL3_QSPI1SEL_PCLK1 | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_HXT |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_PLL |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_HIRC |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL3_I2S0SEL_PCLK0 |\ref CLK_CLKDIV2_I2S0(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_HXT |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_LXT |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_PLL |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL3_UART6SEL_HIRC |\ref CLK_CLKDIV4_UART6(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_HXT |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_LXT |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_PLL |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL3_UART7SEL_HIRC |\ref CLK_CLKDIV4_UART7(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_HXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_LXT |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_PLL |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL3_UART2SEL_HIRC |\ref CLK_CLKDIV4_UART2(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_HXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_LXT |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_PLL |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL3_UART3SEL_HIRC |\ref CLK_CLKDIV4_UART3(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_LXT |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_PLL |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL3_UART4SEL_HIRC |\ref CLK_CLKDIV4_UART4(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_LXT |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_PLL |\ref CLK_CLKDIV4_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL3_UART5SEL_HIRC |\ref CLK_CLKDIV4_UART5(x) | - * |\ref EADC_MODULE | x |\ref CLK_CLKDIV0_EADC(x) | - * |\ref EADC1_MODULE | x |\ref CLK_CLKDIV2_EADC1(x) | - * |\ref EMAC_MODULE | x |\ref CLK_CLKDIV3_EMAC(x) | - * - */ -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32sel = 0U, u32div = 0U; - - if(MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock divider control register address */ - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x1) // M480LD - { - if(MODULE_CLKDIV(u32ModuleIdx) == 2U && MODULE_IP_EN_Pos_ENC(u32ModuleIdx) == 31U) //EADC1 - { - u32div = (uint32_t)&CLK->CLKDIV2; - } - else if(MODULE_CLKDIV(u32ModuleIdx) == 2U && MODULE_IP_EN_Pos_ENC(u32ModuleIdx) == 29U) //I2S0 - { - u32div = (uint32_t)&CLK->CLKDIV2; - } - else if (MODULE_CLKDIV(u32ModuleIdx) == 2U) - { - u32div = (uint32_t)&CLK->CLKDIV3; - } - else if (MODULE_CLKDIV(u32ModuleIdx) == 3U) - { - u32div = (uint32_t)&CLK->CLKDIV4; - } - else - { - u32div = (uint32_t)&CLK->CLKDIV0 + ((MODULE_CLKDIV(u32ModuleIdx)) * 4U); - } - } - else - { - /* Get clock divider control register address */ - if(MODULE_CLKDIV(u32ModuleIdx) == 2U) - { - u32div = (uint32_t)&CLK->CLKDIV3; - } - else if (MODULE_CLKDIV(u32ModuleIdx) == 3U) - { - u32div = (uint32_t)&CLK->CLKDIV4; - } - else - { - u32div = (uint32_t)&CLK->CLKDIV0 + ((MODULE_CLKDIV(u32ModuleIdx)) * 4U); - } - } - - /* Apply new divider */ - M32(u32div) = (M32(u32div) & (~(MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx)))) | u32ClkDiv; - } - - if(MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32sel = (uint32_t)&CLK->CLKSEL0 + ((MODULE_CLKSEL(u32ModuleIdx)) * 4U); - /* Set new clock selection setting */ - M32(u32sel) = (M32(u32sel) & (~(MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx)))) | u32ClkSrc; - } -} - -/** - * @brief Set SysTick clock source - * @param[in] u32ClkSrc is module clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * @return None - * @details This function set SysTick clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc) -{ - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; - -} - -/** - * @brief Enable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * @return None - * @details This function enable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL |= u32ClkMask; -} - -/** - * @brief Disable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * @return None - * @details This function disable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL &= ~u32ClkMask; -} - -/** - * @brief Enable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref EMAC_MODULE - * - \ref SDH0_MODULE - * - \ref CRC_MODULE - * - \ref CCAP_MODULE - * - \ref SEN_MODULE - * - \ref HSUSBD_MODULE - * - \ref CRPT_MODULE - * - \ref SPIM_MODULE - * - \ref FMCIDLE_MODULE - * - \ref USBH_MODULE - * - \ref SDH1_MODULE - * - \ref WDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref CLKO_MODULE - * - \ref WWDT_MODULE - * - \ref ACMP01_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref QSPI0_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref CAN0_MODULE - * - \ref CAN1_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref EADC_MODULE - * - \ref I2S0_MODULE - * - \ref HSOTG_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref QSPI1_MODULE - * - \ref SPI3_MODULE - * - \ref USCI0_MODULE - * - \ref USCI1_MODULE - * - \ref DAC_MODULE - * - \ref CAN2_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref TRNG_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref CAN2_MODULE - * - \ref OPA_MODULE - * - \ref EADC1_MODULE - * @return None - * @details This function is used to enable module clock. - */ -void CLK_EnableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL; - - u32tmpVal = (1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32tmpAddr = (uint32_t)&CLK->AHBCLK; - u32tmpAddr += ((MODULE_APBCLK(u32ModuleIdx) * 4UL)); - - *(volatile uint32_t *)u32tmpAddr |= u32tmpVal; -} - -/** - * @brief Disable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA_MODULE - * - \ref ISP_MODULE - * - \ref EBI_MODULE - * - \ref EMAC_MODULE - * - \ref SDH0_MODULE - * - \ref CRC_MODULE - * - \ref CCAP_MODULE - * - \ref SEN_MODULE - * - \ref HSUSBD_MODULE - * - \ref CRPT_MODULE - * - \ref SPIM_MODULE - * - \ref FMCIDLE_MODULE - * - \ref USBH_MODULE - * - \ref SDH1_MODULE - * - \ref WDT_MODULE - * - \ref RTC_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref CLKO_MODULE - * - \ref WWDT_MODULE - * - \ref ACMP01_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref QSPI0_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref CAN0_MODULE - * - \ref CAN1_MODULE - * - \ref OTG_MODULE - * - \ref USBD_MODULE - * - \ref EADC_MODULE - * - \ref I2S0_MODULE - * - \ref HSOTG_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref QSPI1_MODULE - * - \ref SPI3_MODULE - * - \ref USCI0_MODULE - * - \ref USCI1_MODULE - * - \ref DAC_MODULE - * - \ref CAN2_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref TRNG_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref CAN2_MODULE - * - \ref OPA_MODULE - * - \ref EADC1_MODULE - * @return None - * @details This function is used to disable module clock. - */ -void CLK_DisableModuleClock(uint32_t u32ModuleIdx) -{ - uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL; - - u32tmpVal = ~(1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32tmpAddr = (uint32_t)&CLK->AHBCLK; - u32tmpAddr += ((MODULE_APBCLK(u32ModuleIdx) * 4UL)); - - *(uint32_t *)u32tmpAddr &= u32tmpVal; -} - - -/** - * @brief Set PLL frequency - * @param[in] u32PllClkSrc is PLL clock source. Including : - * - \ref CLK_PLLCTL_PLLSRC_HXT - * - \ref CLK_PLLCTL_PLLSRC_HIRC - * @param[in] u32PllFreq is PLL frequency. - * @return PLL frequency - * @details This function is used to configure PLLCTL register to set specified PLL frequency. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_EnablePLL(uint32_t u32PllClkSrc, uint32_t u32PllFreq) -{ - uint32_t u32PllSrcClk, u32NR, u32NF, u32NO, u32CLK_SRC, u32PllClk; - uint32_t u32Tmp, u32Tmp2, u32Tmp3, u32Min, u32MinNF, u32MinNR, u32MinNO, u32basFreq; - - /* Disable PLL first to avoid unstable when setting PLL */ - CLK_DisablePLL(); - - /* PLL source clock is from HXT */ - if(u32PllClkSrc == CLK_PLLCTL_PLLSRC_HXT) - { - /* Enable HXT clock */ - CLK->PWRCTL |= CLK_PWRCTL_HXTEN_Msk; - - /* Wait for HXT clock ready */ - CLK_WaitClockReady(CLK_STATUS_HXTSTB_Msk); - - /* Select PLL source clock from HXT */ - u32CLK_SRC = CLK_PLLCTL_PLLSRC_HXT; - u32PllSrcClk = __HXT; - - /* u32NR start from 2 */ - u32NR = 2UL; - } - - /* PLL source clock is from HIRC */ - else - { - /* Enable HIRC clock */ - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - - /* Wait for HIRC clock ready */ - CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); - - /* Select PLL source clock from HIRC */ - u32CLK_SRC = CLK_PLLCTL_PLLSRC_HIRC; - u32PllSrcClk = __HIRC; - - /* u32NR start from 4 when FIN = 22.1184MHz to avoid calculation overflow */ - u32NR = 4UL; - } - - if((u32PllFreq <= FREQ_500MHZ) && (u32PllFreq >= FREQ_50MHZ)) - { - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinNR = 0UL; - u32MinNF = 0UL; - u32MinNO = 0UL; - u32basFreq = u32PllFreq; - - for(u32NO = 1UL; u32NO <= 4UL; u32NO++) - { - /* Break when get good results */ - if (u32Min == 0UL) - { - break; - } - - if (u32NO != 3UL) - { - - if(u32NO == 4UL) - { - u32PllFreq = u32basFreq << 2; - } - else if(u32NO == 2UL) - { - u32PllFreq = u32basFreq << 1; - } - else - { - } - - for(u32NR = 2UL; u32NR <= 32UL; u32NR++) - { - /* Break when get good results */ - if (u32Min == 0UL) - { - break; - } - - u32Tmp = u32PllSrcClk / u32NR; - if((u32Tmp >= 4000000UL) && (u32Tmp <= 8000000UL)) - { - for(u32NF = 2UL; u32NF <= 513UL; u32NF++) - { - /* u32Tmp2 is shifted 2 bits to avoid overflow */ - u32Tmp2 = (((u32Tmp * 2UL) >> 2) * u32NF); - - if((u32Tmp2 >= FREQ_50MHZ) && (u32Tmp2 <= FREQ_125MHZ)) - { - u32Tmp3 = (u32Tmp2 > (u32PllFreq>>2)) ? u32Tmp2 - (u32PllFreq>>2) : (u32PllFreq>>2) - u32Tmp2; - if(u32Tmp3 < u32Min) - { - u32Min = u32Tmp3; - u32MinNR = u32NR; - u32MinNF = u32NF; - u32MinNO = u32NO; - - /* Break when get good results */ - if(u32Min == 0UL) - { - break; - } - } - } - } - } - } - } - } - - /* Enable and apply new PLL setting. */ - CLK->PLLCTL = u32CLK_SRC | ((u32MinNO - 1UL) << 14) | ((u32MinNR - 1UL) << 9) | (u32MinNF - 2UL); - - /* Wait for PLL clock stable */ - CLK_WaitClockReady(CLK_STATUS_PLLSTB_Msk); - - /* Actual PLL output clock frequency */ - u32PllClk = u32PllSrcClk / (u32MinNO * (u32MinNR)) * (u32MinNF) * 2UL; - } - else - { - /* Wrong frequency request. Just return default setting. */ - /* Apply default PLL setting and return */ - if(u32PllClkSrc == CLK_PLLCTL_PLLSRC_HXT) - { - CLK->PLLCTL = CLK_PLLCTL_192MHz_HXT; - } - else - { - CLK->PLLCTL = CLK_PLLCTL_192MHz_HIRC; - } - - /* Wait for PLL clock stable */ - CLK_WaitClockReady(CLK_STATUS_PLLSTB_Msk); - - /* Actual PLL output clock frequency */ - u32PllClk = CLK_GetPLLClockFreq(); - } - - return u32PllClk; -} - -/** - * @brief Disable PLL - * @param None - * @return None - * @details This function set PLL in Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisablePLL(void) -{ - CLK->PLLCTL |= CLK_PLLCTL_PD_Msk; -} - - -/** - * @brief This function check selected clock source status - * @param[in] u32ClkMask is selected clock source. Including : - * - \ref CLK_STATUS_HXTSTB_Msk - * - \ref CLK_STATUS_LXTSTB_Msk - * - \ref CLK_STATUS_HIRCSTB_Msk - * - \ref CLK_STATUS_LIRCSTB_Msk - * - \ref CLK_STATUS_PLLSTB_Msk - * @retval 0 clock is not stable - * @retval 1 clock is stable - * @details To wait for clock ready by specified clock source stable flag or timeout (~300ms) - */ -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask) -{ - int32_t i32TimeOutCnt = 2160000; - uint32_t u32Ret = 1U; - - while((CLK->STATUS & u32ClkMask) != u32ClkMask) - { - if(i32TimeOutCnt-- <= 0) - { - u32Ret = 0U; - break; - } - } - return u32Ret; -} - -/** - * @brief Enable System Tick counter - * @param[in] u32ClkSrc is System Tick clock source. Including: - * - \ref CLK_CLKSEL0_STCLKSEL_HXT - * - \ref CLK_CLKSEL0_STCLKSEL_LXT - * - \ref CLK_CLKSEL0_STCLKSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HIRC_DIV2 - * - \ref CLK_CLKSEL0_STCLKSEL_HCLK - * @param[in] u32Count is System Tick reload value. It could be 0~0xFFFFFF. - * @return None - * @details This function set System Tick clock source, reload value, enable System Tick counter and interrupt. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; - - /* Set System Tick clock source */ - if( u32ClkSrc == CLK_CLKSEL0_STCLKSEL_HCLK ) - { - SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk; - } - else - { - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_STCLKSEL_Msk) | u32ClkSrc; - } - - /* Set System Tick reload value */ - SysTick->LOAD = u32Count; - - /* Clear System Tick current value and counter flag */ - SysTick->VAL = 0UL; - - /* Set System Tick interrupt enabled and counter enabled */ - SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk; -} - -/** - * @brief Disable System Tick counter - * @param None - * @return None - * @details This function disable System Tick counter. - */ -void CLK_DisableSysTick(void) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; -} - - -/** - * @brief Power-down mode selected - * @param[in] u32PDMode is power down mode index. Including : - * - \ref CLK_PMUCTL_PDMSEL_PD - * - \ref CLK_PMUCTL_PDMSEL_LLPD - * - \ref CLK_PMUCTL_PDMSEL_FWPD - * - \ref CLK_PMUCTL_PDMSEL_SPD0 - * - \ref CLK_PMUCTL_PDMSEL_SPD1 - * - \ref CLK_PMUCTL_PDMSEL_DPD - * @return None - * @details This function is used to set power-down mode. - * @note Must enable LIRC clock before entering to Standby Power-down Mode - */ - -void CLK_SetPowerDownMode(uint32_t u32PDMode) -{ - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x1) // M480LD - { - if(u32PDMode == CLK_PMUCTL_PDMSEL_SPD0) - { - u32PDMode = CLK_PMUCTL_PDMSEL_SPD0; - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_SRETSEL_Msk)) | CLK_SPDSRETSEL_16K; - } - else if(u32PDMode == CLK_PMUCTL_PDMSEL_SPD1) - { - u32PDMode = CLK_PMUCTL_PDMSEL_SPD0; - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_SRETSEL_Msk)) | CLK_SPDSRETSEL_NO; - } - } - else - { - /* Enable LIRC clock before entering to Standby Power-down Mode */ - if((u32PDMode == CLK_PMUCTL_PDMSEL_SPD0) || (u32PDMode == CLK_PMUCTL_PDMSEL_SPD1)) - { - /* Enable LIRC clock */ - CLK->PWRCTL |= CLK_PWRCTL_LIRCEN_Msk; - - /* Wait for LIRC clock stable */ - CLK_WaitClockReady(CLK_STATUS_LIRCSTB_Msk); - } - } - - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_PDMSEL_Msk)) | u32PDMode; -} - - -/** - * @brief Set Wake-up pin trigger type at Deep Power down mode - * - * @param[in] u32TriggerType - * - \ref CLK_DPDWKPIN_RISING - * - \ref CLK_DPDWKPIN_FALLING - * - \ref CLK_DPDWKPIN_BOTHEDGE - * - \ref CLK_DPDWKPIN1_RISING - * - \ref CLK_DPDWKPIN1_FALLING - * - \ref CLK_DPDWKPIN1_BOTHEDGE - * - \ref CLK_DPDWKPIN2_RISING - * - \ref CLK_DPDWKPIN2_FALLING - * - \ref CLK_DPDWKPIN2_BOTHEDGE - * - \ref CLK_DPDWKPIN3_RISING - * - \ref CLK_DPDWKPIN3_FALLING - * - \ref CLK_DPDWKPIN3_BOTHEDGE - * - \ref CLK_DPDWKPIN4_RISING - * - \ref CLK_DPDWKPIN4_FALLING - * - \ref CLK_DPDWKPIN4_BOTHEDGE - * @return None - * - * @details This function is used to enable Wake-up pin trigger type. - */ - -void CLK_EnableDPDWKPin(uint32_t u32TriggerType) -{ - uint32_t u32Pin1, u32Pin2, u32Pin3, u32Pin4; - - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x1) // M480LD - { - u32Pin1 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN1_Pos); - u32Pin2 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN2_Pos); - u32Pin3 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN3_Pos); - u32Pin4 = (((u32TriggerType) & 0x03UL) >> CLK_PMUCTL_WKPINEN4_Pos); - - if(u32Pin1) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN1_Msk)) | u32TriggerType; - } - else if(u32Pin2) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN2_Msk)) | u32TriggerType; - } - else if(u32Pin3) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN3_Msk)) | u32TriggerType; - } - else if(u32Pin4) - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN4_Msk)) | u32TriggerType; - } - else - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN_Msk)) | u32TriggerType; - } - } - else - { - CLK->PMUCTL = (CLK->PMUCTL & ~(CLK_PMUCTL_WKPINEN_Msk)) | u32TriggerType; - } -} - -/** - * @brief Get power manager wake up source - * - * @param[in] None - * @return None - * - * @details This function get power manager wake up source. - */ - -uint32_t CLK_GetPMUWKSrc(void) -{ - return (CLK->PMUSTS); -} - -/** - * @brief Set specified GPIO as wake up source at Stand-by Power down mode - * - * @param[in] u32Port GPIO port. It could be 0~3. - * @param[in] u32Pin The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32TriggerType - * - \ref CLK_SPDWKPIN_RISING - * - \ref CLK_SPDWKPIN_FALLING - * @param[in] u32DebounceEn - * - \ref CLK_SPDWKPIN_DEBOUNCEEN - * - \ref CLK_SPDWKPIN_DEBOUNCEDIS - * @return None - * - * @details This function is used to set specified GPIO as wake up source - * at Stand-by Power down mode. - */ -void CLK_EnableSPDWKPin(uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerType, uint32_t u32DebounceEn) -{ - uint32_t u32tmpAddr = 0UL; - uint32_t u32tmpVal = 0UL; - - /* GPx Stand-by Power-down Wake-up Pin Select */ - u32tmpAddr = (uint32_t)&CLK->PASWKCTL; - u32tmpAddr += (0x4UL * u32Port); - - u32tmpVal = inpw((uint32_t *)u32tmpAddr); - u32tmpVal = (u32tmpVal & ~(CLK_PASWKCTL_WKPSEL_Msk | CLK_PASWKCTL_PRWKEN_Msk | CLK_PASWKCTL_PFWKEN_Msk | CLK_PASWKCTL_DBEN_Msk | CLK_PASWKCTL_WKEN_Msk)) | - (u32Pin << CLK_PASWKCTL_WKPSEL_Pos) | u32TriggerType | u32DebounceEn | CLK_SPDWKPIN_ENABLE; - outpw((uint32_t *)u32tmpAddr, u32tmpVal); -} - -/** - * @brief Get PLL clock frequency - * @param None - * @return PLL frequency - * @details This function get PLL frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPLLClockFreq(void) -{ - uint32_t u32PllFreq = 0UL, u32PllReg; - uint32_t u32FIN, u32NF, u32NR, u32NO; - uint8_t au8NoTbl[4] = {1U, 2U, 2U, 4U}; - - u32PllReg = CLK->PLLCTL; - - if(u32PllReg & (CLK_PLLCTL_PD_Msk | CLK_PLLCTL_OE_Msk)) - { - u32PllFreq = 0UL; /* PLL is in power down mode or fix low */ - } - else if((u32PllReg & CLK_PLLCTL_BP_Msk) == CLK_PLLCTL_BP_Msk) - { - if((u32PllReg & CLK_PLLCTL_PLLSRC_HIRC) == CLK_PLLCTL_PLLSRC_HIRC) - { - u32FIN = __HIRC; /* PLL source clock from HIRC */ - } - else - { - u32FIN = __HXT; /* PLL source clock from HXT */ - } - - u32PllFreq = u32FIN; - } - else - { - if((u32PllReg & CLK_PLLCTL_PLLSRC_HIRC) == CLK_PLLCTL_PLLSRC_HIRC) - { - u32FIN = __HIRC; /* PLL source clock from HIRC */ - } - else - { - u32FIN = __HXT; /* PLL source clock from HXT */ - } - /* PLL is output enabled in normal work mode */ - u32NO = au8NoTbl[((u32PllReg & CLK_PLLCTL_OUTDIV_Msk) >> CLK_PLLCTL_OUTDIV_Pos)]; - u32NF = ((u32PllReg & CLK_PLLCTL_FBDIV_Msk) >> CLK_PLLCTL_FBDIV_Pos) + 2UL; - u32NR = ((u32PllReg & CLK_PLLCTL_INDIV_Msk) >> CLK_PLLCTL_INDIV_Pos) + 1UL; - - /* u32FIN is shifted 2 bits to avoid overflow */ - u32PllFreq = (((u32FIN >> 2) * u32NF) / (u32NR * u32NO) << 2) * 2UL; - } - - return u32PllFreq; -} - -/** - * @brief Get selected module clock source - * @param[in] u32ModuleIdx is module index. - * - \ref CCAP_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref WDT_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref CLKO_MODULE - * - \ref WWDT_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref BPWM0_MODULE - * - \ref BPWM1_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref RTC_MODULE - * - \ref I2S0_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * @return Selected module clock source setting - * @details This function get selected module clock source. - */ -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx) -{ - uint32_t u32sel = 0; - uint32_t u32SelTbl[4] = {0x0, 0x4, 0x8, 0xC}; - - /* Get clock source selection setting */ - if(u32ModuleIdx == EPWM0_MODULE) - return ((CLK->CLKSEL2 & CLK_CLKSEL2_EPWM0SEL_Msk) >> CLK_CLKSEL2_EPWM0SEL_Pos); - else if(u32ModuleIdx == EPWM1_MODULE) - return ((CLK->CLKSEL2 & CLK_CLKSEL2_EPWM1SEL_Msk) >> CLK_CLKSEL2_EPWM1SEL_Pos); - else if(u32ModuleIdx == BPWM0_MODULE) - return ((CLK->CLKSEL2 & CLK_CLKSEL2_BPWM0SEL_Msk) >> CLK_CLKSEL2_BPWM0SEL_Pos); - else if(u32ModuleIdx == BPWM1_MODULE) - return ((CLK->CLKSEL2 & CLK_CLKSEL2_BPWM1SEL_Msk) >> CLK_CLKSEL2_BPWM1SEL_Pos); - else if(MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32sel = (uint32_t)&CLK->CLKSEL0 + (u32SelTbl[MODULE_CLKSEL(u32ModuleIdx)]); - /* Get clock source selection setting */ - return ((M32(u32sel) & (MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx))) >> MODULE_CLKSEL_Pos(u32ModuleIdx)); - } - else - return 0; -} - -/** - * @brief Get selected module clock divider number - * @param[in] u32ModuleIdx is module index. - * - \ref CCAP_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref SC2_MODULE - * - \ref I2S0_MODULE - * - \ref EADC_MODULE - * - \ref EADC1_MODULE - * - \ref EMAC_MODULE - * @return Selected module clock divider number setting - * @details This function get selected module clock divider number. - */ -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx) -{ - uint32_t u32div = 0; - uint32_t u32DivTbl[4] = {0x0, 0x4, 0xc, 0x10}; - - if(MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock divider control register address */ - u32div = (uint32_t)&CLK->CLKDIV0 + (u32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x1) // M480LD - { - if(MODULE_IP_EN_Pos_ENC(u32ModuleIdx) == 31U) //EADC1 - u32div = (uint32_t)&CLK->CLKDIV2; - else if(MODULE_IP_EN_Pos_ENC(u32ModuleIdx) == 29U) //I2S0 - u32div = (uint32_t)&CLK->CLKDIV2; - } - /* Get clock divider number setting */ - return ((M32(u32div) & (MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx))) >> MODULE_CLKDIV_Pos(u32ModuleIdx)); - } - else - return 0; -} - - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_crc.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_crc.c deleted file mode 100644 index 0de1d365770..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_crc.c +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************//** - * @file crc.c - * @version V1.00 - * @brief M480 CRC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRC_Driver CRC Driver - @{ -*/ - -/** @addtogroup CRC_EXPORTED_FUNCTIONS CRC Exported Functions - @{ -*/ - -/** - * @brief CRC Open - * - * @param[in] u32Mode CRC operation polynomial mode. Valid values are: - * - \ref CRC_CCITT - * - \ref CRC_8 - * - \ref CRC_16 - * - \ref CRC_32 - * @param[in] u32Attribute CRC operation data attribute. Valid values are combined with: - * - \ref CRC_CHECKSUM_COM - * - \ref CRC_CHECKSUM_RVS - * - \ref CRC_WDATA_COM - * - \ref CRC_WDATA_RVS - * @param[in] u32Seed Seed value. - * @param[in] u32DataLen CPU Write Data Length. Valid values are: - * - \ref CRC_CPU_WDATA_8 - * - \ref CRC_CPU_WDATA_16 - * - \ref CRC_CPU_WDATA_32 - * - * @return None - * - * @details This function will enable the CRC controller by specify CRC operation mode, attribute, initial seed and write data length. \n - * After that, user can start to perform CRC calculate by calling CRC_WRITE_DATA macro or CRC_DAT register directly. - */ -void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen) -{ - CRC->SEED = u32Seed; - CRC->CTL = u32Mode | u32Attribute | u32DataLen | CRC_CTL_CRCEN_Msk; - - /* Setting CHKSINIT bit will reload the initial seed value(CRC_SEED register) to CRC controller */ - CRC->CTL |= CRC_CTL_CHKSINIT_Msk; -} - -/** - * @brief Get CRC Checksum - * - * @param[in] None - * - * @return Checksum Result - * - * @details This macro gets the CRC checksum result by current CRC polynomial mode. - */ -uint32_t CRC_GetChecksum(void) -{ - uint32_t ret; - - switch(CRC->CTL & CRC_CTL_CRCMODE_Msk) - { - case CRC_CCITT: - case CRC_16: - ret = (CRC->CHECKSUM & 0xFFFFU); - break; - case CRC_32: - ret = (CRC->CHECKSUM); - break; - case CRC_8: - ret = (CRC->CHECKSUM & 0xFFU); - break; - default: - ret = 0U; - break; - } - - return ret; -} - -/*@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CRC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_crypto.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_crypto.c deleted file mode 100644 index 03afc5fde3a..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_crypto.c +++ /dev/null @@ -1,1995 +0,0 @@ -/**************************************************************************//** - * @file crypto.c - * @version V1.10 - * @brief Cryptographic Accelerator driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include "NuMicro.h" - -/** @cond HIDDEN_SYMBOLS */ - -#define ENABLE_DEBUG 0 - -#if ENABLE_DEBUG - #define CRPT_DBGMSG printf -#else - #define CRPT_DBGMSG(...) do { } while (0) /* disable debug */ -#endif - -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - -/** @cond HIDDEN_SYMBOLS */ - -static uint32_t g_AES_CTL[4]; -static uint32_t g_TDES_CTL[4]; - -static char hex_char_tbl[] = "0123456789abcdef"; - -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count); -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx); -static void Hex2Reg(char input[], uint32_t volatile reg[]); -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]); -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift); -static char ch2hex(char ch); -static int get_nibble_value(char c); - - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Open PRNG function - * @param[in] crpt Reference to Crypto module. - * @param[in] u32KeySize is PRNG key size, including: - * - \ref PRNG_KEY_SIZE_64 - * - \ref PRNG_KEY_SIZE_128 - * - \ref PRNG_KEY_SIZE_192 - * - \ref PRNG_KEY_SIZE_256 - * @param[in] u32SeedReload is PRNG seed reload or not, including: - * - \ref PRNG_SEED_CONT - * - \ref PRNG_SEED_RELOAD - * @param[in] u32Seed The new seed. Only valid when u32SeedReload is PRNG_SEED_RELOAD. - * @return None - */ -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed) -{ - if (u32SeedReload) - { - crpt->PRNG_SEED = u32Seed; - } - - crpt->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - (u32SeedReload << CRPT_PRNG_CTL_SEEDRLD_Pos); -} - -/** - * @brief Start to generate one PRNG key. - * @param[in] crpt Reference to Crypto module. - * @return None - */ -void PRNG_Start(CRPT_T *crpt) -{ - crpt->PRNG_CTL |= CRPT_PRNG_CTL_START_Msk; -} - -/** - * @brief Read the PRNG key. - * @param[in] crpt Reference to Crypto module. - * @param[out] u32RandKey The key buffer to store newly generated PRNG key. - * @return None - */ -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]) -{ - uint32_t i, wcnt; - - wcnt = (((crpt->PRNG_CTL & CRPT_PRNG_CTL_KEYSZ_Msk) >> CRPT_PRNG_CTL_KEYSZ_Pos) + 1U) * 2U; - - for (i = 0U; i < wcnt; i++) - { - u32RandKey[i] = crpt->PRNG_KEY[i]; - } - - crpt->PRNG_CTL &= ~CRPT_PRNG_CTL_SEEDRLD_Msk; -} - - -/** - * @brief Open AES encrypt/decrypt function. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32EncDec 1: AES encode; 0: AES decode - * @param[in] u32OpMode AES operation mode, including: - * - \ref AES_MODE_ECB - * - \ref AES_MODE_CBC - * - \ref AES_MODE_CFB - * - \ref AES_MODE_OFB - * - \ref AES_MODE_CTR - * - \ref AES_MODE_CBC_CS1 - * - \ref AES_MODE_CBC_CS2 - * - \ref AES_MODE_CBC_CS3 - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @param[in] u32SwapType is AES input/output data swap control, including: - * - \ref AES_NO_SWAP - * - \ref AES_OUT_SWAP - * - \ref AES_IN_SWAP - * - \ref AES_IN_OUT_SWAP - * @return None - */ -void AES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, - uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType) -{ - crpt->AES_CTL = (u32Channel << CRPT_AES_CTL_CHANNEL_Pos) | - (u32EncDec << CRPT_AES_CTL_ENCRPT_Pos) | - (u32OpMode << CRPT_AES_CTL_OPMODE_Pos) | - (u32KeySize << CRPT_AES_CTL_KEYSZ_Pos) | - (u32SwapType << CRPT_AES_CTL_OUTSWAP_Pos); - g_AES_CTL[u32Channel] = crpt->AES_CTL; -} - -/** - * @brief Start AES encrypt/decrypt - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32DMAMode AES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop AES encrypt/decrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous AES encrypt/decrypt. - * - \ref CRYPTO_DMA_LAST Last AES encrypt/decrypt of a series of AES_Start. - * @return None - */ -void AES_Start(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32DMAMode) -{ - crpt->AES_CTL = g_AES_CTL[u32Channel]; - crpt->AES_CTL |= CRPT_AES_CTL_START_Msk | (u32DMAMode << CRPT_AES_CTL_DMALAST_Pos); -} - -/** - * @brief Set AES keys - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32Keys An word array contains AES keys. - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @return None - */ -void AES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize) -{ - uint32_t i, wcnt, key_reg_addr; - - key_reg_addr = (uint32_t)&crpt->AES0_KEY[0] + (u32Channel * 0x3CUL); - wcnt = 4UL + u32KeySize * 2UL; - - for (i = 0U; i < wcnt; i++) - { - outpw(key_reg_addr, au32Keys[i]); - key_reg_addr += 4UL; - } -} - -/** - * @brief Set AES initial vectors - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32IV A four entry word array contains AES initial vectors. - * @return None - */ -void AES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32IV[]) -{ - uint32_t i, key_reg_addr; - - key_reg_addr = (uint32_t)&crpt->AES0_IV[0] + (u32Channel * 0x3CUL); - - for (i = 0U; i < 4U; i++) - { - outpw(key_reg_addr, au32IV[i]); - key_reg_addr += 4UL; - } -} - -/** - * @brief Set AES DMA transfer configuration. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32SrcAddr AES DMA source address - * @param[in] u32DstAddr AES DMA destination address - * @param[in] u32TransCnt AES DMA transfer byte count - * @return None - */ -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, - uint32_t u32DstAddr, uint32_t u32TransCnt) -{ - uint32_t reg_addr; - - reg_addr = (uint32_t)&crpt->AES0_SADDR + (u32Channel * 0x3CUL); - outpw(reg_addr, u32SrcAddr); - - reg_addr = (uint32_t)&crpt->AES0_DADDR + (u32Channel * 0x3CUL); - outpw(reg_addr, u32DstAddr); - - reg_addr = (uint32_t)&crpt->AES0_CNT + (u32Channel * 0x3CUL); - outpw(reg_addr, u32TransCnt); -} - -/** - * @brief Open TDES encrypt/decrypt function. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32EncDec 1: TDES encode; 0: TDES decode - * @param[in] Is3DES 1: TDES; 0: DES - * @param[in] Is3Key 1: TDES 3 key mode; 0: TDES 2 key mode - * @param[in] u32OpMode TDES operation mode, including: - * - \ref TDES_MODE_ECB - * - \ref TDES_MODE_CBC - * - \ref TDES_MODE_CFB - * - \ref TDES_MODE_OFB - * - \ref TDES_MODE_CTR - * @param[in] u32SwapType is TDES input/output data swap control and word swap control, including: - * - \ref TDES_NO_SWAP - * - \ref TDES_WHL_SWAP - * - \ref TDES_OUT_SWAP - * - \ref TDES_OUT_WHL_SWAP - * - \ref TDES_IN_SWAP - * - \ref TDES_IN_WHL_SWAP - * - \ref TDES_IN_OUT_SWAP - * - \ref TDES_IN_OUT_WHL_SWAP - * @return None - */ -void TDES_Open(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, int32_t Is3DES, int32_t Is3Key, - uint32_t u32OpMode, uint32_t u32SwapType) -{ - g_TDES_CTL[u32Channel] = (u32Channel << CRPT_TDES_CTL_CHANNEL_Pos) | - (u32EncDec << CRPT_TDES_CTL_ENCRPT_Pos) | - u32OpMode | (u32SwapType << CRPT_TDES_CTL_BLKSWAP_Pos); - if (Is3DES) - { - g_TDES_CTL[u32Channel] |= CRPT_TDES_CTL_TMODE_Msk; - } - if (Is3Key) - { - g_TDES_CTL[u32Channel] |= CRPT_TDES_CTL_3KEYS_Msk; - } -} - -/** - * @brief Start TDES encrypt/decrypt - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32DMAMode TDES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop TDES encrypt/decrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous TDES encrypt/decrypt. - * - \ref CRYPTO_DMA_LAST Last TDES encrypt/decrypt of a series of TDES_Start. - * @return None - */ -void TDES_Start(CRPT_T *crpt, int32_t u32Channel, uint32_t u32DMAMode) -{ - g_TDES_CTL[u32Channel] |= CRPT_TDES_CTL_START_Msk | (u32DMAMode << CRPT_TDES_CTL_DMALAST_Pos); - crpt->TDES_CTL = g_TDES_CTL[u32Channel]; -} - -/** - * @brief Set TDES keys - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] au32Keys The TDES keys. au32Keys[0][0] is Key0 high word and au32Keys[0][1] is key0 low word. - * @return None - */ -void TDES_SetKey(CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[3][2]) -{ - uint32_t i, reg_addr; - - reg_addr = (uint32_t)&crpt->TDES0_KEY1H + (0x40UL * u32Channel); - - for (i = 0U; i < 3U; i++) - { - outpw(reg_addr, au32Keys[i][0]); /* TDESn_KEYxH */ - reg_addr += 4UL; - outpw(reg_addr, au32Keys[i][1]); /* TDESn_KEYxL */ - reg_addr += 4UL; - } -} - -/** - * @brief Set TDES initial vectors - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32IVH TDES initial vector high word. - * @param[in] u32IVL TDES initial vector low word. - * @return None - */ -void TDES_SetInitVect(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32IVH, uint32_t u32IVL) -{ - uint32_t reg_addr; - - reg_addr = (uint32_t)&crpt->TDES0_IVH + (u32Channel * 0x40UL); - outpw(reg_addr, u32IVH); - - reg_addr = (uint32_t)&crpt->TDES0_IVL + (u32Channel * 0x40UL); - outpw(reg_addr, u32IVL); -} - -/** - * @brief Set TDES DMA transfer configuration. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32SrcAddr TDES DMA source address - * @param[in] u32DstAddr TDES DMA destination address - * @param[in] u32TransCnt TDES DMA transfer byte count - * @return None - */ -void TDES_SetDMATransfer(CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, - uint32_t u32DstAddr, uint32_t u32TransCnt) -{ - uint32_t reg_addr; - - reg_addr = (uint32_t)&crpt->TDES0_SA + (u32Channel * 0x40UL); - outpw(reg_addr, u32SrcAddr); - - reg_addr = (uint32_t)&crpt->TDES0_DA + (u32Channel * 0x40UL); - outpw(reg_addr, u32DstAddr); - - reg_addr = (uint32_t)&crpt->TDES0_CNT + (u32Channel * 0x40UL); - outpw(reg_addr, u32TransCnt); -} - -/** - * @brief Open SHA encrypt function. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32OpMode SHA operation mode, including: - * - \ref SHA_MODE_SHA1 - * - \ref SHA_MODE_SHA224 - * - \ref SHA_MODE_SHA256 - * - \ref SHA_MODE_SHA384 - * - \ref SHA_MODE_SHA512 - * @param[in] u32SwapType is SHA input/output data swap control, including: - * - \ref SHA_NO_SWAP - * - \ref SHA_OUT_SWAP - * - \ref SHA_IN_SWAP - * - \ref SHA_IN_OUT_SWAP - * @param[in] hmac_key_len HMAC key byte count - * @return None - */ -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len) -{ - crpt->HMAC_CTL = (u32OpMode << CRPT_HMAC_CTL_OPMODE_Pos) | - (u32SwapType << CRPT_HMAC_CTL_OUTSWAP_Pos); - - if (hmac_key_len != 0UL) - { - crpt->HMAC_KEYCNT = hmac_key_len; - - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x0) - crpt->HMAC_CTL |= (1 << 4); /* M480MD HMACEN is CRYPTO_HMAC_CTL[4] */ - else - crpt->HMAC_CTL |= (1 << 11); /* M480LD HMACEN is CRYPTO_HMAC_CTL[11] */ - } -} - -/** - * @brief Start SHA encrypt - * @param[in] crpt Reference to Crypto module. - * @param[in] u32DMAMode TDES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop SHA encrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous SHA encrypt. - * - \ref CRYPTO_DMA_LAST Last SHA encrypt of a series of SHA_Start. - * @return None - */ -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode) -{ - crpt->HMAC_CTL &= ~(0x7UL << CRPT_HMAC_CTL_DMALAST_Pos); - crpt->HMAC_CTL |= CRPT_HMAC_CTL_START_Msk | (u32DMAMode << CRPT_HMAC_CTL_DMALAST_Pos); -} - -/** - * @brief Set SHA DMA transfer - * @param[in] crpt Reference to Crypto module. - * @param[in] u32SrcAddr SHA DMA source address - * @param[in] u32TransCnt SHA DMA transfer byte count - * @return None - */ -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt) -{ - crpt->HMAC_SADDR = u32SrcAddr; - crpt->HMAC_DMACNT = u32TransCnt; -} - -/** - * @brief Read the SHA digest. - * @param[in] crpt Reference to Crypto module. - * @param[out] u32Digest The SHA encrypt output digest. - * @return None - */ -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]) -{ - uint32_t i, wcnt, reg_addr; - - i = (crpt->HMAC_CTL & CRPT_HMAC_CTL_OPMODE_Msk) >> CRPT_HMAC_CTL_OPMODE_Pos; - - if (i == SHA_MODE_SHA1) - { - wcnt = 5UL; - } - else if (i == SHA_MODE_SHA224) - { - wcnt = 7UL; - } - else if (i == SHA_MODE_SHA256) - { - wcnt = 8UL; - } - else if (i == SHA_MODE_SHA384) - { - wcnt = 12UL; - } - else - { - /* SHA_MODE_SHA512 */ - wcnt = 16UL; - } - - reg_addr = (uint32_t) & (crpt->HMAC_DGST[0]); - for (i = 0UL; i < wcnt; i++) - { - u32Digest[i] = inpw(reg_addr); - reg_addr += 4UL; - } -} - -/** @cond HIDDEN_SYMBOLS */ - -/*-----------------------------------------------------------------------------------------------*/ -/* */ -/* ECC */ -/* */ -/*-----------------------------------------------------------------------------------------------*/ - -#define ECCOP_POINT_MUL (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_MODULE (0x1UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_ADD (0x2UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_DOUBLE (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) - -#define MODOP_DIV (0x0UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_MUL (0x1UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_ADD (0x2UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_SUB (0x3UL << CRPT_ECC_CTL_MODOP_Pos) - -enum -{ - CURVE_GF_P, - CURVE_GF_2M, -}; - -/*-----------------------------------------------------*/ -/* Define elliptic curve (EC): */ -/*-----------------------------------------------------*/ - -typedef struct e_curve_t -{ - E_ECC_CURVE curve_id; - int32_t Echar; - char Ea[144]; - char Eb[144]; - char Px[144]; - char Py[144]; - int32_t Epl; - char Pp[176]; - int32_t Eol; - char Eorder[176]; - int32_t key_len; - int32_t irreducible_k1; - int32_t irreducible_k2; - int32_t irreducible_k3; - int32_t GF; -} ECC_CURVE; - -const ECC_CURVE _Curve[] = -{ - { - /* NIST: Curve P-192 : y^2=x^3-ax+b (mod p) */ - CURVE_P_192, - 48, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", /* "000000000000000000000000000000000000000000000003" */ - "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", - "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012", - "07192b95ffc8da78631011ed6b24cdd573f977a11e794811", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", /* "6277101735386680763835789423207666416083908700390324961279" */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", /* "6277101735386680763835789423176059013767194773182842284081" */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* NIST: Curve P-224 : y^2=x^3-ax+b (mod p) */ - CURVE_P_224, - 56, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", /* "00000000000000000000000000000000000000000000000000000003" */ - "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", - "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", - "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "0026959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", /* "0026959946667150639794667015087019625940457807714424391721682722368061" */ - 224, /* key_len */ - 9, - 8, - 3, - CURVE_GF_P - }, - { - /* NIST: Curve P-256 : y^2=x^3-ax+b (mod p) */ - CURVE_P_256, - 64, /* Echar */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", /* "0000000000000000000000000000000000000000000000000000000000000003" */ - "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", - "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", - "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", - 78, /* Epl */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", /* "115792089210356248762697446949407573530086143415290314195533631308867097853951" */ - 78, /* Eol */ - "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", /* "115792089210356248762697446949407573529996955224135760342422259061068512044369" */ - 256, /* key_len */ - 10, - 5, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-384 : y^2=x^3-ax+b (mod p) */ - CURVE_P_384, - 96, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", /* "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", - "aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", - "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", - 116, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", /* "39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319" */ - 116, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", /* "39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643" */ - 384, /* key_len */ - 12, - 3, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-521 : y^2=x^3-ax+b (mod p)*/ - CURVE_P_521, - 131, /* Echar */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", /* "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", - "0c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", - "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", - 157, /* Epl */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151" */ - 157, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449" */ - 521, /* key_len */ - 32, - 32, - 32, - CURVE_GF_P - }, - { - /* NIST: Curve B-163 : y^2+xy=x^3+ax^2+b */ - CURVE_B_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "20a601907b8c953ca1481eb10512f78744a3205fd", - "3f0eba16286a2d57ea0991168d4994637e8343e36", - "0d51fbc6c71a0094fa2cdd545b11c5c0c797324f1", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "40000000000000000000292FE77E70C12A4234C33", /* "5846006549323611672814742442876390689256843201587" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve B-233 : y^2+xy=x^3+ax^2+b */ - CURVE_B_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000001", - "066647ede6c332c7f8c0923bb58213b333b20e9ce4281fe115f7d8f90ad", - "0fac9dfcbac8313bb2139f1bb755fef65bc391f8b36f8f8eb7371fd558b", - "1006a08a41903350678e58528bebf8a0beff867a7ca36716f7e01f81052", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "1000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", /* "6901746346790563787434755862277025555839812737345013555379383634485463" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve B-283 : y^2+xy=x^3+ax^2+b */ - CURVE_B_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000001", - "27b680ac8b8596da5a4af8a19a0303fca97fd7645309fa2a581485af6263e313b79a2f5", - "5f939258db7dd90e1934f8c70b0dfec2eed25b8557eac9c80e2e198f8cdbecd86b12053", - "3676854fe24141cb98fe6d4b20d02b4516ff702350eddb0826779c813f0df45be8112f4", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", /* "7770675568902916283677847627294075626569625924376904889109196526770044277787378692871" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve B-409 : y^2+xy=x^3+ax^2+b */ - CURVE_B_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "021a5c2c8ee9feb5c4b9a753b7b476b7fd6422ef1f3dd674761fa99d6ac27c8a9a197b272822f6cd57a55aa4f50ae317b13545f", - "15d4860d088ddb3496b0c6064756260441cde4af1771d4db01ffe5b34e59703dc255a868a1180515603aeab60794e54bb7996a7", - "061b1cfab6be5f32bbfa78324ed106a7636b9c5a7bd198d0158aa4f5488d08f38514f1fdf4b4f40d2181b3681c364ba0273c706", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "10000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", /* "661055968790248598951915308032771039828404682964281219284648798304157774827374805208143723762179110965979867288366567526771" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve B-571 : y^2+xy=x^3+ax^2+b */ - CURVE_B_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a", - "303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19", - "37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", /* "3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* NIST: Curve K-163 : y^2+xy=x^3+ax^2+b */ - CURVE_K_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "00000000000000000000000000000000000000001", - "2fe13c0537bbc11acaa07d793de4e6d5e5c94eee8", - "289070fb05d38ff58321f2e800536d538ccdaa3d9", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "4000000000000000000020108A2E0CC0D99F8A5EF", /* "5846006549323611672814741753598448348329118574063" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve K-233 : y^2+xy=x^3+ax^2+b */ - CURVE_K_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000001", - "17232ba853a7e731af129f22ff4149563a419c26bf50a4c9d6eefad6126", - "1db537dece819b7f70f555a67c427a8cd9bf18aeb9b56e0c11056fae6a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", /* "3450873173395281893717377931138512760570940988862252126328087024741343" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve K-283 : y^2+xy=x^3+ax^2+b */ - CURVE_K_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000001", - "503213f78ca44883f1a3b8162f188e553cd265f23c1567a16876913b0c2ac2458492836", - "1ccda380f1c9e318d90f95d07e5426fe87e45c0e8184698e45962364e34116177dd2259", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", /* "3885337784451458141838923813647037813284811733793061324295874997529815829704422603873" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve K-409 : y^2+xy=x^3+ax^2+b */ - CURVE_K_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746", - "1e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", /* "330527984395124299475957654016385519914202341482140609642324395022880711289249191050673258457777458014096366590617731358671" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve K-571 : y^2+xy=x^3+ax^2+b */ - CURVE_K_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "26eb7a859923fbc82189631f8103fe4ac9ca2970012d5d46024804801841ca44370958493b205e647da304db4ceb08cbbd1ba39494776fb988b47174dca88c7e2945283a01c8972", - "349dc807f4fbf374f4aeade3bca95314dd58cec9f307a54ffc61efc006d8a2c9d4979c0ac44aea74fbebbb9f772aedcb620b01a7ba7af1b320430c8591984f601cd4c143ef1c7a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "20000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", /* "1932268761508629172347675945465993672149463664853217499328617625725759571144780212268133978522706711834706712800825351461273674974066617311929682421617092503555733685276673" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* Koblitz: Curve secp192k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_192, - 48, /* Echar */ - "00000000000000000000000000000000000000000", - "00000000000000000000000000000000000000003", - "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", - "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", /* p */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", /* n */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp224k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_224, - 56, /* Echar */ - "00000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000005", - "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", - "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", /* p */ - 70, /* Eol */ - "0000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", /* n */ - 224, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp256k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_256, - 64, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000007", - "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", - "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", - 78, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", /* p */ - 78, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", /* n */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP256r1 */ - CURVE_BP_256, - 64, /* Echar */ - "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", /* A */ - "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", /* B */ - "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", /* x */ - "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", /* y */ - 78, /* Epl */ - "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", /* p */ - 78, /* Eol */ - "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", /* q */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP384r1 */ - CURVE_BP_384, - 96, /* Echar */ - "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", /* A */ - "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", /* B */ - "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", /* x */ - "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", /* y */ - 116, /* Epl */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", /* p */ - 116, /* Eol */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", /* q */ - 384, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP512r1 */ - CURVE_BP_512, - 128, /* Echar */ - "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", /* A */ - "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", /* B */ - "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", /* x */ - "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", /* y */ - 156, /* Epl */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", /* p */ - 156, /* Eol */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", /* q */ - 512, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, -}; - -static ECC_CURVE *pCurve; -static ECC_CURVE Curve_Copy; - -static ECC_CURVE *get_curve(E_ECC_CURVE ecc_curve); -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve); -static void run_ecc_codec(CRPT_T *crpt, uint32_t mode); - -static char temp_hex_str[160]; - - -#if ENABLE_DEBUG -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ - int32_t i; - - printf("%s => ", str); - for (i = 0; i < count; i++) - { - printf("0x%08x ", regs[i]); - } - printf("\n"); -} -#else -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ -} -#endif - -static char ch2hex(char ch) -{ - if (ch <= '9') - { - ch = ch - '0'; - } - else if ((ch <= 'z') && (ch >= 'a')) - { - ch = ch - 'a' + 10U; - } - else - { - ch = ch - 'A' + 10U; - } - return ch; -} - -static void Hex2Reg(char input[], uint32_t volatile reg[]) -{ - char hex; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0; - - while (si >= 0) - { - val32 = 0UL; - for (i = 0UL; (i < 8UL) && (si >= 0); i++) - { - hex = ch2hex(input[si]); - val32 |= (uint32_t)hex << (i * 4UL); - si--; - } - reg[ri++] = val32; - } -} - -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift) -{ - uint32_t hex, carry; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0L; - carry = 0UL; - while (si >= 0) - { - val32 = 0UL; - for (i = 0UL; (i < 8UL) && (si >= 0L); i++) - { - hex = (uint32_t)ch2hex(input[si]); - hex <<= shift; - - val32 |= (uint32_t)((hex & 0xFUL) | carry) << (i * 4UL); - carry = (hex >> 4UL) & 0xFUL; - si--; - } - reg[ri++] = val32; - } - if (carry != 0UL) - { - reg[ri] = carry; - } -} - -/** - * @brief Extract specified nibble from an unsigned word in character format. - * For example: - * Suppose val32 is 0x786543210, get_Nth_nibble_char(val32, 3) will return a '3'. - * @param[in] val32 The input unsigned word - * @param[in] idx The Nth nibble to be extracted. - * @return The nibble in character format. - */ -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx) -{ - return hex_char_tbl[(val32 >> (idx * 4U)) & 0xfU ]; -} - - -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]) -{ - int32_t idx, ri; - uint32_t i; - - output[count] = 0U; - idx = count - 1; - - for (ri = 0; idx >= 0; ri++) - { - for (i = 0UL; (i < 8UL) && (idx >= 0); i++) - { - output[idx] = get_Nth_nibble_char(reg[ri], i); - idx--; - } - } -} - -static ECC_CURVE *get_curve(E_ECC_CURVE ecc_curve) -{ - uint32_t i; - ECC_CURVE *ret = NULL; - - for (i = 0UL; i < sizeof(_Curve) / sizeof(ECC_CURVE); i++) - { - if (ecc_curve == _Curve[i].curve_id) - { - memcpy((char *)&Curve_Copy, &_Curve[i], sizeof(ECC_CURVE)); - ret = &Curve_Copy; /* (ECC_CURVE *)&_Curve[i]; */ - } - if (ret != NULL) - { - break; - } - } - return ret; -} - -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve) -{ - int32_t i, ret = 0; - - pCurve = get_curve(ecc_curve); - if (pCurve == NULL) - { - CRPT_DBGMSG("Cannot find curve %d!!\n", ecc_curve); - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_A[i] = 0UL; - crpt->ECC_B[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_N[i] = 0UL; - } - - Hex2Reg(pCurve->Ea, crpt->ECC_A); - Hex2Reg(pCurve->Eb, crpt->ECC_B); - Hex2Reg(pCurve->Px, crpt->ECC_X1); - Hex2Reg(pCurve->Py, crpt->ECC_Y1); - - CRPT_DBGMSG("Key length = %d\n", pCurve->key_len); - dump_ecc_reg("CRPT_ECC_CURVE_A", crpt->ECC_A, 10); - dump_ecc_reg("CRPT_ECC_CURVE_B", crpt->ECC_B, 10); - dump_ecc_reg("CRPT_ECC_POINT_X1", crpt->ECC_X1, 10); - dump_ecc_reg("CRPT_ECC_POINT_Y1", crpt->ECC_Y1, 10); - - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_N[0] = 0x1UL; - crpt->ECC_N[(pCurve->key_len) / 32] |= (1UL << ((pCurve->key_len) % 32)); - crpt->ECC_N[(pCurve->irreducible_k1) / 32] |= (1UL << ((pCurve->irreducible_k1) % 32)); - crpt->ECC_N[(pCurve->irreducible_k2) / 32] |= (1UL << ((pCurve->irreducible_k2) % 32)); - crpt->ECC_N[(pCurve->irreducible_k3) / 32] |= (1UL << ((pCurve->irreducible_k3) % 32)); - } - else - { - Hex2Reg(pCurve->Pp, crpt->ECC_N); - } - } - dump_ecc_reg("CRPT_ECC_CURVE_N", crpt->ECC_N, 10); - return ret; -} - -static int get_nibble_value(char c) -{ - if ((c >= '0') && (c <= '9')) - { - c = c - '0'; - } - - if ((c >= 'a') && (c <= 'f')) - { - c = c - 'a' + (char)10; - } - - if ((c >= 'A') && (c <= 'F')) - { - c = c - 'A' + (char)10; - } - return (int)c; -} - -static int ecc_strcmp(char *s1, char *s2) -{ - char c1, c2; - - while (*s1 == '0') s1++; - while (*s2 == '0') s2++; - - for (; *s1 || *s2; s1++, s2++) - { - if ((*s1 >= 'A') && (*s1 <= 'Z')) - c1 = *s1 + 32; - else - c1 = *s1; - - if ((*s2 >= 'A') && (*s2 <= 'Z')) - c2 = *s2 + 32; - else - c2 = *s2; - - if (c1 != c2) - return 1; - } - return 0; -} - -volatile uint32_t g_ECC_done, g_ECCERR_done; - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief ECC interrupt service routine. User application must invoke this function in - * his CRYPTO_IRQHandler() to let Crypto driver know ECC processing was done. - * @param[in] crpt Reference to Crypto module. - * @return none - */ -void ECC_Complete(CRPT_T *crpt) -{ - if (crpt->INTSTS & CRPT_INTSTS_ECCIF_Msk) - { - g_ECC_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCIF_Msk; - /* printf("ECC done IRQ.\n"); */ - } - - if (crpt->INTSTS & CRPT_INTSTS_ECCEIF_Msk) - { - g_ECCERR_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCEIF_Msk; - /* printf("ECCERRIF is set!!\n"); */ - } -} - -/** - * @brief Check if the private key is located in valid range of curve. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k The input private key. - * @return 1 Is valid. - * @return 0 Is not valid. - * @return -1 Invalid curve. - */ -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]) -{ - uint32_t i; - int ret = -1; - - pCurve = get_curve(ecc_curve); - if (pCurve == NULL) - { - ret = -1; - } - - if (strlen(private_k) < strlen(pCurve->Eorder)) - { - ret = 1; - } - - if (strlen(private_k) > strlen(pCurve->Eorder)) - { - ret = 0; - } - - for (i = 0UL; i < strlen(private_k); i++) - { - if (get_nibble_value(private_k[i]) < get_nibble_value(pCurve->Eorder[i])) - { - ret = 1; - break; - } - if (get_nibble_value(private_k[i]) > get_nibble_value(pCurve->Eorder[i])) - { - ret = 0; - break; - } - } - return ret; -} - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt Reference to Crypto module. - * @param[in] private_k The input private key. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] public_k1 The output public key 1. - * @param[out] public_k2 The output public key 2. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]) -{ - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(private_k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, public_k1); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, public_k2); - } - - return ret; -} - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt Reference to Crypto module. - * @param[out] x1 The x-coordinate of input point. - * @param[out] y1 The y-coordinate of input point. - * @param[in] k The private key - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] x2 The x-coordinate of output point. - * @param[out] y2 The y-coordinate of output point. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]) -{ - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(x1, crpt->ECC_X1); - Hex2Reg(y1, crpt->ECC_Y1); - Hex2Reg(k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, x2); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, y2); - } - - return ret; -} - -/** - * @brief Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k One's own private key. - * @param[in] public_k1 The other party's publick key 1. - * @param[in] public_k2 The other party's publick key 2. - * @param[out] secret_z The ECC CDH secret Z. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]) -{ - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - if ((ecc_curve == CURVE_B_163) || (ecc_curve == CURVE_B_233) || (ecc_curve == CURVE_B_283) || - (ecc_curve == CURVE_B_409) || (ecc_curve == CURVE_B_571) || (ecc_curve == CURVE_K_163)) - { - Hex2RegEx(private_k, crpt->ECC_K, 1); - } - else if ((ecc_curve == CURVE_K_233) || (ecc_curve == CURVE_K_283) || - (ecc_curve == CURVE_K_409) || (ecc_curve == CURVE_K_571)) - { - Hex2RegEx(private_k, crpt->ECC_K, 2); - } - else - { - Hex2Reg(private_k, crpt->ECC_K); - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, secret_z); - } - - return ret; -} - -/** @cond HIDDEN_SYMBOLS */ - -static void run_ecc_codec(CRPT_T *crpt, uint32_t mode) -{ - if ((mode & CRPT_ECC_CTL_ECCOP_Msk) == ECCOP_MODULE) - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - else - { - if (pCurve->GF == (int)CURVE_GF_2M) - { - /* point */ - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | mode | CRPT_ECC_CTL_START_Msk; - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - while (crpt->ECC_STS & CRPT_ECC_STS_BUSY_Msk) - { - } -} -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief ECDSA digital signature generation. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] d The private key. - * @param[in] k The selected random integer. - * @param[out] R R of the (R,S) pair digital signature - * @param[out] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *d, char *k, char *R, char *S) -{ - uint32_t volatile temp_result1[18], temp_result2[18]; - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - /* - * 1. Calculate e = HASH(m), where HASH is a cryptographic hashing algorithm, (i.e. SHA-1) - * (1) Use SHA to calculate e - */ - - /* 2. Select a random integer k form [1, n-1] - * (1) Notice that n is order, not prime modulus or irreducible polynomial function - */ - - /* - * 3. Compute r = x1 (mod n), where (x1, y1) = k * G. If r = 0, go to step 2 - * (1) Write the curve parameter A, B, and curve length M to corresponding registers - * (2) Write the prime modulus or irreducible polynomial function to N registers according - * (3) Write the point G(x, y) to X1, Y1 registers - * (4) Write the random integer k to K register - * (5) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Write the curve order and curve length to N ,M registers according - * (10) Write 0x0 to Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 * - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Read X1 registers to get r - */ - - /* 3-(4) Write the random integer k to K register */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_K); - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* 3-(9) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(10) Write 0x0 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* 3-(15) Read X1 registers to get r */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result1, R); - - /* - * 4. Compute s = k ? 1 } (e + d } r)(mod n). If s = 0, go to step 2 - * (1) Write the curve order to N registers according - * (2) Write 0x1 to Y1 registers - * (3) Write the random integer k to X1 registers according - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set START(CRPT_ECC_CTL[0]) to 1 - * (7) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (8) Read X1 registers to get k^-1 - * (9) Write the curve order and curve length to N ,M registers - * (10) Write r, d to X1, Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Write the curve order to N registers - * (16) Write e to Y1 registers - * (17) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (18) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (19) Set START(CRPT_ECC_CTL[0]) to 1 - * (20) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (21) Write the curve order and curve length to N ,M registers - * (22) Write k^-1 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get s - */ - - /* S/W: GFp_add_mod_order(pCurve->key_len+2, 0, x1, a, R); */ - - /* 4-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write 0x1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 4-(3) Write the random integer k to X1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(7) output = %s\n", temp_hex_str); -#endif - - /* 4-(8) Read X1 registers to get k^-1 */ - - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("k^-1 = %s\n", temp_hex_str); -#endif - - /* 4-(9) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(10) Write r, d to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - } - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - Hex2Reg(d, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(14) output = %s\n", temp_hex_str); -#endif - - /* 4-(15) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(16) Write e to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(20) output = %s\n", temp_hex_str); -#endif - - /* 4-(21) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(22) Write k^-1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(27) Read X1 registers to get s */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result2, S); - - } /* ret == 0 */ - - return ret; -} - -/** - * @brief ECDSA dogotal signature verification. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] public_k1 The public key 1. - * @param[in] public_k2 The public key 2. - * @param[in] R R of the (R,S) pair digital signature - * @param[in] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - * @return -2 Verification failed. - */ -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *public_k1, char *public_k2, char *R, char *S) -{ - uint32_t temp_result1[18], temp_result2[18]; - uint32_t temp_x[18], temp_y[18]; - int32_t i, ret = 0; - - /* - * 1. Verify that r and s are integers in the interval [1, n-1]. If not, the signature is invalid - * 2. Compute e = HASH (m), where HASH is the hashing algorithm in signature generation - * (1) Use SHA to calculate e - */ - - /* - * 3. Compute w = s^-1 (mod n) - * (1) Write the curve order to N registers - * (2) Write 0x1 to Y1 registers - * (3) Write s to X1 registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Read X1 registers to get w - */ - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - /* 3-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(2) Write 0x1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 3-(3) Write s to X1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(S, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - - /* 3-(9) Read X1 registers to get w */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - CRPT_DBGMSG("e = %s\n", message); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("w = %s\n", temp_hex_str); - CRPT_DBGMSG("o = %s (order)\n", pCurve->Eorder); -#endif - - /* - * 4. Compute u1 = e } w (mod n) and u2 = r } w (mod n) - * (1) Write the curve order and curve length to N ,M registers - * (2) Write e, w to X1, Y1 registers - * (3) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (4) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1 registers to get u1 - * (8) Write the curve order and curve length to N ,M registers - * (9) Write r, w to X1, Y1 registers - * (10) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (11) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Read X1 registers to get u2 - */ - - /* 4-(1) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write e, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(7) Read X1 registers to get u1 */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("u1 = %s\n", temp_hex_str); -#endif - - /* 4-(8) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(9) Write r, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(R, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(14) Read X1 registers to get u2 */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("u2 = %s\n", temp_hex_str); -#endif - - /* - * 5. Compute X・ (x1・, y1・) = u1 * G + u2 * Q - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - * (3) Write u1 to K registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1, Y1 registers to get u1*G - * (8) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (9) Write the public key Q(x,y) to X1, Y1 registers - * (10) Write u2 to K registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (15) Write the result data u1*G to X2, Y2 registers - * (16) Set ECCOP(CRPT_ECC_CTL[10:9]) to 10 - * (17) Set START(CRPT_ECC_CTL[0]) to 1 - * (18) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (19) Read X1, Y1 registers to get X・(x1・, y1・) - * (20) Write the curve order and curve length to N ,M registers - * (21) Write x1・ to X1 registers - * (22) Write 0x0 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get x1・ (mod n) - * - * 6. The signature is valid if x1・ = r, otherwise it is invalid - */ - - /* - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - */ - ecc_init_curve(crpt, ecc_curve); - - /* (3) Write u1 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result1[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* (7) Read X1, Y1 registers to get u1*G */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, y = %s\n", temp_hex_str); -#endif - - /* (8) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* (9) Write the public key Q(x,y) to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* (10) Write u2 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - temp_result2[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, y = %s\n", temp_hex_str); -#endif - - /* (14) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* Write the result data u2*Q to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - crpt->ECC_Y1[i] = temp_result2[i]; - } - - /* (15) Write the result data u1*G to X2, Y2 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_x[i]; - crpt->ECC_Y2[i] = temp_y[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_ADD); - - /* (19) Read X1, Y1 registers to get X・(x1・, y1・) */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(19) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(19) y' = %s\n", temp_hex_str); -#endif - - /* (20) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* - * (21) Write x1・ to X1 registers - * (22) Write 0x0 to Y1 registers - */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_x[i]; - crpt->ECC_Y1[i] = 0UL; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(21) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, temp_hex_str); - CRPT_DBGMSG("5-(22) y' = %s\n", temp_hex_str); -#endif - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* (27) Read X1 registers to get x1・ (mod n) */ - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(27) x1' (mod n) = %s\n", temp_hex_str); - - /* 6. The signature is valid if x1・ = r, otherwise it is invalid */ - - /* Compare with test pattern to check if r is correct or not */ - if (ecc_strcmp(temp_hex_str, R) != 0) - { - CRPT_DBGMSG("x1' (mod n) != R Test filed!!\n"); - CRPT_DBGMSG("Signature R [%s] is not matched with expected R [%s]!\n", temp_hex_str, R); - ret = -2; - } - } /* ret == 0 */ - - return ret; -} - -/*@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CRYPTO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_dac.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_dac.c deleted file mode 100644 index 1ed45773952..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_dac.c +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************//** - * @file dac.c - * @version V1.00 - * @brief M480 series DAC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DAC_Driver DAC Driver - @{ -*/ - -/** @addtogroup DAC_EXPORTED_FUNCTIONS DAC Exported Functions - @{ -*/ - -/** - * @brief This function make DAC module be ready to convert. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @param[in] u32TrgSrc Decides the trigger source. Valid values are: - * - \ref DAC_WRITE_DAT_TRIGGER :Write DAC_DAT trigger - * - \ref DAC_SOFTWARE_TRIGGER :Software trigger - * - \ref DAC_LOW_LEVEL_TRIGGER :STDAC pin low level trigger - * - \ref DAC_HIGH_LEVEL_TRIGGER :STDAC pin high level trigger - * - \ref DAC_FALLING_EDGE_TRIGGER :STDAC pin falling edge trigger - * - \ref DAC_RISING_EDGE_TRIGGER :STDAC pin rising edge trigger - * - \ref DAC_TIMER0_TRIGGER :Timer 0 trigger - * - \ref DAC_TIMER1_TRIGGER :Timer 1 trigger - * - \ref DAC_TIMER2_TRIGGER :Timer 2 trigger - * - \ref DAC_TIMER3_TRIGGER :Timer 3 trigger - * - \ref DAC_EPWM0_TRIGGER :EPWM0 trigger - * - \ref DAC_EPWM1_TRIGGER :EPWM1 trigger - * @return None - * @details The DAC conversion can be started by writing DAC_DAT, software trigger or hardware trigger. - * When TRGEN (DAC_CTL[4]) is 0, the data conversion is started by writing DAC_DAT register. - * When TRGEN (DAC_CTL[4]) is 1, the data conversion is started by SWTRG (DAC_SWTRG[0]) is set to 1, - * external STDAC pin, timer event, or EPWM event. - */ -void DAC_Open(DAC_T *dac, - uint32_t u32Ch, - uint32_t u32TrgSrc) -{ - dac->CTL &= ~(DAC_CTL_ETRGSEL_Msk | DAC_CTL_TRGSEL_Msk | DAC_CTL_TRGEN_Msk); - dac->CTL |= (u32TrgSrc | DAC_CTL_DACEN_Msk); -} - -/** - * @brief Disable DAC analog power. - * @param[in] dac Base address of DAC module. - * @param[in] u32Ch Not used in M480 DAC. - * @return None - * @details Disable DAC analog power for saving power consumption. - */ -void DAC_Close(DAC_T *dac, uint32_t u32Ch) -{ - dac->CTL &= (~DAC_CTL_DACEN_Msk); -} - -/** - * @brief Set delay time for DAC to become stable. - * @param[in] dac Base address of DAC module. - * @param[in] u32Delay Decides the DAC conversion settling time, the range is from 0~(1023/PCLK1*1000000) micro seconds. - * @return Real DAC conversion settling time (micro second). - * @details For example, DAC controller clock speed is 160MHz and DAC conversion setting time is 1 us, SETTLET (DAC_TCTL[9:0]) value must be greater than 0xA0. - * @note User needs to write appropriate value to meet DAC conversion settling time base on PCLK (APB clock) speed. - */ -uint32_t DAC_SetDelayTime(DAC_T *dac, uint32_t u32Delay) -{ - - dac->TCTL = ((CLK_GetPCLK1Freq() * u32Delay / 1000000UL) & 0x3FFUL); - - return ((dac->TCTL) * 1000000UL / CLK_GetPCLK1Freq()); -} - - - -/*@}*/ /* end of group DAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group DAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_eadc.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_eadc.c deleted file mode 100644 index f7ef09d97ba..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_eadc.c +++ /dev/null @@ -1,143 +0,0 @@ -/**************************************************************************//** - * @file eadc.c - * @version V2.00 - * @brief M480 series EADC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_FUNCTIONS EADC Exported Functions - @{ -*/ - -/** - * @brief This function make EADC_module be ready to convert. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32InputMode Decides the input mode. - * - \ref EADC_CTL_DIFFEN_SINGLE_END :Single end input mode. - * - \ref EADC_CTL_DIFFEN_DIFFERENTIAL :Differential input type. - * @return None - * @details This function is used to set analog input mode and enable A/D Converter. - * Before starting A/D conversion function, ADCEN bit (EADC_CTL[0]) should be set to 1. - * @note - */ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode) -{ - eadc->CTL &= (~EADC_CTL_DIFFEN_Msk); - - eadc->CTL |= (u32InputMode | EADC_CTL_ADCEN_Msk); - while (!(eadc->PWRM & EADC_PWRM_PWUPRDY_Msk)) {} -} - -/** - * @brief Disable EADC_module. - * @param[in] eadc The pointer of the specified EADC module.. - * @return None - * @details Clear ADCEN bit (EADC_CTL[0]) to disable A/D converter analog circuit power consumption. - */ -void EADC_Close(EADC_T *eadc) -{ - eadc->CTL &= ~EADC_CTL_ADCEN_Msk; -} - -/** - * @brief Configure the sample control logic module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerSrc Decides the trigger source. Valid values are: - * - \ref EADC_SOFTWARE_TRIGGER : Disable trigger - * - \ref EADC_FALLING_EDGE_TRIGGER : STADC pin falling edge trigger - * - \ref EADC_RISING_EDGE_TRIGGER : STADC pin rising edge trigger - * - \ref EADC_FALLING_RISING_EDGE_TRIGGER : STADC pin both falling and rising edge trigger - * - \ref EADC_ADINT0_TRIGGER : EADC ADINT0 interrupt EOC pulse trigger - * - \ref EADC_ADINT1_TRIGGER : EADC ADINT1 interrupt EOC pulse trigger - * - \ref EADC_TIMER0_TRIGGER : Timer0 overflow pulse trigger - * - \ref EADC_TIMER1_TRIGGER : Timer1 overflow pulse trigger - * - \ref EADC_TIMER2_TRIGGER : Timer2 overflow pulse trigger - * - \ref EADC_TIMER3_TRIGGER : Timer3 overflow pulse trigger - * - \ref EADC_EPWM0TG0_TRIGGER : EPWM0TG0 trigger - * - \ref EADC_EPWM0TG1_TRIGGER : EPWM0TG1 trigger - * - \ref EADC_EPWM0TG2_TRIGGER : EPWM0TG2 trigger - * - \ref EADC_EPWM0TG3_TRIGGER : EPWM0TG3 trigger - * - \ref EADC_EPWM0TG4_TRIGGER : EPWM0TG4 trigger - * - \ref EADC_EPWM0TG5_TRIGGER : EPWM0TG5 trigger - * - \ref EADC_EPWM1TG0_TRIGGER : EPWM1TG0 trigger - * - \ref EADC_EPWM1TG1_TRIGGER : EPWM1TG1 trigger - * - \ref EADC_EPWM1TG2_TRIGGER : EPWM1TG2 trigger - * - \ref EADC_EPWM1TG3_TRIGGER : EPWM1TG3 trigger - * - \ref EADC_EPWM1TG4_TRIGGER : EPWM1TG4 trigger - * - \ref EADC_EPWM1TG5_TRIGGER : EPWM1TG5 trigger - * - \ref EADC_BPWM0TG_TRIGGER : BPWM0TG trigger - * - \ref EADC_BPWM1TG_TRIGGER : BPWM1TG trigger - * @param[in] u32Channel Specifies the sample module channel, valid value are from 0 to 15. - * @return None - * @details Each of ADC control logic modules 0~15 which is configurable for ADC converter channel EADC_CH0~15 and trigger source. - * sample module 16~18 is fixed for ADC channel 16, 17, 18 input sources as band-gap voltage, temperature sensor, and battery power (VBAT). - */ -void EADC_ConfigSampleModule(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerSrc, \ - uint32_t u32Channel) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_EXTFEN_Msk | EADC_SCTL_EXTREN_Msk | EADC_SCTL_TRGSEL_Msk | EADC_SCTL_CHSEL_Msk); - eadc->SCTL[u32ModuleNum] |= (u32TriggerSrc | u32Channel); -} - - -/** - * @brief Set trigger delay time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerDelayTime Decides the trigger delay time, valid range are between 0~0xFF. - * @param[in] u32DelayClockDivider Decides the trigger delay clock divider. Valid values are: - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_1 : Trigger delay clock frequency is ADC_CLK/1 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_2 : Trigger delay clock frequency is ADC_CLK/2 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_4 : Trigger delay clock frequency is ADC_CLK/4 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_16 : Trigger delay clock frequency is ADC_CLK/16 - * @return None - * @details User can configure the trigger delay time by setting TRGDLYCNT (EADC_SCTLn[15:8], n=0~15) and TRGDLYDIV (EADC_SCTLn[7:6], n=0~15). - * Trigger delay time = (u32TriggerDelayTime) x Trigger delay clock period. - */ -void EADC_SetTriggerDelayTime(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerDelayTime, \ - uint32_t u32DelayClockDivider) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_TRGDLYDIV_Msk | EADC_SCTL_TRGDLYCNT_Msk); - eadc->SCTL[u32ModuleNum] |= ((u32TriggerDelayTime << EADC_SCTL_TRGDLYCNT_Pos) | u32DelayClockDivider); -} - -/** - * @brief Set ADC extend sample time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @param[in] u32ExtendSampleTime Decides the extend sampling time, the range is from 0~255 ADC clock. Valid value are from 0 to 0xFF. - * @return None - * @details When A/D converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, - * user can extend A/D sampling time after trigger source is coming to get enough sampling time. - */ -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime) -{ - eadc->SCTL[u32ModuleNum] &= ~EADC_SCTL_EXTSMPT_Msk; - - eadc->SCTL[u32ModuleNum] |= (u32ExtendSampleTime << EADC_SCTL_EXTSMPT_Pos); - -} - -/*@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ebi.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ebi.c deleted file mode 100644 index 2a2bd28de6e..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ebi.c +++ /dev/null @@ -1,195 +0,0 @@ -/**************************************************************************//** - * @file ebi.c - * @version V3.00 - * @brief M480 series External Bus Interface(EBI) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Initialize EBI for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32DataWidth Data bus width. Valid values are: - * - \ref EBI_BUSWIDTH_8BIT - * - \ref EBI_BUSWIDTH_16BIT - * @param[in] u32TimingClass Default timing configuration. Valid values are: - * - \ref EBI_TIMING_FASTEST - * - \ref EBI_TIMING_VERYFAST - * - \ref EBI_TIMING_FAST - * - \ref EBI_TIMING_NORMAL - * - \ref EBI_TIMING_SLOW - * - \ref EBI_TIMING_VERYSLOW - * - \ref EBI_TIMING_SLOWEST - * @param[in] u32BusMode Set EBI bus operate mode. Valid values are: - * - \ref EBI_OPMODE_NORMAL - * - \ref EBI_OPMODE_CACCESS - * - \ref EBI_OPMODE_ADSEPARATE - * @param[in] u32CSActiveLevel CS is active High/Low. Valid values are: - * - \ref EBI_CS_ACTIVE_HIGH - * - \ref EBI_CS_ACTIVE_LOW - * - * @return None - * - * @details This function is used to open specify EBI bank with different bus width, timing setting and \n - * active level of CS pin to access EBI device. - * @note Write Buffer Enable(WBUFEN) and Extend Time Of ALE(TALE) are only available in EBI bank0 control register. - */ -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (uint32_t)u32Bank * 0x10U; - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (uint32_t)u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)( u32Index0 ); - volatile uint32_t *pu32EBITCTL = (uint32_t *)( u32Index1 ); - - if(u32DataWidth == EBI_BUSWIDTH_8BIT) - { - *pu32EBICTL &= ~EBI_CTL_DW16_Msk; - } - else - { - *pu32EBICTL |= EBI_CTL_DW16_Msk; - } - - *pu32EBICTL |= u32BusMode; - - switch(u32TimingClass) - { - case EBI_TIMING_FASTEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_VERYFAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_FAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_NORMAL: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_SLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_VERYSLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_4 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_SLOWEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_8 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - default: - *pu32EBICTL &= ~EBI_CTL_EN_Msk; - break; - } -} - -/** - * @brief Disable EBI on specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * - * @return None - * - * @details This function is used to close specify EBI function. - */ -void EBI_Close(uint32_t u32Bank) -{ - uint32_t u32Index = (uint32_t)&EBI->CTL0 + u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)( u32Index ); - - *pu32EBICTL &= ~EBI_CTL_EN_Msk; -} - -/** - * @brief Set EBI Bus Timing for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32TimingConfig Configure EBI timing settings, includes TACC, TAHD, W2X and R2R setting. - * @param[in] u32MclkDiv Divider for MCLK. Valid values are: - * - \ref EBI_MCLKDIV_1 - * - \ref EBI_MCLKDIV_2 - * - \ref EBI_MCLKDIV_4 - * - \ref EBI_MCLKDIV_8 - * - \ref EBI_MCLKDIV_16 - * - \ref EBI_MCLKDIV_32 - * - \ref EBI_MCLKDIV_64 - * - \ref EBI_MCLKDIV_128 - * - * @return None - * - * @details This function is used to configure specify EBI bus timing for access EBI device. - */ -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (uint32_t)u32Bank * 0x10U; - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (uint32_t)u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)( u32Index0 ); - volatile uint32_t *pu32EBITCTL = (uint32_t *)( u32Index1 ); - - *pu32EBICTL = (*pu32EBICTL & ~EBI_CTL_MCLKDIV_Msk) | (u32MclkDiv << EBI_CTL_MCLKDIV_Pos); - *pu32EBITCTL = u32TimingConfig; -} - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ecap.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ecap.c deleted file mode 100644 index f0a9e772809..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_ecap.c +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************//** - * @file ecap.c - * @version V3.00 - * @brief Enhanced Input Capture Timer (ECAP) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_FUNCTIONS ECAP Exported Functions - @{ -*/ - -/** - * @brief Enable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @param[in] u32FuncMask Input capture function select - * - \ref ECAP_DISABLE_COMPARE - * - \ref ECAP_COMPARE_FUNCTION - * @return None - * @details This macro enable input capture function and select compare and reload function. - */ -void ECAP_Open(ECAP_T* ecap, uint32_t u32FuncMask) -{ - /* Clear Input capture mode*/ - ecap->CTL0 = ecap->CTL0 & ~(ECAP_CTL0_CMPEN_Msk); - - /* Enable Input Capture and set mode */ - ecap->CTL0 |= ECAP_CTL0_CAPEN_Msk | (u32FuncMask); -} - - - -/** - * @brief Disable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @return None - * @details This macro disable input capture function. - */ -void ECAP_Close(ECAP_T* ecap) -{ - /* Disable Input Capture*/ - ecap->CTL0 &= ~ECAP_CTL0_CAPEN_Msk; -} - -/** - * @brief This macro is used to enable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel Mask - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will enable the input channel_n interrupt. - */ -void ECAP_EnableINT(ECAP_T* ecap, uint32_t u32Mask) -{ - /* Enable input channel interrupt */ - ecap->CTL0 |= (u32Mask); - - /* Enable NVIC ECAP IRQ */ - if(ecap == (ECAP_T*)ECAP0) - { - NVIC_EnableIRQ((IRQn_Type)ECAP0_IRQn); - } - else - { - NVIC_EnableIRQ((IRQn_Type)ECAP1_IRQn); - } -} - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel number - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will disable the input channel_n interrupt. - */ -void ECAP_DisableINT(ECAP_T* ecap, uint32_t u32Mask) -{ - /* Disable input channel interrupt */ - ecap->CTL0 &= ~(u32Mask); - - /* Disable NVIC ECAP IRQ */ - if(ecap == (ECAP_T*)ECAP0) - { - NVIC_DisableIRQ((IRQn_Type)ECAP0_IRQn); - } - else - { - NVIC_DisableIRQ((IRQn_Type)ECAP1_IRQn); - } -} - -/*@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ECAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_emac.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_emac.c deleted file mode 100644 index 18fdfc699bf..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_emac.c +++ /dev/null @@ -1,1179 +0,0 @@ -/**************************************************************************//** - * @file emac.c - * @version V1.00 - * @brief M480 EMAC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EMAC_Driver EMAC Driver - @{ -*/ - - -/* Below are structure, definitions, static variables used locally by EMAC driver and does not want to parse by doxygen unless HIDDEN_SYMBOLS is defined */ -/** @cond HIDDEN_SYMBOLS */ - -/** @addtogroup EMAC_EXPORTED_CONSTANTS EMAC Exported Constants - @{ -*/ - -/* PHY Register Description */ -#define PHY_CNTL_REG 0x00UL /*!< PHY control register address */ -#define PHY_STATUS_REG 0x01UL /*!< PHY status register address */ -#define PHY_ID1_REG 0x02UL /*!< PHY ID1 register */ -#define PHY_ID2_REG 0x03UL /*!< PHY ID2 register */ -#define PHY_ANA_REG 0x04UL /*!< PHY auto-negotiation advertisement register */ -#define PHY_ANLPA_REG 0x05UL /*!< PHY auto-negotiation link partner availability register */ -#define PHY_ANE_REG 0x06UL /*!< PHY auto-negotiation expansion register */ - -/* PHY Control Register */ -#define PHY_CNTL_RESET_PHY (1UL << 15UL) -#define PHY_CNTL_DR_100MB (1UL << 13UL) -#define PHY_CNTL_ENABLE_AN (1UL << 12UL) -#define PHY_CNTL_POWER_DOWN (1UL << 11UL) -#define PHY_CNTL_RESTART_AN (1UL << 9UL) -#define PHY_CNTL_FULLDUPLEX (1UL << 8UL) - -/* PHY Status Register */ -#define PHY_STATUS_AN_COMPLETE (1UL << 5UL) -#define PHY_STATUS_LINK_VALID (1UL << 2UL) - -/* PHY Auto-negotiation Advertisement Register */ -#define PHY_ANA_DR100_TX_FULL (1UL << 8UL) -#define PHY_ANA_DR100_TX_HALF (1UL << 7UL) -#define PHY_ANA_DR10_TX_FULL (1UL << 6UL) -#define PHY_ANA_DR10_TX_HALF (1UL << 5UL) -#define PHY_ANA_IEEE_802_3_CSMA_CD (1UL << 0UL) - -/* PHY Auto-negotiation Link Partner Advertisement Register */ -#define PHY_ANLPA_DR100_TX_FULL (1UL << 8UL) -#define PHY_ANLPA_DR100_TX_HALF (1UL << 7UL) -#define PHY_ANLPA_DR10_TX_FULL (1UL << 6UL) -#define PHY_ANLPA_DR10_TX_HALF (1UL << 5UL) - -/* EMAC Tx/Rx descriptor's owner bit */ -#define EMAC_DESC_OWN_EMAC 0x80000000UL /*!< Set owner to EMAC */ -#define EMAC_DESC_OWN_CPU 0x00000000UL /*!< Set owner to CPU */ - -/* Rx Frame Descriptor Status */ -#define EMAC_RXFD_RTSAS 0x0080UL /*!< Time Stamp Available */ -#define EMAC_RXFD_RP 0x0040UL /*!< Runt Packet */ -#define EMAC_RXFD_ALIE 0x0020UL /*!< Alignment Error */ -#define EMAC_RXFD_RXGD 0x0010UL /*!< Receiving Good packet received */ -#define EMAC_RXFD_PTLE 0x0008UL /*!< Packet Too Long Error */ -#define EMAC_RXFD_CRCE 0x0002UL /*!< CRC Error */ -#define EMAC_RXFD_RXINTR 0x0001UL /*!< Interrupt on receive */ - -/* Tx Frame Descriptor's Control bits */ -#define EMAC_TXFD_TTSEN 0x08UL /*!< Tx time stamp enable */ -#define EMAC_TXFD_INTEN 0x04UL /*!< Tx interrupt enable */ -#define EMAC_TXFD_CRCAPP 0x02UL /*!< Append CRC */ -#define EMAC_TXFD_PADEN 0x01UL /*!< Padding mode enable */ - -/* Tx Frame Descriptor Status */ -#define EMAC_TXFD_TXINTR 0x0001UL /*!< Interrupt on Transmit */ -#define EMAC_TXFD_DEF 0x0002UL /*!< Transmit deferred */ -#define EMAC_TXFD_TXCP 0x0008UL /*!< Transmission Completion */ -#define EMAC_TXFD_EXDEF 0x0010UL /*!< Exceed Deferral */ -#define EMAC_TXFD_NCS 0x0020UL /*!< No Carrier Sense Error */ -#define EMAC_TXFD_TXABT 0x0040UL /*!< Transmission Abort */ -#define EMAC_TXFD_LC 0x0080UL /*!< Late Collision */ -#define EMAC_TXFD_TXHA 0x0100UL /*!< Transmission halted */ -#define EMAC_TXFD_PAU 0x0200UL /*!< Paused */ -#define EMAC_TXFD_SQE 0x0400UL /*!< SQE error */ -#define EMAC_TXFD_TTSAS 0x0800UL /*!< Time Stamp available */ - -/*@}*/ /* end of group EMAC_EXPORTED_CONSTANTS */ - -/** @addtogroup EMAC_EXPORTED_TYPEDEF EMAC Exported Type Defines - @{ -*/ - -/** Tx/Rx buffer descriptor structure */ -typedef struct -{ - uint32_t u32Status1; /*!< Status word 1 */ - uint32_t u32Data; /*!< Pointer to data buffer */ - uint32_t u32Status2; /*!< Status word 2 */ - uint32_t u32Next; /*!< Pointer to next descriptor */ - uint32_t u32Backup1; /*!< For backup descriptor fields over written by time stamp */ - uint32_t u32Backup2; /*!< For backup descriptor fields over written by time stamp */ -} EMAC_DESCRIPTOR_T; - -/** Tx/Rx buffer structure */ -typedef struct -{ - uint8_t au8Buf[EMAC_MAX_PKT_SIZE]; -} EMAC_FRAME_T; - -/*@}*/ /* end of group EMAC_EXPORTED_TYPEDEF */ - -/* local variables */ -static volatile EMAC_DESCRIPTOR_T rx_desc[EMAC_RX_DESC_SIZE]; -static volatile EMAC_FRAME_T rx_buf[EMAC_RX_DESC_SIZE]; -static volatile EMAC_DESCRIPTOR_T tx_desc[EMAC_TX_DESC_SIZE]; -static volatile EMAC_FRAME_T tx_buf[EMAC_TX_DESC_SIZE]; - - -static uint32_t u32CurrentTxDesc, u32NextTxDesc, u32CurrentRxDesc; -static uint32_t s_u32EnableTs = 0UL; - -static void EMAC_MdioWrite(uint32_t u32Reg, uint32_t u32Addr, uint32_t u32Data); -static uint32_t EMAC_MdioRead(uint32_t u32Reg, uint32_t u32Addr); -static void EMAC_TxDescInit(void); -static void EMAC_RxDescInit(void); -static uint32_t EMAC_Subsec2Nsec(uint32_t subsec); -static uint32_t EMAC_Nsec2Subsec(uint32_t nsec); - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Write PHY register - * @param[in] u32Reg PHY register number - * @param[in] u32Addr PHY address, this address is board dependent - * @param[in] u32Data data to write to PHY register - * @return None - */ -static void EMAC_MdioWrite(uint32_t u32Reg, uint32_t u32Addr, uint32_t u32Data) -{ - /* Set data register */ - EMAC->MIIMDAT = u32Data ; - /* Set PHY address, PHY register address, busy bit and write bit */ - EMAC->MIIMCTL = u32Reg | (u32Addr << 8) | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_WRITE_Msk | EMAC_MIIMCTL_MDCON_Msk; - - /* Wait write complete by polling busy bit. */ - while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk) - { - ; - } - -} - -/** - * @brief Read PHY register - * @param[in] u32Reg PHY register number - * @param[in] u32Addr PHY address, this address is board dependent - * @return Value read from PHY register - */ -static uint32_t EMAC_MdioRead(uint32_t u32Reg, uint32_t u32Addr) -{ - /* Set PHY address, PHY register address, busy bit */ - EMAC->MIIMCTL = u32Reg | (u32Addr << EMAC_MIIMCTL_PHYADDR_Pos) | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_MDCON_Msk; - - /* Wait read complete by polling busy bit */ - while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk) - { - ; - } - - /* Get return data */ - return EMAC->MIIMDAT; -} - -/** - * @brief Initialize PHY chip, check for the auto-negotiation result. - * @param None - * @return None - */ -void EMAC_PhyInit(void) -{ - uint32_t reg; - uint32_t i = 0UL; - - /* Reset Phy Chip */ - EMAC_MdioWrite(PHY_CNTL_REG, EMAC_PHY_ADDR, PHY_CNTL_RESET_PHY); - - /* Wait until reset complete */ - while (1) - { - reg = EMAC_MdioRead(PHY_CNTL_REG, EMAC_PHY_ADDR) ; - - if ((reg & PHY_CNTL_RESET_PHY) == 0UL) - { - break; - } - } - - while (!(EMAC_MdioRead(PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID)) - { - if (i++ > 10000UL) /* Cable not connected */ - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - break; - } - } - - if (i <= 10000UL) - { - /* Configure auto negotiation capability */ - EMAC_MdioWrite(PHY_ANA_REG, EMAC_PHY_ADDR, PHY_ANA_DR100_TX_FULL | - PHY_ANA_DR100_TX_HALF | - PHY_ANA_DR10_TX_FULL | - PHY_ANA_DR10_TX_HALF | - PHY_ANA_IEEE_802_3_CSMA_CD); - /* Restart auto negotiation */ - EMAC_MdioWrite(PHY_CNTL_REG, EMAC_PHY_ADDR, EMAC_MdioRead(PHY_CNTL_REG, EMAC_PHY_ADDR) | PHY_CNTL_RESTART_AN); - - /* Wait for auto-negotiation complete */ - while (!(EMAC_MdioRead(PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_AN_COMPLETE)) - { - ; - } - - /* Check link valid again. Some PHYs needs to check result after link valid bit set */ - while (!(EMAC_MdioRead(PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID)) - { - ; - } - - /* Check link partner capability */ - reg = EMAC_MdioRead(PHY_ANLPA_REG, EMAC_PHY_ADDR) ; - - if (reg & PHY_ANLPA_DR100_TX_FULL) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - } - else if (reg & PHY_ANLPA_DR100_TX_HALF) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - } - else if (reg & PHY_ANLPA_DR10_TX_FULL) - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - } - else - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - } - } -} - -/** - * @brief Initial EMAC Tx descriptors and get Tx descriptor base address - * @param None - * @return None - */ -static void EMAC_TxDescInit(void) -{ - uint32_t i; - - /* Get Frame descriptor's base address. */ - EMAC->TXDSA = (uint32_t)&tx_desc[0]; - u32NextTxDesc = u32CurrentTxDesc = (uint32_t)&tx_desc[0]; - - for (i = 0UL; i < EMAC_TX_DESC_SIZE; i++) - { - - if (s_u32EnableTs) - { - tx_desc[i].u32Status1 = EMAC_TXFD_PADEN | EMAC_TXFD_CRCAPP | EMAC_TXFD_INTEN; - } - else - { - tx_desc[i].u32Status1 = EMAC_TXFD_PADEN | EMAC_TXFD_CRCAPP | EMAC_TXFD_INTEN | EMAC_TXFD_TTSEN; - } - - tx_desc[i].u32Data = (uint32_t)((uint32_t)&tx_buf[i]); - tx_desc[i].u32Backup1 = tx_desc[i].u32Data; - tx_desc[i].u32Status2 = 0UL; - tx_desc[i].u32Next = (uint32_t)&tx_desc[(i + 1UL) % EMAC_TX_DESC_SIZE]; - tx_desc[i].u32Backup2 = tx_desc[i].u32Next; - - } - -} - - -/** - * @brief Initial EMAC Rx descriptors and get Rx descriptor base address - * @param None - * @return None - */ -static void EMAC_RxDescInit(void) -{ - - uint32_t i; - - /* Get Frame descriptor's base address. */ - EMAC->RXDSA = (uint32_t)&rx_desc[0]; - u32CurrentRxDesc = (uint32_t)&rx_desc[0]; - - for (i = 0UL; i < EMAC_RX_DESC_SIZE; i++) - { - rx_desc[i].u32Status1 = EMAC_DESC_OWN_EMAC; - rx_desc[i].u32Data = (uint32_t)((uint32_t)&rx_buf[i]); - rx_desc[i].u32Backup1 = rx_desc[i].u32Data; - rx_desc[i].u32Status2 = 0UL; - rx_desc[i].u32Next = (uint32_t)&rx_desc[(i + 1UL) % EMAC_RX_DESC_SIZE]; - rx_desc[i].u32Backup2 = rx_desc[i].u32Next; - } - -} - -/** - * @brief Convert subsecond value to nano second - * @param[in] subsec Subsecond value to be convert - * @return Nano second - */ -static uint32_t EMAC_Subsec2Nsec(uint32_t subsec) -{ - /* 2^31 subsec == 10^9 ns */ - uint64_t i; - i = 1000000000ull * (uint64_t)subsec; - i >>= 31; - return ((uint32_t)i); -} - -/** - * @brief Convert nano second to subsecond value - * @param[in] nsec Nano second to be convert - * @return Subsecond - */ -static uint32_t EMAC_Nsec2Subsec(uint32_t nsec) -{ - /* 10^9 ns = 2^31 subsec */ - uint64_t i; - i = (1ull << 31) * nsec; - i /= 1000000000ull; - return ((uint32_t)i); -} - - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - - - -/** @endcond HIDDEN_SYMBOLS */ - - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Initialize EMAC interface, including descriptors, MAC address, and PHY. - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - * @note This API configures EMAC to receive all broadcast and multicast packets, but could configure to other settings with - * \ref EMAC_ENABLE_RECV_BCASTPKT, \ref EMAC_DISABLE_RECV_BCASTPKT, \ref EMAC_ENABLE_RECV_MCASTPKT, and \ref EMAC_DISABLE_RECV_MCASTPKT - * @note Receive(RX) and transmit(TX) are not enabled yet, application must call \ref EMAC_ENABLE_RX and \ref EMAC_ENABLE_TX to - * enable receive and transmit function. - */ -void EMAC_Open(uint8_t *pu8MacAddr) -{ - /* Enable transmit and receive descriptor */ - EMAC_TxDescInit(); - EMAC_RxDescInit(); - - /* Set the CAM Control register and the MAC address value */ - EMAC_SetMacAddr(pu8MacAddr); - - /* Configure the MAC interrupt enable register. */ - EMAC->INTEN = EMAC_INTEN_RXIEN_Msk | - EMAC_INTEN_TXIEN_Msk | - EMAC_INTEN_RXGDIEN_Msk | - EMAC_INTEN_TXCPIEN_Msk | - EMAC_INTEN_RXBEIEN_Msk | - EMAC_INTEN_TXBEIEN_Msk | - EMAC_INTEN_RDUIEN_Msk | - EMAC_INTEN_TSALMIEN_Msk | - EMAC_INTEN_WOLIEN_Msk; - - /* Configure the MAC control register. */ - EMAC->CTL = EMAC_CTL_STRIPCRC_Msk | - EMAC_CTL_RMIIEN_Msk; - - /* Accept packets for us and all broadcast and multicast packets */ - EMAC->CAMCTL = EMAC_CAMCTL_CMPEN_Msk | - EMAC_CAMCTL_AMP_Msk | - EMAC_CAMCTL_ABP_Msk; - - /* Limit the max receive frame length to 1514 + 4 */ - EMAC->MRFL = EMAC_MAX_PKT_SIZE; -} - -/** - * @brief This function stop all receive and transmit activity and disable MAC interface - * @param None - * @return None - */ - -void EMAC_Close(void) -{ - EMAC->CTL |= EMAC_CTL_RST_Msk; - - while (EMAC->CTL & EMAC_CTL_RST_Msk) {} -} - -/** - * @brief Set the device MAC address - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - */ -void EMAC_SetMacAddr(uint8_t *pu8MacAddr) -{ - EMAC_EnableCamEntry(0UL, pu8MacAddr); - -} - -/** - * @brief Fill a CAM entry for MAC address comparison. - * @param[in] u32Entry MAC entry to fill. Entry 0 is used to store device MAC address, do not overwrite the setting in it. - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - */ -void EMAC_EnableCamEntry(uint32_t u32Entry, uint8_t pu8MacAddr[]) -{ - uint32_t u32Lsw, u32Msw; - uint32_t reg; - u32Lsw = (uint32_t)(((uint32_t)pu8MacAddr[4] << 24) | - ((uint32_t)pu8MacAddr[5] << 16)); - u32Msw = (uint32_t)(((uint32_t)pu8MacAddr[0] << 24) | - ((uint32_t)pu8MacAddr[1] << 16) | - ((uint32_t)pu8MacAddr[2] << 8) | - (uint32_t)pu8MacAddr[3]); - - reg = (uint32_t)&EMAC->CAM0M + u32Entry * 2UL * 4UL; - *(uint32_t volatile *)reg = u32Msw; - reg = (uint32_t)&EMAC->CAM0L + u32Entry * 2UL * 4UL; - *(uint32_t volatile *)reg = u32Lsw; - - EMAC->CAMEN |= (1UL << u32Entry); -} - -/** - * @brief Disable a specified CAM entry - * @param[in] u32Entry CAM entry to be disabled - * @return None - */ -void EMAC_DisableCamEntry(uint32_t u32Entry) -{ - EMAC->CAMEN &= ~(1UL << u32Entry); -} - - -/** - * @brief Receive an Ethernet packet - * @param[in] pu8Data Pointer to a buffer to store received packet (4 byte CRC removed) - * @param[in] pu32Size Received packet size (without 4 byte CRC). - * @return Packet receive success or not - * @retval 0 No packet available for receive - * @retval 1 A packet is received - * @note Return 0 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_RecvPkt(uint8_t *pu8Data, uint32_t *pu32Size) -{ - EMAC_DESCRIPTOR_T *desc; - uint32_t status, reg; - uint32_t u32Count = 0UL; - - /* Clear Rx interrupt flags */ - reg = EMAC->INTSTS; - EMAC->INTSTS = reg & 0xFFFFUL; /* Clear all RX related interrupt status */ - - if (reg & EMAC_INTSTS_RXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - - /* Get Rx Frame Descriptor */ - desc = (EMAC_DESCRIPTOR_T *)u32CurrentRxDesc; - - /* If we reach last recv Rx descriptor, leave the loop */ - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - - status = desc->u32Status1 >> 16; - - /* If Rx frame is good, process received frame */ - if (status & EMAC_RXFD_RXGD) - { - /* lower 16 bit in descriptor status1 stores the Rx packet length */ - *pu32Size = desc->u32Status1 & 0xFFFFUL; - memcpy(pu8Data, (uint8_t *)desc->u32Backup1, *pu32Size); - u32Count = 1UL; - } - else - { - /* Save Error status if necessary */ - if (status & EMAC_RXFD_RP) {} - - if (status & EMAC_RXFD_ALIE) {} - - if (status & EMAC_RXFD_PTLE) {} - - if (status & EMAC_RXFD_CRCE) {} - } - } - } - - return (u32Count); -} - -/** - * @brief Receive an Ethernet packet and the time stamp while it's received - * @param[out] pu8Data Pointer to a buffer to store received packet (4 byte CRC removed) - * @param[out] pu32Size Received packet size (without 4 byte CRC). - * @param[out] pu32Sec Second value while packet received - * @param[out] pu32Nsec Nano second value while packet received - * @return Packet receive success or not - * @retval 0 No packet available for receive - * @retval 1 A packet is received - * @note Return 0 doesn't guarantee the packet will be sent and received successfully. - * @note Largest Ethernet packet is 1514 bytes after stripped CRC, application must give - * a buffer large enough to store such packet - */ -uint32_t EMAC_RecvPktTS(uint8_t *pu8Data, uint32_t *pu32Size, uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - EMAC_DESCRIPTOR_T *desc; - uint32_t status, reg; - uint32_t u32Count = 0UL; - - /* Clear Rx interrupt flags */ - reg = EMAC->INTSTS; - EMAC->INTSTS = reg & 0xFFFFUL; /* Clear all Rx related interrupt status */ - - if (reg & EMAC_INTSTS_RXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - - /* Get Rx Frame Descriptor */ - desc = (EMAC_DESCRIPTOR_T *)u32CurrentRxDesc; - - /* If we reach last recv Rx descriptor, leave the loop */ - if (EMAC->CRXDSA != (uint32_t)desc) - { - if ((desc->u32Status1 | EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - - status = desc->u32Status1 >> 16; - - /* If Rx frame is good, process received frame */ - if (status & EMAC_RXFD_RXGD) - { - /* lower 16 bit in descriptor status1 stores the Rx packet length */ - *pu32Size = desc->u32Status1 & 0xFFFFUL; - memcpy(pu8Data, (uint8_t *)desc->u32Backup1, *pu32Size); - - *pu32Sec = desc->u32Next; /* second stores in descriptor's NEXT field */ - *pu32Nsec = EMAC_Subsec2Nsec(desc->u32Data); /* Sub nano second store in DATA field */ - - u32Count = 1UL; - } - else - { - /* Save Error status if necessary */ - if (status & EMAC_RXFD_RP) {} - - if (status & EMAC_RXFD_ALIE) {} - - if (status & EMAC_RXFD_PTLE) {} - - if (status & EMAC_RXFD_CRCE) {} - } - } - } - } - - return (u32Count); -} - -/** - * @brief Clean up process after a packet is received - * @param None - * @return None - * @details EMAC Rx interrupt service routine \b must call this API to release the resource use by receive process - * @note Application can only call this function once every time \ref EMAC_RecvPkt or \ref EMAC_RecvPktTS returns 1 - */ -void EMAC_RecvPktDone(void) -{ - EMAC_DESCRIPTOR_T *desc; - /* Get Rx Frame Descriptor */ - desc = (EMAC_DESCRIPTOR_T *)u32CurrentRxDesc; - - /* Restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - - /* Change ownership to DMA for next use */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get Next Frame Descriptor pointer to process */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Rx descriptor */ - u32CurrentRxDesc = (uint32_t)desc; - - EMAC_TRIGGER_RX(); -} - - -/** - * @brief Send an Ethernet packet - * @param[in] pu8Data Pointer to a buffer holds the packet to transmit - * @param[in] u32Size Packet size (without 4 byte CRC). - * @return Packet transmit success or not - * @retval 0 Transmit failed due to descriptor unavailable. - * @retval 1 Packet is copied to descriptor and triggered to transmit. - * @note Return 1 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_SendPkt(uint8_t *pu8Data, uint32_t u32Size) -{ - EMAC_DESCRIPTOR_T *desc; - uint32_t status; - uint32_t ret = 0UL; - /* Get Tx frame descriptor & data pointer */ - desc = (EMAC_DESCRIPTOR_T *)u32NextTxDesc; - - status = desc->u32Status1; - - /* Check descriptor ownership */ - if ((status & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - memcpy((uint8_t *)desc->u32Data, pu8Data, u32Size); - - /* Set Tx descriptor transmit byte count */ - desc->u32Status2 = u32Size; - - /* Change descriptor ownership to EMAC */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get next Tx descriptor */ - u32NextTxDesc = (uint32_t)(desc->u32Next); - - /* Trigger EMAC to send the packet */ - EMAC_TRIGGER_TX(); - ret = 1UL; - } - - return (ret); -} - - -/** - * @brief Clean up process after packet(s) are sent - * @param None - * @return Number of packet sent between two function calls - * @details EMAC Tx interrupt service routine \b must call this API or \ref EMAC_SendPktDoneTS to - * release the resource use by transmit process - */ -uint32_t EMAC_SendPktDone(void) -{ - EMAC_DESCRIPTOR_T *desc; - uint32_t status, reg; - uint32_t last_tx_desc; - uint32_t u32Count = 0UL; - - reg = EMAC->INTSTS; - /* Clear Tx interrupt flags */ - EMAC->INTSTS = reg & (0xFFFF0000UL & ~EMAC_INTSTS_TSALMIF_Msk); - - - if (reg & EMAC_INTSTS_TXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Process the descriptor(s). */ - last_tx_desc = EMAC->CTXDSA ; - /* Get our first descriptor to process */ - desc = (EMAC_DESCRIPTOR_T *) u32CurrentTxDesc; - - do - { - /* Descriptor ownership is still EMAC, so this packet haven't been send. */ - if (desc->u32Status1 & EMAC_DESC_OWN_EMAC) - { - break; - } - - /* Get Tx status stored in descriptor */ - status = desc->u32Status2 >> 16UL; - - if (status & EMAC_TXFD_TXCP) - { - u32Count++; - } - else - { - /* Do nothing here on error. */ - if (status & EMAC_TXFD_TXABT) {} - - if (status & EMAC_TXFD_DEF) {} - - if (status & EMAC_TXFD_PAU) {} - - if (status & EMAC_TXFD_EXDEF) {} - - if (status & EMAC_TXFD_NCS) {} - - if (status & EMAC_TXFD_SQE) {} - - if (status & EMAC_TXFD_LC) {} - - if (status & EMAC_TXFD_TXHA) {} - } - - /* restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - /* go to next descriptor in link */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - } - while (last_tx_desc != (uint32_t)desc); /* If we reach last sent Tx descriptor, leave the loop */ - - /* Save last processed Tx descriptor */ - u32CurrentTxDesc = (uint32_t)desc; - } - - return (u32Count); -} - -/** - * @brief Clean up process after a packet is sent, and get the time stamp while packet is sent - * @param[in] pu32Sec Second value while packet sent - * @param[in] pu32Nsec Nano second value while packet sent - * @return If a packet sent successfully - * @retval 0 No packet sent successfully, and the value in *pu32Sec and *pu32Nsec are meaningless - * @retval 1 A packet sent successfully, and the value in *pu32Sec and *pu32Nsec is the time stamp while packet sent - * @details EMAC Tx interrupt service routine \b must call this API or \ref EMAC_SendPktDone to - * release the resource use by transmit process - */ -uint32_t EMAC_SendPktDoneTS(uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - - EMAC_DESCRIPTOR_T *desc; - uint32_t status, reg; - uint32_t u32Count = 0UL; - - reg = EMAC->INTSTS; - /* Clear Tx interrupt flags */ - EMAC->INTSTS = reg & (0xFFFF0000UL & ~EMAC_INTSTS_TSALMIF_Msk); - - - if (reg & EMAC_INTSTS_TXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Process the descriptor. - Get our first descriptor to process */ - desc = (EMAC_DESCRIPTOR_T *) u32CurrentTxDesc; - - /* Descriptor ownership is still EMAC, so this packet haven't been send. */ - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - /* Get Tx status stored in descriptor */ - status = desc->u32Status2 >> 16UL; - - if (status & EMAC_TXFD_TXCP) - { - u32Count = 1UL; - *pu32Sec = desc->u32Next; /* second stores in descriptor's NEXT field */ - *pu32Nsec = EMAC_Subsec2Nsec(desc->u32Data); /* Sub nano second store in DATA field */ - } - else - { - /* Do nothing here on error. */ - if (status & EMAC_TXFD_TXABT) {} - - if (status & EMAC_TXFD_DEF) {} - - if (status & EMAC_TXFD_PAU) {} - - if (status & EMAC_TXFD_EXDEF) {} - - if (status & EMAC_TXFD_NCS) {} - - if (status & EMAC_TXFD_SQE) {} - - if (status & EMAC_TXFD_LC) {} - - if (status & EMAC_TXFD_TXHA) {} - } - - /* restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - /* go to next descriptor in link */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Tx descriptor */ - u32CurrentTxDesc = (uint32_t)desc; - } - } - - return (u32Count); -} - -/** - * @brief Enable IEEE1588 time stamp function and set current time - * @param[in] u32Sec Second value - * @param[in] u32Nsec Nano second value - * @return None - */ -void EMAC_EnableTS(uint32_t u32Sec, uint32_t u32Nsec) -{ - double f; - uint32_t reg; - EMAC->TSCTL = EMAC_TSCTL_TSEN_Msk; - EMAC->UPDSEC = u32Sec; /* Assume current time is 0 sec + 0 nano sec */ - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - - /* PTP source clock is 160MHz (Real chip using PLL). Each tick is 6.25ns - Assume we want to set each tick to 100ns. - Increase register = (100 * 2^31) / (10^9) = 214.71 =~ 215 = 0xD7 - Addend register = 2^32 * tick_freq / (160MHz), where tick_freq = (2^31 / 215) MHz - From above equation, addend register = 2^63 / (160M * 215) ~= 268121280 = 0xFFB34C0 - So: - EMAC->TSIR = 0xD7; - EMAC->TSAR = 0x1E70C600; */ - f = (100.0 * 2147483648.0) / (1000000000.0) + 0.5; - EMAC->TSINC = (reg = (uint32_t)f); - f = (double)9223372036854775808.0 / ((double)(CLK_GetHCLKFreq()) * (double)reg); - EMAC->TSADDEND = (uint32_t)f; - EMAC->TSCTL |= (EMAC_TSCTL_TSUPDATE_Msk | EMAC_TSCTL_TSIEN_Msk | EMAC_TSCTL_TSMODE_Msk); /* Fine update */ -} - -/** - * @brief Disable IEEE1588 time stamp function - * @param None - * @return None - */ -void EMAC_DisableTS(void) -{ - EMAC->TSCTL = 0UL; -} - -/** - * @brief Get current time stamp - * @param[out] pu32Sec Current second value - * @param[out] pu32Nsec Current nano second value - * @return None - */ -void EMAC_GetTime(uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - /* Must read TSLSR firstly. Hardware will preserve TSMSR value at the time TSLSR read. */ - *pu32Nsec = EMAC_Subsec2Nsec(EMAC->TSSUBSEC); - *pu32Sec = EMAC->TSSEC; -} - -/** - * @brief Set current time stamp - * @param[in] u32Sec Second value - * @param[in] u32Nsec Nano second value - * @return None - */ -void EMAC_SetTime(uint32_t u32Sec, uint32_t u32Nsec) -{ - /* Disable time stamp counter before update time value (clear EMAC_TSCTL_TSIEN_Msk) */ - EMAC->TSCTL = EMAC_TSCTL_TSEN_Msk; - EMAC->UPDSEC = u32Sec; - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - EMAC->TSCTL |= (EMAC_TSCTL_TSIEN_Msk | EMAC_TSCTL_TSMODE_Msk); - -} - -/** - * @brief Enable alarm function and set alarm time - * @param[in] u32Sec Second value to trigger alarm - * @param[in] u32Nsec Nano second value to trigger alarm - * @return None - */ -void EMAC_EnableAlarm(uint32_t u32Sec, uint32_t u32Nsec) -{ - - EMAC->ALMSEC = u32Sec; - EMAC->ALMSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - EMAC->TSCTL |= EMAC_TSCTL_TSALMEN_Msk; - -} - -/** - * @brief Disable alarm function - * @param None - * @return None - */ -void EMAC_DisableAlarm(void) -{ - - EMAC->TSCTL &= ~EMAC_TSCTL_TSALMEN_Msk; - -} - -/** - * @brief Add a offset to current time - * @param[in] u32Neg Offset is negative value (u32Neg == 1) or positive value (u32Neg == 0). - * @param[in] u32Sec Second value to add to current time - * @param[in] u32Nsec Nano second value to add to current time - * @return None - */ -void EMAC_UpdateTime(uint32_t u32Neg, uint32_t u32Sec, uint32_t u32Nsec) -{ - EMAC->UPDSEC = u32Sec; - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - - if (u32Neg) - { - EMAC->UPDSUBSEC |= BIT31; /* Set bit 31 indicates this is a negative value */ - } - - EMAC->TSCTL |= EMAC_TSCTL_TSUPDATE_Msk; - -} - -/** - * @brief Check Ethernet link status - * @param None - * @return Current link status, could be one of following value. - * - \ref EMAC_LINK_DOWN - * - \ref EMAC_LINK_100F - * - \ref EMAC_LINK_100H - * - \ref EMAC_LINK_10F - * - \ref EMAC_LINK_10H - * @note This API should be called regularly to sync EMAC setting with real connection status - */ -uint32_t EMAC_CheckLinkStatus(void) -{ - uint32_t reg, ret = EMAC_LINK_DOWN; - - /* Check link valid again */ - if (EMAC_MdioRead(PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID) - { - /* Check link partner capability */ - reg = EMAC_MdioRead(PHY_ANLPA_REG, EMAC_PHY_ADDR) ; - - if (reg & PHY_ANLPA_DR100_TX_FULL) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_100F; - } - else if (reg & PHY_ANLPA_DR100_TX_HALF) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_100H; - } - else if (reg & PHY_ANLPA_DR10_TX_FULL) - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_10F; - } - else - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_10H; - } - } - - return ret; -} - -/** - * @brief Fill a MAC address to list and enable. - * @param A MAC address - * @return The CAM index - * @retval -1 Failed to fill the MAC address. - * @retval 0~(EMAC_CAMENTRY_NB-1) The index number of entry location. - */ -int32_t EMAC_FillCamEntry(uint8_t pu8MacAddr[]) -{ - uint32_t *EMAC_CAMxM; - uint32_t *EMAC_CAMxL; - int32_t index; - uint8_t mac[6]; - - for (index = 0; index < EMAC_CAMENTRY_NB; index ++) - { - EMAC_CAMxM = (uint32_t *)((uint32_t)&EMAC->CAM0M + (index * 8)); - EMAC_CAMxL = (uint32_t *)((uint32_t)&EMAC->CAM0L + (index * 8)); - - mac[0] = (*EMAC_CAMxM >> 24) & 0xff; - mac[1] = (*EMAC_CAMxM >> 16) & 0xff; - mac[2] = (*EMAC_CAMxM >> 8) & 0xff; - mac[3] = (*EMAC_CAMxM) & 0xff; - mac[4] = (*EMAC_CAMxL >> 24) & 0xff; - mac[5] = (*EMAC_CAMxL >> 16) & 0xff; - - if (memcmp(mac, pu8MacAddr, sizeof(mac)) == 0) - { - goto exit_emac_fillcamentry; - } - - if (*EMAC_CAMxM == 0 && *EMAC_CAMxL == 0) - { - break; - } - } - - if (index < EMAC_CAMENTRY_NB) - { - EMAC_EnableCamEntry(index, pu8MacAddr); - goto exit_emac_fillcamentry; - } - - return -1; - -exit_emac_fillcamentry: - - return index; -} - -/** - * @brief Send an Ethernet packet - * @param[in] u32Size Packet size (without 4 byte CRC). - * @return Packet transmit success or not - * @retval 0 Transmit failed due to descriptor unavailable. - * @retval 1 Triggered to transmit. - * @note Return 1 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_SendPktWoCopy(uint32_t u32Size) -{ - EMAC_DESCRIPTOR_T *desc; - uint32_t status; - uint32_t ret = 0UL; - /* Get Tx frame descriptor & data pointer */ - desc = (EMAC_DESCRIPTOR_T *)u32NextTxDesc; - - status = desc->u32Status1; - - /* Check descriptor ownership */ - if ((status & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - /* Set Tx descriptor transmit byte count */ - desc->u32Status2 = u32Size; - - /* Change descriptor ownership to EMAC */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get next Tx descriptor */ - u32NextTxDesc = (uint32_t)(desc->u32Next); - - /* Trigger EMAC to send the packet */ - EMAC_TRIGGER_TX(); - ret = 1UL; - } - - return (ret); -} - -/** - * @brief Get avaiable TX buffer address - * @param None - * @return An avaiable TX buffer. - * @note This API should be called before EMAC_SendPkt_WoCopy calling. Caller will do data-copy. - */ -uint8_t *EMAC_ClaimFreeTXBuf(void) -{ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)u32NextTxDesc; - - if (desc->u32Status1 & EMAC_DESC_OWN_EMAC) - { - return (NULL); - } - else - { - return (uint8_t *)desc->u32Data; - } -} - -/** - * @brief Get data length of avaiable RX buffer. - * @param None - * @return An data length of avaiable RX buffer. - * @note This API should be called before EMAC_RecvPktDone_WoTrigger calling. Caller will do data-copy. - */ -uint32_t EMAC_GetAvailRXBufSize(uint8_t **ppuDataBuf) -{ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)u32CurrentRxDesc; - - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - uint32_t status = desc->u32Status1 >> 16; - - /* It is good and no CRC error. */ - if ((status & EMAC_RXFD_RXGD) && !(status & EMAC_RXFD_CRCE)) - { - *ppuDataBuf = (uint8_t *)desc->u32Backup1; - return desc->u32Status1 & 0xFFFFUL; - } - else - { - // Drop it - EMAC_RecvPktDone(); - } - } - - return 0; -} - - -/** - * @brief Clean up process after a packet is received. - * @param None - * @return None - * @details Caller must call the function to release the resource. - * @note Application can only call this function once every time \ref EMAC_RecvPkt or \ref EMAC_RecvPktTS returns 1 - * @note This function is without doing EMAC_TRIGGER_RX. - */ -void EMAC_RecvPktDoneWoRxTrigger(void) -{ - EMAC_DESCRIPTOR_T *desc; - /* Get Rx Frame Descriptor */ - desc = (EMAC_DESCRIPTOR_T *)u32CurrentRxDesc; - - /* Restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - - /* Change ownership to DMA for next use */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get Next Frame Descriptor pointer to process */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Rx descriptor */ - u32CurrentRxDesc = (uint32_t)desc; -} - - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EMAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_epwm.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_epwm.c deleted file mode 100644 index e082fa5dba8..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_epwm.c +++ /dev/null @@ -1,1699 +0,0 @@ -/**************************************************************************//** - * @file epwm.c - * @version V3.00 - * $Revision: 3 $ - * @brief M480 series EPWM driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - - -/** @addtogroup EPWM_EXPORTED_FUNCTIONS EPWM Exported Functions - @{ -*/ - -/** - * @brief Configure EPWM capture and get the nearest unit time. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure EPWM capture and get the nearest unit time. - */ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32Src; - uint32_t u32EPWMClockSrc; - uint32_t u32NearestUnitTimeNsec; - uint32_t u16Prescale = 1U, u16CNR = 0xFFFFU; - - if(epwm == EPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM0SEL_Msk; - } - else /* (epwm == EPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM1SEL_Msk; - } - - if(u32Src == 0U) - { - /* clock source is from PLL clock */ - u32EPWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if(epwm == EPWM0) - { - u32EPWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (epwm == EPWM1) */ - { - u32EPWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - u32EPWMClockSrc /= 1000U; - for(u16Prescale = 1U; u16Prescale <= 0x1000U; u16Prescale++) - { - uint32_t u32Exit = 0U; - u32NearestUnitTimeNsec = (1000000U * u16Prescale) / u32EPWMClockSrc; - if(u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if(u16Prescale == 0x1000U) /* limit to the maximum unit time(nano second) */ - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - if(!((1000000U * (u16Prescale + 1U) > (u32NearestUnitTimeNsec * u32EPWMClockSrc)))) - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - } - else - { - u32Exit = 1U; - } - if (u32Exit == 1U) - { - break; - } - else {} - } - - /* convert to real register value */ - /* every two channels share a prescaler */ - u16Prescale -= 1U; - EPWM_SET_PRESCALER(epwm, u32ChannelNum, u16Prescale); - - /* set EPWM to down count type(edge aligned) */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~(EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1U))) | (1UL << (u32ChannelNum << 1U)); - /* set EPWM to auto-reload mode */ - (epwm)->CTL1 &= ~(EPWM_CTL1_CNTMODE0_Msk << u32ChannelNum); - EPWM_SET_CNR(epwm, u32ChannelNum, u16CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure EPWM generator and get the nearest frequency in edge aligned(up counter type) auto-reload mode - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since every two channels, (0 & 1), (2 & 3), shares a prescaler. Call this API to configure EPWM frequency may affect - * existing frequency of other channel. - * @note This function is used for initial stage. - * To change duty cycle later, it should get the configured period value and calculate the new comparator value. - */ -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32Src; - uint32_t u32EPWMClockSrc; - uint32_t i; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - if(epwm == EPWM0) - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM0SEL_Msk; - } - else /* (epwm == EPWM1) */ - { - u32Src = CLK->CLKSEL2 & CLK_CLKSEL2_EPWM1SEL_Msk; - } - - if(u32Src == 0U) - { - /* clock source is from PLL clock */ - u32EPWMClockSrc = CLK_GetPLLClockFreq(); - } - else - { - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - if(epwm == EPWM0) - { - u32EPWMClockSrc = CLK_GetPCLK0Freq(); - } - else /* (epwm == EPWM1) */ - { - u32EPWMClockSrc = CLK_GetPCLK1Freq(); - } - } - - for(u32Prescale = 1U; u32Prescale < 0xFFFU; u32Prescale++) /* prescale could be 0~0xFFF */ - { - i = (u32EPWMClockSrc / u32Frequency) / u32Prescale; - /* If target value is larger than CNR, need to use a larger prescaler */ - if(i < (0x10000U)) - { - u32CNR = i; - break; - } - } - /* Store return value here 'cos we're gonna change u16Prescale & u16CNR to the real value to fill into register */ - i = u32EPWMClockSrc / (u32Prescale * u32CNR); - - /* convert to real register value */ - /* every two channels share a prescaler */ - u32Prescale -= 1U; - EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescale); - /* set EPWM to up counter type(edge aligned) and auto-reload mode */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~((EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1U))|((1UL << EPWM_CTL1_CNTMODE0_Pos) << u32ChannelNum))); - - u32CNR -= 1U; - EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR); - EPWM_SET_CMR(epwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1U) / 100U); - - (epwm)->WGCTL0 = ((epwm)->WGCTL0 & ~((EPWM_WGCTL0_PRDPCTL0_Msk | EPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1U))) | \ - ((uint32_t)EPWM_OUTPUT_HIGH << ((u32ChannelNum << 1U) + (uint32_t)EPWM_WGCTL0_ZPCTL0_Pos)); - (epwm)->WGCTL1 = ((epwm)->WGCTL1 & ~((EPWM_WGCTL1_CMPDCTL0_Msk | EPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1U))) | \ - ((uint32_t)EPWM_OUTPUT_LOW << ((u32ChannelNum << 1U) + (uint32_t)EPWM_WGCTL1_CMPUCTL0_Pos)); - - return(i); -} - -/** - * @brief Start EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to start EPWM module. - */ -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN |= u32ChannelMask; -} - -/** - * @brief Stop EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM module. - */ -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for(i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if(u32ChannelMask & (1UL << i)) - { - (epwm)->PERIOD[i] = 0U; - } - } -} - -/** - * @brief Stop EPWM generation immediately by clear channel enable bit - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM generation immediately by clear channel enable bit. - */ -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN &= ~u32ChannelMask; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref EPWM_TRG_ADC_EVEN_ZERO - * - \ref EPWM_TRG_ADC_EVEN_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_UP - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_ODD_ZERO - * - \ref EPWM_TRG_ADC_ODD_PERIOD - * - \ref EPWM_TRG_ADC_ODD_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_ODD_COMPARE_UP - * - \ref EPWM_TRG_ADC_ODD_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_DOWN - * @return None - * @details This function is used to enable selected channel to trigger ADC. - */ -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if(u32ChannelNum < 4U) - { - (epwm)->EADCTS0 &= ~((EPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3U)); - (epwm)->EADCTS0 |= ((EPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCTS1 &= ~((EPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4U) << 3U)); - (epwm)->EADCTS1 |= ((EPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4U) << 3U)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger ADC. - */ -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - if(u32ChannelNum < 4U) - { - (epwm)->EADCTS0 &= ~(EPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3U)); - } - else - { - (epwm)->EADCTS1 &= ~(EPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4U) << 3U)); - } -} - -/** - * @brief Enable and configure trigger ADC prescale - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32Prescale ADC prescale. Valid values are between 0 to 0xF. - * @param[in] u32PrescaleCnt ADC prescale counter. Valid values are between 0 to 0xF. - * @retval 0 Success. - * @retval -1 Failed. - * @details This function is used to enable and configure trigger ADC prescale. - * @note User can configure only when ADC trigger prescale is disabled. - * @note ADC prescale counter must less than ADC prescale. - */ -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt) -{ - /* User can write only when PSCENn(n = 0 ~ 5) is 0 */ - if ((epwm)->EADCPSCCTL & (1UL << u32ChannelNum)) - return (-1); - - if(u32ChannelNum < 4UL) - { - (epwm)->EADCPSC0 = ((epwm)->EADCPSC0 & ~((EPWM_EADCPSC0_EADCPSC0_Msk) << (u32ChannelNum << 3))) | \ - (u32Prescale << (u32ChannelNum << 3)); - (epwm)->EADCPSCNT0 = ((epwm)->EADCPSCNT0 & ~((EPWM_EADCPSCNT0_PSCNT0_Msk) << (u32ChannelNum << 3))) | \ - (u32PrescaleCnt << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCPSC1 = ((epwm)->EADCPSC1 & ~((EPWM_EADCPSC1_EADCPSC4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32Prescale << ((u32ChannelNum - 4UL) << 3)); - (epwm)->EADCPSCNT1 = ((epwm)->EADCPSCNT1 & ~((EPWM_EADCPSCNT1_PSCNT4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32PrescaleCnt << ((u32ChannelNum - 4UL) << 3)); - } - - (epwm)->EADCPSCCTL |= EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum; - - return 0; -} - -/** - * @brief Disable Trigger ADC prescale function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable trigger ADC prescale. - */ -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->EADCPSCCTL &= ~(EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum); -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag. - */ -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->STATUS = (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get EPWM trigger ADC to start of conversion flag for specified channel. - */ -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum))?1UL:0UL); -} - -/** - * @brief Enable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger DAC. Combination of following conditions: - * - \ref EPWM_TRIGGER_DAC_ZERO - * - \ref EPWM_TRIGGER_DAC_PERIOD - * - \ref EPWM_TRIGGER_DAC_COMPARE_UP - * - \ref EPWM_TRIGGER_DAC_COMPARE_DOWN - * @return None - * @details This function is used to enable selected channel to trigger DAC. - */ -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->DACTRGEN |= (u32Condition << u32ChannelNum); -} - -/** - * @brief Disable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger DAC. - */ -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->DACTRGEN &= ~((EPWM_TRIGGER_DAC_ZERO | EPWM_TRIGGER_DAC_PERIOD | EPWM_TRIGGER_DAC_COMPARE_UP | \ - EPWM_TRIGGER_DAC_COMPARE_DOWN) << u32ChannelNum); -} - -/** - * @brief Clear selected channel trigger DAC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. This parameter is not used - * @param[in] u32Condition The condition to trigger DAC. This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger DAC flag. - */ -void EPWM_ClearDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->STATUS = EPWM_STATUS_DACTRGF_Msk; -} - -/** - * @brief Get selected channel trigger DAC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. This parameter is not used - * @retval 0 The specified channel trigger DAC to start of conversion flag is not set - * @retval 1 The specified channel trigger DAC to start of conversion flag is set - * @details This function is used to get selected channel trigger DAC flag. - */ -uint32_t EPWM_GetDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & EPWM_STATUS_DACTRGF_Msk)?1UL:0UL); -} - -/** - * @brief This function enable fault brake of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * @param[in] u32LevelMask Output high or low while fault brake occurs, each bit represent the level of a channel - * while fault brake occurs. Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32BrakeSource Fault brake source, could be one of following source - * - \ref EPWM_FB_EDGE_ADCRM - * - \ref EPWM_FB_EDGE_ACMP0 - * - \ref EPWM_FB_EDGE_ACMP1 - * - \ref EPWM_FB_EDGE_BKP0 - * - \ref EPWM_FB_EDGE_BKP1 - * - \ref EPWM_FB_EDGE_SYS_CSS - * - \ref EPWM_FB_EDGE_SYS_BOD - * - \ref EPWM_FB_EDGE_SYS_RAM - * - \ref EPWM_FB_EDGE_SYS_COR - * - \ref EPWM_FB_LEVEL_ADCRM - * - \ref EPWM_FB_LEVEL_ACMP0 - * - \ref EPWM_FB_LEVEL_ACMP1 - * - \ref EPWM_FB_LEVEL_BKP0 - * - \ref EPWM_FB_LEVEL_BKP1 - * - \ref EPWM_FB_LEVEL_SYS_CSS - * - \ref EPWM_FB_LEVEL_SYS_BOD - * - \ref EPWM_FB_LEVEL_SYS_RAM - * - \ref EPWM_FB_LEVEL_SYS_COR - * @return None - * @details This function is used to enable fault brake of selected channel(s). - * The write-protection function should be disabled before using this function. - */ -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource) -{ - uint32_t i; - - for(i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if(u32ChannelMask & (1UL << i)) - { - if((u32BrakeSource == EPWM_FB_EDGE_SYS_CSS) || (u32BrakeSource == EPWM_FB_EDGE_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_EDGE_SYS_RAM) || (u32BrakeSource == EPWM_FB_EDGE_SYS_COR) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_CSS) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_RAM) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_COR)) - { - (epwm)->BRKCTL[i >> 1U] |= (u32BrakeSource & (EPWM_BRKCTL0_1_SYSEBEN_Msk | EPWM_BRKCTL0_1_SYSLBEN_Msk)); - (epwm)->FAILBRK |= (u32BrakeSource & 0xFU); - } - else - { - (epwm)->BRKCTL[i >> 1U] |= u32BrakeSource; - } - } - - if(u32LevelMask & (1UL << i)) - { - if((i & 0x1U) == 0U) - { - /* set brake action as high level for even channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3U) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as high level for odd channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3U) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - else - { - if((i & 0x1U) == 0U) - { - /* set brake action as low level for even channel */ - (epwm)->BRKCTL[i >> 1U] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1U] |= ((2U) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as low level for odd channel */ - (epwm)->BRKCTL[i >> 1U] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1U] |= ((2U) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - } -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s). - */ -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN |= u32ChannelMask; - (epwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s). - */ -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN &= ~u32ChannelMask; - (epwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enable EPWM output generation of selected channel(s). - */ -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disable EPWM output generation of selected channel(s). - */ -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @param[in] u32RisingFirst The capture order is rising, falling first. Every two channels share the same setting. Valid values are TRUE and FALSE. - * @param[in] u32Mode Captured data transferred by PDMA interrupt type. It could be either - * - \ref EPWM_CAPTURE_PDMA_RISING_LATCH - * - \ref EPWM_CAPTURE_PDMA_FALLING_LATCH - * - \ref EPWM_CAPTURE_PDMA_RISING_FALLING_LATCH - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - * @note This function can only selects even or odd channel of pairs to do PDMA transfer. - */ -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode) -{ - uint32_t u32IsOddCh; - u32IsOddCh = u32ChannelNum & 0x1U; - (epwm)->PDMACTL = ((epwm)->PDMACTL & ~((EPWM_PDMACTL_CHSEL0_1_Msk | EPWM_PDMACTL_CAPORD0_1_Msk | EPWM_PDMACTL_CAPMOD0_1_Msk) << ((u32ChannelNum >> 1U) << 3U))) | \ - (((u32IsOddCh << EPWM_PDMACTL_CHSEL0_1_Pos) | (u32RisingFirst << EPWM_PDMACTL_CAPORD0_1_Pos) | \ - u32Mode | EPWM_PDMACTL_CHEN0_1_Msk) << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Disables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - */ -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->PDMACTL &= ~(EPWM_PDMACTL_CHEN0_1_Msk << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Enable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Duration Dead zone length in EPWM clock count, valid values are between 0~0xFFF, but 0 means there is no Dead zone. - * @return None - * @details This function is used to enable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration) -{ - /* every two channels share the same setting */ - (epwm)->DTCTL[(u32ChannelNum) >> 1U] &= ~EPWM_DTCTL0_1_DTCNT_Msk; - (epwm)->DTCTL[(u32ChannelNum) >> 1U] |= EPWM_DTCTL0_1_DTEN_Msk | u32Duration; -} - -/** - * @brief Disable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - */ -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - /* every two channels shares the same setting */ - (epwm)->DTCTL[(u32ChannelNum) >> 1U] &= ~EPWM_DTCTL0_1_DTEN_Msk; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((((epwm)->CAPIF & (EPWM_CAPIF_CFLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1) | \ - (((epwm)->CAPIF & (EPWM_CAPIF_CRLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL)); -} -/** - * @brief Enable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref EPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (epwm)->INTEN0 |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel. - */ -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((uint32_t)(EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | EPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel. - */ -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = (EPWM_INTSTS0_CMPUIF0_Msk | EPWM_INTSTS0_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((EPWM_INTSTS0_CMPDIF0_Msk | EPWM_INTSTS0_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief This function enable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to enable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 |= (0x7UL << u32BrakeSource); -} - -/** - * @brief This function disable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to disable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 &= ~(0x7UL << u32BrakeSource); -} - -/** - * @brief This function clear fault brake interrupt of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to clear fault brake interrupt of selected source. - * The write-protection function should be disabled before using this function. - */ -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTSTS1 = (0x3fUL << u32BrakeSource); -} - -/** - * @brief This function get fault brake interrupt flag of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source, could be either - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * @details This function is used to get fault brake interrupt flag of selected source. - */ -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - return (((epwm)->INTSTS1 & (0x3fUL << u32BrakeSource)) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - */ -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (epwm)->INTEN0 |= ((1UL << EPWM_INTEN0_PIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable period interrupt of selected channel. - */ -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((1UL << EPWM_INTEN0_PIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear period interrupt of selected channel. - */ -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = ((1UL << EPWM_INTSTS0_PIF0_Pos) << u32ChannelNum); -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel. - */ -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((1UL << EPWM_INTSTS0_PIF0_Pos) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable zero interrupt of selected channel. - */ -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 |= ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable zero interrupt of selected channel. - */ -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear zero interrupt of selected channel. - */ -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Zero interrupt flag of specified channel - * @retval 0 Zero interrupt did not occur - * @retval 1 Zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - */ -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntFlagCnt Interrupt flag counter. Valid values are between 0~65535. - * @param[in] u32IntAccSrc Interrupt flag accumulator source selection. - * - \ref EPWM_IFA_ZERO_POINT - * - \ref EPWM_IFA_PERIOD_POINT - * - \ref EPWM_IFA_COMPARE_UP_COUNT_POINT - * - \ref EPWM_IFA_COMPARE_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable interrupt flag accumulator of selected channel. - */ -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc) -{ - (epwm)->IFA[u32ChannelNum] = (((epwm)->IFA[u32ChannelNum] & ~((EPWM_IFA0_IFACNT_Msk | EPWM_IFA0_IFASEL_Msk))) | \ - (EPWM_IFA0_IFAEN_Msk | (u32IntAccSrc << EPWM_IFA0_IFASEL_Pos) | u32IntFlagCnt) ); -} - -/** - * @brief Disable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to Disable interrupt flag accumulator of selected channel. - */ -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] = ((epwm)->IFA[u32ChannelNum] & ~(EPWM_IFA0_IFAEN_Msk)); -} - -/** - * @brief Enable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Clear interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTSTS = (1UL << (u32ChannelNum)); -} - -/** - * @brief Get interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 Accumulator interrupt did not occur - * @retval 1 Accumulator interrupt occurred - * @details This function is used to Get interrupt flag accumulator interrupt of selected channel. - */ -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->AINTSTS & (1UL << (u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Enable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] |= EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Disable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] &= ~EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Clear free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear free trigger duty interrupt flag of selected channel. - */ -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FTCI = ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1U)); -} - -/** - * @brief Get free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Free trigger duty interrupt did not occur - * @retval 1 Free trigger duty interrupt occurred - * @details This function is used to get free trigger duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FTCI & ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1U))) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Configure synchronization phase of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32SyncSrc EPWM synchronize source selection. - * - \ref EPWM_SYNC_OUT_FROM_SYNCIN_SWSYNC - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_ZERO - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_COMPARATOR - * - \ref EPWM_SYNC_OUT_DISABLE - * @param[in] u32Direction Phase direction. Control EPWM counter count decrement or increment after synchronizing. - * - \ref EPWM_PHS_DIR_DECREMENT - * - \ref EPWM_PHS_DIR_INCREMENT - * @param[in] u32StartPhase Synchronous start phase value. Valid values are between 0~65535. - * @return None - * @details This function is used to configure synchronization phase of selected channel. - * @note Every two channels share the same setting. - */ -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase) -{ - /* every two channels shares the same setting */ - u32ChannelNum >>= 1U; - (epwm)->SYNC = (((epwm)->SYNC & ~(((3UL << EPWM_SYNC_SINSRC0_Pos) << (u32ChannelNum << 1U)) | ((1UL << EPWM_SYNC_PHSDIR0_Pos) << u32ChannelNum))) | \ - (u32Direction << EPWM_SYNC_PHSDIR0_Pos << u32ChannelNum) | ((u32SyncSrc << EPWM_SYNC_SINSRC0_Pos) << (u32ChannelNum << 1U))); - (epwm)->PHS[(u32ChannelNum)] = u32StartPhase; -} - - -/** - * @brief Enable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for(i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if(u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC |= ((1UL << EPWM_SYNC_PHSEN0_Pos) << (i >> 1U)); - } - } -} - -/** - * @brief Disable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for(i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if(u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC &= ~((1UL << EPWM_SYNC_PHSEN0_Pos) << (i >> 1U)); - } - } -} - -/** - * @brief Enable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector. - * The valid value is 0~7. - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM SYNC_IN noise filter function. - */ -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->SYNC = ((epwm)->SYNC & ~(EPWM_SYNC_SFLTCNT_Msk | EPWM_SYNC_SFLTCSEL_Msk)) | \ - ((u32ClkCnt << EPWM_SYNC_SFLTCNT_Pos) | (u32ClkDivSel << EPWM_SYNC_SFLTCSEL_Pos) | EPWM_SYNC_SNFLTEN_Msk); -} - -/** - * @brief Disable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC_IN noise filter function. - */ -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm) -{ - (epwm)->SYNC &= ~EPWM_SYNC_SNFLTEN_Msk; -} - -/** - * @brief Enable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to enable EPWM SYNC input pin inverse function. - */ -void EPWM_EnableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC |= EPWM_SYNC_SINPINV_Msk; -} - -/** - * @brief Disable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC input pin inverse function. - */ -void EPWM_DisableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC &= (~EPWM_SYNC_SINPINV_Msk); -} - -/** - * @brief Set EPWM clock source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32ClkSrcSel EPWM external clock source. - * - \ref EPWM_CLKSRC_EPWM_CLK - * - \ref EPWM_CLKSRC_TIMER0 - * - \ref EPWM_CLKSRC_TIMER1 - * - \ref EPWM_CLKSRC_TIMER2 - * - \ref EPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set EPWM clock source. - * @note Every two channels share the same setting. - * @note If the clock source of EPWM counter is selected from TIMERn interrupt events, the TRGEPWM(TIMERn_TRGCTL[1], n=0,1..3) bit must be set as 1. - */ -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (epwm)->CLKSRC = ((epwm)->CLKSRC & ~(EPWM_CLKSRC_ECLKSRC0_Msk << ((u32ChannelNum >> 1U) << 3U))) | \ - (u32ClkSrcSel << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Enable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM brake noise filter function. - */ -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->BNF = ((epwm)->BNF & ~((EPWM_BNF_BRK0FCNT_Msk | EPWM_BNF_BRK0NFSEL_Msk) << (u32BrakePinNum << 3U))) | \ - (((u32ClkCnt << EPWM_BNF_BRK0FCNT_Pos) | (u32ClkDivSel << EPWM_BNF_BRK0NFSEL_Pos) | EPWM_BNF_BRK0NFEN_Msk) << (u32BrakePinNum << 3U)); -} - -/** - * @brief Disable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake noise filter function. - */ -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0NFEN_Msk << (u32BrakePinNum << 3U)); -} - -/** - * @brief Enable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to enable EPWM brake pin inverse function. - */ -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF |= (EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum << 3U)); -} - -/** - * @brief Disable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake pin inverse function. - */ -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum * (uint32_t)EPWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Set EPWM brake pin source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32SelAnotherModule Select to another module. Valid values are TRUE or FALSE. - * @return None - * @details This function is used to set EPWM brake pin source. - */ -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule) -{ - (epwm)->BNF = ((epwm)->BNF & ~(EPWM_BNF_BK0SRC_Msk << (u32BrakePinNum << 3U))) | (u32SelAnotherModule << ((uint32_t)EPWM_BNF_BK0SRC_Pos + (u32BrakePinNum << 3U))); -} - -/** - * @brief Set EPWM leading edge blanking function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32TrigSrcSel Leading edge blanking source selection. - * - \ref EPWM_LEBCTL_SRCEN0 - * - \ref EPWM_LEBCTL_SRCEN2 - * - \ref EPWM_LEBCTL_SRCEN4 - * - \ref EPWM_LEBCTL_SRCEN0_2 - * - \ref EPWM_LEBCTL_SRCEN0_4 - * - \ref EPWM_LEBCTL_SRCEN2_4 - * - \ref EPWM_LEBCTL_SRCEN0_2_4 - * @param[in] u32TrigType Leading edge blanking trigger type. - * - \ref EPWM_LEBCTL_TRGTYPE_RISING - * - \ref EPWM_LEBCTL_TRGTYPE_FALLING - * - \ref EPWM_LEBCTL_TRGTYPE_RISING_OR_FALLING - * @param[in] u32BlankingCnt Leading Edge Blanking Counter. Valid values are between 1~512. - This counter value decides leading edge blanking window size, and this counter clock base is ECLK. - * @param[in] u32BlankingEnable Enable EPWM leading edge blanking function. Valid values are TRUE (ENABLE) or FALSE (DISABLE). - * - \ref FALSE - * - \ref TRUE - * @return None - * @details This function is used to configure EPWM leading edge blanking function that blank the false trigger from ACMP brake source which may cause by EPWM output transition. - * @note EPWM leading edge blanking function is only used for brake source from ACMP. - */ -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable) -{ - (epwm)->LEBCTL = (u32TrigType) | (u32TrigSrcSel) | (u32BlankingEnable); - /* Blanking window size = LEBCNT + 1, so LEBCNT = u32BlankingCnt - 1 */ - (epwm)->LEBCNT = (u32BlankingCnt) - 1U; -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - */ -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - */ -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->STATUS = (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum); -} - -/** - * @brief Enable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32AfterPrescaler Fault Detect Clock Source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @param[in] u32ClkSel Fault Detect Clock Select. - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_1 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_2 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_4 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_8 - * @return None - * @details This function is used to enable fault detect of selected channel. - */ -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel) -{ - (epwm)->FDEN = ((epwm)->FDEN & ~(EPWM_FDEN_FDCKS0_Msk << (u32ChannelNum))) | \ - ((EPWM_FDEN_FDEN0_Msk | ((u32AfterPrescaler) << EPWM_FDEN_FDCKS0_Pos)) << (u32ChannelNum)); - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & ~EPWM_FDCTL0_FDCKSEL_Msk) | (u32ClkSel); -} - -/** - * @brief Disable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect of selected channel. - */ -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect output of selected channel. - */ -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect output of selected channel. - */ -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN |= (EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32DeglitchSmpCycle Deglitch Sampling Cycle. Valid values are between 0~7. - * @return None - * @details This function is used to enable fault detect deglitch function of selected channel. - */ -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_DGSMPCYC_Msk)) | \ - (EPWM_FDCTL0_FDDGEN_Msk | ((u32DeglitchSmpCycle) << EPWM_FDCTL0_DGSMPCYC_Pos)); -} - -/** - * @brief Disable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect deglitch function of selected channel. - */ -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDDGEN_Msk; -} - -/** - * @brief Enable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32MaskCnt Transition mask counter. Valid values are between 0~0x7F. - * @return None - * @details This function is used to enable fault detect mask function of selected channel. - */ -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_TRMSKCNT_Msk)) | (EPWM_FDCTL0_FDMSKEN_Msk | (u32MaskCnt)); -} - -/** - * @brief Disable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect mask function of selected channel. - */ -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDMSKEN_Msk; -} - -/** - * @brief Enable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect interrupt of selected channel. - */ -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN |= (EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect interrupt of selected channel. - */ -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN &= ~(EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Clear fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to clear fault detect interrupt of selected channel. - */ -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDSTS = (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum)); -} - -/** - * @brief Get fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @retval 0 Fault detect interrupt did not occur. - * @retval 1 Fault detect interrupt occurred. - * @details This function is used to Get fault detect interrupt of selected channel. - */ -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FDSTS & (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum))) ? 1UL : 0UL); -} - -/*@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_fmc.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_fmc.c deleted file mode 100644 index d3bbd345dc3..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_fmc.c +++ /dev/null @@ -1,1041 +0,0 @@ -/**************************************************************************//** - * @file fmc.c - * @version V1.00 - * @brief M480 series FMC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include - -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup FMC_Driver FMC Driver - @{ -*/ - - -/** @addtogroup FMC_EXPORTED_FUNCTIONS FMC Exported Functions - @{ -*/ - - -/** - * @brief Disable FMC ISP function. - * @return None - */ -void FMC_Close(void) -{ - FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk; -} - -/** - * @brief Config XOM Region - * @param[in] u32XomNum The XOM number(0~3) - * @param[in] u32XomBase The XOM region base address. - * @param[in] u8XomPage The XOM page number of region size. - * - * @retval 0 Success - * @retval 1 XOM is has already actived. - * @retval -1 Program failed. - * @retval -2 Invalid XOM number. - * - * @details Program XOM base address and XOM size(page) - */ -int32_t FMC_ConfigXOM(uint32_t u32XomNum, uint32_t u32XomBase, uint8_t u8XomPage) -{ - int32_t ret = 0; - - if(u32XomNum >= 4UL) - { - ret = -2; - } - - if(ret == 0) - { - ret = FMC_GetXOMState(u32XomNum); - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u); - FMC->ISPDAT = u32XomBase; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u + 0x04u); - FMC->ISPDAT = u8XomPage; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - if(ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_XOM_BASE + (u32XomNum * 0x10u + 0x08u); - FMC->ISPDAT = 0u; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while(FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) {} - - if(FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_PAGE_ERASE command to erase a flash page. The page size is 4096 bytes. - * @param[in] u32PageAddr Address of the flash page to be erased. - * It must be a 4096 bytes aligned address. - * @return ISP page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - */ -int32_t FMC_Erase(uint32_t u32PageAddr) -{ - int32_t ret = 0; - - if (u32PageAddr == FMC_SPROM_BASE) - { - ret = FMC_Erase_SPROM(); - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = u32PageAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - } - return ret; -} - - -/** - * @brief Execute FMC_ISPCMD_PAGE_ERASE command to erase SPROM. The page size is 4096 bytes. - * @return SPROM page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - */ -int32_t FMC_Erase_SPROM(void) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = FMC_SPROM_BASE; - FMC->ISPDAT = 0x0055AA03UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_BLOCK_ERASE command to erase a flash block. The block size is 4 pages. - * @param[in] u32BlockAddr Address of the flash block to be erased. - * It must be a 4 pages aligned address. - * @return ISP page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - */ -int32_t FMC_Erase_Block(uint32_t u32BlockAddr) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_BLOCK_ERASE; - FMC->ISPADDR = u32BlockAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_BANK_ERASE command to erase a flash block. - * @param[in] u32BankAddr Base address of the flash bank to be erased. - * @return ISP page erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - */ -int32_t FMC_Erase_Bank(uint32_t u32BankAddr) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_BANK_ERASE; - FMC->ISPADDR = u32BankAddr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - ret = -1; - } - return ret; -} - -/** - * @brief Execute Erase XOM Region - * - * @param[in] u32XomNum The XOMRn(n=0~3) - * - * @return XOM erase success or not. - * @retval 0 Success - * @retval -1 Erase failed - * @retval -2 Invalid XOM number. - * - * @details Execute FMC_ISPCMD_PAGE_ERASE command to erase XOM. - */ -int32_t FMC_EraseXOM(uint32_t u32XomNum) -{ - uint32_t u32Addr; - int32_t i32Active, err = 0; - - if(u32XomNum >= 4UL) - { - err = -2; - } - - if(err == 0) - { - i32Active = FMC_GetXOMState(u32XomNum); - - if(i32Active) - { - switch(u32XomNum) - { - case 0u: - u32Addr = (FMC->XOMR0STS & 0xFFFFFF00u) >> 8u; - break; - case 1u: - u32Addr = (FMC->XOMR1STS & 0xFFFFFF00u) >> 8u; - break; - case 2u: - u32Addr = (FMC->XOMR2STS & 0xFFFFFF00u) >> 8u; - break; - case 3u: - u32Addr = (FMC->XOMR3STS & 0xFFFFFF00u) >> 8u; - break; - default: - break; - } - FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE; - FMC->ISPADDR = u32Addr; - FMC->ISPDAT = 0x55aa03u; - FMC->ISPTRG = 0x1u; -#if ISBEN - __ISB(); -#endif - while(FMC->ISPTRG) {} - - /* Check ISPFF flag to know whether erase OK or fail. */ - if(FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) - { - FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk; - err = -1; - } - } - else - { - err = -1; - } - } - return err; -} - -/** - * @brief Check the XOM is actived or not. - * - * @param[in] u32XomNum The xom number(0~3). - * - * @retval 1 XOM is actived. - * @retval 0 XOM is not actived. - * @retval -2 Invalid XOM number. - * - * @details To get specify XOMRn(n=0~3) active status - */ -int32_t FMC_GetXOMState(uint32_t u32XomNum) -{ - uint32_t u32act; - int32_t ret = 0; - - if(u32XomNum >= 4UL) - { - ret = -2; - } - - if(ret >= 0) - { - u32act = (((FMC->XOMSTS) & 0xful) & (1ul << u32XomNum)) >> u32XomNum; - ret = (int32_t)u32act; - } - return ret; -} - -/** - * @brief Get the current boot source. - * @return The current boot source. - * @retval 0 Is boot from APROM. - * @retval 1 Is boot from LDROM. - * @retval 2 Is boot from Boot Loader. - */ -int32_t FMC_GetBootSource (void) -{ - if (FMC->ISPCTL & FMC_ISPCTL_BL_Msk) - { - return 2; - } - if (FMC->ISPCTL & FMC_ISPCTL_BS_Msk) - { - return 1; - } - return 0; -} - - -/** - * @brief Enable FMC ISP function - * @return None - */ -void FMC_Open(void) -{ - FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk; -} - - -/** - * @brief Execute FMC_ISPCMD_READ command to read a word from flash. - * @param[in] u32Addr Address of the flash location to be read. - * It must be a word aligned address. - * @return The word data read from specified flash address. - */ -uint32_t FMC_Read(uint32_t u32Addr) -{ - FMC->ISPCMD = FMC_ISPCMD_READ; - FMC->ISPADDR = u32Addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - return FMC->ISPDAT; -} - - -/** - * @brief Execute FMC_ISPCMD_READ_64 command to read a double-word from flash. - * @param[in] u32addr Address of the flash location to be read. - * It must be a double-word aligned address. - * @param[out] u32data0 Place holder of word 0 read from flash address u32addr. - * @param[out] u32data1 Place holder of word 0 read from flash address u32addr+4. - * @return 0 Success - * @return -1 Failed - */ -int32_t FMC_Read_64(uint32_t u32addr, uint32_t * u32data0, uint32_t * u32data1) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_READ_64; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = 0x0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - else - { - *u32data0 = FMC->MPDAT0; - *u32data1 = FMC->MPDAT1; - } - return ret; -} - - -/** - * @brief Get the base address of Data Flash if enabled. - * @retval The base address of Data Flash - */ -uint32_t FMC_ReadDataFlashBaseAddr(void) -{ - return FMC->DFBA; -} - -/** - * @brief Set boot source from LDROM or APROM after next software reset - * @param[in] i32BootSrc - * 1: Boot from LDROM - * 0: Boot from APROM - * @return None - * @details This function is used to switch APROM boot or LDROM boot. User need to call - * FMC_SetBootSource to select boot source first, then use CPU reset or - * System Reset Request to reset system. - */ -void FMC_SetBootSource(int32_t i32BootSrc) -{ - if(i32BootSrc) - { - FMC->ISPCTL |= FMC_ISPCTL_BS_Msk; /* Boot from LDROM */ - } - else - { - FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk;/* Boot from APROM */ - } -} - -/** - * @brief Execute ISP FMC_ISPCMD_PROGRAM to program a word to flash. - * @param[in] u32Addr Address of the flash location to be programmed. - * It must be a word aligned address. - * @param[in] u32Data The word data to be programmed. - * @return None - */ -void FMC_Write(uint32_t u32Addr, uint32_t u32Data) -{ - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = u32Addr; - FMC->ISPDAT = u32Data; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } -} - -/** - * @brief Execute ISP FMC_ISPCMD_PROGRAM_64 to program a double-word to flash. - * @param[in] u32addr Address of the flash location to be programmed. - * It must be a double-word aligned address. - * @param[in] u32data0 The word data to be programmed to flash address u32addr. - * @param[in] u32data1 The word data to be programmed to flash address u32addr+4. - * @return 0 Success - * @return -1 Failed - */ -int32_t FMC_Write8Bytes(uint32_t u32addr, uint32_t u32data0, uint32_t u32data1) -{ - int32_t ret = 0; - - FMC->ISPCMD = FMC_ISPCMD_PROGRAM_64; - FMC->ISPADDR = u32addr; - FMC->MPDAT0 = u32data0; - FMC->MPDAT1 = u32data1; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - return ret; -} - - -/** - * @brief Program Multi-Word data into specified address of flash. - * @param[in] u32Addr Start flash address in APROM where the data chunk to be programmed into. - * This address must be 8-bytes aligned to flash address. - * @param[in] pu32Buf Buffer that carry the data chunk. - * @param[in] u32Len Length of the data chunk in bytes. - * @retval >=0 Number of data bytes were programmed. - * @return -1 Invalid address. - */ -int32_t FMC_WriteMultiple(uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len) -{ - int i, idx, retval = 0; - - if ((u32Addr >= FMC_APROM_END) || ((u32Addr % 8) != 0)) - { - return -1; - } - - u32Len = u32Len - (u32Len % 8); /* u32Len must be multiple of 8. */ - - idx = 0; - - while (u32Len >= 8) - { - FMC->ISPADDR = u32Addr; - FMC->MPDAT0 = pu32Buf[idx++]; - FMC->MPDAT1 = pu32Buf[idx++]; - FMC->MPDAT2 = pu32Buf[idx++]; - FMC->MPDAT3 = pu32Buf[idx++]; - FMC->ISPCMD = FMC_ISPCMD_PROGRAM_MUL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - for (i = 16; i < FMC_MULTI_WORD_PROG_LEN; ) - { - while (FMC->MPSTS & (FMC_MPSTS_D0_Msk | FMC_MPSTS_D1_Msk)) - ; - retval += 8; - u32Len -= 8; - if (u32Len < 8) - { - return retval; - } - - if (!(FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk)) - { - /* printf(" [WARNING] busy cleared after D0D1 cleared!\n"); */ - i += 8; - break; - } - - FMC->MPDAT0 = pu32Buf[idx++]; - FMC->MPDAT1 = pu32Buf[idx++]; - - if (i == FMC_MULTI_WORD_PROG_LEN/4) - break; // done - - while (FMC->MPSTS & (FMC_MPSTS_D2_Msk | FMC_MPSTS_D3_Msk)) - ; - retval += 8; - u32Len -= 8; - if (u32Len < 8) - { - return retval; - } - - if (!(FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk)) - { - /* printf(" [WARNING] busy cleared after D2D3 cleared!\n"); */ - i += 8; - break; - } - - FMC->MPDAT2 = pu32Buf[idx++]; - FMC->MPDAT3 = pu32Buf[idx++]; - } - - if (i != FMC_MULTI_WORD_PROG_LEN) - { - /* printf(" [WARNING] Multi-word program interrupted at 0x%x !!\n", i); */ - return retval; - } - - while (FMC->MPSTS & FMC_MPSTS_MPBUSY_Msk) ; - - u32Addr += FMC_MULTI_WORD_PROG_LEN; - } - return retval; -} - - -/** - * @brief Program a 64-bits data to the specified OTP. - * @param[in] otp_num The OTP number. - * @param[in] low_word Low word of the 64-bits data. - * @param[in] high_word Low word of the 64-bits data. - * @retval 0 Success - * @retval -1 Program failed. - * @retval -2 Invalid OTP number. - */ -int32_t FMC_Write_OTP(uint32_t otp_num, uint32_t low_word, uint32_t high_word) -{ - int32_t ret = 0; - - if (otp_num > 255UL) - { - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + otp_num * 8UL; - FMC->ISPDAT = low_word; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + otp_num * 8UL + 4UL; - FMC->ISPDAT = high_word; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - - return ret; -} - -/** - * @brief Read the 64-bits data from the specified OTP. - * @param[in] otp_num The OTP number. - * @param[in] low_word Low word of the 64-bits data. - * @param[in] high_word Low word of the 64-bits data. - * @retval 0 Success - * @retval -1 Read failed. - * @retval -2 Invalid OTP number. - */ -int32_t FMC_Read_OTP(uint32_t otp_num, uint32_t *low_word, uint32_t *high_word) -{ - int32_t ret = 0; - - if (otp_num > 255UL) - { - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_READ_64; - FMC->ISPADDR = FMC_OTP_BASE + otp_num * 8UL ; - FMC->ISPDAT = 0x0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - else - { - *low_word = FMC->MPDAT0; - *high_word = FMC->MPDAT1; - } - } - return ret; -} - -/** - * @brief Lock the specified OTP. - * @param[in] otp_num The OTP number. - * @retval 0 Success - * @retval -1 Failed to write OTP lock bits. - * @retval -2 Invalid OTP number. - */ -int32_t FMC_Lock_OTP(uint32_t otp_num) -{ - int32_t ret = 0; - - if (otp_num > 255UL) - { - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_PROGRAM; - FMC->ISPADDR = FMC_OTP_BASE + 0x800UL + otp_num * 4UL; - FMC->ISPDAT = 0UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - } - return ret; -} - -/** - * @brief Check the OTP is locked or not. - * @param[in] otp_num The OTP number. - * @retval 1 OTP is locked. - * @retval 0 OTP is not locked. - * @retval -1 Failed to read OTP lock bits. - * @retval -2 Invalid OTP number. - */ -int32_t FMC_Is_OTP_Locked(uint32_t otp_num) -{ - int32_t ret = 0; - - if (otp_num > 255UL) - { - ret = -2; - } - - if (ret == 0) - { - FMC->ISPCMD = FMC_ISPCMD_READ; - FMC->ISPADDR = FMC_OTP_BASE + 0x800UL + otp_num * 4UL; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { } - - if (FMC->ISPSTS & FMC_ISPSTS_ISPFF_Msk) - { - FMC->ISPSTS |= FMC_ISPSTS_ISPFF_Msk; - ret = -1; - } - else - { - if (FMC->ISPDAT != 0xFFFFFFFFUL) - { - ret = 1; /* Lock work was progrmmed. OTP was locked. */ - } - } - } - return ret; -} - -/** - * @brief Execute FMC_ISPCMD_READ command to read User Configuration. - * @param[out] u32Config A two-word array. - * u32Config[0] holds CONFIG0, while u32Config[1] holds CONFIG1. - * @param[in] u32Count Available word count in u32Config. - * @return Success or not. - * @retval 0 Success. - * @retval -1 Invalid parameter. - */ -int32_t FMC_ReadConfig(uint32_t u32Config[], uint32_t u32Count) -{ - int32_t ret = 0; - - u32Config[0] = FMC_Read(FMC_CONFIG_BASE); - - if (u32Count < 2UL) - { - ret = -1; - } - else - { - u32Config[1] = FMC_Read(FMC_CONFIG_BASE+4UL); - } - return ret; -} - - -/** - * @brief Execute ISP commands to erase then write User Configuration. - * @param[in] u32Config A two-word array. - * u32Config[0] holds CONFIG0, while u32Config[1] holds CONFIG1. - * @param[in] u32Count The number of User Configuration words to be written. - * @return Success or not. - * @retval 0 Success - * @retval -1 Failed - */ -int32_t FMC_WriteConfig(uint32_t u32Config[], uint32_t u32Count) -{ - int i; - - FMC_ENABLE_CFG_UPDATE(); - FMC_Erase(FMC_CONFIG_BASE); - - if ((FMC_Read(FMC_CONFIG_BASE) != 0xFFFFFFFF) || (FMC_Read(FMC_CONFIG_BASE+4) != 0xFFFFFFFF) || - (FMC_Read(FMC_CONFIG_BASE+8) != 0xFFFF5A5A)) - { - FMC_DISABLE_CFG_UPDATE(); - return -1; - } - - for (i = 0; i < u32Count; i++) - { - FMC_Write(FMC_CONFIG_BASE+i*4UL, u32Config[i]); - - if (FMC_Read(FMC_CONFIG_BASE+i*4UL) != u32Config[i]) - { - FMC_DISABLE_CFG_UPDATE(); - return -1; - } - } - - FMC_DISABLE_CFG_UPDATE(); - return 0; -} - - -/** - * @brief Run CRC32 checksum calculation and get result. - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 512 bytes. - * @return Success or not. - * @retval 0 Success. - * @retval 0xFFFFFFFF Invalid parameter. - */ -uint32_t FMC_GetChkSum(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret; - - if ((u32addr % 512UL) || (u32count % 512UL)) - { - ret = 0xFFFFFFFF; - } - else - { - FMC->ISPCMD = FMC_ISPCMD_RUN_CKS; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = u32count; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - FMC->ISPCMD = FMC_ISPCMD_READ_CKS; - FMC->ISPADDR = u32addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - ret = FMC->ISPDAT; - } - - return ret; -} - - -/** - * @brief Run flash all one verification and get result. - * @param[in] u32addr Starting flash address. It must be a page aligned address. - * @param[in] u32count Byte count of flash to be calculated. It must be multiple of 512 bytes. - * @retval READ_ALLONE_YES The contents of verified flash area are 0xFFFFFFFF. - * @retval READ_ALLONE_NOT Some contents of verified flash area are not 0xFFFFFFFF. - * @retval READ_ALLONE_CMD_FAIL Unexpected error occurred. - */ -uint32_t FMC_CheckAllOne(uint32_t u32addr, uint32_t u32count) -{ - uint32_t ret = READ_ALLONE_CMD_FAIL; - - FMC->ISPSTS = 0x80UL; /* clear check all one bit */ - - FMC->ISPCMD = FMC_ISPCMD_RUN_ALL1; - FMC->ISPADDR = u32addr; - FMC->ISPDAT = u32count; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - - do - { - FMC->ISPCMD = FMC_ISPCMD_READ_ALL1; - FMC->ISPADDR = u32addr; - FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk; - while (FMC->ISPSTS & FMC_ISPSTS_ISPBUSY_Msk) { } - } - while (FMC->ISPDAT == 0UL); - - if (FMC->ISPDAT == READ_ALLONE_YES) - { - ret = FMC->ISPDAT; - } - - if (FMC->ISPDAT == READ_ALLONE_NOT) - { - ret = FMC->ISPDAT; - } - - return ret; -} - - -/** - * @brief Setup security key. - * @param[in] key Key 0~2 to be setup. - * @param[in] kpmax Maximum unmatched power-on counting number. - * @param[in] kemax Maximum unmatched counting number. - * @param[in] lock_CONFIG 1: Security key lock CONFIG to write-protect. 0: Don't lock CONFIG. - * @param[in] lock_SPROM 1: Security key lock SPROM to write-protect. 0: Don't lock SPROM. - * @retval 0 Success. - * @retval -1 Key is locked. Cannot overwrite the current key. - * @retval -2 Failed to erase flash. - * @retval -3 Failed to program key. - * @retval -4 Key lock function failed. - * @retval -5 CONFIG lock function failed. - * @retval -6 SPROM lock function failed. - * @retval -7 KPMAX function failed. - * @retval -8 KEMAX function failed. - */ -int32_t FMC_SetSPKey(uint32_t key[3], uint32_t kpmax, uint32_t kemax, - const int32_t lock_CONFIG, const int32_t lock_SPROM) -{ - uint32_t lock_ctrl = 0UL; - uint32_t u32KeySts; - int32_t ret = 0; - - if (FMC->KPKEYSTS != 0x200UL) - { - ret = -1; - } - - if (FMC_Erase(FMC_KPROM_BASE)) - { - ret = -2; - } - - if (FMC_Erase(FMC_KPROM_BASE+0x200UL)) - { - ret = -3; - } - - if (!lock_CONFIG) - { - lock_ctrl |= 0x1UL; - } - - if (!lock_SPROM) - { - lock_ctrl |= 0x2UL; - } - - if (ret == 0) - { - FMC_Write(FMC_KPROM_BASE, key[0]); - FMC_Write(FMC_KPROM_BASE+0x4UL, key[1]); - FMC_Write(FMC_KPROM_BASE+0x8UL, key[2]); - FMC_Write(FMC_KPROM_BASE+0xCUL, kpmax); - FMC_Write(FMC_KPROM_BASE+0x10UL, kemax); - FMC_Write(FMC_KPROM_BASE+0x14UL, lock_ctrl); - - while (FMC->KPKEYSTS & FMC_KPKEYSTS_KEYBUSY_Msk) { } - - u32KeySts = FMC->KPKEYSTS; - - if (!(u32KeySts & FMC_KPKEYSTS_KEYLOCK_Msk)) - { - /* Security key lock failed! */ - ret = -4; - } - else if ((lock_CONFIG && (!(u32KeySts & FMC_KPKEYSTS_CFGFLAG_Msk))) || - ((!lock_CONFIG) && (u32KeySts & FMC_KPKEYSTS_CFGFLAG_Msk))) - { - /* CONFIG lock failed! */ - ret = -5; - } - else if ((lock_SPROM && (!(u32KeySts & FMC_KPKEYSTS_SPFLAG_Msk))) || - ((!lock_SPROM) && (u32KeySts & FMC_KPKEYSTS_SPFLAG_Msk))) - { - /* CONFIG lock failed! */ - ret = -6; - } - else if (((FMC->KPCNT & FMC_KPCNT_KPMAX_Msk) >> FMC_KPCNT_KPMAX_Pos) != kpmax) - { - /* KPMAX failed! */ - ret = -7; - } - else if (((FMC->KPKEYCNT & FMC_KPKEYCNT_KPKEMAX_Msk) >> FMC_KPKEYCNT_KPKEMAX_Pos) != kemax) - { - /* KEMAX failed! */ - ret = -8; - } - } - return ret; -} - - -/** - * @brief Execute security key comparison. - * @param[in] key Key 0~2 to be compared. - * @retval 0 Key matched. - * @retval -1 Forbidden. Times of key comparison mismatch reach the maximum count. - * @retval -2 Key mismatched. - * @retval -3 No security key lock. Key comparison is not required. - */ -int32_t FMC_CompareSPKey(uint32_t key[3]) -{ - uint32_t u32KeySts; - int32_t ret = 0; - - if (FMC->KPKEYSTS & FMC_KPKEYSTS_FORBID_Msk) - { - /* FMC_CompareSPKey - FORBID! */ - ret = -1; - } - - if (!(FMC->KPKEYSTS & FMC_KPKEYSTS_KEYLOCK_Msk)) - { - /* FMC_CompareSPKey - key is not locked! */ - ret = -3; - } - - if (ret == 0) - { - FMC->KPKEY0 = key[0]; - FMC->KPKEY1 = key[1]; - FMC->KPKEY2 = key[2]; - FMC->KPKEYTRG = FMC_KPKEYTRG_KPKEYGO_Msk | FMC_KPKEYTRG_TCEN_Msk; - - while (FMC->KPKEYSTS & FMC_KPKEYSTS_KEYBUSY_Msk) { } - - u32KeySts = FMC->KPKEYSTS; - - if (!(u32KeySts & FMC_KPKEYSTS_KEYMATCH_Msk)) - { - /* Key mismatched! */ - ret = -2; - } - else if (u32KeySts & FMC_KPKEYSTS_KEYLOCK_Msk) - { - /* Key matched, but still be locked! */ - ret = -2; - } - } - return ret; -} - - -/*@}*/ /* end of group FMC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group FMC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_gpio.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_gpio.c deleted file mode 100644 index c40a68aae3b..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_gpio.c +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************//** - * @file gpio.c - * @version V3.00 - * @brief M480 series GPIO driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Set GPIO operation mode - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * @param[in] u32Mode Operation mode. It could be \n - * GPIO_MODE_INPUT, GPIO_MODE_OUTPUT, GPIO_MODE_OPEN_DRAIN, GPIO_MODE_QUASI. - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for(i = 0ul; i < GPIO_PIN_MAX; i++) - { - if((u32PinMask & (1ul << i))==(1ul << i)) - { - port->MODE = (port->MODE & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Enable GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be \n - * GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs) -{ - port->INTTYPE = (port->INTTYPE&~(1ul<> 24) & 0xFFUL) << u32Pin); - port->INTEN = (port->INTEN&~(0x00010001ul<INTTYPE &= ~(1UL << u32Pin); - port->INTEN &= ~((0x00010001UL) << u32Pin); -} - -/** - * @brief Set GPIO slew rate control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref GPH - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * @param[in] u32Mode Slew rate mode. \ref GPIO_SLEWCTL_NORMAL (maximum 40 MHz at 2.7V) - * \ref GPIO_SLEWCTL_HIGH (maximum 80 MHz at 2.7V) - * \ref GPIO_SLEWCTL_FAST (maximum 100 MHz at 2.7V) - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for(i = 0ul; i < GPIO_PIN_MAX; i++) - { - if(u32PinMask & (1ul << i)) - { - port->SLEWCTL = (port->SLEWCTL & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Set GPIO Pull-up and Pull-down control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref GPH - * @param[in] u32PinMask The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32Mode The pin mode of specified GPIO pin. It could be - * \ref GPIO_PUSEL_DISABLE - * \ref GPIO_PUSEL_PULL_UP - * \ref GPIO_PUSEL_PULL_DOWN - * - * @return None - * - * @details Set the pin mode of specified GPIO pin. - */ -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for(i = 0ul; i < GPIO_PIN_MAX; i++) - { - if(u32PinMask & (1ul << i)) - { - port->PUSEL = (port->PUSEL & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2011~2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_hsusbd.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_hsusbd.c deleted file mode 100644 index 48474fa875f..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_hsusbd.c +++ /dev/null @@ -1,725 +0,0 @@ -/**************************************************************************//** - * @file hsusbd.c - * @version V1.00 - * @brief M480 HSUSBD driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HSUSBD_Driver HSUSBD Driver - @{ -*/ - - -/** @addtogroup HSUSBD_EXPORTED_FUNCTIONS HSUSBD Exported Functions - @{ -*/ -/*--------------------------------------------------------------------------*/ -/** @cond HIDDEN_SYMBOLS */ -/* Global variables for Control Pipe */ -S_HSUSBD_CMD_T gUsbCmd; -S_HSUSBD_INFO_T *g_hsusbd_sInfo; - -HSUSBD_VENDOR_REQ g_hsusbd_pfnVendorRequest = NULL; -HSUSBD_CLASS_REQ g_hsusbd_pfnClassRequest = NULL; -HSUSBD_SET_INTERFACE_REQ g_hsusbd_pfnSetInterface = NULL; -uint32_t g_u32HsEpStallLock = 0ul; /* Bit map flag to lock specified EP when SET_FEATURE */ - -static uint8_t *g_hsusbd_CtrlInPointer = 0; -static uint32_t g_hsusbd_CtrlMaxPktSize = 64ul; -static uint8_t g_hsusbd_UsbConfig = 0ul; -static uint8_t g_hsusbd_UsbAltInterface = 0ul; -static uint8_t g_hsusbd_EnableTestMode = 0ul; -static uint8_t g_hsusbd_TestSelector = 0ul; - -#ifdef __ICCARM__ -#pragma data_alignment=4 -static uint8_t g_hsusbd_buf[12]; -#else -static uint8_t g_hsusbd_buf[12] __attribute__((aligned(4))); -#endif - -uint8_t volatile g_hsusbd_Configured = 0ul; -uint8_t g_hsusbd_CtrlZero = 0ul; -uint8_t g_hsusbd_UsbAddr = 0ul; -uint8_t g_hsusbd_ShortPacket = 0ul; -uint32_t volatile g_hsusbd_DmaDone = 0ul; -uint32_t g_hsusbd_CtrlInSize = 0ul; -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief HSUSBD Initial - * - * @param[in] param Descriptor - * @param[in] pfnClassReq Class Request Callback Function - * @param[in] pfnSetInterface SetInterface Request Callback Function - * - * @return None - * - * @details This function is used to initial HSUSBD. - */ -void HSUSBD_Open(S_HSUSBD_INFO_T *param, HSUSBD_CLASS_REQ pfnClassReq, HSUSBD_SET_INTERFACE_REQ pfnSetInterface) -{ - g_hsusbd_sInfo = param; - g_hsusbd_pfnClassRequest = pfnClassReq; - g_hsusbd_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - g_hsusbd_CtrlMaxPktSize = g_hsusbd_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ - //HSUSBD->PHYCTL |= (HSUSBD_PHYCTL_PHYEN_Msk | HSUSBD_PHYCTL_DPPUEN_Msk); - HSUSBD_ENABLE_PHY(); - while((HSUSBD->BUSINTSTS & HSUSBD_BUSINTEN_PHYCLKVLDIEN_Msk) != HSUSBD_BUSINTEN_PHYCLKVLDIEN_Msk ){} - HSUSBD_CLR_SE0(); - - /* wait PHY clock ready */ - while (1) - { - HSUSBD->EP[EPA].EPMPS = 0x20ul; - if (HSUSBD->EP[EPA].EPMPS == 0x20ul) - { - HSUSBD->EP[EPA].EPMPS = 0x0ul; - break; - } - } - /* Force SE0, and then clear it to connect*/ - HSUSBD_SET_SE0(); -} - -/** - * @brief HSUSBD Start - * - * @param[in] None - * - * @return None - * - * @details This function is used to start transfer - */ -void HSUSBD_Start(void) -{ - HSUSBD_CLR_SE0(); -} - -/** - * @brief Process Setup Packet - * - * @param[in] None - * - * @return None - * - * @details This function is used to process Setup packet. - */ -void HSUSBD_ProcessSetupPacket(void) -{ - /* Setup packet process */ - gUsbCmd.bmRequestType = (uint8_t)(HSUSBD->SETUP1_0 & 0xfful); - gUsbCmd.bRequest = (uint8_t)((HSUSBD->SETUP1_0 >> 8) & 0xfful); - gUsbCmd.wValue = (uint16_t)HSUSBD->SETUP3_2; - gUsbCmd.wIndex = (uint16_t)HSUSBD->SETUP5_4; - gUsbCmd.wLength = (uint16_t)HSUSBD->SETUP7_6; - - /* USB device request in setup packet: offset 0, D[6..5]: 0=Standard, 1=Class, 2=Vendor, 3=Reserved */ - switch (gUsbCmd.bmRequestType & 0x60ul) - { - case REQ_STANDARD: - { - HSUSBD_StandardRequest(); - break; - } - case REQ_CLASS: - { - if (g_hsusbd_pfnClassRequest != NULL) - { - g_hsusbd_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: - { - if (g_hsusbd_pfnVendorRequest != NULL) - { - g_hsusbd_pfnVendorRequest(); - } - break; - } - default: - { - /* Setup error, stall the device */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - break; - } - } -} - -/** - * @brief Get Descriptor request - * - * @param[in] None - * - * @return None - * - * @details This function is used to process GetDescriptor request. - */ -int HSUSBD_GetDescriptor(void) -{ - uint32_t u32Len; - int val = 0; - - u32Len = gUsbCmd.wLength; - g_hsusbd_CtrlZero = (uint8_t)0ul; - - switch ((gUsbCmd.wValue & 0xff00ul) >> 8) - { - /* Get Device Descriptor */ - case DESC_DEVICE: - { - u32Len = Minimum(u32Len, LEN_DEVICE); - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8DevDesc, u32Len); - break; - } - /* Get Configuration Descriptor */ - case DESC_CONFIG: - { - uint32_t u32TotalLen; - if ((HSUSBD->OPER & 0x04ul) == 0x04ul) - { - u32TotalLen = g_hsusbd_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8ConfigDesc, u32Len); - } - else - { - u32TotalLen = g_hsusbd_sInfo->gu8FullConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8FullConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8FullConfigDesc, u32Len); - } - - break; - } - /* Get Qualifier Descriptor */ - case DESC_QUALIFIER: - { - u32Len = Minimum(u32Len, LEN_QUALIFIER); - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8QualDesc, u32Len); - break; - } - /* Get Other Speed Descriptor - Full speed */ - case DESC_OTHERSPEED: - { - uint32_t u32TotalLen; - if ((HSUSBD->OPER & 0x04ul) == 0x04ul) - { - u32TotalLen = g_hsusbd_sInfo->gu8HSOtherConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8HSOtherConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8HSOtherConfigDesc, u32Len); - } - else - { - u32TotalLen = g_hsusbd_sInfo->gu8FSOtherConfigDesc[3]; - u32TotalLen = g_hsusbd_sInfo->gu8FSOtherConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8FSOtherConfigDesc, u32Len); - } - - break; - } - /* Get HID Descriptor */ - case DESC_HID: - { - uint32_t u32ConfigDescOffset; /* u32ConfigDescOffset is configuration descriptor offset (HID descriptor start index) */ - u32Len = Minimum(u32Len, LEN_HID); - u32ConfigDescOffset = g_hsusbd_sInfo->gu32ConfigHidDescIdx[gUsbCmd.wIndex & 0xfful]; - HSUSBD_PrepareCtrlIn((uint8_t *)&g_hsusbd_sInfo->gu8ConfigDesc[u32ConfigDescOffset], u32Len); - break; - } - /* Get Report Descriptor */ - case DESC_HID_RPT: - { - if (u32Len > g_hsusbd_sInfo->gu32HidReportSize[gUsbCmd.wIndex & 0xfful]) - { - u32Len = g_hsusbd_sInfo->gu32HidReportSize[gUsbCmd.wIndex & 0xfful]; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8HidReportDesc[gUsbCmd.wIndex & 0xfful], u32Len); - break; - } - /* Get String Descriptor */ - case DESC_STRING: - { - if((gUsbCmd.wValue & 0xfful) < 8ul) - { - if (u32Len > g_hsusbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful][0]) - { - u32Len = g_hsusbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful][0]; - if ((u32Len % g_hsusbd_CtrlMaxPktSize) == 0ul) - { - g_hsusbd_CtrlZero = (uint8_t)1ul; - } - } - HSUSBD_PrepareCtrlIn((uint8_t *)g_hsusbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful], u32Len); - } - else - { - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - val = 1; - } - break; - } - default: - /* Not support. Reply STALL. */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - val = 1; - break; - } - return val; -} - - -/** - * @brief Process USB standard request - * - * @param[in] None - * - * @return None - * - * @details This function is used to process USB Standard Request. - */ -void HSUSBD_StandardRequest(void) -{ - /* clear global variables for new request */ - g_hsusbd_CtrlInPointer = 0; - g_hsusbd_CtrlInSize = 0ul; - - if ((gUsbCmd.bmRequestType & 0x80ul) == 0x80ul) /* request data transfer direction */ - { - /* Device to host */ - switch (gUsbCmd.bRequest) - { - case GET_CONFIGURATION: - { - /* Return current configuration setting */ - HSUSBD_PrepareCtrlIn((uint8_t *)&g_hsusbd_UsbConfig, 1ul); - - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_DESCRIPTOR: - { - if (!HSUSBD_GetDescriptor()) - { - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - } - break; - } - case GET_INTERFACE: - { - /* Return current interface setting */ - HSUSBD_PrepareCtrlIn((uint8_t *)&g_hsusbd_UsbAltInterface, 1ul); - - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_STATUS: - { - /* Device */ - if (gUsbCmd.bmRequestType == 0x80ul) - { - if ((g_hsusbd_sInfo->gu8ConfigDesc[7] & 0x40ul) == 0x40ul) - { - g_hsusbd_buf[0] = (uint8_t)1ul; /* Self-Powered */ - } - else - { - g_hsusbd_buf[0] = (uint8_t)0ul; /* bus-Powered */ - } - } - /* Interface */ - else if (gUsbCmd.bmRequestType == 0x81ul) - { - g_hsusbd_buf[0] = (uint8_t)0ul; - } - /* Endpoint */ - else if (gUsbCmd.bmRequestType == 0x82ul) - { - uint8_t ep = (uint8_t)(gUsbCmd.wIndex & 0xFul); - g_hsusbd_buf[0] = (uint8_t)HSUSBD_GetStall((uint32_t)ep)? (uint8_t)1 : (uint8_t)0; - } - g_hsusbd_buf[1] = (uint8_t)0ul; - HSUSBD_PrepareCtrlIn(g_hsusbd_buf, 2ul); - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_INTKIF_Msk); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_INTKIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - break; - } - } - } - else - { - /* Host to device */ - switch (gUsbCmd.bRequest) - { - case CLEAR_FEATURE: - { - if((gUsbCmd.wValue & 0xfful) == FEATURE_ENDPOINT_HALT) - { - - uint32_t epNum, i; - - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_u32HsEpStallLock is added to support it */ - epNum = (uint32_t)(gUsbCmd.wIndex & 0xFul); - for (i=0ul; iEP[i].EPCFG & 0xf0ul) >> 4) == epNum) && ((g_u32HsEpStallLock & (1ul << i)) == 0ul)) - { - HSUSBD->EP[i].EPRSPCTL = (HSUSBD->EP[i].EPRSPCTL & 0xeful) | HSUSBD_EP_RSPCTL_TOGGLE; - } - } - } - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_ADDRESS: - { - g_hsusbd_UsbAddr = (uint8_t)gUsbCmd.wValue; - /* Status Stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_CONFIGURATION: - { - g_hsusbd_UsbConfig = (uint8_t)gUsbCmd.wValue; - g_hsusbd_Configured = (uint8_t)1ul; - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_FEATURE: - { - if ((gUsbCmd.wValue & 0x3ul) == 2ul) /* TEST_MODE */ - { - g_hsusbd_EnableTestMode = (uint8_t)1ul; - g_hsusbd_TestSelector = (uint8_t)(gUsbCmd.wIndex >> 8); - } - if ((gUsbCmd.wValue & 0x3ul) == 3ul) /* HNP ebable */ - { - HSOTG->CTL |= (HSOTG_CTL_HNPREQEN_Msk | HSOTG_CTL_BUSREQ_Msk); - } - - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_INTERFACE: - { - g_hsusbd_UsbAltInterface = (uint8_t)gUsbCmd.wValue; - if (g_hsusbd_pfnSetInterface != NULL) - { - g_hsusbd_pfnSetInterface((uint32_t)g_hsusbd_UsbAltInterface); - } - /* Status stage */ - HSUSBD_CLR_CEP_INT_FLAG(HSUSBD_CEPINTSTS_STSDONEIF_Msk); - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_NAKCLR); - HSUSBD_ENABLE_CEP_INT(HSUSBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - HSUSBD_SET_CEP_STATE(HSUSBD_CEPCTL_STALLEN_Msk); - break; - } - } - } -} - -/** - * @brief Update Device State - * - * @param[in] None - * - * @return None - * - * @details This function is used to update Device state when Setup packet complete - */ -/** @cond HIDDEN_SYMBOLS */ -#define TEST_J 0x01ul -#define TEST_K 0x02ul -#define TEST_SE0_NAK 0x03ul -#define TEST_PACKET 0x04ul -#define TEST_FORCE_ENABLE 0x05ul -/** @endcond HIDDEN_SYMBOLS */ - -void HSUSBD_UpdateDeviceState(void) -{ - switch (gUsbCmd.bRequest) - { - case SET_ADDRESS: - { - HSUSBD_SET_ADDR(g_hsusbd_UsbAddr); - break; - } - case SET_CONFIGURATION: - { - if (g_hsusbd_UsbConfig == 0ul) - { - uint32_t volatile i; - /* Reset PID DATA0 */ - for (i=0ul; iEP[i].EPCFG & 0x1ul) == 0x1ul) - { - HSUSBD->EP[i].EPRSPCTL = HSUSBD_EP_RSPCTL_TOGGLE; - } - } - } - break; - } - case SET_FEATURE: - { - if(gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - { - uint32_t idx; - idx = (uint32_t)(gUsbCmd.wIndex & 0xFul); - HSUSBD_SetStall(idx); - } - else if (g_hsusbd_EnableTestMode) - { - g_hsusbd_EnableTestMode = (uint8_t)0ul; - if (g_hsusbd_TestSelector == TEST_J) - { - HSUSBD->TEST = TEST_J; - } - else if (g_hsusbd_TestSelector == TEST_K) - { - HSUSBD->TEST = TEST_K; - } - else if (g_hsusbd_TestSelector == TEST_SE0_NAK) - { - HSUSBD->TEST = TEST_SE0_NAK; - } - else if (g_hsusbd_TestSelector == TEST_PACKET) - { - HSUSBD->TEST = TEST_PACKET; - } - else if (g_hsusbd_TestSelector == TEST_FORCE_ENABLE) - { - HSUSBD->TEST = TEST_FORCE_ENABLE; - } - } - break; - } - case CLEAR_FEATURE: - { - if(gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - { - uint32_t idx; - idx = (uint32_t)(gUsbCmd.wIndex & 0xFul); - HSUSBD_ClearStall(idx); - } - break; - } - default: - break; - } -} - - -/** - * @brief Prepare Control IN transaction - * - * @param[in] pu8Buf Control IN data pointer - * @param[in] u32Size IN transfer size - * - * @return None - * - * @details This function is used to prepare Control IN transfer - */ -void HSUSBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size) -{ - g_hsusbd_CtrlInPointer = pu8Buf; - g_hsusbd_CtrlInSize = u32Size; -} - - - -/** - * @brief Start Control IN transfer - * - * @param[in] None - * - * @return None - * - * @details This function is used to start Control IN - */ -void HSUSBD_CtrlIn(void) -{ - uint32_t volatile i, cnt; - uint8_t u8Value; - if(g_hsusbd_CtrlInSize >= g_hsusbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - cnt = g_hsusbd_CtrlMaxPktSize >> 2; - for (i=0ul; iCEPDAT = *(uint32_t *)g_hsusbd_CtrlInPointer; - g_hsusbd_CtrlInPointer = (uint8_t *)(g_hsusbd_CtrlInPointer + 4ul); - } - HSUSBD_START_CEP_IN(g_hsusbd_CtrlMaxPktSize); - g_hsusbd_CtrlInSize -= g_hsusbd_CtrlMaxPktSize; - } - else - { - /* Data size <= MXPLD */ - cnt = g_hsusbd_CtrlInSize >> 2; - for (i=0ul; iCEPDAT = *(uint32_t *)g_hsusbd_CtrlInPointer; - g_hsusbd_CtrlInPointer += 4ul; - } - - for (i=0ul; i<(g_hsusbd_CtrlInSize % 4ul); i++) - { - u8Value = *(uint8_t *)(g_hsusbd_CtrlInPointer+i); - outpb(&HSUSBD->CEPDAT, u8Value); - } - - HSUSBD_START_CEP_IN(g_hsusbd_CtrlInSize); - g_hsusbd_CtrlInPointer = 0; - g_hsusbd_CtrlInSize = 0ul; - } -} - -/** - * @brief Start Control OUT transaction - * - * @param[in] pu8Buf Control OUT data pointer - * @param[in] u32Size OUT transfer size - * - * @return None - * - * @details This function is used to start Control OUT transfer - */ -void HSUSBD_CtrlOut(uint8_t pu8Buf[], uint32_t u32Size) -{ - uint32_t volatile i; - while(1) - { - if ((HSUSBD->CEPINTSTS & HSUSBD_CEPINTSTS_RXPKIF_Msk) == HSUSBD_CEPINTSTS_RXPKIF_Msk) - { - for (i=0ul; iCEPDAT); - } - HSUSBD->CEPINTSTS = HSUSBD_CEPINTSTS_RXPKIF_Msk; - break; - } - } -} - -/** - * @brief Clear all software flags - * - * @param[in] None - * - * @return None - * - * @details This function is used to clear all software control flag - */ -void HSUSBD_SwReset(void) -{ - /* Reset all variables for protocol */ - g_hsusbd_UsbAddr = (uint8_t)0ul; - g_hsusbd_DmaDone = 0ul; - g_hsusbd_ShortPacket = (uint8_t)0ul; - g_hsusbd_Configured = (uint8_t)0ul; - - /* Reset USB device address */ - HSUSBD_SET_ADDR(0ul); -} - -/** - * @brief HSUSBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set HSUSBD vendor request callback function - */ -void HSUSBD_SetVendorRequest(HSUSBD_VENDOR_REQ pfnVendorReq) -{ - g_hsusbd_pfnVendorRequest = pfnVendorReq; -} - - -/*@}*/ /* end of group HSUSBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HSUSBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2c.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2c.c deleted file mode 100644 index 436b7e586b6..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2c.c +++ /dev/null @@ -1,1486 +0,0 @@ -/**************************************************************************//** - * @file i2c.c - * @version V3.00 - * @brief M480 series I2C driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ - -/** - * @brief Enable specify I2C Controller and set Clock Divider - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C bus clock in Hz - * - * @return Actual I2C bus clock frequency - * - * @details The function enable the specify I2C Controller and set proper Clock Divider - * in I2C CLOCK DIVIDED REGISTER (I2CLK) according to the target I2C Bus clock. - * I2C Bus clock = PCLK / (4*(divider+1). - * - */ -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if(i2c == I2C1) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - /* Enable I2C */ - i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Disable specify I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Reset I2C Controller and disable specify I2C port. - * - */ - -void I2C_Close(I2C_T *i2c) -{ - /* Reset I2C Controller */ - if((uint32_t)i2c == I2C0_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C0RST_Msk; - } - else if((uint32_t)i2c == I2C1_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C1RST_Msk; - } - else if((uint32_t)i2c == I2C2_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C2RST_Msk; - } - - /* Disable I2C */ - i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; -} - -/** - * @brief Clear Time-out Counter flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When Time-out flag will be set, use this function to clear I2C Bus Time-out counter flag . - * - */ -void I2C_ClearTimeoutFlag(I2C_T *i2c) -{ - i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; -} - -/** - * @brief Set Control bit of I2C Controller - * - * @param[in] i2c Specify I2C port - * @param[in] u8Start Set I2C START condition - * @param[in] u8Stop Set I2C STOP condition - * @param[in] u8Si Clear SI flag - * @param[in] u8Ack Set I2C ACK bit - * - * @return None - * - * @details The function set I2C Control bit of I2C Bus protocol. - * - */ -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - - if(u8Start) - { - u32Reg |= I2C_CTL_STA; - } - - if(u8Stop) - { - u32Reg |= I2C_CTL_STO; - } - - if(u8Si) - { - u32Reg |= I2C_CTL_SI; - } - - if(u8Ack) - { - u32Reg |= I2C_CTL_AA; - } - - i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; -} - -/** - * @brief Disable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for disable I2C interrupt - * - */ -void I2C_DisableInt(I2C_T *i2c) -{ - i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Enable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for enable I2C interrupt - * - */ -void I2C_EnableInt(I2C_T *i2c) -{ - i2c->CTL0 |= I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Get I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * - * @return The actual I2C Bus clock in Hz - * - * @details To get the actual I2C Bus Clock frequency. - */ -uint32_t I2C_GetBusClockFreq(I2C_T *i2c) -{ - uint32_t u32Divider = i2c->CLKDIV; - uint32_t u32Pclk; - - if(i2c == I2C1) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - return (u32Pclk / ((u32Divider + 1U) << 2U)); -} - -/** - * @brief Set I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C Bus Clock in Hz - * - * @return The actual I2C Bus Clock in Hz - * - * @details To set the actual I2C Bus Clock frequency. - */ -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - if(i2c == I2C1) - { - u32Pclk = CLK_GetPCLK1Freq(); - } - else - { - u32Pclk = CLK_GetPCLK0Freq(); - } - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Get Interrupt Flag - * - * @param[in] i2c Specify I2C port - * - * @return I2C interrupt flag status - * - * @details To get I2C Bus interrupt flag. - */ -uint32_t I2C_GetIntFlag(I2C_T *i2c) -{ - uint32_t u32Value; - - if((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk) - { - u32Value = 1U; - } - else - { - u32Value = 0U; - } - - return u32Value; -} - -/** - * @brief Get I2C Bus Status Code - * - * @param[in] i2c Specify I2C port - * - * @return I2C Status Code - * - * @details To get I2C Bus Status Code. - */ -uint32_t I2C_GetStatus(I2C_T *i2c) -{ - return (i2c->STATUS0); -} - -/** - * @brief Read a Byte from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return I2C Data - * - * @details To read a bytes data from specify I2C port. - */ -uint8_t I2C_GetData(I2C_T *i2c) -{ - return (uint8_t)(i2c->DAT); -} - -/** - * @brief Send a byte to I2C Bus - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data The data to send to I2C bus - * - * @return None - * - * @details This function is used to write a byte to specified I2C port - */ -void I2C_SetData(I2C_T *i2c, uint8_t u8Data) -{ - i2c->DAT = u8Data; -} - -/** - * @brief Set 7-bit Slave Address and GC Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address register (0~3) - * @param[in] u8SlaveAddr 7-bit slave address - * @param[in] u8GCMode Enable/Disable GC mode (I2C_GCMODE_ENABLE / I2C_GCMODE_DISABLE) - * - * @return None - * - * @details This function is used to set 7-bit slave addresses in I2C SLAVE ADDRESS REGISTER (I2CADDR0~3) - * and enable GC Mode. - * - */ -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) -{ - switch(u8SlaveNo) - { - case 1: - i2c->ADDR1 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 2: - i2c->ADDR2 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 3: - i2c->ADDR3 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 0: - default: - i2c->ADDR0 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - } -} - -/** - * @brief Configure the mask bits of 7-bit Slave Address - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address mask register (0~3) - * @param[in] u8SlaveAddrMask A byte for slave address mask - * - * @return None - * - * @details This function is used to set 7-bit slave addresses. - * - */ -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) -{ - switch(u8SlaveNo) - { - case 1: - i2c->ADDRMSK1 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 2: - i2c->ADDRMSK2 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 3: - i2c->ADDRMSK3 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 0: - default: - i2c->ADDRMSK0 = (uint32_t)u8SlaveAddrMask << 1U; - break; - } -} - -/** - * @brief Enable Time-out Counter Function and support Long Time-out - * - * @param[in] i2c Specify I2C port - * @param[in] u8LongTimeout Configure DIV4 to enable Long Time-out (0/1) - * - * @return None - * - * @details This function enable Time-out Counter function and configure DIV4 to support Long - * Time-out. - * - */ -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) -{ - if(u8LongTimeout) - { - i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; - } - else - { - i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; - } - - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Disable Time-out Counter Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Time-out Counter function in I2CTOC register. - * - */ -void I2C_DisableTimeout(I2C_T *i2c) -{ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Enable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To enable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_EnableWakeup(I2C_T *i2c) -{ - i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_DisableWakeup(I2C_T *i2c) -{ - i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief To get SMBus Status - * - * @param[in] i2c Specify I2C port - * - * @return SMBus status - * - * @details To get the Bus Management status of I2C_BUSSTS register - * - */ -uint32_t I2C_SMBusGetStatus(I2C_T *i2c) -{ - return (i2c->BUSSTS); -} - -/** - * @brief Clear SMBus Interrupt Flag - * - * @param[in] i2c Specify I2C port - * @param[in] u8SMBusIntFlag Specify SMBus interrupt flag - * - * @return None - * - * @details To clear flags of I2C_BUSSTS status register if interrupt set. - * - */ -void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag) -{ - i2c->BUSSTS = u8SMBusIntFlag; -} - -/** - * @brief Set SMBus Bytes Counts of Transmission or Reception - * - * @param[in] i2c Specify I2C port - * @param[in] u32PktSize Transmit / Receive bytes - * - * @return None - * - * @details The transmission or receive byte number in one transaction when PECEN is set. The maximum is 255 bytes. - * - */ -void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize) -{ - i2c->PKTSIZE = u32PktSize; -} - -/** - * @brief Init SMBus Host/Device Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8HostDevice Init SMBus port mode(I2C_SMBH_ENABLE(1)/I2C_SMBD_ENABLE(0)) - * - * @return None - * - * @details Using SMBus communication must specify the port is a Host or a Device. - * - */ -void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice) -{ - /* Clear BMHEN, BMDEN of BUSCTL Register */ - i2c->BUSCTL &= ~(I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BMDEN_Msk); - - /* Set SMBus Host/Device Mode, and enable Bus Management*/ - if(u8HostDevice == (uint8_t)I2C_SMBH_ENABLE) - { - i2c->BUSCTL |= (I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } - else - { - i2c->BUSCTL |= (I2C_BUSCTL_BMDEN_Msk | I2C_BUSCTL_BUSEN_Msk); - } -} - -/** - * @brief Disable SMBus function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Disable all SMBus function include Bus disable, CRC check, Acknowledge by manual, Host/Device Mode. - * - */ -void I2C_SMBusClose(I2C_T *i2c) -{ - - i2c->BUSCTL = 0x00U; -} - -/** - * @brief Enable SMBus PEC Transmit Function - * - * @param[in] i2c Specify I2C port - * @param[in] u8PECTxEn CRC transmit enable(PECTX_ENABLE) or disable(PECTX_DISABLE) - * - * @return None - * - * @details When enable CRC check function, the Host or Device needs to transmit CRC byte. - * - */ -void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn) -{ - i2c->BUSCTL &= ~I2C_BUSCTL_PECTXEN_Msk; - - if(u8PECTxEn) - { - i2c->BUSCTL |= (I2C_BUSCTL_PECEN_Msk | I2C_BUSCTL_PECTXEN_Msk); - } - else - { - i2c->BUSCTL |= I2C_BUSCTL_PECEN_Msk; - } -} - -/** - * @brief Get SMBus CRC value - * - * @param[in] i2c Specify I2C port - * - * @return A byte is packet error check value - * - * @details The CRC check value after a transmission or a reception by count by using CRC8 - * - */ -uint8_t I2C_SMBusGetPECValue(I2C_T *i2c) -{ - return (uint8_t)i2c->PKTCRC; -} - -/** - * @brief Calculate Time-out of SMBus idle period - * - * @param[in] i2c Specify I2C port - * @param[in] us Time-out length(us) - * @param[in] u32Hclk I2C peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Idle state. - * - */ - -void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk) -{ - uint32_t u32Div, u32Hclk_kHz; - - i2c->BUSCTL |= I2C_BUSCTL_TIDLE_Msk; - u32Hclk_kHz = u32Hclk / 1000U; - u32Div = (((us * u32Hclk_kHz) / 1000U) >> 2U) - 1U; - if(u32Div > 255U) - { - i2c->BUSTOUT = 0xFFU; - } - else - { - i2c->BUSTOUT = u32Div; - } - -} - -/** - * @brief Calculate Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in active state. - * Time-out length is calculate the SCL line "one clock" pull low timing. - * - */ - -void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if(u32Div <= 0xFFU) - { - i2c->BUSTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->BUSTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - -/** - * @brief Calculate Cumulative Clock low Time-out of SMBus active period - * - * @param[in] i2c Specify I2C port - * @param[in] ms Time-out length(ms) - * @param[in] u32Pclk peripheral clock frequency - * - * @return None - * - * @details This function is used to set SMBus Time-out length when bus is in Active state. - * Time-out length is calculate the SCL line "clocks" low cumulative timing. - * - */ - -void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) -{ - uint32_t u32Div, u32Pclk_kHz; - - i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; - - /* DIV4 disabled */ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; - u32Pclk_kHz = u32Pclk / 1000U; - u32Div = ((ms * u32Pclk_kHz) / (16U * 1024U)) - 1U; - if(u32Div <= 0xFFU) - { - i2c->CLKTOUT = u32Div; - } - else - { - /* DIV4 enabled */ - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; - i2c->CLKTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ - } -} - - -/** - * @brief Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master write a byte data to Slave. - * - */ - -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - - I2C_START(i2c); - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master write multi bytes data to Slave. - * - */ - -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - case 0x28u: - if(u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Send Slave address with write bit */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u32txLen < 1u) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if((u32txLen < 1u) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] data[] A data array for write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if((u32txLen < u32wLen) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master to read a byte data from Slave. - * - */ -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if(u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if(u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if(u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - if(u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify an address(2 bytes) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Addr = 1u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if(u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while(u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch(I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if(u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if(u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2s.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2s.c deleted file mode 100644 index 6e0e5bb6f2b..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_i2s.c +++ /dev/null @@ -1,250 +0,0 @@ -/**************************************************************************//** - * @file i2s.c - * @version V0.10 - * @brief M480 I2S driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s); - -/** - * @brief This function is used to get I2S source clock frequency. - * @param[in] i2s is the base address of I2S module. - * @return I2S source clock frequency (Hz). - */ -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s) -{ - uint32_t u32Freq, u32ClkSrcSel; - - /* get I2S selection clock source */ - u32ClkSrcSel = CLK->CLKSEL3 & CLK_CLKSEL3_I2S0SEL_Msk; - - switch (u32ClkSrcSel) - { - case CLK_CLKSEL3_I2S0SEL_HXT: - u32Freq = __HXT; - break; - - case CLK_CLKSEL3_I2S0SEL_PLL: - u32Freq = CLK_GetPLLClockFreq(); - break; - - case CLK_CLKSEL3_I2S0SEL_HIRC: - u32Freq = __HIRC; - break; - - case CLK_CLKSEL3_I2S0SEL_PCLK0: - u32Freq = (uint32_t)CLK_GetPCLK0Freq(); - break; - - default: - u32Freq = __HIRC; - break; - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * The sample rate may not be used from the parameter, it depends on system's clock settings, - * but real sample rate used by system will be returned for reference. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are: - * - \ref I2S_MODE_MASTER - * - \ref I2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are: - * - \ref I2S_DATABIT_8 - * - \ref I2S_DATABIT_16 - * - \ref I2S_DATABIT_24 - * - \ref I2S_DATABIT_32 - * @param[in] u32MonoData: Set audio data to mono or not. Valid values are: - * - \ref I2S_ENABLE_MONO - * - \ref I2S_DISABLE_MONO - * @param[in] u32DataFormat: Data format. This is also used to select I2S or PCM(TDM) function. Valid values are: - * - \ref I2S_FORMAT_I2S - * - \ref I2S_FORMAT_I2S_MSB - * - \ref I2S_FORMAT_I2S_LSB - * - \ref I2S_FORMAT_PCM - * - \ref I2S_FORMAT_PCM_MSB - * - \ref I2S_FORMAT_PCM_LSB - * @return Real sample rate. - */ -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat) -{ - uint16_t u16Divider; - uint32_t u32BitRate, u32SrcClk; - - SYS->IPRST1 |= SYS_IPRST1_I2S0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2S0RST_Msk; - - i2s->CTL0 = u32MasterSlave | u32WordWidth | u32MonoData | u32DataFormat; - i2s->CTL1 = I2S_FIFO_TX_LEVEL_WORD_8 | I2S_FIFO_RX_LEVEL_WORD_8; - - u32SrcClk = I2S_GetSourceClockFreq(i2s); - - u32BitRate = u32SampleRate * (((u32WordWidth>>4U) & 0x3U) + 1U) * 16U; - //u16Divider = (uint16_t)((u32SrcClk/u32BitRate) >> 1U) - 1U; - u16Divider = (uint16_t)((((u32SrcClk * 10UL / u32BitRate) >> 1U) + 5UL) / 10UL) - 1U; - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_BCLKDIV_Msk) | ((uint32_t)u16Divider << 8U); - - /* calculate real sample rate */ - u32BitRate = u32SrcClk / (2U*((uint32_t)u16Divider+1U)); - u32SampleRate = u32BitRate / ((((u32WordWidth>>4U) & 0x3U) + 1U) * 16U); - - i2s->CTL0 |= I2S_CTL0_I2SEN_Msk; - - return u32SampleRate; -} - -/** - * @brief Disable I2S function and I2S clock. - * @param[in] i2s is the base address of I2S module. - * @return none - */ -void I2S_Close(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_I2SEN_Msk; -} - -/** - * @brief This function enables the interrupt according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return none - */ -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN |= u32Mask; -} - -/** - * @brief This function disables the interrupt according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return none - */ -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN &= ~u32Mask; -} - -/** - * @brief Enable MCLK . - * @param[in] i2s is the base address of I2S module. - * @param[in] u32BusClock is the target MCLK clock - * @return Actual MCLK clock - */ -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock) -{ - uint8_t u8Divider; - uint32_t u32SrcClk, u32Reg, u32Clock; - - u32SrcClk = I2S_GetSourceClockFreq(i2s); - if (u32BusClock == u32SrcClk) - { - u8Divider = 0U; - } - else - { - u8Divider = (uint8_t)(u32SrcClk/u32BusClock) >> 1U; - } - - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_MCLKDIV_Msk) | u8Divider; - - i2s->CTL0 |= I2S_CTL0_MCLKEN_Msk; - - u32Reg = i2s->CLKDIV & I2S_CLKDIV_MCLKDIV_Msk; - - if (u32Reg == 0U) - { - u32Clock = u32SrcClk; - } - else - { - u32Clock = ((u32SrcClk >> 1U) / u32Reg); - } - - return u32Clock; -} - -/** - * @brief Disable MCLK . - * @param[in] i2s is the base address of I2S module. - * @return none - */ -void I2S_DisableMCLK(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->CTL1 = ((i2s->CTL1 & ~(I2S_CTL1_TXTH_Msk | I2S_CTL1_RXTH_Msk)) | - (u32TxThreshold << I2S_CTL1_TXTH_Pos) | - (u32RxThreshold << I2S_CTL1_RXTH_Pos)); -} - - -/** - * @brief Configure PCM(TDM) function parameters, such as channel width, channel number and sync pulse width - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChannelWidth Channel width. Valid values are: - * - \ref I2S_TDM_WIDTH_8BIT - * - \ref I2S_TDM_WIDTH_16BIT - * - \ref I2S_TDM_WIDTH_24BIT - * - \ref I2S_TDM_WIDTH_32BIT - * @param[in] u32ChannelNum Channel number. Valid values are: - * - \ref I2S_TDM_2CH - * - \ref I2S_TDM_4CH - * - \ref I2S_TDM_6CH - * - \ref I2S_TDM_8CH - * @param[in] u32SyncWidth Width for sync pulse. Valid values are: - * - \ref I2S_TDM_SYNC_ONE_BCLK - * - \ref I2S_TDM_SYNC_ONE_CHANNEL - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth) -{ - i2s->CTL0 = ((i2s->CTL0 & ~(I2S_CTL0_TDMCHNUM_Msk | I2S_CTL0_CHWIDTH_Msk | I2S_CTL0_PCMSYNC_Msk)) | - (u32ChannelWidth << I2S_CTL0_CHWIDTH_Pos) | - (u32ChannelNum << I2S_CTL0_TDMCHNUM_Pos) | - (u32SyncWidth << I2S_CTL0_PCMSYNC_Pos)); -} - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_pdma.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_pdma.c deleted file mode 100644 index c806cc09a05..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_pdma.c +++ /dev/null @@ -1,446 +0,0 @@ -/**************************************************************************//** - * @file pdma.c - * @version V1.00 - * @brief M480 series PDMA driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - - -/** @addtogroup PDMA_EXPORTED_FUNCTIONS PDMA Exported Functions - @{ -*/ - -/** - * @brief PDMA Open - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable the PDMA channels. - */ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask) -{ - uint32_t i; - - for (i = 0UL; i < PDMA_CH_MAX; i++) - { - if ((1 << i) & u32Mask) - { - pdma->DSCT[i].CTL = 0UL; - } - } - - pdma->CHCTL |= u32Mask; -} - -/** - * @brief PDMA Close - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details This function disable all PDMA channels. - */ -void PDMA_Close(PDMA_T *pdma) -{ - pdma->CHCTL = 0UL; -} - -/** - * @brief Set PDMA Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Width Data width. Valid values are - * - \ref PDMA_WIDTH_8 - * - \ref PDMA_WIDTH_16 - * - \ref PDMA_WIDTH_32 - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected channel data width and transfer count. - */ -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXCNT_Msk | PDMA_DSCT_CTL_TXWIDTH_Msk); - pdma->DSCT[u32Ch].CTL |= (u32Width | ((u32TransCount - 1UL) << PDMA_DSCT_CTL_TXCNT_Pos)); -} - -/** - * @brief Set PDMA Stride Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestLen Destination stride count - * @param[in] u32SrcLen Source stride count - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected stride mode. - */ -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount) -{ - (pdma)->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - (pdma)->STRIDE[u32Ch].ASOCR = (u32DestLen << 16) | u32SrcLen; - (pdma)->STRIDE[u32Ch].STCR = u32TransCount; -} - -/** - * @brief Set PDMA Repeat - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestInterval Destination address interval count - * @param[in] u32SrcInterval Source address interval count - * @param[in] u32RepeatCount Repeat count - * - * @return None - * - * @details This function set the selected repeat. - */ -void PDMA_SetRepeat(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount) -{ - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - pdma->REPEAT[u32Ch].AICTL = ((u32DestInterval) << 16) | (u32SrcInterval); - pdma->REPEAT[u32Ch].RCNT = u32RepeatCount; -} - -/** - * @brief Set PDMA Transfer Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32SrcAddr Source address - * @param[in] u32SrcCtrl Source control attribute. Valid values are - * - \ref PDMA_SAR_INC - * - \ref PDMA_SAR_FIX - * @param[in] u32DstAddr Destination address - * @param[in] u32DstCtrl Destination control attribute. Valid values are - * - \ref PDMA_DAR_INC - * - \ref PDMA_DAR_FIX - * - * @return None - * - * @details This function set the selected channel source/destination address and attribute. - */ -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl) -{ - pdma->DSCT[u32Ch].SA = u32SrcAddr; - pdma->DSCT[u32Ch].DA = u32DstAddr; - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_SAINC_Msk | PDMA_DSCT_CTL_DAINC_Msk); - pdma->DSCT[u32Ch].CTL |= (u32SrcCtrl | u32DstCtrl); -} - -/** - * @brief Set PDMA Transfer Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Peripheral The selected peripheral. Valid values are - * - \ref PDMA_MEM - * - \ref PDMA_USB_TX - * - \ref PDMA_USB_RX - * - \ref PDMA_UART0_TX - * - \ref PDMA_UART0_RX - * - \ref PDMA_UART1_TX - * - \ref PDMA_UART1_RX - * - \ref PDMA_UART2_TX - * - \ref PDMA_UART2_RX - * - \ref PDMA_UART3_TX - * - \ref PDMA_UART3_RX - * - \ref PDMA_UART4_TX - * - \ref PDMA_UART4_RX - * - \ref PDMA_UART5_TX - * - \ref PDMA_UART5_RX - * - \ref PDMA_USCI0_TX - * - \ref PDMA_USCI0_RX - * - \ref PDMA_USCI1_TX - * - \ref PDMA_USCI1_RX - * - \ref PDMA_QSPI0_TX - * - \ref PDMA_QSPI0_RX - * - \ref PDMA_SPI0_TX - * - \ref PDMA_SPI0_RX - * - \ref PDMA_SPI1_TX - * - \ref PDMA_SPI1_RX - * - \ref PDMA_SPI2_TX - * - \ref PDMA_SPI2_RX - * - \ref PDMA_SPI3_TX - * - \ref PDMA_SPI3_RX - * - \ref PDMA_EPWM0_P1_RX - * - \ref PDMA_EPWM0_P2_RX - * - \ref PDMA_EPWM0_P3_RX - * - \ref PDMA_EPWM1_P1_RX - * - \ref PDMA_EPWM1_P2_RX - * - \ref PDMA_EPWM1_P3_RX - * - \ref PDMA_I2C0_TX - * - \ref PDMA_I2C0_RX - * - \ref PDMA_I2C1_TX - * - \ref PDMA_I2C1_RX - * - \ref PDMA_I2C2_TX - * - \ref PDMA_I2C2_RX - * - \ref PDMA_I2S0_TX - * - \ref PDMA_I2S0_RX - * - \ref PDMA_TMR0 - * - \ref PDMA_TMR1 - * - \ref PDMA_TMR2 - * - \ref PDMA_TMR3 - * - \ref PDMA_EADC0_RX - * - \ref PDMA_DAC0_TX - * - \ref PDMA_DAC1_TX - * - \ref PDMA_EPWM0_CH0_TX - * - \ref PDMA_EPWM0_CH1_TX - * - \ref PDMA_EPWM0_CH2_TX - * - \ref PDMA_EPWM0_CH3_TX - * - \ref PDMA_EPWM0_CH4_TX - * - \ref PDMA_EPWM0_CH5_TX - * - \ref PDMA_EPWM1_CH0_TX - * - \ref PDMA_EPWM1_CH1_TX - * - \ref PDMA_EPWM1_CH2_TX - * - \ref PDMA_EPWM1_CH3_TX - * - \ref PDMA_EPWM1_CH4_TX - * - \ref PDMA_EPWM1_CH5_TX - * - \ref PDMA_UART6_TX - * - \ref PDMA_UART6_RX - * - \ref PDMA_UART7_TX - * - \ref PDMA_UART7_RX - * - \ref PDMA_EADC1_RX - * @param[in] u32ScatterEn Scatter-gather mode enable - * @param[in] u32DescAddr Scatter-gather descriptor address - * - * @return None - * - * @details This function set the selected channel transfer mode. Include peripheral setting. - */ -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - pau32REQSEL[u32Ch / 4] = (pau32REQSEL[u32Ch / 4] & ~u32REQSEL_Msk) | (u32Peripheral << u32REQSEL_Pos); - - if (u32ScatterEn) - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_SCATTER; - pdma->DSCT[u32Ch].NEXT = u32DescAddr - (pdma->SCATBA); - } - else - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_BASIC; - } - } - else {} -} - -/** - * @brief Set PDMA Burst Type and Size - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32BurstType Burst mode or single mode. Valid values are - * - \ref PDMA_REQ_SINGLE - * - \ref PDMA_REQ_BURST - * @param[in] u32BurstSize Set the size of burst mode. Valid values are - * - \ref PDMA_BURST_128 - * - \ref PDMA_BURST_64 - * - \ref PDMA_BURST_32 - * - \ref PDMA_BURST_16 - * - \ref PDMA_BURST_8 - * - \ref PDMA_BURST_4 - * - \ref PDMA_BURST_2 - * - \ref PDMA_BURST_1 - * - * @return None - * - * @details This function set the selected channel burst type and size. - */ -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXTYPE_Msk | PDMA_DSCT_CTL_BURSIZE_Msk); - pdma->DSCT[u32Ch].CTL |= (u32BurstType | u32BurstSize); -} - -/** - * @brief Enable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable timeout function of the selected channel(s). - */ -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN |= u32Mask; -} - -/** - * @brief Disable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function disable timeout function of the selected channel(s). - */ -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN &= ~u32Mask; -} - -/** - * @brief Set PDMA Timeout Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32OnOff Enable/disable time out function - * @param[in] u32TimeOutCnt Timeout count - * - * @return None - * - * @details This function set the timeout count. - * @note M480 only supported channel 0/1. - */ -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt) -{ - if (u32Ch < 2) - { - __IO uint32_t *pau32TOC = (__IO uint32_t *)&pdma->TOC0_1; - uint32_t u32TOC_Pos, u32TOC_Msk; - - u32TOC_Pos = (u32Ch % 2) * 16 ; - u32TOC_Msk = PDMA_TOC0_1_TOC0_Msk << u32TOC_Pos; - pau32TOC[u32Ch / 2] = (pau32TOC[u32Ch / 2] & ~u32TOC_Msk) | (u32TimeOutCnt << u32TOC_Pos); - - if (u32OnOff) - pdma->TOUTEN |= (1 << u32Ch); - else - pdma->TOUTEN &= ~(1 << u32Ch); - } - else {} -} - -/** - * @brief Trigger PDMA - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This function trigger the selected channel. - */ -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch) -{ - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk, u32ChReq; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - - u32ChReq = (pau32REQSEL[u32Ch / 4] & u32REQSEL_Msk) >> u32REQSEL_Pos; - - if (u32ChReq == PDMA_MEM) - { - pdma->SWREQ = (1ul << u32Ch); - } - else {} -} - -/** - * @brief Enable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function enable the selected channel interrupt. - */ -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN |= (1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL &= ~PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN |= (1ul << u32Ch); - break; - - default: - break; - } -} - -/** - * @brief Disable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function disable the selected channel interrupt. - */ -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN &= ~(1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN &= ~(1ul << u32Ch); - break; - - default: - break; - } -} - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2014~2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_qei.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_qei.c deleted file mode 100644 index 225b7e16737..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_qei.c +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************//** - * @file qei.c - * @version V3.00 - * @brief Quadrature Encoder Interface (QEI) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QEI_Driver QEI Driver - @{ -*/ - -/** @addtogroup QEI_EXPORTED_FUNCTIONS QEI Exported Functions - @{ -*/ - -/** - * @brief Close QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function reset QEI configuration and stop QEI counting. - */ -void QEI_Close(QEI_T* qei) -{ - /* Reset QEI configuration */ - qei->CTL = (uint32_t)0; -} - -/** - * @brief Disable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function disable QEI specified interrupt. - */ -void QEI_DisableInt(QEI_T* qei, uint32_t u32IntSel) -{ - /* Disable QEI specified interrupt */ - QEI_DISABLE_INT(qei, u32IntSel); - - /* Disable NVIC QEI IRQ */ - if(qei ==(QEI_T*)QEI0) - { - NVIC_DisableIRQ((IRQn_Type)QEI0_IRQn); - } - else - { - NVIC_DisableIRQ((IRQn_Type)QEI1_IRQn); - } -} - -/** - * @brief Enable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function enable QEI specified interrupt. - */ -void QEI_EnableInt(QEI_T* qei, uint32_t u32IntSel) -{ - /* Enable QEI specified interrupt */ - QEI_ENABLE_INT(qei, u32IntSel); - - /* Enable NVIC QEI IRQ */ - if(qei == (QEI_T*)QEI0) - { - NVIC_EnableIRQ(QEI0_IRQn); - } - else - { - NVIC_EnableIRQ(QEI1_IRQn); - } -} - -/** - * @brief Open QEI in specified mode and enable input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Mode QEI counting mode. - * - \ref QEI_CTL_X4_FREE_COUNTING_MODE - * - \ref QEI_CTL_X2_FREE_COUNTING_MODE - * - \ref QEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref QEI_CTL_X2_COMPARE_COUNTING_MODE - * @param[in] u32Value The counter maximum value in compare-counting mode. - * @return None - * @details This function set QEI in specified mode and enable input. - */ -void QEI_Open(QEI_T* qei, uint32_t u32Mode, uint32_t u32Value) -{ - /* Set QEI function configuration */ - /* Set QEI counting mode */ - /* Enable IDX, QEA and QEB input to QEI controller */ - qei->CTL = (qei->CTL & (~QEI_CTL_MODE_Msk)) | ((u32Mode) | QEI_CTL_CHAEN_Msk | QEI_CTL_CHBEN_Msk | QEI_CTL_IDXEN_Msk); - - /* Set QEI maximum count value in in compare-counting mode */ - qei->CNTMAX = u32Value; -} - -/** - * @brief Start QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function enable QEI function and start QEI counting. - */ -void QEI_Start(QEI_T* qei) -{ - /* Enable QEI controller function */ - qei->CTL |= QEI_CTL_QEIEN_Msk; -} - -/** - * @brief Stop QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function disable QEI function and stop QEI counting. - */ -void QEI_Stop(QEI_T* qei) -{ - /* Disable QEI controller function */ - qei->CTL &= (~QEI_CTL_QEIEN_Msk); -} - - -/*@}*/ /* end of group QEI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QEI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_qspi.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_qspi.c deleted file mode 100644 index 29b1cf9759c..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_qspi.c +++ /dev/null @@ -1,860 +0,0 @@ -/**************************************************************************//** - * @file qspi.c - * @version V3.00 - * @brief M480 series QSPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32MasterSlave Decides the QSPI module is operating in master mode or in slave mode. (QSPI_SLAVE, QSPI_MASTER) - * @param[in] u32QSPIMode Decides the transfer timing. (QSPI_MODE_0, QSPI_MODE_1, QSPI_MODE_2, QSPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a QSPI transaction. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI peripheral clock. - * @details By default, the QSPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the QSPI clock divider setting will be 0. - * The actual clock rate may be different from the target QSPI clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the - * actual QSPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the QSPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t QSPI_Open(QSPI_T *qspi, - uint32_t u32MasterSlave, - uint32_t u32QSPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0U, u32Div, u32HCLKFreq, u32RetValue = 0U; - - if (u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32MasterSlave == QSPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_QSPIEN_Msk; - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - if (qspi == QSPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - else if (qspi == QSPI1) - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_QSPI1SEL_Msk)) | CLK_CLKSEL3_QSPI1SEL_PCLK1; - } - - /* Check clock source of QSPI */ - if (qspi == QSPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (qspi == QSPI1) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0xFFU) - { - u32Div = 0xFFU; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - } - else /* For slave mode, force the QSPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_QSPIEN_Msk; - - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - - /* Select PCLK as the clock source of QSPI */ - if (qspi == QSPI0) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if (qspi == QSPI1) - { - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_QSPI1SEL_Msk)) | CLK_CLKSEL3_QSPI1SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will reset QSPI controller. - */ -void QSPI_Close(QSPI_T *qspi) -{ - /* Reset QSPI */ - if (qspi == QSPI0) - { - SYS->IPRST1 |= SYS_IPRST1_QSPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_QSPI0RST_Msk; - } - else if (qspi == QSPI1) - { - SYS->IPRST2 |= SYS_IPRST2_QSPI1RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_QSPI1RST_Msk; - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI RX FIFO buffer. The RXEMPTY (QSPI_STATUS[8]) will be set to 1. - */ -void QSPI_ClearRxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI TX FIFO buffer. The TXEMPTY (QSPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void QSPI_ClearTxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void QSPI_DisableAutoSS(QSPI_T *qspi) -{ - qspi->SSCTL &= ~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (QSPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (QSPI_SS_ACTIVE_HIGH, QSPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - qspi->SSCTL = (qspi->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | QSPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the QSPI bus clock. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target QSPI bus clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - if (qspi == QSPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_QSPI0SEL_Msk)) | CLK_CLKSEL2_QSPI0SEL_PCLK0; - else if (qspi == QSPI1) - CLK->CLKSEL3 = (CLK->CLKSEL3 & (~CLK_CLKSEL3_QSPI1SEL_Msk)) | CLK_CLKSEL3_QSPI1SEL_PCLK1; - } - - /* Check clock source of QSPI */ - if (qspi == QSPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (qspi == QSPI1) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - return 0; - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - qspi->FIFOCTL = (qspi->FIFOCTL & ~(QSPI_FIFOCTL_TXTH_Msk | QSPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << QSPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << QSPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of QSPI bus clock. Only available in Master mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Actual QSPI bus clock frequency in Hz. - * @details This function will calculate the actual QSPI bus clock rate according to the QSPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t QSPI_GetBusClock(QSPI_T *qspi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc = 0; - - /* Get DIVIDER setting */ - u32Div = (qspi->CLKDIV & QSPI_CLKDIV_DIVIDER_Msk) >> QSPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of QSPI */ - if (qspi == QSPI0) - { - if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL2 & CLK_CLKSEL2_QSPI0SEL_Msk) == CLK_CLKSEL2_QSPI0SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if (qspi == QSPI1) - { - if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if ((CLK->CLKSEL3 & CLK_CLKSEL3_QSPI1SEL_Msk) == CLK_CLKSEL3_QSPI1SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - /* Return QSPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1U)); -} - -/** - * @brief Enable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL |= QSPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL &= ~QSPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get QSPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = qspi->STATUS & QSPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_UNIT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSINACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVUR_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVBE_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_TXUF_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear QSPI related interrupt flags specified by u32Mask parameter. - */ -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - if (u32Mask & QSPI_UNIT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & QSPI_SSACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & QSPI_SSINACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & QSPI_SLVUR_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & QSPI_SLVBE_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & QSPI_TXUF_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXOV_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get QSPI status. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_BUSY_MASK - * - \ref QSPI_RX_EMPTY_MASK - * - \ref QSPI_RX_FULL_MASK - * - \ref QSPI_TX_EMPTY_MASK - * - \ref QSPI_TX_FULL_MASK - * - \ref QSPI_TXRX_RESET_MASK - * - \ref QSPI_QSPIEN_STS_MASK - * - \ref QSPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = qspi->STATUS & QSPI_STATUS_BUSY_Msk; - /* Check busy status */ - if ((u32Mask & QSPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_BUSY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if ((u32Mask & QSPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if ((u32Mask & QSPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if ((u32Mask & QSPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if ((u32Mask & QSPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if ((u32Mask & QSPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TXRX_RESET_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_QSPIENSTS_Msk; - /* Check QSPIEN flag */ - if ((u32Mask & QSPI_QSPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_QSPIEN_STS_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SSLINE_Msk; - /* Check QSPIx_SS line status */ - if ((u32Mask & QSPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_rtc.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_rtc.c deleted file mode 100644 index e7de46e186d..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_rtc.c +++ /dev/null @@ -1,1095 +0,0 @@ -/**************************************************************************//** - * @file rtc.c - * @version V3.00 - * @brief M480 series RTC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @cond HIDDEN_SYMBOLS */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macro, type and constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_GLOBALS - -/*---------------------------------------------------------------------------------------------------------*/ -/* Global file scope (static) variables */ -/*---------------------------------------------------------------------------------------------------------*/ -static volatile uint32_t g_u32hiYear, g_u32loYear, g_u32hiMonth, g_u32loMonth, g_u32hiDay, g_u32loDay; -static volatile uint32_t g_u32hiHour, g_u32loHour, g_u32hiMin, g_u32loMin, g_u32hiSec, g_u32loSec; - -/** @endcond HIDDEN_SYMBOLS */ - - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Initialize RTC module and start counting - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This function is used to: \n - * 1. Write initial key to let RTC start count. \n - * 2. Input parameter indicates start date/time. \n - * 3. User has to make sure that parameters of RTC date/time are reasonable. \n - * @note Null pointer for using default starting date/time. - */ -void RTC_Open(S_RTC_TIME_DATA_T *sPt) -{ - RTC->INIT = RTC_INIT_KEY; - - if (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - RTC->INIT = RTC_INIT_KEY; - while (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - } - } - - if (sPt == 0) - { - } - else - { - /* Set RTC date and time */ - RTC_SetDateAndTime(sPt); - } -} - -/** - * @brief Disable RTC Clock - * - * @param None - * - * @return None - * - * @details This API will disable RTC peripheral clock and stops RTC counting. - */ -void RTC_Close(void) -{ - CLK->APBCLK0 &= ~CLK_APBCLK0_RTCCKEN_Msk; -} - -/** - * @brief Set Frequency Compensation Data - * - * @param[in] i32FrequencyX10000 Specify the RTC clock X10000, ex: 327736512 means 32773.6512. - * - * @return None - * - */ -void RTC_32KCalibration(int32_t i32FrequencyX10000) -{ - uint64_t u64Compensate; - int32_t i32RegInt, i32RegFra ; - - if (!(SYS->CSERVER & 0x1)) - { - u64Compensate = (uint64_t)(0x2710000000000); - u64Compensate = (uint64_t)(u64Compensate / (uint64_t)i32FrequencyX10000); - - if (u64Compensate >= (uint64_t)0x400000) - { - u64Compensate = (uint64_t)0x3FFFFF; - } - - RTC_WaitAccessEnable(); - RTC->FREQADJ = (uint32_t)u64Compensate; - } - else - { - /* Compute Integer and Fraction for RTC register*/ - i32RegInt = (i32FrequencyX10000 / 10000) - 32752; - i32RegFra = ((((i32FrequencyX10000 % 10000)) * 64) + 5000) / 10000; - - if (i32RegFra >= 0x40) - { - i32RegFra = 0x0; - i32RegInt++; - } - - /* Judge Integer part is reasonable */ - if ((i32RegInt < 0) | (i32RegInt > 31)) - { - return; - } - - RTC_WaitAccessEnable(); - RTC->FREQADJ = (uint32_t)((i32RegInt << 8) | i32RegFra); - } - -} - -/** - * @brief Get Current RTC Date and Time - * - * @param[out] sPt The returned pointer is specified the current RTC value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the current RTC date and time value. - */ -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get [Date digit] data */ - g_u32hiYear = (RTC->CAL & RTC_CAL_TENYEAR_Msk) >> RTC_CAL_TENYEAR_Pos; - g_u32loYear = (RTC->CAL & RTC_CAL_YEAR_Msk) >> RTC_CAL_YEAR_Pos; - g_u32hiMonth = (RTC->CAL & RTC_CAL_TENMON_Msk) >> RTC_CAL_TENMON_Pos; - g_u32loMonth = (RTC->CAL & RTC_CAL_MON_Msk) >> RTC_CAL_MON_Pos; - g_u32hiDay = (RTC->CAL & RTC_CAL_TENDAY_Msk) >> RTC_CAL_TENDAY_Pos; - g_u32loDay = (RTC->CAL & RTC_CAL_DAY_Msk) >> RTC_CAL_DAY_Pos; - - /* Get [Time digit] data */ - g_u32hiHour = (RTC->TIME & RTC_TIME_TENHR_Msk) >> RTC_TIME_TENHR_Pos; - g_u32loHour = (RTC->TIME & RTC_TIME_HR_Msk) >> RTC_TIME_HR_Pos; - g_u32hiMin = (RTC->TIME & RTC_TIME_TENMIN_Msk) >> RTC_TIME_TENMIN_Pos; - g_u32loMin = (RTC->TIME & RTC_TIME_MIN_Msk) >> RTC_TIME_MIN_Pos; - g_u32hiSec = (RTC->TIME & RTC_TIME_TENSEC_Msk) >> RTC_TIME_TENSEC_Pos; - g_u32loSec = (RTC->TIME & RTC_TIME_SEC_Msk) >> RTC_TIME_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10ul); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10ul); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10ul); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21ul) - { - sPt->u32AmPm = RTC_PM; - sPt->u32Hour -= 20ul; - } - else - { - sPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Get RTC Alarm Date and Time - * - * @param[out] sPt The returned pointer is specified the RTC alarm value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the RTC alarm date and time setting. - */ -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get alarm [Date digit] data */ - RTC_WaitAccessEnable(); - g_u32hiYear = (RTC->CALM & RTC_CALM_TENYEAR_Msk) >> RTC_CALM_TENYEAR_Pos; - g_u32loYear = (RTC->CALM & RTC_CALM_YEAR_Msk) >> RTC_CALM_YEAR_Pos; - g_u32hiMonth = (RTC->CALM & RTC_CALM_TENMON_Msk) >> RTC_CALM_TENMON_Pos; - g_u32loMonth = (RTC->CALM & RTC_CALM_MON_Msk) >> RTC_CALM_MON_Pos; - g_u32hiDay = (RTC->CALM & RTC_CALM_TENDAY_Msk) >> RTC_CALM_TENDAY_Pos; - g_u32loDay = (RTC->CALM & RTC_CALM_DAY_Msk) >> RTC_CALM_DAY_Pos; - - /* Get alarm [Time digit] data */ - RTC_WaitAccessEnable(); - g_u32hiHour = (RTC->TALM & RTC_TALM_TENHR_Msk) >> RTC_TALM_TENHR_Pos; - g_u32loHour = (RTC->TALM & RTC_TALM_HR_Msk) >> RTC_TALM_HR_Pos; - g_u32hiMin = (RTC->TALM & RTC_TALM_TENMIN_Msk) >> RTC_TALM_TENMIN_Pos; - g_u32loMin = (RTC->TALM & RTC_TALM_MIN_Msk) >> RTC_TALM_MIN_Pos; - g_u32hiSec = (RTC->TALM & RTC_TALM_TENSEC_Msk) >> RTC_TALM_TENSEC_Pos; - g_u32loSec = (RTC->TALM & RTC_TALM_SEC_Msk) >> RTC_TALM_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10ul); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10ul); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10ul); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21ul) - { - sPt->u32AmPm = RTC_PM; - sPt->u32Hour -= 20ul; - } - else - { - sPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - - } - else - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Update Current RTC Date and Time - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update current date and time to RTC. - */ -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCAL, u32RegTIME; - - if (sPt == NULL) - { - } - else - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == RTC_PM) - { - sPt->u32Hour += 20ul; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set Day of the Week */ - RTC_WaitAccessEnable(); - RTC->WEEKDAY = sPt->u32DayOfWeek; - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Current Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCAL = ((sPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((sPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((sPt->u32Month / 10ul) << 12); - u32RegCAL |= ((sPt->u32Month % 10ul) << 8); - u32RegCAL |= ((sPt->u32Day / 10ul) << 4); - u32RegCAL |= (sPt->u32Day % 10ul); - - u32RegTIME = ((sPt->u32Hour / 10ul) << 20); - u32RegTIME |= ((sPt->u32Hour % 10ul) << 16); - u32RegTIME |= ((sPt->u32Minute / 10ul) << 12); - u32RegTIME |= ((sPt->u32Minute % 10ul) << 8); - u32RegTIME |= ((sPt->u32Second / 10ul) << 4); - u32RegTIME |= (sPt->u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Calender and Time Loading */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - RTC->CAL = (uint32_t)u32RegCAL; - RTC_WaitAccessEnable(); - RTC->TIME = (uint32_t)u32RegTIME; - } -} - -/** - * @brief Update RTC Alarm Date and Time - * - * @param[in] sPt Specify the time property and alarm date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update alarm date and time setting to RTC. - */ -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCALM, u32RegTALM; - - if (sPt == NULL) - { - } - else - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == RTC_PM) - { - sPt->u32Hour += 20ul; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Alarm Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCALM = ((sPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((sPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((sPt->u32Month / 10ul) << 12); - u32RegCALM |= ((sPt->u32Month % 10ul) << 8); - u32RegCALM |= ((sPt->u32Day / 10ul) << 4); - u32RegCALM |= (sPt->u32Day % 10ul); - - u32RegTALM = ((sPt->u32Hour / 10ul) << 20); - u32RegTALM |= ((sPt->u32Hour % 10ul) << 16); - u32RegTALM |= ((sPt->u32Minute / 10ul) << 12); - u32RegTALM |= ((sPt->u32Minute % 10ul) << 8); - u32RegTALM |= ((sPt->u32Second / 10ul) << 4); - u32RegTALM |= (sPt->u32Second % 10ul); - - RTC_WaitAccessEnable(); - RTC->CALM = (uint32_t)u32RegCALM; - RTC_WaitAccessEnable(); - RTC->TALM = (uint32_t)u32RegTALM; - } -} - -/** - * @brief Update RTC Current Date - * - * @param[in] u32Year The year calendar digit of current RTC setting. - * @param[in] u32Month The month calendar digit of current RTC setting. - * @param[in] u32Day The day calendar digit of current RTC setting. - * @param[in] u32DayOfWeek The Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] - * - * @return None - * - * @details This API is used to update current date to RTC. - */ -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek) -{ - uint32_t u32RegCAL; - - u32RegCAL = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((u32Month / 10ul) << 12); - u32RegCAL |= ((u32Month % 10ul) << 8); - u32RegCAL |= ((u32Day / 10ul) << 4); - u32RegCAL |= (u32Day % 10ul); - - /* Set Day of the Week */ - RTC_WaitAccessEnable(); - RTC->WEEKDAY = u32DayOfWeek & RTC_WEEKDAY_WEEKDAY_Msk; - - /* Set RTC Calender Loading */ - RTC_WaitAccessEnable(); - RTC->CAL = (uint32_t)u32RegCAL; -} - -/** - * @brief Update RTC Current Time - * - * @param[in] u32Hour The hour time digit of current RTC setting. - * @param[in] u32Minute The minute time digit of current RTC setting. - * @param[in] u32Second The second time digit of current RTC setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update current time to RTC. - */ -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTIME; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == RTC_CLOCK_12) && (u32AmPm == RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTIME = ((u32Hour / 10ul) << 20); - u32RegTIME |= ((u32Hour % 10ul) << 16); - u32RegTIME |= ((u32Minute / 10ul) << 12); - u32RegTIME |= ((u32Minute % 10ul) << 8); - u32RegTIME |= ((u32Second / 10ul) << 4); - u32RegTIME |= (u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (u32TimeMode == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - RTC_WaitAccessEnable(); - RTC->TIME = (uint32_t)u32RegTIME; -} - -/** - * @brief Update RTC Alarm Date - * - * @param[in] u32Year The year calendar digit of RTC alarm setting. - * @param[in] u32Month The month calendar digit of RTC alarm setting. - * @param[in] u32Day The day calendar digit of RTC alarm setting. - * - * @return None - * - * @details This API is used to update alarm date setting to RTC. - */ -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day) -{ - uint32_t u32RegCALM; - - u32RegCALM = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((u32Month / 10ul) << 12); - u32RegCALM |= ((u32Month % 10ul) << 8); - u32RegCALM |= ((u32Day / 10ul) << 4); - u32RegCALM |= (u32Day % 10ul); - - RTC_WaitAccessEnable(); - - /* Set RTC Alarm Date */ - RTC->CALM = (uint32_t)u32RegCALM; -} - -/** - * @brief Update RTC Alarm Time - * - * @param[in] u32Hour The hour time digit of RTC alarm setting. - * @param[in] u32Minute The minute time digit of RTC alarm setting. - * @param[in] u32Second The second time digit of RTC alarm setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update alarm time setting to RTC. - */ -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTALM; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == RTC_CLOCK_12) && (u32AmPm == RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTALM = ((u32Hour / 10ul) << 20); - u32RegTALM |= ((u32Hour % 10ul) << 16); - u32RegTALM |= ((u32Minute / 10ul) << 12); - u32RegTALM |= ((u32Minute % 10ul) << 8); - u32RegTALM |= ((u32Second / 10ul) << 4); - u32RegTALM |= (u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (u32TimeMode == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - - /* Set RTC Alarm Time */ - RTC_WaitAccessEnable(); - RTC->TALM = (uint32_t)u32RegTALM; -} - -/** - * @brief Set RTC Alarm Date Mask Function - * - * @param[in] u8IsTenYMsk 1: enable 10-Year digit alarm mask; 0: disabled. - * @param[in] u8IsYMsk 1: enable 1-Year digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsTenDMsk 1: enable 10-Day digit alarm mask; 0: disabled. - * @param[in] u8IsDMsk 1: enable 1-Day digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm date mask function. - */ -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk) -{ - RTC_WaitAccessEnable(); - RTC->CAMSK = ((uint32_t)u8IsTenYMsk << RTC_CAMSK_MTENYEAR_Pos) | - ((uint32_t)u8IsYMsk << RTC_CAMSK_MYEAR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_CAMSK_MTENMON_Pos) | - ((uint32_t)u8IsMMsk << RTC_CAMSK_MMON_Pos) | - ((uint32_t)u8IsTenDMsk << RTC_CAMSK_MTENDAY_Pos) | - ((uint32_t)u8IsDMsk << RTC_CAMSK_MDAY_Pos); -} - -/** - * @brief Set RTC Alarm Time Mask Function - * - * @param[in] u8IsTenHMsk 1: enable 10-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsHMsk 1: enable 1-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Min digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Min digit alarm mask; 0: disabled. - * @param[in] u8IsTenSMsk 1: enable 10-Sec digit alarm mask; 0: disabled. - * @param[in] u8IsSMsk 1: enable 1-Sec digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm time mask function. - */ -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk) -{ - RTC_WaitAccessEnable(); - RTC->TAMSK = ((uint32_t)u8IsTenHMsk << RTC_TAMSK_MTENHR_Pos) | - ((uint32_t)u8IsHMsk << RTC_TAMSK_MHR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_TAMSK_MTENMIN_Pos) | - ((uint32_t)u8IsMMsk << RTC_TAMSK_MMIN_Pos) | - ((uint32_t)u8IsTenSMsk << RTC_TAMSK_MTENSEC_Pos) | - ((uint32_t)u8IsSMsk << RTC_TAMSK_MSEC_Pos); -} - -/** - * @brief Get Day of the Week - * - * @param None - * - * @retval 0 Sunday - * @retval 1 Monday - * @retval 2 Tuesday - * @retval 3 Wednesday - * @retval 4 Thursday - * @retval 5 Friday - * @retval 6 Saturday - * - * @details This API is used to get day of the week of current RTC date. - */ -uint32_t RTC_GetDayOfWeek(void) -{ - return (RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk); -} - -/** - * @brief Set RTC Tick Period Time - * - * @param[in] u32TickSelection It is used to set the RTC tick period time for Periodic Time Tick request. \n - * It consists of: - * - \ref RTC_TICK_1_SEC : Time tick is 1 second - * - \ref RTC_TICK_1_2_SEC : Time tick is 1/2 second - * - \ref RTC_TICK_1_4_SEC : Time tick is 1/4 second - * - \ref RTC_TICK_1_8_SEC : Time tick is 1/8 second - * - \ref RTC_TICK_1_16_SEC : Time tick is 1/16 second - * - \ref RTC_TICK_1_32_SEC : Time tick is 1/32 second - * - \ref RTC_TICK_1_64_SEC : Time tick is 1/64 second - * - \ref RTC_TICK_1_128_SEC : Time tick is 1/128 second - * - * @return None - * - * @details This API is used to set RTC tick period time for each tick interrupt. - */ -void RTC_SetTickPeriod(uint32_t u32TickSelection) -{ - RTC_WaitAccessEnable(); - - RTC->TICK = (RTC->TICK & ~RTC_TICK_TICK_Msk) | u32TickSelection; -} - -/** - * @brief Enable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - \ref RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP1IEN_Msk : Tamper 1 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP3IEN_Msk : Tamper 3 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP5IEN_Msk : Tamper 5 Pin Event Detection interrupt - * - * @return None - * - * @details This API is used to enable the specify RTC interrupt function. - */ -void RTC_EnableInt(uint32_t u32IntFlagMask) -{ - RTC_WaitAccessEnable(); - RTC->INTEN |= u32IntFlagMask; -} - -/** - * @brief Disable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - \ref RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP1IEN_Msk : Tamper 1 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP3IEN_Msk : Tamper 3 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt - * - \ref RTC_INTEN_TAMP5IEN_Msk : Tamper 5 Pin Event Detection interrupt - * - * @return None - * - * @details This API is used to disable the specify RTC interrupt function. - */ -void RTC_DisableInt(uint32_t u32IntFlagMask) -{ - RTC_WaitAccessEnable(); - RTC->INTEN &= ~u32IntFlagMask; - RTC_WaitAccessEnable(); - RTC->INTSTS = u32IntFlagMask; -} - -/** - * @brief Enable Spare Registers Access - * - * @param None - * - * @return None - * - * @details This API is used to enable the spare registers 0~19 can be accessed. - */ -void RTC_EnableSpareAccess(void) -{ - RTC_WaitAccessEnable(); - - RTC->SPRCTL |= RTC_SPRCTL_SPRRWEN_Msk; -} - -/** - * @brief Disable Spare Register - * - * @param None - * - * @return None - * - * @details This API is used to disable the spare register 0~19 cannot be accessed. - */ -void RTC_DisableSpareRegister(void) -{ - RTC_WaitAccessEnable(); - - RTC->SPRCTL &= ~RTC_SPRCTL_SPRRWEN_Msk; -} - -/** - * @brief Static Tamper Detect - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref RTC_TAMPER5_SELECT - * - \ref RTC_TAMPER4_SELECT - * - \ref RTC_TAMPER3_SELECT - * - \ref RTC_TAMPER2_SELECT - * - \ref RTC_TAMPER1_SELECT - * - \ref RTC_TAMPER0_SELECT - * - * @param[in] u32DetecLevel Tamper pin detection level select. Possible options are - * - \ref RTC_TAMPER_HIGH_LEVEL_DETECT - * - \ref RTC_TAMPER_LOW_LEVEL_DETECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref RTC_TAMPER_DEBOUNCE_ENABLE - * - \ref RTC_TAMPER_DEBOUNCE_DISABLE - * - * @return None - * - * @details This API is used to enable the tamper pin detect function with specify trigger condition. - */ -void RTC_StaticTamperEnable(uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - RTC_WaitAccessEnable(); - u32Reg = RTC->TAMPCTL; - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | (u32DetecLevel << RTC_TAMPCTL_TAMP0LV_Pos) | - (u32DebounceEn << RTC_TAMPCTL_TAMP0DBEN_Pos)); - - for (i = 0ul; i < MAX_TAMPER_PIN_NUM; i++) - { - if (u32TamperSelect & (0x1ul << i)) - { - u32Reg &= ~((RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP0LV_Msk | RTC_TAMPCTL_TAMP0DBEN_Msk) << (i * 4ul)); - u32Reg |= (u32TmpReg << (i * 4ul)); - } - } - - RTC_WaitAccessEnable(); - RTC->TAMPCTL = u32Reg; - -} - -/** - * @brief Static Tamper Disable - * - * @param[in] u32TamperSelect Tamper pin select. Possible options are - * - \ref RTC_TAMPER5_SELECT - * - \ref RTC_TAMPER4_SELECT - * - \ref RTC_TAMPER3_SELECT - * - \ref RTC_TAMPER2_SELECT - * - \ref RTC_TAMPER1_SELECT - * - \ref RTC_TAMPER0_SELECT - * - * @return None - * - * @details This API is used to disable the static tamper pin detect. - */ -void RTC_StaticTamperDisable(uint32_t u32TamperSelect) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - - RTC_WaitAccessEnable(); - u32Reg = RTC->TAMPCTL; - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk); - - for (i = 0ul; i < MAX_TAMPER_PIN_NUM; i++) - { - if (u32TamperSelect & (0x1ul << i)) - { - u32Reg &= ~(u32TmpReg << (i * 4ul)); - } - } - - RTC_WaitAccessEnable(); - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Detect - * - * @param[in] u32PairSel Tamper pin detection enable. Possible options are - * - \ref RTC_PAIR0_SELECT - * - \ref RTC_PAIR1_SELECT - * - \ref RTC_PAIR2_SELECT - * - * @param[in] u32DebounceEn Tamper pin de-bounce enable - * - \ref RTC_TAMPER_DEBOUNCE_ENABLE - * - \ref RTC_TAMPER_DEBOUNCE_DISABLE - * - * @param[in] u32Pair1Source Dynamic Pair 1 Input Source Select - * 0: Pair 1 source select tamper 2 - * 1: Pair 1 source select tamper 0 - * - * @param[in] u32Pair2Source Dynamic Pair 2 Input Source Select - * 0: Pair 2 source select tamper 4 - * 1: Pair 2 source select tamper 0 - * - * @return None - * - * @details This API is used to enable the dynamic tamper. - */ -void RTC_DynamicTamperEnable(uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2Debounce, u32Tamper4Debounce; - - RTC_WaitAccessEnable(); - u32Reg = RTC->TAMPCTL; - - u32Tamper2Debounce = u32Reg & RTC_TAMPCTL_TAMP2DBEN_Msk; - u32Tamper4Debounce = u32Reg & RTC_TAMPCTL_TAMP4DBEN_Msk; - - u32Reg &= ~(RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_TAMP2EN_Msk | - RTC_TAMPCTL_TAMP3EN_Msk | RTC_TAMPCTL_TAMP4EN_Msk | RTC_TAMPCTL_TAMP5EN_Msk); - u32Reg &= ~(RTC_TAMPCTL_DYN1ISS_Msk | RTC_TAMPCTL_DYN2ISS_Msk); - u32Reg |= ((u32Pair1Source & 0x1ul) << RTC_TAMPCTL_DYN1ISS_Pos) | ((u32Pair2Source & 0x1ul) << RTC_TAMPCTL_DYN2ISS_Pos); - - if (u32DebounceEn) - { - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | - RTC_TAMPCTL_TAMP0DBEN_Msk | RTC_TAMPCTL_TAMP1DBEN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - } - else - { - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - } - - for (i = 0ul; i < MAX_PAIR_NUM; i++) - { - if (u32PairSel & (0x1ul << i)) - { - u32Reg &= ~((RTC_TAMPCTL_TAMP0DBEN_Msk | RTC_TAMPCTL_TAMP1DBEN_Msk) << (i * 8ul)); - u32Reg |= (u32TmpReg << (i * 8ul)); - } - } - - if ((u32Pair1Source) && (u32PairSel & RTC_PAIR1_SELECT)) - { - u32Reg &= ~RTC_TAMPCTL_TAMP2EN_Msk; - u32Reg |= u32Tamper2Debounce; - } - - if ((u32Pair2Source) && (u32PairSel & RTC_PAIR2_SELECT)) - { - u32Reg &= ~RTC_TAMPCTL_TAMP4EN_Msk; - u32Reg |= u32Tamper4Debounce; - } - - RTC_WaitAccessEnable(); - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Dynamic Tamper Disable - * - * @param[in] u32PairSel Tamper pin detection enable. Possible options are - * - \ref RTC_PAIR0_SELECT - * - \ref RTC_PAIR1_SELECT - * - \ref RTC_PAIR2_SELECT - * - * @return None - * - * @details This API is used to disable the dynamic tamper. - */ -void RTC_DynamicTamperDisable(uint32_t u32PairSel) -{ - uint32_t i; - uint32_t u32Reg; - uint32_t u32TmpReg; - uint32_t u32Tamper2En = 0ul, u32Tamper4En = 0ul; - - RTC_WaitAccessEnable(); - u32Reg = RTC->TAMPCTL; - - if ((u32Reg & RTC_TAMPCTL_DYN1ISS_Msk) && (u32PairSel & RTC_PAIR1_SELECT)) - { - u32Tamper2En = u32Reg & RTC_TAMPCTL_TAMP2EN_Msk; - } - - if ((u32Reg & RTC_TAMPCTL_DYN2ISS_Msk) && (u32PairSel & RTC_PAIR2_SELECT)) - { - u32Tamper4En = u32Reg & RTC_TAMPCTL_TAMP4EN_Msk; - } - - u32TmpReg = (RTC_TAMPCTL_TAMP0EN_Msk | RTC_TAMPCTL_TAMP1EN_Msk | RTC_TAMPCTL_DYNPR0EN_Msk); - - for (i = 0ul; i < MAX_PAIR_NUM; i++) - { - if (u32PairSel & (0x1ul << i)) - { - u32Reg &= ~(u32TmpReg << ((i * 8ul))); - } - } - - u32Reg |= (u32Tamper2En | u32Tamper4En); - - RTC_WaitAccessEnable(); - RTC->TAMPCTL = u32Reg; -} - -/** - * @brief Config dynamic tamper - * - * @param[in] u32ChangeRate The dynamic tamper output change rate - * - \ref RTC_2POW10_CLK - * - \ref RTC_2POW11_CLK - * - \ref RTC_2POW12_CLK - * - \ref RTC_2POW13_CLK - * - \ref RTC_2POW14_CLK - * - \ref RTC_2POW15_CLK - * - \ref RTC_2POW16_CLK - * - \ref RTC_2POW17_CLK - * - * @param[in] u32SeedReload Reload new seed or not - * 0: not reload new seed - * 1: reload new seed - * - * @param[in] u32RefPattern Reference pattern - * - \ref REF_RANDOM_PATTERN - * - \ref REF_PREVIOUS_PATTERN - * - \ref REF_SEED - * - * @param[in] u32Seed Seed Value (0x0 ~ 0xFFFFFFFF) - * - * @return None - * - * @details This API is used to config dynamic tamper setting. - */ -void RTC_DynamicTamperConfig(uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed) -{ - uint32_t u32Reg; - RTC_WaitAccessEnable(); - u32Reg = RTC->TAMPCTL; - - u32Reg &= ~(RTC_TAMPCTL_DYNSRC_Msk | RTC_TAMPCTL_SEEDRLD_Msk | RTC_TAMPCTL_DYNRATE_Msk); - - u32Reg |= (u32ChangeRate) | ((u32SeedReload & 0x1ul) << RTC_TAMPCTL_SEEDRLD_Pos) | - ((u32RefPattern & 0x3ul) << RTC_TAMPCTL_DYNSRC_Pos); - - RTC_WaitAccessEnable(); - RTC->TAMPSEED = u32Seed; /* need set seed value before re-load seed */ - RTC_WaitAccessEnable(); - RTC->TAMPCTL = u32Reg; -} - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sc.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sc.c deleted file mode 100644 index 785b86cd4b2..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sc.c +++ /dev/null @@ -1,400 +0,0 @@ -/**************************************************************************//** - * @file sc.c - * @version V3.00 - * @brief M480 Smartcard(SC) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/* Below are variables used locally by SC driver and does not want to parse by doxygen unless HIDDEN_SYMBOLS is defined */ -/** @cond HIDDEN_SYMBOLS */ -static uint32_t u32CardStateIgnore[SC_INTERFACE_NUM] = {0UL, 0UL, 0UL}; - -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_FUNCTIONS SC Exported Functions - @{ -*/ - -/** - * @brief This function indicates specified smartcard slot status - * @param[in] sc Base address of smartcard module - * @return Card insert status - * @retval TRUE Card insert - * @retval FALSE Card remove - */ -uint32_t SC_IsCardInserted(SC_T *sc) -{ - uint32_t ret; - /* put conditions into two variable to remove IAR compilation warning */ - uint32_t cond1 = ((sc->STATUS & SC_STATUS_CDPINSTS_Msk) >> SC_STATUS_CDPINSTS_Pos); - uint32_t cond2 = ((sc->CTL & SC_CTL_CDLV_Msk) >> SC_CTL_CDLV_Pos); - - if((sc == SC0) && (u32CardStateIgnore[0] == 1UL)) - { - ret = (uint32_t)TRUE; - } - else if((sc == SC1) && (u32CardStateIgnore[1] == 1UL)) - { - ret = (uint32_t)TRUE; - } - else if((sc == SC2) && (u32CardStateIgnore[2] == 1UL)) - { - ret = (uint32_t)TRUE; - } - else if(cond1 != cond2) - { - ret = (uint32_t)FALSE; - } - else - { - ret = (uint32_t)TRUE; - } - return ret; -} - -/** - * @brief This function reset both transmit and receive FIFO of specified smartcard module - * @param[in] sc Base address of smartcard module - * @return None - */ -void SC_ClearFIFO(SC_T *sc) -{ - while(sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk); -} - -/** - * @brief This function disable specified smartcard module - * @param[in] sc Base address of smartcard module - * @return None - */ -void SC_Close(SC_T *sc) -{ - sc->INTEN = 0UL; - while(sc->PINCTL & SC_PINCTL_SYNC_Msk) - { - ; - } - sc->PINCTL = 0UL; - sc->ALTCTL = 0UL; - while(sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - sc->CTL = 0UL; -} - -/** - * @brief This function initialized smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32CardDet Card detect polarity, select the CD pin state which indicates card absent. Could be - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * -\ref SC_PIN_STATE_IGNORE, no card detect pin, always assumes card present - * @param[in] u32PWR Power on polarity, select the PWR pin state which could set smartcard VCC to high level. Could be - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * @return None - */ -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR) -{ - uint32_t u32Reg = 0UL, u32Intf; - - if(sc == SC0) - { - u32Intf = 0UL; - } - else if(sc == SC1) - { - u32Intf = 1UL; - } - else - { - u32Intf = 2UL; - } - - if(u32CardDet != SC_PIN_STATE_IGNORE) - { - u32Reg = u32CardDet ? 0UL: SC_CTL_CDLV_Msk; - u32CardStateIgnore[u32Intf] = 0UL; - } - else - { - u32CardStateIgnore[u32Intf] = 1UL; - } - sc->PINCTL = u32PWR ? 0UL : SC_PINCTL_PWRINV_Msk; - while(sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_TMRSEL_Msk | u32Reg; -} - -/** - * @brief This function reset specified smartcard module to its default state for activate smartcard - * @param[in] sc Base address of smartcard module - * @return None - */ -void SC_ResetReader(SC_T *sc) -{ - uint32_t u32Intf; - - if(sc == SC0) - { - u32Intf = 0UL; - } - else if(sc == SC1) - { - u32Intf = 1UL; - } - else - { - u32Intf = 2UL; - } - - /* Reset FIFO, enable auto de-activation while card removal */ - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk | SC_ALTCTL_ADACEN_Msk); - /* Set Rx trigger level to 1 character, longest card detect debounce period, disable error retry (EMV ATR does not use error retry) */ - while(sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - sc->CTL &= ~(SC_CTL_RXTRGLV_Msk | - SC_CTL_CDDBSEL_Msk | - SC_CTL_TXRTY_Msk | - SC_CTL_TXRTYEN_Msk | - SC_CTL_RXRTY_Msk | - SC_CTL_RXRTYEN_Msk); - while(sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - /* Enable auto convention, and all three smartcard internal timers */ - sc->CTL |= SC_CTL_AUTOCEN_Msk | SC_CTL_TMRSEL_Msk; - /* Disable Rx timeout */ - sc->RXTOUT = 0UL; - /* 372 clocks per ETU by default */ - sc->ETUCTL= 371UL; - - - /* Enable necessary interrupt for smartcard operation */ - if(u32CardStateIgnore[u32Intf]) /* Do not enable card detect interrupt if card present state ignore */ - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_ACERRIEN_Msk); - } - else - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_CDIEN_Msk | - SC_INTEN_ACERRIEN_Msk); - } - return; -} - -/** - * @brief This function block guard time (BGT) of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32BGT Block guard time using ETU as unit, valid range are between 1 ~ 32 - * @return None - */ -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT) -{ - sc->CTL = (sc->CTL & ~SC_CTL_BGT_Msk) | ((u32BGT - 1UL) << SC_CTL_BGT_Pos); -} - -/** - * @brief This function character guard time (CGT) of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32CGT Character guard time using ETU as unit, valid range are between 11 ~ 267 - * @return None - */ -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT) -{ - u32CGT -= sc->CTL & SC_CTL_NSB_Msk ? 11UL: 12UL; - sc->EGT = u32CGT; -} - -/** - * @brief This function stop all smartcard timer of specified smartcard module - * @param[in] sc Base address of smartcard module - * @return None - * @note This function stop the timers within smartcard module, \b not timer module - */ -void SC_StopAllTimer(SC_T *sc) -{ - while(sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - sc->ALTCTL &= ~(SC_ALTCTL_CNTEN0_Msk | SC_ALTCTL_CNTEN1_Msk | SC_ALTCTL_CNTEN2_Msk); -} - -/** - * @brief This function configure and start a smartcard timer of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32TimerNum Timer to start. Valid values are 0, 1, 2. - * @param[in] u32Mode Timer operating mode, valid values are: - * - \ref SC_TMR_MODE_0 - * - \ref SC_TMR_MODE_1 - * - \ref SC_TMR_MODE_2 - * - \ref SC_TMR_MODE_3 - * - \ref SC_TMR_MODE_4 - * - \ref SC_TMR_MODE_5 - * - \ref SC_TMR_MODE_6 - * - \ref SC_TMR_MODE_7 - * - \ref SC_TMR_MODE_8 - * - \ref SC_TMR_MODE_F - * @param[in] u32ETUCount Timer timeout duration, ETU based. For timer 0, valid range are between 1~0x1000000ETUs. - * For timer 1 and timer 2, valid range are between 1 ~ 0x100 ETUs - * @return None - * @note This function start the timer within smartcard module, \b not timer module - * @note Depend on the timer operating mode, timer may not start counting immediately - */ -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount) -{ - uint32_t reg = u32Mode | (SC_TMRCTL0_CNT_Msk & (u32ETUCount - 1UL)); - while(sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - if(u32TimerNum == 0UL) - { - while(sc->TMRCTL0 & SC_TMRCTL0_SYNC_Msk) - { - ; - } - sc->TMRCTL0 = reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN0_Msk; - } - else if(u32TimerNum == 1UL) - { - while(sc->TMRCTL1 & SC_TMRCTL1_SYNC_Msk) - { - ; - } - sc->TMRCTL1 = reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - while(sc->TMRCTL2 & SC_TMRCTL2_SYNC_Msk) - { - ; - } - sc->TMRCTL2 = reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief This function stop a smartcard timer of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32TimerNum Timer to stop. Valid values are 0, 1, 2. - * @return None - * @note This function stop the timer within smartcard module, \b not timer module - */ -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum) -{ - while(sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - if(u32TimerNum == 0UL) - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN0_Msk; - } - else if(u32TimerNum == 1UL) - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief This function gets smartcard clock frequency. - * @param[in] sc Base address of smartcard module - * @return Smartcard frequency in kHz - */ -uint32_t SC_GetInterfaceClock(SC_T *sc) -{ - uint32_t u32ClkSrc, u32Num, u32Clk; - - if(sc == SC0) - { - u32Num = 0UL; - } - else if(sc == SC1) - { - u32Num = 1UL; - } - else - { - u32Num = 2UL; - } - - u32ClkSrc = (CLK->CLKSEL3 >> (2UL * u32Num)) & CLK_CLKSEL3_SC0SEL_Msk; - - /* Get smartcard module clock */ - if(u32ClkSrc == 0UL) - { - u32Clk = __HXT; - } - else if(u32ClkSrc == 1UL) - { - u32Clk = CLK_GetPLLClockFreq(); - } - else if(u32ClkSrc == 2UL) - { - if(u32Num == 1UL) - { - u32Clk = CLK_GetPCLK1Freq(); - } - else - { - u32Clk = CLK_GetPCLK0Freq(); - } - } - else - { - u32Clk = __HIRC; - } - - u32Clk /= (((CLK->CLKDIV1 >> (8UL * u32Num)) & CLK_CLKDIV1_SC0DIV_Msk) + 1UL) * 1000UL; - return u32Clk; -} - -/*@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_scuart.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_scuart.c deleted file mode 100644 index 7fa2f5a38e5..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_scuart.c +++ /dev/null @@ -1,242 +0,0 @@ -/**************************************************************************//** - * @file scuart.c - * @version V3.00 - * @brief M480 Smartcard UART mode (SCUART) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -static uint32_t SCUART_GetClock(SC_T *sc); - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/** - * @brief The function is used to disable smartcard interface UART mode. - * @param sc The base address of smartcard module. - * @return None - */ -void SCUART_Close(SC_T* sc) -{ - sc->INTEN = 0UL; - sc->UARTCTL = 0UL; - sc->CTL = 0UL; - -} -/** @cond HIDDEN_SYMBOLS */ -/** - * @brief This function returns module clock of specified SC interface - * @param[in] sc The base address of smartcard module. - * @return Module clock of specified SC interface - */ -static uint32_t SCUART_GetClock(SC_T *sc) -{ - uint32_t u32ClkSrc, u32Num, u32Clk; - - if(sc == SC0) - { - u32Num = 0UL; - } - else if(sc == SC1) - { - u32Num = 1UL; - } - else - { - u32Num = 2UL; - } - - u32ClkSrc = (CLK->CLKSEL3 >> (2UL * u32Num)) & CLK_CLKSEL3_SC0SEL_Msk; - - /* Get smartcard module clock */ - if(u32ClkSrc == 0UL) - { - u32Clk = __HXT; - } - else if(u32ClkSrc == 1UL) - { - u32Clk = CLK_GetPLLClockFreq(); - } - else if(u32ClkSrc == 2UL) - { - if(u32Num == 1UL) - { - u32Clk = CLK_GetPCLK1Freq(); - } - else - { - u32Clk = CLK_GetPCLK0Freq(); - } - } - else - { - u32Clk = __HIRC; - } - - u32Clk /= (((CLK->CLKDIV1 >> (8UL * u32Num)) & CLK_CLKDIV1_SC0DIV_Msk) + 1UL); - - - return u32Clk; -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief This function use to enable smartcard module UART mode and set baudrate. - * @param[in] sc The base address of smartcard module. - * @param[in] u32baudrate Target baudrate of smartcard module. - * @return Actual baudrate of smartcard mode - * @details This function configures character width to 8 bits, 1 stop bit, and no parity. - * And can use \ref SCUART_SetLineConfig function to update these settings - * The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_Open(SC_T* sc, uint32_t u32baudrate) -{ - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - /* Calculate divider for target baudrate */ - u32Div = (u32Clk + (u32baudrate >> 1) - 1UL) / u32baudrate - 1UL; - - /* Enable smartcard interface and stop bit = 1 */ - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk; - /* Enable UART mode, disable parity and 8 bit per character */ - sc->UARTCTL = SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk; - sc->ETUCTL = u32Div; - - return(u32Clk / (u32Div + 1UL)); -} - -/** - * @brief The function is used to read Rx data from RX FIFO. - * @param[in] sc The base address of smartcard module. - * @param[in] pu8RxBuf The buffer to store receive the data - * @param[in] u32ReadBytes Target number of characters to receive - * @return Actual character number reads to buffer - * @note This function does not block and return immediately if there's no data available - */ -uint32_t SCUART_Read(SC_T* sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count; - - for(u32Count = 0UL; u32Count < u32ReadBytes; u32Count++) - { - if(SCUART_GET_RX_EMPTY(sc)) /* no data available */ - { - break; - } - pu8RxBuf[u32Count] = (uint8_t)SCUART_READ(sc); /* get data from FIFO */ - } - - return u32Count; -} - -/** - * @brief This function use to configure smartcard UART mode line setting. - * @param[in] sc The base address of smartcard module. - * @param[in] u32Baudrate Target baudrate of smartcard module. If this value is 0, UART baudrate will not change. - * @param[in] u32DataWidth The data length, could be - * - \ref SCUART_CHAR_LEN_5 - * - \ref SCUART_CHAR_LEN_6 - * - \ref SCUART_CHAR_LEN_7 - * - \ref SCUART_CHAR_LEN_8 - * @param[in] u32Parity The parity setting, could be - * - \ref SCUART_PARITY_NONE - * - \ref SCUART_PARITY_ODD - * - \ref SCUART_PARITY_EVEN - * @param[in] u32StopBits The stop bit length, could be - * - \ref SCUART_STOP_BIT_1 - * - \ref SCUART_STOP_BIT_2 - * @return Actual baudrate of smartcard - * @details The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_SetLineConfig(SC_T* sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits) -{ - - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - if(u32Baudrate == 0UL) /* keep original baudrate setting */ - { - u32Div = sc->ETUCTL & SC_ETUCTL_ETURDIV_Msk; - } - else - { - /* Calculate divider for target baudrate */ - u32Div = (u32Clk + (u32Baudrate >> 1) - 1UL)/ u32Baudrate - 1UL; - sc->ETUCTL = u32Div; - } - /* Set stop bit */ - sc->CTL = u32StopBits | SC_CTL_SCEN_Msk; - /* Set character width and parity */ - sc->UARTCTL = u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk; - - return(u32Clk / (u32Div + 1UL)); -} - -/** - * @brief This function use to set receive timeout count. - * @param[in] sc The base address of smartcard module. - * @param[in] u32TOC Rx timeout counter, using baudrate as counter unit. Valid range are 0~0x1FF, - * set this value to 0 will disable timeout counter - * @return None - * @details The time-out counter resets and starts counting whenever the RX buffer received a - * new data word. Once the counter decrease to 1 and no new data is received or CPU - * does not read any data from FIFO, a receiver time-out interrupt will be generated. - */ -void SCUART_SetTimeoutCnt(SC_T* sc, uint32_t u32TOC) -{ - sc->RXTOUT= u32TOC; -} - - -/** - * @brief This function is to write data into transmit FIFO to send data out. - * @param[in] sc The base address of smartcard module. - * @param[in] pu8TxBuf The buffer containing data to send to transmit FIFO. - * @param[in] u32WriteBytes Number of data to send. - * @return None - * @note This function blocks until all data write into FIFO - */ -void SCUART_Write(SC_T* sc,uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count; - - for(u32Count = 0UL; u32Count != u32WriteBytes; u32Count++) - { - /* Wait 'til FIFO not full */ - while(SCUART_GET_TX_FULL(sc)) - { - ; - } - /* Write 1 byte to FIFO */ - sc->DAT = pu8TxBuf[u32Count]; - } -} - - -/*@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SCUART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sdh.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sdh.c deleted file mode 100644 index dbb323b3890..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sdh.c +++ /dev/null @@ -1,1275 +0,0 @@ -/**************************************************************************//** - * @file SDH.c - * @version V1.00 - * @brief M480 SDH driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ -#define SDH_BLOCK_SIZE 512ul - -/** @cond HIDDEN_SYMBOLS */ - -/* global variables */ -/* For response R3 (such as ACMD41, CRC-7 is invalid; but SD controller will still */ -/* calculate CRC-7 and get an error result, software should ignore this error and clear SDISR [CRC_IF] flag */ -/* _sd_uR3_CMD is the flag for it. 1 means software should ignore CRC-7 error */ - -static uint32_t _SDH0_ReferenceClock, _SDH1_ReferenceClock; - -#ifdef __ICCARM__ -#pragma data_alignment = 4 -static uint8_t _SDH0_ucSDHCBuffer[512]; -static uint8_t _SDH1_ucSDHCBuffer[512]; -#else -static uint8_t _SDH0_ucSDHCBuffer[512] __attribute__((aligned(4))); -static uint8_t _SDH1_ucSDHCBuffer[512] __attribute__((aligned(4))); -#endif - -SDH_INFO_T SD0, SD1; - -void SDH_CheckRB(SDH_T *sdh) -{ - while(1) - { - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - if ((sdh->INTSTS & SDH_INTSTS_DAT0STS_Msk) == SDH_INTSTS_DAT0STS_Msk) - { - break; - } - } -} - - -uint32_t SDH_SDCommand(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf, val = 0ul; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL&(~SDH_CTL_CMDCODE_Msk))|(ucCmd << 8ul)|(SDH_CTL_COEN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_COEN_Msk) == SDH_CTL_COEN_Msk) - { - if (pSD->IsCardInsert == 0ul) - { - val = SDH_NO_SD_CARD; - } - } - return val; -} - - -uint32_t SDH_SDCmdAndRsp(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg, uint32_t ntickCount) -{ - volatile uint32_t buf; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk); - sdh->CTL = buf; - - if (ntickCount > 0ul) - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if(ntickCount-- == 0ul) - { - sdh->CTL |= SDH_CTL_CTLRST_Msk; /* reset SD engine */ - return 2ul; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - else - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - - if (pSD->R7Flag) - { - uint32_t tmp0 = 0ul, tmp1= 0ul; - tmp1 = sdh->RESP1 & 0xfful; - tmp0 = sdh->RESP0 & 0xful; - if ((tmp1 != 0x55ul) && (tmp0 != 0x01ul)) - { - pSD->R7Flag = 0ul; - return SDH_CMD8_ERROR; - } - } - - if (!pSD->R3Flag) - { - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return Successful; - } - else - { - return SDH_CRC7_ERROR; - } - } - else - { - /* ignore CRC error for R3 case */ - pSD->R3Flag = 0ul; - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return Successful; - } -} - - -uint32_t SDH_Swap32(uint32_t val) -{ - uint32_t buf; - - buf = val; - val <<= 24; - val |= (buf<<8) & 0xff0000ul; - val |= (buf>>8) & 0xff00ul; - val |= (buf>>24)& 0xfful; - return val; -} - -/* Get 16 bytes CID or CSD */ -uint32_t SDH_SDCmdAndRsp2(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg, uint32_t puR2ptr[]) -{ - uint32_t i, buf; - uint32_t tmpBuf[5]; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL&(~SDH_CTL_CMDCODE_Msk))|(ucCmd << 8)|(SDH_CTL_COEN_Msk | SDH_CTL_R2EN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_R2EN_Msk) == SDH_CTL_R2EN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) - { - for (i=0ul; i<5ul; i++) - { - tmpBuf[i] = SDH_Swap32(sdh->FB[i]); - } - for (i=0ul; i<4ul; i++) - { - puR2ptr[i] = ((tmpBuf[i] & 0x00fffffful)<<8) | ((tmpBuf[i+1ul] & 0xff000000ul)>>24); - } - } - else - { - return SDH_CRC7_ERROR; - } - return Successful; -} - - -uint32_t SDH_SDCmdAndRspDataIn(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk))|(ucCmd << 8ul)| - (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - while ((sdh->CTL & SDH_CTL_DIEN_Msk) == SDH_CTL_DIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) - { - /* check CRC7 */ - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) - { - /* check CRC16 */ - return SDH_CRC16_ERROR; - } - return 0ul; -} - -/* there are 8 bits for divider0, maximum is 256 */ -#define SDH_CLK_DIV0_MAX 256ul - -void SDH_Set_clock(SDH_T *sdh, uint32_t sd_clock_khz) -{ - uint32_t rate, div1; - static uint32_t u32SD_ClkSrc = 0ul, u32SD_PwrCtl = 0ul; - - SYS_UnlockReg(); - - /* initial state, clock source use HIRC */ - if (sd_clock_khz <= 400ul) - { - u32SD_PwrCtl = CLK->PWRCTL; - if ((u32SD_PwrCtl & CLK_PWRCTL_HIRCEN_Msk) != 0x4ul) - { - CLK->PWRCTL |= CLK_PWRCTL_HIRCEN_Msk; - } - - if (sdh == SDH0) - { - u32SD_ClkSrc = (CLK->CLKSEL0 & CLK_CLKSEL0_SDH0SEL_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH0SEL_Msk) | CLK_CLKSEL0_SDH0SEL_HIRC; - _SDH0_ReferenceClock = (__HIRC / 1000ul); - } - else - { - u32SD_ClkSrc = (CLK->CLKSEL0 & CLK_CLKSEL0_SDH1SEL_Msk); - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH1SEL_Msk) | CLK_CLKSEL0_SDH1SEL_HIRC; - _SDH1_ReferenceClock = (__HIRC / 1000ul); - } - } - /* transfer state, clock source use sys_init() */ - else - { - CLK->PWRCTL = u32SD_PwrCtl; - if (sdh == SDH0) - { - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH0SEL_Msk) | u32SD_ClkSrc; - if(u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_HXT) - { - _SDH0_ReferenceClock = (CLK_GetHXTFreq() / 1000ul); - } - else if(u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_HIRC) - { - _SDH0_ReferenceClock = (__HIRC / 1000ul); - } - else if(u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_PLL) - { - _SDH0_ReferenceClock = (CLK_GetPLLClockFreq() / 1000ul); - } - else if(u32SD_ClkSrc == CLK_CLKSEL0_SDH0SEL_HCLK) - { - _SDH0_ReferenceClock = (CLK_GetHCLKFreq() / 1000ul); - } - } - else - { - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_SDH1SEL_Msk) | u32SD_ClkSrc; - if(u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_HXT) - { - _SDH1_ReferenceClock = (CLK_GetHXTFreq() / 1000ul); - } - else if(u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_HIRC) - { - _SDH1_ReferenceClock = (__HIRC / 1000ul); - } - else if(u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_PLL) - { - _SDH1_ReferenceClock = (CLK_GetPLLClockFreq() / 1000ul); - } - else if(u32SD_ClkSrc == CLK_CLKSEL0_SDH1SEL_HCLK) - { - _SDH1_ReferenceClock = (CLK_GetHCLKFreq() / 1000ul); - } - } - - if(sd_clock_khz >= 50000ul) - { - sd_clock_khz = 50000ul; - } - } - if (sdh == SDH0) - { - rate = _SDH0_ReferenceClock / sd_clock_khz; - - /* choose slower clock if system clock cannot divisible by wanted clock */ - if ((_SDH0_ReferenceClock % sd_clock_khz) != 0ul) - { - rate++; - } - } - else - { - rate = _SDH1_ReferenceClock / sd_clock_khz; - - /* choose slower clock if system clock cannot divisible by wanted clock */ - if ((_SDH1_ReferenceClock % sd_clock_khz) != 0ul) - { - rate++; - } - } - - if(rate >= SDH_CLK_DIV0_MAX) - { - rate = SDH_CLK_DIV0_MAX; - } - - /*--- calculate the second divider CLKDIV0[SDHOST_N]*/ - div1 = (rate - 1ul) & 0xFFul; - - /*--- setup register */ - if (sdh == SDH0) - { - CLK->CLKDIV0 &= ~CLK_CLKDIV0_SDH0DIV_Msk; - CLK->CLKDIV0 |= (div1 << CLK_CLKDIV0_SDH0DIV_Pos); - } - else - { - CLK->CLKDIV3 &= ~CLK_CLKDIV3_SDH1DIV_Msk; - CLK->CLKDIV3 |= (div1 << CLK_CLKDIV3_SDH1DIV_Pos); - } - return; -} - -uint32_t SDH_CardDetection(SDH_T *sdh) -{ - uint32_t i, val = TRUE; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - - if ((sdh->INTEN & SDH_INTEN_CDSRC_Msk) == SDH_INTEN_CDSRC_Msk) /* Card detect pin from GPIO */ - { - if ((sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) == SDH_INTSTS_CDSTS_Msk) /* Card remove */ - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - else - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - } - else if ((sdh->INTEN & SDH_INTEN_CDSRC_Msk) != SDH_INTEN_CDSRC_Msk) - { - sdh->CTL |= SDH_CTL_CLKKEEP_Msk; - for(i= 0ul; i < 5000ul; i++) - { - } - - if ((sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) == SDH_INTSTS_CDSTS_Msk) /* Card insert */ - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - else - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - - sdh->CTL &= ~SDH_CTL_CLKKEEP_Msk; - } - - return val; -} - -uint32_t SDH_Init(SDH_T *sdh) -{ - uint32_t volatile i, status; - uint32_t resp; - uint32_t CIDBuffer[4]; - uint32_t volatile u32CmdTimeOut; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - /* set the clock to 300KHz */ - SDH_Set_clock(sdh, 300ul); - - /* power ON 74 clock */ - sdh->CTL |= SDH_CTL_CLK74OEN_Msk; - - while ((sdh->CTL & SDH_CTL_CLK74OEN_Msk) == SDH_CTL_CLK74OEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - SDH_SDCommand(sdh, 0ul, 0ul); /* reset all cards */ - for (i=0x1000ul; i>0ul; i--) - { - } - - /* initial SDHC */ - pSD->R7Flag = 1ul; - u32CmdTimeOut = 0xFFFFFul; - - i = SDH_SDCmdAndRsp(sdh, 8ul, 0x00000155ul, u32CmdTimeOut); - if (i == Successful) - { - /* SD 2.0 */ - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 2.7v-3.6v */ - resp = sdh->RESP0; - - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - } - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_SD_HIGH; - } - else - { - pSD->CardType = SDH_TYPE_SD_LOW; - } - } - else - { - /* SD 1.1 */ - SDH_SDCommand(sdh, 0ul, 0ul); /* reset all cards */ - for (i=0x100ul; i>0ul; i--) - { - } - - i = SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - if (i == 2ul) /* MMC memory */ - { - - SDH_SDCommand(sdh, 0ul, 0ul); /* reset */ - for (i=0x100ul; i>0ul; i--) - { - } - - pSD->R3Flag = 1ul; - - if (SDH_SDCmdAndRsp(sdh, 1ul, 0x40ff8000ul, u32CmdTimeOut) != 2ul) /* eMMC memory */ - { - resp = sdh->RESP0; - while ((resp & 0x00800000ul) != 0x00800000ul) - { - /* check if card is ready */ - pSD->R3Flag = 1ul; - - SDH_SDCmdAndRsp(sdh, 1ul, 0x40ff8000ul, u32CmdTimeOut); /* high voltage */ - resp = sdh->RESP0; - } - - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_EMMC; - } - else - { - pSD->CardType = SDH_TYPE_MMC; - } - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_ERR_DEVICE; - } - } - else if (i == 0ul) /* SD Memory */ - { - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - } - pSD->CardType = SDH_TYPE_SD_LOW; - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_INIT_ERROR; - } - } - - if (pSD->CardType != SDH_TYPE_UNKNOWN) - { - SDH_SDCmdAndRsp2(sdh, 2ul, 0x00ul, CIDBuffer); - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - if ((status = SDH_SDCmdAndRsp(sdh, 3ul, 0x10000ul, 0ul)) != Successful) /* set RCA */ - { - return status; - } - pSD->RCA = 0x10000ul; - } - else - { - if ((status = SDH_SDCmdAndRsp(sdh, 3ul, 0x00ul, 0ul)) != Successful) /* get RCA */ - { - return status; - } - else - { - pSD->RCA = (sdh->RESP0 << 8) & 0xffff0000; - } - } - } - return Successful; -} - - -uint32_t SDH_SwitchToHighSpeed(SDH_T *sdh, SDH_INFO_T *pSD) -{ - uint32_t volatile status=0ul; - uint16_t current_comsumption, busy_status0; - - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; - - if ((status = SDH_SDCmdAndRspDataIn(sdh, 6ul, 0x00ffff01ul)) != Successful) - { - return Fail; - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - busy_status0 = (uint16_t)(*(pSD->dmabuf + 28)) << 8; - busy_status0 |= (uint16_t)(*(pSD->dmabuf + 29)); - - if (!busy_status0) /* function ready */ - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; /* 512 bit */ - - if ((status = SDH_SDCmdAndRspDataIn(sdh, 6ul, 0x80ffff01ul)) != Successful) - { - return Fail; - } - - /* function change timing: 8 clocks */ - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - return Successful; - } - else - { - return Fail; - } -} - - -uint32_t SDH_SelectCardType(SDH_T *sdh) -{ - uint32_t volatile status=0ul; - uint32_t param; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* if SD card set 4bit */ - if (pSD->CardType == SDH_TYPE_SD_HIGH) - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 0x07ul; /* 64 bit */ - sdh->DMACTL |= SDH_DMACTL_DMARST_Msk; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == 0x2); - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, 51ul, 0x00ul)) != Successful) - { - return status; - } - - if ((*pSD->dmabuf & 0xful) == 0x2ul) - { - status = SDH_SwitchToHighSpeed(sdh, pSD); - if (status == Successful) - { - /* divider */ - SDH_Set_clock(sdh, SDHC_FREQ); - } - } - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, 0x02ul, 0ul)) != Successful) /* set bus width */ - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if (pSD->CardType == SDH_TYPE_SD_LOW) - { - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 0x07ul; - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, 51ul, 0x00ul)) != Successful) - { - return status; - } - - /* set data bus width. ACMD6 for SD card, SDCR_DBW for host. */ - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, 0x02ul, 0ul)) != Successful) - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if ((pSD->CardType == SDH_TYPE_MMC) ||(pSD->CardType == SDH_TYPE_EMMC)) - { - - if(pSD->CardType == SDH_TYPE_MMC) - { - sdh->CTL &= ~SDH_CTL_DBW_Msk; - } - - /*--- sent CMD6 to MMC card to set bus width to 4 bits mode */ - /* set CMD6 argument Access field to 3, Index to 183, Value to 1 (4-bit mode) */ - param = (3ul << 24) | (183ul << 16) | (1ul << 8); - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, param, 0ul)) != Successful) - { - return status; - } - SDH_CheckRB(sdh); - - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - - } - - if ((status = SDH_SDCmdAndRsp(sdh, 16ul, SDH_BLOCK_SIZE, 0ul)) != Successful) - { - return status; - } - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - sdh->INTEN |= SDH_INTEN_BLKDIEN_Msk; - - return Successful; -} - -void SDH_Get_SD_info(SDH_T *sdh) -{ - unsigned int R_LEN, C_Size, MULT, size; - uint32_t Buffer[4]; - //unsigned char *ptr; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - SDH_SDCmdAndRsp2(sdh, 9ul, pSD->RCA, Buffer); - - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - /* for MMC/eMMC card */ - if ((Buffer[0] & 0xc0000000) == 0xc0000000) - { - /* CSD_STRUCTURE [127:126] is 3 */ - /* CSD version depend on EXT_CSD register in eMMC v4.4 for card size > 2GB */ - SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul); - - //ptr = (uint8_t *)((uint32_t)_SDH_ucSDHCBuffer ); - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 511ul; /* read 512 bytes for EXT_CSD */ - - if (SDH_SDCmdAndRspDataIn(sdh, 8ul, 0x00ul) == Successful) - { - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - pSD->totalSectorN = (uint32_t)(*(pSD->dmabuf+215))<<24; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf+214))<<16; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf+213))<<8; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf+212)); - pSD->diskSize = pSD->totalSectorN / 2ul; - } - } - else - { - /* CSD version v1.0/1.1/1.2 in eMMC v4.4 spec for card size <= 2GB */ - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size+1ul) * (1ul<<(MULT+2ul)) * (1ul<diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - else - { - if ((Buffer[0] & 0xc0000000) != 0x0ul) - { - C_Size = ((Buffer[1] & 0x0000003ful) << 16) | ((Buffer[2] & 0xffff0000ul) >> 16); - size = (C_Size+1ul) * 512ul; /* Kbytes */ - - pSD->diskSize = size; - pSD->totalSectorN = size << 1; - } - else - { - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size+1ul) * (1ul<<(MULT+2ul)) * (1ul<diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - pSD->sectorSize = (int)512; -} - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief This function use to reset SD function and select card detection source and pin. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32CardDetSrc Select card detection pin from GPIO or DAT3 pin. ( \ref CardDetect_From_GPIO / \ref CardDetect_From_DAT3) - * - * @return None - */ -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc) -{ - sdh->DMACTL = SDH_DMACTL_DMARST_Msk; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == SDH_DMACTL_DMARST_Msk) - { - } - - sdh->DMACTL = SDH_DMACTL_DMAEN_Msk; - - sdh->GCTL = SDH_GCTL_GCTLRST_Msk | SDH_GCTL_SDEN_Msk; - while ((sdh->GCTL & SDH_GCTL_GCTLRST_Msk) == SDH_GCTL_GCTLRST_Msk) - { - } - - if (sdh == SDH0) - { - NVIC_EnableIRQ(SDH0_IRQn); - memset(&SD0, 0, sizeof(SDH_INFO_T)); - SD0.dmabuf = _SDH0_ucSDHCBuffer; - } - else if (sdh == SDH1) - { - NVIC_EnableIRQ(SDH1_IRQn); - memset(&SD1, 0, sizeof(SDH_INFO_T)); - SD1.dmabuf = _SDH1_ucSDHCBuffer; - } - else - { - } - - sdh->GCTL = SDH_GCTL_SDEN_Msk; - - if ((u32CardDetSrc & CardDetect_From_DAT3) == CardDetect_From_DAT3) - { - sdh->INTEN &= ~SDH_INTEN_CDSRC_Msk; - } - else - { - sdh->INTEN |= SDH_INTEN_CDSRC_Msk; - } - sdh->INTEN |= SDH_INTEN_CDIEN_Msk; - - sdh->CTL |= SDH_CTL_CTLRST_Msk; - while ((sdh->CTL & SDH_CTL_CTLRST_Msk) == SDH_CTL_CTLRST_Msk) - { - } -} - -/** - * @brief This function use to initial SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return None - * - * @details This function is used to initial SD card. - * SD initial state needs 400KHz clock output, driver will use HIRC for SD initial clock source. - * And then switch back to the user's setting. - */ -uint32_t SDH_Probe(SDH_T *sdh) -{ - uint32_t val; - - sdh->GINTEN = 0ul; - sdh->CTL &= ~SDH_CTL_SDNWR_Msk; - sdh->CTL |= 0x09ul << SDH_CTL_SDNWR_Pos; /* set SDNWR = 9 */ - sdh->CTL &= ~SDH_CTL_BLKCNT_Msk; - sdh->CTL |= 0x01ul << SDH_CTL_BLKCNT_Pos; /* set BLKCNT = 1 */ - sdh->CTL &= ~SDH_CTL_DBW_Msk; /* SD 1-bit data bus */ - - if(!(SDH_CardDetection(sdh))) - { - return SDH_NO_SD_CARD; - } - - if ((val = SDH_Init(sdh)) != 0ul) - { - return val; - } - - /* divider */ - if ((SD0.CardType == SDH_TYPE_MMC) || (SD1.CardType == SDH_TYPE_MMC)) - { - SDH_Set_clock(sdh, MMC_FREQ); - } - else - { - SDH_Set_clock(sdh, SD_FREQ); - } - SDH_Get_SD_info(sdh); - - if ((val = SDH_SelectCardType(sdh)) != 0ul) - { - return val; - } - - return 0ul; -} - -/** - * @brief This function use to read data from SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[out] pu8BufAddr The buffer to receive the data from SD card. - * @param[in] u32StartSec The start read sector address. - * @param[in] u32SecCount The the read sector number of data - * - * @return None - */ -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE, buf; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - uint32_t blksize = SDH_BLOCK_SIZE; - - SDH_INFO_T *pSD; - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - SDH_CheckRB(sdh); - - sdh->BLEN = blksize - 1ul; /* the actual byte count is equal to (SDBLEN+1) */ - - if ( (pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC) ) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * blksize; - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - - loop = u32SecCount / 255ul; - for (i=0ul; iDataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & ~SDH_CTL_CMDCODE_Msk; - reg = reg | 0xff0000ul; /* set BLK_CNT to 255 */ - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg|(18ul << 8)|(SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - while(!pSD->DataReadyFlag) - { - if(pSD->DataReadyFlag) - { - break; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & (~SDH_CTL_CMDCODE_Msk); - reg = reg & (~SDH_CTL_BLKCNT_Msk); - reg |= (loop << 16); /* setup SDCR_BLKCNT */ - - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg|(18ul << 8)|(SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - while(!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - if (SDH_SDCmdAndRsp(sdh, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - return Successful; -} - - -/** - * @brief This function use to write data to SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] pu8BufAddr The buffer to send the data to SD card. - * @param[in] u32StartSec The start write sector address. - * @param[in] u32SecCount The the write sector number of data. - * - * @return \ref SDH_SELECT_ERROR : u32SecCount is zero. \n - * \ref SDH_NO_SD_CARD : SD card be removed. \n - * \ref SDH_CRC_ERROR : CRC error happen. \n - * \ref SDH_CRC7_ERROR : CRC7 error happen. \n - * \ref Successful : Write data to SD card success. - */ -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* According to SD Spec v2.0, the write CMD block size MUST be 512, and the start address MUST be 512*n. */ - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * SDH_BLOCK_SIZE; /* set start address for SD CMD */ - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - loop = u32SecCount / 255ul; /* the maximum block count is 0xFF=255 for register SDCR[BLK_CNT] */ - for (i=0ul; iDataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & 0xff00c080; - reg = reg | 0xff0000ul; /* set BLK_CNT to 0xFF=255 */ - if (!bIsSendCmd) - { - sdh->CTL = reg|(25ul << 8)|(SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - while(!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = (sdh->CTL & 0xff00c080) | (loop << 16); - if (!bIsSendCmd) - { - sdh->CTL = reg|(25ul << 8)|(SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - while(!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - - if (SDH_SDCmdAndRsp(sdh, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - return Successful; -} - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - - - - - - - - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_spi.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_spi.c deleted file mode 100644 index 0b4c5c789ef..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_spi.c +++ /dev/null @@ -1,1443 +0,0 @@ -/**************************************************************************//** - * @file spi.c - * @version V3.00 - * @brief M480 series SPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s); - -/** - * @brief This function make SPI module be ready to transfer. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32MasterSlave Decides the SPI module is operating in master mode or in slave mode. (SPI_SLAVE, SPI_MASTER) - * @param[in] u32SPIMode Decides the transfer timing. (SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a SPI transaction. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI peripheral clock. - * @details By default, the SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the SPI clock divider setting will be 0. - * The actual clock rate may be different from the target SPI clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the - * actual SPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPI_Open(SPI_T *spi, - uint32_t u32MasterSlave, - uint32_t u32SPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0U, u32Div, u32HCLKFreq, u32RetValue=0U; - - /* Disable I2S mode */ - spi->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; - - if(u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if(u32MasterSlave == SPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - if(u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if(spi == SPI0) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - } - else if(spi == SPI1) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - } - else if(spi == SPI2) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - } - else - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - } - } - - /* Check clock source of SPI */ - if(spi == SPI0) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if(spi == SPI1) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if(spi == SPI2) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if(u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if(u32Div > 0xFFU) - { - u32Div = 0xFFU; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - } - else /* For slave mode, force the SPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - - /* Select PCLK as the clock source of SPI */ - if(spi == SPI0) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if(spi == SPI1) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if(spi == SPI2) - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else - { - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will reset SPI controller. - */ -void SPI_Close(SPI_T *spi) -{ - if(spi == SPI0) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - else if(spi == SPI1) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI1RST_Msk; - } - else if(spi == SPI2) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI2RST_Msk; - } - else - { - /* Reset SPI */ - SYS->IPRST2 |= SYS_IPRST2_SPI3RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI3RST_Msk; - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI RX FIFO buffer. The RXEMPTY (SPI_STATUS[8]) will be set to 1. - */ -void SPI_ClearRxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI TX FIFO buffer. The TXEMPTY (SPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void SPI_ClearTxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void SPI_DisableAutoSS(SPI_T *spi) -{ - spi->SSCTL &= ~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (SPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (SPI_SS_ACTIVE_HIGH, SPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - spi->SSCTL = (spi->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | SPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the SPI bus clock. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target SPI bus clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the actual SPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetHCLKFreq(); - - if(u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if(spi == SPI0) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - else if(spi == SPI1) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - else if(spi == SPI2) - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - else - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - } - - /* Check clock source of SPI */ - if(spi == SPI0) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if(spi == SPI1) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if(spi == SPI2) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - if(u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if(u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if(u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. If data width is 8~16 bits, it could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. If data width is 8~16 bits, it could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - spi->FIFOCTL = (spi->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of SPI bus clock. Only available in Master mode. - * @param[in] spi The pointer of the specified SPI module. - * @return Actual SPI bus clock frequency in Hz. - * @details This function will calculate the actual SPI bus clock rate according to the SPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t SPI_GetBusClock(SPI_T *spi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc; - - /* Get DIVIDER setting */ - u32Div = (spi->CLKDIV & SPI_CLKDIV_DIVIDER_Msk) >> SPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of SPI */ - if(spi == SPI0) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if(spi == SPI1) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else if(spi == SPI2) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32ClkSrc = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32ClkSrc = CLK_GetPCLK0Freq(); - } - else - { - u32ClkSrc = __HIRC; /* Clock source is HIRC */ - } - } - - /* Return SPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1U)); -} - -/** - * @brief Enable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL |= SPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL &= ~SPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get SPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = spi->STATUS & SPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if((u32Mask & SPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_UNIT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if((u32Mask & SPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if((u32Mask & SPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSINACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if((u32Mask & SPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVUR_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if((u32Mask & SPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVBE_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if((u32Mask & SPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_TXUF_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if((u32Mask & SPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if((u32Mask & SPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if((u32Mask & SPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear SPI related interrupt flags specified by u32Mask parameter. - */ -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - if(u32Mask & SPI_UNIT_INT_MASK) - { - spi->STATUS = SPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if(u32Mask & SPI_SSACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if(u32Mask & SPI_SSINACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if(u32Mask & SPI_SLVUR_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if(u32Mask & SPI_SLVBE_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if(u32Mask & SPI_TXUF_INT_MASK) - { - spi->STATUS = SPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if(u32Mask & SPI_FIFO_RXOV_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if(u32Mask & SPI_FIFO_RXTO_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get SPI status. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_BUSY_MASK - * - \ref SPI_RX_EMPTY_MASK - * - \ref SPI_RX_FULL_MASK - * - \ref SPI_TX_EMPTY_MASK - * - \ref SPI_TX_FULL_MASK - * - \ref SPI_TXRX_RESET_MASK - * - \ref SPI_SPIEN_STS_MASK - * - \ref SPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = spi->STATUS & SPI_STATUS_BUSY_Msk; - /* Check busy status */ - if((u32Mask & SPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_BUSY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if((u32Mask & SPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if((u32Mask & SPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if((u32Mask & SPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if((u32Mask & SPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if((u32Mask & SPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TXRX_RESET_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SPIENSTS_Msk; - /* Check SPIEN flag */ - if((u32Mask & SPI_SPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SPIEN_STS_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SSLINE_Msk; - /* Check SPIx_SS line status */ - if((u32Mask & SPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - - -/** - * @brief This function is used to get I2S source clock frequency. - * @param[in] i2s The pointer of the specified I2S module. - * @return I2S source clock frequency (Hz). - * @details Return the source clock frequency according to the setting of SPI0SEL (CLKSEL2[27:26]). - */ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s) -{ - uint32_t u32Freq; - - if(i2s == SPI0) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI0SEL_Msk) == CLK_CLKSEL2_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32Freq = CLK_GetPCLK1Freq(); - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - else if(i2s == SPI1) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI1SEL_Msk) == CLK_CLKSEL2_SPI1SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32Freq = CLK_GetPCLK0Freq(); - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - else if(i2s == SPI2) - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI2SEL_Msk) == CLK_CLKSEL2_SPI2SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32Freq = CLK_GetPCLK1Freq(); - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - else - { - if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_HXT) - { - u32Freq = __HXT; /* Clock source is HXT */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PLL) - { - u32Freq = CLK_GetPLLClockFreq(); /* Clock source is PLL */ - } - else if((CLK->CLKSEL2 & CLK_CLKSEL2_SPI3SEL_Msk) == CLK_CLKSEL2_SPI3SEL_PCLK0) - { - /* Clock source is PCLK0 */ - u32Freq = CLK_GetPCLK0Freq(); - } - else - { - u32Freq = __HIRC; /* Clock source is HIRC */ - } - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are listed below. - * - \ref SPII2S_MODE_MASTER - * - \ref SPII2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are listed below. - * - \ref SPII2S_DATABIT_8 - * - \ref SPII2S_DATABIT_16 - * - \ref SPII2S_DATABIT_24 - * - \ref SPII2S_DATABIT_32 - * @param[in] u32Channels Audio format. Valid values are listed below. - * - \ref SPII2S_MONO - * - \ref SPII2S_STEREO - * @param[in] u32DataFormat Data format. Valid values are listed below. - * - \ref SPII2S_FORMAT_I2S - * - \ref SPII2S_FORMAT_MSB - * - \ref SPII2S_FORMAT_PCMA - * - \ref SPII2S_FORMAT_PCMB - * @return Real sample rate of master mode or peripheral clock rate of slave mode. - * @details This function will reset SPI/I2S controller and configure I2S controller according to the input parameters. - * Set TX FIFO threshold to 2 and RX FIFO threshold to 1. Both the TX and RX functions will be enabled. - * The actual sample rate may be different from the target sample rate. The real sample rate will be returned for reference. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat) -{ - uint32_t u32Divider; - uint32_t u32BitRate, u32SrcClk, u32RetValue; - - /* Reset SPI/I2S */ - if(i2s == SPI0) - { - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - else if(i2s == SPI1) - { - SYS->IPRST1 |= SYS_IPRST1_SPI1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI1RST_Msk; - } - else if(i2s == SPI2) - { - SYS->IPRST1 |= SYS_IPRST1_SPI2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI2RST_Msk; - } - else - { - SYS->IPRST2 |= SYS_IPRST2_SPI3RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI3RST_Msk; - } - - /* Configure I2S controller */ - i2s->I2SCTL = u32MasterSlave | u32WordWidth | u32Channels | u32DataFormat; - /* Set TX FIFO threshold to 2 and RX FIFO threshold to 1 */ - SPI_SetFIFO(i2s, 2, 1); - - if(u32MasterSlave == SPI_MASTER) - { - /* Get the source clock rate */ - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - - /* Calculate the bit clock rate */ - u32BitRate = u32SampleRate * ((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1U) * 16U; - u32Divider = ((u32SrcClk / u32BitRate) >> 1U) - 1U; - //u32Divider = ((((u32SrcClk * 10UL / u32BitRate) >> 1U) + 5UL) / 10UL) - 1U; - /* Set BCLKDIV setting */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_BCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_BCLKDIV_Pos); - - /* Calculate bit clock rate */ - u32BitRate = u32SrcClk / ((u32Divider + 1U) * 2U); - /* Calculate real sample rate */ - u32SampleRate = u32BitRate / (((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1U) * 16U); - - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - - /* Return the real sample rate */ - u32RetValue = u32SampleRate; - } - else - { - /* Set BCLKDIV = 0 */ - i2s->I2SCLK &= ~SPI_I2SCLK_BCLKDIV_Msk; - - if(i2s == SPI0) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI0SEL_Msk)) | CLK_CLKSEL2_SPI0SEL_PCLK1; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if(i2s == SPI1) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI1SEL_Msk)) | CLK_CLKSEL2_SPI1SEL_PCLK0; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - else if(i2s == SPI2) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI2SEL_Msk)) | CLK_CLKSEL2_SPI2SEL_PCLK1; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL2 = (CLK->CLKSEL2 & (~CLK_CLKSEL2_SPI3SEL_Msk)) | CLK_CLKSEL2_SPI3SEL_PCLK0; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable I2S function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Disable I2S function. - */ -void SPII2S_Close(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; -} - -/** - * @brief Enable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * @return None - * @details This function enables the interrupt according to the u32Mask parameter. - */ -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Enable TX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Enable TX underflow interrupt flag */ - if((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable right channel zero cross interrupt flag */ - if((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCIEN_Msk; - } - - /* Enable left channel zero cross interrupt flag */ - if((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_LZCIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * @return None - * @details This function disables the interrupt according to the u32Mask parameter. - */ -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Disable TX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Disable TX underflow interrupt flag */ - if((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable right channel zero cross interrupt flag */ - if((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCIEN_Msk; - } - - /* Disable left channel zero cross interrupt flag */ - if((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCIEN_Msk; - } -} - -/** - * @brief Enable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32BusClock The target MCLK clock rate. - * @return Actual MCLK clock rate - * @details Set the master clock rate according to u32BusClock parameter and enable master clock output. - * The actual master clock rate may be different from the target master clock rate. The real master clock rate will be returned for reference. - */ -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock) -{ - uint32_t u32Divider; - uint32_t u32SrcClk, u32RetValue; - - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - if(u32BusClock == u32SrcClk) - { - u32Divider = 0U; - } - else - { - u32Divider = (u32SrcClk / u32BusClock) >> 1U; - /* MCLKDIV is a 6-bit width configuration. The maximum value is 0x3F. */ - if(u32Divider > 0x3FU) - { - u32Divider = 0x3FU; - } - } - - /* Write u32Divider to MCLKDIV (SPI_I2SCLK[5:0]) */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_MCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_MCLKDIV_Pos); - - /* Enable MCLK output */ - i2s->I2SCTL |= SPI_I2SCTL_MCLKEN_Msk; - - if(u32Divider == 0U) - { - u32RetValue = u32SrcClk; /* If MCLKDIV=0, master clock rate is equal to the source clock rate. */ - } - else - { - u32RetValue = ((u32SrcClk >> 1U) / u32Divider); /* If MCLKDIV>0, master clock rate = source clock rate / (MCLKDIV * 2) */ - } - - return u32RetValue; -} - -/** - * @brief Disable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Clear MCLKEN bit of SPI_I2SCTL register to disable master clock output. - */ -void SPII2S_DisableMCLK(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->FIFOCTL = (i2s->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_spim.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_spim.c deleted file mode 100644 index 6715f446971..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_spim.c +++ /dev/null @@ -1,1308 +0,0 @@ -/**************************************************************************//** - * @file spim.c - * @version V1.00 - * @brief M480 series SPIM driver - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPIM_Driver SPIM Driver - @{ -*/ - -/** @addtogroup SPIM_EXPORTED_FUNCTIONS SPIM Exported Functions - @{ -*/ - - -/** @cond HIDDEN_SYMBOLS */ - - -#define ENABLE_DEBUG 0 - -#if ENABLE_DEBUG -#define SPIM_DBGMSG printf -#else -#define SPIM_DBGMSG(...) do { } while (0) /* disable debug */ -#endif - -static volatile uint8_t g_Supported_List[] = -{ - MFGID_WINBOND, - MFGID_MXIC, - MFGID_EON, - MFGID_ISSI, - MFGID_SPANSION -}; - -static void N_delay(int n); -static void SwitchNBitOutput(uint32_t u32NBit); -static void SwitchNBitInput(uint32_t u32NBit); -static void spim_write(uint8_t pu8TxBuf[], uint32_t u32NTx); -static void spim_read(uint8_t pu8RxBuf[], uint32_t u32NRx); -static void SPIM_WriteStatusRegister(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit); -static void SPIM_ReadStatusRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static void SPIM_ReadStatusRegister2(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static void SPIM_WriteStatusRegister2(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit); -static void SPIM_ReadStatusRegister3(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static void SPIM_ReadSecurityRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit); -static int spim_is_write_done(uint32_t u32NBit); -static int spim_wait_write_done(uint32_t u32NBit); -static void spim_set_write_enable(int isEn, uint32_t u32NBit); -static void spim_enable_spansion_quad_mode(int isEn); -static void spim_eon_set_qpi_mode(int isEn); -static void SPIM_SPANSION_4Bytes_Enable(int isEn, uint32_t u32NBit); -static void SPIM_WriteInPageDataByIo(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int isSync); -static void SPIM_WriteInPageDataByPageWrite(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, - uint8_t pu8TxBuf[], uint32_t wrCmd, int isSync); - - -static void N_delay(int n) -{ - while (n-- > 0) - { - __NOP(); - } -} - -static void SwitchNBitOutput(uint32_t u32NBit) -{ - switch (u32NBit) - { - case 1UL: - SPIM_ENABLE_SING_OUTPUT_MODE(); /* 1-bit, Output. */ - break; - - case 2UL: - SPIM_ENABLE_DUAL_OUTPUT_MODE(); /* 2-bit, Output. */ - break; - - case 4UL: - SPIM_ENABLE_QUAD_OUTPUT_MODE(); /* 4-bit, Output. */ - break; - - default: - break; - } -} - -static void SwitchNBitInput(uint32_t u32NBit) -{ - switch (u32NBit) - { - case 1UL: - SPIM_ENABLE_SING_INPUT_MODE(); /* 1-bit, Input. */ - break; - - case 2UL: - SPIM_ENABLE_DUAL_INPUT_MODE(); /* 2-bit, Input. */ - break; - - case 4UL: - SPIM_ENABLE_QUAD_INPUT_MODE(); /* 4-bit, Input. */ - break; - - default: - break; - } -} - - -/** - * @brief Write data to SPI slave. - * @param pu8TxBuf Transmit buffer. - * @param u32NTx Number of bytes to transmit. - * @return None. - */ -static void spim_write(uint8_t pu8TxBuf[], uint32_t u32NTx) -{ - uint32_t buf_idx = 0UL; - - while (u32NTx) - { - uint32_t dataNum = 0UL, dataNum2; - - if (u32NTx >= 16UL) - { - dataNum = 4UL; - } - else if (u32NTx >= 12UL) - { - dataNum = 3UL; - } - else if (u32NTx >= 8UL) - { - dataNum = 2UL; - } - else if (u32NTx >= 4UL) - { - dataNum = 1UL; - } - - dataNum2 = dataNum; - while (dataNum2) - { - uint32_t tmp; - - memcpy(&tmp, &pu8TxBuf[buf_idx], 4U); - buf_idx += 4UL; - u32NTx -= 4UL; - - dataNum2 --; - /* *((__O uint32_t *) &SPIM->TX0 + dataNum2) = tmp; */ - SPIM->TX[dataNum2] = tmp; - } - - if (dataNum) - { - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(32UL); - SPIM_SET_DATA_NUM(dataNum); - SPIM_SET_GO(); - SPIM_WAIT_FREE(); - } - - if (u32NTx && (u32NTx < 4UL)) - { - uint32_t rnm, tmp; - - rnm = u32NTx; - memcpy(&tmp, &pu8TxBuf[buf_idx], u32NTx); - buf_idx += u32NTx; - u32NTx = 0UL; - SPIM->TX[0] = tmp; - - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(rnm * 8UL); - SPIM_SET_DATA_NUM(1UL); - SPIM_SET_GO(); - SPIM_WAIT_FREE(); - } - } -} - -/** - * @brief Read data from SPI slave. - * @param pu8TxBuf Receive buffer. - * @param u32NRx Size of receive buffer in bytes. - * @return None. - */ -static void spim_read(uint8_t pu8RxBuf[], uint32_t u32NRx) -{ - uint32_t buf_idx = 0UL; - - while (u32NRx) - { - uint32_t dataNum = 0UL; /* number of words */ - - if (u32NRx >= 16UL) - { - dataNum = 4UL; - } - else if (u32NRx >= 12UL) - { - dataNum = 3UL; - } - else if (u32NRx >= 8UL) - { - dataNum = 2UL; - } - else if (u32NRx >= 4UL) - { - dataNum = 1UL; - } - - if (dataNum) - { - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(32UL); - SPIM_SET_DATA_NUM(dataNum); - SPIM_SET_GO(); - SPIM_WAIT_FREE(); - } - - while (dataNum) - { - uint32_t tmp; - - tmp = SPIM->RX[dataNum-1UL]; - memcpy(&pu8RxBuf[buf_idx], &tmp, 4U); - buf_idx += 4UL; - dataNum --; - u32NRx -= 4UL; - } - - if (u32NRx && (u32NRx < 4UL)) - { - uint32_t tmp; - - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch to Normal mode. */ - SPIM_SET_DATA_WIDTH(u32NRx * 8UL); - SPIM_SET_DATA_NUM(1UL); - SPIM_SET_GO(); - SPIM_WAIT_FREE(); - - tmp = SPIM->RX[0]; - memcpy(&pu8RxBuf[buf_idx], &tmp, u32NRx); - buf_idx += u32NRx; - u32NRx = 0UL; - } - } -} - -/** - * @brief Issue Read Status Register #1 command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadStatusRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSR}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Issue Write Status Register #1 command. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteStatusRegister(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_WRSR, 0x00U}; /* 1-byte Write Status Register #1 command + 1-byte data. */ - - cmdBuf[1] = dataBuf[0]; - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Issue Read Status Register #2 command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadStatusRegister2(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSR2}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Issue Winbond Write Status Register command. This command write both Status Register-1 - * and Status Register-2. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteStatusRegister2(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[3] = {OPCODE_WRSR, 0U, 0U}; - - cmdBuf[1] = dataBuf[0]; - cmdBuf[2] = dataBuf[1]; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -#if 0 /* not used */ -/** - * @brief Issue Write Status Register #3 command. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteStatusRegister3(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_WRSR3, 0x00U}; /* 1-byte Write Status Register #2 command + 1-byte data. */ - cmdBuf[1] = dataBuf[0]; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} -#endif - -/** - * @brief Issue Read Status Register #3 command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadStatusRegister3(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSR3}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -#if 0 /* not used */ -/** - * @brief Issue Write Security Register command. - * @param dataBuf Transmit buffer. - * @param u32NTx Size of transmit buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_WriteSecurityRegister(uint8_t dataBuf[], uint32_t u32NTx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_WRSCUR, 0x00U}; /* 1-byte Write Status Register #2 command + 1-byte data. */ - cmdBuf[1] = dataBuf[0]; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} -#endif - -/** - * @brief Issue Read Security Register command. - * @param dataBuf Receive buffer. - * @param u32NRx Size of receive buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void SPIM_ReadSecurityRegister(uint8_t dataBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {OPCODE_RDSCUR}; /* 1-byte Read Status Register #1 command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(dataBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Check if Erase/Write is done. - * @return 0: Not done. 1: Done. - */ -static int spim_is_write_done(uint32_t u32NBit) -{ - uint8_t status[1]; - SPIM_ReadStatusRegister(status, sizeof (status), u32NBit); - return ! (status[0] & SR_WIP); -} - -/** - * @brief Wait until Erase/Write done. - * @param u32NBit N-bit transmit/receive. - * @return 0 SPIM write done. - */ -static int spim_wait_write_done(uint32_t u32NBit) -{ - uint32_t count; - int ret = -1; - - for (count = 0UL; count < SystemCoreClock/1000UL; count++) - { - if (spim_is_write_done(u32NBit)) - { - ret = 0; - break; - } - } - if (ret != 0) - { - SPIM_DBGMSG("spim_wait_write_done time-out!!\n"); - } - return ret; -} - -/** - * @brief Issue Write Enable/disable command. - * @param isEn Enable/disable. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -static void spim_set_write_enable(int isEn, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = {0U}; /* 1-byte Write Enable command. */ - cmdBuf[0] = isEn ? OPCODE_WREN : OPCODE_WRDI; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Get SPIM serial clock. - * @return SPI serial clock. - * @details This function calculates the serial clock of SPI in Hz. - */ -uint32_t SPIM_GetSClkFreq(void) -{ - uint32_t clkDiv = SPIM_GET_CLOCK_DIVIDER(); - - return clkDiv ? SystemCoreClock / (clkDiv * 2U) : SystemCoreClock; -} - -/** - * @brief Initialize SPIM flash. - * @param clrWP Clear Write Protect or not. - * @return 0 Success. - * @return -1 Unrecognized manufacture ID or failed on reading manufacture ID. - */ -int SPIM_InitFlash(int clrWP) -{ - uint8_t idBuf[3]; - uint8_t cmdBuf[1]; - uint32_t i; - int32_t ret = -1; - - SPIM_SET_SS_ACTLVL(0); - - /* - * Because not sure in SPI or QPI mode, do QPI reset and then SPI reset. - */ - /* QPI Reset Enable */ - cmdBuf[0] = OPCODE_RSTEN; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_QUAD_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* QPI Reset */ - cmdBuf[0] = OPCODE_RST; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_QUAD_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* SPI ResetEnable */ - cmdBuf[0] = OPCODE_RSTEN; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_SING_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* SPI Reset */ - cmdBuf[0] = OPCODE_RST; - SPIM_SET_SS_EN(1); /* CS activated. */ - SPIM_ENABLE_SING_OUTPUT_MODE(); /* 1-bit, Output. */ - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (clrWP) - { - uint8_t dataBuf[] = {0x00U}; - - spim_set_write_enable(1, 1UL); /* Clear Block Protect. */ - SPIM_WriteStatusRegister(dataBuf, sizeof (dataBuf), 1U); - spim_wait_write_done(1UL); - } - - SPIM_ReadJedecId(idBuf, sizeof (idBuf), 1UL); - - /* printf("ID: 0x%x, 0x%x, px%x\n", idBuf[0], idBuf[1], idBuf[2]); */ - - for (i = 0UL; i < sizeof(g_Supported_List)/sizeof(g_Supported_List[0]); i++) - { - if (idBuf[0] == g_Supported_List[i]) - { - ret = 0; - } - } - if (ret != 0) - { - SPIM_DBGMSG("Flash initialize failed!! 0x%x\n", idBuf[0]); - } - return ret; -} - -/** - * @brief Issue JEDEC ID command. - * @param idBuf ID buffer. - * @param u32NRx Size of ID buffer. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -void SPIM_ReadJedecId(uint8_t idBuf[], uint32_t u32NRx, uint32_t u32NBit) -{ - uint8_t cmdBuf[] = { OPCODE_RDID }; /* 1-byte JEDEC ID command. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(u32NBit); - spim_read(idBuf, u32NRx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** @cond HIDDEN_SYMBOLS */ - -static void spim_enable_spansion_quad_mode(int isEn) -{ - uint8_t cmdBuf[3]; - uint8_t dataBuf[1], status1; - - cmdBuf[0] = 0x5U; /* Read Status Register-1 */ - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(1UL); - spim_read(dataBuf, sizeof (dataBuf)); - SPIM_SET_SS_EN(0); - /* SPIM_DBGMSG("SR1 = 0x%x\n", dataBuf[0]); */ - - status1 = dataBuf[0]; - - cmdBuf[0] = 0x35U; /* Read Configuration Register-1 */ - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(1UL); - spim_read(dataBuf, sizeof (dataBuf)); - SPIM_SET_SS_EN(0); - /* SPIM_DBGMSG("CR1 = 0x%x\n", dataBuf[0]); */ - - spim_set_write_enable(1, 1UL); - - cmdBuf[0] = 0x1U; /* Write register */ - cmdBuf[1] = status1; - - if (isEn) - { - cmdBuf[2] = dataBuf[0] | 0x2U; /* set QUAD */ - } - else - { - cmdBuf[2] = dataBuf[0] & ~0x2U; /* clear QUAD */ - } - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, 3UL); - SPIM_SET_SS_EN(0); - - spim_set_write_enable(0, 1UL); - - - cmdBuf[0] = 0x35U; /* Read Configuration Register-1 */ - - SPIM_SET_SS_EN(1); - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof (cmdBuf)); - SwitchNBitInput(1UL); - spim_read(dataBuf, sizeof (dataBuf)); - SPIM_SET_SS_EN(0); - - /* SPIM_DBGMSG("CR1 = 0x%x\n", dataBuf[0]); */ - N_delay(10000); -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Set Quad Enable/disable. - * @param isEn Enable/disable. - * @param u32NBit N-bit transmit/receive. - * @return None. - */ -void SPIM_SetQuadEnable(int isEn, uint32_t u32NBit) -{ - uint8_t idBuf[3]; - uint8_t dataBuf[2]; - - SPIM_ReadJedecId(idBuf, sizeof (idBuf), u32NBit); - - SPIM_DBGMSG("SPIM_SetQuadEnable - Flash ID is 0x%x\n", idBuf[0]); - - switch (idBuf[0]) - { - case MFGID_WINBOND: /* Winbond SPI flash */ - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register: 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); - if (isEn) - { - dataBuf[1] |= SR2_QE; - } - else - { - dataBuf[1] &= ~SR2_QE; - } - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - SPIM_WriteStatusRegister2(dataBuf, sizeof (dataBuf), u32NBit); - spim_wait_write_done(u32NBit); - - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register: 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); - break; - - case MFGID_MXIC: /* MXIC SPI flash. */ - case MFGID_EON: - case MFGID_ISSI: /* ISSI SPI flash. */ - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - dataBuf[0] = isEn ? SR_QE : 0U; - SPIM_WriteStatusRegister(dataBuf, sizeof (dataBuf), u32NBit); - spim_wait_write_done(u32NBit); - break; - - case MFGID_SPANSION: - spim_enable_spansion_quad_mode(isEn); - break; - - default: - break; - } -} - -/** - * @brief Enter/exit QPI mode. - * @param isEn Enable/disable. - * @return None. - */ -static void spim_eon_set_qpi_mode(int isEn) -{ - uint8_t cmdBuf[1]; /* 1-byte command. */ - - uint8_t status[1]; - SPIM_ReadStatusRegister(status, sizeof (status), 1UL); - SPIM_DBGMSG("Status: 0x%x\n", status[0]); - - if (isEn) /* Assume in SPI mode. */ - { - cmdBuf[0] = OPCODE_ENQPI; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(1UL); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - } - else /* Assume in QPI mode. */ - { - cmdBuf[0] = OPCODE_EXQPI; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(4UL); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - } - - SPIM_ReadStatusRegister(status, sizeof (status), 1UL); - SPIM_DBGMSG("Status: 0x%x\n", status[0]); -} - - -static void SPIM_SPANSION_4Bytes_Enable(int isEn, uint32_t u32NBit) -{ - uint8_t cmdBuf[2]; - uint8_t dataBuf[1]; - - cmdBuf[0] = OPCODE_BRRD; - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, 1UL); - SwitchNBitInput(1UL); - spim_read(dataBuf, 1UL); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - SPIM_DBGMSG("Bank Address register= 0x%x\n", dataBuf[0]); - - cmdBuf[0] = OPCODE_BRWR; - - if (isEn) - { - cmdBuf[1] = dataBuf[0] | 0x80U; /* set EXTADD */ - } - else - { - cmdBuf[1] = dataBuf[0] & ~0x80U; /* clear EXTADD */ - } - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(1UL); - spim_write(cmdBuf, 2UL); - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** @cond HIDDEN_SYMBOLS */ - -/** - * @brief Query 4-byte address mode enabled or not. - * @param u32NBit N-bit transmit/receive. - * @return 0: 4-byte address mode disabled. 1: 4-byte address mode enabled. - */ -int SPIM_Is4ByteModeEnable(uint32_t u32NBit) -{ - int isEn = 0; - int isSupt = 0; - uint8_t idBuf[3]; - uint8_t dataBuf[1]; - - SPIM_ReadJedecId(idBuf, sizeof (idBuf), u32NBit); - - /* Based on Flash size, check if 4-byte address mode is supported. */ - switch (idBuf[0]) - { - case MFGID_WINBOND: - case MFGID_MXIC: - case MFGID_EON: - isSupt = (idBuf[2] < 0x19U) ? 0L : 1L; - break; - - case MFGID_ISSI: - isSupt = (idBuf[2] < 0x49U) ? 0L : 1L; - break; - - default: - break; - } - - if (isSupt != 0) - { - if (idBuf[0] == MFGID_WINBOND) - { - /* Winbond SPI flash. */ - SPIM_ReadStatusRegister3(dataBuf, sizeof (dataBuf), u32NBit); - isEn = !! (dataBuf[0] & SR3_ADR); - } - else if ((idBuf[0] == MFGID_MXIC) || (idBuf[0] ==MFGID_EON)) - { - /* MXIC/EON SPI flash. */ - SPIM_ReadSecurityRegister(dataBuf, sizeof (dataBuf), u32NBit); - isEn = !! (dataBuf[0] & SCUR_4BYTE); - } - } - - return isEn; -} - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief Enter/Exit 4-byte address mode. - * @param isEn Enable/disable. - * @param u32NBit N-bit transmit/receive. - * @return 0 success - * -1 failed - */ -int SPIM_Enable_4Bytes_Mode(int isEn, uint32_t u32NBit) -{ - int isSupt = 0L, ret = -1; - uint8_t idBuf[3]; - uint8_t cmdBuf[1]; /* 1-byte Enter/Exit 4-Byte Mode command. */ - - SPIM_ReadJedecId(idBuf, sizeof (idBuf), u32NBit); - - /* Based on Flash size, check if 4-byte address mode is supported. */ - switch (idBuf[0]) - { - case MFGID_WINBOND: - case MFGID_MXIC: - case MFGID_EON: - isSupt = (idBuf[2] < 0x19U) ? 0L : 1L; - break; - - case MFGID_ISSI: - isSupt = (idBuf[2] < 0x49U) ? 0L : 1L; - break; - - case MFGID_SPANSION: - SPIM_SPANSION_4Bytes_Enable(isEn, u32NBit); - isSupt = 1L; - ret = 0L; - break; - - default: - break; - } - - if ((isSupt) && (idBuf[0] != MFGID_SPANSION)) - { - cmdBuf[0] = isEn ? OPCODE_EN4B : OPCODE_EX4B; - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - /* - * FIXME: Per test, 4BYTE Indicator bit doesn't set after EN4B, which - * doesn't match spec(MX25L25635E), so skip the check below. - */ - if (idBuf[0] != MFGID_MXIC) - { - if (isEn) - { - while (! SPIM_Is4ByteModeEnable(u32NBit)) { } - } - else - { - while (SPIM_Is4ByteModeEnable(u32NBit)) { } - } - } - ret = 0; - } - return ret; -} - - -void SPIM_WinbondUnlock(uint32_t u32NBit) -{ - uint8_t idBuf[3]; - uint8_t dataBuf[4]; - - SPIM_ReadJedecId(idBuf, sizeof (idBuf), u32NBit); - - if ((idBuf[0] != MFGID_WINBOND) || (idBuf[1] != 0x40) || (idBuf[2] != 0x16)) - { - SPIM_DBGMSG("SPIM_WinbondUnlock - Not W25Q32, do nothing.\n"); - return; - } - - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register: 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); - dataBuf[1] &= ~0x40; /* clear Status Register-1 SEC bit */ - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - SPIM_WriteStatusRegister2(dataBuf, sizeof (dataBuf), u32NBit); - spim_wait_write_done(u32NBit); - - SPIM_ReadStatusRegister(&dataBuf[0], 1UL, u32NBit); - SPIM_ReadStatusRegister2(&dataBuf[1], 1UL, u32NBit); - SPIM_DBGMSG("Status Register (after unlock): 0x%x - 0x%x\n", dataBuf[0], dataBuf[1]); -} - -/** - * @brief Erase whole chip. - * @param u32NBit N-bit transmit/receive. - * @param isSync Block or not. - * @return None. - */ -void SPIM_ChipErase(uint32_t u32NBit, int isSync) -{ - uint8_t cmdBuf[] = { OPCODE_CHIP_ERASE }; /* 1-byte Chip Erase command. */ - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, sizeof (cmdBuf)); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (isSync) - { - spim_wait_write_done(u32NBit); - } -} - - -/** - * @brief Erase one block. - * @param u32Addr Block to erase which contains the u32Addr. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u8ErsCmd Erase command. - * @param u32NBit N-bit transmit/receive. - * @param isSync Block or not. - * @return None. - */ -void SPIM_EraseBlock(uint32_t u32Addr, int is4ByteAddr, uint8_t u8ErsCmd, uint32_t u32NBit, int isSync) -{ - uint8_t cmdBuf[16]; - uint32_t buf_idx = 0UL; - - spim_set_write_enable(1, u32NBit); /* Write Enable. */ - - cmdBuf[buf_idx++] = u8ErsCmd; - - if (is4ByteAddr) - { - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 24); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr & 0xFFUL); - } - else - { - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr & 0xFFUL); - } - - SPIM_SET_SS_EN(1); /* CS activated. */ - SwitchNBitOutput(u32NBit); - spim_write(cmdBuf, buf_idx); - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (isSync) - { - spim_wait_write_done(u32NBit); - } -} - - -/** @cond HIDDEN_SYMBOLS */ - -/** - * @brief Write data in the same page by I/O mode. - * @param u32Addr Start u32Address to write. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NTx Number of bytes to write. - * @param pu8TxBuf Transmit buffer. - * @param wrCmd Write command. - * @param u32NBitCmd N-bit transmit command. - * @param u32NBitAddr N-bit transmit u32Address. - * @param u32NBitDat N-bit transmit/receive data. - * @param isSync Block or not. - * @return None. - */ -static void SPIM_WriteInPageDataByIo(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int isSync) -{ - uint8_t cmdBuf[16]; - uint32_t buf_idx; - - spim_set_write_enable(1, u32NBitCmd); /* Write Enable. */ - - SPIM_SET_SS_EN(1); /* CS activated. */ - - SwitchNBitOutput(u32NBitCmd); - cmdBuf[0] = wrCmd; - spim_write(cmdBuf, 1UL); /* Write out command. */ - - buf_idx = 0UL; - if (is4ByteAddr) - { - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 24); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - else - { - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - - SwitchNBitOutput(u32NBitAddr); - spim_write(cmdBuf, buf_idx); /* Write out u32Address. */ - - SwitchNBitOutput(u32NBitDat); - spim_write(pu8TxBuf, u32NTx); /* Write out data. */ - - SPIM_SET_SS_EN(0); /* CS deactivated. */ - - if (isSync) - { - spim_wait_write_done(u32NBitCmd); - } -} - -/** - * @brief Write data in the same page by Page Write mode. - * @param u32Addr Start u32Address to write. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NTx Number of bytes to write. - * @param pu8TxBuf Transmit buffer. - * @param wrCmd Write command. - * @param isSync Block or not. - * @return None. - */ -static void SPIM_WriteInPageDataByPageWrite(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, - uint8_t pu8TxBuf[], uint32_t wrCmd, int isSync) -{ - if ((wrCmd == CMD_QUAD_PAGE_PROGRAM_WINBOND) || - (wrCmd == CMD_QUAD_PAGE_PROGRAM_MXIC)) - { - SPIM_SetQuadEnable(1, 1UL); /* Set Quad Enable. */ - } - else if (wrCmd == CMD_QUAD_PAGE_PROGRAM_EON) - { - SPIM_SetQuadEnable(1, 1UL); /* Set Quad Enable. */ - spim_eon_set_qpi_mode(1); /* Enter QPI mode. */ - } - - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_PAGEWRITE);/* Switch to Page Write mode. */ - SPIM_SET_SPIM_MODE(wrCmd); /* SPIM mode. */ - SPIM_SET_4BYTE_ADDR_EN(is4ByteAddr); /* Enable/disable 4-Byte Address. */ - - SPIM->SRAMADDR = (uint32_t) pu8TxBuf; /* SRAM u32Address. */ - SPIM->DMACNT = u32NTx; /* Transfer length. */ - SPIM->FADDR = u32Addr; /* Flash u32Address.*/ - SPIM_SET_GO(); /* Go. */ - - if (isSync) - { - SPIM_WAIT_FREE(); - } - - if (wrCmd == CMD_QUAD_PAGE_PROGRAM_EON) - { - spim_eon_set_qpi_mode(0); /* Exit QPI mode. */ - } -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Write data to SPI Flash by sending commands manually (I/O mode). - * @param u32Addr: Start u32Address to write. - * @param is4ByteAddr: 4-byte u32Address or not. - * @param u32NTx: Number of bytes to write. - * @param pu8TxBuf: Transmit buffer. - * @param wrCmd: Write command. - * @param u32NBitCmd: N-bit transmit command. - * @param u32NBitAddr: N-bit transmit u32Address. - * @param u32NBitDat: N-bit transmit/receive data. - * @return None. - */ -void SPIM_IO_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint8_t wrCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat) -{ - uint32_t pageOffset, toWr; - uint32_t buf_idx = 0UL; - - pageOffset = u32Addr % 256UL; - - if ((pageOffset + u32NTx) <= 256UL) /* Do all the bytes fit onto one page ? */ - { - SPIM_WriteInPageDataByIo(u32Addr, is4ByteAddr, u32NTx, &pu8TxBuf[buf_idx], - wrCmd, u32NBitCmd, u32NBitAddr, u32NBitDat, 1); - } - else - { - toWr = 256UL - pageOffset; /* Size of data remaining on the first page. */ - - SPIM_WriteInPageDataByIo(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], - wrCmd, u32NBitCmd, u32NBitAddr, u32NBitDat, 1); - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - - while (u32NTx) - { - toWr = 256UL; - if (toWr > u32NTx) - { - toWr = u32NTx; - } - - SPIM_WriteInPageDataByIo(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], - wrCmd, u32NBitCmd, u32NBitAddr, u32NBitDat, 1); - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - } - } -} - -/** - * @brief Read data from SPI Flash by sending commands manually (I/O mode). - * @param u32Addr Start u32Address to read. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NRx Number of bytes to read. - * @param pu8RxBuf Receive buffer. - * @param rdCmd Read command. - * @param u32NBitCmd N-bit transmit command. - * @param u32NBitAddr N-bit transmit u32Address. - * @param u32NBitDat N-bit transmit/receive data. - * @param u32NDummy Number of dummy bytes following address. - * @return None. - */ -void SPIM_IO_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint8_t rdCmd, - uint32_t u32NBitCmd, uint32_t u32NBitAddr, uint32_t u32NBitDat, int u32NDummy) -{ - uint8_t cmdBuf[16]; - uint32_t buf_idx; - - SPIM_SET_SS_EN(1); /* CS activated. */ - - cmdBuf[0] = rdCmd; - SwitchNBitOutput(u32NBitCmd); - spim_write(cmdBuf, 1UL); /* Write out command. */ - - buf_idx = 0UL; - if (is4ByteAddr) - { - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 24); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - else - { - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 16); - cmdBuf[buf_idx++] = (uint8_t) (u32Addr >> 8); - cmdBuf[buf_idx++] = (uint8_t) u32Addr; - } - SwitchNBitOutput(u32NBitAddr); - spim_write(cmdBuf, buf_idx); /* Write out u32Address. */ - - buf_idx = 0UL; - while (u32NDummy --) - { - cmdBuf[buf_idx++] = 0x00U; - } - - /* Same bit mode as above. */ - spim_write(cmdBuf, buf_idx); /* Write out dummy bytes. */ - - SwitchNBitInput(u32NBitDat); - spim_read(pu8RxBuf, u32NRx); /* Read back data. */ - - SPIM_SET_SS_EN(0); /* CS deactivated. */ -} - -/** - * @brief Write data to SPI Flash by Page Write mode. - * @param u32Addr Start address to write. - * @param is4ByteAddr 4-byte address or not. - * @param u32NTx Number of bytes to write. - * @param pu8TxBuf Transmit buffer. - * @param wrCmd Write command. - * @return None. - */ -void SPIM_DMA_Write(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NTx, uint8_t pu8TxBuf[], uint32_t wrCmd) -{ - uint32_t pageOffset, toWr; - uint32_t buf_idx = 0UL; - - pageOffset = u32Addr % 256UL; - - if ((pageOffset + u32NTx) <= 256UL) - { - /* Do all the bytes fit onto one page ? */ - SPIM_WriteInPageDataByPageWrite(u32Addr, is4ByteAddr, u32NTx, pu8TxBuf, wrCmd, 1); - } - else - { - toWr = 256UL - pageOffset; /* Size of data remaining on the first page. */ - - SPIM_WriteInPageDataByPageWrite(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], wrCmd, 1); - - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - - while (u32NTx) - { - toWr = 256UL; - if (toWr > u32NTx) - { - toWr = u32NTx; - } - - SPIM_WriteInPageDataByPageWrite(u32Addr, is4ByteAddr, toWr, &pu8TxBuf[buf_idx], wrCmd, 1); - - u32Addr += toWr; /* Advance indicator. */ - u32NTx -= toWr; - buf_idx += toWr; - } - } -} - -/** - * @brief Read data from SPI Flash by Page Read mode. - * @param u32Addr Start address to read. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32NRx Number of bytes to read. - * @param pu8RxBuf Receive buffer. - * @param u32RdCmd Read command. - * @param isSync Block or not. - * @return None. - */ -void SPIM_DMA_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], - uint32_t u32RdCmd, int isSync) -{ - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_PAGEREAD); /* Switch to Page Read mode. */ - SPIM_SET_SPIM_MODE(u32RdCmd); /* SPIM mode. */ - SPIM_SET_4BYTE_ADDR_EN(is4ByteAddr); /* Enable/disable 4-Byte Address. */ - - SPIM->SRAMADDR = (uint32_t) pu8RxBuf; /* SRAM u32Address. */ - SPIM->DMACNT = u32NRx; /* Transfer length. */ - SPIM->FADDR = u32Addr; /* Flash u32Address.*/ - SPIM_SET_GO(); /* Go. */ - - if (isSync) - { - SPIM_WAIT_FREE(); /* Wait for DMA done. */ - } -} - -/** - * @brief Enter Direct Map mode. - * @param is4ByteAddr 4-byte u32Address or not. - * @param u32RdCmd Read command. - * @param u32IdleIntvl Idle interval. - * @return None. - */ -void SPIM_EnterDirectMapMode(int is4ByteAddr, uint32_t u32RdCmd, uint32_t u32IdleIntvl) -{ - SPIM_SET_4BYTE_ADDR_EN(is4ByteAddr); /* Enable/disable 4-byte u32Address. */ - SPIM_SET_SPIM_MODE(u32RdCmd); /* SPIM mode. */ - SPIM_SET_IDL_INTVL(u32IdleIntvl); /* Idle interval. */ - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_DIRECTMAP); /* Switch to Direct Map mode. */ -} - -/** - * @brief Exit Direct Map mode. - * @return None. - */ -void SPIM_ExitDirectMapMode(void) -{ - SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_IO); /* Switch back to Normal mode. */ -} - - -/*@}*/ /* end of group SPIM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPIM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sys.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sys.c deleted file mode 100644 index e5e12896e7c..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_sys.c +++ /dev/null @@ -1,284 +0,0 @@ -/**************************************************************************//** - * @file sys.c - * @version V1.00 - * @brief M480 series SYS driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - - -/** @addtogroup SYS_EXPORTED_FUNCTIONS SYS Exported Functions - @{ -*/ - -/** - * @brief Clear reset source - * @param[in] u32Src is system reset source. Including : - * - \ref SYS_RSTSTS_CPULKRF_Msk - * - \ref SYS_RSTSTS_CPURF_Msk - * - \ref SYS_RSTSTS_SYSRF_Msk - * - \ref SYS_RSTSTS_BODRF_Msk - * - \ref SYS_RSTSTS_LVRF_Msk - * - \ref SYS_RSTSTS_WDTRF_Msk - * - \ref SYS_RSTSTS_PINRF_Msk - * - \ref SYS_RSTSTS_PORF_Msk - * @return None - * @details This function clear the selected system reset source. - */ -void SYS_ClearResetSrc(uint32_t u32Src) -{ - SYS->RSTSTS |= u32Src; -} - -/** - * @brief Get Brown-out detector output status - * @param None - * @retval 0 System voltage is higher than BODVL setting or BODEN is 0. - * @retval 1 System voltage is lower than BODVL setting. - * @details This function get Brown-out detector output status. - */ -uint32_t SYS_GetBODStatus(void) -{ - return ((SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) >> SYS_BODCTL_BODOUT_Pos); -} - -/** - * @brief Get reset status register value - * @param None - * @return Reset source - * @details This function get the system reset status register value. - */ -uint32_t SYS_GetResetSrc(void) -{ - return (SYS->RSTSTS); -} - -/** - * @brief Check if register is locked nor not - * @param None - * @retval 0 Write-protection function is disabled. - * 1 Write-protection function is enabled. - * @details This function check register write-protection bit setting. - */ -uint32_t SYS_IsRegLocked(void) -{ - return SYS->REGLCTL & 1UL ? 0UL : 1UL; -} - -/** - * @brief Get product ID - * @param None - * @return Product ID - * @details This function get product ID. - */ -uint32_t SYS_ReadPDID(void) -{ - return SYS->PDID; -} - -/** - * @brief Reset chip with chip reset - * @param None - * @return None - * @details This function reset chip with chip reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetChip(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk; -} - -/** - * @brief Reset chip with CPU reset - * @param None - * @return None - * @details This function reset CPU with CPU reset. - * The register write-protection function should be disabled before using this function. - */ -void SYS_ResetCPU(void) -{ - SYS->IPRST0 |= SYS_IPRST0_CPURST_Msk; -} - -/** - * @brief Reset selected module - * @param[in] u32ModuleIndex is module index. Including : - * - \ref PDMA_RST - * - \ref EBI_RST - * - \ref EMAC_RST - * - \ref SDH0_RST - * - \ref CRC_RST - * - \ref CCAP_RST - * - \ref HSUSBD_RST - * - \ref CRPT_RST - * - \ref SPIM_RST - * - \ref USBH_RST - * - \ref SDH1_RST - * - \ref GPIO_RST - * - \ref TMR0_RST - * - \ref TMR1_RST - * - \ref TMR2_RST - * - \ref TMR3_RST - * - \ref ACMP01_RST - * - \ref I2C0_RST - * - \ref I2C1_RST - * - \ref I2C2_RST - * - \ref QSPI0_RST - * - \ref SPI0_RST - * - \ref SPI1_RST - * - \ref SPI2_RST - * - \ref UART0_RST - * - \ref UART1_RST - * - \ref UART2_RST - * - \ref UART3_RST - * - \ref UART4_RST - * - \ref UART5_RST - * - \ref UART6_RST - * - \ref UART7_RST - * - \ref CAN0_RST - * - \ref CAN1_RST - * - \ref OTG_RST - * - \ref USBD_RST - * - \ref EADC_RST - * - \ref I2S0_RST - * - \ref HSOTG_RST - * - \ref TRNG_RST - * - \ref SC0_RST - * - \ref SC1_RST - * - \ref SC2_RST - * - \ref QSPI1_RST - * - \ref SPI3_RST - * - \ref USCI0_RST - * - \ref USCI1_RST - * - \ref DAC_RST - * - \ref EPWM0_RST - * - \ref EPWM1_RST - * - \ref BPWM0_RST - * - \ref BPWM1_RST - * - \ref QEI0_RST - * - \ref QEI1_RST - * - \ref ECAP0_RST - * - \ref ECAP1_RST - * - \ref CAN2_RST - * - \ref OPA_RST - * - \ref EADC1_RST - * @return None - * @details This function reset selected module. - */ -void SYS_ResetModule(uint32_t u32ModuleIndex) -{ - uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL; - - /* Generate reset signal to the corresponding module */ - u32tmpVal = (1UL << (u32ModuleIndex & 0x00ffffffUL)); - u32tmpAddr = (uint32_t)&SYS->IPRST0 + ((u32ModuleIndex >> 24UL)); - *(uint32_t *)u32tmpAddr |= u32tmpVal; - - /* Release corresponding module from reset state */ - u32tmpVal = ~(1UL << (u32ModuleIndex & 0x00ffffffUL)); - *(uint32_t *)u32tmpAddr &= u32tmpVal; -} - -/** - * @brief Enable and configure Brown-out detector function - * @param[in] i32Mode is reset or interrupt mode. Including : - * - \ref SYS_BODCTL_BOD_RST_EN - * - \ref SYS_BODCTL_BOD_INTERRUPT_EN - * @param[in] u32BODLevel is Brown-out voltage level. Including : - * - \ref SYS_BODCTL_BODVL_3_0V - * - \ref SYS_BODCTL_BODVL_2_8V - * - \ref SYS_BODCTL_BODVL_2_6V - * - \ref SYS_BODCTL_BODVL_2_4V - * - \ref SYS_BODCTL_BODVL_2_2V - * - \ref SYS_BODCTL_BODVL_2_0V - * - \ref SYS_BODCTL_BODVL_1_8V - * - \ref SYS_BODCTL_BODVL_1_6V - * @return None - * @details This function configure Brown-out detector reset or interrupt mode, enable Brown-out function and set Brown-out voltage level. - * The register write-protection function should be disabled before using this function. - */ -void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel) -{ - /* Enable Brown-out Detector function */ - SYS->BODCTL |= SYS_BODCTL_BODEN_Msk; - - /* Enable Brown-out interrupt or reset function */ - SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODRSTEN_Msk) | (uint32_t)i32Mode; - - /* Select Brown-out Detector threshold voltage */ - SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | u32BODLevel; -} - -/** - * @brief Disable Brown-out detector function - * @param None - * @return None - * @details This function disable Brown-out detector function. - * The register write-protection function should be disabled before using this function. - */ -void SYS_DisableBOD(void) -{ - SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk; -} - -/** - * @brief Set Power Level - * @param[in] u32PowerLevel is power level setting. Including : - * - \ref SYS_PLCTL_PLSEL_PL0 - * - \ref SYS_PLCTL_PLSEL_PL1 - * @return None - * @details This function select power level. - * The register write-protection function should be disabled before using this function. - */ -void SYS_SetPowerLevel(uint32_t u32PowerLevel) -{ - /* Set power voltage level */ - SYS->PLCTL = (SYS->PLCTL & (~SYS_PLCTL_PLSEL_Msk)) | (u32PowerLevel); -} - -/** - * @brief Set Reference Voltage - * @param[in] u32VRefCTL is reference voltage setting. Including : - * - \ref SYS_VREFCTL_VREF_PIN - * - \ref SYS_VREFCTL_VREF_1_6V - * - \ref SYS_VREFCTL_VREF_2_0V - * - \ref SYS_VREFCTL_VREF_2_5V - * - \ref SYS_VREFCTL_VREF_3_0V - * - \ref SYS_VREFCTL_VREF_AVDD - * @return None - * @details This function select reference voltage. - * The register write-protection function should be disabled before using this function. - */ -void SYS_SetVRef(uint32_t u32VRefCTL) -{ - /* Set reference voltage */ - SYS->VREFCTL = (SYS->VREFCTL & (~SYS_VREFCTL_VREFCTL_Msk)) | (u32VRefCTL); -} - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer.c deleted file mode 100644 index 1987445777b..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer.c +++ /dev/null @@ -1,353 +0,0 @@ -/**************************************************************************//** - * @file timer.c - * @brief M480 Timer Controller(Timer) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Open Timer with Operate Mode and Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Mode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * @param[in] u32Freq Target working frequency - * - * @return Real timer working frequency - * - * @details This API is used to configure timer to operate in specified mode and frequency. - * If timer cannot work in target frequency, a closest frequency will be chose and returned. - * @note After calling this API, Timer is \b NOT running yet. But could start timer running be calling - * \ref TIMER_Start macro or program registers directly. - */ -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Cmpr = 0UL, u32Prescale = 0UL; - - /* Fastest possible timer working freq is (u32Clk / 2). While cmpr = 2, prescaler = 0. */ - if(u32Freq > (u32Clk / 2UL)) - { - u32Cmpr = 2UL; - } - else - { - u32Cmpr = u32Clk / u32Freq; - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if (u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CTL = u32Mode | u32Prescale; - timer->CMP = u32Cmpr; - - return(u32Clk / (u32Cmpr * (u32Prescale + 1UL))); -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This API stops timer counting and disable all timer interrupt function. - */ -void TIMER_Close(TIMER_T *timer) -{ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; -} - -/** - * @brief Create a specify Delay Time - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Usec Delay period in micro seconds. Valid values are between 100~1000000 (100 micro second ~ 1 second). - * - * @return None - * - * @details This API is used to create a delay loop for u32usec micro seconds by using timer one-shot mode. - * @note This API overwrites the register setting of the timer used to count the delay time. - * @note This API use polling mode. So there is no need to enable interrupt for the timer module used to generate delay. - */ -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Prescale = 0UL, delay = (SystemCoreClock / u32Clk) + 1UL; - uint32_t u32Cmpr, u32NsecPerTick; - - /* Clear current timer configuration */ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; - - if(u32Clk <= 1000000UL) /* min delay is 1000 us if timer clock source is <= 1 MHz */ - { - if(u32Usec < 1000UL) - { - u32Usec = 1000UL; - } - if(u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - else - { - if(u32Usec < 100UL) - { - u32Usec = 100UL; - } - if(u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - - if(u32Clk <= 1000000UL) - { - u32Prescale = 0UL; - u32NsecPerTick = 1000000000UL / u32Clk; - u32Cmpr = (u32Usec * 1000UL) / u32NsecPerTick; - } - else - { - u32Cmpr = u32Usec * (u32Clk / 1000000UL); - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - if (u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CMP = u32Cmpr; - timer->CTL = TIMER_CTL_CNTEN_Msk | TIMER_ONESHOT_MODE | u32Prescale; - - /* When system clock is faster than timer clock, it is possible timer active bit cannot set in time while we check it. - And the while loop below return immediately, so put a tiny delay here allowing timer start counting and raise active flag. */ - for(; delay > 0UL; delay--) - { - __NOP(); - } - - while(timer->CTL & TIMER_CTL_ACTSTS_Msk) - { - ; - } -} - -/** - * @brief Enable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CapMode Timer capture mode. Could be - * - \ref TIMER_CAPTURE_FREE_COUNTING_MODE - * - \ref TIMER_CAPTURE_COUNTER_RESET_MODE - * @param[in] u32Edge Timer capture trigger edge. Possible values are - * - \ref TIMER_CAPTURE_EVENT_FALLING - * - \ref TIMER_CAPTURE_EVENT_RISING - * - \ref TIMER_CAPTURE_EVENT_FALLING_RISING - * - \ref TIMER_CAPTURE_EVENT_RISING_FALLING - * - * @return None - * - * @details This API is used to enable timer capture function with specify capture trigger edge \n - * to get current counter value or reset counter value to 0. - * @note Timer frequency should be configured separately by using \ref TIMER_Open API, or program registers directly. - */ -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~(TIMER_EXTCTL_CAPFUNCS_Msk | TIMER_EXTCTL_CAPEDGE_Msk)) | - u32CapMode | u32Edge | TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Disable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This API is used to disable the timer capture function. - */ -void TIMER_DisableCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Edge Detection edge of counter pin. Could be ether - * - \ref TIMER_COUNTER_EVENT_FALLING, or - * - \ref TIMER_COUNTER_EVENT_RISING - * - * @return None - * - * @details This function is used to enable the timer counter function with specify detection edge. - * @note Timer compare value should be configured separately by using \ref TIMER_SET_CMP_VALUE macro or program registers directly. - * @note While using event counter function, \ref TIMER_TOGGLE_MODE cannot set as timer operation mode. - */ -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~TIMER_EXTCTL_CNTPHASE_Msk) | u32Edge; - timer->CTL |= TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Disable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This API is used to disable the timer event counter function. - */ -void TIMER_DisableEventCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Get Timer Clock Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Timer clock frequency - * - * @details This API is used to get the timer clock frequency. - * @note This API cannot return correct clock rate if timer source is from external clock input. - */ -uint32_t TIMER_GetModuleClock(TIMER_T *timer) -{ - uint32_t u32Src, u32Clk; - const uint32_t au32Clk[] = {__HXT, __LXT, 0UL, 0UL, 0UL, __LIRC, 0UL, __HIRC}; - - if(timer == TIMER0) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR0SEL_Msk) >> CLK_CLKSEL1_TMR0SEL_Pos; - } - else if(timer == TIMER1) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR1SEL_Msk) >> CLK_CLKSEL1_TMR1SEL_Pos; - } - else if(timer == TIMER2) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR2SEL_Msk) >> CLK_CLKSEL1_TMR2SEL_Pos; - } - else /* Timer 3 */ - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR3SEL_Msk) >> CLK_CLKSEL1_TMR3SEL_Pos; - } - - if(u32Src == 2UL) - { - if((timer == TIMER0) || (timer == TIMER1)) - { - u32Clk = CLK_GetPCLK0Freq(); - } - else - { - u32Clk = CLK_GetPCLK1Freq(); - } - } - else - { - u32Clk = au32Clk[u32Src]; - } - - return u32Clk; -} - - - -/** - * @brief This function is used to enable the Timer frequency counter function - * @param[in] timer The base address of Timer module. Can be \ref TIMER0 or \ref TIMER2 - * @param[in] u32DropCount This parameter has no effect in M480 series BSP - * @param[in] u32Timeout This parameter has no effect in M480 series BSP - * @param[in] u32EnableInt Enable interrupt assertion after capture complete or not. Valid values are TRUE and FALSE - * @return None - * @details This function is used to calculate input event frequency. After enable - * this function, a pair of timers, TIMER0 and TIMER1, or TIMER2 and TIMER3 - * will be configured for this function. The mode used to calculate input - * event frequency is mentioned as "Inter Timer Trigger Mode" in Technical - * Reference Manual - */ -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt) -{ - TIMER_T *t; /* store the timer base to configure compare value */ - - t = (timer == TIMER0) ? TIMER1 : TIMER3; - - t->CMP = 0xFFFFFFUL; - t->EXTCTL = u32EnableInt ? TIMER_EXTCTL_CAPIEN_Msk : 0UL; - timer->CTL = TIMER_CTL_INTRGEN_Msk | TIMER_CTL_CNTEN_Msk; - - return; -} -/** - * @brief This function is used to disable the Timer frequency counter function. - * @param[in] timer The base address of Timer module - * @return None - */ -void TIMER_DisableFreqCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTRGEN_Msk; -} - - -/** - * @brief This function is used to select the interrupt source used to trigger other modules. - * @param[in] timer The base address of Timer module - * @param[in] u32Src Selects the interrupt source to trigger other modules. Could be: - * - \ref TIMER_TRGSRC_TIMEOUT_EVENT - * - \ref TIMER_TRGSRC_CAPTURE_EVENT - * @return None - */ -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src) -{ - timer->TRGCTL = (timer->TRGCTL & ~TIMER_TRGCTL_TRGSSEL_Msk) | u32Src; -} - -/** - * @brief This function is used to set modules trigger by timer interrupt - * @param[in] timer The base address of Timer module - * @param[in] u32Mask The mask of modules (EPWM, EADC, DAC and PDMA) trigger by timer. Is the combination of - * - \ref TIMER_TRG_TO_EPWM, - * - \ref TIMER_TRG_TO_EADC, - * - \ref TIMER_TRG_TO_DAC, and - * - \ref TIMER_TRG_TO_PDMA - * @return None - */ -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask) -{ - timer->TRGCTL = (timer->TRGCTL & ~(TIMER_TRGCTL_TRGEPWM_Msk | TIMER_TRGCTL_TRGDAC_Msk | TIMER_TRGCTL_TRGEADC_Msk | TIMER_TRGCTL_TRGPDMA_Msk)) | u32Mask; -} - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer_pwm.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer_pwm.c deleted file mode 100644 index 15d180f2658..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_timer_pwm.c +++ /dev/null @@ -1,443 +0,0 @@ -/**************************************************************************//** - * @file timer_pwm.c - * @brief M480 Timer PWM Controller(Timer PWM) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_FUNCTIONS TIMER PWM Exported Functions - @{ -*/ - -/** - * @brief Set PWM Counter Clock Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CntClkSrc PWM counter clock source, could be one of following source - * - \ref TPWM_CNTR_CLKSRC_TMR_CLK - * - \ref TPWM_CNTR_CLKSRC_TIMER0_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER1_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER2_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER3_INT - * - * @return None - * - * @details This function is used to set PWM counter clock source. - */ -void TPWM_SetCounterClockSource(TIMER_T *timer, uint32_t u32CntClkSrc) -{ - (timer)->PWMCLKSRC = ((timer)->PWMCLKSRC & ~TIMER_PWMCLKSRC_CLKSRC_Msk) | u32CntClkSrc; -} - -/** - * @brief Configure PWM Output Frequency and Duty Cycle - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Frequency Target generator frequency. - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0~100. 10 means 10%, 20 means 20%... - * - * @return Nearest frequency clock in nano second - * - * @details This API is used to configure PWM output frequency and duty cycle in up count type and auto-reload operation mode. - * @note This API is only available if Timer PWM counter clock source is from TMRx_CLK. - */ -uint32_t TPWM_ConfigOutputFreqAndDuty(TIMER_T *timer, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32PWMClockFreq, u32TargetFreq; - uint32_t u32Prescaler = 0x1000UL, u32Period, u32CMP; - - if((timer == TIMER0) || (timer == TIMER1)) - { - u32PWMClockFreq = CLK_GetPCLK0Freq(); - } - else - { - u32PWMClockFreq = CLK_GetPCLK1Freq(); - } - - /* Calculate u16PERIOD and u16PSC */ - for(u32Prescaler = 1UL; u32Prescaler <= 0x1000UL; u32Prescaler++) - { - u32Period = (u32PWMClockFreq / u32Prescaler) / u32Frequency; - - /* If target u32Period is larger than 0x10000, need to use a larger prescaler */ - if(u32Period <= 0x10000UL) - { - break; - } - } - /* Store return value here 'cos we're gonna change u32Prescaler & u32Period to the real value to fill into register */ - u32TargetFreq = (u32PWMClockFreq / u32Prescaler) / u32Period; - - /* Set PWM to up count type */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (TPWM_UP_COUNT << TIMER_PWMCTL_CNTTYPE_Pos); - - /* Set PWM to auto-reload mode */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTMODE_Msk) | TPWM_AUTO_RELOAD_MODE; - - /* Convert to real register value */ - TPWM_SET_PRESCALER(timer, (u32Prescaler - 1UL)); - - TPWM_SET_PERIOD(timer, (u32Period - 1UL)); - if(u32DutyCycle) - { - u32CMP = (u32DutyCycle * u32Period) / 100UL; - } - else - { - u32CMP = 0UL; - } - - TPWM_SET_CMPDAT(timer, u32CMP); - - return (u32TargetFreq); -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the same as Timer PWM clock source. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableDeadTime(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the Timer PWM clock source with prescale. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableDeadTimeWithPrescale(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTCKSEL_Msk | TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Disable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable Dead-time of selected channel. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_DisableDeadTime(TIMER_T *timer) -{ - timer->PWMDTCTL = 0x0UL; -} - -/** - * @brief Enable PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable PWM generator and start counter counting. - */ -void TPWM_EnableCounter(TIMER_T *timer) -{ - timer->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Disable PWM Generator - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable PWM counter immediately by clear CNTEN (TIMERx_PWMCTL[0]) bit. - */ -void TPWM_DisableCounter(TIMER_T *timer) -{ - timer->PWMCTL &= ~TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Enable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Condition The condition to trigger ADC. It could be one of following conditions: - * - \ref TPWM_TRIGGER_ADC_AT_ZERO_POINT - * - \ref TPWM_TRIGGER_ADC_AT_PERIOD_POINT - * - \ref TPWM_TRIGGER_ADC_AT_ZERO_OR_PERIOD_POINT - * - \ref TPWM_TRIGGER_ADC_AT_COMPARE_UP_COUNT_POINT - * - \ref TPWM_TRIGGER_ADC_AT_COMPARE_DOWN_COUNT_POINT - * - * @return None - * - * @details This function is used to enable specified counter compare event to trigger ADC. - */ -void TPWM_EnableTriggerADC(TIMER_T *timer, uint32_t u32Condition) -{ - timer->PWMEADCTS = TIMER_PWMEADCTS_TRGEN_Msk | u32Condition; -} - -/** - * @brief Disable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable counter compare event to trigger ADC. - */ -void TPWM_DisableTriggerADC(TIMER_T *timer) -{ - timer->PWMEADCTS = 0x0UL; -} - -/** - * @brief Enable Fault Brake Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32CH0Level PWMx_CH0 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32CH1Level PWMx_CH1 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32BrakeSource Fault brake source, combination of following source - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_EDGE_BKPIN - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_RAM - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_BKPIN - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM - * - * @return None - * - * @details This function is used to enable fault brake function. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableFaultBrake(TIMER_T *timer, uint32_t u32CH0Level, uint32_t u32CH1Level, uint32_t u32BrakeSource) -{ - timer->PWMFAILBRK |= ((u32BrakeSource >> 16) & 0xFUL); - timer->PWMBRKCTL = (timer->PWMBRKCTL & ~(TIMER_PWMBRKCTL_BRKAEVEN_Msk | TIMER_PWMBRKCTL_BRKAODD_Msk)) | - (u32BrakeSource & 0xFFFFUL) | (u32CH0Level << TIMER_PWMBRKCTL_BRKAEVEN_Pos) | (u32CH1Level << TIMER_PWMBRKCTL_BRKAODD_Pos); -} - -/** - * @brief Enable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to enable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 |= u32IntSource; -} - -/** - * @brief Disable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to disable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_DisableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 &= ~u32IntSource; -} - -/** - * @brief Indicate Fault Brake Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * - * @details This function is used to indicate fault brake interrupt flag occurred or not of selected source. - */ -uint32_t TPWM_GetFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - return ((timer->PWMINTSTS1 & (0x3UL << u32IntSource))? 1UL : 0UL); -} - -/** - * @brief Clear Fault Brake Interrupt Flags - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to clear fault brake interrupt flags of selected source. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_ClearFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTSTS1 = (0x3UL << u32IntSource); -} - -/** - * @brief Enable load mode of selected channel - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32LoadMode Timer PWM counter loading mode, could be one of following mode - * - \ref TPWM_LOAD_MODE_PERIOD - * - \ref TPWM_LOAD_MODE_IMMEDIATE - * - \ref TPWM_LOAD_MODE_CENTER - * - * @return None - * - * @details This function is used to enable load mode of selected channel. - * @note The default loading mode is period loading mode. - */ -void TPWM_SetLoadMode(TIMER_T *timer, uint32_t u32LoadMode) -{ - timer->PWMCTL = (timer->PWMCTL & ~(TIMER_PWMCTL_IMMLDEN_Msk | TIMER_PWMCTL_CTRLD_Msk)) | u32LoadMode; -} - -/** - * @brief Enable brake pin noise filter function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32BrakePinSrc The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * @param[in] u32DebounceCnt This value controls the real debounce sample time. - * The target debounce sample time is (debounce sample clock period) * (u32DebounceCnt). - * @param[in] u32ClkSrcSel Brake pin detector debounce clock source, could be one of following source - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_1 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_2 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_4 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_8 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_16 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_32 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_64 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_128 - * - * @return None - * - * @details This function is used to enable external brake pin detector noise filter function. - */ -void TPWM_EnableBrakePinDebounce(TIMER_T *timer, uint32_t u32BrakePinSrc, uint32_t u32DebounceCnt, uint32_t u32ClkSrcSel) -{ - timer->PWMBNF = (timer->PWMBNF & ~(TIMER_PWMBNF_BKPINSRC_Msk | TIMER_PWMBNF_BRKFCNT_Msk | TIMER_PWMBNF_BRKNFSEL_Msk)) | - (u32BrakePinSrc << TIMER_PWMBNF_BKPINSRC_Pos) | - (u32DebounceCnt << TIMER_PWMBNF_BRKFCNT_Pos) | - (u32ClkSrcSel << TIMER_PWMBNF_BRKNFSEL_Pos) | TIMER_PWMBNF_BRKNFEN_Msk; -} - -/** - * @brief Disable brake pin noise filter function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable external brake pin detector noise filter function. - */ -void TPWM_DisableBrakePinDebounce(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKNFEN_Msk; -} - - -/** - * @brief Enable brake pin inverse function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to enable PWM brake pin inverse function. - */ -void TPWM_EnableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Disable brake pin inverse function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @return None - * @details This function is used to disable PWM brake pin inverse function. - */ -void TPWM_DisableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Set brake pin source - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32BrakePinNum Brake pin selection. One of the following: - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * @return None - * @details This function is used to set PWM brake pin source. - */ -void TPWM_SetBrakePinSource(TIMER_T *timer, uint32_t u32BrakePinNum) -{ - timer->PWMBNF = (((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | (u32BrakePinNum << TIMER_PWMBNF_BKPINSRC_Pos)); -} - - -/*@}*/ /* end of group TIMER_PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_PWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_trng.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_trng.c deleted file mode 100644 index 98449d1a85d..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_trng.c +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************//** - * @file trng.c - * @version V1.00 - * @brief M480 series TRNG driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include - -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TRNG_Driver TRNG Driver - @{ -*/ - - -/** @addtogroup TRNG_EXPORTED_FUNCTIONS TRNG Exported Functions - @{ -*/ - - -/** - * @brief Initialize TRNG hardware. - * @return None - */ -void TRNG_Open(void) -{ - SYS->IPRST1 |= SYS_IPRST1_TRNGRST_Msk; - SYS->IPRST1 ^= SYS_IPRST1_TRNGRST_Msk; - - TRNG->CTL |= TRNG_CTL_TRNGEN_Msk; - - TRNG->ACT |= TRNG_ACT_ACT_Msk; - - /* Waiting for ready */ - while ((TRNG->CTL & TRNG_CTL_READY_Msk) == 0); -} - - -/** - * @brief Generate a 32-bits random number word. - * @param[out] u32RndNum The output 32-bits word random number. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenWord(uint32_t *u32RndNum) -{ - uint32_t i, u32Reg, timeout; - - *u32RndNum = 0; - u32Reg = TRNG->CTL; - - for (i = 0; i < 4; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - *u32RndNum |= ((TRNG->DATA & 0xff) << i*8); - - } - return 0; -} - -/** - * @brief Generate a big number in binary format. - * @param[out] u8BigNum The output big number. - * @param[in] i32Len Request bit length of the output big number. It must be multiple of 8. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenBignum(uint8_t u8BigNum[], int32_t i32Len) -{ - uint32_t i, u32Reg, timeout; - - u32Reg = TRNG->CTL; - - for (i = 0; i < i32Len/8; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - u8BigNum[i] = (TRNG->DATA & 0xff); - } - return 0; -} - -/** - * @brief Generate a big number in hex format. - * @param[out] cBigNumHex The output hex format big number. - * @param[in] i32Len Request bit length of the output big number. It must be multiple of 8. - * - * @return Success or time-out. - * @retval 0 Success - * @retval -1 Time-out. TRNG hardware may not be enabled. - */ -int32_t TRNG_GenBignumHex(char cBigNumHex[], int32_t i32Len) -{ - uint32_t i, idx, u32Reg, timeout; - uint32_t data; - - u32Reg = TRNG->CTL; - idx = 0; - for (i = 0; i < i32Len/8; i++) - { - TRNG->CTL = TRNG_CTL_TRNGEN_Msk | u32Reg; - - /* TRNG should generate one byte per 125*8 us */ - for (timeout = (CLK_GetHCLKFreq() / 100); timeout > 0; timeout--) - { - if (TRNG->CTL & TRNG_CTL_DVIF_Msk) - break; - } - - if (timeout == 0) - return -1; - - data = (TRNG->DATA & 0xff); - - if (data >= 0xA0) - cBigNumHex[idx++] = ((data >> 4) & 0xf) - 10 + 'A'; - else - cBigNumHex[idx++] = ((data >> 4) & 0xf) + '0'; - - data &= 0xf; - if (data >= 0xA) - cBigNumHex[idx++] = data - 10 + 'A'; - else - cBigNumHex[idx++] = data + '0'; - } - cBigNumHex[idx] = 0; - return 0; -} - - -/*@}*/ /* end of group TRNG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TRNG_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2019 Nuvoton Technology Corp. ***/ - - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_uart.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_uart.c deleted file mode 100644 index 9687f89ad6f..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_uart.c +++ /dev/null @@ -1,656 +0,0 @@ -/**************************************************************************//** - * @file uart.c - * @version V3.00 - * @brief M480 series UART driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -/** - * @brief Clear UART specified interrupt flag - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTSTS_LININT_Msk : LIN bus interrupt - * - \ref UART_INTSTS_WKIF_Msk : Wake-up interrupt - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error interrupt - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status interrupt - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status interrupt - * - * @return None - * - * @details The function is used to clear UART specified interrupt flag. - */ - -void UART_ClearIntFlag(UART_T* uart, uint32_t u32InterruptFlag) -{ - - if(u32InterruptFlag & UART_INTSTS_RLSINT_Msk) /* Clear Receive Line Status Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_BIF_Msk | UART_FIFOSTS_FEF_Msk | UART_FIFOSTS_PEF_Msk; - uart->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_MODEMINT_Msk) /* Clear Modem Status Interrupt */ - { - uart->MODEMSTS |= UART_MODEMSTS_CTSDETF_Msk; - } - else - { - } - - if(u32InterruptFlag & UART_INTSTS_BUFERRINT_Msk) /* Clear Buffer Error Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_RXOVIF_Msk | UART_FIFOSTS_TXOVIF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_WKINT_Msk) /* Clear Wake-up Interrupt */ - { - uart->WKSTS = UART_WKSTS_CTSWKF_Msk | UART_WKSTS_DATWKF_Msk | - UART_WKSTS_RFRTWKF_Msk |UART_WKSTS_RS485WKF_Msk | - UART_WKSTS_TOUTWKF_Msk; - } - - if(u32InterruptFlag & UART_INTSTS_LININT_Msk) /* Clear LIN Bus Interrupt */ - { - uart->INTSTS = UART_INTSTS_LINIF_Msk; - uart->LINSTS = UART_LINSTS_BITEF_Msk | UART_LINSTS_BRKDETF_Msk | - UART_LINSTS_SLVSYNCF_Msk | UART_LINSTS_SLVIDPEF_Msk | - UART_LINSTS_SLVHEF_Msk | UART_LINSTS_SLVHDETF_Msk ; - } -} - - -/** - * @brief Disable UART interrupt - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART interrupt. - */ -void UART_Close(UART_T* uart) -{ - uart->INTEN = 0ul; -} - - -/** - * @brief Disable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART auto flow control. - */ -void UART_DisableFlowCtrl(UART_T* uart) -{ - uart->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk); -} - - -/** - * @brief Disable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to disable UART specified interrupt and disable NVIC UART IRQ. - */ -void UART_DisableInt(UART_T* uart, uint32_t u32InterruptFlag) -{ - /* Disable UART specified interrupt */ - UART_DISABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Enable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to Enable UART auto flow control. - */ -void UART_EnableFlowCtrl(UART_T* uart) -{ - /* Set RTS pin output is low level active */ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - - /* Set CTS pin input is low level active */ - uart->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk; - - /* Set RTS and CTS auto flow control enable */ - uart->INTEN |= UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk; -} - - -/** - * @brief The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module: - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - */ -void UART_EnableInt(UART_T* uart, uint32_t u32InterruptFlag) -{ - /* Enable UART specified interrupt */ - UART_ENABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Open and set UART function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The baudrate of UART module. - * - * @return None - * - * @details This function use to enable UART function and set baud-rate. - */ -void UART_Open(UART_T* uart, uint32_t u32baudrate) -{ - uint32_t u32UartClkSrcSel=0ul, u32UartClkDivNum=0ul; - uint32_t u32ClkTbl[4] = {__HXT, 0ul, __LXT, __HIRC}; - uint32_t u32Baud_Div = 0ul; - - - if(uart==(UART_T*)UART0) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = ((uint32_t)(CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk)) >> CLK_CLKSEL1_UART0SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - } - else if(uart==(UART_T*)UART1) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - } - else if(uart==(UART_T*)UART2) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - } - else if(uart==(UART_T*)UART3) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - } - else if(uart==(UART_T*)UART4) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - } - else if(uart==(UART_T*)UART5) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - } - - /* Select UART function */ - uart->FUNCSEL = UART_FUNCSEL_UART; - - /* Set UART line configuration */ - uart->LINE = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1; - - /* Set UART Rx and RTS trigger level */ - uart->FIFO &= ~(UART_FIFO_RFITL_Msk | UART_FIFO_RTSTRGLV_Msk); - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if(u32UartClkSrcSel == 1ul) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Set UART baud rate */ - if(u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if(u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } -} - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive FIFO. - * @param[in] u32ReadBytes The the read bytes number of data. - * - * @return u32Count Receive byte count - * - * @details The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf. - */ -uint32_t UART_Read(UART_T* uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for(u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while(uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if(u32Exit == 1ul) - { - break; - } - else - { - pu8RxBuf[u32Count] = (uint8_t)uart->DAT; /* Get Data from UART RX */ - } - } - - return u32Count; - -} - - -/** - * @brief Set UART line configuration - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The register value of baudrate of UART module. - * If u32baudrate = 0, UART baudrate will not change. - * @param[in] u32data_width The data length of UART module. - * - \ref UART_WORD_LEN_5 - * - \ref UART_WORD_LEN_6 - * - \ref UART_WORD_LEN_7 - * - \ref UART_WORD_LEN_8 - * @param[in] u32parity The parity setting (none/odd/even/mark/space) of UART module. - * - \ref UART_PARITY_NONE - * - \ref UART_PARITY_ODD - * - \ref UART_PARITY_EVEN - * - \ref UART_PARITY_MARK - * - \ref UART_PARITY_SPACE - * @param[in] u32stop_bits The stop bit length (1/1.5/2 bit) of UART module. - * - \ref UART_STOP_BIT_1 - * - \ref UART_STOP_BIT_1_5 - * - \ref UART_STOP_BIT_2 - * - * @return None - * - * @details This function use to config UART line setting. - */ -void UART_SetLineConfig(UART_T* uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32UartClkSrcSel=0ul, u32UartClkDivNum=0ul; - uint32_t u32ClkTbl[4ul] = {__HXT, 0ul, __LXT, __HIRC}; - uint32_t u32Baud_Div = 0ul; - - - if(uart==(UART_T*)UART0) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk) >> CLK_CLKSEL1_UART0SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - } - else if(uart==(UART_T*)UART1) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - } - else if(uart==(UART_T*)UART2) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - } - else if(uart==(UART_T*)UART3) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - } - else if(uart==(UART_T*)UART4) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - } - else if(uart==(UART_T*)UART5) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if(u32UartClkSrcSel == 1ul) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - else - { - } - - /* Set UART baud rate */ - if(u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if(u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } - - /* Set UART line configuration */ - uart->LINE = u32data_width | u32parity | u32stop_bits; -} - - -/** - * @brief Set Rx timeout count - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32TOC Rx timeout counter. - * - * @return None - * - * @details This function use to set Rx timeout count. - */ -void UART_SetTimeoutCnt(UART_T* uart, uint32_t u32TOC) -{ - /* Set time-out interrupt comparator */ - uart->TOUT = (uart->TOUT & ~UART_TOUT_TOIC_Msk) | (u32TOC); - - /* Set time-out counter enable */ - uart->INTEN |= UART_INTEN_TOCNTEN_Msk; -} - - -/** - * @brief Select and configure IrDA function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Buadrate The baudrate of UART module. - * @param[in] u32Direction The direction of UART module in IrDA mode: - * - \ref UART_IRDA_TXEN - * - \ref UART_IRDA_RXEN - * - * @return None - * - * @details The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate. - */ -void UART_SelectIrDAMode(UART_T* uart, uint32_t u32Buadrate, uint32_t u32Direction) -{ - uint32_t u32UartClkSrcSel=0ul, u32UartClkDivNum=0ul; - uint32_t u32ClkTbl[4ul] = {__HXT, 0ul, __LXT, __HIRC}; - uint32_t u32Baud_Div; - - /* Select IrDA function mode */ - uart->FUNCSEL = UART_FUNCSEL_IrDA; - - - if(uart==UART0) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART0SEL_Msk) >> CLK_CLKSEL1_UART0SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART0DIV_Msk) >> CLK_CLKDIV0_UART0DIV_Pos; - } - else if(uart==UART1) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL1 & CLK_CLKSEL1_UART1SEL_Msk) >> CLK_CLKSEL1_UART1SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV0 & CLK_CLKDIV0_UART1DIV_Msk) >> CLK_CLKDIV0_UART1DIV_Pos; - } - else if(uart==UART2) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART2SEL_Msk) >> CLK_CLKSEL3_UART2SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART2DIV_Msk) >> CLK_CLKDIV4_UART2DIV_Pos; - } - else if(uart==UART3) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART3SEL_Msk) >> CLK_CLKSEL3_UART3SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART3DIV_Msk) >> CLK_CLKDIV4_UART3DIV_Pos; - } - else if(uart==UART4) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART4SEL_Msk) >> CLK_CLKSEL3_UART4SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART4DIV_Msk) >> CLK_CLKDIV4_UART4DIV_Pos; - } - else if(uart==UART5) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (CLK->CLKSEL3 & CLK_CLKSEL3_UART5SEL_Msk) >> CLK_CLKSEL3_UART5SEL_Pos; - /* Get UART clock divider number */ - u32UartClkDivNum = (CLK->CLKDIV4 & CLK_CLKDIV4_UART5DIV_Msk) >> CLK_CLKDIV4_UART5DIV_Pos; - } - - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if(u32UartClkSrcSel == 1ul) - { - u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - else - { - } - - /* Set UART IrDA baud rate in mode 0 */ - if(u32Buadrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32Buadrate); - - if(u32Baud_Div < 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | u32Baud_Div); - } - else - { - } - } - - /* Configure IrDA relative settings */ - if(u32Direction == UART_IRDA_RXEN) - { - uart->IRDA |= UART_IRDA_RXINV_Msk; /*Rx signal is inverse*/ - uart->IRDA &= ~UART_IRDA_TXEN_Msk; - } - else - { - uart->IRDA &= ~UART_IRDA_TXINV_Msk; /*Tx signal is not inverse*/ - uart->IRDA |= UART_IRDA_TXEN_Msk; - } - -} - - -/** - * @brief Select and configure RS485 function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The operation mode(NMM/AUD/AAD). - * - \ref UART_ALTCTL_RS485NMM_Msk - * - \ref UART_ALTCTL_RS485AUD_Msk - * - \ref UART_ALTCTL_RS485AAD_Msk - * @param[in] u32Addr The RS485 address. - * - * @return None - * - * @details The function is used to set RS485 relative setting. - */ -void UART_SelectRS485Mode(UART_T* uart, uint32_t u32Mode, uint32_t u32Addr) -{ - /* Select UART RS485 function mode */ - uart->FUNCSEL = UART_FUNCSEL_RS485; - - /* Set RS585 configuration */ - uart->ALTCTL &= ~(UART_ALTCTL_RS485NMM_Msk | UART_ALTCTL_RS485AUD_Msk | UART_ALTCTL_RS485AAD_Msk | UART_ALTCTL_ADDRMV_Msk); - uart->ALTCTL |= (u32Mode | (u32Addr << UART_ALTCTL_ADDRMV_Pos)); -} - - -/** - * @brief Select and configure LIN function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The LIN direction : - * - \ref UART_ALTCTL_LINTXEN_Msk - * - \ref UART_ALTCTL_LINRXEN_Msk - * @param[in] u32BreakLength The break field length. - * - * @return None - * - * @details The function is used to set LIN relative setting. - */ -void UART_SelectLINMode(UART_T* uart, uint32_t u32Mode, uint32_t u32BreakLength) -{ - /* Select LIN function mode */ - uart->FUNCSEL = UART_FUNCSEL_LIN; - - /* Select LIN function setting : Tx enable, Rx enable and break field length */ - uart->ALTCTL &= ~(UART_ALTCTL_LINTXEN_Msk | UART_ALTCTL_LINRXEN_Msk | UART_ALTCTL_BRKFL_Msk); - uart->ALTCTL |= (u32Mode | (u32BreakLength << UART_ALTCTL_BRKFL_Pos)); -} - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8TxBuf The buffer to send the data to UART transmission FIFO. - * @param[out] u32WriteBytes The byte number of data. - * - * @return u32Count transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by UART. - */ -uint32_t UART_Write(UART_T* uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for(u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while(uart->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) /* Check Tx Full */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if(u32Exit == 1ul) - { - break; - } - else - { - uart->DAT = pu8TxBuf[u32Count]; /* Send UART Data from buffer */ - } - } - - return u32Count; -} - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usbd.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usbd.c deleted file mode 100644 index fd783140238..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usbd.c +++ /dev/null @@ -1,745 +0,0 @@ -/**************************************************************************//** - * @file usbd.c - * @version V1.00 - * @brief M480 USBD driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - - -/** @addtogroup USBD_EXPORTED_FUNCTIONS USBD Exported Functions - @{ -*/ - -/* Global variables for Control Pipe */ -uint8_t g_usbd_SetupPacket[8] = {0ul}; /*!< Setup packet buffer */ -volatile uint8_t g_usbd_RemoteWakeupEn = 0ul; /*!< Remote wake up function enable flag */ - -/** - * @cond HIDDEN_SYMBOLS - */ -static uint8_t *g_usbd_CtrlInPointer = 0; -static uint8_t *g_usbd_CtrlOutPointer = 0; -static volatile uint32_t g_usbd_CtrlInSize = 0ul; -static volatile uint32_t g_usbd_CtrlOutSize = 0ul; -static volatile uint32_t g_usbd_CtrlOutSizeLimit = 0ul; -static volatile uint32_t g_usbd_UsbAddr = 0ul; -static volatile uint32_t g_usbd_UsbConfig = 0ul; -static volatile uint32_t g_usbd_CtrlMaxPktSize = 8ul; -static volatile uint32_t g_usbd_UsbAltInterface = 0ul; -static volatile uint32_t g_usbd_CtrlOutToggle = 0; -static volatile uint8_t g_usbd_CtrlInZeroFlag = 0ul; -/** - * @endcond - */ - -const S_USBD_INFO_T *g_usbd_sInfo; /*!< A pointer for USB information structure */ - -VENDOR_REQ g_usbd_pfnVendorRequest = NULL; /*!< USB Vendor Request Functional Pointer */ -CLASS_REQ g_usbd_pfnClassRequest = NULL; /*!< USB Class Request Functional Pointer */ -SET_INTERFACE_REQ g_usbd_pfnSetInterface = NULL; /*!< USB Set Interface Functional Pointer */ -SET_CONFIG_CB g_usbd_pfnSetConfigCallback = NULL; /*!< USB Set configuration callback function pointer */ -uint32_t g_u32EpStallLock = 0ul; /*!< Bit map flag to lock specified EP when SET_FEATURE */ - -/** - * @brief This function makes USBD module to be ready to use - * - * @param[in] param The structure of USBD information. - * @param[in] pfnClassReq USB Class request callback function. - * @param[in] pfnSetInterface USB Set Interface request callback function. - * - * @return None - * - * @details This function will enable USB controller, USB PHY transceiver and pull-up resistor of USB_D+ pin. USB PHY will drive SE0 to bus. - */ -void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface) -{ - g_usbd_sInfo = param; - g_usbd_pfnClassRequest = pfnClassReq; - g_usbd_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - g_usbd_CtrlMaxPktSize = g_usbd_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ - USBD->ATTR = 0x6D0ul; - /* Force SE0 */ - USBD_SET_SE0(); -} - -/** - * @brief This function makes USB host to recognize the device - * - * @param None - * - * @return None - * - * @details Enable WAKEUP, FLDET, USB and BUS interrupts. Disable software-disconnect function after 100ms delay with SysTick timer. - */ -void USBD_Start(void) -{ - /* Disable software-disconnect function */ - USBD_CLR_SE0(); - USBD->ATTR = 0x7D0ul; - - /* Clear USB-related interrupts before enable interrupt */ - USBD_CLR_INT_FLAG(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); - - /* Enable USB-related interrupts. */ - USBD_ENABLE_INT(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP); -} - -/** - * @brief Get the received SETUP packet - * - * @param[in] buf A buffer pointer used to store 8-byte SETUP packet. - * - * @return None - * - * @details Store SETUP packet to a user-specified buffer. - * - */ -void USBD_GetSetupPacket(uint8_t *buf) -{ - USBD_MemCopy(buf, g_usbd_SetupPacket, 8ul); -} - -/** - * @brief Process SETUP packet - * - * @param None - * - * @return None - * - * @details Parse SETUP packet and perform the corresponding action. - * - */ -void USBD_ProcessSetupPacket(void) -{ - g_usbd_CtrlOutToggle = 0; - /* Get SETUP packet from USB buffer */ - USBD_MemCopy(g_usbd_SetupPacket, (uint8_t *)USBD_BUF_BASE, 8ul); - - /* Check the request type */ - switch(g_usbd_SetupPacket[0] & 0x60ul) - { - case REQ_STANDARD: - { - USBD_StandardRequest(); - break; - } - case REQ_CLASS: - { - if(g_usbd_pfnClassRequest != NULL) - { - g_usbd_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: - { - if(g_usbd_pfnVendorRequest != NULL) - { - g_usbd_pfnVendorRequest(); - } - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } -} - -/** - * @brief Process GetDescriptor request - * - * @param None - * - * @return None - * - * @details Parse GetDescriptor request and perform the corresponding action. - * - */ -void USBD_GetDescriptor(void) -{ - uint32_t u32Len; - - g_usbd_CtrlInZeroFlag = (uint8_t)0ul; - u32Len = 0ul; - u32Len = g_usbd_SetupPacket[7]; - u32Len <<= 8ul; - u32Len += g_usbd_SetupPacket[6]; - - switch(g_usbd_SetupPacket[3]) - { - /* Get Device Descriptor */ - case DESC_DEVICE: - { - u32Len = USBD_Minimum(u32Len, (uint32_t)LEN_DEVICE); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8DevDesc, u32Len); - - break; - } - /* Get Configuration Descriptor */ - case DESC_CONFIG: - { - uint32_t u32TotalLen; - - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlInZeroFlag = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8ConfigDesc, u32Len); - - break; - } - - /* Get BOS Descriptor */ - case DESC_BOS: - { - if (g_usbd_sInfo->gu8BosDesc == 0) - { - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - } - else - { - u32Len = USBD_Minimum(u32Len, LEN_BOS+LEN_BOSCAP); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8BosDesc, u32Len); - } - break; - } - /* Get HID Descriptor */ - case DESC_HID: - { - /* CV3.0 HID Class Descriptor Test, - Need to indicate index of the HID Descriptor within gu8ConfigDescriptor, specifically HID Composite device. */ - uint32_t u32ConfigDescOffset; /* u32ConfigDescOffset is configuration descriptor offset (HID descriptor start index) */ - u32Len = USBD_Minimum(u32Len, LEN_HID); - u32ConfigDescOffset = g_usbd_sInfo->gu32ConfigHidDescIdx[g_usbd_SetupPacket[4]]; - USBD_PrepareCtrlIn((uint8_t *)&g_usbd_sInfo->gu8ConfigDesc[u32ConfigDescOffset], u32Len); - - break; - } - /* Get Report Descriptor */ - case DESC_HID_RPT: - { - if (u32Len > g_usbd_sInfo->gu32HidReportSize[g_usbd_SetupPacket[4]]) - { - u32Len = g_usbd_sInfo->gu32HidReportSize[g_usbd_SetupPacket[4]]; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlInZeroFlag = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8HidReportDesc[g_usbd_SetupPacket[4]], u32Len); - break; - } - /* Get String Descriptor */ - case DESC_STRING: - { - /* Get String Descriptor */ - if(g_usbd_SetupPacket[2] < 4ul) - { - if (u32Len > g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]][0]) - { - u32Len = g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]][0]; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlInZeroFlag = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8StringDesc[g_usbd_SetupPacket[2]], u32Len); - break; - } - else - { - /* Not support. Reply STALL. */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - default: - /* Not support. Reply STALL.*/ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } -} - -/** - * @brief Process standard request - * - * @param None - * - * @return None - * - * @details Parse standard request and perform the corresponding action. - * - */ -void USBD_StandardRequest(void) -{ - uint32_t addr; - /* clear global variables for new request */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - - if((g_usbd_SetupPacket[0] & 0x80ul) == 0x80ul) /* request data transfer direction */ - { - /* Device to host */ - switch(g_usbd_SetupPacket[1]) - { - case GET_CONFIGURATION: - { - /* Return current configuration setting */ - /* Data stage */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)g_usbd_UsbConfig; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - case GET_DESCRIPTOR: - { - USBD_GetDescriptor(); - USBD_PrepareCtrlOut(0, 0ul); /* For status stage */ - break; - } - case GET_INTERFACE: - { - /* Return current interface setting */ - /* Data stage */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)g_usbd_UsbAltInterface; - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 1ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - case GET_STATUS: - { - /* Device */ - if(g_usbd_SetupPacket[0] == 0x80ul) - { - uint8_t u8Tmp; - - u8Tmp = (uint8_t)0ul; - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x40ul) == 0x40ul) - { - u8Tmp |= (uint8_t)1ul; /* Self-Powered/Bus-Powered.*/ - } - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x20ul) == 0x20ul) - { - u8Tmp |= (uint8_t)(g_usbd_RemoteWakeupEn << 1ul); /* Remote wake up */ - } - - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = u8Tmp; - - } - /* Interface */ - else if(g_usbd_SetupPacket[0] == 0x81ul) - { - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)0ul; - } - /* Endpoint */ - else if(g_usbd_SetupPacket[0] == 0x82ul) - { - uint8_t ep = (uint8_t)(g_usbd_SetupPacket[4] & 0xFul); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - M8(addr) = (uint8_t)(USBD_GetStall(ep) ? 1ul : 0ul); - } - - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0) + 1ul; - M8(addr) = (uint8_t)0ul; - /* Data stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 2ul); - /* Status stage */ - USBD_PrepareCtrlOut(0, 0ul); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } - else - { - /* Host to device */ - switch(g_usbd_SetupPacket[1]) - { - case CLEAR_FEATURE: - { - if(g_usbd_SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - uint32_t epNum, i; - - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_u32EpStallLock is added to support it */ - epNum = (uint8_t)(g_usbd_SetupPacket[4] & 0xFul); - for(i = 0ul; i < USBD_MAX_EP; i++) - { - if(((USBD->EP[i].CFG & 0xFul) == epNum) && ((g_u32EpStallLock & (1ul << i)) == 0ul)) - { - USBD->EP[i].CFGP &= ~USBD_CFGP_SSTALL_Msk; - USBD->EP[i].CFG &= ~USBD_CFG_DSQSYNC_Msk; - } - } - } - else if(g_usbd_SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_usbd_RemoteWakeupEn = (uint8_t)0; - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_ADDRESS: - { - g_usbd_UsbAddr = g_usbd_SetupPacket[2]; - /* Status Stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - - break; - } - case SET_CONFIGURATION: - { - g_usbd_UsbConfig = g_usbd_SetupPacket[2]; - - if(g_usbd_pfnSetConfigCallback) - { - g_usbd_pfnSetConfigCallback(); - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - case SET_FEATURE: - { - if( (g_usbd_SetupPacket[0] & 0xFul) == 0ul ) /* 0: device */ - { - if((g_usbd_SetupPacket[2] == 3ul) && (g_usbd_SetupPacket[3] == 0ul)) /* 3: HNP enable */ - { - OTG->CTL |= (OTG_CTL_HNPREQEN_Msk | OTG_CTL_BUSREQ_Msk); - } - } - if(g_usbd_SetupPacket[2] == FEATURE_ENDPOINT_HALT) - { - USBD_SetStall((uint8_t)(g_usbd_SetupPacket[4] & 0xFul)); - } - else if(g_usbd_SetupPacket[2] == FEATURE_DEVICE_REMOTE_WAKEUP) - { - g_usbd_RemoteWakeupEn = (uint8_t)1ul; - } - - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - - break; - } - case SET_INTERFACE: - { - g_usbd_UsbAltInterface = g_usbd_SetupPacket[2]; - if(g_usbd_pfnSetInterface != NULL) - { - g_usbd_pfnSetInterface(g_usbd_UsbAltInterface); - } - /* Status stage */ - USBD_SET_DATA1(EP0); - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_EP_STALL(EP0); - USBD_SET_EP_STALL(EP1); - break; - } - } - } -} - -/** - * @brief Prepare the first Control IN pipe - * - * @param[in] pu8Buf The pointer of data sent to USB host. - * @param[in] u32Size The IN transfer size. - * - * @return None - * - * @details Prepare data for Control IN transfer. - * - */ -void USBD_PrepareCtrlIn(uint8_t pu8Buf[], uint32_t u32Size) -{ - uint32_t addr; - if(u32Size > g_usbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - g_usbd_CtrlInPointer = pu8Buf + g_usbd_CtrlMaxPktSize; - g_usbd_CtrlInSize = u32Size - g_usbd_CtrlMaxPktSize; - USBD_SET_DATA1(EP0); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, pu8Buf, g_usbd_CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlMaxPktSize); - } - else - { - /* Data size <= MXPLD */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - USBD_SET_DATA1(EP0); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, pu8Buf, u32Size); - USBD_SET_PAYLOAD_LEN(EP0, u32Size); - } -} - -/** - * @brief Repeat Control IN pipe - * - * @param None - * - * @return None - * - * @details This function processes the remained data of Control IN transfer. - * - */ -void USBD_CtrlIn(void) -{ - uint32_t addr; - - if(g_usbd_CtrlInSize) - { - /* Process remained data */ - if(g_usbd_CtrlInSize > g_usbd_CtrlMaxPktSize) - { - /* Data size > MXPLD */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, (uint8_t *)g_usbd_CtrlInPointer, g_usbd_CtrlMaxPktSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlMaxPktSize); - g_usbd_CtrlInPointer += g_usbd_CtrlMaxPktSize; - g_usbd_CtrlInSize -= g_usbd_CtrlMaxPktSize; - } - else - { - /* Data size <= MXPLD */ - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP0); - USBD_MemCopy((uint8_t *)addr, (uint8_t *)g_usbd_CtrlInPointer, g_usbd_CtrlInSize); - USBD_SET_PAYLOAD_LEN(EP0, g_usbd_CtrlInSize); - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - } - } - else - { - /* In ACK for Set address */ - if((g_usbd_SetupPacket[0] == REQ_STANDARD) && (g_usbd_SetupPacket[1] == SET_ADDRESS)) - { - addr = USBD_GET_ADDR(); - if((addr != g_usbd_UsbAddr) && (addr == 0ul)) - { - USBD_SET_ADDR(g_usbd_UsbAddr); - } - } - - /* For the case of data size is integral times maximum packet size */ - if(g_usbd_CtrlInZeroFlag) - { - USBD_SET_PAYLOAD_LEN(EP0, 0ul); - g_usbd_CtrlInZeroFlag = (uint8_t)0ul; - } - } -} - -/** - * @brief Prepare the first Control OUT pipe - * - * @param[in] pu8Buf The pointer of data received from USB host. - * @param[in] u32Size The OUT transfer size. - * - * @return None - * - * @details This function is used to prepare the first Control OUT transfer. - * - */ -void USBD_PrepareCtrlOut(uint8_t *pu8Buf, uint32_t u32Size) -{ - g_usbd_CtrlOutPointer = pu8Buf; - g_usbd_CtrlOutSize = 0ul; - g_usbd_CtrlOutSizeLimit = u32Size; - USBD_SET_PAYLOAD_LEN(EP1, g_usbd_CtrlMaxPktSize); -} - -/** - * @brief Repeat Control OUT pipe - * - * @param None - * - * @return None - * - * @details This function processes the successive Control OUT transfer. - * - */ -void USBD_CtrlOut(void) -{ - uint32_t u32Size; - uint32_t addr; - - if (g_usbd_CtrlOutToggle != (USBD->EPSTS0 & USBD_EPSTS0_EPSTS1_Msk)) - { - g_usbd_CtrlOutToggle = USBD->EPSTS0 & USBD_EPSTS0_EPSTS1_Msk; - if (g_usbd_CtrlOutSize < g_usbd_CtrlOutSizeLimit) - { - u32Size = USBD_GET_PAYLOAD_LEN(EP1); - addr = USBD_BUF_BASE + USBD_GET_EP_BUF_ADDR(EP1); - USBD_MemCopy((uint8_t *)g_usbd_CtrlOutPointer, (uint8_t *)addr, u32Size); - g_usbd_CtrlOutPointer += u32Size; - g_usbd_CtrlOutSize += u32Size; - - if(g_usbd_CtrlOutSize < g_usbd_CtrlOutSizeLimit) - { - USBD_SET_PAYLOAD_LEN(EP1, g_usbd_CtrlMaxPktSize); - } - } - } - else - { - USBD_SET_PAYLOAD_LEN(EP1, g_usbd_CtrlMaxPktSize); - } -} - -/** - * @brief Reset software flags - * - * @param None - * - * @return None - * - * @details This function resets all variables for protocol and resets USB device address to 0. - * - */ -void USBD_SwReset(void) -{ - uint32_t i; - - /* Reset all variables for protocol */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0ul; - g_usbd_CtrlOutPointer = 0; - g_usbd_CtrlOutSize = 0ul; - g_usbd_CtrlOutSizeLimit = 0ul; - g_u32EpStallLock = 0ul; - memset(g_usbd_SetupPacket, 0, 8ul); - - /* Reset PID DATA0 */ - for(i=0ul; iEP[i].CFG &= ~USBD_CFG_DSQSYNC_Msk; - } - - /* Reset USB device address */ - USBD_SET_ADDR(0ul); -} - -/** - * @brief USBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set USBD vendor request callback function - */ -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq) -{ - g_usbd_pfnVendorRequest = pfnVendorReq; -} - -/** - * @brief The callback function which called when get SET CONFIGURATION request - * - * @param[in] pfnSetConfigCallback Callback function pointer for SET CONFIGURATION request - * - * @return None - * - * @details This function is used to set the callback function which will be called at SET CONFIGURATION request. - */ -void USBD_SetConfigCallback(SET_CONFIG_CB pfnSetConfigCallback) -{ - g_usbd_pfnSetConfigCallback = pfnSetConfigCallback; -} - - -/** - * @brief EP stall lock function to avoid stall clear by USB SET FEATURE request. - * - * @param[in] u32EpBitmap Use bitmap to select which endpoints will be locked - * - * @return None - * - * @details This function is used to lock relative endpoint to avoid stall clear by SET FEATURE request. - * If ep stall locked, user needs to reset USB device or re-configure device to clear it. - */ -void USBD_LockEpStall(uint32_t u32EpBitmap) -{ - g_u32EpStallLock = u32EpBitmap; -} - - -/*@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_i2c.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_i2c.c deleted file mode 100644 index ee62fca567b..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_i2c.c +++ /dev/null @@ -1,1679 +0,0 @@ -/****************************************************************************//** - * @file usci_i2c.c - * @version V3.00 - * @brief M480 series USCI I2C(UI2C) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_I2C_Driver USCI_I2C Driver - @{ -*/ - - -/** @addtogroup USCI_I2C_EXPORTED_FUNCTIONS USCI_I2C Exported Functions - @{ -*/ - -/** - * @brief This function makes USCI_I2C module be ready and set the wanted bus clock - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Enable USCI_I2C module and configure USCI_I2C module(bus clock, data format). - */ -uint32_t UI2C_Open(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if( ui2c == UI2C0 ) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32ClkDiv = (uint32_t) ((((((u32Pclk/2U)*10U)/(u32BusClock))+5U)/10U)-1U); /* Compute proper divider for USCI_I2C clock */ - - /* Enable USCI_I2C protocol */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; - ui2c->CTL = 4U << UI2C_CTL_FUNMODE_Pos; - - /* Data format configuration */ - /* 8 bit data length */ - ui2c->LINECTL &= ~UI2C_LINECTL_DWIDTH_Msk; - ui2c->LINECTL |= 8U << UI2C_LINECTL_DWIDTH_Pos; - - /* MSB data format */ - ui2c->LINECTL &= ~UI2C_LINECTL_LSB_Msk; - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - ui2c->PROTCTL |= UI2C_PROTCTL_PROTEN_Msk; - - return ( u32Pclk / ((u32ClkDiv+1U)<<1U) ); -} - -/** - * @brief This function closes the USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Close USCI_I2C protocol function. - */ -void UI2C_Close(UI2C_T *ui2c) -{ - /* Disable USCI_I2C function */ - ui2c->CTL &= ~UI2C_CTL_FUNMODE_Msk; -} - -/** - * @brief This function clears the time-out flag - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details Clear time-out flag when time-out flag is set. - */ -void UI2C_ClearTimeoutFlag(UI2C_T *ui2c) -{ - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; -} - -/** - * @brief This function sets the control bit of the USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Start Set START bit to USCI_I2C module. - * @param[in] u8Stop Set STOP bit to USCI_I2C module. - * @param[in] u8Ptrg Set PTRG bit to USCI_I2C module. - * @param[in] u8Ack Set ACK bit to USCI_I2C module. - * - * @return None - * - * @details The function set USCI_I2C control bit of USCI_I2C bus protocol. - */ -void UI2C_Trigger(UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - uint32_t u32Val = ui2c->PROTCTL & ~(UI2C_PROTCTL_STA_Msk | UI2C_PROTCTL_STO_Msk | UI2C_PROTCTL_AA_Msk); - - if (u8Start) - { - u32Reg |= UI2C_PROTCTL_STA_Msk; - } - if (u8Stop) - { - u32Reg |= UI2C_PROTCTL_STO_Msk; - } - if (u8Ptrg) - { - u32Reg |= UI2C_PROTCTL_PTRG_Msk; - } - if (u8Ack) - { - u32Reg |= UI2C_PROTCTL_AA_Msk; - } - - ui2c->PROTCTL = u32Val | u32Reg; -} - -/** - * @brief This function disables the interrupt of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to an interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details The function is used to disable USCI_I2C bus interrupt events. - */ -void UI2C_DisableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Disable time-out interrupt flag */ - if((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_TOIEN_Msk; - } - - /* Disable start condition received interrupt flag */ - if((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STARIEN_Msk; - } - - /* Disable stop condition received interrupt flag */ - if((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_STORIEN_Msk; - } - - /* Disable non-acknowledge interrupt flag */ - if((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_NACKIEN_Msk; - } - - /* Disable arbitration lost interrupt flag */ - if((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ARBLOIEN_Msk; - } - - /* Disable error interrupt flag */ - if((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ERRIEN_Msk; - } - - /* Disable acknowledge interrupt flag */ - if((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN &= ~UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function enables the interrupt of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * @return None - * - * @details The function is used to enable USCI_I2C bus interrupt events. - */ -void UI2C_EnableInt(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Enable time-out interrupt flag */ - if((u32Mask & UI2C_TO_INT_MASK) == UI2C_TO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_TOIEN_Msk; - } - - /* Enable start condition received interrupt flag */ - if((u32Mask & UI2C_STAR_INT_MASK) == UI2C_STAR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STARIEN_Msk; - } - - /* Enable stop condition received interrupt flag */ - if((u32Mask & UI2C_STOR_INT_MASK) == UI2C_STOR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_STORIEN_Msk; - } - - /* Enable non-acknowledge interrupt flag */ - if((u32Mask & UI2C_NACK_INT_MASK) == UI2C_NACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_NACKIEN_Msk; - } - - /* Enable arbitration lost interrupt flag */ - if((u32Mask & UI2C_ARBLO_INT_MASK) == UI2C_ARBLO_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ARBLOIEN_Msk; - } - - /* Enable error interrupt flag */ - if((u32Mask & UI2C_ERR_INT_MASK) == UI2C_ERR_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ERRIEN_Msk; - } - - /* Enable acknowledge interrupt flag */ - if((u32Mask & UI2C_ACK_INT_MASK) == UI2C_ACK_INT_MASK) - { - ui2c->PROTIEN |= UI2C_PROTIEN_ACKIEN_Msk; - } -} - -/** - * @brief This function returns the real bus clock of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details The function returns the actual USCI_I2C module bus clock. - */ -uint32_t UI2C_GetBusClockFreq(UI2C_T *ui2c) -{ - uint32_t u32Divider; - uint32_t u32Pclk; - - if (ui2c == UI2C0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32Divider = (ui2c->BRGEN & UI2C_BRGEN_CLKDIV_Msk) >> UI2C_BRGEN_CLKDIV_Pos; - - return ( u32Pclk / ((u32Divider+1U)<<1U) ); -} - -/** - * @brief This function sets bus clock frequency of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32BusClock The target bus speed of USCI_I2C module. - * - * @return Actual USCI_I2C bus clock frequency. - * - * @details Use this function set USCI_I2C bus clock frequency and return actual bus clock. - */ -uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if( ui2c == UI2C0 ) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32ClkDiv = (uint32_t) ((((((u32Pclk/2U)*10U)/(u32BusClock))+5U)/10U)-1U); /* Compute proper divider for USCI_I2C clock */ - - /* Set USCI_I2C bus clock */ - ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; - ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); - - return ( u32Pclk / ((u32ClkDiv+1U)<<1U) ); -} - -/** - * @brief This function gets the interrupt flag of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details Use this function to get USCI_I2C interrupt flag when module occurs interrupt event. - */ -uint32_t UI2C_GetIntFlag(UI2C_T *ui2c, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U; - uint32_t u32TmpValue; - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_TOIF_Msk; - /* Check Time-out Interrupt Flag */ - if((u32Mask & UI2C_TO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_TO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STARIF_Msk; - /* Check Start Condition Received Interrupt Flag */ - if((u32Mask & UI2C_STAR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STAR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_STORIF_Msk; - /* Check Stop Condition Received Interrupt Flag */ - if((u32Mask & UI2C_STOR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_STOR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_NACKIF_Msk; - /* Check Non-Acknowledge Interrupt Flag */ - if((u32Mask & UI2C_NACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_NACK_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ARBLOIF_Msk; - /* Check Arbitration Lost Interrupt Flag */ - if((u32Mask & UI2C_ARBLO_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ARBLO_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ERRIF_Msk; - /* Check Error Interrupt Flag */ - if((u32Mask & UI2C_ERR_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ERR_INT_MASK; - } - - u32TmpValue = ui2c->PROTSTS & UI2C_PROTSTS_ACKIF_Msk; - /* Check Acknowledge Interrupt Flag */ - if((u32Mask & UI2C_ACK_INT_MASK) && (u32TmpValue)) - { - u32IntFlag |= UI2C_ACK_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief This function clears the interrupt flag of USCI_I2C module. - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It is combination of: - * - \ref UI2C_TO_INT_MASK - * - \ref UI2C_STAR_INT_MASK - * - \ref UI2C_STOR_INT_MASK - * - \ref UI2C_NACK_INT_MASK - * - \ref UI2C_ARBLO_INT_MASK - * - \ref UI2C_ERR_INT_MASK - * - \ref UI2C_ACK_INT_MASK - * - * @return None - * - * @details Use this function to clear USCI_I2C interrupt flag when module occurs interrupt event and set flag. - */ -void UI2C_ClearIntFlag(UI2C_T *ui2c, uint32_t u32Mask) -{ - /* Clear Time-out Interrupt Flag */ - if(u32Mask & UI2C_TO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_TOIF_Msk; - } - - /* Clear Start Condition Received Interrupt Flag */ - if(u32Mask & UI2C_STAR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STARIF_Msk; - } - - /* Clear Stop Condition Received Interrupt Flag */ - if(u32Mask & UI2C_STOR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_STORIF_Msk; - } - - /* Clear Non-Acknowledge Interrupt Flag */ - if(u32Mask & UI2C_NACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_NACKIF_Msk; - } - - /* Clear Arbitration Lost Interrupt Flag */ - if(u32Mask & UI2C_ARBLO_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ARBLOIF_Msk; - } - - /* Clear Error Interrupt Flag */ - if(u32Mask & UI2C_ERR_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ERRIF_Msk; - } - - /* Clear Acknowledge Interrupt Flag */ - if(u32Mask & UI2C_ACK_INT_MASK) - { - ui2c->PROTSTS = UI2C_PROTSTS_ACKIF_Msk; - } -} - -/** - * @brief This function returns the data stored in data register of USCI_I2C module. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return USCI_I2C data. - * - * @details To read a byte data from USCI_I2C module receive data register. - */ -uint32_t UI2C_GetData(UI2C_T *ui2c) -{ - return ( ui2c->RXDAT ); -} - -/** - * @brief This function writes a byte data to data register of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8Data The data which will be written to data register of USCI_I2C module. - * - * @return None - * - * @details To write a byte data to transmit data register to transmit data. - */ -void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data) -{ - ui2c->TXDAT = u8Data; -} - -/** - * @brief Configure slave address and enable GC mode - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channel number [0/1] - * @param[in] u16SlaveAddr The slave address. - * @param[in] u8GCMode GC mode enable or not. Valid values are: - * - \ref UI2C_GCMODE_ENABLE - * - \ref UI2C_GCMODE_DISABLE - * - * @return None - * - * @details To configure USCI_I2C module slave address and GC mode. - */ -void UI2C_SetSlaveAddr(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) -{ - if(u8SlaveNo) - { - ui2c->DEVADDR1 = u16SlaveAddr; - } - else - { - ui2c->DEVADDR0 = u16SlaveAddr; - } - - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_GCFUNC_Msk) |u8GCMode; -} - -/** - * @brief Configure the mask bit of slave address. - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveNo Slave channel number [0/1] - * @param[in] u16SlaveAddrMask The slave address mask. - * - * @return None - * - * @details To configure USCI_I2C module slave address mask bit. - * @note The corresponding address bit is "Don't Care". - */ -void UI2C_SetSlaveAddrMask(UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) -{ - if(u8SlaveNo) - { - ui2c->ADDRMSK1 = u16SlaveAddrMask; - } - else - { - ui2c->ADDRMSK0 = u16SlaveAddrMask; - } -} - -/** - * @brief This function enables time-out function and configures timeout counter - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u32TimeoutCnt Timeout counter. Valid values are between 0~0x3FF - * - * @return None - * - * @details To enable USCI_I2C bus time-out function and set time-out counter. - */ -void UI2C_EnableTimeout(UI2C_T *ui2c, uint32_t u32TimeoutCnt) -{ - ui2c->PROTCTL = (ui2c->PROTCTL & ~UI2C_PROTCTL_TOCNT_Msk) | (u32TimeoutCnt << UI2C_PROTCTL_TOCNT_Pos); - ui2c->BRGEN = (ui2c->BRGEN & ~UI2C_BRGEN_TMCNTSRC_Msk) | UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function disables time-out function - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C bus time-out function. - */ -void UI2C_DisableTimeout(UI2C_T *ui2c) -{ - ui2c->PROTCTL &= ~UI2C_PROTCTL_TOCNT_Msk; - ui2c->BRGEN &= ~UI2C_BRGEN_TMCNTEN_Msk; -} - -/** - * @brief This function enables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8WakeupMode The wake-up mode selection. Valid values are: - * - \ref UI2C_DATA_TOGGLE_WK - * - \ref UI2C_ADDR_MATCH_WK - * - * @return None - * - * @details To enable USCI_I2C module wake-up function. - */ -void UI2C_EnableWakeup(UI2C_T *ui2c, uint8_t u8WakeupMode) -{ - ui2c->WKCTL = (ui2c->WKCTL & ~UI2C_WKCTL_WKADDREN_Msk) | (u8WakeupMode | UI2C_WKCTL_WKEN_Msk); -} - -/** - * @brief This function disables the wakeup function of USCI_I2C module - * - * @param[in] ui2c The pointer of the specified USCI_I2C module. - * - * @return None - * - * @details To disable USCI_I2C module wake-up function. - */ -void UI2C_DisableWakeup(UI2C_T *ui2c) -{ - ui2c->WKCTL &= ~UI2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master write a byte data to Slave. - * - */ - -uint8_t UI2C_WriteByte(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master write multi bytes data to Slave. - * - */ - -uint32_t UI2C_WriteMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t UI2C_WriteByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t UI2C_WriteMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else - { - if (u32txLen < u32wLen) - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for USCI_I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t UI2C_WriteByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (u32txLen == 0U) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 1U) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u32txLen++; - } - else if (u32txLen == 2U) - { - UI2C_SET_DATA(ui2c, data); /* Write data to UI2C_TXDAT */ - u32txLen++; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return (u8Err | u8Xfering); -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data write to in Slave. - * - */ - -uint32_t UI2C_WriteMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *data, uint32_t u32wLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32txLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte data address to UI2C_TXDAT */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte data address to UI2C_TXDAT */ - u8Addr = 0; - } - else - { - if (u32txLen < u32wLen) - { - UI2C_SET_DATA(ui2c, data[u32txLen++]); /* Write data to UI2C_TXDAT */ - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - } - } - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master to read a byte data from Slave. - * - */ -uint8_t UI2C_ReadByte(UI2C_T *ui2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - eEvent = MASTER_READ_DATA; - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Err = 1U; - } - else - { - rdata = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; - - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytes(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < (u32rLen - 1U)) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (unsigned char) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t UI2C_ReadByteOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytesOneReg(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, u8DataAddr); /* Write data address of register */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - else if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - /* SLA+R ACK */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address(2 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for USCI_I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t UI2C_ReadByteTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1U, u8Err = 0U, rdata = 0U, u8Addr = 1U, u8Ctrl = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else - { - /* SLA+R ACK */ - u8Ctrl = UI2C_CTL_PTRG; - eEvent = MASTER_READ_DATA; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - { - rdata = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - } - else - { - u8Err = 1U; - } - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - u8Err = 1U; - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - if (u8Err) - rdata = 0U; /* If occurs error, return 0 */ - - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *ui2c The pointer of the specified USCI_I2C module. - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] *rdata Point to array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for USCI_I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t UI2C_ReadMultiBytesTwoRegs(UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen) -{ - uint8_t u8Xfering = 1U, u8Addr = 1U, u8Ctrl = 0U; - uint32_t u32rxLen = 0U; - enum UI2C_MASTER_EVENT eEvent = MASTER_SEND_START; - - UI2C_START(ui2c); /* Send START */ - - while (u8Xfering) - { - while (!(UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U)); /* Wait UI2C new status occur */ - - switch (UI2C_GET_PROT_STATUS(ui2c) & 0x3F00U) - { - case UI2C_PROTSTS_STARIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STARIF_Msk); /* Clear START INT Flag */ - - if (eEvent == MASTER_SEND_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x00U); /* Write SLA+W to Register UI2C_TXDAT */ - eEvent = MASTER_SEND_ADDRESS; - } - else if (eEvent == MASTER_SEND_REPEAT_START) - { - UI2C_SET_DATA(ui2c, (u8SlaveAddr << 1U) | 0x01U); /* Write SLA+R to Register TXDAT */ - eEvent = MASTER_SEND_H_RD_ADDRESS; - } - - u8Ctrl = UI2C_CTL_PTRG; - break; - - case UI2C_PROTSTS_ACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_ACKIF_Msk); /* Clear ACK INT Flag */ - - if (eEvent == MASTER_SEND_ADDRESS) - { - UI2C_SET_DATA(ui2c, (uint8_t)((u16DataAddr & 0xFF00U) >> 8U)); /* Write Hi byte address of register */ - eEvent = MASTER_SEND_DATA; - } - else if (eEvent == MASTER_SEND_DATA) - { - if (u8Addr) - { - UI2C_SET_DATA(ui2c, (uint8_t)(u16DataAddr & 0xFFU)); /* Write Lo byte address of register */ - u8Addr = 0; - } - else - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STA); /* Send repeat START signal */ - eEvent = MASTER_SEND_REPEAT_START; - } - } - else if (eEvent == MASTER_SEND_H_RD_ADDRESS) - { - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - eEvent = MASTER_READ_DATA; - } - else - { - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - if (u32rxLen < u32rLen - 1U) - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_AA); - else - u8Ctrl = UI2C_CTL_PTRG; - } - - break; - - case UI2C_PROTSTS_NACKIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_NACKIF_Msk); /* Clear NACK INT Flag */ - - if (eEvent == MASTER_READ_DATA) - rdata[u32rxLen++] = (uint8_t) UI2C_GET_DATA(ui2c); /* Receive Data */ - - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - - break; - - case UI2C_PROTSTS_STORIF_Msk: - UI2C_CLR_PROT_INT_FLAG(ui2c, UI2C_PROTSTS_STORIF_Msk); /* Clear STOP INT Flag */ - u8Ctrl = UI2C_CTL_PTRG; /* Clear SI */ - u8Xfering = 0U; - break; - - case UI2C_PROTSTS_ARBLOIF_Msk: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = (UI2C_CTL_PTRG | UI2C_CTL_STO); /* Clear SI and send STOP */ - break; - } - - UI2C_SET_CONTROL_REG(ui2c, u8Ctrl); /* Write controlbit to UI2C_PROTCTL register */ - } - - return u32rxLen; /* Return bytes length that have been received */ -} - -/*@}*/ /* end of group USCI_I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_spi.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_spi.c deleted file mode 100644 index 69744f4644a..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_spi.c +++ /dev/null @@ -1,664 +0,0 @@ -/****************************************************************************//** - * @file usci_spi.c - * @version V3.00 - * @brief M480 series USCI_SPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_SPI_Driver USCI_SPI Driver - @{ -*/ - - -/** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions - @{ -*/ - -/** - * @brief This function make USCI_SPI module be ready to transfer. - * By default, the USCI_SPI transfer sequence is MSB first, the slave selection - * signal is active low and the automatic slave select function is disabled. In - * Slave mode, the u32BusClock must be NULL and the USCI_SPI clock - * divider setting will be 0. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32MasterSlave Decide the USCI_SPI module is operating in master mode or in slave mode. Valid values are: - * - \ref USPI_SLAVE - * - \ref USPI_MASTER - * @param[in] u32SPIMode Decide the transfer timing. Valid values are: - * - \ref USPI_MODE_0 - * - \ref USPI_MODE_1 - * - \ref USPI_MODE_2 - * - \ref USPI_MODE_3 - * @param[in] u32DataWidth The data width of a USCI_SPI transaction. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock in Hz. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv = 0ul; - uint32_t u32Pclk; - uint32_t u32UspiClk = 0ul; - - if(uspi == (USPI_T *)USPI0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - if(u32BusClock != 0ul) - { - u32ClkDiv = (uint32_t) ((((((u32Pclk/2ul)*10ul)/(u32BusClock))+5ul)/10ul)-1ul); /* Compute proper divider for USCI_SPI clock */ - } - else {} - - /* Enable USCI_SPI protocol */ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; - uspi->CTL = 1ul << USPI_CTL_FUNMODE_Pos; - - /* Data format configuration */ - if(u32DataWidth == 16ul) - { - u32DataWidth = 0ul; - } - else {} - uspi->LINECTL &= ~USPI_LINECTL_DWIDTH_Msk; - uspi->LINECTL |= (u32DataWidth << USPI_LINECTL_DWIDTH_Pos); - - /* MSB data format */ - uspi->LINECTL &= ~USPI_LINECTL_LSB_Msk; - - /* Set slave selection signal active low */ - if(u32MasterSlave == USPI_MASTER) - { - uspi->LINECTL |= USPI_LINECTL_CTLOINV_Msk; - } - else - { - uspi->CTLIN0 |= USPI_CTLIN0_ININV_Msk; - } - - /* Set operating mode and transfer timing */ - uspi->PROTCTL &= ~(USPI_PROTCTL_SCLKMODE_Msk | USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SLAVE_Msk); - uspi->PROTCTL |= (u32MasterSlave | u32SPIMode); - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - uspi->PROTCTL |= USPI_PROTCTL_PROTEN_Msk; - - if(u32BusClock != 0ul) - { - u32UspiClk = (uint32_t)( u32Pclk / ((u32ClkDiv+1ul)<<1) ); - } - else {} - - return u32UspiClk; -} - -/** - * @brief Disable USCI_SPI function mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_Close(USPI_T *uspi) -{ - uspi->CTL &= ~USPI_CTL_FUNMODE_Msk; -} - -/** - * @brief Clear Rx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearRxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_RXCLR_Msk; -} - -/** - * @brief Clear Tx buffer. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_ClearTxBuf(USPI_T *uspi) -{ - uspi->BUFCTL |= USPI_BUFCTL_TXCLR_Msk; -} - -/** - * @brief Disable the automatic slave select function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableAutoSS(USPI_T *uspi) -{ - uspi->PROTCTL &= ~(USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave select function. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32SSPinMask This parameter is not used. - * @param[in] u32ActiveLevel The active level of slave select signal. Valid values are: - * - \ref USPI_SS_ACTIVE_HIGH - * - \ref USPI_SS_ACTIVE_LOW - * @return None - */ -void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - uspi->LINECTL = (uspi->LINECTL & ~USPI_LINECTL_CTLOINV_Msk) | u32ActiveLevel; - uspi->PROTCTL |= USPI_PROTCTL_AUTOSS_Msk; -} - -/** - * @brief Set the USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32BusClock The expected frequency of USCI_SPI bus clock. - * @return Actual frequency of USCI_SPI peripheral clock. - */ -uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock) -{ - uint32_t u32ClkDiv; - uint32_t u32Pclk; - - if(uspi == USPI0) - { - u32Pclk = CLK_GetPCLK0Freq(); - } - else - { - u32Pclk = CLK_GetPCLK1Freq(); - } - - u32ClkDiv = (uint32_t) ((((((u32Pclk/2ul)*10ul)/(u32BusClock))+5ul)/10ul)-1ul); /* Compute proper divider for USCI_SPI clock */ - - /* Set USCI_SPI bus clock */ - uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; - uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); - - return ( u32Pclk / ((u32ClkDiv+1ul)<<1) ); -} - -/** - * @brief Get the actual frequency of USCI_SPI bus clock. Only available in Master mode. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return Actual USCI_SPI bus clock frequency. - */ -uint32_t USPI_GetBusClock(USPI_T *uspi) -{ - uint32_t u32BusClk; - uint32_t u32ClkDiv; - - u32ClkDiv = (uspi->BRGEN & USPI_BRGEN_CLKDIV_Msk) >> USPI_BRGEN_CLKDIV_Pos; - - if(uspi == USPI0) - { - u32BusClk = (uint32_t)( CLK_GetPCLK0Freq() / ((u32ClkDiv+1ul)<<1) ); - } - else - { - u32BusClk = (uint32_t)( CLK_GetPCLK1Freq() / ((u32ClkDiv+1ul)<<1) ); - } - - return u32BusClk; -} - -/** - * @brief Enable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be enabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Enable slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSINAIEN_Msk; - } - else {} - /* Enable slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SSACTIEN_Msk; - } - else {} - /* Enable slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVTOIEN_Msk; - } - else {} - - /* Enable slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN |= USPI_PROTIEN_SLVBEIEN_Msk; - } - else {} - /* Enable TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_TXUDRIEN_Msk; - } - else {} - /* Enable RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL |= USPI_BUFCTL_RXOVIEN_Msk; - } - else {} - /* Enable TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXSTIEN_Msk; - } - else {} - /* Enable TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_TXENDIEN_Msk; - } - else {} - /* Enable RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXSTIEN_Msk; - } - else {} - /* Enable RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN |= USPI_INTEN_RXENDIEN_Msk; - } - else {} -} - -/** - * @brief Disable related interrupts specified by u32Mask parameter. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. Valid values are: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask) -{ - /* Disable slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK) == USPI_SSINACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSINAIEN_Msk; - } - else {} - /* Disable slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK) == USPI_SSACT_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SSACTIEN_Msk; - } - else {} - /* Disable slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK) == USPI_SLVTO_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVTOIEN_Msk; - } - else {} - /* Disable slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK) == USPI_SLVBE_INT_MASK) - { - uspi->PROTIEN &= ~USPI_PROTIEN_SLVBEIEN_Msk; - } - else {} - /* Disable TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK) == USPI_TXUDR_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_TXUDRIEN_Msk; - } - else {} - /* Disable RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK) == USPI_RXOV_INT_MASK) - { - uspi->BUFCTL &= ~USPI_BUFCTL_RXOVIEN_Msk; - } - else {} - /* Disable TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK) == USPI_TXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXSTIEN_Msk; - } - else {} - /* Disable TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK) == USPI_TXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_TXENDIEN_Msk; - } - else {} - /* Disable RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK) == USPI_RXST_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXSTIEN_Msk; - } - else {} - /* Disable RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK) == USPI_RXEND_INT_MASK) - { - uspi->INTEN &= ~USPI_INTEN_RXENDIEN_Msk; - } - else {} -} - -/** - * @brief Get interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return Interrupt flags of selected sources. - */ -uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32TmpFlag; - uint32_t u32IntFlag = 0ul; - - /* Check slave selection signal inactive interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SSINAIF_Msk; - if(((u32Mask & USPI_SSINACT_INT_MASK)==USPI_SSINACT_INT_MASK) && (u32TmpFlag==USPI_PROTSTS_SSINAIF_Msk) ) - { - u32IntFlag |= USPI_SSINACT_INT_MASK; - } - else {} - /* Check slave selection signal active interrupt flag */ - - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SSACTIF_Msk; - if(((u32Mask & USPI_SSACT_INT_MASK)==USPI_SSACT_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_SSACTIF_Msk)) - { - u32IntFlag |= USPI_SSACT_INT_MASK; - } - else {} - - /* Check slave time-out interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SLVTOIF_Msk; - if(((u32Mask & USPI_SLVTO_INT_MASK)==USPI_SLVTO_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_SLVTOIF_Msk)) - { - u32IntFlag |= USPI_SLVTO_INT_MASK; - } - else {} - - /* Check slave bit count error interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SLVBEIF_Msk; - if(((u32Mask & USPI_SLVBE_INT_MASK)==USPI_SLVBE_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_SLVBEIF_Msk)) - { - u32IntFlag |= USPI_SLVBE_INT_MASK; - } - else {} - - /* Check TX under run interrupt flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_TXUDRIF_Msk; - if(((u32Mask & USPI_TXUDR_INT_MASK)==USPI_TXUDR_INT_MASK) && (u32TmpFlag == USPI_BUFSTS_TXUDRIF_Msk)) - { - u32IntFlag |= USPI_TXUDR_INT_MASK; - } - else {} - - /* Check RX overrun interrupt flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_RXOVIF_Msk; - if(((u32Mask & USPI_RXOV_INT_MASK)==USPI_RXOV_INT_MASK) && (u32TmpFlag == USPI_BUFSTS_RXOVIF_Msk)) - { - u32IntFlag |= USPI_RXOV_INT_MASK; - } - else {} - - /* Check TX start interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_TXSTIF_Msk; - if(((u32Mask & USPI_TXST_INT_MASK)==USPI_TXST_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_TXSTIF_Msk)) - { - u32IntFlag |= USPI_TXST_INT_MASK; - } - else {} - - /* Check TX end interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_TXENDIF_Msk; - if(((u32Mask & USPI_TXEND_INT_MASK)==USPI_TXEND_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_TXENDIF_Msk)) - { - u32IntFlag |= USPI_TXEND_INT_MASK; - } - else {} - - /* Check RX start interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_RXSTIF_Msk; - if(((u32Mask & USPI_RXST_INT_MASK)==USPI_RXST_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_RXSTIF_Msk)) - { - u32IntFlag |= USPI_RXST_INT_MASK; - } - else {} - - /* Check RX end interrupt flag */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_RXENDIF_Msk; - if(((u32Mask & USPI_RXEND_INT_MASK)==USPI_RXEND_INT_MASK) && (u32TmpFlag == USPI_PROTSTS_RXENDIF_Msk)) - { - u32IntFlag |= USPI_RXEND_INT_MASK; - } - else {} - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref USPI_SSINACT_INT_MASK - * - \ref USPI_SSACT_INT_MASK - * - \ref USPI_SLVTO_INT_MASK - * - \ref USPI_SLVBE_INT_MASK - * - \ref USPI_TXUDR_INT_MASK - * - \ref USPI_RXOV_INT_MASK - * - \ref USPI_TXST_INT_MASK - * - \ref USPI_TXEND_INT_MASK - * - \ref USPI_RXST_INT_MASK - * - \ref USPI_RXEND_INT_MASK - * @return None - */ -void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask) -{ - /* Clear slave selection signal inactive interrupt flag */ - if((u32Mask & USPI_SSINACT_INT_MASK)==USPI_SSINACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSINAIF_Msk; - } - else {} - /* Clear slave selection signal active interrupt flag */ - if((u32Mask & USPI_SSACT_INT_MASK)==USPI_SSACT_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SSACTIF_Msk; - } - else {} - /* Clear slave time-out interrupt flag */ - if((u32Mask & USPI_SLVTO_INT_MASK)==USPI_SLVTO_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVTOIF_Msk; - } - else {} - /* Clear slave bit count error interrupt flag */ - if((u32Mask & USPI_SLVBE_INT_MASK)==USPI_SLVBE_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_SLVBEIF_Msk; - } - else {} - /* Clear TX under run interrupt flag */ - if((u32Mask & USPI_TXUDR_INT_MASK)==USPI_TXUDR_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_TXUDRIF_Msk; - } - else {} - /* Clear RX overrun interrupt flag */ - if((u32Mask & USPI_RXOV_INT_MASK)==USPI_RXOV_INT_MASK) - { - uspi->BUFSTS = USPI_BUFSTS_RXOVIF_Msk; - } - else {} - /* Clear TX start interrupt flag */ - if((u32Mask & USPI_TXST_INT_MASK)==USPI_TXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXSTIF_Msk; - } - else {} - /* Clear TX end interrupt flag */ - if((u32Mask & USPI_TXEND_INT_MASK)==USPI_TXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_TXENDIF_Msk; - } - else {} - /* Clear RX start interrupt flag */ - if((u32Mask & USPI_RXST_INT_MASK)==USPI_RXST_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXSTIF_Msk; - } - else {} - - /* Clear RX end interrupt flag */ - if((u32Mask & USPI_RXEND_INT_MASK)==USPI_RXEND_INT_MASK) - { - uspi->PROTSTS = USPI_PROTSTS_RXENDIF_Msk; - } - else {} -} - -/** - * @brief Get USCI_SPI status. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref USPI_BUSY_MASK - * - \ref USPI_RX_EMPTY_MASK - * - \ref USPI_RX_FULL_MASK - * - \ref USPI_TX_EMPTY_MASK - * - \ref USPI_TX_FULL_MASK - * - \ref USPI_SSLINE_STS_MASK - * @return Flags of selected sources. - */ -uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0ul; - uint32_t u32TmpFlag; - - /* Check busy status */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_BUSY_Msk; - if(((u32Mask & USPI_BUSY_MASK)==USPI_BUSY_MASK) && (u32TmpFlag & USPI_PROTSTS_BUSY_Msk)) - { - u32Flag |= USPI_BUSY_MASK; - } - else {} - - /* Check RX empty flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_RXEMPTY_Msk; - if(((u32Mask & USPI_RX_EMPTY_MASK)==USPI_RX_EMPTY_MASK) && (u32TmpFlag == USPI_BUFSTS_RXEMPTY_Msk)) - { - u32Flag |= USPI_RX_EMPTY_MASK; - } - else {} - - /* Check RX full flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_RXFULL_Msk; - if(((u32Mask & USPI_RX_FULL_MASK)==USPI_RX_FULL_MASK) && (u32TmpFlag == USPI_BUFSTS_RXFULL_Msk)) - { - u32Flag |= USPI_RX_FULL_MASK; - } - else {} - - /* Check TX empty flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_TXEMPTY_Msk; - if(((u32Mask & USPI_TX_EMPTY_MASK)==USPI_TX_EMPTY_MASK) && (u32TmpFlag == USPI_BUFSTS_TXEMPTY_Msk)) - { - u32Flag |= USPI_TX_EMPTY_MASK; - } - else {} - - /* Check TX full flag */ - u32TmpFlag = uspi->BUFSTS & USPI_BUFSTS_TXFULL_Msk; - if(((u32Mask & USPI_TX_FULL_MASK)==USPI_TX_FULL_MASK) && (u32TmpFlag == USPI_BUFSTS_TXFULL_Msk)) - { - u32Flag |= USPI_TX_FULL_MASK; - } - else {} - - /* Check USCI_SPI_SS line status */ - u32TmpFlag = uspi->PROTSTS & USPI_PROTSTS_SSLINE_Msk; - if(((u32Mask & USPI_SSLINE_STS_MASK)==USPI_SSLINE_STS_MASK) && (u32TmpFlag & USPI_PROTSTS_SSLINE_Msk)) - { - u32Flag |= USPI_SSLINE_STS_MASK; - } - else {} - return u32Flag; -} - -/** - * @brief Enable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_EnableWakeup(USPI_T *uspi) -{ - uspi->WKCTL |= USPI_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable USCI_SPI Wake-up Function. - * @param[in] uspi The pointer of the specified USCI_SPI module. - * @return None - */ -void USPI_DisableWakeup(USPI_T *uspi) -{ - uspi->WKCTL &= ~USPI_WKCTL_WKEN_Msk; -} - -/*@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_uart.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_uart.c deleted file mode 100644 index 94c1fc99aec..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_usci_uart.c +++ /dev/null @@ -1,702 +0,0 @@ -/**************************************************************************//** - * @file usci_uart.c - * @version V3.00 - * @brief M480 series USCI UART (UUART) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USCI_UART_Driver USCI_UART Driver - @{ -*/ - -/** @addtogroup USCI_UART_EXPORTED_FUNCTIONS USCI_UART Exported Functions - @{ -*/ - -/** - * @brief Clear USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to clear USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -void UUART_ClearIntFlag(UUART_T* uuart, uint32_t u32Mask) -{ - - if(u32Mask & UUART_ABR_INT_MASK) /* Clear Auto-baud Rate Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_ABRDETIF_Msk; - } - - if(u32Mask & UUART_RLS_INT_MASK) /* Clear Receive Line Status Interrupt */ - { - uuart->PROTSTS = (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk); - } - - if(u32Mask & UUART_BUF_RXOV_INT_MASK) /* Clear Receive Buffer Over-run Error Interrupt */ - { - uuart->BUFSTS = UUART_BUFSTS_RXOVIF_Msk; - } - - if(u32Mask & UUART_TXST_INT_MASK) /* Clear Transmit Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXSTIF_Msk; - } - - if(u32Mask & UUART_TXEND_INT_MASK) /* Clear Transmit End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_TXENDIF_Msk; - } - - if(u32Mask & UUART_RXST_INT_MASK) /* Clear Receive Start Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXSTIF_Msk; - } - - if(u32Mask & UUART_RXEND_INT_MASK) /* Clear Receive End Interrupt */ - { - uuart->PROTSTS = UUART_PROTSTS_RXENDIF_Msk; - } - -} - -/** - * @brief Get USCI_UART specified interrupt flag - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return Interrupt flags of selected sources. - * - * @details The function is used to get USCI_UART related interrupt flags specified by u32Mask parameter. - */ - -uint32_t UUART_GetIntFlag(UUART_T* uuart, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0ul; - uint32_t u32Tmp1, u32Tmp2; - - /* Check Auto-baud Rate Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_ABR_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_ABRDETIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_ABR_INT_MASK; - } - - /* Check Receive Line Status Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RLS_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & (UUART_PROTSTS_BREAK_Msk | UUART_PROTSTS_FRMERR_Msk | UUART_PROTSTS_PARITYERR_Msk)); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RLS_INT_MASK; - } - - /* Check Receive Buffer Over-run Error Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_BUF_RXOV_INT_MASK); - u32Tmp2 = (uuart->BUFSTS & UUART_BUFSTS_RXOVIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_BUF_RXOV_INT_MASK; - } - - /* Check Transmit Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXSTIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXST_INT_MASK; - } - - /* Check Transmit End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_TXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_TXENDIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_TXEND_INT_MASK; - } - - /* Check Receive Start Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXST_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXSTIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXST_INT_MASK; - } - - /* Check Receive End Interrupt Flag */ - u32Tmp1 = (u32Mask & UUART_RXEND_INT_MASK); - u32Tmp2 = (uuart->PROTSTS & UUART_PROTSTS_RXENDIF_Msk); - if(u32Tmp1 && u32Tmp2) - { - u32IntFlag |= UUART_RXEND_INT_MASK; - } - - return u32IntFlag; - -} - - -/** - * @brief Disable USCI_UART function mode - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART function mode. - */ -void UUART_Close(UUART_T* uuart) -{ - uuart->CTL = 0ul; -} - - -/** - * @brief Disable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to disabled USCI_UART related interrupts specified by u32Mask parameter. - */ -void UUART_DisableInt(UUART_T* uuart, uint32_t u32Mask) -{ - - /* Disable Auto-baud rate interrupt flag */ - if((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_ABRIEN_Msk; - } - - /* Disable receive line status interrupt flag */ - if((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN &= ~UUART_PROTIEN_RLSIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL &= ~UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Disable TX start interrupt flag */ - if((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXSTIEN_Msk; - } - - /* Disable TX end interrupt flag */ - if((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_TXENDIEN_Msk; - } - - /* Disable RX start interrupt flag */ - if((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXSTIEN_Msk; - } - - /* Disable RX end interrupt flag */ - if((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN &= ~UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Enable interrupt function. - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref UUART_ABR_INT_MASK - * - \ref UUART_RLS_INT_MASK - * - \ref UUART_BUF_RXOV_INT_MASK - * - \ref UUART_TXST_INT_MASK - * - \ref UUART_TXEND_INT_MASK - * - \ref UUART_RXST_INT_MASK - * - \ref UUART_RXEND_INT_MASK - * - * @return None - * - * @details The function is used to enable USCI_UART related interrupts specified by u32Mask parameter. - */ -void UUART_EnableInt(UUART_T* uuart, uint32_t u32Mask) -{ - /* Enable Auto-baud rate interrupt flag */ - if((u32Mask & UUART_ABR_INT_MASK) == UUART_ABR_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_ABRIEN_Msk; - } - - /* Enable receive line status interrupt flag */ - if((u32Mask & UUART_RLS_INT_MASK) == UUART_RLS_INT_MASK) - { - uuart->PROTIEN |= UUART_PROTIEN_RLSIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if((u32Mask & UUART_BUF_RXOV_INT_MASK) == UUART_BUF_RXOV_INT_MASK) - { - uuart->BUFCTL |= UUART_BUFCTL_RXOVIEN_Msk; - } - - /* Enable TX start interrupt flag */ - if((u32Mask & UUART_TXST_INT_MASK) == UUART_TXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXSTIEN_Msk; - } - - /* Enable TX end interrupt flag */ - if((u32Mask & UUART_TXEND_INT_MASK) == UUART_TXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_TXENDIEN_Msk; - } - - /* Enable RX start interrupt flag */ - if((u32Mask & UUART_RXST_INT_MASK) == UUART_RXST_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXSTIEN_Msk; - } - - /* Enable RX end interrupt flag */ - if((u32Mask & UUART_RXEND_INT_MASK) == UUART_RXEND_INT_MASK) - { - uuart->INTEN |= UUART_INTEN_RXENDIEN_Msk; - } -} - - -/** - * @brief Open and set USCI_UART function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The baud rate of USCI_UART module. - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to enable USCI_UART function and set baud-rate. - */ -uint32_t UUART_Open(UUART_T* uuart, uint32_t u32baudrate) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - if( uuart == UUART0) - { - u32PCLKFreq = CLK_GetPCLK0Freq(); - } - else - { - u32PCLKFreq = CLK_GetPCLK1Freq(); - } - - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div+1ul)); - - if(u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - u32Tmp = 0x400ul * 0x10ul; - for(u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if(u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if(u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - u32Tmp = 0ul; - - for(u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - - u32ClkDiv = u32Div / u32DSCnt; - - if(u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv+1ul) * u32DSCnt) - u32Div; - } - - if(u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if(u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if(u32Min == 0ul) - { - break; - } - } - } - - /* Enable USCI_UART protocol */ - uuart->CTL &= ~UUART_CTL_FUNMODE_Msk; - uuart->CTL = 2ul << UUART_CTL_FUNMODE_Pos; - - /* Set USCI_UART line configuration */ - uuart->LINECTL = UUART_WORD_LEN_8 | UUART_LINECTL_LSB_Msk; - uuart->DATIN0 = (2ul << UUART_DATIN0_EDGEDET_Pos); /* Set falling edge detection */ - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv-1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt-1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt-1ul) << UUART_BRGEN_PDSCNT_Pos); - - uuart->PROTCTL |= UUART_PROTCTL_PROTEN_Msk; - - return (u32PCLKFreq/u32PDSCnt/u32MinDSCnt/u32MinClkDiv); -} - - -/** - * @brief Read USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive buffer. - * @param[in] u32ReadBytes The read bytes number of data. - * - * @return Receive byte count - * - * @details The function is used to read Rx data from RX buffer and the data will be stored in pu8RxBuf. - */ -uint32_t UUART_Read(UUART_T* uuart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - - for(u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while(uuart->BUFSTS & UUART_BUFSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - break; - } - } - - if(u32delayno >= 0x40000000ul) - { - break; - } - - pu8RxBuf[u32Count] = (uint8_t)uuart->RXDAT; /* Get Data from USCI RX */ - } - - return u32Count; - -} - - -/** - * @brief Set USCI_UART line configuration - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32baudrate The register value of baud rate of USCI_UART module. - * If u32baudrate = 0, USCI_UART baud rate will not change. - * @param[in] u32data_width The data length of USCI_UART module. - * - \ref UUART_WORD_LEN_6 - * - \ref UUART_WORD_LEN_7 - * - \ref UUART_WORD_LEN_8 - * - \ref UUART_WORD_LEN_9 - * @param[in] u32parity The parity setting (none/odd/even) of USCI_UART module. - * - \ref UUART_PARITY_NONE - * - \ref UUART_PARITY_ODD - * - \ref UUART_PARITY_EVEN - * @param[in] u32stop_bits The stop bit length (1/2 bit) of USCI_UART module. - * - \ref UUART_STOP_BIT_1 - * - \ref UUART_STOP_BIT_2 - * - * @return Real baud rate of USCI_UART module. - * - * @details This function use to config USCI_UART line setting. - */ -uint32_t UUART_SetLine_Config(UUART_T* uuart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32PCLKFreq, u32PDSCnt, u32DSCnt, u32ClkDiv; - uint32_t u32Tmp, u32Tmp2, u32Min, u32MinClkDiv, u32MinDSCnt; - uint32_t u32Div; - - /* Get PCLK frequency */ - if(uuart == UUART0) - { - u32PCLKFreq = CLK_GetPCLK0Freq(); - } - else /* UUART1 */ - { - u32PCLKFreq = CLK_GetPCLK1Freq(); - } - - if(u32baudrate != 0ul) - { - u32Div = u32PCLKFreq / u32baudrate; - u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; - u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div+1ul)); - - if(u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; - - u32Tmp = 0x400ul * 0x10ul; - for(u32PDSCnt = 1ul; u32PDSCnt <= 0x04ul; u32PDSCnt++) - { - if(u32Div <= (u32Tmp * u32PDSCnt)) break; - } - - if(u32PDSCnt > 0x4ul) u32PDSCnt = 0x4ul; - - u32Div = u32Div / u32PDSCnt; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinDSCnt = 0ul; - u32MinClkDiv = 0ul; - - for(u32DSCnt = 6ul; u32DSCnt <= 0x10ul; u32DSCnt++) /* DSCNT could be 0x5~0xF */ - { - u32ClkDiv = u32Div / u32DSCnt; - - if(u32ClkDiv > 0x400ul) - { - u32ClkDiv = 0x400ul; - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = u32Tmp + 1ul; - } - else - { - u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); - u32Tmp2 = ((u32ClkDiv+1ul) * u32DSCnt) - u32Div; - } - - if(u32Tmp >= u32Tmp2) - { - u32ClkDiv = u32ClkDiv + 1ul; - } - else u32Tmp2 = u32Tmp; - - if(u32Tmp2 < u32Min) - { - u32Min = u32Tmp2; - u32MinDSCnt = u32DSCnt; - u32MinClkDiv = u32ClkDiv; - - /* Break when get good results */ - if(u32Min == 0ul) - { - break; - } - } - } - - /* Set USCI_UART baud rate */ - uuart->BRGEN = ((u32MinClkDiv-1ul) << UUART_BRGEN_CLKDIV_Pos) | - ((u32MinDSCnt-1ul) << UUART_BRGEN_DSCNT_Pos) | - ((u32PDSCnt-1ul) << UUART_BRGEN_PDSCNT_Pos); - } - else - { - u32PDSCnt = ((uuart->BRGEN & UUART_BRGEN_PDSCNT_Msk) >> UUART_BRGEN_PDSCNT_Pos) + 1ul; - u32MinDSCnt = ((uuart->BRGEN & UUART_BRGEN_DSCNT_Msk) >> UUART_BRGEN_DSCNT_Pos) + 1ul; - u32MinClkDiv = ((uuart->BRGEN & UUART_BRGEN_CLKDIV_Msk) >> UUART_BRGEN_CLKDIV_Pos) + 1ul; - } - - /* Set USCI_UART line configuration */ - uuart->LINECTL = (uuart->LINECTL & ~UUART_LINECTL_DWIDTH_Msk) | u32data_width; - uuart->PROTCTL = (uuart->PROTCTL & ~(UUART_PROTCTL_STICKEN_Msk | UUART_PROTCTL_EVENPARITY_Msk | - UUART_PROTCTL_PARITYEN_Msk)) | u32parity; - uuart->PROTCTL = (uuart->PROTCTL & ~UUART_PROTCTL_STOPB_Msk ) | u32stop_bits; - - return (u32PCLKFreq/u32PDSCnt/u32MinDSCnt/u32MinClkDiv); -} - - -/** - * @brief Write USCI_UART data - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] pu8TxBuf The buffer to send the data to USCI transmission buffer. - * @param[out] u32WriteBytes The byte number of data. - * - * @return Transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by USCI_UART. - */ -uint32_t UUART_Write(UUART_T* uuart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - - for(u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while((uuart->BUFSTS & UUART_BUFSTS_TXEMPTY_Msk) == 0ul) /* Wait Tx empty */ - { - u32delayno++; - if(u32delayno >= 0x40000000ul) - { - break; - } - } - - if(u32delayno >= 0x40000000ul) - { - break; - } - - uuart->TXDAT = (uint8_t)pu8TxBuf[u32Count]; /* Send USCI_UART Data to buffer */ - } - - return u32Count; - -} - - -/** - * @brief Enable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * @param[in] u32WakeupMode The wakeup mode of USCI_UART module. - * - \ref UUART_PROTCTL_DATWKEN_Msk : Data wake-up Mode - * - \ref UUART_PROTCTL_CTSWKEN_Msk : nCTS wake-up Mode - * - * @return None - * - * @details The function is used to enable Wake-up function of USCI_UART. - */ -void UUART_EnableWakeup(UUART_T* uuart, uint32_t u32WakeupMode) -{ - uuart->PROTCTL |= u32WakeupMode; - uuart->WKCTL |= UUART_WKCTL_WKEN_Msk; -} - - -/** - * @brief Disable USCI_UART Wake-up Function - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable Wake-up function of USCI_UART. - */ -void UUART_DisableWakeup(UUART_T* uuart) -{ - uuart->PROTCTL &= ~(UUART_PROTCTL_DATWKEN_Msk|UUART_PROTCTL_CTSWKEN_Msk); - uuart->WKCTL &= ~UUART_WKCTL_WKEN_Msk; -} - -/** - * @brief Enable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to enable USCI_UART auto flow control. - */ -void UUART_EnableFlowCtrl(UUART_T* uuart) -{ - /* Set RTS signal is low level active */ - uuart->LINECTL &= ~UUART_LINECTL_CTLOINV_Msk; - - /* Set CTS signal is low level active */ - uuart->CTLIN0 &= ~UUART_CTLIN0_ININV_Msk; - - /* Enable CTS and RTS auto flow control function */ - uuart->PROTCTL |= UUART_PROTCTL_RTSAUTOEN_Msk|UUART_PROTCTL_CTSAUTOEN_Msk; -} - -/** - * @brief Disable USCI_UART auto flow control - * - * @param[in] uuart The pointer of the specified USCI_UART module. - * - * @return None - * - * @details The function is used to disable USCI_UART auto flow control. - */ -void UUART_DisableFlowCtrl(UUART_T* uuart) -{ - /* Disable CTS and RTS auto flow control function */ - uuart->PROTCTL &= ~(UUART_PROTCTL_RTSAUTOEN_Msk|UUART_PROTCTL_CTSAUTOEN_Msk); -} - - - - -/*@}*/ /* end of group USCI_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USCI_UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_wdt.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_wdt.c deleted file mode 100644 index fe4d433b866..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_wdt.c +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************//** - * @file wdt.c - * @version V3.00 - * @brief M480 series WDT driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Initialize WDT and start counting - * - * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: - * - \ref WDT_TIMEOUT_2POW4 - * - \ref WDT_TIMEOUT_2POW6 - * - \ref WDT_TIMEOUT_2POW8 - * - \ref WDT_TIMEOUT_2POW10 - * - \ref WDT_TIMEOUT_2POW12 - * - \ref WDT_TIMEOUT_2POW14 - * - \ref WDT_TIMEOUT_2POW16 - * - \ref WDT_TIMEOUT_2POW18 - * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: - * - \ref WDT_RESET_DELAY_1026CLK - * - \ref WDT_RESET_DELAY_130CLK - * - \ref WDT_RESET_DELAY_18CLK - * - \ref WDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable WDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - */ -void WDT_Open(uint32_t u32TimeoutInterval, - uint32_t u32ResetDelay, - uint32_t u32EnableReset, - uint32_t u32EnableWakeup) -{ - WDT->ALTCTL = u32ResetDelay; - - WDT->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk | - (u32EnableReset << WDT_CTL_RSTEN_Pos) | - (u32EnableWakeup << WDT_CTL_WKEN_Pos); - return; -} - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_wwdt.c b/bsp/nuvoton/libraries/m480/StdDriver/src/nu_wwdt.c deleted file mode 100644 index 3f1d13a1510..00000000000 --- a/bsp/nuvoton/libraries/m480/StdDriver/src/nu_wwdt.c +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************//** - * @file wwdt.c - * @version V3.00 - * @brief M480 series WWDT driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Open WWDT and start counting - * - * @param[in] u32PreScale Pre-scale setting of WWDT counter. Valid values are: - * - \ref WWDT_PRESCALER_1 - * - \ref WWDT_PRESCALER_2 - * - \ref WWDT_PRESCALER_4 - * - \ref WWDT_PRESCALER_8 - * - \ref WWDT_PRESCALER_16 - * - \ref WWDT_PRESCALER_32 - * - \ref WWDT_PRESCALER_64 - * - \ref WWDT_PRESCALER_128 - * - \ref WWDT_PRESCALER_192 - * - \ref WWDT_PRESCALER_256 - * - \ref WWDT_PRESCALER_384 - * - \ref WWDT_PRESCALER_512 - * - \ref WWDT_PRESCALER_768 - * - \ref WWDT_PRESCALER_1024 - * - \ref WWDT_PRESCALER_1536 - * - \ref WWDT_PRESCALER_2048 - * @param[in] u32CmpValue Setting the window compared value. Valid values are between 0x0 to 0x3F. - * @param[in] u32EnableInt Enable WWDT time-out interrupt function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WWDT module start counting with different counter period by pre-scale setting and compared window value. - * @note This WWDT_CTL register can be write only one time after chip is powered on or reset. - */ -void WWDT_Open(uint32_t u32PreScale, - uint32_t u32CmpValue, - uint32_t u32EnableInt) -{ - WWDT->CTL = u32PreScale | - (u32CmpValue << WWDT_CTL_CMPDAT_Pos) | - ((u32EnableInt == TRUE) ? WWDT_CTL_INTEN_Msk : 0U) | - WWDT_CTL_WWDTEN_Msk; - return; -} - -/*@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WWDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/SConscript b/bsp/nuvoton/libraries/m480/USBHostLib/SConscript deleted file mode 100644 index acb7a4a7328..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -group = [] -if GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_USBH'): - src = Glob('*src/*.c') + Glob('src/*.cpp') - CPPPATH = [cwd + '/inc'] - group = DefineGroup('m480_usbhostlib', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/inc/config.h b/bsp/nuvoton/libraries/m480/USBHostLib/inc/config.h deleted file mode 100644 index 1534e645d2c..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/inc/config.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************//** - * @file config.h - * @version V1.00 - * @brief This header file defines the configuration of USB Host library. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_CONFIG_H_ -#define _USBH_CONFIG_H_ - -/// @cond HIDDEN_SYMBOLS - -#include -#include -/*----------------------------------------------------------------------------------------*/ -/* Hardware settings */ -/*----------------------------------------------------------------------------------------*/ -#define HCLK_MHZ 192 /* used for loop-delay. must be larger than - true HCLK clock MHz */ - -#define ENABLE_OHCI_IRQ() NVIC_EnableIRQ(USBH_IRQn) -#define DISABLE_OHCI_IRQ() NVIC_DisableIRQ(USBH_IRQn) -#define ENABLE_EHCI_IRQ() NVIC_EnableIRQ(HSUSBH_IRQn) -#define DISABLE_EHCI_IRQ() NVIC_DisableIRQ(HSUSBH_IRQn) - -#define ENABLE_OHCI /* Enable OHCI host controller */ - -#if defined(BSP_USING_HSUSBH) - #define ENABLE_EHCI /* Enable EHCI host controller */ -#endif - -#define EHCI_PORT_CNT 1 /* Number of EHCI roothub ports */ -#define OHCI_PORT_CNT 2 /* Number of OHCI roothub ports */ -#define OHCI_PER_PORT_POWER /* OHCI root hub per port powered */ - -#define OHCI_ISO_DELAY 4 /* preserved number frames while scheduling - OHCI isochronous transfer */ - -#define EHCI_ISO_DELAY 2 /* preserved number of frames while - scheduling EHCI isochronous transfer */ - -#define EHCI_ISO_RCLM_RANGE 32 /* When inspecting activated iTD/siTD, - unconditionally reclaim iTD/isTD scheduled - in just elapsed EHCI_ISO_RCLM_RANGE ms. */ - -#define MAX_DESC_BUFF_SIZE 512 /* To hold the configuration descriptor, USB - core will allocate a buffer with this size - for each connected device. USB core does - not release it until device disconnected. */ - -/*----------------------------------------------------------------------------------------*/ -/* Memory allocation settings */ -/*----------------------------------------------------------------------------------------*/ - -#define STATIC_MEMORY_ALLOC 0 /* pre-allocate static memory blocks. No dynamic memory aloocation. - But the maximum number of connected devices and transfers are - limited. */ - -#define MAX_UDEV_DRIVER 8 /*!< Maximum number of registered drivers */ -#define MAX_ALT_PER_IFACE 8 /*!< maximum number of alternative interfaces per interface */ -#define MAX_EP_PER_IFACE 6 /*!< maximum number of endpoints per interface */ -#define MAX_HUB_DEVICE 8 /*!< Maximum number of hub devices */ - -/* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI - are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE. - May allocate one or more units depend on hardware descriptor type. */ - -#define MEM_POOL_UNIT_SIZE 64 /*!< A fixed hard coding setting. Do not change it! */ -#define MEM_POOL_UNIT_NUM 256 /*!< Increase this or heap size if memory allocate failed. */ - -/*----------------------------------------------------------------------------------------*/ -/* Re-defined staff for various compiler */ -/*----------------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ - #define __inline inline -#endif - - -/*----------------------------------------------------------------------------------------*/ -/* Debug settings */ -/*----------------------------------------------------------------------------------------*/ -#define ENABLE_ERROR_MSG /* enable debug messages */ -#define ENABLE_DEBUG_MSG /* enable debug messages */ -//#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */ -//#define DUMP_DESCRIPTOR /* dump descriptors */ - -#ifdef ENABLE_ERROR_MSG - #define USB_error rt_kprintf -#else - #define USB_error(...) -#endif - -#ifdef ENABLE_DEBUG_MSG - #define USB_debug rt_kprintf - #ifdef ENABLE_VERBOSE_DEBUG - #define USB_vdebug rt_kprintf - #else - #define USB_vdebug(...) - #endif -#else - #define USB_debug(...) - #define USB_vdebug(...) -#endif - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_CONFIG_H_ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/inc/ehci.h b/bsp/nuvoton/libraries/m480/USBHostLib/inc/ehci.h deleted file mode 100644 index f99a4abde34..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/inc/ehci.h +++ /dev/null @@ -1,281 +0,0 @@ -/**************************************************************************//** - * @file ehci.h - * @version V1.00 - * @brief USB EHCI host controller driver header file. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_EHCI_H_ -#define _USBH_EHCI_H_ - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct qh_t; -struct iso_ep_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------------*/ -/* Periodic Frame List Size (256, 512, or 1024) */ -/*----------------------------------------------------------------------------------------*/ -#define FL_SIZE 1024 /* frame list size can be 256, 512, or 1024 */ -#define NUM_IQH 11 /* depends on FL_SIZE, 256:9, 512:10, 1024:11 */ - - -/*----------------------------------------------------------------------------------------*/ -/* Interrupt Threshold Control (1, 2, 4, 6, .. 64) */ -/*----------------------------------------------------------------------------------------*/ -#define UCMDR_INT_THR_CTRL (0x1< of QH */ -} qTD_T; - - -#define QTD_LIST_END 0x1 /* Indicate the terminate of qTD list. */ -#define QTD_PTR(x) ((qTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Status: qTD Token[7:0] - */ -#define QTD_STS_PS_OUT (0<<0) /* directs the HC to issue an OUT PID */ -#define QTD_STS_PS_PING (1<<0) /* directs the HC to issue an PING PID */ -#define QTD_STS_SPLIT_STRAT (0<<1) /* directs the HC to issue an Start split */ -#define QTD_STS_SPLIT_COMPLETE (1<<1) /* directs the HC to issue an Complete split */ -#define QTD_STS_MISS_MF (1<<2) /* miss a required complete-split transaction */ -#define QTD_STS_XactErr (1<<3) /* Transaction Error occurred */ -#define QTD_STS_BABBLE (1<<4) /* Babble Detected */ -#define QTD_STS_DATA_BUFF_ERR (1<<5) /* Data Buffer Error */ -#define QTD_STS_HALT (1<<6) /* Halted */ -#define QTD_STS_ACTIVE (1<<7) /* Active */ - -/* - * PID: qTD Token[9:8] - */ -#define QTD_PID_Msk (0x3<<8) -#define QTD_PID_OUT (0<<8) /* generates token (E1H) */ -#define QTD_PID_IN (1<<8) /* generates token (69H) */ -#define QTD_PID_SETUP (2<<8) /* generates token (2DH) */ - -#define QTD_ERR_COUNTER (3<<10) /* Token[11:10] */ -#define QTD_IOC (1<<15) /* Token[15] - Interrupt On Complete */ -#define QTD_TODO_LEN_Pos 16 /* Token[31:16] - Total Bytes to Transfer */ -#define QTD_TODO_LEN(x) (((x)>>16) & 0x7FFF) -#define QTD_DT (1UL<<31) /* Token[31] - Data Toggle */ - -/*----------------------------------------------------------------------------------------*/ -/* Queue Head (QH) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct qh_t -{ - /* OHCI spec. Endpoint descriptor */ - uint32_t HLink; /* Queue Head Horizontal Link Pointer */ - uint32_t Chrst; /* Endpoint Characteristics: QH DWord 1 */ - uint32_t Cap; /* Endpoint Capabilities: QH DWord 2 */ - uint32_t Curr_qTD; /* Current qTD Pointer */ - /* - * The followings are qTD Transfer Overlay - */ - uint32_t OL_Next_qTD; /* Next qTD Pointer */ - uint32_t OL_Alt_Next_qTD; /* Alternate Next qTD Pointer */ - uint32_t OL_Token; /* qTD Token */ - uint32_t OL_Bptr[5]; /* qTD Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - qTD_T *dummy; /* point to the inactive dummy qTD */ - qTD_T *qtd_list; /* currently linked qTD transfers */ - qTD_T *done_list; /* currently linked qTD transfers */ - struct qh_t *next; /* point to the next QH in remove list */ -} QH_T; - -/* HLink[0] T field of "Queue Head Horizontal Link Pointer" */ -#define QH_HLNK_END 0x1 - -/* - * HLink[2:1] Typ field of "Queue Head Horizontal Link Pointer" - */ -#define QH_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define QH_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define QH_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define QH_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define QH_PTR(x) ((QH_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Bit fields of "Endpoint Characteristics" - */ -#define QH_NAK_RL (4L<<28) /* Chrst[31:28] - NAK Count Reload */ -#define QH_CTRL_EP_FLAG (1<<27) /* Chrst[27] - Control Endpoint Flag */ -#define QH_RCLM_LIST_HEAD (1<<15) /* Chrst[15] - Head of Reclamation List Flag */ -#define QH_DTC (1<<14) /* Chrst[14] - Data Toggle Control */ -#define QH_EPS_FULL (0<<12) /* Chrst[13:12] - Endpoint Speed (Full) */ -#define QH_EPS_LOW (1<<12) /* Chrst[13:12] - Endpoint Speed (Low) */ -#define QH_EPS_HIGH (2<<12) /* Chrst[13:12] - Endpoint Speed (High) */ -#define QH_I_NEXT (1<<7) /* Chrst[7] - Inactivate on Next Transaction */ - -/* - * Bit fields of "Endpoint Capabilities" - */ -#define QH_MULT_Pos 30 /* Cap[31:30] - High-Bandwidth Pipe Multiplier */ -#define QH_HUB_PORT_Pos 23 /* Cap[29:23] - Hub Port Number */ -#define QH_HUB_ADDR_Pos 16 /* Cap[22:16] - Hub Addr */ -#define QH_C_MASK_Msk 0xFF00 /* Cap[15:8] - uFrame C-mask */ -#define QH_S_MASK_Msk 0x00FF /* Cap[7:0] - uFrame S-mask */ - - -/*----------------------------------------------------------------------------------------*/ -/* Isochronous (High-Speed) Transfer Descriptor (iTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct itd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Transaction[8]; /* Transaction Status and Control */ - uint32_t Bptr[7]; /* Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint32_t buff_base; /* buffer base address */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint8_t trans_mask; /* mask of activated transactions in iTD */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct itd_t *next; /* used by software to maintain iTD list */ -} iTD_T; - -/* - * Next_Link[2:1] Typ field of "Next Schedule Element Pointer" Typ field - */ -#define ITD_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define ITD_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define ITD_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define ITD_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define ITD_PTR(x) ((iTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Transaction[8] - */ -#define ITD_STATUS(x) (((x)>>28)&0xF) -#define ITD_STATUS_ACTIVE (0x80000000UL) /* Active */ -#define ITD_STATUS_BUFF_ERR (0x40000000UL) /* Data Buffer Error */ -#define ITD_STATUS_BABBLE (0x20000000UL) /* Babble Detected */ -#define ITD_STATUS_XACT_ERR (0x10000000UL) /* Transcation Error */ - -#define ITD_XLEN_Pos 16 -#define ITD_XFER_LEN(x) (((x)>>16)&0xFFF) -#define ITD_IOC (1<<15) -#define ITD_PG_Pos 12 -#define ITD_XFER_OFF_Msk 0xFFF - -/* - * Bptr[7] - */ -#define ITD_BUFF_PAGE_Pos 12 -/* Bptr[0] */ -#define ITD_EP_NUM_Pos 8 -#define ITD_EP_NUM(itd) (((itd)->Bptr[0]>>8)&0xF) -#define ITD_DEV_ADDR_Pos 0 -#define ITD_DEV_ADDR(itd) ((itd)->Bptr[0]&0x7F) -/* Bptr[1] */ -#define ITD_DIR_IN (1<<11) -#define ITD_DIR_OUT (0<<11) -#define ITD_MAX_PKTSZ_Pos 0 -#define ITD_MAX_PKTSZ(itd) ((itd)->Bptr[1]&0x7FF) - -/*----------------------------------------------------------------------------------------*/ -/* Split Isochronous (Full-Speed) Transfer Descriptor (siTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct sitd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Chrst; /* Endpoint and Transaction Translator Characteristics */ - uint32_t Sched; /* Micro-frame Schedule Control */ - uint32_t StsCtrl; /* siTD Transfer Status and Control */ - uint32_t Bptr[2]; /* Buffer Page Pointer List */ - uint32_t BackLink; /* siTD Back Link Pointer */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct sitd_t *next; /* used by software to maintain siTD list */ -} siTD_T; - -#define SITD_LIST_END 0x1 /* Indicate the terminate of siTD list. */ - -#define SITD_XFER_IO_Msk (1UL<<31) -#define SITD_XFER_IN (1UL<<31) -#define SITD_XFER_OUT (0UL<<31) - -#define SITD_PORT_NUM_Pos 24 -#define SITD_HUB_ADDR_Pos 16 -#define SITD_EP_NUM_Pos 8 -#define SITD_DEV_ADDR_Pos 0 - -#define SITD_IOC (1UL<<31) -#define SITD_XFER_CNT_Pos 16 -#define SITD_XFER_CNT_Msk (0x3FF<>28) & 0x0F) -#define TD_CC_SET(td, cc) (td) = ((td) & 0x0FFFFFFF) | (((cc) & 0x0F) << 28) -#define TD_T_DATA0 0x02000000 -#define TD_T_DATA1 0x03000000 -#define TD_R 0x00040000 -#define TD_DP 0x00180000 -#define TD_DP_IN 0x00100000 -#define TD_DP_OUT 0x00080000 -#define MAXPSW 8 -/* steel TD reserved bits to keep driver data */ -#define TD_TYPE_Msk (0x3<<16) -#define TD_TYPE_CTRL (0x0<<16) -#define TD_TYPE_BULK (0x1<<16) -#define TD_TYPE_INT (0x2<<16) -#define TD_TYPE_ISO (0x3<<16) -#define TD_CTRL_Msk (0x7<<15) -#define TD_CTRL_DATA (1<<15) - - -/* - * The HCCA (Host Controller Communications Area) is a 256 byte - * structure defined in the OHCI spec. that the host controller is - * told the base address of. It must be 256-byte aligned. - */ -typedef struct -{ - uint32_t int_table[32]; /* Interrupt ED table */ - uint16_t frame_no; /* current frame number */ - uint16_t pad1; /* set to 0 on each frame_no change */ - uint32_t done_head; /* info returned for an interrupt */ - uint8_t reserved_for_hc[116]; -} HCCA_T; - - -/// @endcond - -#endif /* _USBH_OHCI_H_ */ diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/inc/usb.h b/bsp/nuvoton/libraries/m480/USBHostLib/inc/usb.h deleted file mode 100644 index 5d6772f27aa..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/inc/usb.h +++ /dev/null @@ -1,486 +0,0 @@ -/**************************************************************************//** - * @file usb.h - * @version V1.00 - * @brief USB Host library header file. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_H_ -#define _USBH_H_ - -#include "config.h" -#include "usbh_lib.h" -#include "ehci.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct hub_dev_t; -struct iface_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------*/ -/* USB device request setup packet */ -/*----------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ -typedef struct -{ - __packed uint8_t bmRequestType; - __packed uint8_t bRequest; - __packed uint16_t wValue; - __packed uint16_t wIndex; - __packed uint16_t wLength; -} DEV_REQ_T; -#else -typedef struct __attribute__((__packed__)) -{ - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} -DEV_REQ_T; -#endif - -/* - * bmRequestType[7] - Data transfer direction - */ -#define REQ_TYPE_OUT 0x00 -#define REQ_TYPE_IN 0x80 -/* - * bmRequestType[6:5] - Type - */ -#define REQ_TYPE_STD_DEV 0x00 -#define REQ_TYPE_CLASS_DEV 0x20 -#define REQ_TYPE_VENDOR_DEV 0x40 -/* - * bmRequestType[4:0] - Recipient - */ -#define REQ_TYPE_TO_DEV 0x00 -#define REQ_TYPE_TO_IFACE 0x01 -#define REQ_TYPE_TO_EP 0x02 -#define REQ_TYPE_TO_OTHER 0x03 -/* - * Standard Requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_SET_INTERFACE 0x0B -/* - * Descriptor Types - */ -#define USB_DT_STANDARD 0x00 -#define USB_DT_CLASS 0x20 -#define USB_DT_VENDOR 0x40 - -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIGURATION 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 -#define USB_DT_DEVICE_QUALIFIER 0x06 -#define USB_DT_OTHER_SPEED_CONF 0x07 -#define USB_DT_IFACE_POWER 0x08 - - - -/*----------------------------------------------------------------------------------*/ -/* USB standard descriptors */ -/*----------------------------------------------------------------------------------*/ - -/* Descriptor header */ -#ifdef __ICCARM__ -typedef struct -{ - __packed uint8_t bLength; - __packed uint8_t bDescriptorType; -} DESC_HDR_T; -#else -typedef struct __attribute__((__packed__)) -{ - uint8_t bLength; - uint8_t bDescriptorType; -} -DESC_HDR_T; -#endif - -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ -typedef struct /*!< device descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of device descriptor */ - __packed uint8_t bDescriptorType; /*!< Device descriptor type */ - __packed uint16_t bcdUSB; /*!< USB version number */ - __packed uint8_t bDeviceClass; /*!< Device class code */ - __packed uint8_t bDeviceSubClass; /*!< Device subclass code */ - __packed uint8_t bDeviceProtocol; /*!< Device protocol code */ - __packed uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - __packed uint16_t idVendor; /*!< Vendor ID */ - __packed uint16_t idProduct; /*!< Product ID */ - __packed uint16_t bcdDevice; /*!< Device ID */ - __packed uint8_t iManufacturer; /*!< Manufacture description string ID */ - __packed uint8_t iProduct; /*!< Product description string ID */ - __packed uint8_t iSerialNumber; /*!< Serial number description string ID */ - __packed uint8_t bNumConfigurations; /*!< Total number of configurations */ -} DESC_DEV_T; /*!< device descriptor structure */ -#else -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) /*!< device descriptor structure */ -{ - uint8_t bLength; /*!< Length of device descriptor */ - uint8_t bDescriptorType; /*!< Device descriptor type */ - uint16_t bcdUSB; /*!< USB version number */ - uint8_t bDeviceClass; /*!< Device class code */ - uint8_t bDeviceSubClass; /*!< Device subclass code */ - uint8_t bDeviceProtocol; /*!< Device protocol code */ - uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - uint16_t idVendor; /*!< Vendor ID */ - uint16_t idProduct; /*!< Product ID */ - uint16_t bcdDevice; /*!< Device ID */ - uint8_t iManufacturer; /*!< Manufacture description string ID */ - uint8_t iProduct; /*!< Product description string ID */ - uint8_t iSerialNumber; /*!< Serial number description string ID */ - uint8_t bNumConfigurations; /*!< Total number of configurations */ -} -DESC_DEV_T; /*!< device descriptor structure */ -#endif - -/* - * Configuration Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_config_descriptor /*!< Configuration descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of configuration descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint16_t wTotalLength; /*!< Total length of this configuration */ - __packed uint8_t bNumInterfaces; /*!< Total number of interfaces */ - __packed uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - __packed uint8_t iConfiguration; /*!< String descriptor ID */ - __packed uint8_t bmAttributes; /*!< Configuration characteristics */ - __packed uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_config_descriptor /*!< Configuration descriptor structure */ -{ - uint8_t bLength; /*!< Length of configuration descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint16_t wTotalLength; /*!< Total length of this configuration */ - uint8_t bNumInterfaces; /*!< Total number of interfaces */ - uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - uint8_t iConfiguration; /*!< String descriptor ID */ - uint8_t bmAttributes; /*!< Configuration characteristics */ - uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ -#endif - -/* - * Interface Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_interface_descriptor /*!< Interface descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of interface descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint8_t bInterfaceNumber; /*!< Interface number */ - __packed uint8_t bAlternateSetting;/*!< Alternate setting number */ - __packed uint8_t bNumEndpoints; /*!< Number of endpoints */ - __packed uint8_t bInterfaceClass; /*!< Interface class code */ - __packed uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - __packed uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - __packed uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_interface_descriptor /*!< Interface descriptor structure */ -{ - uint8_t bLength; /*!< Length of interface descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bInterfaceNumber; /*!< Interface number */ - uint8_t bAlternateSetting; /*!< Alternate setting number */ - uint8_t bNumEndpoints; /*!< Number of endpoints */ - uint8_t bInterfaceClass; /*!< Interface class code */ - uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ -#endif - -/* - * Interface descriptor bInterfaceClass[7:0] - */ -#if 0 -#define USB_CLASS_AUDIO 0x01 -#define USB_CLASS_COMM 0x02 -#define USB_CLASS_HID 0x03 -#define USB_CLASS_PRINTER 0x07 -#define USB_CLASS_MASS_STORAGE 0x08 -#define USB_CLASS_HUB 0x09 -#define USB_CLASS_DATA 0x0A -#define USB_CLASS_VIDEO 0x0E -#endif -/* - * Endpoint Descriptor - */ -#ifdef __ICCARM__ -typedef struct usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - __packed uint8_t bLength; /*!< Length of endpoint descriptor */ - __packed uint8_t bDescriptorType; /*!< Descriptor type */ - __packed uint8_t bEndpointAddress; /*!< Endpoint address */ - __packed uint8_t bmAttributes; /*!< Endpoint attribute */ - __packed uint16_t wMaxPacketSize; /*!< Maximum packet size */ - __packed uint8_t bInterval; /*!< Synchronous transfer interval */ - __packed uint8_t bRefresh; /*!< Refresh */ - __packed uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ -#else -typedef struct __attribute__((__packed__)) usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - uint8_t bLength; /*!< Length of endpoint descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bEndpointAddress; /*!< Endpoint address */ - uint8_t bmAttributes; /*!< Endpoint attribute */ - uint16_t wMaxPacketSize; /*!< Maximum packet size */ - uint8_t bInterval; /*!< Synchronous transfer interval */ - uint8_t bRefresh; /*!< Refresh */ - uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ -#endif - -/* - * Endpoint descriptor bEndpointAddress[7] - direction - */ -#define EP_ADDR_DIR_MASK 0x80 -#define EP_ADDR_DIR_IN 0x80 -#define EP_ADDR_DIR_OUT 0x00 - -/* - * Endpoint descriptor bmAttributes[1:0] - transfer type - */ -#define EP_ATTR_TT_MASK 0x03 -#define EP_ATTR_TT_CTRL 0x00 -#define EP_ATTR_TT_ISO 0x01 -#define EP_ATTR_TT_BULK 0x02 -#define EP_ATTR_TT_INT 0x03 - - -/*----------------------------------------------------------------------------------*/ -/* USB Host controller driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*init) (void); - void (*shutdown) (void); - void (*suspend) (void); - void (*resume) (void); - int (*ctrl_xfer)(struct utr_t *utr); - int (*bulk_xfer)(struct utr_t *utr); - int (*int_xfer)(struct utr_t *utr); - int (*iso_xfer)(struct utr_t *utr); - int (*quit_xfer)(struct utr_t *utr, struct ep_info_t *ep); - - /* root hub support */ - int (*rthub_port_reset)(int port); - int (*rthub_polling) (void); -} HC_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*probe) (struct iface_t *iface); - void (*disconnect) (struct iface_t *iface); - void (*suspend) (struct iface_t *iface); - void (*resume) (struct iface_t *iface); -} UDEV_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device */ -/*----------------------------------------------------------------------------------*/ - -typedef enum -{ - SPEED_LOW, - SPEED_FULL, - SPEED_HIGH -} SPEED_E; - -typedef struct ep_info_t -{ - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint8_t bInterval; - uint8_t bToggle; - uint16_t wMaxPacketSize; - void *hw_pipe; /*!< point to the HC assocaied endpoint \hideinitializer */ -} EP_INFO_T; - -typedef struct udev_t -{ - DESC_DEV_T descriptor; /*!< Device descriptor. \hideinitializer */ - struct hub_dev_t *parent; /*!< parent hub device \hideinitializer */ - uint8_t port_num; /*!< The hub port this device connected on \hideinitializer */ - uint8_t dev_num; /*!< device number \hideinitializer */ - int8_t cur_conf; /*!< Currentll selected configuration \hideinitializer */ - SPEED_E speed; /*!< device speed (low/full/high) \hideinitializer */ - /* - * The followings are lightweight USB stack internal used . - */ - uint8_t *cfd_buff; /*!< Configuration descriptor buffer. \hideinitializer */ - EP_INFO_T ep0; /*!< Endpoint 0 \hideinitializer */ - HC_DRV_T *hc_driver; /*!< host controller driver \hideinitializer */ - struct iface_t *iface_list; /*!< Working interface list \hideinitializer */ - struct udev_t *next; /*!< link for global usb device list \hideinitializer */ -} UDEV_T; - -typedef struct alt_iface_t -{ - DESC_IF_T *ifd; /*!< point to the location of this alternative interface descriptor in UDEV_T->cfd_buff */ - EP_INFO_T ep[MAX_EP_PER_IFACE]; /*!< endpoints of this alternative interface */ -} ALT_IFACE_T; - -typedef struct iface_t -{ - UDEV_T *udev; /*!< USB device \hideinitializer */ - uint8_t if_num; /*!< Interface number \hideinitializer */ - uint8_t num_alt; /*!< Number of alternative interface \hideinitializer */ - ALT_IFACE_T *aif; /*!< Point to the active alternative interface */ - ALT_IFACE_T alt[MAX_ALT_PER_IFACE]; /*!< List of alternative interface \hideinitializer */ - UDEV_DRV_T *driver; /*!< Interface associated driver \hideinitializer */ - void *context; /*!< Reference to device context \hideinitializer */ - struct iface_t *next; /*!< Point to next interface of the same device. Started from UDEV_T->iface_list \hideinitializer */ -} IFACE_T; - - -/*----------------------------------------------------------------------------------*/ -/* URB (USB Request Block) */ -/*----------------------------------------------------------------------------------*/ - -#define IF_PER_UTR 8 /* number of frames per UTR isochronous transfer (DO NOT modify it!) */ - -typedef void (*FUNC_UTR_T)(struct utr_t *); - -typedef struct utr_t -{ - UDEV_T *udev; /*!< point to associated USB device \hideinitializer */ - DEV_REQ_T setup; /*!< buffer for setup packet \hideinitializer */ - EP_INFO_T *ep; /*!< associated endpoint \hideinitializer */ - uint8_t *buff; /*!< transfer buffer \hideinitializer */ - uint8_t bIsTransferDone; /*!< tansfer done? \hideinitializer */ - uint32_t data_len; /*!< length of data to be transferred \hideinitializer */ - uint32_t xfer_len; /*!< length of transferred data \hideinitializer */ - uint8_t bIsoNewSched; /*!< New schedule isochronous transfer \hideinitializer */ - uint16_t iso_sf; /*!< Isochronous start frame number \hideinitializer */ - uint16_t iso_xlen[IF_PER_UTR]; /*!< transfer length of isochronous frames \hideinitializer */ - uint8_t * iso_buff[IF_PER_UTR]; /*!< transfer buffer address of isochronous frames \hideinitializer */ - int iso_status[IF_PER_UTR]; /*!< transfer status of isochronous frames \hideinitializer */ - int td_cnt; /*!< number of transfer descriptors \hideinitializer */ - int status; /*!< return status \hideinitializer */ - int interval; /*!< interrupt/isochronous interval \hideinitializer */ - void *context; /*!< point to deivce proprietary data area \hideinitializer */ - FUNC_UTR_T func; /*!< tansfer done call-back function \hideinitializer */ - struct utr_t *next; /* point to the next UTR of the same endpoint. \hideinitializer */ -} UTR_T; - - -/*----------------------------------------------------------------------------------*/ -/* Global variables */ -/*----------------------------------------------------------------------------------*/ -extern USBH_T *_ohci; -extern HSUSBH_T *_ehci; - -extern HC_DRV_T ohci_driver; -extern HC_DRV_T ehci_driver; - -extern UDEV_T * g_udev_list; - -/*----------------------------------------------------------------------------------*/ -/* USB stack exported functions */ -/*----------------------------------------------------------------------------------*/ -extern void usbh_delay_ms(int msec); - -extern void dump_ohci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ohci_int_table(void); -extern void dump_ehci_regs(void); -extern void dump_ehci_qtd(qTD_T *qtd); -extern void dump_ehci_asynclist(void); -extern void dump_ehci_period_frame_list_simple(void); -extern void usbh_dump_buff_bytes(uint8_t *buff, int nSize); -extern void usbh_dump_interface_descriptor(DESC_IF_T *if_desc); -extern void usbh_dump_endpoint_descriptor(DESC_EP_T *ep_desc); -extern void usbh_dump_iface(IFACE_T *iface); -extern void usbh_dump_ep_info(EP_INFO_T *ep); - -/* - * Memory management functions - */ -extern void usbh_memory_init(void); -extern uint32_t usbh_memory_used(void); -extern void * usbh_alloc_mem(int size); -extern void usbh_free_mem(void *p, int size); -extern int alloc_dev_address(void); -extern void free_dev_address(int dev_addr); -extern UDEV_T * alloc_device(void); -extern void free_device(UDEV_T *udev); -extern UTR_T * alloc_utr(UDEV_T *udev); -extern void free_utr(UTR_T *utr); -extern ED_T * alloc_ohci_ED(void); -extern void free_ohci_ED(ED_T *ed); -extern TD_T * alloc_ohci_TD(UTR_T *utr); -extern void free_ohci_TD(TD_T *td); -extern QH_T * alloc_ehci_QH(void); -extern void free_ehci_QH(QH_T *qh); -extern qTD_T * alloc_ehci_qTD(UTR_T *utr); -extern void free_ehci_qTD(qTD_T *qtd); -extern iTD_T * alloc_ehci_iTD(void); -extern void free_ehci_iTD(iTD_T *itd); -extern siTD_T * alloc_ehci_siTD(void); -extern void free_ehci_siTD(siTD_T *sitd); - - -extern void usbh_hub_init(void); -extern int usbh_connect_device(UDEV_T *); -extern void usbh_disconnect_device(UDEV_T *); -extern int usbh_register_driver(UDEV_DRV_T *driver); -extern EP_INFO_T * usbh_iface_find_ep(IFACE_T *iface, uint8_t ep_addr, uint8_t dir_type); -extern int usbh_reset_device(UDEV_T *); -extern int usbh_reset_port(UDEV_T *); - -/* - * USB Standard Request functions - */ -extern int usbh_get_device_descriptor(UDEV_T *udev, DESC_DEV_T *desc_buff); -extern int usbh_get_config_descriptor(UDEV_T *udev, uint8_t *desc_buff, int buff_len); -extern int usbh_set_configuration(UDEV_T *udev, uint8_t conf_val); -extern int usbh_set_interface(IFACE_T *iface, uint16_t alt_setting); -extern int usbh_clear_halt(UDEV_T *udev, uint16_t ep_addr); - -extern int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout); -extern int usbh_bulk_xfer(UTR_T *utr); -extern int usbh_int_xfer(UTR_T *utr); -extern int usbh_iso_xfer(UTR_T *utr); -extern int usbh_quit_utr(UTR_T *utr); -extern int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep); - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_H_ */ diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/inc/usbh_lib.h b/bsp/nuvoton/libraries/m480/USBHostLib/inc/usbh_lib.h deleted file mode 100644 index a4b86c9df6f..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/inc/usbh_lib.h +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************//** - * @file usbh_lib.h - * @version V1.10 - * @brief USB Host library exported header file. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef _USBH_LIB_H_ -#define _USBH_LIB_H_ - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup LIBRARY Library - @{ -*/ - -/** @addtogroup USBH_Library USB Host Library - @{ -*/ - -/** @addtogroup USBH_EXPORTED_CONSTANTS USB Host Exported Constants - @{ -*/ - -#define USBH_OK 0 /*!< No error. */ -#define USBH_ERR_MEMORY_OUT -10 /*!< Out of memory. */ -#define USBH_ERR_IF_ALT_LIMIT -11 /*!< Number of alternative interface > MAX_ALT_PER_IFACE */ -#define USBH_ERR_IF_EP_LIMIT -15 /*!< Number of endpoints > MAX_EP_PER_IFACE */ -#define USBH_ERR_NOT_SUPPORTED -101 /*!< Device/Class/Transfer not supported */ -#define USBH_ERR_NOT_MATCHED -103 /*!< Not macthed */ -#define USBH_ERR_NOT_EXPECTED -104 /*!< Unknown or unexpected */ -#define USBH_ERR_INVALID_PARAM -105 /*!< Invalid parameter */ -#define USBH_ERR_NOT_FOUND -106 /*!< Device or interface not found */ -#define USBH_ERR_EP_NOT_FOUND -107 /*!< Endpoint not found */ -#define USBH_ERR_DESCRIPTOR -137 /*!< Failed to parse USB descriptors */ -#define USBH_ERR_SET_DEV_ADDR -139 /*!< Failed to set device address */ -#define USBH_ERR_SET_CONFIG -151 /*!< Failed to set device configuration */ - -#define USBH_ERR_TRANSFER -201 /*!< USB transfer error */ -#define USBH_ERR_TIMEOUT -203 /*!< USB transfer time-out */ -#define USBH_ERR_ABORT -205 /*!< USB transfer aborted due to disconnect or reset */ -#define USBH_ERR_PORT_RESET -255 /*!< Hub port reset failed */ -#define USBH_ERR_SCH_OVERRUN -257 /*!< USB isochronous schedule overrun */ -#define USBH_ERR_DISCONNECTED -259 /*!< USB device was disconnected */ - -#define USBH_ERR_TRANSACTION -271 /*!< USB transaction timeout, CRC, Bad PID, etc. */ -#define USBH_ERR_BABBLE_DETECTED -272 /*!< A 'babble' is detected during the transaction */ -#define USBH_ERR_DATA_BUFF -274 /*!< Data buffer overrun or underrun */ - -#define USBH_ERR_CC_NO_ERR -280 /*!< OHCI CC code - no error */ -#define USBH_ERR_CRC -281 /*!< USB trasfer CRC error */ -#define USBH_ERR_BIT_STUFF -282 /*!< USB transfer bit stuffing error */ -#define USBH_ERR_DATA_TOGGLE -283 /*!< USB trasfer data toggle error */ -#define USBH_ERR_STALL -284 /*!< USB trasfer STALL error */ -#define USBH_ERR_DEV_NO_RESP -285 /*!< USB trasfer device no response error */ -#define USBH_ERR_PID_CHECK -286 /*!< USB trasfer PID check failure */ -#define USBH_ERR_UNEXPECT_PID -287 /*!< USB trasfer unexpected PID error */ -#define USBH_ERR_DATA_OVERRUN -288 /*!< USB trasfer data overrun error */ -#define USBH_ERR_DATA_UNDERRUN -289 /*!< USB trasfer data underrun error */ -#define USBH_ERR_BUFF_OVERRUN -292 /*!< USB trasfer buffer overrun error */ -#define USBH_ERR_BUFF_UNDERRUN -293 /*!< USB trasfer buffer underrun error */ -#define USBH_ERR_NOT_ACCESS0 -294 /*!< USB trasfer not accessed error */ -#define USBH_ERR_NOT_ACCESS1 -295 /*!< USB trasfer not accessed error */ - -#define USBH_ERR_OHCI_INIT -301 /*!< Failed to initialize OHIC controller. */ -#define USBH_ERR_OHCI_EP_BUSY -303 /*!< The endpoint is under transfer. */ - -#define USBH_ERR_EHCI_INIT -501 /*!< Failed to initialize EHCI controller. */ -#define USBH_ERR_EHCI_QH_BUSY -503 /*!< the Queue Head is busy. */ - -#define UMAS_OK 0 /*!< No error. */ -#define UMAS_ERR_NO_DEVICE -1031 /*!< No Mass Stroage Device found. */ -#define UMAS_ERR_IO -1033 /*!< Device read/write failed. */ -#define UMAS_ERR_INIT_DEVICE -1035 /*!< failed to init MSC device */ -#define UMAS_ERR_CMD_STATUS -1037 /*!< SCSI command status failed */ -#define UMAS_ERR_IVALID_PARM -1038 /*!< Invalid parameter. */ -#define UMAS_ERR_DRIVE_NOT_FOUND -1039 /*!< drive not found */ - -#define HID_RET_OK 0 /*!< Return with no errors. */ -#define HID_RET_DEV_NOT_FOUND -1081 /*!< HID device not found or removed. */ -#define HID_RET_IO_ERR -1082 /*!< USB transfer failed. */ -#define HID_RET_INVALID_PARAMETER -1083 /*!< Invalid parameter. */ -#define HID_RET_OUT_OF_MEMORY -1084 /*!< Out of memory. */ -#define HID_RET_NOT_SUPPORTED -1085 /*!< Function not supported. */ -#define HID_RET_EP_NOT_FOUND -1086 /*!< Endpoint not found. */ -#define HID_RET_PARSING -1087 /*!< Failed to parse HID descriptor */ -#define HID_RET_XFER_IS_RUNNING -1089 /*!< The transfer has been enabled. */ -#define HID_RET_REPORT_NOT_FOUND -1090 /*!< The transfer has been enabled. */ - -#define UAC_RET_OK 0 /*!< Return with no errors. */ -#define UAC_RET_DEV_NOT_FOUND -2001 /*!< Audio Class device not found or removed. */ -#define UAC_RET_FUNC_NOT_FOUND -2002 /*!< Audio device has no this function. */ -#define UAC_RET_IO_ERR -2003 /*!< USB transfer failed. */ -#define UAC_RET_DATA_LEN -2004 /*!< Unexpected transfer length */ -#define UAC_RET_INVALID -2005 /*!< Invalid parameter or usage. */ -#define UAC_RET_OUT_OF_MEMORY -2007 /*!< Out of memory. */ -#define UAC_RET_DRV_NOT_SUPPORTED -2009 /*!< Function not supported by this UAC driver. */ -#define UAC_RET_DEV_NOT_SUPPORTED -2011 /*!< Function not supported by the UAC device. */ -#define UAC_RET_PARSER -2013 /*!< Failed to parse UAC descriptor */ -#define UAC_RET_IS_STREAMING -2015 /*!< Audio pipe is on streaming. */ - - -/*@}*/ /* end of group USBH_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBH_EXPORTED_TYPEDEF USB Host Typedef - @{ -*/ -struct udev_t; -typedef void (CONN_FUNC)(struct udev_t *udev, int param); - -struct line_coding_t; -struct cdc_dev_t; -typedef void (CDC_CB_FUNC)(struct cdc_dev_t *cdev, uint8_t *rdata, int data_len); - -struct usbhid_dev; -typedef void (HID_IR_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *rdata, uint32_t data_len); /*!< interrupt in callback function \hideinitializer */ -typedef void (HID_IW_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *wbuff, uint32_t *data_len); /*!< interrupt out callback function \hideinitializer */ - -struct uac_dev_t; -typedef int (UAC_CB_FUNC)(struct uac_dev_t *dev, uint8_t *data, int len); /*!< audio in callback function \hideinitializer */ - -/*@}*/ /* end of group USBH_EXPORTED_STRUCT */ - - - -/** @addtogroup USBH_EXPORTED_FUNCTIONS USB Host Exported Functions - @{ -*/ - -/*------------------------------------------------------------------*/ -/* */ -/* USB Core Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_core_init(void); -extern int usbh_polling_root_hubs(void); -extern void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func); -extern void usbh_suspend(void); -extern void usbh_resume(void); -extern struct udev_t *usbh_find_device(char *hub_id, int port); - -/** - * @brief A function return current tick count. - * @return Current tick. - * @details User application must provide this function to return current tick. - * The tick should increase by 1 for every 10 ms. - */ -extern uint32_t usbh_get_ticks(void); /* This function must be provided by user application. */ -extern uint32_t usbh_tick_from_millisecond(uint32_t msec); /* This function must be provided by user application. */ - - -/// @cond HIDDEN_SYMBOLS - -extern void dump_ohci_regs(void); -extern void dump_ehci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ehci_ports(void); -extern uint32_t usbh_memory_used(void); - -/// @endcond HIDDEN_SYMBOLS - - -/*@}*/ /* end of group USBH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBH_Library */ - -/*@}*/ /* end of group LIBRARY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _USBH_LIB_H_ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/src/ehci.c b/bsp/nuvoton/libraries/m480/USBHostLib/src/ehci.c deleted file mode 100644 index ff1a207b7c5..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/src/ehci.c +++ /dev/null @@ -1,1312 +0,0 @@ -/**************************************************************************//** - * @file ehci.c - * @version V1.10 - * @brief USB Host library EHCI (USB 2.0) host controller driver. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -static QH_T *_H_qh; /* head of reclamation list */ -static qTD_T *_ghost_qtd; /* used as a terminator qTD */ -static QH_T *qh_remove_list; - -extern ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ -extern int ehci_iso_xfer(UTR_T *utr); /* EHCI isochronous transfer function */ -extern int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep); - -#ifdef __ICCARM__ - #pragma data_alignment=4096 - uint32_t _PFList[FL_SIZE]; /* Periodic frame list (IAR) */ -#else - uint32_t _PFList[FL_SIZE] __attribute__((aligned(4096))); /* Periodic frame list */ -#endif - -QH_T *_Iqh[NUM_IQH]; - - -#ifdef ENABLE_ERROR_MSG -void dump_ehci_regs() -{ - USB_debug("Dump HSUSBH(EHCI) registers:\n"); - USB_debug(" UCMDR = 0x%x\n", _ehci->UCMDR); - USB_debug(" USTSR = 0x%x\n", _ehci->USTSR); - USB_debug(" UIENR = 0x%x\n", _ehci->UIENR); - USB_debug(" UFINDR = 0x%x\n", _ehci->UFINDR); - USB_debug(" UPFLBAR = 0x%x\n", _ehci->UPFLBAR); - USB_debug(" UCALAR = 0x%x\n", _ehci->UCALAR); - USB_debug(" UASSTR = 0x%x\n", _ehci->UASSTR); - USB_debug(" UCFGR = 0x%x\n", _ehci->UCFGR); - USB_debug(" UPSCR = 0x%x\n", _ehci->UPSCR[0]); - USB_debug(" PHYCTL0 = 0x%x\n", _ehci->USBPCR0); - USB_debug(" PHYCTL1 = 0x%x\n", _ehci->USBPCR1); -} - -void dump_ehci_ports() -{ - USB_debug("_ehci port0=0x%x, port1=0x%x\n", _ehci->UPSCR[0], _ehci->UPSCR[1]); -} - -void dump_ehci_qtd(qTD_T *qtd) -{ - USB_debug(" [qTD] - 0x%08x\n", (int)qtd); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qtd->Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qtd->Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token) PID: %s, Bytes: %d, IOC: %d\n", qtd->Token, (((qtd->Token >> 8) & 0x3) == 0) ? "OUT" : ((((qtd->Token >> 8) & 0x3) == 1) ? "IN" : "SETUP"), (qtd->Token >> 16) & 0x7FFF, (qtd->Token >> 15) & 0x1); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qtd->Bptr[0]); - //USB_debug(" 0x%08x (Buffer Pointer (page 1))\n", qtd->Bptr[1]); - //USB_debug(" 0x%08x (Buffer Pointer (page 2))\n", qtd->Bptr[2]); - //USB_debug(" 0x%08x (Buffer Pointer (page 3))\n", qtd->Bptr[3]); - //USB_debug(" 0x%08x (Buffer Pointer (page 4))\n", qtd->Bptr[4]); - USB_debug("\n"); -} - -void dump_ehci_asynclist(void) -{ - QH_T *qh = _H_qh; - qTD_T *qtd; - - USB_debug(">>> Dump EHCI Asynchronous List <<<\n"); - do - { - USB_debug("[QH] - 0x%08x\n", (int)qh); - USB_debug(" 0x%08x (Queue Head Horizontal Link Pointer, Queue Head DWord 0)\n", qh->HLink); - USB_debug(" 0x%08x (Endpoint Characteristics) DevAddr: %d, EP: 0x%x, PktSz: %d, Speed: %s\n", qh->Chrst, qh->Chrst & 0x7F, (qh->Chrst >> 8) & 0xF, (qh->Chrst >> 16) & 0x7FF, ((qh->Chrst >> 12) & 0x3 == 0) ? "Full" : (((qh->Chrst >> 12) & 0x3 == 1) ? "Low" : "High")); - USB_debug(" 0x%08x (Endpoint Capabilities: Queue Head DWord 2)\n", qh->Cap); - USB_debug(" 0x%08x (Current qtd Pointer)\n", qh->Curr_qTD); - USB_debug(" --- Overlay Area ---\n"); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qh->OL_Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qh->OL_Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token)\n", qh->OL_Token); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qh->OL_Bptr[0]); - USB_debug("\n"); - - qtd = QTD_PTR(qh->Curr_qTD); - while (qtd != NULL) - { - dump_ehci_qtd(qtd); - qtd = QTD_PTR(qtd->Next_qTD); - } - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); -} - -void dump_ehci_asynclist_simple(void) -{ - QH_T *qh = _H_qh; - - USB_debug(">>> EHCI Asynchronous List <<<\n"); - USB_debug("[QH] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list_simple(void) -{ - QH_T *qh = _Iqh[NUM_IQH - 1]; - - USB_debug(">>> EHCI period frame list simple <<<\n"); - USB_debug("[FList] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != NULL); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list() -{ - int i; - QH_T *qh; - - for (i = 0; i < FL_SIZE; i++) - { - USB_debug("!%02d: ", i); - qh = QH_PTR(_PFList[i]);; - while (qh != NULL) - { - // USB_debug("0x%x (0x%x) => ", (int)qh, qh->HLink); - USB_debug("0x%x => ", (int)qh); - qh = QH_PTR(qh->HLink); - } - USB_debug("0\n"); - } -} - -#endif /* ENABLE_ERROR_MSG */ - -static void init_periodic_frame_list() -{ - QH_T *qh_p; - int i, idx, interval; - - memset(_PFList, 0, sizeof(_PFList)); - - iso_ep_list = NULL; - - for (i = NUM_IQH - 1; i >= 0; i--) /* interval = i^2 */ - { - _Iqh[i] = alloc_ehci_QH(); - - _Iqh[i]->HLink = QH_HLNK_END; - _Iqh[i]->Curr_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Next_qTD = QTD_LIST_END; - _Iqh[i]->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Token = QTD_STS_HALT; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < FL_SIZE; idx += interval) - { - if (_PFList[idx] == 0) /* is empty list, insert directly */ - { - _PFList[idx] = QH_HLNK_QH(_Iqh[i]); - } - else - { - qh_p = QH_PTR(_PFList[idx]); - - while (1) - { - if (qh_p == _Iqh[i]) - break; /* already chained by previous visit */ - - if (qh_p->HLink == QH_HLNK_END) /* reach end of list? */ - { - qh_p->HLink = QH_HLNK_QH(_Iqh[i]); - break; - } - qh_p = QH_PTR(qh_p->HLink); - } - } - } - } -} - -static QH_T *get_int_tree_head_node(int interval) -{ - int i; - - interval /= 8; /* each frame list entry for 8 micro-frame */ - - for (i = 0; i < NUM_IQH - 1; i++) - { - interval >>= 1; - if (interval == 0) - return _Iqh[i]; - } - return _Iqh[NUM_IQH - 1]; -} - -static int make_int_s_mask(int bInterval) -{ - int order, interval; - - interval = 1; - while (bInterval > 1) - { - interval *= 2; - bInterval--; - } - - if (interval < 2) - return 0xFF; /* interval 1 */ - if (interval < 4) - return 0x55; /* interval 2 */ - if (interval < 8) - return 0x22; /* interval 4 */ - for (order = 0; (interval > 1); order++) - { - interval >>= 1; - } - return (0x1 << (order % 8)); -} - -static int ehci_init(void) -{ - int timeout = 250 * 1000; /* EHCI reset time-out 250 ms */ - - /*------------------------------------------------------------------------------------*/ - /* Reset EHCI host controller */ - /*------------------------------------------------------------------------------------*/ - _ehci->UCMDR = HSUSBH_UCMDR_HCRST_Msk; - while ((_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) && (timeout > 0)) - { - usbh_delay_ms(1); - timeout -= 1000; - } - if (_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) - return USBH_ERR_EHCI_INIT; - - _ehci->UCMDR = UCMDR_INT_THR_CTRL | HSUSBH_UCMDR_RUN_Msk; - - _ghost_qtd = alloc_ehci_qTD(NULL); - _ghost_qtd->Token = 0x11197B3F; //QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It represents a qhost qTD. - - /*------------------------------------------------------------------------------------*/ - /* Initialize asynchronous list */ - /*------------------------------------------------------------------------------------*/ - qh_remove_list = NULL; - - /* Create the QH list head with H-bit 1 */ - _H_qh = alloc_ehci_QH(); - _H_qh->HLink = QH_HLNK_QH(_H_qh); /* circular link to itself, the only one QH */ - _H_qh->Chrst = QH_RCLM_LIST_HEAD; /* it's the head of reclamation list */ - _H_qh->Curr_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Next_qTD = QTD_LIST_END; - _H_qh->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Token = QTD_STS_HALT; - _ehci->UCALAR = (uint32_t)_H_qh; - - /*------------------------------------------------------------------------------------*/ - /* Initialize periodic list */ - /*------------------------------------------------------------------------------------*/ - if (FL_SIZE == 256) - _ehci->UCMDR |= (0x2 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 512) - _ehci->UCMDR |= (0x1 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 1024) - _ehci->UCMDR |= (0x0 << HSUSBH_UCMDR_FLSZ_Pos); - else - return USBH_ERR_EHCI_INIT; /* Invalid FL_SIZE setting! */ - - _ehci->UPFLBAR = (uint32_t)_PFList; - - /*------------------------------------------------------------------------------------*/ - /* start run */ - /*------------------------------------------------------------------------------------*/ - - _ehci->UCFGR = 0x1; /* enable port routing to EHCI */ - _ehci->UIENR = HSUSBH_UIENR_USBIEN_Msk | HSUSBH_UIENR_UERRIEN_Msk | HSUSBH_UIENR_HSERREN_Msk | HSUSBH_UIENR_IAAEN_Msk; - - usbh_delay_ms(1); /* delay 1 ms */ - - _ehci->UPSCR[0] = HSUSBH_UPSCR_PP_Msk; /* enable port 1 port power */ - _ehci->UPSCR[1] = HSUSBH_UPSCR_PP_Msk | HSUSBH_UPSCR_PO_Msk; /* set port 2 owner to OHCI */ - - init_periodic_frame_list(); - - usbh_delay_ms(10); /* delay 10 ms */ - - return 0; -} - -static void ehci_suspend(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] |= HSUSBH_UPSCR_SUSPEND_Msk; -} - -static void ehci_resume(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] = (HSUSBH->UPSCR[0] & ~HSUSBH_UPSCR_SUSPEND_Msk) | HSUSBH_UPSCR_FPR_Msk; -} - -static void ehci_shutdown(void) -{ - ehci_suspend(); -} - -static void move_qh_to_remove_list(QH_T *qh) -{ - QH_T *q; - - // USB_debug("move_qh_to_remove_list - 0x%x (0x%x)\n", (int)qh, qh->Chrst); - - /* check if this ED found in ed_remove_list */ - q = qh_remove_list; - while (q) - { - if (q == qh) /* This QH found in qh_remove_list. */ - { - return; /* Do nothing, return... */ - } - q = q->next; - } - - DISABLE_EHCI_IRQ(); - - /*------------------------------------------------------------------------------------*/ - /* Search asynchronous frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _H_qh; /* find and remove it from asynchronous list */ - while (QH_PTR(q->HLink) != _H_qh) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - - /*------------------------------------------------------------------------------------*/ - /* Search periodic frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _Iqh[NUM_IQH - 1]; - while (q->HLink != QH_HLNK_END) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - ENABLE_EHCI_IRQ(); -} - -static void append_to_qtd_list_of_QH(QH_T *qh, qTD_T *qtd) -{ - qTD_T *q; - - if (qh->qtd_list == NULL) - { - qh->qtd_list = qtd; - } - else - { - q = qh->qtd_list; - while (q->next != NULL) - { - q = q->next; - } - q->next = qtd; - } -} - -/* - * If ep==NULL, it's a control endpoint QH. - */ -static void write_qh(UDEV_T *udev, EP_INFO_T *ep, QH_T *qh) -{ - uint32_t chrst, cap; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 1 - Endpoint Characteristics */ - /*------------------------------------------------------------------------------------*/ - if (ep == NULL) /* is control endpoint? */ - { - if (udev->descriptor.bMaxPacketSize0 == 0) - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - chrst = QH_DTC | QH_NAK_RL | (udev->descriptor.bMaxPacketSize0 << 16); - if (udev->speed != SPEED_HIGH) - chrst |= QH_CTRL_EP_FLAG; /* non-high-speed control endpoint */ - } - else /* not a control endpoint */ - { - chrst = QH_NAK_RL | (ep->wMaxPacketSize << 16); - chrst |= ((ep->bEndpointAddress & 0xf) << 8); /* Endpoint Address */ - } - - if (udev->speed == SPEED_LOW) - chrst |= QH_EPS_LOW; - else if (udev->speed == SPEED_FULL) - chrst |= QH_EPS_FULL; - else - chrst |= QH_EPS_HIGH; - - chrst |= udev->dev_num; - - qh->Chrst = chrst; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 2 - Endpoint Capabilities */ - /*------------------------------------------------------------------------------------*/ - if (udev->speed == SPEED_HIGH) - { - cap = 0; - } - else - { - /* - * Backtrace device tree until the USB 2.0 hub found - */ - HUB_DEV_T *hub; - int port_num; - - port_num = udev->port_num; - hub = udev->parent; - - while ((hub != NULL) && (hub->iface->udev->speed != SPEED_HIGH)) - { - port_num = hub->iface->udev->port_num; - hub = hub->iface->udev->parent; - } - - cap = (port_num << QH_HUB_PORT_Pos) | - (hub->iface->udev->dev_num << QH_HUB_ADDR_Pos); - } - - qh->Cap = cap; -} - -static void write_qtd_bptr(qTD_T *qtd, uint32_t buff_addr, int xfer_len) -{ - int i; - - qtd->xfer_len = xfer_len; - qtd->Bptr[0] = buff_addr; - - buff_addr = (buff_addr + 0x1000) & ~0xFFF; - - for (i = 1; i < 5; i++) - { - qtd->Bptr[i] = buff_addr; - buff_addr += 0x1000; - } -} - -static int ehci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - QH_T *qh; - qTD_T *qtd_setup, *qtd_data, *qtd_status; - uint32_t token; - int is_new_qh = 0; - - udev = utr->udev; - - if (utr->data_len > 0) - { - if (((uint32_t)utr->buff + utr->data_len) > (((uint32_t)utr->buff & ~0xFFF) + 0x5000)) - return USBH_ERR_BUFF_OVERRUN; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate and link QH */ - /*------------------------------------------------------------------------------------*/ - if (udev->ep0.hw_pipe != NULL) - { - qh = (QH_T *)udev->ep0.hw_pipe; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - - udev->ep0.hw_pipe = (void *)qh; /* driver can find QH from EP */ - is_new_qh = 1; - } - write_qh(udev, NULL, qh); - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - - /*------------------------------------------------------------------------------------*/ - /* Allocate qTDs */ - /*------------------------------------------------------------------------------------*/ - qtd_setup = alloc_ehci_qTD(utr); /* allocate qTD for SETUP */ - - if (utr->data_len > 0) - qtd_data = alloc_ehci_qTD(utr); /* allocate qTD for DATA */ - else - qtd_data = NULL; - - qtd_status = alloc_ehci_qTD(utr); /* allocate qTD for USTSR */ - - if (qtd_status == NULL) /* out of memory? */ - { - if (qtd_setup) - free_ehci_qTD(qtd_setup); /* free memory */ - if (qtd_data) - free_ehci_qTD(qtd_data); /* free memory */ - return USBH_ERR_MEMORY_OUT; /* out of memory */ - } - - // USB_debug("qh=0x%x, qtd_setup=0x%x, qtd_data=0x%x, qtd_status=0x%x\n", (int)qh, (int)qtd_setup, (int)qtd_data, (int)qtd_status); - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_setup->qh = qh; - //qtd_setup->utr = utr; - write_qtd_bptr(qtd_setup, (uint32_t)&utr->setup, 8); - append_to_qtd_list_of_QH(qh, qtd_setup); - qtd_setup->Token = (8 << 16) | QTD_ERR_COUNTER | QTD_PID_SETUP | QTD_STS_ACTIVE; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage qTD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - qtd_setup->Next_qTD = (uint32_t)qtd_data; - qtd_data->Next_qTD = (uint32_t)qtd_status; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd_data->qh = qh; - //qtd_data->utr = utr; - write_qtd_bptr(qtd_data, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd_data); - qtd_data->Token = QTD_DT | (utr->data_len << 16) | token; - } - else - { - qtd_setup->Next_qTD = (uint32_t)qtd_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare USTSR stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_status->Next_qTD = (uint32_t)_ghost_qtd; - qtd_status->Alt_Next_qTD = QTD_LIST_END; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - - qtd_status->qh = qh; - //qtd_status->utr = utr; - append_to_qtd_list_of_QH(qh, qtd_status); - qtd_status->Token = QTD_DT | QTD_IOC | token; - - /*------------------------------------------------------------------------------------*/ - /* Update QH overlay */ - /*------------------------------------------------------------------------------------*/ - qh->Curr_qTD = 0; - qh->OL_Next_qTD = (uint32_t)qtd_setup; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = 0; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - return 0; -} - -static int ehci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh; - qTD_T *qtd, *qtd_pre; - uint32_t data_len, xfer_len; - uint8_t *buff; - uint32_t token; - int is_new_qh = 0; - - //USB_debug("Bulk XFER =>\n"); - // dump_ehci_asynclist_simple(); - - udev = utr->udev; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - { - return USBH_ERR_EHCI_QH_BUSY; - } - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTDs */ - /*------------------------------------------------------------------------------------*/ - data_len = utr->data_len; - buff = utr->buff; - qtd_pre = NULL; - - while (data_len > 0) - { - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - qtd = qh->qtd_list; - while (qtd != NULL) - { - qtd_pre = qtd; - qtd = qtd->next; - free_ehci_qTD(qtd_pre); - } - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - if (data_len > 0x4000) /* force maximum x'fer length 16K per qTD */ - xfer_len = 0x4000; - else - xfer_len = data_len; /* remaining data length < 4K */ - - qtd->qh = qh; - qtd->Next_qTD = (uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)buff, xfer_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = (xfer_len << 16) | token; - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - if (data_len == 0) /* is this the latest qTD? */ - { - qtd->Token |= QTD_IOC; /* ask to raise an interrupt on the last qTD */ - qtd->Next_qTD = (uint32_t)_ghost_qtd; /* qTD list end */ - } - - if (qtd_pre != NULL) - qtd_pre->Next_qTD = (uint32_t)qtd; - qtd_pre = qtd; - } - - //USB_debug("utr=0x%x, qh=0x%x, qtd=0x%x\n", (int)utr, (int)qh, (int)qh->qtd_list); - - qtd = qh->qtd_list; - -// qh->Curr_qTD = 0; //(uint32_t)qtd; - qh->OL_Next_qTD = (uint32_t)qtd; -// qh->OL_Alt_Next_qTD = QTD_LIST_END; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - - qh->OL_Token = 0; //qtd->Token; - - if (utr->ep->bToggle) - qh->OL_Token |= QTD_DT; - - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - - return 0; -} - -static int ehci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh, *iqh; - qTD_T *qtd, *dummy_qtd; - uint32_t token; - - dummy_qtd = alloc_ehci_qTD(NULL); /* allocate a new dummy qTD */ - if (dummy_qtd == NULL) - return USBH_ERR_MEMORY_OUT; - dummy_qtd->Token &= ~(QTD_STS_ACTIVE | QTD_STS_HALT); - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - { - free_ehci_qTD(dummy_qtd); - return USBH_ERR_MEMORY_OUT; - } - write_qh(udev, ep, qh); - qh->Chrst &= ~0xF0000000; - - if (udev->speed == SPEED_HIGH) - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & 0xff) | make_int_s_mask(ep->bInterval); - } - else - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & ~(QH_C_MASK_Msk | QH_S_MASK_Msk)) | 0x7802; - } - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - - /* - * Allocate another dummy qTD - */ - qtd = alloc_ehci_qTD(NULL); /* allocate a new dummy qTD */ - if (qtd == NULL) - { - free_ehci_qTD(dummy_qtd); - free_ehci_QH(qh); - return USBH_ERR_MEMORY_OUT; - } - qtd->Token &= ~(QTD_STS_ACTIVE | QTD_STS_HALT); - - qh->dummy = dummy_qtd; - qh->OL_Next_qTD = (uint32_t)dummy_qtd; - qh->OL_Token = 0; /* !Active & !Halted */ - - /* - * link QH - */ - if (udev->speed == SPEED_HIGH) /* get head node of this interval */ - iqh = get_int_tree_head_node(ep->bInterval); - else - iqh = get_int_tree_head_node(ep->bInterval * 8); - qh->HLink = iqh->HLink; /* Add to list of the same interval */ - iqh->HLink = QH_HLNK_QH(qh); - - dummy_qtd = qtd; - } - - qtd = qh->dummy; /* use the current dummy qTD */ - qtd->Next_qTD = (uint32_t)dummy_qtd; - qtd->utr = utr; - qh->dummy = dummy_qtd; /* give the new dummy qTD */ - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTD */ - /*------------------------------------------------------------------------------------*/ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT; - else - token = QTD_ERR_COUNTER | QTD_PID_IN; - - qtd->qh = qh; - qtd->Alt_Next_qTD = QTD_LIST_END; - write_qtd_bptr(qtd, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = QTD_IOC | (utr->data_len << 16) | token | QTD_STS_ACTIVE; - - // printf("ehci_int_xfer - qh: 0x%x, 0x%x, 0x%x\n", (int)qh, (int)qh->Chrst, (int)qh->Cap); - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; -} - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ehci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - QH_T *qh; - - // USB_debug("ehci_quit_xfer - utr: 0x%x, ep: 0x%x\n", (int)utr, (int)ep); - - DISABLE_EHCI_IRQ(); - if (ehci_quit_iso_xfer(utr, ep) == 0) - { - ENABLE_EHCI_IRQ(); - return 0; - } - ENABLE_EHCI_IRQ(); - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - qh = (QH_T *)(utr->ep->hw_pipe); - - if (!qh) - return USBH_ERR_NOT_FOUND; - - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - qh = (QH_T *)(ep->hw_pipe); - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - ep->hw_pipe = NULL; - } - usbh_delay_ms(2); - - return 0; -} - -static int visit_qtd(qTD_T *qtd) -{ - if ((qtd->Token == 0x11197B3F) || (qtd->Token == 0x1197B3F)) - return 0; /* A Dummy qTD or qTD on writing, don't touch it. */ - - // USB_debug("Visit qtd 0x%x - 0x%x\n", (int)qtd, qtd->Token); - - if ((qtd->Token & QTD_STS_ACTIVE) == 0) - { - if (qtd->Token & (QTD_STS_HALT | QTD_STS_DATA_BUFF_ERR | QTD_STS_BABBLE | QTD_STS_XactErr | QTD_STS_MISS_MF)) - { - USB_error("qTD error token=0x%x! 0x%x\n", qtd->Token, qtd->Bptr[0]); - if (qtd->utr->status == 0) - qtd->utr->status = USBH_ERR_TRANSACTION; - } - else - { - if ((qtd->Token & QTD_PID_Msk) != QTD_PID_SETUP) - { - qtd->utr->xfer_len += qtd->xfer_len - QTD_TODO_LEN(qtd->Token); - // USB_debug("0x%x utr->xfer_len += %d\n", qtd->Token, qtd->xfer_len - QTD_TODO_LEN(qtd->Token)); - } - } - return 1; - } - return 0; -} - -static void scan_asynchronous_list() -{ - QH_T *qh, *qh_tmp; - qTD_T *q_pre = NULL, *qtd, *qtd_tmp; - UTR_T *utr; - - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - // USB_debug("Scan qh=0x%x, 0x%x\n", (int)qh, qh->OL_Token); - - utr = NULL; - qtd = qh->qtd_list; - while (qtd != NULL) - { - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - /* qTD is completed, will remove it */ - utr = qtd->utr; - if (qtd == qh->qtd_list) - qh->qtd_list = qtd->next; /* unlink the qTD from qtd_list */ - else - q_pre->next = qtd->next; /* unlink the qTD from qtd_list */ - - qtd_tmp = qtd; /* remember this qTD for freeing later */ - qtd = qtd->next; /* advance to the next qTD */ - - qtd_tmp->next = qh->done_list; /* push this qTD to QH's done list */ - qh->done_list = qtd_tmp; - } - else - { - q_pre = qtd; /* remember this qTD as a preceder */ - qtd = qtd->next; /* advance to next qTD */ - } - } - - qh_tmp = qh; - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qh_tmp->qtd_list == NULL) && utr) - { - // printf("T %d [%d]\n", (qh_tmp->Chrst>>8)&0xf, (qh_tmp->OL_Token&QTD_DT) ? 1 : 0); - if (qh_tmp->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - } -} - -static void scan_periodic_frame_list() -{ - QH_T *qh; - qTD_T *qtd, *qNext; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Scan interrupt frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - qtd = qh->qtd_list; - - if (qtd == NULL) - { - /* empty QH */ - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - continue; - } - - while (qtd != NULL) - { - qNext = qtd->next; - - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - qh->qtd_list = qtd->next; /* proceed to next qTD or NULL */ - qtd->next = qh->done_list; /* push qTD into the done list */ - qh->done_list = qtd; /* move qTD to done list */ - } - qtd = qNext; - } - - qtd = qh->done_list; - - while (qtd != NULL) - { - utr = qtd->utr; - - if (qh->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - - qtd = qtd->next; - } - - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Scan isochronous frame list */ - /*------------------------------------------------------------------------------------*/ - - scan_isochronous_list(); -} - -void iaad_remove_qh() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Remove all QHs in qh_remove_list... */ - /*------------------------------------------------------------------------------------*/ - while (qh_remove_list != NULL) - { - qh = qh_remove_list; - qh_remove_list = qh->next; - - // USB_debug("iaad_remove_qh - remove QH 0x%x\n", (int)qh); - - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - - if (qh->qtd_list != NULL) /* still have incomplete qTDs? */ - { - utr = qh->qtd_list->utr; - while (qh->qtd_list) - { - qtd = qh->qtd_list; - qh->qtd_list = qtd->next; - free_ehci_qTD(qtd); - } - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); /* call back */ - } - free_ehci_QH(qh); /* free the QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each asynchronous QH */ - /*------------------------------------------------------------------------------------*/ - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each QH of periodic frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } -} - -//static irqreturn_t ehci_irq (struct usb_hcd *hcd) -void EHCI_IRQHandler(void) -{ - uint32_t intsts; - - /* enter interrupt */ - rt_interrupt_enter(); - - intsts = _ehci->USTSR; - _ehci->USTSR = intsts; /* clear interrupt status */ - - // USB_debug("Eirq USTSR=0x%x\n", intsts); - - if (intsts & HSUSBH_USTSR_UERRINT_Msk) - { - // USB_error("Transfer error!\n"); - } - - if (intsts & HSUSBH_USTSR_USBINT_Msk) - { - /* some transfers completed, travel asynchronous */ - /* and periodic lists to find and reclaim them. */ - scan_asynchronous_list(); - - scan_periodic_frame_list(); - } - - if (intsts & HSUSBH_USTSR_IAA_Msk) - { - iaad_remove_qh(); - } - - /* leave interrupt */ - rt_interrupt_leave(); -} - -static UDEV_T *ehci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && (udev->speed == SPEED_HIGH)) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ehci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ehci->UPSCR[port] = (_ehci->UPSCR[port] | HSUSBH_UPSCR_PRST_Msk) & ~HSUSBH_UPSCR_PE_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) ; /* wait at least 50 ms */ - - _ehci->UPSCR[port] &= ~HSUSBH_UPSCR_PRST_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) || - ((_ehci->UPSCR[port] & (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk)) == (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("EHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PEC_Msk; /* clear port enable change status */ - return USBH_OK; /* port reset success */ -} - -static int ehci_rh_polling(void) -{ - UDEV_T *udev; - int ret; - int connect_status, t0, debounce_tick; - - if (!(_ehci->UPSCR[0] & HSUSBH_UPSCR_CSC_Msk)) - return 0; - - /*------------------------------------------------------------------------------------*/ - /* connect status change */ - /*------------------------------------------------------------------------------------*/ - - USB_debug("EHCI port1 status change: 0x%x\n", _ehci->UPSCR[0]); - - /*--------------------------------------------------------------------------------*/ - /* Disconnect the devices attached to this port. */ - /*--------------------------------------------------------------------------------*/ - while (1) - { - udev = ehci_find_device_by_port(1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - /*--------------------------------------------------------------------------------*/ - /* Port de-bounce */ - /*--------------------------------------------------------------------------------*/ - t0 = usbh_get_ticks(); - debounce_tick = usbh_tick_from_millisecond(HUB_DEBOUNCE_TIME); - connect_status = _ehci->UPSCR[0] & HSUSBH_UPSCR_CCS_Msk; - while (usbh_get_ticks() - t0 < debounce_tick) - { - if (connect_status != (_ehci->UPSCR[0] & HSUSBH_UPSCR_CCS_Msk)) - { - /* reset stable time counting */ - t0 = usbh_get_ticks(); - connect_status = _ehci->UPSCR[0] & HSUSBH_UPSCR_CCS_Msk; - } - } - - _ehci->UPSCR[0] |= HSUSBH_UPSCR_CSC_Msk; /* clear connect status change bit */ - - if (connect_status == HSUSBH_UPSCR_CCS_Msk) - { - /*--------------------------------------------------------------------------------*/ - /* A new device connected. */ - /*--------------------------------------------------------------------------------*/ - if (ehci_rh_port_reset(0) != USBH_OK) - { - /* port reset failed, maybe an USB 1.1 device */ - _ehci->UPSCR[0] |= HSUSBH_UPSCR_PO_Msk; /* change port owner to OHCI */ - _ehci->UPSCR[0] |= HSUSBH_UPSCR_CSC_Msk; /* clear all status change bits */ - return 0; - } - - /* - * Port reset success. Start to enumerate this new device. - */ - udev = alloc_device(); - if (udev == NULL) - return 0; /* out-of-memory, do nothing... */ - - udev->parent = NULL; - udev->port_num = 1; - udev->speed = SPEED_HIGH; - udev->hc_driver = &ehci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - } - else - { - /* - * Device disconnected - */ - while (1) - { - udev = ehci_find_device_by_port(1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - } - return 1; -} - - -HC_DRV_T ehci_driver = -{ - ehci_init, /* init */ - ehci_shutdown, /* shutdown */ - ehci_suspend, /* suspend */ - ehci_resume, /* resume */ - ehci_ctrl_xfer, /* ctrl_xfer */ - ehci_bulk_xfer, /* bulk_xfer */ - ehci_int_xfer, /* int_xfer */ - ehci_iso_xfer, /* iso_xfer */ - ehci_quit_xfer, /* quit_xfer */ - ehci_rh_port_reset, /* rthub_port_reset */ - ehci_rh_polling /* rthub_polling */ -}; - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/src/ehci_iso.c b/bsp/nuvoton/libraries/m480/USBHostLib/src/ehci_iso.c deleted file mode 100644 index 58cbc6fb03c..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/src/ehci_iso.c +++ /dev/null @@ -1,916 +0,0 @@ -/**************************************************************************//** - * @file ehci_iso.c - * @version V1.10 - * @brief USB EHCI isochronous transfer driver. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -uint32_t g_flr_cnt; /* frame list rollover counter */ - -ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ - -extern uint32_t _PFList[FL_SIZE]; /* Periodic frame list */ - -static const uint16_t sitd_OUT_Smask [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f }; - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep); - -/* - * Inspect the iTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_itd(iTD_T *itd) -{ - UTR_T *utr; - uint32_t frnidx = itd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int i, fidx; - - // printf("R - %d %d, 0x%x\n", now_frame, frnidx, itd->Transaction[0]); - - if (now_frame == frnidx) - { - for (i = 0; i < 8; i++) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - return 0; /* have any not completed frames */ - } - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this iTD - */ - utr = itd->utr; - fidx = itd->fidx; - for (i = 0; i < 8; i++) - { - if (!(itd->trans_mask & (0x1<Transaction[i])) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - utr->status = USBH_ERR_NOT_ACCESS0; - } - else if (itd->Transaction[i] & ITD_STATUS_BABBLE) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (itd->Transaction[i] & ITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - utr->iso_status[fidx] = 0; - utr->iso_xlen[fidx] = ITD_XFER_LEN(itd->Transaction[i]); - } - fidx++; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - - return 1; /* to be reclaimed */ -} - -/* - * Inspect the siTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_sitd(siTD_T *sitd) -{ - UTR_T *utr; - uint32_t frnidx = sitd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int fidx; - uint32_t TotalBytesToTransfer; - - if (now_frame == frnidx) - { - if (SITD_STATUS(sitd->StsCtrl) == SITD_STATUS_ACTIVE) - return 0; - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this siTD - */ - utr = sitd->utr; - fidx = sitd->fidx; - - if (SITD_STATUS(sitd->StsCtrl)) - { - if (sitd->StsCtrl & SITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - } - else if (sitd->StsCtrl & SITD_BABBLE_DETECTED) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (sitd->StsCtrl & SITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - TotalBytesToTransfer = (sitd->StsCtrl & SITD_XFER_CNT_Msk) >> SITD_XFER_CNT_Pos; - utr->iso_xlen[fidx] = utr->iso_xlen[fidx] - TotalBytesToTransfer; - utr->iso_status[fidx] = 0; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - return 1; /* to be reclaimed */ -} - -/* - * Some iTD/siTD may be scheduled but not serviced due to time missed. - * This function scan several earlier frames and drop unserviced iTD/siTD if found. - */ -void scan_isochronous_list(void) -{ - ISO_EP_T *iso_ep = iso_ep_list; - iTD_T *itd, *itd_pre, *p; - siTD_T *sitd, *sitd_pre, *sp; - uint32_t frnidx; - - DISABLE_EHCI_IRQ(); - - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - /*--------------------------------------------------------------------------------*/ - /* Scan all iTDs */ - /*--------------------------------------------------------------------------------*/ - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - itd_pre = NULL; - while (itd != NULL) /* traverse all iTDs of itd list */ - { - if (review_itd(itd)) /* inspect and reclaim iTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("An iTD lost refernece to periodic frame list! 0x%x -> %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this iTD from iso_ep's iTD list */ - /*------------------------------------------------------------------------*/ - if (itd_pre == NULL) - { - iso_ep->itd_list = itd->next; - } - else - { - itd_pre->next = itd->next; - } - p = itd->next; - free_ehci_iTD(itd); - itd = p; - } - else - { - itd_pre = itd; - itd = itd->next; /* traverse to the next iTD of iTD list */ - } - } - - /*--------------------------------------------------------------------------------*/ - /* Scan all siTDs */ - /*--------------------------------------------------------------------------------*/ - sitd = iso_ep->sitd_list; /* get the first siTD from iso_ep's siTD list */ - sitd_pre = NULL; - while (sitd != NULL) /* traverse all siTDs of sitd list */ - { - if (review_sitd(sitd)) /* inspect and reclaim siTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this siTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = sitd->sched_frnidx; - if (_PFList[frnidx] == SITD_HLNK_SITD(sitd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = sitd->Next_Link; - } - else - { - sp = SITD_PTR(_PFList[frnidx]); /* find the preceding siTD */ - while ((SITD_PTR(sp->Next_Link) != sitd) && (sp != NULL)) - { - sp = SITD_PTR(sp->Next_Link); - } - - if (sp == NULL) /* link list out of control! */ - { - USB_error("An siTD lost reference to periodic frame list! 0x%x -> %d\n", (int)sitd, frnidx); - } - else /* remove iTD from list */ - { - sp->Next_Link = sitd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this siTD from iso_ep's siTD list */ - /*------------------------------------------------------------------------*/ - if (sitd_pre == NULL) - { - iso_ep->sitd_list = sitd->next; - } - else - { - sitd_pre->next = sitd->next; - } - sp = sitd->next; - free_ehci_siTD(sitd); - sitd = sp; - } - else - { - sitd_pre = sitd; - sitd = sitd->next; /* traverse to the next siTD of siTD list */ - } - } - - iso_ep = iso_ep->next; - } - - ENABLE_EHCI_IRQ(); -} - - -static void write_itd_info(UTR_T *utr, iTD_T *itd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int i; - - buff_page_addr = itd->buff_base & 0xFFFFF000; /* 4K page */ - - for (i = 0; i < 7; i++) - { - itd->Bptr[i] = buff_page_addr + (0x1000 * i); - } - /* EndPtr R Device Address */ - itd->Bptr[0] |= (udev->dev_num) | ((ep->bEndpointAddress & 0xF) << ITD_EP_NUM_Pos); - itd->Bptr[1] |= ep->wMaxPacketSize; /* Maximum Packet Size */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - itd->Bptr[1] |= ITD_DIR_IN; - else - itd->Bptr[1] |= ITD_DIR_OUT; - - itd->Bptr[2] |= (ep->wMaxPacketSize + 1023)/1024; /* Mult */ -} - -static void write_itd_micro_frame(UTR_T *utr, int fidx, iTD_T *itd, int mf) -{ - uint32_t buff_addr; - - buff_addr = (uint32_t)(utr->iso_buff[fidx]); /* xfer buffer start address of this frame */ - - itd->Transaction[mf] = ITD_STATUS_ACTIVE | /* Status */ - ((utr->iso_xlen[fidx] & 0xFFF) << ITD_XLEN_Pos) | /* Transaction Length */ - ((buff_addr & 0xFFFFF000) - (itd->buff_base & 0xFFFFF000)) | /* PG */ - (buff_addr & 0xFFF); /* Transaction offset */ -} - - -static void remove_iso_ep_from_list(ISO_EP_T *iso_ep) -{ - ISO_EP_T *p; - - if (iso_ep_list == iso_ep) - { - iso_ep_list = iso_ep->next; /* it's the first entry, remove it */ - return; - } - - p = iso_ep_list; /* find the previous entry of iso_ep */ - while (p->next != NULL) - { - if (p->next == iso_ep) - { - break; - } - p = p->next; - } - - if (p->next == NULL) - { - return; /* not found */ - } - p->next = iso_ep->next; /* remove iso_ep from list */ -} - - -static __inline void add_itd_to_iso_ep(ISO_EP_T *iso_ep, iTD_T *itd) -{ - iTD_T *p; - - itd->next = NULL; - - if (iso_ep->itd_list == NULL) - { - iso_ep->itd_list = itd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->itd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = itd; -} - -int ehci_iso_xfer(UTR_T *utr) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - ISO_EP_T *iso_ep; /* software iso endpoint descriptor */ - iTD_T *itd, *itd_next, *itd_list = NULL; - int i, itd_cnt; - int trans_mask; /* bit mask of used xfer in an iTD */ - int fidx; /* index to the 8 iso frames of UTR */ - int interval; /* frame interval of iTD */ - - if (ep->hw_pipe != NULL) - { - iso_ep = (ISO_EP_T *)ep->hw_pipe; /* get reference of the isochronous endpoint */ - - if (utr->bIsoNewSched) - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - } - else - { - /* first time transfer of this iso endpoint */ - iso_ep = usbh_alloc_mem(sizeof(*iso_ep)); - if (iso_ep == NULL) - return USBH_ERR_MEMORY_OUT; - - memset(iso_ep, 0, sizeof(*iso_ep)); - iso_ep->ep = ep; - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - - ep->hw_pipe = iso_ep; - - /* - * Add this iso_ep into iso_ep_list - */ - DISABLE_EHCI_IRQ(); - iso_ep->next = iso_ep_list; - iso_ep_list = iso_ep; - ENABLE_EHCI_IRQ(); - } - - if (utr->udev->speed == SPEED_FULL) - return ehci_iso_split_xfer(utr, iso_ep); - - /*------------------------------------------------------------------------------------*/ - /* Allocate iTDs */ - /*------------------------------------------------------------------------------------*/ - - if (ep->bInterval < 2) /* transfer interval is 1 micro-frame */ - { - trans_mask = 0xFF; - itd_cnt = 1; /* required 1 iTD for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 4) /* transfer interval is 2 micro-frames */ - { - trans_mask = 0x55; - itd_cnt = 2; /* required 2 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 8) /* transfer interval is 4 micro-frames */ - { - trans_mask = 0x44; - itd_cnt = 4; /* required 4 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 16) /* transfer interval is 8 micro-frames */ - { - trans_mask = 0x08; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 32) /* transfer interval is 16 micro-frames */ - { - trans_mask = 0x10; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 2; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 64) /* transfer interval is 32 micro-frames */ - { - trans_mask = 0x02; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 4; /* iTD frame interval of this endpoint */ - } - else /* transfer interval is 64 micro-frames */ - { - trans_mask = 0x04; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 8; /* iTD frame interval of this endpoint */ - } - - for (i = 0; i < itd_cnt; i++) /* allocate all iTDs required by UTR */ - { - itd = alloc_ehci_iTD(); - if (itd == NULL) - goto malloc_failed; - - if (itd_list == NULL) /* link all iTDs */ - { - itd_list = itd; - } - else - { - itd->next = itd_list; - itd_list = itd; - } - } - - utr->td_cnt = itd_cnt; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all iTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (itd = itd_list; (itd != NULL); ) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver ITD bug!?\n"); - goto malloc_failed; - } - - itd->utr = utr; - itd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - itd->buff_base = (uint32_t)(utr->iso_buff[fidx]); /* iTD buffer base is buffer of the first UTR iso frame serviced by this iTD */ - itd->trans_mask = trans_mask; - - write_itd_info(utr, itd); - - for (i = 0; i < 8; i++) /* settle xfer into micro-frames */ - { - if (!(trans_mask & (0x1<Transaction[i] = 0; /* not accesed */ - continue; /* not scheduled micro-frame */ - } - - write_itd_micro_frame(utr, fidx, itd, i); - - fidx++; /* preceed to next UTR iso frame */ - - if (fidx == IF_PER_UTR) /* is the last scheduled micro-frame? */ - { - /* raise interrupt on completed */ - itd->Transaction[i] |= ITD_IOC; - break; - } - } - - itd_next = itd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - DISABLE_EHCI_IRQ(); - itd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - add_itd_to_iso_ep(iso_ep, itd); /* add to software itd list */ - itd->Next_Link = _PFList[itd->sched_frnidx]; /* keep the next link */ - _PFList[itd->sched_frnidx] = ITD_HLNK_ITD(itd); - iso_ep->next_frame = (iso_ep->next_frame + interval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - itd = itd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (itd_list != NULL) - { - itd = itd_list; - itd_list = itd->next; - free_ehci_iTD(itd); - } - return USBH_ERR_MEMORY_OUT; -} - -static __inline void add_sitd_to_iso_ep(ISO_EP_T *iso_ep, siTD_T *sitd) -{ - siTD_T *p; - - sitd->next = NULL; - - if (iso_ep->sitd_list == NULL) - { - iso_ep->sitd_list = sitd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->sitd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = sitd; -} - -static void write_sitd_info(UTR_T *utr, siTD_T *sitd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int xlen = utr->iso_xlen[sitd->fidx]; - int scnt; - - sitd->Chrst = (udev->port_num << SITD_PORT_NUM_Pos) | - (udev->parent->iface->udev->dev_num << SITD_HUB_ADDR_Pos) | - ((ep->bEndpointAddress & 0xF) << SITD_EP_NUM_Pos) | - (udev->dev_num << SITD_DEV_ADDR_Pos); - - buff_page_addr = ((uint32_t)utr->iso_buff[sitd->fidx]) & 0xFFFFF000; - sitd->Bptr[0] = (uint32_t)(utr->iso_buff[sitd->fidx]); - sitd->Bptr[1] = buff_page_addr + 0x1000; - - scnt = (xlen + 187) / 188; - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - { - sitd->Chrst |= SITD_XFER_IN; - sitd->Sched = (1 << (scnt + 2)) - 1; - sitd->Sched = (sitd->Sched << 10) | 0x1; - //sitd->Sched <<= 1; - } - else - { - sitd->Chrst |= SITD_XFER_OUT; - sitd->Sched = sitd_OUT_Smask[scnt-1]; - if (scnt > 1) - { - sitd->Bptr[1] |= (0x1 << 3); /* Transaction position (TP) 01b: Begin */ - } - sitd->Bptr[1] |= scnt; /* Transaction count (T-Count) */ - } - - if (sitd->fidx == IF_PER_UTR) - { - sitd->Sched |= SITD_IOC; - } - - sitd->StsCtrl = (xlen << SITD_XFER_CNT_Pos) | SITD_STATUS_ACTIVE; - - sitd->BackLink = SITD_LIST_END; -} - - -static void ehci_sitd_adjust_schedule(siTD_T *sitd) -{ - siTD_T *hlink = (siTD_T *)_PFList[sitd->sched_frnidx]; - uint32_t uframe_mask = 0x00; - - while (hlink && !HLINK_IS_TERMINATED(hlink) && HLINK_IS_SITD(hlink)) - { - hlink = SITD_PTR(hlink); - if (hlink != sitd) - { - if ((hlink->Chrst & SITD_XFER_IO_Msk) == SITD_XFER_IN) - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by IN S-mask */ - uframe_mask |= ((hlink->Sched >> 8) & 0xFF); /* mark micro-frames used by IN C-mask */ - } - else - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by OUT S-mask */ - } - } - hlink = SITD_PTR(hlink->Next_Link); - } - - uframe_mask = uframe_mask | (uframe_mask << 8); /* mark both S-mask and C-mask */ - - if (uframe_mask) - { - /* - * Shift afterward one micro-frame until no conflicts. - */ - while (1) - { - if (sitd->Sched & uframe_mask) - { - sitd->Sched = (sitd->Sched & 0xFFFF0000) | ((sitd->Sched << 1) & 0xFFFF); - } - else - { - break; /* no conflit, done. */ - } - } - } -} - - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - siTD_T *sitd, *sitd_next, *sitd_list = NULL; - int i; - int fidx; /* index to the 8 iso frames of UTR */ - - if (utr->udev->parent == NULL) - { - USB_error("siso xfer - parent lost!\n"); - return USBH_ERR_INVALID_PARAM; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate siTDs */ - /*------------------------------------------------------------------------------------*/ - for (i = 0; i < IF_PER_UTR; i++) /* allocate all siTDs required by UTR */ - { - sitd = alloc_ehci_siTD(); - if (sitd == NULL) - goto malloc_failed; - - if (sitd_list == NULL) /* link all siTDs */ - { - sitd_list = sitd; - } - else - { - sitd->next = sitd_list; - sitd_list = sitd; - } - } - - utr->td_cnt = IF_PER_UTR; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all siTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (sitd = sitd_list; (sitd != NULL); fidx++) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver siTD bug!?\n"); - goto malloc_failed; - } - - sitd->utr = utr; - sitd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - - write_sitd_info(utr, sitd); - - sitd_next = sitd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - sitd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - DISABLE_EHCI_IRQ(); - ehci_sitd_adjust_schedule(sitd); - add_sitd_to_iso_ep(iso_ep, sitd); /* add to software itd list */ - sitd->Next_Link = _PFList[sitd->sched_frnidx];/* keep the next link */ - _PFList[sitd->sched_frnidx] = SITD_HLNK_SITD(sitd); - iso_ep->next_frame = (iso_ep->next_frame + ep->bInterval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - sitd = sitd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (sitd_list != NULL) - { - sitd = sitd_list; - sitd_list = sitd->next; - free_ehci_siTD(sitd); - } - return USBH_ERR_MEMORY_OUT; -} - -/* - * If it's an isochronous endpoint, quit current transfer via UTR or hardware EP. - */ -int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ISO_EP_T *iso_ep; - iTD_T *itd, *itd_next, *p; - uint32_t frnidx; - uint32_t now_frame; - - if (ep == NULL) - { - if (utr == NULL) - return USBH_ERR_NOT_FOUND; - - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ep = utr->ep; - } - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) != EP_ATTR_TT_ISO) - return USBH_ERR_NOT_FOUND; /* not isochronous endpoint */ - - /*------------------------------------------------------------------------------------*/ - /* It's an iso endpoint. Remove it as required. */ - /*------------------------------------------------------------------------------------*/ - iso_ep = iso_ep_list; - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - if (iso_ep->ep == ep) - break; - iso_ep = iso_ep->next; - } - if (iso_ep == NULL) - return 0; /* should have been removed */ - - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - - while (itd != NULL) /* traverse all iTDs of itd list */ - { - itd_next = itd->next; /* remember the next iTD */ - utr = itd->utr; - - /*--------------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*--------------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - - /* - * Prevent to race with Host Controller. If the iTD to be removed is located in - * current or next frame, wait until HC passed through it. - */ - while (1) - { - now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - if ((now_frame == frnidx) || (((now_frame+1)%1024) == frnidx)) - continue; - break; - } - - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("ehci_quit_iso_xfer - An iTD lost reference to periodic frame list! 0x%x on %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - utr->status = USBH_ERR_ABORT; - } - free_ehci_iTD(itd); - itd = itd_next; - } - - /* - * Remove iso_ep from iso_ep_list - */ - remove_iso_ep_from_list(iso_ep); - usbh_free_mem(iso_ep, sizeof(*iso_ep)); /* free this iso_ep */ - ep->hw_pipe = NULL; - - if (iso_ep_list == NULL) - _ehci->UCMDR &= ~HSUSBH_UCMDR_PSEN_Msk; - - return 0; -} - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/src/mem_alloc.c b/bsp/nuvoton/libraries/m480/USBHostLib/src/mem_alloc.c deleted file mode 100644 index d0eab237700..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/src/mem_alloc.c +++ /dev/null @@ -1,503 +0,0 @@ -/**************************************************************************//** - * @file mem_alloc.c - * @version V1.10 - * @brief USB host library memory allocation functions. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" - - -/// @cond HIDDEN_SYMBOLS - -//#define MEM_DEBUG - -#ifdef MEM_DEBUG -#define mem_debug rt_kprintf -#else -#define mem_debug(...) -#endif - -#ifdef __ICCARM__ -#pragma data_alignment=32 -static uint8_t _mem_pool[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE]; -#else -static uint8_t _mem_pool[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE] __attribute__((aligned(32))); -#endif -static uint8_t _unit_used[MEM_POOL_UNIT_NUM]; - -static volatile int _usbh_mem_used; -static volatile int _usbh_max_mem_used; -static volatile int _mem_pool_used; - - -UDEV_T * g_udev_list; - -uint8_t _dev_addr_pool[128]; -static volatile int _device_addr; - -static int _sidx = 0;; - -/*--------------------------------------------------------------------------*/ -/* Memory alloc/free recording */ -/*--------------------------------------------------------------------------*/ - -void usbh_memory_init(void) -{ - if (sizeof(TD_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("TD_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - if (sizeof(ED_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("ED_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - _usbh_mem_used = 0L; - _usbh_max_mem_used = 0L; - - memset(_unit_used, 0, sizeof(_unit_used)); - _mem_pool_used = 0; - _sidx = 0; - - g_udev_list = NULL; - - memset(_dev_addr_pool, 0, sizeof(_dev_addr_pool)); - _device_addr = 1; -} - -uint32_t usbh_memory_used(void) -{ - rt_kprintf("USB static memory: %d/%d, heap used: %d\n", _mem_pool_used, MEM_POOL_UNIT_NUM, _usbh_mem_used); - return _usbh_mem_used; -} - -static void memory_counter(int size) -{ - _usbh_mem_used += size; - if (_usbh_mem_used > _usbh_max_mem_used) - _usbh_max_mem_used = _usbh_mem_used; -} - -void * usbh_alloc_mem(int size) -{ - void *p; - - p = malloc(size); - if (p == NULL) - { - USB_error("usbh_alloc_mem failed! %d\n", size); - return NULL; - } - - memset(p, 0, size); - memory_counter(size); - return p; -} - -void usbh_free_mem(void *p, int size) -{ - free(p); - memory_counter(0-size); -} - - -/*--------------------------------------------------------------------------*/ -/* USB device allocate/free */ -/*--------------------------------------------------------------------------*/ - -UDEV_T * alloc_device(void) -{ - UDEV_T *udev; - - udev = malloc(sizeof(*udev)); - if (udev == NULL) - { - USB_error("alloc_device failed!\n"); - return NULL; - } - memset(udev, 0, sizeof(*udev)); - memory_counter(sizeof(*udev)); - udev->cur_conf = -1; /* must! used to identify the first SET CONFIGURATION */ - udev->next = g_udev_list; /* chain to global device list */ - g_udev_list = udev; - return udev; -} - -void free_device(UDEV_T *udev) -{ - UDEV_T *d; - - if (udev == NULL) - return; - - if (udev->cfd_buff != NULL) - usbh_free_mem(udev->cfd_buff, MAX_DESC_BUFF_SIZE); - - /* - * Remove it from the global device list - */ - if (g_udev_list == udev) - { - g_udev_list = g_udev_list->next; - } - else - { - d = g_udev_list; - while (d != NULL) - { - if (d->next == udev) - { - d->next = udev->next; - break; - } - d = d->next; - } - } - - free(udev); - memory_counter(-sizeof(*udev)); -} - -int alloc_dev_address(void) -{ - _device_addr++; - - if (_device_addr >= 128) - _device_addr = 1; - - while (1) - { - if (_dev_addr_pool[_device_addr] == 0) - { - _dev_addr_pool[_device_addr] = 1; - return _device_addr; - } - _device_addr++; - if (_device_addr >= 128) - _device_addr = 1; - } -} - -void free_dev_address(int dev_addr) -{ - if (dev_addr < 128) - _dev_addr_pool[dev_addr] = 0; -} - -/*--------------------------------------------------------------------------*/ -/* UTR (USB Transfer Request) allocate/free */ -/*--------------------------------------------------------------------------*/ - -UTR_T * alloc_utr(UDEV_T *udev) -{ - UTR_T *utr; - - utr = malloc(sizeof(*utr)); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - memory_counter(sizeof(*utr)); - memset(utr, 0, sizeof(*utr)); - utr->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr); - return utr; -} - -void free_utr(UTR_T *utr) -{ - if (utr == NULL) - return; - - mem_debug("[FREE] [UTR] - 0x%x\n", (int)utr); - free(utr); - memory_counter(0-(int)sizeof(*utr)); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI ED allocate/free */ -/*--------------------------------------------------------------------------*/ - -ED_T * alloc_ohci_ED(void) -{ - int i; - ED_T *ed; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - ed = (ED_T *)&_mem_pool[i]; - memset(ed, 0, sizeof(*ed)); - mem_debug("[ALLOC] [ED] - 0x%x\n", (int)ed); - return ed; - } - } - USB_error("alloc_ohci_ED failed!\n"); - return NULL; -} - -void free_ohci_ED(ED_T *ed) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)ed) - { - mem_debug("[FREE] [ED] - 0x%x\n", (int)ed); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ohci_ED - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI TD allocate/free */ -/*--------------------------------------------------------------------------*/ -TD_T * alloc_ohci_TD(UTR_T *utr) -{ - int i; - TD_T *td; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - td = (TD_T *)&_mem_pool[i]; - - memset(td, 0, sizeof(*td)); - td->utr = utr; - mem_debug("[ALLOC] [TD] - 0x%x\n", (int)td); - return td; - } - } - USB_error("alloc_ohci_TD failed!\n"); - return NULL; -} - -void free_ohci_TD(TD_T *td) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)td) - { - mem_debug("[FREE] [TD] - 0x%x\n", (int)td); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ohci_TD - not found!\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI QH allocate/free */ -/*--------------------------------------------------------------------------*/ -QH_T * alloc_ehci_QH(void) -{ - int i; - QH_T *qh = NULL; - - for (i = (_sidx+1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i+1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qh = (QH_T *)&_mem_pool[i]; - memset(qh, 0, sizeof(*qh)); - mem_debug("[ALLOC] [QH] - 0x%x\n", (int)qh); - break; - } - } - if (qh == NULL) - { - USB_error("alloc_ehci_QH failed!\n"); - return NULL; - } - qh->Curr_qTD = QTD_LIST_END; - qh->OL_Next_qTD = QTD_LIST_END; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = QTD_STS_HALT; - return qh; -} - -void free_ehci_QH(QH_T *qh) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)qh) - { - mem_debug("[FREE] [QH] - 0x%x\n", (int)qh); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ehci_QH - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI qTD allocate/free */ -/*--------------------------------------------------------------------------*/ -qTD_T * alloc_ehci_qTD(UTR_T *utr) -{ - int i; - qTD_T *qtd; - - for (i = (_sidx+1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i+1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qtd = (qTD_T *)&_mem_pool[i]; - - memset(qtd, 0, sizeof(*qtd)); - qtd->Next_qTD = QTD_LIST_END; - qtd->Alt_Next_qTD = QTD_LIST_END; - qtd->Token = 0x1197B3F; // QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It means the qTD still not ready for transfer. - qtd->utr = utr; - mem_debug("[ALLOC] [qTD] - 0x%x\n", (int)qtd); - return qtd; - } - } - USB_error("alloc_ehci_qTD failed!\n"); - return NULL; -} - -void free_ehci_qTD(qTD_T *qtd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)qtd) - { - mem_debug("[FREE] [qTD] - 0x%x\n", (int)qtd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_qTD 0x%x - not found!\n", (int)qtd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -iTD_T * alloc_ehci_iTD(void) -{ - int i; - iTD_T *itd; - - for (i = (_sidx+1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i+1) % MEM_POOL_UNIT_NUM) - { - if (i+2 >= MEM_POOL_UNIT_NUM) - continue; - - if ((_unit_used[i] == 0) && (_unit_used[i+1] == 0)) - { - _unit_used[i] = _unit_used[i+1] = 1; - _sidx = i+1; - _mem_pool_used += 2; - itd = (iTD_T *)&_mem_pool[i]; - memset(itd, 0, sizeof(*itd)); - mem_debug("[ALLOC] [iTD] - 0x%x\n", (int)itd); - return itd; - } - } - USB_error("alloc_ehci_iTD failed!\n"); - return NULL; -} - -void free_ehci_iTD(iTD_T *itd) -{ - int i; - - for (i = 0; i+1 < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)itd) - { - mem_debug("[FREE] [iTD] - 0x%x\n", (int)itd); - _unit_used[i] = _unit_used[i+1] = 0; - _mem_pool_used -= 2; - return; - } - } - USB_error("free_ehci_iTD 0x%x - not found!\n", (int)itd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -siTD_T * alloc_ehci_siTD(void) -{ - int i; - siTD_T *sitd; - - for (i = (_sidx+1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i+1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used ++; - sitd = (siTD_T *)&_mem_pool[i]; - memset(sitd, 0, sizeof(*sitd)); - mem_debug("[ALLOC] [siTD] - 0x%x\n", (int)sitd); - return sitd; - } - } - USB_error("alloc_ehci_siTD failed!\n"); - return NULL; -} - -void free_ehci_siTD(siTD_T *sitd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)sitd) - { - mem_debug("[FREE] [siTD] - 0x%x\n", (int)sitd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_siTD 0x%x - not found!\n", (int)sitd); -} - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/src/ohci.c b/bsp/nuvoton/libraries/m480/USBHostLib/src/ohci.c deleted file mode 100644 index 1994d0fc67a..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/src/ohci.c +++ /dev/null @@ -1,1298 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -//#define TD_debug printf -#define TD_debug(...) - -//#define ED_debug printf -#define ED_debug(...) - -#ifdef __ICCARM__ -#pragma data_alignment=256 -HCCA_T _hcca; -#else -HCCA_T _hcca __attribute__((aligned(256))); -#endif - -ED_T * _Ied[6]; - - -static ED_T *ed_remove_list; - -static void add_to_ED_remove_list(ED_T *ed) -{ - ED_T *p; - - ED_debug("add_to_ED_remove_list - 0x%x (0x%x)\n", (int)ed, ed->Info); - DISABLE_OHCI_IRQ(); - - /* check if this ED found in ed_remove_list */ - p = ed_remove_list; - while (p) - { - if (p == ed) - { - ENABLE_OHCI_IRQ(); /* This ED found in ed_remove_list */ - return; /* do nothing */ - } - p = p->next; - } - - ed->Info |= ED_SKIP; /* ask OHCI controller skip this ED */ - ed->next = ed_remove_list; - ed_remove_list = ed; /* insert to the head of ed_remove_list */ - ENABLE_OHCI_IRQ(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_SF_Msk; - usbh_delay_ms(2); /* Full speed wait 2 ms is enough */ -} - -static int ohci_reset(void) -{ - volatile int t0; - - /* Disable HC interrupts */ - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_MIE_Msk; - - /* HC Reset requires max 10 ms delay */ - _ohci->HcControl = 0; - _ohci->HcCommandStatus = USBH_HcCommandStatus_HCR_Msk; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((USBH->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB OHCI reset timed out!\n"); - return -1; - } - - USBH->HcRhStatus = USBH_HcRhStatus_OCI_Msk | USBH_HcRhStatus_LPS_Msk; - - USBH->HcControl = HCFS_RESET; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((USBH->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB HC reset timed out!\n"); - return -1; - } - return 0; -} - -static void init_hcca_int_table() -{ - ED_T *ed_p; - int i, idx, interval; - - memset(_hcca.int_table, 0, sizeof(_hcca.int_table)); - - for (i = 5; i >= 0; i--) /* interval = i^2 */ - { - _Ied[i] = alloc_ohci_ED(); - _Ied[i]->Info = ED_SKIP; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < 32; idx += interval) - { - if (_hcca.int_table[idx] == 0) /* is empty list, insert directly */ - { - _hcca.int_table[idx] = (uint32_t)_Ied[i]; - } - else - { - ed_p = (ED_T *)_hcca.int_table[idx]; - - while (1) - { - if (ed_p == _Ied[i]) - break; /* already chained by previous visit */ - - if (ed_p->NextED == 0) /* reach end of list? */ - { - ed_p->NextED = (uint32_t)_Ied[i]; - break; - } - ed_p = (ED_T *)ed_p->NextED; - } - } - } - } -} - -static ED_T * get_int_tree_head_node(int interval) -{ - int i; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return _Ied[i]; - } - return _Ied[5]; /* for interval >= 32 */ -} - -static int get_ohci_interval(int interval) -{ - int i, bInterval = 1; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return bInterval; - bInterval *= 2; - } - return 32; /* for interval >= 32 */ -} - - -static int ohci_init(void) -{ - uint32_t fminterval; - volatile int i; - - if (ohci_reset() < 0) - return -1; - - ed_remove_list = NULL; - - init_hcca_int_table(); - - /* Tell the controller where the control and bulk lists are - * The lists are empty now. */ - _ohci->HcControlHeadED = 0; /* control ED list head */ - _ohci->HcBulkHeadED = 0; /* bulk ED list head */ - - _ohci->HcHCCA = (uint32_t)&_hcca; /* HCCA area */ - - /* periodic start 90% of frame interval */ - fminterval = 0x2edf; /* 11,999 */ - _ohci->HcPeriodicStart = (fminterval*9)/10; - - /* set FSLargestDataPacket, 10,104 for 0x2edf frame interval */ - fminterval |= ((((fminterval - 210) * 6) / 7) << 16); - _ohci->HcFmInterval = fminterval; - - _ohci->HcLSThreshold = 0x628; - - /* start controller operations */ - _ohci->HcControl = HCFS_OPER | (0x3 << USBH_HcControl_CBSR_Pos); - -#ifdef OHCI_PER_PORT_POWER - _ohci->HcRhDescriptorB = 0x60000; - _ohci->HcRhPortStatus[0] = USBH_HcRhPortStatus_PPS_Msk; - _ohci->HcRhPortStatus[1] = USBH_HcRhPortStatus_PPS_Msk; -#else - _ohci->HcRhDescriptorA = (USBH->HcRhDescriptorA | (1<<9)) & ~USBH_HcRhDescriptorA_PSM_Msk; - _ohci->HcRhStatus = USBH_HcRhStatus_LPSC_Msk; -#endif - - _ohci->HcInterruptEnable = USBH_HcInterruptEnable_MIE_Msk | USBH_HcInterruptEnable_WDH_Msk | USBH_HcInterruptEnable_SF_Msk; - - /* POTPGT delay is bits 24-31, in 20 ms units. */ - usbh_delay_ms(20); - return 0; -} - -static void ohci_suspend(void) -{ - /* set port suspend if connected */ - if (_ohci->HcRhPortStatus[0] & 0x1) - _ohci->HcRhPortStatus[0] = 0x4; - - if (_ohci->HcRhPortStatus[1] & 0x1) - _ohci->HcRhPortStatus[1] = 0x4; - - /* enable Device Remote Wakeup */ - _ohci->HcRhStatus |= USBH_HcRhStatus_DRWE_Msk; - - /* enable USBH RHSC interrupt for system wakeup */ - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_RHSC_Msk | USBH_HcInterruptEnable_RD_Msk; - - /* set Host Controller enter suspend state */ - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (3 << USBH_HcControl_HCFS_Pos); -} - -static void ohci_resume(void) -{ - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (1 << USBH_HcControl_HCFS_Pos); - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (2 << USBH_HcControl_HCFS_Pos); - - if (_ohci->HcRhPortStatus[0] & 0x4) - _ohci->HcRhPortStatus[0] = 0x8; - if (_ohci->HcRhPortStatus[1] & 0x4) - _ohci->HcRhPortStatus[1] = 0x8; -} - -static void ohci_shutdown(void) -{ - ohci_suspend(); - NVIC_DisableIRQ(USBH_IRQn); -#ifndef OHCI_PER_PORT_POWER - _ohci->HcRhStatus = USBH_HcRhStatus_LPS_Msk; -#endif -} - - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ohci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ED_T *ed; - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ed = (ED_T *)(utr->ep->hw_pipe); - - if (!ed) - return USBH_ERR_NOT_FOUND; - - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - ed = (ED_T *)(ep->hw_pipe); - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - ep->hw_pipe = NULL; - } - - return 0; -} - -uint32_t ed_make_info(UDEV_T *udev, EP_INFO_T *ep) -{ - uint32_t info; - - if (ep == NULL) /* is a control endpoint */ - { - /* control endpoint direction is from TD */ - if (udev->descriptor.bMaxPacketSize0 == 0) /* is 0 if device descriptor still not obtained. */ - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - info = (udev->descriptor.bMaxPacketSize0 << 16) /* Control endpoint Maximum Packet Size from device descriptor */ - | ED_DIR_BY_TD /* Direction (Get direction From TD) */ - | ED_FORMAT_GENERAL /* General format */ - | (0 << ED_CTRL_EN_Pos); /* Endpoint address 0 */ - } - else /* Other endpoint direction is from endpoint descriptor */ - { - info = (ep->wMaxPacketSize << 16); /* Maximum Packet Size from endpoint */ - - info |= ((ep->bEndpointAddress & 0xf) << ED_CTRL_EN_Pos); /* Endpoint Number */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) - info |= ED_DIR_IN; - else - info |= ED_DIR_OUT; - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) == EP_ATTR_TT_ISO) - info |= ED_FORMAT_ISO; - else - info |= ED_FORMAT_GENERAL; - } - - info |= ((udev->speed == SPEED_LOW) ? ED_SPEED_LOW : ED_SPEED_FULL); /* Speed */ - info |= (udev->dev_num); /* Function Address */ - - return info; -} - -static void write_td(TD_T *td, uint32_t info, uint8_t *buff, uint32_t data_len) -{ - td->Info = info; - td->CBP = (uint32_t)((!buff || !data_len) ? 0 : buff); - td->BE = (uint32_t)((!buff || !data_len ) ? 0 : (uint32_t)buff + data_len - 1); - td->buff_start = td->CBP; - // TD_debug("TD [0x%x]: 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->BE); -} - -static int ohci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - ED_T *ed; - TD_T *td_setup, *td_data, *td_status; - uint32_t info; - - udev = utr->udev; - - /*------------------------------------------------------------------------------------*/ - /* Allocate ED and TDs */ - /*------------------------------------------------------------------------------------*/ - td_setup = alloc_ohci_TD(utr); - - if (utr->data_len > 0) - td_data = alloc_ohci_TD(utr); - else - td_data = NULL; - - td_status = alloc_ohci_TD(utr); - - if (td_status == NULL) - { - free_ohci_TD(td_setup); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - - /* Check if there's any transfer pending on this endpoint... */ - if (udev->ep0.hw_pipe == NULL) - { - ed = alloc_ohci_ED(); - if (ed == NULL) - { - free_ohci_TD(td_setup); - free_ohci_TD(td_status); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - } - else - ed = (ED_T *)udev->ep0.hw_pipe; - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage TD */ - /*------------------------------------------------------------------------------------*/ - info = TD_CC | TD_T_DATA0 | TD_TYPE_CTRL; - write_td(td_setup, info, (uint8_t *)&utr->setup, 8); - td_setup->ed = ed; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage TD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - - write_td(td_data, info, utr->buff, utr->data_len); - td_data->ed = ed; - td_setup->NextTD = (uint32_t)td_data; - td_setup->next = td_data; - td_data->NextTD = (uint32_t)td_status; - td_data->next = td_status; - } - else - { - td_setup->NextTD = (uint32_t)td_status; - td_setup->next = td_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare STATUS stage TD */ - /*------------------------------------------------------------------------------------*/ - ed->Info = ed_make_info(udev, NULL); - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL); - else - info = (TD_CC | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL); - - write_td(td_status, info, NULL, 0); - td_status->ed = ed; - td_status->NextTD = 0; - td_status->next = 0; - - /*------------------------------------------------------------------------------------*/ - /* prepare ED */ - /*------------------------------------------------------------------------------------*/ - ed->TailP = 0; - ed->HeadP = (uint32_t)td_setup; - ed->Info = ed_make_info(udev, NULL); - ed->NextED = 0; - - //TD_debug("TD SETUP [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_setup, td_setup->Info, td_setup->CBP, td_setup->BE, td_setup->NextTD); - //if (td_data) - // TD_debug("TD DATA [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_data, td_data->Info, td_data->CBP, td_data->BE, td_data->NextTD); - //TD_debug("TD STATUS [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_status, td_status->Info, td_status->CBP, td_status->BE, td_status->NextTD); - ED_debug("Xfer ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - if (utr->data_len > 0) - utr->td_cnt = 3; - else - utr->td_cnt = 2; - - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - udev->ep0.hw_pipe = (void *)ed; /* driver can find ED from EP */ - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - _ohci->HcControlHeadED = (uint32_t)ed; /* Link ED to OHCI */ - _ohci->HcControl |= USBH_HcControl_CLE_Msk; /* enable control list */ - ENABLE_OHCI_IRQ(); - _ohci->HcCommandStatus = USBH_HcCommandStatus_CLF_Msk; /* start Control list */ - - return 0; -} - -static int ohci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed; - TD_T *td, *td_p, *td_list = NULL; - uint32_t info; - uint32_t data_len, xfer_len; - int8_t bIsNewED = 0; - uint8_t *buff; - - /*------------------------------------------------------------------------------------*/ - /* Check if there's uncompleted transfer on this endpoint... */ - /* Prepare ED */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - - /* Check if there's any transfer pending on this endpoint... */ - ed = (ED_T *)_ohci->HcBulkHeadED; /* get the head of bulk endpoint list */ - while (ed != NULL) - { - if (ed->Info == info) /* have transfer of this EP not completed? */ - { - if ((ed->HeadP & 0xFFFFFFF0) != (ed->TailP & 0xFFFFFFF0)) - return USBH_ERR_OHCI_EP_BUSY; /* endpoint is busy */ - else - break; /* ED already there... */ - } - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ED_debug("Link BULK ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - } - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - utr->td_cnt = 0; - data_len = utr->data_len; - buff = utr->buff; - - do - { - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_BULK); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_BULK); - - info &= ~(1 << 25); /* Data toggle from ED toggleCarry bit */ - - if (data_len > 4096) /* maximum transfer length is 4K for each TD */ - xfer_len = 4096; - else - xfer_len = data_len; /* remaining data length < 4K */ - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - write_td(td, info, buff, xfer_len); - td->ed = ed; - - utr->td_cnt++; /* increase TD count, for recalim counter */ - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - /* chain to end of TD list */ - if (td_list == NULL) - { - td_list = td; - } - else - { - td_p = td_list; - while (td_p->NextTD != 0) - td_p = (TD_T *)td_p->NextTD; - td_p->NextTD = (uint32_t)td; - } - - } - while (data_len > 0); - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - if (bIsNewED) - { - ed->HeadP = (uint32_t)td_list; - /* Link ED to OHCI Bulk List */ - ed->NextED = _ohci->HcBulkHeadED; - _ohci->HcBulkHeadED = (uint32_t)ed; - } - ENABLE_OHCI_IRQ(); - _ohci->HcControl |= USBH_HcControl_BLE_Msk; /* enable bulk list */ - _ohci->HcCommandStatus = USBH_HcCommandStatus_BLF_Msk; /* start bulk list */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static int ohci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_new; - uint32_t info; - int8_t bIsNewED = 0; - - if (utr->data_len > 64) /* USB 1.1 interrupt transfer maximum packet size is 64 */ - return USBH_ERR_INVALID_PARAM; - - td_new = alloc_ohci_TD(utr); /* allocate a TD for dummy TD */ - if (td_new == NULL) - return USBH_ERR_MEMORY_OUT; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - - td = alloc_ohci_TD(NULL); /* allocate the initial dummy TD for ED */ - if (td == NULL) - { - free_ohci_ED(ed); - free_ohci_TD(td_new); - return USBH_ERR_MEMORY_OUT; - } - ed->HeadP = (uint32_t)td; /* Let both HeadP and TailP point to dummy TD */ - ed->TailP = ed->HeadP; - } - else - { - td = (TD_T *)(ed->TailP & ~0xf); /* TailP always point to the dummy TD */ - } - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TD */ - /*------------------------------------------------------------------------------------*/ - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_INT); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_INT); - - /* Keep data toggle */ - info = (info & ~(1<<25)) | (td->Info & (1<<25)); - - /* fill this TD */ - write_td(td, info, utr->buff, utr->data_len); - td->ed = ed; - td->NextTD = (uint32_t)td_new; - td->utr = utr; - utr->td_cnt = 1; /* increase TD count, for recalim counter */ - utr->status = 0; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - - ed->TailP = (uint32_t)td_new; - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - - //printf("Link INT ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - _ohci->HcControl |= USBH_HcControl_PLE_Msk; /* periodic list enable */ - return 0; -} - -static int ohci_iso_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_list, *last_td; - int i; - uint32_t info; - uint32_t buff_addr; - int8_t bIsNewED = 0; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - } - else - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - if (utr->bIsoNewSched) /* Is the starting of isochronous streaming? */ - ed->next_sf = _hcca.frame_no + OHCI_ISO_DELAY; - - utr->td_cnt = 0; - utr->iso_sf = ed->next_sf; - - last_td = NULL; - td_list = NULL; - - for (i = 0; i < IF_PER_UTR; i++) - { - utr->iso_status[i] = USBH_ERR_NOT_ACCESS1; - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - buff_addr = (uint32_t)(utr->iso_buff[i]); - td->Info = (TD_CC | TD_TYPE_ISO) | ed->next_sf; - ed->next_sf += get_ohci_interval(ed->bInterval); - td->CBP = buff_addr & ~0xFFF; - td->BE = buff_addr + utr->iso_xlen[i] - 1; - td->PSW[0] = 0xE000 | (buff_addr & 0xFFF); - - td->ed = ed; - utr->td_cnt++; /* increase TD count, for reclaim counter */ - - /* chain to end of TD list */ - if (td_list == NULL) - td_list = td; - else - last_td->NextTD = (uint32_t)td; - - last_td = td; - }; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - - if ((ed->HeadP & ~0x3) == 0) - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - else - { - /* find the tail of TDs under this ED */ - td = (TD_T *)(ed->HeadP & ~0x3); - while (td->NextTD != 0) - { - td = (TD_T *)td->NextTD; - } - td->NextTD = (uint32_t)td_list; - } - - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - ED_debug("Link ISO ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - _ohci->HcControl |= USBH_HcControl_PLE_Msk | USBH_HcControl_IE_Msk; /* enable periodic list and isochronous transfer */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static UDEV_T * ohci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && - ((udev->speed == SPEED_LOW) || (udev->speed == SPEED_FULL))) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ohci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_PRS_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time)+1) - { - /* - * If device is disconnected or port enabled, we can stop port reset. - */ - if (((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) || - ((_ohci->HcRhPortStatus[port] & (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk)) == (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("OHCI port %d - port reset failed!\n", port+1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - return USBH_OK; /* port reset success */ -} - -static int ohci_rh_polling(void) -{ - int i, change = 0; - UDEV_T *udev; - int ret; - - for (i = 0; i < 2; i++) - { - if (((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x1) && (i == 0)) - continue; /* M480LD OHCI has no root hub port 0 */ - - /* clear unwanted port change status */ - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_OCIC_Msk | USBH_HcRhPortStatus_PRSC_Msk | - USBH_HcRhPortStatus_PSSC_Msk | USBH_HcRhPortStatus_PESC_Msk; - - if ((_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CSC_Msk) == 0) - continue; - - /*--------------------------------------------------------------------------------*/ - /* connect status change */ - /*--------------------------------------------------------------------------------*/ - - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* First of all, check if there's any previously connected device. */ - /*----------------------------------------------------------------------------*/ - while (1) - { - udev = ohci_find_device_by_port(i+1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - if (ohci_rh_port_reset(i) != USBH_OK) - continue; - - /* - * Port reset success... - */ - udev = alloc_device(); - if (udev == NULL) - continue; - - udev->parent = NULL; - udev->port_num = i+1; - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_LSDA_Msk) - udev->speed = SPEED_LOW; - else - udev->speed = SPEED_FULL; - udev->hc_driver = &ohci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - - change = 1; - } - else - { - /* - * Device disconnected - */ - while (1) - { - udev = ohci_find_device_by_port(i+1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - change = 1; - } - } - return change; -} - -void td_done(TD_T *td) -{ - UTR_T *utr = td->utr; - uint32_t info; - int cc; - - info = td->Info; - - TD_debug("td_done: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->NextTD, td->BE); - - /* ISO ... drivers see per-TD length/status */ - if ((info & TD_TYPE_Msk) == TD_TYPE_ISO) - { - uint16_t sf; - int idx; - - sf = info & 0xFFFF; - idx = ((sf + 0x10000 - utr->iso_sf) & 0xFFFF) / get_ohci_interval(td->ed->bInterval); - if (idx >= IF_PER_UTR) - { - USB_error("ISO invalid index!! %d, %d\n", sf, utr->iso_sf); - goto td_out; - } - - cc = (td->PSW[0] >> 12) & 0xF; - if (cc == 0xF) /* this frame was not transferred */ - { - USB_debug("ISO F %d N/A!\n", sf); - utr->iso_status[idx] = USBH_ERR_SCH_OVERRUN; - goto td_out; - } - if ((cc != 0) && (cc != CC_DATA_UNDERRUN)) - { - utr->iso_status[idx] = USBH_ERR_CC_NO_ERR - cc; - goto td_out; - } - utr->iso_status[idx] = 0; - utr->iso_xlen[idx] = td->PSW[0] & 0x7FF; - } - else - { - cc = TD_CC_GET(info); - - /* short packet is fine */ - if ((cc != CC_NOERROR) && (cc != CC_DATA_UNDERRUN)) - { - USB_error("TD error, CC = 0x%x\n", cc); - if (cc == CC_STALL) - utr->status = USBH_ERR_STALL; - else - utr->status = USBH_ERR_TRANSFER; - } - - switch (info & TD_TYPE_Msk) - { - case TD_TYPE_CTRL: - if (info & TD_CTRL_DATA) - { - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - } - break; - - case TD_TYPE_BULK: - case TD_TYPE_INT: - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - break; - } - } - -td_out: - - utr->td_cnt--; - - /* If all TDs are done, call-back to requester. */ - if (utr->td_cnt == 0) - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } -} - -/* in IRQ context */ -static void remove_ed() -{ - ED_T *ed, *ed_p, *ied; - TD_T *td, *td_next; - UTR_T *utr; - int found; - - while (ed_remove_list != NULL) - { - ED_debug("Remove ED: 0x%x, %d\n", (int)ed_remove_list, ed_remove_list->bInterval); - ed_p = ed_remove_list; - found = 0; - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Control List if found */ - /*--------------------------------------------------------------------------------*/ - if ((ed_p->Info & ED_EP_ADDR_Msk) == 0) - { - if (_ohci->HcControlHeadED == (uint32_t)ed_p) - { - _ohci->HcControlHeadED = (uint32_t)ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcControlHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove INT or ISO endpoint from HCCA interrupt table */ - /*--------------------------------------------------------------------------------*/ - else if (ed_p->bInterval > 0) - { - ied = get_int_tree_head_node(ed_p->bInterval); - - ed = ied; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - break; - } - ed = (ED_T *)ed->NextED; - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Bulk List if found */ - /*--------------------------------------------------------------------------------*/ - else - { - if (_ohci->HcBulkHeadED == (uint32_t)ed_p) - { - ed = (ED_T *)ed_p; - _ohci->HcBulkHeadED = ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcBulkHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove and free all TDs under this endpoint */ - /*--------------------------------------------------------------------------------*/ - if (found) - { - td = (TD_T *)(ed_p->HeadP & ~0x3); - if (td != NULL) - { - while (td != NULL) - { - utr = td->utr; - td_next = (TD_T *)td->NextTD; - free_ohci_TD(td); - td = td_next; - - utr->td_cnt--; - if (utr->td_cnt == 0) - { - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - } - } - } - - /* - * Done. Remove this ED from [ed_remove_list] and free it. - */ - ed_remove_list = ed_p->next; - free_ohci_ED(ed_p); - } -} - - -//static irqreturn_t ohci_irq (struct usb_hcd *hcd) -void OHCI_IRQHandler(void) -{ - TD_T *td, *td_prev, *td_next; - uint32_t int_sts; - - /* enter interrupt */ - rt_interrupt_enter(); - - int_sts = _ohci->HcInterruptStatus; - - //USB_debug("ohci int_sts = 0x%x\n", int_sts); - - if ((_ohci->HcInterruptEnable & USBH_HcInterruptEnable_SF_Msk) && - (int_sts & USBH_HcInterruptStatus_SF_Msk)) - { - int_sts &= ~USBH_HcInterruptStatus_SF_Msk; - - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_SF_Msk; - remove_ed(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - } - - if (int_sts & USBH_HcInterruptStatus_WDH_Msk) - { - //printf("!%02x\n", _ohci->HcFmNumber & 0xff); - int_sts &= ~USBH_HcInterruptStatus_WDH_Msk; - /* - * reverse done list - */ - td = (TD_T *)(_hcca.done_head & TD_ADDR_MASK); - _hcca.done_head = 0; - td_prev = NULL; - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_WDH_Msk; - - while (td != NULL) - { - //TD_debug("Done list TD 0x%x => 0x%x\n", (int)td, (int)td->NextTD); - td_next = (TD_T *)(td->NextTD & TD_ADDR_MASK); - td->NextTD = (uint32_t)td_prev; - td_prev = td; - td = td_next; - } - td = td_prev; /* first TD of the reversed done list */ - - /* - * reclaim TDs - */ - while (td != NULL) - { - TD_debug("Reclaim TD 0x%x, next 0x%x\n", (int)td, td->NextTD); - td_next = (TD_T *)td->NextTD; - td_done(td); - free_ohci_TD(td); - td = td_next; - } - } - - if (int_sts & USBH_HcInterruptStatus_RHSC_Msk) - { - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_RHSC_Msk; - } - - _ohci->HcInterruptStatus = int_sts; - - /* leave interrupt */ - rt_interrupt_leave(); -} - -#ifdef ENABLE_DEBUG_MSG - -void dump_ohci_int_table() -{ - int i; - ED_T *ed; - - for (i = 0; i < 32; i++) -// for (i = 0; i < 1; i++) - - { - USB_debug("%02d: ", i); - - ed = (ED_T *)_hcca.int_table[i]; - - while (ed != NULL) - { - USB_debug("0x%x (0x%x) => ", (int)ed, ed->HeadP); - ed = (ED_T *)ed->NextED; - } - rt_kprintf("0\n"); - } -} - -void dump_ohci_regs() -{ - USB_debug("Dump OCHI registers:\n"); - USB_debug(" HcRevision = 0x%x\n", _ohci->HcRevision); - USB_debug(" HcControl = 0x%x\n", _ohci->HcControl); - USB_debug(" HcCommandStatus = 0x%x\n", _ohci->HcCommandStatus); - USB_debug(" HcInterruptStatus = 0x%x\n", _ohci->HcInterruptStatus); - USB_debug(" HcInterruptEnable = 0x%x\n", _ohci->HcInterruptEnable); - USB_debug(" HcInterruptDisable = 0x%x\n", _ohci->HcInterruptDisable); - USB_debug(" HcHCCA = 0x%x\n", _ohci->HcHCCA); - USB_debug(" HcPeriodCurrentED = 0x%x\n", _ohci->HcPeriodCurrentED); - USB_debug(" HcControlHeadED = 0x%x\n", _ohci->HcControlHeadED); - USB_debug(" HcControlCurrentED = 0x%x\n", _ohci->HcControlCurrentED); - USB_debug(" HcBulkHeadED = 0x%x\n", _ohci->HcBulkHeadED); - USB_debug(" HcBulkCurrentED = 0x%x\n", _ohci->HcBulkCurrentED); - USB_debug(" HcDoneHead = 0x%x\n", _ohci->HcDoneHead); - USB_debug(" HcFmInterval = 0x%x\n", _ohci->HcFmInterval); - USB_debug(" HcFmRemaining = 0x%x\n", _ohci->HcFmRemaining); - USB_debug(" HcFmNumber = 0x%x\n", _ohci->HcFmNumber); - USB_debug(" HcPeriodicStart = 0x%x\n", _ohci->HcPeriodicStart); - USB_debug(" HcLSThreshold = 0x%x\n", _ohci->HcLSThreshold); - USB_debug(" HcRhDescriptorA = 0x%x\n", _ohci->HcRhDescriptorA); - USB_debug(" HcRhDescriptorB = 0x%x\n", _ohci->HcRhDescriptorB); - USB_debug(" HcRhStatus = 0x%x\n", _ohci->HcRhStatus); - USB_debug(" HcRhPortStatus0 = 0x%x\n", _ohci->HcRhPortStatus[0]); - USB_debug(" HcRhPortStatus1 = 0x%x\n", _ohci->HcRhPortStatus[1]); - USB_debug(" HcPhyControl = 0x%x\n", _ohci->HcPhyControl); - USB_debug(" HcMiscControl = 0x%x\n", _ohci->HcMiscControl); -} - -void dump_ohci_ports() -{ - USB_debug("_ohci port0=0x%x, port1=0x%x\n", _ohci->HcRhPortStatus[0], _ohci->HcRhPortStatus[1]); -} - -#endif // ENABLE_DEBUG_MSG - -HC_DRV_T ohci_driver = -{ - ohci_init, /* init */ - ohci_shutdown, /* shutdown */ - ohci_suspend, /* suspend */ - ohci_resume, /* resume */ - ohci_ctrl_xfer, /* ctrl_xfer */ - ohci_bulk_xfer, /* bulk_xfer */ - ohci_int_xfer, /* int_xfer */ - ohci_iso_xfer, /* iso_xfer */ - ohci_quit_xfer, /* quit_xfer */ - ohci_rh_port_reset, /* rthub_port_reset */ - ohci_rh_polling /* rthub_polling */ -}; - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/m480/USBHostLib/src/usb_core.c b/bsp/nuvoton/libraries/m480/USBHostLib/src/usb_core.c deleted file mode 100644 index 475b768a7a4..00000000000 --- a/bsp/nuvoton/libraries/m480/USBHostLib/src/usb_core.c +++ /dev/null @@ -1,299 +0,0 @@ -/**************************************************************************//** - * @file usb_core.c - * @version V1.10 - * @brief USB Host library core. - * - * SPDX-License-Identifier: Apache-2.0 - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "NuMicro.h" - -#include "usb.h" -#include "hub.h" - -/// @cond HIDDEN_SYMBOLS - -USBH_T *_ohci; -HSUSBH_T *_ehci; - -static UDEV_DRV_T *_drivers[MAX_UDEV_DRIVER]; -static CONN_FUNC *g_conn_func, *g_disconn_func; - -/** - * @brief Initialize M480 USB Host controller and USB stack. - * - * @return None. - */ -void usbh_core_init() -{ - NVIC_DisableIRQ(HSUSBH_IRQn); - NVIC_DisableIRQ(USBH_IRQn); - - _ohci = USBH; - _ehci = HSUSBH; - - memset(_drivers, 0, sizeof(_drivers)); - - g_conn_func = NULL; - g_disconn_func = NULL; - -// usbh_hub_init(); - - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x0) /* Only M480MD has EHCI. */ - { - _ehci->USBPCR0 = 0x160; /* enable PHY 0 */ - _ehci->USBPCR1 = 0x520; /* enable PHY 1 */ - } - - usbh_memory_init(); - - _ohci->HcMiscControl |= USBH_HcMiscControl_OCAL_Msk; /* Over-current active low */ - //_ohci->HcMiscControl &= ~USBH_HcMiscControl_OCAL_Msk; /* Over-current active high */ - -#ifdef ENABLE_OHCI - ohci_driver.init(); - ENABLE_OHCI_IRQ(); -#endif - -#ifdef ENABLE_EHCI - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x0) /* Only M480MD has EHCI. */ - { - ehci_driver.init(); - ENABLE_EHCI_IRQ(); - } -#endif -} - -/** - * @brief Let USB stack polls all root hubs. If there's any hub port - * change found, USB stack will manage the hub events in this function call. - * In this function, USB stack enumerates newly connected devices and remove staff - * of disconnected devices. User's application should periodically invoke this - * function. - * @return There's hub port change or not. - * @retval 0 No any hub port status changes found. - * @retval 1 There's hub port status changes. - */ -int usbh_polling_root_hubs(void) -{ - int ret, change = 0; - -#ifdef ENABLE_EHCI - if ((SYS->CSERVER & SYS_CSERVER_VERSION_Msk) == 0x0) /* Only M480MD has EHCI. */ - { - _ehci->UPSCR[1] = HSUSBH_UPSCR_PP_Msk | HSUSBH_UPSCR_PO_Msk; /* set port 2 owner to OHCI */ - do - { - ret = ehci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); - } -#endif - -#ifdef ENABLE_OHCI - do - { - ret = ohci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - - return change; -} - -/** - * @brief Force to quit an endpoint transfer. - * @param[in] udev The USB device. - * @param[in] ep The endpoint to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep) -{ - return udev->hc_driver->quit_xfer(NULL, ep); -} - - -int usbh_connect_device(UDEV_T *udev) -{ - usbh_delay_ms(100); /* initially, give 100 ms delay */ - - if (g_conn_func) - g_conn_func(udev, 0); - - return 0; -} - - -void usbh_disconnect_device(UDEV_T *udev) -{ - USB_debug("disconnect device...\n"); - - if (g_disconn_func) - g_disconn_func(udev, 0); - - -#if 1 //CHECK: Maybe create a new API to quit_xfer and free udev for application - usbh_quit_xfer(udev, &(udev->ep0)); /* Quit control transfer if hw_pipe is not NULL. */ - - /* remove device from global device list */ -// free_dev_address(udev->dev_num); - free_device(udev); - -// usbh_memory_used(); -#endif -} - -/** - * @brief Install device connect and disconnect callback function. - * - * @param[in] conn_func Device connect callback function. - * @param[in] disconn_func Device disconnect callback function. - * @return None. - */ -void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func) -{ - g_conn_func = conn_func; - g_disconn_func = disconn_func; -} - -int usbh_reset_port(UDEV_T *udev) -{ - if (udev->parent == NULL) - { - if (udev->hc_driver) - return udev->hc_driver->rthub_port_reset(udev->port_num - 1); - else - return USBH_ERR_NOT_FOUND; - } - else - { - return udev->parent->port_reset(udev->parent, udev->port_num); - } -} - - -/** - * @brief Force to quit an UTR transfer. - * @param[in] utr The UTR transfer to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_utr(UTR_T *utr) -{ - if (!utr || !utr->udev) - return USBH_ERR_NOT_FOUND; - - return utr->udev->hc_driver->quit_xfer(utr, NULL); -} - - -/** - * @brief Execute an USB request in control transfer. This function returns after the request - * was done or aborted. - * @param[in] udev The target USB device. - * @param[in] bmRequestType Characteristics of request - * @param[in] bRequest Specific request - * @param[in] wValue Word-sized field that varies according to request - * @param[in] wIndex Word-sized field that varies according to request - * @param[in] wLength Number of bytes to transfer if there is a Data stage - * @param[in] buff Data buffer used in data stage - * @param[out] xfer_len Transmitted/received length of data - * @param[in] timeout Time-out limit (in 10ms - timer tick) of this transfer - * @retval 0 Transfer success - * @retval < 0 Transfer failed. Refer to error code definitions. - */ -int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, - uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout) -{ - UTR_T *utr; - uint32_t t0, timeout_tick; - int status; - - *xfer_len = 0; - - //if (check_device(udev)) - // return USBH_ERR_INVALID_PARAM; - - utr = alloc_utr(udev); - if (utr == NULL) - return USBH_ERR_MEMORY_OUT; - - utr->setup.bmRequestType = bmRequestType; - utr->setup.bRequest = bRequest; - utr->setup.wValue = wValue; - utr->setup.wIndex = wIndex; - utr->setup.wLength = wLength; - - utr->buff = buff; - utr->data_len = wLength; - utr->bIsTransferDone = 0; - status = udev->hc_driver->ctrl_xfer(utr); - if (status < 0) - { - udev->ep0.hw_pipe = NULL; - free_utr(utr); - return status; - } - - timeout_tick = usbh_tick_from_millisecond(timeout); - t0 = usbh_get_ticks(); - while (utr->bIsTransferDone == 0) - { - if (usbh_get_ticks() - t0 > timeout_tick) - { - usbh_quit_utr(utr); - free_utr(utr); - udev->ep0.hw_pipe = NULL; - return USBH_ERR_TIMEOUT; - } - } - - status = utr->status; - - if (status == 0) - { - *xfer_len = utr->xfer_len; - } - free_utr(utr); - - return status; -} - -/** - * @brief Execute a bulk transfer request. This function will return immediately after - * issued the bulk transfer. USB stack will later call back utr->func() once the bulk - * transfer was done or aborted. - * @param[in] utr The bulk transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_bulk_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->bulk_xfer(utr); -} - -/** - * @brief Execute an interrupt transfer request. This function will return immediately after - * issued the interrupt transfer. USB stack will later call back utr->func() once the - * interrupt transfer was done or aborted. - * @param[in] utr The interrupt transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_int_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->int_xfer(utr); -} - - diff --git a/bsp/nuvoton/libraries/m480/rtt_port/Kconfig b/bsp/nuvoton/libraries/m480/rtt_port/Kconfig index fc573f9a4a1..cc9de1b5700 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/Kconfig +++ b/bsp/nuvoton/libraries/m480/rtt_port/Kconfig @@ -4,6 +4,7 @@ config SOC_SERIES_M480 select SOC_FAMILY_NUMICRO select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN + select PKG_USING_NUVOTON_SERIES_DRIVER default y config BSP_USE_STDDRIVER_SOURCE diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_common_tables.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_common_tables.h deleted file mode 100644 index 03153851b8f..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_common_tables.h +++ /dev/null @@ -1,136 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. October 2015 -* $Revision: V.1.4.5 a -* -* Project: CMSIS DSP Library -* Title: arm_common_tables.h -* -* Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_COMMON_TABLES_H -#define _ARM_COMMON_TABLES_H - -#include "arm_math.h" - -extern const uint16_t armBitRevTable[1024]; -extern const q15_t armRecipTableQ15[64]; -extern const q31_t armRecipTableQ31[64]; -/* extern const q31_t realCoefAQ31[1024]; */ -/* extern const q31_t realCoefBQ31[1024]; */ -extern const float32_t twiddleCoef_16[32]; -extern const float32_t twiddleCoef_32[64]; -extern const float32_t twiddleCoef_64[128]; -extern const float32_t twiddleCoef_128[256]; -extern const float32_t twiddleCoef_256[512]; -extern const float32_t twiddleCoef_512[1024]; -extern const float32_t twiddleCoef_1024[2048]; -extern const float32_t twiddleCoef_2048[4096]; -extern const float32_t twiddleCoef_4096[8192]; -#define twiddleCoef twiddleCoef_4096 -extern const q31_t twiddleCoef_16_q31[24]; -extern const q31_t twiddleCoef_32_q31[48]; -extern const q31_t twiddleCoef_64_q31[96]; -extern const q31_t twiddleCoef_128_q31[192]; -extern const q31_t twiddleCoef_256_q31[384]; -extern const q31_t twiddleCoef_512_q31[768]; -extern const q31_t twiddleCoef_1024_q31[1536]; -extern const q31_t twiddleCoef_2048_q31[3072]; -extern const q31_t twiddleCoef_4096_q31[6144]; -extern const q15_t twiddleCoef_16_q15[24]; -extern const q15_t twiddleCoef_32_q15[48]; -extern const q15_t twiddleCoef_64_q15[96]; -extern const q15_t twiddleCoef_128_q15[192]; -extern const q15_t twiddleCoef_256_q15[384]; -extern const q15_t twiddleCoef_512_q15[768]; -extern const q15_t twiddleCoef_1024_q15[1536]; -extern const q15_t twiddleCoef_2048_q15[3072]; -extern const q15_t twiddleCoef_4096_q15[6144]; -extern const float32_t twiddleCoef_rfft_32[32]; -extern const float32_t twiddleCoef_rfft_64[64]; -extern const float32_t twiddleCoef_rfft_128[128]; -extern const float32_t twiddleCoef_rfft_256[256]; -extern const float32_t twiddleCoef_rfft_512[512]; -extern const float32_t twiddleCoef_rfft_1024[1024]; -extern const float32_t twiddleCoef_rfft_2048[2048]; -extern const float32_t twiddleCoef_rfft_4096[4096]; - - -/* floating-point bit reversal tables */ -#define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) -#define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) -#define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) -#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) -#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) -#define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) -#define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) -#define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; - -/* fixed-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) -#define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) -#define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) -#define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) -#define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) -#define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) -#define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) -#define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; - -/* Tables for Fast Math Sine and Cosine */ -extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; -extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; -extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; - -#endif /* ARM_COMMON_TABLES_H */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_const_structs.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_const_structs.h deleted file mode 100644 index 4d026173446..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_const_structs.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. March 2015 -* $Revision: V.1.4.5 -* -* Project: CMSIS DSP Library -* Title: arm_const_structs.h -* -* Description: This file has constant structs that are initialized for -* user convenience. For example, some can be given as -* arguments to the arm_cfft_f32() function. -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_CONST_STRUCTS_H -#define _ARM_CONST_STRUCTS_H - -#include "arm_math.h" -#include "arm_common_tables.h" - -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; -extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; - -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; -extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; - -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; -extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; - -#endif diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_math.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_math.h deleted file mode 100644 index dd69a3e32f8..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/arm_math.h +++ /dev/null @@ -1,7154 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2015 ARM Limited. All rights reserved. -* -* $Date: 20. October 2015 -* $Revision: V1.4.5 b -* -* Project: CMSIS DSP Library -* Title: arm_math.h -* -* Description: Public header file for CMSIS DSP Library -* -* Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. - * -------------------------------------------------------------------- */ - -/** - \mainpage CMSIS DSP Software Library - * - * Introduction - * ------------ - * - * This user manual describes the CMSIS DSP software library, - * a suite of common signal processing functions for use on Cortex-M processor based devices. - * - * The library is divided into a number of functions each covering a specific category: - * - Basic math functions - * - Fast math functions - * - Complex math functions - * - Filters - * - Matrix functions - * - Transforms - * - Motor control functions - * - Statistical functions - * - Support functions - * - Interpolation functions - * - * The library has separate functions for operating on 8-bit integers, 16-bit integers, - * 32-bit integer and 32-bit floating-point values. - * - * Using the Library - * ------------ - * - * The library installer contains prebuilt versions of the libraries in the Lib folder. - * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7l_math.lib (Little endian on Cortex-M7) - * - arm_cortexM7b_math.lib (Big endian on Cortex-M7) - * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4l_math.lib (Little endian on Cortex-M4) - * - arm_cortexM4b_math.lib (Big endian on Cortex-M4) - * - arm_cortexM3l_math.lib (Little endian on Cortex-M3) - * - arm_cortexM3b_math.lib (Big endian on Cortex-M3) - * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+) - * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+) - * - * The library functions are declared in the public file arm_math.h which is placed in the Include folder. - * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single - * public header file arm_math.h for Cortex-M7/M4/M3/M0/M0+ with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. - * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or - * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. - * - * Examples - * -------- - * - * The library ships with a number of examples which demonstrate how to use the library functions. - * - * Toolchain Support - * ------------ - * - * The library has been developed and tested with MDK-ARM version 5.14.0.0 - * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. - * - * Building the Library - * ------------ - * - * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. - * - arm_cortexM_math.uvprojx - * - * - * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above. - * - * Pre-processor Macros - * ------------ - * - * Each library project have differant pre-processor macros. - * - * - UNALIGNED_SUPPORT_DISABLE: - * - * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access - * - * - ARM_MATH_BIG_ENDIAN: - * - * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. - * - * - ARM_MATH_MATRIX_CHECK: - * - * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices - * - * - ARM_MATH_ROUNDING: - * - * Define macro ARM_MATH_ROUNDING for rounding on support functions - * - * - ARM_MATH_CMx: - * - * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target - * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and - * ARM_MATH_CM7 for building the library on cortex-M7. - * - * - __FPU_PRESENT: - * - * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries - * - *
- * CMSIS-DSP in ARM::CMSIS Pack - * ----------------------------- - * - * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: - * |File/Folder |Content | - * |------------------------------|------------------------------------------------------------------------| - * |\b CMSIS\\Documentation\\DSP | This documentation | - * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | - * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | - * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | - * - *
- * Revision History of CMSIS-DSP - * ------------ - * Please refer to \ref ChangeLog_pg. - * - * Copyright Notice - * ------------ - * - * Copyright (C) 2010-2015 ARM Limited. All rights reserved. - */ - - -/** - * @defgroup groupMath Basic Math Functions - */ - -/** - * @defgroup groupFastMath Fast Math Functions - * This set of functions provides a fast approximation to sine, cosine, and square root. - * As compared to most of the other functions in the CMSIS math library, the fast math functions - * operate on individual values and not arrays. - * There are separate functions for Q15, Q31, and floating-point data. - * - */ - -/** - * @defgroup groupCmplxMath Complex Math Functions - * This set of functions operates on complex data vectors. - * The data in the complex arrays is stored in an interleaved fashion - * (real, imag, real, imag, ...). - * In the API functions, the number of samples in a complex array refers - * to the number of complex values; the array contains twice this number of - * real values. - */ - -/** - * @defgroup groupFilters Filtering Functions - */ - -/** - * @defgroup groupMatrix Matrix Functions - * - * This set of functions provides basic matrix math operations. - * The functions operate on matrix data structures. For example, - * the type - * definition for the floating-point matrix structure is shown - * below: - *
- *     typedef struct
- *     {
- *       uint16_t numRows;     // number of rows of the matrix.
- *       uint16_t numCols;     // number of columns of the matrix.
- *       float32_t *pData;     // points to the data of the matrix.
- *     } arm_matrix_instance_f32;
- * 
- * There are similar definitions for Q15 and Q31 data types. - * - * The structure specifies the size of the matrix and then points to - * an array of data. The array is of size numRows X numCols - * and the values are arranged in row order. That is, the - * matrix element (i, j) is stored at: - *
- *     pData[i*numCols + j]
- * 
- * - * \par Init Functions - * There is an associated initialization function for each type of matrix - * data structure. - * The initialization function sets the values of the internal structure fields. - * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() - * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. - * - * \par - * Use of the initialization function is optional. However, if initialization function is used - * then the instance structure cannot be placed into a const data section. - * To place the instance structure in a const data - * section, manually initialize the data structure. For example: - *
- * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
- * 
- * where nRows specifies the number of rows, nColumns - * specifies the number of columns, and pData points to the - * data array. - * - * \par Size Checking - * By default all of the matrix functions perform size checking on the input and - * output matrices. For example, the matrix addition function verifies that the - * two input matrices and the output matrix all have the same number of rows and - * columns. If the size check fails the functions return: - *
- *     ARM_MATH_SIZE_MISMATCH
- * 
- * Otherwise the functions return - *
- *     ARM_MATH_SUCCESS
- * 
- * There is some overhead associated with this matrix size checking. - * The matrix size checking is enabled via the \#define - *
- *     ARM_MATH_MATRIX_CHECK
- * 
- * within the library project settings. By default this macro is defined - * and size checking is enabled. By changing the project settings and - * undefining this macro size checking is eliminated and the functions - * run a bit faster. With size checking disabled the functions always - * return ARM_MATH_SUCCESS. - */ - -/** - * @defgroup groupTransforms Transform Functions - */ - -/** - * @defgroup groupController Controller Functions - */ - -/** - * @defgroup groupStats Statistics Functions - */ -/** - * @defgroup groupSupport Support Functions - */ - -/** - * @defgroup groupInterpolation Interpolation Functions - * These functions perform 1- and 2-dimensional interpolation of data. - * Linear interpolation is used for 1-dimensional data and - * bilinear interpolation is used for 2-dimensional data. - */ - -/** - * @defgroup groupExamples Examples - */ -#ifndef _ARM_MATH_H -#define _ARM_MATH_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ - -#if defined(ARM_MATH_CM7) - #include "core_cm7.h" -#elif defined (ARM_MATH_CM4) - #include "core_cm4.h" -#elif defined (ARM_MATH_CM3) - #include "core_cm3.h" -#elif defined (ARM_MATH_CM0) - #include "core_cm0.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_CM0PLUS) - #include "core_cm0plus.h" - #define ARM_MATH_CM0_FAMILY -#else - #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" -#endif - -#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ -#include "string.h" -#include "math.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** - * @brief Macros required for reciprocal calculation in Normalized LMS - */ - -#define DELTA_Q31 (0x100) -#define DELTA_Q15 0x5 -#define INDEX_MASK 0x0000003F -#ifndef PI -#define PI 3.14159265358979f -#endif - -/** - * @brief Macros required for SINE and COSINE Fast math approximations - */ - -#define FAST_MATH_TABLE_SIZE 512 -#define FAST_MATH_Q31_SHIFT (32 - 10) -#define FAST_MATH_Q15_SHIFT (16 - 10) -#define CONTROLLER_Q31_SHIFT (32 - 9) -#define TABLE_SIZE 256 -#define TABLE_SPACING_Q31 0x400000 -#define TABLE_SPACING_Q15 0x80 - -/** - * @brief Macros required for SINE and COSINE Controller functions - */ -/* 1.31(q31) Fixed value of 2/360 */ -/* -1 to +1 is divided into 360 values so total spacing is (2/360) */ -#define INPUT_SPACING 0xB60B61 - -/** - * @brief Macro for Unaligned Support - */ -#ifndef UNALIGNED_SUPPORT_DISABLE -#define ALIGN4 -#else -#if defined (__GNUC__) -#define ALIGN4 __attribute__((aligned(4))) -#else -#define ALIGN4 __align(4) -#endif -#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ - -/** - * @brief Error status returned by some functions in the library. - */ - -typedef enum -{ - ARM_MATH_SUCCESS = 0, /**< No error */ - ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ - ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ - ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ - ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ - ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ - ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ -} arm_status; - -/** - * @brief 8-bit fractional data type in 1.7 format. - */ -typedef int8_t q7_t; - -/** - * @brief 16-bit fractional data type in 1.15 format. - */ -typedef int16_t q15_t; - -/** - * @brief 32-bit fractional data type in 1.31 format. - */ -typedef int32_t q31_t; - -/** - * @brief 64-bit fractional data type in 1.63 format. - */ -typedef int64_t q63_t; - -/** - * @brief 32-bit floating-point type definition. - */ -typedef float float32_t; - -/** - * @brief 64-bit floating-point type definition. - */ -typedef double float64_t; - -/** - * @brief definition to read/write two 16 bit values. - */ -#if defined __CC_ARM -#define __SIMD32_TYPE int32_t __packed -#define CMSIS_UNUSED __attribute__((unused)) - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __GNUC__ -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __ICCARM__ -#define __SIMD32_TYPE int32_t __packed -#define CMSIS_UNUSED - -#elif defined __CSMC__ -#define __SIMD32_TYPE int32_t -#define CMSIS_UNUSED - -#elif defined __TASKING__ -#define __SIMD32_TYPE __unaligned int32_t -#define CMSIS_UNUSED - -#else -#error Unknown compiler -#endif - -#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) -#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) -#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) -#define __SIMD64(addr) (*(int64_t **) & (addr)) - -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) -/** - * @brief definition to pack two 16 bit values. - */ -#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ - (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) -#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ - (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) - -#endif - - -/** -* @brief definition to pack four 8 bit values. -*/ -#ifndef ARM_MATH_BIG_ENDIAN - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) -#else - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) - -#endif - - -/** - * @brief Clips Q63 to Q31 values. - */ -static __INLINE q31_t clip_q63_to_q31( - q63_t x) -{ - return ((q31_t)(x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFFFFFF ^ ((q31_t)(x >> 63)))) : (q31_t) x; -} - -/** - * @brief Clips Q63 to Q15 values. - */ -static __INLINE q15_t clip_q63_to_q15( - q63_t x) -{ - return ((q31_t)(x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFF ^ ((q15_t)(x >> 63)))) : (q15_t)(x >> 15); -} - -/** - * @brief Clips Q31 to Q7 values. - */ -static __INLINE q7_t clip_q31_to_q7( - q31_t x) -{ - return ((q31_t)(x >> 24) != ((q31_t) x >> 23)) ? - ((0x7F ^ ((q7_t)(x >> 31)))) : (q7_t) x; -} - -/** - * @brief Clips Q31 to Q15 values. - */ -static __INLINE q15_t clip_q31_to_q15( - q31_t x) -{ - return ((q31_t)(x >> 16) != ((q31_t) x >> 15)) ? - ((0x7FFF ^ ((q15_t)(x >> 31)))) : (q15_t) x; -} - -/** - * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. - */ - -static __INLINE q63_t mult32x64( - q63_t x, - q31_t y) -{ - return ((((q63_t)(x & 0x00000000FFFFFFFF) * y) >> 32) + - (((q63_t)(x >> 32) * y))); -} - -/* - #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) - #define __CLZ __clz - #endif - */ -/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ -#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) -static __INLINE uint32_t __CLZ( - q31_t data); - -static __INLINE uint32_t __CLZ( - q31_t data) -{ - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while ((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); -} -#endif - -/** - * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. - */ - -static __INLINE uint32_t arm_recip_q31( - q31_t in, - q31_t *dst, - q31_t *pRecipTable) -{ - q31_t out; - uint32_t tempVal; - uint32_t index, i; - uint32_t signBits; - - if (in > 0) - { - signBits = ((uint32_t)(__CLZ(in) - 1)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 1)); - } - - /* Convert input sample to 1.31 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 24); - index = (index & INDEX_MASK); - - /* 1.31 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t)(((q63_t) in * out) >> 31); - tempVal = 0x7FFFFFFFu - tempVal; - /* 1.31 with exp 1 */ - /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ - out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1u); -} - - -/** - * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. - */ -static __INLINE uint32_t arm_recip_q15( - q15_t in, - q15_t *dst, - q15_t *pRecipTable) -{ - q15_t out = 0; - uint32_t tempVal = 0; - uint32_t index = 0, i = 0; - uint32_t signBits = 0; - - if (in > 0) - { - signBits = ((uint32_t)(__CLZ(in) - 17)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 17)); - } - - /* Convert input sample to 1.15 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 8); - index = (index & INDEX_MASK); - - /* 1.15 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t)(((q31_t) in * out) >> 15); - tempVal = 0x7FFFu - tempVal; - /* 1.15 with exp 1 */ - out = (q15_t)(((q31_t) out * tempVal) >> 14); - /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1); -} - - -/* - * @brief C custom defined intrinisic function for only M0 processors - */ -#if defined(ARM_MATH_CM0_FAMILY) -static __INLINE q31_t __SSAT( - q31_t x, - uint32_t y) -{ - int32_t posMax, negMin; - uint32_t i; - - posMax = 1; - for (i = 0; i < (y - 1); i++) - { - posMax = posMax * 2; - } - - if (x > 0) - { - posMax = (posMax - 1); - - if (x > posMax) - { - x = posMax; - } - } - else - { - negMin = -posMax; - - if (x < negMin) - { - x = negMin; - } - } - return (x); -} -#endif /* end of ARM_MATH_CM0_FAMILY */ - - -/* - * @brief C custom defined intrinsic function for M3 and M0 processors - */ -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - -/* - * @brief C custom defined QADD8 for M3 and M0 processors - */ -static __INLINE uint32_t __QADD8( - uint32_t x, - uint32_t y) -{ - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x) >> 24) + (((q31_t)y) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r))); -} - - -/* - * @brief C custom defined QSUB8 for M3 and M0 processors - */ -static __INLINE uint32_t __QSUB8( - uint32_t x, - uint32_t y) -{ - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x) >> 24) - (((q31_t)y) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r))); -} - - -/* - * @brief C custom defined QADD16 for M3 and M0 processors - */ -static __INLINE uint32_t __QADD16( - uint32_t x, - uint32_t y) -{ - /* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ - q31_t r = 0, s = 0; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) + (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHADD16 for M3 and M0 processors - */ -static __INLINE uint32_t __SHADD16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) + (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QSUB16 for M3 and M0 processors - */ -static __INLINE uint32_t __QSUB16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) - (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHSUB16 for M3 and M0 processors - */ -static __INLINE uint32_t __SHSUB16( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) - (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QASX for M3 and M0 processors - */ -static __INLINE uint32_t __QASX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHASX for M3 and M0 processors - */ -static __INLINE uint32_t __SHASX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined QSAX for M3 and M0 processors - */ -static __INLINE uint32_t __QSAX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SHSAX for M3 and M0 processors - */ -static __INLINE uint32_t __SHSAX( - uint32_t x, - uint32_t y) -{ - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r))); -} - - -/* - * @brief C custom defined SMUSDX for M3 and M0 processors - */ -static __INLINE uint32_t __SMUSDX( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)))); -} - -/* - * @brief C custom defined SMUADX for M3 and M0 processors - */ -static __INLINE uint32_t __SMUADX( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)))); -} - - -/* - * @brief C custom defined QADD for M3 and M0 processors - */ -static __INLINE int32_t __QADD( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); -} - - -/* - * @brief C custom defined QSUB for M3 and M0 processors - */ -static __INLINE int32_t __QSUB( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); -} - - -/* - * @brief C custom defined SMLAD for M3 and M0 processors - */ -static __INLINE uint32_t __SMLAD( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLADX for M3 and M0 processors - */ -static __INLINE uint32_t __SMLADX( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLSDX for M3 and M0 processors - */ -static __INLINE uint32_t __SMLSDX( - uint32_t x, - uint32_t y, - uint32_t sum) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q31_t)sum)))); -} - - -/* - * @brief C custom defined SMLALD for M3 and M0 processors - */ -static __INLINE uint64_t __SMLALD( - uint32_t x, - uint32_t y, - uint64_t sum) -{ - /* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)) + - (((q63_t)sum)))); -} - - -/* - * @brief C custom defined SMLALDX for M3 and M0 processors - */ -static __INLINE uint64_t __SMLALDX( - uint32_t x, - uint32_t y, - uint64_t sum) -{ - /* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y << 16) >> 16)) + - (((q63_t)sum)))); -} - - -/* - * @brief C custom defined SMUAD for M3 and M0 processors - */ -static __INLINE uint32_t __SMUAD( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)))); -} - - -/* - * @brief C custom defined SMUSD for M3 and M0 processors - */ -static __INLINE uint32_t __SMUSD( - uint32_t x, - uint32_t y) -{ - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - - ((((q31_t)x) >> 16) * (((q31_t)y) >> 16)))); -} - - -/* - * @brief C custom defined SXTB16 for M3 and M0 processors - */ -static __INLINE uint32_t __SXTB16( - uint32_t x) -{ - return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | - ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000))); -} - -#endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ - - -/** - * @brief Instance structure for the Q7 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ -} arm_fir_instance_q7; - -/** - * @brief Instance structure for the Q15 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ -} arm_fir_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ -} arm_fir_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ -} arm_fir_instance_f32; - - -/** - * @brief Processing function for the Q7 FIR filter. - * @param[in] S points to an instance of the Q7 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q7( - const arm_fir_instance_q7 *S, - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q7 FIR filter. - * @param[in,out] S points to an instance of the Q7 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed. - */ -void arm_fir_init_q7( - arm_fir_instance_q7 *S, - uint16_t numTaps, - q7_t *pCoeffs, - q7_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR filter. - * @param[in] S points to an instance of the Q15 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q15( - const arm_fir_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_fast_q15( - const arm_fir_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR filter. - * @param[in,out] S points to an instance of the Q15 FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if - * numTaps is not a supported value. - */ -arm_status arm_fir_init_q15( - arm_fir_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR filter. - * @param[in] S points to an instance of the Q31 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_q31( - const arm_fir_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_fast_q31( - const arm_fir_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR filter. - * @param[in,out] S points to an instance of the Q31 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ -void arm_fir_init_q31( - arm_fir_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point FIR filter. - * @param[in] S points to an instance of the floating-point FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_f32( - const arm_fir_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR filter. - * @param[in,out] S points to an instance of the floating-point FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ -void arm_fir_init_f32( - arm_fir_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 Biquad cascade filter. - */ -typedef struct -{ - int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ -} arm_biquad_casd_df1_inst_q15; - -/** - * @brief Instance structure for the Q31 Biquad cascade filter. - */ -typedef struct -{ - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ -} arm_biquad_casd_df1_inst_q31; - -/** - * @brief Instance structure for the floating-point Biquad cascade filter. - */ -typedef struct -{ - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_casd_df1_inst_f32; - - -/** - * @brief Processing function for the Q15 Biquad cascade filter. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_q15( - const arm_biquad_casd_df1_inst_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cascade_df1_init_q15( - arm_biquad_casd_df1_inst_q15 *S, - uint8_t numStages, - q15_t *pCoeffs, - q15_t *pState, - int8_t postShift); - - -/** - * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_fast_q15( - const arm_biquad_casd_df1_inst_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 Biquad cascade filter - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_q31( - const arm_biquad_casd_df1_inst_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_fast_q31( - const arm_biquad_casd_df1_inst_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cascade_df1_init_q31( - arm_biquad_casd_df1_inst_q31 *S, - uint8_t numStages, - q31_t *pCoeffs, - q31_t *pState, - int8_t postShift); - - -/** - * @brief Processing function for the floating-point Biquad cascade filter. - * @param[in] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df1_f32( - const arm_biquad_casd_df1_inst_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point Biquad cascade filter. - * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df1_init_f32( - arm_biquad_casd_df1_inst_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Instance structure for the floating-point matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float32_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_f32; - - -/** - * @brief Instance structure for the floating-point matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float64_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_f64; - -/** - * @brief Instance structure for the Q15 matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q15_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_q15; - -/** - * @brief Instance structure for the Q31 matrix structure. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q31_t *pData; /**< points to the data of the matrix. */ -} arm_matrix_instance_q31; - - -/** - * @brief Floating-point matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_add_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pScratch); - - -/** - * @brief Q31, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_cmplx_mult_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_f32( - const arm_matrix_instance_f32 *pSrc, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_q15( - const arm_matrix_instance_q15 *pSrc, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_trans_q31( - const arm_matrix_instance_q31 *pSrc, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pState); - - -/** - * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_fast_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pState); - - -/** - * @brief Q31 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_mult_fast_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_f32( - const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_q15( - const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_sub_q31( - const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Floating-point matrix scaling. - * @param[in] pSrc points to the input matrix - * @param[in] scale scale factor - * @param[out] pDst points to the output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_f32( - const arm_matrix_instance_f32 *pSrc, - float32_t scale, - arm_matrix_instance_f32 *pDst); - - -/** - * @brief Q15 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_q15( - const arm_matrix_instance_q15 *pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 *pDst); - - -/** - * @brief Q31 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ -arm_status arm_mat_scale_q31( - const arm_matrix_instance_q31 *pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 *pDst); - - -/** - * @brief Q31 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_q31( - arm_matrix_instance_q31 *S, - uint16_t nRows, - uint16_t nColumns, - q31_t *pData); - - -/** - * @brief Q15 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_q15( - arm_matrix_instance_q15 *S, - uint16_t nRows, - uint16_t nColumns, - q15_t *pData); - - -/** - * @brief Floating-point matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ -void arm_mat_init_f32( - arm_matrix_instance_f32 *S, - uint16_t nRows, - uint16_t nColumns, - float32_t *pData); - - - -/** - * @brief Instance structure for the Q15 PID Control. - */ -typedef struct -{ - q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ -#ifdef ARM_MATH_CM0_FAMILY - q15_t A1; - q15_t A2; -#else - q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ -#endif - q15_t state[3]; /**< The state array of length 3. */ - q15_t Kp; /**< The proportional gain. */ - q15_t Ki; /**< The integral gain. */ - q15_t Kd; /**< The derivative gain. */ -} arm_pid_instance_q15; - -/** - * @brief Instance structure for the Q31 PID Control. - */ -typedef struct -{ - q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - q31_t A2; /**< The derived gain, A2 = Kd . */ - q31_t state[3]; /**< The state array of length 3. */ - q31_t Kp; /**< The proportional gain. */ - q31_t Ki; /**< The integral gain. */ - q31_t Kd; /**< The derivative gain. */ -} arm_pid_instance_q31; - -/** - * @brief Instance structure for the floating-point PID Control. - */ -typedef struct -{ - float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - float32_t A2; /**< The derived gain, A2 = Kd . */ - float32_t state[3]; /**< The state array of length 3. */ - float32_t Kp; /**< The proportional gain. */ - float32_t Ki; /**< The integral gain. */ - float32_t Kd; /**< The derivative gain. */ -} arm_pid_instance_f32; - - - -/** - * @brief Initialization function for the floating-point PID Control. - * @param[in,out] S points to an instance of the PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_f32( - arm_pid_instance_f32 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - */ -void arm_pid_reset_f32( - arm_pid_instance_f32 *S); - - -/** - * @brief Initialization function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_q31( - arm_pid_instance_q31 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - */ - -void arm_pid_reset_q31( - arm_pid_instance_q31 *S); - - -/** - * @brief Initialization function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ -void arm_pid_init_q15( - arm_pid_instance_q15 *S, - int32_t resetStateFlag); - - -/** - * @brief Reset function for the Q15 PID Control. - * @param[in,out] S points to an instance of the q15 PID Control structure - */ -void arm_pid_reset_q15( - arm_pid_instance_q15 *S); - - -/** - * @brief Instance structure for the floating-point Linear Interpolate function. - */ -typedef struct -{ - uint32_t nValues; /**< nValues */ - float32_t x1; /**< x1 */ - float32_t xSpacing; /**< xSpacing */ - float32_t *pYData; /**< pointer to the table of Y values */ -} arm_linear_interp_instance_f32; - -/** - * @brief Instance structure for the floating-point bilinear interpolation function. - */ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - float32_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_f32; - -/** -* @brief Instance structure for the Q31 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q31_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q31; - -/** -* @brief Instance structure for the Q15 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q15_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q15; - -/** -* @brief Instance structure for the Q15 bilinear interpolation function. -*/ -typedef struct -{ - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q7_t *pData; /**< points to the data table. */ -} arm_bilinear_interp_instance_q7; - - -/** - * @brief Q7 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_mult_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix2_instance_q15; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_q15( - arm_cfft_radix2_instance_q15 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_q15( - const arm_cfft_radix2_instance_q15 *S, - q15_t *pSrc); - - -/** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix4_instance_q15; - -/* Deprecated */ -arm_status arm_cfft_radix4_init_q15( - arm_cfft_radix4_instance_q15 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix4_q15( - const arm_cfft_radix4_instance_q15 *S, - q15_t *pSrc); - -/** - * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix2_instance_q31; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_q31( - arm_cfft_radix2_instance_q31 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_q31( - const arm_cfft_radix2_instance_q31 *S, - q31_t *pSrc); - -/** - * @brief Instance structure for the Q31 CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ -} arm_cfft_radix4_instance_q31; - -/* Deprecated */ -void arm_cfft_radix4_q31( - const arm_cfft_radix4_instance_q31 *S, - q31_t *pSrc); - -/* Deprecated */ -arm_status arm_cfft_radix4_init_q31( - arm_cfft_radix4_instance_q31 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ -} arm_cfft_radix2_instance_f32; - -/* Deprecated */ -arm_status arm_cfft_radix2_init_f32( - arm_cfft_radix2_instance_f32 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix2_f32( - const arm_cfft_radix2_instance_f32 *S, - float32_t *pSrc); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ -} arm_cfft_radix4_instance_f32; - -/* Deprecated */ -arm_status arm_cfft_radix4_init_f32( - arm_cfft_radix4_instance_f32 *S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ -void arm_cfft_radix4_f32( - const arm_cfft_radix4_instance_f32 *S, - float32_t *pSrc); - -/** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_q15; - -void arm_cfft_q15( - const arm_cfft_instance_q15 *S, - q15_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_q31; - -void arm_cfft_q31( - const arm_cfft_instance_q31 *S, - q31_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ -typedef struct -{ - uint16_t fftLen; /**< length of the FFT. */ - const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ -} arm_cfft_instance_f32; - -void arm_cfft_f32( - const arm_cfft_instance_f32 *S, - float32_t *p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/** - * @brief Instance structure for the Q15 RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_q15; - -arm_status arm_rfft_init_q15( - arm_rfft_instance_q15 *S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_q15( - const arm_rfft_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst); - -/** - * @brief Instance structure for the Q31 RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_q31; - -arm_status arm_rfft_init_q31( - arm_rfft_instance_q31 *S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_q31( - const arm_rfft_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst); - -/** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct -{ - uint32_t fftLenReal; /**< length of the real FFT. */ - uint16_t fftLenBy2; /**< length of the complex FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ -} arm_rfft_instance_f32; - -arm_status arm_rfft_init_f32( - arm_rfft_instance_f32 *S, - arm_cfft_radix4_instance_f32 *S_CFFT, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - -void arm_rfft_f32( - const arm_rfft_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst); - -/** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct -{ - arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ - uint16_t fftLenRFFT; /**< length of the real sequence */ - float32_t *pTwiddleRFFT; /**< Twiddle factors real stage */ -} arm_rfft_fast_instance_f32 ; - -arm_status arm_rfft_fast_init_f32( - arm_rfft_fast_instance_f32 *S, - uint16_t fftLen); - -void arm_rfft_fast_f32( - arm_rfft_fast_instance_f32 *S, - float32_t *p, float32_t *pOut, - uint8_t ifftFlag); - -/** - * @brief Instance structure for the floating-point DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - float32_t normalize; /**< normalizing factor. */ - float32_t *pTwiddle; /**< points to the twiddle factor table. */ - float32_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_f32; - - -/** - * @brief Initialization function for the floating-point DCT4/IDCT4. - * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. - */ -arm_status arm_dct4_init_f32( - arm_dct4_instance_f32 *S, - arm_rfft_instance_f32 *S_RFFT, - arm_cfft_radix4_instance_f32 *S_CFFT, - uint16_t N, - uint16_t Nby2, - float32_t normalize); - - -/** - * @brief Processing function for the floating-point DCT4/IDCT4. - * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_f32( - const arm_dct4_instance_f32 *S, - float32_t *pState, - float32_t *pInlineBuffer); - - -/** - * @brief Instance structure for the Q31 DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q31_t normalize; /**< normalizing factor. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - q31_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_q31; - - -/** - * @brief Initialization function for the Q31 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure - * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ -arm_status arm_dct4_init_q31( - arm_dct4_instance_q31 *S, - arm_rfft_instance_q31 *S_RFFT, - arm_cfft_radix4_instance_q31 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize); - - -/** - * @brief Processing function for the Q31 DCT4/IDCT4. - * @param[in] S points to an instance of the Q31 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_q31( - const arm_dct4_instance_q31 *S, - q31_t *pState, - q31_t *pInlineBuffer); - - -/** - * @brief Instance structure for the Q15 DCT4/IDCT4 function. - */ -typedef struct -{ - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q15_t normalize; /**< normalizing factor. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - q15_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ -} arm_dct4_instance_q15; - - -/** - * @brief Initialization function for the Q15 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ -arm_status arm_dct4_init_q15( - arm_dct4_instance_q15 *S, - arm_rfft_instance_q15 *S_RFFT, - arm_cfft_radix4_instance_q15 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize); - - -/** - * @brief Processing function for the Q15 DCT4/IDCT4. - * @param[in] S points to an instance of the Q15 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ -void arm_dct4_q15( - const arm_dct4_instance_q15 *S, - q15_t *pState, - q15_t *pInlineBuffer); - - -/** - * @brief Floating-point vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_add_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q7( - q7_t *pSrcA, - q7_t *pSrcB, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ -void arm_sub_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a floating-point vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scale scale factor to be applied - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_f32( - float32_t *pSrc, - float32_t scale, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q7 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q7( - q7_t *pSrc, - q7_t scaleFract, - int8_t shift, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q15 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q15( - q15_t *pSrc, - q15_t scaleFract, - int8_t shift, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Multiplies a Q31 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_scale_q31( - q31_t *pSrc, - q31_t scaleFract, - int8_t shift, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q7 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Floating-point vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q15 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Q31 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ -void arm_abs_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Dot product of floating-point vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_f32( - float32_t *pSrcA, - float32_t *pSrcB, - uint32_t blockSize, - float32_t *result); - - -/** - * @brief Dot product of Q7 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q7( - q7_t *pSrcA, - q7_t *pSrcB, - uint32_t blockSize, - q31_t *result); - - -/** - * @brief Dot product of Q15 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q15( - q15_t *pSrcA, - q15_t *pSrcB, - uint32_t blockSize, - q63_t *result); - - -/** - * @brief Dot product of Q31 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ -void arm_dot_prod_q31( - q31_t *pSrcA, - q31_t *pSrcB, - uint32_t blockSize, - q63_t *result); - - -/** - * @brief Shifts the elements of a Q7 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q7( - q7_t *pSrc, - int8_t shiftBits, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Shifts the elements of a Q15 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q15( - q15_t *pSrc, - int8_t shiftBits, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Shifts the elements of a Q31 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_shift_q31( - q31_t *pSrc, - int8_t shiftBits, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_f32( - float32_t *pSrc, - float32_t offset, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q7( - q7_t *pSrc, - q7_t offset, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q15( - q15_t *pSrc, - q15_t offset, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Adds a constant offset to a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_offset_q31( - q31_t *pSrc, - q31_t offset, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Negates the elements of a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ -void arm_negate_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a floating-point vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q7 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q7( - q7_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Copies the elements of a Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_copy_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a floating-point vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_f32( - float32_t value, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q7 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q7( - q7_t value, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q15 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q15( - q15_t value, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Fills a constant value into a Q31 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_fill_q31( - q31_t value, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ -void arm_conv_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ -void arm_conv_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - */ -void arm_conv_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ -void arm_conv_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** -* @brief Convolution of Q7 sequences. -* @param[in] pSrcA points to the first input sequence. -* @param[in] srcALen length of the first input sequence. -* @param[in] pSrcB points to the second input sequence. -* @param[in] srcBLen length of the second input sequence. -* @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. -* @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. -* @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). -*/ -void arm_conv_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. - */ -void arm_conv_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst); - - -/** - * @brief Partial convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Partial convolution of Q7 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Partial convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ -arm_status arm_conv_partial_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - uint32_t firstIndex, - uint32_t numPoints); - - -/** - * @brief Instance structure for the Q15 FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR decimator. - */ -typedef struct -{ - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ -} arm_fir_decimate_instance_f32; - - -/** - * @brief Processing function for the floating-point FIR decimator. - * @param[in] S points to an instance of the floating-point FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_f32( - const arm_fir_decimate_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR decimator. - * @param[in,out] S points to an instance of the floating-point FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_f32( - arm_fir_decimate_instance_f32 *S, - uint16_t numTaps, - uint8_t M, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR decimator. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_q15( - const arm_fir_decimate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_fast_q15( - const arm_fir_decimate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR decimator. - * @param[in,out] S points to an instance of the Q15 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_q15( - arm_fir_decimate_instance_q15 *S, - uint16_t numTaps, - uint8_t M, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR decimator. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_q31( - const arm_fir_decimate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - -/** - * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_decimate_fast_q31( - arm_fir_decimate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR decimator. - * @param[in,out] S points to an instance of the Q31 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ -arm_status arm_fir_decimate_init_q31( - arm_fir_decimate_instance_q31 *S, - uint16_t numTaps, - uint8_t M, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ -} arm_fir_interpolate_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ -} arm_fir_interpolate_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR interpolator. - */ -typedef struct -{ - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ -} arm_fir_interpolate_instance_f32; - - -/** - * @brief Processing function for the Q15 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_q15( - const arm_fir_interpolate_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 FIR interpolator. - * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_q15( - arm_fir_interpolate_instance_q15 *S, - uint8_t L, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_q31( - const arm_fir_interpolate_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR interpolator. - * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_q31( - arm_fir_interpolate_instance_q31 *S, - uint8_t L, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point FIR interpolator. - * @param[in] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_interpolate_f32( - const arm_fir_interpolate_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR interpolator. - * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ -arm_status arm_fir_interpolate_init_f32( - arm_fir_interpolate_instance_f32 *S, - uint8_t L, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the high precision Q31 Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ -} arm_biquad_cas_df1_32x64_ins_q31; - - -/** - * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cas_df1_32x64_q31( - const arm_biquad_cas_df1_32x64_ins_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format - */ -void arm_biquad_cas_df1_32x64_init_q31( - arm_biquad_cas_df1_32x64_ins_q31 *S, - uint8_t numStages, - q31_t *pCoeffs, - q63_t *pState, - uint8_t postShift); - - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_df2T_instance_f32; - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_stereo_df2T_instance_f32; - -/** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ -typedef struct -{ - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ -} arm_biquad_cascade_df2T_instance_f64; - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df2T_f32( - const arm_biquad_cascade_df2T_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_stereo_df2T_f32( - const arm_biquad_cascade_stereo_df2T_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_biquad_cascade_df2T_f64( - const arm_biquad_cascade_df2T_instance_f64 *S, - float64_t *pSrc, - float64_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df2T_init_f32( - arm_biquad_cascade_df2T_instance_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_stereo_df2T_init_f32( - arm_biquad_cascade_stereo_df2T_instance_f32 *S, - uint8_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ -void arm_biquad_cascade_df2T_init_f64( - arm_biquad_cascade_df2T_instance_f64 *S, - uint8_t numStages, - float64_t *pCoeffs, - float64_t *pState); - - -/** - * @brief Instance structure for the Q15 FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_q15; - -/** - * @brief Instance structure for the Q31 FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_q31; - -/** - * @brief Instance structure for the floating-point FIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of filter stages. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ -} arm_fir_lattice_instance_f32; - - -/** - * @brief Initialization function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_q15( - arm_fir_lattice_instance_q15 *S, - uint16_t numStages, - q15_t *pCoeffs, - q15_t *pState); - - -/** - * @brief Processing function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_q15( - const arm_fir_lattice_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_q31( - arm_fir_lattice_instance_q31 *S, - uint16_t numStages, - q31_t *pCoeffs, - q31_t *pState); - - -/** - * @brief Processing function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_q31( - const arm_fir_lattice_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ -void arm_fir_lattice_init_f32( - arm_fir_lattice_instance_f32 *S, - uint16_t numStages, - float32_t *pCoeffs, - float32_t *pState); - - -/** - * @brief Processing function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void arm_fir_lattice_f32( - const arm_fir_lattice_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_q15; - -/** - * @brief Instance structure for the Q31 IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_q31; - -/** - * @brief Instance structure for the floating-point IIR lattice filter. - */ -typedef struct -{ - uint16_t numStages; /**< number of stages in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ -} arm_iir_lattice_instance_f32; - - -/** - * @brief Processing function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_f32( - const arm_iir_lattice_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_init_f32( - arm_iir_lattice_instance_f32 *S, - uint16_t numStages, - float32_t *pkCoeffs, - float32_t *pvCoeffs, - float32_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_q31( - const arm_iir_lattice_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_init_q31( - arm_iir_lattice_instance_q31 *S, - uint16_t numStages, - q31_t *pkCoeffs, - q31_t *pvCoeffs, - q31_t *pState, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the Q15 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ -void arm_iir_lattice_q15( - const arm_iir_lattice_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. - * @param[in] pState points to state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process per call. - */ -void arm_iir_lattice_init_q15( - arm_iir_lattice_instance_q15 *S, - uint16_t numStages, - q15_t *pkCoeffs, - q15_t *pvCoeffs, - q15_t *pState, - uint32_t blockSize); - - -/** - * @brief Instance structure for the floating-point LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that controls filter coefficient updates. */ -} arm_lms_instance_f32; - - -/** - * @brief Processing function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_f32( - const arm_lms_instance_f32 *S, - float32_t *pSrc, - float32_t *pRef, - float32_t *pOut, - float32_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_init_f32( - arm_lms_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - float32_t mu, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q15 LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ -} arm_lms_instance_q15; - - -/** - * @brief Initialization function for the Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_init_q15( - arm_lms_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - q15_t mu, - uint32_t blockSize, - uint32_t postShift); - - -/** - * @brief Processing function for Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_q15( - const arm_lms_instance_q15 *S, - q15_t *pSrc, - q15_t *pRef, - q15_t *pOut, - q15_t *pErr, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q31 LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ -} arm_lms_instance_q31; - - -/** - * @brief Processing function for Q31 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_q31( - const arm_lms_instance_q31 *S, - q31_t *pSrc, - q31_t *pRef, - q31_t *pOut, - q31_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q31 LMS filter. - * @param[in] S points to an instance of the Q31 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_init_q31( - arm_lms_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - q31_t mu, - uint32_t blockSize, - uint32_t postShift); - - -/** - * @brief Instance structure for the floating-point normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that control filter coefficient updates. */ - float32_t energy; /**< saves previous frame energy. */ - float32_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_f32; - - -/** - * @brief Processing function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_f32( - arm_lms_norm_instance_f32 *S, - float32_t *pSrc, - float32_t *pRef, - float32_t *pOut, - float32_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_init_f32( - arm_lms_norm_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - float32_t mu, - uint32_t blockSize); - - -/** - * @brief Instance structure for the Q31 normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q31_t *recipTable; /**< points to the reciprocal initial value table. */ - q31_t energy; /**< saves previous frame energy. */ - q31_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_q31; - - -/** - * @brief Processing function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_q31( - arm_lms_norm_instance_q31 *S, - q31_t *pSrc, - q31_t *pRef, - q31_t *pOut, - q31_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_norm_init_q31( - arm_lms_norm_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - q31_t mu, - uint32_t blockSize, - uint8_t postShift); - - -/** - * @brief Instance structure for the Q15 normalized LMS filter. - */ -typedef struct -{ - uint16_t numTaps; /**< Number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q15_t *recipTable; /**< Points to the reciprocal initial value table. */ - q15_t energy; /**< saves previous frame energy. */ - q15_t x0; /**< saves previous input sample. */ -} arm_lms_norm_instance_q15; - - -/** - * @brief Processing function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ -void arm_lms_norm_q15( - arm_lms_norm_instance_q15 *S, - q15_t *pSrc, - q15_t *pRef, - q15_t *pOut, - q15_t *pErr, - uint32_t blockSize); - - -/** - * @brief Initialization function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ -void arm_lms_norm_init_q15( - arm_lms_norm_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - q15_t mu, - uint32_t blockSize, - uint8_t postShift); - - -/** - * @brief Correlation of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_f32( - float32_t *pSrcA, - uint32_t srcALen, - float32_t *pSrcB, - uint32_t srcBLen, - float32_t *pDst); - - -/** -* @brief Correlation of Q15 sequences -* @param[in] pSrcA points to the first input sequence. -* @param[in] srcALen length of the first input sequence. -* @param[in] pSrcB points to the second input sequence. -* @param[in] srcBLen length of the second input sequence. -* @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. -* @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. -*/ -void arm_correlate_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch); - - -/** - * @brief Correlation of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - -void arm_correlate_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - -void arm_correlate_fast_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst); - - -/** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ -void arm_correlate_fast_opt_q15( - q15_t *pSrcA, - uint32_t srcALen, - q15_t *pSrcB, - uint32_t srcBLen, - q15_t *pDst, - q15_t *pScratch); - - -/** - * @brief Correlation of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_fast_q31( - q31_t *pSrcA, - uint32_t srcALen, - q31_t *pSrcB, - uint32_t srcBLen, - q31_t *pDst); - - -/** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ -void arm_correlate_opt_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst, - q15_t *pScratch1, - q15_t *pScratch2); - - -/** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ -void arm_correlate_q7( - q7_t *pSrcA, - uint32_t srcALen, - q7_t *pSrcB, - uint32_t srcBLen, - q7_t *pDst); - - -/** - * @brief Instance structure for the floating-point sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_f32; - -/** - * @brief Instance structure for the Q31 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q31; - -/** - * @brief Instance structure for the Q15 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q15; - -/** - * @brief Instance structure for the Q7 sparse FIR filter. - */ -typedef struct -{ - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ -} arm_fir_sparse_instance_q7; - - -/** - * @brief Processing function for the floating-point sparse FIR filter. - * @param[in] S points to an instance of the floating-point sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_f32( - arm_fir_sparse_instance_f32 *S, - float32_t *pSrc, - float32_t *pDst, - float32_t *pScratchIn, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point sparse FIR filter. - * @param[in,out] S points to an instance of the floating-point sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_f32( - arm_fir_sparse_instance_f32 *S, - uint16_t numTaps, - float32_t *pCoeffs, - float32_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q31 sparse FIR filter. - * @param[in] S points to an instance of the Q31 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q31( - arm_fir_sparse_instance_q31 *S, - q31_t *pSrc, - q31_t *pDst, - q31_t *pScratchIn, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q31 sparse FIR filter. - * @param[in,out] S points to an instance of the Q31 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q31( - arm_fir_sparse_instance_q31 *S, - uint16_t numTaps, - q31_t *pCoeffs, - q31_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q15 sparse FIR filter. - * @param[in] S points to an instance of the Q15 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q15( - arm_fir_sparse_instance_q15 *S, - q15_t *pSrc, - q15_t *pDst, - q15_t *pScratchIn, - q31_t *pScratchOut, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 sparse FIR filter. - * @param[in,out] S points to an instance of the Q15 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q15( - arm_fir_sparse_instance_q15 *S, - uint16_t numTaps, - q15_t *pCoeffs, - q15_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Processing function for the Q7 sparse FIR filter. - * @param[in] S points to an instance of the Q7 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ -void arm_fir_sparse_q7( - arm_fir_sparse_instance_q7 *S, - q7_t *pSrc, - q7_t *pDst, - q7_t *pScratchIn, - q31_t *pScratchOut, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q7 sparse FIR filter. - * @param[in,out] S points to an instance of the Q7 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ -void arm_fir_sparse_init_q7( - arm_fir_sparse_instance_q7 *S, - uint16_t numTaps, - q7_t *pCoeffs, - q7_t *pState, - int32_t *pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - -/** - * @brief Floating-point sin_cos function. - * @param[in] theta input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cos output. - */ -void arm_sin_cos_f32( - float32_t theta, - float32_t *pSinVal, - float32_t *pCosVal); - - -/** - * @brief Q31 sin_cos function. - * @param[in] theta scaled input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cosine output. - */ -void arm_sin_cos_q31( - q31_t theta, - q31_t *pSinVal, - q31_t *pCosVal); - - -/** - * @brief Floating-point complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - -/** - * @brief Q31 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_conj_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_squared_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @ingroup groupController - */ - -/** - * @defgroup PID PID Motor Control - * - * A Proportional Integral Derivative (PID) controller is a generic feedback control - * loop mechanism widely used in industrial control systems. - * A PID controller is the most commonly used type of feedback controller. - * - * This set of functions implements (PID) controllers - * for Q15, Q31, and floating-point data types. The functions operate on a single sample - * of data and each call to the function returns a single processed value. - * S points to an instance of the PID control data structure. in - * is the input sample value. The functions return the output value. - * - * \par Algorithm: - *
- *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
- *    A0 = Kp + Ki + Kd
- *    A1 = (-Kp ) - (2 * Kd )
- *    A2 = Kd  
- * - * \par - * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant - * - * \par - * \image html PID.gif "Proportional Integral Derivative Controller" - * - * \par - * The PID controller calculates an "error" value as the difference between - * the measured output and the reference input. - * The controller attempts to minimize the error by adjusting the process control inputs. - * The proportional value determines the reaction to the current error, - * the integral value determines the reaction based on the sum of recent errors, - * and the derivative value determines the reaction based on the rate at which the error has been changing. - * - * \par Instance Structure - * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. - * A separate instance structure must be defined for each PID Controller. - * There are separate instance structure declarations for each of the 3 supported data types. - * - * \par Reset Functions - * There is also an associated reset function for each data type which clears the state array. - * - * \par Initialization Functions - * There is also an associated initialization function for each data type. - * The initialization function performs the following operations: - * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. - * - Zeros out the values in the state buffer. - * - * \par - * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. - * - * \par Fixed-Point Behavior - * Care must be taken when using the fixed-point versions of the PID Controller functions. - * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup PID - * @{ - */ - -/** - * @brief Process function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - */ -static __INLINE float32_t arm_pid_f32( - arm_pid_instance_f32 *S, - float32_t in) -{ - float32_t out; - - /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ - out = (S->A0 * in) + - (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - -} - -/** - * @brief Process function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 64-bit accumulator. - * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. - * Thus, if the accumulator result overflows it wraps around rather than clip. - * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. - * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. - */ -static __INLINE q31_t arm_pid_q31( - arm_pid_instance_q31 *S, - q31_t in) -{ - q63_t acc; - q31_t out; - - /* acc = A0 * x[n] */ - acc = (q63_t) S->A0 * in; - - /* acc += A1 * x[n-1] */ - acc += (q63_t) S->A1 * S->state[0]; - - /* acc += A2 * x[n-2] */ - acc += (q63_t) S->A2 * S->state[1]; - - /* convert output to 1.31 format to add y[n-1] */ - out = (q31_t)(acc >> 31u); - - /* out += y[n-1] */ - out += S->state[2]; - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); -} - - -/** - * @brief Process function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using a 64-bit internal accumulator. - * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. - * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. - * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. - * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. - * Lastly, the accumulator is saturated to yield a result in 1.15 format. - */ -static __INLINE q15_t arm_pid_q15( - arm_pid_instance_q15 *S, - q15_t in) -{ - q63_t acc; - q15_t out; - -#ifndef ARM_MATH_CM0_FAMILY - __SIMD32_TYPE *vstate; - - /* Implementation of PID controller */ - - /* acc = A0 * x[n] */ - acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - vstate = __SIMD32_CONST(S->state); - acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t) * vstate, (uint64_t)acc); -#else - /* acc = A0 * x[n] */ - acc = ((q31_t) S->A0) * in; - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - acc += (q31_t) S->A1 * S->state[0]; - acc += (q31_t) S->A2 * S->state[1]; -#endif - - /* acc += y[n-1] */ - acc += (q31_t) S->state[2] << 15; - - /* saturate the output */ - out = (q15_t)(__SSAT((acc >> 15), 16)); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); -} - -/** - * @} end of PID group - */ - - -/** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ -arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 *src, - arm_matrix_instance_f32 *dst); - - -/** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ -arm_status arm_mat_inverse_f64( - const arm_matrix_instance_f64 *src, - arm_matrix_instance_f64 *dst); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup clarke Vector Clarke Transform - * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. - * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents - * in the two-phase orthogonal stator axis Ialpha and Ibeta. - * When Ialpha is superposed with Ia as shown in the figure below - * \image html clarke.gif Stator current space vector and its components in (a,b). - * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta - * can be calculated using only Ia and Ib. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeFormula.gif - * where Ia and Ib are the instantaneous stator phases and - * pIalpha and pIbeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup clarke - * @{ - */ - -/** - * - * @brief Floating-point Clarke transform - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - */ -static __INLINE void arm_clarke_f32( - float32_t Ia, - float32_t Ib, - float32_t *pIalpha, - float32_t *pIbeta) -{ - /* Calculate pIalpha using the equation, pIalpha = Ia */ - *pIalpha = Ia; - - /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ - *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); -} - - -/** - * @brief Clarke transform for Q31 version - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ -static __INLINE void arm_clarke_q31( - q31_t Ia, - q31_t Ib, - q31_t *pIalpha, - q31_t *pIbeta) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIalpha from Ia by equation pIalpha = Ia */ - *pIalpha = Ia; - - /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ - product1 = (q31_t)(((q63_t) Ia * 0x24F34E8B) >> 30); - - /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ - product2 = (q31_t)(((q63_t) Ib * 0x49E69D16) >> 30); - - /* pIbeta is calculated by adding the intermediate products */ - *pIbeta = __QADD(product1, product2); -} - -/** - * @} end of clarke group - */ - -/** - * @brief Converts the elements of the Q7 vector to Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_q7_to_q31( - q7_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup inv_clarke Vector Inverse Clarke Transform - * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeInvFormula.gif - * where pIa and pIb are the instantaneous stator phases and - * Ialpha and Ibeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup inv_clarke - * @{ - */ - -/** -* @brief Floating-point Inverse Clarke transform -* @param[in] Ialpha input two-phase orthogonal vector axis alpha -* @param[in] Ibeta input two-phase orthogonal vector axis beta -* @param[out] pIa points to output three-phase coordinate a -* @param[out] pIb points to output three-phase coordinate b -*/ -static __INLINE void arm_inv_clarke_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t *pIa, - float32_t *pIb) -{ - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ - *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; -} - - -/** - * @brief Inverse Clarke transform for Q31 version - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the subtraction, hence there is no risk of overflow. - */ -static __INLINE void arm_inv_clarke_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t *pIa, - q31_t *pIb) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ - product1 = (q31_t)(((q63_t)(Ialpha) * (0x40000000)) >> 31); - - /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ - product2 = (q31_t)(((q63_t)(Ibeta) * (0x6ED9EBA1)) >> 31); - - /* pIb is calculated by subtracting the products */ - *pIb = __QSUB(product2, product1); -} - -/** - * @} end of inv_clarke group - */ - -/** - * @brief Converts the elements of the Q7 vector to Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ -void arm_q7_to_q15( - q7_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - - -/** - * @ingroup groupController - */ - -/** - * @defgroup park Vector Park Transform - * - * Forward Park transform converts the input two-coordinate vector to flux and torque components. - * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents - * from the stationary to the moving reference frame and control the spatial relationship between - * the stator vector current and rotor flux vector. - * If we consider the d axis aligned with the rotor flux, the diagram below shows the - * current vector and the relationship from the two reference frames: - * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkFormula.gif - * where Ialpha and Ibeta are the stator vector components, - * pId and pIq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup park - * @{ - */ - -/** - * @brief Floating-point Park transform - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * The function implements the forward Park transform. - * - */ -static __INLINE void arm_park_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t *pId, - float32_t *pIq, - float32_t sinVal, - float32_t cosVal) -{ - /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ - *pId = Ialpha * cosVal + Ibeta * sinVal; - - /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ - *pIq = -Ialpha * sinVal + Ibeta * cosVal; -} - - -/** - * @brief Park transform for Q31 version - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition and subtraction, hence there is no risk of overflow. - */ -static __INLINE void arm_park_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t *pId, - q31_t *pIq, - q31_t sinVal, - q31_t cosVal) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Ialpha * cosVal) */ - product1 = (q31_t)(((q63_t)(Ialpha) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * sinVal) */ - product2 = (q31_t)(((q63_t)(Ibeta) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Ialpha * sinVal) */ - product3 = (q31_t)(((q63_t)(Ialpha) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * cosVal) */ - product4 = (q31_t)(((q63_t)(Ibeta) * (cosVal)) >> 31); - - /* Calculate pId by adding the two intermediate products 1 and 2 */ - *pId = __QADD(product1, product2); - - /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ - *pIq = __QSUB(product4, product3); -} - -/** - * @} end of park group - */ - -/** - * @brief Converts the elements of the Q7 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q7_to_float( - q7_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @ingroup groupController - */ - -/** - * @defgroup inv_park Vector Inverse Park transform - * Inverse Park transform converts the input flux and torque components to two-coordinate vector. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkInvFormula.gif - * where pIalpha and pIbeta are the stator vector components, - * Id and Iq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - -/** - * @addtogroup inv_park - * @{ - */ - -/** -* @brief Floating-point Inverse Park transform -* @param[in] Id input coordinate of rotor reference frame d -* @param[in] Iq input coordinate of rotor reference frame q -* @param[out] pIalpha points to output two-phase orthogonal vector axis alpha -* @param[out] pIbeta points to output two-phase orthogonal vector axis beta -* @param[in] sinVal sine value of rotation angle theta -* @param[in] cosVal cosine value of rotation angle theta -*/ -static __INLINE void arm_inv_park_f32( - float32_t Id, - float32_t Iq, - float32_t *pIalpha, - float32_t *pIbeta, - float32_t sinVal, - float32_t cosVal) -{ - /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ - *pIalpha = Id * cosVal - Iq * sinVal; - - /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ - *pIbeta = Id * sinVal + Iq * cosVal; -} - - -/** - * @brief Inverse Park transform for Q31 version - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ -static __INLINE void arm_inv_park_q31( - q31_t Id, - q31_t Iq, - q31_t *pIalpha, - q31_t *pIbeta, - q31_t sinVal, - q31_t cosVal) -{ - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Id * cosVal) */ - product1 = (q31_t)(((q63_t)(Id) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Iq * sinVal) */ - product2 = (q31_t)(((q63_t)(Iq) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Id * sinVal) */ - product3 = (q31_t)(((q63_t)(Id) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Iq * cosVal) */ - product4 = (q31_t)(((q63_t)(Iq) * (cosVal)) >> 31); - - /* Calculate pIalpha by using the two intermediate products 1 and 2 */ - *pIalpha = __QSUB(product1, product2); - - /* Calculate pIbeta by using the two intermediate products 3 and 4 */ - *pIbeta = __QADD(product4, product3); -} - -/** - * @} end of Inverse park group - */ - - -/** - * @brief Converts the elements of the Q31 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_float( - q31_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - -/** - * @ingroup groupInterpolation - */ - -/** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
- *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
- *       where x0, x1 are nearest values of input x
- *             y0, y1 are nearest values to output y
- * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ - -/** - * @addtogroup LinearInterpolate - * @{ - */ - -/** - * @brief Process function for the floating-point Linear Interpolation Function. - * @param[in,out] S is an instance of the floating-point Linear Interpolation structure - * @param[in] x input sample to process - * @return y processed output sample. - * - */ -static __INLINE float32_t arm_linear_interp_f32( - arm_linear_interp_instance_f32 *S, - float32_t x) -{ - float32_t y; - float32_t x0, x1; /* Nearest input values */ - float32_t y0, y1; /* Nearest output values */ - float32_t xSpacing = S->xSpacing; /* spacing between input values */ - int32_t i; /* Index variable */ - float32_t *pYData = S->pYData; /* pointer to output table */ - - /* Calculation of index */ - i = (int32_t)((x - S->x1) / xSpacing); - - if (i < 0) - { - /* Iniatilize output for below specified range as least output value of table */ - y = pYData[0]; - } - else if ((uint32_t)i >= S->nValues) - { - /* Iniatilize output for above specified range as last output value of table */ - y = pYData[S->nValues - 1]; - } - else - { - /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; - - /* Read of nearest output values */ - y0 = pYData[i]; - y1 = pYData[i + 1]; - - /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); - - } - - /* returns output value */ - return (y); -} - - -/** -* -* @brief Process function for the Q31 Linear Interpolation Function. -* @param[in] pYData pointer to Q31 Linear Interpolation table -* @param[in] x input sample to process -* @param[in] nValues number of table values -* @return y processed output sample. -* -* \par -* Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. -* This function can support maximum of table size 2^12. -* -*/ -static __INLINE q31_t arm_linear_interp_q31( - q31_t *pYData, - q31_t x, - uint32_t nValues) -{ - q31_t y; /* output */ - q31_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (q31_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* shift left by 11 to keep fract in 1.31 format */ - fract = (x & 0x000FFFFF) << 11; - - /* Read two nearest output values from the index in 1.31(q31) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 2.30 format */ - y = ((q31_t)((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); - - /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ - y += ((q31_t)(((q63_t) y1 * fract) >> 32)); - - /* Convert y to 1.31 format */ - return (y << 1u); - } -} - - -/** - * - * @brief Process function for the Q15 Linear Interpolation Function. - * @param[in] pYData pointer to Q15 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ -static __INLINE q15_t arm_linear_interp_q15( - q15_t *pYData, - q31_t x, - uint32_t nValues) -{ - q63_t y; /* output */ - q15_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (int32_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 13.35 format */ - y = ((q63_t) y0 * (0xFFFFF - fract)); - - /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ - y += ((q63_t) y1 * (fract)); - - /* convert y to 1.15 format */ - return (q15_t)(y >> 20); - } -} - - -/** - * - * @brief Process function for the Q7 Linear Interpolation Function. - * @param[in] pYData pointer to Q7 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - */ -static __INLINE q7_t arm_linear_interp_q7( - q7_t *pYData, - q31_t x, - uint32_t nValues) -{ - q31_t y; /* output */ - q7_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - uint32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - if (x < 0) - { - return (pYData[0]); - } - index = (x >> 20) & 0xfff; - - if (index >= (nValues - 1)) - { - return (pYData[nValues - 1]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index and are in 1.7(q7) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ - y = ((y0 * (0xFFFFF - fract))); - - /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ - y += (y1 * fract); - - /* convert y to 1.7(q7) format */ - return (q7_t)(y >> 20); - } -} - -/** - * @} end of LinearInterpolate group - */ - -/** - * @brief Fast approximation to the trigonometric sine function for floating-point data. - * @param[in] x input value in radians. - * @return sin(x). - */ -float32_t arm_sin_f32( - float32_t x); - - -/** - * @brief Fast approximation to the trigonometric sine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ -q31_t arm_sin_q31( - q31_t x); - - -/** - * @brief Fast approximation to the trigonometric sine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ -q15_t arm_sin_q15( - q15_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for floating-point data. - * @param[in] x input value in radians. - * @return cos(x). - */ -float32_t arm_cos_f32( - float32_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ -q31_t arm_cos_q31( - q31_t x); - - -/** - * @brief Fast approximation to the trigonometric cosine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ -q15_t arm_cos_q15( - q15_t x); - - -/** - * @ingroup groupFastMath - */ - - -/** - * @defgroup SQRT Square Root - * - * Computes the square root of a number. - * There are separate functions for Q15, Q31, and floating-point data types. - * The square root function is computed using the Newton-Raphson algorithm. - * This is an iterative algorithm of the form: - *
- *      x1 = x0 - f(x0)/f'(x0)
- * 
- * where x1 is the current estimate, - * x0 is the previous estimate, and - * f'(x0) is the derivative of f() evaluated at x0. - * For the square root function, the algorithm reduces to: - *
- *     x0 = in/2                         [initial guess]
- *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
- * 
- */ - - -/** - * @addtogroup SQRT - * @{ - */ - -/** - * @brief Floating-point square root function. - * @param[in] in input value. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -static __INLINE arm_status arm_sqrt_f32( - float32_t in, - float32_t *pOut) -{ - if (in >= 0.0f) - { - -#if (__FPU_USED == 1) && defined ( __CC_ARM ) - *pOut = __sqrtf(in); -#elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined(__GNUC__) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) - __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); -#else - *pOut = sqrtf(in); -#endif - - return (ARM_MATH_SUCCESS); - } - else - { - *pOut = 0.0f; - return (ARM_MATH_ARGUMENT_ERROR); - } -} - - -/** - * @brief Q31 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -arm_status arm_sqrt_q31( - q31_t in, - q31_t *pOut); - - -/** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ -arm_status arm_sqrt_q15( - q15_t in, - q15_t *pOut); - -/** - * @} end of SQRT group - */ - - -/** - * @brief floating-point Circular write function. - */ -static __INLINE void arm_circularWrite_f32( - int32_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const int32_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - - -/** - * @brief floating-point Circular Read function. - */ -static __INLINE void arm_circularRead_f32( - int32_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - int32_t *dst, - int32_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (int32_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Q15 Circular write function. - */ -static __INLINE void arm_circularWrite_q15( - q15_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const q15_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - -/** - * @brief Q15 Circular Read function. - */ -static __INLINE void arm_circularRead_q15( - q15_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - q15_t *dst, - q15_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q15_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update wOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Q7 Circular write function. - */ -static __INLINE void arm_circularWrite_q7( - q7_t *circBuffer, - int32_t L, - uint16_t *writeOffset, - int32_t bufferInc, - const q7_t *src, - int32_t srcInc, - uint32_t blockSize) -{ - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; -} - - -/** - * @brief Q7 Circular Read function. - */ -static __INLINE void arm_circularRead_q7( - q7_t *circBuffer, - int32_t L, - int32_t *readOffset, - int32_t bufferInc, - q7_t *dst, - q7_t *dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) -{ - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t)(dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q7_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; -} - - -/** - * @brief Sum of the squares of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q31( - q31_t *pSrc, - uint32_t blockSize, - q63_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q15( - q15_t *pSrc, - uint32_t blockSize, - q63_t *pResult); - - -/** - * @brief Sum of the squares of the elements of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_power_q7( - q7_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Mean value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *pResult); - - -/** - * @brief Mean value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Mean value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Mean value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_mean_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Variance of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Variance of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Variance of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_var_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Root Mean Square of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_rms_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Standard deviation of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult); - - -/** - * @brief Standard deviation of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult); - - -/** - * @brief Standard deviation of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ -void arm_std_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult); - - -/** - * @brief Floating-point complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_f32( - float32_t *pSrc, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_q31( - q31_t *pSrc, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ -void arm_cmplx_mag_q15( - q15_t *pSrc, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q15 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_q15( - q15_t *pSrcA, - q15_t *pSrcB, - uint32_t numSamples, - q31_t *realResult, - q31_t *imagResult); - - -/** - * @brief Q31 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_q31( - q31_t *pSrcA, - q31_t *pSrcB, - uint32_t numSamples, - q63_t *realResult, - q63_t *imagResult); - - -/** - * @brief Floating-point complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ -void arm_cmplx_dot_prod_f32( - float32_t *pSrcA, - float32_t *pSrcB, - uint32_t numSamples, - float32_t *realResult, - float32_t *imagResult); - - -/** - * @brief Q15 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_q15( - q15_t *pSrcCmplx, - q15_t *pSrcReal, - q15_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_q31( - q31_t *pSrcCmplx, - q31_t *pSrcReal, - q31_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ -void arm_cmplx_mult_real_f32( - float32_t *pSrcCmplx, - float32_t *pSrcReal, - float32_t *pCmplxDst, - uint32_t numSamples); - - -/** - * @brief Minimum value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] result is output pointer - * @param[in] index is the array index of the minimum value in the input buffer. - */ -void arm_min_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *result, - uint32_t *index); - - -/** - * @brief Minimum value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[in] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Minimum value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Minimum value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ -void arm_min_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q7 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q7( - q7_t *pSrc, - uint32_t blockSize, - q7_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q15 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q15( - q15_t *pSrc, - uint32_t blockSize, - q15_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a Q31 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_q31( - q31_t *pSrc, - uint32_t blockSize, - q31_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Maximum value of a floating-point vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ -void arm_max_f32( - float32_t *pSrc, - uint32_t blockSize, - float32_t *pResult, - uint32_t *pIndex); - - -/** - * @brief Q15 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_q15( - q15_t *pSrcA, - q15_t *pSrcB, - q15_t *pDst, - uint32_t numSamples); - - -/** - * @brief Q31 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_q31( - q31_t *pSrcA, - q31_t *pSrcB, - q31_t *pDst, - uint32_t numSamples); - - -/** - * @brief Floating-point complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ -void arm_cmplx_mult_cmplx_f32( - float32_t *pSrcA, - float32_t *pSrcB, - float32_t *pDst, - uint32_t numSamples); - - -/** - * @brief Converts the elements of the floating-point vector to Q31 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q31 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q31( - float32_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the floating-point vector to Q15 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q15( - float32_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the floating-point vector to Q7 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q7 output vector - * @param[in] blockSize length of the input vector - */ -void arm_float_to_q7( - float32_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q31 vector to Q15 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_q15( - q31_t *pSrc, - q15_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q31 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q31_to_q7( - q31_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_float( - q15_t *pSrc, - float32_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to Q31 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_q31( - q15_t *pSrc, - q31_t *pDst, - uint32_t blockSize); - - -/** - * @brief Converts the elements of the Q15 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ -void arm_q15_to_q7( - q15_t *pSrc, - q7_t *pDst, - uint32_t blockSize); - - -/** - * @ingroup groupInterpolation - */ - -/** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
- *   typedef struct
- *   {
- *     uint16_t numRows;
- *     uint16_t numCols;
- *     float32_t *pData;
- * } arm_bilinear_interp_instance_f32;
- * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
- *     XF = floor(x)
- *     YF = floor(y)
- * 
- * \par - * The interpolated output point is computed as: - *
- *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
- *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
- *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
- *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
- * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ - -/** - * @addtogroup BilinearInterpolate - * @{ - */ - - -/** -* -* @brief Floating-point bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate. -* @param[in] Y interpolation coordinate. -* @return out interpolated value. -*/ -static __INLINE float32_t arm_bilinear_interp_f32( - const arm_bilinear_interp_instance_f32 *S, - float32_t X, - float32_t Y) -{ - float32_t out; - float32_t f00, f01, f10, f11; - float32_t *pData = S->pData; - int32_t xIndex, yIndex, index; - float32_t xdiff, ydiff; - float32_t b1, b2, b3, b4; - - xIndex = (int32_t) X; - yIndex = (int32_t) Y; - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) - { - return (0); - } - - /* Calculation of index for two nearest points in X-direction */ - index = (xIndex - 1) + (yIndex - 1) * S->numCols; - - - /* Read two nearest points in X-direction */ - f00 = pData[index]; - f01 = pData[index + 1]; - - /* Calculation of index for two nearest points in Y-direction */ - index = (xIndex - 1) + (yIndex) * S->numCols; - - - /* Read two nearest points in Y-direction */ - f10 = pData[index]; - f11 = pData[index + 1]; - - /* Calculation of intermediate values */ - b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; - - /* Calculation of fractional part in X */ - xdiff = X - xIndex; - - /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; - - /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; - - /* return to application */ - return (out); -} - - -/** -* -* @brief Q31 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -static __INLINE q31_t arm_bilinear_interp_q31( - arm_bilinear_interp_instance_q31 *S, - q31_t X, - q31_t Y) -{ - q31_t out; /* Temporary output */ - q31_t acc = 0; /* output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q31_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q31_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* shift left xfract by 11 to keep 1.31 format */ - xfract = (X & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; - x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; - - /* 20 bits for the fractional part */ - /* shift left yfract by 11 to keep 1.31 format */ - yfract = (Y & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; - y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ - out = ((q31_t)(((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); - acc = ((q31_t)(((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); - - /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); - acc += ((q31_t)((q63_t) out * (xfract) >> 32)); - - /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); - acc += ((q31_t)((q63_t) out * (yfract) >> 32)); - - /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t)((q63_t) y2 * (xfract) >> 32)); - acc += ((q31_t)((q63_t) out * (yfract) >> 32)); - - /* Convert acc to 1.31(q31) format */ - return ((q31_t)(acc << 2)); -} - - -/** -* @brief Q15 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -static __INLINE q15_t arm_bilinear_interp_q15( - arm_bilinear_interp_instance_q15 *S, - q31_t X, - q31_t Y) -{ - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q15_t x1, x2, y1, y2; /* Nearest output values */ - q31_t xfract, yfract; /* X, Y fractional parts */ - int32_t rI, cI; /* Row and column indices */ - q15_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ - - /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ - /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ - out = (q31_t)(((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); - acc = ((q63_t) out * (0xFFFFF - yfract)); - - /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); - acc += ((q63_t) out * (xfract)); - - /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t)(((q63_t) y2 * (xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* acc is in 13.51 format and down shift acc by 36 times */ - /* Convert out to 1.15 format */ - return ((q15_t)(acc >> 36)); -} - - -/** -* @brief Q7 bilinear interpolation. -* @param[in,out] S points to an instance of the interpolation structure. -* @param[in] X interpolation coordinate in 12.20 format. -* @param[in] Y interpolation coordinate in 12.20 format. -* @return out interpolated value. -*/ -static __INLINE q7_t arm_bilinear_interp_q7( - arm_bilinear_interp_instance_q7 *S, - q31_t X, - q31_t Y) -{ - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q7_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q7_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ - out = ((x1 * (0xFFFFF - xfract))); - acc = (((q63_t) out * (0xFFFFF - yfract))); - - /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ - out = ((x2 * (0xFFFFF - yfract))); - acc += (((q63_t) out * (xfract))); - - /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y1 * (0xFFFFF - xfract))); - acc += (((q63_t) out * (yfract))); - - /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y2 * (yfract))); - acc += (((q63_t) out * (xfract))); - - /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ - return ((q7_t)(acc >> 40)); -} - -/** - * @} end of BilinearInterpolate group - */ - - -/* SMMLAR */ -#define multAcc_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMLSR */ -#define multSub_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMULR */ -#define mult_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) - -/* SMMLA */ -#define multAcc_32x32_keep32(a, x, y) \ - a += (q31_t) (((q63_t) x * y) >> 32) - -/* SMMLS */ -#define multSub_32x32_keep32(a, x, y) \ - a -= (q31_t) (((q63_t) x * y) >> 32) - -/* SMMUL */ -#define mult_32x32_keep32(a, x, y) \ - a = (q31_t) (((q63_t) x * y ) >> 32) - - -#if defined ( __CC_ARM ) -/* Enter low optimization region - place directly above function definition */ -#if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) -#define LOW_OPTIMIZATION_ENTER \ - _Pragma ("push") \ - _Pragma ("O1") -#else -#define LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) -#define LOW_OPTIMIZATION_EXIT \ - _Pragma ("pop") -#else -#define LOW_OPTIMIZATION_EXIT -#endif - -/* Enter low optimization region - place directly above function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER - -/* Exit low optimization region - place directly after end of function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__GNUC__) -#define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") )) -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ICCARM__) -/* Enter low optimization region - place directly above function definition */ -#if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) -#define LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") -#else -#define LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#define LOW_OPTIMIZATION_EXIT - -/* Enter low optimization region - place directly above function definition */ -#if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") -#else -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#endif - -/* Exit low optimization region - place directly after end of function definition */ -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__CSMC__) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__TASKING__) -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#endif - - -#ifdef __cplusplus -} -#endif - - -#if defined ( __GNUC__ ) - #pragma GCC diagnostic pop -#endif - -#endif /* _ARM_MATH_H */ - -/** - * - * End of file. - */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc.h deleted file mode 100644 index 7b85e336fe3..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc.h +++ /dev/null @@ -1,734 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#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 - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/* intrinsic void __enable_irq(); */ -/* 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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)1); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \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 (__FPU_PRESENT == 1U) && (__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 (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - register uint32_t __regfpscr __ASM("fpscr"); - __regfpscr = (fpscr); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __rev - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_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] value Value to rotate - \param [in] value 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) -#define __RBIT __rbit -#else -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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) - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -#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 /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_H */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc_V6.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc_V6.h deleted file mode 100644 index 6d8f998d84f..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_armcc_V6.h +++ /dev/null @@ -1,1804 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc_V6.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_ARMCC_V6_H -#define __CMSIS_ARMCC_V6_H - - -/* ########################### 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, control" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile("MSR control, %0" : : "r"(control) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get IPSR Register (non-secure) - \details Returns the content of the non-secure IPSR Register when in secure state. - \return IPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_IPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, ipsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get APSR Register (non-secure) - \details Returns the content of the non-secure APSR Register when in secure state. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_APSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, apsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get xPSR Register (non-secure) - \details Returns the content of the non-secure xPSR Register when in secure state. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_xPSR_NS(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, xpsr_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp, %0" : : "r"(topOfProcStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp_ns, %0" : : "r"(topOfProcStack) : "sp"); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msp" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp, %0" : : "r"(topOfMainStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp_ns, %0" : : "r"(topOfMainStack) : "sp"); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, primask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile("MSR primask, %0" : : "r"(priMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile("MSR primask_ns, %0" : : "r"(priMask) : "memory"); -} -#endif - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, basepri" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile("MSR basepri, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_ns, %0" : : "r"(value) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile("MSR basepri_max, %0" : : "r"(value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Base Priority with condition (non_secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_MAX_NS(uint32_t value) -{ - __ASM volatile("MSR basepri_max_ns, %0" : : "r"(value) : "memory"); -} -#endif - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, faultmask" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask, %0" : : "r"(faultMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask_ns, %0" : : "r"(faultMask) : "memory"); -} -#endif - - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \brief Get Process Stack Pointer Limit - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim" : "=r"(result)); - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim, %0" : : "r"(ProcStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Process Stack Pointer (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile("MSR psplim_ns, %0\n" : : "r"(ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim" : "=r"(result)); - - return (result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msplim_ns" : "=r"(result)); - return (result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim, %0" : : "r"(MainStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Main Stack Pointer Limit (non-secure) - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile("MSR msplim_ns, %0" : : "r"(MainStackPtrLimit)); -} -#endif - -#endif /* (__ARM_ARCH_8M__ == 1U) */ - - -#if ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=4 */ - -/** - \brief Get FPSCR - \details eturns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#define __get_FPSCR __builtin_arm_get_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get FPSCR (non-secure) - \details Returns the current value of the non-secure Floating Point Status/Control register when in secure state. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FPSCR_NS(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMRS %0, fpscr_ns" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#endif -} -#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 - */ -#define __set_FPSCR __builtin_arm_set_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set FPSCR (non-secure) - \details Assigns the given value to the non-secure Floating Point Status/Control register when in secure state. - \param [in] fpscr Floating Point Status/Control value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FPSCR_NS(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile(""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile("VMSR fpscr_ns, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} -#endif - -#endif /* ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - - -/*@} 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 integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __builtin_bswap32 - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16 __builtin_bswap16 /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -#if 0 -__attribute__((always_inline)) __STATIC_INLINE 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); -} -#endif - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -/* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ - int32_t result; - - __ASM volatile("revsh %0, %1" : __CMSIS_GCC_OUT_REG(result) : __CMSIS_GCC_USE_REG(value)); - return (result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -/* ToDo: ARMCC_V6: check if __builtin_arm_rbit is supported */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - __ASM volatile("rbit %0, %1" : "=r"(result) : "r"(value)); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \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 - - -/** - \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*/ -#define __SSAT(ARG1,ARG2) \ -({ \ - 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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat -#if 0 -#define __USAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) -#endif - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile("strt %1, %0" : "=Q"(*ptr) : "r"(value)); -} - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 /* (__ARM_ARCH_8M__ == 1U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__ARM_FEATURE_DSP == 1U) /* ToDo: ARMCC_V6: This should be ARCH >= ARMv7-M + SIMD */ - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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) \ -({ \ - uint32_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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("uxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("sxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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 __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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_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 == 1U) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_V6_H */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_gcc.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_gcc.h deleted file mode 100644 index 815df3ea751..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/cmsis_gcc.h +++ /dev/null @@ -1,1377 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_GCC_H -#define __CMSIS_GCC_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wunused-parameter" -#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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, control" : "=r"(result)); - return (result); -} - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile("MSR control, %0" : : "r"(control) : "memory"); -} - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, psp\n" : "=r"(result)); - return (result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile("MSR psp, %0\n" : : "r"(topOfProcStack) : "sp"); -} - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile("MRS %0, msp\n" : "=r"(result)); - return (result); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile("MSR msp, %0\n" : : "r"(topOfMainStack) : "sp"); -} - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, primask" : "=r"(result)); - return (result); -} - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile("MSR primask, %0" : : "r"(priMask) : "memory"); -} - - -#if (__CORTEX_M >= 0x03U) - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, basepri" : "=r"(result)); - return (result); -} - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile("MSR basepri, %0" : : "r"(value) : "memory"); -} - - -/** - \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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile("MSR basepri_max, %0" : : "r"(value) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile("MRS %0, faultmask" : "=r"(result)); - return (result); -} - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile("MSR faultmask, %0" : : "r"(faultMask) : "memory"); -} - -#endif /* (__CORTEX_M >= 0x03U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile(""); - __ASM volatile("VMRS %0, fpscr" : "=r"(result)); - __ASM volatile(""); - return (result); -#else - return (0); -#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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile(""); - __ASM volatile("VMSR fpscr, %0" : : "r"(fpscr) : "vfpcc"); - __ASM volatile(""); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) -{ - __ASM volatile("wfe"); -} - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) -{ - __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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) -{ - __ASM volatile("dmb 0xF"::: "memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE 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 in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (short)__builtin_bswap16(value); -#else - int32_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] value Value to rotate - \param [in] value Number of Bits to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - __ASM volatile("rbit %0, %1" : "=r"(result) : "r"(value)); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; 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 - */ -#define __CLZ __builtin_clz - - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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. - */ -__attribute__((always_inline)) __STATIC_INLINE void __CLREX(void) -{ - __ASM volatile("clrex" ::: "memory"); -} - - -/** - \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(ARG1,ARG2) \ -({ \ - uint32_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] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1,ARG2) \ -({ \ - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE 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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile("ldrbt %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("ldrbt %0, [%1]" : "=r"(result) : "r"(addr) : "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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile("ldrht %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("ldrht %0, [%1]" : "=r"(result) : "r"(addr) : "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) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile("ldrt %0, %1" : "=r"(result) : "Q"(*addr)); - 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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *addr) -{ - __ASM volatile("strbt %1, %0" : "=Q"(*addr) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *addr) -{ - __ASM volatile("strht %1, %0" : "=Q"(*addr) : "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 - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *addr) -{ - __ASM volatile("strt %1, %0" : "=Q"(*addr) : "r"(value)); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("uxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile("sxtb16 %0, %1" : "=r"(result) : "r"(op1)); - return (result); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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); -} - -__attribute__((always_inline)) __STATIC_INLINE 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 __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; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_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 /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#if defined ( __GNUC__ ) - #pragma GCC diagnostic pop -#endif - -#endif /* __CMSIS_GCC_H */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm0.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm0.h deleted file mode 100644 index 81e63175d79..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm0.h +++ /dev/null @@ -1,798 +0,0 @@ -/**************************************************************************//** - * @file core_cm0.h - * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM0 definitions */ -#define __CM0_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM0_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \ - __CM0_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ -#define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) -#define __ASM __asm /*!< asm keyword for TI CCS Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) -#define __packed -#define __ASM _asm /*!< asm keyword for COSMIC Compiler */ -#define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ -#define __STATIC_INLINE static inline - -#else -#error Unknown compiler -#endif - -/** __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_PCS_VFP -#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 ( __TMS470__ ) -#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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 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_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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M0 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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn)) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return ((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn)) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/ma35/CMSIS/Include/core_cm0plus.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm0plus.h deleted file mode 100644 index aa0ca4ae65b..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm0plus.h +++ /dev/null @@ -1,914 +0,0 @@ -/**************************************************************************//** - * @file core_cm0plus.h - * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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+ - @{ - */ - -/* CMSIS CM0+ definitions */ -#define __CM0PLUS_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM0PLUS_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16U) | \ - __CM0PLUS_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ -#define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) -#define __ASM __asm /*!< asm keyword for TI CCS Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) -#define __packed -#define __ASM _asm /*!< asm keyword for COSMIC Compiler */ -#define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ -#define __STATIC_INLINE static inline - -#else -#error Unknown compiler -#endif - -/** __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_PCS_VFP -#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 ( __TMS470__ ) -#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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 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 */ -#if (__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 (__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 (__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 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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M0+ 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 (__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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn)) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return ((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn)) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/ma35/CMSIS/Include/core_cm3.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm3.h deleted file mode 100644 index 337c324442a..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm3.h +++ /dev/null @@ -1,1763 +0,0 @@ -/**************************************************************************//** - * @file core_cm3.h - * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM3 definitions */ -#define __CM3_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM3_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16U) | \ - __CM3_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x03U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ -#define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) -#define __ASM __asm /*!< asm keyword for TI CCS Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) -#define __packed -#define __ASM _asm /*!< asm keyword for COSMIC Compiler */ -#define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ -#define __STATIC_INLINE static inline - -#else -#error Unknown compiler -#endif - -/** __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_PCS_VFP -#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 ( __TMS470__ ) -#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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 4U -#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: 15; /*!< bit: 9..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_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 RSERVED1[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 (__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 */ - -/* 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 */ - -#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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M3 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 (__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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/ma35/CMSIS/Include/core_cm4.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm4.h deleted file mode 100644 index e9d5044f4c3..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm4.h +++ /dev/null @@ -1,1937 +0,0 @@ -/**************************************************************************//** - * @file core_cm4.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM4 definitions */ -#define __CM4_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM4_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \ - __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x04U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ -#define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) -#define __ASM __asm /*!< asm keyword for TI CCS Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) -#define __packed -#define __ASM _asm /*!< asm keyword for COSMIC Compiler */ -#define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ -#define __STATIC_INLINE static inline - -#else -#error Unknown compiler -#endif - -/** __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 (__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_PCS_VFP -#if (__FPU_PRESENT == 1) -#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 (__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 (__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 ( __TMS470__ ) -#if defined __TI_VFP_SUPPORT__ -#if (__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 (__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 (__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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ -#include "core_cmSimd.h" /* Compiler specific SIMD Intrinsics */ - -#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 4U -#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: 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 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 RSERVED1[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 */ - -/* 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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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 - - -#if (__FPU_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 */ -} 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 */ - -/*@} end of group CMSIS_FPU */ -#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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M4 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 (__MPU_PRESENT == 1U) -#define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ -#define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1U) -#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ -#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point 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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/ma35/CMSIS/Include/core_cm7.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm7.h deleted file mode 100644 index f2877865b12..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cm7.h +++ /dev/null @@ -1,2535 +0,0 @@ -/**************************************************************************//** - * @file core_cm7.h - * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS CM7 definitions */ -#define __CM7_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM7_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16U) | \ - __CM7_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x07U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ -#define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) -#define __ASM __asm /*!< asm keyword for TI CCS Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) -#define __packed -#define __ASM _asm /*!< asm keyword for COSMIC Compiler */ -#define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ -#define __STATIC_INLINE static inline - -#else -#error Unknown compiler -#endif - -/** __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 (__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_PCS_VFP -#if (__FPU_PRESENT == 1) -#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 (__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 (__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 ( __TMS470__ ) -#if defined __TI_VFP_SUPPORT__ -#if (__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 (__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 (__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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ -#include "core_cmSimd.h" /* Compiler specific SIMD Intrinsics */ - -#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: 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 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 RSERVED1[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 1 */ - 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 */ - -/* 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_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[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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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 - - -#if (__FPU_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 */ - -/*@} end of group CMSIS_FPU */ -#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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M4 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 (__MPU_PRESENT == 1U) -#define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ -#define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1U) -#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ -#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point 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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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) -{ - uint32_t mvfr0; - - mvfr0 = SCB->MVFR0; - if ((mvfr0 & 0x00000FF0UL) == 0x220UL) - { - return 2UL; /* Double + Single precision FPU */ - } - else if ((mvfr0 & 0x00000FF0UL) == 0x020UL) - { - return 1UL; /* Single precision FPU */ - } - else - { - return 0UL; /* 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 ) - - -/** - \brief Enable I-Cache - \details Turns on I-Cache - */ -__STATIC_INLINE void SCB_EnableICache(void) -{ -#if (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; /* invalidate I-Cache */ - SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; /* enable I-Cache */ - __DSB(); - __ISB(); -#endif -} - - -/** - \brief Disable I-Cache - \details Turns off I-Cache - */ -__STATIC_INLINE void SCB_DisableICache(void) -{ -#if (__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_INLINE void SCB_InvalidateICache(void) -{ -#if (__ICACHE_PRESENT == 1U) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; - __DSB(); - __ISB(); -#endif -} - - -/** - \brief Enable D-Cache - \details Turns on D-Cache - */ -__STATIC_INLINE void SCB_EnableDCache(void) -{ -#if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } - while (sets--); - __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_INLINE void SCB_DisableDCache(void) -{ -#if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* Level 1 data cache */ - __DSB(); - - ccsidr = SCB->CCSIDR; - - SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ - - /* 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--); - } - while (sets--); - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief Invalidate D-Cache - \details Invalidates D-Cache - */ -__STATIC_INLINE void SCB_InvalidateDCache(void) -{ -#if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } - while (sets--); - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief Clean D-Cache - \details Cleans D-Cache - */ -__STATIC_INLINE void SCB_CleanDCache(void) -{ -#if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } - while (sets--); - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief Clean & Invalidate D-Cache - \details Cleans and Invalidates D-Cache - */ -__STATIC_INLINE void SCB_CleanInvalidateDCache(void) -{ -#if (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; - - SCB->CSSELR = (0U << 1U) | 0U; /* 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--); - } - while (sets--); - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief D-Cache Invalidate by address - \details Invalidates D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_InvalidateDCache_by_Addr(uint32_t *addr, int32_t dsize) -{ -#if (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t)addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) - { - SCB->DCIMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief D-Cache Clean by address - \details Cleans D-Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanDCache_by_Addr(uint32_t *addr, int32_t dsize) -{ -#if (__DCACHE_PRESENT == 1) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) - { - SCB->DCCMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __DSB(); - __ISB(); -#endif -} - - -/** - \brief D-Cache Clean and Invalidate by address - \details Cleans and invalidates D_Cache for the given address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr(uint32_t *addr, int32_t dsize) -{ -#if (__DCACHE_PRESENT == 1U) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - int32_t linesize = 32U; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ - - __DSB(); - - while (op_size > 0) - { - SCB->DCCIMVAC = op_addr; - op_addr += linesize; - op_size -= linesize; - } - - __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 (__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 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/nuvoton/libraries/ma35/CMSIS/Include/core_cmFunc.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmFunc.h deleted file mode 100644 index ed3c1901074..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmFunc.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmFunc.h - * @brief CMSIS Cortex-M Core Function Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMFUNC_H - #define __CORE_CMFUNC_H - - - /* ########################### Core Function Access ########################### */ - /** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - - /*------------------ RealView Compiler -----------------*/ - #if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - - /*------------------ ARM Compiler V6 -------------------*/ - #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - - /*------------------ GNU Compiler ----------------------*/ - #elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - - /*------------------ ICC Compiler ----------------------*/ - #elif defined ( __ICCARM__ ) - #include - - /*------------------ TI CCS Compiler -------------------*/ - #elif defined ( __TMS470__ ) - #include - - /*------------------ 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. - */ - - /*------------------ COSMIC Compiler -------------------*/ - #elif defined ( __CSMC__ ) - #include - - #endif - - /*@} end of CMSIS_Core_RegAccFunctions */ - -#endif /* __CORE_CMFUNC_H */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmInstr.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmInstr.h deleted file mode 100644 index a334984f5dd..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmInstr.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmInstr.h - * @brief CMSIS Cortex-M Core Instruction Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMINSTR_H - #define __CORE_CMINSTR_H - - - /* ########################## Core Instruction Access ######################### */ - /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ - */ - - /*------------------ RealView Compiler -----------------*/ - #if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - - /*------------------ ARM Compiler V6 -------------------*/ - #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - - /*------------------ GNU Compiler ----------------------*/ - #elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - - /*------------------ ICC Compiler ----------------------*/ - #elif defined ( __ICCARM__ ) - #include - - /*------------------ TI CCS Compiler -------------------*/ - #elif defined ( __TMS470__ ) - #include - - /*------------------ 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. - */ - - /*------------------ COSMIC Compiler -------------------*/ - #elif defined ( __CSMC__ ) - #include - - #endif - - /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - -#endif /* __CORE_CMINSTR_H */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmSimd.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmSimd.h deleted file mode 100644 index 590ebee9d5d..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_cmSimd.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file core_cmSimd.h - * @brief CMSIS Cortex-M SIMD Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMSIMD_H -#define __CORE_CMSIMD_H - -#ifdef __cplusplus -extern "C" { -#endif - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) -#include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) -#include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) -#include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) -#include - -/*------------------ 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. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) -#include - -#endif - -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CMSIMD_H */ diff --git a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_sc000.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_sc000.h deleted file mode 100644 index 793c28f09b9..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_sc000.h +++ /dev/null @@ -1,926 +0,0 @@ -/**************************************************************************//** - * @file core_sc000.h - * @brief CMSIS SC000 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS SC000 definitions */ -#define __SC000_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __SC000_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16U) | \ - __SC000_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (000U) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ -#define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) -#define __ASM __asm /*!< asm keyword for TI CCS Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) -#define __packed -#define __ASM _asm /*!< asm keyword for COSMIC Compiler */ -#define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ -#define __STATIC_INLINE static inline - -#else -#error Unknown compiler -#endif - -/** __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_PCS_VFP -#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 ( __TMS470__ ) -#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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 SC000 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 (__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. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* 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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - 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))); - } - else - { - 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))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn)) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return ((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn)) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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/nuvoton/libraries/ma35/CMSIS/Include/core_sc300.h b/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_sc300.h deleted file mode 100644 index eaece43eb2c..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/Include/core_sc300.h +++ /dev/null @@ -1,1745 +0,0 @@ -/**************************************************************************//** - * @file core_sc300.h - * @brief CMSIS SC300 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #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 - @{ - */ - -/* CMSIS SC300 definitions */ -#define __SC300_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __SC300_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16U) | \ - __SC300_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (300U) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ -#define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ -#define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) -#define __ASM __asm /*!< asm keyword for TI CCS Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ -#define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) -#define __packed -#define __ASM _asm /*!< asm keyword for COSMIC Compiler */ -#define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ -#define __STATIC_INLINE static inline - -#else -#error Unknown compiler -#endif - -/** __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_PCS_VFP -#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 ( __TMS470__ ) -#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 "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ - -#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 4U -#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: 15; /*!< bit: 9..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_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 RSERVED1[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 */ - -/* 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 */ - uint32_t RESERVED1[1U]; -} 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[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 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 */ - __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 -{ - __IOM 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 */ - __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 (__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. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((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. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((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 Cortex-M3 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 (__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. - @{ - */ - -/** - \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 External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return ((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \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)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL) - 4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return (((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (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 System Reset - \details Initiates a system reset request to reset the MCU. - */ -__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 */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__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 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/nuvoton/libraries/ma35/CMSIS/SConscript b/bsp/nuvoton/libraries/ma35/CMSIS/SConscript deleted file mode 100644 index dc4b1082e86..00000000000 --- a/bsp/nuvoton/libraries/ma35/CMSIS/SConscript +++ /dev/null @@ -1,14 +0,0 @@ -import rtconfig -Import('RTT_ROOT') -from building import * - -# get current directory -group = [] - -if GetDepend('USE_MA35D1_SUBM'): - cwd = GetCurrentDir() - src = [] - path = [cwd + '/Include',] - group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/NuMicro.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/NuMicro.h deleted file mode 100644 index 6701a455c86..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/NuMicro.h +++ /dev/null @@ -1,15 +0,0 @@ -/**************************************************************************//** - * @file NuMicro.h - * @brief NuMicro peripheral access layer header file. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NUMICRO_H__ -#define __NUMICRO_H__ - -#include "ma35d1.h" - -#endif /* __NUMICRO_H__ */ - - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/adc_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/adc_reg.h deleted file mode 100644 index 4637bb5d190..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/adc_reg.h +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************//** - * @file adc.h - * @brief ADC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020~2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __ADC_REG_H__ -#define __ADC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ADC Analog to Digital Converter(ADC) - Memory Mapped Structure for ADC Controller -@{ */ - -typedef struct -{ - - - /** - * @var ADC_T::CTL - * Offset: 0x00 ADC Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADEN |ADC Power Control - * | | |0 = Power down ADC. - * | | |1 = Power on ADC. - * |[8] |MST |Menu Start Conversion - * | | |0 = Functional menu not started. - * | | |1 = Start all enable bit in ADC_CONF register. - * | | |Note: This bit is set by software and cleared by hardware when all the tasks listed in ADC_CONF are done. - * |[9] |PEDEEN |Pen Down Event Enable Bit - * | | |0 = Pen down event interrupt Disabled. - * | | |1 = Pen down event interrupt Enabled. - * |[11] |WKTEN |Touch Wake Up Enable Bit - * | | |0 = Touch wake-up Disabled. - * | | |1 = Touch wake-up Enabled. - * |[16] |WMSWCH |Wire Mode Switch for 5-wire/4-wire Configuration - * | | |0 = 4-wire mode. - * | | |1 = 5-wire mode. - * @var ADC_T::CONF - * Offset: 0x04 ADC Configure - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TEN |Touch Detection Enable Bit - * | | |0 = Touch detection function Disabled. - * | | |1 = Touch detection function Enabled. - * |[1] |ZEN |Press Measure Enable Bit - * | | |1 = Press measure function Disabled. - * | | |1 = Press measure function Enabled. - * |[2] |NACEN |Normal A/D Conversion Enable Bit - * | | |ADC normal conversion function enable - * | | |0 = Normal A/D Conversion Disabled. - * | | |1 = Normal A/D Conversion Enabled. - * |[7:6] |REFSEL |ADC Reference Select - * | | |ADC reference voltage select when ADC operate in normal conversion. - * | | |00 = AGND33 vs VREF input. - * | | |01 = YM vs YP. - * | | |10 = XM vs XP. - * | | |11 = AGND33 vs AVDD33. - * |[14:12] |CHSEL |Channel Selection - * | | |ADC input channel selection. - * | | |000 = VREF. - * | | |001 = A1. - * | | |010 = A2. - * | | |011 = VSENSE. - * | | |100 = YM. - * | | |101 = YP. - * | | |110 = XM. - * | | |111 = XP. - * |[20] |TMAVDIS |Display T Mean Average Disable Bit - * | | |Touch mean average for X and Y function disable bit. - * | | |0 = Touch mean average for X and Y function Enabled. - * | | |1 = Touch mean average for X and Y function Disabled. - * |[21] |ZMAVDIS |Display Z Mean Average Disable Bit - * | | |Pressure mean average for Z1 and Z2 function disable bit. - * | | |0 = Pressure mean average for Z1 and Z2 function Enabled. - * | | |1 = Pressure mean average for Z1 and Z2 function Disabled. - * |[22] |SPEED |Speed Mode Selection - * | | |0 = All ADC channels set to high speed mode. - * | | |1 = All ADC channels set to low speed mode. - * @var ADC_T::IER - * Offset: 0x08 ADC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MIEN |Menu Interrupt Enable Bit - * | | |Function menu complete interrupt enable. - * | | |0 = Menu interrupt Disabled. - * | | |1 = Menu interrupt Enabled. - * |[2] |PEDEIEN |Pen Down Event Interrupt Enable Bit - * | | |0 = Pen down event detection interrupt Disabled. - * | | |1 = Pen down event detection interrupt Enabled. - * |[3] |WKTIEN |Wake Up Touch Interrupt Enable Bit - * | | |0 = Wake up touch detection interrupt Disabled. - * | | |1 = Wake up touch detection interrupt Enabled. - * |[6] |PEUEIEN |Pen Up Event Interrupt Enable Bit - * | | |0 = Pen up event detection interrupt Disabled. - * | | |1 = Pen up event detection interrupt Enabled. - * @var ADC_T::ISR - * Offset: 0x0C ADC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MF |Menu Complete Flag - * | | |Function menu complete status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[2] |PEDEF |Pen Down Event Flag - * | | |Pen down event status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[4] |PEUEF |Pen Up Event Flag - * | | |Pen up event status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[8] |TF |Touch Conversion Finish - * | | |Functional menu touch detection conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[9] |ZF |Press Conversion Finish - * | | |Functional menu press measure conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[10] |NACF |Normal AD Conversion Finish - * | | |Functional menu normal AD conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[17] |INTTC |Interrupt Signal for Touch Screen Touching Detection - * | | |This signal is directly from analog macro without de-bouncing and can be used to determine the pen down touch event together with PEDEF (ADC_ISR[2]) flag. - * @var ADC_T::WKISR - * Offset: 0x10 ADC Wake-up interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |WPEDEF |Wake Up Pen Down Event Flag - * | | |Pen down event wake up status indicator. - * @var ADC_T::XYDATA - * Offset: 0x20 ADC Touch X,Y Position Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XDATA |ADC X Data - * | | |When TEN (ADC_CONF[0]) is set, the touch x-position will be stored in this register. - * | | |Note: If the TMAVDIS (ADC_CONF[20]) = 0, both x and y position are the results of the mean average of x and y in ADC_XYSORT0 ~ ADC_XYSORT3. - * |[27:16] |YDATA |ADC Y Data - * | | |When TEN (ADC_CONF[0]) is set, the touch y-position will be stored in this register. - * | | |Note: If the TMAVDIS (ADC_CONF[20]) = 0, both x and y position are the results of the mean average of x and y in ADC_XYSORT0 ~ ADC_XYSORT3. - * @var ADC_T::ZDATA - * Offset: 0x24 ADC Touch Z Pressure Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1DATA |ADC Z1 Data - * | | |When ZEN (ADC_CONF[1]) is set; the touch pressure measure Z1 will be stored in this register. - * | | |Note: If the ZMAVDIS (ADC_CONF[21]) = 0, both Z1 and Z2 data is the results of the mean average of Z1 and Z2 in ADC_ZSORT0 ~ ADC_ZSORT3. - * |[27:16] |Z2DATA |ADC Z2 Data - * | | |When ZEN (ADC_CONF[1]) is set; the touch pressure measure Z2 will be stored in this register. - * | | |Note: If the ZMAVDIS (ADC_CONF[21]) = 0, both Z1 and Z2 data is the results of the mean average of Z1 and Z2 in ADC_ZSORT0 ~ ADC_ZSORT3. - * @var ADC_T::DATA - * Offset: 0x28 ADC Normal Conversion Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ADCDATA |ADC Data - * | | |When NACEN (ADC_CONF[2]) is enabled, the AD converting result with corresponding channel is stored in this register. - * @var ADC_T::XYSORT0 - * Offset: 0x1F4 ADC Touch XY Position Mean Value Sort 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT0 |X Position Sort Data 0 - * | | |X position mean average sort data 0. - * |[27:16] |YSORT0 |Y Position Sort Data 0 - * | | |Y position mean average sort data 0. - * @var ADC_T::XYSORT1 - * Offset: 0x1F8 ADC Touch XY Position Mean Value Sort 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT1 |X Position Sort Data 1 - * | | |X position mean average sort data 1. - * |[27:16] |YSORT1 |Y Position Sort Data 1 - * | | |Y position mean average sort data 1. - * @var ADC_T::XYSORT2 - * Offset: 0x1FC ADC Touch XY Position Mean Value Sort 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT2 |X Position Sort Data 2 - * | | |X position mean average sort data 2. - * |[27:16] |YSORT2 |Y Position Sort Data 2 - * | | |Y position mean average sort data 2. - * @var ADC_T::XYSORT3 - * Offset: 0x200 ADC Touch XY Position Mean Value Sort 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT3 |X Position Sort Data 3 - * | | |X position mean average sort data 3. - * |[27:16] |YSORT3 |Y Position Sort Data 3 - * | | |Y position mean average sort data 3. - * @var ADC_T::ZSORT0 - * Offset: 0x204 ADC Touch Z Pressure Mean Value Sort 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT0 |Z1 Position Sort Data 0 - * | | |Z1 position Mean average sort data 0. - * |[27:16] |Z2SORT0 |Z2 Position Sort Data 0 - * | | |Z2 position Mean average sort data 0. - * @var ADC_T::ZSORT1 - * Offset: 0x208 ADC Touch Z Pressure Mean Value Sort 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT1 |Z1 Position Sort Data 1 - * | | |Z1 position Mean average sort data 1. - * |[27:16] |Z2SORT1 |Z2 Position Sort Data 1 - * | | |Z2 position Mean average sort data 1. - * @var ADC_T::ZSORT2 - * Offset: 0x20C ADC Touch Z Pressure Mean Value Sort 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT2 |Z1 Position Sort Data 2 - * | | |Z1 position Mean average sort data 2. - * |[27:16] |Z2SORT2 |Z2 Position Sort Data 2 - * | | |Z2 position Mean average sort data 2. - * @var ADC_T::ZSORT3 - * Offset: 0x210 ADC Touch Z Pressure Mean Value Sort 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT3 |Z1 Position Sort Data 3 - * | | |Z1 position Mean average sort data 3. - * |[27:16] |Z2SORT3 |Z2 Position Sort Data 3 - * | | |Z2 position Mean average sort data 3. - */ - __IO uint32_t CTL; /*!< [0x0000] ADC Control */ - __IO uint32_t CONF; /*!< [0x0004] ADC Configure */ - __IO uint32_t IER; /*!< [0x0008] ADC Interrupt Enable Register */ - __IO uint32_t ISR; /*!< [0x000c] ADC Interrupt Status Register */ - __I uint32_t WKISR; /*!< [0x0010] ADC Wake-up interrupt Status Register */ - __I uint32_t RESERVE0[3]; - __I uint32_t XYDATA; /*!< [0x0020] ADC Touch X,Y Position Data */ - __I uint32_t ZDATA; /*!< [0x0024] ADC Touch Z Pressure Data */ - __I uint32_t DATA; /*!< [0x0028] ADC Normal Conversion Data */ - __I uint32_t RESERVE1[114]; - __I uint32_t XYSORT[4]; /*!< [0x01f4~0x0200] ADC Touch XY Position Mean Value Sort Register */ - __I uint32_t ZSORT0[4]; /*!< [0x0204~0x0210] ADC Touch Z Pressure Mean Value Sort Register */ - -} ADC_T; - -/** - @addtogroup ADC_CONST ADC Bit Field Definition - Constant Definitions for ADC Controller -@{ */ - -#define ADC_CTL_ADEN_Pos (0) /*!< ADC_T::CTL: ADEN Position */ -#define ADC_CTL_ADEN_Msk (0x1ul << ADC_CTL_ADEN_Pos) /*!< ADC_T::CTL: ADEN Mask */ - -#define ADC_CTL_MST_Pos (8) /*!< ADC_T::CTL: MST Position */ -#define ADC_CTL_MST_Msk (0x1ul << ADC_CTL_MST_Pos) /*!< ADC_T::CTL: MST Mask */ - -#define ADC_CTL_PEDEEN_Pos (9) /*!< ADC_T::CTL: PEDEEN Position */ -#define ADC_CTL_PEDEEN_Msk (0x1ul << ADC_CTL_PEDEEN_Pos) /*!< ADC_T::CTL: PEDEEN Mask */ - -#define ADC_CTL_WKTEN_Pos (11) /*!< ADC_T::CTL: WKTEN Position */ -#define ADC_CTL_WKTEN_Msk (0x1ul << ADC_CTL_WKTEN_Pos) /*!< ADC_T::CTL: WKTEN Mask */ - -#define ADC_CTL_WMSWCH_Pos (16) /*!< ADC_T::CTL: WMSWCH Position */ -#define ADC_CTL_WMSWCH_Msk (0x1ul << ADC_CTL_WMSWCH_Pos) /*!< ADC_T::CTL: WMSWCH Mask */ - -#define ADC_CONF_TEN_Pos (0) /*!< ADC_T::CONF: TEN Position */ -#define ADC_CONF_TEN_Msk (0x1ul << ADC_CONF_TEN_Pos) /*!< ADC_T::CONF: TEN Mask */ - -#define ADC_CONF_ZEN_Pos (1) /*!< ADC_T::CONF: ZEN Position */ -#define ADC_CONF_ZEN_Msk (0x1ul << ADC_CONF_ZEN_Pos) /*!< ADC_T::CONF: ZEN Mask */ - -#define ADC_CONF_NACEN_Pos (2) /*!< ADC_T::CONF: NACEN Position */ -#define ADC_CONF_NACEN_Msk (0x1ul << ADC_CONF_NACEN_Pos) /*!< ADC_T::CONF: NACEN Mask */ - -#define ADC_CONF_REFSEL_Pos (6) /*!< ADC_T::CONF: REFSEL Position */ -#define ADC_CONF_REFSEL_Msk (0x3ul << ADC_CONF_REFSEL_Pos) /*!< ADC_T::CONF: REFSEL Mask */ - -#define ADC_CONF_CHSEL_Pos (12) /*!< ADC_T::CONF: CHSEL Position */ -#define ADC_CONF_CHSEL_Msk (0x7ul << ADC_CONF_CHSEL_Pos) /*!< ADC_T::CONF: CHSEL Mask */ - -#define ADC_CONF_TMAVDIS_Pos (20) /*!< ADC_T::CONF: TMAVDIS Position */ -#define ADC_CONF_TMAVDIS_Msk (0x1ul << ADC_CONF_TMAVDIS_Pos) /*!< ADC_T::CONF: TMAVDIS Mask */ - -#define ADC_CONF_ZMAVDIS_Pos (21) /*!< ADC_T::CONF: ZMAVDIS Position */ -#define ADC_CONF_ZMAVDIS_Msk (0x1ul << ADC_CONF_ZMAVDIS_Pos) /*!< ADC_T::CONF: ZMAVDIS Mask */ - -#define ADC_CONF_SPEED_Pos (22) /*!< ADC_T::CONF: SPEED Position */ -#define ADC_CONF_SPEED_Msk (0x1ul << ADC_CONF_SPEED_Pos) /*!< ADC_T::CONF: SPEED Mask */ - -#define ADC_IER_MIEN_Pos (0) /*!< ADC_T::IER: MIEN Position */ -#define ADC_IER_MIEN_Msk (0x1ul << ADC_IER_MIEN_Pos) /*!< ADC_T::IER: MIEN Mask */ - -#define ADC_IER_PEDEIEN_Pos (2) /*!< ADC_T::IER: PEDEIEN Position */ -#define ADC_IER_PEDEIEN_Msk (0x1ul << ADC_IER_PEDEIEN_Pos) /*!< ADC_T::IER: PEDEIEN Mask */ - -#define ADC_IER_WKTIEN_Pos (3) /*!< ADC_T::IER: WKTIEN Position */ -#define ADC_IER_WKTIEN_Msk (0x1ul << ADC_IER_WKTIEN_Pos) /*!< ADC_T::IER: WKTIEN Mask */ - -#define ADC_IER_PEUEIEN_Pos (6) /*!< ADC_T::IER: PEUEIEN Position */ -#define ADC_IER_PEUEIEN_Msk (0x1ul << ADC_IER_PEUEIEN_Pos) /*!< ADC_T::IER: PEUEIEN Mask */ - -#define ADC_ISR_MF_Pos (0) /*!< ADC_T::ISR: MF Position */ -#define ADC_ISR_MF_Msk (0x1ul << ADC_ISR_MF_Pos) /*!< ADC_T::ISR: MF Mask */ - -#define ADC_ISR_PEDEF_Pos (2) /*!< ADC_T::ISR: PEDEF Position */ -#define ADC_ISR_PEDEF_Msk (0x1ul << ADC_ISR_PEDEF_Pos) /*!< ADC_T::ISR: PEDEF Mask */ - -#define ADC_ISR_PEUEF_Pos (4) /*!< ADC_T::ISR: PEUEF Position */ -#define ADC_ISR_PEUEF_Msk (0x1ul << ADC_ISR_PEUEF_Pos) /*!< ADC_T::ISR: PEUEF Mask */ - -#define ADC_ISR_TF_Pos (8) /*!< ADC_T::ISR: TF Position */ -#define ADC_ISR_TF_Msk (0x1ul << ADC_ISR_TF_Pos) /*!< ADC_T::ISR: TF Mask */ - -#define ADC_ISR_ZF_Pos (9) /*!< ADC_T::ISR: ZF Position */ -#define ADC_ISR_ZF_Msk (0x1ul << ADC_ISR_ZF_Pos) /*!< ADC_T::ISR: ZF Mask */ - -#define ADC_ISR_NACF_Pos (10) /*!< ADC_T::ISR: NACF Position */ -#define ADC_ISR_NACF_Msk (0x1ul << ADC_ISR_NACF_Pos) /*!< ADC_T::ISR: NACF Mask */ - -#define ADC_ISR_INTTC_Pos (17) /*!< ADC_T::ISR: INTTC Position */ -#define ADC_ISR_INTTC_Msk (0x1ul << ADC_ISR_INTTC_Pos) /*!< ADC_T::ISR: INTTC Mask */ - -#define ADC_WKISR_WPEDEF_Pos (1) /*!< ADC_T::WKISR: WPEDEF Position */ -#define ADC_WKISR_WPEDEF_Msk (0x1ul << ADC_WKISR_WPEDEF_Pos) /*!< ADC_T::WKISR: WPEDEF Mask */ - -#define ADC_XYDATA_XDATA_Pos (0) /*!< ADC_T::XYDATA: XDATA Position */ -#define ADC_XYDATA_XDATA_Msk (0xffful << ADC_XYDATA_XDATA_Pos) /*!< ADC_T::XYDATA: XDATA Mask */ - -#define ADC_XYDATA_YDATA_Pos (16) /*!< ADC_T::XYDATA: YDATA Position */ -#define ADC_XYDATA_YDATA_Msk (0xffful << ADC_XYDATA_YDATA_Pos) /*!< ADC_T::XYDATA: YDATA Mask */ - -#define ADC_ZDATA_Z1DATA_Pos (0) /*!< ADC_T::ZDATA: Z1DATA Position */ -#define ADC_ZDATA_Z1DATA_Msk (0xffful << ADC_ZDATA_Z1DATA_Pos) /*!< ADC_T::ZDATA: Z1DATA Mask */ - -#define ADC_ZDATA_Z2DATA_Pos (16) /*!< ADC_T::ZDATA: Z2DATA Position */ -#define ADC_ZDATA_Z2DATA_Msk (0xffful << ADC_ZDATA_Z2DATA_Pos) /*!< ADC_T::ZDATA: Z2DATA Mask */ - -#define ADC_DATA_ADCDATA_Pos (0) /*!< ADC_T::DATA: ADCDATA Position */ -#define ADC_DATA_ADCDATA_Msk (0xffful << ADC_DATA_ADCDATA_Pos) /*!< ADC_T::DATA: ADCDATA Mask */ - -#define ADC_XYSORT_XSORT_Pos (0) /*!< ADC_T::XYSORT: XSORT Position */ -#define ADC_XYSORT_XSORT_Msk (0xffful << ADC_XYSORT_XSORT_Pos) /*!< ADC_T::XYSORT: XSORT Mask */ - -#define ADC_XYSORT_YSORT_Pos (16) /*!< ADC_T::XYSORT: YSORT Position */ -#define ADC_XYSORT_YSORT_Msk (0xffful << ADC_XYSORT_YSORT_Pos) /*!< ADC_T::XYSORT: YSORT Mask */ - -#define ADC_ZSORT_Z1SORT_Pos (0) /*!< ADC_T::ZSORT: Z1SORT Position */ -#define ADC_ZSORT_Z1SORT_Msk (0xffful << ADC_ZSORT_Z1SORT_Pos) /*!< ADC_T::ZSORT: Z1SORT Mask */ - -#define ADC_ZSORT_Z2SORT_Pos (16) /*!< ADC_T::ZSORT: Z2SORT Position */ -#define ADC_ZSORT_Z2SORT_Msk (0xffful << ADC_ZSORT_Z2SORT_Pos) /*!< ADC_T::ZSORT: Z2SORT Mask */ - -/**@}*/ /* ADC_CONST */ -/**@}*/ /* end of ADC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif //__ADC_REG_H__ - - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/canfd_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/canfd_reg.h deleted file mode 100644 index e4595d878a1..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/canfd_reg.h +++ /dev/null @@ -1,1709 +0,0 @@ -/**************************************************************************//** - * @file canfd_reg.h - * @brief CANFD register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __CANFD_REG_H__ -#define __CANFD_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup Controller Area Network with Feasibility Data Rate (CAN FD) - Memory Mapped Structure for CAN FD Controller -@{ */ - -typedef struct -{ - - - /** - * @var CANFD_T::DBTP - * Offset: 0x0C Data Bit Timing & Prescaler Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DSJW |Data Re-Synchronization Jump Width - * | | |Valid values are 0 to 15 - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used - * | | |tSJW = (DSJW + 1) x tq. - * |[7:4] |DTSEG2 |Data time segment after sample point - * | | |Valid values are 0 to 15 - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used - * | | |tBS2 = (DTSEG2 + 1) x tq. - * |[12:8] |DTSEG1 |Data time segment before sample point - * | | |Valid values are 0 to 31 - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used - * | | |tBS1 = (DTSEG1 + 1) x tq. - * |[20:16] |DBRP |Data Bit Rate Prescaler - * | | |The value by which the oscillator frequency is divided for generating the bit time quanta - * | | |The bit time is built up from a multiple of this quanta - * | | |Valid values for the Bit Rate Prescaler are 0 to 31 - * | | |When TDC = '1', the range is limited to 0,1 - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * |[23] |TDC |Transmitter Delay Compensation - * | | |0 =Transmitter Delay Compensation Disabled. - * | | |1 =Transmitter Delay Compensation Enabled. - * @var CANFD_T::TEST - * Offset: 0x10 Test Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |LBCK |Loop Back Mode - * | | |0 = Reset value, Loop Back Mode Disabled. - * | | |1 = Loop Back Mode Enabled (refer to section 6.33.5.1 TEST Mode). - * |[6:5] |TX |Control of Transmit Pin - * | | |00 = Reset value, CANx_TXD controlled by the CAN Core, updated at the end of the CAN bit time. - * | | |01 = Sample Point can be monitored at pin CANx_TXD. - * | | |10 = Dominant ('0') level at pin CANx_TXD. - * | | |11 = Recessive ('1') level at pin CANx_TXD. - * |[7] |RX |Receive Pin - * | | |Monitors the actual value of pin CANx_RXD - * | | |0 = The CAN bus is dominant (CANx_RXD = 0). - * | | |1 = The CAN bus is recessive (CANx_RXD = 1). - * @var CANFD_T::RWD - * Offset: 0x14 RAM Watchdog - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDC |Watchdog Configuration - * | | |Start value of the Message RAM Watchdog Counter. With the reset value of 00 the counter is disabled. - * |[15:8] |WDV |Watchdog Value - * | | |Actual Message RAM Watchdog Counter Value. - * @var CANFD_T::CCCR - * Offset: 0x18 CC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INIT |Initialization - * | | |0 = Normal Operation. - * | | |1 = Initialization is started. - * | | |Note: Due to the synchronization mechanism between the two clock domains, there may be a delay until the value written to INIT can be read back - * | | |Therefore the programmer has to assure that the previous value written to INIT has been accepted by reading INIT before setting INIT to a new value. - * |[1] |CCE |Configuration Change Enable - * | | |0 = The CPU has no write access to the protected configuration registers. - * | | |1 = The CPU has write access to the protected configuration registers (while CANFD_INIT (CANFD_CCCR[0]) = 1). - * |[2] |ASM |Restricted Operation Mode - * | | |Bit ASM can only be set by the Host when both CCE and INIT are set to 1 - * | | |The bit can be reset by the software at any time - * | | |This bit will be set automatically set to 1 when the Tx handler was not able to read data from the message RAM in time - * | | |For a description of the Restricted Operation Mode refer to Restricted Operation Mode. - * | | |0 = Normal CAN operation. - * | | |1 = Restricted Operation Mode active. - * |[3] |CSA |Clock Stop Acknowledge - * | | |0 = No clock stop acknowledged. - * | | |1 = The Controller may be set in power down by stopping AHB clock and CAN Core clock. - * |[4] |CSR |Clock Stop Request - * | | |0 = No clock stop is requested. - * | | |1 = Clock stop requested - * | | |When clock stop is requested, first INIT and then CSA will be set after all pending transfer requests have been completed and the CAN bus reached idle. - * |[5] |MON |Bus Monitoring Mode - * | | |Bit MON can only be set by the Host when both CCE and INIT are set to 1 - * | | |The bit can be reset by the Host at any time. - * | | |0 = Bus Monitoring Mode Disabled. - * | | |1 = Bus Monitoring Mode Enabled. - * |[6] |DAR |Disable Automatic Retransmission - * | | |0 = Automatic retransmission of messages not transmitted successfully Enabled. - * | | |1 = Automatic retransmission Disabled. - * |[7] |TEST |Test Mode Enable - * | | |0 = Normal operation, register TEST holds reset values. - * | | |1 = Test Mode, write access to register TEST enabled. - * |[8] |FDOE |FD Operation Enable - * | | |0 = FD operation Disabled. - * | | |1 = FD operation Enabled. - * |[9] |BRSE |Bit Rate Switch Enable - * | | |0 = Bit rate switching for transmissions Disabled. - * | | |1 = Bit rate switching for transmissions Enabled. - * | | |Note: When CAN FD operation is disabled FDOE = 0, BRSE is not evaluated. - * |[12] |PXHD |Protocol Exception Handling Disable - * | | |0 = Protocol exception handling Enabled. - * | | |1 = Protocol exception handling Disabled. - * | | |Note: When protocol exception handling is disabled, the controller will transmit an error frame when it detects a protocol exception condition. - * |[13] |EFBI |Edge Filtering during Bus Integration - * | | |0 = Edge filtering Disabled. - * | | |1 = Two consecutive dominant tq required to detect an edge f or hard synchronization. - * |[14] |TXP |Transmit Pause - * | | |If this bit is set, the CAN FD controller pauses for two CAN bit times before starting the next transmission after itself has successfully transmitted a frame (refer to section 6.33.5.5). - * | | |0 = Transmit pause Disabled. - * | | |1 = Transmit pause Enabled. - * |[15] |NISO |Non ISO Operation - * | | |If this bit is set, the CAN FD controller uses the CAN FD frame format as specified by the Bosch CAN FD Specification V1.0. - * | | |0 = CAN FD frame format according to ISO 11898-1:2015. - * | | |1 = CAN FD frame format according to Bosch CAN FD Specification V1.0. - * @var CANFD_T::NBTP - * Offset: 0x1C Nominal Bit Timing & Prescaler Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |NTSEG2 |Nominal Time Segment after Sample Point - * | | |0x01-0x7F Valid values are 1 to 127 - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used - * | | |tBS2 = (NTSEG2 + 1) x tq. - * | | |Note: With a CAN Core clock (cclk) of 8 MHz, the reset value of 0x06000A03 configures the controller for a bit rate of 500 kBit/s. - * |[15:8] |NTSEG1 |Nominal Time Segment before Sample Point - * | | |Valid values are 1 to 255 - * | | |The actual interpretation by the hardware of this value is such that one more than the programmed value is used - * | | |tBS1 = (NTSEG1 + 1) x tq. - * |[24:16] |NBRP |Nominal Bit Rate Prescaler - * | | |The value by which the oscillator frequency is divided for generating the bit time quanta - * | | |The bit time is built up from a multiple of this quanta - * | | |Valid values for the Bit Rate Prescaler are 0 to 511 - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used - * |[31:25] |NSJW |Nominal Re-Synchronization Jump Width - * | | |Valid values are 0 to 127, which should be smaller than NTSEG2 - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used - * | | |tSJW = (NSJW + 1) x tq. - * @var CANFD_T::TSCC - * Offset: 0x20 Timestamp Counter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TSS |Timestamp Select - * | | |00 = Timestamp counter value always 0x0000. - * | | |01 = Timestamp counter value incremented according to TCP. - * | | |10 = Reserved. - * | | |11 = Same as '00'. - * |[19:16] |TCP |Timestamp Counter Prescaler - * | | |Configures the timestamp and timeout counters time unit in multiples of CAN bit times [ 1u202616 ] - * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. - * @var CANFD_T::TSCV - * Offset: 0x24 Timestamp Counter Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TSC |Timestamp Counter - * | | |The internal Timestamp Counter value is captured on start of frame (both Rx and Tx) - * | | |When CANFD_TSS (TSCC[[1:0]) = 2'b01, the Timestamp Counter is incremented in multiples of CAN bit times [ 1...16 ] depending on the configuration of CANFD_TCP (CANFD_TSCC[19:16]) - * | | |A wrap around sets interrupt flag CANFD_IR (CANFD_IR[16]) - * | | |Write access resets the counter to 0. - * | | |Note: A "around" is a change of the Timestamp Counter value from non-zero to 0 not caused by write access to CANFD_TSCV. - * @var CANFD_T::TOCC - * Offset: 0x28 Timeout Counter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ETOC |Enable Timeout Counter - * | | |0 = Timeout Counter Disabled. - * | | |1 = Timeout Counter Enabled. - * | | |Note: For use of timeout function with CAN FD refer to section 6.33.5.3. - * |[2:1] |TOS |Timeout Select - * | | |When operating in Continuous mode, a write to CANFD_TOCV presets the counter to the value configured by CANFD_TOP (TOCC[31:16]) and continues down-counting - * | | |When the Timeout Counter is controlled by one of the FIFOs, an empty FIFO presets the counter to the value configured by CANFD_TOP (TOCC[31:16]) - * | | |Down-counting is started when the first FIFO element is stored. - * | | |00 = Continuous operation. - * | | |01 = Timeout controlled by Tx Event FIFO. - * | | |10 = Timeout controlled by Rx FIFO 0. - * | | |11 = Timeout controlled by Rx FIFO 1. - * |[31:16] |TOP |Timeout Period - * | | |Start value of the Timeout Counter (down-counter). Configures the Timeout Period. - * @var CANFD_T::TOCV - * Offset: 0x2C Timeout Counter Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TOC |Timeout Counter - * | | |The filed is decremented in multiples of CAN bit times [ 1...16 ] depending on the configuration of TCP (CANFD_TSCC[19:16]) - * | | |When decremented to 0, interrupt flag TOO (CANFD_IR[18]) is set and the timeout counter is stopped - * | | |Start and reset/restart conditions are configured via TOS (CANFD_TOCC[1:0]). - * @var CANFD_T::ECR - * Offset: 0x40 Error Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TEC |Transmit Error Counter - * | | |Actual state of the Transmit Error Counter, values between 0 and 255. - * | | |Note: When ASM (CANFD_CCCR[2]) is set, the CAN protocol controller does not increment TEC and REC when a CAN protocol error is detected, but CEL is still incremented. - * |[14:8] |REC |Receive Error Counter - * | | |Actual state of the Receive Error Counter, values between 0 and 127. - * |[15] |RP |Receive Error Passive - * | | |0 = The Receive Error Counter is below the error passive level of 128. - * | | |1 = The Receive Error Counter has reached the error passive level of 128. - * |[23:16] |CEL |CAN Error Logging - * | | |The counter is incremented each time when a CAN protocol error causes the 8-bit Transmit Error Counter TEC or the 7-bit Receive Error Counter REC to be incremented - * | | |The counter is also incremented when the Bus_Off limit is reached - * | | |It is not incremented when only RP is set without changing REC - * | | |The increment of CEL follows after the increment of REC or TEC. - * | | |The counter is reset by read access to CEL - * | | |The counter stops at 0xFF; the next increment of TEC or REC sets interrupt flag ELO (CANFD_IR[22]). - * @var CANFD_T::PSR - * Offset: 0x44 Protocol Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |LEC |Last Error Code - * | | |The LEC indicates the type of the last error to occur on the CAN bus - * | | |This field will be cleared to 0 when a message has been transferred (reception or transmission) without error. - * | | |000 = No Error: No error occurred since LEC has been reset by successful reception or transmission. - * | | |001 = Stuff Error: More than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed. - * | | |010 = Form Error: A fixed format part of a received frame has the wrong format. - * | | |011 = AckError: The message transmitted by the CANFD CONTROLLER was not acknowledged by another node. - * | | |100 = Bit1Error: During the transmission of a message (with the exception of the arbitration field), the device wanted to send a recessive level (bit of logical value 1), but the monitored bus value was dominant. - * | | |101 = Bit0Error : During the transmission of a message (or acknowledge bit, or active error flag, or overload flag), the device wanted to send a dominant level (data or identifier bit logical value 0), but the monitored bus value was recessive - * | | |During Bus_Off recovery this status is set each time a sequence of 11 recessive bits has been monitored - * | | |This enables the CPU to monitor the proceeding of the Bus_Off recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed). - * | | |110 = CRCError: The CRC check sum of a received message was incorrect - * | | |The CRC of an incoming message does not match with the CRC calculated from the received data. - * | | |111 = NoChange: Any read access to the Protocol Status Register re-initializes the LEC to 7.When the LEC shows the value 7, no CAN bus event was detected since the last CPU read access to the Protocol Status Register. - * |[4:3] |ACT |Activity - * | | |Monitors the module's CAN communication state. - * | | |00 = Synchronizing - node is synchronizing on CAN communication. - * | | |01 = Idle - node is neither receiver nor transmitter. - * | | |10 = Receiver - node is operating as receiver. - * | | |11 = Transmitter - node is operating as transmitter. - * |[5] |EP |Error Passive - * | | |0 = The CAN FD controller is in the Error_Active state - * | | |It normally takes part in bus communication and sends an active error flag when an error has been detected. - * | | |1 = The CAN FD controller is in the Error_Passive state. - * |[6] |EW |Warning Status - * | | |0 = Both error counters are below the Error_Warning limit of 96. - * | | |1 = At least one of error counter has reached the Error_Warning limit of 96. - * |[7] |BO |Bus_Off Status - * | | |0 = The CAN FD controller is not Bus_Off. - * | | |1 = The CAN FD controller is in Bus_Off state. - * |[10:8] |DLEC |Data Phase Last Error Code - * | | |Type of last error that occurred in the data phase of a CAN FD format frame with its BRS flag set - * | | |Coding is the same as for LEC - * | | |This field will be cleared to 0 when a CAN FD format frame with its BRS flag set has been transferred (reception or transmission) without error. - * |[11] |RESI |ESI flag of last received CAN FD Message - * | | |This bit is set together with RFDF, independent of acceptance filtering. - * | | |0 = Last received CAN FD message did not have its ESI flag set. - * | | |1 = Last received CAN FD message had its ESI flag set. - * |[12] |RBRS |BRS flag of last received CAN FD Message - * | | |This bit is set together with RFDF, independent of acceptance filtering. - * | | |0 = Last received CAN FD message did not have its BRS flag set. - * | | |1 = Last received CAN FD message had its BRS flag set. - * | | |Note: Byte access: Reading byte 0 will reset RBRS, reading bytes 3/2/1 has no impact. - * |[13] |RFDF |Received a CAN FD Message - * | | |This bit is set independent of acceptance filtering. - * | | |0 = Since this bit was reset by the CPU, no CAN FD message has been received. - * | | |1 = Message in CAN FD format with FDF flag set has been received. - * | | |Note: Byte access: Reading byte 0 will reset RFDF, reading bytes 3/2/1 has no impact. - * |[14] |PXE |Protocol Exception Event - * | | |0 = No protocol exception event occurred since last read access. - * | | |1 = Protocol exception event occurred. - * |[22:16] |TDCV |Transmitter Delay Compensation Value - * | | |Position of the secondary sample point, defined by the sum of the measured delay from CANx_TXD to CANx_RXD and TDCO (TDCR[[14:8]) - * | | |The SSP position is, in the data phase, the number of minimum time quata (mtq) between the start of the transmitted bit and the secondary sample point - * | | |Valid values are 0 to 127 mtq. - * @var CANFD_T::TDCR - * Offset: 0x48 Transmitter Delay Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TDCF |Transmitter Delay Compensation Filter Window Length - * | | |Defines the minimum value for the SSP position, dominant edges on CANx_RXD that would result in an earlier SSP position are ignored for transmitter delay measurement - * | | |The feature is enabled when TDCF is configured to a value greater than TDCO - * | | |Valid values are 0 to 127 mtq. - * |[14:8] |TDCO |Transmitter Delay Compensation SSP Offset - * | | |Offset value defining the distance between the measured delay from CANx_TXD to CANx_RXD and the secondary sample point - * | | |Valid values are 0 to 127 mtq. - * @var CANFD_T::IR - * Offset: 0x50 Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RF0N |Rx FIFO 0 New Message - * | | |0 = No new message written to Rx FIFO 0. - * | | |1 = New message written to Rx FIFO 0. - * |[1] |RF0W |Rx FIFO 0 Watermark Reached - * | | |0 = Rx FIFO 0 fill level below watermark. - * | | |1 = Rx FIFO 0 fill level reached watermark. - * |[2] |RF0F |Rx FIFO 0 Full - * | | |0 = Rx FIFO 0 not full. - * | | |1 = Rx FIFO 0 full. - * |[3] |RF0L |Rx FIFO 0 Message Lost - * | | |0 = No Rx FIFO 0 message lost. - * | | |1 = Rx FIFO 0 message lost, also set after write attempt to Rx FIFO 0 of size zero. - * |[4] |RF1N |Rx FIFO 1 New Message - * | | |0 = No new message written to Rx FIFO 1. - * | | |1 = New message written to Rx FIFO 1. - * |[5] |RF1W |Rx FIFO 1 Watermark Reached - * | | |0 = Rx FIFO 1 fill level below watermark. - * | | |1 = Rx FIFO 1 fill level reached watermark. - * |[6] |RF1F |Rx FIFO 1 Full - * | | |0 = Rx FIFO 1 not full. - * | | |1 = Rx FIFO 1 full. - * |[7] |RF1L |Rx FIFO 1 Message Lost - * | | |0 = No Rx FIFO 1 message lost. - * | | |1 = Rx FIFO 1 message lost, also set after write attempt to Rx FIFO 1 of size zero. - * |[8] |HPM |High Priority Message - * | | |0 = No high priority message received. - * | | |1 = High priority message received. - * |[9] |TC |Transmission Completed - * | | |0 = No transmission completed. - * | | |1 = Transmission completed. - * |[10] |TCF |Transmission Cancellation Finished - * | | |0 = No transmission cancellation finished. - * | | |1 = Transmission cancellation finished. - * |[11] |TFE |Tx FIFO Empty - * | | |0 = Tx FIFO non-empty. - * | | |1 = Tx FIFO empty. - * |[12] |TEFN |Tx Event FIFO New Entry - * | | |0 = Tx Event FIFO unchanged. - * | | |1 = Tx Handler wrote Tx Event FIFO element. - * |[13] |TEFW |Tx Event FIFO Watermark Reached - * | | |0 = Tx Event FIFO fill level below watermark. - * | | |1 = Tx Event FIFO fill level reached watermark. - * |[14] |TEFF |Tx Event FIFO Full - * | | |0 = Tx Event FIFO not full. - * | | |1 = Tx Event FIFO full. - * |[15] |TEFL |Tx Event FIFO Element Lost - * | | |0 = No Tx Event FIFO element lost. - * | | |1 = Tx Event FIFO element lost, also set after write attempt to Tx Event FIFO of size zero. - * |[16] |TSW |Timestamp Wraparound - * | | |0 = No timestamp counter wrap-around. - * | | |1 = Timestamp counter wrapped around. - * |[17] |MRAF |Message RAM Access Failure - * | | |The flag is set, when the Rx Handler - * | | |Has not completed acceptance filtering or storage of an accepted message until the arbitration field of the following message has been received - * | | |In this case acceptance filtering or message storage is aborted and the Rx Handler starts processing of the following message. - * | | |Was not able to write a message to the Message RAM. In this case message storage is aborted. - * | | |In both cases the FIFO put index is not updated resp - * | | |The New Data flag for a dedicated Rx Buffer is not set, a partly stored message is overwritten when the next message is stored to this location. - * | | |The flag is also set when the Tx Handler was not able to read a message from the Message RAM in time - * | | |In this case message transmission is aborted - * | | |In case of a Tx Handler access failure the CAN FD controller is switched into Restricted Operation Mode (refer to Restricted Operation Mode) - * | | |To leave Restricted Operation Mode, the Host CPU has to reset CANFD_ASM (CANFD_CCCR[2]). - * | | |0 = No Message RAM access failure occurred. - * | | |1 = Message RAM access failure occurred. - * |[18] |TOO |Timeout Occurred - * | | |0 = No timeout. - * | | |1 = Timeout reached. - * |[19] |DRX |Message stored to Dedicated Rx Buffer - * | | |The flag is set whenever a received message has been stored into a dedicated Rx Buffer. - * | | |0 = No Rx Buffer updated. - * | | |1 = At least one received message stored into an Rx Buffer. - * |[22] |ELO |Error Logging Overflow - * | | |0 = CAN Error Logging Counter did not overflow. - * | | |1 = Overflow of CAN Error Logging Counter occurred. - * |[23] |EP |Error Passive - * | | |0 = Error_Passive status unchanged. - * | | |1 = Error_Passive status changed. - * |[24] |EW |Warning Status - * | | |0 = Error_Warning status unchanged. - * | | |1 = Error_Warning status changed. - * |[25] |BO |Bus_Off Status - * | | |0 = Bus_Off status unchanged. - * | | |1 = Bus_Off status changed. - * |[26] |WDI |Watchdog Interrupt - * | | |0 = No Message RAM Watchdog event occurred. - * | | |1 = Message RAM Watchdog event due to missing READY. - * |[27] |PEA |Protocol Error in Arbitration Phase - * | | |0 = No protocol error in arbitration phase. - * | | |1 = Protocol error in arbitration phase detected (CANFD_LEC (CANFD_PSR[2:0]) no equal 0 or 7). - * | | |Note: Nominal bit time is used. - * |[28] |PED |Protocol Error in Data Phase - * | | |0 = No protocol error in data phase. - * | | |1 = Protocol error in data phase detected (DLEC (CANFD_PSR[10:8]) no equal 0 or 7). - * | | |Note: Data bit time is used. - * |[29] |ARA |Access to Reserved Address - * | | |0 = No access to reserved address occurred. - * | | |1 = Access to reserved address occurred. - * @var CANFD_T::IE - * Offset: 0x54 Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RF0NE |Rx FIFO 0 New Message Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[1] |RF0WE |Rx FIFO 0 Watermark Reached Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[2] |RF0FE |Rx FIFO 0 Full Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[3] |RF0LE |Rx FIFO 0 Message Lost Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[4] |RF1NE |Rx FIFO 1 New Message Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[5] |RF1WE |Rx FIFO 1 Watermark Reached Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[6] |RF1FE |Rx FIFO 1 Full Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[7] |RF1LE |Rx FIFO 1 Message Lost Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[8] |HPME |High Priority Message Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[9] |TCE |Transmission Completed Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[10] |TCFE |Transmission Cancellation Finished Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[11] |TFEE |Tx FIFO Empty Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[12] |TEFNE |Tx Event FIFO New Entry Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[13] |TEFWE |Tx Event FIFO Watermark Reached Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[14] |TEFFE |Tx Event FIFO Full Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[15] |TEFLE |Tx Event FIFO Event Lost Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[16] |TSWE |Timestamp Wraparound Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[17] |MRAFE |Message RAM Access Failure Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[18] |TOOE |Timeout Occurred Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[19] |DRXE |Message stored to Dedicated Rx Buffer Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[20] |BECE |Bit Error Corrected Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[21] |BEUE |Bit Error Uncorrected Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[22] |ELOE |Error Logging Overflow Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[23] |EPE |Error Passive Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[24] |EWE |Warning Status Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[25] |BOE |Bus_Off Status Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[26] |WDIE |Watchdog Interrupt Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[27] |PEAE |Protocol Error in Arbitration Phase Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[28] |PEDE |Protocol Error in Data Phase Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * |[29] |ARAE |Access to Reserved Address Enable - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * @var CANFD_T::ILS - * Offset: 0x58 Interrupt Line Select - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RF0NL |Rx FIFO 0 New Message Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[1] |RF0WL |Rx FIFO 0 Watermark Reached Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[2] |RF0FL |Rx FIFO 0 Full Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[3] |RF0LL |Rx FIFO 0 Message Lost Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[4] |RF1NL |Rx FIFO 1 New Message Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[5] |RF1WL |Rx FIFO 1 Watermark Reached Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[6] |RF1FL |Rx FIFO 1 Full Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[7] |RF1LL |Rx FIFO 1 Message Lost Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[8] |HPML |High Priority Message Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[9] |TCL |Transmission Completed Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[10] |TCFL |Transmission Cancellation Finished Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[11] |TFEL |Tx FIFO Empty Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[12] |TEFNL |Tx Event FIFO New Entry Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[13] |TEFWL |Tx Event FIFO Watermark Reached Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[14] |TEFFL |Tx Event FIFO Full Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[15] |TEFLL |Tx Event FIFO Event Lost Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[16] |TSWL |Timestamp Wraparound Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[17] |MRAFL |Message RAM Access Failure Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[18] |TOOL |Timeout Occurred Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[19] |DRXL |Message stored to Dedicated Rx Buffer Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[22] |ELOL |Error Logging Overflow Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[23] |EPL |Error Passive Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[24] |EWL |Warning Status Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[25] |BOL |Bus_Off Status Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[26] |WDIL |Watchdog Interrupt Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[27] |PEAL |Protocol Error in Arbitration Phase Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[28] |PEDL |Protocol Error in Data Phase Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * |[29] |ARAL |Access to Reserved Address Line - * | | |0 = Interrupt assigned to CAN interrupt line 0. - * | | |1 = Interrupt assigned to CAN interrupt line 1. - * @var CANFD_T::ILE - * Offset: 0x5C Interrupt Line Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ENT0 |Enable Interrupt Line 0 - * | | |0 = Interrupt line canfd_int0 Disabled. - * | | |1 = Interrupt line canfd_int0 Enabled. - * |[1] |ENT1 |Enable Interrupt Line 1 - * | | |0 = Interrupt line canfd_int1 Disabled. - * | | |1 = Interrupt line canfd_int1 Enabled. - * @var CANFD_T::GFC - * Offset: 0x80 Global Filter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RRFE |Reject Remote Frames Extended - * | | |0 = Filter remote frames with 29-bit extended IDs. - * | | |1 = Reject all remote frames with 29-bit extended IDs. - * |[1] |RRFS |Reject Remote Frames Standard - * | | |0 = Filter remote frames with 11-bit standard IDs. - * | | |1 = Reject all remote frames with 11-bit standard IDs. - * |[3:2] |ANFE |Accept Non-matching Frames Extended - * | | |Defines how received messages with 29-bit IDs that do not match any element of the filter list are treated. - * | | |00 = Accept in Rx FIFO 0. - * | | |01 = Accept in Rx FIFO 1. - * | | |10 = Reject. - * | | |11 = Reject. - * |[5:4] |ANFS |Accept Non-matching Frames Standard - * | | |Defines how received messages with 11-bit IDs that do not match any element of the filter list are treated. - * | | |00 = Accept in Rx FIFO 0. - * | | |01 = Accept in Rx FIFO 1. - * | | |10 = Reject. - * | | |11 = Reject. - * @var CANFD_T::SIDFC - * Offset: 0x84 Standard ID Filter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |FLSSA |Filter List Standard Start Address - * | | |Start address of standard Message ID filter list (32-bit word address, refer to Figure 6.33-11). - * |[23:16] |LSS |List Size Standard - * | | |0 = No standard Message ID filter. - * | | |1-128 = Number of standard Message ID filter elements. - * | | |>128 = Values greater than 128 are interpreted as 128. - * @var CANFD_T::XIDFC - * Offset: 0x88 Extended ID Filter Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |FLESA |Filter List Extended Start Address - * | | |Start address of extended Message ID filter list (32-bit word address, refer to Figure 6.33-11). - * |[22:16] |LSE |List Size Extended - * | | |0 = No extended Message ID filter. - * | | |1-64 = Number of extended Message ID filter elements. - * | | |>64 = Values greater than 64 are interpreted as 64. - * @var CANFD_T::XIDAM - * Offset: 0x90 Extended ID AND Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |EIDM |Extended ID Mask - * | | |For acceptance filtering of extended frames the Extended ID AND Mask is ANDed with the Message ID of a received frame - * | | |Intended for masking of 29-bit IDs in SAE J1939 - * | | |With the reset value of all bits set to one the mask is not active. - * @var CANFD_T::HPMS - * Offset: 0x94 High Priority Message Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |BIDX |Buffer Index - * | | |Index of Rx FIFO element to which the message was stored. Only valid when MSI[1] = 1. - * |[7:6] |MSI |Message Storage Indicator - * | | |00 = No FIFO selected. - * | | |01 = FIFO message lost. - * | | |10 = Message stored in FIFO 0. - * | | |11 = Message stored in FIFO 1. - * |[14:8] |FIDX |Filter Index - * | | |Index of matching filter element. Range is 0 to CANFD_SIDFC.LSS - 1 or CANFD_XIDFC.LSE - 1 - * |[15] |FLST |Filter List - * | | |Indicates the filter list of the matching filter element. - * | | |0 = Standard Filter List. - * | | |1 = Extended Filter List. - * @var CANFD_T::NDAT1 - * Offset: 0x98 New Data 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NDn |New Data - * | | |The register holds the New Data flags of Rx Buffers 0 to 31 - * | | |The flags are set when the respective Rx Buffer has been updated from a received frame - * | | |The flags remain set until the Host clears them - * | | |A flag is cleared by writing a 1 to the corresponding bit position - * | | |Writing a 0 has no effect - * | | |A hard reset will clear the register. - * | | |0 = Rx Buffer not updated. - * | | |1 = Rx Buffer updated from new message. - * @var CANFD_T::NDAT2 - * Offset: 0x9C New Data 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NDn |New Data - * | | |The register holds the New Data flags of Rx Buffers 32 to 63 - * | | |The flags are set when the respective Rx Buffer has been updated from a received frame - * | | |The flags remain set until the Host clears them - * | | |A flag is cleared by writing a 1 to the corresponding bit position - * | | |Writing a 0 has no effect - * | | |A hard reset will clear the register. - * | | |0 = Rx Buffer not updated. - * | | |1 = Rx Buffer updated from new message. - * @var CANFD_T::RXF0C - * Offset: 0xA0 Rx FIFO 0 Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |F0SA |Rx FIFO 0 Start Address - * | | |Start address of Rx FIFO 0 in Message RAM (32-bit word address). - * |[22:16] |F0S |Rx FIFO 0 Size - * | | |0 = No Rx FIFO 0. - * | | |1-64 = Number of Rx FIFO 0 elements. - * | | |>64 = Values greater than 64 are interpreted as 64. - * | | |The Rx FIFO 0 elements are indexed from 0 to F0S-1 - * |[30:24] |F0WM |Rx FIFO 0 Watermark - * | | |0 = Watermark interrupt Disabled. - * | | |1-64 = Level for Rx FIFO 0 watermark interrupt (CANFD_IR.RF0W). - * | | |>64 = Watermark interrupt Disabled. - * |[31] |F0OM |FIFO 0 Operation Mode - * | | |FIFO 0 can be operated in blocking or in overwrite mode (refer to Rx FIFOs). - * | | |0 = FIFO 0 blocking mode. - * | | |1 = FIFO 0 overwrite mode. - * @var CANFD_T::RXF0S - * Offset: 0xA4 Rx FIFO 0 Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |F0FL |Rx FIFO 0 Fill Level - * | | |Number of elements stored in Rx FIFO 0, range 0 to 64 - * |[13:8] |F0GI |Rx FIFO 0 Get Index - * | | |Rx FIFO 0 read index pointer, range 0 to 63. - * |[21:16] |F0PI |Rx FIFO 0 Put Index - * | | |Rx FIFO 0 write index pointer, range 0 to 63. - * |[24] |F0F |Rx FIFO 0 Full - * | | |0 = Rx FIFO 0 not full. - * | | |1 = Rx FIFO 0 full. - * |[25] |RF0L |Rx FIFO 0 Message Lost - * | | |This bit is a copy of interrupt flag CANFD_IR.RF0L - * | | |When CANFD_IR.RF0L is reset, this bit is also reset - * | | |0 = No Rx FIFO 0 message lost. - * | | |1 = Rx FIFO 0 message lost, also set after write attempt to Rx FIFO 0 of size zero. - * | | |Note: Overwriting the oldest message when F0OM (CANFD_RXF0C[31]) = 1 will not set this flag. - * @var CANFD_T::RXF0A - * Offset: 0xA8 Rx FIFO 0 Acknowledge - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |F0A |Rx FIFO 0 Acknowledge Index - * | | |After the Host has read a message or a sequence of messages from Rx FIFO 0 it has to write the buffer index of the last element read from Rx FIFO 0 to F0AI - * | | |This will set the Rx FIFO 0 Get Index F0GI (CANFD_RXF0S[13:8]) to F0AI (CANFD_RXF0A[5:0]) + 1 and update the FIFO 0 Fill Level CANFD_RXF0S.F0FL. - * @var CANFD_T::RXBC - * Offset: 0xAC Rx Buffer Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |RBSA |Rx Buffer Start Address - * | | |Configures the start address of the Rx Buffers section in the Message RAM (32-bit word address). - * @var CANFD_T::RXF1C - * Offset: 0xB0 Rx FIFO 1 Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |F1SA |Rx FIFO 1 Start Address - * | | |Start address of Rx FIFO 1 in Message RAM (32-bit word address, refer to Figure 6.33-11). - * |[22:16] |F1S |Rx FIFO 1 Size - * | | |0 = No Rx FIFO 1. - * | | |1-64 = Number of Rx FIFO 1 elements. - * | | |>64 = Values greater than 64 are interpreted as 64. - * | | |The Rx FIFO 1 elements are indexed from 0 to F1S - 1 - * |[30:24] |F1WM |Rx FIFO 1 Watermark - * | | |0 = Watermark interrupt Disabled. - * | | |1-64 = Level for Rx FIFO 1 watermark interrupt (CANFD_IR.RF1W). - * | | |>64 = Watermark interrupt Disabled. - * |[31] |F1OM |FIFO 1 Operation Mode - * | | |FIFO 1 can be operated in blocking or in overwrite mode (refer to Rx FIFOs). - * | | |0 = FIFO 1 blocking mode. - * | | |1 = FIFO 1 overwrite mode. - * @var CANFD_T::RXF1S - * Offset: 0xB4 Rx FIFO 1 Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |F1FL |Rx FIFO 1 Fill Level - * | | |Number of elements stored in Rx FIFO 1, range 0 to 64 - * |[13:8] |F1G |Rx FIFO 1 Get Index - * | | |Rx FIFO 1 read index pointer, range 0 to 63. - * |[21:16] |F1P |Rx FIFO 1 Fill Level - * | | |Number of elements stored in Rx FIFO 1, range 0 to 64. - * |[24] |F1F |Rx FIFO 1 Full - * | | |0 = Rx FIFO 1 not full. - * | | |1 = Rx FIFO 1 full. - * |[25] |RF1L |Rx FIFO 1 Message Lost - * | | |This bit is a copy of interrupt flag CANFD_IR.RF1L - * | | |When CANFD_IR.RF1L is reset, this bit is also reset - * | | |0 = No Rx FIFO 1 message lost. - * | | |1 = Rx FIFO 1 message lost, also set after write attempt to Rx FIFO 1 of size zero. - * | | |Note: Overwriting the oldest message when F1OM (CANFD_RXF1C[31]) = 1 will not set this flag. - * @var CANFD_T::RXF1A - * Offset: 0xB8 Rx FIFO 1 Acknowledge - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |F1A |Rx FIFO 1 Acknowledge Index - * | | |After the Host has read a message or a sequence of messages from Rx FIFO 1 it has to write the buffer index of the last element read from Rx FIFO 1 to F1AI - * | | |This will set the Rx FIFO 1 Get Index F1GI (CANFD_RXF1S[13:8]) to F1AI (CANFD_RXF1A[5:0]) + 1 and update the FIFO 1 Fill Level F1FL (CANFD_RXF1S[6:0]). - * @var CANFD_T::RXESC - * Offset: 0xBC Rx Buffer / FIFO Element Size Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |F0DS |Rx FIFO 0 Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * | | |Note: In case the data field size of an accepted CAN frame exceeds the data field size configured for the matching Rx Buffer or Rx FIFO, only the number of bytes as configured by CANFD_RXESC are stored to the Rx Buffer resp - * | | |Rx FIFO element - * | | |The rest of the frame data field is ignored. - * |[6:4] |F1DS |Rx FIFO 1 Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * |[10:8] |RBDS |Rx Buffer Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * @var CANFD_T::TXBC - * Offset: 0xC0 Tx Buffer Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |TBSA |Tx Buffers Start Address - * | | |Start address of Tx Buffers section in Message RAM (32-bit word address, refer to Figure 6.33-11). - * | | |Note: The sum of TFQS and NDTB may be not greater than 32 - * | | |There is no check for erroneous configurations - * | | |The Tx Buffers section in the Message RAM starts with the dedicated Tx Buffers. - * |[21:16] |NDTB |Number of Dedicated Transmit Buffers - * | | |0 = No Dedicated Tx Buffers. - * | | |1-32 = Number of Dedicated Tx Buffers. - * | | |>32 = Values greater than 32 are interpreted as 32. - * |[29:24] |TFQS |Transmit FIFO/Queue Size - * | | |0 = No Tx FIFO/Queue. - * | | |1-32 = Number of Tx Buffers used for Tx FIFO/Queue. - * | | |>32 = Values greater than 32 are interpreted as 32. - * |[30] |TFQM |Tx FIFO/Queue Mode - * | | |0 = Tx FIFO operation. - * | | |1 = Tx Queue operation. - * @var CANFD_T::TXFQS - * Offset: 0xC4 Tx FIFO/Queue Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |TFFL |Tx FIFO Free Level - * | | |Number of consecutive free Tx FIFO elements starting from TFGI, range 0 to 32 - * | | |Read as 0 when Tx Queue operation is configured (TFQM (CANFD_TXBC[3]) = 1). - * | | |Note: In case of mixed configurations where dedicated Tx Buffers are combined with a Tx FIFO or a Tx Queue, the Put and Get Indices indicate the number of the Tx Buffer starting with the first dedicated Tx Buffers. - * | | |Example: For a configuration of 12 dedicated Tx Buffers and a Tx FIFO of 20 Buffers a Put Index of 15 points to the fourth buffer of the Tx FIFO. - * |[12:8] |TFG |Tx FIFO Get Index - * | | |Tx FIFO read index pointer, range 0 to 31 - * | | |Read as 0 when Tx Queue operation is configured (TFQM (CANFD_TXBC[30]) = 1). - * |[20:16] |TFQP |Tx FIFO/Queue Put Index - * | | |Tx FIFO/Queue write index pointer, range 0 to 31. - * |[21] |TFQF |Tx FIFO/Queue Full - * | | |0 = Tx FIFO/Queue not full. - * | | |1 = Tx FIFO/Queue full. - * @var CANFD_T::TXESC - * Offset: 0xC8 Tx Buffer Element Size Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TBDS |Tx Buffer Data Field Size - * | | |000 = 8 byte data field. - * | | |001 = 12 byte data field. - * | | |010 = 16 byte data field. - * | | |011 = 20 byte data field. - * | | |100 = 24 byte data field. - * | | |101 = 32 byte data field. - * | | |110 = 48 byte data field. - * | | |111 = 64 byte data field. - * | | |Note: In case the data length code DLC of a Tx Buffer element is configured to a value higher than the Tx Buffer data field size CANFD_TXESC.TBDS, the bytes not defined by the Tx Buffer are transmitted as 0xCC (padding bytes). - * @var CANFD_T::TXBRP - * Offset: 0xCC Tx Buffer Request Pending - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TRPn |Transmission Request Pending Each Tx Buffer has its own Transmission Request Pending bit The bits are set via register CANFD_TXBAR The bits are reset after a requested transmission has completed or has been cancelled via register CANFD_TXBCR - * | | |CANFD_TXBRP bits are set only for those Tx Buffers configured via CANFD_TXBC - * | | |After a CANFD_TXBRP bit has been set, a Tx scan (refer to section 6.33.5.5, Tx Handling) is started to check for the pending Tx request with the highest priority (Tx Buffer with lowest Message ID). - * | | |A cancellation request resets the corresponding transmission request pending bit of register CANFD_TXBRP - * | | |In case a transmission has already been started when a cancellation is requested, this is done at the end of the transmission, regardless whether the transmission was successful or not - * | | |The cancellation request bits are reset directly after the corresponding CANFD_TXBRP bit has been reset. - * | | |After a cancellation has been requested, a finished cancellation is signaled via CANFD_TXBCF - * | | |- after successful transmission together with the corresponding CANFD_TXBTO bit - * | | |- when the transmission has not yet been started at the point of cancellation - * | | |- when the transmission has been aborted due to lost arbitration - * | | |- when an error occurred during frame transmission - * | | |In DAR mode all transmissions are automatically cancelled if they are not successful - * | | |The corresponding CANFD_TXBCF bit is set for all unsuccessful transmissions. - * | | |0 = No transmission request pending. - * | | |1 = Transmission request pending. - * | | |Note: CANFD_TXBRP bits which are set while a Tx scan is in progress are not considered during this particular Tx scan - * | | |In case a cancellation is requested for such a Tx Buffer, this Add Request is cancelled immediately, the corresponding CANFD_TXBRP bit is reset. - * @var CANFD_T::TXBAR - * Offset: 0xD0 Tx Buffer Add Request - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ARn |Add Request Each Tx Buffer has its own Add Request bit Writing a 1 will set the corresponding Add Request bit; writing a 0 has no impact This enables the Host to set transmission requests for multiple Tx Buffers with one write to CANFD_TXBAR CANFD_TXBAR bits are set only for those Tx Buffers configured via CANFD_TXBC - * | | |When no Tx scan is running, the bits are reset immediately, else the bits remain set until the Tx scan process has completed - * | | |0 = No transmission request added. - * | | |1 = Transmission requested added. - * | | |Note: If an add request is applied for a Tx Buffer with pending transmission request (corresponding CANFD_TXBRP bit already set), this add request is ignored. - * @var CANFD_T::TXBCR - * Offset: 0xD4 Tx Buffer Cancellation Request - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRn |Cancellation Request - * | | |Each Tx Buffer has its own Cancellation Request bit - * | | |Writing a 1 will set the corresponding Cancellation Request bit; writing a 0 has no impact - * | | |This enables the Host to set cancellation requests for multiple Tx Buffers with one write to CANFD_TXBCR - * | | |CANFD_TXBCR bits are set only for those Tx Buffers configured via CANFD_TXBC - * | | |The bits remain set until the corresponding bit of CANFD_TXBRP is reset. - * | | |0 = No cancellation pending. - * | | |1 = Cancellation pending. - * @var CANFD_T::TXBTO - * Offset: 0xD8 Tx Buffer Transmission Occurred - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TOn |Transmission Occurred - * | | |Each Tx Buffer has its own Transmission Occurred bit - * | | |The bits are set when the corresponding CANFD_TXBRP bit is cleared after a successful transmission - * | | |The bits are reset when a new transmission is requested by writing a 1 to the corresponding bit of register CANFD_TXBAR. - * | | |0 = No transmission occurred. - * | | |1 = Transmission occurred. - * @var CANFD_T::TXBCF - * Offset: 0xDC Tx Buffer Cancellation Finished - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CFn |Cancellation Finished - * | | |Each Tx Buffer has its own Cancellation Finished bit - * | | |The bits are set when the corresponding CANFD_TXBRP bit is cleared after a cancellation was requested via CANFD_TXBCR - * | | |In case the corresponding CANFD_TXBRP bit was not set at the point of cancellation, CF is set immediately - * | | |The bits are reset when a new transmission is requested by writing a 1 to the corresponding bit of register CANFD_TXBAR. - * | | |0 = No transmit buffer cancellation. - * | | |1 = Transmit buffer cancellation finished. - * @var CANFD_T::TXBTIE - * Offset: 0xE0 Tx Buffer Transmission Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TIEn |Transmission Interrupt Enable - * | | |Each Tx Buffer has its own Transmission Interrupt Enable bit. - * | | |0 = Transmission interrupt Disabled. - * | | |1 = Transmission interrupt Enabled. - * @var CANFD_T::TXBCIE - * Offset: 0xE4 Tx Buffer Cancellation Finished Interrupt Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CFIEn |Cancellation Finished Interrupt Enable - * | | |Each Tx Buffer has its own Cancellation Finished Interrupt Enable bit. - * | | |0 = Cancellation finished interrupt Disabled. - * | | |1 = Cancellation finished interrupt Enabled. - * @var CANFD_T::TXEFC - * Offset: 0xF0 Tx Event FIFO Configuration - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:2] |EFSA |Event FIFO Start Address - * | | |Start address of Tx Event FIFO in Message RAM (32-bit word address, refer to Figure 6.33-11). - * |[21:16] |EFS |Event FIFO Size - * | | |0 = Tx Event FIFO Disabled. - * | | |1-32 = Number of Tx Event FIFO elements. - * | | |>32 = Values greater than 32 are interpreted as 32. - * | | |The Tx Event FIFO elements are indexed from 0 to EFS - 1 - * |[29:24] |EFWN |Event FIFO Watermark - * | | |0 = Watermark interrupt Disabled. - * | | |1-32 = Level for Tx Event FIFO watermark interrupt (TEFW (CANFD_IR[13])). - * | | |>32 = Watermark interrupt Disabled. - * @var CANFD_T::TXEFS - * Offset: 0xF4 Tx Event FIFO Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |EFFL |Event FIFO Fill Level - * | | |Number of elements stored in Tx Event FIFO, range 0 to 32 - * |[12:8] |EFG |Event FIFO Get Index - * | | |Tx Event FIFO read index pointer, range 0 to 31 - * |[20:16] |EFP |Event FIFO Put Index - * | | |Tx Event FIFO write index pointer, range 0 to 31 - * |[24] |EFF |Event FIFO Full - * | | |0 = Tx Event FIFO not full. - * | | |1 = Tx Event FIFO full. - * |[25] |TEFL |Tx Event FIFO Element Lost - * | | |This bit is a copy of interrupt flag TEFL (CANFD_IR[15]). When TEFL is reset, this bit is also reset. - * | | |0 = No Tx Event FIFO element lost. - * | | |1 = Tx Event FIFO element lost, also set after write attempt to Tx Event FIFO of size zero. - * @var CANFD_T::TXEFA - * Offset: 0xF8 Tx Event FIFO Acknowledge - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |EFA |Event FIFO Acknowledge Index - * | | |After the Host has read an element or a sequence of elements from the Tx Event FIFO it has to write the index of the last element read from Tx Event FIFO to EFAI - * | | |This will set the Tx Event FIFO Get Index EFGI (CANFD_TXEFS[12:8]) to EFAI + 1 and update the Event FIFO Fill Level EFFL (CANFD_TXEFS[5:0]) - */ - __I uint32_t RESERVE0[3]; - __IO uint32_t DBTP; /*!< [0x000c] Data Bit Timing & Prescaler Register */ - __IO uint32_t TEST; /*!< [0x0010] Test Register */ - __IO uint32_t RWD; /*!< [0x0014] RAM Watchdog */ - __IO uint32_t CCCR; /*!< [0x0018] CC Control Register */ - __IO uint32_t NBTP; /*!< [0x001c] Nominal Bit Timing & Prescaler Register */ - __IO uint32_t TSCC; /*!< [0x0020] Timestamp Counter Configuration */ - __IO uint32_t TSCV; /*!< [0x0024] Timestamp Counter Value */ - __IO uint32_t TOCC; /*!< [0x0028] Timeout Counter Configuration */ - __IO uint32_t TOCV; /*!< [0x002c] Timeout Counter Value */ - __I uint32_t RESERVE1[4]; - __IO uint32_t ECR; /*!< [0x0040] Error Counter Register */ - __IO uint32_t PSR; /*!< [0x0044] Protocol Status Register */ - __IO uint32_t TDCR; /*!< [0x0048] Transmitter Delay Compensation Register */ - __I uint32_t RESERVE2[1]; - __IO uint32_t IR; /*!< [0x0050] Interrupt Register */ - __IO uint32_t IE; /*!< [0x0054] Interrupt Enable */ - __IO uint32_t ILS; /*!< [0x0058] Interrupt Line Select */ - __IO uint32_t ILE; /*!< [0x005c] Interrupt Line Enable */ - __I uint32_t RESERVE3[8]; - __IO uint32_t GFC; /*!< [0x0080] Global Filter Configuration */ - __IO uint32_t SIDFC; /*!< [0x0084] Standard ID Filter Configuration */ - __IO uint32_t XIDFC; /*!< [0x0088] Extended ID Filter Configuration */ - __I uint32_t RESERVE4[1]; - __IO uint32_t XIDAM; /*!< [0x0090] Extended ID AND Mask */ - __I uint32_t HPMS; /*!< [0x0094] High Priority Message Status */ - __IO uint32_t NDAT1; /*!< [0x0098] New Data 1 */ - __IO uint32_t NDAT2; /*!< [0x009c] New Data 2 */ - __IO uint32_t RXF0C; /*!< [0x00a0] Rx FIFO 0 Configuration */ - __I uint32_t RXF0S; /*!< [0x00a4] Rx FIFO 0 Status */ - __IO uint32_t RXF0A; /*!< [0x00a8] Rx FIFO 0 Acknowledge */ - __IO uint32_t RXBC; /*!< [0x00ac] Rx Buffer Configuration */ - __IO uint32_t RXF1C; /*!< [0x00b0] Rx FIFO 1 Configuration */ - __I uint32_t RXF1S; /*!< [0x00b4] Rx FIFO 1 Status */ - __IO uint32_t RXF1A; /*!< [0x00b8] Rx FIFO 1 Acknowledge */ - __IO uint32_t RXESC; /*!< [0x00bc] Rx Buffer / FIFO Element Size Configuration */ - __IO uint32_t TXBC; /*!< [0x00c0] Tx Buffer Configuration */ - __I uint32_t TXFQS; /*!< [0x00c4] Tx FIFO/Queue Status */ - __IO uint32_t TXESC; /*!< [0x00c8] Tx Buffer Element Size Configuration */ - __I uint32_t TXBRP; /*!< [0x00cc] Tx Buffer Request Pending */ - __IO uint32_t TXBAR; /*!< [0x00d0] Tx Buffer Add Request */ - __IO uint32_t TXBCR; /*!< [0x00d4] Tx Buffer Cancellation Request */ - __I uint32_t TXBTO; /*!< [0x00d8] Tx Buffer Transmission Occurred */ - __I uint32_t TXBCF; /*!< [0x00dc] Tx Buffer Cancellation Finished */ - __IO uint32_t TXBTIE; /*!< [0x00e0] Tx Buffer Transmission Interrupt Enable */ - __IO uint32_t TXBCIE; /*!< [0x00e4] Tx Buffer Cancellation Finished Interrupt Enable */ - __I uint32_t RESERVE5[2]; - __IO uint32_t TXEFC; /*!< [0x00f0] Tx Event FIFO Configuration */ - __I uint32_t TXEFS; /*!< [0x00f4] Tx Event FIFO Status */ - __IO uint32_t TXEFA; /*!< [0x00f8] Tx Event FIFO Acknowledge */ - -} CANFD_T; - -/** - @addtogroup CANFD_CONST CANFD Bit Field Definition - Constant Definitions for CANFD Controller -@{ */ - -#define CANFD_DBTP_DSJW_Pos (0) /*!< CANFD_T::DBTP: DSJW Position */ -#define CANFD_DBTP_DSJW_Msk (0xful << CANFD_DBTP_DSJW_Pos) /*!< CANFD_T::DBTP: DSJW Mask */ - -#define CANFD_DBTP_DTSEG2_Pos (4) /*!< CANFD_T::DBTP: DTSEG2 Position */ -#define CANFD_DBTP_DTSEG2_Msk (0xful << CANFD_DBTP_DTSEG2_Pos) /*!< CANFD_T::DBTP: DTSEG2 Mask */ - -#define CANFD_DBTP_DTSEG1_Pos (8) /*!< CANFD_T::DBTP: DTSEG1 Position */ -#define CANFD_DBTP_DTSEG1_Msk (0x1ful << CANFD_DBTP_DTSEG1_Pos) /*!< CANFD_T::DBTP: DTSEG1 Mask */ - -#define CANFD_DBTP_DBRP_Pos (16) /*!< CANFD_T::DBTP: DBRP Position */ -#define CANFD_DBTP_DBRP_Msk (0x1ful << CANFD_DBTP_DBRP_Pos) /*!< CANFD_T::DBTP: DBRP Mask */ - -#define CANFD_DBTP_TDC_Pos (23) /*!< CANFD_T::DBTP: TDC Position */ -#define CANFD_DBTP_TDC_Msk (0x1ul << CANFD_DBTP_TDC_Pos) /*!< CANFD_T::DBTP: TDC Mask */ - -#define CANFD_TEST_LBCK_Pos (4) /*!< CANFD_T::TEST: LBCK Position */ -#define CANFD_TEST_LBCK_Msk (0x1ul << CANFD_TEST_LBCK_Pos) /*!< CANFD_T::TEST: LBCK Mask */ - -#define CANFD_TEST_TX_Pos (5) /*!< CANFD_T::TEST: TX Position */ -#define CANFD_TEST_TX_Msk (0x3ul << CANFD_TEST_TX_Pos) /*!< CANFD_T::TEST: TX Mask */ - -#define CANFD_TEST_RX_Pos (7) /*!< CANFD_T::TEST: RX Position */ -#define CANFD_TEST_RX_Msk (0x1ul << CANFD_TEST_RX_Pos) /*!< CANFD_T::TEST: RX Mask */ - -#define CANFD_RWD_WDC_Pos (0) /*!< CANFD_T::RWD: WDC Position */ -#define CANFD_RWD_WDC_Msk (0xfful << CANFD_RWD_WDC_Pos) /*!< CANFD_T::RWD: WDC Mask */ - -#define CANFD_RWD_WDV_Pos (8) /*!< CANFD_T::RWD: WDV Position */ -#define CANFD_RWD_WDV_Msk (0xfful << CANFD_RWD_WDV_Pos) /*!< CANFD_T::RWD: WDV Mask */ - -#define CANFD_CCCR_INIT_Pos (0) /*!< CANFD_T::CCCR: INIT Position */ -#define CANFD_CCCR_INIT_Msk (0x1ul << CANFD_CCCR_INIT_Pos) /*!< CANFD_T::CCCR: INIT Mask */ - -#define CANFD_CCCR_CCE_Pos (1) /*!< CANFD_T::CCCR: CCE Position */ -#define CANFD_CCCR_CCE_Msk (0x1ul << CANFD_CCCR_CCE_Pos) /*!< CANFD_T::CCCR: CCE Mask */ - -#define CANFD_CCCR_ASM_Pos (2) /*!< CANFD_T::CCCR: ASM Position */ -#define CANFD_CCCR_ASM_Msk (0x1ul << CANFD_CCCR_ASM_Pos) /*!< CANFD_T::CCCR: ASM Mask */ - -#define CANFD_CCCR_CSA_Pos (3) /*!< CANFD_T::CCCR: CSA Position */ -#define CANFD_CCCR_CSA_Msk (0x1ul << CANFD_CCCR_CSA_Pos) /*!< CANFD_T::CCCR: CSA Mask */ - -#define CANFD_CCCR_CSR_Pos (4) /*!< CANFD_T::CCCR: CSR Position */ -#define CANFD_CCCR_CSR_Msk (0x1ul << CANFD_CCCR_CSR_Pos) /*!< CANFD_T::CCCR: CSR Mask */ - -#define CANFD_CCCR_MON_Pos (5) /*!< CANFD_T::CCCR: MON Position */ -#define CANFD_CCCR_MON_Msk (0x1ul << CANFD_CCCR_MON_Pos) /*!< CANFD_T::CCCR: MON Mask */ - -#define CANFD_CCCR_DAR_Pos (6) /*!< CANFD_T::CCCR: DAR Position */ -#define CANFD_CCCR_DAR_Msk (0x1ul << CANFD_CCCR_DAR_Pos) /*!< CANFD_T::CCCR: DAR Mask */ - -#define CANFD_CCCR_TEST_Pos (7) /*!< CANFD_T::CCCR: TEST Position */ -#define CANFD_CCCR_TEST_Msk (0x1ul << CANFD_CCCR_TEST_Pos) /*!< CANFD_T::CCCR: TEST Mask */ - -#define CANFD_CCCR_FDOE_Pos (8) /*!< CANFD_T::CCCR: FDOE Position */ -#define CANFD_CCCR_FDOE_Msk (0x1ul << CANFD_CCCR_FDOE_Pos) /*!< CANFD_T::CCCR: FDOE Mask */ - -#define CANFD_CCCR_BRSE_Pos (9) /*!< CANFD_T::CCCR: BRSE Position */ -#define CANFD_CCCR_BRSE_Msk (0x1ul << CANFD_CCCR_BRSE_Pos) /*!< CANFD_T::CCCR: BRSE Mask */ - -#define CANFD_CCCR_PXHD_Pos (12) /*!< CANFD_T::CCCR: PXHD Position */ -#define CANFD_CCCR_PXHD_Msk (0x1ul << CANFD_CCCR_PXHD_Pos) /*!< CANFD_T::CCCR: PXHD Mask */ - -#define CANFD_CCCR_EFBI_Pos (13) /*!< CANFD_T::CCCR: EFBI Position */ -#define CANFD_CCCR_EFBI_Msk (0x1ul << CANFD_CCCR_EFBI_Pos) /*!< CANFD_T::CCCR: EFBI Mask */ - -#define CANFD_CCCR_TXP_Pos (14) /*!< CANFD_T::CCCR: TXP Position */ -#define CANFD_CCCR_TXP_Msk (0x1ul << CANFD_CCCR_TXP_Pos) /*!< CANFD_T::CCCR: TXP Mask */ - -#define CANFD_CCCR_NISO_Pos (15) /*!< CANFD_T::CCCR: NISO Position */ -#define CANFD_CCCR_NISO_Msk (0x1ul << CANFD_CCCR_NISO_Pos) /*!< CANFD_T::CCCR: NISO Mask */ - -#define CANFD_NBTP_NTSEG2_Pos (0) /*!< CANFD_T::NBTP: NTSEG2 Position */ -#define CANFD_NBTP_NTSEG2_Msk (0x7ful << CANFD_NBTP_NTSEG2_Pos) /*!< CANFD_T::NBTP: NTSEG2 Mask */ - -#define CANFD_NBTP_NTSEG1_Pos (8) /*!< CANFD_T::NBTP: NTSEG1 Position */ -#define CANFD_NBTP_NTSEG1_Msk (0xfful << CANFD_NBTP_NTSEG1_Pos) /*!< CANFD_T::NBTP: NTSEG1 Mask */ - -#define CANFD_NBTP_NBRP_Pos (16) /*!< CANFD_T::NBTP: NBRP Position */ -#define CANFD_NBTP_NBRP_Msk (0x1fful << CANFD_NBTP_NBRP_Pos) /*!< CANFD_T::NBTP: NBRP Mask */ - -#define CANFD_NBTP_NSJW_Pos (25) /*!< CANFD_T::NBTP: NSJW Position */ -#define CANFD_NBTP_NSJW_Msk (0x7ful << CANFD_NBTP_NSJW_Pos) /*!< CANFD_T::NBTP: NSJW Mask */ - -#define CANFD_TSCC_TSS_Pos (0) /*!< CANFD_T::TSCC: TSS Position */ -#define CANFD_TSCC_TSS_Msk (0x3ul << CANFD_TSCC_TSS_Pos) /*!< CANFD_T::TSCC: TSS Mask */ - -#define CANFD_TSCC_TCP_Pos (16) /*!< CANFD_T::TSCC: TCP Position */ -#define CANFD_TSCC_TCP_Msk (0xful << CANFD_TSCC_TCP_Pos) /*!< CANFD_T::TSCC: TCP Mask */ - -#define CANFD_TSCV_TSC_Pos (0) /*!< CANFD_T::TSCV: TSC Position */ -#define CANFD_TSCV_TSC_Msk (0xfffful << CANFD_TSCV_TSC_Pos) /*!< CANFD_T::TSCV: TSC Mask */ - -#define CANFD_TOCC_ETOC_Pos (0) /*!< CANFD_T::TOCC: ETOC Position */ -#define CANFD_TOCC_ETOC_Msk (0x1ul << CANFD_TOCC_ETOC_Pos) /*!< CANFD_T::TOCC: ETOC Mask */ - -#define CANFD_TOCC_TOS_Pos (1) /*!< CANFD_T::TOCC: TOS Position */ -#define CANFD_TOCC_TOS_Msk (0x3ul << CANFD_TOCC_TOS_Pos) /*!< CANFD_T::TOCC: TOS Mask */ - -#define CANFD_TOCC_TOP_Pos (16) /*!< CANFD_T::TOCC: TOP Position */ -#define CANFD_TOCC_TOP_Msk (0xfffful << CANFD_TOCC_TOP_Pos) /*!< CANFD_T::TOCC: TOP Mask */ - -#define CANFD_TOCV_TOC_Pos (0) /*!< CANFD_T::TOCV: TOC Position */ -#define CANFD_TOCV_TOC_Msk (0xfffful << CANFD_TOCV_TOC_Pos) /*!< CANFD_T::TOCV: TOC Mask */ - -#define CANFD_ECR_TEC_Pos (0) /*!< CANFD_T::ECR: TEC Position */ -#define CANFD_ECR_TEC_Msk (0xfful << CANFD_ECR_TEC_Pos) /*!< CANFD_T::ECR: TEC Mask */ - -#define CANFD_ECR_REC_Pos (8) /*!< CANFD_T::ECR: REC Position */ -#define CANFD_ECR_REC_Msk (0x7ful << CANFD_ECR_REC_Pos) /*!< CANFD_T::ECR: REC Mask */ - -#define CANFD_ECR_RP_Pos (15) /*!< CANFD_T::ECR: RP Position */ -#define CANFD_ECR_RP_Msk (0x1ul << CANFD_ECR_RP_Pos) /*!< CANFD_T::ECR: RP Mask */ - -#define CANFD_ECR_CEL_Pos (16) /*!< CANFD_T::ECR: CEL Position */ -#define CANFD_ECR_CEL_Msk (0xfful << CANFD_ECR_CEL_Pos) /*!< CANFD_T::ECR: CEL Mask */ - -#define CANFD_PSR_LEC_Pos (0) /*!< CANFD_T::PSR: LEC Position */ -#define CANFD_PSR_LEC_Msk (0x7ul << CANFD_PSR_LEC_Pos) /*!< CANFD_T::PSR: LEC Mask */ - -#define CANFD_PSR_ACT_Pos (3) /*!< CANFD_T::PSR: ACT Position */ -#define CANFD_PSR_ACT_Msk (0x3ul << CANFD_PSR_ACT_Pos) /*!< CANFD_T::PSR: ACT Mask */ - -#define CANFD_PSR_EP_Pos (5) /*!< CANFD_T::PSR: EP Position */ -#define CANFD_PSR_EP_Msk (0x1ul << CANFD_PSR_EP_Pos) /*!< CANFD_T::PSR: EP Mask */ - -#define CANFD_PSR_EW_Pos (6) /*!< CANFD_T::PSR: EW Position */ -#define CANFD_PSR_EW_Msk (0x1ul << CANFD_PSR_EW_Pos) /*!< CANFD_T::PSR: EW Mask */ - -#define CANFD_PSR_BO_Pos (7) /*!< CANFD_T::PSR: BO Position */ -#define CANFD_PSR_BO_Msk (0x1ul << CANFD_PSR_BO_Pos) /*!< CANFD_T::PSR: BO Mask */ - -#define CANFD_PSR_DLEC_Pos (8) /*!< CANFD_T::PSR: DLEC Position */ -#define CANFD_PSR_DLEC_Msk (0x7ul << CANFD_PSR_DLEC_Pos) /*!< CANFD_T::PSR: DLEC Mask */ - -#define CANFD_PSR_RESI_Pos (11) /*!< CANFD_T::PSR: RESI Position */ -#define CANFD_PSR_RESI_Msk (0x1ul << CANFD_PSR_RESI_Pos) /*!< CANFD_T::PSR: RESI Mask */ - -#define CANFD_PSR_RBRS_Pos (12) /*!< CANFD_T::PSR: RBRS Position */ -#define CANFD_PSR_RBRS_Msk (0x1ul << CANFD_PSR_RBRS_Pos) /*!< CANFD_T::PSR: RBRS Mask */ - -#define CANFD_PSR_RFDF_Pos (13) /*!< CANFD_T::PSR: RFDF Position */ -#define CANFD_PSR_RFDF_Msk (0x1ul << CANFD_PSR_RFDF_Pos) /*!< CANFD_T::PSR: RFDF Mask */ - -#define CANFD_PSR_PXE_Pos (14) /*!< CANFD_T::PSR: PXE Position */ -#define CANFD_PSR_PXE_Msk (0x1ul << CANFD_PSR_PXE_Pos) /*!< CANFD_T::PSR: PXE Mask */ - -#define CANFD_PSR_TDCV_Pos (16) /*!< CANFD_T::PSR: TDCV Position */ -#define CANFD_PSR_TDCV_Msk (0x7ful << CANFD_PSR_TDCV_Pos) /*!< CANFD_T::PSR: TDCV Mask */ - -#define CANFD_TDCR_TDCF_Pos (0) /*!< CANFD_T::TDCR: TDCF Position */ -#define CANFD_TDCR_TDCF_Msk (0x7ful << CANFD_TDCR_TDCF_Pos) /*!< CANFD_T::TDCR: TDCF Mask */ - -#define CANFD_TDCR_TDCO_Pos (8) /*!< CANFD_T::TDCR: TDCO Position */ -#define CANFD_TDCR_TDCO_Msk (0x7ful << CANFD_TDCR_TDCO_Pos) /*!< CANFD_T::TDCR: TDCO Mask */ - -#define CANFD_IR_RF0N_Pos (0) /*!< CANFD_T::IR: RF0N Position */ -#define CANFD_IR_RF0N_Msk (0x1ul << CANFD_IR_RF0N_Pos) /*!< CANFD_T::IR: RF0N Mask */ - -#define CANFD_IR_RF0W_Pos (1) /*!< CANFD_T::IR: RF0W Position */ -#define CANFD_IR_RF0W_Msk (0x1ul << CANFD_IR_RF0W_Pos) /*!< CANFD_T::IR: RF0W Mask */ - -#define CANFD_IR_RF0F_Pos (2) /*!< CANFD_T::IR: RF0F Position */ -#define CANFD_IR_RF0F_Msk (0x1ul << CANFD_IR_RF0F_Pos) /*!< CANFD_T::IR: RF0F Mask */ - -#define CANFD_IR_RF0L_Pos (3) /*!< CANFD_T::IR: RF0L Position */ -#define CANFD_IR_RF0L_Msk (0x1ul << CANFD_IR_RF0L_Pos) /*!< CANFD_T::IR: RF0L Mask */ - -#define CANFD_IR_RF1N_Pos (4) /*!< CANFD_T::IR: RF1N Position */ -#define CANFD_IR_RF1N_Msk (0x1ul << CANFD_IR_RF1N_Pos) /*!< CANFD_T::IR: RF1N Mask */ - -#define CANFD_IR_RF1W_Pos (5) /*!< CANFD_T::IR: RF1W Position */ -#define CANFD_IR_RF1W_Msk (0x1ul << CANFD_IR_RF1W_Pos) /*!< CANFD_T::IR: RF1W Mask */ - -#define CANFD_IR_RF1F_Pos (6) /*!< CANFD_T::IR: RF1F Position */ -#define CANFD_IR_RF1F_Msk (0x1ul << CANFD_IR_RF1F_Pos) /*!< CANFD_T::IR: RF1F Mask */ - -#define CANFD_IR_RF1L_Pos (7) /*!< CANFD_T::IR: RF1L Position */ -#define CANFD_IR_RF1L_Msk (0x1ul << CANFD_IR_RF1L_Pos) /*!< CANFD_T::IR: RF1L Mask */ - -#define CANFD_IR_HPM_Pos (8) /*!< CANFD_T::IR: HPM Position */ -#define CANFD_IR_HPM_Msk (0x1ul << CANFD_IR_HPM_Pos) /*!< CANFD_T::IR: HPM Mask */ - -#define CANFD_IR_TC_Pos (9) /*!< CANFD_T::IR: TC Position */ -#define CANFD_IR_TC_Msk (0x1ul << CANFD_IR_TC_Pos) /*!< CANFD_T::IR: TC Mask */ - -#define CANFD_IR_TCF_Pos (10) /*!< CANFD_T::IR: TCF Position */ -#define CANFD_IR_TCF_Msk (0x1ul << CANFD_IR_TCF_Pos) /*!< CANFD_T::IR: TCF Mask */ - -#define CANFD_IR_TFE_Pos (11) /*!< CANFD_T::IR: TFE Position */ -#define CANFD_IR_TFE_Msk (0x1ul << CANFD_IR_TFE_Pos) /*!< CANFD_T::IR: TFE Mask */ - -#define CANFD_IR_TEFN_Pos (12) /*!< CANFD_T::IR: TEFN Position */ -#define CANFD_IR_TEFN_Msk (0x1ul << CANFD_IR_TEFN_Pos) /*!< CANFD_T::IR: TEFN Mask */ - -#define CANFD_IR_TEFW_Pos (13) /*!< CANFD_T::IR: TEFW Position */ -#define CANFD_IR_TEFW_Msk (0x1ul << CANFD_IR_TEFW_Pos) /*!< CANFD_T::IR: TEFW Mask */ - -#define CANFD_IR_TEFF_Pos (14) /*!< CANFD_T::IR: TEFF Position */ -#define CANFD_IR_TEFF_Msk (0x1ul << CANFD_IR_TEFF_Pos) /*!< CANFD_T::IR: TEFF Mask */ - -#define CANFD_IR_TEFL_Pos (15) /*!< CANFD_T::IR: TEFL Position */ -#define CANFD_IR_TEFL_Msk (0x1ul << CANFD_IR_TEFL_Pos) /*!< CANFD_T::IR: TEFL Mask */ - -#define CANFD_IR_TSW_Pos (16) /*!< CANFD_T::IR: TSW Position */ -#define CANFD_IR_TSW_Msk (0x1ul << CANFD_IR_TSW_Pos) /*!< CANFD_T::IR: TSW Mask */ - -#define CANFD_IR_MRAF_Pos (17) /*!< CANFD_T::IR: MRAF Position */ -#define CANFD_IR_MRAF_Msk (0x1ul << CANFD_IR_MRAF_Pos) /*!< CANFD_T::IR: MRAF Mask */ - -#define CANFD_IR_TOO_Pos (18) /*!< CANFD_T::IR: TOO Position */ -#define CANFD_IR_TOO_Msk (0x1ul << CANFD_IR_TOO_Pos) /*!< CANFD_T::IR: TOO Mask */ - -#define CANFD_IR_DRX_Pos (19) /*!< CANFD_T::IR: DRX Position */ -#define CANFD_IR_DRX_Msk (0x1ul << CANFD_IR_DRX_Pos) /*!< CANFD_T::IR: DRX Mask */ - -#define CANFD_IR_ELO_Pos (22) /*!< CANFD_T::IR: ELO Position */ -#define CANFD_IR_ELO_Msk (0x1ul << CANFD_IR_ELO_Pos) /*!< CANFD_T::IR: ELO Mask */ - -#define CANFD_IR_EP_Pos (23) /*!< CANFD_T::IR: EP Position */ -#define CANFD_IR_EP_Msk (0x1ul << CANFD_IR_EP_Pos) /*!< CANFD_T::IR: EP Mask */ - -#define CANFD_IR_EW_Pos (24) /*!< CANFD_T::IR: EW Position */ -#define CANFD_IR_EW_Msk (0x1ul << CANFD_IR_EW_Pos) /*!< CANFD_T::IR: EW Mask */ - -#define CANFD_IR_BO_Pos (25) /*!< CANFD_T::IR: BO Position */ -#define CANFD_IR_BO_Msk (0x1ul << CANFD_IR_BO_Pos) /*!< CANFD_T::IR: BO Mask */ - -#define CANFD_IR_WDI_Pos (26) /*!< CANFD_T::IR: WDI Position */ -#define CANFD_IR_WDI_Msk (0x1ul << CANFD_IR_WDI_Pos) /*!< CANFD_T::IR: WDI Mask */ - -#define CANFD_IR_PEA_Pos (27) /*!< CANFD_T::IR: PEA Position */ -#define CANFD_IR_PEA_Msk (0x1ul << CANFD_IR_PEA_Pos) /*!< CANFD_T::IR: PEA Mask */ - -#define CANFD_IR_PED_Pos (28) /*!< CANFD_T::IR: PED Position */ -#define CANFD_IR_PED_Msk (0x1ul << CANFD_IR_PED_Pos) /*!< CANFD_T::IR: PED Mask */ - -#define CANFD_IR_ARA_Pos (29) /*!< CANFD_T::IR: ARA Position */ -#define CANFD_IR_ARA_Msk (0x1ul << CANFD_IR_ARA_Pos) /*!< CANFD_T::IR: ARA Mask */ - -#define CANFD_IE_RF0NE_Pos (0) /*!< CANFD_T::IE: RF0NE Position */ -#define CANFD_IE_RF0NE_Msk (0x1ul << CANFD_IE_RF0NE_Pos) /*!< CANFD_T::IE: RF0NE Mask */ - -#define CANFD_IE_RF0WE_Pos (1) /*!< CANFD_T::IE: RF0WE Position */ -#define CANFD_IE_RF0WE_Msk (0x1ul << CANFD_IE_RF0WE_Pos) /*!< CANFD_T::IE: RF0WE Mask */ - -#define CANFD_IE_RF0FE_Pos (2) /*!< CANFD_T::IE: RF0FE Position */ -#define CANFD_IE_RF0FE_Msk (0x1ul << CANFD_IE_RF0FE_Pos) /*!< CANFD_T::IE: RF0FE Mask */ - -#define CANFD_IE_RF0LE_Pos (3) /*!< CANFD_T::IE: RF0LE Position */ -#define CANFD_IE_RF0LE_Msk (0x1ul << CANFD_IE_RF0LE_Pos) /*!< CANFD_T::IE: RF0LE Mask */ - -#define CANFD_IE_RF1NE_Pos (4) /*!< CANFD_T::IE: RF1NE Position */ -#define CANFD_IE_RF1NE_Msk (0x1ul << CANFD_IE_RF1NE_Pos) /*!< CANFD_T::IE: RF1NE Mask */ - -#define CANFD_IE_RF1WE_Pos (5) /*!< CANFD_T::IE: RF1WE Position */ -#define CANFD_IE_RF1WE_Msk (0x1ul << CANFD_IE_RF1WE_Pos) /*!< CANFD_T::IE: RF1WE Mask */ - -#define CANFD_IE_RF1FE_Pos (6) /*!< CANFD_T::IE: RF1FE Position */ -#define CANFD_IE_RF1FE_Msk (0x1ul << CANFD_IE_RF1FE_Pos) /*!< CANFD_T::IE: RF1FE Mask */ - -#define CANFD_IE_RF1LE_Pos (7) /*!< CANFD_T::IE: RF1LE Position */ -#define CANFD_IE_RF1LE_Msk (0x1ul << CANFD_IE_RF1LE_Pos) /*!< CANFD_T::IE: RF1LE Mask */ - -#define CANFD_IE_HPME_Pos (8) /*!< CANFD_T::IE: HPME Position */ -#define CANFD_IE_HPME_Msk (0x1ul << CANFD_IE_HPME_Pos) /*!< CANFD_T::IE: HPME Mask */ - -#define CANFD_IE_TCE_Pos (9) /*!< CANFD_T::IE: TCE Position */ -#define CANFD_IE_TCE_Msk (0x1ul << CANFD_IE_TCE_Pos) /*!< CANFD_T::IE: TCE Mask */ - -#define CANFD_IE_TCFE_Pos (10) /*!< CANFD_T::IE: TCFE Position */ -#define CANFD_IE_TCFE_Msk (0x1ul << CANFD_IE_TCFE_Pos) /*!< CANFD_T::IE: TCFE Mask */ - -#define CANFD_IE_TFEE_Pos (11) /*!< CANFD_T::IE: TFEE Position */ -#define CANFD_IE_TFEE_Msk (0x1ul << CANFD_IE_TFEE_Pos) /*!< CANFD_T::IE: TFEE Mask */ - -#define CANFD_IE_TEFNE_Pos (12) /*!< CANFD_T::IE: TEFNE Position */ -#define CANFD_IE_TEFNE_Msk (0x1ul << CANFD_IE_TEFNE_Pos) /*!< CANFD_T::IE: TEFNE Mask */ - -#define CANFD_IE_TEFWE_Pos (13) /*!< CANFD_T::IE: TEFWE Position */ -#define CANFD_IE_TEFWE_Msk (0x1ul << CANFD_IE_TEFWE_Pos) /*!< CANFD_T::IE: TEFWE Mask */ - -#define CANFD_IE_TEFFE_Pos (14) /*!< CANFD_T::IE: TEFFE Position */ -#define CANFD_IE_TEFFE_Msk (0x1ul << CANFD_IE_TEFFE_Pos) /*!< CANFD_T::IE: TEFFE Mask */ - -#define CANFD_IE_TEFLE_Pos (15) /*!< CANFD_T::IE: TEFLE Position */ -#define CANFD_IE_TEFLE_Msk (0x1ul << CANFD_IE_TEFLE_Pos) /*!< CANFD_T::IE: TEFLE Mask */ - -#define CANFD_IE_TSWE_Pos (16) /*!< CANFD_T::IE: TSWE Position */ -#define CANFD_IE_TSWE_Msk (0x1ul << CANFD_IE_TSWE_Pos) /*!< CANFD_T::IE: TSWE Mask */ - -#define CANFD_IE_MRAFE_Pos (17) /*!< CANFD_T::IE: MRAFE Position */ -#define CANFD_IE_MRAFE_Msk (0x1ul << CANFD_IE_MRAFE_Pos) /*!< CANFD_T::IE: MRAFE Mask */ - -#define CANFD_IE_TOOE_Pos (18) /*!< CANFD_T::IE: TOOE Position */ -#define CANFD_IE_TOOE_Msk (0x1ul << CANFD_IE_TOOE_Pos) /*!< CANFD_T::IE: TOOE Mask */ - -#define CANFD_IE_DRXE_Pos (19) /*!< CANFD_T::IE: DRXE Position */ -#define CANFD_IE_DRXE_Msk (0x1ul << CANFD_IE_DRXE_Pos) /*!< CANFD_T::IE: DRXE Mask */ - -#define CANFD_IE_BECE_Pos (20) /*!< CANFD_T::IE: BECE Position */ -#define CANFD_IE_BECE_Msk (0x1ul << CANFD_IE_BECE_Pos) /*!< CANFD_T::IE: BECE Mask */ - -#define CANFD_IE_BEUE_Pos (21) /*!< CANFD_T::IE: BEUE Position */ -#define CANFD_IE_BEUE_Msk (0x1ul << CANFD_IE_BEUE_Pos) /*!< CANFD_T::IE: BEUE Mask */ - -#define CANFD_IE_ELOE_Pos (22) /*!< CANFD_T::IE: ELOE Position */ -#define CANFD_IE_ELOE_Msk (0x1ul << CANFD_IE_ELOE_Pos) /*!< CANFD_T::IE: ELOE Mask */ - -#define CANFD_IE_EPE_Pos (23) /*!< CANFD_T::IE: EPE Position */ -#define CANFD_IE_EPE_Msk (0x1ul << CANFD_IE_EPE_Pos) /*!< CANFD_T::IE: EPE Mask */ - -#define CANFD_IE_EWE_Pos (24) /*!< CANFD_T::IE: EWE Position */ -#define CANFD_IE_EWE_Msk (0x1ul << CANFD_IE_EWE_Pos) /*!< CANFD_T::IE: EWE Mask */ - -#define CANFD_IE_BOE_Pos (25) /*!< CANFD_T::IE: BOE Position */ -#define CANFD_IE_BOE_Msk (0x1ul << CANFD_IE_BOE_Pos) /*!< CANFD_T::IE: BOE Mask */ - -#define CANFD_IE_WDIE_Pos (26) /*!< CANFD_T::IE: WDIE Position */ -#define CANFD_IE_WDIE_Msk (0x1ul << CANFD_IE_WDIE_Pos) /*!< CANFD_T::IE: WDIE Mask */ - -#define CANFD_IE_PEAE_Pos (27) /*!< CANFD_T::IE: PEAE Position */ -#define CANFD_IE_PEAE_Msk (0x1ul << CANFD_IE_PEAE_Pos) /*!< CANFD_T::IE: PEAE Mask */ - -#define CANFD_IE_PEDE_Pos (28) /*!< CANFD_T::IE: PEDE Position */ -#define CANFD_IE_PEDE_Msk (0x1ul << CANFD_IE_PEDE_Pos) /*!< CANFD_T::IE: PEDE Mask */ - -#define CANFD_IE_ARAE_Pos (29) /*!< CANFD_T::IE: ARAE Position */ -#define CANFD_IE_ARAE_Msk (0x1ul << CANFD_IE_ARAE_Pos) /*!< CANFD_T::IE: ARAE Mask */ - -#define CANFD_ILS_RF0NL_Pos (0) /*!< CANFD_T::ILS: RF0NL Position */ -#define CANFD_ILS_RF0NL_Msk (0x1ul << CANFD_ILS_RF0NL_Pos) /*!< CANFD_T::ILS: RF0NL Mask */ - -#define CANFD_ILS_RF0WL_Pos (1) /*!< CANFD_T::ILS: RF0WL Position */ -#define CANFD_ILS_RF0WL_Msk (0x1ul << CANFD_ILS_RF0WL_Pos) /*!< CANFD_T::ILS: RF0WL Mask */ - -#define CANFD_ILS_RF0FL_Pos (2) /*!< CANFD_T::ILS: RF0FL Position */ -#define CANFD_ILS_RF0FL_Msk (0x1ul << CANFD_ILS_RF0FL_Pos) /*!< CANFD_T::ILS: RF0FL Mask */ - -#define CANFD_ILS_RF0LL_Pos (3) /*!< CANFD_T::ILS: RF0LL Position */ -#define CANFD_ILS_RF0LL_Msk (0x1ul << CANFD_ILS_RF0LL_Pos) /*!< CANFD_T::ILS: RF0LL Mask */ - -#define CANFD_ILS_RF1NL_Pos (4) /*!< CANFD_T::ILS: RF1NL Position */ -#define CANFD_ILS_RF1NL_Msk (0x1ul << CANFD_ILS_RF1NL_Pos) /*!< CANFD_T::ILS: RF1NL Mask */ - -#define CANFD_ILS_RF1WL_Pos (5) /*!< CANFD_T::ILS: RF1WL Position */ -#define CANFD_ILS_RF1WL_Msk (0x1ul << CANFD_ILS_RF1WL_Pos) /*!< CANFD_T::ILS: RF1WL Mask */ - -#define CANFD_ILS_RF1FL_Pos (6) /*!< CANFD_T::ILS: RF1FL Position */ -#define CANFD_ILS_RF1FL_Msk (0x1ul << CANFD_ILS_RF1FL_Pos) /*!< CANFD_T::ILS: RF1FL Mask */ - -#define CANFD_ILS_RF1LL_Pos (7) /*!< CANFD_T::ILS: RF1LL Position */ -#define CANFD_ILS_RF1LL_Msk (0x1ul << CANFD_ILS_RF1LL_Pos) /*!< CANFD_T::ILS: RF1LL Mask */ - -#define CANFD_ILS_HPML_Pos (8) /*!< CANFD_T::ILS: HPML Position */ -#define CANFD_ILS_HPML_Msk (0x1ul << CANFD_ILS_HPML_Pos) /*!< CANFD_T::ILS: HPML Mask */ - -#define CANFD_ILS_TCL_Pos (9) /*!< CANFD_T::ILS: TCL Position */ -#define CANFD_ILS_TCL_Msk (0x1ul << CANFD_ILS_TCL_Pos) /*!< CANFD_T::ILS: TCL Mask */ - -#define CANFD_ILS_TCFL_Pos (10) /*!< CANFD_T::ILS: TCFL Position */ -#define CANFD_ILS_TCFL_Msk (0x1ul << CANFD_ILS_TCFL_Pos) /*!< CANFD_T::ILS: TCFL Mask */ - -#define CANFD_ILS_TFEL_Pos (11) /*!< CANFD_T::ILS: TFEL Position */ -#define CANFD_ILS_TFEL_Msk (0x1ul << CANFD_ILS_TFEL_Pos) /*!< CANFD_T::ILS: TFEL Mask */ - -#define CANFD_ILS_TEFNL_Pos (12) /*!< CANFD_T::ILS: TEFNL Position */ -#define CANFD_ILS_TEFNL_Msk (0x1ul << CANFD_ILS_TEFNL_Pos) /*!< CANFD_T::ILS: TEFNL Mask */ - -#define CANFD_ILS_TEFWL_Pos (13) /*!< CANFD_T::ILS: TEFWL Position */ -#define CANFD_ILS_TEFWL_Msk (0x1ul << CANFD_ILS_TEFWL_Pos) /*!< CANFD_T::ILS: TEFWL Mask */ - -#define CANFD_ILS_TEFFL_Pos (14) /*!< CANFD_T::ILS: TEFFL Position */ -#define CANFD_ILS_TEFFL_Msk (0x1ul << CANFD_ILS_TEFFL_Pos) /*!< CANFD_T::ILS: TEFFL Mask */ - -#define CANFD_ILS_TEFLL_Pos (15) /*!< CANFD_T::ILS: TEFLL Position */ -#define CANFD_ILS_TEFLL_Msk (0x1ul << CANFD_ILS_TEFLL_Pos) /*!< CANFD_T::ILS: TEFLL Mask */ - -#define CANFD_ILS_TSWL_Pos (16) /*!< CANFD_T::ILS: TSWL Position */ -#define CANFD_ILS_TSWL_Msk (0x1ul << CANFD_ILS_TSWL_Pos) /*!< CANFD_T::ILS: TSWL Mask */ - -#define CANFD_ILS_MRAFL_Pos (17) /*!< CANFD_T::ILS: MRAFL Position */ -#define CANFD_ILS_MRAFL_Msk (0x1ul << CANFD_ILS_MRAFL_Pos) /*!< CANFD_T::ILS: MRAFL Mask */ - -#define CANFD_ILS_TOOL_Pos (18) /*!< CANFD_T::ILS: TOOL Position */ -#define CANFD_ILS_TOOL_Msk (0x1ul << CANFD_ILS_TOOL_Pos) /*!< CANFD_T::ILS: TOOL Mask */ - -#define CANFD_ILS_DRXL_Pos (19) /*!< CANFD_T::ILS: DRXL Position */ -#define CANFD_ILS_DRXL_Msk (0x1ul << CANFD_ILS_DRXL_Pos) /*!< CANFD_T::ILS: DRXL Mask */ - -#define CANFD_ILS_ELOL_Pos (22) /*!< CANFD_T::ILS: ELOL Position */ -#define CANFD_ILS_ELOL_Msk (0x1ul << CANFD_ILS_ELOL_Pos) /*!< CANFD_T::ILS: ELOL Mask */ - -#define CANFD_ILS_EPL_Pos (23) /*!< CANFD_T::ILS: EPL Position */ -#define CANFD_ILS_EPL_Msk (0x1ul << CANFD_ILS_EPL_Pos) /*!< CANFD_T::ILS: EPL Mask */ - -#define CANFD_ILS_EWL_Pos (24) /*!< CANFD_T::ILS: EWL Position */ -#define CANFD_ILS_EWL_Msk (0x1ul << CANFD_ILS_EWL_Pos) /*!< CANFD_T::ILS: EWL Mask */ - -#define CANFD_ILS_BOL_Pos (25) /*!< CANFD_T::ILS: BOL Position */ -#define CANFD_ILS_BOL_Msk (0x1ul << CANFD_ILS_BOL_Pos) /*!< CANFD_T::ILS: BOL Mask */ - -#define CANFD_ILS_WDIL_Pos (26) /*!< CANFD_T::ILS: WDIL Position */ -#define CANFD_ILS_WDIL_Msk (0x1ul << CANFD_ILS_WDIL_Pos) /*!< CANFD_T::ILS: WDIL Mask */ - -#define CANFD_ILS_PEAL_Pos (27) /*!< CANFD_T::ILS: PEAL Position */ -#define CANFD_ILS_PEAL_Msk (0x1ul << CANFD_ILS_PEAL_Pos) /*!< CANFD_T::ILS: PEAL Mask */ - -#define CANFD_ILS_PEDL_Pos (28) /*!< CANFD_T::ILS: PEDL Position */ -#define CANFD_ILS_PEDL_Msk (0x1ul << CANFD_ILS_PEDL_Pos) /*!< CANFD_T::ILS: PEDL Mask */ - -#define CANFD_ILS_ARAL_Pos (29) /*!< CANFD_T::ILS: ARAL Position */ -#define CANFD_ILS_ARAL_Msk (0x1ul << CANFD_ILS_ARAL_Pos) /*!< CANFD_T::ILS: ARAL Mask */ - -#define CANFD_ILE_ENT0_Pos (0) /*!< CANFD_T::ILE: ENT0 Position */ -#define CANFD_ILE_ENT0_Msk (0x1ul << CANFD_ILE_ENT0_Pos) /*!< CANFD_T::ILE: ENT0 Mask */ - -#define CANFD_ILE_ENT1_Pos (1) /*!< CANFD_T::ILE: ENT1 Position */ -#define CANFD_ILE_ENT1_Msk (0x1ul << CANFD_ILE_ENT1_Pos) /*!< CANFD_T::ILE: ENT1 Mask */ - -#define CANFD_GFC_RRFE_Pos (0) /*!< CANFD_T::GFC: RRFE Position */ -#define CANFD_GFC_RRFE_Msk (0x1ul << CANFD_GFC_RRFE_Pos) /*!< CANFD_T::GFC: RRFE Mask */ - -#define CANFD_GFC_RRFS_Pos (1) /*!< CANFD_T::GFC: RRFS Position */ -#define CANFD_GFC_RRFS_Msk (0x1ul << CANFD_GFC_RRFS_Pos) /*!< CANFD_T::GFC: RRFS Mask */ - -#define CANFD_GFC_ANFE_Pos (2) /*!< CANFD_T::GFC: ANFE Position */ -#define CANFD_GFC_ANFE_Msk (0x3ul << CANFD_GFC_ANFE_Pos) /*!< CANFD_T::GFC: ANFE Mask */ - -#define CANFD_GFC_ANFS_Pos (4) /*!< CANFD_T::GFC: ANFS Position */ -#define CANFD_GFC_ANFS_Msk (0x3ul << CANFD_GFC_ANFS_Pos) /*!< CANFD_T::GFC: ANFS Mask */ - -#define CANFD_SIDFC_FLSSA_Pos (2) /*!< CANFD_T::SIDFC: FLSSA Position */ -#define CANFD_SIDFC_FLSSA_Msk (0x3ffful << CANFD_SIDFC_FLSSA_Pos) /*!< CANFD_T::SIDFC: FLSSA Mask */ - -#define CANFD_SIDFC_LSS_Pos (16) /*!< CANFD_T::SIDFC: LSS Position */ -#define CANFD_SIDFC_LSS_Msk (0xfful << CANFD_SIDFC_LSS_Pos) /*!< CANFD_T::SIDFC: LSS Mask */ - -#define CANFD_XIDFC_FLESA_Pos (2) /*!< CANFD_T::XIDFC: FLESA Position */ -#define CANFD_XIDFC_FLESA_Msk (0x3ffful << CANFD_XIDFC_FLESA_Pos) /*!< CANFD_T::XIDFC: FLESA Mask */ - -#define CANFD_XIDFC_LSE_Pos (16) /*!< CANFD_T::XIDFC: LSE Position */ -#define CANFD_XIDFC_LSE_Msk (0x7ful << CANFD_XIDFC_LSE_Pos) /*!< CANFD_T::XIDFC: LSE Mask */ - -#define CANFD_XIDAM_EIDM_Pos (0) /*!< CANFD_T::XIDAM: EIDM Position */ -#define CANFD_XIDAM_EIDM_Msk (0x1ffffffful << CANFD_XIDAM_EIDM_Pos) /*!< CANFD_T::XIDAM: EIDM Mask */ - -#define CANFD_HPMS_BIDX_Pos (0) /*!< CANFD_T::HPMS: BIDX Position */ -#define CANFD_HPMS_BIDX_Msk (0x3ful << CANFD_HPMS_BIDX_Pos) /*!< CANFD_T::HPMS: BIDX Mask */ - -#define CANFD_HPMS_MSI_Pos (6) /*!< CANFD_T::HPMS: MSI Position */ -#define CANFD_HPMS_MSI_Msk (0x3ul << CANFD_HPMS_MSI_Pos) /*!< CANFD_T::HPMS: MSI Mask */ - -#define CANFD_HPMS_FIDX_Pos (8) /*!< CANFD_T::HPMS: FIDX Position */ -#define CANFD_HPMS_FIDX_Msk (0x7ful << CANFD_HPMS_FIDX_Pos) /*!< CANFD_T::HPMS: FIDX Mask */ - -#define CANFD_HPMS_FLST_Pos (15) /*!< CANFD_T::HPMS: FLST Position */ -#define CANFD_HPMS_FLST_Msk (0x1ul << CANFD_HPMS_FLST_Pos) /*!< CANFD_T::HPMS: FLST Mask */ - -#define CANFD_NDAT1_NDn_Pos (0) /*!< CANFD_T::NDAT1: NDn Position */ -#define CANFD_NDAT1_NDn_Msk (0xfffffffful << CANFD_NDAT1_NDn_Pos) /*!< CANFD_T::NDAT1: NDn Mask */ - -#define CANFD_NDAT2_NDn_Pos (0) /*!< CANFD_T::NDAT2: NDn Position */ -#define CANFD_NDAT2_NDn_Msk (0xfffffffful << CANFD_NDAT2_NDn_Pos) /*!< CANFD_T::NDAT2: NDn Mask */ - -#define CANFD_RXF0C_F0SA_Pos (2) /*!< CANFD_T::RXF0C: F0SA Position */ -#define CANFD_RXF0C_F0SA_Msk (0x3ffful << CANFD_RXF0C_F0SA_Pos) /*!< CANFD_T::RXF0C: F0SA Mask */ - -#define CANFD_RXF0C_F0S_Pos (16) /*!< CANFD_T::RXF0C: F0S Position */ -#define CANFD_RXF0C_F0S_Msk (0x7ful << CANFD_RXF0C_F0S_Pos) /*!< CANFD_T::RXF0C: F0S Mask */ - -#define CANFD_RXF0C_F0WM_Pos (24) /*!< CANFD_T::RXF0C: F0WM Position */ -#define CANFD_RXF0C_F0WM_Msk (0x7ful << CANFD_RXF0C_F0WM_Pos) /*!< CANFD_T::RXF0C: F0WM Mask */ - -#define CANFD_RXF0C_F0OM_Pos (31) /*!< CANFD_T::RXF0C: F0OM Position */ -#define CANFD_RXF0C_F0OM_Msk (0x1ul << CANFD_RXF0C_F0OM_Pos) /*!< CANFD_T::RXF0C: F0OM Mask */ - -#define CANFD_RXF0S_F0FL_Pos (0) /*!< CANFD_T::RXF0S: F0FL Position */ -#define CANFD_RXF0S_F0FL_Msk (0x7ful << CANFD_RXF0S_F0FL_Pos) /*!< CANFD_T::RXF0S: F0FL Mask */ - -#define CANFD_RXF0S_F0GI_Pos (8) /*!< CANFD_T::RXF0S: F0GI Position */ -#define CANFD_RXF0S_F0GI_Msk (0x3ful << CANFD_RXF0S_F0GI_Pos) /*!< CANFD_T::RXF0S: F0GI Mask */ - -#define CANFD_RXF0S_F0PI_Pos (16) /*!< CANFD_T::RXF0S: F0PI Position */ -#define CANFD_RXF0S_F0PI_Msk (0x3ful << CANFD_RXF0S_F0PI_Pos) /*!< CANFD_T::RXF0S: F0PI Mask */ - -#define CANFD_RXF0S_F0F_Pos (24) /*!< CANFD_T::RXF0S: F0F Position */ -#define CANFD_RXF0S_F0F_Msk (0x1ul << CANFD_RXF0S_F0F_Pos) /*!< CANFD_T::RXF0S: F0F Mask */ - -#define CANFD_RXF0S_RF0L_Pos (25) /*!< CANFD_T::RXF0S: RF0L Position */ -#define CANFD_RXF0S_RF0L_Msk (0x1ul << CANFD_RXF0S_RF0L_Pos) /*!< CANFD_T::RXF0S: RF0L Mask */ - -#define CANFD_RXF0A_F0A_Pos (0) /*!< CANFD_T::RXF0A: F0A Position */ -#define CANFD_RXF0A_F0A_Msk (0x3ful << CANFD_RXF0A_F0A_Pos) /*!< CANFD_T::RXF0A: F0A Mask */ - -#define CANFD_RXBC_RBSA_Pos (2) /*!< CANFD_T::RXBC: RBSA Position */ -#define CANFD_RXBC_RBSA_Msk (0x3ffful << CANFD_RXBC_RBSA_Pos) /*!< CANFD_T::RXBC: RBSA Mask */ - -#define CANFD_RXF1C_F1SA_Pos (2) /*!< CANFD_T::RXF1C: F1SA Position */ -#define CANFD_RXF1C_F1SA_Msk (0x3ffful << CANFD_RXF1C_F1SA_Pos) /*!< CANFD_T::RXF1C: F1SA Mask */ - -#define CANFD_RXF1C_F1S_Pos (16) /*!< CANFD_T::RXF1C: F1S Position */ -#define CANFD_RXF1C_F1S_Msk (0x7ful << CANFD_RXF1C_F1S_Pos) /*!< CANFD_T::RXF1C: F1S Mask */ - -#define CANFD_RXF1C_F1WM_Pos (24) /*!< CANFD_T::RXF1C: F1WM Position */ -#define CANFD_RXF1C_F1WM_Msk (0x7ful << CANFD_RXF1C_F1WM_Pos) /*!< CANFD_T::RXF1C: F1WM Mask */ - -#define CANFD_RXF1C_F1OM_Pos (31) /*!< CANFD_T::RXF1C: F1OM Position */ -#define CANFD_RXF1C_F1OM_Msk (0x1ul << CANFD_RXF1C_F1OM_Pos) /*!< CANFD_T::RXF1C: F1OM Mask */ - -#define CANFD_RXF1S_F1FL_Pos (0) /*!< CANFD_T::RXF1S: F1FL Position */ -#define CANFD_RXF1S_F1FL_Msk (0x7ful << CANFD_RXF1S_F1FL_Pos) /*!< CANFD_T::RXF1S: F1FL Mask */ - -#define CANFD_RXF1S_F1G_Pos (8) /*!< CANFD_T::RXF1S: F1G Position */ -#define CANFD_RXF1S_F1G_Msk (0x3ful << CANFD_RXF1S_F1G_Pos) /*!< CANFD_T::RXF1S: F1G Mask */ - -#define CANFD_RXF1S_F1P_Pos (16) /*!< CANFD_T::RXF1S: F1P Position */ -#define CANFD_RXF1S_F1P_Msk (0x3ful << CANFD_RXF1S_F1P_Pos) /*!< CANFD_T::RXF1S: F1P Mask */ - -#define CANFD_RXF1S_F1F_Pos (24) /*!< CANFD_T::RXF1S: F1F Position */ -#define CANFD_RXF1S_F1F_Msk (0x1ul << CANFD_RXF1S_F1F_Pos) /*!< CANFD_T::RXF1S: F1F Mask */ - -#define CANFD_RXF1S_RF1L_Pos (25) /*!< CANFD_T::RXF1S: RF1L Position */ -#define CANFD_RXF1S_RF1L_Msk (0x1ul << CANFD_RXF1S_RF1L_Pos) /*!< CANFD_T::RXF1S: RF1L Mask */ - -#define CANFD_RXF1S_DMS_Pos (30) /*!< CANFD_T::RXF1S: DMS Position */ -#define CANFD_RXF1S_DMS_Msk (0x3ul << CANFD_RXF1S_DMS_Pos) /*!< CANFD_T::RXF1S: DMS Mask */ - -#define CANFD_RXF1A_F1A_Pos (0) /*!< CANFD_T::RXF1A: F1A Position */ -#define CANFD_RXF1A_F1A_Msk (0x3ful << CANFD_RXF1A_F1A_Pos) /*!< CANFD_T::RXF1A: F1A Mask */ - -#define CANFD_RXESC_F0DS_Pos (0) /*!< CANFD_T::RXESC: F0DS Position */ -#define CANFD_RXESC_F0DS_Msk (0x7ul << CANFD_RXESC_F0DS_Pos) /*!< CANFD_T::RXESC: F0DS Mask */ - -#define CANFD_RXESC_F1DS_Pos (4) /*!< CANFD_T::RXESC: F1DS Position */ -#define CANFD_RXESC_F1DS_Msk (0x7ul << CANFD_RXESC_F1DS_Pos) /*!< CANFD_T::RXESC: F1DS Mask */ - -#define CANFD_RXESC_RBDS_Pos (8) /*!< CANFD_T::RXESC: RBDS Position */ -#define CANFD_RXESC_RBDS_Msk (0x7ul << CANFD_RXESC_RBDS_Pos) /*!< CANFD_T::RXESC: RBDS Mask */ - -#define CANFD_TXBC_TBSA_Pos (2) /*!< CANFD_T::TXBC: TBSA Position */ -#define CANFD_TXBC_TBSA_Msk (0x3ffful << CANFD_TXBC_TBSA_Pos) /*!< CANFD_T::TXBC: TBSA Mask */ - -#define CANFD_TXBC_NDTB_Pos (16) /*!< CANFD_T::TXBC: NDTB Position */ -#define CANFD_TXBC_NDTB_Msk (0x3ful << CANFD_TXBC_NDTB_Pos) /*!< CANFD_T::TXBC: NDTB Mask */ - -#define CANFD_TXBC_TFQS_Pos (24) /*!< CANFD_T::TXBC: TFQS Position */ -#define CANFD_TXBC_TFQS_Msk (0x3ful << CANFD_TXBC_TFQS_Pos) /*!< CANFD_T::TXBC: TFQS Mask */ - -#define CANFD_TXBC_TFQM_Pos (30) /*!< CANFD_T::TXBC: TFQM Position */ -#define CANFD_TXBC_TFQM_Msk (0x1ul << CANFD_TXBC_TFQM_Pos) /*!< CANFD_T::TXBC: TFQM Mask */ - -#define CANFD_TXFQS_TFFL_Pos (0) /*!< CANFD_T::TXFQS: TFFL Position */ -#define CANFD_TXFQS_TFFL_Msk (0x3ful << CANFD_TXFQS_TFFL_Pos) /*!< CANFD_T::TXFQS: TFFL Mask */ - -#define CANFD_TXFQS_TFG_Pos (8) /*!< CANFD_T::TXFQS: TFG Position */ -#define CANFD_TXFQS_TFG_Msk (0x1ful << CANFD_TXFQS_TFG_Pos) /*!< CANFD_T::TXFQS: TFG Mask */ - -#define CANFD_TXFQS_TFQP_Pos (16) /*!< CANFD_T::TXFQS: TFQP Position */ -#define CANFD_TXFQS_TFQP_Msk (0x1ful << CANFD_TXFQS_TFQP_Pos) /*!< CANFD_T::TXFQS: TFQP Mask */ - -#define CANFD_TXFQS_TFQF_Pos (21) /*!< CANFD_T::TXFQS: TFQF Position */ -#define CANFD_TXFQS_TFQF_Msk (0x1ul << CANFD_TXFQS_TFQF_Pos) /*!< CANFD_T::TXFQS: TFQF Mask */ - -#define CANFD_TXESC_TBDS_Pos (0) /*!< CANFD_T::TXESC: TBDS Position */ -#define CANFD_TXESC_TBDS_Msk (0x7ul << CANFD_TXESC_TBDS_Pos) /*!< CANFD_T::TXESC: TBDS Mask */ - -#define CANFD_TXBRP_TRPn_Pos (0) /*!< CANFD_T::TXBRP: TRPn Position */ -#define CANFD_TXBRP_TRPn_Msk (0xfffffffful << CANFD_TXBRP_TRPn_Pos) /*!< CANFD_T::TXBRP: TRPn Mask */ - -#define CANFD_TXBAR_ARn_Pos (0) /*!< CANFD_T::TXBAR: ARn Position */ -#define CANFD_TXBAR_ARn_Msk (0xfffffffful << CANFD_TXBAR_ARn_Pos) /*!< CANFD_T::TXBAR: ARn Mask */ - -#define CANFD_TXBCR_CRn_Pos (0) /*!< CANFD_T::TXBCR: CRn Position */ -#define CANFD_TXBCR_CRn_Msk (0xfffffffful << CANFD_TXBCR_CRn_Pos) /*!< CANFD_T::TXBCR: CRn Mask */ - -#define CANFD_TXBTO_TOn_Pos (0) /*!< CANFD_T::TXBTO: TOn Position */ -#define CANFD_TXBTO_TOn_Msk (0xfffffffful << CANFD_TXBTO_TOn_Pos) /*!< CANFD_T::TXBTO: TOn Mask */ - -#define CANFD_TXBCF_CFn_Pos (0) /*!< CANFD_T::TXBCF: CFn Position */ -#define CANFD_TXBCF_CFn_Msk (0xfffffffful << CANFD_TXBCF_CFn_Pos) /*!< CANFD_T::TXBCF: CFn Mask */ - -#define CANFD_TXBTIE_TIEn_Pos (0) /*!< CANFD_T::TXBTIE: TIEn Position */ -#define CANFD_TXBTIE_TIEn_Msk (0xfffffffful << CANFD_TXBTIE_TIEn_Pos) /*!< CANFD_T::TXBTIE: TIEn Mask */ - -#define CANFD_TXBCIE_CFIEn_Pos (0) /*!< CANFD_T::TXBCIE: CFIEn Position */ -#define CANFD_TXBCIE_CFIEn_Msk (0xfffffffful << CANFD_TXBCIE_CFIEn_Pos) /*!< CANFD_T::TXBCIE: CFIEn Mask */ - -#define CANFD_TXEFC_EFSA_Pos (2) /*!< CANFD_T::TXEFC: EFSA Position */ -#define CANFD_TXEFC_EFSA_Msk (0x3ffful << CANFD_TXEFC_EFSA_Pos) /*!< CANFD_T::TXEFC: EFSA Mask */ - -#define CANFD_TXEFC_EFS_Pos (16) /*!< CANFD_T::TXEFC: EFS Position */ -#define CANFD_TXEFC_EFS_Msk (0x3ful << CANFD_TXEFC_EFS_Pos) /*!< CANFD_T::TXEFC: EFS Mask */ - -#define CANFD_TXEFC_EFWN_Pos (24) /*!< CANFD_T::TXEFC: EFWN Position */ -#define CANFD_TXEFC_EFWN_Msk (0x3ful << CANFD_TXEFC_EFWN_Pos) /*!< CANFD_T::TXEFC: EFWN Mask */ - -#define CANFD_TXEFS_EFFL_Pos (0) /*!< CANFD_T::TXEFS: EFFL Position */ -#define CANFD_TXEFS_EFFL_Msk (0x3ful << CANFD_TXEFS_EFFL_Pos) /*!< CANFD_T::TXEFS: EFFL Mask */ - -#define CANFD_TXEFS_EFG_Pos (8) /*!< CANFD_T::TXEFS: EFG Position */ -#define CANFD_TXEFS_EFG_Msk (0x1ful << CANFD_TXEFS_EFG_Pos) /*!< CANFD_T::TXEFS: EFG Mask */ - -#define CANFD_TXEFS_EFP_Pos (16) /*!< CANFD_T::TXEFS: EFP Position */ -#define CANFD_TXEFS_EFP_Msk (0x1ful << CANFD_TXEFS_EFP_Pos) /*!< CANFD_T::TXEFS: EFP Mask */ - -#define CANFD_TXEFS_EFF_Pos (24) /*!< CANFD_T::TXEFS: EFF Position */ -#define CANFD_TXEFS_EFF_Msk (0x1ul << CANFD_TXEFS_EFF_Pos) /*!< CANFD_T::TXEFS: EFF Mask */ - -#define CANFD_TXEFS_TEFL_Pos (25) /*!< CANFD_T::TXEFS: TEFL Position */ -#define CANFD_TXEFS_TEFL_Msk (0x1ul << CANFD_TXEFS_TEFL_Pos) /*!< CANFD_T::TXEFS: TEFL Mask */ - -#define CANFD_TXEFA_EFA_Pos (0) /*!< CANFD_T::TXEFA: EFA Position */ -#define CANFD_TXEFA_EFA_Msk (0x1ful << CANFD_TXEFA_EFA_Pos) /*!< CANFD_T::TXEFA: EFA Mask */ - -/**@}*/ /* CANFD_CONST */ -/**@}*/ /* end of CANFD register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CANFD_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ccap_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ccap_reg.h deleted file mode 100644 index fc81bad9405..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ccap_reg.h +++ /dev/null @@ -1,453 +0,0 @@ -/**************************************************************************//** - * @file ccap_reg.h - * @version V3.00 - * @brief CCAP register definition header file - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CCAP_REG_H__ -#define __CCAP_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup CCAP Camera Capture Interface Controller (CCAP) - Memory Mapped Structure for CCAP Controller -@{ */ - - -typedef struct -{ - - - /** - * @var CCAP_T::CTL - * Offset: 0x00 Camera Capture Interface Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCAPEN |Camera Capture Interface Enable Bit - * | | |0 = Camera Capture Interface Disabled. - * | | |1 = Camera Capture Interface Enabled. - * |[6] |PKTEN |Packet Output Enable Bit - * | | |0 = Packet output Disabled. - * | | |1 = Packet output Enabled. - * |[7] |MONO |Monochrome CMOS Sensor Select - * | | |0 = Color CMOS Sensor. - * | | |1 = Monochrome CMOS Sensor. The U/V components are ignored when the MONO is enabled. - * |[16] |SHUTTER |Camera Capture Interface Automatically Disable the Capture Interface After a Frame Had Been Captured - * | | |0 = Shutter Disabled. - * | | |1 = Shutter Enabled. - * |[17] |MY4_SWAP |Monochrome CMOS Sensor 4-bit Data Nibble Swap - * | | |0 = The 4-bit data input sequence: 1st Pixel is for 1st Nibble (1st pixel at MSB). - * | | |1 = The 4-bit data input sequence: 1st Pixel is for 2nd Nibble (1st pixel at LSB). - * |[18] |MY8_MY4 |Monochrome CMOS Sensor Data I/O Interface - * | | |0 = Monochrome CMOS sensor is by the 4-bit data I/O interface. - * | | |1 = Monochrome CMOS sensor is by the 8-bit data I/O interface. - * |[19] |Luma_Y_One|Color/Monochrome CMOS Sensor Luminance 8-bit Y to 1-bit Y Conversion - * | | |0 = Color/Monochrome CMOS sensor Luma-Y-One bit Disabled. - * | | |1 = Color/Monochrome CMOS sensor Luma-Y-One bit Enabled. - * | | |Note: Color CMOS sensor U/V components are ignored when the Luma_Y_One is enabled. - * |[20] |UPDATE |Update Register at New Frame - * | | |0 = Update register at new frame Disabled. - * | | |1 = Update register at new frame Enabled (Auto clear to 0 when register updated). - * |[24] |VPRST |Capture Interface Reset - * | | |0 = Capture interface reset Disabled. - * | | |1 = Capture interface reset Enabled. - * @var CCAP_T::PAR - * Offset: 0x04 Camera Capture Interface Parameter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INFMT |Sensor Input Data Format - * | | |0 = YCbCr422. - * | | |1 = RGB565. - * |[1] |SENTYPE |Sensor Input Type - * | | |0 = CCIR601. - * | | |1 = CCIR656, VSync & Hsync embedded in the data signal. - * |[3:2] |INDATORD |Sensor Input Data Order - * | | |If INFMT (CCAP_PAR[0]) = 0 (YCbCr): - * | | |00 = Sensor input data (Byte 0 1 2 3) is Y0 U0 Y1 V0. - * | | |01 = Sensor input data (Byte 0 1 2 3) is Y0 V0 Y1 U0. - * | | |10 = Sensor input data (Byte 0 1 2 3) is U0 Y0 V0 Y1. - * | | |11 = Sensor input data (Byte 0 1 2 3) is V0 Y0 U0 Y1. - * | | |If INFMT (CCAP_PAR[0]) = 1 (RGB565): - * | | |00 = Sensor input data (Byte 0) is {R[4:0],G[5:3]}. Sensor input data (Byte 1) is {G[2:0], B[4:0]}. - * | | |01 = Sensor input data (Byte 0) is {B[4:0],G[5:3]}. Sensor input data (Byte 1) is {G[2:0], R[4:0]}. - * | | |10 = Sensor input data (Byte 0) is {G[2:0],B[4:0]}. Sensor input data (Byte 1) is {R[4:0], G[5:3]}. - * | | |11 = Sensor input data (Byte 0) is {G[2:0],R[4:0]}. Sensor input data (Byte 1) is {B[4:0], G[5:3]}. - * |[5:4] |OUTFMT |Image Data Format Output to System Memory - * | | |00 = YCbCr422. - * | | |01 = Only output Y. (Select this format when CCAP_CTL "Luma_Y_One" or "MONO" enabled). - * | | |10 = RGB555. - * | | |11 = RGB565. - * |[6] |RANGE |Scale Input YUV CCIR601 Color Range to Full Range - * | | |0 = Default. - * | | |1 = Scale to full range. - * |[8] |PCLKP |Sensor Pixel Clock Polarity - * | | |0 = Input video data and signals are latched by falling edge of Pixel Clock. - * | | |1 = Input video data and signals are latched by rising edge of Pixel Clock. - * |[9] |HSP |Sensor Hsync Polarity - * | | |0 = Sync Low. - * | | |1 = Sync High. - * |[10] |VSP |Sensor Vsync Polarity - * | | |0 = Sync Low. - * | | |1 = Sync High. - * |[18] |FBB |Field by Blank - * | | |Field by Blank (only in ccir-656 mode) means blanking pixel data(0x80108010) have to transfer to system memory or not. - * | | |0 = Field by blank Disabled. (blank pixel data will transfer to system memory). - * | | |1 = Field by blank Enabled. (only active data will transfer to system memory). - * @var CCAP_T::INT - * Offset: 0x08 Camera Capture Interface Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |VINTF |Video Frame End Interrupt - * | | |0 = Did not receive a frame completely. - * | | |1 = Received a frame completely. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |MEINTF |Bus Master Transfer Error Interrupt - * | | |0 = Transfer Error did not occur. - * | | |1 = Transfer Error occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |ADDRMINTF |Memory Address Match Interrupt - * | | |0 = Memory Address Match Interrupt did not occur. - * | | |1 = Memory Address Match Interrupt occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[16] |VIEN |Video Frame End Interrupt Enable Bit - * | | |0 = Video frame end interrupt Disabled. - * | | |1 = Video frame end interrupt Enabled. - * |[17] |MEIEN |Bus Master Transfer Error Interrupt Enable Bit - * | | |0 = Bus Master Transfer error interrupt Disabled. - * | | |1 = Bus Master Transfer error interrupt Enabled. - * |[19] |ADDRMIEN |Memory Address Match Interrupt Enable Bit - * | | |0 = Memory address match interrupt Disabled. - * | | |1 = Memory address match interrupt Enabled. - * @var CCAP_T::CWSP - * Offset: 0x20 Cropping Window Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CWSADDRH |Cropping Window Horizontal Starting Address - * | | |Specify the value of the cropping window horizontal start address. - * |[26:16] |CWSADDRV |Cropping Window Vertical Starting Address - * | | |Specify the value of the cropping window vertical start address. - * @var CCAP_T::CWS - * Offset: 0x24 Cropping Window Size Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CWW |Cropping Window Width - * | | |Specify the size of the cropping window width. - * |[26:16] |CWH |Cropping Window Height - * | | |Specify the size of the cropping window height. - * @var CCAP_T::PKTSL - * Offset: 0x28 Packet Scaling Vertical/Horizontal Factor Register (LSB) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PKTSHML |Packet Scaling Horizontal Factor M - * | | |Specifies the lower 8-bit of denominator part (M) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSHMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image width * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[15:8] |PKTSHNL |Packet Scaling Horizontal Factor N - * | | |Specify the lower 8-bit of numerator part (N) of the horizontal scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSHNH) to form a 16-bit numerator of horizontal factor. - * |[23:16] |PKTSVML |Packet Scaling Vertical Factor M - * | | |Specify the lower 8-bit of denominator part (M) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSVMH) to form a 16-bit denominator (M) of vertical factor. - * | | |The output image width will be equal to the image height * N/M. - * | | |Note: The value of N must be equal to or less than M. - * |[31:24] |PKTSVNL |Packet Scaling Vertical Factor N - * | | |Specify the lower 8-bit of numerator part (N) of the vertical scaling factor. - * | | |The lower 8-bit will be cascaded with higher 8-bit (PKDSVNH) to form a 16-bit numerator of vertical factor. - * @var CCAP_T::FRCTL - * Offset: 0x30 Scaling Frame Rate Factor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |FRM |Scaling Frame Rate Factor M - * | | |Specify the denominator part (M) of the frame rate scaling factor. - * | | |The output image frame rate will be equal to input image frame rate * (N/M). - * | | |Note: The value of N must be equal to or less than M. - * |[13:8] |FRN |Scaling Frame Rate Factor N - * | | |Specify the numerator part (N) of the frame rate scaling factor. - * @var CCAP_T::STRIDE - * Offset: 0x34 Frame Output Pixel Stride Width Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PKTSTRIDE |Packet Frame Output Pixel Stride Width - * | | |The output pixel stride size of packet pipe. - * | | |It is a 32-pixel aligned stride width for the Luma-Y-One bit format or a 4-pixel aligned stride with for the Luma-Y-Eight bit format when color or monochrome CMOS sensors used. - * | | |This means that every new captured line is by word alignment address when color or monochrome CMOS sensors used. - * @var CCAP_T::FIFOTH - * Offset: 0x3C FIFO Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:24] |PKTFTH |Packet FIFO Threshold - * | | |Specify the 5-bit value of the packet FIFO threshold. - * |[31] |OVF |FIFO Overflow Flag - * | | |Indicate the FIFO overflow flag. - * @var CCAP_T::CMPADDR - * Offset: 0x40 Compare Memory Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CMPADDR |Compare Memory Base Address - * | | |It is a word alignment address, that is, the address is aligned by ignoring the 2 LSB bits [1:0]. - * @var CCAP_T::LUMA_Y1_THD - * Offset: 0x44 Luminance Y8 to Y1 Threshold Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :-----------: | :---- | - * |[7:0] |LUMA_Y1_THRESH |Luminance Y8 to Y1 Threshold Value - * | | |Specify the 8-bit threshold value for the luminance Y bit-8 to the luminance Y 1-bit conversion. - * @var CCAP_T::PKTSM - * Offset: 0x48 Packet Scaling Vertical/Horizontal Factor Register (MSB) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PKTSHMH |Packet Scaling Horizontal Factor M - * | | |Specify the higher 8-bit of denominator part (M) of the horizontal scaling factor. - * | | |Please refer to the register CCAP_PKTSL for the detailed operation. - * |[15:8] |PKTSHNH |Packet Scaling Horizontal Factor N - * | | |Specify the higher 8-bit of numerator part (N) of the horizontal scaling factor. - * | | |Please refer to the register CCAP_PKTSL for the detailed operation. - * |[23:16] |PKTSVMH |Packet Scaling Vertical Factor M - * | | |Specify the higher 8-bit of denominator part (M) of the vertical scaling factor. - * | | |Please refer to the register CCAP_PKTSL to check the cooperation between these two registers. - * |[31:24] |PKTSVNH |Packet Scaling Vertical Factor N - * | | |Specify the higher 8-bit of numerator part (N) of the vertical scaling factor. - * | | |Please refer to the register CCAP_PKTSL to check the cooperation between these two registers. - * @var CCAP_T::CURADDRP - * Offset: 0x50 Current Packet System Memory Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURADDR |Current Packet Output Memory Address - * | | |Specify the 32-bit value of the current packet output memory address. - * @var CCAP_T::PKTBA0 - * Offset: 0x60 System Memory Packet Base Address 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |BASEADDR |System Memory Packet Base Address 0 - * | | |It is a word alignment address, that is, the address is aligned by ignoring the 2 LSB bits [1:0]. - */ - __IO uint32_t CTL; /*!< [0x0000] Camera Capture Interface Control Register */ - __IO uint32_t PAR; /*!< [0x0004] Camera Capture Interface Parameter Register */ - __IO uint32_t INT; /*!< [0x0008] Camera Capture Interface Interrupt Register */ - __I uint32_t RESERVE0[5]; - __IO uint32_t CWSP; /*!< [0x0020] Cropping Window Starting Address Register */ - __IO uint32_t CWS; /*!< [0x0024] Cropping Window Size Register */ - __IO uint32_t PKTSL; /*!< [0x0028] Packet Scaling Vertical/Horizontal Factor Register (LSB) */ - __IO uint32_t PLNSL; /*!< [0x002C] Planar Scaling Vertical/Horizontal Factor Register (LSB) */ - __IO uint32_t FRCTL; /*!< [0x0030] Scaling Frame Rate Factor Register */ - __IO uint32_t STRIDE; /*!< [0x0034] Frame Output Pixel Stride Width Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t FIFOTH; /*!< [0x003C] FIFO Threshold Register */ - __IO uint32_t CMPADDR; /*!< [0x0040] Compare Memory Base Address Register */ - __IO uint32_t LUMA_Y1_THD; /*!< [0x0044] Luminance Y8 to Y1 Threshold Value Register */ - __IO uint32_t PKTSM; /*!< [0x0048] Packet Scaling Vertical/Horizontal Factor Register (MSB) */ - __IO uint32_t PLNSM; /*!< [0x004C] Planar Scaling Vertical/Horizontal Factor Register (MSB) */ - __I uint32_t CURADDRP; /*!< [0x0050] Current Packet System Memory Address Register */ - __I uint32_t CURADDRY; /*!< [0x0054] Current Planar Y System Memory Address Register */ - __I uint32_t CURADDRU; /*!< [0x0058] Current Planar U System Memory Address Register */ - __I uint32_t CURADDRV; /*!< [0x005C] Current Planar V System Memory Address Register */ - __IO uint32_t PKTBA0; /*!< [0x0060] System Memory Packet Base Address 0 Register */ - __I uint32_t RESERVE4[7]; - __IO uint32_t YBA; /*!< [0x0080] System Memory Planar Y Base Address Register */ - __IO uint32_t UBA; /*!< [0x0084] System Memory Planar U Base Address Register */ - __IO uint32_t VBA; /*!< [0x0088] System Memory Planar V Base Address Register */ -} CCAP_T; - -/** - @addtogroup CCAP_CONST CCAP Bit Field Definition - Constant Definitions for CCAP Controller -@{ */ - -#define CCAP_CTL_CCAPEN_Pos (0) /*!< CCAP_T::CTL: CCAPEN Position */ -#define CCAP_CTL_CCAPEN_Msk (0x1ul << CCAP_CTL_CCAPEN_Pos) /*!< CCAP_T::CTL: CCAPEN Mask */ - -#define CCAP_CTL_PLNEN_Pos (5) /*!< CCAP_T::CTL: PLNEN Position */ -#define CCAP_CTL_PLNEN_Msk (0x1ul << CCAP_CTL_PLNEN_Pos) /*!< CCAP_T::CTL: PLNEN Mask */ - -#define CCAP_CTL_PKTEN_Pos (6) /*!< CCAP_T::CTL: PKTEN Position */ -#define CCAP_CTL_PKTEN_Msk (0x1ul << CCAP_CTL_PKTEN_Pos) /*!< CCAP_T::CTL: PKTEN Mask */ - -#define CCAP_CTL_MONO_Pos (7) /*!< CCAP_T::CTL: MONO Position */ -#define CCAP_CTL_MONO_Msk (0x1ul << CCAP_CTL_MONO_Pos) /*!< CCAP_T::CTL: MONO Mask */ - -#define CCAP_CTL_SHUTTER_Pos (16) /*!< CCAP_T::CTL: SHUTTER Position */ -#define CCAP_CTL_SHUTTER_Msk (0x1ul << CCAP_CTL_SHUTTER_Pos) /*!< CCAP_T::CTL: SHUTTER Mask */ - -#define CCAP_CTL_MY4_SWAP_Pos (17) /*!< CCAP_T::CTL: MY4_SWAP Position */ -#define CCAP_CTL_MY4_SWAP_Msk (0x1ul << CCAP_CTL_MY4_SWAP_Pos) /*!< CCAP_T::CTL: MY4_SWAP Mask */ - -#define CCAP_CTL_MY8_MY4_Pos (18) /*!< CCAP_T::CTL: MY8_MY4 Position */ -#define CCAP_CTL_MY8_MY4_Msk (0x1ul << CCAP_CTL_MY8_MY4_Pos) /*!< CCAP_T::CTL: MY8_MY4 Mask */ - -#define CCAP_CTL_Luma_Y_One_Pos (19) /*!< CCAP_T::CTL: Luma_Y_One Position */ -#define CCAP_CTL_Luma_Y_One_Msk (0x1ul << CCAP_CTL_Luma_Y_One_Pos) /*!< CCAP_T::CTL: Luma_Y_One Mask */ - -#define CCAP_CTL_UPDATE_Pos (20) /*!< CCAP_T::CTL: UPDATE Position */ -#define CCAP_CTL_UPDATE_Msk (0x1ul << CCAP_CTL_UPDATE_Pos) /*!< CCAP_T::CTL: UPDATE Mask */ - -#define CCAP_CTL_VPRST_Pos (24) /*!< CCAP_T::CTL: VPRST Position */ -#define CCAP_CTL_VPRST_Msk (0x1ul << CCAP_CTL_VPRST_Pos) /*!< CCAP_T::CTL: VPRST Mask */ - -#define CCAP_PAR_INFMT_Pos (0) /*!< CCAP_T::PAR: INFMT Position */ -#define CCAP_PAR_INFMT_Msk (0x1ul << CCAP_PAR_INFMT_Pos) /*!< CCAP_T::PAR: INFMT Mask */ - -#define CCAP_PAR_SENTYPE_Pos (1) /*!< CCAP_T::PAR: SENTYPE Position */ -#define CCAP_PAR_SENTYPE_Msk (0x1ul << CCAP_PAR_SENTYPE_Pos) /*!< CCAP_T::PAR: SENTYPE Mask */ - -#define CCAP_PAR_INDATORD_Pos (2) /*!< CCAP_T::PAR: INDATORD Position */ -#define CCAP_PAR_INDATORD_Msk (0x3ul << CCAP_PAR_INDATORD_Pos) /*!< CCAP_T::PAR: INDATORD Mask */ - -#define CCAP_PAR_PLNFMT_Pos (7) /*!< CCAP_T::PAR: OUTFMT Position */ -#define CCAP_PAR_PLNFMT_Msk (0x1ul << CCAP_PAR_OUTFMT_Pos) /*!< CCAP_T::PAR: OUTFMT Mask */ - -#define CCAP_PAR_OUTFMT_Pos (4) /*!< CCAP_T::PAR: OUTFMT Position */ -#define CCAP_PAR_OUTFMT_Msk (0x3ul << CCAP_PAR_OUTFMT_Pos) /*!< CCAP_T::PAR: OUTFMT Mask */ - -#define CCAP_PAR_RANGE_Pos (6) /*!< CCAP_T::PAR: RANGE Position */ -#define CCAP_PAR_RANGE_Msk (0x1ul << CCAP_PAR_RANGE_Pos) /*!< CCAP_T::PAR: RANGE Mask */ - -#define CCAP_PAR_PCLKP_Pos (8) /*!< CCAP_T::PAR: PCLKP Position */ -#define CCAP_PAR_PCLKP_Msk (0x1ul << CCAP_PAR_PCLKP_Pos) /*!< CCAP_T::PAR: PCLKP Mask */ - -#define CCAP_PAR_HSP_Pos (9) /*!< CCAP_T::PAR: HSP Position */ -#define CCAP_PAR_HSP_Msk (0x1ul << CCAP_PAR_HSP_Pos) /*!< CCAP_T::PAR: HSP Mask */ - -#define CCAP_PAR_VSP_Pos (10) /*!< CCAP_T::PAR: VSP Position */ -#define CCAP_PAR_VSP_Msk (0x1ul << CCAP_PAR_VSP_Pos) /*!< CCAP_T::PAR: VSP Mask */ - -#define CCAP_PAR_FBB_Pos (18) /*!< CCAP_T::PAR: FBB Position */ -#define CCAP_PAR_FBB_Msk (0x1ul << CCAP_PAR_FBB_Pos) /*!< CCAP_T::PAR: FBB Mask */ - -#define CCAP_INT_VINTF_Pos (0) /*!< CCAP_T::INT: VINTF Position */ -#define CCAP_INT_VINTF_Msk (0x1ul << CCAP_INT_VINTF_Pos) /*!< CCAP_T::INT: VINTF Mask */ - -#define CCAP_INT_MEINTF_Pos (1) /*!< CCAP_T::INT: MEINTF Position */ -#define CCAP_INT_MEINTF_Msk (0x1ul << CCAP_INT_MEINTF_Pos) /*!< CCAP_T::INT: MEINTF Mask */ - -#define CCAP_INT_ADDRMINTF_Pos (3) /*!< CCAP_T::INT: ADDRMINTF Position */ -#define CCAP_INT_ADDRMINTF_Msk (0x1ul << CCAP_INT_ADDRMINTF_Pos) /*!< CCAP_T::INT: ADDRMINTF Mask */ - -#define CCAP_INT_VIEN_Pos (16) /*!< CCAP_T::INT: VIEN Position */ -#define CCAP_INT_VIEN_Msk (0x1ul << CCAP_INT_VIEN_Pos) /*!< CCAP_T::INT: VIEN Mask */ - -#define CCAP_INT_MEIEN_Pos (17) /*!< CCAP_T::INT: MEIEN Position */ -#define CCAP_INT_MEIEN_Msk (0x1ul << CCAP_INT_MEIEN_Pos) /*!< CCAP_T::INT: MEIEN Mask */ - -#define CCAP_INT_ADDRMIEN_Pos (19) /*!< CCAP_T::INT: ADDRMIEN Position */ -#define CCAP_INT_ADDRMIEN_Msk (0x1ul << CCAP_INT_ADDRMIEN_Pos) /*!< CCAP_T::INT: ADDRMIEN Mask */ - -#define CCAP_CWSP_CWSADDRH_Pos (0) /*!< CCAP_T::CWSP: CWSADDRH Position */ -#define CCAP_CWSP_CWSADDRH_Msk (0xffful << CCAP_CWSP_CWSADDRH_Pos) /*!< CCAP_T::CWSP: CWSADDRH Mask */ - -#define CCAP_CWSP_CWSADDRV_Pos (16) /*!< CCAP_T::CWSP: CWSADDRV Position */ -#define CCAP_CWSP_CWSADDRV_Msk (0x7fful << CCAP_CWSP_CWSADDRV_Pos) /*!< CCAP_T::CWSP: CWSADDRV Mask */ - -#define CCAP_CWS_CWW_Pos (0) /*!< CCAP_T::CWS: CWW Position */ -#define CCAP_CWS_CWW_Msk (0xffful << CCAP_CWS_CWW_Pos) /*!< CCAP_T::CWS: CWW Mask */ - -#define CCAP_CWS_CWH_Pos (16) /*!< CCAP_T::CWS: CIWH Position */ -#define CCAP_CWS_CWH_Msk (0x7fful << CCAP_CWS_CWH_Pos) /*!< CCAP_T::CWS: CIWH Mask */ - -#define CCAP_PKTSL_PKTSHML_Pos (0) /*!< CCAP_T::PKTSL: PKTSHML Position */ -#define CCAP_PKTSL_PKTSHML_Msk (0xfful << CCAP_PKTSL_PKTSHML_Pos) /*!< CCAP_T::PKTSL: PKTSHML Mask */ - -#define CCAP_PKTSL_PKTSHNL_Pos (8) /*!< CCAP_T::PKTSL: PKTSHNL Position */ -#define CCAP_PKTSL_PKTSHNL_Msk (0xfful << CCAP_PKTSL_PKTSHNL_Pos) /*!< CCAP_T::PKTSL: PKTSHNL Mask */ - -#define CCAP_PKTSL_PKTSVML_Pos (16) /*!< CCAP_T::PKTSL: PKTSVML Position */ -#define CCAP_PKTSL_PKTSVML_Msk (0xfful << CCAP_PKTSL_PKTSVML_Pos) /*!< CCAP_T::PKTSL: PKTSVML Mask */ - -#define CCAP_PKTSL_PKTSVNL_Pos (24) /*!< CCAP_T::PKTSL: PKTSVNL Position */ -#define CCAP_PKTSL_PKTSVNL_Msk (0xfful << CCAP_PKTSL_PKTSVNL_Pos) /*!< CCAP_T::PKTSL: PKTSVNL Mask */ - -#define CCAP_PLNSL_PLNSHML_Pos (0) /*!< CCAP_T::PLNSL: PLNSHML Position */ -#define CCAP_PLNSL_PLNSHML_Msk (0xfful << CCAP_PLNSL_PLNSHML_Pos) /*!< CCAP_T::PLNSL: PLNSHML Mask */ - -#define CCAP_PLNSL_PLNSHNL_Pos (8) /*!< CCAP_T::PLNSL: PLNSHNL Position */ -#define CCAP_PLNSL_PLNSHNL_Msk (0xfful << CCAP_PLNSL_PLNSHNL_Pos) /*!< CCAP_T::PLNSL: PLNSHNL Mask */ - -#define CCAP_PLNSL_PLNSVML_Pos (16) /*!< CCAP_T::PLNSL: PLNSVML Position */ -#define CCAP_PLNSL_PLNSVML_Msk (0xfful << CCAP_PLNSL_PLNSVML_Pos) /*!< CCAP_T::PLNSL: PLNSVML Mask */ - -#define CCAP_PLNSL_PLNSVNL_Pos (24) /*!< CCAP_T::PLNSL: PLNSVNL Position */ -#define CCAP_PLNSL_PLNSVNL_Msk (0xfful << CCAP_PLNSL_PLNSVNL_Pos) /*!< CCAP_T::PLNSL: PLNSVNL Mask */ - -#define CCAP_FRCTL_FRM_Pos (0) /*!< CCAP_T::FRCTL: FRM Position */ -#define CCAP_FRCTL_FRM_Msk (0x3ful << CCAP_FRCTL_FRM_Pos) /*!< CCAP_T::FRCTL: FRM Mask */ - -#define CCAP_FRCTL_FRN_Pos (8) /*!< CCAP_T::FRCTL: FRN Position */ -#define CCAP_FRCTL_FRN_Msk (0x3ful << CCAP_FRCTL_FRN_Pos) /*!< CCAP_T::FRCTL: FRN Mask */ - -#define CCAP_STRIDE_PKTSTRIDE_Pos (0) /*!< CCAP_T::STRIDE: PKTSTRIDE Position */ -#define CCAP_STRIDE_PKTSTRIDE_Msk (0x3ffful << CCAP_STRIDE_PKTSTRIDE_Pos) /*!< CCAP_T::STRIDE: PKTSTRIDE Mask */ - -#define CCAP_STRIDE_PLNSTRIDE_Pos (16) /*!< CCAP_T::STRIDE: PLNSTRIDE Position */ -#define CCAP_STRIDE_PLNSTRIDE_Msk (0x3ffful << CCAP_STRIDE_PLNSTRIDE_Pos) /*!< CCAP_T::STRIDE: PLNSTRIDE Mask */ - -#define CCAP_FIFOTH_PKTFTH_Pos (24) /*!< CCAP_T::FIFOTH: PKTFTH Position */ -#define CCAP_FIFOTH_PKTFTH_Msk (0x1ful << CCAP_FIFOTH_PKTFTH_Pos) /*!< CCAP_T::FIFOTH: PKTFTH Mask */ - -#define CCAP_FIFOTH_OVF_Pos (31) /*!< CCAP_T::FIFOTH: OVF Position */ -#define CCAP_FIFOTH_OVF_Msk (0x1ul << CCAP_FIFOTH_OVF_Pos) /*!< CCAP_T::FIFOTH: OVF Mask */ - -#define CCAP_CMPADDR_CMPADDR_Pos (0) /*!< CCAP_T::CMPADDR: CMPADDR Position */ -#define CCAP_CMPADDR_CMPADDR_Msk (0xfffffffful << CCAP_CMPADDR_CMPADDR_Pos) /*!< CCAP_T::CMPADDR: CMPADDR Mask */ - -#define CCAP_PKTSM_PKTSHMH_Pos (0) /*!< CCAP_T::PKTSM: PKTSHMH Position */ -#define CCAP_PKTSM_PKTSHMH_Msk (0xfful << CCAP_PKTSM_PKTSHMH_Pos) /*!< CCAP_T::PKTSM: PKTSHMH Mask */ - -#define CCAP_PKTSM_PKTSHNH_Pos (8) /*!< CCAP_T::PKTSM: PKTSHNH Position */ -#define CCAP_PKTSM_PKTSHNH_Msk (0xfful << CCAP_PKTSM_PKTSHNH_Pos) /*!< CCAP_T::PKTSM: PKTSHNH Mask */ - -#define CCAP_PKTSM_PKTSVMH_Pos (16) /*!< CCAP_T::PKTSM: PKTSVMH Position */ -#define CCAP_PKTSM_PKTSVMH_Msk (0xfful << CCAP_PKTSM_PKTSVMH_Pos) /*!< CCAP_T::PKTSM: PKTSVMH Mask */ - -#define CCAP_PKTSM_PKTSVNH_Pos (24) /*!< CCAP_T::PKTSM: PKTSVNH Position */ -#define CCAP_PKTSM_PKTSVNH_Msk (0xfful << CCAP_PKTSM_PKTSVNH_Pos) /*!< CCAP_T::PKTSM: PKTSVNH Mask */ - -#define CCAP_PLNSM_PLNSHMH_Pos (0) /*!< CCAP_T::PLNSM: PLNSHMH Position */ -#define CCAP_PLNSM_PLNSHMH_Msk (0xfful << CCAP_PLNSM_PLNSHMH_Pos) /*!< CCAP_T::PLNSM: PLNSHMH Mask */ - -#define CCAP_PLNSM_PLNSHNH_Pos (8) /*!< CCAP_T::PLNSM: PLNSHNH Position */ -#define CCAP_PLNSM_PLNSHNH_Msk (0xfful << CCAP_PLNSM_PLNSHNH_Pos) /*!< CCAP_T::PLNSM: PLNSHNH Mask */ - -#define CCAP_PLNSM_PLNSVMH_Pos (16) /*!< CCAP_T::PLNSM: PLNSVMH Position */ -#define CCAP_PLNSM_PLNSVMH_Msk (0xfful << CCAP_PLNSM_PLNSVMH_Pos) /*!< CCAP_T::PLNSM: PLNSVMH Mask */ - -#define CCAP_PLNSM_PLNSVNH_Pos (24) /*!< CCAP_T::PLNSM: PLNSVNH Position */ -#define CCAP_PLNSM_PLNSVNH_Msk (0xfful << CCAP_PLNSM_PLNSVNH_Pos) /*!< CCAP_T::PLNSM: PLNSVNH Mask */ - -#define CCAP_CURADDRP_CURADDR_Pos (0) /*!< CCAP_T::CURADDRP: CURADDR Position */ -#define CCAP_CURADDRP_CURADDR_Msk (0xfffffffful << CCAP_CURADDRP_CURADDR_Pos) /*!< CCAP_T::CURADDRP: CURADDR Mask */ - -#define CCAP_PKTBA0_BASEADDR_Pos (0) /*!< CCAP_T::PKTBA0: BASEADDR Position */ -#define CCAP_PKTBA0_BASEADDR_Msk (0xfffffffful << CCAP_PKTBA0_BASEADDR_Pos) /*!< CCAP_T::PKTBA0: BASEADDR Mask */ - -/**@}*/ /* CCAP_CONST */ -/**@}*/ /* end of CCAP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CCAP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/clk_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/clk_reg.h deleted file mode 100644 index 96a6945de91..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/clk_reg.h +++ /dev/null @@ -1,2596 +0,0 @@ -/**************************************************************************//** - * @file clk_reg.h - * @brief CLK register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CLK_REG_H__ -#define __CLK_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -typedef struct -{ - /** - * @var PLL_T::CTL0 - * Offset: 0x0 PLL Control Register 0(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Set the feedback divider factor (N) from 16 to 2047. - * | | |The N = FBDIV[10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[17:12] |INDIV |PLL Reference Input Divider Control (Write Protect) - * | | |Set the reference divider factor (M) from 1 to 63. - * | | |The M = INDIV[5:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[19:18] |MODE |Operation Mode Selection(Write Protect) - * | | |00 = Integer mode. - * | | |In this mode, the rising edges of the two clocks at the input of PFD are phase aligned - * | | |And the output clock frequency is at multiples of the input clock frequency contingent on the configuration of OUTDIV, INDIV and FBDIV. - * | | |01 = Fractional mode. - * | | |This mode is suitable for applications which need small output frequency steps, like 20 kHz - * | | |The jitter performance in this mode may be worse than in Integer Mode. - * | | |In this mode, the output clock frequency is at the fractional multiples of the input clock frequency - * | | |By setting the control pins FRAC [23:0], a small output frequency step is achieved.. - * | | |10 = Spread Spectrum Mode. - * | | |This mode is suitable for In this mode the output frequency of PLL will be modulated by triangle wave - * | | |It is for EMI consideration. - * | | |By setting SSRATE [10:0] and SLOPE [23:0], the modulation index and the modulation frequency can be programmed. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[30:20] |SSRATE |Spreading Frequency Control (Write Protect) - * | | |Set the spread step factor SSRATE from 0 to 2047, - * | | |SSRATE = SSRATE [10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var PLL_T::CTL1 - * Offset: 0x4 PLL Control Register 1(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[1] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock Fref. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[6:4] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Set the output divider factor (P) from 1 to 7. - * | | |P = OUTDIV[2:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[31:8] |FRAC |PLL Fractional Portion of DN Value (Write Protect) - * | | |Set the fraction part (X) of Fractional Portion of DN Value factor. - * | | |The X = FRAC[23:0] / 224. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var PLL_T::CTL2 - * Offset: 0x8 PLL Control Register 2(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |SLOPE |PLL Stable Counter Selection (Write Protect) - * | | |Set the spread step factor SLOPE from 0 to 16777215, - * | | |SLOPE = SLOPE[23:0]. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var PLL_T::RESERVE - * Offset: 0xC - * --------------------------------------------------------------------------------------------------- - */ - __IO uint32_t CTL0; /*!< [0x0000] PLL Control Register 0 of PLL Channel n.(Write Protect) */ - __IO uint32_t CTL1; /*!< [0x0004] PLL Control Register 1 of PLL Channel n.(Write Protect) */ - __IO uint32_t CTL2; /*!< [0x0008] PLL Control Register 2 of PLL Channel n.(Write Protect) */ - __IO uint32_t RESERVE; /*!< [0x000c] Reserved */ - -} PLL_T; - -/** - @addtogroup CLK System Clock Controller(CLK) - Memory Mapped Structure for CLK Controller -@{ */ - -typedef struct -{ - - - /** - * @var CLK_T::PWRCTL - * Offset: 0x00 System Power-down Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTEN |HXT Enable Bit (Write Protect) - * | | |0 = 24 MHz external high speed crystal (HXT) Disabled. - * | | |1 = 24 MHz external high speed crystal (HXT) Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: HXT cannot be disabled and HXTEN will always read as 1 if HCLK clock source is selected from HXT or PLL (clock source from HXT). - * |[1] |LXTEN |LXT Enable Bit (Write Protect) - * | | |0 = 32.768 kHz external low speed crystal (external LXT) Disabled. - * | | |1 = 32.768 kHz external low speed crystal (external LXT) Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: LXT cannot be disabled and LXTEN will always read as 1 if HCLK clock source is selected from LXT when the LXT clock source is selected as external LXT by setting C32KS(RTC_LXTCTL[6]) to 1. - * |[2] |HIRCEN |HIRC Enable Bit (Write Protect) - * | | |The HCLK default clock source is from HIRC and this bit default value is 1. - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) Disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: HIRC cannot be disabled and HIRCEN will always read as 1 if HXTFQIEN or is set. - * |[3] |LIRCEN |LIRC Enable Bit (Write Protect) - * | | |0 = 32 kHz internal low speed RC oscillator (LIRC) Disabled. - * | | |1 = 32 kHz internal low speed RC oscillator (LIRC) Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[10] |HXTDS |HXT Drive Current Strength (Write Protect) - * | | |0 = Lower power consumption requirement for 2.5V~3.3V I/O power application. - * | | |1 = higher noise immunity requirement for 2.5V~3.3V I/O power application.(default) - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[11] |SYSPLLAPD |SYSPLL Auto Power Down Option when CA35 & RTP-M4 are Power Down (Write Protect) - * | | |0 = When CA35 and RTP-M4 are both in WFI, the PD pin of SYS-PLL is the same as CLK_PLL2CTL1[0]. - * | | |1 = When CA35 and RTP-M4 are both in WFI, set the PD pin of SYS-PLL to high automatically. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 and RTP-M4 are not both in Power-down mode - * | | |If one of RTP-M4 and CA35 is not in Power-down mode, the PLL PD pin status is the controlled by CLK_PLL1CTL1[0]. - * |[12] |CAPLLAPD |CAPLL Auto Power Down Option when CA35 is Power Gating (Write Protect) - * | | |0 = When CA35 core power is not ready, the PD pin of CA-PLL is the same as CLK_PLL0CTL1[0]. - * | | |1 = When CA35 core power is not ready, set the PD pin of CA-PLL to high automatically. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 core power is not ready - * | | |If CA35 core power is ready, the PLL PD pin status is the controlled by CLK_PLL0CTL1[0]. - * |[13] |DDRPLLAPD |DDRPLL Auto Power Down Option when CA35 is Power Gating (Write Protect) - * | | |0 = When CA35 core power is not ready, the PD pin of DDR-PLL is the same as CLK_PLL2CTL1[0]. - * | | |1 = When CA35 core power is not ready, set the PD pin of DDR-PLL to high automatically. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 core power is not ready - * | | |If CA35 core power is ready, the PLL PD pin status is the controlled by CLK_PLL2CTL1[0]. - * |[14] |HXTAOFF |HXT Auto Off Option when CA35 is Power Gating (Write Protect) - * | | |0 = When CA35 core power is not ready, the HXT enable bit is the same as CLK_PWRCTL[0]. - * | | |1 = When CA35 core power is not ready, switch the HXT enable bit to low automatically. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 core power is not ready - * | | |If CA35 core power is ready, the HXT enable bit is the controlled by CLK_PWRCTL[0]. - * |[15] |HIRCAOFF |HIRC Auto Off Option when CA35 is Power Gating (Write Protect) - * | | |0 = When CA35 core power is not ready, the HIRC enable bit is the same as CLK_PWRCTL[2]. - * | | |1 = When CA35 core power is not ready, switch the HIRC enable bit to low automatically. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 core power is not ready - * | | |If CA35 core power is ready, the HIRC enable bit is the controlled by CLK_PWRCTL[2]. - * |[17:16] |LXTSTBS |LXT Stable Count Select (Write Protect) - * | | |00 = LXT stable count = 16384 clocks. - * | | |01 = LXT stable count = 65536 clocks. - * | | |10 = LXT stable count = 131072 clocks. - * | | |11 = LXT stable count = 327680 clocks. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZS register. - * |[21] |GICAOFF |GIC CLK Auto Off Option when CA35 is Power Gating (Write Protect) - * | | |0 = When CA35 core power is not ready, the GIC CLK will not be gated. - * | | |1 = When CA35 core power is not ready, the GIC CLK will be gated. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 core power is not ready - * | | |If CA35 core power is ready, the HIRC enable bit is the controlled by CLK_PWRCTL[2]. - * |[22] |HXTAPD |HXT Auto Off Option when CA35 is Power Down (Write Protect) - * | | |0 = When CA35 cores are in WFI, the HXT enable bit is the same as CLK_PWRCTL[0]. - * | | |1 = When CA35 cores are in WFI, switch the HXT enable bit to low automatically. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 cores are in the WFI - * | | |If CA35 cores are not in WFI, the HXT enable bit is the controlled by CLK_PWRCTL[0]. - * |[23] |HIRCAPD |HIRC Auto Off Option when CA35 is Power Down (Write Protect) - * | | |0 = When CA35 cores are in WFI, the HIRC enable bit is the same as CLK_PWRCTL[2]. - * | | |1 = When CA35 cores are in WFI, switch the HIRC enable bit to low automatically. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: This bit only works when the CA35 cores are in the WFI - * | | |If CA35 cores are not in WFI, the HIRC enable bit is the controlled by CLK_PWRCTL[2]. - * @var CLK_T::SYSCLK0 - * Offset: 0x04 AXI and AHB Device Clock Enable Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RTPEN |CPU RTP CortexM4 AHB Clock Enable Bit (Write Protect) - * | | |0 = Cortex M4 AHB clock Disabled. - * | | |1 = Cortex M4 AHB clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[2] |TAHBCKEN |TSI AHB HCLK Clock Enable Bit (Write Protect) - * | | |0 = TSI AHB HCLK Disabled. - * | | |1 = TSI AHB HCLK Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[3] |LVRDBEN |LVR Debounce Clock Enable Bit (Write Protect) - * | | |0 = LVR Debounce clock Disabled. - * | | |1 = LVR Debounce clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[4] |DDR0CKEN |DDR Port0 Clock Enable Bit (Write Protect) - * | | |0 = DDR Port0 peripheral clock Disabled. - * | | |1 = DDR Port0 peripheral clock Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: The peripheral clock of DDR Port 1, DDR Port 2, DDR Port 3, DDR Port 4, DDR Port5, DDR Port7 are enabled automatically by the peripheral clock enable bit of the IP on the corresponding bus. - * |[5] |DDR6CKEN |DDR Port6 Clock Enable Bit (Write Protect) - * | | |0 = DDR Port6 peripheral clock Disabled. - * | | |1 = DDR Port6 peripheral clock Enabled. - * | | |Note 1: This bit is write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: The peripheral clock of DDR Port 1, DDR Port 2, DDR Port 3, DDR Port 4, DDR Port5, DDR Port7 are enabled automatically by the peripheral clock enable bit of the IP on the corresponding bus. - * |[8] |CANFD0CKEN|CANFD0 Clock Enable Bit - * | | |0 = CANFD0 clock Disabled. - * | | |1 = CANFD0 clock Enabled. - * |[9] |CANFD1CKEN|CANFD1 Clock Enable Bit - * | | |0 = CANFD1 clock Disabled. - * | | |1 = CANFD1 clock Enabled. - * |[10] |CANFD2CKEN|CANFD2 Clock Enable Bit - * | | |0 = CANFD2 clock Disabled. - * | | |1 = CANFD2 clock Enabled. - * |[11] |CANFD3CKEN|CANFD3 Clock Enable Bit - * | | |0 = CANFD3 clock Disabled. - * | | |1 = CANFD3 clock Enabled. - * |[16] |SDH0EN |SD0 Host Controller AHB clock Enable Bit - * | | |0 = SDH0 controller AHB clock Disabled. - * | | |1 = SDH0 controller AHB clock Enabled. - * |[17] |SDH1EN |SD1 Host Controller AHB clock Enable Bit - * | | |0 = SDH1 controller AHB clock Disabled. - * | | |1 = SDH1 controller AHB clock Enabled. - * |[18] |NANDEN |NAND Controller Clock Enable Bit - * | | |0 = NAND controller clock Disabled. - * | | |1 = NAND controller clock Enabled. - * |[19] |USBDEN |USBD Clock Enable Bit - * | | |0 = USBD clock Disabled. - * | | |1 = USBD clock Enabled. - * |[20] |USBHEN |USBH Clock Enable Bit (TZNS) - * | | |0 = USBH clock Disabled. - * | | |1 = USBH clock Enabled. - * |[21] |HUSBH0EN |High Speed USBH Clock Enable Bit (TZNS) - * | | |0 = HUSBH0 clock Disabled. - * | | |1 = HUSBH0 clock Enabled. - * |[22] |HUSBH1EN |High Speed USBH Clock Enable Bit (TZNS) - * | | |0 = HUSBH1 clock Disabled. - * | | |1 = HUSBH1 clock Enabled. - * |[24] |GFXEN |GFX Clock Enable Bit (TZNS) - * | | |0 = GFX clock Disabled. - * | | |1 = GFX clock Enabled. - * |[25] |VDECEN |VC8000 Clock Enable Bit (TZNS) - * | | |0 = VC8000 clock Disabled. - * | | |1 = VC8000 clock Enabled. - * |[26] |DCUEN |DC Ultra Clock Enable Bit (TZNS) - * | | |0 = DC Ultra clock Disabled. - * | | |1 = DC Ultra clock Enabled. - * |[27] |GMAC0EN |Gigabit Ethernet MAC 0 AXI Clock Enable Bit (TZNS) - * | | |0 = Gigabit Ethernet MAC 0 AXI clock Disabled. - * | | |1 = Gigabit Ethernet MAC 0 AXI clock Enabled. - * |[28] |GMAC1EN |Gigabit Ethernet MAC 1 AXI Clock Enable Bit (TZNS) - * | | |0 = Gigabit Ethernet MAC 1 AXI clock Disabled. - * | | |1 = Gigabit Ethernet MAC 1 AXI clock Enabled. - * |[29] |CCAP0EN |CCAP0 Clock Enable Bit (TZNS) - * | | |0 = CCAP0 clock Disabled. - * | | |1 = CCAP0 clock Enabled. - * |[30] |CCAP1EN |CCAP1 Clock Enable Bit (TZNS) - * | | |0 = CCAP1 clock Disabled. - * | | |1 = CCAP1 clock Enabled. - * @var CLK_T::SYSCLK1 - * Offset: 0x08 AXI and AHB Device Clock Enable Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDMA0EN |PDMA0 Controller Clock Enable Bit - * | | |0 = PDMA0 peripheral clock Disabled. - * | | |1 = PDMA0 peripheral clock Enabled. - * |[1] |PDMA1EN |PDMA1 Controller Clock Enable Bit - * | | |0 = PDMA1 peripheral clock Disabled. - * | | |1 = PDMA1 peripheral clock Enabled. - * |[2] |PDMA2EN |PDMA2 Controller Clock Enable Bit - * | | |0 = PDMA2 peripheral clock Disabled. - * | | |1 = PDMA2 peripheral clock Enabled. - * |[3] |PDMA3EN |PDMA3 Controller Clock Enable Bit - * | | |0 = PDMA3 peripheral clock Disabled. - * | | |1 = PDMA3 peripheral clock Enabled. - * |[4] |WH0CKEN |Wormhole 0 Peripheral Clock Enable Bit (Write Protect, TZNS) - * | | |0 = Wormhole 0 clock Disabled. - * | | |1 = Wormhole 0 clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZNS register. - * |[5] |WH1CKEN |Wormhole 1 Peripheral Clock Enable Bit (Write Protect) - * | | |0 = Wormhole 1 clock Disabled. - * | | |1 = Wormhole 1 clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[6] |HWSCKEN |Hardware Semaphore Clock Enable Bit (Write Protect, TZNS) - * | | |0 = Hardware Semaphore peripheral clock Disabled. - * | | |1 = Hardware Semaphore clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZNS register. - * |[7] |EBICKEN |EBI Controller Clock Enable Bit - * | | |0 = EBI peripheral clock Disabled. - * | | |1 = EBI peripheral clock Enabled. - * |[8] |SRAM0CKEN |SRAM Bank0 Controller Clock Enable Bit (Write Protect) - * | | |0 = SRAM bank0 clock Disabled. - * | | |1 = SRAM bank0 clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[9] |SRAM1CKEN |SRAM Bank1 Controller Clock Enable Bit (Write Protect) - * | | |0 = SRAM bank1 clock Disabled. - * | | |1 = SRAM bank1 clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[10] |ROMCKEN |ROM AHB Clock Enable Bit (Write Protect) - * | | |0 = ROM AHB clock Disabled. - * | | |1 = ROM AHB clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[11] |TRACKEN |Coresight Trace Clock Enable Bit (Write Protect) - * | | |0 = Coresight trace clock Disabled. - * | | |1 = Coresight trace clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[12] |DBGCKEN |Coresight Debug Clock Enable Bit (Write Protect) - * | | |0 = Coresight debug clock Disabled. - * | | |1 = Coresight debug clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[13] |CLKOCKEN |CLKO Clock Enable Bit (Write Protect) - * | | |0 = CLKO clock Disabled. - * | | |1 = CLKO clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[14] |GTMRCKEN |Cortex A35 Generic Timer Clock Enable Bit (Write Protect) - * | | |0 = Cortex A35 Generic timer clock Disabled. - * | | |1 = Cortex A35 Generic timer clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[16] |GPACKEN |GPIOA AHB Clock Enable Bit - * | | |0 = GPIOA port clock Disabled. - * | | |1 = GPIOA port clock Enabled. - * |[17] |GPBCKEN |GPIOB AHB Clock Enable Bit - * | | |0 = GPIOB port clock Disabled. - * | | |1 = GPIOB port clock Enabled. - * |[18] |GPCCKEN |GPIOC AHB Clock Enable Bit - * | | |0 = GPIOC port clock Disabled. - * | | |1 = GPIOC port clock Enabled. - * |[19] |GPDCKEN |GPIOD AHB Clock Enable Bit - * | | |0 = GPIOD port clock Disabled. - * | | |1 = GPIOD port clock Enabled. - * |[20] |GPECKEN |GPIOE AHB Clock Enable Bit - * | | |0 = GPIOE port clock Disabled. - * | | |1 = GPIOE port clock Enabled. - * |[21] |GPFCKEN |GPIOF AHB Clock Enable Bit - * | | |0 = GPIOF port clock Disabled. - * | | |1 = GPIOF port clock Enabled. - * |[22] |GPGCKEN |GPIOG AHB Clock Enable Bit - * | | |0 = GPIOG port clock Disabled. - * | | |1 = GPIOG port clock Enabled. - * |[23] |GPHCKEN |GPIOH AHB Clock Enable Bit - * | | |0 = GPIOH port clock Disabled. - * | | |1 = GPIOH port clock Enabled. - * |[24] |GPICKEN |GPIOI AHB Clock Enable Bit - * | | |0 = GPIOI port clock Disabled. - * | | |1 = GPIOI port clock Enabled. - * |[25] |GPJCKEN |GPIOJ AHB Clock Enable Bit - * | | |0 = GPIOJ port clock Disabled. - * | | |1 = GPIOJ port clock Enabled. - * |[26] |GPKCKEN |GPIOK AHB Clock Enable Bit - * | | |0 = GPIOK port clock Disabled. - * | | |1 = GPIOK port clock Enabled. - * |[27] |GPLCKEN |GPIOL AHB Clock Enable Bit - * | | |0 = GPIOL port clock Disabled. - * | | |1 = GPIOL port clock Enabled. - * |[28] |GPMCKEN |GPIOM AHB Clock Enable Bit - * | | |0 = GPIOM port clock Disabled. - * | | |1 = GPIOM port clock Enabled. - * |[29] |GPNCKEN |GPION AHB Clock Enable Bit - * | | |0 = GPION port clock Disabled. - * | | |1 = GPION port clock Enabled. - * @var CLK_T::APBCLK0 - * Offset: 0x0C APB Devices Clock Enable Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TMR0CKEN |Timer0 Clock Enable Bit - * | | |0 = Timer0 clock Disabled. - * | | |1 = Timer0 clock Enabled. - * |[1] |TMR1CKEN |Timer1 Clock Enable Bit - * | | |0 = Timer1 clock Disabled. - * | | |1 = Timer1 clock Enabled. - * |[2] |TMR2CKEN |Timer2 Clock Enable Bit - * | | |0 = Timer2 clock Disabled. - * | | |1 = Timer2 clock Enabled. - * |[3] |TMR3CKEN |Timer3 Clock Enable Bit - * | | |0 = Timer3 clock Disabled. - * | | |1 = Timer3 clock Enabled. - * |[4] |TMR4CKEN |Timer4 Clock Enable Bit - * | | |0 = Timer4 clock Disabled. - * | | |1 = Timer4 clock Enabled. - * |[5] |TMR5CKEN |Timer5 Clock Enable Bit - * | | |0 = Timer5 clock Disabled. - * | | |1 = Timer5 clock Enabled. - * |[6] |TMR6CKEN |Timer6 Clock Enable Bit - * | | |0 = Timer6 clock Disabled. - * | | |1 = Timer6 clock Enabled. - * |[7] |TMR7CKEN |Timer7 Clock Enable Bit - * | | |0 = Timer7 clock Disabled. - * | | |1 = Timer7 clock Enabled. - * |[8] |TMR8CKEN |Timer8 Clock Enable Bit - * | | |0 = Timer8 clock Disabled. - * | | |1 = Timer8 clock Enabled. - * |[9] |TMR9CKEN |Timer9 Clock Enable Bit - * | | |0 = Timer9 clock Disabled. - * | | |1 = Timer9 clock Enabled. - * |[10] |TMR10CKEN |Timer10 Clock Enable Bit - * | | |0 = Timer10 clock Disabled. - * | | |1 = Timer10 clock Enabled. - * |[11] |TMR11CKEN |Timer11 Clock Enable Bit - * | | |0 = Timer11 clock Disabled. - * | | |1 = Timer11 clock Enabled. - * |[12] |UART0CKEN |UART0 Clock Enable Bit - * | | |0 = UART0 clock Disabled. - * | | |1 = UART0 clock Enabled. - * |[13] |UART1CKEN |UART1 Clock Enable Bit - * | | |0 = UART1 clock Disabled. - * | | |1 = UART1 clock Enabled. - * |[14] |UART2CKEN |UART2 Clock Enable Bit - * | | |0 = UART2 clock Disabled. - * | | |1 = UART2 clock Enabled. - * |[15] |UART3CKEN |UART3 Clock Enable Bit - * | | |0 = UART3 clock Disabled. - * | | |1 = UART3 clock Enabled. - * |[16] |UART4CKEN |UART4 Clock Enable Bit - * | | |0 = UART4 clock Disabled. - * | | |1 = UART4 clock Enabled. - * |[17] |UART5CKEN |UART5 Clock Enable Bit - * | | |0 = UART5 clock Disabled. - * | | |1 = UART5 clock Enabled. - * |[18] |UART6CKEN |UART6 Clock Enable Bit - * | | |0 = UART6 clock Disabled. - * | | |1 = UART6 clock Enabled. - * |[19] |UART7CKEN |UART7 Clock Enable Bit - * | | |0 = UART7 clock Disabled. - * | | |1 = UART7 clock Enabled. - * |[20] |UART8CKEN |UART8 Clock Enable Bit - * | | |0 = UART8 clock Disabled. - * | | |1 = UART8 clock Enabled. - * |[21] |UART9CKEN |UART9 Clock Enable Bit - * | | |0 = UART9 clock Disabled. - * | | |1 = UART9 clock Enabled. - * |[22] |UART10CKEN|UART10 Clock Enable Bit - * | | |0 = UART10 clock Disabled. - * | | |1 = UART10 clock Enabled. - * |[23] |UART11CKEN|UART11 Clock Enable Bit - * | | |0 = UART11 clock Disabled. - * | | |1 = UART11 clock Enabled. - * |[24] |UART12CKEN|UART12 Clock Enable Bit - * | | |0 = UART12 clock Disabled. - * | | |1 = UART12 clock Enabled. - * |[25] |UART13CKEN|UART13 Clock Enable Bit - * | | |0 = UART13 clock Disabled. - * | | |1 = UART13 clock Enabled. - * |[26] |UART14CKEN|UART14 Clock Enable Bit - * | | |0 = UART14 clock Disabled. - * | | |1 = UART14 clock Enabled. - * |[27] |UART15CKEN|UART15 Clock Enable Bit - * | | |0 = UART15 clock Disabled. - * | | |1 = UART15 clock Enabled. - * |[28] |UART16CKEN|UART16 Clock Enable Bit - * | | |0 = UART16 clock Disabled. - * | | |1 = UART16 clock Enabled. - * |[29] |RTCCKEN |RTC Clock Enable Bit (Shared) - * | | |0 = RTC Clock Disabled. - * | | |1 = RTC Clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[30] |DDRPCKEN |DDR PHY Utility Block Clock Enable Bit - * | | |0 = DDR PHY utility clock Disabled. - * | | |1 = DDR PHY utility clock Enabled. - * |[31] |KPICKEN |Keypad Interface Clock Enable Bit - * | | |0 = Keypad interface clock Disabled. - * | | |1 = Keypad interface clock Enabled. - * @var CLK_T::APBCLK1 - * Offset: 0x10 APB Devices Clock Enable Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2C0CKEN |I2C0 Clock Enable Bit - * | | |0 = I2C0 clock Disabled. - * | | |1 = I2C0 clock Enabled. - * |[1] |I2C1CKEN |I2C1 Clock Enable Bit - * | | |0 = I2C1 clock Disabled. - * | | |1 = I2C1 clock Enabled. - * |[2] |I2C2CKEN |I2C2 Clock Enable Bit - * | | |0 = I2C2 clock Disabled. - * | | |1 = I2C2 clock Enabled. - * |[3] |I2C3CKEN |I2C3 Clock Enable Bit - * | | |0 = I2C3 clock Disabled. - * | | |1 = I2C3 clock Enabled. - * |[4] |I2C4CKEN |I2C4 Clock Enable Bit - * | | |0 = I2C4 clock Disabled. - * | | |1 = I2C4 clock Enabled. - * |[5] |I2C5CKEN |I2C5 Clock Enable Bit - * | | |0 = I2C5 clock Disabled. - * | | |1 = I2C5 clock Enabled. - * |[6] |QSPI0CKEN |QSPI0 Clock Enable Bit - * | | |0 = QSPI0 clock Disabled. - * | | |1 = QSPI0 clock Enabled. - * |[7] |QSPI1CKEN |QSPI1 Clock Enable Bit - * | | |0 = QSPI1 clock Disabled. - * | | |1 = QSPI1 clock Enabled. - * |[12] |SC0CKEN |SC0 Clock Enable Bit - * | | |0 = SC0 clock Disabled. - * | | |1 = SC0 clock Enabled. - * |[13] |SC1CKEN |SC1 Clock Enable Bit - * | | |0 = SC1 clock Disabled. - * | | |1 = SC1 clock Enabled. - * |[16] |WDT0CKEN |Watchdog Timer 0 Clock Enable Bit (Write Protect) - * | | |0 = Watchdog timer 0 clock Disabled. - * | | |1 = Watchdog timer 0 clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[17] |WDT1CKEN |Watchdog Timer 1 Clock Enable Bit (Write Protect) - * | | |0 = Watchdog timer 1 clock Disabled. - * | | |1 = Watchdog timer 1 clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register or SYS_RLKTZNS register. - * |[18] |WDT2CKEN |Watchdog Timer 2 Clock Enable Bit (Write Protect, SUBM) - * | | |0 = Watchdog timer 2 clock Disabled. - * | | |1 = Watchdog timer 2 clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKSUBM register. - * |[24] |EPWM0CKEN |EPWM0 Clock Enable Bit - * | | |0 = EPWM0 clock Disabled. - * | | |1 = EPWM0 clock Enabled. - * |[25] |EPWM1CKEN |EPWM1 Clock Enable Bit - * | | |0 = EPWM1 clock Disabled. - * | | |1 = EPWM1 clock Enabled. - * |[26] |EPWM2CKEN |EPWM2 Clock Enable Bit - * | | |0 = EPWM2 clock Disabled. - * | | |1 = EPWM2 clock Enabled. - * @var CLK_T::APBCLK2 - * Offset: 0x14 APB Devices Clock Enable Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2S0CKEN |I2S0 Clock Enable Bit - * | | |0 = I2S0 Clock Disabled. - * | | |1 = I2S0 Clock Enabled. - * |[1] |I2S1CKEN |I2S1 Clock Enable Bit - * | | |0 = I2S1 Clock Disabled. - * | | |1 = I2S1 Clock Enabled. - * |[2] |SSMCCEN |SSMCC Clock Enable Bit (Write Protect) - * | | |0 = SSMCC clock Disabled. - * | | |1 = SSMCC clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[3] |SSPCCEN |SSPCC Clock Enable Bit (Write Protect) - * | | |0 = SSPCC clock Disabled. - * | | |1 = SSPCC clock Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[4] |SPI0CKEN |SPI0 Clock Enable Bit - * | | |0 = SPI0 clock Disabled. - * | | |1 = SPI0 clock Enabled. - * |[5] |SPI1CKEN |SPI1 Clock Enable Bit - * | | |0 = SPI1 clock Disabled. - * | | |1 = SPI1 clock Enabled. - * |[6] |SPI2CKEN |SPI2 Clock Enable Bit - * | | |0 = SPI2 clock Disabled. - * | | |1 = SPI2 clock Enabled. - * |[7] |SPI3CKEN |SPI3 Clock Enable Bit - * | | |0 = SPI3 clock Disabled. - * | | |1 = SPI3 clock Enabled. - * |[8] |ECAP0CKEN |ECAP0 Clock Enable Bit - * | | |0 = ECAP0 clock Disabled. - * | | |1 = ECAP0 clock Enabled. - * |[9] |ECAP1CKEN |ECAP1 Clock Enable Bit - * | | |0 = ECAP1 clock Disabled. - * | | |1 = ECAP1 clock Enabled. - * |[10] |ECAP2CKEN |ECAP2 Clock Enable Bit - * | | |0 = ECAP2 clock Disabled. - * | | |1 = ECAP2 clock Enabled. - * |[12] |QEI0CKEN |QEI0 Clock Enable Bit - * | | |0 = QEI0 clock Disabled. - * | | |1 = QEI0 clock Enabled. - * |[13] |QEI1CKEN |QEI1 Clock Enable Bit - * | | |0 = QEI1 clock Disabled. - * | | |1 = QEI1 clock Enabled. - * |[14] |QEI2CKEN |QEI2 Clock Enable Bit - * | | |0 = QEI2 clock Disabled. - * | | |1 = QEI2 clock Enabled. - * |[24] |ADCCKEN |ADC Clock Enable Bit - * | | |0 = ADC clock Disabled. - * | | |1 = ADC clock Enabled. - * |[25] |EADCCKEN |EADC Clock Enable Bit - * | | |0 = EADC clock Disabled. - * | | |1 = EADC clock Enabled. - * @var CLK_T::CLKSEL0 - * Offset: 0x18 Clock Source Select Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CA35CKSEL |Cortex A35 CPU Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |00 = Clock source from HXT. - * | | |01 = Clock source from CA-PLL. - * | | |10 = Clock source from EPLL. - * | | |11 = Clock source from APLL. - * | | |Note 2: These bits are write protected. Refer to the SYS_RLKTZS register. - * |[2] |SYSCK0SEL |System Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |0 = Clock source from EPLL/2. - * | | |1 = Clock source from SYS-PLL. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZS register. - * |[3] |LVRDBSEL |LVR Debounce Clock Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |0 = Clock source from LIRC. - * | | |1 = Clock source from HIRC. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZS register. - * |[5:4] |SYSCK1SEL |System Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |00 = Clock source from HXT. - * | | |01 = Clock source from SYS-PLL. - * | | |10 = Clock source from APLL. - * | | |11 = Clock source from APLL. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZS register. - * |[10:8] |RTPSTSEL |RTP CortexM4 SysTick Clock Source Selection (Write Protect, SUBM) - * | | |If SYST_CTRL[2]=0, SysTick uses listed clock source below. - * | | |000 = Clock source from HXT. - * | | |001 = Clock source from LXT. - * | | |010 = Clock source from HXT/2. - * | | |011 = Clock source from SYSCLK1/2. - * | | |Others = Clock source from HIRC. - * | | |Note 1: if SysTick clock source is not from HCLK (i.e - * | | |SYST_CTRL[2] = 0), SysTick need clock frequency must less than or equal to HCLK/2. - * | | |Note 2: These bits are write protected. Refer to the SYS_RLKSUBM register. - * |[13:12] |CCAP0SEL |CCAP0 Sensor Clock Source Selection (TZNS) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |00 = Clock source from HXT. - * | | |01 = Clock source from VPLL. - * | | |10 = Clock source from APLL. - * | | |11 = Clock source from SYS-PLL. - * |[15:14] |CCAP1SEL |CCAP1 Sensor Clock Source Selection (TZNS) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |00 = Clock source from HXT. - * | | |01 = Clock source from VPLL. - * | | |10 = Clock source from APLL. - * | | |11 = Clock source from SYS-PLL. - * |[17:16] |SD0SEL |SD HOST0 Controller Core Logic Clock Source Selection - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |00 = Clock source from APLL. - * | | |01 = Clock source from VPLL. - * | | |10 = Clock source from SYS-PLL. - * | | |11 = Clock source from SYS-PLL. - * |[19:18] |SD1SEL |SD HOST1 Controller Core Logic Clock Source Selection - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |00 = Clock source from APLL. - * | | |01 = Clock source from VPLL. - * | | |10 = Clock source from SYS-PLL. - * | | |11 = Clock source from SYS-PLL. - * |[24] |DCUSEL |Display Controller Ultra Core Clock Source Selection (TZNS) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |0 = Clock source from EPLL/2. - * | | |1 = Clock source from SYS-PLL. - * |[25] |DCUPSEL |Display Controller Ultra Pixel Clock Source Selection (TZNS) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |0 = Clock source from VPLL. - * | | |1 = Clock source from APLL. - * |[26] |GFXSEL |GFX Core Clock Source Selection (TZNS) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |0 = Clock source from EPLL. - * | | |1 = Clock source from SYS-PLL. - * |[27] |DBGSEL |Coresight DBG Clock Source Selection (Write Protect) - * | | |Before clock switching, the related clock sources (both pre-select and new-select) must be turned on. - * | | |0 = Clock source from HIRC.1. - * | | |1 = Clock source from SYS-PLL. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * @var CLK_T::CLKSEL1 - * Offset: 0x1C Clock Source Select Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TMR0SEL |TIMER0 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM0 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[6:4] |TMR1SEL |TIMER1 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM1 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[10:8] |TMR2SEL |TIMER2 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM2 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[14:12] |TMR3SEL |TIMER3 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM3 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[18:16] |TMR4SEL |TIMER4 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK2. - * | | |011 = Clock source from external clock TM4 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[22:20] |TMR5SEL |TIMER5 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK2. - * | | |011 = Clock source from external clock TM5 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[26:24] |TMR6SEL |TIMER6 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM6 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[30:28] |TMR7SEL |TIMER7 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK0. - * | | |011 = Clock source from external clock TM7 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * @var CLK_T::CLKSEL2 - * Offset: 0x20 Clock Source Select Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TMR8SEL |TIMER8 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM8 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[6:4] |TMR9SEL |TIMER9 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK1. - * | | |011 = Clock source from external clock TM9 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[10:8] |TMR10SEL |TIMER10 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK2. - * | | |011 = Clock source from external clock TM10 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[14:12] |TMR11SEL |TIMER11 Clock Source Selection - * | | |000 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |001 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |010 = Clock source from PCLK2. - * | | |011 = Clock source from external clock TM11 pin. - * | | |101 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |111 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * | | |Others = Reserved. - * |[17:16] |UART0SEL |UART0 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[19:18] |UART1SEL |UART1 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[21:20] |UART2SEL |UART2 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[23:22] |UART3SEL |UART3 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[25:24] |UART4SEL |UART4 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[27:26] |UART5SEL |UART5 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[29:28] |UART6SEL |UART6 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[31:30] |UART7SEL |UART7 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * @var CLK_T::CLKSEL3 - * Offset: 0x24 Clock Source Select Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |UART8SEL |UART8 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[3:2] |UART9SEL |UART6 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[5:4] |UART10SEL |UART10 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[7:6] |UART11SEL |UART11 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[9:8] |UART12SEL |UART12 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[11:10] |UART13SEL |UART13 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[13:12] |UART14SEL |UART14 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[15:14] |UART15SEL |UART15 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[17:16] |UART16SEL |UART16 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from SYSCLK1/2. - * | | |10 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[21:20] |WDT0SEL |Watchdog Timer Clock Source Selection (Write Protect) - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from PCLK3/4096. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZS register. - * |[23:22] |WWDT0SEL |Window Watchdog Timer Clock Source Selection (Write Protect) - * | | |10 = Clock source from PCLK3/4096. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZS register. - * |[25:24] |WDT1SEL |Watchdog Timer Clock Source Selection (Write Protect) - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from PCLK3/4096. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZNS register or SYS_RLKTZS register. - * |[27:26] |WWDT1SEL |Window Watchdog Timer Clock Source Selection (Write Protect) - * | | |10 = Clock source from PCLK3/4096. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZNS register or SYS_RLKTZS register. - * |[29:28] |WDT2SEL |Watchdog Timer Clock Source Selection (Write Protect, SUBM) - * | | |01 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * | | |10 = Clock source from PCLK4/4096. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZNS register. - * |[31:30] |WWDT2SEL |Window Watchdog Timer Clock Source Selection (Write Protect, SUBM) - * | | |10 = Clock source from PCLK4/4096. - * | | |11 = Clock source from 32 kHz internal low speed RC oscillator (LIRC). - * | | |Others = Reserved. - * | | |Note: These bits are write protected. Refer to the SYS_RLKTZNS register. - * @var CLK_T::CLKSEL4 - * Offset: 0x28 Clock Source Select Control Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SPI0SEL |SPI3 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from EPLL/4. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[3:2] |SPI1SEL |SPI1 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from EPLL/4. - * | | |10 = Clock source from PCLK2. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[5:4] |SPI2SEL |SPI2 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from EPLL/4. - * | | |10 = Clock source from PCLK1. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[7:6] |SPI3SEL |SPI3 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from EPLL/4. - * | | |10 = Clock source from PCLK2. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[9:8] |QSPI0SEL |QSPI0 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from EPLL/4. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[11:10] |QSPI1SEL |QSPI1 Clock Source Selection - * | | |00 = Clock source from 24 MHz external high speed crystal oscillator (HXT). - * | | |01 = Clock source from EPLL/4. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from 12 MHz internal high speed RC oscillator (HIRC). - * |[13:12] |I2S0SEL |I2S0 Clock Source Selection - * | | |00 = Clock source from HXT clock. - * | | |01 = Clock source from APLL clock. - * | | |10 = Clock source from PCLK0. - * | | |11 = Clock source from HIRC clock. - * |[15:14] |I2S1SEL |I2S1 Clock Source Selection - * | | |00 = Clock source from HXT clock. - * | | |01 = Clock source from APLL clock. - * | | |10 = Clock source from PCLK2. - * | | |11 = Clock source from HIRC clock. - * |[16] |CANFD0SEL |CANFD0 Clock Source Selection - * | | |0 = Clock source from APLL clock. - * | | |1 = Clock source from VPLL clock. - * |[17] |CANFD1SEL |CANFD1 Clock Source Selection - * | | |0 = Clock source from APLL clock. - * | | |1 = Clock source from VPLL clock. - * |[18] |CANFD2SEL |CANFD2 Clock Source Selection - * | | |0 = Clock source from APLL clock. - * | | |1 = Clock source from VPLL clock. - * |[19] |CANFD3SEL |CANFD3 Clock Source Selection - * | | |0 = Clock source from APLL clock. - * | | |1 = Clock source from VPLL clock. - * |[27:24] |CKOSEL |Reference Clock Our Source Selection - * | | |This field selects which clock is used to be the source of reference clock output - * | | |0000 = Clock source from HXT. - * | | |0001 = Clock source from LXT. - * | | |0010 = Clock source from HIRC. - * | | |0011 = Clock source from LIRC. - * | | |0100 = Reserved.. - * | | |0101 = Clock source from SYS-PLL. - * | | |0110 = Clock source from DDR core CLK. - * | | |0111 = Clock source from EPLL/4. - * | | |1000 = Clock source from APLL. - * | | |1001 = Clock source from VPLL. - * | | |1010 = Clock source from CA CLK. - * | | |1011 = Clock source from AXI0 ACLK. - * | | |1100 = Clock source from SYSCLK0. - * | | |1101 = Clock source from SYSCLK1. - * | | |1110 = Clock source from PCLK3. - * | | |1111 = Clock source from PCLK4. - * | | |Others = Reserved. - * |[28] |SC0SEL |Smart Card 0 Clock Source Selection - * | | |0 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |1 = Clock source from PCLK4. - * |[29] |SC1SEL |Smart Card 1 Clock Source Selection - * | | |0 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |1 = Clock source from PCLK4. - * |[30] |KPISEL |Key Pad Interface Clock Source Selection - * | | |0 = Clock source from 4~24 MHz external high speed crystal oscillator (HXT). - * | | |1 = Clock source from 32.768 kHz external low speed crystal oscillator (LXT). - * @var CLK_T::CLKDIV0 - * Offset: 0x2C Clock Divider Number Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CANFD0DIV |CANFD0 Clock Divide Number From CANFD0 Clock Source - * | | |00 = Clock source from CANFD0 Clock Source /2. - * | | |01 = Clock source from CANFD0 Clock Source /4. - * | | |10 = Clock source from CANFD0 Clock Source /8. - * | | |11 = Clock source from CANFD0 Clock Source /16. - * |[3:2] |CANFD1DIV |CANFD1 Clock Divide Number From CANFD1 Clock Source - * | | |00 = Clock source from CANFD1 Clock Source /2. - * | | |01 = Clock source from CANFD1 Clock Source /4. - * | | |10 = Clock source from CANFD1 Clock Source /8. - * | | |11 = Clock source from CANFD1 Clock Source /16. - * |[5:4] |CANFD2DIV |CANFD2 Clock Divide Number From CANFD2 Clock Source - * | | |00 = Clock source from CANFD2 Clock Source /2. - * | | |01 = Clock source from CANFD2 Clock Source /4. - * | | |10 = Clock source from CANFD2 Clock Source /8. - * | | |11 = Clock source from CANFD2 Clock Source /16. - * |[7:6] |CANFD3DIV |CANFD3 Clock Divide Number From CANFD3 Clock Source - * | | |00 = Clock source from CANFD3 Clock Source /2. - * | | |01 = Clock source from CANFD3 Clock Source /4. - * | | |10 = Clock source from CANFD3 Clock Source /8. - * | | |11 = Clock source from CANFD3 Clock Source /16. - * |[25:24] |DCUPDIV |Display Controller Ultra Pixel Divided Clock Source (Read Only) - * | | |00 = Clock source from Display Controller Ultra Pixel Clock Source /2. - * | | |01 = Clock source from Display Controller Ultra Pixel Clock Source /4. - * | | |10 = Clock source from Display Controller Ultra Pixel Clock Source /8. - * | | |11 = Clock source from Display Controller Ultra Pixel Clock Source /16. - * |[26] |ACLK0DIV |AXI0 Bus Clock Divide Number From CA-PLL Clock Source (Write Protect) - * | | |0 = Clock source from CA-PLL /2. - * | | |1 = Clock source from CA-PLL /4. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[29:28] |EMAC0DIV |EMAC0 TX Clock Divide Selection From EPLL Clock Source (Read Only) - * | | |00 = Clock source from EPLL /2.(RGMII). - * | | |01 = Clock source from EPLL /2.(RGMII). - * | | |10 = Clock source from EPLL /100 (RGMII). - * | | |11 = Clock source from EPLL /10 (RGMII). - * | | |X0 = Clock source from RMII reference clock /20 (RMII). - * | | |X1 = Clock source from RMII reference clock /2 (RMII). - * | | |Others = Reserved. - * | | |Note: This field definition depends on the Ethernet mac is RMII or not. - * |[31:30] |EMAC1DIV |EMAC1 TX Clock Divide Selection From EPLL Clock Source (Read Only) - * | | |00 = Clock source from EPLL /2.(RGMII). - * | | |01 = Clock source from EPLL /2.(RGMII). - * | | |10 = Clock source from EPLL /100 (RGMII). - * | | |11 = Clock source from EPLL /10 (RGMII). - * | | |X0 = Clock source from RMII reference clock /20 (RMII). - * | | |X1 = Clock source from RMII reference clock /2 (RMII). - * | | |Others = Reserved. - * | | |Note: This field definition depends on the Ethernet mac is RMII or not. - * @var CLK_T::CLKDIV1 - * Offset: 0x30 Clock Divider Number Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |SC0DIV |Smart Card 0 Clock Divide Number From SC0 Clock Source - * | | |SC0 clock frequency = (SC0 clock source frequency) / (SC0DIV + 1). - * |[7:4] |SC1DIV |Smart Card 1 Clock Divide Number From SC1 Clock Source - * | | |SC1 clock frequency = (SC1 clock source frequency) / (SC1DIV + 1). - * |[11:8] |CCAP0DIV |CCAP0 Clock Divide Number From CCAP0 Clock Source (TZNS) - * | | |CCAP0 clock frequency = (CCAP0 clock source frequency) / (CCAP0DIV + 1). - * |[15:12] |CCAP1DIV |CCAP1 Clock Divide Number From CCAP1 Clock Source (TZNS) - * | | |CCAP1 clock frequency = (CCAP1 clock source frequency) / (CCAP1DIV + 1). - * |[19:16] |UART0DIV |UART0 Clock Divide Number From UART0 Clock Source - * | | |UART0 clock frequency = (UART0 clock source frequency) / (UART0DIV + 1). - * |[23:20] |UART1DIV |UART1 Clock Divide Number From UART1 Clock Source - * | | |UART1 clock frequency = (UART1 clock source frequency) / (UART1DIV + 1). - * |[27:24] |UART2DIV |UART2 Clock Divide Number From UART2 Clock Source - * | | |UART2 clock frequency = (UART2 clock source frequency) / (UART2DIV + 1). - * |[31:28] |UART3DIV |UART3 Clock Divide Number From UART3 Clock Source - * | | |UART3 clock frequency = (UART3 clock source frequency) / (UART3DIV + 1). - * @var CLK_T::CLKDIV2 - * Offset: 0x34 Clock Divider Number Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |UART4DIV |UART4 Clock Divide Number From UART4 Clock Source - * | | |UART4 clock frequency = (UART4 clock source frequency) / (UART4DIV + 1). - * |[7:4] |UART5DIV |UART5 Clock Divide Number From UART5 Clock Source - * | | |UART5 clock frequency = (UART5 clock source frequency) / (UART5DIV + 1). - * |[11:8] |UART6DIV |UART6 Clock Divide Number From UART6 Clock Source - * | | |UART6 clock frequency = (UART6 clock source frequency) / (UART6DIV + 1). - * |[15:12] |UART7DIV |UART7 Clock Divide Number From UART7 Clock Source - * | | |UART7 clock frequency = (UART7 clock source frequency) / (UART7DIV + 1). - * |[19:16] |UART8DIV |UART8 Clock Divide Number From UART8 Clock Source - * | | |UART8 clock frequency = (UART8 clock source frequency) / (UART8DIV + 1). - * |[23:20] |UART9DIV |UART9 Clock Divide Number From UART9 Clock Source - * | | |UART9 clock frequency = (UART9 clock source frequency) / (UART9DIV + 1). - * |[27:24] |UART10DIV |UART10 Clock Divide Number From UART10 Clock Source - * | | |UART10 clock frequency = (UART10 clock source frequency) / (UART10DIV + 1). - * |[31:28] |UART11DIV |UART11 Clock Divide Number From UART11 Clock Source - * | | |UART11 clock frequency = (UART11 clock source frequency) / (UART11DIV + 1). - * @var CLK_T::CLKDIV3 - * Offset: 0x38 Clock Divider Number Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |UART12DIV |UART12 Clock Divide Number From UART12 Clock Source - * | | |UART12 clock frequency = (UART12 clock source frequency) / (UART12DIV + 1). - * |[7:4] |UART13DIV |UART13 Clock Divide Number From UART13 Clock Source - * | | |UART13 clock frequency = (UART13 clock source frequency) / (UART13DIV + 1). - * |[11:8] |UART14DIV |UART14 Clock Divide Number From UART14 Clock Source - * | | |UART14 clock frequency = (UART14 clock source frequency) / (UART14DIV + 1). - * |[15:12] |UART15DIV |UART15 Clock Divide Number From UART15 Clock Source - * | | |UART15 clock frequency = (UART15 clock source frequency) / (UART15DIV + 1). - * |[19:16] |UART16DIV |UART16 Clock Divide Number From UART16 Clock Source - * | | |UART16 clock frequency = (UART16 clock source frequency) / (UART16DIV + 1). - * @var CLK_T::CLKDIV4 - * Offset: 0x3C Clock Divider Number Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EADCDIV |EADC Clock Divide Number From EADC Clock Source - * | | |EADC clock frequency = (EADC clock source frequency) / (EADCDIV + 1). - * |[20:4] |ADCDIV |ADC Clock Divide Number From ADC Clock Source - * | | |ADC clock frequency = (ADC clock source frequency) / (ADCDIV + 1). - * |[31:24] |KPIDIV |Keypad Interface Clock Divide Number From KPI Clock Source - * | | |KPI clock frequency = (KPI clock source frequency) / (KPIDIV + 1). - * @var CLK_T::CLKOCTL - * Offset: 0x40 Clock Output Control Register (Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |FREQSEL |Clock Output Frequency Selection - * | | |The formula of output frequency is - * | | |Fout = Fin/2(N+1). - * | | |Fin is the input clock frequency. - * | | |Fout is the frequency of divider output clock. - * | | |N is the 4-bit value of FREQSEL [3:0]. - * |[4] |CLKOEN |Clock Output Enable Bit - * | | |0 = Clock Output function Disabled. - * | | |1 = Clock Output function Enabled. - * |[5] |DIV1EN |Clock Output Divide One Enable Bit - * | | |0 = Clock Output will output clock with source frequency divided by FREQSEL. - * | | |1 = Clock Output will output clock with source frequency. - * @var CLK_T::STATUS - * Offset: 0x50 Clock Status Monitor Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTSTB |HXT Clock Source Stable Flag (Read Only) - * | | |0 = 24 MHz external high speed crystal oscillator (HXT) clock is not stable or disabled. - * | | |1 = 24 MHz external high speed crystal oscillator (HXT) clock is stable and enabled. - * |[1] |LXTSTB |LXT Clock Source Stable Flag (Read Only) - * | | |LXT clock source can be selected as external LXT or LIRC32 by setting C32KS(RTC_LXTCTL[6]) - * | | |IfC32KS is set to 0 the LXT stable flag is set when external LXT clock source is stable - * | | |IfC32KS is set to 1 the LXT stable flag is set when LIRC32 clock source is stable. - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is not stable or disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock is stabled and enabled. - * |[2] |SYSPLLSTB |SYS-PLL Clock Source Stable Flag (Read Only) - * | | |0 = SYS-PLL clock is not stable or disabled. - * | | |1 = SYS-PLL clock is stable and enabled. - * |[3] |LIRCSTB |LIRC Clock Source Stable Flag (Read Only) - * | | |0 = 32 kHz internal low speed RC oscillator (LIRC) clock is not stable or disabled. - * | | |1 = 32 kHz internal low speed RC oscillator (LIRC) clock is stable and enabled. - * |[4] |HIRCSTB |HIRC Clock Source Stable Flag (Read Only) - * | | |0 = 12 MHz internal high speed RC oscillator (HIRC) clock is not stable or disabled. - * | | |1 = 12 MHz internal high speed RC oscillator (HIRC) clock is stable and enabled. - * |[6] |CAPLLSTB |Cortex35 PLL Clock Source Stable Flag (Read Only) - * | | |0 = CA-PLL clock is not stable or disabled. - * | | |1 = CA-PLL clock is stable and enabled. - * |[8] |DDRPLLSTB |DDR-PLL Clock Source Stable Flag (Read Only) - * | | |0 = DDR-PLL clock is not stable or disabled. - * | | |1 = DDR-PLL clock is stable and enabled. - * |[9] |EPLLSTB |EPLL Clock Source Stable Flag (Read Only) - * | | |0 = EPLL clock is not stable or disabled. - * | | |1 = EPLL clock is stable and enabled. - * |[10] |APLLSTB |APLL Clock Source Stable Flag (Read Only) - * | | |0 = APLL clock is not stable or disabled. - * | | |1 = APLL clock is stable and enabled. - * |[11] |VPLLSTB |VPLL Clock Source Stable Flag (Read Only) - * | | |0 = VPLL clock is not stable or disabled. - * | | |1 = VPLL clock is stable and enabled. - * @var CLK_T::PLL0CTL0 - * Offset: 0x60 CA-PLL Control Register 0(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Set the feedback divider factor (N) from 16 to 2047. - * | | |The N = FBDIV[10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[17:12] |INDIV |PLL Reference Input Divider Control (Write Protect) - * | | |Set the reference divider factor (M) from 1 to 63. - * | | |The M = INDIV[5:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[19:18] |MODE |Operation Mode Selection(Write Protect) - * | | |00 = Integer mode. - * | | |In this mode, the rising edges of the two clocks at the input of PFD are phase aligned - * | | |And the output clock frequency is at multiples of the input clock frequency contingent on the configuration of OUTDIV, INDIV and FBDIV. - * | | |01 = Fractional mode. - * | | |This mode is suitable for applications which need small output frequency steps, like 20 kHz - * | | |The jitter performance in this mode may be worse than in Integer Mode. - * | | |In this mode, the output clock frequency is at the fractional multiples of the input clock frequency - * | | |By setting the control pins FRAC [23:0], a small output frequency step is achieved.. - * | | |10 = Spread Spectrum Mode. - * | | |This mode is suitable for In this mode the output frequency of PLL will be modulated by triangle wave - * | | |It is for EMI consideration. - * | | |By setting SSRATE [10:0] and SLOPE [23:0], the modulation index and the modulation frequency can be programmed. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[30:20] |SSRATE |Spreading Frequency Control (Write Protect) - * | | |Set the spread step factor SSRATE from 0 to 2047, - * | | |SSRATE = SSRATE [10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL0CTL1 - * Offset: 0x64 CA-PLL Control Register 1(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[1] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock Fref. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[6:4] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Set the output divider factor (P) from 1 to 7. - * | | |P = OUTDIV[2:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[31:8] |FRAC |PLL Fractional Portion of DN Value (Write Protect) - * | | |Set the fraction part (X) of Fractional Portion of DN Value factor. - * | | |The X = FRAC[23:0] / 224. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL0CTL2 - * Offset: 0x68 CA-PLL Control Register 2(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |SLOPE |PLL Stable Counter Selection (Write Protect) - * | | |Set the spread step factor SLOPE from 0 to 16777215, - * | | |SLOPE = SLOPE[23:0]. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL1CTL0 - * Offset: 0x70 SYS-PLL Control Register 0(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Set the feedback divider factor (N) from 16 to 2047. - * | | |The N = FBDIV[10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[17:12] |INDIV |PLL Reference Input Divider Control (Write Protect) - * | | |Set the reference divider factor (M) from 1 to 63. - * | | |The M = INDIV[5:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[19:18] |MODE |Operation Mode Selection(Write Protect) - * | | |00 = Integer mode. - * | | |In this mode, the rising edges of the two clocks at the input of PFD are phase aligned - * | | |And the output clock frequency is at multiples of the input clock frequency contingent on the configuration of OUTDIV, INDIV and FBDIV. - * | | |01 = Fractional mode. - * | | |This mode is suitable for applications which need small output frequency steps, like 20 kHz - * | | |The jitter performance in this mode may be worse than in Integer Mode. - * | | |In this mode, the output clock frequency is at the fractional multiples of the input clock frequency - * | | |By setting the control pins FRAC [23:0], a small output frequency step is achieved.. - * | | |10 = Spread Spectrum Mode. - * | | |This mode is suitable for In this mode the output frequency of PLL will be modulated by triangle wave - * | | |It is for EMI consideration. - * | | |By setting SSRATE [10:0] and SLOPE [23:0], the modulation index and the modulation frequency can be programmed. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[30:20] |SSRATE |Spreading Frequency Control (Write Protect) - * | | |Set the spread step factor SSRATE from 0 to 2047, - * | | |SSRATE = SSRATE [10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL1CTL1 - * Offset: 0x74 SYS-PLL Control Register 1(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[1] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock Fref. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[6:4] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Set the output divider factor (P) from 1 to 7. - * | | |P = OUTDIV[2:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[31:8] |FRAC |PLL Fractional Portion of DN Value (Write Protect) - * | | |Set the fraction part (X) of Fractional Portion of DN Value factor. - * | | |The X = FRAC[23:0] / 224. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL1CTL2 - * Offset: 0x78 SYS-PLL Control Register 2(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |SLOPE |PLL Stable Counter Selection (Write Protect) - * | | |Set the spread step factor SLOPE from 0 to 16777215, - * | | |SLOPE = SLOPE[23:0]. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL2CTL0 - * Offset: 0x80 DDR-PLL Control Register 0(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Set the feedback divider factor (N) from 16 to 2047. - * | | |The N = FBDIV[10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[17:12] |INDIV |PLL Reference Input Divider Control (Write Protect) - * | | |Set the reference divider factor (M) from 1 to 63. - * | | |The M = INDIV[5:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[19:18] |MODE |Operation Mode Selection(Write Protect) - * | | |00 = Integer mode. - * | | |In this mode, the rising edges of the two clocks at the input of PFD are phase aligned - * | | |And the output clock frequency is at multiples of the input clock frequency contingent on the configuration of OUTDIV, INDIV and FBDIV. - * | | |01 = Fractional mode. - * | | |This mode is suitable for applications which need small output frequency steps, like 20 kHz - * | | |The jitter performance in this mode may be worse than in Integer Mode. - * | | |In this mode, the output clock frequency is at the fractional multiples of the input clock frequency - * | | |By setting the control pins FRAC [23:0], a small output frequency step is achieved.. - * | | |10 = Spread Spectrum Mode. - * | | |This mode is suitable for In this mode the output frequency of PLL will be modulated by triangle wave - * | | |It is for EMI consideration. - * | | |By setting SSRATE [10:0] and SLOPE [23:0], the modulation index and the modulation frequency can be programmed. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[30:20] |SSRATE |Spreading Frequency Control (Write Protect) - * | | |Set the spread step factor SSRATE from 0 to 2047, - * | | |SSRATE = SSRATE [10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL2CTL1 - * Offset: 0x84 DDR-PLL Control Register 1(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[1] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock Fref. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[6:4] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Set the output divider factor (P) from 1 to 7. - * | | |P = OUTDIV[2:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[31:8] |FRAC |PLL Fractional Portion of DN Value (Write Protect) - * | | |Set the fraction part (X) of Fractional Portion of DN Value factor. - * | | |The X = FRAC[23:0] / 224. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL2CTL2 - * Offset: 0x88 DDR-PLL Control Register 2(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |SLOPE |PLL Stable Counter Selection (Write Protect) - * | | |Set the spread step factor SLOPE from 0 to 16777215, - * | | |SLOPE = SLOPE[23:0]. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL3CTL0 - * Offset: 0x90 APLL Control Register 0(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Set the feedback divider factor (N) from 16 to 2047. - * | | |The N = FBDIV[10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[17:12] |INDIV |PLL Reference Input Divider Control (Write Protect) - * | | |Set the reference divider factor (M) from 1 to 63. - * | | |The M = INDIV[5:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[19:18] |MODE |Operation Mode Selection(Write Protect) - * | | |00 = Integer mode. - * | | |In this mode, the rising edges of the two clocks at the input of PFD are phase aligned - * | | |And the output clock frequency is at multiples of the input clock frequency contingent on the configuration of OUTDIV, INDIV and FBDIV. - * | | |01 = Fractional mode. - * | | |This mode is suitable for applications which need small output frequency steps, like 20 kHz - * | | |The jitter performance in this mode may be worse than in Integer Mode. - * | | |In this mode, the output clock frequency is at the fractional multiples of the input clock frequency - * | | |By setting the control pins FRAC [23:0], a small output frequency step is achieved.. - * | | |10 = Spread Spectrum Mode. - * | | |This mode is suitable for In this mode the output frequency of PLL will be modulated by triangle wave - * | | |It is for EMI consideration. - * | | |By setting SSRATE [10:0] and SLOPE [23:0], the modulation index and the modulation frequency can be programmed. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[30:20] |SSRATE |Spreading Frequency Control (Write Protect) - * | | |Set the spread step factor SSRATE from 0 to 2047, - * | | |SSRATE = SSRATE [10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL3CTL1 - * Offset: 0x94 APLL Control Register 1(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[1] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock Fref. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[6:4] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Set the output divider factor (P) from 1 to 7. - * | | |P = OUTDIV[2:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[31:8] |FRAC |PLL Fractional Portion of DN Value (Write Protect) - * | | |Set the fraction part (X) of Fractional Portion of DN Value factor. - * | | |The X = FRAC[23:0] / 224. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL3CTL2 - * Offset: 0x98 APLL Control Register 2(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |SLOPE |PLL Stable Counter Selection (Write Protect) - * | | |Set the spread step factor SLOPE from 0 to 16777215, - * | | |SLOPE = SLOPE[23:0]. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL4CTL0 - * Offset: 0xA0 EPLL Control Register 0(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Set the feedback divider factor (N) from 16 to 2047. - * | | |The N = FBDIV[10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[17:12] |INDIV |PLL Reference Input Divider Control (Write Protect) - * | | |Set the reference divider factor (M) from 1 to 63. - * | | |The M = INDIV[5:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[19:18] |MODE |Operation Mode Selection(Write Protect) - * | | |00 = Integer mode. - * | | |In this mode, the rising edges of the two clocks at the input of PFD are phase aligned - * | | |And the output clock frequency is at multiples of the input clock frequency contingent on the configuration of OUTDIV, INDIV and FBDIV. - * | | |01 = Fractional mode. - * | | |This mode is suitable for applications which need small output frequency steps, like 20 kHz - * | | |The jitter performance in this mode may be worse than in Integer Mode. - * | | |In this mode, the output clock frequency is at the fractional multiples of the input clock frequency - * | | |By setting the control pins FRAC [23:0], a small output frequency step is achieved.. - * | | |10 = Spread Spectrum Mode. - * | | |This mode is suitable for In this mode the output frequency of PLL will be modulated by triangle wave - * | | |It is for EMI consideration. - * | | |By setting SSRATE [10:0] and SLOPE [23:0], the modulation index and the modulation frequency can be programmed. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[30:20] |SSRATE |Spreading Frequency Control (Write Protect) - * | | |Set the spread step factor SSRATE from 0 to 2047, - * | | |SSRATE = SSRATE [10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL4CTL1 - * Offset: 0xA4 EPLL Control Register 1(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[1] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock Fref. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[6:4] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Set the output divider factor (P) from 1 to 7. - * | | |P = OUTDIV[2:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[31:8] |FRAC |PLL Fractional Portion of DN Value (Write Protect) - * | | |Set the fraction part (X) of Fractional Portion of DN Value factor. - * | | |The X = FRAC[23:0] / 224. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL4CTL2 - * Offset: 0xA8 EPLL Control Register 2(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |SLOPE |PLL Stable Counter Selection (Write Protect) - * | | |Set the spread step factor SLOPE from 0 to 16777215, - * | | |SLOPE = SLOPE[23:0]. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL5CTL0 - * Offset: 0xB0 VPLL Control Register 0(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |FBDIV |PLL Feedback Divider Control (Write Protect) - * | | |Set the feedback divider factor (N) from 16 to 2047. - * | | |The N = FBDIV[10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[17:12] |INDIV |PLL Reference Input Divider Control (Write Protect) - * | | |Set the reference divider factor (M) from 1 to 63. - * | | |The M = INDIV[5:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[19:18] |MODE |Operation Mode Selection(Write Protect) - * | | |00 = Integer mode. - * | | |In this mode, the rising edges of the two clocks at the input of PFD are phase aligned - * | | |And the output clock frequency is at multiples of the input clock frequency contingent on the configuration of OUTDIV, INDIV and FBDIV. - * | | |01 = Fractional mode. - * | | |This mode is suitable for applications which need small output frequency steps, like 20 kHz - * | | |The jitter performance in this mode may be worse than in Integer Mode. - * | | |In this mode, the output clock frequency is at the fractional multiples of the input clock frequency - * | | |By setting the control pins FRAC [23:0], a small output frequency step is achieved.. - * | | |10 = Spread Spectrum Mode. - * | | |This mode is suitable for In this mode the output frequency of PLL will be modulated by triangle wave - * | | |It is for EMI consideration. - * | | |By setting SSRATE [10:0] and SLOPE [23:0], the modulation index and the modulation frequency can be programmed. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[30:20] |SSRATE |Spreading Frequency Control (Write Protect) - * | | |Set the spread step factor SSRATE from 0 to 2047, - * | | |SSRATE = SSRATE [10:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL5CTL1 - * Offset: 0xB4 VPLL Control Register 1(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PD |Power-down Mode (Write Protect) - * | | |0 = PLL is enable (in normal mode). - * | | |1 = PLL is disable (in Power-down mode) (default). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[1] |BP |PLL Bypass Control (Write Protect) - * | | |0 = PLL is in normal mode (default). - * | | |1 = PLL clock output is same as PLL input clock Fref. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[6:4] |OUTDIV |PLL Output Divider Control (Write Protect) - * | | |Set the output divider factor (P) from 1 to 7. - * | | |P = OUTDIV[2:0]. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * |[31:8] |FRAC |PLL Fractional Portion of DN Value (Write Protect) - * | | |Set the fraction part (X) of Fractional Portion of DN Value factor. - * | | |The X = FRAC[23:0] / 224. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::PLL5CTL2 - * Offset: 0xB8 VPLL Control Register 2(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |SLOPE |PLL Stable Counter Selection (Write Protect) - * | | |Set the spread step factor SLOPE from 0 to 16777215, - * | | |SLOPE = SLOPE[23:0]. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register - * | | |For PLL3, PLL4, and PLL5, user can also refer to the SYS_RLKTZNS register if SYSSIAEN is 1. - * @var CLK_T::CLKDCTL - * Offset: 0xC0 Clock Fail Detector Control Register(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |HXTFDEN |HXT Clock Fail Detector Enable Bit - * | | |0 = 24 MHz external high speed crystal oscillator (HXT) clock fail detector Disabled. - * | | |1 = 24 MHz external high speed crystal oscillator (HXT) clock fail detector Enabled. - * |[5] |HXTFIEN |HXT Clock Fail Interrupt Enable Bit - * | | |0 = 24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Disabled. - * | | |1 = 24 MHz external high speed crystal oscillator (HXT) clock fail interrupt Enabled. - * |[12] |LXTFDEN |LXT Clock Fail Detector Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail detector Enabled. - * |[13] |LXTFIEN |LXT Clock Fail Interrupt Enable Bit - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Disabled. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) clock fail interrupt Enabled. - * |[16] |HXTFQDEN |HXT Clock Frequency Monitor Enable Bit - * | | |0 = 24 MHz external high speed crystal oscillator (HXT) clock frequency monitor Disabled. - * | | |1 = 24 MHz external high speed crystal oscillator (HXT) clock frequency monitor Enabled. - * |[17] |HXTFQIEN |HXT Clock Frequency Monitor Interrupt Enable Bit - * | | |0 = 24 MHz external high speed crystal oscillator (HXT) clock frequency monitor fail interrupt Disabled. - * | | |1 = 24 MHz external high speed crystal oscillator (HXT) clock frequency monitor fail interrupt Enabled. - * @var CLK_T::CLKDSTS - * Offset: 0xC4 Clock Fail Detector Status Register(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFIF |HXT Clock Fail Interrupt Flag (Write Protect, Write 1 to Clear) - * | | |0 = 24 MHz external high speed crystal oscillator (HXT) clock is normal. - * | | |1 = 24 MHz external high speed crystal oscillator (HXT) clock stops. - * | | |Note 1: Write 1 to clear the bit to 0. - * | | |Note 2: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[1] |LXTFIF |LXT Clock Fail Interrupt Flag (Write Protect, Write 1 to Clear) - * | | |0 = 32.768 kHz external low speed crystal oscillator (LXT) clock is normal. - * | | |1 = 32.768 kHz external low speed crystal oscillator (LXT) stops. - * | | |Note 1: Write 1 to clear the bit to 0. - * | | |Note 2: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[8] |HXTFQIF |HXT Clock Frequency Monitor Interrupt Flag (Write Protect, Write 1 to Clear) - * | | |0 = 24 MHz external high speed crystal oscillator (HXT) clock is normal. - * | | |1 = 24 MHz external high speed crystal oscillator (HXT) clock frequency is abnormal. - * | | |Note 1: Write 1 to clear the bit to 0. - * | | |Note 2: This bit is write protected. Refer to the SYS_RLKTZS register. - * @var CLK_T::CDUPB - * Offset: 0xC8 Clock Frequency Detector Upper Boundary Register(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |UPERBD |HXT Clock Frequency Detector Upper Boundary - * | | |The bits define the high value of frequency monitor window. - * | | |When HXT frequency monitor value higher than this register, the HXT frequency detect fail interrupt flag will set to 1. - * @var CLK_T::CDLOWB - * Offset: 0xCC Clock Frequency Detector Lower Boundary Register(Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |LOWERBD |HXT Clock Frequency Detector Lower Boundary - * | | |The bits define the low value of frequency monitor window. - * | | |When HXT frequency monitor value lower than this register, the HXT frequency detect fail interrupt flag will set to 1. - * @var CLK_T::CKFLTRCTL - * Offset: 0xD0 Clock Filter Control Register (Write Protect) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HXTFLTREN |HXT Clock Filter Enable Control Bit (Write Protect) - * | | |0 = HXT clock filter function Disabled. - * | | |1 = HXT clock filter function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[1] |HXTFLTRSEL|HXT Clock Filter Frequency Select - * | | |0 = HXT frequency is > 24 MHz. - * | | |1 = HXT frequency is <= 24 MHz. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[4] |HXTGTEN |HXT Clock Gating Enable Control Bit (Write Protect) - * | | |0 = HXT clock filter function Disabled. - * | | |1 = HXT clock filter function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[5] |HXTBYPSEN |HXT Clock Bypass Enable Control Bit (Write Protect) - * | | |0 = HXT clock filter function Disabled. - * | | |1 = HXT clock filter function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[8] |HIRCFLTREN|HIRC Clock Filter Enable Control Bit (Write Protect) - * | | |0 = HIRC clock filter function Disabled. - * | | |1 = HIRC clock filter function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[9] |HIRCFLTRSEL|HIRC Clock Filter Frequency Select - * | | |0 = HIRC frequency is > 12 MHz. - * | | |1 = HIRC frequency is <= 12 MHz. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[12] |HIRCGTEN |HIRC Clock Gating Enable Control Bit (Write Protect) - * | | |0 = HIRC clock filter function Disabled. - * | | |1 = HIRC clock filter function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - */ - __IO uint32_t PWRCTL; /*!< [0x0000] System Power-down Control Register */ - __IO uint32_t SYSCLK0; /*!< [0x0004] AXI and AHB Device Clock Enable Control Register 0 */ - __IO uint32_t SYSCLK1; /*!< [0x0008] AXI and AHB Device Clock Enable Control Register 1 */ - __IO uint32_t APBCLK0; /*!< [0x000c] APB Devices Clock Enable Control Register 0 */ - __IO uint32_t APBCLK1; /*!< [0x0010] APB Devices Clock Enable Control Register 1 */ - __IO uint32_t APBCLK2; /*!< [0x0014] APB Devices Clock Enable Control Register 2 */ - __IO uint32_t CLKSEL0; /*!< [0x0018] Clock Source Select Control Register 0 */ - __IO uint32_t CLKSEL1; /*!< [0x001c] Clock Source Select Control Register 1 */ - __IO uint32_t CLKSEL2; /*!< [0x0020] Clock Source Select Control Register 2 */ - __IO uint32_t CLKSEL3; /*!< [0x0024] Clock Source Select Control Register 3 */ - __IO uint32_t CLKSEL4; /*!< [0x0028] Clock Source Select Control Register 4 */ - __IO uint32_t CLKDIV0; /*!< [0x002c] Clock Divider Number Register 0 */ - __IO uint32_t CLKDIV1; /*!< [0x0030] Clock Divider Number Register 1 */ - __IO uint32_t CLKDIV2; /*!< [0x0034] Clock Divider Number Register 2 */ - __IO uint32_t CLKDIV3; /*!< [0x0038] Clock Divider Number Register 3 */ - __IO uint32_t CLKDIV4; /*!< [0x003c] Clock Divider Number Register 4 */ - __IO uint32_t CLKOCTL; /*!< [0x0040] Clock Output Control Register (Write Protect) */ - __I uint32_t RESERVE0[3]; - __I uint32_t STATUS; /*!< [0x0050] Clock Status Monitor Register */ - __I uint32_t RESERVE1[3]; - union - { - /* data */ - __IO uint32_t PLL0CTL0; /*!< [0x0060] CA-PLL Control Register 0 */ - PLL_T PLL[6]; /*!< [0x0080] PLL Control Registers (Write Protect) */ - }; - __IO uint32_t CLKDCTL; /*!< [0x00c0] Clock Fail Detector Control Register(Write Protect) */ - __IO uint32_t CLKDSTS; /*!< [0x00c4] Clock Fail Detector Status Register(Write Protect) */ - __IO uint32_t CDUPB; /*!< [0x00c8] Clock Frequency Detector Upper Boundary Register(Write Protect) */ - __IO uint32_t CDLOWB; /*!< [0x00cc] Clock Frequency Detector Lower Boundary Register(Write Protect) */ - __IO uint32_t CKFLTRCTL; /*!< [0x00d0] Clock Filter Control Register (Write Protect) */ - -} CLK_T; - -/** - @addtogroup CLK_CONST CLK Bit Field Definition - Constant Definitions for CLK Controller -@{ */ - -#define CLK_PWRCTL_HXTEN_Pos (0) /*!< CLK_T::PWRCTL: HXTEN Position */ -#define CLK_PWRCTL_HXTEN_Msk (0x1ul << CLK_PWRCTL_HXTEN_Pos) /*!< CLK_T::PWRCTL: HXTEN Mask */ - -#define CLK_PWRCTL_LXTEN_Pos (1) /*!< CLK_T::PWRCTL: LXTEN Position */ -#define CLK_PWRCTL_LXTEN_Msk (0x1ul << CLK_PWRCTL_LXTEN_Pos) /*!< CLK_T::PWRCTL: LXTEN Mask */ - -#define CLK_PWRCTL_HIRCEN_Pos (2) /*!< CLK_T::PWRCTL: HIRCEN Position */ -#define CLK_PWRCTL_HIRCEN_Msk (0x1ul << CLK_PWRCTL_HIRCEN_Pos) /*!< CLK_T::PWRCTL: HIRCEN Mask */ - -#define CLK_PWRCTL_LIRCEN_Pos (3) /*!< CLK_T::PWRCTL: LIRCEN Position */ -#define CLK_PWRCTL_LIRCEN_Msk (0x1ul << CLK_PWRCTL_LIRCEN_Pos) /*!< CLK_T::PWRCTL: LIRCEN Mask */ - -#define CLK_PWRCTL_HXTDS_Pos (10) /*!< CLK_T::PWRCTL: HXTDS Position */ -#define CLK_PWRCTL_HXTDS_Msk (0x1ul << CLK_PWRCTL_HXTDS_Pos) /*!< CLK_T::PWRCTL: HXTDS Mask */ - -#define CLK_PWRCTL_SYSPLLAPD_Pos (11) /*!< CLK_T::PWRCTL: SYSPLLAPD Position */ -#define CLK_PWRCTL_SYSPLLAPD_Msk (0x1ul << CLK_PWRCTL_SYSPLLAPD_Pos) /*!< CLK_T::PWRCTL: SYSPLLAPD Mask */ - -#define CLK_PWRCTL_CAPLLAPD_Pos (12) /*!< CLK_T::PWRCTL: CAPLLAPD Position */ -#define CLK_PWRCTL_CAPLLAPD_Msk (0x1ul << CLK_PWRCTL_CAPLLAPD_Pos) /*!< CLK_T::PWRCTL: CAPLLAPD Mask */ - -#define CLK_PWRCTL_DDRPLLAPD_Pos (13) /*!< CLK_T::PWRCTL: DDRPLLAPD Position */ -#define CLK_PWRCTL_DDRPLLAPD_Msk (0x1ul << CLK_PWRCTL_DDRPLLAPD_Pos) /*!< CLK_T::PWRCTL: DDRPLLAPD Mask */ - -#define CLK_PWRCTL_HXTAOFF_Pos (14) /*!< CLK_T::PWRCTL: HXTAOFF Position */ -#define CLK_PWRCTL_HXTAOFF_Msk (0x1ul << CLK_PWRCTL_HXTAOFF_Pos) /*!< CLK_T::PWRCTL: HXTAOFF Mask */ - -#define CLK_PWRCTL_HIRCAOFF_Pos (15) /*!< CLK_T::PWRCTL: HIRCAOFF Position */ -#define CLK_PWRCTL_HIRCAOFF_Msk (0x1ul << CLK_PWRCTL_HIRCAOFF_Pos) /*!< CLK_T::PWRCTL: HIRCAOFF Mask */ - -#define CLK_PWRCTL_LXTSTBS_Pos (16) /*!< CLK_T::PWRCTL: LXTSTBS Position */ -#define CLK_PWRCTL_LXTSTBS_Msk (0x3ul << CLK_PWRCTL_LXTSTBS_Pos) /*!< CLK_T::PWRCTL: LXTSTBS Mask */ - -#define CLK_PWRCTL_GICAOFF_Pos (21) /*!< CLK_T::PWRCTL: GICAOFF Position */ -#define CLK_PWRCTL_GICAOFF_Msk (0x1ul << CLK_PWRCTL_GICAOFF_Pos) /*!< CLK_T::PWRCTL: GICAOFF Mask */ - -#define CLK_PWRCTL_HXTAPD_Pos (22) /*!< CLK_T::PWRCTL: HXTAPD Position */ -#define CLK_PWRCTL_HXTAPD_Msk (0x1ul << CLK_PWRCTL_HXTAPD_Pos) /*!< CLK_T::PWRCTL: HXTAPD Mask */ - -#define CLK_PWRCTL_HIRCAPD_Pos (23) /*!< CLK_T::PWRCTL: HIRCAPD Position */ -#define CLK_PWRCTL_HIRCAPD_Msk (0x1ul << CLK_PWRCTL_HIRCAPD_Pos) /*!< CLK_T::PWRCTL: HIRCAPD Mask */ - -#define CLK_SYSCLK0_RTPEN_Pos (1) /*!< CLK_T::SYSCLK0: RTPEN Position */ -#define CLK_SYSCLK0_RTPEN_Msk (0x1ul << CLK_SYSCLK0_RTPEN_Pos) /*!< CLK_T::SYSCLK0: RTPEN Mask */ - -#define CLK_SYSCLK0_TAHBCKEN_Pos (2) /*!< CLK_T::SYSCLK0: TAHBCKEN Position */ -#define CLK_SYSCLK0_TAHBCKEN_Msk (0x1ul << CLK_SYSCLK0_TAHBCKEN_Pos) /*!< CLK_T::SYSCLK0: TAHBCKEN Mask */ - -#define CLK_SYSCLK0_LVRDBEN_Pos (3) /*!< CLK_T::SYSCLK0: LVRDBEN Position */ -#define CLK_SYSCLK0_LVRDBEN_Msk (0x1ul << CLK_SYSCLK0_LVRDBEN_Pos) /*!< CLK_T::SYSCLK0: LVRDBEN Mask */ - -#define CLK_SYSCLK0_DDR0CKEN_Pos (4) /*!< CLK_T::SYSCLK0: DDR0CKEN Position */ -#define CLK_SYSCLK0_DDR0CKEN_Msk (0x1ul << CLK_SYSCLK0_DDR0CKEN_Pos) /*!< CLK_T::SYSCLK0: DDR0CKEN Mask */ - -#define CLK_SYSCLK0_DDR6CKEN_Pos (5) /*!< CLK_T::SYSCLK0: DDR6CKEN Position */ -#define CLK_SYSCLK0_DDR6CKEN_Msk (0x1ul << CLK_SYSCLK0_DDR6CKEN_Pos) /*!< CLK_T::SYSCLK0: DDR6CKEN Mask */ - -#define CLK_SYSCLK0_CANFD0CKEN_Pos (8) /*!< CLK_T::SYSCLK0: CANFD0CKEN Position */ -#define CLK_SYSCLK0_CANFD0CKEN_Msk (0x1ul << CLK_SYSCLK0_CANFD0CKEN_Pos) /*!< CLK_T::SYSCLK0: CANFD0CKEN Mask */ - -#define CLK_SYSCLK0_CANFD1CKEN_Pos (9) /*!< CLK_T::SYSCLK0: CANFD1CKEN Position */ -#define CLK_SYSCLK0_CANFD1CKEN_Msk (0x1ul << CLK_SYSCLK0_CANFD1CKEN_Pos) /*!< CLK_T::SYSCLK0: CANFD1CKEN Mask */ - -#define CLK_SYSCLK0_CANFD2CKEN_Pos (10) /*!< CLK_T::SYSCLK0: CANFD2CKEN Position */ -#define CLK_SYSCLK0_CANFD2CKEN_Msk (0x1ul << CLK_SYSCLK0_CANFD2CKEN_Pos) /*!< CLK_T::SYSCLK0: CANFD2CKEN Mask */ - -#define CLK_SYSCLK0_CANFD3CKEN_Pos (11) /*!< CLK_T::SYSCLK0: CANFD3CKEN Position */ -#define CLK_SYSCLK0_CANFD3CKEN_Msk (0x1ul << CLK_SYSCLK0_CANFD3CKEN_Pos) /*!< CLK_T::SYSCLK0: CANFD3CKEN Mask */ - -#define CLK_SYSCLK0_SDH0EN_Pos (16) /*!< CLK_T::SYSCLK0: SDH0EN Position */ -#define CLK_SYSCLK0_SDH0EN_Msk (0x1ul << CLK_SYSCLK0_SDH0EN_Pos) /*!< CLK_T::SYSCLK0: SDH0EN Mask */ - -#define CLK_SYSCLK0_SDH1EN_Pos (17) /*!< CLK_T::SYSCLK0: SDH1EN Position */ -#define CLK_SYSCLK0_SDH1EN_Msk (0x1ul << CLK_SYSCLK0_SDH1EN_Pos) /*!< CLK_T::SYSCLK0: SDH1EN Mask */ - -#define CLK_SYSCLK0_NANDEN_Pos (18) /*!< CLK_T::SYSCLK0: NANDEN Position */ -#define CLK_SYSCLK0_NANDEN_Msk (0x1ul << CLK_SYSCLK0_NANDEN_Pos) /*!< CLK_T::SYSCLK0: NANDEN Mask */ - -#define CLK_SYSCLK0_USBDEN_Pos (19) /*!< CLK_T::SYSCLK0: USBDEN Position */ -#define CLK_SYSCLK0_USBDEN_Msk (0x1ul << CLK_SYSCLK0_USBDEN_Pos) /*!< CLK_T::SYSCLK0: USBDEN Mask */ - -#define CLK_SYSCLK0_USBHEN_Pos (20) /*!< CLK_T::SYSCLK0: USBHEN Position */ -#define CLK_SYSCLK0_USBHEN_Msk (0x1ul << CLK_SYSCLK0_USBHEN_Pos) /*!< CLK_T::SYSCLK0: USBHEN Mask */ - -#define CLK_SYSCLK0_HUSBH0EN_Pos (21) /*!< CLK_T::SYSCLK0: HUSBH0EN Position */ -#define CLK_SYSCLK0_HUSBH0EN_Msk (0x1ul << CLK_SYSCLK0_HUSBH0EN_Pos) /*!< CLK_T::SYSCLK0: HUSBH0EN Mask */ - -#define CLK_SYSCLK0_HUSBH1EN_Pos (22) /*!< CLK_T::SYSCLK0: HUSBH1EN Position */ -#define CLK_SYSCLK0_HUSBH1EN_Msk (0x1ul << CLK_SYSCLK0_HUSBH1EN_Pos) /*!< CLK_T::SYSCLK0: HUSBH1EN Mask */ - -#define CLK_SYSCLK0_GFXEN_Pos (24) /*!< CLK_T::SYSCLK0: GFXEN Position */ -#define CLK_SYSCLK0_GFXEN_Msk (0x1ul << CLK_SYSCLK0_GFXEN_Pos) /*!< CLK_T::SYSCLK0: GFXEN Mask */ - -#define CLK_SYSCLK0_VDECEN_Pos (25) /*!< CLK_T::SYSCLK0: VDECEN Position */ -#define CLK_SYSCLK0_VDECEN_Msk (0x1ul << CLK_SYSCLK0_VDECEN_Pos) /*!< CLK_T::SYSCLK0: VDECEN Mask */ - -#define CLK_SYSCLK0_DCUEN_Pos (26) /*!< CLK_T::SYSCLK0: DCUEN Position */ -#define CLK_SYSCLK0_DCUEN_Msk (0x1ul << CLK_SYSCLK0_DCUEN_Pos) /*!< CLK_T::SYSCLK0: DCUEN Mask */ - -#define CLK_SYSCLK0_GMAC0EN_Pos (27) /*!< CLK_T::SYSCLK0: GMAC0EN Position */ -#define CLK_SYSCLK0_GMAC0EN_Msk (0x1ul << CLK_SYSCLK0_GMAC0EN_Pos) /*!< CLK_T::SYSCLK0: GMAC0EN Mask */ - -#define CLK_SYSCLK0_GMAC1EN_Pos (28) /*!< CLK_T::SYSCLK0: GMAC1EN Position */ -#define CLK_SYSCLK0_GMAC1EN_Msk (0x1ul << CLK_SYSCLK0_GMAC1EN_Pos) /*!< CLK_T::SYSCLK0: GMAC1EN Mask */ - -#define CLK_SYSCLK0_CCAP0EN_Pos (29) /*!< CLK_T::SYSCLK0: CCAP0EN Position */ -#define CLK_SYSCLK0_CCAP0EN_Msk (0x1ul << CLK_SYSCLK0_CCAP0EN_Pos) /*!< CLK_T::SYSCLK0: CCAP0EN Mask */ - -#define CLK_SYSCLK0_CCAP1EN_Pos (30) /*!< CLK_T::SYSCLK0: CCAP1EN Position */ -#define CLK_SYSCLK0_CCAP1EN_Msk (0x1ul << CLK_SYSCLK0_CCAP1EN_Pos) /*!< CLK_T::SYSCLK0: CCAP1EN Mask */ - -#define CLK_SYSCLK1_PDMA0EN_Pos (0) /*!< CLK_T::SYSCLK1: PDMA0EN Position */ -#define CLK_SYSCLK1_PDMA0EN_Msk (0x1ul << CLK_SYSCLK1_PDMA0EN_Pos) /*!< CLK_T::SYSCLK1: PDMA0EN Mask */ - -#define CLK_SYSCLK1_PDMA1EN_Pos (1) /*!< CLK_T::SYSCLK1: PDMA1EN Position */ -#define CLK_SYSCLK1_PDMA1EN_Msk (0x1ul << CLK_SYSCLK1_PDMA1EN_Pos) /*!< CLK_T::SYSCLK1: PDMA1EN Mask */ - -#define CLK_SYSCLK1_PDMA2EN_Pos (2) /*!< CLK_T::SYSCLK1: PDMA2EN Position */ -#define CLK_SYSCLK1_PDMA2EN_Msk (0x1ul << CLK_SYSCLK1_PDMA2EN_Pos) /*!< CLK_T::SYSCLK1: PDMA2EN Mask */ - -#define CLK_SYSCLK1_PDMA3EN_Pos (3) /*!< CLK_T::SYSCLK1: PDMA3EN Position */ -#define CLK_SYSCLK1_PDMA3EN_Msk (0x1ul << CLK_SYSCLK1_PDMA3EN_Pos) /*!< CLK_T::SYSCLK1: PDMA3EN Mask */ - -#define CLK_SYSCLK1_WH0CKEN_Pos (4) /*!< CLK_T::SYSCLK1: WH0CKEN Position */ -#define CLK_SYSCLK1_WH0CKEN_Msk (0x1ul << CLK_SYSCLK1_WH0CKEN_Pos) /*!< CLK_T::SYSCLK1: WH0CKEN Mask */ - -#define CLK_SYSCLK1_WH1CKEN_Pos (5) /*!< CLK_T::SYSCLK1: WH1CKEN Position */ -#define CLK_SYSCLK1_WH1CKEN_Msk (0x1ul << CLK_SYSCLK1_WH1CKEN_Pos) /*!< CLK_T::SYSCLK1: WH1CKEN Mask */ - -#define CLK_SYSCLK1_HWSCKEN_Pos (6) /*!< CLK_T::SYSCLK1: HWSCKEN Position */ -#define CLK_SYSCLK1_HWSCKEN_Msk (0x1ul << CLK_SYSCLK1_HWSCKEN_Pos) /*!< CLK_T::SYSCLK1: HWSCKEN Mask */ - -#define CLK_SYSCLK1_EBICKEN_Pos (7) /*!< CLK_T::SYSCLK1: EBICKEN Position */ -#define CLK_SYSCLK1_EBICKEN_Msk (0x1ul << CLK_SYSCLK1_EBICKEN_Pos) /*!< CLK_T::SYSCLK1: EBICKEN Mask */ - -#define CLK_SYSCLK1_SRAM0CKEN_Pos (8) /*!< CLK_T::SYSCLK1: SRAM0CKEN Position */ -#define CLK_SYSCLK1_SRAM0CKEN_Msk (0x1ul << CLK_SYSCLK1_SRAM0CKEN_Pos) /*!< CLK_T::SYSCLK1: SRAM0CKEN Mask */ - -#define CLK_SYSCLK1_SRAM1CKEN_Pos (9) /*!< CLK_T::SYSCLK1: SRAM1CKEN Position */ -#define CLK_SYSCLK1_SRAM1CKEN_Msk (0x1ul << CLK_SYSCLK1_SRAM1CKEN_Pos) /*!< CLK_T::SYSCLK1: SRAM1CKEN Mask */ - -#define CLK_SYSCLK1_ROMCKEN_Pos (10) /*!< CLK_T::SYSCLK1: ROMCKEN Position */ -#define CLK_SYSCLK1_ROMCKEN_Msk (0x1ul << CLK_SYSCLK1_ROMCKEN_Pos) /*!< CLK_T::SYSCLK1: ROMCKEN Mask */ - -#define CLK_SYSCLK1_TRACKEN_Pos (11) /*!< CLK_T::SYSCLK1: TRACKEN Position */ -#define CLK_SYSCLK1_TRACKEN_Msk (0x1ul << CLK_SYSCLK1_TRACKEN_Pos) /*!< CLK_T::SYSCLK1: TRACKEN Mask */ - -#define CLK_SYSCLK1_DBGCKEN_Pos (12) /*!< CLK_T::SYSCLK1: DBGCKEN Position */ -#define CLK_SYSCLK1_DBGCKEN_Msk (0x1ul << CLK_SYSCLK1_DBGCKEN_Pos) /*!< CLK_T::SYSCLK1: DBGCKEN Mask */ - -#define CLK_SYSCLK1_CLKOCKEN_Pos (13) /*!< CLK_T::SYSCLK1: CLKOCKEN Position */ -#define CLK_SYSCLK1_CLKOCKEN_Msk (0x1ul << CLK_SYSCLK1_CLKOCKEN_Pos) /*!< CLK_T::SYSCLK1: CLKOCKEN Mask */ - -#define CLK_SYSCLK1_GTMRCKEN_Pos (14) /*!< CLK_T::SYSCLK1: GTMRCKEN Position */ -#define CLK_SYSCLK1_GTMRCKEN_Msk (0x1ul << CLK_SYSCLK1_GTMRCKEN_Pos) /*!< CLK_T::SYSCLK1: GTMRCKEN Mask */ - -#define CLK_SYSCLK1_GPACKEN_Pos (16) /*!< CLK_T::SYSCLK1: GPACKEN Position */ -#define CLK_SYSCLK1_GPACKEN_Msk (0x1ul << CLK_SYSCLK1_GPACKEN_Pos) /*!< CLK_T::SYSCLK1: GPACKEN Mask */ - -#define CLK_SYSCLK1_GPBCKEN_Pos (17) /*!< CLK_T::SYSCLK1: GPBCKEN Position */ -#define CLK_SYSCLK1_GPBCKEN_Msk (0x1ul << CLK_SYSCLK1_GPBCKEN_Pos) /*!< CLK_T::SYSCLK1: GPBCKEN Mask */ - -#define CLK_SYSCLK1_GPCCKEN_Pos (18) /*!< CLK_T::SYSCLK1: GPCCKEN Position */ -#define CLK_SYSCLK1_GPCCKEN_Msk (0x1ul << CLK_SYSCLK1_GPCCKEN_Pos) /*!< CLK_T::SYSCLK1: GPCCKEN Mask */ - -#define CLK_SYSCLK1_GPDCKEN_Pos (19) /*!< CLK_T::SYSCLK1: GPDCKEN Position */ -#define CLK_SYSCLK1_GPDCKEN_Msk (0x1ul << CLK_SYSCLK1_GPDCKEN_Pos) /*!< CLK_T::SYSCLK1: GPDCKEN Mask */ - -#define CLK_SYSCLK1_GPECKEN_Pos (20) /*!< CLK_T::SYSCLK1: GPECKEN Position */ -#define CLK_SYSCLK1_GPECKEN_Msk (0x1ul << CLK_SYSCLK1_GPECKEN_Pos) /*!< CLK_T::SYSCLK1: GPECKEN Mask */ - -#define CLK_SYSCLK1_GPFCKEN_Pos (21) /*!< CLK_T::SYSCLK1: GPFCKEN Position */ -#define CLK_SYSCLK1_GPFCKEN_Msk (0x1ul << CLK_SYSCLK1_GPFCKEN_Pos) /*!< CLK_T::SYSCLK1: GPFCKEN Mask */ - -#define CLK_SYSCLK1_GPGCKEN_Pos (22) /*!< CLK_T::SYSCLK1: GPGCKEN Position */ -#define CLK_SYSCLK1_GPGCKEN_Msk (0x1ul << CLK_SYSCLK1_GPGCKEN_Pos) /*!< CLK_T::SYSCLK1: GPGCKEN Mask */ - -#define CLK_SYSCLK1_GPHCKEN_Pos (23) /*!< CLK_T::SYSCLK1: GPHCKEN Position */ -#define CLK_SYSCLK1_GPHCKEN_Msk (0x1ul << CLK_SYSCLK1_GPHCKEN_Pos) /*!< CLK_T::SYSCLK1: GPHCKEN Mask */ - -#define CLK_SYSCLK1_GPICKEN_Pos (24) /*!< CLK_T::SYSCLK1: GPICKEN Position */ -#define CLK_SYSCLK1_GPICKEN_Msk (0x1ul << CLK_SYSCLK1_GPICKEN_Pos) /*!< CLK_T::SYSCLK1: GPICKEN Mask */ - -#define CLK_SYSCLK1_GPJCKEN_Pos (25) /*!< CLK_T::SYSCLK1: GPJCKEN Position */ -#define CLK_SYSCLK1_GPJCKEN_Msk (0x1ul << CLK_SYSCLK1_GPJCKEN_Pos) /*!< CLK_T::SYSCLK1: GPJCKEN Mask */ - -#define CLK_SYSCLK1_GPKCKEN_Pos (26) /*!< CLK_T::SYSCLK1: GPKCKEN Position */ -#define CLK_SYSCLK1_GPKCKEN_Msk (0x1ul << CLK_SYSCLK1_GPKCKEN_Pos) /*!< CLK_T::SYSCLK1: GPKCKEN Mask */ - -#define CLK_SYSCLK1_GPLCKEN_Pos (27) /*!< CLK_T::SYSCLK1: GPLCKEN Position */ -#define CLK_SYSCLK1_GPLCKEN_Msk (0x1ul << CLK_SYSCLK1_GPLCKEN_Pos) /*!< CLK_T::SYSCLK1: GPLCKEN Mask */ - -#define CLK_SYSCLK1_GPMCKEN_Pos (28) /*!< CLK_T::SYSCLK1: GPMCKEN Position */ -#define CLK_SYSCLK1_GPMCKEN_Msk (0x1ul << CLK_SYSCLK1_GPMCKEN_Pos) /*!< CLK_T::SYSCLK1: GPMCKEN Mask */ - -#define CLK_SYSCLK1_GPNCKEN_Pos (29) /*!< CLK_T::SYSCLK1: GPNCKEN Position */ -#define CLK_SYSCLK1_GPNCKEN_Msk (0x1ul << CLK_SYSCLK1_GPNCKEN_Pos) /*!< CLK_T::SYSCLK1: GPNCKEN Mask */ - -#define CLK_APBCLK0_TMR0CKEN_Pos (0) /*!< CLK_T::APBCLK0: TMR0CKEN Position */ -#define CLK_APBCLK0_TMR0CKEN_Msk (0x1ul << CLK_APBCLK0_TMR0CKEN_Pos) /*!< CLK_T::APBCLK0: TMR0CKEN Mask */ - -#define CLK_APBCLK0_TMR1CKEN_Pos (1) /*!< CLK_T::APBCLK0: TMR1CKEN Position */ -#define CLK_APBCLK0_TMR1CKEN_Msk (0x1ul << CLK_APBCLK0_TMR1CKEN_Pos) /*!< CLK_T::APBCLK0: TMR1CKEN Mask */ - -#define CLK_APBCLK0_TMR2CKEN_Pos (2) /*!< CLK_T::APBCLK0: TMR2CKEN Position */ -#define CLK_APBCLK0_TMR2CKEN_Msk (0x1ul << CLK_APBCLK0_TMR2CKEN_Pos) /*!< CLK_T::APBCLK0: TMR2CKEN Mask */ - -#define CLK_APBCLK0_TMR3CKEN_Pos (3) /*!< CLK_T::APBCLK0: TMR3CKEN Position */ -#define CLK_APBCLK0_TMR3CKEN_Msk (0x1ul << CLK_APBCLK0_TMR3CKEN_Pos) /*!< CLK_T::APBCLK0: TMR3CKEN Mask */ - -#define CLK_APBCLK0_TMR4CKEN_Pos (4) /*!< CLK_T::APBCLK0: TMR4CKEN Position */ -#define CLK_APBCLK0_TMR4CKEN_Msk (0x1ul << CLK_APBCLK0_TMR4CKEN_Pos) /*!< CLK_T::APBCLK0: TMR4CKEN Mask */ - -#define CLK_APBCLK0_TMR5CKEN_Pos (5) /*!< CLK_T::APBCLK0: TMR5CKEN Position */ -#define CLK_APBCLK0_TMR5CKEN_Msk (0x1ul << CLK_APBCLK0_TMR5CKEN_Pos) /*!< CLK_T::APBCLK0: TMR5CKEN Mask */ - -#define CLK_APBCLK0_TMR6CKEN_Pos (6) /*!< CLK_T::APBCLK0: TMR6CKEN Position */ -#define CLK_APBCLK0_TMR6CKEN_Msk (0x1ul << CLK_APBCLK0_TMR6CKEN_Pos) /*!< CLK_T::APBCLK0: TMR6CKEN Mask */ - -#define CLK_APBCLK0_TMR7CKEN_Pos (7) /*!< CLK_T::APBCLK0: TMR7CKEN Position */ -#define CLK_APBCLK0_TMR7CKEN_Msk (0x1ul << CLK_APBCLK0_TMR7CKEN_Pos) /*!< CLK_T::APBCLK0: TMR7CKEN Mask */ - -#define CLK_APBCLK0_TMR8CKEN_Pos (8) /*!< CLK_T::APBCLK0: TMR8CKEN Position */ -#define CLK_APBCLK0_TMR8CKEN_Msk (0x1ul << CLK_APBCLK0_TMR8CKEN_Pos) /*!< CLK_T::APBCLK0: TMR8CKEN Mask */ - -#define CLK_APBCLK0_TMR9CKEN_Pos (9) /*!< CLK_T::APBCLK0: TMR9CKEN Position */ -#define CLK_APBCLK0_TMR9CKEN_Msk (0x1ul << CLK_APBCLK0_TMR9CKEN_Pos) /*!< CLK_T::APBCLK0: TMR9CKEN Mask */ - -#define CLK_APBCLK0_TMR10CKEN_Pos (10) /*!< CLK_T::APBCLK0: TMR10CKEN Position */ -#define CLK_APBCLK0_TMR10CKEN_Msk (0x1ul << CLK_APBCLK0_TMR10CKEN_Pos) /*!< CLK_T::APBCLK0: TMR10CKEN Mask */ - -#define CLK_APBCLK0_TMR11CKEN_Pos (11) /*!< CLK_T::APBCLK0: TMR11CKEN Position */ -#define CLK_APBCLK0_TMR11CKEN_Msk (0x1ul << CLK_APBCLK0_TMR11CKEN_Pos) /*!< CLK_T::APBCLK0: TMR11CKEN Mask */ - -#define CLK_APBCLK0_UART0CKEN_Pos (12) /*!< CLK_T::APBCLK0: UART0CKEN Position */ -#define CLK_APBCLK0_UART0CKEN_Msk (0x1ul << CLK_APBCLK0_UART0CKEN_Pos) /*!< CLK_T::APBCLK0: UART0CKEN Mask */ - -#define CLK_APBCLK0_UART1CKEN_Pos (13) /*!< CLK_T::APBCLK0: UART1CKEN Position */ -#define CLK_APBCLK0_UART1CKEN_Msk (0x1ul << CLK_APBCLK0_UART1CKEN_Pos) /*!< CLK_T::APBCLK0: UART1CKEN Mask */ - -#define CLK_APBCLK0_UART2CKEN_Pos (14) /*!< CLK_T::APBCLK0: UART2CKEN Position */ -#define CLK_APBCLK0_UART2CKEN_Msk (0x1ul << CLK_APBCLK0_UART2CKEN_Pos) /*!< CLK_T::APBCLK0: UART2CKEN Mask */ - -#define CLK_APBCLK0_UART3CKEN_Pos (15) /*!< CLK_T::APBCLK0: UART3CKEN Position */ -#define CLK_APBCLK0_UART3CKEN_Msk (0x1ul << CLK_APBCLK0_UART3CKEN_Pos) /*!< CLK_T::APBCLK0: UART3CKEN Mask */ - -#define CLK_APBCLK0_UART4CKEN_Pos (16) /*!< CLK_T::APBCLK0: UART4CKEN Position */ -#define CLK_APBCLK0_UART4CKEN_Msk (0x1ul << CLK_APBCLK0_UART4CKEN_Pos) /*!< CLK_T::APBCLK0: UART4CKEN Mask */ - -#define CLK_APBCLK0_UART5CKEN_Pos (17) /*!< CLK_T::APBCLK0: UART5CKEN Position */ -#define CLK_APBCLK0_UART5CKEN_Msk (0x1ul << CLK_APBCLK0_UART5CKEN_Pos) /*!< CLK_T::APBCLK0: UART5CKEN Mask */ - -#define CLK_APBCLK0_UART6CKEN_Pos (18) /*!< CLK_T::APBCLK0: UART6CKEN Position */ -#define CLK_APBCLK0_UART6CKEN_Msk (0x1ul << CLK_APBCLK0_UART6CKEN_Pos) /*!< CLK_T::APBCLK0: UART6CKEN Mask */ - -#define CLK_APBCLK0_UART7CKEN_Pos (19) /*!< CLK_T::APBCLK0: UART7CKEN Position */ -#define CLK_APBCLK0_UART7CKEN_Msk (0x1ul << CLK_APBCLK0_UART7CKEN_Pos) /*!< CLK_T::APBCLK0: UART7CKEN Mask */ - -#define CLK_APBCLK0_UART8CKEN_Pos (20) /*!< CLK_T::APBCLK0: UART8CKEN Position */ -#define CLK_APBCLK0_UART8CKEN_Msk (0x1ul << CLK_APBCLK0_UART8CKEN_Pos) /*!< CLK_T::APBCLK0: UART8CKEN Mask */ - -#define CLK_APBCLK0_UART9CKEN_Pos (21) /*!< CLK_T::APBCLK0: UART9CKEN Position */ -#define CLK_APBCLK0_UART9CKEN_Msk (0x1ul << CLK_APBCLK0_UART9CKEN_Pos) /*!< CLK_T::APBCLK0: UART9CKEN Mask */ - -#define CLK_APBCLK0_UART10CKEN_Pos (22) /*!< CLK_T::APBCLK0: UART10CKEN Position */ -#define CLK_APBCLK0_UART10CKEN_Msk (0x1ul << CLK_APBCLK0_UART10CKEN_Pos) /*!< CLK_T::APBCLK0: UART10CKEN Mask */ - -#define CLK_APBCLK0_UART11CKEN_Pos (23) /*!< CLK_T::APBCLK0: UART11CKEN Position */ -#define CLK_APBCLK0_UART11CKEN_Msk (0x1ul << CLK_APBCLK0_UART11CKEN_Pos) /*!< CLK_T::APBCLK0: UART11CKEN Mask */ - -#define CLK_APBCLK0_UART12CKEN_Pos (24) /*!< CLK_T::APBCLK0: UART12CKEN Position */ -#define CLK_APBCLK0_UART12CKEN_Msk (0x1ul << CLK_APBCLK0_UART12CKEN_Pos) /*!< CLK_T::APBCLK0: UART12CKEN Mask */ - -#define CLK_APBCLK0_UART13CKEN_Pos (25) /*!< CLK_T::APBCLK0: UART13CKEN Position */ -#define CLK_APBCLK0_UART13CKEN_Msk (0x1ul << CLK_APBCLK0_UART13CKEN_Pos) /*!< CLK_T::APBCLK0: UART13CKEN Mask */ - -#define CLK_APBCLK0_UART14CKEN_Pos (26) /*!< CLK_T::APBCLK0: UART14CKEN Position */ -#define CLK_APBCLK0_UART14CKEN_Msk (0x1ul << CLK_APBCLK0_UART14CKEN_Pos) /*!< CLK_T::APBCLK0: UART14CKEN Mask */ - -#define CLK_APBCLK0_UART15CKEN_Pos (27) /*!< CLK_T::APBCLK0: UART15CKEN Position */ -#define CLK_APBCLK0_UART15CKEN_Msk (0x1ul << CLK_APBCLK0_UART15CKEN_Pos) /*!< CLK_T::APBCLK0: UART15CKEN Mask */ - -#define CLK_APBCLK0_UART16CKEN_Pos (28) /*!< CLK_T::APBCLK0: UART16CKEN Position */ -#define CLK_APBCLK0_UART16CKEN_Msk (0x1ul << CLK_APBCLK0_UART16CKEN_Pos) /*!< CLK_T::APBCLK0: UART16CKEN Mask */ - -#define CLK_APBCLK0_RTCCKEN_Pos (29) /*!< CLK_T::APBCLK0: RTCCKEN Position */ -#define CLK_APBCLK0_RTCCKEN_Msk (0x1ul << CLK_APBCLK0_RTCCKEN_Pos) /*!< CLK_T::APBCLK0: RTCCKEN Mask */ - -#define CLK_APBCLK0_DDRPCKEN_Pos (30) /*!< CLK_T::APBCLK0: DDRPCKEN Position */ -#define CLK_APBCLK0_DDRPCKEN_Msk (0x1ul << CLK_APBCLK0_DDRPCKEN_Pos) /*!< CLK_T::APBCLK0: DDRPCKEN Mask */ - -#define CLK_APBCLK0_KPICKEN_Pos (31) /*!< CLK_T::APBCLK0: KPICKEN Position */ -#define CLK_APBCLK0_KPICKEN_Msk (0x1ul << CLK_APBCLK0_KPICKEN_Pos) /*!< CLK_T::APBCLK0: KPICKEN Mask */ - -#define CLK_APBCLK1_I2C0CKEN_Pos (0) /*!< CLK_T::APBCLK1: I2C0CKEN Position */ -#define CLK_APBCLK1_I2C0CKEN_Msk (0x1ul << CLK_APBCLK1_I2C0CKEN_Pos) /*!< CLK_T::APBCLK1: I2C0CKEN Mask */ - -#define CLK_APBCLK1_I2C1CKEN_Pos (1) /*!< CLK_T::APBCLK1: I2C1CKEN Position */ -#define CLK_APBCLK1_I2C1CKEN_Msk (0x1ul << CLK_APBCLK1_I2C1CKEN_Pos) /*!< CLK_T::APBCLK1: I2C1CKEN Mask */ - -#define CLK_APBCLK1_I2C2CKEN_Pos (2) /*!< CLK_T::APBCLK1: I2C2CKEN Position */ -#define CLK_APBCLK1_I2C2CKEN_Msk (0x1ul << CLK_APBCLK1_I2C2CKEN_Pos) /*!< CLK_T::APBCLK1: I2C2CKEN Mask */ - -#define CLK_APBCLK1_I2C3CKEN_Pos (3) /*!< CLK_T::APBCLK1: I2C3CKEN Position */ -#define CLK_APBCLK1_I2C3CKEN_Msk (0x1ul << CLK_APBCLK1_I2C3CKEN_Pos) /*!< CLK_T::APBCLK1: I2C3CKEN Mask */ - -#define CLK_APBCLK1_I2C4CKEN_Pos (4) /*!< CLK_T::APBCLK1: I2C4CKEN Position */ -#define CLK_APBCLK1_I2C4CKEN_Msk (0x1ul << CLK_APBCLK1_I2C4CKEN_Pos) /*!< CLK_T::APBCLK1: I2C4CKEN Mask */ - -#define CLK_APBCLK1_I2C5CKEN_Pos (5) /*!< CLK_T::APBCLK1: I2C5CKEN Position */ -#define CLK_APBCLK1_I2C5CKEN_Msk (0x1ul << CLK_APBCLK1_I2C5CKEN_Pos) /*!< CLK_T::APBCLK1: I2C5CKEN Mask */ - -#define CLK_APBCLK1_QSPI0CKEN_Pos (6) /*!< CLK_T::APBCLK1: QSPI0CKEN Position */ -#define CLK_APBCLK1_QSPI0CKEN_Msk (0x1ul << CLK_APBCLK1_QSPI0CKEN_Pos) /*!< CLK_T::APBCLK1: QSPI0CKEN Mask */ - -#define CLK_APBCLK1_QSPI1CKEN_Pos (7) /*!< CLK_T::APBCLK1: QSPI1CKEN Position */ -#define CLK_APBCLK1_QSPI1CKEN_Msk (0x1ul << CLK_APBCLK1_QSPI1CKEN_Pos) /*!< CLK_T::APBCLK1: QSPI1CKEN Mask */ - -#define CLK_APBCLK1_SC0CKEN_Pos (12) /*!< CLK_T::APBCLK1: SC0CKEN Position */ -#define CLK_APBCLK1_SC0CKEN_Msk (0x1ul << CLK_APBCLK1_SC0CKEN_Pos) /*!< CLK_T::APBCLK1: SC0CKEN Mask */ - -#define CLK_APBCLK1_SC1CKEN_Pos (13) /*!< CLK_T::APBCLK1: SC1CKEN Position */ -#define CLK_APBCLK1_SC1CKEN_Msk (0x1ul << CLK_APBCLK1_SC1CKEN_Pos) /*!< CLK_T::APBCLK1: SC1CKEN Mask */ - -#define CLK_APBCLK1_WDT0CKEN_Pos (16) /*!< CLK_T::APBCLK1: WDT0CKEN Position */ -#define CLK_APBCLK1_WDT0CKEN_Msk (0x1ul << CLK_APBCLK1_WDT0CKEN_Pos) /*!< CLK_T::APBCLK1: WDT0CKEN Mask */ - -#define CLK_APBCLK1_WDT1CKEN_Pos (17) /*!< CLK_T::APBCLK1: WDT1CKEN Position */ -#define CLK_APBCLK1_WDT1CKEN_Msk (0x1ul << CLK_APBCLK1_WDT1CKEN_Pos) /*!< CLK_T::APBCLK1: WDT1CKEN Mask */ - -#define CLK_APBCLK1_WDT2CKEN_Pos (18) /*!< CLK_T::APBCLK1: WDT2CKEN Position */ -#define CLK_APBCLK1_WDT2CKEN_Msk (0x1ul << CLK_APBCLK1_WDT2CKEN_Pos) /*!< CLK_T::APBCLK1: WDT2CKEN Mask */ - -#define CLK_APBCLK1_EPWM0CKEN_Pos (24) /*!< CLK_T::APBCLK1: EPWM0CKEN Position */ -#define CLK_APBCLK1_EPWM0CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM0CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM0CKEN Mask */ - -#define CLK_APBCLK1_EPWM1CKEN_Pos (25) /*!< CLK_T::APBCLK1: EPWM1CKEN Position */ -#define CLK_APBCLK1_EPWM1CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM1CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM1CKEN Mask */ - -#define CLK_APBCLK1_EPWM2CKEN_Pos (26) /*!< CLK_T::APBCLK1: EPWM2CKEN Position */ -#define CLK_APBCLK1_EPWM2CKEN_Msk (0x1ul << CLK_APBCLK1_EPWM2CKEN_Pos) /*!< CLK_T::APBCLK1: EPWM2CKEN Mask */ - -#define CLK_APBCLK2_I2S0CKEN_Pos (0) /*!< CLK_T::APBCLK2: I2S0CKEN Position */ -#define CLK_APBCLK2_I2S0CKEN_Msk (0x1ul << CLK_APBCLK2_I2S0CKEN_Pos) /*!< CLK_T::APBCLK2: I2S0CKEN Mask */ - -#define CLK_APBCLK2_I2S1CKEN_Pos (1) /*!< CLK_T::APBCLK2: I2S1CKEN Position */ -#define CLK_APBCLK2_I2S1CKEN_Msk (0x1ul << CLK_APBCLK2_I2S1CKEN_Pos) /*!< CLK_T::APBCLK2: I2S1CKEN Mask */ - -#define CLK_APBCLK2_SSMCCEN_Pos (2) /*!< CLK_T::APBCLK2: SSMCCEN Position */ -#define CLK_APBCLK2_SSMCCEN_Msk (0x1ul << CLK_APBCLK2_SSMCCEN_Pos) /*!< CLK_T::APBCLK2: SSMCCEN Mask */ - -#define CLK_APBCLK2_SSPCCEN_Pos (3) /*!< CLK_T::APBCLK2: SSPCCEN Position */ -#define CLK_APBCLK2_SSPCCEN_Msk (0x1ul << CLK_APBCLK2_SSPCCEN_Pos) /*!< CLK_T::APBCLK2: SSPCCEN Mask */ - -#define CLK_APBCLK2_SPI0CKEN_Pos (4) /*!< CLK_T::APBCLK2: SPI0CKEN Position */ -#define CLK_APBCLK2_SPI0CKEN_Msk (0x1ul << CLK_APBCLK2_SPI0CKEN_Pos) /*!< CLK_T::APBCLK2: SPI0CKEN Mask */ - -#define CLK_APBCLK2_SPI1CKEN_Pos (5) /*!< CLK_T::APBCLK2: SPI1CKEN Position */ -#define CLK_APBCLK2_SPI1CKEN_Msk (0x1ul << CLK_APBCLK2_SPI1CKEN_Pos) /*!< CLK_T::APBCLK2: SPI1CKEN Mask */ - -#define CLK_APBCLK2_SPI2CKEN_Pos (6) /*!< CLK_T::APBCLK2: SPI2CKEN Position */ -#define CLK_APBCLK2_SPI2CKEN_Msk (0x1ul << CLK_APBCLK2_SPI2CKEN_Pos) /*!< CLK_T::APBCLK2: SPI2CKEN Mask */ - -#define CLK_APBCLK2_SPI3CKEN_Pos (7) /*!< CLK_T::APBCLK2: SPI3CKEN Position */ -#define CLK_APBCLK2_SPI3CKEN_Msk (0x1ul << CLK_APBCLK2_SPI3CKEN_Pos) /*!< CLK_T::APBCLK2: SPI3CKEN Mask */ - -#define CLK_APBCLK2_ECAP0CKEN_Pos (8) /*!< CLK_T::APBCLK2: ECAP0CKEN Position */ -#define CLK_APBCLK2_ECAP0CKEN_Msk (0x1ul << CLK_APBCLK2_ECAP0CKEN_Pos) /*!< CLK_T::APBCLK2: ECAP0CKEN Mask */ - -#define CLK_APBCLK2_ECAP1CKEN_Pos (9) /*!< CLK_T::APBCLK2: ECAP1CKEN Position */ -#define CLK_APBCLK2_ECAP1CKEN_Msk (0x1ul << CLK_APBCLK2_ECAP1CKEN_Pos) /*!< CLK_T::APBCLK2: ECAP1CKEN Mask */ - -#define CLK_APBCLK2_ECAP2CKEN_Pos (10) /*!< CLK_T::APBCLK2: ECAP2CKEN Position */ -#define CLK_APBCLK2_ECAP2CKEN_Msk (0x1ul << CLK_APBCLK2_ECAP2CKEN_Pos) /*!< CLK_T::APBCLK2: ECAP2CKEN Mask */ - -#define CLK_APBCLK2_QEI0CKEN_Pos (12) /*!< CLK_T::APBCLK2: QEI0CKEN Position */ -#define CLK_APBCLK2_QEI0CKEN_Msk (0x1ul << CLK_APBCLK2_QEI0CKEN_Pos) /*!< CLK_T::APBCLK2: QEI0CKEN Mask */ - -#define CLK_APBCLK2_QEI1CKEN_Pos (13) /*!< CLK_T::APBCLK2: QEI1CKEN Position */ -#define CLK_APBCLK2_QEI1CKEN_Msk (0x1ul << CLK_APBCLK2_QEI1CKEN_Pos) /*!< CLK_T::APBCLK2: QEI1CKEN Mask */ - -#define CLK_APBCLK2_QEI2CKEN_Pos (14) /*!< CLK_T::APBCLK2: QEI2CKEN Position */ -#define CLK_APBCLK2_QEI2CKEN_Msk (0x1ul << CLK_APBCLK2_QEI2CKEN_Pos) /*!< CLK_T::APBCLK2: QEI2CKEN Mask */ - -#define CLK_APBCLK2_ADCCKEN_Pos (24) /*!< CLK_T::APBCLK2: ADCCKEN Position */ -#define CLK_APBCLK2_ADCCKEN_Msk (0x1ul << CLK_APBCLK2_ADCCKEN_Pos) /*!< CLK_T::APBCLK2: ADCCKEN Mask */ - -#define CLK_APBCLK2_EADCCKEN_Pos (25) /*!< CLK_T::APBCLK2: EADCCKEN Position */ -#define CLK_APBCLK2_EADCCKEN_Msk (0x1ul << CLK_APBCLK2_EADCCKEN_Pos) /*!< CLK_T::APBCLK2: EADCCKEN Mask */ - -#define CLK_CLKSEL0_CA35CKSEL_Pos (0) /*!< CLK_T::CLKSEL0: CA35CKSEL Position */ -#define CLK_CLKSEL0_CA35CKSEL_Msk (0x3ul << CLK_CLKSEL0_CA35CKSEL_Pos) /*!< CLK_T::CLKSEL0: CA35CKSEL Mask */ - -#define CLK_CLKSEL0_SYSCK0SEL_Pos (2) /*!< CLK_T::CLKSEL0: SYSCK0SEL Position */ -#define CLK_CLKSEL0_SYSCK0SEL_Msk (0x1ul << CLK_CLKSEL0_SYSCK0SEL_Pos) /*!< CLK_T::CLKSEL0: SYSCK0SEL Mask */ - -#define CLK_CLKSEL0_LVRDBSEL_Pos (3) /*!< CLK_T::CLKSEL0: LVRDBSEL Position */ -#define CLK_CLKSEL0_LVRDBSEL_Msk (0x1ul << CLK_CLKSEL0_LVRDBSEL_Pos) /*!< CLK_T::CLKSEL0: LVRDBSEL Mask */ - -#define CLK_CLKSEL0_SYSCK1SEL_Pos (4) /*!< CLK_T::CLKSEL0: SYSCK1SEL Position */ -#define CLK_CLKSEL0_SYSCK1SEL_Msk (0x1ul << CLK_CLKSEL0_SYSCK1SEL_Pos) /*!< CLK_T::CLKSEL0: SYSCK1SEL Mask */ - -#define CLK_CLKSEL0_RTPSTSEL_Pos (8) /*!< CLK_T::CLKSEL0: RTPSTSEL Position */ -#define CLK_CLKSEL0_RTPSTSEL_Msk (0x7ul << CLK_CLKSEL0_RTPSTSEL_Pos) /*!< CLK_T::CLKSEL0: RTPSTSEL Mask */ - -#define CLK_CLKSEL0_CCAP0SEL_Pos (12) /*!< CLK_T::CLKSEL0: CCAP0SEL Position */ -#define CLK_CLKSEL0_CCAP0SEL_Msk (0x3ul << CLK_CLKSEL0_CCAP0SEL_Pos) /*!< CLK_T::CLKSEL0: CCAP0SEL Mask */ - -#define CLK_CLKSEL0_CCAP1SEL_Pos (14) /*!< CLK_T::CLKSEL0: CCAP1SEL Position */ -#define CLK_CLKSEL0_CCAP1SEL_Msk (0x3ul << CLK_CLKSEL0_CCAP1SEL_Pos) /*!< CLK_T::CLKSEL0: CCAP1SEL Mask */ - -#define CLK_CLKSEL0_SD0SEL_Pos (16) /*!< CLK_T::CLKSEL0: SD0SEL Position */ -#define CLK_CLKSEL0_SD0SEL_Msk (0x3ul << CLK_CLKSEL0_SD0SEL_Pos) /*!< CLK_T::CLKSEL0: SD0SEL Mask */ - -#define CLK_CLKSEL0_SD1SEL_Pos (18) /*!< CLK_T::CLKSEL0: SD1SEL Position */ -#define CLK_CLKSEL0_SD1SEL_Msk (0x3ul << CLK_CLKSEL0_SD1SEL_Pos) /*!< CLK_T::CLKSEL0: SD1SEL Mask */ - -#define CLK_CLKSEL0_DCUSEL_Pos (24) /*!< CLK_T::CLKSEL0: DCUSEL Position */ -#define CLK_CLKSEL0_DCUSEL_Msk (0x1ul << CLK_CLKSEL0_DCUSEL_Pos) /*!< CLK_T::CLKSEL0: DCUSEL Mask */ - -#define CLK_CLKSEL0_GFXSEL_Pos (26) /*!< CLK_T::CLKSEL0: GFXSEL Position */ -#define CLK_CLKSEL0_GFXSEL_Msk (0x1ul << CLK_CLKSEL0_GFXSEL_Pos) /*!< CLK_T::CLKSEL0: GFXSEL Mask */ - -#define CLK_CLKSEL0_DBGSEL_Pos (27) /*!< CLK_T::CLKSEL0: DBGSEL Position */ -#define CLK_CLKSEL0_DBGSEL_Msk (0x1ul << CLK_CLKSEL0_DBGSEL_Pos) /*!< CLK_T::CLKSEL0: DBGSEL Mask */ - -#define CLK_CLKSEL1_TMR0SEL_Pos (0) /*!< CLK_T::CLKSEL1: TMR0SEL Position */ -#define CLK_CLKSEL1_TMR0SEL_Msk (0x7ul << CLK_CLKSEL1_TMR0SEL_Pos) /*!< CLK_T::CLKSEL1: TMR0SEL Mask */ - -#define CLK_CLKSEL1_TMR1SEL_Pos (4) /*!< CLK_T::CLKSEL1: TMR1SEL Position */ -#define CLK_CLKSEL1_TMR1SEL_Msk (0x7ul << CLK_CLKSEL1_TMR1SEL_Pos) /*!< CLK_T::CLKSEL1: TMR1SEL Mask */ - -#define CLK_CLKSEL1_TMR2SEL_Pos (8) /*!< CLK_T::CLKSEL1: TMR2SEL Position */ -#define CLK_CLKSEL1_TMR2SEL_Msk (0x7ul << CLK_CLKSEL1_TMR2SEL_Pos) /*!< CLK_T::CLKSEL1: TMR2SEL Mask */ - -#define CLK_CLKSEL1_TMR3SEL_Pos (12) /*!< CLK_T::CLKSEL1: TMR3SEL Position */ -#define CLK_CLKSEL1_TMR3SEL_Msk (0x7ul << CLK_CLKSEL1_TMR3SEL_Pos) /*!< CLK_T::CLKSEL1: TMR3SEL Mask */ - -#define CLK_CLKSEL1_TMR4SEL_Pos (16) /*!< CLK_T::CLKSEL1: TMR4SEL Position */ -#define CLK_CLKSEL1_TMR4SEL_Msk (0x7ul << CLK_CLKSEL1_TMR4SEL_Pos) /*!< CLK_T::CLKSEL1: TMR4SEL Mask */ - -#define CLK_CLKSEL1_TMR5SEL_Pos (20) /*!< CLK_T::CLKSEL1: TMR5SEL Position */ -#define CLK_CLKSEL1_TMR5SEL_Msk (0x7ul << CLK_CLKSEL1_TMR5SEL_Pos) /*!< CLK_T::CLKSEL1: TMR5SEL Mask */ - -#define CLK_CLKSEL1_TMR6SEL_Pos (24) /*!< CLK_T::CLKSEL1: TMR6SEL Position */ -#define CLK_CLKSEL1_TMR6SEL_Msk (0x7ul << CLK_CLKSEL1_TMR6SEL_Pos) /*!< CLK_T::CLKSEL1: TMR6SEL Mask */ - -#define CLK_CLKSEL1_TMR7SEL_Pos (28) /*!< CLK_T::CLKSEL1: TMR7SEL Position */ -#define CLK_CLKSEL1_TMR7SEL_Msk (0x7ul << CLK_CLKSEL1_TMR7SEL_Pos) /*!< CLK_T::CLKSEL1: TMR7SEL Mask */ - -#define CLK_CLKSEL2_TMR8SEL_Pos (0) /*!< CLK_T::CLKSEL2: TMR8SEL Position */ -#define CLK_CLKSEL2_TMR8SEL_Msk (0x7ul << CLK_CLKSEL2_TMR8SEL_Pos) /*!< CLK_T::CLKSEL2: TMR8SEL Mask */ - -#define CLK_CLKSEL2_TMR9SEL_Pos (4) /*!< CLK_T::CLKSEL2: TMR9SEL Position */ -#define CLK_CLKSEL2_TMR9SEL_Msk (0x7ul << CLK_CLKSEL2_TMR9SEL_Pos) /*!< CLK_T::CLKSEL2: TMR9SEL Mask */ - -#define CLK_CLKSEL2_TMR10SEL_Pos (8) /*!< CLK_T::CLKSEL2: TMR10SEL Position */ -#define CLK_CLKSEL2_TMR10SEL_Msk (0x7ul << CLK_CLKSEL2_TMR10SEL_Pos) /*!< CLK_T::CLKSEL2: TMR10SEL Mask */ - -#define CLK_CLKSEL2_TMR11SEL_Pos (12) /*!< CLK_T::CLKSEL2: TMR11SEL Position */ -#define CLK_CLKSEL2_TMR11SEL_Msk (0x7ul << CLK_CLKSEL2_TMR11SEL_Pos) /*!< CLK_T::CLKSEL2: TMR11SEL Mask */ - -#define CLK_CLKSEL2_UART0SEL_Pos (16) /*!< CLK_T::CLKSEL2: UART0SEL Position */ -#define CLK_CLKSEL2_UART0SEL_Msk (0x3ul << CLK_CLKSEL2_UART0SEL_Pos) /*!< CLK_T::CLKSEL2: UART0SEL Mask */ - -#define CLK_CLKSEL2_UART1SEL_Pos (18) /*!< CLK_T::CLKSEL2: UART1SEL Position */ -#define CLK_CLKSEL2_UART1SEL_Msk (0x3ul << CLK_CLKSEL2_UART1SEL_Pos) /*!< CLK_T::CLKSEL2: UART1SEL Mask */ - -#define CLK_CLKSEL2_UART2SEL_Pos (20) /*!< CLK_T::CLKSEL2: UART2SEL Position */ -#define CLK_CLKSEL2_UART2SEL_Msk (0x3ul << CLK_CLKSEL2_UART2SEL_Pos) /*!< CLK_T::CLKSEL2: UART2SEL Mask */ - -#define CLK_CLKSEL2_UART3SEL_Pos (22) /*!< CLK_T::CLKSEL2: UART3SEL Position */ -#define CLK_CLKSEL2_UART3SEL_Msk (0x3ul << CLK_CLKSEL2_UART3SEL_Pos) /*!< CLK_T::CLKSEL2: UART3SEL Mask */ - -#define CLK_CLKSEL2_UART4SEL_Pos (24) /*!< CLK_T::CLKSEL2: UART4SEL Position */ -#define CLK_CLKSEL2_UART4SEL_Msk (0x3ul << CLK_CLKSEL2_UART4SEL_Pos) /*!< CLK_T::CLKSEL2: UART4SEL Mask */ - -#define CLK_CLKSEL2_UART5SEL_Pos (26) /*!< CLK_T::CLKSEL2: UART5SEL Position */ -#define CLK_CLKSEL2_UART5SEL_Msk (0x3ul << CLK_CLKSEL2_UART5SEL_Pos) /*!< CLK_T::CLKSEL2: UART5SEL Mask */ - -#define CLK_CLKSEL2_UART6SEL_Pos (28) /*!< CLK_T::CLKSEL2: UART6SEL Position */ -#define CLK_CLKSEL2_UART6SEL_Msk (0x3ul << CLK_CLKSEL2_UART6SEL_Pos) /*!< CLK_T::CLKSEL2: UART6SEL Mask */ - -#define CLK_CLKSEL2_UART7SEL_Pos (30) /*!< CLK_T::CLKSEL2: UART7SEL Position */ -#define CLK_CLKSEL2_UART7SEL_Msk (0x3ul << CLK_CLKSEL2_UART7SEL_Pos) /*!< CLK_T::CLKSEL2: UART7SEL Mask */ - -#define CLK_CLKSEL3_UART8SEL_Pos (0) /*!< CLK_T::CLKSEL3: UART8SEL Position */ -#define CLK_CLKSEL3_UART8SEL_Msk (0x3ul << CLK_CLKSEL3_UART8SEL_Pos) /*!< CLK_T::CLKSEL3: UART8SEL Mask */ - -#define CLK_CLKSEL3_UART9SEL_Pos (2) /*!< CLK_T::CLKSEL3: UART9SEL Position */ -#define CLK_CLKSEL3_UART9SEL_Msk (0x3ul << CLK_CLKSEL3_UART9SEL_Pos) /*!< CLK_T::CLKSEL3: UART9SEL Mask */ - -#define CLK_CLKSEL3_UART10SEL_Pos (4) /*!< CLK_T::CLKSEL3: UART10SEL Position */ -#define CLK_CLKSEL3_UART10SEL_Msk (0x3ul << CLK_CLKSEL3_UART10SEL_Pos) /*!< CLK_T::CLKSEL3: UART10SEL Mask */ - -#define CLK_CLKSEL3_UART11SEL_Pos (6) /*!< CLK_T::CLKSEL3: UART11SEL Position */ -#define CLK_CLKSEL3_UART11SEL_Msk (0x3ul << CLK_CLKSEL3_UART11SEL_Pos) /*!< CLK_T::CLKSEL3: UART11SEL Mask */ - -#define CLK_CLKSEL3_UART12SEL_Pos (8) /*!< CLK_T::CLKSEL3: UART12SEL Position */ -#define CLK_CLKSEL3_UART12SEL_Msk (0x3ul << CLK_CLKSEL3_UART12SEL_Pos) /*!< CLK_T::CLKSEL3: UART12SEL Mask */ - -#define CLK_CLKSEL3_UART13SEL_Pos (10) /*!< CLK_T::CLKSEL3: UART13SEL Position */ -#define CLK_CLKSEL3_UART13SEL_Msk (0x3ul << CLK_CLKSEL3_UART13SEL_Pos) /*!< CLK_T::CLKSEL3: UART13SEL Mask */ - -#define CLK_CLKSEL3_UART14SEL_Pos (12) /*!< CLK_T::CLKSEL3: UART14SEL Position */ -#define CLK_CLKSEL3_UART14SEL_Msk (0x3ul << CLK_CLKSEL3_UART14SEL_Pos) /*!< CLK_T::CLKSEL3: UART14SEL Mask */ - -#define CLK_CLKSEL3_UART15SEL_Pos (14) /*!< CLK_T::CLKSEL3: UART15SEL Position */ -#define CLK_CLKSEL3_UART15SEL_Msk (0x3ul << CLK_CLKSEL3_UART15SEL_Pos) /*!< CLK_T::CLKSEL3: UART15SEL Mask */ - -#define CLK_CLKSEL3_UART16SEL_Pos (16) /*!< CLK_T::CLKSEL3: UART16SEL Position */ -#define CLK_CLKSEL3_UART16SEL_Msk (0x3ul << CLK_CLKSEL3_UART16SEL_Pos) /*!< CLK_T::CLKSEL3: UART16SEL Mask */ - -#define CLK_CLKSEL3_WDT0SEL_Pos (20) /*!< CLK_T::CLKSEL3: WDT0SEL Position */ -#define CLK_CLKSEL3_WDT0SEL_Msk (0x3ul << CLK_CLKSEL3_WDT0SEL_Pos) /*!< CLK_T::CLKSEL3: WDT0SEL Mask */ - -#define CLK_CLKSEL3_WWDT0SEL_Pos (22) /*!< CLK_T::CLKSEL3: WWDT0SEL Position */ -#define CLK_CLKSEL3_WWDT0SEL_Msk (0x3ul << CLK_CLKSEL3_WWDT0SEL_Pos) /*!< CLK_T::CLKSEL3: WWDT0SEL Mask */ - -#define CLK_CLKSEL3_WDT1SEL_Pos (24) /*!< CLK_T::CLKSEL3: WDT1SEL Position */ -#define CLK_CLKSEL3_WDT1SEL_Msk (0x3ul << CLK_CLKSEL3_WDT1SEL_Pos) /*!< CLK_T::CLKSEL3: WDT1SEL Mask */ - -#define CLK_CLKSEL3_WWDT1SEL_Pos (26) /*!< CLK_T::CLKSEL3: WWDT1SEL Position */ -#define CLK_CLKSEL3_WWDT1SEL_Msk (0x3ul << CLK_CLKSEL3_WWDT1SEL_Pos) /*!< CLK_T::CLKSEL3: WWDT1SEL Mask */ - -#define CLK_CLKSEL3_WDT2SEL_Pos (28) /*!< CLK_T::CLKSEL3: WDT2SEL Position */ -#define CLK_CLKSEL3_WDT2SEL_Msk (0x3ul << CLK_CLKSEL3_WDT2SEL_Pos) /*!< CLK_T::CLKSEL3: WDT2SEL Mask */ - -#define CLK_CLKSEL3_WWDT2SEL_Pos (30) /*!< CLK_T::CLKSEL3: WWDT2SEL Position */ -#define CLK_CLKSEL3_WWDT2SEL_Msk (0x3ul << CLK_CLKSEL3_WWDT2SEL_Pos) /*!< CLK_T::CLKSEL3: WWDT2SEL Mask */ - -#define CLK_CLKSEL4_SPI0SEL_Pos (0) /*!< CLK_T::CLKSEL4: SPI0SEL Position */ -#define CLK_CLKSEL4_SPI0SEL_Msk (0x3ul << CLK_CLKSEL4_SPI0SEL_Pos) /*!< CLK_T::CLKSEL4: SPI0SEL Mask */ - -#define CLK_CLKSEL4_SPI1SEL_Pos (2) /*!< CLK_T::CLKSEL4: SPI1SEL Position */ -#define CLK_CLKSEL4_SPI1SEL_Msk (0x3ul << CLK_CLKSEL4_SPI1SEL_Pos) /*!< CLK_T::CLKSEL4: SPI1SEL Mask */ - -#define CLK_CLKSEL4_SPI2SEL_Pos (4) /*!< CLK_T::CLKSEL4: SPI2SEL Position */ -#define CLK_CLKSEL4_SPI2SEL_Msk (0x3ul << CLK_CLKSEL4_SPI2SEL_Pos) /*!< CLK_T::CLKSEL4: SPI2SEL Mask */ - -#define CLK_CLKSEL4_SPI3SEL_Pos (6) /*!< CLK_T::CLKSEL4: SPI3SEL Position */ -#define CLK_CLKSEL4_SPI3SEL_Msk (0x3ul << CLK_CLKSEL4_SPI3SEL_Pos) /*!< CLK_T::CLKSEL4: SPI3SEL Mask */ - -#define CLK_CLKSEL4_QSPI0SEL_Pos (8) /*!< CLK_T::CLKSEL4: QSPI0SEL Position */ -#define CLK_CLKSEL4_QSPI0SEL_Msk (0x3ul << CLK_CLKSEL4_QSPI0SEL_Pos) /*!< CLK_T::CLKSEL4: QSPI0SEL Mask */ - -#define CLK_CLKSEL4_QSPI1SEL_Pos (10) /*!< CLK_T::CLKSEL4: QSPI1SEL Position */ -#define CLK_CLKSEL4_QSPI1SEL_Msk (0x3ul << CLK_CLKSEL4_QSPI1SEL_Pos) /*!< CLK_T::CLKSEL4: QSPI1SEL Mask */ - -#define CLK_CLKSEL4_I2S0SEL_Pos (12) /*!< CLK_T::CLKSEL4: I2S0SEL Position */ -#define CLK_CLKSEL4_I2S0SEL_Msk (0x3ul << CLK_CLKSEL4_I2S0SEL_Pos) /*!< CLK_T::CLKSEL4: I2S0SEL Mask */ - -#define CLK_CLKSEL4_I2S1SEL_Pos (14) /*!< CLK_T::CLKSEL4: I2S1SEL Position */ -#define CLK_CLKSEL4_I2S1SEL_Msk (0x3ul << CLK_CLKSEL4_I2S1SEL_Pos) /*!< CLK_T::CLKSEL4: I2S1SEL Mask */ - -#define CLK_CLKSEL4_CANFD0SEL_Pos (16) /*!< CLK_T::CLKSEL4: CANFD0SEL Position */ -#define CLK_CLKSEL4_CANFD0SEL_Msk (0x1ul << CLK_CLKSEL4_CANFD0SEL_Pos) /*!< CLK_T::CLKSEL4: CANFD0SEL Mask */ - -#define CLK_CLKSEL4_CANFD1SEL_Pos (17) /*!< CLK_T::CLKSEL4: CANFD1SEL Position */ -#define CLK_CLKSEL4_CANFD1SEL_Msk (0x1ul << CLK_CLKSEL4_CANFD1SEL_Pos) /*!< CLK_T::CLKSEL4: CANFD1SEL Mask */ - -#define CLK_CLKSEL4_CANFD2SEL_Pos (18) /*!< CLK_T::CLKSEL4: CANFD2SEL Position */ -#define CLK_CLKSEL4_CANFD2SEL_Msk (0x1ul << CLK_CLKSEL4_CANFD2SEL_Pos) /*!< CLK_T::CLKSEL4: CANFD2SEL Mask */ - -#define CLK_CLKSEL4_CANFD3SEL_Pos (19) /*!< CLK_T::CLKSEL4: CANFD3SEL Position */ -#define CLK_CLKSEL4_CANFD3SEL_Msk (0x1ul << CLK_CLKSEL4_CANFD3SEL_Pos) /*!< CLK_T::CLKSEL4: CANFD3SEL Mask */ - -#define CLK_CLKSEL4_CKOSEL_Pos (24) /*!< CLK_T::CLKSEL4: CKOSEL Position */ -#define CLK_CLKSEL4_CKOSEL_Msk (0xful << CLK_CLKSEL4_CKOSEL_Pos) /*!< CLK_T::CLKSEL4: CKOSEL Mask */ - -#define CLK_CLKSEL4_SC0SEL_Pos (28) /*!< CLK_T::CLKSEL4: SC0SEL Position */ -#define CLK_CLKSEL4_SC0SEL_Msk (0x1ul << CLK_CLKSEL4_SC0SEL_Pos) /*!< CLK_T::CLKSEL4: SC0SEL Mask */ - -#define CLK_CLKSEL4_SC1SEL_Pos (29) /*!< CLK_T::CLKSEL4: SC1SEL Position */ -#define CLK_CLKSEL4_SC1SEL_Msk (0x1ul << CLK_CLKSEL4_SC1SEL_Pos) /*!< CLK_T::CLKSEL4: SC1SEL Mask */ - -#define CLK_CLKSEL4_KPISEL_Pos (30) /*!< CLK_T::CLKSEL4: KPISEL Position */ -#define CLK_CLKSEL4_KPISEL_Msk (0x1ul << CLK_CLKSEL4_KPISEL_Pos) /*!< CLK_T::CLKSEL4: KPISEL Mask */ - -#define CLK_CLKDIV0_CANFD0DIV_Pos (0) /*!< CLK_T::CLKDIV0: CANFD0DIV Position */ -#define CLK_CLKDIV0_CANFD0DIV_Msk (0x7ul << CLK_CLKDIV0_CANFD0DIV_Pos) /*!< CLK_T::CLKDIV0: CANFD0DIV Mask */ - -#define CLK_CLKDIV0_CANFD1DIV_Pos (4) /*!< CLK_T::CLKDIV0: CANFD1DIV Position */ -#define CLK_CLKDIV0_CANFD1DIV_Msk (0x7ul << CLK_CLKDIV0_CANFD1DIV_Pos) /*!< CLK_T::CLKDIV0: CANFD1DIV Mask */ - -#define CLK_CLKDIV0_CANFD2DIV_Pos (8) /*!< CLK_T::CLKDIV0: CANFD2DIV Position */ -#define CLK_CLKDIV0_CANFD2DIV_Msk (0x7ul << CLK_CLKDIV0_CANFD2DIV_Pos) /*!< CLK_T::CLKDIV0: CANFD2DIV Mask */ - -#define CLK_CLKDIV0_CANFD3DIV_Pos (12) /*!< CLK_T::CLKDIV0: CANFD3DIV Position */ -#define CLK_CLKDIV0_CANFD3DIV_Msk (0x7ul << CLK_CLKDIV0_CANFD3DIV_Pos) /*!< CLK_T::CLKDIV0: CANFD3DIV Mask */ - -#define CLK_CLKDIV0_DCUPDIV_Pos (16) /*!< CLK_T::CLKDIV0: DCUPDIV Position */ -#define CLK_CLKDIV0_DCUPDIV_Msk (0x7ul << CLK_CLKDIV0_DCUPDIV_Pos) /*!< CLK_T::CLKDIV0: DCUPDIV Mask */ - -#define CLK_CLKDIV0_ACLK0DIV_Pos (26) /*!< CLK_T::CLKDIV0: ACLK0DIV Position */ -#define CLK_CLKDIV0_ACLK0DIV_Msk (0x1ul << CLK_CLKDIV0_ACLK0DIV_Pos) /*!< CLK_T::CLKDIV0: ACLK0DIV Mask */ - -#define CLK_CLKDIV0_EMAC0DIV_Pos (28) /*!< CLK_T::CLKDIV0: EMAC0DIV Position */ -#define CLK_CLKDIV0_EMAC0DIV_Msk (0x3ul << CLK_CLKDIV0_EMAC0DIV_Pos) /*!< CLK_T::CLKDIV0: EMAC0DIV Mask */ - -#define CLK_CLKDIV0_EMAC1DIV_Pos (30) /*!< CLK_T::CLKDIV0: EMAC1DIV Position */ -#define CLK_CLKDIV0_EMAC1DIV_Msk (0x3ul << CLK_CLKDIV0_EMAC1DIV_Pos) /*!< CLK_T::CLKDIV0: EMAC1DIV Mask */ - -#define CLK_CLKDIV1_SC0DIV_Pos (0) /*!< CLK_T::CLKDIV1: SC0DIV Position */ -#define CLK_CLKDIV1_SC0DIV_Msk (0xful << CLK_CLKDIV1_SC0DIV_Pos) /*!< CLK_T::CLKDIV1: SC0DIV Mask */ - -#define CLK_CLKDIV1_SC1DIV_Pos (4) /*!< CLK_T::CLKDIV1: SC1DIV Position */ -#define CLK_CLKDIV1_SC1DIV_Msk (0xful << CLK_CLKDIV1_SC1DIV_Pos) /*!< CLK_T::CLKDIV1: SC1DIV Mask */ - -#define CLK_CLKDIV1_CCAP0DIV_Pos (8) /*!< CLK_T::CLKDIV1: CCAP0DIV Position */ -#define CLK_CLKDIV1_CCAP0DIV_Msk (0xful << CLK_CLKDIV1_CCAP0DIV_Pos) /*!< CLK_T::CLKDIV1: CCAP0DIV Mask */ - -#define CLK_CLKDIV1_CCAP1DIV_Pos (12) /*!< CLK_T::CLKDIV1: CCAP1DIV Position */ -#define CLK_CLKDIV1_CCAP1DIV_Msk (0xful << CLK_CLKDIV1_CCAP1DIV_Pos) /*!< CLK_T::CLKDIV1: CCAP1DIV Mask */ - -#define CLK_CLKDIV1_UART0DIV_Pos (16) /*!< CLK_T::CLKDIV1: UART0DIV Position */ -#define CLK_CLKDIV1_UART0DIV_Msk (0xful << CLK_CLKDIV1_UART0DIV_Pos) /*!< CLK_T::CLKDIV1: UART0DIV Mask */ - -#define CLK_CLKDIV1_UART1DIV_Pos (20) /*!< CLK_T::CLKDIV1: UART1DIV Position */ -#define CLK_CLKDIV1_UART1DIV_Msk (0xful << CLK_CLKDIV1_UART1DIV_Pos) /*!< CLK_T::CLKDIV1: UART1DIV Mask */ - -#define CLK_CLKDIV1_UART2DIV_Pos (24) /*!< CLK_T::CLKDIV1: UART2DIV Position */ -#define CLK_CLKDIV1_UART2DIV_Msk (0xful << CLK_CLKDIV1_UART2DIV_Pos) /*!< CLK_T::CLKDIV1: UART2DIV Mask */ - -#define CLK_CLKDIV1_UART3DIV_Pos (28) /*!< CLK_T::CLKDIV1: UART3DIV Position */ -#define CLK_CLKDIV1_UART3DIV_Msk (0xful << CLK_CLKDIV1_UART3DIV_Pos) /*!< CLK_T::CLKDIV1: UART3DIV Mask */ - -#define CLK_CLKDIV2_UART4DIV_Pos (0) /*!< CLK_T::CLKDIV2: UART4DIV Position */ -#define CLK_CLKDIV2_UART4DIV_Msk (0xful << CLK_CLKDIV2_UART4DIV_Pos) /*!< CLK_T::CLKDIV2: UART4DIV Mask */ - -#define CLK_CLKDIV2_UART5DIV_Pos (4) /*!< CLK_T::CLKDIV2: UART5DIV Position */ -#define CLK_CLKDIV2_UART5DIV_Msk (0xful << CLK_CLKDIV2_UART5DIV_Pos) /*!< CLK_T::CLKDIV2: UART5DIV Mask */ - -#define CLK_CLKDIV2_UART6DIV_Pos (8) /*!< CLK_T::CLKDIV2: UART6DIV Position */ -#define CLK_CLKDIV2_UART6DIV_Msk (0xful << CLK_CLKDIV2_UART6DIV_Pos) /*!< CLK_T::CLKDIV2: UART6DIV Mask */ - -#define CLK_CLKDIV2_UART7DIV_Pos (12) /*!< CLK_T::CLKDIV2: UART7DIV Position */ -#define CLK_CLKDIV2_UART7DIV_Msk (0xful << CLK_CLKDIV2_UART7DIV_Pos) /*!< CLK_T::CLKDIV2: UART7DIV Mask */ - -#define CLK_CLKDIV2_UART8DIV_Pos (16) /*!< CLK_T::CLKDIV2: UART8DIV Position */ -#define CLK_CLKDIV2_UART8DIV_Msk (0xful << CLK_CLKDIV2_UART8DIV_Pos) /*!< CLK_T::CLKDIV2: UART8DIV Mask */ - -#define CLK_CLKDIV2_UART9DIV_Pos (20) /*!< CLK_T::CLKDIV2: UART9DIV Position */ -#define CLK_CLKDIV2_UART9DIV_Msk (0xful << CLK_CLKDIV2_UART9DIV_Pos) /*!< CLK_T::CLKDIV2: UART9DIV Mask */ - -#define CLK_CLKDIV2_UART10DIV_Pos (24) /*!< CLK_T::CLKDIV2: UART10DIV Position */ -#define CLK_CLKDIV2_UART10DIV_Msk (0xful << CLK_CLKDIV2_UART10DIV_Pos) /*!< CLK_T::CLKDIV2: UART10DIV Mask */ - -#define CLK_CLKDIV2_UART11DIV_Pos (28) /*!< CLK_T::CLKDIV2: UART11DIV Position */ -#define CLK_CLKDIV2_UART11DIV_Msk (0xful << CLK_CLKDIV2_UART11DIV_Pos) /*!< CLK_T::CLKDIV2: UART11DIV Mask */ - -#define CLK_CLKDIV3_UART12DIV_Pos (0) /*!< CLK_T::CLKDIV3: UART12DIV Position */ -#define CLK_CLKDIV3_UART12DIV_Msk (0xful << CLK_CLKDIV3_UART12DIV_Pos) /*!< CLK_T::CLKDIV3: UART12DIV Mask */ - -#define CLK_CLKDIV3_UART13DIV_Pos (4) /*!< CLK_T::CLKDIV3: UART13DIV Position */ -#define CLK_CLKDIV3_UART13DIV_Msk (0xful << CLK_CLKDIV3_UART13DIV_Pos) /*!< CLK_T::CLKDIV3: UART13DIV Mask */ - -#define CLK_CLKDIV3_UART14DIV_Pos (8) /*!< CLK_T::CLKDIV3: UART14DIV Position */ -#define CLK_CLKDIV3_UART14DIV_Msk (0xful << CLK_CLKDIV3_UART14DIV_Pos) /*!< CLK_T::CLKDIV3: UART14DIV Mask */ - -#define CLK_CLKDIV3_UART15DIV_Pos (12) /*!< CLK_T::CLKDIV3: UART15DIV Position */ -#define CLK_CLKDIV3_UART15DIV_Msk (0xful << CLK_CLKDIV3_UART15DIV_Pos) /*!< CLK_T::CLKDIV3: UART15DIV Mask */ - -#define CLK_CLKDIV3_UART16DIV_Pos (16) /*!< CLK_T::CLKDIV3: UART16DIV Position */ -#define CLK_CLKDIV3_UART16DIV_Msk (0xful << CLK_CLKDIV3_UART16DIV_Pos) /*!< CLK_T::CLKDIV3: UART16DIV Mask */ - -#define CLK_CLKDIV4_EADCDIV_Pos (0) /*!< CLK_T::CLKDIV4: EADCDIV Position */ -#define CLK_CLKDIV4_EADCDIV_Msk (0xful << CLK_CLKDIV4_EADCDIV_Pos) /*!< CLK_T::CLKDIV4: EADCDIV Mask */ - -#define CLK_CLKDIV4_ADCDIV_Pos (4) /*!< CLK_T::CLKDIV4: ADCDIV Position */ -#define CLK_CLKDIV4_ADCDIV_Msk (0x1fffful << CLK_CLKDIV4_ADCDIV_Pos) /*!< CLK_T::CLKDIV4: ADCDIV Mask */ - -#define CLK_CLKDIV4_KPIDIV_Pos (24) /*!< CLK_T::CLKDIV4: KPIDIV Position */ -#define CLK_CLKDIV4_KPIDIV_Msk (0xfful << CLK_CLKDIV4_KPIDIV_Pos) /*!< CLK_T::CLKDIV4: KPIDIV Mask */ - -#define CLK_CLKOCTL_FREQSEL_Pos (0) /*!< CLK_T::CLKOCTL: FREQSEL Position */ -#define CLK_CLKOCTL_FREQSEL_Msk (0xful << CLK_CLKOCTL_FREQSEL_Pos) /*!< CLK_T::CLKOCTL: FREQSEL Mask */ - -#define CLK_CLKOCTL_CLKOEN_Pos (4) /*!< CLK_T::CLKOCTL: CLKOEN Position */ -#define CLK_CLKOCTL_CLKOEN_Msk (0x1ul << CLK_CLKOCTL_CLKOEN_Pos) /*!< CLK_T::CLKOCTL: CLKOEN Mask */ - -#define CLK_CLKOCTL_DIV1EN_Pos (5) /*!< CLK_T::CLKOCTL: DIV1EN Position */ -#define CLK_CLKOCTL_DIV1EN_Msk (0x1ul << CLK_CLKOCTL_DIV1EN_Pos) /*!< CLK_T::CLKOCTL: DIV1EN Mask */ - -#define CLK_STATUS_HXTSTB_Pos (0) /*!< CLK_T::STATUS: HXTSTB Position */ -#define CLK_STATUS_HXTSTB_Msk (0x1ul << CLK_STATUS_HXTSTB_Pos) /*!< CLK_T::STATUS: HXTSTB Mask */ - -#define CLK_STATUS_LXTSTB_Pos (1) /*!< CLK_T::STATUS: LXTSTB Position */ -#define CLK_STATUS_LXTSTB_Msk (0x1ul << CLK_STATUS_LXTSTB_Pos) /*!< CLK_T::STATUS: LXTSTB Mask */ - -#define CLK_STATUS_SYSPLLSTB_Pos (2) /*!< CLK_T::STATUS: SYSPLLSTB Position */ -#define CLK_STATUS_SYSPLLSTB_Msk (0x1ul << CLK_STATUS_SYSPLLSTB_Pos) /*!< CLK_T::STATUS: SYSPLLSTB Mask */ - -#define CLK_STATUS_LIRCSTB_Pos (3) /*!< CLK_T::STATUS: LIRCSTB Position */ -#define CLK_STATUS_LIRCSTB_Msk (0x1ul << CLK_STATUS_LIRCSTB_Pos) /*!< CLK_T::STATUS: LIRCSTB Mask */ - -#define CLK_STATUS_HIRCSTB_Pos (4) /*!< CLK_T::STATUS: HIRCSTB Position */ -#define CLK_STATUS_HIRCSTB_Msk (0x1ul << CLK_STATUS_HIRCSTB_Pos) /*!< CLK_T::STATUS: HIRCSTB Mask */ - -#define CLK_STATUS_CAPLLSTB_Pos (6) /*!< CLK_T::STATUS: CAPLLSTB Position */ -#define CLK_STATUS_CAPLLSTB_Msk (0x1ul << CLK_STATUS_CAPLLSTB_Pos) /*!< CLK_T::STATUS: CAPLLSTB Mask */ - -#define CLK_STATUS_DDRPLLSTB_Pos (8) /*!< CLK_T::STATUS: DDRPLLSTB Position */ -#define CLK_STATUS_DDRPLLSTB_Msk (0x1ul << CLK_STATUS_DDRPLLSTB_Pos) /*!< CLK_T::STATUS: DDRPLLSTB Mask */ - -#define CLK_STATUS_EPLLSTB_Pos (9) /*!< CLK_T::STATUS: EPLLSTB Position */ -#define CLK_STATUS_EPLLSTB_Msk (0x1ul << CLK_STATUS_EPLLSTB_Pos) /*!< CLK_T::STATUS: EPLLSTB Mask */ - -#define CLK_STATUS_APLLSTB_Pos (10) /*!< CLK_T::STATUS: APLLSTB Position */ -#define CLK_STATUS_APLLSTB_Msk (0x1ul << CLK_STATUS_APLLSTB_Pos) /*!< CLK_T::STATUS: APLLSTB Mask */ - -#define CLK_STATUS_VPLLSTB_Pos (11) /*!< CLK_T::STATUS: VPLLSTB Position */ -#define CLK_STATUS_VPLLSTB_Msk (0x1ul << CLK_STATUS_VPLLSTB_Pos) /*!< CLK_T::STATUS: VPLLSTB Mask */ - -#define CLK_PLL0CTL0_FBDIV_Pos (0) /*!< CLK_T::PLL0CTL0: FBDIV Position */ -#define CLK_PLL0CTL0_FBDIV_Msk (0xfful << CLK_PLL0CTL0_FBDIV_Pos) /*!< CLK_T::PLL0CTL0: FBDIV Mask */ - -#define CLK_PLL0CTL0_INDIV_Pos (8) /*!< CLK_T::PLL0CTL0: INDIV Position */ -#define CLK_PLL0CTL0_INDIV_Msk (0xful << CLK_PLL0CTL0_INDIV_Pos) /*!< CLK_T::PLL0CTL0: INDIV Mask */ - -#define CLK_PLL0CTL0_OUTDIV_Pos (12) /*!< CLK_T::PLL0CTL0: MODE Position */ -#define CLK_PLL0CTL0_OUTDIV_Msk (0x3ul << CLK_PLL0CTL0_OUTDIV_Pos) /*!< CLK_T::PLL0CTL0: MODE Mask */ - -#define CLK_PLL0CTL0_PD_Pos (16) /*!< CLK_T::PLL0CTL0: PD Position */ -#define CLK_PLL0CTL0_PD_Msk (0x1ul << CLK_PLL0CTL0_PD_Pos) /*!< CLK_T::PLL0CTL0: PD Mask */ - -#define CLK_PLL0CTL0_BP_Pos (17) /*!< CLK_T::PLL0CTL0: BP Position */ -#define CLK_PLL0CTL0_BP_Msk (0x1ul << CLK_PLL0CTL0_BP_Pos) /*!< CLK_T::PLL0CTL0: BP Mask */ - -/* For PLL2 ~ PLL5 */ -#define CLK_PLLnCTL0_FBDIV_Pos (0) /*!< CLK_T::PLLnCTL0: FBDIV Position */ -#define CLK_PLLnCTL0_FBDIV_Msk (0x7fful << CLK_PLLnCTL0_FBDIV_Pos) /*!< CLK_T::PLLnCTL0: FBDIV Mask */ - -#define CLK_PLLnCTL0_INDIV_Pos (12) /*!< CLK_T::PLLnCTL0: INDIV Position */ -#define CLK_PLLnCTL0_INDIV_Msk (0x3ful << CLK_PLLnCTL0_INDIV_Pos) /*!< CLK_T::PLLnCTL0: INDIV Mask */ - -#define CLK_PLLnCTL0_MODE_Pos (18) /*!< CLK_T::PLLnCTL0: MODE Position */ -#define CLK_PLLnCTL0_MODE_Msk (0x3ul << CLK_PLLnCTL0_MODE_Pos) /*!< CLK_T::PLLnCTL0: MODE Mask */ - -#define CLK_PLLnCTL0_SSRATE_Pos (20) /*!< CLK_T::PLLnCTL0: SSRATE Position */ -#define CLK_PLLnCTL0_SSRATE_Msk (0x7fful << CLK_PLLnCTL0_SSRATE_Pos) /*!< CLK_T::PLLnCTL0: SSRATE Mask */ - -#define CLK_PLLnCTL1_PD_Pos (0) /*!< CLK_T::PLLnCTL1: PD Position */ -#define CLK_PLLnCTL1_PD_Msk (0x1ul << CLK_PLLnCTL1_PD_Pos) /*!< CLK_T::PLLnCTL1: PD Mask */ - -#define CLK_PLLnCTL1_BP_Pos (1) /*!< CLK_T::PLLnCTL1: BP Position */ -#define CLK_PLLnCTL1_BP_Msk (0x1ul << CLK_PLLnCTL1_BP_Pos) /*!< CLK_T::PLLnCTL1: BP Mask */ - -#define CLK_PLLnCTL1_OUTDIV_Pos (4) /*!< CLK_T::PLLnCTL1: OUTDIV Position */ -#define CLK_PLLnCTL1_OUTDIV_Msk (0x7ul << CLK_PLLnCTL1_OUTDIV_Pos) /*!< CLK_T::PLLnCTL1: OUTDIV Mask */ - -#define CLK_PLLnCTL1_FRAC_Pos (8) /*!< CLK_T::PLLnCTL1: FRAC Position */ -#define CLK_PLLnCTL1_FRAC_Msk (0xfffffful << CLK_PLLnCTL1_FRAC_Pos) /*!< CLK_T::PLLnCTL1: FRAC Mask */ - -#define CLK_PLLnCTL2_SLOPE_Pos (0) /*!< CLK_T::PLLnCTL2: SLOPE Position */ -#define CLK_PLLnCTL2_SLOPE_Msk (0xfffffful << CLK_PLLnCTL2_SLOPE_Pos) /*!< CLK_T::PLLnCTL2: SLOPE Mask */ - -#define CLK_CLKDCTL_HXTFDEN_Pos (4) /*!< CLK_T::CLKDCTL: HXTFDEN Position */ -#define CLK_CLKDCTL_HXTFDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFDEN Mask */ - -#define CLK_CLKDCTL_HXTFIEN_Pos (5) /*!< CLK_T::CLKDCTL: HXTFIEN Position */ -#define CLK_CLKDCTL_HXTFIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFIEN Mask */ - -#define CLK_CLKDCTL_LXTFDEN_Pos (12) /*!< CLK_T::CLKDCTL: LXTFDEN Position */ -#define CLK_CLKDCTL_LXTFDEN_Msk (0x1ul << CLK_CLKDCTL_LXTFDEN_Pos) /*!< CLK_T::CLKDCTL: LXTFDEN Mask */ - -#define CLK_CLKDCTL_LXTFIEN_Pos (13) /*!< CLK_T::CLKDCTL: LXTFIEN Position */ -#define CLK_CLKDCTL_LXTFIEN_Msk (0x1ul << CLK_CLKDCTL_LXTFIEN_Pos) /*!< CLK_T::CLKDCTL: LXTFIEN Mask */ - -#define CLK_CLKDCTL_HXTFQDEN_Pos (16) /*!< CLK_T::CLKDCTL: HXTFQDEN Position */ -#define CLK_CLKDCTL_HXTFQDEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQDEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQDEN Mask */ - -#define CLK_CLKDCTL_HXTFQIEN_Pos (17) /*!< CLK_T::CLKDCTL: HXTFQIEN Position */ -#define CLK_CLKDCTL_HXTFQIEN_Msk (0x1ul << CLK_CLKDCTL_HXTFQIEN_Pos) /*!< CLK_T::CLKDCTL: HXTFQIEN Mask */ - -#define CLK_CLKDSTS_HXTFIF_Pos (0) /*!< CLK_T::CLKDSTS: HXTFIF Position */ -#define CLK_CLKDSTS_HXTFIF_Msk (0x1ul << CLK_CLKDSTS_HXTFIF_Pos) /*!< CLK_T::CLKDSTS: HXTFIF Mask */ - -#define CLK_CLKDSTS_LXTFIF_Pos (1) /*!< CLK_T::CLKDSTS: LXTFIF Position */ -#define CLK_CLKDSTS_LXTFIF_Msk (0x1ul << CLK_CLKDSTS_LXTFIF_Pos) /*!< CLK_T::CLKDSTS: LXTFIF Mask */ - -#define CLK_CLKDSTS_HXTFQIF_Pos (8) /*!< CLK_T::CLKDSTS: HXTFQIF Position */ -#define CLK_CLKDSTS_HXTFQIF_Msk (0x1ul << CLK_CLKDSTS_HXTFQIF_Pos) /*!< CLK_T::CLKDSTS: HXTFQIF Mask */ - -#define CLK_CDUPB_UPERBD_Pos (0) /*!< CLK_T::CDUPB: UPERBD Position */ -#define CLK_CDUPB_UPERBD_Msk (0x3fful << CLK_CDUPB_UPERBD_Pos) /*!< CLK_T::CDUPB: UPERBD Mask */ - -#define CLK_CDLOWB_LOWERBD_Pos (0) /*!< CLK_T::CDLOWB: LOWERBD Position */ -#define CLK_CDLOWB_LOWERBD_Msk (0x3fful << CLK_CDLOWB_LOWERBD_Pos) /*!< CLK_T::CDLOWB: LOWERBD Mask */ - -#define CLK_CKFLTRCTL_HXTFLTREN_Pos (0) /*!< CLK_T::CKFLTRCTL: HXTFLTREN Position */ -#define CLK_CKFLTRCTL_HXTFLTREN_Msk (0x1ul << CLK_CKFLTRCTL_HXTFLTREN_Pos) /*!< CLK_T::CKFLTRCTL: HXTFLTREN Mask */ - -#define CLK_CKFLTRCTL_HXTFLTRSEL_Pos (1) /*!< CLK_T::CKFLTRCTL: HXTFLTRSEL Position */ -#define CLK_CKFLTRCTL_HXTFLTRSEL_Msk (0x1ul << CLK_CKFLTRCTL_HXTFLTRSEL_Pos) /*!< CLK_T::CKFLTRCTL: HXTFLTRSEL Mask */ - -#define CLK_CKFLTRCTL_HXTGTEN_Pos (4) /*!< CLK_T::CKFLTRCTL: HXTGTEN Position */ -#define CLK_CKFLTRCTL_HXTGTEN_Msk (0x1ul << CLK_CKFLTRCTL_HXTGTEN_Pos) /*!< CLK_T::CKFLTRCTL: HXTGTEN Mask */ - -#define CLK_CKFLTRCTL_HXTBYPSEN_Pos (5) /*!< CLK_T::CKFLTRCTL: HXTBYPSEN Position */ -#define CLK_CKFLTRCTL_HXTBYPSEN_Msk (0x1ul << CLK_CKFLTRCTL_HXTBYPSEN_Pos) /*!< CLK_T::CKFLTRCTL: HXTBYPSEN Mask */ - -#define CLK_CKFLTRCTL_HIRCFLTREN_Pos (8) /*!< CLK_T::CKFLTRCTL: HIRCFLTREN Position */ -#define CLK_CKFLTRCTL_HIRCFLTREN_Msk (0x1ul << CLK_CKFLTRCTL_HIRCFLTREN_Pos) /*!< CLK_T::CKFLTRCTL: HIRCFLTREN Mask */ - -#define CLK_CKFLTRCTL_HIRCFLTRSEL_Pos (9) /*!< CLK_T::CKFLTRCTL: HIRCFLTRSEL Position */ -#define CLK_CKFLTRCTL_HIRCFLTRSEL_Msk (0x1ul << CLK_CKFLTRCTL_HIRCFLTRSEL_Pos) /*!< CLK_T::CKFLTRCTL: HIRCFLTRSEL Mask */ - -#define CLK_CKFLTRCTL_HIRCGTEN_Pos (12) /*!< CLK_T::CKFLTRCTL: HIRCGTEN Position */ -#define CLK_CKFLTRCTL_HIRCGTEN_Msk (0x1ul << CLK_CKFLTRCTL_HIRCGTEN_Pos) /*!< CLK_T::CKFLTRCTL: HIRCGTEN Mask */ - -/**@}*/ /* CLK_CONST */ -/**@}*/ /* end of CLK register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CLK_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/crypto_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/crypto_reg.h deleted file mode 100644 index dd621e18444..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/crypto_reg.h +++ /dev/null @@ -1,7135 +0,0 @@ -/**************************************************************************//** - * @file crypto_reg.h - * @brief Cryptographic Accelerator definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __CRYPTO_REG_H__ -#define __CRYPTO_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Cryptographic Accelerator -------------------------*/ -/** - @addtogroup CRYPTO Cryptographic Accelerator(CRYPTO) - Memory Mapped Structure for Cryptographic Accelerator -@{ */ - -typedef struct -{ - - /** - * @var CRYPTO_T::INTEN - * Offset: 0x00 Crypto Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIEN |AES Interrupt Enable Bit - * | | |0 = AES interrupt Disabled. - * | | |1 = AES interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when an amount of data set in AES_DMA_CNT is fed into the AES engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the AES engine finishes the operation. - * |[1] |AESEIEN |AES Error Flag Enable Bit - * | | |0 = AES error interrupt flag Disabled. - * | | |1 = AES error interrupt flag Enabled. - * |[16] |PRNGIEN |PRNG Interrupt Enable Bit - * | | |0 = PRNG interrupt Disabled. - * | | |1 = PRNG interrupt Enabled. - * |[17] |PRNGEIEN |PRNG Error Flag Enable Bit - * | | |0 = PRNG error interrupt flag Disabled. - * | | |1 = PRNG error interrupt flag Enabled. - * |[22] |ECCIEN |ECC Interrupt Enable Bit - * | | |0 = ECC interrupt Disabled. - * | | |1 = ECC interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when an amount of data set in ECC_DMA_CNT is fed into the ECC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the ECC engine finishes the operation. - * |[23] |ECCEIEN |ECC Error Interrupt Enable Bit - * | | |0 = ECC error interrupt flag Disabled. - * | | |1 = ECC error interrupt flag Enabled. - * |[24] |HMACIEN |SHA/HMAC Interrupt Enable Bit - * | | |0 = SHA/HMAC interrupt Disabled. - * | | |1 = SHA/HMAC interrupt Enabled. - * | | |Note: In DMA mode, an interrupt will be triggered when an amount of data set in HMAC_DMA_CNT is fed into the SHA/HMAC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the SHA/HMAC engine finishes the operation. - * |[25] |HMACEIEN |SHA/HMAC Error Interrupt Enable Bit - * | | |0 = SHA/HMAC error interrupt flag Disabled. - * | | |1 = HMAC error interrupt flag Enabled. - * |[30] |RSAIEN |RSA Interrupt Enable Bit - * | | |0 = RSA interrupt Disabled. - * | | |1 = RSA interrupt Enabled. - * |[31] |RSAEIEN |RSA Error Interrupt Enable Bit - * | | |0 = RSA error interrupt flag Disabled. - * | | |1 = RSA error interrupt flag Enabled. - * @var CRYPTO_T::INTSTS - * Offset: 0x04 Crypto Interrupt Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIF |AES Finish Interrupt Flag - * | | |0 = No AES interrupt. - * | | |1 = AES encryption/decryption done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[1] |AESEIF |AES Error Flag - * | | |0 = No AES error. - * | | |1 = AES encryption/decryption error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[16] |PRNGIF |PRNG Finish Interrupt Flag - * | | |0 = No PRNG interrupt. - * | | |1 = PRNG key generation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[17] |PRNGEIF |PRNG Error Flag - * | | |0 = No PRNG error. - * | | |1 = PRNG key generation error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[22] |ECCIF |ECC Finish Interrupt Flag - * | | |0 = No ECC interrupt. - * | | |1 = ECC operation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[23] |ECCEIF |ECC Error Flag - * | | |This register includes operating and setting error - * | | |The detail flag is shown in CRYPTO_ECC_STS register. - * | | |0 = No ECC error. - * | | |1 = ECC error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[24] |HMACIF |SHA/HMAC Finish Interrupt Flag - * | | |0 = No SHA/HMAC interrupt. - * | | |1 = SHA/HMAC operation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[25] |HMACEIF |SHA/HMAC Error Flag - * | | |This register includes operating and setting error - * | | |The detail flag is shown in CRYPTO_HMAC_STS register. - * | | |0 = No SHA/HMAC error. - * | | |1 = SHA/HMAC error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[30] |RSAIF |RSA Finish Interrupt Flag - * | | |0 = No RSA interrupt. - * | | |1 = RSA operation done interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * |[31] |RSAEIF |RSA Error Interrupt Flag - * | | |This register includes operating and setting error - * | | |The detail flag is shown in CRYPTO_RSA_STS register. - * | | |0 = No RSA error. - * | | |1 = RSA error interrupt. - * | | |Note: This bit is cleared by writing 1, and it has no effect by writing 0. - * @var CRYPTO_T::PRNG_CTL - * Offset: 0x08 PRNG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Start PRNG Engine - * | | |0 = Stop PRNG engine. - * | | |1 = Generate new key and store the new key to register CRYPTO_PRNG_KEYx, which will be cleared when the new key is generated. - * |[1] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * |[5:2] |KEYSZ |PRNG Generate Key Size - * | | |0000 = 128 bits. - * | | |0001 = 163 bits. - * | | |0010 = 192 bits. - * | | |0011 = 224 bits. - * | | |0100 = 233 bits. - * | | |0101 = 255 bits. - * | | |0110 = 256 bits. - * | | |0111 = 283 bits (only for KS). - * | | |1000 = 384 bits (only for KS). - * | | |1001 = 409 bits (only for KS). - * | | |1010 = 512 bits (only for KS). - * | | |1011 = 521 bits (only for KS). - * | | |1100 = 571 bits (only for KS). - * | | |1101 = Reserved. - * | | |1110 = Reserved. - * | | |1111 = Reserved. - * | | |Note: 283~571 bits are only generated for key store. - * |[8] |BUSY |PRNG Busy (Read Only) - * | | |0 = PRNG engine is idle. - * | | |1 = PRNG engine is generating CRYPTO_PRNG_KEYx. - * |[16] |SEEDSRC |Seed Source - * | | |0 = Seed is from TRNG. - * | | |1 = Seed is from PRNG seed register. - * | | |Note: When SEEDRLD is set to 0, this bit (SEEDSRC) is meaningless. - * @var CRYPTO_T::PRNG_SEED - * Offset: 0x0C Seed for PRNG - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed for PRNG (Write Only) - * | | |The bits store the seed for PRNG engine. - * | | |Note: In TRNG+PRNG mode, the seed is from TRNG engine, and it will not be stored in this register. - * @var CRYPTO_T::PRNG_KEY0 - * Offset: 0x10 PRNG Generated Key0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_KEY1 - * Offset: 0x14 PRNG Generated Key1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_KEY2 - * Offset: 0x18 PRNG Generated Key2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_KEY3 - * Offset: 0x1C PRNG Generated Key3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_KEY4 - * Offset: 0x20 PRNG Generated Key4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_KEY5 - * Offset: 0x24 PRNG Generated Key5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_KEY6 - * Offset: 0x28 PRNG Generated Key6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_KEY7 - * Offset: 0x2C PRNG Generated Key7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRYPTO_T::PRNG_STS - * Offset: 0x30 PRNG Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |PRNG Busy Flag - * | | |0 = PRNG engine is idle. - * | | |1 = PRNG engine is generating CRYPTO_PRNG_KEYx. - * |[16] |KCTLERR |PRNG Key Control Register Error Flag - * | | |0 = No error. - * | | |1 = PRNG key control error - * | | |When PRNG execute ECDSA or ECDH, but PRNG seed not from TRNG or key is not written to the SRAM of key store (WSDST, CRYPTO_PRNG_KSCTL[23:22] is not equal to '00'). - * |[17] |KSERR |PRNG Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access key store failed. - * |[18] |TRNGERR |True Random Number Generator Error Flag - * | | |0 = No error. - * | | |1 = Getting random number or seed failed. - * | | |Note: When TRNGERR becomes 1, TRNG may be BUSY, in TESTMODE or in wrong state. - * @var CRYPTO_T::AES_FDBCK0 - * Offset: 0x50 AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRYPTO_AES_FDBCKx as the data inputted to CRYPTO_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRYPTO_T::AES_FDBCK1 - * Offset: 0x54 AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRYPTO_AES_FDBCKx as the data inputted to CRYPTO_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRYPTO_T::AES_FDBCK2 - * Offset: 0x58 AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRYPTO_AES_FDBCKx as the data inputted to CRYPTO_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRYPTO_T::AES_FDBCK3 - * Offset: 0x5C AES Engine Output Feedback Data After Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRYPTO_AES_FDBCKx as the data inputted to CRYPTO_AES_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_AES_IVx in the same channel operation, and then continue the operation with the original setting. - * @var CRYPTO_T::AES_GCM_IVCNT0 - * Offset: 0x80 AES GCM IV Byte Count Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM IV Byte Count - * | | |The bit length of IV is 64 bits for AES GCM mode - * | | |The CRYPTO_AES_GCM_IVCNT0 keeps the low weight byte count of initial vector (i.e., len(IV)[34:3]) of AES GCM mode and can be read and written. - * @var CRYPTO_T::AES_GCM_IVCNT1 - * Offset: 0x84 AES GCM IV Byte Count Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |CNT |AES GCM IV Byte Count - * | | |The bit length of IV is 64 bits for AES GCM mode - * | | |The CRYPTO_AES_GCM_IVCNT1 keeps the high weight byte count of initial vector (i.e., len(IV)[64:35]) of AES GCM mode and can be read and written. - * @var CRYPTO_T::AES_GCM_ACNT0 - * Offset: 0x88 AES GCM A Byte Count Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM a Byte Count - * | | |The bit length of A is 64 bits for AES GCM mode - * | | |The CRYPTO_AES_GCM_ACNT0 keeps the low weight byte count of the additional authenticated data (i.e., len(A)[34:3]) of AES GCM mode and can be read and written. - * @var CRYPTO_T::AES_GCM_ACNT1 - * Offset: 0x8C AES GCM A Byte Count Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |CNT |AES GCM a Byte Count - * | | |The bit length of A is 64 bits for AES GCM mode - * | | |The CRYPTO_AES_GCM_ACNT0 keeps the high weight byte count of the additional authenticated data (i.e., len(A)[63:35]) of AES GCM mode and can be read and written. - * @var CRYPTO_T::AES_GCM_PCNT0 - * Offset: 0x90 AES GCM P Byte Count Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES GCM P Byte Count - * | | |The bit length of Por C is 39 bits for AES GCM mode - * | | |The CRYPTO_AES_GCM_PCNT0 keeps the low weight byte count of the plaintext or ciphertext (i.e., len(P)[34:3] or len(C)[34:3]) of AES GCM mode and can be read and written. - * @var CRYPTO_T::AES_GCM_PCNT1 - * Offset: 0x94 AES GCM P Byte Count Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[28:0] |CNT |AES GCM P Byte Count - * | | |The bit length of Por C is 39 bits for AES GCM mode - * | | |The CRYPTO_AES_GCM_PCNT1 keeps the high weight byte count of the plaintext or ciphertext (i.e., len(P)[38:35] or len(C)[38:35]) of AES GCM mode and can be read and written. - * | | |The bit length of Por C is 64 bits for AES CCM mode - * | | |The CRYPTO_AES_GCM_PCNT1 keeps the high weight byte count of the plaintext or ciphertext (i.e., len(P)[63:35] or len(C)[63:35]) of AES CCM mode and can be read and written. - * @var CRYPTO_T::AES_FBADDR - * Offset: 0xA0 AES DMA Feedback Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FBADDR |AES DMA Feedback Address - * | | |In DMA cascade mode, software can update DMA feedback address register for automatically reading and writing feedback values via DMA - * | | |The FBADDR keeps the feedback address of the feedback data for the next cascade operation - * | | |Based on the feedback address, the AES accelerator can read the feedback data of the last cascade operation from SRAM memory space and write the feedback data of the current cascade operation to SRAM memory space - * | | |The start of feedback address should be located at word boundary - * | | |In other words, bit 1 and 0 of FBADDR are ignored. - * | | |FBADDR can be read and written. - * | | |In DMA mode, software can update the next CRYPTO_AES_FBADDR before triggering START. - * @var CRYPTO_T::AES_CTL - * Offset: 0x100 AES Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |AES Engine Start - * | | |0 = No effect. - * | | |1 = Start AES engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it is read back. - * |[1] |STOP |AES Engine Stop - * | | |0 = No effect. - * | | |1 = Stop AES engine. - * | | |Note: This bit is always 0 when it is read back. - * |[3:2] |KEYSZ |AES Key Size - * | | |This bit defines three different key size for AES operation. - * | | |2'b00 = 128 bits key. - * | | |2'b01 = 192 bits key. - * | | |2'b10 = 256 bits key. - * | | |2'b11 = Reserved. - * | | |If the AES accelerator is operating and the corresponding flag BUSY is 1, updating this register has no effect. - * | | |Note: When SM4EN=1, the key size of AES must be 128. - * |[5] |DMALAST |AES Last Block - * | | |In DMA mode, this bit must be set as beginning the last DMA cascade round. - * | | |In Non-DMA mode, this bit must be set when feeding in the last block of data in ECB, CBC, CTR, OFB, and CFB mode, and feeding in the (last-1) block of data at CBC-CS1, CBC-CS2, and CBC-CS3 mode. - * | | |This bit is always 0 when it is read back, and must be written again once START is triggered. - * |[6] |DMACSCAD |AES Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |AES Engine DMA Enable Bit - * | | |0 = AES DMA engine Disabled. - * | | |The AES engine operates in Non-DMA mode. The data need to be written in CRYPTO_AES_DATIN. - * | | |1 = AES_DMA engine Enabled. - * | | |The AES engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[15:8] |OPMODE |AES Engine Operation Modes - * | | |0x00 = ECB (Electronic Codebook Mode) 0x01 = CBC (Cipher Block Chaining Mode). - * | | |0x02 = CFB (Cipher Feedback Mode). - * | | |0x03 = OFB (Output Feedback Mode). - * | | |0x04 = CTR (Counter Mode). - * | | |0x10 = CBC-CS1 (CBC Ciphertext-Stealing 1 Mode). - * | | |0x11 = CBC-CS2 (CBC Ciphertext-Stealing 2 Mode). - * | | |0x12 = CBC-CS3 (CBC Ciphertext-Stealing 3 Mode). - * | | |0x20 = GCM (Galois/Counter Mode). - * | | |0x21 = GHASH (Galois Hash Function). - * | | |0x22 = CCM (Counter with CBC-MAC Mode). - * |[16] |ENCRYPTO |AES Encryption/Decryption - * | | |0 = AES engine executes decryption operation. - * | | |1 = AES engine executes encryption operation. - * |[17] |SM4EN |SM4 Engine Enable - * | | |0 = AES engine Enabled. - * | | |1 = SM4 engine Enabled. - * |[19] |DFAPEN |AES Differential Fault Attack Protection Enable - * | | |0 = AES Differential Fault Attack Protection Disabled. - * | | |1 = AES Differential Fault Attack Protection Enabled. - * |[20] |FBIN |Feedback Input to AES Via DMA Automatically - * | | |0 = DMA automatic feedback input function Disabled. - * | | |1 = DMA automatic feedback input function Enabled when DMAEN = 1. - * |[21] |FBOUT |Feedback Output From AES Via DMA Automatically - * | | |0 = DMA automatic feedback output function Disabled. - * | | |1 = DMA automatic feedback output function Enabled when DMAEN = 1. - * |[22] |OUTSWAP |AES Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU reads data from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |AES Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[24] |KOUTSWAP |AES Engine Output Key, Initial Vector and Feedback Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU reads key, initial vector and feedback from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[25] |KINSWAP |AES Engine Input Key and Initial Vector Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds key and initial vector to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[30:26] |KEYUNPRT |Unprotect Key - * | | |Writing 0 to CRYPTO_AES_CTL[31] and "10110" to CRYPTO_AES_CTL[30:26] is to unprotect the AES key. - * | | |The KEYUNPRT can be read and written - * | | |When it is written as the AES engine is operating, BUSY flag is 1, there would be no effect on KEYUNPRT. - * |[31] |KEYPRT |Protect Key - * | | |Read as a flag to reflect KEYPRT. - * | | |0 = No effect. - * | | |1 = Protect the content of the AES key from reading - * | | |The return value for reading CRYPTO_AES_KEYx is not the content of the registers CRYPTO_AES_KEYx - * | | |Once it is set, it can be cleared by asserting KEYUNPRT - * | | |The key content would be cleared as well. - * @var CRYPTO_T::AES_STS - * Offset: 0x104 AES Engine Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |AES Engine Busy - * | | |0 = The AES engine is idle or finished. - * | | |1 = The AES engine is under processing. - * |[8] |INBUFEMPTY|AES Input Buffer Empty - * | | |0 = There are some data in input buffer waiting for the AES engine to process. - * | | |1 = AES input buffer is empty - * | | |Software needs to feed data to the AES engine - * | | |Otherwise, the AES engine will be pending to wait for input data. - * |[9] |INBUFFULL |AES Input Buffer Full Flag - * | | |0 = AES input buffer is not full. Software can feed the data into the AES engine. - * | | |1 = AES input buffer is full - * | | |Software cannot feed data to the AES engine - * | | |Otherwise, the flag INBUFERR will be set to 1. - * |[10] |INBUFERR |AES Input Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happened during feeding data to the AES engine. - * |[12] |CNTERR |CRYPTO_AES_CNT Setting Error - * | | |0 = No error in CRYPTO_AES_CNT setting. - * | | |1 = CRYPTO_AES_CNT is 0 if DMAEN (CRYPTO_AES_CTL[7]) is enabled. - * |[16] |OUTBUFEMPTY|AES Out Buffer Empty - * | | |0 = AES output buffer is not empty. There are some valid data kept in output buffer. - * | | |1 = AES output buffer is empty - * | | |Software cannot get data from CRYPTO_AES_DATOUT - * | | |Otherwise, the flag OUTBUFERR will be set to 1 since the output buffer is empty. - * |[17] |OUTBUFFULL|AES Out Buffer Full Flag - * | | |0 = AES output buffer is not full. - * | | |1 = AES output buffer is full, and software needs to get data from CRYPTO_AES_DATOUT - * | | |Otherwise, the AES engine will be pending since the output buffer is full. - * |[18] |OUTBUFERR |AES Out Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happened during getting the result from AES engine. - * |[20] |BUSERR |AES DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and AES engine. - * |[21] |KSERR |AES Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Key store access error will stop AES engine. - * |[22] |DFAERR |AES Engine Differential Fault Attack Error Flag - * | | |0 = No error. - * | | |1 = Differential Fault Attack happened in AES engine. The results from AES engine are wrong. - * @var CRYPTO_T::AES_DATIN - * Offset: 0x108 AES Engine Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |AES Engine Input Port - * | | |CPU feeds data to AES engine through this port by checking CRYPTO_AES_STS. Feed data as INBUFFULL is 0. - * @var CRYPTO_T::AES_DATOUT - * Offset: 0x10C AES Engine Data Output Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATOUT |AES Engine Output Port - * | | |CPU gets results from the AES engine through this port by checking CRYPTO_AES_STS - * | | |Get data as OUTBUFEMPTY is 0. - * @var CRYPTO_T::AES_KEY0 - * Offset: 0x110 AES Key Word 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_KEY1 - * Offset: 0x114 AES Key Word 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_KEY2 - * Offset: 0x118 AES Key Word 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_KEY3 - * Offset: 0x11C AES Key Word 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_KEY4 - * Offset: 0x120 AES Key Word 4 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_KEY5 - * Offset: 0x124 AES Key Word 5 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_KEY6 - * Offset: 0x128 AES Key Word 6 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_KEY7 - * Offset: 0x12C AES Key Word 7 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRYPTO_AES_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key. - * | | |{CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 128-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 192-bit security key for AES operation. - * | | |{CRYPTO_AES_KEY7, CRYPTO_AES_KEY6, CRYPTO_AES_KEY5, CRYPTO_AES_KEY4, CRYPTO_AES_KEY3, CRYPTO_AES_KEY2, CRYPTO_AES_KEY1, CRYPTO_AES_KEY0} stores the 256-bit security key for AES operation. - * @var CRYPTO_T::AES_IV0 - * Offset: 0x130 AES Initial Vector Word 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRYPTO_T::AES_IV1 - * Offset: 0x134 AES Initial Vector Word 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRYPTO_T::AES_IV2 - * Offset: 0x138 AES Initial Vector Word 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRYPTO_T::AES_IV3 - * Offset: 0x13C AES Initial Vector Word 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRYPTO_AES_IV0, CRYPTO_AES_IV1, CRYPTO_AES_IV2, and CRYPTO_AES_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRYPTO_T::AES_SADDR - * Offset: 0x140 AES DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between SRAM memory space and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text (encryption) / cipher text (decryption) from SRAM memory space and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRYPTO_AES_SADDR before triggering START. - * | | |The value of CRYPTO_AES_SADDR and CRYPTO_AES_DADDR can be the same. - * @var CRYPTO_T::AES_DADDR - * Offset: 0x144 AES DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between SRAM memory space and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text (encryption) / plain text (decryption) back to SRAM memory space after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRYPTO_AES_DADDR before triggering START. - * | | |The value of CRYPTO_AES_SADDR and CRYPTO_AES_DADDR can be the same. - * @var CRYPTO_T::AES_CNT - * Offset: 0x148 AES Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRYPTO_AES_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRYPTO_AES_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRYPTO_AES_CNT can be read and written - * | | |Writing to CRYPTO_AES_CNT while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of CRYPTO_AES_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be more than 16 bytes - * | | |Operations that are qual or less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, CTR, CCM and GCM mode, CRYPTO_AES_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRYPTO_AES_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * | | |In AES GCM mode without DMA cascade function, the value of CRYPTO_AES_CNT is equal to the total value of {CRYPTO_AES_GCM_IVCNT1, CRYPTO_AES_GCM_IVCNT0}, {CRYPTO_AES_GCM_ACNT1, CRYPTO_AES_GCM_ACNT0} and {CRYPTO_AES_GCM_PCNT1, CRYPTO_AES_GCM_PCNT0}. - * | | |In AES GCM mode with DMA cascade function, the value of CRYPTO_AES_CNT represents the byte count of source text in this cascade function - * | | |Thus, the value of CRYPTO_AES_CNT is less than or equal to the total value of {CRYPTO_AES_GCM_IVCNT1, CRYPTO_AES_GCM_IVCNT0}, {CRYPTO_AES_GCM_ACNT1, CRYPTO_AES_GCM_ACNT0} and {CRYPTO_AES_GCM_PCNT1, CRYPTO_AES_GCM_PCNT0} and must be block alignment. - * | | |In AES CCM mode without DMA cascade function, the value of CRYPTO_AES_CNT is equal to the total value of {CRYPTO_AES_GCM_ACNT1, CRYPTO_AES_GCM_ACNT0} and {CRYPTO_AES_GCM_PCNT1, CRYPTO_AES_GCM_PCNT0}. - * | | |In AES CCM mode with DMA cascade function, the value of CRYPTO_AES_CNT represents the byte count of source text in this cascade function - * | | |Thus, the value of CRYPTO_AES_CNT is less than or equal to the total value of {CRYPTO_AES_GCM_ACNT1, CRYPTO_AES_GCM_ACNT0} and {CRYPTO_AES_GCM_PCNT1, CRYPTO_AES_GCM_PCNT0} and must be block alignment, except for the last block of plaintext or ciphertext. - * @var CRYPTO_T::HMAC_CTL - * Offset: 0x300 SHA/HMAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |SHA/HMAC Engine Start - * | | |0 = No effect. - * | | |1 = Start SHA/HMAC engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it is read back. - * |[1] |STOP |SHA/HMAC Engine Stop - * | | |0 = No effect. - * | | |1 = Stop SHA/HMAC engine. - * | | |Note: This bit is always 0 when it is read back. - * |[4] |DMAFIRST |SHA/HMAC First Block in Cascade function - * | | |This bit must be set as feeding in first byte of data. - * |[5] |DMALAST |SHA/HMAC Last Block - * | | |This bit must be set as feeding in last byte of data. - * |[6] |DMACSCAD |SHA/HMAC Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |SHA/HMAC Engine DMA Enable Bit - * | | |0 = SHA/HMAC DMA engine Disabled. - * | | |SHA/HMAC engine operates in Non-DMA mode. The data need to be written in CRYPTO_HMAC_DATIN. - * | | |1 = SHA/HMAC DMA engine Enabled. - * | | |SHA/HMAC engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[10:8] |OPMODE |SHA/HMAC Engine Operation Modes - * | | |When SHA3EN=0,. - * | | |0x0xx: SHA1-160 - * | | |0x100: SHA2-256 - * | | |0x101: SHA2-224 - * | | |0x110: SHA2-512 - * | | |0x111: SHA2-384 - * | | |When SHA3EN=1,. - * | | |0x100: SHA3-256 - * | | |0x101: SHA3-224 - * | | |0x110: SHA3-512 - * | | |0x111: SHA3-384 - * | | |0x000: SHAKE128 - * | | |0x001: SHAKE256 - * | | |Note: These bits can be read and written. But writing to them wouldn't take effect as BUSY is 1. - * | | |Note: When SM3EN=1, SHA/HMAC only execute SM3 and then generate 256 bits digest. - * | | |Note: When MD5EN=1, SHA/HMAC only execute MD5 and then generate 128 bits digest. - * |[11] |HMACEN |HMAC_SHA Engine Operating Mode - * | | |0 = Execute SHA function. - * | | |1 = Execute HMAC function. - * |[12] |SHA3EN |SHA3 Engine Enable Bit - * | | |0 = Execute other function. - * | | |1 = Execute SHA3 function if SM3EN=0 and MD5EN=0. - * |[13] |SM3EN |SM3 Engine Enable Bit - * | | |0 = Execute other function. - * | | |1 = Execute SM3 function if SHA3EN=0 and MD5EN=0. - * |[14] |MD5EN |MD5 Engine Enable Bit - * | | |0 = Execute other function. - * | | |1 = Execute MD5 function if SHA3EN=0 and SM3EN=0. - * |[20] |FBIN |Feedback Input to SHA/HMAC Via DMA Automatically - * | | |0 = DMA automatic feedback input function Disabled. - * | | |1 = DMA automatic feedback input function Enabled when DMAEN = 1. - * |[21] |FBOUT |Feedback Output From SHA/HMAC Via DMA Automatically - * | | |0 = DMA automatic feedback output function Disabled. - * | | |1 = DMA automatic feedback output function Enabled when DMAEN = 1. - * |[22] |OUTSWAP |SHA/HMAC Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |SHA/HMAC Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[24] |NEXTDGST |SHAKE128/256 Next Digest Start - * | | |0 = No effect. - * | | |1 = Start SHAKE engine to generate the next digest only when SHAKEBUSY is 0 - * | | |BUSY and SHAKEBUSY flag will be set. - * |[25] |FINISHDGST|SHAKE128/256 Next Digest Finish - * | | |0 = No effect. - * | | |1 = finish generating the next digest. - * @var CRYPTO_T::HMAC_STS - * Offset: 0x304 SHA/HMAC Status Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |SHA/HMAC Engine Busy - * | | |0 = SHA/HMAC engine is idle or finished. - * | | |1 = SHA/HMAC engine is busy. - * |[1] |DMABUSY |SHA/HMAC Engine DMA Busy Flag - * | | |0 = SHA/HMAC DMA engine is idle or finished. - * | | |1 = SHA/HMAC DMA engine is busy. - * |[2] |SHAKEBUSY |SHAKE Engine Busy Flag - * | | |0 = SHAKE engine is idle or finished. - * | | |1 = SHAKE engine is busy. - * |[8] |DMAERR |SHA/HMAC Engine DMA Error Flag - * | | |0 = Show the SHA/HMAC engine access normal. - * | | |1 = Show the SHA/HMAC engine access error. - * |[9] |KSERR |HMAC Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop HMAC engine. - * |[16] |DATINREQ |SHA/HMAC Non-DMA Mode Data Input Request - * | | |0 = No effect. - * | | |1 = Request SHA/HMAC Non-DMA mode data input. - * @var CRYPTO_T::HMAC_DGST0 - * Offset: 0x308 SHA/HMAC Output Feedback Data 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST1 - * Offset: 0x30C SHA/HMAC Output Feedback Data 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST2 - * Offset: 0x310 SHA/HMAC Output Feedback Data 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST3 - * Offset: 0x314 SHA/HMAC Output Feedback Data 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST4 - * Offset: 0x318 SHA/HMAC Output Feedback Data 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST5 - * Offset: 0x31C SHA/HMAC Output Feedback Data 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST6 - * Offset: 0x320 SHA/HMAC Output Feedback Data 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST7 - * Offset: 0x324 SHA/HMAC Output Feedback Data 7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST8 - * Offset: 0x328 SHA/HMAC Output Feedback Data 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST9 - * Offset: 0x32C SHA/HMAC Output Feedback Data 9 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST10 - * Offset: 0x330 SHA/HMAC Output Feedback Data 10 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST11 - * Offset: 0x334 SHA/HMAC Output Feedback Data 11 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST12 - * Offset: 0x338 SHA/HMAC Output Feedback Data 12 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST13 - * Offset: 0x33C SHA/HMAC Output Feedback Data 13 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST14 - * Offset: 0x340 SHA/HMAC Output Feedback Data 14 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_DGST15 - * Offset: 0x344 SHA/HMAC Output Feedback Data 15 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Output Feedback Data Output Register - * | | |For SHA-160, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRYPTO_HMAC_DGST0 ~ CRYPTO_HMAC_DGST15. - * @var CRYPTO_T::HMAC_KEYCNT - * Offset: 0x348 SHA/HMAC Key Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEYCNT |SHA/HMAC Key Byte Count - * | | |The CRYPTO_HMAC_KEYCNT keeps the byte count of key that SHA/HMAC engine operates - * | | |The register is 32-bit and the maximum byte count is 4G bytes - * | | |It can be read and written. - * | | |Writing to the register CRYPTO_HMAC_KEYCNT as the SHA/HMAC accelerator operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRYPTO_HMAC_KEYCNT will be updated later on - * | | |Consequently, software can prepare the key count for the next SHA/HMAC operation. - * @var CRYPTO_T::HMAC_SADDR - * Offset: 0x34C SHA/HMAC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |SHA/HMAC DMA Source Address - * | | |The SHA/HMAC accelerator supports DMA function to transfer the plain text between SRAM memory space and embedded FIFO - * | | |The CRYPTO_HMAC_SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the SHA/HMAC accelerator can read the plain text from SRAM memory space and do SHA/HMAC operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRYPTO_HMAC_SADDR are ignored. - * | | |CRYPTO_HMAC_SADDR can be read and written - * | | |Writing to CRYPTO_HMAC_SADDR while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRYPTO_HMAC_SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next SHA/HMAC operation. - * | | |In DMA mode, software can update the next CRYPTO_HMAC_SADDR before triggering START. - * | | |CRYPTO_HMAC_SADDR and CRYPTO_HMAC_DADDR can be the same in the value. - * @var CRYPTO_T::HMAC_DMACNT - * Offset: 0x350 SHA/HMAC Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMACNT |SHA/HMAC Operation Byte Count - * | | |The CRYPTO_HMAC_DMACNT keeps the byte count of source text that is for the SHA/HMAC engine operating in DMA mode - * | | |The CRYPTO_HMAC_DMACNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRYPTO_HMAC_DMACNT can be read and written - * | | |Writing to CRYPTO_HMAC_DMACNT while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRYPTO_HMAC_DMACNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next SHA/HMAC operation. - * | | |In Non-DMA mode, CRYPTO_HMAC_DMACNT must be set as the byte count of the last block before feeding in the last block of data. - * @var CRYPTO_T::HMAC_DATIN - * Offset: 0x354 SHA/HMAC Engine Non-DMA Mode Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |SHA/HMAC Engine Input Port - * | | |CPU feeds data to SHA/HMAC engine through this port by checking CRYPTO_HMAC_STS - * | | |Feed data as DATINREQ is 1. - * @var CRYPTO_T::HMAC_FDBCK0 - * Offset: 0x358 SHA/HMAC Output Feedback Data 0 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK1 - * Offset: 0x35C SHA/HMAC Output Feedback Data 1 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK2 - * Offset: 0x360 SHA/HMAC Output Feedback Data 2 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK3 - * Offset: 0x364 SHA/HMAC Output Feedback Data 3 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK4 - * Offset: 0x368 SHA/HMAC Output Feedback Data 4 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK5 - * Offset: 0x36C SHA/HMAC Output Feedback Data 5 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK6 - * Offset: 0x370 SHA/HMAC Output Feedback Data 6 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK7 - * Offset: 0x374 SHA/HMAC Output Feedback Data 7 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK8 - * Offset: 0x378 SHA/HMAC Output Feedback Data 8 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK9 - * Offset: 0x37C SHA/HMAC Output Feedback Data 9 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK10 - * Offset: 0x380 SHA/HMAC Output Feedback Data 10 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK11 - * Offset: 0x384 SHA/HMAC Output Feedback Data 11 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK12 - * Offset: 0x388 SHA/HMAC Output Feedback Data 12 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK13 - * Offset: 0x38C SHA/HMAC Output Feedback Data 13 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK14 - * Offset: 0x390 SHA/HMAC Output Feedback Data 14 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK15 - * Offset: 0x394 SHA/HMAC Output Feedback Data 15 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK16 - * Offset: 0x398 SHA/HMAC Output Feedback Data 16 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK17 - * Offset: 0x39C SHA/HMAC Output Feedback Data 17 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK18 - * Offset: 0x3A0 SHA/HMAC Output Feedback Data 18 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK19 - * Offset: 0x3A4 SHA/HMAC Output Feedback Data 19 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK20 - * Offset: 0x3A8 SHA/HMAC Output Feedback Data 20 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK21 - * Offset: 0x3AC SHA/HMAC Output Feedback Data 21 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK22 - * Offset: 0x3B0 SHA/HMAC Output Feedback Data 22 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK23 - * Offset: 0x3B4 SHA/HMAC Output Feedback Data 23 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK24 - * Offset: 0x3B8 SHA/HMAC Output Feedback Data 24 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK25 - * Offset: 0x3BC SHA/HMAC Output Feedback Data 25 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK26 - * Offset: 0x3C0 SHA/HMAC Output Feedback Data 26 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK27 - * Offset: 0x3C4 SHA/HMAC Output Feedback Data 27 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK28 - * Offset: 0x3C8 SHA/HMAC Output Feedback Data 28 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK29 - * Offset: 0x3CC SHA/HMAC Output Feedback Data 29 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK30 - * Offset: 0x3D0 SHA/HMAC Output Feedback Data 30 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK31 - * Offset: 0x3D4 SHA/HMAC Output Feedback Data 31 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK32 - * Offset: 0x3D8 SHA/HMAC Output Feedback Data 32 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK33 - * Offset: 0x3DC SHA/HMAC Output Feedback Data 33 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK34 - * Offset: 0x3E0 SHA/HMAC Output Feedback Data 34 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK35 - * Offset: 0x3E4 SHA/HMAC Output Feedback Data 35 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK36 - * Offset: 0x3E8 SHA/HMAC Output Feedback Data 36 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK37 - * Offset: 0x3EC SHA/HMAC Output Feedback Data 37 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK38 - * Offset: 0x3F0 SHA/HMAC Output Feedback Data 38 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK39 - * Offset: 0x3F4 SHA/HMAC Output Feedback Data 39 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK40 - * Offset: 0x3F8 SHA/HMAC Output Feedback Data 40 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK41 - * Offset: 0x3FC SHA/HMAC Output Feedback Data 41 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK42 - * Offset: 0x400 SHA/HMAC Output Feedback Data 42 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK43 - * Offset: 0x404 SHA/HMAC Output Feedback Data 43 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK44 - * Offset: 0x408 SHA/HMAC Output Feedback Data 44 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK45 - * Offset: 0x40C SHA/HMAC Output Feedback Data 45 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK46 - * Offset: 0x410 SHA/HMAC Output Feedback Data 46 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK47 - * Offset: 0x414 SHA/HMAC Output Feedback Data 47 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK48 - * Offset: 0x418 SHA/HMAC Output Feedback Data 48 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK49 - * Offset: 0x41C SHA/HMAC Output Feedback Data 49 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK50 - * Offset: 0x420 SHA/HMAC Output Feedback Data 50 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK51 - * Offset: 0x424 SHA/HMAC Output Feedback Data 51 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK52 - * Offset: 0x428 SHA/HMAC Output Feedback Data 52 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK53 - * Offset: 0x42C SHA/HMAC Output Feedback Data 53 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK54 - * Offset: 0x430 SHA/HMAC Output Feedback Data 54 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK55 - * Offset: 0x434 SHA/HMAC Output Feedback Data 55 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK56 - * Offset: 0x438 SHA/HMAC Output Feedback Data 56 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK57 - * Offset: 0x43C SHA/HMAC Output Feedback Data 57 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK58 - * Offset: 0x440 SHA/HMAC Output Feedback Data 58 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK59 - * Offset: 0x444 SHA/HMAC Output Feedback Data 59 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK60 - * Offset: 0x448 SHA/HMAC Output Feedback Data 60 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK61 - * Offset: 0x44C SHA/HMAC Output Feedback Data 61 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK62 - * Offset: 0x450 SHA/HMAC Output Feedback Data 62 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK63 - * Offset: 0x454 SHA/HMAC Output Feedback Data 63 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK64 - * Offset: 0x458 SHA/HMAC Output Feedback Data 64 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK65 - * Offset: 0x45C SHA/HMAC Output Feedback Data 65 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK66 - * Offset: 0x460 SHA/HMAC Output Feedback Data 66 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK67 - * Offset: 0x464 SHA/HMAC Output Feedback Data 67 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK68 - * Offset: 0x468 SHA/HMAC Output Feedback Data 68 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK69 - * Offset: 0x46C SHA/HMAC Output Feedback Data 69 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK70 - * Offset: 0x470 SHA/HMAC Output Feedback Data 70 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK71 - * Offset: 0x474 SHA/HMAC Output Feedback Data 71 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK72 - * Offset: 0x478 SHA/HMAC Output Feedback Data 72 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK73 - * Offset: 0x47C SHA/HMAC Output Feedback Data 73 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK74 - * Offset: 0x480 SHA/HMAC Output Feedback Data 74 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK75 - * Offset: 0x484 SHA/HMAC Output Feedback Data 75 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK76 - * Offset: 0x488 SHA/HMAC Output Feedback Data 76 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK77 - * Offset: 0x48C SHA/HMAC Output Feedback Data 77 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK78 - * Offset: 0x490 SHA/HMAC Output Feedback Data 78 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK79 - * Offset: 0x494 SHA/HMAC Output Feedback Data 79 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK80 - * Offset: 0x498 SHA/HMAC Output Feedback Data 80 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK81 - * Offset: 0x49C SHA/HMAC Output Feedback Data 81 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK82 - * Offset: 0x4A0 SHA/HMAC Output Feedback Data 82 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK83 - * Offset: 0x4A4 SHA/HMAC Output Feedback Data 83 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK84 - * Offset: 0x4A8 SHA/HMAC Output Feedback Data 84 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK85 - * Offset: 0x4AC SHA/HMAC Output Feedback Data 85 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK86 - * Offset: 0x4B0 SHA/HMAC Output Feedback Data 86 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_FDBCK87 - * Offset: 0x4B4 SHA/HMAC Output Feedback Data 87 After SHA/HMAC Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |SHA/HMAC Feedback Information - * | | |The feedback value is 1728 bits in size for SHA1/2 and 2784 bits in size for SHA3. - * | | |The SHA/HMAC engine uses the data from CRYPTO_HMAC_FDBCKx as the data inputted to CRYPTO_HMAC_FDBCKx for the next block in DMA cascade mode. - * | | |The SHA/HMAC engine outputs feedback information for initial setting in the next block's operation - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to CRYPTO_HMAC_FDBCKx in the same operation, and then continue the operation with the original setting. - * @var CRYPTO_T::HMAC_SHA512T - * Offset: 0x4F8 SHA/HMAC SHA512T Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SHA512TEN |SHA512T Engine Enable Bit - * | | |0 = Execute other function. - * | | |1 = Execute SHA512T function if SHA3EN=0, MD5EN=0 and SM3EN=0. - * | | |Note: When SHA512TEN=1, SHA/HMAC only execute SHA2-512. - * |[16:8] |TLEN |SHA512T output digest length - * | | |The TLEN is equal to value t of SHA512T. It also means the output digest length of SHA512T. - * | | |Note: TLEN < 512, and TLEN is not 384 - * @var CRYPTO_T::HMAC_FBADDR - * Offset: 0x4FC SHA/HMAC DMA Feedback Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FBADDR |SHA/HMAC DMA Feedback Address - * | | |In DMA cascade mode, software can update DMA feedback address register for automatically reading and writing feedback values via DMA - * | | |The FBADDR keeps the feedback address of the feedback data for the next cascade operation - * | | |Based on the feedback address, the SHA/HMAC accelerator can read the feedback data of the last cascade operation from SRAM memory space and write the feedback data of the current cascade operation to SRAM memory space - * | | |The start of feedback address should be located at word boundary - * | | |In other words, bit 1 and 0 of FBADDR are ignored. - * | | |FBADDR can be read and written. - * | | |In DMA mode, software can update the next CRYPTO_HMAC_FBADDR before triggering START. - * @var CRYPTO_T::HMAC_SHAKEDGST0 - * Offset: 0x500 SHA/HMAC SHAKE Digest Message 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST1 - * Offset: 0x504 SHA/HMAC SHAKE Digest Message 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST2 - * Offset: 0x508 SHA/HMAC SHAKE Digest Message 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST3 - * Offset: 0x50C SHA/HMAC SHAKE Digest Message 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST4 - * Offset: 0x510 SHA/HMAC SHAKE Digest Message 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST5 - * Offset: 0x514 SHA/HMAC SHAKE Digest Message 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST6 - * Offset: 0x518 SHA/HMAC SHAKE Digest Message 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST7 - * Offset: 0x51C SHA/HMAC SHAKE Digest Message 7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST8 - * Offset: 0x520 SHA/HMAC SHAKE Digest Message 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST9 - * Offset: 0x524 SHA/HMAC SHAKE Digest Message 9 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST10 - * Offset: 0x528 SHA/HMAC SHAKE Digest Message 10 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST11 - * Offset: 0x52C SHA/HMAC SHAKE Digest Message 11 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST12 - * Offset: 0x530 SHA/HMAC SHAKE Digest Message 12 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST13 - * Offset: 0x534 SHA/HMAC SHAKE Digest Message 13 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST14 - * Offset: 0x538 SHA/HMAC SHAKE Digest Message 14 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST15 - * Offset: 0x53C SHA/HMAC SHAKE Digest Message 15 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST16 - * Offset: 0x540 SHA/HMAC SHAKE Digest Message 16 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST17 - * Offset: 0x544 SHA/HMAC SHAKE Digest Message 17 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST18 - * Offset: 0x548 SHA/HMAC SHAKE Digest Message 18 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST19 - * Offset: 0x54C SHA/HMAC SHAKE Digest Message 19 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST20 - * Offset: 0x550 SHA/HMAC SHAKE Digest Message 20 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST21 - * Offset: 0x554 SHA/HMAC SHAKE Digest Message 21 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST22 - * Offset: 0x558 SHA/HMAC SHAKE Digest Message 22 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST23 - * Offset: 0x55C SHA/HMAC SHAKE Digest Message 23 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST24 - * Offset: 0x560 SHA/HMAC SHAKE Digest Message 24 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST25 - * Offset: 0x564 SHA/HMAC SHAKE Digest Message 25 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST26 - * Offset: 0x568 SHA/HMAC SHAKE Digest Message 26 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST27 - * Offset: 0x56C SHA/HMAC SHAKE Digest Message 27 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST28 - * Offset: 0x570 SHA/HMAC SHAKE Digest Message 28 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST29 - * Offset: 0x574 SHA/HMAC SHAKE Digest Message 29 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST30 - * Offset: 0x578 SHA/HMAC SHAKE Digest Message 30 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST31 - * Offset: 0x57C SHA/HMAC SHAKE Digest Message 31 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST32 - * Offset: 0x580 SHA/HMAC SHAKE Digest Message 32 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST33 - * Offset: 0x584 SHA/HMAC SHAKE Digest Message 33 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST34 - * Offset: 0x588 SHA/HMAC SHAKE Digest Message 34 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST35 - * Offset: 0x58C SHA/HMAC SHAKE Digest Message 35 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST36 - * Offset: 0x590 SHA/HMAC SHAKE Digest Message 36 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST37 - * Offset: 0x594 SHA/HMAC SHAKE Digest Message 37 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST38 - * Offset: 0x598 SHA/HMAC SHAKE Digest Message 38 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST39 - * Offset: 0x59C SHA/HMAC SHAKE Digest Message 39 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST40 - * Offset: 0x5A0 SHA/HMAC SHAKE Digest Message 40 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::HMAC_SHAKEDGST41 - * Offset: 0x5A4 SHA/HMAC SHAKE Digest Message 41 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC SHAKE Digest Message Register - * | | |For SHAKE-128, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 41. - * | | |For SHAKE-256, the digest is stored in CRYPTO_HMAC_SHAKEDGST0 0 ~ CRYPTO_HMAC_ SHAKEDGST0 33. - * @var CRYPTO_T::ECC_CTL - * Offset: 0x800 ECC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |ECC Accelerator Start - * | | |0 = No effect. - * | | |1 = Start ECC accelerator. BUSY flag will be set. - * | | |This bit is always 0 when it is read back. - * | | |ECC accelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |ECC Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort ECC accelerator and make it into idle state. - * | | |This bit is always 0 when it is read back. - * | | |Remember to clear ECC interrupt flag after stopping ECC accelerator. - * |[4] |ECDSAS |Generate S in ECDSA Signature Generation - * | | |0 = No effect. - * | | |1 = Formula for generating S. - * | | |POINTX1 = ((POINTX2 * POINTY1 + POINTY2 ) / POINTX1) % CURVEN. - * |[5] |ECDSAR |Generate R in ECDSA Signature Generation - * | | |0 = No effect. - * | | |1 = Formula for generating R. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * |[7] |DMAEN |ECC Accelerator DMA Enable Bit - * | | |0 = ECC DMA engine Disabled. - * | | |1 = ECC DMA engine Enabled. - * | | |Only when START and DMAEN are 1, ECC DMA engine will be active. - * |[8] |FSEL |Field Selection - * | | |0 = Binary Field (GF(2m )). - * | | |1 = Prime Field (GF(p)). - * |[10:9] |ECCOP |Point Operation for BF and PF - * | | |00 = Point multiplication:. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * | | |01 = Modulus operation: choose by MODOP (CRYPTO_ECC_CTL[12:11]). - * | | |10 = Point addition:. - * | | |(POINTX1, POINTY1) = (POINTX1, POINTY1) +. - * | | |(POINTX2, POINTY2) - * | | |11 = Point doubling:. - * | | |(POINTX1, POINTY1) = 2 * (POINTX1, POINTY1). - * | | |Besides above three input data, point operations still need the parameters of elliptic curve (CURVEA, CURVEB, CURVEN and CURVEM) as shown in Figure 6.27-11 - * |[12:11] |MODOP |Modulus Operation for PF - * | | |00 = Division:. - * | | |POINTX1 = (POINTY1 / POINTX1) % CURVEN. - * | | |01 = Multiplication:. - * | | |POINTX1 = (POINTX1 * POINTY1) % CURVEN. - * | | |10 = Addition:. - * | | |POINTX1 = (POINTX1 + POINTY1) % CURVEN. - * | | |11 = Subtraction:. - * | | |POINTX1 = (POINTX1 - POINTY1) % CURVEN. - * | | |MODOP is active only when ECCOP = 01. - * |[13] |CSEL |Curve Selection - * | | |0 = NIST suggested curve. - * | | |1 = Montgomery curve. - * |[14] |SCAP |Side-channel Attack Protection - * | | |0 = Full speed without side-channel protection. - * | | |1 = Less speed with side-channel protection. - * |[15] |ASCAP |Advance Side-channel Attack Protection - * | | |0 = Advance side-channel protection Disabled. - * | | |1 = Advance side-channel protection Enabled. - * | | |ASCAP is active only when SCAP = 1. - * |[16] |LDP1 |The Control Signal of Register POINTX1 and POINTY1 for the x and Y Coordinate of the First Point - * | | |0 = The register for POINTX1 and POINTY1 is not modified by DMA or user. - * | | |1 = The register for POINTX1 and POINTY1 is modified by DMA or user. - * |[17] |LDP2 |The Control Signal of Register POINTX2 and POINTY2 for the x and Y Coordinate of the Second Point - * | | |0 = The register for POINTX2 and POINTY2 is not modified by DMA or user. - * | | |1 = The register for POINTX2 and POINTY2 is modified by DMA or user. - * |[18] |LDA |The Control Signal of Register for the Parameter CURVEA of Elliptic Curve - * | | |0 = The register for CURVEA is not modified by DMA or user. - * | | |1 = The register for CURVEA is modified by DMA or user. - * |[19] |LDB |The Control Signal of Register for the Parameter CURVEB of Elliptic Curve - * | | |0 = The register for CURVEB is not modified by DMA or user. - * | | |1 = The register for CURVEB is modified by DMA or user. - * |[20] |LDN |The Control Signal of Register for the Parameter CURVEN of Elliptic Curve - * | | |0 = The register for CURVEN is not modified by DMA or user. - * | | |1 = The register for CURVEN is modified by DMA or user. - * |[21] |LDK |The Control Signal of Register for SCALARK - * | | |0 = The register for SCALARK is not modified by DMA or user. - * | | |1 = The register for SCALARK is modified by DMA or user. - * |[31:22] |CURVEM |The key length of elliptic curve. - * @var CRYPTO_T::ECC_STS - * Offset: 0x804 ECC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |ECC Accelerator Busy Flag - * | | |0 = The ECC accelerator is idle or finished. - * | | |1 = The ECC accelerator is under processing and protects all registers. - * | | |Note: Remember to clear ECC interrupt flag after ECC accelerator is finished - * |[1] |DMABUSY |ECC DMA Busy Flag - * | | |0 = ECC DMA is idle or finished. - * | | |1 = ECC DMA is busy. - * |[16] |BUSERR |ECC DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and ECC accelerator. - * |[17] |KSERR |ECC Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop ECC engine. - * |[18] |DFAERR |ECC Engine Differential Fault Attack Error Flag - * | | |0 = No error. - * | | |1 = Differential Fault Attack happened in ECC engine. The results from ECC engine are wrong. - * @var CRYPTO_T::ECC_X1_00 - * Offset: 0x808 ECC the X-coordinate Word0 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_01 - * Offset: 0x80C ECC the X-coordinate Word1 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_02 - * Offset: 0x810 ECC the X-coordinate Word2 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_03 - * Offset: 0x814 ECC the X-coordinate Word3 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_04 - * Offset: 0x818 ECC the X-coordinate Word4 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_05 - * Offset: 0x81C ECC the X-coordinate Word5 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_06 - * Offset: 0x820 ECC the X-coordinate Word6 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_07 - * Offset: 0x824 ECC the X-coordinate Word7 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_08 - * Offset: 0x828 ECC the X-coordinate Word8 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_09 - * Offset: 0x82C ECC the X-coordinate Word9 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_10 - * Offset: 0x830 ECC the X-coordinate Word10 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_11 - * Offset: 0x834 ECC the X-coordinate Word11 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_12 - * Offset: 0x838 ECC the X-coordinate Word12 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_13 - * Offset: 0x83C ECC the X-coordinate Word13 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_14 - * Offset: 0x840 ECC the X-coordinate Word14 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_15 - * Offset: 0x844 ECC the X-coordinate Word15 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_16 - * Offset: 0x848 ECC the X-coordinate Word16 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_X1_17 - * Offset: 0x84C ECC the X-coordinate Word17 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the X-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_06 - * | | |For P-256 or SM2, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRYPTO_ECC_X1_00~CRYPTO_ECC_X1_16 - * @var CRYPTO_T::ECC_Y1_00 - * Offset: 0x850 ECC the Y-coordinate Word0 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_01 - * Offset: 0x854 ECC the Y-coordinate Word1 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_02 - * Offset: 0x858 ECC the Y-coordinate Word2 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_03 - * Offset: 0x85C ECC the Y-coordinate Word3 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_04 - * Offset: 0x860 ECC the Y-coordinate Word4 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_05 - * Offset: 0x864 ECC the Y-coordinate Word5 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_06 - * Offset: 0x868 ECC the Y-coordinate Word6 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_07 - * Offset: 0x86C ECC the Y-coordinate Word7 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_08 - * Offset: 0x870 ECC the Y-coordinate Word8 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_09 - * Offset: 0x874 ECC the Y-coordinate Word9 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_10 - * Offset: 0x878 ECC the Y-coordinate Word10 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_11 - * Offset: 0x87C ECC the Y-coordinate Word11 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_12 - * Offset: 0x880 ECC the Y-coordinate Word12 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_13 - * Offset: 0x884 ECC the Y-coordinate Word13 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_14 - * Offset: 0x888 ECC the Y-coordinate Word14 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_15 - * Offset: 0x88C ECC the Y-coordinate Word15 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_16 - * Offset: 0x890 ECC the Y-coordinate Word16 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_Y1_17 - * Offset: 0x894 ECC the Y-coordinate Word17 of the First Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point - * | | |For B-163 or K-163, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_06 - * | | |For P-256 or SM2, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRYPTO_ECC_Y1_00~CRYPTO_ECC_Y1_16 - * @var CRYPTO_T::ECC_X2_00 - * Offset: 0x898 ECC the X-coordinate Word0 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_01 - * Offset: 0x89C ECC the X-coordinate Word1 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_02 - * Offset: 0x8A0 ECC the X-coordinate Word2 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_03 - * Offset: 0x8A4 ECC the X-coordinate Word3 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_04 - * Offset: 0x8A8 ECC the X-coordinate Word4 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_05 - * Offset: 0x8AC ECC the X-coordinate Word5 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_06 - * Offset: 0x8B0 ECC the X-coordinate Word6 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_07 - * Offset: 0x8B4 ECC the X-coordinate Word7 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_08 - * Offset: 0x8B8 ECC the X-coordinate Word8 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_09 - * Offset: 0x8BC ECC the X-coordinate Word9 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_10 - * Offset: 0x8C0 ECC the X-coordinate Word10 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_11 - * Offset: 0x8C4 ECC the X-coordinate Word11 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_12 - * Offset: 0x8C8 ECC the X-coordinate Word12 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_13 - * Offset: 0x8CC ECC the X-coordinate Word13 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_14 - * Offset: 0x8D0 ECC the X-coordinate Word14 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_15 - * Offset: 0x8D4 ECC the X-coordinate Word15 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_16 - * Offset: 0x8D8 ECC the X-coordinate Word16 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_X2_17 - * Offset: 0x8DC ECC the X-coordinate Word17 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the X-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_06 - * | | |For P-256 or SM2, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRYPTO_ECC_X2_00~CRYPTO_ECC_X2_16 - * @var CRYPTO_T::ECC_Y2_00 - * Offset: 0x8E0 ECC the Y-coordinate Word0 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_01 - * Offset: 0x8E4 ECC the Y-coordinate Word1 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_02 - * Offset: 0x8E8 ECC the Y-coordinate Word2 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_03 - * Offset: 0x8EC ECC the Y-coordinate Word3 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_04 - * Offset: 0x8F0 ECC the Y-coordinate Word4 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_05 - * Offset: 0x8F4 ECC the Y-coordinate Word5 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_06 - * Offset: 0x8F8 ECC the Y-coordinate Word6 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_07 - * Offset: 0x8FC ECC the Y-coordinate Word7 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_08 - * Offset: 0x900 ECC the Y-coordinate Word8 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_09 - * Offset: 0x904 ECC the Y-coordinate Word9 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_10 - * Offset: 0x908 ECC the Y-coordinate Word10 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_11 - * Offset: 0x90C ECC the Y-coordinate Word11 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_12 - * Offset: 0x910 ECC the Y-coordinate Word12 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_13 - * Offset: 0x914 ECC the Y-coordinate Word13 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_14 - * Offset: 0x918 ECC the Y-coordinate Word14 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_15 - * Offset: 0x91C ECC the Y-coordinate Word15 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_16 - * Offset: 0x920 ECC the Y-coordinate Word16 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_Y2_17 - * Offset: 0x924 ECC the Y-coordinate Word17 of the Second Point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point - * | | |For B-163 or K-163, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_06 - * | | |For P-256 or SM2, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRYPTO_ECC_Y2_00~CRYPTO_ECC_Y2_16 - * @var CRYPTO_T::ECC_A_00 - * Offset: 0x928 ECC the Parameter CURVEA Word0 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_01 - * Offset: 0x92C ECC the Parameter CURVEA Word1 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_02 - * Offset: 0x930 ECC the Parameter CURVEA Word2 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_03 - * Offset: 0x934 ECC the Parameter CURVEA Word3 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_04 - * Offset: 0x938 ECC the Parameter CURVEA Word4 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_05 - * Offset: 0x93C ECC the Parameter CURVEA Word5 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_06 - * Offset: 0x940 ECC the Parameter CURVEA Word6 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_07 - * Offset: 0x944 ECC the Parameter CURVEA Word7 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_08 - * Offset: 0x948 ECC the Parameter CURVEA Word8 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_09 - * Offset: 0x94C ECC the Parameter CURVEA Word9 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_10 - * Offset: 0x950 ECC the Parameter CURVEA Word10 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_11 - * Offset: 0x954 ECC the Parameter CURVEA Word11 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_12 - * Offset: 0x958 ECC the Parameter CURVEA Word12 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_13 - * Offset: 0x95C ECC the Parameter CURVEA Word13 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_14 - * Offset: 0x960 ECC the Parameter CURVEA Word14 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_15 - * Offset: 0x964 ECC the Parameter CURVEA Word15 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_16 - * Offset: 0x968 ECC the Parameter CURVEA Word16 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_A_17 - * Offset: 0x96C ECC the Parameter CURVEA Word17 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_06 - * | | |For P-256 or SM2, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRYPTO_ECC_A_00~CRYPTO_ECC_A_16 - * @var CRYPTO_T::ECC_B_00 - * Offset: 0x970 ECC the Parameter CURVEB Word0 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_01 - * Offset: 0x974 ECC the Parameter CURVEB Word1 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_02 - * Offset: 0x978 ECC the Parameter CURVEB Word2 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_03 - * Offset: 0x97C ECC the Parameter CURVEB Word3 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_04 - * Offset: 0x980 ECC the Parameter CURVEB Word4 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_05 - * Offset: 0x984 ECC the Parameter CURVEB Word5 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_06 - * Offset: 0x988 ECC the Parameter CURVEB Word6 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_07 - * Offset: 0x98C ECC the Parameter CURVEB Word7 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_08 - * Offset: 0x990 ECC the Parameter CURVEB Word8 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_09 - * Offset: 0x994 ECC the Parameter CURVEB Word9 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_10 - * Offset: 0x998 ECC the Parameter CURVEB Word10 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_11 - * Offset: 0x99C ECC the Parameter CURVEB Word11 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_12 - * Offset: 0x9A0 ECC the Parameter CURVEB Word12 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_13 - * Offset: 0x9A4 ECC the Parameter CURVEB Word13 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_14 - * Offset: 0x9A8 ECC the Parameter CURVEB Word14 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_15 - * Offset: 0x9AC ECC the Parameter CURVEB Word15 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_16 - * Offset: 0x9B0 ECC the Parameter CURVEB Word16 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_B_17 - * Offset: 0x9B4 ECC the Parameter CURVEB Word17 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2m). - * | | |For B-163 or K-163, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_06 - * | | |For P-256 or SM2, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRYPTO_ECC_B_00~CRYPTO_ECC_B_16 - * @var CRYPTO_T::ECC_N_00 - * Offset: 0x9B8 ECC the Parameter CURVEN Word0 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_01 - * Offset: 0x9BC ECC the Parameter CURVEN Word1 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_02 - * Offset: 0x9C0 ECC the Parameter CURVEN Word2 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_03 - * Offset: 0x9C4 ECC the Parameter CURVEN Word3 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_04 - * Offset: 0x9C8 ECC the Parameter CURVEN Word4 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_05 - * Offset: 0x9CC ECC the Parameter CURVEN Word5 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_06 - * Offset: 0x9D0 ECC the Parameter CURVEN Word6 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_07 - * Offset: 0x9D4 ECC the Parameter CURVEN Word7 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_08 - * Offset: 0x9D8 ECC the Parameter CURVEN Word8 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_09 - * Offset: 0x9DC ECC the Parameter CURVEN Word9 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_10 - * Offset: 0x9E0 ECC the Parameter CURVEN Word10 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_11 - * Offset: 0x9E4 ECC the Parameter CURVEN Word11 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_12 - * Offset: 0x9E8 ECC the Parameter CURVEN Word12 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_13 - * Offset: 0x9EC ECC the Parameter CURVEN Word13 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_14 - * Offset: 0x9F0 ECC the Parameter CURVEN Word14 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_15 - * Offset: 0x9F4 ECC the Parameter CURVEN Word15 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_16 - * Offset: 0x9F8 ECC the Parameter CURVEN Word16 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_N_17 - * Offset: 0x9FC ECC the Parameter CURVEN Word17 of Elliptic Curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_06 - * | | |For P-256 or SM2, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRYPTO_ECC_N_00~CRYPTO_ECC_N_16 - * @var CRYPTO_T::ECC_K_00 - * Offset: 0xA00 ECC the Scalar SCALARK Word0 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_01 - * Offset: 0xA04 ECC the Scalar SCALARK Word1 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_02 - * Offset: 0xA08 ECC the Scalar SCALARK Word2 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_03 - * Offset: 0xA0C ECC the Scalar SCALARK Word3 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_04 - * Offset: 0xA10 ECC the Scalar SCALARK Word4 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_05 - * Offset: 0xA14 ECC the Scalar SCALARK Word5 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_06 - * Offset: 0xA18 ECC the Scalar SCALARK Word6 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_07 - * Offset: 0xA1C ECC the Scalar SCALARK Word7 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_08 - * Offset: 0xA20 ECC the Scalar SCALARK Word8 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_09 - * Offset: 0xA24 ECC the Scalar SCALARK Word9 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_10 - * Offset: 0xA28 ECC the Scalar SCALARK Word10 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_11 - * Offset: 0xA2C ECC the Scalar SCALARK Word11 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_12 - * Offset: 0xA30 ECC the Scalar SCALARK Word12 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_13 - * Offset: 0xA34 ECC the Scalar SCALARK Word13 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_14 - * Offset: 0xA38 ECC the Scalar SCALARK Word14 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_15 - * Offset: 0xA3C ECC the Scalar SCALARK Word15 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_16 - * Offset: 0xA40 ECC the Scalar SCALARK Word16 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_K_17 - * Offset: 0xA44 ECC the Scalar SCALARK Word17 of Point Multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_06 - * | | |For P-256 or SM2, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRYPTO_ECC_K_00~CRYPTO_ECC_K_16 - * @var CRYPTO_T::ECC_SADDR - * Offset: 0xA48 ECC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var CRYPTO_T::ECC_DADDR - * Offset: 0xA4C ECC DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |ECC DMA Destination Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory and ECC accelerator - * | | |The DADDR keeps the destination address of the data buffer where output data of ECC engine will be stored - * | | |Based on the destination address, the ECC accelerator can write the result data back to SRAM memory space after the ECC operation is finished - * | | |The start of destination address should be located at word boundary - * | | |That is, bit 1 and 0 of DADDR are ignored - * | | |DADDR can be read and written - * | | |In DMA mode, software must update the CRYPTO_ECC_DADDR before triggering START - * @var CRYPTO_T::ECC_STARTREG - * Offset: 0xA50 ECC Starting Address of Updated Registers - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |STARTREG |ECC Starting Address of Updated Registers - * | | |The address of the updated registers that DMA feeds the first data or parameter to ECC engine - * | | |When ECC engine is active, ECC accelerator does not allow users to modify STARTRE.G - * | | |For example, to update input data from register CRYPTO_ECC POINTX1 - * | | |Thus, the value of STARTREG is 0x808. - * @var CRYPTO_T::ECC_WORDCNT - * Offset: 0xA54 ECC DMA Word Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WORDCNT |ECC DMA Word Count - * | | |The CRYPTO_ECC_WORDCNT keeps the word count of source data that is for the required input data of ECC accelerator with various operations in DMA mode - * | | |Although CRYPTO_ECC_WORDCNT is 32-bit, the maximum of word count in ECC accelerator is 144 words - * | | |CRYPTO_ECC_WORDCNT can be read and written - * @var CRYPTO_T::RSA_CTL - * Offset: 0xB00 RSA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |RSA Accelerator Start - * | | |0 = No effect. - * | | |1 = Start RSA accelerator. BUSY flag will be set. - * | | |This bit is always 0 when it is read back. - * | | |RSA accelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |RSA Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort RSA accelerator and make it into initial state. - * | | |This bit is always 0 when it is read back. - * | | |Remember to clear RSA interrupt flag after stopping RSA accelerator. - * |[2] |CRT |CRT Enable Control - * | | |0 = CRT Disabled. - * | | |1 = CRT Enabled. - * | | |CRT is only used in decryption with key length 2048, 3072,4096 bits. - * |[3] |CRTBYP |CRT Bypass Enable Control - * | | |0 = CRT Bypass Disabled. - * | | |1 = CRT Bypass Enabled. - * | | |CRT bypass is only used in CRT decryption with the same key. - * | | |Note: If users want to decrypt repeatedly with the same key, they can execute CRT bypass mode after the first time CRT decryption (means the second time to the latest time), but they cannot set CRTBYP to 1 in non-CRT mode. - * |[5:4] |KEYLENG |The Key Length of RSA Operation - * | | |00 = 1024-bits. - * | | |01 = 2048-bits. - * | | |10 = 3072-bits. - * | | |11 = 4096-bits. - * |[8] |SCAP |Side Channel Attack Protection Enable Control - * | | |0 = Side Channel Attack Protection Disabled. - * | | |1 = Side Channel Attack Protection Enabled. - * @var CRYPTO_T::RSA_STS - * Offset: 0xB04 RSA Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |RSA Accelerator Busy Flag - * | | |0 = The RSA accelerator is idle or finished. - * | | |1 = The RSA accelerator is under processing and protects all registers. - * | | |Remember to clear RSA interrupt flag after RSA accelerator finished. - * |[1] |DMABUSY |RSA DMA Busy Flag - * | | |0 = RSA DMA is idle or finished. - * | | |1 = RSA DMA is busy. - * |[16] |BUSERR |RSA DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and RSA accelerator. - * |[17] |CTLERR |RSA Control Register Error Flag - * | | |0 = No error. - * | | |1 = RSA control error. RSA will not start in the unsupported situation. - * | | |Note: If users use the error combination of control, even though they don't set START(CRYPTO_RSA_CTL[0]) to 1, CTLERR still be set to 1. - * |[18] |KSERR |RSA Engine Access Key Store Error Flag - * | | |0 = No error. - * | | |1 = Access error will stop RSA engine. - * @var CRYPTO_T::RSA_SADDR0 - * Offset: 0xB08 RSA DMA Source Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR0 |RSA DMA Source Address Register0 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Base of Exponentiation (M). - * @var CRYPTO_T::RSA_SADDR1 - * Offset: 0xB0C RSA DMA Source Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR1 |RSA DMA Source Address Register1 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Base of Modulus Operation (N). - * @var CRYPTO_T::RSA_SADDR2 - * Offset: 0xB10 RSA DMA Source Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR2 |RSA DMA Source Address Register2 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Exponent of Exponentiation (E). - * @var CRYPTO_T::RSA_SADDR3 - * Offset: 0xB14 RSA DMA Source Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR3 |RSA DMA Source Address Register3 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Factor of Modulus Operation (p). - * @var CRYPTO_T::RSA_SADDR4 - * Offset: 0xB18 RSA DMA Source Address Register4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR4 |RSA DMA Source Address Register4 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA the Factor of Modulus Operation (q). - * @var CRYPTO_T::RSA_DADDR - * Offset: 0xB1C RSA DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |RSA DMA Destination Address Register - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * | | |This register is stored the address of RSA DMA Destination Address Register (Ans). - * @var CRYPTO_T::RSA_MADDR0 - * Offset: 0xB20 RSA DMA Middle Address Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR0 |RSA DMA Middle Address Register0 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * @var CRYPTO_T::RSA_MADDR1 - * Offset: 0xB24 RSA DMA Middle Address Register1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR1 |RSA DMA Middle Address Register1 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * @var CRYPTO_T::RSA_MADDR2 - * Offset: 0xB28 RSA DMA Middle Address Register2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR2 |RSA DMA Middle Address Register2 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * @var CRYPTO_T::RSA_MADDR3 - * Offset: 0xB2C RSA DMA Middle Address Register3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR3 |RSA DMA Middle Address Register3 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * @var CRYPTO_T::RSA_MADDR4 - * Offset: 0xB30 RSA DMA Middle Address Register4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR4 |RSA DMA Middle Address Register4 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * @var CRYPTO_T::RSA_MADDR5 - * Offset: 0xB34 RSA DMA Middle Address Register5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR5 |RSA DMA Middle Address Register5 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * @var CRYPTO_T::RSA_MADDR6 - * Offset: 0xB38 RSA DMA Middle Address Register6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MADDR6 |RSA DMA Middle Address Register6 - * | | |The RSA accelerator supports DMA function to transfer the DATA and PARAMETER between SRAM memory space and RSA accelerator. - * @var CRYPTO_T::PRNG_KSCTL - * Offset: 0xF00 PRNG Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Write Key Number - * | | |The key number is sent to key store - * | | |Note: Only for destination Is OTP of key store. - * |[8] |KEYSRC |Key Source - * | | |0 = Key (random number) is from PRNG engine. - * | | |1 = Key (random number) is from TRNG engine (skip PRNG operation). - * | | |Note: When KEYSRC is set to 1, PRNG operation will be skipped, it indicates that the bit (SEEDRLD) is meaningless. - * |[16] |TRUST |Write Key Trust Selection Bit - * | | |0 = Set written key as the non-secure key. - * | | |1 = Set written key as the secure key. - * |[19] |ECDH |ECDH Control Bit - * | | |0 = reserved. - * | | |1 = key is written to key store and used in ECDH. - * | | |Note: When ECDH was set to '1', 1 - * | | |PRNG seed must from TRNG and key is must written to the SRAM of key store (WSDST, CRYPTO_PRNG_KSCTL[23:22] must set to '00') - * | | |Otherwise, KCTLERR will become '1'(CRYPTO_PRNG_KSSTS[16]) - * | | |2 - * | | |Key must in the interval [1, n-1] (the parameter n is from ECC) - * | | |The value of n cannot be 0 or 1, otherwise, PRNG will always keep busy. - * |[20] |ECDSA |ECDSA Control Bit - * | | |0 = reserved. - * | | |1 = key is written to key store and used in ECDSA. - * | | |Note: When ECDSA was set to '1', 1 - * | | |PRNG seed must from TRNG and key is must written to the SRAM of key store (WSDST, CRYPTO_PRNG_KSCTL[23:22] must set to '00') - * | | |Otherwise, KCTLERR will become '1'(CRYPTO_PRNG_KSSTS[16]) - * | | |2 - * | | |Key must in the interval [1, n-1] (the parameter n is from ECC) - * | | |The value of n cannot be 0 or 1, otherwise, PRNG will always keep busy. - * |[21] |WDST |Write Key Destination - * | | |0 = key is written to registers CRYPTO_PRNG_KEYx. - * | | |1 = key is written to key store. - * |[23:22] |WSDST |Write Key Store Destination - * | | |00 = key is written to the SRAM of key store. - * | | |10 = key is written to the OTP of key store. - * | | |Others = reserved. - * |[26:24] |OWNER |Write Key Owner Selection Bits - * | | |000 = Only for AES used. - * | | |001 = Only for HMAC engine used. - * | | |100 = Only for ECC engine used. - * | | |101 = Only for CPU engine use. - * | | |Others = reserved. - * @var CRYPTO_T::PRNG_KSSTS - * Offset: 0xF04 PRNG Key Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Key Number - * | | |The key number is generated by key store - * @var CRYPTO_T::AES_KSCTL - * Offset: 0xF10 AES Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Source - * | | |0 = key is read from registers CRYPTO_AESx_KEYx. - * | | |1 = key is read from key store. - * |[7:6] |RSSRC |Read Key Store Source - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRYPTO_T::HMAC_KSCTL - * Offset: 0xF30 HMAC Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Source - * | | |0 = key is read from HMAC registers. - * | | |1 = key is read from key store. - * |[7:6] |RSSRC |Read Key Store Source - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRYPTO_T::ECC_KSCTL - * Offset: 0xF40 ECC Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUMK |Read Key Number K - * | | |The key number of CRYPTO_ECC_K is sent to key store when RSRCK =1. - * |[5] |RSRCK |Read Key Source for Key Number K - * | | |0 = key is read from ECC registers. - * | | |1 = key is read from key store. - * |[7:6] |RSSRCK |Read Key Store Source for Key Number K - * | | |00 = key is read from the SRAM of key store. - * | | |10 = key is read from the OTP of key store. - * | | |Others = reserved. - * |[14] |ECDH |ECDH Control Bit - * | | |0 = reserved. - * | | |1 = Set ECC operation is in ECDH - * | | |When this bit and RSRCK are equal to 0x1, ECC will read ECDH private key to CRYPTO_ECC_K from key store. - * |[16] |TRUST |Write Key Trust Selection Bit - * | | |0 = Set ECDH written key as the non-secure key. - * | | |1 = Set ECDH written key as the secure key. - * |[20] |XY |ECDH Output Select Bit - * | | |0 = The ECDH written key is from X-coordinate Value. - * | | |1 = The ECDH written key is from Y-coordinate Value. - * |[21] |WDST |Write Key Destination - * | | |0 = The ECDH written key is in registers CRYPTO_ECC_X1 and CRYPTO_ECC_Y. - * | | |1 = The ECDH written key is written to key store. - * |[23:22] |WSDST |Write Key Store Destination - * | | |00 = The ECDH written key is written to the SRAM of key store. - * | | |10 = The ECDH written key is written to the OTP of key store. - * | | |Others = reserved. - * |[26:24] |OWNER |Write Key Owner Selection Bits - * | | |000 = The ECDH written key is only for AES used. - * | | |001 = The ECDH written key is only for HMAC engine used. - * | | |100 = The ECDH written key is only for ECC engine used. - * | | |101 = The ECDH written key is only for CPU engine use. - * | | |Others = reserved. - * @var CRYPTO_T::ECC_KSSTS - * Offset: 0xF44 ECC Key Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Key Number - * | | |The key number is generated by key store after ECDH. - * @var CRYPTO_T::ECC_KSXY - * Offset: 0xF48 ECC XY Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUMX |Read Key Number X - * | | |The key number of CRYPTO_ECC_X1 is sent to key store when RSRCXY =1. - * |[5] |RSRCXY |Read Key Source for Key Number x and Y - * | | |0 = Key is read from ECC registers. - * | | |1 = Key is read from key store. - * |[7:6] |RSSRCX |Read Key Store Source for Key Number X - * | | |00 = Key is read from the SRAM of key store. - * | | |10 = Key is read from the OTP of key store. - * | | |Others = reserved. - * |[12:8] |NUMY |Read Key Number Y - * | | |The key number of CRYPTO_ECC_Y1 is sent to key store when RSRCXY =1. - * |[15:14] |RSSRCY |Read Key Store Source for Key Number Y - * | | |00 = Key is read from the SRAM of key store. - * | | |10 = Key is read from the OTP of key store. - * | | |Others = reserved. - * @var CRYPTO_T::RSA_KSCTL - * Offset: 0xF50 RSA Key Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM |Read Key Number - * | | |The key number is sent to key store - * |[5] |RSRC |Read Key Source - * | | |0 = Key is read from RSA engine. - * | | |1 = Key is read from key store. - * |[7:6] |RSSRC |Read Key Store Source - * | | |00 = Key is read from the SRAM of key store. - * | | |Others = Reserved. - * |[12:8] |BKNUM |Read Exponent Blind Key Number - * | | |The key number is sent to key store, and its destination always be the SRAM of key store - * | | |CPU cannot read the exponent blind key. - * | | |Note: Use this key number, only when executing SCA protection but no-CRT mode - * | | |When allocate space of key store, key owner selection bits(KS_METADATA[18:16]) should be '010'. - * @var CRYPTO_T::RSA_KSSTS0 - * Offset: 0xF54 RSA Key Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM0 |Key Number0 - * | | |The key number is generated by key store, RSA can get complete p by key number in key store while operating. - * | | |Note: The size of this key as half key length. - * |[12:8] |NUM1 |Key Number1 - * | | |The key number is generated by key store, RSA can get complete q by key number in Key Store while operating. - * | | |Note: The size of this key as half key length. - * |[20:16] |NUM2 |Key Number2 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value by key number in the key store while operating. - * | | |Note: The size of this key as key length. - * |[28:24] |NUM3 |Key Number3 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value by key number in the key store while operating. - * | | |Note: The size of this key as key length. - * @var CRYPTO_T::RSA_KSSTS1 - * Offset: 0xF58 RSA Key Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |NUM4 |Key Number4 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value by key number in key store while operating. - * | | |Note: The size of this key as half key length. - * |[12:8] |NUM5 |Key Number5 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value by key number in key store while operating. - * | | |Note: The size of this key as half key length. - * |[20:16] |NUM6 |Key Number6 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value by key number in key store while operating. - * | | |Note: The size of this key as key length. - * |[28:24] |NUM7 |Key Number7 - * | | |The key number is generated by key store, RSA can get or store the intermediate temporary value by key number in key store while operating. - * | | |Note: The size of this key as key length. - */ - __IO uint32_t INTEN; /*!< [0x0000] Crypto Interrupt Enable Control Register */ - __IO uint32_t INTSTS; /*!< [0x0004] Crypto Interrupt Flag */ - __IO uint32_t PRNG_CTL; /*!< [0x0008] PRNG Control Register */ - __O uint32_t PRNG_SEED; /*!< [0x000c] Seed for PRNG */ - __I uint32_t PRNG_KEY0; /*!< [0x0010] PRNG Generated Key0 */ - __I uint32_t PRNG_KEY1; /*!< [0x0014] PRNG Generated Key1 */ - __I uint32_t PRNG_KEY2; /*!< [0x0018] PRNG Generated Key2 */ - __I uint32_t PRNG_KEY3; /*!< [0x001c] PRNG Generated Key3 */ - __I uint32_t PRNG_KEY4; /*!< [0x0020] PRNG Generated Key4 */ - __I uint32_t PRNG_KEY5; /*!< [0x0024] PRNG Generated Key5 */ - __I uint32_t PRNG_KEY6; /*!< [0x0028] PRNG Generated Key6 */ - __I uint32_t PRNG_KEY7; /*!< [0x002c] PRNG Generated Key7 */ - __I uint32_t PRNG_STS; /*!< [0x0030] PRNG Status Register */ - __I uint32_t RESERVE0[7]; - __I uint32_t AES_FDBCK0; /*!< [0x0050] AES Engine Output Feedback Data After Cryptographic Operation */ - __I uint32_t AES_FDBCK1; /*!< [0x0054] AES Engine Output Feedback Data After Cryptographic Operation */ - __I uint32_t AES_FDBCK2; /*!< [0x0058] AES Engine Output Feedback Data After Cryptographic Operation */ - __I uint32_t AES_FDBCK3; /*!< [0x005c] AES Engine Output Feedback Data After Cryptographic Operation */ - __I uint32_t RESERVE1[8]; - __IO uint32_t AES_GCM_IVCNT0; /*!< [0x0080] AES GCM IV Byte Count Register 0 */ - __IO uint32_t AES_GCM_IVCNT1; /*!< [0x0084] AES GCM IV Byte Count Register 1 */ - __IO uint32_t AES_GCM_ACNT0; /*!< [0x0088] AES GCM A Byte Count Register 0 */ - __IO uint32_t AES_GCM_ACNT1; /*!< [0x008c] AES GCM A Byte Count Register 1 */ - __IO uint32_t AES_GCM_PCNT0; /*!< [0x0090] AES GCM P Byte Count Register 0 */ - __IO uint32_t AES_GCM_PCNT1; /*!< [0x0094] AES GCM P Byte Count Register 1 */ - __I uint32_t RESERVE2[2]; - __IO uint32_t AES_FBADDR; /*!< [0x00a0] AES DMA Feedback Address Register */ - __I uint32_t RESERVE3[23]; - __IO uint32_t AES_CTL; /*!< [0x0100] AES Control Register */ - __I uint32_t AES_STS; /*!< [0x0104] AES Engine Flag */ - __IO uint32_t AES_DATIN; /*!< [0x0108] AES Engine Data Input Port Register */ - __I uint32_t AES_DATOUT; /*!< [0x010c] AES Engine Data Output Port Register */ - __IO uint32_t AES_KEY0; /*!< [0x0110] AES Key Word 0 Register */ - __IO uint32_t AES_KEY1; /*!< [0x0114] AES Key Word 1 Register */ - __IO uint32_t AES_KEY2; /*!< [0x0118] AES Key Word 2 Register */ - __IO uint32_t AES_KEY3; /*!< [0x011c] AES Key Word 3 Register */ - __IO uint32_t AES_KEY4; /*!< [0x0120] AES Key Word 4 Register */ - __IO uint32_t AES_KEY5; /*!< [0x0124] AES Key Word 5 Register */ - __IO uint32_t AES_KEY6; /*!< [0x0128] AES Key Word 6 Register */ - __IO uint32_t AES_KEY7; /*!< [0x012c] AES Key Word 7 Register */ - __IO uint32_t AES_IV0; /*!< [0x0130] AES Initial Vector Word 0 Register */ - __IO uint32_t AES_IV1; /*!< [0x0134] AES Initial Vector Word 1 Register */ - __IO uint32_t AES_IV2; /*!< [0x0138] AES Initial Vector Word 2 Register */ - __IO uint32_t AES_IV3; /*!< [0x013c] AES Initial Vector Word 3 Register */ - __IO uint32_t AES_SADDR; /*!< [0x0140] AES DMA Source Address Register */ - __IO uint32_t AES_DADDR; /*!< [0x0144] AES DMA Destination Address Register */ - __IO uint32_t AES_CNT; /*!< [0x0148] AES Byte Count Register */ - __I uint32_t RESERVE4[109]; - __IO uint32_t HMAC_CTL; /*!< [0x0300] SHA/HMAC Control Register */ - __I uint32_t HMAC_STS; /*!< [0x0304] SHA/HMAC Status Flag */ - __I uint32_t HMAC_DGST0; /*!< [0x0308] SHA/HMAC Output Feedback Data 0 */ - __I uint32_t HMAC_DGST1; /*!< [0x030c] SHA/HMAC Output Feedback Data 1 */ - __I uint32_t HMAC_DGST2; /*!< [0x0310] SHA/HMAC Output Feedback Data 2 */ - __I uint32_t HMAC_DGST3; /*!< [0x0314] SHA/HMAC Output Feedback Data 3 */ - __I uint32_t HMAC_DGST4; /*!< [0x0318] SHA/HMAC Output Feedback Data 4 */ - __I uint32_t HMAC_DGST5; /*!< [0x031c] SHA/HMAC Output Feedback Data 5 */ - __I uint32_t HMAC_DGST6; /*!< [0x0320] SHA/HMAC Output Feedback Data 6 */ - __I uint32_t HMAC_DGST7; /*!< [0x0324] SHA/HMAC Output Feedback Data 7 */ - __I uint32_t HMAC_DGST8; /*!< [0x0328] SHA/HMAC Output Feedback Data 8 */ - __I uint32_t HMAC_DGST9; /*!< [0x032c] SHA/HMAC Output Feedback Data 9 */ - __I uint32_t HMAC_DGST10; /*!< [0x0330] SHA/HMAC Output Feedback Data 10 */ - __I uint32_t HMAC_DGST11; /*!< [0x0334] SHA/HMAC Output Feedback Data 11 */ - __I uint32_t HMAC_DGST12; /*!< [0x0338] SHA/HMAC Output Feedback Data 12 */ - __I uint32_t HMAC_DGST13; /*!< [0x033c] SHA/HMAC Output Feedback Data 13 */ - __I uint32_t HMAC_DGST14; /*!< [0x0340] SHA/HMAC Output Feedback Data 14 */ - __I uint32_t HMAC_DGST15; /*!< [0x0344] SHA/HMAC Output Feedback Data 15 */ - __IO uint32_t HMAC_KEYCNT; /*!< [0x0348] SHA/HMAC Key Byte Count Register */ - __IO uint32_t HMAC_SADDR; /*!< [0x034c] SHA/HMAC DMA Source Address Register */ - __IO uint32_t HMAC_DMACNT; /*!< [0x0350] SHA/HMAC Byte Count Register */ - __IO uint32_t HMAC_DATIN; /*!< [0x0354] SHA/HMAC Engine Non-DMA Mode Data Input Port Register */ - __IO uint32_t HMAC_FDBCK0; /*!< [0x0358] SHA/HMAC Output Feedback Data 0 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK1; /*!< [0x035c] SHA/HMAC Output Feedback Data 1 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK2; /*!< [0x0360] SHA/HMAC Output Feedback Data 2 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK3; /*!< [0x0364] SHA/HMAC Output Feedback Data 3 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK4; /*!< [0x0368] SHA/HMAC Output Feedback Data 4 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK5; /*!< [0x036c] SHA/HMAC Output Feedback Data 5 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK6; /*!< [0x0370] SHA/HMAC Output Feedback Data 6 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK7; /*!< [0x0374] SHA/HMAC Output Feedback Data 7 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK8; /*!< [0x0378] SHA/HMAC Output Feedback Data 8 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK9; /*!< [0x037c] SHA/HMAC Output Feedback Data 9 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK10; /*!< [0x0380] SHA/HMAC Output Feedback Data 10 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK11; /*!< [0x0384] SHA/HMAC Output Feedback Data 11 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK12; /*!< [0x0388] SHA/HMAC Output Feedback Data 12 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK13; /*!< [0x038c] SHA/HMAC Output Feedback Data 13 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK14; /*!< [0x0390] SHA/HMAC Output Feedback Data 14 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK15; /*!< [0x0394] SHA/HMAC Output Feedback Data 15 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK16; /*!< [0x0398] SHA/HMAC Output Feedback Data 16 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK17; /*!< [0x039c] SHA/HMAC Output Feedback Data 17 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK18; /*!< [0x03a0] SHA/HMAC Output Feedback Data 18 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK19; /*!< [0x03a4] SHA/HMAC Output Feedback Data 19 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK20; /*!< [0x03a8] SHA/HMAC Output Feedback Data 20 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK21; /*!< [0x03ac] SHA/HMAC Output Feedback Data 21 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK22; /*!< [0x03b0] SHA/HMAC Output Feedback Data 22 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK23; /*!< [0x03b4] SHA/HMAC Output Feedback Data 23 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK24; /*!< [0x03b8] SHA/HMAC Output Feedback Data 24 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK25; /*!< [0x03bc] SHA/HMAC Output Feedback Data 25 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK26; /*!< [0x03c0] SHA/HMAC Output Feedback Data 26 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK27; /*!< [0x03c4] SHA/HMAC Output Feedback Data 27 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK28; /*!< [0x03c8] SHA/HMAC Output Feedback Data 28 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK29; /*!< [0x03cc] SHA/HMAC Output Feedback Data 29 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK30; /*!< [0x03d0] SHA/HMAC Output Feedback Data 30 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK31; /*!< [0x03d4] SHA/HMAC Output Feedback Data 31 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK32; /*!< [0x03d8] SHA/HMAC Output Feedback Data 32 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK33; /*!< [0x03dc] SHA/HMAC Output Feedback Data 33 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK34; /*!< [0x03e0] SHA/HMAC Output Feedback Data 34 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK35; /*!< [0x03e4] SHA/HMAC Output Feedback Data 35 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK36; /*!< [0x03e8] SHA/HMAC Output Feedback Data 36 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK37; /*!< [0x03ec] SHA/HMAC Output Feedback Data 37 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK38; /*!< [0x03f0] SHA/HMAC Output Feedback Data 38 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK39; /*!< [0x03f4] SHA/HMAC Output Feedback Data 39 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK40; /*!< [0x03f8] SHA/HMAC Output Feedback Data 40 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK41; /*!< [0x03fc] SHA/HMAC Output Feedback Data 41 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK42; /*!< [0x0400] SHA/HMAC Output Feedback Data 42 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK43; /*!< [0x0404] SHA/HMAC Output Feedback Data 43 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK44; /*!< [0x0408] SHA/HMAC Output Feedback Data 44 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK45; /*!< [0x040c] SHA/HMAC Output Feedback Data 45 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK46; /*!< [0x0410] SHA/HMAC Output Feedback Data 46 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK47; /*!< [0x0414] SHA/HMAC Output Feedback Data 47 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK48; /*!< [0x0418] SHA/HMAC Output Feedback Data 48 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK49; /*!< [0x041c] SHA/HMAC Output Feedback Data 49 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK50; /*!< [0x0420] SHA/HMAC Output Feedback Data 50 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK51; /*!< [0x0424] SHA/HMAC Output Feedback Data 51 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK52; /*!< [0x0428] SHA/HMAC Output Feedback Data 52 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK53; /*!< [0x042c] SHA/HMAC Output Feedback Data 53 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK54; /*!< [0x0430] SHA/HMAC Output Feedback Data 54 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK55; /*!< [0x0434] SHA/HMAC Output Feedback Data 55 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK56; /*!< [0x0438] SHA/HMAC Output Feedback Data 56 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK57; /*!< [0x043c] SHA/HMAC Output Feedback Data 57 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK58; /*!< [0x0440] SHA/HMAC Output Feedback Data 58 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK59; /*!< [0x0444] SHA/HMAC Output Feedback Data 59 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK60; /*!< [0x0448] SHA/HMAC Output Feedback Data 60 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK61; /*!< [0x044c] SHA/HMAC Output Feedback Data 61 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK62; /*!< [0x0450] SHA/HMAC Output Feedback Data 62 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK63; /*!< [0x0454] SHA/HMAC Output Feedback Data 63 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK64; /*!< [0x0458] SHA/HMAC Output Feedback Data 64 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK65; /*!< [0x045c] SHA/HMAC Output Feedback Data 65 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK66; /*!< [0x0460] SHA/HMAC Output Feedback Data 66 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK67; /*!< [0x0464] SHA/HMAC Output Feedback Data 67 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK68; /*!< [0x0468] SHA/HMAC Output Feedback Data 68 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK69; /*!< [0x046c] SHA/HMAC Output Feedback Data 69 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK70; /*!< [0x0470] SHA/HMAC Output Feedback Data 70 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK71; /*!< [0x0474] SHA/HMAC Output Feedback Data 71 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK72; /*!< [0x0478] SHA/HMAC Output Feedback Data 72 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK73; /*!< [0x047c] SHA/HMAC Output Feedback Data 73 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK74; /*!< [0x0480] SHA/HMAC Output Feedback Data 74 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK75; /*!< [0x0484] SHA/HMAC Output Feedback Data 75 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK76; /*!< [0x0488] SHA/HMAC Output Feedback Data 76 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK77; /*!< [0x048c] SHA/HMAC Output Feedback Data 77 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK78; /*!< [0x0490] SHA/HMAC Output Feedback Data 78 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK79; /*!< [0x0494] SHA/HMAC Output Feedback Data 79 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK80; /*!< [0x0498] SHA/HMAC Output Feedback Data 80 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK81; /*!< [0x049c] SHA/HMAC Output Feedback Data 81 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK82; /*!< [0x04a0] SHA/HMAC Output Feedback Data 82 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK83; /*!< [0x04a4] SHA/HMAC Output Feedback Data 83 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK84; /*!< [0x04a8] SHA/HMAC Output Feedback Data 84 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK85; /*!< [0x04ac] SHA/HMAC Output Feedback Data 85 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK86; /*!< [0x04b0] SHA/HMAC Output Feedback Data 86 After SHA/HMAC Operation */ - __IO uint32_t HMAC_FDBCK87; /*!< [0x04b4] SHA/HMAC Output Feedback Data 87 After SHA/HMAC Operation */ - __I uint32_t RESERVE5[16]; - __IO uint32_t HMAC_SHA512T; /*!< [0x04f8] SHA/HMAC SHA512T Control Register */ - __IO uint32_t HMAC_FBADDR; /*!< [0x04fc] SHA/HMAC DMA Feedback Address Register */ - __I uint32_t HMAC_SHAKEDGST0; /*!< [0x0500] SHA/HMAC SHAKE Digest Message 0 */ - __I uint32_t HMAC_SHAKEDGST1; /*!< [0x0504] SHA/HMAC SHAKE Digest Message 1 */ - __I uint32_t HMAC_SHAKEDGST2; /*!< [0x0508] SHA/HMAC SHAKE Digest Message 2 */ - __I uint32_t HMAC_SHAKEDGST3; /*!< [0x050c] SHA/HMAC SHAKE Digest Message 3 */ - __I uint32_t HMAC_SHAKEDGST4; /*!< [0x0510] SHA/HMAC SHAKE Digest Message 4 */ - __I uint32_t HMAC_SHAKEDGST5; /*!< [0x0514] SHA/HMAC SHAKE Digest Message 5 */ - __I uint32_t HMAC_SHAKEDGST6; /*!< [0x0518] SHA/HMAC SHAKE Digest Message 6 */ - __I uint32_t HMAC_SHAKEDGST7; /*!< [0x051c] SHA/HMAC SHAKE Digest Message 7 */ - __I uint32_t HMAC_SHAKEDGST8; /*!< [0x0520] SHA/HMAC SHAKE Digest Message 8 */ - __I uint32_t HMAC_SHAKEDGST9; /*!< [0x0524] SHA/HMAC SHAKE Digest Message 9 */ - __I uint32_t HMAC_SHAKEDGST10; /*!< [0x0528] SHA/HMAC SHAKE Digest Message 10 */ - __I uint32_t HMAC_SHAKEDGST11; /*!< [0x052c] SHA/HMAC SHAKE Digest Message 11 */ - __I uint32_t HMAC_SHAKEDGST12; /*!< [0x0530] SHA/HMAC SHAKE Digest Message 12 */ - __I uint32_t HMAC_SHAKEDGST13; /*!< [0x0534] SHA/HMAC SHAKE Digest Message 13 */ - __I uint32_t HMAC_SHAKEDGST14; /*!< [0x0538] SHA/HMAC SHAKE Digest Message 14 */ - __I uint32_t HMAC_SHAKEDGST15; /*!< [0x053c] SHA/HMAC SHAKE Digest Message 15 */ - __I uint32_t HMAC_SHAKEDGST16; /*!< [0x0540] SHA/HMAC SHAKE Digest Message 16 */ - __I uint32_t HMAC_SHAKEDGST17; /*!< [0x0544] SHA/HMAC SHAKE Digest Message 17 */ - __I uint32_t HMAC_SHAKEDGST18; /*!< [0x0548] SHA/HMAC SHAKE Digest Message 18 */ - __I uint32_t HMAC_SHAKEDGST19; /*!< [0x054c] SHA/HMAC SHAKE Digest Message 19 */ - __I uint32_t HMAC_SHAKEDGST20; /*!< [0x0550] SHA/HMAC SHAKE Digest Message 20 */ - __I uint32_t HMAC_SHAKEDGST21; /*!< [0x0554] SHA/HMAC SHAKE Digest Message 21 */ - __I uint32_t HMAC_SHAKEDGST22; /*!< [0x0558] SHA/HMAC SHAKE Digest Message 22 */ - __I uint32_t HMAC_SHAKEDGST23; /*!< [0x055c] SHA/HMAC SHAKE Digest Message 23 */ - __I uint32_t HMAC_SHAKEDGST24; /*!< [0x0560] SHA/HMAC SHAKE Digest Message 24 */ - __I uint32_t HMAC_SHAKEDGST25; /*!< [0x0564] SHA/HMAC SHAKE Digest Message 25 */ - __I uint32_t HMAC_SHAKEDGST26; /*!< [0x0568] SHA/HMAC SHAKE Digest Message 26 */ - __I uint32_t HMAC_SHAKEDGST27; /*!< [0x056c] SHA/HMAC SHAKE Digest Message 27 */ - __I uint32_t HMAC_SHAKEDGST28; /*!< [0x0570] SHA/HMAC SHAKE Digest Message 28 */ - __I uint32_t HMAC_SHAKEDGST29; /*!< [0x0574] SHA/HMAC SHAKE Digest Message 29 */ - __I uint32_t HMAC_SHAKEDGST30; /*!< [0x0578] SHA/HMAC SHAKE Digest Message 30 */ - __I uint32_t HMAC_SHAKEDGST31; /*!< [0x057c] SHA/HMAC SHAKE Digest Message 31 */ - __I uint32_t HMAC_SHAKEDGST32; /*!< [0x0580] SHA/HMAC SHAKE Digest Message 32 */ - __I uint32_t HMAC_SHAKEDGST33; /*!< [0x0584] SHA/HMAC SHAKE Digest Message 33 */ - __I uint32_t HMAC_SHAKEDGST34; /*!< [0x0588] SHA/HMAC SHAKE Digest Message 34 */ - __I uint32_t HMAC_SHAKEDGST35; /*!< [0x058c] SHA/HMAC SHAKE Digest Message 35 */ - __I uint32_t HMAC_SHAKEDGST36; /*!< [0x0590] SHA/HMAC SHAKE Digest Message 36 */ - __I uint32_t HMAC_SHAKEDGST37; /*!< [0x0594] SHA/HMAC SHAKE Digest Message 37 */ - __I uint32_t HMAC_SHAKEDGST38; /*!< [0x0598] SHA/HMAC SHAKE Digest Message 38 */ - __I uint32_t HMAC_SHAKEDGST39; /*!< [0x059c] SHA/HMAC SHAKE Digest Message 39 */ - __I uint32_t HMAC_SHAKEDGST40; /*!< [0x05a0] SHA/HMAC SHAKE Digest Message 40 */ - __I uint32_t HMAC_SHAKEDGST41; /*!< [0x05a4] SHA/HMAC SHAKE Digest Message 41 */ - __I uint32_t RESERVE6[150]; - __IO uint32_t ECC_CTL; /*!< [0x0800] ECC Control Register */ - __I uint32_t ECC_STS; /*!< [0x0804] ECC Status Register */ - __IO uint32_t ECC_X1_00; /*!< [0x0808] ECC the X-coordinate Word0 of the First Point */ - __IO uint32_t ECC_X1_01; /*!< [0x080c] ECC the X-coordinate Word1 of the First Point */ - __IO uint32_t ECC_X1_02; /*!< [0x0810] ECC the X-coordinate Word2 of the First Point */ - __IO uint32_t ECC_X1_03; /*!< [0x0814] ECC the X-coordinate Word3 of the First Point */ - __IO uint32_t ECC_X1_04; /*!< [0x0818] ECC the X-coordinate Word4 of the First Point */ - __IO uint32_t ECC_X1_05; /*!< [0x081c] ECC the X-coordinate Word5 of the First Point */ - __IO uint32_t ECC_X1_06; /*!< [0x0820] ECC the X-coordinate Word6 of the First Point */ - __IO uint32_t ECC_X1_07; /*!< [0x0824] ECC the X-coordinate Word7 of the First Point */ - __IO uint32_t ECC_X1_08; /*!< [0x0828] ECC the X-coordinate Word8 of the First Point */ - __IO uint32_t ECC_X1_09; /*!< [0x082c] ECC the X-coordinate Word9 of the First Point */ - __IO uint32_t ECC_X1_10; /*!< [0x0830] ECC the X-coordinate Word10 of the First Point */ - __IO uint32_t ECC_X1_11; /*!< [0x0834] ECC the X-coordinate Word11 of the First Point */ - __IO uint32_t ECC_X1_12; /*!< [0x0838] ECC the X-coordinate Word12 of the First Point */ - __IO uint32_t ECC_X1_13; /*!< [0x083c] ECC the X-coordinate Word13 of the First Point */ - __IO uint32_t ECC_X1_14; /*!< [0x0840] ECC the X-coordinate Word14 of the First Point */ - __IO uint32_t ECC_X1_15; /*!< [0x0844] ECC the X-coordinate Word15 of the First Point */ - __IO uint32_t ECC_X1_16; /*!< [0x0848] ECC the X-coordinate Word16 of the First Point */ - __IO uint32_t ECC_X1_17; /*!< [0x084c] ECC the X-coordinate Word17 of the First Point */ - __IO uint32_t ECC_Y1_00; /*!< [0x0850] ECC the Y-coordinate Word0 of the First Point */ - __IO uint32_t ECC_Y1_01; /*!< [0x0854] ECC the Y-coordinate Word1 of the First Point */ - __IO uint32_t ECC_Y1_02; /*!< [0x0858] ECC the Y-coordinate Word2 of the First Point */ - __IO uint32_t ECC_Y1_03; /*!< [0x085c] ECC the Y-coordinate Word3 of the First Point */ - __IO uint32_t ECC_Y1_04; /*!< [0x0860] ECC the Y-coordinate Word4 of the First Point */ - __IO uint32_t ECC_Y1_05; /*!< [0x0864] ECC the Y-coordinate Word5 of the First Point */ - __IO uint32_t ECC_Y1_06; /*!< [0x0868] ECC the Y-coordinate Word6 of the First Point */ - __IO uint32_t ECC_Y1_07; /*!< [0x086c] ECC the Y-coordinate Word7 of the First Point */ - __IO uint32_t ECC_Y1_08; /*!< [0x0870] ECC the Y-coordinate Word8 of the First Point */ - __IO uint32_t ECC_Y1_09; /*!< [0x0874] ECC the Y-coordinate Word9 of the First Point */ - __IO uint32_t ECC_Y1_10; /*!< [0x0878] ECC the Y-coordinate Word10 of the First Point */ - __IO uint32_t ECC_Y1_11; /*!< [0x087c] ECC the Y-coordinate Word11 of the First Point */ - __IO uint32_t ECC_Y1_12; /*!< [0x0880] ECC the Y-coordinate Word12 of the First Point */ - __IO uint32_t ECC_Y1_13; /*!< [0x0884] ECC the Y-coordinate Word13 of the First Point */ - __IO uint32_t ECC_Y1_14; /*!< [0x0888] ECC the Y-coordinate Word14 of the First Point */ - __IO uint32_t ECC_Y1_15; /*!< [0x088c] ECC the Y-coordinate Word15 of the First Point */ - __IO uint32_t ECC_Y1_16; /*!< [0x0890] ECC the Y-coordinate Word16 of the First Point */ - __IO uint32_t ECC_Y1_17; /*!< [0x0894] ECC the Y-coordinate Word17 of the First Point */ - __IO uint32_t ECC_X2_00; /*!< [0x0898] ECC the X-coordinate Word0 of the Second Point */ - __IO uint32_t ECC_X2_01; /*!< [0x089c] ECC the X-coordinate Word1 of the Second Point */ - __IO uint32_t ECC_X2_02; /*!< [0x08a0] ECC the X-coordinate Word2 of the Second Point */ - __IO uint32_t ECC_X2_03; /*!< [0x08a4] ECC the X-coordinate Word3 of the Second Point */ - __IO uint32_t ECC_X2_04; /*!< [0x08a8] ECC the X-coordinate Word4 of the Second Point */ - __IO uint32_t ECC_X2_05; /*!< [0x08ac] ECC the X-coordinate Word5 of the Second Point */ - __IO uint32_t ECC_X2_06; /*!< [0x08b0] ECC the X-coordinate Word6 of the Second Point */ - __IO uint32_t ECC_X2_07; /*!< [0x08b4] ECC the X-coordinate Word7 of the Second Point */ - __IO uint32_t ECC_X2_08; /*!< [0x08b8] ECC the X-coordinate Word8 of the Second Point */ - __IO uint32_t ECC_X2_09; /*!< [0x08bc] ECC the X-coordinate Word9 of the Second Point */ - __IO uint32_t ECC_X2_10; /*!< [0x08c0] ECC the X-coordinate Word10 of the Second Point */ - __IO uint32_t ECC_X2_11; /*!< [0x08c4] ECC the X-coordinate Word11 of the Second Point */ - __IO uint32_t ECC_X2_12; /*!< [0x08c8] ECC the X-coordinate Word12 of the Second Point */ - __IO uint32_t ECC_X2_13; /*!< [0x08cc] ECC the X-coordinate Word13 of the Second Point */ - __IO uint32_t ECC_X2_14; /*!< [0x08d0] ECC the X-coordinate Word14 of the Second Point */ - __IO uint32_t ECC_X2_15; /*!< [0x08d4] ECC the X-coordinate Word15 of the Second Point */ - __IO uint32_t ECC_X2_16; /*!< [0x08d8] ECC the X-coordinate Word16 of the Second Point */ - __IO uint32_t ECC_X2_17; /*!< [0x08dc] ECC the X-coordinate Word17 of the Second Point */ - __IO uint32_t ECC_Y2_00; /*!< [0x08e0] ECC the Y-coordinate Word0 of the Second Point */ - __IO uint32_t ECC_Y2_01; /*!< [0x08e4] ECC the Y-coordinate Word1 of the Second Point */ - __IO uint32_t ECC_Y2_02; /*!< [0x08e8] ECC the Y-coordinate Word2 of the Second Point */ - __IO uint32_t ECC_Y2_03; /*!< [0x08ec] ECC the Y-coordinate Word3 of the Second Point */ - __IO uint32_t ECC_Y2_04; /*!< [0x08f0] ECC the Y-coordinate Word4 of the Second Point */ - __IO uint32_t ECC_Y2_05; /*!< [0x08f4] ECC the Y-coordinate Word5 of the Second Point */ - __IO uint32_t ECC_Y2_06; /*!< [0x08f8] ECC the Y-coordinate Word6 of the Second Point */ - __IO uint32_t ECC_Y2_07; /*!< [0x08fc] ECC the Y-coordinate Word7 of the Second Point */ - __IO uint32_t ECC_Y2_08; /*!< [0x0900] ECC the Y-coordinate Word8 of the Second Point */ - __IO uint32_t ECC_Y2_09; /*!< [0x0904] ECC the Y-coordinate Word9 of the Second Point */ - __IO uint32_t ECC_Y2_10; /*!< [0x0908] ECC the Y-coordinate Word10 of the Second Point */ - __IO uint32_t ECC_Y2_11; /*!< [0x090c] ECC the Y-coordinate Word11 of the Second Point */ - __IO uint32_t ECC_Y2_12; /*!< [0x0910] ECC the Y-coordinate Word12 of the Second Point */ - __IO uint32_t ECC_Y2_13; /*!< [0x0914] ECC the Y-coordinate Word13 of the Second Point */ - __IO uint32_t ECC_Y2_14; /*!< [0x0918] ECC the Y-coordinate Word14 of the Second Point */ - __IO uint32_t ECC_Y2_15; /*!< [0x091c] ECC the Y-coordinate Word15 of the Second Point */ - __IO uint32_t ECC_Y2_16; /*!< [0x0920] ECC the Y-coordinate Word16 of the Second Point */ - __IO uint32_t ECC_Y2_17; /*!< [0x0924] ECC the Y-coordinate Word17 of the Second Point */ - __IO uint32_t ECC_A_00; /*!< [0x0928] ECC the Parameter CURVEA Word0 of Elliptic Curve */ - __IO uint32_t ECC_A_01; /*!< [0x092c] ECC the Parameter CURVEA Word1 of Elliptic Curve */ - __IO uint32_t ECC_A_02; /*!< [0x0930] ECC the Parameter CURVEA Word2 of Elliptic Curve */ - __IO uint32_t ECC_A_03; /*!< [0x0934] ECC the Parameter CURVEA Word3 of Elliptic Curve */ - __IO uint32_t ECC_A_04; /*!< [0x0938] ECC the Parameter CURVEA Word4 of Elliptic Curve */ - __IO uint32_t ECC_A_05; /*!< [0x093c] ECC the Parameter CURVEA Word5 of Elliptic Curve */ - __IO uint32_t ECC_A_06; /*!< [0x0940] ECC the Parameter CURVEA Word6 of Elliptic Curve */ - __IO uint32_t ECC_A_07; /*!< [0x0944] ECC the Parameter CURVEA Word7 of Elliptic Curve */ - __IO uint32_t ECC_A_08; /*!< [0x0948] ECC the Parameter CURVEA Word8 of Elliptic Curve */ - __IO uint32_t ECC_A_09; /*!< [0x094c] ECC the Parameter CURVEA Word9 of Elliptic Curve */ - __IO uint32_t ECC_A_10; /*!< [0x0950] ECC the Parameter CURVEA Word10 of Elliptic Curve */ - __IO uint32_t ECC_A_11; /*!< [0x0954] ECC the Parameter CURVEA Word11 of Elliptic Curve */ - __IO uint32_t ECC_A_12; /*!< [0x0958] ECC the Parameter CURVEA Word12 of Elliptic Curve */ - __IO uint32_t ECC_A_13; /*!< [0x095c] ECC the Parameter CURVEA Word13 of Elliptic Curve */ - __IO uint32_t ECC_A_14; /*!< [0x0960] ECC the Parameter CURVEA Word14 of Elliptic Curve */ - __IO uint32_t ECC_A_15; /*!< [0x0964] ECC the Parameter CURVEA Word15 of Elliptic Curve */ - __IO uint32_t ECC_A_16; /*!< [0x0968] ECC the Parameter CURVEA Word16 of Elliptic Curve */ - __IO uint32_t ECC_A_17; /*!< [0x096c] ECC the Parameter CURVEA Word17 of Elliptic Curve */ - __IO uint32_t ECC_B_00; /*!< [0x0970] ECC the Parameter CURVEB Word0 of Elliptic Curve */ - __IO uint32_t ECC_B_01; /*!< [0x0974] ECC the Parameter CURVEB Word1 of Elliptic Curve */ - __IO uint32_t ECC_B_02; /*!< [0x0978] ECC the Parameter CURVEB Word2 of Elliptic Curve */ - __IO uint32_t ECC_B_03; /*!< [0x097c] ECC the Parameter CURVEB Word3 of Elliptic Curve */ - __IO uint32_t ECC_B_04; /*!< [0x0980] ECC the Parameter CURVEB Word4 of Elliptic Curve */ - __IO uint32_t ECC_B_05; /*!< [0x0984] ECC the Parameter CURVEB Word5 of Elliptic Curve */ - __IO uint32_t ECC_B_06; /*!< [0x0988] ECC the Parameter CURVEB Word6 of Elliptic Curve */ - __IO uint32_t ECC_B_07; /*!< [0x098c] ECC the Parameter CURVEB Word7 of Elliptic Curve */ - __IO uint32_t ECC_B_08; /*!< [0x0990] ECC the Parameter CURVEB Word8 of Elliptic Curve */ - __IO uint32_t ECC_B_09; /*!< [0x0994] ECC the Parameter CURVEB Word9 of Elliptic Curve */ - __IO uint32_t ECC_B_10; /*!< [0x0998] ECC the Parameter CURVEB Word10 of Elliptic Curve */ - __IO uint32_t ECC_B_11; /*!< [0x099c] ECC the Parameter CURVEB Word11 of Elliptic Curve */ - __IO uint32_t ECC_B_12; /*!< [0x09a0] ECC the Parameter CURVEB Word12 of Elliptic Curve */ - __IO uint32_t ECC_B_13; /*!< [0x09a4] ECC the Parameter CURVEB Word13 of Elliptic Curve */ - __IO uint32_t ECC_B_14; /*!< [0x09a8] ECC the Parameter CURVEB Word14 of Elliptic Curve */ - __IO uint32_t ECC_B_15; /*!< [0x09ac] ECC the Parameter CURVEB Word15 of Elliptic Curve */ - __IO uint32_t ECC_B_16; /*!< [0x09b0] ECC the Parameter CURVEB Word16 of Elliptic Curve */ - __IO uint32_t ECC_B_17; /*!< [0x09b4] ECC the Parameter CURVEB Word17 of Elliptic Curve */ - __IO uint32_t ECC_N_00; /*!< [0x09b8] ECC the Parameter CURVEN Word0 of Elliptic Curve */ - __IO uint32_t ECC_N_01; /*!< [0x09bc] ECC the Parameter CURVEN Word1 of Elliptic Curve */ - __IO uint32_t ECC_N_02; /*!< [0x09c0] ECC the Parameter CURVEN Word2 of Elliptic Curve */ - __IO uint32_t ECC_N_03; /*!< [0x09c4] ECC the Parameter CURVEN Word3 of Elliptic Curve */ - __IO uint32_t ECC_N_04; /*!< [0x09c8] ECC the Parameter CURVEN Word4 of Elliptic Curve */ - __IO uint32_t ECC_N_05; /*!< [0x09cc] ECC the Parameter CURVEN Word5 of Elliptic Curve */ - __IO uint32_t ECC_N_06; /*!< [0x09d0] ECC the Parameter CURVEN Word6 of Elliptic Curve */ - __IO uint32_t ECC_N_07; /*!< [0x09d4] ECC the Parameter CURVEN Word7 of Elliptic Curve */ - __IO uint32_t ECC_N_08; /*!< [0x09d8] ECC the Parameter CURVEN Word8 of Elliptic Curve */ - __IO uint32_t ECC_N_09; /*!< [0x09dc] ECC the Parameter CURVEN Word9 of Elliptic Curve */ - __IO uint32_t ECC_N_10; /*!< [0x09e0] ECC the Parameter CURVEN Word10 of Elliptic Curve */ - __IO uint32_t ECC_N_11; /*!< [0x09e4] ECC the Parameter CURVEN Word11 of Elliptic Curve */ - __IO uint32_t ECC_N_12; /*!< [0x09e8] ECC the Parameter CURVEN Word12 of Elliptic Curve */ - __IO uint32_t ECC_N_13; /*!< [0x09ec] ECC the Parameter CURVEN Word13 of Elliptic Curve */ - __IO uint32_t ECC_N_14; /*!< [0x09f0] ECC the Parameter CURVEN Word14 of Elliptic Curve */ - __IO uint32_t ECC_N_15; /*!< [0x09f4] ECC the Parameter CURVEN Word15 of Elliptic Curve */ - __IO uint32_t ECC_N_16; /*!< [0x09f8] ECC the Parameter CURVEN Word16 of Elliptic Curve */ - __IO uint32_t ECC_N_17; /*!< [0x09fc] ECC the Parameter CURVEN Word17 of Elliptic Curve */ - __O uint32_t ECC_K_00; /*!< [0x0a00] ECC the Scalar SCALARK Word0 of Point Multiplication */ - __O uint32_t ECC_K_01; /*!< [0x0a04] ECC the Scalar SCALARK Word1 of Point Multiplication */ - __O uint32_t ECC_K_02; /*!< [0x0a08] ECC the Scalar SCALARK Word2 of Point Multiplication */ - __O uint32_t ECC_K_03; /*!< [0x0a0c] ECC the Scalar SCALARK Word3 of Point Multiplication */ - __O uint32_t ECC_K_04; /*!< [0x0a10] ECC the Scalar SCALARK Word4 of Point Multiplication */ - __O uint32_t ECC_K_05; /*!< [0x0a14] ECC the Scalar SCALARK Word5 of Point Multiplication */ - __O uint32_t ECC_K_06; /*!< [0x0a18] ECC the Scalar SCALARK Word6 of Point Multiplication */ - __O uint32_t ECC_K_07; /*!< [0x0a1c] ECC the Scalar SCALARK Word7 of Point Multiplication */ - __O uint32_t ECC_K_08; /*!< [0x0a20] ECC the Scalar SCALARK Word8 of Point Multiplication */ - __O uint32_t ECC_K_09; /*!< [0x0a24] ECC the Scalar SCALARK Word9 of Point Multiplication */ - __O uint32_t ECC_K_10; /*!< [0x0a28] ECC the Scalar SCALARK Word10 of Point Multiplication */ - __O uint32_t ECC_K_11; /*!< [0x0a2c] ECC the Scalar SCALARK Word11 of Point Multiplication */ - __O uint32_t ECC_K_12; /*!< [0x0a30] ECC the Scalar SCALARK Word12 of Point Multiplication */ - __O uint32_t ECC_K_13; /*!< [0x0a34] ECC the Scalar SCALARK Word13 of Point Multiplication */ - __O uint32_t ECC_K_14; /*!< [0x0a38] ECC the Scalar SCALARK Word14 of Point Multiplication */ - __O uint32_t ECC_K_15; /*!< [0x0a3c] ECC the Scalar SCALARK Word15 of Point Multiplication */ - __O uint32_t ECC_K_16; /*!< [0x0a40] ECC the Scalar SCALARK Word16 of Point Multiplication */ - __O uint32_t ECC_K_17; /*!< [0x0a44] ECC the Scalar SCALARK Word17 of Point Multiplication */ - __IO uint32_t ECC_SADDR; /*!< [0x0a48] ECC DMA Source Address Register */ - __IO uint32_t ECC_DADDR; /*!< [0x0a4c] ECC DMA Destination Address Register */ - __IO uint32_t ECC_STARTREG; /*!< [0x0a50] ECC Starting Address of Updated Registers */ - __IO uint32_t ECC_WORDCNT; /*!< [0x0a54] ECC DMA Word Count */ - __I uint32_t RESERVE7[42]; - __IO uint32_t RSA_CTL; /*!< [0x0b00] RSA Control Register */ - __I uint32_t RSA_STS; /*!< [0x0b04] RSA Status Register */ - __IO uint32_t RSA_SADDR0; /*!< [0x0b08] RSA DMA Source Address Register0 */ - __IO uint32_t RSA_SADDR1; /*!< [0x0b0c] RSA DMA Source Address Register1 */ - __IO uint32_t RSA_SADDR2; /*!< [0x0b10] RSA DMA Source Address Register2 */ - __IO uint32_t RSA_SADDR3; /*!< [0x0b14] RSA DMA Source Address Register3 */ - __IO uint32_t RSA_SADDR4; /*!< [0x0b18] RSA DMA Source Address Register4 */ - __IO uint32_t RSA_DADDR; /*!< [0x0b1c] RSA DMA Destination Address Register */ - __IO uint32_t RSA_MADDR0; /*!< [0x0b20] RSA DMA Middle Address Register0 */ - __IO uint32_t RSA_MADDR1; /*!< [0x0b24] RSA DMA Middle Address Register1 */ - __IO uint32_t RSA_MADDR2; /*!< [0x0b28] RSA DMA Middle Address Register2 */ - __IO uint32_t RSA_MADDR3; /*!< [0x0b2c] RSA DMA Middle Address Register3 */ - __IO uint32_t RSA_MADDR4; /*!< [0x0b30] RSA DMA Middle Address Register4 */ - __IO uint32_t RSA_MADDR5; /*!< [0x0b34] RSA DMA Middle Address Register5 */ - __IO uint32_t RSA_MADDR6; /*!< [0x0b38] RSA DMA Middle Address Register6 */ - __I uint32_t RESERVE8[241]; - __O uint32_t PRNG_KSCTL; /*!< [0x0f00] PRNG Key Control Register */ - __I uint32_t PRNG_KSSTS; /*!< [0x0f04] PRNG Key Status Register */ - __I uint32_t RESERVE9[2]; - __O uint32_t AES_KSCTL; /*!< [0x0f10] AES Key Control Register */ - __I uint32_t RESERVE10[7]; - __O uint32_t HMAC_KSCTL; /*!< [0x0f30] HMAC Key Control Register */ - __I uint32_t RESERVE11[3]; - __O uint32_t ECC_KSCTL; /*!< [0x0f40] ECC Key Control Register */ - __I uint32_t ECC_KSSTS; /*!< [0x0f44] ECC Key Status Register */ - __O uint32_t ECC_KSXY; /*!< [0x0f48] ECC XY Number Register */ - __I uint32_t RESERVE12[1]; - __O uint32_t RSA_KSCTL; /*!< [0x0f50] RSA Key Control Register */ - __IO uint32_t RSA_KSSTS0; /*!< [0x0f54] RSA Key Status Register 0 */ - __IO uint32_t RSA_KSSTS1; /*!< [0x0f58] RSA Key Status Register 1 */ - -} CRYPTO_T; - -/** - @addtogroup CRYPTO_CONST CRYPTO Bit Field Definition - Constant Definitions for CRYPTO Controller -@{ */ - -#define CRYPTO_INTEN_AESIEN_Pos (0) /*!< CRYPTO_T::INTEN: AESIEN Position */ -#define CRYPTO_INTEN_AESIEN_Msk (0x1ul << CRYPTO_INTEN_AESIEN_Pos) /*!< CRYPTO_T::INTEN: AESIEN Mask */ - -#define CRYPTO_INTEN_AESEIEN_Pos (1) /*!< CRYPTO_T::INTEN: AESEIEN Position */ -#define CRYPTO_INTEN_AESEIEN_Msk (0x1ul << CRYPTO_INTEN_AESEIEN_Pos) /*!< CRYPTO_T::INTEN: AESEIEN Mask */ - -#define CRYPTO_INTEN_PRNGIEN_Pos (16) /*!< CRYPTO_T::INTEN: PRNGIEN Position */ -#define CRYPTO_INTEN_PRNGIEN_Msk (0x1ul << CRYPTO_INTEN_PRNGIEN_Pos) /*!< CRYPTO_T::INTEN: PRNGIEN Mask */ - -#define CRYPTO_INTEN_PRNGEIEN_Pos (17) /*!< CRYPTO_T::INTEN: PRNGEIEN Position */ -#define CRYPTO_INTEN_PRNGEIEN_Msk (0x1ul << CRYPTO_INTEN_PRNGEIEN_Pos) /*!< CRYPTO_T::INTEN: PRNGEIEN Mask */ - -#define CRYPTO_INTEN_ECCIEN_Pos (22) /*!< CRYPTO_T::INTEN: ECCIEN Position */ -#define CRYPTO_INTEN_ECCIEN_Msk (0x1ul << CRYPTO_INTEN_ECCIEN_Pos) /*!< CRYPTO_T::INTEN: ECCIEN Mask */ - -#define CRYPTO_INTEN_ECCEIEN_Pos (23) /*!< CRYPTO_T::INTEN: ECCEIEN Position */ -#define CRYPTO_INTEN_ECCEIEN_Msk (0x1ul << CRYPTO_INTEN_ECCEIEN_Pos) /*!< CRYPTO_T::INTEN: ECCEIEN Mask */ - -#define CRYPTO_INTEN_HMACIEN_Pos (24) /*!< CRYPTO_T::INTEN: HMACIEN Position */ -#define CRYPTO_INTEN_HMACIEN_Msk (0x1ul << CRYPTO_INTEN_HMACIEN_Pos) /*!< CRYPTO_T::INTEN: HMACIEN Mask */ - -#define CRYPTO_INTEN_HMACEIEN_Pos (25) /*!< CRYPTO_T::INTEN: HMACEIEN Position */ -#define CRYPTO_INTEN_HMACEIEN_Msk (0x1ul << CRYPTO_INTEN_HMACEIEN_Pos) /*!< CRYPTO_T::INTEN: HMACEIEN Mask */ - -#define CRYPTO_INTEN_RSAIEN_Pos (30) /*!< CRYPTO_T::INTEN: RSAIEN Position */ -#define CRYPTO_INTEN_RSAIEN_Msk (0x1ul << CRYPTO_INTEN_RSAIEN_Pos) /*!< CRYPTO_T::INTEN: RSAIEN Mask */ - -#define CRYPTO_INTEN_RSAEIEN_Pos (31) /*!< CRYPTO_T::INTEN: RSAEIEN Position */ -#define CRYPTO_INTEN_RSAEIEN_Msk (0x1ul << CRYPTO_INTEN_RSAEIEN_Pos) /*!< CRYPTO_T::INTEN: RSAEIEN Mask */ - -#define CRYPTO_INTSTS_AESIF_Pos (0) /*!< CRYPTO_T::INTSTS: AESIF Position */ -#define CRYPTO_INTSTS_AESIF_Msk (0x1ul << CRYPTO_INTSTS_AESIF_Pos) /*!< CRYPTO_T::INTSTS: AESIF Mask */ - -#define CRYPTO_INTSTS_AESEIF_Pos (1) /*!< CRYPTO_T::INTSTS: AESEIF Position */ -#define CRYPTO_INTSTS_AESEIF_Msk (0x1ul << CRYPTO_INTSTS_AESEIF_Pos) /*!< CRYPTO_T::INTSTS: AESEIF Mask */ - -#define CRYPTO_INTSTS_PRNGIF_Pos (16) /*!< CRYPTO_T::INTSTS: PRNGIF Position */ -#define CRYPTO_INTSTS_PRNGIF_Msk (0x1ul << CRYPTO_INTSTS_PRNGIF_Pos) /*!< CRYPTO_T::INTSTS: PRNGIF Mask */ - -#define CRYPTO_INTSTS_PRNGEIF_Pos (17) /*!< CRYPTO_T::INTSTS: PRNGEIF Position */ -#define CRYPTO_INTSTS_PRNGEIF_Msk (0x1ul << CRYPTO_INTSTS_PRNGEIF_Pos) /*!< CRYPTO_T::INTSTS: PRNGEIF Mask */ - -#define CRYPTO_INTSTS_ECCIF_Pos (22) /*!< CRYPTO_T::INTSTS: ECCIF Position */ -#define CRYPTO_INTSTS_ECCIF_Msk (0x1ul << CRYPTO_INTSTS_ECCIF_Pos) /*!< CRYPTO_T::INTSTS: ECCIF Mask */ - -#define CRYPTO_INTSTS_ECCEIF_Pos (23) /*!< CRYPTO_T::INTSTS: ECCEIF Position */ -#define CRYPTO_INTSTS_ECCEIF_Msk (0x1ul << CRYPTO_INTSTS_ECCEIF_Pos) /*!< CRYPTO_T::INTSTS: ECCEIF Mask */ - -#define CRYPTO_INTSTS_HMACIF_Pos (24) /*!< CRYPTO_T::INTSTS: HMACIF Position */ -#define CRYPTO_INTSTS_HMACIF_Msk (0x1ul << CRYPTO_INTSTS_HMACIF_Pos) /*!< CRYPTO_T::INTSTS: HMACIF Mask */ - -#define CRYPTO_INTSTS_HMACEIF_Pos (25) /*!< CRYPTO_T::INTSTS: HMACEIF Position */ -#define CRYPTO_INTSTS_HMACEIF_Msk (0x1ul << CRYPTO_INTSTS_HMACEIF_Pos) /*!< CRYPTO_T::INTSTS: HMACEIF Mask */ - -#define CRYPTO_INTSTS_RSAIF_Pos (30) /*!< CRYPTO_T::INTSTS: RSAIF Position */ -#define CRYPTO_INTSTS_RSAIF_Msk (0x1ul << CRYPTO_INTSTS_RSAIF_Pos) /*!< CRYPTO_T::INTSTS: RSAIF Mask */ - -#define CRYPTO_INTSTS_RSAEIF_Pos (31) /*!< CRYPTO_T::INTSTS: RSAEIF Position */ -#define CRYPTO_INTSTS_RSAEIF_Msk (0x1ul << CRYPTO_INTSTS_RSAEIF_Pos) /*!< CRYPTO_T::INTSTS: RSAEIF Mask */ - -#define CRYPTO_PRNG_CTL_START_Pos (0) /*!< CRYPTO_T::PRNG_CTL: START Position */ -#define CRYPTO_PRNG_CTL_START_Msk (0x1ul << CRYPTO_PRNG_CTL_START_Pos) /*!< CRYPTO_T::PRNG_CTL: START Mask */ - -#define CRYPTO_PRNG_CTL_SEEDRLD_Pos (1) /*!< CRYPTO_T::PRNG_CTL: SEEDRLD Position */ -#define CRYPTO_PRNG_CTL_SEEDRLD_Msk (0x1ul << CRYPTO_PRNG_CTL_SEEDRLD_Pos) /*!< CRYPTO_T::PRNG_CTL: SEEDRLD Mask */ - -#define CRYPTO_PRNG_CTL_KEYSZ_Pos (2) /*!< CRYPTO_T::PRNG_CTL: KEYSZ Position */ -#define CRYPTO_PRNG_CTL_KEYSZ_Msk (0xful << CRYPTO_PRNG_CTL_KEYSZ_Pos) /*!< CRYPTO_T::PRNG_CTL: KEYSZ Mask */ - -#define CRYPTO_PRNG_CTL_BUSY_Pos (8) /*!< CRYPTO_T::PRNG_CTL: BUSY Position */ -#define CRYPTO_PRNG_CTL_BUSY_Msk (0x1ul << CRYPTO_PRNG_CTL_BUSY_Pos) /*!< CRYPTO_T::PRNG_CTL: BUSY Mask */ - -#define CRYPTO_PRNG_CTL_SEEDSRC_Pos (16) /*!< CRYPTO_T::PRNG_CTL: SEEDSRC Position */ -#define CRYPTO_PRNG_CTL_SEEDSRC_Msk (0x1ul << CRYPTO_PRNG_CTL_SEEDSRC_Pos) /*!< CRYPTO_T::PRNG_CTL: SEEDSRC Mask */ - -#define CRYPTO_PRNG_SEED_SEED_Pos (0) /*!< CRYPTO_T::PRNG_SEED: SEED Position */ -#define CRYPTO_PRNG_SEED_SEED_Msk (0xfffffffful << CRYPTO_PRNG_SEED_SEED_Pos) /*!< CRYPTO_T::PRNG_SEED: SEED Mask */ - -#define CRYPTO_PRNG_KEY0_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY0: KEY Position */ -#define CRYPTO_PRNG_KEY0_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY0_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY0: KEY Mask */ - -#define CRYPTO_PRNG_KEY1_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY1: KEY Position */ -#define CRYPTO_PRNG_KEY1_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY1_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY1: KEY Mask */ - -#define CRYPTO_PRNG_KEY2_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY2: KEY Position */ -#define CRYPTO_PRNG_KEY2_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY2_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY2: KEY Mask */ - -#define CRYPTO_PRNG_KEY3_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY3: KEY Position */ -#define CRYPTO_PRNG_KEY3_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY3_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY3: KEY Mask */ - -#define CRYPTO_PRNG_KEY4_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY4: KEY Position */ -#define CRYPTO_PRNG_KEY4_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY4_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY4: KEY Mask */ - -#define CRYPTO_PRNG_KEY5_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY5: KEY Position */ -#define CRYPTO_PRNG_KEY5_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY5_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY5: KEY Mask */ - -#define CRYPTO_PRNG_KEY6_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY6: KEY Position */ -#define CRYPTO_PRNG_KEY6_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY6_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY6: KEY Mask */ - -#define CRYPTO_PRNG_KEY7_KEY_Pos (0) /*!< CRYPTO_T::PRNG_KEY7: KEY Position */ -#define CRYPTO_PRNG_KEY7_KEY_Msk (0xfffffffful << CRYPTO_PRNG_KEY7_KEY_Pos) /*!< CRYPTO_T::PRNG_KEY7: KEY Mask */ - -#define CRYPTO_PRNG_STS_BUSY_Pos (0) /*!< CRYPTO_T::PRNG_STS: BUSY Position */ -#define CRYPTO_PRNG_STS_BUSY_Msk (0x1ul << CRYPTO_PRNG_STS_BUSY_Pos) /*!< CRYPTO_T::PRNG_STS: BUSY Mask */ - -#define CRYPTO_PRNG_STS_KCTLERR_Pos (16) /*!< CRYPTO_T::PRNG_STS: KCTLERR Position */ -#define CRYPTO_PRNG_STS_KCTLERR_Msk (0x1ul << CRYPTO_PRNG_STS_KCTLERR_Pos) /*!< CRYPTO_T::PRNG_STS: KCTLERR Mask */ - -#define CRYPTO_PRNG_STS_KSERR_Pos (17) /*!< CRYPTO_T::PRNG_STS: KSERR Position */ -#define CRYPTO_PRNG_STS_KSERR_Msk (0x1ul << CRYPTO_PRNG_STS_KSERR_Pos) /*!< CRYPTO_T::PRNG_STS: KSERR Mask */ - -#define CRYPTO_PRNG_STS_TRNGERR_Pos (18) /*!< CRYPTO_T::PRNG_STS: TRNGERR Position */ -#define CRYPTO_PRNG_STS_TRNGERR_Msk (0x1ul << CRYPTO_PRNG_STS_TRNGERR_Pos) /*!< CRYPTO_T::PRNG_STS: TRNGERR Mask */ - -#define CRYPTO_AES_FDBCK0_FDBCK_Pos (0) /*!< CRYPTO_T::AES_FDBCK0: FDBCK Position */ -#define CRYPTO_AES_FDBCK0_FDBCK_Msk (0xfffffffful << CRYPTO_AES_FDBCK0_FDBCK_Pos) /*!< CRYPTO_T::AES_FDBCK0: FDBCK Mask */ - -#define CRYPTO_AES_FDBCK1_FDBCK_Pos (0) /*!< CRYPTO_T::AES_FDBCK1: FDBCK Position */ -#define CRYPTO_AES_FDBCK1_FDBCK_Msk (0xfffffffful << CRYPTO_AES_FDBCK1_FDBCK_Pos) /*!< CRYPTO_T::AES_FDBCK1: FDBCK Mask */ - -#define CRYPTO_AES_FDBCK2_FDBCK_Pos (0) /*!< CRYPTO_T::AES_FDBCK2: FDBCK Position */ -#define CRYPTO_AES_FDBCK2_FDBCK_Msk (0xfffffffful << CRYPTO_AES_FDBCK2_FDBCK_Pos) /*!< CRYPTO_T::AES_FDBCK2: FDBCK Mask */ - -#define CRYPTO_AES_FDBCK3_FDBCK_Pos (0) /*!< CRYPTO_T::AES_FDBCK3: FDBCK Position */ -#define CRYPTO_AES_FDBCK3_FDBCK_Msk (0xfffffffful << CRYPTO_AES_FDBCK3_FDBCK_Pos) /*!< CRYPTO_T::AES_FDBCK3: FDBCK Mask */ - -#define CRYPTO_AES_GCM_IVCNT0_CNT_Pos (0) /*!< CRYPTO_T::AES_GCM_IVCNT0: CNT Position */ -#define CRYPTO_AES_GCM_IVCNT0_CNT_Msk (0xfffffffful << CRYPTO_AES_GCM_IVCNT0_CNT_Pos) /*!< CRYPTO_T::AES_GCM_IVCNT0: CNT Mask */ - -#define CRYPTO_AES_GCM_IVCNT1_CNT_Pos (0) /*!< CRYPTO_T::AES_GCM_IVCNT1: CNT Position */ -#define CRYPTO_AES_GCM_IVCNT1_CNT_Msk (0x1ffffffful << CRYPTO_AES_GCM_IVCNT1_CNT_Pos) /*!< CRYPTO_T::AES_GCM_IVCNT1: CNT Mask */ - -#define CRYPTO_AES_GCM_ACNT0_CNT_Pos (0) /*!< CRYPTO_T::AES_GCM_ACNT0: CNT Position */ -#define CRYPTO_AES_GCM_ACNT0_CNT_Msk (0xfffffffful << CRYPTO_AES_GCM_ACNT0_CNT_Pos) /*!< CRYPTO_T::AES_GCM_ACNT0: CNT Mask */ - -#define CRYPTO_AES_GCM_ACNT1_CNT_Pos (0) /*!< CRYPTO_T::AES_GCM_ACNT1: CNT Position */ -#define CRYPTO_AES_GCM_ACNT1_CNT_Msk (0x1ffffffful << CRYPTO_AES_GCM_ACNT1_CNT_Pos) /*!< CRYPTO_T::AES_GCM_ACNT1: CNT Mask */ - -#define CRYPTO_AES_GCM_PCNT0_CNT_Pos (0) /*!< CRYPTO_T::AES_GCM_PCNT0: CNT Position */ -#define CRYPTO_AES_GCM_PCNT0_CNT_Msk (0xfffffffful << CRYPTO_AES_GCM_PCNT0_CNT_Pos) /*!< CRYPTO_T::AES_GCM_PCNT0: CNT Mask */ - -#define CRYPTO_AES_GCM_PCNT1_CNT_Pos (0) /*!< CRYPTO_T::AES_GCM_PCNT1: CNT Position */ -#define CRYPTO_AES_GCM_PCNT1_CNT_Msk (0x1ffffffful << CRYPTO_AES_GCM_PCNT1_CNT_Pos) /*!< CRYPTO_T::AES_GCM_PCNT1: CNT Mask */ - -#define CRYPTO_AES_FBADDR_FBADDR_Pos (0) /*!< CRYPTO_T::AES_FBADDR: FBADDR Position */ -#define CRYPTO_AES_FBADDR_FBADDR_Msk (0xfffffffful << CRYPTO_AES_FBADDR_FBADDR_Pos) /*!< CRYPTO_T::AES_FBADDR: FBADDR Mask */ - -#define CRYPTO_AES_CTL_START_Pos (0) /*!< CRYPTO_T::AES_CTL: START Position */ -#define CRYPTO_AES_CTL_START_Msk (0x1ul << CRYPTO_AES_CTL_START_Pos) /*!< CRYPTO_T::AES_CTL: START Mask */ - -#define CRYPTO_AES_CTL_STOP_Pos (1) /*!< CRYPTO_T::AES_CTL: STOP Position */ -#define CRYPTO_AES_CTL_STOP_Msk (0x1ul << CRYPTO_AES_CTL_STOP_Pos) /*!< CRYPTO_T::AES_CTL: STOP Mask */ - -#define CRYPTO_AES_CTL_KEYSZ_Pos (2) /*!< CRYPTO_T::AES_CTL: KEYSZ Position */ -#define CRYPTO_AES_CTL_KEYSZ_Msk (0x3ul << CRYPTO_AES_CTL_KEYSZ_Pos) /*!< CRYPTO_T::AES_CTL: KEYSZ Mask */ - -#define CRYPTO_AES_CTL_DMALAST_Pos (5) /*!< CRYPTO_T::AES_CTL: DMALAST Position */ -#define CRYPTO_AES_CTL_DMALAST_Msk (0x1ul << CRYPTO_AES_CTL_DMALAST_Pos) /*!< CRYPTO_T::AES_CTL: DMALAST Mask */ - -#define CRYPTO_AES_CTL_DMACSCAD_Pos (6) /*!< CRYPTO_T::AES_CTL: DMACSCAD Position */ -#define CRYPTO_AES_CTL_DMACSCAD_Msk (0x1ul << CRYPTO_AES_CTL_DMACSCAD_Pos) /*!< CRYPTO_T::AES_CTL: DMACSCAD Mask */ - -#define CRYPTO_AES_CTL_DMAEN_Pos (7) /*!< CRYPTO_T::AES_CTL: DMAEN Position */ -#define CRYPTO_AES_CTL_DMAEN_Msk (0x1ul << CRYPTO_AES_CTL_DMAEN_Pos) /*!< CRYPTO_T::AES_CTL: DMAEN Mask */ - -#define CRYPTO_AES_CTL_OPMODE_Pos (8) /*!< CRYPTO_T::AES_CTL: OPMODE Position */ -#define CRYPTO_AES_CTL_OPMODE_Msk (0xfful << CRYPTO_AES_CTL_OPMODE_Pos) /*!< CRYPTO_T::AES_CTL: OPMODE Mask */ - -#define CRYPTO_AES_CTL_ENCRYPTO_Pos (16) /*!< CRYPTO_T::AES_CTL: ENCRYPTO Position */ -#define CRYPTO_AES_CTL_ENCRYPTO_Msk (0x1ul << CRYPTO_AES_CTL_ENCRYPTO_Pos) /*!< CRYPTO_T::AES_CTL: ENCRYPTO Mask */ - -#define CRYPTO_AES_CTL_SM4EN_Pos (17) /*!< CRYPTO_T::AES_CTL: SM4EN Position */ -#define CRYPTO_AES_CTL_SM4EN_Msk (0x1ul << CRYPTO_AES_CTL_SM4EN_Pos) /*!< CRYPTO_T::AES_CTL: SM4EN Mask */ - -#define CRYPTO_AES_CTL_DFAPEN_Pos (19) /*!< CRYPTO_T::AES_CTL: DFAPEN Position */ -#define CRYPTO_AES_CTL_DFAPEN_Msk (0x1ul << CRYPTO_AES_CTL_DFAPEN_Pos) /*!< CRYPTO_T::AES_CTL: DFAPEN Mask */ - -#define CRYPTO_AES_CTL_FBIN_Pos (20) /*!< CRYPTO_T::AES_CTL: FBIN Position */ -#define CRYPTO_AES_CTL_FBIN_Msk (0x1ul << CRYPTO_AES_CTL_FBIN_Pos) /*!< CRYPTO_T::AES_CTL: FBIN Mask */ - -#define CRYPTO_AES_CTL_FBOUT_Pos (21) /*!< CRYPTO_T::AES_CTL: FBOUT Position */ -#define CRYPTO_AES_CTL_FBOUT_Msk (0x1ul << CRYPTO_AES_CTL_FBOUT_Pos) /*!< CRYPTO_T::AES_CTL: FBOUT Mask */ - -#define CRYPTO_AES_CTL_OUTSWAP_Pos (22) /*!< CRYPTO_T::AES_CTL: OUTSWAP Position */ -#define CRYPTO_AES_CTL_OUTSWAP_Msk (0x1ul << CRYPTO_AES_CTL_OUTSWAP_Pos) /*!< CRYPTO_T::AES_CTL: OUTSWAP Mask */ - -#define CRYPTO_AES_CTL_INSWAP_Pos (23) /*!< CRYPTO_T::AES_CTL: INSWAP Position */ -#define CRYPTO_AES_CTL_INSWAP_Msk (0x1ul << CRYPTO_AES_CTL_INSWAP_Pos) /*!< CRYPTO_T::AES_CTL: INSWAP Mask */ - -#define CRYPTO_AES_CTL_KOUTSWAP_Pos (24) /*!< CRYPTO_T::AES_CTL: KOUTSWAP Position */ -#define CRYPTO_AES_CTL_KOUTSWAP_Msk (0x1ul << CRYPTO_AES_CTL_KOUTSWAP_Pos) /*!< CRYPTO_T::AES_CTL: KOUTSWAP Mask */ - -#define CRYPTO_AES_CTL_KINSWAP_Pos (25) /*!< CRYPTO_T::AES_CTL: KINSWAP Position */ -#define CRYPTO_AES_CTL_KINSWAP_Msk (0x1ul << CRYPTO_AES_CTL_KINSWAP_Pos) /*!< CRYPTO_T::AES_CTL: KINSWAP Mask */ - -#define CRYPTO_AES_CTL_KEYUNPRT_Pos (26) /*!< CRYPTO_T::AES_CTL: KEYUNPRT Position */ -#define CRYPTO_AES_CTL_KEYUNPRT_Msk (0x1ful << CRYPTO_AES_CTL_KEYUNPRT_Pos) /*!< CRYPTO_T::AES_CTL: KEYUNPRT Mask */ - -#define CRYPTO_AES_CTL_KEYPRT_Pos (31) /*!< CRYPTO_T::AES_CTL: KEYPRT Position */ -#define CRYPTO_AES_CTL_KEYPRT_Msk (0x1ul << CRYPTO_AES_CTL_KEYPRT_Pos) /*!< CRYPTO_T::AES_CTL: KEYPRT Mask */ - -#define CRYPTO_AES_STS_BUSY_Pos (0) /*!< CRYPTO_T::AES_STS: BUSY Position */ -#define CRYPTO_AES_STS_BUSY_Msk (0x1ul << CRYPTO_AES_STS_BUSY_Pos) /*!< CRYPTO_T::AES_STS: BUSY Mask */ - -#define CRYPTO_AES_STS_INBUFEMPTY_Pos (8) /*!< CRYPTO_T::AES_STS: INBUFEMPTY Position */ -#define CRYPTO_AES_STS_INBUFEMPTY_Msk (0x1ul << CRYPTO_AES_STS_INBUFEMPTY_Pos) /*!< CRYPTO_T::AES_STS: INBUFEMPTY Mask */ - -#define CRYPTO_AES_STS_INBUFFULL_Pos (9) /*!< CRYPTO_T::AES_STS: INBUFFULL Position */ -#define CRYPTO_AES_STS_INBUFFULL_Msk (0x1ul << CRYPTO_AES_STS_INBUFFULL_Pos) /*!< CRYPTO_T::AES_STS: INBUFFULL Mask */ - -#define CRYPTO_AES_STS_INBUFERR_Pos (10) /*!< CRYPTO_T::AES_STS: INBUFERR Position */ -#define CRYPTO_AES_STS_INBUFERR_Msk (0x1ul << CRYPTO_AES_STS_INBUFERR_Pos) /*!< CRYPTO_T::AES_STS: INBUFERR Mask */ - -#define CRYPTO_AES_STS_CNTERR_Pos (12) /*!< CRYPTO_T::AES_STS: CNTERR Position */ -#define CRYPTO_AES_STS_CNTERR_Msk (0x1ul << CRYPTO_AES_STS_CNTERR_Pos) /*!< CRYPTO_T::AES_STS: CNTERR Mask */ - -#define CRYPTO_AES_STS_OUTBUFEMPTY_Pos (16) /*!< CRYPTO_T::AES_STS: OUTBUFEMPTY Position*/ -#define CRYPTO_AES_STS_OUTBUFEMPTY_Msk (0x1ul << CRYPTO_AES_STS_OUTBUFEMPTY_Pos) /*!< CRYPTO_T::AES_STS: OUTBUFEMPTY Mask */ - -#define CRYPTO_AES_STS_OUTBUFFULL_Pos (17) /*!< CRYPTO_T::AES_STS: OUTBUFFULL Position */ -#define CRYPTO_AES_STS_OUTBUFFULL_Msk (0x1ul << CRYPTO_AES_STS_OUTBUFFULL_Pos) /*!< CRYPTO_T::AES_STS: OUTBUFFULL Mask */ - -#define CRYPTO_AES_STS_OUTBUFERR_Pos (18) /*!< CRYPTO_T::AES_STS: OUTBUFERR Position */ -#define CRYPTO_AES_STS_OUTBUFERR_Msk (0x1ul << CRYPTO_AES_STS_OUTBUFERR_Pos) /*!< CRYPTO_T::AES_STS: OUTBUFERR Mask */ - -#define CRYPTO_AES_STS_BUSERR_Pos (20) /*!< CRYPTO_T::AES_STS: BUSERR Position */ -#define CRYPTO_AES_STS_BUSERR_Msk (0x1ul << CRYPTO_AES_STS_BUSERR_Pos) /*!< CRYPTO_T::AES_STS: BUSERR Mask */ - -#define CRYPTO_AES_STS_KSERR_Pos (21) /*!< CRYPTO_T::AES_STS: KSERR Position */ -#define CRYPTO_AES_STS_KSERR_Msk (0x1ul << CRYPTO_AES_STS_KSERR_Pos) /*!< CRYPTO_T::AES_STS: KSERR Mask */ - -#define CRYPTO_AES_STS_DFAERR_Pos (22) /*!< CRYPTO_T::AES_STS: DFAERR Position */ -#define CRYPTO_AES_STS_DFAERR_Msk (0x1ul << CRYPTO_AES_STS_DFAERR_Pos) /*!< CRYPTO_T::AES_STS: DFAERR Mask */ - -#define CRYPTO_AES_DATIN_DATIN_Pos (0) /*!< CRYPTO_T::AES_DATIN: DATIN Position */ -#define CRYPTO_AES_DATIN_DATIN_Msk (0xfffffffful << CRYPTO_AES_DATIN_DATIN_Pos) /*!< CRYPTO_T::AES_DATIN: DATIN Mask */ - -#define CRYPTO_AES_DATOUT_DATOUT_Pos (0) /*!< CRYPTO_T::AES_DATOUT: DATOUT Position */ -#define CRYPTO_AES_DATOUT_DATOUT_Msk (0xfffffffful << CRYPTO_AES_DATOUT_DATOUT_Pos) /*!< CRYPTO_T::AES_DATOUT: DATOUT Mask */ - -#define CRYPTO_AES_KEY0_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY0: KEY Position */ -#define CRYPTO_AES_KEY0_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY0_KEY_Pos) /*!< CRYPTO_T::AES_KEY0: KEY Mask */ - -#define CRYPTO_AES_KEY1_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY1: KEY Position */ -#define CRYPTO_AES_KEY1_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY1_KEY_Pos) /*!< CRYPTO_T::AES_KEY1: KEY Mask */ - -#define CRYPTO_AES_KEY2_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY2: KEY Position */ -#define CRYPTO_AES_KEY2_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY2_KEY_Pos) /*!< CRYPTO_T::AES_KEY2: KEY Mask */ - -#define CRYPTO_AES_KEY3_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY3: KEY Position */ -#define CRYPTO_AES_KEY3_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY3_KEY_Pos) /*!< CRYPTO_T::AES_KEY3: KEY Mask */ - -#define CRYPTO_AES_KEY4_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY4: KEY Position */ -#define CRYPTO_AES_KEY4_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY4_KEY_Pos) /*!< CRYPTO_T::AES_KEY4: KEY Mask */ - -#define CRYPTO_AES_KEY5_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY5: KEY Position */ -#define CRYPTO_AES_KEY5_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY5_KEY_Pos) /*!< CRYPTO_T::AES_KEY5: KEY Mask */ - -#define CRYPTO_AES_KEY6_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY6: KEY Position */ -#define CRYPTO_AES_KEY6_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY6_KEY_Pos) /*!< CRYPTO_T::AES_KEY6: KEY Mask */ - -#define CRYPTO_AES_KEY7_KEY_Pos (0) /*!< CRYPTO_T::AES_KEY7: KEY Position */ -#define CRYPTO_AES_KEY7_KEY_Msk (0xfffffffful << CRYPTO_AES_KEY7_KEY_Pos) /*!< CRYPTO_T::AES_KEY7: KEY Mask */ - -#define CRYPTO_AES_IV0_IV_Pos (0) /*!< CRYPTO_T::AES_IV0: IV Position */ -#define CRYPTO_AES_IV0_IV_Msk (0xfffffffful << CRYPTO_AES_IV0_IV_Pos) /*!< CRYPTO_T::AES_IV0: IV Mask */ - -#define CRYPTO_AES_IV1_IV_Pos (0) /*!< CRYPTO_T::AES_IV1: IV Position */ -#define CRYPTO_AES_IV1_IV_Msk (0xfffffffful << CRYPTO_AES_IV1_IV_Pos) /*!< CRYPTO_T::AES_IV1: IV Mask */ - -#define CRYPTO_AES_IV2_IV_Pos (0) /*!< CRYPTO_T::AES_IV2: IV Position */ -#define CRYPTO_AES_IV2_IV_Msk (0xfffffffful << CRYPTO_AES_IV2_IV_Pos) /*!< CRYPTO_T::AES_IV2: IV Mask */ - -#define CRYPTO_AES_IV3_IV_Pos (0) /*!< CRYPTO_T::AES_IV3: IV Position */ -#define CRYPTO_AES_IV3_IV_Msk (0xfffffffful << CRYPTO_AES_IV3_IV_Pos) /*!< CRYPTO_T::AES_IV3: IV Mask */ - -#define CRYPTO_AES_SADDR_SADDR_Pos (0) /*!< CRYPTO_T::AES_SADDR: SADDR Position */ -#define CRYPTO_AES_SADDR_SADDR_Msk (0xfffffffful << CRYPTO_AES_SADDR_SADDR_Pos) /*!< CRYPTO_T::AES_SADDR: SADDR Mask */ - -#define CRYPTO_AES_DADDR_DADDR_Pos (0) /*!< CRYPTO_T::AES_DADDR: DADDR Position */ -#define CRYPTO_AES_DADDR_DADDR_Msk (0xfffffffful << CRYPTO_AES_DADDR_DADDR_Pos) /*!< CRYPTO_T::AES_DADDR: DADDR Mask */ - -#define CRYPTO_AES_CNT_CNT_Pos (0) /*!< CRYPTO_T::AES_CNT: CNT Position */ -#define CRYPTO_AES_CNT_CNT_Msk (0xfffffffful << CRYPTO_AES_CNT_CNT_Pos) /*!< CRYPTO_T::AES_CNT: CNT Mask */ - -#define CRYPTO_HMAC_CTL_START_Pos (0) /*!< CRYPTO_T::HMAC_CTL: START Position */ -#define CRYPTO_HMAC_CTL_START_Msk (0x1ul << CRYPTO_HMAC_CTL_START_Pos) /*!< CRYPTO_T::HMAC_CTL: START Mask */ - -#define CRYPTO_HMAC_CTL_STOP_Pos (1) /*!< CRYPTO_T::HMAC_CTL: STOP Position */ -#define CRYPTO_HMAC_CTL_STOP_Msk (0x1ul << CRYPTO_HMAC_CTL_STOP_Pos) /*!< CRYPTO_T::HMAC_CTL: STOP Mask */ - -#define CRYPTO_HMAC_CTL_DMAFIRST_Pos (4) /*!< CRYPTO_T::HMAC_CTL: DMAFIRST Position */ -#define CRYPTO_HMAC_CTL_DMAFIRST_Msk (0x1ul << CRYPTO_HMAC_CTL_DMAFIRST_Pos) /*!< CRYPTO_T::HMAC_CTL: DMAFIRST Mask */ - -#define CRYPTO_HMAC_CTL_DMALAST_Pos (5) /*!< CRYPTO_T::HMAC_CTL: DMALAST Position */ -#define CRYPTO_HMAC_CTL_DMALAST_Msk (0x1ul << CRYPTO_HMAC_CTL_DMALAST_Pos) /*!< CRYPTO_T::HMAC_CTL: DMALAST Mask */ - -#define CRYPTO_HMAC_CTL_DMACSCAD_Pos (6) /*!< CRYPTO_T::HMAC_CTL: DMACSCAD Position */ -#define CRYPTO_HMAC_CTL_DMACSCAD_Msk (0x1ul << CRYPTO_HMAC_CTL_DMACSCAD_Pos) /*!< CRYPTO_T::HMAC_CTL: DMACSCAD Mask */ - -#define CRYPTO_HMAC_CTL_DMAEN_Pos (7) /*!< CRYPTO_T::HMAC_CTL: DMAEN Position */ -#define CRYPTO_HMAC_CTL_DMAEN_Msk (0x1ul << CRYPTO_HMAC_CTL_DMAEN_Pos) /*!< CRYPTO_T::HMAC_CTL: DMAEN Mask */ - -#define CRYPTO_HMAC_CTL_OPMODE_Pos (8) /*!< CRYPTO_T::HMAC_CTL: OPMODE Position */ -#define CRYPTO_HMAC_CTL_OPMODE_Msk (0x7ul << CRYPTO_HMAC_CTL_OPMODE_Pos) /*!< CRYPTO_T::HMAC_CTL: OPMODE Mask */ - -#define CRYPTO_HMAC_CTL_HMACEN_Pos (11) /*!< CRYPTO_T::HMAC_CTL: HMACEN Position */ -#define CRYPTO_HMAC_CTL_HMACEN_Msk (0x1ul << CRYPTO_HMAC_CTL_HMACEN_Pos) /*!< CRYPTO_T::HMAC_CTL: HMACEN Mask */ - -#define CRYPTO_HMAC_CTL_SHA3EN_Pos (12) /*!< CRYPTO_T::HMAC_CTL: SHA3EN Position */ -#define CRYPTO_HMAC_CTL_SHA3EN_Msk (0x1ul << CRYPTO_HMAC_CTL_SHA3EN_Pos) /*!< CRYPTO_T::HMAC_CTL: SHA3EN Mask */ - -#define CRYPTO_HMAC_CTL_SM3EN_Pos (13) /*!< CRYPTO_T::HMAC_CTL: SM3EN Position */ -#define CRYPTO_HMAC_CTL_SM3EN_Msk (0x1ul << CRYPTO_HMAC_CTL_SM3EN_Pos) /*!< CRYPTO_T::HMAC_CTL: SM3EN Mask */ - -#define CRYPTO_HMAC_CTL_MD5EN_Pos (14) /*!< CRYPTO_T::HMAC_CTL: MD5EN Position */ -#define CRYPTO_HMAC_CTL_MD5EN_Msk (0x1ul << CRYPTO_HMAC_CTL_MD5EN_Pos) /*!< CRYPTO_T::HMAC_CTL: MD5EN Mask */ - -#define CRYPTO_HMAC_CTL_FBIN_Pos (20) /*!< CRYPTO_T::HMAC_CTL: FBIN Position */ -#define CRYPTO_HMAC_CTL_FBIN_Msk (0x1ul << CRYPTO_HMAC_CTL_FBIN_Pos) /*!< CRYPTO_T::HMAC_CTL: FBIN Mask */ - -#define CRYPTO_HMAC_CTL_FBOUT_Pos (21) /*!< CRYPTO_T::HMAC_CTL: FBOUT Position */ -#define CRYPTO_HMAC_CTL_FBOUT_Msk (0x1ul << CRYPTO_HMAC_CTL_FBOUT_Pos) /*!< CRYPTO_T::HMAC_CTL: FBOUT Mask */ - -#define CRYPTO_HMAC_CTL_OUTSWAP_Pos (22) /*!< CRYPTO_T::HMAC_CTL: OUTSWAP Position */ -#define CRYPTO_HMAC_CTL_OUTSWAP_Msk (0x1ul << CRYPTO_HMAC_CTL_OUTSWAP_Pos) /*!< CRYPTO_T::HMAC_CTL: OUTSWAP Mask */ - -#define CRYPTO_HMAC_CTL_INSWAP_Pos (23) /*!< CRYPTO_T::HMAC_CTL: INSWAP Position */ -#define CRYPTO_HMAC_CTL_INSWAP_Msk (0x1ul << CRYPTO_HMAC_CTL_INSWAP_Pos) /*!< CRYPTO_T::HMAC_CTL: INSWAP Mask */ - -#define CRYPTO_HMAC_CTL_NEXTDGST_Pos (24) /*!< CRYPTO_T::HMAC_CTL: NEXTDGST Position */ -#define CRYPTO_HMAC_CTL_NEXTDGST_Msk (0x1ul << CRYPTO_HMAC_CTL_NEXTDGST_Pos) /*!< CRYPTO_T::HMAC_CTL: NEXTDGST Mask */ - -#define CRYPTO_HMAC_CTL_FINISHDGST_Pos (25) /*!< CRYPTO_T::HMAC_CTL: FINISHDGST Position*/ -#define CRYPTO_HMAC_CTL_FINISHDGST_Msk (0x1ul << CRYPTO_HMAC_CTL_FINISHDGST_Pos) /*!< CRYPTO_T::HMAC_CTL: FINISHDGST Mask */ - -#define CRYPTO_HMAC_STS_BUSY_Pos (0) /*!< CRYPTO_T::HMAC_STS: BUSY Position */ -#define CRYPTO_HMAC_STS_BUSY_Msk (0x1ul << CRYPTO_HMAC_STS_BUSY_Pos) /*!< CRYPTO_T::HMAC_STS: BUSY Mask */ - -#define CRYPTO_HMAC_STS_DMABUSY_Pos (1) /*!< CRYPTO_T::HMAC_STS: DMABUSY Position */ -#define CRYPTO_HMAC_STS_DMABUSY_Msk (0x1ul << CRYPTO_HMAC_STS_DMABUSY_Pos) /*!< CRYPTO_T::HMAC_STS: DMABUSY Mask */ - -#define CRYPTO_HMAC_STS_SHAKEBUSY_Pos (2) /*!< CRYPTO_T::HMAC_STS: SHAKEBUSY Position */ -#define CRYPTO_HMAC_STS_SHAKEBUSY_Msk (0x1ul << CRYPTO_HMAC_STS_SHAKEBUSY_Pos) /*!< CRYPTO_T::HMAC_STS: SHAKEBUSY Mask */ - -#define CRYPTO_HMAC_STS_DMAERR_Pos (8) /*!< CRYPTO_T::HMAC_STS: DMAERR Position */ -#define CRYPTO_HMAC_STS_DMAERR_Msk (0x1ul << CRYPTO_HMAC_STS_DMAERR_Pos) /*!< CRYPTO_T::HMAC_STS: DMAERR Mask */ - -#define CRYPTO_HMAC_STS_KSERR_Pos (9) /*!< CRYPTO_T::HMAC_STS: KSERR Position */ -#define CRYPTO_HMAC_STS_KSERR_Msk (0x1ul << CRYPTO_HMAC_STS_KSERR_Pos) /*!< CRYPTO_T::HMAC_STS: KSERR Mask */ - -#define CRYPTO_HMAC_STS_DATINREQ_Pos (16) /*!< CRYPTO_T::HMAC_STS: DATINREQ Position */ -#define CRYPTO_HMAC_STS_DATINREQ_Msk (0x1ul << CRYPTO_HMAC_STS_DATINREQ_Pos) /*!< CRYPTO_T::HMAC_STS: DATINREQ Mask */ - -#define CRYPTO_HMAC_DGST0_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST0: DGST Position */ -#define CRYPTO_HMAC_DGST0_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST0_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST0: DGST Mask */ - -#define CRYPTO_HMAC_DGST1_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST1: DGST Position */ -#define CRYPTO_HMAC_DGST1_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST1_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST1: DGST Mask */ - -#define CRYPTO_HMAC_DGST2_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST2: DGST Position */ -#define CRYPTO_HMAC_DGST2_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST2_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST2: DGST Mask */ - -#define CRYPTO_HMAC_DGST3_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST3: DGST Position */ -#define CRYPTO_HMAC_DGST3_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST3_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST3: DGST Mask */ - -#define CRYPTO_HMAC_DGST4_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST4: DGST Position */ -#define CRYPTO_HMAC_DGST4_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST4_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST4: DGST Mask */ - -#define CRYPTO_HMAC_DGST5_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST5: DGST Position */ -#define CRYPTO_HMAC_DGST5_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST5_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST5: DGST Mask */ - -#define CRYPTO_HMAC_DGST6_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST6: DGST Position */ -#define CRYPTO_HMAC_DGST6_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST6_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST6: DGST Mask */ - -#define CRYPTO_HMAC_DGST7_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST7: DGST Position */ -#define CRYPTO_HMAC_DGST7_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST7_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST7: DGST Mask */ - -#define CRYPTO_HMAC_DGST8_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST8: DGST Position */ -#define CRYPTO_HMAC_DGST8_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST8_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST8: DGST Mask */ - -#define CRYPTO_HMAC_DGST9_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST9: DGST Position */ -#define CRYPTO_HMAC_DGST9_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST9_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST9: DGST Mask */ - -#define CRYPTO_HMAC_DGST10_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST10: DGST Position */ -#define CRYPTO_HMAC_DGST10_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST10_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST10: DGST Mask */ - -#define CRYPTO_HMAC_DGST11_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST11: DGST Position */ -#define CRYPTO_HMAC_DGST11_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST11_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST11: DGST Mask */ - -#define CRYPTO_HMAC_DGST12_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST12: DGST Position */ -#define CRYPTO_HMAC_DGST12_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST12_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST12: DGST Mask */ - -#define CRYPTO_HMAC_DGST13_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST13: DGST Position */ -#define CRYPTO_HMAC_DGST13_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST13_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST13: DGST Mask */ - -#define CRYPTO_HMAC_DGST14_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST14: DGST Position */ -#define CRYPTO_HMAC_DGST14_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST14_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST14: DGST Mask */ - -#define CRYPTO_HMAC_DGST15_DGST_Pos (0) /*!< CRYPTO_T::HMAC_DGST15: DGST Position */ -#define CRYPTO_HMAC_DGST15_DGST_Msk (0xfffffffful << CRYPTO_HMAC_DGST15_DGST_Pos) /*!< CRYPTO_T::HMAC_DGST15: DGST Mask */ - -#define CRYPTO_HMAC_KEYCNT_KEYCNT_Pos (0) /*!< CRYPTO_T::HMAC_KEYCNT: KEYCNT Position */ -#define CRYPTO_HMAC_KEYCNT_KEYCNT_Msk (0xfffffffful << CRYPTO_HMAC_KEYCNT_KEYCNT_Pos) /*!< CRYPTO_T::HMAC_KEYCNT: KEYCNT Mask */ - -#define CRYPTO_HMAC_SADDR_SADDR_Pos (0) /*!< CRYPTO_T::HMAC_SADDR: SADDR Position */ -#define CRYPTO_HMAC_SADDR_SADDR_Msk (0xfffffffful << CRYPTO_HMAC_SADDR_SADDR_Pos) /*!< CRYPTO_T::HMAC_SADDR: SADDR Mask */ - -#define CRYPTO_HMAC_DMACNT_DMACNT_Pos (0) /*!< CRYPTO_T::HMAC_DMACNT: DMACNT Position */ -#define CRYPTO_HMAC_DMACNT_DMACNT_Msk (0xfffffffful << CRYPTO_HMAC_DMACNT_DMACNT_Pos) /*!< CRYPTO_T::HMAC_DMACNT: DMACNT Mask */ - -#define CRYPTO_HMAC_DATIN_DATIN_Pos (0) /*!< CRYPTO_T::HMAC_DATIN: DATIN Position */ -#define CRYPTO_HMAC_DATIN_DATIN_Msk (0xfffffffful << CRYPTO_HMAC_DATIN_DATIN_Pos) /*!< CRYPTO_T::HMAC_DATIN: DATIN Mask */ - -#define CRYPTO_HMAC_FDBCK0_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK0: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK0_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK0_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK0: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK1_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK1: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK1_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK1_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK1: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK2_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK2: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK2_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK2_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK2: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK3_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK3: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK3_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK3_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK3: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK4_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK4: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK4_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK4_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK4: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK5_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK5: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK5_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK5_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK5: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK6_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK6: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK6_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK6_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK6: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK7_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK7: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK7_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK7_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK7: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK8_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK8: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK8_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK8_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK8: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK9_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK9: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK9_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK9_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK9: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK10_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK10: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK10_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK10_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK10: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK11_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK11: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK11_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK11_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK11: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK12_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK12: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK12_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK12_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK12: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK13_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK13: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK13_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK13_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK13: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK14_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK14: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK14_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK14_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK14: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK15_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK15: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK15_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK15_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK15: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK16_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK16: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK16_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK16_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK16: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK17_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK17: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK17_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK17_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK17: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK18_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK18: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK18_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK18_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK18: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK19_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK19: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK19_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK19_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK19: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK20_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK20: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK20_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK20_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK20: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK21_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK21: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK21_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK21_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK21: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK22_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK22: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK22_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK22_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK22: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK23_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK23: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK23_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK23_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK23: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK24_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK24: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK24_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK24_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK24: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK25_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK25: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK25_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK25_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK25: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK26_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK26: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK26_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK26_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK26: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK27_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK27: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK27_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK27_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK27: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK28_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK28: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK28_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK28_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK28: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK29_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK29: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK29_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK29_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK29: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK30_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK30: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK30_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK30_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK30: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK31_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK31: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK31_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK31_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK31: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK32_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK32: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK32_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK32_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK32: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK33_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK33: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK33_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK33_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK33: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK34_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK34: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK34_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK34_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK34: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK35_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK35: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK35_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK35_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK35: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK36_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK36: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK36_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK36_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK36: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK37_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK37: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK37_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK37_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK37: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK38_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK38: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK38_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK38_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK38: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK39_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK39: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK39_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK39_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK39: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK40_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK40: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK40_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK40_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK40: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK41_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK41: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK41_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK41_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK41: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK42_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK42: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK42_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK42_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK42: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK43_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK43: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK43_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK43_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK43: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK44_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK44: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK44_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK44_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK44: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK45_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK45: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK45_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK45_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK45: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK46_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK46: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK46_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK46_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK46: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK47_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK47: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK47_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK47_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK47: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK48_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK48: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK48_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK48_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK48: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK49_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK49: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK49_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK49_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK49: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK50_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK50: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK50_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK50_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK50: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK51_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK51: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK51_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK51_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK51: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK52_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK52: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK52_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK52_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK52: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK53_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK53: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK53_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK53_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK53: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK54_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK54: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK54_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK54_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK54: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK55_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK55: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK55_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK55_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK55: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK56_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK56: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK56_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK56_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK56: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK57_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK57: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK57_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK57_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK57: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK58_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK58: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK58_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK58_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK58: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK59_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK59: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK59_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK59_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK59: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK60_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK60: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK60_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK60_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK60: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK61_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK61: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK61_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK61_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK61: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK62_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK62: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK62_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK62_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK62: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK63_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK63: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK63_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK63_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK63: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK64_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK64: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK64_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK64_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK64: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK65_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK65: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK65_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK65_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK65: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK66_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK66: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK66_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK66_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK66: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK67_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK67: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK67_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK67_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK67: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK68_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK68: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK68_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK68_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK68: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK69_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK69: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK69_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK69_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK69: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK70_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK70: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK70_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK70_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK70: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK71_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK71: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK71_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK71_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK71: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK72_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK72: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK72_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK72_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK72: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK73_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK73: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK73_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK73_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK73: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK74_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK74: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK74_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK74_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK74: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK75_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK75: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK75_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK75_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK75: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK76_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK76: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK76_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK76_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK76: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK77_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK77: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK77_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK77_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK77: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK78_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK78: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK78_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK78_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK78: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK79_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK79: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK79_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK79_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK79: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK80_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK80: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK80_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK80_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK80: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK81_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK81: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK81_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK81_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK81: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK82_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK82: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK82_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK82_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK82: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK83_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK83: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK83_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK83_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK83: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK84_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK84: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK84_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK84_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK84: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK85_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK85: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK85_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK85_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK85: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK86_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK86: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK86_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK86_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK86: FDBCK Mask */ - -#define CRYPTO_HMAC_FDBCK87_FDBCK_Pos (0) /*!< CRYPTO_T::HMAC_FDBCK87: FDBCK Position */ -#define CRYPTO_HMAC_FDBCK87_FDBCK_Msk (0xfffffffful << CRYPTO_HMAC_FDBCK87_FDBCK_Pos) /*!< CRYPTO_T::HMAC_FDBCK87: FDBCK Mask */ - -#define CRYPTO_HMAC_SHA512T_SHA512TEN_Pos (0) /*!< CRYPTO_T::HMAC_SHA512T: SHA512TEN Position*/ -#define CRYPTO_HMAC_SHA512T_SHA512TEN_Msk (0x1ul << CRYPTO_HMAC_SHA512T_SHA512TEN_Pos) /*!< CRYPTO_T::HMAC_SHA512T: SHA512TEN Mask */ - -#define CRYPTO_HMAC_SHA512T_TLEN_Pos (8) /*!< CRYPTO_T::HMAC_SHA512T: TLEN Position */ -#define CRYPTO_HMAC_SHA512T_TLEN_Msk (0x1fful << CRYPTO_HMAC_SHA512T_TLEN_Pos) /*!< CRYPTO_T::HMAC_SHA512T: TLEN Mask */ - -#define CRYPTO_HMAC_FBADDR_FBADDR_Pos (0) /*!< CRYPTO_T::HMAC_FBADDR: FBADDR Position */ -#define CRYPTO_HMAC_FBADDR_FBADDR_Msk (0xfffffffful << CRYPTO_HMAC_FBADDR_FBADDR_Pos) /*!< CRYPTO_T::HMAC_FBADDR: FBADDR Mask */ - -#define CRYPTO_HMAC_SHAKEDGST0_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST0: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST0_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST0_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST0: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST1_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST1: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST1_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST1_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST1: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST2_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST2: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST2_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST2_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST2: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST3_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST3: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST3_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST3_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST3: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST4_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST4: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST4_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST4_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST4: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST5_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST5: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST5_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST5_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST5: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST6_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST6: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST6_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST6_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST6: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST7_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST7: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST7_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST7_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST7: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST8_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST8: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST8_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST8_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST8: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST9_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST9: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST9_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST9_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST9: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST10_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST10: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST10_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST10_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST10: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST11_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST11: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST11_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST11_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST11: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST12_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST12: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST12_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST12_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST12: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST13_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST13: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST13_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST13_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST13: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST14_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST14: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST14_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST14_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST14: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST15_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST15: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST15_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST15_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST15: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST16_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST16: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST16_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST16_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST16: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST17_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST17: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST17_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST17_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST17: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST18_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST18: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST18_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST18_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST18: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST19_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST19: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST19_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST19_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST19: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST20_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST20: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST20_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST20_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST20: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST21_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST21: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST21_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST21_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST21: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST22_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST22: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST22_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST22_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST22: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST23_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST23: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST23_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST23_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST23: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST24_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST24: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST24_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST24_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST24: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST25_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST25: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST25_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST25_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST25: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST26_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST26: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST26_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST26_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST26: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST27_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST27: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST27_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST27_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST27: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST28_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST28: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST28_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST28_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST28: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST29_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST29: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST29_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST29_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST29: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST30_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST30: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST30_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST30_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST30: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST31_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST31: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST31_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST31_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST31: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST32_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST32: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST32_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST32_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST32: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST33_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST33: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST33_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST33_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST33: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST34_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST34: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST34_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST34_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST34: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST35_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST35: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST35_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST35_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST35: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST36_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST36: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST36_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST36_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST36: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST37_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST37: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST37_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST37_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST37: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST38_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST38: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST38_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST38_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST38: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST39_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST39: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST39_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST39_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST39: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST40_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST40: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST40_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST40_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST40: DGST Mask */ - -#define CRYPTO_HMAC_SHAKEDGST41_DGST_Pos (0) /*!< CRYPTO_T::HMAC_SHAKEDGST41: DGST Position*/ -#define CRYPTO_HMAC_SHAKEDGST41_DGST_Msk (0xfffffffful << CRYPTO_HMAC_SHAKEDGST41_DGST_Pos) /*!< CRYPTO_T::HMAC_SHAKEDGST41: DGST Mask */ - -#define CRYPTO_ECC_CTL_START_Pos (0) /*!< CRYPTO_T::ECC_CTL: START Position */ -#define CRYPTO_ECC_CTL_START_Msk (0x1ul << CRYPTO_ECC_CTL_START_Pos) /*!< CRYPTO_T::ECC_CTL: START Mask */ - -#define CRYPTO_ECC_CTL_STOP_Pos (1) /*!< CRYPTO_T::ECC_CTL: STOP Position */ -#define CRYPTO_ECC_CTL_STOP_Msk (0x1ul << CRYPTO_ECC_CTL_STOP_Pos) /*!< CRYPTO_T::ECC_CTL: STOP Mask */ - -#define CRYPTO_ECC_CTL_ECDSAS_Pos (4) /*!< CRYPTO_T::ECC_CTL: ECDSAS Position */ -#define CRYPTO_ECC_CTL_ECDSAS_Msk (0x1ul << CRYPTO_ECC_CTL_ECDSAS_Pos) /*!< CRYPTO_T::ECC_CTL: ECDSAS Mask */ - -#define CRYPTO_ECC_CTL_ECDSAR_Pos (5) /*!< CRYPTO_T::ECC_CTL: ECDSAR Position */ -#define CRYPTO_ECC_CTL_ECDSAR_Msk (0x1ul << CRYPTO_ECC_CTL_ECDSAR_Pos) /*!< CRYPTO_T::ECC_CTL: ECDSAR Mask */ - -#define CRYPTO_ECC_CTL_DMAEN_Pos (7) /*!< CRYPTO_T::ECC_CTL: DMAEN Position */ -#define CRYPTO_ECC_CTL_DMAEN_Msk (0x1ul << CRYPTO_ECC_CTL_DMAEN_Pos) /*!< CRYPTO_T::ECC_CTL: DMAEN Mask */ - -#define CRYPTO_ECC_CTL_FSEL_Pos (8) /*!< CRYPTO_T::ECC_CTL: FSEL Position */ -#define CRYPTO_ECC_CTL_FSEL_Msk (0x1ul << CRYPTO_ECC_CTL_FSEL_Pos) /*!< CRYPTO_T::ECC_CTL: FSEL Mask */ - -#define CRYPTO_ECC_CTL_ECCOP_Pos (9) /*!< CRYPTO_T::ECC_CTL: ECCOP Position */ -#define CRYPTO_ECC_CTL_ECCOP_Msk (0x3ul << CRYPTO_ECC_CTL_ECCOP_Pos) /*!< CRYPTO_T::ECC_CTL: ECCOP Mask */ - -#define CRYPTO_ECC_CTL_MODOP_Pos (11) /*!< CRYPTO_T::ECC_CTL: MODOP Position */ -#define CRYPTO_ECC_CTL_MODOP_Msk (0x3ul << CRYPTO_ECC_CTL_MODOP_Pos) /*!< CRYPTO_T::ECC_CTL: MODOP Mask */ - -#define CRYPTO_ECC_CTL_CSEL_Pos (13) /*!< CRYPTO_T::ECC_CTL: CSEL Position */ -#define CRYPTO_ECC_CTL_CSEL_Msk (0x1ul << CRYPTO_ECC_CTL_CSEL_Pos) /*!< CRYPTO_T::ECC_CTL: CSEL Mask */ - -#define CRYPTO_ECC_CTL_SCAP_Pos (14) /*!< CRYPTO_T::ECC_CTL: SCAP Position */ -#define CRYPTO_ECC_CTL_SCAP_Msk (0x1ul << CRYPTO_ECC_CTL_SCAP_Pos) /*!< CRYPTO_T::ECC_CTL: SCAP Mask */ - -#define CRYPTO_ECC_CTL_ASCAP_Pos (15) /*!< CRYPTO_T::ECC_CTL: ASCAP Position */ -#define CRYPTO_ECC_CTL_ASCAP_Msk (0x1ul << CRYPTO_ECC_CTL_ASCAP_Pos) /*!< CRYPTO_T::ECC_CTL: ASCAP Mask */ - -#define CRYPTO_ECC_CTL_LDP1_Pos (16) /*!< CRYPTO_T::ECC_CTL: LDP1 Position */ -#define CRYPTO_ECC_CTL_LDP1_Msk (0x1ul << CRYPTO_ECC_CTL_LDP1_Pos) /*!< CRYPTO_T::ECC_CTL: LDP1 Mask */ - -#define CRYPTO_ECC_CTL_LDP2_Pos (17) /*!< CRYPTO_T::ECC_CTL: LDP2 Position */ -#define CRYPTO_ECC_CTL_LDP2_Msk (0x1ul << CRYPTO_ECC_CTL_LDP2_Pos) /*!< CRYPTO_T::ECC_CTL: LDP2 Mask */ - -#define CRYPTO_ECC_CTL_LDA_Pos (18) /*!< CRYPTO_T::ECC_CTL: LDA Position */ -#define CRYPTO_ECC_CTL_LDA_Msk (0x1ul << CRYPTO_ECC_CTL_LDA_Pos) /*!< CRYPTO_T::ECC_CTL: LDA Mask */ - -#define CRYPTO_ECC_CTL_LDB_Pos (19) /*!< CRYPTO_T::ECC_CTL: LDB Position */ -#define CRYPTO_ECC_CTL_LDB_Msk (0x1ul << CRYPTO_ECC_CTL_LDB_Pos) /*!< CRYPTO_T::ECC_CTL: LDB Mask */ - -#define CRYPTO_ECC_CTL_LDN_Pos (20) /*!< CRYPTO_T::ECC_CTL: LDN Position */ -#define CRYPTO_ECC_CTL_LDN_Msk (0x1ul << CRYPTO_ECC_CTL_LDN_Pos) /*!< CRYPTO_T::ECC_CTL: LDN Mask */ - -#define CRYPTO_ECC_CTL_LDK_Pos (21) /*!< CRYPTO_T::ECC_CTL: LDK Position */ -#define CRYPTO_ECC_CTL_LDK_Msk (0x1ul << CRYPTO_ECC_CTL_LDK_Pos) /*!< CRYPTO_T::ECC_CTL: LDK Mask */ - -#define CRYPTO_ECC_CTL_CURVEM_Pos (22) /*!< CRYPTO_T::ECC_CTL: CURVEM Position */ -#define CRYPTO_ECC_CTL_CURVEM_Msk (0x3fful << CRYPTO_ECC_CTL_CURVEM_Pos) /*!< CRYPTO_T::ECC_CTL: CURVEM Mask */ - -#define CRYPTO_ECC_STS_BUSY_Pos (0) /*!< CRYPTO_T::ECC_STS: BUSY Position */ -#define CRYPTO_ECC_STS_BUSY_Msk (0x1ul << CRYPTO_ECC_STS_BUSY_Pos) /*!< CRYPTO_T::ECC_STS: BUSY Mask */ - -#define CRYPTO_ECC_STS_DMABUSY_Pos (1) /*!< CRYPTO_T::ECC_STS: DMABUSY Position */ -#define CRYPTO_ECC_STS_DMABUSY_Msk (0x1ul << CRYPTO_ECC_STS_DMABUSY_Pos) /*!< CRYPTO_T::ECC_STS: DMABUSY Mask */ - -#define CRYPTO_ECC_STS_BUSERR_Pos (16) /*!< CRYPTO_T::ECC_STS: BUSERR Position */ -#define CRYPTO_ECC_STS_BUSERR_Msk (0x1ul << CRYPTO_ECC_STS_BUSERR_Pos) /*!< CRYPTO_T::ECC_STS: BUSERR Mask */ - -#define CRYPTO_ECC_STS_KSERR_Pos (17) /*!< CRYPTO_T::ECC_STS: KSERR Position */ -#define CRYPTO_ECC_STS_KSERR_Msk (0x1ul << CRYPTO_ECC_STS_KSERR_Pos) /*!< CRYPTO_T::ECC_STS: KSERR Mask */ - -#define CRYPTO_ECC_STS_DFAERR_Pos (18) /*!< CRYPTO_T::ECC_STS: DFAERR Position */ -#define CRYPTO_ECC_STS_DFAERR_Msk (0x1ul << CRYPTO_ECC_STS_DFAERR_Pos) /*!< CRYPTO_T::ECC_STS: DFAERR Mask */ - -#define CRYPTO_ECC_X1_00_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_00: POINTX1 Position */ -#define CRYPTO_ECC_X1_00_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_00_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_00: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_01_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_01: POINTX1 Position */ -#define CRYPTO_ECC_X1_01_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_01_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_01: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_02_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_02: POINTX1 Position */ -#define CRYPTO_ECC_X1_02_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_02_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_02: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_03_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_03: POINTX1 Position */ -#define CRYPTO_ECC_X1_03_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_03_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_03: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_04_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_04: POINTX1 Position */ -#define CRYPTO_ECC_X1_04_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_04_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_04: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_05_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_05: POINTX1 Position */ -#define CRYPTO_ECC_X1_05_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_05_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_05: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_06_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_06: POINTX1 Position */ -#define CRYPTO_ECC_X1_06_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_06_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_06: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_07_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_07: POINTX1 Position */ -#define CRYPTO_ECC_X1_07_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_07_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_07: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_08_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_08: POINTX1 Position */ -#define CRYPTO_ECC_X1_08_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_08_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_08: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_09_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_09: POINTX1 Position */ -#define CRYPTO_ECC_X1_09_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_09_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_09: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_10_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_10: POINTX1 Position */ -#define CRYPTO_ECC_X1_10_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_10_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_10: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_11_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_11: POINTX1 Position */ -#define CRYPTO_ECC_X1_11_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_11_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_11: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_12_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_12: POINTX1 Position */ -#define CRYPTO_ECC_X1_12_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_12_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_12: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_13_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_13: POINTX1 Position */ -#define CRYPTO_ECC_X1_13_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_13_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_13: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_14_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_14: POINTX1 Position */ -#define CRYPTO_ECC_X1_14_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_14_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_14: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_15_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_15: POINTX1 Position */ -#define CRYPTO_ECC_X1_15_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_15_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_15: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_16_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_16: POINTX1 Position */ -#define CRYPTO_ECC_X1_16_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_16_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_16: POINTX1 Mask */ - -#define CRYPTO_ECC_X1_17_POINTX1_Pos (0) /*!< CRYPTO_T::ECC_X1_17: POINTX1 Position */ -#define CRYPTO_ECC_X1_17_POINTX1_Msk (0xfffffffful << CRYPTO_ECC_X1_17_POINTX1_Pos) /*!< CRYPTO_T::ECC_X1_17: POINTX1 Mask */ - -#define CRYPTO_ECC_Y1_00_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_00: POINTY1 Position */ -#define CRYPTO_ECC_Y1_00_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_00_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_00: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_01_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_01: POINTY1 Position */ -#define CRYPTO_ECC_Y1_01_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_01_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_01: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_02_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_02: POINTY1 Position */ -#define CRYPTO_ECC_Y1_02_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_02_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_02: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_03_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_03: POINTY1 Position */ -#define CRYPTO_ECC_Y1_03_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_03_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_03: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_04_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_04: POINTY1 Position */ -#define CRYPTO_ECC_Y1_04_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_04_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_04: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_05_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_05: POINTY1 Position */ -#define CRYPTO_ECC_Y1_05_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_05_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_05: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_06_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_06: POINTY1 Position */ -#define CRYPTO_ECC_Y1_06_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_06_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_06: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_07_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_07: POINTY1 Position */ -#define CRYPTO_ECC_Y1_07_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_07_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_07: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_08_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_08: POINTY1 Position */ -#define CRYPTO_ECC_Y1_08_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_08_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_08: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_09_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_09: POINTY1 Position */ -#define CRYPTO_ECC_Y1_09_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_09_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_09: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_10_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_10: POINTY1 Position */ -#define CRYPTO_ECC_Y1_10_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_10_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_10: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_11_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_11: POINTY1 Position */ -#define CRYPTO_ECC_Y1_11_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_11_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_11: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_12_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_12: POINTY1 Position */ -#define CRYPTO_ECC_Y1_12_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_12_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_12: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_13_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_13: POINTY1 Position */ -#define CRYPTO_ECC_Y1_13_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_13_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_13: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_14_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_14: POINTY1 Position */ -#define CRYPTO_ECC_Y1_14_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_14_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_14: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_15_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_15: POINTY1 Position */ -#define CRYPTO_ECC_Y1_15_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_15_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_15: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_16_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_16: POINTY1 Position */ -#define CRYPTO_ECC_Y1_16_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_16_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_16: POINTY1 Mask */ - -#define CRYPTO_ECC_Y1_17_POINTY1_Pos (0) /*!< CRYPTO_T::ECC_Y1_17: POINTY1 Position */ -#define CRYPTO_ECC_Y1_17_POINTY1_Msk (0xfffffffful << CRYPTO_ECC_Y1_17_POINTY1_Pos) /*!< CRYPTO_T::ECC_Y1_17: POINTY1 Mask */ - -#define CRYPTO_ECC_X2_00_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_00: POINTX2 Position */ -#define CRYPTO_ECC_X2_00_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_00_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_00: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_01_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_01: POINTX2 Position */ -#define CRYPTO_ECC_X2_01_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_01_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_01: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_02_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_02: POINTX2 Position */ -#define CRYPTO_ECC_X2_02_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_02_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_02: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_03_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_03: POINTX2 Position */ -#define CRYPTO_ECC_X2_03_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_03_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_03: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_04_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_04: POINTX2 Position */ -#define CRYPTO_ECC_X2_04_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_04_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_04: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_05_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_05: POINTX2 Position */ -#define CRYPTO_ECC_X2_05_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_05_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_05: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_06_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_06: POINTX2 Position */ -#define CRYPTO_ECC_X2_06_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_06_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_06: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_07_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_07: POINTX2 Position */ -#define CRYPTO_ECC_X2_07_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_07_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_07: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_08_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_08: POINTX2 Position */ -#define CRYPTO_ECC_X2_08_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_08_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_08: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_09_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_09: POINTX2 Position */ -#define CRYPTO_ECC_X2_09_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_09_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_09: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_10_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_10: POINTX2 Position */ -#define CRYPTO_ECC_X2_10_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_10_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_10: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_11_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_11: POINTX2 Position */ -#define CRYPTO_ECC_X2_11_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_11_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_11: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_12_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_12: POINTX2 Position */ -#define CRYPTO_ECC_X2_12_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_12_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_12: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_13_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_13: POINTX2 Position */ -#define CRYPTO_ECC_X2_13_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_13_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_13: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_14_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_14: POINTX2 Position */ -#define CRYPTO_ECC_X2_14_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_14_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_14: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_15_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_15: POINTX2 Position */ -#define CRYPTO_ECC_X2_15_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_15_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_15: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_16_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_16: POINTX2 Position */ -#define CRYPTO_ECC_X2_16_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_16_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_16: POINTX2 Mask */ - -#define CRYPTO_ECC_X2_17_POINTX2_Pos (0) /*!< CRYPTO_T::ECC_X2_17: POINTX2 Position */ -#define CRYPTO_ECC_X2_17_POINTX2_Msk (0xfffffffful << CRYPTO_ECC_X2_17_POINTX2_Pos) /*!< CRYPTO_T::ECC_X2_17: POINTX2 Mask */ - -#define CRYPTO_ECC_Y2_00_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_00: POINTY2 Position */ -#define CRYPTO_ECC_Y2_00_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_00_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_00: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_01_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_01: POINTY2 Position */ -#define CRYPTO_ECC_Y2_01_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_01_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_01: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_02_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_02: POINTY2 Position */ -#define CRYPTO_ECC_Y2_02_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_02_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_02: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_03_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_03: POINTY2 Position */ -#define CRYPTO_ECC_Y2_03_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_03_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_03: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_04_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_04: POINTY2 Position */ -#define CRYPTO_ECC_Y2_04_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_04_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_04: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_05_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_05: POINTY2 Position */ -#define CRYPTO_ECC_Y2_05_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_05_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_05: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_06_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_06: POINTY2 Position */ -#define CRYPTO_ECC_Y2_06_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_06_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_06: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_07_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_07: POINTY2 Position */ -#define CRYPTO_ECC_Y2_07_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_07_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_07: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_08_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_08: POINTY2 Position */ -#define CRYPTO_ECC_Y2_08_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_08_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_08: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_09_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_09: POINTY2 Position */ -#define CRYPTO_ECC_Y2_09_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_09_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_09: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_10_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_10: POINTY2 Position */ -#define CRYPTO_ECC_Y2_10_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_10_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_10: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_11_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_11: POINTY2 Position */ -#define CRYPTO_ECC_Y2_11_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_11_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_11: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_12_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_12: POINTY2 Position */ -#define CRYPTO_ECC_Y2_12_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_12_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_12: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_13_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_13: POINTY2 Position */ -#define CRYPTO_ECC_Y2_13_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_13_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_13: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_14_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_14: POINTY2 Position */ -#define CRYPTO_ECC_Y2_14_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_14_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_14: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_15_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_15: POINTY2 Position */ -#define CRYPTO_ECC_Y2_15_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_15_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_15: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_16_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_16: POINTY2 Position */ -#define CRYPTO_ECC_Y2_16_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_16_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_16: POINTY2 Mask */ - -#define CRYPTO_ECC_Y2_17_POINTY2_Pos (0) /*!< CRYPTO_T::ECC_Y2_17: POINTY2 Position */ -#define CRYPTO_ECC_Y2_17_POINTY2_Msk (0xfffffffful << CRYPTO_ECC_Y2_17_POINTY2_Pos) /*!< CRYPTO_T::ECC_Y2_17: POINTY2 Mask */ - -#define CRYPTO_ECC_A_00_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_00: CURVEA Position */ -#define CRYPTO_ECC_A_00_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_00_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_00: CURVEA Mask */ - -#define CRYPTO_ECC_A_01_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_01: CURVEA Position */ -#define CRYPTO_ECC_A_01_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_01_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_01: CURVEA Mask */ - -#define CRYPTO_ECC_A_02_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_02: CURVEA Position */ -#define CRYPTO_ECC_A_02_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_02_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_02: CURVEA Mask */ - -#define CRYPTO_ECC_A_03_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_03: CURVEA Position */ -#define CRYPTO_ECC_A_03_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_03_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_03: CURVEA Mask */ - -#define CRYPTO_ECC_A_04_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_04: CURVEA Position */ -#define CRYPTO_ECC_A_04_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_04_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_04: CURVEA Mask */ - -#define CRYPTO_ECC_A_05_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_05: CURVEA Position */ -#define CRYPTO_ECC_A_05_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_05_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_05: CURVEA Mask */ - -#define CRYPTO_ECC_A_06_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_06: CURVEA Position */ -#define CRYPTO_ECC_A_06_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_06_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_06: CURVEA Mask */ - -#define CRYPTO_ECC_A_07_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_07: CURVEA Position */ -#define CRYPTO_ECC_A_07_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_07_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_07: CURVEA Mask */ - -#define CRYPTO_ECC_A_08_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_08: CURVEA Position */ -#define CRYPTO_ECC_A_08_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_08_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_08: CURVEA Mask */ - -#define CRYPTO_ECC_A_09_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_09: CURVEA Position */ -#define CRYPTO_ECC_A_09_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_09_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_09: CURVEA Mask */ - -#define CRYPTO_ECC_A_10_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_10: CURVEA Position */ -#define CRYPTO_ECC_A_10_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_10_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_10: CURVEA Mask */ - -#define CRYPTO_ECC_A_11_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_11: CURVEA Position */ -#define CRYPTO_ECC_A_11_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_11_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_11: CURVEA Mask */ - -#define CRYPTO_ECC_A_12_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_12: CURVEA Position */ -#define CRYPTO_ECC_A_12_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_12_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_12: CURVEA Mask */ - -#define CRYPTO_ECC_A_13_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_13: CURVEA Position */ -#define CRYPTO_ECC_A_13_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_13_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_13: CURVEA Mask */ - -#define CRYPTO_ECC_A_14_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_14: CURVEA Position */ -#define CRYPTO_ECC_A_14_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_14_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_14: CURVEA Mask */ - -#define CRYPTO_ECC_A_15_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_15: CURVEA Position */ -#define CRYPTO_ECC_A_15_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_15_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_15: CURVEA Mask */ - -#define CRYPTO_ECC_A_16_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_16: CURVEA Position */ -#define CRYPTO_ECC_A_16_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_16_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_16: CURVEA Mask */ - -#define CRYPTO_ECC_A_17_CURVEA_Pos (0) /*!< CRYPTO_T::ECC_A_17: CURVEA Position */ -#define CRYPTO_ECC_A_17_CURVEA_Msk (0xfffffffful << CRYPTO_ECC_A_17_CURVEA_Pos) /*!< CRYPTO_T::ECC_A_17: CURVEA Mask */ - -#define CRYPTO_ECC_B_00_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_00: CURVEB Position */ -#define CRYPTO_ECC_B_00_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_00_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_00: CURVEB Mask */ - -#define CRYPTO_ECC_B_01_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_01: CURVEB Position */ -#define CRYPTO_ECC_B_01_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_01_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_01: CURVEB Mask */ - -#define CRYPTO_ECC_B_02_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_02: CURVEB Position */ -#define CRYPTO_ECC_B_02_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_02_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_02: CURVEB Mask */ - -#define CRYPTO_ECC_B_03_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_03: CURVEB Position */ -#define CRYPTO_ECC_B_03_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_03_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_03: CURVEB Mask */ - -#define CRYPTO_ECC_B_04_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_04: CURVEB Position */ -#define CRYPTO_ECC_B_04_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_04_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_04: CURVEB Mask */ - -#define CRYPTO_ECC_B_05_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_05: CURVEB Position */ -#define CRYPTO_ECC_B_05_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_05_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_05: CURVEB Mask */ - -#define CRYPTO_ECC_B_06_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_06: CURVEB Position */ -#define CRYPTO_ECC_B_06_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_06_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_06: CURVEB Mask */ - -#define CRYPTO_ECC_B_07_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_07: CURVEB Position */ -#define CRYPTO_ECC_B_07_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_07_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_07: CURVEB Mask */ - -#define CRYPTO_ECC_B_08_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_08: CURVEB Position */ -#define CRYPTO_ECC_B_08_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_08_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_08: CURVEB Mask */ - -#define CRYPTO_ECC_B_09_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_09: CURVEB Position */ -#define CRYPTO_ECC_B_09_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_09_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_09: CURVEB Mask */ - -#define CRYPTO_ECC_B_10_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_10: CURVEB Position */ -#define CRYPTO_ECC_B_10_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_10_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_10: CURVEB Mask */ - -#define CRYPTO_ECC_B_11_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_11: CURVEB Position */ -#define CRYPTO_ECC_B_11_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_11_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_11: CURVEB Mask */ - -#define CRYPTO_ECC_B_12_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_12: CURVEB Position */ -#define CRYPTO_ECC_B_12_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_12_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_12: CURVEB Mask */ - -#define CRYPTO_ECC_B_13_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_13: CURVEB Position */ -#define CRYPTO_ECC_B_13_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_13_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_13: CURVEB Mask */ - -#define CRYPTO_ECC_B_14_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_14: CURVEB Position */ -#define CRYPTO_ECC_B_14_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_14_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_14: CURVEB Mask */ - -#define CRYPTO_ECC_B_15_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_15: CURVEB Position */ -#define CRYPTO_ECC_B_15_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_15_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_15: CURVEB Mask */ - -#define CRYPTO_ECC_B_16_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_16: CURVEB Position */ -#define CRYPTO_ECC_B_16_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_16_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_16: CURVEB Mask */ - -#define CRYPTO_ECC_B_17_CURVEB_Pos (0) /*!< CRYPTO_T::ECC_B_17: CURVEB Position */ -#define CRYPTO_ECC_B_17_CURVEB_Msk (0xfffffffful << CRYPTO_ECC_B_17_CURVEB_Pos) /*!< CRYPTO_T::ECC_B_17: CURVEB Mask */ - -#define CRYPTO_ECC_N_00_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_00: CURVEN Position */ -#define CRYPTO_ECC_N_00_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_00_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_00: CURVEN Mask */ - -#define CRYPTO_ECC_N_01_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_01: CURVEN Position */ -#define CRYPTO_ECC_N_01_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_01_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_01: CURVEN Mask */ - -#define CRYPTO_ECC_N_02_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_02: CURVEN Position */ -#define CRYPTO_ECC_N_02_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_02_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_02: CURVEN Mask */ - -#define CRYPTO_ECC_N_03_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_03: CURVEN Position */ -#define CRYPTO_ECC_N_03_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_03_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_03: CURVEN Mask */ - -#define CRYPTO_ECC_N_04_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_04: CURVEN Position */ -#define CRYPTO_ECC_N_04_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_04_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_04: CURVEN Mask */ - -#define CRYPTO_ECC_N_05_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_05: CURVEN Position */ -#define CRYPTO_ECC_N_05_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_05_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_05: CURVEN Mask */ - -#define CRYPTO_ECC_N_06_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_06: CURVEN Position */ -#define CRYPTO_ECC_N_06_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_06_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_06: CURVEN Mask */ - -#define CRYPTO_ECC_N_07_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_07: CURVEN Position */ -#define CRYPTO_ECC_N_07_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_07_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_07: CURVEN Mask */ - -#define CRYPTO_ECC_N_08_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_08: CURVEN Position */ -#define CRYPTO_ECC_N_08_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_08_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_08: CURVEN Mask */ - -#define CRYPTO_ECC_N_09_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_09: CURVEN Position */ -#define CRYPTO_ECC_N_09_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_09_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_09: CURVEN Mask */ - -#define CRYPTO_ECC_N_10_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_10: CURVEN Position */ -#define CRYPTO_ECC_N_10_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_10_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_10: CURVEN Mask */ - -#define CRYPTO_ECC_N_11_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_11: CURVEN Position */ -#define CRYPTO_ECC_N_11_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_11_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_11: CURVEN Mask */ - -#define CRYPTO_ECC_N_12_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_12: CURVEN Position */ -#define CRYPTO_ECC_N_12_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_12_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_12: CURVEN Mask */ - -#define CRYPTO_ECC_N_13_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_13: CURVEN Position */ -#define CRYPTO_ECC_N_13_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_13_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_13: CURVEN Mask */ - -#define CRYPTO_ECC_N_14_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_14: CURVEN Position */ -#define CRYPTO_ECC_N_14_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_14_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_14: CURVEN Mask */ - -#define CRYPTO_ECC_N_15_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_15: CURVEN Position */ -#define CRYPTO_ECC_N_15_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_15_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_15: CURVEN Mask */ - -#define CRYPTO_ECC_N_16_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_16: CURVEN Position */ -#define CRYPTO_ECC_N_16_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_16_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_16: CURVEN Mask */ - -#define CRYPTO_ECC_N_17_CURVEN_Pos (0) /*!< CRYPTO_T::ECC_N_17: CURVEN Position */ -#define CRYPTO_ECC_N_17_CURVEN_Msk (0xfffffffful << CRYPTO_ECC_N_17_CURVEN_Pos) /*!< CRYPTO_T::ECC_N_17: CURVEN Mask */ - -#define CRYPTO_ECC_K_00_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_00: SCALARK Position */ -#define CRYPTO_ECC_K_00_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_00_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_00: SCALARK Mask */ - -#define CRYPTO_ECC_K_01_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_01: SCALARK Position */ -#define CRYPTO_ECC_K_01_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_01_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_01: SCALARK Mask */ - -#define CRYPTO_ECC_K_02_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_02: SCALARK Position */ -#define CRYPTO_ECC_K_02_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_02_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_02: SCALARK Mask */ - -#define CRYPTO_ECC_K_03_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_03: SCALARK Position */ -#define CRYPTO_ECC_K_03_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_03_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_03: SCALARK Mask */ - -#define CRYPTO_ECC_K_04_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_04: SCALARK Position */ -#define CRYPTO_ECC_K_04_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_04_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_04: SCALARK Mask */ - -#define CRYPTO_ECC_K_05_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_05: SCALARK Position */ -#define CRYPTO_ECC_K_05_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_05_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_05: SCALARK Mask */ - -#define CRYPTO_ECC_K_06_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_06: SCALARK Position */ -#define CRYPTO_ECC_K_06_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_06_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_06: SCALARK Mask */ - -#define CRYPTO_ECC_K_07_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_07: SCALARK Position */ -#define CRYPTO_ECC_K_07_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_07_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_07: SCALARK Mask */ - -#define CRYPTO_ECC_K_08_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_08: SCALARK Position */ -#define CRYPTO_ECC_K_08_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_08_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_08: SCALARK Mask */ - -#define CRYPTO_ECC_K_09_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_09: SCALARK Position */ -#define CRYPTO_ECC_K_09_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_09_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_09: SCALARK Mask */ - -#define CRYPTO_ECC_K_10_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_10: SCALARK Position */ -#define CRYPTO_ECC_K_10_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_10_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_10: SCALARK Mask */ - -#define CRYPTO_ECC_K_11_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_11: SCALARK Position */ -#define CRYPTO_ECC_K_11_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_11_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_11: SCALARK Mask */ - -#define CRYPTO_ECC_K_12_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_12: SCALARK Position */ -#define CRYPTO_ECC_K_12_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_12_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_12: SCALARK Mask */ - -#define CRYPTO_ECC_K_13_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_13: SCALARK Position */ -#define CRYPTO_ECC_K_13_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_13_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_13: SCALARK Mask */ - -#define CRYPTO_ECC_K_14_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_14: SCALARK Position */ -#define CRYPTO_ECC_K_14_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_14_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_14: SCALARK Mask */ - -#define CRYPTO_ECC_K_15_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_15: SCALARK Position */ -#define CRYPTO_ECC_K_15_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_15_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_15: SCALARK Mask */ - -#define CRYPTO_ECC_K_16_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_16: SCALARK Position */ -#define CRYPTO_ECC_K_16_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_16_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_16: SCALARK Mask */ - -#define CRYPTO_ECC_K_17_SCALARK_Pos (0) /*!< CRYPTO_T::ECC_K_17: SCALARK Position */ -#define CRYPTO_ECC_K_17_SCALARK_Msk (0xfffffffful << CRYPTO_ECC_K_17_SCALARK_Pos) /*!< CRYPTO_T::ECC_K_17: SCALARK Mask */ - -#define CRYPTO_ECC_DADDR_DADDR_Pos (0) /*!< CRYPTO_T::ECC_DADDR: DADDR Position */ -#define CRYPTO_ECC_DADDR_DADDR_Msk (0xfffffffful << CRYPTO_ECC_DADDR_DADDR_Pos) /*!< CRYPTO_T::ECC_DADDR: DADDR Mask */ - -#define CRYPTO_ECC_STARTREG_STARTREG_Pos (0) /*!< CRYPTO_T::ECC_STARTREG: STARTREG Position*/ -#define CRYPTO_ECC_STARTREG_STARTREG_Msk (0xfffffffful << CRYPTO_ECC_STARTREG_STARTREG_Pos) /*!< CRYPTO_T::ECC_STARTREG: STARTREG Mask */ - -#define CRYPTO_ECC_WORDCNT_WORDCNT_Pos (0) /*!< CRYPTO_T::ECC_WORDCNT: WORDCNT Position*/ -#define CRYPTO_ECC_WORDCNT_WORDCNT_Msk (0xfffffffful << CRYPTO_ECC_WORDCNT_WORDCNT_Pos) /*!< CRYPTO_T::ECC_WORDCNT: WORDCNT Mask */ - -#define CRYPTO_RSA_CTL_START_Pos (0) /*!< CRYPTO_T::RSA_CTL: START Position */ -#define CRYPTO_RSA_CTL_START_Msk (0x1ul << CRYPTO_RSA_CTL_START_Pos) /*!< CRYPTO_T::RSA_CTL: START Mask */ - -#define CRYPTO_RSA_CTL_STOP_Pos (1) /*!< CRYPTO_T::RSA_CTL: STOP Position */ -#define CRYPTO_RSA_CTL_STOP_Msk (0x1ul << CRYPTO_RSA_CTL_STOP_Pos) /*!< CRYPTO_T::RSA_CTL: STOP Mask */ - -#define CRYPTO_RSA_CTL_CRT_Pos (2) /*!< CRYPTO_T::RSA_CTL: CRT Position */ -#define CRYPTO_RSA_CTL_CRT_Msk (0x1ul << CRYPTO_RSA_CTL_CRT_Pos) /*!< CRYPTO_T::RSA_CTL: CRT Mask */ - -#define CRYPTO_RSA_CTL_CRTBYP_Pos (3) /*!< CRYPTO_T::RSA_CTL: CRTBYP Position */ -#define CRYPTO_RSA_CTL_CRTBYP_Msk (0x1ul << CRYPTO_RSA_CTL_CRTBYP_Pos) /*!< CRYPTO_T::RSA_CTL: CRTBYP Mask */ - -#define CRYPTO_RSA_CTL_KEYLENG_Pos (4) /*!< CRYPTO_T::RSA_CTL: KEYLENG Position */ -#define CRYPTO_RSA_CTL_KEYLENG_Msk (0x3ul << CRYPTO_RSA_CTL_KEYLENG_Pos) /*!< CRYPTO_T::RSA_CTL: KEYLENG Mask */ - -#define CRYPTO_RSA_CTL_SCAP_Pos (8) /*!< CRYPTO_T::RSA_CTL: SCAP Position */ -#define CRYPTO_RSA_CTL_SCAP_Msk (0x1ul << CRYPTO_RSA_CTL_SCAP_Pos) /*!< CRYPTO_T::RSA_CTL: SCAP Mask */ - -#define CRYPTO_RSA_STS_BUSY_Pos (0) /*!< CRYPTO_T::RSA_STS: BUSY Position */ -#define CRYPTO_RSA_STS_BUSY_Msk (0x1ul << CRYPTO_RSA_STS_BUSY_Pos) /*!< CRYPTO_T::RSA_STS: BUSY Mask */ - -#define CRYPTO_RSA_STS_DMABUSY_Pos (1) /*!< CRYPTO_T::RSA_STS: DMABUSY Position */ -#define CRYPTO_RSA_STS_DMABUSY_Msk (0x1ul << CRYPTO_RSA_STS_DMABUSY_Pos) /*!< CRYPTO_T::RSA_STS: DMABUSY Mask */ - -#define CRYPTO_RSA_STS_BUSERR_Pos (16) /*!< CRYPTO_T::RSA_STS: BUSERR Position */ -#define CRYPTO_RSA_STS_BUSERR_Msk (0x1ul << CRYPTO_RSA_STS_BUSERR_Pos) /*!< CRYPTO_T::RSA_STS: BUSERR Mask */ - -#define CRYPTO_RSA_STS_CTLERR_Pos (17) /*!< CRYPTO_T::RSA_STS: CTLERR Position */ -#define CRYPTO_RSA_STS_CTLERR_Msk (0x1ul << CRYPTO_RSA_STS_CTLERR_Pos) /*!< CRYPTO_T::RSA_STS: CTLERR Mask */ - -#define CRYPTO_RSA_STS_KSERR_Pos (18) /*!< CRYPTO_T::RSA_STS: KSERR Position */ -#define CRYPTO_RSA_STS_KSERR_Msk (0x1ul << CRYPTO_RSA_STS_KSERR_Pos) /*!< CRYPTO_T::RSA_STS: KSERR Mask */ - -#define CRYPTO_RSA_SADDR0_SADDR0_Pos (0) /*!< CRYPTO_T::RSA_SADDR0: SADDR0 Position */ -#define CRYPTO_RSA_SADDR0_SADDR0_Msk (0xfffffffful << CRYPTO_RSA_SADDR0_SADDR0_Pos) /*!< CRYPTO_T::RSA_SADDR0: SADDR0 Mask */ - -#define CRYPTO_RSA_SADDR1_SADDR1_Pos (0) /*!< CRYPTO_T::RSA_SADDR1: SADDR1 Position */ -#define CRYPTO_RSA_SADDR1_SADDR1_Msk (0xfffffffful << CRYPTO_RSA_SADDR1_SADDR1_Pos) /*!< CRYPTO_T::RSA_SADDR1: SADDR1 Mask */ - -#define CRYPTO_RSA_SADDR2_SADDR2_Pos (0) /*!< CRYPTO_T::RSA_SADDR2: SADDR2 Position */ -#define CRYPTO_RSA_SADDR2_SADDR2_Msk (0xfffffffful << CRYPTO_RSA_SADDR2_SADDR2_Pos) /*!< CRYPTO_T::RSA_SADDR2: SADDR2 Mask */ - -#define CRYPTO_RSA_SADDR3_SADDR3_Pos (0) /*!< CRYPTO_T::RSA_SADDR3: SADDR3 Position */ -#define CRYPTO_RSA_SADDR3_SADDR3_Msk (0xfffffffful << CRYPTO_RSA_SADDR3_SADDR3_Pos) /*!< CRYPTO_T::RSA_SADDR3: SADDR3 Mask */ - -#define CRYPTO_RSA_SADDR4_SADDR4_Pos (0) /*!< CRYPTO_T::RSA_SADDR4: SADDR4 Position */ -#define CRYPTO_RSA_SADDR4_SADDR4_Msk (0xfffffffful << CRYPTO_RSA_SADDR4_SADDR4_Pos) /*!< CRYPTO_T::RSA_SADDR4: SADDR4 Mask */ - -#define CRYPTO_RSA_DADDR_DADDR_Pos (0) /*!< CRYPTO_T::RSA_DADDR: DADDR Position */ -#define CRYPTO_RSA_DADDR_DADDR_Msk (0xfffffffful << CRYPTO_RSA_DADDR_DADDR_Pos) /*!< CRYPTO_T::RSA_DADDR: DADDR Mask */ - -#define CRYPTO_RSA_MADDR0_MADDR0_Pos (0) /*!< CRYPTO_T::RSA_MADDR0: MADDR0 Position */ -#define CRYPTO_RSA_MADDR0_MADDR0_Msk (0xfffffffful << CRYPTO_RSA_MADDR0_MADDR0_Pos) /*!< CRYPTO_T::RSA_MADDR0: MADDR0 Mask */ - -#define CRYPTO_RSA_MADDR1_MADDR1_Pos (0) /*!< CRYPTO_T::RSA_MADDR1: MADDR1 Position */ -#define CRYPTO_RSA_MADDR1_MADDR1_Msk (0xfffffffful << CRYPTO_RSA_MADDR1_MADDR1_Pos) /*!< CRYPTO_T::RSA_MADDR1: MADDR1 Mask */ - -#define CRYPTO_RSA_MADDR2_MADDR2_Pos (0) /*!< CRYPTO_T::RSA_MADDR2: MADDR2 Position */ -#define CRYPTO_RSA_MADDR2_MADDR2_Msk (0xfffffffful << CRYPTO_RSA_MADDR2_MADDR2_Pos) /*!< CRYPTO_T::RSA_MADDR2: MADDR2 Mask */ - -#define CRYPTO_RSA_MADDR3_MADDR3_Pos (0) /*!< CRYPTO_T::RSA_MADDR3: MADDR3 Position */ -#define CRYPTO_RSA_MADDR3_MADDR3_Msk (0xfffffffful << CRYPTO_RSA_MADDR3_MADDR3_Pos) /*!< CRYPTO_T::RSA_MADDR3: MADDR3 Mask */ - -#define CRYPTO_RSA_MADDR4_MADDR4_Pos (0) /*!< CRYPTO_T::RSA_MADDR4: MADDR4 Position */ -#define CRYPTO_RSA_MADDR4_MADDR4_Msk (0xfffffffful << CRYPTO_RSA_MADDR4_MADDR4_Pos) /*!< CRYPTO_T::RSA_MADDR4: MADDR4 Mask */ - -#define CRYPTO_RSA_MADDR5_MADDR5_Pos (0) /*!< CRYPTO_T::RSA_MADDR5: MADDR5 Position */ -#define CRYPTO_RSA_MADDR5_MADDR5_Msk (0xfffffffful << CRYPTO_RSA_MADDR5_MADDR5_Pos) /*!< CRYPTO_T::RSA_MADDR5: MADDR5 Mask */ - -#define CRYPTO_RSA_MADDR6_MADDR6_Pos (0) /*!< CRYPTO_T::RSA_MADDR6: MADDR6 Position */ -#define CRYPTO_RSA_MADDR6_MADDR6_Msk (0xfffffffful << CRYPTO_RSA_MADDR6_MADDR6_Pos) /*!< CRYPTO_T::RSA_MADDR6: MADDR6 Mask */ - -#define CRYPTO_PRNG_KSCTL_NUM_Pos (0) /*!< CRYPTO_T::PRNG_KSCTL: NUM Position */ -#define CRYPTO_PRNG_KSCTL_NUM_Msk (0x1ful << CRYPTO_PRNG_KSCTL_NUM_Pos) /*!< CRYPTO_T::PRNG_KSCTL: NUM Mask */ - -#define CRYPTO_PRNG_KSCTL_KEYSRC_Pos (8) /*!< CRYPTO_T::PRNG_KSCTL: KEYSRC Position */ -#define CRYPTO_PRNG_KSCTL_KEYSRC_Msk (0x1ul << CRYPTO_PRNG_KSCTL_KEYSRC_Pos) /*!< CRYPTO_T::PRNG_KSCTL: KEYSRC Mask */ - -#define CRYPTO_PRNG_KSCTL_TRUST_Pos (16) /*!< CRYPTO_T::PRNG_KSCTL: TRUST Position */ -#define CRYPTO_PRNG_KSCTL_TRUST_Msk (0x1ul << CRYPTO_PRNG_KSCTL_TRUST_Pos) /*!< CRYPTO_T::PRNG_KSCTL: TRUST Mask */ - -#define CRYPTO_PRNG_KSCTL_ECDH_Pos (19) /*!< CRYPTO_T::PRNG_KSCTL: ECDH Position */ -#define CRYPTO_PRNG_KSCTL_ECDH_Msk (0x1ul << CRYPTO_PRNG_KSCTL_ECDH_Pos) /*!< CRYPTO_T::PRNG_KSCTL: ECDH Mask */ - -#define CRYPTO_PRNG_KSCTL_ECDSA_Pos (20) /*!< CRYPTO_T::PRNG_KSCTL: ECDSA Position */ -#define CRYPTO_PRNG_KSCTL_ECDSA_Msk (0x1ul << CRYPTO_PRNG_KSCTL_ECDSA_Pos) /*!< CRYPTO_T::PRNG_KSCTL: ECDSA Mask */ - -#define CRYPTO_PRNG_KSCTL_WDST_Pos (21) /*!< CRYPTO_T::PRNG_KSCTL: WDST Position */ -#define CRYPTO_PRNG_KSCTL_WDST_Msk (0x1ul << CRYPTO_PRNG_KSCTL_WDST_Pos) /*!< CRYPTO_T::PRNG_KSCTL: WDST Mask */ - -#define CRYPTO_PRNG_KSCTL_WSDST_Pos (22) /*!< CRYPTO_T::PRNG_KSCTL: WSDST Position */ -#define CRYPTO_PRNG_KSCTL_WSDST_Msk (0x3ul << CRYPTO_PRNG_KSCTL_WSDST_Pos) /*!< CRYPTO_T::PRNG_KSCTL: WSDST Mask */ - -#define CRYPTO_PRNG_KSCTL_OWNER_Pos (24) /*!< CRYPTO_T::PRNG_KSCTL: OWNER Position */ -#define CRYPTO_PRNG_KSCTL_OWNER_Msk (0x7ul << CRYPTO_PRNG_KSCTL_OWNER_Pos) /*!< CRYPTO_T::PRNG_KSCTL: OWNER Mask */ - -#define CRYPTO_PRNG_KSSTS_NUM_Pos (0) /*!< CRYPTO_T::PRNG_KSSTS: NUM Position */ -#define CRYPTO_PRNG_KSSTS_NUM_Msk (0x1ful << CRYPTO_PRNG_KSSTS_NUM_Pos) /*!< CRYPTO_T::PRNG_KSSTS: NUM Mask */ - -#define CRYPTO_AES_KSCTL_NUM_Pos (0) /*!< CRYPTO_T::AES_KSCTL: NUM Position */ -#define CRYPTO_AES_KSCTL_NUM_Msk (0x1ful << CRYPTO_AES_KSCTL_NUM_Pos) /*!< CRYPTO_T::AES_KSCTL: NUM Mask */ - -#define CRYPTO_AES_KSCTL_RSRC_Pos (5) /*!< CRYPTO_T::AES_KSCTL: RSRC Position */ -#define CRYPTO_AES_KSCTL_RSRC_Msk (0x1ul << CRYPTO_AES_KSCTL_RSRC_Pos) /*!< CRYPTO_T::AES_KSCTL: RSRC Mask */ - -#define CRYPTO_AES_KSCTL_RSSRC_Pos (6) /*!< CRYPTO_T::AES_KSCTL: RSSRC Position */ -#define CRYPTO_AES_KSCTL_RSSRC_Msk (0x3ul << CRYPTO_AES_KSCTL_RSSRC_Pos) /*!< CRYPTO_T::AES_KSCTL: RSSRC Mask */ - -#define CRYPTO_HMAC_KSCTL_NUM_Pos (0) /*!< CRYPTO_T::HMAC_KSCTL: NUM Position */ -#define CRYPTO_HMAC_KSCTL_NUM_Msk (0x1ful << CRYPTO_HMAC_KSCTL_NUM_Pos) /*!< CRYPTO_T::HMAC_KSCTL: NUM Mask */ - -#define CRYPTO_HMAC_KSCTL_RSRC_Pos (5) /*!< CRYPTO_T::HMAC_KSCTL: RSRC Position */ -#define CRYPTO_HMAC_KSCTL_RSRC_Msk (0x1ul << CRYPTO_HMAC_KSCTL_RSRC_Pos) /*!< CRYPTO_T::HMAC_KSCTL: RSRC Mask */ - -#define CRYPTO_HMAC_KSCTL_RSSRC_Pos (6) /*!< CRYPTO_T::HMAC_KSCTL: RSSRC Position */ -#define CRYPTO_HMAC_KSCTL_RSSRC_Msk (0x3ul << CRYPTO_HMAC_KSCTL_RSSRC_Pos) /*!< CRYPTO_T::HMAC_KSCTL: RSSRC Mask */ - -#define CRYPTO_ECC_KSCTL_NUMK_Pos (0) /*!< CRYPTO_T::ECC_KSCTL: NUMK Position */ -#define CRYPTO_ECC_KSCTL_NUMK_Msk (0x1ful << CRYPTO_ECC_KSCTL_NUMK_Pos) /*!< CRYPTO_T::ECC_KSCTL: NUMK Mask */ - -#define CRYPTO_ECC_KSCTL_RSRCK_Pos (5) /*!< CRYPTO_T::ECC_KSCTL: RSRCK Position */ -#define CRYPTO_ECC_KSCTL_RSRCK_Msk (0x1ul << CRYPTO_ECC_KSCTL_RSRCK_Pos) /*!< CRYPTO_T::ECC_KSCTL: RSRCK Mask */ - -#define CRYPTO_ECC_KSCTL_RSSRCK_Pos (6) /*!< CRYPTO_T::ECC_KSCTL: RSSRCK Position */ -#define CRYPTO_ECC_KSCTL_RSSRCK_Msk (0x3ul << CRYPTO_ECC_KSCTL_RSSRCK_Pos) /*!< CRYPTO_T::ECC_KSCTL: RSSRCK Mask */ - -#define CRYPTO_ECC_KSCTL_ECDH_Pos (14) /*!< CRYPTO_T::ECC_KSCTL: ECDH Position */ -#define CRYPTO_ECC_KSCTL_ECDH_Msk (0x1ul << CRYPTO_ECC_KSCTL_ECDH_Pos) /*!< CRYPTO_T::ECC_KSCTL: ECDH Mask */ - -#define CRYPTO_ECC_KSCTL_TRUST_Pos (16) /*!< CRYPTO_T::ECC_KSCTL: TRUST Position */ -#define CRYPTO_ECC_KSCTL_TRUST_Msk (0x1ul << CRYPTO_ECC_KSCTL_TRUST_Pos) /*!< CRYPTO_T::ECC_KSCTL: TRUST Mask */ - -#define CRYPTO_ECC_KSCTL_XY_Pos (20) /*!< CRYPTO_T::ECC_KSCTL: XY Position */ -#define CRYPTO_ECC_KSCTL_XY_Msk (0x1ul << CRYPTO_ECC_KSCTL_XY_Pos) /*!< CRYPTO_T::ECC_KSCTL: XY Mask */ - -#define CRYPTO_ECC_KSCTL_WDST_Pos (21) /*!< CRYPTO_T::ECC_KSCTL: WDST Position */ -#define CRYPTO_ECC_KSCTL_WDST_Msk (0x1ul << CRYPTO_ECC_KSCTL_WDST_Pos) /*!< CRYPTO_T::ECC_KSCTL: WDST Mask */ - -#define CRYPTO_ECC_KSCTL_WSDST_Pos (22) /*!< CRYPTO_T::ECC_KSCTL: WSDST Position */ -#define CRYPTO_ECC_KSCTL_WSDST_Msk (0x3ul << CRYPTO_ECC_KSCTL_WSDST_Pos) /*!< CRYPTO_T::ECC_KSCTL: WSDST Mask */ - -#define CRYPTO_ECC_KSCTL_OWNER_Pos (24) /*!< CRYPTO_T::ECC_KSCTL: OWNER Position */ -#define CRYPTO_ECC_KSCTL_OWNER_Msk (0x7ul << CRYPTO_ECC_KSCTL_OWNER_Pos) /*!< CRYPTO_T::ECC_KSCTL: OWNER Mask */ - -#define CRYPTO_ECC_KSSTS_NUM_Pos (0) /*!< CRYPTO_T::ECC_KSSTS: NUM Position */ -#define CRYPTO_ECC_KSSTS_NUM_Msk (0x1ful << CRYPTO_ECC_KSSTS_NUM_Pos) /*!< CRYPTO_T::ECC_KSSTS: NUM Mask */ - -#define CRYPTO_ECC_KSXY_NUMX_Pos (0) /*!< CRYPTO_T::ECC_KSXY: NUMX Position */ -#define CRYPTO_ECC_KSXY_NUMX_Msk (0x1ful << CRYPTO_ECC_KSXY_NUMX_Pos) /*!< CRYPTO_T::ECC_KSXY: NUMX Mask */ - -#define CRYPTO_ECC_KSXY_RSRCXY_Pos (5) /*!< CRYPTO_T::ECC_KSXY: RSRCXY Position */ -#define CRYPTO_ECC_KSXY_RSRCXY_Msk (0x1ul << CRYPTO_ECC_KSXY_RSRCXY_Pos) /*!< CRYPTO_T::ECC_KSXY: RSRCXY Mask */ - -#define CRYPTO_ECC_KSXY_RSSRCX_Pos (6) /*!< CRYPTO_T::ECC_KSXY: RSSRCX Position */ -#define CRYPTO_ECC_KSXY_RSSRCX_Msk (0x3ul << CRYPTO_ECC_KSXY_RSSRCX_Pos) /*!< CRYPTO_T::ECC_KSXY: RSSRCX Mask */ - -#define CRYPTO_ECC_KSXY_NUMY_Pos (8) /*!< CRYPTO_T::ECC_KSXY: NUMY Position */ -#define CRYPTO_ECC_KSXY_NUMY_Msk (0x1ful << CRYPTO_ECC_KSXY_NUMY_Pos) /*!< CRYPTO_T::ECC_KSXY: NUMY Mask */ - -#define CRYPTO_ECC_KSXY_RSSRCY_Pos (14) /*!< CRYPTO_T::ECC_KSXY: RSSRCY Position */ -#define CRYPTO_ECC_KSXY_RSSRCY_Msk (0x3ul << CRYPTO_ECC_KSXY_RSSRCY_Pos) /*!< CRYPTO_T::ECC_KSXY: RSSRCY Mask */ - -#define CRYPTO_RSA_KSCTL_NUM_Pos (0) /*!< CRYPTO_T::RSA_KSCTL: NUM Position */ -#define CRYPTO_RSA_KSCTL_NUM_Msk (0x1ful << CRYPTO_RSA_KSCTL_NUM_Pos) /*!< CRYPTO_T::RSA_KSCTL: NUM Mask */ - -#define CRYPTO_RSA_KSCTL_RSRC_Pos (5) /*!< CRYPTO_T::RSA_KSCTL: RSRC Position */ -#define CRYPTO_RSA_KSCTL_RSRC_Msk (0x1ul << CRYPTO_RSA_KSCTL_RSRC_Pos) /*!< CRYPTO_T::RSA_KSCTL: RSRC Mask */ - -#define CRYPTO_RSA_KSCTL_RSSRC_Pos (6) /*!< CRYPTO_T::RSA_KSCTL: RSSRC Position */ -#define CRYPTO_RSA_KSCTL_RSSRC_Msk (0x3ul << CRYPTO_RSA_KSCTL_RSSRC_Pos) /*!< CRYPTO_T::RSA_KSCTL: RSSRC Mask */ - -#define CRYPTO_RSA_KSCTL_BKNUM_Pos (8) /*!< CRYPTO_T::RSA_KSCTL: BKNUM Position */ -#define CRYPTO_RSA_KSCTL_BKNUM_Msk (0x1ful << CRYPTO_RSA_KSCTL_BKNUM_Pos) /*!< CRYPTO_T::RSA_KSCTL: BKNUM Mask */ - -#define CRYPTO_RSA_KSSTS0_NUM0_Pos (0) /*!< CRYPTO_T::RSA_KSSTS0: NUM0 Position */ -#define CRYPTO_RSA_KSSTS0_NUM0_Msk (0x1ful << CRYPTO_RSA_KSSTS0_NUM0_Pos) /*!< CRYPTO_T::RSA_KSSTS0: NUM0 Mask */ - -#define CRYPTO_RSA_KSSTS0_NUM1_Pos (8) /*!< CRYPTO_T::RSA_KSSTS0: NUM1 Position */ -#define CRYPTO_RSA_KSSTS0_NUM1_Msk (0x1ful << CRYPTO_RSA_KSSTS0_NUM1_Pos) /*!< CRYPTO_T::RSA_KSSTS0: NUM1 Mask */ - -#define CRYPTO_RSA_KSSTS0_NUM2_Pos (16) /*!< CRYPTO_T::RSA_KSSTS0: NUM2 Position */ -#define CRYPTO_RSA_KSSTS0_NUM2_Msk (0x1ful << CRYPTO_RSA_KSSTS0_NUM2_Pos) /*!< CRYPTO_T::RSA_KSSTS0: NUM2 Mask */ - -#define CRYPTO_RSA_KSSTS0_NUM3_Pos (24) /*!< CRYPTO_T::RSA_KSSTS0: NUM3 Position */ -#define CRYPTO_RSA_KSSTS0_NUM3_Msk (0x1ful << CRYPTO_RSA_KSSTS0_NUM3_Pos) /*!< CRYPTO_T::RSA_KSSTS0: NUM3 Mask */ - -#define CRYPTO_RSA_KSSTS1_NUM4_Pos (0) /*!< CRYPTO_T::RSA_KSSTS1: NUM4 Position */ -#define CRYPTO_RSA_KSSTS1_NUM4_Msk (0x1ful << CRYPTO_RSA_KSSTS1_NUM4_Pos) /*!< CRYPTO_T::RSA_KSSTS1: NUM4 Mask */ - -#define CRYPTO_RSA_KSSTS1_NUM5_Pos (8) /*!< CRYPTO_T::RSA_KSSTS1: NUM5 Position */ -#define CRYPTO_RSA_KSSTS1_NUM5_Msk (0x1ful << CRYPTO_RSA_KSSTS1_NUM5_Pos) /*!< CRYPTO_T::RSA_KSSTS1: NUM5 Mask */ - -#define CRYPTO_RSA_KSSTS1_NUM6_Pos (16) /*!< CRYPTO_T::RSA_KSSTS1: NUM6 Position */ -#define CRYPTO_RSA_KSSTS1_NUM6_Msk (0x1ful << CRYPTO_RSA_KSSTS1_NUM6_Pos) /*!< CRYPTO_T::RSA_KSSTS1: NUM6 Mask */ - -#define CRYPTO_RSA_KSSTS1_NUM7_Pos (24) /*!< CRYPTO_T::RSA_KSSTS1: NUM7 Position */ -#define CRYPTO_RSA_KSSTS1_NUM7_Msk (0x1ful << CRYPTO_RSA_KSSTS1_NUM7_Pos) /*!< CRYPTO_T::RSA_KSSTS1: NUM7 Mask */ - -/**@}*/ /* CRYPTO_CONST */ -/**@}*/ /* end of CRYPTO register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __CRYPTO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ddr32phy_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ddr32phy_reg.h deleted file mode 100644 index d1408a3ba57..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ddr32phy_reg.h +++ /dev/null @@ -1,9569 +0,0 @@ -/**************************************************************************//** - * @file ddr32phy_reg.h - * @brief DDR32PHY register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __DDR32PHY_REG_H__ -#define __DDR32PHY_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- DDR 3/2 PHY Controller -------------------------*/ -/** - @addtogroup DDR32PHY DDR 3/2 PHY Controller(DDR32PHY) - Memory Mapped Structure for DDRPHY Controller -@{ */ - -typedef struct -{ - - - /** - * @var DDRPHY_T::RIDR - * Offset: 0x00 Revision Identification Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PUBMNR |PUB Minor Revision - * | | |Indicates minor update of the PUB such as bug fixes. Normally no new features are included. - * |[7:4] |PUBMDR |PUB Moderate Revision - * | | |Indicates moderate revision of the PUB such as addition of new features - * | | |Normally the new version is still compatible with previous versions. - * |[11:8] |PUBMJR |PUB Major Revision - * | | |Indicates major revision of the PUB such addition of the features that make the new version not compatible with previous versions. - * |[15:12] |PHYMNR |PHY Minor Revision - * | | |Indicates minor update of the PHY such as bug fixes. Normally no new features are included. - * |[19:16] |PHYMDR |PHY Moderate Revision - * | | |Indicates moderate revision of the PHY such as addition of new features - * | | |Normally the new version is still compatible with previous versions. - * |[23:20] |PHYMJR |PHY Major Revision - * | | |Indicates major revision of the PHY such addition of the features that make the new version not compatible with previous versions. - * |[31:24] |UDRID |User-Defined Revision ID - * | | |General purpose revision identification set by the user. - * @var DDRPHY_T::PIR - * Offset: 0x04 PHY Initialization Register (PIR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |INIT |Initialization Trigger - * | | |A write of '1' to this bit triggers the DDR system initialization, including PHY initialization, DRAM initialization, and PHY training - * | | |The exact initialization steps to be executed are specified in bits 1 to 15 of this register - * | | |A bit setting of 1 means the step will be executed as part of the initialization sequence, while a setting of '0' means the step will be bypassed - * | | |The initialization trigger bit is self-clearing. - * |[1] |ZCAL |Impedance Calibration - * | | |Performs PHY impedance calibration - * | | |When set the impedance calibration will be performed in parallel with PHY initialization (PLL initialization + DDL calibration + PHY reset). - * |[4] |PLLINIT |PLL Initialization - * | | |Executes the PLL initialization sequence which includes correct driving of PLL power-down, reset and gear shift pins, and then waiting for the PHY PLLs to lock. - * |[5] |DCAL |Digital Delay Line Calibration - * | | |Performs PHY delay line calibration. - * |[6] |PHYRST |PHY Reset - * | | |Resets the AC and DATX8 modules by asserting the AC/DATX8 reset pin. - * |[7] |DRAMRST |DRAM Reset - * | | |Issues a reset to the DRAM (by driving the DRAM reset pin low) and wait 200us - * | | |This can be triggered in isolation or with the full DRAM initialization (DRAMINIT) - * | | |For the latter case, the reset is issued and 200us is waited before starting the full initialization sequence. - * |[8] |DRAMINIT |DRAM Initialization - * | | |Executes the DRAM initialization sequence. - * |[9] |WL |Write Leveling - * | | |Executes a PUB write leveling routine. - * |[10] |QSGATE |Read DQS Gate Training - * | | |Executes a PUB training routine to determine the optimum position of the read data DQS strobe for maximum system timing margins. - * |[11] |WLADJ |Write Leveling Adjust - * | | |Executes a PUB training routine that re- adjusts the write latency used during write in case the write leveling routine changed the expected latency. - * | | |Note: Ensure that the DCU command cache is cleared prior to running WLADJ. - * |[12] |RDDSKW |Read Data Bit Deskew - * | | |Executes a PUB training routine to deskew the DQ bits during read. - * |[13] |WRDSKW |Write Data Bit Deskew - * | | |Executes a PUB training routine to deskew the DQ bits during write. - * |[14] |RDEYE |Read Data Eye Training - * | | |Executes a PUB training routine to maximize the read data eye. - * |[15] |WREYE |Write Data Eye Training - * | | |Executes a PUB training routine to maximize the write data eye. - * |[16] |ICPC |Initialization Complete Pin Configuration - * | | |Specifies how the DFI initialization complete output pin (dfi_init_complete) should be used to indicate the status of initialization - * | | |Valid values are: - * | | |0 = Asserted after PHY initialization (DLL locking and impedance calibration) is complete. - * | | |1 = Asserted after PHY initialization is complete and the triggered the PUB initialization (DRAM initialization, data training, or initialization trigger with no selected initialization) is complete. - * |[17] |PLLBYP |PLL Bypass - * | | |A setting of 1 on this bit will put all PHY PLLs in bypass mode. - * |[18] |CTLDINIT |Controller DRAM Initialization - * | | |Indicates, if set, that DRAM initialization will be performed by the controller - * | | |Otherwise if not set it indicates that DRAM initialization will be performed using the built-in initialization sequence or using software through the configuration port. - * |[19] |RDIMMINIT |RDIMM Initialization - * | | |Executes the RDIMM buffer chip initialization before executing DRAM initialization - * | | |The RDIMM buffer chip initialization is run after the DRAM is reset and CKE have been driven high by the DRAM initialization sequence. - * |[27] |CLRSR |Clear Status Registers - * | | |Writing 1 to this bit clears (reset to 0) select status bits in register PGSR0. - * | | |This bit is primarily for debug purposes and is typically not needed during normal functional operation - * | | |It can be used when PGSR.IDONE=1, to manually clear a selection of the PGSR status bits, although starting a new initialization process (PIR[0].INIT = 1'b1) automatically clears the PGSR status bits associated with the initialization steps enabled. - * | | |The following list describes which bits within the PGSR0 register are cleared when CLRSR is set to 1'b1 and which bits are not cleared: - * | | |The following bits are not cleared by PIR[27] (CLRSR): - * | | |- PGSR0[31] (APLOCK) - * | | |- PGSR0[29:28] (PLDONE_CHN) - * | | |- PGSR0[23] (WLAERR) - * | | |- PGSR0[21] (WLERR) - * | | |- PGSR0[4] (DIDONE) - * | | |- PGSR0[2] (DCDONE) - * | | |- PGSR0[1] (PLDONE) - * | | |- PGSR0[0] (IDONE) - * | | |The following bits are always zero: - * | | |- PGSR0[30] (reserved) - * | | |- PGSR0[19:12] (reserved) - * | | |The following bits are cleared unconditionally by PIR[27] (CLRSR): - * | | |- PGSR0[27] (WEERR) - * | | |- PGSR0[26] (REERR) - * | | |- PGSR0[25] (WDERR) - * | | |- PGSR0[24] (RDERR) - * | | |- PGSR0[22] (QSGERR) - * | | |- PGSR0[20] (ZCERR) - * | | |- PGSR0[11] (WEDONE) - * | | |- PGSR0[10] (REDONE) - * | | |- PGSR0[9] (WDDONE) - * | | |- PGSR0[8] (RDDONE) - * | | |- PGSR0[7] (WLADONE) - * | | |- PGSR0[6] (QSGDONE) - * | | |- PGSR0[5] (WLDONE) - * | | |- PGSR0[3] (ZCDONE) - * |[28] |LOCKBYP |PLL Lock Bypass - * | | |Bypasses or stops, if set, the waiting of PLLs to lock - * | | |PLL lock wait is automatically triggered after reset - * | | |PLL lock wait may be triggered manually using INIT and PLLINIT bits of the PIR register - * | | |This bit is self-clearing. - * |[29] |DCALBYP |Digital Delay Line Calibration Bypass - * | | |Bypasses or stops, if set, DDL calibration that automatically triggers after reset - * | | |DDL calibration may be triggered manually using INIT and DCAL bits of the PIR register - * | | |This bit is self- clearing. - * |[30] |ZCALBYP |Impedance Calibration Bypass - * | | |Bypasses or stops, if set, impedance calibration of all ZQ control blocks that automatically triggers after reset - * | | |Impedance calibration may be triggered manually using INIT and ZCAL bits of the PIR register - * | | |This bit is self-clearing. - * |[31] |INITBYP |Initialization Bypass - * | | |Bypasses or stops, if set, all initialization routines currently running, including PHY initialization, DRAM initialization, and PHY training - * | | |Initialization may be triggered manually using INIT and the other relevant bits of the PIR register - * | | |This bit is self-clearing. - * @var DDRPHY_T::PGCR0 - * Offset: 0x08 PHY General Configuration Registers 0 (PGCR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WLLVT |Write Leveling LCDL Delay VT Compensation - * | | |Enables, if set, the VT drift compensation of the write leveling LCDL. - * |[1] |WDLVT |Write DQ LCDL Delay VT Compensation - * | | |Enables, if set, the VT drift compensation of the write DQ LCDL. - * |[2] |RDLVT |Read DQS LCDL Delay VT Compensation - * | | |Enables, if set, the VT drift compensation of the read DQS LCDL. - * |[3] |RGLVT |Read DQS Gating LCDL Delay VT Compensation - * | | |Enables, if set, the VT drift compensation of the read DQS gating LCDL. - * |[4] |WDBVT |Write Data BDL VT Compensation - * | | |Enables, if set, the VT drift compensation of the write data bit delay lines. - * |[5] |RDBVT |Read Data BDL VT Compensation - * | | |Enables, if set, the VT drift compensation of the read data bit delay lines. - * |[6] |DLTMODE |Delay Line Test Mode - * | | |Selects, if set, the delay line oscillator test mode - * | | |Setting this bit also clears all delay line register values - * | | |For DL oscillator testing, first set this bit, then apply desired non-zero LCDL and BDL register programmings. - * |[7] |DLTST |Delay Line Test Start - * | | |A write of '1' to this bit will trigger delay line oscillator mode period measurement - * | | |This bit is not self clearing and needs to be reset to '0' before the measurement can be re-triggered. - * |[8] |OSCEN |Oscillator Enable: Enables, if set, the delay line oscillation. - * |[11:9] |OSCDIV |Oscillator Mode Division - * | | |Specifies the factor by which the delay line oscillator mode output is divided down before it is output on the delay line digital test output pin dl_dto - * | | |Valid values are: - * | | |000 = Divide by 1 - * | | |001 = Divide by 256 - * | | |010 = Divide by 512 - * | | |011 = Divide by 1024 - * | | |100 = Divide by 2048 - * | | |101 = Divide by 4096 - * | | |110 = Divide by 8192 - * | | |111 = Divide by 65536 - * |[13:12] |OSCWDL |Oscillator Mode Write-Leveling Delay Line Select - * | | |Selects which of the two write leveling LCDLs is active - * | | |The delay select value of the inactive LCDL is set to zero while the delay select value of the active LCDL can be varied by the input write leveling delay select pin - * | | |Valid values are: - * | | |00 = No WL LCDL is active - * | | |01 = DDR WL LCDL is active - * | | |10 = SDR WL LCDL is active - * | | |11 = Both LCDLs are active - * |[18:14] |DTOSEL |Digital Test Output Select - * | | |Selects the PHY digital test output that is driven onto PHY digital test output (phy_dto) pin: Valid values are: - * | | |00000 = DATX8 0 PLL digital test output - * | | |00001 = DATX8 1 PLL digital test output - * | | |00010 = DATX8 2 PLL digital test output - * | | |00011 = DATX8 3 PLL digital test output - * | | |00100 = DATX8 4 PLL digital test output - * | | |00101 = DATX8 5 PLL digital test output - * | | |00110 = DATX8 6 PLL digital test output - * | | |00111 = DATX8 7 PLL digital test output - * | | |01000 = DATX8 8 PLL digital test output - * | | |01001 = AC PLL digital test output - * | | |01010 - 01111 = Reserved - * | | |10000 = DATX8 0 delay line digital test output - * | | |10001 = DATX8 1 delay line digital test output - * | | |10010 = DATX8 2 delay line digital test output - * | | |10011 = DATX8 3 delay line digital test output - * | | |10100 = DATX8 4 delay line digital test output - * | | |10101 = DATX8 5 delay line digital test output - * | | |10110 = DATX8 6 delay line digital test output - * | | |10111 = DATX8 7 delay line digital test output - * | | |11000 = DATX8 8 delay line digital test output - * | | |11001 = AC delay line digital test output - * | | |11010 - 11111 = Reserved - * |[25] |PUBMODE |PUB Mode Enable - * | | |Enables, if set, the PUB to control the interface to the PHY and SDRAM - * | | |In this mode the DFI commands from the controller are ignored - * | | |The bit must be set to 0 after the system determines it is convenient to pass control of the DFI bus to the controller - * | | |When set to 0 the DFI interface has control of the PHY and SDRAM interface except when triggering pub operations such as BIST, DCU or data training. - * |[31:26] |CKEN |CK Enable - * | | |Controls whether the CK going to the SDRAM is enabled (toggling) or disabled (static value) and whether the CK is inverted - * | | |Two bits for each of the up to three CK pairs - * | | |Valid values for the two bits are: - * | | |00 = CK disabled (Driven to constant 0) - * | | |01 = CK toggling with inverted polarity - * | | |10 = CK toggling with normal polarity (This should be the default setting) - * | | |11 = CK disabled (Driven to constant 1) - * @var DDRPHY_T::PGCR1 - * Offset: 0x0C PHY General Configuration Registers 1 (PGCR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDDISDX |Power Down Disabled Byte - * | | |Indicates, if set, that the PLL and I/Os of a disabled byte should be powered down. - * |[1] |WLMODE |Write Leveling Mode - * | | |Indicates, if set, that the PUB is in software write leveling mode in which software executes single steps of DQS pulsing by writing '1' to PIR.WL - * | | |The write leveling DQ status from the DRAM is captured in DXnGSR0.WLDQ. - * |[2] |WLSTEP |Write Leveling Step - * | | |Specifies the number of delay step-size increments during each step of write leveling - * | | |Valid values are: - * | | |0 = computed to be 1/2 of the associated lane's DXnGSR0.WLPRD value - * | | |1 = 1 step size - * |[4] |WSLOPT |Write System Latency Optimization - * | | |Controls the insertion of a pipeline stage on the AC signals from the DFI interface to the PHY to cater for a negative write system latency (WSL) value (only -1 possible). - * | | |0x0 = A pipeline stage is inserted only if WL2 training results in a WSL of -1 for any rank - * | | |0x1 = Inserts a pipeline stage - * |[5] |ACHRST |AC PHY High-Speed Reset - * | | |A Write of '0' to this bit resets the AC macro without resetting the PUB RTL logic - * | | |This bit is not self-clearing and a '1' must be written to de-assert the reset. - * |[6] |WLSELT |Write Leveling Select Type - * | | |Selects the encoding type for the write leveling select signal depending on the desired setup/hold margins for the internal pipelines - * | | |Refer to the DDR PHY Databook for details of how the select type is used - * | | |Valid values are: - * | | |0 = Type 1: Setup margin of 90 degrees and hold margin of 90 degrees - * | | |1 = Type 2: Setup margin of 135 degrees and hold margin of 45 degrees - * |[8:7] |IODDRM |I/O DDR Mode - * | | |Selects the DDR mode for the I/Os - * | | |These bits connect to bits [2:1] of the IOM pin of the SSTL I/O - * | | |For more information, refer to the SSTL I/O chapter in the DWC DDR PHY Databook. - * |[9] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the AC master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or on when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high. - * |[10] |LPFEN |Low-Pass Filter Enable - * | | |Enables, if set, the low pass filtering of MDL period measurements. - * |[12:11] |LPFDEPTH |Low-Pass Filter Depth - * | | |Specifies the number of measurements over which MDL period measurements are filtered - * | | |This determines the time constant of the low pass filter - * | | |Valid values are: - * | | |00 = 2 - * | | |01 = 4 - * | | |10 = 8 - * | | |11 = 16 - * |[14:13] |FDEPTH |Filter Depth - * | | |Specifies the number of measurements over which all AC and DATX8 initial period measurements, that happen after reset or when calibration is manually triggered, are averaged - * | | |Valid values are: - * | | |00 = 2 - * | | |01 = 4 - * | | |10 = 8 - * | | |11 = 16 - * |[22:15] |DLDLMT |Delay Line VT Drift Limit - * | | |Specifies the minimum change in the delay line VT drift in one direction which should result in the assertion of the delay line VT drift status signal (vt_drift) - * | | |The limit is specified in terms of delay select values - * | | |A value of 0 disables the assertion of delay line VT drift status signal. - * |[24:23] |ZCKSEL |Impedance Clock Divider Select - * | | |Selects the divide ratio for the clock used by the impedance control logic relative to the clock used by the memory controller and SDRAM. - * | | |Valid values are: - * | | |00 = Divide by 2 - * | | |01 = Divide by 8 - * | | |10 = Divide by 32 - * | | |11 = Divide by 64 - * |[25] |DXHRST |DX PHY High-Speed Reset - * | | |a Write of '0' to this bit resets the DX macro without resetting the PUB RTL logic - * | | |This bit is not self-clearing and a '1' must be written to de-assert the reset. - * |[26] |INHVT |VT Calculation Inhibit - * | | |Inhibits calculation of the next VT compensated delay line values - * | | |A value of 1 will inhibit the VT calculation - * | | |This bit should be set to 1 during writes to the delay line registers. - * |[27] |IOLB |I/O Loop-Back Select - * | | |Selects where inside the I/O the loop-back of signals happens. Valid values are: - * | | |1'b0 = Loopback is after output buffer; output enable must be asserted - * | | |1'b1 = Loopback is before output buffer; output enable is don't care - * |[28] |LBDQSS |Loopback DQS Shift - * | | |Selects how the read DQS is shifted during loopback to ensure that the read DQS is centered into the read data eye - * | | |Valid values are: - * | | |1'b0 = PUB sets the read DQS LCDL to 0 (internally) - * | | |DQS is already shifted 90 degrees by write path - * | | |1'b1 = The read DQS shift is set manually through software - * |[30:29] |LBGDQS |Loopback DQS Gating - * | | |Selects the DQS gating mode that should be used when the PHY is in loopback mode, including BIST loopback mode - * | | |Valid values are: - * | | |2'b00 = DQS gate is always on - * | | |2'b01 = DQS gate training will be triggered on the PUB - * | | |2'b10 = DQS gate is set manually using software - * | | |2'b11 = Reserved - * |[31] |LBMODE |Loopback Mode - * | | |Indicates, if set, that the PHY/PUB is in loopback mode. - * @var DDRPHY_T::PGSR0 - * Offset: 0x10 PHY General Status Registers 0 (PGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IDONE |Initialization Done - * | | |Indicates, if set, that the DDR system initialization has completed - * | | |This bit is set after all the selected initialization routines in PIR register have completed. - * |[1] |PLDONE |PLL Lock Done - * | | |Indicates, if set, that PLL locking has completed. - * |[2] |DCDONE |Digital Delay Line Calibration Done - * | | |Indicates, if set, that DDL calibration has completed. - * |[3] |ZCDONE |Impedance Calibration Done: Indicates, if set, that impedance calibration has completed. - * |[4] |DIDONE |DRAM Initialization Done - * | | |Indicates, if set, that DRAM initialization has completed. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that write leveling has completed. - * |[6] |QSGDONE |Read DQS Gate Training Done - * | | |Indicates, if set, that DQS gate training has completed. - * |[7] |WLADONE |Write Leveling Adjustment Done - * | | |Indicates, if set, that write leveling adjustment has completed. - * |[8] |RDDONE |Read Data Bit Deskew Done - * | | |Indicates, if set, that read bit deskew has completed. - * |[9] |WDDONE |Write Data Bit Deskew Done - * | | |Indicates, if set, that write bit deskew has completed. - * |[10] |REDONE |Read Data Eye Training Done - * | | |Indicates, if set, that read eye training has completed. - * |[11] |WEDONE |Write Data Eye Training Done - * | | |Indicates, if set, that write eye training has completed. - * |[20] |ZCERR |Impedance Calibration Error - * | | |Indicates, if set, that there is an error in impedance calibration. - * |[21] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is an error in write leveling. - * |[22] |QSGERR |Read DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. - * |[23] |WLAERR |Write Data Leveling Adjustment Error - * | | |Indicates, if set, that there is an error in write leveling adjustment. - * |[24] |RDERR |Read Data Bit Deskew Error - * | | |Indicates, if set, that there is an error in read bit deskew. - * |[25] |WDERR |Write Data Bit Deskew Error - * | | |Indicates, if set, that there is an error in write bit deskew. - * |[26] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that there is an error in read eye training. - * |[27] |WEERR |Write Eye Training Error - * | | |Indicates, if set, that there is an error in write eye training. - * |[29:28] |PLDONE_CHN|PLL Lock Done per Channel - * | | |Indicates PLL locking has completed for each underlying channel - * | | |Bit 28 represents channel 0 while bit 29 represents channel 1. - * |[31] |APLOCK |AC PLL Lock - * | | |Indicates, if set, that AC PLL has locked. This is a direct status of the AC PLL lock pin. - * @var DDRPHY_T::PGSR1 - * Offset: 0x14 PHY General Status Registers 1 (PGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the AC delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the AC delay line digital test output. - * |[30] |VTSTOP |VT Stop - * | | |Indicates, if set, that the VT calculation logic has stopped computing the next values for the VT compensated delay line values - * | | |After assertion of the PGCR.INHVT, the VTSTOP bit should be read to ensure all VT compensation logic has stopped computations before writing to the delay line registers. - * |[31] |PARERR |RDIMM Parity Error - * | | |Indicates, if set, that there was a parity error (i.e - * | | |err_out_n was sampled low) during one of the transactions to the RDIMM buffer chip - * | | |This bit remains asserted until cleared by the PIR.CLRSR. - * @var DDRPHY_T::PLLCR - * Offset: 0x18 PLL Control Register (PLLCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |DTC |Digital Test Control - * | | |Selects various PLL digital test signals and other test mode signals to be brought out via bit [1] of the PLL digital test output (pll_dto[1]) - * | | |Valid values are: - * | | |00 = '0' (Test output is disabled) - * | | |01 = PLL x1 clock (X1) - * | | |10 = PLL reference (input) clock (REF_CLK) - * | | |11 = PLL feedback clock (FB_X1) - * |[5:2] |ATC |Analog Test Control - * | | |Selects various PLL analog test signals to be brought out via PLL analog test output pin (pll_ato) - * | | |Valid values are: - * | | |0000 = Reserved - * | | |0001 = vdd_ckin - * | | |0010 = vrfbf - * | | |0011 = vdd_cko - * | | |0100 = vp_cp - * | | |0101 = vpfil(vp) - * | | |0110 = Reserved - * | | |0111 = gd - * | | |1000 = vcntrl_atb - * | | |1001 = vref_atb - * | | |1010 = vpsf_atb - * | | |1011 - 1111 = Reserved - * |[9:6] |ATOEN |Analog Test Enable - * | | |Selects the analog test signal that is driven on the analog test output pin - * | | |Otherwise the analog test output is tri-stated - * | | |This allows analog test output pins from multiple PLLs to be connected together - * | | |Valid values are: - * | | |0000 = All PLL analog test signals are tri-stated - * | | |0001 = AC PLL analog test signal is driven out - * | | |0010 = DATX8 0 PLL analog test signal is driven out - * | | |0011 = DATX8 1 PLL analog test signal is driven out - * | | |0100 = DATX8 2 PLL analog test signal is driven out - * | | |0101 = DATX8 3 PLL analog test signal is driven out - * | | |0110 = DATX8 4 PLL analog test signal is driven out - * | | |0111 = DATX8 5 PLL analog test signal is driven out - * | | |1000 = DATX8 6 PLL analog test signal is driven out - * | | |1001 = DATX8 7 PLL analog test signal is driven out - * | | |1010 = DATX8 8 PLL analog test signal is driven out - * | | |1011 - 1111 = Reserved - * |[10] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode. - * |[12:11] |CPIC |Charge Pump Integrating Current Control - * |[16:13] |CPPC |Charge Pump Proportional Current Control - * |[17] |QPMODE |PLL Quadrature Phase Mode - * | | |Enables, if set, the quadrature phase clock outputs. This mode is not used in this version of the PHY. - * |[19:18] |FRQSEL |PLL Frequency Select - * | | |00 = PLL reference clock (ctl_clk/REF_CLK) ranges from 250 MHz to 400 MHz - * | | |01 = PLL reference clock (ctl_clk/REF_CLK) ranges from 166 MHz to 300 MHz - * | | |10 = Reserved - * | | |11 = Reserved - * |[29] |PLLPD |PLL Power Down - * | | |Puts the PLLs in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down. - * |[30] |PLLRST |PLL Rest - * | | |Resets the PLLs by driving the PLL reset pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the reset. - * |[31] |BYP |PLL Bypass - * | | |Bypasses the PLL, if set, to 1. - * @var DDRPHY_T::PTR0 - * Offset: 0x1C PHY Timing Registers 0 (PTR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |tPHYRST |PHY Reset Time - * | | |Number of configuration or APB clock cycles that the PHY reset must remain asserted after PHY calibration is done before the reset to the PHY is de-asserted - * | | |This is used to extend the reset to the PHY so that the reset is asserted for some clock cycles after the clocks are stable - * | | |Valid values are from 1 to 63 (the value must be non-zero). - * |[20:6] |tPLLGS |PLL Gear Shift Time - * | | |Number of configuration or APB clock cycles from when the PLL reset pin is de-asserted to when the PLL gear shift pin is de-asserted - * | | |This must correspond to a value that is equal to or more than 4us - * | | |Default value corresponds to 4us. - * |[31:21] |tPLLPD |PLL Power-Down Time - * | | |Number of configuration or APB clock cycles that the PLL must remain in power-down mode, i.e - * | | |number of clock cycles from when PLL power-down pin is asserted to when PLL power-down pin is de-asserted - * | | |This must correspond to a value that is equal to or more than 1us - * | | |Default value corresponds to 1us. - * @var DDRPHY_T::PTR1 - * Offset: 0x20 PHY Timing Registers 1 (PTR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |tPLLRST |PLL Reset Time - * | | |Number of configuration or APB clock cycles that the PLL must remain in reset mode, i.e - * | | |number of clock cycles from when PLL power-down pin is de-asserted and PLL reset pin is asserted to when PLL reset pin is de-asserted - * | | |The setting must correspond to a value that is equal to, or greater than 3us. - * |[31:16] |tPLLLOCK |PLL Lock Time - * | | |Number of configuration or APB clock cycles for the PLL to stabilize and lock, i.e - * | | |number of clock cycles from when the PLL reset pin is de-asserted to when the PLL has lock and is ready for use - * | | |This must correspond to a value that is equal to or more than 100us - * | | |Default value corresponds to 100us. - * @var DDRPHY_T::PTR2 - * Offset: 0x24 PHY Timing Registers 2 (PTR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |tCALON |Calibration On Time - * | | |Number of clock cycles that the calibration clock is enabled (cal_clk_en asserted). - * |[9:5] |tCALS |Calibration Setup Time - * | | |Number of controller clock cycles from when calibration is enabled (cal_en asserted) to when the calibration clock is asserted again (cal_clk_en asserted). - * |[14:10] |tCALH |Calibration Hold Time - * | | |Number of controller clock cycles from when the clock was disabled (cal_clk_en deasserted) to when calibration is enable (cal_en asserted). - * |[19:15] |tWLDLYS |Write Leveling Delay Settling Time - * | | |Number of controller clock cycles from when a new value of the write leveling delay is applied to the LCDL to when to DQS high is driven high - * | | |This allows the delay to settle. - * @var DDRPHY_T::PTR3 - * Offset: 0x28 PHY Timing Registers 3 (PTR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[19:0] |tDINIT0 |DRAM Initialization Time 0 - * | | |DRAM initialization time in DRAM clock cycles corresponding to the following: - * | | |DDR3 = CKE low time with power and clock stable (500 us) DDR2 = CKE low time with power and clock stable (200 us) Default value corresponds to DDR3 500 us at 1066 MHz. - * | | |During Verilog simulations, it is recommended that this value is changed to a much smaller value in order to avoid long simulation times - * | | |However, this may cause a memory model error, due to a violation of the CKE setup sequence - * | | |This violation is expected if this value is not programmed to the required SDRAM CKE low time, but memory models should be able to tolerate this violation without malfunction of the model. - * |[28:20] |tDINIT1 |DRAM Initialization Time 1 - * | | |DRAM initialization time in DRAM clock cycles corresponding to the following: - * | | |DDR3 = CKE high time to first command (tRFC + 10 ns or 5 tCK, whichever is bigger) DDR2 = CKE high time to first command (400 ns) - * | | |Default value corresponds to DDR3 tRFC of 360ns at 1066 MHz. - * @var DDRPHY_T::PTR4 - * Offset: 0x2C PHY Timing Registers 4 (PTR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |tDINIT2 |DRAM Initialization Time 2 - * | | |DRAM initialization time in DRAM clock cycles corresponding to the following: - * | | |DDR3 = Reset low time (200 us on power-up or 100 ns after power-up) Default value corresponds to DDR3 200 us at 1066 MHz. - * |[27:18] |tDINIT3 |DRAM Initialization Time 3 - * | | |DRAM initialization time in DRAM clock cycles corresponding to the following: - * | | |DDR3 = Time from ZQ initialization command to first command (1 us) Default value corresponds to the DDR3 640ns at 1066 MHz. - * @var DDRPHY_T::ACMDLR - * Offset: 0x30 AC Master Delay Line Register (ACMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::ACBDLR - * Offset: 0x34 AC Bit Delay Line Register (ACBDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CK0BD |CK0 Bit Delay - * | | |Delay select for the BDL on CK0. - * |[11:6] |CK1BD |CK1 Bit Delay - * | | |Delay select for the BDL on CK1. - * |[17:12] |CK2BD |CK2 Bit Delay - * | | |Delay select for the BDL on CK2. - * |[23:18] |ACBD |Address/Command Bit Delay - * | | |Delay select for the BDLs on address and command signals. - * @var DDRPHY_T::ACIOCR - * Offset: 0x38 AC I/O Configuration Register (ACIOCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ACIOM |Address/Command I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for all address and command pins - * | | |This bit connects to bit [0] of the IOM pin on the D3F I/Os, and for other I/O libraries, it connects to the IOM pin of the I/O. - * |[1] |ACOE |Address/Command Output Enable - * | | |Enables, when set, the output driver on the I/O for all address and command pins. - * |[2] |ACODT |Address/Command On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for RAS#, CAS#, WE#, BA[2:0], and A[15:0] pins. - * |[3] |ACPDD |AC Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for RAS#, CAS#, WE#, BA[2:0], and A[15:0] pins. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[4] |ACPDR |AC Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for RAS#, CAS#, WE#, BA[2:0], and A[15:0] pins. - * |[7:5] |CKODT |CK On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for CK[0], CK[1], and CK[2] pins, respectively. - * |[10:8] |CKPDD |CK Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for CK[0], CK[1], and CK[2] pins, respectively. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[13:11] |CKPDR |CK Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for CK[0], CK[1], and CK[2] pins, respectively. - * |[17:14] |RANKODT |Rank On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for CKE[3:0], ODT[3:0], and CS#[3:0] pins - * | | |RANKODT[0] controls the on-die termination for CKE[0], ODT[0], and CS#[0], RANKODT[1] controls the on-die termination for CKE[1], ODT[1], and CS#[1], and so on. - * |[21:18] |CSPDD |CS# Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for CS#[3:0] pins - * | | |CSPDD[0] controls the power down for CS#[0], CSPDD[1] controls the power down for CS#[1], and so on - * | | |CKE and ODT driver power down is controlled by DSGCR register. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[25:22] |RANKPDR |Rank Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O CKE[3:0], ODT[3:0], and CS#[3:0] pins - * | | |RANKPDR[0] controls the power down for CKE[0], ODT[0], and CS#[0], RANKPDR[1] controls the power down for CKE[1], ODT[1], and CS#[1], and so on. - * |[26] |RSTODT |SDRAM Reset On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for SDRAM RST# pin. - * |[27] |RSTPDD |SDRAM Reset Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for SDRAM RST# pin. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[28] |RSTPDR |SDRAM Reset Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for SDRAM RST# pin. - * |[29] |RSTIOM |SDRAM Reset I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for SDRAM Reset. - * |[31:30] |ACSR |Address/Command Slew Rate - * | | |Selects slew rate of the I/O for all address and command pins. - * @var DDRPHY_T::DXCCR - * Offset: 0x3C DATX8 Common Configuration Register (DXCCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ, DM, and DQS/DQS# pins of all DATX8 macros - * | | |This bit is ORed with the ODT configuration bit of the individual DATX8 ("DATX8 General Configuration Register (DXnGCR)") - * |[1] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of all DATX8 macros - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8. - * |[2] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, all DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or on when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the MDLEN bit in the individual DATX8. - * |[3] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of all DATX8 macros - * | | |This bit is ORed with the PDD configuration bit of the individual DATX8. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[4] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of all DATX8 macros - * | | |This bit is ORed with the PDR configuration bit of the individual DATX8. - * |[8:5] |DQSRES |DQS Resistor - * | | |Selects the on-die pull-down/pull-up resistor for DQS pins - * | | |DQSRES[3] selects pull-down (when set to 0) or pull-up (when set to 1) - * | | |DQSRES[2:0] selects the resistor value. - * | | |Refer PHY databook for pull-down/pull-up resistor values (RA_SEL/RB_SEL) for - * | | |DQS/DQS_b. - * |[12:9] |DQSNRES |DQS# Resistor - * | | |Selects the on-die pull-up/pull-down resistor for DQS# pins. Same encoding as DQSRES. - * | | |Refer PHY databook for pull-down/pull-up resistor values (RA_SEL/RB_SEL) for - * | | |DQS/DQS_b. - * |[14:13] |DXSR |Data Slew Rate - * | | |Selects slew rate of the I/O for DQ, DM, and DQS/DQS# pins of all DATX8 macros. - * |[17:15] |MSBUDQ |Most Significant Byte Unused DQs - * | | |Specifies the number of DQ bits that are not used in the most significant byte - * | | |The used (valid) bits for this byte are [8-MSBDQ-1:0] - * | | |To disable the whole byte, use the DXnGCR.DXEN register. - * |[18] |UDQODT |Unused DQ On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for unused DQ pins. - * |[19] |UDQPDD |Unused DQ Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for unused DQ pins. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[20] |UDQPDR |Unused DQ Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for unused DQ pins. - * |[21] |UDQIOM |Unused DQ I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for unused DQ pins. - * |[22] |DYNDXPDD |Dynamic Data Power Down Driver - * | | |Dynamically powers down, when set, the output driver on I/O for the DQ pins of the active DATX8 macros - * | | |Applies only when DXPDD and DXnGCR.DXPDD are not set to 1 - * | | |Driver is powered-up on a DFI WRITE command and powered-down (twrlat + WL/2 + n) HDR cycles after the last DFI WRITE command - * | | |Note that n is defined by the register bit field DXCCR[27:24] (DDPDDCDO). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[23] |DYNDXPDR |Data Power Down Receiver - * | | |Dynamically powers down, when set, the input receiver on I/O for the DQ pins of the active DATX8 macros - * | | |Applies only when DXPDR and DXnGCR.DXPDR are not set to 1 - * | | |Receiver is powered-up on a DFI READ command and powered-down (trddata_en + fixed_read_latency + n) HDR cycles after the last DFI READ command - * | | |Note that n is defined by the register bit field DXCCR[31:28] (DDPDRCDO). - * |[27:24] |DDPDDCDO |Dynamic Data Power Down Driver Count Down Offset - * | | |Offset applied in calculating window of time where driver is powered up - * |[31:28] |DDPDRCDO |Dynamic Data Power Down Receiver Count Down Offset - * | | |Offset applied in calculating window of time where receiver is powered up - * @var DDRPHY_T::DSGCR - * Offset: 0x40 DDR System General Configuration Register (DSGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PUREN |PHY Update Request Enable - * | | |Specifies if set, that the PHY should issue PHY- initiated update request when there is DDL VT drift. - * |[1] |BDISEN |Byte Disable Enable - * | | |Specifies, if set, that the PHY should respond to DFI byte disable request - * | | |Otherwise the byte disable from the DFI is ignored in which case bytes can only be disabled using the DXnGCR register. - * |[2] |ZUEN |Impedance Update Enable - * | | |Specifies, if set, that in addition to DDL VT update, the PHY could also perform impedance calibration (update). - * | | |Refer to the "Impedance Control Register 0-1 (ZQnCR0-1)" bit fields DFICU0, DFICU1 and DFICCU bits to control if an impedance calibration is performed (update) with a DFI controller update request. - * | | |Refer to the "Impedance Control Register 0-1 (ZQnCR0-1)"D bit fields DFIPU0 and DFIPU1 bits to control if an impedance calibration is performed (update) with a DFI PHY update request. - * |[3] |LPIOPD |Low Power I/O Power Down - * | | |Specifies, if set, that the PHY should respond to the DFI low power opportunity request and power down the I/Os of the byte. - * |[4] |LPPLLPD |Low Power PLL Power Down - * | | |Specifies, if set, that the PHY should respond to the DFI low power opportunity request and power down the PLL of the byte if the wakeup time request satisfies the PLL lock time. - * |[5] |CUAEN |Controller Update Acknowledge Enable - * | | |Specifies, if set, that the PHY should issue controller update acknowledge when the DFI controller update request is asserted - * | | |By default, the PHY does not acknowledge controller initiated update requests but simply does an update whenever there is a controller update request - * | | |This speeds up the update. - * |[6] |DQSGX |DQS Gate Extension - * | | |Specifies, if set, that the DQS gating must be extended by two DRAM clock cycles and then re-centered, i.e - * | | |one clock cycle extension on either side. - * |[7] |BRRMODE |Bypass Rise-to-Rise Mode - * | | |Indicates, if set, that the PHY bypass mode is configured to run in rise-to-rise mode - * | | |Otherwise if not set the PHY bypass mode is running in rise-to-fall mode. - * |[11:8] |PUAD |PHY Update Acknowledge Delay - * | | |Specifies the number of clock cycles that the indication for the completion of PHY update from the PHY to the controller should be delayed - * | | |This essentially delays, by this many clock cycles, the de-assertion of dfi_ctrlup_ack and dfi_phyupd_req signals relative to the time when the delay lines or I/Os are updated. - * |[12] |DTOODT |DTO On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DTO pins. - * |[13] |DTOPDD |DTO Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for DTO pins. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[14] |DTOPDR |DTO Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for DTO pins. - * |[15] |DTOIOM |DTO I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DTO pins. - * |[16] |DTOOE |DTO Output Enable - * | | |Enables, when set, the output driver on the I/O for DTO pins. - * |[17] |ATOAE |ATO Analog Test Enable - * | | |Enables, if set, the analog test output (ATO) I/O. - * |[18] |RRMODE |Rise-to-Rise Mode - * | | |Indicates, if set, that the PHY mission mode is configured to run in rise-to-rise mode - * | | |Otherwise if not set the PHY mission mode is running in rise-to- fall mode. - * |[19] |SDRMODE |Single Data Rate Mode - * | | |Indicates, if set, that the external controller is configured to run in single data rate (SDR) mode - * | | |Otherwise if not set the controller is running in half data rate (HDR) mode - * | | |This bit not supported in the current version of the PUB. - * |[23:20] |CKEPDD |CKE Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for CKE[3:0] pins - * | | |CKEPDD[0] controls the power down for CKE[0], CKEPDD[1] controls the power down for CKE[1], and so on. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[27:24] |ODTPDD |ODT Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for ODT[3:0] pins - * | | |ODTPDD[0] controls the power down for ODT[0], ODTPDD[1] controls the power down for ODT[1], and so on. - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[28] |CKOE |SDRAM CK Output Enable - * | | |Enables, when set, the output driver on the I/O for SDRAM CK/CK# pins. - * |[29] |ODTOE |SDRAM ODT Output Enable - * | | |Enables, when set, the output driver on the I/O for SDRAM ODT pins. - * |[30] |RSTOE |SDRAM Reset Output Enable - * | | |Enables, when set, the output driver on the I/O for SDRAM RST# pin. - * |[31] |CKEOE |SDRAM CKE Output Enable - * | | |Enables, when set, the output driver on the I/O for SDRAM CKE pins. - * @var DDRPHY_T::DCR - * Offset: 0x44 DRAM Configuration Register (DCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |DDRMD |DDR Mode - * | | |SDRAM DDR mode. Valid values are: - * | | |000 = Reserved - * | | |001 = Reserved - * | | |010 = DDR2 - * | | |011 = DDR3 - * | | |100 - 111 = Reserved - * |[3] |DDR8BNK |DDR 8-Bank - * | | |Indicates, if set, that the SDRAM used has 8 banks - * | | |tRPA = tRP+1 and tFAW are used for 8-bank DRAMs, otherwise tRPA = tRP and no tFAW is used. - * | | |Note that a setting of 1 for DRAMs that have fewer than 8 banks results in correct functionality, but less tight DRAM command spacing for the parameters. - * |[6:4] |PDQ |Primary DQ - * | | |Specifies the DQ pin in a byte that is designated as a primary pin for Multi-Purpose Register (MPR) reads - * | | |Valid values are 0 to 7 for DQ[0] to DQ[7], respectively. - * |[7] |MPRDQ |Multi-Purpose Register DQ - * | | |Specifies the value that is driven on non-primary DQ pins during MPR reads. Valid values are: - * | | |0 = Primary DQ drives out the data from MPR (0-1-0-1); non-primary DQs drive '0' - * | | |1 = Primary DQ and non-primary DQs all drive the same data from MPR (0-1-0-1) - * |[17:10] |BYTEMASK |Byte Mask - * | | |Mask applied to all beats of read data on all byte lanes during read DQS gate training - * | | |This allows training to be conducted based on selected bit(s) from the byte lanes. - * | | |Valid values for each bit are: - * | | |0 = Disable compare for that bit - * | | |1 = Enable compare for that bit - * | | |Note that this mask applies in DDR3 MPR operation mode as well and must be in keeping with the PDQ field setting. - * |[27] |NOSRA |No Simultaneous Rank Access - * | | |Specifies, if set, that simultaneous rank access on the same clock cycle is not allowed - * | | |This means that multiple chip select signals should not be asserted at the same time - * | | |This may be required on some DIMM systems. - * |[28] |DDR2T |DDR 2T Timing - * | | |Indicates, if set, that 2T timing should be used by PUB internally generated SDRAM transactions. - * |[29] |UDIMM |Un-buffered DIMM Address Mirroring - * | | |Indicates, if set, that there is address mirroring on the second rank of an un-buffered DIMM (the rank connected to CS#[1]) - * | | |In this case, the PUB re-scrambles the bank and address when sending mode register commands to the second rank - * | | |This only applies to PUB internal SDRAM transactions - * | | |Transactions generated by the controller must make its own adjustments when using an un-buffered DIMM - * | | |DCR[NOSRA] must be set if address mirroring is enabled. - * @var DDRPHY_T::DTPR0 - * Offset: 0x48 DRAM Timing Parameters Register 0 (DTPR0) 105 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |tRTP |Internal read to precharge command delay - * | | |Valid values are 2 to 15. - * |[7:4] |tWTR |Internal write to read command delay - * | | |Valid values are 1 to 15. - * |[11:8] |tRP |Precharge command period - * | | |The minimum time between a precharge command and any other command - * | | |Note that the Controller automatically derives tRPA for 8- bank DDR2 devices by adding 1 to tRP - * | | |Valid values are 2 to 15. - * |[15:12] |tRCD |Activate to read or write delay - * | | |Minimum time from when an activate command is issued to when a read or write to the activated row can be issued - * | | |Valid values are 2 to 15. - * |[21:16] |tRAS |Activate to precharge command delay - * | | |Valid values are 2 to 63. - * |[25:22] |tRRD |Activate to activate command delay - * | | |Valid values are 1 to 15. - * |[31:26] |tRC |Activate to activate command delay - * | | |Valid values are 2 to 63. - * @var DDRPHY_T::DTPR1 - * Offset: 0x4C DRAM Timing Parameters Register 1 (DTPR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |tMRD |Load mode cycle time - * | | |The minimum time between a load mode register command and any other command - * | | |For DDR3 this is the minimum time between two load mode register commands - * | | |Valid values for DDR2 are 2 to 3 - * | | |For DDR3, the value used for tMRD is 4 plus the value programmed in these bits, i.e - * | | |tMRD value for DDR3 ranges from 4 to 7. - * |[4:2] |tMOD |Load mode update delay - * | | |The minimum time between a load mode register command and a non-load mode register command - * | | |Valid values are: - * | | |000 = 12 - * | | |001 = 13 - * | | |010 = 14 - * | | |011 = 15 - * | | |100 = 16 - * | | |101 = 17 - * | | |110 - 111 = Reserved - * |[10:5] |tFAW |4-bank activate period - * | | |No more than 4-bank activate commands may be issued in a given tFAW period - * | | |Only applies to 8-bank devices - * | | |Valid values are 2 to 63. - * |[19:11] |tRFC |Refresh-to-Refresh - * | | |Indicates the minimum time between two refresh commands or between a refresh and an active command - * | | |This is derived from the minimum refresh interval from the Datasheet, tRFC(min), divided by the clock cycle time - * | | |The default number of clock cycles is for the largest JEDEC tRFC(min parameter value supported. - * |[25:20] |tWLMRD |Minimum delay from when write leveling mode is programmed to the first - * | | |DQS/DQS# rising edge. - * |[29:26] |tWLO |Write leveling output delay - * | | |Number of clock cycles from when write leveling DQS is driven high by the control block to when the results from the SDRAM on DQ is sampled by the control block - * | | |This must include the SDRAM tWLO timing parameter plus the round trip delay from control block to SDRAM back to control block. - * |[31:30] |tAONDtAOFD|ODT turn-on/turn-off delays. - * | | |Valid values are: - * | | |00 = 2/2.5 - * | | |01 = 3/3.5 - * | | |10 = 4/4.5 - * | | |11 = 5/5.5 - * | | |Most DDR2 devices utilize a fixed value of 2/2.5 - * | | |For non-standard SDRAMs, the user must ensure that the operational Write Latency is always greater than or equal to the ODT turn-on delay - * | | |For example, a DDR2 SDRAM with CAS latency set to 3 and CAS additive latency set to 0 has a Write Latency of 2 - * | | |Thus 2/2.5 can be used, but not 3/3.5 or higher. - * @var DDRPHY_T::DTPR2 - * Offset: 0x50 DRAM Timing Parameters Register 2 (DTPR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |tXS |Self refresh exit delay - * | | |The minimum time between a self refresh exit command and any other command - * | | |This parameter must be set to the maximum of the various minimum self refresh exit delay parameters specified in the SDRAM Datasheet, i.e - * | | |max(tXSNR, tXSRD) for DDR2 and max(tXS, tXSDLL) for DDR3 - * | | |Valid values are 2 to - * | | |1023. - * |[14:10] |tXP |Power down exit delay - * | | |The minimum time between a power down exit command and any other command - * | | |This parameter must be set to the maximum of the various minimum power down exit delay parameters specified in the SDRAM Datasheet, i.e - * | | |max(tXP, tXARD, tXARDS) for DDR2 and max(tXP, tXPDLL) for DDR3 - * | | |Valid values are 2 to 31. - * |[18:15] |tCKE |CKE minimum pulse width - * | | |Also specifies the minimum time that the SDRAM must remain in power down or self refresh mode - * | | |For DDR3 this parameter must be set to the value of tCKESR which is usually bigger than the value of tCKE - * | | |Valid values are 2 to 15. - * |[28:19] |tDLLK |DLL locking time - * | | |Valid values are 2 to 1023. - * |[29] |tRTODT |Read to ODT delay - * | | |Specifies whether ODT can be enabled immediately after the read post-amble or one clock delay has to be added - * | | |Valid values are: - * | | |0 = ODT may be turned on immediately after read post-amble - * | | |1 = ODT may not be turned on until one clock after the read post-amble - * | | |If tRTODT is set to 1, then the read-to-write latency is increased by 1 if ODT is enabled. - * |[30] |tRTW |Read to Write command delay - * | | |Valid values are: - * | | |0 = standard bus turn around delay - * | | |1 = add 1 clock to standard bus turn around delay - * | | |This parameter allows the user to increase the delay between issuing Write commands to the SDRAM when preceded by Read commands - * | | |This provides an option to increase bus turn-around margin for high frequency systems. - * |[31] |tCCD |Read to read and write to write command delay - * | | |Valid values are: - * | | |0 = BL/2 for DDR2 and 4 for DDR3 - * | | |1 = BL/2 + 1 for DDR2 and 5 for DDR3 - * @var DDRPHY_T::MR0 - * Offset: 0x54 Mode Register 0 (MR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |BL |Burst Length - * | | |Determines the maximum number of column locations that can be accessed during a given read or write command - * | | |Valid values are: - * | | |Valid values for DDR3 are: - * | | |00 = 8 (Fixed) - * | | |01 = 4 or 8 (On the fly) - * | | |10 = 4 (Fixed) - * | | |11 = Reserved - * |[2] |CL0 |CAS Latency - * | | |The delay between when the SDRAM registers a read command to when data is available. Valid values are: - * | | |0010 = 5 - * | | |0100 = 6 - * | | |0110 = 7 - * | | |1000 = 8 - * | | |1010 = 9 - * | | |1100 = 10 - * | | |1110 = 11 - * | | |0001 = 12 - * | | |0011 = 13 - * | | |0101 = 14 - * | | |All other settings are reserved and should not be used. - * |[3] |BT |Burst Type - * | | |Indicates whether a burst is sequential (0) or interleaved (1). - * |[6:4] |CL1 |CAS Latency - * | | |The delay between when the SDRAM registers a read command to when data is available. Valid values are: - * | | |0010 = 5 - * | | |0100 = 6 - * | | |0110 = 7 - * | | |1000 = 8 - * | | |1010 = 9 - * | | |1100 = 10 - * | | |1110 = 11 - * | | |0001 = 12 - * | | |0011 = 13 - * | | |0101 = 14 - * | | |All other settings are reserved and should not be used. - * |[7] |TM |Operating Mode - * | | |Selects either normal operating mode (0) or test mode (1) - * | | |Test mode is reserved for the manufacturer and should not be used. - * |[8] |DR |DLL Reset - * | | |Writing a '1' to this bit will reset the SDRAM DLL - * | | |This bit is self- clearing, i.e - * | | |it returns back to '0' after the DLL reset has been issued. - * |[11:9] |WR |Write Recovery - * | | |This is the value of the write recovery - * | | |It is calculated by dividing the Datasheet write recovery time, tWR (ns) by the Datasheet clock cycle time, tCK (ns) and rounding up a non-integer value to the next integer - * | | |Valid values are: - * | | |000 = 16 - * | | |001 = 5 - * | | |010 = 6 - * | | |011 = 7 - * | | |100 = 8 - * | | |101 = 10 - * | | |110 = 12 - * | | |111 = 14 - * | | |All other settings are reserved and should not be used. - * | | |Note: tWR (ns) is the time from the first SDRAM positive clock edge after the last data-in pair of a write command, to when a precharge of the same bank can be issued. - * |[12] |PD |Power-Down Control - * | | |Controls the exit time for power-down modes - * | | |Refer to the SDRAM Datasheet for details on power-down modes - * | | |Valid values are: - * | | |0 = Slow exit (DLL off) - * | | |1 = Fast exit (DLL on) - * @var DDRPHY_T::MR1 - * Offset: 0x58 Mode Register 1 (MR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DE |DLL Enable/Disable - * | | |Enable (0) or disable (1) the DLL. DLL must be enabled for normal operation. - * | | |Note: SDRAM DLL off mode is not supported - * |[1] |DIC0 |Output Driver Impedance Control - * | | |Controls the output drive strength. Valid values are: - * | | |00 = RZQ/6 - * | | |01 = RZQ7 - * | | |10 = Reserved - * | | |11 = Reserved - * |[2] |RTT0 |On Die Termination - * | | |Selects the effective resistance for SDRAM on die termination. Valid values are: - * | | |000 = ODT disabled - * | | |001 = RZQ/4 - * | | |010 = RZQ/2 - * | | |011 = RZQ/6 - * | | |100 = RZQ/12 - * | | |101 = RZQ/8 - * | | |All other settings are reserved and should not be used. - * |[4:3] |AL |Posted CAS Additive Latency - * | | |Setting additive latency that allows read and write commands to be issued to the SDRAM earlier than normal (refer to the SDRAM Datasheet for details) - * | | |Valid values are: - * | | |00 = 0 (AL disabled) - * | | |01 = CL - 1 - * | | |10 = CL - 2 - * | | |11 = Reserved - * |[5] |DIC1 |Output Driver Impedance Control - * | | |Controls the output drive strength. Valid values are: - * | | |00 = RZQ/6 - * | | |01 = RZQ7 - * | | |10 = Reserved - * | | |11 = Reserved - * |[6] |RTT1 |On Die Termination - * | | |Selects the effective resistance for SDRAM on die termination. Valid values are: - * | | |000 = ODT disabled - * | | |001 = RZQ/4 - * | | |010 = RZQ/2 - * | | |011 = RZQ/6 - * | | |100 = RZQ/12 - * | | |101 = RZQ/8 - * | | |All other settings are reserved and should not be used. - * |[7] |LEVEL |Write Leveling Enable - * | | |Enables write-leveling when set. - * |[9] |RTT2 |On Die Termination - * | | |Selects the effective resistance for SDRAM on die termination. Valid values are: - * | | |000 = ODT disabled - * | | |001 = RZQ/4 - * | | |010 = RZQ/2 - * | | |011 = RZQ/6 - * | | |100 = RZQ/12 - * | | |101 = RZQ/8 - * | | |All other settings are reserved and should not be used. - * |[11] |TDQS |Termination Data Strobe - * | | |When enabled ('1') TDQS provides additional termination resistance outputs that may be useful in some system configurations - * | | |Refer to the SDRAM Datasheet for details. - * |[12] |QOFF |Output Enable/Disable - * | | |When '0', all outputs function normal; when '1' all SDRAM outputs are disabled removing output buffer current - * | | |This feature is intended to be used for IDD characterization of read current and should not be used in normal operation. - * @var DDRPHY_T::MR2 - * Offset: 0x5C Mode Register 2/Extended Mode Register 2 (MR2/EMR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |PASR |Partial Array Self Refresh - * | | |Specifies that data located in areas of the array beyond the specified location will be lost if self refresh is entered. - * | | |Valid settings for 4 banks are: - * | | |000 = Full Array - * | | |001 = Half Array (BA[1:0] = 00 & 01) - * | | |010 = Quarter Array (BA[1:0] = 00) - * | | |011 = Not defined - * | | |100 = 3/4 Array (BA[1:0] = 01, 10, & 11) - * | | |101 = Half Array (BA[1:0] = 10 & 11) - * | | |110 = Quarter Array (BA[1:0] = 11) - * | | |111 = Not defined - * | | |Valid settings for 8 banks are: - * | | |000 = Full Array - * | | |001 = Half Array (BA[2:0] = 000, 001, 010 & 011) - * | | |010 = Quarter Array (BA[2:0] = 000, 001) - * | | |011 = 1/8 Array (BA[2:0] = 000) - * | | |100 = 3/4 Array (BA[2:0] = 010, 011, 100, 101, 110 & 111) - * | | |101 = Half Array (BA[2:0] = 100, 101, 110 & 111) - * | | |110 = Quarter Array (BA[2:0] = 110 & 111) - * | | |111 = 1/8 Array (BA[2:0] 111) - * |[5:3] |CWL |CAS Write Latency - * | | |The delay between when the SDRAM registers a write command to when write data is available - * | | |Valid values are: - * | | |000 = 5 (tCK > 2.5ns) - * | | |001 = 6 (2.5ns > tCK > 1.875ns) - * | | |010 = 7 (1.875ns > tCK> 1.5ns) - * | | |011 = 8 (1.5ns > tCK > 1.25ns) - * | | |100 = 9 (1.25ns > tCK > 1.07ns) - * | | |101 = 10 (1.07ns > tCK > 0.935ns) - * | | |110 = 11 (0.935ns > tCK > 0.833ns) - * | | |111 = 12 (0.833ns > tCK > 0.75ns) - * | | |All other settings are reserved and should not be used. - * |[6] |ASR |Auto Self-Refresh - * | | |When enabled ('1'), SDRAM automatically provides self-refresh power management functions for all supported operating temperature values - * | | |Otherwise the SRT bit must be programmed to indicate the temperature range. - * |[7] |SRT |Self-Refresh Temperature Range - * | | |Selects either normal ('0') or extended ('1') operating temperature range during self-refresh. - * |[10:9] |RTTWR |Dynamic ODT - * | | |Selects RTT for dynamic ODT. Valid values are: - * | | |00 = Dynamic ODT off - * | | |01 = RZQ/4 - * | | |10 = RZQ/2 - * | | |11 = Reserved - * @var DDRPHY_T::MR3 - * Offset: 0x60 Mode Register 3 (MR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |MPRLOC |Multi-Purpose Register Location - * | | |Selects MPR data location: Valid value are: - * | | |00 = Predefined pattern for system calibration - * | | |All other settings are reserved and should not be used. - * |[2] |MPR |Multi-Purpose Register Enable - * | | |Enables, if set, that read data should come from the Multi-Purpose Register - * | | |Otherwise read data come from the DRAM array. - * @var DDRPHY_T::ODTCR - * Offset: 0x64 ODT Configuration Register (ODTCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |RDODT0 |Write ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a write command is sent to rank n - * | | |WRODT0, WRODT1, WRODT2, and WRODT3 specify ODT settings when a write is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to enable ODT only on rank being written to. - * |[7:4] |RDODT1 |Write ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a write command is sent to rank n - * | | |WRODT0, WRODT1, WRODT2, and WRODT3 specify ODT settings when a write is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to enable ODT only on rank being written to. - * |[11:8] |RDODT2 |Write ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a write command is sent to rank n - * | | |WRODT0, WRODT1, WRODT2, and WRODT3 specify ODT settings when a write is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to enable ODT only on rank being written to. - * |[15:12] |RDODT3 |Write ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a write command is sent to rank n - * | | |WRODT0, WRODT1, WRODT2, and WRODT3 specify ODT settings when a write is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to enable ODT only on rank being written to. - * |[19:16] |WRODT0 |Read ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a read command is sent to rank n - * | | |RDODT0, RDODT1, RDODT2, and RDODT3 specify ODT settings when a read is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to disable ODT during reads - * |[23:20] |WRODT1 |Read ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a read command is sent to rank n - * | | |RDODT0, RDODT1, RDODT2, and RDODT3 specify ODT settings when a read is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to disable ODT during reads - * |[27:24] |WRODT2 |Read ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a read command is sent to rank n - * | | |RDODT0, RDODT1, RDODT2, and RDODT3 specify ODT settings when a read is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to disable ODT during reads - * |[31:28] |WRODT3 |Read ODT - * | | |Specifies whether ODT should be enabled ('1') or disabled ('0') on each of the up to four ranks when a read command is sent to rank n - * | | |RDODT0, RDODT1, RDODT2, and RDODT3 specify ODT settings when a read is to rank 0, rank 1, rank 2, and rank 3, respectively - * | | |The four bits of each field each represent a rank, the LSB being rank 0 and the MSB being rank 3 - * | | |Default is to disable ODT during reads - * @var DDRPHY_T::DTCR - * Offset: 0x68 Data Training Configuration Register (DTCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCOL |Data Training Column Address - * | | |Selects the SDRAM column address to be used during data training - * | | |The lower four bits of this address must always be "000". - * |[27:12] |DTROW |Data Training Row Address - * | | |Selects the SDRAM row address to be used during data training. - * |[30:28] |DTBANK |Data Training Bank Address - * | | |Selects the SDRAM bank address to be used during data training. - * @var DDRPHY_T::DTAR0 - * Offset: 0x6C Data Training Address Register 0 (DTAR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var DDRPHY_T::DTAR1 - * Offset: 0x70 Data Training Address Register 1 (DTAR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCOL |Data Training Column Address - * | | |Selects the SDRAM column address to be used during data training - * | | |The lower four bits of this address must always be "000". - * |[27:12] |DTROW |Data Training Row Address - * | | |Selects the SDRAM row address to be used during data training. - * |[30:28] |DTBANK |Data Training Bank Address - * | | |Selects the SDRAM bank address to be used during data training. - * @var DDRPHY_T::DTAR2 - * Offset: 0x74 Data Training Address Register 2 (DTAR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCOL |Data Training Column Address - * | | |Selects the SDRAM column address to be used during data training - * | | |The lower four bits of this address must always be "000". - * |[27:12] |DTROW |Data Training Row Address - * | | |Selects the SDRAM row address to be used during data training. - * |[30:28] |DTBANK |Data Training Bank Address - * | | |Selects the SDRAM bank address to be used during data training. - * @var DDRPHY_T::DTAR3 - * Offset: 0x78 Data Training Address Register 3 (DTAR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCOL |Data Training Column Address - * | | |Selects the SDRAM column address to be used during data training - * | | |The lower four bits of this address must always be "000". - * |[27:12] |DTROW |Data Training Row Address - * | | |Selects the SDRAM row address to be used during data training. - * |[30:28] |DTBANK |Data Training Bank Address - * | | |Selects the SDRAM bank address to be used during data training. - * @var DDRPHY_T::DTDR0 - * Offset: 0x7C Data Training Data Register 0 (DTDR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DTBYTE1 |Data Training Data - * | | |The first 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * |[15:8] |DTBYTE0 |Data Training Data - * | | |The first 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * |[23:16] |DTBYTE2 |Data Training Data - * | | |The first 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * |[31:24] |DTBYTE3 |Data Training Data - * | | |The first 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * @var DDRPHY_T::DTDR1 - * Offset: 0x80 Data Training Data Register 1 (DTDR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DTBYTE4 |Data Training Data - * | | |The second 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * |[15:8] |DTBYTE5 |Data Training Data - * | | |The second 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * |[23:16] |DTBYTE6 |Data Training Data - * | | |The second 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * |[31:24] |DTBYTE7 |Data Training Data - * | | |The second 4 bytes of data used during data training - * | | |This same data byte is used for each Byte Lane - * | | |Default sequence is a walking 1 while toggling data every data cycle. - * @var DDRPHY_T::DTEDR0 - * Offset: 0x84 Data Training Eye Data Register 0 (DTEDR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DTWLMN |Data Training WDQ LCDL Minimum. - * |[15:8] |DTWLMX |Data Training WDQ LCDL Maximum. - * |[23:16] |DTWBMN |Data Training Write BDL Shift Minimum. - * |[31:24] |DTWBMX |Data Training Write BDL Shift Maximum. - * @var DDRPHY_T::DTEDR1 - * Offset: 0x88 Data Training Eye Data Register 1 (DTEDR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DTRLMN |Data Training RDQS LCDL Minimum. - * |[15:8] |DTRLMX |Data Training RDQS LCDL Maximum. - * |[23:16] |DTRBMN |Data Training Read BDL Shift Minimum. - * |[31:24] |DTRBMX |Data Training Read BDL Shift Maximum. - * @var DDRPHY_T::PGCR2 - * Offset: 0x8C PHY General Configuration Register 2 (PGCR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |tREFPRD |Refresh Period - * | | |Indicates the period, after which the PUB has to issue a refresh command to the SDRAM - * | | |This is derived from the maximum refresh interval from the Datasheet, tRFC(max) or REFI, divided by the clock cycle time - * | | |A further 400 clocks must be subtracted from the derived number to account for command flow and missed slots of refreshes in the internal PUB blocks - * | | |The default corresponds to DDR3 9*7.8us at 1066 MHz when a burst of 9 refreshes are issued at every refresh interval. - * |[18] |NOBUB |No Bubbles - * | | |Specified whether reads should be returned to the controller with no bubbles - * | | |Enabling no-bubble reads increases the read latency - * | | |Valid values are: - * | | |0 = Bubbles are allowed during reads - * | | |1 = Bubbles are not allowed during reads - * |[19] |FXDLAT |Fixed Latency - * | | |Specified whether all reads should be returned to the controller with a fixed read latency - * | | |Enabling fixed read latency increases the read latency - * | | |Valid values are: - * | | |0 = Disable fixed read latency - * | | |1 = Enable fixed read latency - * | | |Fixed read latency is calculated as (12 + (maximum DXnGTR.RxDGSL)/2) HDR - * | | |clock cycles - * |[27:20] |DTPMXTMR |Data Training PUB Mode Timer Exit - * | | |Specifies the number of controller clocks to wait when entering and exiting pub mode data training - * | | |The default value ensures controller refreshes do not cause memory model errors when entering and exiting data training - * | | |The value should be increased if controller initiated SDRAM ZQ short or long operation may occur just before or just after the execution of data training. - * |[28] |SHRAC |Shared-AC mode - * | | |Set to 1 to enable shared address/command mode with two independent data channels - available only if shared address/command mode support is compiled in. - * |[29] |ACPDDC |AC Power-Down with Dual Channels - * | | |Set to 1 to power-down address/command lane when both data channels are powered-down - * | | |Only valid in shared-AC mode. - * |[30] |LPMSTRC0 |Low-Power Master Channel 0 - * | | |Set to 1 to have channel 0 act as master to drive channel 1 low-power functions simultaneously - * | | |Only valid in shared-AC mode. - * |[31] |DYNACPDD |Dynamic AC Power Down Driver - * | | |Powers down, when set, the output driver on I/O for ADDR and BA - * | | |This bit is ORed with bit ACIOCR[3] (ACPDD). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * @var DDRPHY_T::RDIMMGCR0 - * Offset: 0xB0 RDIMM General Configuration Register 0 (RDIMMGCR0) 123 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDIMM |Registered DIMM - * | | |Indicates, if set, that a registered DIMM is used - * | | |In this case, the PUB increases the SDRAM write and read latencies (WL/RL) by 1 and also enforces that accesses adhere to RDIMM buffer chip - * | | |This only applies to PUB internal SDRAM transactions - * | | |Transactions generated by the controller must make its own adjustments to WL/RL when using a registered DIMM - * | | |The DCR.NOSRA register bit must be set to '1' if using the standard RDIMM buffer chip so that normal DRAM accesses do not assert multiple chip select bits at the same time. - * |[1] |ERRNOREG |Parity Error No Registering - * | | |Indicates, if set, that parity error signal from the RDIMM should be passed to the DFI controller without any synchronization or registering - * |[2] |SOPERR |Stop On Parity Error - * | | |Indicates, if set, that the PUB is to stop driving commands to the DRAM upon encountering a parity error - * | | |Transactions can resume only after status is cleared via PIR.CLRSR. - * |[14] |PARINODT |PAR_IN On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for PAR_IN pin. - * |[15] |PARINPDD |PAR_IN Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for PAR_IN pin. - * |[16] |PARINPDR |PAR_IN Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for PAR_IN pin. - * |[17] |PARINIOM |PAR_IN I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for PAR_IN pin. - * |[18] |PARINOE |PAR_IN Output Enable - * | | |Enables, when set, the output driver on the I/O for PAR_IN pin. - * |[19] |ERROUTODT |ERROUT# On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for ERROUT# pin. - * |[20] |ERROUTPDD |ERROUT# Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for ERROUT# pin. - * |[21] |ERROUTPDR |ERROUT# Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for ERROUT# pin. - * |[22] |ERROUTIOM |ERROUT# I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for ERROUT# pin. - * |[23] |ERROUTOE |ERROUT# Output Enable - * | | |Enables, when set, the output driver on the I/O for ERROUT# pin. - * |[24] |RDIMMODT |RDIMM Outputs On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for QCSEN# and MIRROR pins. - * |[25] |RDIMMPDD |RDIMM Outputs Power Down Driver - * | | |Powers down, when set, the output driver on the I/O for QCSEN# and MIRROR pins. - * |[26] |RDIMMPDR |RDIMM Outputs Power Down Receiver - * | | |Powers down, when set, the input receiver on the I/O for QCSEN# and MIRROR pins. - * |[27] |RDIMMIOM |RDIMM Outputs I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for QCSEN# and MIRROR pins. - * |[28] |QCSENOE |QCSEN# Output Enable - * | | |Enables, when set, the output driver on the I/O for QCSEN# pin. - * |[29] |MIRROROE |MIRROR Output Enable - * | | |Enables, when set, the output driver on the I/O for MIRROR pin. - * |[30] |QCSEN |RDMIMM Quad CS Enable - * | | |Enables, if set, the Quad CS mode for the RDIMM registering buffer chip - * | | |This register bit controls the buffer chip QCSEN# signal. - * |[31] |MIRROR |RDIMM Mirror - * | | |Selects between two different ballouts of the RDIMM buffer chip for front or back operation - * | | |This register bit controls the buffer chip MIRROR signal. - * @var DDRPHY_T::RDIMMGCR1 - * Offset: 0xB4 RDIMM General Configuration Register 1 (RDIMMGCR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |tBCSTAB |Stabilization time - * | | |Number of DRAM clock cycles for the RDIMM buffer chip to stabilize - * | | |This parameter corresponds to the buffer chip tSTAB parameter - * | | |Default value is in decimal format and corresponds to 6us at 533 MHz. - * |[14:12] |tBCMRD |Command word to command word programming delay - * | | |Number of DRAM clock cycles between two RDIMM buffer chip command programming accesses - * | | |The value used for tBCMRD is 8 plus the value programmed in these bits, i.e - * | | |tBCMRD value ranges from 8 to 15 - * | | |This parameter corresponds to the buffer chip tMRD parameter. - * |[31:16] |CRINIT |Control Registers Initialization Enable - * | | |Indicates which RDIMM buffer chip control registers (RC0 to RC15) should be initialized (written) when the PUB is triggered to initialize the buffer chip - * | | |A setting of '1' on CRINIT[n] bit means that CRn should be written during initialization. - * @var DDRPHY_T::RDIMMCR0 - * Offset: 0xB8 RDIMM Control Register 0 (RDIMMCR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |RC0 |Control Word 0 - * | | |Bit definitions are: - * | | |RC0[0]: 0 = Output inversion enabled, 1 = Output inversion disabled. - * | | |RC0[1]: 0 = Floating outputs disabled, 1 = Floating outputs enabled. - * | | |RC0[2]: 0 = A outputs enabled, 1 = A outputs disabled. - * | | |RC0[3]: 0 = B outputs enabled, 1 = B outputs disabled. - * |[7:4] |RC1 |Control Word 1 - * | | |Bit definitions are: - * | | |RC1[0]: 0 = Y0/Y0# clock enabled, 1 = Y0/Y0# clock disabled. - * | | |RC1[1]: 0 = Y1/Y1# clock enabled, 1 = Y1/Y1# clock disabled. - * | | |RC1[2]: 0 = Y2/Y2# clock enabled, 1 = Y2/Y2# clock disabled. - * | | |RC1[3]: 0 = Y3/Y3# clock enabled, 1 = Y3/Y3# clock disabled. - * |[11:8] |RC2 |Control Word 2 - * | | |Bit definitions are: - * | | |RC2[0]: 0 = Standard (1/2 clock) pre-launch, 1 = Prelaunch controlled by RC1. - * | | |RC2[1]: 0 = Reserved. - * | | |RC2[2]: 0 = 100 Ohm input bus termination, 1 = 150 Ohm input bus termination. - * | | |RC2[3]: 0 = Operation frequency band 1, 1 = Test mode frequency band 2. - * |[15:12] |RC3 |Control Word 3 - * | | |RC3[1:0] is driver settings for command/address A outputs, and RC3[3:2] is driver settings for command/address B outputs - * | | |Bit definitions are: - * | | |00 = Light drive (4 or 5 DRAM loads) - * | | |01 = Moderate drive (8 or 10 DRAM loads) - * | | |10 = Strong drive (16 or 20 DRAM loads) - * | | |11 = Reserved - * |[19:16] |RC4 |Control Word 4 - * | | |RC4[1:0] is driver settings for control A outputs, and RC4[3:2] is driver settings for control B outputs - * | | |Bit definitions are: - * | | |00 = Light drive (4 or 5 DRAM loads) - * | | |01 = Moderate drive (8 or 10 DRAM loads) - * | | |10 = Reserved - * | | |11 = Reserved - * |[23:20] |RC5 |Control Word 5 - * | | |RC5[1:0] is driver settings for clock Y1, Y1#, Y3, and Y3# outputs, and RC5[3:2] is driver settings for clock Y0, Y0#, Y2, and Y2# outputs - * | | |Bit definitions are: - * | | |00 = Light drive (4 or 5 DRAM loads) - * | | |01 = Moderate drive (8 or 10 DRAM loads) - * | | |10 = Strong drive (16 or 20 DRAM loads) - * | | |11 = Reserved - * |[27:24] |RC6 |Control Word 6 - * | | |Reserved, free to use by vendor. - * |[31:28] |RC7 |Control Word 7 - * | | |Reserved, free to use by vendor. - * @var DDRPHY_T::RDIMMCR1 - * Offset: 0xBC RDIMM Control Register 1 (RDIMMCR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |RC8 |Control Word 8 - * | | |RC8[2:0] is Input Bus Termination (IBT) setting as follows: - * | | |000 = IBT as defined in RC2. - * | | |001 = Reserved - * | | |010 = 200 Ohm - * | | |011 = Reserved - * | | |100 = 300 Ohm - * | | |101 = Reserved - * | | |110 = Reserved - * | | |111 = Off - * | | |RC8[3]: 0 = IBT off when MIRROR is HIGH, 1 = IBT on when MIRROR is high - * |[7:4] |RC9 |Control Word 9 - * | | |Bit definitions are: - * | | |RC9[0]: 0 = Floating outputs as defined in RC0, 1 = Weak drive enabled. - * | | |RC9[1]: 0 = Reserved. - * | | |RC9[2]: 0 = CKE power down with IBT ON, QxODT is a function of DxODT, 1 = CKE power down with IBT off, QxODT held LOW - * | | |RC9[2] is valid only when RC9[3] is 1. - * | | |RC9[3]: 0 = CKE Power-down mode disabled, 1 = CKE Power-down mode enabled. - * |[11:8] |RC10 |Control Word 10 - * | | |RC10[2:0] is RDIMM operating speed setting as follows: - * | | |000 = DDR3/DDR3L-800 - * | | |001 = DDR3/DDR3L-1066 - * | | |010 = DDR3/DDR3L-1333 - * | | |011 = DDR3/DDR3L-1600 - * | | |100 = Reserved - * | | |101 = Reserved - * | | |110 = Reserved - * | | |111 = Reserved - * | | |RC10[3]: Don't care. - * |[15:12] |RC11 |Control Word 11 - * | | |RC10[1:0] is VDD operating voltage setting as follows: - * | | |00 = DDR3 1.5V mode - * | | |01 = DDR3L 1.35V mode - * | | |10 = Reserved - * | | |11 = Reserved - * | | |RC10[3:2]: Reserved. - * |[19:16] |RC12 |Control Word 12 - * | | |Reserved for future use. - * |[23:20] |RC13 |Control Word 13 - * | | |Reserved for future use. - * |[27:24] |RC14 |Control Word 14 - * | | |Reserved for future use - * |[31:28] |RC15 |Control Word 15 - * | | |Reserved for future use - * @var DDRPHY_T::DCUAR - * Offset: 0xC0 DCU Address Register (DCUAR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CWADDR |Cache Word Address - * | | |Address of the cache word to be accessed. - * |[7:4] |CSADDR |Cache Slice Address - * | | |Address of the cache slice to be accessed. - * |[9:8] |CSEL |Cache Select - * | | |Selects the cache to be accessed. Valid values are: - * | | |00 = Command cache - * | | |01 = Expected data cache - * | | |10 = Read data cache - * | | |11 = Reserved - * |[10] |INCA |Increment Address - * | | |Specifies, if set, that the cache address specified in WADDR and SADDR should be automatically incremented after each access of the cache - * | | |The increment happens in such a way that all the slices of a selected word are first accessed before going to the next word. - * |[11] |ATYPE |Access Type - * | | |Specifies the type of access to be performed using this address. Valid values are: - * | | |0 = Write access - * | | |1 = Read access - * @var DDRPHY_T::DCUDR - * Offset: 0xC4 DCU Data Register (DCUDR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CDATA |Cache Data - * | | |Data to be written to or read from a cache - * | | |This data corresponds to the cache word slice specified by the DCU Address Register. - * @var DDRPHY_T::DCURR - * Offset: 0xC8 DCU Run Register (DCURR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DINST |DCU Instruction - * | | |Selects the DCU command to be executed: Valid values are: - * | | |0000 = NOP: No operation - * | | |0001 = Run: Triggers the execution of commands in the command cache. - * | | |0010 = Stop: Stops the execution of commands in the command cache. - * | | |0011 = Stop Loop: Stops the execution of an infinite loop in the command cache. - * | | |0100 = Reset: Resets all DCU run time registers. See "DCU Status" for details. - * | | |0101 - 1111 Reserved - * |[7:4] |SADDR |Start Address - * | | |Cache word address where the execution of commands should begin. - * |[11:8] |EADDR |End Address - * | | |Cache word address where the execution of command should end. - * |[19:12] |NFAIL |Number of Failures - * | | |Specifies the number of failures after which the execution of commands and the capture of read data should stop if SONF bit of this register is set - * | | |Execution of commands and the capture of read data will stop after (NFAIL+1) failures if SONF is set. - * | | |Valid values are from 0 to 254. - * |[20] |SONF |Stop On Nth Fail - * | | |Specifies, if set, that the execution of commands and the capture of read data should stop when there are N read data failures - * | | |The number of failures is specified by NFAIL - * | | |Otherwise commands execute until the end of the program or until manually stopped using a STOP command. - * |[21] |SCOF |Stop Capture On Full - * | | |Specifies, if set, that the capture of read data should stop when the capture cache is full. - * |[22] |RCEN |Read Capture Enable - * | | |Indicates, if set, that read data coming back from the SDRAM should be captured into the read data cache. - * |[23] |XCEN |Expected Compare Enable - * | | |Indicates, if set, that read data coming back from the SDRAM should be should be compared with the expected data. - * @var DDRPHY_T::DCULR - * Offset: 0xCC DCU Loop Register (DCULR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |LSADDR |Loop Start Address - * | | |Command cache word address where the loop should start. - * |[7:4] |LEADDR |Loop End Address - * | | |Command cache word address where the loop should end. - * |[15:8] |LCNT |Loop Count - * | | |The number of times that the loop should be executed if LINF is not set. - * |[16] |LINF |Loop Infinite - * | | |Indicates, if set, that the loop should be executed indefinitely until stopped by the STOP command - * | | |Otherwise the loop is execute LCNT times. - * |[17] |IDA |Increment DRAM Address - * | | |Indicates, if set, that DRAM addresses should be incremented every time a DRAM read/write command inside the loop is executed. - * |[31:28] |XLEADDR |Expected Data Loop End Address - * | | |The last expected data cache word address that contains valid expected data - * | | |Expected data should be looped between 0 and this address. - * | | |XLEADDR field uses only the following bits based on the cache depth: - * | | |DCU expected data cache = 4, XLEADDR[1:0] - * | | |DCU expected data cache = 8, XLEADDR[2:0] - * | | |DCU expected data cache = 16, XLEADDR[3:0] - * @var DDRPHY_T::DCUGCR - * Offset: 0xD0 DCU General Configuration Register (DCUGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCSW |Read Capture Start Word - * | | |The capture and compare of read data should start after Nth word - * | | |For example setting this value to 12 will skip the first 12 read data. - * @var DDRPHY_T::DCUTPR - * Offset: 0xD4 DCU Timing Parameter Register (DCUTPR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |tDCUT0 |DCU Generic Timing Parameter 0 - * |[15:8] |tDCUT1 |DCU Generic Timing Parameter 1 - * |[23:16] |tDCUT2 |DCU Generic Timing Parameter 2 - * |[31:24] |tDCUT3 |DCU Generic Timing Parameter 3 - * @var DDRPHY_T::DCUSR0 - * Offset: 0xD8 DCU Status Register 0 (DCUSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDONE |Run Done - * | | |Indicates, if set, that the DCU has finished executing the commands in the command cache - * | | |This bit is also set to indicate that a STOP command has successfully been executed and command execution has stopped. - * |[1] |CFAIL |Capture Fail - * | | |Indicates, if set, that at least one read data word has failed. - * |[2] |CFULL |Capture Full - * | | |Indicates, if set, that the capture cache is full. - * @var DDRPHY_T::DCUSR1 - * Offset: 0xDC DCU Status Register 1 (DCUSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RDCNT |Read Count - * | | |Number of read words returned from the SDRAM. - * |[23:16] |FLCNT |Fail Count - * | | |Number of read words that have failed. - * |[31:24] |LPCNT |Loop Count - * | | |Indicates the value of the loop count - * | | |This is useful when the program has stopped because of failures to assess how many reads were executed before first fail. - * @var DDRPHY_T::BISTRR - * Offset: 0x100 BIST Run Register (BISTRR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |BINST |BIST Instruction - * | | |Selects the BIST instruction to be executed: Valid values are: - * | | |000 = NOP: No operation - * | | |001 = Run: Triggers the running of the BIST. - * | | |010 = Stop: Stops the running of the BIST. - * | | |011 = Reset: Resets all BIST run-time registers, such as error counters. - * | | |100 - 111 Reserved - * |[3] |BMODE |BIST Mode - * | | |Selects the mode in which BIST is run. Valid values are: - * | | |0 = Loopback mode: Address, commands and data loop back at the PHY I/Os. - * | | |1 = DRAM mode: Address, commands and data go to DRAM for normal memory accesses. - * |[4] |BINF |BIST Infinite Run - * | | |Specifies, if set, that the BIST should be run indefinitely until when it is either stopped or a failure has been encountered - * | | |Otherwise BIST is run until number of BIST words specified in the BISTWCR register has been generated. - * |[12:5] |NFAIL |Number of Failures - * | | |Specifies the number of failures after which the execution of commands and the capture of read data should stop if BSONF bit of this register is set - * | | |Execution of commands and the capture of read data will stop after (NFAIL+1) failures if BSONF is set. - * |[13] |BSONF |BIST Stop On Nth Fail - * | | |Specifies, if set, that the BIST should stop when an nth data word or address/command comparison error has been encountered. - * |[14] |BDXEN |BIST DATX8 Enable - * | | |Enables the running of BIST on the data byte lane PHYs - * | | |This bit is exclusive with BACEN, i.e - * | | |both cannot be set to '1' at the same time. - * |[15] |BACEN |BIST AC Enable - * | | |Enables the running of BIST on the address/command lane PHY - * | | |This bit is exclusive with BDXEN, i.e - * | | |both cannot be set to '1' at the same time. - * |[16] |BDMEN |BIST Data Mask Enable - * | | |Enables, if set, that the data mask BIST should be included in the BIST run, i.e - * | | |data pattern generated and loopback data compared - * | | |This is valid only for loopback mode. - * |[18:17] |BDPAT |BIST Data Pattern - * | | |Selects the data pattern used during BIST. Valid values are: - * | | |00 = Walking 0 - * | | |01 = Walking 1 - * | | |10 = LFSR-based pseudo-random - * | | |11 = User programmable (Not valid for AC loopback). - * |[22:19] |BDXSEL |BIST DATX8 Select - * | | |Select the byte lane for comparison of loopback/read data. Valid values are 0 to 8. - * |[24:23] |BCKSEL |BIST CK Select - * | | |Selects the CK that should be used to register the AC loopback signals from the I/Os. Valid values are: - * | | |00 = CK[0] - * | | |01 = CK[1] - * | | |10 = CK[2] - * | | |11 = Reserved - * |[26:25] |BCCSEL |BIST Clock Cycle Select - * | | |Selects the clock numbers on which the AC loopback data is written into the FIFO - * | | |Data is written into the loopback FIFO once every four clock cycles - * | | |Valid values are: - * | | |00 = Clock cycle 0, 4, 8, 12, etc. - * | | |01 = Clock cycle 1, 5, 9, 13, etc. - * | | |10 = Clock cycle 2, 6, 10, 14, etc. - * | | |11 = Clock cycle 3, 7, 11, 15, etc. - * @var DDRPHY_T::BISTWCR - * Offset: 0x104 BIST Word Count Register (BISTWCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |BWCNT |BIST Word Count - * | | |Indicates the number of words to generate during BIST - * | | |This must be a multiple of DRAM burst length (BL) divided by 2, e.g - * | | |for BL=8, valid values are 4, 8, 12, 16, and so on. - * @var DDRPHY_T::BISTMSKR0 - * Offset: 0x108 BIST Mask Register 0 (BISTMSKR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |AMSK |Address Mask - * | | |Mask bit for each of the up to 16 address bits. - * |[18:16] |BAMSK |Bank Address Mask - * | | |Mask bit for each of the up to 3 bank address bits. - * |[19] |WEMSK |WE Mask - * | | |Mask bit for the WE#. - * |[23:20] |CKEMSK |CKE Mask - * | | |Mask bit for each of the up to 4 CKE bits. - * |[27:24] |CSMSK |CS Mask - * | | |Mask bit for each of the up to 4 CS# bits. - * |[31:28] |ODTMSK |ODT Mask - * | | |Mask bit for each of the up to 4 ODT bits. - * @var DDRPHY_T::BISTMSKR1 - * Offset: 0x10C BIST Mask Register 1 (BISTMSKR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RASMSK |RAS Mask - * | | |Mask bit for the RAS. - * |[1] |CASMSK |CAS Mask - * | | |Mask bit for the CAS. - * |[27] |PARMSK |Mask bit for the PAR_IN - * | | |Only for DIMM parity support and only if the design is compiled for less than 3 ranks. - * |[31:28] |DMMSK |DM Mask - * | | |Mask bit for the data mask (DM) bit. - * @var DDRPHY_T::BISTMSKR2 - * Offset: 0x110 BIST Mask Register 2 (BISTMSKR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DQMSK |DQ Mask - * | | |Mask bit for each of the 8 data (DQ) bits. - * @var DDRPHY_T::BISTLSR - * Offset: 0x114 BIST LFSR Seed Register (BISTLSR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |LFSR seed - * | | |LFSR seed for pseudo-random BIST patterns. - * @var DDRPHY_T::BISTAR0 - * Offset: 0x118 BIST Address Register 0 (BISTAR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |BCOL |BIST Column Address - * | | |Selects the SDRAM column address to be used during BIST - * | | |The lower bits of this address must be "0000" for BL16, "000" for BL8, "00" for BL4 and "0" for BL2. - * |[27:12] |BROW |BIST Row Address - * | | |Selects the SDRAM row address to be used during BIST. - * |[30:28] |BBANK |BIST Bank Address - * | | |Selects the SDRAM bank address to be used during BIST. - * @var DDRPHY_T::BISTAR1 - * Offset: 0x11C BIST Address Register 1 (BISTAR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |BRANK |BIST Rank - * | | |Selects the SDRAM rank to be used during BIST. Valid values range from 0 to maximum ranks minus 1. - * |[3:2] |BMRANK |BIST Maximum Rank - * | | |Specifies the maximum SDRAM rank to be used during BIST - * | | |The default value is set to maximum ranks minus 1 - * | | |Example default shown here is for a 4-rank system - * |[15:4] |BAINC |BIST Address Increment - * | | |Selects the value by which the SDRAM address is incremented for each write/read access - * | | |This value must be at the beginning of a burst boundary, i.e - * | | |the lower bits must be "0000" for BL16, "000" for BL8, "00" for BL4 and "0" for BL2. - * @var DDRPHY_T::BISTAR2 - * Offset: 0x120 BIST Address Register 2 (BISTAR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |BMCOL |BIST Maximum Column Address - * | | |Specifies the maximum SDRAM column address to be used during BIST before the address increments to the next row. - * |[27:12] |BMROW |BIST Maximum Row Address - * | | |Specifies the maximum SDRAM row address to be used during BIST before the address increments to the next bank. - * |[30:28] |BMBANK |BIST Maximum Bank Address - * | | |Specifies the maximum SDRAM bank address to be used during BIST before the address increments to the next rank. - * @var DDRPHY_T::BISTUDPR - * Offset: 0x124 BIST User Data Pattern Register (BISTUDPR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |BUDP0 |BIST User Data Pattern 0 - * | | |Data to be applied on even DQ pins during BIST. - * |[31:16] |BUDP1 |BIST User Data Pattern 1 - * | | |Data to be applied on odd DQ pins during BIST. - * @var DDRPHY_T::BISTGSR - * Offset: 0x128 BIST General Status Register (BISTGSR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BDONE |BIST Done - * | | |Indicates, if set, that the BIST has finished executing - * | | |This bit is reset to zero when BIST is triggered. - * |[1] |BACERR |BIST Address/Command Error - * | | |indicates, if set, that there is a data comparison error in the address/command lane. - * |[2] |BDXERR |BIST Data Error - * | | |indicates, if set, that there is a data comparison error in the byte lane. - * |[17:16] |PARBER |PAR_IN Bit Error - * | | |Indicates the number of bit errors on PAR_IN - * |[27:20] |DMBER |DM Bit Error - * | | |Indicates the number of bit errors on data mask (DM) bit - * | | |DMBER[1:0] are for even DQS cycles first DM beat, and DMBER[3:2] are for even DQS cycles second DM beat - * | | |Similarly, DMBER[5:4] are for odd DQS cycles first DM beat, and DMBER[7:6] are for odd DQS cycles second DM beat. - * |[29:28] |RASBER |RAS Bit Error - * | | |Indicates the number of bit errors on RAS. - * |[31:30] |CASBER |CAS Bit Error - * | | |Indicates the number of bit errors on CAS. - * @var DDRPHY_T::BISTWER - * Offset: 0x12C BIST Word Error Register (BISTWER) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACWER |Address/Command Word Error - * | | |Indicates the number of word errors on the address/command lane - * | | |An error on any bit of the address/command bus increments the error count. - * |[31:16] |DXWER |Byte Word Error - * | | |Indicates the number of word errors on the byte lane - * | | |An error on any bit of the data bus including the data mask bit increments the error count. - * @var DDRPHY_T::BISTBER0 - * Offset: 0x130 BIST Bit Error Register 0 (BISTBER0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ABER |Address Bit Error - * | | |Each group of two bits indicate the bit error count on each of the up to 16 address bits - * | | |[1:0] is the error count for A[0], [3:2] for A[1], and so on. - * @var DDRPHY_T::BISTBER1 - * Offset: 0x134 BIST Bit Error Register 1 (BISTBER1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |BABER |Bank Address Bit Error - * | | |Each group of two bits indicate the bit error count on each of the up to 3 bank address bits - * | | |[1:0] is the error count for BA[0], [3:2] for BA[1], and so on. - * |[7:6] |WEBER |WE# Bit Error - * | | |Indicates the number of bit errors on WE#. - * |[15:8] |CKEBER |CKE Bit Error - * | | |Each group of two bits indicate the bit error count on each of the up to 4 CKE bits - * | | |[1:0] is the error count for CKE[0], [3:2] for CKE[1], and so on. - * |[23:16] |CSBER |CS# Bit Error - * | | |Each group of two bits indicate the bit error count on each of the up to 4 CS# bits - * | | |[1:0] is the error count for CS#[0], [3:2] for CS#[1], and so on. - * |[31:24] |ODTBER |ODT Bit Error - * | | |Each group of two bits indicates the bit error count on each of the up to 4 ODT bits - * | | |[1:0] is the error count for ODT[0], [3:2] for ODT[1], and so on. - * @var DDRPHY_T::BISTBER2 - * Offset: 0x138 BIST Bit Error Register 2 (BISTBER2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DQBER0 |Data Bit Error - * | | |The error count for even DQS cycles - * | | |The first 16 bits indicate the error count for the first data beat (i.e - * | | |the data driven out on DQ[7:0] on the rising edge of DQS) - * | | |The second 16 bits indicate the error on the second data beat (i.e - * | | |the error count of the data driven out on DQ[7:0] on the falling edge of DQS) - * | | |For each of the 16-bit group, the first 2 bits are for DQ[0], the second for DQ[1], and so on. - * @var DDRPHY_T::BISTBER3 - * Offset: 0x13C BIST Bit Error Register 3 (BISTBER3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DQBER1 |Data Bit Error - * | | |The error count for odd DQS cycles - * | | |The first 16 bits indicate the error count for the first data beat (i.e - * | | |the data driven out on DQ[7:0] on the rising edge of DQS) - * | | |The second 16 bits indicate the error on the second data beat (i.e - * | | |the error count of the data driven out on DQ[7:0] on the falling edge of DQS) - * | | |For each of the 16-bit group, the first 2 bits are for DQ[0], the second for DQ[1], and so on. - * @var DDRPHY_T::BISTWCSR - * Offset: 0x140 BIST Word Count Status Register (BISTWCSR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ACWCNT |Address/Command Word Count - * | | |Indicates the number of words received from the address/command lane. - * |[31:16] |DXWCNT |Byte Word Count - * | | |Indicates the number of words received from the byte lane. - * @var DDRPHY_T::BISTFWR0 - * Offset: 0x144 BIST Fail Word Register 0 (BISTFWR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |AWEBS |Address Word Error Bit Status - * | | |Bit status during a word error for each of the up to 16 address bits. - * |[18:16] |BAWEBS |Bank Address Word Error Bit Status - * | | |Bit status during a word error for each of the up to 3 bank address bits. - * |[19] |WEWEBS |WE Word Error Bit Status - * | | |Bit status during a word error for the WE#. - * |[23:20] |CKEWEBS |CKE Word Error Bit Status - * | | |Bit status during a word error for each of the up to 4 CKE bits. - * |[27:24] |CSWEBS |CS Word Error Bit Status - * | | |Bit status during a word error for each of the up to 4 CS# bits. - * |[31:28] |ODTWEBS |ODT Word Error Bit Status - * | | |Bit status during a word error for each of the up to 4 ODT bits. - * @var DDRPHY_T::BISTFWR1 - * Offset: 0x148 BIST Fail Word Register 1 (BISTFWR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RASWEBS |RAS Word Error Bit Status - * | | |Bit status during a word error for the RAS. - * |[1] |CASWEBS |CAS Word Error Bit Status - * | | |Bit status during a word error for the CAS. - * |[26] |PARWEBS |PAR_IN Word Error Bit Status - * | | |Bit status during a word error for the PAR_IN. Only for DIMM parity support - * |[31:28] |DMWEBS |DM Word Error Bit Status - * | | |Bit status during a word error for the data mask (DM) bit - * | | |DMWEBS [0] is for the first DM beat, DMWEBS [1] is for the second DM beat, and so on. - * @var DDRPHY_T::BISTFWR2 - * Offset: 0x14C BIST Fail Word Register 2 (BISTFWR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DQWEBS |DQ Word Error Bit Status - * | | |Bit status during a word error for each of the 8 data (DQ) bits - * | | |The first 8 bits indicate the status of the first data beat (i.e - * | | |the status of the data driven out on DQ[7:0] on the rising edge of DQS) - * | | |The second 8 bits indicate the status of the second data beat (i.e - * | | |the status of the data driven out on DQ[7:0] on the falling edge of DQS), and so on - * | | |For each of the 8-bit group, the first bit is for DQ[0], the second bit is for DQ[1], and so on. - * @var DDRPHY_T::AACR - * Offset: 0x174 Anti-Aging Control Register (AACR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[29:0] |AATR |Anti-Aging Toggle Rate - * | | |Defines the number of controller clock (ctl_clk) cycles after which the PUB will toggle the data going to DATX8 if the data channel between the controller/PUB and DATX8 has been idle for this long. - * | | |The default value corresponds to a toggling count of 4096 ctl_clk cycles - * | | |For a ctl_clk running at 533 MHz the toggle rate will be approximately 7.68us. - * | | |The default value may also be overridden by the macro - * | | |DWC_AACR_AATR_DFLT. - * |[30] |AAENC |Anti-Aging Enable Control - * | | |Enables, if set, the automatic toggling of the data going to the DATX8 when the data channel from the controller/PUB to DATX8 is idle for programmable number of clock cycles. - * |[31] |AAOENC |Anti-Aging PAD Output Enable Control - * | | |Enables, if set, anti-aging toggling on the pad output enable signal "ctl_oe_n" going into the DATX8s - * | | |This will increase power consumption for the anti-aging feature. - * @var DDRPHY_T::GPR0 - * Offset: 0x178 General Purpose Register 0 (GPR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |GPR0 |General Purpose Register 0 - * | | |General purpose register bits. - * @var DDRPHY_T::GPR1 - * Offset: 0x17C General Purpose Register 1 (GPR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |GPR1 |General Purpose Register 1 - * | | |General purpose register bits. - * @var DDRPHY_T::ZQ0CR0 - * Offset: 0x180 Impedance Control Register 0 (ZQnCR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZDATA |Impedance Over-Ride Data - * | | |Data used to directly drive the impedance control. - * | | |ZDATA field mapping for D3R I/O is as follows: - * | | |ZDATA[27:20] is reserved and returns zeros on reads. - * | | |ZDATA[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZDATA[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZDATA[9:5] is used to select the pull-up output impedance - * | | |ZDATA[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[28] |ZDEN |Impedance Over-Ride Enable - * | | |When this bit is set, it allows users to directly drive the impedance control using the data programmed in the ZDATA field - * | | |Otherwise, the control is generated automatically by the impedance control logic. - * |[29] |ZCALBYP |Impedance Calibration Bypass - * | | |Bypasses, if set, impedance calibration of this ZQ control block when impedance calibration is already in progress - * | | |Impedance calibration can be disabled prior to trigger by using the ZCALEN bit. - * |[30] |ZCALEN |Impedance Calibration Enable - * | | |Enables, if set, the impedance calibration of this ZQ control block when impedance calibration is triggered using either the ZCAL bit of PIR register or the DFI update interface. - * |[31] |ZQPD |ZQ Power Down - * | | |Powers down, if set, the PZQ cell. - * @var DDRPHY_T::ZQ0CR1 - * Offset: 0x184 Impedance Control Register 1 (ZQnCR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ZPROG |Impedance Divide Ratio - * | | |Selects the external resistor divide ratio to be used to set the output impedance and the on-die termination as follows: - * | | |ZPROG[7:4] = On-die termination divide select - * | | |ZPROG[3:0] = Output impedance divide select - * |[12] |DFICU0 |DFI Controller Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 0 (channel 0) requests an update. - * |[13] |DFICU1 |DFI Controller Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * |[14] |DFICCU |DFI Concurrent Controller Update Interface - * | | |Sets this impedance controller to be enabled for calibration when both of the DFI controller update interfaces request an update on the same clock - * | | |This provides the ability to enable impedance calibration updates for the Address/Command lane - * | | |Only valid in shared-AC mode. - * |[16] |DFIPU0 |DFI Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 0 (channel 0) requests an update. - * |[17] |DFIPU1 |DFI Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * @var DDRPHY_T::ZQ0SR0 - * Offset: 0x188 Impedance Status Register 0 (ZQnSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZCTRL |Impedance Control - * | | |Current value of impedance control. - * | | |ZCTRL field mapping for D3R I/O is as follows: - * | | |ZCTRL[27:20] is reserved and returns zeros on reads. - * | | |ZCTRL[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZCTRL[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZCTRL[9:5] is used to select the pull-up output impedance. - * | | |ZCTRL[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[30] |ZERR |Impedance Calibration Error - * | | |If set, indicates that there was an error during impedance calibration. - * |[31] |ZDONE |Impedance Calibration Done - * | | |Indicates that impedance calibration has completed. - * @var DDRPHY_T::ZQ0SR1 - * Offset: 0x18C Impedance Status Register 1 (ZQnSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPD |Output impedance pull-down calibration status - * | | |Valid status encodings are: - * | | |00 = Completed with no errors - * | | |01 = Overflow error - * | | |10 = Underflow error - * | | |11 = Calibration in progress - * |[3:2] |ZPU |Output impedance pull-up calibration status - * | | |Similar status encodings as ZPD. - * |[5:4] |OPD |On-die termination pull-down calibration status - * | | |Similar status encodings as ZPD. - * |[7:6] |OPU |On-die termination pull-up calibration status - * | | |Similar status encodings as ZPD. - * @var DDRPHY_T::ZQ1CR0 - * Offset: 0x190 Impedance Control Register 0 (ZQnCR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZDATA |Impedance Over-Ride Data - * | | |Data used to directly drive the impedance control. - * | | |ZDATA field mapping for D3R I/O is as follows: - * | | |ZDATA[27:20] is reserved and returns zeros on reads. - * | | |ZDATA[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZDATA[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZDATA[9:5] is used to select the pull-up output impedance - * | | |ZDATA[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[28] |ZDEN |Impedance Over-Ride Enable - * | | |When this bit is set, it allows users to directly drive the impedance control using the data programmed in the ZDATA field - * | | |Otherwise, the control is generated automatically by the impedance control logic. - * |[29] |ZCALBYP |Impedance Calibration Bypass - * | | |Bypasses, if set, impedance calibration of this ZQ control block when impedance calibration is already in progress - * | | |Impedance calibration can be disabled prior to trigger by using the ZCALEN bit. - * |[30] |ZCALEN |Impedance Calibration Enable - * | | |Enables, if set, the impedance calibration of this ZQ control block when impedance calibration is triggered using either the ZCAL bit of PIR register or the DFI update interface. - * |[31] |ZQPD |ZQ Power Down - * | | |Powers down, if set, the PZQ cell. - * @var DDRPHY_T::ZQ1CR1 - * Offset: 0x194 Impedance Control Register 1 (ZQnCR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ZPROG |Impedance Divide Ratio - * | | |Selects the external resistor divide ratio to be used to set the output impedance and the on-die termination as follows: - * | | |ZPROG[7:4] = On-die termination divide select - * | | |ZPROG[3:0] = Output impedance divide select - * |[12] |DFICU0 |DFI Controller Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 0 (channel 0) requests an update. - * |[13] |DFICU1 |DFI Controller Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * |[14] |DFICCU |DFI Concurrent Controller Update Interface - * | | |Sets this impedance controller to be enabled for calibration when both of the DFI controller update interfaces request an update on the same clock - * | | |This provides the ability to enable impedance calibration updates for the Address/Command lane - * | | |Only valid in shared-AC mode. - * |[16] |DFIPU0 |DFI Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 0 (channel 0) requests an update. - * |[17] |DFIPU1 |DFI Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * @var DDRPHY_T::ZQ1SR0 - * Offset: 0x198 Impedance Status Register 0 (ZQnSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZCTRL |Impedance Control - * | | |Current value of impedance control. - * | | |ZCTRL field mapping for D3R I/O is as follows: - * | | |ZCTRL[27:20] is reserved and returns zeros on reads. - * | | |ZCTRL[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZCTRL[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZCTRL[9:5] is used to select the pull-up output impedance. - * | | |ZCTRL[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[30] |ZERR |Impedance Calibration Error - * | | |If set, indicates that there was an error during impedance calibration. - * |[31] |ZDONE |Impedance Calibration Done - * | | |Indicates that impedance calibration has completed. - * @var DDRPHY_T::ZQ1SR1 - * Offset: 0x19C Impedance Status Register 1 (ZQnSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPD |Output impedance pull-down calibration status - * | | |Valid status encodings are: - * | | |00 = Completed with no errors - * | | |01 = Overflow error - * | | |10 = Underflow error - * | | |11 = Calibration in progress - * |[3:2] |ZPU |Output impedance pull-up calibration status - * | | |Similar status encodings as ZPD. - * |[5:4] |OPD |On-die termination pull-down calibration status - * | | |Similar status encodings as ZPD. - * |[7:6] |OPU |On-die termination pull-up calibration status - * | | |Similar status encodings as ZPD. - * @var DDRPHY_T::ZQ2CR0 - * Offset: 0x1A0 Impedance Control Register 0 (ZQnCR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZDATA |Impedance Over-Ride Data - * | | |Data used to directly drive the impedance control. - * | | |ZDATA field mapping for D3R I/O is as follows: - * | | |ZDATA[27:20] is reserved and returns zeros on reads. - * | | |ZDATA[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZDATA[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZDATA[9:5] is used to select the pull-up output impedance - * | | |ZDATA[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[28] |ZDEN |Impedance Over-Ride Enable - * | | |When this bit is set, it allows users to directly drive the impedance control using the data programmed in the ZDATA field - * | | |Otherwise, the control is generated automatically by the impedance control logic. - * |[29] |ZCALBYP |Impedance Calibration Bypass - * | | |Bypasses, if set, impedance calibration of this ZQ control block when impedance calibration is already in progress - * | | |Impedance calibration can be disabled prior to trigger by using the ZCALEN bit. - * |[30] |ZCALEN |Impedance Calibration Enable - * | | |Enables, if set, the impedance calibration of this ZQ control block when impedance calibration is triggered using either the ZCAL bit of PIR register or the DFI update interface. - * |[31] |ZQPD |ZQ Power Down - * | | |Powers down, if set, the PZQ cell. - * @var DDRPHY_T::ZQ2CR1 - * Offset: 0x1A4 Impedance Control Register 1 (ZQnCR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ZPROG |Impedance Divide Ratio - * | | |Selects the external resistor divide ratio to be used to set the output impedance and the on-die termination as follows: - * | | |ZPROG[7:4] = On-die termination divide select - * | | |ZPROG[3:0] = Output impedance divide select - * |[12] |DFICU0 |DFI Controller Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 0 (channel 0) requests an update. - * |[13] |DFICU1 |DFI Controller Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * |[14] |DFICCU |DFI Concurrent Controller Update Interface - * | | |Sets this impedance controller to be enabled for calibration when both of the DFI controller update interfaces request an update on the same clock - * | | |This provides the ability to enable impedance calibration updates for the Address/Command lane - * | | |Only valid in shared-AC mode. - * |[16] |DFIPU0 |DFI Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 0 (channel 0) requests an update. - * |[17] |DFIPU1 |DFI Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * @var DDRPHY_T::ZQ2SR0 - * Offset: 0x1A8 Impedance Status Register 0 (ZQnSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZCTRL |Impedance Control - * | | |Current value of impedance control. - * | | |ZCTRL field mapping for D3R I/O is as follows: - * | | |ZCTRL[27:20] is reserved and returns zeros on reads. - * | | |ZCTRL[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZCTRL[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZCTRL[9:5] is used to select the pull-up output impedance. - * | | |ZCTRL[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[30] |ZERR |Impedance Calibration Error - * | | |If set, indicates that there was an error during impedance calibration. - * |[31] |ZDONE |Impedance Calibration Done - * | | |Indicates that impedance calibration has completed. - * @var DDRPHY_T::ZQ2SR1 - * Offset: 0x1AC Impedance Status Register 1 (ZQnSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPD |Output impedance pull-down calibration status - * | | |Valid status encodings are: - * | | |00 = Completed with no errors - * | | |01 = Overflow error - * | | |10 = Underflow error - * | | |11 = Calibration in progress - * |[3:2] |ZPU |Output impedance pull-up calibration status - * | | |Similar status encodings as ZPD. - * |[5:4] |OPD |On-die termination pull-down calibration status - * | | |Similar status encodings as ZPD. - * |[7:6] |OPU |On-die termination pull-up calibration status - * | | |Similar status encodings as ZPD. - * @var DDRPHY_T::ZQ3CR0 - * Offset: 0x1B0 Impedance Control Register 0 (ZQnCR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZDATA |Impedance Over-Ride Data - * | | |Data used to directly drive the impedance control. - * | | |ZDATA field mapping for D3R I/O is as follows: - * | | |ZDATA[27:20] is reserved and returns zeros on reads. - * | | |ZDATA[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZDATA[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZDATA[9:5] is used to select the pull-up output impedance - * | | |ZDATA[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[28] |ZDEN |Impedance Over-Ride Enable - * | | |When this bit is set, it allows users to directly drive the impedance control using the data programmed in the ZDATA field - * | | |Otherwise, the control is generated automatically by the impedance control logic. - * |[29] |ZCALBYP |Impedance Calibration Bypass - * | | |Bypasses, if set, impedance calibration of this ZQ control block when impedance calibration is already in progress - * | | |Impedance calibration can be disabled prior to trigger by using the ZCALEN bit. - * |[30] |ZCALEN |Impedance Calibration Enable - * | | |Enables, if set, the impedance calibration of this ZQ control block when impedance calibration is triggered using either the ZCAL bit of PIR register or the DFI update interface. - * |[31] |ZQPD |ZQ Power Down - * | | |Powers down, if set, the PZQ cell. - * @var DDRPHY_T::ZQ3CR1 - * Offset: 0x1B4 Impedance Control Register 1 (ZQnCR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ZPROG |Impedance Divide Ratio - * | | |Selects the external resistor divide ratio to be used to set the output impedance and the on-die termination as follows: - * | | |ZPROG[7:4] = On-die termination divide select - * | | |ZPROG[3:0] = Output impedance divide select - * |[12] |DFICU0 |DFI Controller Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 0 (channel 0) requests an update. - * |[13] |DFICU1 |DFI Controller Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI controller update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * |[14] |DFICCU |DFI Concurrent Controller Update Interface - * | | |Sets this impedance controller to be enabled for calibration when both of the DFI controller update interfaces request an update on the same clock - * | | |This provides the ability to enable impedance calibration updates for the Address/Command lane - * | | |Only valid in shared-AC mode. - * |[16] |DFIPU0 |DFI Update Interface 0 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 0 (channel 0) requests an update. - * |[17] |DFIPU1 |DFI Update Interface 1 - * | | |Sets this impedance controller to be enabled for calibration when the DFI PHY update interface 1 (channel 1) requests an update - * | | |Only valid in shared-AC mode. - * @var DDRPHY_T::ZQ3SR0 - * Offset: 0x1B8 Impedance Status Register 0 (ZQnSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27:0] |ZCTRL |Impedance Control - * | | |Current value of impedance control. - * | | |ZCTRL field mapping for D3R I/O is as follows: - * | | |ZCTRL[27:20] is reserved and returns zeros on reads. - * | | |ZCTRL[19:15] is used to select the pull-up on-die termination impedance. - * | | |ZCTRL[14:10] is used to select the pull-down on-die termination impedance. - * | | |ZCTRL[9:5] is used to select the pull-up output impedance. - * | | |ZCTRL[4:0] is used to select the pull-down output impedance. - * | | |Note: The default value is 0x000014A for I/O type D3R. - * |[30] |ZERR |Impedance Calibration Error - * | | |If set, indicates that there was an error during impedance calibration. - * |[31] |ZDONE |Impedance Calibration Done - * | | |Indicates that impedance calibration has completed. - * @var DDRPHY_T::ZQ3SR1 - * Offset: 0x1BC Impedance Status Register 1 (ZQnSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPD |Output impedance pull-down calibration status - * | | |Valid status encodings are: - * | | |00 = Completed with no errors - * | | |01 = Overflow error - * | | |10 = Underflow error - * | | |11 = Calibration in progress - * |[3:2] |ZPU |Output impedance pull-up calibration status - * | | |Similar status encodings as ZPD. - * |[5:4] |OPD |On-die termination pull-down calibration status - * | | |Similar status encodings as ZPD. - * |[7:6] |OPU |On-die termination pull-up calibration status - * | | |Similar status encodings as ZPD. - * @var DDRPHY_T::DX0GCR - * Offset: 0x1C0 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to "0") when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX0GSR0 - * Offset: 0x1C4 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX0GSR1 - * Offset: 0x1C8 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX0BDLR0 - * Offset: 0x1CC DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX0BDLR1 - * Offset: 0x1D0 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX0BDLR2 - * Offset: 0x1D4 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX0BDLR3 - * Offset: 0x1D8 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX0BDLR4 - * Offset: 0x1DC DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX0LCDLR0 - * Offset: 0x1E0 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX0LCDLR1 - * Offset: 0x1E4 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDQD |Write Data Delay - * | | |Delay select for the write data (WDQ) LCDL - * |[15:8] |RDQSD |Read DQS Delay - * | | |Delay select for the read DQS (RDQS) LCDL - * |[23:16] |RDQSND |Read DQSN Delay - * | | |Delay select for the read DQSN (RDQS) LCDL - * @var DDRPHY_T::DX0LCDLR2 - * Offset: 0x1E8 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX0MDLR - * Offset: 0x1EC DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX0GTR - * Offset: 0x1F0 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX0GSR2 - * Offset: 0x1F4 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX1GCR - * Offset: 0x200 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX1GSR0 - * Offset: 0x204 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX1GSR1 - * Offset: 0x208 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX1BDLR0 - * Offset: 0x20C DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX1BDLR1 - * Offset: 0x210 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX1BDLR2 - * Offset: 0x214 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX1BDLR3 - * Offset: 0x218 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX1BDLR4 - * Offset: 0x21C DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX1LCDLR0 - * Offset: 0x220 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX1LCDLR1 - * Offset: 0x224 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDQD |Write Data Delay - * | | |Delay select for the write data (WDQ) LCDL - * |[15:8] |RDQSD |Read DQS Delay - * | | |Delay select for the read DQS (RDQS) LCDL - * |[23:16] |RDQSND |Read DQSN Delay - * | | |Delay select for the read DQSN (RDQS) LCDL - * @var DDRPHY_T::DX1LCDLR2 - * Offset: 0x228 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX1MDLR - * Offset: 0x22C DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX1GTR - * Offset: 0x230 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX1GSR2 - * Offset: 0x234 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX2GCR - * Offset: 0x240 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX2GSR0 - * Offset: 0x244 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX2GSR1 - * Offset: 0x248 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX2BDLR0 - * Offset: 0x24C DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX2BDLR1 - * Offset: 0x250 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX2BDLR2 - * Offset: 0x254 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX2BDLR3 - * Offset: 0x258 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX2BDLR4 - * Offset: 0x25C DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX2LCDLR0 - * Offset: 0x260 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX2LCDLR1 - * Offset: 0x264 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDQD |Write Data Delay - * | | |Delay select for the write data (WDQ) LCDL - * |[15:8] |RDQSD |Read DQS Delay - * | | |Delay select for the read DQS (RDQS) LCDL - * |[23:16] |RDQSND |Read DQSN Delay - * | | |Delay select for the read DQSN (RDQS) LCDL - * @var DDRPHY_T::DX2LCDLR2 - * Offset: 0x268 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX2MDLR - * Offset: 0x26C DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX2GTR - * Offset: 0x270 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX2GSR2 - * Offset: 0x274 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX3GCR - * Offset: 0x280 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX3GSR0 - * Offset: 0x284 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX3GSR1 - * Offset: 0x288 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX3BDLR0 - * Offset: 0x28C DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX3BDLR1 - * Offset: 0x290 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX3BDLR2 - * Offset: 0x294 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX3BDLR3 - * Offset: 0x298 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX3BDLR4 - * Offset: 0x29C DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX3LCDLR0 - * Offset: 0x2A0 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX3LCDLR1 - * Offset: 0x2A4 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDQD |Write Data Delay - * | | |Delay select for the write data (WDQ) LCDL - * |[15:8] |RDQSD |Read DQS Delay - * | | |Delay select for the read DQS (RDQS) LCDL - * |[23:16] |RDQSND |Read DQSN Delay - * | | |Delay select for the read DQSN (RDQS) LCDL - * @var DDRPHY_T::DX3LCDLR2 - * Offset: 0x2A8 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX3MDLR - * Offset: 0x2AC DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX3GTR - * Offset: 0x2B0 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX3GSR2 - * Offset: 0x2B4 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX4GCR - * Offset: 0x2C0 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX4GSR0 - * Offset: 0x2C4 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX4GSR1 - * Offset: 0x2C8 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX4BDLR0 - * Offset: 0x2CC DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX4BDLR1 - * Offset: 0x2D0 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX4BDLR2 - * Offset: 0x2D4 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX4BDLR3 - * Offset: 0x2D8 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX4BDLR4 - * Offset: 0x2DC DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX4LCDLR0 - * Offset: 0x2E0 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX4LCDLR1 - * Offset: 0x2E4 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var DDRPHY_T::DX4LCDLR2 - * Offset: 0x2E8 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX4MDLR - * Offset: 0x2EC DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX4GTR - * Offset: 0x2F0 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX4GSR2 - * Offset: 0x2F4 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX5GCR - * Offset: 0x300 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX5GSR0 - * Offset: 0x304 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX5GSR1 - * Offset: 0x308 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX5BDLR0 - * Offset: 0x30C DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX5BDLR1 - * Offset: 0x310 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX5BDLR2 - * Offset: 0x314 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX5BDLR3 - * Offset: 0x318 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX5BDLR4 - * Offset: 0x31C DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX5LCDLR0 - * Offset: 0x320 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX5LCDLR1 - * Offset: 0x324 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDQD |Write Data Delay - * | | |Delay select for the write data (WDQ) LCDL - * |[15:8] |RDQSD |Read DQS Delay - * | | |Delay select for the read DQS (RDQS) LCDL - * |[23:16] |RDQSND |Read DQSN Delay - * | | |Delay select for the read DQSN (RDQS) LCDL - * @var DDRPHY_T::DX5LCDLR2 - * Offset: 0x328 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX5MDLR - * Offset: 0x32C DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX5GTR - * Offset: 0x330 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX5GSR2 - * Offset: 0x334 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX6GCR - * Offset: 0x340 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX6GSR0 - * Offset: 0x344 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX6GSR1 - * Offset: 0x348 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX6BDLR0 - * Offset: 0x34C DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX6BDLR1 - * Offset: 0x350 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX6BDLR2 - * Offset: 0x354 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX6BDLR3 - * Offset: 0x358 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX6BDLR4 - * Offset: 0x35C DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX6LCDLR0 - * Offset: 0x360 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX6LCDLR1 - * Offset: 0x364 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var DDRPHY_T::DX6LCDLR2 - * Offset: 0x368 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX6MDLR - * Offset: 0x36C DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX6GTR - * Offset: 0x370 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX6GSR2 - * Offset: 0x374 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX7GCR - * Offset: 0x380 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX7GSR0 - * Offset: 0x384 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX7GSR1 - * Offset: 0x388 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX7BDLR0 - * Offset: 0x38C DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX7BDLR1 - * Offset: 0x390 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX7BDLR2 - * Offset: 0x394 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX7BDLR3 - * Offset: 0x398 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX7BDLR4 - * Offset: 0x39C DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX7LCDLR0 - * Offset: 0x3A0 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX7LCDLR1 - * Offset: 0x3A4 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDQD |Write Data Delay - * | | |Delay select for the write data (WDQ) LCDL - * |[15:8] |RDQSD |Read DQS Delay - * | | |Delay select for the read DQS (RDQS) LCDL - * |[23:16] |RDQSND |Read DQSN Delay - * | | |Delay select for the read DQSN (RDQS) LCDL - * @var DDRPHY_T::DX7LCDLR2 - * Offset: 0x3A8 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX7MDLR - * Offset: 0x3AC DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX7GTR - * Offset: 0x3B0 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX7GSR2 - * Offset: 0x3B4 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - * @var DDRPHY_T::DX8GCR - * Offset: 0x3C0 DATX8 General Configuration Register (DXnGCR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DXEN |Data Byte Enable - * | | |Enables, if set, the data byte - * | | |Setting this bit to '0' disables the byte, i.e - * | | |the byte is not used in PHY initialization or training and is ignored during SDRAM read/write operations. - * |[1] |DQSODT |DQS On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQS/DQS# pin of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[9] is '0'. - * |[2] |DQODT |Data On-Die Termination - * | | |Enables, when set, the on-die termination on the I/O for DQ and DM pins of the byte - * | | |This bit is ORed with the common DATX8 ODT configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: This bit is only valid when DXnGCR0[10] is '0'. - * |[3] |DXIOM |Data I/O Mode - * | | |Selects SSTL mode (when set to 0) or CMOS mode (when set to 1) of the I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the IOM configuration bit of the individual DATX8(see "DATX8 Common Configuration Register (DXCCR)"). - * |[4] |DXPDD |Data Power Down Driver - * | | |Powers down, when set, the output driver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDD configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * | | |Note: Asserting PDD puts the IO driver cell into a lower power, lower speed mode of operation - * | | |However, it will still drive if its OE is asserted - * | | |ODT will be disabled (if used) - * | | |Asserting PDD does not prevent the IO from driving. - * |[5] |DXPDR |Data Power Down Receiver - * | | |Powers down, when set, the input receiver on I/O for DQ, DM, and DQS/DQS# pins of the byte - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)"). - * |[6] |DQSRPD |DQSR Power Down - * | | |Powers down, if set, the PDQSR cell - * | | |This bit is ORed with the common PDR configuration bit (see "DATX8 Common Configuration Register (DXCCR)") - * |[8:7] |DSEN |Write DQS Enable - * | | |Controls whether the write DQS going to the SDRAM is enabled (toggling) or disabled (static value) and whether the DQS is inverted - * | | |DQS# is always the inversion of DQS - * | | |These values are valid only when DQS/DQS# output enable is on, otherwise the DQS/DQS# is tristated - * | | |Valid settings are: - * | | |00 = Reserved - * | | |01 = DQS toggling with normal polarity (This should be the default setting) - * | | |10 = Reserved - * | | |11 = Reserved - * |[9] |DQSRTT |DQS Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQS/DQS# SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[1] (DQSODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[10] |DQRTT |DQ Dynamic RTT Control - * | | |If set, the on die termination (ODT) control of the DQ/DM SSTL I/O is dynamically generated to enable the ODT during read operation and disabled otherwise - * | | |By setting this bit to '0' the dynamic ODT feature is disabled - * | | |To control ODT statically this bit must be set to '0' and DXnGCR0[2] (DQODT) is used to enable ODT (when set to '1') or disable ODT(when set to '0'). - * |[12:11] |RTTOH |RTT Output Hold - * | | |Indicates the number of clock cycles (from 0 to 3) after the read data postamble for which ODT control should remain set to DQSODT for DQS or DQODT for DQ/DM before disabling it (setting it to '0') when using dynamic ODT control - * | | |ODT is disabled almost RTTOH clock cycles after the read postamble. - * |[13] |RTTOAL |RTT On Additive Latency - * | | |Indicates when the ODT control of DQ/DQS SSTL I/Os is set to the value in DQODT/DQSODT during read cycles - * | | |Valid values are: - * | | |0 = ODT control is set to DQSODT/DQODT almost two cycles before read data preamble - * | | |1 = ODT control is set to DQSODT/DQODT almost one cycle before read data preamble - * |[15:14] |DXOEO |Data Byte Output Enable Override - * | | |Specifies whether the output I/O output enable for the byte lane should be set to a fixed value - * | | |Valid values are: - * | | |00 = No override. Output enable is controlled by DFI transactions - * | | |01 = Output enable is asserted (I/O is forced to output mode). - * | | |10 = Output enable is de-asserted (I/O is forced to input mode) - * | | |11 = Reserved - * |[16] |PLLRST |PLL Rest - * | | |Resets the byte PLL by driving the PLL reset pin - * | | |This bit is not self- clearing and a '0' must be written to de-assert the reset - * | | |This bit is ORed with the global PLLRST configuration bit. - * |[17] |PLLPD |PLL Power Down - * | | |Puts the byte PLL in Power-down mode by driving the PLL power down pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the power-down - * | | |This bit is ORed with the global PLLPD configuration bit. - * |[18] |GSHIFT |Gear Shift - * | | |Enables, if set, rapid locking mode on the byte PLL - * | | |This bit is ORed with the global GSHIFT configuration bit. - * |[19] |PLLBYP |PLL Bypass - * | | |Puts the byte PLL in bypass mode by driving the PLL bypass pin - * | | |This bit is not self-clearing and a '0' must be written to de-assert the bypass - * | | |This bit is ORed with the global BYP configuration bit. - * |[29:26] |WLRKEN |Write Level Rank Enable - * | | |Specifies the ranks that should be write leveled for this byte - * | | |Write leveling responses from ranks that are not enabled for write leveling for a particular byte are ignored and write leveling is flagged as done for these ranks - * | | |WLRKEN[0] enables rank 0, [1] enables rank 1, [2] enables rank 2, and [3] enables rank 3. - * |[30] |MDLEN |Master Delay Line Enable - * | | |Enables, if set, the DATX8 master delay line calibration to perform subsequent period measurements following the initial period measurements that are performed after reset or when calibration is manually triggered - * | | |These additional measurements are accumulated and filtered as long as this bit remains high - * | | |This bit is ANDed with the common DATX8 MDL enable bit. - * |[31] |CALBYP |Calibration Bypass - * | | |Prevents, if set, period measurement calibration from automatically triggering after PHY initialization. - * @var DDRPHY_T::DX8GSR0 - * Offset: 0x3C4 DATX8 General Status Registers 0 (DXnGSR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WDQCAL |Write DQ Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write DQ LCDL. - * |[1] |RDQSCAL |Read DQS Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS LCDL. - * |[2] |RDQSNCAL |Read DQS# Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS# LCDL. - * |[3] |GDQSCAL |Read DQS gating Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the read DQS gating LCDL. - * |[4] |WLCAL |Write Leveling Calibration - * | | |Indicates, if set, that the DATX8 has finished doing period measurement calibration for the write leveling slave delay line. - * |[5] |WLDONE |Write Leveling Done - * | | |Indicates, if set, that the DATX8 has completed write leveling. - * |[6] |WLERR |Write Leveling Error - * | | |Indicates, if set, that there is a write leveling error in the DATX8. - * |[14:7] |WLPRD |Write Leveling Period - * | | |Returns the DDR clock period measured by the write leveling LCDL during calibration - * | | |The measured period is used to generate the control of the write leveling pipeline which is a function of the write-leveling delay and the clock period - * | | |This value is PVT compensated. - * |[15] |DPLOCK |DATX8 PLL Lock - * | | |Indicates, if set, that the DATX8 PLL has locked. This is a direct status of the DATX8 PLL lock pin. - * |[23:16] |GDQSPRD |Read DQS gating Period - * | | |Returns the DDR clock period measured by the read DQS gating LCDL during calibration - * | | |This value is PVT compensated. - * |[27:24] |QSGERR |DQS Gate Training Error - * | | |Indicates, if set, that there is an error in DQS gate training. One bit for each of the up to 4 ranks. - * |[28] |WLDQ |Write Leveling DQ Status - * | | |Captures the write leveling DQ status from the DRAM during software write leveling. - * @var DDRPHY_T::DX8GSR1 - * Offset: 0x3C8 DATX8 General Status Registers 1 (DXnGSR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DLTDONE |Delay Line Test Done - * | | |Indicates, if set, that the PHY control block has finished doing period measurement of the DATX8 delay line digital test output. - * |[24:1] |DLTCODE |Delay Line Test Code - * | | |Returns the code measured by the PHY control block that corresponds to the period of the DATX8 delay line digital test output. - * @var DDRPHY_T::DX8BDLR0 - * Offset: 0x3CC DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0WBD |DQ0 Write Bit Delay - * | | |Delay select for the BDL on DQ0 write path. - * |[11:6] |DQ1WBD |DQ1 Write Bit Delay - * | | |Delay select for the BDL on DQ1 write path. - * |[17:12] |DQ2WBD |DQ2 Write Bit Delay - * | | |Delay select for the BDL on DQ2 write path. - * |[23:18] |DQ3WBD |DQ3 Write Bit Delay - * | | |Delay select for the BDL on DQ3 write path - * |[29:24] |DQ4WBD |DQ4 Write Bit Delay - * | | |Delay select for the BDL on DQ4 write path. - * @var DDRPHY_T::DX8BDLR1 - * Offset: 0x3D0 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5WBD |DQ5 Write Bit Delay - * | | |Delay select for the BDL on DQ5 write path. - * |[11:6] |DQ6WBD |DQ6 Write Bit Delay - * | | |Delay select for the BDL on DQ6 write path. - * |[17:12] |DQ7WBD |DQ7 Write Bit Delay - * | | |Delay select for the BDL on DQ7 write path. - * |[23:18] |DMWBD |DM Write Bit Delay - * | | |Delay select for the BDL on DM write path. - * |[29:24] |DSWBD |DQS Write Bit Delay - * | | |Delay select for the BDL on DQS write path - * @var DDRPHY_T::DX8BDLR2 - * Offset: 0x3D4 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DSOEBD |DQS Output Enable Bit Delay - * | | |Delay select for the BDL on DQS output enable path - * |[11:6] |DQOEBD |DQ Output Enable Bit Delay - * | | |Delay select for the BDL on DQ/DM output enable path. - * |[17:12] |DSRBD |DQS Read Bit Delay - * | | |Delay select for the BDL on DQS read path - * |[23:18] |DSNRBD |DQSN Read Bit Delay - * | | |Delay select for the BDL on DQSN read path - * @var DDRPHY_T::DX8BDLR3 - * Offset: 0x3D8 DATX8 Bit Delay Line Register 3 (DXnBDLR3) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ0RBD |DQ0 Read Bit Delay - * | | |Delay select for the BDL on DQ0 read path. - * |[11:6] |DQ1RBD |DQ1 Read Bit Delay - * | | |Delay select for the BDL on DQ1 read path. - * |[17:12] |DQ2RBD |DQ2 Read Bit Delay - * | | |Delay select for the BDL on DQ2 read path. - * |[23:18] |DQ3RBD |DQ3 Read Bit Delay - * | | |Delay select for the BDL on DQ3 read path - * |[29:24] |DQ4RBD |DQ4 Read Bit Delay - * | | |Delay select for the BDL on DQ4 read path. - * @var DDRPHY_T::DX8BDLR4 - * Offset: 0x3DC DATX8 Bit Delay Line Register 4 (DXnBDLR4) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |DQ5RBD |DQ5 Read Bit Delay - * | | |Delay select for the BDL on DQ5 read path. - * |[11:6] |DQ6RBD |DQ6 Read Bit Delay - * | | |Delay select for the BDL on DQ6 read path. - * |[17:12] |DQ7RBD |DQ7 Read Bit Delay - * | | |Delay select for the BDL on DQ7 read path. - * |[23:18] |DMRBD |DM Read Bit Delay - * | | |Delay select for the BDL on DM read path. - * @var DDRPHY_T::DX8LCDLR0 - * Offset: 0x3E0 DATX8 Bit Delay Line Register 0 (DXnBDLR0) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0WLD |Rank 0 Write Leveling Delay - * | | |Rank 0 delay select for the write leveling (WL) LCDL - * |[15:8] |R1WLD |Rank 1 Write Leveling Delay - * | | |Rank 1 delay select for the write leveling (WL) LCDL - * |[23:16] |R2WLD |Rank 2 Write Leveling Delay - * | | |Rank 2 delay select for the write leveling (WL) LCDL - * |[31:24] |R3WLD |Rank 3 Write Leveling Delay - * | | |Rank 3 delay select for the write leveling (WL) LCDL - * @var DDRPHY_T::DX8LCDLR1 - * Offset: 0x3E4 DATX8 Bit Delay Line Register 1 (DXnBDLR1) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |WDQD |Write Data Delay - * | | |Delay select for the write data (WDQ) LCDL - * |[15:8] |RDQSD |Read DQS Delay - * | | |Delay select for the read DQS (RDQS) LCDL - * |[23:16] |RDQSND |Read DQSN Delay - * | | |Delay select for the read DQSN (RDQS) LCDL - * @var DDRPHY_T::DX8LCDLR2 - * Offset: 0x3E8 DATX8 Bit Delay Line Register 2 (DXnBDLR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |R0DQSGD |Rank 0 Read DQS Gating Delay - * | | |Rank 0 delay select for the read DQS gating (DQSG) LCDL - * |[15:8] |R1DQSGD |Rank 1 Read DQS Gating Delay - * | | |Rank 1 delay select for the read DQS gating (DQSG) LCDL - * |[23:16] |R2DQSGD |Rank 2 Read DQS Gating Delay - * | | |Rank 2 delay select for the read DQS gating (DQSG) LCDL - * |[31:24] |R3DQSGD |Rank 3 Read DQS Gating Delay - * | | |Rank 3 delay select for the read DQS gating (DQSG) LCDL - * @var DDRPHY_T::DX8MDLR - * Offset: 0x3EC DATX8 Master Delay Line Register (DXnMDLR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |IPRD |Initial Period - * | | |Initial period measured by the master delay line calibration for VT drift compensation - * | | |This value is used as the denominator when calculating the ratios of updates during VT compensation. - * |[15:8] |TPRD |Target Period - * | | |Target period measured by the master delay line calibration for VT drift compensation - * | | |This is the current measured value of the period and is continuously updated if the MDL is enabled to do so. - * |[23:16] |MDLD |MDL Delay - * | | |Delay select for the LCDL for the Master Delay Line. - * @var DDRPHY_T::DX8GTR - * Offset: 0x3F0 DATX8 General Timing Register (DXnGTR) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |R0DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[5:3] |R1DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[8:6] |R2DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[11:9] |R3DGSL |Rank n DQS Gating System Latency - * | | |This is used to increase the number of clock cycles needed to expect valid DDR read data by up to seven extra clock cycles - * | | |This is used to compensate for board delays and other system delays - * | | |Power-up default is 000 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic DQS data training but these values can be overwritten by a direct write to this register - * | | |Every three bits of this register control the latency of each of the (up to) four ranks - * | | |R0DGSL controls the latency of rank 0, R1DGSL controls rank 1, and so on - * | | |Valid values are 0 to 7. - * |[13:12] |R0WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[15:14] |R1WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[17:16] |R2WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * |[19:18] |R3WLSL |Rank n Write Leveling System Latency - * | | |This is used to adjust the write latency after write leveling - * | | |Power-up default is 01 (i.e - * | | |no extra clock cycles required) - * | | |The SL fields are initially set by the PUB during automatic write leveling but these values can be overwritten by a direct write to this register - * | | |Every two bits of this register control the latency of each of the (up to) four ranks - * | | |R0WLSL controls the latency of rank 0, R1WLSL controls rank 1, and so on - * | | |Valid values: - * | | |00 = Write latency = WL - 1 - * | | |01 = Write latency = WL - * | | |10 = Write latency = WL + 1 - * | | |11 = Reserved - * @var DDRPHY_T::DX8GSR2 - * Offset: 0x3F4 DATX8 General Status Register 2 (DXnGSR2) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDERR |Read Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read bit deskew training. - * |[1] |RDWN |Read Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read bit deskew training. - * |[2] |WDERR |Write Bit Deskew Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write bit deskew training. - * |[3] |WDWN |Write Bit Deskew Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write bit deskew training. - * |[4] |REERR |Read Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the read data eye training. - * |[5] |REWN |Read Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the read data eye training. - * |[6] |WEERR |Write Data Eye Training Error - * | | |Indicates, if set, that the DATX8 has encountered an error during execution of the write data eye training. - * |[7] |WEWN |Write Data Eye Training Warning - * | | |Indicates, if set, that the DATX8 has encountered a warning during execution of the write data eye training. - * |[11:8] |ESTAT |Error Status - * | | |If an error occurred for this lane as indicated by RDERR, WDERR, REERR or WEERR the error status code can provide additional information regard when the error occurred during the algorithm execution. - */ - __I uint32_t RIDR; /*!< [0x0000] Revision Identification Register */ - __IO uint32_t PIR; /*!< [0x0004] PHY Initialization Register (PIR) */ - __IO uint32_t PGCR0; /*!< [0x0008] PHY General Configuration Registers 0 (PGCR0) */ - __IO uint32_t PGCR1; /*!< [0x000c] PHY General Configuration Registers 1 (PGCR1) */ - __I uint32_t PGSR0; /*!< [0x0010] PHY General Status Registers 0 (PGSR0) */ - __I uint32_t PGSR1; /*!< [0x0014] PHY General Status Registers 1 (PGSR1) */ - __IO uint32_t PLLCR; /*!< [0x0018] PLL Control Register (PLLCR) */ - __IO uint32_t PTR0; /*!< [0x001c] PHY Timing Registers 0 (PTR0) */ - __IO uint32_t PTR1; /*!< [0x0020] PHY Timing Registers 1 (PTR1) */ - __IO uint32_t PTR2; /*!< [0x0024] PHY Timing Registers 2 (PTR2) */ - __IO uint32_t PTR3; /*!< [0x0028] PHY Timing Registers 3 (PTR3) */ - __IO uint32_t PTR4; /*!< [0x002c] PHY Timing Registers 4 (PTR4) */ - __IO uint32_t ACMDLR; /*!< [0x0030] AC Master Delay Line Register (ACMDLR) */ - __IO uint32_t ACBDLR; /*!< [0x0034] AC Bit Delay Line Register (ACBDLR) */ - __IO uint32_t ACIOCR; /*!< [0x0038] AC I/O Configuration Register (ACIOCR) */ - __IO uint32_t DXCCR; /*!< [0x003c] DATX8 Common Configuration Register (DXCCR) */ - __IO uint32_t DSGCR; /*!< [0x0040] DDR System General Configuration Register (DSGCR) */ - __IO uint32_t DCR; /*!< [0x0044] DRAM Configuration Register (DCR) */ - __IO uint32_t DTPR0; /*!< [0x0048] DRAM Timing Parameters Register 0 (DTPR0) 105 */ - __IO uint32_t DTPR1; /*!< [0x004c] DRAM Timing Parameters Register 1 (DTPR1) */ - __IO uint32_t DTPR2; /*!< [0x0050] DRAM Timing Parameters Register 2 (DTPR2) */ - __IO uint32_t MR0; /*!< [0x0054] Mode Register 0 (MR0) */ - __IO uint32_t MR1; /*!< [0x0058] Mode Register 1 (MR1) */ - __IO uint32_t MR2; /*!< [0x005c] Mode Register 2/Extended Mode Register 2 (MR2/EMR2) */ - __IO uint32_t MR3; /*!< [0x0060] Mode Register 3 (MR3) */ - __IO uint32_t ODTCR; /*!< [0x0064] ODT Configuration Register (ODTCR) */ - __IO uint32_t DTCR; /*!< [0x0068] Data Training Configuration Register (DTCR) */ - __IO uint32_t DTAR0; /*!< [0x006c] Data Training Address Register 0 (DTAR0) */ - __IO uint32_t DTAR1; /*!< [0x0070] Data Training Address Register 1 (DTAR1) */ - __IO uint32_t DTAR2; /*!< [0x0074] Data Training Address Register 2 (DTAR2) */ - __IO uint32_t DTAR3; /*!< [0x0078] Data Training Address Register 3 (DTAR3) */ - __IO uint32_t DTDR0; /*!< [0x007c] Data Training Data Register 0 (DTDR0) */ - __IO uint32_t DTDR1; /*!< [0x0080] Data Training Data Register 1 (DTDR1) */ - __I uint32_t DTEDR0; /*!< [0x0084] Data Training Eye Data Register 0 (DTEDR0) */ - __I uint32_t DTEDR1; /*!< [0x0088] Data Training Eye Data Register 1 (DTEDR1) */ - __IO uint32_t PGCR2; /*!< [0x008c] PHY General Configuration Register 2 (PGCR2) */ - __I uint32_t RESERVE0[8]; - __I uint32_t RDIMMGCR0; /*!< [0x00b0] RDIMM General Configuration Register 0 (RDIMMGCR0) 123 */ - __I uint32_t RDIMMGCR1; /*!< [0x00b4] RDIMM General Configuration Register 1 (RDIMMGCR1) */ - __I uint32_t RDIMMCR0; /*!< [0x00b8] RDIMM Control Register 0 (RDIMMCR0) */ - __I uint32_t RDIMMCR1; /*!< [0x00bc] RDIMM Control Register 1 (RDIMMCR1) */ - __IO uint32_t DCUAR; /*!< [0x00c0] DCU Address Register (DCUAR) */ - __IO uint32_t DCUDR; /*!< [0x00c4] DCU Data Register (DCUDR) */ - __IO uint32_t DCURR; /*!< [0x00c8] DCU Run Register (DCURR) */ - __IO uint32_t DCULR; /*!< [0x00cc] DCU Loop Register (DCULR) */ - __IO uint32_t DCUGCR; /*!< [0x00d0] DCU General Configuration Register (DCUGCR) */ - __IO uint32_t DCUTPR; /*!< [0x00d4] DCU Timing Parameter Register (DCUTPR) */ - __I uint32_t DCUSR0; /*!< [0x00d8] DCU Status Register 0 (DCUSR0) */ - __I uint32_t DCUSR1; /*!< [0x00dc] DCU Status Register 1 (DCUSR1) */ - __I uint32_t RESERVE1[8]; - __IO uint32_t BISTRR; /*!< [0x0100] BIST Run Register (BISTRR) */ - __IO uint32_t BISTWCR; /*!< [0x0104] BIST Word Count Register (BISTWCR) */ - __IO uint32_t BISTMSKR0; /*!< [0x0108] BIST Mask Register 0 (BISTMSKR0) */ - __IO uint32_t BISTMSKR1; /*!< [0x010c] BIST Mask Register 1 (BISTMSKR1) */ - __IO uint32_t BISTMSKR2; /*!< [0x0110] BIST Mask Register 2 (BISTMSKR2) */ - __IO uint32_t BISTLSR; /*!< [0x0114] BIST LFSR Seed Register (BISTLSR) */ - __IO uint32_t BISTAR0; /*!< [0x0118] BIST Address Register 0 (BISTAR0) */ - __IO uint32_t BISTAR1; /*!< [0x011c] BIST Address Register 1 (BISTAR1) */ - __IO uint32_t BISTAR2; /*!< [0x0120] BIST Address Register 2 (BISTAR2) */ - __IO uint32_t BISTUDPR; /*!< [0x0124] BIST User Data Pattern Register (BISTUDPR) */ - __I uint32_t BISTGSR; /*!< [0x0128] BIST General Status Register (BISTGSR) */ - __I uint32_t BISTWER; /*!< [0x012c] BIST Word Error Register (BISTWER) */ - __I uint32_t BISTBER0; /*!< [0x0130] BIST Bit Error Register 0 (BISTBER0) */ - __I uint32_t BISTBER1; /*!< [0x0134] BIST Bit Error Register 1 (BISTBER1) */ - __I uint32_t BISTBER2; /*!< [0x0138] BIST Bit Error Register 2 (BISTBER2) */ - __I uint32_t BISTBER3; /*!< [0x013c] BIST Bit Error Register 3 (BISTBER3) */ - __I uint32_t BISTWCSR; /*!< [0x0140] BIST Word Count Status Register (BISTWCSR) */ - __I uint32_t BISTFWR0; /*!< [0x0144] BIST Fail Word Register 0 (BISTFWR0) */ - __I uint32_t BISTFWR1; /*!< [0x0148] BIST Fail Word Register 1 (BISTFWR1) */ - __I uint32_t BISTFWR2; /*!< [0x014c] BIST Fail Word Register 2 (BISTFWR2) */ - __I uint32_t RESERVE2[9]; - __IO uint32_t AACR; /*!< [0x0174] Anti-Aging Control Register (AACR) */ - __IO uint32_t GPR0; /*!< [0x0178] General Purpose Register 0 (GPR0) */ - __IO uint32_t GPR1; /*!< [0x017c] General Purpose Register 1 (GPR1) */ - __IO uint32_t ZQ0CR0; /*!< [0x0180] Impedance Control Register 0 (ZQnCR0) */ - __IO uint32_t ZQ0CR1; /*!< [0x0184] Impedance Control Register 1 (ZQnCR1) */ - __I uint32_t ZQ0SR0; /*!< [0x0188] Impedance Status Register 0 (ZQnSR0) */ - __I uint32_t ZQ0SR1; /*!< [0x018c] Impedance Status Register 1 (ZQnSR1) */ - __IO uint32_t ZQ1CR0; /*!< [0x0190] Impedance Control Register 0 (ZQnCR0) */ - __IO uint32_t ZQ1CR1; /*!< [0x0194] Impedance Control Register 1 (ZQnCR1) */ - __I uint32_t ZQ1SR0; /*!< [0x0198] Impedance Status Register 0 (ZQnSR0) */ - __I uint32_t ZQ1SR1; /*!< [0x019c] Impedance Status Register 1 (ZQnSR1) */ - __IO uint32_t ZQ2CR0; /*!< [0x01a0] Impedance Control Register 0 (ZQnCR0) */ - __IO uint32_t ZQ2CR1; /*!< [0x01a4] Impedance Control Register 1 (ZQnCR1) */ - __I uint32_t ZQ2SR0; /*!< [0x01a8] Impedance Status Register 0 (ZQnSR0) */ - __I uint32_t ZQ2SR1; /*!< [0x01ac] Impedance Status Register 1 (ZQnSR1) */ - __IO uint32_t ZQ3CR0; /*!< [0x01b0] Impedance Control Register 0 (ZQnCR0) */ - __IO uint32_t ZQ3CR1; /*!< [0x01b4] Impedance Control Register 1 (ZQnCR1) */ - __I uint32_t ZQ3SR0; /*!< [0x01b8] Impedance Status Register 0 (ZQnSR0) */ - __I uint32_t ZQ3SR1; /*!< [0x01bc] Impedance Status Register 1 (ZQnSR1) */ - __IO uint32_t DX0GCR; /*!< [0x01c0] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX0GSR0; /*!< [0x01c4] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX0GSR1; /*!< [0x01c8] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX0BDLR0; /*!< [0x01cc] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX0BDLR1; /*!< [0x01d0] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX0BDLR2; /*!< [0x01d4] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX0BDLR3; /*!< [0x01d8] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX0BDLR4; /*!< [0x01dc] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX0LCDLR0; /*!< [0x01e0] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX0LCDLR1; /*!< [0x01e4] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX0LCDLR2; /*!< [0x01e8] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX0MDLR; /*!< [0x01ec] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX0GTR; /*!< [0x01f0] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX0GSR2; /*!< [0x01f4] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE3[2]; - __IO uint32_t DX1GCR; /*!< [0x0200] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX1GSR0; /*!< [0x0204] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX1GSR1; /*!< [0x0208] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX1BDLR0; /*!< [0x020c] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX1BDLR1; /*!< [0x0210] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX1BDLR2; /*!< [0x0214] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX1BDLR3; /*!< [0x0218] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX1BDLR4; /*!< [0x021c] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX1LCDLR0; /*!< [0x0220] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX1LCDLR1; /*!< [0x0224] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX1LCDLR2; /*!< [0x0228] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX1MDLR; /*!< [0x022c] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX1GTR; /*!< [0x0230] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX1GSR2; /*!< [0x0234] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE4[2]; - __IO uint32_t DX2GCR; /*!< [0x0240] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX2GSR0; /*!< [0x0244] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX2GSR1; /*!< [0x0248] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX2BDLR0; /*!< [0x024c] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX2BDLR1; /*!< [0x0250] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX2BDLR2; /*!< [0x0254] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX2BDLR3; /*!< [0x0258] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX2BDLR4; /*!< [0x025c] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX2LCDLR0; /*!< [0x0260] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX2LCDLR1; /*!< [0x0264] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX2LCDLR2; /*!< [0x0268] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX2MDLR; /*!< [0x026c] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX2GTR; /*!< [0x0270] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX2GSR2; /*!< [0x0274] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE5[2]; - __IO uint32_t DX3GCR; /*!< [0x0280] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX3GSR0; /*!< [0x0284] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX3GSR1; /*!< [0x0288] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX3BDLR0; /*!< [0x028c] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX3BDLR1; /*!< [0x0290] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX3BDLR2; /*!< [0x0294] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX3BDLR3; /*!< [0x0298] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX3BDLR4; /*!< [0x029c] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX3LCDLR0; /*!< [0x02a0] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX3LCDLR1; /*!< [0x02a4] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX3LCDLR2; /*!< [0x02a8] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX3MDLR; /*!< [0x02ac] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX3GTR; /*!< [0x02b0] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX3GSR2; /*!< [0x02b4] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE6[2]; - __IO uint32_t DX4GCR; /*!< [0x02c0] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX4GSR0; /*!< [0x02c4] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX4GSR1; /*!< [0x02c8] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX4BDLR0; /*!< [0x02cc] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX4BDLR1; /*!< [0x02d0] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX4BDLR2; /*!< [0x02d4] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX4BDLR3; /*!< [0x02d8] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX4BDLR4; /*!< [0x02dc] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX4LCDLR0; /*!< [0x02e0] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX4LCDLR1; /*!< [0x02e4] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX4LCDLR2; /*!< [0x02e8] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX4MDLR; /*!< [0x02ec] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX4GTR; /*!< [0x02f0] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX4GSR2; /*!< [0x02f4] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE7[2]; - __IO uint32_t DX5GCR; /*!< [0x0300] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX5GSR0; /*!< [0x0304] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX5GSR1; /*!< [0x0308] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX5BDLR0; /*!< [0x030c] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX5BDLR1; /*!< [0x0310] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX5BDLR2; /*!< [0x0314] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX5BDLR3; /*!< [0x0318] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX5BDLR4; /*!< [0x031c] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX5LCDLR0; /*!< [0x0320] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX5LCDLR1; /*!< [0x0324] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX5LCDLR2; /*!< [0x0328] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX5MDLR; /*!< [0x032c] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX5GTR; /*!< [0x0330] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX5GSR2; /*!< [0x0334] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE8[2]; - __IO uint32_t DX6GCR; /*!< [0x0340] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX6GSR0; /*!< [0x0344] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX6GSR1; /*!< [0x0348] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX6BDLR0; /*!< [0x034c] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX6BDLR1; /*!< [0x0350] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX6BDLR2; /*!< [0x0354] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX6BDLR3; /*!< [0x0358] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX6BDLR4; /*!< [0x035c] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX6LCDLR0; /*!< [0x0360] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX6LCDLR1; /*!< [0x0364] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX6LCDLR2; /*!< [0x0368] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX6MDLR; /*!< [0x036c] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX6GTR; /*!< [0x0370] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX6GSR2; /*!< [0x0374] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE9[2]; - __IO uint32_t DX7GCR; /*!< [0x0380] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX7GSR0; /*!< [0x0384] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX7GSR1; /*!< [0x0388] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX7BDLR0; /*!< [0x038c] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX7BDLR1; /*!< [0x0390] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX7BDLR2; /*!< [0x0394] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX7BDLR3; /*!< [0x0398] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX7BDLR4; /*!< [0x039c] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX7LCDLR0; /*!< [0x03a0] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX7LCDLR1; /*!< [0x03a4] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX7LCDLR2; /*!< [0x03a8] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX7MDLR; /*!< [0x03ac] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX7GTR; /*!< [0x03b0] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX7GSR2; /*!< [0x03b4] DATX8 General Status Register 2 (DXnGSR2) */ - __I uint32_t RESERVE10[2]; - __IO uint32_t DX8GCR; /*!< [0x03c0] DATX8 General Configuration Register (DXnGCR) */ - __I uint32_t DX8GSR0; /*!< [0x03c4] DATX8 General Status Registers 0 (DXnGSR0) */ - __I uint32_t DX8GSR1; /*!< [0x03c8] DATX8 General Status Registers 1 (DXnGSR1) */ - __IO uint32_t DX8BDLR0; /*!< [0x03cc] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX8BDLR1; /*!< [0x03d0] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX8BDLR2; /*!< [0x03d4] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX8BDLR3; /*!< [0x03d8] DATX8 Bit Delay Line Register 3 (DXnBDLR3) */ - __IO uint32_t DX8BDLR4; /*!< [0x03dc] DATX8 Bit Delay Line Register 4 (DXnBDLR4) */ - __IO uint32_t DX8LCDLR0; /*!< [0x03e0] DATX8 Bit Delay Line Register 0 (DXnBDLR0) */ - __IO uint32_t DX8LCDLR1; /*!< [0x03e4] DATX8 Bit Delay Line Register 1 (DXnBDLR1) */ - __IO uint32_t DX8LCDLR2; /*!< [0x03e8] DATX8 Bit Delay Line Register 2 (DXnBDLR2) */ - __IO uint32_t DX8MDLR; /*!< [0x03ec] DATX8 Master Delay Line Register (DXnMDLR) */ - __IO uint32_t DX8GTR; /*!< [0x03f0] DATX8 General Timing Register (DXnGTR) */ - __IO uint32_t DX8GSR2; /*!< [0x03f4] DATX8 General Status Register 2 (DXnGSR2) */ - -} DDRPHY_T; - -/** - @addtogroup DDRPHY_CONST DDRPHY Bit Field Definition - Constant Definitions for DDRPHY Controller -@{ */ - -#define DDRPHY_RIDR_PUBMNR_Pos (0) /*!< DDRPHY_T::RIDR: PUBMNR Position */ -#define DDRPHY_RIDR_PUBMNR_Msk (0xful << DDRPHY_RIDR_PUBMNR_Pos) /*!< DDRPHY_T::RIDR: PUBMNR Mask */ - -#define DDRPHY_RIDR_PUBMDR_Pos (4) /*!< DDRPHY_T::RIDR: PUBMDR Position */ -#define DDRPHY_RIDR_PUBMDR_Msk (0xful << DDRPHY_RIDR_PUBMDR_Pos) /*!< DDRPHY_T::RIDR: PUBMDR Mask */ - -#define DDRPHY_RIDR_PUBMJR_Pos (8) /*!< DDRPHY_T::RIDR: PUBMJR Position */ -#define DDRPHY_RIDR_PUBMJR_Msk (0xful << DDRPHY_RIDR_PUBMJR_Pos) /*!< DDRPHY_T::RIDR: PUBMJR Mask */ - -#define DDRPHY_RIDR_PHYMNR_Pos (12) /*!< DDRPHY_T::RIDR: PHYMNR Position */ -#define DDRPHY_RIDR_PHYMNR_Msk (0xful << DDRPHY_RIDR_PHYMNR_Pos) /*!< DDRPHY_T::RIDR: PHYMNR Mask */ - -#define DDRPHY_RIDR_PHYMDR_Pos (16) /*!< DDRPHY_T::RIDR: PHYMDR Position */ -#define DDRPHY_RIDR_PHYMDR_Msk (0xful << DDRPHY_RIDR_PHYMDR_Pos) /*!< DDRPHY_T::RIDR: PHYMDR Mask */ - -#define DDRPHY_RIDR_PHYMJR_Pos (20) /*!< DDRPHY_T::RIDR: PHYMJR Position */ -#define DDRPHY_RIDR_PHYMJR_Msk (0xful << DDRPHY_RIDR_PHYMJR_Pos) /*!< DDRPHY_T::RIDR: PHYMJR Mask */ - -#define DDRPHY_RIDR_UDRID_Pos (24) /*!< DDRPHY_T::RIDR: UDRID Position */ -#define DDRPHY_RIDR_UDRID_Msk (0xfful << DDRPHY_RIDR_UDRID_Pos) /*!< DDRPHY_T::RIDR: UDRID Mask */ - -#define DDRPHY_PIR_INIT_Pos (0) /*!< DDRPHY_T::PIR: INIT Position */ -#define DDRPHY_PIR_INIT_Msk (0x1ul << DDRPHY_PIR_INIT_Pos) /*!< DDRPHY_T::PIR: INIT Mask */ - -#define DDRPHY_PIR_ZCAL_Pos (1) /*!< DDRPHY_T::PIR: ZCAL Position */ -#define DDRPHY_PIR_ZCAL_Msk (0x1ul << DDRPHY_PIR_ZCAL_Pos) /*!< DDRPHY_T::PIR: ZCAL Mask */ - -#define DDRPHY_PIR_PLLINIT_Pos (4) /*!< DDRPHY_T::PIR: PLLINIT Position */ -#define DDRPHY_PIR_PLLINIT_Msk (0x1ul << DDRPHY_PIR_PLLINIT_Pos) /*!< DDRPHY_T::PIR: PLLINIT Mask */ - -#define DDRPHY_PIR_DCAL_Pos (5) /*!< DDRPHY_T::PIR: DCAL Position */ -#define DDRPHY_PIR_DCAL_Msk (0x1ul << DDRPHY_PIR_DCAL_Pos) /*!< DDRPHY_T::PIR: DCAL Mask */ - -#define DDRPHY_PIR_PHYRST_Pos (6) /*!< DDRPHY_T::PIR: PHYRST Position */ -#define DDRPHY_PIR_PHYRST_Msk (0x1ul << DDRPHY_PIR_PHYRST_Pos) /*!< DDRPHY_T::PIR: PHYRST Mask */ - -#define DDRPHY_PIR_DRAMRST_Pos (7) /*!< DDRPHY_T::PIR: DRAMRST Position */ -#define DDRPHY_PIR_DRAMRST_Msk (0x1ul << DDRPHY_PIR_DRAMRST_Pos) /*!< DDRPHY_T::PIR: DRAMRST Mask */ - -#define DDRPHY_PIR_DRAMINIT_Pos (8) /*!< DDRPHY_T::PIR: DRAMINIT Position */ -#define DDRPHY_PIR_DRAMINIT_Msk (0x1ul << DDRPHY_PIR_DRAMINIT_Pos) /*!< DDRPHY_T::PIR: DRAMINIT Mask */ - -#define DDRPHY_PIR_WL_Pos (9) /*!< DDRPHY_T::PIR: WL Position */ -#define DDRPHY_PIR_WL_Msk (0x1ul << DDRPHY_PIR_WL_Pos) /*!< DDRPHY_T::PIR: WL Mask */ - -#define DDRPHY_PIR_QSGATE_Pos (10) /*!< DDRPHY_T::PIR: QSGATE Position */ -#define DDRPHY_PIR_QSGATE_Msk (0x1ul << DDRPHY_PIR_QSGATE_Pos) /*!< DDRPHY_T::PIR: QSGATE Mask */ - -#define DDRPHY_PIR_WLADJ_Pos (11) /*!< DDRPHY_T::PIR: WLADJ Position */ -#define DDRPHY_PIR_WLADJ_Msk (0x1ul << DDRPHY_PIR_WLADJ_Pos) /*!< DDRPHY_T::PIR: WLADJ Mask */ - -#define DDRPHY_PIR_RDDSKW_Pos (12) /*!< DDRPHY_T::PIR: RDDSKW Position */ -#define DDRPHY_PIR_RDDSKW_Msk (0x1ul << DDRPHY_PIR_RDDSKW_Pos) /*!< DDRPHY_T::PIR: RDDSKW Mask */ - -#define DDRPHY_PIR_WRDSKW_Pos (13) /*!< DDRPHY_T::PIR: WRDSKW Position */ -#define DDRPHY_PIR_WRDSKW_Msk (0x1ul << DDRPHY_PIR_WRDSKW_Pos) /*!< DDRPHY_T::PIR: WRDSKW Mask */ - -#define DDRPHY_PIR_RDEYE_Pos (14) /*!< DDRPHY_T::PIR: RDEYE Position */ -#define DDRPHY_PIR_RDEYE_Msk (0x1ul << DDRPHY_PIR_RDEYE_Pos) /*!< DDRPHY_T::PIR: RDEYE Mask */ - -#define DDRPHY_PIR_WREYE_Pos (15) /*!< DDRPHY_T::PIR: WREYE Position */ -#define DDRPHY_PIR_WREYE_Msk (0x1ul << DDRPHY_PIR_WREYE_Pos) /*!< DDRPHY_T::PIR: WREYE Mask */ - -#define DDRPHY_PIR_ICPC_Pos (16) /*!< DDRPHY_T::PIR: ICPC Position */ -#define DDRPHY_PIR_ICPC_Msk (0x1ul << DDRPHY_PIR_ICPC_Pos) /*!< DDRPHY_T::PIR: ICPC Mask */ - -#define DDRPHY_PIR_PLLBYP_Pos (17) /*!< DDRPHY_T::PIR: PLLBYP Position */ -#define DDRPHY_PIR_PLLBYP_Msk (0x1ul << DDRPHY_PIR_PLLBYP_Pos) /*!< DDRPHY_T::PIR: PLLBYP Mask */ - -#define DDRPHY_PIR_CTLDINIT_Pos (18) /*!< DDRPHY_T::PIR: CTLDINIT Position */ -#define DDRPHY_PIR_CTLDINIT_Msk (0x1ul << DDRPHY_PIR_CTLDINIT_Pos) /*!< DDRPHY_T::PIR: CTLDINIT Mask */ - -#define DDRPHY_PIR_RDIMMINIT_Pos (19) /*!< DDRPHY_T::PIR: RDIMMINIT Position */ -#define DDRPHY_PIR_RDIMMINIT_Msk (0x1ul << DDRPHY_PIR_RDIMMINIT_Pos) /*!< DDRPHY_T::PIR: RDIMMINIT Mask */ - -#define DDRPHY_PIR_CLRSR_Pos (27) /*!< DDRPHY_T::PIR: CLRSR Position */ -#define DDRPHY_PIR_CLRSR_Msk (0x1ul << DDRPHY_PIR_CLRSR_Pos) /*!< DDRPHY_T::PIR: CLRSR Mask */ - -#define DDRPHY_PIR_LOCKBYP_Pos (28) /*!< DDRPHY_T::PIR: LOCKBYP Position */ -#define DDRPHY_PIR_LOCKBYP_Msk (0x1ul << DDRPHY_PIR_LOCKBYP_Pos) /*!< DDRPHY_T::PIR: LOCKBYP Mask */ - -#define DDRPHY_PIR_DCALBYP_Pos (29) /*!< DDRPHY_T::PIR: DCALBYP Position */ -#define DDRPHY_PIR_DCALBYP_Msk (0x1ul << DDRPHY_PIR_DCALBYP_Pos) /*!< DDRPHY_T::PIR: DCALBYP Mask */ - -#define DDRPHY_PIR_ZCALBYP_Pos (30) /*!< DDRPHY_T::PIR: ZCALBYP Position */ -#define DDRPHY_PIR_ZCALBYP_Msk (0x1ul << DDRPHY_PIR_ZCALBYP_Pos) /*!< DDRPHY_T::PIR: ZCALBYP Mask */ - -#define DDRPHY_PIR_INITBYP_Pos (31) /*!< DDRPHY_T::PIR: INITBYP Position */ -#define DDRPHY_PIR_INITBYP_Msk (0x1ul << DDRPHY_PIR_INITBYP_Pos) /*!< DDRPHY_T::PIR: INITBYP Mask */ - -#define DDRPHY_PGCR0_WLLVT_Pos (0) /*!< DDRPHY_T::PGCR0: WLLVT Position */ -#define DDRPHY_PGCR0_WLLVT_Msk (0x1ul << DDRPHY_PGCR0_WLLVT_Pos) /*!< DDRPHY_T::PGCR0: WLLVT Mask */ - -#define DDRPHY_PGCR0_WDLVT_Pos (1) /*!< DDRPHY_T::PGCR0: WDLVT Position */ -#define DDRPHY_PGCR0_WDLVT_Msk (0x1ul << DDRPHY_PGCR0_WDLVT_Pos) /*!< DDRPHY_T::PGCR0: WDLVT Mask */ - -#define DDRPHY_PGCR0_RDLVT_Pos (2) /*!< DDRPHY_T::PGCR0: RDLVT Position */ -#define DDRPHY_PGCR0_RDLVT_Msk (0x1ul << DDRPHY_PGCR0_RDLVT_Pos) /*!< DDRPHY_T::PGCR0: RDLVT Mask */ - -#define DDRPHY_PGCR0_RGLVT_Pos (3) /*!< DDRPHY_T::PGCR0: RGLVT Position */ -#define DDRPHY_PGCR0_RGLVT_Msk (0x1ul << DDRPHY_PGCR0_RGLVT_Pos) /*!< DDRPHY_T::PGCR0: RGLVT Mask */ - -#define DDRPHY_PGCR0_WDBVT_Pos (4) /*!< DDRPHY_T::PGCR0: WDBVT Position */ -#define DDRPHY_PGCR0_WDBVT_Msk (0x1ul << DDRPHY_PGCR0_WDBVT_Pos) /*!< DDRPHY_T::PGCR0: WDBVT Mask */ - -#define DDRPHY_PGCR0_RDBVT_Pos (5) /*!< DDRPHY_T::PGCR0: RDBVT Position */ -#define DDRPHY_PGCR0_RDBVT_Msk (0x1ul << DDRPHY_PGCR0_RDBVT_Pos) /*!< DDRPHY_T::PGCR0: RDBVT Mask */ - -#define DDRPHY_PGCR0_DLTMODE_Pos (6) /*!< DDRPHY_T::PGCR0: DLTMODE Position */ -#define DDRPHY_PGCR0_DLTMODE_Msk (0x1ul << DDRPHY_PGCR0_DLTMODE_Pos) /*!< DDRPHY_T::PGCR0: DLTMODE Mask */ - -#define DDRPHY_PGCR0_DLTST_Pos (7) /*!< DDRPHY_T::PGCR0: DLTST Position */ -#define DDRPHY_PGCR0_DLTST_Msk (0x1ul << DDRPHY_PGCR0_DLTST_Pos) /*!< DDRPHY_T::PGCR0: DLTST Mask */ - -#define DDRPHY_PGCR0_OSCEN_Pos (8) /*!< DDRPHY_T::PGCR0: OSCEN Position */ -#define DDRPHY_PGCR0_OSCEN_Msk (0x1ul << DDRPHY_PGCR0_OSCEN_Pos) /*!< DDRPHY_T::PGCR0: OSCEN Mask */ - -#define DDRPHY_PGCR0_OSCDIV_Pos (9) /*!< DDRPHY_T::PGCR0: OSCDIV Position */ -#define DDRPHY_PGCR0_OSCDIV_Msk (0x7ul << DDRPHY_PGCR0_OSCDIV_Pos) /*!< DDRPHY_T::PGCR0: OSCDIV Mask */ - -#define DDRPHY_PGCR0_OSCWDL_Pos (12) /*!< DDRPHY_T::PGCR0: OSCWDL Position */ -#define DDRPHY_PGCR0_OSCWDL_Msk (0x3ul << DDRPHY_PGCR0_OSCWDL_Pos) /*!< DDRPHY_T::PGCR0: OSCWDL Mask */ - -#define DDRPHY_PGCR0_DTOSEL_Pos (14) /*!< DDRPHY_T::PGCR0: DTOSEL Position */ -#define DDRPHY_PGCR0_DTOSEL_Msk (0x1ful << DDRPHY_PGCR0_DTOSEL_Pos) /*!< DDRPHY_T::PGCR0: DTOSEL Mask */ - -#define DDRPHY_PGCR0_PUBMODE_Pos (25) /*!< DDRPHY_T::PGCR0: PUBMODE Position */ -#define DDRPHY_PGCR0_PUBMODE_Msk (0x1ul << DDRPHY_PGCR0_PUBMODE_Pos) /*!< DDRPHY_T::PGCR0: PUBMODE Mask */ - -#define DDRPHY_PGCR0_CKEN_Pos (26) /*!< DDRPHY_T::PGCR0: CKEN Position */ -#define DDRPHY_PGCR0_CKEN_Msk (0x3ful << DDRPHY_PGCR0_CKEN_Pos) /*!< DDRPHY_T::PGCR0: CKEN Mask */ - -#define DDRPHY_PGCR1_PDDISDX_Pos (0) /*!< DDRPHY_T::PGCR1: PDDISDX Position */ -#define DDRPHY_PGCR1_PDDISDX_Msk (0x1ul << DDRPHY_PGCR1_PDDISDX_Pos) /*!< DDRPHY_T::PGCR1: PDDISDX Mask */ - -#define DDRPHY_PGCR1_WLMODE_Pos (1) /*!< DDRPHY_T::PGCR1: WLMODE Position */ -#define DDRPHY_PGCR1_WLMODE_Msk (0x1ul << DDRPHY_PGCR1_WLMODE_Pos) /*!< DDRPHY_T::PGCR1: WLMODE Mask */ - -#define DDRPHY_PGCR1_WLSTEP_Pos (2) /*!< DDRPHY_T::PGCR1: WLSTEP Position */ -#define DDRPHY_PGCR1_WLSTEP_Msk (0x1ul << DDRPHY_PGCR1_WLSTEP_Pos) /*!< DDRPHY_T::PGCR1: WLSTEP Mask */ - -#define DDRPHY_PGCR1_WSLOPT_Pos (4) /*!< DDRPHY_T::PGCR1: WSLOPT Position */ -#define DDRPHY_PGCR1_WSLOPT_Msk (0x1ul << DDRPHY_PGCR1_WSLOPT_Pos) /*!< DDRPHY_T::PGCR1: WSLOPT Mask */ - -#define DDRPHY_PGCR1_ACHRST_Pos (5) /*!< DDRPHY_T::PGCR1: ACHRST Position */ -#define DDRPHY_PGCR1_ACHRST_Msk (0x1ul << DDRPHY_PGCR1_ACHRST_Pos) /*!< DDRPHY_T::PGCR1: ACHRST Mask */ - -#define DDRPHY_PGCR1_WLSELT_Pos (6) /*!< DDRPHY_T::PGCR1: WLSELT Position */ -#define DDRPHY_PGCR1_WLSELT_Msk (0x1ul << DDRPHY_PGCR1_WLSELT_Pos) /*!< DDRPHY_T::PGCR1: WLSELT Mask */ - -#define DDRPHY_PGCR1_IODDRM_Pos (7) /*!< DDRPHY_T::PGCR1: IODDRM Position */ -#define DDRPHY_PGCR1_IODDRM_Msk (0x3ul << DDRPHY_PGCR1_IODDRM_Pos) /*!< DDRPHY_T::PGCR1: IODDRM Mask */ - -#define DDRPHY_PGCR1_MDLEN_Pos (9) /*!< DDRPHY_T::PGCR1: MDLEN Position */ -#define DDRPHY_PGCR1_MDLEN_Msk (0x1ul << DDRPHY_PGCR1_MDLEN_Pos) /*!< DDRPHY_T::PGCR1: MDLEN Mask */ - -#define DDRPHY_PGCR1_LPFEN_Pos (10) /*!< DDRPHY_T::PGCR1: LPFEN Position */ -#define DDRPHY_PGCR1_LPFEN_Msk (0x1ul << DDRPHY_PGCR1_LPFEN_Pos) /*!< DDRPHY_T::PGCR1: LPFEN Mask */ - -#define DDRPHY_PGCR1_LPFDEPTH_Pos (11) /*!< DDRPHY_T::PGCR1: LPFDEPTH Position */ -#define DDRPHY_PGCR1_LPFDEPTH_Msk (0x3ul << DDRPHY_PGCR1_LPFDEPTH_Pos) /*!< DDRPHY_T::PGCR1: LPFDEPTH Mask */ - -#define DDRPHY_PGCR1_FDEPTH_Pos (13) /*!< DDRPHY_T::PGCR1: FDEPTH Position */ -#define DDRPHY_PGCR1_FDEPTH_Msk (0x3ul << DDRPHY_PGCR1_FDEPTH_Pos) /*!< DDRPHY_T::PGCR1: FDEPTH Mask */ - -#define DDRPHY_PGCR1_DLDLMT_Pos (15) /*!< DDRPHY_T::PGCR1: DLDLMT Position */ -#define DDRPHY_PGCR1_DLDLMT_Msk (0xfful << DDRPHY_PGCR1_DLDLMT_Pos) /*!< DDRPHY_T::PGCR1: DLDLMT Mask */ - -#define DDRPHY_PGCR1_ZCKSEL_Pos (23) /*!< DDRPHY_T::PGCR1: ZCKSEL Position */ -#define DDRPHY_PGCR1_ZCKSEL_Msk (0x3ul << DDRPHY_PGCR1_ZCKSEL_Pos) /*!< DDRPHY_T::PGCR1: ZCKSEL Mask */ - -#define DDRPHY_PGCR1_DXHRST_Pos (25) /*!< DDRPHY_T::PGCR1: DXHRST Position */ -#define DDRPHY_PGCR1_DXHRST_Msk (0x1ul << DDRPHY_PGCR1_DXHRST_Pos) /*!< DDRPHY_T::PGCR1: DXHRST Mask */ - -#define DDRPHY_PGCR1_INHVT_Pos (26) /*!< DDRPHY_T::PGCR1: INHVT Position */ -#define DDRPHY_PGCR1_INHVT_Msk (0x1ul << DDRPHY_PGCR1_INHVT_Pos) /*!< DDRPHY_T::PGCR1: INHVT Mask */ - -#define DDRPHY_PGCR1_IOLB_Pos (27) /*!< DDRPHY_T::PGCR1: IOLB Position */ -#define DDRPHY_PGCR1_IOLB_Msk (0x1ul << DDRPHY_PGCR1_IOLB_Pos) /*!< DDRPHY_T::PGCR1: IOLB Mask */ - -#define DDRPHY_PGCR1_LBDQSS_Pos (28) /*!< DDRPHY_T::PGCR1: LBDQSS Position */ -#define DDRPHY_PGCR1_LBDQSS_Msk (0x1ul << DDRPHY_PGCR1_LBDQSS_Pos) /*!< DDRPHY_T::PGCR1: LBDQSS Mask */ - -#define DDRPHY_PGCR1_LBGDQS_Pos (29) /*!< DDRPHY_T::PGCR1: LBGDQS Position */ -#define DDRPHY_PGCR1_LBGDQS_Msk (0x3ul << DDRPHY_PGCR1_LBGDQS_Pos) /*!< DDRPHY_T::PGCR1: LBGDQS Mask */ - -#define DDRPHY_PGCR1_LBMODE_Pos (31) /*!< DDRPHY_T::PGCR1: LBMODE Position */ -#define DDRPHY_PGCR1_LBMODE_Msk (0x1ul << DDRPHY_PGCR1_LBMODE_Pos) /*!< DDRPHY_T::PGCR1: LBMODE Mask */ - -#define DDRPHY_PGSR0_IDONE_Pos (0) /*!< DDRPHY_T::PGSR0: IDONE Position */ -#define DDRPHY_PGSR0_IDONE_Msk (0x1ul << DDRPHY_PGSR0_IDONE_Pos) /*!< DDRPHY_T::PGSR0: IDONE Mask */ - -#define DDRPHY_PGSR0_PLDONE_Pos (1) /*!< DDRPHY_T::PGSR0: PLDONE Position */ -#define DDRPHY_PGSR0_PLDONE_Msk (0x1ul << DDRPHY_PGSR0_PLDONE_Pos) /*!< DDRPHY_T::PGSR0: PLDONE Mask */ - -#define DDRPHY_PGSR0_DCDONE_Pos (2) /*!< DDRPHY_T::PGSR0: DCDONE Position */ -#define DDRPHY_PGSR0_DCDONE_Msk (0x1ul << DDRPHY_PGSR0_DCDONE_Pos) /*!< DDRPHY_T::PGSR0: DCDONE Mask */ - -#define DDRPHY_PGSR0_ZCDONE_Pos (3) /*!< DDRPHY_T::PGSR0: ZCDONE Position */ -#define DDRPHY_PGSR0_ZCDONE_Msk (0x1ul << DDRPHY_PGSR0_ZCDONE_Pos) /*!< DDRPHY_T::PGSR0: ZCDONE Mask */ - -#define DDRPHY_PGSR0_DIDONE_Pos (4) /*!< DDRPHY_T::PGSR0: DIDONE Position */ -#define DDRPHY_PGSR0_DIDONE_Msk (0x1ul << DDRPHY_PGSR0_DIDONE_Pos) /*!< DDRPHY_T::PGSR0: DIDONE Mask */ - -#define DDRPHY_PGSR0_WLDONE_Pos (5) /*!< DDRPHY_T::PGSR0: WLDONE Position */ -#define DDRPHY_PGSR0_WLDONE_Msk (0x1ul << DDRPHY_PGSR0_WLDONE_Pos) /*!< DDRPHY_T::PGSR0: WLDONE Mask */ - -#define DDRPHY_PGSR0_QSGDONE_Pos (6) /*!< DDRPHY_T::PGSR0: QSGDONE Position */ -#define DDRPHY_PGSR0_QSGDONE_Msk (0x1ul << DDRPHY_PGSR0_QSGDONE_Pos) /*!< DDRPHY_T::PGSR0: QSGDONE Mask */ - -#define DDRPHY_PGSR0_WLADONE_Pos (7) /*!< DDRPHY_T::PGSR0: WLADONE Position */ -#define DDRPHY_PGSR0_WLADONE_Msk (0x1ul << DDRPHY_PGSR0_WLADONE_Pos) /*!< DDRPHY_T::PGSR0: WLADONE Mask */ - -#define DDRPHY_PGSR0_RDDONE_Pos (8) /*!< DDRPHY_T::PGSR0: RDDONE Position */ -#define DDRPHY_PGSR0_RDDONE_Msk (0x1ul << DDRPHY_PGSR0_RDDONE_Pos) /*!< DDRPHY_T::PGSR0: RDDONE Mask */ - -#define DDRPHY_PGSR0_WDDONE_Pos (9) /*!< DDRPHY_T::PGSR0: WDDONE Position */ -#define DDRPHY_PGSR0_WDDONE_Msk (0x1ul << DDRPHY_PGSR0_WDDONE_Pos) /*!< DDRPHY_T::PGSR0: WDDONE Mask */ - -#define DDRPHY_PGSR0_REDONE_Pos (10) /*!< DDRPHY_T::PGSR0: REDONE Position */ -#define DDRPHY_PGSR0_REDONE_Msk (0x1ul << DDRPHY_PGSR0_REDONE_Pos) /*!< DDRPHY_T::PGSR0: REDONE Mask */ - -#define DDRPHY_PGSR0_WEDONE_Pos (11) /*!< DDRPHY_T::PGSR0: WEDONE Position */ -#define DDRPHY_PGSR0_WEDONE_Msk (0x1ul << DDRPHY_PGSR0_WEDONE_Pos) /*!< DDRPHY_T::PGSR0: WEDONE Mask */ - -#define DDRPHY_PGSR0_ZCERR_Pos (20) /*!< DDRPHY_T::PGSR0: ZCERR Position */ -#define DDRPHY_PGSR0_ZCERR_Msk (0x1ul << DDRPHY_PGSR0_ZCERR_Pos) /*!< DDRPHY_T::PGSR0: ZCERR Mask */ - -#define DDRPHY_PGSR0_WLERR_Pos (21) /*!< DDRPHY_T::PGSR0: WLERR Position */ -#define DDRPHY_PGSR0_WLERR_Msk (0x1ul << DDRPHY_PGSR0_WLERR_Pos) /*!< DDRPHY_T::PGSR0: WLERR Mask */ - -#define DDRPHY_PGSR0_QSGERR_Pos (22) /*!< DDRPHY_T::PGSR0: QSGERR Position */ -#define DDRPHY_PGSR0_QSGERR_Msk (0x1ul << DDRPHY_PGSR0_QSGERR_Pos) /*!< DDRPHY_T::PGSR0: QSGERR Mask */ - -#define DDRPHY_PGSR0_WLAERR_Pos (23) /*!< DDRPHY_T::PGSR0: WLAERR Position */ -#define DDRPHY_PGSR0_WLAERR_Msk (0x1ul << DDRPHY_PGSR0_WLAERR_Pos) /*!< DDRPHY_T::PGSR0: WLAERR Mask */ - -#define DDRPHY_PGSR0_RDERR_Pos (24) /*!< DDRPHY_T::PGSR0: RDERR Position */ -#define DDRPHY_PGSR0_RDERR_Msk (0x1ul << DDRPHY_PGSR0_RDERR_Pos) /*!< DDRPHY_T::PGSR0: RDERR Mask */ - -#define DDRPHY_PGSR0_WDERR_Pos (25) /*!< DDRPHY_T::PGSR0: WDERR Position */ -#define DDRPHY_PGSR0_WDERR_Msk (0x1ul << DDRPHY_PGSR0_WDERR_Pos) /*!< DDRPHY_T::PGSR0: WDERR Mask */ - -#define DDRPHY_PGSR0_REERR_Pos (26) /*!< DDRPHY_T::PGSR0: REERR Position */ -#define DDRPHY_PGSR0_REERR_Msk (0x1ul << DDRPHY_PGSR0_REERR_Pos) /*!< DDRPHY_T::PGSR0: REERR Mask */ - -#define DDRPHY_PGSR0_WEERR_Pos (27) /*!< DDRPHY_T::PGSR0: WEERR Position */ -#define DDRPHY_PGSR0_WEERR_Msk (0x1ul << DDRPHY_PGSR0_WEERR_Pos) /*!< DDRPHY_T::PGSR0: WEERR Mask */ - -#define DDRPHY_PGSR0_PLDONE_CHN_Pos (28) /*!< DDRPHY_T::PGSR0: PLDONE_CHN Position */ -#define DDRPHY_PGSR0_PLDONE_CHN_Msk (0x3ul << DDRPHY_PGSR0_PLDONE_CHN_Pos) /*!< DDRPHY_T::PGSR0: PLDONE_CHN Mask */ - -#define DDRPHY_PGSR0_APLOCK_Pos (31) /*!< DDRPHY_T::PGSR0: APLOCK Position */ -#define DDRPHY_PGSR0_APLOCK_Msk (0x1ul << DDRPHY_PGSR0_APLOCK_Pos) /*!< DDRPHY_T::PGSR0: APLOCK Mask */ - -#define DDRPHY_PGSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::PGSR1: DLTDONE Position */ -#define DDRPHY_PGSR1_DLTDONE_Msk (0x1ul << DDRPHY_PGSR1_DLTDONE_Pos) /*!< DDRPHY_T::PGSR1: DLTDONE Mask */ - -#define DDRPHY_PGSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::PGSR1: DLTCODE Position */ -#define DDRPHY_PGSR1_DLTCODE_Msk (0xfffffful << DDRPHY_PGSR1_DLTCODE_Pos) /*!< DDRPHY_T::PGSR1: DLTCODE Mask */ - -#define DDRPHY_PGSR1_VTSTOP_Pos (30) /*!< DDRPHY_T::PGSR1: VTSTOP Position */ -#define DDRPHY_PGSR1_VTSTOP_Msk (0x1ul << DDRPHY_PGSR1_VTSTOP_Pos) /*!< DDRPHY_T::PGSR1: VTSTOP Mask */ - -#define DDRPHY_PGSR1_PARERR_Pos (31) /*!< DDRPHY_T::PGSR1: PARERR Position */ -#define DDRPHY_PGSR1_PARERR_Msk (0x1ul << DDRPHY_PGSR1_PARERR_Pos) /*!< DDRPHY_T::PGSR1: PARERR Mask */ - -#define DDRPHY_PLLCR_DTC_Pos (0) /*!< DDRPHY_T::PLLCR: DTC Position */ -#define DDRPHY_PLLCR_DTC_Msk (0x3ul << DDRPHY_PLLCR_DTC_Pos) /*!< DDRPHY_T::PLLCR: DTC Mask */ - -#define DDRPHY_PLLCR_ATC_Pos (2) /*!< DDRPHY_T::PLLCR: ATC Position */ -#define DDRPHY_PLLCR_ATC_Msk (0xful << DDRPHY_PLLCR_ATC_Pos) /*!< DDRPHY_T::PLLCR: ATC Mask */ - -#define DDRPHY_PLLCR_ATOEN_Pos (6) /*!< DDRPHY_T::PLLCR: ATOEN Position */ -#define DDRPHY_PLLCR_ATOEN_Msk (0xful << DDRPHY_PLLCR_ATOEN_Pos) /*!< DDRPHY_T::PLLCR: ATOEN Mask */ - -#define DDRPHY_PLLCR_GSHIFT_Pos (10) /*!< DDRPHY_T::PLLCR: GSHIFT Position */ -#define DDRPHY_PLLCR_GSHIFT_Msk (0x1ul << DDRPHY_PLLCR_GSHIFT_Pos) /*!< DDRPHY_T::PLLCR: GSHIFT Mask */ - -#define DDRPHY_PLLCR_CPIC_Pos (11) /*!< DDRPHY_T::PLLCR: CPIC Position */ -#define DDRPHY_PLLCR_CPIC_Msk (0x3ul << DDRPHY_PLLCR_CPIC_Pos) /*!< DDRPHY_T::PLLCR: CPIC Mask */ - -#define DDRPHY_PLLCR_CPPC_Pos (13) /*!< DDRPHY_T::PLLCR: CPPC Position */ -#define DDRPHY_PLLCR_CPPC_Msk (0xful << DDRPHY_PLLCR_CPPC_Pos) /*!< DDRPHY_T::PLLCR: CPPC Mask */ - -#define DDRPHY_PLLCR_QPMODE_Pos (17) /*!< DDRPHY_T::PLLCR: QPMODE Position */ -#define DDRPHY_PLLCR_QPMODE_Msk (0x1ul << DDRPHY_PLLCR_QPMODE_Pos) /*!< DDRPHY_T::PLLCR: QPMODE Mask */ - -#define DDRPHY_PLLCR_FRQSEL_Pos (18) /*!< DDRPHY_T::PLLCR: FRQSEL Position */ -#define DDRPHY_PLLCR_FRQSEL_Msk (0x3ul << DDRPHY_PLLCR_FRQSEL_Pos) /*!< DDRPHY_T::PLLCR: FRQSEL Mask */ - -#define DDRPHY_PLLCR_PLLPD_Pos (29) /*!< DDRPHY_T::PLLCR: PLLPD Position */ -#define DDRPHY_PLLCR_PLLPD_Msk (0x1ul << DDRPHY_PLLCR_PLLPD_Pos) /*!< DDRPHY_T::PLLCR: PLLPD Mask */ - -#define DDRPHY_PLLCR_PLLRST_Pos (30) /*!< DDRPHY_T::PLLCR: PLLRST Position */ -#define DDRPHY_PLLCR_PLLRST_Msk (0x1ul << DDRPHY_PLLCR_PLLRST_Pos) /*!< DDRPHY_T::PLLCR: PLLRST Mask */ - -#define DDRPHY_PLLCR_BYP_Pos (31) /*!< DDRPHY_T::PLLCR: BYP Position */ -#define DDRPHY_PLLCR_BYP_Msk (0x1ul << DDRPHY_PLLCR_BYP_Pos) /*!< DDRPHY_T::PLLCR: BYP Mask */ - -#define DDRPHY_PTR0_tPHYRST_Pos (0) /*!< DDRPHY_T::PTR0: tPHYRST Position */ -#define DDRPHY_PTR0_tPHYRST_Msk (0x3ful << DDRPHY_PTR0_tPHYRST_Pos) /*!< DDRPHY_T::PTR0: tPHYRST Mask */ - -#define DDRPHY_PTR0_tPLLGS_Pos (6) /*!< DDRPHY_T::PTR0: tPLLGS Position */ -#define DDRPHY_PTR0_tPLLGS_Msk (0x7ffful << DDRPHY_PTR0_tPLLGS_Pos) /*!< DDRPHY_T::PTR0: tPLLGS Mask */ - -#define DDRPHY_PTR0_tPLLPD_Pos (21) /*!< DDRPHY_T::PTR0: tPLLPD Position */ -#define DDRPHY_PTR0_tPLLPD_Msk (0x7fful << DDRPHY_PTR0_tPLLPD_Pos) /*!< DDRPHY_T::PTR0: tPLLPD Mask */ - -#define DDRPHY_PTR1_tPLLRST_Pos (0) /*!< DDRPHY_T::PTR1: tPLLRST Position */ -#define DDRPHY_PTR1_tPLLRST_Msk (0x1ffful << DDRPHY_PTR1_tPLLRST_Pos) /*!< DDRPHY_T::PTR1: tPLLRST Mask */ - -#define DDRPHY_PTR1_tPLLLOCK_Pos (16) /*!< DDRPHY_T::PTR1: tPLLLOCK Position */ -#define DDRPHY_PTR1_tPLLLOCK_Msk (0xfffful << DDRPHY_PTR1_tPLLLOCK_Pos) /*!< DDRPHY_T::PTR1: tPLLLOCK Mask */ - -#define DDRPHY_PTR2_tCALON_Pos (0) /*!< DDRPHY_T::PTR2: tCALON Position */ -#define DDRPHY_PTR2_tCALON_Msk (0x1ful << DDRPHY_PTR2_tCALON_Pos) /*!< DDRPHY_T::PTR2: tCALON Mask */ - -#define DDRPHY_PTR2_tCALS_Pos (5) /*!< DDRPHY_T::PTR2: tCALS Position */ -#define DDRPHY_PTR2_tCALS_Msk (0x1ful << DDRPHY_PTR2_tCALS_Pos) /*!< DDRPHY_T::PTR2: tCALS Mask */ - -#define DDRPHY_PTR2_tCALH_Pos (10) /*!< DDRPHY_T::PTR2: tCALH Position */ -#define DDRPHY_PTR2_tCALH_Msk (0x1ful << DDRPHY_PTR2_tCALH_Pos) /*!< DDRPHY_T::PTR2: tCALH Mask */ - -#define DDRPHY_PTR2_tWLDLYS_Pos (15) /*!< DDRPHY_T::PTR2: tWLDLYS Position */ -#define DDRPHY_PTR2_tWLDLYS_Msk (0x1ful << DDRPHY_PTR2_tWLDLYS_Pos) /*!< DDRPHY_T::PTR2: tWLDLYS Mask */ - -#define DDRPHY_PTR3_tDINIT0_Pos (0) /*!< DDRPHY_T::PTR3: tDINIT0 Position */ -#define DDRPHY_PTR3_tDINIT0_Msk (0xffffful << DDRPHY_PTR3_tDINIT0_Pos) /*!< DDRPHY_T::PTR3: tDINIT0 Mask */ - -#define DDRPHY_PTR3_tDINIT1_Pos (20) /*!< DDRPHY_T::PTR3: tDINIT1 Position */ -#define DDRPHY_PTR3_tDINIT1_Msk (0x1fful << DDRPHY_PTR3_tDINIT1_Pos) /*!< DDRPHY_T::PTR3: tDINIT1 Mask */ - -#define DDRPHY_PTR4_tDINIT2_Pos (0) /*!< DDRPHY_T::PTR4: tDINIT2 Position */ -#define DDRPHY_PTR4_tDINIT2_Msk (0x3fffful << DDRPHY_PTR4_tDINIT2_Pos) /*!< DDRPHY_T::PTR4: tDINIT2 Mask */ - -#define DDRPHY_PTR4_tDINIT3_Pos (18) /*!< DDRPHY_T::PTR4: tDINIT3 Position */ -#define DDRPHY_PTR4_tDINIT3_Msk (0x3fful << DDRPHY_PTR4_tDINIT3_Pos) /*!< DDRPHY_T::PTR4: tDINIT3 Mask */ - -#define DDRPHY_ACMDLR_IPRD_Pos (0) /*!< DDRPHY_T::ACMDLR: IPRD Position */ -#define DDRPHY_ACMDLR_IPRD_Msk (0xfful << DDRPHY_ACMDLR_IPRD_Pos) /*!< DDRPHY_T::ACMDLR: IPRD Mask */ - -#define DDRPHY_ACMDLR_TPRD_Pos (8) /*!< DDRPHY_T::ACMDLR: TPRD Position */ -#define DDRPHY_ACMDLR_TPRD_Msk (0xfful << DDRPHY_ACMDLR_TPRD_Pos) /*!< DDRPHY_T::ACMDLR: TPRD Mask */ - -#define DDRPHY_ACMDLR_MDLD_Pos (16) /*!< DDRPHY_T::ACMDLR: MDLD Position */ -#define DDRPHY_ACMDLR_MDLD_Msk (0xfful << DDRPHY_ACMDLR_MDLD_Pos) /*!< DDRPHY_T::ACMDLR: MDLD Mask */ - -#define DDRPHY_ACBDLR_CK0BD_Pos (0) /*!< DDRPHY_T::ACBDLR: CK0BD Position */ -#define DDRPHY_ACBDLR_CK0BD_Msk (0x3ful << DDRPHY_ACBDLR_CK0BD_Pos) /*!< DDRPHY_T::ACBDLR: CK0BD Mask */ - -#define DDRPHY_ACBDLR_CK1BD_Pos (6) /*!< DDRPHY_T::ACBDLR: CK1BD Position */ -#define DDRPHY_ACBDLR_CK1BD_Msk (0x3ful << DDRPHY_ACBDLR_CK1BD_Pos) /*!< DDRPHY_T::ACBDLR: CK1BD Mask */ - -#define DDRPHY_ACBDLR_CK2BD_Pos (12) /*!< DDRPHY_T::ACBDLR: CK2BD Position */ -#define DDRPHY_ACBDLR_CK2BD_Msk (0x3ful << DDRPHY_ACBDLR_CK2BD_Pos) /*!< DDRPHY_T::ACBDLR: CK2BD Mask */ - -#define DDRPHY_ACBDLR_ACBD_Pos (18) /*!< DDRPHY_T::ACBDLR: ACBD Position */ -#define DDRPHY_ACBDLR_ACBD_Msk (0x3ful << DDRPHY_ACBDLR_ACBD_Pos) /*!< DDRPHY_T::ACBDLR: ACBD Mask */ - -#define DDRPHY_ACIOCR_ACIOM_Pos (0) /*!< DDRPHY_T::ACIOCR: ACIOM Position */ -#define DDRPHY_ACIOCR_ACIOM_Msk (0x1ul << DDRPHY_ACIOCR_ACIOM_Pos) /*!< DDRPHY_T::ACIOCR: ACIOM Mask */ - -#define DDRPHY_ACIOCR_ACOE_Pos (1) /*!< DDRPHY_T::ACIOCR: ACOE Position */ -#define DDRPHY_ACIOCR_ACOE_Msk (0x1ul << DDRPHY_ACIOCR_ACOE_Pos) /*!< DDRPHY_T::ACIOCR: ACOE Mask */ - -#define DDRPHY_ACIOCR_ACODT_Pos (2) /*!< DDRPHY_T::ACIOCR: ACODT Position */ -#define DDRPHY_ACIOCR_ACODT_Msk (0x1ul << DDRPHY_ACIOCR_ACODT_Pos) /*!< DDRPHY_T::ACIOCR: ACODT Mask */ - -#define DDRPHY_ACIOCR_ACPDD_Pos (3) /*!< DDRPHY_T::ACIOCR: ACPDD Position */ -#define DDRPHY_ACIOCR_ACPDD_Msk (0x1ul << DDRPHY_ACIOCR_ACPDD_Pos) /*!< DDRPHY_T::ACIOCR: ACPDD Mask */ - -#define DDRPHY_ACIOCR_ACPDR_Pos (4) /*!< DDRPHY_T::ACIOCR: ACPDR Position */ -#define DDRPHY_ACIOCR_ACPDR_Msk (0x1ul << DDRPHY_ACIOCR_ACPDR_Pos) /*!< DDRPHY_T::ACIOCR: ACPDR Mask */ - -#define DDRPHY_ACIOCR_CKODT_Pos (5) /*!< DDRPHY_T::ACIOCR: CKODT Position */ -#define DDRPHY_ACIOCR_CKODT_Msk (0x7ul << DDRPHY_ACIOCR_CKODT_Pos) /*!< DDRPHY_T::ACIOCR: CKODT Mask */ - -#define DDRPHY_ACIOCR_CKPDD_Pos (8) /*!< DDRPHY_T::ACIOCR: CKPDD Position */ -#define DDRPHY_ACIOCR_CKPDD_Msk (0x7ul << DDRPHY_ACIOCR_CKPDD_Pos) /*!< DDRPHY_T::ACIOCR: CKPDD Mask */ - -#define DDRPHY_ACIOCR_CKPDR_Pos (11) /*!< DDRPHY_T::ACIOCR: CKPDR Position */ -#define DDRPHY_ACIOCR_CKPDR_Msk (0x7ul << DDRPHY_ACIOCR_CKPDR_Pos) /*!< DDRPHY_T::ACIOCR: CKPDR Mask */ - -#define DDRPHY_ACIOCR_RANKODT_Pos (14) /*!< DDRPHY_T::ACIOCR: RANKODT Position */ -#define DDRPHY_ACIOCR_RANKODT_Msk (0xful << DDRPHY_ACIOCR_RANKODT_Pos) /*!< DDRPHY_T::ACIOCR: RANKODT Mask */ - -#define DDRPHY_ACIOCR_CSPDD_Pos (18) /*!< DDRPHY_T::ACIOCR: CSPDD Position */ -#define DDRPHY_ACIOCR_CSPDD_Msk (0xful << DDRPHY_ACIOCR_CSPDD_Pos) /*!< DDRPHY_T::ACIOCR: CSPDD Mask */ - -#define DDRPHY_ACIOCR_RANKPDR_Pos (22) /*!< DDRPHY_T::ACIOCR: RANKPDR Position */ -#define DDRPHY_ACIOCR_RANKPDR_Msk (0xful << DDRPHY_ACIOCR_RANKPDR_Pos) /*!< DDRPHY_T::ACIOCR: RANKPDR Mask */ - -#define DDRPHY_ACIOCR_RSTODT_Pos (26) /*!< DDRPHY_T::ACIOCR: RSTODT Position */ -#define DDRPHY_ACIOCR_RSTODT_Msk (0x1ul << DDRPHY_ACIOCR_RSTODT_Pos) /*!< DDRPHY_T::ACIOCR: RSTODT Mask */ - -#define DDRPHY_ACIOCR_RSTPDD_Pos (27) /*!< DDRPHY_T::ACIOCR: RSTPDD Position */ -#define DDRPHY_ACIOCR_RSTPDD_Msk (0x1ul << DDRPHY_ACIOCR_RSTPDD_Pos) /*!< DDRPHY_T::ACIOCR: RSTPDD Mask */ - -#define DDRPHY_ACIOCR_RSTPDR_Pos (28) /*!< DDRPHY_T::ACIOCR: RSTPDR Position */ -#define DDRPHY_ACIOCR_RSTPDR_Msk (0x1ul << DDRPHY_ACIOCR_RSTPDR_Pos) /*!< DDRPHY_T::ACIOCR: RSTPDR Mask */ - -#define DDRPHY_ACIOCR_RSTIOM_Pos (29) /*!< DDRPHY_T::ACIOCR: RSTIOM Position */ -#define DDRPHY_ACIOCR_RSTIOM_Msk (0x1ul << DDRPHY_ACIOCR_RSTIOM_Pos) /*!< DDRPHY_T::ACIOCR: RSTIOM Mask */ - -#define DDRPHY_ACIOCR_ACSR_Pos (30) /*!< DDRPHY_T::ACIOCR: ACSR Position */ -#define DDRPHY_ACIOCR_ACSR_Msk (0x3ul << DDRPHY_ACIOCR_ACSR_Pos) /*!< DDRPHY_T::ACIOCR: ACSR Mask */ - -#define DDRPHY_DXCCR_DXODT_Pos (0) /*!< DDRPHY_T::DXCCR: DXODT Position */ -#define DDRPHY_DXCCR_DXODT_Msk (0x1ul << DDRPHY_DXCCR_DXODT_Pos) /*!< DDRPHY_T::DXCCR: DXODT Mask */ - -#define DDRPHY_DXCCR_DXIOM_Pos (1) /*!< DDRPHY_T::DXCCR: DXIOM Position */ -#define DDRPHY_DXCCR_DXIOM_Msk (0x1ul << DDRPHY_DXCCR_DXIOM_Pos) /*!< DDRPHY_T::DXCCR: DXIOM Mask */ - -#define DDRPHY_DXCCR_MDLEN_Pos (2) /*!< DDRPHY_T::DXCCR: MDLEN Position */ -#define DDRPHY_DXCCR_MDLEN_Msk (0x1ul << DDRPHY_DXCCR_MDLEN_Pos) /*!< DDRPHY_T::DXCCR: MDLEN Mask */ - -#define DDRPHY_DXCCR_DXPDD_Pos (3) /*!< DDRPHY_T::DXCCR: DXPDD Position */ -#define DDRPHY_DXCCR_DXPDD_Msk (0x1ul << DDRPHY_DXCCR_DXPDD_Pos) /*!< DDRPHY_T::DXCCR: DXPDD Mask */ - -#define DDRPHY_DXCCR_DXPDR_Pos (4) /*!< DDRPHY_T::DXCCR: DXPDR Position */ -#define DDRPHY_DXCCR_DXPDR_Msk (0x1ul << DDRPHY_DXCCR_DXPDR_Pos) /*!< DDRPHY_T::DXCCR: DXPDR Mask */ - -#define DDRPHY_DXCCR_DQSRES_Pos (5) /*!< DDRPHY_T::DXCCR: DQSRES Position */ -#define DDRPHY_DXCCR_DQSRES_Msk (0xful << DDRPHY_DXCCR_DQSRES_Pos) /*!< DDRPHY_T::DXCCR: DQSRES Mask */ - -#define DDRPHY_DXCCR_DQSNRES_Pos (9) /*!< DDRPHY_T::DXCCR: DQSNRES Position */ -#define DDRPHY_DXCCR_DQSNRES_Msk (0xful << DDRPHY_DXCCR_DQSNRES_Pos) /*!< DDRPHY_T::DXCCR: DQSNRES Mask */ - -#define DDRPHY_DXCCR_DXSR_Pos (13) /*!< DDRPHY_T::DXCCR: DXSR Position */ -#define DDRPHY_DXCCR_DXSR_Msk (0x3ul << DDRPHY_DXCCR_DXSR_Pos) /*!< DDRPHY_T::DXCCR: DXSR Mask */ - -#define DDRPHY_DXCCR_MSBUDQ_Pos (15) /*!< DDRPHY_T::DXCCR: MSBUDQ Position */ -#define DDRPHY_DXCCR_MSBUDQ_Msk (0x7ul << DDRPHY_DXCCR_MSBUDQ_Pos) /*!< DDRPHY_T::DXCCR: MSBUDQ Mask */ - -#define DDRPHY_DXCCR_UDQODT_Pos (18) /*!< DDRPHY_T::DXCCR: UDQODT Position */ -#define DDRPHY_DXCCR_UDQODT_Msk (0x1ul << DDRPHY_DXCCR_UDQODT_Pos) /*!< DDRPHY_T::DXCCR: UDQODT Mask */ - -#define DDRPHY_DXCCR_UDQPDD_Pos (19) /*!< DDRPHY_T::DXCCR: UDQPDD Position */ -#define DDRPHY_DXCCR_UDQPDD_Msk (0x1ul << DDRPHY_DXCCR_UDQPDD_Pos) /*!< DDRPHY_T::DXCCR: UDQPDD Mask */ - -#define DDRPHY_DXCCR_UDQPDR_Pos (20) /*!< DDRPHY_T::DXCCR: UDQPDR Position */ -#define DDRPHY_DXCCR_UDQPDR_Msk (0x1ul << DDRPHY_DXCCR_UDQPDR_Pos) /*!< DDRPHY_T::DXCCR: UDQPDR Mask */ - -#define DDRPHY_DXCCR_UDQIOM_Pos (21) /*!< DDRPHY_T::DXCCR: UDQIOM Position */ -#define DDRPHY_DXCCR_UDQIOM_Msk (0x1ul << DDRPHY_DXCCR_UDQIOM_Pos) /*!< DDRPHY_T::DXCCR: UDQIOM Mask */ - -#define DDRPHY_DXCCR_DYNDXPDD_Pos (22) /*!< DDRPHY_T::DXCCR: DYNDXPDD Position */ -#define DDRPHY_DXCCR_DYNDXPDD_Msk (0x1ul << DDRPHY_DXCCR_DYNDXPDD_Pos) /*!< DDRPHY_T::DXCCR: DYNDXPDD Mask */ - -#define DDRPHY_DXCCR_DYNDXPDR_Pos (23) /*!< DDRPHY_T::DXCCR: DYNDXPDR Position */ -#define DDRPHY_DXCCR_DYNDXPDR_Msk (0x1ul << DDRPHY_DXCCR_DYNDXPDR_Pos) /*!< DDRPHY_T::DXCCR: DYNDXPDR Mask */ - -#define DDRPHY_DXCCR_DDPDDCDO_Pos (24) /*!< DDRPHY_T::DXCCR: DDPDDCDO Position */ -#define DDRPHY_DXCCR_DDPDDCDO_Msk (0xful << DDRPHY_DXCCR_DDPDDCDO_Pos) /*!< DDRPHY_T::DXCCR: DDPDDCDO Mask */ - -#define DDRPHY_DXCCR_DDPDRCDO_Pos (28) /*!< DDRPHY_T::DXCCR: DDPDRCDO Position */ -#define DDRPHY_DXCCR_DDPDRCDO_Msk (0xful << DDRPHY_DXCCR_DDPDRCDO_Pos) /*!< DDRPHY_T::DXCCR: DDPDRCDO Mask */ - -#define DDRPHY_DSGCR_PUREN_Pos (0) /*!< DDRPHY_T::DSGCR: PUREN Position */ -#define DDRPHY_DSGCR_PUREN_Msk (0x1ul << DDRPHY_DSGCR_PUREN_Pos) /*!< DDRPHY_T::DSGCR: PUREN Mask */ - -#define DDRPHY_DSGCR_BDISEN_Pos (1) /*!< DDRPHY_T::DSGCR: BDISEN Position */ -#define DDRPHY_DSGCR_BDISEN_Msk (0x1ul << DDRPHY_DSGCR_BDISEN_Pos) /*!< DDRPHY_T::DSGCR: BDISEN Mask */ - -#define DDRPHY_DSGCR_ZUEN_Pos (2) /*!< DDRPHY_T::DSGCR: ZUEN Position */ -#define DDRPHY_DSGCR_ZUEN_Msk (0x1ul << DDRPHY_DSGCR_ZUEN_Pos) /*!< DDRPHY_T::DSGCR: ZUEN Mask */ - -#define DDRPHY_DSGCR_LPIOPD_Pos (3) /*!< DDRPHY_T::DSGCR: LPIOPD Position */ -#define DDRPHY_DSGCR_LPIOPD_Msk (0x1ul << DDRPHY_DSGCR_LPIOPD_Pos) /*!< DDRPHY_T::DSGCR: LPIOPD Mask */ - -#define DDRPHY_DSGCR_LPPLLPD_Pos (4) /*!< DDRPHY_T::DSGCR: LPPLLPD Position */ -#define DDRPHY_DSGCR_LPPLLPD_Msk (0x1ul << DDRPHY_DSGCR_LPPLLPD_Pos) /*!< DDRPHY_T::DSGCR: LPPLLPD Mask */ - -#define DDRPHY_DSGCR_CUAEN_Pos (5) /*!< DDRPHY_T::DSGCR: CUAEN Position */ -#define DDRPHY_DSGCR_CUAEN_Msk (0x1ul << DDRPHY_DSGCR_CUAEN_Pos) /*!< DDRPHY_T::DSGCR: CUAEN Mask */ - -#define DDRPHY_DSGCR_DQSGX_Pos (6) /*!< DDRPHY_T::DSGCR: DQSGX Position */ -#define DDRPHY_DSGCR_DQSGX_Msk (0x1ul << DDRPHY_DSGCR_DQSGX_Pos) /*!< DDRPHY_T::DSGCR: DQSGX Mask */ - -#define DDRPHY_DSGCR_BRRMODE_Pos (7) /*!< DDRPHY_T::DSGCR: BRRMODE Position */ -#define DDRPHY_DSGCR_BRRMODE_Msk (0x1ul << DDRPHY_DSGCR_BRRMODE_Pos) /*!< DDRPHY_T::DSGCR: BRRMODE Mask */ - -#define DDRPHY_DSGCR_PUAD_Pos (8) /*!< DDRPHY_T::DSGCR: PUAD Position */ -#define DDRPHY_DSGCR_PUAD_Msk (0xful << DDRPHY_DSGCR_PUAD_Pos) /*!< DDRPHY_T::DSGCR: PUAD Mask */ - -#define DDRPHY_DSGCR_DTOODT_Pos (12) /*!< DDRPHY_T::DSGCR: DTOODT Position */ -#define DDRPHY_DSGCR_DTOODT_Msk (0x1ul << DDRPHY_DSGCR_DTOODT_Pos) /*!< DDRPHY_T::DSGCR: DTOODT Mask */ - -#define DDRPHY_DSGCR_DTOPDD_Pos (13) /*!< DDRPHY_T::DSGCR: DTOPDD Position */ -#define DDRPHY_DSGCR_DTOPDD_Msk (0x1ul << DDRPHY_DSGCR_DTOPDD_Pos) /*!< DDRPHY_T::DSGCR: DTOPDD Mask */ - -#define DDRPHY_DSGCR_DTOPDR_Pos (14) /*!< DDRPHY_T::DSGCR: DTOPDR Position */ -#define DDRPHY_DSGCR_DTOPDR_Msk (0x1ul << DDRPHY_DSGCR_DTOPDR_Pos) /*!< DDRPHY_T::DSGCR: DTOPDR Mask */ - -#define DDRPHY_DSGCR_DTOIOM_Pos (15) /*!< DDRPHY_T::DSGCR: DTOIOM Position */ -#define DDRPHY_DSGCR_DTOIOM_Msk (0x1ul << DDRPHY_DSGCR_DTOIOM_Pos) /*!< DDRPHY_T::DSGCR: DTOIOM Mask */ - -#define DDRPHY_DSGCR_DTOOE_Pos (16) /*!< DDRPHY_T::DSGCR: DTOOE Position */ -#define DDRPHY_DSGCR_DTOOE_Msk (0x1ul << DDRPHY_DSGCR_DTOOE_Pos) /*!< DDRPHY_T::DSGCR: DTOOE Mask */ - -#define DDRPHY_DSGCR_ATOAE_Pos (17) /*!< DDRPHY_T::DSGCR: ATOAE Position */ -#define DDRPHY_DSGCR_ATOAE_Msk (0x1ul << DDRPHY_DSGCR_ATOAE_Pos) /*!< DDRPHY_T::DSGCR: ATOAE Mask */ - -#define DDRPHY_DSGCR_RRMODE_Pos (18) /*!< DDRPHY_T::DSGCR: RRMODE Position */ -#define DDRPHY_DSGCR_RRMODE_Msk (0x1ul << DDRPHY_DSGCR_RRMODE_Pos) /*!< DDRPHY_T::DSGCR: RRMODE Mask */ - -#define DDRPHY_DSGCR_SDRMODE_Pos (19) /*!< DDRPHY_T::DSGCR: SDRMODE Position */ -#define DDRPHY_DSGCR_SDRMODE_Msk (0x1ul << DDRPHY_DSGCR_SDRMODE_Pos) /*!< DDRPHY_T::DSGCR: SDRMODE Mask */ - -#define DDRPHY_DSGCR_CKEPDD_Pos (20) /*!< DDRPHY_T::DSGCR: CKEPDD Position */ -#define DDRPHY_DSGCR_CKEPDD_Msk (0xful << DDRPHY_DSGCR_CKEPDD_Pos) /*!< DDRPHY_T::DSGCR: CKEPDD Mask */ - -#define DDRPHY_DSGCR_ODTPDD_Pos (24) /*!< DDRPHY_T::DSGCR: ODTPDD Position */ -#define DDRPHY_DSGCR_ODTPDD_Msk (0xful << DDRPHY_DSGCR_ODTPDD_Pos) /*!< DDRPHY_T::DSGCR: ODTPDD Mask */ - -#define DDRPHY_DSGCR_CKOE_Pos (28) /*!< DDRPHY_T::DSGCR: CKOE Position */ -#define DDRPHY_DSGCR_CKOE_Msk (0x1ul << DDRPHY_DSGCR_CKOE_Pos) /*!< DDRPHY_T::DSGCR: CKOE Mask */ - -#define DDRPHY_DSGCR_ODTOE_Pos (29) /*!< DDRPHY_T::DSGCR: ODTOE Position */ -#define DDRPHY_DSGCR_ODTOE_Msk (0x1ul << DDRPHY_DSGCR_ODTOE_Pos) /*!< DDRPHY_T::DSGCR: ODTOE Mask */ - -#define DDRPHY_DSGCR_RSTOE_Pos (30) /*!< DDRPHY_T::DSGCR: RSTOE Position */ -#define DDRPHY_DSGCR_RSTOE_Msk (0x1ul << DDRPHY_DSGCR_RSTOE_Pos) /*!< DDRPHY_T::DSGCR: RSTOE Mask */ - -#define DDRPHY_DSGCR_CKEOE_Pos (31) /*!< DDRPHY_T::DSGCR: CKEOE Position */ -#define DDRPHY_DSGCR_CKEOE_Msk (0x1ul << DDRPHY_DSGCR_CKEOE_Pos) /*!< DDRPHY_T::DSGCR: CKEOE Mask */ - -#define DDRPHY_DCR_DDRMD_Pos (0) /*!< DDRPHY_T::DCR: DDRMD Position */ -#define DDRPHY_DCR_DDRMD_Msk (0x7ul << DDRPHY_DCR_DDRMD_Pos) /*!< DDRPHY_T::DCR: DDRMD Mask */ - -#define DDRPHY_DCR_DDR8BNK_Pos (3) /*!< DDRPHY_T::DCR: DDR8BNK Position */ -#define DDRPHY_DCR_DDR8BNK_Msk (0x1ul << DDRPHY_DCR_DDR8BNK_Pos) /*!< DDRPHY_T::DCR: DDR8BNK Mask */ - -#define DDRPHY_DCR_PDQ_Pos (4) /*!< DDRPHY_T::DCR: PDQ Position */ -#define DDRPHY_DCR_PDQ_Msk (0x7ul << DDRPHY_DCR_PDQ_Pos) /*!< DDRPHY_T::DCR: PDQ Mask */ - -#define DDRPHY_DCR_MPRDQ_Pos (7) /*!< DDRPHY_T::DCR: MPRDQ Position */ -#define DDRPHY_DCR_MPRDQ_Msk (0x1ul << DDRPHY_DCR_MPRDQ_Pos) /*!< DDRPHY_T::DCR: MPRDQ Mask */ - -#define DDRPHY_DCR_BYTEMASK_Pos (10) /*!< DDRPHY_T::DCR: BYTEMASK Position */ -#define DDRPHY_DCR_BYTEMASK_Msk (0xfful << DDRPHY_DCR_BYTEMASK_Pos) /*!< DDRPHY_T::DCR: BYTEMASK Mask */ - -#define DDRPHY_DCR_NOSRA_Pos (27) /*!< DDRPHY_T::DCR: NOSRA Position */ -#define DDRPHY_DCR_NOSRA_Msk (0x1ul << DDRPHY_DCR_NOSRA_Pos) /*!< DDRPHY_T::DCR: NOSRA Mask */ - -#define DDRPHY_DCR_DDR2T_Pos (28) /*!< DDRPHY_T::DCR: DDR2T Position */ -#define DDRPHY_DCR_DDR2T_Msk (0x1ul << DDRPHY_DCR_DDR2T_Pos) /*!< DDRPHY_T::DCR: DDR2T Mask */ - -#define DDRPHY_DCR_UDIMM_Pos (29) /*!< DDRPHY_T::DCR: UDIMM Position */ -#define DDRPHY_DCR_UDIMM_Msk (0x1ul << DDRPHY_DCR_UDIMM_Pos) /*!< DDRPHY_T::DCR: UDIMM Mask */ - -#define DDRPHY_DTPR0_tRTP_Pos (0) /*!< DDRPHY_T::DTPR0: tRTP Position */ -#define DDRPHY_DTPR0_tRTP_Msk (0xful << DDRPHY_DTPR0_tRTP_Pos) /*!< DDRPHY_T::DTPR0: tRTP Mask */ - -#define DDRPHY_DTPR0_tWTR_Pos (4) /*!< DDRPHY_T::DTPR0: tWTR Position */ -#define DDRPHY_DTPR0_tWTR_Msk (0xful << DDRPHY_DTPR0_tWTR_Pos) /*!< DDRPHY_T::DTPR0: tWTR Mask */ - -#define DDRPHY_DTPR0_tRP_Pos (8) /*!< DDRPHY_T::DTPR0: tRP Position */ -#define DDRPHY_DTPR0_tRP_Msk (0xful << DDRPHY_DTPR0_tRP_Pos) /*!< DDRPHY_T::DTPR0: tRP Mask */ - -#define DDRPHY_DTPR0_tRCD_Pos (12) /*!< DDRPHY_T::DTPR0: tRCD Position */ -#define DDRPHY_DTPR0_tRCD_Msk (0xful << DDRPHY_DTPR0_tRCD_Pos) /*!< DDRPHY_T::DTPR0: tRCD Mask */ - -#define DDRPHY_DTPR0_tRAS_Pos (16) /*!< DDRPHY_T::DTPR0: tRAS Position */ -#define DDRPHY_DTPR0_tRAS_Msk (0x3ful << DDRPHY_DTPR0_tRAS_Pos) /*!< DDRPHY_T::DTPR0: tRAS Mask */ - -#define DDRPHY_DTPR0_tRRD_Pos (22) /*!< DDRPHY_T::DTPR0: tRRD Position */ -#define DDRPHY_DTPR0_tRRD_Msk (0xful << DDRPHY_DTPR0_tRRD_Pos) /*!< DDRPHY_T::DTPR0: tRRD Mask */ - -#define DDRPHY_DTPR0_tRC_Pos (26) /*!< DDRPHY_T::DTPR0: tRC Position */ -#define DDRPHY_DTPR0_tRC_Msk (0x3ful << DDRPHY_DTPR0_tRC_Pos) /*!< DDRPHY_T::DTPR0: tRC Mask */ - -#define DDRPHY_DTPR1_tMRD_Pos (0) /*!< DDRPHY_T::DTPR1: tMRD Position */ -#define DDRPHY_DTPR1_tMRD_Msk (0x3ul << DDRPHY_DTPR1_tMRD_Pos) /*!< DDRPHY_T::DTPR1: tMRD Mask */ - -#define DDRPHY_DTPR1_tMOD_Pos (2) /*!< DDRPHY_T::DTPR1: tMOD Position */ -#define DDRPHY_DTPR1_tMOD_Msk (0x7ul << DDRPHY_DTPR1_tMOD_Pos) /*!< DDRPHY_T::DTPR1: tMOD Mask */ - -#define DDRPHY_DTPR1_tFAW_Pos (5) /*!< DDRPHY_T::DTPR1: tFAW Position */ -#define DDRPHY_DTPR1_tFAW_Msk (0x3ful << DDRPHY_DTPR1_tFAW_Pos) /*!< DDRPHY_T::DTPR1: tFAW Mask */ - -#define DDRPHY_DTPR1_tRFC_Pos (11) /*!< DDRPHY_T::DTPR1: tRFC Position */ -#define DDRPHY_DTPR1_tRFC_Msk (0x1fful << DDRPHY_DTPR1_tRFC_Pos) /*!< DDRPHY_T::DTPR1: tRFC Mask */ - -#define DDRPHY_DTPR1_tWLMRD_Pos (20) /*!< DDRPHY_T::DTPR1: tWLMRD Position */ -#define DDRPHY_DTPR1_tWLMRD_Msk (0x3ful << DDRPHY_DTPR1_tWLMRD_Pos) /*!< DDRPHY_T::DTPR1: tWLMRD Mask */ - -#define DDRPHY_DTPR1_tWLO_Pos (26) /*!< DDRPHY_T::DTPR1: tWLO Position */ -#define DDRPHY_DTPR1_tWLO_Msk (0xful << DDRPHY_DTPR1_tWLO_Pos) /*!< DDRPHY_T::DTPR1: tWLO Mask */ - -#define DDRPHY_DTPR1_tAONDtAOFD_Pos (30) /*!< DDRPHY_T::DTPR1: tAONDtAOFD Position */ -#define DDRPHY_DTPR1_tAONDtAOFD_Msk (0x3ul << DDRPHY_DTPR1_tAONDtAOFD_Pos) /*!< DDRPHY_T::DTPR1: tAONDtAOFD Mask */ - -#define DDRPHY_DTPR2_tXS_Pos (0) /*!< DDRPHY_T::DTPR2: tXS Position */ -#define DDRPHY_DTPR2_tXS_Msk (0x3fful << DDRPHY_DTPR2_tXS_Pos) /*!< DDRPHY_T::DTPR2: tXS Mask */ - -#define DDRPHY_DTPR2_tXP_Pos (10) /*!< DDRPHY_T::DTPR2: tXP Position */ -#define DDRPHY_DTPR2_tXP_Msk (0x1ful << DDRPHY_DTPR2_tXP_Pos) /*!< DDRPHY_T::DTPR2: tXP Mask */ - -#define DDRPHY_DTPR2_tCKE_Pos (15) /*!< DDRPHY_T::DTPR2: tCKE Position */ -#define DDRPHY_DTPR2_tCKE_Msk (0xful << DDRPHY_DTPR2_tCKE_Pos) /*!< DDRPHY_T::DTPR2: tCKE Mask */ - -#define DDRPHY_DTPR2_tDLLK_Pos (19) /*!< DDRPHY_T::DTPR2: tDLLK Position */ -#define DDRPHY_DTPR2_tDLLK_Msk (0x3fful << DDRPHY_DTPR2_tDLLK_Pos) /*!< DDRPHY_T::DTPR2: tDLLK Mask */ - -#define DDRPHY_DTPR2_tRTODT_Pos (29) /*!< DDRPHY_T::DTPR2: tRTODT Position */ -#define DDRPHY_DTPR2_tRTODT_Msk (0x1ul << DDRPHY_DTPR2_tRTODT_Pos) /*!< DDRPHY_T::DTPR2: tRTODT Mask */ - -#define DDRPHY_DTPR2_tRTW_Pos (30) /*!< DDRPHY_T::DTPR2: tRTW Position */ -#define DDRPHY_DTPR2_tRTW_Msk (0x1ul << DDRPHY_DTPR2_tRTW_Pos) /*!< DDRPHY_T::DTPR2: tRTW Mask */ - -#define DDRPHY_DTPR2_tCCD_Pos (31) /*!< DDRPHY_T::DTPR2: tCCD Position */ -#define DDRPHY_DTPR2_tCCD_Msk (0x1ul << DDRPHY_DTPR2_tCCD_Pos) /*!< DDRPHY_T::DTPR2: tCCD Mask */ - -#define DDRPHY_MR0_BL_Pos (0) /*!< DDRPHY_T::MR0: BL Position */ -#define DDRPHY_MR0_BL_Msk (0x3ul << DDRPHY_MR0_BL_Pos) /*!< DDRPHY_T::MR0: BL Mask */ - -#define DDRPHY_MR0_CL0_Pos (2) /*!< DDRPHY_T::MR0: CL0 Position */ -#define DDRPHY_MR0_CL0_Msk (0x1ul << DDRPHY_MR0_CL0_Pos) /*!< DDRPHY_T::MR0: CL0 Mask */ - -#define DDRPHY_MR0_BT_Pos (3) /*!< DDRPHY_T::MR0: BT Position */ -#define DDRPHY_MR0_BT_Msk (0x1ul << DDRPHY_MR0_BT_Pos) /*!< DDRPHY_T::MR0: BT Mask */ - -#define DDRPHY_MR0_CL1_Pos (4) /*!< DDRPHY_T::MR0: CL1 Position */ -#define DDRPHY_MR0_CL1_Msk (0x7ul << DDRPHY_MR0_CL1_Pos) /*!< DDRPHY_T::MR0: CL1 Mask */ - -#define DDRPHY_MR0_TM_Pos (7) /*!< DDRPHY_T::MR0: TM Position */ -#define DDRPHY_MR0_TM_Msk (0x1ul << DDRPHY_MR0_TM_Pos) /*!< DDRPHY_T::MR0: TM Mask */ - -#define DDRPHY_MR0_DR_Pos (8) /*!< DDRPHY_T::MR0: DR Position */ -#define DDRPHY_MR0_DR_Msk (0x1ul << DDRPHY_MR0_DR_Pos) /*!< DDRPHY_T::MR0: DR Mask */ - -#define DDRPHY_MR0_WR_Pos (9) /*!< DDRPHY_T::MR0: WR Position */ -#define DDRPHY_MR0_WR_Msk (0x7ul << DDRPHY_MR0_WR_Pos) /*!< DDRPHY_T::MR0: WR Mask */ - -#define DDRPHY_MR0_PD_Pos (12) /*!< DDRPHY_T::MR0: PD Position */ -#define DDRPHY_MR0_PD_Msk (0x1ul << DDRPHY_MR0_PD_Pos) /*!< DDRPHY_T::MR0: PD Mask */ - -#define DDRPHY_MR1_DE_Pos (0) /*!< DDRPHY_T::MR1: DE Position */ -#define DDRPHY_MR1_DE_Msk (0x1ul << DDRPHY_MR1_DE_Pos) /*!< DDRPHY_T::MR1: DE Mask */ - -#define DDRPHY_MR1_DIC0_Pos (1) /*!< DDRPHY_T::MR1: DIC0 Position */ -#define DDRPHY_MR1_DIC0_Msk (0x1ul << DDRPHY_MR1_DIC0_Pos) /*!< DDRPHY_T::MR1: DIC0 Mask */ - -#define DDRPHY_MR1_RTT0_Pos (2) /*!< DDRPHY_T::MR1: RTT0 Position */ -#define DDRPHY_MR1_RTT0_Msk (0x1ul << DDRPHY_MR1_RTT0_Pos) /*!< DDRPHY_T::MR1: RTT0 Mask */ - -#define DDRPHY_MR1_AL_Pos (3) /*!< DDRPHY_T::MR1: AL Position */ -#define DDRPHY_MR1_AL_Msk (0x3ul << DDRPHY_MR1_AL_Pos) /*!< DDRPHY_T::MR1: AL Mask */ - -#define DDRPHY_MR1_DIC1_Pos (5) /*!< DDRPHY_T::MR1: DIC1 Position */ -#define DDRPHY_MR1_DIC1_Msk (0x1ul << DDRPHY_MR1_DIC1_Pos) /*!< DDRPHY_T::MR1: DIC1 Mask */ - -#define DDRPHY_MR1_RTT1_Pos (6) /*!< DDRPHY_T::MR1: RTT1 Position */ -#define DDRPHY_MR1_RTT1_Msk (0x1ul << DDRPHY_MR1_RTT1_Pos) /*!< DDRPHY_T::MR1: RTT1 Mask */ - -#define DDRPHY_MR1_LEVEL_Pos (7) /*!< DDRPHY_T::MR1: LEVEL Position */ -#define DDRPHY_MR1_LEVEL_Msk (0x1ul << DDRPHY_MR1_LEVEL_Pos) /*!< DDRPHY_T::MR1: LEVEL Mask */ - -#define DDRPHY_MR1_RTT2_Pos (9) /*!< DDRPHY_T::MR1: RTT2 Position */ -#define DDRPHY_MR1_RTT2_Msk (0x1ul << DDRPHY_MR1_RTT2_Pos) /*!< DDRPHY_T::MR1: RTT2 Mask */ - -#define DDRPHY_MR1_TDQS_Pos (11) /*!< DDRPHY_T::MR1: TDQS Position */ -#define DDRPHY_MR1_TDQS_Msk (0x1ul << DDRPHY_MR1_TDQS_Pos) /*!< DDRPHY_T::MR1: TDQS Mask */ - -#define DDRPHY_MR1_QOFF_Pos (12) /*!< DDRPHY_T::MR1: QOFF Position */ -#define DDRPHY_MR1_QOFF_Msk (0x1ul << DDRPHY_MR1_QOFF_Pos) /*!< DDRPHY_T::MR1: QOFF Mask */ - -#define DDRPHY_MR2_PASR_Pos (0) /*!< DDRPHY_T::MR2: PASR Position */ -#define DDRPHY_MR2_PASR_Msk (0x7ul << DDRPHY_MR2_PASR_Pos) /*!< DDRPHY_T::MR2: PASR Mask */ - -#define DDRPHY_MR2_CWL_Pos (3) /*!< DDRPHY_T::MR2: CWL Position */ -#define DDRPHY_MR2_CWL_Msk (0x7ul << DDRPHY_MR2_CWL_Pos) /*!< DDRPHY_T::MR2: CWL Mask */ - -#define DDRPHY_MR2_ASR_Pos (6) /*!< DDRPHY_T::MR2: ASR Position */ -#define DDRPHY_MR2_ASR_Msk (0x1ul << DDRPHY_MR2_ASR_Pos) /*!< DDRPHY_T::MR2: ASR Mask */ - -#define DDRPHY_MR2_SRT_Pos (7) /*!< DDRPHY_T::MR2: SRT Position */ -#define DDRPHY_MR2_SRT_Msk (0x1ul << DDRPHY_MR2_SRT_Pos) /*!< DDRPHY_T::MR2: SRT Mask */ - -#define DDRPHY_MR2_RTTWR_Pos (9) /*!< DDRPHY_T::MR2: RTTWR Position */ -#define DDRPHY_MR2_RTTWR_Msk (0x3ul << DDRPHY_MR2_RTTWR_Pos) /*!< DDRPHY_T::MR2: RTTWR Mask */ - -#define DDRPHY_MR3_MPRLOC_Pos (0) /*!< DDRPHY_T::MR3: MPRLOC Position */ -#define DDRPHY_MR3_MPRLOC_Msk (0x3ul << DDRPHY_MR3_MPRLOC_Pos) /*!< DDRPHY_T::MR3: MPRLOC Mask */ - -#define DDRPHY_MR3_MPR_Pos (2) /*!< DDRPHY_T::MR3: MPR Position */ -#define DDRPHY_MR3_MPR_Msk (0x1ul << DDRPHY_MR3_MPR_Pos) /*!< DDRPHY_T::MR3: MPR Mask */ - -#define DDRPHY_ODTCR_RDODT0_Pos (0) /*!< DDRPHY_T::ODTCR: RDODT0 Position */ -#define DDRPHY_ODTCR_RDODT0_Msk (0xful << DDRPHY_ODTCR_RDODT0_Pos) /*!< DDRPHY_T::ODTCR: RDODT0 Mask */ - -#define DDRPHY_ODTCR_RDODT1_Pos (4) /*!< DDRPHY_T::ODTCR: RDODT1 Position */ -#define DDRPHY_ODTCR_RDODT1_Msk (0xful << DDRPHY_ODTCR_RDODT1_Pos) /*!< DDRPHY_T::ODTCR: RDODT1 Mask */ - -#define DDRPHY_ODTCR_RDODT2_Pos (8) /*!< DDRPHY_T::ODTCR: RDODT2 Position */ -#define DDRPHY_ODTCR_RDODT2_Msk (0xful << DDRPHY_ODTCR_RDODT2_Pos) /*!< DDRPHY_T::ODTCR: RDODT2 Mask */ - -#define DDRPHY_ODTCR_RDODT3_Pos (12) /*!< DDRPHY_T::ODTCR: RDODT3 Position */ -#define DDRPHY_ODTCR_RDODT3_Msk (0xful << DDRPHY_ODTCR_RDODT3_Pos) /*!< DDRPHY_T::ODTCR: RDODT3 Mask */ - -#define DDRPHY_ODTCR_WRODT0_Pos (16) /*!< DDRPHY_T::ODTCR: WRODT0 Position */ -#define DDRPHY_ODTCR_WRODT0_Msk (0xful << DDRPHY_ODTCR_WRODT0_Pos) /*!< DDRPHY_T::ODTCR: WRODT0 Mask */ - -#define DDRPHY_ODTCR_WRODT1_Pos (20) /*!< DDRPHY_T::ODTCR: WRODT1 Position */ -#define DDRPHY_ODTCR_WRODT1_Msk (0xful << DDRPHY_ODTCR_WRODT1_Pos) /*!< DDRPHY_T::ODTCR: WRODT1 Mask */ - -#define DDRPHY_ODTCR_WRODT2_Pos (24) /*!< DDRPHY_T::ODTCR: WRODT2 Position */ -#define DDRPHY_ODTCR_WRODT2_Msk (0xful << DDRPHY_ODTCR_WRODT2_Pos) /*!< DDRPHY_T::ODTCR: WRODT2 Mask */ - -#define DDRPHY_ODTCR_WRODT3_Pos (28) /*!< DDRPHY_T::ODTCR: WRODT3 Position */ -#define DDRPHY_ODTCR_WRODT3_Msk (0xful << DDRPHY_ODTCR_WRODT3_Pos) /*!< DDRPHY_T::ODTCR: WRODT3 Mask */ - -#define DDRPHY_DTCR_DTCOL_Pos (0) /*!< DDRPHY_T::DTCR: DTCOL Position */ -#define DDRPHY_DTCR_DTCOL_Msk (0xffful << DDRPHY_DTCR_DTCOL_Pos) /*!< DDRPHY_T::DTCR: DTCOL Mask */ - -#define DDRPHY_DTCR_DTROW_Pos (12) /*!< DDRPHY_T::DTCR: DTROW Position */ -#define DDRPHY_DTCR_DTROW_Msk (0xfffful << DDRPHY_DTCR_DTROW_Pos) /*!< DDRPHY_T::DTCR: DTROW Mask */ - -#define DDRPHY_DTCR_DTBANK_Pos (28) /*!< DDRPHY_T::DTCR: DTBANK Position */ -#define DDRPHY_DTCR_DTBANK_Msk (0x7ul << DDRPHY_DTCR_DTBANK_Pos) /*!< DDRPHY_T::DTCR: DTBANK Mask */ - -#define DDRPHY_DTAR1_DTCOL_Pos (0) /*!< DDRPHY_T::DTAR1: DTCOL Position */ -#define DDRPHY_DTAR1_DTCOL_Msk (0xffful << DDRPHY_DTAR1_DTCOL_Pos) /*!< DDRPHY_T::DTAR1: DTCOL Mask */ - -#define DDRPHY_DTAR1_DTROW_Pos (12) /*!< DDRPHY_T::DTAR1: DTROW Position */ -#define DDRPHY_DTAR1_DTROW_Msk (0xfffful << DDRPHY_DTAR1_DTROW_Pos) /*!< DDRPHY_T::DTAR1: DTROW Mask */ - -#define DDRPHY_DTAR1_DTBANK_Pos (28) /*!< DDRPHY_T::DTAR1: DTBANK Position */ -#define DDRPHY_DTAR1_DTBANK_Msk (0x7ul << DDRPHY_DTAR1_DTBANK_Pos) /*!< DDRPHY_T::DTAR1: DTBANK Mask */ - -#define DDRPHY_DTAR2_DTCOL_Pos (0) /*!< DDRPHY_T::DTAR2: DTCOL Position */ -#define DDRPHY_DTAR2_DTCOL_Msk (0xffful << DDRPHY_DTAR2_DTCOL_Pos) /*!< DDRPHY_T::DTAR2: DTCOL Mask */ - -#define DDRPHY_DTAR2_DTROW_Pos (12) /*!< DDRPHY_T::DTAR2: DTROW Position */ -#define DDRPHY_DTAR2_DTROW_Msk (0xfffful << DDRPHY_DTAR2_DTROW_Pos) /*!< DDRPHY_T::DTAR2: DTROW Mask */ - -#define DDRPHY_DTAR2_DTBANK_Pos (28) /*!< DDRPHY_T::DTAR2: DTBANK Position */ -#define DDRPHY_DTAR2_DTBANK_Msk (0x7ul << DDRPHY_DTAR2_DTBANK_Pos) /*!< DDRPHY_T::DTAR2: DTBANK Mask */ - -#define DDRPHY_DTAR3_DTCOL_Pos (0) /*!< DDRPHY_T::DTAR3: DTCOL Position */ -#define DDRPHY_DTAR3_DTCOL_Msk (0xffful << DDRPHY_DTAR3_DTCOL_Pos) /*!< DDRPHY_T::DTAR3: DTCOL Mask */ - -#define DDRPHY_DTAR3_DTROW_Pos (12) /*!< DDRPHY_T::DTAR3: DTROW Position */ -#define DDRPHY_DTAR3_DTROW_Msk (0xfffful << DDRPHY_DTAR3_DTROW_Pos) /*!< DDRPHY_T::DTAR3: DTROW Mask */ - -#define DDRPHY_DTAR3_DTBANK_Pos (28) /*!< DDRPHY_T::DTAR3: DTBANK Position */ -#define DDRPHY_DTAR3_DTBANK_Msk (0x7ul << DDRPHY_DTAR3_DTBANK_Pos) /*!< DDRPHY_T::DTAR3: DTBANK Mask */ - -#define DDRPHY_DTDR0_DTBYTE1_Pos (0) /*!< DDRPHY_T::DTDR0: DTBYTE1 Position */ -#define DDRPHY_DTDR0_DTBYTE1_Msk (0xfful << DDRPHY_DTDR0_DTBYTE1_Pos) /*!< DDRPHY_T::DTDR0: DTBYTE1 Mask */ - -#define DDRPHY_DTDR0_DTBYTE0_Pos (8) /*!< DDRPHY_T::DTDR0: DTBYTE0 Position */ -#define DDRPHY_DTDR0_DTBYTE0_Msk (0xfful << DDRPHY_DTDR0_DTBYTE0_Pos) /*!< DDRPHY_T::DTDR0: DTBYTE0 Mask */ - -#define DDRPHY_DTDR0_DTBYTE2_Pos (16) /*!< DDRPHY_T::DTDR0: DTBYTE2 Position */ -#define DDRPHY_DTDR0_DTBYTE2_Msk (0xfful << DDRPHY_DTDR0_DTBYTE2_Pos) /*!< DDRPHY_T::DTDR0: DTBYTE2 Mask */ - -#define DDRPHY_DTDR0_DTBYTE3_Pos (24) /*!< DDRPHY_T::DTDR0: DTBYTE3 Position */ -#define DDRPHY_DTDR0_DTBYTE3_Msk (0xfful << DDRPHY_DTDR0_DTBYTE3_Pos) /*!< DDRPHY_T::DTDR0: DTBYTE3 Mask */ - -#define DDRPHY_DTDR1_DTBYTE4_Pos (0) /*!< DDRPHY_T::DTDR1: DTBYTE4 Position */ -#define DDRPHY_DTDR1_DTBYTE4_Msk (0xfful << DDRPHY_DTDR1_DTBYTE4_Pos) /*!< DDRPHY_T::DTDR1: DTBYTE4 Mask */ - -#define DDRPHY_DTDR1_DTBYTE5_Pos (8) /*!< DDRPHY_T::DTDR1: DTBYTE5 Position */ -#define DDRPHY_DTDR1_DTBYTE5_Msk (0xfful << DDRPHY_DTDR1_DTBYTE5_Pos) /*!< DDRPHY_T::DTDR1: DTBYTE5 Mask */ - -#define DDRPHY_DTDR1_DTBYTE6_Pos (16) /*!< DDRPHY_T::DTDR1: DTBYTE6 Position */ -#define DDRPHY_DTDR1_DTBYTE6_Msk (0xfful << DDRPHY_DTDR1_DTBYTE6_Pos) /*!< DDRPHY_T::DTDR1: DTBYTE6 Mask */ - -#define DDRPHY_DTDR1_DTBYTE7_Pos (24) /*!< DDRPHY_T::DTDR1: DTBYTE7 Position */ -#define DDRPHY_DTDR1_DTBYTE7_Msk (0xfful << DDRPHY_DTDR1_DTBYTE7_Pos) /*!< DDRPHY_T::DTDR1: DTBYTE7 Mask */ - -#define DDRPHY_DTEDR0_DTWLMN_Pos (0) /*!< DDRPHY_T::DTEDR0: DTWLMN Position */ -#define DDRPHY_DTEDR0_DTWLMN_Msk (0xfful << DDRPHY_DTEDR0_DTWLMN_Pos) /*!< DDRPHY_T::DTEDR0: DTWLMN Mask */ - -#define DDRPHY_DTEDR0_DTWLMX_Pos (8) /*!< DDRPHY_T::DTEDR0: DTWLMX Position */ -#define DDRPHY_DTEDR0_DTWLMX_Msk (0xfful << DDRPHY_DTEDR0_DTWLMX_Pos) /*!< DDRPHY_T::DTEDR0: DTWLMX Mask */ - -#define DDRPHY_DTEDR0_DTWBMN_Pos (16) /*!< DDRPHY_T::DTEDR0: DTWBMN Position */ -#define DDRPHY_DTEDR0_DTWBMN_Msk (0xfful << DDRPHY_DTEDR0_DTWBMN_Pos) /*!< DDRPHY_T::DTEDR0: DTWBMN Mask */ - -#define DDRPHY_DTEDR0_DTWBMX_Pos (24) /*!< DDRPHY_T::DTEDR0: DTWBMX Position */ -#define DDRPHY_DTEDR0_DTWBMX_Msk (0xfful << DDRPHY_DTEDR0_DTWBMX_Pos) /*!< DDRPHY_T::DTEDR0: DTWBMX Mask */ - -#define DDRPHY_DTEDR1_DTRLMN_Pos (0) /*!< DDRPHY_T::DTEDR1: DTRLMN Position */ -#define DDRPHY_DTEDR1_DTRLMN_Msk (0xfful << DDRPHY_DTEDR1_DTRLMN_Pos) /*!< DDRPHY_T::DTEDR1: DTRLMN Mask */ - -#define DDRPHY_DTEDR1_DTRLMX_Pos (8) /*!< DDRPHY_T::DTEDR1: DTRLMX Position */ -#define DDRPHY_DTEDR1_DTRLMX_Msk (0xfful << DDRPHY_DTEDR1_DTRLMX_Pos) /*!< DDRPHY_T::DTEDR1: DTRLMX Mask */ - -#define DDRPHY_DTEDR1_DTRBMN_Pos (16) /*!< DDRPHY_T::DTEDR1: DTRBMN Position */ -#define DDRPHY_DTEDR1_DTRBMN_Msk (0xfful << DDRPHY_DTEDR1_DTRBMN_Pos) /*!< DDRPHY_T::DTEDR1: DTRBMN Mask */ - -#define DDRPHY_DTEDR1_DTRBMX_Pos (24) /*!< DDRPHY_T::DTEDR1: DTRBMX Position */ -#define DDRPHY_DTEDR1_DTRBMX_Msk (0xfful << DDRPHY_DTEDR1_DTRBMX_Pos) /*!< DDRPHY_T::DTEDR1: DTRBMX Mask */ - -#define DDRPHY_PGCR2_tREFPRD_Pos (0) /*!< DDRPHY_T::PGCR2: tREFPRD Position */ -#define DDRPHY_PGCR2_tREFPRD_Msk (0x3fffful << DDRPHY_PGCR2_tREFPRD_Pos) /*!< DDRPHY_T::PGCR2: tREFPRD Mask */ - -#define DDRPHY_PGCR2_NOBUB_Pos (18) /*!< DDRPHY_T::PGCR2: NOBUB Position */ -#define DDRPHY_PGCR2_NOBUB_Msk (0x1ul << DDRPHY_PGCR2_NOBUB_Pos) /*!< DDRPHY_T::PGCR2: NOBUB Mask */ - -#define DDRPHY_PGCR2_FXDLAT_Pos (19) /*!< DDRPHY_T::PGCR2: FXDLAT Position */ -#define DDRPHY_PGCR2_FXDLAT_Msk (0x1ul << DDRPHY_PGCR2_FXDLAT_Pos) /*!< DDRPHY_T::PGCR2: FXDLAT Mask */ - -#define DDRPHY_PGCR2_DTPMXTMR_Pos (20) /*!< DDRPHY_T::PGCR2: DTPMXTMR Position */ -#define DDRPHY_PGCR2_DTPMXTMR_Msk (0xfful << DDRPHY_PGCR2_DTPMXTMR_Pos) /*!< DDRPHY_T::PGCR2: DTPMXTMR Mask */ - -#define DDRPHY_PGCR2_SHRAC_Pos (28) /*!< DDRPHY_T::PGCR2: SHRAC Position */ -#define DDRPHY_PGCR2_SHRAC_Msk (0x1ul << DDRPHY_PGCR2_SHRAC_Pos) /*!< DDRPHY_T::PGCR2: SHRAC Mask */ - -#define DDRPHY_PGCR2_ACPDDC_Pos (29) /*!< DDRPHY_T::PGCR2: ACPDDC Position */ -#define DDRPHY_PGCR2_ACPDDC_Msk (0x1ul << DDRPHY_PGCR2_ACPDDC_Pos) /*!< DDRPHY_T::PGCR2: ACPDDC Mask */ - -#define DDRPHY_PGCR2_LPMSTRC0_Pos (30) /*!< DDRPHY_T::PGCR2: LPMSTRC0 Position */ -#define DDRPHY_PGCR2_LPMSTRC0_Msk (0x1ul << DDRPHY_PGCR2_LPMSTRC0_Pos) /*!< DDRPHY_T::PGCR2: LPMSTRC0 Mask */ - -#define DDRPHY_PGCR2_DYNACPDD_Pos (31) /*!< DDRPHY_T::PGCR2: DYNACPDD Position */ -#define DDRPHY_PGCR2_DYNACPDD_Msk (0x1ul << DDRPHY_PGCR2_DYNACPDD_Pos) /*!< DDRPHY_T::PGCR2: DYNACPDD Mask */ - -#define DDRPHY_RDIMMGCR0_RDIMM_Pos (0) /*!< DDRPHY_T::RDIMMGCR0: RDIMM Position */ -#define DDRPHY_RDIMMGCR0_RDIMM_Msk (0x1ul << DDRPHY_RDIMMGCR0_RDIMM_Pos) /*!< DDRPHY_T::RDIMMGCR0: RDIMM Mask */ - -#define DDRPHY_RDIMMGCR0_ERRNOREG_Pos (1) /*!< DDRPHY_T::RDIMMGCR0: ERRNOREG Position */ -#define DDRPHY_RDIMMGCR0_ERRNOREG_Msk (0x1ul << DDRPHY_RDIMMGCR0_ERRNOREG_Pos) /*!< DDRPHY_T::RDIMMGCR0: ERRNOREG Mask */ - -#define DDRPHY_RDIMMGCR0_SOPERR_Pos (2) /*!< DDRPHY_T::RDIMMGCR0: SOPERR Position */ -#define DDRPHY_RDIMMGCR0_SOPERR_Msk (0x1ul << DDRPHY_RDIMMGCR0_SOPERR_Pos) /*!< DDRPHY_T::RDIMMGCR0: SOPERR Mask */ - -#define DDRPHY_RDIMMGCR0_PARINODT_Pos (14) /*!< DDRPHY_T::RDIMMGCR0: PARINODT Position */ -#define DDRPHY_RDIMMGCR0_PARINODT_Msk (0x1ul << DDRPHY_RDIMMGCR0_PARINODT_Pos) /*!< DDRPHY_T::RDIMMGCR0: PARINODT Mask */ - -#define DDRPHY_RDIMMGCR0_PARINPDD_Pos (15) /*!< DDRPHY_T::RDIMMGCR0: PARINPDD Position */ -#define DDRPHY_RDIMMGCR0_PARINPDD_Msk (0x1ul << DDRPHY_RDIMMGCR0_PARINPDD_Pos) /*!< DDRPHY_T::RDIMMGCR0: PARINPDD Mask */ - -#define DDRPHY_RDIMMGCR0_PARINPDR_Pos (16) /*!< DDRPHY_T::RDIMMGCR0: PARINPDR Position */ -#define DDRPHY_RDIMMGCR0_PARINPDR_Msk (0x1ul << DDRPHY_RDIMMGCR0_PARINPDR_Pos) /*!< DDRPHY_T::RDIMMGCR0: PARINPDR Mask */ - -#define DDRPHY_RDIMMGCR0_PARINIOM_Pos (17) /*!< DDRPHY_T::RDIMMGCR0: PARINIOM Position */ -#define DDRPHY_RDIMMGCR0_PARINIOM_Msk (0x1ul << DDRPHY_RDIMMGCR0_PARINIOM_Pos) /*!< DDRPHY_T::RDIMMGCR0: PARINIOM Mask */ - -#define DDRPHY_RDIMMGCR0_PARINOE_Pos (18) /*!< DDRPHY_T::RDIMMGCR0: PARINOE Position */ -#define DDRPHY_RDIMMGCR0_PARINOE_Msk (0x1ul << DDRPHY_RDIMMGCR0_PARINOE_Pos) /*!< DDRPHY_T::RDIMMGCR0: PARINOE Mask */ - -#define DDRPHY_RDIMMGCR0_ERROUTODT_Pos (19) /*!< DDRPHY_T::RDIMMGCR0: ERROUTODT Position*/ -#define DDRPHY_RDIMMGCR0_ERROUTODT_Msk (0x1ul << DDRPHY_RDIMMGCR0_ERROUTODT_Pos) /*!< DDRPHY_T::RDIMMGCR0: ERROUTODT Mask */ - -#define DDRPHY_RDIMMGCR0_ERROUTPDD_Pos (20) /*!< DDRPHY_T::RDIMMGCR0: ERROUTPDD Position*/ -#define DDRPHY_RDIMMGCR0_ERROUTPDD_Msk (0x1ul << DDRPHY_RDIMMGCR0_ERROUTPDD_Pos) /*!< DDRPHY_T::RDIMMGCR0: ERROUTPDD Mask */ - -#define DDRPHY_RDIMMGCR0_ERROUTPDR_Pos (21) /*!< DDRPHY_T::RDIMMGCR0: ERROUTPDR Position*/ -#define DDRPHY_RDIMMGCR0_ERROUTPDR_Msk (0x1ul << DDRPHY_RDIMMGCR0_ERROUTPDR_Pos) /*!< DDRPHY_T::RDIMMGCR0: ERROUTPDR Mask */ - -#define DDRPHY_RDIMMGCR0_ERROUTIOM_Pos (22) /*!< DDRPHY_T::RDIMMGCR0: ERROUTIOM Position*/ -#define DDRPHY_RDIMMGCR0_ERROUTIOM_Msk (0x1ul << DDRPHY_RDIMMGCR0_ERROUTIOM_Pos) /*!< DDRPHY_T::RDIMMGCR0: ERROUTIOM Mask */ - -#define DDRPHY_RDIMMGCR0_ERROUTOE_Pos (23) /*!< DDRPHY_T::RDIMMGCR0: ERROUTOE Position */ -#define DDRPHY_RDIMMGCR0_ERROUTOE_Msk (0x1ul << DDRPHY_RDIMMGCR0_ERROUTOE_Pos) /*!< DDRPHY_T::RDIMMGCR0: ERROUTOE Mask */ - -#define DDRPHY_RDIMMGCR0_RDIMMODT_Pos (24) /*!< DDRPHY_T::RDIMMGCR0: RDIMMODT Position */ -#define DDRPHY_RDIMMGCR0_RDIMMODT_Msk (0x1ul << DDRPHY_RDIMMGCR0_RDIMMODT_Pos) /*!< DDRPHY_T::RDIMMGCR0: RDIMMODT Mask */ - -#define DDRPHY_RDIMMGCR0_RDIMMPDD_Pos (25) /*!< DDRPHY_T::RDIMMGCR0: RDIMMPDD Position */ -#define DDRPHY_RDIMMGCR0_RDIMMPDD_Msk (0x1ul << DDRPHY_RDIMMGCR0_RDIMMPDD_Pos) /*!< DDRPHY_T::RDIMMGCR0: RDIMMPDD Mask */ - -#define DDRPHY_RDIMMGCR0_RDIMMPDR_Pos (26) /*!< DDRPHY_T::RDIMMGCR0: RDIMMPDR Position */ -#define DDRPHY_RDIMMGCR0_RDIMMPDR_Msk (0x1ul << DDRPHY_RDIMMGCR0_RDIMMPDR_Pos) /*!< DDRPHY_T::RDIMMGCR0: RDIMMPDR Mask */ - -#define DDRPHY_RDIMMGCR0_RDIMMIOM_Pos (27) /*!< DDRPHY_T::RDIMMGCR0: RDIMMIOM Position */ -#define DDRPHY_RDIMMGCR0_RDIMMIOM_Msk (0x1ul << DDRPHY_RDIMMGCR0_RDIMMIOM_Pos) /*!< DDRPHY_T::RDIMMGCR0: RDIMMIOM Mask */ - -#define DDRPHY_RDIMMGCR0_QCSENOE_Pos (28) /*!< DDRPHY_T::RDIMMGCR0: QCSENOE Position */ -#define DDRPHY_RDIMMGCR0_QCSENOE_Msk (0x1ul << DDRPHY_RDIMMGCR0_QCSENOE_Pos) /*!< DDRPHY_T::RDIMMGCR0: QCSENOE Mask */ - -#define DDRPHY_RDIMMGCR0_MIRROROE_Pos (29) /*!< DDRPHY_T::RDIMMGCR0: MIRROROE Position */ -#define DDRPHY_RDIMMGCR0_MIRROROE_Msk (0x1ul << DDRPHY_RDIMMGCR0_MIRROROE_Pos) /*!< DDRPHY_T::RDIMMGCR0: MIRROROE Mask */ - -#define DDRPHY_RDIMMGCR0_QCSEN_Pos (30) /*!< DDRPHY_T::RDIMMGCR0: QCSEN Position */ -#define DDRPHY_RDIMMGCR0_QCSEN_Msk (0x1ul << DDRPHY_RDIMMGCR0_QCSEN_Pos) /*!< DDRPHY_T::RDIMMGCR0: QCSEN Mask */ - -#define DDRPHY_RDIMMGCR0_MIRROR_Pos (31) /*!< DDRPHY_T::RDIMMGCR0: MIRROR Position */ -#define DDRPHY_RDIMMGCR0_MIRROR_Msk (0x1ul << DDRPHY_RDIMMGCR0_MIRROR_Pos) /*!< DDRPHY_T::RDIMMGCR0: MIRROR Mask */ - -#define DDRPHY_RDIMMGCR1_tBCSTAB_Pos (0) /*!< DDRPHY_T::RDIMMGCR1: tBCSTAB Position */ -#define DDRPHY_RDIMMGCR1_tBCSTAB_Msk (0xffful << DDRPHY_RDIMMGCR1_tBCSTAB_Pos) /*!< DDRPHY_T::RDIMMGCR1: tBCSTAB Mask */ - -#define DDRPHY_RDIMMGCR1_tBCMRD_Pos (12) /*!< DDRPHY_T::RDIMMGCR1: tBCMRD Position */ -#define DDRPHY_RDIMMGCR1_tBCMRD_Msk (0x7ul << DDRPHY_RDIMMGCR1_tBCMRD_Pos) /*!< DDRPHY_T::RDIMMGCR1: tBCMRD Mask */ - -#define DDRPHY_RDIMMGCR1_CRINIT_Pos (16) /*!< DDRPHY_T::RDIMMGCR1: CRINIT Position */ -#define DDRPHY_RDIMMGCR1_CRINIT_Msk (0xfffful << DDRPHY_RDIMMGCR1_CRINIT_Pos) /*!< DDRPHY_T::RDIMMGCR1: CRINIT Mask */ - -#define DDRPHY_RDIMMCR0_RC0_Pos (0) /*!< DDRPHY_T::RDIMMCR0: RC0 Position */ -#define DDRPHY_RDIMMCR0_RC0_Msk (0xful << DDRPHY_RDIMMCR0_RC0_Pos) /*!< DDRPHY_T::RDIMMCR0: RC0 Mask */ - -#define DDRPHY_RDIMMCR0_RC1_Pos (4) /*!< DDRPHY_T::RDIMMCR0: RC1 Position */ -#define DDRPHY_RDIMMCR0_RC1_Msk (0xful << DDRPHY_RDIMMCR0_RC1_Pos) /*!< DDRPHY_T::RDIMMCR0: RC1 Mask */ - -#define DDRPHY_RDIMMCR0_RC2_Pos (8) /*!< DDRPHY_T::RDIMMCR0: RC2 Position */ -#define DDRPHY_RDIMMCR0_RC2_Msk (0xful << DDRPHY_RDIMMCR0_RC2_Pos) /*!< DDRPHY_T::RDIMMCR0: RC2 Mask */ - -#define DDRPHY_RDIMMCR0_RC3_Pos (12) /*!< DDRPHY_T::RDIMMCR0: RC3 Position */ -#define DDRPHY_RDIMMCR0_RC3_Msk (0xful << DDRPHY_RDIMMCR0_RC3_Pos) /*!< DDRPHY_T::RDIMMCR0: RC3 Mask */ - -#define DDRPHY_RDIMMCR0_RC4_Pos (16) /*!< DDRPHY_T::RDIMMCR0: RC4 Position */ -#define DDRPHY_RDIMMCR0_RC4_Msk (0xful << DDRPHY_RDIMMCR0_RC4_Pos) /*!< DDRPHY_T::RDIMMCR0: RC4 Mask */ - -#define DDRPHY_RDIMMCR0_RC5_Pos (20) /*!< DDRPHY_T::RDIMMCR0: RC5 Position */ -#define DDRPHY_RDIMMCR0_RC5_Msk (0xful << DDRPHY_RDIMMCR0_RC5_Pos) /*!< DDRPHY_T::RDIMMCR0: RC5 Mask */ - -#define DDRPHY_RDIMMCR0_RC6_Pos (24) /*!< DDRPHY_T::RDIMMCR0: RC6 Position */ -#define DDRPHY_RDIMMCR0_RC6_Msk (0xful << DDRPHY_RDIMMCR0_RC6_Pos) /*!< DDRPHY_T::RDIMMCR0: RC6 Mask */ - -#define DDRPHY_RDIMMCR0_RC7_Pos (28) /*!< DDRPHY_T::RDIMMCR0: RC7 Position */ -#define DDRPHY_RDIMMCR0_RC7_Msk (0xful << DDRPHY_RDIMMCR0_RC7_Pos) /*!< DDRPHY_T::RDIMMCR0: RC7 Mask */ - -#define DDRPHY_RDIMMCR1_RC8_Pos (0) /*!< DDRPHY_T::RDIMMCR1: RC8 Position */ -#define DDRPHY_RDIMMCR1_RC8_Msk (0xful << DDRPHY_RDIMMCR1_RC8_Pos) /*!< DDRPHY_T::RDIMMCR1: RC8 Mask */ - -#define DDRPHY_RDIMMCR1_RC9_Pos (4) /*!< DDRPHY_T::RDIMMCR1: RC9 Position */ -#define DDRPHY_RDIMMCR1_RC9_Msk (0xful << DDRPHY_RDIMMCR1_RC9_Pos) /*!< DDRPHY_T::RDIMMCR1: RC9 Mask */ - -#define DDRPHY_RDIMMCR1_RC10_Pos (8) /*!< DDRPHY_T::RDIMMCR1: RC10 Position */ -#define DDRPHY_RDIMMCR1_RC10_Msk (0xful << DDRPHY_RDIMMCR1_RC10_Pos) /*!< DDRPHY_T::RDIMMCR1: RC10 Mask */ - -#define DDRPHY_RDIMMCR1_RC11_Pos (12) /*!< DDRPHY_T::RDIMMCR1: RC11 Position */ -#define DDRPHY_RDIMMCR1_RC11_Msk (0xful << DDRPHY_RDIMMCR1_RC11_Pos) /*!< DDRPHY_T::RDIMMCR1: RC11 Mask */ - -#define DDRPHY_RDIMMCR1_RC12_Pos (16) /*!< DDRPHY_T::RDIMMCR1: RC12 Position */ -#define DDRPHY_RDIMMCR1_RC12_Msk (0xful << DDRPHY_RDIMMCR1_RC12_Pos) /*!< DDRPHY_T::RDIMMCR1: RC12 Mask */ - -#define DDRPHY_RDIMMCR1_RC13_Pos (20) /*!< DDRPHY_T::RDIMMCR1: RC13 Position */ -#define DDRPHY_RDIMMCR1_RC13_Msk (0xful << DDRPHY_RDIMMCR1_RC13_Pos) /*!< DDRPHY_T::RDIMMCR1: RC13 Mask */ - -#define DDRPHY_RDIMMCR1_RC14_Pos (24) /*!< DDRPHY_T::RDIMMCR1: RC14 Position */ -#define DDRPHY_RDIMMCR1_RC14_Msk (0xful << DDRPHY_RDIMMCR1_RC14_Pos) /*!< DDRPHY_T::RDIMMCR1: RC14 Mask */ - -#define DDRPHY_RDIMMCR1_RC15_Pos (28) /*!< DDRPHY_T::RDIMMCR1: RC15 Position */ -#define DDRPHY_RDIMMCR1_RC15_Msk (0xful << DDRPHY_RDIMMCR1_RC15_Pos) /*!< DDRPHY_T::RDIMMCR1: RC15 Mask */ - -#define DDRPHY_DCUAR_CWADDR_Pos (0) /*!< DDRPHY_T::DCUAR: CWADDR Position */ -#define DDRPHY_DCUAR_CWADDR_Msk (0xful << DDRPHY_DCUAR_CWADDR_Pos) /*!< DDRPHY_T::DCUAR: CWADDR Mask */ - -#define DDRPHY_DCUAR_CSADDR_Pos (4) /*!< DDRPHY_T::DCUAR: CSADDR Position */ -#define DDRPHY_DCUAR_CSADDR_Msk (0xful << DDRPHY_DCUAR_CSADDR_Pos) /*!< DDRPHY_T::DCUAR: CSADDR Mask */ - -#define DDRPHY_DCUAR_CSEL_Pos (8) /*!< DDRPHY_T::DCUAR: CSEL Position */ -#define DDRPHY_DCUAR_CSEL_Msk (0x3ul << DDRPHY_DCUAR_CSEL_Pos) /*!< DDRPHY_T::DCUAR: CSEL Mask */ - -#define DDRPHY_DCUAR_INCA_Pos (10) /*!< DDRPHY_T::DCUAR: INCA Position */ -#define DDRPHY_DCUAR_INCA_Msk (0x1ul << DDRPHY_DCUAR_INCA_Pos) /*!< DDRPHY_T::DCUAR: INCA Mask */ - -#define DDRPHY_DCUAR_ATYPE_Pos (11) /*!< DDRPHY_T::DCUAR: ATYPE Position */ -#define DDRPHY_DCUAR_ATYPE_Msk (0x1ul << DDRPHY_DCUAR_ATYPE_Pos) /*!< DDRPHY_T::DCUAR: ATYPE Mask */ - -#define DDRPHY_DCUDR_CDATA_Pos (0) /*!< DDRPHY_T::DCUDR: CDATA Position */ -#define DDRPHY_DCUDR_CDATA_Msk (0xfffffffful << DDRPHY_DCUDR_CDATA_Pos) /*!< DDRPHY_T::DCUDR: CDATA Mask */ - -#define DDRPHY_DCURR_DINST_Pos (0) /*!< DDRPHY_T::DCURR: DINST Position */ -#define DDRPHY_DCURR_DINST_Msk (0xful << DDRPHY_DCURR_DINST_Pos) /*!< DDRPHY_T::DCURR: DINST Mask */ - -#define DDRPHY_DCURR_SADDR_Pos (4) /*!< DDRPHY_T::DCURR: SADDR Position */ -#define DDRPHY_DCURR_SADDR_Msk (0xful << DDRPHY_DCURR_SADDR_Pos) /*!< DDRPHY_T::DCURR: SADDR Mask */ - -#define DDRPHY_DCURR_EADDR_Pos (8) /*!< DDRPHY_T::DCURR: EADDR Position */ -#define DDRPHY_DCURR_EADDR_Msk (0xful << DDRPHY_DCURR_EADDR_Pos) /*!< DDRPHY_T::DCURR: EADDR Mask */ - -#define DDRPHY_DCURR_NFAIL_Pos (12) /*!< DDRPHY_T::DCURR: NFAIL Position */ -#define DDRPHY_DCURR_NFAIL_Msk (0xfful << DDRPHY_DCURR_NFAIL_Pos) /*!< DDRPHY_T::DCURR: NFAIL Mask */ - -#define DDRPHY_DCURR_SONF_Pos (20) /*!< DDRPHY_T::DCURR: SONF Position */ -#define DDRPHY_DCURR_SONF_Msk (0x1ul << DDRPHY_DCURR_SONF_Pos) /*!< DDRPHY_T::DCURR: SONF Mask */ - -#define DDRPHY_DCURR_SCOF_Pos (21) /*!< DDRPHY_T::DCURR: SCOF Position */ -#define DDRPHY_DCURR_SCOF_Msk (0x1ul << DDRPHY_DCURR_SCOF_Pos) /*!< DDRPHY_T::DCURR: SCOF Mask */ - -#define DDRPHY_DCURR_RCEN_Pos (22) /*!< DDRPHY_T::DCURR: RCEN Position */ -#define DDRPHY_DCURR_RCEN_Msk (0x1ul << DDRPHY_DCURR_RCEN_Pos) /*!< DDRPHY_T::DCURR: RCEN Mask */ - -#define DDRPHY_DCURR_XCEN_Pos (23) /*!< DDRPHY_T::DCURR: XCEN Position */ -#define DDRPHY_DCURR_XCEN_Msk (0x1ul << DDRPHY_DCURR_XCEN_Pos) /*!< DDRPHY_T::DCURR: XCEN Mask */ - -#define DDRPHY_DCULR_LSADDR_Pos (0) /*!< DDRPHY_T::DCULR: LSADDR Position */ -#define DDRPHY_DCULR_LSADDR_Msk (0xful << DDRPHY_DCULR_LSADDR_Pos) /*!< DDRPHY_T::DCULR: LSADDR Mask */ - -#define DDRPHY_DCULR_LEADDR_Pos (4) /*!< DDRPHY_T::DCULR: LEADDR Position */ -#define DDRPHY_DCULR_LEADDR_Msk (0xful << DDRPHY_DCULR_LEADDR_Pos) /*!< DDRPHY_T::DCULR: LEADDR Mask */ - -#define DDRPHY_DCULR_LCNT_Pos (8) /*!< DDRPHY_T::DCULR: LCNT Position */ -#define DDRPHY_DCULR_LCNT_Msk (0xfful << DDRPHY_DCULR_LCNT_Pos) /*!< DDRPHY_T::DCULR: LCNT Mask */ - -#define DDRPHY_DCULR_LINF_Pos (16) /*!< DDRPHY_T::DCULR: LINF Position */ -#define DDRPHY_DCULR_LINF_Msk (0x1ul << DDRPHY_DCULR_LINF_Pos) /*!< DDRPHY_T::DCULR: LINF Mask */ - -#define DDRPHY_DCULR_IDA_Pos (17) /*!< DDRPHY_T::DCULR: IDA Position */ -#define DDRPHY_DCULR_IDA_Msk (0x1ul << DDRPHY_DCULR_IDA_Pos) /*!< DDRPHY_T::DCULR: IDA Mask */ - -#define DDRPHY_DCULR_XLEADDR_Pos (28) /*!< DDRPHY_T::DCULR: XLEADDR Position */ -#define DDRPHY_DCULR_XLEADDR_Msk (0xful << DDRPHY_DCULR_XLEADDR_Pos) /*!< DDRPHY_T::DCULR: XLEADDR Mask */ - -#define DDRPHY_DCUGCR_RCSW_Pos (0) /*!< DDRPHY_T::DCUGCR: RCSW Position */ -#define DDRPHY_DCUGCR_RCSW_Msk (0xfffful << DDRPHY_DCUGCR_RCSW_Pos) /*!< DDRPHY_T::DCUGCR: RCSW Mask */ - -#define DDRPHY_DCUTPR_tDCUT0_Pos (0) /*!< DDRPHY_T::DCUTPR: tDCUT0 Position */ -#define DDRPHY_DCUTPR_tDCUT0_Msk (0xfful << DDRPHY_DCUTPR_tDCUT0_Pos) /*!< DDRPHY_T::DCUTPR: tDCUT0 Mask */ - -#define DDRPHY_DCUTPR_tDCUT1_Pos (8) /*!< DDRPHY_T::DCUTPR: tDCUT1 Position */ -#define DDRPHY_DCUTPR_tDCUT1_Msk (0xfful << DDRPHY_DCUTPR_tDCUT1_Pos) /*!< DDRPHY_T::DCUTPR: tDCUT1 Mask */ - -#define DDRPHY_DCUTPR_tDCUT2_Pos (16) /*!< DDRPHY_T::DCUTPR: tDCUT2 Position */ -#define DDRPHY_DCUTPR_tDCUT2_Msk (0xfful << DDRPHY_DCUTPR_tDCUT2_Pos) /*!< DDRPHY_T::DCUTPR: tDCUT2 Mask */ - -#define DDRPHY_DCUTPR_tDCUT3_Pos (24) /*!< DDRPHY_T::DCUTPR: tDCUT3 Position */ -#define DDRPHY_DCUTPR_tDCUT3_Msk (0xfful << DDRPHY_DCUTPR_tDCUT3_Pos) /*!< DDRPHY_T::DCUTPR: tDCUT3 Mask */ - -#define DDRPHY_DCUSR0_RDONE_Pos (0) /*!< DDRPHY_T::DCUSR0: RDONE Position */ -#define DDRPHY_DCUSR0_RDONE_Msk (0x1ul << DDRPHY_DCUSR0_RDONE_Pos) /*!< DDRPHY_T::DCUSR0: RDONE Mask */ - -#define DDRPHY_DCUSR0_CFAIL_Pos (1) /*!< DDRPHY_T::DCUSR0: CFAIL Position */ -#define DDRPHY_DCUSR0_CFAIL_Msk (0x1ul << DDRPHY_DCUSR0_CFAIL_Pos) /*!< DDRPHY_T::DCUSR0: CFAIL Mask */ - -#define DDRPHY_DCUSR0_CFULL_Pos (2) /*!< DDRPHY_T::DCUSR0: CFULL Position */ -#define DDRPHY_DCUSR0_CFULL_Msk (0x1ul << DDRPHY_DCUSR0_CFULL_Pos) /*!< DDRPHY_T::DCUSR0: CFULL Mask */ - -#define DDRPHY_DCUSR1_RDCNT_Pos (0) /*!< DDRPHY_T::DCUSR1: RDCNT Position */ -#define DDRPHY_DCUSR1_RDCNT_Msk (0xfffful << DDRPHY_DCUSR1_RDCNT_Pos) /*!< DDRPHY_T::DCUSR1: RDCNT Mask */ - -#define DDRPHY_DCUSR1_FLCNT_Pos (16) /*!< DDRPHY_T::DCUSR1: FLCNT Position */ -#define DDRPHY_DCUSR1_FLCNT_Msk (0xfful << DDRPHY_DCUSR1_FLCNT_Pos) /*!< DDRPHY_T::DCUSR1: FLCNT Mask */ - -#define DDRPHY_DCUSR1_LPCNT_Pos (24) /*!< DDRPHY_T::DCUSR1: LPCNT Position */ -#define DDRPHY_DCUSR1_LPCNT_Msk (0xfful << DDRPHY_DCUSR1_LPCNT_Pos) /*!< DDRPHY_T::DCUSR1: LPCNT Mask */ - -#define DDRPHY_BISTRR_BINST_Pos (0) /*!< DDRPHY_T::BISTRR: BINST Position */ -#define DDRPHY_BISTRR_BINST_Msk (0x7ul << DDRPHY_BISTRR_BINST_Pos) /*!< DDRPHY_T::BISTRR: BINST Mask */ - -#define DDRPHY_BISTRR_BMODE_Pos (3) /*!< DDRPHY_T::BISTRR: BMODE Position */ -#define DDRPHY_BISTRR_BMODE_Msk (0x1ul << DDRPHY_BISTRR_BMODE_Pos) /*!< DDRPHY_T::BISTRR: BMODE Mask */ - -#define DDRPHY_BISTRR_BINF_Pos (4) /*!< DDRPHY_T::BISTRR: BINF Position */ -#define DDRPHY_BISTRR_BINF_Msk (0x1ul << DDRPHY_BISTRR_BINF_Pos) /*!< DDRPHY_T::BISTRR: BINF Mask */ - -#define DDRPHY_BISTRR_NFAIL_Pos (5) /*!< DDRPHY_T::BISTRR: NFAIL Position */ -#define DDRPHY_BISTRR_NFAIL_Msk (0xfful << DDRPHY_BISTRR_NFAIL_Pos) /*!< DDRPHY_T::BISTRR: NFAIL Mask */ - -#define DDRPHY_BISTRR_BSONF_Pos (13) /*!< DDRPHY_T::BISTRR: BSONF Position */ -#define DDRPHY_BISTRR_BSONF_Msk (0x1ul << DDRPHY_BISTRR_BSONF_Pos) /*!< DDRPHY_T::BISTRR: BSONF Mask */ - -#define DDRPHY_BISTRR_BDXEN_Pos (14) /*!< DDRPHY_T::BISTRR: BDXEN Position */ -#define DDRPHY_BISTRR_BDXEN_Msk (0x1ul << DDRPHY_BISTRR_BDXEN_Pos) /*!< DDRPHY_T::BISTRR: BDXEN Mask */ - -#define DDRPHY_BISTRR_BACEN_Pos (15) /*!< DDRPHY_T::BISTRR: BACEN Position */ -#define DDRPHY_BISTRR_BACEN_Msk (0x1ul << DDRPHY_BISTRR_BACEN_Pos) /*!< DDRPHY_T::BISTRR: BACEN Mask */ - -#define DDRPHY_BISTRR_BDMEN_Pos (16) /*!< DDRPHY_T::BISTRR: BDMEN Position */ -#define DDRPHY_BISTRR_BDMEN_Msk (0x1ul << DDRPHY_BISTRR_BDMEN_Pos) /*!< DDRPHY_T::BISTRR: BDMEN Mask */ - -#define DDRPHY_BISTRR_BDPAT_Pos (17) /*!< DDRPHY_T::BISTRR: BDPAT Position */ -#define DDRPHY_BISTRR_BDPAT_Msk (0x3ul << DDRPHY_BISTRR_BDPAT_Pos) /*!< DDRPHY_T::BISTRR: BDPAT Mask */ - -#define DDRPHY_BISTRR_BDXSEL_Pos (19) /*!< DDRPHY_T::BISTRR: BDXSEL Position */ -#define DDRPHY_BISTRR_BDXSEL_Msk (0xful << DDRPHY_BISTRR_BDXSEL_Pos) /*!< DDRPHY_T::BISTRR: BDXSEL Mask */ - -#define DDRPHY_BISTRR_BCKSEL_Pos (23) /*!< DDRPHY_T::BISTRR: BCKSEL Position */ -#define DDRPHY_BISTRR_BCKSEL_Msk (0x3ul << DDRPHY_BISTRR_BCKSEL_Pos) /*!< DDRPHY_T::BISTRR: BCKSEL Mask */ - -#define DDRPHY_BISTRR_BCCSEL_Pos (25) /*!< DDRPHY_T::BISTRR: BCCSEL Position */ -#define DDRPHY_BISTRR_BCCSEL_Msk (0x3ul << DDRPHY_BISTRR_BCCSEL_Pos) /*!< DDRPHY_T::BISTRR: BCCSEL Mask */ - -#define DDRPHY_BISTWCR_BWCNT_Pos (0) /*!< DDRPHY_T::BISTWCR: BWCNT Position */ -#define DDRPHY_BISTWCR_BWCNT_Msk (0xfffful << DDRPHY_BISTWCR_BWCNT_Pos) /*!< DDRPHY_T::BISTWCR: BWCNT Mask */ - -#define DDRPHY_BISTMSKR0_AMSK_Pos (0) /*!< DDRPHY_T::BISTMSKR0: AMSK Position */ -#define DDRPHY_BISTMSKR0_AMSK_Msk (0xfffful << DDRPHY_BISTMSKR0_AMSK_Pos) /*!< DDRPHY_T::BISTMSKR0: AMSK Mask */ - -#define DDRPHY_BISTMSKR0_BAMSK_Pos (16) /*!< DDRPHY_T::BISTMSKR0: BAMSK Position */ -#define DDRPHY_BISTMSKR0_BAMSK_Msk (0x7ul << DDRPHY_BISTMSKR0_BAMSK_Pos) /*!< DDRPHY_T::BISTMSKR0: BAMSK Mask */ - -#define DDRPHY_BISTMSKR0_WEMSK_Pos (19) /*!< DDRPHY_T::BISTMSKR0: WEMSK Position */ -#define DDRPHY_BISTMSKR0_WEMSK_Msk (0x1ul << DDRPHY_BISTMSKR0_WEMSK_Pos) /*!< DDRPHY_T::BISTMSKR0: WEMSK Mask */ - -#define DDRPHY_BISTMSKR0_CKEMSK_Pos (20) /*!< DDRPHY_T::BISTMSKR0: CKEMSK Position */ -#define DDRPHY_BISTMSKR0_CKEMSK_Msk (0xful << DDRPHY_BISTMSKR0_CKEMSK_Pos) /*!< DDRPHY_T::BISTMSKR0: CKEMSK Mask */ - -#define DDRPHY_BISTMSKR0_CSMSK_Pos (24) /*!< DDRPHY_T::BISTMSKR0: CSMSK Position */ -#define DDRPHY_BISTMSKR0_CSMSK_Msk (0xful << DDRPHY_BISTMSKR0_CSMSK_Pos) /*!< DDRPHY_T::BISTMSKR0: CSMSK Mask */ - -#define DDRPHY_BISTMSKR0_ODTMSK_Pos (28) /*!< DDRPHY_T::BISTMSKR0: ODTMSK Position */ -#define DDRPHY_BISTMSKR0_ODTMSK_Msk (0xful << DDRPHY_BISTMSKR0_ODTMSK_Pos) /*!< DDRPHY_T::BISTMSKR0: ODTMSK Mask */ - -#define DDRPHY_BISTMSKR1_RASMSK_Pos (0) /*!< DDRPHY_T::BISTMSKR1: RASMSK Position */ -#define DDRPHY_BISTMSKR1_RASMSK_Msk (0x1ul << DDRPHY_BISTMSKR1_RASMSK_Pos) /*!< DDRPHY_T::BISTMSKR1: RASMSK Mask */ - -#define DDRPHY_BISTMSKR1_CASMSK_Pos (1) /*!< DDRPHY_T::BISTMSKR1: CASMSK Position */ -#define DDRPHY_BISTMSKR1_CASMSK_Msk (0x1ul << DDRPHY_BISTMSKR1_CASMSK_Pos) /*!< DDRPHY_T::BISTMSKR1: CASMSK Mask */ - -#define DDRPHY_BISTMSKR1_PARMSK_Pos (27) /*!< DDRPHY_T::BISTMSKR1: PARMSK Position */ -#define DDRPHY_BISTMSKR1_PARMSK_Msk (0x1ul << DDRPHY_BISTMSKR1_PARMSK_Pos) /*!< DDRPHY_T::BISTMSKR1: PARMSK Mask */ - -#define DDRPHY_BISTMSKR1_DMMSK_Pos (28) /*!< DDRPHY_T::BISTMSKR1: DMMSK Position */ -#define DDRPHY_BISTMSKR1_DMMSK_Msk (0xful << DDRPHY_BISTMSKR1_DMMSK_Pos) /*!< DDRPHY_T::BISTMSKR1: DMMSK Mask */ - -#define DDRPHY_BISTMSKR2_DQMSK_Pos (0) /*!< DDRPHY_T::BISTMSKR2: DQMSK Position */ -#define DDRPHY_BISTMSKR2_DQMSK_Msk (0xfffffffful << DDRPHY_BISTMSKR2_DQMSK_Pos) /*!< DDRPHY_T::BISTMSKR2: DQMSK Mask */ - -#define DDRPHY_BISTLSR_SEED_Pos (0) /*!< DDRPHY_T::BISTLSR: SEED Position */ -#define DDRPHY_BISTLSR_SEED_Msk (0xfffffffful << DDRPHY_BISTLSR_SEED_Pos) /*!< DDRPHY_T::BISTLSR: SEED Mask */ - -#define DDRPHY_BISTAR0_BCOL_Pos (0) /*!< DDRPHY_T::BISTAR0: BCOL Position */ -#define DDRPHY_BISTAR0_BCOL_Msk (0xffful << DDRPHY_BISTAR0_BCOL_Pos) /*!< DDRPHY_T::BISTAR0: BCOL Mask */ - -#define DDRPHY_BISTAR0_BROW_Pos (12) /*!< DDRPHY_T::BISTAR0: BROW Position */ -#define DDRPHY_BISTAR0_BROW_Msk (0xfffful << DDRPHY_BISTAR0_BROW_Pos) /*!< DDRPHY_T::BISTAR0: BROW Mask */ - -#define DDRPHY_BISTAR0_BBANK_Pos (28) /*!< DDRPHY_T::BISTAR0: BBANK Position */ -#define DDRPHY_BISTAR0_BBANK_Msk (0x7ul << DDRPHY_BISTAR0_BBANK_Pos) /*!< DDRPHY_T::BISTAR0: BBANK Mask */ - -#define DDRPHY_BISTAR1_BRANK_Pos (0) /*!< DDRPHY_T::BISTAR1: BRANK Position */ -#define DDRPHY_BISTAR1_BRANK_Msk (0x3ul << DDRPHY_BISTAR1_BRANK_Pos) /*!< DDRPHY_T::BISTAR1: BRANK Mask */ - -#define DDRPHY_BISTAR1_BMRANK_Pos (2) /*!< DDRPHY_T::BISTAR1: BMRANK Position */ -#define DDRPHY_BISTAR1_BMRANK_Msk (0x3ul << DDRPHY_BISTAR1_BMRANK_Pos) /*!< DDRPHY_T::BISTAR1: BMRANK Mask */ - -#define DDRPHY_BISTAR1_BAINC_Pos (4) /*!< DDRPHY_T::BISTAR1: BAINC Position */ -#define DDRPHY_BISTAR1_BAINC_Msk (0xffful << DDRPHY_BISTAR1_BAINC_Pos) /*!< DDRPHY_T::BISTAR1: BAINC Mask */ - -#define DDRPHY_BISTAR2_BMCOL_Pos (0) /*!< DDRPHY_T::BISTAR2: BMCOL Position */ -#define DDRPHY_BISTAR2_BMCOL_Msk (0xffful << DDRPHY_BISTAR2_BMCOL_Pos) /*!< DDRPHY_T::BISTAR2: BMCOL Mask */ - -#define DDRPHY_BISTAR2_BMROW_Pos (12) /*!< DDRPHY_T::BISTAR2: BMROW Position */ -#define DDRPHY_BISTAR2_BMROW_Msk (0xfffful << DDRPHY_BISTAR2_BMROW_Pos) /*!< DDRPHY_T::BISTAR2: BMROW Mask */ - -#define DDRPHY_BISTAR2_BMBANK_Pos (28) /*!< DDRPHY_T::BISTAR2: BMBANK Position */ -#define DDRPHY_BISTAR2_BMBANK_Msk (0x7ul << DDRPHY_BISTAR2_BMBANK_Pos) /*!< DDRPHY_T::BISTAR2: BMBANK Mask */ - -#define DDRPHY_BISTUDPR_BUDP0_Pos (0) /*!< DDRPHY_T::BISTUDPR: BUDP0 Position */ -#define DDRPHY_BISTUDPR_BUDP0_Msk (0xfffful << DDRPHY_BISTUDPR_BUDP0_Pos) /*!< DDRPHY_T::BISTUDPR: BUDP0 Mask */ - -#define DDRPHY_BISTUDPR_BUDP1_Pos (16) /*!< DDRPHY_T::BISTUDPR: BUDP1 Position */ -#define DDRPHY_BISTUDPR_BUDP1_Msk (0xfffful << DDRPHY_BISTUDPR_BUDP1_Pos) /*!< DDRPHY_T::BISTUDPR: BUDP1 Mask */ - -#define DDRPHY_BISTGSR_BDONE_Pos (0) /*!< DDRPHY_T::BISTGSR: BDONE Position */ -#define DDRPHY_BISTGSR_BDONE_Msk (0x1ul << DDRPHY_BISTGSR_BDONE_Pos) /*!< DDRPHY_T::BISTGSR: BDONE Mask */ - -#define DDRPHY_BISTGSR_BACERR_Pos (1) /*!< DDRPHY_T::BISTGSR: BACERR Position */ -#define DDRPHY_BISTGSR_BACERR_Msk (0x1ul << DDRPHY_BISTGSR_BACERR_Pos) /*!< DDRPHY_T::BISTGSR: BACERR Mask */ - -#define DDRPHY_BISTGSR_BDXERR_Pos (2) /*!< DDRPHY_T::BISTGSR: BDXERR Position */ -#define DDRPHY_BISTGSR_BDXERR_Msk (0x1ul << DDRPHY_BISTGSR_BDXERR_Pos) /*!< DDRPHY_T::BISTGSR: BDXERR Mask */ - -#define DDRPHY_BISTGSR_PARBER_Pos (16) /*!< DDRPHY_T::BISTGSR: PARBER Position */ -#define DDRPHY_BISTGSR_PARBER_Msk (0x3ul << DDRPHY_BISTGSR_PARBER_Pos) /*!< DDRPHY_T::BISTGSR: PARBER Mask */ - -#define DDRPHY_BISTGSR_DMBER_Pos (20) /*!< DDRPHY_T::BISTGSR: DMBER Position */ -#define DDRPHY_BISTGSR_DMBER_Msk (0xfful << DDRPHY_BISTGSR_DMBER_Pos) /*!< DDRPHY_T::BISTGSR: DMBER Mask */ - -#define DDRPHY_BISTGSR_RASBER_Pos (28) /*!< DDRPHY_T::BISTGSR: RASBER Position */ -#define DDRPHY_BISTGSR_RASBER_Msk (0x3ul << DDRPHY_BISTGSR_RASBER_Pos) /*!< DDRPHY_T::BISTGSR: RASBER Mask */ - -#define DDRPHY_BISTGSR_CASBER_Pos (30) /*!< DDRPHY_T::BISTGSR: CASBER Position */ -#define DDRPHY_BISTGSR_CASBER_Msk (0x3ul << DDRPHY_BISTGSR_CASBER_Pos) /*!< DDRPHY_T::BISTGSR: CASBER Mask */ - -#define DDRPHY_BISTWER_ACWER_Pos (0) /*!< DDRPHY_T::BISTWER: ACWER Position */ -#define DDRPHY_BISTWER_ACWER_Msk (0xfffful << DDRPHY_BISTWER_ACWER_Pos) /*!< DDRPHY_T::BISTWER: ACWER Mask */ - -#define DDRPHY_BISTWER_DXWER_Pos (16) /*!< DDRPHY_T::BISTWER: DXWER Position */ -#define DDRPHY_BISTWER_DXWER_Msk (0xfffful << DDRPHY_BISTWER_DXWER_Pos) /*!< DDRPHY_T::BISTWER: DXWER Mask */ - -#define DDRPHY_BISTBER0_ABER_Pos (0) /*!< DDRPHY_T::BISTBER0: ABER Position */ -#define DDRPHY_BISTBER0_ABER_Msk (0xfffffffful << DDRPHY_BISTBER0_ABER_Pos) /*!< DDRPHY_T::BISTBER0: ABER Mask */ - -#define DDRPHY_BISTBER1_BABER_Pos (0) /*!< DDRPHY_T::BISTBER1: BABER Position */ -#define DDRPHY_BISTBER1_BABER_Msk (0x3ful << DDRPHY_BISTBER1_BABER_Pos) /*!< DDRPHY_T::BISTBER1: BABER Mask */ - -#define DDRPHY_BISTBER1_WEBER_Pos (6) /*!< DDRPHY_T::BISTBER1: WEBER Position */ -#define DDRPHY_BISTBER1_WEBER_Msk (0x3ul << DDRPHY_BISTBER1_WEBER_Pos) /*!< DDRPHY_T::BISTBER1: WEBER Mask */ - -#define DDRPHY_BISTBER1_CKEBER_Pos (8) /*!< DDRPHY_T::BISTBER1: CKEBER Position */ -#define DDRPHY_BISTBER1_CKEBER_Msk (0xfful << DDRPHY_BISTBER1_CKEBER_Pos) /*!< DDRPHY_T::BISTBER1: CKEBER Mask */ - -#define DDRPHY_BISTBER1_CSBER_Pos (16) /*!< DDRPHY_T::BISTBER1: CSBER Position */ -#define DDRPHY_BISTBER1_CSBER_Msk (0xfful << DDRPHY_BISTBER1_CSBER_Pos) /*!< DDRPHY_T::BISTBER1: CSBER Mask */ - -#define DDRPHY_BISTBER1_ODTBER_Pos (24) /*!< DDRPHY_T::BISTBER1: ODTBER Position */ -#define DDRPHY_BISTBER1_ODTBER_Msk (0xfful << DDRPHY_BISTBER1_ODTBER_Pos) /*!< DDRPHY_T::BISTBER1: ODTBER Mask */ - -#define DDRPHY_BISTBER2_DQBER0_Pos (0) /*!< DDRPHY_T::BISTBER2: DQBER0 Position */ -#define DDRPHY_BISTBER2_DQBER0_Msk (0xfffffffful << DDRPHY_BISTBER2_DQBER0_Pos) /*!< DDRPHY_T::BISTBER2: DQBER0 Mask */ - -#define DDRPHY_BISTBER3_DQBER1_Pos (0) /*!< DDRPHY_T::BISTBER3: DQBER1 Position */ -#define DDRPHY_BISTBER3_DQBER1_Msk (0xfffffffful << DDRPHY_BISTBER3_DQBER1_Pos) /*!< DDRPHY_T::BISTBER3: DQBER1 Mask */ - -#define DDRPHY_BISTWCSR_ACWCNT_Pos (0) /*!< DDRPHY_T::BISTWCSR: ACWCNT Position */ -#define DDRPHY_BISTWCSR_ACWCNT_Msk (0xfffful << DDRPHY_BISTWCSR_ACWCNT_Pos) /*!< DDRPHY_T::BISTWCSR: ACWCNT Mask */ - -#define DDRPHY_BISTWCSR_DXWCNT_Pos (16) /*!< DDRPHY_T::BISTWCSR: DXWCNT Position */ -#define DDRPHY_BISTWCSR_DXWCNT_Msk (0xfffful << DDRPHY_BISTWCSR_DXWCNT_Pos) /*!< DDRPHY_T::BISTWCSR: DXWCNT Mask */ - -#define DDRPHY_BISTFWR0_AWEBS_Pos (0) /*!< DDRPHY_T::BISTFWR0: AWEBS Position */ -#define DDRPHY_BISTFWR0_AWEBS_Msk (0xfffful << DDRPHY_BISTFWR0_AWEBS_Pos) /*!< DDRPHY_T::BISTFWR0: AWEBS Mask */ - -#define DDRPHY_BISTFWR0_BAWEBS_Pos (16) /*!< DDRPHY_T::BISTFWR0: BAWEBS Position */ -#define DDRPHY_BISTFWR0_BAWEBS_Msk (0x7ul << DDRPHY_BISTFWR0_BAWEBS_Pos) /*!< DDRPHY_T::BISTFWR0: BAWEBS Mask */ - -#define DDRPHY_BISTFWR0_WEWEBS_Pos (19) /*!< DDRPHY_T::BISTFWR0: WEWEBS Position */ -#define DDRPHY_BISTFWR0_WEWEBS_Msk (0x1ul << DDRPHY_BISTFWR0_WEWEBS_Pos) /*!< DDRPHY_T::BISTFWR0: WEWEBS Mask */ - -#define DDRPHY_BISTFWR0_CKEWEBS_Pos (20) /*!< DDRPHY_T::BISTFWR0: CKEWEBS Position */ -#define DDRPHY_BISTFWR0_CKEWEBS_Msk (0xful << DDRPHY_BISTFWR0_CKEWEBS_Pos) /*!< DDRPHY_T::BISTFWR0: CKEWEBS Mask */ - -#define DDRPHY_BISTFWR0_CSWEBS_Pos (24) /*!< DDRPHY_T::BISTFWR0: CSWEBS Position */ -#define DDRPHY_BISTFWR0_CSWEBS_Msk (0xful << DDRPHY_BISTFWR0_CSWEBS_Pos) /*!< DDRPHY_T::BISTFWR0: CSWEBS Mask */ - -#define DDRPHY_BISTFWR0_ODTWEBS_Pos (28) /*!< DDRPHY_T::BISTFWR0: ODTWEBS Position */ -#define DDRPHY_BISTFWR0_ODTWEBS_Msk (0xful << DDRPHY_BISTFWR0_ODTWEBS_Pos) /*!< DDRPHY_T::BISTFWR0: ODTWEBS Mask */ - -#define DDRPHY_BISTFWR1_RASWEBS_Pos (0) /*!< DDRPHY_T::BISTFWR1: RASWEBS Position */ -#define DDRPHY_BISTFWR1_RASWEBS_Msk (0x1ul << DDRPHY_BISTFWR1_RASWEBS_Pos) /*!< DDRPHY_T::BISTFWR1: RASWEBS Mask */ - -#define DDRPHY_BISTFWR1_CASWEBS_Pos (1) /*!< DDRPHY_T::BISTFWR1: CASWEBS Position */ -#define DDRPHY_BISTFWR1_CASWEBS_Msk (0x1ul << DDRPHY_BISTFWR1_CASWEBS_Pos) /*!< DDRPHY_T::BISTFWR1: CASWEBS Mask */ - -#define DDRPHY_BISTFWR1_PARWEBS_Pos (26) /*!< DDRPHY_T::BISTFWR1: PARWEBS Position */ -#define DDRPHY_BISTFWR1_PARWEBS_Msk (0x1ul << DDRPHY_BISTFWR1_PARWEBS_Pos) /*!< DDRPHY_T::BISTFWR1: PARWEBS Mask */ - -#define DDRPHY_BISTFWR1_DMWEBS_Pos (28) /*!< DDRPHY_T::BISTFWR1: DMWEBS Position */ -#define DDRPHY_BISTFWR1_DMWEBS_Msk (0xful << DDRPHY_BISTFWR1_DMWEBS_Pos) /*!< DDRPHY_T::BISTFWR1: DMWEBS Mask */ - -#define DDRPHY_BISTFWR2_DQWEBS_Pos (0) /*!< DDRPHY_T::BISTFWR2: DQWEBS Position */ -#define DDRPHY_BISTFWR2_DQWEBS_Msk (0xfffffffful << DDRPHY_BISTFWR2_DQWEBS_Pos) /*!< DDRPHY_T::BISTFWR2: DQWEBS Mask */ - -#define DDRPHY_AACR_AATR_Pos (0) /*!< DDRPHY_T::AACR: AATR Position */ -#define DDRPHY_AACR_AATR_Msk (0x3ffffffful << DDRPHY_AACR_AATR_Pos) /*!< DDRPHY_T::AACR: AATR Mask */ - -#define DDRPHY_AACR_AAENC_Pos (30) /*!< DDRPHY_T::AACR: AAENC Position */ -#define DDRPHY_AACR_AAENC_Msk (0x1ul << DDRPHY_AACR_AAENC_Pos) /*!< DDRPHY_T::AACR: AAENC Mask */ - -#define DDRPHY_AACR_AAOENC_Pos (31) /*!< DDRPHY_T::AACR: AAOENC Position */ -#define DDRPHY_AACR_AAOENC_Msk (0x1ul << DDRPHY_AACR_AAOENC_Pos) /*!< DDRPHY_T::AACR: AAOENC Mask */ - -#define DDRPHY_GPR0_GPR0_Pos (0) /*!< DDRPHY_T::GPR0: GPR0 Position */ -#define DDRPHY_GPR0_GPR0_Msk (0xfffffffful << DDRPHY_GPR0_GPR0_Pos) /*!< DDRPHY_T::GPR0: GPR0 Mask */ - -#define DDRPHY_GPR1_GPR1_Pos (0) /*!< DDRPHY_T::GPR1: GPR1 Position */ -#define DDRPHY_GPR1_GPR1_Msk (0xfffffffful << DDRPHY_GPR1_GPR1_Pos) /*!< DDRPHY_T::GPR1: GPR1 Mask */ - -#define DDRPHY_ZQ0CR0_ZDATA_Pos (0) /*!< DDRPHY_T::ZQ0CR0: ZDATA Position */ -#define DDRPHY_ZQ0CR0_ZDATA_Msk (0xffffffful << DDRPHY_ZQ0CR0_ZDATA_Pos) /*!< DDRPHY_T::ZQ0CR0: ZDATA Mask */ - -#define DDRPHY_ZQ0CR0_ZDEN_Pos (28) /*!< DDRPHY_T::ZQ0CR0: ZDEN Position */ -#define DDRPHY_ZQ0CR0_ZDEN_Msk (0x1ul << DDRPHY_ZQ0CR0_ZDEN_Pos) /*!< DDRPHY_T::ZQ0CR0: ZDEN Mask */ - -#define DDRPHY_ZQ0CR0_ZCALBYP_Pos (29) /*!< DDRPHY_T::ZQ0CR0: ZCALBYP Position */ -#define DDRPHY_ZQ0CR0_ZCALBYP_Msk (0x1ul << DDRPHY_ZQ0CR0_ZCALBYP_Pos) /*!< DDRPHY_T::ZQ0CR0: ZCALBYP Mask */ - -#define DDRPHY_ZQ0CR0_ZCALEN_Pos (30) /*!< DDRPHY_T::ZQ0CR0: ZCALEN Position */ -#define DDRPHY_ZQ0CR0_ZCALEN_Msk (0x1ul << DDRPHY_ZQ0CR0_ZCALEN_Pos) /*!< DDRPHY_T::ZQ0CR0: ZCALEN Mask */ - -#define DDRPHY_ZQ0CR0_ZQPD_Pos (31) /*!< DDRPHY_T::ZQ0CR0: ZQPD Position */ -#define DDRPHY_ZQ0CR0_ZQPD_Msk (0x1ul << DDRPHY_ZQ0CR0_ZQPD_Pos) /*!< DDRPHY_T::ZQ0CR0: ZQPD Mask */ - -#define DDRPHY_ZQ0CR1_ZPROG_Pos (0) /*!< DDRPHY_T::ZQ0CR1: ZPROG Position */ -#define DDRPHY_ZQ0CR1_ZPROG_Msk (0xfful << DDRPHY_ZQ0CR1_ZPROG_Pos) /*!< DDRPHY_T::ZQ0CR1: ZPROG Mask */ - -#define DDRPHY_ZQ0CR1_DFICU0_Pos (12) /*!< DDRPHY_T::ZQ0CR1: DFICU0 Position */ -#define DDRPHY_ZQ0CR1_DFICU0_Msk (0x1ul << DDRPHY_ZQ0CR1_DFICU0_Pos) /*!< DDRPHY_T::ZQ0CR1: DFICU0 Mask */ - -#define DDRPHY_ZQ0CR1_DFICU1_Pos (13) /*!< DDRPHY_T::ZQ0CR1: DFICU1 Position */ -#define DDRPHY_ZQ0CR1_DFICU1_Msk (0x1ul << DDRPHY_ZQ0CR1_DFICU1_Pos) /*!< DDRPHY_T::ZQ0CR1: DFICU1 Mask */ - -#define DDRPHY_ZQ0CR1_DFICCU_Pos (14) /*!< DDRPHY_T::ZQ0CR1: DFICCU Position */ -#define DDRPHY_ZQ0CR1_DFICCU_Msk (0x1ul << DDRPHY_ZQ0CR1_DFICCU_Pos) /*!< DDRPHY_T::ZQ0CR1: DFICCU Mask */ - -#define DDRPHY_ZQ0CR1_DFIPU0_Pos (16) /*!< DDRPHY_T::ZQ0CR1: DFIPU0 Position */ -#define DDRPHY_ZQ0CR1_DFIPU0_Msk (0x1ul << DDRPHY_ZQ0CR1_DFIPU0_Pos) /*!< DDRPHY_T::ZQ0CR1: DFIPU0 Mask */ - -#define DDRPHY_ZQ0CR1_DFIPU1_Pos (17) /*!< DDRPHY_T::ZQ0CR1: DFIPU1 Position */ -#define DDRPHY_ZQ0CR1_DFIPU1_Msk (0x1ul << DDRPHY_ZQ0CR1_DFIPU1_Pos) /*!< DDRPHY_T::ZQ0CR1: DFIPU1 Mask */ - -#define DDRPHY_ZQ0SR0_ZCTRL_Pos (0) /*!< DDRPHY_T::ZQ0SR0: ZCTRL Position */ -#define DDRPHY_ZQ0SR0_ZCTRL_Msk (0xffffffful << DDRPHY_ZQ0SR0_ZCTRL_Pos) /*!< DDRPHY_T::ZQ0SR0: ZCTRL Mask */ - -#define DDRPHY_ZQ0SR0_ZERR_Pos (30) /*!< DDRPHY_T::ZQ0SR0: ZERR Position */ -#define DDRPHY_ZQ0SR0_ZERR_Msk (0x1ul << DDRPHY_ZQ0SR0_ZERR_Pos) /*!< DDRPHY_T::ZQ0SR0: ZERR Mask */ - -#define DDRPHY_ZQ0SR0_ZDONE_Pos (31) /*!< DDRPHY_T::ZQ0SR0: ZDONE Position */ -#define DDRPHY_ZQ0SR0_ZDONE_Msk (0x1ul << DDRPHY_ZQ0SR0_ZDONE_Pos) /*!< DDRPHY_T::ZQ0SR0: ZDONE Mask */ - -#define DDRPHY_ZQ0SR1_ZPD_Pos (0) /*!< DDRPHY_T::ZQ0SR1: ZPD Position */ -#define DDRPHY_ZQ0SR1_ZPD_Msk (0x3ul << DDRPHY_ZQ0SR1_ZPD_Pos) /*!< DDRPHY_T::ZQ0SR1: ZPD Mask */ - -#define DDRPHY_ZQ0SR1_ZPU_Pos (2) /*!< DDRPHY_T::ZQ0SR1: ZPU Position */ -#define DDRPHY_ZQ0SR1_ZPU_Msk (0x3ul << DDRPHY_ZQ0SR1_ZPU_Pos) /*!< DDRPHY_T::ZQ0SR1: ZPU Mask */ - -#define DDRPHY_ZQ0SR1_OPD_Pos (4) /*!< DDRPHY_T::ZQ0SR1: OPD Position */ -#define DDRPHY_ZQ0SR1_OPD_Msk (0x3ul << DDRPHY_ZQ0SR1_OPD_Pos) /*!< DDRPHY_T::ZQ0SR1: OPD Mask */ - -#define DDRPHY_ZQ0SR1_OPU_Pos (6) /*!< DDRPHY_T::ZQ0SR1: OPU Position */ -#define DDRPHY_ZQ0SR1_OPU_Msk (0x3ul << DDRPHY_ZQ0SR1_OPU_Pos) /*!< DDRPHY_T::ZQ0SR1: OPU Mask */ - -#define DDRPHY_ZQ1CR0_ZDATA_Pos (0) /*!< DDRPHY_T::ZQ1CR0: ZDATA Position */ -#define DDRPHY_ZQ1CR0_ZDATA_Msk (0xffffffful << DDRPHY_ZQ1CR0_ZDATA_Pos) /*!< DDRPHY_T::ZQ1CR0: ZDATA Mask */ - -#define DDRPHY_ZQ1CR0_ZDEN_Pos (28) /*!< DDRPHY_T::ZQ1CR0: ZDEN Position */ -#define DDRPHY_ZQ1CR0_ZDEN_Msk (0x1ul << DDRPHY_ZQ1CR0_ZDEN_Pos) /*!< DDRPHY_T::ZQ1CR0: ZDEN Mask */ - -#define DDRPHY_ZQ1CR0_ZCALBYP_Pos (29) /*!< DDRPHY_T::ZQ1CR0: ZCALBYP Position */ -#define DDRPHY_ZQ1CR0_ZCALBYP_Msk (0x1ul << DDRPHY_ZQ1CR0_ZCALBYP_Pos) /*!< DDRPHY_T::ZQ1CR0: ZCALBYP Mask */ - -#define DDRPHY_ZQ1CR0_ZCALEN_Pos (30) /*!< DDRPHY_T::ZQ1CR0: ZCALEN Position */ -#define DDRPHY_ZQ1CR0_ZCALEN_Msk (0x1ul << DDRPHY_ZQ1CR0_ZCALEN_Pos) /*!< DDRPHY_T::ZQ1CR0: ZCALEN Mask */ - -#define DDRPHY_ZQ1CR0_ZQPD_Pos (31) /*!< DDRPHY_T::ZQ1CR0: ZQPD Position */ -#define DDRPHY_ZQ1CR0_ZQPD_Msk (0x1ul << DDRPHY_ZQ1CR0_ZQPD_Pos) /*!< DDRPHY_T::ZQ1CR0: ZQPD Mask */ - -#define DDRPHY_ZQ1CR1_ZPROG_Pos (0) /*!< DDRPHY_T::ZQ1CR1: ZPROG Position */ -#define DDRPHY_ZQ1CR1_ZPROG_Msk (0xfful << DDRPHY_ZQ1CR1_ZPROG_Pos) /*!< DDRPHY_T::ZQ1CR1: ZPROG Mask */ - -#define DDRPHY_ZQ1CR1_DFICU0_Pos (12) /*!< DDRPHY_T::ZQ1CR1: DFICU0 Position */ -#define DDRPHY_ZQ1CR1_DFICU0_Msk (0x1ul << DDRPHY_ZQ1CR1_DFICU0_Pos) /*!< DDRPHY_T::ZQ1CR1: DFICU0 Mask */ - -#define DDRPHY_ZQ1CR1_DFICU1_Pos (13) /*!< DDRPHY_T::ZQ1CR1: DFICU1 Position */ -#define DDRPHY_ZQ1CR1_DFICU1_Msk (0x1ul << DDRPHY_ZQ1CR1_DFICU1_Pos) /*!< DDRPHY_T::ZQ1CR1: DFICU1 Mask */ - -#define DDRPHY_ZQ1CR1_DFICCU_Pos (14) /*!< DDRPHY_T::ZQ1CR1: DFICCU Position */ -#define DDRPHY_ZQ1CR1_DFICCU_Msk (0x1ul << DDRPHY_ZQ1CR1_DFICCU_Pos) /*!< DDRPHY_T::ZQ1CR1: DFICCU Mask */ - -#define DDRPHY_ZQ1CR1_DFIPU0_Pos (16) /*!< DDRPHY_T::ZQ1CR1: DFIPU0 Position */ -#define DDRPHY_ZQ1CR1_DFIPU0_Msk (0x1ul << DDRPHY_ZQ1CR1_DFIPU0_Pos) /*!< DDRPHY_T::ZQ1CR1: DFIPU0 Mask */ - -#define DDRPHY_ZQ1CR1_DFIPU1_Pos (17) /*!< DDRPHY_T::ZQ1CR1: DFIPU1 Position */ -#define DDRPHY_ZQ1CR1_DFIPU1_Msk (0x1ul << DDRPHY_ZQ1CR1_DFIPU1_Pos) /*!< DDRPHY_T::ZQ1CR1: DFIPU1 Mask */ - -#define DDRPHY_ZQ1SR0_ZCTRL_Pos (0) /*!< DDRPHY_T::ZQ1SR0: ZCTRL Position */ -#define DDRPHY_ZQ1SR0_ZCTRL_Msk (0xffffffful << DDRPHY_ZQ1SR0_ZCTRL_Pos) /*!< DDRPHY_T::ZQ1SR0: ZCTRL Mask */ - -#define DDRPHY_ZQ1SR0_ZERR_Pos (30) /*!< DDRPHY_T::ZQ1SR0: ZERR Position */ -#define DDRPHY_ZQ1SR0_ZERR_Msk (0x1ul << DDRPHY_ZQ1SR0_ZERR_Pos) /*!< DDRPHY_T::ZQ1SR0: ZERR Mask */ - -#define DDRPHY_ZQ1SR0_ZDONE_Pos (31) /*!< DDRPHY_T::ZQ1SR0: ZDONE Position */ -#define DDRPHY_ZQ1SR0_ZDONE_Msk (0x1ul << DDRPHY_ZQ1SR0_ZDONE_Pos) /*!< DDRPHY_T::ZQ1SR0: ZDONE Mask */ - -#define DDRPHY_ZQ1SR1_ZPD_Pos (0) /*!< DDRPHY_T::ZQ1SR1: ZPD Position */ -#define DDRPHY_ZQ1SR1_ZPD_Msk (0x3ul << DDRPHY_ZQ1SR1_ZPD_Pos) /*!< DDRPHY_T::ZQ1SR1: ZPD Mask */ - -#define DDRPHY_ZQ1SR1_ZPU_Pos (2) /*!< DDRPHY_T::ZQ1SR1: ZPU Position */ -#define DDRPHY_ZQ1SR1_ZPU_Msk (0x3ul << DDRPHY_ZQ1SR1_ZPU_Pos) /*!< DDRPHY_T::ZQ1SR1: ZPU Mask */ - -#define DDRPHY_ZQ1SR1_OPD_Pos (4) /*!< DDRPHY_T::ZQ1SR1: OPD Position */ -#define DDRPHY_ZQ1SR1_OPD_Msk (0x3ul << DDRPHY_ZQ1SR1_OPD_Pos) /*!< DDRPHY_T::ZQ1SR1: OPD Mask */ - -#define DDRPHY_ZQ1SR1_OPU_Pos (6) /*!< DDRPHY_T::ZQ1SR1: OPU Position */ -#define DDRPHY_ZQ1SR1_OPU_Msk (0x3ul << DDRPHY_ZQ1SR1_OPU_Pos) /*!< DDRPHY_T::ZQ1SR1: OPU Mask */ - -#define DDRPHY_ZQ2CR0_ZDATA_Pos (0) /*!< DDRPHY_T::ZQ2CR0: ZDATA Position */ -#define DDRPHY_ZQ2CR0_ZDATA_Msk (0xffffffful << DDRPHY_ZQ2CR0_ZDATA_Pos) /*!< DDRPHY_T::ZQ2CR0: ZDATA Mask */ - -#define DDRPHY_ZQ2CR0_ZDEN_Pos (28) /*!< DDRPHY_T::ZQ2CR0: ZDEN Position */ -#define DDRPHY_ZQ2CR0_ZDEN_Msk (0x1ul << DDRPHY_ZQ2CR0_ZDEN_Pos) /*!< DDRPHY_T::ZQ2CR0: ZDEN Mask */ - -#define DDRPHY_ZQ2CR0_ZCALBYP_Pos (29) /*!< DDRPHY_T::ZQ2CR0: ZCALBYP Position */ -#define DDRPHY_ZQ2CR0_ZCALBYP_Msk (0x1ul << DDRPHY_ZQ2CR0_ZCALBYP_Pos) /*!< DDRPHY_T::ZQ2CR0: ZCALBYP Mask */ - -#define DDRPHY_ZQ2CR0_ZCALEN_Pos (30) /*!< DDRPHY_T::ZQ2CR0: ZCALEN Position */ -#define DDRPHY_ZQ2CR0_ZCALEN_Msk (0x1ul << DDRPHY_ZQ2CR0_ZCALEN_Pos) /*!< DDRPHY_T::ZQ2CR0: ZCALEN Mask */ - -#define DDRPHY_ZQ2CR0_ZQPD_Pos (31) /*!< DDRPHY_T::ZQ2CR0: ZQPD Position */ -#define DDRPHY_ZQ2CR0_ZQPD_Msk (0x1ul << DDRPHY_ZQ2CR0_ZQPD_Pos) /*!< DDRPHY_T::ZQ2CR0: ZQPD Mask */ - -#define DDRPHY_ZQ2CR1_ZPROG_Pos (0) /*!< DDRPHY_T::ZQ2CR1: ZPROG Position */ -#define DDRPHY_ZQ2CR1_ZPROG_Msk (0xfful << DDRPHY_ZQ2CR1_ZPROG_Pos) /*!< DDRPHY_T::ZQ2CR1: ZPROG Mask */ - -#define DDRPHY_ZQ2CR1_DFICU0_Pos (12) /*!< DDRPHY_T::ZQ2CR1: DFICU0 Position */ -#define DDRPHY_ZQ2CR1_DFICU0_Msk (0x1ul << DDRPHY_ZQ2CR1_DFICU0_Pos) /*!< DDRPHY_T::ZQ2CR1: DFICU0 Mask */ - -#define DDRPHY_ZQ2CR1_DFICU1_Pos (13) /*!< DDRPHY_T::ZQ2CR1: DFICU1 Position */ -#define DDRPHY_ZQ2CR1_DFICU1_Msk (0x1ul << DDRPHY_ZQ2CR1_DFICU1_Pos) /*!< DDRPHY_T::ZQ2CR1: DFICU1 Mask */ - -#define DDRPHY_ZQ2CR1_DFICCU_Pos (14) /*!< DDRPHY_T::ZQ2CR1: DFICCU Position */ -#define DDRPHY_ZQ2CR1_DFICCU_Msk (0x1ul << DDRPHY_ZQ2CR1_DFICCU_Pos) /*!< DDRPHY_T::ZQ2CR1: DFICCU Mask */ - -#define DDRPHY_ZQ2CR1_DFIPU0_Pos (16) /*!< DDRPHY_T::ZQ2CR1: DFIPU0 Position */ -#define DDRPHY_ZQ2CR1_DFIPU0_Msk (0x1ul << DDRPHY_ZQ2CR1_DFIPU0_Pos) /*!< DDRPHY_T::ZQ2CR1: DFIPU0 Mask */ - -#define DDRPHY_ZQ2CR1_DFIPU1_Pos (17) /*!< DDRPHY_T::ZQ2CR1: DFIPU1 Position */ -#define DDRPHY_ZQ2CR1_DFIPU1_Msk (0x1ul << DDRPHY_ZQ2CR1_DFIPU1_Pos) /*!< DDRPHY_T::ZQ2CR1: DFIPU1 Mask */ - -#define DDRPHY_ZQ2SR0_ZCTRL_Pos (0) /*!< DDRPHY_T::ZQ2SR0: ZCTRL Position */ -#define DDRPHY_ZQ2SR0_ZCTRL_Msk (0xffffffful << DDRPHY_ZQ2SR0_ZCTRL_Pos) /*!< DDRPHY_T::ZQ2SR0: ZCTRL Mask */ - -#define DDRPHY_ZQ2SR0_ZERR_Pos (30) /*!< DDRPHY_T::ZQ2SR0: ZERR Position */ -#define DDRPHY_ZQ2SR0_ZERR_Msk (0x1ul << DDRPHY_ZQ2SR0_ZERR_Pos) /*!< DDRPHY_T::ZQ2SR0: ZERR Mask */ - -#define DDRPHY_ZQ2SR0_ZDONE_Pos (31) /*!< DDRPHY_T::ZQ2SR0: ZDONE Position */ -#define DDRPHY_ZQ2SR0_ZDONE_Msk (0x1ul << DDRPHY_ZQ2SR0_ZDONE_Pos) /*!< DDRPHY_T::ZQ2SR0: ZDONE Mask */ - -#define DDRPHY_ZQ2SR1_ZPD_Pos (0) /*!< DDRPHY_T::ZQ2SR1: ZPD Position */ -#define DDRPHY_ZQ2SR1_ZPD_Msk (0x3ul << DDRPHY_ZQ2SR1_ZPD_Pos) /*!< DDRPHY_T::ZQ2SR1: ZPD Mask */ - -#define DDRPHY_ZQ2SR1_ZPU_Pos (2) /*!< DDRPHY_T::ZQ2SR1: ZPU Position */ -#define DDRPHY_ZQ2SR1_ZPU_Msk (0x3ul << DDRPHY_ZQ2SR1_ZPU_Pos) /*!< DDRPHY_T::ZQ2SR1: ZPU Mask */ - -#define DDRPHY_ZQ2SR1_OPD_Pos (4) /*!< DDRPHY_T::ZQ2SR1: OPD Position */ -#define DDRPHY_ZQ2SR1_OPD_Msk (0x3ul << DDRPHY_ZQ2SR1_OPD_Pos) /*!< DDRPHY_T::ZQ2SR1: OPD Mask */ - -#define DDRPHY_ZQ2SR1_OPU_Pos (6) /*!< DDRPHY_T::ZQ2SR1: OPU Position */ -#define DDRPHY_ZQ2SR1_OPU_Msk (0x3ul << DDRPHY_ZQ2SR1_OPU_Pos) /*!< DDRPHY_T::ZQ2SR1: OPU Mask */ - -#define DDRPHY_ZQ3CR0_ZDATA_Pos (0) /*!< DDRPHY_T::ZQ3CR0: ZDATA Position */ -#define DDRPHY_ZQ3CR0_ZDATA_Msk (0xffffffful << DDRPHY_ZQ3CR0_ZDATA_Pos) /*!< DDRPHY_T::ZQ3CR0: ZDATA Mask */ - -#define DDRPHY_ZQ3CR0_ZDEN_Pos (28) /*!< DDRPHY_T::ZQ3CR0: ZDEN Position */ -#define DDRPHY_ZQ3CR0_ZDEN_Msk (0x1ul << DDRPHY_ZQ3CR0_ZDEN_Pos) /*!< DDRPHY_T::ZQ3CR0: ZDEN Mask */ - -#define DDRPHY_ZQ3CR0_ZCALBYP_Pos (29) /*!< DDRPHY_T::ZQ3CR0: ZCALBYP Position */ -#define DDRPHY_ZQ3CR0_ZCALBYP_Msk (0x1ul << DDRPHY_ZQ3CR0_ZCALBYP_Pos) /*!< DDRPHY_T::ZQ3CR0: ZCALBYP Mask */ - -#define DDRPHY_ZQ3CR0_ZCALEN_Pos (30) /*!< DDRPHY_T::ZQ3CR0: ZCALEN Position */ -#define DDRPHY_ZQ3CR0_ZCALEN_Msk (0x1ul << DDRPHY_ZQ3CR0_ZCALEN_Pos) /*!< DDRPHY_T::ZQ3CR0: ZCALEN Mask */ - -#define DDRPHY_ZQ3CR0_ZQPD_Pos (31) /*!< DDRPHY_T::ZQ3CR0: ZQPD Position */ -#define DDRPHY_ZQ3CR0_ZQPD_Msk (0x1ul << DDRPHY_ZQ3CR0_ZQPD_Pos) /*!< DDRPHY_T::ZQ3CR0: ZQPD Mask */ - -#define DDRPHY_ZQ3CR1_ZPROG_Pos (0) /*!< DDRPHY_T::ZQ3CR1: ZPROG Position */ -#define DDRPHY_ZQ3CR1_ZPROG_Msk (0xfful << DDRPHY_ZQ3CR1_ZPROG_Pos) /*!< DDRPHY_T::ZQ3CR1: ZPROG Mask */ - -#define DDRPHY_ZQ3CR1_DFICU0_Pos (12) /*!< DDRPHY_T::ZQ3CR1: DFICU0 Position */ -#define DDRPHY_ZQ3CR1_DFICU0_Msk (0x1ul << DDRPHY_ZQ3CR1_DFICU0_Pos) /*!< DDRPHY_T::ZQ3CR1: DFICU0 Mask */ - -#define DDRPHY_ZQ3CR1_DFICU1_Pos (13) /*!< DDRPHY_T::ZQ3CR1: DFICU1 Position */ -#define DDRPHY_ZQ3CR1_DFICU1_Msk (0x1ul << DDRPHY_ZQ3CR1_DFICU1_Pos) /*!< DDRPHY_T::ZQ3CR1: DFICU1 Mask */ - -#define DDRPHY_ZQ3CR1_DFICCU_Pos (14) /*!< DDRPHY_T::ZQ3CR1: DFICCU Position */ -#define DDRPHY_ZQ3CR1_DFICCU_Msk (0x1ul << DDRPHY_ZQ3CR1_DFICCU_Pos) /*!< DDRPHY_T::ZQ3CR1: DFICCU Mask */ - -#define DDRPHY_ZQ3CR1_DFIPU0_Pos (16) /*!< DDRPHY_T::ZQ3CR1: DFIPU0 Position */ -#define DDRPHY_ZQ3CR1_DFIPU0_Msk (0x1ul << DDRPHY_ZQ3CR1_DFIPU0_Pos) /*!< DDRPHY_T::ZQ3CR1: DFIPU0 Mask */ - -#define DDRPHY_ZQ3CR1_DFIPU1_Pos (17) /*!< DDRPHY_T::ZQ3CR1: DFIPU1 Position */ -#define DDRPHY_ZQ3CR1_DFIPU1_Msk (0x1ul << DDRPHY_ZQ3CR1_DFIPU1_Pos) /*!< DDRPHY_T::ZQ3CR1: DFIPU1 Mask */ - -#define DDRPHY_ZQ3SR0_ZCTRL_Pos (0) /*!< DDRPHY_T::ZQ3SR0: ZCTRL Position */ -#define DDRPHY_ZQ3SR0_ZCTRL_Msk (0xffffffful << DDRPHY_ZQ3SR0_ZCTRL_Pos) /*!< DDRPHY_T::ZQ3SR0: ZCTRL Mask */ - -#define DDRPHY_ZQ3SR0_ZERR_Pos (30) /*!< DDRPHY_T::ZQ3SR0: ZERR Position */ -#define DDRPHY_ZQ3SR0_ZERR_Msk (0x1ul << DDRPHY_ZQ3SR0_ZERR_Pos) /*!< DDRPHY_T::ZQ3SR0: ZERR Mask */ - -#define DDRPHY_ZQ3SR0_ZDONE_Pos (31) /*!< DDRPHY_T::ZQ3SR0: ZDONE Position */ -#define DDRPHY_ZQ3SR0_ZDONE_Msk (0x1ul << DDRPHY_ZQ3SR0_ZDONE_Pos) /*!< DDRPHY_T::ZQ3SR0: ZDONE Mask */ - -#define DDRPHY_ZQ3SR1_ZPD_Pos (0) /*!< DDRPHY_T::ZQ3SR1: ZPD Position */ -#define DDRPHY_ZQ3SR1_ZPD_Msk (0x3ul << DDRPHY_ZQ3SR1_ZPD_Pos) /*!< DDRPHY_T::ZQ3SR1: ZPD Mask */ - -#define DDRPHY_ZQ3SR1_ZPU_Pos (2) /*!< DDRPHY_T::ZQ3SR1: ZPU Position */ -#define DDRPHY_ZQ3SR1_ZPU_Msk (0x3ul << DDRPHY_ZQ3SR1_ZPU_Pos) /*!< DDRPHY_T::ZQ3SR1: ZPU Mask */ - -#define DDRPHY_ZQ3SR1_OPD_Pos (4) /*!< DDRPHY_T::ZQ3SR1: OPD Position */ -#define DDRPHY_ZQ3SR1_OPD_Msk (0x3ul << DDRPHY_ZQ3SR1_OPD_Pos) /*!< DDRPHY_T::ZQ3SR1: OPD Mask */ - -#define DDRPHY_ZQ3SR1_OPU_Pos (6) /*!< DDRPHY_T::ZQ3SR1: OPU Position */ -#define DDRPHY_ZQ3SR1_OPU_Msk (0x3ul << DDRPHY_ZQ3SR1_OPU_Pos) /*!< DDRPHY_T::ZQ3SR1: OPU Mask */ - -#define DDRPHY_DX0GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX0GCR: DXEN Position */ -#define DDRPHY_DX0GCR_DXEN_Msk (0x1ul << DDRPHY_DX0GCR_DXEN_Pos) /*!< DDRPHY_T::DX0GCR: DXEN Mask */ - -#define DDRPHY_DX0GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX0GCR: DQSODT Position */ -#define DDRPHY_DX0GCR_DQSODT_Msk (0x1ul << DDRPHY_DX0GCR_DQSODT_Pos) /*!< DDRPHY_T::DX0GCR: DQSODT Mask */ - -#define DDRPHY_DX0GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX0GCR: DQODT Position */ -#define DDRPHY_DX0GCR_DQODT_Msk (0x1ul << DDRPHY_DX0GCR_DQODT_Pos) /*!< DDRPHY_T::DX0GCR: DQODT Mask */ - -#define DDRPHY_DX0GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX0GCR: DXIOM Position */ -#define DDRPHY_DX0GCR_DXIOM_Msk (0x1ul << DDRPHY_DX0GCR_DXIOM_Pos) /*!< DDRPHY_T::DX0GCR: DXIOM Mask */ - -#define DDRPHY_DX0GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX0GCR: DXPDD Position */ -#define DDRPHY_DX0GCR_DXPDD_Msk (0x1ul << DDRPHY_DX0GCR_DXPDD_Pos) /*!< DDRPHY_T::DX0GCR: DXPDD Mask */ - -#define DDRPHY_DX0GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX0GCR: DXPDR Position */ -#define DDRPHY_DX0GCR_DXPDR_Msk (0x1ul << DDRPHY_DX0GCR_DXPDR_Pos) /*!< DDRPHY_T::DX0GCR: DXPDR Mask */ - -#define DDRPHY_DX0GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX0GCR: DQSRPD Position */ -#define DDRPHY_DX0GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX0GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX0GCR: DQSRPD Mask */ - -#define DDRPHY_DX0GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX0GCR: DSEN Position */ -#define DDRPHY_DX0GCR_DSEN_Msk (0x3ul << DDRPHY_DX0GCR_DSEN_Pos) /*!< DDRPHY_T::DX0GCR: DSEN Mask */ - -#define DDRPHY_DX0GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX0GCR: DQSRTT Position */ -#define DDRPHY_DX0GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX0GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX0GCR: DQSRTT Mask */ - -#define DDRPHY_DX0GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX0GCR: DQRTT Position */ -#define DDRPHY_DX0GCR_DQRTT_Msk (0x1ul << DDRPHY_DX0GCR_DQRTT_Pos) /*!< DDRPHY_T::DX0GCR: DQRTT Mask */ - -#define DDRPHY_DX0GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX0GCR: RTTOH Position */ -#define DDRPHY_DX0GCR_RTTOH_Msk (0x3ul << DDRPHY_DX0GCR_RTTOH_Pos) /*!< DDRPHY_T::DX0GCR: RTTOH Mask */ - -#define DDRPHY_DX0GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX0GCR: RTTOAL Position */ -#define DDRPHY_DX0GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX0GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX0GCR: RTTOAL Mask */ - -#define DDRPHY_DX0GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX0GCR: DXOEO Position */ -#define DDRPHY_DX0GCR_DXOEO_Msk (0x3ul << DDRPHY_DX0GCR_DXOEO_Pos) /*!< DDRPHY_T::DX0GCR: DXOEO Mask */ - -#define DDRPHY_DX0GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX0GCR: PLLRST Position */ -#define DDRPHY_DX0GCR_PLLRST_Msk (0x1ul << DDRPHY_DX0GCR_PLLRST_Pos) /*!< DDRPHY_T::DX0GCR: PLLRST Mask */ - -#define DDRPHY_DX0GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX0GCR: PLLPD Position */ -#define DDRPHY_DX0GCR_PLLPD_Msk (0x1ul << DDRPHY_DX0GCR_PLLPD_Pos) /*!< DDRPHY_T::DX0GCR: PLLPD Mask */ - -#define DDRPHY_DX0GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX0GCR: GSHIFT Position */ -#define DDRPHY_DX0GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX0GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX0GCR: GSHIFT Mask */ - -#define DDRPHY_DX0GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX0GCR: PLLBYP Position */ -#define DDRPHY_DX0GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX0GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX0GCR: PLLBYP Mask */ - -#define DDRPHY_DX0GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX0GCR: WLRKEN Position */ -#define DDRPHY_DX0GCR_WLRKEN_Msk (0xful << DDRPHY_DX0GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX0GCR: WLRKEN Mask */ - -#define DDRPHY_DX0GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX0GCR: MDLEN Position */ -#define DDRPHY_DX0GCR_MDLEN_Msk (0x1ul << DDRPHY_DX0GCR_MDLEN_Pos) /*!< DDRPHY_T::DX0GCR: MDLEN Mask */ - -#define DDRPHY_DX0GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX0GCR: CALBYP Position */ -#define DDRPHY_DX0GCR_CALBYP_Msk (0x1ul << DDRPHY_DX0GCR_CALBYP_Pos) /*!< DDRPHY_T::DX0GCR: CALBYP Mask */ - -#define DDRPHY_DX0GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX0GSR0: WDQCAL Position */ -#define DDRPHY_DX0GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX0GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX0GSR0: WDQCAL Mask */ - -#define DDRPHY_DX0GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX0GSR0: RDQSCAL Position */ -#define DDRPHY_DX0GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX0GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX0GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX0GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX0GSR0: RDQSNCAL Position */ -#define DDRPHY_DX0GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX0GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX0GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX0GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX0GSR0: GDQSCAL Position */ -#define DDRPHY_DX0GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX0GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX0GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX0GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX0GSR0: WLCAL Position */ -#define DDRPHY_DX0GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX0GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX0GSR0: WLCAL Mask */ - -#define DDRPHY_DX0GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX0GSR0: WLDONE Position */ -#define DDRPHY_DX0GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX0GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX0GSR0: WLDONE Mask */ - -#define DDRPHY_DX0GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX0GSR0: WLERR Position */ -#define DDRPHY_DX0GSR0_WLERR_Msk (0x1ul << DDRPHY_DX0GSR0_WLERR_Pos) /*!< DDRPHY_T::DX0GSR0: WLERR Mask */ - -#define DDRPHY_DX0GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX0GSR0: WLPRD Position */ -#define DDRPHY_DX0GSR0_WLPRD_Msk (0xfful << DDRPHY_DX0GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX0GSR0: WLPRD Mask */ - -#define DDRPHY_DX0GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX0GSR0: DPLOCK Position */ -#define DDRPHY_DX0GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX0GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX0GSR0: DPLOCK Mask */ - -#define DDRPHY_DX0GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX0GSR0: GDQSPRD Position */ -#define DDRPHY_DX0GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX0GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX0GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX0GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX0GSR0: QSGERR Position */ -#define DDRPHY_DX0GSR0_QSGERR_Msk (0xful << DDRPHY_DX0GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX0GSR0: QSGERR Mask */ - -#define DDRPHY_DX0GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX0GSR0: WLDQ Position */ -#define DDRPHY_DX0GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX0GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX0GSR0: WLDQ Mask */ - -#define DDRPHY_DX0GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX0GSR1: DLTDONE Position */ -#define DDRPHY_DX0GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX0GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX0GSR1: DLTDONE Mask */ - -#define DDRPHY_DX0GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX0GSR1: DLTCODE Position */ -#define DDRPHY_DX0GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX0GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX0GSR1: DLTCODE Mask */ - -#define DDRPHY_DX0BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX0BDLR0: DQ0WBD Position */ -#define DDRPHY_DX0BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX0BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX0BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX0BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX0BDLR0: DQ1WBD Position */ -#define DDRPHY_DX0BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX0BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX0BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX0BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX0BDLR0: DQ2WBD Position */ -#define DDRPHY_DX0BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX0BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX0BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX0BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX0BDLR0: DQ3WBD Position */ -#define DDRPHY_DX0BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX0BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX0BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX0BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX0BDLR0: DQ4WBD Position */ -#define DDRPHY_DX0BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX0BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX0BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX0BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX0BDLR1: DQ5WBD Position */ -#define DDRPHY_DX0BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX0BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX0BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX0BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX0BDLR1: DQ6WBD Position */ -#define DDRPHY_DX0BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX0BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX0BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX0BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX0BDLR1: DQ7WBD Position */ -#define DDRPHY_DX0BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX0BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX0BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX0BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX0BDLR1: DMWBD Position */ -#define DDRPHY_DX0BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX0BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX0BDLR1: DMWBD Mask */ - -#define DDRPHY_DX0BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX0BDLR1: DSWBD Position */ -#define DDRPHY_DX0BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX0BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX0BDLR1: DSWBD Mask */ - -#define DDRPHY_DX0BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX0BDLR2: DSOEBD Position */ -#define DDRPHY_DX0BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX0BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX0BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX0BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX0BDLR2: DQOEBD Position */ -#define DDRPHY_DX0BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX0BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX0BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX0BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX0BDLR2: DSRBD Position */ -#define DDRPHY_DX0BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX0BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX0BDLR2: DSRBD Mask */ - -#define DDRPHY_DX0BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX0BDLR2: DSNRBD Position */ -#define DDRPHY_DX0BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX0BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX0BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX0BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX0BDLR3: DQ0RBD Position */ -#define DDRPHY_DX0BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX0BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX0BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX0BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX0BDLR3: DQ1RBD Position */ -#define DDRPHY_DX0BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX0BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX0BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX0BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX0BDLR3: DQ2RBD Position */ -#define DDRPHY_DX0BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX0BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX0BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX0BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX0BDLR3: DQ3RBD Position */ -#define DDRPHY_DX0BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX0BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX0BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX0BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX0BDLR3: DQ4RBD Position */ -#define DDRPHY_DX0BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX0BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX0BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX0BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX0BDLR4: DQ5RBD Position */ -#define DDRPHY_DX0BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX0BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX0BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX0BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX0BDLR4: DQ6RBD Position */ -#define DDRPHY_DX0BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX0BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX0BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX0BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX0BDLR4: DQ7RBD Position */ -#define DDRPHY_DX0BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX0BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX0BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX0BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX0BDLR4: DMRBD Position */ -#define DDRPHY_DX0BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX0BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX0BDLR4: DMRBD Mask */ - -#define DDRPHY_DX0LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX0LCDLR0: R0WLD Position */ -#define DDRPHY_DX0LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX0LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX0LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX0LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX0LCDLR0: R1WLD Position */ -#define DDRPHY_DX0LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX0LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX0LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX0LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX0LCDLR0: R2WLD Position */ -#define DDRPHY_DX0LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX0LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX0LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX0LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX0LCDLR0: R3WLD Position */ -#define DDRPHY_DX0LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX0LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX0LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX0LCDLR1_WDQD_Pos (0) /*!< DDRPHY_T::DX0LCDLR1: WDQD Position */ -#define DDRPHY_DX0LCDLR1_WDQD_Msk (0xfful << DDRPHY_DX0LCDLR1_WDQD_Pos) /*!< DDRPHY_T::DX0LCDLR1: WDQD Mask */ - -#define DDRPHY_DX0LCDLR1_RDQSD_Pos (8) /*!< DDRPHY_T::DX0LCDLR1: RDQSD Position */ -#define DDRPHY_DX0LCDLR1_RDQSD_Msk (0xfful << DDRPHY_DX0LCDLR1_RDQSD_Pos) /*!< DDRPHY_T::DX0LCDLR1: RDQSD Mask */ - -#define DDRPHY_DX0LCDLR1_RDQSND_Pos (16) /*!< DDRPHY_T::DX0LCDLR1: RDQSND Position */ -#define DDRPHY_DX0LCDLR1_RDQSND_Msk (0xfful << DDRPHY_DX0LCDLR1_RDQSND_Pos) /*!< DDRPHY_T::DX0LCDLR1: RDQSND Mask */ - -#define DDRPHY_DX0LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX0LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX0LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX0LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX0LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX0LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX0LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX0LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX0LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX0LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX0LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX0LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX0LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX0LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX0LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX0LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX0LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX0LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX0LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX0LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX0MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX0MDLR: IPRD Position */ -#define DDRPHY_DX0MDLR_IPRD_Msk (0xfful << DDRPHY_DX0MDLR_IPRD_Pos) /*!< DDRPHY_T::DX0MDLR: IPRD Mask */ - -#define DDRPHY_DX0MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX0MDLR: TPRD Position */ -#define DDRPHY_DX0MDLR_TPRD_Msk (0xfful << DDRPHY_DX0MDLR_TPRD_Pos) /*!< DDRPHY_T::DX0MDLR: TPRD Mask */ - -#define DDRPHY_DX0MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX0MDLR: MDLD Position */ -#define DDRPHY_DX0MDLR_MDLD_Msk (0xfful << DDRPHY_DX0MDLR_MDLD_Pos) /*!< DDRPHY_T::DX0MDLR: MDLD Mask */ - -#define DDRPHY_DX0GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX0GTR: R0DGSL Position */ -#define DDRPHY_DX0GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX0GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX0GTR: R0DGSL Mask */ - -#define DDRPHY_DX0GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX0GTR: R1DGSL Position */ -#define DDRPHY_DX0GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX0GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX0GTR: R1DGSL Mask */ - -#define DDRPHY_DX0GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX0GTR: R2DGSL Position */ -#define DDRPHY_DX0GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX0GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX0GTR: R2DGSL Mask */ - -#define DDRPHY_DX0GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX0GTR: R3DGSL Position */ -#define DDRPHY_DX0GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX0GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX0GTR: R3DGSL Mask */ - -#define DDRPHY_DX0GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX0GTR: R0WLSL Position */ -#define DDRPHY_DX0GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX0GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX0GTR: R0WLSL Mask */ - -#define DDRPHY_DX0GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX0GTR: R1WLSL Position */ -#define DDRPHY_DX0GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX0GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX0GTR: R1WLSL Mask */ - -#define DDRPHY_DX0GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX0GTR: R2WLSL Position */ -#define DDRPHY_DX0GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX0GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX0GTR: R2WLSL Mask */ - -#define DDRPHY_DX0GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX0GTR: R3WLSL Position */ -#define DDRPHY_DX0GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX0GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX0GTR: R3WLSL Mask */ - -#define DDRPHY_DX0GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX0GSR2: RDERR Position */ -#define DDRPHY_DX0GSR2_RDERR_Msk (0x1ul << DDRPHY_DX0GSR2_RDERR_Pos) /*!< DDRPHY_T::DX0GSR2: RDERR Mask */ - -#define DDRPHY_DX0GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX0GSR2: RDWN Position */ -#define DDRPHY_DX0GSR2_RDWN_Msk (0x1ul << DDRPHY_DX0GSR2_RDWN_Pos) /*!< DDRPHY_T::DX0GSR2: RDWN Mask */ - -#define DDRPHY_DX0GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX0GSR2: WDERR Position */ -#define DDRPHY_DX0GSR2_WDERR_Msk (0x1ul << DDRPHY_DX0GSR2_WDERR_Pos) /*!< DDRPHY_T::DX0GSR2: WDERR Mask */ - -#define DDRPHY_DX0GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX0GSR2: WDWN Position */ -#define DDRPHY_DX0GSR2_WDWN_Msk (0x1ul << DDRPHY_DX0GSR2_WDWN_Pos) /*!< DDRPHY_T::DX0GSR2: WDWN Mask */ - -#define DDRPHY_DX0GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX0GSR2: REERR Position */ -#define DDRPHY_DX0GSR2_REERR_Msk (0x1ul << DDRPHY_DX0GSR2_REERR_Pos) /*!< DDRPHY_T::DX0GSR2: REERR Mask */ - -#define DDRPHY_DX0GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX0GSR2: REWN Position */ -#define DDRPHY_DX0GSR2_REWN_Msk (0x1ul << DDRPHY_DX0GSR2_REWN_Pos) /*!< DDRPHY_T::DX0GSR2: REWN Mask */ - -#define DDRPHY_DX0GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX0GSR2: WEERR Position */ -#define DDRPHY_DX0GSR2_WEERR_Msk (0x1ul << DDRPHY_DX0GSR2_WEERR_Pos) /*!< DDRPHY_T::DX0GSR2: WEERR Mask */ - -#define DDRPHY_DX0GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX0GSR2: WEWN Position */ -#define DDRPHY_DX0GSR2_WEWN_Msk (0x1ul << DDRPHY_DX0GSR2_WEWN_Pos) /*!< DDRPHY_T::DX0GSR2: WEWN Mask */ - -#define DDRPHY_DX0GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX0GSR2: ESTAT Position */ -#define DDRPHY_DX0GSR2_ESTAT_Msk (0xful << DDRPHY_DX0GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX0GSR2: ESTAT Mask */ - -#define DDRPHY_DX1GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX1GCR: DXEN Position */ -#define DDRPHY_DX1GCR_DXEN_Msk (0x1ul << DDRPHY_DX1GCR_DXEN_Pos) /*!< DDRPHY_T::DX1GCR: DXEN Mask */ - -#define DDRPHY_DX1GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX1GCR: DQSODT Position */ -#define DDRPHY_DX1GCR_DQSODT_Msk (0x1ul << DDRPHY_DX1GCR_DQSODT_Pos) /*!< DDRPHY_T::DX1GCR: DQSODT Mask */ - -#define DDRPHY_DX1GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX1GCR: DQODT Position */ -#define DDRPHY_DX1GCR_DQODT_Msk (0x1ul << DDRPHY_DX1GCR_DQODT_Pos) /*!< DDRPHY_T::DX1GCR: DQODT Mask */ - -#define DDRPHY_DX1GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX1GCR: DXIOM Position */ -#define DDRPHY_DX1GCR_DXIOM_Msk (0x1ul << DDRPHY_DX1GCR_DXIOM_Pos) /*!< DDRPHY_T::DX1GCR: DXIOM Mask */ - -#define DDRPHY_DX1GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX1GCR: DXPDD Position */ -#define DDRPHY_DX1GCR_DXPDD_Msk (0x1ul << DDRPHY_DX1GCR_DXPDD_Pos) /*!< DDRPHY_T::DX1GCR: DXPDD Mask */ - -#define DDRPHY_DX1GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX1GCR: DXPDR Position */ -#define DDRPHY_DX1GCR_DXPDR_Msk (0x1ul << DDRPHY_DX1GCR_DXPDR_Pos) /*!< DDRPHY_T::DX1GCR: DXPDR Mask */ - -#define DDRPHY_DX1GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX1GCR: DQSRPD Position */ -#define DDRPHY_DX1GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX1GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX1GCR: DQSRPD Mask */ - -#define DDRPHY_DX1GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX1GCR: DSEN Position */ -#define DDRPHY_DX1GCR_DSEN_Msk (0x3ul << DDRPHY_DX1GCR_DSEN_Pos) /*!< DDRPHY_T::DX1GCR: DSEN Mask */ - -#define DDRPHY_DX1GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX1GCR: DQSRTT Position */ -#define DDRPHY_DX1GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX1GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX1GCR: DQSRTT Mask */ - -#define DDRPHY_DX1GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX1GCR: DQRTT Position */ -#define DDRPHY_DX1GCR_DQRTT_Msk (0x1ul << DDRPHY_DX1GCR_DQRTT_Pos) /*!< DDRPHY_T::DX1GCR: DQRTT Mask */ - -#define DDRPHY_DX1GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX1GCR: RTTOH Position */ -#define DDRPHY_DX1GCR_RTTOH_Msk (0x3ul << DDRPHY_DX1GCR_RTTOH_Pos) /*!< DDRPHY_T::DX1GCR: RTTOH Mask */ - -#define DDRPHY_DX1GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX1GCR: RTTOAL Position */ -#define DDRPHY_DX1GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX1GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX1GCR: RTTOAL Mask */ - -#define DDRPHY_DX1GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX1GCR: DXOEO Position */ -#define DDRPHY_DX1GCR_DXOEO_Msk (0x3ul << DDRPHY_DX1GCR_DXOEO_Pos) /*!< DDRPHY_T::DX1GCR: DXOEO Mask */ - -#define DDRPHY_DX1GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX1GCR: PLLRST Position */ -#define DDRPHY_DX1GCR_PLLRST_Msk (0x1ul << DDRPHY_DX1GCR_PLLRST_Pos) /*!< DDRPHY_T::DX1GCR: PLLRST Mask */ - -#define DDRPHY_DX1GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX1GCR: PLLPD Position */ -#define DDRPHY_DX1GCR_PLLPD_Msk (0x1ul << DDRPHY_DX1GCR_PLLPD_Pos) /*!< DDRPHY_T::DX1GCR: PLLPD Mask */ - -#define DDRPHY_DX1GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX1GCR: GSHIFT Position */ -#define DDRPHY_DX1GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX1GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX1GCR: GSHIFT Mask */ - -#define DDRPHY_DX1GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX1GCR: PLLBYP Position */ -#define DDRPHY_DX1GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX1GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX1GCR: PLLBYP Mask */ - -#define DDRPHY_DX1GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX1GCR: WLRKEN Position */ -#define DDRPHY_DX1GCR_WLRKEN_Msk (0xful << DDRPHY_DX1GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX1GCR: WLRKEN Mask */ - -#define DDRPHY_DX1GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX1GCR: MDLEN Position */ -#define DDRPHY_DX1GCR_MDLEN_Msk (0x1ul << DDRPHY_DX1GCR_MDLEN_Pos) /*!< DDRPHY_T::DX1GCR: MDLEN Mask */ - -#define DDRPHY_DX1GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX1GCR: CALBYP Position */ -#define DDRPHY_DX1GCR_CALBYP_Msk (0x1ul << DDRPHY_DX1GCR_CALBYP_Pos) /*!< DDRPHY_T::DX1GCR: CALBYP Mask */ - -#define DDRPHY_DX1GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX1GSR0: WDQCAL Position */ -#define DDRPHY_DX1GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX1GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX1GSR0: WDQCAL Mask */ - -#define DDRPHY_DX1GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX1GSR0: RDQSCAL Position */ -#define DDRPHY_DX1GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX1GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX1GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX1GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX1GSR0: RDQSNCAL Position */ -#define DDRPHY_DX1GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX1GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX1GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX1GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX1GSR0: GDQSCAL Position */ -#define DDRPHY_DX1GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX1GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX1GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX1GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX1GSR0: WLCAL Position */ -#define DDRPHY_DX1GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX1GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX1GSR0: WLCAL Mask */ - -#define DDRPHY_DX1GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX1GSR0: WLDONE Position */ -#define DDRPHY_DX1GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX1GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX1GSR0: WLDONE Mask */ - -#define DDRPHY_DX1GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX1GSR0: WLERR Position */ -#define DDRPHY_DX1GSR0_WLERR_Msk (0x1ul << DDRPHY_DX1GSR0_WLERR_Pos) /*!< DDRPHY_T::DX1GSR0: WLERR Mask */ - -#define DDRPHY_DX1GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX1GSR0: WLPRD Position */ -#define DDRPHY_DX1GSR0_WLPRD_Msk (0xfful << DDRPHY_DX1GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX1GSR0: WLPRD Mask */ - -#define DDRPHY_DX1GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX1GSR0: DPLOCK Position */ -#define DDRPHY_DX1GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX1GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX1GSR0: DPLOCK Mask */ - -#define DDRPHY_DX1GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX1GSR0: GDQSPRD Position */ -#define DDRPHY_DX1GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX1GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX1GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX1GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX1GSR0: QSGERR Position */ -#define DDRPHY_DX1GSR0_QSGERR_Msk (0xful << DDRPHY_DX1GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX1GSR0: QSGERR Mask */ - -#define DDRPHY_DX1GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX1GSR0: WLDQ Position */ -#define DDRPHY_DX1GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX1GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX1GSR0: WLDQ Mask */ - -#define DDRPHY_DX1GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX1GSR1: DLTDONE Position */ -#define DDRPHY_DX1GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX1GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX1GSR1: DLTDONE Mask */ - -#define DDRPHY_DX1GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX1GSR1: DLTCODE Position */ -#define DDRPHY_DX1GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX1GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX1GSR1: DLTCODE Mask */ - -#define DDRPHY_DX1BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX1BDLR0: DQ0WBD Position */ -#define DDRPHY_DX1BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX1BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX1BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX1BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX1BDLR0: DQ1WBD Position */ -#define DDRPHY_DX1BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX1BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX1BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX1BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX1BDLR0: DQ2WBD Position */ -#define DDRPHY_DX1BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX1BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX1BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX1BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX1BDLR0: DQ3WBD Position */ -#define DDRPHY_DX1BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX1BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX1BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX1BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX1BDLR0: DQ4WBD Position */ -#define DDRPHY_DX1BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX1BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX1BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX1BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX1BDLR1: DQ5WBD Position */ -#define DDRPHY_DX1BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX1BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX1BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX1BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX1BDLR1: DQ6WBD Position */ -#define DDRPHY_DX1BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX1BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX1BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX1BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX1BDLR1: DQ7WBD Position */ -#define DDRPHY_DX1BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX1BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX1BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX1BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX1BDLR1: DMWBD Position */ -#define DDRPHY_DX1BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX1BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX1BDLR1: DMWBD Mask */ - -#define DDRPHY_DX1BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX1BDLR1: DSWBD Position */ -#define DDRPHY_DX1BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX1BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX1BDLR1: DSWBD Mask */ - -#define DDRPHY_DX1BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX1BDLR2: DSOEBD Position */ -#define DDRPHY_DX1BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX1BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX1BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX1BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX1BDLR2: DQOEBD Position */ -#define DDRPHY_DX1BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX1BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX1BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX1BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX1BDLR2: DSRBD Position */ -#define DDRPHY_DX1BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX1BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX1BDLR2: DSRBD Mask */ - -#define DDRPHY_DX1BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX1BDLR2: DSNRBD Position */ -#define DDRPHY_DX1BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX1BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX1BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX1BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX1BDLR3: DQ0RBD Position */ -#define DDRPHY_DX1BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX1BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX1BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX1BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX1BDLR3: DQ1RBD Position */ -#define DDRPHY_DX1BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX1BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX1BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX1BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX1BDLR3: DQ2RBD Position */ -#define DDRPHY_DX1BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX1BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX1BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX1BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX1BDLR3: DQ3RBD Position */ -#define DDRPHY_DX1BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX1BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX1BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX1BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX1BDLR3: DQ4RBD Position */ -#define DDRPHY_DX1BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX1BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX1BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX1BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX1BDLR4: DQ5RBD Position */ -#define DDRPHY_DX1BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX1BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX1BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX1BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX1BDLR4: DQ6RBD Position */ -#define DDRPHY_DX1BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX1BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX1BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX1BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX1BDLR4: DQ7RBD Position */ -#define DDRPHY_DX1BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX1BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX1BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX1BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX1BDLR4: DMRBD Position */ -#define DDRPHY_DX1BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX1BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX1BDLR4: DMRBD Mask */ - -#define DDRPHY_DX1LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX1LCDLR0: R0WLD Position */ -#define DDRPHY_DX1LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX1LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX1LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX1LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX1LCDLR0: R1WLD Position */ -#define DDRPHY_DX1LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX1LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX1LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX1LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX1LCDLR0: R2WLD Position */ -#define DDRPHY_DX1LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX1LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX1LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX1LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX1LCDLR0: R3WLD Position */ -#define DDRPHY_DX1LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX1LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX1LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX1LCDLR1_WDQD_Pos (0) /*!< DDRPHY_T::DX1LCDLR1: WDQD Position */ -#define DDRPHY_DX1LCDLR1_WDQD_Msk (0xfful << DDRPHY_DX1LCDLR1_WDQD_Pos) /*!< DDRPHY_T::DX1LCDLR1: WDQD Mask */ - -#define DDRPHY_DX1LCDLR1_RDQSD_Pos (8) /*!< DDRPHY_T::DX1LCDLR1: RDQSD Position */ -#define DDRPHY_DX1LCDLR1_RDQSD_Msk (0xfful << DDRPHY_DX1LCDLR1_RDQSD_Pos) /*!< DDRPHY_T::DX1LCDLR1: RDQSD Mask */ - -#define DDRPHY_DX1LCDLR1_RDQSND_Pos (16) /*!< DDRPHY_T::DX1LCDLR1: RDQSND Position */ -#define DDRPHY_DX1LCDLR1_RDQSND_Msk (0xfful << DDRPHY_DX1LCDLR1_RDQSND_Pos) /*!< DDRPHY_T::DX1LCDLR1: RDQSND Mask */ - -#define DDRPHY_DX1LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX1LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX1LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX1LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX1LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX1LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX1LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX1LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX1LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX1LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX1LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX1LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX1LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX1LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX1LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX1LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX1LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX1LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX1LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX1LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX1MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX1MDLR: IPRD Position */ -#define DDRPHY_DX1MDLR_IPRD_Msk (0xfful << DDRPHY_DX1MDLR_IPRD_Pos) /*!< DDRPHY_T::DX1MDLR: IPRD Mask */ - -#define DDRPHY_DX1MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX1MDLR: TPRD Position */ -#define DDRPHY_DX1MDLR_TPRD_Msk (0xfful << DDRPHY_DX1MDLR_TPRD_Pos) /*!< DDRPHY_T::DX1MDLR: TPRD Mask */ - -#define DDRPHY_DX1MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX1MDLR: MDLD Position */ -#define DDRPHY_DX1MDLR_MDLD_Msk (0xfful << DDRPHY_DX1MDLR_MDLD_Pos) /*!< DDRPHY_T::DX1MDLR: MDLD Mask */ - -#define DDRPHY_DX1GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX1GTR: R0DGSL Position */ -#define DDRPHY_DX1GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX1GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX1GTR: R0DGSL Mask */ - -#define DDRPHY_DX1GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX1GTR: R1DGSL Position */ -#define DDRPHY_DX1GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX1GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX1GTR: R1DGSL Mask */ - -#define DDRPHY_DX1GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX1GTR: R2DGSL Position */ -#define DDRPHY_DX1GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX1GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX1GTR: R2DGSL Mask */ - -#define DDRPHY_DX1GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX1GTR: R3DGSL Position */ -#define DDRPHY_DX1GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX1GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX1GTR: R3DGSL Mask */ - -#define DDRPHY_DX1GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX1GTR: R0WLSL Position */ -#define DDRPHY_DX1GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX1GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX1GTR: R0WLSL Mask */ - -#define DDRPHY_DX1GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX1GTR: R1WLSL Position */ -#define DDRPHY_DX1GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX1GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX1GTR: R1WLSL Mask */ - -#define DDRPHY_DX1GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX1GTR: R2WLSL Position */ -#define DDRPHY_DX1GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX1GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX1GTR: R2WLSL Mask */ - -#define DDRPHY_DX1GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX1GTR: R3WLSL Position */ -#define DDRPHY_DX1GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX1GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX1GTR: R3WLSL Mask */ - -#define DDRPHY_DX1GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX1GSR2: RDERR Position */ -#define DDRPHY_DX1GSR2_RDERR_Msk (0x1ul << DDRPHY_DX1GSR2_RDERR_Pos) /*!< DDRPHY_T::DX1GSR2: RDERR Mask */ - -#define DDRPHY_DX1GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX1GSR2: RDWN Position */ -#define DDRPHY_DX1GSR2_RDWN_Msk (0x1ul << DDRPHY_DX1GSR2_RDWN_Pos) /*!< DDRPHY_T::DX1GSR2: RDWN Mask */ - -#define DDRPHY_DX1GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX1GSR2: WDERR Position */ -#define DDRPHY_DX1GSR2_WDERR_Msk (0x1ul << DDRPHY_DX1GSR2_WDERR_Pos) /*!< DDRPHY_T::DX1GSR2: WDERR Mask */ - -#define DDRPHY_DX1GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX1GSR2: WDWN Position */ -#define DDRPHY_DX1GSR2_WDWN_Msk (0x1ul << DDRPHY_DX1GSR2_WDWN_Pos) /*!< DDRPHY_T::DX1GSR2: WDWN Mask */ - -#define DDRPHY_DX1GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX1GSR2: REERR Position */ -#define DDRPHY_DX1GSR2_REERR_Msk (0x1ul << DDRPHY_DX1GSR2_REERR_Pos) /*!< DDRPHY_T::DX1GSR2: REERR Mask */ - -#define DDRPHY_DX1GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX1GSR2: REWN Position */ -#define DDRPHY_DX1GSR2_REWN_Msk (0x1ul << DDRPHY_DX1GSR2_REWN_Pos) /*!< DDRPHY_T::DX1GSR2: REWN Mask */ - -#define DDRPHY_DX1GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX1GSR2: WEERR Position */ -#define DDRPHY_DX1GSR2_WEERR_Msk (0x1ul << DDRPHY_DX1GSR2_WEERR_Pos) /*!< DDRPHY_T::DX1GSR2: WEERR Mask */ - -#define DDRPHY_DX1GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX1GSR2: WEWN Position */ -#define DDRPHY_DX1GSR2_WEWN_Msk (0x1ul << DDRPHY_DX1GSR2_WEWN_Pos) /*!< DDRPHY_T::DX1GSR2: WEWN Mask */ - -#define DDRPHY_DX1GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX1GSR2: ESTAT Position */ -#define DDRPHY_DX1GSR2_ESTAT_Msk (0xful << DDRPHY_DX1GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX1GSR2: ESTAT Mask */ - -#define DDRPHY_DX2GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX2GCR: DXEN Position */ -#define DDRPHY_DX2GCR_DXEN_Msk (0x1ul << DDRPHY_DX2GCR_DXEN_Pos) /*!< DDRPHY_T::DX2GCR: DXEN Mask */ - -#define DDRPHY_DX2GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX2GCR: DQSODT Position */ -#define DDRPHY_DX2GCR_DQSODT_Msk (0x1ul << DDRPHY_DX2GCR_DQSODT_Pos) /*!< DDRPHY_T::DX2GCR: DQSODT Mask */ - -#define DDRPHY_DX2GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX2GCR: DQODT Position */ -#define DDRPHY_DX2GCR_DQODT_Msk (0x1ul << DDRPHY_DX2GCR_DQODT_Pos) /*!< DDRPHY_T::DX2GCR: DQODT Mask */ - -#define DDRPHY_DX2GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX2GCR: DXIOM Position */ -#define DDRPHY_DX2GCR_DXIOM_Msk (0x1ul << DDRPHY_DX2GCR_DXIOM_Pos) /*!< DDRPHY_T::DX2GCR: DXIOM Mask */ - -#define DDRPHY_DX2GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX2GCR: DXPDD Position */ -#define DDRPHY_DX2GCR_DXPDD_Msk (0x1ul << DDRPHY_DX2GCR_DXPDD_Pos) /*!< DDRPHY_T::DX2GCR: DXPDD Mask */ - -#define DDRPHY_DX2GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX2GCR: DXPDR Position */ -#define DDRPHY_DX2GCR_DXPDR_Msk (0x1ul << DDRPHY_DX2GCR_DXPDR_Pos) /*!< DDRPHY_T::DX2GCR: DXPDR Mask */ - -#define DDRPHY_DX2GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX2GCR: DQSRPD Position */ -#define DDRPHY_DX2GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX2GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX2GCR: DQSRPD Mask */ - -#define DDRPHY_DX2GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX2GCR: DSEN Position */ -#define DDRPHY_DX2GCR_DSEN_Msk (0x3ul << DDRPHY_DX2GCR_DSEN_Pos) /*!< DDRPHY_T::DX2GCR: DSEN Mask */ - -#define DDRPHY_DX2GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX2GCR: DQSRTT Position */ -#define DDRPHY_DX2GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX2GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX2GCR: DQSRTT Mask */ - -#define DDRPHY_DX2GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX2GCR: DQRTT Position */ -#define DDRPHY_DX2GCR_DQRTT_Msk (0x1ul << DDRPHY_DX2GCR_DQRTT_Pos) /*!< DDRPHY_T::DX2GCR: DQRTT Mask */ - -#define DDRPHY_DX2GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX2GCR: RTTOH Position */ -#define DDRPHY_DX2GCR_RTTOH_Msk (0x3ul << DDRPHY_DX2GCR_RTTOH_Pos) /*!< DDRPHY_T::DX2GCR: RTTOH Mask */ - -#define DDRPHY_DX2GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX2GCR: RTTOAL Position */ -#define DDRPHY_DX2GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX2GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX2GCR: RTTOAL Mask */ - -#define DDRPHY_DX2GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX2GCR: DXOEO Position */ -#define DDRPHY_DX2GCR_DXOEO_Msk (0x3ul << DDRPHY_DX2GCR_DXOEO_Pos) /*!< DDRPHY_T::DX2GCR: DXOEO Mask */ - -#define DDRPHY_DX2GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX2GCR: PLLRST Position */ -#define DDRPHY_DX2GCR_PLLRST_Msk (0x1ul << DDRPHY_DX2GCR_PLLRST_Pos) /*!< DDRPHY_T::DX2GCR: PLLRST Mask */ - -#define DDRPHY_DX2GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX2GCR: PLLPD Position */ -#define DDRPHY_DX2GCR_PLLPD_Msk (0x1ul << DDRPHY_DX2GCR_PLLPD_Pos) /*!< DDRPHY_T::DX2GCR: PLLPD Mask */ - -#define DDRPHY_DX2GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX2GCR: GSHIFT Position */ -#define DDRPHY_DX2GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX2GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX2GCR: GSHIFT Mask */ - -#define DDRPHY_DX2GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX2GCR: PLLBYP Position */ -#define DDRPHY_DX2GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX2GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX2GCR: PLLBYP Mask */ - -#define DDRPHY_DX2GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX2GCR: WLRKEN Position */ -#define DDRPHY_DX2GCR_WLRKEN_Msk (0xful << DDRPHY_DX2GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX2GCR: WLRKEN Mask */ - -#define DDRPHY_DX2GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX2GCR: MDLEN Position */ -#define DDRPHY_DX2GCR_MDLEN_Msk (0x1ul << DDRPHY_DX2GCR_MDLEN_Pos) /*!< DDRPHY_T::DX2GCR: MDLEN Mask */ - -#define DDRPHY_DX2GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX2GCR: CALBYP Position */ -#define DDRPHY_DX2GCR_CALBYP_Msk (0x1ul << DDRPHY_DX2GCR_CALBYP_Pos) /*!< DDRPHY_T::DX2GCR: CALBYP Mask */ - -#define DDRPHY_DX2GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX2GSR0: WDQCAL Position */ -#define DDRPHY_DX2GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX2GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX2GSR0: WDQCAL Mask */ - -#define DDRPHY_DX2GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX2GSR0: RDQSCAL Position */ -#define DDRPHY_DX2GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX2GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX2GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX2GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX2GSR0: RDQSNCAL Position */ -#define DDRPHY_DX2GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX2GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX2GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX2GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX2GSR0: GDQSCAL Position */ -#define DDRPHY_DX2GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX2GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX2GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX2GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX2GSR0: WLCAL Position */ -#define DDRPHY_DX2GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX2GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX2GSR0: WLCAL Mask */ - -#define DDRPHY_DX2GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX2GSR0: WLDONE Position */ -#define DDRPHY_DX2GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX2GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX2GSR0: WLDONE Mask */ - -#define DDRPHY_DX2GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX2GSR0: WLERR Position */ -#define DDRPHY_DX2GSR0_WLERR_Msk (0x1ul << DDRPHY_DX2GSR0_WLERR_Pos) /*!< DDRPHY_T::DX2GSR0: WLERR Mask */ - -#define DDRPHY_DX2GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX2GSR0: WLPRD Position */ -#define DDRPHY_DX2GSR0_WLPRD_Msk (0xfful << DDRPHY_DX2GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX2GSR0: WLPRD Mask */ - -#define DDRPHY_DX2GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX2GSR0: DPLOCK Position */ -#define DDRPHY_DX2GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX2GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX2GSR0: DPLOCK Mask */ - -#define DDRPHY_DX2GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX2GSR0: GDQSPRD Position */ -#define DDRPHY_DX2GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX2GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX2GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX2GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX2GSR0: QSGERR Position */ -#define DDRPHY_DX2GSR0_QSGERR_Msk (0xful << DDRPHY_DX2GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX2GSR0: QSGERR Mask */ - -#define DDRPHY_DX2GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX2GSR0: WLDQ Position */ -#define DDRPHY_DX2GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX2GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX2GSR0: WLDQ Mask */ - -#define DDRPHY_DX2GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX2GSR1: DLTDONE Position */ -#define DDRPHY_DX2GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX2GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX2GSR1: DLTDONE Mask */ - -#define DDRPHY_DX2GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX2GSR1: DLTCODE Position */ -#define DDRPHY_DX2GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX2GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX2GSR1: DLTCODE Mask */ - -#define DDRPHY_DX2BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX2BDLR0: DQ0WBD Position */ -#define DDRPHY_DX2BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX2BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX2BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX2BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX2BDLR0: DQ1WBD Position */ -#define DDRPHY_DX2BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX2BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX2BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX2BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX2BDLR0: DQ2WBD Position */ -#define DDRPHY_DX2BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX2BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX2BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX2BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX2BDLR0: DQ3WBD Position */ -#define DDRPHY_DX2BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX2BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX2BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX2BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX2BDLR0: DQ4WBD Position */ -#define DDRPHY_DX2BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX2BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX2BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX2BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX2BDLR1: DQ5WBD Position */ -#define DDRPHY_DX2BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX2BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX2BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX2BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX2BDLR1: DQ6WBD Position */ -#define DDRPHY_DX2BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX2BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX2BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX2BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX2BDLR1: DQ7WBD Position */ -#define DDRPHY_DX2BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX2BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX2BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX2BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX2BDLR1: DMWBD Position */ -#define DDRPHY_DX2BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX2BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX2BDLR1: DMWBD Mask */ - -#define DDRPHY_DX2BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX2BDLR1: DSWBD Position */ -#define DDRPHY_DX2BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX2BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX2BDLR1: DSWBD Mask */ - -#define DDRPHY_DX2BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX2BDLR2: DSOEBD Position */ -#define DDRPHY_DX2BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX2BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX2BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX2BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX2BDLR2: DQOEBD Position */ -#define DDRPHY_DX2BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX2BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX2BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX2BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX2BDLR2: DSRBD Position */ -#define DDRPHY_DX2BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX2BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX2BDLR2: DSRBD Mask */ - -#define DDRPHY_DX2BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX2BDLR2: DSNRBD Position */ -#define DDRPHY_DX2BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX2BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX2BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX2BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX2BDLR3: DQ0RBD Position */ -#define DDRPHY_DX2BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX2BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX2BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX2BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX2BDLR3: DQ1RBD Position */ -#define DDRPHY_DX2BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX2BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX2BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX2BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX2BDLR3: DQ2RBD Position */ -#define DDRPHY_DX2BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX2BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX2BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX2BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX2BDLR3: DQ3RBD Position */ -#define DDRPHY_DX2BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX2BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX2BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX2BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX2BDLR3: DQ4RBD Position */ -#define DDRPHY_DX2BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX2BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX2BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX2BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX2BDLR4: DQ5RBD Position */ -#define DDRPHY_DX2BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX2BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX2BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX2BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX2BDLR4: DQ6RBD Position */ -#define DDRPHY_DX2BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX2BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX2BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX2BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX2BDLR4: DQ7RBD Position */ -#define DDRPHY_DX2BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX2BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX2BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX2BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX2BDLR4: DMRBD Position */ -#define DDRPHY_DX2BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX2BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX2BDLR4: DMRBD Mask */ - -#define DDRPHY_DX2LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX2LCDLR0: R0WLD Position */ -#define DDRPHY_DX2LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX2LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX2LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX2LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX2LCDLR0: R1WLD Position */ -#define DDRPHY_DX2LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX2LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX2LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX2LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX2LCDLR0: R2WLD Position */ -#define DDRPHY_DX2LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX2LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX2LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX2LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX2LCDLR0: R3WLD Position */ -#define DDRPHY_DX2LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX2LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX2LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX2LCDLR1_WDQD_Pos (0) /*!< DDRPHY_T::DX2LCDLR1: WDQD Position */ -#define DDRPHY_DX2LCDLR1_WDQD_Msk (0xfful << DDRPHY_DX2LCDLR1_WDQD_Pos) /*!< DDRPHY_T::DX2LCDLR1: WDQD Mask */ - -#define DDRPHY_DX2LCDLR1_RDQSD_Pos (8) /*!< DDRPHY_T::DX2LCDLR1: RDQSD Position */ -#define DDRPHY_DX2LCDLR1_RDQSD_Msk (0xfful << DDRPHY_DX2LCDLR1_RDQSD_Pos) /*!< DDRPHY_T::DX2LCDLR1: RDQSD Mask */ - -#define DDRPHY_DX2LCDLR1_RDQSND_Pos (16) /*!< DDRPHY_T::DX2LCDLR1: RDQSND Position */ -#define DDRPHY_DX2LCDLR1_RDQSND_Msk (0xfful << DDRPHY_DX2LCDLR1_RDQSND_Pos) /*!< DDRPHY_T::DX2LCDLR1: RDQSND Mask */ - -#define DDRPHY_DX2LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX2LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX2LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX2LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX2LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX2LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX2LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX2LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX2LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX2LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX2LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX2LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX2LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX2LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX2LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX2LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX2LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX2LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX2LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX2LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX2MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX2MDLR: IPRD Position */ -#define DDRPHY_DX2MDLR_IPRD_Msk (0xfful << DDRPHY_DX2MDLR_IPRD_Pos) /*!< DDRPHY_T::DX2MDLR: IPRD Mask */ - -#define DDRPHY_DX2MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX2MDLR: TPRD Position */ -#define DDRPHY_DX2MDLR_TPRD_Msk (0xfful << DDRPHY_DX2MDLR_TPRD_Pos) /*!< DDRPHY_T::DX2MDLR: TPRD Mask */ - -#define DDRPHY_DX2MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX2MDLR: MDLD Position */ -#define DDRPHY_DX2MDLR_MDLD_Msk (0xfful << DDRPHY_DX2MDLR_MDLD_Pos) /*!< DDRPHY_T::DX2MDLR: MDLD Mask */ - -#define DDRPHY_DX2GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX2GTR: R0DGSL Position */ -#define DDRPHY_DX2GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX2GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX2GTR: R0DGSL Mask */ - -#define DDRPHY_DX2GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX2GTR: R1DGSL Position */ -#define DDRPHY_DX2GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX2GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX2GTR: R1DGSL Mask */ - -#define DDRPHY_DX2GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX2GTR: R2DGSL Position */ -#define DDRPHY_DX2GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX2GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX2GTR: R2DGSL Mask */ - -#define DDRPHY_DX2GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX2GTR: R3DGSL Position */ -#define DDRPHY_DX2GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX2GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX2GTR: R3DGSL Mask */ - -#define DDRPHY_DX2GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX2GTR: R0WLSL Position */ -#define DDRPHY_DX2GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX2GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX2GTR: R0WLSL Mask */ - -#define DDRPHY_DX2GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX2GTR: R1WLSL Position */ -#define DDRPHY_DX2GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX2GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX2GTR: R1WLSL Mask */ - -#define DDRPHY_DX2GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX2GTR: R2WLSL Position */ -#define DDRPHY_DX2GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX2GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX2GTR: R2WLSL Mask */ - -#define DDRPHY_DX2GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX2GTR: R3WLSL Position */ -#define DDRPHY_DX2GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX2GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX2GTR: R3WLSL Mask */ - -#define DDRPHY_DX2GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX2GSR2: RDERR Position */ -#define DDRPHY_DX2GSR2_RDERR_Msk (0x1ul << DDRPHY_DX2GSR2_RDERR_Pos) /*!< DDRPHY_T::DX2GSR2: RDERR Mask */ - -#define DDRPHY_DX2GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX2GSR2: RDWN Position */ -#define DDRPHY_DX2GSR2_RDWN_Msk (0x1ul << DDRPHY_DX2GSR2_RDWN_Pos) /*!< DDRPHY_T::DX2GSR2: RDWN Mask */ - -#define DDRPHY_DX2GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX2GSR2: WDERR Position */ -#define DDRPHY_DX2GSR2_WDERR_Msk (0x1ul << DDRPHY_DX2GSR2_WDERR_Pos) /*!< DDRPHY_T::DX2GSR2: WDERR Mask */ - -#define DDRPHY_DX2GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX2GSR2: WDWN Position */ -#define DDRPHY_DX2GSR2_WDWN_Msk (0x1ul << DDRPHY_DX2GSR2_WDWN_Pos) /*!< DDRPHY_T::DX2GSR2: WDWN Mask */ - -#define DDRPHY_DX2GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX2GSR2: REERR Position */ -#define DDRPHY_DX2GSR2_REERR_Msk (0x1ul << DDRPHY_DX2GSR2_REERR_Pos) /*!< DDRPHY_T::DX2GSR2: REERR Mask */ - -#define DDRPHY_DX2GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX2GSR2: REWN Position */ -#define DDRPHY_DX2GSR2_REWN_Msk (0x1ul << DDRPHY_DX2GSR2_REWN_Pos) /*!< DDRPHY_T::DX2GSR2: REWN Mask */ - -#define DDRPHY_DX2GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX2GSR2: WEERR Position */ -#define DDRPHY_DX2GSR2_WEERR_Msk (0x1ul << DDRPHY_DX2GSR2_WEERR_Pos) /*!< DDRPHY_T::DX2GSR2: WEERR Mask */ - -#define DDRPHY_DX2GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX2GSR2: WEWN Position */ -#define DDRPHY_DX2GSR2_WEWN_Msk (0x1ul << DDRPHY_DX2GSR2_WEWN_Pos) /*!< DDRPHY_T::DX2GSR2: WEWN Mask */ - -#define DDRPHY_DX2GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX2GSR2: ESTAT Position */ -#define DDRPHY_DX2GSR2_ESTAT_Msk (0xful << DDRPHY_DX2GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX2GSR2: ESTAT Mask */ - -#define DDRPHY_DX3GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX3GCR: DXEN Position */ -#define DDRPHY_DX3GCR_DXEN_Msk (0x1ul << DDRPHY_DX3GCR_DXEN_Pos) /*!< DDRPHY_T::DX3GCR: DXEN Mask */ - -#define DDRPHY_DX3GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX3GCR: DQSODT Position */ -#define DDRPHY_DX3GCR_DQSODT_Msk (0x1ul << DDRPHY_DX3GCR_DQSODT_Pos) /*!< DDRPHY_T::DX3GCR: DQSODT Mask */ - -#define DDRPHY_DX3GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX3GCR: DQODT Position */ -#define DDRPHY_DX3GCR_DQODT_Msk (0x1ul << DDRPHY_DX3GCR_DQODT_Pos) /*!< DDRPHY_T::DX3GCR: DQODT Mask */ - -#define DDRPHY_DX3GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX3GCR: DXIOM Position */ -#define DDRPHY_DX3GCR_DXIOM_Msk (0x1ul << DDRPHY_DX3GCR_DXIOM_Pos) /*!< DDRPHY_T::DX3GCR: DXIOM Mask */ - -#define DDRPHY_DX3GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX3GCR: DXPDD Position */ -#define DDRPHY_DX3GCR_DXPDD_Msk (0x1ul << DDRPHY_DX3GCR_DXPDD_Pos) /*!< DDRPHY_T::DX3GCR: DXPDD Mask */ - -#define DDRPHY_DX3GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX3GCR: DXPDR Position */ -#define DDRPHY_DX3GCR_DXPDR_Msk (0x1ul << DDRPHY_DX3GCR_DXPDR_Pos) /*!< DDRPHY_T::DX3GCR: DXPDR Mask */ - -#define DDRPHY_DX3GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX3GCR: DQSRPD Position */ -#define DDRPHY_DX3GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX3GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX3GCR: DQSRPD Mask */ - -#define DDRPHY_DX3GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX3GCR: DSEN Position */ -#define DDRPHY_DX3GCR_DSEN_Msk (0x3ul << DDRPHY_DX3GCR_DSEN_Pos) /*!< DDRPHY_T::DX3GCR: DSEN Mask */ - -#define DDRPHY_DX3GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX3GCR: DQSRTT Position */ -#define DDRPHY_DX3GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX3GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX3GCR: DQSRTT Mask */ - -#define DDRPHY_DX3GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX3GCR: DQRTT Position */ -#define DDRPHY_DX3GCR_DQRTT_Msk (0x1ul << DDRPHY_DX3GCR_DQRTT_Pos) /*!< DDRPHY_T::DX3GCR: DQRTT Mask */ - -#define DDRPHY_DX3GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX3GCR: RTTOH Position */ -#define DDRPHY_DX3GCR_RTTOH_Msk (0x3ul << DDRPHY_DX3GCR_RTTOH_Pos) /*!< DDRPHY_T::DX3GCR: RTTOH Mask */ - -#define DDRPHY_DX3GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX3GCR: RTTOAL Position */ -#define DDRPHY_DX3GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX3GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX3GCR: RTTOAL Mask */ - -#define DDRPHY_DX3GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX3GCR: DXOEO Position */ -#define DDRPHY_DX3GCR_DXOEO_Msk (0x3ul << DDRPHY_DX3GCR_DXOEO_Pos) /*!< DDRPHY_T::DX3GCR: DXOEO Mask */ - -#define DDRPHY_DX3GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX3GCR: PLLRST Position */ -#define DDRPHY_DX3GCR_PLLRST_Msk (0x1ul << DDRPHY_DX3GCR_PLLRST_Pos) /*!< DDRPHY_T::DX3GCR: PLLRST Mask */ - -#define DDRPHY_DX3GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX3GCR: PLLPD Position */ -#define DDRPHY_DX3GCR_PLLPD_Msk (0x1ul << DDRPHY_DX3GCR_PLLPD_Pos) /*!< DDRPHY_T::DX3GCR: PLLPD Mask */ - -#define DDRPHY_DX3GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX3GCR: GSHIFT Position */ -#define DDRPHY_DX3GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX3GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX3GCR: GSHIFT Mask */ - -#define DDRPHY_DX3GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX3GCR: PLLBYP Position */ -#define DDRPHY_DX3GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX3GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX3GCR: PLLBYP Mask */ - -#define DDRPHY_DX3GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX3GCR: WLRKEN Position */ -#define DDRPHY_DX3GCR_WLRKEN_Msk (0xful << DDRPHY_DX3GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX3GCR: WLRKEN Mask */ - -#define DDRPHY_DX3GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX3GCR: MDLEN Position */ -#define DDRPHY_DX3GCR_MDLEN_Msk (0x1ul << DDRPHY_DX3GCR_MDLEN_Pos) /*!< DDRPHY_T::DX3GCR: MDLEN Mask */ - -#define DDRPHY_DX3GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX3GCR: CALBYP Position */ -#define DDRPHY_DX3GCR_CALBYP_Msk (0x1ul << DDRPHY_DX3GCR_CALBYP_Pos) /*!< DDRPHY_T::DX3GCR: CALBYP Mask */ - -#define DDRPHY_DX3GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX3GSR0: WDQCAL Position */ -#define DDRPHY_DX3GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX3GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX3GSR0: WDQCAL Mask */ - -#define DDRPHY_DX3GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX3GSR0: RDQSCAL Position */ -#define DDRPHY_DX3GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX3GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX3GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX3GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX3GSR0: RDQSNCAL Position */ -#define DDRPHY_DX3GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX3GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX3GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX3GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX3GSR0: GDQSCAL Position */ -#define DDRPHY_DX3GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX3GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX3GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX3GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX3GSR0: WLCAL Position */ -#define DDRPHY_DX3GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX3GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX3GSR0: WLCAL Mask */ - -#define DDRPHY_DX3GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX3GSR0: WLDONE Position */ -#define DDRPHY_DX3GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX3GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX3GSR0: WLDONE Mask */ - -#define DDRPHY_DX3GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX3GSR0: WLERR Position */ -#define DDRPHY_DX3GSR0_WLERR_Msk (0x1ul << DDRPHY_DX3GSR0_WLERR_Pos) /*!< DDRPHY_T::DX3GSR0: WLERR Mask */ - -#define DDRPHY_DX3GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX3GSR0: WLPRD Position */ -#define DDRPHY_DX3GSR0_WLPRD_Msk (0xfful << DDRPHY_DX3GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX3GSR0: WLPRD Mask */ - -#define DDRPHY_DX3GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX3GSR0: DPLOCK Position */ -#define DDRPHY_DX3GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX3GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX3GSR0: DPLOCK Mask */ - -#define DDRPHY_DX3GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX3GSR0: GDQSPRD Position */ -#define DDRPHY_DX3GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX3GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX3GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX3GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX3GSR0: QSGERR Position */ -#define DDRPHY_DX3GSR0_QSGERR_Msk (0xful << DDRPHY_DX3GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX3GSR0: QSGERR Mask */ - -#define DDRPHY_DX3GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX3GSR0: WLDQ Position */ -#define DDRPHY_DX3GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX3GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX3GSR0: WLDQ Mask */ - -#define DDRPHY_DX3GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX3GSR1: DLTDONE Position */ -#define DDRPHY_DX3GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX3GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX3GSR1: DLTDONE Mask */ - -#define DDRPHY_DX3GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX3GSR1: DLTCODE Position */ -#define DDRPHY_DX3GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX3GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX3GSR1: DLTCODE Mask */ - -#define DDRPHY_DX3BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX3BDLR0: DQ0WBD Position */ -#define DDRPHY_DX3BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX3BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX3BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX3BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX3BDLR0: DQ1WBD Position */ -#define DDRPHY_DX3BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX3BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX3BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX3BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX3BDLR0: DQ2WBD Position */ -#define DDRPHY_DX3BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX3BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX3BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX3BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX3BDLR0: DQ3WBD Position */ -#define DDRPHY_DX3BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX3BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX3BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX3BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX3BDLR0: DQ4WBD Position */ -#define DDRPHY_DX3BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX3BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX3BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX3BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX3BDLR1: DQ5WBD Position */ -#define DDRPHY_DX3BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX3BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX3BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX3BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX3BDLR1: DQ6WBD Position */ -#define DDRPHY_DX3BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX3BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX3BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX3BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX3BDLR1: DQ7WBD Position */ -#define DDRPHY_DX3BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX3BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX3BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX3BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX3BDLR1: DMWBD Position */ -#define DDRPHY_DX3BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX3BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX3BDLR1: DMWBD Mask */ - -#define DDRPHY_DX3BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX3BDLR1: DSWBD Position */ -#define DDRPHY_DX3BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX3BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX3BDLR1: DSWBD Mask */ - -#define DDRPHY_DX3BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX3BDLR2: DSOEBD Position */ -#define DDRPHY_DX3BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX3BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX3BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX3BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX3BDLR2: DQOEBD Position */ -#define DDRPHY_DX3BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX3BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX3BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX3BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX3BDLR2: DSRBD Position */ -#define DDRPHY_DX3BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX3BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX3BDLR2: DSRBD Mask */ - -#define DDRPHY_DX3BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX3BDLR2: DSNRBD Position */ -#define DDRPHY_DX3BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX3BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX3BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX3BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX3BDLR3: DQ0RBD Position */ -#define DDRPHY_DX3BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX3BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX3BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX3BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX3BDLR3: DQ1RBD Position */ -#define DDRPHY_DX3BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX3BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX3BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX3BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX3BDLR3: DQ2RBD Position */ -#define DDRPHY_DX3BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX3BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX3BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX3BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX3BDLR3: DQ3RBD Position */ -#define DDRPHY_DX3BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX3BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX3BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX3BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX3BDLR3: DQ4RBD Position */ -#define DDRPHY_DX3BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX3BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX3BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX3BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX3BDLR4: DQ5RBD Position */ -#define DDRPHY_DX3BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX3BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX3BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX3BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX3BDLR4: DQ6RBD Position */ -#define DDRPHY_DX3BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX3BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX3BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX3BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX3BDLR4: DQ7RBD Position */ -#define DDRPHY_DX3BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX3BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX3BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX3BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX3BDLR4: DMRBD Position */ -#define DDRPHY_DX3BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX3BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX3BDLR4: DMRBD Mask */ - -#define DDRPHY_DX3LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX3LCDLR0: R0WLD Position */ -#define DDRPHY_DX3LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX3LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX3LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX3LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX3LCDLR0: R1WLD Position */ -#define DDRPHY_DX3LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX3LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX3LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX3LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX3LCDLR0: R2WLD Position */ -#define DDRPHY_DX3LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX3LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX3LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX3LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX3LCDLR0: R3WLD Position */ -#define DDRPHY_DX3LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX3LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX3LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX3LCDLR1_WDQD_Pos (0) /*!< DDRPHY_T::DX3LCDLR1: WDQD Position */ -#define DDRPHY_DX3LCDLR1_WDQD_Msk (0xfful << DDRPHY_DX3LCDLR1_WDQD_Pos) /*!< DDRPHY_T::DX3LCDLR1: WDQD Mask */ - -#define DDRPHY_DX3LCDLR1_RDQSD_Pos (8) /*!< DDRPHY_T::DX3LCDLR1: RDQSD Position */ -#define DDRPHY_DX3LCDLR1_RDQSD_Msk (0xfful << DDRPHY_DX3LCDLR1_RDQSD_Pos) /*!< DDRPHY_T::DX3LCDLR1: RDQSD Mask */ - -#define DDRPHY_DX3LCDLR1_RDQSND_Pos (16) /*!< DDRPHY_T::DX3LCDLR1: RDQSND Position */ -#define DDRPHY_DX3LCDLR1_RDQSND_Msk (0xfful << DDRPHY_DX3LCDLR1_RDQSND_Pos) /*!< DDRPHY_T::DX3LCDLR1: RDQSND Mask */ - -#define DDRPHY_DX3LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX3LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX3LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX3LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX3LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX3LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX3LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX3LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX3LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX3LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX3LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX3LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX3LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX3LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX3LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX3LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX3LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX3LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX3LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX3LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX3MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX3MDLR: IPRD Position */ -#define DDRPHY_DX3MDLR_IPRD_Msk (0xfful << DDRPHY_DX3MDLR_IPRD_Pos) /*!< DDRPHY_T::DX3MDLR: IPRD Mask */ - -#define DDRPHY_DX3MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX3MDLR: TPRD Position */ -#define DDRPHY_DX3MDLR_TPRD_Msk (0xfful << DDRPHY_DX3MDLR_TPRD_Pos) /*!< DDRPHY_T::DX3MDLR: TPRD Mask */ - -#define DDRPHY_DX3MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX3MDLR: MDLD Position */ -#define DDRPHY_DX3MDLR_MDLD_Msk (0xfful << DDRPHY_DX3MDLR_MDLD_Pos) /*!< DDRPHY_T::DX3MDLR: MDLD Mask */ - -#define DDRPHY_DX3GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX3GTR: R0DGSL Position */ -#define DDRPHY_DX3GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX3GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX3GTR: R0DGSL Mask */ - -#define DDRPHY_DX3GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX3GTR: R1DGSL Position */ -#define DDRPHY_DX3GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX3GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX3GTR: R1DGSL Mask */ - -#define DDRPHY_DX3GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX3GTR: R2DGSL Position */ -#define DDRPHY_DX3GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX3GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX3GTR: R2DGSL Mask */ - -#define DDRPHY_DX3GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX3GTR: R3DGSL Position */ -#define DDRPHY_DX3GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX3GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX3GTR: R3DGSL Mask */ - -#define DDRPHY_DX3GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX3GTR: R0WLSL Position */ -#define DDRPHY_DX3GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX3GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX3GTR: R0WLSL Mask */ - -#define DDRPHY_DX3GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX3GTR: R1WLSL Position */ -#define DDRPHY_DX3GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX3GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX3GTR: R1WLSL Mask */ - -#define DDRPHY_DX3GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX3GTR: R2WLSL Position */ -#define DDRPHY_DX3GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX3GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX3GTR: R2WLSL Mask */ - -#define DDRPHY_DX3GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX3GTR: R3WLSL Position */ -#define DDRPHY_DX3GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX3GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX3GTR: R3WLSL Mask */ - -#define DDRPHY_DX3GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX3GSR2: RDERR Position */ -#define DDRPHY_DX3GSR2_RDERR_Msk (0x1ul << DDRPHY_DX3GSR2_RDERR_Pos) /*!< DDRPHY_T::DX3GSR2: RDERR Mask */ - -#define DDRPHY_DX3GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX3GSR2: RDWN Position */ -#define DDRPHY_DX3GSR2_RDWN_Msk (0x1ul << DDRPHY_DX3GSR2_RDWN_Pos) /*!< DDRPHY_T::DX3GSR2: RDWN Mask */ - -#define DDRPHY_DX3GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX3GSR2: WDERR Position */ -#define DDRPHY_DX3GSR2_WDERR_Msk (0x1ul << DDRPHY_DX3GSR2_WDERR_Pos) /*!< DDRPHY_T::DX3GSR2: WDERR Mask */ - -#define DDRPHY_DX3GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX3GSR2: WDWN Position */ -#define DDRPHY_DX3GSR2_WDWN_Msk (0x1ul << DDRPHY_DX3GSR2_WDWN_Pos) /*!< DDRPHY_T::DX3GSR2: WDWN Mask */ - -#define DDRPHY_DX3GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX3GSR2: REERR Position */ -#define DDRPHY_DX3GSR2_REERR_Msk (0x1ul << DDRPHY_DX3GSR2_REERR_Pos) /*!< DDRPHY_T::DX3GSR2: REERR Mask */ - -#define DDRPHY_DX3GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX3GSR2: REWN Position */ -#define DDRPHY_DX3GSR2_REWN_Msk (0x1ul << DDRPHY_DX3GSR2_REWN_Pos) /*!< DDRPHY_T::DX3GSR2: REWN Mask */ - -#define DDRPHY_DX3GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX3GSR2: WEERR Position */ -#define DDRPHY_DX3GSR2_WEERR_Msk (0x1ul << DDRPHY_DX3GSR2_WEERR_Pos) /*!< DDRPHY_T::DX3GSR2: WEERR Mask */ - -#define DDRPHY_DX3GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX3GSR2: WEWN Position */ -#define DDRPHY_DX3GSR2_WEWN_Msk (0x1ul << DDRPHY_DX3GSR2_WEWN_Pos) /*!< DDRPHY_T::DX3GSR2: WEWN Mask */ - -#define DDRPHY_DX3GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX3GSR2: ESTAT Position */ -#define DDRPHY_DX3GSR2_ESTAT_Msk (0xful << DDRPHY_DX3GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX3GSR2: ESTAT Mask */ - -#define DDRPHY_DX4GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX4GCR: DXEN Position */ -#define DDRPHY_DX4GCR_DXEN_Msk (0x1ul << DDRPHY_DX4GCR_DXEN_Pos) /*!< DDRPHY_T::DX4GCR: DXEN Mask */ - -#define DDRPHY_DX4GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX4GCR: DQSODT Position */ -#define DDRPHY_DX4GCR_DQSODT_Msk (0x1ul << DDRPHY_DX4GCR_DQSODT_Pos) /*!< DDRPHY_T::DX4GCR: DQSODT Mask */ - -#define DDRPHY_DX4GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX4GCR: DQODT Position */ -#define DDRPHY_DX4GCR_DQODT_Msk (0x1ul << DDRPHY_DX4GCR_DQODT_Pos) /*!< DDRPHY_T::DX4GCR: DQODT Mask */ - -#define DDRPHY_DX4GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX4GCR: DXIOM Position */ -#define DDRPHY_DX4GCR_DXIOM_Msk (0x1ul << DDRPHY_DX4GCR_DXIOM_Pos) /*!< DDRPHY_T::DX4GCR: DXIOM Mask */ - -#define DDRPHY_DX4GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX4GCR: DXPDD Position */ -#define DDRPHY_DX4GCR_DXPDD_Msk (0x1ul << DDRPHY_DX4GCR_DXPDD_Pos) /*!< DDRPHY_T::DX4GCR: DXPDD Mask */ - -#define DDRPHY_DX4GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX4GCR: DXPDR Position */ -#define DDRPHY_DX4GCR_DXPDR_Msk (0x1ul << DDRPHY_DX4GCR_DXPDR_Pos) /*!< DDRPHY_T::DX4GCR: DXPDR Mask */ - -#define DDRPHY_DX4GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX4GCR: DQSRPD Position */ -#define DDRPHY_DX4GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX4GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX4GCR: DQSRPD Mask */ - -#define DDRPHY_DX4GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX4GCR: DSEN Position */ -#define DDRPHY_DX4GCR_DSEN_Msk (0x3ul << DDRPHY_DX4GCR_DSEN_Pos) /*!< DDRPHY_T::DX4GCR: DSEN Mask */ - -#define DDRPHY_DX4GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX4GCR: DQSRTT Position */ -#define DDRPHY_DX4GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX4GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX4GCR: DQSRTT Mask */ - -#define DDRPHY_DX4GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX4GCR: DQRTT Position */ -#define DDRPHY_DX4GCR_DQRTT_Msk (0x1ul << DDRPHY_DX4GCR_DQRTT_Pos) /*!< DDRPHY_T::DX4GCR: DQRTT Mask */ - -#define DDRPHY_DX4GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX4GCR: RTTOH Position */ -#define DDRPHY_DX4GCR_RTTOH_Msk (0x3ul << DDRPHY_DX4GCR_RTTOH_Pos) /*!< DDRPHY_T::DX4GCR: RTTOH Mask */ - -#define DDRPHY_DX4GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX4GCR: RTTOAL Position */ -#define DDRPHY_DX4GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX4GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX4GCR: RTTOAL Mask */ - -#define DDRPHY_DX4GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX4GCR: DXOEO Position */ -#define DDRPHY_DX4GCR_DXOEO_Msk (0x3ul << DDRPHY_DX4GCR_DXOEO_Pos) /*!< DDRPHY_T::DX4GCR: DXOEO Mask */ - -#define DDRPHY_DX4GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX4GCR: PLLRST Position */ -#define DDRPHY_DX4GCR_PLLRST_Msk (0x1ul << DDRPHY_DX4GCR_PLLRST_Pos) /*!< DDRPHY_T::DX4GCR: PLLRST Mask */ - -#define DDRPHY_DX4GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX4GCR: PLLPD Position */ -#define DDRPHY_DX4GCR_PLLPD_Msk (0x1ul << DDRPHY_DX4GCR_PLLPD_Pos) /*!< DDRPHY_T::DX4GCR: PLLPD Mask */ - -#define DDRPHY_DX4GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX4GCR: GSHIFT Position */ -#define DDRPHY_DX4GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX4GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX4GCR: GSHIFT Mask */ - -#define DDRPHY_DX4GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX4GCR: PLLBYP Position */ -#define DDRPHY_DX4GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX4GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX4GCR: PLLBYP Mask */ - -#define DDRPHY_DX4GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX4GCR: WLRKEN Position */ -#define DDRPHY_DX4GCR_WLRKEN_Msk (0xful << DDRPHY_DX4GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX4GCR: WLRKEN Mask */ - -#define DDRPHY_DX4GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX4GCR: MDLEN Position */ -#define DDRPHY_DX4GCR_MDLEN_Msk (0x1ul << DDRPHY_DX4GCR_MDLEN_Pos) /*!< DDRPHY_T::DX4GCR: MDLEN Mask */ - -#define DDRPHY_DX4GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX4GCR: CALBYP Position */ -#define DDRPHY_DX4GCR_CALBYP_Msk (0x1ul << DDRPHY_DX4GCR_CALBYP_Pos) /*!< DDRPHY_T::DX4GCR: CALBYP Mask */ - -#define DDRPHY_DX4GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX4GSR0: WDQCAL Position */ -#define DDRPHY_DX4GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX4GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX4GSR0: WDQCAL Mask */ - -#define DDRPHY_DX4GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX4GSR0: RDQSCAL Position */ -#define DDRPHY_DX4GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX4GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX4GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX4GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX4GSR0: RDQSNCAL Position */ -#define DDRPHY_DX4GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX4GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX4GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX4GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX4GSR0: GDQSCAL Position */ -#define DDRPHY_DX4GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX4GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX4GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX4GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX4GSR0: WLCAL Position */ -#define DDRPHY_DX4GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX4GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX4GSR0: WLCAL Mask */ - -#define DDRPHY_DX4GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX4GSR0: WLDONE Position */ -#define DDRPHY_DX4GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX4GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX4GSR0: WLDONE Mask */ - -#define DDRPHY_DX4GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX4GSR0: WLERR Position */ -#define DDRPHY_DX4GSR0_WLERR_Msk (0x1ul << DDRPHY_DX4GSR0_WLERR_Pos) /*!< DDRPHY_T::DX4GSR0: WLERR Mask */ - -#define DDRPHY_DX4GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX4GSR0: WLPRD Position */ -#define DDRPHY_DX4GSR0_WLPRD_Msk (0xfful << DDRPHY_DX4GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX4GSR0: WLPRD Mask */ - -#define DDRPHY_DX4GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX4GSR0: DPLOCK Position */ -#define DDRPHY_DX4GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX4GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX4GSR0: DPLOCK Mask */ - -#define DDRPHY_DX4GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX4GSR0: GDQSPRD Position */ -#define DDRPHY_DX4GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX4GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX4GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX4GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX4GSR0: QSGERR Position */ -#define DDRPHY_DX4GSR0_QSGERR_Msk (0xful << DDRPHY_DX4GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX4GSR0: QSGERR Mask */ - -#define DDRPHY_DX4GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX4GSR0: WLDQ Position */ -#define DDRPHY_DX4GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX4GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX4GSR0: WLDQ Mask */ - -#define DDRPHY_DX4GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX4GSR1: DLTDONE Position */ -#define DDRPHY_DX4GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX4GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX4GSR1: DLTDONE Mask */ - -#define DDRPHY_DX4GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX4GSR1: DLTCODE Position */ -#define DDRPHY_DX4GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX4GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX4GSR1: DLTCODE Mask */ - -#define DDRPHY_DX4BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX4BDLR0: DQ0WBD Position */ -#define DDRPHY_DX4BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX4BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX4BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX4BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX4BDLR0: DQ1WBD Position */ -#define DDRPHY_DX4BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX4BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX4BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX4BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX4BDLR0: DQ2WBD Position */ -#define DDRPHY_DX4BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX4BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX4BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX4BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX4BDLR0: DQ3WBD Position */ -#define DDRPHY_DX4BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX4BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX4BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX4BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX4BDLR0: DQ4WBD Position */ -#define DDRPHY_DX4BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX4BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX4BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX4BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX4BDLR1: DQ5WBD Position */ -#define DDRPHY_DX4BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX4BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX4BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX4BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX4BDLR1: DQ6WBD Position */ -#define DDRPHY_DX4BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX4BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX4BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX4BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX4BDLR1: DQ7WBD Position */ -#define DDRPHY_DX4BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX4BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX4BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX4BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX4BDLR1: DMWBD Position */ -#define DDRPHY_DX4BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX4BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX4BDLR1: DMWBD Mask */ - -#define DDRPHY_DX4BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX4BDLR1: DSWBD Position */ -#define DDRPHY_DX4BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX4BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX4BDLR1: DSWBD Mask */ - -#define DDRPHY_DX4BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX4BDLR2: DSOEBD Position */ -#define DDRPHY_DX4BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX4BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX4BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX4BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX4BDLR2: DQOEBD Position */ -#define DDRPHY_DX4BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX4BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX4BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX4BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX4BDLR2: DSRBD Position */ -#define DDRPHY_DX4BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX4BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX4BDLR2: DSRBD Mask */ - -#define DDRPHY_DX4BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX4BDLR2: DSNRBD Position */ -#define DDRPHY_DX4BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX4BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX4BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX4BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX4BDLR3: DQ0RBD Position */ -#define DDRPHY_DX4BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX4BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX4BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX4BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX4BDLR3: DQ1RBD Position */ -#define DDRPHY_DX4BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX4BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX4BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX4BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX4BDLR3: DQ2RBD Position */ -#define DDRPHY_DX4BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX4BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX4BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX4BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX4BDLR3: DQ3RBD Position */ -#define DDRPHY_DX4BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX4BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX4BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX4BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX4BDLR3: DQ4RBD Position */ -#define DDRPHY_DX4BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX4BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX4BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX4BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX4BDLR4: DQ5RBD Position */ -#define DDRPHY_DX4BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX4BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX4BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX4BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX4BDLR4: DQ6RBD Position */ -#define DDRPHY_DX4BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX4BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX4BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX4BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX4BDLR4: DQ7RBD Position */ -#define DDRPHY_DX4BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX4BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX4BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX4BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX4BDLR4: DMRBD Position */ -#define DDRPHY_DX4BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX4BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX4BDLR4: DMRBD Mask */ - -#define DDRPHY_DX4LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX4LCDLR0: R0WLD Position */ -#define DDRPHY_DX4LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX4LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX4LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX4LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX4LCDLR0: R1WLD Position */ -#define DDRPHY_DX4LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX4LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX4LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX4LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX4LCDLR0: R2WLD Position */ -#define DDRPHY_DX4LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX4LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX4LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX4LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX4LCDLR0: R3WLD Position */ -#define DDRPHY_DX4LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX4LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX4LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX4LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX4LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX4LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX4LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX4LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX4LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX4LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX4LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX4LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX4LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX4LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX4LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX4LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX4LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX4LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX4LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX4LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX4LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX4LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX4LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX4MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX4MDLR: IPRD Position */ -#define DDRPHY_DX4MDLR_IPRD_Msk (0xfful << DDRPHY_DX4MDLR_IPRD_Pos) /*!< DDRPHY_T::DX4MDLR: IPRD Mask */ - -#define DDRPHY_DX4MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX4MDLR: TPRD Position */ -#define DDRPHY_DX4MDLR_TPRD_Msk (0xfful << DDRPHY_DX4MDLR_TPRD_Pos) /*!< DDRPHY_T::DX4MDLR: TPRD Mask */ - -#define DDRPHY_DX4MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX4MDLR: MDLD Position */ -#define DDRPHY_DX4MDLR_MDLD_Msk (0xfful << DDRPHY_DX4MDLR_MDLD_Pos) /*!< DDRPHY_T::DX4MDLR: MDLD Mask */ - -#define DDRPHY_DX4GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX4GTR: R0DGSL Position */ -#define DDRPHY_DX4GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX4GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX4GTR: R0DGSL Mask */ - -#define DDRPHY_DX4GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX4GTR: R1DGSL Position */ -#define DDRPHY_DX4GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX4GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX4GTR: R1DGSL Mask */ - -#define DDRPHY_DX4GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX4GTR: R2DGSL Position */ -#define DDRPHY_DX4GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX4GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX4GTR: R2DGSL Mask */ - -#define DDRPHY_DX4GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX4GTR: R3DGSL Position */ -#define DDRPHY_DX4GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX4GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX4GTR: R3DGSL Mask */ - -#define DDRPHY_DX4GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX4GTR: R0WLSL Position */ -#define DDRPHY_DX4GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX4GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX4GTR: R0WLSL Mask */ - -#define DDRPHY_DX4GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX4GTR: R1WLSL Position */ -#define DDRPHY_DX4GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX4GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX4GTR: R1WLSL Mask */ - -#define DDRPHY_DX4GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX4GTR: R2WLSL Position */ -#define DDRPHY_DX4GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX4GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX4GTR: R2WLSL Mask */ - -#define DDRPHY_DX4GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX4GTR: R3WLSL Position */ -#define DDRPHY_DX4GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX4GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX4GTR: R3WLSL Mask */ - -#define DDRPHY_DX4GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX4GSR2: RDERR Position */ -#define DDRPHY_DX4GSR2_RDERR_Msk (0x1ul << DDRPHY_DX4GSR2_RDERR_Pos) /*!< DDRPHY_T::DX4GSR2: RDERR Mask */ - -#define DDRPHY_DX4GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX4GSR2: RDWN Position */ -#define DDRPHY_DX4GSR2_RDWN_Msk (0x1ul << DDRPHY_DX4GSR2_RDWN_Pos) /*!< DDRPHY_T::DX4GSR2: RDWN Mask */ - -#define DDRPHY_DX4GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX4GSR2: WDERR Position */ -#define DDRPHY_DX4GSR2_WDERR_Msk (0x1ul << DDRPHY_DX4GSR2_WDERR_Pos) /*!< DDRPHY_T::DX4GSR2: WDERR Mask */ - -#define DDRPHY_DX4GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX4GSR2: WDWN Position */ -#define DDRPHY_DX4GSR2_WDWN_Msk (0x1ul << DDRPHY_DX4GSR2_WDWN_Pos) /*!< DDRPHY_T::DX4GSR2: WDWN Mask */ - -#define DDRPHY_DX4GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX4GSR2: REERR Position */ -#define DDRPHY_DX4GSR2_REERR_Msk (0x1ul << DDRPHY_DX4GSR2_REERR_Pos) /*!< DDRPHY_T::DX4GSR2: REERR Mask */ - -#define DDRPHY_DX4GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX4GSR2: REWN Position */ -#define DDRPHY_DX4GSR2_REWN_Msk (0x1ul << DDRPHY_DX4GSR2_REWN_Pos) /*!< DDRPHY_T::DX4GSR2: REWN Mask */ - -#define DDRPHY_DX4GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX4GSR2: WEERR Position */ -#define DDRPHY_DX4GSR2_WEERR_Msk (0x1ul << DDRPHY_DX4GSR2_WEERR_Pos) /*!< DDRPHY_T::DX4GSR2: WEERR Mask */ - -#define DDRPHY_DX4GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX4GSR2: WEWN Position */ -#define DDRPHY_DX4GSR2_WEWN_Msk (0x1ul << DDRPHY_DX4GSR2_WEWN_Pos) /*!< DDRPHY_T::DX4GSR2: WEWN Mask */ - -#define DDRPHY_DX4GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX4GSR2: ESTAT Position */ -#define DDRPHY_DX4GSR2_ESTAT_Msk (0xful << DDRPHY_DX4GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX4GSR2: ESTAT Mask */ - -#define DDRPHY_DX5GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX5GCR: DXEN Position */ -#define DDRPHY_DX5GCR_DXEN_Msk (0x1ul << DDRPHY_DX5GCR_DXEN_Pos) /*!< DDRPHY_T::DX5GCR: DXEN Mask */ - -#define DDRPHY_DX5GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX5GCR: DQSODT Position */ -#define DDRPHY_DX5GCR_DQSODT_Msk (0x1ul << DDRPHY_DX5GCR_DQSODT_Pos) /*!< DDRPHY_T::DX5GCR: DQSODT Mask */ - -#define DDRPHY_DX5GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX5GCR: DQODT Position */ -#define DDRPHY_DX5GCR_DQODT_Msk (0x1ul << DDRPHY_DX5GCR_DQODT_Pos) /*!< DDRPHY_T::DX5GCR: DQODT Mask */ - -#define DDRPHY_DX5GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX5GCR: DXIOM Position */ -#define DDRPHY_DX5GCR_DXIOM_Msk (0x1ul << DDRPHY_DX5GCR_DXIOM_Pos) /*!< DDRPHY_T::DX5GCR: DXIOM Mask */ - -#define DDRPHY_DX5GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX5GCR: DXPDD Position */ -#define DDRPHY_DX5GCR_DXPDD_Msk (0x1ul << DDRPHY_DX5GCR_DXPDD_Pos) /*!< DDRPHY_T::DX5GCR: DXPDD Mask */ - -#define DDRPHY_DX5GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX5GCR: DXPDR Position */ -#define DDRPHY_DX5GCR_DXPDR_Msk (0x1ul << DDRPHY_DX5GCR_DXPDR_Pos) /*!< DDRPHY_T::DX5GCR: DXPDR Mask */ - -#define DDRPHY_DX5GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX5GCR: DQSRPD Position */ -#define DDRPHY_DX5GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX5GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX5GCR: DQSRPD Mask */ - -#define DDRPHY_DX5GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX5GCR: DSEN Position */ -#define DDRPHY_DX5GCR_DSEN_Msk (0x3ul << DDRPHY_DX5GCR_DSEN_Pos) /*!< DDRPHY_T::DX5GCR: DSEN Mask */ - -#define DDRPHY_DX5GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX5GCR: DQSRTT Position */ -#define DDRPHY_DX5GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX5GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX5GCR: DQSRTT Mask */ - -#define DDRPHY_DX5GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX5GCR: DQRTT Position */ -#define DDRPHY_DX5GCR_DQRTT_Msk (0x1ul << DDRPHY_DX5GCR_DQRTT_Pos) /*!< DDRPHY_T::DX5GCR: DQRTT Mask */ - -#define DDRPHY_DX5GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX5GCR: RTTOH Position */ -#define DDRPHY_DX5GCR_RTTOH_Msk (0x3ul << DDRPHY_DX5GCR_RTTOH_Pos) /*!< DDRPHY_T::DX5GCR: RTTOH Mask */ - -#define DDRPHY_DX5GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX5GCR: RTTOAL Position */ -#define DDRPHY_DX5GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX5GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX5GCR: RTTOAL Mask */ - -#define DDRPHY_DX5GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX5GCR: DXOEO Position */ -#define DDRPHY_DX5GCR_DXOEO_Msk (0x3ul << DDRPHY_DX5GCR_DXOEO_Pos) /*!< DDRPHY_T::DX5GCR: DXOEO Mask */ - -#define DDRPHY_DX5GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX5GCR: PLLRST Position */ -#define DDRPHY_DX5GCR_PLLRST_Msk (0x1ul << DDRPHY_DX5GCR_PLLRST_Pos) /*!< DDRPHY_T::DX5GCR: PLLRST Mask */ - -#define DDRPHY_DX5GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX5GCR: PLLPD Position */ -#define DDRPHY_DX5GCR_PLLPD_Msk (0x1ul << DDRPHY_DX5GCR_PLLPD_Pos) /*!< DDRPHY_T::DX5GCR: PLLPD Mask */ - -#define DDRPHY_DX5GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX5GCR: GSHIFT Position */ -#define DDRPHY_DX5GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX5GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX5GCR: GSHIFT Mask */ - -#define DDRPHY_DX5GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX5GCR: PLLBYP Position */ -#define DDRPHY_DX5GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX5GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX5GCR: PLLBYP Mask */ - -#define DDRPHY_DX5GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX5GCR: WLRKEN Position */ -#define DDRPHY_DX5GCR_WLRKEN_Msk (0xful << DDRPHY_DX5GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX5GCR: WLRKEN Mask */ - -#define DDRPHY_DX5GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX5GCR: MDLEN Position */ -#define DDRPHY_DX5GCR_MDLEN_Msk (0x1ul << DDRPHY_DX5GCR_MDLEN_Pos) /*!< DDRPHY_T::DX5GCR: MDLEN Mask */ - -#define DDRPHY_DX5GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX5GCR: CALBYP Position */ -#define DDRPHY_DX5GCR_CALBYP_Msk (0x1ul << DDRPHY_DX5GCR_CALBYP_Pos) /*!< DDRPHY_T::DX5GCR: CALBYP Mask */ - -#define DDRPHY_DX5GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX5GSR0: WDQCAL Position */ -#define DDRPHY_DX5GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX5GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX5GSR0: WDQCAL Mask */ - -#define DDRPHY_DX5GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX5GSR0: RDQSCAL Position */ -#define DDRPHY_DX5GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX5GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX5GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX5GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX5GSR0: RDQSNCAL Position */ -#define DDRPHY_DX5GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX5GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX5GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX5GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX5GSR0: GDQSCAL Position */ -#define DDRPHY_DX5GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX5GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX5GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX5GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX5GSR0: WLCAL Position */ -#define DDRPHY_DX5GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX5GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX5GSR0: WLCAL Mask */ - -#define DDRPHY_DX5GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX5GSR0: WLDONE Position */ -#define DDRPHY_DX5GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX5GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX5GSR0: WLDONE Mask */ - -#define DDRPHY_DX5GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX5GSR0: WLERR Position */ -#define DDRPHY_DX5GSR0_WLERR_Msk (0x1ul << DDRPHY_DX5GSR0_WLERR_Pos) /*!< DDRPHY_T::DX5GSR0: WLERR Mask */ - -#define DDRPHY_DX5GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX5GSR0: WLPRD Position */ -#define DDRPHY_DX5GSR0_WLPRD_Msk (0xfful << DDRPHY_DX5GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX5GSR0: WLPRD Mask */ - -#define DDRPHY_DX5GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX5GSR0: DPLOCK Position */ -#define DDRPHY_DX5GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX5GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX5GSR0: DPLOCK Mask */ - -#define DDRPHY_DX5GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX5GSR0: GDQSPRD Position */ -#define DDRPHY_DX5GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX5GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX5GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX5GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX5GSR0: QSGERR Position */ -#define DDRPHY_DX5GSR0_QSGERR_Msk (0xful << DDRPHY_DX5GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX5GSR0: QSGERR Mask */ - -#define DDRPHY_DX5GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX5GSR0: WLDQ Position */ -#define DDRPHY_DX5GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX5GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX5GSR0: WLDQ Mask */ - -#define DDRPHY_DX5GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX5GSR1: DLTDONE Position */ -#define DDRPHY_DX5GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX5GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX5GSR1: DLTDONE Mask */ - -#define DDRPHY_DX5GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX5GSR1: DLTCODE Position */ -#define DDRPHY_DX5GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX5GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX5GSR1: DLTCODE Mask */ - -#define DDRPHY_DX5BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX5BDLR0: DQ0WBD Position */ -#define DDRPHY_DX5BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX5BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX5BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX5BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX5BDLR0: DQ1WBD Position */ -#define DDRPHY_DX5BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX5BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX5BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX5BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX5BDLR0: DQ2WBD Position */ -#define DDRPHY_DX5BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX5BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX5BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX5BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX5BDLR0: DQ3WBD Position */ -#define DDRPHY_DX5BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX5BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX5BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX5BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX5BDLR0: DQ4WBD Position */ -#define DDRPHY_DX5BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX5BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX5BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX5BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX5BDLR1: DQ5WBD Position */ -#define DDRPHY_DX5BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX5BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX5BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX5BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX5BDLR1: DQ6WBD Position */ -#define DDRPHY_DX5BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX5BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX5BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX5BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX5BDLR1: DQ7WBD Position */ -#define DDRPHY_DX5BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX5BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX5BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX5BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX5BDLR1: DMWBD Position */ -#define DDRPHY_DX5BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX5BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX5BDLR1: DMWBD Mask */ - -#define DDRPHY_DX5BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX5BDLR1: DSWBD Position */ -#define DDRPHY_DX5BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX5BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX5BDLR1: DSWBD Mask */ - -#define DDRPHY_DX5BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX5BDLR2: DSOEBD Position */ -#define DDRPHY_DX5BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX5BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX5BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX5BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX5BDLR2: DQOEBD Position */ -#define DDRPHY_DX5BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX5BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX5BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX5BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX5BDLR2: DSRBD Position */ -#define DDRPHY_DX5BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX5BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX5BDLR2: DSRBD Mask */ - -#define DDRPHY_DX5BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX5BDLR2: DSNRBD Position */ -#define DDRPHY_DX5BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX5BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX5BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX5BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX5BDLR3: DQ0RBD Position */ -#define DDRPHY_DX5BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX5BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX5BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX5BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX5BDLR3: DQ1RBD Position */ -#define DDRPHY_DX5BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX5BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX5BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX5BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX5BDLR3: DQ2RBD Position */ -#define DDRPHY_DX5BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX5BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX5BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX5BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX5BDLR3: DQ3RBD Position */ -#define DDRPHY_DX5BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX5BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX5BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX5BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX5BDLR3: DQ4RBD Position */ -#define DDRPHY_DX5BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX5BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX5BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX5BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX5BDLR4: DQ5RBD Position */ -#define DDRPHY_DX5BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX5BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX5BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX5BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX5BDLR4: DQ6RBD Position */ -#define DDRPHY_DX5BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX5BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX5BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX5BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX5BDLR4: DQ7RBD Position */ -#define DDRPHY_DX5BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX5BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX5BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX5BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX5BDLR4: DMRBD Position */ -#define DDRPHY_DX5BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX5BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX5BDLR4: DMRBD Mask */ - -#define DDRPHY_DX5LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX5LCDLR0: R0WLD Position */ -#define DDRPHY_DX5LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX5LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX5LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX5LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX5LCDLR0: R1WLD Position */ -#define DDRPHY_DX5LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX5LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX5LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX5LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX5LCDLR0: R2WLD Position */ -#define DDRPHY_DX5LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX5LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX5LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX5LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX5LCDLR0: R3WLD Position */ -#define DDRPHY_DX5LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX5LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX5LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX5LCDLR1_WDQD_Pos (0) /*!< DDRPHY_T::DX5LCDLR1: WDQD Position */ -#define DDRPHY_DX5LCDLR1_WDQD_Msk (0xfful << DDRPHY_DX5LCDLR1_WDQD_Pos) /*!< DDRPHY_T::DX5LCDLR1: WDQD Mask */ - -#define DDRPHY_DX5LCDLR1_RDQSD_Pos (8) /*!< DDRPHY_T::DX5LCDLR1: RDQSD Position */ -#define DDRPHY_DX5LCDLR1_RDQSD_Msk (0xfful << DDRPHY_DX5LCDLR1_RDQSD_Pos) /*!< DDRPHY_T::DX5LCDLR1: RDQSD Mask */ - -#define DDRPHY_DX5LCDLR1_RDQSND_Pos (16) /*!< DDRPHY_T::DX5LCDLR1: RDQSND Position */ -#define DDRPHY_DX5LCDLR1_RDQSND_Msk (0xfful << DDRPHY_DX5LCDLR1_RDQSND_Pos) /*!< DDRPHY_T::DX5LCDLR1: RDQSND Mask */ - -#define DDRPHY_DX5LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX5LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX5LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX5LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX5LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX5LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX5LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX5LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX5LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX5LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX5LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX5LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX5LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX5LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX5LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX5LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX5LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX5LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX5LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX5LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX5MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX5MDLR: IPRD Position */ -#define DDRPHY_DX5MDLR_IPRD_Msk (0xfful << DDRPHY_DX5MDLR_IPRD_Pos) /*!< DDRPHY_T::DX5MDLR: IPRD Mask */ - -#define DDRPHY_DX5MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX5MDLR: TPRD Position */ -#define DDRPHY_DX5MDLR_TPRD_Msk (0xfful << DDRPHY_DX5MDLR_TPRD_Pos) /*!< DDRPHY_T::DX5MDLR: TPRD Mask */ - -#define DDRPHY_DX5MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX5MDLR: MDLD Position */ -#define DDRPHY_DX5MDLR_MDLD_Msk (0xfful << DDRPHY_DX5MDLR_MDLD_Pos) /*!< DDRPHY_T::DX5MDLR: MDLD Mask */ - -#define DDRPHY_DX5GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX5GTR: R0DGSL Position */ -#define DDRPHY_DX5GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX5GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX5GTR: R0DGSL Mask */ - -#define DDRPHY_DX5GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX5GTR: R1DGSL Position */ -#define DDRPHY_DX5GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX5GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX5GTR: R1DGSL Mask */ - -#define DDRPHY_DX5GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX5GTR: R2DGSL Position */ -#define DDRPHY_DX5GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX5GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX5GTR: R2DGSL Mask */ - -#define DDRPHY_DX5GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX5GTR: R3DGSL Position */ -#define DDRPHY_DX5GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX5GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX5GTR: R3DGSL Mask */ - -#define DDRPHY_DX5GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX5GTR: R0WLSL Position */ -#define DDRPHY_DX5GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX5GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX5GTR: R0WLSL Mask */ - -#define DDRPHY_DX5GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX5GTR: R1WLSL Position */ -#define DDRPHY_DX5GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX5GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX5GTR: R1WLSL Mask */ - -#define DDRPHY_DX5GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX5GTR: R2WLSL Position */ -#define DDRPHY_DX5GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX5GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX5GTR: R2WLSL Mask */ - -#define DDRPHY_DX5GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX5GTR: R3WLSL Position */ -#define DDRPHY_DX5GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX5GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX5GTR: R3WLSL Mask */ - -#define DDRPHY_DX5GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX5GSR2: RDERR Position */ -#define DDRPHY_DX5GSR2_RDERR_Msk (0x1ul << DDRPHY_DX5GSR2_RDERR_Pos) /*!< DDRPHY_T::DX5GSR2: RDERR Mask */ - -#define DDRPHY_DX5GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX5GSR2: RDWN Position */ -#define DDRPHY_DX5GSR2_RDWN_Msk (0x1ul << DDRPHY_DX5GSR2_RDWN_Pos) /*!< DDRPHY_T::DX5GSR2: RDWN Mask */ - -#define DDRPHY_DX5GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX5GSR2: WDERR Position */ -#define DDRPHY_DX5GSR2_WDERR_Msk (0x1ul << DDRPHY_DX5GSR2_WDERR_Pos) /*!< DDRPHY_T::DX5GSR2: WDERR Mask */ - -#define DDRPHY_DX5GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX5GSR2: WDWN Position */ -#define DDRPHY_DX5GSR2_WDWN_Msk (0x1ul << DDRPHY_DX5GSR2_WDWN_Pos) /*!< DDRPHY_T::DX5GSR2: WDWN Mask */ - -#define DDRPHY_DX5GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX5GSR2: REERR Position */ -#define DDRPHY_DX5GSR2_REERR_Msk (0x1ul << DDRPHY_DX5GSR2_REERR_Pos) /*!< DDRPHY_T::DX5GSR2: REERR Mask */ - -#define DDRPHY_DX5GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX5GSR2: REWN Position */ -#define DDRPHY_DX5GSR2_REWN_Msk (0x1ul << DDRPHY_DX5GSR2_REWN_Pos) /*!< DDRPHY_T::DX5GSR2: REWN Mask */ - -#define DDRPHY_DX5GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX5GSR2: WEERR Position */ -#define DDRPHY_DX5GSR2_WEERR_Msk (0x1ul << DDRPHY_DX5GSR2_WEERR_Pos) /*!< DDRPHY_T::DX5GSR2: WEERR Mask */ - -#define DDRPHY_DX5GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX5GSR2: WEWN Position */ -#define DDRPHY_DX5GSR2_WEWN_Msk (0x1ul << DDRPHY_DX5GSR2_WEWN_Pos) /*!< DDRPHY_T::DX5GSR2: WEWN Mask */ - -#define DDRPHY_DX5GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX5GSR2: ESTAT Position */ -#define DDRPHY_DX5GSR2_ESTAT_Msk (0xful << DDRPHY_DX5GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX5GSR2: ESTAT Mask */ - -#define DDRPHY_DX6GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX6GCR: DXEN Position */ -#define DDRPHY_DX6GCR_DXEN_Msk (0x1ul << DDRPHY_DX6GCR_DXEN_Pos) /*!< DDRPHY_T::DX6GCR: DXEN Mask */ - -#define DDRPHY_DX6GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX6GCR: DQSODT Position */ -#define DDRPHY_DX6GCR_DQSODT_Msk (0x1ul << DDRPHY_DX6GCR_DQSODT_Pos) /*!< DDRPHY_T::DX6GCR: DQSODT Mask */ - -#define DDRPHY_DX6GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX6GCR: DQODT Position */ -#define DDRPHY_DX6GCR_DQODT_Msk (0x1ul << DDRPHY_DX6GCR_DQODT_Pos) /*!< DDRPHY_T::DX6GCR: DQODT Mask */ - -#define DDRPHY_DX6GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX6GCR: DXIOM Position */ -#define DDRPHY_DX6GCR_DXIOM_Msk (0x1ul << DDRPHY_DX6GCR_DXIOM_Pos) /*!< DDRPHY_T::DX6GCR: DXIOM Mask */ - -#define DDRPHY_DX6GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX6GCR: DXPDD Position */ -#define DDRPHY_DX6GCR_DXPDD_Msk (0x1ul << DDRPHY_DX6GCR_DXPDD_Pos) /*!< DDRPHY_T::DX6GCR: DXPDD Mask */ - -#define DDRPHY_DX6GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX6GCR: DXPDR Position */ -#define DDRPHY_DX6GCR_DXPDR_Msk (0x1ul << DDRPHY_DX6GCR_DXPDR_Pos) /*!< DDRPHY_T::DX6GCR: DXPDR Mask */ - -#define DDRPHY_DX6GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX6GCR: DQSRPD Position */ -#define DDRPHY_DX6GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX6GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX6GCR: DQSRPD Mask */ - -#define DDRPHY_DX6GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX6GCR: DSEN Position */ -#define DDRPHY_DX6GCR_DSEN_Msk (0x3ul << DDRPHY_DX6GCR_DSEN_Pos) /*!< DDRPHY_T::DX6GCR: DSEN Mask */ - -#define DDRPHY_DX6GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX6GCR: DQSRTT Position */ -#define DDRPHY_DX6GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX6GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX6GCR: DQSRTT Mask */ - -#define DDRPHY_DX6GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX6GCR: DQRTT Position */ -#define DDRPHY_DX6GCR_DQRTT_Msk (0x1ul << DDRPHY_DX6GCR_DQRTT_Pos) /*!< DDRPHY_T::DX6GCR: DQRTT Mask */ - -#define DDRPHY_DX6GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX6GCR: RTTOH Position */ -#define DDRPHY_DX6GCR_RTTOH_Msk (0x3ul << DDRPHY_DX6GCR_RTTOH_Pos) /*!< DDRPHY_T::DX6GCR: RTTOH Mask */ - -#define DDRPHY_DX6GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX6GCR: RTTOAL Position */ -#define DDRPHY_DX6GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX6GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX6GCR: RTTOAL Mask */ - -#define DDRPHY_DX6GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX6GCR: DXOEO Position */ -#define DDRPHY_DX6GCR_DXOEO_Msk (0x3ul << DDRPHY_DX6GCR_DXOEO_Pos) /*!< DDRPHY_T::DX6GCR: DXOEO Mask */ - -#define DDRPHY_DX6GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX6GCR: PLLRST Position */ -#define DDRPHY_DX6GCR_PLLRST_Msk (0x1ul << DDRPHY_DX6GCR_PLLRST_Pos) /*!< DDRPHY_T::DX6GCR: PLLRST Mask */ - -#define DDRPHY_DX6GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX6GCR: PLLPD Position */ -#define DDRPHY_DX6GCR_PLLPD_Msk (0x1ul << DDRPHY_DX6GCR_PLLPD_Pos) /*!< DDRPHY_T::DX6GCR: PLLPD Mask */ - -#define DDRPHY_DX6GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX6GCR: GSHIFT Position */ -#define DDRPHY_DX6GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX6GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX6GCR: GSHIFT Mask */ - -#define DDRPHY_DX6GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX6GCR: PLLBYP Position */ -#define DDRPHY_DX6GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX6GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX6GCR: PLLBYP Mask */ - -#define DDRPHY_DX6GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX6GCR: WLRKEN Position */ -#define DDRPHY_DX6GCR_WLRKEN_Msk (0xful << DDRPHY_DX6GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX6GCR: WLRKEN Mask */ - -#define DDRPHY_DX6GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX6GCR: MDLEN Position */ -#define DDRPHY_DX6GCR_MDLEN_Msk (0x1ul << DDRPHY_DX6GCR_MDLEN_Pos) /*!< DDRPHY_T::DX6GCR: MDLEN Mask */ - -#define DDRPHY_DX6GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX6GCR: CALBYP Position */ -#define DDRPHY_DX6GCR_CALBYP_Msk (0x1ul << DDRPHY_DX6GCR_CALBYP_Pos) /*!< DDRPHY_T::DX6GCR: CALBYP Mask */ - -#define DDRPHY_DX6GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX6GSR0: WDQCAL Position */ -#define DDRPHY_DX6GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX6GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX6GSR0: WDQCAL Mask */ - -#define DDRPHY_DX6GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX6GSR0: RDQSCAL Position */ -#define DDRPHY_DX6GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX6GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX6GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX6GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX6GSR0: RDQSNCAL Position */ -#define DDRPHY_DX6GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX6GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX6GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX6GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX6GSR0: GDQSCAL Position */ -#define DDRPHY_DX6GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX6GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX6GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX6GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX6GSR0: WLCAL Position */ -#define DDRPHY_DX6GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX6GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX6GSR0: WLCAL Mask */ - -#define DDRPHY_DX6GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX6GSR0: WLDONE Position */ -#define DDRPHY_DX6GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX6GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX6GSR0: WLDONE Mask */ - -#define DDRPHY_DX6GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX6GSR0: WLERR Position */ -#define DDRPHY_DX6GSR0_WLERR_Msk (0x1ul << DDRPHY_DX6GSR0_WLERR_Pos) /*!< DDRPHY_T::DX6GSR0: WLERR Mask */ - -#define DDRPHY_DX6GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX6GSR0: WLPRD Position */ -#define DDRPHY_DX6GSR0_WLPRD_Msk (0xfful << DDRPHY_DX6GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX6GSR0: WLPRD Mask */ - -#define DDRPHY_DX6GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX6GSR0: DPLOCK Position */ -#define DDRPHY_DX6GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX6GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX6GSR0: DPLOCK Mask */ - -#define DDRPHY_DX6GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX6GSR0: GDQSPRD Position */ -#define DDRPHY_DX6GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX6GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX6GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX6GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX6GSR0: QSGERR Position */ -#define DDRPHY_DX6GSR0_QSGERR_Msk (0xful << DDRPHY_DX6GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX6GSR0: QSGERR Mask */ - -#define DDRPHY_DX6GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX6GSR0: WLDQ Position */ -#define DDRPHY_DX6GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX6GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX6GSR0: WLDQ Mask */ - -#define DDRPHY_DX6GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX6GSR1: DLTDONE Position */ -#define DDRPHY_DX6GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX6GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX6GSR1: DLTDONE Mask */ - -#define DDRPHY_DX6GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX6GSR1: DLTCODE Position */ -#define DDRPHY_DX6GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX6GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX6GSR1: DLTCODE Mask */ - -#define DDRPHY_DX6BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX6BDLR0: DQ0WBD Position */ -#define DDRPHY_DX6BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX6BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX6BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX6BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX6BDLR0: DQ1WBD Position */ -#define DDRPHY_DX6BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX6BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX6BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX6BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX6BDLR0: DQ2WBD Position */ -#define DDRPHY_DX6BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX6BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX6BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX6BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX6BDLR0: DQ3WBD Position */ -#define DDRPHY_DX6BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX6BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX6BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX6BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX6BDLR0: DQ4WBD Position */ -#define DDRPHY_DX6BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX6BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX6BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX6BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX6BDLR1: DQ5WBD Position */ -#define DDRPHY_DX6BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX6BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX6BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX6BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX6BDLR1: DQ6WBD Position */ -#define DDRPHY_DX6BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX6BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX6BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX6BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX6BDLR1: DQ7WBD Position */ -#define DDRPHY_DX6BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX6BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX6BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX6BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX6BDLR1: DMWBD Position */ -#define DDRPHY_DX6BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX6BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX6BDLR1: DMWBD Mask */ - -#define DDRPHY_DX6BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX6BDLR1: DSWBD Position */ -#define DDRPHY_DX6BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX6BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX6BDLR1: DSWBD Mask */ - -#define DDRPHY_DX6BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX6BDLR2: DSOEBD Position */ -#define DDRPHY_DX6BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX6BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX6BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX6BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX6BDLR2: DQOEBD Position */ -#define DDRPHY_DX6BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX6BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX6BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX6BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX6BDLR2: DSRBD Position */ -#define DDRPHY_DX6BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX6BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX6BDLR2: DSRBD Mask */ - -#define DDRPHY_DX6BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX6BDLR2: DSNRBD Position */ -#define DDRPHY_DX6BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX6BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX6BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX6BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX6BDLR3: DQ0RBD Position */ -#define DDRPHY_DX6BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX6BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX6BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX6BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX6BDLR3: DQ1RBD Position */ -#define DDRPHY_DX6BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX6BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX6BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX6BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX6BDLR3: DQ2RBD Position */ -#define DDRPHY_DX6BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX6BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX6BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX6BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX6BDLR3: DQ3RBD Position */ -#define DDRPHY_DX6BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX6BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX6BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX6BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX6BDLR3: DQ4RBD Position */ -#define DDRPHY_DX6BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX6BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX6BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX6BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX6BDLR4: DQ5RBD Position */ -#define DDRPHY_DX6BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX6BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX6BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX6BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX6BDLR4: DQ6RBD Position */ -#define DDRPHY_DX6BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX6BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX6BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX6BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX6BDLR4: DQ7RBD Position */ -#define DDRPHY_DX6BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX6BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX6BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX6BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX6BDLR4: DMRBD Position */ -#define DDRPHY_DX6BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX6BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX6BDLR4: DMRBD Mask */ - -#define DDRPHY_DX6LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX6LCDLR0: R0WLD Position */ -#define DDRPHY_DX6LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX6LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX6LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX6LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX6LCDLR0: R1WLD Position */ -#define DDRPHY_DX6LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX6LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX6LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX6LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX6LCDLR0: R2WLD Position */ -#define DDRPHY_DX6LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX6LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX6LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX6LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX6LCDLR0: R3WLD Position */ -#define DDRPHY_DX6LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX6LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX6LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX6LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX6LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX6LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX6LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX6LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX6LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX6LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX6LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX6LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX6LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX6LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX6LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX6LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX6LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX6LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX6LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX6LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX6LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX6LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX6LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX6MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX6MDLR: IPRD Position */ -#define DDRPHY_DX6MDLR_IPRD_Msk (0xfful << DDRPHY_DX6MDLR_IPRD_Pos) /*!< DDRPHY_T::DX6MDLR: IPRD Mask */ - -#define DDRPHY_DX6MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX6MDLR: TPRD Position */ -#define DDRPHY_DX6MDLR_TPRD_Msk (0xfful << DDRPHY_DX6MDLR_TPRD_Pos) /*!< DDRPHY_T::DX6MDLR: TPRD Mask */ - -#define DDRPHY_DX6MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX6MDLR: MDLD Position */ -#define DDRPHY_DX6MDLR_MDLD_Msk (0xfful << DDRPHY_DX6MDLR_MDLD_Pos) /*!< DDRPHY_T::DX6MDLR: MDLD Mask */ - -#define DDRPHY_DX6GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX6GTR: R0DGSL Position */ -#define DDRPHY_DX6GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX6GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX6GTR: R0DGSL Mask */ - -#define DDRPHY_DX6GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX6GTR: R1DGSL Position */ -#define DDRPHY_DX6GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX6GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX6GTR: R1DGSL Mask */ - -#define DDRPHY_DX6GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX6GTR: R2DGSL Position */ -#define DDRPHY_DX6GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX6GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX6GTR: R2DGSL Mask */ - -#define DDRPHY_DX6GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX6GTR: R3DGSL Position */ -#define DDRPHY_DX6GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX6GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX6GTR: R3DGSL Mask */ - -#define DDRPHY_DX6GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX6GTR: R0WLSL Position */ -#define DDRPHY_DX6GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX6GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX6GTR: R0WLSL Mask */ - -#define DDRPHY_DX6GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX6GTR: R1WLSL Position */ -#define DDRPHY_DX6GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX6GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX6GTR: R1WLSL Mask */ - -#define DDRPHY_DX6GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX6GTR: R2WLSL Position */ -#define DDRPHY_DX6GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX6GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX6GTR: R2WLSL Mask */ - -#define DDRPHY_DX6GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX6GTR: R3WLSL Position */ -#define DDRPHY_DX6GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX6GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX6GTR: R3WLSL Mask */ - -#define DDRPHY_DX6GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX6GSR2: RDERR Position */ -#define DDRPHY_DX6GSR2_RDERR_Msk (0x1ul << DDRPHY_DX6GSR2_RDERR_Pos) /*!< DDRPHY_T::DX6GSR2: RDERR Mask */ - -#define DDRPHY_DX6GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX6GSR2: RDWN Position */ -#define DDRPHY_DX6GSR2_RDWN_Msk (0x1ul << DDRPHY_DX6GSR2_RDWN_Pos) /*!< DDRPHY_T::DX6GSR2: RDWN Mask */ - -#define DDRPHY_DX6GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX6GSR2: WDERR Position */ -#define DDRPHY_DX6GSR2_WDERR_Msk (0x1ul << DDRPHY_DX6GSR2_WDERR_Pos) /*!< DDRPHY_T::DX6GSR2: WDERR Mask */ - -#define DDRPHY_DX6GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX6GSR2: WDWN Position */ -#define DDRPHY_DX6GSR2_WDWN_Msk (0x1ul << DDRPHY_DX6GSR2_WDWN_Pos) /*!< DDRPHY_T::DX6GSR2: WDWN Mask */ - -#define DDRPHY_DX6GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX6GSR2: REERR Position */ -#define DDRPHY_DX6GSR2_REERR_Msk (0x1ul << DDRPHY_DX6GSR2_REERR_Pos) /*!< DDRPHY_T::DX6GSR2: REERR Mask */ - -#define DDRPHY_DX6GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX6GSR2: REWN Position */ -#define DDRPHY_DX6GSR2_REWN_Msk (0x1ul << DDRPHY_DX6GSR2_REWN_Pos) /*!< DDRPHY_T::DX6GSR2: REWN Mask */ - -#define DDRPHY_DX6GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX6GSR2: WEERR Position */ -#define DDRPHY_DX6GSR2_WEERR_Msk (0x1ul << DDRPHY_DX6GSR2_WEERR_Pos) /*!< DDRPHY_T::DX6GSR2: WEERR Mask */ - -#define DDRPHY_DX6GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX6GSR2: WEWN Position */ -#define DDRPHY_DX6GSR2_WEWN_Msk (0x1ul << DDRPHY_DX6GSR2_WEWN_Pos) /*!< DDRPHY_T::DX6GSR2: WEWN Mask */ - -#define DDRPHY_DX6GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX6GSR2: ESTAT Position */ -#define DDRPHY_DX6GSR2_ESTAT_Msk (0xful << DDRPHY_DX6GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX6GSR2: ESTAT Mask */ - -#define DDRPHY_DX7GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX7GCR: DXEN Position */ -#define DDRPHY_DX7GCR_DXEN_Msk (0x1ul << DDRPHY_DX7GCR_DXEN_Pos) /*!< DDRPHY_T::DX7GCR: DXEN Mask */ - -#define DDRPHY_DX7GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX7GCR: DQSODT Position */ -#define DDRPHY_DX7GCR_DQSODT_Msk (0x1ul << DDRPHY_DX7GCR_DQSODT_Pos) /*!< DDRPHY_T::DX7GCR: DQSODT Mask */ - -#define DDRPHY_DX7GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX7GCR: DQODT Position */ -#define DDRPHY_DX7GCR_DQODT_Msk (0x1ul << DDRPHY_DX7GCR_DQODT_Pos) /*!< DDRPHY_T::DX7GCR: DQODT Mask */ - -#define DDRPHY_DX7GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX7GCR: DXIOM Position */ -#define DDRPHY_DX7GCR_DXIOM_Msk (0x1ul << DDRPHY_DX7GCR_DXIOM_Pos) /*!< DDRPHY_T::DX7GCR: DXIOM Mask */ - -#define DDRPHY_DX7GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX7GCR: DXPDD Position */ -#define DDRPHY_DX7GCR_DXPDD_Msk (0x1ul << DDRPHY_DX7GCR_DXPDD_Pos) /*!< DDRPHY_T::DX7GCR: DXPDD Mask */ - -#define DDRPHY_DX7GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX7GCR: DXPDR Position */ -#define DDRPHY_DX7GCR_DXPDR_Msk (0x1ul << DDRPHY_DX7GCR_DXPDR_Pos) /*!< DDRPHY_T::DX7GCR: DXPDR Mask */ - -#define DDRPHY_DX7GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX7GCR: DQSRPD Position */ -#define DDRPHY_DX7GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX7GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX7GCR: DQSRPD Mask */ - -#define DDRPHY_DX7GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX7GCR: DSEN Position */ -#define DDRPHY_DX7GCR_DSEN_Msk (0x3ul << DDRPHY_DX7GCR_DSEN_Pos) /*!< DDRPHY_T::DX7GCR: DSEN Mask */ - -#define DDRPHY_DX7GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX7GCR: DQSRTT Position */ -#define DDRPHY_DX7GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX7GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX7GCR: DQSRTT Mask */ - -#define DDRPHY_DX7GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX7GCR: DQRTT Position */ -#define DDRPHY_DX7GCR_DQRTT_Msk (0x1ul << DDRPHY_DX7GCR_DQRTT_Pos) /*!< DDRPHY_T::DX7GCR: DQRTT Mask */ - -#define DDRPHY_DX7GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX7GCR: RTTOH Position */ -#define DDRPHY_DX7GCR_RTTOH_Msk (0x3ul << DDRPHY_DX7GCR_RTTOH_Pos) /*!< DDRPHY_T::DX7GCR: RTTOH Mask */ - -#define DDRPHY_DX7GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX7GCR: RTTOAL Position */ -#define DDRPHY_DX7GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX7GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX7GCR: RTTOAL Mask */ - -#define DDRPHY_DX7GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX7GCR: DXOEO Position */ -#define DDRPHY_DX7GCR_DXOEO_Msk (0x3ul << DDRPHY_DX7GCR_DXOEO_Pos) /*!< DDRPHY_T::DX7GCR: DXOEO Mask */ - -#define DDRPHY_DX7GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX7GCR: PLLRST Position */ -#define DDRPHY_DX7GCR_PLLRST_Msk (0x1ul << DDRPHY_DX7GCR_PLLRST_Pos) /*!< DDRPHY_T::DX7GCR: PLLRST Mask */ - -#define DDRPHY_DX7GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX7GCR: PLLPD Position */ -#define DDRPHY_DX7GCR_PLLPD_Msk (0x1ul << DDRPHY_DX7GCR_PLLPD_Pos) /*!< DDRPHY_T::DX7GCR: PLLPD Mask */ - -#define DDRPHY_DX7GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX7GCR: GSHIFT Position */ -#define DDRPHY_DX7GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX7GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX7GCR: GSHIFT Mask */ - -#define DDRPHY_DX7GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX7GCR: PLLBYP Position */ -#define DDRPHY_DX7GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX7GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX7GCR: PLLBYP Mask */ - -#define DDRPHY_DX7GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX7GCR: WLRKEN Position */ -#define DDRPHY_DX7GCR_WLRKEN_Msk (0xful << DDRPHY_DX7GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX7GCR: WLRKEN Mask */ - -#define DDRPHY_DX7GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX7GCR: MDLEN Position */ -#define DDRPHY_DX7GCR_MDLEN_Msk (0x1ul << DDRPHY_DX7GCR_MDLEN_Pos) /*!< DDRPHY_T::DX7GCR: MDLEN Mask */ - -#define DDRPHY_DX7GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX7GCR: CALBYP Position */ -#define DDRPHY_DX7GCR_CALBYP_Msk (0x1ul << DDRPHY_DX7GCR_CALBYP_Pos) /*!< DDRPHY_T::DX7GCR: CALBYP Mask */ - -#define DDRPHY_DX7GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX7GSR0: WDQCAL Position */ -#define DDRPHY_DX7GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX7GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX7GSR0: WDQCAL Mask */ - -#define DDRPHY_DX7GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX7GSR0: RDQSCAL Position */ -#define DDRPHY_DX7GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX7GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX7GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX7GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX7GSR0: RDQSNCAL Position */ -#define DDRPHY_DX7GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX7GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX7GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX7GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX7GSR0: GDQSCAL Position */ -#define DDRPHY_DX7GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX7GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX7GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX7GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX7GSR0: WLCAL Position */ -#define DDRPHY_DX7GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX7GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX7GSR0: WLCAL Mask */ - -#define DDRPHY_DX7GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX7GSR0: WLDONE Position */ -#define DDRPHY_DX7GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX7GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX7GSR0: WLDONE Mask */ - -#define DDRPHY_DX7GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX7GSR0: WLERR Position */ -#define DDRPHY_DX7GSR0_WLERR_Msk (0x1ul << DDRPHY_DX7GSR0_WLERR_Pos) /*!< DDRPHY_T::DX7GSR0: WLERR Mask */ - -#define DDRPHY_DX7GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX7GSR0: WLPRD Position */ -#define DDRPHY_DX7GSR0_WLPRD_Msk (0xfful << DDRPHY_DX7GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX7GSR0: WLPRD Mask */ - -#define DDRPHY_DX7GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX7GSR0: DPLOCK Position */ -#define DDRPHY_DX7GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX7GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX7GSR0: DPLOCK Mask */ - -#define DDRPHY_DX7GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX7GSR0: GDQSPRD Position */ -#define DDRPHY_DX7GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX7GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX7GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX7GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX7GSR0: QSGERR Position */ -#define DDRPHY_DX7GSR0_QSGERR_Msk (0xful << DDRPHY_DX7GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX7GSR0: QSGERR Mask */ - -#define DDRPHY_DX7GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX7GSR0: WLDQ Position */ -#define DDRPHY_DX7GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX7GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX7GSR0: WLDQ Mask */ - -#define DDRPHY_DX7GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX7GSR1: DLTDONE Position */ -#define DDRPHY_DX7GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX7GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX7GSR1: DLTDONE Mask */ - -#define DDRPHY_DX7GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX7GSR1: DLTCODE Position */ -#define DDRPHY_DX7GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX7GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX7GSR1: DLTCODE Mask */ - -#define DDRPHY_DX7BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX7BDLR0: DQ0WBD Position */ -#define DDRPHY_DX7BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX7BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX7BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX7BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX7BDLR0: DQ1WBD Position */ -#define DDRPHY_DX7BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX7BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX7BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX7BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX7BDLR0: DQ2WBD Position */ -#define DDRPHY_DX7BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX7BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX7BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX7BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX7BDLR0: DQ3WBD Position */ -#define DDRPHY_DX7BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX7BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX7BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX7BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX7BDLR0: DQ4WBD Position */ -#define DDRPHY_DX7BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX7BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX7BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX7BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX7BDLR1: DQ5WBD Position */ -#define DDRPHY_DX7BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX7BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX7BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX7BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX7BDLR1: DQ6WBD Position */ -#define DDRPHY_DX7BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX7BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX7BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX7BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX7BDLR1: DQ7WBD Position */ -#define DDRPHY_DX7BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX7BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX7BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX7BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX7BDLR1: DMWBD Position */ -#define DDRPHY_DX7BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX7BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX7BDLR1: DMWBD Mask */ - -#define DDRPHY_DX7BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX7BDLR1: DSWBD Position */ -#define DDRPHY_DX7BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX7BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX7BDLR1: DSWBD Mask */ - -#define DDRPHY_DX7BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX7BDLR2: DSOEBD Position */ -#define DDRPHY_DX7BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX7BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX7BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX7BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX7BDLR2: DQOEBD Position */ -#define DDRPHY_DX7BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX7BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX7BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX7BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX7BDLR2: DSRBD Position */ -#define DDRPHY_DX7BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX7BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX7BDLR2: DSRBD Mask */ - -#define DDRPHY_DX7BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX7BDLR2: DSNRBD Position */ -#define DDRPHY_DX7BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX7BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX7BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX7BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX7BDLR3: DQ0RBD Position */ -#define DDRPHY_DX7BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX7BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX7BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX7BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX7BDLR3: DQ1RBD Position */ -#define DDRPHY_DX7BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX7BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX7BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX7BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX7BDLR3: DQ2RBD Position */ -#define DDRPHY_DX7BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX7BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX7BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX7BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX7BDLR3: DQ3RBD Position */ -#define DDRPHY_DX7BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX7BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX7BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX7BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX7BDLR3: DQ4RBD Position */ -#define DDRPHY_DX7BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX7BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX7BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX7BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX7BDLR4: DQ5RBD Position */ -#define DDRPHY_DX7BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX7BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX7BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX7BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX7BDLR4: DQ6RBD Position */ -#define DDRPHY_DX7BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX7BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX7BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX7BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX7BDLR4: DQ7RBD Position */ -#define DDRPHY_DX7BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX7BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX7BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX7BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX7BDLR4: DMRBD Position */ -#define DDRPHY_DX7BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX7BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX7BDLR4: DMRBD Mask */ - -#define DDRPHY_DX7LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX7LCDLR0: R0WLD Position */ -#define DDRPHY_DX7LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX7LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX7LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX7LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX7LCDLR0: R1WLD Position */ -#define DDRPHY_DX7LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX7LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX7LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX7LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX7LCDLR0: R2WLD Position */ -#define DDRPHY_DX7LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX7LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX7LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX7LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX7LCDLR0: R3WLD Position */ -#define DDRPHY_DX7LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX7LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX7LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX7LCDLR1_WDQD_Pos (0) /*!< DDRPHY_T::DX7LCDLR1: WDQD Position */ -#define DDRPHY_DX7LCDLR1_WDQD_Msk (0xfful << DDRPHY_DX7LCDLR1_WDQD_Pos) /*!< DDRPHY_T::DX7LCDLR1: WDQD Mask */ - -#define DDRPHY_DX7LCDLR1_RDQSD_Pos (8) /*!< DDRPHY_T::DX7LCDLR1: RDQSD Position */ -#define DDRPHY_DX7LCDLR1_RDQSD_Msk (0xfful << DDRPHY_DX7LCDLR1_RDQSD_Pos) /*!< DDRPHY_T::DX7LCDLR1: RDQSD Mask */ - -#define DDRPHY_DX7LCDLR1_RDQSND_Pos (16) /*!< DDRPHY_T::DX7LCDLR1: RDQSND Position */ -#define DDRPHY_DX7LCDLR1_RDQSND_Msk (0xfful << DDRPHY_DX7LCDLR1_RDQSND_Pos) /*!< DDRPHY_T::DX7LCDLR1: RDQSND Mask */ - -#define DDRPHY_DX7LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX7LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX7LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX7LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX7LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX7LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX7LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX7LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX7LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX7LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX7LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX7LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX7LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX7LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX7LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX7LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX7LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX7LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX7LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX7LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX7MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX7MDLR: IPRD Position */ -#define DDRPHY_DX7MDLR_IPRD_Msk (0xfful << DDRPHY_DX7MDLR_IPRD_Pos) /*!< DDRPHY_T::DX7MDLR: IPRD Mask */ - -#define DDRPHY_DX7MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX7MDLR: TPRD Position */ -#define DDRPHY_DX7MDLR_TPRD_Msk (0xfful << DDRPHY_DX7MDLR_TPRD_Pos) /*!< DDRPHY_T::DX7MDLR: TPRD Mask */ - -#define DDRPHY_DX7MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX7MDLR: MDLD Position */ -#define DDRPHY_DX7MDLR_MDLD_Msk (0xfful << DDRPHY_DX7MDLR_MDLD_Pos) /*!< DDRPHY_T::DX7MDLR: MDLD Mask */ - -#define DDRPHY_DX7GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX7GTR: R0DGSL Position */ -#define DDRPHY_DX7GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX7GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX7GTR: R0DGSL Mask */ - -#define DDRPHY_DX7GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX7GTR: R1DGSL Position */ -#define DDRPHY_DX7GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX7GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX7GTR: R1DGSL Mask */ - -#define DDRPHY_DX7GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX7GTR: R2DGSL Position */ -#define DDRPHY_DX7GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX7GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX7GTR: R2DGSL Mask */ - -#define DDRPHY_DX7GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX7GTR: R3DGSL Position */ -#define DDRPHY_DX7GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX7GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX7GTR: R3DGSL Mask */ - -#define DDRPHY_DX7GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX7GTR: R0WLSL Position */ -#define DDRPHY_DX7GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX7GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX7GTR: R0WLSL Mask */ - -#define DDRPHY_DX7GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX7GTR: R1WLSL Position */ -#define DDRPHY_DX7GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX7GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX7GTR: R1WLSL Mask */ - -#define DDRPHY_DX7GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX7GTR: R2WLSL Position */ -#define DDRPHY_DX7GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX7GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX7GTR: R2WLSL Mask */ - -#define DDRPHY_DX7GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX7GTR: R3WLSL Position */ -#define DDRPHY_DX7GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX7GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX7GTR: R3WLSL Mask */ - -#define DDRPHY_DX7GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX7GSR2: RDERR Position */ -#define DDRPHY_DX7GSR2_RDERR_Msk (0x1ul << DDRPHY_DX7GSR2_RDERR_Pos) /*!< DDRPHY_T::DX7GSR2: RDERR Mask */ - -#define DDRPHY_DX7GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX7GSR2: RDWN Position */ -#define DDRPHY_DX7GSR2_RDWN_Msk (0x1ul << DDRPHY_DX7GSR2_RDWN_Pos) /*!< DDRPHY_T::DX7GSR2: RDWN Mask */ - -#define DDRPHY_DX7GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX7GSR2: WDERR Position */ -#define DDRPHY_DX7GSR2_WDERR_Msk (0x1ul << DDRPHY_DX7GSR2_WDERR_Pos) /*!< DDRPHY_T::DX7GSR2: WDERR Mask */ - -#define DDRPHY_DX7GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX7GSR2: WDWN Position */ -#define DDRPHY_DX7GSR2_WDWN_Msk (0x1ul << DDRPHY_DX7GSR2_WDWN_Pos) /*!< DDRPHY_T::DX7GSR2: WDWN Mask */ - -#define DDRPHY_DX7GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX7GSR2: REERR Position */ -#define DDRPHY_DX7GSR2_REERR_Msk (0x1ul << DDRPHY_DX7GSR2_REERR_Pos) /*!< DDRPHY_T::DX7GSR2: REERR Mask */ - -#define DDRPHY_DX7GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX7GSR2: REWN Position */ -#define DDRPHY_DX7GSR2_REWN_Msk (0x1ul << DDRPHY_DX7GSR2_REWN_Pos) /*!< DDRPHY_T::DX7GSR2: REWN Mask */ - -#define DDRPHY_DX7GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX7GSR2: WEERR Position */ -#define DDRPHY_DX7GSR2_WEERR_Msk (0x1ul << DDRPHY_DX7GSR2_WEERR_Pos) /*!< DDRPHY_T::DX7GSR2: WEERR Mask */ - -#define DDRPHY_DX7GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX7GSR2: WEWN Position */ -#define DDRPHY_DX7GSR2_WEWN_Msk (0x1ul << DDRPHY_DX7GSR2_WEWN_Pos) /*!< DDRPHY_T::DX7GSR2: WEWN Mask */ - -#define DDRPHY_DX7GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX7GSR2: ESTAT Position */ -#define DDRPHY_DX7GSR2_ESTAT_Msk (0xful << DDRPHY_DX7GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX7GSR2: ESTAT Mask */ - -#define DDRPHY_DX8GCR_DXEN_Pos (0) /*!< DDRPHY_T::DX8GCR: DXEN Position */ -#define DDRPHY_DX8GCR_DXEN_Msk (0x1ul << DDRPHY_DX8GCR_DXEN_Pos) /*!< DDRPHY_T::DX8GCR: DXEN Mask */ - -#define DDRPHY_DX8GCR_DQSODT_Pos (1) /*!< DDRPHY_T::DX8GCR: DQSODT Position */ -#define DDRPHY_DX8GCR_DQSODT_Msk (0x1ul << DDRPHY_DX8GCR_DQSODT_Pos) /*!< DDRPHY_T::DX8GCR: DQSODT Mask */ - -#define DDRPHY_DX8GCR_DQODT_Pos (2) /*!< DDRPHY_T::DX8GCR: DQODT Position */ -#define DDRPHY_DX8GCR_DQODT_Msk (0x1ul << DDRPHY_DX8GCR_DQODT_Pos) /*!< DDRPHY_T::DX8GCR: DQODT Mask */ - -#define DDRPHY_DX8GCR_DXIOM_Pos (3) /*!< DDRPHY_T::DX8GCR: DXIOM Position */ -#define DDRPHY_DX8GCR_DXIOM_Msk (0x1ul << DDRPHY_DX8GCR_DXIOM_Pos) /*!< DDRPHY_T::DX8GCR: DXIOM Mask */ - -#define DDRPHY_DX8GCR_DXPDD_Pos (4) /*!< DDRPHY_T::DX8GCR: DXPDD Position */ -#define DDRPHY_DX8GCR_DXPDD_Msk (0x1ul << DDRPHY_DX8GCR_DXPDD_Pos) /*!< DDRPHY_T::DX8GCR: DXPDD Mask */ - -#define DDRPHY_DX8GCR_DXPDR_Pos (5) /*!< DDRPHY_T::DX8GCR: DXPDR Position */ -#define DDRPHY_DX8GCR_DXPDR_Msk (0x1ul << DDRPHY_DX8GCR_DXPDR_Pos) /*!< DDRPHY_T::DX8GCR: DXPDR Mask */ - -#define DDRPHY_DX8GCR_DQSRPD_Pos (6) /*!< DDRPHY_T::DX8GCR: DQSRPD Position */ -#define DDRPHY_DX8GCR_DQSRPD_Msk (0x1ul << DDRPHY_DX8GCR_DQSRPD_Pos) /*!< DDRPHY_T::DX8GCR: DQSRPD Mask */ - -#define DDRPHY_DX8GCR_DSEN_Pos (7) /*!< DDRPHY_T::DX8GCR: DSEN Position */ -#define DDRPHY_DX8GCR_DSEN_Msk (0x3ul << DDRPHY_DX8GCR_DSEN_Pos) /*!< DDRPHY_T::DX8GCR: DSEN Mask */ - -#define DDRPHY_DX8GCR_DQSRTT_Pos (9) /*!< DDRPHY_T::DX8GCR: DQSRTT Position */ -#define DDRPHY_DX8GCR_DQSRTT_Msk (0x1ul << DDRPHY_DX8GCR_DQSRTT_Pos) /*!< DDRPHY_T::DX8GCR: DQSRTT Mask */ - -#define DDRPHY_DX8GCR_DQRTT_Pos (10) /*!< DDRPHY_T::DX8GCR: DQRTT Position */ -#define DDRPHY_DX8GCR_DQRTT_Msk (0x1ul << DDRPHY_DX8GCR_DQRTT_Pos) /*!< DDRPHY_T::DX8GCR: DQRTT Mask */ - -#define DDRPHY_DX8GCR_RTTOH_Pos (11) /*!< DDRPHY_T::DX8GCR: RTTOH Position */ -#define DDRPHY_DX8GCR_RTTOH_Msk (0x3ul << DDRPHY_DX8GCR_RTTOH_Pos) /*!< DDRPHY_T::DX8GCR: RTTOH Mask */ - -#define DDRPHY_DX8GCR_RTTOAL_Pos (13) /*!< DDRPHY_T::DX8GCR: RTTOAL Position */ -#define DDRPHY_DX8GCR_RTTOAL_Msk (0x1ul << DDRPHY_DX8GCR_RTTOAL_Pos) /*!< DDRPHY_T::DX8GCR: RTTOAL Mask */ - -#define DDRPHY_DX8GCR_DXOEO_Pos (14) /*!< DDRPHY_T::DX8GCR: DXOEO Position */ -#define DDRPHY_DX8GCR_DXOEO_Msk (0x3ul << DDRPHY_DX8GCR_DXOEO_Pos) /*!< DDRPHY_T::DX8GCR: DXOEO Mask */ - -#define DDRPHY_DX8GCR_PLLRST_Pos (16) /*!< DDRPHY_T::DX8GCR: PLLRST Position */ -#define DDRPHY_DX8GCR_PLLRST_Msk (0x1ul << DDRPHY_DX8GCR_PLLRST_Pos) /*!< DDRPHY_T::DX8GCR: PLLRST Mask */ - -#define DDRPHY_DX8GCR_PLLPD_Pos (17) /*!< DDRPHY_T::DX8GCR: PLLPD Position */ -#define DDRPHY_DX8GCR_PLLPD_Msk (0x1ul << DDRPHY_DX8GCR_PLLPD_Pos) /*!< DDRPHY_T::DX8GCR: PLLPD Mask */ - -#define DDRPHY_DX8GCR_GSHIFT_Pos (18) /*!< DDRPHY_T::DX8GCR: GSHIFT Position */ -#define DDRPHY_DX8GCR_GSHIFT_Msk (0x1ul << DDRPHY_DX8GCR_GSHIFT_Pos) /*!< DDRPHY_T::DX8GCR: GSHIFT Mask */ - -#define DDRPHY_DX8GCR_PLLBYP_Pos (19) /*!< DDRPHY_T::DX8GCR: PLLBYP Position */ -#define DDRPHY_DX8GCR_PLLBYP_Msk (0x1ul << DDRPHY_DX8GCR_PLLBYP_Pos) /*!< DDRPHY_T::DX8GCR: PLLBYP Mask */ - -#define DDRPHY_DX8GCR_WLRKEN_Pos (26) /*!< DDRPHY_T::DX8GCR: WLRKEN Position */ -#define DDRPHY_DX8GCR_WLRKEN_Msk (0xful << DDRPHY_DX8GCR_WLRKEN_Pos) /*!< DDRPHY_T::DX8GCR: WLRKEN Mask */ - -#define DDRPHY_DX8GCR_MDLEN_Pos (30) /*!< DDRPHY_T::DX8GCR: MDLEN Position */ -#define DDRPHY_DX8GCR_MDLEN_Msk (0x1ul << DDRPHY_DX8GCR_MDLEN_Pos) /*!< DDRPHY_T::DX8GCR: MDLEN Mask */ - -#define DDRPHY_DX8GCR_CALBYP_Pos (31) /*!< DDRPHY_T::DX8GCR: CALBYP Position */ -#define DDRPHY_DX8GCR_CALBYP_Msk (0x1ul << DDRPHY_DX8GCR_CALBYP_Pos) /*!< DDRPHY_T::DX8GCR: CALBYP Mask */ - -#define DDRPHY_DX8GSR0_WDQCAL_Pos (0) /*!< DDRPHY_T::DX8GSR0: WDQCAL Position */ -#define DDRPHY_DX8GSR0_WDQCAL_Msk (0x1ul << DDRPHY_DX8GSR0_WDQCAL_Pos) /*!< DDRPHY_T::DX8GSR0: WDQCAL Mask */ - -#define DDRPHY_DX8GSR0_RDQSCAL_Pos (1) /*!< DDRPHY_T::DX8GSR0: RDQSCAL Position */ -#define DDRPHY_DX8GSR0_RDQSCAL_Msk (0x1ul << DDRPHY_DX8GSR0_RDQSCAL_Pos) /*!< DDRPHY_T::DX8GSR0: RDQSCAL Mask */ - -#define DDRPHY_DX8GSR0_RDQSNCAL_Pos (2) /*!< DDRPHY_T::DX8GSR0: RDQSNCAL Position */ -#define DDRPHY_DX8GSR0_RDQSNCAL_Msk (0x1ul << DDRPHY_DX8GSR0_RDQSNCAL_Pos) /*!< DDRPHY_T::DX8GSR0: RDQSNCAL Mask */ - -#define DDRPHY_DX8GSR0_GDQSCAL_Pos (3) /*!< DDRPHY_T::DX8GSR0: GDQSCAL Position */ -#define DDRPHY_DX8GSR0_GDQSCAL_Msk (0x1ul << DDRPHY_DX8GSR0_GDQSCAL_Pos) /*!< DDRPHY_T::DX8GSR0: GDQSCAL Mask */ - -#define DDRPHY_DX8GSR0_WLCAL_Pos (4) /*!< DDRPHY_T::DX8GSR0: WLCAL Position */ -#define DDRPHY_DX8GSR0_WLCAL_Msk (0x1ul << DDRPHY_DX8GSR0_WLCAL_Pos) /*!< DDRPHY_T::DX8GSR0: WLCAL Mask */ - -#define DDRPHY_DX8GSR0_WLDONE_Pos (5) /*!< DDRPHY_T::DX8GSR0: WLDONE Position */ -#define DDRPHY_DX8GSR0_WLDONE_Msk (0x1ul << DDRPHY_DX8GSR0_WLDONE_Pos) /*!< DDRPHY_T::DX8GSR0: WLDONE Mask */ - -#define DDRPHY_DX8GSR0_WLERR_Pos (6) /*!< DDRPHY_T::DX8GSR0: WLERR Position */ -#define DDRPHY_DX8GSR0_WLERR_Msk (0x1ul << DDRPHY_DX8GSR0_WLERR_Pos) /*!< DDRPHY_T::DX8GSR0: WLERR Mask */ - -#define DDRPHY_DX8GSR0_WLPRD_Pos (7) /*!< DDRPHY_T::DX8GSR0: WLPRD Position */ -#define DDRPHY_DX8GSR0_WLPRD_Msk (0xfful << DDRPHY_DX8GSR0_WLPRD_Pos) /*!< DDRPHY_T::DX8GSR0: WLPRD Mask */ - -#define DDRPHY_DX8GSR0_DPLOCK_Pos (15) /*!< DDRPHY_T::DX8GSR0: DPLOCK Position */ -#define DDRPHY_DX8GSR0_DPLOCK_Msk (0x1ul << DDRPHY_DX8GSR0_DPLOCK_Pos) /*!< DDRPHY_T::DX8GSR0: DPLOCK Mask */ - -#define DDRPHY_DX8GSR0_GDQSPRD_Pos (16) /*!< DDRPHY_T::DX8GSR0: GDQSPRD Position */ -#define DDRPHY_DX8GSR0_GDQSPRD_Msk (0xfful << DDRPHY_DX8GSR0_GDQSPRD_Pos) /*!< DDRPHY_T::DX8GSR0: GDQSPRD Mask */ - -#define DDRPHY_DX8GSR0_QSGERR_Pos (24) /*!< DDRPHY_T::DX8GSR0: QSGERR Position */ -#define DDRPHY_DX8GSR0_QSGERR_Msk (0xful << DDRPHY_DX8GSR0_QSGERR_Pos) /*!< DDRPHY_T::DX8GSR0: QSGERR Mask */ - -#define DDRPHY_DX8GSR0_WLDQ_Pos (28) /*!< DDRPHY_T::DX8GSR0: WLDQ Position */ -#define DDRPHY_DX8GSR0_WLDQ_Msk (0x1ul << DDRPHY_DX8GSR0_WLDQ_Pos) /*!< DDRPHY_T::DX8GSR0: WLDQ Mask */ - -#define DDRPHY_DX8GSR1_DLTDONE_Pos (0) /*!< DDRPHY_T::DX8GSR1: DLTDONE Position */ -#define DDRPHY_DX8GSR1_DLTDONE_Msk (0x1ul << DDRPHY_DX8GSR1_DLTDONE_Pos) /*!< DDRPHY_T::DX8GSR1: DLTDONE Mask */ - -#define DDRPHY_DX8GSR1_DLTCODE_Pos (1) /*!< DDRPHY_T::DX8GSR1: DLTCODE Position */ -#define DDRPHY_DX8GSR1_DLTCODE_Msk (0xfffffful << DDRPHY_DX8GSR1_DLTCODE_Pos) /*!< DDRPHY_T::DX8GSR1: DLTCODE Mask */ - -#define DDRPHY_DX8BDLR0_DQ0WBD_Pos (0) /*!< DDRPHY_T::DX8BDLR0: DQ0WBD Position */ -#define DDRPHY_DX8BDLR0_DQ0WBD_Msk (0x3ful << DDRPHY_DX8BDLR0_DQ0WBD_Pos) /*!< DDRPHY_T::DX8BDLR0: DQ0WBD Mask */ - -#define DDRPHY_DX8BDLR0_DQ1WBD_Pos (6) /*!< DDRPHY_T::DX8BDLR0: DQ1WBD Position */ -#define DDRPHY_DX8BDLR0_DQ1WBD_Msk (0x3ful << DDRPHY_DX8BDLR0_DQ1WBD_Pos) /*!< DDRPHY_T::DX8BDLR0: DQ1WBD Mask */ - -#define DDRPHY_DX8BDLR0_DQ2WBD_Pos (12) /*!< DDRPHY_T::DX8BDLR0: DQ2WBD Position */ -#define DDRPHY_DX8BDLR0_DQ2WBD_Msk (0x3ful << DDRPHY_DX8BDLR0_DQ2WBD_Pos) /*!< DDRPHY_T::DX8BDLR0: DQ2WBD Mask */ - -#define DDRPHY_DX8BDLR0_DQ3WBD_Pos (18) /*!< DDRPHY_T::DX8BDLR0: DQ3WBD Position */ -#define DDRPHY_DX8BDLR0_DQ3WBD_Msk (0x3ful << DDRPHY_DX8BDLR0_DQ3WBD_Pos) /*!< DDRPHY_T::DX8BDLR0: DQ3WBD Mask */ - -#define DDRPHY_DX8BDLR0_DQ4WBD_Pos (24) /*!< DDRPHY_T::DX8BDLR0: DQ4WBD Position */ -#define DDRPHY_DX8BDLR0_DQ4WBD_Msk (0x3ful << DDRPHY_DX8BDLR0_DQ4WBD_Pos) /*!< DDRPHY_T::DX8BDLR0: DQ4WBD Mask */ - -#define DDRPHY_DX8BDLR1_DQ5WBD_Pos (0) /*!< DDRPHY_T::DX8BDLR1: DQ5WBD Position */ -#define DDRPHY_DX8BDLR1_DQ5WBD_Msk (0x3ful << DDRPHY_DX8BDLR1_DQ5WBD_Pos) /*!< DDRPHY_T::DX8BDLR1: DQ5WBD Mask */ - -#define DDRPHY_DX8BDLR1_DQ6WBD_Pos (6) /*!< DDRPHY_T::DX8BDLR1: DQ6WBD Position */ -#define DDRPHY_DX8BDLR1_DQ6WBD_Msk (0x3ful << DDRPHY_DX8BDLR1_DQ6WBD_Pos) /*!< DDRPHY_T::DX8BDLR1: DQ6WBD Mask */ - -#define DDRPHY_DX8BDLR1_DQ7WBD_Pos (12) /*!< DDRPHY_T::DX8BDLR1: DQ7WBD Position */ -#define DDRPHY_DX8BDLR1_DQ7WBD_Msk (0x3ful << DDRPHY_DX8BDLR1_DQ7WBD_Pos) /*!< DDRPHY_T::DX8BDLR1: DQ7WBD Mask */ - -#define DDRPHY_DX8BDLR1_DMWBD_Pos (18) /*!< DDRPHY_T::DX8BDLR1: DMWBD Position */ -#define DDRPHY_DX8BDLR1_DMWBD_Msk (0x3ful << DDRPHY_DX8BDLR1_DMWBD_Pos) /*!< DDRPHY_T::DX8BDLR1: DMWBD Mask */ - -#define DDRPHY_DX8BDLR1_DSWBD_Pos (24) /*!< DDRPHY_T::DX8BDLR1: DSWBD Position */ -#define DDRPHY_DX8BDLR1_DSWBD_Msk (0x3ful << DDRPHY_DX8BDLR1_DSWBD_Pos) /*!< DDRPHY_T::DX8BDLR1: DSWBD Mask */ - -#define DDRPHY_DX8BDLR2_DSOEBD_Pos (0) /*!< DDRPHY_T::DX8BDLR2: DSOEBD Position */ -#define DDRPHY_DX8BDLR2_DSOEBD_Msk (0x3ful << DDRPHY_DX8BDLR2_DSOEBD_Pos) /*!< DDRPHY_T::DX8BDLR2: DSOEBD Mask */ - -#define DDRPHY_DX8BDLR2_DQOEBD_Pos (6) /*!< DDRPHY_T::DX8BDLR2: DQOEBD Position */ -#define DDRPHY_DX8BDLR2_DQOEBD_Msk (0x3ful << DDRPHY_DX8BDLR2_DQOEBD_Pos) /*!< DDRPHY_T::DX8BDLR2: DQOEBD Mask */ - -#define DDRPHY_DX8BDLR2_DSRBD_Pos (12) /*!< DDRPHY_T::DX8BDLR2: DSRBD Position */ -#define DDRPHY_DX8BDLR2_DSRBD_Msk (0x3ful << DDRPHY_DX8BDLR2_DSRBD_Pos) /*!< DDRPHY_T::DX8BDLR2: DSRBD Mask */ - -#define DDRPHY_DX8BDLR2_DSNRBD_Pos (18) /*!< DDRPHY_T::DX8BDLR2: DSNRBD Position */ -#define DDRPHY_DX8BDLR2_DSNRBD_Msk (0x3ful << DDRPHY_DX8BDLR2_DSNRBD_Pos) /*!< DDRPHY_T::DX8BDLR2: DSNRBD Mask */ - -#define DDRPHY_DX8BDLR3_DQ0RBD_Pos (0) /*!< DDRPHY_T::DX8BDLR3: DQ0RBD Position */ -#define DDRPHY_DX8BDLR3_DQ0RBD_Msk (0x3ful << DDRPHY_DX8BDLR3_DQ0RBD_Pos) /*!< DDRPHY_T::DX8BDLR3: DQ0RBD Mask */ - -#define DDRPHY_DX8BDLR3_DQ1RBD_Pos (6) /*!< DDRPHY_T::DX8BDLR3: DQ1RBD Position */ -#define DDRPHY_DX8BDLR3_DQ1RBD_Msk (0x3ful << DDRPHY_DX8BDLR3_DQ1RBD_Pos) /*!< DDRPHY_T::DX8BDLR3: DQ1RBD Mask */ - -#define DDRPHY_DX8BDLR3_DQ2RBD_Pos (12) /*!< DDRPHY_T::DX8BDLR3: DQ2RBD Position */ -#define DDRPHY_DX8BDLR3_DQ2RBD_Msk (0x3ful << DDRPHY_DX8BDLR3_DQ2RBD_Pos) /*!< DDRPHY_T::DX8BDLR3: DQ2RBD Mask */ - -#define DDRPHY_DX8BDLR3_DQ3RBD_Pos (18) /*!< DDRPHY_T::DX8BDLR3: DQ3RBD Position */ -#define DDRPHY_DX8BDLR3_DQ3RBD_Msk (0x3ful << DDRPHY_DX8BDLR3_DQ3RBD_Pos) /*!< DDRPHY_T::DX8BDLR3: DQ3RBD Mask */ - -#define DDRPHY_DX8BDLR3_DQ4RBD_Pos (24) /*!< DDRPHY_T::DX8BDLR3: DQ4RBD Position */ -#define DDRPHY_DX8BDLR3_DQ4RBD_Msk (0x3ful << DDRPHY_DX8BDLR3_DQ4RBD_Pos) /*!< DDRPHY_T::DX8BDLR3: DQ4RBD Mask */ - -#define DDRPHY_DX8BDLR4_DQ5RBD_Pos (0) /*!< DDRPHY_T::DX8BDLR4: DQ5RBD Position */ -#define DDRPHY_DX8BDLR4_DQ5RBD_Msk (0x3ful << DDRPHY_DX8BDLR4_DQ5RBD_Pos) /*!< DDRPHY_T::DX8BDLR4: DQ5RBD Mask */ - -#define DDRPHY_DX8BDLR4_DQ6RBD_Pos (6) /*!< DDRPHY_T::DX8BDLR4: DQ6RBD Position */ -#define DDRPHY_DX8BDLR4_DQ6RBD_Msk (0x3ful << DDRPHY_DX8BDLR4_DQ6RBD_Pos) /*!< DDRPHY_T::DX8BDLR4: DQ6RBD Mask */ - -#define DDRPHY_DX8BDLR4_DQ7RBD_Pos (12) /*!< DDRPHY_T::DX8BDLR4: DQ7RBD Position */ -#define DDRPHY_DX8BDLR4_DQ7RBD_Msk (0x3ful << DDRPHY_DX8BDLR4_DQ7RBD_Pos) /*!< DDRPHY_T::DX8BDLR4: DQ7RBD Mask */ - -#define DDRPHY_DX8BDLR4_DMRBD_Pos (18) /*!< DDRPHY_T::DX8BDLR4: DMRBD Position */ -#define DDRPHY_DX8BDLR4_DMRBD_Msk (0x3ful << DDRPHY_DX8BDLR4_DMRBD_Pos) /*!< DDRPHY_T::DX8BDLR4: DMRBD Mask */ - -#define DDRPHY_DX8LCDLR0_R0WLD_Pos (0) /*!< DDRPHY_T::DX8LCDLR0: R0WLD Position */ -#define DDRPHY_DX8LCDLR0_R0WLD_Msk (0xfful << DDRPHY_DX8LCDLR0_R0WLD_Pos) /*!< DDRPHY_T::DX8LCDLR0: R0WLD Mask */ - -#define DDRPHY_DX8LCDLR0_R1WLD_Pos (8) /*!< DDRPHY_T::DX8LCDLR0: R1WLD Position */ -#define DDRPHY_DX8LCDLR0_R1WLD_Msk (0xfful << DDRPHY_DX8LCDLR0_R1WLD_Pos) /*!< DDRPHY_T::DX8LCDLR0: R1WLD Mask */ - -#define DDRPHY_DX8LCDLR0_R2WLD_Pos (16) /*!< DDRPHY_T::DX8LCDLR0: R2WLD Position */ -#define DDRPHY_DX8LCDLR0_R2WLD_Msk (0xfful << DDRPHY_DX8LCDLR0_R2WLD_Pos) /*!< DDRPHY_T::DX8LCDLR0: R2WLD Mask */ - -#define DDRPHY_DX8LCDLR0_R3WLD_Pos (24) /*!< DDRPHY_T::DX8LCDLR0: R3WLD Position */ -#define DDRPHY_DX8LCDLR0_R3WLD_Msk (0xfful << DDRPHY_DX8LCDLR0_R3WLD_Pos) /*!< DDRPHY_T::DX8LCDLR0: R3WLD Mask */ - -#define DDRPHY_DX8LCDLR1_WDQD_Pos (0) /*!< DDRPHY_T::DX8LCDLR1: WDQD Position */ -#define DDRPHY_DX8LCDLR1_WDQD_Msk (0xfful << DDRPHY_DX8LCDLR1_WDQD_Pos) /*!< DDRPHY_T::DX8LCDLR1: WDQD Mask */ - -#define DDRPHY_DX8LCDLR1_RDQSD_Pos (8) /*!< DDRPHY_T::DX8LCDLR1: RDQSD Position */ -#define DDRPHY_DX8LCDLR1_RDQSD_Msk (0xfful << DDRPHY_DX8LCDLR1_RDQSD_Pos) /*!< DDRPHY_T::DX8LCDLR1: RDQSD Mask */ - -#define DDRPHY_DX8LCDLR1_RDQSND_Pos (16) /*!< DDRPHY_T::DX8LCDLR1: RDQSND Position */ -#define DDRPHY_DX8LCDLR1_RDQSND_Msk (0xfful << DDRPHY_DX8LCDLR1_RDQSND_Pos) /*!< DDRPHY_T::DX8LCDLR1: RDQSND Mask */ - -#define DDRPHY_DX8LCDLR2_R0DQSGD_Pos (0) /*!< DDRPHY_T::DX8LCDLR2: R0DQSGD Position */ -#define DDRPHY_DX8LCDLR2_R0DQSGD_Msk (0xfful << DDRPHY_DX8LCDLR2_R0DQSGD_Pos) /*!< DDRPHY_T::DX8LCDLR2: R0DQSGD Mask */ - -#define DDRPHY_DX8LCDLR2_R1DQSGD_Pos (8) /*!< DDRPHY_T::DX8LCDLR2: R1DQSGD Position */ -#define DDRPHY_DX8LCDLR2_R1DQSGD_Msk (0xfful << DDRPHY_DX8LCDLR2_R1DQSGD_Pos) /*!< DDRPHY_T::DX8LCDLR2: R1DQSGD Mask */ - -#define DDRPHY_DX8LCDLR2_R2DQSGD_Pos (16) /*!< DDRPHY_T::DX8LCDLR2: R2DQSGD Position */ -#define DDRPHY_DX8LCDLR2_R2DQSGD_Msk (0xfful << DDRPHY_DX8LCDLR2_R2DQSGD_Pos) /*!< DDRPHY_T::DX8LCDLR2: R2DQSGD Mask */ - -#define DDRPHY_DX8LCDLR2_R3DQSGD_Pos (24) /*!< DDRPHY_T::DX8LCDLR2: R3DQSGD Position */ -#define DDRPHY_DX8LCDLR2_R3DQSGD_Msk (0xfful << DDRPHY_DX8LCDLR2_R3DQSGD_Pos) /*!< DDRPHY_T::DX8LCDLR2: R3DQSGD Mask */ - -#define DDRPHY_DX8MDLR_IPRD_Pos (0) /*!< DDRPHY_T::DX8MDLR: IPRD Position */ -#define DDRPHY_DX8MDLR_IPRD_Msk (0xfful << DDRPHY_DX8MDLR_IPRD_Pos) /*!< DDRPHY_T::DX8MDLR: IPRD Mask */ - -#define DDRPHY_DX8MDLR_TPRD_Pos (8) /*!< DDRPHY_T::DX8MDLR: TPRD Position */ -#define DDRPHY_DX8MDLR_TPRD_Msk (0xfful << DDRPHY_DX8MDLR_TPRD_Pos) /*!< DDRPHY_T::DX8MDLR: TPRD Mask */ - -#define DDRPHY_DX8MDLR_MDLD_Pos (16) /*!< DDRPHY_T::DX8MDLR: MDLD Position */ -#define DDRPHY_DX8MDLR_MDLD_Msk (0xfful << DDRPHY_DX8MDLR_MDLD_Pos) /*!< DDRPHY_T::DX8MDLR: MDLD Mask */ - -#define DDRPHY_DX8GTR_R0DGSL_Pos (0) /*!< DDRPHY_T::DX8GTR: R0DGSL Position */ -#define DDRPHY_DX8GTR_R0DGSL_Msk (0x7ul << DDRPHY_DX8GTR_R0DGSL_Pos) /*!< DDRPHY_T::DX8GTR: R0DGSL Mask */ - -#define DDRPHY_DX8GTR_R1DGSL_Pos (3) /*!< DDRPHY_T::DX8GTR: R1DGSL Position */ -#define DDRPHY_DX8GTR_R1DGSL_Msk (0x7ul << DDRPHY_DX8GTR_R1DGSL_Pos) /*!< DDRPHY_T::DX8GTR: R1DGSL Mask */ - -#define DDRPHY_DX8GTR_R2DGSL_Pos (6) /*!< DDRPHY_T::DX8GTR: R2DGSL Position */ -#define DDRPHY_DX8GTR_R2DGSL_Msk (0x7ul << DDRPHY_DX8GTR_R2DGSL_Pos) /*!< DDRPHY_T::DX8GTR: R2DGSL Mask */ - -#define DDRPHY_DX8GTR_R3DGSL_Pos (9) /*!< DDRPHY_T::DX8GTR: R3DGSL Position */ -#define DDRPHY_DX8GTR_R3DGSL_Msk (0x7ul << DDRPHY_DX8GTR_R3DGSL_Pos) /*!< DDRPHY_T::DX8GTR: R3DGSL Mask */ - -#define DDRPHY_DX8GTR_R0WLSL_Pos (12) /*!< DDRPHY_T::DX8GTR: R0WLSL Position */ -#define DDRPHY_DX8GTR_R0WLSL_Msk (0x3ul << DDRPHY_DX8GTR_R0WLSL_Pos) /*!< DDRPHY_T::DX8GTR: R0WLSL Mask */ - -#define DDRPHY_DX8GTR_R1WLSL_Pos (14) /*!< DDRPHY_T::DX8GTR: R1WLSL Position */ -#define DDRPHY_DX8GTR_R1WLSL_Msk (0x3ul << DDRPHY_DX8GTR_R1WLSL_Pos) /*!< DDRPHY_T::DX8GTR: R1WLSL Mask */ - -#define DDRPHY_DX8GTR_R2WLSL_Pos (16) /*!< DDRPHY_T::DX8GTR: R2WLSL Position */ -#define DDRPHY_DX8GTR_R2WLSL_Msk (0x3ul << DDRPHY_DX8GTR_R2WLSL_Pos) /*!< DDRPHY_T::DX8GTR: R2WLSL Mask */ - -#define DDRPHY_DX8GTR_R3WLSL_Pos (18) /*!< DDRPHY_T::DX8GTR: R3WLSL Position */ -#define DDRPHY_DX8GTR_R3WLSL_Msk (0x3ul << DDRPHY_DX8GTR_R3WLSL_Pos) /*!< DDRPHY_T::DX8GTR: R3WLSL Mask */ - -#define DDRPHY_DX8GSR2_RDERR_Pos (0) /*!< DDRPHY_T::DX8GSR2: RDERR Position */ -#define DDRPHY_DX8GSR2_RDERR_Msk (0x1ul << DDRPHY_DX8GSR2_RDERR_Pos) /*!< DDRPHY_T::DX8GSR2: RDERR Mask */ - -#define DDRPHY_DX8GSR2_RDWN_Pos (1) /*!< DDRPHY_T::DX8GSR2: RDWN Position */ -#define DDRPHY_DX8GSR2_RDWN_Msk (0x1ul << DDRPHY_DX8GSR2_RDWN_Pos) /*!< DDRPHY_T::DX8GSR2: RDWN Mask */ - -#define DDRPHY_DX8GSR2_WDERR_Pos (2) /*!< DDRPHY_T::DX8GSR2: WDERR Position */ -#define DDRPHY_DX8GSR2_WDERR_Msk (0x1ul << DDRPHY_DX8GSR2_WDERR_Pos) /*!< DDRPHY_T::DX8GSR2: WDERR Mask */ - -#define DDRPHY_DX8GSR2_WDWN_Pos (3) /*!< DDRPHY_T::DX8GSR2: WDWN Position */ -#define DDRPHY_DX8GSR2_WDWN_Msk (0x1ul << DDRPHY_DX8GSR2_WDWN_Pos) /*!< DDRPHY_T::DX8GSR2: WDWN Mask */ - -#define DDRPHY_DX8GSR2_REERR_Pos (4) /*!< DDRPHY_T::DX8GSR2: REERR Position */ -#define DDRPHY_DX8GSR2_REERR_Msk (0x1ul << DDRPHY_DX8GSR2_REERR_Pos) /*!< DDRPHY_T::DX8GSR2: REERR Mask */ - -#define DDRPHY_DX8GSR2_REWN_Pos (5) /*!< DDRPHY_T::DX8GSR2: REWN Position */ -#define DDRPHY_DX8GSR2_REWN_Msk (0x1ul << DDRPHY_DX8GSR2_REWN_Pos) /*!< DDRPHY_T::DX8GSR2: REWN Mask */ - -#define DDRPHY_DX8GSR2_WEERR_Pos (6) /*!< DDRPHY_T::DX8GSR2: WEERR Position */ -#define DDRPHY_DX8GSR2_WEERR_Msk (0x1ul << DDRPHY_DX8GSR2_WEERR_Pos) /*!< DDRPHY_T::DX8GSR2: WEERR Mask */ - -#define DDRPHY_DX8GSR2_WEWN_Pos (7) /*!< DDRPHY_T::DX8GSR2: WEWN Position */ -#define DDRPHY_DX8GSR2_WEWN_Msk (0x1ul << DDRPHY_DX8GSR2_WEWN_Pos) /*!< DDRPHY_T::DX8GSR2: WEWN Mask */ - -#define DDRPHY_DX8GSR2_ESTAT_Pos (8) /*!< DDRPHY_T::DX8GSR2: ESTAT Position */ -#define DDRPHY_DX8GSR2_ESTAT_Msk (0xful << DDRPHY_DX8GSR2_ESTAT_Pos) /*!< DDRPHY_T::DX8GSR2: ESTAT Mask */ - -/**@}*/ /* DDRPHY_CONST */ -/**@}*/ /* end of DDRPHY register group */ - - -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __DDR32PHY_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/disp_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/disp_reg.h deleted file mode 100644 index ece14b52497..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/disp_reg.h +++ /dev/null @@ -1,1432 +0,0 @@ -/**************************************************************************//** -* @file disp_reg.h -* @brief LCD Display Controller driver header file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __DISP_REG_H__ -#define __DISP_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup DISP LCD Display Controller(DISP) - Memory Mapped Structure for DISP Controller -@{ */ - -typedef struct -{ - /** - * @var DISP_T::AQHiClockControl - * Offset: 0x00 Clock Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |CLKDC_DIS |Disable DC clock. - * |[8:2] |FSCALE_VAL|Core clock frequency scale value. - * |[9] |FSCALE_CMD_LOAD|Core clock frequency scale value enable When writing a 1 to this bit, it updates the frequency scale factor with the value FSCALE_VAL[6:0] The bit must be set back to 0 after that If this bit is set and FSCALE_VAL=0 (an invalid combination), the HREADYOUT output signal will get stuck to 0. - * |[10] |DISABLE_RAM_CLOCK_GATING|Disables clock gating for rams. - * |[11] |DISABLE_DEBUG_REGISTERS|Disable debug registers If this bit is 1, debug registers are clock gated(reset=1). - * |[12] |SOFT_RESET|Soft resets the IP. - * |[13] |DISABLE_RAM_POWER_OPTIMIZATION|Disables ram power optimization. - * @var DISP_T::FrameBufferAddress0 - * Offset: 0x1400 Framebuffer Start Address Register. Starting address of the framebuffer. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |ADDRESS |Framebuffer Start Address - * |[31] |TYPE |0 => SYSTEM 1 => VIRTUAL_SYSTEM - * @var DISP_T::FrameBufferStride0 - * Offset: 0x1408 Framebuffer Stride Register. Stride of the framebuffer in bytes. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16:0] |STRIDE |Number of bytes from start of one line to next line. - * @var DISP_T::DisplayDitherConfig0 - * Offset: 0x1410 Display Dither Configuration Register. Configuration register for dithering. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31] |ENABLE |Enabling dithering allows R8G8B8 modes to show better on panels with less bits- per-pixel Note: This field is double buffered. - * @var DISP_T::PanelConfig0 - * Offset: 0x1418 Panel Configuration Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DE |Data Enable enabled/disabled 0 => DISABLED 1 => ENABLED - * |[1] |DE_POLARITY|Data Enable polarity 0 => POSITIVE 1 => NEGATIVE - * |[4] |DATA_ENABLE|Data enabled/disabled 0 => DISABLED 1 => ENABLED - * |[5] |DATA_POLARITY|Data polarity 0 => POSITIVE 1 => NEGATIVE - * |[8] |CLOCK |Clock enabled/disabled 0 => DISABLED 1 => ENABLED - * |[9] |CLOCK_POLARITY|Clock polarity 0 => POSITIVE 1 => NEGATIVE - * @var DISP_T::DisplayDitherTableLow0 - * Offset: 0x1420 Display Dither Table Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |Y0_X0 |Dither threshold value for x,y=0,0. - * |[7:4] |Y0_X1 |Dither threshold value for x,y=1,0. - * |[11:8] |Y0_X2 |Dither threshold value for x,y=2,0. - * |[15:12] |Y0_X3 |Dither threshold value for x,y=3,0. - * |[19:16] |Y1_X0 |Dither threshold value for x,y=0,1. - * |[23:20] |Y1_X1 |Dither threshold value for x,y=1,1. - * |[27:24] |Y1_X2 |Dither threshold value for x,y=2,1. - * |[31:28] |Y1_X3 |Dither threshold value for x,y=3,1. - * @var DISP_T::DisplayDitherTableHigh0 - * Offset: 0x1428 Display Dither Table Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |Y2_X0 |Dither threshold value for x,y=0,2. - * |[7:4] |Y2_X1 |Dither threshold value for x,y=1,2. - * |[11:8] |Y2_X2 |Dither threshold value for x,y=2,2. - * |[15:12] |Y2_X3 |Dither threshold value for x,y=3,2. - * |[19:16] |Y3_X0 |Dither threshold value for x,y=0,3. - * |[23:20] |Y3_X1 |Dither threshold value for x,y=1,3. - * |[27:24] |Y3_X2 |Dither threshold value for x,y=2,3. - * |[31:28] |Y3_X3 |Dither threshold value for x,y=3,3. - * @var DISP_T::HDisplay0 - * Offset: 0x1430 Horizontal Total and Display End Counter Register. Note: This register is double buffered - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |DISPLAY_END|Visible number of horizontal pixels. - * |[30:16] |TOTAL |Total number of horizontal pixels. - * @var DISP_T::HSync0 - * Offset: 0x1438 Horizontal Sync Counter Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |START |Start of horizontal sync pulse. - * |[29:15] |END |End of horizontal sync pulse. - * |[30] |PULSE |Horizontal sync pulse control 0 => DISABLED 1 => ENABLED - * |[31] |POLARITY |Polarity of the horizontal sync pulse 0 => POSITIVE 1 => NEGATIVE - * @var DISP_T::VDisplay0 - * Offset: 0x1440 Vertical Total and Display End Counter Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |DISPLAY_END|Visible number of vertical lines - * |[30:16] |TOTAL |Total number of vertical lines. - * @var DISP_T::VSync0 - * Offset: 0x1448 Vertical Sync Counter Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |START |Start of the vertical sync pulse - * |[29:15] |END |End of the vertical sync pulse. - * |[30] |PULSE |Vertical sync pulse control 0 => DISABLED 1 => ENABLED - * |[31] |POLARITY |Polarity of the vertical sync pulse 0 => POSITIVE 1 => NEGATIVE - * @var DISP_T::DisplayCurrentLocation0 - * Offset: 0x1450 Display Current Location Register. Current x,y location of display controller. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |X |Current X location. - * |[31:16] |Y |Current Y location. - * @var DISP_T::GammaIndex0 - * Offset: 0x1458 Gamma Table Index Register. Index into gamma table. See GammaData for more information. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |INDEX |Index into gamma table. - * @var DISP_T::GammaData0 - * Offset: 0x1460 Gamma Data Translation Register. Translation values for the gamma table. When this register gets written, the data gets stored in the gamma table at the index specified by the GammaIndex register. After the register is written, the index gets incremented. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |BLUE |Blue translation value. - * |[19:10] |GREEN |Green translation value. - * |[29:20] |READ |Red translation value. - * @var DISP_T::CursorConfig - * Offset: 0x1468 Cursor Configuration Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |FORMAT |Format of the cursor Note: This field is double buffered. - * |[4] |DISPLAY |Display Controller owning the cursor. - * |[12:8] |HOT_SPOT_Y|Vertical offset to cursor hotspot Note: This field is double buffered. - * |[20:16] |HOT_SPOT_X|Horizontal offset to cursor hotspot Note: This field is double buffered. - * @var DISP_T::CursorAddress - * Offset: 0x146C Cursor Address Register. Address of the cursor shape. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |ADDRESS |Cursor Address - * |[31] |TYPE |0 => SYSTEM 1 => VIRTUAL_SYSTEM - * @var DISP_T::CursorLocation - * Offset: 0x1470 Cursor Location Register. Location of the cursor on the owning display. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |X |X location of cursor's hotspot. - * |[30:16] |Y |Y location of cursor's hotspot. - * @var DISP_T::CursorBackground - * Offset: 0x1474 Masked Cursor Background Color Register. The background color for Masked cursors. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |Blue value. - * |[15:8] |GREEN |Green value. - * |[23:16] |RED |Red value. - * @var DISP_T::CursorForeground - * Offset: 0x1478 Masked Cursor Foreground Color Register. The foreground color for Masked cursors. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |Blue value. - * |[15:8] |GREEN |Green value. - * |[23:16] |RED |Red value. - * @var DISP_T::DisplayIntr - * Offset: 0x147C Display Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DISP0 |Display0 interrupt(read only) - * @var DISP_T::DisplayIntrEnable - * Offset: 0x1480 Display Interrupt Enable Register. The interrupt enable register for display_0. Note: Interrupt enable for register DisplayIntr. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DISP0 |Display0 interrupt enable (read only) - * @var DISP_T::CursorModuleClockGatingControl - * Offset: 0x1484 Clock Gating Control for Cursor Register. Module level clock gating control for cursor. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DISABLE_MODULE_CLOCK_GATING_CURSOR|Disable module clock gating cursor 0 => ENABLED 1 => DISABLED - * @var DISP_T::GeneralConfig0 - * Offset: 0x14B0 General Miscellaneous Configuration Register. Misc option configuration. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ENDIAN_CONTROL|Control endian swapping 0 => NO_SWAP 1 => SWAP_WORD 2 => SWAP_DWORD 3 => SWAP_DDWORD - * |[2] |STALL_OUTPUT_WHEN_UNDERFLOW|If enabled, when FIFO underflow happens, output is stalled 0 => DISABLED 1 => ENABLED - * |[3] |DISABLE_IDLE|Disable idle signal 0 => DISABLED 1 => ENABLED - * @var DISP_T::DpiConfig0 - * Offset: 0x14B8 DPI Configuration Register. The configuration register for DPI output. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |DPI_DATA_FORMAT|DPI interface data format Refer to DPI spec 'Interface color coding' for details 0 => D16CFG1 1 => D16CFG2 2 => D16CFG3 3 => D18CFG1 4 => D18CFG2 5 => D24 - * @var DISP_T::DebugCounterSelect0 - * Offset: 0x14D0 Debug Counter Selection Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SELECT |Write a value to this field to pick up from 0~255 counters Then the counter will be on DebugCounterValue 00 => TOTAL_AXI_VIDEO_RD_REQ_CNT * video read request number * 01 => TOTAL_AXI_VIDEO_RD_LAST_CNT * video read return data last number * 02 => TOTAL_AXI_VIDEO_REQ_BURST_CNT * video number of 16 byte burst requests bytes * 03 => TOTAL_AXI_VIDEO_RD_BURST_CUNT * video number of 16 byte burst read return data * 04 => TOTAL_PIXEL_CNT * total pixels sent * 05 => TOTAL_FRAME_CNT * total frames sent * 06 => TOTAL_INPUT_DBI_CMD_CNT * total DBI input command * 07 => TOTAL_OUTPUT_DBI_CMD_CNT * total DBI output command * 08 => DEBUG_SIGNALS0 * debug signals * 09 => TOTAL_AXI_OVERLAY0_RD_REQ_CNT * overlay read request number * 0A => TOTAL_AXI_OVERLAY0_RD_LAST_CNT * overlay read return data last number * 0B => TOTAL_AXI_OVERLAY0_REQ_BURST_CNT * overlay number of 16 byte bursts of request bytes * 0C => TOTAL_AXI_OVERLAY0_RD_BURST_CUNT * overlay number of 16 bytes bursts of read return data * 0D => DEBUG_SIGNALS_FREE_POOL 0E => DEBUG_SIGNALS_INFOBUF_RD 0F => DEBUG_SIGNALS_INFOBUF_WR0 10 => DEBUG_SIGNALS_INFOBUF_WR1 11 => DEBUG_SIGNALS_INFOBUF_WR2 12 => DEBUG_SIGNALS_INFOBUF_WR3 13 => DEBUG_SIGNALS_OVERLAY0_FREE_POOL 14 => DEBUG_SIGNALS_OVERLAY0_INFOBUF_RD 15 => DEBUG_SIGNALS_OVERLAY0_INFOBUF_WR0 16 => DEBUG_SIGNALS_OVERLAY0_INFOBUF_WR1 17 => DEBUG_SIGNALS_OVERLAY0_INFOBUF_WR2 18 => DEBUG_SIGNALS_OVERLAY0_INFOBUF_WR3 19 => OVERLAY_BLEND_DEBUGSIGNALS 1A => CURSOR_BLEND_DEBUGSIGNALS 1C => VIDEO_WALKER_DEBUGSIGNALS_1 1D => VIDEO_WALKER_DEBUGSIGNALS_2 1E => VIDEO_WALKER_DEBUGSIGNALS_3 1F => OVERLAY_WALKER_DEBUGSIGNALS_1 20 => OVERLAY_WALKER_DEBUGSIGNALS_2 21 => OVERLAY_WALKER_DEBUGSIGNALS_3 FF => RESET_ALL_DEBUG_COUNTERS * Reset all debug counters *. - * @var DISP_T::DebugCounterValue0 - * Offset: 0x14D8 Debug Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VALUE |Selected debug counter value - * @var DISP_T::FrameBufferColorKey0 - * Offset: 0x1508 Framebuffer Color Key Start Address Register. Start of color key range of framebuffer. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::FrameBufferColorKeyHigh0 - * Offset: 0x1510 Framebuffer Color Key End Address Register. End of color key range of framebuffer. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::FrameBufferConfig0 - * Offset: 0x1518 Framebuffer Configuration Register. Framebuffer attribute configuration. Note: This register is double buffered. Some fields are double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |OUTPUT |When Output is enabled, pixels will be displayed When Output is disabled, all pixels will be black This allows a panel to have the correct timing but without any pixels Note: This field is double buffered 0 => DISABLED 1 => ENABLED. - * |[2] |GAMMA |When Gamma is enabled, the R, G, and B channels will be routed through the Gamma LUT to perform gamma correction Note: This field is double buffered 0 => DISABLED 1 => ENABLED. - * |[3] |VALID |The valid field defines whether we can copy a new set of registers at the next VBLANK or not This ensures a frame will always start with a valid working set if this register is programmed last, which reduces the need for SW to wait for the start of a VBLANK signal in order to ensure all states are loaded before the next VBLANK 0 => WORKING 1 => PENDING. - * |[4] |RESET |Enable reset for the display controller - * | | |0: See below for DPI - * | | |For DBI,this field should be 0 - * | | |1: RESET - * | | |Enable DPI timing, start a DPI transfer - * | | |Write 0 to this bit to reset the display controller, then configure the other registers and lastly write a 1 to this bit to let the display controller start - * | | |When the display controller starts, it begins at VBLANK_START, and all registers get flopped to the working set at VSYNC_END - * | | |Counters will be reset to the end of HSYNC and VSYNC - * | | |(Refer the Timing Diagram provided in the Hardware Feature document) - * | | |For DBI, do not write 1 to this field - * | | |Use DbiReset DBI_IF_LEVEL_RESET instead - * | | |This bit is WRITE ONLY. - * | | |1 => RESET. - * |[5] |UNDERFLOW |0: NO 1: YES When the display FIFO underflows, this bit gets set to one Reading this register will reset it back to zero This field is READ ONLY 0 => NO 1 => YES. - * |[6] |FLIP_IN_PROGRESS|0: NO 1: YES When the framebuffer address gets written to, this bit gets set to one It will be reset to zero at the start of the next VBLANK when the registers gets copied into the working set This field is (READ ONLY) 0 => NO 1 => YES. - * |[8] |CLEAR |When enabled, the pixel value of the framebuffer comes from FrameBufferClearValue; otherwise, the pixel value comes from memory 0 => DISABLED 1 => ENABLED - * |[10:9] |TRANSPARENCY|Transparency of framebuffer 0 => OPAQUE 1 => MASK 2 => KEY - * |[16:14] |YUV |YUV standard 1 => SELECT_709 * BT709 * 3 => SELECT_2020 * BT2020 * - * |[24:23] |SWIZZLE |0 => ARGB 1 => RGBA 2 => ABGR 3 => BGRA - * |[25] |UV_SWIZZLE|UV swizzle type - * |[31:26] |FORMAT |The format of the framebuffer 00 => X4R4G4B4 01 => A4R4G4B4 02 => X1R5G5B5 03 => A1R5G5B5 04 => R5G6B5 05 => X8R8G8B8 06 => A8R8G8B8 07 => YUY2 08 => UYVY 09 => INDEX8 0A => MONOCHROME 0F => YV12 10 => A8 11 => NV12 12 => NV16 13 => RG16 14 => R8 15 => NV12_10BIT 16 => A2R10G10B10 17 => NV16_10BIT 18 => INDEX1 19 => INDEX2 1A => INDEX4 1B => P010 1C => NV12_10BIT_L1 1D => NV16_10BIT_L1 - * @var DISP_T::FrameBufferBGColor0 - * Offset: 0x1528 Framebuffer Background Color Register. Background color used when a pixel from the framebuffer falls outside of the range of color key. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::FrameBufferUPlanarAddress0 - * Offset: 0x1530 Framebuffer Second Plane U Start Address Register. Starting address of the second planar (often the U plane) of the framebuffer if one exists. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |ADDRESS |Framebuffer Second Plane U Start Address - * |[31] |TYPE |0 => SYSTEM 1 => VIRTUAL_SYSTEM - * @var DISP_T::FrameBufferVPlanarAddress0 - * Offset: 0x1538 Framebuffer Third Plane V Start Address Register. Starting address of the third planar (often the V plane) of the framebuffer if one exists. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |ADDRESS |Framebuffer Third Plane V Start Address - * |[31] |TYPE |0 => SYSTEM 1 => VIRTUAL_SYSTEM - * @var DISP_T::OverlayConfig0 - * Offset: 0x1540 Overlay Configuration Register. Overlay attributes control. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TRANSPARENCY|Transparency of the overlay 0 => OPAQUE 1 => MASK 2 => KEY - * |[7:5] |YUV |YUV standard - * | | |1 => SELECT_709 * BT709 * 3 => SELECT_2020 * BT2020 *. - * |[14:13] |SWIZZLE |0 => ARGB 1 => RGBA 2 => ABGR 3 => BGRA - * |[15] |UV_SWIZZLE|UV swizzle type. - * |[21:16] |FORMAT |The format of the overlay - * | | |00 => X4R4G4B4 01 => A4R4G4B4 02 => X1R5G5B5 03 => A1R5G5B5 04 => R5G6B5 05 => X8R8G8B8 06 => A8R8G8B8 07 => YUY2 08 => UYVY 09 => INDEX8 0A => MONOCHROME 0F => YV12 10 => A8 11 => NV12 12 => NV16 13 => RG16 14 => R8 15 => NV12_10BIT 16 => A2R10G10B10 17 => NV16_10BIT 18 => INDEX1 19 => INDEX2 1A => INDEX4 1B => P010 1C => NV12_10BIT_L1 1D => NV16_10BIT_L1. - * |[23] |UNDERFLOW |When the overlay FIFO underflows, this bit gets set to one Reading this register will reset it back to zero 0 => NO 1 => YES. - * |[24] |ENABLE |Enable this overlay layer 0 => DISABLE 1 => ENABLE - * |[25] |CLEAR |When enabled, the pixel value of the overlay comes from OverlayClearValue; otherwise the pixel value comes from memory 0 => DISABLED 1 => ENABLED - * @var DISP_T::OverlayAlphaBlendConfig0 - * Offset: 0x1580 Overlay Alpha Blending Configuration Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SRC_ALPHA_MODE|0 => NORMAL 1 => INVERSED - * |[1] |DISABLE_ALPHA_BLEND|0 => DISABLED 1 => ENABLED - * |[4:3] |SRC_GLOBAL_ALPHA_MODE|0 => NORMAL 1 => GLOBAL 2 => SCALED - * |[7:5] |SRC_BLENDING_MODE|0 => ZERO 1 => ONE 2 => NORMAL 3 => INVERSED 4 => COLOR 5 => COLOR_INVERSED 6 => SATURATED_ALPHA 7 => SATURATED_DEST_ALPHA - * |[8] |SRC_ALPHA_FACTOR|Src Blending factor is calculated from Src alpha 0 => DISABLED 1 => ENABLED - * |[9] |DST_ALPHA_MODE|0 => NORMAL 1 => INVERSED - * |[11:10] |DST_GLOBAL_ALPHA_MODE|0 => NORMAL 1 => GLOBAL 2 => SCALED - * |[14:12] |DST_BLENDING_MODE|0 => ZERO 1 => ONE 2 => NORMAL 3 => INVERSED 4 => COLOR 5 => COLOR_INVERSED 6 => SATURATED_ALPHA 7 => SATURATED_DEST_ALPHA - * |[15] |DST_ALPHA_FACTOR|Dst Blending factor is calculated from Dst alpha 0 => DISABLED 1 => ENABLED - * @var DISP_T::OverlayAddress0 - * Offset: 0x15C0 Overlay Start Address Register. Starting address of the overlay. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |ADDRESS |Overlay Start Address - * |[31] |TYPE |0 => SYSTEM 1 => VIRTUAL_SYSTEM - * @var DISP_T::OverlayStride0 - * Offset: 0x1600 Overlay Stride Register. Stride of the overlay in bytes. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16:0] |STRIDE |Number of bytes from the start of one line to next line. - * @var DISP_T::OverlayTL0 - * Offset: 0x1640 Overlay Origin Register. Top left coordinate of the panel pixel where the overlay should start. Be aware there is no panning inside the overlay. Note: This register is double buffered - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |X |Left boundary of overlay window. - * |[29:15] |Y |Top boundary of overlay window. - * @var DISP_T::OverlayBR0 - * Offset: 0x1680 Overlay End Register. Bottom right coordinate of the panel pixel where the overlay should end. The border is inclusive. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |X |Right boundary of overlay. - * |[29:15] |Y |Bottom boundary of overlay. - * @var DISP_T::OverlaySrcGlobalColor0 - * Offset: 0x16C0 Overlay Source Global Color Register. Color value used when alpha blending process is configured to use global color for source. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::OverlayDstGlobalColor0 - * Offset: 0x1700 Overlay Destination Global Color Register. Color value used when alpha blending process is configured to use global color for destination. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::OverlayColorKey0 - * Offset: 0x1740 Overlay Color Key Start Address Register. Start of color key range for overlay. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::OverlayColorKeyHigh0 - * Offset: 0x1780 Overlay Color Key End Address Register. End of color key range for overlay. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::OverlaySize0 - * Offset: 0x17C0 Overlay Window Size Register. Window size of the overlay buffer in memory - in pixels. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |WIDTH |Overlay width - * |[29:15] |HEIGHT |Overlay height - * @var DISP_T::FrameBufferUStride0 - * Offset: 0x1800 Framebuffer Second Plane U Stride Register. Stride of the second planar (often the U plane) of the framebuffer if one exists. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16:0] |STRIDE |Number of bytes from the start of one line to next line. - * @var DISP_T::FrameBufferVStride0 - * Offset: 0x1808 Framebuffer Third Plane V Stride Register. Stride of the third planar (often the V plane) of the framebuffer if one exists. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16:0] |STRIDE |Number of bytes from the start of one line to next line. - * @var DISP_T::FrameBufferSize0 - * Offset: 0x1810 Framebuffer Size Register. Window size of the framebuffer in memory - in pixels. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[14:0] |WIDTH |Frame width - * |[29:15] |HEIGHT |Frame height - * @var DISP_T::IndexColorTableIndex0 - * Offset: 0x1818 Index Color Table Index Register. Index into index color table. See IndexColorTableData for more information. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |INDEX |index into index color table. - * @var DISP_T::IndexColorTableData0 - * Offset: 0x1820 Index Color Table Data Translation Register. Translation values for the index color table. When this register gets written, the data gets stored in the index color table at the index specified by the IndexColorTableIndex register. After the register is written, the index gets incremented. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::OverlayUPlanarAddress0 - * Offset: 0x1840 Overlay Second Plane U Start Address Register. Address of the second planar (often U plane) of the overlay if one exists. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |ADDRESS |Overlay Third Plane V Start Address - * |[31] |TYPE |0 => SYSTEM 1 => VIRTUAL_SYSTEM - * @var DISP_T::OverlayVPlanarAddress0 - * Offset: 0x1880 Overlay Third Plane V Start Address Register. Address of the third planar (often V plane) of the overlay if one exists. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |ADDRESS |Overlay Second Plane U Stride - * |[31] |TYPE |0 => SYSTEM 1 => VIRTUAL_SYSTEM - * @var DISP_T::OverlayUStride0 - * Offset: 0x18C0 Overlay Second Plane U Stride Register. Stride of the second planar of the overlay if one exists. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16:0] |STRIDE |Number of bytes from the start of one line to next line. - * @var DISP_T::OverlayVStride0 - * Offset: 0x1900 Overlay Third Plane V Stride Register. Stride of the third planar of the overlay if one exists. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[16:0] |STRIDE |Number of bytes from start of one line to next line. - * @var DISP_T::OverlayClearValue0 - * Offset: 0x1940 Overlay Clear Value Register. Clear value used when OverlayConfig.Clear is enabled. Format is A8R8G8B8. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::OverlayIndexColorTableIndex0 - * Offset: 0x1980 Overlay Index Color Table Index Register. Index into overlay index color table. See OverlayIndexColorTableData for more information. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |INDEX |Index into index color table. - * @var DISP_T::OverlayIndexColorTableData0 - * Offset: 0x19C0 Index Color Table Data Translation Register. Translation values for the index color table of the overlay. When this register gets written, the data gets stored in the index color table at the index specified by the OverlayIndexColorTableIndex register. After the register is written, the index gets incremented. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::FrameBufferClearValue0 - * Offset: 0x1A18 Framebuffer Clear Value Register. Clear value used when FrameBufferConfig. Clear is enabled, format is A8R8G8B8. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |BLUE |BLUE value - * |[15:8] |GREEN |GREEN value - * |[23:16] |RED |RED value - * |[31:24] |ALPHA |ALPHA value - * @var DISP_T::ModuleClockGatingControl0 - * Offset: 0x1A28 Clock Gating Module Control Register. Module level clock gating control for video and overlay. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DISABLE_MODULE_CLOCK_GATING_VIDEO|Disable module clock gating video 0 => ENABLE 1 => DISABLE. - * |[1] |DISABLE_MODULE_CLOCK_GATING_OVERLAY0|Disable module clock gating overlay0 0 => ENABLE 1 => DISABLE. - * |[9] |DISABLE_MODULE_CLOCK_GATING_WB_FIFO|Disable module clock gating WBFifo 0 => ENABLE 1 => DISABLE. - * @var DISP_T::LatencyCounter0 - * Offset: 0x1A30 Latency Counter Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |COUNTER |Latency counter value which is used to judge whether latency is low or high. - * @var DISP_T::Qos0 - * Offset: 0x1A38 Quality of Service Latency Value Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |LOW |If latency low, will send low value. - * |[7:4] |HIGH |If latency high, will send high value. - * @var DISP_T::MpuIntfCmd0 - * Offset: 0x1C40 MPU Command Configuration Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |REG_DATA |Register address or register configured parameter. - * |[26:24] |READ_COUNT|0 is invalid value, one read operation returns 1 data at least, Max value is 5 It is designed to prepare 5 registers to save returned data. - * |[29] |START |HW generates a pulse while writing 1 to this field, then HW starts to send display data to the LCD. - * |[31:30] |CMD |0: Not a valid command, HW ignores the CMD/REGDATA/READCOUNT field Usage: only want to trigger HW, don't configure other fields 1: Write register by MPU interface 2: Write register parameter by MPU interface 3: Read register by MPU interface. - * @var DISP_T::MpuIntfReadPara00 - * Offset: 0x1C48 MPU Read Parameter0 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |DATA |Read register returned parameter0. - * @var DISP_T::MpuIntfReadPara10 - * Offset: 0x1C50 MPU Read Parameter1 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |DATA |Read register returned parameter1. - * @var DISP_T::MpuIntfReadPara20 - * Offset: 0x1C58 MPU Read Parameter2 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |DATA |Read register returned parameter2. - * @var DISP_T::MpuIntfReadPara30 - * Offset: 0x1C60 MPU Read Parameter3 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |DATA |Read register returned parameter3. - * @var DISP_T::MpuIntfReadPara40 - * Offset: 0x1C68 MPU Read Parameter4 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |DATA |Read register returned parameter4. - * @var DISP_T::MpuIntfReadStatus0 - * Offset: 0x1C70 MPU Read Parameter Status Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DATA |Returned parameter readiness - * | | |0 = UNREADY - * | | |The returned parameters of all read registers are not ready - * | | |1 = READY - * | | |The returned parameters of all read registers are ready. - * @var DISP_T::MpuIntfConfig0 - * Offset: 0x1C78 MPU Interface Configuration Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGISTER_MODE|0: 8 bit register mode, only MpuIntfCmd[7:0] are valid Only send 8 bits valid data each time to LCD by MPU Interface 1: 16 bit register mode, only MpuIntfCmd[15:0] are valid, Only send 16 bits valid data each time to the LCD by MPU Interface 0 = MODE_8_BIT 1 = MODE_16_BIT - * |[2:1] |DATA_BUS_WIDTH|MPU interface bus width 0 = WIDTH_8_BIT 1 = WIDTH_9_BIT 2 = WIDTH_16_BIT 3 = WIDTH_18_BIT - * |[3] |DATA_BUS_MODE|0 = MODE0. Mode0: 8-bit:DB[7:0]; 9-bit:DB[8:0]; 16-bit:DB[15:0]; 18-bit:DB[17:0], 1 = MODE1. Mode1: 8-bit:DB[17:10]; 9-bit:DB[17:9]; 16-bit:{DB[17:10],DB[8:1]}; 18-bit:DB[17:0]. - * |[4] |INTERFACE_MODE|System Interface. - * |[5] |ENABLE_VSYNC|0: Disable; 1: Enable VSYNC interface 0 = DISABLE 1 = ENABLE - * |[6] |VSYNC_POLARITY|VSYNC signal is negative or positive value 0 = NEGATIVE 1 = POSITIVE - * |[7] |ENABLE_TE |0: Disable; 1: Enable TE interface 0 = DISABLE 1 = ENABLE - * |[8] |TE_POLARITY|TE signal is positive or negative value 0 = POSITIVE 1 = NEGATIVE - * |[9] |DCX_POLARITY|DCX polarity for command and data 0 = MODE0. 0-command, 1-data 1 = MODE1. 1-command, 0-data. - * |[10] |DATA_MODE24_BIT|16 bit data bus, 24 bit data output 0 = MODE0. 0: 2 pixels per 3 transfers 1 = MODE1. 1: 1 pixel per 2 transfers. - * |[11] |INTERFACE_RESET|Write 1 to this field, HW will reset the MPU interface. - * |[12] |ENABLE_MPU_INTF|O:Disable; 1: Enable MPU interface 0 = DISABLE 1 = ENABLE - * @var DISP_T::MpuIntfFrame0 - * Offset: 0x1C80 MPU Frame Configuration Register. Note: This register is double buffered. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FRAME_UPDATE|0: When using VSync interface/TE mode, if this bit is 0, this frame data won't be updated 1: When using VSync interface/TE mode, if this bit is 1, this frame data will be updated 0 => NO 1 => YES. - * |[2:1] |DATA_FORMAT|0: 16 bit format R5G6B5 1: 18 bit format R6G6B6 2: 24 bit format R8G8B8. 3: Reserved 0 => R5G6B5 1 => R6G6B6 2 => R8G8B8 - * |[3] |MPU_WRITE_BACK|0: Disable MPU data write back 1: Enable MPU interface data write back 0 => DISABLE 1 => ENABLE. - * @var DISP_T::MpuIntfACWrI800 - * Offset: 0x1C88 MPU Write AC Characteristics I80 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |WR_PERIOD_I80|I80 system write period cycle number Minimum number is 3 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[19:10] |WRX_ASSERT|I80 system WRX assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[29:20] |WRX_DE_ASSERT|I80 system WRX de-assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock - * @var DISP_T::MpuIntfACRdI800 - * Offset: 0x1C90 MPU Read AC Characteristics I80 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |RD_PERIOD_I80|I80 system read period cycle number Minimum number is 3 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[19:10] |RDX_ASSERT|I80 system RDX assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[29:20] |RDX_DE_ASSERT|I80 system RDX de-assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * @var DISP_T::MpuIntfACWrM680 - * Offset: 0x1C98 MPU Write AC Characteristics M68 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |WR_PERIOD_M68|M68 system write period cycle number Minimum number is 3 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[19:10] |WR_EASSERT|M68 system write E assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[29:20] |WR_EDE_ASSERT|M68 system write E de-assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * @var DISP_T::MpuIntfACRdM680 - * Offset: 0x1CA0 MPU Read AC Characteristics M68 Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |RD_PERIOD_I80|M68 system read period cycle number Minimum number is 3 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[19:10] |RDX_ASSERT|M68 system RDX assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * |[29:20] |RDX_DE_ASSERT|M68 system RDX de-assert cycle number Minimum number is 1 Default number is 0, 0 means 1024 cycle number Cycle unit is pixel clock. - * @var DISP_T::MpuIntfACVsyncCSX0 - * Offset: 0x1CA8 MPU CSX Assert Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |CSX_ASSERT|Add delay between VSYNC-high and CSX- low This field specifies how many transfer-one-pixel period. - */ - __IO uint32_t AQHiClockControl; /*!< [0x0000] Clock Control Register */ - __I uint32_t RESERVE0[1279]; - __IO uint32_t FrameBufferAddress0; /*!< [0x1400] Framebuffer Start Address Register. Starting address of the framebuffer. Note: This register is double buffered. */ - __I uint32_t RESERVE1[1]; - __IO uint32_t FrameBufferStride0; /*!< [0x1408] Framebuffer Stride Register. Stride of the framebuffer in bytes. Note: This register is double buffered. */ - __I uint32_t RESERVE2[1]; - __IO uint32_t DisplayDitherConfig0; /*!< [0x1410] Display Dither Configuration Register. Configuration register for dithering. Note: This register is double buffered. */ - __I uint32_t RESERVE3[1]; - __IO uint32_t PanelConfig0; /*!< [0x1418] Panel Configuration Register. Note: This register is double buffered. */ - __I uint32_t RESERVE4[1]; - __IO uint32_t DisplayDitherTableLow0; /*!< [0x1420] Display Dither Table Register. Note: This register is double buffered. */ - __I uint32_t RESERVE5[1]; - __IO uint32_t DisplayDitherTableHigh0; /*!< [0x1428] Display Dither Table Register. Note: This register is double buffered. */ - __I uint32_t RESERVE6[1]; - __IO uint32_t HDisplay0; /*!< [0x1430] Horizontal Total and Display End Counter Register. Note: This register is double buffered */ - __I uint32_t RESERVE7[1]; - __IO uint32_t HSync0; /*!< [0x1438] Horizontal Sync Counter Register. Note: This register is double buffered. */ - __I uint32_t RESERVE8[1]; - __IO uint32_t VDisplay0; /*!< [0x1440] Vertical Total and Display End Counter Register. Note: This register is double buffered. */ - __I uint32_t RESERVE9[1]; - __IO uint32_t VSync0; /*!< [0x1448] Vertical Sync Counter Register. Note: This register is double buffered. */ - __I uint32_t RESERVE10[1]; - __I uint32_t DisplayCurrentLocation0; /*!< [0x1450] Display Current Location Register. Current x,y location of display controller. */ - __I uint32_t RESERVE11[1]; - __O uint32_t GammaIndex0; /*!< [0x1458] Gamma Table Index Register. Index into gamma table. See GammaData for more information. */ - __I uint32_t RESERVE12[1]; - __O uint32_t GammaData0; /*!< [0x1460] Gamma Data Translation Register. Translation values for the gamma table. When this register gets written, the data gets stored in the gamma table at the index specified by the GammaIndex register. After the register is written, the index gets incremented. */ - __I uint32_t RESERVE13[1]; - __IO uint32_t CursorConfig; /*!< [0x1468] Cursor Configuration Register. */ - __IO uint32_t CursorAddress; /*!< [0x146c] Cursor Address Register. Address of the cursor shape. Note: This register is double buffered. */ - __IO uint32_t CursorLocation; /*!< [0x1470] Cursor Location Register. Location of the cursor on the owning display. Note: This register is double buffered. */ - __IO uint32_t CursorBackground; /*!< [0x1474] Masked Cursor Background Color Register. The background color for Masked cursors. Note: This register is double buffered. */ - __IO uint32_t CursorForeground; /*!< [0x1478] Masked Cursor Foreground Color Register. The foreground color for Masked cursors. Note: This register is double buffered. */ - __I uint32_t DisplayIntr; /*!< [0x147c] Display Interrupt Register */ - __IO uint32_t DisplayIntrEnable; /*!< [0x1480] Display Interrupt Enable Register. The interrupt enable register for display_0. Note: Interrupt enable for register DisplayIntr. */ - __IO uint32_t CursorModuleClockGatingControl; /*!< [0x1484] Clock Gating Control for Cursor Register. Module level clock gating control for cursor. */ - __IO uint32_t DbiConfig0; /*!< [0x1488] Wayne Undertable register */ - __I uint32_t RESERVE14[9]; - __IO uint32_t GeneralConfig0; /*!< [0x14b0] General Miscellaneous Configuration Register. Misc option configuration. Note: This register is double buffered. */ - __I uint32_t RESERVE15[1]; - __IO uint32_t DpiConfig0; /*!< [0x14b8] DPI Configuration Register. The configuration register for DPI output. Note: This register is double buffered. */ - __I uint32_t RESERVE16[5]; - __IO uint32_t DebugCounterSelect0; /*!< [0x14d0] Debug Counter Selection Register. */ - __I uint32_t RESERVE17[1]; - __I uint32_t DebugCounterValue0; /*!< [0x14d8] Debug Counter Value Register */ - __I uint32_t RESERVE18[11]; - __IO uint32_t FrameBufferColorKey0; /*!< [0x1508] Framebuffer Color Key Start Address Register. Start of color key range of framebuffer. Note: This register is double buffered. */ - __I uint32_t RESERVE19[1]; - __IO uint32_t FrameBufferColorKeyHigh0; /*!< [0x1510] Framebuffer Color Key End Address Register. End of color key range of framebuffer. Note: This register is double buffered. */ - __I uint32_t RESERVE20[1]; - __IO uint32_t FrameBufferConfig0; /*!< [0x1518] Framebuffer Configuration Register. Framebuffer attribute configuration. Note: This register is double buffered. Some fields are double buffered. */ - __I uint32_t RESERVE21[3]; - __IO uint32_t FrameBufferBGColor0; /*!< [0x1528] Framebuffer Background Color Register. Background color used when a pixel from the framebuffer falls outside of the range of color key. */ - __I uint32_t RESERVE22[1]; - __IO uint32_t FrameBufferUPlanarAddress0; /*!< [0x1530] Framebuffer Second Plane U Start Address Register. Starting address of the second planar (often the U plane) of the framebuffer if one exists. */ - __I uint32_t RESERVE23[1]; - __IO uint32_t FrameBufferVPlanarAddress0; /*!< [0x1538] Framebuffer Third Plane V Start Address Register. Starting address of the third planar (often the V plane) of the framebuffer if one exists. Note: This register is double buffered. */ - __I uint32_t RESERVE24[1]; - __IO uint32_t OverlayConfig0; /*!< [0x1540] Overlay Configuration Register. Overlay attributes control. Note: This register is double buffered. */ - __I uint32_t RESERVE25[15]; - __IO uint32_t OverlayAlphaBlendConfig0; /*!< [0x1580] Overlay Alpha Blending Configuration Register. Note: This register is double buffered. */ - __I uint32_t RESERVE26[15]; - __IO uint32_t OverlayAddress0; /*!< [0x15c0] Overlay Start Address Register. Starting address of the overlay. Note: This register is double buffered. */ - __I uint32_t RESERVE27[15]; - __IO uint32_t OverlayStride0; /*!< [0x1600] Overlay Stride Register. Stride of the overlay in bytes. Note: This register is double buffered. */ - __I uint32_t RESERVE28[15]; - __IO uint32_t OverlayTL0; /*!< [0x1640] Overlay Origin Register. Top left coordinate of the panel pixel where the overlay should start. Be aware there is no panning inside the overlay. Note: This register is double buffered */ - __I uint32_t RESERVE29[15]; - __IO uint32_t OverlayBR0; /*!< [0x1680] Overlay End Register. Bottom right coordinate of the panel pixel where the overlay should end. The border is inclusive. Note: This register is double buffered. */ - __I uint32_t RESERVE30[15]; - __IO uint32_t OverlaySrcGlobalColor0; /*!< [0x16c0] Overlay Source Global Color Register. Color value used when alpha blending process is configured to use global color for source. Note: This register is double buffered. */ - __I uint32_t RESERVE31[15]; - __IO uint32_t OverlayDstGlobalColor0; /*!< [0x1700] Overlay Destination Global Color Register. Color value used when alpha blending process is configured to use global color for destination. Note: This register is double buffered. */ - __I uint32_t RESERVE32[15]; - __IO uint32_t OverlayColorKey0; /*!< [0x1740] Overlay Color Key Start Address Register. Start of color key range for overlay. Note: This register is double buffered. */ - __I uint32_t RESERVE33[15]; - __IO uint32_t OverlayColorKeyHigh0; /*!< [0x1780] Overlay Color Key End Address Register. End of color key range for overlay. Note: This register is double buffered. */ - __I uint32_t RESERVE34[15]; - __IO uint32_t OverlaySize0; /*!< [0x17c0] Overlay Window Size Register. Window size of the overlay buffer in memory - in pixels. Note: This register is double buffered. */ - __I uint32_t RESERVE35[15]; - __IO uint32_t FrameBufferUStride0; /*!< [0x1800] Framebuffer Second Plane U Stride Register. Stride of the second planar (often the U plane) of the framebuffer if one exists. Note: This register is double buffered. */ - __I uint32_t RESERVE36[1]; - __IO uint32_t FrameBufferVStride0; /*!< [0x1808] Framebuffer Third Plane V Stride Register. Stride of the third planar (often the V plane) of the framebuffer if one exists. Note: This register is double buffered. */ - __I uint32_t RESERVE37[1]; - __IO uint32_t FrameBufferSize0; /*!< [0x1810] Framebuffer Size Register. Window size of the framebuffer in memory - in pixels. Note: This register is double buffered. */ - __I uint32_t RESERVE38[1]; - __O uint32_t IndexColorTableIndex0; /*!< [0x1818] Index Color Table Index Register. Index into index color table. See IndexColorTableData for more information. */ - __I uint32_t RESERVE39[1]; - __O uint32_t IndexColorTableData0; /*!< [0x1820] Index Color Table Data Translation Register. Translation values for the index color table. When this register gets written, the data gets stored in the index color table at the index specified by the IndexColorTableIndex register. After the register is written, the index gets incremented. Note: This register is double buffered. */ - __I uint32_t RESERVE40[7]; - __IO uint32_t OverlayUPlanarAddress0; /*!< [0x1840] Overlay Second Plane U Start Address Register. Address of the second planar (often U plane) of the overlay if one exists. Note: This register is double buffered. */ - __I uint32_t RESERVE41[15]; - __IO uint32_t OverlayVPlanarAddress0; /*!< [0x1880] Overlay Third Plane V Start Address Register. Address of the third planar (often V plane) of the overlay if one exists. Note: This register is double buffered. */ - __I uint32_t RESERVE42[15]; - __IO uint32_t OverlayUStride0; /*!< [0x18c0] Overlay Second Plane U Stride Register. Stride of the second planar of the overlay if one exists. Note: This register is double buffered. */ - __I uint32_t RESERVE43[15]; - __IO uint32_t OverlayVStride0; /*!< [0x1900] Overlay Third Plane V Stride Register. Stride of the third planar of the overlay if one exists. Note: This register is double buffered. */ - __I uint32_t RESERVE44[15]; - __IO uint32_t OverlayClearValue0; /*!< [0x1940] Overlay Clear Value Register. Clear value used when OverlayConfig.Clear is enabled. Format is A8R8G8B8. Note: This register is double buffered. */ - __I uint32_t RESERVE45[15]; - __O uint32_t OverlayIndexColorTableIndex0; /*!< [0x1980] Overlay Index Color Table Index Register. Index into overlay index color table. See OverlayIndexColorTableData for more information. */ - __I uint32_t RESERVE46[15]; - __O uint32_t OverlayIndexColorTableData0; /*!< [0x19c0] Index Color Table Data Translation Register. Translation values for the index color table of the overlay. When this register gets written, the data gets stored in the index color table at the index specified by the OverlayIndexColorTableIndex register. After the register is written, the index gets incremented. Note: This register is double buffered. */ - __I uint32_t RESERVE47[21]; - __IO uint32_t FrameBufferClearValue0; /*!< [0x1a18] Framebuffer Clear Value Register. Clear value used when FrameBufferConfig. Clear is enabled, format is A8R8G8B8. Note: This register is double buffered. */ - __I uint32_t RESERVE48[3]; - __IO uint32_t ModuleClockGatingControl0; /*!< [0x1a28] Clock Gating Module Control Register. Module level clock gating control for video and overlay. */ - __I uint32_t RESERVE49[1]; - __IO uint32_t LatencyCounter0; /*!< [0x1a30] Latency Counter Register. */ - __I uint32_t RESERVE50[1]; - __IO uint32_t Qos0; /*!< [0x1a38] Quality of Service Latency Value Register. */ - __I uint32_t RESERVE51[129]; - __IO uint32_t MpuIntfCmd0; /*!< [0x1c40] MPU Command Configuration Register. */ - __I uint32_t RESERVE52[1]; - __I uint32_t MpuIntfReadPara00; /*!< [0x1c48] MPU Read Parameter0 Register. */ - __I uint32_t RESERVE53[1]; - __I uint32_t MpuIntfReadPara10; /*!< [0x1c50] MPU Read Parameter1 Register. */ - __I uint32_t RESERVE54[1]; - __I uint32_t MpuIntfReadPara20; /*!< [0x1c58] MPU Read Parameter2 Register. */ - __I uint32_t RESERVE55[1]; - __I uint32_t MpuIntfReadPara30; /*!< [0x1c60] MPU Read Parameter3 Register. */ - __I uint32_t RESERVE56[1]; - __I uint32_t MpuIntfReadPara40; /*!< [0x1c68] MPU Read Parameter4 Register. */ - __I uint32_t RESERVE57[1]; - __I uint32_t MpuIntfReadStatus0; /*!< [0x1c70] MPU Read Parameter Status Register. */ - __I uint32_t RESERVE58[1]; - __IO uint32_t MpuIntfConfig0; /*!< [0x1c78] MPU Interface Configuration Register. */ - __I uint32_t RESERVE59[1]; - __IO uint32_t MpuIntfFrame0; /*!< [0x1c80] MPU Frame Configuration Register. Note: This register is double buffered. */ - __I uint32_t RESERVE60[1]; - __IO uint32_t MpuIntfACWrI800; /*!< [0x1c88] MPU Write AC Characteristics I80 Register. */ - __I uint32_t RESERVE61[1]; - __IO uint32_t MpuIntfACRdI800; /*!< [0x1c90] MPU Read AC Characteristics I80 Register. */ - __I uint32_t RESERVE62[1]; - __IO uint32_t MpuIntfACWrM680; /*!< [0x1c98] MPU Write AC Characteristics M68 Register. */ - __I uint32_t RESERVE63[1]; - __IO uint32_t MpuIntfACRdM680; /*!< [0x1ca0] MPU Read AC Characteristics M68 Register. */ - __I uint32_t RESERVE64[1]; - __IO uint32_t MpuIntfACVsyncCSX0; /*!< [0x1ca8] MPU CSX Assert Register. */ - -} DISP_T; - -/** - @addtogroup DISP_CONST DISP Bit Field Definition - Constant Definitions for DISP Controller -@{ */ - -#define DISP_AQHiClockControl_CLKDC_DIS_Pos (1) /*!< DISP_T::AQHiClockControl: CLKDC_DIS Position*/ -#define DISP_AQHiClockControl_CLKDC_DIS_Msk (0x1ul << DISP_AQHiClockControl_CLKDC_DIS_Pos) /*!< DISP_T::AQHiClockControl: CLKDC_DIS Mask*/ - -#define DISP_AQHiClockControl_FSCALE_VAL_Pos (2) /*!< DISP_T::AQHiClockControl: FSCALE_VAL Position*/ -#define DISP_AQHiClockControl_FSCALE_VAL_Msk (0x7ful << DISP_AQHiClockControl_FSCALE_VAL_Pos) /*!< DISP_T::AQHiClockControl: FSCALE_VAL Mask*/ - -#define DISP_AQHiClockControl_FSCALE_CMD_LOAD_Pos (9) /*!< DISP_T::AQHiClockControl: FSCALE_CMD_LOAD Position*/ -#define DISP_AQHiClockControl_FSCALE_CMD_LOAD_Msk (0x1ul << DISP_AQHiClockControl_FSCALE_CMD_LOAD_Pos) /*!< DISP_T::AQHiClockControl: FSCALE_CMD_LOAD Mask*/ - -#define DISP_AQHiClockControl_DISABLE_RAM_CLOCK_GATING_Pos (10) /*!< DISP_T::AQHiClockControl: DISABLE_RAM_CLOCK_GATING Position*/ -#define DISP_AQHiClockControl_DISABLE_RAM_CLOCK_GATING_Msk (0x1ul << DISP_AQHiClockControl_DISABLE_RAM_CLOCK_GATING_Pos) /*!< DISP_T::AQHiClockControl: DISABLE_RAM_CLOCK_GATING Mask*/ - -#define DISP_AQHiClockControl_DISABLE_DEBUG_REGISTERS_Pos (11) /*!< DISP_T::AQHiClockControl: DISABLE_DEBUG_REGISTERS Position*/ -#define DISP_AQHiClockControl_DISABLE_DEBUG_REGISTERS_Msk (0x1ul << DISP_AQHiClockControl_DISABLE_DEBUG_REGISTERS_Pos) /*!< DISP_T::AQHiClockControl: DISABLE_DEBUG_REGISTERS Mask*/ - -#define DISP_AQHiClockControl_SOFT_RESET_Pos (12) /*!< DISP_T::AQHiClockControl: SOFT_RESET Position*/ -#define DISP_AQHiClockControl_SOFT_RESET_Msk (0x1ul << DISP_AQHiClockControl_SOFT_RESET_Pos) /*!< DISP_T::AQHiClockControl: SOFT_RESET Mask*/ - -#define DISP_AQHiClockControl_DISABLE_RAM_POWER_OPTIMIZATION_Pos (13) /*!< DISP_T::AQHiClockControl: DISABLE_RAM_POWER_OPTIMIZATION Position*/ -#define DISP_AQHiClockControl_DISABLE_RAM_POWER_OPTIMIZATION_Msk (0x1ul << DISP_AQHiClockControl_DISABLE_RAM_POWER_OPTIMIZATION_Pos) /*!< DISP_T::AQHiClockControl: DISABLE_RAM_POWER_OPTIMIZATION Mask*/ - -#define DISP_FrameBufferAddress0_ADDRESS_Pos (0) /*!< DISP_T::FrameBufferAddress0: ADDRESS Position*/ -#define DISP_FrameBufferAddress0_ADDRESS_Msk (0x7ffffffful << DISP_FrameBufferAddress0_ADDRESS_Pos) /*!< DISP_T::FrameBufferAddress0: ADDRESS Mask*/ - -#define DISP_FrameBufferAddress0_TYPE_Pos (31) /*!< DISP_T::FrameBufferAddress0: TYPE Position*/ -#define DISP_FrameBufferAddress0_TYPE_Msk (0x1ul << DISP_FrameBufferAddress0_TYPE_Pos) /*!< DISP_T::FrameBufferAddress0: TYPE Mask*/ - -#define DISP_FrameBufferStride0_STRIDE_Pos (0) /*!< DISP_T::FrameBufferStride0: STRIDE Position*/ -#define DISP_FrameBufferStride0_STRIDE_Msk (0x1fffful << DISP_FrameBufferStride0_STRIDE_Pos) /*!< DISP_T::FrameBufferStride0: STRIDE Mask*/ - -#define DISP_DisplayDitherConfig0_ENABLE_Pos (31) /*!< DISP_T::DisplayDitherConfig0: ENABLE Position*/ -#define DISP_DisplayDitherConfig0_ENABLE_Msk (0x1ul << DISP_DisplayDitherConfig0_ENABLE_Pos) /*!< DISP_T::DisplayDitherConfig0: ENABLE Mask*/ - -#define DISP_PanelConfig0_DE_Pos (0) /*!< DISP_T::PanelConfig0: DE Position */ -#define DISP_PanelConfig0_DE_Msk (0x1ul << DISP_PanelConfig0_DE_Pos) /*!< DISP_T::PanelConfig0: DE Mask */ - -#define DISP_PanelConfig0_DE_POLARITY_Pos (1) /*!< DISP_T::PanelConfig0: DE_POLARITY Position*/ -#define DISP_PanelConfig0_DE_POLARITY_Msk (0x1ul << DISP_PanelConfig0_DE_POLARITY_Pos) /*!< DISP_T::PanelConfig0: DE_POLARITY Mask*/ - -#define DISP_PanelConfig0_DATA_ENABLE_Pos (4) /*!< DISP_T::PanelConfig0: DATA_ENABLE Position*/ -#define DISP_PanelConfig0_DATA_ENABLE_Msk (0x1ul << DISP_PanelConfig0_DATA_ENABLE_Pos) /*!< DISP_T::PanelConfig0: DATA_ENABLE Mask*/ - -#define DISP_PanelConfig0_DATA_POLARITY_Pos (5) /*!< DISP_T::PanelConfig0: DATA_POLARITY Position*/ -#define DISP_PanelConfig0_DATA_POLARITY_Msk (0x1ul << DISP_PanelConfig0_DATA_POLARITY_Pos) /*!< DISP_T::PanelConfig0: DATA_POLARITY Mask*/ - -#define DISP_PanelConfig0_CLOCK_Pos (8) /*!< DISP_T::PanelConfig0: CLOCK Position*/ -#define DISP_PanelConfig0_CLOCK_Msk (0x1ul << DISP_PanelConfig0_CLOCK_Pos) /*!< DISP_T::PanelConfig0: CLOCK Mask */ - -#define DISP_PanelConfig0_CLOCK_POLARITY_Pos (9) /*!< DISP_T::PanelConfig0: CLOCK_POLARITY Position*/ -#define DISP_PanelConfig0_CLOCK_POLARITY_Msk (0x1ul << DISP_PanelConfig0_CLOCK_POLARITY_Pos) /*!< DISP_T::PanelConfig0: CLOCK_POLARITY Mask*/ - -#define DISP_DisplayDitherTableLow0_Y0_X0_Pos (0) /*!< DISP_T::DisplayDitherTableLow0: Y0_X0 Position*/ -#define DISP_DisplayDitherTableLow0_Y0_X0_Msk (0xful << DISP_DisplayDitherTableLow0_Y0_X0_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y0_X0 Mask*/ - -#define DISP_DisplayDitherTableLow0_Y0_X1_Pos (4) /*!< DISP_T::DisplayDitherTableLow0: Y0_X1 Position*/ -#define DISP_DisplayDitherTableLow0_Y0_X1_Msk (0xful << DISP_DisplayDitherTableLow0_Y0_X1_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y0_X1 Mask*/ - -#define DISP_DisplayDitherTableLow0_Y0_X2_Pos (8) /*!< DISP_T::DisplayDitherTableLow0: Y0_X2 Position*/ -#define DISP_DisplayDitherTableLow0_Y0_X2_Msk (0xful << DISP_DisplayDitherTableLow0_Y0_X2_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y0_X2 Mask*/ - -#define DISP_DisplayDitherTableLow0_Y0_X3_Pos (12) /*!< DISP_T::DisplayDitherTableLow0: Y0_X3 Position*/ -#define DISP_DisplayDitherTableLow0_Y0_X3_Msk (0xful << DISP_DisplayDitherTableLow0_Y0_X3_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y0_X3 Mask*/ - -#define DISP_DisplayDitherTableLow0_Y1_X0_Pos (16) /*!< DISP_T::DisplayDitherTableLow0: Y1_X0 Position*/ -#define DISP_DisplayDitherTableLow0_Y1_X0_Msk (0xful << DISP_DisplayDitherTableLow0_Y1_X0_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y1_X0 Mask*/ - -#define DISP_DisplayDitherTableLow0_Y1_X1_Pos (20) /*!< DISP_T::DisplayDitherTableLow0: Y1_X1 Position*/ -#define DISP_DisplayDitherTableLow0_Y1_X1_Msk (0xful << DISP_DisplayDitherTableLow0_Y1_X1_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y1_X1 Mask*/ - -#define DISP_DisplayDitherTableLow0_Y1_X2_Pos (24) /*!< DISP_T::DisplayDitherTableLow0: Y1_X2 Position*/ -#define DISP_DisplayDitherTableLow0_Y1_X2_Msk (0xful << DISP_DisplayDitherTableLow0_Y1_X2_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y1_X2 Mask*/ - -#define DISP_DisplayDitherTableLow0_Y1_X3_Pos (28) /*!< DISP_T::DisplayDitherTableLow0: Y1_X3 Position*/ -#define DISP_DisplayDitherTableLow0_Y1_X3_Msk (0xful << DISP_DisplayDitherTableLow0_Y1_X3_Pos) /*!< DISP_T::DisplayDitherTableLow0: Y1_X3 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y2_X0_Pos (0) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X0 Position*/ -#define DISP_DisplayDitherTableHigh0_Y2_X0_Msk (0xful << DISP_DisplayDitherTableHigh0_Y2_X0_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X0 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y2_X1_Pos (4) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X1 Position*/ -#define DISP_DisplayDitherTableHigh0_Y2_X1_Msk (0xful << DISP_DisplayDitherTableHigh0_Y2_X1_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X1 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y2_X2_Pos (8) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X2 Position*/ -#define DISP_DisplayDitherTableHigh0_Y2_X2_Msk (0xful << DISP_DisplayDitherTableHigh0_Y2_X2_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X2 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y2_X3_Pos (12) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X3 Position*/ -#define DISP_DisplayDitherTableHigh0_Y2_X3_Msk (0xful << DISP_DisplayDitherTableHigh0_Y2_X3_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y2_X3 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y3_X0_Pos (16) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X0 Position*/ -#define DISP_DisplayDitherTableHigh0_Y3_X0_Msk (0xful << DISP_DisplayDitherTableHigh0_Y3_X0_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X0 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y3_X1_Pos (20) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X1 Position*/ -#define DISP_DisplayDitherTableHigh0_Y3_X1_Msk (0xful << DISP_DisplayDitherTableHigh0_Y3_X1_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X1 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y3_X2_Pos (24) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X2 Position*/ -#define DISP_DisplayDitherTableHigh0_Y3_X2_Msk (0xful << DISP_DisplayDitherTableHigh0_Y3_X2_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X2 Mask*/ - -#define DISP_DisplayDitherTableHigh0_Y3_X3_Pos (28) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X3 Position*/ -#define DISP_DisplayDitherTableHigh0_Y3_X3_Msk (0xful << DISP_DisplayDitherTableHigh0_Y3_X3_Pos) /*!< DISP_T::DisplayDitherTableHigh0: Y3_X3 Mask*/ - -#define DISP_HDisplay0_DISPLAY_END_Pos (0) /*!< DISP_T::HDisplay0: DISPLAY_END Position*/ -#define DISP_HDisplay0_DISPLAY_END_Msk (0x7ffful << DISP_HDisplay0_DISPLAY_END_Pos) /*!< DISP_T::HDisplay0: DISPLAY_END Mask*/ - -#define DISP_HDisplay0_TOTAL_Pos (16) /*!< DISP_T::HDisplay0: TOTAL Position */ -#define DISP_HDisplay0_TOTAL_Msk (0x7ffful << DISP_HDisplay0_TOTAL_Pos) /*!< DISP_T::HDisplay0: TOTAL Mask */ - -#define DISP_HSync0_START_Pos (0) /*!< DISP_T::HSync0: START Position */ -#define DISP_HSync0_START_Msk (0x7ffful << DISP_HSync0_START_Pos) /*!< DISP_T::HSync0: START Mask */ - -#define DISP_HSync0_END_Pos (15) /*!< DISP_T::HSync0: END Position */ -#define DISP_HSync0_END_Msk (0x7ffful << DISP_HSync0_END_Pos) /*!< DISP_T::HSync0: END Mask */ - -#define DISP_HSync0_PULSE_Pos (30) /*!< DISP_T::HSync0: PULSE Position */ -#define DISP_HSync0_PULSE_Msk (0x1ul << DISP_HSync0_PULSE_Pos) /*!< DISP_T::HSync0: PULSE Mask */ - -#define DISP_HSync0_POLARITY_Pos (31) /*!< DISP_T::HSync0: POLARITY Position */ -#define DISP_HSync0_POLARITY_Msk (0x1ul << DISP_HSync0_POLARITY_Pos) /*!< DISP_T::HSync0: POLARITY Mask */ - -#define DISP_VDisplay0_DISPLAY_END_Pos (0) /*!< DISP_T::VDisplay0: DISPLAY_END Position*/ -#define DISP_VDisplay0_DISPLAY_END_Msk (0x7ffful << DISP_VDisplay0_DISPLAY_END_Pos) /*!< DISP_T::VDisplay0: DISPLAY_END Mask*/ - -#define DISP_VDisplay0_TOTAL_Pos (16) /*!< DISP_T::VDisplay0: TOTAL Position */ -#define DISP_VDisplay0_TOTAL_Msk (0x7ffful << DISP_VDisplay0_TOTAL_Pos) /*!< DISP_T::VDisplay0: TOTAL Mask */ - -#define DISP_VSync0_START_Pos (0) /*!< DISP_T::VSync0: START Position */ -#define DISP_VSync0_START_Msk (0x7ffful << DISP_VSync0_START_Pos) /*!< DISP_T::VSync0: START Mask */ - -#define DISP_VSync0_END_Pos (15) /*!< DISP_T::VSync0: END Position */ -#define DISP_VSync0_END_Msk (0x7ffful << DISP_VSync0_END_Pos) /*!< DISP_T::VSync0: END Mask */ - -#define DISP_VSync0_PULSE_Pos (30) /*!< DISP_T::VSync0: PULSE Position */ -#define DISP_VSync0_PULSE_Msk (0x1ul << DISP_VSync0_PULSE_Pos) /*!< DISP_T::VSync0: PULSE Mask */ - -#define DISP_VSync0_POLARITY_Pos (31) /*!< DISP_T::VSync0: POLARITY Position */ -#define DISP_VSync0_POLARITY_Msk (0x1ul << DISP_VSync0_POLARITY_Pos) /*!< DISP_T::VSync0: POLARITY Mask */ - -#define DISP_DisplayCurrentLocation0_X_Pos (0) /*!< DISP_T::DisplayCurrentLocation0: X Position*/ -#define DISP_DisplayCurrentLocation0_X_Msk (0xfffful << DISP_DisplayCurrentLocation0_X_Pos) /*!< DISP_T::DisplayCurrentLocation0: X Mask*/ - -#define DISP_DisplayCurrentLocation0_Y_Pos (16) /*!< DISP_T::DisplayCurrentLocation0: Y Position*/ -#define DISP_DisplayCurrentLocation0_Y_Msk (0xfffful << DISP_DisplayCurrentLocation0_Y_Pos) /*!< DISP_T::DisplayCurrentLocation0: Y Mask*/ - -#define DISP_GammaIndex0_INDEX_Pos (0) /*!< DISP_T::GammaIndex0: INDEX Position*/ -#define DISP_GammaIndex0_INDEX_Msk (0xfful << DISP_GammaIndex0_INDEX_Pos) /*!< DISP_T::GammaIndex0: INDEX Mask */ - -#define DISP_GammaData0_BLUE_Pos (0) /*!< DISP_T::GammaData0: BLUE Position */ -#define DISP_GammaData0_BLUE_Msk (0x3fful << DISP_GammaData0_BLUE_Pos) /*!< DISP_T::GammaData0: BLUE Mask */ - -#define DISP_GammaData0_GREEN_Pos (10) /*!< DISP_T::GammaData0: GREEN Position*/ -#define DISP_GammaData0_GREEN_Msk (0x3fful << DISP_GammaData0_GREEN_Pos) /*!< DISP_T::GammaData0: GREEN Mask */ - -#define DISP_GammaData0_READ_Pos (20) /*!< DISP_T::GammaData0: READ Position */ -#define DISP_GammaData0_READ_Msk (0x3fful << DISP_GammaData0_READ_Pos) /*!< DISP_T::GammaData0: READ Mask */ - -#define DISP_CursorConfig_FORMAT_Pos (0) /*!< DISP_T::CursorConfig: FORMAT Position*/ -#define DISP_CursorConfig_FORMAT_Msk (0x3ul << DISP_CursorConfig_FORMAT_Pos) /*!< DISP_T::CursorConfig: FORMAT Mask */ - -#define DISP_CursorConfig_DISPLAY_Pos (4) /*!< DISP_T::CursorConfig: DISPLAY Position*/ -#define DISP_CursorConfig_DISPLAY_Msk (0x1ul << DISP_CursorConfig_DISPLAY_Pos) /*!< DISP_T::CursorConfig: DISPLAY Mask*/ - -#define DISP_CursorConfig_HOT_SPOT_Y_Pos (8) /*!< DISP_T::CursorConfig: HOT_SPOT_Y Position*/ -#define DISP_CursorConfig_HOT_SPOT_Y_Msk (0x1ful << DISP_CursorConfig_HOT_SPOT_Y_Pos) /*!< DISP_T::CursorConfig: HOT_SPOT_Y Mask*/ - -#define DISP_CursorConfig_HOT_SPOT_X_Pos (16) /*!< DISP_T::CursorConfig: HOT_SPOT_X Position*/ -#define DISP_CursorConfig_HOT_SPOT_X_Msk (0x1ful << DISP_CursorConfig_HOT_SPOT_X_Pos) /*!< DISP_T::CursorConfig: HOT_SPOT_X Mask*/ - -#define DISP_CursorAddress_ADDRESS_Pos (0) /*!< DISP_T::CursorAddress: ADDRESS Position*/ -#define DISP_CursorAddress_ADDRESS_Msk (0x7ffffffful << DISP_CursorAddress_ADDRESS_Pos) /*!< DISP_T::CursorAddress: ADDRESS Mask*/ - -#define DISP_CursorAddress_TYPE_Pos (31) /*!< DISP_T::CursorAddress: TYPE Position*/ -#define DISP_CursorAddress_TYPE_Msk (0x1ul << DISP_CursorAddress_TYPE_Pos) /*!< DISP_T::CursorAddress: TYPE Mask */ - -#define DISP_CursorLocation_X_Pos (0) /*!< DISP_T::CursorLocation: X Position*/ -#define DISP_CursorLocation_X_Msk (0x7ffful << DISP_CursorLocation_X_Pos) /*!< DISP_T::CursorLocation: X Mask */ - -#define DISP_CursorLocation_Y_Pos (16) /*!< DISP_T::CursorLocation: Y Position*/ -#define DISP_CursorLocation_Y_Msk (0x7ffful << DISP_CursorLocation_Y_Pos) /*!< DISP_T::CursorLocation: Y Mask */ - -#define DISP_CursorBackground_BLUE_Pos (0) /*!< DISP_T::CursorBackground: BLUE Position*/ -#define DISP_CursorBackground_BLUE_Msk (0xfful << DISP_CursorBackground_BLUE_Pos) /*!< DISP_T::CursorBackground: BLUE Mask*/ - -#define DISP_CursorBackground_GREEN_Pos (8) /*!< DISP_T::CursorBackground: GREEN Position*/ -#define DISP_CursorBackground_GREEN_Msk (0xfful << DISP_CursorBackground_GREEN_Pos) /*!< DISP_T::CursorBackground: GREEN Mask*/ - -#define DISP_CursorBackground_RED_Pos (16) /*!< DISP_T::CursorBackground: RED Position*/ -#define DISP_CursorBackground_RED_Msk (0xfful << DISP_CursorBackground_RED_Pos) /*!< DISP_T::CursorBackground: RED Mask*/ - -#define DISP_CursorForeground_BLUE_Pos (0) /*!< DISP_T::CursorForeground: BLUE Position*/ -#define DISP_CursorForeground_BLUE_Msk (0xfful << DISP_CursorForeground_BLUE_Pos) /*!< DISP_T::CursorForeground: BLUE Mask*/ - -#define DISP_CursorForeground_GREEN_Pos (8) /*!< DISP_T::CursorForeground: GREEN Position*/ -#define DISP_CursorForeground_GREEN_Msk (0xfful << DISP_CursorForeground_GREEN_Pos) /*!< DISP_T::CursorForeground: GREEN Mask*/ - -#define DISP_CursorForeground_RED_Pos (16) /*!< DISP_T::CursorForeground: RED Position*/ -#define DISP_CursorForeground_RED_Msk (0xfful << DISP_CursorForeground_RED_Pos) /*!< DISP_T::CursorForeground: RED Mask*/ - -#define DISP_DisplayIntr_DISP0_Pos (0) /*!< DISP_T::DisplayIntr: DISP0 Position*/ -#define DISP_DisplayIntr_DISP0_Msk (0x1ul << DISP_DisplayIntr_DISP0_Pos) /*!< DISP_T::DisplayIntr: DISP0 Mask */ - -#define DISP_DisplayIntrEnable_DISP0_Pos (0) /*!< DISP_T::DisplayIntrEnable: DISP0 Position*/ -#define DISP_DisplayIntrEnable_DISP0_Msk (0x1ul << DISP_DisplayIntrEnable_DISP0_Pos) /*!< DISP_T::DisplayIntrEnable: DISP0 Mask*/ - -#define DISP_CursorModuleClockGatingControl_DISABLE_MODULE_CLOCK_GATING_CURSOR_Pos (0) /*!< DISP_T::CursorModuleClockGatingControl: DISABLE_MODULE_CLOCK_GATING_CURSOR Position*/ -#define DISP_CursorModuleClockGatingControl_DISABLE_MODULE_CLOCK_GATING_CURSOR_Msk (0x1ul << DISP_CursorModuleClockGatingControl_DISABLE_MODULE_CLOCK_GATING_CURSOR_Pos) /*!< DISP_T::CursorModuleClockGatingControl: DISABLE_MODULE_CLOCK_GATING_CURSOR Mask*/ - -#define DISP_GeneralConfig0_ENDIAN_CONTROL_Pos (0) /*!< DISP_T::GeneralConfig0: ENDIAN_CONTROL Position*/ -#define DISP_GeneralConfig0_ENDIAN_CONTROL_Msk (0x3ul << DISP_GeneralConfig0_ENDIAN_CONTROL_Pos) /*!< DISP_T::GeneralConfig0: ENDIAN_CONTROL Mask*/ - -#define DISP_GeneralConfig0_STALL_OUTPUT_WHEN_UNDERFLOW_Pos (2) /*!< DISP_T::GeneralConfig0: STALL_OUTPUT_WHEN_UNDERFLOW Position*/ -#define DISP_GeneralConfig0_STALL_OUTPUT_WHEN_UNDERFLOW_Msk (0x1ul << DISP_GeneralConfig0_STALL_OUTPUT_WHEN_UNDERFLOW_Pos) /*!< DISP_T::GeneralConfig0: STALL_OUTPUT_WHEN_UNDERFLOW Mask*/ - -#define DISP_GeneralConfig0_DISABLE_IDLE_Pos (3) /*!< DISP_T::GeneralConfig0: DISABLE_IDLE Position*/ -#define DISP_GeneralConfig0_DISABLE_IDLE_Msk (0x1ul << DISP_GeneralConfig0_DISABLE_IDLE_Pos) /*!< DISP_T::GeneralConfig0: DISABLE_IDLE Mask*/ - -#define DISP_DpiConfig0_DPI_DATA_FORMAT_Pos (0) /*!< DISP_T::DpiConfig0: DPI_DATA_FORMAT Position*/ -#define DISP_DpiConfig0_DPI_DATA_FORMAT_Msk (0x7ul << DISP_DpiConfig0_DPI_DATA_FORMAT_Pos) /*!< DISP_T::DpiConfig0: DPI_DATA_FORMAT Mask*/ - -#define DISP_DebugCounterSelect0_SELECT_Pos (0) /*!< DISP_T::DebugCounterSelect0: SELECT Position*/ -#define DISP_DebugCounterSelect0_SELECT_Msk (0xfful << DISP_DebugCounterSelect0_SELECT_Pos) /*!< DISP_T::DebugCounterSelect0: SELECT Mask*/ - -#define DISP_DebugCounterValue0_VALUE_Pos (0) /*!< DISP_T::DebugCounterValue0: VALUE Position*/ -#define DISP_DebugCounterValue0_VALUE_Msk (0xfffffffful << DISP_DebugCounterValue0_VALUE_Pos) /*!< DISP_T::DebugCounterValue0: VALUE Mask*/ - -#define DISP_FrameBufferColorKey0_BLUE_Pos (0) /*!< DISP_T::FrameBufferColorKey0: BLUE Position*/ -#define DISP_FrameBufferColorKey0_BLUE_Msk (0xfful << DISP_FrameBufferColorKey0_BLUE_Pos) /*!< DISP_T::FrameBufferColorKey0: BLUE Mask*/ - -#define DISP_FrameBufferColorKey0_GREEN_Pos (8) /*!< DISP_T::FrameBufferColorKey0: GREEN Position*/ -#define DISP_FrameBufferColorKey0_GREEN_Msk (0xfful << DISP_FrameBufferColorKey0_GREEN_Pos) /*!< DISP_T::FrameBufferColorKey0: GREEN Mask*/ - -#define DISP_FrameBufferColorKey0_RED_Pos (16) /*!< DISP_T::FrameBufferColorKey0: RED Position*/ -#define DISP_FrameBufferColorKey0_RED_Msk (0xfful << DISP_FrameBufferColorKey0_RED_Pos) /*!< DISP_T::FrameBufferColorKey0: RED Mask*/ - -#define DISP_FrameBufferColorKey0_ALPHA_Pos (24) /*!< DISP_T::FrameBufferColorKey0: ALPHA Position*/ -#define DISP_FrameBufferColorKey0_ALPHA_Msk (0xfful << DISP_FrameBufferColorKey0_ALPHA_Pos) /*!< DISP_T::FrameBufferColorKey0: ALPHA Mask*/ - -#define DISP_FrameBufferColorKeyHigh0_BLUE_Pos (0) /*!< DISP_T::FrameBufferColorKeyHigh0: BLUE Position*/ -#define DISP_FrameBufferColorKeyHigh0_BLUE_Msk (0xfful << DISP_FrameBufferColorKeyHigh0_BLUE_Pos) /*!< DISP_T::FrameBufferColorKeyHigh0: BLUE Mask*/ - -#define DISP_FrameBufferColorKeyHigh0_GREEN_Pos (8) /*!< DISP_T::FrameBufferColorKeyHigh0: GREEN Position*/ -#define DISP_FrameBufferColorKeyHigh0_GREEN_Msk (0xfful << DISP_FrameBufferColorKeyHigh0_GREEN_Pos) /*!< DISP_T::FrameBufferColorKeyHigh0: GREEN Mask*/ - -#define DISP_FrameBufferColorKeyHigh0_RED_Pos (16) /*!< DISP_T::FrameBufferColorKeyHigh0: RED Position*/ -#define DISP_FrameBufferColorKeyHigh0_RED_Msk (0xfful << DISP_FrameBufferColorKeyHigh0_RED_Pos) /*!< DISP_T::FrameBufferColorKeyHigh0: RED Mask*/ - -#define DISP_FrameBufferColorKeyHigh0_ALPHA_Pos (24) /*!< DISP_T::FrameBufferColorKeyHigh0: ALPHA Position*/ -#define DISP_FrameBufferColorKeyHigh0_ALPHA_Msk (0xfful << DISP_FrameBufferColorKeyHigh0_ALPHA_Pos) /*!< DISP_T::FrameBufferColorKeyHigh0: ALPHA Mask*/ - -#define DISP_FrameBufferConfig0_OUTPUT_Pos (0) /*!< DISP_T::FrameBufferConfig0: OUTPUT Position*/ -#define DISP_FrameBufferConfig0_OUTPUT_Msk (0x1ul << DISP_FrameBufferConfig0_OUTPUT_Pos) /*!< DISP_T::FrameBufferConfig0: OUTPUT Mask*/ - -#define DISP_FrameBufferConfig0_GAMMA_Pos (2) /*!< DISP_T::FrameBufferConfig0: GAMMA Position*/ -#define DISP_FrameBufferConfig0_GAMMA_Msk (0x1ul << DISP_FrameBufferConfig0_GAMMA_Pos) /*!< DISP_T::FrameBufferConfig0: GAMMA Mask*/ - -#define DISP_FrameBufferConfig0_VALID_Pos (3) /*!< DISP_T::FrameBufferConfig0: VALID Position*/ -#define DISP_FrameBufferConfig0_VALID_Msk (0x1ul << DISP_FrameBufferConfig0_VALID_Pos) /*!< DISP_T::FrameBufferConfig0: VALID Mask*/ - -#define DISP_FrameBufferConfig0_RESET_Pos (4) /*!< DISP_T::FrameBufferConfig0: RESET Position*/ -#define DISP_FrameBufferConfig0_RESET_Msk (0x1ul << DISP_FrameBufferConfig0_RESET_Pos) /*!< DISP_T::FrameBufferConfig0: RESET Mask*/ - -#define DISP_FrameBufferConfig0_UNDERFLOW_Pos (5) /*!< DISP_T::FrameBufferConfig0: UNDERFLOW Position*/ -#define DISP_FrameBufferConfig0_UNDERFLOW_Msk (0x1ul << DISP_FrameBufferConfig0_UNDERFLOW_Pos) /*!< DISP_T::FrameBufferConfig0: UNDERFLOW Mask*/ - -#define DISP_FrameBufferConfig0_FLIP_IN_PROGRESS_Pos (6) /*!< DISP_T::FrameBufferConfig0: FLIP_IN_PROGRESS Position*/ -#define DISP_FrameBufferConfig0_FLIP_IN_PROGRESS_Msk (0x1ul << DISP_FrameBufferConfig0_FLIP_IN_PROGRESS_Pos) /*!< DISP_T::FrameBufferConfig0: FLIP_IN_PROGRESS Mask*/ - -#define DISP_FrameBufferConfig0_CLEAR_Pos (8) /*!< DISP_T::FrameBufferConfig0: CLEAR Position*/ -#define DISP_FrameBufferConfig0_CLEAR_Msk (0x1ul << DISP_FrameBufferConfig0_CLEAR_Pos) /*!< DISP_T::FrameBufferConfig0: CLEAR Mask*/ - -#define DISP_FrameBufferConfig0_TRANSPARENCY_Pos (9) /*!< DISP_T::FrameBufferConfig0: TRANSPARENCY Position*/ -#define DISP_FrameBufferConfig0_TRANSPARENCY_Msk (0x3ul << DISP_FrameBufferConfig0_TRANSPARENCY_Pos) /*!< DISP_T::FrameBufferConfig0: TRANSPARENCY Mask*/ - -#define DISP_FrameBufferConfig0_YUV_Pos (14) /*!< DISP_T::FrameBufferConfig0: YUV Position*/ -#define DISP_FrameBufferConfig0_YUV_Msk (0x7ul << DISP_FrameBufferConfig0_YUV_Pos) /*!< DISP_T::FrameBufferConfig0: YUV Mask*/ - -#define DISP_FrameBufferConfig0_SWIZZLE_Pos (23) /*!< DISP_T::FrameBufferConfig0: SWIZZLE Position*/ -#define DISP_FrameBufferConfig0_SWIZZLE_Msk (0x3ul << DISP_FrameBufferConfig0_SWIZZLE_Pos) /*!< DISP_T::FrameBufferConfig0: SWIZZLE Mask*/ - -#define DISP_FrameBufferConfig0_UV_SWIZZLE_Pos (25) /*!< DISP_T::FrameBufferConfig0: UV_SWIZZLE Position*/ -#define DISP_FrameBufferConfig0_UV_SWIZZLE_Msk (0x1ul << DISP_FrameBufferConfig0_UV_SWIZZLE_Pos) /*!< DISP_T::FrameBufferConfig0: UV_SWIZZLE Mask*/ - -#define DISP_FrameBufferConfig0_FORMAT_Pos (26) /*!< DISP_T::FrameBufferConfig0: FORMAT Position*/ -#define DISP_FrameBufferConfig0_FORMAT_Msk (0x3ful << DISP_FrameBufferConfig0_FORMAT_Pos) /*!< DISP_T::FrameBufferConfig0: FORMAT Mask*/ - -#define DISP_FrameBufferBGColor0_BLUE_Pos (0) /*!< DISP_T::FrameBufferBGColor0: BLUE Position*/ -#define DISP_FrameBufferBGColor0_BLUE_Msk (0xfful << DISP_FrameBufferBGColor0_BLUE_Pos) /*!< DISP_T::FrameBufferBGColor0: BLUE Mask*/ - -#define DISP_FrameBufferBGColor0_GREEN_Pos (8) /*!< DISP_T::FrameBufferBGColor0: GREEN Position*/ -#define DISP_FrameBufferBGColor0_GREEN_Msk (0xfful << DISP_FrameBufferBGColor0_GREEN_Pos) /*!< DISP_T::FrameBufferBGColor0: GREEN Mask*/ - -#define DISP_FrameBufferBGColor0_RED_Pos (16) /*!< DISP_T::FrameBufferBGColor0: RED Position*/ -#define DISP_FrameBufferBGColor0_RED_Msk (0xfful << DISP_FrameBufferBGColor0_RED_Pos) /*!< DISP_T::FrameBufferBGColor0: RED Mask*/ - -#define DISP_FrameBufferBGColor0_ALPHA_Pos (24) /*!< DISP_T::FrameBufferBGColor0: ALPHA Position*/ -#define DISP_FrameBufferBGColor0_ALPHA_Msk (0xfful << DISP_FrameBufferBGColor0_ALPHA_Pos) /*!< DISP_T::FrameBufferBGColor0: ALPHA Mask*/ - -#define DISP_FrameBufferUPlanarAddress0_ADDRESS_Pos (0) /*!< DISP_T::FrameBufferUPlanarAddress0: ADDRESS Position*/ -#define DISP_FrameBufferUPlanarAddress0_ADDRESS_Msk (0x7ffffffful << DISP_FrameBufferUPlanarAddress0_ADDRESS_Pos) /*!< DISP_T::FrameBufferUPlanarAddress0: ADDRESS Mask*/ - -#define DISP_FrameBufferUPlanarAddress0_TYPE_Pos (31) /*!< DISP_T::FrameBufferUPlanarAddress0: TYPE Position*/ -#define DISP_FrameBufferUPlanarAddress0_TYPE_Msk (0x1ul << DISP_FrameBufferUPlanarAddress0_TYPE_Pos) /*!< DISP_T::FrameBufferUPlanarAddress0: TYPE Mask*/ - -#define DISP_FrameBufferVPlanarAddress0_ADDRESS_Pos (0) /*!< DISP_T::FrameBufferVPlanarAddress0: ADDRESS Position*/ -#define DISP_FrameBufferVPlanarAddress0_ADDRESS_Msk (0x7ffffffful << DISP_FrameBufferVPlanarAddress0_ADDRESS_Pos) /*!< DISP_T::FrameBufferVPlanarAddress0: ADDRESS Mask*/ - -#define DISP_FrameBufferVPlanarAddress0_TYPE_Pos (31) /*!< DISP_T::FrameBufferVPlanarAddress0: TYPE Position*/ -#define DISP_FrameBufferVPlanarAddress0_TYPE_Msk (0x1ul << DISP_FrameBufferVPlanarAddress0_TYPE_Pos) /*!< DISP_T::FrameBufferVPlanarAddress0: TYPE Mask*/ - -#define DISP_OverlayConfig0_TRANSPARENCY_Pos (0) /*!< DISP_T::OverlayConfig0: TRANSPARENCY Position*/ -#define DISP_OverlayConfig0_TRANSPARENCY_Msk (0x3ul << DISP_OverlayConfig0_TRANSPARENCY_Pos) /*!< DISP_T::OverlayConfig0: TRANSPARENCY Mask*/ - -#define DISP_OverlayConfig0_YUV_Pos (5) /*!< DISP_T::OverlayConfig0: YUV Position*/ -#define DISP_OverlayConfig0_YUV_Msk (0x7ul << DISP_OverlayConfig0_YUV_Pos) /*!< DISP_T::OverlayConfig0: YUV Mask */ - -#define DISP_OverlayConfig0_SWIZZLE_Pos (13) /*!< DISP_T::OverlayConfig0: SWIZZLE Position*/ -#define DISP_OverlayConfig0_SWIZZLE_Msk (0x3ul << DISP_OverlayConfig0_SWIZZLE_Pos) /*!< DISP_T::OverlayConfig0: SWIZZLE Mask*/ - -#define DISP_OverlayConfig0_UV_SWIZZLE_Pos (15) /*!< DISP_T::OverlayConfig0: UV_SWIZZLE Position*/ -#define DISP_OverlayConfig0_UV_SWIZZLE_Msk (0x1ul << DISP_OverlayConfig0_UV_SWIZZLE_Pos) /*!< DISP_T::OverlayConfig0: UV_SWIZZLE Mask*/ - -#define DISP_OverlayConfig0_FORMAT_Pos (16) /*!< DISP_T::OverlayConfig0: FORMAT Position*/ -#define DISP_OverlayConfig0_FORMAT_Msk (0x3ful << DISP_OverlayConfig0_FORMAT_Pos) /*!< DISP_T::OverlayConfig0: FORMAT Mask*/ - -#define DISP_OverlayConfig0_UNDERFLOW_Pos (23) /*!< DISP_T::OverlayConfig0: UNDERFLOW Position*/ -#define DISP_OverlayConfig0_UNDERFLOW_Msk (0x1ul << DISP_OverlayConfig0_UNDERFLOW_Pos) /*!< DISP_T::OverlayConfig0: UNDERFLOW Mask*/ - -#define DISP_OverlayConfig0_ENABLE_Pos (24) /*!< DISP_T::OverlayConfig0: ENABLE Position*/ -#define DISP_OverlayConfig0_ENABLE_Msk (0x1ul << DISP_OverlayConfig0_ENABLE_Pos) /*!< DISP_T::OverlayConfig0: ENABLE Mask*/ - -#define DISP_OverlayConfig0_CLEAR_Pos (25) /*!< DISP_T::OverlayConfig0: CLEAR Position*/ -#define DISP_OverlayConfig0_CLEAR_Msk (0x1ul << DISP_OverlayConfig0_CLEAR_Pos) /*!< DISP_T::OverlayConfig0: CLEAR Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_SRC_ALPHA_MODE_Pos (0) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_ALPHA_MODE Position*/ -#define DISP_OverlayAlphaBlendConfig0_SRC_ALPHA_MODE_Msk (0x1ul << DISP_OverlayAlphaBlendConfig0_SRC_ALPHA_MODE_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_ALPHA_MODE Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_DISABLE_ALPHA_BLEND_Pos (1) /*!< DISP_T::OverlayAlphaBlendConfig0: DISABLE_ALPHA_BLEND Position*/ -#define DISP_OverlayAlphaBlendConfig0_DISABLE_ALPHA_BLEND_Msk (0x1ul << DISP_OverlayAlphaBlendConfig0_DISABLE_ALPHA_BLEND_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: DISABLE_ALPHA_BLEND Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_SRC_GLOBAL_ALPHA_MODE_Pos (3) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_GLOBAL_ALPHA_MODE Position*/ -#define DISP_OverlayAlphaBlendConfig0_SRC_GLOBAL_ALPHA_MODE_Msk (0x3ul << DISP_OverlayAlphaBlendConfig0_SRC_GLOBAL_ALPHA_MODE_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_GLOBAL_ALPHA_MODE Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos (5) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_BLENDING_MODE Position*/ -#define DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Msk (0x7ul << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_BLENDING_MODE Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_SRC_ALPHA_FACTOR_Pos (8) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_ALPHA_FACTOR Position*/ -#define DISP_OverlayAlphaBlendConfig0_SRC_ALPHA_FACTOR_Msk (0x1ul << DISP_OverlayAlphaBlendConfig0_SRC_ALPHA_FACTOR_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: SRC_ALPHA_FACTOR Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_DST_ALPHA_MODE_Pos (9) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_ALPHA_MODE Position*/ -#define DISP_OverlayAlphaBlendConfig0_DST_ALPHA_MODE_Msk (0x1ul << DISP_OverlayAlphaBlendConfig0_DST_ALPHA_MODE_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_ALPHA_MODE Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_DST_GLOBAL_ALPHA_MODE_Pos (10) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_GLOBAL_ALPHA_MODE Position*/ -#define DISP_OverlayAlphaBlendConfig0_DST_GLOBAL_ALPHA_MODE_Msk (0x3ul << DISP_OverlayAlphaBlendConfig0_DST_GLOBAL_ALPHA_MODE_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_GLOBAL_ALPHA_MODE Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos (12) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_BLENDING_MODE Position*/ -#define DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Msk (0x7ul << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_BLENDING_MODE Mask*/ - -#define DISP_OverlayAlphaBlendConfig0_DST_ALPHA_FACTOR_Pos (15) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_ALPHA_FACTOR Position*/ -#define DISP_OverlayAlphaBlendConfig0_DST_ALPHA_FACTOR_Msk (0x1ul << DISP_OverlayAlphaBlendConfig0_DST_ALPHA_FACTOR_Pos) /*!< DISP_T::OverlayAlphaBlendConfig0: DST_ALPHA_FACTOR Mask*/ - -#define DISP_OverlayAddress0_ADDRESS_Pos (0) /*!< DISP_T::OverlayAddress0: ADDRESS Position*/ -#define DISP_OverlayAddress0_ADDRESS_Msk (0x7ffffffful << DISP_OverlayAddress0_ADDRESS_Pos) /*!< DISP_T::OverlayAddress0: ADDRESS Mask*/ - -#define DISP_OverlayAddress0_TYPE_Pos (31) /*!< DISP_T::OverlayAddress0: TYPE Position*/ -#define DISP_OverlayAddress0_TYPE_Msk (0x1ul << DISP_OverlayAddress0_TYPE_Pos) /*!< DISP_T::OverlayAddress0: TYPE Mask*/ - -#define DISP_OverlayStride0_STRIDE_Pos (0) /*!< DISP_T::OverlayStride0: STRIDE Position*/ -#define DISP_OverlayStride0_STRIDE_Msk (0x1fffful << DISP_OverlayStride0_STRIDE_Pos) /*!< DISP_T::OverlayStride0: STRIDE Mask*/ - -#define DISP_OverlayTL0_X_Pos (0) /*!< DISP_T::OverlayTL0: X Position */ -#define DISP_OverlayTL0_X_Msk (0x7ffful << DISP_OverlayTL0_X_Pos) /*!< DISP_T::OverlayTL0: X Mask */ - -#define DISP_OverlayTL0_Y_Pos (15) /*!< DISP_T::OverlayTL0: Y Position */ -#define DISP_OverlayTL0_Y_Msk (0x7ffful << DISP_OverlayTL0_Y_Pos) /*!< DISP_T::OverlayTL0: Y Mask */ - -#define DISP_OverlayBR0_X_Pos (0) /*!< DISP_T::OverlayBR0: X Position */ -#define DISP_OverlayBR0_X_Msk (0x7ffful << DISP_OverlayBR0_X_Pos) /*!< DISP_T::OverlayBR0: X Mask */ - -#define DISP_OverlayBR0_Y_Pos (15) /*!< DISP_T::OverlayBR0: Y Position */ -#define DISP_OverlayBR0_Y_Msk (0x7ffful << DISP_OverlayBR0_Y_Pos) /*!< DISP_T::OverlayBR0: Y Mask */ - -#define DISP_OverlaySrcGlobalColor0_BLUE_Pos (0) /*!< DISP_T::OverlaySrcGlobalColor0: BLUE Position*/ -#define DISP_OverlaySrcGlobalColor0_BLUE_Msk (0xfful << DISP_OverlaySrcGlobalColor0_BLUE_Pos) /*!< DISP_T::OverlaySrcGlobalColor0: BLUE Mask*/ - -#define DISP_OverlaySrcGlobalColor0_GREEN_Pos (8) /*!< DISP_T::OverlaySrcGlobalColor0: GREEN Position*/ -#define DISP_OverlaySrcGlobalColor0_GREEN_Msk (0xfful << DISP_OverlaySrcGlobalColor0_GREEN_Pos) /*!< DISP_T::OverlaySrcGlobalColor0: GREEN Mask*/ - -#define DISP_OverlaySrcGlobalColor0_RED_Pos (16) /*!< DISP_T::OverlaySrcGlobalColor0: RED Position*/ -#define DISP_OverlaySrcGlobalColor0_RED_Msk (0xfful << DISP_OverlaySrcGlobalColor0_RED_Pos) /*!< DISP_T::OverlaySrcGlobalColor0: RED Mask*/ - -#define DISP_OverlaySrcGlobalColor0_ALPHA_Pos (24) /*!< DISP_T::OverlaySrcGlobalColor0: ALPHA Position*/ -#define DISP_OverlaySrcGlobalColor0_ALPHA_Msk (0xfful << DISP_OverlaySrcGlobalColor0_ALPHA_Pos) /*!< DISP_T::OverlaySrcGlobalColor0: ALPHA Mask*/ - -#define DISP_OverlayDstGlobalColor0_BLUE_Pos (0) /*!< DISP_T::OverlayDstGlobalColor0: BLUE Position*/ -#define DISP_OverlayDstGlobalColor0_BLUE_Msk (0xfful << DISP_OverlayDstGlobalColor0_BLUE_Pos) /*!< DISP_T::OverlayDstGlobalColor0: BLUE Mask*/ - -#define DISP_OverlayDstGlobalColor0_GREEN_Pos (8) /*!< DISP_T::OverlayDstGlobalColor0: GREEN Position*/ -#define DISP_OverlayDstGlobalColor0_GREEN_Msk (0xfful << DISP_OverlayDstGlobalColor0_GREEN_Pos) /*!< DISP_T::OverlayDstGlobalColor0: GREEN Mask*/ - -#define DISP_OverlayDstGlobalColor0_RED_Pos (16) /*!< DISP_T::OverlayDstGlobalColor0: RED Position*/ -#define DISP_OverlayDstGlobalColor0_RED_Msk (0xfful << DISP_OverlayDstGlobalColor0_RED_Pos) /*!< DISP_T::OverlayDstGlobalColor0: RED Mask*/ - -#define DISP_OverlayDstGlobalColor0_ALPHA_Pos (24) /*!< DISP_T::OverlayDstGlobalColor0: ALPHA Position*/ -#define DISP_OverlayDstGlobalColor0_ALPHA_Msk (0xfful << DISP_OverlayDstGlobalColor0_ALPHA_Pos) /*!< DISP_T::OverlayDstGlobalColor0: ALPHA Mask*/ - -#define DISP_OverlayColorKey0_BLUE_Pos (0) /*!< DISP_T::OverlayColorKey0: BLUE Position*/ -#define DISP_OverlayColorKey0_BLUE_Msk (0xfful << DISP_OverlayColorKey0_BLUE_Pos) /*!< DISP_T::OverlayColorKey0: BLUE Mask*/ - -#define DISP_OverlayColorKey0_GREEN_Pos (8) /*!< DISP_T::OverlayColorKey0: GREEN Position*/ -#define DISP_OverlayColorKey0_GREEN_Msk (0xfful << DISP_OverlayColorKey0_GREEN_Pos) /*!< DISP_T::OverlayColorKey0: GREEN Mask*/ - -#define DISP_OverlayColorKey0_RED_Pos (16) /*!< DISP_T::OverlayColorKey0: RED Position*/ -#define DISP_OverlayColorKey0_RED_Msk (0xfful << DISP_OverlayColorKey0_RED_Pos) /*!< DISP_T::OverlayColorKey0: RED Mask*/ - -#define DISP_OverlayColorKey0_ALPHA_Pos (24) /*!< DISP_T::OverlayColorKey0: ALPHA Position*/ -#define DISP_OverlayColorKey0_ALPHA_Msk (0xfful << DISP_OverlayColorKey0_ALPHA_Pos) /*!< DISP_T::OverlayColorKey0: ALPHA Mask*/ - -#define DISP_OverlayColorKeyHigh0_BLUE_Pos (0) /*!< DISP_T::OverlayColorKeyHigh0: BLUE Position*/ -#define DISP_OverlayColorKeyHigh0_BLUE_Msk (0xfful << DISP_OverlayColorKeyHigh0_BLUE_Pos) /*!< DISP_T::OverlayColorKeyHigh0: BLUE Mask*/ - -#define DISP_OverlayColorKeyHigh0_GREEN_Pos (8) /*!< DISP_T::OverlayColorKeyHigh0: GREEN Position*/ -#define DISP_OverlayColorKeyHigh0_GREEN_Msk (0xfful << DISP_OverlayColorKeyHigh0_GREEN_Pos) /*!< DISP_T::OverlayColorKeyHigh0: GREEN Mask*/ - -#define DISP_OverlayColorKeyHigh0_RED_Pos (16) /*!< DISP_T::OverlayColorKeyHigh0: RED Position*/ -#define DISP_OverlayColorKeyHigh0_RED_Msk (0xfful << DISP_OverlayColorKeyHigh0_RED_Pos) /*!< DISP_T::OverlayColorKeyHigh0: RED Mask*/ - -#define DISP_OverlayColorKeyHigh0_ALPHA_Pos (24) /*!< DISP_T::OverlayColorKeyHigh0: ALPHA Position*/ -#define DISP_OverlayColorKeyHigh0_ALPHA_Msk (0xfful << DISP_OverlayColorKeyHigh0_ALPHA_Pos) /*!< DISP_T::OverlayColorKeyHigh0: ALPHA Mask*/ - -#define DISP_OverlaySize0_WIDTH_Pos (0) /*!< DISP_T::OverlaySize0: WIDTH Position*/ -#define DISP_OverlaySize0_WIDTH_Msk (0x7ffful << DISP_OverlaySize0_WIDTH_Pos) /*!< DISP_T::OverlaySize0: WIDTH Mask */ - -#define DISP_OverlaySize0_HEIGHT_Pos (15) /*!< DISP_T::OverlaySize0: HEIGHT Position*/ -#define DISP_OverlaySize0_HEIGHT_Msk (0x7ffful << DISP_OverlaySize0_HEIGHT_Pos) /*!< DISP_T::OverlaySize0: HEIGHT Mask */ - -#define DISP_FrameBufferUStride0_STRIDE_Pos (0) /*!< DISP_T::FrameBufferUStride0: STRIDE Position*/ -#define DISP_FrameBufferUStride0_STRIDE_Msk (0x1fffful << DISP_FrameBufferUStride0_STRIDE_Pos) /*!< DISP_T::FrameBufferUStride0: STRIDE Mask*/ - -#define DISP_FrameBufferVStride0_STRIDE_Pos (0) /*!< DISP_T::FrameBufferVStride0: STRIDE Position*/ -#define DISP_FrameBufferVStride0_STRIDE_Msk (0x1fffful << DISP_FrameBufferVStride0_STRIDE_Pos) /*!< DISP_T::FrameBufferVStride0: STRIDE Mask*/ - -#define DISP_FrameBufferSize0_WIDTH_Pos (0) /*!< DISP_T::FrameBufferSize0: WIDTH Position*/ -#define DISP_FrameBufferSize0_WIDTH_Msk (0x7ffful << DISP_FrameBufferSize0_WIDTH_Pos) /*!< DISP_T::FrameBufferSize0: WIDTH Mask*/ - -#define DISP_FrameBufferSize0_HEIGHT_Pos (15) /*!< DISP_T::FrameBufferSize0: HEIGHT Position*/ -#define DISP_FrameBufferSize0_HEIGHT_Msk (0x7ffful << DISP_FrameBufferSize0_HEIGHT_Pos) /*!< DISP_T::FrameBufferSize0: HEIGHT Mask*/ - -#define DISP_IndexColorTableIndex0_INDEX_Pos (0) /*!< DISP_T::IndexColorTableIndex0: INDEX Position*/ -#define DISP_IndexColorTableIndex0_INDEX_Msk (0xfful << DISP_IndexColorTableIndex0_INDEX_Pos) /*!< DISP_T::IndexColorTableIndex0: INDEX Mask*/ - -#define DISP_IndexColorTableData0_BLUE_Pos (0) /*!< DISP_T::IndexColorTableData0: BLUE Position*/ -#define DISP_IndexColorTableData0_BLUE_Msk (0xfful << DISP_IndexColorTableData0_BLUE_Pos) /*!< DISP_T::IndexColorTableData0: BLUE Mask*/ - -#define DISP_IndexColorTableData0_GREEN_Pos (8) /*!< DISP_T::IndexColorTableData0: GREEN Position*/ -#define DISP_IndexColorTableData0_GREEN_Msk (0xfful << DISP_IndexColorTableData0_GREEN_Pos) /*!< DISP_T::IndexColorTableData0: GREEN Mask*/ - -#define DISP_IndexColorTableData0_RED_Pos (16) /*!< DISP_T::IndexColorTableData0: RED Position*/ -#define DISP_IndexColorTableData0_RED_Msk (0xfful << DISP_IndexColorTableData0_RED_Pos) /*!< DISP_T::IndexColorTableData0: RED Mask*/ - -#define DISP_IndexColorTableData0_ALPHA_Pos (24) /*!< DISP_T::IndexColorTableData0: ALPHA Position*/ -#define DISP_IndexColorTableData0_ALPHA_Msk (0xfful << DISP_IndexColorTableData0_ALPHA_Pos) /*!< DISP_T::IndexColorTableData0: ALPHA Mask*/ - -#define DISP_OverlayUPlanarAddress0_ADDRESS_Pos (0) /*!< DISP_T::OverlayUPlanarAddress0: ADDRESS Position*/ -#define DISP_OverlayUPlanarAddress0_ADDRESS_Msk (0x7ffffffful << DISP_OverlayUPlanarAddress0_ADDRESS_Pos) /*!< DISP_T::OverlayUPlanarAddress0: ADDRESS Mask*/ - -#define DISP_OverlayUPlanarAddress0_TYPE_Pos (31) /*!< DISP_T::OverlayUPlanarAddress0: TYPE Position*/ -#define DISP_OverlayUPlanarAddress0_TYPE_Msk (0x1ul << DISP_OverlayUPlanarAddress0_TYPE_Pos) /*!< DISP_T::OverlayUPlanarAddress0: TYPE Mask*/ - -#define DISP_OverlayVPlanarAddress0_ADDRESS_Pos (0) /*!< DISP_T::OverlayVPlanarAddress0: ADDRESS Position*/ -#define DISP_OverlayVPlanarAddress0_ADDRESS_Msk (0x7ffffffful << DISP_OverlayVPlanarAddress0_ADDRESS_Pos) /*!< DISP_T::OverlayVPlanarAddress0: ADDRESS Mask*/ - -#define DISP_OverlayVPlanarAddress0_TYPE_Pos (31) /*!< DISP_T::OverlayVPlanarAddress0: TYPE Position*/ -#define DISP_OverlayVPlanarAddress0_TYPE_Msk (0x1ul << DISP_OverlayVPlanarAddress0_TYPE_Pos) /*!< DISP_T::OverlayVPlanarAddress0: TYPE Mask*/ - -#define DISP_OverlayUStride0_STRIDE_Pos (0) /*!< DISP_T::OverlayUStride0: STRIDE Position*/ -#define DISP_OverlayUStride0_STRIDE_Msk (0x1fffful << DISP_OverlayUStride0_STRIDE_Pos) /*!< DISP_T::OverlayUStride0: STRIDE Mask*/ - -#define DISP_OverlayVStride0_STRIDE_Pos (0) /*!< DISP_T::OverlayVStride0: STRIDE Position*/ -#define DISP_OverlayVStride0_STRIDE_Msk (0x1fffful << DISP_OverlayVStride0_STRIDE_Pos) /*!< DISP_T::OverlayVStride0: STRIDE Mask*/ - -#define DISP_OverlayClearValue0_BLUE_Pos (0) /*!< DISP_T::OverlayClearValue0: BLUE Position*/ -#define DISP_OverlayClearValue0_BLUE_Msk (0xfful << DISP_OverlayClearValue0_BLUE_Pos) /*!< DISP_T::OverlayClearValue0: BLUE Mask*/ - -#define DISP_OverlayClearValue0_GREEN_Pos (8) /*!< DISP_T::OverlayClearValue0: GREEN Position*/ -#define DISP_OverlayClearValue0_GREEN_Msk (0xfful << DISP_OverlayClearValue0_GREEN_Pos) /*!< DISP_T::OverlayClearValue0: GREEN Mask*/ - -#define DISP_OverlayClearValue0_RED_Pos (16) /*!< DISP_T::OverlayClearValue0: RED Position*/ -#define DISP_OverlayClearValue0_RED_Msk (0xfful << DISP_OverlayClearValue0_RED_Pos) /*!< DISP_T::OverlayClearValue0: RED Mask*/ - -#define DISP_OverlayClearValue0_ALPHA_Pos (24) /*!< DISP_T::OverlayClearValue0: ALPHA Position*/ -#define DISP_OverlayClearValue0_ALPHA_Msk (0xfful << DISP_OverlayClearValue0_ALPHA_Pos) /*!< DISP_T::OverlayClearValue0: ALPHA Mask*/ - -#define DISP_OverlayIndexColorTableIndex0_INDEX_Pos (0) /*!< DISP_T::OverlayIndexColorTableIndex0: INDEX Position*/ -#define DISP_OverlayIndexColorTableIndex0_INDEX_Msk (0xfful << DISP_OverlayIndexColorTableIndex0_INDEX_Pos) /*!< DISP_T::OverlayIndexColorTableIndex0: INDEX Mask*/ - -#define DISP_OverlayIndexColorTableData0_BLUE_Pos (0) /*!< DISP_T::OverlayIndexColorTableData0: BLUE Position*/ -#define DISP_OverlayIndexColorTableData0_BLUE_Msk (0xfful << DISP_OverlayIndexColorTableData0_BLUE_Pos) /*!< DISP_T::OverlayIndexColorTableData0: BLUE Mask*/ - -#define DISP_OverlayIndexColorTableData0_GREEN_Pos (8) /*!< DISP_T::OverlayIndexColorTableData0: GREEN Position*/ -#define DISP_OverlayIndexColorTableData0_GREEN_Msk (0xfful << DISP_OverlayIndexColorTableData0_GREEN_Pos) /*!< DISP_T::OverlayIndexColorTableData0: GREEN Mask*/ - -#define DISP_OverlayIndexColorTableData0_RED_Pos (16) /*!< DISP_T::OverlayIndexColorTableData0: RED Position*/ -#define DISP_OverlayIndexColorTableData0_RED_Msk (0xfful << DISP_OverlayIndexColorTableData0_RED_Pos) /*!< DISP_T::OverlayIndexColorTableData0: RED Mask*/ - -#define DISP_OverlayIndexColorTableData0_ALPHA_Pos (24) /*!< DISP_T::OverlayIndexColorTableData0: ALPHA Position*/ -#define DISP_OverlayIndexColorTableData0_ALPHA_Msk (0xfful << DISP_OverlayIndexColorTableData0_ALPHA_Pos) /*!< DISP_T::OverlayIndexColorTableData0: ALPHA Mask*/ - -#define DISP_FrameBufferClearValue0_BLUE_Pos (0) /*!< DISP_T::FrameBufferClearValue0: BLUE Position*/ -#define DISP_FrameBufferClearValue0_BLUE_Msk (0xfful << DISP_FrameBufferClearValue0_BLUE_Pos) /*!< DISP_T::FrameBufferClearValue0: BLUE Mask*/ - -#define DISP_FrameBufferClearValue0_GREEN_Pos (8) /*!< DISP_T::FrameBufferClearValue0: GREEN Position*/ -#define DISP_FrameBufferClearValue0_GREEN_Msk (0xfful << DISP_FrameBufferClearValue0_GREEN_Pos) /*!< DISP_T::FrameBufferClearValue0: GREEN Mask*/ - -#define DISP_FrameBufferClearValue0_RED_Pos (16) /*!< DISP_T::FrameBufferClearValue0: RED Position*/ -#define DISP_FrameBufferClearValue0_RED_Msk (0xfful << DISP_FrameBufferClearValue0_RED_Pos) /*!< DISP_T::FrameBufferClearValue0: RED Mask*/ - -#define DISP_FrameBufferClearValue0_ALPHA_Pos (24) /*!< DISP_T::FrameBufferClearValue0: ALPHA Position*/ -#define DISP_FrameBufferClearValue0_ALPHA_Msk (0xfful << DISP_FrameBufferClearValue0_ALPHA_Pos) /*!< DISP_T::FrameBufferClearValue0: ALPHA Mask*/ - -#define DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_VIDEO_Pos (0) /*!< DISP_T::ModuleClockGatingControl0: DISABLE_MODULE_CLOCK_GATING_VIDEO Position*/ -#define DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_VIDEO_Msk (0x1ul << DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_VIDEO_Pos) /*!< DISP_T::ModuleClockGatingControl0: DISABLE_MODULE_CLOCK_GATING_VIDEO Mask*/ - -#define DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_OVERLAY0_Pos (1) /*!< DISP_T::ModuleClockGatingControl0: DISABLE_MODULE_CLOCK_GATING_OVERLAY0 Position*/ -#define DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_OVERLAY0_Msk (0x1ul << DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_OVERLAY0_Pos) /*!< DISP_T::ModuleClockGatingControl0: DISABLE_MODULE_CLOCK_GATING_OVERLAY0 Mask*/ - -#define DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_WB_FIFO_Pos (9) /*!< DISP_T::ModuleClockGatingControl0: DISABLE_MODULE_CLOCK_GATING_WB_FIFO Position*/ -#define DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_WB_FIFO_Msk (0x1ul << DISP_ModuleClockGatingControl0_DISABLE_MODULE_CLOCK_GATING_WB_FIFO_Pos) /*!< DISP_T::ModuleClockGatingControl0: DISABLE_MODULE_CLOCK_GATING_WB_FIFO Mask*/ - -#define DISP_LatencyCounter0_COUNTER_Pos (0) /*!< DISP_T::LatencyCounter0: COUNTER Position*/ -#define DISP_LatencyCounter0_COUNTER_Msk (0xfffffffful << DISP_LatencyCounter0_COUNTER_Pos) /*!< DISP_T::LatencyCounter0: COUNTER Mask*/ - -#define DISP_Qos0_LOW_Pos (0) /*!< DISP_T::Qos0: LOW Position */ -#define DISP_Qos0_LOW_Msk (0xful << DISP_Qos0_LOW_Pos) /*!< DISP_T::Qos0: LOW Mask */ - -#define DISP_Qos0_HIGH_Pos (4) /*!< DISP_T::Qos0: HIGH Position */ -#define DISP_Qos0_HIGH_Msk (0xful << DISP_Qos0_HIGH_Pos) /*!< DISP_T::Qos0: HIGH Mask */ - -#define DISP_MpuIntfCmd0_REG_DATA_Pos (0) /*!< DISP_T::MpuIntfCmd0: REG_DATA Position*/ -#define DISP_MpuIntfCmd0_REG_DATA_Msk (0xfffful << DISP_MpuIntfCmd0_REG_DATA_Pos) /*!< DISP_T::MpuIntfCmd0: REG_DATA Mask*/ - -#define DISP_MpuIntfCmd0_READ_COUNT_Pos (24) /*!< DISP_T::MpuIntfCmd0: READ_COUNT Position*/ -#define DISP_MpuIntfCmd0_READ_COUNT_Msk (0x7ul << DISP_MpuIntfCmd0_READ_COUNT_Pos) /*!< DISP_T::MpuIntfCmd0: READ_COUNT Mask*/ - -#define DISP_MpuIntfCmd0_START_Pos (29) /*!< DISP_T::MpuIntfCmd0: START Position*/ -#define DISP_MpuIntfCmd0_START_Msk (0x1ul << DISP_MpuIntfCmd0_START_Pos) /*!< DISP_T::MpuIntfCmd0: START Mask */ - -#define DISP_MpuIntfCmd0_CMD_Pos (30) /*!< DISP_T::MpuIntfCmd0: CMD Position */ -#define DISP_MpuIntfCmd0_CMD_Msk (0x3ul << DISP_MpuIntfCmd0_CMD_Pos) /*!< DISP_T::MpuIntfCmd0: CMD Mask */ - -#define DISP_MpuIntfReadPara00_DATA_Pos (0) /*!< DISP_T::MpuIntfReadPara00: DATA Position*/ -#define DISP_MpuIntfReadPara00_DATA_Msk (0x3fffful << DISP_MpuIntfReadPara00_DATA_Pos) /*!< DISP_T::MpuIntfReadPara00: DATA Mask*/ - -#define DISP_MpuIntfReadPara10_DATA_Pos (0) /*!< DISP_T::MpuIntfReadPara10: DATA Position*/ -#define DISP_MpuIntfReadPara10_DATA_Msk (0x3fffful << DISP_MpuIntfReadPara10_DATA_Pos) /*!< DISP_T::MpuIntfReadPara10: DATA Mask*/ - -#define DISP_MpuIntfReadPara20_DATA_Pos (0) /*!< DISP_T::MpuIntfReadPara20: DATA Position*/ -#define DISP_MpuIntfReadPara20_DATA_Msk (0x3fffful << DISP_MpuIntfReadPara20_DATA_Pos) /*!< DISP_T::MpuIntfReadPara20: DATA Mask*/ - -#define DISP_MpuIntfReadPara30_DATA_Pos (0) /*!< DISP_T::MpuIntfReadPara30: DATA Position*/ -#define DISP_MpuIntfReadPara30_DATA_Msk (0x3fffful << DISP_MpuIntfReadPara30_DATA_Pos) /*!< DISP_T::MpuIntfReadPara30: DATA Mask*/ - -#define DISP_MpuIntfReadPara40_DATA_Pos (0) /*!< DISP_T::MpuIntfReadPara40: DATA Position*/ -#define DISP_MpuIntfReadPara40_DATA_Msk (0x3fffful << DISP_MpuIntfReadPara40_DATA_Pos) /*!< DISP_T::MpuIntfReadPara40: DATA Mask*/ - -#define DISP_MpuIntfReadStatus0_DATA_Pos (0) /*!< DISP_T::MpuIntfReadStatus0: DATA Position*/ -#define DISP_MpuIntfReadStatus0_DATA_Msk (0x1ul << DISP_MpuIntfReadStatus0_DATA_Pos) /*!< DISP_T::MpuIntfReadStatus0: DATA Mask*/ - -#define DISP_MpuIntfConfig0_REGISTER_MODE_Pos (0) /*!< DISP_T::MpuIntfConfig0: REGISTER_MODE Position*/ -#define DISP_MpuIntfConfig0_REGISTER_MODE_Msk (0x1ul << DISP_MpuIntfConfig0_REGISTER_MODE_Pos) /*!< DISP_T::MpuIntfConfig0: REGISTER_MODE Mask*/ - -#define DISP_MpuIntfConfig0_DATA_BUS_WIDTH_Pos (1) /*!< DISP_T::MpuIntfConfig0: DATA_BUS_WIDTH Position*/ -#define DISP_MpuIntfConfig0_DATA_BUS_WIDTH_Msk (0x3ul << DISP_MpuIntfConfig0_DATA_BUS_WIDTH_Pos) /*!< DISP_T::MpuIntfConfig0: DATA_BUS_WIDTH Mask*/ - -#define DISP_MpuIntfConfig0_DATA_BUS_MODE_Pos (3) /*!< DISP_T::MpuIntfConfig0: DATA_BUS_MODE Position*/ -#define DISP_MpuIntfConfig0_DATA_BUS_MODE_Msk (0x1ul << DISP_MpuIntfConfig0_DATA_BUS_MODE_Pos) /*!< DISP_T::MpuIntfConfig0: DATA_BUS_MODE Mask*/ - -#define DISP_MpuIntfConfig0_INTERFACE_MODE_Pos (4) /*!< DISP_T::MpuIntfConfig0: INTERFACE_MODE Position*/ -#define DISP_MpuIntfConfig0_INTERFACE_MODE_Msk (0x1ul << DISP_MpuIntfConfig0_INTERFACE_MODE_Pos) /*!< DISP_T::MpuIntfConfig0: INTERFACE_MODE Mask*/ - -#define DISP_MpuIntfConfig0_ENABLE_VSYNC_Pos (5) /*!< DISP_T::MpuIntfConfig0: ENABLE_VSYNC Position*/ -#define DISP_MpuIntfConfig0_ENABLE_VSYNC_Msk (0x1ul << DISP_MpuIntfConfig0_ENABLE_VSYNC_Pos) /*!< DISP_T::MpuIntfConfig0: ENABLE_VSYNC Mask*/ - -#define DISP_MpuIntfConfig0_VSYNC_POLARITY_Pos (6) /*!< DISP_T::MpuIntfConfig0: VSYNC_POLARITY Position*/ -#define DISP_MpuIntfConfig0_VSYNC_POLARITY_Msk (0x1ul << DISP_MpuIntfConfig0_VSYNC_POLARITY_Pos) /*!< DISP_T::MpuIntfConfig0: VSYNC_POLARITY Mask*/ - -#define DISP_MpuIntfConfig0_ENABLE_TE_Pos (7) /*!< DISP_T::MpuIntfConfig0: ENABLE_TE Position*/ -#define DISP_MpuIntfConfig0_ENABLE_TE_Msk (0x1ul << DISP_MpuIntfConfig0_ENABLE_TE_Pos) /*!< DISP_T::MpuIntfConfig0: ENABLE_TE Mask*/ - -#define DISP_MpuIntfConfig0_TE_POLARITY_Pos (8) /*!< DISP_T::MpuIntfConfig0: TE_POLARITY Position*/ -#define DISP_MpuIntfConfig0_TE_POLARITY_Msk (0x1ul << DISP_MpuIntfConfig0_TE_POLARITY_Pos) /*!< DISP_T::MpuIntfConfig0: TE_POLARITY Mask*/ - -#define DISP_MpuIntfConfig0_DCX_POLARITY_Pos (9) /*!< DISP_T::MpuIntfConfig0: DCX_POLARITY Position*/ -#define DISP_MpuIntfConfig0_DCX_POLARITY_Msk (0x1ul << DISP_MpuIntfConfig0_DCX_POLARITY_Pos) /*!< DISP_T::MpuIntfConfig0: DCX_POLARITY Mask*/ - -#define DISP_MpuIntfConfig0_DATA_MODE24_BIT_Pos (10) /*!< DISP_T::MpuIntfConfig0: DATA_MODE24_BIT Position*/ -#define DISP_MpuIntfConfig0_DATA_MODE24_BIT_Msk (0x1ul << DISP_MpuIntfConfig0_DATA_MODE24_BIT_Pos) /*!< DISP_T::MpuIntfConfig0: DATA_MODE24_BIT Mask*/ - -#define DISP_MpuIntfConfig0_INTERFACE_RESET_Pos (11) /*!< DISP_T::MpuIntfConfig0: INTERFACE_RESET Position*/ -#define DISP_MpuIntfConfig0_INTERFACE_RESET_Msk (0x1ul << DISP_MpuIntfConfig0_INTERFACE_RESET_Pos) /*!< DISP_T::MpuIntfConfig0: INTERFACE_RESET Mask*/ - -#define DISP_MpuIntfConfig0_ENABLE_MPU_INTF_Pos (12) /*!< DISP_T::MpuIntfConfig0: ENABLE_MPU_INTF Position*/ -#define DISP_MpuIntfConfig0_ENABLE_MPU_INTF_Msk (0x1ul << DISP_MpuIntfConfig0_ENABLE_MPU_INTF_Pos) /*!< DISP_T::MpuIntfConfig0: ENABLE_MPU_INTF Mask*/ - -#define DISP_MpuIntfFrame0_FRAME_UPDATE_Pos (0) /*!< DISP_T::MpuIntfFrame0: FRAME_UPDATE Position*/ -#define DISP_MpuIntfFrame0_FRAME_UPDATE_Msk (0x1ul << DISP_MpuIntfFrame0_FRAME_UPDATE_Pos) /*!< DISP_T::MpuIntfFrame0: FRAME_UPDATE Mask*/ - -#define DISP_MpuIntfFrame0_DATA_FORMAT_Pos (1) /*!< DISP_T::MpuIntfFrame0: DATA_FORMAT Position*/ -#define DISP_MpuIntfFrame0_DATA_FORMAT_Msk (0x3ul << DISP_MpuIntfFrame0_DATA_FORMAT_Pos) /*!< DISP_T::MpuIntfFrame0: DATA_FORMAT Mask*/ - -#define DISP_MpuIntfFrame0_MPU_WRITE_BACK_Pos (3) /*!< DISP_T::MpuIntfFrame0: MPU_WRITE_BACK Position*/ -#define DISP_MpuIntfFrame0_MPU_WRITE_BACK_Msk (0x1ul << DISP_MpuIntfFrame0_MPU_WRITE_BACK_Pos) /*!< DISP_T::MpuIntfFrame0: MPU_WRITE_BACK Mask*/ - -#define DISP_MpuIntfACWrI800_WR_PERIOD_I80_Pos (0) /*!< DISP_T::MpuIntfACWrI800: WR_PERIOD_I80 Position*/ -#define DISP_MpuIntfACWrI800_WR_PERIOD_I80_Msk (0x3fful << DISP_MpuIntfACWrI800_WR_PERIOD_I80_Pos) /*!< DISP_T::MpuIntfACWrI800: WR_PERIOD_I80 Mask*/ - -#define DISP_MpuIntfACWrI800_WRX_ASSERT_Pos (10) /*!< DISP_T::MpuIntfACWrI800: WRX_ASSERT Position*/ -#define DISP_MpuIntfACWrI800_WRX_ASSERT_Msk (0x3fful << DISP_MpuIntfACWrI800_WRX_ASSERT_Pos) /*!< DISP_T::MpuIntfACWrI800: WRX_ASSERT Mask*/ - -#define DISP_MpuIntfACWrI800_WRX_DE_ASSERT_Pos (20) /*!< DISP_T::MpuIntfACWrI800: WRX_DE_ASSERT Position*/ -#define DISP_MpuIntfACWrI800_WRX_DE_ASSERT_Msk (0x3fful << DISP_MpuIntfACWrI800_WRX_DE_ASSERT_Pos) /*!< DISP_T::MpuIntfACWrI800: WRX_DE_ASSERT Mask*/ - -#define DISP_MpuIntfACRdI800_RD_PERIOD_I80_Pos (0) /*!< DISP_T::MpuIntfACRdI800: RD_PERIOD_I80 Position*/ -#define DISP_MpuIntfACRdI800_RD_PERIOD_I80_Msk (0x3fful << DISP_MpuIntfACRdI800_RD_PERIOD_I80_Pos) /*!< DISP_T::MpuIntfACRdI800: RD_PERIOD_I80 Mask*/ - -#define DISP_MpuIntfACRdI800_RDX_ASSERT_Pos (10) /*!< DISP_T::MpuIntfACRdI800: RDX_ASSERT Position*/ -#define DISP_MpuIntfACRdI800_RDX_ASSERT_Msk (0x3fful << DISP_MpuIntfACRdI800_RDX_ASSERT_Pos) /*!< DISP_T::MpuIntfACRdI800: RDX_ASSERT Mask*/ - -#define DISP_MpuIntfACRdI800_RDX_DE_ASSERT_Pos (20) /*!< DISP_T::MpuIntfACRdI800: RDX_DE_ASSERT Position*/ -#define DISP_MpuIntfACRdI800_RDX_DE_ASSERT_Msk (0x3fful << DISP_MpuIntfACRdI800_RDX_DE_ASSERT_Pos) /*!< DISP_T::MpuIntfACRdI800: RDX_DE_ASSERT Mask*/ - -#define DISP_MpuIntfACWrM680_WR_PERIOD_M68_Pos (0) /*!< DISP_T::MpuIntfACWrM680: WR_PERIOD_M68 Position*/ -#define DISP_MpuIntfACWrM680_WR_PERIOD_M68_Msk (0x3fful << DISP_MpuIntfACWrM680_WR_PERIOD_M68_Pos) /*!< DISP_T::MpuIntfACWrM680: WR_PERIOD_M68 Mask*/ - -#define DISP_MpuIntfACWrM680_WR_EASSERT_Pos (10) /*!< DISP_T::MpuIntfACWrM680: WR_EASSERT Position*/ -#define DISP_MpuIntfACWrM680_WR_EASSERT_Msk (0x3fful << DISP_MpuIntfACWrM680_WR_EASSERT_Pos) /*!< DISP_T::MpuIntfACWrM680: WR_EASSERT Mask*/ - -#define DISP_MpuIntfACWrM680_WR_EDE_ASSERT_Pos (20) /*!< DISP_T::MpuIntfACWrM680: WR_EDE_ASSERT Position*/ -#define DISP_MpuIntfACWrM680_WR_EDE_ASSERT_Msk (0x3fful << DISP_MpuIntfACWrM680_WR_EDE_ASSERT_Pos) /*!< DISP_T::MpuIntfACWrM680: WR_EDE_ASSERT Mask*/ - -#define DISP_MpuIntfACRdM680_RD_PERIOD_I80_Pos (0) /*!< DISP_T::MpuIntfACRdM680: RD_PERIOD_I80 Position*/ -#define DISP_MpuIntfACRdM680_RD_PERIOD_I80_Msk (0x3fful << DISP_MpuIntfACRdM680_RD_PERIOD_I80_Pos) /*!< DISP_T::MpuIntfACRdM680: RD_PERIOD_I80 Mask*/ - -#define DISP_MpuIntfACRdM680_RDX_ASSERT_Pos (10) /*!< DISP_T::MpuIntfACRdM680: RDX_ASSERT Position*/ -#define DISP_MpuIntfACRdM680_RDX_ASSERT_Msk (0x3fful << DISP_MpuIntfACRdM680_RDX_ASSERT_Pos) /*!< DISP_T::MpuIntfACRdM680: RDX_ASSERT Mask*/ - -#define DISP_MpuIntfACRdM680_RDX_DE_ASSERT_Pos (20) /*!< DISP_T::MpuIntfACRdM680: RDX_DE_ASSERT Position*/ -#define DISP_MpuIntfACRdM680_RDX_DE_ASSERT_Msk (0x3fful << DISP_MpuIntfACRdM680_RDX_DE_ASSERT_Pos) /*!< DISP_T::MpuIntfACRdM680: RDX_DE_ASSERT Mask*/ - -#define DISP_MpuIntfACVsyncCSX0_CSX_ASSERT_Pos (0) /*!< DISP_T::MpuIntfACVsyncCSX0: CSX_ASSERT Position*/ -#define DISP_MpuIntfACVsyncCSX0_CSX_ASSERT_Msk (0x3fful << DISP_MpuIntfACVsyncCSX0_CSX_ASSERT_Pos) /*!< DISP_T::MpuIntfACVsyncCSX0: CSX_ASSERT Mask*/ - -/**@}*/ /* DISP_CONST */ -/**@}*/ /* end of DISP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif //__DISP_REG_H__ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/dpm_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/dpm_reg.h deleted file mode 100644 index 3f056d45961..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/dpm_reg.h +++ /dev/null @@ -1,315 +0,0 @@ -/**************************************************************************//** - * @file dpm_reg.h - * @brief DPM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __DPM_REG_H__ -#define __DPM_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Debug Protection Mechanism -------------------------*/ -/** - @addtogroup DPM Debug Protection Mechanism(DPM) - Memory Mapped Structure for DPM Controller -@{ */ - -typedef struct -{ - - - /** - * @var DPM_T::A35SDS - * Offset: 0x10 DPM A35 Secure Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - * @var DPM_T::A35SNDS - * Offset: 0x14 DPM A35 Secure Non-invasive Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - * @var DPM_T::A35NSDS - * Offset: 0x18 DPM A35 Non-secure Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - * @var DPM_T::A35NSNDS - * Offset: 0x1C DPM A35 Non-secure Non-invasive Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - * @var DPM_T::M4DS - * Offset: 0x20 DPM M4 Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - * @var DPM_T::M4NDS - * Offset: 0x24 DPM M4 Non-invasive Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - * @var DPM_T::EXTDS - * Offset: 0x30 DPM External Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - * @var DPM_T::EXTTDS - * Offset: 0x34 DPM External Tracing Debug State Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |REGDEN |Debug State Register Enable Bit - * | | |0 = Set the debug state to CLOSE state when current state is OPEN state. - * | | |1 = Set the debug state to OPEN state when current state is CLOSE state. - * | | |Note: if SINFAEN.SSPCC is set to high. This bit becomes read-only by Non-Secure software - * |[1] |ODIS |Debug State OTP Disable Bit (Read Only) - * | | |Indicate the Disable bit stored in OTP. - * |[2] |OLOCK |Debug State OTP Lock Bit (Read Only) - * | | |Indicate the Lock bit stored in OTP. - * |[31:24] |VCODE |Write Verify Code and Read Verify Code - * | | |Read operation: - * | | |0xA5 = The read access for DPM_CTL is correct. - * | | |Others = The read access for DPM_CTL is incorrect. - * | | |Write operation: - * | | |0x5A = The write verify code, which is needed to do a valid write to DPM_CA35SDS. - * | | |Others = Invalid write verify code. - */ - __I uint32_t RESERVE0[4]; - __IO uint32_t A35SDS; /*!< [0x0010] DPM A35 Secure Debug State Register */ - __IO uint32_t A35SNDS; /*!< [0x0014] DPM A35 Secure Non-invasive Debug State Register */ - __IO uint32_t A35NSDS; /*!< [0x0018] DPM A35 Non-secure Debug State Register */ - __IO uint32_t A35NSNDS; /*!< [0x001c] DPM A35 Non-secure Non-invasive Debug State Register */ - __IO uint32_t M4DS; /*!< [0x0020] DPM M4 Debug State Register */ - __IO uint32_t M4NDS; /*!< [0x0024] DPM M4 Non-invasive Debug State Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t EXTDS; /*!< [0x0030] DPM External Debug State Register */ - __IO uint32_t EXTTDS; /*!< [0x0034] DPM External Tracing Debug State Register */ - -} DPM_T; - -/** - @addtogroup DPM_CONST DPM Bit Field Definition - Constant Definitions for DPM Controller -@{ */ - -#define DPM_A35SDS_REGDEN_Pos (0) /*!< DPM_T::A35SDS: REGDEN Position */ -#define DPM_A35SDS_REGDEN_Msk (0x1ul << DPM_A35SDS_REGDEN_Pos) /*!< DPM_T::A35SDS: REGDEN Mask */ - -#define DPM_A35SDS_ODIS_Pos (1) /*!< DPM_T::A35SDS: ODIS Position */ -#define DPM_A35SDS_ODIS_Msk (0x1ul << DPM_A35SDS_ODIS_Pos) /*!< DPM_T::A35SDS: ODIS Mask */ - -#define DPM_A35SDS_OLOCK_Pos (2) /*!< DPM_T::A35SDS: OLOCK Position */ -#define DPM_A35SDS_OLOCK_Msk (0x1ul << DPM_A35SDS_OLOCK_Pos) /*!< DPM_T::A35SDS: OLOCK Mask */ - -#define DPM_A35SDS_VCODE_Pos (24) /*!< DPM_T::A35SDS: VCODE Position */ -#define DPM_A35SDS_VCODE_Msk (0xfful << DPM_A35SDS_VCODE_Pos) /*!< DPM_T::A35SDS: VCODE Mask */ - -#define DPM_A35SNDS_REGDEN_Pos (0) /*!< DPM_T::A35SNDS: REGDEN Position */ -#define DPM_A35SNDS_REGDEN_Msk (0x1ul << DPM_A35SNDS_REGDEN_Pos) /*!< DPM_T::A35SNDS: REGDEN Mask */ - -#define DPM_A35SNDS_ODIS_Pos (1) /*!< DPM_T::A35SNDS: ODIS Position */ -#define DPM_A35SNDS_ODIS_Msk (0x1ul << DPM_A35SNDS_ODIS_Pos) /*!< DPM_T::A35SNDS: ODIS Mask */ - -#define DPM_A35SNDS_OLOCK_Pos (2) /*!< DPM_T::A35SNDS: OLOCK Position */ -#define DPM_A35SNDS_OLOCK_Msk (0x1ul << DPM_A35SNDS_OLOCK_Pos) /*!< DPM_T::A35SNDS: OLOCK Mask */ - -#define DPM_A35SNDS_VCODE_Pos (24) /*!< DPM_T::A35SNDS: VCODE Position */ -#define DPM_A35SNDS_VCODE_Msk (0xfful << DPM_A35SNDS_VCODE_Pos) /*!< DPM_T::A35SNDS: VCODE Mask */ - -#define DPM_A35NSDS_REGDEN_Pos (0) /*!< DPM_T::A35NSDS: REGDEN Position */ -#define DPM_A35NSDS_REGDEN_Msk (0x1ul << DPM_A35NSDS_REGDEN_Pos) /*!< DPM_T::A35NSDS: REGDEN Mask */ - -#define DPM_A35NSDS_ODIS_Pos (1) /*!< DPM_T::A35NSDS: ODIS Position */ -#define DPM_A35NSDS_ODIS_Msk (0x1ul << DPM_A35NSDS_ODIS_Pos) /*!< DPM_T::A35NSDS: ODIS Mask */ - -#define DPM_A35NSDS_OLOCK_Pos (2) /*!< DPM_T::A35NSDS: OLOCK Position */ -#define DPM_A35NSDS_OLOCK_Msk (0x1ul << DPM_A35NSDS_OLOCK_Pos) /*!< DPM_T::A35NSDS: OLOCK Mask */ - -#define DPM_A35NSDS_VCODE_Pos (24) /*!< DPM_T::A35NSDS: VCODE Position */ -#define DPM_A35NSDS_VCODE_Msk (0xfful << DPM_A35NSDS_VCODE_Pos) /*!< DPM_T::A35NSDS: VCODE Mask */ - -#define DPM_A35NSNDS_REGDEN_Pos (0) /*!< DPM_T::A35NSNDS: REGDEN Position */ -#define DPM_A35NSNDS_REGDEN_Msk (0x1ul << DPM_A35NSNDS_REGDEN_Pos) /*!< DPM_T::A35NSNDS: REGDEN Mask */ - -#define DPM_A35NSNDS_ODIS_Pos (1) /*!< DPM_T::A35NSNDS: ODIS Position */ -#define DPM_A35NSNDS_ODIS_Msk (0x1ul << DPM_A35NSNDS_ODIS_Pos) /*!< DPM_T::A35NSNDS: ODIS Mask */ - -#define DPM_A35NSNDS_OLOCK_Pos (2) /*!< DPM_T::A35NSNDS: OLOCK Position */ -#define DPM_A35NSNDS_OLOCK_Msk (0x1ul << DPM_A35NSNDS_OLOCK_Pos) /*!< DPM_T::A35NSNDS: OLOCK Mask */ - -#define DPM_A35NSNDS_VCODE_Pos (24) /*!< DPM_T::A35NSNDS: VCODE Position */ -#define DPM_A35NSNDS_VCODE_Msk (0xfful << DPM_A35NSNDS_VCODE_Pos) /*!< DPM_T::A35NSNDS: VCODE Mask */ - -#define DPM_M4DS_REGDEN_Pos (0) /*!< DPM_T::M4DS: REGDEN Position */ -#define DPM_M4DS_REGDEN_Msk (0x1ul << DPM_M4DS_REGDEN_Pos) /*!< DPM_T::M4DS: REGDEN Mask */ - -#define DPM_M4DS_ODIS_Pos (1) /*!< DPM_T::M4DS: ODIS Position */ -#define DPM_M4DS_ODIS_Msk (0x1ul << DPM_M4DS_ODIS_Pos) /*!< DPM_T::M4DS: ODIS Mask */ - -#define DPM_M4DS_OLOCK_Pos (2) /*!< DPM_T::M4DS: OLOCK Position */ -#define DPM_M4DS_OLOCK_Msk (0x1ul << DPM_M4DS_OLOCK_Pos) /*!< DPM_T::M4DS: OLOCK Mask */ - -#define DPM_M4DS_VCODE_Pos (24) /*!< DPM_T::M4DS: VCODE Position */ -#define DPM_M4DS_VCODE_Msk (0xfful << DPM_M4DS_VCODE_Pos) /*!< DPM_T::M4DS: VCODE Mask */ - -#define DPM_M4NDS_REGDEN_Pos (0) /*!< DPM_T::M4NDS: REGDEN Position */ -#define DPM_M4NDS_REGDEN_Msk (0x1ul << DPM_M4NDS_REGDEN_Pos) /*!< DPM_T::M4NDS: REGDEN Mask */ - -#define DPM_M4NDS_ODIS_Pos (1) /*!< DPM_T::M4NDS: ODIS Position */ -#define DPM_M4NDS_ODIS_Msk (0x1ul << DPM_M4NDS_ODIS_Pos) /*!< DPM_T::M4NDS: ODIS Mask */ - -#define DPM_M4NDS_OLOCK_Pos (2) /*!< DPM_T::M4NDS: OLOCK Position */ -#define DPM_M4NDS_OLOCK_Msk (0x1ul << DPM_M4NDS_OLOCK_Pos) /*!< DPM_T::M4NDS: OLOCK Mask */ - -#define DPM_M4NDS_VCODE_Pos (24) /*!< DPM_T::M4NDS: VCODE Position */ -#define DPM_M4NDS_VCODE_Msk (0xfful << DPM_M4NDS_VCODE_Pos) /*!< DPM_T::M4NDS: VCODE Mask */ - -#define DPM_EXTDS_REGDEN_Pos (0) /*!< DPM_T::EXTDS: REGDEN Position */ -#define DPM_EXTDS_REGDEN_Msk (0x1ul << DPM_EXTDS_REGDEN_Pos) /*!< DPM_T::EXTDS: REGDEN Mask */ - -#define DPM_EXTDS_ODIS_Pos (1) /*!< DPM_T::EXTDS: ODIS Position */ -#define DPM_EXTDS_ODIS_Msk (0x1ul << DPM_EXTDS_ODIS_Pos) /*!< DPM_T::EXTDS: ODIS Mask */ - -#define DPM_EXTDS_OLOCK_Pos (2) /*!< DPM_T::EXTDS: OLOCK Position */ -#define DPM_EXTDS_OLOCK_Msk (0x1ul << DPM_EXTDS_OLOCK_Pos) /*!< DPM_T::EXTDS: OLOCK Mask */ - -#define DPM_EXTDS_VCODE_Pos (24) /*!< DPM_T::EXTDS: VCODE Position */ -#define DPM_EXTDS_VCODE_Msk (0xfful << DPM_EXTDS_VCODE_Pos) /*!< DPM_T::EXTDS: VCODE Mask */ - -#define DPM_EXTTDS_REGDEN_Pos (0) /*!< DPM_T::EXTTDS: REGDEN Position */ -#define DPM_EXTTDS_REGDEN_Msk (0x1ul << DPM_EXTTDS_REGDEN_Pos) /*!< DPM_T::EXTTDS: REGDEN Mask */ - -#define DPM_EXTTDS_ODIS_Pos (1) /*!< DPM_T::EXTTDS: ODIS Position */ -#define DPM_EXTTDS_ODIS_Msk (0x1ul << DPM_EXTTDS_ODIS_Pos) /*!< DPM_T::EXTTDS: ODIS Mask */ - -#define DPM_EXTTDS_OLOCK_Pos (2) /*!< DPM_T::EXTTDS: OLOCK Position */ -#define DPM_EXTTDS_OLOCK_Msk (0x1ul << DPM_EXTTDS_OLOCK_Pos) /*!< DPM_T::EXTTDS: OLOCK Mask */ - -#define DPM_EXTTDS_VCODE_Pos (24) /*!< DPM_T::EXTTDS: VCODE Position */ -#define DPM_EXTTDS_VCODE_Msk (0xfful << DPM_EXTTDS_VCODE_Pos) /*!< DPM_T::EXTTDS: VCODE Mask */ - -/**@}*/ /* DPM_CONST */ -/**@}*/ /* end of DPM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __DPM_REG_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/eadc_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/eadc_reg.h deleted file mode 100644 index aae9b392396..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/eadc_reg.h +++ /dev/null @@ -1,2278 +0,0 @@ -/**************************************************************************//** - * @file eadc_reg.h - * @brief EADC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EADC_REG_H__ -#define __EADC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EADC Enhanced Analog to Digital Converter(EADC) - Memory Mapped Structure for EADC Controller -@{ */ - -typedef struct -{ - - - /** - * @var EADC_T::DAT0 - * Offset: 0x00 ADC Data Register 0 for Sample Module 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT1 - * Offset: 0x04 ADC Data Register 1 for Sample Module 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT2 - * Offset: 0x08 ADC Data Register 2 for Sample Module 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT3 - * Offset: 0x0C ADC Data Register 3 for Sample Module 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT4 - * Offset: 0x10 ADC Data Register 4 for Sample Module 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT5 - * Offset: 0x14 ADC Data Register 5 for Sample Module 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT6 - * Offset: 0x18 ADC Data Register 6 for Sample Module 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT7 - * Offset: 0x1C ADC Data Register 7 for Sample Module 7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::DAT8 - * Offset: 0x20 ADC Data Register 8 for Sample Module 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Result - * | | |This field contains 12 bits conversion result. - * | | |When DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT[11:0] and zero will be filled in RESULT[15:12]. - * | | |When DMOF (EADC_CTL[9]) set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT[11:0] and signed bits to will be filled in RESULT[15:12]. - * |[16] |OV |Overrun Flag - * | | |If converted data in RESULT[11:0] has not been read before new conversion result is loaded to this register, OV is set to 1. - * | | |0 = Data in RESULT[11:0] is recent conversion result. - * | | |1 = Data in RESULT[11:0] is overwrite. - * | | |Note: It is cleared by hardware after EADC_DAT register is read. - * |[17] |VALID |Valid Flag - * | | |This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DAT register is read. - * | | |0 = Data in RESULT[11:0] bits is not valid. - * | | |1 = Data in RESULT[11:0] bits is valid. - * @var EADC_T::CURDAT - * Offset: 0x4C ADC PDMA Current Transfer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:0] |CURDAT |ADC PDMA Current Transfer Data (Read Only) - * | | |This register is a shadow register of EADC_DATn (n=0~8) for PDMA support. - * @var EADC_T::CTL - * Offset: 0x50 ADC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCEN |ADC Converter Enable Bit - * | | |0 = EADC Disabled. - * | | |1 = EADC Enabled. - * | | |Note: Before starting ADC conversion function, this bit should be set to 1 - * | | |Clear it to 0 to disable ADC converter analog circuit power consumption. - * |[1] |ADCRST |ADC Converter Control Circuits Reset - * | | |0 = No effect. - * | | |1 = Cause ADC control circuits reset to initial state, but not change the ADC registers value. - * | | |Note: ADCRST bit remains 1 during ADC reset, when ADC reset end, the ADCRST bit is automatically cleared to 0. - * |[2] |ADCIEN0 |Specific Sample Module ADC ADINT0 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF0 (EADC_STATUS2[0]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN0 bit is set then conversion end interrupt request ADINT0 is generated. - * | | |0 = Specific sample module ADC ADINT0 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT0 interrupt function Enabled. - * |[3] |ADCIEN1 |Specific Sample Module ADC ADINT1 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF1 (EADC_STATUS2[1]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN1 bit is set then conversion end interrupt request ADINT1 is generated. - * | | |0 = Specific sample module ADC ADINT1 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT1 interrupt function Enabled. - * |[4] |ADCIEN2 |Specific Sample Module ADC ADINT2 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF2 (EADC_STATUS2[2]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN2 bit is set then conversion end interrupt request ADINT2 is generated. - * | | |0 = Specific sample module ADC ADINT2 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT2 interrupt function Enabled. - * |[5] |ADCIEN3 |Specific Sample Module ADC ADINT3 Interrupt Enable Bit - * | | |The ADC converter generates a conversion end ADIF3 (EADC_STATUS2[3]) upon the end of specific sample module ADC conversion - * | | |If ADCIEN3 bit is set then conversion end interrupt request ADINT3 is generated. - * | | |0 = Specific sample module ADC ADINT3 interrupt function Disabled. - * | | |1 = Specific sample module ADC ADINT3 interrupt function Enabled. - * |[7:6] |RES |Resolution (Read Only) - * | | |11 = 12-bit ADC result will be put at RESULT (EADC_DATn[11:0]). - * |[8] |DIFFEN |Differential Analog Input Mode Enable Bit - * | | |0 = Single-end analog input mode. - * | | |1 = Differential analog input mode. - * |[9] |DMOF |ADC Differential Input Mode Output Format - * | | |0 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0], where n= 0 ~ 8) with unsigned format. - * | | |1 = ADC conversion result will be filled in RESULT (EADC_DATn[15:0], where n= 0 ~ 8) with 2'complement format. - * |[11:10] |VREFSEL |Internal Voltage Reference Select Bit - * | | |ADC have internal voltage reference, user can control this bit to select reference voltage for ADC - * | | |00 = 1.6V. - * | | |01 = 2.0V. - * | | |10 = 2.5V (AVDD33 >= 2.8V). - * | | |11 = 3.0V (AVDD33 >= 3.3V). - * |[12] |SPEED |Speed Mode Select Bit - * | | |Control signal for ADC conversion speed - * | | |0 = Low speed mode. - * | | |1 = High speed mode. - * @var EADC_T::SWTRG - * Offset: 0x54 ADC Sample Module Software Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |SWTRG |ADC Sample Module 0~8 Software Force to Start ADC Conversion - * | | |0 = No effect. - * | | |1 = Cause an ADC conversion when the priority is given to sample module. - * | | |Note: After writing this register to start ADC conversion, the EADC_PENDSTS register will show which sample module will conversion - * | | |If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - * @var EADC_T::PENDSTS - * Offset: 0x58 ADC Start of Conversion Pending Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |STPF |ADC Sample Module 0~8 Start of Conversion Pending Flag - * | | |Read Operation: - * | | |0 = There is no pending conversion for sample module. - * | | |1 = Sample module ADC start of conversion is pending. - * | | |Write Operation: - * | | |1 = Clear pending flag & cancel the conversion for sample module. - * | | |Note: This bit remains 1 during pending state - * | | |When the respective ADC conversion is ended, the STPFn (n=0~8) bit is automatically cleared to 0 - * @var EADC_T::OVSTS - * Offset: 0x5C ADC Sample Module Start of Conversion Overrun Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |SPOVF |ADC SAMPLE0~8 Overrun Flag - * | | |0 = No sample module event overrun. - * | | |1 = Indicates a new sample module event is generated while an old one event is pending. - * | | |Note: This bit is cleared by writing 1 to it. - * @var EADC_T::SCTL0 - * Offset: 0x80 ADC Sample Module 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * |[23] |DBMEN |Double Buffer Mode Enable Bit - * | | |0 = Sample has one sample result register (default). - * | | |1 = Sample has two sample result registers. - * @var EADC_T::SCTL1 - * Offset: 0x84 ADC Sample Module 1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * |[23] |DBMEN |Double Buffer Mode Enable Bit - * | | |0 = Sample has one sample result register (default). - * | | |1 = Sample has two sample result registers. - * @var EADC_T::SCTL2 - * Offset: 0x88 ADC Sample Module 2 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * |[23] |DBMEN |Double Buffer Mode Enable Bit - * | | |0 = Sample has one sample result register (default). - * | | |1 = Sample has two sample result registers. - * @var EADC_T::SCTL3 - * Offset: 0x8C ADC Sample Module 3 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * |[23] |DBMEN |Double Buffer Mode Enable Bit - * | | |0 = Sample has one sample result register (default). - * | | |1 = Sample has two sample result registers. - * @var EADC_T::SCTL4 - * Offset: 0x90 ADC Sample Module 4 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * @var EADC_T::SCTL5 - * Offset: 0x94 ADC Sample Module 5 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * @var EADC_T::SCTL6 - * Offset: 0x98 ADC Sample Module 6 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * @var EADC_T::SCTL7 - * Offset: 0x9C ADC Sample Module 7 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CHSEL |ADC Sample Module Channel Selection - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[4] |EXTREN |ADC External Trigger Rising Edge Enable Bit - * | | |0 = Rising edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Rising edge Enabled when ADC selects EADC0_ST as trigger source. - * |[5] |EXTFEN |ADC External Trigger Falling Edge Enable Bit - * | | |0 = Falling edge Disabled when ADC selects EADC0_ST as trigger source. - * | | |1 = Falling edge Enabled when ADC selects EADC0_ST as trigger source. - * |[7:6] |TRGDLYDIV |ADC Sample Module Start of Conversion Trigger Delay Clock Divider Selection - * | | |Trigger delay clock frequency: - * | | |00 = ADC_CLK/1. - * | | |01 = ADC_CLK/2. - * | | |10 = ADC_CLK/4. - * | | |11 = ADC_CLK/16. - * |[15:8] |TRGDLYCNT |ADC Sample Module Start of Conversion Trigger Delay Time - * | | |Trigger delay time = TRGDLYCNT x ADC_CLK period x n (n=1,2,4,16 from TRGDLYDIV setting). - * | | |Note: If TRGDLYCNT is set to 1, trigger delay time is actually the same as TRGDLYCNT is set to 2 for hardware operation. - * |[21:16] |TRGSEL |ADC Sample Module Start of Conversion Trigger Source Selection - * | | |0H = Disable trigger. - * | | |1H = External trigger from EADC0_ST pin input. - * | | |2H = ADC ADINT0 interrupt EOC (End of conversion) pulse trigger. - * | | |3H = ADC ADINT1 interrupt EOC (End of conversion) pulse trigger. - * | | |4H = Timer0 overflow pulse trigger. - * | | |5H = Timer1 overflow pulse trigger. - * | | |6H = Timer2 overflow pulse trigger. - * | | |7H = Timer3 overflow pulse trigger. - * | | |8H = Timer4 overflow pulse trigger. - * | | |9H = Timer5 overflow pulse trigger. - * | | |AH = Timer6 overflow pulse trigger. - * | | |BH = Timer7 overflow pulse trigger. - * | | |CH = Timer8 overflow pulse trigger. - * | | |DH = Timer9 overflow pulse trigger. - * | | |EH = Timer10 overflow pulse trigger. - * | | |FH = Timer11 overflow pulse trigger. - * | | |10H = EPWM0TG0. - * | | |11H = EPWM0TG1. - * | | |12H = EPWM0TG2. - * | | |13H = EPWM0TG3. - * | | |14H = EPWM0TG4. - * | | |15H = EPWM0TG5. - * | | |16H = EPWM1TG0. - * | | |17H = EPWM1TG1. - * | | |18H = EPWM1TG2. - * | | |19H = EPWM1TG3. - * | | |1AH = EPWM1TG4. - * | | |1BH = EPWM1TG5. - * | | |1CH = EPWM2TG0. - * | | |1DH = EPWM2TG1. - * | | |1EH = EPWM2TG2. - * | | |1FH = EPWM2TG3. - * | | |20H = EPWM2TG4. - * | | |21H = EPWM2TG5. - * | | |other = Reserved. - * |[22] |INTPOS |Interrupt Flag Position Select - * | | |0 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC end of conversion. - * | | |1 = Set ADIFn (EADC_STATUS2[n], n=0~3) at ADC start of conversion. - * @var EADC_T::INTSRC0 - * Offset: 0xD0 ADC Interrupt 0 Source Enable Control Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPLIE0 |Sample Module 0 Interrupt Enable Bit - * | | |0 = Sample Module 0 interrupt Disabled. - * | | |1 = Sample Module 0 interrupt Enabled. - * |[1] |SPLIE1 |Sample Module 1 Interrupt Enable Bit - * | | |0 = Sample Module 1 interrupt Disabled. - * | | |1 = Sample Module 1 interrupt Enabled. - * |[2] |SPLIE2 |Sample Module 2 Interrupt Enable Bit - * | | |0 = Sample Module 2 interrupt Disabled. - * | | |1 = Sample Module 2 interrupt Enabled. - * |[3] |SPLIE3 |Sample Module 3 Interrupt Enable Bit - * | | |0 = Sample Module 3 interrupt Disabled. - * | | |1 = Sample Module 3 interrupt Enabled. - * |[4] |SPLIE4 |Sample Module 4 Interrupt Enable Bit - * | | |0 = Sample Module 4 interrupt Disabled. - * | | |1 = Sample Module 4 interrupt Enabled. - * |[5] |SPLIE5 |Sample Module 5 Interrupt Enable Bit - * | | |0 = Sample Module 5 interrupt Disabled. - * | | |1 = Sample Module 5 interrupt Enabled. - * |[6] |SPLIE6 |Sample Module 6 Interrupt Enable Bit - * | | |0 = Sample Module 6 interrupt Disabled. - * | | |1 = Sample Module 6 interrupt Enabled. - * |[7] |SPLIE7 |Sample Module 7 Interrupt Enable Bit - * | | |0 = Sample Module 7 interrupt Disabled. - * | | |1 = Sample Module 7 interrupt Enabled. - * |[8] |SPLIE8 |Sample Module 8 Interrupt Enable Bit - * | | |0 = Sample Module 8 interrupt Disabled. - * | | |1 = Sample Module 8 interrupt Enabled. - * @var EADC_T::INTSRC1 - * Offset: 0xD4 ADC Interrupt 1 Source Enable Control Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPLIE0 |Sample Module 0 Interrupt Enable Bit - * | | |0 = Sample Module 0 interrupt Disabled. - * | | |1 = Sample Module 0 interrupt Enabled. - * |[1] |SPLIE1 |Sample Module 1 Interrupt Enable Bit - * | | |0 = Sample Module 1 interrupt Disabled. - * | | |1 = Sample Module 1 interrupt Enabled. - * |[2] |SPLIE2 |Sample Module 2 Interrupt Enable Bit - * | | |0 = Sample Module 2 interrupt Disabled. - * | | |1 = Sample Module 2 interrupt Enabled. - * |[3] |SPLIE3 |Sample Module 3 Interrupt Enable Bit - * | | |0 = Sample Module 3 interrupt Disabled. - * | | |1 = Sample Module 3 interrupt Enabled. - * |[4] |SPLIE4 |Sample Module 4 Interrupt Enable Bit - * | | |0 = Sample Module 4 interrupt Disabled. - * | | |1 = Sample Module 4 interrupt Enabled. - * |[5] |SPLIE5 |Sample Module 5 Interrupt Enable Bit - * | | |0 = Sample Module 5 interrupt Disabled. - * | | |1 = Sample Module 5 interrupt Enabled. - * |[6] |SPLIE6 |Sample Module 6 Interrupt Enable Bit - * | | |0 = Sample Module 6 interrupt Disabled. - * | | |1 = Sample Module 6 interrupt Enabled. - * |[7] |SPLIE7 |Sample Module 7 Interrupt Enable Bit - * | | |0 = Sample Module 7 interrupt Disabled. - * | | |1 = Sample Module 7 interrupt Enabled. - * |[8] |SPLIE8 |Sample Module 8 Interrupt Enable Bit - * | | |0 = Sample Module 8 interrupt Disabled. - * | | |1 = Sample Module 8 interrupt Enabled. - * @var EADC_T::INTSRC2 - * Offset: 0xD8 ADC Interrupt 2 Source Enable Control Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPLIE0 |Sample Module 0 Interrupt Enable Bit - * | | |0 = Sample Module 0 interrupt Disabled. - * | | |1 = Sample Module 0 interrupt Enabled. - * |[1] |SPLIE1 |Sample Module 1 Interrupt Enable Bit - * | | |0 = Sample Module 1 interrupt Disabled. - * | | |1 = Sample Module 1 interrupt Enabled. - * |[2] |SPLIE2 |Sample Module 2 Interrupt Enable Bit - * | | |0 = Sample Module 2 interrupt Disabled. - * | | |1 = Sample Module 2 interrupt Enabled. - * |[3] |SPLIE3 |Sample Module 3 Interrupt Enable Bit - * | | |0 = Sample Module 3 interrupt Disabled. - * | | |1 = Sample Module 3 interrupt Enabled. - * |[4] |SPLIE4 |Sample Module 4 Interrupt Enable Bit - * | | |0 = Sample Module 4 interrupt Disabled. - * | | |1 = Sample Module 4 interrupt Enabled. - * |[5] |SPLIE5 |Sample Module 5 Interrupt Enable Bit - * | | |0 = Sample Module 5 interrupt Disabled. - * | | |1 = Sample Module 5 interrupt Enabled. - * |[6] |SPLIE6 |Sample Module 6 Interrupt Enable Bit - * | | |0 = Sample Module 6 interrupt Disabled. - * | | |1 = Sample Module 6 interrupt Enabled. - * |[7] |SPLIE7 |Sample Module 7 Interrupt Enable Bit - * | | |0 = Sample Module 7 interrupt Disabled. - * | | |1 = Sample Module 7 interrupt Enabled. - * |[8] |SPLIE8 |Sample Module 8 Interrupt Enable Bit - * | | |0 = Sample Module 8 interrupt Disabled. - * | | |1 = Sample Module 8 interrupt Enabled. - * @var EADC_T::INTSRC3 - * Offset: 0xDC ADC Interrupt 3 Source Enable Control Register. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPLIE0 |Sample Module 0 Interrupt Enable Bit - * | | |0 = Sample Module 0 interrupt Disabled. - * | | |1 = Sample Module 0 interrupt Enabled. - * |[1] |SPLIE1 |Sample Module 1 Interrupt Enable Bit - * | | |0 = Sample Module 1 interrupt Disabled. - * | | |1 = Sample Module 1 interrupt Enabled. - * |[2] |SPLIE2 |Sample Module 2 Interrupt Enable Bit - * | | |0 = Sample Module 2 interrupt Disabled. - * | | |1 = Sample Module 2 interrupt Enabled. - * |[3] |SPLIE3 |Sample Module 3 Interrupt Enable Bit - * | | |0 = Sample Module 3 interrupt Disabled. - * | | |1 = Sample Module 3 interrupt Enabled. - * |[4] |SPLIE4 |Sample Module 4 Interrupt Enable Bit - * | | |0 = Sample Module 4 interrupt Disabled. - * | | |1 = Sample Module 4 interrupt Enabled. - * |[5] |SPLIE5 |Sample Module 5 Interrupt Enable Bit - * | | |0 = Sample Module 5 interrupt Disabled. - * | | |1 = Sample Module 5 interrupt Enabled. - * |[6] |SPLIE6 |Sample Module 6 Interrupt Enable Bit - * | | |0 = Sample Module 6 interrupt Disabled. - * | | |1 = Sample Module 6 interrupt Enabled. - * |[7] |SPLIE7 |Sample Module 7 Interrupt Enable Bit - * | | |0 = Sample Module 7 interrupt Disabled. - * | | |1 = Sample Module 7 interrupt Enabled. - * |[8] |SPLIE8 |Sample Module 8 Interrupt Enable Bit - * | | |0 = Sample Module 8 interrupt Disabled. - * | | |1 = Sample Module 8 interrupt Enabled. - * @var EADC_T::CMP0 - * Offset: 0xE0 ADC Result Compare Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCMPEN |ADC Result Compare Enable Bit - * | | |0 = Compare Disabled. - * | | |1 = Compare Enabled. - * | | |Set this bit to 1 to enable compare CMPDAT (EADC_CMPn[27:16], n=0~3) with specified sample module conversion result when converted data is loaded into EADC_DAT register. - * |[1] |ADCMPIE |ADC Result Compare Interrupt Enable Bit - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, if ADCMPIE is set to 1, a compare interrupt request is generated. - * |[2] |CMPCOND |Compare Condition - * | | |0= Set the compare condition as that when a 12-bit ADC conversion result is less than the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |1= Set the compare condition as that when a 12-bit ADC conversion result is greater or equal to the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |Note: When the internal counter reaches the value to (CMPMCNT (EADC_CMPn[11:8], n=0~3) +1), the CMPF bit will be set. - * |[6:3] |CMPSPL |Compare Sample Module Selection - * | | |00000 = Sample Module 0 conversion result EADC_DAT0 is selected to be compared. - * | | |00001 = Sample Module 1 conversion result EADC_DAT1 is selected to be compared. - * | | |00010 = Sample Module 2 conversion result EADC_DAT2 is selected to be compared. - * | | |00011 = Sample Module 3 conversion result EADC_DAT3 is selected to be compared. - * | | |00100 = Sample Module 4 conversion result EADC_DAT4 is selected to be compared. - * | | |00101 = Sample Module 5 conversion result EADC_DAT5 is selected to be compared. - * | | |00110 = Sample Module 6 conversion result EADC_DAT6 is selected to be compared. - * | | |00111 = Sample Module 7 conversion result EADC_DAT7 is selected to be compared. - * | | |01000 = Sample Module 8 conversion result EADC_DAT8 is selected to be compared. - * |[11:8] |CMPMCNT |Compare Match Count - * | | |When the specified ADC sample module analog conversion result matches the compare condition defined by CMPCOND (EADC_CMPn[2], n=0~3), the internal match counter will increase 1 - * | | |If the compare result does not meet the compare condition, the internal compare match counter will reset to 0 - * | | |When the internal counter reaches the value to (CMPMCNT +1), the ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = ADCMPF0 (EADC_STATUS2[4]) will be set when EADC_CMP0 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when EADC_CMP2 compared condition matched - * | | |1 = ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * | | |Note: This bit is only present in EADC_CMP0 and EADC_CMP2 register. - * |[27:16] |CMPDAT |Comparison Data - * | | |The 12 bits data is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage transition without imposing a load on software. - * @var EADC_T::CMP1 - * Offset: 0xE4 ADC Result Compare Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCMPEN |ADC Result Compare Enable Bit - * | | |0 = Compare Disabled. - * | | |1 = Compare Enabled. - * | | |Set this bit to 1 to enable compare CMPDAT (EADC_CMPn[27:16], n=0~3) with specified sample module conversion result when converted data is loaded into EADC_DAT register. - * |[1] |ADCMPIE |ADC Result Compare Interrupt Enable Bit - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, if ADCMPIE is set to 1, a compare interrupt request is generated. - * |[2] |CMPCOND |Compare Condition - * | | |0= Set the compare condition as that when a 12-bit ADC conversion result is less than the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |1= Set the compare condition as that when a 12-bit ADC conversion result is greater or equal to the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |Note: When the internal counter reaches the value to (CMPMCNT (EADC_CMPn[11:8], n=0~3) +1), the CMPF bit will be set. - * |[6:3] |CMPSPL |Compare Sample Module Selection - * | | |00000 = Sample Module 0 conversion result EADC_DAT0 is selected to be compared. - * | | |00001 = Sample Module 1 conversion result EADC_DAT1 is selected to be compared. - * | | |00010 = Sample Module 2 conversion result EADC_DAT2 is selected to be compared. - * | | |00011 = Sample Module 3 conversion result EADC_DAT3 is selected to be compared. - * | | |00100 = Sample Module 4 conversion result EADC_DAT4 is selected to be compared. - * | | |00101 = Sample Module 5 conversion result EADC_DAT5 is selected to be compared. - * | | |00110 = Sample Module 6 conversion result EADC_DAT6 is selected to be compared. - * | | |00111 = Sample Module 7 conversion result EADC_DAT7 is selected to be compared. - * | | |01000 = Sample Module 8 conversion result EADC_DAT8 is selected to be compared. - * |[11:8] |CMPMCNT |Compare Match Count - * | | |When the specified ADC sample module analog conversion result matches the compare condition defined by CMPCOND (EADC_CMPn[2], n=0~3), the internal match counter will increase 1 - * | | |If the compare result does not meet the compare condition, the internal compare match counter will reset to 0 - * | | |When the internal counter reaches the value to (CMPMCNT +1), the ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = ADCMPF0 (EADC_STATUS2[4]) will be set when EADC_CMP0 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when EADC_CMP2 compared condition matched - * | | |1 = ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * | | |Note: This bit is only present in EADC_CMP0 and EADC_CMP2 register. - * |[27:16] |CMPDAT |Comparison Data - * | | |The 12 bits data is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage transition without imposing a load on software. - * @var EADC_T::CMP2 - * Offset: 0xE8 ADC Result Compare Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCMPEN |ADC Result Compare Enable Bit - * | | |0 = Compare Disabled. - * | | |1 = Compare Enabled. - * | | |Set this bit to 1 to enable compare CMPDAT (EADC_CMPn[27:16], n=0~3) with specified sample module conversion result when converted data is loaded into EADC_DAT register. - * |[1] |ADCMPIE |ADC Result Compare Interrupt Enable Bit - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, if ADCMPIE is set to 1, a compare interrupt request is generated. - * |[2] |CMPCOND |Compare Condition - * | | |0= Set the compare condition as that when a 12-bit ADC conversion result is less than the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |1= Set the compare condition as that when a 12-bit ADC conversion result is greater or equal to the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |Note: When the internal counter reaches the value to (CMPMCNT (EADC_CMPn[11:8], n=0~3) +1), the CMPF bit will be set. - * |[6:3] |CMPSPL |Compare Sample Module Selection - * | | |00000 = Sample Module 0 conversion result EADC_DAT0 is selected to be compared. - * | | |00001 = Sample Module 1 conversion result EADC_DAT1 is selected to be compared. - * | | |00010 = Sample Module 2 conversion result EADC_DAT2 is selected to be compared. - * | | |00011 = Sample Module 3 conversion result EADC_DAT3 is selected to be compared. - * | | |00100 = Sample Module 4 conversion result EADC_DAT4 is selected to be compared. - * | | |00101 = Sample Module 5 conversion result EADC_DAT5 is selected to be compared. - * | | |00110 = Sample Module 6 conversion result EADC_DAT6 is selected to be compared. - * | | |00111 = Sample Module 7 conversion result EADC_DAT7 is selected to be compared. - * | | |01000 = Sample Module 8 conversion result EADC_DAT8 is selected to be compared. - * |[11:8] |CMPMCNT |Compare Match Count - * | | |When the specified ADC sample module analog conversion result matches the compare condition defined by CMPCOND (EADC_CMPn[2], n=0~3), the internal match counter will increase 1 - * | | |If the compare result does not meet the compare condition, the internal compare match counter will reset to 0 - * | | |When the internal counter reaches the value to (CMPMCNT +1), the ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = ADCMPF0 (EADC_STATUS2[4]) will be set when EADC_CMP0 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when EADC_CMP2 compared condition matched - * | | |1 = ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * | | |Note: This bit is only present in EADC_CMP0 and EADC_CMP2 register. - * |[27:16] |CMPDAT |Comparison Data - * | | |The 12 bits data is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage transition without imposing a load on software. - * @var EADC_T::CMP3 - * Offset: 0xEC ADC Result Compare Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADCMPEN |ADC Result Compare Enable Bit - * | | |0 = Compare Disabled. - * | | |1 = Compare Enabled. - * | | |Set this bit to 1 to enable compare CMPDAT (EADC_CMPn[27:16], n=0~3) with specified sample module conversion result when converted data is loaded into EADC_DAT register. - * |[1] |ADCMPIE |ADC Result Compare Interrupt Enable Bit - * | | |0 = Compare function interrupt Disabled. - * | | |1 = Compare function interrupt Enabled. - * | | |If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, if ADCMPIE is set to 1, a compare interrupt request is generated. - * |[2] |CMPCOND |Compare Condition - * | | |0= Set the compare condition as that when a 12-bit ADC conversion result is less than the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |1= Set the compare condition as that when a 12-bit ADC conversion result is greater or equal to the 12-bit CMPDAT (EADC_CMPn [27:16]), the internal match counter will increase one. - * | | |Note: When the internal counter reaches the value to (CMPMCNT (EADC_CMPn[11:8], n=0~3) +1), the CMPF bit will be set. - * |[6:3] |CMPSPL |Compare Sample Module Selection - * | | |00000 = Sample Module 0 conversion result EADC_DAT0 is selected to be compared. - * | | |00001 = Sample Module 1 conversion result EADC_DAT1 is selected to be compared. - * | | |00010 = Sample Module 2 conversion result EADC_DAT2 is selected to be compared. - * | | |00011 = Sample Module 3 conversion result EADC_DAT3 is selected to be compared. - * | | |00100 = Sample Module 4 conversion result EADC_DAT4 is selected to be compared. - * | | |00101 = Sample Module 5 conversion result EADC_DAT5 is selected to be compared. - * | | |00110 = Sample Module 6 conversion result EADC_DAT6 is selected to be compared. - * | | |00111 = Sample Module 7 conversion result EADC_DAT7 is selected to be compared. - * | | |01000 = Sample Module 8 conversion result EADC_DAT8 is selected to be compared. - * |[11:8] |CMPMCNT |Compare Match Count - * | | |When the specified ADC sample module analog conversion result matches the compare condition defined by CMPCOND (EADC_CMPn[2], n=0~3), the internal match counter will increase 1 - * | | |If the compare result does not meet the compare condition, the internal compare match counter will reset to 0 - * | | |When the internal counter reaches the value to (CMPMCNT +1), the ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be set. - * |[15] |CMPWEN |Compare Window Mode Enable Bit - * | | |0 = ADCMPF0 (EADC_STATUS2[4]) will be set when EADC_CMP0 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when EADC_CMP2 compared condition matched - * | | |1 = ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched - * | | |ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * | | |Note: This bit is only present in EADC_CMP0 and EADC_CMP2 register. - * |[27:16] |CMPDAT |Comparison Data - * | | |The 12 bits data is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage transition without imposing a load on software. - * @var EADC_T::STATUS0 - * Offset: 0xF0 ADC Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |VALID |EADC_DAT0~8 Data Valid Flag - * | | |It is a mirror of VALID bit in sample module ADC result data register EADC_DATn. (n=0~8). - * |[24:16] |OV |EADC_DAT0~8 Overrun Flag - * | | |It is a mirror to OV bit in sample module ADC result data register EADC_DATn. (n=0~8). - * @var EADC_T::STATUS2 - * Offset: 0xF8 ADC Status Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADIF0 |ADC ADINT0 Interrupt Flag - * | | |0 = No ADINT0 interrupt pulse received. - * | | |1 = ADINT0 interrupt pulse has been received. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[1] |ADIF1 |ADC ADINT1 Interrupt Flag - * | | |0 = No ADINT1 interrupt pulse received. - * | | |1 = ADINT1 interrupt pulse has been received. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[2] |ADIF2 |ADC ADINT2 Interrupt Flag - * | | |0 = No ADINT2 interrupt pulse received. - * | | |1 = ADINT2 interrupt pulse has been received. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[3] |ADIF3 |ADC ADINT3 Interrupt Flag - * | | |0 = No ADINT3 interrupt pulse received. - * | | |1 = ADINT3 interrupt pulse has been received. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2:This bit indicates whether an ADC conversion of specific sample module has been completed - * |[4] |ADCMPF0 |ADC Compare 0 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP0 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP0 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP0 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[5] |ADCMPF1 |ADC Compare 1 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP1 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP1 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP1 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |ADCMPF2 |ADC Compare 2 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP2 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP2 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP2 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[7] |ADCMPF3 |ADC Compare 3 Flag - * | | |When the specific sample module ADC conversion result meets setting condition in EADC_CMP3 then this bit is set to 1. - * | | |0 = Conversion result in EADC_DAT does not meet EADC_CMP3 register setting. - * | | |1 = Conversion result in EADC_DAT meets EADC_CMP3 register setting. - * | | |Note: This bit is cleared by writing 1 to it. - * |[8] |ADOVIF0 |ADC ADINT0 Interrupt Flag Overrun - * | | |0 = ADINT0 interrupt flag is not overwritten to 1. - * | | |1 = ADINT0 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[9] |ADOVIF1 |ADC ADINT1 Interrupt Flag Overrun - * | | |0 = ADINT1 interrupt flag is not overwritten to 1. - * | | |1 = ADINT1 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[10] |ADOVIF2 |ADC ADINT2 Interrupt Flag Overrun - * | | |0 = ADINT2 interrupt flag is not overwritten to 1. - * | | |1 = ADINT2 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[11] |ADOVIF3 |ADC ADINT3 Interrupt Flag Overrun - * | | |0 = ADINT3 interrupt flag is not overwritten to 1. - * | | |1 = ADINT3 interrupt flag is overwritten to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[12] |ADCMPO0 |ADC Compare 0 Output Status (Read Only) - * | | |The 12 bits compare0 data CMPDAT0 (EADC_CMP0[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT is less than CMPDAT0 setting. - * | | |1 = Conversion result in EADC_DAT is greater than or equal to CMPDAT0 setting. - * |[13] |ADCMPO1 |ADC Compare 1 Output Status (Read Only) - * | | |The 12 bits compare1 data CMPDAT1 (EADC_CMP1[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT is less than CMPDAT1 setting. - * | | |1 = Conversion result in EADC_DAT is greater than or equal to CMPDAT1 setting. - * |[14] |ADCMPO2 |ADC Compare 2 Output Status (Read Only) - * | | |The 12 bits compare2 data CMPDAT2 (EADC_CMP2[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT is less than CMPDAT2 setting. - * | | |1 = Conversion result in EADC_DAT is greater than or equal to CMPDAT2 setting. - * |[15] |ADCMPO3 |ADC Compare 3 Output Status (Read Only) - * | | |The 12 bits compare3 data CMPDAT3 (EADC_CMP3[27:16]) is used to compare with conversion result of specified sample module - * | | |User can use it to monitor the external analog input pin voltage status. - * | | |0 = Conversion result in EADC_DAT is less than CMPDAT3 setting. - * | | |1 = Conversion result in EADC_DAT is greater than or equal to CMPDAT3 setting. - * |[20:16] |CHANNEL |Current Conversion Channel (Read Only) - * | | |This filed reflects ADC current conversion channel when BUSY=1. - * | | |00H = EADC_CH0. - * | | |01H = EADC_CH1. - * | | |02H = EADC_CH2. - * | | |03H = EADC_CH3. - * | | |04H = EADC_CH4. - * | | |05H = EADC_CH5. - * | | |06H = EADC_CH6. - * | | |07H = EADC_CH7. - * | | |08H = VBAT/4. - * |[23] |BUSY |Busy/Idle (Read Only) - * | | |0 = EADC is in idle state. - * | | |1 = EADC is busy at conversion. - * |[24] |ADOVIF |All ADC Interrupt Flag Overrun Bits Check (Read Only) - * | | |n=0~3. - * | | |0 = None of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * | | |1 = Any one of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * | | |Note: This bit will keep 1 when any ADOVIFn Flag is equal to 1. - * |[25] |STOVF |All ADC Sample Module Start of Conversion Overrun Flags Check (Read Only) - * | | |n=0~8. - * | | |0 = None of sample module event overrun flag SPOVF (EADC_OVSTS[n]) is set to 1. - * | | |1 = Any one of sample module event overrun flag SPOVF (EADC_OVSTS[n]) is set to 1. - * | | |Note: This bit will keep 1 when any SPOVF Flag is equal to 1. - * |[26] |AVALID |All Sample Module ADC Result Data Register EADC_DAT Data Valid Flag Check (Read Only) - * | | |n=0~8. - * | | |0 = None of sample module data register valid flag VALID (EADC_DATn[17]) is set to 1. - * | | |1 = Any one of sample module data register valid flag VALID (EADC_DATn[17]) is set to 1. - * | | |Note: This bit will keep 1 when any VALID Flag is equal to 1. - * |[27] |AOV |All Sample Module ADC Result Data Register Overrun Flags Check (Read Only) - * | | |n=0~8. - * | | |0 = None of sample module data register overrun flag OV (EADC_DATn[16]) is set to 1. - * | | |1 = Any one of sample module data register overrun flag OV (EADC_DATn[16]) is set to 1. - * | | |Note: This bit will keep 1 when any OV Flag is equal to 1. - * @var EADC_T::STATUS3 - * Offset: 0xFC ADC Status Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |CURSPL |ADC Current Sample Module (Read Only) - * | | |This register shows the current ADC is controlled by which sample module control logic modules. - * | | |If the ADC is Idle, the bit filed will be set to 0x1F. - * @var EADC_T::DDAT0 - * Offset: 0x100 ADC Double Data Register 0 for Sample Module 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Results - * | | |This field contains 12 bits conversion results. - * | | |When the DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT [11:0] and zero will be filled in RESULT [15:12]. - * | | |When DMOF (EADC_CTL[9]) is set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT [11:0] and signed bits to will be filled in RESULT [15:12]. - * |[16] |OV |Overrun Flag - * | | |0 = Data in RESULT (EADC_DATn[15:0], n=0~3) is recent conversion result. - * | | |1 = Data in RESULT (EADC_DATn[15:0], n=0~3) is overwrite. - * | | |Note: If converted data in RESULT[15:0] has not been read before new conversion result is loaded to this register, OV is set to 1 - * | | |It is cleared by hardware after EADC_DDAT register is read. - * |[17] |VALID |Valid Flag - * | | |0 = Double data in RESULT (EADC_DDATn[15:0]) is not valid. - * | | |1 = Double data in RESULT (EADC_DDATn[15:0]) is valid. - * | | |Note: This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DDATn register is read (n=0~3). - * @var EADC_T::DDAT1 - * Offset: 0x104 ADC Double Data Register 1 for Sample Module 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Results - * | | |This field contains 12 bits conversion results. - * | | |When the DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT [11:0] and zero will be filled in RESULT [15:12]. - * | | |When DMOF (EADC_CTL[9]) is set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT [11:0] and signed bits to will be filled in RESULT [15:12]. - * |[16] |OV |Overrun Flag - * | | |0 = Data in RESULT (EADC_DATn[15:0], n=0~3) is recent conversion result. - * | | |1 = Data in RESULT (EADC_DATn[15:0], n=0~3) is overwrite. - * | | |Note: If converted data in RESULT[15:0] has not been read before new conversion result is loaded to this register, OV is set to 1 - * | | |It is cleared by hardware after EADC_DDAT register is read. - * |[17] |VALID |Valid Flag - * | | |0 = Double data in RESULT (EADC_DDATn[15:0]) is not valid. - * | | |1 = Double data in RESULT (EADC_DDATn[15:0]) is valid. - * | | |Note: This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DDATn register is read (n=0~3). - * @var EADC_T::DDAT2 - * Offset: 0x108 ADC Double Data Register 2 for Sample Module 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Results - * | | |This field contains 12 bits conversion results. - * | | |When the DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT [11:0] and zero will be filled in RESULT [15:12]. - * | | |When DMOF (EADC_CTL[9]) is set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT [11:0] and signed bits to will be filled in RESULT [15:12]. - * |[16] |OV |Overrun Flag - * | | |0 = Data in RESULT (EADC_DATn[15:0], n=0~3) is recent conversion result. - * | | |1 = Data in RESULT (EADC_DATn[15:0], n=0~3) is overwrite. - * | | |Note: If converted data in RESULT[15:0] has not been read before new conversion result is loaded to this register, OV is set to 1 - * | | |It is cleared by hardware after EADC_DDAT register is read. - * |[17] |VALID |Valid Flag - * | | |0 = Double data in RESULT (EADC_DDATn[15:0]) is not valid. - * | | |1 = Double data in RESULT (EADC_DDATn[15:0]) is valid. - * | | |Note: This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DDATn register is read (n=0~3). - * @var EADC_T::DDAT3 - * Offset: 0x10C ADC Double Data Register 3 for Sample Module 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RESULT |ADC Conversion Results - * | | |This field contains 12 bits conversion results. - * | | |When the DMOF (EADC_CTL[9]) is set to 0, 12-bit ADC conversion result with unsigned format will be filled in RESULT [11:0] and zero will be filled in RESULT [15:12]. - * | | |When DMOF (EADC_CTL[9]) is set to 1, 12-bit ADC conversion result with 2's complement format will be filled in RESULT [11:0] and signed bits to will be filled in RESULT [15:12]. - * |[16] |OV |Overrun Flag - * | | |0 = Data in RESULT (EADC_DATn[15:0], n=0~3) is recent conversion result. - * | | |1 = Data in RESULT (EADC_DATn[15:0], n=0~3) is overwrite. - * | | |Note: If converted data in RESULT[15:0] has not been read before new conversion result is loaded to this register, OV is set to 1 - * | | |It is cleared by hardware after EADC_DDAT register is read. - * |[17] |VALID |Valid Flag - * | | |0 = Double data in RESULT (EADC_DDATn[15:0]) is not valid. - * | | |1 = Double data in RESULT (EADC_DDATn[15:0]) is valid. - * | | |Note: This bit is set to 1 when corresponding sample module channel analog input conversion is completed and cleared by hardware after EADC_DDATn register is read (n=0~3). - * @var EADC_T::PWRM - * Offset: 0x110 ADC Power Management Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWUPRDY |ADC Power-up Sequence Completed and Ready for Conversion (Read Only) - * | | |0 = ADC is not ready for conversion may be in power down state or in the progress of start-up. - * | | |1 = ADC is ready for conversion. - * |[1] |PWUCALEN |Power Up Calibration Function Enable Bit - * | | |0 = Calibration function Disabled at power up. - * | | |1 = Calibration function Enabled at power up. - * | | |Note: This bit works together with CALSEL (EADC_CALCTL [3]), see the following - * | | |{PWUCALEN, CALSEL } Description: - * | | |PWUCALEN is 0 and CALSEL is 0: No need to calibrate. - * | | |PWUCALEN is 0 and CALSEL is 1: No need to calibrate. - * | | |PWUCALEN is 1 and CALSEL is 1: Calibrate when power up. - * |[3:2] |PWDMOD |ADC Power-down Mode - * | | |Set this bit field to select ADC Power-down mode when system power-down. - * | | |00 = ADC Deep Power-down mode. - * | | |01 = ADC Power down. - * | | |10 = ADC Standby mode. - * | | |11 = ADC Deep Power-down mode. - * | | |Note: Different PWDMOD has different power down/up sequence; in order to avoid ADC powering up with wrong sequence, user must keep PWMOD consistent each time in power down and start-up - * |[27:8] |IREFSUT |ADC Internal REF Start-up Time - * | | |Set this bit field to control internal reference start-up time - * | | |The typical required internal reference start-up time is 1ms when ADC fully power down - * | | |Internal reference start-up time = (1/ADC_CLK) x IREFSUT. - * | | |Note 1: ADC fully Power-down mode means both ADC macro and internal reference enter Power-down mode. - * | | |Note 2: ADC macro enters Power-down mode when ADCEN(EADC_CTL[0] = 0. - * | | |Note 3: ADC internal reference enters Power-down mode when PDREF(EADC_REFADJCT[0] = 1. - * @var EADC_T::CALCTL - * Offset: 0x114 ADC Calibration Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |CALSTART |Calibration Functional Block Start - * | | |0 = Stop calibration functional block. - * | | |1 = Start calibration functional block. - * | | |Note: This bit is set by software and cleared by hardware after re-calibration is finished. - * |[2] |CALDONE |Calibration Functional Block Complete (Read Only) - * | | |0 = During a calibration. - * | | |1 = Calibration is completed. - * |[3] |CALSEL |Select Calibration Functional Block Enable Bit - * | | |0 = Calibration functional block Disabled. - * | | |1 = Calibration functional block Enabled. - * @var EADC_T::PDMACTL - * Offset: 0x130 ADC PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |PDMATEN |PDMA Transfer Enable Bit - * | | |When EADC conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 8) register, user can enable this bit to generate a PDMA data transfer request. - * | | |0 = PDMA data transfer Disabled. - * | | |1 = PDMA data transfer Enabled. - * | | |Note:When this bit field is set to 1, user must set EADCIENn (EADC_CTL[5:2], n=0~3) = 0 to disable interrupt. - * |[31] |PDMABUSY |PDMA Busy Bit - * | | |When EADC conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 8) register - * | | |User can trigger PDMA to read converted data - * | | |When PDMA is too busy to read converted data, this bit field to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * @var EADC_T::SELSMP0 - * Offset: 0x140 ADC Select Sampling Time Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SELSMP0 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * |[5:4] |SELSMP1 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * |[9:8] |SELSMP2 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * |[13:12] |SELSMP3 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * |[17:16] |SELSMP4 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * |[21:20] |SELSMP5 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * |[25:24] |SELSMP6 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * |[29:28] |SELSMP7 |Channel n Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * @var EADC_T::SELSMP1 - * Offset: 0x144 ADC Select Sampling Time Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SELSMP8 |Channel 8 Select Sampling Time Option - * | | |ADC sampling time selection bit, in case more sampling time is needed when the input signal resistance is higher. - * | | |00 = 3+0 ADC_CLK. - * | | |01 = 3+2 ADC_CLK. - * | | |10 = 3+4 ADC_CLK. - * | | |11 = 3+6 ADC_CLK. - * | | |Note: Please set the same value in all of SELSMPn (n = 0,1..8). - * @var EADC_T::REFADJCTL - * Offset: 0x150 ADC Reference Voltage Adjust Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDREF |ADC Power Down Internal Reference Control Bit - * | | |0 = Normal operating mode. - * | | |1 = Power-down mode. - * | | |Note: If power down internal reference, ADC's reference voltage must come from external VREF. - * |[4:1] |REFADJ |ADC Internal Band-gap Voltage Option - * | | |By setting REFADJ according to the following formula and configuration table, one can adjust reference voltage VREF in a small range: - * | | |VREF = GAIN x VBG. - * | | |GAIN = 1.6, 2.0, 2.5, 3.0(by setting VREFSEL(EADC_CTL[11:10]) = 00, 01, 10, 11 respectively). - * | | |VBG is internal band-gap voltage, typical 1.0V, VBG can be configured by the following: - * | | |0000 = VBG_type. - * | | |0001 = VBG_type + 20 mV. - * | | |0010 = VBG_type + 40 mV. - * | | |0011 = VBG_type + 60 mV. - * | | |0100 = VBG_type + 80 mV. - * | | |0101 = VBG_type + 100 mV. - * | | |0110 = VBG_type + 120 mV. - * | | |0111 = VBG_type + 160 mV. - * | | |1000 = VBG_type - 20 mV. - * | | |1001 = VBG_type - 40 mV. - * | | |1010 = VBG_type - 60 mV. - * | | |1011 = VBG_type - 80 mV. - * | | |1100 = VBG_type - 100 mV. - * | | |1101 = VBG_type - 120 mV. - * | | |1110 = VBG_type - 140 mV. - * | | |1111 = VBG_type - 160 mV. - * | | |Note: VBG_type = 1.0 V. - */ - __I uint32_t DAT[19]; /*!< [0x0000] ADC Data Register 0~18 for Sample Module 0~18 */ - __I uint32_t CURDAT; /*!< [0x004c] ADC PDMA Current Transfer Data Register */ - __IO uint32_t CTL; /*!< [0x0050] ADC Control Register */ - __O uint32_t SWTRG; /*!< [0x0054] ADC Sample Module Software Start Register */ - __IO uint32_t PENDSTS; /*!< [0x0058] ADC Start of Conversion Pending Flag Register */ - __IO uint32_t OVSTS; /*!< [0x005c] ADC Sample Module Start of Conversion Overrun Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[8]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SCTL[19]; /*!< [0x0080] ADC Sample Module 0~18 Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t INTSRC[4]; /*!< [0x00d0] ADC interrupt 0~3 Source Enable Control Register. */ - __IO uint32_t CMP[4]; /*!< [0x00e0] ADC Result Compare Register 0~3 */ - __I uint32_t STATUS0; /*!< [0x00f0] ADC Status Register 0 */ - __I uint32_t STATUS1; /*!< [0x00f4] ADC Status Register 1 */ - __IO uint32_t STATUS2; /*!< [0x00f8] ADC Status Register 2 */ - __I uint32_t STATUS3; /*!< [0x00fc] ADC Status Register 3 */ - __I uint32_t DDAT[4]; /*!< [0x0100] ADC Double Data Register 0~3 for Sample Module 0~3 */ - __IO uint32_t PWRM; /*!< [0x0110] ADC Power Management Register */ - __IO uint32_t CALCTL; /*!< [0x0114] ADC Calibration Control Register */ - __IO uint32_t CALDWRD; /*!< [0x0118] ADC Calibration Load Word Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PDMACTL; /*!< [0x0130] ADC PDMA Control Register */ - __I uint32_t RESERVE5[3]; - __IO uint32_t SELSMP0; /*!< [0x0140] ADC Select Sampling Time Register 0 */ - __IO uint32_t SELSMP1; /*!< [0x0144] ADC Select Sampling Time Register 1 */ - __I uint32_t RESERVE6[2]; - __IO uint32_t REFADJCTL; /*!< [0x0150] ADC Reference Voltage Adjust Control Register */ - -} EADC_T; - -/** - @addtogroup EADC_CONST EADC Bit Field Definition - Constant Definitions for EADC Controller -@{ */ - -#define EADC_DAT_RESULT_Pos (0) /*!< EADC_T::DAT: RESULT Position */ -#define EADC_DAT_RESULT_Msk (0xfffful << EADC_DAT_RESULT_Pos) /*!< EADC_T::DAT: RESULT Mask */ - -#define EADC_DAT_OV_Pos (16) /*!< EADC_T::DAT: OV Position */ -#define EADC_DAT_OV_Msk (0x1ul << EADC_DAT_OV_Pos) /*!< EADC_T::DAT: OV Mask */ - -#define EADC_DAT_VALID_Pos (17) /*!< EADC_T::DAT: VALID Position */ -#define EADC_DAT_VALID_Msk (0x1ul << EADC_DAT_VALID_Pos) /*!< EADC_T::DAT: VALID Mask */ - -#define EADC_DAT0_RESULT_Pos (0) /*!< EADC_T::DAT0: RESULT Position */ -#define EADC_DAT0_RESULT_Msk (0xfffful << EADC_DAT0_RESULT_Pos) /*!< EADC_T::DAT0: RESULT Mask */ - -#define EADC_DAT0_OV_Pos (16) /*!< EADC_T::DAT0: OV Position */ -#define EADC_DAT0_OV_Msk (0x1ul << EADC_DAT0_OV_Pos) /*!< EADC_T::DAT0: OV Mask */ - -#define EADC_DAT0_VALID_Pos (17) /*!< EADC_T::DAT0: VALID Position */ -#define EADC_DAT0_VALID_Msk (0x1ul << EADC_DAT0_VALID_Pos) /*!< EADC_T::DAT0: VALID Mask */ - -#define EADC_DAT1_RESULT_Pos (0) /*!< EADC_T::DAT1: RESULT Position */ -#define EADC_DAT1_RESULT_Msk (0xfffful << EADC_DAT1_RESULT_Pos) /*!< EADC_T::DAT1: RESULT Mask */ - -#define EADC_DAT1_OV_Pos (16) /*!< EADC_T::DAT1: OV Position */ -#define EADC_DAT1_OV_Msk (0x1ul << EADC_DAT1_OV_Pos) /*!< EADC_T::DAT1: OV Mask */ - -#define EADC_DAT1_VALID_Pos (17) /*!< EADC_T::DAT1: VALID Position */ -#define EADC_DAT1_VALID_Msk (0x1ul << EADC_DAT1_VALID_Pos) /*!< EADC_T::DAT1: VALID Mask */ - -#define EADC_DAT2_RESULT_Pos (0) /*!< EADC_T::DAT2: RESULT Position */ -#define EADC_DAT2_RESULT_Msk (0xfffful << EADC_DAT2_RESULT_Pos) /*!< EADC_T::DAT2: RESULT Mask */ - -#define EADC_DAT2_OV_Pos (16) /*!< EADC_T::DAT2: OV Position */ -#define EADC_DAT2_OV_Msk (0x1ul << EADC_DAT2_OV_Pos) /*!< EADC_T::DAT2: OV Mask */ - -#define EADC_DAT2_VALID_Pos (17) /*!< EADC_T::DAT2: VALID Position */ -#define EADC_DAT2_VALID_Msk (0x1ul << EADC_DAT2_VALID_Pos) /*!< EADC_T::DAT2: VALID Mask */ - -#define EADC_DAT3_RESULT_Pos (0) /*!< EADC_T::DAT3: RESULT Position */ -#define EADC_DAT3_RESULT_Msk (0xfffful << EADC_DAT3_RESULT_Pos) /*!< EADC_T::DAT3: RESULT Mask */ - -#define EADC_DAT3_OV_Pos (16) /*!< EADC_T::DAT3: OV Position */ -#define EADC_DAT3_OV_Msk (0x1ul << EADC_DAT3_OV_Pos) /*!< EADC_T::DAT3: OV Mask */ - -#define EADC_DAT3_VALID_Pos (17) /*!< EADC_T::DAT3: VALID Position */ -#define EADC_DAT3_VALID_Msk (0x1ul << EADC_DAT3_VALID_Pos) /*!< EADC_T::DAT3: VALID Mask */ - -#define EADC_DAT4_RESULT_Pos (0) /*!< EADC_T::DAT4: RESULT Position */ -#define EADC_DAT4_RESULT_Msk (0xfffful << EADC_DAT4_RESULT_Pos) /*!< EADC_T::DAT4: RESULT Mask */ - -#define EADC_DAT4_OV_Pos (16) /*!< EADC_T::DAT4: OV Position */ -#define EADC_DAT4_OV_Msk (0x1ul << EADC_DAT4_OV_Pos) /*!< EADC_T::DAT4: OV Mask */ - -#define EADC_DAT4_VALID_Pos (17) /*!< EADC_T::DAT4: VALID Position */ -#define EADC_DAT4_VALID_Msk (0x1ul << EADC_DAT4_VALID_Pos) /*!< EADC_T::DAT4: VALID Mask */ - -#define EADC_DAT5_RESULT_Pos (0) /*!< EADC_T::DAT5: RESULT Position */ -#define EADC_DAT5_RESULT_Msk (0xfffful << EADC_DAT5_RESULT_Pos) /*!< EADC_T::DAT5: RESULT Mask */ - -#define EADC_DAT5_OV_Pos (16) /*!< EADC_T::DAT5: OV Position */ -#define EADC_DAT5_OV_Msk (0x1ul << EADC_DAT5_OV_Pos) /*!< EADC_T::DAT5: OV Mask */ - -#define EADC_DAT5_VALID_Pos (17) /*!< EADC_T::DAT5: VALID Position */ -#define EADC_DAT5_VALID_Msk (0x1ul << EADC_DAT5_VALID_Pos) /*!< EADC_T::DAT5: VALID Mask */ - -#define EADC_DAT6_RESULT_Pos (0) /*!< EADC_T::DAT6: RESULT Position */ -#define EADC_DAT6_RESULT_Msk (0xfffful << EADC_DAT6_RESULT_Pos) /*!< EADC_T::DAT6: RESULT Mask */ - -#define EADC_DAT6_OV_Pos (16) /*!< EADC_T::DAT6: OV Position */ -#define EADC_DAT6_OV_Msk (0x1ul << EADC_DAT6_OV_Pos) /*!< EADC_T::DAT6: OV Mask */ - -#define EADC_DAT6_VALID_Pos (17) /*!< EADC_T::DAT6: VALID Position */ -#define EADC_DAT6_VALID_Msk (0x1ul << EADC_DAT6_VALID_Pos) /*!< EADC_T::DAT6: VALID Mask */ - -#define EADC_DAT7_RESULT_Pos (0) /*!< EADC_T::DAT7: RESULT Position */ -#define EADC_DAT7_RESULT_Msk (0xfffful << EADC_DAT7_RESULT_Pos) /*!< EADC_T::DAT7: RESULT Mask */ - -#define EADC_DAT7_OV_Pos (16) /*!< EADC_T::DAT7: OV Position */ -#define EADC_DAT7_OV_Msk (0x1ul << EADC_DAT7_OV_Pos) /*!< EADC_T::DAT7: OV Mask */ - -#define EADC_DAT7_VALID_Pos (17) /*!< EADC_T::DAT7: VALID Position */ -#define EADC_DAT7_VALID_Msk (0x1ul << EADC_DAT7_VALID_Pos) /*!< EADC_T::DAT7: VALID Mask */ - -#define EADC_DAT8_RESULT_Pos (0) /*!< EADC_T::DAT8: RESULT Position */ -#define EADC_DAT8_RESULT_Msk (0xfffful << EADC_DAT8_RESULT_Pos) /*!< EADC_T::DAT8: RESULT Mask */ - -#define EADC_DAT8_OV_Pos (16) /*!< EADC_T::DAT8: OV Position */ -#define EADC_DAT8_OV_Msk (0x1ul << EADC_DAT8_OV_Pos) /*!< EADC_T::DAT8: OV Mask */ - -#define EADC_DAT8_VALID_Pos (17) /*!< EADC_T::DAT8: VALID Position */ -#define EADC_DAT8_VALID_Msk (0x1ul << EADC_DAT8_VALID_Pos) /*!< EADC_T::DAT8: VALID Mask */ - -#define EADC_CURDAT_CURDAT_Pos (0) /*!< EADC_T::CURDAT: CURDAT Position */ -#define EADC_CURDAT_CURDAT_Msk (0x3fffful << EADC_CURDAT_CURDAT_Pos) /*!< EADC_T::CURDAT: CURDAT Mask */ - -#define EADC_CTL_ADCEN_Pos (0) /*!< EADC_T::CTL: ADCEN Position */ -#define EADC_CTL_ADCEN_Msk (0x1ul << EADC_CTL_ADCEN_Pos) /*!< EADC_T::CTL: ADCEN Mask */ - -#define EADC_CTL_ADCRST_Pos (1) /*!< EADC_T::CTL: ADCRST Position */ -#define EADC_CTL_ADCRST_Msk (0x1ul << EADC_CTL_ADCRST_Pos) /*!< EADC_T::CTL: ADCRST Mask */ - -#define EADC_CTL_ADCIEN0_Pos (2) /*!< EADC_T::CTL: ADCIEN0 Position */ -#define EADC_CTL_ADCIEN0_Msk (0x1ul << EADC_CTL_ADCIEN0_Pos) /*!< EADC_T::CTL: ADCIEN0 Mask */ - -#define EADC_CTL_ADCIEN1_Pos (3) /*!< EADC_T::CTL: ADCIEN1 Position */ -#define EADC_CTL_ADCIEN1_Msk (0x1ul << EADC_CTL_ADCIEN1_Pos) /*!< EADC_T::CTL: ADCIEN1 Mask */ - -#define EADC_CTL_ADCIEN2_Pos (4) /*!< EADC_T::CTL: ADCIEN2 Position */ -#define EADC_CTL_ADCIEN2_Msk (0x1ul << EADC_CTL_ADCIEN2_Pos) /*!< EADC_T::CTL: ADCIEN2 Mask */ - -#define EADC_CTL_ADCIEN3_Pos (5) /*!< EADC_T::CTL: ADCIEN3 Position */ -#define EADC_CTL_ADCIEN3_Msk (0x1ul << EADC_CTL_ADCIEN3_Pos) /*!< EADC_T::CTL: ADCIEN3 Mask */ - -#define EADC_CTL_RES_Pos (6) /*!< EADC_T::CTL: RES Position */ -#define EADC_CTL_RES_Msk (0x3ul << EADC_CTL_RES_Pos) /*!< EADC_T::CTL: RES Mask */ - -#define EADC_CTL_DIFFEN_Pos (8) /*!< EADC_T::CTL: DIFFEN Position */ -#define EADC_CTL_DIFFEN_Msk (0x1ul << EADC_CTL_DIFFEN_Pos) /*!< EADC_T::CTL: DIFFEN Mask */ - -#define EADC_CTL_DMOF_Pos (9) /*!< EADC_T::CTL: DMOF Position */ -#define EADC_CTL_DMOF_Msk (0x1ul << EADC_CTL_DMOF_Pos) /*!< EADC_T::CTL: DMOF Mask */ - -#define EADC_CTL_VREFSEL_Pos (10) /*!< EADC_T::CTL: VREFSEL Position */ -#define EADC_CTL_VREFSEL_Msk (0x3ul << EADC_CTL_VREFSEL_Pos) /*!< EADC_T::CTL: VREFSEL Mask */ - -#define EADC_CTL_SPEED_Pos (12) /*!< EADC_T::CTL: SPEED Position */ -#define EADC_CTL_SPEED_Msk (0x1ul << EADC_CTL_SPEED_Pos) /*!< EADC_T::CTL: SPEED Mask */ - -#define EADC_SWTRG_SWTRG_Pos (0) /*!< EADC_T::SWTRG: SWTRG Position */ -#define EADC_SWTRG_SWTRG_Msk (0x1fful << EADC_SWTRG_SWTRG_Pos) /*!< EADC_T::SWTRG: SWTRG Mask */ - -#define EADC_PENDSTS_STPF_Pos (0) /*!< EADC_T::PENDSTS: STPF Position */ -#define EADC_PENDSTS_STPF_Msk (0x1fful << EADC_PENDSTS_STPF_Pos) /*!< EADC_T::PENDSTS: STPF Mask */ - -#define EADC_OVSTS_SPOVF_Pos (0) /*!< EADC_T::OVSTS: SPOVF Position */ -#define EADC_OVSTS_SPOVF_Msk (0x1fful << EADC_OVSTS_SPOVF_Pos) /*!< EADC_T::OVSTS: SPOVF Mask */ - -#define EADC_SCTL_CHSEL_Pos (0) /*!< EADC_T::SCTL: CHSEL Position */ -#define EADC_SCTL_CHSEL_Msk (0xful << EADC_SCTL_CHSEL_Pos) /*!< EADC_T::SCTL: CHSEL Mask */ - -#define EADC_SCTL_EXTREN_Pos (4) /*!< EADC_T::SCTL: EXTREN Position */ -#define EADC_SCTL_EXTREN_Msk (0x1ul << EADC_SCTL_EXTREN_Pos) /*!< EADC_T::SCTL: EXTREN Mask */ - -#define EADC_SCTL_EXTFEN_Pos (5) /*!< EADC_T::SCTL: EXTFEN Position */ -#define EADC_SCTL_EXTFEN_Msk (0x1ul << EADC_SCTL_EXTFEN_Pos) /*!< EADC_T::SCTL: EXTFEN Mask */ - -#define EADC_SCTL_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL: TRGDLYDIV Position */ -#define EADC_SCTL_TRGDLYDIV_Msk (0x3ul << EADC_SCTL_TRGDLYDIV_Pos) /*!< EADC_T::SCTL: TRGDLYDIV Mask */ - -#define EADC_SCTL_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL: TRGDLYCNT Position */ -#define EADC_SCTL_TRGDLYCNT_Msk (0xfful << EADC_SCTL_TRGDLYCNT_Pos) /*!< EADC_T::SCTL: TRGDLYCNT Mask */ - -#define EADC_SCTL_TRGSEL_Pos (16) /*!< EADC_T::SCTL: TRGSEL Position */ -#define EADC_SCTL_TRGSEL_Msk (0x1ful << EADC_SCTL_TRGSEL_Pos) /*!< EADC_T::SCTL: TRGSEL Mask */ - -#define EADC_SCTL_INTPOS_Pos (22) /*!< EADC_T::SCTL: INTPOS Position */ -#define EADC_SCTL_INTPOS_Msk (0x1ul << EADC_SCTL_INTPOS_Pos) /*!< EADC_T::SCTL: INTPOS Mask */ - -#define EADC_SCTL_DBMEN_Pos (23) /*!< EADC_T::SCTL: DBMEN Position */ -#define EADC_SCTL_DBMEN_Msk (0x1ul << EADC_SCTL_DBMEN_Pos) /*!< EADC_T::SCTL: DBMEN Mask */ - -#define EADC_SCTL_EXTSMPT_Pos (24) /*!< EADC_T::SCTL: EXTSMPT Position */ -#define EADC_SCTL_EXTSMPT_Msk (0xfful << EADC_SCTL_EXTSMPT_Pos) /*!< EADC_T::SCTL: EXTSMPT Mask */ - -#define EADC_SCTL0_CHSEL_Pos (0) /*!< EADC_T::SCTL0: CHSEL Position */ -#define EADC_SCTL0_CHSEL_Msk (0xful << EADC_SCTL0_CHSEL_Pos) /*!< EADC_T::SCTL0: CHSEL Mask */ - -#define EADC_SCTL0_EXTREN_Pos (4) /*!< EADC_T::SCTL0: EXTREN Position */ -#define EADC_SCTL0_EXTREN_Msk (0x1ul << EADC_SCTL0_EXTREN_Pos) /*!< EADC_T::SCTL0: EXTREN Mask */ - -#define EADC_SCTL0_EXTFEN_Pos (5) /*!< EADC_T::SCTL0: EXTFEN Position */ -#define EADC_SCTL0_EXTFEN_Msk (0x1ul << EADC_SCTL0_EXTFEN_Pos) /*!< EADC_T::SCTL0: EXTFEN Mask */ - -#define EADC_SCTL0_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL0: TRGDLYDIV Position */ -#define EADC_SCTL0_TRGDLYDIV_Msk (0x3ul << EADC_SCTL0_TRGDLYDIV_Pos) /*!< EADC_T::SCTL0: TRGDLYDIV Mask */ - -#define EADC_SCTL0_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL0: TRGDLYCNT Position */ -#define EADC_SCTL0_TRGDLYCNT_Msk (0xfful << EADC_SCTL0_TRGDLYCNT_Pos) /*!< EADC_T::SCTL0: TRGDLYCNT Mask */ - -#define EADC_SCTL0_TRGSEL_Pos (16) /*!< EADC_T::SCTL0: TRGSEL Position */ -#define EADC_SCTL0_TRGSEL_Msk (0x3ful << EADC_SCTL0_TRGSEL_Pos) /*!< EADC_T::SCTL0: TRGSEL Mask */ - -#define EADC_SCTL0_INTPOS_Pos (22) /*!< EADC_T::SCTL0: INTPOS Position */ -#define EADC_SCTL0_INTPOS_Msk (0x1ul << EADC_SCTL0_INTPOS_Pos) /*!< EADC_T::SCTL0: INTPOS Mask */ - -#define EADC_SCTL0_DBMEN_Pos (23) /*!< EADC_T::SCTL0: DBMEN Position */ -#define EADC_SCTL0_DBMEN_Msk (0x1ul << EADC_SCTL0_DBMEN_Pos) /*!< EADC_T::SCTL0: DBMEN Mask */ - -#define EADC_SCTL1_CHSEL_Pos (0) /*!< EADC_T::SCTL1: CHSEL Position */ -#define EADC_SCTL1_CHSEL_Msk (0xful << EADC_SCTL1_CHSEL_Pos) /*!< EADC_T::SCTL1: CHSEL Mask */ - -#define EADC_SCTL1_EXTREN_Pos (4) /*!< EADC_T::SCTL1: EXTREN Position */ -#define EADC_SCTL1_EXTREN_Msk (0x1ul << EADC_SCTL1_EXTREN_Pos) /*!< EADC_T::SCTL1: EXTREN Mask */ - -#define EADC_SCTL1_EXTFEN_Pos (5) /*!< EADC_T::SCTL1: EXTFEN Position */ -#define EADC_SCTL1_EXTFEN_Msk (0x1ul << EADC_SCTL1_EXTFEN_Pos) /*!< EADC_T::SCTL1: EXTFEN Mask */ - -#define EADC_SCTL1_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL1: TRGDLYDIV Position */ -#define EADC_SCTL1_TRGDLYDIV_Msk (0x3ul << EADC_SCTL1_TRGDLYDIV_Pos) /*!< EADC_T::SCTL1: TRGDLYDIV Mask */ - -#define EADC_SCTL1_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL1: TRGDLYCNT Position */ -#define EADC_SCTL1_TRGDLYCNT_Msk (0xfful << EADC_SCTL1_TRGDLYCNT_Pos) /*!< EADC_T::SCTL1: TRGDLYCNT Mask */ - -#define EADC_SCTL1_TRGSEL_Pos (16) /*!< EADC_T::SCTL1: TRGSEL Position */ -#define EADC_SCTL1_TRGSEL_Msk (0x3ful << EADC_SCTL1_TRGSEL_Pos) /*!< EADC_T::SCTL1: TRGSEL Mask */ - -#define EADC_SCTL1_INTPOS_Pos (22) /*!< EADC_T::SCTL1: INTPOS Position */ -#define EADC_SCTL1_INTPOS_Msk (0x1ul << EADC_SCTL1_INTPOS_Pos) /*!< EADC_T::SCTL1: INTPOS Mask */ - -#define EADC_SCTL1_DBMEN_Pos (23) /*!< EADC_T::SCTL1: DBMEN Position */ -#define EADC_SCTL1_DBMEN_Msk (0x1ul << EADC_SCTL1_DBMEN_Pos) /*!< EADC_T::SCTL1: DBMEN Mask */ - -#define EADC_SCTL2_CHSEL_Pos (0) /*!< EADC_T::SCTL2: CHSEL Position */ -#define EADC_SCTL2_CHSEL_Msk (0xful << EADC_SCTL2_CHSEL_Pos) /*!< EADC_T::SCTL2: CHSEL Mask */ - -#define EADC_SCTL2_EXTREN_Pos (4) /*!< EADC_T::SCTL2: EXTREN Position */ -#define EADC_SCTL2_EXTREN_Msk (0x1ul << EADC_SCTL2_EXTREN_Pos) /*!< EADC_T::SCTL2: EXTREN Mask */ - -#define EADC_SCTL2_EXTFEN_Pos (5) /*!< EADC_T::SCTL2: EXTFEN Position */ -#define EADC_SCTL2_EXTFEN_Msk (0x1ul << EADC_SCTL2_EXTFEN_Pos) /*!< EADC_T::SCTL2: EXTFEN Mask */ - -#define EADC_SCTL2_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL2: TRGDLYDIV Position */ -#define EADC_SCTL2_TRGDLYDIV_Msk (0x3ul << EADC_SCTL2_TRGDLYDIV_Pos) /*!< EADC_T::SCTL2: TRGDLYDIV Mask */ - -#define EADC_SCTL2_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL2: TRGDLYCNT Position */ -#define EADC_SCTL2_TRGDLYCNT_Msk (0xfful << EADC_SCTL2_TRGDLYCNT_Pos) /*!< EADC_T::SCTL2: TRGDLYCNT Mask */ - -#define EADC_SCTL2_TRGSEL_Pos (16) /*!< EADC_T::SCTL2: TRGSEL Position */ -#define EADC_SCTL2_TRGSEL_Msk (0x3ful << EADC_SCTL2_TRGSEL_Pos) /*!< EADC_T::SCTL2: TRGSEL Mask */ - -#define EADC_SCTL2_INTPOS_Pos (22) /*!< EADC_T::SCTL2: INTPOS Position */ -#define EADC_SCTL2_INTPOS_Msk (0x1ul << EADC_SCTL2_INTPOS_Pos) /*!< EADC_T::SCTL2: INTPOS Mask */ - -#define EADC_SCTL2_DBMEN_Pos (23) /*!< EADC_T::SCTL2: DBMEN Position */ -#define EADC_SCTL2_DBMEN_Msk (0x1ul << EADC_SCTL2_DBMEN_Pos) /*!< EADC_T::SCTL2: DBMEN Mask */ - -#define EADC_SCTL3_CHSEL_Pos (0) /*!< EADC_T::SCTL3: CHSEL Position */ -#define EADC_SCTL3_CHSEL_Msk (0xful << EADC_SCTL3_CHSEL_Pos) /*!< EADC_T::SCTL3: CHSEL Mask */ - -#define EADC_SCTL3_EXTREN_Pos (4) /*!< EADC_T::SCTL3: EXTREN Position */ -#define EADC_SCTL3_EXTREN_Msk (0x1ul << EADC_SCTL3_EXTREN_Pos) /*!< EADC_T::SCTL3: EXTREN Mask */ - -#define EADC_SCTL3_EXTFEN_Pos (5) /*!< EADC_T::SCTL3: EXTFEN Position */ -#define EADC_SCTL3_EXTFEN_Msk (0x1ul << EADC_SCTL3_EXTFEN_Pos) /*!< EADC_T::SCTL3: EXTFEN Mask */ - -#define EADC_SCTL3_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL3: TRGDLYDIV Position */ -#define EADC_SCTL3_TRGDLYDIV_Msk (0x3ul << EADC_SCTL3_TRGDLYDIV_Pos) /*!< EADC_T::SCTL3: TRGDLYDIV Mask */ - -#define EADC_SCTL3_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL3: TRGDLYCNT Position */ -#define EADC_SCTL3_TRGDLYCNT_Msk (0xfful << EADC_SCTL3_TRGDLYCNT_Pos) /*!< EADC_T::SCTL3: TRGDLYCNT Mask */ - -#define EADC_SCTL3_TRGSEL_Pos (16) /*!< EADC_T::SCTL3: TRGSEL Position */ -#define EADC_SCTL3_TRGSEL_Msk (0x3ful << EADC_SCTL3_TRGSEL_Pos) /*!< EADC_T::SCTL3: TRGSEL Mask */ - -#define EADC_SCTL3_INTPOS_Pos (22) /*!< EADC_T::SCTL3: INTPOS Position */ -#define EADC_SCTL3_INTPOS_Msk (0x1ul << EADC_SCTL3_INTPOS_Pos) /*!< EADC_T::SCTL3: INTPOS Mask */ - -#define EADC_SCTL3_DBMEN_Pos (23) /*!< EADC_T::SCTL3: DBMEN Position */ -#define EADC_SCTL3_DBMEN_Msk (0x1ul << EADC_SCTL3_DBMEN_Pos) /*!< EADC_T::SCTL3: DBMEN Mask */ - -#define EADC_SCTL4_CHSEL_Pos (0) /*!< EADC_T::SCTL4: CHSEL Position */ -#define EADC_SCTL4_CHSEL_Msk (0xful << EADC_SCTL4_CHSEL_Pos) /*!< EADC_T::SCTL4: CHSEL Mask */ - -#define EADC_SCTL4_EXTREN_Pos (4) /*!< EADC_T::SCTL4: EXTREN Position */ -#define EADC_SCTL4_EXTREN_Msk (0x1ul << EADC_SCTL4_EXTREN_Pos) /*!< EADC_T::SCTL4: EXTREN Mask */ - -#define EADC_SCTL4_EXTFEN_Pos (5) /*!< EADC_T::SCTL4: EXTFEN Position */ -#define EADC_SCTL4_EXTFEN_Msk (0x1ul << EADC_SCTL4_EXTFEN_Pos) /*!< EADC_T::SCTL4: EXTFEN Mask */ - -#define EADC_SCTL4_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL4: TRGDLYDIV Position */ -#define EADC_SCTL4_TRGDLYDIV_Msk (0x3ul << EADC_SCTL4_TRGDLYDIV_Pos) /*!< EADC_T::SCTL4: TRGDLYDIV Mask */ - -#define EADC_SCTL4_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL4: TRGDLYCNT Position */ -#define EADC_SCTL4_TRGDLYCNT_Msk (0xfful << EADC_SCTL4_TRGDLYCNT_Pos) /*!< EADC_T::SCTL4: TRGDLYCNT Mask */ - -#define EADC_SCTL4_TRGSEL_Pos (16) /*!< EADC_T::SCTL4: TRGSEL Position */ -#define EADC_SCTL4_TRGSEL_Msk (0x3ful << EADC_SCTL4_TRGSEL_Pos) /*!< EADC_T::SCTL4: TRGSEL Mask */ - -#define EADC_SCTL4_INTPOS_Pos (22) /*!< EADC_T::SCTL4: INTPOS Position */ -#define EADC_SCTL4_INTPOS_Msk (0x1ul << EADC_SCTL4_INTPOS_Pos) /*!< EADC_T::SCTL4: INTPOS Mask */ - -#define EADC_SCTL5_CHSEL_Pos (0) /*!< EADC_T::SCTL5: CHSEL Position */ -#define EADC_SCTL5_CHSEL_Msk (0xful << EADC_SCTL5_CHSEL_Pos) /*!< EADC_T::SCTL5: CHSEL Mask */ - -#define EADC_SCTL5_EXTREN_Pos (4) /*!< EADC_T::SCTL5: EXTREN Position */ -#define EADC_SCTL5_EXTREN_Msk (0x1ul << EADC_SCTL5_EXTREN_Pos) /*!< EADC_T::SCTL5: EXTREN Mask */ - -#define EADC_SCTL5_EXTFEN_Pos (5) /*!< EADC_T::SCTL5: EXTFEN Position */ -#define EADC_SCTL5_EXTFEN_Msk (0x1ul << EADC_SCTL5_EXTFEN_Pos) /*!< EADC_T::SCTL5: EXTFEN Mask */ - -#define EADC_SCTL5_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL5: TRGDLYDIV Position */ -#define EADC_SCTL5_TRGDLYDIV_Msk (0x3ul << EADC_SCTL5_TRGDLYDIV_Pos) /*!< EADC_T::SCTL5: TRGDLYDIV Mask */ - -#define EADC_SCTL5_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL5: TRGDLYCNT Position */ -#define EADC_SCTL5_TRGDLYCNT_Msk (0xfful << EADC_SCTL5_TRGDLYCNT_Pos) /*!< EADC_T::SCTL5: TRGDLYCNT Mask */ - -#define EADC_SCTL5_TRGSEL_Pos (16) /*!< EADC_T::SCTL5: TRGSEL Position */ -#define EADC_SCTL5_TRGSEL_Msk (0x3ful << EADC_SCTL5_TRGSEL_Pos) /*!< EADC_T::SCTL5: TRGSEL Mask */ - -#define EADC_SCTL5_INTPOS_Pos (22) /*!< EADC_T::SCTL5: INTPOS Position */ -#define EADC_SCTL5_INTPOS_Msk (0x1ul << EADC_SCTL5_INTPOS_Pos) /*!< EADC_T::SCTL5: INTPOS Mask */ - -#define EADC_SCTL6_CHSEL_Pos (0) /*!< EADC_T::SCTL6: CHSEL Position */ -#define EADC_SCTL6_CHSEL_Msk (0xful << EADC_SCTL6_CHSEL_Pos) /*!< EADC_T::SCTL6: CHSEL Mask */ - -#define EADC_SCTL6_EXTREN_Pos (4) /*!< EADC_T::SCTL6: EXTREN Position */ -#define EADC_SCTL6_EXTREN_Msk (0x1ul << EADC_SCTL6_EXTREN_Pos) /*!< EADC_T::SCTL6: EXTREN Mask */ - -#define EADC_SCTL6_EXTFEN_Pos (5) /*!< EADC_T::SCTL6: EXTFEN Position */ -#define EADC_SCTL6_EXTFEN_Msk (0x1ul << EADC_SCTL6_EXTFEN_Pos) /*!< EADC_T::SCTL6: EXTFEN Mask */ - -#define EADC_SCTL6_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL6: TRGDLYDIV Position */ -#define EADC_SCTL6_TRGDLYDIV_Msk (0x3ul << EADC_SCTL6_TRGDLYDIV_Pos) /*!< EADC_T::SCTL6: TRGDLYDIV Mask */ - -#define EADC_SCTL6_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL6: TRGDLYCNT Position */ -#define EADC_SCTL6_TRGDLYCNT_Msk (0xfful << EADC_SCTL6_TRGDLYCNT_Pos) /*!< EADC_T::SCTL6: TRGDLYCNT Mask */ - -#define EADC_SCTL6_TRGSEL_Pos (16) /*!< EADC_T::SCTL6: TRGSEL Position */ -#define EADC_SCTL6_TRGSEL_Msk (0x3ful << EADC_SCTL6_TRGSEL_Pos) /*!< EADC_T::SCTL6: TRGSEL Mask */ - -#define EADC_SCTL6_INTPOS_Pos (22) /*!< EADC_T::SCTL6: INTPOS Position */ -#define EADC_SCTL6_INTPOS_Msk (0x1ul << EADC_SCTL6_INTPOS_Pos) /*!< EADC_T::SCTL6: INTPOS Mask */ - -#define EADC_SCTL7_CHSEL_Pos (0) /*!< EADC_T::SCTL7: CHSEL Position */ -#define EADC_SCTL7_CHSEL_Msk (0xful << EADC_SCTL7_CHSEL_Pos) /*!< EADC_T::SCTL7: CHSEL Mask */ - -#define EADC_SCTL7_EXTREN_Pos (4) /*!< EADC_T::SCTL7: EXTREN Position */ -#define EADC_SCTL7_EXTREN_Msk (0x1ul << EADC_SCTL7_EXTREN_Pos) /*!< EADC_T::SCTL7: EXTREN Mask */ - -#define EADC_SCTL7_EXTFEN_Pos (5) /*!< EADC_T::SCTL7: EXTFEN Position */ -#define EADC_SCTL7_EXTFEN_Msk (0x1ul << EADC_SCTL7_EXTFEN_Pos) /*!< EADC_T::SCTL7: EXTFEN Mask */ - -#define EADC_SCTL7_TRGDLYDIV_Pos (6) /*!< EADC_T::SCTL7: TRGDLYDIV Position */ -#define EADC_SCTL7_TRGDLYDIV_Msk (0x3ul << EADC_SCTL7_TRGDLYDIV_Pos) /*!< EADC_T::SCTL7: TRGDLYDIV Mask */ - -#define EADC_SCTL7_TRGDLYCNT_Pos (8) /*!< EADC_T::SCTL7: TRGDLYCNT Position */ -#define EADC_SCTL7_TRGDLYCNT_Msk (0xfful << EADC_SCTL7_TRGDLYCNT_Pos) /*!< EADC_T::SCTL7: TRGDLYCNT Mask */ - -#define EADC_SCTL7_TRGSEL_Pos (16) /*!< EADC_T::SCTL7: TRGSEL Position */ -#define EADC_SCTL7_TRGSEL_Msk (0x3ful << EADC_SCTL7_TRGSEL_Pos) /*!< EADC_T::SCTL7: TRGSEL Mask */ - -#define EADC_SCTL7_INTPOS_Pos (22) /*!< EADC_T::SCTL7: INTPOS Position */ -#define EADC_SCTL7_INTPOS_Msk (0x1ul << EADC_SCTL7_INTPOS_Pos) /*!< EADC_T::SCTL7: INTPOS Mask */ - -#define EADC_INTSRC0_SPLIE0_Pos (0) /*!< EADC_T::INTSRC0: SPLIE0 Position */ -#define EADC_INTSRC0_SPLIE0_Msk (0x1ul << EADC_INTSRC0_SPLIE0_Pos) /*!< EADC_T::INTSRC0: SPLIE0 Mask */ - -#define EADC_INTSRC0_SPLIE1_Pos (1) /*!< EADC_T::INTSRC0: SPLIE1 Position */ -#define EADC_INTSRC0_SPLIE1_Msk (0x1ul << EADC_INTSRC0_SPLIE1_Pos) /*!< EADC_T::INTSRC0: SPLIE1 Mask */ - -#define EADC_INTSRC0_SPLIE2_Pos (2) /*!< EADC_T::INTSRC0: SPLIE2 Position */ -#define EADC_INTSRC0_SPLIE2_Msk (0x1ul << EADC_INTSRC0_SPLIE2_Pos) /*!< EADC_T::INTSRC0: SPLIE2 Mask */ - -#define EADC_INTSRC0_SPLIE3_Pos (3) /*!< EADC_T::INTSRC0: SPLIE3 Position */ -#define EADC_INTSRC0_SPLIE3_Msk (0x1ul << EADC_INTSRC0_SPLIE3_Pos) /*!< EADC_T::INTSRC0: SPLIE3 Mask */ - -#define EADC_INTSRC0_SPLIE4_Pos (4) /*!< EADC_T::INTSRC0: SPLIE4 Position */ -#define EADC_INTSRC0_SPLIE4_Msk (0x1ul << EADC_INTSRC0_SPLIE4_Pos) /*!< EADC_T::INTSRC0: SPLIE4 Mask */ - -#define EADC_INTSRC0_SPLIE5_Pos (5) /*!< EADC_T::INTSRC0: SPLIE5 Position */ -#define EADC_INTSRC0_SPLIE5_Msk (0x1ul << EADC_INTSRC0_SPLIE5_Pos) /*!< EADC_T::INTSRC0: SPLIE5 Mask */ - -#define EADC_INTSRC0_SPLIE6_Pos (6) /*!< EADC_T::INTSRC0: SPLIE6 Position */ -#define EADC_INTSRC0_SPLIE6_Msk (0x1ul << EADC_INTSRC0_SPLIE6_Pos) /*!< EADC_T::INTSRC0: SPLIE6 Mask */ - -#define EADC_INTSRC0_SPLIE7_Pos (7) /*!< EADC_T::INTSRC0: SPLIE7 Position */ -#define EADC_INTSRC0_SPLIE7_Msk (0x1ul << EADC_INTSRC0_SPLIE7_Pos) /*!< EADC_T::INTSRC0: SPLIE7 Mask */ - -#define EADC_INTSRC0_SPLIE8_Pos (8) /*!< EADC_T::INTSRC0: SPLIE8 Position */ -#define EADC_INTSRC0_SPLIE8_Msk (0x1ul << EADC_INTSRC0_SPLIE8_Pos) /*!< EADC_T::INTSRC0: SPLIE8 Mask */ - -#define EADC_INTSRC1_SPLIE0_Pos (0) /*!< EADC_T::INTSRC1: SPLIE0 Position */ -#define EADC_INTSRC1_SPLIE0_Msk (0x1ul << EADC_INTSRC1_SPLIE0_Pos) /*!< EADC_T::INTSRC1: SPLIE0 Mask */ - -#define EADC_INTSRC1_SPLIE1_Pos (1) /*!< EADC_T::INTSRC1: SPLIE1 Position */ -#define EADC_INTSRC1_SPLIE1_Msk (0x1ul << EADC_INTSRC1_SPLIE1_Pos) /*!< EADC_T::INTSRC1: SPLIE1 Mask */ - -#define EADC_INTSRC1_SPLIE2_Pos (2) /*!< EADC_T::INTSRC1: SPLIE2 Position */ -#define EADC_INTSRC1_SPLIE2_Msk (0x1ul << EADC_INTSRC1_SPLIE2_Pos) /*!< EADC_T::INTSRC1: SPLIE2 Mask */ - -#define EADC_INTSRC1_SPLIE3_Pos (3) /*!< EADC_T::INTSRC1: SPLIE3 Position */ -#define EADC_INTSRC1_SPLIE3_Msk (0x1ul << EADC_INTSRC1_SPLIE3_Pos) /*!< EADC_T::INTSRC1: SPLIE3 Mask */ - -#define EADC_INTSRC1_SPLIE4_Pos (4) /*!< EADC_T::INTSRC1: SPLIE4 Position */ -#define EADC_INTSRC1_SPLIE4_Msk (0x1ul << EADC_INTSRC1_SPLIE4_Pos) /*!< EADC_T::INTSRC1: SPLIE4 Mask */ - -#define EADC_INTSRC1_SPLIE5_Pos (5) /*!< EADC_T::INTSRC1: SPLIE5 Position */ -#define EADC_INTSRC1_SPLIE5_Msk (0x1ul << EADC_INTSRC1_SPLIE5_Pos) /*!< EADC_T::INTSRC1: SPLIE5 Mask */ - -#define EADC_INTSRC1_SPLIE6_Pos (6) /*!< EADC_T::INTSRC1: SPLIE6 Position */ -#define EADC_INTSRC1_SPLIE6_Msk (0x1ul << EADC_INTSRC1_SPLIE6_Pos) /*!< EADC_T::INTSRC1: SPLIE6 Mask */ - -#define EADC_INTSRC1_SPLIE7_Pos (7) /*!< EADC_T::INTSRC1: SPLIE7 Position */ -#define EADC_INTSRC1_SPLIE7_Msk (0x1ul << EADC_INTSRC1_SPLIE7_Pos) /*!< EADC_T::INTSRC1: SPLIE7 Mask */ - -#define EADC_INTSRC1_SPLIE8_Pos (8) /*!< EADC_T::INTSRC1: SPLIE8 Position */ -#define EADC_INTSRC1_SPLIE8_Msk (0x1ul << EADC_INTSRC1_SPLIE8_Pos) /*!< EADC_T::INTSRC1: SPLIE8 Mask */ - -#define EADC_INTSRC2_SPLIE0_Pos (0) /*!< EADC_T::INTSRC2: SPLIE0 Position */ -#define EADC_INTSRC2_SPLIE0_Msk (0x1ul << EADC_INTSRC2_SPLIE0_Pos) /*!< EADC_T::INTSRC2: SPLIE0 Mask */ - -#define EADC_INTSRC2_SPLIE1_Pos (1) /*!< EADC_T::INTSRC2: SPLIE1 Position */ -#define EADC_INTSRC2_SPLIE1_Msk (0x1ul << EADC_INTSRC2_SPLIE1_Pos) /*!< EADC_T::INTSRC2: SPLIE1 Mask */ - -#define EADC_INTSRC2_SPLIE2_Pos (2) /*!< EADC_T::INTSRC2: SPLIE2 Position */ -#define EADC_INTSRC2_SPLIE2_Msk (0x1ul << EADC_INTSRC2_SPLIE2_Pos) /*!< EADC_T::INTSRC2: SPLIE2 Mask */ - -#define EADC_INTSRC2_SPLIE3_Pos (3) /*!< EADC_T::INTSRC2: SPLIE3 Position */ -#define EADC_INTSRC2_SPLIE3_Msk (0x1ul << EADC_INTSRC2_SPLIE3_Pos) /*!< EADC_T::INTSRC2: SPLIE3 Mask */ - -#define EADC_INTSRC2_SPLIE4_Pos (4) /*!< EADC_T::INTSRC2: SPLIE4 Position */ -#define EADC_INTSRC2_SPLIE4_Msk (0x1ul << EADC_INTSRC2_SPLIE4_Pos) /*!< EADC_T::INTSRC2: SPLIE4 Mask */ - -#define EADC_INTSRC2_SPLIE5_Pos (5) /*!< EADC_T::INTSRC2: SPLIE5 Position */ -#define EADC_INTSRC2_SPLIE5_Msk (0x1ul << EADC_INTSRC2_SPLIE5_Pos) /*!< EADC_T::INTSRC2: SPLIE5 Mask */ - -#define EADC_INTSRC2_SPLIE6_Pos (6) /*!< EADC_T::INTSRC2: SPLIE6 Position */ -#define EADC_INTSRC2_SPLIE6_Msk (0x1ul << EADC_INTSRC2_SPLIE6_Pos) /*!< EADC_T::INTSRC2: SPLIE6 Mask */ - -#define EADC_INTSRC2_SPLIE7_Pos (7) /*!< EADC_T::INTSRC2: SPLIE7 Position */ -#define EADC_INTSRC2_SPLIE7_Msk (0x1ul << EADC_INTSRC2_SPLIE7_Pos) /*!< EADC_T::INTSRC2: SPLIE7 Mask */ - -#define EADC_INTSRC2_SPLIE8_Pos (8) /*!< EADC_T::INTSRC2: SPLIE8 Position */ -#define EADC_INTSRC2_SPLIE8_Msk (0x1ul << EADC_INTSRC2_SPLIE8_Pos) /*!< EADC_T::INTSRC2: SPLIE8 Mask */ - -#define EADC_INTSRC3_SPLIE0_Pos (0) /*!< EADC_T::INTSRC3: SPLIE0 Position */ -#define EADC_INTSRC3_SPLIE0_Msk (0x1ul << EADC_INTSRC3_SPLIE0_Pos) /*!< EADC_T::INTSRC3: SPLIE0 Mask */ - -#define EADC_INTSRC3_SPLIE1_Pos (1) /*!< EADC_T::INTSRC3: SPLIE1 Position */ -#define EADC_INTSRC3_SPLIE1_Msk (0x1ul << EADC_INTSRC3_SPLIE1_Pos) /*!< EADC_T::INTSRC3: SPLIE1 Mask */ - -#define EADC_INTSRC3_SPLIE2_Pos (2) /*!< EADC_T::INTSRC3: SPLIE2 Position */ -#define EADC_INTSRC3_SPLIE2_Msk (0x1ul << EADC_INTSRC3_SPLIE2_Pos) /*!< EADC_T::INTSRC3: SPLIE2 Mask */ - -#define EADC_INTSRC3_SPLIE3_Pos (3) /*!< EADC_T::INTSRC3: SPLIE3 Position */ -#define EADC_INTSRC3_SPLIE3_Msk (0x1ul << EADC_INTSRC3_SPLIE3_Pos) /*!< EADC_T::INTSRC3: SPLIE3 Mask */ - -#define EADC_INTSRC3_SPLIE4_Pos (4) /*!< EADC_T::INTSRC3: SPLIE4 Position */ -#define EADC_INTSRC3_SPLIE4_Msk (0x1ul << EADC_INTSRC3_SPLIE4_Pos) /*!< EADC_T::INTSRC3: SPLIE4 Mask */ - -#define EADC_INTSRC3_SPLIE5_Pos (5) /*!< EADC_T::INTSRC3: SPLIE5 Position */ -#define EADC_INTSRC3_SPLIE5_Msk (0x1ul << EADC_INTSRC3_SPLIE5_Pos) /*!< EADC_T::INTSRC3: SPLIE5 Mask */ - -#define EADC_INTSRC3_SPLIE6_Pos (6) /*!< EADC_T::INTSRC3: SPLIE6 Position */ -#define EADC_INTSRC3_SPLIE6_Msk (0x1ul << EADC_INTSRC3_SPLIE6_Pos) /*!< EADC_T::INTSRC3: SPLIE6 Mask */ - -#define EADC_INTSRC3_SPLIE7_Pos (7) /*!< EADC_T::INTSRC3: SPLIE7 Position */ -#define EADC_INTSRC3_SPLIE7_Msk (0x1ul << EADC_INTSRC3_SPLIE7_Pos) /*!< EADC_T::INTSRC3: SPLIE7 Mask */ - -#define EADC_INTSRC3_SPLIE8_Pos (8) /*!< EADC_T::INTSRC3: SPLIE8 Position */ -#define EADC_INTSRC3_SPLIE8_Msk (0x1ul << EADC_INTSRC3_SPLIE8_Pos) /*!< EADC_T::INTSRC3: SPLIE8 Mask */ - -#define EADC_CMP_ADCMPEN_Pos (0) /*!< EADC_T::CMP: ADCMPEN Position */ -#define EADC_CMP_ADCMPEN_Msk (0x1ul << EADC_CMP_ADCMPEN_Pos) /*!< EADC_T::CMP: ADCMPEN Mask */ - -#define EADC_CMP_ADCMPIE_Pos (1) /*!< EADC_T::CMP: ADCMPIE Position */ -#define EADC_CMP_ADCMPIE_Msk (0x1ul << EADC_CMP_ADCMPIE_Pos) /*!< EADC_T::CMP: ADCMPIE Mask */ - -#define EADC_CMP_CMPCOND_Pos (2) /*!< EADC_T::CMP: CMPCOND Position */ -#define EADC_CMP_CMPCOND_Msk (0x1ul << EADC_CMP_CMPCOND_Pos) /*!< EADC_T::CMP: CMPCOND Mask */ - -#define EADC_CMP_CMPSPL_Pos (3) /*!< EADC_T::CMP: CMPSPL Position */ -#define EADC_CMP_CMPSPL_Msk (0x1ful << EADC_CMP_CMPSPL_Pos) /*!< EADC_T::CMP: CMPSPL Mask */ - -#define EADC_CMP_CMPMCNT_Pos (8) /*!< EADC_T::CMP: CMPMCNT Position */ -#define EADC_CMP_CMPMCNT_Msk (0xful << EADC_CMP_CMPMCNT_Pos) /*!< EADC_T::CMP: CMPMCNT Mask */ - -#define EADC_CMP_CMPWEN_Pos (15) /*!< EADC_T::CMP: CMPWEN Position */ -#define EADC_CMP_CMPWEN_Msk (0x1ul << EADC_CMP_CMPWEN_Pos) /*!< EADC_T::CMP: CMPWEN Mask */ - -#define EADC_CMP_CMPDAT_Pos (16) /*!< EADC_T::CMP: CMPDAT Position */ -#define EADC_CMP_CMPDAT_Msk (0xffful << EADC_CMP_CMPDAT_Pos) /*!< EADC_T::CMP: CMPDAT Mask */ - -#define EADC_CMP0_ADCMPEN_Pos (0) /*!< EADC_T::CMP0: ADCMPEN Position */ -#define EADC_CMP0_ADCMPEN_Msk (0x1ul << EADC_CMP0_ADCMPEN_Pos) /*!< EADC_T::CMP0: ADCMPEN Mask */ - -#define EADC_CMP0_ADCMPIE_Pos (1) /*!< EADC_T::CMP0: ADCMPIE Position */ -#define EADC_CMP0_ADCMPIE_Msk (0x1ul << EADC_CMP0_ADCMPIE_Pos) /*!< EADC_T::CMP0: ADCMPIE Mask */ - -#define EADC_CMP0_CMPCOND_Pos (2) /*!< EADC_T::CMP0: CMPCOND Position */ -#define EADC_CMP0_CMPCOND_Msk (0x1ul << EADC_CMP0_CMPCOND_Pos) /*!< EADC_T::CMP0: CMPCOND Mask */ - -#define EADC_CMP0_CMPSPL_Pos (3) /*!< EADC_T::CMP0: CMPSPL Position */ -#define EADC_CMP0_CMPSPL_Msk (0xful << EADC_CMP0_CMPSPL_Pos) /*!< EADC_T::CMP0: CMPSPL Mask */ - -#define EADC_CMP0_CMPMCNT_Pos (8) /*!< EADC_T::CMP0: CMPMCNT Position */ -#define EADC_CMP0_CMPMCNT_Msk (0xful << EADC_CMP0_CMPMCNT_Pos) /*!< EADC_T::CMP0: CMPMCNT Mask */ - -#define EADC_CMP0_CMPWEN_Pos (15) /*!< EADC_T::CMP0: CMPWEN Position */ -#define EADC_CMP0_CMPWEN_Msk (0x1ul << EADC_CMP0_CMPWEN_Pos) /*!< EADC_T::CMP0: CMPWEN Mask */ - -#define EADC_CMP0_CMPDAT_Pos (16) /*!< EADC_T::CMP0: CMPDAT Position */ -#define EADC_CMP0_CMPDAT_Msk (0xffful << EADC_CMP0_CMPDAT_Pos) /*!< EADC_T::CMP0: CMPDAT Mask */ - -#define EADC_CMP1_ADCMPEN_Pos (0) /*!< EADC_T::CMP1: ADCMPEN Position */ -#define EADC_CMP1_ADCMPEN_Msk (0x1ul << EADC_CMP1_ADCMPEN_Pos) /*!< EADC_T::CMP1: ADCMPEN Mask */ - -#define EADC_CMP1_ADCMPIE_Pos (1) /*!< EADC_T::CMP1: ADCMPIE Position */ -#define EADC_CMP1_ADCMPIE_Msk (0x1ul << EADC_CMP1_ADCMPIE_Pos) /*!< EADC_T::CMP1: ADCMPIE Mask */ - -#define EADC_CMP1_CMPCOND_Pos (2) /*!< EADC_T::CMP1: CMPCOND Position */ -#define EADC_CMP1_CMPCOND_Msk (0x1ul << EADC_CMP1_CMPCOND_Pos) /*!< EADC_T::CMP1: CMPCOND Mask */ - -#define EADC_CMP1_CMPSPL_Pos (3) /*!< EADC_T::CMP1: CMPSPL Position */ -#define EADC_CMP1_CMPSPL_Msk (0xful << EADC_CMP1_CMPSPL_Pos) /*!< EADC_T::CMP1: CMPSPL Mask */ - -#define EADC_CMP1_CMPMCNT_Pos (8) /*!< EADC_T::CMP1: CMPMCNT Position */ -#define EADC_CMP1_CMPMCNT_Msk (0xful << EADC_CMP1_CMPMCNT_Pos) /*!< EADC_T::CMP1: CMPMCNT Mask */ - -#define EADC_CMP1_CMPWEN_Pos (15) /*!< EADC_T::CMP1: CMPWEN Position */ -#define EADC_CMP1_CMPWEN_Msk (0x1ul << EADC_CMP1_CMPWEN_Pos) /*!< EADC_T::CMP1: CMPWEN Mask */ - -#define EADC_CMP1_CMPDAT_Pos (16) /*!< EADC_T::CMP1: CMPDAT Position */ -#define EADC_CMP1_CMPDAT_Msk (0xffful << EADC_CMP1_CMPDAT_Pos) /*!< EADC_T::CMP1: CMPDAT Mask */ - -#define EADC_CMP2_ADCMPEN_Pos (0) /*!< EADC_T::CMP2: ADCMPEN Position */ -#define EADC_CMP2_ADCMPEN_Msk (0x1ul << EADC_CMP2_ADCMPEN_Pos) /*!< EADC_T::CMP2: ADCMPEN Mask */ - -#define EADC_CMP2_ADCMPIE_Pos (1) /*!< EADC_T::CMP2: ADCMPIE Position */ -#define EADC_CMP2_ADCMPIE_Msk (0x1ul << EADC_CMP2_ADCMPIE_Pos) /*!< EADC_T::CMP2: ADCMPIE Mask */ - -#define EADC_CMP2_CMPCOND_Pos (2) /*!< EADC_T::CMP2: CMPCOND Position */ -#define EADC_CMP2_CMPCOND_Msk (0x1ul << EADC_CMP2_CMPCOND_Pos) /*!< EADC_T::CMP2: CMPCOND Mask */ - -#define EADC_CMP2_CMPSPL_Pos (3) /*!< EADC_T::CMP2: CMPSPL Position */ -#define EADC_CMP2_CMPSPL_Msk (0xful << EADC_CMP2_CMPSPL_Pos) /*!< EADC_T::CMP2: CMPSPL Mask */ - -#define EADC_CMP2_CMPMCNT_Pos (8) /*!< EADC_T::CMP2: CMPMCNT Position */ -#define EADC_CMP2_CMPMCNT_Msk (0xful << EADC_CMP2_CMPMCNT_Pos) /*!< EADC_T::CMP2: CMPMCNT Mask */ - -#define EADC_CMP2_CMPWEN_Pos (15) /*!< EADC_T::CMP2: CMPWEN Position */ -#define EADC_CMP2_CMPWEN_Msk (0x1ul << EADC_CMP2_CMPWEN_Pos) /*!< EADC_T::CMP2: CMPWEN Mask */ - -#define EADC_CMP2_CMPDAT_Pos (16) /*!< EADC_T::CMP2: CMPDAT Position */ -#define EADC_CMP2_CMPDAT_Msk (0xffful << EADC_CMP2_CMPDAT_Pos) /*!< EADC_T::CMP2: CMPDAT Mask */ - -#define EADC_CMP3_ADCMPEN_Pos (0) /*!< EADC_T::CMP3: ADCMPEN Position */ -#define EADC_CMP3_ADCMPEN_Msk (0x1ul << EADC_CMP3_ADCMPEN_Pos) /*!< EADC_T::CMP3: ADCMPEN Mask */ - -#define EADC_CMP3_ADCMPIE_Pos (1) /*!< EADC_T::CMP3: ADCMPIE Position */ -#define EADC_CMP3_ADCMPIE_Msk (0x1ul << EADC_CMP3_ADCMPIE_Pos) /*!< EADC_T::CMP3: ADCMPIE Mask */ - -#define EADC_CMP3_CMPCOND_Pos (2) /*!< EADC_T::CMP3: CMPCOND Position */ -#define EADC_CMP3_CMPCOND_Msk (0x1ul << EADC_CMP3_CMPCOND_Pos) /*!< EADC_T::CMP3: CMPCOND Mask */ - -#define EADC_CMP3_CMPSPL_Pos (3) /*!< EADC_T::CMP3: CMPSPL Position */ -#define EADC_CMP3_CMPSPL_Msk (0xful << EADC_CMP3_CMPSPL_Pos) /*!< EADC_T::CMP3: CMPSPL Mask */ - -#define EADC_CMP3_CMPMCNT_Pos (8) /*!< EADC_T::CMP3: CMPMCNT Position */ -#define EADC_CMP3_CMPMCNT_Msk (0xful << EADC_CMP3_CMPMCNT_Pos) /*!< EADC_T::CMP3: CMPMCNT Mask */ - -#define EADC_CMP3_CMPWEN_Pos (15) /*!< EADC_T::CMP3: CMPWEN Position */ -#define EADC_CMP3_CMPWEN_Msk (0x1ul << EADC_CMP3_CMPWEN_Pos) /*!< EADC_T::CMP3: CMPWEN Mask */ - -#define EADC_CMP3_CMPDAT_Pos (16) /*!< EADC_T::CMP3: CMPDAT Position */ -#define EADC_CMP3_CMPDAT_Msk (0xffful << EADC_CMP3_CMPDAT_Pos) /*!< EADC_T::CMP3: CMPDAT Mask */ - -#define EADC_STATUS0_VALID_Pos (0) /*!< EADC_T::STATUS0: VALID Position */ -#define EADC_STATUS0_VALID_Msk (0x1fful << EADC_STATUS0_VALID_Pos) /*!< EADC_T::STATUS0: VALID Mask */ - -#define EADC_STATUS0_OV_Pos (16) /*!< EADC_T::STATUS0: OV Position */ -#define EADC_STATUS0_OV_Msk (0x1fful << EADC_STATUS0_OV_Pos) /*!< EADC_T::STATUS0: OV Mask */ - -#define EADC_STATUS2_ADIF0_Pos (0) /*!< EADC_T::STATUS2: ADIF0 Position */ -#define EADC_STATUS2_ADIF0_Msk (0x1ul << EADC_STATUS2_ADIF0_Pos) /*!< EADC_T::STATUS2: ADIF0 Mask */ - -#define EADC_STATUS2_ADIF1_Pos (1) /*!< EADC_T::STATUS2: ADIF1 Position */ -#define EADC_STATUS2_ADIF1_Msk (0x1ul << EADC_STATUS2_ADIF1_Pos) /*!< EADC_T::STATUS2: ADIF1 Mask */ - -#define EADC_STATUS2_ADIF2_Pos (2) /*!< EADC_T::STATUS2: ADIF2 Position */ -#define EADC_STATUS2_ADIF2_Msk (0x1ul << EADC_STATUS2_ADIF2_Pos) /*!< EADC_T::STATUS2: ADIF2 Mask */ - -#define EADC_STATUS2_ADIF3_Pos (3) /*!< EADC_T::STATUS2: ADIF3 Position */ -#define EADC_STATUS2_ADIF3_Msk (0x1ul << EADC_STATUS2_ADIF3_Pos) /*!< EADC_T::STATUS2: ADIF3 Mask */ - -#define EADC_STATUS2_ADCMPF0_Pos (4) /*!< EADC_T::STATUS2: ADCMPF0 Position */ -#define EADC_STATUS2_ADCMPF0_Msk (0x1ul << EADC_STATUS2_ADCMPF0_Pos) /*!< EADC_T::STATUS2: ADCMPF0 Mask */ - -#define EADC_STATUS2_ADCMPF1_Pos (5) /*!< EADC_T::STATUS2: ADCMPF1 Position */ -#define EADC_STATUS2_ADCMPF1_Msk (0x1ul << EADC_STATUS2_ADCMPF1_Pos) /*!< EADC_T::STATUS2: ADCMPF1 Mask */ - -#define EADC_STATUS2_ADCMPF2_Pos (6) /*!< EADC_T::STATUS2: ADCMPF2 Position */ -#define EADC_STATUS2_ADCMPF2_Msk (0x1ul << EADC_STATUS2_ADCMPF2_Pos) /*!< EADC_T::STATUS2: ADCMPF2 Mask */ - -#define EADC_STATUS2_ADCMPF3_Pos (7) /*!< EADC_T::STATUS2: ADCMPF3 Position */ -#define EADC_STATUS2_ADCMPF3_Msk (0x1ul << EADC_STATUS2_ADCMPF3_Pos) /*!< EADC_T::STATUS2: ADCMPF3 Mask */ - -#define EADC_STATUS2_ADOVIF0_Pos (8) /*!< EADC_T::STATUS2: ADOVIF0 Position */ -#define EADC_STATUS2_ADOVIF0_Msk (0x1ul << EADC_STATUS2_ADOVIF0_Pos) /*!< EADC_T::STATUS2: ADOVIF0 Mask */ - -#define EADC_STATUS2_ADOVIF1_Pos (9) /*!< EADC_T::STATUS2: ADOVIF1 Position */ -#define EADC_STATUS2_ADOVIF1_Msk (0x1ul << EADC_STATUS2_ADOVIF1_Pos) /*!< EADC_T::STATUS2: ADOVIF1 Mask */ - -#define EADC_STATUS2_ADOVIF2_Pos (10) /*!< EADC_T::STATUS2: ADOVIF2 Position */ -#define EADC_STATUS2_ADOVIF2_Msk (0x1ul << EADC_STATUS2_ADOVIF2_Pos) /*!< EADC_T::STATUS2: ADOVIF2 Mask */ - -#define EADC_STATUS2_ADOVIF3_Pos (11) /*!< EADC_T::STATUS2: ADOVIF3 Position */ -#define EADC_STATUS2_ADOVIF3_Msk (0x1ul << EADC_STATUS2_ADOVIF3_Pos) /*!< EADC_T::STATUS2: ADOVIF3 Mask */ - -#define EADC_STATUS2_ADCMPO0_Pos (12) /*!< EADC_T::STATUS2: ADCMPO0 Position */ -#define EADC_STATUS2_ADCMPO0_Msk (0x1ul << EADC_STATUS2_ADCMPO0_Pos) /*!< EADC_T::STATUS2: ADCMPO0 Mask */ - -#define EADC_STATUS2_ADCMPO1_Pos (13) /*!< EADC_T::STATUS2: ADCMPO1 Position */ -#define EADC_STATUS2_ADCMPO1_Msk (0x1ul << EADC_STATUS2_ADCMPO1_Pos) /*!< EADC_T::STATUS2: ADCMPO1 Mask */ - -#define EADC_STATUS2_ADCMPO2_Pos (14) /*!< EADC_T::STATUS2: ADCMPO2 Position */ -#define EADC_STATUS2_ADCMPO2_Msk (0x1ul << EADC_STATUS2_ADCMPO2_Pos) /*!< EADC_T::STATUS2: ADCMPO2 Mask */ - -#define EADC_STATUS2_ADCMPO3_Pos (15) /*!< EADC_T::STATUS2: ADCMPO3 Position */ -#define EADC_STATUS2_ADCMPO3_Msk (0x1ul << EADC_STATUS2_ADCMPO3_Pos) /*!< EADC_T::STATUS2: ADCMPO3 Mask */ - -#define EADC_STATUS2_CHANNEL_Pos (16) /*!< EADC_T::STATUS2: CHANNEL Position */ -#define EADC_STATUS2_CHANNEL_Msk (0x1ful << EADC_STATUS2_CHANNEL_Pos) /*!< EADC_T::STATUS2: CHANNEL Mask */ - -#define EADC_STATUS2_BUSY_Pos (23) /*!< EADC_T::STATUS2: BUSY Position */ -#define EADC_STATUS2_BUSY_Msk (0x1ul << EADC_STATUS2_BUSY_Pos) /*!< EADC_T::STATUS2: BUSY Mask */ - -#define EADC_STATUS2_ADOVIF_Pos (24) /*!< EADC_T::STATUS2: ADOVIF Position */ -#define EADC_STATUS2_ADOVIF_Msk (0x1ul << EADC_STATUS2_ADOVIF_Pos) /*!< EADC_T::STATUS2: ADOVIF Mask */ - -#define EADC_STATUS2_STOVF_Pos (25) /*!< EADC_T::STATUS2: STOVF Position */ -#define EADC_STATUS2_STOVF_Msk (0x1ul << EADC_STATUS2_STOVF_Pos) /*!< EADC_T::STATUS2: STOVF Mask */ - -#define EADC_STATUS2_AVALID_Pos (26) /*!< EADC_T::STATUS2: AVALID Position */ -#define EADC_STATUS2_AVALID_Msk (0x1ul << EADC_STATUS2_AVALID_Pos) /*!< EADC_T::STATUS2: AVALID Mask */ - -#define EADC_STATUS2_AOV_Pos (27) /*!< EADC_T::STATUS2: AOV Position */ -#define EADC_STATUS2_AOV_Msk (0x1ul << EADC_STATUS2_AOV_Pos) /*!< EADC_T::STATUS2: AOV Mask */ - -#define EADC_STATUS3_CURSPL_Pos (0) /*!< EADC_T::STATUS3: CURSPL Position */ -#define EADC_STATUS3_CURSPL_Msk (0x1ful << EADC_STATUS3_CURSPL_Pos) /*!< EADC_T::STATUS3: CURSPL Mask */ - -#define EADC_DDAT0_RESULT_Pos (0) /*!< EADC_T::DDAT0: RESULT Position */ -#define EADC_DDAT0_RESULT_Msk (0xfffful << EADC_DDAT0_RESULT_Pos) /*!< EADC_T::DDAT0: RESULT Mask */ - -#define EADC_DDAT0_OV_Pos (16) /*!< EADC_T::DDAT0: OV Position */ -#define EADC_DDAT0_OV_Msk (0x1ul << EADC_DDAT0_OV_Pos) /*!< EADC_T::DDAT0: OV Mask */ - -#define EADC_DDAT0_VALID_Pos (17) /*!< EADC_T::DDAT0: VALID Position */ -#define EADC_DDAT0_VALID_Msk (0x1ul << EADC_DDAT0_VALID_Pos) /*!< EADC_T::DDAT0: VALID Mask */ - -#define EADC_DDAT1_RESULT_Pos (0) /*!< EADC_T::DDAT1: RESULT Position */ -#define EADC_DDAT1_RESULT_Msk (0xfffful << EADC_DDAT1_RESULT_Pos) /*!< EADC_T::DDAT1: RESULT Mask */ - -#define EADC_DDAT1_OV_Pos (16) /*!< EADC_T::DDAT1: OV Position */ -#define EADC_DDAT1_OV_Msk (0x1ul << EADC_DDAT1_OV_Pos) /*!< EADC_T::DDAT1: OV Mask */ - -#define EADC_DDAT1_VALID_Pos (17) /*!< EADC_T::DDAT1: VALID Position */ -#define EADC_DDAT1_VALID_Msk (0x1ul << EADC_DDAT1_VALID_Pos) /*!< EADC_T::DDAT1: VALID Mask */ - -#define EADC_DDAT2_RESULT_Pos (0) /*!< EADC_T::DDAT2: RESULT Position */ -#define EADC_DDAT2_RESULT_Msk (0xfffful << EADC_DDAT2_RESULT_Pos) /*!< EADC_T::DDAT2: RESULT Mask */ - -#define EADC_DDAT2_OV_Pos (16) /*!< EADC_T::DDAT2: OV Position */ -#define EADC_DDAT2_OV_Msk (0x1ul << EADC_DDAT2_OV_Pos) /*!< EADC_T::DDAT2: OV Mask */ - -#define EADC_DDAT2_VALID_Pos (17) /*!< EADC_T::DDAT2: VALID Position */ -#define EADC_DDAT2_VALID_Msk (0x1ul << EADC_DDAT2_VALID_Pos) /*!< EADC_T::DDAT2: VALID Mask */ - -#define EADC_DDAT3_RESULT_Pos (0) /*!< EADC_T::DDAT3: RESULT Position */ -#define EADC_DDAT3_RESULT_Msk (0xfffful << EADC_DDAT3_RESULT_Pos) /*!< EADC_T::DDAT3: RESULT Mask */ - -#define EADC_DDAT3_OV_Pos (16) /*!< EADC_T::DDAT3: OV Position */ -#define EADC_DDAT3_OV_Msk (0x1ul << EADC_DDAT3_OV_Pos) /*!< EADC_T::DDAT3: OV Mask */ - -#define EADC_DDAT3_VALID_Pos (17) /*!< EADC_T::DDAT3: VALID Position */ -#define EADC_DDAT3_VALID_Msk (0x1ul << EADC_DDAT3_VALID_Pos) /*!< EADC_T::DDAT3: VALID Mask */ - -#define EADC_PWRM_PWUPRDY_Pos (0) /*!< EADC_T::PWRM: PWUPRDY Position */ -#define EADC_PWRM_PWUPRDY_Msk (0x1ul << EADC_PWRM_PWUPRDY_Pos) /*!< EADC_T::PWRM: PWUPRDY Mask */ - -#define EADC_PWRM_PWUCALEN_Pos (1) /*!< EADC_T::PWRM: PWUCALEN Position */ -#define EADC_PWRM_PWUCALEN_Msk (0x1ul << EADC_PWRM_PWUCALEN_Pos) /*!< EADC_T::PWRM: PWUCALEN Mask */ - -#define EADC_PWRM_PWDMOD_Pos (2) /*!< EADC_T::PWRM: PWDMOD Position */ -#define EADC_PWRM_PWDMOD_Msk (0x3ul << EADC_PWRM_PWDMOD_Pos) /*!< EADC_T::PWRM: PWDMOD Mask */ - -#define EADC_PWRM_IREFSUT_Pos (8) /*!< EADC_T::PWRM: IREFSUT Position */ -#define EADC_PWRM_IREFSUT_Msk (0xffffful << EADC_PWRM_IREFSUT_Pos) /*!< EADC_T::PWRM: IREFSUT Mask */ - -#define EADC_CALCTL_CALSTART_Pos (1) /*!< EADC_T::CALCTL: CALSTART Position */ -#define EADC_CALCTL_CALSTART_Msk (0x1ul << EADC_CALCTL_CALSTART_Pos) /*!< EADC_T::CALCTL: CALSTART Mask */ - -#define EADC_CALCTL_CALDONE_Pos (2) /*!< EADC_T::CALCTL: CALDONE Position */ -#define EADC_CALCTL_CALDONE_Msk (0x1ul << EADC_CALCTL_CALDONE_Pos) /*!< EADC_T::CALCTL: CALDONE Mask */ - -#define EADC_CALCTL_CALSEL_Pos (3) /*!< EADC_T::CALCTL: CALSEL Position */ -#define EADC_CALCTL_CALSEL_Msk (0x1ul << EADC_CALCTL_CALSEL_Pos) /*!< EADC_T::CALCTL: CALSEL Mask */ - -#define EADC_PDMACTL_PDMATEN_Pos (0) /*!< EADC_T::PDMACTL: PDMATEN Position */ -#define EADC_PDMACTL_PDMATEN_Msk (0x1fful << EADC_PDMACTL_PDMATEN_Pos) /*!< EADC_T::PDMACTL: PDMATEN Mask */ - -#define EADC_PDMACTL_PDMABUSY_Pos (31) /*!< EADC_T::PDMACTL: PDMABUSY Position */ -#define EADC_PDMACTL_PDMABUSY_Msk (0x1ul << EADC_PDMACTL_PDMABUSY_Pos) /*!< EADC_T::PDMACTL: PDMABUSY Mask */ - -#define EADC_SELSMP0_SELSMP0_Pos (0) /*!< EADC_T::SELSMP0: SELSMP0 Position */ -#define EADC_SELSMP0_SELSMP0_Msk (0x3ul << EADC_SELSMP0_SELSMP0_Pos) /*!< EADC_T::SELSMP0: SELSMP0 Mask */ - -#define EADC_SELSMP0_SELSMP1_Pos (4) /*!< EADC_T::SELSMP0: SELSMP1 Position */ -#define EADC_SELSMP0_SELSMP1_Msk (0x3ul << EADC_SELSMP0_SELSMP1_Pos) /*!< EADC_T::SELSMP0: SELSMP1 Mask */ - -#define EADC_SELSMP0_SELSMP2_Pos (8) /*!< EADC_T::SELSMP0: SELSMP2 Position */ -#define EADC_SELSMP0_SELSMP2_Msk (0x3ul << EADC_SELSMP0_SELSMP2_Pos) /*!< EADC_T::SELSMP0: SELSMP2 Mask */ - -#define EADC_SELSMP0_SELSMP3_Pos (12) /*!< EADC_T::SELSMP0: SELSMP3 Position */ -#define EADC_SELSMP0_SELSMP3_Msk (0x3ul << EADC_SELSMP0_SELSMP3_Pos) /*!< EADC_T::SELSMP0: SELSMP3 Mask */ - -#define EADC_SELSMP0_SELSMP4_Pos (16) /*!< EADC_T::SELSMP0: SELSMP4 Position */ -#define EADC_SELSMP0_SELSMP4_Msk (0x3ul << EADC_SELSMP0_SELSMP4_Pos) /*!< EADC_T::SELSMP0: SELSMP4 Mask */ - -#define EADC_SELSMP0_SELSMP5_Pos (20) /*!< EADC_T::SELSMP0: SELSMP5 Position */ -#define EADC_SELSMP0_SELSMP5_Msk (0x3ul << EADC_SELSMP0_SELSMP5_Pos) /*!< EADC_T::SELSMP0: SELSMP5 Mask */ - -#define EADC_SELSMP0_SELSMP6_Pos (24) /*!< EADC_T::SELSMP0: SELSMP6 Position */ -#define EADC_SELSMP0_SELSMP6_Msk (0x3ul << EADC_SELSMP0_SELSMP6_Pos) /*!< EADC_T::SELSMP0: SELSMP6 Mask */ - -#define EADC_SELSMP0_SELSMP7_Pos (28) /*!< EADC_T::SELSMP0: SELSMP7 Position */ -#define EADC_SELSMP0_SELSMP7_Msk (0x3ul << EADC_SELSMP0_SELSMP7_Pos) /*!< EADC_T::SELSMP0: SELSMP7 Mask */ - -#define EADC_SELSMP1_SELSMP8_Pos (0) /*!< EADC_T::SELSMP1: SELSMP8 Position */ -#define EADC_SELSMP1_SELSMP8_Msk (0x3ul << EADC_SELSMP1_SELSMP8_Pos) /*!< EADC_T::SELSMP1: SELSMP8 Mask */ - -#define EADC_REFADJCTL_PDREF_Pos (0) /*!< EADC_T::REFADJCTL: PDREF Position */ -#define EADC_REFADJCTL_PDREF_Msk (0x1ul << EADC_REFADJCTL_PDREF_Pos) /*!< EADC_T::REFADJCTL: PDREF Mask */ - -#define EADC_REFADJCTL_REFADJ_Pos (1) /*!< EADC_T::REFADJCTL: REFADJ Position */ -#define EADC_REFADJCTL_REFADJ_Msk (0xful << EADC_REFADJCTL_REFADJ_Pos) /*!< EADC_T::REFADJCTL: REFADJ Mask */ - -/**@}*/ /* EADC_CONST */ -/**@}*/ /* end of EADC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EADC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ebi_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ebi_reg.h deleted file mode 100644 index f56049f1352..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ebi_reg.h +++ /dev/null @@ -1,428 +0,0 @@ -/**************************************************************************//** - * @file ebi_reg.h - * @brief EBI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EBI_REG_H__ -#define __EBI_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller -@{ */ - -typedef struct -{ - - - /** - * @var EBI_T::CTL0 - * Offset: 0x00 External Bus Interface Bank0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separate Mode Enable Bit - * | | |0 = Address/Data Bus Separate Mode Disabled. - * | | |1 = Address/Data Bus Separate Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When continuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register. - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register. - * @var EBI_T::TCTL0 - * Offset: 0x04 External Bus Interface Bank0 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC defines data access time (tACC). - * | | |tACC = (TACC +1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD defines data access hold time (tAHD). - * | | |tAHD = (TAHD +1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finished, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = Data Access Hold Time (tAHD) during EBI reading Enabled. - * | | |1 = Data Access Hold Time (tAHD) during EBI reading Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = Data Access Hold Time (tAHD) during EBI writing Enabled. - * | | |1 = Data Access Hold Time (tAHD) during EBI writing Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finished and the next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - * @var EBI_T::CTL1 - * Offset: 0x10 External Bus Interface Bank1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separate Mode Enable Bit - * | | |0 = Address/Data Bus Separate Mode Disabled. - * | | |1 = Address/Data Bus Separate Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When continuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register. - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register. - * @var EBI_T::TCTL1 - * Offset: 0x14 External Bus Interface Bank1 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC defines data access time (tACC). - * | | |tACC = (TACC +1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD defines data access hold time (tAHD). - * | | |tAHD = (TAHD +1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finished, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = Data Access Hold Time (tAHD) during EBI reading Enabled. - * | | |1 = Data Access Hold Time (tAHD) during EBI reading Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = Data Access Hold Time (tAHD) during EBI writing Enabled. - * | | |1 = Data Access Hold Time (tAHD) during EBI writing Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finished and the next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - * @var EBI_T::CTL2 - * Offset: 0x20 External Bus Interface Bank2 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |EN |EBI Enable Bit - * | | |This bit is the functional enable bit for EBI. - * | | |0 = EBI function Disabled. - * | | |1 = EBI function Enabled. - * |[1] |DW16 |EBI Data Width 16-bit Select - * | | |This bit defines if the EBI data width is 8-bit or 16-bit. - * | | |0 = EBI data width is 8-bit. - * | | |1 = EBI data width is 16-bit. - * |[2] |CSPOLINV |Chip Select Pin Polar Inverse - * | | |This bit defines the active level of EBI chip select pin (EBI_nCS). - * | | |0 = Chip select pin (EBI_nCS) is active low. - * | | |1 = Chip select pin (EBI_nCS) is active high. - * |[3] |ADSEPEN |EBI Address/Data Bus Separate Mode Enable Bit - * | | |0 = Address/Data Bus Separate Mode Disabled. - * | | |1 = Address/Data Bus Separate Mode Enabled. - * |[4] |CACCESS |Continuous Data Access Mode - * | | |When continuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request. - * | | |0 = Continuous data access mode Disabled. - * | | |1 = Continuous data access mode Enabled. - * |[10:8] |MCLKDIV |External Output Clock Divider - * | | |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow: - * | | |000 = HCLK/1. - * | | |001 = HCLK/2. - * | | |010 = HCLK/4. - * | | |011 = HCLK/8. - * | | |100 = HCLK/16. - * | | |101 = HCLK/32. - * | | |110 = HCLK/64. - * | | |111 = HCLK/128. - * |[18:16] |TALE |Extend Time of ALE - * | | |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE. - * | | |tALE = (TALE+1)*EBI_MCLK. - * | | |Note: This field only available in EBI_CTL0 register. - * |[24] |WBUFEN |EBI Write Buffer Enable Bit - * | | |0 = EBI write buffer Disabled. - * | | |1 = EBI write buffer Enabled. - * | | |Note: This bit only available in EBI_CTL0 register. - * @var EBI_T::TCTL2 - * Offset: 0x24 External Bus Interface Bank2 Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:3] |TACC |EBI Data Access Time - * | | |TACC defines data access time (tACC). - * | | |tACC = (TACC +1) * EBI_MCLK. - * |[10:8] |TAHD |EBI Data Access Hold Time - * | | |TAHD defines data access hold time (tAHD). - * | | |tAHD = (TAHD +1) * EBI_MCLK. - * |[15:12] |W2X |Idle Cycle After Write - * | | |This field defines the number of W2X idle cycle. - * | | |W2X idle cycle = (W2X * EBI_MCLK). - * | | |When write action is finished, W2X idle cycle is inserted and EBI_nCS return to idle state. - * |[22] |RAHDOFF |Access Hold Time Disable Control When Read - * | | |0 = Data Access Hold Time (tAHD) during EBI reading Enabled. - * | | |1 = Data Access Hold Time (tAHD) during EBI reading Disabled. - * |[23] |WAHDOFF |Access Hold Time Disable Control When Write - * | | |0 = Data Access Hold Time (tAHD) during EBI writing Enabled. - * | | |1 = Data Access Hold Time (tAHD) during EBI writing Disabled. - * |[27:24] |R2R |Idle Cycle Between Read-to-read - * | | |This field defines the number of R2R idle cycle. - * | | |R2R idle cycle = (R2R * EBI_MCLK). - * | | |When read action is finished and the next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state. - */ - __IO uint32_t CTL0; /*!< [0x0000] External Bus Interface Bank0 Control Register */ - __IO uint32_t TCTL0; /*!< [0x0004] External Bus Interface Bank0 Timing Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL1; /*!< [0x0010] External Bus Interface Bank1 Control Register */ - __IO uint32_t TCTL1; /*!< [0x0014] External Bus Interface Bank1 Timing Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL2; /*!< [0x0020] External Bus Interface Bank2 Control Register */ - __IO uint32_t TCTL2; /*!< [0x0024] External Bus Interface Bank2 Timing Control Register */ - -} EBI_T; - -/** - @addtogroup EBI_CONST EBI Bit Field Definition - Constant Definitions for EBI Controller -@{ */ - -#define EBI_CTL_EN_Pos (0) /*!< EBI_T::CTL: EN Position */ -#define EBI_CTL_EN_Msk (0x1ul << EBI_CTL_EN_Pos) /*!< EBI_T::CTL: EN Mask */ - -#define EBI_CTL_DW16_Pos (1) /*!< EBI_T::CTL: DW16 Position */ -#define EBI_CTL_DW16_Msk (0x1ul << EBI_CTL_DW16_Pos) /*!< EBI_T::CTL: DW16 Mask */ - -#define EBI_CTL_CSPOLINV_Pos (2) /*!< EBI_T::CTL: CSPOLINV Position */ -#define EBI_CTL_CSPOLINV_Msk (0x1ul << EBI_CTL_CSPOLINV_Pos) /*!< EBI_T::CTL: CSPOLINV Mask */ - -#define EBI_CTL_ADSEPEN_Pos (3) /*!< EBI_T::CTL: ADSEPEN Position */ -#define EBI_CTL_ADSEPEN_Msk (0x1ul << EBI_CTL_ADSEPEN_Pos) /*!< EBI_T::CTL: ADSEPEN Mask */ - -#define EBI_CTL_CACCESS_Pos (4) /*!< EBI_T::CTL: CACCESS Position */ -#define EBI_CTL_CACCESS_Msk (0x1ul << EBI_CTL_CACCESS_Pos) /*!< EBI_T::CTL: CACCESS Mask */ - -#define EBI_CTL_MCLKDIV_Pos (8) /*!< EBI_T::CTL: MCLKDIV Position */ -#define EBI_CTL_MCLKDIV_Msk (0x7ul << EBI_CTL_MCLKDIV_Pos) /*!< EBI_T::CTL: MCLKDIV Mask */ - -#define EBI_CTL_TALE_Pos (16) /*!< EBI_T::CTL: TALE Position */ -#define EBI_CTL_TALE_Msk (0x7ul << EBI_CTL_TALE_Pos) /*!< EBI_T::CTL: TALE Mask */ - -#define EBI_CTL_WBUFEN_Pos (24) /*!< EBI_T::CTL: WBUFEN Position */ -#define EBI_CTL_WBUFEN_Msk (0x1ul << EBI_CTL_WBUFEN_Pos) /*!< EBI_T::CTL: WBUFEN Mask */ - -#define EBI_TCTL_TACC_Pos (3) /*!< EBI_T::TCTL: TACC Position */ -#define EBI_TCTL_TACC_Msk (0x1ful << EBI_TCTL_TACC_Pos) /*!< EBI_T::TCTL: TACC Mask */ - -#define EBI_TCTL_TAHD_Pos (8) /*!< EBI_T::TCTL: TAHD Position */ -#define EBI_TCTL_TAHD_Msk (0x7ul << EBI_TCTL_TAHD_Pos) /*!< EBI_T::TCTL: TAHD Mask */ - -#define EBI_TCTL_W2X_Pos (12) /*!< EBI_T::TCTL: W2X Position */ -#define EBI_TCTL_W2X_Msk (0xful << EBI_TCTL_W2X_Pos) /*!< EBI_T::TCTL: W2X Mask */ - -#define EBI_TCTL_RAHDOFF_Pos (22) /*!< EBI_T::TCTL: RAHDOFF Position */ -#define EBI_TCTL_RAHDOFF_Msk (0x1ul << EBI_TCTL_RAHDOFF_Pos) /*!< EBI_T::TCTL: RAHDOFF Mask */ - -#define EBI_TCTL_WAHDOFF_Pos (23) /*!< EBI_T::TCTL: WAHDOFF Position */ -#define EBI_TCTL_WAHDOFF_Msk (0x1ul << EBI_TCTL_WAHDOFF_Pos) /*!< EBI_T::TCTL: WAHDOFF Mask */ - -#define EBI_TCTL_R2R_Pos (24) /*!< EBI_T::TCTL: R2R Position */ -#define EBI_TCTL_R2R_Msk (0xful << EBI_TCTL_R2R_Pos) /*!< EBI_T::TCTL: R2R Mask */ - -#define EBI_CTL0_EN_Pos (0) /*!< EBI_T::CTL0: EN Position */ -#define EBI_CTL0_EN_Msk (0x1ul << EBI_CTL0_EN_Pos) /*!< EBI_T::CTL0: EN Mask */ - -#define EBI_CTL0_DW16_Pos (1) /*!< EBI_T::CTL0: DW16 Position */ -#define EBI_CTL0_DW16_Msk (0x1ul << EBI_CTL0_DW16_Pos) /*!< EBI_T::CTL0: DW16 Mask */ - -#define EBI_CTL0_CSPOLINV_Pos (2) /*!< EBI_T::CTL0: CSPOLINV Position */ -#define EBI_CTL0_CSPOLINV_Msk (0x1ul << EBI_CTL0_CSPOLINV_Pos) /*!< EBI_T::CTL0: CSPOLINV Mask */ - -#define EBI_CTL0_ADSEPEN_Pos (3) /*!< EBI_T::CTL0: ADSEPEN Position */ -#define EBI_CTL0_ADSEPEN_Msk (0x1ul << EBI_CTL0_ADSEPEN_Pos) /*!< EBI_T::CTL0: ADSEPEN Mask */ - -#define EBI_CTL0_CACCESS_Pos (4) /*!< EBI_T::CTL0: CACCESS Position */ -#define EBI_CTL0_CACCESS_Msk (0x1ul << EBI_CTL0_CACCESS_Pos) /*!< EBI_T::CTL0: CACCESS Mask */ - -#define EBI_CTL0_MCLKDIV_Pos (8) /*!< EBI_T::CTL0: MCLKDIV Position */ -#define EBI_CTL0_MCLKDIV_Msk (0x7ul << EBI_CTL0_MCLKDIV_Pos) /*!< EBI_T::CTL0: MCLKDIV Mask */ - -#define EBI_CTL0_TALE_Pos (16) /*!< EBI_T::CTL0: TALE Position */ -#define EBI_CTL0_TALE_Msk (0x7ul << EBI_CTL0_TALE_Pos) /*!< EBI_T::CTL0: TALE Mask */ - -#define EBI_CTL0_WBUFEN_Pos (24) /*!< EBI_T::CTL0: WBUFEN Position */ -#define EBI_CTL0_WBUFEN_Msk (0x1ul << EBI_CTL0_WBUFEN_Pos) /*!< EBI_T::CTL0: WBUFEN Mask */ - -#define EBI_TCTL0_TACC_Pos (3) /*!< EBI_T::TCTL0: TACC Position */ -#define EBI_TCTL0_TACC_Msk (0x1ful << EBI_TCTL0_TACC_Pos) /*!< EBI_T::TCTL0: TACC Mask */ - -#define EBI_TCTL0_TAHD_Pos (8) /*!< EBI_T::TCTL0: TAHD Position */ -#define EBI_TCTL0_TAHD_Msk (0x7ul << EBI_TCTL0_TAHD_Pos) /*!< EBI_T::TCTL0: TAHD Mask */ - -#define EBI_TCTL0_W2X_Pos (12) /*!< EBI_T::TCTL0: W2X Position */ -#define EBI_TCTL0_W2X_Msk (0xful << EBI_TCTL0_W2X_Pos) /*!< EBI_T::TCTL0: W2X Mask */ - -#define EBI_TCTL0_RAHDOFF_Pos (22) /*!< EBI_T::TCTL0: RAHDOFF Position */ -#define EBI_TCTL0_RAHDOFF_Msk (0x1ul << EBI_TCTL0_RAHDOFF_Pos) /*!< EBI_T::TCTL0: RAHDOFF Mask */ - -#define EBI_TCTL0_WAHDOFF_Pos (23) /*!< EBI_T::TCTL0: WAHDOFF Position */ -#define EBI_TCTL0_WAHDOFF_Msk (0x1ul << EBI_TCTL0_WAHDOFF_Pos) /*!< EBI_T::TCTL0: WAHDOFF Mask */ - -#define EBI_TCTL0_R2R_Pos (24) /*!< EBI_T::TCTL0: R2R Position */ -#define EBI_TCTL0_R2R_Msk (0xful << EBI_TCTL0_R2R_Pos) /*!< EBI_T::TCTL0: R2R Mask */ - -#define EBI_CTL1_EN_Pos (0) /*!< EBI_T::CTL1: EN Position */ -#define EBI_CTL1_EN_Msk (0x1ul << EBI_CTL1_EN_Pos) /*!< EBI_T::CTL1: EN Mask */ - -#define EBI_CTL1_DW16_Pos (1) /*!< EBI_T::CTL1: DW16 Position */ -#define EBI_CTL1_DW16_Msk (0x1ul << EBI_CTL1_DW16_Pos) /*!< EBI_T::CTL1: DW16 Mask */ - -#define EBI_CTL1_CSPOLINV_Pos (2) /*!< EBI_T::CTL1: CSPOLINV Position */ -#define EBI_CTL1_CSPOLINV_Msk (0x1ul << EBI_CTL1_CSPOLINV_Pos) /*!< EBI_T::CTL1: CSPOLINV Mask */ - -#define EBI_CTL1_ADSEPEN_Pos (3) /*!< EBI_T::CTL1: ADSEPEN Position */ -#define EBI_CTL1_ADSEPEN_Msk (0x1ul << EBI_CTL1_ADSEPEN_Pos) /*!< EBI_T::CTL1: ADSEPEN Mask */ - -#define EBI_CTL1_CACCESS_Pos (4) /*!< EBI_T::CTL1: CACCESS Position */ -#define EBI_CTL1_CACCESS_Msk (0x1ul << EBI_CTL1_CACCESS_Pos) /*!< EBI_T::CTL1: CACCESS Mask */ - -#define EBI_CTL1_MCLKDIV_Pos (8) /*!< EBI_T::CTL1: MCLKDIV Position */ -#define EBI_CTL1_MCLKDIV_Msk (0x7ul << EBI_CTL1_MCLKDIV_Pos) /*!< EBI_T::CTL1: MCLKDIV Mask */ - -#define EBI_CTL1_TALE_Pos (16) /*!< EBI_T::CTL1: TALE Position */ -#define EBI_CTL1_TALE_Msk (0x7ul << EBI_CTL1_TALE_Pos) /*!< EBI_T::CTL1: TALE Mask */ - -#define EBI_CTL1_WBUFEN_Pos (24) /*!< EBI_T::CTL1: WBUFEN Position */ -#define EBI_CTL1_WBUFEN_Msk (0x1ul << EBI_CTL1_WBUFEN_Pos) /*!< EBI_T::CTL1: WBUFEN Mask */ - -#define EBI_TCTL1_TACC_Pos (3) /*!< EBI_T::TCTL1: TACC Position */ -#define EBI_TCTL1_TACC_Msk (0x1ful << EBI_TCTL1_TACC_Pos) /*!< EBI_T::TCTL1: TACC Mask */ - -#define EBI_TCTL1_TAHD_Pos (8) /*!< EBI_T::TCTL1: TAHD Position */ -#define EBI_TCTL1_TAHD_Msk (0x7ul << EBI_TCTL1_TAHD_Pos) /*!< EBI_T::TCTL1: TAHD Mask */ - -#define EBI_TCTL1_W2X_Pos (12) /*!< EBI_T::TCTL1: W2X Position */ -#define EBI_TCTL1_W2X_Msk (0xful << EBI_TCTL1_W2X_Pos) /*!< EBI_T::TCTL1: W2X Mask */ - -#define EBI_TCTL1_RAHDOFF_Pos (22) /*!< EBI_T::TCTL1: RAHDOFF Position */ -#define EBI_TCTL1_RAHDOFF_Msk (0x1ul << EBI_TCTL1_RAHDOFF_Pos) /*!< EBI_T::TCTL1: RAHDOFF Mask */ - -#define EBI_TCTL1_WAHDOFF_Pos (23) /*!< EBI_T::TCTL1: WAHDOFF Position */ -#define EBI_TCTL1_WAHDOFF_Msk (0x1ul << EBI_TCTL1_WAHDOFF_Pos) /*!< EBI_T::TCTL1: WAHDOFF Mask */ - -#define EBI_TCTL1_R2R_Pos (24) /*!< EBI_T::TCTL1: R2R Position */ -#define EBI_TCTL1_R2R_Msk (0xful << EBI_TCTL1_R2R_Pos) /*!< EBI_T::TCTL1: R2R Mask */ - -#define EBI_CTL2_EN_Pos (0) /*!< EBI_T::CTL2: EN Position */ -#define EBI_CTL2_EN_Msk (0x1ul << EBI_CTL2_EN_Pos) /*!< EBI_T::CTL2: EN Mask */ - -#define EBI_CTL2_DW16_Pos (1) /*!< EBI_T::CTL2: DW16 Position */ -#define EBI_CTL2_DW16_Msk (0x1ul << EBI_CTL2_DW16_Pos) /*!< EBI_T::CTL2: DW16 Mask */ - -#define EBI_CTL2_CSPOLINV_Pos (2) /*!< EBI_T::CTL2: CSPOLINV Position */ -#define EBI_CTL2_CSPOLINV_Msk (0x1ul << EBI_CTL2_CSPOLINV_Pos) /*!< EBI_T::CTL2: CSPOLINV Mask */ - -#define EBI_CTL2_ADSEPEN_Pos (3) /*!< EBI_T::CTL2: ADSEPEN Position */ -#define EBI_CTL2_ADSEPEN_Msk (0x1ul << EBI_CTL2_ADSEPEN_Pos) /*!< EBI_T::CTL2: ADSEPEN Mask */ - -#define EBI_CTL2_CACCESS_Pos (4) /*!< EBI_T::CTL2: CACCESS Position */ -#define EBI_CTL2_CACCESS_Msk (0x1ul << EBI_CTL2_CACCESS_Pos) /*!< EBI_T::CTL2: CACCESS Mask */ - -#define EBI_CTL2_MCLKDIV_Pos (8) /*!< EBI_T::CTL2: MCLKDIV Position */ -#define EBI_CTL2_MCLKDIV_Msk (0x7ul << EBI_CTL2_MCLKDIV_Pos) /*!< EBI_T::CTL2: MCLKDIV Mask */ - -#define EBI_CTL2_TALE_Pos (16) /*!< EBI_T::CTL2: TALE Position */ -#define EBI_CTL2_TALE_Msk (0x7ul << EBI_CTL2_TALE_Pos) /*!< EBI_T::CTL2: TALE Mask */ - -#define EBI_CTL2_WBUFEN_Pos (24) /*!< EBI_T::CTL2: WBUFEN Position */ -#define EBI_CTL2_WBUFEN_Msk (0x1ul << EBI_CTL2_WBUFEN_Pos) /*!< EBI_T::CTL2: WBUFEN Mask */ - -#define EBI_TCTL2_TACC_Pos (3) /*!< EBI_T::TCTL2: TACC Position */ -#define EBI_TCTL2_TACC_Msk (0x1ful << EBI_TCTL2_TACC_Pos) /*!< EBI_T::TCTL2: TACC Mask */ - -#define EBI_TCTL2_TAHD_Pos (8) /*!< EBI_T::TCTL2: TAHD Position */ -#define EBI_TCTL2_TAHD_Msk (0x7ul << EBI_TCTL2_TAHD_Pos) /*!< EBI_T::TCTL2: TAHD Mask */ - -#define EBI_TCTL2_W2X_Pos (12) /*!< EBI_T::TCTL2: W2X Position */ -#define EBI_TCTL2_W2X_Msk (0xful << EBI_TCTL2_W2X_Pos) /*!< EBI_T::TCTL2: W2X Mask */ - -#define EBI_TCTL2_RAHDOFF_Pos (22) /*!< EBI_T::TCTL2: RAHDOFF Position */ -#define EBI_TCTL2_RAHDOFF_Msk (0x1ul << EBI_TCTL2_RAHDOFF_Pos) /*!< EBI_T::TCTL2: RAHDOFF Mask */ - -#define EBI_TCTL2_WAHDOFF_Pos (23) /*!< EBI_T::TCTL2: WAHDOFF Position */ -#define EBI_TCTL2_WAHDOFF_Msk (0x1ul << EBI_TCTL2_WAHDOFF_Pos) /*!< EBI_T::TCTL2: WAHDOFF Mask */ - -#define EBI_TCTL2_R2R_Pos (24) /*!< EBI_T::TCTL2: R2R Position */ -#define EBI_TCTL2_R2R_Msk (0xful << EBI_TCTL2_R2R_Pos) /*!< EBI_T::TCTL2: R2R Mask */ - -/**@}*/ /* EBI_CONST */ -/**@}*/ /* end of EBI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EBI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ecap_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ecap_reg.h deleted file mode 100644 index 6584e6f5565..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ecap_reg.h +++ /dev/null @@ -1,389 +0,0 @@ -/**************************************************************************//** - * @file ecap_reg.h - * @brief ECAP register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __ECAP_REG_H__ -#define __ECAP_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ECAP Enhanced Input Capture Timer(ECAP) - Memory Mapped Structure for ECAP Controller -@{ */ - -typedef struct -{ - - /** - * @var ECAP_T::CNT - * Offset: 0x00 Input Capture Counter (24-bit up counter) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Input Capture Timer/Counter - * | | |The input Capture Timer/Counter is a 24-bit up-counting counter - * | | |The clock source for the counter is from the clock divider - * @var ECAP_T::HLD0 - * Offset: 0x04 Input Capture Hold Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD1 - * Offset: 0x08 Input Capture Hold Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::HLD2 - * Offset: 0x0C Input Capture Hold Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |HOLD |Input Capture Counter Hold Register - * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register - * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively. - * @var ECAP_T::CNTCMP - * Offset: 0x10 Input Capture Compare Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNTCMP |Input Capture Counter Compare Register - * | | |If the compare function is enabled (CMPEN = 1), this register (ECAP_CNTCMP) is used to compare with the capture counter (ECAP_CNT). - * | | |If the reload control is enabled (RLDEN[n] = 1, n=0~3), an overflow event or capture events will trigger the hardware to load the value of this register (ECAP_CNTCMP) into ECAP_CNT. - * @var ECAP_T::CTL0 - * Offset: 0x14 Input Capture Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection - * | | |To determine the sampling frequency of the Noise Filter clock - * | | |000 = CAP_CLK. - * | | |001 = CAP_CLK/2. - * | | |010 = CAP_CLK/4. - * | | |011 = CAP_CLK/16. - * | | |100 = CAP_CLK/32. - * | | |101 = CAP_CLK/64. - * |[3] |CAPNFDIS |Input Capture Noise Filter Disable Control - * | | |0 = Noise filter of Input Capture Enabled. - * | | |1 = Noise filter of Input Capture Disabled (Bypass). - * |[4] |IC0EN |Port Pin IC0 Input to Input Capture Unit Enable Control - * | | |0 = IC0 input to Input Capture Unit Disabled. - * | | |1 = IC0 input to Input Capture Unit Enabled. - * |[5] |IC1EN |Port Pin IC1 Input to Input Capture Unit Enable Control - * | | |0 = IC1 input to Input Capture Unit Disabled. - * | | |1 = IC1 input to Input Capture Unit Enabled. - * |[6] |IC2EN |Port Pin IC2 Input to Input Capture Unit Enable Control - * | | |0 = IC2 input to Input Capture Unit Disabled. - * | | |1 = IC2 input to Input Capture Unit Enabled. - * |[9:8] |CAPSEL0 |CAP0 Input Source Selection - * | | |00 = CAP0 input is from port pin ICAP0. - * | | |01 = Reserved. - * | | |10 = CAP0 input is from signal CHA of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[11:10] |CAPSEL1 |CAP1 Input Source Selection - * | | |00 = CAP1 input is from port pin ICAP1. - * | | |01 = Reserved. - * | | |10 = CAP1 input is from signal CHB of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[13:12] |CAPSEL2 |CAP2 Input Source Selection - * | | |00 = CAP2 input is from port pin ICAP2. - * | | |01 = Reserved. - * | | |10 = CAP2 input is from signal CHX of QEI controller unit n. - * | | |11 = Reserved. - * | | |Note: Input capture unit n matches QEIn, where n = 0~1. - * |[16] |CAPIEN0 |Input Capture Channel 0 Interrupt Enable Control - * | | |0 = The flag CAPTF0 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF0 can trigger Input Capture interrupt Enabled. - * |[17] |CAPIEN1 |Input Capture Channel 1 Interrupt Enable Control - * | | |0 = The flag CAPTF1 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF1 can trigger Input Capture interrupt Enabled. - * |[18] |CAPIEN2 |Input Capture Channel 2 Interrupt Enable Control - * | | |0 = The flag CAPTF2 can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPTF2 can trigger Input Capture interrupt Enabled. - * |[20] |OVIEN |CAPOVF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPOVF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPOVF can trigger Input Capture interrupt Enabled. - * |[21] |CMPIEN |CAPCMPF Trigger Input Capture Interrupt Enable Control - * | | |0 = The flag CAPCMPF can trigger Input Capture interrupt Disabled. - * | | |1 = The flag CAPCMPF can trigger Input Capture interrupt Enabled. - * |[24] |CNTEN |Input Capture Counter Start Counting Control - * | | |Setting this bit to 1, the capture counter (ECAP_CNT) starts up-counting synchronously with the clock from the . - * | | |0 = ECAP_CNT stop counting. - * | | |1 = ECAP_CNT starts up-counting. - * |[25] |CMPCLREN |Input Capture Counter Cleared by Compare-match Control - * | | |If this bit is set to 1, the capture counter (ECAP_CNT) will be cleared to 0 when the compare-match event (CAPCMPF = 1) occurs. - * | | |0 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Enabled. - * |[28] |CMPEN |Compare Function Enable Control - * | | |The compare function in input capture timer/counter is to compare the dynamic counting ECAP_CNT with the compare register ECAP_CNTCMP, if ECAP_CNT value reaches ECAP_CNTCMP, the flag CAPCMPF will be set. - * | | |0 = The compare function Disabled. - * | | |1 = The compare function Enabled. - * |[29] |CAPEN |Input Capture Timer/Counter Enable Control - * | | |0 = Input Capture function Disabled. - * | | |1 = Input Capture function Enabled. - * @var ECAP_T::CTL1 - * Offset: 0x18 Input Capture Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |EDGESEL0 |Channel 0 Captured Edge Selection - * | | |Input capture0 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[3:2] |EDGESEL1 |Channel 1 Captured Edge Selection - * | | |Input capture1 can detect falling edge change only, rising edge change only or both edge change - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[5:4] |EDGESEL2 |Channel 2 Captured Edge Selection - * | | |Input capture2 can detect falling edge change only, rising edge change only or both edge changes - * | | |00 = Detect rising edge only. - * | | |01 = Detect falling edge only. - * | | |1x = Detect both rising and falling edge. - * |[8] |CAP0RLDEN |Capture Counter Reload Function Triggered by Event CAPTE0 Enable Bit - * | | |0 = The reload triggered by Event CAPTE0 Disabled. - * | | |1 = The reload triggered by Event CAPTE0 Enabled. - * |[9] |CAP1RLDEN |Capture Counter Reload Function Triggered by Event CAPTE1 Enable Bit - * | | |0 = The reload triggered by Event CAPTE1 Disabled. - * | | |1 = The reload triggered by Event CAPTE1 Enabled. - * |[10] |CAP2RLDEN |Capture Counter Reload Function Triggered by Event CAPTE2 Enable Bit - * | | |0 = The reload triggered by Event CAPTE2 Disabled. - * | | |1 = The reload triggered by Event CAPTE2 Enabled. - * |[11] |OVRLDEN |Capture Counter Reload Function Triggered by Overflow Enable Bit - * | | |0 = The reload triggered by CAPOV Disabled. - * | | |1 = The reload triggered by CAPOV Enabled. - * |[14:12] |CLKSEL |Capture Timer Clock Divide Selection - * | | |The capture timer clock has a pre-divider with eight divided options controlled by CLKSEL[2:0]. - * | | |000 = CAP_CLK/1. - * | | |001 = CAP_CLK/4. - * | | |010 = CAP_CLK/16. - * | | |011 = CAP_CLK/32. - * | | |100 = CAP_CLK/64. - * | | |101 = CAP_CLK/96. - * | | |110 = CAP_CLK/112. - * | | |111 = CAP_CLK/128. - * |[17:16] |CNTSRCSEL |Capture Timer/Counter Clock Source Selection - * | | |Select the capture timer/counter clock source. - * | | |00 = CAP_CLK (default). - * | | |01 = CAP0. - * | | |10 = CAP1. - * | | |11 = CAP2. - * |[20] |CAP0CLREN |Capture Counter Cleared by Capture Event0 Control - * | | |0 = Event CAPTE0 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE0 can clear capture counter (ECAP_CNT) Enabled. - * |[21] |CAP1CLREN |Capture Counter Cleared by Capture Event1 Control - * | | |0 = Event CAPTE1 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE1 can clear capture counter (ECAP_CNT) Enabled. - * |[22] |CAP2CLREN |Capture Counter Cleared by Capture Event2 Control - * | | |0 = Event CAPTE2 can clear capture counter (ECAP_CNT) Disabled. - * | | |1 = Event CAPTE2 can clear capture counter (ECAP_CNT) Enabled. - * @var ECAP_T::STATUS - * Offset: 0x1C Input Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPTF0 |Input Capture Channel 0 Triggered Flag - * | | |When the input capture channel 0 detects a valid edge change at CAP0 input, it will set flag CAPTF0 to high. - * | | |0 = No valid edge change has been detected at CAP0 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP0 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[1] |CAPTF1 |Input Capture Channel 1 Triggered Flag - * | | |When the input capture channel 1 detects a valid edge change at CAP1 input, it will set flag CAPTF1 to high. - * | | |0 = No valid edge change has been detected at CAP1 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP1 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[2] |CAPTF2 |Input Capture Channel 2 Triggered Flag - * | | |When the input capture channel 2 detects a valid edge change at CAP2 input, it will set flag CAPTF2 to high. - * | | |0 = No valid edge change has been detected at CAP2 input since last clear. - * | | |1 = At least a valid edge change has been detected at CAP2 input since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[4] |CAPCMPF |Input Capture Compare-match Flag - * | | |If the input capture compare function is enabled, the flag is set by hardware when capture counter (ECAP_CNT) up counts and reaches the ECAP_CNTCMP value. - * | | |0 = ECAP_CNT has not matched ECAP_CNTCMP value since last clear. - * | | |1 = ECAP_CNT has matched ECAP_CNTCMP value at least once since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[5] |CAPOVF |Input Capture Counter Overflow Flag - * | | |Flag is set by hardware when counter (ECAP_CNT) overflows from 0x00FF_FFFF to zero. - * | | |0 = No overflow event has occurred since last clear. - * | | |1 = Overflow event(s) has/have occurred since last clear. - * | | |Note: This bit is only cleared by writing 1 to it. - * |[6] |CAP0 |Value of Input Channel 0, CAP0 (Read Only) - * | | |Reflecting the value of input channel 0, CAP0 - * | | |(The bit is read only and write is ignored) - * |[7] |CAP1 |Value of Input Channel 1, CAP1 (Read Only) - * | | |Reflecting the value of input channel 1, CAP1 - * | | |(The bit is read only and write is ignored) - * |[8] |CAP2 |Value of Input Channel 2, CAP2 (Read Only) - * | | |Reflecting the value of input channel 2, CAP2. - * | | |(The bit is read only and write is ignored) - */ - __IO uint32_t CNT; /*!< [0x0000] Input Capture Counter */ - __IO uint32_t HLD0; /*!< [0x0004] Input Capture Hold Register 0 */ - __IO uint32_t HLD1; /*!< [0x0008] Input Capture Hold Register 1 */ - __IO uint32_t HLD2; /*!< [0x000c] Input Capture Hold Register 2 */ - __IO uint32_t CNTCMP; /*!< [0x0010] Input Capture Compare Register */ - __IO uint32_t CTL0; /*!< [0x0014] Input Capture Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0018] Input Capture Control Register 1 */ - __IO uint32_t STATUS; /*!< [0x001c] Input Capture Status Register */ - -} ECAP_T; - -/** - @addtogroup ECAP_CONST ECAP Bit Field Definition - Constant Definitions for ECAP Controller -@{ */ - -#define ECAP_CNT_CNT_Pos (0) /*!< ECAP_T::CNT: CNT Position */ -#define ECAP_CNT_CNT_Msk (0xfffffful << ECAP_CNT_CNT_Pos) /*!< ECAP_T::CNT: CNT Mask */ - -#define ECAP_HLD0_HOLD_Pos (0) /*!< ECAP_T::HLD0: HOLD Position */ -#define ECAP_HLD0_HOLD_Msk (0xfffffful << ECAP_HLD0_HOLD_Pos) /*!< ECAP_T::HLD0: HOLD Mask */ - -#define ECAP_HLD1_HOLD_Pos (0) /*!< ECAP_T::HLD1: HOLD Position */ -#define ECAP_HLD1_HOLD_Msk (0xfffffful << ECAP_HLD1_HOLD_Pos) /*!< ECAP_T::HLD1: HOLD Mask */ - -#define ECAP_HLD2_HOLD_Pos (0) /*!< ECAP_T::HLD2: HOLD Position */ -#define ECAP_HLD2_HOLD_Msk (0xfffffful << ECAP_HLD2_HOLD_Pos) /*!< ECAP_T::HLD2: HOLD Mask */ - -#define ECAP_CNTCMP_CNTCMP_Pos (0) /*!< ECAP_T::CNTCMP: CNTCMP Position */ -#define ECAP_CNTCMP_CNTCMP_Msk (0xfffffful << ECAP_CNTCMP_CNTCMP_Pos) /*!< ECAP_T::CNTCMP: CNTCMP Mask */ - -#define ECAP_CTL0_NFCLKSEL_Pos (0) /*!< ECAP_T::CTL0: NFCLKSEL Position */ -#define ECAP_CTL0_NFCLKSEL_Msk (0x7ul << ECAP_CTL0_NFCLKSEL_Pos) /*!< ECAP_T::CTL0: NFCLKSEL Mask */ - -#define ECAP_CTL0_CAPNFDIS_Pos (3) /*!< ECAP_T::CTL0: CAPNFDIS Position */ -#define ECAP_CTL0_CAPNFDIS_Msk (0x1ul << ECAP_CTL0_CAPNFDIS_Pos) /*!< ECAP_T::CTL0: CAPNFDIS Mask */ - -#define ECAP_CTL0_IC0EN_Pos (4) /*!< ECAP_T::CTL0: IC0EN Position */ -#define ECAP_CTL0_IC0EN_Msk (0x1ul << ECAP_CTL0_IC0EN_Pos) /*!< ECAP_T::CTL0: IC0EN Mask */ - -#define ECAP_CTL0_IC1EN_Pos (5) /*!< ECAP_T::CTL0: IC1EN Position */ -#define ECAP_CTL0_IC1EN_Msk (0x1ul << ECAP_CTL0_IC1EN_Pos) /*!< ECAP_T::CTL0: IC1EN Mask */ - -#define ECAP_CTL0_IC2EN_Pos (6) /*!< ECAP_T::CTL0: IC2EN Position */ -#define ECAP_CTL0_IC2EN_Msk (0x1ul << ECAP_CTL0_IC2EN_Pos) /*!< ECAP_T::CTL0: IC2EN Mask */ - -#define ECAP_CTL0_CAPSEL0_Pos (8) /*!< ECAP_T::CTL0: CAPSEL0 Position */ -#define ECAP_CTL0_CAPSEL0_Msk (0x3ul << ECAP_CTL0_CAPSEL0_Pos) /*!< ECAP_T::CTL0: CAPSEL0 Mask */ - -#define ECAP_CTL0_CAPSEL1_Pos (10) /*!< ECAP_T::CTL0: CAPSEL1 Position */ -#define ECAP_CTL0_CAPSEL1_Msk (0x3ul << ECAP_CTL0_CAPSEL1_Pos) /*!< ECAP_T::CTL0: CAPSEL1 Mask */ - -#define ECAP_CTL0_CAPSEL2_Pos (12) /*!< ECAP_T::CTL0: CAPSEL2 Position */ -#define ECAP_CTL0_CAPSEL2_Msk (0x3ul << ECAP_CTL0_CAPSEL2_Pos) /*!< ECAP_T::CTL0: CAPSEL2 Mask */ - -#define ECAP_CTL0_CAPIEN0_Pos (16) /*!< ECAP_T::CTL0: CAPIEN0 Position */ -#define ECAP_CTL0_CAPIEN0_Msk (0x1ul << ECAP_CTL0_CAPIEN0_Pos) /*!< ECAP_T::CTL0: CAPIEN0 Mask */ - -#define ECAP_CTL0_CAPIEN1_Pos (17) /*!< ECAP_T::CTL0: CAPIEN1 Position */ -#define ECAP_CTL0_CAPIEN1_Msk (0x1ul << ECAP_CTL0_CAPIEN1_Pos) /*!< ECAP_T::CTL0: CAPIEN1 Mask */ - -#define ECAP_CTL0_CAPIEN2_Pos (18) /*!< ECAP_T::CTL0: CAPIEN2 Position */ -#define ECAP_CTL0_CAPIEN2_Msk (0x1ul << ECAP_CTL0_CAPIEN2_Pos) /*!< ECAP_T::CTL0: CAPIEN2 Mask */ - -#define ECAP_CTL0_OVIEN_Pos (20) /*!< ECAP_T::CTL0: OVIEN Position */ -#define ECAP_CTL0_OVIEN_Msk (0x1ul << ECAP_CTL0_OVIEN_Pos) /*!< ECAP_T::CTL0: OVIEN Mask */ - -#define ECAP_CTL0_CMPIEN_Pos (21) /*!< ECAP_T::CTL0: CMPIEN Position */ -#define ECAP_CTL0_CMPIEN_Msk (0x1ul << ECAP_CTL0_CMPIEN_Pos) /*!< ECAP_T::CTL0: CMPIEN Mask */ - -#define ECAP_CTL0_CNTEN_Pos (24) /*!< ECAP_T::CTL0: CNTEN Position */ -#define ECAP_CTL0_CNTEN_Msk (0x1ul << ECAP_CTL0_CNTEN_Pos) /*!< ECAP_T::CTL0: CNTEN Mask */ - -#define ECAP_CTL0_CMPCLREN_Pos (25) /*!< ECAP_T::CTL0: CMPCLREN Position */ -#define ECAP_CTL0_CMPCLREN_Msk (0x1ul << ECAP_CTL0_CMPCLREN_Pos) /*!< ECAP_T::CTL0: CMPCLREN Mask */ - -#define ECAP_CTL0_CMPEN_Pos (28) /*!< ECAP_T::CTL0: CMPEN Position */ -#define ECAP_CTL0_CMPEN_Msk (0x1ul << ECAP_CTL0_CMPEN_Pos) /*!< ECAP_T::CTL0: CMPEN Mask */ - -#define ECAP_CTL0_CAPEN_Pos (29) /*!< ECAP_T::CTL0: CAPEN Position */ -#define ECAP_CTL0_CAPEN_Msk (0x1ul << ECAP_CTL0_CAPEN_Pos) /*!< ECAP_T::CTL0: CAPEN Mask */ - -#define ECAP_CTL1_EDGESEL0_Pos (0) /*!< ECAP_T::CTL1: EDGESEL0 Position */ -#define ECAP_CTL1_EDGESEL0_Msk (0x3ul << ECAP_CTL1_EDGESEL0_Pos) /*!< ECAP_T::CTL1: EDGESEL0 Mask */ - -#define ECAP_CTL1_EDGESEL1_Pos (2) /*!< ECAP_T::CTL1: EDGESEL1 Position */ -#define ECAP_CTL1_EDGESEL1_Msk (0x3ul << ECAP_CTL1_EDGESEL1_Pos) /*!< ECAP_T::CTL1: EDGESEL1 Mask */ - -#define ECAP_CTL1_EDGESEL2_Pos (4) /*!< ECAP_T::CTL1: EDGESEL2 Position */ -#define ECAP_CTL1_EDGESEL2_Msk (0x3ul << ECAP_CTL1_EDGESEL2_Pos) /*!< ECAP_T::CTL1: EDGESEL2 Mask */ - -#define ECAP_CTL1_CAP0RLDEN_Pos (8) /*!< ECAP_T::CTL1: CAP0RLDEN Position */ -#define ECAP_CTL1_CAP0RLDEN_Msk (0x1ul << ECAP_CTL1_CAP0RLDEN_Pos) /*!< ECAP_T::CTL1: CAP0RLDEN Mask */ - -#define ECAP_CTL1_CAP1RLDEN_Pos (9) /*!< ECAP_T::CTL1: CAP1RLDEN Position */ -#define ECAP_CTL1_CAP1RLDEN_Msk (0x1ul << ECAP_CTL1_CAP1RLDEN_Pos) /*!< ECAP_T::CTL1: CAP1RLDEN Mask */ - -#define ECAP_CTL1_CAP2RLDEN_Pos (10) /*!< ECAP_T::CTL1: CAP2RLDEN Position */ -#define ECAP_CTL1_CAP2RLDEN_Msk (0x1ul << ECAP_CTL1_CAP2RLDEN_Pos) /*!< ECAP_T::CTL1: CAP2RLDEN Mask */ - -#define ECAP_CTL1_OVRLDEN_Pos (11) /*!< ECAP_T::CTL1: OVRLDEN Position */ -#define ECAP_CTL1_OVRLDEN_Msk (0x1ul << ECAP_CTL1_OVRLDEN_Pos) /*!< ECAP_T::CTL1: OVRLDEN Mask */ - -#define ECAP_CTL1_CLKSEL_Pos (12) /*!< ECAP_T::CTL1: CLKSEL Position */ -#define ECAP_CTL1_CLKSEL_Msk (0x7ul << ECAP_CTL1_CLKSEL_Pos) /*!< ECAP_T::CTL1: CLKSEL Mask */ - -#define ECAP_CTL1_CNTSRCSEL_Pos (16) /*!< ECAP_T::CTL1: CNTSRCSEL Position */ -#define ECAP_CTL1_CNTSRCSEL_Msk (0x3ul << ECAP_CTL1_CNTSRCSEL_Pos) /*!< ECAP_T::CTL1: CNTSRCSEL Mask */ - -#define ECAP_CTL1_CAP0CLREN_Pos (20) /*!< ECAP_T::CTL1: CAP0CLREN Position */ -#define ECAP_CTL1_CAP0CLREN_Msk (0x1ul << ECAP_CTL1_CAP0CLREN_Pos) /*!< ECAP_T::CTL1: CAP0CLREN Mask */ - -#define ECAP_CTL1_CAP1CLREN_Pos (21) /*!< ECAP_T::CTL1: CAP1CLREN Position */ -#define ECAP_CTL1_CAP1CLREN_Msk (0x1ul << ECAP_CTL1_CAP1CLREN_Pos) /*!< ECAP_T::CTL1: CAP1CLREN Mask */ - -#define ECAP_CTL1_CAP2CLREN_Pos (22) /*!< ECAP_T::CTL1: CAP2CLREN Position */ -#define ECAP_CTL1_CAP2CLREN_Msk (0x1ul << ECAP_CTL1_CAP2CLREN_Pos) /*!< ECAP_T::CTL1: CAP2CLREN Mask */ - -#define ECAP_STATUS_CAPTF0_Pos (0) /*!< ECAP_T::STATUS: CAPTF0 Position */ -#define ECAP_STATUS_CAPTF0_Msk (0x1ul << ECAP_STATUS_CAPTF0_Pos) /*!< ECAP_T::STATUS: CAPTF0 Mask */ - -#define ECAP_STATUS_CAPTF1_Pos (1) /*!< ECAP_T::STATUS: CAPTF1 Position */ -#define ECAP_STATUS_CAPTF1_Msk (0x1ul << ECAP_STATUS_CAPTF1_Pos) /*!< ECAP_T::STATUS: CAPTF1 Mask */ - -#define ECAP_STATUS_CAPTF2_Pos (2) /*!< ECAP_T::STATUS: CAPTF2 Position */ -#define ECAP_STATUS_CAPTF2_Msk (0x1ul << ECAP_STATUS_CAPTF2_Pos) /*!< ECAP_T::STATUS: CAPTF2 Mask */ - -#define ECAP_STATUS_CAPCMPF_Pos (4) /*!< ECAP_T::STATUS: CAPCMPF Position */ -#define ECAP_STATUS_CAPCMPF_Msk (0x1ul << ECAP_STATUS_CAPCMPF_Pos) /*!< ECAP_T::STATUS: CAPCMPF Mask */ - -#define ECAP_STATUS_CAPOVF_Pos (5) /*!< ECAP_T::STATUS: CAPOVF Position */ -#define ECAP_STATUS_CAPOVF_Msk (0x1ul << ECAP_STATUS_CAPOVF_Pos) /*!< ECAP_T::STATUS: CAPOVF Mask */ - -#define ECAP_STATUS_CAP0_Pos (8) /*!< ECAP_T::STATUS: CAP0 Position */ -#define ECAP_STATUS_CAP0_Msk (0x1ul << ECAP_STATUS_CAP0_Pos) /*!< ECAP_T::STATUS: CAP0 Mask */ - -#define ECAP_STATUS_CAP1_Pos (9) /*!< ECAP_T::STATUS: CAP1 Position */ -#define ECAP_STATUS_CAP1_Msk (0x1ul << ECAP_STATUS_CAP1_Pos) /*!< ECAP_T::STATUS: CAP1 Mask */ - -#define ECAP_STATUS_CAP2_Pos (10) /*!< ECAP_T::STATUS: CAP2 Position */ -#define ECAP_STATUS_CAP2_Msk (0x1ul << ECAP_STATUS_CAP2_Pos) /*!< ECAP_T::STATUS: CAP2 Mask */ - -/**@}*/ /* ECAP_CONST */ -/**@}*/ /* end of ECAP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __ECAP_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/epwm_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/epwm_reg.h deleted file mode 100644 index 7f6d0879002..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/epwm_reg.h +++ /dev/null @@ -1,4978 +0,0 @@ -/**************************************************************************//** - * @file epwm_reg.h - * @brief EPWM register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EPWM_REG_H__ -#define __EPWM_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Enhanced PWM Generator -------------------------*/ -/** - @addtogroup EPWM Enhanced PWM Generator(EPWM) - Memory Mapped Structure for EPWM Controller -@{ */ - -typedef struct -{ - /** - * @var ECAPDAT_T::RCAPDAT - * Offset: 0x20C EPWM Rising Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var ECAPDAT_T::FCAPDAT - * Offset: 0x210 EPWM Falling Capture Data Register 0~5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - */ - __IO uint32_t RCAPDAT; /*!< [0x20C/0x214/0x21C/0x224/0x22C/0x234] EPWM Rising Capture Data Register 0~5 */ - __IO uint32_t FCAPDAT; /*!< [0x210/0x218/0x220/0x228/0x230/0x238] EPWM Falling Capture Data Register 0~5 */ -} ECAPDAT_T; - -typedef struct -{ - - - /** - * @var EPWM_T::CTL0 - * Offset: 0x00 EPWM Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTRLD0 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[1] |CTRLD1 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[2] |CTRLD2 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[3] |CTRLD3 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[4] |CTRLD4 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[5] |CTRLD5 |Center Re-load - * | | |In up-down counter type, PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the center point of a period - * |[8] |WINLDEN0 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[9] |WINLDEN1 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[10] |WINLDEN2 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[11] |WINLDEN3 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[12] |WINLDEN4 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[13] |WINLDEN5 |Window Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point of each period when valid reload window is set - * | | |The valid reload window is set by software write 1 to EPWM_LOAD register and cleared by hardware after load success. - * |[16] |IMMLDEN0 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[17] |IMMLDEN1 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[18] |IMMLDEN2 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[19] |IMMLDEN3 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[20] |IMMLDEN4 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[21] |IMMLDEN5 |Immediately Load Enable Bits - * | | |0 = PERIOD will load to PBUF at the end point of each period - * | | |CMPDAT will load to CMPBUF at the end point or center point of each period by setting CTRLD bit. - * | | |1 = PERIOD/CMPDAT will load to PBUF and CMPBUF immediately when software update PERIOD/CMPDAT. - * | | |Note: If IMMLDENn is enabled, WINLDENn and CTRLDn will be invalid. - * |[24] |GROUPEN |Group Function Enable Bit - * | | |0 = The output waveform of each EPWM channel are independent. - * | | |1 = Unify the EPWM_CH2 and EPWM_CH4 to output the same waveform as EPWM_CH0 and unify the EPWM_CH3 and EPWM_CH5 to output the same waveform as EPWM_CH1. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If counter halt is enabled, all EPWM counters will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt Disabled. - * | | |1 = ICE debug mode counter halt Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects EPWM output. - * | | |EPWM pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |EPWM pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var EPWM_T::CTL1 - * Offset: 0x04 EPWM Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CNTTYPE0 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[3:2] |CNTTYPE1 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[5:4] |CNTTYPE2 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[7:6] |CNTTYPE3 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[9:8] |CNTTYPE4 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[11:10] |CNTTYPE5 |EPWM Counter Behavior Type - * | | |00 = Up counter type (supported in capture mode). - * | | |01 = Down count type (supported in capture mode). - * | | |10 = Up-down counter type. - * | | |11 = Reserved. - * |[16] |CNTMODE0 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[17] |CNTMODE1 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[18] |CNTMODE2 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[19] |CNTMODE3 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[20] |CNTMODE4 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[21] |CNTMODE5 |EPWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[24] |OUTMODE0 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[25] |OUTMODE2 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * |[26] |OUTMODE4 |EPWM Output Mode - * | | |Each bit n controls the output mode of corresponding EPWM channel n. - * | | |0 = EPWM independent mode. - * | | |1 = EPWM complementary mode. - * | | |Note: When operating in group function, these bits must all set to the same mode. - * @var EPWM_T::SYNC - * Offset: 0x08 EPWM Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PHSEN0 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disabled to load PHS value. - * | | |1 = EPWM counter enabled to load PHS value. - * |[1] |PHSEN2 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disabled to load PHS value. - * | | |1 = EPWM counter enabled to load PHS value. - * |[2] |PHSEN4 |SYNC Phase Enable Bits - * | | |0 = EPWM counter disabled to load PHS value. - * | | |1 = EPWM counter enabled to load PHS value. - * |[9:8] |SINSRC0 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[11:10] |SINSRC2 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[13:12] |SINSRC4 |EPWM0_SYNC_IN Source Selection - * | | |00 = Synchronize source from SYNC_IN or SWSYNC. - * | | |01 = Counter equal to 0. - * | | |10 = Counter equal to EPWM_CMPDATm, m denotes 1, 3, 5. - * | | |11 = SYNC_OUT will not be generated. - * |[16] |SNFLTEN |EPWM0_SYNC_IN Noise Filter Enable Bits - * | | |0 = Noise filter of input pin EPWM0_SYNC_IN Disabled. - * | | |1 = Noise filter of input pin EPWM0_SYNC_IN Enabled. - * |[19:17] |SFLTCSEL |SYNC Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[22:20] |SFLTCNT |SYNC Edge Detector Filter Count - * | | |The register bits control the counter number of edge detector. - * |[23] |SINPINV |SYNC Input Pin Inverse - * | | |0 = The state of pin SYNC is passed to the negative edge detector. - * | | |1 = The inversed state of pin SYNC is passed to the negative edge detector. - * |[24] |PHSDIR0 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[25] |PHSDIR2 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * |[26] |PHSDIR4 |EPWM Phase Direction Control - * | | |0 = Control EPWM counter count decrement after synchronizing. - * | | |1 = Control EPWM counter count increment after synchronizing. - * @var EPWM_T::SWSYNC - * Offset: 0x0C EPWM Software Control Synchronization Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWSYNC0 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source comes from SYNC_IN or this bit. - * |[1] |SWSYNC2 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source comes from SYNC_IN or this bit. - * |[2] |SWSYNC4 |Software SYNC Function - * | | |When SINSRCn (EPWM_SYNC[13:8]) is selected to 0, SYNC_OUT source comes from SYNC_IN or this bit. - * @var EPWM_T::CLKSRC - * Offset: 0x10 EPWM Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |ECLKSRC0 |EPWM_CH01 External Clock Source Select - * | | |0000 = EPWMx_CLK, x denotes 0, 1 or 2. - * | | |0001 = TIMER0 overflow. - * | | |0010 = TIMER1 overflow. - * | | |0011 = TIMER2 overflow. - * | | |0100 = TIMER3 overflow. - * | | |0101 = TIMER4 overflow. - * | | |0110 = TIMER5 overflow. - * | | |0111 = TIMER6 overflow. - * | | |1000 = TIMER7 overflow. - * | | |1001 = TIMER8 overflow. - * | | |1010 = TIMER9 overflow. - * | | |1011 = TIMER10 overflow. - * | | |1100 = TIMER11 overflow. - * | | |Others = Reserved. - * |[11:8] |ECLKSRC2 |EPWM_CH23 External Clock Source Select - * | | |0000 = EPWMx_CLK, x denotes 0, 1 or 2. - * | | |0001 = TIMER0 overflow. - * | | |0010 = TIMER1 overflow. - * | | |0011 = TIMER2 overflow. - * | | |0100 = TIMER3 overflow. - * | | |0101 = TIMER4 overflow. - * | | |0110 = TIMER5 overflow. - * | | |0111 = TIMER6 overflow. - * | | |1000 = TIMER7 overflow. - * | | |1001 = TIMER8 overflow. - * | | |1010 = TIMER9 overflow. - * | | |1011 = TIMER10 overflow. - * | | |1100 = TIMER11 overflow. - * | | |Others = Reserved. - * |[19:16] |ECLKSRC4 |EPWM_CH45 External Clock Source Select - * | | |0000 = EPWMx_CLK, x denotes 0, 1 or 2. - * | | |0001 = TIMER0 overflow. - * | | |0010 = TIMER1 overflow. - * | | |0011 = TIMER2 overflow. - * | | |0100 = TIMER3 overflow. - * | | |0101 = TIMER4 overflow. - * | | |0110 = TIMER5 overflow. - * | | |0111 = TIMER6 overflow. - * | | |1000 = TIMER7 overflow. - * | | |1001 = TIMER8 overflow. - * | | |1010 = TIMER9 overflow. - * | | |1011 = TIMER10 overflow. - * | | |1100 = TIMER11 overflow. - * | | |Others = Reserved. - * @var EPWM_T::CLKPSC0_1 - * Offset: 0x14 EPWM Clock Prescale Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair share one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CLKPSC2_3 - * Offset: 0x18 EPWM Clock Prescale Register 2/3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair share one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CLKPSC4_5 - * Offset: 0x1C EPWM Clock Prescale Register 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |EPWM Counter Clock Prescale - * | | |The clock of EPWM counter is decided by clock prescaler - * | | |Each EPWM pair share one EPWM counter clock prescaler - * | | |The clock of EPWM counter is divided by (CLKPSC+ 1) - * @var EPWM_T::CNTEN - * Offset: 0x20 EPWM Counter Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN0 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[1] |CNTEN1 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[2] |CNTEN2 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[3] |CNTEN3 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[4] |CNTEN4 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * |[5] |CNTEN5 |EPWM Counter Enable Bits - * | | |0 = EPWM Counter and clock prescaler stop running. - * | | |1 = EPWM Counter and clock prescaler start running. - * @var EPWM_T::CNTCLR - * Offset: 0x24 EPWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR0 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[1] |CNTCLR1 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[2] |CNTCLR2 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[3] |CNTCLR3 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[4] |CNTCLR4 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * |[5] |CNTCLR5 |Clear EPWM Counter Control Bit - * | | |It is automatically cleared by hardware. Each bit n controls the corresponding EPWM channel n. - * | | |0 = No effect. - * | | |1 = Clear 16-bit EPWM counter to 0000H. - * @var EPWM_T::LOAD - * Offset: 0x28 EPWM Load Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LOAD0 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write, hardware clear when current EPWM period ended. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit is only used in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[1] |LOAD1 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write, hardware clear when current EPWM period ended. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit is only used in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[2] |LOAD2 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write, hardware clear when current EPWM period ended. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit is only used in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[3] |LOAD3 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write, hardware clear when current EPWM period ended. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit is only used in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[4] |LOAD4 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write, hardware clear when current EPWM period ended. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit is only used in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * |[5] |LOAD5 |Re-load EPWM Comparator Register Control Bit - * | | |This bit is software write, hardware clear when current EPWM period ended. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set load window of window loading mode. - * | | |Read Operation: - * | | |0 = No load window is set. - * | | |1 = Load window is set. - * | | |Note: This bit is only used in window loading mode, WINLDENn(EPWM_CTL0[13:8]) = 1. - * @var EPWM_T::PERIOD0 - * Offset: 0x30 EPWM Period Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Down-Count mode: - * | | |In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Up-Down-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * (CLKPSC+1) * EPWM_CLK. - * @var EPWM_T::PERIOD1 - * Offset: 0x34 EPWM Period Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Down-Count mode: - * | | |In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Up-Down-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * (CLKPSC+1) * EPWM_CLK. - * @var EPWM_T::PERIOD2 - * Offset: 0x38 EPWM Period Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Down-Count mode: - * | | |In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Up-Down-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * (CLKPSC+1) * EPWM_CLK. - * @var EPWM_T::PERIOD3 - * Offset: 0x3C EPWM Period Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Down-Count mode: - * | | |In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Up-Down-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * (CLKPSC+1) * EPWM_CLK. - * @var EPWM_T::PERIOD4 - * Offset: 0x40 EPWM Period Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Down-Count mode: - * | | |In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Up-Down-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * (CLKPSC+1) * EPWM_CLK. - * @var EPWM_T::PERIOD5 - * Offset: 0x44 EPWM Period Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |EPWM Period Register - * | | |Up-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Down-Count mode: - * | | |In this mode, EPWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |EPWM period time = (PERIOD+1) * (CLKPSC+1) * EPWM_CLK . - * | | |Up-Down-Count mode: - * | | |In this mode, EPWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |EPWM period time = 2 * PERIOD * (CLKPSC+1) * EPWM_CLK. - * @var EPWM_T::CMPDAT0 - * Offset: 0x50 EPWM Comparator Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP is used to compare with CNT (EPWM_CNTn[15:0]) bits to generate EPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 is denoted as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 is denoted as the first compared point, and CMPDAT1, 3, 5 is denoted as the second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::CMPDAT1 - * Offset: 0x54 EPWM Comparator Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP is used to compare with CNT (EPWM_CNTn[15:0]) bits to generate EPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 is denoted as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 is denoted as the first compared point, and CMPDAT1, 3, 5 is denoted as the second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::CMPDAT2 - * Offset: 0x58 EPWM Comparator Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP is used to compare with CNT (EPWM_CNTn[15:0]) bits to generate EPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 is denoted as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 is denoted as the first compared point, and CMPDAT1, 3, 5 is denoted as the second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::CMPDAT3 - * Offset: 0x5C EPWM Comparator Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP is used to compare with CNT (EPWM_CNTn[15:0]) bits to generate EPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 is denoted as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 is denoted as the first compared point, and CMPDAT1, 3, 5 is denoted as the second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::CMPDAT4 - * Offset: 0x60 EPWM Comparator Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP is used to compare with CNT (EPWM_CNTn[15:0]) bits to generate EPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 is denoted as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 is denoted as the first compared point, and CMPDAT1, 3, 5 is denoted as the second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::CMPDAT5 - * Offset: 0x64 EPWM Comparator Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |EPWM Comparator Register - * | | |CMP is used to compare with CNT (EPWM_CNTn[15:0]) bits to generate EPWM waveform, interrupt and trigger EADC. - * | | |In independent mode, CMPDAT0~5 is denoted as 6 independent EPWM_CH0~5 compared point. - * | | |In complementary mode, CMPDAT0, 2, 4 is denoted as the first compared point, and CMPDAT1, 3, 5 is denoted as the second compared point for the corresponding 3 complementary pairs EPWM_CH0 and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::DTCTL0_1 - * Offset: 0x70 EPWM Dead-time Control Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |DTCKSEL=0: Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period. - * | | |DTCKSEL=1: Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[16] |DTEN |Enable Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Dead-time insertion disabled on the pin pair. - * | | |1 = Dead-time insertion enabled on the pin pair. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from EPWM_CLK. - * | | |1 = Dead-time clock source from prescaler output. - * | | |Note: This bit is write protected. Refer to REGWRPROT register. - * @var EPWM_T::DTCTL2_3 - * Offset: 0x74 EPWM Dead-time Control Register 2/3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |DTCKSEL=0: Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period. - * | | |DTCKSEL=1: Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[16] |DTEN |Enable Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Dead-time insertion disabled on the pin pair. - * | | |1 = Dead-time insertion enabled on the pin pair. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from EPWM_CLK. - * | | |1 = Dead-time clock source from prescaler output. - * | | |Note: This bit is write protected. Refer to REGWRPROT register. - * @var EPWM_T::DTCTL4_5 - * Offset: 0x78 EPWM Dead-time Control Register 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following formula: - * | | |DTCKSEL=0: Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period. - * | | |DTCKSEL=1: Dead-time = (DTCNT[11:0]+1) * EPWM_CLK period * (CLKPSC+1). - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[16] |DTEN |Enable Dead-time Insertion for EPWM Pair (Write Protect) - * | | |Dead-time insertion is only active when this pair of complementary EPWM is enabled - * | | |If dead- time insertion is inactive, the outputs of pin pair are complementary without any delay. - * | | |0 = Dead-time insertion disabled on the pin pair. - * | | |1 = Dead-time insertion enabled on the pin pair. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from EPWM_CLK. - * | | |1 = Dead-time clock source from prescaler output. - * | | |Note: This bit is write protected. Refer to REGWRPROT register. - * @var EPWM_T::PHS0_1 - * Offset: 0x80 EPWM Counter Phase Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PHS |EPWM Synchronous Start Phase Bits - * | | |PHS determines the EPWM synchronous start phase value - * | | |These bits are only used for synchronous function. - * @var EPWM_T::PHS2_3 - * Offset: 0x84 EPWM Counter Phase Register 2/3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PHS |EPWM Synchronous Start Phase Bits - * | | |PHS determines the EPWM synchronous start phase value - * | | |These bits are only used for synchronous function. - * @var EPWM_T::PHS4_5 - * Offset: 0x88 EPWM Counter Phase Register 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PHS |EPWM Synchronous Start Phase Bits - * | | |PHS determines the EPWM synchronous start phase value - * | | |These bits are only used for synchronous function. - * @var EPWM_T::CNT0 - * Offset: 0x90 EPWM Counter Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNT to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is counting down. - * | | |1 = Counter is counting up. - * @var EPWM_T::CNT1 - * Offset: 0x94 EPWM Counter Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNT to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is counting down. - * | | |1 = Counter is counting up. - * @var EPWM_T::CNT2 - * Offset: 0x98 EPWM Counter Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNT to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is counting down. - * | | |1 = Counter is counting up. - * @var EPWM_T::CNT3 - * Offset: 0x9C EPWM Counter Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNT to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is counting down. - * | | |1 = Counter is counting up. - * @var EPWM_T::CNT4 - * Offset: 0xA0 EPWM Counter Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNT to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is counting down. - * | | |1 = Counter is counting up. - * @var EPWM_T::CNT5 - * Offset: 0xA4 EPWM Counter Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |EPWM Data Register (Read Only) - * | | |User can monitor CNT to know the current value in 16-bit period counter. - * |[16] |DIRF |EPWM Direction Indicator Flag (Read Only) - * | | |0 = Counter is counting down. - * | | |1 = Counter is counting up. - * @var EPWM_T::WGCTL0 - * Offset: 0xB0 EPWM Generation Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |ZPCTL0 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[3:2] |ZPCTL1 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[5:4] |ZPCTL2 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[7:6] |ZPCTL3 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[9:8] |ZPCTL4 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[11:10] |ZPCTL5 |EPWM Zero Point Control - * | | |EPWM can control output level when EPWM counter counts to 0. - * | | |00 = Do nothing. - * | | |01 = EPWM zero point output Low. - * | | |10 = EPWM zero point output High. - * | | |11 = EPWM zero point output Toggle. - * |[17:16] |PRDPCTL0 |EPWM Period Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[19:18] |PRDPCTL1 |EPWM Period Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[21:20] |PRDPCTL2 |EPWM Period Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[23:22] |PRDPCTL3 |EPWM Period Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[25:24] |PRDPCTL4 |EPWM Period Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * |[27:26] |PRDPCTL5 |EPWM Period Point Control - * | | |EPWM can control output level when EPWM counter counts to (PERIODn+1). - * | | |00 = Do nothing. - * | | |01 = EPWM period (center) point output Low. - * | | |10 = EPWM period (center) point output High. - * | | |11 = EPWM period (center) point output Toggle. - * | | |Note: This bit is center point control when EPWM counter operating in up-down counter type. - * @var EPWM_T::WGCTL1 - * Offset: 0xB4 EPWM Generation Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CMPUCTL0 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[3:2] |CMPUCTL1 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[5:4] |CMPUCTL2 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[7:6] |CMPUCTL3 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[9:8] |CMPUCTL4 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[11:10] |CMPUCTL5 |EPWM Compare Up Point Control - * | | |EPWM can control output level when EPWM counter counts up to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare up point output Low. - * | | |10 = EPWM compare up point output High. - * | | |11 = EPWM compare up point output Toggle. - * | | |Note: In complementary mode, CMPUCTL1, 3, 5 is used as another CMPUCTL for channel 0, 2, 4. - * |[17:16] |CMPDCTL0 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[19:18] |CMPDCTL1 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[21:20] |CMPDCTL2 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[23:22] |CMPDCTL3 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[25:24] |CMPDCTL4 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * |[27:26] |CMPDCTL5 |EPWM Compare Down Point Control - * | | |EPWM can control output level when EPWM counter counts down to CMPDAT. - * | | |00 = Do nothing. - * | | |01 = EPWM compare down point output Low. - * | | |10 = EPWM compare down point output High. - * | | |11 = EPWM compare down point output Toggle. - * | | |Note: In complementary mode, CMPDCTL1, 3, 5 is used as another CMPDCTL for channel 0, 2, 4. - * @var EPWM_T::MSKEN - * Offset: 0xB8 EPWM Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[1] |MSKEN1 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[2] |MSKEN2 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[3] |MSKEN3 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[4] |MSKEN4 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * |[5] |MSKEN5 |EPWM Mask Enable Bits - * | | |The EPWM output signal will be masked when this bit is enabled - * | | |The corresponding EPWM channel n will output MSKDATn (EPWM_MSK[5:0]) data. - * | | |0 = EPWM output signal is non-masked. - * | | |1 = EPWM output signal is masked and output MSKDATn data. - * @var EPWM_T::MSK - * Offset: 0xBC EPWM Mask Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[1] |MSKDAT1 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[2] |MSKDAT2 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[3] |MSKDAT3 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[4] |MSKDAT4 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * |[5] |MSKDAT5 |EPWM Mask Data Bit - * | | |This data bit control the state of EPWMn output pin, if corresponding mask function is enabled. - * | | |0 = Output logic low to EPWM channel n. - * | | |1 = Output logic high to EPWM channel n. - * @var EPWM_T::BNF - * Offset: 0xC0 EPWM Brake Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRK0NFEN |EPWM Brake 0 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 0 Disabled. - * | | |1 = Noise filter of EPWM Brake 0 Enabled. - * |[3:1] |BRK0NFSEL |Brake 0 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[6:4] |BRK0FCNT |Brake 0 Edge Detector Filter Count - * | | |The register bits control the Brake0 filter counter to count from 0 to BRK0FCNT. - * |[7] |BRK0PINV |Brake 0 Pin Inverse - * | | |0 = brake pin event will be detected if EPWMx BRAKE0 pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = brake pin event will be detected if EPWMx BRAKE0 pin status transfer from high to low in edge-detect, or pin status is low in level-detect. - * |[8] |BRK1NFEN |EPWM Brake 1 Noise Filter Enable Bit - * | | |0 = Noise filter of EPWM Brake 1 Disabled. - * | | |1 = Noise filter of EPWM Brake 1 Enabled. - * |[11:9] |BRK1NFSEL |Brake 1 Edge Detector Filter Clock Selection - * | | |000 = Filter clock = HCLK. - * | | |001 = Filter clock = HCLK/2. - * | | |010 = Filter clock = HCLK/4. - * | | |011 = Filter clock = HCLK/8. - * | | |100 = Filter clock = HCLK/16. - * | | |101 = Filter clock = HCLK/32. - * | | |110 = Filter clock = HCLK/64. - * | | |111 = Filter clock = HCLK/128. - * |[14:12] |BRK1FCNT |Brake 1 Edge Detector Filter Count - * | | |The register bits control the Brake1 filter counter to count from 0 to BRK1FCNT. - * |[15] |BRK1PINV |Brake 1 Pin Inverse - * | | |0 = brake pin event will be detected if EPWMx BRAKE1 pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = brake pin event will be detected if EPWMx BRAKE1 pin status transfer from high to low in edge-detect, or pin status is low in level-detect. - * |[17:16] |BK0SRC |Brake 0 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 0 pin source come from EPWM0_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |2 = Brake 0 pin source come from EPWM2_BRAKE0. - * | | |For EPWM1 setting: - * | | |0 = Brake 0 pin source come from EPWM1_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM0_BRAKE0. - * | | |2 = Brake 1 pin source come from EPWM2_BRAKE0. - * | | |For EPWM2 setting: - * | | |0 = Brake 0 pin source come from EPWM2_BRAKE0. - * | | |1 = Brake 0 pin source come from EPWM0_BRAKE0. - * | | |2 = Brake 1 pin source come from EPWM1_BRAKE0. - * |[25:24] |BK1SRC |Brake 1 Pin Source Select - * | | |For EPWM0 setting: - * | | |0 = Brake 1 pin source come from EPWM0_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |2 = Brake 1 pin source come from EPWM2_BRAKE1. - * | | |For EPWM1 setting: - * | | |0 = Brake 1 pin source come from EPWM1_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM0_BRAKE1. - * | | |2 = Brake 1 pin source come from EPWM2_BRAKE1. - * | | |For EPWM2 setting: - * | | |0 = Brake 1 pin source come from EPWM2_BRAKE1. - * | | |1 = Brake 1 pin source come from EPWM0_BRAKE1. - * | | |2 = Brake 1 pin source come from EPWM1_BRAKE1. - * @var EPWM_T::FAILBRK - * Offset: 0xC4 EPWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by CSS detection Disabled. - * | | |1 = Brake Function triggered by CSS detection Enabled. - * |[1] |LVDBRKEN |Low Voltage Interrupt Flag Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by LVD Disabled. - * | | |1 = Brake Function triggered by LVD Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger EPWM Brake Function 0 Enable Bit - * | | |0 = Brake Function triggered by Core lockup detection Disabled. - * | | |1 = Brake Function triggered by Core lockup detection Enabled. - * @var EPWM_T::BRKCTL0_1 - * Offset: 0xC8 EPWM Brake Edge Detect Control Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |BRKP0EEN |Enable EPWMx_BRAKE0 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[5] |BRKP1EEN |Enable EPWMx_BRAKE1 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as edge-detect brake source Disabled. - * | | |1 = System Fail condition as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[12] |BRKP0LEN |Enable BKP0 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[13] |BRKP1LEN |Enable BKP1 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as level-detect brake source Disabled. - * | | |1 = System Fail condition as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[17:16] |BRKAEVEN |EPWM Brake Action Select for Even Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect even channels output. - * | | |01 = EPWM even channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM even channel output low level when EPWMx brake event happened. - * | | |11 = EPWM even channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[19:18] |BRKAODD |EPWM Brake Action Select for Odd Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect odd channels output. - * | | |01 = EPWM odd channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM odd channel output low level when EPWMx brake event happened. - * | | |11 = EPWM odd channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[20] |EADCEBEN |Enable EADC Result Monitor As Edge-detect Brake Source (Write Protect) - * | | |0 = EADCRM as edge-detect brake source Disabled. - * | | |1 = EADCRM as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[28] |EADCLBEN |Enable EADC Result Monitor As Level-detect Brake Source (Write Protect) - * | | |0 = EADCRM as level-detect brake source Disabled. - * | | |1 = EADCRM as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var EPWM_T::BRKCTL2_3 - * Offset: 0xCC EPWM Brake Edge Detect Control Register 2/3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |BRKP0EEN |Enable EPWMx_BRAKE0 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[5] |BRKP1EEN |Enable EPWMx_BRAKE1 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as edge-detect brake source Disabled. - * | | |1 = System Fail condition as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[12] |BRKP0LEN |Enable BKP0 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[13] |BRKP1LEN |Enable BKP1 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as level-detect brake source Disabled. - * | | |1 = System Fail condition as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[17:16] |BRKAEVEN |EPWM Brake Action Select for Even Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect even channels output. - * | | |01 = EPWM even channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM even channel output low level when EPWMx brake event happened. - * | | |11 = EPWM even channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[19:18] |BRKAODD |EPWM Brake Action Select for Odd Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect odd channels output. - * | | |01 = EPWM odd channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM odd channel output low level when EPWMx brake event happened. - * | | |11 = EPWM odd channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[20] |EADCEBEN |Enable EADC Result Monitor As Edge-detect Brake Source (Write Protect) - * | | |0 = EADCRM as edge-detect brake source Disabled. - * | | |1 = EADCRM as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[28] |EADCLBEN |Enable EADC Result Monitor As Level-detect Brake Source (Write Protect) - * | | |0 = EADCRM as level-detect brake source Disabled. - * | | |1 = EADCRM as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var EPWM_T::BRKCTL4_5 - * Offset: 0xD0 EPWM Brake Edge Detect Control Register 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |BRKP0EEN |Enable EPWMx_BRAKE0 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[5] |BRKP1EEN |Enable EPWMx_BRAKE1 Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as edge-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as edge-detect brake source Disabled. - * | | |1 = System Fail condition as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[12] |BRKP0LEN |Enable BKP0 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE0 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE0 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[13] |BRKP1LEN |Enable BKP1 Pin As Level-detect Brake Source (Write Protect) - * | | |0 = EPWMx_BRAKE1 pin as level-detect brake source Disabled. - * | | |1 = EPWMx_BRAKE1 pin as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System Fail condition as level-detect brake source Disabled. - * | | |1 = System Fail condition as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[17:16] |BRKAEVEN |EPWM Brake Action Select for Even Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect even channels output. - * | | |01 = EPWM even channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM even channel output low level when EPWMx brake event happened. - * | | |11 = EPWM even channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[19:18] |BRKAODD |EPWM Brake Action Select for Odd Channel (Write Protect) - * | | |00 = EPWMx brake event will not affect odd channels output. - * | | |01 = EPWM odd channel output tri-state when EPWMx brake event happened. - * | | |10 = EPWM odd channel output low level when EPWMx brake event happened. - * | | |11 = EPWM odd channel output high level when EPWMx brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[20] |EADCEBEN |Enable EADC Result Monitor As Edge-detect Brake Source (Write Protect) - * | | |0 = EADCRM as edge-detect brake source Disabled. - * | | |1 = EADCRM as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[28] |EADCLBEN |Enable EADC Result Monitor As Level-detect Brake Source (Write Protect) - * | | |0 = EADCRM as level-detect brake source Disabled. - * | | |1 = EADCRM as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var EPWM_T::POLCTL - * Offset: 0xD4 EPWM Pin Polar Inverse Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[1] |PINV1 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[2] |PINV2 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[3] |PINV3 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[4] |PINV4 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * |[5] |PINV5 |EPWM PIN Polar Inverse Control - * | | |The register controls polarity state of EPWMx_CHn output pin. - * | | |0 = EPWMx_CHn output pin polar inverse Disabled. - * | | |1 = EPWMx_CHn output pin polar inverse Enabled. - * @var EPWM_T::POEN - * Offset: 0xD8 EPWM Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[1] |POEN1 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[2] |POEN2 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[3] |POEN3 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[4] |POEN4 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * |[5] |POEN5 |EPWM Pin Output Enable Bits - * | | |0 = EPWMx_CHn pin at tri-state. - * | | |1 = EPWMx_CHn pin in output mode. - * @var EPWM_T::SWBRK - * Offset: 0xDC EPWM Software Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG0 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[1] |BRKETRG2 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[2] |BRKETRG4 |EPWM Edge Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger edge brake, and set BRKEIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[8] |BRKLTRG0 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[9] |BRKLTRG2 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[10] |BRKLTRG4 |EPWM Level Brake Software Trigger (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger level brake, and set BRKLIFn to 1 in EPWM_INTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * @var EPWM_T::INTEN0 - * Offset: 0xE0 EPWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN0 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[1] |ZIEN1 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[2] |ZIEN2 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[3] |ZIEN3 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[4] |ZIEN4 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[5] |ZIEN5 |EPWM Zero Point Interrupt Enable Bits - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * | | |Note: Odd channels will read always 0 at complementary mode. - * |[8] |PIEN0 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note 1: When up-down counter type period point means center point. - * | | |Note 2: Odd channels will read always 0 at complementary mode. - * |[9] |PIEN1 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note 1: When up-down counter type period point means center point. - * | | |Note 2: Odd channels will read always 0 at complementary mode. - * |[10] |PIEN2 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note 1: When up-down counter type period point means center point. - * | | |Note 2: Odd channels will read always 0 at complementary mode. - * |[11] |PIEN3 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note 1: When up-down counter type period point means center point. - * | | |Note 2: Odd channels will read always 0 at complementary mode. - * |[12] |PIEN4 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note 1: When up-down counter type period point means center point. - * | | |Note 2: Odd channels will read always 0 at complementary mode. - * |[13] |PIEN5 |EPWM Period Point Interrupt Enable Bits - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note 1: When up-down counter type period point means center point. - * | | |Note 2: Odd channels will read always 0 at complementary mode. - * |[16] |CMPUIEN0 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[17] |CMPUIEN1 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[18] |CMPUIEN2 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[19] |CMPUIEN3 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[20] |CMPUIEN4 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[21] |CMPUIEN5 |EPWM Compare Up Count Interrupt Enable Bits - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * | | |Note: In complementary mode, CMPUIEN1, 3, 5 is used as another CMPUIEN for channel 0, 2, 4. - * |[24] |CMPDIEN0 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[25] |CMPDIEN1 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[26] |CMPDIEN2 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[27] |CMPDIEN3 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[28] |CMPDIEN4 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * |[29] |CMPDIEN5 |EPWM Compare Down Count Interrupt Enable Bits - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * | | |Note: In complementary mode, CMPDIEN1, 3, 5 is used as another CMPDIEN for channel 0, 2, 4. - * @var EPWM_T::INTEN1 - * Offset: 0xE4 EPWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN0_1|EPWM Edge-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[1] |BRKEIEN2_3|EPWM Edge-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[2] |BRKEIEN4_5|EPWM Edge-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Edge-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Edge-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[8] |BRKLIEN0_1|EPWM Level-detect Brake Interrupt Enable for Channel0/1 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel0/1 Disabled. - * | | |1 = Level-detect Brake interrupt for channel0/1 Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[9] |BRKLIEN2_3|EPWM Level-detect Brake Interrupt Enable for Channel2/3 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel2/3 Disabled. - * | | |1 = Level-detect Brake interrupt for channel2/3 Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[10] |BRKLIEN4_5|EPWM Level-detect Brake Interrupt Enable for Channel4/5 (Write Protect) - * | | |0 = Level-detect Brake interrupt for channel4/5 Disabled. - * | | |1 = Level-detect Brake interrupt for channel4/5 Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * @var EPWM_T::INTSTS0 - * Offset: 0xE8 EPWM Interrupt Flag Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF0 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[1] |ZIF1 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[2] |ZIF2 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[3] |ZIF3 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[4] |ZIF4 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[5] |ZIF5 |EPWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches 0. - * | | |Note: This bit can be cleared to 0 by software writing 1 - * |[8] |PIF0 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[9] |PIF1 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[10] |PIF2 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[11] |PIF3 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[12] |PIF4 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[13] |PIF5 |EPWM Period Point Interrupt Flag - * | | |This bit is set by hardware when EPWM counter reaches EPWM_PERIODn. - * | | |Note: This bit can be cleared to 0 by software writing 1. - * |[16] |CMPUIF0 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[17] |CMPUIF1 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[18] |CMPUIF2 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[19] |CMPUIF3 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[20] |CMPUIF4 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[21] |CMPUIF5 |EPWM Compare Up Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter up count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPUIF1, 3, 5 is used as another CMPUIF for channel 0, 2, 4. - * |[24] |CMPDIF0 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[25] |CMPDIF1 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[26] |CMPDIF2 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[27] |CMPDIF3 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[28] |CMPDIF4 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * |[29] |CMPDIF5 |EPWM Compare Down Count Interrupt Flag - * | | |Flag is set by hardware when EPWM counter down count and reaches EPWM_CMPDATn, software can clear this bit by writing 1 to it. - * | | |Note: In complementary mode, CMPDIF1, 3, 5 is used as another CMPDIF for channel 0, 2, 4. - * @var EPWM_T::INTSTS1 - * Offset: 0xEC EPWM Interrupt Flag Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |EPWM Channel n Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n edge-detect brake event do not happened. - * | | |1 = When EPWM channel n edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[1] |BRKEIF1 |EPWM Channel n Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n edge-detect brake event do not happened. - * | | |1 = When EPWM channel n edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[2] |BRKEIF2 |EPWM Channel n Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n edge-detect brake event do not happened. - * | | |1 = When EPWM channel n edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[3] |BRKEIF3 |EPWM Channel n Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n edge-detect brake event do not happened. - * | | |1 = When EPWM channel n edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[4] |BRKEIF4 |EPWM Channel n Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n edge-detect brake event do not happened. - * | | |1 = When EPWM channel n edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[5] |BRKEIF5 |EPWM Channel n Edge-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n edge-detect brake event do not happened. - * | | |1 = When EPWM channel n edge-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[8] |BRKLIF0 |EPWM Channel n Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n level-detect brake event do not happened. - * | | |1 = When EPWM channel n level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[9] |BRKLIF1 |EPWM Channel n Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n level-detect brake event do not happened. - * | | |1 = When EPWM channel n level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[10] |BRKLIF2 |EPWM Channel n Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n level-detect brake event do not happened. - * | | |1 = When EPWM channel n level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[11] |BRKLIF3 |EPWM Channel n Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n level-detect brake event do not happened. - * | | |1 = When EPWM channel n level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[12] |BRKLIF4 |EPWM Channel n Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n level-detect brake event do not happened. - * | | |1 = When EPWM channel n level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[13] |BRKLIF5 |EPWM Channel n Level-detect Brake Interrupt Flag (Write Protect) - * | | |0 = EPWM channel n level-detect brake event do not happened. - * | | |1 = When EPWM channel n level-detect brake event happened, this bit is set to 1, writing 1 to clear. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[16] |BRKESTS0 |EPWM Channel n Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel n edge-detect brake state is released. - * | | |1 = When EPWM channel n edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[17] |BRKESTS1 |EPWM Channel n Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel n edge-detect brake state is released. - * | | |1 = When EPWM channel n edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[18] |BRKESTS2 |EPWM Channel n Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel n edge-detect brake state is released. - * | | |1 = When EPWM channel n edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[19] |BRKESTS3 |EPWM Channel n Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel n edge-detect brake state is released. - * | | |1 = When EPWM channel n edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[20] |BRKESTS4 |EPWM Channel n Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel n edge-detect brake state is released. - * | | |1 = When EPWM channel n edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[21] |BRKESTS5 |EPWM Channel n Edge-detect Brake Status (Read Only) - * | | |0 = EPWM channel n edge-detect brake state is released. - * | | |1 = When EPWM channel n edge-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When edge-detect brake interrupt flag is cleared, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[24] |BRKLSTS0 |EPWM Channel n Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel n level-detect brake state is released. - * | | |1 = When EPWM channel n level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[25] |BRKLSTS1 |EPWM Channel n Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel n level-detect brake state is released. - * | | |1 = When EPWM channel n level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[26] |BRKLSTS2 |EPWM Channel n Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel n level-detect brake state is released. - * | | |1 = When EPWM channel n level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[27] |BRKLSTS3 |EPWM Channel n Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel n level-detect brake state is released. - * | | |1 = When EPWM channel n level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[28] |BRKLSTS4 |EPWM Channel n Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel n level-detect brake state is released. - * | | |1 = When EPWM channel n level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * |[29] |BRKLSTS5 |EPWM Channel n Level-detect Brake Status (Read Only) - * | | |0 = EPWM channel n level-detect brake state is released. - * | | |1 = When EPWM channel n level-detect brake detects a falling edge of any enabled brake source; this flag will be set to indicate the EPWM channel n at brake state. - * | | |Note: This bit is read only and auto cleared by hardware - * | | |When enabled brake source return to high level, EPWM will release brake state until current EPWM period finished - * | | |The EPWM waveform will start output from next full EPWM period. - * @var EPWM_T::EADCTS0 - * Offset: 0xF8 EPWM Trigger EADC Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL0 |EPWM_CH0 Trigger EADC Source Select - * | | |0000 = EPWM_CH0 zero point. - * | | |0001 = EPWM_CH0 period point. - * | | |0010 = EPWM_CH0 zero or period point. - * | | |0011 = EPWM_CH0 up-count compared point. - * | | |0100 = EPWM_CH0 down-count compared point. - * | | |0101 = EPWM_CH1 zero point. - * | | |0110 = EPWM_CH1 period point. - * | | |0111 = EPWM_CH1 zero or period point. - * | | |1000 = EPWM_CH1 up-count compared point. - * | | |1001 = EPWM_CH1 down-count compared point. - * | | |1010 = EPWM_CH0 up-count free trigger compared point. - * | | |1011 = EPWM_CH0 down-count free trigger compared point. - * | | |1100 = EPWM_CH2 up-count free trigger compared point. - * | | |1101 = EPWM_CH2 down-count free trigger compared point. - * | | |1110 = EPWM_CH4 up-count free trigger compared point. - * | | |1111 = EPWM_CH4 down-count free trigger compared point. - * |[7] |TRGEN0 |EPWM_CH0 Trigger EADC Enable Bit - * | | |0 = EPWM_CH0 Trigger EADC function Disabled. - * | | |1 = EPWM_CH0 Trigger EADC function Enabled. - * |[11:8] |TRGSEL1 |EPWM_CH1 Trigger EADC Source Select - * | | |0000 = EPWM_CH0 zero point. - * | | |0001 = EPWM_CH0 period point. - * | | |0010 = EPWM_CH0 zero or period point. - * | | |0011 = EPWM_CH0 up-count compared point. - * | | |0100 = EPWM_CH0 down-count compared point. - * | | |0101 = EPWM_CH1 zero point. - * | | |0110 = EPWM_CH1 period point. - * | | |0111 = EPWM_CH1 zero or period point. - * | | |1000 = EPWM_CH1 up-count compared point. - * | | |1001 = EPWM_CH1 down-count compared point. - * | | |1010 = EPWM_CH0 up-count free trigger compared point. - * | | |1011 = EPWM_CH0 down-count free trigger compared point. - * | | |1100 = EPWM_CH2 up-count free trigger compared point. - * | | |1101 = EPWM_CH2 down-count free trigger compared point. - * | | |1110 = EPWM_CH4 up-count free trigger compared point. - * | | |1111 = EPWM_CH4 down-count free trigger compared point. - * |[15] |TRGEN1 |EPWM_CH1 Trigger EADC Enable Bit - * | | |0 = EPWM_CH1 Trigger EADC function Disabled. - * | | |1 = EPWM_CH1 Trigger EADC function Enabled. - * |[19:16] |TRGSEL2 |EPWM_CH2 Trigger EADC Source Select - * | | |0000 = EPWM_CH2 zero point. - * | | |0001 = EPWM_CH2 period point. - * | | |0010 = EPWM_CH2 zero or period point. - * | | |0011 = EPWM_CH2 up-count compared point. - * | | |0100 = EPWM_CH2 down-count compared point. - * | | |0101 = EPWM_CH3 zero point. - * | | |0110 = EPWM_CH3 period point. - * | | |0111 = EPWM_CH3 zero or period point. - * | | |1000 = EPWM_CH3 up-count compared point. - * | | |1001 = EPWM_CH3 down-count compared point. - * | | |1010 = EPWM_CH0 up-count free trigger compared point. - * | | |1011 = EPWM_CH0 down-count free trigger compared point. - * | | |1100 = EPWM_CH2 up-count free trigger compared point. - * | | |1101 = EPWM_CH2 down-count free trigger compared point. - * | | |1110 = EPWM_CH4 up-count free trigger compared point. - * | | |1111 = EPWM_CH4 down-count free trigger compared point. - * |[23] |TRGEN2 |EPWM_CH2 Trigger EADC Enable Bit - * | | |0 = EPWM_CH2 Trigger EADC function Disabled. - * | | |1 = EPWM_CH2 Trigger EADC function Enabled. - * |[27:24] |TRGSEL3 |EPWM_CH3 Trigger EADC Source Select - * | | |0000 = EPWM_CH2 zero point. - * | | |0001 = EPWM_CH2 period point. - * | | |0010 = EPWM_CH2 zero or period point. - * | | |0011 = EPWM_CH2 up-count compared point. - * | | |0100 = EPWM_CH2 down-count compared point. - * | | |0101 = EPWM_CH3 zero point. - * | | |0110 = EPWM_CH3 period point. - * | | |0111 = EPWM_CH3 zero or period point. - * | | |1000 = EPWM_CH3 up-count compared point. - * | | |1001 = EPWM_CH3 down-count compared point. - * | | |1010 = EPWM_CH0 up-count free trigger compared point. - * | | |1011 = EPWM_CH0 down-count free trigger compared point. - * | | |1100 = EPWM_CH2 up-count free trigger compared point. - * | | |1101 = EPWM_CH2 down-count free trigger compared point. - * | | |1110 = EPWM_CH4 up-count free trigger compared point. - * | | |1111 = EPWM_CH4 down-count free trigger compared point. - * |[31] |TRGEN3 |EPWM_CH3 Trigger EADC Enable Bit - * | | |0 = EPWM_CH3 Trigger EADC function Disabled. - * | | |1 = EPWM_CH3 Trigger EADC function Enabled. - * @var EPWM_T::EADCTS1 - * Offset: 0xFC EPWM Trigger EADC Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |TRGSEL4 |EPWM_CH4 Trigger EADC Source Select - * | | |0000 = EPWM_CH4 zero point. - * | | |0001 = EPWM_CH4 period point. - * | | |0010 = EPWM_CH4 zero or period point. - * | | |0011 = EPWM_CH4 up-count compared point. - * | | |0100 = EPWM_CH4 down-count compared point. - * | | |0101 = EPWM_CH5 zero point. - * | | |0110 = EPWM_CH5 period point. - * | | |0111 = EPWM_CH5 zero or period point. - * | | |1000 = EPWM_CH5 up-count compared point. - * | | |1001 = EPWM_CH5 down-count compared point. - * | | |1010 = EPWM_CH0 up-count free trigger compared point. - * | | |1011 = EPWM_CH0 down-count free trigger compared point. - * | | |1100 = EPWM_CH2 up-count free trigger compared point. - * | | |1101 = EPWM_CH2 down-count free trigger compared point. - * | | |1110 = EPWM_CH4 up-count free trigger compared point. - * | | |1111 = EPWM_CH4 down-count free trigger compared point. - * |[7] |TRGEN4 |EPWM_CH4 Trigger EADC Enable Bit - * | | |0 = EPWM_CH4 Trigger EADC function Disabled. - * | | |1 = EPWM_CH4 Trigger EADC function Enabled. - * |[11:8] |TRGSEL5 |EPWM_CH5 Trigger EADC Source Select - * | | |0000 = EPWM_CH4 zero point. - * | | |0001 = EPWM_CH4 period point. - * | | |0010 = EPWM_CH4 zero or period point. - * | | |0011 = EPWM_CH4 up-count compared point. - * | | |0100 = EPWM_CH4 down-count compared point. - * | | |0101 = EPWM_CH5 zero point. - * | | |0110 = EPWM_CH5 period point. - * | | |0111 = EPWM_CH5 zero or period point. - * | | |1000 = EPWM_CH5 up-count compared point. - * | | |1001 = EPWM_CH5 down-count compared point. - * | | |1010 = EPWM_CH0 up-count free trigger compared point. - * | | |1011 = EPWM_CH0 down-count free trigger compared point. - * | | |1100 = EPWM_CH2 up-count free trigger compared point. - * | | |1101 = EPWM_CH2 down-count free trigger compared point. - * | | |1110 = EPWM_CH4 up-count free trigger compared point. - * | | |1111 = EPWM_CH4 down-count free trigger compared point. - * |[15] |TRGEN5 |EPWM_CH5 Trigger EADC Enable Bit - * | | |0 = EPWM_CH5 Trigger EADC function Disabled. - * | | |1 = EPWM_CH5 Trigger EADC function Enabled. - * @var EPWM_T::FTCMPDAT0_1 - * Offset: 0x100 EPWM Free Trigger Compare Register 0/1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMP |EPWM Free Trigger Compare Register - * | | |FTCMP uses to compare with even CNT (EPWM_CNTm[15:0], m=0,2,4) to trigger EADC - * | | |FTCMPDAT0, 2, 4 corresponding complementary pairs EPWM_CH0and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::FTCMPDAT2_3 - * Offset: 0x104 EPWM Free Trigger Compare Register 2/3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMP |EPWM Free Trigger Compare Register - * | | |FTCMP uses to compare with even CNT (EPWM_CNTm[15:0], m=0,2,4) to trigger EADC - * | | |FTCMPDAT0, 2, 4 corresponding complementary pairs EPWM_CH0and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::FTCMPDAT4_5 - * Offset: 0x108 EPWM Free Trigger Compare Register 4/5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMP |EPWM Free Trigger Compare Register - * | | |FTCMP uses to compare with even CNT (EPWM_CNTm[15:0], m=0,2,4) to trigger EADC - * | | |FTCMPDAT0, 2, 4 corresponding complementary pairs EPWM_CH0and EPWM_CH1, EPWM_CH2 and EPWM_CH3, EPWM_CH4 and EPWM_CH5. - * @var EPWM_T::SSCTL - * Offset: 0x110 EPWM Synchronous Start Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSEN0 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[1] |SSEN1 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[2] |SSEN2 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[3] |SSEN3 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[4] |SSEN4 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[5] |SSEN5 |EPWM Synchronous Start Function Enable Bits - * | | |When synchronous start function is enabled, the EPWM counter enable register (EPWM_CNTEN) can be enabled by writing EPWM synchronous start trigger bit (CNTSEN). - * | | |0 = EPWM synchronous start function Disabled. - * | | |1 = EPWM synchronous start function Enabled. - * |[9:8] |SSRC |EPWM Synchronous Start Source Select Bits - * | | |00 = Synchronous start source come from EPWM0. - * | | |01 = Synchronous start source come from EPWM1. - * | | |10 = Synchronous start source come from EPWM2. - * | | |11 = Reserved. - * @var EPWM_T::SSTRG - * Offset: 0x114 EPWM Synchronous Start Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTSEN |EPWM Counter Synchronous Start Enable (Write Only) - * | | |PMW counter synchronous enable function is used to make selected EPWM channels (include EPWM0_CHx and EPWM1_CHx) start counting at the same time. - * | | |Writing this bit to 1 will also set the counter enable bit (CNTENn, n denotes channel 0 to 5) if correlated EPWM channel counter synchronous start function is enabled. - * @var EPWM_T::LEBCTL - * Offset: 0x118 EPWM Leading Edge Blanking Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LEBEN |EPWM Leading Edge Blanking Enable Bit - * | | |0 = EPWM Leading Edge Blanking Disabled. - * | | |1 = EPWM Leading Edge Blanking Enabled. - * |[8] |SRCEN0 |EPWM Leading Edge Blanking Source From EPWM_CH0 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH0 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH0 Enabled. - * |[9] |SRCEN2 |EPWM Leading Edge Blanking Source From EPWM_CH2 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH2 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH2 Enabled. - * |[10] |SRCEN4 |EPWM Leading Edge Blanking Source From EPWM_CH4 Enable Bit - * | | |0 = EPWM Leading Edge Blanking Source from EPWM_CH4 Disabled. - * | | |1 = EPWM Leading Edge Blanking Source from EPWM_CH4 Enabled. - * |[17:16] |TRGTYPE |EPWM Leading Edge Blanking Trigger Type - * | | |0 = When detect leading edge blanking source rising edge, blanking counter start counting. - * | | |1 = When detect leading edge blanking source falling edge, blanking counter start counting. - * | | |2 = When detect leading edge blanking source rising or falling edge, blanking counter start counting. - * | | |3 = Reserved. - * @var EPWM_T::LEBCNT - * Offset: 0x11C EPWM Leading Edge Blanking Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |LEBCNT |EPWM Leading Edge Blanking Counter - * | | |This counter value decides leading edge blanking window size - * | | |Blanking window size = LEBCNT+1, and LEB counter clock base is ECLK. - * @var EPWM_T::STATUS - * Offset: 0x120 EPWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF0 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[1] |CNTMAXF1 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[2] |CNTMAXF2 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[3] |CNTMAXF3 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[4] |CNTMAXF4 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[5] |CNTMAXF5 |Time-base Counter Equal to 0xFFFF Latched Flag - * | | |0 = The time-base counter never reached its maximum value 0xFFFF. - * | | |1 = The time-base counter reached its maximum value. - * | | |Note: This bit can be cleared by software writing 1. - * |[8] |SYNCINF0 |Input Synchronization Latched Flag - * | | |0 = No SYNC_IN event occurred. - * | | |1 = A SYNC_IN event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[9] |SYNCINF2 |Input Synchronization Latched Flag - * | | |0 = No SYNC_IN event occurred. - * | | |1 = A SYNC_IN event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[10] |SYNCINF4 |Input Synchronization Latched Flag - * | | |0 = No SYNC_IN event occurred. - * | | |1 = A SYNC_IN event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[16] |EADCTRGF0 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event occurred. - * | | |1 = An EADC start of conversion trigger event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[17] |EADCTRGF1 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event occurred. - * | | |1 = An EADC start of conversion trigger event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[18] |EADCTRGF2 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event occurred. - * | | |1 = An EADC start of conversion trigger event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[19] |EADCTRGF3 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event occurred. - * | | |1 = An EADC start of conversion trigger event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[20] |EADCTRGF4 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event occurred. - * | | |1 = An EADC start of conversion trigger event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * |[21] |EADCTRGF5 |EADC Start of Conversion Flag - * | | |0 = No EADC start of conversion trigger event occurred. - * | | |1 = An EADC start of conversion trigger event occurred. - * | | |Note: This bit can be cleared by software writing 1. - * @var EPWM_T::IFA0 - * Offset: 0x130 EPWM Interrupt Flag Accumulator Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn Stop Mode Disable. - * | | |1 = EPWM_CHn Stop Mode Enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = EPWM_CHn zero point. - * | | |01 = EPWM_CHn period in channel n. - * | | |10 = EPWM_CHn up-count compared point. - * | | |11 = EPWM_CHn down-count compared point. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator Disabled. - * | | |1 = EPWM_CHn interrupt flag accumulator Enabled. - * @var EPWM_T::IFA1 - * Offset: 0x134 EPWM Interrupt Flag Accumulator Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn Stop Mode Disable. - * | | |1 = EPWM_CHn Stop Mode Enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = EPWM_CHn zero point. - * | | |01 = EPWM_CHn period in channel n. - * | | |10 = EPWM_CHn up-count compared point. - * | | |11 = EPWM_CHn down-count compared point. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator Disabled. - * | | |1 = EPWM_CHn interrupt flag accumulator Enabled. - * @var EPWM_T::IFA2 - * Offset: 0x138 EPWM Interrupt Flag Accumulator Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn Stop Mode Disable. - * | | |1 = EPWM_CHn Stop Mode Enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = EPWM_CHn zero point. - * | | |01 = EPWM_CHn period in channel n. - * | | |10 = EPWM_CHn up-count compared point. - * | | |11 = EPWM_CHn down-count compared point. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator Disabled. - * | | |1 = EPWM_CHn interrupt flag accumulator Enabled. - * @var EPWM_T::IFA3 - * Offset: 0x13C EPWM Interrupt Flag Accumulator Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn Stop Mode Disable. - * | | |1 = EPWM_CHn Stop Mode Enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = EPWM_CHn zero point. - * | | |01 = EPWM_CHn period in channel n. - * | | |10 = EPWM_CHn up-count compared point. - * | | |11 = EPWM_CHn down-count compared point. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator Disabled. - * | | |1 = EPWM_CHn interrupt flag accumulator Enabled. - * @var EPWM_T::IFA4 - * Offset: 0x140 EPWM Interrupt Flag Accumulator Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn Stop Mode Disable. - * | | |1 = EPWM_CHn Stop Mode Enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = EPWM_CHn zero point. - * | | |01 = EPWM_CHn period in channel n. - * | | |10 = EPWM_CHn up-count compared point. - * | | |11 = EPWM_CHn down-count compared point. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator Disabled. - * | | |1 = EPWM_CHn interrupt flag accumulator Enabled. - * @var EPWM_T::IFA5 - * Offset: 0x144 EPWM Interrupt Flag Accumulator Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |IFACNT |EPWM_CHn Interrupt Flag Counter - * | | |The register sets the count number which defines how many times of EPWM_CHn period occurs to set bit IFAIFn to request the EPWM period interrupt. - * | | |EPWM flag will be set in every IFACNT[15:0] times of EPWM period. - * |[24] |STPMOD |EPWM_CHn Accumulator Stop Mode Enable Bits - * | | |0 = EPWM_CHn Stop Mode Disable. - * | | |1 = EPWM_CHn Stop Mode Enable. - * |[29:28] |IFASEL |EPWM_CHn Interrupt Flag Accumulator Source Select - * | | |00 = EPWM_CHn zero point. - * | | |01 = EPWM_CHn period in channel n. - * | | |10 = EPWM_CHn up-count compared point. - * | | |11 = EPWM_CHn down-count compared point. - * |[31] |IFAEN |EPWM_CHn Interrupt Flag Accumulator Enable Bits - * | | |0 = EPWM_CHn interrupt flag accumulator Disabled. - * | | |1 = EPWM_CHn interrupt flag accumulator Enabled. - * @var EPWM_T::AINTSTS - * Offset: 0x150 EPWM Accumulator Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIF0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition matches IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[1] |IFAIF1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition matches IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[2] |IFAIF2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition matches IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[3] |IFAIF3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition matches IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[4] |IFAIF4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition matches IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * |[5] |IFAIF5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Flag - * | | |Flag is set by hardware when condition matches IFASEL in EPWM_IFAn register, software can clear this bit by writing 1 to it. - * @var EPWM_T::AINTEN - * Offset: 0x154 EPWM Accumulator Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IFAIEN0 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[1] |IFAIEN1 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[2] |IFAIEN2 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[3] |IFAIEN3 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[4] |IFAIEN4 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * |[5] |IFAIEN5 |EPWM_CHn Interrupt Flag Accumulator Interrupt Enable Bits - * | | |0 = Interrupt Flag accumulator interrupt Disabled. - * | | |1 = Interrupt Flag accumulator interrupt Enabled. - * @var EPWM_T::APDMACTL - * Offset: 0x158 EPWM Accumulator PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APDMAEN0 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[1] |APDMAEN1 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[2] |APDMAEN2 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[3] |APDMAEN3 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[4] |APDMAEN4 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * |[5] |APDMAEN5 |Channel n Accumulator PDMA Enable Bits - * | | |0 = Channel n PDMA function Disabled. - * | | |1 = Channel n PDMA function Enabled for the channel n to trigger PDMA to transfer memory data to register. - * @var EPWM_T::FDEN - * Offset: 0x160 EPWM Fault Detect Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FDEN0 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disable. - * | | |1 = Fault detect function Enable. - * |[1] |FDEN1 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disable. - * | | |1 = Fault detect function Enable. - * |[2] |FDEN2 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disable. - * | | |1 = Fault detect function Enable. - * |[3] |FDEN3 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disable. - * | | |1 = Fault detect function Enable. - * |[4] |FDEN4 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disable. - * | | |1 = Fault detect function Enable. - * |[5] |FDEN5 |EPWM Fault Detect Function Enable Bit - * | | |0 = Fault detect function Disable. - * | | |1 = Fault detect function Enable. - * |[8] |FDODIS0 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enable. - * | | |1 = EPWM detect fault and output Disable. - * |[9] |FDODIS1 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enable. - * | | |1 = EPWM detect fault and output Disable. - * |[10] |FDODIS2 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enable. - * | | |1 = EPWM detect fault and output Disable. - * |[11] |FDODIS3 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enable. - * | | |1 = EPWM detect fault and output Disable. - * |[12] |FDODIS4 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enable. - * | | |1 = EPWM detect fault and output Disable. - * |[13] |FDODIS5 |EPWM Channel n Output Fault Detect Disable Bit - * | | |0 = EPWM detect fault and output Enable. - * | | |1 = EPWM detect fault and output Disable. - * |[16] |FDCKS0 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0, 1or 2. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0, 1 or 2. - * |[17] |FDCKS1 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0, 1or 2. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0, 1 or 2. - * |[18] |FDCKS2 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0, 1or 2. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0, 1 or 2. - * |[19] |FDCKS3 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0, 1or 2. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0, 1 or 2. - * |[20] |FDCKS4 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0, 1or 2. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0, 1 or 2. - * |[21] |FDCKS5 |EPWM Channel n Fault Detect Clock Source Select Bit - * | | |0 = EPWMx_CLK, x denotes 0, 1or 2. - * | | |1 = EPWMx_CLK divide by prescaler, x denotes 0, 1 or 2. - * @var EPWM_T::FDCTL0 - * Offset: 0x164 EPWM Fault Detect Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disable. - * | | |1 = Fault detect deglitch function Enable. - * @var EPWM_T::FDCTL1 - * Offset: 0x168 EPWM Fault Detect Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disable. - * | | |1 = Fault detect deglitch function Enable. - * @var EPWM_T::FDCTL2 - * Offset: 0x16C EPWM Fault Detect Control Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disable. - * | | |1 = Fault detect deglitch function Enable. - * @var EPWM_T::FDCTL3 - * Offset: 0x170 EPWM Fault Detect Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disable. - * | | |1 = Fault detect deglitch function Enable. - * @var EPWM_T::FDCTL4 - * Offset: 0x174 EPWM Fault Detect Control Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disable. - * | | |1 = Fault detect deglitch function Enable. - * @var EPWM_T::FDCTL5 - * Offset: 0x178 EPWM Fault Detect Control Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |TRMSKCNT |Transition Mask Counter - * | | |The fault detect result will be masked before counter count from 0 to TRMSKCNT. - * | | |FDCKS is set to 0: - * | | |Mask time is EPWMx_CLK * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |FDCKS is set to 1: - * | | |Mask time EPWMx_CLK * CLKPSC * (2^FDCKSEL) * (TRMSKCNT +2) - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[15] |FDMSKEN |Fault Detect Mask Enable Bit - * | | |0 = Fault detect mask function Disabled. - * | | |1 = Fault detect mask function Enabled. - * |[18:16] |DGSMPCYC |Deglitch Sampling Cycle - * | | |FDCKS is set to 0: - * | | |Sampling detect signal each EPWMx_CLK * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |FDCKS is set to 1: - * | | |Sampling detect signal each EPWMx_CLK * CLKPSC * (2^FDCKSEL) period and detect DGSMPCYC+1 times - * | | |Note: - * | | |CLKPSC (EPWM_CLKPSC) is 0: - * | | |TRMSKCNT >= DGSMPCYC + 2. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 1: - * | | |TRMSKCNT >= DGSMPCYC + 1. - * | | |FDCKS is 1 and CLKPSC (EPWM_CLKPSC) is 2: - * | | |TRMSKCNT >= DGSMPCYC. - * |[29:28] |FDCKSEL |EPWM Channel Fault Detect Clock Select - * | | |00 = FLT_CLK/1. - * | | |01 = FLT_CLK/2. - * | | |10 = FLT_CLK/4. - * | | |11 = FLT_CLK/8. - * | | |Note: FLT_CLK is FDCKSn (EPWM_FDENn[16+n], n=0,1..5) selected clock. - * |[31] |FDDGEN |Fault Detect Deglitch Enable Bit - * | | |0 = Fault detect deglitch function Disable. - * | | |1 = Fault detect deglitch function Enable. - * @var EPWM_T::FDIEN - * Offset: 0x17C EPWM Fault Detect Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FDIENn |EPWM Channel n Fault Detect Interrupt Enable Bit - * | | |0 = EPWM Channel n Fault Detect Interrupt Disabled. - * | | |1 = EPWM Channel n Fault Detect Interrupt Enabled. - * @var EPWM_T::FDSTS - * Offset: 0x180 EPWM Fault Detect Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |FDIFn |EPWM Channel n Fault Detect Interrupt Flag Bit - * | | |Fault Detect Interrupt Flag will be set when EPWM output short - * | | |Software can clear this bit by writing 1 to it. - * @var EPWM_T::EADCPSCCTL - * Offset: 0x184 EPWM Trigger EADC Prescale Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PSCEN0 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[1] |PSCEN1 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[2] |PSCEN2 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[3] |PSCEN3 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[4] |PSCEN4 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * |[5] |PSCEN5 |EPWM Trigger EADC Pre-scale Function Enable Bits - * | | |0 = EPWM Trigger EADC Pre-scale Function Disabled. - * | | |1 = EPWM Trigger EADC Pre-scale Function Enabled. - * @var EPWM_T::EADCPSC0 - * Offset: 0x188 EPWM Trigger EADC Prescale Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EADCPSC0 |EPWM Channel 0 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC0+1) times of EPWM_CH0 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF0. - * |[11:8] |EADCPSC1 |EPWM Channel 1 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC1+1) times of EPWM_CH1 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF1. - * |[19:16] |EADCPSC2 |EPWM Channel 2 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC2+1) times of EPWM_CH2 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF3. - * |[27:24] |EADCPSC3 |EPWM Channel 3 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC3+1) times of EPWM_CH3 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF3. - * @var EPWM_T::EADCPSC1 - * Offset: 0x18C EPWM Trigger EADC Prescale Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EADCPSC4 |EPWM Channel 4 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC4+1) times of EPWM_CH3 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF4. - * |[11:8] |EADCPSC5 |EPWM Channel 5 Trigger EADC Prescale - * | | |The register sets the count number which defines (EADCPSC5+1) times of EPWM_CH3 trigger EADC event occurs to trigger EADC and set trigger EADC flag bit EADCTRGF5. - * @var EPWM_T::EADCPSCNT0 - * Offset: 0x190 EPWM Trigger EADC Prescale Counter Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PSCNT0 |EPWM Trigger EADC Prescale Counter 0 - * | | |User can monitor PSCNT0 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN0 is 0. - * | | |Note 2: Write data limitation: PSCNT0 < EADCPSC0. - * |[11:8] |PSCNT1 |EPWM Trigger EADC Prescale Counter 1 - * | | |User can monitor PSCNT1 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN1 is 0. - * | | |Note 2: Write data limitation: PSCNT1 < EADCPSC1. - * |[19:16] |PSCNT2 |EPWM Trigger EADC Prescale Counter 2 - * | | |User can monitor PSCNT2 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN2 is 0. - * | | |Note 2: Write data limitation: PSCNT2 < EADCPSC2. - * |[27:24] |PSCNT3 |EPWM Trigger EADC Prescale Counter 3 - * | | |User can monitor PSCNT3 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN3 is 0. - * | | |Note 2: Write data limitation: PSCNT3 < EADCPSC3. - * @var EPWM_T::EADCPSCNT1 - * Offset: 0x194 EPWM Trigger EADC Prescale Counter Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PSCNT4 |EPWM Trigger EADC Prescale Counter 4 - * | | |User can monitor PSCNT4 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN4 is 0. - * | | |Note 2: Write data limitation: PSCNT4 < EADCPSC4. - * |[11:8] |PSCNT5 |EPWM Trigger EADC Prescale Counter 5 - * | | |User can monitor PSCNT5 to know the current value in 4-bit trigger EADC prescale counter. - * | | |Note 1: user can write only when PSCEN5 is 0. - * | | |Note 2: Write data limitation: PSCNT5 < EADCPSC5. - * @var EPWM_T::CAPINEN - * Offset: 0x200 EPWM Capture Input Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPINEN0 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[1] |CAPINEN1 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[2] |CAPINEN2 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[3] |CAPINEN3 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[4] |CAPINEN4 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * |[5] |CAPINEN5 |Capture Input Enable Bits - * | | |0 = EPWM Channel capture input path Disabled - * | | |The input of EPWM channel capture function is always regarded as 0. - * | | |1 = EPWM Channel capture input path Enabled - * | | |The input of EPWM channel capture function comes from correlative multifunction pin. - * @var EPWM_T::CAPCTL - * Offset: 0x204 EPWM Capture Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPEN0 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[1] |CAPEN1 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[2] |CAPEN2 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[3] |CAPEN3 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[4] |CAPEN4 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[5] |CAPEN5 |Capture Function Enable Bits - * | | |0 = Capture function Disabled. RCAPDAT/FCAPDAT register will not be updated. - * | | |1 = Capture function Enabled - * | | |Capture latched the EPWM counter value when detected rising or falling edge of input signal and saved to RCAPDAT (Rising latch) and FCAPDAT (Falling latch). - * |[8] |CAPINV0 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[9] |CAPINV1 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[10] |CAPINV2 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[11] |CAPINV3 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[12] |CAPINV4 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[13] |CAPINV5 |Capture Inverter Enable Bits - * | | |0 = Capture source inverter Disabled. - * | | |1 = Capture source inverter Enabled. Reverse the input signal from GPIO. - * |[16] |RCRLDEN0 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[17] |RCRLDEN1 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[18] |RCRLDEN2 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[19] |RCRLDEN3 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[20] |RCRLDEN4 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[21] |RCRLDEN5 |Rising Capture Reload Enable Bits - * | | |0 = Rising capture reload counter Disabled. - * | | |1 = Rising capture reload counter Enabled. - * |[24] |FCRLDEN0 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[25] |FCRLDEN1 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[26] |FCRLDEN2 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[27] |FCRLDEN3 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[28] |FCRLDEN4 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * |[29] |FCRLDEN5 |Falling Capture Reload Enable Bits - * | | |0 = Falling capture reload counter Disabled. - * | | |1 = Falling capture reload counter Enabled. - * @var EPWM_T::CAPSTS - * Offset: 0x208 EPWM Capture Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIFOV0 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[1] |CRLIFOV1 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[2] |CRLIFOV2 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[3] |CRLIFOV3 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[4] |CRLIFOV4 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[5] |CRLIFOV5 |Capture Rising Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if rising latch happened when the corresponding CRLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CRLIF. - * |[8] |CFLIFOV0 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[9] |CFLIFOV1 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[10] |CFLIFOV2 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[11] |CFLIFOV3 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[12] |CFLIFOV4 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * |[13] |CFLIFOV5 |Capture Falling Latch Interrupt Flag Overrun Status (Read Only) - * | | |This flag indicates if falling latch happened when the corresponding CFLIF is 1. - * | | |Note: This bit will be cleared automatically when user clear corresponding CFLIF. - * @var EPWM_T::RCAPDAT0 - * Offset: 0x20C EPWM Rising Capture Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT0 - * Offset: 0x210 EPWM Falling Capture Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT1 - * Offset: 0x214 EPWM Rising Capture Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT1 - * Offset: 0x218 EPWM Falling Capture Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT2 - * Offset: 0x21C EPWM Rising Capture Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT2 - * Offset: 0x220 EPWM Falling Capture Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT3 - * Offset: 0x224 EPWM Rising Capture Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT3 - * Offset: 0x228 EPWM Falling Capture Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT4 - * Offset: 0x22C EPWM Rising Capture Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT4 - * Offset: 0x230 EPWM Falling Capture Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::RCAPDAT5 - * Offset: 0x234 EPWM Rising Capture Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RCAPDAT |EPWM Rising Capture Data Register (Read Only) - * | | |When rising capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::FCAPDAT5 - * Offset: 0x238 EPWM Falling Capture Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FCAPDAT |EPWM Falling Capture Data Register (Read Only) - * | | |When falling capture condition happened, the EPWM counter value will be saved in this register. - * @var EPWM_T::PDMACTL - * Offset: 0x23C EPWM PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHEN0_1 |Channel 0/1 PDMA Enable Bit - * | | |0 = Channel 0/1 PDMA function Disabled. - * | | |1 = Channel 0/1 PDMA function Enabled for the channel 0/1 captured data and transfer to memory. - * |[2:1] |CAPMOD0_1 |Select EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT0/1. - * | | |10 = EPWM_FCAPDAT0/1. - * | | |11 = Both EPWM_RCAPDAT0/1 and EPWM_FCAPDAT0/1. - * |[3] |CAPORD0_1 |Capture Channel 0/1 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT0/1 or EPWM_FCAPDAT0/1 is the first captured data transferred to memory through PDMA when CAPMOD0_1 =11. - * | | |0 = EPWM_FCAPDAT0/1 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT0/1 is the first captured data to memory. - * |[4] |CHSEL0_1 |Select Channel 0/1 to Do PDMA Transfer - * | | |0 = Channel0. - * | | |1 = Channel1. - * |[8] |CHEN2_3 |Channel 2/3 PDMA Enable Bit - * | | |0 = Channel 2/3 PDMA function Disabled. - * | | |1 = Channel 2/3 PDMA function Enabled for the channel 2/3 captured data and transfer to memory. - * |[10:9] |CAPMOD2_3 |Select EPWM_RCAPDAT2/3 or EPWM_FCAODAT2/3 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT2/3. - * | | |10 = EPWM_FCAPDAT2/3. - * | | |11 = Both EPWM_RCAPDAT2/3 and EPWM_FCAPDAT2/3. - * |[11] |CAPORD2_3 |Capture Channel 2/3 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT2/3 or EPWM_FCAPDAT2/3 is the first captured data transferred to memory through PDMA when CAPMOD2_3 =11. - * | | |0 = EPWM_FCAPDAT2/3 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT2/3 is the first captured data to memory. - * |[12] |CHSEL2_3 |Select Channel 2/3 to Do PDMA Transfer - * | | |0 = Channel2. - * | | |1 = Channel3. - * |[16] |CHEN4_5 |Channel 4/5 PDMA Enable Bit - * | | |0 = Channel 4/5 PDMA function Disabled. - * | | |1 = Channel 4/5 PDMA function Enabled for the channel 4/5 captured data and transfer to memory. - * |[18:17] |CAPMOD4_5 |Select EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 to Do PDMA Transfer - * | | |00 = Reserved. - * | | |01 = EPWM_RCAPDAT4/5. - * | | |10 = EPWM_FCAPDAT4/5. - * | | |11 = Both EPWM_RCAPDAT4/5 and EPWM_FCAPDAT4/5. - * |[19] |CAPORD4_5 |Capture Channel 4/5 Rising/Falling Order - * | | |Set this bit to determine whether the EPWM_RCAPDAT4/5 or EPWM_FCAPDAT4/5 is the first captured data transferred to memory through PDMA when CAPMOD4_5 =11. - * | | |0 = EPWM_FCAPDAT4/5 is the first captured data to memory. - * | | |1 = EPWM_RCAPDAT4/5 is the first captured data to memory. - * |[20] |CHSEL4_5 |Select Channel 4/5 to Do PDMA Transfer - * | | |0 = Channel4. - * | | |1 = Channel5. - * @var EPWM_T::PDMACAP0_1 - * Offset: 0x240 EPWM Capture Channel 01 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |EPWM Capture PDMA Register (Read Only) - * | | |This register is used as a buffer to transfer EPWM capture rising or falling data to memory by PDMA. - * @var EPWM_T::PDMACAP2_3 - * Offset: 0x244 EPWM Capture Channel 23 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |EPWM Capture PDMA Register (Read Only) - * | | |This register is used as a buffer to transfer EPWM capture rising or falling data to memory by PDMA. - * @var EPWM_T::PDMACAP4_5 - * Offset: 0x248 EPWM Capture Channel 45 PDMA Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CAPBUF |EPWM Capture PDMA Register (Read Only) - * | | |This register is used as a buffer to transfer EPWM capture rising or falling data to memory by PDMA. - * @var EPWM_T::CAPIEN - * Offset: 0x250 EPWM Capture Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPRIEN0 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[1] |CAPRIEN1 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[2] |CAPRIEN2 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[3] |CAPRIEN3 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[4] |CAPRIEN4 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[5] |CAPRIEN5 |EPWM Capture Rising Latch Interrupt Enable Bits - * | | |0 = Capture rising edge latch interrupt Disabled. - * | | |1 = Capture rising edge latch interrupt Enabled. - * |[8] |CAPFIEN0 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[9] |CAPFIEN1 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[10] |CAPFIEN2 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[11] |CAPFIEN3 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[12] |CAPFIEN4 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * |[13] |CAPFIEN5 |EPWM Capture Falling Latch Interrupt Enable Bits - * | | |0 = Capture falling edge latch interrupt Disabled. - * | | |1 = Capture falling edge latch interrupt Enabled. - * @var EPWM_T::CAPIF - * Offset: 0x254 EPWM Capture Interrupt Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CRLIF0 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[1] |CRLIF1 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[2] |CRLIF2 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[3] |CRLIF3 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[4] |CRLIF4 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[5] |CRLIF5 |EPWM Capture Rising Latch Interrupt Flag - * | | |0 = No capture rising latch condition happened. - * | | |1 = Capture rising latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CRLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[8] |CFLIF0 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[9] |CFLIF1 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[10] |CFLIF2 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[11] |CFLIF3 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[12] |CFLIF4 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[13] |CFLIF5 |EPWM Capture Falling Latch Interrupt Flag - * | | |0 = No capture falling latch condition happened. - * | | |1 = Capture falling latch condition happened, this flag will be set to high. - * | | |Note 1: When Capture with PDMA operating, CAPIF corresponding channel CFLIF will be cleared by hardware after PDMA transfer data. - * | | |Note 2: This bit is cleared by writing 1 to it. - * @var EPWM_T::PBUF0 - * Offset: 0x304 EPWM PERIOD0 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::PBUF1 - * Offset: 0x308 EPWM PERIOD1 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::PBUF2 - * Offset: 0x30C EPWM PERIOD2 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::PBUF3 - * Offset: 0x310 EPWM PERIOD3 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::PBUF4 - * Offset: 0x314 EPWM PERIOD4 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::PBUF5 - * Offset: 0x318 EPWM PERIOD5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |EPWM Period Register Buffer (Read Only) - * | | |Used as PERIOD active register. - * @var EPWM_T::CMPBUF0 - * Offset: 0x31C EPWM CMPDAT0 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CMPBUF1 - * Offset: 0x320 EPWM CMPDAT1 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CMPBUF2 - * Offset: 0x324 EPWM CMPDAT2 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CMPBUF3 - * Offset: 0x328 EPWM CMPDAT3 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CMPBUF4 - * Offset: 0x32C EPWM CMPDAT4 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CMPBUF5 - * Offset: 0x330 EPWM CMPDAT5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |EPWM Comparator Register Buffer (Read Only) - * | | |Used as CMP active register. - * @var EPWM_T::CPSCBUF0_1 - * Offset: 0x334 EPWM CLKPSC0_1 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::CPSCBUF2_3 - * Offset: 0x338 EPWM CLKPSC2_3 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::CPSCBUF4_5 - * Offset: 0x33C EPWM CLKPSC4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CPSCBUF |EPWM Counter Clock Prescale Buffer - * | | |Used as EPWM counter clock pre-scare active register. - * @var EPWM_T::FTCBUF0_1 - * Offset: 0x340 EPWM FTCMPDAT0_1 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMPBUF |EPWM FTCMPDAT Buffer (Read Only) - * | | |Used as FTCMPDAT active register. - * @var EPWM_T::FTCBUF2_3 - * Offset: 0x344 EPWM FTCMPDAT2_3 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMPBUF |EPWM FTCMPDAT Buffer (Read Only) - * | | |Used as FTCMPDAT active register. - * @var EPWM_T::FTCBUF4_5 - * Offset: 0x348 EPWM FTCMPDAT4_5 Buffer - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FTCMPBUF |EPWM FTCMPDAT Buffer (Read Only) - * | | |Used as FTCMPDAT active register. - * @var EPWM_T::FTCI - * Offset: 0x34C EPWM FTCMPDAT Indicator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FTCMU0 |EPWM FTCMPDAT Up Indicator - * | | |Indicator is set by hardware when EPWM counter up count and reaches EPWM_FTCMPDATn, software can clear this bit by writing 1 to it. - * |[1] |FTCMU2 |EPWM FTCMPDAT Up Indicator - * | | |Indicator is set by hardware when EPWM counter up count and reaches EPWM_FTCMPDATn, software can clear this bit by writing 1 to it. - * |[2] |FTCMU4 |EPWM FTCMPDAT Up Indicator - * | | |Indicator is set by hardware when EPWM counter up count and reaches EPWM_FTCMPDATn, software can clear this bit by writing 1 to it. - * |[8] |FTCMD0 |EPWM FTCMPDAT Down Indicator - * | | |Indicator is set by hardware when EPWM counter down count and reaches EPWM_FTCMPDATn, software can clear this bit by writing 1 to it. - * |[9] |FTCMD2 |EPWM FTCMPDAT Down Indicator - * | | |Indicator is set by hardware when EPWM counter down count and reaches EPWM_FTCMPDATn, software can clear this bit by writing 1 to it. - * |[10] |FTCMD4 |EPWM FTCMPDAT Down Indicator - * | | |Indicator is set by hardware when EPWM counter down count and reaches EPWM_FTCMPDATn, software can clear this bit by writing 1 to it. - */ - __IO uint32_t CTL0; /*!< [0x0000] EPWM Control Register 0 */ - __IO uint32_t CTL1; /*!< [0x0004] EPWM Control Register 1 */ - __IO uint32_t SYNC; /*!< [0x0008] EPWM Synchronization Register */ - __IO uint32_t SWSYNC; /*!< [0x000c] EPWM Software Control Synchronization Register */ - __IO uint32_t CLKSRC; /*!< [0x0010] EPWM Clock Source Register */ - __IO uint32_t CLKPSC[3]; /*!< [0x0014] EPWM Clock Prescale Register 0/1,2/3,4/5 */ - __IO uint32_t CNTEN; /*!< [0x0020] EPWM Counter Enable Register */ - __IO uint32_t CNTCLR; /*!< [0x0024] EPWM Clear Counter Register */ - __IO uint32_t LOAD; /*!< [0x0028] EPWM Load Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PERIOD[6]; /*!< [0x0030] EPWM Period Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CMPDAT[6]; /*!< [0x0050] EPWM Comparator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DTCTL[3]; /*!< [0x0070] EPWM Dead-Time Control Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PHS[3]; /*!< [0x0080] EPWM Counter Phase Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[1]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t CNT[6]; /*!< [0x0090] EPWM Counter Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t WGCTL0; /*!< [0x00b0] EPWM Generation Register 0 */ - __IO uint32_t WGCTL1; /*!< [0x00b4] EPWM Generation Register 1 */ - __IO uint32_t MSKEN; /*!< [0x00b8] EPWM Mask Enable Register */ - __IO uint32_t MSK; /*!< [0x00bc] EPWM Mask Data Register */ - __IO uint32_t BNF; /*!< [0x00c0] EPWM Brake Noise Filter Register */ - __IO uint32_t FAILBRK; /*!< [0x00c4] EPWM System Fail Brake Control Register */ - __IO uint32_t BRKCTL[3]; /*!< [0x00c8] EPWM Brake Edge Detect Control Register 0/1,2/3,4/5 */ - __IO uint32_t POLCTL; /*!< [0x00d4] EPWM Pin Polar Inverse Register */ - __IO uint32_t POEN; /*!< [0x00d8] EPWM Output Enable Register */ - __O uint32_t SWBRK; /*!< [0x00dc] EPWM Software Brake Control Register */ - __IO uint32_t INTEN0; /*!< [0x00e0] EPWM Interrupt Enable Register 0 */ - __IO uint32_t INTEN1; /*!< [0x00e4] EPWM Interrupt Enable Register 1 */ - __IO uint32_t INTSTS0; /*!< [0x00e8] EPWM Interrupt Flag Register 0 */ - __IO uint32_t INTSTS1; /*!< [0x00ec] EPWM Interrupt Flag Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE6[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DACTRGEN; /*!< [0x00f4] EPWM Trigger DAC Enable Register */ - __IO uint32_t EADCTS0; /*!< [0x00f8] EPWM Trigger EADC Source Select Register 0 */ - __IO uint32_t EADCTS1; /*!< [0x00fc] EPWM Trigger EADC Source Select Register 1 */ - __IO uint32_t FTCMPDAT[3]; /*!< [0x0100] EPWM Free Trigger Compare Register 0/1,2/3,4/5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE7[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t SSCTL; /*!< [0x0110] EPWM Synchronous Start Control Register */ - __O uint32_t SSTRG; /*!< [0x0114] EPWM Synchronous Start Trigger Register */ - __IO uint32_t LEBCTL; /*!< [0x0118] EPWM Leading Edge Blanking Control Register */ - __IO uint32_t LEBCNT; /*!< [0x011c] EPWM Leading Edge Blanking Counter Register */ - __IO uint32_t STATUS; /*!< [0x0120] EPWM Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE8[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t IFA[6]; /*!< [0x0130] EPWM Interrupt Flag Accumulator Register 0~5 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE9[2]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t AINTSTS; /*!< [0x0150] EPWM Accumulator Interrupt Flag Register */ - __IO uint32_t AINTEN; /*!< [0x0154] EPWM Accumulator Interrupt Enable Register */ - __IO uint32_t APDMACTL; /*!< [0x0158] EPWM Accumulator PDMA Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE10[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t FDEN; /*!< [0x0160] EPWM Fault Detect Enable Register */ - __IO uint32_t FDCTL[6]; /*!< [0x0164~0x178] EPWM Fault Detect Control Register 0~5 */ - __IO uint32_t FDIEN; /*!< [0x017C] EPWM Fault Detect Interrupt Enable Register */ - __IO uint32_t FDSTS; /*!< [0x0180] EPWM Fault Detect Interrupt Flag Register */ - __IO uint32_t EADCPSCCTL; /*!< [0x0184] EPWM Trigger EADC Prescale Control Register */ - __IO uint32_t EADCPSC0; /*!< [0x0188] EPWM Trigger EADC Prescale Register 0 */ - __IO uint32_t EADCPSC1; /*!< [0x018C] EPWM Trigger EADC Prescale Register 1 */ - __IO uint32_t EADCPSCNT0; /*!< [0x0190] EPWM Trigger EADC Prescale Counter Register 0 */ - __IO uint32_t EADCPSCNT1; /*!< [0x0194] EPWM Trigger EADC Prescale Counter Register 1 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE11[26]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPINEN; /*!< [0x0200] EPWM Capture Input Enable Register */ - __IO uint32_t CAPCTL; /*!< [0x0204] EPWM Capture Control Register */ - __I uint32_t CAPSTS; /*!< [0x0208] EPWM Capture Status Register */ - ECAPDAT_T CAPDAT[6]; /*!< [0x020C] EPWM Rising and Falling Capture Data Register 0~5 */ - __IO uint32_t PDMACTL; /*!< [0x023c] EPWM PDMA Control Register */ - __I uint32_t PDMACAP[3]; /*!< [0x0240] EPWM Capture Channel 01,23,45 PDMA Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE12[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CAPIEN; /*!< [0x0250] EPWM Capture Interrupt Enable Register */ - __IO uint32_t CAPIF; /*!< [0x0254] EPWM Capture Interrupt Flag Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE13[43]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t PBUF[6]; /*!< [0x0304] EPWM PERIOD0~5 Buffer */ - __I uint32_t CMPBUF[6]; /*!< [0x031c] EPWM CMPDAT0~5 Buffer */ - __I uint32_t CPSCBUF[3]; /*!< [0x0334] EPWM CLKPSC0_1/2_3/4_5 Buffer */ - __I uint32_t FTCBUF[3]; /*!< [0x0340] EPWM FTCMPDAT0_1/2_3/4_5 Buffer */ - __IO uint32_t FTCI; /*!< [0x034c] EPWM FTCMPDAT Indicator Register */ - -} EPWM_T; - -/** - @addtogroup EPWM_CONST EPWM Bit Field Definition - Constant Definitions for EPWM Controller -@{ */ - -#define EPWM_CTL0_CTRLD0_Pos (0) /*!< EPWM_T::CTL0: CTRLD0 Position */ -#define EPWM_CTL0_CTRLD0_Msk (0x1ul << EPWM_CTL0_CTRLD0_Pos) /*!< EPWM_T::CTL0: CTRLD0 Mask */ - -#define EPWM_CTL0_CTRLD1_Pos (1) /*!< EPWM_T::CTL0: CTRLD1 Position */ -#define EPWM_CTL0_CTRLD1_Msk (0x1ul << EPWM_CTL0_CTRLD1_Pos) /*!< EPWM_T::CTL0: CTRLD1 Mask */ - -#define EPWM_CTL0_CTRLD2_Pos (2) /*!< EPWM_T::CTL0: CTRLD2 Position */ -#define EPWM_CTL0_CTRLD2_Msk (0x1ul << EPWM_CTL0_CTRLD2_Pos) /*!< EPWM_T::CTL0: CTRLD2 Mask */ - -#define EPWM_CTL0_CTRLD3_Pos (3) /*!< EPWM_T::CTL0: CTRLD3 Position */ -#define EPWM_CTL0_CTRLD3_Msk (0x1ul << EPWM_CTL0_CTRLD3_Pos) /*!< EPWM_T::CTL0: CTRLD3 Mask */ - -#define EPWM_CTL0_CTRLD4_Pos (4) /*!< EPWM_T::CTL0: CTRLD4 Position */ -#define EPWM_CTL0_CTRLD4_Msk (0x1ul << EPWM_CTL0_CTRLD4_Pos) /*!< EPWM_T::CTL0: CTRLD4 Mask */ - -#define EPWM_CTL0_CTRLD5_Pos (5) /*!< EPWM_T::CTL0: CTRLD5 Position */ -#define EPWM_CTL0_CTRLD5_Msk (0x1ul << EPWM_CTL0_CTRLD5_Pos) /*!< EPWM_T::CTL0: CTRLD5 Mask */ - -#define EPWM_CTL0_WINLDEN0_Pos (8) /*!< EPWM_T::CTL0: WINLDEN0 Position */ -#define EPWM_CTL0_WINLDEN0_Msk (0x1ul << EPWM_CTL0_WINLDEN0_Pos) /*!< EPWM_T::CTL0: WINLDEN0 Mask */ - -#define EPWM_CTL0_WINLDEN1_Pos (9) /*!< EPWM_T::CTL0: WINLDEN1 Position */ -#define EPWM_CTL0_WINLDEN1_Msk (0x1ul << EPWM_CTL0_WINLDEN1_Pos) /*!< EPWM_T::CTL0: WINLDEN1 Mask */ - -#define EPWM_CTL0_WINLDEN2_Pos (10) /*!< EPWM_T::CTL0: WINLDEN2 Position */ -#define EPWM_CTL0_WINLDEN2_Msk (0x1ul << EPWM_CTL0_WINLDEN2_Pos) /*!< EPWM_T::CTL0: WINLDEN2 Mask */ - -#define EPWM_CTL0_WINLDEN3_Pos (11) /*!< EPWM_T::CTL0: WINLDEN3 Position */ -#define EPWM_CTL0_WINLDEN3_Msk (0x1ul << EPWM_CTL0_WINLDEN3_Pos) /*!< EPWM_T::CTL0: WINLDEN3 Mask */ - -#define EPWM_CTL0_WINLDEN4_Pos (12) /*!< EPWM_T::CTL0: WINLDEN4 Position */ -#define EPWM_CTL0_WINLDEN4_Msk (0x1ul << EPWM_CTL0_WINLDEN4_Pos) /*!< EPWM_T::CTL0: WINLDEN4 Mask */ - -#define EPWM_CTL0_WINLDEN5_Pos (13) /*!< EPWM_T::CTL0: WINLDEN5 Position */ -#define EPWM_CTL0_WINLDEN5_Msk (0x1ul << EPWM_CTL0_WINLDEN5_Pos) /*!< EPWM_T::CTL0: WINLDEN5 Mask */ - -#define EPWM_CTL0_IMMLDEN0_Pos (16) /*!< EPWM_T::CTL0: IMMLDEN0 Position */ -#define EPWM_CTL0_IMMLDEN0_Msk (0x1ul << EPWM_CTL0_IMMLDEN0_Pos) /*!< EPWM_T::CTL0: IMMLDEN0 Mask */ - -#define EPWM_CTL0_IMMLDEN1_Pos (17) /*!< EPWM_T::CTL0: IMMLDEN1 Position */ -#define EPWM_CTL0_IMMLDEN1_Msk (0x1ul << EPWM_CTL0_IMMLDEN1_Pos) /*!< EPWM_T::CTL0: IMMLDEN1 Mask */ - -#define EPWM_CTL0_IMMLDEN2_Pos (18) /*!< EPWM_T::CTL0: IMMLDEN2 Position */ -#define EPWM_CTL0_IMMLDEN2_Msk (0x1ul << EPWM_CTL0_IMMLDEN2_Pos) /*!< EPWM_T::CTL0: IMMLDEN2 Mask */ - -#define EPWM_CTL0_IMMLDEN3_Pos (19) /*!< EPWM_T::CTL0: IMMLDEN3 Position */ -#define EPWM_CTL0_IMMLDEN3_Msk (0x1ul << EPWM_CTL0_IMMLDEN3_Pos) /*!< EPWM_T::CTL0: IMMLDEN3 Mask */ - -#define EPWM_CTL0_IMMLDEN4_Pos (20) /*!< EPWM_T::CTL0: IMMLDEN4 Position */ -#define EPWM_CTL0_IMMLDEN4_Msk (0x1ul << EPWM_CTL0_IMMLDEN4_Pos) /*!< EPWM_T::CTL0: IMMLDEN4 Mask */ - -#define EPWM_CTL0_IMMLDEN5_Pos (21) /*!< EPWM_T::CTL0: IMMLDEN5 Position */ -#define EPWM_CTL0_IMMLDEN5_Msk (0x1ul << EPWM_CTL0_IMMLDEN5_Pos) /*!< EPWM_T::CTL0: IMMLDEN5 Mask */ - -#define EPWM_CTL0_GROUPEN_Pos (24) /*!< EPWM_T::CTL0: GROUPEN Position */ -#define EPWM_CTL0_GROUPEN_Msk (0x1ul << EPWM_CTL0_GROUPEN_Pos) /*!< EPWM_T::CTL0: GROUPEN Mask */ - -#define EPWM_CTL0_DBGHALT_Pos (30) /*!< EPWM_T::CTL0: DBGHALT Position */ -#define EPWM_CTL0_DBGHALT_Msk (0x1ul << EPWM_CTL0_DBGHALT_Pos) /*!< EPWM_T::CTL0: DBGHALT Mask */ - -#define EPWM_CTL0_DBGTRIOFF_Pos (31) /*!< EPWM_T::CTL0: DBGTRIOFF Position */ -#define EPWM_CTL0_DBGTRIOFF_Msk (0x1ul << EPWM_CTL0_DBGTRIOFF_Pos) /*!< EPWM_T::CTL0: DBGTRIOFF Mask */ - -#define EPWM_CTL1_CNTTYPE0_Pos (0) /*!< EPWM_T::CTL1: CNTTYPE0 Position */ -#define EPWM_CTL1_CNTTYPE0_Msk (0x3ul << EPWM_CTL1_CNTTYPE0_Pos) /*!< EPWM_T::CTL1: CNTTYPE0 Mask */ - -#define EPWM_CTL1_CNTTYPE1_Pos (2) /*!< EPWM_T::CTL1: CNTTYPE1 Position */ -#define EPWM_CTL1_CNTTYPE1_Msk (0x3ul << EPWM_CTL1_CNTTYPE1_Pos) /*!< EPWM_T::CTL1: CNTTYPE1 Mask */ - -#define EPWM_CTL1_CNTTYPE2_Pos (4) /*!< EPWM_T::CTL1: CNTTYPE2 Position */ -#define EPWM_CTL1_CNTTYPE2_Msk (0x3ul << EPWM_CTL1_CNTTYPE2_Pos) /*!< EPWM_T::CTL1: CNTTYPE2 Mask */ - -#define EPWM_CTL1_CNTTYPE3_Pos (6) /*!< EPWM_T::CTL1: CNTTYPE3 Position */ -#define EPWM_CTL1_CNTTYPE3_Msk (0x3ul << EPWM_CTL1_CNTTYPE3_Pos) /*!< EPWM_T::CTL1: CNTTYPE3 Mask */ - -#define EPWM_CTL1_CNTTYPE4_Pos (8) /*!< EPWM_T::CTL1: CNTTYPE4 Position */ -#define EPWM_CTL1_CNTTYPE4_Msk (0x3ul << EPWM_CTL1_CNTTYPE4_Pos) /*!< EPWM_T::CTL1: CNTTYPE4 Mask */ - -#define EPWM_CTL1_CNTTYPE5_Pos (10) /*!< EPWM_T::CTL1: CNTTYPE5 Position */ -#define EPWM_CTL1_CNTTYPE5_Msk (0x3ul << EPWM_CTL1_CNTTYPE5_Pos) /*!< EPWM_T::CTL1: CNTTYPE5 Mask */ - -#define EPWM_CTL1_CNTMODE0_Pos (16) /*!< EPWM_T::CTL1: CNTMODE0 Position */ -#define EPWM_CTL1_CNTMODE0_Msk (0x1ul << EPWM_CTL1_CNTMODE0_Pos) /*!< EPWM_T::CTL1: CNTMODE0 Mask */ - -#define EPWM_CTL1_CNTMODE1_Pos (17) /*!< EPWM_T::CTL1: CNTMODE1 Position */ -#define EPWM_CTL1_CNTMODE1_Msk (0x1ul << EPWM_CTL1_CNTMODE1_Pos) /*!< EPWM_T::CTL1: CNTMODE1 Mask */ - -#define EPWM_CTL1_CNTMODE2_Pos (18) /*!< EPWM_T::CTL1: CNTMODE2 Position */ -#define EPWM_CTL1_CNTMODE2_Msk (0x1ul << EPWM_CTL1_CNTMODE2_Pos) /*!< EPWM_T::CTL1: CNTMODE2 Mask */ - -#define EPWM_CTL1_CNTMODE3_Pos (19) /*!< EPWM_T::CTL1: CNTMODE3 Position */ -#define EPWM_CTL1_CNTMODE3_Msk (0x1ul << EPWM_CTL1_CNTMODE3_Pos) /*!< EPWM_T::CTL1: CNTMODE3 Mask */ - -#define EPWM_CTL1_CNTMODE4_Pos (20) /*!< EPWM_T::CTL1: CNTMODE4 Position */ -#define EPWM_CTL1_CNTMODE4_Msk (0x1ul << EPWM_CTL1_CNTMODE4_Pos) /*!< EPWM_T::CTL1: CNTMODE4 Mask */ - -#define EPWM_CTL1_CNTMODE5_Pos (21) /*!< EPWM_T::CTL1: CNTMODE5 Position */ -#define EPWM_CTL1_CNTMODE5_Msk (0x1ul << EPWM_CTL1_CNTMODE5_Pos) /*!< EPWM_T::CTL1: CNTMODE5 Mask */ - -#define EPWM_CTL1_OUTMODE0_Pos (24) /*!< EPWM_T::CTL1: OUTMODE0 Position */ -#define EPWM_CTL1_OUTMODE0_Msk (0x1ul << EPWM_CTL1_OUTMODE0_Pos) /*!< EPWM_T::CTL1: OUTMODE0 Mask */ - -#define EPWM_CTL1_OUTMODE2_Pos (25) /*!< EPWM_T::CTL1: OUTMODE2 Position */ -#define EPWM_CTL1_OUTMODE2_Msk (0x1ul << EPWM_CTL1_OUTMODE2_Pos) /*!< EPWM_T::CTL1: OUTMODE2 Mask */ - -#define EPWM_CTL1_OUTMODE4_Pos (26) /*!< EPWM_T::CTL1: OUTMODE4 Position */ -#define EPWM_CTL1_OUTMODE4_Msk (0x1ul << EPWM_CTL1_OUTMODE4_Pos) /*!< EPWM_T::CTL1: OUTMODE4 Mask */ - -#define EPWM_SYNC_PHSEN0_Pos (0) /*!< EPWM_T::SYNC: PHSEN0 Position */ -#define EPWM_SYNC_PHSEN0_Msk (0x1ul << EPWM_SYNC_PHSEN0_Pos) /*!< EPWM_T::SYNC: PHSEN0 Mask */ - -#define EPWM_SYNC_PHSEN2_Pos (1) /*!< EPWM_T::SYNC: PHSEN2 Position */ -#define EPWM_SYNC_PHSEN2_Msk (0x1ul << EPWM_SYNC_PHSEN2_Pos) /*!< EPWM_T::SYNC: PHSEN2 Mask */ - -#define EPWM_SYNC_PHSEN4_Pos (2) /*!< EPWM_T::SYNC: PHSEN4 Position */ -#define EPWM_SYNC_PHSEN4_Msk (0x1ul << EPWM_SYNC_PHSEN4_Pos) /*!< EPWM_T::SYNC: PHSEN4 Mask */ - -#define EPWM_SYNC_SINSRC0_Pos (8) /*!< EPWM_T::SYNC: SINSRC0 Position */ -#define EPWM_SYNC_SINSRC0_Msk (0x3ul << EPWM_SYNC_SINSRC0_Pos) /*!< EPWM_T::SYNC: SINSRC0 Mask */ - -#define EPWM_SYNC_SINSRC2_Pos (10) /*!< EPWM_T::SYNC: SINSRC2 Position */ -#define EPWM_SYNC_SINSRC2_Msk (0x3ul << EPWM_SYNC_SINSRC2_Pos) /*!< EPWM_T::SYNC: SINSRC2 Mask */ - -#define EPWM_SYNC_SINSRC4_Pos (12) /*!< EPWM_T::SYNC: SINSRC4 Position */ -#define EPWM_SYNC_SINSRC4_Msk (0x3ul << EPWM_SYNC_SINSRC4_Pos) /*!< EPWM_T::SYNC: SINSRC4 Mask */ - -#define EPWM_SYNC_SNFLTEN_Pos (16) /*!< EPWM_T::SYNC: SNFLTEN Position */ -#define EPWM_SYNC_SNFLTEN_Msk (0x1ul << EPWM_SYNC_SNFLTEN_Pos) /*!< EPWM_T::SYNC: SNFLTEN Mask */ - -#define EPWM_SYNC_SFLTCSEL_Pos (17) /*!< EPWM_T::SYNC: SFLTCSEL Position */ -#define EPWM_SYNC_SFLTCSEL_Msk (0x7ul << EPWM_SYNC_SFLTCSEL_Pos) /*!< EPWM_T::SYNC: SFLTCSEL Mask */ - -#define EPWM_SYNC_SFLTCNT_Pos (20) /*!< EPWM_T::SYNC: SFLTCNT Position */ -#define EPWM_SYNC_SFLTCNT_Msk (0x7ul << EPWM_SYNC_SFLTCNT_Pos) /*!< EPWM_T::SYNC: SFLTCNT Mask */ - -#define EPWM_SYNC_SINPINV_Pos (23) /*!< EPWM_T::SYNC: SINPINV Position */ -#define EPWM_SYNC_SINPINV_Msk (0x1ul << EPWM_SYNC_SINPINV_Pos) /*!< EPWM_T::SYNC: SINPINV Mask */ - -#define EPWM_SYNC_PHSDIR0_Pos (24) /*!< EPWM_T::SYNC: PHSDIR0 Position */ -#define EPWM_SYNC_PHSDIR0_Msk (0x1ul << EPWM_SYNC_PHSDIR0_Pos) /*!< EPWM_T::SYNC: PHSDIR0 Mask */ - -#define EPWM_SYNC_PHSDIR2_Pos (25) /*!< EPWM_T::SYNC: PHSDIR2 Position */ -#define EPWM_SYNC_PHSDIR2_Msk (0x1ul << EPWM_SYNC_PHSDIR2_Pos) /*!< EPWM_T::SYNC: PHSDIR2 Mask */ - -#define EPWM_SYNC_PHSDIR4_Pos (26) /*!< EPWM_T::SYNC: PHSDIR4 Position */ -#define EPWM_SYNC_PHSDIR4_Msk (0x1ul << EPWM_SYNC_PHSDIR4_Pos) /*!< EPWM_T::SYNC: PHSDIR4 Mask */ - -#define EPWM_SWSYNC_SWSYNC0_Pos (0) /*!< EPWM_T::SWSYNC: SWSYNC0 Position */ -#define EPWM_SWSYNC_SWSYNC0_Msk (0x1ul << EPWM_SWSYNC_SWSYNC0_Pos) /*!< EPWM_T::SWSYNC: SWSYNC0 Mask */ - -#define EPWM_SWSYNC_SWSYNC2_Pos (1) /*!< EPWM_T::SWSYNC: SWSYNC2 Position */ -#define EPWM_SWSYNC_SWSYNC2_Msk (0x1ul << EPWM_SWSYNC_SWSYNC2_Pos) /*!< EPWM_T::SWSYNC: SWSYNC2 Mask */ - -#define EPWM_SWSYNC_SWSYNC4_Pos (2) /*!< EPWM_T::SWSYNC: SWSYNC4 Position */ -#define EPWM_SWSYNC_SWSYNC4_Msk (0x1ul << EPWM_SWSYNC_SWSYNC4_Pos) /*!< EPWM_T::SWSYNC: SWSYNC4 Mask */ - -#define EPWM_CLKSRC_ECLKSRC0_Pos (0) /*!< EPWM_T::CLKSRC: ECLKSRC0 Position */ -#define EPWM_CLKSRC_ECLKSRC0_Msk (0xful << EPWM_CLKSRC_ECLKSRC0_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC0 Mask */ - -#define EPWM_CLKSRC_ECLKSRC2_Pos (8) /*!< EPWM_T::CLKSRC: ECLKSRC2 Position */ -#define EPWM_CLKSRC_ECLKSRC2_Msk (0xful << EPWM_CLKSRC_ECLKSRC2_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC2 Mask */ - -#define EPWM_CLKSRC_ECLKSRC4_Pos (16) /*!< EPWM_T::CLKSRC: ECLKSRC4 Position */ -#define EPWM_CLKSRC_ECLKSRC4_Msk (0xful << EPWM_CLKSRC_ECLKSRC4_Pos) /*!< EPWM_T::CLKSRC: ECLKSRC4 Mask */ - -#define EPWM_CLKPSC0_1_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC0_1: CLKPSC Position */ -#define EPWM_CLKPSC0_1_CLKPSC_Msk (0xffful << EPWM_CLKPSC0_1_CLKPSC_Pos) /*!< EPWM_T::CLKPSC0_1: CLKPSC Mask */ - -#define EPWM_CLKPSC2_3_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC2_3: CLKPSC Position */ -#define EPWM_CLKPSC2_3_CLKPSC_Msk (0xffful << EPWM_CLKPSC2_3_CLKPSC_Pos) /*!< EPWM_T::CLKPSC2_3: CLKPSC Mask */ - -#define EPWM_CLKPSC4_5_CLKPSC_Pos (0) /*!< EPWM_T::CLKPSC4_5: CLKPSC Position */ -#define EPWM_CLKPSC4_5_CLKPSC_Msk (0xffful << EPWM_CLKPSC4_5_CLKPSC_Pos) /*!< EPWM_T::CLKPSC4_5: CLKPSC Mask */ - -#define EPWM_CNTEN_CNTEN0_Pos (0) /*!< EPWM_T::CNTEN: CNTEN0 Position */ -#define EPWM_CNTEN_CNTEN0_Msk (0x1ul << EPWM_CNTEN_CNTEN0_Pos) /*!< EPWM_T::CNTEN: CNTEN0 Mask */ - -#define EPWM_CNTEN_CNTEN1_Pos (1) /*!< EPWM_T::CNTEN: CNTEN1 Position */ -#define EPWM_CNTEN_CNTEN1_Msk (0x1ul << EPWM_CNTEN_CNTEN1_Pos) /*!< EPWM_T::CNTEN: CNTEN1 Mask */ - -#define EPWM_CNTEN_CNTEN2_Pos (2) /*!< EPWM_T::CNTEN: CNTEN2 Position */ -#define EPWM_CNTEN_CNTEN2_Msk (0x1ul << EPWM_CNTEN_CNTEN2_Pos) /*!< EPWM_T::CNTEN: CNTEN2 Mask */ - -#define EPWM_CNTEN_CNTEN3_Pos (3) /*!< EPWM_T::CNTEN: CNTEN3 Position */ -#define EPWM_CNTEN_CNTEN3_Msk (0x1ul << EPWM_CNTEN_CNTEN3_Pos) /*!< EPWM_T::CNTEN: CNTEN3 Mask */ - -#define EPWM_CNTEN_CNTEN4_Pos (4) /*!< EPWM_T::CNTEN: CNTEN4 Position */ -#define EPWM_CNTEN_CNTEN4_Msk (0x1ul << EPWM_CNTEN_CNTEN4_Pos) /*!< EPWM_T::CNTEN: CNTEN4 Mask */ - -#define EPWM_CNTEN_CNTEN5_Pos (5) /*!< EPWM_T::CNTEN: CNTEN5 Position */ -#define EPWM_CNTEN_CNTEN5_Msk (0x1ul << EPWM_CNTEN_CNTEN5_Pos) /*!< EPWM_T::CNTEN: CNTEN5 Mask */ - -#define EPWM_CNTCLR_CNTCLR0_Pos (0) /*!< EPWM_T::CNTCLR: CNTCLR0 Position */ -#define EPWM_CNTCLR_CNTCLR0_Msk (0x1ul << EPWM_CNTCLR_CNTCLR0_Pos) /*!< EPWM_T::CNTCLR: CNTCLR0 Mask */ - -#define EPWM_CNTCLR_CNTCLR1_Pos (1) /*!< EPWM_T::CNTCLR: CNTCLR1 Position */ -#define EPWM_CNTCLR_CNTCLR1_Msk (0x1ul << EPWM_CNTCLR_CNTCLR1_Pos) /*!< EPWM_T::CNTCLR: CNTCLR1 Mask */ - -#define EPWM_CNTCLR_CNTCLR2_Pos (2) /*!< EPWM_T::CNTCLR: CNTCLR2 Position */ -#define EPWM_CNTCLR_CNTCLR2_Msk (0x1ul << EPWM_CNTCLR_CNTCLR2_Pos) /*!< EPWM_T::CNTCLR: CNTCLR2 Mask */ - -#define EPWM_CNTCLR_CNTCLR3_Pos (3) /*!< EPWM_T::CNTCLR: CNTCLR3 Position */ -#define EPWM_CNTCLR_CNTCLR3_Msk (0x1ul << EPWM_CNTCLR_CNTCLR3_Pos) /*!< EPWM_T::CNTCLR: CNTCLR3 Mask */ - -#define EPWM_CNTCLR_CNTCLR4_Pos (4) /*!< EPWM_T::CNTCLR: CNTCLR4 Position */ -#define EPWM_CNTCLR_CNTCLR4_Msk (0x1ul << EPWM_CNTCLR_CNTCLR4_Pos) /*!< EPWM_T::CNTCLR: CNTCLR4 Mask */ - -#define EPWM_CNTCLR_CNTCLR5_Pos (5) /*!< EPWM_T::CNTCLR: CNTCLR5 Position */ -#define EPWM_CNTCLR_CNTCLR5_Msk (0x1ul << EPWM_CNTCLR_CNTCLR5_Pos) /*!< EPWM_T::CNTCLR: CNTCLR5 Mask */ - -#define EPWM_LOAD_LOAD0_Pos (0) /*!< EPWM_T::LOAD: LOAD0 Position */ -#define EPWM_LOAD_LOAD0_Msk (0x1ul << EPWM_LOAD_LOAD0_Pos) /*!< EPWM_T::LOAD: LOAD0 Mask */ - -#define EPWM_LOAD_LOAD1_Pos (1) /*!< EPWM_T::LOAD: LOAD1 Position */ -#define EPWM_LOAD_LOAD1_Msk (0x1ul << EPWM_LOAD_LOAD1_Pos) /*!< EPWM_T::LOAD: LOAD1 Mask */ - -#define EPWM_LOAD_LOAD2_Pos (2) /*!< EPWM_T::LOAD: LOAD2 Position */ -#define EPWM_LOAD_LOAD2_Msk (0x1ul << EPWM_LOAD_LOAD2_Pos) /*!< EPWM_T::LOAD: LOAD2 Mask */ - -#define EPWM_LOAD_LOAD3_Pos (3) /*!< EPWM_T::LOAD: LOAD3 Position */ -#define EPWM_LOAD_LOAD3_Msk (0x1ul << EPWM_LOAD_LOAD3_Pos) /*!< EPWM_T::LOAD: LOAD3 Mask */ - -#define EPWM_LOAD_LOAD4_Pos (4) /*!< EPWM_T::LOAD: LOAD4 Position */ -#define EPWM_LOAD_LOAD4_Msk (0x1ul << EPWM_LOAD_LOAD4_Pos) /*!< EPWM_T::LOAD: LOAD4 Mask */ - -#define EPWM_LOAD_LOAD5_Pos (5) /*!< EPWM_T::LOAD: LOAD5 Position */ -#define EPWM_LOAD_LOAD5_Msk (0x1ul << EPWM_LOAD_LOAD5_Pos) /*!< EPWM_T::LOAD: LOAD5 Mask */ - -#define EPWM_PERIOD0_PERIOD_Pos (0) /*!< EPWM_T::PERIOD0: PERIOD Position */ -#define EPWM_PERIOD0_PERIOD_Msk (0xfffful << EPWM_PERIOD0_PERIOD_Pos) /*!< EPWM_T::PERIOD0: PERIOD Mask */ - -#define EPWM_PERIOD1_PERIOD_Pos (0) /*!< EPWM_T::PERIOD1: PERIOD Position */ -#define EPWM_PERIOD1_PERIOD_Msk (0xfffful << EPWM_PERIOD1_PERIOD_Pos) /*!< EPWM_T::PERIOD1: PERIOD Mask */ - -#define EPWM_PERIOD2_PERIOD_Pos (0) /*!< EPWM_T::PERIOD2: PERIOD Position */ -#define EPWM_PERIOD2_PERIOD_Msk (0xfffful << EPWM_PERIOD2_PERIOD_Pos) /*!< EPWM_T::PERIOD2: PERIOD Mask */ - -#define EPWM_PERIOD3_PERIOD_Pos (0) /*!< EPWM_T::PERIOD3: PERIOD Position */ -#define EPWM_PERIOD3_PERIOD_Msk (0xfffful << EPWM_PERIOD3_PERIOD_Pos) /*!< EPWM_T::PERIOD3: PERIOD Mask */ - -#define EPWM_PERIOD4_PERIOD_Pos (0) /*!< EPWM_T::PERIOD4: PERIOD Position */ -#define EPWM_PERIOD4_PERIOD_Msk (0xfffful << EPWM_PERIOD4_PERIOD_Pos) /*!< EPWM_T::PERIOD4: PERIOD Mask */ - -#define EPWM_PERIOD5_PERIOD_Pos (0) /*!< EPWM_T::PERIOD5: PERIOD Position */ -#define EPWM_PERIOD5_PERIOD_Msk (0xfffful << EPWM_PERIOD5_PERIOD_Pos) /*!< EPWM_T::PERIOD5: PERIOD Mask */ - -#define EPWM_CMPDAT0_CMP_Pos (0) /*!< EPWM_T::CMPDAT0: CMP Position */ -#define EPWM_CMPDAT0_CMP_Msk (0xfffful << EPWM_CMPDAT0_CMP_Pos) /*!< EPWM_T::CMPDAT0: CMP Mask */ - -#define EPWM_CMPDAT1_CMP_Pos (0) /*!< EPWM_T::CMPDAT1: CMP Position */ -#define EPWM_CMPDAT1_CMP_Msk (0xfffful << EPWM_CMPDAT1_CMP_Pos) /*!< EPWM_T::CMPDAT1: CMP Mask */ - -#define EPWM_CMPDAT2_CMP_Pos (0) /*!< EPWM_T::CMPDAT2: CMP Position */ -#define EPWM_CMPDAT2_CMP_Msk (0xfffful << EPWM_CMPDAT2_CMP_Pos) /*!< EPWM_T::CMPDAT2: CMP Mask */ - -#define EPWM_CMPDAT3_CMP_Pos (0) /*!< EPWM_T::CMPDAT3: CMP Position */ -#define EPWM_CMPDAT3_CMP_Msk (0xfffful << EPWM_CMPDAT3_CMP_Pos) /*!< EPWM_T::CMPDAT3: CMP Mask */ - -#define EPWM_CMPDAT4_CMP_Pos (0) /*!< EPWM_T::CMPDAT4: CMP Position */ -#define EPWM_CMPDAT4_CMP_Msk (0xfffful << EPWM_CMPDAT4_CMP_Pos) /*!< EPWM_T::CMPDAT4: CMP Mask */ - -#define EPWM_CMPDAT5_CMP_Pos (0) /*!< EPWM_T::CMPDAT5: CMP Position */ -#define EPWM_CMPDAT5_CMP_Msk (0xfffful << EPWM_CMPDAT5_CMP_Pos) /*!< EPWM_T::CMPDAT5: CMP Mask */ - -#define EPWM_DTCTL0_1_DTCNT_Pos (0) /*!< EPWM_T::DTCTL0_1: DTCNT Position */ -#define EPWM_DTCTL0_1_DTCNT_Msk (0xffful << EPWM_DTCTL0_1_DTCNT_Pos) /*!< EPWM_T::DTCTL0_1: DTCNT Mask */ - -#define EPWM_DTCTL0_1_DTEN_Pos (16) /*!< EPWM_T::DTCTL0_1: DTEN Position */ -#define EPWM_DTCTL0_1_DTEN_Msk (0x1ul << EPWM_DTCTL0_1_DTEN_Pos) /*!< EPWM_T::DTCTL0_1: DTEN Mask */ - -#define EPWM_DTCTL0_1_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL0_1: DTCKSEL Position */ -#define EPWM_DTCTL0_1_DTCKSEL_Msk (0x1ul << EPWM_DTCTL0_1_DTCKSEL_Pos) /*!< EPWM_T::DTCTL0_1: DTCKSEL Mask */ - -#define EPWM_DTCTL2_3_DTCNT_Pos (0) /*!< EPWM_T::DTCTL2_3: DTCNT Position */ -#define EPWM_DTCTL2_3_DTCNT_Msk (0xffful << EPWM_DTCTL2_3_DTCNT_Pos) /*!< EPWM_T::DTCTL2_3: DTCNT Mask */ - -#define EPWM_DTCTL2_3_DTEN_Pos (16) /*!< EPWM_T::DTCTL2_3: DTEN Position */ -#define EPWM_DTCTL2_3_DTEN_Msk (0x1ul << EPWM_DTCTL2_3_DTEN_Pos) /*!< EPWM_T::DTCTL2_3: DTEN Mask */ - -#define EPWM_DTCTL2_3_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL2_3: DTCKSEL Position */ -#define EPWM_DTCTL2_3_DTCKSEL_Msk (0x1ul << EPWM_DTCTL2_3_DTCKSEL_Pos) /*!< EPWM_T::DTCTL2_3: DTCKSEL Mask */ - -#define EPWM_DTCTL4_5_DTCNT_Pos (0) /*!< EPWM_T::DTCTL4_5: DTCNT Position */ -#define EPWM_DTCTL4_5_DTCNT_Msk (0xffful << EPWM_DTCTL4_5_DTCNT_Pos) /*!< EPWM_T::DTCTL4_5: DTCNT Mask */ - -#define EPWM_DTCTL4_5_DTEN_Pos (16) /*!< EPWM_T::DTCTL4_5: DTEN Position */ -#define EPWM_DTCTL4_5_DTEN_Msk (0x1ul << EPWM_DTCTL4_5_DTEN_Pos) /*!< EPWM_T::DTCTL4_5: DTEN Mask */ - -#define EPWM_DTCTL4_5_DTCKSEL_Pos (24) /*!< EPWM_T::DTCTL4_5: DTCKSEL Position */ -#define EPWM_DTCTL4_5_DTCKSEL_Msk (0x1ul << EPWM_DTCTL4_5_DTCKSEL_Pos) /*!< EPWM_T::DTCTL4_5: DTCKSEL Mask */ - -#define EPWM_PHS0_1_PHS_Pos (0) /*!< EPWM_T::PHS0_1: PHS Position */ -#define EPWM_PHS0_1_PHS_Msk (0xfffful << EPWM_PHS0_1_PHS_Pos) /*!< EPWM_T::PHS0_1: PHS Mask */ - -#define EPWM_PHS2_3_PHS_Pos (0) /*!< EPWM_T::PHS2_3: PHS Position */ -#define EPWM_PHS2_3_PHS_Msk (0xfffful << EPWM_PHS2_3_PHS_Pos) /*!< EPWM_T::PHS2_3: PHS Mask */ - -#define EPWM_PHS4_5_PHS_Pos (0) /*!< EPWM_T::PHS4_5: PHS Position */ -#define EPWM_PHS4_5_PHS_Msk (0xfffful << EPWM_PHS4_5_PHS_Pos) /*!< EPWM_T::PHS4_5: PHS Mask */ - -#define EPWM_CNT0_CNT_Pos (0) /*!< EPWM_T::CNT0: CNT Position */ -#define EPWM_CNT0_CNT_Msk (0xfffful << EPWM_CNT0_CNT_Pos) /*!< EPWM_T::CNT0: CNT Mask */ - -#define EPWM_CNT0_DIRF_Pos (16) /*!< EPWM_T::CNT0: DIRF Position */ -#define EPWM_CNT0_DIRF_Msk (0x1ul << EPWM_CNT0_DIRF_Pos) /*!< EPWM_T::CNT0: DIRF Mask */ - -#define EPWM_CNT1_CNT_Pos (0) /*!< EPWM_T::CNT1: CNT Position */ -#define EPWM_CNT1_CNT_Msk (0xfffful << EPWM_CNT1_CNT_Pos) /*!< EPWM_T::CNT1: CNT Mask */ - -#define EPWM_CNT1_DIRF_Pos (16) /*!< EPWM_T::CNT1: DIRF Position */ -#define EPWM_CNT1_DIRF_Msk (0x1ul << EPWM_CNT1_DIRF_Pos) /*!< EPWM_T::CNT1: DIRF Mask */ - -#define EPWM_CNT2_CNT_Pos (0) /*!< EPWM_T::CNT2: CNT Position */ -#define EPWM_CNT2_CNT_Msk (0xfffful << EPWM_CNT2_CNT_Pos) /*!< EPWM_T::CNT2: CNT Mask */ - -#define EPWM_CNT2_DIRF_Pos (16) /*!< EPWM_T::CNT2: DIRF Position */ -#define EPWM_CNT2_DIRF_Msk (0x1ul << EPWM_CNT2_DIRF_Pos) /*!< EPWM_T::CNT2: DIRF Mask */ - -#define EPWM_CNT3_CNT_Pos (0) /*!< EPWM_T::CNT3: CNT Position */ -#define EPWM_CNT3_CNT_Msk (0xfffful << EPWM_CNT3_CNT_Pos) /*!< EPWM_T::CNT3: CNT Mask */ - -#define EPWM_CNT3_DIRF_Pos (16) /*!< EPWM_T::CNT3: DIRF Position */ -#define EPWM_CNT3_DIRF_Msk (0x1ul << EPWM_CNT3_DIRF_Pos) /*!< EPWM_T::CNT3: DIRF Mask */ - -#define EPWM_CNT4_CNT_Pos (0) /*!< EPWM_T::CNT4: CNT Position */ -#define EPWM_CNT4_CNT_Msk (0xfffful << EPWM_CNT4_CNT_Pos) /*!< EPWM_T::CNT4: CNT Mask */ - -#define EPWM_CNT4_DIRF_Pos (16) /*!< EPWM_T::CNT4: DIRF Position */ -#define EPWM_CNT4_DIRF_Msk (0x1ul << EPWM_CNT4_DIRF_Pos) /*!< EPWM_T::CNT4: DIRF Mask */ - -#define EPWM_CNT5_CNT_Pos (0) /*!< EPWM_T::CNT5: CNT Position */ -#define EPWM_CNT5_CNT_Msk (0xfffful << EPWM_CNT5_CNT_Pos) /*!< EPWM_T::CNT5: CNT Mask */ - -#define EPWM_CNT5_DIRF_Pos (16) /*!< EPWM_T::CNT5: DIRF Position */ -#define EPWM_CNT5_DIRF_Msk (0x1ul << EPWM_CNT5_DIRF_Pos) /*!< EPWM_T::CNT5: DIRF Mask */ - -#define EPWM_WGCTL0_ZPCTL0_Pos (0) /*!< EPWM_T::WGCTL0: ZPCTL0 Position */ -#define EPWM_WGCTL0_ZPCTL0_Msk (0x3ul << EPWM_WGCTL0_ZPCTL0_Pos) /*!< EPWM_T::WGCTL0: ZPCTL0 Mask */ - -#define EPWM_WGCTL0_ZPCTL1_Pos (2) /*!< EPWM_T::WGCTL0: ZPCTL1 Position */ -#define EPWM_WGCTL0_ZPCTL1_Msk (0x3ul << EPWM_WGCTL0_ZPCTL1_Pos) /*!< EPWM_T::WGCTL0: ZPCTL1 Mask */ - -#define EPWM_WGCTL0_ZPCTL2_Pos (4) /*!< EPWM_T::WGCTL0: ZPCTL2 Position */ -#define EPWM_WGCTL0_ZPCTL2_Msk (0x3ul << EPWM_WGCTL0_ZPCTL2_Pos) /*!< EPWM_T::WGCTL0: ZPCTL2 Mask */ - -#define EPWM_WGCTL0_ZPCTL3_Pos (6) /*!< EPWM_T::WGCTL0: ZPCTL3 Position */ -#define EPWM_WGCTL0_ZPCTL3_Msk (0x3ul << EPWM_WGCTL0_ZPCTL3_Pos) /*!< EPWM_T::WGCTL0: ZPCTL3 Mask */ - -#define EPWM_WGCTL0_ZPCTL4_Pos (8) /*!< EPWM_T::WGCTL0: ZPCTL4 Position */ -#define EPWM_WGCTL0_ZPCTL4_Msk (0x3ul << EPWM_WGCTL0_ZPCTL4_Pos) /*!< EPWM_T::WGCTL0: ZPCTL4 Mask */ - -#define EPWM_WGCTL0_ZPCTL5_Pos (10) /*!< EPWM_T::WGCTL0: ZPCTL5 Position */ -#define EPWM_WGCTL0_ZPCTL5_Msk (0x3ul << EPWM_WGCTL0_ZPCTL5_Pos) /*!< EPWM_T::WGCTL0: ZPCTL5 Mask */ - -#define EPWM_WGCTL0_PRDPCTL0_Pos (16) /*!< EPWM_T::WGCTL0: PRDPCTL0 Position */ -#define EPWM_WGCTL0_PRDPCTL0_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL0_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL0 Mask */ - -#define EPWM_WGCTL0_PRDPCTL1_Pos (18) /*!< EPWM_T::WGCTL0: PRDPCTL1 Position */ -#define EPWM_WGCTL0_PRDPCTL1_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL1_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL1 Mask */ - -#define EPWM_WGCTL0_PRDPCTL2_Pos (20) /*!< EPWM_T::WGCTL0: PRDPCTL2 Position */ -#define EPWM_WGCTL0_PRDPCTL2_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL2_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL2 Mask */ - -#define EPWM_WGCTL0_PRDPCTL3_Pos (22) /*!< EPWM_T::WGCTL0: PRDPCTL3 Position */ -#define EPWM_WGCTL0_PRDPCTL3_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL3_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL3 Mask */ - -#define EPWM_WGCTL0_PRDPCTL4_Pos (24) /*!< EPWM_T::WGCTL0: PRDPCTL4 Position */ -#define EPWM_WGCTL0_PRDPCTL4_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL4_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL4 Mask */ - -#define EPWM_WGCTL0_PRDPCTL5_Pos (26) /*!< EPWM_T::WGCTL0: PRDPCTL5 Position */ -#define EPWM_WGCTL0_PRDPCTL5_Msk (0x3ul << EPWM_WGCTL0_PRDPCTL5_Pos) /*!< EPWM_T::WGCTL0: PRDPCTL5 Mask */ - -#define EPWM_WGCTL1_CMPUCTL0_Pos (0) /*!< EPWM_T::WGCTL1: CMPUCTL0 Position */ -#define EPWM_WGCTL1_CMPUCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL0 Mask */ - -#define EPWM_WGCTL1_CMPUCTL1_Pos (2) /*!< EPWM_T::WGCTL1: CMPUCTL1 Position */ -#define EPWM_WGCTL1_CMPUCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL1 Mask */ - -#define EPWM_WGCTL1_CMPUCTL2_Pos (4) /*!< EPWM_T::WGCTL1: CMPUCTL2 Position */ -#define EPWM_WGCTL1_CMPUCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL2 Mask */ - -#define EPWM_WGCTL1_CMPUCTL3_Pos (6) /*!< EPWM_T::WGCTL1: CMPUCTL3 Position */ -#define EPWM_WGCTL1_CMPUCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL3 Mask */ - -#define EPWM_WGCTL1_CMPUCTL4_Pos (8) /*!< EPWM_T::WGCTL1: CMPUCTL4 Position */ -#define EPWM_WGCTL1_CMPUCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL4 Mask */ - -#define EPWM_WGCTL1_CMPUCTL5_Pos (10) /*!< EPWM_T::WGCTL1: CMPUCTL5 Position */ -#define EPWM_WGCTL1_CMPUCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPUCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPUCTL5 Mask */ - -#define EPWM_WGCTL1_CMPDCTL0_Pos (16) /*!< EPWM_T::WGCTL1: CMPDCTL0 Position */ -#define EPWM_WGCTL1_CMPDCTL0_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL0_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL0 Mask */ - -#define EPWM_WGCTL1_CMPDCTL1_Pos (18) /*!< EPWM_T::WGCTL1: CMPDCTL1 Position */ -#define EPWM_WGCTL1_CMPDCTL1_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL1_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL1 Mask */ - -#define EPWM_WGCTL1_CMPDCTL2_Pos (20) /*!< EPWM_T::WGCTL1: CMPDCTL2 Position */ -#define EPWM_WGCTL1_CMPDCTL2_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL2_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL2 Mask */ - -#define EPWM_WGCTL1_CMPDCTL3_Pos (22) /*!< EPWM_T::WGCTL1: CMPDCTL3 Position */ -#define EPWM_WGCTL1_CMPDCTL3_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL3_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL3 Mask */ - -#define EPWM_WGCTL1_CMPDCTL4_Pos (24) /*!< EPWM_T::WGCTL1: CMPDCTL4 Position */ -#define EPWM_WGCTL1_CMPDCTL4_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL4_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL4 Mask */ - -#define EPWM_WGCTL1_CMPDCTL5_Pos (26) /*!< EPWM_T::WGCTL1: CMPDCTL5 Position */ -#define EPWM_WGCTL1_CMPDCTL5_Msk (0x3ul << EPWM_WGCTL1_CMPDCTL5_Pos) /*!< EPWM_T::WGCTL1: CMPDCTL5 Mask */ - -#define EPWM_MSKEN_MSKEN0_Pos (0) /*!< EPWM_T::MSKEN: MSKEN0 Position */ -#define EPWM_MSKEN_MSKEN0_Msk (0x1ul << EPWM_MSKEN_MSKEN0_Pos) /*!< EPWM_T::MSKEN: MSKEN0 Mask */ - -#define EPWM_MSKEN_MSKEN1_Pos (1) /*!< EPWM_T::MSKEN: MSKEN1 Position */ -#define EPWM_MSKEN_MSKEN1_Msk (0x1ul << EPWM_MSKEN_MSKEN1_Pos) /*!< EPWM_T::MSKEN: MSKEN1 Mask */ - -#define EPWM_MSKEN_MSKEN2_Pos (2) /*!< EPWM_T::MSKEN: MSKEN2 Position */ -#define EPWM_MSKEN_MSKEN2_Msk (0x1ul << EPWM_MSKEN_MSKEN2_Pos) /*!< EPWM_T::MSKEN: MSKEN2 Mask */ - -#define EPWM_MSKEN_MSKEN3_Pos (3) /*!< EPWM_T::MSKEN: MSKEN3 Position */ -#define EPWM_MSKEN_MSKEN3_Msk (0x1ul << EPWM_MSKEN_MSKEN3_Pos) /*!< EPWM_T::MSKEN: MSKEN3 Mask */ - -#define EPWM_MSKEN_MSKEN4_Pos (4) /*!< EPWM_T::MSKEN: MSKEN4 Position */ -#define EPWM_MSKEN_MSKEN4_Msk (0x1ul << EPWM_MSKEN_MSKEN4_Pos) /*!< EPWM_T::MSKEN: MSKEN4 Mask */ - -#define EPWM_MSKEN_MSKEN5_Pos (5) /*!< EPWM_T::MSKEN: MSKEN5 Position */ -#define EPWM_MSKEN_MSKEN5_Msk (0x1ul << EPWM_MSKEN_MSKEN5_Pos) /*!< EPWM_T::MSKEN: MSKEN5 Mask */ - -#define EPWM_MSK_MSKDAT0_Pos (0) /*!< EPWM_T::MSK: MSKDAT0 Position */ -#define EPWM_MSK_MSKDAT0_Msk (0x1ul << EPWM_MSK_MSKDAT0_Pos) /*!< EPWM_T::MSK: MSKDAT0 Mask */ - -#define EPWM_MSK_MSKDAT1_Pos (1) /*!< EPWM_T::MSK: MSKDAT1 Position */ -#define EPWM_MSK_MSKDAT1_Msk (0x1ul << EPWM_MSK_MSKDAT1_Pos) /*!< EPWM_T::MSK: MSKDAT1 Mask */ - -#define EPWM_MSK_MSKDAT2_Pos (2) /*!< EPWM_T::MSK: MSKDAT2 Position */ -#define EPWM_MSK_MSKDAT2_Msk (0x1ul << EPWM_MSK_MSKDAT2_Pos) /*!< EPWM_T::MSK: MSKDAT2 Mask */ - -#define EPWM_MSK_MSKDAT3_Pos (3) /*!< EPWM_T::MSK: MSKDAT3 Position */ -#define EPWM_MSK_MSKDAT3_Msk (0x1ul << EPWM_MSK_MSKDAT3_Pos) /*!< EPWM_T::MSK: MSKDAT3 Mask */ - -#define EPWM_MSK_MSKDAT4_Pos (4) /*!< EPWM_T::MSK: MSKDAT4 Position */ -#define EPWM_MSK_MSKDAT4_Msk (0x1ul << EPWM_MSK_MSKDAT4_Pos) /*!< EPWM_T::MSK: MSKDAT4 Mask */ - -#define EPWM_MSK_MSKDAT5_Pos (5) /*!< EPWM_T::MSK: MSKDAT5 Position */ -#define EPWM_MSK_MSKDAT5_Msk (0x1ul << EPWM_MSK_MSKDAT5_Pos) /*!< EPWM_T::MSK: MSKDAT5 Mask */ - -#define EPWM_BNF_BRK0NFEN_Pos (0) /*!< EPWM_T::BNF: BRK0NFEN Position */ -#define EPWM_BNF_BRK0NFEN_Msk (0x1ul << EPWM_BNF_BRK0NFEN_Pos) /*!< EPWM_T::BNF: BRK0NFEN Mask */ - -#define EPWM_BNF_BRK0NFSEL_Pos (1) /*!< EPWM_T::BNF: BRK0NFSEL Position */ -#define EPWM_BNF_BRK0NFSEL_Msk (0x7ul << EPWM_BNF_BRK0NFSEL_Pos) /*!< EPWM_T::BNF: BRK0NFSEL Mask */ - -#define EPWM_BNF_BRK0FCNT_Pos (4) /*!< EPWM_T::BNF: BRK0FCNT Position */ -#define EPWM_BNF_BRK0FCNT_Msk (0x7ul << EPWM_BNF_BRK0FCNT_Pos) /*!< EPWM_T::BNF: BRK0FCNT Mask */ - -#define EPWM_BNF_BRK0PINV_Pos (7) /*!< EPWM_T::BNF: BRK0PINV Position */ -#define EPWM_BNF_BRK0PINV_Msk (0x1ul << EPWM_BNF_BRK0PINV_Pos) /*!< EPWM_T::BNF: BRK0PINV Mask */ - -#define EPWM_BNF_BRK1NFEN_Pos (8) /*!< EPWM_T::BNF: BRK1NFEN Position */ -#define EPWM_BNF_BRK1NFEN_Msk (0x1ul << EPWM_BNF_BRK1NFEN_Pos) /*!< EPWM_T::BNF: BRK1NFEN Mask */ - -#define EPWM_BNF_BRK1NFSEL_Pos (9) /*!< EPWM_T::BNF: BRK1NFSEL Position */ -#define EPWM_BNF_BRK1NFSEL_Msk (0x7ul << EPWM_BNF_BRK1NFSEL_Pos) /*!< EPWM_T::BNF: BRK1NFSEL Mask */ - -#define EPWM_BNF_BRK1FCNT_Pos (12) /*!< EPWM_T::BNF: BRK1FCNT Position */ -#define EPWM_BNF_BRK1FCNT_Msk (0x7ul << EPWM_BNF_BRK1FCNT_Pos) /*!< EPWM_T::BNF: BRK1FCNT Mask */ - -#define EPWM_BNF_BRK1PINV_Pos (15) /*!< EPWM_T::BNF: BRK1PINV Position */ -#define EPWM_BNF_BRK1PINV_Msk (0x1ul << EPWM_BNF_BRK1PINV_Pos) /*!< EPWM_T::BNF: BRK1PINV Mask */ - -#define EPWM_BNF_BK0SRC_Pos (16) /*!< EPWM_T::BNF: BK0SRC Position */ -#define EPWM_BNF_BK0SRC_Msk (0x3ul << EPWM_BNF_BK0SRC_Pos) /*!< EPWM_T::BNF: BK0SRC Mask */ - -#define EPWM_BNF_BK1SRC_Pos (24) /*!< EPWM_T::BNF: BK1SRC Position */ -#define EPWM_BNF_BK1SRC_Msk (0x3ul << EPWM_BNF_BK1SRC_Pos) /*!< EPWM_T::BNF: BK1SRC Mask */ - -#define EPWM_FAILBRK_CSSBRKEN_Pos (0) /*!< EPWM_T::FAILBRK: CSSBRKEN Position */ -#define EPWM_FAILBRK_CSSBRKEN_Msk (0x1ul << EPWM_FAILBRK_CSSBRKEN_Pos) /*!< EPWM_T::FAILBRK: CSSBRKEN Mask */ - -#define EPWM_FAILBRK_LVDBRKEN_Pos (1) /*!< EPWM_T::FAILBRK: LVDBRKEN Position */ -#define EPWM_FAILBRK_LVDBRKEN_Msk (0x1ul << EPWM_FAILBRK_LVDBRKEN_Pos) /*!< EPWM_T::FAILBRK: LVDBRKEN Mask */ - -#define EPWM_FAILBRK_BODBRKEN_Pos (1) /*!< EPWM_T::FAILBRK: BODBRKEN Position */ -#define EPWM_FAILBRK_BODBRKEN_Msk (0x1ul << EPWM_FAILBRK_BODBRKEN_Pos) /*!< EPWM_T::FAILBRK: BODBRKEN Mask */ - -#define EPWM_FAILBRK_RAMBRKEN_Pos (2) /*!< EPWM_T::FAILBRK: RAMBRKEN Position */ -#define EPWM_FAILBRK_RAMBRKEN_Msk (0x1ul << EPWM_FAILBRK_RAMBRKEN_Pos) /*!< EPWM_T::FAILBRK: RAMBRKEN Mask */ - -#define EPWM_FAILBRK_CORBRKEN_Pos (3) /*!< EPWM_T::FAILBRK: CORBRKEN Position */ -#define EPWM_FAILBRK_CORBRKEN_Msk (0x1ul << EPWM_FAILBRK_CORBRKEN_Pos) /*!< EPWM_T::FAILBRK: CORBRKEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Position */ -#define EPWM_BRKCTL0_1_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0EEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Position */ -#define EPWM_BRKCTL0_1_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1EEN Mask */ - -#define EPWM_BRKCTL0_1_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Position */ -#define EPWM_BRKCTL0_1_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSEBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Position */ -#define EPWM_BRKCTL0_1_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP0LEN Mask */ - -#define EPWM_BRKCTL0_1_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Position */ -#define EPWM_BRKCTL0_1_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL0_1_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKP1LEN Mask */ - -#define EPWM_BRKCTL0_1_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Position */ -#define EPWM_BRKCTL0_1_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL0_1_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL0_1: SYSLBEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Position */ -#define EPWM_BRKCTL0_1_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAEVEN Mask */ - -#define EPWM_BRKCTL0_1_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL0_1: BRKAODD Position */ -#define EPWM_BRKCTL0_1_BRKAODD_Msk (0x3ul << EPWM_BRKCTL0_1_BRKAODD_Pos) /*!< EPWM_T::BRKCTL0_1: BRKAODD Mask */ - -#define EPWM_BRKCTL0_1_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL0_1: EADCEBEN Position */ -#define EPWM_BRKCTL0_1_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADCEBEN Mask */ - -#define EPWM_BRKCTL0_1_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL0_1: EADCLBEN Position */ -#define EPWM_BRKCTL0_1_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL0_1_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL0_1: EADCLBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Position */ -#define EPWM_BRKCTL2_3_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0EEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Position */ -#define EPWM_BRKCTL2_3_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1EEN Mask */ - -#define EPWM_BRKCTL2_3_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Position */ -#define EPWM_BRKCTL2_3_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSEBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Position */ -#define EPWM_BRKCTL2_3_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP0LEN Mask */ - -#define EPWM_BRKCTL2_3_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Position */ -#define EPWM_BRKCTL2_3_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL2_3_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKP1LEN Mask */ - -#define EPWM_BRKCTL2_3_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Position */ -#define EPWM_BRKCTL2_3_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL2_3_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL2_3: SYSLBEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Position */ -#define EPWM_BRKCTL2_3_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAEVEN Mask */ - -#define EPWM_BRKCTL2_3_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL2_3: BRKAODD Position */ -#define EPWM_BRKCTL2_3_BRKAODD_Msk (0x3ul << EPWM_BRKCTL2_3_BRKAODD_Pos) /*!< EPWM_T::BRKCTL2_3: BRKAODD Mask */ - -#define EPWM_BRKCTL2_3_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL2_3: EADCEBEN Position */ -#define EPWM_BRKCTL2_3_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADCEBEN Mask */ - -#define EPWM_BRKCTL2_3_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL2_3: EADCLBEN Position */ -#define EPWM_BRKCTL2_3_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL2_3_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL2_3: EADCLBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0EEN_Pos (4) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Position */ -#define EPWM_BRKCTL4_5_BRKP0EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0EEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1EEN_Pos (5) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Position */ -#define EPWM_BRKCTL4_5_BRKP1EEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1EEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1EEN Mask */ - -#define EPWM_BRKCTL4_5_SYSEBEN_Pos (7) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Position */ -#define EPWM_BRKCTL4_5_SYSEBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSEBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSEBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP0LEN_Pos (12) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Position */ -#define EPWM_BRKCTL4_5_BRKP0LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP0LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP0LEN Mask */ - -#define EPWM_BRKCTL4_5_BRKP1LEN_Pos (13) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Position */ -#define EPWM_BRKCTL4_5_BRKP1LEN_Msk (0x1ul << EPWM_BRKCTL4_5_BRKP1LEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKP1LEN Mask */ - -#define EPWM_BRKCTL4_5_SYSLBEN_Pos (15) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Position */ -#define EPWM_BRKCTL4_5_SYSLBEN_Msk (0x1ul << EPWM_BRKCTL4_5_SYSLBEN_Pos) /*!< EPWM_T::BRKCTL4_5: SYSLBEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAEVEN_Pos (16) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Position */ -#define EPWM_BRKCTL4_5_BRKAEVEN_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAEVEN_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAEVEN Mask */ - -#define EPWM_BRKCTL4_5_BRKAODD_Pos (18) /*!< EPWM_T::BRKCTL4_5: BRKAODD Position */ -#define EPWM_BRKCTL4_5_BRKAODD_Msk (0x3ul << EPWM_BRKCTL4_5_BRKAODD_Pos) /*!< EPWM_T::BRKCTL4_5: BRKAODD Mask */ - -#define EPWM_BRKCTL4_5_EADCEBEN_Pos (20) /*!< EPWM_T::BRKCTL4_5: EADCEBEN Position */ -#define EPWM_BRKCTL4_5_EADCEBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADCEBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADCEBEN Mask */ - -#define EPWM_BRKCTL4_5_EADCLBEN_Pos (28) /*!< EPWM_T::BRKCTL4_5: EADCLBEN Position */ -#define EPWM_BRKCTL4_5_EADCLBEN_Msk (0x1ul << EPWM_BRKCTL4_5_EADCLBEN_Pos) /*!< EPWM_T::BRKCTL4_5: EADCLBEN Mask */ - -#define EPWM_POLCTL_PINV0_Pos (0) /*!< EPWM_T::POLCTL: PINV0 Position */ -#define EPWM_POLCTL_PINV0_Msk (0x1ul << EPWM_POLCTL_PINV0_Pos) /*!< EPWM_T::POLCTL: PINV0 Mask */ - -#define EPWM_POLCTL_PINV1_Pos (1) /*!< EPWM_T::POLCTL: PINV1 Position */ -#define EPWM_POLCTL_PINV1_Msk (0x1ul << EPWM_POLCTL_PINV1_Pos) /*!< EPWM_T::POLCTL: PINV1 Mask */ - -#define EPWM_POLCTL_PINV2_Pos (2) /*!< EPWM_T::POLCTL: PINV2 Position */ -#define EPWM_POLCTL_PINV2_Msk (0x1ul << EPWM_POLCTL_PINV2_Pos) /*!< EPWM_T::POLCTL: PINV2 Mask */ - -#define EPWM_POLCTL_PINV3_Pos (3) /*!< EPWM_T::POLCTL: PINV3 Position */ -#define EPWM_POLCTL_PINV3_Msk (0x1ul << EPWM_POLCTL_PINV3_Pos) /*!< EPWM_T::POLCTL: PINV3 Mask */ - -#define EPWM_POLCTL_PINV4_Pos (4) /*!< EPWM_T::POLCTL: PINV4 Position */ -#define EPWM_POLCTL_PINV4_Msk (0x1ul << EPWM_POLCTL_PINV4_Pos) /*!< EPWM_T::POLCTL: PINV4 Mask */ - -#define EPWM_POLCTL_PINV5_Pos (5) /*!< EPWM_T::POLCTL: PINV5 Position */ -#define EPWM_POLCTL_PINV5_Msk (0x1ul << EPWM_POLCTL_PINV5_Pos) /*!< EPWM_T::POLCTL: PINV5 Mask */ - -#define EPWM_POEN_POEN0_Pos (0) /*!< EPWM_T::POEN: POEN0 Position */ -#define EPWM_POEN_POEN0_Msk (0x1ul << EPWM_POEN_POEN0_Pos) /*!< EPWM_T::POEN: POEN0 Mask */ - -#define EPWM_POEN_POEN1_Pos (1) /*!< EPWM_T::POEN: POEN1 Position */ -#define EPWM_POEN_POEN1_Msk (0x1ul << EPWM_POEN_POEN1_Pos) /*!< EPWM_T::POEN: POEN1 Mask */ - -#define EPWM_POEN_POEN2_Pos (2) /*!< EPWM_T::POEN: POEN2 Position */ -#define EPWM_POEN_POEN2_Msk (0x1ul << EPWM_POEN_POEN2_Pos) /*!< EPWM_T::POEN: POEN2 Mask */ - -#define EPWM_POEN_POEN3_Pos (3) /*!< EPWM_T::POEN: POEN3 Position */ -#define EPWM_POEN_POEN3_Msk (0x1ul << EPWM_POEN_POEN3_Pos) /*!< EPWM_T::POEN: POEN3 Mask */ - -#define EPWM_POEN_POEN4_Pos (4) /*!< EPWM_T::POEN: POEN4 Position */ -#define EPWM_POEN_POEN4_Msk (0x1ul << EPWM_POEN_POEN4_Pos) /*!< EPWM_T::POEN: POEN4 Mask */ - -#define EPWM_POEN_POEN5_Pos (5) /*!< EPWM_T::POEN: POEN5 Position */ -#define EPWM_POEN_POEN5_Msk (0x1ul << EPWM_POEN_POEN5_Pos) /*!< EPWM_T::POEN: POEN5 Mask */ - -#define EPWM_SWBRK_BRKETRG0_Pos (0) /*!< EPWM_T::SWBRK: BRKETRG0 Position */ -#define EPWM_SWBRK_BRKETRG0_Msk (0x1ul << EPWM_SWBRK_BRKETRG0_Pos) /*!< EPWM_T::SWBRK: BRKETRG0 Mask */ - -#define EPWM_SWBRK_BRKETRG2_Pos (1) /*!< EPWM_T::SWBRK: BRKETRG2 Position */ -#define EPWM_SWBRK_BRKETRG2_Msk (0x1ul << EPWM_SWBRK_BRKETRG2_Pos) /*!< EPWM_T::SWBRK: BRKETRG2 Mask */ - -#define EPWM_SWBRK_BRKETRG4_Pos (2) /*!< EPWM_T::SWBRK: BRKETRG4 Position */ -#define EPWM_SWBRK_BRKETRG4_Msk (0x1ul << EPWM_SWBRK_BRKETRG4_Pos) /*!< EPWM_T::SWBRK: BRKETRG4 Mask */ - -#define EPWM_SWBRK_BRKLTRG0_Pos (8) /*!< EPWM_T::SWBRK: BRKLTRG0 Position */ -#define EPWM_SWBRK_BRKLTRG0_Msk (0x1ul << EPWM_SWBRK_BRKLTRG0_Pos) /*!< EPWM_T::SWBRK: BRKLTRG0 Mask */ - -#define EPWM_SWBRK_BRKLTRG2_Pos (9) /*!< EPWM_T::SWBRK: BRKLTRG2 Position */ -#define EPWM_SWBRK_BRKLTRG2_Msk (0x1ul << EPWM_SWBRK_BRKLTRG2_Pos) /*!< EPWM_T::SWBRK: BRKLTRG2 Mask */ - -#define EPWM_SWBRK_BRKLTRG4_Pos (10) /*!< EPWM_T::SWBRK: BRKLTRG4 Position */ -#define EPWM_SWBRK_BRKLTRG4_Msk (0x1ul << EPWM_SWBRK_BRKLTRG4_Pos) /*!< EPWM_T::SWBRK: BRKLTRG4 Mask */ - -#define EPWM_INTEN0_ZIEN0_Pos (0) /*!< EPWM_T::INTEN0: ZIEN0 Position */ -#define EPWM_INTEN0_ZIEN0_Msk (0x1ul << EPWM_INTEN0_ZIEN0_Pos) /*!< EPWM_T::INTEN0: ZIEN0 Mask */ - -#define EPWM_INTEN0_ZIEN1_Pos (1) /*!< EPWM_T::INTEN0: ZIEN1 Position */ -#define EPWM_INTEN0_ZIEN1_Msk (0x1ul << EPWM_INTEN0_ZIEN1_Pos) /*!< EPWM_T::INTEN0: ZIEN1 Mask */ - -#define EPWM_INTEN0_ZIEN2_Pos (2) /*!< EPWM_T::INTEN0: ZIEN2 Position */ -#define EPWM_INTEN0_ZIEN2_Msk (0x1ul << EPWM_INTEN0_ZIEN2_Pos) /*!< EPWM_T::INTEN0: ZIEN2 Mask */ - -#define EPWM_INTEN0_ZIEN3_Pos (3) /*!< EPWM_T::INTEN0: ZIEN3 Position */ -#define EPWM_INTEN0_ZIEN3_Msk (0x1ul << EPWM_INTEN0_ZIEN3_Pos) /*!< EPWM_T::INTEN0: ZIEN3 Mask */ - -#define EPWM_INTEN0_ZIEN4_Pos (4) /*!< EPWM_T::INTEN0: ZIEN4 Position */ -#define EPWM_INTEN0_ZIEN4_Msk (0x1ul << EPWM_INTEN0_ZIEN4_Pos) /*!< EPWM_T::INTEN0: ZIEN4 Mask */ - -#define EPWM_INTEN0_ZIEN5_Pos (5) /*!< EPWM_T::INTEN0: ZIEN5 Position */ -#define EPWM_INTEN0_ZIEN5_Msk (0x1ul << EPWM_INTEN0_ZIEN5_Pos) /*!< EPWM_T::INTEN0: ZIEN5 Mask */ - -#define EPWM_INTEN0_PIEN0_Pos (8) /*!< EPWM_T::INTEN0: PIEN0 Position */ -#define EPWM_INTEN0_PIEN0_Msk (0x1ul << EPWM_INTEN0_PIEN0_Pos) /*!< EPWM_T::INTEN0: PIEN0 Mask */ - -#define EPWM_INTEN0_PIEN1_Pos (9) /*!< EPWM_T::INTEN0: PIEN1 Position */ -#define EPWM_INTEN0_PIEN1_Msk (0x1ul << EPWM_INTEN0_PIEN1_Pos) /*!< EPWM_T::INTEN0: PIEN1 Mask */ - -#define EPWM_INTEN0_PIEN2_Pos (10) /*!< EPWM_T::INTEN0: PIEN2 Position */ -#define EPWM_INTEN0_PIEN2_Msk (0x1ul << EPWM_INTEN0_PIEN2_Pos) /*!< EPWM_T::INTEN0: PIEN2 Mask */ - -#define EPWM_INTEN0_PIEN3_Pos (11) /*!< EPWM_T::INTEN0: PIEN3 Position */ -#define EPWM_INTEN0_PIEN3_Msk (0x1ul << EPWM_INTEN0_PIEN3_Pos) /*!< EPWM_T::INTEN0: PIEN3 Mask */ - -#define EPWM_INTEN0_PIEN4_Pos (12) /*!< EPWM_T::INTEN0: PIEN4 Position */ -#define EPWM_INTEN0_PIEN4_Msk (0x1ul << EPWM_INTEN0_PIEN4_Pos) /*!< EPWM_T::INTEN0: PIEN4 Mask */ - -#define EPWM_INTEN0_PIEN5_Pos (13) /*!< EPWM_T::INTEN0: PIEN5 Position */ -#define EPWM_INTEN0_PIEN5_Msk (0x1ul << EPWM_INTEN0_PIEN5_Pos) /*!< EPWM_T::INTEN0: PIEN5 Mask */ - -#define EPWM_INTEN0_CMPUIEN0_Pos (16) /*!< EPWM_T::INTEN0: CMPUIEN0 Position */ -#define EPWM_INTEN0_CMPUIEN0_Msk (0x1ul << EPWM_INTEN0_CMPUIEN0_Pos) /*!< EPWM_T::INTEN0: CMPUIEN0 Mask */ - -#define EPWM_INTEN0_CMPUIEN1_Pos (17) /*!< EPWM_T::INTEN0: CMPUIEN1 Position */ -#define EPWM_INTEN0_CMPUIEN1_Msk (0x1ul << EPWM_INTEN0_CMPUIEN1_Pos) /*!< EPWM_T::INTEN0: CMPUIEN1 Mask */ - -#define EPWM_INTEN0_CMPUIEN2_Pos (18) /*!< EPWM_T::INTEN0: CMPUIEN2 Position */ -#define EPWM_INTEN0_CMPUIEN2_Msk (0x1ul << EPWM_INTEN0_CMPUIEN2_Pos) /*!< EPWM_T::INTEN0: CMPUIEN2 Mask */ - -#define EPWM_INTEN0_CMPUIEN3_Pos (19) /*!< EPWM_T::INTEN0: CMPUIEN3 Position */ -#define EPWM_INTEN0_CMPUIEN3_Msk (0x1ul << EPWM_INTEN0_CMPUIEN3_Pos) /*!< EPWM_T::INTEN0: CMPUIEN3 Mask */ - -#define EPWM_INTEN0_CMPUIEN4_Pos (20) /*!< EPWM_T::INTEN0: CMPUIEN4 Position */ -#define EPWM_INTEN0_CMPUIEN4_Msk (0x1ul << EPWM_INTEN0_CMPUIEN4_Pos) /*!< EPWM_T::INTEN0: CMPUIEN4 Mask */ - -#define EPWM_INTEN0_CMPUIEN5_Pos (21) /*!< EPWM_T::INTEN0: CMPUIEN5 Position */ -#define EPWM_INTEN0_CMPUIEN5_Msk (0x1ul << EPWM_INTEN0_CMPUIEN5_Pos) /*!< EPWM_T::INTEN0: CMPUIEN5 Mask */ - -#define EPWM_INTEN0_CMPDIEN0_Pos (24) /*!< EPWM_T::INTEN0: CMPDIEN0 Position */ -#define EPWM_INTEN0_CMPDIEN0_Msk (0x1ul << EPWM_INTEN0_CMPDIEN0_Pos) /*!< EPWM_T::INTEN0: CMPDIEN0 Mask */ - -#define EPWM_INTEN0_CMPDIEN1_Pos (25) /*!< EPWM_T::INTEN0: CMPDIEN1 Position */ -#define EPWM_INTEN0_CMPDIEN1_Msk (0x1ul << EPWM_INTEN0_CMPDIEN1_Pos) /*!< EPWM_T::INTEN0: CMPDIEN1 Mask */ - -#define EPWM_INTEN0_CMPDIEN2_Pos (26) /*!< EPWM_T::INTEN0: CMPDIEN2 Position */ -#define EPWM_INTEN0_CMPDIEN2_Msk (0x1ul << EPWM_INTEN0_CMPDIEN2_Pos) /*!< EPWM_T::INTEN0: CMPDIEN2 Mask */ - -#define EPWM_INTEN0_CMPDIEN3_Pos (27) /*!< EPWM_T::INTEN0: CMPDIEN3 Position */ -#define EPWM_INTEN0_CMPDIEN3_Msk (0x1ul << EPWM_INTEN0_CMPDIEN3_Pos) /*!< EPWM_T::INTEN0: CMPDIEN3 Mask */ - -#define EPWM_INTEN0_CMPDIEN4_Pos (28) /*!< EPWM_T::INTEN0: CMPDIEN4 Position */ -#define EPWM_INTEN0_CMPDIEN4_Msk (0x1ul << EPWM_INTEN0_CMPDIEN4_Pos) /*!< EPWM_T::INTEN0: CMPDIEN4 Mask */ - -#define EPWM_INTEN0_CMPDIEN5_Pos (29) /*!< EPWM_T::INTEN0: CMPDIEN5 Position */ -#define EPWM_INTEN0_CMPDIEN5_Msk (0x1ul << EPWM_INTEN0_CMPDIEN5_Pos) /*!< EPWM_T::INTEN0: CMPDIEN5 Mask */ - -#define EPWM_INTEN1_BRKEIEN0_1_Pos (0) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Position */ -#define EPWM_INTEN1_BRKEIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKEIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKEIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKEIEN2_3_Pos (1) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Position */ -#define EPWM_INTEN1_BRKEIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKEIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKEIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKEIEN4_5_Pos (2) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Position */ -#define EPWM_INTEN1_BRKEIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKEIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKEIEN4_5 Mask */ - -#define EPWM_INTEN1_BRKLIEN0_1_Pos (8) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Position */ -#define EPWM_INTEN1_BRKLIEN0_1_Msk (0x1ul << EPWM_INTEN1_BRKLIEN0_1_Pos) /*!< EPWM_T::INTEN1: BRKLIEN0_1 Mask */ - -#define EPWM_INTEN1_BRKLIEN2_3_Pos (9) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Position */ -#define EPWM_INTEN1_BRKLIEN2_3_Msk (0x1ul << EPWM_INTEN1_BRKLIEN2_3_Pos) /*!< EPWM_T::INTEN1: BRKLIEN2_3 Mask */ - -#define EPWM_INTEN1_BRKLIEN4_5_Pos (10) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Position */ -#define EPWM_INTEN1_BRKLIEN4_5_Msk (0x1ul << EPWM_INTEN1_BRKLIEN4_5_Pos) /*!< EPWM_T::INTEN1: BRKLIEN4_5 Mask */ - -#define EPWM_INTSTS0_ZIF0_Pos (0) /*!< EPWM_T::INTSTS0: ZIF0 Position */ -#define EPWM_INTSTS0_ZIF0_Msk (0x1ul << EPWM_INTSTS0_ZIF0_Pos) /*!< EPWM_T::INTSTS0: ZIF0 Mask */ - -#define EPWM_INTSTS0_ZIF1_Pos (1) /*!< EPWM_T::INTSTS0: ZIF1 Position */ -#define EPWM_INTSTS0_ZIF1_Msk (0x1ul << EPWM_INTSTS0_ZIF1_Pos) /*!< EPWM_T::INTSTS0: ZIF1 Mask */ - -#define EPWM_INTSTS0_ZIF2_Pos (2) /*!< EPWM_T::INTSTS0: ZIF2 Position */ -#define EPWM_INTSTS0_ZIF2_Msk (0x1ul << EPWM_INTSTS0_ZIF2_Pos) /*!< EPWM_T::INTSTS0: ZIF2 Mask */ - -#define EPWM_INTSTS0_ZIF3_Pos (3) /*!< EPWM_T::INTSTS0: ZIF3 Position */ -#define EPWM_INTSTS0_ZIF3_Msk (0x1ul << EPWM_INTSTS0_ZIF3_Pos) /*!< EPWM_T::INTSTS0: ZIF3 Mask */ - -#define EPWM_INTSTS0_ZIF4_Pos (4) /*!< EPWM_T::INTSTS0: ZIF4 Position */ -#define EPWM_INTSTS0_ZIF4_Msk (0x1ul << EPWM_INTSTS0_ZIF4_Pos) /*!< EPWM_T::INTSTS0: ZIF4 Mask */ - -#define EPWM_INTSTS0_ZIF5_Pos (5) /*!< EPWM_T::INTSTS0: ZIF5 Position */ -#define EPWM_INTSTS0_ZIF5_Msk (0x1ul << EPWM_INTSTS0_ZIF5_Pos) /*!< EPWM_T::INTSTS0: ZIF5 Mask */ - -#define EPWM_INTSTS0_PIF0_Pos (8) /*!< EPWM_T::INTSTS0: PIF0 Position */ -#define EPWM_INTSTS0_PIF0_Msk (0x1ul << EPWM_INTSTS0_PIF0_Pos) /*!< EPWM_T::INTSTS0: PIF0 Mask */ - -#define EPWM_INTSTS0_PIF1_Pos (9) /*!< EPWM_T::INTSTS0: PIF1 Position */ -#define EPWM_INTSTS0_PIF1_Msk (0x1ul << EPWM_INTSTS0_PIF1_Pos) /*!< EPWM_T::INTSTS0: PIF1 Mask */ - -#define EPWM_INTSTS0_PIF2_Pos (10) /*!< EPWM_T::INTSTS0: PIF2 Position */ -#define EPWM_INTSTS0_PIF2_Msk (0x1ul << EPWM_INTSTS0_PIF2_Pos) /*!< EPWM_T::INTSTS0: PIF2 Mask */ - -#define EPWM_INTSTS0_PIF3_Pos (11) /*!< EPWM_T::INTSTS0: PIF3 Position */ -#define EPWM_INTSTS0_PIF3_Msk (0x1ul << EPWM_INTSTS0_PIF3_Pos) /*!< EPWM_T::INTSTS0: PIF3 Mask */ - -#define EPWM_INTSTS0_PIF4_Pos (12) /*!< EPWM_T::INTSTS0: PIF4 Position */ -#define EPWM_INTSTS0_PIF4_Msk (0x1ul << EPWM_INTSTS0_PIF4_Pos) /*!< EPWM_T::INTSTS0: PIF4 Mask */ - -#define EPWM_INTSTS0_PIF5_Pos (13) /*!< EPWM_T::INTSTS0: PIF5 Position */ -#define EPWM_INTSTS0_PIF5_Msk (0x1ul << EPWM_INTSTS0_PIF5_Pos) /*!< EPWM_T::INTSTS0: PIF5 Mask */ - -#define EPWM_INTSTS0_CMPUIF0_Pos (16) /*!< EPWM_T::INTSTS0: CMPUIF0 Position */ -#define EPWM_INTSTS0_CMPUIF0_Msk (0x1ul << EPWM_INTSTS0_CMPUIF0_Pos) /*!< EPWM_T::INTSTS0: CMPUIF0 Mask */ - -#define EPWM_INTSTS0_CMPUIF1_Pos (17) /*!< EPWM_T::INTSTS0: CMPUIF1 Position */ -#define EPWM_INTSTS0_CMPUIF1_Msk (0x1ul << EPWM_INTSTS0_CMPUIF1_Pos) /*!< EPWM_T::INTSTS0: CMPUIF1 Mask */ - -#define EPWM_INTSTS0_CMPUIF2_Pos (18) /*!< EPWM_T::INTSTS0: CMPUIF2 Position */ -#define EPWM_INTSTS0_CMPUIF2_Msk (0x1ul << EPWM_INTSTS0_CMPUIF2_Pos) /*!< EPWM_T::INTSTS0: CMPUIF2 Mask */ - -#define EPWM_INTSTS0_CMPUIF3_Pos (19) /*!< EPWM_T::INTSTS0: CMPUIF3 Position */ -#define EPWM_INTSTS0_CMPUIF3_Msk (0x1ul << EPWM_INTSTS0_CMPUIF3_Pos) /*!< EPWM_T::INTSTS0: CMPUIF3 Mask */ - -#define EPWM_INTSTS0_CMPUIF4_Pos (20) /*!< EPWM_T::INTSTS0: CMPUIF4 Position */ -#define EPWM_INTSTS0_CMPUIF4_Msk (0x1ul << EPWM_INTSTS0_CMPUIF4_Pos) /*!< EPWM_T::INTSTS0: CMPUIF4 Mask */ - -#define EPWM_INTSTS0_CMPUIF5_Pos (21) /*!< EPWM_T::INTSTS0: CMPUIF5 Position */ -#define EPWM_INTSTS0_CMPUIF5_Msk (0x1ul << EPWM_INTSTS0_CMPUIF5_Pos) /*!< EPWM_T::INTSTS0: CMPUIF5 Mask */ - -#define EPWM_INTSTS0_CMPDIF0_Pos (24) /*!< EPWM_T::INTSTS0: CMPDIF0 Position */ -#define EPWM_INTSTS0_CMPDIF0_Msk (0x1ul << EPWM_INTSTS0_CMPDIF0_Pos) /*!< EPWM_T::INTSTS0: CMPDIF0 Mask */ - -#define EPWM_INTSTS0_CMPDIF1_Pos (25) /*!< EPWM_T::INTSTS0: CMPDIF1 Position */ -#define EPWM_INTSTS0_CMPDIF1_Msk (0x1ul << EPWM_INTSTS0_CMPDIF1_Pos) /*!< EPWM_T::INTSTS0: CMPDIF1 Mask */ - -#define EPWM_INTSTS0_CMPDIF2_Pos (26) /*!< EPWM_T::INTSTS0: CMPDIF2 Position */ -#define EPWM_INTSTS0_CMPDIF2_Msk (0x1ul << EPWM_INTSTS0_CMPDIF2_Pos) /*!< EPWM_T::INTSTS0: CMPDIF2 Mask */ - -#define EPWM_INTSTS0_CMPDIF3_Pos (27) /*!< EPWM_T::INTSTS0: CMPDIF3 Position */ -#define EPWM_INTSTS0_CMPDIF3_Msk (0x1ul << EPWM_INTSTS0_CMPDIF3_Pos) /*!< EPWM_T::INTSTS0: CMPDIF3 Mask */ - -#define EPWM_INTSTS0_CMPDIF4_Pos (28) /*!< EPWM_T::INTSTS0: CMPDIF4 Position */ -#define EPWM_INTSTS0_CMPDIF4_Msk (0x1ul << EPWM_INTSTS0_CMPDIF4_Pos) /*!< EPWM_T::INTSTS0: CMPDIF4 Mask */ - -#define EPWM_INTSTS0_CMPDIF5_Pos (29) /*!< EPWM_T::INTSTS0: CMPDIF5 Position */ -#define EPWM_INTSTS0_CMPDIF5_Msk (0x1ul << EPWM_INTSTS0_CMPDIF5_Pos) /*!< EPWM_T::INTSTS0: CMPDIF5 Mask */ - -#define EPWM_INTSTS1_BRKEIF0_Pos (0) /*!< EPWM_T::INTSTS1: BRKEIF0 Position */ -#define EPWM_INTSTS1_BRKEIF0_Msk (0x1ul << EPWM_INTSTS1_BRKEIF0_Pos) /*!< EPWM_T::INTSTS1: BRKEIF0 Mask */ - -#define EPWM_INTSTS1_BRKEIF1_Pos (1) /*!< EPWM_T::INTSTS1: BRKEIF1 Position */ -#define EPWM_INTSTS1_BRKEIF1_Msk (0x1ul << EPWM_INTSTS1_BRKEIF1_Pos) /*!< EPWM_T::INTSTS1: BRKEIF1 Mask */ - -#define EPWM_INTSTS1_BRKEIF2_Pos (2) /*!< EPWM_T::INTSTS1: BRKEIF2 Position */ -#define EPWM_INTSTS1_BRKEIF2_Msk (0x1ul << EPWM_INTSTS1_BRKEIF2_Pos) /*!< EPWM_T::INTSTS1: BRKEIF2 Mask */ - -#define EPWM_INTSTS1_BRKEIF3_Pos (3) /*!< EPWM_T::INTSTS1: BRKEIF3 Position */ -#define EPWM_INTSTS1_BRKEIF3_Msk (0x1ul << EPWM_INTSTS1_BRKEIF3_Pos) /*!< EPWM_T::INTSTS1: BRKEIF3 Mask */ - -#define EPWM_INTSTS1_BRKEIF4_Pos (4) /*!< EPWM_T::INTSTS1: BRKEIF4 Position */ -#define EPWM_INTSTS1_BRKEIF4_Msk (0x1ul << EPWM_INTSTS1_BRKEIF4_Pos) /*!< EPWM_T::INTSTS1: BRKEIF4 Mask */ - -#define EPWM_INTSTS1_BRKEIF5_Pos (5) /*!< EPWM_T::INTSTS1: BRKEIF5 Position */ -#define EPWM_INTSTS1_BRKEIF5_Msk (0x1ul << EPWM_INTSTS1_BRKEIF5_Pos) /*!< EPWM_T::INTSTS1: BRKEIF5 Mask */ - -#define EPWM_INTSTS1_BRKLIF0_Pos (8) /*!< EPWM_T::INTSTS1: BRKLIF0 Position */ -#define EPWM_INTSTS1_BRKLIF0_Msk (0x1ul << EPWM_INTSTS1_BRKLIF0_Pos) /*!< EPWM_T::INTSTS1: BRKLIF0 Mask */ - -#define EPWM_INTSTS1_BRKLIF1_Pos (9) /*!< EPWM_T::INTSTS1: BRKLIF1 Position */ -#define EPWM_INTSTS1_BRKLIF1_Msk (0x1ul << EPWM_INTSTS1_BRKLIF1_Pos) /*!< EPWM_T::INTSTS1: BRKLIF1 Mask */ - -#define EPWM_INTSTS1_BRKLIF2_Pos (10) /*!< EPWM_T::INTSTS1: BRKLIF2 Position */ -#define EPWM_INTSTS1_BRKLIF2_Msk (0x1ul << EPWM_INTSTS1_BRKLIF2_Pos) /*!< EPWM_T::INTSTS1: BRKLIF2 Mask */ - -#define EPWM_INTSTS1_BRKLIF3_Pos (11) /*!< EPWM_T::INTSTS1: BRKLIF3 Position */ -#define EPWM_INTSTS1_BRKLIF3_Msk (0x1ul << EPWM_INTSTS1_BRKLIF3_Pos) /*!< EPWM_T::INTSTS1: BRKLIF3 Mask */ - -#define EPWM_INTSTS1_BRKLIF4_Pos (12) /*!< EPWM_T::INTSTS1: BRKLIF4 Position */ -#define EPWM_INTSTS1_BRKLIF4_Msk (0x1ul << EPWM_INTSTS1_BRKLIF4_Pos) /*!< EPWM_T::INTSTS1: BRKLIF4 Mask */ - -#define EPWM_INTSTS1_BRKLIF5_Pos (13) /*!< EPWM_T::INTSTS1: BRKLIF5 Position */ -#define EPWM_INTSTS1_BRKLIF5_Msk (0x1ul << EPWM_INTSTS1_BRKLIF5_Pos) /*!< EPWM_T::INTSTS1: BRKLIF5 Mask */ - -#define EPWM_INTSTS1_BRKESTS0_Pos (16) /*!< EPWM_T::INTSTS1: BRKESTS0 Position */ -#define EPWM_INTSTS1_BRKESTS0_Msk (0x1ul << EPWM_INTSTS1_BRKESTS0_Pos) /*!< EPWM_T::INTSTS1: BRKESTS0 Mask */ - -#define EPWM_INTSTS1_BRKESTS1_Pos (17) /*!< EPWM_T::INTSTS1: BRKESTS1 Position */ -#define EPWM_INTSTS1_BRKESTS1_Msk (0x1ul << EPWM_INTSTS1_BRKESTS1_Pos) /*!< EPWM_T::INTSTS1: BRKESTS1 Mask */ - -#define EPWM_INTSTS1_BRKESTS2_Pos (18) /*!< EPWM_T::INTSTS1: BRKESTS2 Position */ -#define EPWM_INTSTS1_BRKESTS2_Msk (0x1ul << EPWM_INTSTS1_BRKESTS2_Pos) /*!< EPWM_T::INTSTS1: BRKESTS2 Mask */ - -#define EPWM_INTSTS1_BRKESTS3_Pos (19) /*!< EPWM_T::INTSTS1: BRKESTS3 Position */ -#define EPWM_INTSTS1_BRKESTS3_Msk (0x1ul << EPWM_INTSTS1_BRKESTS3_Pos) /*!< EPWM_T::INTSTS1: BRKESTS3 Mask */ - -#define EPWM_INTSTS1_BRKESTS4_Pos (20) /*!< EPWM_T::INTSTS1: BRKESTS4 Position */ -#define EPWM_INTSTS1_BRKESTS4_Msk (0x1ul << EPWM_INTSTS1_BRKESTS4_Pos) /*!< EPWM_T::INTSTS1: BRKESTS4 Mask */ - -#define EPWM_INTSTS1_BRKESTS5_Pos (21) /*!< EPWM_T::INTSTS1: BRKESTS5 Position */ -#define EPWM_INTSTS1_BRKESTS5_Msk (0x1ul << EPWM_INTSTS1_BRKESTS5_Pos) /*!< EPWM_T::INTSTS1: BRKESTS5 Mask */ - -#define EPWM_INTSTS1_BRKLSTS0_Pos (24) /*!< EPWM_T::INTSTS1: BRKLSTS0 Position */ -#define EPWM_INTSTS1_BRKLSTS0_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS0_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS0 Mask */ - -#define EPWM_INTSTS1_BRKLSTS1_Pos (25) /*!< EPWM_T::INTSTS1: BRKLSTS1 Position */ -#define EPWM_INTSTS1_BRKLSTS1_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS1_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS1 Mask */ - -#define EPWM_INTSTS1_BRKLSTS2_Pos (26) /*!< EPWM_T::INTSTS1: BRKLSTS2 Position */ -#define EPWM_INTSTS1_BRKLSTS2_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS2_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS2 Mask */ - -#define EPWM_INTSTS1_BRKLSTS3_Pos (27) /*!< EPWM_T::INTSTS1: BRKLSTS3 Position */ -#define EPWM_INTSTS1_BRKLSTS3_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS3_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS3 Mask */ - -#define EPWM_INTSTS1_BRKLSTS4_Pos (28) /*!< EPWM_T::INTSTS1: BRKLSTS4 Position */ -#define EPWM_INTSTS1_BRKLSTS4_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS4_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS4 Mask */ - -#define EPWM_INTSTS1_BRKLSTS5_Pos (29) /*!< EPWM_T::INTSTS1: BRKLSTS5 Position */ -#define EPWM_INTSTS1_BRKLSTS5_Msk (0x1ul << EPWM_INTSTS1_BRKLSTS5_Pos) /*!< EPWM_T::INTSTS1: BRKLSTS5 Mask */ - -#define EPWM_EADCTS0_TRGSEL0_Pos (0) /*!< EPWM_T::EADCTS0: TRGSEL0 Position */ -#define EPWM_EADCTS0_TRGSEL0_Msk (0xful << EPWM_EADCTS0_TRGSEL0_Pos) /*!< EPWM_T::EADCTS0: TRGSEL0 Mask */ - -#define EPWM_EADCTS0_TRGEN0_Pos (7) /*!< EPWM_T::EADCTS0: TRGEN0 Position */ -#define EPWM_EADCTS0_TRGEN0_Msk (0x1ul << EPWM_EADCTS0_TRGEN0_Pos) /*!< EPWM_T::EADCTS0: TRGEN0 Mask */ - -#define EPWM_EADCTS0_TRGSEL1_Pos (8) /*!< EPWM_T::EADCTS0: TRGSEL1 Position */ -#define EPWM_EADCTS0_TRGSEL1_Msk (0xful << EPWM_EADCTS0_TRGSEL1_Pos) /*!< EPWM_T::EADCTS0: TRGSEL1 Mask */ - -#define EPWM_EADCTS0_TRGEN1_Pos (15) /*!< EPWM_T::EADCTS0: TRGEN1 Position */ -#define EPWM_EADCTS0_TRGEN1_Msk (0x1ul << EPWM_EADCTS0_TRGEN1_Pos) /*!< EPWM_T::EADCTS0: TRGEN1 Mask */ - -#define EPWM_EADCTS0_TRGSEL2_Pos (16) /*!< EPWM_T::EADCTS0: TRGSEL2 Position */ -#define EPWM_EADCTS0_TRGSEL2_Msk (0xful << EPWM_EADCTS0_TRGSEL2_Pos) /*!< EPWM_T::EADCTS0: TRGSEL2 Mask */ - -#define EPWM_EADCTS0_TRGEN2_Pos (23) /*!< EPWM_T::EADCTS0: TRGEN2 Position */ -#define EPWM_EADCTS0_TRGEN2_Msk (0x1ul << EPWM_EADCTS0_TRGEN2_Pos) /*!< EPWM_T::EADCTS0: TRGEN2 Mask */ - -#define EPWM_EADCTS0_TRGSEL3_Pos (24) /*!< EPWM_T::EADCTS0: TRGSEL3 Position */ -#define EPWM_EADCTS0_TRGSEL3_Msk (0xful << EPWM_EADCTS0_TRGSEL3_Pos) /*!< EPWM_T::EADCTS0: TRGSEL3 Mask */ - -#define EPWM_EADCTS0_TRGEN3_Pos (31) /*!< EPWM_T::EADCTS0: TRGEN3 Position */ -#define EPWM_EADCTS0_TRGEN3_Msk (0x1ul << EPWM_EADCTS0_TRGEN3_Pos) /*!< EPWM_T::EADCTS0: TRGEN3 Mask */ - -#define EPWM_EADCTS1_TRGSEL4_Pos (0) /*!< EPWM_T::EADCTS1: TRGSEL4 Position */ -#define EPWM_EADCTS1_TRGSEL4_Msk (0xful << EPWM_EADCTS1_TRGSEL4_Pos) /*!< EPWM_T::EADCTS1: TRGSEL4 Mask */ - -#define EPWM_EADCTS1_TRGEN4_Pos (7) /*!< EPWM_T::EADCTS1: TRGEN4 Position */ -#define EPWM_EADCTS1_TRGEN4_Msk (0x1ul << EPWM_EADCTS1_TRGEN4_Pos) /*!< EPWM_T::EADCTS1: TRGEN4 Mask */ - -#define EPWM_EADCTS1_TRGSEL5_Pos (8) /*!< EPWM_T::EADCTS1: TRGSEL5 Position */ -#define EPWM_EADCTS1_TRGSEL5_Msk (0xful << EPWM_EADCTS1_TRGSEL5_Pos) /*!< EPWM_T::EADCTS1: TRGSEL5 Mask */ - -#define EPWM_EADCTS1_TRGEN5_Pos (15) /*!< EPWM_T::EADCTS1: TRGEN5 Position */ -#define EPWM_EADCTS1_TRGEN5_Msk (0x1ul << EPWM_EADCTS1_TRGEN5_Pos) /*!< EPWM_T::EADCTS1: TRGEN5 Mask */ - -#define EPWM_FTCMPDAT0_1_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Position */ -#define EPWM_FTCMPDAT0_1_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT0_1_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT0_1: FTCMP Mask */ - -#define EPWM_FTCMPDAT2_3_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Position */ -#define EPWM_FTCMPDAT2_3_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT2_3_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT2_3: FTCMP Mask */ - -#define EPWM_FTCMPDAT4_5_FTCMP_Pos (0) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Position */ -#define EPWM_FTCMPDAT4_5_FTCMP_Msk (0xfffful << EPWM_FTCMPDAT4_5_FTCMP_Pos) /*!< EPWM_T::FTCMPDAT4_5: FTCMP Mask */ - -#define EPWM_SSCTL_SSEN0_Pos (0) /*!< EPWM_T::SSCTL: SSEN0 Position */ -#define EPWM_SSCTL_SSEN0_Msk (0x1ul << EPWM_SSCTL_SSEN0_Pos) /*!< EPWM_T::SSCTL: SSEN0 Mask */ - -#define EPWM_SSCTL_SSEN1_Pos (1) /*!< EPWM_T::SSCTL: SSEN1 Position */ -#define EPWM_SSCTL_SSEN1_Msk (0x1ul << EPWM_SSCTL_SSEN1_Pos) /*!< EPWM_T::SSCTL: SSEN1 Mask */ - -#define EPWM_SSCTL_SSEN2_Pos (2) /*!< EPWM_T::SSCTL: SSEN2 Position */ -#define EPWM_SSCTL_SSEN2_Msk (0x1ul << EPWM_SSCTL_SSEN2_Pos) /*!< EPWM_T::SSCTL: SSEN2 Mask */ - -#define EPWM_SSCTL_SSEN3_Pos (3) /*!< EPWM_T::SSCTL: SSEN3 Position */ -#define EPWM_SSCTL_SSEN3_Msk (0x1ul << EPWM_SSCTL_SSEN3_Pos) /*!< EPWM_T::SSCTL: SSEN3 Mask */ - -#define EPWM_SSCTL_SSEN4_Pos (4) /*!< EPWM_T::SSCTL: SSEN4 Position */ -#define EPWM_SSCTL_SSEN4_Msk (0x1ul << EPWM_SSCTL_SSEN4_Pos) /*!< EPWM_T::SSCTL: SSEN4 Mask */ - -#define EPWM_SSCTL_SSEN5_Pos (5) /*!< EPWM_T::SSCTL: SSEN5 Position */ -#define EPWM_SSCTL_SSEN5_Msk (0x1ul << EPWM_SSCTL_SSEN5_Pos) /*!< EPWM_T::SSCTL: SSEN5 Mask */ - -#define EPWM_SSCTL_SSRC_Pos (8) /*!< EPWM_T::SSCTL: SSRC Position */ -#define EPWM_SSCTL_SSRC_Msk (0x3ul << EPWM_SSCTL_SSRC_Pos) /*!< EPWM_T::SSCTL: SSRC Mask */ - -#define EPWM_SSTRG_CNTSEN_Pos (0) /*!< EPWM_T::SSTRG: CNTSEN Position */ -#define EPWM_SSTRG_CNTSEN_Msk (0x1ul << EPWM_SSTRG_CNTSEN_Pos) /*!< EPWM_T::SSTRG: CNTSEN Mask */ - -#define EPWM_LEBCTL_LEBEN_Pos (0) /*!< EPWM_T::LEBCTL: LEBEN Position */ -#define EPWM_LEBCTL_LEBEN_Msk (0x1ul << EPWM_LEBCTL_LEBEN_Pos) /*!< EPWM_T::LEBCTL: LEBEN Mask */ - -#define EPWM_LEBCTL_SRCEN0_Pos (8) /*!< EPWM_T::LEBCTL: SRCEN0 Position */ -#define EPWM_LEBCTL_SRCEN0_Msk (0x1ul << EPWM_LEBCTL_SRCEN0_Pos) /*!< EPWM_T::LEBCTL: SRCEN0 Mask */ - -#define EPWM_LEBCTL_SRCEN2_Pos (9) /*!< EPWM_T::LEBCTL: SRCEN2 Position */ -#define EPWM_LEBCTL_SRCEN2_Msk (0x1ul << EPWM_LEBCTL_SRCEN2_Pos) /*!< EPWM_T::LEBCTL: SRCEN2 Mask */ - -#define EPWM_LEBCTL_SRCEN4_Pos (10) /*!< EPWM_T::LEBCTL: SRCEN4 Position */ -#define EPWM_LEBCTL_SRCEN4_Msk (0x1ul << EPWM_LEBCTL_SRCEN4_Pos) /*!< EPWM_T::LEBCTL: SRCEN4 Mask */ - -#define EPWM_LEBCTL_TRGTYPE_Pos (16) /*!< EPWM_T::LEBCTL: TRGTYPE Position */ -#define EPWM_LEBCTL_TRGTYPE_Msk (0x3ul << EPWM_LEBCTL_TRGTYPE_Pos) /*!< EPWM_T::LEBCTL: TRGTYPE Mask */ - -#define EPWM_LEBCNT_LEBCNT_Pos (0) /*!< EPWM_T::LEBCNT: LEBCNT Position */ -#define EPWM_LEBCNT_LEBCNT_Msk (0x1fful << EPWM_LEBCNT_LEBCNT_Pos) /*!< EPWM_T::LEBCNT: LEBCNT Mask */ - -#define EPWM_STATUS_CNTMAXF0_Pos (0) /*!< EPWM_T::STATUS: CNTMAXF0 Position */ -#define EPWM_STATUS_CNTMAXF0_Msk (0x1ul << EPWM_STATUS_CNTMAXF0_Pos) /*!< EPWM_T::STATUS: CNTMAXF0 Mask */ - -#define EPWM_STATUS_CNTMAXF1_Pos (1) /*!< EPWM_T::STATUS: CNTMAXF1 Position */ -#define EPWM_STATUS_CNTMAXF1_Msk (0x1ul << EPWM_STATUS_CNTMAXF1_Pos) /*!< EPWM_T::STATUS: CNTMAXF1 Mask */ - -#define EPWM_STATUS_CNTMAXF2_Pos (2) /*!< EPWM_T::STATUS: CNTMAXF2 Position */ -#define EPWM_STATUS_CNTMAXF2_Msk (0x1ul << EPWM_STATUS_CNTMAXF2_Pos) /*!< EPWM_T::STATUS: CNTMAXF2 Mask */ - -#define EPWM_STATUS_CNTMAXF3_Pos (3) /*!< EPWM_T::STATUS: CNTMAXF3 Position */ -#define EPWM_STATUS_CNTMAXF3_Msk (0x1ul << EPWM_STATUS_CNTMAXF3_Pos) /*!< EPWM_T::STATUS: CNTMAXF3 Mask */ - -#define EPWM_STATUS_CNTMAXF4_Pos (4) /*!< EPWM_T::STATUS: CNTMAXF4 Position */ -#define EPWM_STATUS_CNTMAXF4_Msk (0x1ul << EPWM_STATUS_CNTMAXF4_Pos) /*!< EPWM_T::STATUS: CNTMAXF4 Mask */ - -#define EPWM_STATUS_CNTMAXF5_Pos (5) /*!< EPWM_T::STATUS: CNTMAXF5 Position */ -#define EPWM_STATUS_CNTMAXF5_Msk (0x1ul << EPWM_STATUS_CNTMAXF5_Pos) /*!< EPWM_T::STATUS: CNTMAXF5 Mask */ - -#define EPWM_STATUS_SYNCINF0_Pos (8) /*!< EPWM_T::STATUS: SYNCINF0 Position */ -#define EPWM_STATUS_SYNCINF0_Msk (0x1ul << EPWM_STATUS_SYNCINF0_Pos) /*!< EPWM_T::STATUS: SYNCINF0 Mask */ - -#define EPWM_STATUS_SYNCINF2_Pos (9) /*!< EPWM_T::STATUS: SYNCINF2 Position */ -#define EPWM_STATUS_SYNCINF2_Msk (0x1ul << EPWM_STATUS_SYNCINF2_Pos) /*!< EPWM_T::STATUS: SYNCINF2 Mask */ - -#define EPWM_STATUS_SYNCINF4_Pos (10) /*!< EPWM_T::STATUS: SYNCINF4 Position */ -#define EPWM_STATUS_SYNCINF4_Msk (0x1ul << EPWM_STATUS_SYNCINF4_Pos) /*!< EPWM_T::STATUS: SYNCINF4 Mask */ - -#define EPWM_STATUS_EADCTRGF0_Pos (16) /*!< EPWM_T::STATUS: EADCTRGF0 Position */ -#define EPWM_STATUS_EADCTRGF0_Msk (0x1ul << EPWM_STATUS_EADCTRGF0_Pos) /*!< EPWM_T::STATUS: EADCTRGF0 Mask */ - -#define EPWM_STATUS_EADCTRGF1_Pos (17) /*!< EPWM_T::STATUS: EADCTRGF1 Position */ -#define EPWM_STATUS_EADCTRGF1_Msk (0x1ul << EPWM_STATUS_EADCTRGF1_Pos) /*!< EPWM_T::STATUS: EADCTRGF1 Mask */ - -#define EPWM_STATUS_EADCTRGF2_Pos (18) /*!< EPWM_T::STATUS: EADCTRGF2 Position */ -#define EPWM_STATUS_EADCTRGF2_Msk (0x1ul << EPWM_STATUS_EADCTRGF2_Pos) /*!< EPWM_T::STATUS: EADCTRGF2 Mask */ - -#define EPWM_STATUS_EADCTRGF3_Pos (19) /*!< EPWM_T::STATUS: EADCTRGF3 Position */ -#define EPWM_STATUS_EADCTRGF3_Msk (0x1ul << EPWM_STATUS_EADCTRGF3_Pos) /*!< EPWM_T::STATUS: EADCTRGF3 Mask */ - -#define EPWM_STATUS_EADCTRGF4_Pos (20) /*!< EPWM_T::STATUS: EADCTRGF4 Position */ -#define EPWM_STATUS_EADCTRGF4_Msk (0x1ul << EPWM_STATUS_EADCTRGF4_Pos) /*!< EPWM_T::STATUS: EADCTRGF4 Mask */ - -#define EPWM_STATUS_EADCTRGF5_Pos (21) /*!< EPWM_T::STATUS: EADCTRGF5 Position */ -#define EPWM_STATUS_EADCTRGF5_Msk (0x1ul << EPWM_STATUS_EADCTRGF5_Pos) /*!< EPWM_T::STATUS: EADCTRGF5 Mask */ - -#define EPWM_IFA0_IFACNT_Pos (0) /*!< EPWM_T::IFA0: IFACNT Position */ -#define EPWM_IFA0_IFACNT_Msk (0xfffful << EPWM_IFA0_IFACNT_Pos) /*!< EPWM_T::IFA0: IFACNT Mask */ - -#define EPWM_IFA0_STPMOD_Pos (24) /*!< EPWM_T::IFA0: STPMOD Position */ -#define EPWM_IFA0_STPMOD_Msk (0x1ul << EPWM_IFA0_STPMOD_Pos) /*!< EPWM_T::IFA0: STPMOD Mask */ - -#define EPWM_IFA0_IFASEL_Pos (28) /*!< EPWM_T::IFA0: IFASEL Position */ -#define EPWM_IFA0_IFASEL_Msk (0x3ul << EPWM_IFA0_IFASEL_Pos) /*!< EPWM_T::IFA0: IFASEL Mask */ - -#define EPWM_IFA0_IFAEN_Pos (31) /*!< EPWM_T::IFA0: IFAEN Position */ -#define EPWM_IFA0_IFAEN_Msk (0x1ul << EPWM_IFA0_IFAEN_Pos) /*!< EPWM_T::IFA0: IFAEN Mask */ - -#define EPWM_IFA1_IFACNT_Pos (0) /*!< EPWM_T::IFA1: IFACNT Position */ -#define EPWM_IFA1_IFACNT_Msk (0xfffful << EPWM_IFA1_IFACNT_Pos) /*!< EPWM_T::IFA1: IFACNT Mask */ - -#define EPWM_IFA1_STPMOD_Pos (24) /*!< EPWM_T::IFA1: STPMOD Position */ -#define EPWM_IFA1_STPMOD_Msk (0x1ul << EPWM_IFA1_STPMOD_Pos) /*!< EPWM_T::IFA1: STPMOD Mask */ - -#define EPWM_IFA1_IFASEL_Pos (28) /*!< EPWM_T::IFA1: IFASEL Position */ -#define EPWM_IFA1_IFASEL_Msk (0x3ul << EPWM_IFA1_IFASEL_Pos) /*!< EPWM_T::IFA1: IFASEL Mask */ - -#define EPWM_IFA1_IFAEN_Pos (31) /*!< EPWM_T::IFA1: IFAEN Position */ -#define EPWM_IFA1_IFAEN_Msk (0x1ul << EPWM_IFA1_IFAEN_Pos) /*!< EPWM_T::IFA1: IFAEN Mask */ - -#define EPWM_IFA2_IFACNT_Pos (0) /*!< EPWM_T::IFA2: IFACNT Position */ -#define EPWM_IFA2_IFACNT_Msk (0xfffful << EPWM_IFA2_IFACNT_Pos) /*!< EPWM_T::IFA2: IFACNT Mask */ - -#define EPWM_IFA2_STPMOD_Pos (24) /*!< EPWM_T::IFA2: STPMOD Position */ -#define EPWM_IFA2_STPMOD_Msk (0x1ul << EPWM_IFA2_STPMOD_Pos) /*!< EPWM_T::IFA2: STPMOD Mask */ - -#define EPWM_IFA2_IFASEL_Pos (28) /*!< EPWM_T::IFA2: IFASEL Position */ -#define EPWM_IFA2_IFASEL_Msk (0x3ul << EPWM_IFA2_IFASEL_Pos) /*!< EPWM_T::IFA2: IFASEL Mask */ - -#define EPWM_IFA2_IFAEN_Pos (31) /*!< EPWM_T::IFA2: IFAEN Position */ -#define EPWM_IFA2_IFAEN_Msk (0x1ul << EPWM_IFA2_IFAEN_Pos) /*!< EPWM_T::IFA2: IFAEN Mask */ - -#define EPWM_IFA3_IFACNT_Pos (0) /*!< EPWM_T::IFA3: IFACNT Position */ -#define EPWM_IFA3_IFACNT_Msk (0xfffful << EPWM_IFA3_IFACNT_Pos) /*!< EPWM_T::IFA3: IFACNT Mask */ - -#define EPWM_IFA3_STPMOD_Pos (24) /*!< EPWM_T::IFA3: STPMOD Position */ -#define EPWM_IFA3_STPMOD_Msk (0x1ul << EPWM_IFA3_STPMOD_Pos) /*!< EPWM_T::IFA3: STPMOD Mask */ - -#define EPWM_IFA3_IFASEL_Pos (28) /*!< EPWM_T::IFA3: IFASEL Position */ -#define EPWM_IFA3_IFASEL_Msk (0x3ul << EPWM_IFA3_IFASEL_Pos) /*!< EPWM_T::IFA3: IFASEL Mask */ - -#define EPWM_IFA3_IFAEN_Pos (31) /*!< EPWM_T::IFA3: IFAEN Position */ -#define EPWM_IFA3_IFAEN_Msk (0x1ul << EPWM_IFA3_IFAEN_Pos) /*!< EPWM_T::IFA3: IFAEN Mask */ - -#define EPWM_IFA4_IFACNT_Pos (0) /*!< EPWM_T::IFA4: IFACNT Position */ -#define EPWM_IFA4_IFACNT_Msk (0xfffful << EPWM_IFA4_IFACNT_Pos) /*!< EPWM_T::IFA4: IFACNT Mask */ - -#define EPWM_IFA4_STPMOD_Pos (24) /*!< EPWM_T::IFA4: STPMOD Position */ -#define EPWM_IFA4_STPMOD_Msk (0x1ul << EPWM_IFA4_STPMOD_Pos) /*!< EPWM_T::IFA4: STPMOD Mask */ - -#define EPWM_IFA4_IFASEL_Pos (28) /*!< EPWM_T::IFA4: IFASEL Position */ -#define EPWM_IFA4_IFASEL_Msk (0x3ul << EPWM_IFA4_IFASEL_Pos) /*!< EPWM_T::IFA4: IFASEL Mask */ - -#define EPWM_IFA4_IFAEN_Pos (31) /*!< EPWM_T::IFA4: IFAEN Position */ -#define EPWM_IFA4_IFAEN_Msk (0x1ul << EPWM_IFA4_IFAEN_Pos) /*!< EPWM_T::IFA4: IFAEN Mask */ - -#define EPWM_IFA5_IFACNT_Pos (0) /*!< EPWM_T::IFA5: IFACNT Position */ -#define EPWM_IFA5_IFACNT_Msk (0xfffful << EPWM_IFA5_IFACNT_Pos) /*!< EPWM_T::IFA5: IFACNT Mask */ - -#define EPWM_IFA5_STPMOD_Pos (24) /*!< EPWM_T::IFA5: STPMOD Position */ -#define EPWM_IFA5_STPMOD_Msk (0x1ul << EPWM_IFA5_STPMOD_Pos) /*!< EPWM_T::IFA5: STPMOD Mask */ - -#define EPWM_IFA5_IFASEL_Pos (28) /*!< EPWM_T::IFA5: IFASEL Position */ -#define EPWM_IFA5_IFASEL_Msk (0x3ul << EPWM_IFA5_IFASEL_Pos) /*!< EPWM_T::IFA5: IFASEL Mask */ - -#define EPWM_IFA5_IFAEN_Pos (31) /*!< EPWM_T::IFA5: IFAEN Position */ -#define EPWM_IFA5_IFAEN_Msk (0x1ul << EPWM_IFA5_IFAEN_Pos) /*!< EPWM_T::IFA5: IFAEN Mask */ - -#define EPWM_AINTSTS_IFAIF0_Pos (0) /*!< EPWM_T::AINTSTS: IFAIF0 Position */ -#define EPWM_AINTSTS_IFAIF0_Msk (0x1ul << EPWM_AINTSTS_IFAIF0_Pos) /*!< EPWM_T::AINTSTS: IFAIF0 Mask */ - -#define EPWM_AINTSTS_IFAIF1_Pos (1) /*!< EPWM_T::AINTSTS: IFAIF1 Position */ -#define EPWM_AINTSTS_IFAIF1_Msk (0x1ul << EPWM_AINTSTS_IFAIF1_Pos) /*!< EPWM_T::AINTSTS: IFAIF1 Mask */ - -#define EPWM_AINTSTS_IFAIF2_Pos (2) /*!< EPWM_T::AINTSTS: IFAIF2 Position */ -#define EPWM_AINTSTS_IFAIF2_Msk (0x1ul << EPWM_AINTSTS_IFAIF2_Pos) /*!< EPWM_T::AINTSTS: IFAIF2 Mask */ - -#define EPWM_AINTSTS_IFAIF3_Pos (3) /*!< EPWM_T::AINTSTS: IFAIF3 Position */ -#define EPWM_AINTSTS_IFAIF3_Msk (0x1ul << EPWM_AINTSTS_IFAIF3_Pos) /*!< EPWM_T::AINTSTS: IFAIF3 Mask */ - -#define EPWM_AINTSTS_IFAIF4_Pos (4) /*!< EPWM_T::AINTSTS: IFAIF4 Position */ -#define EPWM_AINTSTS_IFAIF4_Msk (0x1ul << EPWM_AINTSTS_IFAIF4_Pos) /*!< EPWM_T::AINTSTS: IFAIF4 Mask */ - -#define EPWM_AINTSTS_IFAIF5_Pos (5) /*!< EPWM_T::AINTSTS: IFAIF5 Position */ -#define EPWM_AINTSTS_IFAIF5_Msk (0x1ul << EPWM_AINTSTS_IFAIF5_Pos) /*!< EPWM_T::AINTSTS: IFAIF5 Mask */ - -#define EPWM_AINTEN_IFAIEN0_Pos (0) /*!< EPWM_T::AINTEN: IFAIEN0 Position */ -#define EPWM_AINTEN_IFAIEN0_Msk (0x1ul << EPWM_AINTEN_IFAIEN0_Pos) /*!< EPWM_T::AINTEN: IFAIEN0 Mask */ - -#define EPWM_AINTEN_IFAIEN1_Pos (1) /*!< EPWM_T::AINTEN: IFAIEN1 Position */ -#define EPWM_AINTEN_IFAIEN1_Msk (0x1ul << EPWM_AINTEN_IFAIEN1_Pos) /*!< EPWM_T::AINTEN: IFAIEN1 Mask */ - -#define EPWM_AINTEN_IFAIEN2_Pos (2) /*!< EPWM_T::AINTEN: IFAIEN2 Position */ -#define EPWM_AINTEN_IFAIEN2_Msk (0x1ul << EPWM_AINTEN_IFAIEN2_Pos) /*!< EPWM_T::AINTEN: IFAIEN2 Mask */ - -#define EPWM_AINTEN_IFAIEN3_Pos (3) /*!< EPWM_T::AINTEN: IFAIEN3 Position */ -#define EPWM_AINTEN_IFAIEN3_Msk (0x1ul << EPWM_AINTEN_IFAIEN3_Pos) /*!< EPWM_T::AINTEN: IFAIEN3 Mask */ - -#define EPWM_AINTEN_IFAIEN4_Pos (4) /*!< EPWM_T::AINTEN: IFAIEN4 Position */ -#define EPWM_AINTEN_IFAIEN4_Msk (0x1ul << EPWM_AINTEN_IFAIEN4_Pos) /*!< EPWM_T::AINTEN: IFAIEN4 Mask */ - -#define EPWM_AINTEN_IFAIEN5_Pos (5) /*!< EPWM_T::AINTEN: IFAIEN5 Position */ -#define EPWM_AINTEN_IFAIEN5_Msk (0x1ul << EPWM_AINTEN_IFAIEN5_Pos) /*!< EPWM_T::AINTEN: IFAIEN5 Mask */ - -#define EPWM_APDMACTL_APDMAEN0_Pos (0) /*!< EPWM_T::APDMACTL: APDMAEN0 Position */ -#define EPWM_APDMACTL_APDMAEN0_Msk (0x1ul << EPWM_APDMACTL_APDMAEN0_Pos) /*!< EPWM_T::APDMACTL: APDMAEN0 Mask */ - -#define EPWM_APDMACTL_APDMAEN1_Pos (1) /*!< EPWM_T::APDMACTL: APDMAEN1 Position */ -#define EPWM_APDMACTL_APDMAEN1_Msk (0x1ul << EPWM_APDMACTL_APDMAEN1_Pos) /*!< EPWM_T::APDMACTL: APDMAEN1 Mask */ - -#define EPWM_APDMACTL_APDMAEN2_Pos (2) /*!< EPWM_T::APDMACTL: APDMAEN2 Position */ -#define EPWM_APDMACTL_APDMAEN2_Msk (0x1ul << EPWM_APDMACTL_APDMAEN2_Pos) /*!< EPWM_T::APDMACTL: APDMAEN2 Mask */ - -#define EPWM_APDMACTL_APDMAEN3_Pos (3) /*!< EPWM_T::APDMACTL: APDMAEN3 Position */ -#define EPWM_APDMACTL_APDMAEN3_Msk (0x1ul << EPWM_APDMACTL_APDMAEN3_Pos) /*!< EPWM_T::APDMACTL: APDMAEN3 Mask */ - -#define EPWM_APDMACTL_APDMAEN4_Pos (4) /*!< EPWM_T::APDMACTL: APDMAEN4 Position */ -#define EPWM_APDMACTL_APDMAEN4_Msk (0x1ul << EPWM_APDMACTL_APDMAEN4_Pos) /*!< EPWM_T::APDMACTL: APDMAEN4 Mask */ - -#define EPWM_APDMACTL_APDMAEN5_Pos (5) /*!< EPWM_T::APDMACTL: APDMAEN5 Position */ -#define EPWM_APDMACTL_APDMAEN5_Msk (0x1ul << EPWM_APDMACTL_APDMAEN5_Pos) /*!< EPWM_T::APDMACTL: APDMAEN5 Mask */ - -#define EPWM_FDEN_FDEN0_Pos (0) /*!< EPWM_T::FDEN: FDEN0 Position */ -#define EPWM_FDEN_FDEN0_Msk (0x1ul << EPWM_FDEN_FDEN0_Pos) /*!< EPWM_T::FDEN: FDEN0 Mask */ - -#define EPWM_FDEN_FDEN1_Pos (1) /*!< EPWM_T::FDEN: FDEN1 Position */ -#define EPWM_FDEN_FDEN1_Msk (0x1ul << EPWM_FDEN_FDEN1_Pos) /*!< EPWM_T::FDEN: FDEN1 Mask */ - -#define EPWM_FDEN_FDEN2_Pos (2) /*!< EPWM_T::FDEN: FDEN2 Position */ -#define EPWM_FDEN_FDEN2_Msk (0x1ul << EPWM_FDEN_FDEN2_Pos) /*!< EPWM_T::FDEN: FDEN2 Mask */ - -#define EPWM_FDEN_FDEN3_Pos (3) /*!< EPWM_T::FDEN: FDEN3 Position */ -#define EPWM_FDEN_FDEN3_Msk (0x1ul << EPWM_FDEN_FDEN3_Pos) /*!< EPWM_T::FDEN: FDEN3 Mask */ - -#define EPWM_FDEN_FDEN4_Pos (4) /*!< EPWM_T::FDEN: FDEN4 Position */ -#define EPWM_FDEN_FDEN4_Msk (0x1ul << EPWM_FDEN_FDEN4_Pos) /*!< EPWM_T::FDEN: FDEN4 Mask */ - -#define EPWM_FDEN_FDEN5_Pos (5) /*!< EPWM_T::FDEN: FDEN5 Position */ -#define EPWM_FDEN_FDEN5_Msk (0x1ul << EPWM_FDEN_FDEN5_Pos) /*!< EPWM_T::FDEN: FDEN5 Mask */ - -#define EPWM_FDEN_FDODIS0_Pos (8) /*!< EPWM_T::FDEN: FDODIS0 Position */ -#define EPWM_FDEN_FDODIS0_Msk (0x1ul << EPWM_FDEN_FDODIS0_Pos) /*!< EPWM_T::FDEN: FDODIS0 Mask */ - -#define EPWM_FDEN_FDODIS1_Pos (9) /*!< EPWM_T::FDEN: FDODIS1 Position */ -#define EPWM_FDEN_FDODIS1_Msk (0x1ul << EPWM_FDEN_FDODIS1_Pos) /*!< EPWM_T::FDEN: FDODIS1 Mask */ - -#define EPWM_FDEN_FDODIS2_Pos (10) /*!< EPWM_T::FDEN: FDODIS2 Position */ -#define EPWM_FDEN_FDODIS2_Msk (0x1ul << EPWM_FDEN_FDODIS2_Pos) /*!< EPWM_T::FDEN: FDODIS2 Mask */ - -#define EPWM_FDEN_FDODIS3_Pos (11) /*!< EPWM_T::FDEN: FDODIS3 Position */ -#define EPWM_FDEN_FDODIS3_Msk (0x1ul << EPWM_FDEN_FDODIS3_Pos) /*!< EPWM_T::FDEN: FDODIS3 Mask */ - -#define EPWM_FDEN_FDODIS4_Pos (12) /*!< EPWM_T::FDEN: FDODIS4 Position */ -#define EPWM_FDEN_FDODIS4_Msk (0x1ul << EPWM_FDEN_FDODIS4_Pos) /*!< EPWM_T::FDEN: FDODIS4 Mask */ - -#define EPWM_FDEN_FDODIS5_Pos (13) /*!< EPWM_T::FDEN: FDODIS5 Position */ -#define EPWM_FDEN_FDODIS5_Msk (0x1ul << EPWM_FDEN_FDODIS5_Pos) /*!< EPWM_T::FDEN: FDODIS5 Mask */ - -#define EPWM_FDEN_FDCKS0_Pos (16) /*!< EPWM_T::FDEN: FDCKS0 Position */ -#define EPWM_FDEN_FDCKS0_Msk (0x1ul << EPWM_FDEN_FDCKS0_Pos) /*!< EPWM_T::FDEN: FDCKS0 Mask */ - -#define EPWM_FDEN_FDCKS1_Pos (17) /*!< EPWM_T::FDEN: FDCKS1 Position */ -#define EPWM_FDEN_FDCKS1_Msk (0x1ul << EPWM_FDEN_FDCKS1_Pos) /*!< EPWM_T::FDEN: FDCKS1 Mask */ - -#define EPWM_FDEN_FDCKS2_Pos (18) /*!< EPWM_T::FDEN: FDCKS2 Position */ -#define EPWM_FDEN_FDCKS2_Msk (0x1ul << EPWM_FDEN_FDCKS2_Pos) /*!< EPWM_T::FDEN: FDCKS2 Mask */ - -#define EPWM_FDEN_FDCKS3_Pos (19) /*!< EPWM_T::FDEN: FDCKS3 Position */ -#define EPWM_FDEN_FDCKS3_Msk (0x1ul << EPWM_FDEN_FDCKS3_Pos) /*!< EPWM_T::FDEN: FDCKS3 Mask */ - -#define EPWM_FDEN_FDCKS4_Pos (20) /*!< EPWM_T::FDEN: FDCKS4 Position */ -#define EPWM_FDEN_FDCKS4_Msk (0x1ul << EPWM_FDEN_FDCKS4_Pos) /*!< EPWM_T::FDEN: FDCKS4 Mask */ - -#define EPWM_FDEN_FDCKS5_Pos (21) /*!< EPWM_T::FDEN: FDCKS5 Position */ -#define EPWM_FDEN_FDCKS5_Msk (0x1ul << EPWM_FDEN_FDCKS5_Pos) /*!< EPWM_T::FDEN: FDCKS5 Mask */ - -#define EPWM_FDCTL0_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL0: TRMSKCNT Position */ -#define EPWM_FDCTL0_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL0_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL0: TRMSKCNT Mask */ - -#define EPWM_FDCTL0_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL0: FDMSKEN Position */ -#define EPWM_FDCTL0_FDMSKEN_Msk (0x1ul << EPWM_FDCTL0_FDMSKEN_Pos) /*!< EPWM_T::FDCTL0: FDMSKEN Mask */ - -#define EPWM_FDCTL0_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL0: DGSMPCYC Position */ -#define EPWM_FDCTL0_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL0_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL0: DGSMPCYC Mask */ - -#define EPWM_FDCTL0_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL0: FDCKSEL Position */ -#define EPWM_FDCTL0_FDCKSEL_Msk (0x3ul << EPWM_FDCTL0_FDCKSEL_Pos) /*!< EPWM_T::FDCTL0: FDCKSEL Mask */ - -#define EPWM_FDCTL0_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL0: FDDGEN Position */ -#define EPWM_FDCTL0_FDDGEN_Msk (0x1ul << EPWM_FDCTL0_FDDGEN_Pos) /*!< EPWM_T::FDCTL0: FDDGEN Mask */ - -#define EPWM_FDCTL1_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL1: TRMSKCNT Position */ -#define EPWM_FDCTL1_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL1_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL1: TRMSKCNT Mask */ - -#define EPWM_FDCTL1_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL1: FDMSKEN Position */ -#define EPWM_FDCTL1_FDMSKEN_Msk (0x1ul << EPWM_FDCTL1_FDMSKEN_Pos) /*!< EPWM_T::FDCTL1: FDMSKEN Mask */ - -#define EPWM_FDCTL1_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL1: DGSMPCYC Position */ -#define EPWM_FDCTL1_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL1_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL1: DGSMPCYC Mask */ - -#define EPWM_FDCTL1_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL1: FDCKSEL Position */ -#define EPWM_FDCTL1_FDCKSEL_Msk (0x3ul << EPWM_FDCTL1_FDCKSEL_Pos) /*!< EPWM_T::FDCTL1: FDCKSEL Mask */ - -#define EPWM_FDCTL1_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL1: FDDGEN Position */ -#define EPWM_FDCTL1_FDDGEN_Msk (0x1ul << EPWM_FDCTL1_FDDGEN_Pos) /*!< EPWM_T::FDCTL1: FDDGEN Mask */ - -#define EPWM_FDCTL2_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL2: TRMSKCNT Position */ -#define EPWM_FDCTL2_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL2_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL2: TRMSKCNT Mask */ - -#define EPWM_FDCTL2_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL2: FDMSKEN Position */ -#define EPWM_FDCTL2_FDMSKEN_Msk (0x1ul << EPWM_FDCTL2_FDMSKEN_Pos) /*!< EPWM_T::FDCTL2: FDMSKEN Mask */ - -#define EPWM_FDCTL2_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL2: DGSMPCYC Position */ -#define EPWM_FDCTL2_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL2_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL2: DGSMPCYC Mask */ - -#define EPWM_FDCTL2_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL2: FDCKSEL Position */ -#define EPWM_FDCTL2_FDCKSEL_Msk (0x3ul << EPWM_FDCTL2_FDCKSEL_Pos) /*!< EPWM_T::FDCTL2: FDCKSEL Mask */ - -#define EPWM_FDCTL2_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL2: FDDGEN Position */ -#define EPWM_FDCTL2_FDDGEN_Msk (0x1ul << EPWM_FDCTL2_FDDGEN_Pos) /*!< EPWM_T::FDCTL2: FDDGEN Mask */ - -#define EPWM_FDCTL3_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL3: TRMSKCNT Position */ -#define EPWM_FDCTL3_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL3_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL3: TRMSKCNT Mask */ - -#define EPWM_FDCTL3_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL3: FDMSKEN Position */ -#define EPWM_FDCTL3_FDMSKEN_Msk (0x1ul << EPWM_FDCTL3_FDMSKEN_Pos) /*!< EPWM_T::FDCTL3: FDMSKEN Mask */ - -#define EPWM_FDCTL3_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL3: DGSMPCYC Position */ -#define EPWM_FDCTL3_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL3_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL3: DGSMPCYC Mask */ - -#define EPWM_FDCTL3_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL3: FDCKSEL Position */ -#define EPWM_FDCTL3_FDCKSEL_Msk (0x3ul << EPWM_FDCTL3_FDCKSEL_Pos) /*!< EPWM_T::FDCTL3: FDCKSEL Mask */ - -#define EPWM_FDCTL3_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL3: FDDGEN Position */ -#define EPWM_FDCTL3_FDDGEN_Msk (0x1ul << EPWM_FDCTL3_FDDGEN_Pos) /*!< EPWM_T::FDCTL3: FDDGEN Mask */ - -#define EPWM_FDCTL4_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL4: TRMSKCNT Position */ -#define EPWM_FDCTL4_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL4_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL4: TRMSKCNT Mask */ - -#define EPWM_FDCTL4_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL4: FDMSKEN Position */ -#define EPWM_FDCTL4_FDMSKEN_Msk (0x1ul << EPWM_FDCTL4_FDMSKEN_Pos) /*!< EPWM_T::FDCTL4: FDMSKEN Mask */ - -#define EPWM_FDCTL4_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL4: DGSMPCYC Position */ -#define EPWM_FDCTL4_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL4_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL4: DGSMPCYC Mask */ - -#define EPWM_FDCTL4_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL4: FDCKSEL Position */ -#define EPWM_FDCTL4_FDCKSEL_Msk (0x3ul << EPWM_FDCTL4_FDCKSEL_Pos) /*!< EPWM_T::FDCTL4: FDCKSEL Mask */ - -#define EPWM_FDCTL4_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL4: FDDGEN Position */ -#define EPWM_FDCTL4_FDDGEN_Msk (0x1ul << EPWM_FDCTL4_FDDGEN_Pos) /*!< EPWM_T::FDCTL4: FDDGEN Mask */ - -#define EPWM_FDCTL5_TRMSKCNT_Pos (0) /*!< EPWM_T::FDCTL5: TRMSKCNT Position */ -#define EPWM_FDCTL5_TRMSKCNT_Msk (0x7ful << EPWM_FDCTL5_TRMSKCNT_Pos) /*!< EPWM_T::FDCTL5: TRMSKCNT Mask */ - -#define EPWM_FDCTL5_FDMSKEN_Pos (15) /*!< EPWM_T::FDCTL5: FDMSKEN Position */ -#define EPWM_FDCTL5_FDMSKEN_Msk (0x1ul << EPWM_FDCTL5_FDMSKEN_Pos) /*!< EPWM_T::FDCTL5: FDMSKEN Mask */ - -#define EPWM_FDCTL5_DGSMPCYC_Pos (16) /*!< EPWM_T::FDCTL5: DGSMPCYC Position */ -#define EPWM_FDCTL5_DGSMPCYC_Msk (0x7ul << EPWM_FDCTL5_DGSMPCYC_Pos) /*!< EPWM_T::FDCTL5: DGSMPCYC Mask */ - -#define EPWM_FDCTL5_FDCKSEL_Pos (28) /*!< EPWM_T::FDCTL5: FDCKSEL Position */ -#define EPWM_FDCTL5_FDCKSEL_Msk (0x3ul << EPWM_FDCTL5_FDCKSEL_Pos) /*!< EPWM_T::FDCTL5: FDCKSEL Mask */ - -#define EPWM_FDCTL5_FDDGEN_Pos (31) /*!< EPWM_T::FDCTL5: FDDGEN Position */ -#define EPWM_FDCTL5_FDDGEN_Msk (0x1ul << EPWM_FDCTL5_FDDGEN_Pos) /*!< EPWM_T::FDCTL5: FDDGEN Mask */ - -#define EPWM_FDIEN_FDIENn_Pos (0) /*!< EPWM_T::FDIEN: FDIENn Position */ -#define EPWM_FDIEN_FDIENn_Msk (0x1ul << EPWM_FDIEN_FDIENn_Pos) /*!< EPWM_T::FDIEN: FDIENn Mask */ - -#define EPWM_FDSTS_FDIFn_Pos (0) /*!< EPWM_T::FDSTS: FDIFn Position */ -#define EPWM_FDSTS_FDIFn_Msk (0x3ful << EPWM_FDSTS_FDIFn_Pos) /*!< EPWM_T::FDSTS: FDIFn Mask */ - -#define EPWM_FDIEN_FDIEN0_Pos (0) /*!< EPWM_T::FDIEN: FDIEN0 Position */ -#define EPWM_FDIEN_FDIEN0_Msk (0x1ul << EPWM_FDIEN_FDIEN0_Pos) /*!< EPWM_T::FDIEN: FDIEN0 Mask */ - -#define EPWM_FDIEN_FDIEN1_Pos (1) /*!< EPWM_T::FDIEN: FDIEN1 Position */ -#define EPWM_FDIEN_FDIEN1_Msk (0x1ul << EPWM_FDIEN_FDIEN1_Pos) /*!< EPWM_T::FDIEN: FDIEN1 Mask */ - -#define EPWM_FDIEN_FDIEN2_Pos (2) /*!< EPWM_T::FDIEN: FDIEN2 Position */ -#define EPWM_FDIEN_FDIEN2_Msk (0x1ul << EPWM_FDIEN_FDIEN2_Pos) /*!< EPWM_T::FDIEN: FDIEN2 Mask */ - -#define EPWM_FDIEN_FDIEN3_Pos (3) /*!< EPWM_T::FDIEN: FDIEN3 Position */ -#define EPWM_FDIEN_FDIEN3_Msk (0x1ul << EPWM_FDIEN_FDIEN3_Pos) /*!< EPWM_T::FDIEN: FDIEN3 Mask */ - -#define EPWM_FDIEN_FDIEN4_Pos (4) /*!< EPWM_T::FDIEN: FDIEN4 Position */ -#define EPWM_FDIEN_FDIEN4_Msk (0x1ul << EPWM_FDIEN_FDIEN4_Pos) /*!< EPWM_T::FDIEN: FDIEN4 Mask */ - -#define EPWM_FDIEN_FDIEN5_Pos (5) /*!< EPWM_T::FDIEN: FDIEN5 Position */ -#define EPWM_FDIEN_FDIEN5_Msk (0x1ul << EPWM_FDIEN_FDIEN5_Pos) /*!< EPWM_T::FDIEN: FDIEN5 Mask */ - -#define EPWM_FDSTS_FDIF0_Pos (0) /*!< EPWM_T::FDSTS: FDIF0 Position */ -#define EPWM_FDSTS_FDIF0_Msk (0x1ul << EPWM_FDSTS_FDIF0_Pos) /*!< EPWM_T::FDSTS: FDIF0 Mask */ - -#define EPWM_FDSTS_FDIF1_Pos (1) /*!< EPWM_T::FDSTS: FDIF1 Position */ -#define EPWM_FDSTS_FDIF1_Msk (0x1ul << EPWM_FDSTS_FDIF1_Pos) /*!< EPWM_T::FDSTS: FDIF1 Mask */ - -#define EPWM_FDSTS_FDIF2_Pos (2) /*!< EPWM_T::FDSTS: FDIF2 Position */ -#define EPWM_FDSTS_FDIF2_Msk (0x1ul << EPWM_FDSTS_FDIF2_Pos) /*!< EPWM_T::FDSTS: FDIF2 Mask */ - -#define EPWM_FDSTS_FDIF3_Pos (3) /*!< EPWM_T::FDSTS: FDIF3 Position */ -#define EPWM_FDSTS_FDIF3_Msk (0x1ul << EPWM_FDSTS_FDIF3_Pos) /*!< EPWM_T::FDSTS: FDIF3 Mask */ - -#define EPWM_FDSTS_FDIF4_Pos (4) /*!< EPWM_T::FDSTS: FDIF4 Position */ -#define EPWM_FDSTS_FDIF4_Msk (0x1ul << EPWM_FDSTS_FDIF4_Pos) /*!< EPWM_T::FDSTS: FDIF4 Mask */ - -#define EPWM_FDSTS_FDIF5_Pos (5) /*!< EPWM_T::FDSTS: FDIF5 Position */ -#define EPWM_FDSTS_FDIF5_Msk (0x1ul << EPWM_FDSTS_FDIF5_Pos) /*!< EPWM_T::FDSTS: FDIF5 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN0_Pos (0) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Position */ -#define EPWM_EADCPSCCTL_PSCEN0_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN0_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN0 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN1_Pos (1) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Position */ -#define EPWM_EADCPSCCTL_PSCEN1_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN1_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN1 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN2_Pos (2) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Position */ -#define EPWM_EADCPSCCTL_PSCEN2_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN2_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN2 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN3_Pos (3) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Position */ -#define EPWM_EADCPSCCTL_PSCEN3_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN3_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN3 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN4_Pos (4) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Position */ -#define EPWM_EADCPSCCTL_PSCEN4_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN4_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN4 Mask */ - -#define EPWM_EADCPSCCTL_PSCEN5_Pos (5) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Position */ -#define EPWM_EADCPSCCTL_PSCEN5_Msk (0x1ul << EPWM_EADCPSCCTL_PSCEN5_Pos) /*!< EPWM_T::EADCPSCCTL: PSCEN5 Mask */ - -#define EPWM_EADCPSC0_EADCPSC0_Pos (0) /*!< EPWM_T::EADCPSC0: EADCPSC0 Position */ -#define EPWM_EADCPSC0_EADCPSC0_Msk (0xful << EPWM_EADCPSC0_EADCPSC0_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC0 Mask */ - -#define EPWM_EADCPSC0_EADCPSC1_Pos (8) /*!< EPWM_T::EADCPSC0: EADCPSC1 Position */ -#define EPWM_EADCPSC0_EADCPSC1_Msk (0xful << EPWM_EADCPSC0_EADCPSC1_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC1 Mask */ - -#define EPWM_EADCPSC0_EADCPSC2_Pos (16) /*!< EPWM_T::EADCPSC0: EADCPSC2 Position */ -#define EPWM_EADCPSC0_EADCPSC2_Msk (0xful << EPWM_EADCPSC0_EADCPSC2_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC2 Mask */ - -#define EPWM_EADCPSC0_EADCPSC3_Pos (24) /*!< EPWM_T::EADCPSC0: EADCPSC3 Position */ -#define EPWM_EADCPSC0_EADCPSC3_Msk (0xful << EPWM_EADCPSC0_EADCPSC3_Pos) /*!< EPWM_T::EADCPSC0: EADCPSC3 Mask */ - -#define EPWM_EADCPSC1_EADCPSC4_Pos (0) /*!< EPWM_T::EADCPSC1: EADCPSC4 Position */ -#define EPWM_EADCPSC1_EADCPSC4_Msk (0xful << EPWM_EADCPSC1_EADCPSC4_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC4 Mask */ - -#define EPWM_EADCPSC1_EADCPSC5_Pos (8) /*!< EPWM_T::EADCPSC1: EADCPSC5 Position */ -#define EPWM_EADCPSC1_EADCPSC5_Msk (0xful << EPWM_EADCPSC1_EADCPSC5_Pos) /*!< EPWM_T::EADCPSC1: EADCPSC5 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT0_Pos (0) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Position */ -#define EPWM_EADCPSCNT0_PSCNT0_Msk (0xful << EPWM_EADCPSCNT0_PSCNT0_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT0 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT1_Pos (8) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Position */ -#define EPWM_EADCPSCNT0_PSCNT1_Msk (0xful << EPWM_EADCPSCNT0_PSCNT1_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT1 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT2_Pos (16) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Position */ -#define EPWM_EADCPSCNT0_PSCNT2_Msk (0xful << EPWM_EADCPSCNT0_PSCNT2_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT2 Mask */ - -#define EPWM_EADCPSCNT0_PSCNT3_Pos (24) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Position */ -#define EPWM_EADCPSCNT0_PSCNT3_Msk (0xful << EPWM_EADCPSCNT0_PSCNT3_Pos) /*!< EPWM_T::EADCPSCNT0: PSCNT3 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT4_Pos (0) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Position */ -#define EPWM_EADCPSCNT1_PSCNT4_Msk (0xful << EPWM_EADCPSCNT1_PSCNT4_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT4 Mask */ - -#define EPWM_EADCPSCNT1_PSCNT5_Pos (8) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Position */ -#define EPWM_EADCPSCNT1_PSCNT5_Msk (0xful << EPWM_EADCPSCNT1_PSCNT5_Pos) /*!< EPWM_T::EADCPSCNT1: PSCNT5 Mask */ - -#define EPWM_CAPINEN_CAPINEN0_Pos (0) /*!< EPWM_T::CAPINEN: CAPINEN0 Position */ -#define EPWM_CAPINEN_CAPINEN0_Msk (0x1ul << EPWM_CAPINEN_CAPINEN0_Pos) /*!< EPWM_T::CAPINEN: CAPINEN0 Mask */ - -#define EPWM_CAPINEN_CAPINEN1_Pos (1) /*!< EPWM_T::CAPINEN: CAPINEN1 Position */ -#define EPWM_CAPINEN_CAPINEN1_Msk (0x1ul << EPWM_CAPINEN_CAPINEN1_Pos) /*!< EPWM_T::CAPINEN: CAPINEN1 Mask */ - -#define EPWM_CAPINEN_CAPINEN2_Pos (2) /*!< EPWM_T::CAPINEN: CAPINEN2 Position */ -#define EPWM_CAPINEN_CAPINEN2_Msk (0x1ul << EPWM_CAPINEN_CAPINEN2_Pos) /*!< EPWM_T::CAPINEN: CAPINEN2 Mask */ - -#define EPWM_CAPINEN_CAPINEN3_Pos (3) /*!< EPWM_T::CAPINEN: CAPINEN3 Position */ -#define EPWM_CAPINEN_CAPINEN3_Msk (0x1ul << EPWM_CAPINEN_CAPINEN3_Pos) /*!< EPWM_T::CAPINEN: CAPINEN3 Mask */ - -#define EPWM_CAPINEN_CAPINEN4_Pos (4) /*!< EPWM_T::CAPINEN: CAPINEN4 Position */ -#define EPWM_CAPINEN_CAPINEN4_Msk (0x1ul << EPWM_CAPINEN_CAPINEN4_Pos) /*!< EPWM_T::CAPINEN: CAPINEN4 Mask */ - -#define EPWM_CAPINEN_CAPINEN5_Pos (5) /*!< EPWM_T::CAPINEN: CAPINEN5 Position */ -#define EPWM_CAPINEN_CAPINEN5_Msk (0x1ul << EPWM_CAPINEN_CAPINEN5_Pos) /*!< EPWM_T::CAPINEN: CAPINEN5 Mask */ - -#define EPWM_CAPCTL_CAPEN0_Pos (0) /*!< EPWM_T::CAPCTL: CAPEN0 Position */ -#define EPWM_CAPCTL_CAPEN0_Msk (0x1ul << EPWM_CAPCTL_CAPEN0_Pos) /*!< EPWM_T::CAPCTL: CAPEN0 Mask */ - -#define EPWM_CAPCTL_CAPEN1_Pos (1) /*!< EPWM_T::CAPCTL: CAPEN1 Position */ -#define EPWM_CAPCTL_CAPEN1_Msk (0x1ul << EPWM_CAPCTL_CAPEN1_Pos) /*!< EPWM_T::CAPCTL: CAPEN1 Mask */ - -#define EPWM_CAPCTL_CAPEN2_Pos (2) /*!< EPWM_T::CAPCTL: CAPEN2 Position */ -#define EPWM_CAPCTL_CAPEN2_Msk (0x1ul << EPWM_CAPCTL_CAPEN2_Pos) /*!< EPWM_T::CAPCTL: CAPEN2 Mask */ - -#define EPWM_CAPCTL_CAPEN3_Pos (3) /*!< EPWM_T::CAPCTL: CAPEN3 Position */ -#define EPWM_CAPCTL_CAPEN3_Msk (0x1ul << EPWM_CAPCTL_CAPEN3_Pos) /*!< EPWM_T::CAPCTL: CAPEN3 Mask */ - -#define EPWM_CAPCTL_CAPEN4_Pos (4) /*!< EPWM_T::CAPCTL: CAPEN4 Position */ -#define EPWM_CAPCTL_CAPEN4_Msk (0x1ul << EPWM_CAPCTL_CAPEN4_Pos) /*!< EPWM_T::CAPCTL: CAPEN4 Mask */ - -#define EPWM_CAPCTL_CAPEN5_Pos (5) /*!< EPWM_T::CAPCTL: CAPEN5 Position */ -#define EPWM_CAPCTL_CAPEN5_Msk (0x1ul << EPWM_CAPCTL_CAPEN5_Pos) /*!< EPWM_T::CAPCTL: CAPEN5 Mask */ - -#define EPWM_CAPCTL_CAPINV0_Pos (8) /*!< EPWM_T::CAPCTL: CAPINV0 Position */ -#define EPWM_CAPCTL_CAPINV0_Msk (0x1ul << EPWM_CAPCTL_CAPINV0_Pos) /*!< EPWM_T::CAPCTL: CAPINV0 Mask */ - -#define EPWM_CAPCTL_CAPINV1_Pos (9) /*!< EPWM_T::CAPCTL: CAPINV1 Position */ -#define EPWM_CAPCTL_CAPINV1_Msk (0x1ul << EPWM_CAPCTL_CAPINV1_Pos) /*!< EPWM_T::CAPCTL: CAPINV1 Mask */ - -#define EPWM_CAPCTL_CAPINV2_Pos (10) /*!< EPWM_T::CAPCTL: CAPINV2 Position */ -#define EPWM_CAPCTL_CAPINV2_Msk (0x1ul << EPWM_CAPCTL_CAPINV2_Pos) /*!< EPWM_T::CAPCTL: CAPINV2 Mask */ - -#define EPWM_CAPCTL_CAPINV3_Pos (11) /*!< EPWM_T::CAPCTL: CAPINV3 Position */ -#define EPWM_CAPCTL_CAPINV3_Msk (0x1ul << EPWM_CAPCTL_CAPINV3_Pos) /*!< EPWM_T::CAPCTL: CAPINV3 Mask */ - -#define EPWM_CAPCTL_CAPINV4_Pos (12) /*!< EPWM_T::CAPCTL: CAPINV4 Position */ -#define EPWM_CAPCTL_CAPINV4_Msk (0x1ul << EPWM_CAPCTL_CAPINV4_Pos) /*!< EPWM_T::CAPCTL: CAPINV4 Mask */ - -#define EPWM_CAPCTL_CAPINV5_Pos (13) /*!< EPWM_T::CAPCTL: CAPINV5 Position */ -#define EPWM_CAPCTL_CAPINV5_Msk (0x1ul << EPWM_CAPCTL_CAPINV5_Pos) /*!< EPWM_T::CAPCTL: CAPINV5 Mask */ - -#define EPWM_CAPCTL_RCRLDEN0_Pos (16) /*!< EPWM_T::CAPCTL: RCRLDEN0 Position */ -#define EPWM_CAPCTL_RCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN0 Mask */ - -#define EPWM_CAPCTL_RCRLDEN1_Pos (17) /*!< EPWM_T::CAPCTL: RCRLDEN1 Position */ -#define EPWM_CAPCTL_RCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN1 Mask */ - -#define EPWM_CAPCTL_RCRLDEN2_Pos (18) /*!< EPWM_T::CAPCTL: RCRLDEN2 Position */ -#define EPWM_CAPCTL_RCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN2 Mask */ - -#define EPWM_CAPCTL_RCRLDEN3_Pos (19) /*!< EPWM_T::CAPCTL: RCRLDEN3 Position */ -#define EPWM_CAPCTL_RCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN3 Mask */ - -#define EPWM_CAPCTL_RCRLDEN4_Pos (20) /*!< EPWM_T::CAPCTL: RCRLDEN4 Position */ -#define EPWM_CAPCTL_RCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN4 Mask */ - -#define EPWM_CAPCTL_RCRLDEN5_Pos (21) /*!< EPWM_T::CAPCTL: RCRLDEN5 Position */ -#define EPWM_CAPCTL_RCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_RCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: RCRLDEN5 Mask */ - -#define EPWM_CAPCTL_FCRLDEN0_Pos (24) /*!< EPWM_T::CAPCTL: FCRLDEN0 Position */ -#define EPWM_CAPCTL_FCRLDEN0_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN0_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN0 Mask */ - -#define EPWM_CAPCTL_FCRLDEN1_Pos (25) /*!< EPWM_T::CAPCTL: FCRLDEN1 Position */ -#define EPWM_CAPCTL_FCRLDEN1_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN1_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN1 Mask */ - -#define EPWM_CAPCTL_FCRLDEN2_Pos (26) /*!< EPWM_T::CAPCTL: FCRLDEN2 Position */ -#define EPWM_CAPCTL_FCRLDEN2_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN2_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN2 Mask */ - -#define EPWM_CAPCTL_FCRLDEN3_Pos (27) /*!< EPWM_T::CAPCTL: FCRLDEN3 Position */ -#define EPWM_CAPCTL_FCRLDEN3_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN3_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN3 Mask */ - -#define EPWM_CAPCTL_FCRLDEN4_Pos (28) /*!< EPWM_T::CAPCTL: FCRLDEN4 Position */ -#define EPWM_CAPCTL_FCRLDEN4_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN4_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN4 Mask */ - -#define EPWM_CAPCTL_FCRLDEN5_Pos (29) /*!< EPWM_T::CAPCTL: FCRLDEN5 Position */ -#define EPWM_CAPCTL_FCRLDEN5_Msk (0x1ul << EPWM_CAPCTL_FCRLDEN5_Pos) /*!< EPWM_T::CAPCTL: FCRLDEN5 Mask */ - -#define EPWM_CAPSTS_CRLIFOV0_Pos (0) /*!< EPWM_T::CAPSTS: CRLIFOV0 Position */ -#define EPWM_CAPSTS_CRLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV0 Mask */ - -#define EPWM_CAPSTS_CRLIFOV1_Pos (1) /*!< EPWM_T::CAPSTS: CRLIFOV1 Position */ -#define EPWM_CAPSTS_CRLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV1 Mask */ - -#define EPWM_CAPSTS_CRLIFOV2_Pos (2) /*!< EPWM_T::CAPSTS: CRLIFOV2 Position */ -#define EPWM_CAPSTS_CRLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV2 Mask */ - -#define EPWM_CAPSTS_CRLIFOV3_Pos (3) /*!< EPWM_T::CAPSTS: CRLIFOV3 Position */ -#define EPWM_CAPSTS_CRLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV3 Mask */ - -#define EPWM_CAPSTS_CRLIFOV4_Pos (4) /*!< EPWM_T::CAPSTS: CRLIFOV4 Position */ -#define EPWM_CAPSTS_CRLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV4 Mask */ - -#define EPWM_CAPSTS_CRLIFOV5_Pos (5) /*!< EPWM_T::CAPSTS: CRLIFOV5 Position */ -#define EPWM_CAPSTS_CRLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CRLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CRLIFOV5 Mask */ - -#define EPWM_CAPSTS_CFLIFOV0_Pos (8) /*!< EPWM_T::CAPSTS: CFLIFOV0 Position */ -#define EPWM_CAPSTS_CFLIFOV0_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV0_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV0 Mask */ - -#define EPWM_CAPSTS_CFLIFOV1_Pos (9) /*!< EPWM_T::CAPSTS: CFLIFOV1 Position */ -#define EPWM_CAPSTS_CFLIFOV1_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV1_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV1 Mask */ - -#define EPWM_CAPSTS_CFLIFOV2_Pos (10) /*!< EPWM_T::CAPSTS: CFLIFOV2 Position */ -#define EPWM_CAPSTS_CFLIFOV2_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV2_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV2 Mask */ - -#define EPWM_CAPSTS_CFLIFOV3_Pos (11) /*!< EPWM_T::CAPSTS: CFLIFOV3 Position */ -#define EPWM_CAPSTS_CFLIFOV3_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV3_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV3 Mask */ - -#define EPWM_CAPSTS_CFLIFOV4_Pos (12) /*!< EPWM_T::CAPSTS: CFLIFOV4 Position */ -#define EPWM_CAPSTS_CFLIFOV4_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV4_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV4 Mask */ - -#define EPWM_CAPSTS_CFLIFOV5_Pos (13) /*!< EPWM_T::CAPSTS: CFLIFOV5 Position */ -#define EPWM_CAPSTS_CFLIFOV5_Msk (0x1ul << EPWM_CAPSTS_CFLIFOV5_Pos) /*!< EPWM_T::CAPSTS: CFLIFOV5 Mask */ - -#define EPWM_RCAPDAT0_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT0: RCAPDAT Position */ -#define EPWM_RCAPDAT0_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT0_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT0: RCAPDAT Mask */ - -#define EPWM_FCAPDAT0_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT0: FCAPDAT Position */ -#define EPWM_FCAPDAT0_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT0_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT0: FCAPDAT Mask */ - -#define EPWM_RCAPDAT1_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT1: RCAPDAT Position */ -#define EPWM_RCAPDAT1_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT1_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT1: RCAPDAT Mask */ - -#define EPWM_FCAPDAT1_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT1: FCAPDAT Position */ -#define EPWM_FCAPDAT1_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT1_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT1: FCAPDAT Mask */ - -#define EPWM_RCAPDAT2_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT2: RCAPDAT Position */ -#define EPWM_RCAPDAT2_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT2_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT2: RCAPDAT Mask */ - -#define EPWM_FCAPDAT2_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT2: FCAPDAT Position */ -#define EPWM_FCAPDAT2_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT2_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT2: FCAPDAT Mask */ - -#define EPWM_RCAPDAT3_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT3: RCAPDAT Position */ -#define EPWM_RCAPDAT3_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT3_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT3: RCAPDAT Mask */ - -#define EPWM_FCAPDAT3_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT3: FCAPDAT Position */ -#define EPWM_FCAPDAT3_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT3_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT3: FCAPDAT Mask */ - -#define EPWM_RCAPDAT4_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT4: RCAPDAT Position */ -#define EPWM_RCAPDAT4_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT4_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT4: RCAPDAT Mask */ - -#define EPWM_FCAPDAT4_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT4: FCAPDAT Position */ -#define EPWM_FCAPDAT4_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT4_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT4: FCAPDAT Mask */ - -#define EPWM_RCAPDAT5_RCAPDAT_Pos (0) /*!< EPWM_T::RCAPDAT5: RCAPDAT Position */ -#define EPWM_RCAPDAT5_RCAPDAT_Msk (0xfffful << EPWM_RCAPDAT5_RCAPDAT_Pos) /*!< EPWM_T::RCAPDAT5: RCAPDAT Mask */ - -#define EPWM_FCAPDAT5_FCAPDAT_Pos (0) /*!< EPWM_T::FCAPDAT5: FCAPDAT Position */ -#define EPWM_FCAPDAT5_FCAPDAT_Msk (0xfffful << EPWM_FCAPDAT5_FCAPDAT_Pos) /*!< EPWM_T::FCAPDAT5: FCAPDAT Mask */ - -#define EPWM_PDMACTL_CHEN0_1_Pos (0) /*!< EPWM_T::PDMACTL: CHEN0_1 Position */ -#define EPWM_PDMACTL_CHEN0_1_Msk (0x1ul << EPWM_PDMACTL_CHEN0_1_Pos) /*!< EPWM_T::PDMACTL: CHEN0_1 Mask */ - -#define EPWM_PDMACTL_CAPMOD0_1_Pos (1) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Position */ -#define EPWM_PDMACTL_CAPMOD0_1_Msk (0x3ul << EPWM_PDMACTL_CAPMOD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPMOD0_1 Mask */ - -#define EPWM_PDMACTL_CAPORD0_1_Pos (3) /*!< EPWM_T::PDMACTL: CAPORD0_1 Position */ -#define EPWM_PDMACTL_CAPORD0_1_Msk (0x1ul << EPWM_PDMACTL_CAPORD0_1_Pos) /*!< EPWM_T::PDMACTL: CAPORD0_1 Mask */ - -#define EPWM_PDMACTL_CHSEL0_1_Pos (4) /*!< EPWM_T::PDMACTL: CHSEL0_1 Position */ -#define EPWM_PDMACTL_CHSEL0_1_Msk (0x1ul << EPWM_PDMACTL_CHSEL0_1_Pos) /*!< EPWM_T::PDMACTL: CHSEL0_1 Mask */ - -#define EPWM_PDMACTL_CHEN2_3_Pos (8) /*!< EPWM_T::PDMACTL: CHEN2_3 Position */ -#define EPWM_PDMACTL_CHEN2_3_Msk (0x1ul << EPWM_PDMACTL_CHEN2_3_Pos) /*!< EPWM_T::PDMACTL: CHEN2_3 Mask */ - -#define EPWM_PDMACTL_CAPMOD2_3_Pos (9) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Position */ -#define EPWM_PDMACTL_CAPMOD2_3_Msk (0x3ul << EPWM_PDMACTL_CAPMOD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPMOD2_3 Mask */ - -#define EPWM_PDMACTL_CAPORD2_3_Pos (11) /*!< EPWM_T::PDMACTL: CAPORD2_3 Position */ -#define EPWM_PDMACTL_CAPORD2_3_Msk (0x1ul << EPWM_PDMACTL_CAPORD2_3_Pos) /*!< EPWM_T::PDMACTL: CAPORD2_3 Mask */ - -#define EPWM_PDMACTL_CHSEL2_3_Pos (12) /*!< EPWM_T::PDMACTL: CHSEL2_3 Position */ -#define EPWM_PDMACTL_CHSEL2_3_Msk (0x1ul << EPWM_PDMACTL_CHSEL2_3_Pos) /*!< EPWM_T::PDMACTL: CHSEL2_3 Mask */ - -#define EPWM_PDMACTL_CHEN4_5_Pos (16) /*!< EPWM_T::PDMACTL: CHEN4_5 Position */ -#define EPWM_PDMACTL_CHEN4_5_Msk (0x1ul << EPWM_PDMACTL_CHEN4_5_Pos) /*!< EPWM_T::PDMACTL: CHEN4_5 Mask */ - -#define EPWM_PDMACTL_CAPMOD4_5_Pos (17) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Position */ -#define EPWM_PDMACTL_CAPMOD4_5_Msk (0x3ul << EPWM_PDMACTL_CAPMOD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPMOD4_5 Mask */ - -#define EPWM_PDMACTL_CAPORD4_5_Pos (19) /*!< EPWM_T::PDMACTL: CAPORD4_5 Position */ -#define EPWM_PDMACTL_CAPORD4_5_Msk (0x1ul << EPWM_PDMACTL_CAPORD4_5_Pos) /*!< EPWM_T::PDMACTL: CAPORD4_5 Mask */ - -#define EPWM_PDMACTL_CHSEL4_5_Pos (20) /*!< EPWM_T::PDMACTL: CHSEL4_5 Position */ -#define EPWM_PDMACTL_CHSEL4_5_Msk (0x1ul << EPWM_PDMACTL_CHSEL4_5_Pos) /*!< EPWM_T::PDMACTL: CHSEL4_5 Mask */ - -#define EPWM_PDMACAP0_1_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP0_1: CAPBUF Position */ -#define EPWM_PDMACAP0_1_CAPBUF_Msk (0xfffful << EPWM_PDMACAP0_1_CAPBUF_Pos) /*!< EPWM_T::PDMACAP0_1: CAPBUF Mask */ - -#define EPWM_PDMACAP2_3_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP2_3: CAPBUF Position */ -#define EPWM_PDMACAP2_3_CAPBUF_Msk (0xfffful << EPWM_PDMACAP2_3_CAPBUF_Pos) /*!< EPWM_T::PDMACAP2_3: CAPBUF Mask */ - -#define EPWM_PDMACAP4_5_CAPBUF_Pos (0) /*!< EPWM_T::PDMACAP4_5: CAPBUF Position */ -#define EPWM_PDMACAP4_5_CAPBUF_Msk (0xfffful << EPWM_PDMACAP4_5_CAPBUF_Pos) /*!< EPWM_T::PDMACAP4_5: CAPBUF Mask */ - -#define EPWM_CAPIEN_CAPRIEN0_Pos (0) /*!< EPWM_T::CAPIEN: CAPRIEN0 Position */ -#define EPWM_CAPIEN_CAPRIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN0 Mask */ - -#define EPWM_CAPIEN_CAPRIEN1_Pos (1) /*!< EPWM_T::CAPIEN: CAPRIEN1 Position */ -#define EPWM_CAPIEN_CAPRIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN1 Mask */ - -#define EPWM_CAPIEN_CAPRIEN2_Pos (2) /*!< EPWM_T::CAPIEN: CAPRIEN2 Position */ -#define EPWM_CAPIEN_CAPRIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN2 Mask */ - -#define EPWM_CAPIEN_CAPRIEN3_Pos (3) /*!< EPWM_T::CAPIEN: CAPRIEN3 Position */ -#define EPWM_CAPIEN_CAPRIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN3 Mask */ - -#define EPWM_CAPIEN_CAPRIEN4_Pos (4) /*!< EPWM_T::CAPIEN: CAPRIEN4 Position */ -#define EPWM_CAPIEN_CAPRIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN4 Mask */ - -#define EPWM_CAPIEN_CAPRIEN5_Pos (5) /*!< EPWM_T::CAPIEN: CAPRIEN5 Position */ -#define EPWM_CAPIEN_CAPRIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPRIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPRIEN5 Mask */ - -#define EPWM_CAPIEN_CAPFIEN0_Pos (8) /*!< EPWM_T::CAPIEN: CAPFIEN0 Position */ -#define EPWM_CAPIEN_CAPFIEN0_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN0_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN0 Mask */ - -#define EPWM_CAPIEN_CAPFIEN1_Pos (9) /*!< EPWM_T::CAPIEN: CAPFIEN1 Position */ -#define EPWM_CAPIEN_CAPFIEN1_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN1_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN1 Mask */ - -#define EPWM_CAPIEN_CAPFIEN2_Pos (10) /*!< EPWM_T::CAPIEN: CAPFIEN2 Position */ -#define EPWM_CAPIEN_CAPFIEN2_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN2_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN2 Mask */ - -#define EPWM_CAPIEN_CAPFIEN3_Pos (11) /*!< EPWM_T::CAPIEN: CAPFIEN3 Position */ -#define EPWM_CAPIEN_CAPFIEN3_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN3_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN3 Mask */ - -#define EPWM_CAPIEN_CAPFIEN4_Pos (12) /*!< EPWM_T::CAPIEN: CAPFIEN4 Position */ -#define EPWM_CAPIEN_CAPFIEN4_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN4_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN4 Mask */ - -#define EPWM_CAPIEN_CAPFIEN5_Pos (13) /*!< EPWM_T::CAPIEN: CAPFIEN5 Position */ -#define EPWM_CAPIEN_CAPFIEN5_Msk (0x1ul << EPWM_CAPIEN_CAPFIEN5_Pos) /*!< EPWM_T::CAPIEN: CAPFIEN5 Mask */ - -#define EPWM_CAPIF_CRLIF0_Pos (0) /*!< EPWM_T::CAPIF: CRLIF0 Position */ -#define EPWM_CAPIF_CRLIF0_Msk (0x1ul << EPWM_CAPIF_CRLIF0_Pos) /*!< EPWM_T::CAPIF: CRLIF0 Mask */ - -#define EPWM_CAPIF_CRLIF1_Pos (1) /*!< EPWM_T::CAPIF: CRLIF1 Position */ -#define EPWM_CAPIF_CRLIF1_Msk (0x1ul << EPWM_CAPIF_CRLIF1_Pos) /*!< EPWM_T::CAPIF: CRLIF1 Mask */ - -#define EPWM_CAPIF_CRLIF2_Pos (2) /*!< EPWM_T::CAPIF: CRLIF2 Position */ -#define EPWM_CAPIF_CRLIF2_Msk (0x1ul << EPWM_CAPIF_CRLIF2_Pos) /*!< EPWM_T::CAPIF: CRLIF2 Mask */ - -#define EPWM_CAPIF_CRLIF3_Pos (3) /*!< EPWM_T::CAPIF: CRLIF3 Position */ -#define EPWM_CAPIF_CRLIF3_Msk (0x1ul << EPWM_CAPIF_CRLIF3_Pos) /*!< EPWM_T::CAPIF: CRLIF3 Mask */ - -#define EPWM_CAPIF_CRLIF4_Pos (4) /*!< EPWM_T::CAPIF: CRLIF4 Position */ -#define EPWM_CAPIF_CRLIF4_Msk (0x1ul << EPWM_CAPIF_CRLIF4_Pos) /*!< EPWM_T::CAPIF: CRLIF4 Mask */ - -#define EPWM_CAPIF_CRLIF5_Pos (5) /*!< EPWM_T::CAPIF: CRLIF5 Position */ -#define EPWM_CAPIF_CRLIF5_Msk (0x1ul << EPWM_CAPIF_CRLIF5_Pos) /*!< EPWM_T::CAPIF: CRLIF5 Mask */ - -#define EPWM_CAPIF_CFLIF0_Pos (8) /*!< EPWM_T::CAPIF: CFLIF0 Position */ -#define EPWM_CAPIF_CFLIF0_Msk (0x1ul << EPWM_CAPIF_CFLIF0_Pos) /*!< EPWM_T::CAPIF: CFLIF0 Mask */ - -#define EPWM_CAPIF_CFLIF1_Pos (9) /*!< EPWM_T::CAPIF: CFLIF1 Position */ -#define EPWM_CAPIF_CFLIF1_Msk (0x1ul << EPWM_CAPIF_CFLIF1_Pos) /*!< EPWM_T::CAPIF: CFLIF1 Mask */ - -#define EPWM_CAPIF_CFLIF2_Pos (10) /*!< EPWM_T::CAPIF: CFLIF2 Position */ -#define EPWM_CAPIF_CFLIF2_Msk (0x1ul << EPWM_CAPIF_CFLIF2_Pos) /*!< EPWM_T::CAPIF: CFLIF2 Mask */ - -#define EPWM_CAPIF_CFLIF3_Pos (11) /*!< EPWM_T::CAPIF: CFLIF3 Position */ -#define EPWM_CAPIF_CFLIF3_Msk (0x1ul << EPWM_CAPIF_CFLIF3_Pos) /*!< EPWM_T::CAPIF: CFLIF3 Mask */ - -#define EPWM_CAPIF_CFLIF4_Pos (12) /*!< EPWM_T::CAPIF: CFLIF4 Position */ -#define EPWM_CAPIF_CFLIF4_Msk (0x1ul << EPWM_CAPIF_CFLIF4_Pos) /*!< EPWM_T::CAPIF: CFLIF4 Mask */ - -#define EPWM_CAPIF_CFLIF5_Pos (13) /*!< EPWM_T::CAPIF: CFLIF5 Position */ -#define EPWM_CAPIF_CFLIF5_Msk (0x1ul << EPWM_CAPIF_CFLIF5_Pos) /*!< EPWM_T::CAPIF: CFLIF5 Mask */ - -#define EPWM_PBUF0_PBUF_Pos (0) /*!< EPWM_T::PBUF0: PBUF Position */ -#define EPWM_PBUF0_PBUF_Msk (0xfffful << EPWM_PBUF0_PBUF_Pos) /*!< EPWM_T::PBUF0: PBUF Mask */ - -#define EPWM_PBUF1_PBUF_Pos (0) /*!< EPWM_T::PBUF1: PBUF Position */ -#define EPWM_PBUF1_PBUF_Msk (0xfffful << EPWM_PBUF1_PBUF_Pos) /*!< EPWM_T::PBUF1: PBUF Mask */ - -#define EPWM_PBUF2_PBUF_Pos (0) /*!< EPWM_T::PBUF2: PBUF Position */ -#define EPWM_PBUF2_PBUF_Msk (0xfffful << EPWM_PBUF2_PBUF_Pos) /*!< EPWM_T::PBUF2: PBUF Mask */ - -#define EPWM_PBUF3_PBUF_Pos (0) /*!< EPWM_T::PBUF3: PBUF Position */ -#define EPWM_PBUF3_PBUF_Msk (0xfffful << EPWM_PBUF3_PBUF_Pos) /*!< EPWM_T::PBUF3: PBUF Mask */ - -#define EPWM_PBUF4_PBUF_Pos (0) /*!< EPWM_T::PBUF4: PBUF Position */ -#define EPWM_PBUF4_PBUF_Msk (0xfffful << EPWM_PBUF4_PBUF_Pos) /*!< EPWM_T::PBUF4: PBUF Mask */ - -#define EPWM_PBUF5_PBUF_Pos (0) /*!< EPWM_T::PBUF5: PBUF Position */ -#define EPWM_PBUF5_PBUF_Msk (0xfffful << EPWM_PBUF5_PBUF_Pos) /*!< EPWM_T::PBUF5: PBUF Mask */ - -#define EPWM_CMPBUF0_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF0: CMPBUF Position */ -#define EPWM_CMPBUF0_CMPBUF_Msk (0xfffful << EPWM_CMPBUF0_CMPBUF_Pos) /*!< EPWM_T::CMPBUF0: CMPBUF Mask */ - -#define EPWM_CMPBUF1_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF1: CMPBUF Position */ -#define EPWM_CMPBUF1_CMPBUF_Msk (0xfffful << EPWM_CMPBUF1_CMPBUF_Pos) /*!< EPWM_T::CMPBUF1: CMPBUF Mask */ - -#define EPWM_CMPBUF2_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF2: CMPBUF Position */ -#define EPWM_CMPBUF2_CMPBUF_Msk (0xfffful << EPWM_CMPBUF2_CMPBUF_Pos) /*!< EPWM_T::CMPBUF2: CMPBUF Mask */ - -#define EPWM_CMPBUF3_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF3: CMPBUF Position */ -#define EPWM_CMPBUF3_CMPBUF_Msk (0xfffful << EPWM_CMPBUF3_CMPBUF_Pos) /*!< EPWM_T::CMPBUF3: CMPBUF Mask */ - -#define EPWM_CMPBUF4_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF4: CMPBUF Position */ -#define EPWM_CMPBUF4_CMPBUF_Msk (0xfffful << EPWM_CMPBUF4_CMPBUF_Pos) /*!< EPWM_T::CMPBUF4: CMPBUF Mask */ - -#define EPWM_CMPBUF5_CMPBUF_Pos (0) /*!< EPWM_T::CMPBUF5: CMPBUF Position */ -#define EPWM_CMPBUF5_CMPBUF_Msk (0xfffful << EPWM_CMPBUF5_CMPBUF_Pos) /*!< EPWM_T::CMPBUF5: CMPBUF Mask */ - -#define EPWM_CPSCBUF0_1_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF0_1: CPSCBUF Position */ -#define EPWM_CPSCBUF0_1_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF0_1_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF0_1: CPSCBUF Mask */ - -#define EPWM_CPSCBUF2_3_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF2_3: CPSCBUF Position */ -#define EPWM_CPSCBUF2_3_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF2_3_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF2_3: CPSCBUF Mask */ - -#define EPWM_CPSCBUF4_5_CPSCBUF_Pos (0) /*!< EPWM_T::CPSCBUF4_5: CPSCBUF Position */ -#define EPWM_CPSCBUF4_5_CPSCBUF_Msk (0xffful << EPWM_CPSCBUF4_5_CPSCBUF_Pos) /*!< EPWM_T::CPSCBUF4_5: CPSCBUF Mask */ - -#define EPWM_FTCBUF0_1_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Position */ -#define EPWM_FTCBUF0_1_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF0_1_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF0_1: FTCMPBUF Mask */ - -#define EPWM_FTCBUF2_3_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Position */ -#define EPWM_FTCBUF2_3_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF2_3_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF2_3: FTCMPBUF Mask */ - -#define EPWM_FTCBUF4_5_FTCMPBUF_Pos (0) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Position */ -#define EPWM_FTCBUF4_5_FTCMPBUF_Msk (0xfffful << EPWM_FTCBUF4_5_FTCMPBUF_Pos) /*!< EPWM_T::FTCBUF4_5: FTCMPBUF Mask */ - -#define EPWM_FTCI_FTCMU0_Pos (0) /*!< EPWM_T::FTCI: FTCMU0 Position */ -#define EPWM_FTCI_FTCMU0_Msk (0x1ul << EPWM_FTCI_FTCMU0_Pos) /*!< EPWM_T::FTCI: FTCMU0 Mask */ - -#define EPWM_FTCI_FTCMU2_Pos (1) /*!< EPWM_T::FTCI: FTCMU2 Position */ -#define EPWM_FTCI_FTCMU2_Msk (0x1ul << EPWM_FTCI_FTCMU2_Pos) /*!< EPWM_T::FTCI: FTCMU2 Mask */ - -#define EPWM_FTCI_FTCMU4_Pos (2) /*!< EPWM_T::FTCI: FTCMU4 Position */ -#define EPWM_FTCI_FTCMU4_Msk (0x1ul << EPWM_FTCI_FTCMU4_Pos) /*!< EPWM_T::FTCI: FTCMU4 Mask */ - -#define EPWM_FTCI_FTCMD0_Pos (8) /*!< EPWM_T::FTCI: FTCMD0 Position */ -#define EPWM_FTCI_FTCMD0_Msk (0x1ul << EPWM_FTCI_FTCMD0_Pos) /*!< EPWM_T::FTCI: FTCMD0 Mask */ - -#define EPWM_FTCI_FTCMD2_Pos (9) /*!< EPWM_T::FTCI: FTCMD2 Position */ -#define EPWM_FTCI_FTCMD2_Msk (0x1ul << EPWM_FTCI_FTCMD2_Pos) /*!< EPWM_T::FTCI: FTCMD2 Mask */ - -#define EPWM_FTCI_FTCMD4_Pos (10) /*!< EPWM_T::FTCI: FTCMD4 Position */ -#define EPWM_FTCI_FTCMD4_Msk (0x1ul << EPWM_FTCI_FTCMD4_Pos) /*!< EPWM_T::FTCI: FTCMD4 Mask */ - -/**@}*/ /* EPWM_CONST */ -/**@}*/ /* end of EPWM register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EPWM_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gfx_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gfx_reg.h deleted file mode 100644 index f042e3524b5..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gfx_reg.h +++ /dev/null @@ -1,382 +0,0 @@ -/**************************************************************************//** - * @file gfx_reg.h - * @brief GFX register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __GFX_REG_H__ -#define __GFX_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup GFX 2D Graphic Engine (GFX) - Memory Mapped Structure for GFX Controller -@{ */ - -typedef struct -{ - - - /** - * @var GFX_T::AQHiClockControl - * Offset: 0x00 Clock control register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CLK3D_DIS |Disable 3D clock - * | | |Software core clock disable signal for core (clk1x) clock. - * | | |When set to 1, the clock is frozen. - * |[1] |CLK2D_DIS |Disable 2D clock - * | | |Software clock disable signal. - * | | |For this core both bits CLK3D_DIS and CLK2D_DIS should be controlled by software. - * | | |The AXI interface clock is the only block not stalled at that point. - * |[8:2] |FSCALE_VAL|Core clock frequency scale value - * | | |If this value is set to 1, the core clock will be 1/64 of clk1x, otherwise clock is fully frequency - * |[9] |FSCALE_CMD_LOAD|Core clock frequency scale value - * | | |When writing a 1 to this bit, it updates the frequency scale factor with the value FSCALE_VAL. - * | | |The bit must be set back to 0 after that. - * | | |If this bit is set and FSCALE_VAL=0 (an invalid combination), the HREADYOUT output signal will get stuck to 0. - * |[10] |DISABLE_RAM_CLOCK_GATING|Disables clock gating for rams. - * |[12] |SOFT_RESET|Soft resets the GFX. - * |[17] |IDLE2_D |2D pipe is idle. - * |[19] |ISOLATE_GPU|Isolate GPU bit - * | | |Used for power on/off sequence. - * @var GFX_T::AQHiIdle - * Offset: 0x04 Idle status register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IDLE_FE |FE is idle. - * |[1] |IDLE_DE |DE is idle. - * |[2] |IDLE_PE |PE is idle. - * |[31] |AXI_LP |AXI is in low power mode. - * @var GFX_T::AQAxiConfig - * Offset: 0x08 AXI configuration register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:8] |AWCACHE |Set AWCACHE[3:0] value - * |[15:12] |ARCACHE |Set ARCACHE[3:0] value - * |[17:16] |AXDOMAIN_SHARED|Configure AxDOMAIN value for shareable request. - * |[19:18] |AXDOMAIN_NON_SHARED|Configure AxDOMAIN value for non-shareable request. - * |[23:20] |AXCACHE_OVERRIDE_SHARED|Configure AxCACHE value for shareable request. - * @var GFX_T::AQAxiStatus - * Offset: 0x0C AXI status register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |WR_ERR_ID |Write error ID - * |[7:4] |RD_ERR_ID |Read error ID - * |[8] |DET_WR_ERR|1 = Detect write error - * |[9] |DET_RD_ERR|1 = Detect read error - * @var GFX_T::AQIntrAcknowledge - * Offset: 0x10 Interrupt acknowledge register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |INTR_VEC |Interrupt Vector - * | | |Each bit represents a corresponding event being triggered. - * | | |Reading from this register clears the outstanding interrupt. - * | | |For each interrupt event, 0=Clear, 1=Interrupt Active. - * | | |INTR_VEC[31] is AXI_BUS_ERROR, 0 = No Error. - * @var GFX_T::AQIntrEnbl - * Offset: 0x14 Interrupt enable register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |INTR_ENBL_VEC|Interrupt enable - * | | |Each bit enables a corresponding event. - * @var GFX_T::GCChipRev - * Offset: 0x24 Revision register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |REV |Revision - * @var GFX_T::GCChipDate - * Offset: 0x28 Release date register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATE |Date (YYYY/MM/DD) - * @var GFX_T::gcTotalCycles - * Offset: 0x78 Total cycles register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CYCLES |Total cycles - * | | |This register is a free running counter. - * | | |It can be reset by writing 0 to it. - * @var GFX_T::gcregHIChipPatchRev - * Offset: 0x98 Patch revision level register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PATCH_REV |Patch revision level for the chip. - * @var GFX_T::gcProductId - * Offset: 0xA8 Product ID register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |GRADE_LEVEL|Grade Level - * | | |0 = None-no extra letter on the product name;. - * | | |2 = L-Lite. - * | | |3 = UL-Ultra Lite. - * |[23:4] |NUM |Product Number - * | | |520 for this core. - * |[27:24] |TYPE |Core Type - * | | |0 = GC (2D or 3D Graphics Cores). - * @var GFX_T::gcModulePowerControls - * Offset: 0x100 Control register for module level power - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ENABLE_MODULE_CLOCK_GATING|Enables module level clock gating. - * |[1] |DISABLE_STALL_MODULE_CLOCK_GATING|Disables module level clock gating for stall condition. - * |[2] |DISABLE_STARVE_MODULE_CLOCK_GATING|Disables module level clock gating for starve/idle condition. - * @var GFX_T::gcregMMUControl - * Offset: 0x18C MMU Control register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ENABLE |Enable the MMU - * | | |For security reasons, once the MMU is enabled it cannot be disabled anymore. - * | | |1 = enable. - * @var GFX_T::AQMemoryDebug - * Offset: 0x414 Memory debug register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MAX_OUTSTANDING_READS|Limits the total number of outstanding read requests. - * @var GFX_T::AQRegisterTImingControl - * Offset: 0x42C SRAM timing control register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |FOR_RF1P |For 1 port RAM - * |[15:8] |FOR_RF2P |For 2 port RAM - * |[17:16] |FAST_RTC |RTC for fast RAMs - * |[19:18] |FAST_WTC |WTC for fast RAMs - * |[20] |POWER_DOW |Power down - * |[21] |DEEP_SLEEP|Deep sleep - * |[22] |LIGHT_SLEEP|Light sleep - * @var GFX_T::AQCmdBufferAddr - * Offset: 0x654 Command buffer base address register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRESS |Base address for the command buffer - * | | |The address must be 64-bit alignment and it is always physical. - * | | |To check the value of the current fetch address use AQFEDebugCurCmdAdr register. - * | | |Since this is a write only register is has no reset value. - * @var GFX_T::AQCmdBufferCtrl - * Offset: 0x658 Command buffer control register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PREFETCH |Prefetch (write only) - * | | |Number of 64-bit words to fetch from the command buffer. - * |[16] |ENABLE |Enable - * | | |Enable the command parser. - * @var GFX_T::AQFEDebugCurCmdAdr - * Offset: 0x664 Command decoder address register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CUR_CMD_ADR|This is the command decoder address - * | | |The address is always physical so the MSB should always be 0. - * | | |Note that with the current MMU all 32 bits are valid. - * | | |It has no reset value. - */ - __IO uint32_t AQHiClockControl; /*!< [0x0000] Clock control register */ - __I uint32_t AQHiIdle; /*!< [0x0004] Idle status register */ - __IO uint32_t AQAxiConfig; /*!< [0x0008] AXI configuration register */ - __I uint32_t AQAxiStatus; /*!< [0x000c] AXI status register */ - __I uint32_t AQIntrAcknowledge; /*!< [0x0010] Interrupt acknowledge register */ - __IO uint32_t AQIntrEnbl; /*!< [0x0014] Interrupt enable register */ - __I uint32_t RESERVE0[3]; - __I uint32_t GCChipRev; /*!< [0x0024] Revision register */ - __I uint32_t GCChipDate; /*!< [0x0028] Release date register */ - __I uint32_t RESERVE1[19]; - __IO uint32_t gcTotalCycles; /*!< [0x0078] Total cycles register */ - __I uint32_t RESERVE2[7]; - __I uint32_t gcregHIChipPatchRev; /*!< [0x0098] Patch revision level register */ - __I uint32_t RESERVE3[3]; - __I uint32_t gcProductId; /*!< [0x00a8] Product ID register */ - __I uint32_t RESERVE4[21]; - __IO uint32_t gcModulePowerControls; /*!< [0x0100] Control register for module level power */ - __I uint32_t RESERVE5[34]; - __O uint32_t gcregMMUControl; /*!< [0x018c] MMU Control register */ - __I uint32_t RESERVE6[161]; - __IO uint32_t AQMemoryDebug; /*!< [0x0414] Memory debug register */ - __I uint32_t RESERVE7[5]; - __IO uint32_t AQRegisterTImingControl; /*!< [0x042c] SRAM timing control register */ - __I uint32_t RESERVE8[137]; - __O uint32_t AQCmdBufferAddr; /*!< [0x0654] Command buffer base address register */ - __IO uint32_t AQCmdBufferCtrl; /*!< [0x0658] Command buffer control register */ - __I uint32_t RESERVE9[2]; - __I uint32_t AQFEDebugCurCmdAdr; /*!< [0x0664] Command decoder address register */ - -} GFX_T; - -/** - @addtogroup GFX_CONST GFX Bit Field Definition - Constant Definitions for GFX Controller -@{ */ - -#define GFX_AQHiClockControl_CLK3D_DIS_Pos (0) /*!< GFX_T::AQHiClockControl: CLK3D_DIS Position*/ -#define GFX_AQHiClockControl_CLK3D_DIS_Msk (0x1ul << GFX_AQHiClockControl_CLK3D_DIS_Pos) /*!< GFX_T::AQHiClockControl: CLK3D_DIS Mask*/ - -#define GFX_AQHiClockControl_CLK2D_DIS_Pos (1) /*!< GFX_T::AQHiClockControl: CLK2D_DIS Position*/ -#define GFX_AQHiClockControl_CLK2D_DIS_Msk (0x1ul << GFX_AQHiClockControl_CLK2D_DIS_Pos) /*!< GFX_T::AQHiClockControl: CLK2D_DIS Mask*/ - -#define GFX_AQHiClockControl_FSCALE_VAL_Pos (2) /*!< GFX_T::AQHiClockControl: FSCALE_VAL Position*/ -#define GFX_AQHiClockControl_FSCALE_VAL_Msk (0x7ful << GFX_AQHiClockControl_FSCALE_VAL_Pos) /*!< GFX_T::AQHiClockControl: FSCALE_VAL Mask*/ - -#define GFX_AQHiClockControl_FSCALE_CMD_LOAD_Pos (9) /*!< GFX_T::AQHiClockControl: FSCALE_CMD_LOAD Position*/ -#define GFX_AQHiClockControl_FSCALE_CMD_LOAD_Msk (0x1ul << GFX_AQHiClockControl_FSCALE_CMD_LOAD_Pos) /*!< GFX_T::AQHiClockControl: FSCALE_CMD_LOAD Mask*/ - -#define GFX_AQHiClockControl_DISABLE_RAM_CLOCK_GATING_Pos (10) /*!< GFX_T::AQHiClockControl: DISABLE_RAM_CLOCK_GATING Position*/ -#define GFX_AQHiClockControl_DISABLE_RAM_CLOCK_GATING_Msk (0x1ul << GFX_AQHiClockControl_DISABLE_RAM_CLOCK_GATING_Pos) /*!< GFX_T::AQHiClockControl: DISABLE_RAM_CLOCK_GATING Mask*/ - -#define GFX_AQHiClockControl_SOFT_RESET_Pos (12) /*!< GFX_T::AQHiClockControl: SOFT_RESET Position*/ -#define GFX_AQHiClockControl_SOFT_RESET_Msk (0x1ul << GFX_AQHiClockControl_SOFT_RESET_Pos) /*!< GFX_T::AQHiClockControl: SOFT_RESET Mask*/ - -#define GFX_AQHiClockControl_IDLE2_D_Pos (17) /*!< GFX_T::AQHiClockControl: IDLE2_D Position*/ -#define GFX_AQHiClockControl_IDLE2_D_Msk (0x1ul << GFX_AQHiClockControl_IDLE2_D_Pos) /*!< GFX_T::AQHiClockControl: IDLE2_D Mask */ - -#define GFX_AQHiClockControl_ISOLATE_GPU_Pos (19) /*!< GFX_T::AQHiClockControl: ISOLATE_GPU Position*/ -#define GFX_AQHiClockControl_ISOLATE_GPU_Msk (0x1ul << GFX_AQHiClockControl_ISOLATE_GPU_Pos) /*!< GFX_T::AQHiClockControl: ISOLATE_GPU Mask*/ - -#define GFX_AQHiIdle_IDLE_FE_Pos (0) /*!< GFX_T::AQHiIdle: IDLE_FE Position */ -#define GFX_AQHiIdle_IDLE_FE_Msk (0x1ul << GFX_AQHiIdle_IDLE_FE_Pos) /*!< GFX_T::AQHiIdle: IDLE_FE Mask */ - -#define GFX_AQHiIdle_IDLE_DE_Pos (1) /*!< GFX_T::AQHiIdle: IDLE_DE Position */ -#define GFX_AQHiIdle_IDLE_DE_Msk (0x1ul << GFX_AQHiIdle_IDLE_DE_Pos) /*!< GFX_T::AQHiIdle: IDLE_DE Mask */ - -#define GFX_AQHiIdle_IDLE_PE_Pos (2) /*!< GFX_T::AQHiIdle: IDLE_PE Position */ -#define GFX_AQHiIdle_IDLE_PE_Msk (0x1ul << GFX_AQHiIdle_IDLE_PE_Pos) /*!< GFX_T::AQHiIdle: IDLE_PE Mask */ - -#define GFX_AQHiIdle_AXI_LP_Pos (31) /*!< GFX_T::AQHiIdle: AXI_LP Position */ -#define GFX_AQHiIdle_AXI_LP_Msk (0x1ul << GFX_AQHiIdle_AXI_LP_Pos) /*!< GFX_T::AQHiIdle: AXI_LP Mask */ - -#define GFX_AQAxiConfig_AWCACHE_Pos (8) /*!< GFX_T::AQAxiConfig: AWCACHE Position */ -#define GFX_AQAxiConfig_AWCACHE_Msk (0xful << GFX_AQAxiConfig_AWCACHE_Pos) /*!< GFX_T::AQAxiConfig: AWCACHE Mask */ - -#define GFX_AQAxiConfig_ARCACHE_Pos (12) /*!< GFX_T::AQAxiConfig: ARCACHE Position */ -#define GFX_AQAxiConfig_ARCACHE_Msk (0xful << GFX_AQAxiConfig_ARCACHE_Pos) /*!< GFX_T::AQAxiConfig: ARCACHE Mask */ - -#define GFX_AQAxiConfig_AXDOMAIN_SHARED_Pos (16) /*!< GFX_T::AQAxiConfig: AXDOMAIN_SHARED Position*/ -#define GFX_AQAxiConfig_AXDOMAIN_SHARED_Msk (0x3ul << GFX_AQAxiConfig_AXDOMAIN_SHARED_Pos) /*!< GFX_T::AQAxiConfig: AXDOMAIN_SHARED Mask*/ - -#define GFX_AQAxiConfig_AXDOMAIN_NON_SHARED_Pos (18) /*!< GFX_T::AQAxiConfig: AXDOMAIN_NON_SHARED Position*/ -#define GFX_AQAxiConfig_AXDOMAIN_NON_SHARED_Msk (0x3ul << GFX_AQAxiConfig_AXDOMAIN_NON_SHARED_Pos) /*!< GFX_T::AQAxiConfig: AXDOMAIN_NON_SHARED Mask*/ - -#define GFX_AQAxiConfig_AXCACHE_OVERRIDE_SHARED_Pos (20) /*!< GFX_T::AQAxiConfig: AXCACHE_OVERRIDE_SHARED Position*/ -#define GFX_AQAxiConfig_AXCACHE_OVERRIDE_SHARED_Msk (0xful << GFX_AQAxiConfig_AXCACHE_OVERRIDE_SHARED_Pos) /*!< GFX_T::AQAxiConfig: AXCACHE_OVERRIDE_SHARED Mask*/ - -#define GFX_AQAxiStatus_WR_ERR_ID_Pos (0) /*!< GFX_T::AQAxiStatus: WR_ERR_ID Position */ -#define GFX_AQAxiStatus_WR_ERR_ID_Msk (0xful << GFX_AQAxiStatus_WR_ERR_ID_Pos) /*!< GFX_T::AQAxiStatus: WR_ERR_ID Mask */ - -#define GFX_AQAxiStatus_RD_ERR_ID_Pos (4) /*!< GFX_T::AQAxiStatus: RD_ERR_ID Position */ -#define GFX_AQAxiStatus_RD_ERR_ID_Msk (0xful << GFX_AQAxiStatus_RD_ERR_ID_Pos) /*!< GFX_T::AQAxiStatus: RD_ERR_ID Mask */ - -#define GFX_AQAxiStatus_DET_WR_ERR_Pos (8) /*!< GFX_T::AQAxiStatus: DET_WR_ERR Position*/ -#define GFX_AQAxiStatus_DET_WR_ERR_Msk (0x1ul << GFX_AQAxiStatus_DET_WR_ERR_Pos) /*!< GFX_T::AQAxiStatus: DET_WR_ERR Mask */ - -#define GFX_AQAxiStatus_DET_RD_ERR_Pos (9) /*!< GFX_T::AQAxiStatus: DET_RD_ERR Position*/ -#define GFX_AQAxiStatus_DET_RD_ERR_Msk (0x1ul << GFX_AQAxiStatus_DET_RD_ERR_Pos) /*!< GFX_T::AQAxiStatus: DET_RD_ERR Mask */ - -#define GFX_AQIntrAcknowledge_INTR_VEC_Pos (0) /*!< GFX_T::AQIntrAcknowledge: INTR_VEC Position*/ -#define GFX_AQIntrAcknowledge_INTR_VEC_Msk (0xfffffffful << GFX_AQIntrAcknowledge_INTR_VEC_Pos) /*!< GFX_T::AQIntrAcknowledge: INTR_VEC Mask*/ - -#define GFX_AQIntrEnbl_INTR_ENBL_VEC_Pos (0) /*!< GFX_T::AQIntrEnbl: INTR_ENBL_VEC Position*/ -#define GFX_AQIntrEnbl_INTR_ENBL_VEC_Msk (0xfffffffful << GFX_AQIntrEnbl_INTR_ENBL_VEC_Pos) /*!< GFX_T::AQIntrEnbl: INTR_ENBL_VEC Mask */ - -#define GFX_GCChipRev_REV_Pos (0) /*!< GFX_T::GCChipRev: REV Position */ -#define GFX_GCChipRev_REV_Msk (0xfffffffful << GFX_GCChipRev_REV_Pos) /*!< GFX_T::GCChipRev: REV Mask */ - -#define GFX_GCChipDate_DATE_Pos (0) /*!< GFX_T::GCChipDate: DATE Position */ -#define GFX_GCChipDate_DATE_Msk (0xfffffffful << GFX_GCChipDate_DATE_Pos) /*!< GFX_T::GCChipDate: DATE Mask */ - -#define GFX_gcTotalCycles_CYCLES_Pos (0) /*!< GFX_T::gcTotalCycles: CYCLES Position */ -#define GFX_gcTotalCycles_CYCLES_Msk (0xfffffffful << GFX_gcTotalCycles_CYCLES_Pos) /*!< GFX_T::gcTotalCycles: CYCLES Mask */ - -#define GFX_gcregHIChipPatchRev_PATCH_REV_Pos (0) /*!< GFX_T::gcregHIChipPatchRev: PATCH_REV Position*/ -#define GFX_gcregHIChipPatchRev_PATCH_REV_Msk (0xfful << GFX_gcregHIChipPatchRev_PATCH_REV_Pos) /*!< GFX_T::gcregHIChipPatchRev: PATCH_REV Mask*/ - -#define GFX_gcProductId_GRADE_LEVEL_Pos (0) /*!< GFX_T::gcProductId: GRADE_LEVEL Position*/ -#define GFX_gcProductId_GRADE_LEVEL_Msk (0xful << GFX_gcProductId_GRADE_LEVEL_Pos) /*!< GFX_T::gcProductId: GRADE_LEVEL Mask */ - -#define GFX_gcProductId_NUM_Pos (4) /*!< GFX_T::gcProductId: NUM Position */ -#define GFX_gcProductId_NUM_Msk (0xffffful << GFX_gcProductId_NUM_Pos) /*!< GFX_T::gcProductId: NUM Mask */ - -#define GFX_gcProductId_TYPE_Pos (24) /*!< GFX_T::gcProductId: TYPE Position */ -#define GFX_gcProductId_TYPE_Msk (0xful << GFX_gcProductId_TYPE_Pos) /*!< GFX_T::gcProductId: TYPE Mask */ - -#define GFX_gcModulePowerControls_ENABLE_MODULE_CLOCK_GATING_Pos (0) /*!< GFX_T::gcModulePowerControls: ENABLE_MODULE_CLOCK_GATING Position*/ -#define GFX_gcModulePowerControls_ENABLE_MODULE_CLOCK_GATING_Msk (0x1ul << GFX_gcModulePowerControls_ENABLE_MODULE_CLOCK_GATING_Pos) /*!< GFX_T::gcModulePowerControls: ENABLE_MODULE_CLOCK_GATING Mask*/ - -#define GFX_gcModulePowerControls_DISABLE_STALL_MODULE_CLOCK_GATING_Pos (1) /*!< GFX_T::gcModulePowerControls: DISABLE_STALL_MODULE_CLOCK_GATING Position*/ -#define GFX_gcModulePowerControls_DISABLE_STALL_MODULE_CLOCK_GATING_Msk (0x1ul << GFX_gcModulePowerControls_DISABLE_STALL_MODULE_CLOCK_GATING_Pos) /*!< GFX_T::gcModulePowerControls: DISABLE_STALL_MODULE_CLOCK_GATING Mask*/ - -#define GFX_gcModulePowerControls_DISABLE_STARVE_MODULE_CLOCK_GATING_Pos (2) /*!< GFX_T::gcModulePowerControls: DISABLE_STARVE_MODULE_CLOCK_GATING Position*/ -#define GFX_gcModulePowerControls_DISABLE_STARVE_MODULE_CLOCK_GATING_Msk (0x1ul << GFX_gcModulePowerControls_DISABLE_STARVE_MODULE_CLOCK_GATING_Pos) /*!< GFX_T::gcModulePowerControls: DISABLE_STARVE_MODULE_CLOCK_GATING Mask*/ - -#define GFX_gcregMMUControl_ENABLE_Pos (0) /*!< GFX_T::gcregMMUControl: ENABLE Position*/ -#define GFX_gcregMMUControl_ENABLE_Msk (0x1ul << GFX_gcregMMUControl_ENABLE_Pos) /*!< GFX_T::gcregMMUControl: ENABLE Mask */ - -#define GFX_AQMemoryDebug_MAX_OUTSTANDING_READS_Pos (0) /*!< GFX_T::AQMemoryDebug: MAX_OUTSTANDING_READS Position*/ -#define GFX_AQMemoryDebug_MAX_OUTSTANDING_READS_Msk (0xfful << GFX_AQMemoryDebug_MAX_OUTSTANDING_READS_Pos) /*!< GFX_T::AQMemoryDebug: MAX_OUTSTANDING_READS Mask*/ - -#define GFX_AQRegisterTImingControl_FOR_RF1P_Pos (0) /*!< GFX_T::AQRegisterTImingControl: FOR_RF1P Position*/ -#define GFX_AQRegisterTImingControl_FOR_RF1P_Msk (0xfful << GFX_AQRegisterTImingControl_FOR_RF1P_Pos) /*!< GFX_T::AQRegisterTImingControl: FOR_RF1P Mask*/ - -#define GFX_AQRegisterTImingControl_FOR_RF2P_Pos (8) /*!< GFX_T::AQRegisterTImingControl: FOR_RF2P Position*/ -#define GFX_AQRegisterTImingControl_FOR_RF2P_Msk (0xfful << GFX_AQRegisterTImingControl_FOR_RF2P_Pos) /*!< GFX_T::AQRegisterTImingControl: FOR_RF2P Mask*/ - -#define GFX_AQRegisterTImingControl_FAST_RTC_Pos (16) /*!< GFX_T::AQRegisterTImingControl: FAST_RTC Position*/ -#define GFX_AQRegisterTImingControl_FAST_RTC_Msk (0x3ul << GFX_AQRegisterTImingControl_FAST_RTC_Pos) /*!< GFX_T::AQRegisterTImingControl: FAST_RTC Mask*/ - -#define GFX_AQRegisterTImingControl_FAST_WTC_Pos (18) /*!< GFX_T::AQRegisterTImingControl: FAST_WTC Position*/ -#define GFX_AQRegisterTImingControl_FAST_WTC_Msk (0x3ul << GFX_AQRegisterTImingControl_FAST_WTC_Pos) /*!< GFX_T::AQRegisterTImingControl: FAST_WTC Mask*/ - -#define GFX_AQRegisterTImingControl_POWER_DOW_Pos (20) /*!< GFX_T::AQRegisterTImingControl: POWER_DOW Position*/ -#define GFX_AQRegisterTImingControl_POWER_DOW_Msk (0x1ul << GFX_AQRegisterTImingControl_POWER_DOW_Pos) /*!< GFX_T::AQRegisterTImingControl: POWER_DOW Mask*/ - -#define GFX_AQRegisterTImingControl_DEEP_SLEEP_Pos (21) /*!< GFX_T::AQRegisterTImingControl: DEEP_SLEEP Position*/ -#define GFX_AQRegisterTImingControl_DEEP_SLEEP_Msk (0x1ul << GFX_AQRegisterTImingControl_DEEP_SLEEP_Pos) /*!< GFX_T::AQRegisterTImingControl: DEEP_SLEEP Mask*/ - -#define GFX_AQRegisterTImingControl_LIGHT_SLEEP_Pos (22) /*!< GFX_T::AQRegisterTImingControl: LIGHT_SLEEP Position*/ -#define GFX_AQRegisterTImingControl_LIGHT_SLEEP_Msk (0x1ul << GFX_AQRegisterTImingControl_LIGHT_SLEEP_Pos) /*!< GFX_T::AQRegisterTImingControl: LIGHT_SLEEP Mask*/ - -#define GFX_AQCmdBufferAddr_ADDRESS_Pos (0) /*!< GFX_T::AQCmdBufferAddr: ADDRESS Position*/ -#define GFX_AQCmdBufferAddr_ADDRESS_Msk (0xfffffffful << GFX_AQCmdBufferAddr_ADDRESS_Pos) /*!< GFX_T::AQCmdBufferAddr: ADDRESS Mask */ - -#define GFX_AQCmdBufferCtrl_PREFETCH_Pos (0) /*!< GFX_T::AQCmdBufferCtrl: PREFETCH Position*/ -#define GFX_AQCmdBufferCtrl_PREFETCH_Msk (0xfffful << GFX_AQCmdBufferCtrl_PREFETCH_Pos) /*!< GFX_T::AQCmdBufferCtrl: PREFETCH Mask */ - -#define GFX_AQCmdBufferCtrl_ENABLE_Pos (16) /*!< GFX_T::AQCmdBufferCtrl: ENABLE Position*/ -#define GFX_AQCmdBufferCtrl_ENABLE_Msk (0x1ul << GFX_AQCmdBufferCtrl_ENABLE_Pos) /*!< GFX_T::AQCmdBufferCtrl: ENABLE Mask */ - -#define GFX_AQFEDebugCurCmdAdr_CUR_CMD_ADR_Pos (4) /*!< GFX_T::AQFEDebugCurCmdAdr: CUR_CMD_ADR Position*/ -#define GFX_AQFEDebugCurCmdAdr_CUR_CMD_ADR_Msk (0xffffffful << GFX_AQFEDebugCurCmdAdr_CUR_CMD_ADR_Pos) /*!< GFX_T::AQFEDebugCurCmdAdr: CUR_CMD_ADR Mask*/ - -/**@}*/ /* GFX_CONST */ -/**@}*/ /* end of GFX register group */ - -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __GFX_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gmac_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gmac_reg.h deleted file mode 100644 index c307da4635f..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gmac_reg.h +++ /dev/null @@ -1,2606 +0,0 @@ -/**************************************************************************//** - * @file gmac_reg.h - * @brief GMAC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __GAMAC_REG_H__ -#define __GMAC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ -/** - @addtogroup GMAC Gigabit Ethernet MAC (GMAC) - Memory Mapped Structure for GMAC Controller -@{ */ - -typedef struct -{ - - /** - * @var GMAC_T::MACCFG - * Offset: 0x00 Register 0 (MAC Configuration Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PRELEN |Preamble Length for Transmit Frames - * | | |These bits control the number of preamble bytes that are added to the beginning of every Transmit frame - * | | |The preamble reduction occurs only when the MAC is operating in the full-duplex mode. - * | | |2'b00: 7 bytes of preamble - * | | |2'b01: 5 byte of preamble - * | | |2'b10: 3 bytes of preamble - * | | |2'b11: reserved - * |[2] |RE |Receiver Enable - * | | |When this bit is set, the receiver state machine of the MAC is enabled for receiving frames from the GMII or MII - * | | |When this bit is reset, the MAC receive state machine is disabled after the completion of the reception of the current frame, and does not receive any further frames from the GMII or MII. - * |[3] |TE |Transmitter Enable - * | | |When this bit is set, the transmit state machine of the MAC is enabled for transmission on the GMII or MII - * | | |When this bit is reset, the MAC transmit state machine is disabled after the completion of the transmission of the current frame, and does not transmit any further frames. - * |[4] |DC |Deferral Check - * | | |When this bit is set, the deferral check function is enabled in the MAC - * | | |The MAC issues a Frame Abort status, along with the excessive deferral error bit set in the transmit frame status, when the transmit state machine is deferred for more than 24,288 bit times in the 10 or 100 Mbps mode. - * | | |If the MAC is configured for 1000 Mbps operation or if the Jumbo frame mode is enabled in the 10 or 100 Mbps mode, the threshold for deferral is 155,680 bits times - * | | |Deferral begins when the transmitter is ready to transmit, but it is prevented because of an active carrier sense signal (CRS) on GMII or MII. - * | | |The defer time is not cumulative - * | | |For example, if the transmitter defers for 10,000 bit times because the CRS signal is active and then the CRS signal becomes inactive, the transmitter transmits and collision happens - * | | |Because of collision, the transmitter needs to back off and then defer again after back off completion - * | | |In such a scenario, the deferral timer is reset to 0 and it is restarted - * | | |When this bit is reset, the deferral check function is disabled and the MAC defers until the CRS signal goes inactive - * | | |This bit is applicable only in the half-duplex mode. - * |[6:5] |BL |Back-Off Limit - * | | |The Back-Off limit determines the random integer number (r) of slot time delays (4,096 bit times for 1000 Mbps and 512 bit times for 10/100 Mbps) for which the MAC waits before rescheduling a transmission attempt during retries after a collision - * | | |This bit is applicable only in the half-duplex mode. - * | | |00: k = min (n, 10) - * | | |01: k = min (n, 8) - * | | |10: k = min (n, 4) - * | | |11: k = min (n, 1) - * | | |where n = retransmission attempt - * | | |The random integer r takes the value in the range 0 <= r < kth power of 2 - * |[7] |ACS |Automatic Pad or CRC Stripping - * | | |When this bit is set, the MAC strips the Pad or FCS field on the incoming frames only if the value of the length field is less than 1,536 bytes - * | | |All received frames with length field greater than or equal to 1,536 bytes are passed to the application without stripping the Pad or FCS field. - * | | |When this bit is reset, the MAC passes all incoming frames, without modifying them, to the Host. - * |[8] |LUD |Link Up or Down - * | | |This bit indicates whether the link is up or down during the transmission of configuration in the RGMII interface: - * | | |0: Link Down - * | | |1: Link Up - * |[9] |DR |Disable Retry - * | | |When this bit is set, the MAC attempts only one transmission - * | | |When a collision occurs on the GMII or MII interface, the MAC ignores the current frame transmission and reports a Frame Abort with excessive collision error in the transmit frame status. - * | | |When this bit is reset, the MAC attempts retries based on the settings of the BL field (Bits [6:5]) - * | | |This bit is applicable only in the half-duplex mode. - * |[10] |IPC |Checksum Offload - * | | |When this bit is set, the MAC calculates the 16-bit one's complement of the one's complement sum of all received Ethernet frame payloads - * | | |It also checks whether the IPv4 Header checksum (assumed to be bytes 2526 or 2930 (VLAN-tagged) of the received Ethernet frame) is correct for the received frame and gives the status in the receive status word - * | | |The MAC also appends the 16-bit checksum calculated for the IP header datagram payload (bytes after the IPv4 header) and appends it to the Ethernet frame transferred to the application (when Type 2 COE is deselected). - * | | |When this bit is reset, this function is disabled. - * | | |When Type 2 COE is selected, this bit, when set, enables the IPv4 header checksum checking and IPv4 or IPv6 TCP, UDP, or ICMP payload checksum checking - * | | |When this bit is reset, the COE function in the receiver is disabled and the corresponding PCE and IP HCE status bits are always cleared. - * |[11] |DM |Duplex Mode - * | | |When this bit is set, the MAC operates in the full-duplex mode where it can transmit and receive simultaneously - * |[12] |LM |Loopback Mode - * | | |When this bit is set, the MAC operates in the loopback mode at GMII or MII - * | | |The (G)MII Receive clock input (clk_rx_i) is required for the loopback to work properly, because the Transmit clock is not looped-back internally. - * |[13] |DO |Disable Receive Own - * | | |When this bit is set, the MAC disables the reception of frames when the phy_txen_o is asserted in the half-duplex mode - * | | |When this bit is reset, the MAC receives all packets that are given by the PHY while transmitting - * | | |This bit is not applicable if the MAC is operating in the full-duplex mode - * |[14] |FES |Speed - * | | |This bit selects the speed in the RMII or RGMII interface - * | | |0: 10 Mbps - * | | |1: 100 Mbps - * |[15] |PS |Port Select - * | | |This bit selects the Ethernet line speed: - * | | |0: For 1000 Mbps operations - * | | |1: For 10 or 100 Mbps operations - * | | |In 10 or 100 Mbps operations, this bit, along with FES bit, selects the exact line speed - * | | |The mac_portselect_o signal reflects the value of this bit. - * |[16] |DCRS |Disable Carrier Sense During Transmission - * | | |When set high, this bit makes the MAC transmitter ignore the (G)MII CRS signal during frame transmission in the half-duplex mode - * | | |This request results in no errors generated because of Loss of Carrier or No Carrier during such transmission - * | | |When this bit is low, the MAC transmitter generates such errors because of Carrier Sense and can even abort the transmissions - * |[19:17] |IFG |Inter-Frame Gap - * | | |These bits control the minimum IFG between frames during transmission. - * | | |000: 96 bit times - * | | |001: 88 bit times - * | | |010: 80 bit times - * | | |... - * | | |111: 40 bit times - * | | |In the half-duplex mode, the minimum IFG can be configured only for 64 bit times (IFG = 100) - * | | |Lower values are not considered - * | | |In the 1000-Mbps mode, the minimum IFG supported is 80 bit times (and above). - * |[20] |JE |Jumbo Frame Enable - * | | |When this bit is set, the MAC allows Jumbo frames of 9,018 bytes (9,022 bytes for VLAN tagged frames) without reporting a giant frame error in the receive frame status. - * |[21] |BE |Frame Burst Enable - * | | |When this bit is set, the MAC allows frame bursting during transmission in the GMII half-duplex mode. - * |[22] |JD |Jabber Disable - * | | |When this bit is set, the MAC disables the jabber timer on the transmitter - * | | |The MAC can transfer frames of up to 16,384 bytes - * | | |When this bit is reset, the MAC cuts off the transmitter if the application sends out more than 2,048 bytes of data (10,240 if JE is set high) during transmission. - * |[23] |WD |Watchdog Disable - * | | |When this bit is set, the MAC disables the watchdog timer on the receiver - * | | |The MAC can receive frames of up to 16,384 bytes - * | | |When this bit is reset, the MAC does not allow a receive frame which more than 2,048 bytes (10,240 if JE is set high) or the value programmed in Register 55 (Watchdog Timeout Register). - * | | |The MAC cuts off any bytes received after the watchdog limit number of bytes. - * |[24] |TC |Transmit Configuration in RGMII - * | | |When set, this bit enables the transmission of duplex mode, link speed, and link up or down information to the PHY in the RGMII port - * | | |When this bit is reset, no such information is driven to the PHY - * |[25] |CST |CRC Stripping for Type Frames - * | | |When this bit is set, the last 4 bytes (FCS) of all frames of Ether type (Length/Type field greater than or equal to 1,536) are stripped and dropped before forwarding the frame to the application - * | | |This function is not valid when the IP Checksum Engine (Type 1) is enabled in the MAC receiver - * | | |This function is valid when Type 2 Checksum Offload Engine is enabled. - * |[27] |TWOKPE |IEEE 802.3as Support for 2K Packets - * | | |When set, the MAC considers all frames, with up to 2,000 bytes length, as normal packets - * | | |When Bit 20 (JE) is not set, the MAC considers all received frames of size more than 2 Kbytes as Giant frames - * | | |When this bit is reset and Bit 20 (JE) is not set, the MAC considers all received frames of size more than 1,518 bytes (1,522 bytes for tagged) as Giant frames - * | | |When Bit 20 is set, setting this bit has no effect on Giant Frame status. - * |[30:28] |SARC |Source Address Insertion or Replacement Control - * | | |This field controls the source address insertion or replacement for all transmitted frames - * | | |Bit 30 specifies which MAC Address register (0 or 1) is used for source address insertion or replacement based on the values of Bits [29:28]: - * | | |* 2'b0x: The input signals mti_sa_ctrl_i and ati_sa_ctrl_i control the SA field generation. * 2'b10: - * | | |If Bit 30 is set to 0, the MAC inserts the content of the MAC Address 0 registers (registers 16 and 17) in the SA field of all transmitted frames. - * | | |If Bit 30 is set to 1, the MAC inserts the content of the MAC Address 1 registers (registers 18 and 19) in the SA field of all transmitted frames. - * | | |* 2'b11: - * | | |If Bit 30 is set to 0, the MAC replaces the content of the MAC Address 0 registers (registers 16 and 17) in the SA field of all transmitted frames. - * | | |If Bit 30 is set to 1, the MAC replaces the content of the MAC Address 1 registers (registers 18 and 19) in the SA field of all transmitted frames. - * | | |Note: - * | | |Changes to this field take effect only on the start of a frame - * | | |If you write this register field when a frame is being transmitted, only the subsequent frame can use the updated value, that is, the current frame does not use the updated value - * @var GMAC_T::MACFRMFLTR - * Offset: 0x04 Register 1 (MAC Frame Filter) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PR |Promiscuous Mode - * | | |When this bit is set, the Address Filter module passes all incoming frames regardless of its destination or source address - * | | |The SA or DA Filter Fails status bits of the Receive Status Word are always cleared when PR is set. - * |[3] |DAIF |DA Inverse Filtering - * | | |When this bit is set, the Address Check block operates in inverse filtering mode for the DA address comparison for both unicast and multicast frames. - * | | |When reset, normal filtering of frames is performed. - * |[4] |PM |Pass All Multicast - * | | |When set, this bit indicates that all received frames with a multicast destination address (first bit in the destination address field is '1') are passed. - * | | |When reset, filtering of multicast frame depends on HMC bit. - * |[5] |DBF |Disable Broadcast Frames - * | | |When this bit is set, the AFM module filters all incoming broadcast frames - * | | |In addition, it overrides all other filter settings. - * | | |When this bit is reset, the AFM module passes all received broadcast frames. - * |[7:6] |PCF |Pass Control Frames - * | | |These bits control the forwarding of all control frames (including unicast and multicast PAUSE frames). - * | | |00: MAC filters all control frames from reaching the application. - * | | |01: MAC forwards all control frames except PAUSE control frames to application even if they fail the Address filter. - * | | |10: MAC forwards all control frames to application even if they fail the Address Filter. - * | | |11: MAC forwards control frames that pass the Address Filter. - * | | |The following conditions should be true for the PAUSE control frames processing: - * | | |Condition 1: The MAC is in the full-duplex mode and flow control is enabled by setting Bit 2 (RFE) of Register 6 (Flow Control Register) to 1. - * | | |Condition 2: The destination address (DA) of the received frame matches the special multicast address or the MAC Address 0 when Bit 3 (UP) of the Register 6 (Flow Control Register) is set. - * | | |Condition 3: The Type field of the received frame is 0x8808 and the OPCODE field is 0x0001. - * | | |Note: - * | | |This field should be set to 01 only when the Condition 1 is true, that is, the MAC is programmed to operate in the full-duplex mode and the RFE bit is enabled - * | | |Otherwise, the PAUSE frame filtering may be inconsistent - * | | |When Condition 1 is false, the PAUSE frames are considered as generic control frames - * | | |Therefore, to pass all control frames (including PAUSE control frames) when the full-duplex mode and flow control is not enabled, you should set the PCF field to 10 or 11 (as required by the application). - * |[8] |SAIF |SA Inverse Filtering - * | | |When this bit is set, the Address Check block operates in inverse filtering mode for the SA address comparison - * | | |The frames whose SA matches the SA registers are marked as failing the SA Address filter. - * | | |When this bit is reset, frames whose SA does not match the SA registers are marked as failing the SA Address filter. - * |[9] |SAF |Source Address Filter Enable - * | | |When this bit is set, the MAC compares the SA field of the received frames with the values programmed in the enabled SA registers - * | | |If the comparison fails, the MAC drops the frame - * | | |When this bit is reset, the MAC forwards the received frame to the application with updated SAF bit of the Rx Status depending on the SA address comparison. - * | | |Note: According to the IEEE specification, Bit 47 of the SA is reserved and set to 0 - * | | |However, in GMAC, the MAC compares all 48 bits - * | | |The software driver should take this into consideration while programming the MAC address registers for SA. - * |[16] |VTFE |VLAN Tag Filter Enable - * | | |When set, this bit enables the MAC to drop VLAN tagged frames that do not match the VLAN Tag comparison. - * | | |When reset, the MAC forwards all frames irrespective of the match status of the VLAN Tag. - * |[31] |RA |Receive All - * | | |When this bit is set, the MAC Receiver module passes all received frames, irrespective of whether they pass the address filter or not, to the Application - * | | |The result of the SA or DA filtering is updated (pass or fail) in the corresponding bits in the Receive Status Word. - * | | |When this bit is reset, the Receiver module passes only those frames to the Application that pass the SA or DA address filter. - * @var GMAC_T::GMIIADDR - * Offset: 0x10 Register 4 (GMII Address Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GB |GMII Busy - * | | |This bit should read logic 0 before writing to Register 4 and Register 5 - * | | |During a PHY register access, the software sets this bit to 1'b1 to indicate that a Read or Write access is in progress. - * | | |Register 5 is invalid until this bit is cleared by the MAC - * | | |Therefore, Register 5 (GMII Data) should be kept valid until the MAC clears this bit during a PHY Write operation - * | | |Similarly for a read operation, the contents of Register 5 are not valid until this bit is cleared. - * | | |The subsequent read or write operation should happen only after the previous operation is complete - * | | |Because there is no acknowledgment from the PHY to MAC after a read or write operation is completed, there is no change in the functionality of this bit even when the PHY is not present. - * |[1] |GW |GMII Write - * | | |When set, this bit indicates to the PHY that this is a Write operation using the GMII Data register - * | | |If this bit is not set, it indicates that this is a Read operation, that is, placing the data in the GMII Data register. - * |[5:2] |CR |CSR Clock Range - * | | |The CSR Clock Range selection determines the frequency of the MDC clock according to the CSR clock frequency used in your design - * | | |The suggested range of CSR clock frequency applicable for each value (when Bit[5] = 0) ensures that the MDC clock is approximately between the frequency range 1.0 MHz - 2.5 MHz. - * | | |0000: The frequency of the CSR clock is 60-100 MHz and the MDC clock is CSR clock/42. - * | | |0001: The frequency of the CSR clock is 100-150 MHz and the MDC clock is CSR clock/62. - * | | |0010: The frequency of the CSR clock is 20-35 MHz and the MDC clock is CSR clock/16. - * | | |0011: The frequency of the CSR clock is 35-60 MHz and the MDC clock is CSR clock/26. - * | | |0100: The frequency of the CSR clock is 150-250 MHz and the MDC clock is CSR clock/102. - * | | |0100: The frequency of the CSR clock is 250-300 MHz and the MDC clock is CSR clock/124. - * | | |0110 and 0111: Reserved - * | | |When Bit 5 is set, you can achieve MDC clock of frequency higher than the IEEE 802.3 specified frequency limit of 2.5 MHz and program a clock divider of lower value - * | | |For example, when CSR clock is of 100 MHz frequency and you program these bits as 1010, then the resultant MDC clock is of 12.5 MHz which is outside the limit of IEEE 802.3 specified range. - * | | |Program the following values only if the interfacing chips support faster MDC clocks: - * | | |1000: CSR clock/4 - * | | |1001: CSR clock/6 - * | | |1010: CSR clock/8 - * | | |1011: CSR clock/10 - * | | |1100: CSR clock/12 - * | | |1101: CSR clock/14 - * | | |1110: CSR clock/16 - * | | |1111: CSR clock/18 - * |[10:6] |GR |GMII Register - * | | |These bits select the desired GMII register in the selected PHY device. - * |[15:11] |PA |Physical Layer Address - * | | |This field indicates which of the 32 possible PHY devices are being accessed. - * @var GMAC_T::GMIIDATA - * Offset: 0x14 Register 5 (GMII Data Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |GD |GMII Data - * | | |This field contains the 16-bit data value read from the PHY after a Management Read operation or the 16-bit data value to be written to the PHY before a Management Write operation. - * @var GMAC_T::FLOWCTL - * Offset: 0x18 Register 6 (Flow Control Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FCA_BPA |Flow Control Busy or Backpressure Activate - * | | |This bit initiates a Pause Control frame in the full-duplex mode and activates the backpressure function in the half-duplex mode if the TFE bit is set. - * | | |In the full-duplex mode, this bit should be read as 1'b0 before writing to the Flow Control register - * | | |To initiate a Pause control frame, the Application must set this bit to 1'b1 - * | | |During a transfer of the Control Frame, this bit continues to be set to signify that a frame transmission is in progress - * | | |After the completion of Pause control frame transmission, the MAC resets this bit to 1'b0 - * | | |The Flow Control register should not be written to until this bit is cleared. - * | | |In the half-duplex mode, when this bit is set (and TFE is set), then backpressure is asserted by the MAC - * | | |During backpressure, when the MAC receives a new frame, the transmitter starts sending a JAM pattern resulting in a collision - * | | |This control register bit is logically ORed with the mti_flowctrl_i input signal for the backpressure function - * | | |When the MAC is configured for the full-duplex mode, the BPA is automatically disabled. - * |[1] |TFE |Transmit Flow Control Enable - * | | |In the full-duplex mode, when this bit is set, the MAC enables the flow control operation to transmit Pause frames - * | | |When this bit is reset, the flow control operation in the MAC is disabled, and the MAC does not transmit any Pause frames. - * | | |In half-duplex mode, when this bit is set, the MAC enables the back-pressure operation - * | | |When this bit is reset, the back-pressure feature is disabled. - * |[2] |RFE |Receive Flow Control Enable - * | | |When this bit is set, the MAC decodes the received Pause frame and disables its transmitter for a specified (Pause) time - * | | |When this bit is reset, the decode function of the Pause frame is disabled. - * |[3] |UP |Unicast Pause Frame Detect - * | | |A pause frame is processed when it has the unique multicast address specified in the IEEE Std 802.3 - * | | |When this bit is set, the MAC can also detect Pause frames with unicast address of the station - * | | |This unicast address should be as specified in the MAC Address0 High Register and MAC Address0 Low Register. - * | | |When this bit is reset, the MAC only detects Pause frames with unique multicast address. - * | | |Note: The MAC does not process a Pause frame if the multicast address of received frame is different from the unique multicast address. - * |[5:4] |PLT |Pause Low Threshold - * | | |This field configures the threshold of the PAUSE timer at which the input flow control signal mti_flowctrl_i (or sbd_flowctrl_i) is checked for automatic retransmission of PAUSE Frame. - * | | |The threshold values should be always less than the Pause Time configured in Bits[31:16] - * | | |For example, if PT = 100H (256 slot-times), and PLT = 01, then a second PAUSE frame is automatically transmitted if the mti_flowctrl_i signal is asserted at 228 (256 - 28) slot times after the first PAUSE frame is transmitted. - * | | |The following list provides the threshold values for different values: - * | | |00: The threshold is Pause time minus 4 slot times (PT - 4 slot times). - * | | |01: The threshold is Pause time minus 28 slot times (PT - 28 slot times). - * | | |10: The threshold is Pause time minus 144 slot times (PT - 144 slot times). - * | | |11: The threshold is Pause time minus 256 slot times (PT - 256 slot times). - * | | |The slot time is defined as the time taken to transmit 512 bits (64 bytes) on the GMII or MII interface. - * |[7] |DZPQ |Disable Zero-Quanta Pause - * | | |When this bit is set, it disables the automatic generation of the Zero-Quanta Pause Control frames on the de-assertion of the flow-control signal from the FIFO layer (MTL or external sideband flow control signal sbd_flowctrl_i/mti_flowctrl_i) - * | | |When this bit is reset, normal operation with automatic Zero-Quanta Pause Control frame generation is enabled. - * |[31:16] |PT |Pause Time - * | | |This field holds the value to be used in the Pause Time field in the transmit control frame - * | | |Consecutive writes to this register should be performed only after at least four clock cycles in the destination clock domain. - * @var GMAC_T::VLANTAG - * Offset: 0x1C Register 7 (VLAN Tag Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |VL |VLAN Tag Identifier for Receive Frames - * | | |This field contains the 802.1Q VLAN tag to identify the VLAN frames and is compared to the 15th and 16th bytes of the frames being received for VLAN frames - * | | |The following list describes the bits of this field: - * | | |Bits [15:13]: User Priority - * | | |Bit 12: Canonical Format Indicator (CFI) or Drop Eligible Indicator (DEI) - * | | |Bits[11:0]: VLAN tag's VLAN Identifier (VID) field - * | | |When the ETV bit is set, only the VID (Bits[11:0]) is used for comparison - * | | |If VL (VL[11:0] if ETV is set) is all zeros, the MAC does not check the fifteenth and 16th bytes for VLAN tag comparison, and declares all frames with a Type field value of 0x8100 or 0x88a8 as VLAN frames. - * |[16] |ETV |Enable 12-Bit VLAN Tag Comparison - * | | |When this bit is set, a 12-bit VLAN identifier is used for comparing and filtering instead of the complete 16-bit VLAN tag - * | | |Bits [11:0] of VLAN tag are compared with the corresponding field in the received VLAN-tagged frame - * | | |Similarly, when enabled, only 12 bits of the VLAN tag in the received frame are used for hash-based VLAN filtering. - * | | |When this bit is reset, all 16 bits of the 15th and 16th bytes of the received VLAN frame are used for comparison and VLAN hash filtering. - * |[17] |VTIM |VLAN Tag Inverse Match Enable - * | | |When set, this bit enables the VLAN Tag inverse matching - * | | |The frames that do not have matching VLAN Tag are marked as matched. - * | | |When reset, this bit enables the VLAN Tag perfect matching - * | | |The frames with matched VLAN Tag are marked as matched. - * |[18] |ESVL |Enable S-VLAN - * | | |When this bit is set, the MAC transmitter and receiver also consider the S-VLAN (Type = 0x88A8) frames as valid VLAN tagged frames. - * @var GMAC_T::VERSION - * Offset: 0x20 Register 8 (Version Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var GMAC_T::REGDEBUG - * Offset: 0x24 Register 9 (Debug Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RPESTS |MAC GMII or MII Receive Protocol Engine Status - * | | |When high, this bit indicates that the MAC GMII or MII receive protocol engine is actively receiving data and not in IDLE state. - * |[2:1] |RFCFCSTS |MAC Receive Frame Controller FIFO Status - * | | |When high, this field indicates the active state of the small FIFO Read and Write controllers of the MAC Receive Frame Controller Module. - * |[4] |RWCSTS |MTL Rx FIFO Write Controller Active Status - * | | |When high, this bit indicates that the MTL Rx FIFO Write Controller is active and is transferring a received frame to the FIFO. - * |[6:5] |RRCSTS |MTL Rx FIFO Read Controller State - * | | |This field gives the state of the Rx FIFO read Controller: - * | | |00: IDLE state - * | | |01: Reading frame data - * | | |10: Reading frame status (or timestamp) - * | | |11: Flushing the frame data and status - * |[9:8] |RXFSTS |MTL Rx FIFO Fill-level Status - * | | |This field gives the status of the fill-level of the Rx FIFO: - * | | |00: Rx FIFO Empty - * | | |01: Rx FIFO fill level is below the flow-control deactivate threshold - * | | |10: Rx FIFO fill level is above the flow-control activate threshold - * | | |11: Rx FIFO Full - * |[16] |TPESTS |MAC GMII or MII Transmit Protocol Engine Status - * | | |When high, this bit indicates that the MAC GMII or MII transmit protocol engine is actively transmitting data and is not in the IDLE state. - * |[18:17] |TFCSTS |MAC Transmit Frame Controller Status - * | | |This field indicates the state of the MAC Transmit Frame Controller module: - * | | |00: IDLE state - * | | |01: Waiting for Status of previous frame or IFG or back off period to be over - * | | |10: Generating and transmitting a PAUSE control frame (in the full-duplex mode) - * | | |11: Transferring input frame for transmission - * |[19] |TXPAUSED |MAC transmitter in PAUSE - * | | |When high, this bit indicates that the MAC transmitter is in the PAUSE condition (in the full-duplex only mode) and hence does not schedule any frame for transmission. - * |[21:20] |TRCSTS |MTL Tx FIFO Read Controller Status - * | | |This field indicates the state of the Tx FIFO Read Controller: - * | | |00: IDLE state - * | | |01: READ state (transferring data to MAC transmitter) - * | | |10: Waiting for TxStatus from MAC transmitter - * | | |11: Writing the received TxStatus or flushing the Tx FIFO - * |[22] |TWCSTS |MTL Tx FIFO Write Controller Active Status - * | | |When high, this bit indicates that the MTL Tx FIFO Write Controller is active and transferring data to the Tx FIFO. - * |[24] |TXFSTS |MTL Tx FIFO Not Empty Status - * | | |When high, this bit indicates that the MTL Tx FIFO is not empty and some data is left for transmission. - * |[25] |TXSTSFSTS |MTL TxStatus FIFO Full Status - * | | |When high, this bit indicates that the MTL TxStatus FIFO is full - * | | |Therefore, the MTL cannot accept any more frames for transmission. - * @var GMAC_T::PMTCTLSTS - * Offset: 0x2C Register 11 (PMT Control and Status Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWRDWN |Power Down - * | | |When set, the MAC receiver drops all received frames until it receives the expected magic packet or wake-up frame - * | | |This bit is then self-cleared and the power-down mode is disabled - * | | |The Software can also clear this bit before the expected magic packet or wake-up frame is received - * | | |The frames, received by the MAC after this bit is cleared, are forwarded to the application - * | | |This bit must only be set when the Magic Packet Enable, Global Unicast, or Wake-Up Frame Enable bit is set high. - * | | |Note: You can gate-off the CSR clock during the power-down mode - * | | |However, when the CSR clock is gated-off, you cannot perform any read or write operations on this register - * | | |Therefore, the Software cannot clear this bit. - * |[1] |MGKPKTEN |Magic Packet Enable - * | | |When set, enables generation of a power management event because of magic packet reception. - * |[5] |MGKPRCVD |Magic Packet Received (read only) - * | | |When set, this bit indicates that the power management event is generated because of the reception of a magic packet - * | | |This bit is cleared by a Read into this register. - * @var GMAC_T::LPICTLSTS - * Offset: 0x30 Register 12 (LPI Control and Status Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TLPIEN |Transmit LPI Entry (read only) - * | | |When set, this bit indicates that the MAC Transmitter has entered the LPI state because of the setting of the LPIEN bit - * | | |This bit is cleared by a read into this register. - * |[1] |TLPIEX |Transmit LPI Exit (read only) - * | | |When set, this bit indicates that the MAC transmitter has exited the LPI state after the user has cleared the LPIEN bit and the LPI TW Timer has expired - * | | |This bit is cleared by a read into this register. - * |[2] |RLPIEN |Receive LPI Entry (read only) - * | | |When set, this bit indicates that the MAC Receiver has received an LPI pattern and entered the LPI state - * | | |This bit is cleared by a read into this register. - * | | |Note: This bit may not get set if the MAC stops receiving the LPI pattern for a very short duration, such as, less than 3 clock cycles of CSR clock. - * |[3] |RLPIEX |Receive LPI Exit (read only) - * | | |When set, this bit indicates that the MAC Receiver has stopped receiving the LPI pattern on the GMII or MII interface, exited the LPI state, and resumed the normal reception - * | | |This bit is cleared by a read into this register. - * | | |Note: This bit may not get set if the MAC stops receiving the LPI pattern for a very short duration, such as, less than 3 clock cycles of CSR clock. - * |[8] |TLPIST |Transmit LPI State (read only) - * | | |When set, this bit indicates that the MAC is transmitting the LPI pattern on the GMII or MII interface. - * |[9] |RLPIST |Receive LPI State (read only) - * | | |When set, this bit indicates that the MAC is receiving the LPI pattern on the GMII or MII interface. - * |[16] |LPIEN |LPI Enable - * | | |When set, this bit instructs the MAC Transmitter to enter the LPI state - * | | |When reset, this bit instructs the MAC to exit the LPI state and resume normal transmission. - * | | |This bit is cleared when the LPITXA bit is set and the MAC exits the LPI state because of the arrival of a new packet for transmission. - * |[17] |PLS |PHY Link Status - * | | |This bit indicates the link status of the PHY - * | | |The MAC Transmitter asserts the LPI pattern only when the link status is up (okay) at least for the time indicated by the LPI LS TIMER - * | | |When set, the link is considered to be okay (up) and when reset, the link is considered to be down. - * |[18] |PLSEN |PHY Link Status Enable - * | | |This bit enables the link status received on the RGMII receive paths to be used for activating the LPI LS TIMER. - * | | |When set, the MAC uses the link-status bits of Register 54 (RGMII Status Register) and Bit 17 (PLS) for the LPI LS Timer trigger - * | | |When cleared, the MAC ignores the link-status bits of Register 54 and takes only the PLS bit. - * | | |This bit is RO and reserved if you have not selected the RGMII PHY interface. - * |[19] |LPITXA |LPI TX Automate - * | | |This bit controls the behavior of the MAC when it is entering or coming out of the LPI mode on the transmit side - * | | |If the LPITXA and LPIEN bits are set to 1, the MAC enters the LPI mode only after all outstanding frames (in the core) and pending frames (in the application interface) have been transmitted - * | | |The MAC comes out of the LPI mode when the application sends any frame for transmission or the application issues a TX FIFO Flush command - * | | |In addition, the MAC automatically clears the LPIEN bit when it exits the LPI state - * | | |If TX FIFO Flush is set, in Bit 20 of Register 1006 (Operation Mode Register), when the MAC is in the LPI mode, the MAC exits the LPI mode. - * | | |When this bit is 0, the LPIEN bit directly controls behavior of the MAC when it is entering or coming out of the LPI mode. - * @var GMAC_T::LPITMRCTL - * Offset: 0x34 Register 13 (LPI Timers Control Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TWT |LPI TW Timer - * | | |This field specifies the minimum time (in microseconds) for which the MAC waits after it stops transmitting the LPI pattern to the PHY and before it resumes the normal transmission - * | | |The TLPIEX status bit is set after the expiry of this timer. - * |[25:16] |LST |LPI LS Timer - * | | |This field specifies the minimum time (in milliseconds) for which the link status from the PHY should be up (OKAY) before the LPI pattern can be transmitted to the PHY - * | | |The MAC does not transmit the LPI pattern even when the LPIEN bit is set unless the LPI LS Timer reaches the programmed terminal count - * | | |The default value of the LPI LS Timer is 1000 (1 sec) as defined in the IEEE standard. - * @var GMAC_T::INTSTS - * Offset: 0x38 Register 14 (Interrupt Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RGSMIIIS |RGMII Interrupt Status - * | | |This bit is set because of any change in value of the Link Status of RGMII interface (Bit 3 in Register 54 (RGMII Status Register)) - * | | |This bit is cleared when you perform a read operation on the RGMII Status Register. - * |[3] |PMTIS |PMT Interrupt Status - * | | |This bit is set when a Magic packet or Wake-on-LAN frame is received in the power-down mode (see Bits 5 and 6 in the PMT Control and Status Register) - * | | |This bit is cleared when both Bits[6:5] are cleared because of a read operation to the PMT Control and Status register. - * |[9] |TSIS |Timestamp Interrupt Status - * | | |When the Advanced Timestamp feature is enabled, this bit is set when any of the following conditions is true: - * | | |The system time value equals or exceeds the value specified in the Target Time High and Low registers. - * | | |There is an overflow in the seconds register. - * | | |The Auxiliary snapshot trigger is asserted. - * | | |This bit is cleared on reading Bit 0 of the Register 458 (Timestamp Status Register). - * | | |If default Timestamping is enabled, when set, this bit indicates that the system time value is equal to or exceeds the value specified in the Target Time registers - * | | |In this mode, this bit is cleared after the completion of the read of this bit - * | | |In all other modes, this bit is reserved. - * |[10] |LPIIS |LPI Interrupt Status - * | | |When the Energy Efficient Ethernet feature is enabled, this bit is set for any LPI state entry or exit in the MAC Transmitter or Receiver - * | | |This bit is cleared on reading Bit 0 of Register 12 (LPI Control and Status Register) - * | | |In all other modes, this bit is reserved. - * @var GMAC_T::INTMSK - * Offset: 0x3C Register 15 (Interrupt Mask Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RGSMIIIM |RGMII or SMII Interrupt Mask - * | | |When set, this bit disables the assertion of the interrupt signal because of the setting of the RGMII or SMII Interrupt Status bit in Register 14 (Interrupt Status Register). - * |[1] |PCSLCHGIM |PCS Link Status Interrupt Mask (read only) - * | | |When set, this bit disables the assertion of the interrupt signal because of the setting of the PCS Link-status changed bit in Register 14 (Interrupt Status Register). - * |[2] |PCSANCIM |PCS AN Completion Interrupt Mask (read only) - * | | |When set, this bit disables the assertion of the interrupt signal because of the setting of PCS Auto-negotiation complete bit in Register 14 (Interrupt Status Register) - * |[3] |PMTIM |PMT Interrupt Mask - * | | |When set, this bit disables the assertion of the interrupt signal because of the setting of PMT Interrupt Status bit in Register 14 (Interrupt Status Register). - * |[9] |TSIM |Timestamp Interrupt Mask - * | | |When set, this bit disables the assertion of the interrupt signal because of the setting of Timestamp Interrupt Status bit in Register 14 (Interrupt Status Register) - * | | |This bit is valid only when IEEE1588 timestamping is enabled - * | | |In all other modes, this bit is reserved. - * |[10] |LPIIM |LPI Interrupt Mask - * | | |When set, this bit disables the assertion of the interrupt signal because of the setting of the LPI Interrupt Status bit in Register 14 (Interrupt Status Register) - * @var GMAC_T::MACADDR0H - * Offset: 0x40 Register 16 (MAC Address0 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address0 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the first 6-byte MAC address - * | | |The MAC uses this field for filtering the received frames and inserting the MAC address in the Transmit Flow Control (PAUSE) Frames. - * |[31] |AE |Address Enable (read only) - * | | |This bit is always set to 1. - * @var GMAC_T::MACADDR0L - * Offset: 0x44 Register 17 (MAC Address0 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address0 [31:0] - * | | |This field contains the lower 32 bits of the first 6-byte MAC address - * | | |This is used by the MAC for filtering the received frames and inserting the MAC address in the Transmit Flow Control (PAUSE) Frames. - * @var GMAC_T::MACADDR1H - * Offset: 0x48 Register 18 (MAC Address1 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address1 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the second 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address1 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * | | |You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address. - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address1[47:0] is used to compare with the SA fields of the received frame. - * | | |When this bit is reset, the MAC Address1[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the second MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR1L - * Offset: 0x4C Register 19 (MAC Address1 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address1 [31:0] - * | | |This field contains the lower 32 bits of the second 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::MACADDR2H - * Offset: 0x50 Register 20 (MAC Address2 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address2 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the third 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address2 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address2[47:0] is used to compare with the SA fields of the received frame. - * | | |When this bit is reset, the MAC Address2[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the third MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR2L - * Offset: 0x54 Register 21 (MAC Address2 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address2 [31:0] - * | | |This field contains the lower 32 bits of the third 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::MACADDR3H - * Offset: 0x58 Register 22 (MAC Address3 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address3 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the fourth 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address3 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address3[47:0] is used to compare with the SA fields of the received frame. - * | | |When this bit is reset, the MAC Address3[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the fourth MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR3L - * Offset: 0x5C Register 23 (MAC Address3 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address3 [31:0] - * | | |This field contains the lower 32 bits of the fourth 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::MACADDR4H - * Offset: 0x60 Register 24 (MAC Address4 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address4 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the fifth 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address4 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address4[47:0] is used to compare with the SA fields of the received frame. - * | | |When this bit is reset, the MAC Address4[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the fifth MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR4L - * Offset: 0x64 Register 25 (MAC Address4 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address4 [31:0] - * | | |This field contains the lower 32 bits of the fifth 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::MACADDR5H - * Offset: 0x68 Register 26 (MAC Address5 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address5 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the sixth 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address5 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address5[47:0] is used to compare with the SA fields of the received frame - * | | |When this bit is reset, the MAC Address5[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the sixth MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR5L - * Offset: 0x6C Register 27 (MAC Address5 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address5 [31:0] - * | | |This field contains the lower 32 bits of the sixth 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::MACADDR6H - * Offset: 0x70 Register 28 (MAC Address6 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address6 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the seventh 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address6 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address6[47:0] is used to compare with the SA fields of the received frame - * | | |When this bit is reset, the MAC Address6[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the seventh MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR6L - * Offset: 0x74 Register 29 (MAC Address6 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address6 [31:0] - * | | |This field contains the lower 32 bits of the seventh 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::MACADDR7H - * Offset: 0x78 Register 30 (MAC Address7 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address7 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the eighth 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address6 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address7[47:0] is used to compare with the SA fields of the received frame - * | | |When this bit is reset, the MAC Address7[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the eighth MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR7L - * Offset: 0x7C Register 31 (MAC Address7 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address7 [31:0] - * | | |This field contains the lower 32 bits of the eighth 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::MACADDR8H - * Offset: 0x80 Register 32 (MAC Address8 High Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ADDRHI |MAC Address8 [47:32] - * | | |This field contains the upper 16 bits (47:32) of the ninth 6-byte MAC address. - * |[29:24] |MBC |Mask Byte Control - * | | |These bits are mask control bits for comparison of each of the MAC Address bytes - * | | |When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address8 registers - * | | |Each bit controls the masking of the bytes as follows: - * | | |Bit 29: Register 18[15:8] - * | | |Bit 28: Register 18[7:0] - * | | |Bit 27: Register 19[31:24] - * | | |... - * | | |Bit 24: Register 19[7:0] - * |[30] |SA |Source Address - * | | |When this bit is set, the MAC Address8[47:0] is used to compare with the SA fields of the received frame - * | | |When this bit is reset, the MAC Address8[47:0] is used to compare with the DA fields of the received frame. - * |[31] |AE |Address Enable - * | | |When this bit is set, the address filter module uses the ninth MAC address for perfect filtering - * | | |When this bit is reset, the address filter module ignores the address for filtering. - * @var GMAC_T::MACADDR8L - * Offset: 0x84 Register 33 (MAC Address8 Low Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDRLO |MAC Address8 [31:0] - * | | |This field contains the lower 32 bits of the ninth 6-byte MAC address - * | | |The content of this field is undefined until loaded by the Application after the initialization process. - * @var GMAC_T::RGMIICTLSTS - * Offset: 0xD8 Register 54 (RGMII Status Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LNKMOD |Link Mode - * | | |This bit indicates the current mode of operation of the link: - * | | |1'b0: Half-duplex mode - * | | |1'b1: Full-duplex mode - * |[2:1] |LNKSPEED |Link Speed - * | | |This bit indicates the current speed of the link: - * | | |00: 2.5 MHz - * | | |01: 25 MHz - * | | |10: 125 MHz - * |[3] |LNKSTS |Link Status - * | | |When set, this bit indicates that the link is up between the local PHY and the remote PHY - * | | |When cleared, this bit indicates that the link is down between the local PHY and the remote PHY. - * @var GMAC_T::WDTOUT - * Offset: 0xDC Register 55 (Watchdog Timeout Register) This register controls the watchdog timeout for received frames - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |WTO |Watchdog Timeout - * | | |When Bit 16 (PWE) is set and Bit 23 (WD) of Register 0 (MAC Configuration Register) is reset, this field is used as watchdog timeout for a received frame - * | | |If the length of a received frame exceeds the value of this field, such frame is terminated and declared as an error frame. - * | | |Note: When Bit 16 (PWE) is set, the value in this field should be more than 1,522 (0x05F2) - * | | |Otherwise, the IEEE Std 802.3-specified valid tagged frames are declared as error frames and are dropped. - * |[16] |PWE |Programmable Watchdog Enable - * | | |When this bit is set and Bit 23 (WD) of Register 0 (MAC Configuration Register) is reset, the WTO field (Bits[13:0]) is used as watchdog timeout for a received frame - * | | |When this bit is cleared, the watchdog timeout for a received frame is controlled by the setting of Bit 23 (WD) and Bit 20 (JE) in Register 0 (MAC Configuration Register). - * @var GMAC_T::VLANINCL - * Offset: 0x584 Register 353 (VLAN Tag Inclusion or Replacement Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |VLT |VLAN Tag for Transmit Frames - * | | |This field contains the value of the VLAN tag to be inserted or replaced - * | | |The value must only be changed when the transmit lines are inactive or during the initialization phase - * | | |Bits[15:13] are the User Priority, Bit 12 is the CFI/DEI, and Bits[11:0] are the VLAN tag's VID field. - * |[17:16] |VLC |VLAN Tag Control in Transmit Frames - * | | |2'b00: No VLAN tag deletion, insertion, or replacement - * | | |2'b01: VLAN tag deletion - * | | |The MAC removes the VLAN type (bytes 13 and 14) and VLAN tag (bytes 15 and 16) of all transmitted frames with VLAN tags. - * | | |2'b10: VLAN tag insertion - * | | |The MAC inserts VLT in bytes 15 and 16 of the frame after inserting the Type value (0x8100/0x88a8) in bytes 13 and 14 - * | | |This operation is performed on all transmitted frames, irrespective of whether they already have a VLAN tag. - * | | |2'b11: VLAN tag replacement - * | | |The MAC replaces VLT in bytes 15 and 16 of all VLAN-type transmitted frames (Bytes 13 and 14 are 0x8100/0x88a8). - * | | |Note: Changes to this field take effect only on the start of a frame - * | | |If you write this register field when a frame is being transmitted, only the subsequent frame can use the updated value, that is, the current frame does not use the updated value - * |[18] |VLP |VLAN Priority Control - * | | |When this bit is set, the control Bits [17:16] are used for VLAN deletion, insertion, or replacement - * | | |When this bit is reset, the mti_vlan_ctrl_i control input is used, and Bits [17:16] are ignored. - * |[19] |CSVL |C-VLAN or S-VLAN - * | | |When this bit is set, S-VLAN type (0x88A8) is inserted or replaced in the 13th and 14th bytes of transmitted frames - * | | |When this bit is reset, C-VLAN type (0x8100) is inserted or replaced in the transmitted frames. - * @var GMAC_T::TSCTL - * Offset: 0x700 Register 448 (Timestamp Control Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TSENA |Timestamp Enable - * | | |When set, the timestamp is added for the transmit and receive frames - * | | |When disabled, timestamp is not added for the transmit and receive frames and the Timestamp Generator is also suspended - * | | |You need to initialize the Timestamp (system time) after enabling this mode - * | | |On the receive side, the MAC processes the 1588 frames only if this bit is set. - * |[1] |TSCFUPDT |Timestamp Fine or Coarse Update - * | | |When set, this bit indicates that the system times update should be done using the fine update method - * | | |When reset, it indicates the system timestamp update should be done using the Coarse method. - * |[2] |TSINIT |Timestamp Initialize - * | | |When set, the system time is initialized (overwritten) with the value specified in the Register 452 (System Time - Seconds Update Register) and Register 453 (System Time - Nanoseconds Update Register). - * | | |This bit should be read zero before updating it - * | | |This bit is reset when the initialization is complete - * | | |The Timestamp Higher Word register can only be initialized. - * |[3] |TSUPDT |Timestamp Update - * | | |When set, the system time is updated (added or subtracted) with the value specified in Register 452 (System Time - Seconds Update Register) and Register 453 (System Time - Nanoseconds Update Register). - * | | |This bit should be read zero before updating it - * | | |This bit is reset when the update is completed in hardware - * | | |The Timestamp Higher Word register is not updated. - * |[4] |TSTRIG |Timestamp Interrupt Trigger Enable - * | | |When set, the timestamp interrupt is generated when the System Time becomes greater than the value written in the Target Time register - * | | |This bit is reset after the generation of the Timestamp Trigger Interrupt. - * |[5] |TSADDREG |Addend Reg Update - * | | |When set, the content of the Timestamp Addend register is updated in the PTP block for fine correction - * | | |This is cleared when the update is completed - * | | |This register bit should be zero before setting it. - * |[8] |TSENALL |Enable Timestamp for All Frames - * | | |When set, the timestamp snapshot is enabled for all frames received by the MAC. - * |[9] |TSCTRLSSR |Timestamp Digital or Binary Rollover Control - * | | |When set, the Timestamp Low register rolls over after 0x3B9A_C9FF value (that is, 1 nanosecond accuracy) and increments the timestamp (High) seconds - * | | |When reset, the rollover value of sub-second register is 0x7FFF_FFFF - * | | |The sub-second increment has to be programmed correctly depending on the PTP reference clock frequency and the value of this bit. - * |[10] |TSVER2ENA |Enable PTP packet Processing for Version 2 Format - * | | |When set, the PTP packets are processed using the 1588 version 2 format - * | | |Otherwise, the PTP packets are processed using the version 1 format. - * |[11] |TSIPENA |Enable Processing of PTP over Ethernet Frames - * | | |When set, the MAC receiver processes the PTP packets encapsulated directly in the Ethernet frames - * | | |When this bit is clear, the MAC ignores the PTP over Ethernet packets. - * |[12] |TSIPV6ENA |Enable Processing of PTP Frames Sent Over IPv6-UDP - * | | |When set, the MAC receiver processes PTP packets encapsulated in UDP over IPv6 packets - * | | |When this bit is clear, the MAC ignores the PTP transported over UDP-IPv6 packets. - * |[13] |TSIPV4ENA |Enable Processing of PTP Frames Sent over IPv4-UDP - * | | |When set, the MAC receiver processes the PTP packets encapsulated in UDP over IPv4 packets - * | | |When this bit is clear, the MAC ignores the PTP transported over UDP-IPv4 packets - * | | |This bit is set by default. - * |[14] |TSEVNTENA |Enable Timestamp Snapshot for Event Messages - * | | |When set, the timestamp snapshot is taken only for event messages (SYNC, Delay_Req, Pdelay_Req, or Pdelay_Resp) - * | | |When reset, the snapshot is taken for all messages except Announce, Management, and Signaling. - * |[15] |TSMSTRENA |Enable Snapshot for Messages Relevant to Master - * | | |When set, the snapshot is taken only for the messages relevant to the master node - * | | |Otherwise, the snapshot is taken for the messages relevant to the slave node. - * |[17:16] |SNAPTYPSEL|Select PTP packets for Taking Snapshots - * | | |These bits along with Bits 15 and 14 decide the set of PTP packet types for which snapshot needs to be taken. - * |[18] |TSENMACADDR|Enable MAC address for PTP Frame Filtering - * | | |When set, the DA MAC address (that matches any MAC Address register) is used to filter the PTP frames when PTP is directly sent over Ethernet. - * @var GMAC_T::SSECINC - * Offset: 0x704 Register 449 (Sub-Second Increment Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |SSINC |Sub-second Increment Value - * | | |The value programmed in this field is accumulated every clock cycle (of clk_ptp_i) with the contents of the sub-second register - * | | |For example, when PTP clock is 50 MHz (period is 20 ns), you should program 20 (0x14) when the System Time-Nanoseconds register has an accuracy of 1 ns (TSCTRLSSR bit is set) - * | | |When TSCTRLSSR is clear, the Nanoseconds register has a resolution of ~0.465ns - * | | |In this case, you should program a value of 43 (0x2B) that is derived by 20ns/0.465. - * @var GMAC_T::STSEC - * Offset: 0x708 Register 450 (System Time - Seconds Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TSS |Timestamp Second - * | | |The value in this field indicates the current value in seconds of the System Time maintained by the MAC. - * @var GMAC_T::STNSEC - * Offset: 0x70C Register 451 (System Time - Nanoseconds Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |TSSS |Timestamp Sub Seconds - * | | |The value in this field has the sub second representation of time, with an accuracy of 0.46 ns - * | | |When bit 9 (TSCTRLSSR) is set in Register 448 (Timestamp Control Register), each bit represents 1 ns and the maximum value is 0x3B9A_C9FF, after which it rolls-over to zero. - * @var GMAC_T::STSECU - * Offset: 0x710 Register 452 (System Time - Seconds Update Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TSS |Timestamp Second - * | | |The value in this field indicates the time in seconds to be initialized or added to the system time. - * @var GMAC_T::STNSECU - * Offset: 0x714 Register 453 (System Time - Nanoseconds Update Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |TSSS |Timestamp Sub Second - * | | |The value in this field has the sub second representation of time, with an accuracy of 0.46 ns - * | | |When bit 9 (TSCTRLSSR) is set in Register 448 (Timestamp Control Register), each bit represents 1 ns and the programmed value should not exceed 0x3B9A_C9FF. - * |[31] |ADDSUB |Add or subtract time - * | | |When this bit is set, the time value is subtracted with the contents of the update register - * | | |When this bit is reset, the time value is added with the contents of the update register. - * @var GMAC_T::TSADDEND - * Offset: 0x718 Register 454 (Timestamp Addend Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TSAR |Timestamp Addend Register - * | | |This field indicates the 32-bit time value to be added to the Accumulator register to achieve time synchronization. - * @var GMAC_T::TGTSEC - * Offset: 0x71C Register 455 (Target Time Seconds Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TSTR |Target Time Seconds Register - * | | |This register stores the time in seconds - * | | |When the timestamp value matches or exceeds both Target Timestamp registers, then based on Bits [6:5] of Register 459 (PPS Control Register), the MAC starts or stops the PPS signal output and generates an interrupt (if enabled). - * @var GMAC_T::TGTNSEC - * Offset: 0x720 Register 456 (Target Time Nanoseconds Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[30:0] |TTSLO |Target Timestamp Low Register - * | | |This register stores the time in (signed) nanoseconds - * | | |When the value of the timestamp matches the both Target Timestamp registers, then based on the TRGTMODSEL0 field (Bits [6:5]) in Register 459 (PPS Control Register), the MAC starts or stops the PPS signal output and generates an interrupt (if enabled). - * | | |This value should not exceed 0x3B9A_C9FF when TSCTRLSSR is set in the Timestamp control register - * | | |The actual start or stop time of the PPS signal output may have an error margin up to one unit of sub-second increment value. - * |[31] |TRGTBUSY |Target Time Register Busy (read only) - * | | |The MAC sets this bit when the PPSCMD field (Bits[3:0]) in Register 459 (PPS Control Register) is programmed to 010 or 011 - * | | |Programming the PPSCMD field to 010 or 011, instructs the MAC to synchronize the Target Time Registers to the PTP clock domain. - * | | |The MAC clears this bit after synchronizing the Target Time Registers to the PTP clock domain The application must not update the Target Time Registers when this bit is read as 1 - * | | |Otherwise, the synchronization of the previous programmed time gets corrupted - * | | |This bit is reserved when the Enable Flexible Pulse-Per-Second Output feature is not selected. - * @var GMAC_T::STHSEC - * Offset: 0x724 Register 457 (System Time - Higher Word Seconds Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TSHWR |Timestamp Higher Word Register - * | | |This field contains the most significant 16-bits of the timestamp seconds value - * | | |The register is directly written to initialize the value - * | | |This register is incremented when there is an overflow from the 32-bits of the System Time - Seconds register. - * @var GMAC_T::TSSTS - * Offset: 0x728 Register 458 (Timestamp Status Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TSSOVF |Timestamp Seconds Overflow - * | | |When set, this bit indicates that the seconds value of the timestamp (when supporting version 2 format) has overflowed beyond 32'hFFFF_FFFF. - * |[1] |TSTARGT |Timestamp Target Time Reached - * | | |When set, this bit indicates that the value of system time is greater or equal to the value specified in the Register 455 (Target Time Seconds Register) and Register 456 (Target Time Nanoseconds Register). - * |[2] |AUXTSTRIG |Auxiliary Timestamp Trigger Snapshot - * | | |This bit is set high when the auxiliary snapshot is written to the FIFO - * | | |This bit is valid only if the Enable IEEE 1588 Auxiliary Snapshot feature is selected. - * |[3] |TSTRGTERR |Timestamp Target Time Error - * | | |This bit is set when the target time, being programmed in Target Time Registers, is already elapsed - * | | |This bit is cleared when read by the application. - * |[19:16] |ATSSTN |Auxiliary Timestamp Snapshot Trigger Identifier - * | | |These bits identify the Auxiliary trigger inputs for which the timestamp available in the Auxiliary Snapshot Register is applicable - * | | |When more than one bit is set at the same time, it means that corresponding auxiliary triggers were sampled at the same clock - * | | |These bits are applicable only if the number of Auxiliary snapshots is more than one - * | | |One bit is assigned for each trigger as shown in the following list: - * | | |Bit 16: Auxiliary trigger 0 - * | | |Bit 17: Auxiliary trigger 1 - * | | |Bit 18: Auxiliary trigger 2 - * | | |Bit 19: Auxiliary trigger 3 - * | | |The software can read this register to find the triggers that are set when the timestamp is taken. - * @var GMAC_T::PPSCTL - * Offset: 0x72C Register 459 (PPS Control Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PPSCTL_PPSCMD|PPSCTL0 or PPSCMD0 - * | | |PPSCTL0: PPS0 Output Frequency Control - * | | |This field controls the frequency of the PPS0 output (ptp_pps_o[0]) signal - * | | |The default value of PPSCTL is 0000, and the PPS output is 1 pulse (of width clk_ptp_i) every second - * | | |For other values of PPSCTL, the PPS output becomes a generated clock of following frequencies: - * | | |-0001: The binary rollover is 2 Hz, and the digital rollover is 1 Hz - * | | |-0010: The binary rollover is 4 Hz, and the digital rollover is 2 Hz - * | | |-0011: The binary rollover is 8 Hz, and the digital rollover is 4 Hz - * | | |-0100: The binary rollover is 16 Hz, and the digital rollover is 8 Hz - * | | |-.. - * | | |-1111: The binary rollover is 32.768 kHz, and the digital rollover is 16.384 kHz - * | | |Note: - * | | |In the binary rollover mode, the PPS output (ptp_pps_o) has a duty cycle of 50 percent with these frequencies. - * | | |In the digital rollover mode, the PPS output frequency is an average number - * | | |The actual clock is of different frequency that gets synchronized every second - * | | |For example: - * | | |* When PPSCTL = 0001, the PPS (1 Hz) has a low period of 537 ms and a high period of 463 ms * When PPSCTL = 0010, the PPS (2 Hz) is a sequence of: - * | | |One clock of 50 percent duty cycle and 537 ms period - * | | |Second clock of 463 ms period (268 ms low and 195 ms high) - * | | |* When PPSCTL = 0011, the PPS (4 Hz) is a sequence of: - * | | |Three clocks of 50 percent duty cycle and 268 ms period - * | | |Fourth clock of 195 ms period (134 ms low and 61 ms high) - * | | |This behavior is because of the non-linear toggling of bits in the digital rollover mode in Register 451 (System Time - Nanoseconds Register). - * | | |Flexible PPS0 Output (ptp_pps_o[0]) Control Programming these bits with a non-zero value instructs the MAC to initiate an event - * | | |Once the command is transferred or synchronized to the PTP clock domain, these bits get cleared automatically - * | | |The Software should ensure that these bits are programmed only when they are all-zero - * | | |The following list describes the values of PPSCMD0: - * | | |* 0000: No Command * 0001: START Single Pulse This command generates single pulse rising at the start point defined in Target Time Registers (register 455 and 456) and of a duration defined in the PPS0 PPSWDTH Register - * | | |* 0010: START Pulse Train This command generates the train of pulses rising at the start point defined in the Target Time Registers and of a duration defined in the PPSWDTH Register and repeated at interval defined in the PPS Interval Register - * | | |By default, the PPS pulse train is free-running unless stopped by 'STOP Pulse train at time' or 'STOP Pulse Train immediately' commands - * | | |* 0011: Cancel START - * | | |This command cancels the START Single Pulse and START Pulse Train commands if the system time has not crossed the programmed start time - * | | |* 0100: STOP Pulse train at time This command stops the train of pulses initiated by the START Pulse Train command (PPSCMD = 0010) after the time programmed in the Target Time registers elapses - * | | |* 0101: STOP Pulse Train immediately This command immediately stops the train of pulses initiated by the START Pulse Train command (PPSCMD = 0010) - * | | |* 0110: Cancel STOP Pulse train This command cancels the STOP pulse train at time command if the programmed stop time has not elapsed - * | | |The PPS pulse train becomes free-running on the successful execution of this command - * | | |* 0111-1111: Reserved - * |[4] |PPSEN0 |Flexible PPS Output Mode Enable - * | | |When set low, Bits[3:0] function as PPSCTL (backward compatible) - * | | |When set high, Bits[3:0] function as PPSCMD. - * |[6:5] |TRGTMODSEL0|Target Time Register Mode for PPS0 Output - * | | |This field indicates the Target Time registers (register 455 and 456) mode for PPS0 output signal: - * | | |00: Indicates that the Target Time registers are programmed only for generating the interrupt event. - * | | |01: Reserved - * | | |10: Indicates that the Target Time registers are programmed for generating the interrupt event and starting or stopping the generation of the PPS0 output signal. - * | | |11: Indicates that the Target Time registers are programmed only for starting or stopping the generation of the PPS0 output signal - * | | |No interrupt is asserted. - * @var GMAC_T::PPSINTVL - * Offset: 0x760 Register 472 (PPS0 Interval Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PPSINT |PPS0 Output Signal Interval - * | | |These bits store the interval between the rising edges of PPS0 signal output in terms of units of sub-second increment value - * | | |You need to program one value less than the required interval - * | | |For example, if the PTP reference clock is 50 MHz (period of 20ns), and desired interval between rising edges of PPS0 signal output is 100ns (that is, five units of sub-second increment value), then you should program value 4 (5 -1) in this register. - * @var GMAC_T::PPSWDTH - * Offset: 0x764 Register 473 (PPS0 PPSWDTH Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |PPSWIDTH |PPS0 Output Signal PPSWDTH - * | | |These bits store the width between the rising edge and corresponding falling edge of the PPS0 signal output in terms of units of sub-second increment value. - * | | |You need to program one value less than the required interval - * | | |For example, if PTP reference clock is 50 MHz (period of 20ns), and desired width between the rising and corresponding falling edges of PPS0 signal output is 80ns (that is, four units of sub-second increment value), then you should program value 3 (4-1) in this register. - * | | |Note: The value programmed in this register must be lesser than the value programmed in Register 472 (PPS0 Interval Register). - */ - - __IO uint32_t MACCFG; /*!< [0x0000] Register 0 (MAC Configuration Register) */ - __IO uint32_t MACFRMFLTR; /*!< [0x0004] Register 1 (MAC Frame Filter) */ - __I uint32_t RESERVE0[2]; - __IO uint32_t GMIIADDR; /*!< [0x0010] Register 4 (GMII Address Register) */ - __IO uint32_t GMIIDATA; /*!< [0x0014] Register 5 (GMII Data Register) */ - __IO uint32_t FLOWCTL; /*!< [0x0018] Register 6 (Flow Control Register) */ - __IO uint32_t VLANTAG; /*!< [0x001c] Register 7 (VLAN Tag Register) */ - __IO uint32_t VERSION; /*!< [0x0020] Register 8 (Version Register) */ - __I uint32_t REGREGDEBUG; /*!< [0x0024] Register 9 (Debug Register) */ - __I uint32_t RESERVE1[1]; - __IO uint32_t PMTCTLSTS; /*!< [0x002c] Register 11 (PMT Control and Status Register) */ - __IO uint32_t LPICTLSTS; /*!< [0x0030] Register 12 (LPI Control and Status Register) */ - __IO uint32_t LPITMRCTL; /*!< [0x0034] Register 13 (LPI Timers Control Register) */ - __I uint32_t INTSTS; /*!< [0x0038] Register 14 (Interrupt Status Register) */ - __IO uint32_t INTMSK; /*!< [0x003c] Register 15 (Interrupt Mask Register) */ - __IO uint32_t MACADDR0H; /*!< [0x0040] Register 16 (MAC Address0 High Register) */ - __IO uint32_t MACADDR0L; /*!< [0x0044] Register 17 (MAC Address0 Low Register) */ - __IO uint32_t MACADDR1H; /*!< [0x0048] Register 18 (MAC Address1 High Register) */ - __IO uint32_t MACADDR1L; /*!< [0x004c] Register 19 (MAC Address1 Low Register) */ - __IO uint32_t MACADDR2H; /*!< [0x0050] Register 20 (MAC Address2 High Register) */ - __IO uint32_t MACADDR2L; /*!< [0x0054] Register 21 (MAC Address2 Low Register) */ - __IO uint32_t MACADDR3H; /*!< [0x0058] Register 22 (MAC Address3 High Register) */ - __IO uint32_t MACADDR3L; /*!< [0x005c] Register 23 (MAC Address3 Low Register) */ - __IO uint32_t MACADDR4H; /*!< [0x0060] Register 24 (MAC Address4 High Register) */ - __IO uint32_t MACADDR4L; /*!< [0x0064] Register 25 (MAC Address4 Low Register) */ - __IO uint32_t MACADDR5H; /*!< [0x0068] Register 26 (MAC Address5 High Register) */ - __IO uint32_t MACADDR5L; /*!< [0x006c] Register 27 (MAC Address5 Low Register) */ - __IO uint32_t MACADDR6H; /*!< [0x0070] Register 28 (MAC Address6 High Register) */ - __IO uint32_t MACADDR6L; /*!< [0x0074] Register 29 (MAC Address6 Low Register) */ - __IO uint32_t MACADDR7H; /*!< [0x0078] Register 30 (MAC Address7 High Register) */ - __IO uint32_t MACADDR7L; /*!< [0x007c] Register 31 (MAC Address7 Low Register) */ - __IO uint32_t MACADDR8H; /*!< [0x0080] Register 32 (MAC Address8 High Register) */ - __IO uint32_t MACADDR8L; /*!< [0x0084] Register 33 (MAC Address8 Low Register) */ - __I uint32_t RESERVE2[20]; - __I uint32_t RGMIICTLSTS; /*!< [0x00d8] Register 54 (RGMII Status Register) */ - __IO uint32_t WDTOUT; /*!< [0x00dc] Register 55 (Watchdog Timeout Register) */ - __I uint32_t RESERVE3[297]; - __IO uint32_t VLANINCL; /*!< [0x0584] Register 353 (VLAN Tag Inclusion or Replacement Register) */ - __I uint32_t RESERVE4[94]; - __IO uint32_t TSCTL; /*!< [0x0700] Register 448 (Timestamp Control Register) */ - __IO uint32_t SSECINC; /*!< [0x0704] Register 449 (Sub-Second Increment Register) */ - __I uint32_t STSEC; /*!< [0x0708] Register 450 (System Time - Seconds Register) */ - __I uint32_t STNSEC; /*!< [0x070c] Register 451 (System Time - Nanoseconds Register) */ - __IO uint32_t STSECU; /*!< [0x0710] Register 452 (System Time - Seconds Update Register) */ - __IO uint32_t STNSECU; /*!< [0x0714] Register 453 (System Time - Nanoseconds Update Register) */ - __IO uint32_t TSADDEND; /*!< [0x0718] Register 454 (Timestamp Addend Register) */ - __IO uint32_t TGTSEC; /*!< [0x071c] Register 455 (Target Time Seconds Register) */ - __IO uint32_t TGTNSEC; /*!< [0x0720] Register 456 (Target Time Nanoseconds Register) */ - __IO uint32_t STHSEC; /*!< [0x0724] Register 457 (System Time - Higher Word Seconds Register) */ - __I uint32_t TSSTS; /*!< [0x0728] Register 458 (Timestamp Status Register) */ - __IO uint32_t PPSCTL; /*!< [0x072c] Register 459 (PPS Control Register) */ - __I uint32_t RESERVE5[12]; - __IO uint32_t PPSINTVL; /*!< [0x0760] Register 472 (PPS0 Interval Register) */ - __IO uint32_t PPSWDTH; /*!< [0x0764] Register 473 (PPS0 Width Register) */ - -} GMAC_T; - - -/** - @addtogroup GMAC_CONST GMAC Bit Field Definition - Constant Definitions for GMAC Controller -@{ */ - -#define GMAC_MACCFG_PRELEN_Pos (0) /*!< GMAC_T::MACCFG: PRELEN Position */ -#define GMAC_MACCFG_PRELEN_Msk (0x3ul << GMAC_MACCFG_PRELEN_Pos) /*!< GMAC_T::MACCFG: PRELEN Mask */ - -#define GMAC_MACCFG_RE_Pos (2) /*!< GMAC_T::MACCFG: RE Position */ -#define GMAC_MACCFG_RE_Msk (0x1ul << GMAC_MACCFG_RE_Pos) /*!< GMAC_T::MACCFG: RE Mask */ - -#define GMAC_MACCFG_TE_Pos (3) /*!< GMAC_T::MACCFG: TE Position */ -#define GMAC_MACCFG_TE_Msk (0x1ul << GMAC_MACCFG_TE_Pos) /*!< GMAC_T::MACCFG: TE Mask */ - -#define GMAC_MACCFG_DC_Pos (4) /*!< GMAC_T::MACCFG: DC Position */ -#define GMAC_MACCFG_DC_Msk (0x1ul << GMAC_MACCFG_DC_Pos) /*!< GMAC_T::MACCFG: DC Mask */ - -#define GMAC_MACCFG_BL_Pos (5) /*!< GMAC_T::MACCFG: BL Position */ -#define GMAC_MACCFG_BL_Msk (0x3ul << GMAC_MACCFG_BL_Pos) /*!< GMAC_T::MACCFG: BL Mask */ - -#define GMAC_MACCFG_ACS_Pos (7) /*!< GMAC_T::MACCFG: ACS Position */ -#define GMAC_MACCFG_ACS_Msk (0x1ul << GMAC_MACCFG_ACS_Pos) /*!< GMAC_T::MACCFG: ACS Mask */ - -#define GMAC_MACCFG_LUD_Pos (8) /*!< GMAC_T::MACCFG: LUD Position */ -#define GMAC_MACCFG_LUD_Msk (0x1ul << GMAC_MACCFG_LUD_Pos) /*!< GMAC_T::MACCFG: LUD Mask */ - -#define GMAC_MACCFG_DR_Pos (9) /*!< GMAC_T::MACCFG: DR Position */ -#define GMAC_MACCFG_DR_Msk (0x1ul << GMAC_MACCFG_DR_Pos) /*!< GMAC_T::MACCFG: DR Mask */ - -#define GMAC_MACCFG_IPC_Pos (10) /*!< GMAC_T::MACCFG: IPC Position */ -#define GMAC_MACCFG_IPC_Msk (0x1ul << GMAC_MACCFG_IPC_Pos) /*!< GMAC_T::MACCFG: IPC Mask */ - -#define GMAC_MACCFG_DM_Pos (11) /*!< GMAC_T::MACCFG: DM Position */ -#define GMAC_MACCFG_DM_Msk (0x1ul << GMAC_MACCFG_DM_Pos) /*!< GMAC_T::MACCFG: DM Mask */ - -#define GMAC_MACCFG_LM_Pos (12) /*!< GMAC_T::MACCFG: LM Position */ -#define GMAC_MACCFG_LM_Msk (0x1ul << GMAC_MACCFG_LM_Pos) /*!< GMAC_T::MACCFG: LM Mask */ - -#define GMAC_MACCFG_DO_Pos (13) /*!< GMAC_T::MACCFG: DO Position */ -#define GMAC_MACCFG_DO_Msk (0x1ul << GMAC_MACCFG_DO_Pos) /*!< GMAC_T::MACCFG: DO Mask */ - -#define GMAC_MACCFG_FES_Pos (14) /*!< GMAC_T::MACCFG: FES Position */ -#define GMAC_MACCFG_FES_Msk (0x1ul << GMAC_MACCFG_FES_Pos) /*!< GMAC_T::MACCFG: FES Mask */ - -#define GMAC_MACCFG_PS_Pos (15) /*!< GMAC_T::MACCFG: PS Position */ -#define GMAC_MACCFG_PS_Msk (0x1ul << GMAC_MACCFG_PS_Pos) /*!< GMAC_T::MACCFG: PS Mask */ - -#define GMAC_MACCFG_DCRS_Pos (16) /*!< GMAC_T::MACCFG: DCRS Position */ -#define GMAC_MACCFG_DCRS_Msk (0x1ul << GMAC_MACCFG_DCRS_Pos) /*!< GMAC_T::MACCFG: DCRS Mask */ - -#define GMAC_MACCFG_IFG_Pos (17) /*!< GMAC_T::MACCFG: IFG Position */ -#define GMAC_MACCFG_IFG_Msk (0x7ul << GMAC_MACCFG_IFG_Pos) /*!< GMAC_T::MACCFG: IFG Mask */ - -#define GMAC_MACCFG_JE_Pos (20) /*!< GMAC_T::MACCFG: JE Position */ -#define GMAC_MACCFG_JE_Msk (0x1ul << GMAC_MACCFG_JE_Pos) /*!< GMAC_T::MACCFG: JE Mask */ - -#define GMAC_MACCFG_BE_Pos (21) /*!< GMAC_T::MACCFG: BE Position */ -#define GMAC_MACCFG_BE_Msk (0x1ul << GMAC_MACCFG_BE_Pos) /*!< GMAC_T::MACCFG: BE Mask */ - -#define GMAC_MACCFG_JD_Pos (22) /*!< GMAC_T::MACCFG: JD Position */ -#define GMAC_MACCFG_JD_Msk (0x1ul << GMAC_MACCFG_JD_Pos) /*!< GMAC_T::MACCFG: JD Mask */ - -#define GMAC_MACCFG_WD_Pos (23) /*!< GMAC_T::MACCFG: WD Position */ -#define GMAC_MACCFG_WD_Msk (0x1ul << GMAC_MACCFG_WD_Pos) /*!< GMAC_T::MACCFG: WD Mask */ - -#define GMAC_MACCFG_TC_Pos (24) /*!< GMAC_T::MACCFG: TC Position */ -#define GMAC_MACCFG_TC_Msk (0x1ul << GMAC_MACCFG_TC_Pos) /*!< GMAC_T::MACCFG: TC Mask */ - -#define GMAC_MACCFG_CST_Pos (25) /*!< GMAC_T::MACCFG: CST Position */ -#define GMAC_MACCFG_CST_Msk (0x1ul << GMAC_MACCFG_CST_Pos) /*!< GMAC_T::MACCFG: CST Mask */ - -#define GMAC_MACCFG_TWOKPE_Pos (27) /*!< GMAC_T::MACCFG: TWOKPE Position */ -#define GMAC_MACCFG_TWOKPE_Msk (0x1ul << GMAC_MACCFG_TWOKPE_Pos) /*!< GMAC_T::MACCFG: TWOKPE Mask */ - -#define GMAC_MACCFG_SARC_Pos (28) /*!< GMAC_T::MACCFG: SARC Position */ -#define GMAC_MACCFG_SARC_Msk (0x7ul << GMAC_MACCFG_SARC_Pos) /*!< GMAC_T::MACCFG: SARC Mask */ - -#define GMAC_MACFRMFLTR_PR_Pos (0) /*!< GMAC_T::MACFRMFLTR: PR Position */ -#define GMAC_MACFRMFLTR_PR_Msk (0x1ul << GMAC_MACFRMFLTR_PR_Pos) /*!< GMAC_T::MACFRMFLTR: PR Mask */ - -#define GMAC_MACFRMFLTR_DAIF_Pos (3) /*!< GMAC_T::MACFRMFLTR: DAIF Position */ -#define GMAC_MACFRMFLTR_DAIF_Msk (0x1ul << GMAC_MACFRMFLTR_DAIF_Pos) /*!< GMAC_T::MACFRMFLTR: DAIF Mask */ - -#define GMAC_MACFRMFLTR_PM_Pos (4) /*!< GMAC_T::MACFRMFLTR: PM Position */ -#define GMAC_MACFRMFLTR_PM_Msk (0x1ul << GMAC_MACFRMFLTR_PM_Pos) /*!< GMAC_T::MACFRMFLTR: PM Mask */ - -#define GMAC_MACFRMFLTR_DBF_Pos (5) /*!< GMAC_T::MACFRMFLTR: DBF Position */ -#define GMAC_MACFRMFLTR_DBF_Msk (0x1ul << GMAC_MACFRMFLTR_DBF_Pos) /*!< GMAC_T::MACFRMFLTR: DBF Mask */ - -#define GMAC_MACFRMFLTR_PCF_Pos (6) /*!< GMAC_T::MACFRMFLTR: PCF Position */ -#define GMAC_MACFRMFLTR_PCF_Msk (0x3ul << GMAC_MACFRMFLTR_PCF_Pos) /*!< GMAC_T::MACFRMFLTR: PCF Mask */ - -#define GMAC_MACFRMFLTR_SAIF_Pos (8) /*!< GMAC_T::MACFRMFLTR: SAIF Position */ -#define GMAC_MACFRMFLTR_SAIF_Msk (0x1ul << GMAC_MACFRMFLTR_SAIF_Pos) /*!< GMAC_T::MACFRMFLTR: SAIF Mask */ - -#define GMAC_MACFRMFLTR_SAF_Pos (9) /*!< GMAC_T::MACFRMFLTR: SAF Position */ -#define GMAC_MACFRMFLTR_SAF_Msk (0x1ul << GMAC_MACFRMFLTR_SAF_Pos) /*!< GMAC_T::MACFRMFLTR: SAF Mask */ - -#define GMAC_MACFRMFLTR_VTFE_Pos (16) /*!< GMAC_T::MACFRMFLTR: VTFE Position */ -#define GMAC_MACFRMFLTR_VTFE_Msk (0x1ul << GMAC_MACFRMFLTR_VTFE_Pos) /*!< GMAC_T::MACFRMFLTR: VTFE Mask */ - -#define GMAC_MACFRMFLTR_RA_Pos (31) /*!< GMAC_T::MACFRMFLTR: RA Position */ -#define GMAC_MACFRMFLTR_RA_Msk (0x1ul << GMAC_MACFRMFLTR_RA_Pos) /*!< GMAC_T::MACFRMFLTR: RA Mask */ - -#define GMAC_GMIIADDR_GB_Pos (0) /*!< GMAC_T::GMIIADDR: GB Position */ -#define GMAC_GMIIADDR_GB_Msk (0x1ul << GMAC_GMIIADDR_GB_Pos) /*!< GMAC_T::GMIIADDR: GB Mask */ - -#define GMAC_GMIIADDR_GW_Pos (1) /*!< GMAC_T::GMIIADDR: GW Position */ -#define GMAC_GMIIADDR_GW_Msk (0x1ul << GMAC_GMIIADDR_GW_Pos) /*!< GMAC_T::GMIIADDR: GW Mask */ - -#define GMAC_GMIIADDR_CR_Pos (2) /*!< GMAC_T::GMIIADDR: CR Position */ -#define GMAC_GMIIADDR_CR_Msk (0xful << GMAC_GMIIADDR_CR_Pos) /*!< GMAC_T::GMIIADDR: CR Mask */ - -#define GMAC_GMIIADDR_GR_Pos (6) /*!< GMAC_T::GMIIADDR: GR Position */ -#define GMAC_GMIIADDR_GR_Msk (0x1ful << GMAC_GMIIADDR_GR_Pos) /*!< GMAC_T::GMIIADDR: GR Mask */ - -#define GMAC_GMIIADDR_PA_Pos (11) /*!< GMAC_T::GMIIADDR: PA Position */ -#define GMAC_GMIIADDR_PA_Msk (0x1ful << GMAC_GMIIADDR_PA_Pos) /*!< GMAC_T::GMIIADDR: PA Mask */ - -#define GMAC_GMII_Date_GD_Pos (0) /*!< GMAC_T::GMII_Date: GD Position */ -#define GMAC_GMII_Date_GD_Msk (0xfffful << GMAC_GMII_Date_GD_Pos) /*!< GMAC_T::GMII_Date: GD Mask */ - -#define GMAC_FLOWCTL_FCA_BPA_Pos (0) /*!< GMAC_T::FLOWCTL: FCA_BPA Position */ -#define GMAC_FLOWCTL_FCA_BPA_Msk (0x1ul << GMAC_FLOWCTL_FCA_BPA_Pos) /*!< GMAC_T::FLOWCTL: FCA_BPA Mask */ - -#define GMAC_FLOWCTL_TFE_Pos (1) /*!< GMAC_T::FLOWCTL: TFE Position */ -#define GMAC_FLOWCTL_TFE_Msk (0x1ul << GMAC_FLOWCTL_TFE_Pos) /*!< GMAC_T::FLOWCTL: TFE Mask */ - -#define GMAC_FLOWCTL_RFE_Pos (2) /*!< GMAC_T::FLOWCTL: RFE Position */ -#define GMAC_FLOWCTL_RFE_Msk (0x1ul << GMAC_FLOWCTL_RFE_Pos) /*!< GMAC_T::FLOWCTL: RFE Mask */ - -#define GMAC_FLOWCTL_UP_Pos (3) /*!< GMAC_T::FLOWCTL: UP Position */ -#define GMAC_FLOWCTL_UP_Msk (0x1ul << GMAC_FLOWCTL_UP_Pos) /*!< GMAC_T::FLOWCTL: UP Mask */ - -#define GMAC_FLOWCTL_PLT_Pos (4) /*!< GMAC_T::FLOWCTL: PLT Position */ -#define GMAC_FLOWCTL_PLT_Msk (0x3ul << GMAC_FLOWCTL_PLT_Pos) /*!< GMAC_T::FLOWCTL: PLT Mask */ - -#define GMAC_FLOWCTL_DZPQ_Pos (7) /*!< GMAC_T::FLOWCTL: DZPQ Position */ -#define GMAC_FLOWCTL_DZPQ_Msk (0x1ul << GMAC_FLOWCTL_DZPQ_Pos) /*!< GMAC_T::FLOWCTL: DZPQ Mask */ - -#define GMAC_FLOWCTL_PT_Pos (16) /*!< GMAC_T::FLOWCTL: PT Position */ -#define GMAC_FLOWCTL_PT_Msk (0xfffful << GMAC_FLOWCTL_PT_Pos) /*!< GMAC_T::FLOWCTL: PT Mask */ - -#define GMAC_VLANTAG_VL_Pos (0) /*!< GMAC_T::VLANTAG: VL Position */ -#define GMAC_VLANTAG_VL_Msk (0xfffful << GMAC_VLANTAG_VL_Pos) /*!< GMAC_T::VLANTAG: VL Mask */ - -#define GMAC_VLANTAG_ETV_Pos (16) /*!< GMAC_T::VLANTAG: ETV Position */ -#define GMAC_VLANTAG_ETV_Msk (0x1ul << GMAC_VLANTAG_ETV_Pos) /*!< GMAC_T::VLANTAG: ETV Mask */ - -#define GMAC_VLANTAG_VTIM_Pos (17) /*!< GMAC_T::VLANTAG: VTIM Position */ -#define GMAC_VLANTAG_VTIM_Msk (0x1ul << GMAC_VLANTAG_VTIM_Pos) /*!< GMAC_T::VLANTAG: VTIM Mask */ - -#define GMAC_VLANTAG_ESVL_Pos (18) /*!< GMAC_T::VLANTAG: ESVL Position */ -#define GMAC_VLANTAG_ESVL_Msk (0x1ul << GMAC_VLANTAG_ESVL_Pos) /*!< GMAC_T::VLANTAG: ESVL Mask */ - -#define GMAC_REGREGDEBUG_RPESTS_Pos (0) /*!< GMAC_T::REGDEBUG: RPESTS Position */ -#define GMAC_REGDEBUG_RPESTS_Msk (0x1ul << GMAC_REGDEBUG_RPESTS_Pos) /*!< GMAC_T::REGDEBUG: RPESTS Mask */ - -#define GMAC_REGDEBUG_RFCFCSTS_Pos (1) /*!< GMAC_T::REGDEBUG: RFCFCSTS Position */ -#define GMAC_REGDEBUG_RFCFCSTS_Msk (0x3ul << GMAC_REGDEBUG_RFCFCSTS_Pos) /*!< GMAC_T::REGDEBUG: RFCFCSTS Mask */ - -#define GMAC_REGDEBUG_RWCSTS_Pos (4) /*!< GMAC_T::REGDEBUG: RWCSTS Position */ -#define GMAC_REGDEBUG_RWCSTS_Msk (0x1ul << GMAC_REGDEBUG_RWCSTS_Pos) /*!< GMAC_T::REGDEBUG: RWCSTS Mask */ - -#define GMAC_REGDEBUG_RRCSTS_Pos (5) /*!< GMAC_T::REGDEBUG: RRCSTS Position */ -#define GMAC_REGDEBUG_RRCSTS_Msk (0x3ul << GMAC_REGDEBUG_RRCSTS_Pos) /*!< GMAC_T::REGDEBUG: RRCSTS Mask */ - -#define GMAC_REGDEBUG_RXFSTS_Pos (8) /*!< GMAC_T::REGDEBUG: RXFSTS Position */ -#define GMAC_REGDEBUG_RXFSTS_Msk (0x3ul << GMAC_REGDEBUG_RXFSTS_Pos) /*!< GMAC_T::REGDEBUG: RXFSTS Mask */ - -#define GMAC_REGDEBUG_TPESTS_Pos (16) /*!< GMAC_T::REGDEBUG: TPESTS Position */ -#define GMAC_REGDEBUG_TPESTS_Msk (0x1ul << GMAC_REGDEBUG_TPESTS_Pos) /*!< GMAC_T::REGDEBUG: TPESTS Mask */ - -#define GMAC_REGDEBUG_TFCSTS_Pos (17) /*!< GMAC_T::REGDEBUG: TFCSTS Position */ -#define GMAC_REGDEBUG_TFCSTS_Msk (0x3ul << GMAC_REGDEBUG_TFCSTS_Pos) /*!< GMAC_T::REGDEBUG: TFCSTS Mask */ - -#define GMAC_REGDEBUG_TXPAUSED_Pos (19) /*!< GMAC_T::REGDEBUG: TXPAUSED Position */ -#define GMAC_REGDEBUG_TXPAUSED_Msk (0x1ul << GMAC_REGDEBUG_TXPAUSED_Pos) /*!< GMAC_T::REGDEBUG: TXPAUSED Mask */ - -#define GMAC_REGDEBUG_TRCSTS_Pos (20) /*!< GMAC_T::REGDEBUG: TRCSTS Position */ -#define GMAC_REGDEBUG_TRCSTS_Msk (0x3ul << GMAC_REGDEBUG_TRCSTS_Pos) /*!< GMAC_T::REGDEBUG: TRCSTS Mask */ - -#define GMAC_REGDEBUG_TWCSTS_Pos (22) /*!< GMAC_T::REGDEBUG: TWCSTS Position */ -#define GMAC_REGDEBUG_TWCSTS_Msk (0x1ul << GMAC_REGDEBUG_TWCSTS_Pos) /*!< GMAC_T::REGDEBUG: TWCSTS Mask */ - -#define GMAC_REGDEBUG_TXFSTS_Pos (24) /*!< GMAC_T::REGDEBUG: TXFSTS Position */ -#define GMAC_REGDEBUG_TXFSTS_Msk (0x1ul << GMAC_REGDEBUG_TXFSTS_Pos) /*!< GMAC_T::REGDEBUG: TXFSTS Mask */ - -#define GMAC_REGDEBUG_TXSTSFSTS_Pos (25) /*!< GMAC_T::REGDEBUG: TXSTSFSTS Position */ -#define GMAC_REGDEBUG_TXSTSFSTS_Msk (0x1ul << GMAC_REGDEBUG_TXSTSFSTS_Pos) /*!< GMAC_T::REGDEBUG: TXSTSFSTS Mask */ - -#define GMAC_PMTCTLSTS_PWRDWN_Pos (0) /*!< GMAC_T::PMTCTLSTS: PWRDWN Position*/ -#define GMAC_PMTCTLSTS_PWRDWN_Msk (0x1ul << GMAC_PMTCTLSTS_PWRDWN_Pos) /*!< GMAC_T::PMTCTLSTS: PWRDWN Mask */ - -#define GMAC_PMTCTLSTS_MGKPKTEN_Pos (1) /*!< GMAC_T::PMTCTLSTS: MGKPKTEN Position*/ -#define GMAC_PMTCTLSTS_MGKPKTEN_Msk (0x1ul << GMAC_PMTCTLSTS_MGKPKTEN_Pos) /*!< GMAC_T::PMTCTLSTS: MGKPKTEN Mask */ - -#define GMAC_PMTCTLSTS_MGKPRCVD_Pos (5) /*!< GMAC_T::PMTCTLSTS: MGKPRCVD Position*/ -#define GMAC_PMTCTLSTS_MGKPRCVD_Msk (0x1ul << GMAC_PMTCTLSTS_MGKPRCVD_Pos) /*!< GMAC_T::PMTCTLSTS: MGKPRCVD Mask */ - -#define GMAC_LPICTLSTS_TLPIEN_Pos (0) /*!< GMAC_T::LPICTLSTS: TLPIEN Position*/ -#define GMAC_LPICTLSTS_TLPIEN_Msk (0x1ul << GMAC_LPICTLSTS_TLPIEN_Pos) /*!< GMAC_T::LPICTLSTS: TLPIEN Mask */ - -#define GMAC_LPICTLSTS_TLPIEX_Pos (1) /*!< GMAC_T::LPICTLSTS: TLPIEX Position*/ -#define GMAC_LPICTLSTS_TLPIEX_Msk (0x1ul << GMAC_LPICTLSTS_TLPIEX_Pos) /*!< GMAC_T::LPICTLSTS: TLPIEX Mask */ - -#define GMAC_LPICTLSTS_RLPIEN_Pos (2) /*!< GMAC_T::LPICTLSTS: RLPIEN Position*/ -#define GMAC_LPICTLSTS_RLPIEN_Msk (0x1ul << GMAC_LPICTLSTS_RLPIEN_Pos) /*!< GMAC_T::LPICTLSTS: RLPIEN Mask */ - -#define GMAC_LPICTLSTS_RLPIEX_Pos (3) /*!< GMAC_T::LPICTLSTS: RLPIEX Position*/ -#define GMAC_LPICTLSTS_RLPIEX_Msk (0x1ul << GMAC_LPICTLSTS_RLPIEX_Pos) /*!< GMAC_T::LPICTLSTS: RLPIEX Mask */ - -#define GMAC_LPICTLSTS_TLPIST_Pos (8) /*!< GMAC_T::LPICTLSTS: TLPIST Position*/ -#define GMAC_LPICTLSTS_TLPIST_Msk (0x1ul << GMAC_LPICTLSTS_TLPIST_Pos) /*!< GMAC_T::LPICTLSTS: TLPIST Mask */ - -#define GMAC_LPICTLSTS_RLPIST_Pos (9) /*!< GMAC_T::LPICTLSTS: RLPIST Position*/ -#define GMAC_LPICTLSTS_RLPIST_Msk (0x1ul << GMAC_LPICTLSTS_RLPIST_Pos) /*!< GMAC_T::LPICTLSTS: RLPIST Mask */ - -#define GMAC_LPICTLSTS_LPIEN_Pos (16) /*!< GMAC_T::LPICTLSTS: LPIEN Position */ -#define GMAC_LPICTLSTS_LPIEN_Msk (0x1ul << GMAC_LPICTLSTS_LPIEN_Pos) /*!< GMAC_T::LPICTLSTS: LPIEN Mask */ - -#define GMAC_LPICTLSTS_PLS_Pos (17) /*!< GMAC_T::LPICTLSTS: PLS Position */ -#define GMAC_LPICTLSTS_PLS_Msk (0x1ul << GMAC_LPICTLSTS_PLS_Pos) /*!< GMAC_T::LPICTLSTS: PLS Mask */ - -#define GMAC_LPICTLSTS_PLSEN_Pos (18) /*!< GMAC_T::LPICTLSTS: PLSEN Position */ -#define GMAC_LPICTLSTS_PLSEN_Msk (0x1ul << GMAC_LPICTLSTS_PLSEN_Pos) /*!< GMAC_T::LPICTLSTS: PLSEN Mask */ - -#define GMAC_LPICTLSTS_LPITXA_Pos (19) /*!< GMAC_T::LPICTLSTS: LPITXA Position*/ -#define GMAC_LPICTLSTS_LPITXA_Msk (0x1ul << GMAC_LPICTLSTS_LPITXA_Pos) /*!< GMAC_T::LPICTLSTS: LPITXA Mask */ - -#define GMAC_LPITMRCTL_TWT_Pos (0) /*!< GMAC_T::LPITMRCTL: TWT Position */ -#define GMAC_LPITMRCTL_TWT_Msk (0xfffful << GMAC_LPITMRCTL_TWT_Pos) /*!< GMAC_T::LPITMRCTL: TWT Mask */ - -#define GMAC_LPITMRCTL_LST_Pos (16) /*!< GMAC_T::LPITMRCTL: LST Position */ -#define GMAC_LPITMRCTL_LST_Msk (0x3fful << GMAC_LPITMRCTL_LST_Pos) /*!< GMAC_T::LPITMRCTL: LST Mask */ - -#define GMAC_INTSTS_RGSMIIIS_Pos (0) /*!< GMAC_T::INTSTS: RGSMIIIS Position */ -#define GMAC_INTSTS_RGSMIIIS_Msk (0x1ul << GMAC_INTSTS_RGSMIIIS_Pos) /*!< GMAC_T::INTSTS: RGSMIIIS Mask */ - -#define GMAC_INTSTS_PMTIS_Pos (3) /*!< GMAC_T::INTSTS: PMTIS Position */ -#define GMAC_INTSTS_PMTIS_Msk (0x1ul << GMAC_INTSTS_PMTIS_Pos) /*!< GMAC_T::INTSTS: PMTIS Mask */ - -#define GMAC_INTSTS_TSIS_Pos (9) /*!< GMAC_T::INTSTS: TSIS Position */ -#define GMAC_INTSTS_TSIS_Msk (0x1ul << GMAC_INTSTS_TSIS_Pos) /*!< GMAC_T::INTSTS: TSIS Mask */ - -#define GMAC_INTSTS_LPIIS_Pos (10) /*!< GMAC_T::INTSTS: LPIIS Position */ -#define GMAC_INTSTS_LPIIS_Msk (0x1ul << GMAC_INTSTS_LPIIS_Pos) /*!< GMAC_T::INTSTS: LPIIS Mask */ - -#define GMAC_INTMSK_RGSMIIIM_Pos (0) /*!< GMAC_T::INTMSK: RGSMIIIM Position */ -#define GMAC_INTMSK_RGSMIIIM_Msk (0x1ul << GMAC_INTMSK_RGSMIIIM_Pos) /*!< GMAC_T::INTMSK: RGSMIIIM INTMSK */ - -#define GMAC_INTMSK_PCSLCHGIM_Pos (1) /*!< GMAC_T::INTMSK: PCSLCHGIM Position */ -#define GMAC_INTMSK_PCSLCHGIM_Msk (0x1ul << GMAC_INTMSK_PCSLCHGIM_Pos) /*!< GMAC_T::INTMSK: PCSLCHGIM INTMSK */ - -#define GMAC_INTMSK_PCSANCIM_Pos (2) /*!< GMAC_T::INTMSK: PCSANCIM Position */ -#define GMAC_INTMSK_PCSANCIM_Msk (0x1ul << GMAC_INTMSK_PCSANCIM_Pos) /*!< GMAC_T::INTMSK: PCSANCIM INTMSK */ - -#define GMAC_INTMSK_PMTIM_Pos (3) /*!< GMAC_T::INTMSK: PMTIM Position */ -#define GMAC_INTMSK_PMTIM_Msk (0x1ul << GMAC_INTMSK_PMTIM_Pos) /*!< GMAC_T::INTMSK: PMTIM INTMSK */ - -#define GMAC_INTMSK_TSIM_Pos (9) /*!< GMAC_T::INTMSK: TSIM Position */ -#define GMAC_INTMSK_TSIM_Msk (0x1ul << GMAC_INTMSK_TSIM_Pos) /*!< GMAC_T::INTMSK: TSIM INTMSK */ - -#define GMAC_INTMSK_LPIIM_Pos (10) /*!< GMAC_T::INTMSK: LPIIM Position */ -#define GMAC_INTMSK_LPIIM_Msk (0x1ul << GMAC_INTMSK_LPIIM_Pos) /*!< GMAC_T::INTMSK: LPIIM INTMSK */ - -#define GMAC_MACADDR0H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR0H: ADDRHI Position */ -#define GMAC_MACADDR0H_ADDRHI_Msk (0xfffful << GMAC_MACADDR0H_ADDRHI_Pos) /*!< GMAC_T::MACADDR0H: ADDRHI Mask */ - -#define GMAC_MACADDR0H_AE_Pos (31) /*!< GMAC_T::MACADDR0H: AE Position */ -#define GMAC_MACADDR0H_AE_Msk (0x1ul << GMAC_MACADDR0H_AE_Pos) /*!< GMAC_T::MACADDR0H: AE Mask */ - -#define GMAC_MACADDR0L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR0L: ADDRLO Position */ -#define GMAC_MACADDR0L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR0L_ADDRLO_Pos) /*!< GMAC_T::MACADDR0L: ADDRLO Mask */ - -#define GMAC_MACADDR1H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR1H: ADDRHI Position */ -#define GMAC_MACADDR1H_ADDRHI_Msk (0xfffful << GMAC_MACADDR1H_ADDRHI_Pos) /*!< GMAC_T::MACADDR1H: ADDRHI Mask */ - -#define GMAC_MACADDR1H_MBC_Pos (24) /*!< GMAC_T::MACADDR1H: MBC Position */ -#define GMAC_MACADDR1H_MBC_Msk (0x3ful << GMAC_MACADDR1H_MBC_Pos) /*!< GMAC_T::MACADDR1H: MBC Mask */ - -#define GMAC_MACADDR1H_SA_Pos (30) /*!< GMAC_T::MACADDR1H: SA Position */ -#define GMAC_MACADDR1H_SA_Msk (0x1ul << GMAC_MACADDR1H_SA_Pos) /*!< GMAC_T::MACADDR1H: SA Mask */ - -#define GMAC_MACADDR1H_AE_Pos (31) /*!< GMAC_T::MACADDR1H: AE Position */ -#define GMAC_MACADDR1H_AE_Msk (0x1ul << GMAC_MACADDR1H_AE_Pos) /*!< GMAC_T::MACADDR1H: AE Mask */ - -#define GMAC_MACADDR1L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR1L: ADDRLO Position */ -#define GMAC_MACADDR1L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR1L_ADDRLO_Pos) /*!< GMAC_T::MACADDR1L: ADDRLO Mask */ - -#define GMAC_MACADDR2H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR2H: ADDRHI Position */ -#define GMAC_MACADDR2H_ADDRHI_Msk (0xfffful << GMAC_MACADDR2H_ADDRHI_Pos) /*!< GMAC_T::MACADDR2H: ADDRHI Mask */ - -#define GMAC_MACADDR2H_MBC_Pos (24) /*!< GMAC_T::MACADDR2H: MBC Position */ -#define GMAC_MACADDR2H_MBC_Msk (0x3ful << GMAC_MACADDR2H_MBC_Pos) /*!< GMAC_T::MACADDR2H: MBC Mask */ - -#define GMAC_MACADDR2H_SA_Pos (30) /*!< GMAC_T::MACADDR2H: SA Position */ -#define GMAC_MACADDR2H_SA_Msk (0x1ul << GMAC_MACADDR2H_SA_Pos) /*!< GMAC_T::MACADDR2H: SA Mask */ - -#define GMAC_MACADDR2H_AE_Pos (31) /*!< GMAC_T::MACADDR2H: AE Position */ -#define GMAC_MACADDR2H_AE_Msk (0x1ul << GMAC_MACADDR2H_AE_Pos) /*!< GMAC_T::MACADDR2H: AE Mask */ - -#define GMAC_MACADDR2L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR2L: ADDRLO Position */ -#define GMAC_MACADDR2L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR2L_ADDRLO_Pos) /*!< GMAC_T::MACADDR2L: ADDRLO Mask */ - -#define GMAC_MACADDR3H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR3H: ADDRHI Position */ -#define GMAC_MACADDR3H_ADDRHI_Msk (0xfffful << GMAC_MACADDR3H_ADDRHI_Pos) /*!< GMAC_T::MACADDR3H: ADDRHI Mask */ - -#define GMAC_MACADDR3H_MBC_Pos (24) /*!< GMAC_T::MACADDR3H: MBC Position */ -#define GMAC_MACADDR3H_MBC_Msk (0x3ful << GMAC_MACADDR3H_MBC_Pos) /*!< GMAC_T::MACADDR3H: MBC Mask */ - -#define GMAC_MACADDR3H_SA_Pos (30) /*!< GMAC_T::MACADDR3H: SA Position */ -#define GMAC_MACADDR3H_SA_Msk (0x1ul << GMAC_MACADDR3H_SA_Pos) /*!< GMAC_T::MACADDR3H: SA Mask */ - -#define GMAC_MACADDR3H_AE_Pos (31) /*!< GMAC_T::MACADDR3H: AE Position */ -#define GMAC_MACADDR3H_AE_Msk (0x1ul << GMAC_MACADDR3H_AE_Pos) /*!< GMAC_T::MACADDR3H: AE Mask */ - -#define GMAC_MACADDR3L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR3L: ADDRLO Position */ -#define GMAC_MACADDR3L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR3L_ADDRLO_Pos) /*!< GMAC_T::MACADDR3L: ADDRLO Mask */ - -#define GMAC_MACADDR4H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR4H: ADDRHI Position */ -#define GMAC_MACADDR4H_ADDRHI_Msk (0xfffful << GMAC_MACADDR4H_ADDRHI_Pos) /*!< GMAC_T::MACADDR4H: ADDRHI Mask */ - -#define GMAC_MACADDR4H_MBC_Pos (24) /*!< GMAC_T::MACADDR4H: MBC Position */ -#define GMAC_MACADDR4H_MBC_Msk (0x3ful << GMAC_MACADDR4H_MBC_Pos) /*!< GMAC_T::MACADDR4H: MBC Mask */ - -#define GMAC_MACADDR4H_SA_Pos (30) /*!< GMAC_T::MACADDR4H: SA Position */ -#define GMAC_MACADDR4H_SA_Msk (0x1ul << GMAC_MACADDR4H_SA_Pos) /*!< GMAC_T::MACADDR4H: SA Mask */ - -#define GMAC_MACADDR4H_AE_Pos (31) /*!< GMAC_T::MACADDR4H: AE Position */ -#define GMAC_MACADDR4H_AE_Msk (0x1ul << GMAC_MACADDR4H_AE_Pos) /*!< GMAC_T::MACADDR4H: AE Mask */ - -#define GMAC_MACADDR4L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR4L: ADDRLO Position */ -#define GMAC_MACADDR4L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR4L_ADDRLO_Pos) /*!< GMAC_T::MACADDR4L: ADDRLO Mask */ - -#define GMAC_MACADDR5H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR5H: ADDRHI Position */ -#define GMAC_MACADDR5H_ADDRHI_Msk (0xfffful << GMAC_MACADDR5H_ADDRHI_Pos) /*!< GMAC_T::MACADDR5H: ADDRHI Mask */ - -#define GMAC_MACADDR5H_MBC_Pos (24) /*!< GMAC_T::MACADDR5H: MBC Position */ -#define GMAC_MACADDR5H_MBC_Msk (0x3ful << GMAC_MACADDR5H_MBC_Pos) /*!< GMAC_T::MACADDR5H: MBC Mask */ - -#define GMAC_MACADDR5H_SA_Pos (30) /*!< GMAC_T::MACADDR5H: SA Position */ -#define GMAC_MACADDR5H_SA_Msk (0x1ul << GMAC_MACADDR5H_SA_Pos) /*!< GMAC_T::MACADDR5H: SA Mask */ - -#define GMAC_MACADDR5H_AE_Pos (31) /*!< GMAC_T::MACADDR5H: AE Position */ -#define GMAC_MACADDR5H_AE_Msk (0x1ul << GMAC_MACADDR5H_AE_Pos) /*!< GMAC_T::MACADDR5H: AE Mask */ - -#define GMAC_MACADDR5L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR5L: ADDRLO Position */ -#define GMAC_MACADDR5L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR5L_ADDRLO_Pos) /*!< GMAC_T::MACADDR5L: ADDRLO Mask */ - -#define GMAC_MACADDR6H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR6H: ADDRHI Position */ -#define GMAC_MACADDR6H_ADDRHI_Msk (0xfffful << GMAC_MACADDR6H_ADDRHI_Pos) /*!< GMAC_T::MACADDR6H: ADDRHI Mask */ - -#define GMAC_MACADDR6H_MBC_Pos (24) /*!< GMAC_T::MACADDR6H: MBC Position */ -#define GMAC_MACADDR6H_MBC_Msk (0x3ful << GMAC_MACADDR6H_MBC_Pos) /*!< GMAC_T::MACADDR6H: MBC Mask */ - -#define GMAC_MACADDR6H_SA_Pos (30) /*!< GMAC_T::MACADDR6H: SA Position */ -#define GMAC_MACADDR6H_SA_Msk (0x1ul << GMAC_MACADDR6H_SA_Pos) /*!< GMAC_T::MACADDR6H: SA Mask */ - -#define GMAC_MACADDR6H_AE_Pos (31) /*!< GMAC_T::MACADDR6H: AE Position */ -#define GMAC_MACADDR6H_AE_Msk (0x1ul << GMAC_MACADDR6H_AE_Pos) /*!< GMAC_T::MACADDR6H: AE Mask */ - -#define GMAC_MACADDR6L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR6L: ADDRLO Position */ -#define GMAC_MACADDR6L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR6L_ADDRLO_Pos) /*!< GMAC_T::MACADDR6L: ADDRLO Mask */ - -#define GMAC_MACADDR7H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR7H: ADDRHI Position */ -#define GMAC_MACADDR7H_ADDRHI_Msk (0xfffful << GMAC_MACADDR7H_ADDRHI_Pos) /*!< GMAC_T::MACADDR7H: ADDRHI Mask */ - -#define GMAC_MACADDR7H_MBC_Pos (24) /*!< GMAC_T::MACADDR7H: MBC Position */ -#define GMAC_MACADDR7H_MBC_Msk (0x3ful << GMAC_MACADDR7H_MBC_Pos) /*!< GMAC_T::MACADDR7H: MBC Mask */ - -#define GMAC_MACADDR7H_SA_Pos (30) /*!< GMAC_T::MACADDR7H: SA Position */ -#define GMAC_MACADDR7H_SA_Msk (0x1ul << GMAC_MACADDR7H_SA_Pos) /*!< GMAC_T::MACADDR7H: SA Mask */ - -#define GMAC_MACADDR7H_AE_Pos (31) /*!< GMAC_T::MACADDR7H: AE Position */ -#define GMAC_MACADDR7H_AE_Msk (0x1ul << GMAC_MACADDR7H_AE_Pos) /*!< GMAC_T::MACADDR7H: AE Mask */ - -#define GMAC_MACADDR7L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR7L: ADDRLO Position */ -#define GMAC_MACADDR7L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR7L_ADDRLO_Pos) /*!< GMAC_T::MACADDR7L: ADDRLO Mask */ - -#define GMAC_MACADDR8H_ADDRHI_Pos (0) /*!< GMAC_T::MACADDR8H: ADDRHI Position */ -#define GMAC_MACADDR8H_ADDRHI_Msk (0xfffful << GMAC_MACADDR8H_ADDRHI_Pos) /*!< GMAC_T::MACADDR8H: ADDRHI Mask */ - -#define GMAC_MACADDR8H_MBC_Pos (24) /*!< GMAC_T::MACADDR8H: MBC Position */ -#define GMAC_MACADDR8H_MBC_Msk (0x3ful << GMAC_MACADDR8H_MBC_Pos) /*!< GMAC_T::MACADDR8H: MBC Mask */ - -#define GMAC_MACADDR8H_SA_Pos (30) /*!< GMAC_T::MACADDR8H: SA Position */ -#define GMAC_MACADDR8H_SA_Msk (0x1ul << GMAC_MACADDR8H_SA_Pos) /*!< GMAC_T::MACADDR8H: SA Mask */ - -#define GMAC_MACADDR8H_AE_Pos (31) /*!< GMAC_T::MACADDR8H: AE Position */ -#define GMAC_MACADDR8H_AE_Msk (0x1ul << GMAC_MACADDR8H_AE_Pos) /*!< GMAC_T::MACADDR8H: AE Mask */ - -#define GMAC_MACADDR8L_ADDRLO_Pos (0) /*!< GMAC_T::MACADDR8L: ADDRLO Position */ -#define GMAC_MACADDR8L_ADDRLO_Msk (0xfffffffful << GMAC_MACADDR8L_ADDRLO_Pos) /*!< GMAC_T::MACADDR8L: ADDRLO Mask */ - -#define GMAC_RGMIICTLSTS_LNKMOD_Pos (0) /*!< GMAC_T::RGMIICTLSTS: LNKMOD Position*/ -#define GMAC_RGMIICTLSTS_LNKMOD_Msk (0x1ul << GMAC_RGMIICTLSTS_LNKMOD_Pos) /*!< GMAC_T::RGMIICTLSTS: LNKMOD Mask */ - -#define GMAC_RGMIICTLSTS_LNKSPEED_Pos (1) /*!< GMAC_T::RGMIICTLSTS: LNKSPEED Position*/ -#define GMAC_RGMIICTLSTS_LNKSPEED_Msk (0x3ul << GMAC_RGMIICTLSTS_LNKSPEED_Pos) /*!< GMAC_T::RGMIICTLSTS: LNKSPEED Mask */ - -#define GMAC_RGMIICTLSTS_LNKSTS_Pos (3) /*!< GMAC_T::RGMIICTLSTS: LNKSTS Position*/ -#define GMAC_RGMIICTLSTS_LNKSTS_Msk (0x1ul << GMAC_RGMIICTLSTS_LNKSTS_Pos) /*!< GMAC_T::RGMIICTLSTS: LNKSTS Mask */ - -#define GMAC_WDTOUT_WTO_Pos (0) /*!< GMAC_T::WDTOUT: WTO Position */ -#define GMAC_WDTOUT_WTO_Msk (0x3ffful << GMAC_WDTOUT_WTO_Pos) /*!< GMAC_T::WDTOUT: WTO Mask */ - -#define GMAC_WDTOUT_PWE_Pos (16) /*!< GMAC_T::WDTOUT: PWE Position */ -#define GMAC_WDTOUT_PWE_Msk (0x1ul << GMAC_WDTOUT_PWE_Pos) /*!< GMAC_T::WDTOUT: PWE Mask */ - -#define GMAC_VLANINCL_VLT_Pos (0) /*!< GMAC_T::VLANINCL: VLT Position */ -#define GMAC_VLANINCL_VLT_Msk (0xfffful << GMAC_VLANINCL_VLT_Pos) /*!< GMAC_T::VLANINCL: VLT Mask */ - -#define GMAC_VLANINCL_VLC_Pos (16) /*!< GMAC_T::VLANINCL: VLC Position */ -#define GMAC_VLANINCL_VLC_Msk (0x3ul << GMAC_VLANINCL_VLC_Pos) /*!< GMAC_T::VLANINCL: VLC Mask */ - -#define GMAC_VLANINCL_VLP_Pos (18) /*!< GMAC_T::VLANINCL: VLP Position */ -#define GMAC_VLANINCL_VLP_Msk (0x1ul << GMAC_VLANINCL_VLP_Pos) /*!< GMAC_T::VLANINCL: VLP Mask */ - -#define GMAC_VLANINCL_CSVL_Pos (19) /*!< GMAC_T::VLANINCL: CSVL Position */ -#define GMAC_VLANINCL_CSVL_Msk (0x1ul << GMAC_VLANINCL_CSVL_Pos) /*!< GMAC_T::VLANINCL: CSVL Mask */ - -#define GMAC_TSCTL_TSENA_Pos (0) /*!< GMAC_T::TSCTL: TSENA Position */ -#define GMAC_TSCTL_TSENA_Msk (0x1ul << GMAC_TSCTL_TSENA_Pos) /*!< GMAC_T::TSCTL: TSENA Mask */ - -#define GMAC_TSCTL_TSCFUPDT_Pos (1) /*!< GMAC_T::TSCTL: TSCFUPDT Position */ -#define GMAC_TSCTL_TSCFUPDT_Msk (0x1ul << GMAC_TSCTL_TSCFUPDT_Pos) /*!< GMAC_T::TSCTL: TSCFUPDT Mask */ - -#define GMAC_TSCTL_TSINIT_Pos (2) /*!< GMAC_T::TSCTL: TSINIT Position */ -#define GMAC_TSCTL_TSINIT_Msk (0x1ul << GMAC_TSCTL_TSINIT_Pos) /*!< GMAC_T::TSCTL: TSINIT Mask */ - -#define GMAC_TSCTL_TSUPDT_Pos (3) /*!< GMAC_T::TSCTL: TSUPDT Position */ -#define GMAC_TSCTL_TSUPDT_Msk (0x1ul << GMAC_TSCTL_TSUPDT_Pos) /*!< GMAC_T::TSCTL: TSUPDT Mask */ - -#define GMAC_TSCTL_TSTRIG_Pos (4) /*!< GMAC_T::TSCTL: TSTRIG Position */ -#define GMAC_TSCTL_TSTRIG_Msk (0x1ul << GMAC_TSCTL_TSTRIG_Pos) /*!< GMAC_T::TSCTL: TSTRIG Mask */ - -#define GMAC_TSCTL_TSADDREG_Pos (5) /*!< GMAC_T::TSCTL: TSADDREG Position */ -#define GMAC_TSCTL_TSADDREG_Msk (0x1ul << GMAC_TSCTL_TSADDREG_Pos) /*!< GMAC_T::TSCTL: TSADDREG Mask */ - -#define GMAC_TSCTL_TSENALL_Pos (8) /*!< GMAC_T::TSCTL: TSENALL Position */ -#define GMAC_TSCTL_TSENALL_Msk (0x1ul << GMAC_TSCTL_TSENALL_Pos) /*!< GMAC_T::TSCTL: TSENALL Mask */ - -#define GMAC_TSCTL_TSCTRLSSR_Pos (9) /*!< GMAC_T::TSCTL: TSCTRLSSR Position */ -#define GMAC_TSCTL_TSCTRLSSR_Msk (0x1ul << GMAC_TSCTL_TSCTRLSSR_Pos) /*!< GMAC_T::TSCTL: TSCTRLSSR Mask */ - -#define GMAC_TSCTL_TSVER2ENA_Pos (10) /*!< GMAC_T::TSCTL: TSVER2ENA Position */ -#define GMAC_TSCTL_TSVER2ENA_Msk (0x1ul << GMAC_TSCTL_TSVER2ENA_Pos) /*!< GMAC_T::TSCTL: TSVER2ENA Mask */ - -#define GMAC_TSCTL_TSIPENA_Pos (11) /*!< GMAC_T::TSCTL: TSIPENA Position */ -#define GMAC_TSCTL_TSIPENA_Msk (0x1ul << GMAC_TSCTL_TSIPENA_Pos) /*!< GMAC_T::TSCTL: TSIPENA Mask */ - -#define GMAC_TSCTL_TSIPV6ENA_Pos (12) /*!< GMAC_T::TSCTL: TSIPV6ENA Position */ -#define GMAC_TSCTL_TSIPV6ENA_Msk (0x1ul << GMAC_TSCTL_TSIPV6ENA_Pos) /*!< GMAC_T::TSCTL: TSIPV6ENA Mask */ - -#define GMAC_TSCTL_TSIPV4ENA_Pos (13) /*!< GMAC_T::TSCTL: TSIPV4ENA Position */ -#define GMAC_TSCTL_TSIPV4ENA_Msk (0x1ul << GMAC_TSCTL_TSIPV4ENA_Pos) /*!< GMAC_T::TSCTL: TSIPV4ENA Mask */ - -#define GMAC_TSCTL_TSEVNTENA_Pos (14) /*!< GMAC_T::TSCTL: TSEVNTENA Position */ -#define GMAC_TSCTL_TSEVNTENA_Msk (0x1ul << GMAC_TSCTL_TSEVNTENA_Pos) /*!< GMAC_T::TSCTL: TSEVNTENA Mask */ - -#define GMAC_TSCTL_TSMSTRENA_Pos (15) /*!< GMAC_T::TSCTL: TSMSTRENA Position */ -#define GMAC_TSCTL_TSMSTRENA_Msk (0x1ul << GMAC_TSCTL_TSMSTRENA_Pos) /*!< GMAC_T::TSCTL: TSMSTRENA Mask */ - -#define GMAC_TSCTL_SNAPTYPSEL_Pos (16) /*!< GMAC_T::TSCTL: SNAPTYPSEL Position */ -#define GMAC_TSCTL_SNAPTYPSEL_Msk (0x3ul << GMAC_TSCTL_SNAPTYPSEL_Pos) /*!< GMAC_T::TSCTL: SNAPTYPSEL Mask */ - -#define GMAC_TSCTL_TSENMACADDR_Pos (18) /*!< GMAC_T::TSCTL: TSENMACADDR Position */ -#define GMAC_TSCTL_TSENMACADDR_Msk (0x1ul << GMAC_TSCTL_TSENMACADDR_Pos) /*!< GMAC_T::TSCTL: TSENMACADDR Mask */ - -#define GMAC_SSECINC_SSINC_Pos (0) /*!< GMAC_T::SSECINC: SSINC Position */ -#define GMAC_SSECINC_SSINC_Msk (0xfful << GMAC_SSECINC_SSINC_Pos) /*!< GMAC_T::SSECINC: SSINC Mask */ - -#define GMAC_STSEC_TSS_Pos (0) /*!< GMAC_T::STSEC: TSS Position */ -#define GMAC_STSEC_TSS_Msk (0xfffffffful << GMAC_STSEC_TSS_Pos) /*!< GMAC_T::STSEC: TSS Mask */ - -#define GMAC_STNSEC_TSSS_Pos (0) /*!< GMAC_T::STNSEC: TSSS Position */ -#define GMAC_STNSEC_TSSS_Msk (0x7ffffffful << GMAC_STNSEC_TSSS_Pos) /*!< GMAC_T::STNSEC: TSSS Mask */ - -#define GMAC_STSECU_TSS_Pos (0) /*!< GMAC_T::STSECU: TSS Position */ -#define GMAC_STSECU_TSS_Msk (0xfffffffful << GMAC_STSECU_TSS_Pos) /*!< GMAC_T::STSECU: TSS Mask */ - -#define GMAC_STNSECU_TSSS_Pos (0) /*!< GMAC_T::STNSECU: TSSS Position */ -#define GMAC_STNSECU_TSSS_Msk (0x7ffffffful << GMAC_STNSECU_TSSS_Pos) /*!< GMAC_T::STNSECU: TSSS Mask */ - -#define GMAC_STNSECU_ADDSUB_Pos (31) /*!< GMAC_T::STNSECU: ADDSUB Position */ -#define GMAC_STNSECU_ADDSUB_Msk (0x1ul << GMAC_STNSECU_ADDSUB_Pos) /*!< GMAC_T::STNSECU: ADDSUB Mask */ - -#define GMAC_TSADDEND_TSAR_Pos (0) /*!< GMAC_T::TSADDEND: TSAR Position */ -#define GMAC_TSADDEND_TSAR_Msk (0xfffffffful << GMAC_TSADDEND_TSAR_Pos) /*!< GMAC_T::TSADDEND: TSAR Mask */ - -#define GMAC_TGTSEC_TSTR_Pos (0) /*!< GMAC_T::TGTSEC: TSTR Position */ -#define GMAC_TGTSEC_TSTR_Msk (0xfffffffful << GMAC_TGTSEC_TSTR_Pos) /*!< GMAC_T::TGTSEC: TSTR Mask */ - -#define GMAC_TGTNSEC_TTSLO_Pos (0) /*!< GMAC_T::TGTNSEC: TTSLO Position */ -#define GMAC_TGTNSEC_TTSLO_Msk (0x7ffffffful << GMAC_TGTNSEC_TTSLO_Pos) /*!< GMAC_T::TGTNSEC: TTSLO Mask */ - -#define GMAC_TGTNSEC_TRGTBUSY_Pos (31) /*!< GMAC_T::TGTNSEC: TRGTBUSY Position */ -#define GMAC_TGTNSEC_TRGTBUSY_Msk (0x1ul << GMAC_TGTNSEC_TRGTBUSY_Pos) /*!< GMAC_T::TGTNSEC: TRGTBUSY Mask */ - -#define GMAC_STHSEC_TSHWR_Pos (0) /*!< GMAC_T::STHSEC: TSHWR Position */ -#define GMAC_STHSEC_TSHWR_Msk (0xfffful << GMAC_STHSEC_TSHWR_Pos) /*!< GMAC_T::STHSEC: TSHWR Mask */ - -#define GMAC_TSSTS_TSSOVF_Pos (0) /*!< GMAC_T::TSSTS: TSSOVF Position */ -#define GMAC_TSSTS_TSSOVF_Msk (0x1ul << GMAC_TSSTS_TSSOVF_Pos) /*!< GMAC_T::TSSTS: TSSOVF Mask */ - -#define GMAC_TSSTS_TSTARGT_Pos (1) /*!< GMAC_T::TSSTS: TSTARGT Position */ -#define GMAC_TSSTS_TSTARGT_Msk (0x1ul << GMAC_TSSTS_TSTARGT_Pos) /*!< GMAC_T::TSSTS: TSTARGT Mask */ - -#define GMAC_TSSTS_AUXTSTRIG_Pos (2) /*!< GMAC_T::TSSTS: AUXTSTRIG Position */ -#define GMAC_TSSTS_AUXTSTRIG_Msk (0x1ul << GMAC_TSSTS_AUXTSTRIG_Pos) /*!< GMAC_T::TSSTS: AUXTSTRIG Mask */ - -#define GMAC_TSSTS_TSTRGTERR_Pos (3) /*!< GMAC_T::TSSTS: TSTRGTERR Position */ -#define GMAC_TSSTS_TSTRGTERR_Msk (0x1ul << GMAC_TSSTS_TSTRGTERR_Pos) /*!< GMAC_T::TSSTS: TSTRGTERR Mask */ - -#define GMAC_TSSTS_ATSSTN_Pos (16) /*!< GMAC_T::TSSTS: ATSSTN Position */ -#define GMAC_TSSTS_ATSSTN_Msk (0xful << GMAC_TSSTS_ATSSTN_Pos) /*!< GMAC_T::TSSTS: ATSSTN Mask */ - -#define GMAC_PPSCTL_PPSCTL_PPSCMD_Pos (0) /*!< GMAC_T::PPSCTL: PPSCTL_PPSCMD Position*/ -#define GMAC_PPSCTL_PPSCTL_PPSCMD_Msk (0xful << GMAC_PPSCTL_PPSCTL_PPSCMD_Pos) /*!< GMAC_T::PPSCTL: PPSCTL_PPSCMD Mask */ - -#define GMAC_PPSCTL_PPSEN0_Pos (4) /*!< GMAC_T::PPSCTL: PPSEN0 Position */ -#define GMAC_PPSCTL_PPSEN0_Msk (0x1ul << GMAC_PPSCTL_PPSEN0_Pos) /*!< GMAC_T::PPSCTL: PPSEN0 Mask */ - -#define GMAC_PPSCTL_TRGTMODSEL0_Pos (5) /*!< GMAC_T::PPSCTL: TRGTMODSEL0 Position */ -#define GMAC_PPSCTL_TRGTMODSEL0_Msk (0x3ul << GMAC_PPSCTL_TRGTMODSEL0_Pos) /*!< GMAC_T::PPSCTL: TRGTMODSEL0 Mask */ - -#define GMAC_PPSINTVL_PPSINT_Pos (0) /*!< GMAC_T::PPSINTVL: PPSINT Position */ -#define GMAC_PPSINTVL_PPSINT_Msk (0xfffffffful << GMAC_PPSINTVL_PPSINT_Pos) /*!< GMAC_T::PPSINTVL: PPSINT Mask */ - -#define GMAC_PPSWDTH_PPSWIDTH_Pos (0) /*!< GMAC_T::PPSWDTH: PPSWIDTH Position */ -#define GMAC_PPSWDTH_PPSWIDTH_Msk (0xfffffffful << GMAC_PPSWDTH_PPSWIDTH_Pos) /*!< GMAC_T::PPSWDTH: PPSWIDTH Mask */ - -/**@}*/ /* GMAC_CONST */ -/**@}*/ /* end of GMAC register group */ - -/** - @addtogroup GMAC Gigabit Ethernet MAC DMA(GMACDMA) - Memory Mapped Structure for GMAC DMA -@{ */ - -typedef struct -{ - - /** - * @var GMACDMA_T::BUSMODE - * Offset: 0x0000 Register 1000 (Bus Mode Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWR |Software Reset - * | | |When this bit is set, the MAC DMA Controller resets the logic and all internal registers of the MAC - * | | |It is cleared automatically after the reset operation has completed in all of the GMAC clock domains - * | | |Before reprogramming any register of the GMAC, you should read a zero (0) value in this bit . - * | | |Note: - * | | |The Software reset function is driven only by this bit. - * | | |The reset operation is completed only when all resets in all active clock domains are de-asserted - * | | |Therefore, it is essential that all the PHY inputs clocks (applicable for the selected PHY interface) are present for the software reset completion. - * |[6:2] |DSL |Descriptor Skip Length - * | | |This bit specifies the number of Word, Dword, or Lword (depending on the 32-bit, 64-bit, or 128-bit bus) to skip between two unchained descriptors - * | | |The address skipping starts from the end of current descriptor to the start of next descriptor - * | | |When the DSL value is equal to zero, the descriptor table is taken as contiguous by the DMA in Ring mode. - * |[7] |ATDS |Alternate Descriptor Size - * | | |When set, the size of the alternate descriptor increases to 32 bytes (8 DWORDS) - * | | |This is required when the Advanced Timestamp feature or the IPC Full Offload Engine (Type 2) is enabled in the receiver - * | | |The enhanced descriptor is not required if the Advanced Timestamp and IPC Full Checksum Offload (Type 2) features are not enabled - * | | |In such cases, you can use the 16 bytes descriptor to save 4 bytes of memory. - * | | |When reset, the descriptor size reverts back to 4 DWORDs (16 bytes) - * | | |This bit preserves the backward compatibility for the descriptor size - * | | |In versions prior to 3.50a, the descriptor size is 16 bytes for both normal and enhanced descriptor - * | | |In version 3.50a, descriptor size is increased to 32 bytes because of the Advanced Timestamp and IPC Full Checksum Offload Engine (Type 2) features. - * |[13:8] |PBL |Programmable Burst Length - * | | |These bits indicate the maximum number of beats to be transferred in one DMA transaction - * | | |This is the maximum value that is used in a single block Read or Write - * | | |The DMA always attempts to burst as specified in PBL each time it starts a Burst transfer on the host bus - * | | |PBL can be programmed with permissible values of 1, 2, 4, 8, 16, and 32 - * | | |Any other value results in undefined behavior - * | | |When USP is set high, this PBL value is applicable only for Tx DMA transactions - * | | |If the number of beats to be transferred is more than 32, then perform the following steps: - * | | |1. Set the PBLx8 mode. - * | | |2. Set the PBL. - * | | |For example, if the maximum number of beats to be transferred is 64, then first set PBLx8 to 1 and then set PBL to 8 - * | | |The PBL values have the following limitation: The maximum number of possible beats (PBL) is limited by the size of the Tx FIFO and Rx FIFO in the MTL layer and the data bus width on the DMA - * | | |The FIFO has a constraint that the maximum beat supported is half the depth of the FIFO, except when specified. - * | | |For different data bus widths and FIFO sizes, the valid PBL range (including x8 mode) is provided in the following list - * | | |If the PBL is common for both transmit and receive DMA, the minimum Rx FIFO and Tx FIFO depths must be considered. - * | | |Note: In the half-duplex mode, the valid PBL range specified in the following list is applicable only for Tx FIFO. - * | | |* 32-Bit Data Bus PPSWDTH - * | | |128 Bytes FIFO Depth: In the full-duplex mode, the valid PBL range is 16 or less - * | | |In the half-duplex mode, the valid PBL range is 8 or less for the 10 or 100 Mbps mode. - * | | |256 Bytes FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 32 or less. - * | | |512 Bytes FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 64 or less. - * | | |1 KB FIFO Depth: In the full-duplex mode, the valid PBL range is 128 or less - * | | |In the half-duplex mode, the valid PBL range is 128 or less in the 10 or 100 Mbps mode and 64 or less in the 1000 Mbps mode. - * | | |2 KB and Higher FIFO Depth: All PBL values are supported in the full-duplex mode and half-duplex modes. - * | | |* 64-Bit Data Bus PPSWDTH - * | | |128 Bytes FIFO Depth: In the full-duplex mode, the valid PBL range is 8 or less - * | | |In the half-duplex mode, the valid PBL range is 4 or less for the 10 or 100 Mbps mode. - * | | |256 Bytes FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 16 or less. - * | | |512 Bytes FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 32 or less. - * | | |1 KB FIFO Depth: In the full-duplex mode, the valid PBL range is 64 or less - * | | |In the half-duplex mode, the valid PBL range is 64 or less in the 10 or 100 Mbps mode and 32 or less in the 1000-Mbps mode. - * | | |2 KB FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 128 or less. - * | | |4 KB and Higher FIFO Depth: All PBL values are supported in the full-duplex and half-duplex modes. - * | | |* 128-Bit Data Bus PPSWDTH - * | | |128 Bytes FIFO Depth: In the full-duplex mode, the valid PBL range is 4 or less - * | | |In the half-duplex mode, the valid PBL range is 2 or less for the 10 or 100 Mbps mode. - * | | |256 Bytes FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 8 or less. - * | | |512 Bytes FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 16 or less. - * | | |1 KB FIFO Depth: In the full-duplex mode, the valid PBL range is 32 or less - * | | |In the half-duplex mode, the valid PBL range is 32 or less in the 10 or 100 Mbps mode and 16 or less in the 1000-Mbps mode. - * | | |2 KB FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 64 or less. - * | | |4 KB FIFO Depth: In the full-duplex mode and the half-duplex (10 or 100 Mbps) modes, the valid PBL range is 128 or less. - * | | |8 KB and Higher FIFO Depth: All PBL values are supported in the full-duplex and half-duplex modes. - * |[16] |FB |Fixed Burst - * | | |This bit controls whether the AHB or AXI Master interface performs fixed burst transfers or not - * | | |When set, the AHB interface uses only SINGLE, INCR4, INCR8, or INCR16 during start of the normal burst transfers - * | | |When reset, the AHB or AXI interface uses SINGLE and INCR burst transfer operations. - * | | |For more information, see Bit 0 (UNDEF) of the AXI Bus Mode register. - * |[22:17] |RPBL |Rx DMA PBL - * | | |This field indicates the maximum number of beats to be transferred in one Rx DMA transaction - * | | |This is the maximum value that is used in a single block Read or Write. - * | | |The Rx DMA always attempts to burst as specified in the RPBL bit each time it starts a Burst transfer on the host bus - * | | |You can program RPBL with values of 1, 2, 4, 8, 16, and 32 - * | | |Any other value results in undefined behavior - * | | |This field is valid and applicable only when USP is set high. - * |[23] |USP |Use Separate PBL - * | | |When set high, this bit configures the Rx DMA to use the value configured in Bits[22:17] as PBL - * | | |The PBL value in Bits[13:8] is applicable only to the Tx DMA operations. - * | | |When reset to low, the PBL value in Bits[13:8] is applicable for both DMA engines. - * |[24] |PBLx8 |PBLx8 Mode - * | | |When set high, this bit multiplies the programmed PBL value (Bits[22:17] and Bits[13:8]) eight times - * | | |Therefore, the DMA transfers the data in 8, 16, 32, 64, 128, and 256 beats depending on the PBL value - * |[25] |AAL |Address Aligned Beats - * | | |When this bit is set high and the FB bit is equal to 1, the AHB or AXI interface generates all bursts aligned to the start address LS bits - * | | |If the FB bit is equal to 0, the first burst (accessing the data buffer's start address) is not aligned, but subsequent bursts are aligned to the address. - * @var GMACDMA_T::TXDEM - * Offset: 0x0004 Register 1001 (Transmit Poll Demand Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TPD |Transmit Poll Demand - * | | |When these bits are written with any value, the DMA reads the current descriptor pointed to by Register 1018 (Current Host Transmit Descriptor Register) - * | | |If that descriptor is not available (owned by the Host), the transmission returns to the Suspend state and the Bit 2 (TU) of Register 1005 (Status Register) is asserted - * | | |If the descriptor is available, the transmission resumes. - * @var GMACDMA_T::RXDEM - * Offset: 0x0008 Register 1002 (Receive Poll Demand Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RPD |Receive Poll Demand - * | | |When these bits are written with any value, the DMA reads the current descriptor pointed to by Register 1019 (Current Host Receive Descriptor Register) - * | | |If that descriptor is not available (owned by the Host), the reception returns to the Suspended state and the Bit 7 (RU) of Register 1005 (Status Register) is not asserted - * | | |If the descriptor is available, the Rx DMA returns to the active state. - * @var GMACDMA_T::RXDADDR - * Offset: 0x000C Register 1003 (Receive Descriptor List Address Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:3] |RDESLA_64_bit|Start of Receive List - * | | |This field contains the base address of the first descriptor in the Receive Descriptor list - * | | |The LSB bits (2:0) for 64-bit bus width are ignored and are internally taken as all-zero by the DMA - * | | |Therefore, these LSB bits are read-only (RO). - * @var GMACDMA_T::TXDADDR - * Offset: 0x0010 Register 1004 (Transmit Descriptor List Address Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:3] |TDESLA_64_bit|Start of Transmit List - * | | |This field contains the base address of the first descriptor in the Transmit Descriptor list - * | | |The LSB bits (2:0) for 64-bit bus width are ignored and are internally taken as all-zero by the DMA - * | | |Therefore, these LSB bits are read-only (RO). - * @var GMACDMA_T::Status - * Offset: 0x0014 Register 1005 (Status Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TI |Transmit Interrupt - * | | |This bit indicates that the frame transmission is complete - * | | |When transmission is complete, Bit 31 (OWN) of TDES0 is reset, and the specific frame status information is updated in the descriptor. - * |[1] |TPS |Transmit Process Stopped - * | | |This bit is set when the transmission is stopped. - * |[2] |TU |Transmit Buffer Unavailable - * | | |This bit indicates that the host owns the Next Descriptor in the Transmit List and the DMA cannot acquire it - * | | |Transmission is suspended - * | | |Bits[22:20] explain the Transmit Process state transitions. - * | | |To resume processing Transmit descriptors, the host should change the ownership of the descriptor by setting TDES0[31] and then issue a Transmit Poll Demand command. - * |[3] |TJT |Transmit Jabber Timeout - * | | |This bit indicates that the Transmit Jabber Timer expired, which happens when the frame size exceeds 2,048 (10,240 bytes when the Jumbo frame is enabled) - * | | |When the Jabber Timeout occurs, the transmission process is aborted and placed in the Stopped state - * | | |This causes the Transmit Jabber Timeout TDES0[14] flag to assert. - * |[4] |OVF |Receive Overflow - * | | |This bit indicates that the Receive Buffer had an Overflow during frame reception - * | | |If the partial frame is transferred to the application, the overflow status is set in RDES0[11]. - * |[5] |UNF |Transmit Underflow - * | | |This bit indicates that the Transmit Buffer had an Underflow during frame transmission - * | | |Transmission is suspended and an Underflow Error TDES0[1] is set. - * |[6] |RI |Receive Interrupt - * | | |This bit indicates that the frame reception is complete - * | | |When reception is complete, the Bit 31 of RDES1 (Disable Interrupt on Completion) is reset in the last Descriptor, and the specific frame status information is updated in the descriptor - * | | |The reception remains in the Running state. - * |[7] |RU |Receive Buffer Unavailable - * | | |This bit indicates that the host owns the Next Descriptor in the Receive List and the DMA cannot acquire it - * | | |The Receive Process is suspended - * | | |To resume processing Receive descriptors, the host should change the ownership of the descriptor and issue a Receive Poll Demand command - * | | |If no Receive Poll Demand is issued, the Receive Process resumes when the next recognized incoming frame is received - * | | |This bit is set only when the previous Receive Descriptor is owned by the DMA. - * |[8] |RPS |Receive Process Stopped - * | | |This bit is asserted when the Receive Process enters the Stopped state. - * |[9] |RWT |Receive Watchdog Timeout - * | | |When set, this bit indicates that the Receive Watchdog Timer expired while receiving the current frame and the current frame is truncated after the watchdog timeout. - * |[10] |ETI |Early Transmit Interrupt - * | | |This bit indicates that the frame to be transmitted is fully transferred to the MTL Transmit FIFO. - * |[13] |FBI |Fatal Bus Error Interrupt - * | | |This bit indicates that a bus error occurred, as described in Bits[25:23] - * | | |When this bit is set, the corresponding DMA engine disables all of its bus accesses. - * |[14] |ERI |Early Receive Interrupt - * | | |This bit indicates that the DMA filled the first data buffer of the packet - * | | |This bit is cleared when the software writes 1 to this bit or Bit 6 (RI) of this register is set (whichever occurs earlier). - * |[15] |AIS |Abnormal Interrupt Summary - * | | |Abnormal Interrupt Summary bit value is the logical OR of the following when the corresponding interrupt bits are enabled in Register 1007 (Interrupt Enable Register): - * | | |Register 1005[1]: Transmit Process Stopped - * | | |Register 1005[3]: Transmit Jabber Timeout - * | | |Register 1005[4]: Receive FIFO Overflow - * | | |Register 1005[5]: Transmit Underflow - * | | |Register 1005[7]: Receive Buffer Unavailable - * | | |Register 1005[8]: Receive Process Stopped - * | | |Register 1005[9]: Receive Watchdog Timeout - * | | |Register 1005[10]: Early Transmit Interrupt - * | | |Register 1005[13]: Fatal Bus Error - * | | |Only unmasked bits affect the Abnormal Interrupt Summary bit. - * | | |This is a sticky bit and must be cleared each time a corresponding bit, which causes AIS to be set, is cleared. - * |[16] |NIS |Normal Interrupt Summary - * | | |Normal Interrupt Summary bit value is the logical OR of the following when the corresponding interrupt bits are enabled in Register 1007 (Interrupt Enable Register): - * | | |Register 1005[0]: Transmit Interrupt - * | | |Register 1005[2]: Transmit Buffer Unavailable - * | | |Register 1005[6]: Receive Interrupt - * | | |Register 1005[14]: Early Receive Interrupt - * | | |Only unmasked bits (interrupts for which interrupt enable is set in Register 1007) affect the Normal Interrupt Summary bit. - * | | |This is a sticky bit and must be cleared (by writing 1 to this bit) each time a corresponding bit, which causes NIS to be set, is cleared. - * |[19:17] |RS |Received Process State (read only) - * | | |This field indicates the Receive DMA FSM state. This field does not generate an interrupt. - * | | |3'b000: Stopped: Reset or Stop Receive Command issued - * | | |3'b001: Running: Fetching Receive Transfer Descriptor - * | | |3'b010: Reserved for future use - * | | |3'b011: Running: Waiting for receive packet - * | | |3'b100: Suspended: Receive Descriptor Unavailable - * | | |3'b101: Running: Closing Receive Descriptor - * | | |3'b110: TIME_STAMP write state - * | | |3'b111: Running: Transferring the receive packet data from receive buffer to host memory - * |[22:20] |TS |Transmit Process State (read only) - * | | |This field indicates the Transmit DMA FSM state. This field does not generate an interrupt. - * | | |3'b000: Stopped; Reset or Stop Transmit Command issued - * | | |3'b001: Running; Fetching Transmit Transfer Descriptor - * | | |3'b010: Running; Waiting for status - * | | |3'b011: Running; Reading Data from host memory buffer and queuing it to transmit buffer (Tx FIFO) - * | | |3'b100: TIME_STAMP write state - * | | |3'b101: Reserved for future use - * | | |3'b110: Suspended; Transmit Descriptor Unavailable or Transmit Buffer Underflow - * | | |3'b111: Running; Closing Transmit Descriptor - * |[25:23] |EB |Error Bits (read only) - * | | |This field indicates the type of error that caused a Bus Error, for example, error response on the AHB or AXI interface - * | | |This field is valid only when Bit 13 (FBI) is set - * | | |This field does not generate an interrupt. - * | | |0 0 0: Error during Rx DMA Write Data Transfer - * | | |0 1 1: Error during Tx DMA Read Data Transfer - * | | |1 0 0: Error during Rx DMA Descriptor Write Access - * | | |1 0 1: Error during Tx DMA Descriptor Write Access - * | | |1 1 0: Error during Rx DMA Descriptor Read Access - * | | |1 1 1: Error during Tx DMA Descriptor Read Access - * | | |Note: 001 and 010 are reserved. - * |[26] |GLI |GMAC Line interface Interrupt (read only) - * | | |When set, this bit reflects any of the following interrupt events in the GMAC interfaces: - * | | |RGMII: Link change event - * | | |To identify the exact cause of the interrupt, the software must first read Bit 11 and Bits[2:0] of Register 14 (Interrupt Status Register) and then to clear the source of interrupt (which also clears the GLI interrupt), read any of the following corresponding registers: - * | | |RGMII: Register 54 (RGMII Status Register) - * | | |The interrupt signal from the GMAC subsystem (sbd_intr_o) is high when this bit is high. - * |[28] |GPI |GMAC PMT Interrupt (read only) - * | | |This bit indicates an interrupt event in the PMT module of the GMAC - * | | |The software must read the PMT Control and Status Register in the MAC to get the exact cause of interrupt and clear its source to reset this bit to 1'b0 - * | | |The interrupt signal from the GMAC subsystem (sbd_intr_o) is high when this bit is high. - * | | |This bit is applicable only when the Power Management feature is enabled - * | | |Otherwise, this bit is reserved. - * | | |Note: The GPI and pmt_intr_o interrupts are generated in different clock domains. - * |[29] |TTI |Timestamp Trigger Interrupt (read only) - * | | |This bit indicates an interrupt event in the Timestamp Generator block of GMAC - * | | |The software must read the corresponding registers in the GMAC to get the exact cause of interrupt and clear its source to reset this bit to 1'b0 - * | | |When this bit is high, the interrupt signal from the GMAC subsystem (sbd_intr_o) is high. - * | | |This bit is applicable only when the IEEE 1588 Timestamp feature is enabled - * | | |Otherwise, this bit is reserved. - * |[30] |GLPII |GMAC LPI Interrupt (for Channel 0) (read only) - * | | |This bit indicates an interrupt event in the LPI logic of the GMAC - * | | |To reset this bit to 1'b0, the software must read the corresponding registers in the GMAC to get the exact cause of the interrupt and clear its source. - * | | |Note: GLPII status is given only in Channel 0 DMA register and is applicable only when the Energy Efficient Ethernet feature is enabled - * | | |Otherwise, this bit is reserved - * | | |When this bit is high, the interrupt signal from the MAC (sbd_intr_o) is high. - * @var GMACDMA_T::OPMODE - * Offset: 0x0018 Register 1006 (Operation Mode Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |SR |Start or Stop Receive - * | | |When this bit is set, the Receive process is placed in the Running state - * | | |The DMA attempts to acquire the descriptor from the Receive list and processes the incoming frames - * | | |The descriptor acquisition is attempted from the current position in the list, which is the address set by Register 1003 (Receive Descriptor List Address Register) or the position retained when the Receive process was previously stopped - * | | |If the DMA does not own the descriptor, reception is suspended and Bit 7 (Receive Buffer Unavailable) of Register 1005 (Status Register) is set - * | | |The Start Receive command is effective only when the reception has stopped - * | | |If the command is issued before setting Register 1003 (Receive Descriptor List Address Register), the DMA behavior is unpredictable. - * | | |When this bit is cleared, the Rx DMA operation is stopped after the transfer of the current frame - * | | |The next descriptor position in the Receive list is saved and becomes the current position after the Receive process is restarted - * | | |The Stop Receive command is effective only when the Receive process is in either the Running (waiting for receive packet) or in the Suspended state. - * |[2] |OSF |Operate on Second Frame - * | | |When this bit is set, it instructs the DMA to process the second frame of the Transmit data even before the status for the first frame is obtained. - * |[4:3] |RTC |Receive Threshold Control - * | | |These two bits control the threshold level of the MTL Receive FIFO - * | | |Transfer (request) to DMA starts when the frame size within the MTL Receive FIFO is larger than the threshold - * | | |In addition, full frames with length less than the threshold are transferred automatically. - * | | |These bits are valid only when the RSF bit is zero, and are ignored when the RSF bit is set to 1. - * | | |00: 64 - * | | |01: 32 - * | | |10: 96 - * | | |11: 128 - * |[5] |DGF |Drop Giant Frames - * | | |When set, the MAC drops the received giant frames in the Rx FIFO, that is, frames that are larger than the computed giant frame limit - * | | |When reset, the MAC does not drop the giant frames in the Rx FIFO. - * |[6] |FUF |Forward Undersized Good Frames - * | | |When set, the Rx FIFO forwards Undersized frames (frames with no Error and length less than 64 bytes) including pad-bytes and CRC. - * | | |When reset, the Rx FIFO drops all frames of less than 64 bytes, unless a frame is already transferred because of the lower value of Receive Threshold, for example, RTC = 01. - * |[7] |FEF |Forward Error Frames - * | | |When this bit is reset, the Rx FIFO drops frames with error status (CRC error, collision error, GMII_ER, giant frame, watchdog timeout, or overflow) - * | | |However, if the start byte (write) pointer of a frame is already transferred to the read controller side (in Threshold mode), then the frame is not dropped - * | | |When the FEF bit is set, all frames except runt error frames are forwarded to the DMA - * | | |If the Bit 25 (RSF) is set and the Rx FIFO overflows when a partial frame is written, then the frame is dropped irrespective of the FEF bit setting - * | | |However, if the Bit 25 (RSF) is reset and the Rx FIFO overflows when a partial frame is written, then a partial frame may be forwarded to the DMA. - * |[8] |EFC |Enable HW Flow Control - * | | |When this bit is set, the flow control signal operation based on the fill-level of Rx FIFO is enabled - * | | |When reset, the flow control operation is disabled - * | | |This bit is not used (reserved and always reset) when the Rx FIFO is less than 4 KB. - * |[10:9] |RFA |Threshold for Activating Flow Control (in half-duplex and full-duplex) - * | | |These bits control the threshold (Fill level of Rx FIFO) at which the flow control is activated. - * | | |00: Full minus 1 KB, that is, FULL - 1KB - * | | |01: Full minus 2 KB, that is, FULL - 2KB - * | | |10: Full minus 3 KB, that is, FULL - 3KB - * | | |11: Full minus 4 KB, that is, FULL - 4KB - * | | |These values are applicable only to Rx FIFOs of 4 KB or more and when Bit 8 (EFC) is set high - * | | |If the Rx FIFO is 8 KB or more, an additional Bit (RFA_2) is used for more threshold levels as described in Bit 23 - * | | |These bits are reserved and read-only when the depth of Rx FIFO is less than 4 KB. - * | | |Note: When FIFO size is exactly 4 KB, although the GMAC allows you to program the value of these bits to 11, the software should not program these bits to 2'b11 - * | | |The value 2'b11 means flow control on FIFO empty condition. - * |[12:11] |RFD |Threshold for Deactivating Flow Control (in half-duplex and full-duplex) - * | | |These bits control the threshold (Fill-level of Rx FIFO) at which the flow control is de-asserted after activation. - * | | |00: Full minus 1 KB, that is, FULL - 1KB - * | | |01: Full minus 2 KB, that is, FULL - 2KB - * | | |10: Full minus 3 KB, that is, FULL - 3KB - * | | |11: Full minus 4 KB, that is, FULL - 4KB - * | | |The de-assertion is effective only after flow control is asserted - * | | |If the Rx FIFO is 8 KB or more, an additional bit (RFD_2) is used for more threshold levels as described in Bit 22 - * | | |These bits are reserved and read-only when the Rx FIFO depth is less than 4 KB - * | | |Note: For proper flow control, the value programmed in the "RFD_2, RFD" fields should be equal to or more than the value programmed in the "RFA_2, RFA" fields. - * |[13] |ST |Start or Stop Transmission Command - * | | |When this bit is set, transmission is placed in the Running state, and the DMA checks the Transmit List at the current position for a frame to be transmitted - * | | |Descriptor acquisition is attempted either from the current position in the list, which is the Transmit List Base Address set by Register 1004 (Transmit Descriptor List Address Register), or from the position retained when transmission was stopped previously - * | | |If the DMA does not own the current descriptor, transmission enters the Suspended state and Bit 2 (Transmit Buffer Unavailable) of Register 1005 (Status Register) is set - * | | |The Start Transmission command is effective only when transmission is stopped - * | | |If the command is issued before setting Register 1004 (Transmit Descriptor List Address Register), then the DMA behavior is unpredictable. - * | | |When this bit is reset, the transmission process is placed in the Stopped state after completing the transmission of the current frame - * | | |The Next Descriptor position in the Transmit List is saved, and it becomes the current position when transmission is restarted - * | | |To change the list address, you need to program Register 1004 (Transmit Descriptor List Address Register) with a new value when this bit is reset - * | | |The new value is considered when this bit is set again - * | | |The stop transmission command is effective only when the transmission of the current frame is complete or the transmission is in the Suspended state. - * |[16:14] |TTC |Transmit Threshold Control - * | | |These bits control the threshold level of the MTL Transmit FIFO - * | | |Transmission starts when the frame size within the MTL Transmit FIFO is larger than the threshold - * | | |In addition, full frames with a length less than the threshold are also transmitted - * | | |These bits are used only when Bit 21 (TSF) is reset. - * | | |000: 64 - * | | |001: 128 - * | | |010: 192 - * | | |011: 256 - * | | |100: 40 - * | | |101: 32 - * | | |110: 24 - * | | |111: 16 - * |[20] |FTF |Flush Transmit FIFO - * | | |When this bit is set, the transmit FIFO controller logic is reset to its default values and thus all data in the Tx FIFO is lost or flushed - * | | |This bit is cleared internally when the flushing operation is completed - * | | |The Operation Mode register should not be written to until this bit is cleared - * | | |The data which is already accepted by the MAC transmitter is not flushed - * | | |It is scheduled for transmission and results in underflow and runt frame transmission. - * | | |Note: The flush operation is complete only when the Tx FIFO is emptied of its contents and all the pending Transmit Status of the transmitted frames are accepted by the host - * | | |To complete this flush operation, the PHY transmit clock (clk_tx_i) is required to be active. - * |[21] |TSF |Transmit Store and Forward - * | | |When this bit is set, transmission starts when a full frame resides in the MTL Transmit FIFO - * | | |When this bit is set, the TTC values specified in Bits[16:14] are ignored - * | | |This bit should be changed only when the transmission is stopped. - * |[24] |DFF |Disable Flushing of Received Frames - * | | |When this bit is set, the Rx DMA does not flush any frames because of the unavailability of receive descriptors or buffers as it does normally when this bit is reset - * |[25] |RSF |Receive Store and Forward - * | | |When this bit is set, the MTL reads a frame from the Rx FIFO only after the complete frame has been written to it, ignoring the RTC bits - * | | |When this bit is reset, the Rx FIFO operates in the cut-through mode, subject to the threshold specified by the RTC bits - * |[26] |DT |Disable Dropping of TCP/IP Checksum Error Frames - * | | |When this bit is set, the MAC does not drop the frames which only have errors detected by the Receive Checksum Offload engine - * | | |Such frames do not have any errors (including FCS error) in the Ethernet frame received by the MAC but have errors only in the encapsulated payload - * | | |When this bit is reset, all error frames are dropped if the FEF bit is reset. - * | | |If the IPC Full Checksum Offload Engine (Type 2) is disabled, this bit is reserved (RO with value 1'b0). - * @var GMACDMA_T::INTEN - * Offset: 0x001C Register 1007 (Interrupt Enable Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TIE |Transmit Interrupt Enable - * | | |When this bit is set with Normal Interrupt Summary Enable (Bit 16), the Transmit Interrupt is enabled - * | | |When this bit is reset, the Transmit Interrupt is disabled. - * |[1] |TSE |Transmit Stopped Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Transmission Stopped Interrupt is enabled - * | | |When this bit is reset, the Transmission Stopped Interrupt is disabled. - * |[2] |TUE |Transmit Buffer Unavailable Enable - * | | |When this bit is set with Normal Interrupt Summary Enable (Bit 16), the Transmit Buffer Unavailable Interrupt is enabled - * | | |When this bit is reset, the Transmit Buffer Unavailable Interrupt is disabled. - * |[3] |TJE |Transmit Jabber Timeout Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Transmit Jabber Timeout Interrupt is enabled - * | | |When this bit is reset, the Transmit Jabber Timeout Interrupt is disabled. - * |[4] |OVE |Overflow Interrupt Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Receive Overflow Interrupt is enabled - * | | |When this bit is reset, the Overflow Interrupt is disabled. - * |[5] |UNE |Underflow Interrupt Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Transmit Underflow Interrupt is enabled - * | | |When this bit is reset, the Underflow Interrupt is disabled. - * |[6] |RIE |Receive Interrupt Enable - * | | |When this bit is set with Normal Interrupt Summary Enable (Bit 16), the Receive Interrupt is enabled - * | | |When this bit is reset, the Receive Interrupt is disabled. - * |[7] |RUE |Receive Buffer Unavailable Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Receive Buffer Unavailable Interrupt is enabled - * | | |When this bit is reset, the Receive Buffer Unavailable Interrupt is disabled. - * |[8] |RSE |Receive Stopped Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Receive Stopped Interrupt is enabled - * | | |When this bit is reset, the Receive Stopped Interrupt is disabled. - * |[9] |RWE |Receive Watchdog Timeout Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Receive Watchdog Timeout Interrupt is enabled - * | | |When this bit is reset, the Receive Watchdog Timeout Interrupt is disabled. - * |[10] |ETE |Early Transmit Interrupt Enable - * | | |When this bit is set with an Abnormal Interrupt Summary Enable (Bit 15), the Early Transmit Interrupt is enabled - * | | |When this bit is reset, the Early Transmit Interrupt is disabled. - * |[13] |FBE |Fatal Bus Error Enable - * | | |When this bit is set with Abnormal Interrupt Summary Enable (Bit 15), the Fatal Bus Error Interrupt is enabled - * | | |When this bit is reset, the Fatal Bus Error Enable Interrupt is disabled. - * |[14] |ERE |Early Receive Interrupt Enable - * | | |When this bit is set with Normal Interrupt Summary Enable (Bit 16), the Early Receive Interrupt is enabled - * | | |When this bit is reset, the Early Receive Interrupt is disabled. - * |[15] |AIE |Abnormal Interrupt Summary Enable - * | | |When this bit is set, abnormal interrupt summary is enabled - * | | |When this bit is reset, the abnormal interrupt summary is disabled - * | | |This bit enables the following interrupts in Register 1005 (Status Register): - * | | |Register 1005[1]: Transmit Process Stopped - * | | |Register 1005[3]: Transmit Jabber Timeout - * | | |Register 1005[4]: Receive Overflow - * | | |Register 1005[5]: Transmit Underflow - * | | |Register 1005[7]: Receive Buffer Unavailable - * | | |Register 1005[8]: Receive Process Stopped - * | | |Register 1005[9]: Receive Watchdog Timeout - * | | |Register 1005[10]: Early Transmit Interrupt - * | | |Register 1005[13]: Fatal Bus Error - * |[16] |NIE |Normal Interrupt Summary Enable - * | | |When this bit is set, normal interrupt summary is enabled - * | | |When this bit is reset, normal interrupt summary is disabled - * | | |This bit enables the following interrupts in Register 1005 (Status Register): - * | | |Register 1005[0]: Transmit Interrupt - * | | |Register 1005[2]: Transmit Buffer Unavailable - * | | |Register 1005[6]: Receive Interrupt - * | | |Register 1005[14]: Early Receive Interrupt - * @var GMACDMA_T::MFOVCNTR - * Offset: 0x0020 Register 1008 (Missed Frame and Buffer Overflow Counter Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MISFRMCNT |Missed Frame Counter - * | | |This field indicates the number of frames missed by the controller because of the Host Receive Buffer being unavailable - * | | |This counter is incremented each time the DMA discards an incoming frame - * | | |The counter is cleared when this register is read with mci_be_i[0] at 1'b1. - * |[16] |MISCNTOVF |Overflow Bit for Missed Frame Counter - * | | |This bit is set every time Missed Frame Counter (Bits[15:0]) overflows, that is, the DMA discards an incoming frame because of the Host Receive Buffer being unavailable with the missed frame counter at maximum value - * | | |In such a scenario, the Missed frame counter is reset to all-zeros and this bit indicates that the rollover happened. - * |[27:17] |OVFFRMCNT |Overflow Frame Counter - * | | |This field indicates the number of frames missed by the application - * | | |This counter is incremented each time the MTL FIFO overflows - * | | |The counter is cleared when this register is read with mci_be_i[2] at 1'b1. - * |[28] |OVFCNTOVF |Overflow Bit for FIFO Overflow Counter - * | | |This bit is set every time the Overflow Frame Counter (Bits[27:17]) overflows, that is, the Rx FIFO overflows with the overflow frame counter at maximum value - * | | |In such a scenario, the overflow frame counter is reset to all-zeros and this bit indicates that the rollover happened. - * @var GMACDMA_T::RXINTWDT - * Offset: 0x0024 Register 1009 (Receive Interrupt Watchdog Timer Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RIWT |RI Watchdog Timer Count - * | | |This bit indicates the number of system clock cycles multiplied by 256 for which the watchdog timer is set - * | | |The watchdog timer gets triggered with the programmed value after the Rx DMA completes the transfer of a frame for which the RI status bit is not set because of the setting in the corresponding descriptor RDES1[31] - * | | |When the watchdog timer runs out, the RI bit is set and the timer is stopped - * | | |The watchdog timer is reset when the RI bit is set high because of automatic setting of RI as per RDES1[31] of any received frame. - * @var GMACDMA_T::AXIMODE - * Offset: 0x0028 Register 1010 (AXI Bus Mode Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |UNDEF |AXI Undefined Burst Length (read only) - * | | |This bit is read-only bit and indicates the complement (invert) value of Bit 16 (FB) in Register 1000 (Bus Mode Register[16]). - * | | |When this bit is set to 1, the GMAC-AXI is allowed to perform any burst length equal to or below the maximum allowed burst length programmed in Bits[7:1]. - * | | |When this bit is set to 0, the GMAC-AXI is allowed to perform only fixed burst lengths as indicated by BLEN256, BLEN128, BLEN64, BLEN32, BLEN16, BLEN8, or BLEN4, or a burst length of 1 - * |[1] |BLEN4 |AXI Burst Length 4 - * | | |When this bit is set to 1, the GMAC-AXI is allowed to select a burst length of 4 on the AXI Master interface. - * | | |Setting this bit has no effect when UNDEF is set to 1. - * |[2] |BLEN8 |AXI Burst Length 8 - * | | |When this bit is set to 1, the GMAC-AXI is allowed to select a burst length of 8 on the AXI Master interface. - * | | |Setting this bit has no effect when UNDEF is set to 1. - * |[3] |BLEN16 |AXI Burst Length 16 - * | | |When this bit is set to 1 or UNDEF is set to 1, the GMAC-AXI is allowed to select a burst length of 16 on the AXI Master interface. - * |[12] |AXI_AAL |Address-Aligned Beats (read only) - * | | |This bit is read-only bit and reflects the Bit 25 (AAL) of Register 1000 (Bus Mode Register). - * | | |When this bit is set to 1, the GMAC-AXI performs address-aligned burst transfers on both read and write channels. - * |[13] |ONEKBBE |1 KB Boundary Crossing Enable for the GMAC-AXI Master When set, the GMAC-AXI Master performs burst transfers that do not cross 1 KB boundary. When reset, the GMAC-AXI Master performs burst transfers that do not cross 4 KB boundary. - * |[17:16] |RD_OSR_LMT|AXI Maximum Read OutStanding Request Limit - * | | |This value limits the maximum outstanding request on the AXI read interface - * | | |Maximum outstanding requests = RD_OSR_LMT+1 - * | | |Note: The Bit 18 is reserved if AXI_GM_MAX_RD_REQUESTS = 4 - * | | |The Bit 19 is reserved if AXI_GM_MAX_RD_REQUESTS != 16. - * |[18] |RD_OSR_LMT_GT4|Reserved. - * |[19] |RD_OSR_LMT_GT8|Reserved. - * |[21:20] |WR_OSR_LMT|AXI Maximum Write OutStanding Request Limit - * |[22] |WR_OSR_LMT_GT4|Reserved. - * |[23] |WR_OSR_LMT_GT8|Reserved. - * |[30] |LPI_XIT_FRM|Unlock on Magic Packet or Remote Wake Up - * | | |When set to 1, this bit enables the GMAC-AXI to come out of the LPI mode only when the Magic Packet or Remote Wake Up Packet is received - * | | |When set to 0, this bit enables the GMAC-AXI to come out of LPI mode when any frame is received. - * |[31] |EN_LPI |Enable Low Power Interface (LPI) - * | | |When set to 1, this bit enables the LPI mode and accepts the LPI request from the AXI System Clock controller. - * | | |When set to 0, this bit disables the LPI mode and always denies the LPI request from the AXI System Clock controller. - * @var GMACDMA_T::BUSSTS - * Offset: 0x002C Register 1011 (AHB or AXI Status Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AXWHSTS |AXI Master Write Channel or AHB Master Status - * | | |When high, it indicates that AXI Master's write channel is active and transferring data. - * |[1] |AXIRDSTS |AXI Master Read Channel Status - * | | |When high, it indicates that AXI Master's read channel is active and transferring data. - * @var GMACDMA_T::CTXDESC - * Offset: 0x0048 Register 1018 (Current Host Transmit Descriptor Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURTDESAPTR|Host Transmit Descriptor Address Pointer - * | | |Cleared on Reset. Pointer updated by the DMA during operation. - * @var GMACDMA_T::CRXDESC - * Offset: 0x004C Register 1019 (Current Host Receive Descriptor Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURRDESAPTR|Host Receive Descriptor Address Pointer - * | | |Cleared on Reset. Pointer updated by the DMA during operation. - * @var GMACDMA_T::CTXBUF - * Offset: 0x0050 Register 1020 (Current Host Transmit Buffer Address Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURTBUFAPTR|Host Transmit Buffer Address Pointer - * | | |Cleared on Reset. Pointer updated by the DMA during operation. - * @var GMACDMA_T::CRXBUF - * Offset: 0x0054 Register 1021 (Current Host Receive Buffer Address Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURRBUFAPTR|Host Receive Buffer Address Pointer - * | | |Cleared on Reset. Pointer updated by the DMA during operation. - * @var GMACDMA_T::HWFEAT - * Offset: 0x0058 Register 1022 (HW Feature Register) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MIISEL |10 or 100 Mbps support - * |[1] |GMIISEL |1000 Mbps support - * |[2] |HDSEL |Half-Duplex support - * |[3] |EXTHASHEN |Expanded DA Hash Filter - * |[4] |HASHSEL |HASH Filter - * |[5] |ADDMACADRSEL|Multiple MAC Address Registers - * |[6] |PCSSEL |PCS registers (TBI, SGMII, or RTBI PHY interface) - * |[7] |L3L4FLTREN|Layer 3 and Layer 4 Filter Feature - * |[8] |SMASEL |SMA (MDIO) Interface - * |[9] |RWKSEL |PMT Remote Wakeup - * |[10] |MGKSEL |PMT Magic Packet - * |[11] |MMCSEL |RMON Module - * |[12] |TSVER1SEL |Only IEEE 1588-2002 Timestamp - * |[13] |TSVER2SEL |IEEE 1588-2008 Advanced Timestamp - * |[14] |EEESEL |Energy Efficient Ethernet - * |[15] |AVSEL |AV Feature - * |[16] |TXCOESEL |Checksum Offload in Tx - * |[17] |RXTYP1COE |Type 1 IP Checksum Offload (Type 1) in Rx - * | | |Note: If IPCHKSUM_EN = Enabled and IPC_FULL_OFFLOAD = Enabled, then RXTYP1COE = 0 and RXTYP2COE =1. - * |[18] |RXTYP2COE |Type 2 IP Checksum Offload (Type 2) in Rx - * |[19] |RXFIFOSIZE|Rx FIFO > 2,048 Bytes - * |[21:20] |RXCHCNT |Number of additional Rx channels - * |[23:22] |TXCHCNT |Number of additional Tx channels - * |[24] |ENHDESSEL |Alternate (Enhanced Descriptor) - * |[25] |INTTSEN |Timestamping with Internal System Time - * |[26] |FLEXIPPSEN|Flexible Pulse-Per-Second Output - * |[27] |SAVLANINS |Source Address or VLAN Insertion - * |[30:28] |ACTPHYIF |Active or Selected PHY interface - * | | |When you have multiple PHY interfaces in your configuration, this field indicates the sampled value of phy_intf_sel_i during reset de-assertion - * | | |0001: RGMII - * | | |0100: RMII - * | | |All Others: Reserved - */ - __IO uint32_t BUSMODE; /*!< [0x0000] Register 1000 (Bus Mode Register) */ - __IO uint32_t TXDEM; /*!< [0x0004] Register 1001 (Transmit Poll Demand Register) */ - __IO uint32_t RXDEM; /*!< [0x0008] Register 1002 (Receive Poll Demand Register) */ - __IO uint32_t RXDADDR; /*!< [0x000c] Register 1003 (Receive Descriptor List Address Register) */ - __IO uint32_t TXDADDR; /*!< [0x0010] Register 1004 (Transmit Descriptor List Address Register) */ - __IO uint32_t STS; /*!< [0x0014] Register 1005 (Status Register) */ - __IO uint32_t OPMODE; /*!< [0x0018] Register 1006 (Operation Mode Register) */ - __IO uint32_t INTEN; /*!< [0x001c] Register 1007 (Interrupt Enable Register) */ - __I uint32_t MFOVCNTR; /*!< [0x0020] Register 1008 (Missed Frame and Buffer Overflow Counter Register)*/ - __IO uint32_t RXINTWDT; /*!< [0x0024] Register 1009 (Receive Interrupt Watchdog Timer Register) */ - __IO uint32_t AXIMODE; /*!< [0x0028] Register 1010 (AXI Bus Mode Register) */ - __I uint32_t BUSSTS; /*!< [0x002c] Register 1011 (AHB or AXI Status Register) */ - __I uint32_t RESERVE0[6]; - __I uint32_t CTXDESC; /*!< [0x0048] Register 1018 (Current Host Transmit Descriptor Register) */ - __I uint32_t CRXDESC; /*!< [0x004c] Register 1019 (Current Host Receive Descriptor Register) */ - __I uint32_t CTXBUF; /*!< [0x0050] Register 1020 (Current Host Transmit Buffer Address Register) */ - __I uint32_t CRXBUF; /*!< [0x0054] Register 1021 (Current Host Receive Buffer Address Register) */ - __I uint32_t HWFEAT; /*!< [0x0058] Register 1022 (HW Feature Register) */ - -} GMACDMA_T; - - -/** - @addtogroup GMACDMA_CONST GMACDMA Bit Field Definition - Constant Definitions for GMACDMA -@{ */ -#define GMACDMA_BUSMODE_SWR_Pos (0) /*!< GMACDMA_T::BUSMODE: SWR Position */ -#define GMACDMA_BUSMODE_SWR_Msk (0x1ul << GMACDMA_BUSMODE_SWR_Pos) /*!< GMACDMA_T::BUSMODE: SWR Mask */ - -#define GMACDMA_BUSMODE_DSL_Pos (2) /*!< GMACDMA_T::BUSMODE: DSL Position */ -#define GMACDMA_BUSMODE_DSL_Msk (0x1ful << GMACDMA_BUSMODE_DSL_Pos) /*!< GMACDMA_T::BUSMODE: DSL Mask */ - -#define GMACDMA_BUSMODE_ATDS_Pos (7) /*!< GMACDMA_T::BUSMODE: ATDS Position */ -#define GMACDMA_BUSMODE_ATDS_Msk (0x1ul << GMACDMA_BUSMODE_ATDS_Pos) /*!< GMACDMA_T::BUSMODE: ATDS Mask */ - -#define GMACDMA_BUSMODE_PBL_Pos (8) /*!< GMACDMA_T::BUSMODE: PBL Position */ -#define GMACDMA_BUSMODE_PBL_Msk (0x3ful << GMACDMA_BUSMODE_PBL_Pos) /*!< GMACDMA_T::BUSMODE: PBL Mask */ - -#define GMACDMA_BUSMODE_FB_Pos (16) /*!< GMACDMA_T::BUSMODE: FB Position */ -#define GMACDMA_BUSMODE_FB_Msk (0x1ul << GMACDMA_BUSMODE_FB_Pos) /*!< GMACDMA_T::BUSMODE: FB Mask */ - -#define GMACDMA_BUSMODE_RPBL_Pos (17) /*!< GMACDMA_T::BUSMODE: RPBL Position */ -#define GMACDMA_BUSMODE_RPBL_Msk (0x3ful << GMACDMA_BUSMODE_RPBL_Pos) /*!< GMACDMA_T::BUSMODE: RPBL Mask */ - -#define GMACDMA_BUSMODE_USP_Pos (23) /*!< GMACDMA_T::BUSMODE: USP Position */ -#define GMACDMA_BUSMODE_USP_Msk (0x1ul << GMACDMA_BUSMODE_USP_Pos) /*!< GMACDMA_T::BUSMODE: USP Mask */ - -#define GMACDMA_BUSMODE_PBLx8_Pos (24) /*!< GMACDMA_T::BUSMODE: PBLx8 Position */ -#define GMACDMA_BUSMODE_PBLx8_Msk (0x1ul << GMACDMA_BUSMODE_PBLx8_Pos) /*!< GMACDMA_T::BUSMODE: PBLx8 Mask */ - -#define GMACDMA_BUSMODE_AAL_Pos (25) /*!< GMACDMA_T::BUSMODE: AAL Position */ -#define GMACDMA_BUSMODE_AAL_Msk (0x1ul << GMACDMA_BUSMODE_AAL_Pos) /*!< GMACDMA_T::BUSMODE: AAL Mask */ - -#define GMACDMA_TXDEM_TPD_Pos (0) /*!< GMACDMA_T::TXDEM: TPD Position */ -#define GMACDMA_TXDEM_TPD_Msk (0xfffffffful << GMACDMA_TXDEM_TPD_Pos) /*!< GMACDMA_T::TXDEM: TPD Mask */ - -#define GMACDMA_RXDEM_RPD_Pos (0) /*!< GMACDMA_T::RXDEM: RPD Position */ -#define GMACDMA_RXDEM_RPD_Msk (0xfffffffful << GMACDMA_RXDEM_RPD_Pos) /*!< GMACDMA_T::RXDEM: RPD Mask */ - -#define GMACDMA_RXDADDR_RDESLA_64_bit_Pos (3) /*!< GMACDMA_T::RXDADDR: RDESLA_64_bit Position */ -#define GMACDMA_RXDADDR_RDESLA_64_bit_Msk (0x1ffffffful << GMACDMA_RXDADDR_RDESLA_64_bit_Pos) /*!< GMACDMA_T::RXDADDR: RDESLA_64_bit Mask */ - -#define GMACDMA_TXDADDR_TDESLA_64_bit_Pos (3) /*!< GMACDMA_T::TXDADDR: TDESLA_64_bit Position */ -#define GMACDMA_TXDADDR_TDESLA_64_bit_Msk (0x1ffffffful << GMACDMA_TXDADDR_TDESLA_64_bit_Pos) /*!< GMACDMA_T::TXDADDR: TDESLA_64_bit Mask */ - -#define GMACDMA_STS_TI_Pos (0) /*!< GMACDMA_T::STS: TI Position */ -#define GMACDMA_STS_TI_Msk (0x1ul << GMACDMA_STS_TI_Pos) /*!< GMACDMA_T::STS: TI Mask */ - -#define GMACDMA_STS_TPS_Pos (1) /*!< GMACDMA_T::STS: TPS Position */ -#define GMACDMA_STS_TPS_Msk (0x1ul << GMACDMA_STS_TPS_Pos) /*!< GMACDMA_T::STS: TPS Mask */ - -#define GMACDMA_STS_TU_Pos (2) /*!< GMACDMA_T::STS: TU Position */ -#define GMACDMA_STS_TU_Msk (0x1ul << GMACDMA_STS_TU_Pos) /*!< GMACDMA_T::STS: TU Mask */ - -#define GMACDMA_STS_TJT_Pos (3) /*!< GMACDMA_T::STS: TJT Position */ -#define GMACDMA_STS_TJT_Msk (0x1ul << GMACDMA_STS_TJT_Pos) /*!< GMACDMA_T::STS: TJT Mask */ - -#define GMACDMA_STS_OVF_Pos (4) /*!< GMACDMA_T::STS: OVF Position */ -#define GMACDMA_STS_OVF_Msk (0x1ul << GMACDMA_STS_OVF_Pos) /*!< GMACDMA_T::STS: OVF Mask */ - -#define GMACDMA_STS_UNF_Pos (5) /*!< GMACDMA_T::STS: UNF Position */ -#define GMACDMA_STS_UNF_Msk (0x1ul << GMACDMA_STS_UNF_Pos) /*!< GMACDMA_T::STS: UNF Mask */ - -#define GMACDMA_STS_RI_Pos (6) /*!< GMACDMA_T::STS: RI Position */ -#define GMACDMA_STS_RI_Msk (0x1ul << GMACDMA_STS_RI_Pos) /*!< GMACDMA_T::STS: RI Mask */ - -#define GMACDMA_STS_RU_Pos (7) /*!< GMACDMA_T::STS: RU Position */ -#define GMACDMA_STS_RU_Msk (0x1ul << GMACDMA_STS_RU_Pos) /*!< GMACDMA_T::STS: RU Mask */ - -#define GMACDMA_STS_RPS_Pos (8) /*!< GMACDMA_T::STS: RPS Position */ -#define GMACDMA_STS_RPS_Msk (0x1ul << GMACDMA_STS_RPS_Pos) /*!< GMACDMA_T::STS: RPS Mask */ - -#define GMACDMA_STS_RWT_Pos (9) /*!< GMACDMA_T::STS: RWT Position */ -#define GMACDMA_STS_RWT_Msk (0x1ul << GMACDMA_STS_RWT_Pos) /*!< GMACDMA_T::STS: RWT Mask */ - -#define GMACDMA_STS_ETI_Pos (10) /*!< GMACDMA_T::STS: ETI Position */ -#define GMACDMA_STS_ETI_Msk (0x1ul << GMACDMA_STS_ETI_Pos) /*!< GMACDMA_T::STS: ETI Mask */ - -#define GMACDMA_STS_FBI_Pos (13) /*!< GMACDMA_T::STS: FBI Position */ -#define GMACDMA_STS_FBI_Msk (0x1ul << GMACDMA_STS_FBI_Pos) /*!< GMACDMA_T::STS: FBI Mask */ - -#define GMACDMA_STS_ERI_Pos (14) /*!< GMACDMA_T::STS: ERI Position */ -#define GMACDMA_STS_ERI_Msk (0x1ul << GMACDMA_STS_ERI_Pos) /*!< GMACDMA_T::STS: ERI Mask */ - -#define GMACDMA_STS_AIS_Pos (15) /*!< GMACDMA_T::STS: AIS Position */ -#define GMACDMA_STS_AIS_Msk (0x1ul << GMACDMA_STS_AIS_Pos) /*!< GMACDMA_T::STS: AIS Mask */ - -#define GMACDMA_STS_NIS_Pos (16) /*!< GMACDMA_T::STS: NIS Position */ -#define GMACDMA_STS_NIS_Msk (0x1ul << GMACDMA_STS_NIS_Pos) /*!< GMACDMA_T::STS: NIS Mask */ - -#define GMACDMA_STS_RS_Pos (17) /*!< GMACDMA_T::STS: RS Position */ -#define GMACDMA_STS_RS_Msk (0x7ul << GMACDMA_STS_RS_Pos) /*!< GMACDMA_T::STS: RS Mask */ - -#define GMACDMA_STS_TS_Pos (20) /*!< GMACDMA_T::STS: TS Position */ -#define GMACDMA_STS_TS_Msk (0x7ul << GMACDMA_STS_TS_Pos) /*!< GMACDMA_T::STS: TS Mask */ - -#define GMACDMA_STS_EB_Pos (23) /*!< GMACDMA_T::STS: EB Position */ -#define GMACDMA_STS_EB_Msk (0x7ul << GMACDMA_STS_EB_Pos) /*!< GMACDMA_T::STS: EB Mask */ - -#define GMACDMA_STS_GLI_Pos (26) /*!< GMACDMA_T::STS: GLI Position */ -#define GMACDMA_STS_GLI_Msk (0x1ul << GMACDMA_STS_GLI_Pos) /*!< GMACDMA_T::STS: GLI Mask */ - -#define GMACDMA_STS_GPI_Pos (28) /*!< GMACDMA_T::STS: GPI Position */ -#define GMACDMA_STS_GPI_Msk (0x1ul << GMACDMA_STS_GPI_Pos) /*!< GMACDMA_T::STS: GPI Mask */ - -#define GMACDMA_STS_TTI_Pos (29) /*!< GMACDMA_T::STS: TTI Position */ -#define GMACDMA_STS_TTI_Msk (0x1ul << GMACDMA_STS_TTI_Pos) /*!< GMACDMA_T::STS: TTI Mask */ - -#define GMACDMA_STS_GLPII_Pos (30) /*!< GMACDMA_T::STS: GLPII Position */ -#define GMACDMA_STS_GLPII_Msk (0x1ul << GMACDMA_STS_GLPII_Pos) /*!< GMACDMA_T::STS: GLPII Mask */ - -#define GMACDMA_OPMODE_SR_Pos (1) /*!< GMACDMA_T::OPMODE: SR Position */ -#define GMACDMA_OPMODE_SR_Msk (0x1ul << GMACDMA_OPMODE_SR_Pos) /*!< GMACDMA_T::OPMODE: SR Mask */ - -#define GMACDMA_OPMODE_OSF_Pos (2) /*!< GMACDMA_T::OPMODE: OSF Position */ -#define GMACDMA_OPMODE_OSF_Msk (0x1ul << GMACDMA_OPMODE_OSF_Pos) /*!< GMACDMA_T::OPMODE: OSF Mask */ - -#define GMACDMA_OPMODE_RTC_Pos (3) /*!< GMACDMA_T::OPMODE: RTC Position */ -#define GMACDMA_OPMODE_RTC_Msk (0x3ul << GMACDMA_OPMODE_RTC_Pos) /*!< GMACDMA_T::OPMODE: RTC Mask */ - -#define GMACDMA_OPMODE_DGF_Pos (5) /*!< GMACDMA_T::OPMODE: DGF Position */ -#define GMACDMA_OPMODE_DGF_Msk (0x1ul << GMACDMA_OPMODE_DGF_Pos) /*!< GMACDMA_T::OPMODE: DGF Mask */ - -#define GMACDMA_OPMODE_FUF_Pos (6) /*!< GMACDMA_T::OPMODE: FUF Position */ -#define GMACDMA_OPMODE_FUF_Msk (0x1ul << GMACDMA_OPMODE_FUF_Pos) /*!< GMACDMA_T::OPMODE: FUF Mask */ - -#define GMACDMA_OPMODE_FEF_Pos (7) /*!< GMACDMA_T::OPMODE: FEF Position */ -#define GMACDMA_OPMODE_FEF_Msk (0x1ul << GMACDMA_OPMODE_FEF_Pos) /*!< GMACDMA_T::OPMODE: FEF Mask */ - -#define GMACDMA_OPMODE_EFC_Pos (8) /*!< GMACDMA_T::OPMODE: EFC Position */ -#define GMACDMA_OPMODE_EFC_Msk (0x1ul << GMACDMA_OPMODE_EFC_Pos) /*!< GMACDMA_T::OPMODE: EFC Mask */ - -#define GMACDMA_OPMODE_RFA_Pos (9) /*!< GMACDMA_T::OPMODE: RFA Position */ -#define GMACDMA_OPMODE_RFA_Msk (0x3ul << GMACDMA_OPMODE_RFA_Pos) /*!< GMACDMA_T::OPMODE: RFA Mask */ - -#define GMACDMA_OPMODE_RFD_Pos (11) /*!< GMACDMA_T::OPMODE: RFD Position */ -#define GMACDMA_OPMODE_RFD_Msk (0x3ul << GMACDMA_OPMODE_RFD_Pos) /*!< GMACDMA_T::OPMODE: RFD Mask */ - -#define GMACDMA_OPMODE_ST_Pos (13) /*!< GMACDMA_T::OPMODE: ST Position */ -#define GMACDMA_OPMODE_ST_Msk (0x1ul << GMACDMA_OPMODE_ST_Pos) /*!< GMACDMA_T::OPMODE: ST Mask */ - -#define GMACDMA_OPMODE_TTC_Pos (14) /*!< GMACDMA_T::OPMODE: TTC Position */ -#define GMACDMA_OPMODE_TTC_Msk (0x7ul << GMACDMA_OPMODE_TTC_Pos) /*!< GMACDMA_T::OPMODE: TTC Mask */ - -#define GMACDMA_OPMODE_FTF_Pos (20) /*!< GMACDMA_T::OPMODE: FTF Position */ -#define GMACDMA_OPMODE_FTF_Msk (0x1ul << GMACDMA_OPMODE_FTF_Pos) /*!< GMACDMA_T::OPMODE: FTF Mask */ - -#define GMACDMA_OPMODE_TSF_Pos (21) /*!< GMACDMA_T::OPMODE: TSF Position */ -#define GMACDMA_OPMODE_TSF_Msk (0x1ul << GMACDMA_OPMODE_TSF_Pos) /*!< GMACDMA_T::OPMODE: TSF Mask */ - -#define GMACDMA_OPMODE_DFF_Pos (24) /*!< GMACDMA_T::OPMODE: DFF Position */ -#define GMACDMA_OPMODE_DFF_Msk (0x1ul << GMACDMA_OPMODE_DFF_Pos) /*!< GMACDMA_T::OPMODE: DFF Mask */ - -#define GMACDMA_OPMODE_RSF_Pos (25) /*!< GMACDMA_T::OPMODE: RSF Position */ -#define GMACDMA_OPMODE_RSF_Msk (0x1ul << GMACDMA_OPMODE_RSF_Pos) /*!< GMACDMA_T::OPMODE: RSF Mask */ - -#define GMACDMA_OPMODE_DT_Pos (26) /*!< GMACDMA_T::OPMODE: DT Position */ -#define GMACDMA_OPMODE_DT_Msk (0x1ul << GMACDMA_OPMODE_DT_Pos) /*!< GMACDMA_T::OPMODE: DT Mask */ - -#define GMACDMA_INTEN_TIE_Pos (0) /*!< GMACDMA_T::INTEN: TIE Position */ -#define GMACDMA_INTEN_TIE_Msk (0x1ul << GMACDMA_INTEN_TIE_Pos) /*!< GMACDMA_T::INTEN: TIE Mask */ - -#define GMACDMA_INTEN_TSE_Pos (1) /*!< GMACDMA_T::INTEN: TSE Position */ -#define GMACDMA_INTEN_TSE_Msk (0x1ul << GMACDMA_INTEN_TSE_Pos) /*!< GMACDMA_T::INTEN: TSE Mask */ - -#define GMACDMA_INTEN_TUE_Pos (2) /*!< GMACDMA_T::INTEN: TUE Position */ -#define GMACDMA_INTEN_TUE_Msk (0x1ul << GMACDMA_INTEN_TUE_Pos) /*!< GMACDMA_T::INTEN: TUE Mask */ - -#define GMACDMA_INTEN_TJE_Pos (3) /*!< GMACDMA_T::INTEN: TJE Position */ -#define GMACDMA_INTEN_TJE_Msk (0x1ul << GMACDMA_INTEN_TJE_Pos) /*!< GMACDMA_T::INTEN: TJE Mask */ - -#define GMACDMA_INTEN_OVE_Pos (4) /*!< GMACDMA_T::INTEN: OVE Position */ -#define GMACDMA_INTEN_OVE_Msk (0x1ul << GMACDMA_INTEN_OVE_Pos) /*!< GMACDMA_T::INTEN: OVE Mask */ - -#define GMACDMA_INTEN_UNE_Pos (5) /*!< GMACDMA_T::INTEN: UNE Position */ -#define GMACDMA_INTEN_UNE_Msk (0x1ul << GMACDMA_INTEN_UNE_Pos) /*!< GMACDMA_T::INTEN: UNE Mask */ - -#define GMACDMA_INTEN_RIE_Pos (6) /*!< GMACDMA_T::INTEN: RIE Position */ -#define GMACDMA_INTEN_RIE_Msk (0x1ul << GMACDMA_INTEN_RIE_Pos) /*!< GMACDMA_T::INTEN: RIE Mask */ - -#define GMACDMA_INTEN_RUE_Pos (7) /*!< GMACDMA_T::INTEN: RUE Position */ -#define GMACDMA_INTEN_RUE_Msk (0x1ul << GMACDMA_INTEN_RUE_Pos) /*!< GMACDMA_T::INTEN: RUE Mask */ - -#define GMACDMA_INTEN_RSE_Pos (8) /*!< GMACDMA_T::INTEN: RSE Position */ -#define GMACDMA_INTEN_RSE_Msk (0x1ul << GMACDMA_INTEN_RSE_Pos) /*!< GMACDMA_T::INTEN: RSE Mask */ - -#define GMACDMA_INTEN_RWE_Pos (9) /*!< GMACDMA_T::INTEN: RWE Position */ -#define GMACDMA_INTEN_RWE_Msk (0x1ul << GMACDMA_INTEN_RWE_Pos) /*!< GMACDMA_T::INTEN: RWE Mask */ - -#define GMACDMA_INTEN_ETE_Pos (10) /*!< GMACDMA_T::INTEN: ETE Position */ -#define GMACDMA_INTEN_ETE_Msk (0x1ul << GMACDMA_INTEN_ETE_Pos) /*!< GMACDMA_T::INTEN: ETE Mask */ - -#define GMACDMA_INTEN_FBE_Pos (13) /*!< GMACDMA_T::INTEN: FBE Position */ -#define GMACDMA_INTEN_FBE_Msk (0x1ul << GMACDMA_INTEN_FBE_Pos) /*!< GMACDMA_T::INTEN: FBE Mask */ - -#define GMACDMA_INTEN_ERE_Pos (14) /*!< GMACDMA_T::INTEN: ERE Position */ -#define GMACDMA_INTEN_ERE_Msk (0x1ul << GMACDMA_INTEN_ERE_Pos) /*!< GMACDMA_T::INTEN: ERE Mask */ - -#define GMACDMA_INTEN_AIE_Pos (15) /*!< GMACDMA_T::INTEN: AIE Position */ -#define GMACDMA_INTEN_AIE_Msk (0x1ul << GMACDMA_INTEN_AIE_Pos) /*!< GMACDMA_T::INTEN: AIE Mask */ - -#define GMACDMA_INTEN_NIE_Pos (16) /*!< GMACDMA_T::INTEN: NIE Position */ -#define GMACDMA_INTEN_NIE_Msk (0x1ul << GMACDMA_INTEN_NIE_Pos) /*!< GMACDMA_T::INTEN: NIE Mask */ - -#define GMACDMA_MFOVCNTR_MISFRMCNT_Pos (0) /*!< GMACDMA_T::MFOVCNTR: MISFRMCNT Position*/ -#define GMACDMA_MFOVCNTR_MISFRMCNT_Msk (0xfffful << GMACDMA_MFOVCNTR_MISFRMCNT_Pos) /*!< GMACDMA_T::MFOVCNTR: MISFRMCNT Mask*/ - -#define GMACDMA_MFOVCNTR_MISCNTOVF_Pos (16) /*!< GMACDMA_T::MFOVCNTR: MISCNTOVF Position*/ -#define GMACDMA_MFOVCNTR_MISCNTOVF_Msk (0x1ul << GMACDMA_MFOVCNTR_MISCNTOVF_Pos) /*!< GMACDMA_T::MFOVCNTR: MISCNTOVF Mask*/ - -#define GMACDMA_MFOVCNTR_OVFFRMCNT_Pos (17) /*!< GMACDMA_T::MFOVCNTR: OVFFRMCNT Position*/ -#define GMACDMA_MFOVCNTR_OVFFRMCNT_Msk (0x7fful << GMACDMA_MFOVCNTR_OVFFRMCNT_Pos) /*!< GMACDMA_T::MFOVCNTR: OVFFRMCNT Mask*/ - -#define GMACDMA_MFOVCNTR_OVFCNTOVF_Pos (28) /*!< GMACDMA_T::MFOVCNTR: OVFCNTOVF Position*/ -#define GMACDMA_MFOVCNTR_OVFCNTOVF_Msk (0x1ul << GMACDMA_MFOVCNTR_OVFCNTOVF_Pos) /*!< GMACDMA_T::MFOVCNTR: OVFCNTOVF Mask*/ - -#define GMACDMA_RXINTWDT_RIWT_Pos (0) /*!< GMACDMA_T::RXINTWDT: RIWT Position*/ -#define GMACDMA_RXINTWDT_RIWT_Msk (0xfful << GMACDMA_RXINTWDT_RIWT_Pos) /*!< GMACDMA_T::RXINTWDT: RIWT Mask*/ - -#define GMACDMA_AXIMODE_UNDEF_Pos (0) /*!< GMACDMA_T::AXIMODE: UNDEF Position */ -#define GMACDMA_AXIMODE_UNDEF_Msk (0x1ul << GMACDMA_AXIMODE_UNDEF_Pos) /*!< GMACDMA_T::AXIMODE: UNDEF Mask */ - -#define GMACDMA_AXIMODE_BLEN4_Pos (1) /*!< GMACDMA_T::AXIMODE: BLEN4 Position */ -#define GMACDMA_AXIMODE_BLEN4_Msk (0x1ul << GMACDMA_AXIMODE_BLEN4_Pos) /*!< GMACDMA_T::AXIMODE: BLEN4 Mask */ - -#define GMACDMA_AXIMODE_BLEN8_Pos (2) /*!< GMACDMA_T::AXIMODE: BLEN8 Position */ -#define GMACDMA_AXIMODE_BLEN8_Msk (0x1ul << GMACDMA_AXIMODE_BLEN8_Pos) /*!< GMACDMA_T::AXIMODE: BLEN8 Mask */ - -#define GMACDMA_AXIMODE_BLEN16_Pos (3) /*!< GMACDMA_T::AXIMODE: BLEN16 Position */ -#define GMACDMA_AXIMODE_BLEN16_Msk (0x1ul << GMACDMA_AXIMODE_BLEN16_Pos) /*!< GMACDMA_T::AXIMODE: BLEN16 Mask */ - -#define GMACDMA_AXIMODE_AXI_AAL_Pos (12) /*!< GMACDMA_T::AXIMODE: AXI_AAL Position */ -#define GMACDMA_AXIMODE_AXI_AAL_Msk (0x1ul << GMACDMA_AXIMODE_AXI_AAL_Pos) /*!< GMACDMA_T::AXIMODE: AXI_AAL Mask */ - -#define GMACDMA_AXIMODE_ONEKBBE_Pos (13) /*!< GMACDMA_T::AXIMODE: ONEKBBE Position */ -#define GMACDMA_AXIMODE_ONEKBBE_Msk (0x1ul << GMACDMA_AXIMODE_ONEKBBE_Pos) /*!< GMACDMA_T::AXIMODE: ONEKBBE Mask */ - -#define GMACDMA_AXIMODE_RD_OSR_LMT_Pos (16) /*!< GMACDMA_T::AXIMODE: RD_OSR_LMT Position */ -#define GMACDMA_AXIMODE_RD_OSR_LMT_Msk (0x3ul << GMACDMA_AXIMODE_RD_OSR_LMT_Pos) /*!< GMACDMA_T::AXIMODE: RD_OSR_LMT Mask */ - -#define GMACDMA_AXIMODE_RD_OSR_LMT_GT4_Pos (18) /*!< GMACDMA_T::AXIMODE: RD_OSR_LMT_GT4 Position*/ -#define GMACDMA_AXIMODE_RD_OSR_LMT_GT4_Msk (0x1ul << GMACDMA_AXIMODE_RD_OSR_LMT_GT4_Pos) /*!< GMACDMA_T::AXIMODE: RD_OSR_LMT_GT4 Mask */ - -#define GMACDMA_AXIMODE_RD_OSR_LMT_GT8_Pos (19) /*!< GMACDMA_T::AXIMODE: RD_OSR_LMT_GT8 Position*/ -#define GMACDMA_AXIMODE_RD_OSR_LMT_GT8_Msk (0x1ul << GMACDMA_AXIMODE_RD_OSR_LMT_GT8_Pos) /*!< GMACDMA_T::AXIMODE: RD_OSR_LMT_GT8 Mask */ - -#define GMACDMA_AXIMODE_WR_OSR_LMT_Pos (20) /*!< GMACDMA_T::AXIMODE: WR_OSR_LMT Position */ -#define GMACDMA_AXIMODE_WR_OSR_LMT_Msk (0x3ul << GMACDMA_AXIMODE_WR_OSR_LMT_Pos) /*!< GMACDMA_T::AXIMODE: WR_OSR_LMT Mask */ - -#define GMACDMA_AXIMODE_WR_OSR_LMT_GT4_Pos (22) /*!< GMACDMA_T::AXIMODE: WR_OSR_LMT_GT4 Position*/ -#define GMACDMA_AXIMODE_WR_OSR_LMT_GT4_Msk (0x1ul << GMACDMA_AXIMODE_WR_OSR_LMT_GT4_Pos) /*!< GMACDMA_T::AXIMODE: WR_OSR_LMT_GT4 Mask */ - -#define GMACDMA_AXIMODE_WR_OSR_LMT_GT8_Pos (23) /*!< GMACDMA_T::AXIMODE: WR_OSR_LMT_GT8 Position*/ -#define GMACDMA_AXIMODE_WR_OSR_LMT_GT8_Msk (0x1ul << GMACDMA_AXIMODE_WR_OSR_LMT_GT8_Pos) /*!< GMACDMA_T::AXIMODE: WR_OSR_LMT_GT8 Mask */ - -#define GMACDMA_AXIMODE_LPI_XIT_FRM_Pos (30) /*!< GMACDMA_T::AXIMODE: LPI_XIT_FRM Position */ -#define GMACDMA_AXIMODE_LPI_XIT_FRM_Msk (0x1ul << GMACDMA_AXIMODE_LPI_XIT_FRM_Pos) /*!< GMACDMA_T::AXIMODE: LPI_XIT_FRM Mask */ - -#define GMACDMA_AXIMODE_EN_LPI_Pos (31) /*!< GMACDMA_T::AXIMODE: EN_LPI Position */ -#define GMACDMA_AXIMODE_EN_LPI_Msk (0x1ul << GMACDMA_AXIMODE_EN_LPI_Pos) /*!< GMACDMA_T::AXIMODE: EN_LPI Mask */ - -#define GMACDMA_BUSSTS_AXWHSTS_Pos (0) /*!< GMACDMA_T::BUSSTS: AXWHSTS Position*/ -#define GMACDMA_BUSSTS_AXWHSTS_Msk (0x1ul << GMACDMA_BUSSTS_AXWHSTS_Pos) /*!< GMACDMA_T::BUSSTS: AXWHSTS Mask */ - -#define GMACDMA_BUSSTS_AXIRDSTS_Pos (1) /*!< GMACDMA_T::BUSSTS: AXIRDSTS Position*/ -#define GMACDMA_BUSSTS_AXIRDSTS_Msk (0x1ul << GMACDMA_BUSSTS_AXIRDSTS_Pos) /*!< GMACDMA_T::BUSSTS: AXIRDSTS Mask */ - -#define GMACDMA_CTXDESC_CURTDESAPTR_Pos (0) /*!< GMACDMA_T::CTXDESC: CURTDESAPTR Position*/ -#define GMACDMA_CTXDESC_CURTDESAPTR_Msk (0xfffffffful << GMACDMA_CTXDESC_CURTDESAPTR_Pos) /*!< GMACDMA_T::CTXDESC: CURTDESAPTR Mask*/ - -#define GMACDMA_CRXDESC_CURRDESAPTR_Pos (0) /*!< GMACDMA_T::CRXDESC: CURRDESAPTR Position*/ -#define GMACDMA_CRXDESC_CURRDESAPTR_Msk (0xfffffffful << GMACDMA_CRXDESC_CURRDESAPTR_Pos) /*!< GMACDMA_T::CRXDESC: CURRDESAPTR Mask*/ - -#define GMACDMA_CTXBUF_CURTBUFAPTR_Pos (0) /*!< GMACDMA_T::CTXBUF: CURTBUFAPTR Position*/ -#define GMACDMA_CTXBUF_CURTBUFAPTR_Msk (0xfffffffful << GMACDMA_CTXBUF_CURTBUFAPTR_Pos) /*!< GMACDMA_T::CTXBUF: CURTBUFAPTR Mask*/ - -#define GMACDMA_CRXBUF_CURRBUFAPTR_Pos (0) /*!< GMACDMA_T::CRXBUF: CURRBUFAPTR Position*/ -#define GMACDMA_CRXBUF_CURRBUFAPTR_Msk (0xfffffffful << GMACDMA_CRXBUF_CURRBUFAPTR_Pos) /*!< GMACDMA_T::CRXBUF: CURRBUFAPTR Mask*/ - -#define GMACDMA_HWFEAT_MIISEL_Pos (0) /*!< GMACDMA_T::HWFEAT: MIISEL Position */ -#define GMACDMA_HWFEAT_MIISEL_Msk (0x1ul << GMACDMA_HWFEAT_MIISEL_Pos) /*!< GMACDMA_T::HWFEAT: MIISEL Mask */ - -#define GMACDMA_HWFEAT_GMIISEL_Pos (1) /*!< GMACDMA_T::HWFEAT: GMIISEL Position */ -#define GMACDMA_HWFEAT_GMIISEL_Msk (0x1ul << GMACDMA_HWFEAT_GMIISEL_Pos) /*!< GMACDMA_T::HWFEAT: GMIISEL Mask */ - -#define GMACDMA_HWFEAT_HDSEL_Pos (2) /*!< GMACDMA_T::HWFEAT: HDSEL Position */ -#define GMACDMA_HWFEAT_HDSEL_Msk (0x1ul << GMACDMA_HWFEAT_HDSEL_Pos) /*!< GMACDMA_T::HWFEAT: HDSEL Mask */ - -#define GMACDMA_HWFEAT_EXTHASHEN_Pos (3) /*!< GMACDMA_T::HWFEAT: EXTHASHEN Position */ -#define GMACDMA_HWFEAT_EXTHASHEN_Msk (0x1ul << GMACDMA_HWFEAT_EXTHASHEN_Pos) /*!< GMACDMA_T::HWFEAT: EXTHASHEN Mask */ - -#define GMACDMA_HWFEAT_HASHSEL_Pos (4) /*!< GMACDMA_T::HWFEAT: HASHSEL Position */ -#define GMACDMA_HWFEAT_HASHSEL_Msk (0x1ul << GMACDMA_HWFEAT_HASHSEL_Pos) /*!< GMACDMA_T::HWFEAT: HASHSEL Mask */ - -#define GMACDMA_HWFEAT_ADDMACADRSEL_Pos (5) /*!< GMACDMA_T::HWFEAT: ADDMACADRSEL Position */ -#define GMACDMA_HWFEAT_ADDMACADRSEL_Msk (0x1ul << GMACDMA_HWFEAT_ADDMACADRSEL_Pos) /*!< GMACDMA_T::HWFEAT: ADDMACADRSEL Mask */ - -#define GMACDMA_HWFEAT_PCSSEL_Pos (6) /*!< GMACDMA_T::HWFEAT: PCSSEL Position */ -#define GMACDMA_HWFEAT_PCSSEL_Msk (0x1ul << GMACDMA_HWFEAT_PCSSEL_Pos) /*!< GMACDMA_T::HWFEAT: PCSSEL Mask */ - -#define GMACDMA_HWFEAT_L3L4FLTREN_Pos (7) /*!< GMACDMA_T::HWFEAT: L3L4FLTREN Position */ -#define GMACDMA_HWFEAT_L3L4FLTREN_Msk (0x1ul << GMACDMA_HWFEAT_L3L4FLTREN_Pos) /*!< GMACDMA_T::HWFEAT: L3L4FLTREN Mask */ - -#define GMACDMA_HWFEAT_SMASEL_Pos (8) /*!< GMACDMA_T::HWFEAT: SMASEL Position */ -#define GMACDMA_HWFEAT_SMASEL_Msk (0x1ul << GMACDMA_HWFEAT_SMASEL_Pos) /*!< GMACDMA_T::HWFEAT: SMASEL Mask */ - -#define GMACDMA_HWFEAT_RWKSEL_Pos (9) /*!< GMACDMA_T::HWFEAT: RWKSEL Position */ -#define GMACDMA_HWFEAT_RWKSEL_Msk (0x1ul << GMACDMA_HWFEAT_RWKSEL_Pos) /*!< GMACDMA_T::HWFEAT: RWKSEL Mask */ - -#define GMACDMA_HWFEAT_MGKSEL_Pos (10) /*!< GMACDMA_T::HWFEAT: MGKSEL Position */ -#define GMACDMA_HWFEAT_MGKSEL_Msk (0x1ul << GMACDMA_HWFEAT_MGKSEL_Pos) /*!< GMACDMA_T::HWFEAT: MGKSEL Mask */ - -#define GMACDMA_HWFEAT_MMCSEL_Pos (11) /*!< GMACDMA_T::HWFEAT: MMCSEL Position */ -#define GMACDMA_HWFEAT_MMCSEL_Msk (0x1ul << GMACDMA_HWFEAT_MMCSEL_Pos) /*!< GMACDMA_T::HWFEAT: MMCSEL Mask */ - -#define GMACDMA_HWFEAT_TSVER1SEL_Pos (12) /*!< GMACDMA_T::HWFEAT: TSVER1SEL Position */ -#define GMACDMA_HWFEAT_TSVER1SEL_Msk (0x1ul << GMACDMA_HWFEAT_TSVER1SEL_Pos) /*!< GMACDMA_T::HWFEAT: TSVER1SEL Mask */ - -#define GMACDMA_HWFEAT_TSVER2SEL_Pos (13) /*!< GMACDMA_T::HWFEAT: TSVER2SEL Position */ -#define GMACDMA_HWFEAT_TSVER2SEL_Msk (0x1ul << GMACDMA_HWFEAT_TSVER2SEL_Pos) /*!< GMACDMA_T::HWFEAT: TSVER2SEL Mask */ - -#define GMACDMA_HWFEAT_EEESEL_Pos (14) /*!< GMACDMA_T::HWFEAT: EEESEL Position */ -#define GMACDMA_HWFEAT_EEESEL_Msk (0x1ul << GMACDMA_HWFEAT_EEESEL_Pos) /*!< GMACDMA_T::HWFEAT: EEESEL Mask */ - -#define GMACDMA_HWFEAT_AVSEL_Pos (15) /*!< GMACDMA_T::HWFEAT: AVSEL Position */ -#define GMACDMA_HWFEAT_AVSEL_Msk (0x1ul << GMACDMA_HWFEAT_AVSEL_Pos) /*!< GMACDMA_T::HWFEAT: AVSEL Mask */ - -#define GMACDMA_HWFEAT_TXCOESEL_Pos (16) /*!< GMACDMA_T::HWFEAT: TXCOESEL Position */ -#define GMACDMA_HWFEAT_TXCOESEL_Msk (0x1ul << GMACDMA_HWFEAT_TXCOESEL_Pos) /*!< GMACDMA_T::HWFEAT: TXCOESEL Mask */ - -#define GMACDMA_HWFEAT_RXTYP1COE_Pos (17) /*!< GMACDMA_T::HWFEAT: RXTYP1COE Position */ -#define GMACDMA_HWFEAT_RXTYP1COE_Msk (0x1ul << GMACDMA_HWFEAT_RXTYP1COE_Pos) /*!< GMACDMA_T::HWFEAT: RXTYP1COE Mask */ - -#define GMACDMA_HWFEAT_RXTYP2COE_Pos (18) /*!< GMACDMA_T::HWFEAT: RXTYP2COE Position */ -#define GMACDMA_HWFEAT_RXTYP2COE_Msk (0x1ul << GMACDMA_HWFEAT_RXTYP2COE_Pos) /*!< GMACDMA_T::HWFEAT: RXTYP2COE Mask */ - -#define GMACDMA_HWFEAT_RXFIFOSIZE_Pos (19) /*!< GMACDMA_T::HWFEAT: RXFIFOSIZE Position */ -#define GMACDMA_HWFEAT_RXFIFOSIZE_Msk (0x1ul << GMACDMA_HWFEAT_RXFIFOSIZE_Pos) /*!< GMACDMA_T::HWFEAT: RXFIFOSIZE Mask */ - -#define GMACDMA_HWFEAT_RXCHCNT_Pos (20) /*!< GMACDMA_T::HWFEAT: RXCHCNT Position */ -#define GMACDMA_HWFEAT_RXCHCNT_Msk (0x3ul << GMACDMA_HWFEAT_RXCHCNT_Pos) /*!< GMACDMA_T::HWFEAT: RXCHCNT Mask */ - -#define GMACDMA_HWFEAT_TXCHCNT_Pos (22) /*!< GMACDMA_T::HWFEAT: TXCHCNT Position */ -#define GMACDMA_HWFEAT_TXCHCNT_Msk (0x3ul << GMACDMA_HWFEAT_TXCHCNT_Pos) /*!< GMACDMA_T::HWFEAT: TXCHCNT Mask */ - -#define GMACDMA_HWFEAT_ENHDESSEL_Pos (24) /*!< GMACDMA_T::HWFEAT: ENHDESSEL Position */ -#define GMACDMA_HWFEAT_ENHDESSEL_Msk (0x1ul << GMACDMA_HWFEAT_ENHDESSEL_Pos) /*!< GMACDMA_T::HWFEAT: ENHDESSEL Mask */ - -#define GMACDMA_HWFEAT_INTTSEN_Pos (25) /*!< GMACDMA_T::HWFEAT: INTTSEN Position */ -#define GMACDMA_HWFEAT_INTTSEN_Msk (0x1ul << GMACDMA_HWFEAT_INTTSEN_Pos) /*!< GMACDMA_T::HWFEAT: INTTSEN Mask */ - -#define GMACDMA_HWFEAT_FLEXIPPSEN_Pos (26) /*!< GMACDMA_T::HWFEAT: FLEXIPPSEN Position */ -#define GMACDMA_HWFEAT_FLEXIPPSEN_Msk (0x1ul << GMACDMA_HWFEAT_FLEXIPPSEN_Pos) /*!< GMACDMA_T::HWFEAT: FLEXIPPSEN Mask */ - -#define GMACDMA_HWFEAT_SAVLANINS_Pos (27) /*!< GMACDMA_T::HWFEAT: SAVLANINS Position */ -#define GMACDMA_HWFEAT_SAVLANINS_Msk (0x1ul << GMACDMA_HWFEAT_SAVLANINS_Pos) /*!< GMACDMA_T::HWFEAT: SAVLANINS Mask */ - -#define GMACDMA_HWFEAT_ACTPHYIF_Pos (28) /*!< GMACDMA_T::HWFEAT: ACTPHYIF Position */ -#define GMACDMA_HWFEAT_ACTPHYIF_Msk (0x7ul << GMACDMA_HWFEAT_ACTPHYIF_Pos) /*!< GMACDMA_T::HWFEAT: ACTPHYIF Mask */ - -/**@}*/ /* GMACDMA_CONST */ -/**@}*/ /* end of GMACDMA register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __GMAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gpio_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gpio_reg.h deleted file mode 100644 index c969d76b761..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/gpio_reg.h +++ /dev/null @@ -1,1221 +0,0 @@ -/**************************************************************************//** - * @file gpio_reg.h - * @brief GPIO register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __GPIO_REG_H__ -#define __GPIO_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup GPIO General Purpose Input/Output Controller(GPIO) - Memory Mapped Structure for GPIO Controller -@{ */ - - -typedef struct -{ - - /** - * @var GPIO_T::MODE - * Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0/0x200/0x240/0x280/0x2C0/0x300/0x340 Port A-N I/O Mode Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|MODEn |Port A-N I/O Pin[n] Mode Control - * | | |Determine each I/O mode of Px.n pins. - * | | |00 = Px.n is in Input mode. - * | | |01 = Px.n is in Push-pull Output mode. - * | | |10 = Px.n is in Open-drain Output mode. - * | | |11 = Reserved. - * | | |Note 1: The default value is 0x0000_0000 and all pins will be input mode after chip powered on. - * | | |Note 2: If MFOS is enabled then GPIO mode setting is ignored. - * @var GPIO_T::DINOFF - * Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4/0x204/0x244/0x284/0x2C4/0x304/0x344 Port A-N Digital Input Path Disable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n+16] |DINOFFn |Port A-N Pin[n] Digital Input Path Disable Bit - * | | |Each of these bits is used to control if the digital input path of corresponding Px.n pin is disabled. - * | | |If input is analog signal, users can disable Px.n digital input path to avoid input current leakage. - * | | |0 = Px.n digital input path Enabled. - * | | |1 = Px.n digital input path Disabled (digital input tied to low). - * @var GPIO_T::DOUT - * Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8/0x208/0x248/0x288/0x2C8/0x308/0x348 Port A-N Data Output Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DOUTn |Port A-N Pin[n] Output Value - * | | |Each of these bits controls the status of a Px.n pin when the Px.n is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |0 = Px.n will drive Low if the Px.n pin is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |1 = Px.n will drive High if the Px.n pin is configured as Push-pull output or Quasi-bidirectional mode. - * @var GPIO_T::DATMSK - * Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC/0x20C/0x24C/0x28C/0x2CC/0x30C/0x34C Port A-N Data Output Write Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DATMSKn |Port A-N Pin[n] Data Output Write Mask - * | | |These bits are used to protect the corresponding DOUT (Px_DOUT[n]) bit - * | | |When the DATMSK (Px_DATMSK[n]) bit is set to 1, the corresponding DOUT (Px_DOUT[n]) bit is protected. - * | | |If the write signal is masked, writing data to the protect bit is ignored. - * | | |0 = Corresponding DOUT (Px_DOUT[n]) bit can be updated. - * | | |1 = Corresponding DOUT (Px_DOUT[n]) bit protected. - * | | |Note: This function only protects the corresponding DOUT (Px_DOUT[n]) bit, and will not protect the corresponding PDIO (Pxn_PDIO[0]) bit. - * @var GPIO_T::PIN - * Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0/0x210/0x250/0x290/0x2D0/0x310/0x350 Port A-N Pin Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |PINn |Port A-N Pin[n] Pin Value - * | | |Each bit of the register reflects the actual status of the respective Px.n pin. - * | | |If the bit is 1, it indicates the corresponding pin status is high; else the pin status is low. - * @var GPIO_T::DBEN - * Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4/0x214/0x254/0x294/0x2D4/0x314/0x354 Port A-N De-Bounce Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DBENn |Port A-N Pin[n] Input Signal De-Bounce Enable Bit - * | | |The DBEN[n] bit is used to enable the de-bounce function for each corresponding bit. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the interrupt. - * | | |The de-bounce clock source is controlled by DBCLKSRC (GPIO_DBCTL [4]), one de-bounce sample cycle period is controlled by DBCLKSEL (GPIO_DBCTL [3:0]). - * | | |0 = Px.n de-bounce function Disabled. - * | | |1 = Px.n de-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * @var GPIO_T::INTTYPE - * Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8/0x218/0x258/0x298/0x2D8/0x318/0x358 Port A-N Interrupt Trigger Type Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |TYPEn |Port A-N Pin[n] Edge or Level Detection Interrupt Trigger Type Control - * | | |TYPE (Px_INTTYPE[n]) bit is used to control the triggered interrupt is by level trigger or by edge trigger. - * | | |If the interrupt is by edge trigger, the trigger source can be controlled by de-bounce. - * | | |If the interrupt is by level trigger, the input source is sampled by one HCLK clock and generates the interrupt. - * | | |0 = Edge trigger interrupt. - * | | |1 = Level trigger interrupt. - * | | |If the pin is set as the level trigger interrupt, only one level can be set on the registers RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]). - * | | |If both levels to trigger interrupt are set, the setting is ignored and no interrupt will occur. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * @var GPIO_T::INTEN - * Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC/0x21C/0x25C/0x29C/0x2DC/0x31C/0x35C Port A-N Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |FLIENn |Port A-N Pin[n] Falling Edge or Low Level Interrupt Trigger Type Enable Bit - * | | |The FLIEN (Px_INTEN[n]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the FLIEN (Px_INTEN[n]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at low level. - * | | |If the interrupt is edge trigger(TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from high to low. - * | | |0 = Px.n level low or high to low interrupt Disabled. - * | | |1 = Px.n level low or high to low interrupt Enabled. - * |[n+16] |RHIENn |Port A-N Pin[n] Rising Edge or High Level Interrupt Trigger Type Enable Bit - * | | |The RHIEN (Px_INTEN[n+16]) bit is used to enable the interrupt for each of the corresponding input Px.n pin - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the RHIEN (Px_INTEN[n+16]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at high level. - * | | |If the interrupt is edge trigger (TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from low to high. - * | | |0 = Px.n level high or low to high interrupt Disabled. - * | | |1 = Px.n level high or low to high interrupt Enabled. - * @var GPIO_T::INTSRC - * Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0/0x220/0x260/0x2A0/0x2E0/0x320/0x360 Port A-N Interrupt Source Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |INTSRCn |Port A-N Pin[n] Interrupt Source Flag - * | | |Write Operation : - * | | |0 = No action. - * | | |1 = Clear the corresponding pending interrupt. - * | | |Read Operation : - * | | |0 = No interrupt at Px.n. - * | | |1 = Px.n generates an interrupt. - * @var GPIO_T::SMTEN - * Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4/0x224/0x264/0x2A4/0x2E4/0x324/0x364 Port A-N Input Schmitt Trigger Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |SMTENn |Port A-N Pin[n] Input Schmitt Trigger Enable Bit - * | | |0 = Px.n input Schmitt trigger function Disabled. - * | | |1 = Px.n input Schmitt trigger function Enabled. - * @var GPIO_T::SLEWCTL - * Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8/0x228/0x268/0x2A8/0x2E8/0x328/0x368 Port A-N High Slew Rate Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|HSRENn |Port A-N Pin[n] High Slew Rate Control - * | | |00 = Px.n output with normal slew rate mode. - * | | |01 = Px.n output with high slew rate mode . - * | | |10 = Reserved. - * | | |11 = Reserved. - * @var GPIO_T::PUSEL - * Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0/0x230/0x270/0x2B0/0x2F0/0x330/0x370 Port A-N Pull-up and Pull-down Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|PUSELn |Port A-N Pin[n] Pull-up and Pull-down Enable Register - * | | |Determine each I/O Pull-up/pull-down of Px.n pins. - * | | |00 = Px.n pull-up and pull-down disable. - * | | |01 = Px.n pull-up enable. - * | | |10 = Px.n pull-down enable. - * | | |11 = Px.n pull-up and pull-down disable. - * | | |Note: Basically, the pull-up control and pull-down control has following behavior limitation. - * | | |The independent pull-up control register only valid when MODEn is set as input and open-drain mode even if I/O function is switched to multi-function pin, e.g - * | | |UARTx_RXD. - * | | |The independent pull-down control register is only valid when MODEn set as tri-state mode. - * | | |When both pull-up pull-down is set as 1 at "tri-state" mode, keep I/O in tri-state mode. - * @var GPIO_T::DBCTL - * Offset: 0x34/0x74/0xB4/0xF4/0x134/0x174/0x1B4/0x1F4/0x234/0x274/0x2B4/0x2F4/0x334/0x374 Port A-N Interrupt De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DBCLKSEL |De-bounce Sampling Cycle Selection - * | | |0000 = Sample interrupt input once per 1 clocks. - * | | |0001 = Sample interrupt input once per 2 clocks. - * | | |0010 = Sample interrupt input once per 4 clocks. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 2*256 clocks. - * | | |1010 = Sample interrupt input once per 4*256 clocks. - * | | |1011 = Sample interrupt input once per 8*256 clocks. - * | | |1100 = Sample interrupt input once per 16*256 clocks. - * | | |1101 = Sample interrupt input once per 32*256 clocks. - * | | |1110 = Sample interrupt input once per 64*256 clocks. - * | | |1111 = Sample interrupt input once per 128*256 clocks. - * |[4] |DBCLKSRC |De-bounce Counter Clock Source Selection - * | | |0 = De-bounce counter clock source is the HXT. - * | | |1 = De-bounce counter clock source is the LIRC. - * | | |Note: This bit is reserved if the chip package without LIRC - * | | |The de-bounce counter clock source is only from HXT - * | | |And setting this bit does not guarantee what will occur. - * |[5] |ICLKON |Interrupt Clock on Mode - * | | |0 = Edge detection circuit is active only if I/O pin corresponding RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]) bit is set to 1. - * | | |1 = All I/O pins edge detection circuit is always active after reset. - * | | |Note: It is recommended to disable this bit to save system power if no special application concern. - * @var GPIO_T::DS - * Offset: 0x38 0x38/0x78/0xB8/0xF8/0x138/0x178/0x1B8/0x1F8/0x238/0x278/0x2B8/0x2F8/0x338/0x378 Port A-N Driver Strength Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DS10_DS00 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[1] |DS11_DS01 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[2] |DS12_DS02 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[3] |DS13_DS03 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[4] |DS14_DS04 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[5] |DS15_DS05 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[6] |DS16_DS06 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[7] |DS17_DS07 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[8] |DS18_DS08 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[9] |DS19_DS09 |Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[10] |DS110_DS010|Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[11] |DS111_DS011|Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[12] |DS112_DS012|Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[13] |DS113_DS013|Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[14] |DS114_DS014|Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * |[15] |DS115_DS015|Port A-N Pin[n] Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |00 = [ DS1n, DS0n] is minimum diver strength. - * | | |11 = [ DS1n, DS0n] is maximum diver strength. - * | | |Note: PH_DS bit20~bit23 are reserved. - * | | |The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is minimum. - * @var GPIO_T::PA_UDS - * Offset: 0x3C/0x7C/0xBC/0xFC/0x13C/0x17C/0x1BC/0x1FC/0x23C/0x27C/0x2BC/0x2FC/0x33C/0x37C Port A-N Ultra Driver Strength Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |UDS0 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[1] |UDS1 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[2] |UDS2 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[3] |UDS3 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[4] |UDS4 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[5] |UDS5 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[6] |UDS6 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[7] |UDS7 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[8] |UDS8 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[9] |UDS9 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[10] |UDS10 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[11] |UDS11 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[12] |UDS12 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[13] |UDS13 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[14] |UDS14 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - * |[15] |UDS15 |Port A-N Pin[n] Ultra Driver Strength Control Register - * | | |Determine each driver strength of Px.n pins. - * | | |0 = Px.n is minimum deiver strength. - * | | |1 = Px.n is maximum deiver strength. - * | | |Note: The UDS and DS bits are Px.n driver strength control bits. - * | | |When [ UDS, DS1, DS0 ] are "111", the driver strength is the maximum. - * | | |When [ UDS, DS1, DS0 ] are "000", the driver strength is the minimum. - */ - - __IO uint32_t MODE; /* Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0/0x200/0x240/0x280/0x2C0/0x300/0x340 Port A-N I/O Mode Control */ - __IO uint32_t DINOFF; /* Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4/0x204/0x244/0x284/0x2C4/0x304/0x344 Port A-N Digital Input Path Disable Control */ - __IO uint32_t DOUT; /* Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8/0x208/0x248/0x288/0x2C8/0x308/0x348 Port A-N Data Output Value */ - __IO uint32_t DATMSK; /* Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC/0x20C/0x24C/0x28C/0x2CC/0x30C/0x34C Port A-N Data Output Write Mask */ - __I uint32_t PIN; /* Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0/0x210/0x250/0x290/0x2D0/0x310/0x350 Port A-N Pin Value */ - __IO uint32_t DBEN; /* Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4/0x214/0x254/0x294/0x2D4/0x314/0x354 Port A-N De-Bounce Enable Control Register */ - __IO uint32_t INTTYPE; /* Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8/0x218/0x258/0x298/0x2D8/0x318/0x358 Port A-N Interrupt Trigger Type Control */ - __IO uint32_t INTEN; /* Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC/0x21C/0x25C/0x29C/0x2DC/0x31C/0x35C Port A-N Interrupt Enable Control Register */ - __IO uint32_t INTSRC; /* Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0/0x220/0x260/0x2A0/0x2E0/0x320/0x360 Port A-N Interrupt Source Flag */ - __IO uint32_t SMTEN; /* Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4/0x224/0x264/0x2A4/0x2E4/0x324/0x364 Port A-N Input Schmitt Trigger Enable Register */ - __IO uint32_t SLEWCTL; /* Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8/0x228/0x268/0x2A8/0x2E8/0x328/0x368 Port A-N High Slew Rate Control Register */ - __IO uint32_t SPW; /* Offset: 0x06C/0xAC/0xEC/0x12C/0x16C/0x1AC/0x26C/0x2AC/0x36C */ - __IO uint32_t PUSEL; /* Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0/0x230/0x270/0x2B0/0x2F0/0x330/0x370 Port A-N Pull-up and Pull-down Enable Register */ - __IO uint32_t DBCTL; /* Offset: 0x34/0x74/0xB4/0xF4/0x134/0x174/0x1B4/0x1F4/0x234/0x274/0x2B4/0x2F4/0x334/0x374 Port A-N Interrupt De-bounce Control Register */ - __IO uint32_t DSL; /* Offset: 0x38/0x78/0xB8/0xF8/0x138/0x178/0x1B8/0x1F8/0x238/0x278/0x2B8/0x2F8/0x338/0x378 Port A-N Low-byte Driver Strength Control Register */ - __IO uint32_t DSH; /* Offset: 0x3c/0x7C/0xBC/0xFC/0x13C/0x17C/0x1BC/0x1FC/0x23C/0x27C/0x2BC/0x2FC/0x33C/0x37C Port A-N High-byte Driver Strength Control Register */ -} GPIO_T; - -/** - @addtogroup GPIO_CONST GPIO Bit Field Definition - Constant Definitions for GPIO Controller -@{ */ - -#define GPIO_MODE_MODE0_Pos (0) /*!< GPIO_T::MODE: MODE0 Position */ -#define GPIO_MODE_MODE0_Msk (0x3ul << GPIO_MODE_MODE0_Pos) /*!< GPIO_T::MODE: MODE0 Mask */ - -#define GPIO_MODE_MODE1_Pos (2) /*!< GPIO_T::MODE: MODE1 Position */ -#define GPIO_MODE_MODE1_Msk (0x3ul << GPIO_MODE_MODE1_Pos) /*!< GPIO_T::MODE: MODE1 Mask */ - -#define GPIO_MODE_MODE2_Pos (4) /*!< GPIO_T::MODE: MODE2 Position */ -#define GPIO_MODE_MODE2_Msk (0x3ul << GPIO_MODE_MODE2_Pos) /*!< GPIO_T::MODE: MODE2 Mask */ - -#define GPIO_MODE_MODE3_Pos (6) /*!< GPIO_T::MODE: MODE3 Position */ -#define GPIO_MODE_MODE3_Msk (0x3ul << GPIO_MODE_MODE3_Pos) /*!< GPIO_T::MODE: MODE3 Mask */ - -#define GPIO_MODE_MODE4_Pos (8) /*!< GPIO_T::MODE: MODE4 Position */ -#define GPIO_MODE_MODE4_Msk (0x3ul << GPIO_MODE_MODE4_Pos) /*!< GPIO_T::MODE: MODE4 Mask */ - -#define GPIO_MODE_MODE5_Pos (10) /*!< GPIO_T::MODE: MODE5 Position */ -#define GPIO_MODE_MODE5_Msk (0x3ul << GPIO_MODE_MODE5_Pos) /*!< GPIO_T::MODE: MODE5 Mask */ - -#define GPIO_MODE_MODE6_Pos (12) /*!< GPIO_T::MODE: MODE6 Position */ -#define GPIO_MODE_MODE6_Msk (0x3ul << GPIO_MODE_MODE6_Pos) /*!< GPIO_T::MODE: MODE6 Mask */ - -#define GPIO_MODE_MODE7_Pos (14) /*!< GPIO_T::MODE: MODE7 Position */ -#define GPIO_MODE_MODE7_Msk (0x3ul << GPIO_MODE_MODE7_Pos) /*!< GPIO_T::MODE: MODE7 Mask */ - -#define GPIO_MODE_MODE8_Pos (16) /*!< GPIO_T::MODE: MODE8 Position */ -#define GPIO_MODE_MODE8_Msk (0x3ul << GPIO_MODE_MODE8_Pos) /*!< GPIO_T::MODE: MODE8 Mask */ - -#define GPIO_MODE_MODE9_Pos (18) /*!< GPIO_T::MODE: MODE9 Position */ -#define GPIO_MODE_MODE9_Msk (0x3ul << GPIO_MODE_MODE9_Pos) /*!< GPIO_T::MODE: MODE9 Mask */ - -#define GPIO_MODE_MODE10_Pos (20) /*!< GPIO_T::MODE: MODE10 Position */ -#define GPIO_MODE_MODE10_Msk (0x3ul << GPIO_MODE_MODE10_Pos) /*!< GPIO_T::MODE: MODE10 Mask */ - -#define GPIO_MODE_MODE11_Pos (22) /*!< GPIO_T::MODE: MODE11 Position */ -#define GPIO_MODE_MODE11_Msk (0x3ul << GPIO_MODE_MODE11_Pos) /*!< GPIO_T::MODE: MODE11 Mask */ - -#define GPIO_MODE_MODE12_Pos (24) /*!< GPIO_T::MODE: MODE12 Position */ -#define GPIO_MODE_MODE12_Msk (0x3ul << GPIO_MODE_MODE12_Pos) /*!< GPIO_T::MODE: MODE12 Mask */ - -#define GPIO_MODE_MODE13_Pos (26) /*!< GPIO_T::MODE: MODE13 Position */ -#define GPIO_MODE_MODE13_Msk (0x3ul << GPIO_MODE_MODE13_Pos) /*!< GPIO_T::MODE: MODE13 Mask */ - -#define GPIO_MODE_MODE14_Pos (28) /*!< GPIO_T::MODE: MODE14 Position */ -#define GPIO_MODE_MODE14_Msk (0x3ul << GPIO_MODE_MODE14_Pos) /*!< GPIO_T::MODE: MODE14 Mask */ - -#define GPIO_MODE_MODE15_Pos (30) /*!< GPIO_T::MODE: MODE15 Position */ -#define GPIO_MODE_MODE15_Msk (0x3ul << GPIO_MODE_MODE15_Pos) /*!< GPIO_T::MODE: MODE15 Mask */ - -#define GPIO_DINOFF_DINOFF0_Pos (16) /*!< GPIO_T::DINOFF: DINOFF0 Position */ -#define GPIO_DINOFF_DINOFF0_Msk (0x1ul << GPIO_DINOFF_DINOFF0_Pos) /*!< GPIO_T::DINOFF: DINOFF0 Mask */ - -#define GPIO_DINOFF_DINOFF1_Pos (17) /*!< GPIO_T::DINOFF: DINOFF1 Position */ -#define GPIO_DINOFF_DINOFF1_Msk (0x1ul << GPIO_DINOFF_DINOFF1_Pos) /*!< GPIO_T::DINOFF: DINOFF1 Mask */ - -#define GPIO_DINOFF_DINOFF2_Pos (18) /*!< GPIO_T::DINOFF: DINOFF2 Position */ -#define GPIO_DINOFF_DINOFF2_Msk (0x1ul << GPIO_DINOFF_DINOFF2_Pos) /*!< GPIO_T::DINOFF: DINOFF2 Mask */ - -#define GPIO_DINOFF_DINOFF3_Pos (19) /*!< GPIO_T::DINOFF: DINOFF3 Position */ -#define GPIO_DINOFF_DINOFF3_Msk (0x1ul << GPIO_DINOFF_DINOFF3_Pos) /*!< GPIO_T::DINOFF: DINOFF3 Mask */ - -#define GPIO_DINOFF_DINOFF4_Pos (20) /*!< GPIO_T::DINOFF: DINOFF4 Position */ -#define GPIO_DINOFF_DINOFF4_Msk (0x1ul << GPIO_DINOFF_DINOFF4_Pos) /*!< GPIO_T::DINOFF: DINOFF4 Mask */ - -#define GPIO_DINOFF_DINOFF5_Pos (21) /*!< GPIO_T::DINOFF: DINOFF5 Position */ -#define GPIO_DINOFF_DINOFF5_Msk (0x1ul << GPIO_DINOFF_DINOFF5_Pos) /*!< GPIO_T::DINOFF: DINOFF5 Mask */ - -#define GPIO_DINOFF_DINOFF6_Pos (22) /*!< GPIO_T::DINOFF: DINOFF6 Position */ -#define GPIO_DINOFF_DINOFF6_Msk (0x1ul << GPIO_DINOFF_DINOFF6_Pos) /*!< GPIO_T::DINOFF: DINOFF6 Mask */ - -#define GPIO_DINOFF_DINOFF7_Pos (23) /*!< GPIO_T::DINOFF: DINOFF7 Position */ -#define GPIO_DINOFF_DINOFF7_Msk (0x1ul << GPIO_DINOFF_DINOFF7_Pos) /*!< GPIO_T::DINOFF: DINOFF7 Mask */ - -#define GPIO_DINOFF_DINOFF8_Pos (24) /*!< GPIO_T::DINOFF: DINOFF8 Position */ -#define GPIO_DINOFF_DINOFF8_Msk (0x1ul << GPIO_DINOFF_DINOFF8_Pos) /*!< GPIO_T::DINOFF: DINOFF8 Mask */ - -#define GPIO_DINOFF_DINOFF9_Pos (25) /*!< GPIO_T::DINOFF: DINOFF9 Position */ -#define GPIO_DINOFF_DINOFF9_Msk (0x1ul << GPIO_DINOFF_DINOFF9_Pos) /*!< GPIO_T::DINOFF: DINOFF9 Mask */ - -#define GPIO_DINOFF_DINOFF10_Pos (26) /*!< GPIO_T::DINOFF: DINOFF10 Position */ -#define GPIO_DINOFF_DINOFF10_Msk (0x1ul << GPIO_DINOFF_DINOFF10_Pos) /*!< GPIO_T::DINOFF: DINOFF10 Mask */ - -#define GPIO_DINOFF_DINOFF11_Pos (27) /*!< GPIO_T::DINOFF: DINOFF11 Position */ -#define GPIO_DINOFF_DINOFF11_Msk (0x1ul << GPIO_DINOFF_DINOFF11_Pos) /*!< GPIO_T::DINOFF: DINOFF11 Mask */ - -#define GPIO_DINOFF_DINOFF12_Pos (28) /*!< GPIO_T::DINOFF: DINOFF12 Position */ -#define GPIO_DINOFF_DINOFF12_Msk (0x1ul << GPIO_DINOFF_DINOFF12_Pos) /*!< GPIO_T::DINOFF: DINOFF12 Mask */ - -#define GPIO_DINOFF_DINOFF13_Pos (29) /*!< GPIO_T::DINOFF: DINOFF13 Position */ -#define GPIO_DINOFF_DINOFF13_Msk (0x1ul << GPIO_DINOFF_DINOFF13_Pos) /*!< GPIO_T::DINOFF: DINOFF13 Mask */ - -#define GPIO_DINOFF_DINOFF14_Pos (30) /*!< GPIO_T::DINOFF: DINOFF14 Position */ -#define GPIO_DINOFF_DINOFF14_Msk (0x1ul << GPIO_DINOFF_DINOFF14_Pos) /*!< GPIO_T::DINOFF: DINOFF14 Mask */ - -#define GPIO_DINOFF_DINOFF15_Pos (31) /*!< GPIO_T::DINOFF: DINOFF15 Position */ -#define GPIO_DINOFF_DINOFF15_Msk (0x1ul << GPIO_DINOFF_DINOFF15_Pos) /*!< GPIO_T::DINOFF: DINOFF15 Mask */ - -#define GPIO_DOUT_DOUT0_Pos (0) /*!< GPIO_T::DOUT: DOUT0 Position */ -#define GPIO_DOUT_DOUT0_Msk (0x1ul << GPIO_DOUT_DOUT0_Pos) /*!< GPIO_T::DOUT: DOUT0 Mask */ - -#define GPIO_DOUT_DOUT1_Pos (1) /*!< GPIO_T::DOUT: DOUT1 Position */ -#define GPIO_DOUT_DOUT1_Msk (0x1ul << GPIO_DOUT_DOUT1_Pos) /*!< GPIO_T::DOUT: DOUT1 Mask */ - -#define GPIO_DOUT_DOUT2_Pos (2) /*!< GPIO_T::DOUT: DOUT2 Position */ -#define GPIO_DOUT_DOUT2_Msk (0x1ul << GPIO_DOUT_DOUT2_Pos) /*!< GPIO_T::DOUT: DOUT2 Mask */ - -#define GPIO_DOUT_DOUT3_Pos (3) /*!< GPIO_T::DOUT: DOUT3 Position */ -#define GPIO_DOUT_DOUT3_Msk (0x1ul << GPIO_DOUT_DOUT3_Pos) /*!< GPIO_T::DOUT: DOUT3 Mask */ - -#define GPIO_DOUT_DOUT4_Pos (4) /*!< GPIO_T::DOUT: DOUT4 Position */ -#define GPIO_DOUT_DOUT4_Msk (0x1ul << GPIO_DOUT_DOUT4_Pos) /*!< GPIO_T::DOUT: DOUT4 Mask */ - -#define GPIO_DOUT_DOUT5_Pos (5) /*!< GPIO_T::DOUT: DOUT5 Position */ -#define GPIO_DOUT_DOUT5_Msk (0x1ul << GPIO_DOUT_DOUT5_Pos) /*!< GPIO_T::DOUT: DOUT5 Mask */ - -#define GPIO_DOUT_DOUT6_Pos (6) /*!< GPIO_T::DOUT: DOUT6 Position */ -#define GPIO_DOUT_DOUT6_Msk (0x1ul << GPIO_DOUT_DOUT6_Pos) /*!< GPIO_T::DOUT: DOUT6 Mask */ - -#define GPIO_DOUT_DOUT7_Pos (7) /*!< GPIO_T::DOUT: DOUT7 Position */ -#define GPIO_DOUT_DOUT7_Msk (0x1ul << GPIO_DOUT_DOUT7_Pos) /*!< GPIO_T::DOUT: DOUT7 Mask */ - -#define GPIO_DOUT_DOUT8_Pos (8) /*!< GPIO_T::DOUT: DOUT8 Position */ -#define GPIO_DOUT_DOUT8_Msk (0x1ul << GPIO_DOUT_DOUT8_Pos) /*!< GPIO_T::DOUT: DOUT8 Mask */ - -#define GPIO_DOUT_DOUT9_Pos (9) /*!< GPIO_T::DOUT: DOUT9 Position */ -#define GPIO_DOUT_DOUT9_Msk (0x1ul << GPIO_DOUT_DOUT9_Pos) /*!< GPIO_T::DOUT: DOUT9 Mask */ - -#define GPIO_DOUT_DOUT10_Pos (10) /*!< GPIO_T::DOUT: DOUT10 Position */ -#define GPIO_DOUT_DOUT10_Msk (0x1ul << GPIO_DOUT_DOUT10_Pos) /*!< GPIO_T::DOUT: DOUT10 Mask */ - -#define GPIO_DOUT_DOUT11_Pos (11) /*!< GPIO_T::DOUT: DOUT11 Position */ -#define GPIO_DOUT_DOUT11_Msk (0x1ul << GPIO_DOUT_DOUT11_Pos) /*!< GPIO_T::DOUT: DOUT11 Mask */ - -#define GPIO_DOUT_DOUT12_Pos (12) /*!< GPIO_T::DOUT: DOUT12 Position */ -#define GPIO_DOUT_DOUT12_Msk (0x1ul << GPIO_DOUT_DOUT12_Pos) /*!< GPIO_T::DOUT: DOUT12 Mask */ - -#define GPIO_DOUT_DOUT13_Pos (13) /*!< GPIO_T::DOUT: DOUT13 Position */ -#define GPIO_DOUT_DOUT13_Msk (0x1ul << GPIO_DOUT_DOUT13_Pos) /*!< GPIO_T::DOUT: DOUT13 Mask */ - -#define GPIO_DOUT_DOUT14_Pos (14) /*!< GPIO_T::DOUT: DOUT14 Position */ -#define GPIO_DOUT_DOUT14_Msk (0x1ul << GPIO_DOUT_DOUT14_Pos) /*!< GPIO_T::DOUT: DOUT14 Mask */ - -#define GPIO_DOUT_DOUT15_Pos (15) /*!< GPIO_T::DOUT: DOUT15 Position */ -#define GPIO_DOUT_DOUT15_Msk (0x1ul << GPIO_DOUT_DOUT15_Pos) /*!< GPIO_T::DOUT: DOUT15 Mask */ - -#define GPIO_DATMSK_DATMSK0_Pos (0) /*!< GPIO_T::DATMSK: DATMSK0 Position */ -#define GPIO_DATMSK_DATMSK0_Msk (0x1ul << GPIO_DATMSK_DATMSK0_Pos) /*!< GPIO_T::DATMSK: DATMSK0 Mask */ - -#define GPIO_DATMSK_DATMSK1_Pos (1) /*!< GPIO_T::DATMSK: DATMSK1 Position */ -#define GPIO_DATMSK_DATMSK1_Msk (0x1ul << GPIO_DATMSK_DATMSK1_Pos) /*!< GPIO_T::DATMSK: DATMSK1 Mask */ - -#define GPIO_DATMSK_DATMSK2_Pos (2) /*!< GPIO_T::DATMSK: DATMSK2 Position */ -#define GPIO_DATMSK_DATMSK2_Msk (0x1ul << GPIO_DATMSK_DATMSK2_Pos) /*!< GPIO_T::DATMSK: DATMSK2 Mask */ - -#define GPIO_DATMSK_DATMSK3_Pos (3) /*!< GPIO_T::DATMSK: DATMSK3 Position */ -#define GPIO_DATMSK_DATMSK3_Msk (0x1ul << GPIO_DATMSK_DATMSK3_Pos) /*!< GPIO_T::DATMSK: DATMSK3 Mask */ - -#define GPIO_DATMSK_DATMSK4_Pos (4) /*!< GPIO_T::DATMSK: DATMSK4 Position */ -#define GPIO_DATMSK_DATMSK4_Msk (0x1ul << GPIO_DATMSK_DATMSK4_Pos) /*!< GPIO_T::DATMSK: DATMSK4 Mask */ - -#define GPIO_DATMSK_DATMSK5_Pos (5) /*!< GPIO_T::DATMSK: DATMSK5 Position */ -#define GPIO_DATMSK_DATMSK5_Msk (0x1ul << GPIO_DATMSK_DATMSK5_Pos) /*!< GPIO_T::DATMSK: DATMSK5 Mask */ - -#define GPIO_DATMSK_DATMSK6_Pos (6) /*!< GPIO_T::DATMSK: DATMSK6 Position */ -#define GPIO_DATMSK_DATMSK6_Msk (0x1ul << GPIO_DATMSK_DATMSK6_Pos) /*!< GPIO_T::DATMSK: DATMSK6 Mask */ - -#define GPIO_DATMSK_DATMSK7_Pos (7) /*!< GPIO_T::DATMSK: DATMSK7 Position */ -#define GPIO_DATMSK_DATMSK7_Msk (0x1ul << GPIO_DATMSK_DATMSK7_Pos) /*!< GPIO_T::DATMSK: DATMSK7 Mask */ - -#define GPIO_DATMSK_DATMSK8_Pos (8) /*!< GPIO_T::DATMSK: DATMSK8 Position */ -#define GPIO_DATMSK_DATMSK8_Msk (0x1ul << GPIO_DATMSK_DATMSK8_Pos) /*!< GPIO_T::DATMSK: DATMSK8 Mask */ - -#define GPIO_DATMSK_DATMSK9_Pos (9) /*!< GPIO_T::DATMSK: DATMSK9 Position */ -#define GPIO_DATMSK_DATMSK9_Msk (0x1ul << GPIO_DATMSK_DATMSK9_Pos) /*!< GPIO_T::DATMSK: DATMSK9 Mask */ - -#define GPIO_DATMSK_DATMSK10_Pos (10) /*!< GPIO_T::DATMSK: DATMSK10 Position */ -#define GPIO_DATMSK_DATMSK10_Msk (0x1ul << GPIO_DATMSK_DATMSK10_Pos) /*!< GPIO_T::DATMSK: DATMSK10 Mask */ - -#define GPIO_DATMSK_DATMSK11_Pos (11) /*!< GPIO_T::DATMSK: DATMSK11 Position */ -#define GPIO_DATMSK_DATMSK11_Msk (0x1ul << GPIO_DATMSK_DATMSK11_Pos) /*!< GPIO_T::DATMSK: DATMSK11 Mask */ - -#define GPIO_DATMSK_DATMSK12_Pos (12) /*!< GPIO_T::DATMSK: DATMSK12 Position */ -#define GPIO_DATMSK_DATMSK12_Msk (0x1ul << GPIO_DATMSK_DATMSK12_Pos) /*!< GPIO_T::DATMSK: DATMSK12 Mask */ - -#define GPIO_DATMSK_DATMSK13_Pos (13) /*!< GPIO_T::DATMSK: DATMSK13 Position */ -#define GPIO_DATMSK_DATMSK13_Msk (0x1ul << GPIO_DATMSK_DATMSK13_Pos) /*!< GPIO_T::DATMSK: DATMSK13 Mask */ - -#define GPIO_DATMSK_DATMSK14_Pos (14) /*!< GPIO_T::DATMSK: DATMSK14 Position */ -#define GPIO_DATMSK_DATMSK14_Msk (0x1ul << GPIO_DATMSK_DATMSK14_Pos) /*!< GPIO_T::DATMSK: DATMSK14 Mask */ - -#define GPIO_DATMSK_DATMSK15_Pos (15) /*!< GPIO_T::DATMSK: DATMSK15 Position */ -#define GPIO_DATMSK_DATMSK15_Msk (0x1ul << GPIO_DATMSK_DATMSK15_Pos) /*!< GPIO_T::DATMSK: DATMSK15 Mask */ - -#define GPIO_PIN_PIN0_Pos (0) /*!< GPIO_T::PIN: PIN0 Position */ -#define GPIO_PIN_PIN0_Msk (0x1ul << GPIO_PIN_PIN0_Pos) /*!< GPIO_T::PIN: PIN0 Mask */ - -#define GPIO_PIN_PIN1_Pos (1) /*!< GPIO_T::PIN: PIN1 Position */ -#define GPIO_PIN_PIN1_Msk (0x1ul << GPIO_PIN_PIN1_Pos) /*!< GPIO_T::PIN: PIN1 Mask */ - -#define GPIO_PIN_PIN2_Pos (2) /*!< GPIO_T::PIN: PIN2 Position */ -#define GPIO_PIN_PIN2_Msk (0x1ul << GPIO_PIN_PIN2_Pos) /*!< GPIO_T::PIN: PIN2 Mask */ - -#define GPIO_PIN_PIN3_Pos (3) /*!< GPIO_T::PIN: PIN3 Position */ -#define GPIO_PIN_PIN3_Msk (0x1ul << GPIO_PIN_PIN3_Pos) /*!< GPIO_T::PIN: PIN3 Mask */ - -#define GPIO_PIN_PIN4_Pos (4) /*!< GPIO_T::PIN: PIN4 Position */ -#define GPIO_PIN_PIN4_Msk (0x1ul << GPIO_PIN_PIN4_Pos) /*!< GPIO_T::PIN: PIN4 Mask */ - -#define GPIO_PIN_PIN5_Pos (5) /*!< GPIO_T::PIN: PIN5 Position */ -#define GPIO_PIN_PIN5_Msk (0x1ul << GPIO_PIN_PIN5_Pos) /*!< GPIO_T::PIN: PIN5 Mask */ - -#define GPIO_PIN_PIN6_Pos (6) /*!< GPIO_T::PIN: PIN6 Position */ -#define GPIO_PIN_PIN6_Msk (0x1ul << GPIO_PIN_PIN6_Pos) /*!< GPIO_T::PIN: PIN6 Mask */ - -#define GPIO_PIN_PIN7_Pos (7) /*!< GPIO_T::PIN: PIN7 Position */ -#define GPIO_PIN_PIN7_Msk (0x1ul << GPIO_PIN_PIN7_Pos) /*!< GPIO_T::PIN: PIN7 Mask */ - -#define GPIO_PIN_PIN8_Pos (8) /*!< GPIO_T::PIN: PIN8 Position */ -#define GPIO_PIN_PIN8_Msk (0x1ul << GPIO_PIN_PIN8_Pos) /*!< GPIO_T::PIN: PIN8 Mask */ - -#define GPIO_PIN_PIN9_Pos (9) /*!< GPIO_T::PIN: PIN9 Position */ -#define GPIO_PIN_PIN9_Msk (0x1ul << GPIO_PIN_PIN9_Pos) /*!< GPIO_T::PIN: PIN9 Mask */ - -#define GPIO_PIN_PIN10_Pos (10) /*!< GPIO_T::PIN: PIN10 Position */ -#define GPIO_PIN_PIN10_Msk (0x1ul << GPIO_PIN_PIN10_Pos) /*!< GPIO_T::PIN: PIN10 Mask */ - -#define GPIO_PIN_PIN11_Pos (11) /*!< GPIO_T::PIN: PIN11 Position */ -#define GPIO_PIN_PIN11_Msk (0x1ul << GPIO_PIN_PIN11_Pos) /*!< GPIO_T::PIN: PIN11 Mask */ - -#define GPIO_PIN_PIN12_Pos (12) /*!< GPIO_T::PIN: PIN12 Position */ -#define GPIO_PIN_PIN12_Msk (0x1ul << GPIO_PIN_PIN12_Pos) /*!< GPIO_T::PIN: PIN12 Mask */ - -#define GPIO_PIN_PIN13_Pos (13) /*!< GPIO_T::PIN: PIN13 Position */ -#define GPIO_PIN_PIN13_Msk (0x1ul << GPIO_PIN_PIN13_Pos) /*!< GPIO_T::PIN: PIN13 Mask */ - -#define GPIO_PIN_PIN14_Pos (14) /*!< GPIO_T::PIN: PIN14 Position */ -#define GPIO_PIN_PIN14_Msk (0x1ul << GPIO_PIN_PIN14_Pos) /*!< GPIO_T::PIN: PIN14 Mask */ - -#define GPIO_PIN_PIN15_Pos (15) /*!< GPIO_T::PIN: PIN15 Position */ -#define GPIO_PIN_PIN15_Msk (0x1ul << GPIO_PIN_PIN15_Pos) /*!< GPIO_T::PIN: PIN15 Mask */ - -#define GPIO_DBEN_DBEN0_Pos (0) /*!< GPIO_T::DBEN: DBEN0 Position */ -#define GPIO_DBEN_DBEN0_Msk (0x1ul << GPIO_DBEN_DBEN0_Pos) /*!< GPIO_T::DBEN: DBEN0 Mask */ - -#define GPIO_DBEN_DBEN1_Pos (1) /*!< GPIO_T::DBEN: DBEN1 Position */ -#define GPIO_DBEN_DBEN1_Msk (0x1ul << GPIO_DBEN_DBEN1_Pos) /*!< GPIO_T::DBEN: DBEN1 Mask */ - -#define GPIO_DBEN_DBEN2_Pos (2) /*!< GPIO_T::DBEN: DBEN2 Position */ -#define GPIO_DBEN_DBEN2_Msk (0x1ul << GPIO_DBEN_DBEN2_Pos) /*!< GPIO_T::DBEN: DBEN2 Mask */ - -#define GPIO_DBEN_DBEN3_Pos (3) /*!< GPIO_T::DBEN: DBEN3 Position */ -#define GPIO_DBEN_DBEN3_Msk (0x1ul << GPIO_DBEN_DBEN3_Pos) /*!< GPIO_T::DBEN: DBEN3 Mask */ - -#define GPIO_DBEN_DBEN4_Pos (4) /*!< GPIO_T::DBEN: DBEN4 Position */ -#define GPIO_DBEN_DBEN4_Msk (0x1ul << GPIO_DBEN_DBEN4_Pos) /*!< GPIO_T::DBEN: DBEN4 Mask */ - -#define GPIO_DBEN_DBEN5_Pos (5) /*!< GPIO_T::DBEN: DBEN5 Position */ -#define GPIO_DBEN_DBEN5_Msk (0x1ul << GPIO_DBEN_DBEN5_Pos) /*!< GPIO_T::DBEN: DBEN5 Mask */ - -#define GPIO_DBEN_DBEN6_Pos (6) /*!< GPIO_T::DBEN: DBEN6 Position */ -#define GPIO_DBEN_DBEN6_Msk (0x1ul << GPIO_DBEN_DBEN6_Pos) /*!< GPIO_T::DBEN: DBEN6 Mask */ - -#define GPIO_DBEN_DBEN7_Pos (7) /*!< GPIO_T::DBEN: DBEN7 Position */ -#define GPIO_DBEN_DBEN7_Msk (0x1ul << GPIO_DBEN_DBEN7_Pos) /*!< GPIO_T::DBEN: DBEN7 Mask */ - -#define GPIO_DBEN_DBEN8_Pos (8) /*!< GPIO_T::DBEN: DBEN8 Position */ -#define GPIO_DBEN_DBEN8_Msk (0x1ul << GPIO_DBEN_DBEN8_Pos) /*!< GPIO_T::DBEN: DBEN8 Mask */ - -#define GPIO_DBEN_DBEN9_Pos (9) /*!< GPIO_T::DBEN: DBEN9 Position */ -#define GPIO_DBEN_DBEN9_Msk (0x1ul << GPIO_DBEN_DBEN9_Pos) /*!< GPIO_T::DBEN: DBEN9 Mask */ - -#define GPIO_DBEN_DBEN10_Pos (10) /*!< GPIO_T::DBEN: DBEN10 Position */ -#define GPIO_DBEN_DBEN10_Msk (0x1ul << GPIO_DBEN_DBEN10_Pos) /*!< GPIO_T::DBEN: DBEN10 Mask */ - -#define GPIO_DBEN_DBEN11_Pos (11) /*!< GPIO_T::DBEN: DBEN11 Position */ -#define GPIO_DBEN_DBEN11_Msk (0x1ul << GPIO_DBEN_DBEN11_Pos) /*!< GPIO_T::DBEN: DBEN11 Mask */ - -#define GPIO_DBEN_DBEN12_Pos (12) /*!< GPIO_T::DBEN: DBEN12 Position */ -#define GPIO_DBEN_DBEN12_Msk (0x1ul << GPIO_DBEN_DBEN12_Pos) /*!< GPIO_T::DBEN: DBEN12 Mask */ - -#define GPIO_DBEN_DBEN13_Pos (13) /*!< GPIO_T::DBEN: DBEN13 Position */ -#define GPIO_DBEN_DBEN13_Msk (0x1ul << GPIO_DBEN_DBEN13_Pos) /*!< GPIO_T::DBEN: DBEN13 Mask */ - -#define GPIO_DBEN_DBEN14_Pos (14) /*!< GPIO_T::DBEN: DBEN14 Position */ -#define GPIO_DBEN_DBEN14_Msk (0x1ul << GPIO_DBEN_DBEN14_Pos) /*!< GPIO_T::DBEN: DBEN14 Mask */ - -#define GPIO_DBEN_DBEN15_Pos (15) /*!< GPIO_T::DBEN: DBEN15 Position */ -#define GPIO_DBEN_DBEN15_Msk (0x1ul << GPIO_DBEN_DBEN15_Pos) /*!< GPIO_T::DBEN: DBEN15 Mask */ - -#define GPIO_INTTYPE_TYPE0_Pos (0) /*!< GPIO_T::INTTYPE: TYPE0 Position */ -#define GPIO_INTTYPE_TYPE0_Msk (0x1ul << GPIO_INTTYPE_TYPE0_Pos) /*!< GPIO_T::INTTYPE: TYPE0 Mask */ - -#define GPIO_INTTYPE_TYPE1_Pos (1) /*!< GPIO_T::INTTYPE: TYPE1 Position */ -#define GPIO_INTTYPE_TYPE1_Msk (0x1ul << GPIO_INTTYPE_TYPE1_Pos) /*!< GPIO_T::INTTYPE: TYPE1 Mask */ - -#define GPIO_INTTYPE_TYPE2_Pos (2) /*!< GPIO_T::INTTYPE: TYPE2 Position */ -#define GPIO_INTTYPE_TYPE2_Msk (0x1ul << GPIO_INTTYPE_TYPE2_Pos) /*!< GPIO_T::INTTYPE: TYPE2 Mask */ - -#define GPIO_INTTYPE_TYPE3_Pos (3) /*!< GPIO_T::INTTYPE: TYPE3 Position */ -#define GPIO_INTTYPE_TYPE3_Msk (0x1ul << GPIO_INTTYPE_TYPE3_Pos) /*!< GPIO_T::INTTYPE: TYPE3 Mask */ - -#define GPIO_INTTYPE_TYPE4_Pos (4) /*!< GPIO_T::INTTYPE: TYPE4 Position */ -#define GPIO_INTTYPE_TYPE4_Msk (0x1ul << GPIO_INTTYPE_TYPE4_Pos) /*!< GPIO_T::INTTYPE: TYPE4 Mask */ - -#define GPIO_INTTYPE_TYPE5_Pos (5) /*!< GPIO_T::INTTYPE: TYPE5 Position */ -#define GPIO_INTTYPE_TYPE5_Msk (0x1ul << GPIO_INTTYPE_TYPE5_Pos) /*!< GPIO_T::INTTYPE: TYPE5 Mask */ - -#define GPIO_INTTYPE_TYPE6_Pos (6) /*!< GPIO_T::INTTYPE: TYPE6 Position */ -#define GPIO_INTTYPE_TYPE6_Msk (0x1ul << GPIO_INTTYPE_TYPE6_Pos) /*!< GPIO_T::INTTYPE: TYPE6 Mask */ - -#define GPIO_INTTYPE_TYPE7_Pos (7) /*!< GPIO_T::INTTYPE: TYPE7 Position */ -#define GPIO_INTTYPE_TYPE7_Msk (0x1ul << GPIO_INTTYPE_TYPE7_Pos) /*!< GPIO_T::INTTYPE: TYPE7 Mask */ - -#define GPIO_INTTYPE_TYPE8_Pos (8) /*!< GPIO_T::INTTYPE: TYPE8 Position */ -#define GPIO_INTTYPE_TYPE8_Msk (0x1ul << GPIO_INTTYPE_TYPE8_Pos) /*!< GPIO_T::INTTYPE: TYPE8 Mask */ - -#define GPIO_INTTYPE_TYPE9_Pos (9) /*!< GPIO_T::INTTYPE: TYPE9 Position */ -#define GPIO_INTTYPE_TYPE9_Msk (0x1ul << GPIO_INTTYPE_TYPE9_Pos) /*!< GPIO_T::INTTYPE: TYPE9 Mask */ - -#define GPIO_INTTYPE_TYPE10_Pos (10) /*!< GPIO_T::INTTYPE: TYPE10 Position */ -#define GPIO_INTTYPE_TYPE10_Msk (0x1ul << GPIO_INTTYPE_TYPE10_Pos) /*!< GPIO_T::INTTYPE: TYPE10 Mask */ - -#define GPIO_INTTYPE_TYPE11_Pos (11) /*!< GPIO_T::INTTYPE: TYPE11 Position */ -#define GPIO_INTTYPE_TYPE11_Msk (0x1ul << GPIO_INTTYPE_TYPE11_Pos) /*!< GPIO_T::INTTYPE: TYPE11 Mask */ - -#define GPIO_INTTYPE_TYPE12_Pos (12) /*!< GPIO_T::INTTYPE: TYPE12 Position */ -#define GPIO_INTTYPE_TYPE12_Msk (0x1ul << GPIO_INTTYPE_TYPE12_Pos) /*!< GPIO_T::INTTYPE: TYPE12 Mask */ - -#define GPIO_INTTYPE_TYPE13_Pos (13) /*!< GPIO_T::INTTYPE: TYPE13 Position */ -#define GPIO_INTTYPE_TYPE13_Msk (0x1ul << GPIO_INTTYPE_TYPE13_Pos) /*!< GPIO_T::INTTYPE: TYPE13 Mask */ - -#define GPIO_INTTYPE_TYPE14_Pos (14) /*!< GPIO_T::INTTYPE: TYPE14 Position */ -#define GPIO_INTTYPE_TYPE14_Msk (0x1ul << GPIO_INTTYPE_TYPE14_Pos) /*!< GPIO_T::INTTYPE: TYPE14 Mask */ - -#define GPIO_INTTYPE_TYPE15_Pos (15) /*!< GPIO_T::INTTYPE: TYPE15 Position */ -#define GPIO_INTTYPE_TYPE15_Msk (0x1ul << GPIO_INTTYPE_TYPE15_Pos) /*!< GPIO_T::INTTYPE: TYPE15 Mask */ - -#define GPIO_INTEN_FLIEN0_Pos (0) /*!< GPIO_T::INTEN: FLIEN0 Position */ -#define GPIO_INTEN_FLIEN0_Msk (0x1ul << GPIO_INTEN_FLIEN0_Pos) /*!< GPIO_T::INTEN: FLIEN0 Mask */ - -#define GPIO_INTEN_FLIEN1_Pos (1) /*!< GPIO_T::INTEN: FLIEN1 Position */ -#define GPIO_INTEN_FLIEN1_Msk (0x1ul << GPIO_INTEN_FLIEN1_Pos) /*!< GPIO_T::INTEN: FLIEN1 Mask */ - -#define GPIO_INTEN_FLIEN2_Pos (2) /*!< GPIO_T::INTEN: FLIEN2 Position */ -#define GPIO_INTEN_FLIEN2_Msk (0x1ul << GPIO_INTEN_FLIEN2_Pos) /*!< GPIO_T::INTEN: FLIEN2 Mask */ - -#define GPIO_INTEN_FLIEN3_Pos (3) /*!< GPIO_T::INTEN: FLIEN3 Position */ -#define GPIO_INTEN_FLIEN3_Msk (0x1ul << GPIO_INTEN_FLIEN3_Pos) /*!< GPIO_T::INTEN: FLIEN3 Mask */ - -#define GPIO_INTEN_FLIEN4_Pos (4) /*!< GPIO_T::INTEN: FLIEN4 Position */ -#define GPIO_INTEN_FLIEN4_Msk (0x1ul << GPIO_INTEN_FLIEN4_Pos) /*!< GPIO_T::INTEN: FLIEN4 Mask */ - -#define GPIO_INTEN_FLIEN5_Pos (5) /*!< GPIO_T::INTEN: FLIEN5 Position */ -#define GPIO_INTEN_FLIEN5_Msk (0x1ul << GPIO_INTEN_FLIEN5_Pos) /*!< GPIO_T::INTEN: FLIEN5 Mask */ - -#define GPIO_INTEN_FLIEN6_Pos (6) /*!< GPIO_T::INTEN: FLIEN6 Position */ -#define GPIO_INTEN_FLIEN6_Msk (0x1ul << GPIO_INTEN_FLIEN6_Pos) /*!< GPIO_T::INTEN: FLIEN6 Mask */ - -#define GPIO_INTEN_FLIEN7_Pos (7) /*!< GPIO_T::INTEN: FLIEN7 Position */ -#define GPIO_INTEN_FLIEN7_Msk (0x1ul << GPIO_INTEN_FLIEN7_Pos) /*!< GPIO_T::INTEN: FLIEN7 Mask */ - -#define GPIO_INTEN_FLIEN8_Pos (8) /*!< GPIO_T::INTEN: FLIEN8 Position */ -#define GPIO_INTEN_FLIEN8_Msk (0x1ul << GPIO_INTEN_FLIEN8_Pos) /*!< GPIO_T::INTEN: FLIEN8 Mask */ - -#define GPIO_INTEN_FLIEN9_Pos (9) /*!< GPIO_T::INTEN: FLIEN9 Position */ -#define GPIO_INTEN_FLIEN9_Msk (0x1ul << GPIO_INTEN_FLIEN9_Pos) /*!< GPIO_T::INTEN: FLIEN9 Mask */ - -#define GPIO_INTEN_FLIEN10_Pos (10) /*!< GPIO_T::INTEN: FLIEN10 Position */ -#define GPIO_INTEN_FLIEN10_Msk (0x1ul << GPIO_INTEN_FLIEN10_Pos) /*!< GPIO_T::INTEN: FLIEN10 Mask */ - -#define GPIO_INTEN_FLIEN11_Pos (11) /*!< GPIO_T::INTEN: FLIEN11 Position */ -#define GPIO_INTEN_FLIEN11_Msk (0x1ul << GPIO_INTEN_FLIEN11_Pos) /*!< GPIO_T::INTEN: FLIEN11 Mask */ - -#define GPIO_INTEN_FLIEN12_Pos (12) /*!< GPIO_T::INTEN: FLIEN12 Position */ -#define GPIO_INTEN_FLIEN12_Msk (0x1ul << GPIO_INTEN_FLIEN12_Pos) /*!< GPIO_T::INTEN: FLIEN12 Mask */ - -#define GPIO_INTEN_FLIEN13_Pos (13) /*!< GPIO_T::INTEN: FLIEN13 Position */ -#define GPIO_INTEN_FLIEN13_Msk (0x1ul << GPIO_INTEN_FLIEN13_Pos) /*!< GPIO_T::INTEN: FLIEN13 Mask */ - -#define GPIO_INTEN_FLIEN14_Pos (14) /*!< GPIO_T::INTEN: FLIEN14 Position */ -#define GPIO_INTEN_FLIEN14_Msk (0x1ul << GPIO_INTEN_FLIEN14_Pos) /*!< GPIO_T::INTEN: FLIEN14 Mask */ - -#define GPIO_INTEN_FLIEN15_Pos (15) /*!< GPIO_T::INTEN: FLIEN15 Position */ -#define GPIO_INTEN_FLIEN15_Msk (0x1ul << GPIO_INTEN_FLIEN15_Pos) /*!< GPIO_T::INTEN: FLIEN15 Mask */ - -#define GPIO_INTEN_RHIEN0_Pos (16) /*!< GPIO_T::INTEN: RHIEN0 Position */ -#define GPIO_INTEN_RHIEN0_Msk (0x1ul << GPIO_INTEN_RHIEN0_Pos) /*!< GPIO_T::INTEN: RHIEN0 Mask */ - -#define GPIO_INTEN_RHIEN1_Pos (17) /*!< GPIO_T::INTEN: RHIEN1 Position */ -#define GPIO_INTEN_RHIEN1_Msk (0x1ul << GPIO_INTEN_RHIEN1_Pos) /*!< GPIO_T::INTEN: RHIEN1 Mask */ - -#define GPIO_INTEN_RHIEN2_Pos (18) /*!< GPIO_T::INTEN: RHIEN2 Position */ -#define GPIO_INTEN_RHIEN2_Msk (0x1ul << GPIO_INTEN_RHIEN2_Pos) /*!< GPIO_T::INTEN: RHIEN2 Mask */ - -#define GPIO_INTEN_RHIEN3_Pos (19) /*!< GPIO_T::INTEN: RHIEN3 Position */ -#define GPIO_INTEN_RHIEN3_Msk (0x1ul << GPIO_INTEN_RHIEN3_Pos) /*!< GPIO_T::INTEN: RHIEN3 Mask */ - -#define GPIO_INTEN_RHIEN4_Pos (20) /*!< GPIO_T::INTEN: RHIEN4 Position */ -#define GPIO_INTEN_RHIEN4_Msk (0x1ul << GPIO_INTEN_RHIEN4_Pos) /*!< GPIO_T::INTEN: RHIEN4 Mask */ - -#define GPIO_INTEN_RHIEN5_Pos (21) /*!< GPIO_T::INTEN: RHIEN5 Position */ -#define GPIO_INTEN_RHIEN5_Msk (0x1ul << GPIO_INTEN_RHIEN5_Pos) /*!< GPIO_T::INTEN: RHIEN5 Mask */ - -#define GPIO_INTEN_RHIEN6_Pos (22) /*!< GPIO_T::INTEN: RHIEN6 Position */ -#define GPIO_INTEN_RHIEN6_Msk (0x1ul << GPIO_INTEN_RHIEN6_Pos) /*!< GPIO_T::INTEN: RHIEN6 Mask */ - -#define GPIO_INTEN_RHIEN7_Pos (23) /*!< GPIO_T::INTEN: RHIEN7 Position */ -#define GPIO_INTEN_RHIEN7_Msk (0x1ul << GPIO_INTEN_RHIEN7_Pos) /*!< GPIO_T::INTEN: RHIEN7 Mask */ - -#define GPIO_INTEN_RHIEN8_Pos (24) /*!< GPIO_T::INTEN: RHIEN8 Position */ -#define GPIO_INTEN_RHIEN8_Msk (0x1ul << GPIO_INTEN_RHIEN8_Pos) /*!< GPIO_T::INTEN: RHIEN8 Mask */ - -#define GPIO_INTEN_RHIEN9_Pos (25) /*!< GPIO_T::INTEN: RHIEN9 Position */ -#define GPIO_INTEN_RHIEN9_Msk (0x1ul << GPIO_INTEN_RHIEN9_Pos) /*!< GPIO_T::INTEN: RHIEN9 Mask */ - -#define GPIO_INTEN_RHIEN10_Pos (26) /*!< GPIO_T::INTEN: RHIEN10 Position */ -#define GPIO_INTEN_RHIEN10_Msk (0x1ul << GPIO_INTEN_RHIEN10_Pos) /*!< GPIO_T::INTEN: RHIEN10 Mask */ - -#define GPIO_INTEN_RHIEN11_Pos (27) /*!< GPIO_T::INTEN: RHIEN11 Position */ -#define GPIO_INTEN_RHIEN11_Msk (0x1ul << GPIO_INTEN_RHIEN11_Pos) /*!< GPIO_T::INTEN: RHIEN11 Mask */ - -#define GPIO_INTEN_RHIEN12_Pos (28) /*!< GPIO_T::INTEN: RHIEN12 Position */ -#define GPIO_INTEN_RHIEN12_Msk (0x1ul << GPIO_INTEN_RHIEN12_Pos) /*!< GPIO_T::INTEN: RHIEN12 Mask */ - -#define GPIO_INTEN_RHIEN13_Pos (29) /*!< GPIO_T::INTEN: RHIEN13 Position */ -#define GPIO_INTEN_RHIEN13_Msk (0x1ul << GPIO_INTEN_RHIEN13_Pos) /*!< GPIO_T::INTEN: RHIEN13 Mask */ - -#define GPIO_INTEN_RHIEN14_Pos (30) /*!< GPIO_T::INTEN: RHIEN14 Position */ -#define GPIO_INTEN_RHIEN14_Msk (0x1ul << GPIO_INTEN_RHIEN14_Pos) /*!< GPIO_T::INTEN: RHIEN14 Mask */ - -#define GPIO_INTEN_RHIEN15_Pos (31) /*!< GPIO_T::INTEN: RHIEN15 Position */ -#define GPIO_INTEN_RHIEN15_Msk (0x1ul << GPIO_INTEN_RHIEN15_Pos) /*!< GPIO_T::INTEN: RHIEN15 Mask */ - -#define GPIO_INTSRC_INTSRC0_Pos (0) /*!< GPIO_T::INTSRC: INTSRC0 Position */ -#define GPIO_INTSRC_INTSRC0_Msk (0x1ul << GPIO_INTSRC_INTSRC0_Pos) /*!< GPIO_T::INTSRC: INTSRC0 Mask */ - -#define GPIO_INTSRC_INTSRC1_Pos (1) /*!< GPIO_T::INTSRC: INTSRC1 Position */ -#define GPIO_INTSRC_INTSRC1_Msk (0x1ul << GPIO_INTSRC_INTSRC1_Pos) /*!< GPIO_T::INTSRC: INTSRC1 Mask */ - -#define GPIO_INTSRC_INTSRC2_Pos (2) /*!< GPIO_T::INTSRC: INTSRC2 Position */ -#define GPIO_INTSRC_INTSRC2_Msk (0x1ul << GPIO_INTSRC_INTSRC2_Pos) /*!< GPIO_T::INTSRC: INTSRC2 Mask */ - -#define GPIO_INTSRC_INTSRC3_Pos (3) /*!< GPIO_T::INTSRC: INTSRC3 Position */ -#define GPIO_INTSRC_INTSRC3_Msk (0x1ul << GPIO_INTSRC_INTSRC3_Pos) /*!< GPIO_T::INTSRC: INTSRC3 Mask */ - -#define GPIO_INTSRC_INTSRC4_Pos (4) /*!< GPIO_T::INTSRC: INTSRC4 Position */ -#define GPIO_INTSRC_INTSRC4_Msk (0x1ul << GPIO_INTSRC_INTSRC4_Pos) /*!< GPIO_T::INTSRC: INTSRC4 Mask */ - -#define GPIO_INTSRC_INTSRC5_Pos (5) /*!< GPIO_T::INTSRC: INTSRC5 Position */ -#define GPIO_INTSRC_INTSRC5_Msk (0x1ul << GPIO_INTSRC_INTSRC5_Pos) /*!< GPIO_T::INTSRC: INTSRC5 Mask */ - -#define GPIO_INTSRC_INTSRC6_Pos (6) /*!< GPIO_T::INTSRC: INTSRC6 Position */ -#define GPIO_INTSRC_INTSRC6_Msk (0x1ul << GPIO_INTSRC_INTSRC6_Pos) /*!< GPIO_T::INTSRC: INTSRC6 Mask */ - -#define GPIO_INTSRC_INTSRC7_Pos (7) /*!< GPIO_T::INTSRC: INTSRC7 Position */ -#define GPIO_INTSRC_INTSRC7_Msk (0x1ul << GPIO_INTSRC_INTSRC7_Pos) /*!< GPIO_T::INTSRC: INTSRC7 Mask */ - -#define GPIO_INTSRC_INTSRC8_Pos (8) /*!< GPIO_T::INTSRC: INTSRC8 Position */ -#define GPIO_INTSRC_INTSRC8_Msk (0x1ul << GPIO_INTSRC_INTSRC8_Pos) /*!< GPIO_T::INTSRC: INTSRC8 Mask */ - -#define GPIO_INTSRC_INTSRC9_Pos (9) /*!< GPIO_T::INTSRC: INTSRC9 Position */ -#define GPIO_INTSRC_INTSRC9_Msk (0x1ul << GPIO_INTSRC_INTSRC9_Pos) /*!< GPIO_T::INTSRC: INTSRC9 Mask */ - -#define GPIO_INTSRC_INTSRC10_Pos (10) /*!< GPIO_T::INTSRC: INTSRC10 Position */ -#define GPIO_INTSRC_INTSRC10_Msk (0x1ul << GPIO_INTSRC_INTSRC10_Pos) /*!< GPIO_T::INTSRC: INTSRC10 Mask */ - -#define GPIO_INTSRC_INTSRC11_Pos (11) /*!< GPIO_T::INTSRC: INTSRC11 Position */ -#define GPIO_INTSRC_INTSRC11_Msk (0x1ul << GPIO_INTSRC_INTSRC11_Pos) /*!< GPIO_T::INTSRC: INTSRC11 Mask */ - -#define GPIO_INTSRC_INTSRC12_Pos (12) /*!< GPIO_T::INTSRC: INTSRC12 Position */ -#define GPIO_INTSRC_INTSRC12_Msk (0x1ul << GPIO_INTSRC_INTSRC12_Pos) /*!< GPIO_T::INTSRC: INTSRC12 Mask */ - -#define GPIO_INTSRC_INTSRC13_Pos (13) /*!< GPIO_T::INTSRC: INTSRC13 Position */ -#define GPIO_INTSRC_INTSRC13_Msk (0x1ul << GPIO_INTSRC_INTSRC13_Pos) /*!< GPIO_T::INTSRC: INTSRC13 Mask */ - -#define GPIO_INTSRC_INTSRC14_Pos (14) /*!< GPIO_T::INTSRC: INTSRC14 Position */ -#define GPIO_INTSRC_INTSRC14_Msk (0x1ul << GPIO_INTSRC_INTSRC14_Pos) /*!< GPIO_T::INTSRC: INTSRC14 Mask */ - -#define GPIO_INTSRC_INTSRC15_Pos (15) /*!< GPIO_T::INTSRC: INTSRC15 Position */ -#define GPIO_INTSRC_INTSRC15_Msk (0x1ul << GPIO_INTSRC_INTSRC15_Pos) /*!< GPIO_T::INTSRC: INTSRC15 Mask */ - -#define GPIO_SMTEN_SMTEN0_Pos (0) /*!< GPIO_T::SMTEN: SMTEN0 Position */ -#define GPIO_SMTEN_SMTEN0_Msk (0x1ul << GPIO_SMTEN_SMTEN0_Pos) /*!< GPIO_T::SMTEN: SMTEN0 Mask */ - -#define GPIO_SMTEN_SMTEN1_Pos (1) /*!< GPIO_T::SMTEN: SMTEN1 Position */ -#define GPIO_SMTEN_SMTEN1_Msk (0x1ul << GPIO_SMTEN_SMTEN1_Pos) /*!< GPIO_T::SMTEN: SMTEN1 Mask */ - -#define GPIO_SMTEN_SMTEN2_Pos (2) /*!< GPIO_T::SMTEN: SMTEN2 Position */ -#define GPIO_SMTEN_SMTEN2_Msk (0x1ul << GPIO_SMTEN_SMTEN2_Pos) /*!< GPIO_T::SMTEN: SMTEN2 Mask */ - -#define GPIO_SMTEN_SMTEN3_Pos (3) /*!< GPIO_T::SMTEN: SMTEN3 Position */ -#define GPIO_SMTEN_SMTEN3_Msk (0x1ul << GPIO_SMTEN_SMTEN3_Pos) /*!< GPIO_T::SMTEN: SMTEN3 Mask */ - -#define GPIO_SMTEN_SMTEN4_Pos (4) /*!< GPIO_T::SMTEN: SMTEN4 Position */ -#define GPIO_SMTEN_SMTEN4_Msk (0x1ul << GPIO_SMTEN_SMTEN4_Pos) /*!< GPIO_T::SMTEN: SMTEN4 Mask */ - -#define GPIO_SMTEN_SMTEN5_Pos (5) /*!< GPIO_T::SMTEN: SMTEN5 Position */ -#define GPIO_SMTEN_SMTEN5_Msk (0x1ul << GPIO_SMTEN_SMTEN5_Pos) /*!< GPIO_T::SMTEN: SMTEN5 Mask */ - -#define GPIO_SMTEN_SMTEN6_Pos (6) /*!< GPIO_T::SMTEN: SMTEN6 Position */ -#define GPIO_SMTEN_SMTEN6_Msk (0x1ul << GPIO_SMTEN_SMTEN6_Pos) /*!< GPIO_T::SMTEN: SMTEN6 Mask */ - -#define GPIO_SMTEN_SMTEN7_Pos (7) /*!< GPIO_T::SMTEN: SMTEN7 Position */ -#define GPIO_SMTEN_SMTEN7_Msk (0x1ul << GPIO_SMTEN_SMTEN7_Pos) /*!< GPIO_T::SMTEN: SMTEN7 Mask */ - -#define GPIO_SMTEN_SMTEN8_Pos (8) /*!< GPIO_T::SMTEN: SMTEN8 Position */ -#define GPIO_SMTEN_SMTEN8_Msk (0x1ul << GPIO_SMTEN_SMTEN8_Pos) /*!< GPIO_T::SMTEN: SMTEN8 Mask */ - -#define GPIO_SMTEN_SMTEN9_Pos (9) /*!< GPIO_T::SMTEN: SMTEN9 Position */ -#define GPIO_SMTEN_SMTEN9_Msk (0x1ul << GPIO_SMTEN_SMTEN9_Pos) /*!< GPIO_T::SMTEN: SMTEN9 Mask */ - -#define GPIO_SMTEN_SMTEN10_Pos (10) /*!< GPIO_T::SMTEN: SMTEN10 Position */ -#define GPIO_SMTEN_SMTEN10_Msk (0x1ul << GPIO_SMTEN_SMTEN10_Pos) /*!< GPIO_T::SMTEN: SMTEN10 Mask */ - -#define GPIO_SMTEN_SMTEN11_Pos (11) /*!< GPIO_T::SMTEN: SMTEN11 Position */ -#define GPIO_SMTEN_SMTEN11_Msk (0x1ul << GPIO_SMTEN_SMTEN11_Pos) /*!< GPIO_T::SMTEN: SMTEN11 Mask */ - -#define GPIO_SMTEN_SMTEN12_Pos (12) /*!< GPIO_T::SMTEN: SMTEN12 Position */ -#define GPIO_SMTEN_SMTEN12_Msk (0x1ul << GPIO_SMTEN_SMTEN12_Pos) /*!< GPIO_T::SMTEN: SMTEN12 Mask */ - -#define GPIO_SMTEN_SMTEN13_Pos (13) /*!< GPIO_T::SMTEN: SMTEN13 Position */ -#define GPIO_SMTEN_SMTEN13_Msk (0x1ul << GPIO_SMTEN_SMTEN13_Pos) /*!< GPIO_T::SMTEN: SMTEN13 Mask */ - -#define GPIO_SMTEN_SMTEN14_Pos (14) /*!< GPIO_T::SMTEN: SMTEN14 Position */ -#define GPIO_SMTEN_SMTEN14_Msk (0x1ul << GPIO_SMTEN_SMTEN14_Pos) /*!< GPIO_T::SMTEN: SMTEN14 Mask */ - -#define GPIO_SMTEN_SMTEN15_Pos (15) /*!< GPIO_T::SMTEN: SMTEN15 Position */ -#define GPIO_SMTEN_SMTEN15_Msk (0x1ul << GPIO_SMTEN_SMTEN15_Pos) /*!< GPIO_T::SMTEN: SMTEN15 Mask */ - -#define GPIO_SLEWCTL_HSREN0_Pos (0) /*!< GPIO_T::SLEWCTL: HSREN0 Position */ -#define GPIO_SLEWCTL_HSREN0_Msk (0x3ul << GPIO_SLEWCTL_HSREN0_Pos) /*!< GPIO_T::SLEWCTL: HSREN0 Mask */ - -#define GPIO_SLEWCTL_HSREN1_Pos (2) /*!< GPIO_T::SLEWCTL: HSREN1 Position */ -#define GPIO_SLEWCTL_HSREN1_Msk (0x3ul << GPIO_SLEWCTL_HSREN1_Pos) /*!< GPIO_T::SLEWCTL: HSREN1 Mask */ - -#define GPIO_SLEWCTL_HSREN2_Pos (4) /*!< GPIO_T::SLEWCTL: HSREN2 Position */ -#define GPIO_SLEWCTL_HSREN2_Msk (0x3ul << GPIO_SLEWCTL_HSREN2_Pos) /*!< GPIO_T::SLEWCTL: HSREN2 Mask */ - -#define GPIO_SLEWCTL_HSREN3_Pos (6) /*!< GPIO_T::SLEWCTL: HSREN3 Position */ -#define GPIO_SLEWCTL_HSREN3_Msk (0x3ul << GPIO_SLEWCTL_HSREN3_Pos) /*!< GPIO_T::SLEWCTL: HSREN3 Mask */ - -#define GPIO_SLEWCTL_HSREN4_Pos (8) /*!< GPIO_T::SLEWCTL: HSREN4 Position */ -#define GPIO_SLEWCTL_HSREN4_Msk (0x3ul << GPIO_SLEWCTL_HSREN4_Pos) /*!< GPIO_T::SLEWCTL: HSREN4 Mask */ - -#define GPIO_SLEWCTL_HSREN5_Pos (10) /*!< GPIO_T::SLEWCTL: HSREN5 Position */ -#define GPIO_SLEWCTL_HSREN5_Msk (0x3ul << GPIO_SLEWCTL_HSREN5_Pos) /*!< GPIO_T::SLEWCTL: HSREN5 Mask */ - -#define GPIO_SLEWCTL_HSREN6_Pos (12) /*!< GPIO_T::SLEWCTL: HSREN6 Position */ -#define GPIO_SLEWCTL_HSREN6_Msk (0x3ul << GPIO_SLEWCTL_HSREN6_Pos) /*!< GPIO_T::SLEWCTL: HSREN6 Mask */ - -#define GPIO_SLEWCTL_HSREN7_Pos (14) /*!< GPIO_T::SLEWCTL: HSREN7 Position */ -#define GPIO_SLEWCTL_HSREN7_Msk (0x3ul << GPIO_SLEWCTL_HSREN7_Pos) /*!< GPIO_T::SLEWCTL: HSREN7 Mask */ - -#define GPIO_SLEWCTL_HSREN8_Pos (16) /*!< GPIO_T::SLEWCTL: HSREN8 Position */ -#define GPIO_SLEWCTL_HSREN8_Msk (0x3ul << GPIO_SLEWCTL_HSREN8_Pos) /*!< GPIO_T::SLEWCTL: HSREN8 Mask */ - -#define GPIO_SLEWCTL_HSREN9_Pos (18) /*!< GPIO_T::SLEWCTL: HSREN9 Position */ -#define GPIO_SLEWCTL_HSREN9_Msk (0x3ul << GPIO_SLEWCTL_HSREN9_Pos) /*!< GPIO_T::SLEWCTL: HSREN9 Mask */ - -#define GPIO_SLEWCTL_HSREN10_Pos (20) /*!< GPIO_T::SLEWCTL: HSREN10 Position */ -#define GPIO_SLEWCTL_HSREN10_Msk (0x3ul << GPIO_SLEWCTL_HSREN10_Pos) /*!< GPIO_T::SLEWCTL: HSREN10 Mask */ - -#define GPIO_SLEWCTL_HSREN11_Pos (22) /*!< GPIO_T::SLEWCTL: HSREN11 Position */ -#define GPIO_SLEWCTL_HSREN11_Msk (0x3ul << GPIO_SLEWCTL_HSREN11_Pos) /*!< GPIO_T::SLEWCTL: HSREN11 Mask */ - -#define GPIO_SLEWCTL_HSREN12_Pos (24) /*!< GPIO_T::SLEWCTL: HSREN12 Position */ -#define GPIO_SLEWCTL_HSREN12_Msk (0x3ul << GPIO_SLEWCTL_HSREN12_Pos) /*!< GPIO_T::SLEWCTL: HSREN12 Mask */ - -#define GPIO_SLEWCTL_HSREN13_Pos (26) /*!< GPIO_T::SLEWCTL: HSREN13 Position */ -#define GPIO_SLEWCTL_HSREN13_Msk (0x3ul << GPIO_SLEWCTL_HSREN13_Pos) /*!< GPIO_T::SLEWCTL: HSREN13 Mask */ - -#define GPIO_SLEWCTL_HSREN14_Pos (28) /*!< GPIO_T::SLEWCTL: HSREN14 Position */ -#define GPIO_SLEWCTL_HSREN14_Msk (0x3ul << GPIO_SLEWCTL_HSREN14_Pos) /*!< GPIO_T::SLEWCTL: HSREN14 Mask */ - -#define GPIO_SLEWCTL_HSREN15_Pos (30) /*!< GPIO_T::SLEWCTL: HSREN15 Position */ -#define GPIO_SLEWCTL_HSREN15_Msk (0x3ul << GPIO_SLEWCTL_HSREN15_Pos) /*!< GPIO_T::SLEWCTL: HSREN15 Mask */ - -#define GPIO_PUSEL_PUSEL0_Pos (0) /*!< GPIO_T::PUSEL: PUSEL0 Position */ -#define GPIO_PUSEL_PUSEL0_Msk (0x3ul << GPIO_PUSEL_PUSEL0_Pos) /*!< GPIO_T::PUSEL: PUSEL0 Mask */ - -#define GPIO_PUSEL_PUSEL1_Pos (2) /*!< GPIO_T::PUSEL: PUSEL1 Position */ -#define GPIO_PUSEL_PUSEL1_Msk (0x3ul << GPIO_PUSEL_PUSEL1_Pos) /*!< GPIO_T::PUSEL: PUSEL1 Mask */ - -#define GPIO_PUSEL_PUSEL2_Pos (4) /*!< GPIO_T::PUSEL: PUSEL2 Position */ -#define GPIO_PUSEL_PUSEL2_Msk (0x3ul << GPIO_PUSEL_PUSEL2_Pos) /*!< GPIO_T::PUSEL: PUSEL2 Mask */ - -#define GPIO_PUSEL_PUSEL3_Pos (6) /*!< GPIO_T::PUSEL: PUSEL3 Position */ -#define GPIO_PUSEL_PUSEL3_Msk (0x3ul << GPIO_PUSEL_PUSEL3_Pos) /*!< GPIO_T::PUSEL: PUSEL3 Mask */ - -#define GPIO_PUSEL_PUSEL4_Pos (8) /*!< GPIO_T::PUSEL: PUSEL4 Position */ -#define GPIO_PUSEL_PUSEL4_Msk (0x3ul << GPIO_PUSEL_PUSEL4_Pos) /*!< GPIO_T::PUSEL: PUSEL4 Mask */ - -#define GPIO_PUSEL_PUSEL5_Pos (10) /*!< GPIO_T::PUSEL: PUSEL5 Position */ -#define GPIO_PUSEL_PUSEL5_Msk (0x3ul << GPIO_PUSEL_PUSEL5_Pos) /*!< GPIO_T::PUSEL: PUSEL5 Mask */ - -#define GPIO_PUSEL_PUSEL6_Pos (12) /*!< GPIO_T::PUSEL: PUSEL6 Position */ -#define GPIO_PUSEL_PUSEL6_Msk (0x3ul << GPIO_PUSEL_PUSEL6_Pos) /*!< GPIO_T::PUSEL: PUSEL6 Mask */ - -#define GPIO_PUSEL_PUSEL7_Pos (14) /*!< GPIO_T::PUSEL: PUSEL7 Position */ -#define GPIO_PUSEL_PUSEL7_Msk (0x3ul << GPIO_PUSEL_PUSEL7_Pos) /*!< GPIO_T::PUSEL: PUSEL7 Mask */ - -#define GPIO_PUSEL_PUSEL8_Pos (16) /*!< GPIO_T::PUSEL: PUSEL8 Position */ -#define GPIO_PUSEL_PUSEL8_Msk (0x3ul << GPIO_PUSEL_PUSEL8_Pos) /*!< GPIO_T::PUSEL: PUSEL8 Mask */ - -#define GPIO_PUSEL_PUSEL9_Pos (18) /*!< GPIO_T::PUSEL: PUSEL9 Position */ -#define GPIO_PUSEL_PUSEL9_Msk (0x3ul << GPIO_PUSEL_PUSEL9_Pos) /*!< GPIO_T::PUSEL: PUSEL9 Mask */ - -#define GPIO_PUSEL_PUSEL10_Pos (20) /*!< GPIO_T::PUSEL: PUSEL10 Position */ -#define GPIO_PUSEL_PUSEL10_Msk (0x3ul << GPIO_PUSEL_PUSEL10_Pos) /*!< GPIO_T::PUSEL: PUSEL10 Mask */ - -#define GPIO_PUSEL_PUSEL11_Pos (22) /*!< GPIO_T::PUSEL: PUSEL11 Position */ -#define GPIO_PUSEL_PUSEL11_Msk (0x3ul << GPIO_PUSEL_PUSEL11_Pos) /*!< GPIO_T::PUSEL: PUSEL11 Mask */ - -#define GPIO_PUSEL_PUSEL12_Pos (24) /*!< GPIO_T::PUSEL: PUSEL12 Position */ -#define GPIO_PUSEL_PUSEL12_Msk (0x3ul << GPIO_PUSEL_PUSEL12_Pos) /*!< GPIO_T::PUSEL: PUSEL12 Mask */ - -#define GPIO_PUSEL_PUSEL13_Pos (26) /*!< GPIO_T::PUSEL: PUSEL13 Position */ -#define GPIO_PUSEL_PUSEL13_Msk (0x3ul << GPIO_PUSEL_PUSEL13_Pos) /*!< GPIO_T::PUSEL: PUSEL13 Mask */ - -#define GPIO_PUSEL_PUSEL14_Pos (28) /*!< GPIO_T::PUSEL: PUSEL14 Position */ -#define GPIO_PUSEL_PUSEL14_Msk (0x3ul << GPIO_PUSEL_PUSEL14_Pos) /*!< GPIO_T::PUSEL: PUSEL14 Mask */ - -#define GPIO_PUSEL_PUSEL15_Pos (30) /*!< GPIO_T::PUSEL: PUSEL15 Position */ -#define GPIO_PUSEL_PUSEL15_Msk (0x3ul << GPIO_PUSEL_PUSEL15_Pos) /*!< GPIO_T::PUSEL: PUSEL15 Mask */ - -#define GPIO_DBCTL_DBCLKSEL_Pos (0) /*!< GPIO_T::DBCTL: DBCLKSEL Position */ -#define GPIO_DBCTL_DBCLKSEL_Msk (0xful << GPIO_DBCTL_DBCLKSEL_Pos) /*!< GPIO_T::DBCTL: DBCLKSEL Mask */ - -#define GPIO_DBCTL_DBCLKSRC_Pos (4) /*!< GPIO_T::DBCTL: DBCLKSRC Position */ -#define GPIO_DBCTL_DBCLKSRC_Msk (0x1ul << GPIO_DBCTL_DBCLKSRC_Pos) /*!< GPIO_T::DBCTL: DBCLKSRC Mask */ - -#define GPIO_DBCTL_ICLKON_Pos (5) /*!< GPIO_T::DBCTL: ICLKON Position */ -#define GPIO_DBCTL_ICLKON_Msk (0x1ul << GPIO_DBCTL_ICLKON_Pos) /*!< GPIO_T::DBCTL: ICLKON Mask */ - - -#define GPIO_DS_DS10_DS00_Pos (0) /*!< GPIO_T::DS: DS10_DS00 Position */ -#define GPIO_DS_DS10_DS00_Msk (0x1ul << GPIO_DS_DS10_DS00_Pos) /*!< GPIO_T::DS: DS10_DS00 Mask */ - -#define GPIO_DS_DS11_DS01_Pos (1) /*!< GPIO_T::DS: DS11_DS01 Position */ -#define GPIO_DS_DS11_DS01_Msk (0x1ul << GPIO_DS_DS11_DS01_Pos) /*!< GPIO_T::DS: DS11_DS01 Mask */ - -#define GPIO_DS_DS12_DS02_Pos (2) /*!< GPIO_T::DS: DS12_DS02 Position */ -#define GPIO_DS_DS12_DS02_Msk (0x1ul << GPIO_DS_DS12_DS02_Pos) /*!< GPIO_T::DS: DS12_DS02 Mask */ - -#define GPIO_DS_DS13_DS03_Pos (3) /*!< GPIO_T::DS: DS13_DS03 Position */ -#define GPIO_DS_DS13_DS03_Msk (0x1ul << GPIO_DS_DS13_DS03_Pos) /*!< GPIO_T::DS: DS13_DS03 Mask */ - -#define GPIO_DS_DS14_DS04_Pos (4) /*!< GPIO_T::DS: DS14_DS04 Position */ -#define GPIO_DS_DS14_DS04_Msk (0x1ul << GPIO_DS_DS14_DS04_Pos) /*!< GPIO_T::DS: DS14_DS04 Mask */ - -#define GPIO_DS_DS15_DS05_Pos (5) /*!< GPIO_T::DS: DS15_DS05 Position */ -#define GPIO_DS_DS15_DS05_Msk (0x1ul << GPIO_DS_DS15_DS05_Pos) /*!< GPIO_T::DS: DS15_DS05 Mask */ - -#define GPIO_DS_DS16_DS06_Pos (6) /*!< GPIO_T::DS: DS16_DS06 Position */ -#define GPIO_DS_DS16_DS06_Msk (0x1ul << GPIO_DS_DS16_DS06_Pos) /*!< GPIO_T::DS: DS16_DS06 Mask */ - -#define GPIO_DS_DS17_DS07_Pos (7) /*!< GPIO_T::DS: DS17_DS07 Position */ -#define GPIO_DS_DS17_DS07_Msk (0x1ul << GPIO_DS_DS17_DS07_Pos) /*!< GPIO_T::DS: DS17_DS07 Mask */ - -#define GPIO_DS_DS18_DS08_Pos (8) /*!< GPIO_T::DS: DS18_DS08 Position */ -#define GPIO_DS_DS18_DS08_Msk (0x1ul << GPIO_DS_DS18_DS08_Pos) /*!< GPIO_T::DS: DS18_DS08 Mask */ - -#define GPIO_DS_DS19_DS09_Pos (9) /*!< GPIO_T::DS: DS19_DS09 Position */ -#define GPIO_DS_DS19_DS09_Msk (0x1ul << GPIO_DS_DS19_DS09_Pos) /*!< GPIO_T::DS: DS19_DS09 Mask */ - -#define GPIO_DS_DS110_DS010_Pos (10) /*!< GPIO_T::DS: DS110_DS010 Position */ -#define GPIO_DS_DS110_DS010_Msk (0x1ul << GPIO_DS_DS110_DS010_Pos) /*!< GPIO_T::DS: DS110_DS010 Mask */ - -#define GPIO_DS_DS111_DS011_Pos (11) /*!< GPIO_T::DS: DS111_DS011 Position */ -#define GPIO_DS_DS111_DS011_Msk (0x1ul << GPIO_DS_DS111_DS011_Pos) /*!< GPIO_T::DS: DS111_DS011 Mask */ - -#define GPIO_DS_DS112_DS012_Pos (12) /*!< GPIO_T::DS: DS112_DS012 Position */ -#define GPIO_DS_DS112_DS012_Msk (0x1ul << GPIO_DS_DS112_DS012_Pos) /*!< GPIO_T::DS: DS112_DS012 Mask */ - -#define GPIO_DS_DS113_DS013_Pos (13) /*!< GPIO_T::DS: DS113_DS013 Position */ -#define GPIO_DS_DS113_DS013_Msk (0x1ul << GPIO_DS_DS113_DS013_Pos) /*!< GPIO_T::DS: DS113_DS013 Mask */ - -#define GPIO_DS_DS114_DS014_Pos (14) /*!< GPIO_T::DS: DS114_DS014 Position */ -#define GPIO_DS_DS114_DS014_Msk (0x1ul << GPIO_DS_DS114_DS014_Pos) /*!< GPIO_T::DS: DS114_DS014 Mask */ - -#define GPIO_DS_DS115_DS015_Pos (15) /*!< GPIO_T::DS: DS115_DS015 Position */ -#define GPIO_DS_DS115_DS015_Msk (0x1ul << GPIO_DS_DS115_DS015_Pos) /*!< GPIO_T::DS: DS115_DS015 Mask */ - -#define GPIO_UDS_UDS0_Pos (0) /*!< GPIO_T::UDS: UDS0 Position */ -#define GPIO_UDS_UDS0_Msk (0x1ul << GPIO_UDS_UDS0_Pos) /*!< GPIO_T::UDS: UDS0 Mask */ - -#define GPIO_UDS_UDS1_Pos (1) /*!< GPIO_T::UDS: UDS1 Position */ -#define GPIO_UDS_UDS1_Msk (0x1ul << GPIO_UDS_UDS1_Pos) /*!< GPIO_T::UDS: UDS1 Mask */ - -#define GPIO_UDS_UDS2_Pos (2) /*!< GPIO_T::UDS: UDS2 Position */ -#define GPIO_UDS_UDS2_Msk (0x1ul << GPIO_UDS_UDS2_Pos) /*!< GPIO_T::UDS: UDS2 Mask */ - -#define GPIO_UDS_UDS3_Pos (3) /*!< GPIO_T::UDS: UDS3 Position */ -#define GPIO_UDS_UDS3_Msk (0x1ul << GPIO_UDS_UDS3_Pos) /*!< GPIO_T::UDS: UDS3 Mask */ - -#define GPIO_UDS_UDS4_Pos (4) /*!< GPIO_T::UDS: UDS4 Position */ -#define GPIO_UDS_UDS4_Msk (0x1ul << GPIO_UDS_UDS4_Pos) /*!< GPIO_T::UDS: UDS4 Mask */ - -#define GPIO_UDS_UDS5_Pos (5) /*!< GPIO_T::UDS: UDS5 Position */ -#define GPIO_UDS_UDS5_Msk (0x1ul << GPIO_UDS_UDS5_Pos) /*!< GPIO_T::UDS: UDS5 Mask */ - -#define GPIO_UDS_UDS6_Pos (6) /*!< GPIO_T::UDS: UDS6 Position */ -#define GPIO_UDS_UDS6_Msk (0x1ul << GPIO_UDS_UDS6_Pos) /*!< GPIO_T::UDS: UDS6 Mask */ - -#define GPIO_UDS_UDS7_Pos (7) /*!< GPIO_T::UDS: UDS7 Position */ -#define GPIO_UDS_UDS7_Msk (0x1ul << GPIO_UDS_UDS7_Pos) /*!< GPIO_T::UDS: UDS7 Mask */ - -#define GPIO_UDS_UDS8_Pos (8) /*!< GPIO_T::UDS: UDS8 Position */ -#define GPIO_UDS_UDS8_Msk (0x1ul << GPIO_UDS_UDS8_Pos) /*!< GPIO_T::UDS: UDS8 Mask */ - -#define GPIO_UDS_UDS9_Pos (9) /*!< GPIO_T::UDS: UDS9 Position */ -#define GPIO_UDS_UDS9_Msk (0x1ul << GPIO_UDS_UDS9_Pos) /*!< GPIO_T::UDS: UDS9 Mask */ - -#define GPIO_UDS_UDS10_Pos (10) /*!< GPIO_T::UDS: UDS10 Position */ -#define GPIO_UDS_UDS10_Msk (0x1ul << GPIO_UDS_UDS10_Pos) /*!< GPIO_T::UDS: UDS10 Mask */ - -#define GPIO_UDS_UDS11_Pos (11) /*!< GPIO_T::UDS: UDS11 Position */ -#define GPIO_UDS_UDS11_Msk (0x1ul << GPIO_UDS_UDS11_Pos) /*!< GPIO_T::UDS: UDS11 Mask */ - -#define GPIO_UDS_UDS12_Pos (12) /*!< GPIO_T::UDS: UDS12 Position */ -#define GPIO_UDS_UDS12_Msk (0x1ul << GPIO_UDS_UDS12_Pos) /*!< GPIO_T::UDS: UDS12 Mask */ - -#define GPIO_UDS_UDS13_Pos (13) /*!< GPIO_T::UDS: UDS13 Position */ -#define GPIO_UDS_UDS13_Msk (0x1ul << GPIO_UDS_UDS13_Pos) /*!< GPIO_T::UDS: UDS13 Mask */ - -#define GPIO_UDS_UDS14_Pos (14) /*!< GPIO_T::UDS: UDS14 Position */ -#define GPIO_UDS_UDS14_Msk (0x1ul << GPIO_UDS_UDS14_Pos) /*!< GPIO_T::UDS: UDS14 Mask */ - -#define GPIO_UDS_UDS15_Pos (15) /*!< GPIO_T::UDS: UDS15 Position */ -#define GPIO_UDS_UDS15_Msk (0x1ul << GPIO_UDS_UDS15_Pos) /*!< GPIO_T::UDS: UDS15 Mask */ -/**@}*/ /* GPIO_CONST */ -/**@}*/ /* end of GPIO register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __GPIO_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/hsusbd_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/hsusbd_reg.h deleted file mode 100644 index ae1d67027ac..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/hsusbd_reg.h +++ /dev/null @@ -1,3108 +0,0 @@ -/**************************************************************************//** - * @file hsusbd_reg.h - * @brief HSUSBD register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __HSUSBD_REG_H__ -#define __HSUSBD_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- High Speed USB 2.0 Device Controller -------------------------*/ -/** - @addtogroup HSUSBD High Speed USB 2.0 Device Controller(HSUSBD) - Memory Mapped Structure for HSUSBD Controller -@{ */ - -/*----- IN Endpoint 1~8 -----*/ -typedef struct -{ - - /** - * @var HSUSBD_T::DIEPCTLn - * Offset: 0x00 Device Control IN Endpoint n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |MPS |Maximum Packet Size (MPS) - * | | |The application must program this field with the maximum packet size for the current logical endpoint - * | | |This value is in bytes. - * |[15] |USBActEP |USB Active Endpoint (USBActEP) - * | | |Indicates whether this endpoint is active in the current configuration and interface - * | | |The core clears this bit for all endpoints (other than EP 0) after detecting a USB reset - * | | |After receiving the SetConfiguration and SetInterface commands, the application must program endpoint registers accordingly and set this bit. - * | | |Values: - * | | |0x0 (DISABLED): Not Active - * | | |0x1 (ENABLED): USB Active Endpoint - * |[16] |DPID |Endpoint Data PID (DPID) (Read only) - * | | |Applies to interrupt/bulk IN and OUT endpoints only. - * | | |Contains the PID of the packet to be received or transmitted on this endpoint - * | | |The application must program the PID of the first packet to be received or transmitted on this endpoint, after the endpoint is activated - * | | |The applications use the SetD1PID and SetD0PID fields of this register to program either DATA0 or DATA1 PID. - * | | |1'b0: DATA0 - * | | |1'b1: DATA1 - * | | |Values: - * | | |0x0 (DATA0EVENFRM): DATA0 or Even Frame - * | | |0x1 (DATA1ODDFRM): DATA1 or Odd Frame - * |[17] |NAKSts |NAK Status (NAKSts) (Read only) - * | | |Indicates the following: - * | | |1'b0: The core is transmitting non-NAK handshakes based on the FIFO status. - * | | |1'b1: The core is transmitting NAK handshakes on this endpoint. - * | | |When either the application or the core sets this bit: - * | | |The core stops receiving any data on an OUT endpoint, even if there is space in the RxFIFO to accommodate the incoming packet. - * | | |For non-isochronous IN endpoints: The core stops transmitting any data on an IN endpoint, even if there data is available in the TxFIFO. - * | | |For isochronous IN endpoints: The core sends out a zero-length data packet, even if there data is available in the TxFIFO. - * | | |Irrespective of this bit's setting, the core always responds to SETUP data packets with an ACK handshake. - * | | |Values: - * | | |0x0 (NONNAK): - * | | |The core is transmitting non-NAK handshakes based on the FIFO status - * | | |0x1 (NAK): - * | | |The core is transmitting NAK handshakes on this endpoint - * |[19:18] |EPType |Endpoint Type (EPType) - * | | |This is the transfer type supported by this logical endpoint - * | | |2'b00: Control - * | | |2'b01: Isochronous - * | | |2'b10: Bulk - * | | |2'b11: Interrupt - * | | |Values: - * | | |0x0 (CONTROL): Control - * | | |0x1 (ISOCHRONOUS): Isochronous - * | | |0x2 (BULK): Bulk - * | | |0x3 (INTERRUP): Interrupt - * |[21] |Stall |STALL Handshake (Stall) - * | | |Applies to non-control, non-isochronous IN and OUT endpoints only. - * | | |The application sets this bit to stall all tokens from the USB host to this endpoint - * | | |If a NAK bit, Global Non-periodic IN NAK, or Global OUT NAK is set along with this bit, the STALL bit takes priority - * | | |Only the application can clear this bit, never the core. - * | | |Applies to control endpoints only. - * | | |The application can only set this bit, and the core clears it, when a SETUP token is received for this endpoint - * | | |If a NAK bit, Global Non-periodic IN NAK, or Global OUT NAK is set along with this bit, the STALL bit takes priority - * | | |Irrespective of this bit's setting, the core always responds to SETUP data packets with an ACK handshake. - * | | |Values: - * | | |0x0 (INACTIVE): STALL All non-active tokens - * | | |0x1 (ACTIVE): STALL All Active Tokens - * |[25:22] |TxFNum |TxFIFO Number (TxFNum) - * | | |Dedicated FIFO Operation: These bits specify the FIFO number associated with this endpoint - * | | |Each active IN endpoint must be programmed to a separate FIFO number - * | | |This field is valid only for IN endpoints. - * | | |Values: - * | | |0x0 (TXFIFO0): Tx FIFO 0 - * | | |0x1 (TXFIFO1): Tx FIFO 1 - * | | |0x2 (TXFIFO2): Tx FIFO 2 - * | | |0x3 (TXFIFO3): Tx FIFO 3 - * | | |0x4 (TXFIFO4): Tx FIFO 4 - * | | |0x5 (TXFIFO5): Tx FIFO 5 - * | | |0x6 (TXFIFO6): Tx FIFO 6 - * | | |0x7 (TXFIFO7): Tx FIFO 7 - * | | |0x8 (TXFIFO8): Tx FIFO 8 - * |[26] |CNAK |Clear NAK (CNAK) - * | | |A write to this bit clears the NAK bit for the endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No Clear NAK - * | | |0x1 (ACTIVE): Clear NAK - * |[27] |SNAK |Set NAK (SNAK) - * | | |A write to this bit sets the NAK bit for the endpoint. - * | | |Using this bit, the application can control the transmission of NAK handshakes on an endpoint - * | | |The core can also Set this bit for an endpoint after a SETUP packet is received on that endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No Set NAK - * | | |0x1 (ACTIVE): Set NAK - * |[30] |EPDis |Endpoint Disable (EPDis) - * | | |Applies to IN and OUT endpoints. - * | | |The application sets this bit to stop transmitting/receiving data on an endpoint, even before the transfer for that endpoint is complete - * | | |The application must wait for the Endpoint Disabled interrupt before treating the endpoint as disabled - * | | |The core clears this bit before setting the Endpoint Disabled interrupt - * | | |The application must set this bit only if Endpoint Enable is already set for this endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No Action - * | | |0x1 (ACTIVE): Disable Endpoint - * |[31] |EPEna |Endpoint Enable (EPEna) - * | | |Applies to IN and OUT endpoints. - * | | |When Scatter/Gather DMA mode is enabled, - * | | |For IN endpoints this bit indicates that the descriptor structure and data buffer with data ready to transmit is setup. - * | | |For OUT endpoint it indicates that the descriptor structure and data buffer to receive data is setup. - * | | |The core clears this bit before setting any of the following interrupts on this endpoint: - * | | |SETUP Phase Done - * | | |Endpoint Disabled - * | | |Transfer Completed - * | | |Note: For control endpoints in DMA mode, this bit must be set to be able to transfer SETUP data packets in memory. - * | | |Values: - * | | |0x0 (INACTIVE): No Action - * | | |0x1 (ACTIVE): Enable Endpoint - * @var HSUSBD_T::DIEPINTn - * Offset: 0x08 Device IN Endpoint n Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |XferCompl |Transfer Completed Interrupt (XferCompl) - * | | |Applies to IN and OUT endpoints. - * | | |When Scatter/Gather DMA mode is enabled - * | | |For IN endpoint this field indicates that the requested data from the descriptor is moved from external system memory to internal FIFO. - * | | |For OUT endpoint this field indicates that the requested data from the internal FIFO is moved to external system memory - * | | |This interrupt is generated only when the corresponding endpoint descriptor is closed, and the IOC bit for the corresponding descriptor is set. - * | | |Values: - * | | |0x0 (INACTIVE): No Transfer Complete Interrupt - * | | |0x1 (ACTIVE): Transfer Complete Interrupt - * |[1] |EPDisbld |Endpoint Disabled Interrupt (EPDisbld) - * | | |Applies to IN and OUT endpoints. - * | | |This bit indicates that the endpoint is disabled per the application's request. - * | | |Values: - * | | |0x0 (INACTIVE): No Endpoint Disabled Interrupt - * | | |0x1 (ACTIVE): Endpoint Disabled Interrupt - * |[2] |AHBErr |AHB Error (AHBErr) - * | | |Applies to IN and OUT endpoints. - * | | |When there is an AHB error during an AHB read/write - * | | |The application can read the corresponding endpoint DMA address register to get the error address. - * | | |Values: - * | | |0x0 (INACTIVE): No AHB Error Interrupt - * | | |0x1 (ACTIVE): AHB Error interrupt - * |[4] |INTknTXFEmp|IN Token Received When TxFIFO is Empty (INTknTXFEmp) - * | | |Applies to non-periodic IN endpoints only. - * | | |Indicates that an IN token was received when the associated TxFIFO (periodic/non-periodic) was empty - * | | |This interrupt is asserted on the endpoint for which the IN token was received. - * | | |Values: - * | | |0x0 (INACTIVE): No IN Token Received interrupt - * | | |0x1 (ACTIVE): IN Token Received Interrupt - * |[5] |INTknEPMis|IN Token Received with EP Mismatch (INTknEPMis) - * | | |Applies to non-periodic IN endpoints only. - * | | |Indicates that the data in the top of the non-periodic TxFIFO belongs to an endpoint other than the one for which the IN token was received - * | | |This interrupt is asserted on the endpoint for which the IN token was received. - * | | |Values: - * | | |0x0 (INACTIVE): No IN Token Received with EP Mismatch interrupt - * | | |0x1 (ACTIVE): IN Token Received with EP Mismatch interrupt - * |[6] |INEPNakEff|IN Endpoint NAK Effective (INEPNakEff) - * | | |Applies to periodic IN endpoints only. - * | | |This bit can be cleared when the application clears the IN endpoint NAK by writing to DIEPCTLn.CNAK. - * | | |This interrupt indicates that the core has sampled the NAK bit - * | | |Set (either by the application or by the core) - * | | |The interrupt indicates that the IN endpoint NAK bit Set by the application has taken effect in the core. - * | | |This interrupt does not guarantee that a NAK handshake is sent on the USB - * | | |A STALL bit takes priority over a NAK bit. - * | | |Values: - * | | |0x0 (INACTIVE): No Endpoint NAK Effective interrupt - * | | |0x1 (ACTIVE): IN Endpoint NAK Effective interrupt - * |[7] |TxFEmp |Transmit FIFO Empty (TxFEmp) (Read only) - * | | |This bit is valid only for IN endpoints - * | | |This interrupt is asserted when the TxFIFO for this endpoint is either half or completely empty - * | | |The half or completely empty status is determined by the TxFIFO Empty Level bit in the Core AHB Configuration register (GAHBCFG.NPTxFEmpLvl)). - * | | |Values: - * | | |0x0 (INACTIVE): No Transmit FIFO Empty interrupt - * | | |0x1 (ACTIVE): Transmit FIFO Empty interrupt - * |[8] |TxfifoUndrn|Fifo Underrun (TxfifoUndrn) - * | | |Applies to IN endpoints Only - * | | |This bit is valid only If thresholding is enabled - * | | |The core generates this interrupt when it detects a transmit FIFO underrun condition for this endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No Tx FIFO Underrun interrupt - * | | |0x1 (ACTIVE): TxFIFO Underrun interrupt - * |[9] |BNAIntr |BNA (Buffer Not Available) Interrupt (BNAIntr) - * | | |The core generates this interrupt when the descriptor accessed is not ready for the Core to process, such as Host busy or DMA done. - * | | |Values: - * | | |0x0 (INACTIVE): No BNA interrupt - * | | |0x1 (ACTIVE): BNA interrupt - * |[12] |BbleErr |NAK Interrupt (BbleErr) - * | | |The core generates this interrupt when babble is received for the endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No interrupt - * | | |0x1 (ACTIVE): BbleErr interrupt - * |[13] |NAKIntrpt |NAK Interrupt (NAKInterrupt) - * | | |The core generates this interrupt when a NAK is transmitted or received by the device - * | | |In case of isochronous IN endpoints the interrupt gets generated when a zero length packet is transmitted due to un-availability of data in the TXFifo. - * | | |Values: - * | | |0x0 (INACTIVE): No NAK interrupt - * | | |0x1 (ACTIVE): NAK Interrupt - * |[14] |NYETIntrpt|NYET Interrupt (NYETIntrpt) - * | | |The core generates this interrupt when a NYET response is transmitted for a non isochronous OUT endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No NYET interrupt - * | | |0x1 (ACTIVE): NYET Interrupt - * @var HSUSBD_T::DIEPDMAn - * Offset: 0x14 Device IN Endpoint n DMA Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMAAddr |Holds the start address of the external memory for storing or fetching endpoint data - * | | |Note: For control endpoints, this field stores control OUT data packets as well as SETUP transaction data packets - * | | |When more than three SETUP packets are received back-to-back, the SETUP data packet in the memory is overwritten. - * | | |This register is incremented on every AHB transaction - * | | |The application can give only a DWORD-aligned address. - * | | |This field indicates the base pointer for the descriptor list. - * @var HSUSBD_T::DTXFSTSn - * Offset: 0x18 Device IN Endpoint Transmit FIFO Status Register n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |INEPTxFSpcAvail|IN Endpoint TxFIFO Space Avail (INEPTxFSpcAvail) - * | | |Indicates the amount of free space available in the Endpoint TxFIFO. - * | | |Values are in terms of 32-bit words. - * | | |16'h0: Endpoint TxFIFO is full - * | | |16'h1: 1 word available - * | | |16'h2: 2 words available - * | | |16'hn: n words available (where 0 n 32,768) - * | | |16'h8000: 32,768 words available - * | | |Others: Reserved - * @var HSUSBD_T::DIEPDMABn - * Offset: 0x1C Device IN Endpoint n Buffer Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMABufferAddr|Holds the current buffer address This register is updated as and when the data transfer for the corresponding end point is in progress - */ - - - __IO uint32_t DIEPCTL; /*!< [0x000] Device Control IN Endpoint n Control Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t DIEPINT; /*!< [0x008] Device IN Endpoint n Interrupt Register */ - __I uint32_t RESERVE2[2]; - __IO uint32_t DIEPDMA; /*!< [0x014] Device IN Endpoint n DMA Address Register */ - __I uint32_t DTXFSTS; /*!< [0x018] Device IN Endpoint Transmit FIFO Status Register n */ - __I uint32_t DIEPDMAB; /*!< [0x01c] Device IN Endpoint n Buffer Address Register */ - -} HSUSBD_IEP_T; - - - -/*----- OUT Endpoint 1~8 -----*/ -typedef struct -{ - - /** - - * @var HSUSBD_T::DOEPCTLn - * Offset: 0x00 Device Control OUT Endpoint n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |MPS |Maximum Packet Size (MPS)Maximum Packet Size - * | | |The application must program this field with the maximum packet size for the current logical endpoint - * | | |This value is in bytes. - * |[15] |USBActEP |USB Active Endpoint (USBActEP)USB Active Endpoint - * | | |Indicates whether this endpoint is active in the current configuration and interface - * | | |The core clears this bit for all endpoints (other than EP 0) after detecting a USB reset - * | | |After receiving the SetConfiguration and SetInterface commands, the application must program endpoint registers accordingly and set this bit. - * | | |Values: - * | | |0x0 (DISABLED): Not Active - * | | |0x1 (ENABLED): USB Active Endpoint - * |[16] |DPID |Endpoint Data PID (DPID) (Read only)Endpoint Data PID (Read only) - * | | |Applies to interrupt/bulk IN and OUT endpoints only. - * | | |Contains the PID of the packet to be received or transmitted on this endpoint - * | | |The application must program the PID of the first packet to be received or transmitted on this endpoint, after the endpoint is activated - * | | |The applications use the SetD1PID and SetD0PID fields of this register to program either DATA0 or DATA1 PID. - * | | |1'b0: DATA0 - * | | |1'b1: DATA1 - * | | |Values: - * | | |0x0 (INACTIVE): Endpoint Data PID not active - * | | |0x1 (ACTIVE): Endpoint Data PID active - * |[17] |NAKSts |NAK Status (NAKSts) (Read only)NAK Status (Read only) - * | | |Indicates the following: - * | | |1'b0: The core is transmitting non-NAK handshakes based on the FIFO status. - * | | |1'b1: The core is transmitting NAK handshakes on this endpoint. - * | | |When either the application or the core sets this bit: - * | | |The core stops receiving any data on an OUT endpoint, even if there is space in the RxFIFO to accommodate the incoming packet. - * | | |For non-isochronous IN endpoints: The core stops transmitting any data on an IN endpoint, even if there data is available in the TxFIFO. - * | | |For isochronous IN endpoints: The core sends out a zero-length data packet, even if there data is available in the TxFIFO. - * | | |Irrespective of this bit's setting, the core always responds to SETUP data packets with an ACK handshake. - * | | |Values: - * | | |0x0 (NONNAK): - * | | |The core is transmitting non-NAK handshakes based on the FIFO status - * | | |0x1 (NAK): - * | | |The core is transmitting NAK handshakes on this endpoint - * |[19:18] |EPType |Endpoint Type (EPType)Endpoint Type - * | | |This is the transfer type supported by this logical endpoint. - * | | |2'b00: Control - * | | |2'b01: Isochronous - * | | |2'b10: Bulk - * | | |2'b11: Interrupt - * | | |Values: - * | | |0x0 (CONTROL): Control - * | | |0x1 (ISOCHRONOUS): Isochronous - * | | |0x2 (BULK): Bulk - * | | |0x3 (INTERRUPT): Interrupt - * |[20] |Snp |Reserved. - * |[21] |Stall |STALL Handshake (Stall)STALL Handshake - * | | |Applies to non-control, non-isochronous IN and OUT endpoints only. - * | | |The application sets this bit to stall all tokens from the USB host to this endpoint - * | | |If a NAK bit, Global Non-periodic IN NAK, or Global OUT NAK is set along with this bit, the STALL bit takes priority - * | | |Only the application can clear this bit, never the core. - * | | |Applies to control endpoints only. - * | | |The application can only set this bit, and the core clears it, when a SETUP token is received for this endpoint - * | | |If a NAK bit, Global Non-periodic IN NAK, or Global OUT NAK is set along with this bit, the STALL bit takes priority - * | | |Irrespective of this bit's setting, the core always responds to SETUP data packets with an ACK handshake. - * | | |Values: - * | | |0x0 (INACTIVE): STALL All non-active tokens - * | | |0x1 (ACTIVE): STALL All Active Tokens - * |[26] |CNAK |Clear NAK (CNAK)Clear NAK A write to this bit clears the NAK bit for the endpoint - * | | |Values: - * | | |0x0 (INACTIVE): No Clear NAK - * | | |0x1 (ACTIVE): Clear NAK - * |[27] |SNAK |Set NAK (SNAK)Set NAK - * | | |A write to this bit sets the NAK bit for the endpoint. - * | | |Using this bit, the application can control the transmission of NAK handshakes on an endpoint - * | | |The core can also set this bit for an endpoint after a SETUP packet is received on that endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No Set NAK - * | | |0x1 (ACTIVE): Set NAK - * |[28] |SetD0PID |Set DATA0 PID (SetD0PID)Set DATA0 PID - * | | |Applies to interrupt/bulk IN and OUT endpoints only. - * | | |Writing to this field sets the Endpoint Data PID (DPID) field in this register to DATA0. - * | | |Values: - * | | |0x0 (DISABLED): Disables Set DATA0 PID or Do not force Even Frame - * | | |0x1 (ENABLED): Set Endpoint Data PID to DATA0 or Sets EO_FrNum field to odd (micro)Frame - * |[29] |SetD1PID |Set DATA1 PID (SetD1PID)Set DATA1 PID - * | | |Applies to interrupt and bulk IN and OUT endpoints only. - * | | |Writing to this field sets the Endpoint Data PID (DPID) field in this register to DATA1. - * | | |Values: - * | | |0x0 (DISABLED): Disables Set DATA1 PID or Do not force Odd Frame - * | | |0x1 (ENABLED): Set Endpoint Data PID to DATA1 or Sets EO_FrNum field to odd (micro)Frame - * |[30] |EPDis |Endpoint Disable (EPDis)Endpoint Disable - * | | |Applies to IN and OUT endpoints. - * | | |The application sets this bit to stop transmitting/receiving data on an endpoint, even before the transfer for that endpoint is complete - * | | |The application must wait for the Endpoint Disabled interrupt before treating the endpoint as disabled - * | | |The core clears this bit before setting the Endpoint Disabled interrupt - * | | |The application must set this bit only if Endpoint Enable is already set for this endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No Action - * | | |0x1 (ACTIVE): Disable Endpoint - * |[31] |EPEna |Endpoint Enable (EPEna)Endpoint Enable - * | | |Applies to IN and OUT endpoints. - * | | |For IN endpoints this bit indicates that the descriptor structure and data buffer with data ready to transmit is setup. - * | | |For OUT endpoint it indicates that the descriptor structure and data buffer to receive data is setup. - * | | |The core clears this bit before setting any of the following interrupts on this endpoint: - * | | |SETUP Phase Done - * | | |Endpoint Disabled - * | | |Transfer Completed - * | | |Note: For control endpoints in DMA mode, this bit must be set for the controller to transfer SETUP data packets to the memory - * | | |This bit will not be cleared on Transfer Completed interrupt of the SETUP packet. - * | | |Values: - * | | |0x0 (INACTIVE): No Action - * | | |0x1 (ACTIVE): Enable Endpoint - * @var HSUSBD_T::DOEPINTn - * Offset: 0x08 Device OUT Endpoint n Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |XferCompl |Transfer Completed Interrupt (XferCompl) Transfer Completed Interrupt - * | | |Applies to IN and OUT endpoints. - * | | |When Scatter/Gather DMA mode is enabled - * | | |For IN endpoint this field indicates that the requested data from the descriptor is moved from external system memory to internal FIFO. - * | | |For OUT endpoint this field indicates that the requested data from the internal FIFO is moved to external system memory - * | | |This interrupt is generated only when the corresponding endpoint descriptor is closed, and the IOC bit for the corresponding descriptor is Set. - * | | |Values: - * | | |0x0 (INACTIVE): No Transfer Complete Interrupt - * | | |0x1 (ACTIVE): Transfer Complete Interrupt - * |[1] |EPDisbld |Endpoint Disabled Interrupt (EPDisbld)Endpoint Disabled Interrupt - * | | |Applies to IN and OUT endpoints. - * | | |This bit indicates that the endpoint is disabled per the application's request. - * | | |Values: - * | | |0x0 (INACTIVE): No Endpoint Disabled Interrupt - * | | |0x1 (ACTIVE): Endpoint Disabled Interrupt - * |[2] |AHBErr |AHB Error (AHBErr)AHB Error - * | | |Applies to IN and OUT endpoints. - * | | |When there is an AHB error during an AHB read/write - * | | |The application can read the corresponding endpoint DMA address register to get the error address. - * | | |Values: - * | | |0x0 (INACTIVE): No AHB Error Interrupt - * | | |0x1 (ACTIVE): AHB Error interrupt - * |[3] |SetUp |SETUP Phase Done (SetUp)SETUP Phase Done - * | | |Applies to control OUT endpoints only. - * | | |Indicates that the SETUP phase for the control endpoint is complete and no more back-to-back SETUP packets were received for the current control transfer - * | | |On this interrupt, the application can decode the received SETUP data packet. - * | | |Values: - * | | |0x0 (INACTIVE): No SETUP Phase Done - * | | |0x1 (ACTIVE): SETUP Phase Done - * |[4] |OUTTknEPdis|OUT Token Received When Endpoint Disabled (OUTTknEPdis)OUT Token Received When Endpoint Disabled - * | | |Applies only to control OUT endpoints. - * | | |Indicates that an OUT token was received when the endpoint was not yet enabled - * | | |This interrupt is asserted on the endpoint for which the OUT token was received. - * | | |Values: - * | | |0x0 (INACTIVE): No OUT Token Received When Endpoint Disabled - * | | |0x1 (ACTIVE): OUT Token Received When Endpoint Disabled - * |[5] |StsPhseRcvd|Status Phase Received for Control Write (StsPhseRcvd)Status Phase Received for Control Write - * | | |This interrupt is valid only for Control OUT endpoints. - * | | |This interrupt is generated only after the core has transferred all the data that the host has sent during the data phase of a control write transfer, to the system memory buffer. - * | | |The interrupt indicates to the application that the host has switched from data phase to the status phase of a Control Write transfer - * | | |The application can use this interrupt to ACK or STALL the Status phase, after it has decoded the data phase - * | | |This is applicable only in Case of Scatter Gather DMA mode. - * | | |Values: - * | | |0x0 (INACTIVE): No Status Phase Received for Control Write - * | | |0x1 (ACTIVE): Status Phase Received for Control Write - * |[6] |Back2BackSETup|Back-to-Back SETUP Packets Received (Back2BackSETup)Back-to-Back SETUP Packets Received - * | | |Applies to Control OUT endpoints only. - * | | |This bit indicates that the core has received more than three back-to-back SETUP packets for this particular endpoint - * | | |For information about handling this interrupt, - * | | |Values: - * | | |0x0 (INACTIVE): No Back-to-Back SETUP Packets Received - * | | |0x1 (ACTIVE): Back-to-Back SETUP Packets Received - * |[8] |OutPktErr |OUT Packet Error (OutPktErr)OUT Packet Error - * | | |Applies to OUT endpoints Only - * | | |This interrupt is valid only when thresholding is enabled - * | | |This interrupt is asserted when the core detects an overflow or a CRC error for non-Isochronous OUT packet. - * | | |Values: - * | | |0x0 (INACTIVE): No OUT Packet Error - * | | |0x1 (ACTIVE): OUT Packet Error - * |[9] |BNAIntr |BNA (Buffer Not Available) Interrupt (BNAIntr)Buffer Not Available Interrupt - * | | |The core generates this interrupt when the descriptor accessed is not ready for the Core to process, such as Host busy or DMA done - * | | |Values: - * | | |0x0 (INACTIVE): No BNA interrupt - * | | |0x1 (ACTIVE): BNA interrupt - * |[12] |BbleErr |NAK Interrupt (BbleErr)NAK Interrupt - * | | |The core generates this interrupt when babble is received for the endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No BbleErr interrupt - * | | |0x1 (ACTIVE): BbleErr interrupt - * |[13] |NAKIntrpt |NAK Interrupt (NAKInterrupt)NAK Interrupt - * | | |The core generates this interrupt when a NAK is transmitted or received by the device. - * | | |In case of isochronous IN endpoints the interrupt gets generated when a zero length packet is transmitted due to un-availability of data in the TXFifo. - * | | |Values: - * | | |0x0 (INACTIVE): No NAK interrupt - * | | |0x1 (ACTIVE): NAK Interrupt - * |[14] |NYETIntrpt|NYET Interrupt (NYETIntrpt)NYET Interrupt - * | | |The core generates this interrupt when a NYET response is transmitted for a non isochronous OUT endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No NYET interrupt - * | | |0x1 (ACTIVE): NYET Interrupt - * @var HSUSBD_T::DOEPDMAn - * Offset: 0x14 Device OUT Endpoint n DMA Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMAAddr |Holds the start address of the external memory for storing or fetching endpoint data - * | | |Note: For control endpoints, this field stores control OUT data packets as well as SETUP transaction data packets - * | | |When more than three SETUP packets are received back-to-back, the SETUP data packet in the memory is overwritten. - * | | |This register is incremented on every AHB transaction - * | | |The application can give only a DWORD-aligned address - * @var HSUSBD_T::DOEPDMABn - * Offset: 0x1C Device OUT Endpoint n Buffer Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMABufferAddr|Holds the current buffer address This register is updated as and when the data transfer for the corresponding end point is in progress. - */ - - __IO uint32_t DOEPCTL; /*!< [0x000] Device Control OUT Endpoint n Control Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t DOEPINT; /*!< [0x008] Device OUT Endpoint n Interrupt Register */ - __I uint32_t RESERVE2[2]; - __IO uint32_t DOEPDMA; /*!< [0x014] Device OUT Endpoint n DMA Address Register */ - __I uint32_t RESERVE3[1]; - __I uint32_t DOEPDMAB; /*!< [0x01c] Device OUT Endpoint n Buffer Address Register */ - -} HSUSBD_OEP_T; - - -typedef struct -{ - - - /** - * @var HSUSBD_T::GOTGCTL - * Offset: 0x00 Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27] |ChirpEn |Mode: Device Only - * | | |This bit when programmed to 1'b1 results in the core asserting chirp_on before sending an actual Chirp "K" signal on USB. - * | | |0x0 (CHIRP_DISABLE): The controller does not assert chirp_on before sending an actual Chirp "K" signal on USB. - * | | |0x1 (CHIRP_ENABLE): The controller asserts chirp_on before sending an actual Chirp "K" signal on USB. - * |[31] |Testmode_corr_eUSB2|UTMI IF correction for eUSB2 PHY during Test mode - * | | |This bit is used to modify the behavior of UTMI 8-bit interface signals during test J and test K sequences when eUSB2 PHY is used. - * | | |When this bit is set to 1'b1, the controller asserts utmi_txvalid and utmi_opmode in the same cycle during test J or test K sequence execution. - * | | |Note: This bit is applicable only if eUSB2 PHY is used with 8-bit UTMI interface. - * | | |0x0 (eUSB2_corr_disable): The controller asserts utmi_txvalid one cycle later than utmi_opmode. - * | | |0x1 (eUSB2_corr_enable): The controller asserts utmi_txvalid and utmi_opmode in the same cycle. - * @var HSUSBD_T::GAHBCFG - * Offset: 0x08 AHB Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GlblIntrMsk|Global Interrupt Mask (GlblIntrMsk) - * | | |The application uses this bit to mask or unmask the interrupt line assertion to itself - * | | |Irrespective of this bit's setting, the interrupt status registers are updated by the controller. - * | | |1'b0: Mask the interrupt assertion to the application. - * | | |1'b1: Unmask the interrupt assertion to the application. - * | | |Values: - * | | |0x0 (MASK): Mask the interrupt assertion to the application - * | | |0x1 (NOMASK): Unmask the interrupt assertion to the application. - * |[4:1] |HBstLen |Burst Length/Type (HBstLen) - * | | |Internal DMA Mode AHB Master burst type: - * | | |4'b0000 Single - * | | |4'b0001 INCR - * | | |4'b0011 INCR4 - * | | |4'b0101 INCR8 - * | | |4'b0111 INCR16 - * | | |Others: Reserved - * | | |Values: - * | | |0x0 (WORD1ORSINGLE): 1 word or single - * | | |0x1 (WORD4ORINCR): 4 words or INCR - * | | |0x3 (WORD16ORINCR4): 16 words or INCR4 - * | | |0x5 (WORD64ORINCR8): 64 words or INCR8 - * | | |0x7 (WORD256ORINCR16): 256 words or INCR16 - * |[5] |DMAEn |DMA Enable (DMAEn) - * | | |Reset: 1'b0 - * | | |Values: - * | | |0x1 (DMAMODE): Core operates in a DMA mode - * |[23] |AHBSingle |AHB Single Support (AHBSingle) - * | | |This bit when programmed supports Single transfers for the remaining data in a transfer when the core is operating in DMA mode. - * | | |1'b0: The remaining data in the transfer is sent using INCR burst size. - * | | |1'b1: The remaining data in the transfer is sent using Single burst size. - * | | |Note: If this feature is enabled, the AHB RETRY and SPLIT transfers still have INCR burst type - * | | |Enable this feature when the AHB Slave connected to the core does not support INCR burst (and when Split, and Retry transactions are not being used in the bus). - * | | |Values: - * | | |0x0 (INCRBURST): The remaining data in the transfer is sent using INCR burst size - * | | |0x1 (SINGLEBURST): The remaining data in the transfer is sent using Single burst size - * |[24] |InvDescEndianess|Invert Descriptor Endianess (InvDescEndianess) - * | | |1'b0: Descriptor Endianness is same as AHB Master Endianness. - * | | |1'b1: - * | | |If the AHB Master endianness is Big Endian, the Descriptor Endianness is Little Endian. - * | | |If the AHB Master endianness is Little Endian, the Descriptor Endianness is Big Endian. - * | | |Values: - * | | |0x0 (DISABLE): Descriptor Endianness is same as AHB Master Endianness - * | | |0x1 (ENABLE): Descriptor Endianness is opposite to AHB Master Endianness - * @var HSUSBD_T::GUSBCFG - * Offset: 0x0C USB Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TOutCal |HS/FS Timeout Calibration (TOutCal) - * | | |The number of PHY clocks that the application programs in this field is added to the high-speed/full-speed interpacket timeout duration in the core to account for any additional delays introduced by the PHY - * | | |This can be required, because the delay introduced by the PHY in generating the linestate condition can vary from one PHY to another. - * | | |The USB standard timeout value for high-speed operation is 736 to 816 (inclusive) bit times - * | | |The USB standard timeout value for full-speed operation is 16 to 18 (inclusive) bit times - * | | |The application must program this field based on the speed of enumeration - * | | |The number of bit times added per PHY clock are as follows: - * | | |High-speed operation: - * | | |One 60- MHz PHY clock = 8 bit times. - * | | |Full-speed operation: - * | | |One 60- MHz PHY clock = 0.2 bit times. - * |[13:10] |USBTrdTim |USB Turnaround Time (USBTrdTim) - * | | |Sets the turnaround time in PHY clocks - * | | |Specifies the response time for a MAC request to the Packet FIFO Controller (PFC) to fetch data from the DFIFO (Interanl Storage) - * | | |This must be programmed to - * | | |4'h9: When the MAC interface is 8-bit UTMI+ . - * | | |Values: - * | | |0x9 (TURNTIME8BIT): MAC interface is 8-bit UTMI+. - * |[28] |TxEndDelay|Tx End Delay (TxEndDelay) - * | | |Writing 1'b1 to this bit enables the controller to follow the TxEndDelay timings as per UTMI+ specification 1.05 section 4.1.5 for opmode signal during remote wakeup. - * | | |1'b0 : Normal Mode. - * | | |1'b1 : Tx End delay. - * | | |Values: - * | | |0x0 (DISABLED): Normal Mode - * | | |0x1 (ENABLED): Tx End delay - * @var HSUSBD_T::GRSTCTL - * Offset: 0x10 Reset Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSftRst |Core Soft Reset (CSftRst) - * | | |Resets the hclk and phy_clock domains as follows: - * | | |Clears the interrupts and all the CSR registers except the following register bits: - * | | |GUSBCFG.TxEndDelay - * | | |DCFG.DevSpd - * | | |DCTL.SftDiscon - * | | |All module state machines - * | | |All module state machines (except the AHB Slave Unit) are reset to the IDLE state, and all the transmit FIFOs and the receive FIFO are flushed. - * | | |Any transactions on the AHB Master are terminated as soon as possible, after gracefully completing the last data phase of an AHB transfer - * | | |Any transactions on the USB are terminated immediately. - * | | |The application can write to this bit any time it wants to reset the core - * | | |This is a self-clearing bit and the core clears this bit after all the necessary logic is reset in the core, which can take several clocks, depending on the current state of the core - * | | |Once this bit is cleared software must wait at least 3 PHY clocks before doing any access to the PHY domain (synchronization delay) - * | | |Software must also must check that bit 31 of this register is 1 (AHB Master is IDLE) before starting any operation. - * | | |Typically software reset is used during software development and also when you dynamically change the PHY selection bits in the USB configuration registers listed above - * | | |When you change the PHY, the corresponding clock for the PHY is selected and used in the PHY domain - * | | |Once a new clock is selected, the PHY domain has to be reset for proper operation. - * | | |Values: - * | | |0x0 (NOTACTIVE): No reset - * | | |0x1 (ACTIVE): Resets hclk and phy_clock domains - * |[1] |PIUFSSftRst|PIU FS Dedicated Controller Soft Reset (PIUFSSftRst) - * | | |Resets the PIU FS Dedicated Controller - * | | |All module state machines in FS Dedicated Controller of PIU are reset to the IDLE state - * | | |Used to reset the FS Dedicated controller in PIU in case of any PHY Errors like Loss of activity or Babble Error resulting in the PHY remaining in RX state for more than one frame boundary. - * | | |This is a self clearing bit and core clears this bit after all the necessary logic is reset in the core. - * | | |Values: - * | | |0x0 (RESET_INACTIVE): No Reset - * | | |0x1 (RESET_ACTIVE): PIU FS Dedicated Controller Soft Reset - * |[4] |RxFFlsh |RxFIFO Flush (RxFFlsh) - * | | |The application can flush the entire RxFIFO using this bit, but must first ensure that the core is not in the middle of a transaction. - * | | |The application must only write to this bit after checking that the controller is neither reading from the RxFIFO nor writing to the RxFIFO. - * | | |The application must wait until the bit is cleared before performing any other operations - * | | |This bit requires eight clocks (slowest of PHY or AHB clock) to clear. - * | | |Values: - * | | |0x0 (INACTIVE): Does not flush the entire RxFIFO - * | | |0x1 (ACTIVE): Flushes the entire RxFIFO - * |[5] |TxFFlsh |TxFIFO Flush (TxFFlsh) - * | | |This bit selectively flushes a single or all transmit FIFOs, but cannot do so If the core is in the midst of a transaction. - * | | |The application must write this bit only after checking that the core is neither writing to the TxFIFO nor reading from the TxFIFO. - * | | |Verify using these registers: - * | | |ReadNAK Effective Interrupt ensures the core is not reading from the FIFO - * | | |WriteGRSTCTL.AHBIdle ensures the core is not writing anything to the FIFO. - * | | |Flushing is normally recommended when FIFOs are reconfigured - * | | |FIFO flushing is also recommended during device endpoint disable - * | | |The application must wait until the core clears this bit before performing any operations - * | | |This bit takes eight clocks to clear, using the slower clock of phy_clk or hclk. - * | | |Values: - * | | |0x0 (INACTIVE): No Flush - * | | |0x1 (ACTIVE): Selectively flushes a single or all transmit FIFOs - * |[10:6] |TxFNum |TxFIFO Number (TxFNum) - * | | |This is the FIFO number that must be flushed using the TxFIFO Flush bit - * | | |This field must not be changed until the core clears the TxFIFO Flush bit. - * | | |5'h0: - * | | |Tx FIFO 0 flush in device mode when in dedicated FIFO mode - * | | |5'h1: - * | | |TXFIFO 1 flush in device mode when in dedicated FIFO mode - * | | |5'h2: - * | | |TXFIFO 2 flush in device mode when in dedicated FIFO mode - * | | |... - * | | |5'h8 - * | | |TXFIFO 8 flush in device mode when in dedicated FIFO mode - * | | |5'h10: Flush all the transmit FIFOs - * | | |Values: - * | | |0x0 (TXF0): TXFIFO 0 flush in device mode when in dedicated FIFO mode - * | | |0x1 (TXF1): TXFIFO 1 flush in device mode when in dedicated FIFO mode - * | | |0x2 (TXF2): TXFIFO 2 flush in device mode when in dedicated FIFO mode - * | | |0x3 (TXF3): TXFIFO 3 flush in device mode when in dedicated FIFO mode - * | | |0x4 (TXF4): TXFIFO 4 flush in device mode when in dedicated FIFO mode - * | | |0x5 (TXF5): TXFIFO 5 flush in device mode when in dedicated FIFO mode - * | | |0x6 (TXF6): TXFIFO 6 flush in device mode when in dedicated FIFO mode - * | | |0x7 (TXF7): TXFIFO 7 flush in device mode when in dedicated FIFO mode - * | | |0x8 (TXF8): TXFIFO 8 flush in device mode when in dedicated FIFO mode - * | | |0x10 (TXF16): Flush all the transmit FIFOs - * |[31] |AHBIdle |AHB Master Idle (AHBIdle)(Read only) - * | | |Indicates that the AHB Master State Machine is in the IDLE condition. - * | | |Values: - * | | |0x0 (INACTIVE): Not Idle - * | | |0x1 (ACTIVE): AHB Master Idle - * @var HSUSBD_T::GINTSTS - * Offset: 0x14 Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3] |Sof |Start of (micro)Frame (Sof) - * | | |In Device mode, the controller sets this bit to indicate that an SOF token has been received on the USB - * | | |The application can read the Device Status register to get the current (micro)Frame number - * | | |This interrupt is seen only when the core is operating at either HS or FS - * | | |This bit can be set only by the core and the application must write 1 to clear it. - * | | |Note: This register may return 1'b1 if read immediately after power-on reset - * | | |If the register bit reads 1'b1 immediately after power-on reset, it does not indicate that an SOF has been received - * | | |The read value of this interrupt is valid only after a valid connection between host and device is established - * | | |If the bit is set after power on reset the application can clear the bit. - * | | |Values: - * | | |0x0 (INTACTIVE): No Start of Frame - * | | |0x1 (ACTIVE): Start of Frame - * |[4] |RxFLvl |RxFIFO Non-Empty (RxFLvl)(Read only) - * | | |Indicates that there is at least one packet pending to be read from the RxFIFO. - * | | |Values: - * | | |0x0 (INACTIVE): Rx Fifo is empty - * | | |0x1 (ACTIVE): Rx Fifo is not empty - * |[6] |GINNakEff |Global IN Non-periodic NAK Effective (GINNakEff)(Read only) - * | | |Indicates that the Set Global Non-periodic IN NAK bit in the Device Control register (DCTL.SGNPInNak) set by the application, has taken effect in the core - * | | |That is, the core has sampled the Global IN NAK bit Set by the application - * | | |This bit can be cleared by clearing the Clear Global Non-periodic IN NAK bit in the Device Control register (DCTL.CGNPInNak) - * | | |This interrupt does not necessarily mean that a NAK handshake is sent out on the USB - * | | |The STALL bit takes precedence over the NAK bit. - * | | |Values: - * | | |0x0 (INACTIVE): Global Non-periodic IN NAK not active - * | | |0x1 (ACTIVE): Set Global Non-periodic IN NAK bit - * |[7] |GOUTNakEff|Global OUT NAK Effective (GOUTNakEff)(Read only) - * | | |Indicates that the Set Global OUT NAK bit in the Device Control register (DCTL.SGOUTNak), Set by the application, has taken effect in the core - * | | |This bit can be cleared by writing the Clear Global OUT NAK bit in the Device Control register (DCTL.CGOUTNak). - * | | |Values: - * | | |0x0 (INACTIVE): Not Active - * | | |0x1 (ACTIVE): Global OUT NAK Effective - * |[10] |ErlySusp |Early Suspend (ErlySusp) - * | | |The controller sets this bit to indicate that an Idle state has been detected on the USB for 3 ms. - * | | |Values: - * | | |0x0 (INACTIVE): No Idle state detected - * | | |0x1 (ACTIVE): 3ms of Idle state detected - * |[11] |USBSusp |USB Suspend (USBSusp) - * | | |The controller sets this bit to indicate that a suspend was detected on the USB - * | | |The controller enters the Suspended state when there is no activity on the linestate signal for an extended period of time. - * | | |Values: - * | | |0x0 (INACTIVE): Not Active - * | | |0x1 (ACTIVE): USB Suspend - * |[12] |USBRst |USB Reset (USBRst) - * | | |The controller sets this bit to indicate that a reset is detected on the USB. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): USB Reset - * |[13] |EnumDone |Enumeration Done (EnumDone) - * | | |The core sets this bit to indicate that speed enumeration is complete - * | | |The application must read the Device Status (DSTS) register to obtain the enumerated speed. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): Enumeration Done - * |[14] |ISOOutDrop|Isochronous OUT Packet Dropped Interrupt (ISOOutDrop) - * | | |The controller sets this bit when it fails to write an isochronous OUT packet into the RxFIFO because the RxFIFO does not have enough space to accommodate a maximum packet size packet for the isochronous OUT endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): Isochronous OUT Packet Dropped Interrupt - * |[15] |EOPF |End of Periodic Frame Interrupt (EOPF) - * | | |Indicates that the period specified in the Periodic Frame Interval field of the Device Configuration register (DCFG.PerFrInt) has been reached in the current microframe - * | | |In case of Non-Ignore Frame Number Scatter/Gather (Descriptor DMA) mode, the controller internally handles the following scenarios based on EOPF: - * | | |Read Flush: At the EOPF, the controller checks if there are any pending packets in the FIFO corresponding to the current (micro)Frame. - * | | |If there are any pending packets, then the controller initiates read flush, due to which the read pointer is updated to the starting location of the next micro-frame packet. - * | | |If there are no pending packets corresponding to the current (micro)Frame, the controller does not take any action. - * | | |Write Flush: At the EOPF, if the controller is still fetching the current micro-frame data, then the controller stops pushing data into the TXFIFO but keeps fetching the complete packet from the System Memory - * | | |After completing the scheduled packet size fetch, the controller updates the Status Quadlet Fields (Transmit Status to BUFFLUSH) and closes the Descriptor - * | | |During the descriptor close, the controller initiates write flush, due to which the write pointer is updated to the starting location of the next micro-frame packet - * | | |Because the controller stops pushing the packet to the TxFIFO after EOPF, to bring the write pointer to the starting location of the next micro-frame, write flush is done. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): End of Periodic Frame Interrupt - * |[18] |IEPInt |IN Endpoints Interrupt (IEPInt)(Read only) - * | | |The core sets this bit to indicate that an interrupt is pending on one of the IN endpoints of the core - * | | |The application must read the Device All Endpoints Interrupt (DAINT) register to determine the exact number of the IN endpoint on Device IN Endpoint-n Interrupt (DIEPINTn) register to determine the exact cause of the interrupt - * | | |The application must clear the appropriate status bit in the corresponding DIEPINTn register to clear this bit. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): IN Endpoints Interrupt - * |[19] |OEPInt |OUT Endpoints Interrupt (OEPInt)(Read only) - * | | |The controller sets this bit to indicate that an interrupt is pending on one of the OUT endpoints of the core - * | | |The application must read the Device All Endpoints Interrupt (DAINT) register to determine the exact number of the OUT endpoint on which the interrupt occurred, and then read the corresponding Device OUT Endpoint-n Interrupt (DOEPINTn) register to determine the exact cause of the interrupt - * | | |The application must clear the appropriate status bit in the corresponding DOEPINTn register to clear this bit. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): OUT Endpoints Interrupt - * |[22] |FetSusp |Data Fetch Suspended (FetSusp) - * | | |This interrupt indicates that the core has stopped fetching data - * | | |For IN endpoints due to the unavailability of TxFIFO space or Request Queue space - * | | |This interrupt is used by the application for an endpoint mismatch algorithm. - * | | |For example, after detecting an endpoint mismatch, the application: - * | | |Sets a Global non-periodic IN NAK handshake - * | | |Disables IN endpoints - * | | |Flushes the FIFO - * | | |Determines the token sequence from the IN Token Sequence Learning Queue - * | | |Re-enables the endpoints - * | | |Clears the Global non-periodic IN NAK handshake - * | | |If the Global non-periodic IN NAK is cleared, the core has not yet fetched data for the IN endpoint, and the IN token is received - * | | |The core generates an 'IN token received when FIFO empty' interrupt - * | | |It then sends the host a NAK response - * | | |To avoid this scenario, the application can check the GINTSTS.FetSusp interrupt, which ensures that the FIFO is full before clearing a Global NAK handshake. - * | | |Alternatively, the application can mask the IN token received when FIFO empty interrupt when clearing a Global IN NAK handshake. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): Data Fetch Suspended - * |[23] |ResetDet |Reset detected Interrupt (ResetDet) - * | | |In Device mode, this interrupt is asserted when a reset is detected on the USB in partial power-down mode when the device is in Suspend. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): Reset detected Interrupt - * |[27] |LPM_Int |LPM Transaction Received Interrupt - * | | |(LPM_Int) This interrupt is asserted when the device receives an LPM transaction and responds with a non-ERRORed response has completed LPM transactions for the programmed number of times (GLPMCFG.RetryCnt) - * | | |Values: - * | | |0x0 (INACTIVE): Not Active - * | | |0x1 (ACTIVE): LPM Transaction Received Interrupt - * |[31] |WkUpInt |Resume/Remote Wakeup Detected Interrupt (WkUpInt) - * | | |Wakeup Interrupt during Suspend(L2) or LPM(L1) state. - * | | |During Suspend(L2): - * | | |This interrupt is asserted only when Host Initiated Resume is detected on USB. - * | | |During LPM(L1): - * | | |This interrupt is asserted for either Host Initiated Resume or Device Initiated Remote Wakeup on USB. - * | | |Values: - * | | |0x0 (INACTIVE): Not active - * | | |0x1 (ACTIVE): Resume or Remote Wakeup Detected Interrupt - * @var HSUSBD_T::GINTMSK - * Offset: 0x18 Interrupt Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |OTGIntMsk |OTG Interrupt Mask (OTGIntMsk) - * | | |Values: - * | | |0x0 (MASK): OTG Interrupt Mask - * | | |0x1 (NOMASK): No OTG Interrupt Mask - * |[3] |SofMsk |Start of (micro) Frame Mask (SofMsk) - * | | |Values: - * | | |0x0 (MASK): Start of Frame Mask - * | | |0x1 (NOMASK): No Start of Frame Mask - * |[4] |RxFLvlMsk |Receive FIFO Non-Empty Mask (RxFLvlMsk) - * | | |Values: - * | | |0x0 (MASK): Receive FIFO Non-Empty Mask - * | | |0x1 (NOMASK): No Receive FIFO Non-Empty Mask - * |[6] |GINNakEffMsk|Global Non-periodic IN NAK Effective Mask (GINNakEffMsk) - * | | |Values: - * | | |0x0 (MASK): Global Non-periodic IN NAK Effective Mask - * | | |0x1 (NOMASK): No Global Non-periodic IN NAK Effective Mask - * |[7] |GOUTNakEffMsk|Global OUT NAK Effective Mask (GOUTNakEffMsk) - * | | |Values: - * | | |0x0 (MASK): Global OUT NAK Effective Mask - * | | |0x1 (NOMASK): No Global OUT NAK Effective Mask - * |[10] |ErlySuspMsk|Early Suspend Mask (ErlySuspMsk) - * | | |Values: - * | | |0x0 (MASK): Early Suspend Mask - * | | |0x1 (NOMASK): No Early Suspend Mask - * |[11] |USBSuspMsk|USB Suspend Mask (USBSuspMsk) - * | | |Values: - * | | |0x0 (MASK): USB Suspend Mask - * | | |0x1 (NOMASK): No USB Suspend Mask - * |[12] |USBRstMsk |USB Reset Mask (USBRstMsk) - * | | |Values: - * | | |0x0 (MASK): USB Reset Mask - * | | |0x1 (NOMASK): No USB Reset Mask - * |[13] |EnumDoneMsk|Enumeration Done Mask (EnumDoneMsk) - * | | |Values: - * | | |0x0 (MASK): Enumeration Done Mask - * | | |0x1 (NOMASK): No Enumeration Done Mask - * |[14] |ISOOutDropMsk|Isochronous OUT Packet Dropped Interrupt Mask (ISOOutDropMsk) - * | | |Values: - * | | |0x0 (MASK): Isochronous OUT Packet Dropped Interrupt Mask - * | | |0x1 (NOMASK): No Isochronous OUT Packet Dropped Interrupt Mask - * |[15] |EOPFMsk |End of Periodic Frame Interrupt Mask (EOPFMsk) - * | | |Values: - * | | |0x0 (MASK): End of Periodic Frame Interrupt Mask - * | | |0x1 (NOMASK): No End of Periodic Frame Interrupt Mask - * |[17] |EPMisMsk |Endpoint Mismatch Interrupt Mask (EPMisMsk) - * | | |Values: - * | | |0x0 (MASK): Endpoint Mismatch Interrupt Mask - * | | |0x1 (NOMASK): No Endpoint Mismatch Interrupt Mask - * |[18] |IEPIntMsk |IN Endpoints Interrupt Mask (IEPIntMsk) - * | | |Values: - * | | |0x0 (MASK): IN Endpoints Interrupt Mask - * | | |0x1 (NOMASK): No IN Endpoints Interrupt Mask - * |[19] |OEPIntMsk |OUT Endpoints Interrupt Mask (OEPIntMsk) - * | | |Values: - * | | |0x0 (MASK): OUT Endpoints Interrupt Mask - * | | |0x1 (NOMASK): No OUT Endpoints Interrupt Mask - * |[22] |FetSuspMsk|Data Fetch Suspended Mask (FetSuspMsk) - * | | |Values: - * | | |0x0 (MASK): Data Fetch Suspended Mask - * | | |0x1 (NOMASK): No Data Fetch Suspended Mask - * |[23] |ResetDetMsk|Reset detected Interrupt Mask (ResetDetMsk) - * | | |Values: - * | | |0x0 (MASK): Reset detected Interrupt Mask - * | | |0x1 (NOMASK): No Reset detected Interrupt Mask - * |[27] |LPM_IntMsk|LPM Transaction Received Interrupt (LPM_Int) - * | | |LPM Transaction received interrupt Mask - * | | |Values: - * | | |0x0 (MASK): LPM Transaction received interrupt Mask - * | | |0x1 (NOMASK): No LPM Transaction received interrupt Mask - * |[31] |WkUpIntMsk|Resume/Remote Wakeup Detected Interrupt Mask (WkUpIntMsk) - * | | |The WakeUp bit is used for LPM state wake up in a way similar to that of wake up in suspend state. - * | | |Values: - * | | |0x0 (MASK): Resume or Remote Wakeup Detected Interrupt Mask - * | | |0x1 (NOMASK): Unmask Resume Remote Wakeup Detected Interrupt - * @var HSUSBD_T::GRXSTSR - * Offset: 0x1C Receive Status Debug Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNum |Endpoint Number (EPNum) - * | | |Indicates the endpoint number to which the current received packet belongs. - * |[14:4] |BCnt |Byte Count (BCnt) - * | | |indicates the byte count of the received data packet. - * |[16:15] |DPID |Data PID - * | | |I (DPID) indicates the Data PID of the received OUT data packet - * | | |2'b00: DATA0 - * | | |2'b10: DATA1 - * | | |2'b01: DATA2 - * | | |2'b11: MDATA - * | | |Reset: 2'h0 - * | | |Values: - * | | |0x0 (DATA0): DATA0 - * | | |0x2 (DATA1): DATA1 - * | | |0x1 (DATA2): DATA2 - * | | |0x3 (MDATA): MDATA - * |[20:17] |PktSts |Packet Status - * | | |I(PktSts) indicates the status of the received packet - * | | |4'b0001: Global OUT NAK (triggers an interrupt) - * | | |4'b0010: OUT data packet received - * | | |4'b0011: OUT transfer completed (triggers an interrupt) - * | | |4'b0100: SETUP transaction completed (triggers an interrupt) - * | | |4'b0110: SETUP data packet received - * | | |Others: Reserved - * | | |Reset:4'h0 - * | | |Values: - * | | |0x1 (OUTNAK): Global OUT NAK (triggers an interrupt) - * | | |0x2 (INOUTDPRX): OUT data packet received - * | | |0x3 (INOUTTRCOM): IN or OUT transfer completed (triggers an interrupt) - * | | |0x4 (DSETUPCOM): SETUP transaction completed (triggers an interrupt) - * | | |0x6 (DSETUPRX): SETUP data packet received - * |[24:21] |FN |Frame Number - * | | |(FN) - * | | |This is the least significant 4 bits of the (micro)Frame number in which the packet is received on the USB - * | | |This field is supported only when isochronous OUT endpoints are supported. - * @var HSUSBD_T::GRXSTSP - * Offset: 0x20 Receive Status Read/Pop Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |EPNum |Endpoint Number (EPNum) - * | | |Indicates the endpoint number to which the current received packet belongs. - * | | |Values: - * | | |0x0 (CHEP0): Channel or EndPoint 0 - * | | |0x1 (CHEP1): Channel or EndPoint 1 - * | | |0x2 (CHEP2): Channel or EndPoint 2 - * | | |0x3 (CHEP3): Channel or EndPoint 3 - * | | |0x4 (CHEP4): Channel or EndPoint 4 - * | | |0x5 (CHEP5): Channel or EndPoint 5 - * | | |0x6 (CHEP6): Channel or EndPoint 6 - * | | |0x7 (CHEP7): Channel or EndPoint 7 - * | | |0x8 (CHEP8): Channel or EndPoint 8 - * |[14:4] |BCnt |Byte Count - * | | |(BCnt) - * | | |indicates the byte count of the received data packet. - * |[16:15] |DPID |Data PID (DPID) - * | | |iIndicates the Data PID of the received OUT data packet - * | | |2'b00: DATA0 - * | | |2'b10: DATA1 - * | | |2'b01: DATA2 - * | | |2'b11: MDATA - * | | |Reset: 2'h0 - * | | |Values: - * | | |0x0 (DATA0): DATA0 - * | | |0x2 (DATA1): DATA1 - * | | |0x1 (DATA2): DATA2 - * | | |0x3 (MDATA): MDATA - * |[20:17] |PktSts |Packet Status (PktSts) - * | | |iIndicates the status of the received packet - * | | |4'b0001: Global OUT NAK (triggers an interrupt) - * | | |4'b0010: OUT data packet received - * | | |4'b0011: OUT transfer completed (triggers an interrupt) - * | | |4'b0100: SETUP transaction completed (triggers an interrupt) - * | | |4'b0110: SETUP data packet received - * | | |Others: Reserved - * | | |Reset:4'h0 - * | | |Values: - * | | |0x1 (OUTNAK): Global OUT NAK (triggers an interrupt) - * | | |0x2 (INOUTDPRX): OUT data packet received - * | | |0x3 (INOUTTRCOM): IN or OUT transfer completed (triggers an interrupt) - * | | |0x4 (DSETUPCOM): SETUP transaction completed (triggers an interrupt) - * |[24:21] |FN |Frame Number (FN) - * | | |This is the least significant 4 bits of the (micro)Frame number in which the packet is received on the USB - * | | |This field is supported only when isochronous OUT endpoints are supported. - * @var HSUSBD_T::GRXFSIZ - * Offset: 0x24 Receive FIFO Size Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |RxFDep |RxFIFO Depth (RxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth. - * | | |You can write a new value in this field. Programmed values must not exceed the power-on value. - * @var HSUSBD_T::GNPTXFSIZ - * Offset: 0x28 Non-periodic Transmit FIFO Size Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |INEPTxF0StAddr|IN Endpoint FIFO0 Transmit RAM Start Address(INEPTxF0StAddr) - * | | |This field contains the memory start address for IN Endpoint Transmit FIFO# 0. - * | | |Programmed values must not exceed the power-on value. - * |[21:16] |INEPTxF0Dep|IN Endpoint TxFIFO 0 Depth (INEPTxF0Dep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The application can write a new value in this field - * | | |The power-on reset value of this field is specified as Largest IN Endpoint FIFO 0 Depth. - * @var HSUSBD_T::GLPMCFG - * Offset: 0x54 LPM Config Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPMCap |LPM-Capable (LPMCap) - * | | |The application uses this bit to control the controller LPM capabilities - * | | |If the core operates as a non-LPM-capable device, it cannot respond to any LPM transactions - * | | |If GLPMCFG.LPMCap is 1'b0, the software must not set any of the remaining fields in the GLPMCFG register and these fields should hold their Reset values. - * | | |1'b0: LPM capability is not enabled. - * | | |1'b1: LPM capability is enabled. - * | | |Values: - * | | |0x0 (DISABLED): LPM capability is not enabled - * | | |0x1 (ENABLED): LPM capability is enabled - * |[1] |AppL1Res |LPM response programmed by application (AppL1Res) - * | | |Handshake response to LPM token pre-programmed by device application software - * | | |The response depends on GLPMCFG.LPMCap - * | | |If GLPMCFG.LPMCap is 1'b0, the core operates as a non-LPM-capable Device and does not respond to any LPM transactions - * | | |If GLPMCFG.LPMCap is 1'b1, the core responds as follows: - * | | |1: ACK - * | | |Even though an ACK is pre-programmed, the core responds with an ACK only on a successful LPM transaction - * | | |The LPM transaction is successful if: - * | | |There are no PID/CRC5 errors in both the EXT token and the LPM token (else ERROR) - * | | |A valid bLinkState = 0001B (L1) is received in the LPM transaction (else STALL). - * | | |No data is pending in the Transmit queue (else NYET) - * | | |0: NYET - * | | |The pre-programmed software bit is overridden for response to LPM token when: - * | | |The received bLinkState is not L1 (STALL response) - * | | |An error is detected in either of the LPM token packets due to corruption (ERROR response). - * | | |Values: - * | | |0x0 (NYET_RESP): The core responds with a NYET when an error is detected in either of the LPM token packets due to corruption - * | | |0x1 (ACK_RESP): The core responds with an ACK only on a successful LPM transaction - * |[5:2] |HIRD |Host-Initiated Resume Duration (HIRD) (Read only) - * | | |EnBESL = 1'b0. - * | | |Host Initiated Resume Duration - * | | |This field is read only and is updated with the Received LPM Token HIRD bmAttribute when an ACK/NYET/STALL response is sent to an LPM transaction - * | | |If HIRD[3:0], - * | | |4'b0000, THIRD(us) = 50. - * | | |4'b0001, THIRD(us) = 125. - * | | |4'b0010, THIRD(us) = 200. - * | | |4'b0011, THIRD(us) = 275. - * | | |4'b0100, THIRD(us) = 350. - * | | |4'b0101, THIRD(us) = 425. - * | | |4'b0110, THIRD(us) = 500. - * | | |4'b0111, THIRD(us) = 575. - * | | |4'b1000, THIRD(us) = 650. - * | | |4'b1001, THIRD(us) = 725. - * | | |4'b1010, THIRD(us) = 800. - * | | |4'b1011, THIRD(us) = 875. - * | | |4'b1100, THIRD(us) = 950. - * | | |4'b1101, THIRD(us) = 1025. - * | | |4'b1110, THIRD(us) = 1100. - * | | |4'b1111, THIRD(us) = 1175. - * | | |EnBESL = 1'b1. - * | | |Best Effort Service Latency (BESL) - * | | |This field is updated with the Received LPM Token BESL bmAttribute when an ACK/NYET/STALL response is sent to an LPM transaction - * | | |If BESL[3:0], - * | | |4'b0000, TBESL(us) = 125. - * | | |4'b0001, TBESL(us) = 150. - * | | |4'b0010, TBESL(us) = 200. - * | | |4'b0011, TBESL(us) = 300. - * | | |4'b0100, TBESL(us) = 400. - * | | |4'b0101, TBESL(us) = 500. - * | | |4'b0110, TBESL(us) = 1000. - * | | |4'b0111, TBESL(us) = 2000. - * | | |4'b1000, TBESL(us) = 3000. - * | | |4'b1001, TBESL(us) = 4000. - * | | |4'b1010, TBESL(us) = 5000. - * | | |4'b1011, TBESL(us) = 6000. - * | | |4'b1100, TBESL(us) = 7000. - * | | |4'b1101, TBESL(us) = 8000. - * | | |4'b1110, TBESL(us) = 9000. - * | | |4'b1111, TBESL(us) = 10000. - * |[6] |bRemoteWake|RemoteWakeEnable (bRemoteWake)(Read only) - * | | |This field is read only - * | | |It is updated with the Received LPM Token bRemoteWake bmAttribute when an ACK/NYET/STALL response is sent to an LPM transaction. - * | | |Values: - * | | |0x0 (DISABLED): Remote Wakeup is disabled - * | | |0x1 (ENABLED): In device mode, this field takes the value of remote wake up - * |[7] |EnblSlpM |Enable utmi_sleep_n (EnblSlpM) - * | | |The application uses this bit to control utmi_sleep_n assertion to the PHY in the L1 state. - * | | |1'b0: utmi_sleep_n assertion from the core is not transferred to the external PHY. - * | | |1'b1: utmi_sleep_n assertion from the core is transferred to the external PHY when utmi_l1_suspend_n cannot be asserted. - * | | |Values: - * | | |0x0 (DISABLED): utmi_sleep_n assertion from the core is not transferred to the external PHY - * | | |0x1 (ENABLED): utmi_sleep_n assertion from the core is transferred to the external PHY when utmi_l1_suspend_n cannot be asserted - * |[12:8] |HIRD_Thres|BESL/HIRD Threshold (HIRD_Thres) - * | | |EnBESL = 1'b0: The core puts the PHY into deep low power mode in L1 (by core asserting L1SuspendM) when HIRD value is greater than or equal to the value defined in this field HIRD_Thres[3:0] and HIRD_Thres[4] is set to 1b1. - * | | |EnBESL = 1'b1: The core puts the PHY into deep low power mode in L1 (by core asserting L1SuspendM) when BESL value is greater than or equal to the value defined in this field BESL_Thres[3:0] and BESL_Thres [4] is set to 1'b1. - * | | |DCTL.DeepSleepBESLReject = 1'b1: In device initiated resume, the core expects the Host to resume service to the device within the BESL value corresponding to L1 exit time specified in HIRD_Thres[3:0] - * | | |The Device sends a NYET response when the received HIRD in LPM token is greater than HIRD threshold - * |[14:13] |CoreL1Res |LPM Response (CoreL1Res) (Read only) - * | | |The response of the core to LPM transaction received is reflected in these two bits. - * | | |Values: - * | | |0x0 (LPMRESP1): ERROR : No handshake response - * | | |0x1 (LPMRESP2): STALL response - * | | |0x2 (LPMRESP3): NYET response - * | | |0x3 (LPMRESP4): ACK response - * |[15] |SlpSts |Port Sleep Status (SlpSts) (Read only) - * | | |This bit is set as long as a Sleep condition is present on the USB bus. - * | | |The core enters the Sleep state when an ACK response is sent to an LPM transaction and the TL1TokenRetry timer has expired - * | | |To stop the PHY clock, the application must set the Port Clock Stop bit, which asserts the PHY Suspend input signal - * | | |The application must rely on SlpSts and not ACK in CoreL1Res to confirm transition into sleep. - * | | |The core comes out of sleep: - * | | |When there is any activity on the USB line_state - * | | |When the application writes to the Remote Wakeup Signaling bit in the Device Control register (DCTL.RmtWkUpSig) or when the application resets or soft-disconnects the device. - * | | |Values: - * | | |0x0 (CORE_NOT_IN_L1): In Device mode, this bit indicates core is not in L1 - * | | |0x1 (CORE_IN_L1): In Device mode, the core enters the Sleep state when an ACK response is sent to an LPM transaction - * |[16] |L1ResumeOK|Sleep State Resume OK (L1ResumeOK)(Read only) - * | | |Indicates that the application or host can start resume from Sleep state - * | | |This bit is valid in LPM sleep (L1) state - * | | |It is set in sleep mode after a delay of 50 micro sec (TL1Residency) - * | | |The bit is reset when SlpSts is 0. - * | | |1'b0: The application/core cannot start resume from Sleep state. - * | | |1'b1: The application/core can start resume from Sleep state. - * | | |Values: - * | | |0x0 (NOTOK): The application/core cannot start Resume from Sleep state - * | | |0x1 (OK): The application/core can start Resume from Sleep state - * |[23:20] |LPM_Accept_Ctrl|Device Mode: LPM Accept Control (LPM_Accept_Ctrl) - * | | |LPM_Accept_Ctrl[0]: The application can use this bit to accept an LPM token even if data is present in the Interrupt endpoint TxFIFO. - * | | |1'b0: Reject (NYET) LPM token when data is present in the TxFIFO for Interrupt endpoints. - * | | |1'b1: Accept(ACK) LPM token when data is present in the TxFIFO for Interrupt endpoints. - * | | |Note: This bit is applicable only for Dedicated TxFIFO configurations (OTG_EN_DED_TX_FIFO=1). - * | | |LPM_Accept_Ctrl[1]: The application can use this bit to reject an LPM token (NYET) between multiple stages of a single control transfer. - * | | |1'b0: Accept(ACK) LPM token during Setup, Data, and Status stage of a control transfer. - * | | |1'b1: Reject(NYET) LPM token during Setup, Data, and Status stage of a control transfer. - * | | |LPM_Accept_Ctrl[2]: The application can use this bit to accept an LPM token even if data is present in the ISOC endpoint TxFIFO. - * | | |1'b0: Reject (NYET) LPM token when data is present in the TxFIFO for ISOC endpoints. - * | | |1'b1: Accept(ACK) LPM token when data is present in the TxFIFO for ISOC endpoints. - * | | |Note: This bit is applicable only for Dedicated TxFIFO configurations (OTG_EN_DED_TX_FIFO=1). - * | | |LPM_Accept_Ctrl[3]: The application can use this bit to accept an LPM token even if data is present in the BULK endpoint TxFIFO. - * | | |1'b0: Reject (NYET) LPM token, when data is present in the TxFIFO for Bulk endpoints. - * | | |1'b1: Accept(ACK) LPM token, when data is present in the TxFIFO for Bulk endpoints. - * | | |Note: This bit is applicable only for Dedicated TxFIFO configurations (OTG_EN_DED_TX_FIFO=1). - * |[28] |LPM_EnBESL|LPM Enable BESL (LPM_EnBESL) - * | | |This bit enables the BESL feature as defined in LPM Errata - * | | |1'b0: The core works as per USB 2.0 Link Power Management Addendum Engineering Change Notice to the USB 2.0 specification as of July 16, 2007 - * | | |1'b1: The core works as per the LPM Errata - * | | |Values: - * | | |0x0 (DISABLED): BESL is disabled - * | | |0x1 (ENABLED): BESL is enabled as defined in LPM Errata - * @var HSUSBD_T::GDFIFOCFG - * Offset: 0x5C Global DFIFO Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |GDFIFOCfg |GDFIFOCfg - * | | |This field is for dynamic programming of the DFIFO Size - * | | |This value takes effect only when the application programs a non zero value to this register - * | | |The value programmed must conform to the guidelines described in 'FIFO RAM Allocation' - * | | |The core does not have any corrective logic if the FIFO sizes are programmed incorrectly. - * | | |Value After Reset: 0xc00 - * |[31:16] |EPInfoBaseAddr|EPInfoBaseAddr - * | | |This field provides the start address of the EP info controller. - * | | |Value After Reset: 0xbb8 - * @var HSUSBD_T::GREFCLK - * Offset: 0x64 ref_clk Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |SOF_CNT_WKUP_ALERT|This bit indicates the number of SOF's after which the controller should generate an interrupt if the device had been in L1 state until that period - * | | |The interrupt is used by software to initiate remote wakeup in the controller in order to sync to the uF number in the host - * |[14] |RefclkMode|This bit is used to enable or disable ref_clk mode of operation - * | | |Note: - * | | |The default value of this field is 'd0. - * | | |When this field is disabled, DCTL.ServInt cannot be set to 1. - * | | |Values: - * | | |0x1 (ENABLE): Controller uses ref_clk to run internal micro-frame timers - * | | |0x0 (DISABLE): Controller uses phy_clk to run internal micro-frame timers - * |[31:15] |REFCLKPER |This bit indicates the period of ref_clk in terms of pico seconds - * | | |Note: - * | | |The default value of this field is 'd0. - * | | |The period of ref_clk should be an integer multiple of 125us. - * | | |The minimum frequency supported is 12 MHz. - * | | |Other supported frequencies are 16, 17, 19.2, 20, 24, 30, and 40 MHz. - * @var HSUSBD_T::GINTMSK2 - * Offset: 0x68 Interrupt Mask Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WkUpAlertIntMsk|Mode: Device - * | | |Remote WakeUp Alert Interrupt Mask - * | | |This interrupt is used to alert the application to initiate Remote WakeUp sequence. - * | | |Values: - * | | |0x0 (MASK): Mask Remote WakeUp Alert Interrupt - * | | |0x1 (NOMASK): Unmask Remote WakeUp Alert Interrupt - * @var HSUSBD_T::GINTSTS2 - * Offset: 0x6C Interrupt Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WkUpAlertInt|Mode: Device - * | | |Remote WakeUp Alert Interrupt Mask - * | | |This interrupt is used to alert the application to initiate Remote WakeUp sequence. - * | | |Values: - * | | |• 0x0 (INACTIVE): Not Active - * | | |• 0x1 (ACTIVE): Remote WakeUp Alert Interrupt detected - * @var HSUSBD_T::DIEPTXF1 - * Offset: 0x104 Device IN Endpoint Transmit FIFO Size Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value. - * @var HSUSBD_T::DIEPTXF2 - * Offset: 0x108 Device IN Endpoint Transmit FIFO Size Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value. - * @var HSUSBD_T::DIEPTXF3 - * Offset: 0x10C Device IN Endpoint Transmit FIFO Size Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth. - * | | |Value After Reset: 0x320 - * |[15:10] |_ |Reserved. - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value. - * @var HSUSBD_T::DIEPTXF4 - * Offset: 0x110 Device IN Endpoint Transmit FIFO Size Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value - * @var HSUSBD_T::DIEPTXF5 - * Offset: 0x114 Device IN Endpoint Transmit FIFO Size Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value. - * @var HSUSBD_T::DIEPTXF6 - * Offset: 0x118 Device IN Endpoint Transmit FIFO Size Register 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value. - * @var HSUSBD_T::DIEPTXF7 - * Offset: 0x11C Device IN Endpoint Transmit FIFO Size Register 7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value. - * @var HSUSBD_T::DIEPTXF8 - * Offset: 0x120 Device IN Endpoint Transmit FIFO Size Register 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |INEPnTxFStAddr|IN Endpoint FIFOn Transmit RAM Start Address (INEPnTxFStAddr) - * | | |This field contains the memory start address for IN endpoint Transmit FIFO - * | | |The power-on reset value of this register is specified as the Largest Rx Data FIFO Depth - * |[24:16] |INEPnTxFDep|IN Endpoint TxFIFO Depth (INEPnTxFDep) - * | | |This value is in terms of 32-bit words. - * | | |Minimum value is 16 - * | | |Maximum value is 32,768 - * | | |The power-on reset value of this register is specified as the Largest IN Endpoint FIFO number Depth. - * | | |Programmed values must not exceed the power-on value. - * @var HSUSBD_T::DCFG - * Offset: 0x800 Device Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |DevSpd |Device Speed (DevSpd) - * | | |Indicates the speed at which the application requires the core to enumerate, or the maximum speed the application can support - * | | |However, the actual bus speed is determined only after the connect sequence is completed, and is based on the speed of the USB host to which the core is connected. - * | | |Values: - * | | |0x0 (USBHS20): High speed USB 2.0 - * | | |0x1 (USBFS20): Full speed USB 2.0 - * | | |0x2 (Reserved0): Reserved - * | | |0x3 (Reserved1): Reserved - * |[2] |NZStsOUTHShk|Non-Zero-Length Status OUT Handshake (NZStsOUTHShk) - * | | |The application can use this field to select the handshake the core sends on receiving a nonzero-length data packet during the OUT transaction of a control transfer's Status stage. - * | | |1'b1: Send a STALL handshake on a nonzero-length status OUT transaction and do not send the received OUT packet to the application. - * | | |1'b0: Send the received OUT packet to the application (zerolength or nonzero-length) and send a handshake based on the NAK and STALL bits for the endpoint in the Device Endpoint Control register. - * | | |Values: - * | | |0x0 (SENDOUT): - * | | |Send the received OUT packet to the application (zero-length or non-zero length) and send a handshake based on NAK and STALL bits for the endpoint in the Devce Endpoint Control Register - * | | |0x1 (SENDSTALL): - * | | |Send a STALL handshake on a nonzero-length status OUT transaction and do not send the received OUT packet to the application - * |[10:4] |DevAddr |Device Address (DevAddr) - * | | |The application must program this field after every SetAddress control command. - * |[12:11] |PerFrInt |Periodic Frame Interval (PerFrInt) - * | | |Indicates the time within a (micro)Frame at which the application must be notified using the End Of Periodic Frame Interrupt - * | | |This can be used to determine If all the isochronous traffic for that (micro)Frame is complete. - * | | |2'b00: 80% of the (micro)Frame interval - * | | |2'b01: 85% of the (micro)Frame interval - * | | |2'b10: 90% of the (micro)Frame interval - * | | |2'b11: 95% of the (micro)Frame interval - * | | |Values: - * | | |0x0 (EOPF80): 80% of the (micro)Frame interval - * | | |0x1 (EOPF85): 85% of the (micro)Frame interval - * | | |0x2 (EOPF90): 90% of the (micro)Frame interval - * | | |0x3 (EOPF95): 95% of the (micro)Frame interval - * |[13] |EnDevOutNak|Enable Device OUT NAK (EnDevOutNak) - * | | |This bit enables setting NAK for Bulk OUT endpoints after the transfer is completed for Device mode Descriptor DMA - * | | |1'b0 : The core does not set NAK after Bulk OUT transfer complete - * | | |1'b1 : The core sets NAK after Bulk OUT transfer complete - * | | |This bit is one time programmable after reset like any other DCFG register bits. - * | | |Values: - * | | |0x0 (DISABLED): - * | | |The core does not set NAK after Bulk OUT transfer complete - * | | |0x1 (ENABLED): The core sets NAK after Bulk OUT transfer complete - * |[14] |XCVRDLY |XCVRDLY - * | | |Enables or disables delay between xcvr_sel and txvalid during device chirp - * | | |Values: - * | | |0x0 (DISABLE): No delay between xcvr_sel and txvalid during Device chirp - * | | |0x1 (ENABLE): Enable delay between xcvr_sel and txvalid during Device chirp - * |[15] |ErraticIntMsk|Erratic Error Interrupt Mask - * | | |Values: - * | | |0x0 (NOMASK): Early suspend interrupt is generated on erratic error - * | | |0x1 (MASK): Mask early suspend interrupt on erratic error - * |[17] |ipgisocSupt|Worst-Case Inter-Packet Gap ISOC OUT Support (ipgisocSupt) - * | | |This bit indicates that the controller supports the worst-case scenario of Rx followed by Rx Inter Packet Gap (IPG) (32 bit times) as per the UTMI Specification for any token following an ISOC OUT token - * | | |Without this support, when any token follows an ISOC OUT token with the worst-case IPG, the controller will not detect the followed token - * | | |The worst-case IPG of the controller without this support depends on the AHB and PHY Clock frequency. - * | | |Values: - * | | |0x0 (DISABLED): Worst-Case Inter-Packet Gap ISOC OUT Support is disabled - * | | |0x1 (ENABLED): Worst-Case Inter-Packet Gap ISOC OUT Support is enabled - * |[23] |DescDMA |Enable Scatter/gather DMA in device mode (DescDMA) - * | | |The application can Set this bit during initialization to enable the Scatter/Gather DMA operation. - * | | |Note: This bit must be modified only once after a reset - * | | |The following combinations are available for programming: - * | | |GAHBCFG.DMAEn=0,DCFG.DescDMA=0 => Invalid. - * | | |GAHBCFG.DMAEn=0,DCFG.DescDMA=1 => Invalid. - * | | |GAHBCFG.DMAEn=1,DCFG.DescDMA=0 => Invalid. - * | | |GAHBCFG.DMAEn=1,DCFG.DescDMA=1 => Scatter/Gather DMA mode. - * | | |Values: - * | | |0x0 (DISABLED): Disable Scatter/Gather DMA - * | | |0x1 (ENABLED): Enable Scatter/Gather DMA - * |[25:24] |PerSchIntvl|Periodic Scheduling Interval (PerSchIntvl) - * | | |PerSchIntvl must be programmed for Scatter/Gather DMA mode. - * | | |This field specifies the amount of time the Internal DMA engine must allocate for fetching periodic IN endpoint data - * | | |Based on the number of periodic endpoints, this value must be specified as 25,50 or 75% of (micro)Frame. - * | | |When any periodic endpoints are active, the internal DMA engine allocates the specified amount of time in fetching periodic IN endpoint data . - * | | |When no periodic endpoints are active, Then the internal DMA engine services non-periodic endpoints, ignoring this field. - * | | |After the specified time within a (micro)Frame, the DMA switches to fetching for non-periodic endpoints. - * | | |2'b00: 25% of (micro)Frame. - * | | |2'b01: 50% of (micro)Frame. - * | | |2'b10: 75% of (micro)Frame. - * | | |2'b11: Reserved. - * | | |Reset: 2'b00 - * | | |Values: - * | | |0x0 (MF25): 25% of (micro)Frame - * | | |0x1 (MF50): 50% of (micro)Frame - * | | |0x2 (MF75): 75% of (micro)Frame - * | | |0x3 (RESERVED): Reserved - * |[31:26] |ResValid |Resume Validation Period (ResValid) - * | | |This field is effective only when DCFG.Ena32 kHzSusp is set - * | | |It controls the resume period when the core resumes from suspend - * | | |The core counts for ResValid number of clock cycles to detect a valid resume when this bit is set - * @var HSUSBD_T::DCTL - * Offset: 0x804 Device Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RmtWkUpSig|Remote Wakeup Signaling (RmtWkUpSig) - * | | |When the application sets this bit, the core initiates remote signaling to wake up the USB host - * | | |The application must Set this bit to instruct the core to exit the Suspend state - * | | |As specified in the USB 2.0 specification, the application must clear this bit 1-15 ms after setting it. - * | | |If LPM is enabled and the core is in the L1 (Sleep) state, when the application sets this bit, the core initiates L1 remote signaling to wake up the USB host - * | | |The application must set this bit to instruct the core to exit the Sleep state - * | | |As specified in the LPM specification, the hardware automatically clears this bit 50 microseconds (TL1DevDrvResume) after being set by the application - * | | |The application must not set this bit when GLPMCFG bRemoteWake from the previous LPM transaction is zero. - * | | |Values: - * | | |0x0 (DISABLEDRMWKUP): Core does not send Remote Wakeup Signaling - * | | |0x1 (ENABLERMWKUP): Core sends Remote Wakeup Signaling - * |[1] |SftDiscon |Soft Disconnect (SftDiscon) - * | | |The application uses this bit to signal the controller to do a soft disconnect - * | | |As long as this bit is set, the host does not see that the device is connected, and the device does not receive signals on the USB - * | | |The core stays in the disconnected state until the application clears this bit. - * | | |1'b0: Normal operation - * | | |When this bit is cleared after a soft disconnect, the core drives the phy_opmode_o signal on the UTMI+ to 2'b00, which generates a device connect event to the USB host - * | | |When the device is reconnected, the USB host restarts device enumeration. - * | | |1'b1: The core drives the phy_opmode_o signal on the UTMI+ to 2'b01, which generates a device disconnect event to the USB host. - * | | |Note: - * | | |This bit can be also used for ULPI/FS Serial interfaces. - * | | |This bit is not impacted by a soft reset. - * | | |Values: - * | | |0x0 (NODISCONNECT): The core drives the phy_opmode_o signal on the UTMI+ to 2'b00, which generates a device connect event to the USB host - * | | |0x1 (DISCONNECT): The core drives the phy_opmode_o signal on the UTMI+ to 2'b01, which generates a device disconnect event to the USB host - * |[2] |GNPINNakSts|Global Non-periodic IN NAK Status (GNPINNakSts) (Read only) - * | | |1'b0: A handshake is sent out based on the data availability in the transmit FIFO. - * | | |1'b1: A NAK handshake is sent out on all non-periodic IN endpoints, irrespective of the data availability in the transmit FIFO. - * | | |Values: - * | | |0x0 (INACTIVE): A handshake is sent out based on the data availability in the transmit FIFO - * | | |0x1 (ACTIVE): A NAK handshake is sent out on all non-periodic IN endpoints, irrespective of the data availability in the transmit FIFO - * |[3] |GOUTNakSts|Global OUT NAK Status (GOUTNakSts) (Read only) - * | | |1'b0: A handshake is sent based on the FIFO Status and the NAK and STALL bit settings. - * | | |1'b1: No data is written to the RxFIFO, irrespective of space availability - * | | |Sends a NAK handshake on all packets, except on SETUP transactions - * | | |All isochronous OUT packets are dropped. - * | | |Values: - * | | |0x0 (INACTIVE): A handshake is sent based on the FIFO Status and the NAK and STALL bit settings. - * | | |0x1 (ACTIVE): No data is written to the RxFIFO, irrespective of space availability - * | | |Sends a NAK handshake on all packets, except on SETUP transactions - * | | |All isochronous OUT packets are dropped - * |[6:4] |TstCtl |Test Control (TstCtl) - * | | |3'b000: Test mode disabled - * | | |3'b001: Test_J mode - * | | |3'b010: Test_K mode - * | | |3'b011: Test_SE0_NAK mode - * | | |3'b100: Test_Packet mode - * | | |3'b101: Test_Force_Enable - * | | |Others: Reserved - * | | |Values: - * | | |0x0 (DISABLED): Test mode disabled - * | | |0x1 (TESTJ): Test_J mode - * | | |0x2 (TESTK): Test_K mode - * | | |0x3 (TESTSN): Test_SE0_NAK mode - * | | |0x4 (TESTPM): Test_Packet mode - * | | |0x5 (TESTFE): Test_force_Enable - * |[7] |SGNPInNak |Set Global Non-periodic IN NAK (SGNPInNak) - * | | |A write to this field sets the Global Non-periodic IN NAK.The application uses this bit to send a NAK handshake on all non-periodic IN endpoints - * | | |The application must Set this bit only after making sure that the Global IN NAK Effective bit in the Core Interrupt Register (GINTSTS.GINNakEff) is cleared - * | | |Values: - * | | |0x0 (DISABLE): Disable Global Non-periodic IN NAK - * | | |0x1 (ENABLE): Set Global Non-periodic IN NAK - * |[8] |CGNPInNak |Clear Global Non-periodic IN NAK (CGNPInNak) - * | | |A write to this field clears the Global Non-periodic IN NAK. - * | | |Values: - * | | |0x0 (DISABLE): Disable Global Non-periodic IN NAK - * | | |0x1 (ENABLE): Clear Global Non-periodic IN NAK - * |[9] |SGOUTNak |Set Global OUT NAK (SGOUTNak) - * | | |A write to this field sets the Global OUT NAK - * | | |The application uses this bit to send a NAK handshake on all OUT endpoints - * | | |The application must set the this bit only after making sure that the Global OUT NAK Effective bit in the Core Interrupt Register (GINTSTS.GOUTNakEff) is cleared. - * | | |Values: - * | | |0x0 (DISABLED): Disable Global OUT NAK - * | | |0x1 (ENABLED): Set Global OUT NAK - * |[10] |CGOUTNak |Clear Global OUT NAK (CGOUTNak) - * | | |A write to this field clears the Global OUT NAK. - * | | |Values: - * | | |0x0 (DISABLED): Disable Clear Global OUT NAK - * | | |0x1 (ENABLED): Clear Global OUT NAK - * |[11] |PWROnPrgDone|Power-On Programming Done (PWROnPrgDone) - * | | |The application uses this bit to indicate that register programming is completed after a wake-up from Power-down mode. - * | | |Values: - * | | |0x0 (NOTDONE): Power-On Programming not done - * | | |0x1 (DONE): Power-On Programming Done - * |[14:13] |GMC |Global Multi Count (GMC) - * | | |GMC must be programmed only once after initialization - * | | |Applicable only for Scatter/Gather DMA mode - * | | |This indicates the number of packets to be serviced for that end point before moving to the next end point - * | | |It is only for non-periodic endpoints. - * | | |2'b00: Invalid. - * | | |2'b01: 1 packet. - * | | |2'b10: 2 packets. - * | | |2'b11: 3 packets. - * | | |Values: - * | | |0x0 (NOTVALID): Invalid - * | | |0x1 (ONEPACKET): 1 packet - * | | |0x2 (TWOPACKET): 2 packets - * | | |0x3 (THREEPACKET): 3 packets - * |[15] |IgnrFrmNum|Ignore Frame Number Feature for Isochronous Endpoints (IgnrFrmNum) - * | | |Note: Do not program IgnrFrmNum bit to 1'b1 when the core is operating in threshold mode. - * | | |Note: When Scatter/Gather DMA mode is enabled this feature is not applicable to High Speed, High bandwidth transfers. - * | | |When this bit is enabled, there must be only one packet per descriptor. - * | | |0: The core transmits the packets only in the frame number in which they are intended to be transmitted. - * | | |1: The core ignores the frame number, sending packets immediately as the packets are ready. - * | | |In Scatter/Gather DMA mode, if this bit is enabled, the packets are not flushed when a ISOC IN token is received for an elapsed frame. - * | | |Values: - * | | |0x0 (DISABLED): The core transmits the packets only in the frame number in which they are intended to be transmitted. - * | | |0x1 (ENABLED): The core ignores the frame number, sending packets immediately as the packets are ready - * |[16] |NakOnBble |NAK on Babble Error (NakOnBble) - * | | |Set NAK automatically on babble (NakOnBble) - * | | |The core sets NAK automatically for the endpoint on which babble is received. - * | | |Values: - * | | |0x0 (DISABLED): Disable NAK on Babble Error - * | | |0x1 (ENABLED): NAK on Babble Error - * |[17] |EnContOnBNA|Enable Continue on BNA (EnContOnBNA) - * | | |This bit enables the core to continue on BNA for Bulk OUT endpoints - * | | |With this feature enabled, when a Bulk OUT or INTR OUT endpoint receives a BNA interrupt the core starts processing the descriptor that caused the BNA interrupt after the endpoint re-enables the endpoint. - * | | |1'b0: After receiving BNA interrupt,the core disables the endpoint - * | | |When the endpoint is re-enabled by the application, the core starts processing from the DOEPDMA descriptor. - * | | |1'b1: After receiving BNA interrupt, the core disables the endpoint - * | | |When the endpoint is re-enabled by the application, the core starts processing from the descriptor that received the BNA interrupt. - * | | |It is a one-time programmable after reset bit like any other DCTL register bits. - * | | |Values: - * | | |0x0 (DISABLED): Core disables the endpoint after receiving BNA interrupt - * | | |When application re-enables the endpoint, core starts processing from the DOEPDMA descriptor - * | | |0x1 (ENABLED): Core disables the endpoint after receiving BNA interrupt - * | | |When application re-enables the endpoint, core starts processing from the descriptor that received the BNA interrupt - * |[18] |DeepSleepBESLReject|DeepSleepBESLReject - * | | |1: Deep Sleep BESL Reject feature is enabled - * | | |0: Deep Sleep BESL Reject feature is disabled - * | | |Core rejects LPM request with HIRD value greater than HIRD threshold programmed - * | | |NYET response is sent for LPM tokens with HIRD value greater than HIRD threshold - * | | |By default, the Deep Sleep BESL Reject feature is disabled. - * | | |Values: - * | | |0x0 (DISABLED): Deep Sleep BESL Reject feature is disabled - * | | |0x1 (ENABLED): Deep Sleep BESL Reject feature is enabled - * |[19] |ServInt |Service Interval based scheduling for Isochronous IN Endpoints - * | | |Note: This bit is applicable only in device mode and when Scatter/Gather DMA mode is used - * | | |This feature should not be enabled along with DCTL.IgnrFrmNum. - * | | |When this bit is enabled, the frame number field in the ISOC IN descriptor structure is interpreted as the last frame of the service interval - * | | |In Scatter/Gather DMA mode, if this bit is enabled, the pending packets are flushed by the controller at the last frame of the service interval. - * | | |Values: - * | | |0x0 (DISABLED): The controller behavior depends on DCTL.IgnrFrmNum field. - * | | |0x1 (ENABLED): The controller can transmit the packets in any frame of the service interval. - * @var HSUSBD_T::DSTS - * Offset: 0x808 Device Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SuspSts |Suspend Status (SuspSts) - * | | |In Device mode, this bit is set as long as a Suspend condition is detected on the USB - * | | |The core enters the Suspend state when there is no activity on the phy_line_state_i signal for an extended period of time - * | | |The core comes out of the suspend under the following conditions : - * | | |If there is any activity on the phy_line_state_i signal, or - * | | |If the application writes to the Remote Wakeup Signaling bit in the Device Control register (DCTL.RmtWkUpSig). - * | | |When the core comes out of the suspend, this bit is set to 1'b0. - * | | |Values: - * | | |0x0 (INACTIVE): No suspend state - * | | |0x1 (ACTIVE): Suspend state - * |[2:1] |EnumSpd |Enumerated Speed (EnumSpd) - * | | |Indicates the speed at which the controller has come up after speed detection through a connect or reset sequence. - * | | |2'b00: High speed - * | | |2'b01: Full speed - * | | |Values: - * | | |0x0 (HS3060): High speed - * | | |0x1 (FS3060): Full speed - * | | |0x2 (Reserved0): Reserved - * | | |0x3 (Reserved1): Reserved - * |[3] |ErrticErr |Erratic Error (ErrticErr) - * | | |The core sets this bit to report any erratic errors (phy_rxvalid_i/phy_rxvldh_i or phy_rxactive_i is asserted for at least 2 ms, due to PHY error) - * | | |Due to erratic errors, the core goes into Suspended state and an interrupt is generated to the application with Early Suspend bit of the Core Interrupt register (GINTSTS.ErlySusp) - * | | |If the early suspend is asserted due to an erratic error, the application can only perform a soft disconnect recover. - * | | |Values: - * | | |0x0 (INACTIVE): No Erratic Error - * | | |0x1 (ACTIVE): Erratic Error - * |[21:8] |SOFFN |Frame or Microframe Number of the Received SOF (SOFFN) - * | | |When the core is operating at high speed, this field contains a microframe number - * | | |When the core is operating at full or low speed, this field contains a Frame number. - * | | |Note: This register may return a non-zero value if read immediately after power-on reset - * | | |In case the register bit reads non-zero immediately after power-on reset, it does not indicate that SOF has been received from the host - * | | |The read value of this interrupt is valid only after a valid connection between host and device is established. - * |[23:22] |DevLnSts |Device Line Status (DevLnSts) - * | | |Indicates the current logic level USB data lines - * | | |DevLnSts[1]: Logic level of D+ - * | | |DevLnSts[0]: Logic level of D- - * @var HSUSBD_T::DIEPMSK - * Offset: 0x810 Device IN Endpoint Common Interrupt Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |XferComplMsk|Transfer Completed Interrupt Mask (XferComplMsk) - * | | |Values: - * | | |0x0 (MASK): Mask Transfer Completed Interrupt - * | | |0x1 (NOMASK): No Transfer Completed Interrupt Mask - * |[1] |EPDisbldMsk|Endpoint Disabled Interrupt Mask (EPDisbldMsk) - * | | |Values: - * | | |0x0 (MASK): Mask Endpoint Disabled Interrupt - * | | |0x1 (NOMASK): No Endpoint Disabled Interrupt Mask - * |[2] |AHBErrMsk |AHB Error Mask (AHBErrMsk) - * | | |Values: - * | | |0x0 (MASK): Mask AHB Error Interrupt - * | | |0x1 (NOMASK): No AHB Error Interrupt Mask - * |[3] |TimeOUTMsk|Timeout Condition Mask (TimeOUTMsk) (Non-isochronous endpoints) - * | | |Values: - * | | |0x0 (MASK): Mask Timeout Condition Interrupt - * | | |0x1 (NOMASK): No Timeout Condition Interrupt Mask - * |[4] |INTknTXFEmpMsk|IN Token Received When TxFIFO Empty Mask (INTknTXFEmpMsk) - * | | |Values: - * | | |0x0 (MASK): Mask IN Token Received When TxFIFO Empty Interrupt - * | | |0x1 (NOMASK): - * | | |No IN Token Received When TxFIFO Empty Interrupt - * |[5] |INTknEPMisMsk|IN Token received with EP Mismatch Mask (INTknEPMisMsk) - * | | |Values: - * | | |0x0 (MASK): Mask IN Token received with EP Mismatch Interrupt - * | | |0x1 (NOMASK): - * | | |No Mask IN Token received with EP Mismatch Interrupt - * |[6] |INEPNakEffMsk|IN Endpoint NAK Effective Mask (INEPNakEffMsk) - * | | |Values: - * | | |0x0 (MASK): Mask IN Endpoint NAK Effective Interrupt - * | | |0x1 (NOMASK): No IN Endpoint NAK Effective Interrupt Mask - * |[8] |TxfifoUndrnMsk|Fifo Underrun Mask (TxfifoUndrnMsk) - * | | |Values: - * | | |0x0 (MASK): Mask Fifo Underrun Interrupt - * | | |0x1 (NOMASK): No Fifo Underrun Interrupt Mask - * |[9] |BNAInIntrMsk|BNA interrupt Mask (BNAInIntrMsk) - * | | |Values: - * | | |0x0 (MASK): Mask BNA Interrupt - * | | |0x1 (NOMASK): No BNA Interrupt Mask - * |[13] |NAKMsk |NAK interrupt Mask (NAKMsk) - * | | |Values: - * | | |0x0 (MASK): Mask NAK Interrupt - * | | |0x1 (NOMASK): No Mask NAK Interrupt - * @var HSUSBD_T::DOEPMSK - * Offset: 0x814 Device OUT Endpoint Common Interrupt Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |XferComplMsk|Transfer Completed Interrupt Mask (XferComplMsk) - * | | |Values: - * | | |0x0 (MASK): Mask Transfer Completed Interrupt - * | | |0x1 (NOMASK): No Transfer Completed Interrupt Mask - * |[1] |EPDisbldMsk|Endpoint Disabled Interrupt Mask (EPDisbldMsk) - * | | |Values: - * | | |0x0 (MASK): Mask Endpoint Disabled Interrupt - * | | |0x1 (NOMASK): No Endpoint Disabled Interrupt Mask - * |[2] |AHBErrMsk |AHB Error (AHBErrMsk) - * | | |Values: - * | | |0x0 (MASK): Mask AHB Error Interrupt - * | | |0x1 (NOMASK): No AHB Error Interrupt Mask - * |[3] |SetUPMsk |SETUP Phase Done Mask (SetUPMsk) - * | | |Applies to control endpoints only. - * | | |Values: - * | | |0x0 (MASK): Mask SETUP Phase Done Interrupt - * | | |0x1 (NOMASK): No SETUP Phase Done Interrupt Mask - * |[4] |OUTTknEPdisMsk|OUT Token Received when Endpoint Disabled Mask (OUTTknEPdisMsk) - * | | |Applies to control OUT endpoints only. - * | | |Values: - * | | |0x0 (MASK): - * | | |Mask OUT Token Received when Endpoint Disabled Interrupt - * | | |0x1 (NOMASK): - * | | |No OUT Token Received when Endpoint Disabled Interrupt Mask - * |[5] |StsPhseRcvdMsk|Status Phase Received Mask (StsPhseRcvdMsk) - * | | |Applies to control OUT endpoints only. - * | | |Values: - * | | |0x0 (MASK): Status Phase Received Mask - * | | |0x1 (NOMASK): No Status Phase Received Mask - * |[6] |Back2BackSETup|Back-to-Back SETUP Packets Received Mask (Back2BackSETup) - * | | |Applies to control OUT endpoints only. - * | | |Values: - * | | |0x0 (MASK): Mask Back-to-Back SETUP Packets Received Interrupt - * | | |0x1 (NOMASK): - * | | |No Back-to-Back SETUP Packets Received Interrupt Mask - * |[8] |OutPktErrMsk|OUT Packet Error Mask (OutPktErrMsk) - * | | |Values: - * | | |0x0 (MASK): Mask OUT Packet Error Interrupt - * | | |0x1 (NOMASK): No OUT Packet Error Interrupt Mask - * |[9] |BnaOutIntrMsk|BNA interrupt Mask (BnaOutIntrMsk) - * | | |Values: - * | | |0x0 (MASK): Mask BNA Interrupt - * | | |0x1 (NOMASK): No BNA Interrupt Mask - * |[12] |BbleErrMsk|Babble Error interrupt Mask (BbleErrMsk) - * | | |Values: - * | | |0x0 (MASK): Mask Babble Error Interrupt - * | | |0x1 (NOMASK): No Babble Error Interrupt Mask - * |[13] |NAKMsk |NAK interrupt Mask (NAKMsk) - * | | |Values: - * | | |0x0 (MASK): Mask NAK Interrupt - * | | |0x1 (NOMASK): No NAK Interrupt Mask - * |[14] |NYETMsk |NYET interrupt Mask (NYETMsk) - * | | |Values: - * | | |0x0 (MASK): Mask NYET Interrupt - * | | |0x1 (NOMASK): No NYET Interrupt Mask - * @var HSUSBD_T::DAINT - * Offset: 0x818 Device All Endpoints Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |InEpInt0 |IN Endpoint 0 Interrupt Bit - * | | |Values: - * | | |0x0 (INACTIVE): No Interrupt - * | | |0x1 (ACTIVE): IN Endpoint 0 Interrupt - * |[1] |InEpInt1 |IN Endpoint 1 Interrupt Bit - * |[2] |InEpInt2 |IN Endpoint 2 Interrupt Bit - * |[3] |InEpInt3 |IN Endpoint 3 Interrupt Bit - * |[4] |InEpInt4 |IN Endpoint 4 Interrupt Bit - * |[5] |InEpInt5 |IN Endpoint 5 Interrupt Bit - * |[6] |InEpInt6 |IN Endpoint 6 Interrupt Bit - * |[7] |InEpInt7 |IN Endpoint 7 Interrupt Bit - * |[8] |InEpInt8 |IN Endpoint 8 Interrupt Bit - * |[16] |OutEPInt0 |OUT Endpoint 0 Interrupt Bit - * | | |Values: - * | | |0x0 (INACTIVE): No Interrupt - * | | |0x1 (ACTIVE): OUT Endpoint 0 Interrupt - * |[17] |OutEPInt1 |OUT Endpoint 1 Interrupt Bit - * |[18] |OutEPInt2 |OUT Endpoint 2 Interrupt Bit - * |[19] |OutEPInt3 |OUT Endpoint 3 Interrupt Bit - * |[20] |OutEPInt4 |OUT Endpoint 4 Interrupt Bit - * |[21] |OutEPInt5 |OUT Endpoint 5 Interrupt Bit - * |[22] |OutEPInt6 |OUT Endpoint 6 Interrupt Bit - * |[23] |OutEPInt7 |OUT Endpoint 7 Interrupt Bit - * |[24] |OutEPInt8 |OUT Endpoint 8 Interrupt Bit - * @var HSUSBD_T::DAINTMSK - * Offset: 0x81C Device All Endpoints Interrupt Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |InEpMsk0 |IN Endpoint 0 Interrupt mask Bit - * | | |Values: - * | | |0x0 (MASK): IN Endpoint 0 Interrupt mask - * | | |0x1 (NOMASK): No Interrupt mask - * |[1] |InEpMsk1 |IN Endpoint 1 Interrupt mask Bit - * |[2] |InEpMsk2 |IN Endpoint 2 Interrupt mask Bit - * |[3] |InEpMsk3 |IN Endpoint 3 Interrupt mask Bit - * |[4] |InEpMsk4 |IN Endpoint 4 Interrupt mask Bit - * |[5] |InEpMsk5 |IN Endpoint 5 Interrupt mask Bit - * |[6] |InEpMsk6 |IN Endpoint 6 Interrupt mask Bit - * |[7] |InEpMsk7 |IN Endpoint 7 Interrupt mask Bit - * |[8] |InEpMsk8 |IN Endpoint 8 Interrupt mask Bit - * |[16] |OutEPMsk0 |OUT Endpoint 0 Interrupt mask Bit - * | | |Values: - * | | |0x0 (MASK): OUT Endpoint 0 Interrupt mask - * | | |0x1 (NOMASK): No Interrupt mask - * |[17] |OutEPMsk1 |OUT Endpoint 1 Interrupt mask Bit - * |[18] |OutEPMsk2 |OUT Endpoint 2 Interrupt mask Bit - * |[19] |OutEPMsk3 |OUT Endpoint 3 Interrupt mask Bit - * |[20] |OutEPMsk4 |OUT Endpoint 4 Interrupt mask Bit - * |[21] |OutEPMsk5 |OUT Endpoint 5 Interrupt mask Bit - * |[22] |OutEPMsk6 |OUT Endpoint 6 Interrupt mask Bit - * |[23] |OutEPMsk7 |OUT Endpoint 7 Interrupt mask Bit - * |[24] |OutEPMsk8 |OUT Endpoint 8 Interrupt mask Bit - * @var HSUSBD_T::DTHRCTL - * Offset: 0x830 Device Threshold Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |NonISOThrEn|Non-ISO IN Endpoints Threshold Enable (NonISOThrEn) - * | | |When this bit is Set, the core enables thresholding for Non Isochronous IN endpoints. - * | | |Values: - * | | |0x0 (DISABLED): No thresholding - * | | |0x1 (ENABLED): Enable thresholding for non-isochronous IN endpoints - * |[1] |ISOThrEn |ISO IN Endpoints Threshold Enable (ISOThrEn) - * | | |When this bit is Set, the core enables thresholding for isochronous IN endpoints. - * | | |Values: - * | | |0x0 (DISABLED): No thresholding - * | | |0x1 (ENABLED): Enables thresholding for isochronous IN endpoints - * |[10:2] |TxThrLen |Transmit Threshold Length (TxThrLen) - * | | |This field specifies Transmit thresholding size in DWORDS - * | | |This also forms the MAC threshold and specifies the amount of data in bytes to be in the corresponding endpoint transmit FIFO, before the core can start transmit on the USB - * | | |The threshold length has to be at least eight DWORDS when the value of AHBThrRatio is 2'h00 - * | | |In case the AHBThrRatio is non zero the application needs to ensure that the AHB Threshold value does not go below the recommended eight DWORD - * | | |This field controls both isochronous and non-isochronous IN endpoint thresholds - * | | |The recommended value for ThrLen is to be the same as the programmed AHB Burst Length (GAHBCFG.HBstLen). - * | | |Note: - * | | |When OTG_ARCHITECTURE=2, the reset value of this register field is 8. - * |[12:11] |AHBThrRatio|AHB Threshold Ratio (AHBThrRatio) - * | | |These bits define the ratio between the AHB threshold and the MAC threshold for the transmit path only - * | | |The AHB threshold always remains less than or equal to the USB threshold, because this does not increase overhead - * | | |Both the AHB and the MAC threshold must be DWORD-aligned - * | | |The application needs to program TxThrLen and the AHBThrRatio to make the AHB Threshold value DWORD aligned - * | | |If the AHB threshold value is not DWORD aligned, the core might not behave correctly - * | | |When programming the TxThrLen and AHBThrRatio, the application must ensure that the minimum AHB threshold value does not go below 8 DWORDS to meet the USB turnaround time requirements. - * | | |2'b00: AHB threshold = MAC threshold. - * | | |2'b01: AHB threshold = MAC threshold / 2. - * | | |2'b10: AHB threshold = MAC threshold / 4. - * | | |2'b11: AHB threshold = MAC threshold / 8. - * | | |Values: - * | | |0x0 (THRESZERO): AHB threshold = MAC threshold. - * | | |0x1 (THRESONE): AHB threshold = MAC threshold /2. - * | | |0x2 (THRESTWO): AHB threshold = MAC threshold /4. - * | | |0x3 (THRESTHREE): AHB threshold = MAC threshold /8. - * |[16] |RxThrEn |Receive Threshold Enable (RxThrEn) - * | | |When this bit is set, the core enables thresholding in the receive direction. - * | | |Note: We recommends that you do not enable RxThrEn, because it may cause issues in the RxFIFO especially during error conditions such as RxError and Babble. - * | | |Values: - * | | |0x0 (DISABLED): Disable thresholding - * | | |0x1 (ENABLED): Enable thresholding in the receive direction - * |[25:17] |RxThrLen |Receive Threshold Length (RxThrLen) - * | | |This field specifies Receive thresholding size in DWORDS - * | | |This field also specifies the amount of data received on the USB before the core can start transmitting on the AHB - * | | |The threshold length has to be at least eight DWORDS - * | | |The recommended value for ThrLen is to be the same as the programmed AHB Burst Length (GAHBCFG.HBstLen). - * |[27] |ArbPrkEn |Arbiter Parking Enable (ArbPrkEn) - * | | |This bit controls internal DMA arbiter parking for IN endpoints - * | | |If thresholding is enabled and this bit is set to one, then the arbiter parks on the IN endpoint for which there is a token received on the USB - * | | |This is done to avoid getting into underrun conditions - * | | |By default, arbiter parking is enabled. - * | | |Values: - * | | |0x0 (DISABLED): Disable DMA arbiter parking - * | | |0x1 (ENABLED): Enable DMA arbiter parking for IN endpoints - * @var HSUSBD_T::DIEPEMPMSK - * Offset: 0x834 Device IN Endpoint FIFO Empty Interrupt Mask Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |InEpTxfEmpMsk|IN EP Tx FIFO Empty Interrupt Mask Bits (InEpTxfEmpMsk) - * | | |These bits acts as mask bits for DIEPINTn.TxFEmp interrupt, one bit per IN Endpoint: - * | | |Bit 0 for IN EP 0, bit 8 for IN EP 8 - * | | |Values: - * | | |0x1 (EP0_MASK): Mask IN EP0 Tx FIFO Empty Interrupt - * | | |0x2 (EP1_MASK): Mask IN EP1 Tx FIFO Empty Interrupt - * | | |0x4 (EP2_MASK): Mask IN EP2 Tx FIFO Empty Interrupt - * | | |0x8 (EP3_MASK): Mask IN EP3 Tx FIFO Empty Interrupt - * | | |0x10 (EP4_MASK): Mask IN EP4 Tx FIFO Empty Interrupt - * | | |0x20 (EP5_MASK): Mask IN EP5 Tx FIFO Empty Interrupt - * | | |0x40 (EP6_MASK): Mask IN EP6 Tx FIFO Empty Interrupt - * | | |0x80 (EP7_MASK): Mask IN EP7 Tx FIFO Empty Interrupt - * | | |0x100 (EP8_MASK): Mask IN EP8 Tx FIFO Empty Interrupt - * @var HSUSBD_T::DIEPCTL0 - * Offset: 0x900 Device Control IN Endpoint 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |MPS |Maximum Packet Size (MPS) - * | | |Applies to IN and OUT endpoints. - * | | |The application must program this field with the maximum packet size for the current logical endpoint. - * | | |2'b00: 64 bytes - * | | |2'b01: 32 bytes - * | | |2'b10: 16 bytes - * | | |2'b11: 8 bytes - * | | |Values: - * | | |0x0 (BYTES64): 64 bytes - * | | |0x1 (BYTES32): 32 bytes - * | | |0x2 (BYTES16): 16 bytes - * | | |0x3 (BYTES8): 8 bytes - * |[15] |USBActEP |USB Active Endpoint (USBActEP) (Read only) - * | | |This bit is always SET to 1, indicating that control endpoint 0 is always active in all configurations and interfaces. - * | | |Values: - * | | |0x1 (ACTIVE0): Control endpoint is always active - * |[17] |NAKSts |NAK Status (NAKSts) (Read only) - * | | |Indicates the following: - * | | |1'b0: The core is transmitting non-NAK handshakes based on the FIFO status - * | | |1'b1: The core is transmitting NAK handshakes on this endpoint. - * | | |When this bit is set, either by the application or core, the core stops transmitting data, even If there is data available in the TxFIFO - * | | |Irrespective of this bit's setting, the core always responds to SETUP data packets with an ACK handshake. - * | | |Values: - * | | |0x0 (INACTIVE): - * | | |The core is transmitting non-NAK handshakes based on the FIFO status - * | | |0x1 (ACTIVE): - * | | |The core is transmitting NAK handshakes on this endpoint - * |[19:18] |EPType |Endpoint Type (EPType) (Read only) - * | | |Hardcoded to 00 for control. - * | | |Values: - * | | |0x0 (ACTIVE): Endpoint Control 0 - * |[21] |Stall |STALL Handshake (Stall) - * | | |The application can only set this bit, and the core clears it, when a SETUP token is received for this endpoint - * | | |If a NAK bit, Global Nonperiodic IN NAK, or Global OUT NAK is set along with this bit, the STALL bit takes priority. - * | | |Values: - * | | |0x0 (INACTIVE): No Stall - * | | |0x1 (ACTIVE): Stall Handshake - * |[25:22] |TxFNum |TxFIFO Number (TxFNum) - * | | |For Dedicated FIFO operation, this value is set to the FIFO number that is assigned to IN Endpoint. - * | | |Values: - * | | |0x0 (TXFIFO0): Tx FIFO 0 - * | | |0x1 (TXFIFO1): Tx FIFO 1 - * | | |0x2 (TXFIFO2): Tx FIFO 2 - * | | |0x3 (TXFIFO3): Tx FIFO 3 - * | | |0x4 (TXFIFO4): Tx FIFO 4 - * | | |0x5 (TXFIFO5): Tx FIFO 5 - * | | |0x6 (TXFIFO6): Tx FIFO 6 - * | | |0x7 (TXFIFO7): Tx FIFO 7 - * | | |0x8 (TXFIFO8): Tx FIFO 8 - * |[26] |CNAK |Clear NAK (CNAK) - * | | |A write to this bit clears the NAK bit for the endpoint - * | | |Values: - * | | |0x0 (NOCLEAR): No action - * | | |0x1 (CLEAR): Clear NAK - * |[27] |SNAK |Set NAK (SNAK - * | | |) A write to this bit sets the NAK bit for the endpoint Using this bit, the application can control the transmission of NAK handshakes on an endpoint The core can also set this bit for an endpoint after a SETUP packet is received on that endpoint - * | | |Values: - * | | |0x0 (NOSET): No action - * | | |0x1 (SET): Set NAK - * |[30] |EPDis |Endpoint Disable (EPDis) - * | | |The application sets this bit to stop transmitting data on an endpoint, even before the transfer for that endpoint is complete - * | | |The application must wait for the Endpoint Disabled interrupt before treating the endpoint as disabled - * | | |The core clears this bit before setting the Endpoint Disabled Interrupt - * | | |The application must Set this bit only if Endpoint Enable is already set for this endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No action - * | | |0x1 (ACTIVE): Disabled Endpoint - * |[31] |EPEna |Endpoint Enable (EPEna) - * | | |When Scatter/Gather DMA mode is enabled for IN endpoints, this bit indicates that the descriptor structure and data buffer with data ready to transmit is setup. - * | | |Values: - * | | |0x0 (INACTIVE): No action - * | | |0x1 (ACTIVE): Enable Endpoint - * @var HSUSBD_T::DIEPINT0 - * Offset: 0x908 Device IN Endpoint 0 Interrupt Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |XferCompl |Transfer Completed Interrupt (XferCompl) - * | | |Applies to IN and OUT endpoints. - * | | |When Scatter/Gather DMA mode is enabled - * | | |For IN endpoint this field indicates that the requested data from the descriptor is moved from external system memory to internal FIFO. - * | | |For OUT endpoint this field indicates that the requested data from the internal FIFO is moved to external system memory - * | | |This interrupt is generated only when the corresponding endpoint descriptor is closed, and the IOC bit for the corresponding descriptor is set. - * | | |Values: - * | | |0x0 (INACTIVE): No Transfer Complete Interrupt - * | | |0x1 (ACTIVE): Transfer Completed Interrupt - * |[1] |EPDisbld |Endpoint Disabled Interrupt (EPDisbld) - * | | |Applies to IN and OUT endpoints. - * | | |This bit indicates that the endpoint is disabled per the application's request. - * | | |Values: - * | | |0x0 (INACTIVE): No Endpoint Disabled Interrupt - * | | |0x1 (ACTIVE): Endpoint Disabled Interrupt - * |[2] |AHBErr |AHB Error (AHBErr) - * | | |Applies to IN and OUT endpoints. - * | | |When there is an AHB error during an AHB read/write - * | | |The application can read the corresponding endpoint DMA address register to get the error address. - * | | |Values: - * | | |0x0 (INACTIVE): No AHB Error Interrupt - * | | |0x1 (ACTIVE): AHB Error interrupt - * |[4] |INTknTXFEmp|IN Token Received When TxFIFO is Empty (INTknTXFEmp) - * | | |Applies to non-periodic IN endpoints only. - * | | |Indicates that an IN token was received when the associated TxFIFO (periodic/non-periodic) was empty - * | | |This interrupt is asserted on the endpoint for which the IN token was received. - * | | |Values: - * | | |0x0 (INACTIVE): No IN Token Received when TxFIFO Empty interrupt - * | | |0x1 (ACTIVE): IN Token Received when TxFIFO Empty Interrupt - * |[5] |INTknEPMis|IN Token Received with EP Mismatch (INTknEPMis) - * | | |Applies to non-periodic IN endpoints only. - * | | |Indicates that the data in the top of the non-periodic TxFIFO belongs to an endpoint other than the one for which the IN token was received - * | | |This interrupt is asserted on the endpoint for which the IN token was received. - * | | |Values: - * | | |0x0 (INACTIVE): No IN Token Received with EP Mismatch interrupt - * | | |0x1 (ACTIVE): IN Token Received with EP Mismatch interrupt - * |[6] |INEPNakEff|IN Endpoint NAK Effective (INEPNakEff) - * | | |Applies to periodic IN endpoints only. - * | | |This bit can be cleared when the application clears the IN endpoint NAK by writing to DIEPCTLn.CNAK. - * | | |This interrupt indicates that the core has sampled the NAK bit - * | | |Set (either by the application or by the core). - * | | |The interrupt indicates that the IN endpoint NAK bit Set by the application has taken effect in the core. - * | | |This interrupt does not guarantee that a NAK handshake is sent on the USB - * | | |A STALL bit takes priority over a NAK bit. - * | | |Values: - * | | |0x0 (INACTIVE): No IN Endpoint NAK Effective interrupt - * | | |0x1 (ACTIVE): IN Endpoint NAK Effective interrupt - * |[7] |TxFEmp |Transmit FIFO Empty (TxFEmp) (Read only) - * | | |This bit is valid only for IN Endpoints - * | | |This interrupt is asserted when the TxFIFO for this endpoint is either half or completely empty - * | | |The half or completely empty status is determined by the TxFIFO Empty Level bit in the Core AHB Configuration register (GAHBCFG.NPTxFEmpLvl)). - * | | |Values: - * | | |0x0 (INACTIVE): No Transmit FIFO Empty interrupt - * | | |0x1 (ACTIVE): Transmit FIFO Empty interrupt - * |[8] |TxfifoUndrn|Fifo Underrun (TxfifoUndrn) - * | | |Applies to IN endpoints only. - * | | |The core generates this interrupt when it detects a transmit FIFO underrun condition in threshold mode for this endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No Fifo Underrun interrupt - * | | |0x1 (ACTIVE): Fifo Underrun interrupt - * |[9] |BNAIntr |BNA (Buffer Not Available) Interrupt (BNAIntr) - * | | |The core generates this interrupt when the descriptor accessed is not ready for the Core to process, such as DMA done. - * | | |Values: - * | | |0x0 (INACTIVE): No BNA interrupt - * | | |0x1 (ACTIVE): BNA interrupt - * |[12] |BbleErr |NAK Interrupt (BbleErr) - * | | |The core generates this interrupt when babble is received for the endpoint. - * | | |Values: - * | | |0x0 (INACTIVE): No interrupt - * | | |0x1 (ACTIVE): BbleErr interrupt - * |[13] |NAKIntrpt |NAK Interrupt (NAKInterrupt) - * | | |The core generates this interrupt when a NAK is transmitted or received by the device - * | | |= 1). - * | | |F_MCLK = F_I2SCLK (When MCLKDIV is set to 0). - * | | |Note: F_MCLK is the frequency of MCLK, and F_I2SCLK is the frequency of the I2S_CLK - * |[17:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode - * | | |Software can program these bit fields to generate sampling rate clock frequency. - * | | |F_BCLK= F_I2SCLK / (2*(BCLKDIV + 1)). - * | | |Note: F_BCLK is the frequency of BCLK and F_I2SCLK is the frequency of I2S_CLK - * @var I2S_T::IEN - * Offset: 0x08 I2S Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXUDFIEN |Receive FIFO Underflow Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: If software reads receive FIFO when it is empty then RXUDIF (I2S_STATUS0[8]) flag is set to 1 - * | | |If RXUDFIEN bit is enabled, interrupt occurs. - * |[1] |RXOVFIEN |Receive FIFO Overflow Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and RXOVIF (I2S_STATUS0[9]) flag is set to 1 - * |[2] |RXTHIEN |Receive FIFO Threshold Level Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and data words in receive FIFO is larger than RXTH (I2S_CTL1[19:16]). - * |[8] |TXUDFIEN |Transmit FIFO Underflow Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occur if this bit is set to 1 and TXUDIF (I2S_STATUS0[16]) flag is set to 1. - * |[9] |TXOVFIEN |Transmit FIFO Overflow Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and TXOVIF (I2S_STATUS0[17]) flag is set to 1 - * |[10] |TXTHIEN |Transmit FIFO Threshold Level Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note: Interrupt occurs if this bit is set to 1 and data words in transmit FIFO is less than or equal to TXTH (I2S_CTL1[11:8]). - * |[16] |CH0ZCIEN |Channel0 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel0 zero-cross - * | | |Note 2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[17] |CH1ZCIEN |Channel1 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel1 zero-cross - * | | |Note 2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[18] |CH2ZCIEN |Channel2 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel2 zero-cross - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[19] |CH3ZCIEN |Channel3 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel3 zero-cross - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[20] |CH4ZCIEN |Channel4 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel4 zero-cross - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x2, 0x3. - * |[21] |CH5ZCIEN |Channel5 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel5 zero-cross - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x2, 0x3. - * |[22] |CH6ZCIEN |Channel6 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel6 zero-cross - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x3. - * |[23] |CH7ZCIEN |Channel7 Zero-cross Interrupt Enable Bit - * | | |0 = Interrupt Disabled. - * | | |1 = Interrupt Enabled. - * | | |Note 1: Interrupt occurs if this bit is set to 1 and channel7 zero-cross - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x3. - * @var I2S_T::STATUS0 - * Offset: 0x0C I2S Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |I2SINT |I2S Interrupt Flag (Read Only) - * | | |0 = No I2S interrupt. - * | | |1 = I2S interrupt. - * | | |Note: It is wire-OR of I2STXINT and I2SRXINT bits. - * |[1] |I2SRXINT |I2S Receive Interrupt (Read Only) - * | | |0 = No receive interrupt. - * | | |1 = Receive interrupt. - * |[2] |I2STXINT |I2S Transmit Interrupt (Read Only) - * | | |0 = No transmit interrupt. - * | | |1 = Transmit interrupt. - * |[5:3] |DATACH |Transmission Data Channel (Read Only) - * | | |This bit fields are used to indicate which audio channel is current transmit data belong. - * | | |000 = channel0 (means left channel while 2-channel I2S/PCM mode). - * | | |001 = channel1 (means right channel while 2-channel I2S/PCM mode). - * | | |010 = channel2 (available while 4-channel TDM PCM mode). - * | | |011 = channel3 (available while 4-channel TDM PCM mode). - * | | |100 = channel4 (available while 6-channel TDM PCM mode). - * | | |101 = channel5 (available while 6-channel TDM PCM mode). - * | | |110 = channel6 (available while 8-channel TDM PCM mode). - * | | |111 = channel7 (available while 8-channel TDM PCM mode). - * |[8] |RXUDIF |Receive FIFO Underflow Interrupt Flag - * | | |0 = No underflow occur. - * | | |1 = Underflow occur. - * | | |Note 1: When receive FIFO is empty, and software reads the receive FIFO again - * | | |This bit will be set to 1, and it indicates underflow situation occurs. - * | | |Note 2: Write 1 to clear this bit to 0 - * |[9] |RXOVIF |Receive FIFO Overflow Interrupt Flag - * | | |0 = No overflow occur. - * | | |1 = Overflow occur. - * | | |Note 1: When receive FIFO is full and receive hardware attempt to write data into receive FIFO then this bit is set to 1, data in 1st buffer is overwritten. - * | | |Note 2: Write 1 to clear this bit to 0. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is less than or equal to threshold level. - * | | |1 = Data word(s) in FIFO is larger than threshold level. - * | | |Note: When data word(s) in receive FIFO is larger than threshold value set in RXTH (I2S_CTL1[19:16]) the RXTHIF bit becomes to 1 - * | | |It keeps at 1 till RXCNT (I2S_STATUS1[20:16]) is less than or equal to RXTH (I2S_CTL1[19:16]) after software read RXFIFO register. - * |[11] |RXFULL |Receive FIFO Full (Read Only) - * | | |0 = Not full. - * | | |1 = Full. - * | | |Note: This bit reflects data words number in receive FIFO is 16. - * |[12] |RXEMPTY |Receive FIFO Empty (Read Only) - * | | |0 = Not empty. - * | | |1 = Empty. - * | | |Note: This bit reflects data words number in receive FIFO is 0. - * |[16] |TXUDIF |Transmit FIFO Underflow Interrupt Flag - * | | |0 = No underflow. - * | | |1 = Underflow. - * | | |Note 1: This bit will be set to 1 when shift logic hardware read data from transmitting FIFO and the filling data level in transmitting FIFO is not enough for one audio frame. - * | | |Note 2: Write 1 to clear this bit to 0. - * |[17] |TXOVIF |Transmit FIFO Overflow Interrupt Flag - * | | |0 = No overflow. - * | | |1 = Overflow. - * | | |Note 1: Write data to transmit FIFO when it is full and this bit set to 1 - * | | |Note 2: Write 1 to clear this bit to 0. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = Data word(s) in FIFO is larger than threshold level. - * | | |1 = Data word(s) in FIFO is less than or equal to threshold level. - * | | |Note: When data word(s) in transmit FIFO is less than or equal to threshold value set in TXTH (I2S_CTL1[11:8]) the TXTHIF bit becomes to 1 - * | | |It keeps at 1 till TXCNT (I2S_STATUS1[12:8]) is larger than TXTH (I2S_CTL1[11:8]) after software write TXFIFO register. - * |[19] |TXFULL |Transmit FIFO Full (Read Only) - * | | |This bit reflect data word number in transmit FIFO is 16 - * | | |0 = Not full. - * | | |1 = Full. - * |[20] |TXEMPTY |Transmit FIFO Empty (Read Only) - * | | |This bit reflect data word number in transmit FIFO is 0 - * | | |0 = Not empty. - * | | |1 = Empty. - * |[21] |TXBUSY |Transmit Busy (Read Only) - * | | |0 = Transmit shift buffer is empty. - * | | |1 = Transmit shift buffer is busy. - * | | |Note: This bit is cleared to 0 when all data in transmit FIFO and shift buffer is shifted out - * | | |And set to 1 when 1st data is load to shift buffer - * @var I2S_T::TXFIFO - * Offset: 0x10 I2S Transmit FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXFIFO |Transmit FIFO Bits - * | | |The I2S contains 16 words (16x32 bits) data buffer for data transmit - * | | |Write data to this register to prepare data for transmit - * | | |The remaining word number is indicated by TXCNT (I2S_STATUS1[12:8]). - * @var I2S_T::RXFIFO - * Offset: 0x14 I2S Receive FIFO Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXFIFO |Receive FIFO Bits - * | | |I2S contains 16 words (16x32 bits) data buffer for data receive - * | | |Read this register to get data in FIFO - * | | |The remaining data word number is indicated by RXCNT (I2S_STATUS1[20:16]). - * @var I2S_T::CTL1 - * Offset: 0x20 I2S Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCEN |Channel0 Zero-cross Detection Enable Bit - * | | |0 = channel0 zero-cross detect Disabled. - * | | |1 = channel0 zero-cross detect Enabled. - * | | |Note 1: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note 2: If this bit is set to 1, when channel0 data sign bit change or next shift data bits are all 0 then CH0ZCIF(I2S_STATUS1[0]) flag is set to 1. - * | | |Note 3: If CH0ZCIF flag is set to 1, the channel0 will be mute. - * |[1] |CH1ZCEN |Channel1 Zero-cross Detect Enable Bit - * | | |0 = channel1 zero-cross detect Disabled. - * | | |1 = channel1 zero-cross detect Enabled. - * | | |Note 1: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * | | |Note 2: If this bit is set to 1, when channel1 data sign bit change or next shift data bits are all 0 then CH1ZCIF(I2S_STATUS1[1]) flag is set to 1. - * | | |Note 3: If CH1ZCIF flag is set to 1, the channel1 will be mute. - * |[2] |CH2ZCEN |Channel2 Zero-cross Detect Enable Bit - * | | |0 = channel2 zero-cross detect Disabled. - * | | |1 = channel2 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel2 data sign bit change or next shift data bits are all 0 then CH2ZCIF(I2S_STATUS1[2]) flag is set to 1. - * | | |Note 3: If CH2ZCIF flag is set to 1, the channel2 will be mute. - * |[3] |CH3ZCEN |Channel3 Zero-cross Detect Enable Bit - * | | |0 = channel3 zero-cross detect Disabled. - * | | |1 = channel3 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel3 data sign bit change or next shift data bits are all 0 then CH3ZCIF(I2S_STATUS1[3]) flag is set to 1. - * | | |Note 3: If CH3ZCIF flag is set to 1, the channel3 will be mute. - * |[4] |CH4ZCEN |Channel4 Zero-cross Detect Enable Bit - * | | |0 = channel4 zero-cross detect Disabled. - * | | |1 = channel4 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel4 data sign bit change or next shift data bits are all 0 then CH4ZCIF(I2S_STATUS1[4]) flag is set to 1. - * | | |Note 3: If CH4ZCIF flag is set to 1, the channel4 will be mute. - * |[5] |CH5ZCEN |Channel5 Zero-cross Detect Enable Bit - * | | |0 = channel5 zero-cross detect Disabled. - * | | |1 = channel5 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x2, 0x3. - * | | |Note 2: If this bit is set to 1, when channel5 data sign bit change or next shift data bits are all 0 then CH5ZCIF(I2S_STATUS1[5]) flag is set to 1. - * | | |Note 3: If CH5ZCIF flag is set to 1, the channel5 will be mute. - * |[6] |CH6ZCEN |Channel6 Zero-cross Detect Enable Bit - * | | |0 = channel6 zero-cross detect Disabled. - * | | |1 = channel6 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x3. - * | | |Note 2: If this bit is set to 1, when channel6 data sign bit change or next shift data bits are all 0 then CH6ZCIF(I2S_STATUS1[6]) flag is set to 1. - * | | |Note 3: If CH6ZCIF flag is set to 1, the channel6 will be mute. - * |[7] |CH7ZCEN |Channel7 Zero-cross Detect Enable Bit - * | | |0 = channel7 zero-cross detect Disabled. - * | | |1 = channel7 zero-cross detect Enabled. - * | | |Note 1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x3. - * | | |Note 2: If this bit is set to 1, when channel7 data sign bit change or next shift data bits are all 0 then CH7ZCIF (I2S_STATUS1[7]) flag is set to 1. - * | | |Note 3: If CH7ZCIF flag is set to 1, the channel7 will be mute. - * |[11:8] |TXTH |Transmit FIFO Threshold Level - * | | |0000 = 0 data word in transmit FIFO. - * | | |0001 = 1 data word in transmit FIFO. - * | | |0010 = 2 data words in transmit FIFO. - * | | |.... - * | | |1110 = 14 data words in transmit FIFO. - * | | |1111 = 15 data words in transmit FIFO. - * | | |Note: If remain data word number in transmit FIFO is less than or equal to threshold level then TXTHIF (I2S_STATUS0[18]) flag is set. - * |[19:16] |RXTH |Receive FIFO Threshold Level - * | | |0000 = 1 data word in receive FIFO. - * | | |0001 = 2 data words in receive FIFO. - * | | |0010 = 3 data words in receive FIFO. - * | | |.... - * | | |1110 = 15 data words in receive FIFO. - * | | |1111 = 16 data words in receive FIFO. - * | | |Note: When received data word number in receive buffer is larger than threshold level then RXTHIF (I2S_STATUS0[10]) flag is set. - * |[24] |PBWIDTH |Peripheral Bus Data Width Selection - * | | |This bit is used to choice the available data width of APB bus - * | | |It must be set to 1 while PDMA function is enable and it is set to 16-bit transmission mode - * | | |0 = 32 bits data width. - * | | |1 = 16 bits data width. - * | | |Note 1: If PBWIDTH=1, the low 16 bits of 32-bit data bus are available. - * | | |Note 2: If PBWIDTH=1, the transmitting FIFO level will be increased after two FIFO write operations. - * | | |Note 3: If PBWIDTH=1, the receiving FIFO level will be decreased after two FIFO read operations. - * |[25] |PB16ORD |FIFO Read/Write Order in 16-bit Width of Peripheral Bus - * | | |When PBWIDTH = 1, the data FIFO will be increased or decreased by two peripheral bus access - * | | |This bit is used to select the order of FIFO access operations to meet the 32-bit transmitting/receiving FIFO entries. - * | | |0 = Low 16-bit read/write access first. - * | | |1 = High 16-bit read/write access first. - * | | |Note: This bit is available while PBWIDTH = 1. - * @var I2S_T::STATUS1 - * Offset: 0x24 I2S Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ZCIF |Channel0 Zero-cross Interrupt Flag - * | | |It indicates channel0 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel0. - * | | |1 = Channel0 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[1] |CH1ZCIF |Channel1 Zero-cross Interrupt Flag - * | | |It indicates channel1 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel1. - * | | |1 = Channel1 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode. - * |[2] |CH2ZCIF |Channel2 Zero-cross Interrupt Flag - * | | |It indicates channel2 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel2. - * | | |1 = Channel2 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[3] |CH3ZCIF |Channel3 Zero-cross Interrupt Flag - * | | |It indicates channel3 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel3. - * | | |1 = Channel3 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3. - * |[4] |CH4ZCIF |Channel4 Zero-cross Interrupt Flag - * | | |It indicates channel4 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel4. - * | | |1 = Channel4 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x2, 0x3. - * |[5] |CH5ZCIF |Channel5 Zero-cross Interrupt Flag - * | | |It indicates channel5 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel5. - * | | |1 = Channel5 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x2, 0x3. - * |[6] |CH6ZCIF |Channel6 Zero-cross Interrupt Flag - * | | |It indicates channel6 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel6. - * | | |1 = Channel6 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x3. - * |[7] |CH7ZCIF |Channel7 Zero-cross Interrupt Flag - * | | |It indicates channel7 next sample data sign bit is changed or all data bits are 0. - * | | |0 = No zero-cross in channel7. - * | | |1 = Channel7 zero-cross is detected. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x3. - * |[12:8] |TXCNT |Transmit FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in transmit FIFO - * | | |00000 = No data. - * | | |00001 = 1 word in transmit FIFO. - * | | |00010 = 2 words in transmit FIFO. - * | | |.... - * | | |01110 = 14 words in transmit FIFO. - * | | |01111 = 15 words in transmit FIFO. - * | | |10000 = 16 words in transmit FIFO. - * | | |Others are reserved. - * |[20:16] |RXCNT |Receive FIFO Level (Read Only) - * | | |These bits indicate the number of available entries in receive FIFO - * | | |00000 = No data. - * | | |00001 = 1 word in receive FIFO. - * | | |00010 = 2 words in receive FIFO. - * | | |.... - * | | |01110 = 14 words in receive FIFO. - * | | |01111 = 15 words in receive FIFO. - * | | |10000 = 16 words in receive FIFO. - * | | |Others are reserved. - */ - __IO uint32_t CTL0; /*!< [0x0000] I2S Control Register 0 */ - __IO uint32_t CLKDIV; /*!< [0x0004] I2S Clock Divider Register */ - __IO uint32_t IEN; /*!< [0x0008] I2S Interrupt Enable Register */ - __IO uint32_t STATUS0; /*!< [0x000c] I2S Status Register 0 */ - __O uint32_t TXFIFO; /*!< [0x0010] I2S Transmit FIFO Register */ - __I uint32_t RXFIFO; /*!< [0x0014] I2S Receive FIFO Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CTL1; /*!< [0x0020] I2S Control Register 1 */ - __IO uint32_t STATUS1; /*!< [0x0024] I2S Status Register 1 */ - -} I2S_T; - -/** - @addtogroup I2S_CONST I2S Bit Field Definition - Constant Definitions for I2S Controller -@{ */ - -#define I2S_CTL0_I2SEN_Pos (0) /*!< I2S_T::CTL0: I2SEN Position */ -#define I2S_CTL0_I2SEN_Msk (0x1ul << I2S_CTL0_I2SEN_Pos) /*!< I2S_T::CTL0: I2SEN Mask */ - -#define I2S_CTL0_TXEN_Pos (1) /*!< I2S_T::CTL0: TXEN Position */ -#define I2S_CTL0_TXEN_Msk (0x1ul << I2S_CTL0_TXEN_Pos) /*!< I2S_T::CTL0: TXEN Mask */ - -#define I2S_CTL0_RXEN_Pos (2) /*!< I2S_T::CTL0: RXEN Position */ -#define I2S_CTL0_RXEN_Msk (0x1ul << I2S_CTL0_RXEN_Pos) /*!< I2S_T::CTL0: RXEN Mask */ - -#define I2S_CTL0_MUTE_Pos (3) /*!< I2S_T::CTL0: MUTE Position */ -#define I2S_CTL0_MUTE_Msk (0x1ul << I2S_CTL0_MUTE_Pos) /*!< I2S_T::CTL0: MUTE Mask */ - -#define I2S_CTL0_DATWIDTH_Pos (4) /*!< I2S_T::CTL0: DATWIDTH Position */ -#define I2S_CTL0_DATWIDTH_Msk (0x3ul << I2S_CTL0_DATWIDTH_Pos) /*!< I2S_T::CTL0: DATWIDTH Mask */ - -#define I2S_CTL0_MONO_Pos (6) /*!< I2S_T::CTL0: MONO Position */ -#define I2S_CTL0_MONO_Msk (0x1ul << I2S_CTL0_MONO_Pos) /*!< I2S_T::CTL0: MONO Mask */ - -#define I2S_CTL0_ORDER_Pos (7) /*!< I2S_T::CTL0: ORDER Position */ -#define I2S_CTL0_ORDER_Msk (0x1ul << I2S_CTL0_ORDER_Pos) /*!< I2S_T::CTL0: ORDER Mask */ - -#define I2S_CTL0_SLAVE_Pos (8) /*!< I2S_T::CTL0: SLAVE Position */ -#define I2S_CTL0_SLAVE_Msk (0x1ul << I2S_CTL0_SLAVE_Pos) /*!< I2S_T::CTL0: SLAVE Mask */ - -#define I2S_CTL0_MCLKEN_Pos (15) /*!< I2S_T::CTL0: MCLKEN Position */ -#define I2S_CTL0_MCLKEN_Msk (0x1ul << I2S_CTL0_MCLKEN_Pos) /*!< I2S_T::CTL0: MCLKEN Mask */ - -#define I2S_CTL0_TXFBCLR_Pos (18) /*!< I2S_T::CTL0: TXFBCLR Position */ -#define I2S_CTL0_TXFBCLR_Msk (0x1ul << I2S_CTL0_TXFBCLR_Pos) /*!< I2S_T::CTL0: TXFBCLR Mask */ - -#define I2S_CTL0_RXFBCLR_Pos (19) /*!< I2S_T::CTL0: RXFBCLR Position */ -#define I2S_CTL0_RXFBCLR_Msk (0x1ul << I2S_CTL0_RXFBCLR_Pos) /*!< I2S_T::CTL0: RXFBCLR Mask */ - -#define I2S_CTL0_TXPDMAEN_Pos (20) /*!< I2S_T::CTL0: TXPDMAEN Position */ -#define I2S_CTL0_TXPDMAEN_Msk (0x1ul << I2S_CTL0_TXPDMAEN_Pos) /*!< I2S_T::CTL0: TXPDMAEN Mask */ - -#define I2S_CTL0_RXPDMAEN_Pos (21) /*!< I2S_T::CTL0: RXPDMAEN Position */ -#define I2S_CTL0_RXPDMAEN_Msk (0x1ul << I2S_CTL0_RXPDMAEN_Pos) /*!< I2S_T::CTL0: RXPDMAEN Mask */ - -#define I2S_CTL0_RXLCH_Pos (23) /*!< I2S_T::CTL0: RXLCH Position */ -#define I2S_CTL0_RXLCH_Msk (0x1ul << I2S_CTL0_RXLCH_Pos) /*!< I2S_T::CTL0: RXLCH Mask */ - -#define I2S_CTL0_FORMAT_Pos (24) /*!< I2S_T::CTL0: FORMAT Position */ -#define I2S_CTL0_FORMAT_Msk (0x7ul << I2S_CTL0_FORMAT_Pos) /*!< I2S_T::CTL0: FORMAT Mask */ - -#define I2S_CTL0_PCMSYNC_Pos (27) /*!< I2S_T::CTL0: PCMSYNC Position */ -#define I2S_CTL0_PCMSYNC_Msk (0x1ul << I2S_CTL0_PCMSYNC_Pos) /*!< I2S_T::CTL0: PCMSYNC Mask */ - -#define I2S_CTL0_CHWIDTH_Pos (28) /*!< I2S_T::CTL0: CHWIDTH Position */ -#define I2S_CTL0_CHWIDTH_Msk (0x3ul << I2S_CTL0_CHWIDTH_Pos) /*!< I2S_T::CTL0: CHWIDTH Mask */ - -#define I2S_CTL0_TDMCHNUM_Pos (30) /*!< I2S_T::CTL0: TDMCHNUM Position */ -#define I2S_CTL0_TDMCHNUM_Msk (0x3ul << I2S_CTL0_TDMCHNUM_Pos) /*!< I2S_T::CTL0: TDMCHNUM Mask */ - -#define I2S_CLKDIV_MCLKDIV_Pos (0) /*!< I2S_T::CLKDIV: MCLKDIV Position */ -#define I2S_CLKDIV_MCLKDIV_Msk (0x7ful << I2S_CLKDIV_MCLKDIV_Pos) /*!< I2S_T::CLKDIV: MCLKDIV Mask */ - -#define I2S_CLKDIV_BCLKDIV_Pos (8) /*!< I2S_T::CLKDIV: BCLKDIV Position */ -#define I2S_CLKDIV_BCLKDIV_Msk (0x3fful << I2S_CLKDIV_BCLKDIV_Pos) /*!< I2S_T::CLKDIV: BCLKDIV Mask */ - -#define I2S_IEN_RXUDFIEN_Pos (0) /*!< I2S_T::IEN: RXUDFIEN Position */ -#define I2S_IEN_RXUDFIEN_Msk (0x1ul << I2S_IEN_RXUDFIEN_Pos) /*!< I2S_T::IEN: RXUDFIEN Mask */ - -#define I2S_IEN_RXOVFIEN_Pos (1) /*!< I2S_T::IEN: RXOVFIEN Position */ -#define I2S_IEN_RXOVFIEN_Msk (0x1ul << I2S_IEN_RXOVFIEN_Pos) /*!< I2S_T::IEN: RXOVFIEN Mask */ - -#define I2S_IEN_RXTHIEN_Pos (2) /*!< I2S_T::IEN: RXTHIEN Position */ -#define I2S_IEN_RXTHIEN_Msk (0x1ul << I2S_IEN_RXTHIEN_Pos) /*!< I2S_T::IEN: RXTHIEN Mask */ - -#define I2S_IEN_TXUDFIEN_Pos (8) /*!< I2S_T::IEN: TXUDFIEN Position */ -#define I2S_IEN_TXUDFIEN_Msk (0x1ul << I2S_IEN_TXUDFIEN_Pos) /*!< I2S_T::IEN: TXUDFIEN Mask */ - -#define I2S_IEN_TXOVFIEN_Pos (9) /*!< I2S_T::IEN: TXOVFIEN Position */ -#define I2S_IEN_TXOVFIEN_Msk (0x1ul << I2S_IEN_TXOVFIEN_Pos) /*!< I2S_T::IEN: TXOVFIEN Mask */ - -#define I2S_IEN_TXTHIEN_Pos (10) /*!< I2S_T::IEN: TXTHIEN Position */ -#define I2S_IEN_TXTHIEN_Msk (0x1ul << I2S_IEN_TXTHIEN_Pos) /*!< I2S_T::IEN: TXTHIEN Mask */ - -#define I2S_IEN_CH0ZCIEN_Pos (16) /*!< I2S_T::IEN: CH0ZCIEN Position */ -#define I2S_IEN_CH0ZCIEN_Msk (0x1ul << I2S_IEN_CH0ZCIEN_Pos) /*!< I2S_T::IEN: CH0ZCIEN Mask */ - -#define I2S_IEN_CH1ZCIEN_Pos (17) /*!< I2S_T::IEN: CH1ZCIEN Position */ -#define I2S_IEN_CH1ZCIEN_Msk (0x1ul << I2S_IEN_CH1ZCIEN_Pos) /*!< I2S_T::IEN: CH1ZCIEN Mask */ - -#define I2S_IEN_CH2ZCIEN_Pos (18) /*!< I2S_T::IEN: CH2ZCIEN Position */ -#define I2S_IEN_CH2ZCIEN_Msk (0x1ul << I2S_IEN_CH2ZCIEN_Pos) /*!< I2S_T::IEN: CH2ZCIEN Mask */ - -#define I2S_IEN_CH3ZCIEN_Pos (19) /*!< I2S_T::IEN: CH3ZCIEN Position */ -#define I2S_IEN_CH3ZCIEN_Msk (0x1ul << I2S_IEN_CH3ZCIEN_Pos) /*!< I2S_T::IEN: CH3ZCIEN Mask */ - -#define I2S_IEN_CH4ZCIEN_Pos (20) /*!< I2S_T::IEN: CH4ZCIEN Position */ -#define I2S_IEN_CH4ZCIEN_Msk (0x1ul << I2S_IEN_CH4ZCIEN_Pos) /*!< I2S_T::IEN: CH4ZCIEN Mask */ - -#define I2S_IEN_CH5ZCIEN_Pos (21) /*!< I2S_T::IEN: CH5ZCIEN Position */ -#define I2S_IEN_CH5ZCIEN_Msk (0x1ul << I2S_IEN_CH5ZCIEN_Pos) /*!< I2S_T::IEN: CH5ZCIEN Mask */ - -#define I2S_IEN_CH6ZCIEN_Pos (22) /*!< I2S_T::IEN: CH6ZCIEN Position */ -#define I2S_IEN_CH6ZCIEN_Msk (0x1ul << I2S_IEN_CH6ZCIEN_Pos) /*!< I2S_T::IEN: CH6ZCIEN Mask */ - -#define I2S_IEN_CH7ZCIEN_Pos (23) /*!< I2S_T::IEN: CH7ZCIEN Position */ -#define I2S_IEN_CH7ZCIEN_Msk (0x1ul << I2S_IEN_CH7ZCIEN_Pos) /*!< I2S_T::IEN: CH7ZCIEN Mask */ - -#define I2S_STATUS0_I2SINT_Pos (0) /*!< I2S_T::STATUS0: I2SINT Position */ -#define I2S_STATUS0_I2SINT_Msk (0x1ul << I2S_STATUS0_I2SINT_Pos) /*!< I2S_T::STATUS0: I2SINT Mask */ - -#define I2S_STATUS0_I2SRXINT_Pos (1) /*!< I2S_T::STATUS0: I2SRXINT Position */ -#define I2S_STATUS0_I2SRXINT_Msk (0x1ul << I2S_STATUS0_I2SRXINT_Pos) /*!< I2S_T::STATUS0: I2SRXINT Mask */ - -#define I2S_STATUS0_I2STXINT_Pos (2) /*!< I2S_T::STATUS0: I2STXINT Position */ -#define I2S_STATUS0_I2STXINT_Msk (0x1ul << I2S_STATUS0_I2STXINT_Pos) /*!< I2S_T::STATUS0: I2STXINT Mask */ - -#define I2S_STATUS0_DATACH_Pos (3) /*!< I2S_T::STATUS0: DATACH Position */ -#define I2S_STATUS0_DATACH_Msk (0x7ul << I2S_STATUS0_DATACH_Pos) /*!< I2S_T::STATUS0: DATACH Mask */ - -#define I2S_STATUS0_RXUDIF_Pos (8) /*!< I2S_T::STATUS0: RXUDIF Position */ -#define I2S_STATUS0_RXUDIF_Msk (0x1ul << I2S_STATUS0_RXUDIF_Pos) /*!< I2S_T::STATUS0: RXUDIF Mask */ - -#define I2S_STATUS0_RXOVIF_Pos (9) /*!< I2S_T::STATUS0: RXOVIF Position */ -#define I2S_STATUS0_RXOVIF_Msk (0x1ul << I2S_STATUS0_RXOVIF_Pos) /*!< I2S_T::STATUS0: RXOVIF Mask */ - -#define I2S_STATUS0_RXTHIF_Pos (10) /*!< I2S_T::STATUS0: RXTHIF Position */ -#define I2S_STATUS0_RXTHIF_Msk (0x1ul << I2S_STATUS0_RXTHIF_Pos) /*!< I2S_T::STATUS0: RXTHIF Mask */ - -#define I2S_STATUS0_RXFULL_Pos (11) /*!< I2S_T::STATUS0: RXFULL Position */ -#define I2S_STATUS0_RXFULL_Msk (0x1ul << I2S_STATUS0_RXFULL_Pos) /*!< I2S_T::STATUS0: RXFULL Mask */ - -#define I2S_STATUS0_RXEMPTY_Pos (12) /*!< I2S_T::STATUS0: RXEMPTY Position */ -#define I2S_STATUS0_RXEMPTY_Msk (0x1ul << I2S_STATUS0_RXEMPTY_Pos) /*!< I2S_T::STATUS0: RXEMPTY Mask */ - -#define I2S_STATUS0_TXUDIF_Pos (16) /*!< I2S_T::STATUS0: TXUDIF Position */ -#define I2S_STATUS0_TXUDIF_Msk (0x1ul << I2S_STATUS0_TXUDIF_Pos) /*!< I2S_T::STATUS0: TXUDIF Mask */ - -#define I2S_STATUS0_TXOVIF_Pos (17) /*!< I2S_T::STATUS0: TXOVIF Position */ -#define I2S_STATUS0_TXOVIF_Msk (0x1ul << I2S_STATUS0_TXOVIF_Pos) /*!< I2S_T::STATUS0: TXOVIF Mask */ - -#define I2S_STATUS0_TXTHIF_Pos (18) /*!< I2S_T::STATUS0: TXTHIF Position */ -#define I2S_STATUS0_TXTHIF_Msk (0x1ul << I2S_STATUS0_TXTHIF_Pos) /*!< I2S_T::STATUS0: TXTHIF Mask */ - -#define I2S_STATUS0_TXFULL_Pos (19) /*!< I2S_T::STATUS0: TXFULL Position */ -#define I2S_STATUS0_TXFULL_Msk (0x1ul << I2S_STATUS0_TXFULL_Pos) /*!< I2S_T::STATUS0: TXFULL Mask */ - -#define I2S_STATUS0_TXEMPTY_Pos (20) /*!< I2S_T::STATUS0: TXEMPTY Position */ -#define I2S_STATUS0_TXEMPTY_Msk (0x1ul << I2S_STATUS0_TXEMPTY_Pos) /*!< I2S_T::STATUS0: TXEMPTY Mask */ - -#define I2S_STATUS0_TXBUSY_Pos (21) /*!< I2S_T::STATUS0: TXBUSY Position */ -#define I2S_STATUS0_TXBUSY_Msk (0x1ul << I2S_STATUS0_TXBUSY_Pos) /*!< I2S_T::STATUS0: TXBUSY Mask */ - -#define I2S_TXFIFO_TXFIFO_Pos (0) /*!< I2S_T::TXFIFO: TXFIFO Position */ -#define I2S_TXFIFO_TXFIFO_Msk (0xfffffffful << I2S_TXFIFO_TXFIFO_Pos) /*!< I2S_T::TXFIFO: TXFIFO Mask */ - -#define I2S_RXFIFO_RXFIFO_Pos (0) /*!< I2S_T::RXFIFO: RXFIFO Position */ -#define I2S_RXFIFO_RXFIFO_Msk (0xfffffffful << I2S_RXFIFO_RXFIFO_Pos) /*!< I2S_T::RXFIFO: RXFIFO Mask */ - -#define I2S_CTL1_CH0ZCEN_Pos (0) /*!< I2S_T::CTL1: CH0ZCEN Position */ -#define I2S_CTL1_CH0ZCEN_Msk (0x1ul << I2S_CTL1_CH0ZCEN_Pos) /*!< I2S_T::CTL1: CH0ZCEN Mask */ - -#define I2S_CTL1_CH1ZCEN_Pos (1) /*!< I2S_T::CTL1: CH1ZCEN Position */ -#define I2S_CTL1_CH1ZCEN_Msk (0x1ul << I2S_CTL1_CH1ZCEN_Pos) /*!< I2S_T::CTL1: CH1ZCEN Mask */ - -#define I2S_CTL1_CH2ZCEN_Pos (2) /*!< I2S_T::CTL1: CH2ZCEN Position */ -#define I2S_CTL1_CH2ZCEN_Msk (0x1ul << I2S_CTL1_CH2ZCEN_Pos) /*!< I2S_T::CTL1: CH2ZCEN Mask */ - -#define I2S_CTL1_CH3ZCEN_Pos (3) /*!< I2S_T::CTL1: CH3ZCEN Position */ -#define I2S_CTL1_CH3ZCEN_Msk (0x1ul << I2S_CTL1_CH3ZCEN_Pos) /*!< I2S_T::CTL1: CH3ZCEN Mask */ - -#define I2S_CTL1_CH4ZCEN_Pos (4) /*!< I2S_T::CTL1: CH4ZCEN Position */ -#define I2S_CTL1_CH4ZCEN_Msk (0x1ul << I2S_CTL1_CH4ZCEN_Pos) /*!< I2S_T::CTL1: CH4ZCEN Mask */ - -#define I2S_CTL1_CH5ZCEN_Pos (5) /*!< I2S_T::CTL1: CH5ZCEN Position */ -#define I2S_CTL1_CH5ZCEN_Msk (0x1ul << I2S_CTL1_CH5ZCEN_Pos) /*!< I2S_T::CTL1: CH5ZCEN Mask */ - -#define I2S_CTL1_CH6ZCEN_Pos (6) /*!< I2S_T::CTL1: CH6ZCEN Position */ -#define I2S_CTL1_CH6ZCEN_Msk (0x1ul << I2S_CTL1_CH6ZCEN_Pos) /*!< I2S_T::CTL1: CH6ZCEN Mask */ - -#define I2S_CTL1_CH7ZCEN_Pos (7) /*!< I2S_T::CTL1: CH7ZCEN Position */ -#define I2S_CTL1_CH7ZCEN_Msk (0x1ul << I2S_CTL1_CH7ZCEN_Pos) /*!< I2S_T::CTL1: CH7ZCEN Mask */ - -#define I2S_CTL1_TXTH_Pos (8) /*!< I2S_T::CTL1: TXTH Position */ -#define I2S_CTL1_TXTH_Msk (0xful << I2S_CTL1_TXTH_Pos) /*!< I2S_T::CTL1: TXTH Mask */ - -#define I2S_CTL1_RXTH_Pos (16) /*!< I2S_T::CTL1: RXTH Position */ -#define I2S_CTL1_RXTH_Msk (0xful << I2S_CTL1_RXTH_Pos) /*!< I2S_T::CTL1: RXTH Mask */ - -#define I2S_CTL1_PBWIDTH_Pos (24) /*!< I2S_T::CTL1: PBWIDTH Position */ -#define I2S_CTL1_PBWIDTH_Msk (0x1ul << I2S_CTL1_PBWIDTH_Pos) /*!< I2S_T::CTL1: PBWIDTH Mask */ - -#define I2S_CTL1_PB16ORD_Pos (25) /*!< I2S_T::CTL1: PB16ORD Position */ -#define I2S_CTL1_PB16ORD_Msk (0x1ul << I2S_CTL1_PB16ORD_Pos) /*!< I2S_T::CTL1: PB16ORD Mask */ - -#define I2S_STATUS1_CH0ZCIF_Pos (0) /*!< I2S_T::STATUS1: CH0ZCIF Position */ -#define I2S_STATUS1_CH0ZCIF_Msk (0x1ul << I2S_STATUS1_CH0ZCIF_Pos) /*!< I2S_T::STATUS1: CH0ZCIF Mask */ - -#define I2S_STATUS1_CH1ZCIF_Pos (1) /*!< I2S_T::STATUS1: CH1ZCIF Position */ -#define I2S_STATUS1_CH1ZCIF_Msk (0x1ul << I2S_STATUS1_CH1ZCIF_Pos) /*!< I2S_T::STATUS1: CH1ZCIF Mask */ - -#define I2S_STATUS1_CH2ZCIF_Pos (2) /*!< I2S_T::STATUS1: CH2ZCIF Position */ -#define I2S_STATUS1_CH2ZCIF_Msk (0x1ul << I2S_STATUS1_CH2ZCIF_Pos) /*!< I2S_T::STATUS1: CH2ZCIF Mask */ - -#define I2S_STATUS1_CH3ZCIF_Pos (3) /*!< I2S_T::STATUS1: CH3ZCIF Position */ -#define I2S_STATUS1_CH3ZCIF_Msk (0x1ul << I2S_STATUS1_CH3ZCIF_Pos) /*!< I2S_T::STATUS1: CH3ZCIF Mask */ - -#define I2S_STATUS1_CH4ZCIF_Pos (4) /*!< I2S_T::STATUS1: CH4ZCIF Position */ -#define I2S_STATUS1_CH4ZCIF_Msk (0x1ul << I2S_STATUS1_CH4ZCIF_Pos) /*!< I2S_T::STATUS1: CH4ZCIF Mask */ - -#define I2S_STATUS1_CH5ZCIF_Pos (5) /*!< I2S_T::STATUS1: CH5ZCIF Position */ -#define I2S_STATUS1_CH5ZCIF_Msk (0x1ul << I2S_STATUS1_CH5ZCIF_Pos) /*!< I2S_T::STATUS1: CH5ZCIF Mask */ - -#define I2S_STATUS1_CH6ZCIF_Pos (6) /*!< I2S_T::STATUS1: CH6ZCIF Position */ -#define I2S_STATUS1_CH6ZCIF_Msk (0x1ul << I2S_STATUS1_CH6ZCIF_Pos) /*!< I2S_T::STATUS1: CH6ZCIF Mask */ - -#define I2S_STATUS1_CH7ZCIF_Pos (7) /*!< I2S_T::STATUS1: CH7ZCIF Position */ -#define I2S_STATUS1_CH7ZCIF_Msk (0x1ul << I2S_STATUS1_CH7ZCIF_Pos) /*!< I2S_T::STATUS1: CH7ZCIF Mask */ - -#define I2S_STATUS1_TXCNT_Pos (8) /*!< I2S_T::STATUS1: TXCNT Position */ -#define I2S_STATUS1_TXCNT_Msk (0x1ful << I2S_STATUS1_TXCNT_Pos) /*!< I2S_T::STATUS1: TXCNT Mask */ - -#define I2S_STATUS1_RXCNT_Pos (16) /*!< I2S_T::STATUS1: RXCNT Position */ -#define I2S_STATUS1_RXCNT_Msk (0x1ful << I2S_STATUS1_RXCNT_Pos) /*!< I2S_T::STATUS1: RXCNT Mask */ - -/**@}*/ /* I2S_CONST */ -/**@}*/ /* end of I2S register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __I2S_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/kpi_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/kpi_reg.h deleted file mode 100644 index 74cc94dd858..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/kpi_reg.h +++ /dev/null @@ -1,409 +0,0 @@ -/**************************************************************************//** - * @file kpi_reg.h - * @version V1.00 - * @brief KPI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 20 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __KPI_REG_H__ -#define __KPI_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup Keypad Interface (KPI) - Memory Mapped Structure for KPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var KPI_T::KPICONF - * Offset: 0x00 Keypad Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ENKP |Keypad Scan Enable Bit - * | | |Setting this bit high enables the key scan function. - * | | |0 = Keypad scan Disabled. - * | | |1 = Keypad scan Enabled. - * |[1] |PKINTEN |Press Key Interrupt Enable Bit - * | | |The keypad controller will generate an interrupt when the controller detects any effective key press. - * | | |0 = Keypad press interrupt Disabled. - * | | |1 = Keypad press interrupt Enabled. - * | | |Note: The bit will be reset when KPI reset occurs. - * |[2] |RKINTEN |Release Key Interrupt Enable Bit - * | | |The keypad controller will generate an interrupt when the controller detects keypad status changes from press to release. - * | | |0 = Keypad release interrupt Disabled. - * | | |1 = Keypad release interrupt Enabled. - * | | |Note: The bit will be reset when KPI reset occurs. - * |[3] |INTEN |Key Interrupt Enable Bit - * | | |0 = Keypad interrupt Disabled. - * | | |1 = Keypad interrupt Enabled. - * | | |Note: The bit will be reset when KPI reset occurs. - * |[5] |WAKEUP |Lower Power Wakeup Enable Bit - * | | |Setting this bit enables low power wakeup. - * | | |0 = Wakeup Disabled. - * | | |1 = Wakeup Enabled. - * | | |Note: Setting the bit will force all KPI scan out to low. - * |[15:8] |PRESCALE |Row Scan Cycle Pre-scale Value - * | | |This value is used to pre-scale row scan cycle. - * | | |The pre-scale counter is clocked by the divided crystal clock, xCLOCK. - * | | |The divided number is from 1 to 256. - * | | |E.g.If the crystal clock is 1Mhz then the xCLOCK period is 1us. - * | | |If the keypad matric is 3x3 then - * | | |Each row scan time = xCLOCK x PRESCALE x PrescaleDivider. - * | | |Key array scan time = Each row scan time x ROWS. - * | | |Example scan time for PRESCALE = 0x40, and PrescaleDivider = 0x1F. - * | | |Each row scan time = 1us x 65 x 32 = 2.08ms. - * | | |Scan time = 2.08 x 3 = 6.24ms. - * | | |Note: - * | | |When PRESCALE is determined, De-bounce sampling cycle should not exceed the half of (PRESCALE x PrescaleDivider), - * | | |in the above example, and if scan row delay cycle is 4 xclock - * | | |The maximum DBCLKSEL should be 4*256 xCLOCK, bouncing time is 1ms. - * |[19:16] |DBCLKSEL |Scan in De-bounce Sampling Cycle Selection - * | | |0000 = Reserved. - * | | |0001 = Reserved. - * | | |0010 = Reserved. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 512 clocks. - * | | |1010 = Sample interrupt input once per 1024 clocks. - * | | |1011 = Sample interrupt input once per 2048 clocks. - * | | |1100 = Sample interrupt input once per 4096 clocks. - * | | |1101 = Sample interrupt input once per 8192 clocks. - * | | |1110 = reserved. - * | | |1111 = reserved. - * | | |Note: - * | | |scan row delay cycle < debounce sampling cycle. - * | | |row scan time > scan row delay cycle + (2 * debounce sampling cycle). - * | | |row scan time = prescale * 32 (xclock). - * | | |xclock = 1 MHz ~32 kHz. - * | | |bouncing time last for 1ms - * | | |For example, if xclock = 1 MHz,. - * | | |debounce sampling cycle choose 1024 xclock, - * | | |and scan row delay cycle choose 8 xclock, - * | | |row scan time should choose larger than (8+2048) xclock, - * | | |suppose PrescaleDivider = 0x1F, then prescale = 65 (2056/32 = 64.25). - * |[23:22] |SCANROWD |Scan Row Delay - * | | |Setting delay cycle when row change. - * | | |00 = 4 KPI engine clock cycle. - * | | |01 = 8 KPI engine clock cycle. - * | | |10 = 16 KPI engine clock cycle. - * | | |11 = 32 KPI engine clock cycle. - * | | |Note: - * | | |scan row delay cycle < debounce sampling cycle. - * | | |row scan time > scan row delay cycle + (2 * debounce sampling cycle). - * |[26:24] |KCOL |Keypad Matrix COL Number - * | | |The keypad matrix is set by ROW x COL. The COL number can be set 1 to 8. - * | | |000 = 1. - * | | |001 = 2. - * | | |010 = 3. - * | | |011 = 4. - * | | |100 = 5. - * | | |101 = 6. - * | | |110 = 7. - * | | |111 = 8. - * |[30:28] |KROW |Keypad Matrix ROW Number - * | | |The keypad matrix is set by ROW x COL. The ROW number can be set 2 to 6. - * | | |000 = reserved. - * | | |001 = 2. - * | | |010 = 3. - * | | |011 = 4. - * | | |100 = 5. - * | | |101 = 6. - * | | |110 = Reserved. - * | | |111 = Reserved. - * @var KPI_T::KPI3KCONF - * Offset: 0x04 Keypad 3-keys Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |K30C |The #0 Key Column Address - * |[5:3] |K30R |The #0 Key Row Address - * | | |The #0 means the row address and the column address is the lowest of the specified 3-keys - * |[10:8] |K31C |The #1 Key Column Address - * |[13:11] |K31R |The #1 Key Row Address - * | | |The #1 means the row address and the column address is the 2nd of the specified 3-keys - * |[18:16] |K32C |The #2 Key Column Address - * |[21:19] |K32R |The #2 Key Row Address - * | | |The #2 means the row address and the column address is the highest of the specified 3-keys - * |[24] |EN3KYRST |Enable Three-key Reset - * | | |Setting this bit enables hardware reset when three-key is detected - * | | |0 = Three-key function Disabled. - * | | |1 = Three-key function Enabled. - * | | |Note: The bit will be reset when KPI reset occurs. - * @var KPI_T::KPISTATUS - * Offset: 0x08 Keypad Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PDWAKE |Power Down Wakeup Flag - * | | |This flag indicates the chip is woken up from power down by keypad. - * | | |When READ: - * | | |0 = No wakeup. - * | | |1 = Wake-up by keypad. - * | | |When WRITE: - * | | |0 = No operation. - * | | |1 = Clear interrupt flag. - * |[1] |RST3KEY |3-keys Reset Flag - * | | |This bit will be set after 3-keys reset occurs. - * | | |When READ: - * | | |0 = No reset. - * | | |1 = 3 keys reset interrupt occurred. - * | | |When WRITE: - * | | |0 = No operation. - * | | |1 = Clear interrupt flag. - * |[2] |KEYINT |Key Interrupt - * | | |This bit indicates the key scan interrupt is active when any key press or release or three key reset or wake up. - * | | |When READ: - * | | |0 = No reset. - * | | |1 = Key press/release/3-key reset/wakeup interrupt occurred. - * |[3] |RKEYINT |Release Key Interrupt - * | | |This bit indicates that some keys (one or multiple key) have been released. - * | | |When READ: - * | | |0 = No key release. - * | | |1 = At least one key release. - * | | |Note: To clear RKEYINT, software must clear each releasing event that are shown on u201Ckey releasing eventu201D. - * | | |C code example: - * | | |DWORD RKE0, RKE1 - * | | |PKE0 = reg_read(KPIKRE0); PKE1 = reg_read(KPIKRE1);. - * | | |Reg_write(KPIKRE0, RKE0); Reg_write(KPIKRE1, RKE1) - * |[4] |PKEYINT |Press Key Interrupt - * | | |This bit indicates that some keys (one or multiple key) have been pressed. - * | | |When READ: - * | | |0 = No key press. - * | | |1 = At least one key press. - * | | |Note: To clear PKEYINT, software must clear each pressing event that are shown on u201CKPIKPE1, KPIKPE0u201D. - * | | |C code example: - * | | |DWORD PKE0, PKE1 - * | | |PKE0 = reg_read(KPIKPE0); PKE1 = reg_read(KPIKPE1);. - * | | |Reg_write(KPIKPE0, PKE0); Reg_write(KPIKPE1, PKE1) - * @var KPI_T::KPIRSTC - * Offset: 0x0C Keypad Reset Period Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RSTC |3-key Reset Period Count - * | | |The keypad controller generates a reset signal when it detects 3-key match condition, if the EN3KYRST (KPI3KCONF[24]) is set - * | | |The RSTC is used to control the reset period. - * | | |Reset period = 64 * RSTC XCLOCK. - * @var KPI_T::KPIKEST0 - * Offset: 0x10 Keypad State Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KESTmn |Key State - * | | |KESTm,n: m is row number, n is column number - * | | |0 = Key m,n is pressing. - * | | |1 = Key m,n is releasing. - * @var KPI_T::KPIKEST1 - * Offset: 0x14 Keypad State Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |KESTmn |Key State - * | | |KESTm,n: m is row number, n is column number - * | | |0 = Key m,n is pressing. - * | | |1 = Key m,n is releasing. - * @var KPI_T::KPIKPE0 - * Offset: 0x18 Lower 32 Key Press Event Indicator - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KPEmn |Lower 32 Key Press Event Change Indicator - * | | |KPE mn[X] = 1, m=row, n=column:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a high to low event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear PKEYINT (KPISTATUS[4]) by writing 1 bit by bit to this register. - * @var KPI_T::KPIKPE1 - * Offset: 0x1C Upper 32 Key Press Event Indicator - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |KPEmn |Upper 32 Key Press Event Change Indicator - * | | |KPE mn[X] = 1, m=row, n=column:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a high to low event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear PKEYINT (KPISTATUS[4]) by writing 1 bit by bit to this register. - * @var KPI_T::KPIKRE0 - * Offset: 0x20 Lower 32 Key Release Event Indicator - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KREmn |Lower 32 Key Release Event Change Indicator - * | | |KRE mn[X] = 1, m=row, n=column:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a low to high event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear RKEYINT (KPISTATUS[3]) by writing 1 bit by bit to this register. - * @var KPI_T::KPIKRE1 - * Offset: 0x24 Upper 32 Key Release Event Indicator - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |KREmn |Upper 32 Key Release Event Change Indicator - * | | |KRE mn[X] = 1, m=row, n=column:. - * | | |0 = No key event. - * | | |1 = Corresponding key has a low to high event change. - * | | |Note: - * | | |Hardware will set this bit, and software should clear this bit by writing 1. - * | | |Software can clear RKEYINT (KPISTATUS[3]) by writing 1 bit by bit to this register. - * @var KPI_T::KPIPRESCALDIV - * Offset: 0x28 Pre-scale Divider - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PRESCALDIV|Pre-scale Divider - * | | |This value is used to divide RESCALE that is set in KPICONF[15:8] - * | | |The prescale divider counter is clocked by the divided crystal clock, xCLOCK - * | | |The number is from 1 to 256. - * | | |E.g. If the crystal clock is 1Mhz then the xCLOCK period is 1us. If the keypad matrix is 3x3. Then, - * | | |each row scan time = xCLOCK x PRESCALE x PrescaleDivider. - * | | |key array scan time = each row scan time x ROWS. - * | | |example scan time for PRESCALE = 0x40, and PrescaleDivider = 0x1F. - * | | |each row scan time = 1us x 65 x 32 = 2.08ms. - * | | |scan time = 2.08 x 3 = 6.24ms. - * | | |Note: - * | | |When PRESCALE (KPICONF[15:8]) is determined, De-bounce sampling cycle should not exceed the half of (PRESCALE x PrescaleDivider), - * | | |in the above example, and if scan row delay cycle is 4 xclock - * | | |The maximum DBCLKSEL(KPICONF[19:16]) should be 1024 x clock, bouncing time is 1ms. - */ - __IO uint32_t KPICONF; /*!< [0x0000] Keypad Configuration Register */ - __IO uint32_t KPI3KCONF; /*!< [0x0004] Keypad 3-keys Configuration Register */ - __IO uint32_t KPISTATUS; /*!< [0x0008] Keypad Status Register */ - __IO uint32_t KPIRSTC; /*!< [0x000c] Keypad Reset Period Control Register */ - __I uint32_t KPIKEST0; /*!< [0x0010] Keypad State Register 0 */ - __I uint32_t KPIKEST1; /*!< [0x0014] Keypad State Register 1 */ - __IO uint32_t KPIKPE0; /*!< [0x0018] Lower 32 Key Press Event Indicator */ - __IO uint32_t KPIKPE1; /*!< [0x001c] Upper 32 Key Press Event Indicator */ - __IO uint32_t KPIKRE0; /*!< [0x0020] Lower 32 Key Release Event Indicator */ - __IO uint32_t KPIKRE1; /*!< [0x0024] Upper 32 Key Release Event Indicator */ - __IO uint32_t KPIPRESCALDIV; /*!< [0x0028] Pre-scale Divider */ - -} KPI_T; - -/** - @addtogroup KPI_CONST KPI Bit Field Definition - Constant Definitions for KPI Controller -@{ */ - -#define KPI_KPICONF_ENKP_Pos (0) /*!< KPI_T::KPICONF: ENKP Position */ -#define KPI_KPICONF_ENKP_Msk (0x1ul << KPI_KPICONF_ENKP_Pos) /*!< KPI_T::KPICONF: ENKP Mask */ - -#define KPI_KPICONF_PKINTEN_Pos (1) /*!< KPI_T::KPICONF: PKINTEN Position */ -#define KPI_KPICONF_PKINTEN_Msk (0x1ul << KPI_KPICONF_PKINTEN_Pos) /*!< KPI_T::KPICONF: PKINTEN Mask */ - -#define KPI_KPICONF_RKINTEN_Pos (2) /*!< KPI_T::KPICONF: RKINTEN Position */ -#define KPI_KPICONF_RKINTEN_Msk (0x1ul << KPI_KPICONF_RKINTEN_Pos) /*!< KPI_T::KPICONF: RKINTEN Mask */ - -#define KPI_KPICONF_INTEN_Pos (3) /*!< KPI_T::KPICONF: INTEN Position */ -#define KPI_KPICONF_INTEN_Msk (0x1ul << KPI_KPICONF_INTEN_Pos) /*!< KPI_T::KPICONF: INTEN Mask */ - -#define KPI_KPICONF_WAKEUP_Pos (5) /*!< KPI_T::KPICONF: WAKEUP Position */ -#define KPI_KPICONF_WAKEUP_Msk (0x1ul << KPI_KPICONF_WAKEUP_Pos) /*!< KPI_T::KPICONF: WAKEUP Mask */ - -#define KPI_KPICONF_PRESCALE_Pos (8) /*!< KPI_T::KPICONF: PRESCALE Position */ -#define KPI_KPICONF_PRESCALE_Msk (0xfful << KPI_KPICONF_PRESCALE_Pos) /*!< KPI_T::KPICONF: PRESCALE Mask */ - -#define KPI_KPICONF_DBCLKSEL_Pos (16) /*!< KPI_T::KPICONF: DBCLKSEL Position */ -#define KPI_KPICONF_DBCLKSEL_Msk (0xful << KPI_KPICONF_DBCLKSEL_Pos) /*!< KPI_T::KPICONF: DBCLKSEL Mask */ - -#define KPI_KPICONF_SCANROWD_Pos (22) /*!< KPI_T::KPICONF: SCANROWD Position */ -#define KPI_KPICONF_SCANROWD_Msk (0x3ul << KPI_KPICONF_SCANROWD_Pos) /*!< KPI_T::KPICONF: SCANROWD Mask */ - -#define KPI_KPICONF_KCOL_Pos (24) /*!< KPI_T::KPICONF: KCOL Position */ -#define KPI_KPICONF_KCOL_Msk (0x7ul << KPI_KPICONF_KCOL_Pos) /*!< KPI_T::KPICONF: KCOL Mask */ - -#define KPI_KPICONF_KROW_Pos (28) /*!< KPI_T::KPICONF: KROW Position */ -#define KPI_KPICONF_KROW_Msk (0x7ul << KPI_KPICONF_KROW_Pos) /*!< KPI_T::KPICONF: KROW Mask */ - -#define KPI_KPI3KCONF_K30C_Pos (0) /*!< KPI_T::KPI3KCONF: K30C Position */ -#define KPI_KPI3KCONF_K30C_Msk (0x7ul << KPI_KPI3KCONF_K30C_Pos) /*!< KPI_T::KPI3KCONF: K30C Mask */ - -#define KPI_KPI3KCONF_K30R_Pos (3) /*!< KPI_T::KPI3KCONF: K30R Position */ -#define KPI_KPI3KCONF_K30R_Msk (0x7ul << KPI_KPI3KCONF_K30R_Pos) /*!< KPI_T::KPI3KCONF: K30R Mask */ - -#define KPI_KPI3KCONF_K31C_Pos (8) /*!< KPI_T::KPI3KCONF: K31C Position */ -#define KPI_KPI3KCONF_K31C_Msk (0x7ul << KPI_KPI3KCONF_K31C_Pos) /*!< KPI_T::KPI3KCONF: K31C Mask */ - -#define KPI_KPI3KCONF_K31R_Pos (11) /*!< KPI_T::KPI3KCONF: K31R Position */ -#define KPI_KPI3KCONF_K31R_Msk (0x7ul << KPI_KPI3KCONF_K31R_Pos) /*!< KPI_T::KPI3KCONF: K31R Mask */ - -#define KPI_KPI3KCONF_K32C_Pos (16) /*!< KPI_T::KPI3KCONF: K32C Position */ -#define KPI_KPI3KCONF_K32C_Msk (0x7ul << KPI_KPI3KCONF_K32C_Pos) /*!< KPI_T::KPI3KCONF: K32C Mask */ - -#define KPI_KPI3KCONF_K32R_Pos (19) /*!< KPI_T::KPI3KCONF: K32R Position */ -#define KPI_KPI3KCONF_K32R_Msk (0x7ul << KPI_KPI3KCONF_K32R_Pos) /*!< KPI_T::KPI3KCONF: K32R Mask */ - -#define KPI_KPI3KCONF_EN3KYRST_Pos (24) /*!< KPI_T::KPI3KCONF: EN3KYRST Position */ -#define KPI_KPI3KCONF_EN3KYRST_Msk (0x1ul << KPI_KPI3KCONF_EN3KYRST_Pos) /*!< KPI_T::KPI3KCONF: EN3KYRST Mask */ - -#define KPI_KPISTATUS_PDWAKE_Pos (0) /*!< KPI_T::KPISTATUS: PDWAKE Position */ -#define KPI_KPISTATUS_PDWAKE_Msk (0x1ul << KPI_KPISTATUS_PDWAKE_Pos) /*!< KPI_T::KPISTATUS: PDWAKE Mask */ - -#define KPI_KPISTATUS_RST3KEY_Pos (1) /*!< KPI_T::KPISTATUS: RST3KEY Position */ -#define KPI_KPISTATUS_RST3KEY_Msk (0x1ul << KPI_KPISTATUS_RST3KEY_Pos) /*!< KPI_T::KPISTATUS: RST3KEY Mask */ - -#define KPI_KPISTATUS_KEYINT_Pos (2) /*!< KPI_T::KPISTATUS: KEYINT Position */ -#define KPI_KPISTATUS_KEYINT_Msk (0x1ul << KPI_KPISTATUS_KEYINT_Pos) /*!< KPI_T::KPISTATUS: KEYINT Mask */ - -#define KPI_KPISTATUS_RKEYINT_Pos (3) /*!< KPI_T::KPISTATUS: RKEYINT Position */ -#define KPI_KPISTATUS_RKEYINT_Msk (0x1ul << KPI_KPISTATUS_RKEYINT_Pos) /*!< KPI_T::KPISTATUS: RKEYINT Mask */ - -#define KPI_KPISTATUS_PKEYINT_Pos (4) /*!< KPI_T::KPISTATUS: PKEYINT Position */ -#define KPI_KPISTATUS_PKEYINT_Msk (0x1ul << KPI_KPISTATUS_PKEYINT_Pos) /*!< KPI_T::KPISTATUS: PKEYINT Mask */ - -#define KPI_KPIRSTC_RSTC_Pos (0) /*!< KPI_T::KPIRSTC: RSTC Position */ -#define KPI_KPIRSTC_RSTC_Msk (0xfful << KPI_KPIRSTC_RSTC_Pos) /*!< KPI_T::KPIRSTC: RSTC Mask */ - -#define KPI_KPIKEST0_KESTmn_Pos (0) /*!< KPI_T::KPIKEST0: KESTmn Position */ -#define KPI_KPIKEST0_KESTmn_Msk (0xfffffffful << KPI_KPIKEST0_KESTmn_Pos) /*!< KPI_T::KPIKEST0: KESTmn Mask */ - -#define KPI_KPIKEST1_KESTmn_Pos (0) /*!< KPI_T::KPIKEST1: KESTmn Position */ -#define KPI_KPIKEST1_KESTmn_Msk (0xfffful << KPI_KPIKEST1_KESTmn_Pos) /*!< KPI_T::KPIKEST1: KESTmn Mask */ - -#define KPI_KPIKPE0_KPEmn_Pos (0) /*!< KPI_T::KPIKPE0: KPEmn Position */ -#define KPI_KPIKPE0_KPEmn_Msk (0xfffffffful << KPI_KPIKPE0_KPEmn_Pos) /*!< KPI_T::KPIKPE0: KPEmn Mask */ - -#define KPI_KPIKPE1_KPEmn_Pos (0) /*!< KPI_T::KPIKPE1: KPEmn Position */ -#define KPI_KPIKPE1_KPEmn_Msk (0xfffful << KPI_KPIKPE1_KPEmn_Pos) /*!< KPI_T::KPIKPE1: KPEmn Mask */ - -#define KPI_KPIKRE0_KREmn_Pos (0) /*!< KPI_T::KPIKRE0: KREmn Position */ -#define KPI_KPIKRE0_KREmn_Msk (0xfffffffful << KPI_KPIKRE0_KREmn_Pos) /*!< KPI_T::KPIKRE0: KREmn Mask */ - -#define KPI_KPIKRE1_KREmn_Pos (0) /*!< KPI_T::KPIKRE1: KREmn Position */ -#define KPI_KPIKRE1_KREmn_Msk (0xfffful << KPI_KPIKRE1_KREmn_Pos) /*!< KPI_T::KPIKRE1: KREmn Mask */ - -#define KPI_KPIPRESCALDIV_PRESCALDIV_Pos (0) /*!< KPI_T::KPIPRESCALDIV: PRESCALDIV Position*/ -#define KPI_KPIPRESCALDIV_PRESCALDIV_Msk (0xfful << KPI_KPIPRESCALDIV_PRESCALDIV_Pos) /*!< KPI_T::KPIPRESCALDIV: PRESCALDIV Mask */ - -/**@}*/ /* KPI_CONST */ -/**@}*/ /* end of KPI register group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __KPI_REG_H__ */ - - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ks_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ks_reg.h deleted file mode 100644 index a3aac30c73c..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ks_reg.h +++ /dev/null @@ -1,473 +0,0 @@ -/**************************************************************************//** - * @file ks_reg.h - * @brief Key Store register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __KS_REG_H__ -#define __KS_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- Key Store -------------------------*/ -/** - @addtogroup KS Key Store(KS) - Memory Mapped Structure for KS Controller -@{ */ - -typedef struct -{ - - - /** - * @var KS_T::CTL - * Offset: 0x00 Key Store Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Key Store Start Control Bit - * | | |0 = No operation. - * | | |1 = Start the operation. - * |[3:1] |OPMODE |Key Store Operation Mode - * | | |000 = Read operation. - * | | |001 = Create operation. - * | | |010 = Erase one key operation. - * | | |011 = Erase all keys operation (only for SRAM). - * | | |100 = Revoke key operation. - * | | |101 = Data Remanence prevention operation (only for SRAM). - * | | |Others = reserved. - * |[7] |CONT |Read/Write Key Continue Bit - * | | |0 = Read/Write key operation is not continuous to previous operation. - * | | |1 = Read/Write key operation is continuous to previous operation. - * |[8] |INIT |Key Store Initialization - * | | |User should check BUSY(KS_STS[2]) is 0, and then write 1 to this bit and START(KS_CTL[0[), Key Store will start initialization. - * | | |After the Key Store is initialized, INIT will be cleared. - * |[10] |SILENT |Silent Access Enable Bit - * | | |0 = Silent access Disabled. - * | | |1 = Silent access Enabled. - * |[11] |SCMB |Data Scramble Enable Bit - * | | |0 = Data scramble Disabled. - * | | |1 = Data scramble Enabled. - * |[14] |TCLR |Tamper Event Clear Control Bit - * | | |0 = Key Store does not clear all keys at SRAM and revoke all OTP keys when tamper event occurs. - * | | |1 = Key Store clears all keys at SRAM and revoke all OTP keys when tamper event occurs. - * |[15] |IEN |Key Store Interrupt Enable Bit - * | | |0 = Key Store interrupt Disabled. - * | | |1 = Key Store interrupt Enabled. - * @var KS_T::METADATA - * Offset: 0x04 Key Store Metadata Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SEC |Secure Key Selection Bit - * | | |0 = Set key as the non-secure key. - * | | |1 = Set key as the secure key. - * |[2] |READABLE |Key Readable Control Bit - * | | |0 = key is un-readable. - * | | |1 = key is readable. - * |[3] |RVK |Key Revoke Control Bit - * | | |0 = Key current selected will not be changed. - * | | |1 = key current selected will be change to revoked state. - * |[4] |BS |Booting State Selection Bit - * | | |0 = Set key used at all state. - * | | |1 = Set key used at boot loader state 1 (BL1 state). - * |[12:8] |SIZE |Key Size Selection Bits - * | | |00000 = 128 bits. - * | | |00001 = 163 bits. - * | | |00010 = 192 bits. - * | | |00011 = 224 bits. - * | | |00100 = 233 bits. - * | | |00101 = 255 bits. - * | | |00110 = 256 bits. - * | | |00111 = 283 bits. - * | | |01000 = 384 bits. - * | | |01001 = 409 bits. - * | | |01010 = 512 bits. - * | | |01011 = 521 bits. - * | | |01100 = 571 bits. - * | | |10000 = 1024 bits. - * | | |10001 = 1536 bits. - * | | |10010 = 2048 bits. - * | | |10011 = 3072 bits. - * | | |10100 = 4096 bits. - * | | |Others = reserved. - * |[18:16] |OWNER |Key Owner Selection Bits - * | | |000 = AES. - * | | |001 = HMAC. - * | | |010 = RSA exponent blind key for SCAP(CRYPTO_RSA_CTL[8]) = 1 and CRT(CRYPTO_RSA_CTL[2]) = 0 . - * | | |011 = RSA middle data, p, q and private key. - * | | |100 = ECC. - * | | |101 = CPU. - * | | |Others = reserved. - * |[25:20] |NUMBER |Key Number - * | | |Before read or erase one key operation is started, user should write the key number to be operated - * | | |When create operation is finished, user can read these bits to get its key number. - * |[31:30] |DST |Key Location Selection Bits - * | | |00 = Key is in SRAM. - * | | |10 = Key is in OTP. - * | | |Others = reserved. - * @var KS_T::STS - * Offset: 0x08 Key Store Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |IF |Key Store Finish Interrupt Flag (Write 1 to Clear) - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No Key Store interrupt. - * | | |1 = Key Store operation done interrupt. - * |[1] |EIF |Key Store Error Flag (Write 1 to Clear) - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No Key Store error. - * | | |1 = Key Store error interrupt. - * |[2] |BUSY |Key Store Busy Flag (Read Only) - * | | |0 = Key Store is idle or finished. - * | | |1 = Key Store is busy. - * |[3] |SRAMFULL |Key Storage at SRAM Full Status Bit (Read Only) - * | | |0 = Key Storage at SRAM is not full. - * | | |1 = Key Storage at SRAM is full. - * |[7] |INITDONE |Key Store Initialization Done Status (Read Only) - * | | |0 = Key Store is un-initialized. - * | | |1 = Key Store is initialized. - * |[8] |RAMINV |Key Store SRAM Invert Status (Read Only) - * | | |0 = Key Store key in SRAM is normal. - * | | |1 = Key Store key in SRAM is inverted. - * @var KS_T::REMAIN - * Offset: 0x0C Key Store Remaining Space Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[12:0] |RRMNG |Key Store SRAM Remaining Space - * | | |The RRMNG shows the remaining byte count space of SRAM - * @var KS_T::SCMBKEY0 - * Offset: 0x10 Key Store Scramble Key Word 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCMBKEY |Key Store Scramble Key - * | | |When SCMB(KS_CTL[]) is set to 1, user should write the scramble key in this register before new key stores in Key Store - * | | |If user does not write the scramble key in this register, the Key Store will use previous scramble key to execute data scramble function. - * @var KS_T::SCMBKEY1 - * Offset: 0x14 Key Store Scramble Key Word 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCMBKEY |Key Store Scramble Key - * | | |When SCMB(KS_CTL[]) is set to 1, user should write the scramble key in this register before new key stores in Key Store - * | | |If user does not write the scramble key in this register, the Key Store will use previous scramble key to execute data scramble function. - * @var KS_T::SCMBKEY2 - * Offset: 0x18 Key Store Scramble Key Word 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCMBKEY |Key Store Scramble Key - * | | |When SCMB(KS_CTL[]) is set to 1, user should write the scramble key in this register before new key stores in Key Store - * | | |If user does not write the scramble key in this register, the Key Store will use previous scramble key to execute data scramble function. - * @var KS_T::SCMBKEY3 - * Offset: 0x1C Key Store Scramble Key Word 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCMBKEY |Key Store Scramble Key - * | | |When SCMB(KS_CTL[]) is set to 1, user should write the scramble key in this register before new key stores in Key Store - * | | |If user does not write the scramble key in this register, the Key Store will use previous scramble key to execute data scramble function. - * @var KS_T::KEY0 - * Offset: 0x20 Key Store Entry Key Word 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY1 - * Offset: 0x24 Key Store Entry Key Word 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY2 - * Offset: 0x28 Key Store Entry Key Word 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY3 - * Offset: 0x2C Key Store Entry Key Word 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY4 - * Offset: 0x30 Key Store Entry Key Word 4 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY5 - * Offset: 0x34 Key Store Entry Key Word 5 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY6 - * Offset: 0x38 Key Store Entry Key Word 6 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::KEY7 - * Offset: 0x3C Key Store Entry Key Word 7 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Key Data (Read/Write, Read to Clear) - * | | |These registers will be cleared if Key Store executes the write operation or CPU completes the reading key. - * @var KS_T::OTPSTS - * Offset: 0x40 Key Store OTP Keys Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |KEY0 |OTP Key 0 Used Status - * | | |0 = OTP key 0 is unused. - * | | |1 = OTP key 0 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[1] |KEY1 |OTP Key 1 Used Status - * | | |0 = OTP key 1 is unused. - * | | |1 = OTP key 1 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[2] |KEY2 |OTP Key 2 Used Status - * | | |0 = OTP key 2 is unused. - * | | |1 = OTP key 2 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[3] |KEY3 |OTP Key 3 Used Status - * | | |0 = OTP key 3 is unused. - * | | |1 = OTP key 3 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[4] |KEY4 |OTP Key 4 Used Status - * | | |0 = OTP key 4 is unused. - * | | |1 = OTP key 4 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[5] |KEY5 |OTP Key 5 Used Status - * | | |0 = OTP key 5 is unused. - * | | |1 = OTP key 5 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[6] |KEY6 |OTP Key 6 Used Status - * | | |0 = OTP key 6 is unused. - * | | |1 = OTP key 6 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[7] |KEY7 |OTP Key 7 Used Status - * | | |0 = OTP key 7 is unused. - * | | |1 = OTP key 7 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * |[8] |KEY8 |OTP Key 8 Used Status - * | | |0 = OTP key 8 is unused. - * | | |1 = OTP key 8 is used. - * | | |Note: When chip is in RMA stage, this bit will be set to 1 and key is revoked after initialization if key is existed. - * @var KS_T::REMKCNT - * Offset: 0x44 Key Store Remaining Key Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |RRMKCNT |Key Store SRAM Remaining Key Count - * | | |The RRMKCNT shows the remaining key count for SRAM. - */ - __IO uint32_t CTL; /*!< [0x0000] Key Store Control Register */ - __IO uint32_t METADATA; /*!< [0x0004] Key Store Metadata Register */ - __IO uint32_t STS; /*!< [0x0008] Key Store Status Register */ - __I uint32_t REMAIN; /*!< [0x000c] Key Store Remaining Space Register */ - __IO uint32_t SCMBKEY0; /*!< [0x0010] Key Store Scramble Key Word 0 Register */ - __IO uint32_t SCMBKEY1; /*!< [0x0014] Key Store Scramble Key Word 1 Register */ - __IO uint32_t SCMBKEY2; /*!< [0x0018] Key Store Scramble Key Word 2 Register */ - __IO uint32_t SCMBKEY3; /*!< [0x001c] Key Store Scramble Key Word 3 Register */ - __IO uint32_t KEY0; /*!< [0x0020] Key Store Entry Key Word 0 Register */ - __IO uint32_t KEY1; /*!< [0x0024] Key Store Entry Key Word 1 Register */ - __IO uint32_t KEY2; /*!< [0x0028] Key Store Entry Key Word 2 Register */ - __IO uint32_t KEY3; /*!< [0x002c] Key Store Entry Key Word 3 Register */ - __IO uint32_t KEY4; /*!< [0x0030] Key Store Entry Key Word 4 Register */ - __IO uint32_t KEY5; /*!< [0x0034] Key Store Entry Key Word 5 Register */ - __IO uint32_t KEY6; /*!< [0x0038] Key Store Entry Key Word 6 Register */ - __IO uint32_t KEY7; /*!< [0x003c] Key Store Entry Key Word 7 Register */ - __I uint32_t OTPSTS; /*!< [0x0040] Key Store OTP Keys Status Register */ - __I uint32_t REMKCNT; /*!< [0x0044] Key Store Remaining Key Count Register */ -} KS_T; - -typedef struct -{ - __IO uint32_t CTL; /*!< [0x0000] Key Store Control Register */ - __IO uint32_t METADATA; /*!< [0x0004] Key Store Metadata Register */ - __IO uint32_t STS; /*!< [0x0008] Key Store Status Register */ - __I uint32_t REMAIN; /*!< [0x000c] Key Store Remaining Space Register */ - __I uint32_t RESERVE0[4]; - __IO uint32_t KEY0; /*!< [0x0020] Key Store Entry Key Word 0 Register */ - __IO uint32_t KEY1; /*!< [0x0024] Key Store Entry Key Word 1 Register */ - __IO uint32_t KEY2; /*!< [0x0028] Key Store Entry Key Word 2 Register */ - __IO uint32_t KEY3; /*!< [0x002c] Key Store Entry Key Word 3 Register */ - __IO uint32_t KEY4; /*!< [0x0030] Key Store Entry Key Word 4 Register */ - __IO uint32_t KEY5; /*!< [0x0034] Key Store Entry Key Word 5 Register */ - __IO uint32_t KEY6; /*!< [0x0038] Key Store Entry Key Word 6 Register */ - __IO uint32_t KEY7; /*!< [0x003c] Key Store Entry Key Word 7 Register */ - __I uint32_t OTPSTS; /*!< [0x0040] Key Store OTP Keys Status Register */ - __I uint32_t REMKCNT; /*!< [0x0044] Key Store Remaining Key Count Register */ -} NS_KS_T; - -/** - @addtogroup KS_CONST KS Bit Field Definition - Constant Definitions for KS Controller -@{ */ - -#define KS_CTL_START_Pos (0) /*!< KS_T::CTL: START Position */ -#define KS_CTL_START_Msk (0x1ul << KS_CTL_START_Pos) /*!< KS_T::CTL: START Mask */ - -#define KS_CTL_OPMODE_Pos (1) /*!< KS_T::CTL: OPMODE Position */ -#define KS_CTL_OPMODE_Msk (0x7ul << KS_CTL_OPMODE_Pos) /*!< KS_T::CTL: OPMODE Mask */ - -#define KS_CTL_CONT_Pos (7) /*!< KS_T::CTL: CONT Position */ -#define KS_CTL_CONT_Msk (0x1ul << KS_CTL_CONT_Pos) /*!< KS_T::CTL: CONT Mask */ - -#define KS_CTL_INIT_Pos (8) /*!< KS_T::CTL: INIT Position */ -#define KS_CTL_INIT_Msk (0x1ul << KS_CTL_INIT_Pos) /*!< KS_T::CTL: INIT Mask */ - -#define KS_CTL_SILENT_Pos (10) /*!< KS_T::CTL: SILENT Position */ -#define KS_CTL_SILENT_Msk (0x1ul << KS_CTL_SILENT_Pos) /*!< KS_T::CTL: SILENT Mask */ - -#define KS_CTL_SCMB_Pos (11) /*!< KS_T::CTL: SCMB Position */ -#define KS_CTL_SCMB_Msk (0x1ul << KS_CTL_SCMB_Pos) /*!< KS_T::CTL: SCMB Mask */ - -#define KS_CTL_TCLR_Pos (14) /*!< KS_T::CTL: TCLR Position */ -#define KS_CTL_TCLR_Msk (0x1ul << KS_CTL_TCLR_Pos) /*!< KS_T::CTL: TCLR Mask */ - -#define KS_CTL_IEN_Pos (15) /*!< KS_T::CTL: IEN Position */ -#define KS_CTL_IEN_Msk (0x1ul << KS_CTL_IEN_Pos) /*!< KS_T::CTL: IEN Mask */ - -#define KS_METADATA_SEC_Pos (0) /*!< KS_T::METADATA: SEC Position */ -#define KS_METADATA_SEC_Msk (0x1ul << KS_METADATA_SEC_Pos) /*!< KS_T::METADATA: SEC Mask */ - -#define KS_METADATA_READABLE_Pos (2) /*!< KS_T::METADATA: READABLE Position */ -#define KS_METADATA_READABLE_Msk (0x1ul << KS_METADATA_READABLE_Pos) /*!< KS_T::METADATA: READABLE Mask */ - -#define KS_METADATA_RVK_Pos (3) /*!< KS_T::METADATA: RVK Position */ -#define KS_METADATA_RVK_Msk (0x1ul << KS_METADATA_RVK_Pos) /*!< KS_T::METADATA: RVK Mask */ - -#define KS_METADATA_BS_Pos (4) /*!< KS_T::METADATA: BS Position */ -#define KS_METADATA_BS_Msk (0x1ul << KS_METADATA_BS_Pos) /*!< KS_T::METADATA: BS Mask */ - -#define KS_METADATA_SIZE_Pos (8) /*!< KS_T::METADATA: SIZE Position */ -#define KS_METADATA_SIZE_Msk (0x1ful << KS_METADATA_SIZE_Pos) /*!< KS_T::METADATA: SIZE Mask */ - -#define KS_METADATA_OWNER_Pos (16) /*!< KS_T::METADATA: OWNER Position */ -#define KS_METADATA_OWNER_Msk (0x7ul << KS_METADATA_OWNER_Pos) /*!< KS_T::METADATA: OWNER Mask */ - -#define KS_METADATA_NUMBER_Pos (20) /*!< KS_T::METADATA: NUMBER Position */ -#define KS_METADATA_NUMBER_Msk (0x3ful << KS_METADATA_NUMBER_Pos) /*!< KS_T::METADATA: NUMBER Mask */ - -#define KS_METADATA_DST_Pos (30) /*!< KS_T::METADATA: DST Position */ -#define KS_METADATA_DST_Msk (0x3ul << KS_METADATA_DST_Pos) /*!< KS_T::METADATA: DST Mask */ - -#define KS_STS_IF_Pos (0) /*!< KS_T::STS: IF Position */ -#define KS_STS_IF_Msk (0x1ul << KS_STS_IF_Pos) /*!< KS_T::STS: IF Mask */ - -#define KS_STS_EIF_Pos (1) /*!< KS_T::STS: EIF Position */ -#define KS_STS_EIF_Msk (0x1ul << KS_STS_EIF_Pos) /*!< KS_T::STS: EIF Mask */ - -#define KS_STS_BUSY_Pos (2) /*!< KS_T::STS: BUSY Position */ -#define KS_STS_BUSY_Msk (0x1ul << KS_STS_BUSY_Pos) /*!< KS_T::STS: BUSY Mask */ - -#define KS_STS_SRAMFULL_Pos (3) /*!< KS_T::STS: SRAMFULL Position */ -#define KS_STS_SRAMFULL_Msk (0x1ul << KS_STS_SRAMFULL_Pos) /*!< KS_T::STS: SRAMFULL Mask */ - -#define KS_STS_INITDONE_Pos (7) /*!< KS_T::STS: INITDONE Position */ -#define KS_STS_INITDONE_Msk (0x1ul << KS_STS_INITDONE_Pos) /*!< KS_T::STS: INITDONE Mask */ - -#define KS_STS_RAMINV_Pos (8) /*!< KS_T::STS: RAMINV Position */ -#define KS_STS_RAMINV_Msk (0x1ul << KS_STS_RAMINV_Pos) /*!< KS_T::STS: RAMINV Mask */ - -#define KS_REMAIN_RRMNG_Pos (0) /*!< KS_T::REMAIN: RRMNG Position */ -#define KS_REMAIN_RRMNG_Msk (0x1ffful << KS_REMAIN_RRMNG_Pos) /*!< KS_T::REMAIN: RRMNG Mask */ - -#define KS_SCMBKEY0_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY0: SCMBKEY Position */ -#define KS_SCMBKEY0_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY0_SCMBKEY_Pos) /*!< KS_T::SCMBKEY0: SCMBKEY Mask */ - -#define KS_SCMBKEY1_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY1: SCMBKEY Position */ -#define KS_SCMBKEY1_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY1_SCMBKEY_Pos) /*!< KS_T::SCMBKEY1: SCMBKEY Mask */ - -#define KS_SCMBKEY2_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY2: SCMBKEY Position */ -#define KS_SCMBKEY2_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY2_SCMBKEY_Pos) /*!< KS_T::SCMBKEY2: SCMBKEY Mask */ - -#define KS_SCMBKEY3_SCMBKEY_Pos (0) /*!< KS_T::SCMBKEY3: SCMBKEY Position */ -#define KS_SCMBKEY3_SCMBKEY_Msk (0xfffffffful << KS_SCMBKEY3_SCMBKEY_Pos) /*!< KS_T::SCMBKEY3: SCMBKEY Mask */ - -#define KS_KEY0_KEY_Pos (0) /*!< KS_T::KEY0: KEY Position */ -#define KS_KEY0_KEY_Msk (0xfffffffful << KS_KEY0_KEY_Pos) /*!< KS_T::KEY0: KEY Mask */ - -#define KS_KEY1_KEY_Pos (0) /*!< KS_T::KEY1: KEY Position */ -#define KS_KEY1_KEY_Msk (0xfffffffful << KS_KEY1_KEY_Pos) /*!< KS_T::KEY1: KEY Mask */ - -#define KS_KEY2_KEY_Pos (0) /*!< KS_T::KEY2: KEY Position */ -#define KS_KEY2_KEY_Msk (0xfffffffful << KS_KEY2_KEY_Pos) /*!< KS_T::KEY2: KEY Mask */ - -#define KS_KEY3_KEY_Pos (0) /*!< KS_T::KEY3: KEY Position */ -#define KS_KEY3_KEY_Msk (0xfffffffful << KS_KEY3_KEY_Pos) /*!< KS_T::KEY3: KEY Mask */ - -#define KS_KEY4_KEY_Pos (0) /*!< KS_T::KEY4: KEY Position */ -#define KS_KEY4_KEY_Msk (0xfffffffful << KS_KEY4_KEY_Pos) /*!< KS_T::KEY4: KEY Mask */ - -#define KS_KEY5_KEY_Pos (0) /*!< KS_T::KEY5: KEY Position */ -#define KS_KEY5_KEY_Msk (0xfffffffful << KS_KEY5_KEY_Pos) /*!< KS_T::KEY5: KEY Mask */ - -#define KS_KEY6_KEY_Pos (0) /*!< KS_T::KEY6: KEY Position */ -#define KS_KEY6_KEY_Msk (0xfffffffful << KS_KEY6_KEY_Pos) /*!< KS_T::KEY6: KEY Mask */ - -#define KS_KEY7_KEY_Pos (0) /*!< KS_T::KEY7: KEY Position */ -#define KS_KEY7_KEY_Msk (0xfffffffful << KS_KEY7_KEY_Pos) /*!< KS_T::KEY7: KEY Mask */ - -#define KS_OTPSTS_KEY0_Pos (0) /*!< KS_T::OTPSTS: KEY0 Position */ -#define KS_OTPSTS_KEY0_Msk (0x1ul << KS_OTPSTS_KEY0_Pos) /*!< KS_T::OTPSTS: KEY0 Mask */ - -#define KS_OTPSTS_KEY1_Pos (1) /*!< KS_T::OTPSTS: KEY1 Position */ -#define KS_OTPSTS_KEY1_Msk (0x1ul << KS_OTPSTS_KEY1_Pos) /*!< KS_T::OTPSTS: KEY1 Mask */ - -#define KS_OTPSTS_KEY2_Pos (2) /*!< KS_T::OTPSTS: KEY2 Position */ -#define KS_OTPSTS_KEY2_Msk (0x1ul << KS_OTPSTS_KEY2_Pos) /*!< KS_T::OTPSTS: KEY2 Mask */ - -#define KS_OTPSTS_KEY3_Pos (3) /*!< KS_T::OTPSTS: KEY3 Position */ -#define KS_OTPSTS_KEY3_Msk (0x1ul << KS_OTPSTS_KEY3_Pos) /*!< KS_T::OTPSTS: KEY3 Mask */ - -#define KS_OTPSTS_KEY4_Pos (4) /*!< KS_T::OTPSTS: KEY4 Position */ -#define KS_OTPSTS_KEY4_Msk (0x1ul << KS_OTPSTS_KEY4_Pos) /*!< KS_T::OTPSTS: KEY4 Mask */ - -#define KS_OTPSTS_KEY5_Pos (5) /*!< KS_T::OTPSTS: KEY5 Position */ -#define KS_OTPSTS_KEY5_Msk (0x1ul << KS_OTPSTS_KEY5_Pos) /*!< KS_T::OTPSTS: KEY5 Mask */ - -#define KS_OTPSTS_KEY6_Pos (6) /*!< KS_T::OTPSTS: KEY6 Position */ -#define KS_OTPSTS_KEY6_Msk (0x1ul << KS_OTPSTS_KEY6_Pos) /*!< KS_T::OTPSTS: KEY6 Mask */ - -#define KS_OTPSTS_KEY7_Pos (7) /*!< KS_T::OTPSTS: KEY7 Position */ -#define KS_OTPSTS_KEY7_Msk (0x1ul << KS_OTPSTS_KEY7_Pos) /*!< KS_T::OTPSTS: KEY7 Mask */ - -#define KS_OTPSTS_KEY8_Pos (8) /*!< KS_T::OTPSTS: KEY8 Position */ -#define KS_OTPSTS_KEY8_Msk (0x1ul << KS_OTPSTS_KEY8_Pos) /*!< KS_T::OTPSTS: KEY8 Mask */ - -#define KS_REMKCNT_RRMKCNT_Pos (0) /*!< KS_T::REMKCNT: RRMKCNT Position */ -#define KS_REMKCNT_RRMKCNT_Msk (0x3ful << KS_REMKCNT_RRMKCNT_Pos) /*!< KS_T::REMKCNT: RRMKCNT Mask */ - -/**@}*/ /* KS_CONST */ -/**@}*/ /* end of KS register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __KS_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ma35d1.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ma35d1.h deleted file mode 100644 index 695a97d68c0..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ma35d1.h +++ /dev/null @@ -1,1052 +0,0 @@ -/**************************************************************************//** - * @file ma35d1.h - * @brief Peripheral access layer header file. - * This file contains all the peripheral register's definitions - * and bits definitions and memory mapping. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -/** - \mainpage NuMicro MA35D1 Driver Reference Guide - * - * Introduction - * - * This user manual describes the usage of MA35D1 device driver - * - * Disclaimer - * - * The Software is furnished "AS IS", without warranty as to performance or results, and - * the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all - * warranties, express, implied or otherwise, with regard to the Software, its use, or - * operation, including without limitation any and all warranties of merchantability, fitness - * for a particular purpose, and non-infringement of intellectual property rights. - * - * Important Notice - * - * Nuvoton Products are neither intended nor warranted for usage in systems or equipment, - * any malfunction or failure of which may cause loss of human life, bodily injury or severe - * property damage. Such applications are deemed, "Insecure Usage". - * - * Insecure usage includes, but is not limited to: equipment for surgical implementation, - * atomic energy control instruments, airplane or spaceship instruments, the control or - * operation of dynamic, brake or safety systems designed for vehicular use, traffic signal - * instruments, all types of safety devices, and other applications intended to support or - * sustain life. - * - * All Insecure Usage shall be made at customer's risk, and in the event that third parties - * lay claims to Nuvoton as a result of customer's Insecure Usage, customer shall indemnify - * the damages and liabilities thus incurred by Nuvoton. - * - * Please note that all data and specifications are subject to change without notice. All the - * trademarks of products and companies mentioned in this datasheet belong to their respective - * owners. - * - * Copyright Notice - * - * Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - */ -#ifndef __MA35D1_H__ -#define __MA35D1_H__ - -#include "rtconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************/ -/* Processor and Core Peripherals */ -/******************************************************************************/ -/** @addtogroup CMSIS_Device Device CMSIS Definitions - Configuration of the Cortex-M4 Processor and Core Peripherals - @{ -*/ - -/** - * @details Interrupt Number Definition. - */ -#if defined(USE_MA35D1_SUBM) -typedef enum IRQn -{ - /****** Cortex-M4 Processor Exceptions Numbers *************************************************/ - NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */ - MemoryManagement_IRQn = -12, /*!< 4 Memory Management Interrupt */ - BusFault_IRQn = -11, /*!< 5 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /*!< 6 Usage Fault Interrupt */ - SVCall_IRQn = -5, /*!< 11 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /*!< 14 Pend SV Interrupt */ - SysTick_IRQn = -1, /*!< 15 System Tick Interrupt */ - - /****** ma35d_rtp Specific Interrupt Numbers **************************************************/ - - LVD_IRQn = 0, - PWRWU_IRQn = 2, - HWSEM0_IRQn = 3, - CKFAIL_IRQn = 4, - WHC0_IRQn = 5, - RTC_IRQn = 6, - TAMPER_IRQn = 7, - WDT2_IRQn = 8, - WWDT2_IRQn = 9, - EINT0_IRQn = 10, - EINT1_IRQn = 11, - EINT2_IRQn = 12, - EINT3_IRQn = 13, - GPA_IRQn = 16, - GPB_IRQn = 17, - GPC_IRQn = 18, - GPD_IRQn = 19, - TMR2_IRQn = 22, - TMR3_IRQn = 23, - BRAKE0_IRQn = 24, - EPWM0P0_IRQn = 25, - EPWM0P1_IRQn = 26, - EPWM0P2_IRQn = 27, - QEI0_IRQn = 28, - ECAP0_IRQn = 29, - QSPI1_IRQn = 31, - UART1_IRQn = 35, - UART2_IRQn = 36, - UART3_IRQn = 37, - UART4_IRQn = 38, - UART5_IRQn = 39, - EADC00_IRQn = 40, - EADC01_IRQn = 41, - EADC02_IRQn = 42, - EADC03_IRQn = 43, - I2C1_IRQn = 45, - I2S0_IRQn = 46, - CANFD00_IRQn = 47, - SC0_IRQn = 48, - GPE_IRQn = 49, - GPF_IRQn = 50, - GPG_IRQn = 51, - GPH_IRQn = 52, - GPI_IRQn = 53, - GPJ_IRQn = 54, - TMR4_IRQn = 55, - TMR5_IRQn = 56, - TMR6_IRQn = 57, - TMR7_IRQn = 58, - BRAKE1_IRQn = 59, - EPWM1P0_IRQn = 60, - EPWM1P1_IRQn = 61, - EPWM1P2_IRQn = 62, - QEI1_IRQn = 63, - ECAP1_IRQn = 64, - SPI0_IRQn = 65, - SPI1_IRQn = 66, - PDMA2_IRQn = 67, - PDMA3_IRQn = 68, - UART6_IRQn = 69, - UART7_IRQn = 70, - UART8_IRQn = 71, - UART9_IRQn = 72, - UART10_IRQn = 73, - UART11_IRQn = 74, - I2C2_IRQn = 75, - I2C3_IRQn = 76, - I2S1_IRQn = 77, - CANFD10_IRQn = 78, - SC1_IRQn = 79, - GPK_IRQn = 80, - GPL_IRQn = 81, - GPM_IRQn = 82, - GPN_IRQn = 83, - TMR8_IRQn = 84, - TMR9_IRQn = 85, - TMR10_IRQn = 86, - TMR11_IRQn = 87, - BRAKE2_IRQn = 88, - EPWM2P0_IRQn = 89, - EPWM2P1_IRQn = 90, - EPWM2P2_IRQn = 91, - QEI2_IRQn = 92, - ECAP2_IRQn = 93, - SPI2_IRQn = 94, - SPI3_IRQn = 95, - UART12_IRQn = 96, - UART13_IRQn = 97, - UART14_IRQn = 98, - UART15_IRQn = 99, - UART16_IRQn = 100, - I2C4_IRQn = 101, - I2C5_IRQn = 102, - CANFD20_IRQn = 103, - CANFD30_IRQn = 104, - KPI_IRQn = 105, - CANFD01_IRQn = 106, - CANFD11_IRQn = 107, - CANFD21_IRQn = 108, - CANFD31_IRQn = 109, - ADC0_IRQn = 110, - IRQn_Max = 128, -} -IRQn_Type; - -/* Configuration of the Cortex-M4 Processor and Core Peripherals */ -#define __CM4_REV 0x0201U /*!< Core Revision r2p1 */ -#define __NVIC_PRIO_BITS 4U /*!< Number of Bits used for Priority Levels */ -#define __Vendor_SysTickConfig 0U /*!< Set to 1 if different SysTick Config is used */ -#define __MPU_PRESENT 1U /*!< MPU present or not */ -#ifdef __FPU_PRESENT -#undef __FPU_PRESENT -#define __FPU_PRESENT 1U /*!< FPU present or not */ -#else -#define __FPU_PRESENT 1U /*!< FPU present or not */ -#endif - -/*@}*/ /* end of group CMSIS_Device */ - - -#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ -#include "system_ma35d1.h" /* System include file */ -#include - -#else - -typedef enum IRQn -{ - /****** SGI Interrupts Numbers ************************************************/ - SGI0_IRQn = 0, /*!< Software Generated Interrupt 0 */ - SGI1_IRQn = 1, /*!< Software Generated Interrupt 1 */ - SGI2_IRQn = 2, /*!< Software Generated Interrupt 2 */ - SGI3_IRQn = 3, /*!< Software Generated Interrupt 3 */ - SGI4_IRQn = 4, /*!< Software Generated Interrupt 4 */ - SGI5_IRQn = 5, /*!< Software Generated Interrupt 5 */ - SGI6_IRQn = 6, /*!< Software Generated Interrupt 6 */ - SGI7_IRQn = 7, /*!< Software Generated Interrupt 7 */ - SGI8_IRQn = 8, /*!< Software Generated Interrupt 8 */ - SGI9_IRQn = 9, /*!< Software Generated Interrupt 9 */ - SGI10_IRQn = 10, /*!< Software Generated Interrupt 10 */ - SGI11_IRQn = 11, /*!< Software Generated Interrupt 11 */ - SGI12_IRQn = 12, /*!< Software Generated Interrupt 12 */ - SGI13_IRQn = 13, /*!< Software Generated Interrupt 13 */ - SGI14_IRQn = 14, /*!< Software Generated Interrupt 14 */ - SGI15_IRQn = 15, /*!< Software Generated Interrupt 15 */ - - /****** Cortex-35 Processor Exceptions Numbers ****************************************/ - VirtualMachine_IRQn = 25, - HypervisorTimer_IRQn = 26, - VirtualTimer_IRQn = 27, - LegacyFIQ_IRQn = 28, - SecPhysicalTimer_IRQn = 29, - NonSecPhysicalTimer_IRQn = 30, - LegacyIRQ_IRQn = 31, - - /****** Platform Exceptions Numbers ***************************************************/ - LVD_IRQn = 32, /*!< Low Voltage detection Interrupt */ - A35PMU_IRQn = 33, /*!< A35 PMU Interrupt */ - HWSEM0_IRQn = 34, /*!< Hardware Semaphore Interrupt */ - CKFAIL_IRQn = 35, /*!< Clock failed Interrupt */ - WHC0_IRQn = 36, /*!< Wormhole Interrupt */ - RTC_IRQn = 37, /*!< Real Time Clock Interrupt */ - TAMPER_IRQn = 38, /*!< Tamper detection Interrupt */ - WDT0_IRQn = 39, /*!< Watchdog timer 0 Interrupt */ - WWDT0_IRQn = 40, /*!< Window Watchdog timer 0 Interrupt */ - EINT0_IRQn = 41, /*!< External Input 0 Interrupt */ - EINT1_IRQn = 42, /*!< External Input 1 Interrupt */ - EINT2_IRQn = 43, /*!< External Input 2 Interrupt */ - EINT3_IRQn = 44, /*!< External Input 3 Interrupt */ - I2C0_IRQn = 45, /*!< I2C 0 Interrupt */ - GPA_IRQn = 46, /*!< GPIO Port A Interrupt */ - GPB_IRQn = 47, /*!< GPIO Port B Interrupt */ - GPC_IRQn = 48, /*!< GPIO Port C Interrupt */ - GPD_IRQn = 49, /*!< GPIO Port D Interrupt */ - PDMA0_IRQn = 50, /*!< Peripheral DMA 0 Interrupt */ - PDMA1_IRQn = 51, /*!< Peripheral DMA 1 Interrupt */ - DISP_IRQn = 52, /*!< Display Controller (DCUltra) Interrupt */ - CCAP0_IRQn = 53, /*!< CCAP 0 Interrupt */ - CCAP1_IRQn = 54, /*!< CCAP 1 Interrupt */ - GMAC0RX_IRQn = 55, /*!< GMAC0 RX Interrupt */ - GMAC1RX_IRQn = 56, /*!< GMAC1 RX Interrupt */ - SSMCC_IRQn = 57, /*!< SSMCC Interrupt */ - SSPCC_IRQn = 58, /*!< SSPCC Interrupt */ - GFX_IRQn = 59, /*!< GFX GC520L Interrupt (Graphic Engine) */ - VDE_IRQn = 60, /*!< Video Decoder (VC8000) Interrupt */ - WHC1_IRQn = 61, /*!< WRHO 1 Interrupt */ - SDH0_IRQn = 62, /*!< SDH 0 Interrupt */ - SDH1_IRQn = 63, /*!< SDH 1 Interrupt */ - HSUSBD_IRQn = 64, /*!< USB 2.0 High-Speed Device Interrupt */ - HSUSBH0_IRQn = 65, /*!< USB 2.0 High-Speed Host 0(EHCI) Interrupt */ - HSUSBH1_IRQn = 66, /*!< USB 2.0 High-Speed Host 1(EHCI) Interrupt */ - USBH0_IRQn = 67, /*!< USB 1.1 Host (OHCI) 0 Interrupt (Synopsys) */ - USBH1_IRQn = 68, /*!< USB 1.1 Host (OHCI) 0 Interrupt (Hydra) */ - USBH2_IRQn = 69, /*!< USB 1.1 Host (OHCI) 0 Interrupt (Hydra) */ - NAND_IRQn = 70, /*!< NAND Controller Interrupt */ - CRPT_IRQn = 71, /*!< Crypto Interrupt */ - TRNG_IRQn = 72, /*!< TRNG Interrupt */ - KS_IRQn = 73, /*!< KeyStore Interrupt */ - OTPC_IRQn = 74, /*!< OTP Controller Interrupt */ - WDT1_IRQn = 75, /*!< Watchdog timer 1 Interrupt */ - WWDT1_IRQn = 76, /*!< Window Watchdog timer 1 Interrupt */ - PDMA2_IRQn = 77, /*!< Peripheral DMA 2 Interrupt */ - PDMA3_IRQn = 78, /*!< Peripheral DMA 3 Interrupt */ - TMR0_IRQn = 79, /*!< Timer 0 Interrupt */ - TMR1_IRQn = 80, /*!< Timer 1 Interrupt */ - TMR2_IRQn = 81, /*!< Timer 2 Interrupt */ - TMR3_IRQn = 82, /*!< Timer 3 Interrupt */ - BRAKE0_IRQn = 83, /*!< BRAKE0 Interrupt */ - EPWM0P0_IRQn = 84, /*!< EPWM0P0 Interrupt */ - EPWM0P1_IRQn = 85, /*!< EPWM0P1 Interrupt */ - EPWM0P2_IRQn = 86, /*!< EPWM0P2 Interrupt */ - QEI0_IRQn = 87, /*!< QEI0 Interrupt */ - ECAP0_IRQn = 88, /*!< ECAP0 Interrupt */ - QSPI0_IRQn = 89, /*!< QSPI0 Interrupt */ - QSPI1_IRQn = 90, /*!< QSPI1 Interrupt */ - UART0_IRQn = 91, /*!< UART 0 Interrupt */ - UART1_IRQn = 92, /*!< UART 1 Interrupt */ - UART2_IRQn = 93, /*!< UART 2 Interrupt */ - UART3_IRQn = 94, /*!< UART 3 Interrupt */ - UART4_IRQn = 95, /*!< UART 4 Interrupt */ - UART5_IRQn = 96, /*!< UART 5 Interrupt */ - EADC00_IRQn = 97, /*!< EADC00 Interrupt */ - EADC01_IRQn = 98, /*!< EADC01 Interrupt */ - EADC02_IRQn = 99, /*!< EADC02 Interrupt */ - EADC03_IRQn = 100, /*!< EADC03 Interrupt */ - I2C1_IRQn = 101, /*!< I2C 1 Interrupt */ - I2S0_IRQn = 102, /*!< I2S 0 Interrupt */ - CANFD00_IRQn = 103, /*!< CAN-FD 00 Interrupt */ - SC0_IRQn = 104, /*!< Smart Card 0 Interrupt */ - GPE_IRQn = 105, /*!< GPIO Port E Interrupt */ - GPF_IRQn = 106, /*!< GPIO Port F Interrupt */ - GPG_IRQn = 107, /*!< GPIO Port G Interrupt */ - GPH_IRQn = 108, /*!< GPIO Port H Interrupt */ - GPI_IRQn = 109, /*!< GPIO Port I Interrupt */ - GPJ_IRQn = 110, /*!< GPIO Port J Interrupt */ - KPI_IRQn = 111, /*!< KPI Interrupt */ - ADC0_IRQn = 112, /*!< ADC 0 (Touch Panel ADC) Interrupt */ - TMR4_IRQn = 113, /*!< Timer 4 Interrupt */ - TMR5_IRQn = 114, /*!< Timer 5 Interrupt */ - BRAKE1_IRQn = 115, /*!< BRAKE1 Interrupt */ - EPWM1P0_IRQn = 116, /*!< EPWM1P0 Interrupt */ - EPWM1P1_IRQn = 117, /*!< EPWM1P1 Interrupt */ - EPWM1P2_IRQn = 118, /*!< EPWM1P2 Interrupt */ - QEI1_IRQn = 119, /*!< QEI1 Interrupt */ - ECAP1_IRQn = 120, /*!< ECAP1 Interrupt */ - SPI0_IRQn = 121, /*!< SPI0 Interrupt */ - SPI1_IRQn = 122, /*!< SPI1 Interrupt */ - UART6_IRQn = 123, /*!< UART 6 Interrupt */ - UART7_IRQn = 124, /*!< UART 7 Interrupt */ - UART8_IRQn = 125, /*!< UART 8 Interrupt */ - UART9_IRQn = 126, /*!< UART 9 Interrupt */ - UART10_IRQn = 127, /*!< UART 10 Interrupt */ - UART11_IRQn = 128, /*!< UART 11 Interrupt */ - I2C2_IRQn = 129, /*!< I2C 2 Interrupt */ - I2C3_IRQn = 130, /*!< I2C 3 Interrupt */ - I2S1_IRQn = 131, /*!< I2S 1 Interrupt */ - CANFD10_IRQn = 132, /*!< CAN-FD 10 Interrupt */ - SC1_IRQn = 133, /*!< Smart Card 1 Interrupt */ - GPK_IRQn = 134, /*!< GPIO Port K Interrupt */ - GPL_IRQn = 135, /*!< GPIO Port L Interrupt */ - GPM_IRQn = 136, /*!< GPIO Port M Interrupt */ - GPN_IRQn = 137, /*!< GPIO Port N Interrupt */ - TMR6_IRQn = 138, /*!< Timer 6 Interrupt */ - TMR7_IRQn = 139, /*!< Timer 7 Interrupt */ - TMR8_IRQn = 140, /*!< Timer 8 Interrupt */ - TMR9_IRQn = 141, /*!< Timer 9 Interrupt */ - BRAKE2_IRQn = 142, /*!< BRAKE2 Interrupt */ - EPWM2P0_IRQn = 143, /*!< EPWM2P0 Interrupt */ - EPWM2P1_IRQn = 144, /*!< EPWM2P1 Interrupt */ - EPWM2P2_IRQn = 145, /*!< EPWM2P2 Interrupt */ - QEI2_IRQn = 146, /*!< QEI2 Interrupt */ - ECAP2_IRQn = 147, /*!< ECAP2 Interrupt */ - SPI2_IRQn = 148, /*!< SPI2 Interrupt */ - SPI3_IRQn = 149, /*!< SPI3 Interrupt */ - UART12_IRQn = 150, /*!< UART 12 Interrupt */ - UART13_IRQn = 151, /*!< UART 13 Interrupt */ - UART14_IRQn = 152, /*!< UART 14 Interrupt */ - UART15_IRQn = 153, /*!< UART 15 Interrupt */ - UART16_IRQn = 154, /*!< UART 16 Interrupt */ - I2C4_IRQn = 155, /*!< I2C 4 Interrupt */ - I2C5_IRQn = 156, /*!< I2C 5 Interrupt */ - CANFD20_IRQn = 157, /*!< CAN-FD 20 Interrupt */ - CANFD30_IRQn = 158, /*!< CAN-FD 30 Interrupt */ - TMR10_IRQn = 159, /*!< Timer 10 Interrupt */ - TMR11_IRQn = 160, /*!< Timer 11 Interrupt */ - EMACAXIDLK_IRQn = 161, /*!< EMAC Fabric deadlock Interrupt */ - A35AXIDLK_IRQn = 162, /*!< A35 Fabric deadlock Interrupt */ - CANFD01_IRQn = 163, /*!< CAN-FD 01 Interrupt */ - CANFD11_IRQn = 164, /*!< CAN-FD 11 Interrupt */ - CANFD21_IRQn = 165, /*!< CAN-FD 21 Interrupt */ - CANFD31_IRQn = 166, /*!< CAN-FD 31 Interrupt */ - PWRWU_IRQn = 167, /*!< Power Down Wake Up Interrupt */ - DDRPOISION_IRQn = 168, /*!< DDR Out of range Interrupt */ - NS_KS_IRQn = 169, /*!< KeyStore Interrupt */ - IRQn_Max = 192, -} IRQn_Type; - - -/* - * ========================================================================== - * ----------- Processor and Core Peripheral Section ------------------------ - * ========================================================================== - */ - -/* -------- Configuration of the Cortex-A35 Processor and Core Peripherals ------- */ -#define __CA_REV 0x0000U /*!< Core revision r0p0 */ -#define __CORTEX_A 35U /*!< Cortex-A35 Core */ -#define __FPU_PRESENT 1U /* FPU present */ -#define __GIC_PRESENT 1U /* GIC present */ -#define __TIM_PRESENT 1U /* TIM present */ -#define __L2C_PRESENT 0U /* L2C present */ - -#define IS_ALIGNED(x,a) (((x) & ((typeof(x))(a)-1U)) == 0) - -#include -#include "system_ma35d1.h" - -#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 */ - -#define __STATIC_INLINE static __inline - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP() asm("nop") - -#endif /* if defined(USE_MA35D1_SUBM) */ - -#ifndef __CLZ -#if defined(__CC_ARM) -#define __CLZ __clz -#else -#define __CLZ __builtin_clz -#endif -#endif - -#if defined ( __CC_ARM ) -#pragma anon_unions -#endif - -/******************************************************************************/ -/* Register definitions */ -/******************************************************************************/ -#include "sys_reg.h" -#include "clk_reg.h" - -#include "uart_reg.h" -#include "whc_reg.h" -#include "hwsem_reg.h" -#include "wdt_reg.h" -#include "wwdt_reg.h" -#include "adc_reg.h" -#include "eadc_reg.h" -#include "sc_reg.h" -#include "gpio_reg.h" -#include "ecap_reg.h" -#include "qei_reg.h" -#include "i2c_reg.h" -#include "i2s_reg.h" -#include "pdma_reg.h" -#include "qspi_reg.h" -#include "spi_reg.h" -#include "rtc_reg.h" -#include "timer_reg.h" -#include "ebi_reg.h" -#include "epwm_reg.h" -#include "kpi_reg.h" -#include "canfd_reg.h" - -#include "sspcc_reg.h" -#include "ssmcc_reg.h" -#include "umctl2_reg.h" -#include "disp_reg.h" -#include "gmac_reg.h" - -#include "hsusbh_reg.h" -#include "usbh_reg.h" - -#include "sdh_reg.h" -#include "ccap_reg.h" -#include "nfi_reg.h" - -/** @addtogroup PERIPHERAL_MEM_MAP Peripheral Memory Base - Memory Mapped Structure for Peripherals - @{ - */ -/* SRAM, SDRAM, External Memory and IBR (Internal Boot ROM) Space */ -#define SRAM0_BASE (0x00000000U) /* SRAM 0 Memory Space (256 KB) */ -#define SDRAM4M_BASE (0x00040000U) /* SDRAM Offset 0x0 Alias Memory Space (4 MB-256 KB) */ -#define SRAM0A_BASE (0x24000000U) /* SRAM 0 Alias Memory Space (256 KB) */ -#define SRAM1_BASE (0x28000000U) /* SRAM 1 Memory Space (256 KB) */ -#define IBR_BASE (0x5FFC0000U) /* Internal Boot ROM Space (128 KB) */ -#define EXTMEM_BASE (0x68000000U) /* External Memory Space (128 MB) */ -#define SDRAM_BASE (0x80000000U) /* SDRAM Memory Space (2GB) */ - - -/* AXI/AHB Peripheral Register Space */ -#define GPIO_BASE (0x40040000U) -#define GPIOA_BASE GPIO_BASE -#define GPIOB_BASE (0x40040040U) -#define GPIOC_BASE (0x40040080U) -#define GPIOD_BASE (0x400400C0U) -#define GPIOE_BASE (0x40040100U) -#define GPIOF_BASE (0x40040140U) -#define GPIOG_BASE (0x40040180U) -#define GPIOH_BASE (0x400401C0U) -#define GPIOI_BASE (0x40040200U) -#define GPIOJ_BASE (0x40040240U) -#define GPIOK_BASE (0x40040280U) -#define GPIOL_BASE (0x400402C0U) -#define GPIOM_BASE (0x40040300U) -#define GPION_BASE (0x40040340U) -#define GPIO_DBCTL_BASE (0x40044440U) -#define GPIO_PIN_DATA_BASE (0x40040800U) - -#define PDMA0_BASE (0x40080000U) -#define PDMA1_BASE (0x40090000U) -#define PDMA2_BASE (0x400A0000U) -#define PDMA3_BASE (0x400B0000U) - -#define EBI_BASE (0x40100000U) - -#define GMAC0_BASE (0x40120000U) -#define GMAC1_BASE (0x40130000U) - -#define HSUSBH0_BASE (0x40140000U) -#define USBH0_BASE (0x40150000U) -#define USBD_BASE (0x40160000U) -#define USBH2_BASE (0x40170000U) - -#define SDH0_BASE (0x40180000U) -#define SDH1_BASE (0x40190000U) - -#define NAND_BASE (0x401A0000U) - -#define HSUSBH1_BASE (0x401C0000U) -#define USBH1_BASE (0x401D0000U) - -#define HSUSBD_BASE (0x40200000U) - -#define CCAP0_BASE (0x40240000U) -#define CCAP1_BASE (0x40250000U) - -#define DISP_BASE (0x40260000U) -#define DISP_MPU_BASE (0x40261C40U) - -#define GFX_BASE (0x40280000U) -#define VDEC_BASE (0x40290000U) - -#define CRYPTO_BASE (0x40300000U) -#define KS_BASE (0x40340000U) -#define OPTC_BASE (0x40350000U) -#define NS_OTPC_BASE (0x40350800U) - -#define CRYPTOSYS_BASE (0x40360000U) -#define CRYPTOCLK_BASE (0x40360200U) - -#define HWSEM_BASE (0x40380000U) -#define WHC0_BASE (0x403A0000U) - -#define MCAN0_BASE (0x403C0000U) -#define MCAN1_BASE (0x403D0000U) -#define MCAN2_BASE (0x403E0000U) -#define MCAN3_BASE (0x403F0000U) -#define CANFD0_BASE MCAN0_BASE -#define CANFD1_BASE MCAN1_BASE -#define CANFD2_BASE MCAN2_BASE -#define CANFD3_BASE MCAN3_BASE - -#define WHC1_BASE (0x503B0000U) - -#define GIC_DISTRIBUTOR_BASE (0x50801000U) -#define GIC_INTERFACE_BASE (0x50802000U) - - -/* APB Peripheral Register Space */ - -#define WDT0_BASE (0x40400000U) -#define RTC_BASE (0x40410000U) -#define ADC0_BASE (0x40420000U) -#define EADC_BASE (0x40430000U) -#define EADC0_BASE EADC_BASE -#define WDT1_BASE (0x40440000U) -#define SYS_BASE (0x40460000U) -#define CLK_BASE (0x40460200U) - -#define NMI_BASE (0x40460300U) -#define I2S0_BASE (0x40480000U) -#define I2S1_BASE (0x40490000U) -#define KPI_BASE (0x404A0000U) - -#define DDRPHY_BASE (0x404C0000U) -#define UMCTL2_BASE (0x404D0000U) - -#define SSMCC_BASE (0x404E0000U) -#define TZC0_BASE (0x404E1000U) -#define TZC1_BASE (0x404E2000U) -#define TZC2_BASE (0x404E3000U) - -#define SSPCC_BASE (0x404F0000U) - -#define TIMER0_BASE (0x40500000U) -#define TIMER1_BASE (0x40500100U) -#define TIMER2_BASE (0x40510000U) -#define TIMER3_BASE (0x40510100U) -#define TIMER4_BASE (0x40520000U) -#define TIMER5_BASE (0x40520100U) -#define TIMER6_BASE (0x40530000U) -#define TIMER7_BASE (0x40530100U) -#define TIMER8_BASE (0x40540000U) -#define TIMER9_BASE (0x40540100U) -#define TIMER10_BASE (0x40550000U) -#define TIMER11_BASE (0x40550100U) - -#define EPWM0_BASE (0x40580000U) -#define EPWM1_BASE (0x40590000U) -#define EPWM2_BASE (0x405A0000U) - -#define SPI0_BASE (0x40600000U) -#define SPI1_BASE (0x40610000U) -#define SPI2_BASE (0x40620000U) -#define SPI3_BASE (0x40630000U) - -#define QSPI0_BASE (0x40680000U) -#define QSPI1_BASE (0x40690000U) - -#define UART0_BASE (0x40700000U) -#define UART1_BASE (0x40710000U) -#define UART2_BASE (0x40720000U) -#define UART3_BASE (0x40730000U) -#define UART4_BASE (0x40740000U) -#define UART5_BASE (0x40750000U) -#define UART6_BASE (0x40760000U) -#define UART7_BASE (0x40770000U) -#define UART8_BASE (0x40780000U) -#define UART9_BASE (0x40790000U) -#define UART10_BASE (0x407A0000U) -#define UART11_BASE (0x407B0000U) -#define UART12_BASE (0x407C0000U) -#define UART13_BASE (0x407D0000U) -#define UART14_BASE (0x407E0000U) -#define UART15_BASE (0x407F0000U) - -#define I2C0_BASE (0x40800000U) -#define I2C1_BASE (0x40810000U) -#define I2C2_BASE (0x40820000U) -#define I2C3_BASE (0x40830000U) -#define I2C4_BASE (0x40840000U) -#define I2C5_BASE (0x40850000U) - -#define UART16_BASE (0x40880000U) - -#define SC0_BASE (0x40900000U) -#define SC1_BASE (0x40910000U) - -#define WDT2_BASE (0x40980000U) - -#define QEI0_BASE (0x40B00000U) -#define QEI1_BASE (0x40B10000U) -#define QEI2_BASE (0x40B20000U) - -#define ECAP0_BASE (0x40B40000U) -#define ECAP1_BASE (0x40B50000U) -#define ECAP2_BASE (0x40B60000U) - - -#define WWDT0_BASE (0x40400100U) -#define WWDT1_BASE (0x40440100U) -#define WWDT2_BASE (0x40980100U) - - - -/*@}*/ /* end of group PERIPHERAL_MEM_MAP */ - - -/** @addtogroup PERIPHERAL_DECLARATION Peripheral Pointer - The Declaration of Peripherals - @{ - */ - -#define SYS ((SYS_T *) SYS_BASE) -#define CLK ((CLK_T *) CLK_BASE) -#define PA ((GPIO_T *) GPIOA_BASE) -#define PB ((GPIO_T *) GPIOB_BASE) -#define PC ((GPIO_T *) GPIOC_BASE) -#define PD ((GPIO_T *) GPIOD_BASE) -#define PE ((GPIO_T *) GPIOE_BASE) -#define PF ((GPIO_T *) GPIOF_BASE) -#define PG ((GPIO_T *) GPIOG_BASE) -#define PH ((GPIO_T *) GPIOH_BASE) -#define PI ((GPIO_T *) GPIOI_BASE) -#define PJ ((GPIO_T *) GPIOJ_BASE) -#define PK ((GPIO_T *) GPIOK_BASE) -#define PL ((GPIO_T *) GPIOL_BASE) -#define PM ((GPIO_T *) GPIOM_BASE) -#define PN ((GPIO_T *) GPION_BASE) -#define PDMA0 ((PDMA_T *) PDMA0_BASE) -#define PDMA1 ((PDMA_T *) PDMA1_BASE) -#define PDMA2 ((PDMA_T *) PDMA2_BASE) -#define PDMA3 ((PDMA_T *) PDMA3_BASE) -#define EBI ((EBI_T *) EBI_BASE) -#define HWSEM0 ((HWSEM_T *) HWSEM_BASE) -#define WHC0 ((WHC_T *) WHC0_BASE) -#define MCAN0 ((MCAN_T *) MCAN0_BASE) -#define MCAN1 ((MCAN_T *) MCAN1_BASE) -#define MCAN2 ((MCAN_T *) MCAN2_BASE) -#define MCAN3 ((MCAN_T *) MCAN3_BASE) -#define RTC ((RTC_T *) RTC_BASE) -#define ADC0 ((ADC_T *) ADC0_BASE) -#define EADC ((EADC_T *) EADC_BASE) -#define EADC0 EADC -#define I2S0 ((I2S_T *) I2S0_BASE) -#define I2S1 ((I2S_T *) I2S1_BASE) -#define KPI ((KPI_T *) KPI_BASE) -#define TIMER0 ((TIMER_T *) TIMER0_BASE) -#define TIMER1 ((TIMER_T *) TIMER1_BASE) -#define TIMER2 ((TIMER_T *) TIMER2_BASE) -#define TIMER3 ((TIMER_T *) TIMER3_BASE) -#define TIMER4 ((TIMER_T *) TIMER4_BASE) -#define TIMER5 ((TIMER_T *) TIMER5_BASE) -#define TIMER6 ((TIMER_T *) TIMER6_BASE) -#define TIMER7 ((TIMER_T *) TIMER7_BASE) -#define TIMER8 ((TIMER_T *) TIMER8_BASE) -#define TIMER9 ((TIMER_T *) TIMER9_BASE) -#define TIMER10 ((TIMER_T *) TIMER10_BASE) -#define TIMER11 ((TIMER_T *) TIMER11_BASE) -#define EPWM0 ((EPWM_T *) EPWM0_BASE) -#define EPWM1 ((EPWM_T *) EPWM1_BASE) -#define EPWM2 ((EPWM_T *) EPWM2_BASE) -#define SPI0 ((SPI_T *) SPI0_BASE) -#define SPI1 ((SPI_T *) SPI1_BASE) -#define SPI2 ((SPI_T *) SPI2_BASE) -#define SPI3 ((SPI_T *) SPI3_BASE) - -#define QSPI0 ((QSPI_T *) QSPI0_BASE) -#define QSPI1 ((QSPI_T *) QSPI1_BASE) - -#define UART0 ((UART_T *) UART0_BASE) -#define UART1 ((UART_T *) UART1_BASE) -#define UART2 ((UART_T *) UART2_BASE) -#define UART3 ((UART_T *) UART3_BASE) -#define UART4 ((UART_T *) UART4_BASE) -#define UART5 ((UART_T *) UART5_BASE) -#define UART6 ((UART_T *) UART6_BASE) -#define UART7 ((UART_T *) UART7_BASE) -#define UART8 ((UART_T *) UART8_BASE) -#define UART9 ((UART_T *) UART9_BASE) -#define UART10 ((UART_T *) UART10_BASE) -#define UART11 ((UART_T *) UART11_BASE) -#define UART12 ((UART_T *) UART12_BASE) -#define UART13 ((UART_T *) UART13_BASE) -#define UART14 ((UART_T *) UART14_BASE) -#define UART15 ((UART_T *) UART15_BASE) -#define UART16 ((UART_T *) UART16_BASE) - -#define I2C0 ((I2C_T *) I2C0_BASE) -#define I2C1 ((I2C_T *) I2C1_BASE) -#define I2C2 ((I2C_T *) I2C2_BASE) -#define I2C3 ((I2C_T *) I2C3_BASE) -#define I2C4 ((I2C_T *) I2C4_BASE) -#define I2C5 ((I2C_T *) I2C5_BASE) -#define SC0 ((SC_T *) SC0_BASE) -#define SC1 ((SC_T *) SC1_BASE) -#define WDT0 ((WDT_T *) WDT0_BASE) -#define WDT1 ((WDT_T *) WDT1_BASE) -#define WDT2 ((WDT_T *) WDT2_BASE) -#define WWDT2 ((WWDT_T *) WWDT2_BASE) -#define QEI0 ((QEI_T *) QEI0_BASE) -#define QEI1 ((QEI_T *) QEI1_BASE) -#define QEI2 ((QEI_T *) QEI2_BASE) -#define ECAP0 ((ECAP_T *) ECAP0_BASE) -#define ECAP1 ((ECAP_T *) ECAP1_BASE) -#define ECAP2 ((ECAP_T *) ECAP2_BASE) -#define CANFD0 ((CANFD_T*) CANFD0_BASE) -#define CANFD1 ((CANFD_T*) CANFD1_BASE) -#define CANFD2 ((CANFD_T*) CANFD2_BASE) -#define CANFD3 ((CANFD_T*) CANFD3_BASE) - -#define SSPCC ((SSPCC_T*) SSPCC_BASE) -#define SSMCC ((SSMCC_T*) SSMCC_BASE) -#define TZC0 ((TZC_T*) TZC0_BASE) -#define TZC2 ((TZC_T*) TZC2_BASE) -#define UMCTL2 ((UMCTL2_T*)UMCTL2_BASE) -#define DISP ((DISP_T*) DISP_BASE) - -#define GMAC0 ((GMAC_T*) GMAC0_BASE) -#define GMAC1 ((GMAC_T*) GMAC1_BASE) - -#define SDH0 ((SDH_T*) SDH0_BASE) -#define SDH1 ((SDH_T*) SDH1_BASE) - -#define CCAP0 ((CCAP_T*) CCAP0_BASE) -#define CCAP1 ((CCAP_T*) CCAP1_BASE) - -#define NFI ((NFI_T*) NAND_BASE) -/*@}*/ /* end of group ERIPHERAL_DECLARATION */ - -/** @addtogroup IO_ROUTINE I/O Routines - The Declaration of I/O Routines - @{ - */ - -typedef volatile uint8_t vu8; ///< Define 8-bit unsigned volatile data type -typedef volatile uint16_t vu16; ///< Define 16-bit unsigned volatile data type -typedef volatile uint32_t vu32; ///< Define 32-bit unsigned volatile data type -typedef volatile uint64_t vu64; ///< Define 64-bit unsigned volatile data type - -/** - * @brief Get a 8-bit unsigned value from specified address - * @param[in] addr Address to get 8-bit data from - * @return 8-bit unsigned value stored in specified address - */ -#define M8(addr) (*((vu8 *) (addr))) - -/** - * @brief Get a 16-bit unsigned value from specified address - * @param[in] addr Address to get 16-bit data from - * @return 16-bit unsigned value stored in specified address - * @note The input address must be 16-bit aligned - */ -#define M16(addr) (*((vu16 *) (addr))) - -/** - * @brief Get a 32-bit unsigned value from specified address - * @param[in] addr Address to get 32-bit data from - * @return 32-bit unsigned value stored in specified address - * @note The input address must be 32-bit aligned - */ -#define M32(addr) (*((vu32 *) (addr))) - -/** - * @brief Get a 64-bit unsigned value from specified address - * @param[in] addr Address to get 64-bit data from - * @return 64-bit unsigned value stored in specified address - * @note The input address must be 64-bit aligned - */ -#define M64(addr) (*((vu64 *) (addr))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outpw(port,value) *((vu32 *)(port)) = (value) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inpw(port) (*((vu32 *)(port))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outps(port,value) *((vu16 *)(port)) = (value) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inps(port) (*((vu16 *)(port))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outpb(port,value) *((vu8 *)(port)) = (value) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inpb(port) (*((vu8 *)(port))) - -/** - * @brief Set a 64-bit unsigned value to specified I/O port - * @param[in] port Port address to set 64-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 64-bit aligned - */ -#define outp64(port,value) *((vu64 *)(port)) = (value) - -/** - * @brief Get a 64-bit unsigned value from specified I/O port - * @param[in] port Port address to get 64-bit data from - * @return 64-bit unsigned value stored in specified I/O port - * @note The input port must be 64-bit aligned - */ -#define inp64(port) (*((vu64 *)(port))) - -/** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ -#define outp32(port,value) *((vu32 *)(port)) = (value) - -/** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ -#define inp32(port) (*((vu32 *)(port))) - -/** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ -#define outp16(port,value) *((vu16 *)(port)) = (value) - -/** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ -#define inp16(port) (*((vu16 *)(port))) - -/** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ -#define outp8(port,value) *((vu8 *)(port)) = (value) - -/** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ -#define inp8(port) (*((vu8 *)(port))) - - -/*@}*/ /* end of group IO_ROUTINE */ - -/******************************************************************************/ -/* Legacy Constants */ -/******************************************************************************/ -/** @addtogroup Legacy_Constants Legacy Constants - Legacy Constants - @{ -*/ - -#ifndef NULL -#define NULL (0) ///< NUL pointer -#endif - -#define TRUE (1U) ///< Boolean true, define to use in API parameters or return value -#define FALSE (0U) ///< Boolean false, define to use in API parameters or return value - -#define ENABLE (1U) ///< Enable, define to use in API parameters -#define DISABLE (0U) ///< Disable, define to use in API parameters - -/* Define one bit mask */ -#define BIT0 (0x00000001U) ///< Bit 0 mask of an 32 bit integer -#define BIT1 (0x00000002U) ///< Bit 1 mask of an 32 bit integer -#define BIT2 (0x00000004U) ///< Bit 2 mask of an 32 bit integer -#define BIT3 (0x00000008U) ///< Bit 3 mask of an 32 bit integer -#define BIT4 (0x00000010U) ///< Bit 4 mask of an 32 bit integer -#define BIT5 (0x00000020U) ///< Bit 5 mask of an 32 bit integer -#define BIT6 (0x00000040U) ///< Bit 6 mask of an 32 bit integer -#define BIT7 (0x00000080U) ///< Bit 7 mask of an 32 bit integer -#define BIT8 (0x00000100U) ///< Bit 8 mask of an 32 bit integer -#define BIT9 (0x00000200U) ///< Bit 9 mask of an 32 bit integer -#define BIT10 (0x00000400U) ///< Bit 10 mask of an 32 bit integer -#define BIT11 (0x00000800U) ///< Bit 11 mask of an 32 bit integer -#define BIT12 (0x00001000U) ///< Bit 12 mask of an 32 bit integer -#define BIT13 (0x00002000U) ///< Bit 13 mask of an 32 bit integer -#define BIT14 (0x00004000U) ///< Bit 14 mask of an 32 bit integer -#define BIT15 (0x00008000U) ///< Bit 15 mask of an 32 bit integer -#define BIT16 (0x00010000U) ///< Bit 16 mask of an 32 bit integer -#define BIT17 (0x00020000U) ///< Bit 17 mask of an 32 bit integer -#define BIT18 (0x00040000U) ///< Bit 18 mask of an 32 bit integer -#define BIT19 (0x00080000U) ///< Bit 19 mask of an 32 bit integer -#define BIT20 (0x00100000U) ///< Bit 20 mask of an 32 bit integer -#define BIT21 (0x00200000U) ///< Bit 21 mask of an 32 bit integer -#define BIT22 (0x00400000U) ///< Bit 22 mask of an 32 bit integer -#define BIT23 (0x00800000U) ///< Bit 23 mask of an 32 bit integer -#define BIT24 (0x01000000U) ///< Bit 24 mask of an 32 bit integer -#define BIT25 (0x02000000U) ///< Bit 25 mask of an 32 bit integer -#define BIT26 (0x04000000U) ///< Bit 26 mask of an 32 bit integer -#define BIT27 (0x08000000U) ///< Bit 27 mask of an 32 bit integer -#define BIT28 (0x10000000U) ///< Bit 28 mask of an 32 bit integer -#define BIT29 (0x20000000U) ///< Bit 29 mask of an 32 bit integer -#define BIT30 (0x40000000U) ///< Bit 30 mask of an 32 bit integer -#define BIT31 (0x80000000U) ///< Bit 31 mask of an 32 bit integer - -/* Byte Mask Definitions */ -#define BYTE0_Msk (0x000000FFU) ///< Mask to get bit0~bit7 from a 32 bit integer -#define BYTE1_Msk (0x0000FF00U) ///< Mask to get bit8~bit15 from a 32 bit integer -#define BYTE2_Msk (0x00FF0000U) ///< Mask to get bit16~bit23 from a 32 bit integer -#define BYTE3_Msk (0xFF000000U) ///< Mask to get bit24~bit31 from a 32 bit integer - -#define GET_BYTE0(u32Param) (((u32Param) & BYTE0_Msk) ) /*!< Extract Byte 0 (Bit 0~ 7) from parameter u32Param */ -#define GET_BYTE1(u32Param) (((u32Param) & BYTE1_Msk) >> 8) /*!< Extract Byte 1 (Bit 8~15) from parameter u32Param */ -#define GET_BYTE2(u32Param) (((u32Param) & BYTE2_Msk) >> 16) /*!< Extract Byte 2 (Bit 16~23) from parameter u32Param */ -#define GET_BYTE3(u32Param) (((u32Param) & BYTE3_Msk) >> 24) /*!< Extract Byte 3 (Bit 24~31) from parameter u32Param */ - -/*@}*/ /* end of group Legacy_Constants */ - -/******************************************************************************/ -/* Peripheral header files */ -/******************************************************************************/ -#include "nu_sys.h" -#include "nu_clk.h" -#include "nu_uart.h" -#include "nu_pdma.h" -#include "nu_gpio.h" -#include "nu_hwsem.h" -#include "nu_whc.h" -#include "nu_ecap.h" -#include "nu_qei.h" -#include "nu_timer.h" -#include "nu_timer_pwm.h" -#include "nu_i2c.h" -#include "nu_i2s.h" -#include "nu_epwm.h" -#include "nu_eadc.h" -#include "nu_adc.h" -#include "nu_wdt.h" -#include "nu_wwdt.h" -#include "nu_ebi.h" -#include "nu_scuart.h" -#include "nu_sc.h" -#include "nu_spi.h" -#include "nu_qspi.h" -#include "nu_rtc.h" -#include "nu_kpi.h" -#include "nu_canfd.h" -#include "nu_ssmcc.h" -#include "nu_sspcc.h" -#include "nu_disp.h" -#include "nu_sdh.h" -#include "nu_ccap.h" - -#ifdef __cplusplus -} -#endif - -#endif /* __MA35D1_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/nfi_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/nfi_reg.h deleted file mode 100644 index 25477915bd7..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/nfi_reg.h +++ /dev/null @@ -1,2041 +0,0 @@ -/**************************************************************************//** - * @file nfi_reg.h - * @brief NFI register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NFI_REG_H__ -#define __NFI_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- NAND Flash Interface -------------------------*/ -/** - @addtogroup NFI NAND Flash Interface(NFI) - Memory Mapped Structure for NFI Controller -@{ */ - -typedef struct -{ - - - /** - * @var NFI_T::BUFFER0 - * Offset: 0x00 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER1 - * Offset: 0x04 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER2 - * Offset: 0x08 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER3 - * Offset: 0x0C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER4 - * Offset: 0x10 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER5 - * Offset: 0x14 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER6 - * Offset: 0x18 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER7 - * Offset: 0x1C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER8 - * Offset: 0x20 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER9 - * Offset: 0x24 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER10 - * Offset: 0x28 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER11 - * Offset: 0x2C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER12 - * Offset: 0x30 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER13 - * Offset: 0x34 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER14 - * Offset: 0x38 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER15 - * Offset: 0x3C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER16 - * Offset: 0x40 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER17 - * Offset: 0x44 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER18 - * Offset: 0x48 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER19 - * Offset: 0x4C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER20 - * Offset: 0x50 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER21 - * Offset: 0x54 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER22 - * Offset: 0x58 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER23 - * Offset: 0x5C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER24 - * Offset: 0x60 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER25 - * Offset: 0x64 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER26 - * Offset: 0x68 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER27 - * Offset: 0x6C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER28 - * Offset: 0x70 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER29 - * Offset: 0x74 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER30 - * Offset: 0x78 NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::BUFFER31 - * Offset: 0x7C NFI Embedded Buffer Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NFI Embedded Buffer Word n - * | | |This field indicates a 32-bit data of NAND Flash controller embedded buffer. - * @var NFI_T::DMACTL - * Offset: 0x400 NFI DMA Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMACEN |DMA Controller Engine Enable Bit - * | | |0 = DMA Controller Disabled. - * | | |1 = DMA Controller Enabled. - * | | |Note 1: If this bit is cleared, DMA will ignore all requests from NAND Flash and force bus master into IDLE state. - * | | |Note 2: If target abort occurred, DMACEN will be cleared. - * |[1] |DMARST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset internal state machine and pointers - * | | |The contents of control register will not be cleared - * | | |This bit will auto be cleared after a few clock cycles. - * | | |Note: The software reset DMA related registers. - * |[3] |SGEN |Scatter-gather Function for NFI Enable Bit - * | | |0 = Scatter-gather function Disabled (DMA will treat the starting address in DMASA as starting pointer of a single block memory). - * | | |1 = Scatter-gather function Enabled (DMA will treat the starting address in DMASA as a starting address of Physical Address Descriptor (PAD) table - * | | |The format of these Pads' will be described later). - * |[9] |DMABUSY |NFI DMA Transfer in Progress - * | | |This bit indicates if NFI is granted and doing DMA transfer or not. - * | | |0 = NFI DMA transfer is not in progress. - * | | |1 = NFI DMA transfer is in progress. - * @var NFI_T::DMASA - * Offset: 0x408 NFI DMA Transfer Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ORDER |Determined to the PAD Table Fetching Is in Order or Out of Order - * | | |0 = PAD table is fetched in order. - * | | |1 = PAD table is fetched out of order. - * | | |Note: the bit 0 is valid in scatter-gather mode when SGEN (NFI_DMACTL[3]) = 1. - * |[31:1] |DMASA |DMA Transfer Starting Address - * | | |This field pads 0 as least significant bit indicates a 32-bit starting address of system memory (SRAM) for DMA to retrieve or fill in data. - * | | |If DMA is not in normal mode, this field will be interpreted as a starting address of Physical Address Descriptor (PAD) table. - * | | |Note: Starting address of the SRAM must be word aligned, for example, 0x0000_0000, 0x0000_0004. - * @var NFI_T::DMABCNT - * Offset: 0x40C NFI DMA Transfer Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[25:0] |BCNT |DMA Transfer Byte Count (Read Only) - * | | |This field indicates the remained byte count of DMA transfer - * | | |The value of this field is valid only when NFI is busy; otherwise, it is zero. - * @var NFI_T::DMAINTEN - * Offset: 0x410 NFI DMA Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIEN |DMA Read/Write Target Abort Interrupt Enable Bit - * | | |0 = Target abort interrupt generation Disabled during DMA transfer. - * | | |1 = Target abort interrupt generation Enabled during DMA transfer. - * |[1] |WEOTIEN |Wrong EOT Encountered Interrupt Enable Bit - * | | |0 = Interrupt generation Disabled when wrong EOT (end of transfer) is encountered. - * | | |1 = Interrupt generation Enabled when wrong EOT (end of transfer) is encountered. - * @var NFI_T::DMAINTSTS - * Offset: 0x414 NFI DMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIF |DMA Read/Write Target Abort Interrupt Flag(Read Only) - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * | | |Note: When DMA's bus master received ERROR response, it means that target abort happened - * | | |DMA will stop transfer and respond this event by set ABORTIF high - * | | |Then, NFI go to IDLE state - * | | |When target abort occurred or WEOTIF is set, it is necessary to reset NFI's DMA and then transfer those data again. - * |[1] |WEOTIF |Wrong EOT Encountered Interrupt Flag(Read Only) - * | | |When DMA Scatter-Gather function is enabled, and EOT of the descriptor is encountered before DMA transfer finished (that means the total sector count of all PAD is less than the sector count of NFI), this bit will be set. - * | | |0 = No EOT encountered before DMA transfer finished. - * | | |1 = EOT encountered before DMA transfer finished. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var NFI_T::GCTL - * Offset: 0x800 NFI Global Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset all NFI engines. - * | | |Note: The contents of control register will not be cleared - * | | |This bit will auto cleared after a few clock cycles. - * |[3] |NANDEN |NAND Flash Functionality Enable Bit - * | | |0 = NAND Flash functionality of NFI Disabled. - * | | |1 = NAND Flash functionality of NFI Enabled. - * @var NFI_T::GINTEN - * Offset: 0x804 NFI Global Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIEN |DMA READ/WRITE Target Abort Interrupt Enable Bit - * | | |0 = DMA READ/WRITE target abort interrupt generation Disabled. - * | | |1 = DMA READ/WRITE target abort interrupt generation Enabled. - * @var NFI_T::GINTSTS - * Offset: 0x808 NFI Global Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIF |DMA READ/WRITE Target Abort Interrupt Flag (Read Only) - * | | |This bit indicates DMA received an ERROR response from internal AHB bus during DMA read/write operation - * | | |When Target Abort occurred, please reset all engines. - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var NFI_T::NANDCTL - * Offset: 0x8A0 NAND Flash Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SWRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset the internal state machine and counters (include DWREN (NFI_NANDCTL[2]) and DRDEN (NFI_NANDCTL[1])). - * | | |Note: The contents of control register will not be cleared - * | | |This bit will be auto cleared after a few clock cycles. - * |[1] |DRDEN |DMA Read Data Enable Bit - * | | |This bit enables NAND controller to transfer data (1 page) from NAND Flash or NAND type Flash into DMAC's embedded frame buffer. - * | | |0 = No effect. - * | | |1 = DMA read data transfer Enabled. - * | | |Note: When DMA transfer completed, this bit will be cleared automatically. - * |[2] |DWREN |DMA Write Data Enable Bit - * | | |This bit enables NAND controller to transfer data (1 page) from DMAC's embedded frame buffer into NAND Flash or NAND type Flash. - * | | |0 = No effect. - * | | |1 = DMA write data transfer Enabled. - * | | |Note: When DMA transfer completed, this bit will be cleared automatically. - * |[3] |REDUNREN |Redundant Area Read Enable Bit - * | | |This bit enables NAND controller to transfer redundant data from NAND Flash into NFI_NANDRA, the data size is dependent on NFI_NANDRACTL register. - * | | |0 = No effect. - * | | |1 = Read redundant data transfer Enabled. - * | | |Note: When transfer completed, this bit will be cleared automatically. - * |[4] |REDUNAUTOWEN|Redundant Area Auto Write Enable Bit - * | | |This field is used to auto write redundant data out to NAND Flash - * | | |The redundant data area is dependent on NFI_NANDRACTL register. - * | | |0 = Auto write redundant data out to NAND Flash Disabled. - * | | |1 = Auto write redundant data out to NAND Flash Enabled. - * |[7] |ECCCHK |None Used Field ECC Check After Read Page Data - * | | |0 = ECC check Disabled - * | | |The NAND controller will always check ECC result for each field, no matter it is used or not. - * | | |1 = ECC check Enabled - * | | |The NAND controller will check 1's count for byte 2, 3 of redundant data of the ECC in each field - * | | |If the count value is greater than 8, the NAND controller will treat this field as none used field; otherwise, it is used - * | | |If that field is none used field, the NAND controller will ignore its ECC check result. - * |[8] |PROT3BEN |Protect_3Byte Software Data Enable Bit - * | | |The ECC algorithm only protects data area and hardware ECC parity code - * | | |User can choose to protect software redundant data first 3 bytes by setting this bit high. - * | | |0 = Software redundant data is not protected by ECC algorithm. - * | | |1 = Software redundant data first 3 bytes protected by ECC algorithm. - * |[9] |SRAMINT |SRAM Initial - * | | |0 = No effect. - * | | |1 = Reset the internal NFI_NANDRA0~NFI_NANDRA1 to 0xFFFF_FFFF. - * | | |Note: The contents of control register will not be cleared - * | | |This bit will be auto cleared after a few clock cycles. - * |[17:16] |PSIZE |Page Size of NAND - * | | |This bit indicates the page size of NAND - * | | |There are four page sizes for choose, 2048 bytes/page, 4096 bytes/page and 8192 bytes/page - * | | |Before setting PSIZE register, user must set BCHTSEL register at first. - * | | |01 = Page size is 2048 bytes/page. - * | | |10 = Page size is 4096 bytes/page. - * | | |11 = Page size is 8192 bytes/page. - * |[22:18] |BCHTSEL |BCH Correct Bit Selection - * | | |This field is used to select BCH correct bits for data protecting - * | | |For BCH algorithm, T can be 8 or 12 or 24 for choosing (correct 8 or 12 or 24 bits). - * | | |00001 = Using BCH T24 to encode/decode (T24).(.1024 Bytes per block) - * | | |00100 = Using BCH T8 to encode/decode (T8). - * | | |01000 = Using BCH T12 to encode/decode (T12). - * |[23] |ECCEN |ECC Algorithm Enable Bit - * | | |This field is used to select the ECC algorithm for data protecting - * | | |The BCH algorithm can correct 8 or 12 or 24 bits. - * | | |0 = BCH code encode/decode Disabled. - * | | |1 = BCH code encode/decode Enabled. - * | | |Note: If disabling ECCEN and when reading data from NAND, the NAND controller will ignore its ECC check result - * | | |When writing data to NAND, the NAND controller will write out 0xFF to every parity field. - * | | |Note: The ECC algorithm only protects data area and hardware ECC parity code by default - * | | |By setting PROT3BEN (NFI_NANDCTL[8]) high, the first 3 bytes of redundant data are also protected by ECC algorithm. - * |[25] |CS0 |NAND Flash Chip Select 0 Enable Bit - * | | |0 = Chip select 0 Enabled. - * | | |1 = Chip select 0 Disabled. - * @var NFI_T::NANDTMCTL - * Offset: 0x8A4 NAND Flash Timing Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |LOWID |Read/Write Enable Signal Low Pulse Width - * | | |This field controls the low pulse width of signals -RE and -WE while HARDWARE mode page access is enabled - * | | |The pulse width is a multiple of period of AHB bus clock - * | | |( The actual width time will be [clock period*(LOWID+1)] ) - * |[15:8] |HIWID |Read/Write Enable Signal High Pulse Width - * | | |This field controls the high pulse width of signals -RE and -WE while HARDWARE mode page access is enabled - * | | |The pulse width is a multiple of period of AHB bus clock - * | | |( The actual width time will be [clock period*(HIWID+1)] ) - * |[22:16] |CALESH |CLE/ALE Setup/Hold Time - * | | |This field controls the CLE/ALE setup/hold time to -WE. - * | | |The setup/hold time can be calculated using following equation: - * | | |tCLS = (CALESH+1)*TAHB. - * | | |tCLH = ((CALESH*2)+2)*TAHB. - * | | |tALS = (CALESH+1)*TAHB. - * | | |tALH = ((CALESH*2)+2)*TAHB. - * |[27:24] |EDOD |EDO Mode Delay Time - * | | |Control this field to delay sampling point when NAND Flash enters EDO mode only. - * | | |The EDO mode delay time can be calculated using following equation: - * | | |Delay time = (EDOD+1)*(TAHB/2). - * |[31] |EDOEN |EDO Mode Enable Bit - * | | |This bit specifies NAND Flash to EDO mode - * | | |Before trigger this bit, software should fill EDOD(NFI_NANDTMCTL[27:24]), CALESH(NFI_NANDTMCTL[22:16]), HIWID(NFI_NANDTMCTL[15:8]) and LOWID(NFI_NANDTMCTL[7:0]). - * | | |0 = EDO Mode related function Disabled. - * | | |1 = EDO Mode related function Enabled. - * | | |Note: Only NAND Flash entering EDO mode should set this bit. - * @var NFI_T::NANDINTEN - * Offset: 0x8A8 NAND Flash Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMAIE |DMA Read/Write Data Complete Interrupt Enable Bit - * | | |0 = DMA read/write data complete interrupt generation Disabled. - * | | |1 = DMA read/write data complete interrupt generation Enabled. - * |[2] |ECCFLDIE |ECC Field Check Error Interrupt Enable Bit - * | | |This bit can check the ECC error on each field (512bytes) of data transfer - * | | |Enable this bit to detect error and do error correction. - * | | |0 = ECC field check error Disabled. - * | | |1 = ECC field check error Enabled. - * |[10] |RB0IE |Ready/-Busy Rising Edge Detect Interrupt Enable Bit - * | | |0 = R/-B rising edge detect interrupt generation Disabled. - * | | |1 = R/-B rising edge detect interrupt generation Enabled. - * @var NFI_T::NANDINTSTS - * Offset: 0x8AC NAND Flash Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMAIF |DMA Read/Write Data Complete Interrupt Flag (Read Only) - * | | |0 = DMA read/write transfer is not finished yet. - * | | |1 = DMA read/write transfer is done. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[2] |ECCFLDIF |ECC Field Check Error Interrupt Flag (Read Only) - * | | |This bit can check the ECC error on each field (512bytes) of data transfer - * | | |Read this bit to check if the error occurred. - * | | |0 = No occurrence of ECC error. - * | | |1 = Occurrence of ECC error. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[4] |EDOF |EDO Mode Entrance Flag (Read Only) - * | | |0 = NAND Flash did not enter EDO mode. - * | | |1 = NAND Flash entered EDO mode. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[10] |RB0IF |Ready/-Busy 0 Rising Edge Detect Interrupt Flag (Read Only) - * | | |0 = R/-B rising edge is not detected. - * | | |1 = R/-B rising edge is detected. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[18] |RB0Status |Ready/-Busy 0 Pin Status (Read Only) - * | | |This bit reflects the Ready/-Busy pin status of NAND Flash. - * @var NFI_T::NANDCMD - * Offset: 0x8B0 NAND Flash Command Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |COMMAND |NAND Flash Command Port - * | | |When CPU writes to this port, NFI will send a command to NAND Flash. - * @var NFI_T::NANDADDR - * Offset: 0x8B4 NAND Flash Address Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ADDRESS |NAND Flash Address Port - * | | |By writing this port, NAND Flash control will send an address to NAND Flash. - * |[31] |EOA |End of Address - * | | |Write this bit to indicate if this address is the last one or not - * | | |By writing address port with this bit low, the NAND Flash controller will set ALE pin to active (HIGH) - * | | |After the last address is written (with this bit set high), the NAND Flash controller will set ALE pin to inactive (LOW). - * | | |0 = Not the last address cycle. - * | | |1 = The last one address cycle. - * @var NFI_T::NANDDATA - * Offset: 0x8B8 NAND Flash Data Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DATA |NAND Flash Data Port - * | | |CPU can access NAND's memory array through this data port - * | | |When CPU WRITE, the lower 8-bit data from CPU will appear on the data bus of NAND controller - * | | |When CPU READ, NAND controller will get 8-bit data from data bus. - * @var NFI_T::NANDRACTL - * Offset: 0x8BC NAND Flash Redundant Area Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |RA128EN |Redundant Area 128 Byte Enable Bit - * | | |These bits indicate NAND Flash extended redundant area. - * | | |If PSIZE (NFI_NANDCTL[17:16]) = 2'b01, this field will be set 0x40 (64bytes) automatically. - * | | |If PSIZE (NFI_NANDCTL[17:16]) = 2'b10, this field will be set 0x80 (128 bytes) automatically. - * | | |If PSIZE (NFI_NANDCTL[17:16]) = 2'b11, this field will be set 0x100 (256bytes) automatically. - * | | |Note: The REA128EN must be 4 byte aligned, so bit1 and bit0 can't be filled 1 to it. - * | | |The maximum redundant area of the controller is 472Bytes. - * |[31:16] |MECC |Mask ECC During Write Page Data - * | | |These 16 bits registers indicate NAND controller to write out ECC parity or just 0xFF for each field (every 512 bytes) the real parity data will be write out to NFI_NANDRAx. - * | | |0x00 = Do not mask the ECC parity for each field. - * | | |0x01 = Mask ECC parity and write out FF to NAND ECC parity for 512 Bytes page size or 2K/4K/8K page size first 512 field. - * | | |0x02 = Mask ECC parity and write out FF to NAND ECC parity for 512 Bytes page size or 2K/4K/8K page size second 512 field. - * | | |Others = Mask ECC parity and write out FF to NAND ECC parity for 512 Bytes page size or 2K/4K/8K page size each 512 field. - * @var NFI_T::NANDECTL - * Offset: 0x8C0 NAND Flash Extend Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WP |NAND Flash Write Protect Control - * | | |Set this bit low (low active) to make NAND_nWP functional pin low to prevent the write to NAND Flash device. - * | | |0 = NAND Flash is write-protected and is not writeable. - * | | |1 = NAND Flash is not write-protected and is writeable. - * @var NFI_T::NANDECCES0 - * Offset: 0x8D0 NAND Flash ECC Error Status 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |F1STAT |ECC Status of Field 1 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 1. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[6:2] |F1ECNT |Error Count of ECC Field 1 - * | | |This field contains the error counts after ECC correct calculation of Field 1 - * | | |For this ECC core (BCH algorithm), only when F1STAT equals to 0x01, the value in this field is meaningful - * | | |F1ECNT means how many errors depending on which ECC is used. - * |[9:8] |F2STAT |ECC Status of Field 2 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 2. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[14:10] |F2ECNT |Error Count of ECC Field 2 - * | | |This field contains the error counts after ECC correct calculation of Field 2 - * | | |For this ECC core (BCH algorithm), only when F2STAT equals to 0x01, the value in this field is meaningful - * | | |F2ECNT means how many errors depending on which ECC is used. - * |[17:16] |F3STAT |ECC Status of Field 3 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 3. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[22:18] |F3ECNT |Error Count of ECC Field 3 - * | | |This field contains the error counts after ECC correct calculation of Field 3 - * | | |For this ECC core (BCH algorithm), only when F3STAT equals to 0x01, the value in this field is meaningful - * | | |F3ECNT means how many errors depending on which ECC is used. - * |[25:24] |F4STAT |ECC Status of Field 4 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 4. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[30:26] |F4ECNT |Error Count of ECC Field 4 - * | | |This field contains the error counts after ECC correct calculation of Field 4 - * | | |For this ECC core (BCH algorithm), only when F4STAT equals to 0x01, the value in this field is meaningful - * | | |F4ECNT means how many errors depending on which ECC is used. - * @var NFI_T::NANDECCES1 - * Offset: 0x8D4 NAND Flash ECC Error Status 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |F5STAT |ECC Status of Field 5 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field5. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[6:2] |F5ECNT |Error Count of ECC Field 5 - * | | |This field contains the error counts after ECC correct calculation of Field 5 - * | | |For this ECC core (BCH algorithm), only when F5STAT equals to 0x01, the value in this field is meaningful - * | | |F5ECNT means how many errors depending on which ECC is used. - * |[9:8] |F6STAT |ECC Status of Field 6 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 6. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[14:10] |F6ECNT |Error Count of ECC Field 6 - * | | |This field contains the error counts after ECC correct calculation of Field 6 - * | | |For this ECC core (BCH algorithm), only when F6STAT equals to 0x01, the value in this field is meaningful - * | | |F6ECNT means how many errors depending on which ECC is used. - * |[17:16] |F7STAT |ECC Status of Field 7 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 7. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[22:18] |F7ECNT |Error Count of ECC Field 7 - * | | |This field contains the error counts after ECC correct calculation of Field 7 - * | | |For this ECC core (BCH algorithm), only when F7STAT equals to 0x01, the value in this field is meaningful - * | | |F7ECNT means how many errors depending on which ECC is used. - * |[25:24] |F8STAT |ECC Status of Field 8 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 8. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[30:26] |F8ECNT |Error Count of ECC Field 8 - * | | |This field contains the error counts after ECC correct calculation of Field 8 - * | | |For this ECC core (BCH algorithm), only when F8STAT equals to 0x01, the value in this field is meaningful - * | | |F8ECNT means how many errors depending on which ECC is used. - * @var NFI_T::NANDECCES2 - * Offset: 0x8D8 NAND Flash ECC Error Status 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |F9STAT |ECC Status of Field 9 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 9. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[6:2] |F9ECNT |Error Count of ECC Field 9 - * | | |This field contains the error counts after ECC correct calculation of Field 9 - * | | |For this ECC core (BCH algorithm), only when F9STAT equals to 0x01, the value in this field is meaningful - * | | |F9ECNT means how many errors depending on which ECC is used. - * |[9:8] |F10STAT |ECC Status of Field 10 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 10. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[14:10] |F10ECNT |Error Count of ECC Field 10 - * | | |This field contains the error counts after ECC correct calculation of Field 10 - * | | |For this ECC core (BCH algorithm), only when F10STAT equals to 0x01, the value in this field is meaningful - * | | |F10ECNT means how many errors depending on which ECC is used. - * |[17:16] |F11STAT |ECC Status of Field 11 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 11. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[22:18] |F11ECNT |Error Count of ECC Field 11 - * | | |This field contains the error counts after ECC correct calculation of Field 11 - * | | |For this ECC core (BCH algorithm), only when F11STAT equals to 0x01, the value in this field is meaningful - * | | |F11ECNT means how many errors depending on which ECC is used. - * |[25:24] |F12STAT |ECC Status of Field 12 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 12. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[30:26] |F12ECNT |Error Count of ECC Field 12 - * | | |This field contains the error counts after ECC correct calculation of Field 12 - * | | |For this ECC core (BCH algorithm), only when F12STAT equals to 0x01, the value in this field is meaningful - * | | |F12ECNT means how many errors depending on which ECC is used. - * @var NFI_T::NANDECCES3 - * Offset: 0x8DC NAND Flash ECC Error Status 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |F13STAT |ECC Status of Field 13 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 13. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[6:2] |F13ECNT |Error Count of ECC Field 13 - * | | |This field contains the error counts after ECC correct calculation of Field 13 - * | | |For this ECC core (BCH algorithm), only when F13STAT equals to 0x01, the value in this field is meaningful - * | | |F13ECNT means how many errors depending on which ECC is used. - * |[9:8] |F14STAT |ECC Status of Field 14 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 14. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[14:10] |F14ECNT |Error Count of ECC Field 14 - * | | |This field contains the error counts after ECC correct calculation of Field 14 - * | | |For this ECC core (BCH algorithm), only when F14STAT equals to 0x01, the value in this field is meaningful - * | | |F14ECNT means how many errors depending on which ECC is used. - * |[17:16] |F15STAT |ECC Status of Field 15 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 15. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[22:18] |F15ECNT |Error Count of ECC Field 15 - * | | |This field contains the error counts after ECC correct calculation of Field 15 - * | | |For this ECC core (BCH algorithm), only when F15STAT equals to 0x01, the value in this field is meaningful - * | | |F15ECNT means how many errors depending on which ECC is used. - * |[25:24] |F16STAT |ECC Status of Field 16 - * | | |This field contains the ECC correction status (BCH algorithm) of ECC-field 16. - * | | |00 = No error. - * | | |01 = Correctable error. - * | | |10 = Uncorrectable error. - * | | |11 = Reserved. - * |[30:26] |F16ECNT |Error Count of ECC Field 16 - * | | |This field contains the error counts after ECC correct calculation of Field 16 - * | | |For this ECC core (BCH algorithm), only when F16STAT equals to 0x01, the value in this field is meaningful - * | | |F16ECNT means how many errors depending on which ECC is used. - * @var NFI_T::NANDECCEA0 - * Offset: 0x900 NAND Flash ECC Error Byte Address 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR0 |ECC Error Address First Field of Error 0 - * | | |This field contains an 11-bit ECC error address 0 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA0 (NFI_NANDECCED0[7:0]), to correct this error. - * |[26:16] |ERRADDR1 |ECC Error Address First Field of Error 1 - * | | |This field contains an 11-bit ECC error address 1 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA1 (NFI_NANDECCED0[15:8]), to correct this error. - * @var NFI_T::NANDECCEA1 - * Offset: 0x904 NAND Flash ECC Error Byte Address 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR2 |ECC Error Address First Field of Error 2 - * | | |This field contains an 11-bit ECC error address 2 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA2 (NFI_NANDECCED0[23:16]), to correct this error. - * |[26:16] |ERRADDR3 |ECC Error Address First Field of Error 3 - * | | |This field contains an 11-bit ECC error address 3 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA3 (NFI_NANDECCED0[31:24]), to correct this error. - * @var NFI_T::NANDECCEA2 - * Offset: 0x908 NAND Flash ECC Error Byte Address 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR4 |ECC Error Address First Field of Error 4 - * | | |This field contains an 11-bit ECC error address 4 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA4 (NFI_NANDECCED1[7:0]), to correct this error. - * |[26:16] |ERRADDR5 |ECC Error Address First Field of Error 5 - * | | |This field contains an 11-bit ECC error address 5 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA5 (NFI_NANDECCED1[15:8]), to correct this error. - * @var NFI_T::NANDECCEA3 - * Offset: 0x90C NAND Flash ECC Error Byte Address 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR6 |ECC Error Address First Field of Error 6 - * | | |This field contains an 11-bit ECC error address 6 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA6 (NFI_NANDECCED1[23:16]), to correct this error. - * |[26:16] |ERRADDR7 |ECC Error Address First Field of Error 7 - * | | |This field contains an 11-bit ECC error address 7 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA7 (NFI_NANDECCED1[31:24]), to correct this error. - * @var NFI_T::NANDECCEA4 - * Offset: 0x910 NAND Flash ECC Error Byte Address 4 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR8 |ECC Error Address First Field of Error 8 - * | | |This field contains an 11-bit ECC error address 8 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA8 (NFI_NANDECCED2[7:0]), to correct this error. - * |[26:16] |ERRADDR9 |ECC Error Address First Field of Error 9 - * | | |This field contains an 11-bit ECC error address 9 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA9 (NFI_NANDECCED2[15:8]), to correct this error. - * @var NFI_T::NANDECCEA5 - * Offset: 0x914 NAND Flash ECC Error Byte Address 5 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR10 |ECC Error Address First Field of Error 10 - * | | |This field contains an 11-bit ECC error address 10 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA10 (NFI_NANDECCED2[23:16]), to correct this error. - * |[26:16] |ERRADDR11 |ECC Error Address First Field of Error 11 - * | | |This field contains an 11-bit ECC error address 11 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA11 (NFI_NANDECCED2[31:24]), to correct this error. - * @var NFI_T::NANDECCEA6 - * Offset: 0x918 NAND Flash ECC Error Byte Address 6 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR12 |ECC Error Address First Field of Error 12 - * | | |This field contains an 11-bit ECC error address 12 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA12 (NFI_NANDECCED3[7:0]), to correct this error. - * |[26:16] |ERRADDR13 |ECC Error Address First Field of Error 13 - * | | |This field contains an 11-bit ECC error address 13 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA13 (NFI_NANDECCED3[15:8]), to correct this error. - * @var NFI_T::NANDECCEA7 - * Offset: 0x91C NAND Flash ECC Error Byte Address 7 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR14 |ECC Error Address First Field of Error 14 - * | | |This field contains an 11-bit ECC error address 14 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA14 (NFI_NANDECCED3[23:16]), to correct this error. - * |[26:16] |ERRADDR15 |ECC Error Address First Field of Error 15 - * | | |This field contains an 11-bit ECC error address 15 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA15 (NFI_NANDECCED3[31:24]), to correct this error. - * @var NFI_T::NANDECCEA8 - * Offset: 0x920 NAND Flash ECC Error Byte Address 8 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR16 |ECC Error Address First Field of Error 16 - * | | |This field contains an 11-bit ECC error address 16 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA16 (NFI_NANDECCED4[7:0]), to correct this error. - * |[26:16] |ERRADDR17 |ECC Error Address First Field of Error 17 - * | | |This field contains an 11-bit ECC error address 17 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA17 (NFI_NANDECCED4[15:8]), to correct this error. - * @var NFI_T::NANDECCEA9 - * Offset: 0x924 NAND Flash ECC Error Byte Address 9 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR18 |ECC Error Address First Field of Error 18 - * | | |This field contains an 11-bit ECC error address 18 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA18 (NFI_NANDECCED4[23:16]), to correct this error. - * |[26:16] |ERRADDR19 |ECC Error Address First Field of Error 19 - * | | |This field contains an 11-bit ECC error address 19 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA19 (NFI_NANDECCED4[31:24]), to correct this error. - * @var NFI_T::NANDECCEA10 - * Offset: 0x928 NAND Flash ECC Error Byte Address 10 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR20 |ECC Error Address First Field of Error 20 - * | | |This field contains an 11-bit ECC error address 20 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA20 (NFI_NANDECCED5[7:0]), to correct this error. - * |[26:16] |ERRADDR21 |ECC Error Address First Field of Error 21 - * | | |This field contains an 11-bit ECC error address 21 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA21 (NFI_NANDECCED5[15:8]), to correct this error. - * @var NFI_T::NANDECCEA11 - * Offset: 0x92C NAND Flash ECC Error Byte Address 11 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |ERRADDR22 |ECC Error Address First Field of Error 22 - * | | |This field contains an 11-bit ECC error address 22 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA22 (NFI_NANDECCED5[23:16]), to correct this error. - * |[26:16] |ERRADDR23 |ECC Error Address First Field of Error 23 - * | | |This field contains an 11-bit ECC error address 23 of first field - * | | |If it is a correctable error, please read the error data, ERRDATA23 (NFI_NANDECCED5[31:24]), to correct this error. - * @var NFI_T::NANDECCED0 - * Offset: 0x960 NAND Flash ECC Error Data Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ERRDATA0 |ECC Error Data of First Field 0 - * | | |This field contains an 8-bit BCH ECC error data 0 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR0 (NFI_ANNDECCEA0[10:0]), and then the result will be the correct data. - * |[15:8] |ERRDATA1 |ECC Error Data of First Field 1 - * | | |This field contains an 8-bit BCH ECC error data 1 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR1 (NFI_NANDECCEA0[26:16]), and then the result will be the correct data. - * |[23:16] |ERRDATA2 |ECC Error Data of First Field 2 - * | | |This field contains an 8-bit BCH ECC error data 2 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR2 (NFI_NANDECCEA1[10:0]), and then the result will be the correct data. - * |[31:24] |ERRDATA3 |ECC Error Data of First Field 3 - * | | |This field contains an 8-bit BCH ECC error data 3 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR3 (NFI_NANDECCEA1[26:16]), and then the result will be the correct data. - * @var NFI_T::NANDECCED1 - * Offset: 0x964 NAND Flash ECC Error Data Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ERRDATA4 |ECC Error Data of First Field 4 - * | | |This field contains an 8-bit BCH ECC error data 4 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR4 (NFI_NANDECCEA2[10:0]), and then the result will be the correct data. - * |[15:8] |ERRDATA5 |ECC Error Data of First Field 5 - * | | |This field contains an 8-bit BCH ECC error data 5 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR5 (NFI_NANDECCEA2[26:16]), and then the result will be the correct data. - * |[23:16] |ERRDATA6 |ECC Error Data of First Field 6 - * | | |This field contains an 8-bit BCH ECC error data 6 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR6 (NFI_NANDECCEA3[10:0]), and then the result will be the correct data. - * |[31:24] |ERRDATA7 |ECC Error Data of First Field 7 - * | | |This field contains an 8-bit BCH ECC error data 7 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR7 (NFI_NANDECCEA3[26:16]), and then the result will be the correct data. - * @var NFI_T::NANDECCED2 - * Offset: 0x968 NAND Flash ECC Error Data Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ERRDATA8 |ECC Error Data of First Field 8 - * | | |This field contains an 8-bit BCH ECC error data 8 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR8 (NFI_NANDECCEA4[10:0]), and then the result will be the correct data. - * |[15:8] |ERRDATA9 |ECC Error Data of First Field 9 - * | | |This field contains an 8-bit BCH ECC error data 9 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR9 (NFI_NANDECCEA4[26:16]), and then the result will be the correct data. - * |[23:16] |ERRDATA10 |ECC Error Data of First Field 10 - * | | |This field contains an 8-bit BCH ECC error data 10 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR10 (NFI_NANDECCEA5[10:0]), and then the result will be the correct data. - * |[31:24] |ERRDATA11 |ECC Error Data of First Field 11 - * | | |This field contains an 8-bit BCH ECC error data 11 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR11 (NFI_NANDECCEA5[26:16]), and then the result will be the correct data. - * @var NFI_T::NANDECCED3 - * Offset: 0x96C NAND Flash ECC Error Data Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ERRDATA12 |ECC Error Data of First Field 12 - * | | |This field contains an 8-bit BCH ECC error data 12 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR12 (NFI_NANDECCEA6[10:0]), and then the result will be the correct data. - * |[15:8] |ERRDATA13 |ECC Error Data of First Field 13 - * | | |This field contains an 8-bit BCH ECC error data 13 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR13 (NFI_NANDECCEA6[26:16]), and then the result will be the correct data. - * |[23:16] |ERRDATA14 |ECC Error Data of First Field 14 - * | | |This field contains an 8-bit BCH ECC error data 14 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR14 (NFI_NANDECCEA7[10:0]), and then the result will be the correct data. - * |[31:24] |ERRDATA15 |ECC Error Data of First Field 15 - * | | |This field contains an 8-bit BCH ECC error data 15 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR15 (NFI_NANDECCEA7[26:16]), and then the result will be the correct data. - * @var NFI_T::NANDECCED4 - * Offset: 0x970 NAND Flash ECC Error Data Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ERRDATA16 |ECC Error Data of First Field 16 - * | | |This field contains an 8-bit BCH ECC error data 16 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR16 (NFI_NANDECCEA8[10:0]), and then the result will be the correct data. - * |[15:8] |ERRDATA17 |ECC Error Data of First Field 17 - * | | |This field contains an 8-bit BCH ECC error data 17 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR17 (NFI_NANDECCEA8[26:16]), and then the result will be the correct data. - * |[23:16] |ERRDATA18 |ECC Error Data of First Field 18 - * | | |This field contains an 8-bit BCH ECC error data 18 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR18 (NFI_NANDECCEA9[10:0]), and then the result will be the correct data. - * |[31:24] |ERRDATA19 |ECC Error Data of First Field 19 - * | | |This field contains an 8-bit BCH ECC error data 19 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR19 (NFI_NANDECCEA9[26:16]), and then the result will be the correct data. - * @var NFI_T::NANDECCED5 - * Offset: 0x974 NAND Flash ECC Error Data Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |ERRDATA20 |ECC Error Data of First Field 20 - * | | |This field contains an 8-bit BCH ECC error data 20 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR20 (NFI_NANDECCEA10[10:0]), and then the result will be the correct data. - * |[15:8] |ERRDATA21 |ECC Error Data of First Field 21 - * | | |This field contains an 8-bit BCH ECC error data 21 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR21 (NFI_NANDECCEA10[26:16]), and then the result will be the correct data. - * |[23:16] |ERRDATA22 |ECC Error Data of First Field 22 - * | | |This field contains an 8-bit BCH ECC error data 22 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR22 (NFI_NANDECCEA11[10:0]), and then the result will be the correct data. - * |[31:24] |ERRDATA23 |ECC Error Data of First Field 23 - * | | |This field contains an 8-bit BCH ECC error data 23 of first field - * | | |If it is a correctable error, please read out the error data in this field and doing bitwise XOR with received data locating at address ERRADDR23 (NFI_NANDECCEA11[26:16]), and then the result will be the correct data. - * @var NFI_T::NANDRA0 - * Offset: 0xA00 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA1 - * Offset: 0xA04 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA2 - * Offset: 0xA08 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA3 - * Offset: 0xA0C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA4 - * Offset: 0xA10 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA5 - * Offset: 0xA14 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA6 - * Offset: 0xA18 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA7 - * Offset: 0xA1C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA8 - * Offset: 0xA20 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA9 - * Offset: 0xA24 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA10 - * Offset: 0xA28 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA11 - * Offset: 0xA2C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA12 - * Offset: 0xA30 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA13 - * Offset: 0xA34 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA14 - * Offset: 0xA38 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA15 - * Offset: 0xA3C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA16 - * Offset: 0xA40 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA17 - * Offset: 0xA44 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA18 - * Offset: 0xA48 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA19 - * Offset: 0xA4C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA20 - * Offset: 0xA50 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA21 - * Offset: 0xA54 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA22 - * Offset: 0xA58 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA23 - * Offset: 0xA5C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA24 - * Offset: 0xA60 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA25 - * Offset: 0xA64 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA26 - * Offset: 0xA68 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA27 - * Offset: 0xA6C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA28 - * Offset: 0xA70 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA29 - * Offset: 0xA74 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA30 - * Offset: 0xA78 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA31 - * Offset: 0xA7C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA32 - * Offset: 0xA80 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA33 - * Offset: 0xA84 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA34 - * Offset: 0xA88 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA35 - * Offset: 0xA8C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA36 - * Offset: 0xA90 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA37 - * Offset: 0xA94 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA38 - * Offset: 0xA98 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA39 - * Offset: 0xA9C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA40 - * Offset: 0xAA0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA41 - * Offset: 0xAA4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA42 - * Offset: 0xAA8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA43 - * Offset: 0xAAC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA44 - * Offset: 0xAB0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA45 - * Offset: 0xAB4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA46 - * Offset: 0xAB8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA47 - * Offset: 0xABC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA48 - * Offset: 0xAC0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA49 - * Offset: 0xAC4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA50 - * Offset: 0xAC8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA51 - * Offset: 0xACC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA52 - * Offset: 0xAD0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA53 - * Offset: 0xAD4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA54 - * Offset: 0xAD8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA55 - * Offset: 0xADC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA56 - * Offset: 0xAE0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA57 - * Offset: 0xAE4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA58 - * Offset: 0xAE8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA59 - * Offset: 0xAEC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA60 - * Offset: 0xAF0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA61 - * Offset: 0xAF4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA62 - * Offset: 0xAF8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA63 - * Offset: 0xAFC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA64 - * Offset: 0xB00 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA65 - * Offset: 0xB04 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA66 - * Offset: 0xB08 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA67 - * Offset: 0xB0C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA68 - * Offset: 0xB10 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA69 - * Offset: 0xB14 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA70 - * Offset: 0xB18 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA71 - * Offset: 0xB1C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA72 - * Offset: 0xB20 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA73 - * Offset: 0xB24 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA74 - * Offset: 0xB28 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA75 - * Offset: 0xB2C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA76 - * Offset: 0xB30 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA77 - * Offset: 0xB34 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA78 - * Offset: 0xB38 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA79 - * Offset: 0xB3C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA80 - * Offset: 0xB40 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA81 - * Offset: 0xB44 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA82 - * Offset: 0xB48 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA83 - * Offset: 0xB4C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA84 - * Offset: 0xB50 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA85 - * Offset: 0xB54 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA86 - * Offset: 0xB58 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA87 - * Offset: 0xB5C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA88 - * Offset: 0xB60 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA89 - * Offset: 0xB64 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA90 - * Offset: 0xB68 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA91 - * Offset: 0xB6C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA92 - * Offset: 0xB70 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA93 - * Offset: 0xB74 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA94 - * Offset: 0xB78 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA95 - * Offset: 0xB7C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA96 - * Offset: 0xB80 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA97 - * Offset: 0xB84 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA98 - * Offset: 0xB88 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA99 - * Offset: 0xB8C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA100 - * Offset: 0xB90 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA101 - * Offset: 0xB94 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA102 - * Offset: 0xB98 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA103 - * Offset: 0xB9C NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA104 - * Offset: 0xBA0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA105 - * Offset: 0xBA4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA106 - * Offset: 0xBA8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA107 - * Offset: 0xBAC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA108 - * Offset: 0xBB0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA109 - * Offset: 0xBB4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA110 - * Offset: 0xBB8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA111 - * Offset: 0xBBC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA112 - * Offset: 0xBC0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA113 - * Offset: 0xBC4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA114 - * Offset: 0xBC8 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA115 - * Offset: 0xBCC NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA116 - * Offset: 0xBD0 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - * @var NFI_T::NANDRA117 - * Offset: 0xBD4 NAND Flash Redundant Area Word n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |Data |NAND Flash Redundant Area Word n - * | | |This field indicates a 32-bit data of redundant area. - */ - __IO uint32_t BUFFER[32]; /*!< [0x0000] NFI Embedded Buffer Word n */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[224]; /*!< [0x0080~0x03FC] */ - /** @endcond */ - __IO uint32_t DMACTL; /*!< [0x0400] NFI DMA Control and Status Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE1[1]; /*!< [0x0404] */ - /** @endcond */ - __IO uint32_t DMASA; /*!< [0x0408] NFI DMA Transfer Starting Address Register */ - __I uint32_t DMABCNT; /*!< [0x040c] NFI DMA Transfer Byte Count Register */ - __IO uint32_t DMAINTEN; /*!< [0x0410] NFI DMA Interrupt Enable Control Register */ - __I uint32_t DMAINTSTS; /*!< [0x0414] NFI DMA Interrupt Status Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE2[250]; /*!< [0x0418~0x07FC] */ - /** @endcond */ - __IO uint32_t GCTL; /*!< [0x0800] NFI Global Control and Status Register */ - __IO uint32_t GINTEN; /*!< [0x0804] NFI Global Interrupt Control Register */ - __I uint32_t GINTSTS; /*!< [0x0808] NFI Global Interrupt Status Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE3[37]; /*!< [0x080C~0x089C] */ - /** @endcond */ - __IO uint32_t NANDCTL; /*!< [0x08a0] NAND Flash Control Register */ - __IO uint32_t NANDTMCTL; /*!< [0x08a4] NAND Flash Timing Control Register */ - __IO uint32_t NANDINTEN; /*!< [0x08a8] NAND Flash Interrupt Enable Register */ - __IO uint32_t NANDINTSTS; /*!< [0x08ac] NAND Flash Interrupt Status Register */ - __O uint32_t NANDCMD; /*!< [0x08b0] NAND Flash Command Port Register */ - __O uint32_t NANDADDR; /*!< [0x08b4] NAND Flash Address Port Register */ - __IO uint32_t NANDDATA; /*!< [0x08b8] NAND Flash Data Port Register */ - __IO uint32_t NANDRACTL; /*!< [0x08bc] NAND Flash Redundant Area Control Register */ - __IO uint32_t NANDECTL; /*!< [0x08c0] NAND Flash Extend Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE4[3]; /*!< [0x08C4~0x08CC] */ - /** @endcond */ - __I uint32_t NANDECCES[4]; /*!< [0x08d0] NAND Flash ECC Error Status 0 Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE5[8]; /*!< [0x08E0~0x08FC] */ - /** @endcond */ - __I uint32_t NANDECCEA[12]; /*!< [0x0900] NAND Flash ECC Error Byte Address 0 Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE6[12]; /*!< [0x0930~0x095C] */ - /** @endcond */ - __I uint32_t NANDECCED[6]; /*!< [0x0960] NAND Flash ECC Error Data Register 0 */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE7[34]; /*!< [0x0978~0x09FC] */ - /** @endcond */ - __IO uint32_t NANDRA[118]; /*!< [0x0a00] NAND Flash Redundant Area Word n */ -} NFI_T; - -/** - @addtogroup NFI_CONST NFI Bit Field Definition - Constant Definitions for NFI Controller -@{ */ - -#define NFI_BUFFER_Data_Pos (0) /*!< NFI_T::BUFFER0: Data Position */ -#define NFI_BUFFER_Data_Msk (0xfffffffful << NFI_BUFFER0_Data_Pos) /*!< NFI_T::BUFFER0: Data Mask */ - -#define NFI_DMACTL_DMACEN_Pos (0) /*!< NFI_T::DMACTL: DMACEN Position */ -#define NFI_DMACTL_DMACEN_Msk (0x1ul << NFI_DMACTL_DMACEN_Pos) /*!< NFI_T::DMACTL: DMACEN Mask */ - -#define NFI_DMACTL_DMARST_Pos (1) /*!< NFI_T::DMACTL: DMARST Position */ -#define NFI_DMACTL_DMARST_Msk (0x1ul << NFI_DMACTL_DMARST_Pos) /*!< NFI_T::DMACTL: DMARST Mask */ - -#define NFI_DMACTL_SGEN_Pos (3) /*!< NFI_T::DMACTL: SGEN Position */ -#define NFI_DMACTL_SGEN_Msk (0x1ul << NFI_DMACTL_SGEN_Pos) /*!< NFI_T::DMACTL: SGEN Mask */ - -#define NFI_DMACTL_DMABUSY_Pos (9) /*!< NFI_T::DMACTL: DMABUSY Position */ -#define NFI_DMACTL_DMABUSY_Msk (0x1ul << NFI_DMACTL_DMABUSY_Pos) /*!< NFI_T::DMACTL: DMABUSY Mask */ - -#define NFI_DMASA_ORDER_Pos (0) /*!< NFI_T::DMASA: ORDER Position */ -#define NFI_DMASA_ORDER_Msk (0x1ul << NFI_DMASA_ORDER_Pos) /*!< NFI_T::DMASA: ORDER Mask */ - -#define NFI_DMASA_DMASA_Pos (1) /*!< NFI_T::DMASA: DMASA Position */ -#define NFI_DMASA_DMASA_Msk (0x7ffffffful << NFI_DMASA_DMASA_Pos) /*!< NFI_T::DMASA: DMASA Mask */ - -#define NFI_DMABCNT_BCNT_Pos (0) /*!< NFI_T::DMABCNT: BCNT Position */ -#define NFI_DMABCNT_BCNT_Msk (0x3fffffful << NFI_DMABCNT_BCNT_Pos) /*!< NFI_T::DMABCNT: BCNT Mask */ - -#define NFI_DMAINTEN_ABORTIEN_Pos (0) /*!< NFI_T::DMAINTEN: ABORTIEN Position */ -#define NFI_DMAINTEN_ABORTIEN_Msk (0x1ul << NFI_DMAINTEN_ABORTIEN_Pos) /*!< NFI_T::DMAINTEN: ABORTIEN Mask */ - -#define NFI_DMAINTEN_WEOTIEN_Pos (1) /*!< NFI_T::DMAINTEN: WEOTIEN Position */ -#define NFI_DMAINTEN_WEOTIEN_Msk (0x1ul << NFI_DMAINTEN_WEOTIEN_Pos) /*!< NFI_T::DMAINTEN: WEOTIEN Mask */ - -#define NFI_DMAINTSTS_ABORTIF_Pos (0) /*!< NFI_T::DMAINTSTS: ABORTIF Position */ -#define NFI_DMAINTSTS_ABORTIF_Msk (0x1ul << NFI_DMAINTSTS_ABORTIF_Pos) /*!< NFI_T::DMAINTSTS: ABORTIF Mask */ - -#define NFI_DMAINTSTS_WEOTIF_Pos (1) /*!< NFI_T::DMAINTSTS: WEOTIF Position */ -#define NFI_DMAINTSTS_WEOTIF_Msk (0x1ul << NFI_DMAINTSTS_WEOTIF_Pos) /*!< NFI_T::DMAINTSTS: WEOTIF Mask */ - -#define NFI_GCTL_GCTLRST_Pos (0) /*!< NFI_T::GCTL: GCTLRST Position */ -#define NFI_GCTL_GCTLRST_Msk (0x1ul << NFI_GCTL_GCTLRST_Pos) /*!< NFI_T::GCTL: GCTLRST Mask */ - -#define NFI_GCTL_NANDEN_Pos (3) /*!< NFI_T::GCTL: NANDEN Position */ -#define NFI_GCTL_NANDEN_Msk (0x1ul << NFI_GCTL_NANDEN_Pos) /*!< NFI_T::GCTL: NANDEN Mask */ - -#define NFI_GINTEN_DTAIEN_Pos (0) /*!< NFI_T::GINTEN: DTAIEN Position */ -#define NFI_GINTEN_DTAIEN_Msk (0x1ul << NFI_GINTEN_DTAIEN_Pos) /*!< NFI_T::GINTEN: DTAIEN Mask */ - -#define NFI_GINTSTS_DTAIF_Pos (0) /*!< NFI_T::GINTSTS: DTAIF Position */ -#define NFI_GINTSTS_DTAIF_Msk (0x1ul << NFI_GINTSTS_DTAIF_Pos) /*!< NFI_T::GINTSTS: DTAIF Mask */ - -#define NFI_NANDCTL_SWRST_Pos (0) /*!< NFI_T::NANDCTL: SWRST Position */ -#define NFI_NANDCTL_SWRST_Msk (0x1ul << NFI_NANDCTL_SWRST_Pos) /*!< NFI_T::NANDCTL: SWRST Mask */ - -#define NFI_NANDCTL_DRDEN_Pos (1) /*!< NFI_T::NANDCTL: DRDEN Position */ -#define NFI_NANDCTL_DRDEN_Msk (0x1ul << NFI_NANDCTL_DRDEN_Pos) /*!< NFI_T::NANDCTL: DRDEN Mask */ - -#define NFI_NANDCTL_DWREN_Pos (2) /*!< NFI_T::NANDCTL: DWREN Position */ -#define NFI_NANDCTL_DWREN_Msk (0x1ul << NFI_NANDCTL_DWREN_Pos) /*!< NFI_T::NANDCTL: DWREN Mask */ - -#define NFI_NANDCTL_REDUNREN_Pos (3) /*!< NFI_T::NANDCTL: REDUNREN Position */ -#define NFI_NANDCTL_REDUNREN_Msk (0x1ul << NFI_NANDCTL_REDUNREN_Pos) /*!< NFI_T::NANDCTL: REDUNREN Mask */ - -#define NFI_NANDCTL_REDUNAUTOWEN_Pos (4) /*!< NFI_T::NANDCTL: REDUNAUTOWEN Position */ -#define NFI_NANDCTL_REDUNAUTOWEN_Msk (0x1ul << NFI_NANDCTL_REDUNAUTOWEN_Pos) /*!< NFI_T::NANDCTL: REDUNAUTOWEN Mask */ - -#define NFI_NANDCTL_ECCCHK_Pos (7) /*!< NFI_T::NANDCTL: ECCCHK Position */ -#define NFI_NANDCTL_ECCCHK_Msk (0x1ul << NFI_NANDCTL_ECCCHK_Pos) /*!< NFI_T::NANDCTL: ECCCHK Mask */ - -#define NFI_NANDCTL_PROT3BEN_Pos (8) /*!< NFI_T::NANDCTL: PROT3BEN Position */ -#define NFI_NANDCTL_PROT3BEN_Msk (0x1ul << NFI_NANDCTL_PROT3BEN_Pos) /*!< NFI_T::NANDCTL: PROT3BEN Mask */ - -#define NFI_NANDCTL_SRAMINT_Pos (9) /*!< NFI_T::NANDCTL: SRAMINT Position */ -#define NFI_NANDCTL_SRAMINT_Msk (0x1ul << NFI_NANDCTL_SRAMINT_Pos) /*!< NFI_T::NANDCTL: SRAMINT Mask */ - -#define NFI_NANDCTL_PSIZE_Pos (16) /*!< NFI_T::NANDCTL: PSIZE Position */ -#define NFI_NANDCTL_PSIZE_Msk (0x3ul << NFI_NANDCTL_PSIZE_Pos) /*!< NFI_T::NANDCTL: PSIZE Mask */ - -#define NFI_NANDCTL_BCHTSEL_Pos (18) /*!< NFI_T::NANDCTL: BCHTSEL Position */ -#define NFI_NANDCTL_BCHTSEL_Msk (0x1ful << NFI_NANDCTL_BCHTSEL_Pos) /*!< NFI_T::NANDCTL: BCHTSEL Mask */ - -#define NFI_NANDCTL_ECCEN_Pos (23) /*!< NFI_T::NANDCTL: ECCEN Position */ -#define NFI_NANDCTL_ECCEN_Msk (0x1ul << NFI_NANDCTL_ECCEN_Pos) /*!< NFI_T::NANDCTL: ECCEN Mask */ - -#define NFI_NANDCTL_CS0_Pos (25) /*!< NFI_T::NANDCTL: CS0 Position */ -#define NFI_NANDCTL_CS0_Msk (0x1ul << NFI_NANDCTL_CS0_Pos) /*!< NFI_T::NANDCTL: CS0 Mask */ - -#define NFI_NANDCTL_CS1_Pos (26) /*!< NFI_T::NANDCTL: CS1 Position */ -#define NFI_NANDCTL_CS1_Msk (0x1ul << NFI_NANDCTL_CS1_Pos) /*!< NFI_T::NANDCTL: CS1 Mask */ - -#define NFI_NANDTMCTL_LOWID_Pos (0) /*!< NFI_T::NANDTMCTL: LOWID Position */ -#define NFI_NANDTMCTL_LOWID_Msk (0xfful << NFI_NANDTMCTL_LOWID_Pos) /*!< NFI_T::NANDTMCTL: LOWID Mask */ - -#define NFI_NANDTMCTL_HIWID_Pos (8) /*!< NFI_T::NANDTMCTL: HIWID Position */ -#define NFI_NANDTMCTL_HIWID_Msk (0xfful << NFI_NANDTMCTL_HIWID_Pos) /*!< NFI_T::NANDTMCTL: HIWID Mask */ - -#define NFI_NANDTMCTL_CALESH_Pos (16) /*!< NFI_T::NANDTMCTL: CALESH Position */ -#define NFI_NANDTMCTL_CALESH_Msk (0x7ful << NFI_NANDTMCTL_CALESH_Pos) /*!< NFI_T::NANDTMCTL: CALESH Mask */ - -#define NFI_NANDTMCTL_EDOD_Pos (24) /*!< NFI_T::NANDTMCTL: EDOD Position */ -#define NFI_NANDTMCTL_EDOD_Msk (0xful << NFI_NANDTMCTL_EDOD_Pos) /*!< NFI_T::NANDTMCTL: EDOD Mask */ - -#define NFI_NANDTMCTL_EDOEN_Pos (31) /*!< NFI_T::NANDTMCTL: EDOEN Position */ -#define NFI_NANDTMCTL_EDOEN_Msk (0x1ul << NFI_NANDTMCTL_EDOEN_Pos) /*!< NFI_T::NANDTMCTL: EDOEN Mask */ - -#define NFI_NANDINTEN_DMAIE_Pos (0) /*!< NFI_T::NANDINTEN: DMAIE Position */ -#define NFI_NANDINTEN_DMAIE_Msk (0x1ul << NFI_NANDINTEN_DMAIE_Pos) /*!< NFI_T::NANDINTEN: DMAIE Mask */ - -#define NFI_NANDINTEN_ECCFLDIE_Pos (2) /*!< NFI_T::NANDINTEN: ECCFLDIE Position */ -#define NFI_NANDINTEN_ECCFLDIE_Msk (0x1ul << NFI_NANDINTEN_ECCFLDIE_Pos) /*!< NFI_T::NANDINTEN: ECCFLDIE Mask */ - -#define NFI_NANDINTEN_RB0IE_Pos (10) /*!< NFI_T::NANDINTEN: RB0IE Position */ -#define NFI_NANDINTEN_RB0IE_Msk (0x1ul << NFI_NANDINTEN_RB0IE_Pos) /*!< NFI_T::NANDINTEN: RB0IE Mask */ - -#define NFI_NANDINTSTS_DMAIF_Pos (0) /*!< NFI_T::NANDINTSTS: DMAIF Position */ -#define NFI_NANDINTSTS_DMAIF_Msk (0x1ul << NFI_NANDINTSTS_DMAIF_Pos) /*!< NFI_T::NANDINTSTS: DMAIF Mask */ - -#define NFI_NANDINTSTS_ECCFLDIF_Pos (2) /*!< NFI_T::NANDINTSTS: ECCFLDIF Position */ -#define NFI_NANDINTSTS_ECCFLDIF_Msk (0x1ul << NFI_NANDINTSTS_ECCFLDIF_Pos) /*!< NFI_T::NANDINTSTS: ECCFLDIF Mask */ - -#define NFI_NANDINTSTS_EDOF_Pos (4) /*!< NFI_T::NANDINTSTS: EDOF Position */ -#define NFI_NANDINTSTS_EDOF_Msk (0x1ul << NFI_NANDINTSTS_EDOF_Pos) /*!< NFI_T::NANDINTSTS: EDOF Mask */ - -#define NFI_NANDINTSTS_RB0IF_Pos (10) /*!< NFI_T::NANDINTSTS: RB0IF Position */ -#define NFI_NANDINTSTS_RB0IF_Msk (0x1ul << NFI_NANDINTSTS_RB0IF_Pos) /*!< NFI_T::NANDINTSTS: RB0IF Mask */ - -#define NFI_NANDINTSTS_RB0Status_Pos (18) /*!< NFI_T::NANDINTSTS: RB0Status Position */ -#define NFI_NANDINTSTS_RB0Status_Msk (0x1ul << NFI_NANDINTSTS_RB0Status_Pos) /*!< NFI_T::NANDINTSTS: RB0Status Mask */ - -#define NFI_NANDCMD_COMMAND_Pos (0) /*!< NFI_T::NANDCMD: COMMAND Position */ -#define NFI_NANDCMD_COMMAND_Msk (0xfful << NFI_NANDCMD_COMMAND_Pos) /*!< NFI_T::NANDCMD: COMMAND Mask */ - -#define NFI_NANDADDR_ADDRESS_Pos (0) /*!< NFI_T::NANDADDR: ADDRESS Position */ -#define NFI_NANDADDR_ADDRESS_Msk (0xfful << NFI_NANDADDR_ADDRESS_Pos) /*!< NFI_T::NANDADDR: ADDRESS Mask */ - -#define NFI_NANDADDR_EOA_Pos (31) /*!< NFI_T::NANDADDR: EOA Position */ -#define NFI_NANDADDR_EOA_Msk (0x1ul << NFI_NANDADDR_EOA_Pos) /*!< NFI_T::NANDADDR: EOA Mask */ - -#define NFI_NANDDATA_DATA_Pos (0) /*!< NFI_T::NANDDATA: DATA Position */ -#define NFI_NANDDATA_DATA_Msk (0xfful << NFI_NANDDATA_DATA_Pos) /*!< NFI_T::NANDDATA: DATA Mask */ - -#define NFI_NANDRACTL_RA128EN_Pos (0) /*!< NFI_T::NANDRACTL: RA128EN Position */ -#define NFI_NANDRACTL_RA128EN_Msk (0x1fful << NFI_NANDRACTL_RA128EN_Pos) /*!< NFI_T::NANDRACTL: RA128EN Mask */ - -#define NFI_NANDRACTL_MECC_Pos (16) /*!< NFI_T::NANDRACTL: MECC Position */ -#define NFI_NANDRACTL_MECC_Msk (0xfffful << NFI_NANDRACTL_MECC_Pos) /*!< NFI_T::NANDRACTL: MECC Mask */ - -#define NFI_NANDECTL_WP_Pos (0) /*!< NFI_T::NANDECTL: WP Position */ -#define NFI_NANDECTL_WP_Msk (0x1ul << NFI_NANDECTL_WP_Pos) /*!< NFI_T::NANDECTL: WP Mask */ - -#define NFI_NANDECCES_F1STAT_Pos (0) /*!< NFI_T::NANDECCES: F1STAT Position */ -#define NFI_NANDECCES_F1STAT_Msk (0x3ul << NFI_NANDECCES_F1STAT_Pos) /*!< NFI_T::NANDECCES: F1STAT Mask */ - -#define NFI_NANDECCES_F1ECNT_Pos (2) /*!< NFI_T::NANDECCES: F1ECNT Position */ -#define NFI_NANDECCES_F1ECNT_Msk (0x1ful << NFI_NANDECCES_F1ECNT_Pos) /*!< NFI_T::NANDECCES: F1ECNT Mask */ - -#define NFI_NANDECCES_F2STAT_Pos (8) /*!< NFI_T::NANDECCES: F2STAT Position */ -#define NFI_NANDECCES_F2STAT_Msk (0x3ul << NFI_NANDECCES_F2STAT_Pos) /*!< NFI_T::NANDECCES: F2STAT Mask */ - -#define NFI_NANDECCES_F2ECNT_Pos (10) /*!< NFI_T::NANDECCES: F2ECNT Position */ -#define NFI_NANDECCES_F2ECNT_Msk (0x1ful << NFI_NANDECCES_F2ECNT_Pos) /*!< NFI_T::NANDECCES: F2ECNT Mask */ - -#define NFI_NANDECCES_F3STAT_Pos (16) /*!< NFI_T::NANDECCES: F3STAT Position */ -#define NFI_NANDECCES_F3STAT_Msk (0x3ul << NFI_NANDECCES_F3STAT_Pos) /*!< NFI_T::NANDECCES: F3STAT Mask */ - -#define NFI_NANDECCES_F3ECNT_Pos (18) /*!< NFI_T::NANDECCES: F3ECNT Position */ -#define NFI_NANDECCES_F3ECNT_Msk (0x1ful << NFI_NANDECCES_F3ECNT_Pos) /*!< NFI_T::NANDECCES: F3ECNT Mask */ - -#define NFI_NANDECCES_F4STAT_Pos (24) /*!< NFI_T::NANDECCES: F4STAT Position */ -#define NFI_NANDECCES_F4STAT_Msk (0x3ul << NFI_NANDECCES_F4STAT_Pos) /*!< NFI_T::NANDECCES: F4STAT Mask */ - -#define NFI_NANDECCES_F4ECNT_Pos (26) /*!< NFI_T::NANDECCES: F4ECNT Position */ -#define NFI_NANDECCES_F4ECNT_Msk (0x1ful << NFI_NANDECCES_F4ECNT_Pos) /*!< NFI_T::NANDECCES: F4ECNT Mask */ - -#define NFI_NANDRA_Data_Pos (0) /*!< NFI_T::NANDRA: Data Position */ -#define NFI_NANDRA_Data_Msk (0xfffffffful << NFI_NANDRA_Data_Pos) /*!< NFI_T::NANDRA: Data Mask */ - -/**@}*/ /* NFI_CONST */ -/**@}*/ /* end of NFI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __NFI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/otp_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/otp_reg.h deleted file mode 100644 index d71d6f1b81d..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/otp_reg.h +++ /dev/null @@ -1,346 +0,0 @@ -/**************************************************************************//** -* @file otp_reg.h -* @brief OTP driver header file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __OTP_REG_H__ -#define __OTP_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup OTP One-Time Programming Controller(OTP) - Memory Mapped Structure for OTP Controller -@{ */ - -typedef struct -{ - - - /** - * @var OTP_T::CTL - * Offset: 0x00 OTP Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |OTP Start Control Bit - * | | |0 = No operation. - * | | |1 = Start the operation. - * |[7:4] |CMD |OTP Command Selection Bits - * | | |0x0 = Read command. - * | | |0x1 = Program command. - * | | |0x2 = Read only lock command. - * | | |0x3 = Fault Tolerance Mechanism command. - * | | |0x7 = Read checker command. - * | | |0xB = Read company ID - * | | |0xC = Read device ID - * | | |0xD = Read unique ID - * | | |Others = reserved. - * @var OTP_T::STS - * Offset: 0x04 OTP Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |OTP Busy Flag (Read Only) - * | | |0 = OTP is idle or finished. - * | | |1 = OTP is busy. - * |[1] |PFF |OTP Program Fail Flag (Write 1 to Clear) - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No OTP programming operation failed. - * | | |1 = OTP programming operation is failed. - * |[2] |ADDRFF |OTP Address Fail Flag (Write 1 to Clear) - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = OTP Address is legal. - * | | |1 = OTP Address is illegal. - * |[3] |FTMFF |OTP Fault Tolerance Mechanism Fail Flag (Write 1 to Clear) - * | | |This bit is set after Fault Tolerance Mechanism command is triggered and address is assigned to a block without available spare memory. - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No OTP fault tolerance mechanism failed. - * | | |1 = OTP fault tolerance mechanism failed. - * |[4] |CMDFF |OTP Command Fail Flag (Write 1 to Clear) - * | | |This bit is set after program command or Fault Tolerance Mechanism command is triggered and address is assigned a locked block. - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No OTP command failed. - * | | |1 = OTP command is failed. - * @var OTP_T::ADDR - * Offset: 0x08 OTP Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ADDR |OTP Address - * | | |OTP_ADDR register is byte addressable. - * | | |If OTP_ADDR is written to illegal region and START(OTP_CTL[0]) bit is triggered, ADDRFF(OTP_STS[2]) will be set and this operation will not be executed. - * @var OTP_T::DATA - * Offset: 0x0C OTP Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |OTP Data - * | | |Writing data to OTP_DATA register before OTP program operation. - * | | |Reading data from OTP_DATA register after OTP read operation. - * | | |Writing password, 0x55aa_92d6, before OTP read only lock operation or OTP Fault Tolerance Mechanism operation. - * @var OTP_T::USMSTS0 - * Offset: 0x10 OTP Unused Spare Memory 0 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:2] |BLK1 |Block 1 Unused Spare Memory - * | | |Maximum unused spare memory is 2. - * |[5:4] |BLK2 |Block 2 Unused Spare Memory - * | | |Maximum unused spare memory is 0. - * |[7:6] |BLK3 |Block 3 Unused Spare Memory - * | | |Maximum unused spare memory is 2. - * |[9:8] |BLK4 |Block 4 Unused Spare Memory - * | | |Maximum unused spare memory is 2. - * |[11:10] |BLK5 |Block 5 Unused Spare Memory - * | | |Maximum unused spare memory is 0. - * |[13:12] |BLK6 |Block 6 Unused Spare Memory - * | | |Maximum unused spare memory is 0. - * |[15:14] |BLK7 |Block 7 Unused Spare Memory - * | | |Maximum unused spare memory is 0. - * |[17:16] |BLK8 |Block 8 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * |[19:18] |BLK9 |Block 9 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * |[21:20] |BLK10 |Block 10 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * |[23:22] |BLK11 |Block 11 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * |[25:24] |BLK12 |Block 12 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * |[27:26] |BLK13 |Block 13 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * |[29:28] |BLK14 |Block 14 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * |[31:30] |BLK15 |Block 15 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * @var OTP_T::USMSTS1 - * Offset: 0x14 OTP Unused Spare Memory 1 Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |BLK16 |Block 16 Unused Spare Memory - * | | |Maximum unused spare memory is 1. - * @var OTP_T::OTP_CTL - * Offset: 0x800 Non-secure OTP Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |OTP Start Control Bit - * | | |0 = No operation. - * | | |1 = Start the operation. - * |[6:4] |CMD |OTP Command Selection Bits - * | | |0x0 = Read command. - * | | |0x1 = Program command. - * | | |0x2 = Read only lock command. - * | | |0x3 = Fault Tolerance Mechanism command. - * | | |0x7 = Read checker command. - * | | |0xB = Read company ID - * | | |0xC = Read device ID - * | | |0xD = Read unique ID - * | | |Others = reserved. - * @var OTP_T::OTP_STS - * Offset: 0x804 Non-secure OTP Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |OTP Busy Flag (Read Only) - * | | |0 = OTP is idle or finished. - * | | |1 = OTP is busy. - * |[1] |PFF |OTP Program Fail Flag (Write 1 to Clear) - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No OTP programming operation failed. - * | | |1 = OTP programming operation failed. - * |[2] |ADDRFF |OTP Address Fail Flag (Write 1 to Clear) - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = OTP Address is legal. - * | | |1 = OTP Address is illegal. - * |[3] |FTMFF |OTP Fault Tolerance Mechanism Fail Flag (Write 1 to Clear) - * | | |This bit is set after Fault Tolerance Mechanism command is triggered and address is assigned to a block without available spare memory. - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No OTP fault tolerance mechanism failed. - * | | |1 = OTP fault tolerance mechanism is failed. - * |[4] |CMDFF |OTP Command Fail Flag (Write 1 to Clear) - * | | |This bit is set after program command or Fault Tolerance Mechanism command is triggered and address is assigned to a locked block. - * | | |This bit is cleared by writing 1 and it has no effect by writing 0. - * | | |0 = No OTP command failed. - * | | |1 = OTP command failed. - * @var OTP_T::OTP_ADDR - * Offset: 0x808 Non-secure OTP Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ADDR |OTP Address - * | | |OTP_ADDR register is byte addressable. - * | | |If OTP_ADDR is written to illegal region and START(OTP_CTL[0]) bit is triggered, ADDRFF(OTP_STS[2]) will be set and this operation will not be executed. - * @var OTP_T::OTP_DATA - * Offset: 0x80C Non-secure OTP Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |OTP Data - * | | |Writing data to OTP_DATA register before OTP program operation. - * | | |Reading data from OTP_DATA register after OTP read operation. - * | | |Writing password, 0x55aa_92d6, before OTP read only lock operation or OTP Fault Tolerance Mechanism operation. - * @var OTP_T::OTP_USMSTS - * Offset: 0x810 Non-secure OTP Unused Spare Memory Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:6] |BLK3 |Block 3 Unused Spare Memory - * | | |Maximum unused spare memory is 2. - * |[9:8] |BLK4 |Block 4 Unused Spare Memory - * | | |Maximum unused spare memory is 2. - * |[15:14] |BLK7 |Block 7 Unused Spare Memory - * | | |Maximum unused spare memory is 0. - */ - __IO uint32_t CTL; /*!< [0x0000] OTP Control Register */ - __IO uint32_t STS; /*!< [0x0004] OTP Status Register */ - __IO uint32_t ADDR; /*!< [0x0008] OTP Address Register */ - __IO uint32_t DATA; /*!< [0x000c] OTP Data Register */ - __I uint32_t USMSTS0; /*!< [0x0010] OTP Unused Spare Memory 0 Status Register */ - __I uint32_t USMSTS1; /*!< [0x0014] OTP Unused Spare Memory 1 Status Register */ - __I uint32_t RESERVE0[506]; - __IO uint32_t OTP_CTL; /*!< [0x0800] Non-secure OTP Control Register */ - __IO uint32_t OTP_STS; /*!< [0x0804] Non-secure OTP Status Register */ - __IO uint32_t OTP_ADDR; /*!< [0x0808] Non-secure OTP Address Register */ - __IO uint32_t OTP_DATA; /*!< [0x080c] Non-secure OTP Data Register */ - __I uint32_t OTP_USMSTS; /*!< [0x0810] Non-secure OTP Unused Spare Memory Status Register */ - -} OTP_T; - -/** - @addtogroup OTP_CONST OTP Bit Field Definition - Constant Definitions for OTP Controller -@{ */ - -#define OTP_CTL_START_Pos (0) /*!< OTP_T::CTL: START Position */ -#define OTP_CTL_START_Msk (0x1ul << OTP_CTL_START_Pos) /*!< OTP_T::CTL: START Mask */ - -#define OTP_CTL_CMD_Pos (4) /*!< OTP_T::CTL: CMD Position */ -#define OTP_CTL_CMD_Msk (0xful << OTP_CTL_CMD_Pos) /*!< OTP_T::CTL: CMD Mask */ - -#define OTP_STS_BUSY_Pos (0) /*!< OTP_T::STS: BUSY Position */ -#define OTP_STS_BUSY_Msk (0x1ul << OTP_STS_BUSY_Pos) /*!< OTP_T::STS: BUSY Mask */ - -#define OTP_STS_PFF_Pos (1) /*!< OTP_T::STS: PFF Position */ -#define OTP_STS_PFF_Msk (0x1ul << OTP_STS_PFF_Pos) /*!< OTP_T::STS: PFF Mask */ - -#define OTP_STS_ADDRFF_Pos (2) /*!< OTP_T::STS: ADDRFF Position */ -#define OTP_STS_ADDRFF_Msk (0x1ul << OTP_STS_ADDRFF_Pos) /*!< OTP_T::STS: ADDRFF Mask */ - -#define OTP_STS_FTMFF_Pos (3) /*!< OTP_T::STS: FTMFF Position */ -#define OTP_STS_FTMFF_Msk (0x1ul << OTP_STS_FTMFF_Pos) /*!< OTP_T::STS: FTMFF Mask */ - -#define OTP_STS_CMDFF_Pos (4) /*!< OTP_T::STS: CMDFF Position */ -#define OTP_STS_CMDFF_Msk (0x1ul << OTP_STS_CMDFF_Pos) /*!< OTP_T::STS: CMDFF Mask */ - -#define OTP_ADDR_ADDR_Pos (0) /*!< OTP_T::ADDR: ADDR Position */ -#define OTP_ADDR_ADDR_Msk (0xffful << OTP_ADDR_ADDR_Pos) /*!< OTP_T::ADDR: ADDR Mask */ - -#define OTP_DATA_DATA_Pos (0) /*!< OTP_T::DATA: DATA Position */ -#define OTP_DATA_DATA_Msk (0xfffffffful << OTP_DATA_DATA_Pos) /*!< OTP_T::DATA: DATA Mask */ - -#define OTP_USMSTS0_BLK1_Pos (2) /*!< OTP_T::USMSTS0: BLK1 Position */ -#define OTP_USMSTS0_BLK1_Msk (0x3ul << OTP_USMSTS0_BLK1_Pos) /*!< OTP_T::USMSTS0: BLK1 Mask */ - -#define OTP_USMSTS0_BLK2_Pos (4) /*!< OTP_T::USMSTS0: BLK2 Position */ -#define OTP_USMSTS0_BLK2_Msk (0x3ul << OTP_USMSTS0_BLK2_Pos) /*!< OTP_T::USMSTS0: BLK2 Mask */ - -#define OTP_USMSTS0_BLK3_Pos (6) /*!< OTP_T::USMSTS0: BLK3 Position */ -#define OTP_USMSTS0_BLK3_Msk (0x3ul << OTP_USMSTS0_BLK3_Pos) /*!< OTP_T::USMSTS0: BLK3 Mask */ - -#define OTP_USMSTS0_BLK4_Pos (8) /*!< OTP_T::USMSTS0: BLK4 Position */ -#define OTP_USMSTS0_BLK4_Msk (0x3ul << OTP_USMSTS0_BLK4_Pos) /*!< OTP_T::USMSTS0: BLK4 Mask */ - -#define OTP_USMSTS0_BLK5_Pos (10) /*!< OTP_T::USMSTS0: BLK5 Position */ -#define OTP_USMSTS0_BLK5_Msk (0x3ul << OTP_USMSTS0_BLK5_Pos) /*!< OTP_T::USMSTS0: BLK5 Mask */ - -#define OTP_USMSTS0_BLK6_Pos (12) /*!< OTP_T::USMSTS0: BLK6 Position */ -#define OTP_USMSTS0_BLK6_Msk (0x3ul << OTP_USMSTS0_BLK6_Pos) /*!< OTP_T::USMSTS0: BLK6 Mask */ - -#define OTP_USMSTS0_BLK7_Pos (14) /*!< OTP_T::USMSTS0: BLK7 Position */ -#define OTP_USMSTS0_BLK7_Msk (0x3ul << OTP_USMSTS0_BLK7_Pos) /*!< OTP_T::USMSTS0: BLK7 Mask */ - -#define OTP_USMSTS0_BLK8_Pos (16) /*!< OTP_T::USMSTS0: BLK8 Position */ -#define OTP_USMSTS0_BLK8_Msk (0x3ul << OTP_USMSTS0_BLK8_Pos) /*!< OTP_T::USMSTS0: BLK8 Mask */ - -#define OTP_USMSTS0_BLK9_Pos (18) /*!< OTP_T::USMSTS0: BLK9 Position */ -#define OTP_USMSTS0_BLK9_Msk (0x3ul << OTP_USMSTS0_BLK9_Pos) /*!< OTP_T::USMSTS0: BLK9 Mask */ - -#define OTP_USMSTS0_BLK10_Pos (20) /*!< OTP_T::USMSTS0: BLK10 Position */ -#define OTP_USMSTS0_BLK10_Msk (0x3ul << OTP_USMSTS0_BLK10_Pos) /*!< OTP_T::USMSTS0: BLK10 Mask */ - -#define OTP_USMSTS0_BLK11_Pos (22) /*!< OTP_T::USMSTS0: BLK11 Position */ -#define OTP_USMSTS0_BLK11_Msk (0x3ul << OTP_USMSTS0_BLK11_Pos) /*!< OTP_T::USMSTS0: BLK11 Mask */ - -#define OTP_USMSTS0_BLK12_Pos (24) /*!< OTP_T::USMSTS0: BLK12 Position */ -#define OTP_USMSTS0_BLK12_Msk (0x3ul << OTP_USMSTS0_BLK12_Pos) /*!< OTP_T::USMSTS0: BLK12 Mask */ - -#define OTP_USMSTS0_BLK13_Pos (26) /*!< OTP_T::USMSTS0: BLK13 Position */ -#define OTP_USMSTS0_BLK13_Msk (0x3ul << OTP_USMSTS0_BLK13_Pos) /*!< OTP_T::USMSTS0: BLK13 Mask */ - -#define OTP_USMSTS0_BLK14_Pos (28) /*!< OTP_T::USMSTS0: BLK14 Position */ -#define OTP_USMSTS0_BLK14_Msk (0x3ul << OTP_USMSTS0_BLK14_Pos) /*!< OTP_T::USMSTS0: BLK14 Mask */ - -#define OTP_USMSTS0_BLK15_Pos (30) /*!< OTP_T::USMSTS0: BLK15 Position */ -#define OTP_USMSTS0_BLK15_Msk (0x3ul << OTP_USMSTS0_BLK15_Pos) /*!< OTP_T::USMSTS0: BLK15 Mask */ - -#define OTP_USMSTS1_BLK16_Pos (0) /*!< OTP_T::USMSTS1: BLK16 Position */ -#define OTP_USMSTS1_BLK16_Msk (0x3ul << OTP_USMSTS1_BLK16_Pos) /*!< OTP_T::USMSTS1: BLK16 Mask */ - -#define OTP_OTP_CTL_START_Pos (0) /*!< OTP_T::OTP_CTL: START Position */ -#define OTP_OTP_CTL_START_Msk (0x1ul << OTP_OTP_CTL_START_Pos) /*!< OTP_T::OTP_CTL: START Mask */ - -#define OTP_OTP_CTL_CMD_Pos (4) /*!< OTP_T::OTP_CTL: CMD Position */ -#define OTP_OTP_CTL_CMD_Msk (0x7ul << OTP_OTP_CTL_CMD_Pos) /*!< OTP_T::OTP_CTL: CMD Mask */ - -#define OTP_OTP_STS_BUSY_Pos (0) /*!< OTP_T::OTP_STS: BUSY Position */ -#define OTP_OTP_STS_BUSY_Msk (0x1ul << OTP_OTP_STS_BUSY_Pos) /*!< OTP_T::OTP_STS: BUSY Mask */ - -#define OTP_OTP_STS_PFF_Pos (1) /*!< OTP_T::OTP_STS: PFF Position */ -#define OTP_OTP_STS_PFF_Msk (0x1ul << OTP_OTP_STS_PFF_Pos) /*!< OTP_T::OTP_STS: PFF Mask */ - -#define OTP_OTP_STS_ADDRFF_Pos (2) /*!< OTP_T::OTP_STS: ADDRFF Position */ -#define OTP_OTP_STS_ADDRFF_Msk (0x1ul << OTP_OTP_STS_ADDRFF_Pos) /*!< OTP_T::OTP_STS: ADDRFF Mask */ - -#define OTP_OTP_STS_FTMFF_Pos (3) /*!< OTP_T::OTP_STS: FTMFF Position */ -#define OTP_OTP_STS_FTMFF_Msk (0x1ul << OTP_OTP_STS_FTMFF_Pos) /*!< OTP_T::OTP_STS: FTMFF Mask */ - -#define OTP_OTP_STS_CMDFF_Pos (4) /*!< OTP_T::OTP_STS: CMDFF Position */ -#define OTP_OTP_STS_CMDFF_Msk (0x1ul << OTP_OTP_STS_CMDFF_Pos) /*!< OTP_T::OTP_STS: CMDFF Mask */ - -#define OTP_OTP_ADDR_ADDR_Pos (0) /*!< OTP_T::OTP_ADDR: ADDR Position */ -#define OTP_OTP_ADDR_ADDR_Msk (0xffful << OTP_OTP_ADDR_ADDR_Pos) /*!< OTP_T::OTP_ADDR: ADDR Mask */ - -#define OTP_OTP_DATA_DATA_Pos (0) /*!< OTP_T::OTP_DATA: DATA Position */ -#define OTP_OTP_DATA_DATA_Msk (0xfffffffful << OTP_OTP_DATA_DATA_Pos) /*!< OTP_T::OTP_DATA: DATA Mask */ - -#define OTP_OTP_USMSTS_BLK3_Pos (6) /*!< OTP_T::OTP_USMSTS: BLK3 Position */ -#define OTP_OTP_USMSTS_BLK3_Msk (0x3ul << OTP_OTP_USMSTS_BLK3_Pos) /*!< OTP_T::OTP_USMSTS: BLK3 Mask */ - -#define OTP_OTP_USMSTS_BLK4_Pos (8) /*!< OTP_T::OTP_USMSTS: BLK4 Position */ -#define OTP_OTP_USMSTS_BLK4_Msk (0x3ul << OTP_OTP_USMSTS_BLK4_Pos) /*!< OTP_T::OTP_USMSTS: BLK4 Mask */ - -#define OTP_OTP_USMSTS_BLK7_Pos (14) /*!< OTP_T::OTP_USMSTS: BLK7 Position */ -#define OTP_OTP_USMSTS_BLK7_Msk (0x3ul << OTP_OTP_USMSTS_BLK7_Pos) /*!< OTP_T::OTP_USMSTS: BLK7 Mask */ - -/**@}*/ /* OTP_CONST */ -/**@}*/ /* end of OTP register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif //__OTP_REG_H__ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/pdma_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/pdma_reg.h deleted file mode 100644 index 587c0403a51..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/pdma_reg.h +++ /dev/null @@ -1,1020 +0,0 @@ -/**************************************************************************//** - * @file pdma_reg.h - * @brief PDMA register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __PDMA_REG_H__ -#define __PDMA_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -#define PDMA_CH_MAX 10UL /*!< Specify Maximum Channels of PDMA \hideinitializer */ -#define PDMA_CH_Msk ((1ul<= 1,. - * | | |If MCLKDIV = 0,. - * | | |where - * | | |is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL4 - * | | |In general, the master clock rate is 256 times sampling clock rate. - * |[17:8] |BCLKDIV |Bit Clock Divider - * | | |The I2S controller will generate bit clock in Master mode - * | | |The clock frequency of bit clock, fBCLK, is determined by the following expression: - * | | |where - * | | |is the frequency of I2S peripheral clock source, which is defined in the clock control register CLK_CLKSEL4. - * | | |In I2S Slave mode, this field is used to define the frequency of peripheral clock and it's determined by . - * | | |The peripheral clock frequency in I2S Slave mode must be equal to or faster than 6 times of input bit clock. - * | | |Note: The time interval must be larger than or equal 5 peripheral clock cycles between releasing SPI IP software reset and setting this clock divider register. - * |[24] |I2SMODE |I2S Clock Divider Number Selection for I2S Mode and SPI Mode - * | | |User sets I2SMODE to set frequency of peripheral clock of I2S mode or SPI mode when BCLKDIV (SPIx_I2SCLK[17:8]) or DIVIDER (SPIx_CLKDIV[8:0]) are set. - * | | |User needs to set I2SMODE before I2SEN (SPIx_I2SCTL[0]) or SPIEN (SPIx_CTL[0]) is enabled. - * | | |0 = The frequency of peripheral clock set to SPI mode. - * | | |1 = The frequency of peripheral clock set to I2S mode. - * |[25] |I2SSLAVE |I2S Clock Divider Number Selection for I2S Slave Mode and I2S Master Mode - * | | |User sets I2SSLAVE to set frequency of peripheral clock of I2S master mode and I2S slave mode when BCLKDIV (SPIx_I2SCLK[17:8]) is set. - * | | |User needs to set I2SSLAVE before I2SEN (SPIx_I2SCTL[0]) is enabled. - * | | |0 = The frequency of peripheral clock set to I2S master mode. - * | | |1 = The frequency of peripheral clock set to I2S slave mode. - * @var SPI_T::I2SSTS - * Offset: 0x68 I2S Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |RIGHT |Right Channel (Read Only) - * | | |This bit indicates the current transmit data is belong to which channel. - * | | |0 = Left channel. - * | | |1 = Right channel. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * | | |Note: If RXTHIEN = 1 and RXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock period in Master mode or over 576 SPI peripheral clock period in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |I2SENSTS |I2S Enable Status (Read Only) - * | | |0 = The SPI/I2S control logic Disabled. - * | | |1 = The SPI/I2S control logic Enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI/I2S control logic is disabled, this bit indicates the real status of SPI/I2S control logic for user. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * | | |Note: If TXTHIEN = 1 and TXTHIF = 1, the SPI/I2S controller will generate a SPI interrupt request. - * |[19] |TXUFIF |Transmit FIFO Underflow Interrupt Flag - * | | |When the transmit FIFO buffer is empty and there is no datum written into the FIFO buffer, if there is more bus clock input, this bit will be set to 1. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[20] |RZCIF |Right Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on right channel. - * | | |1 = Zero cross event occurred on right channel. - * |[21] |LZCIF |Left Channel Zero Cross Interrupt Flag - * | | |0 = No zero cross event occurred on left channel. - * | | |1 = Zero cross event occurred on left channel. - * |[22] |SLVERRIF |Bit Number Error Interrupt Flag for Slave Mode - * | | |0 = No bit number error event occurred. - * | | |1 = Bit number error event occurred. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[26:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[30:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - */ - __IO uint32_t CTL; /*!< [0x0000] SPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] SPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] SPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] SPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] SPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] SPI Status Register */ - __I uint32_t STATUS2; /*!< [0x0018] SPI Status2 Register */ - __I uint32_t RESERVE0[1]; - __O uint32_t TX; /*!< [0x0020] SPI Data Transmit Register */ - __I uint32_t RESERVE1[3]; - __I uint32_t RX; /*!< [0x0030] SPI Data Receive Register */ - __I uint32_t RESERVE2[5]; /*!< [0x0034] Reserved */ - __IO uint32_t INTERNAL; /*!< [0x0048] SPI Internal Control Register */ - __I uint32_t RESERVE3; /*!< [0x004C] Reserved */ - __I uint32_t VER_NUM; /*!< [0x0050] SPI Version Number Register */ - __I uint32_t RESERVE4[3]; /*!< [0x0054] Reserved */ - __IO uint32_t I2SCTL; /*!< [0x0060] I2S Control Register */ - __IO uint32_t I2SCLK; /*!< [0x0064] I2S Clock Divider Control Register */ - __IO uint32_t I2SSTS; /*!< [0x0068] I2S Status Register */ - -} SPI_T; - -/** - @addtogroup SPI_CONST SPI Bit Field Definition - Constant Definitions for SPI Controller -@{ */ - -#define SPI_CTL_SPIEN_Pos (0) /*!< SPI_T::CTL: SPIEN Position */ -#define SPI_CTL_SPIEN_Msk (0x1ul << SPI_CTL_SPIEN_Pos) /*!< SPI_T::CTL: SPIEN Mask */ - -#define SPI_CTL_RXNEG_Pos (1) /*!< SPI_T::CTL: RXNEG Position */ -#define SPI_CTL_RXNEG_Msk (0x1ul << SPI_CTL_RXNEG_Pos) /*!< SPI_T::CTL: RXNEG Mask */ - -#define SPI_CTL_TXNEG_Pos (2) /*!< SPI_T::CTL: TXNEG Position */ -#define SPI_CTL_TXNEG_Msk (0x1ul << SPI_CTL_TXNEG_Pos) /*!< SPI_T::CTL: TXNEG Mask */ - -#define SPI_CTL_CLKPOL_Pos (3) /*!< SPI_T::CTL: CLKPOL Position */ -#define SPI_CTL_CLKPOL_Msk (0x1ul << SPI_CTL_CLKPOL_Pos) /*!< SPI_T::CTL: CLKPOL Mask */ - -#define SPI_CTL_SUSPITV_Pos (4) /*!< SPI_T::CTL: SUSPITV Position */ -#define SPI_CTL_SUSPITV_Msk (0xful << SPI_CTL_SUSPITV_Pos) /*!< SPI_T::CTL: SUSPITV Mask */ - -#define SPI_CTL_DWIDTH_Pos (8) /*!< SPI_T::CTL: DWIDTH Position */ -#define SPI_CTL_DWIDTH_Msk (0x1ful << SPI_CTL_DWIDTH_Pos) /*!< SPI_T::CTL: DWIDTH Mask */ - -#define SPI_CTL_LSB_Pos (13) /*!< SPI_T::CTL: LSB Position */ -#define SPI_CTL_LSB_Msk (0x1ul << SPI_CTL_LSB_Pos) /*!< SPI_T::CTL: LSB Mask */ - -#define SPI_CTL_HALFDPX_Pos (14) /*!< SPI_T::CTL: HALFDPX Position */ -#define SPI_CTL_HALFDPX_Msk (0x1ul << SPI_CTL_HALFDPX_Pos) /*!< SPI_T::CTL: HALFDPX Mask */ - -#define SPI_CTL_RXONLY_Pos (15) /*!< SPI_T::CTL: RXONLY Position */ -#define SPI_CTL_RXONLY_Msk (0x1ul << SPI_CTL_RXONLY_Pos) /*!< SPI_T::CTL: RXONLY Mask */ - -#define SPI_CTL_UNITIEN_Pos (17) /*!< SPI_T::CTL: UNITIEN Position */ -#define SPI_CTL_UNITIEN_Msk (0x1ul << SPI_CTL_UNITIEN_Pos) /*!< SPI_T::CTL: UNITIEN Mask */ - -#define SPI_CTL_SLAVE_Pos (18) /*!< SPI_T::CTL: SLAVE Position */ -#define SPI_CTL_SLAVE_Msk (0x1ul << SPI_CTL_SLAVE_Pos) /*!< SPI_T::CTL: SLAVE Mask */ - -#define SPI_CTL_REORDER_Pos (19) /*!< SPI_T::CTL: REORDER Position */ -#define SPI_CTL_REORDER_Msk (0x1ul << SPI_CTL_REORDER_Pos) /*!< SPI_T::CTL: REORDER Mask */ - -#define SPI_CTL_DATDIR_Pos (20) /*!< SPI_T::CTL: DATDIR Position */ -#define SPI_CTL_DATDIR_Msk (0x1ul << SPI_CTL_DATDIR_Pos) /*!< SPI_T::CTL: DATDIR Mask */ - -#define SPI_CLKDIV_DIVIDER_Pos (0) /*!< SPI_T::CLKDIV: DIVIDER Position */ -#define SPI_CLKDIV_DIVIDER_Msk (0x1fful << SPI_CLKDIV_DIVIDER_Pos) /*!< SPI_T::CLKDIV: DIVIDER Mask */ - -#define SPI_SSCTL_SS_Pos (0) /*!< SPI_T::SSCTL: SS Position */ -#define SPI_SSCTL_SS_Msk (0x1ul << SPI_SSCTL_SS_Pos) /*!< SPI_T::SSCTL: SS Mask */ - -#define SPI_SSCTL_SS0_Pos (0) /*!< SPI_T::SSCTL: SS0 Position */ -#define SPI_SSCTL_SS0_Msk (0x1ul << SPI_SSCTL_SS0_Pos) /*!< SPI_T::SSCTL: SS0 Mask */ - -#define SPI_SSCTL_SS1_Pos (1) /*!< SPI_T::SSCTL: SS1 Position */ -#define SPI_SSCTL_SS1_Msk (0x1ul << SPI_SSCTL_SS1_Pos) /*!< SPI_T::SSCTL: SS1 Mask */ - -#define SPI_SSCTL_SSACTPOL_Pos (2) /*!< SPI_T::SSCTL: SSACTPOL Position */ -#define SPI_SSCTL_SSACTPOL_Msk (0x1ul << SPI_SSCTL_SSACTPOL_Pos) /*!< SPI_T::SSCTL: SSACTPOL Mask */ - -#define SPI_SSCTL_AUTOSS_Pos (3) /*!< SPI_T::SSCTL: AUTOSS Position */ -#define SPI_SSCTL_AUTOSS_Msk (0x1ul << SPI_SSCTL_AUTOSS_Pos) /*!< SPI_T::SSCTL: AUTOSS Mask */ - -#define SPI_SSCTL_SLV3WIRE_Pos (4) /*!< SPI_T::SSCTL: SLV3WIRE Position */ -#define SPI_SSCTL_SLV3WIRE_Msk (0x1ul << SPI_SSCTL_SLV3WIRE_Pos) /*!< SPI_T::SSCTL: SLV3WIRE Mask */ - -#define SPI_SSCTL_SLVBEIEN_Pos (8) /*!< SPI_T::SSCTL: SLVBEIEN Position */ -#define SPI_SSCTL_SLVBEIEN_Msk (0x1ul << SPI_SSCTL_SLVBEIEN_Pos) /*!< SPI_T::SSCTL: SLVBEIEN Mask */ - -#define SPI_SSCTL_SLVURIEN_Pos (9) /*!< SPI_T::SSCTL: SLVURIEN Position */ -#define SPI_SSCTL_SLVURIEN_Msk (0x1ul << SPI_SSCTL_SLVURIEN_Pos) /*!< SPI_T::SSCTL: SLVURIEN Mask */ - -#define SPI_SSCTL_SSACTIEN_Pos (12) /*!< SPI_T::SSCTL: SSACTIEN Position */ -#define SPI_SSCTL_SSACTIEN_Msk (0x1ul << SPI_SSCTL_SSACTIEN_Pos) /*!< SPI_T::SSCTL: SSACTIEN Mask */ - -#define SPI_SSCTL_SSINAIEN_Pos (13) /*!< SPI_T::SSCTL: SSINAIEN Position */ -#define SPI_SSCTL_SSINAIEN_Msk (0x1ul << SPI_SSCTL_SSINAIEN_Pos) /*!< SPI_T::SSCTL: SSINAIEN Mask */ - -#define SPI_PDMACTL_TXPDMAEN_Pos (0) /*!< SPI_T::PDMACTL: TXPDMAEN Position */ -#define SPI_PDMACTL_TXPDMAEN_Msk (0x1ul << SPI_PDMACTL_TXPDMAEN_Pos) /*!< SPI_T::PDMACTL: TXPDMAEN Mask */ - -#define SPI_PDMACTL_RXPDMAEN_Pos (1) /*!< SPI_T::PDMACTL: RXPDMAEN Position */ -#define SPI_PDMACTL_RXPDMAEN_Msk (0x1ul << SPI_PDMACTL_RXPDMAEN_Pos) /*!< SPI_T::PDMACTL: RXPDMAEN Mask */ - -#define SPI_PDMACTL_PDMARST_Pos (2) /*!< SPI_T::PDMACTL: PDMARST Position */ -#define SPI_PDMACTL_PDMARST_Msk (0x1ul << SPI_PDMACTL_PDMARST_Pos) /*!< SPI_T::PDMACTL: PDMARST Mask */ - -#define SPI_FIFOCTL_RXRST_Pos (0) /*!< SPI_T::FIFOCTL: RXRST Position */ -#define SPI_FIFOCTL_RXRST_Msk (0x1ul << SPI_FIFOCTL_RXRST_Pos) /*!< SPI_T::FIFOCTL: RXRST Mask */ - -#define SPI_FIFOCTL_TXRST_Pos (1) /*!< SPI_T::FIFOCTL: TXRST Position */ -#define SPI_FIFOCTL_TXRST_Msk (0x1ul << SPI_FIFOCTL_TXRST_Pos) /*!< SPI_T::FIFOCTL: TXRST Mask */ - -#define SPI_FIFOCTL_RXTHIEN_Pos (2) /*!< SPI_T::FIFOCTL: RXTHIEN Position */ -#define SPI_FIFOCTL_RXTHIEN_Msk (0x1ul << SPI_FIFOCTL_RXTHIEN_Pos) /*!< SPI_T::FIFOCTL: RXTHIEN Mask */ - -#define SPI_FIFOCTL_TXTHIEN_Pos (3) /*!< SPI_T::FIFOCTL: TXTHIEN Position */ -#define SPI_FIFOCTL_TXTHIEN_Msk (0x1ul << SPI_FIFOCTL_TXTHIEN_Pos) /*!< SPI_T::FIFOCTL: TXTHIEN Mask */ - -#define SPI_FIFOCTL_RXTOIEN_Pos (4) /*!< SPI_T::FIFOCTL: RXTOIEN Position */ -#define SPI_FIFOCTL_RXTOIEN_Msk (0x1ul << SPI_FIFOCTL_RXTOIEN_Pos) /*!< SPI_T::FIFOCTL: RXTOIEN Mask */ - -#define SPI_FIFOCTL_RXOVIEN_Pos (5) /*!< SPI_T::FIFOCTL: RXOVIEN Position */ -#define SPI_FIFOCTL_RXOVIEN_Msk (0x1ul << SPI_FIFOCTL_RXOVIEN_Pos) /*!< SPI_T::FIFOCTL: RXOVIEN Mask */ - -#define SPI_FIFOCTL_TXUFPOL_Pos (6) /*!< SPI_T::FIFOCTL: TXUFPOL Position */ -#define SPI_FIFOCTL_TXUFPOL_Msk (0x1ul << SPI_FIFOCTL_TXUFPOL_Pos) /*!< SPI_T::FIFOCTL: TXUFPOL Mask */ - -#define SPI_FIFOCTL_TXUFIEN_Pos (7) /*!< SPI_T::FIFOCTL: TXUFIEN Position */ -#define SPI_FIFOCTL_TXUFIEN_Msk (0x1ul << SPI_FIFOCTL_TXUFIEN_Pos) /*!< SPI_T::FIFOCTL: TXUFIEN Mask */ - -#define SPI_FIFOCTL_RXFBCLR_Pos (8) /*!< SPI_T::FIFOCTL: RXFBCLR Position */ -#define SPI_FIFOCTL_RXFBCLR_Msk (0x1ul << SPI_FIFOCTL_RXFBCLR_Pos) /*!< SPI_T::FIFOCTL: RXFBCLR Mask */ - -#define SPI_FIFOCTL_TXFBCLR_Pos (9) /*!< SPI_T::FIFOCTL: TXFBCLR Position */ -#define SPI_FIFOCTL_TXFBCLR_Msk (0x1ul << SPI_FIFOCTL_TXFBCLR_Pos) /*!< SPI_T::FIFOCTL: TXFBCLR Mask */ - -#define SPI_FIFOCTL_SLVBERX_Pos (10) /*!< SPI_T::FIFOCTL: SLVBERX Position */ -#define SPI_FIFOCTL_SLVBERX_Msk (0x1ul << SPI_FIFOCTL_SLVBERX_Pos) /*!< SPI_T::FIFOCTL: SLVBERX Mask */ - -#define SPI_FIFOCTL_RXTH_Pos (24) /*!< SPI_T::FIFOCTL: RXTH Position */ -#define SPI_FIFOCTL_RXTH_Msk (0x7ul << SPI_FIFOCTL_RXTH_Pos) /*!< SPI_T::FIFOCTL: RXTH Mask */ - -#define SPI_FIFOCTL_TXTH_Pos (28) /*!< SPI_T::FIFOCTL: TXTH Position */ -#define SPI_FIFOCTL_TXTH_Msk (0x7ul << SPI_FIFOCTL_TXTH_Pos) /*!< SPI_T::FIFOCTL: TXTH Mask */ - -#define SPI_STATUS_BUSY_Pos (0) /*!< SPI_T::STATUS: BUSY Position */ -#define SPI_STATUS_BUSY_Msk (0x1ul << SPI_STATUS_BUSY_Pos) /*!< SPI_T::STATUS: BUSY Mask */ - -#define SPI_STATUS_UNITIF_Pos (1) /*!< SPI_T::STATUS: UNITIF Position */ -#define SPI_STATUS_UNITIF_Msk (0x1ul << SPI_STATUS_UNITIF_Pos) /*!< SPI_T::STATUS: UNITIF Mask */ - -#define SPI_STATUS_SSACTIF_Pos (2) /*!< SPI_T::STATUS: SSACTIF Position */ -#define SPI_STATUS_SSACTIF_Msk (0x1ul << SPI_STATUS_SSACTIF_Pos) /*!< SPI_T::STATUS: SSACTIF Mask */ - -#define SPI_STATUS_SSINAIF_Pos (3) /*!< SPI_T::STATUS: SSINAIF Position */ -#define SPI_STATUS_SSINAIF_Msk (0x1ul << SPI_STATUS_SSINAIF_Pos) /*!< SPI_T::STATUS: SSINAIF Mask */ - -#define SPI_STATUS_SSLINE_Pos (4) /*!< SPI_T::STATUS: SSLINE Position */ -#define SPI_STATUS_SSLINE_Msk (0x1ul << SPI_STATUS_SSLINE_Pos) /*!< SPI_T::STATUS: SSLINE Mask */ - -#define SPI_STATUS_SLVBEIF_Pos (6) /*!< SPI_T::STATUS: SLVBEIF Position */ -#define SPI_STATUS_SLVBEIF_Msk (0x1ul << SPI_STATUS_SLVBEIF_Pos) /*!< SPI_T::STATUS: SLVBEIF Mask */ - -#define SPI_STATUS_SLVURIF_Pos (7) /*!< SPI_T::STATUS: SLVURIF Position */ -#define SPI_STATUS_SLVURIF_Msk (0x1ul << SPI_STATUS_SLVURIF_Pos) /*!< SPI_T::STATUS: SLVURIF Mask */ - -#define SPI_STATUS_RXEMPTY_Pos (8) /*!< SPI_T::STATUS: RXEMPTY Position */ -#define SPI_STATUS_RXEMPTY_Msk (0x1ul << SPI_STATUS_RXEMPTY_Pos) /*!< SPI_T::STATUS: RXEMPTY Mask */ - -#define SPI_STATUS_RXFULL_Pos (9) /*!< SPI_T::STATUS: RXFULL Position */ -#define SPI_STATUS_RXFULL_Msk (0x1ul << SPI_STATUS_RXFULL_Pos) /*!< SPI_T::STATUS: RXFULL Mask */ - -#define SPI_STATUS_RXTHIF_Pos (10) /*!< SPI_T::STATUS: RXTHIF Position */ -#define SPI_STATUS_RXTHIF_Msk (0x1ul << SPI_STATUS_RXTHIF_Pos) /*!< SPI_T::STATUS: RXTHIF Mask */ - -#define SPI_STATUS_RXOVIF_Pos (11) /*!< SPI_T::STATUS: RXOVIF Position */ -#define SPI_STATUS_RXOVIF_Msk (0x1ul << SPI_STATUS_RXOVIF_Pos) /*!< SPI_T::STATUS: RXOVIF Mask */ - -#define SPI_STATUS_RXTOIF_Pos (12) /*!< SPI_T::STATUS: RXTOIF Position */ -#define SPI_STATUS_RXTOIF_Msk (0x1ul << SPI_STATUS_RXTOIF_Pos) /*!< SPI_T::STATUS: RXTOIF Mask */ - -#define SPI_STATUS_SPIENSTS_Pos (15) /*!< SPI_T::STATUS: SPIENSTS Position */ -#define SPI_STATUS_SPIENSTS_Msk (0x1ul << SPI_STATUS_SPIENSTS_Pos) /*!< SPI_T::STATUS: SPIENSTS Mask */ - -#define SPI_STATUS_TXEMPTY_Pos (16) /*!< SPI_T::STATUS: TXEMPTY Position */ -#define SPI_STATUS_TXEMPTY_Msk (0x1ul << SPI_STATUS_TXEMPTY_Pos) /*!< SPI_T::STATUS: TXEMPTY Mask */ - -#define SPI_STATUS_TXFULL_Pos (17) /*!< SPI_T::STATUS: TXFULL Position */ -#define SPI_STATUS_TXFULL_Msk (0x1ul << SPI_STATUS_TXFULL_Pos) /*!< SPI_T::STATUS: TXFULL Mask */ - -#define SPI_STATUS_TXTHIF_Pos (18) /*!< SPI_T::STATUS: TXTHIF Position */ -#define SPI_STATUS_TXTHIF_Msk (0x1ul << SPI_STATUS_TXTHIF_Pos) /*!< SPI_T::STATUS: TXTHIF Mask */ - -#define SPI_STATUS_TXUFIF_Pos (19) /*!< SPI_T::STATUS: TXUFIF Position */ -#define SPI_STATUS_TXUFIF_Msk (0x1ul << SPI_STATUS_TXUFIF_Pos) /*!< SPI_T::STATUS: TXUFIF Mask */ - -#define SPI_STATUS_FIFOCLR_Pos (22) /*!< SPI_T::STATUS: FIFOCLR Position */ -#define SPI_STATUS_FIFOCLR_Msk (0x1ul << SPI_STATUS_FIFOCLR_Pos) /*!< SPI_T::STATUS: FIFOCLR Mask */ - -#define SPI_STATUS_TXRXRST_Pos (23) /*!< SPI_T::STATUS: TXRXRST Position */ -#define SPI_STATUS_TXRXRST_Msk (0x1ul << SPI_STATUS_TXRXRST_Pos) /*!< SPI_T::STATUS: TXRXRST Mask */ - -#define SPI_STATUS_RXCNT_Pos (24) /*!< SPI_T::STATUS: RXCNT Position */ -#define SPI_STATUS_RXCNT_Msk (0xful << SPI_STATUS_RXCNT_Pos) /*!< SPI_T::STATUS: RXCNT Mask */ - -#define SPI_STATUS_TXCNT_Pos (28) /*!< SPI_T::STATUS: TXCNT Position */ -#define SPI_STATUS_TXCNT_Msk (0xful << SPI_STATUS_TXCNT_Pos) /*!< SPI_T::STATUS: TXCNT Mask */ - -#define SPI_STATUS2_RXCPDMA_Pos (8) /*!< SPI_T::STATUS2: RXCPDMA Position */ -#define SPI_STATUS2_RXCPDMA_Msk (0x1ful << SPI_STATUS2_RXCPDMA_Pos) /*!< SPI_T::STATUS2: RXCPDMA Mask */ - -#define SPI_STATUS2_TXCPDMA_Pos (16) /*!< SPI_T::STATUS2: TXCPDMA Position */ -#define SPI_STATUS2_TXCPDMA_Msk (0x1ful << SPI_STATUS2_TXCPDMA_Pos) /*!< SPI_T::STATUS2: TXCPDMA Mask */ - -#define SPI_STATUS2_SLVBENUM_Pos (24) /*!< SPI_T::STATUS2: SLVBENUM Position */ -#define SPI_STATUS2_SLVBENUM_Msk (0x3ful << SPI_STATUS2_SLVBENUM_Pos) /*!< SPI_T::STATUS2: SLVBENUM Mask */ - -#define SPI_TX_TX_Pos (0) /*!< SPI_T::TX: TX Position */ -#define SPI_TX_TX_Msk (0xfffffffful << SPI_TX_TX_Pos) /*!< SPI_T::TX: TX Mask */ - -#define SPI_RX_RX_Pos (0) /*!< SPI_T::RX: RX Position */ -#define SPI_RX_RX_Msk (0xfffffffful << SPI_RX_RX_Pos) /*!< SPI_T::RX: RX Mask */ - -#define SPI_INTERNAL_MRXPHASE_Pos (12) /*!< SPI_T::INTERNAL: CLKDLY_SEL Position */ -#define SPI_INTERNAL_MRXPHASE_Msk (0xful << SPI_INTERNAL_MRXPHASE_Pos) /*!< SPI_T::INTERNAL: CLKDLY_SEL Mask */ - -#define SPI_I2SCTL_I2SEN_Pos (0) /*!< SPI_T::I2SCTL: I2SEN Position */ -#define SPI_I2SCTL_I2SEN_Msk (0x1ul << SPI_I2SCTL_I2SEN_Pos) /*!< SPI_T::I2SCTL: I2SEN Mask */ - -#define SPI_I2SCTL_TXEN_Pos (1) /*!< SPI_T::I2SCTL: TXEN Position */ -#define SPI_I2SCTL_TXEN_Msk (0x1ul << SPI_I2SCTL_TXEN_Pos) /*!< SPI_T::I2SCTL: TXEN Mask */ - -#define SPI_I2SCTL_RXEN_Pos (2) /*!< SPI_T::I2SCTL: RXEN Position */ -#define SPI_I2SCTL_RXEN_Msk (0x1ul << SPI_I2SCTL_RXEN_Pos) /*!< SPI_T::I2SCTL: RXEN Mask */ - -#define SPI_I2SCTL_MUTE_Pos (3) /*!< SPI_T::I2SCTL: MUTE Position */ -#define SPI_I2SCTL_MUTE_Msk (0x1ul << SPI_I2SCTL_MUTE_Pos) /*!< SPI_T::I2SCTL: MUTE Mask */ - -#define SPI_I2SCTL_WDWIDTH_Pos (4) /*!< SPI_T::I2SCTL: WDWIDTH Position */ -#define SPI_I2SCTL_WDWIDTH_Msk (0x3ul << SPI_I2SCTL_WDWIDTH_Pos) /*!< SPI_T::I2SCTL: WDWIDTH Mask */ - -#define SPI_I2SCTL_MONO_Pos (6) /*!< SPI_T::I2SCTL: MONO Position */ -#define SPI_I2SCTL_MONO_Msk (0x1ul << SPI_I2SCTL_MONO_Pos) /*!< SPI_T::I2SCTL: MONO Mask */ - -#define SPI_I2SCTL_ORDER_Pos (7) /*!< SPI_T::I2SCTL: ORDER Position */ -#define SPI_I2SCTL_ORDER_Msk (0x1ul << SPI_I2SCTL_ORDER_Pos) /*!< SPI_T::I2SCTL: ORDER Mask */ - -#define SPI_I2SCTL_SLAVE_Pos (8) /*!< SPI_T::I2SCTL: SLAVE Position */ -#define SPI_I2SCTL_SLAVE_Msk (0x1ul << SPI_I2SCTL_SLAVE_Pos) /*!< SPI_T::I2SCTL: SLAVE Mask */ - -#define SPI_I2SCTL_MCLKEN_Pos (15) /*!< SPI_T::I2SCTL: MCLKEN Position */ -#define SPI_I2SCTL_MCLKEN_Msk (0x1ul << SPI_I2SCTL_MCLKEN_Pos) /*!< SPI_T::I2SCTL: MCLKEN Mask */ - -#define SPI_I2SCTL_RZCEN_Pos (16) /*!< SPI_T::I2SCTL: RZCEN Position */ -#define SPI_I2SCTL_RZCEN_Msk (0x1ul << SPI_I2SCTL_RZCEN_Pos) /*!< SPI_T::I2SCTL: RZCEN Mask */ - -#define SPI_I2SCTL_LZCEN_Pos (17) /*!< SPI_T::I2SCTL: LZCEN Position */ -#define SPI_I2SCTL_LZCEN_Msk (0x1ul << SPI_I2SCTL_LZCEN_Pos) /*!< SPI_T::I2SCTL: LZCEN Mask */ - -#define SPI_I2SCTL_RXLCH_Pos (23) /*!< SPI_T::I2SCTL: RXLCH Position */ -#define SPI_I2SCTL_RXLCH_Msk (0x1ul << SPI_I2SCTL_RXLCH_Pos) /*!< SPI_T::I2SCTL: RXLCH Mask */ - -#define SPI_I2SCTL_RZCIEN_Pos (24) /*!< SPI_T::I2SCTL: RZCIEN Position */ -#define SPI_I2SCTL_RZCIEN_Msk (0x1ul << SPI_I2SCTL_RZCIEN_Pos) /*!< SPI_T::I2SCTL: RZCIEN Mask */ - -#define SPI_I2SCTL_LZCIEN_Pos (25) /*!< SPI_T::I2SCTL: LZCIEN Position */ -#define SPI_I2SCTL_LZCIEN_Msk (0x1ul << SPI_I2SCTL_LZCIEN_Pos) /*!< SPI_T::I2SCTL: LZCIEN Mask */ - -#define SPI_I2SCTL_FORMAT_Pos (28) /*!< SPI_T::I2SCTL: FORMAT Position */ -#define SPI_I2SCTL_FORMAT_Msk (0x3ul << SPI_I2SCTL_FORMAT_Pos) /*!< SPI_T::I2SCTL: FORMAT Mask */ - -#define SPI_I2SCTL_SLVERRIEN_Pos (31) /*!< SPI_T::I2SCTL: SLVERRIEN Position */ -#define SPI_I2SCTL_SLVERRIEN_Msk (0x1ul << SPI_I2SCTL_SLVERRIEN_Pos) /*!< SPI_T::I2SCTL: SLVERRIEN Mask */ - -#define SPI_I2SCLK_MCLKDIV_Pos (0) /*!< SPI_T::I2SCLK: MCLKDIV Position */ -#define SPI_I2SCLK_MCLKDIV_Msk (0x7ful << SPI_I2SCLK_MCLKDIV_Pos) /*!< SPI_T::I2SCLK: MCLKDIV Mask */ - -#define SPI_I2SCLK_BCLKDIV_Pos (8) /*!< SPI_T::I2SCLK: BCLKDIV Position */ -#define SPI_I2SCLK_BCLKDIV_Msk (0x3fful << SPI_I2SCLK_BCLKDIV_Pos) /*!< SPI_T::I2SCLK: BCLKDIV Mask */ - -#define SPI_I2SCLK_I2SMODE_Pos (24) /*!< SPI_T::I2SCLK: I2SMODE Position */ -#define SPI_I2SCLK_I2SMODE_Msk (0x1ul << SPI_I2SCLK_I2SMODE_Pos) /*!< SPI_T::I2SCLK: I2SMODE Mask */ - -#define SPI_I2SCLK_I2SSLAVE_Pos (25) /*!< SPI_T::I2SCLK: I2SSLAVE Position */ -#define SPI_I2SCLK_I2SSLAVE_Msk (0x1ul << SPI_I2SCLK_I2SSLAVE_Pos) /*!< SPI_T::I2SCLK: I2SSLAVE Mask */ - -#define SPI_I2SSTS_RIGHT_Pos (4) /*!< SPI_T::I2SSTS: RIGHT Position */ -#define SPI_I2SSTS_RIGHT_Msk (0x1ul << SPI_I2SSTS_RIGHT_Pos) /*!< SPI_T::I2SSTS: RIGHT Mask */ - -#define SPI_I2SSTS_RXEMPTY_Pos (8) /*!< SPI_T::I2SSTS: RXEMPTY Position */ -#define SPI_I2SSTS_RXEMPTY_Msk (0x1ul << SPI_I2SSTS_RXEMPTY_Pos) /*!< SPI_T::I2SSTS: RXEMPTY Mask */ - -#define SPI_I2SSTS_RXFULL_Pos (9) /*!< SPI_T::I2SSTS: RXFULL Position */ -#define SPI_I2SSTS_RXFULL_Msk (0x1ul << SPI_I2SSTS_RXFULL_Pos) /*!< SPI_T::I2SSTS: RXFULL Mask */ - -#define SPI_I2SSTS_RXTHIF_Pos (10) /*!< SPI_T::I2SSTS: RXTHIF Position */ -#define SPI_I2SSTS_RXTHIF_Msk (0x1ul << SPI_I2SSTS_RXTHIF_Pos) /*!< SPI_T::I2SSTS: RXTHIF Mask */ - -#define SPI_I2SSTS_RXOVIF_Pos (11) /*!< SPI_T::I2SSTS: RXOVIF Position */ -#define SPI_I2SSTS_RXOVIF_Msk (0x1ul << SPI_I2SSTS_RXOVIF_Pos) /*!< SPI_T::I2SSTS: RXOVIF Mask */ - -#define SPI_I2SSTS_RXTOIF_Pos (12) /*!< SPI_T::I2SSTS: RXTOIF Position */ -#define SPI_I2SSTS_RXTOIF_Msk (0x1ul << SPI_I2SSTS_RXTOIF_Pos) /*!< SPI_T::I2SSTS: RXTOIF Mask */ - -#define SPI_I2SSTS_I2SENSTS_Pos (15) /*!< SPI_T::I2SSTS: I2SENSTS Position */ -#define SPI_I2SSTS_I2SENSTS_Msk (0x1ul << SPI_I2SSTS_I2SENSTS_Pos) /*!< SPI_T::I2SSTS: I2SENSTS Mask */ - -#define SPI_I2SSTS_TXEMPTY_Pos (16) /*!< SPI_T::I2SSTS: TXEMPTY Position */ -#define SPI_I2SSTS_TXEMPTY_Msk (0x1ul << SPI_I2SSTS_TXEMPTY_Pos) /*!< SPI_T::I2SSTS: TXEMPTY Mask */ - -#define SPI_I2SSTS_TXFULL_Pos (17) /*!< SPI_T::I2SSTS: TXFULL Position */ -#define SPI_I2SSTS_TXFULL_Msk (0x1ul << SPI_I2SSTS_TXFULL_Pos) /*!< SPI_T::I2SSTS: TXFULL Mask */ - -#define SPI_I2SSTS_TXTHIF_Pos (18) /*!< SPI_T::I2SSTS: TXTHIF Position */ -#define SPI_I2SSTS_TXTHIF_Msk (0x1ul << SPI_I2SSTS_TXTHIF_Pos) /*!< SPI_T::I2SSTS: TXTHIF Mask */ - -#define SPI_I2SSTS_TXUFIF_Pos (19) /*!< SPI_T::I2SSTS: TXUFIF Position */ -#define SPI_I2SSTS_TXUFIF_Msk (0x1ul << SPI_I2SSTS_TXUFIF_Pos) /*!< SPI_T::I2SSTS: TXUFIF Mask */ - -#define SPI_I2SSTS_RZCIF_Pos (20) /*!< SPI_T::I2SSTS: RZCIF Position */ -#define SPI_I2SSTS_RZCIF_Msk (0x1ul << SPI_I2SSTS_RZCIF_Pos) /*!< SPI_T::I2SSTS: RZCIF Mask */ - -#define SPI_I2SSTS_LZCIF_Pos (21) /*!< SPI_T::I2SSTS: LZCIF Position */ -#define SPI_I2SSTS_LZCIF_Msk (0x1ul << SPI_I2SSTS_LZCIF_Pos) /*!< SPI_T::I2SSTS: LZCIF Mask */ - -#define SPI_I2SSTS_SLVERRIF_Pos (22) /*!< SPI_T::I2SSTS: SLVERRIF Position */ -#define SPI_I2SSTS_SLVERRIF_Msk (0x1ul << SPI_I2SSTS_SLVERRIF_Pos) /*!< SPI_T::I2SSTS: SLVERRIF Mask */ - -#define SPI_I2SSTS_TXRXRST_Pos (23) /*!< SPI_T::I2SSTS: TXRXRST Position */ -#define SPI_I2SSTS_TXRXRST_Msk (0x1ul << SPI_I2SSTS_TXRXRST_Pos) /*!< SPI_T::I2SSTS: TXRXRST Mask */ - -#define SPI_I2SSTS_RXCNT_Pos (24) /*!< SPI_T::I2SSTS: RXCNT Position */ -#define SPI_I2SSTS_RXCNT_Msk (0x7ul << SPI_I2SSTS_RXCNT_Pos) /*!< SPI_T::I2SSTS: RXCNT Mask */ - -#define SPI_I2SSTS_TXCNT_Pos (28) /*!< SPI_T::I2SSTS: TXCNT Position */ -#define SPI_I2SSTS_TXCNT_Msk (0x7ul << SPI_I2SSTS_TXCNT_Pos) /*!< SPI_T::I2SSTS: TXCNT Mask */ - -/**@}*/ /* SPI_CONST */ -/**@}*/ /* end of SPI register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SPI_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ssmcc_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ssmcc_reg.h deleted file mode 100644 index 1ad967d3d09..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/ssmcc_reg.h +++ /dev/null @@ -1,932 +0,0 @@ -/**************************************************************************//** - * @file ssmcc_reg.h - * @brief SSMCC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SSMCC_REG_H__ -#define __SSMCC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -typedef struct -{ - /** - * @var FAIL_T::ADDRESS_LOW - * Offset: 0x20 Contains the lower 32 bits of the address of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |addr_status_low|If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite address bits [31:0] of the first f. You must clear the associated interrupt status before this field can return the address of accesses of subsequent permission checks or region overlap failures. This occurs even if the ACTION register does not enable the interrupt. If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var FAIL_T::ADDRESS_HIGH - * Offset: 0x24 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var FAIL_T::CONTROL - * Offset: 0x28 Contains the control status information of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[20] |Privileged|If a region permission check fails or a region overlap occurs, this field indicates whether it was an unprivileged or privileged access attempt You must clear the associated interrupt status before this field can return the values of accesses of subsequent permission checks or region overlap failures 0 Unprivileged access 1 Privileged access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[21] |Non_secure|If a region permission check fails or a region overlap occurs, this field indicates whether it was a Secure or Non- secure access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Secure access 1 Non-secure access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[24] |Direction |If a region permission check fails or a region overlap occurs, this field indicates whether the failed access was a read or write access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Read access 1 Write access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var FAIL_T::ID - * Offset: 0x2C Contains the master ACE-Lite ARID or AWID of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |id |If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite ID values of the first failed access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[27:24] |vnet |If a region permission check fails or a region overlap occurs, this field returns the VN number of the first failed access, from either ARVNET or AWVNET as appropriate If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - */ - __I uint32_t ADDRESS_LOW; /*!< [0x0000] Contains the lower 32 bits of the address of the first access that failed a region permission check in the associated filter unit. */ - __IO uint32_t ADDRESS_HIGH; /*!< [0x0004] Reserved */ - __I uint32_t CONTROL; /*!< [0x0008] Contains the control status information of the first access that failed a region permission check in the associated filter unit. */ - __I uint32_t ID; /*!< [0x000c] Contains the master ACE-Lite ARID or AWID of the first access that failed a region permission check in the associated filter unit. */ -} FAIL_STS_T; - -typedef struct -{ - __IO uint32_t BASE_LOW; /*!< [0x0000] */ - __IO uint32_t BASE_HIGH; /*!< [0x0004] */ - __IO uint32_t TOP_LOW; /*!< [0x0008] */ - __IO uint32_t TOP_HIGH; /*!< [0x000c] */ - __IO uint32_t ATTRIBUTES; /*!< [0x0010] */ - __IO uint32_t ID_ACCESS; /*!< [0x0014] */ - __I uint32_t RESERVE2[2]; /*!< [0x0018] */ -} REGION_T; - -/*---------------------- System Security Memory Configuration Controller -------------------------*/ -/** - @addtogroup SSMCC System Security Memory Configuration Controller(SSMCC) - Memory Mapped Structure for SSMCC Controller -@{ */ - -typedef struct -{ - - - /** - * @var SSMCC_T::SCWP - * Offset: 0x00 Security Configuration Write Protect Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ENABLE |Write Protection Enable Bit - * | | |0 = Security Configuration Write Protection Disabled. - * | | |1 = Security Configuration Write Protection Enabled. - * |[1] |LOCK |Write Protection Enable and Lock Bit (Write 1 to Set) - * | | |0 = Security Configuration Write Protection Disabled. - * | | |1 = Security Configuration Write Protection Enabled. - * | | |Note: This bit can only be cleared by system reset. - * |[31:16] |WVCODE |Write Verify Code - * | | |Read operation: - * | | |Reserved, all zeros. - * | | |Write operation: - * | | |0x475A = The write verify code, 0x475A, is needed to do a valid write to SSMCC_SCWP. - * | | |Others = Invalid write verify code. - */ - __IO uint32_t SCWP; /*!< [0x0000] Security Configuration Write Protect Register */ - -} SSMCC_T; - -/** - @addtogroup SSMCC_CONST SSMCC Bit Field Definition - Constant Definitions for SSMCC Controller -@{ */ - -#define SSMCC_SCWP_ENABLE_Pos (0) /*!< SSMCC_T::SCWP: ENABLE Position */ -#define SSMCC_SCWP_ENABLE_Msk (0x1ul << SSMCC_SCWP_ENABLE_Pos) /*!< SSMCC_T::SCWP: ENABLE Mask */ - -#define SSMCC_SCWP_LOCK_Pos (1) /*!< SSMCC_T::SCWP: LOCK Position */ -#define SSMCC_SCWP_LOCK_Msk (0x1ul << SSMCC_SCWP_LOCK_Pos) /*!< SSMCC_T::SCWP: LOCK Mask */ - -#define SSMCC_SCWP_WVCODE_Pos (16) /*!< SSMCC_T::SCWP: WVCODE Position */ -#define SSMCC_SCWP_WVCODE_Msk (0xfffful << SSMCC_SCWP_WVCODE_Pos) /*!< SSMCC_T::SCWP: WVCODE Mask */ - -/**@}*/ /* SSMCC_CONST */ -/**@}*/ /* end of SSMCC register group */ - - -/*---------------------- TrustZone Address Space Controller -------------------------*/ -/** - @addtogroup TZC TrustZone Address Space Controller(TZC) - Memory Mapped Structure for TZC Controller -@{ */ - -typedef struct -{ - /** - * @var TZC_T::BUILD_CONFIG - * Offset: 0x00 Provides information about the configuration of the TZC-400. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |no_of_regions|Defines the number of regions that the TZC-400 provides: 0b01000 Nine regions All other values Reserved. - * |[13:8] |address_width|Defines the width of the ACE-Lite address bus: 0b011111 32 bits 0b100011 36 bits 0b100111 40 bits 0b101111 48 bits 0b111111 64 bits All other values Reserved. - * |[25:24] |no_of_filters|Defines the number of filter units in the design implementation: 0b00 One filter unit 0b01 Two filter units 0b10 Reserved 0b11 Four filter units. - * @var TZC_T::ACTION - * Offset: 0x04 Controls the interrupt and bus response signaling behavior of the TZC-400 when region permission failures occur. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |reaction_value|Controls how the TZC-400 uses the BRESPS[1:0], RRESPS[1:0], and TZCINT signals when a region permission failure occurs, excluding region overlap errors The settings for these bits are: 0b00 Sets TZCINT LOW and issues an OKAY response 0b01 Sets TZCINT LOW and issues a DECERR response 0b10 Sets TZCINT HIGH and issues an OKAY response 0b11 Sets TZCINT HIGH and issues a DECERR response When a region overlap for region 1 and higher occurs, this field also determines how TZCINT is set The settings are: 0b00, 0b01 TZCINT LOW 0b10, 0b11 TZCINT HIGH. - * @var TZC_T::GATE_KEEPER - * Offset: 0x08 Provides control and status for the gate keeper in each filter unit implemented - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |open_request|Each bit in this field requests the gate of the associated filter unit to be open or closed Each bit is associated as follows: bit 0 Filter 0 bit 1 Filter 1 bit 2 Filter 2 bit 3 Filter 3. Set the open_request bit to 1, to request the gate to be open Set the open_request bit to 0, to request the gate to be closed If any of the associated filter units are not implemented, the corresponding open_request bits are unused, - * |[19:16] |open_status|The current state of the gate keeper in each filter unit The bit associations are as follows: bit 16 Filter 0 gate keeper status bit 17 Filter 1 gate keeper status bit 18 Filter 2 gate keeper status bit 19 Filter 3 gate keeper status When a bit is set to 1, the gate keeper permits access to its associated filter, that is, it is open When a bit is set to 0, the gate keeper no longer permits access to its associated filter, that is, it is closed This bit is set to 0 when both of the following conditions are fulfilled:This means that the gate keeper always waits for outstanding accesses to complete • The gate keeper no longer permits access to its associated filter • All outstanding accesses through the filter unit are complete If any of the associated filter units are not implemented, the corresponding gate keeper bits are unused, - * @var TZC_T::SPECULATION_CTRL - * Offset: 0x0C Controls the read access speculation and write access speculation. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |read_spec_disable|Controls read access speculation Note This bit is ignored and assumed to be zero at a filter unit if the corresponding QVNENABLE signal is HIGH You can set this bit as follows: 0 Enables read access speculation This is the default setting 1 Disables read access speculation. - * |[1] |write_spec_disable|Controls write acc. Note This bit is ignored and assumed to be zero at a filter unit if the corresponding QVNENABLE signal is HIGH. Set this bit as follows: 0 Enables write access speculation. This is the default setting. 1 Disables write access speculation. - * @var TZC_T::INT_STATUS - * Offset: 0x10 Contains the status of the interrupt signal, TZCINT, that reports access security violations or region overlap errors. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |status |Each bit is associated as follows: bit 0 Filter 0 bit 1 Filter 1 bit 2 Filter 2 bit 3 Filter 3. Each bit in this field indicates the status of the interrupt from each filter unit as follows: 0 Interrupt is not asserted 1 Interrupt is asserted and waiting to be cleared This bit is set even if the ACTION register is set to not drive the interrupt output TZCINT HIGH Therefore, the status acts as an indicator that a region permission check failure or an overlap error has occurred at a particular filter unit. - * |[11:8] |overrun |The bit associations are as follows: bit 8 Filter 0 bit 9 Filter 1 bit 10 Filter 2 bit 11 Filter 3. When a bit is set to 1, it indicates the occurrence of two or more region permission or region overlapping failures at the associated filter unit after the interrupt was cleared by the associated bit This bit is set even if the ACTION register is set to not drive the interrupt Clear the interrupt status of the associated bit in the INT_CLEAR register to also clear this field. - * |[19:16] |overlap |The bit associations are as follows: bit 16 Filter 0 bit 17 Filter 1 bit 18 Filter 2 bit 19 Filter 3 When a bit is set to 1, it indicates a violation of the overlap region configuration rules for the associated filter unit This occurs when an access matches with two enabled regions at the same time unless the overlap is only with Region 0. This bit is set even if the ACTION register is set to not drive the interrupt When this bit is 1, the interrupt status bit is also set to 1. Clear the interrupt status of the associated bit to also clear this field - * @var TZC_T::INT_CLEAR - * Offset: 0x14 Clears the interrupt. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |clear |Contains the control bits to clear interrupts The bit associations are as follows: bit 0 Filter 0 bit 1 Filter 1 bit 2 Filter 2 bit 3 Filter 3. Write a 1 to any of these bits to clear the associated status, overrun, and overlap bits in the INT_STATUS register. - * @var TZC_T::FAIL_ADDRESS_LOW_0 - * Offset: 0x20 Contains the lower 32 bits of the address of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |addr_status_low|If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite address bits [31:0] of the first f. You must clear the associated interrupt status before this field can return the address of accesses of subsequent permission checks or region overlap failures. This occurs even if the ACTION register does not enable the interrupt. If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ADDRESS_HIGH_0 - * Offset: 0x24 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::FAIL_CONTROL_0 - * Offset: 0x28 Contains the control status information of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[20] |Privileged|If a region permission check fails or a region overlap occurs, this field indicates whether it was an unprivileged or privileged access attempt You must clear the associated interrupt status before this field can return the values of accesses of subsequent permission checks or region overlap failures 0 Unprivileged access 1 Privileged access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[21] |Non_secure|If a region permission check fails or a region overlap occurs, this field indicates whether it was a Secure or Non- secure access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Secure access 1 Non-secure access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[24] |Direction |If a region permission check fails or a region overlap occurs, this field indicates whether the failed access was a read or write access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Read access 1 Write access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ID_0 - * Offset: 0x2C Contains the master ACE-Lite ARID or AWID of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |id |If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite ID values of the first failed access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[27:24] |vnet |If a region permission check fails or a region overlap occurs, this field returns the VN number of the first failed access, from either ARVNET or AWVNET as appropriate If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ADDRESS_LOW_1 - * Offset: 0x30 Contains the lower 32 bits of the address of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |addr_status_low|If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite address bits [31:0] of the first f. You must clear the associated interrupt status before this field can return the address of accesses of subsequent permission checks or region overlap failures. This occurs even if the ACTION register does not enable the interrupt. If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ADDRESS_HIGH_1 - * Offset: 0x34 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::FAIL_CONTROL_1 - * Offset: 0x38 Contains the control status information of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[20] |Privileged|If a region permission check fails or a region overlap occurs, this field indicates whether it was an unprivileged or privileged access attempt You must clear the associated interrupt status before this field can return the values of accesses of subsequent permission checks or region overlap failures 0 Unprivileged access 1 Privileged access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[21] |Non_secure|If a region permission check fails or a region overlap occurs, this field indicates whether it was a Secure or Non- secure access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Secure access 1 Non-secure access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[24] |Direction |If a region permission check fails or a region overlap occurs, this field indicates whether the failed access was a read or write access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Read access 1 Write access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ID_1 - * Offset: 0x3C Contains the master ACE-Lite ARID or AWID of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |id |If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite ID values of the first failed access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[27:24] |vnet |If a region permission check fails or a region overlap occurs, this field returns the VN number of the first failed access, from either ARVNET or AWVNET as appropriate If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ADDRESS_LOW_2 - * Offset: 0x40 Contains the lower 32 bits of the address of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |addr_status_low|If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite address bits [31:0] of the first f. You must clear the associated interrupt status before this field can return the address of accesses of subsequent permission checks or region overlap failures. This occurs even if the ACTION register does not enable the interrupt. If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ADDRESS_HIGH_2 - * Offset: 0x44 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::FAIL_CONTROL_2 - * Offset: 0x48 Contains the control status information of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[20] |Privileged|If a region permission check fails or a region overlap occurs, this field indicates whether it was an unprivileged or privileged access attempt You must clear the associated interrupt status before this field can return the values of accesses of subsequent permission checks or region overlap failures 0 Unprivileged access 1 Privileged access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[21] |Non_secure|If a region permission check fails or a region overlap occurs, this field indicates whether it was a Secure or Non- secure access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Secure access 1 Non-secure access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[24] |Direction |If a region permission check fails or a region overlap occurs, this field indicates whether the failed access was a read or write access attempt You must clear the associated interrupt status before this field can return the direction of accesses of subsequent permission checks or region overlap failures 0 Read access 1 Write access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::FAIL_ID_2 - * Offset: 0x4C Contains the master ACE-Lite ARID or AWID of the first access that failed a region permission check in the associated filter unit. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |id |If a region permission check fails or a region overlap occurs, this field returns the ACE-Lite ID values of the first failed access If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * |[27:24] |vnet |If a region permission check fails or a region overlap occurs, this field returns the VN number of the first failed access, from either ARVNET or AWVNET as appropriate If the status flag for the filter unit in the INT_STATUS register is already set, new region permission check failures in the same filter unit do not update the associated fail status group of registers. - * @var TZC_T::REGION_BASE_LOW_0 - * Offset: 0x100 This register is read-only and is hard-wired to all zeros. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region - * | | |For Region 0, this field is read-only. The TZC-400 sets the base address of Region 0 to 0x0. - * @var TZC_T::REGION_BASE_HIGH_0 - * Offset: 0x104 This register is read-only and is hard-wired to all zeros. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_0 - * Offset: 0x108 This register is read-only and is hard-wired to all 1. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region - * | | |For Region 0, this field is read-only and all bits are set HIGH. - * | | |. - * @var TZC_T::REGION_TOP_HIGH_0 - * Offset: 0x10C This register is read-only and is hard-wired to all zeros. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_0 - * Offset: 0x110 Controls the permissions for Region 0. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_0 - * Offset: 0x114 Controls the Non-secure access based on the NSAID inputs for Region 0. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_1 - * Offset: 0x120 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_1 - * Offset: 0x124 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_1 - * Offset: 0x128 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_1 - * Offset: 0x12C Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_1 - * Offset: 0x130 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_1 - * Offset: 0x134 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_2 - * Offset: 0x140 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_2 - * Offset: 0x144 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_2 - * Offset: 0x148 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_2 - * Offset: 0x14C Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_2 - * Offset: 0x150 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_2 - * Offset: 0x154 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_3 - * Offset: 0x160 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_3 - * Offset: 0x164 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_3 - * Offset: 0x168 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_3 - * Offset: 0x16C Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_3 - * Offset: 0x170 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_3 - * Offset: 0x174 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_4 - * Offset: 0x180 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_4 - * Offset: 0x184 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_4 - * Offset: 0x188 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_4 - * Offset: 0x18C Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_4 - * Offset: 0x190 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_4 - * Offset: 0x194 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_5 - * Offset: 0x1A0 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_5 - * Offset: 0x1A4 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_5 - * Offset: 0x1A8 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_5 - * Offset: 0x1AC Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_5 - * Offset: 0x1B0 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_5 - * Offset: 0x1B4 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_6 - * Offset: 0x1C0 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_6 - * Offset: 0x1C4 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_6 - * Offset: 0x1C8 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_6 - * Offset: 0x1CC Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_6 - * Offset: 0x1D0 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_6 - * Offset: 0x1D4 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_7 - * Offset: 0x1E0 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_7 - * Offset: 0x1E4 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_7 - * Offset: 0x1E8 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_7 - * Offset: 0x1EC Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_7 - * Offset: 0x1F0 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_7 - * Offset: 0x1F4 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::REGION_BASE_LOW_8 - * Offset: 0x200 Controls the base address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |base_address_low_n_|Controls the base address bits[31:12] of Region For Region 0, this field is read-only The TZC-400 sets the base address of Region 0 to 0x0 The TZC-400 only permits a region to start at a 4KB aligned address and address bits[11:0] are zeros. - * @var TZC_T::REGION_BASE_HIGH_8 - * Offset: 0x204 Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_TOP_LOW_8 - * Offset: 0x208 Controls the region top address bits[31:12] of Region . - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |top_address_low_n_|Controls the region top address bits[31:12] of region This address points to the start of the next 4KB aligned address immediately outside the region. - * @var TZC_T::REGION_TOP_HIGH_8 - * Offset: 0x20C Reserved - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var TZC_T::REGION_ATTRIBUTES_8 - * Offset: 0x210 Controls the permissions and target filter region enables. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |filter_en |Independent region enable for each filter unit Each bit is associated with a filter unit Set these bits as follows: Bit 0 For Filter 0 Bit 1 For Filter 1 Bit 2 For Filter 2 Bit 3 For Filter 3. When set HIGH, it enables the use of the current region programming for the associated filter For Region 0, all bits are set HIGH and cannot be modified. - * |[30] |s_rd_en |Secure global read enable This control bit defines the permissions for the Secure reads in the region Set this bit as follows: 0 Secure read to the region is not permitted 1 Permits Secure read to the region. - * |[31] |s_wr_en |Secure global write enable This control bit defines the permissions for the Secure writes in the region Set this bit as follows: 0 Secure write to the region is not permitted 1 Permits Secure write to the region. - * @var TZC_T::REGION_ID_ACCESS_8 - * Offset: 0x214 Controls the Non-secure access based on the NSAID inputs. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |nsaid_rd_en|NSAID read enables - * | | |This enables NSAID inputs to define Non-secure read access permission Each bit of the nsaid_rd_en register field is associated with a value on the NSAIDR signal as follows: Bit 0 Associated with NSAIDR = 0 - * | | |Bit 1 Associated with NSAIDR = 1 - * | | |Bit 2 Associated with NSAIDR = 2 - * | | |Bit 15 Associated with NSAIDR = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set HIGH, TZC-400 permits Non-secure read access to any access with the associated NSAIDR value - * | | |For example, if NSAIDR is 3 and the corresponding nsaid_rd_en[3] bit is set HIGH then TZC-400 permits the Non-secure read access to progress. - * |[31:16] |nsaid_wr_en|NSAID write enables - * | | |This enables NSAID inputs to define Non-secure write access permission Each bit of the nsaid_wr_en register field is associated with a value on the NSAIDW signal as follows: Bit 16 Associated with NSAIDW = 0 - * | | |Bit 17 Associated with NSAIDW = 1 - * | | |Bit 18 Associated with NSAIDW = 2 - * | | |Bit 31 Associated with NSAIDW = 15 - * | | | is the filter unit number - * | | |When any bit in this field is set to 1, TZC-400 permits Non-secure write access to any access with the associated NSAIDW value - * | | |For example, if NSAIDW is 3 and the corresponding nsaid_wr_en[3] bit is set HIGH then TZC-400 permits the Non-secure write access to progress. - * @var TZC_T::PID4 - * Offset: 0xFD0 Provides the following information about the peripheral configuration u2022 4KB_count. u2022 Jep106_c_code. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |jep106_c_code|The JEP106 continuation code value represents how many 0x7F continuation characters occur in the manufacturer identity code These bits read back as 0x4 For information on the JEP106 standard, see the Additional reading section. - * |[7:4] |4KB_count |The number of 4KB address blocks required to access the registers, expressed in powers of 2 These bits read back as 0x0 This means that the TZC-400 occupies a single 4KB address block. - * @var TZC_T::PID0 - * Offset: 0xFE0 The PID0 register provides the following information about the peripheral configuration: u2022 part_number_0. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |part_number_0|These bits read back as 0x60 - * @var TZC_T::PID1 - * Offset: 0xFE4 The PID1 register provides the following information about the peripheral configuration: u2022 part_number_1. u2022 Jep106_id_3_0. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |part_number_1|These bits read back as 0x4. - * |[7:4] |jep106_id_3_0|JEP106 identity code [3:0] See the JEP106, Standard Manufacturer Identification Code These bits read back as 0xB because ARM is the peripheral designer. - * @var TZC_T::PID2 - * Offset: 0xFE8 The PID2 register provides the following information about the peripheral configuration: u2022 Jep106_id_6_4. u2022 Revision number. u2022 JEDEC use flag. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |jep106_id_6_4|JEP106 identity code [6:4] See the JEP106, Standard Manufacturer Identification Code These bits read back as 0b011 because ARM is the peripheral designer. - * |[3] |jedec_used|This indicates that the TZC-400 uses a manufacturer identity code that was allocated by JEDEC according to JEP106 This bit always reads back as 0x1. - * |[7:4] |revision |Identifies the revision of the TZC-400 For revision r0p1, this field is set to 0x2. - * @var TZC_T::PID3 - * Offset: 0xFEC The PID3 register provides the following information about the peripheral configuration: u2022 Mod Number. u2022 RevAnd. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |mod_number|This is set to 0x0. - * |[7:4] |RevAnd |The top-level RTL provides a 4-bit input, USERPID3REVAND, that is normally tied LOW and provides a read value of 0x0 When silicon is available, and if metal fixes are required, the manufacturer can modify the tie-offs to indicate a revision of the silicon. - * @var TZC_T::CID0 - * Offset: 0xFF0 This is one of four 8-bit registers that together hold a 32-bit component ID value. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |comp_id_0 |These bits read back as 0x0D - * @var TZC_T::CID1 - * Offset: 0xFF4 This is one of four 8-bit registers, that together hold a 32-bit component ID value. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |comp_id_0 |These bits read back as 0xF0 - * @var TZC_T::CID2 - * Offset: 0xFF8 This is one of four 8-bit registers, that together hold a 32-bit component ID value. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |comp_id_2 |These bits read back as 0x05 - * @var TZC_T::CID3 - * Offset: 0xFFC This is one of four 8-bit registers that together hold a 32-bit component ID value. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |comp_id_3 |These bits read back as 0xB1 - */ - __I uint32_t BUILD_CONFIG; /*!< [0x0000] Provides information about the configuration of the TZC-400. */ - __IO uint32_t ACTION; /*!< [0x0004] Controls the interrupt and bus response signaling behavior of the TZC-400 when region permission failures occur. */ - __IO uint32_t GATE_KEEPER; /*!< [0x0008] Provides control and status for the gate keeper in each filter unit implemented */ - __IO uint32_t SPECULATION_CTRL; /*!< [0x000c] Controls the read access speculation and write access speculation. */ - __I uint32_t INT_STATUS; /*!< [0x0010] Contains the status of the interrupt signal, TZCINT, that reports access security violations or region overlap errors. */ - __O uint32_t INT_CLEAR; /*!< [0x0014] Clears the interrupt. */ - __I uint32_t RESERVE0[2]; - FAIL_STS_T FAIL[3]; /*!< [0x0020] Failed regions */ - __I uint32_t RESERVE1[44]; - - /*!< [0x0100] This register is read-only and is hard-wired to all zeros. */ - REGION_T REGION[9]; /*!< [0x0100] All structure regions in TZC. */ - __I uint32_t RESERVE10[876]; - __I uint32_t PID4; /*!< [0x0fd0] Provides the following information about the peripheral configuration u2022 4KB_count. u2022 Jep106_c_code. */ - __I uint32_t RESERVE11[3]; - __I uint32_t PID0; /*!< [0x0fe0] The PID0 register provides the following information about the peripheral configuration: u2022 part_number_0. */ - __I uint32_t PID1; /*!< [0x0fe4] The PID1 register provides the following information about the peripheral configuration: u2022 part_number_1. u2022 Jep106_id_3_0. */ - __I uint32_t PID2; /*!< [0x0fe8] The PID2 register provides the following information about the peripheral configuration: u2022 Jep106_id_6_4. u2022 Revision number. u2022 JEDEC use flag. */ - __I uint32_t PID3; /*!< [0x0fec] The PID3 register provides the following information about the peripheral configuration: u2022 Mod Number. u2022 RevAnd. */ - __I uint32_t CID0; /*!< [0x0ff0] This is one of four 8-bit registers that together hold a 32-bit component ID value. */ - __I uint32_t CID1; /*!< [0x0ff4] This is one of four 8-bit registers, that together hold a 32-bit component ID value. */ - __I uint32_t CID2; /*!< [0x0ff8] This is one of four 8-bit registers, that together hold a 32-bit component ID value. */ - __I uint32_t CID3; /*!< [0x0ffc] This is one of four 8-bit registers that together hold a 32-bit component ID value. */ - -} TZC_T; - -/** - @addtogroup TZC_CONST TZC Bit Field Definition - Constant Definitions for TZC Controller -@{ */ - -#define TZC_BUILD_CONFIG_no_of_regions_Pos (0) /*!< TZC_T::BUILD_CONFIG: no_of_regions Position*/ -#define TZC_BUILD_CONFIG_no_of_regions_Msk (0x1ful << TZC_BUILD_CONFIG_no_of_regions_Pos) /*!< TZC_T::BUILD_CONFIG: no_of_regions Mask*/ - -#define TZC_BUILD_CONFIG_address_width_Pos (8) /*!< TZC_T::BUILD_CONFIG: address_width Position*/ -#define TZC_BUILD_CONFIG_address_width_Msk (0x3ful << TZC_BUILD_CONFIG_address_width_Pos) /*!< TZC_T::BUILD_CONFIG: address_width Mask*/ - -#define TZC_BUILD_CONFIG_no_of_filters_Pos (24) /*!< TZC_T::BUILD_CONFIG: no_of_filters Position*/ -#define TZC_BUILD_CONFIG_no_of_filters_Msk (0x3ul << TZC_BUILD_CONFIG_no_of_filters_Pos) /*!< TZC_T::BUILD_CONFIG: no_of_filters Mask*/ - -#define TZC_ACTION_reaction_value_Pos (0) /*!< TZC_T::ACTION: reaction_value Position*/ -#define TZC_ACTION_reaction_value_Msk (0x3ul << TZC_ACTION_reaction_value_Pos) /*!< TZC_T::ACTION: reaction_value Mask */ - -#define TZC_GATE_KEEPER_open_request_Pos (0) /*!< TZC_T::GATE_KEEPER: open_request Position*/ -#define TZC_GATE_KEEPER_open_request_Msk (0xful << TZC_GATE_KEEPER_open_request_Pos) /*!< TZC_T::GATE_KEEPER: open_request Mask */ - -#define TZC_GATE_KEEPER_open_status_Pos (16) /*!< TZC_T::GATE_KEEPER: open_status Position*/ -#define TZC_GATE_KEEPER_open_status_Msk (0xful << TZC_GATE_KEEPER_open_status_Pos) /*!< TZC_T::GATE_KEEPER: open_status Mask */ - -#define TZC_SPECULATION_CTRL_read_spec_disable_Pos (0) /*!< TZC_T::SPECULATION_CTRL: read_spec_disable Position*/ -#define TZC_SPECULATION_CTRL_read_spec_disable_Msk (0x1ul << TZC_SPECULATION_CTRL_read_spec_disable_Pos) /*!< TZC_T::SPECULATION_CTRL: read_spec_disable Mask*/ - -#define TZC_SPECULATION_CTRL_write_spec_disable_Pos (1) /*!< TZC_T::SPECULATION_CTRL: write_spec_disable Position*/ -#define TZC_SPECULATION_CTRL_write_spec_disable_Msk (0x1ul << TZC_SPECULATION_CTRL_write_spec_disable_Pos) /*!< TZC_T::SPECULATION_CTRL: write_spec_disable Mask*/ - -#define TZC_INT_STATUS_status_Pos (0) /*!< TZC_T::INT_STATUS: status Position */ -#define TZC_INT_STATUS_status_Msk (0xful << TZC_INT_STATUS_status_Pos) /*!< TZC_T::INT_STATUS: status Mask */ - -#define TZC_INT_STATUS_overrun_Pos (8) /*!< TZC_T::INT_STATUS: overrun Position */ -#define TZC_INT_STATUS_overrun_Msk (0xful << TZC_INT_STATUS_overrun_Pos) /*!< TZC_T::INT_STATUS: overrun Mask */ - -#define TZC_INT_STATUS_overlap_Pos (16) /*!< TZC_T::INT_STATUS: overlap Position */ -#define TZC_INT_STATUS_overlap_Msk (0xful << TZC_INT_STATUS_overlap_Pos) /*!< TZC_T::INT_STATUS: overlap Mask */ - -#define TZC_INT_CLEAR_clear_Pos (0) /*!< TZC_T::INT_CLEAR: clear Position */ -#define TZC_INT_CLEAR_clear_Msk (0xful << TZC_INT_CLEAR_clear_Pos) /*!< TZC_T::INT_CLEAR: clear Mask */ - -#define TZC_FAIL_ADDRESS_LOW_addr_status_low_Pos (0) /*!< TZC_T::FAIL_ADDRESS_LOW: addr_status_low Position*/ -#define TZC_FAIL_ADDRESS_LOW_addr_status_low_Msk (0xfffffffful << TZC_FAIL_ADDRESS_LOW_addr_status_low_Pos) /*!< TZC_T::FAIL_ADDRESS_LOW: addr_status_low Mask*/ - -#define TZC_FAIL_CONTROL_Privileged_Pos (20) /*!< TZC_T::FAIL_CONTROL: Privileged Position*/ -#define TZC_FAIL_CONTROL_Privileged_Msk (0x1ul << TZC_FAIL_CONTROL_Privileged_Pos) /*!< TZC_T::FAIL_CONTROL: Privileged Mask*/ - -#define TZC_FAIL_CONTROL_Non_secure_Pos (21) /*!< TZC_T::FAIL_CONTROL: Non_secure Position*/ -#define TZC_FAIL_CONTROL_Non_secure_Msk (0x1ul << TZC_FAIL_CONTROL_Non_secure_Pos) /*!< TZC_T::FAIL_CONTROL: Non_secure Mask*/ - -#define TZC_FAIL_CONTROL_Direction_Pos (24) /*!< TZC_T::FAIL_CONTROL: Direction Position*/ -#define TZC_FAIL_CONTROL_Direction_Msk (0x1ul << TZC_FAIL_CONTROL_Direction_Pos) /*!< TZC_T::FAIL_CONTROL: Direction Mask */ - -#define TZC_FAIL_ID_id_Pos (0) /*!< TZC_T::FAIL_ID: id Position */ -#define TZC_FAIL_ID_id_Msk (0x3ful << TZC_FAIL_ID_id_Pos) /*!< TZC_T::FAIL_ID: id Mask */ - -#define TZC_FAIL_ID_vnet_Pos (24) /*!< TZC_T::FAIL_ID: vnet Position */ -#define TZC_FAIL_ID_vnet_Msk (0xful << TZC_FAIL_ID_vnet_Pos) /*!< TZC_T::FAIL_ID: vnet Mask */ - -#define TZC_REGION_BASE_LOW_base_address_low_n_Pos (12) /*!< TZC_T::REGION_BASE_LOW: base_address_low_n_ Position*/ -#define TZC_REGION_BASE_LOW_base_address_low_n_Msk (0xffffful << TZC_REGION_BASE_LOW_base_address_low_n_Pos) /*!< TZC_T::REGION_BASE_LOW: base_address_low_n_ Mask*/ - -#define TZC_REGION_TOP_LOW_top_address_low_n_Pos (12) /*!< TZC_T::REGION_TOP_LOW: top_address_low_n_ Position*/ -#define TZC_REGION_TOP_LOW_top_address_low_n_Msk (0xffffful << TZC_REGION_TOP_LOW_top_address_low_n_Pos) /*!< TZC_T::REGION_TOP_LOW: top_address_low_n_ Mask*/ - -#define TZC_REGION_ATTRIBUTES_filter_en_Pos (0) /*!< TZC_T::REGION_ATTRIBUTES: filter_en Position*/ -#define TZC_REGION_ATTRIBUTES_filter_en_Msk (0xful << TZC_REGION_ATTRIBUTES_filter_en_Pos) /*!< TZC_T::REGION_ATTRIBUTES: filter_en Mask*/ - -#define TZC_REGION_ATTRIBUTES_s_rd_en_Pos (30) /*!< TZC_T::REGION_ATTRIBUTES: s_rd_en Position*/ -#define TZC_REGION_ATTRIBUTES_s_rd_en_Msk (0x1ul << TZC_REGION_ATTRIBUTES_s_rd_en_Pos) /*!< TZC_T::REGION_ATTRIBUTES: s_rd_en Mask*/ - -#define TZC_REGION_ATTRIBUTES_s_wr_en_Pos (31) /*!< TZC_T::REGION_ATTRIBUTES: s_wr_en Position*/ -#define TZC_REGION_ATTRIBUTES_s_wr_en_Msk (0x1ul << TZC_REGION_ATTRIBUTES_s_wr_en_Pos) /*!< TZC_T::REGION_ATTRIBUTES: s_wr_en Mask*/ - -#define TZC_REGION_ID_ACCESS_nsaid_rd_en_Pos (0) /*!< TZC_T::REGION_ID_ACCESS: nsaid_rd_en Position*/ -#define TZC_REGION_ID_ACCESS_nsaid_rd_en_Msk (0xfffful << TZC_REGION_ID_ACCESS_nsaid_rd_en_Pos) /*!< TZC_T::REGION_ID_ACCESS: nsaid_rd_en Mask*/ - -#define TZC_REGION_ID_ACCESS_nsaid_wr_en_Pos (16) /*!< TZC_T::REGION_ID_ACCESS: nsaid_wr_en Position*/ -#define TZC_REGION_ID_ACCESS_nsaid_wr_en_Msk (0xfffful << TZC_REGION_ID_ACCESS_nsaid_wr_en_Pos) /*!< TZC_T::REGION_ID_ACCESS: nsaid_wr_en Mask*/ - -#define TZC_PID4_jep106_c_code_Pos (0) /*!< TZC_T::PID4: jep106_c_code Position */ -#define TZC_PID4_jep106_c_code_Msk (0xful << TZC_PID4_jep106_c_code_Pos) /*!< TZC_T::PID4: jep106_c_code Mask */ - -#define TZC_PID4_4KB_count_Pos (4) /*!< TZC_T::PID4: 4KB_count Position */ -#define TZC_PID4_4KB_count_Msk (0xful << TZC_PID4_4KB_count_Pos) /*!< TZC_T::PID4: 4KB_count Mask */ - -#define TZC_PID0_part_number_0_Pos (0) /*!< TZC_T::PID0: part_number_0 Position */ -#define TZC_PID0_part_number_0_Msk (0xfful << TZC_PID0_part_number_0_Pos) /*!< TZC_T::PID0: part_number_0 Mask */ - -#define TZC_PID1_part_number_1_Pos (0) /*!< TZC_T::PID1: part_number_1 Position */ -#define TZC_PID1_part_number_1_Msk (0xful << TZC_PID1_part_number_1_Pos) /*!< TZC_T::PID1: part_number_1 Mask */ - -#define TZC_PID1_jep106_id_3_0_Pos (4) /*!< TZC_T::PID1: jep106_id_3_0 Position */ -#define TZC_PID1_jep106_id_3_0_Msk (0xful << TZC_PID1_jep106_id_3_0_Pos) /*!< TZC_T::PID1: jep106_id_3_0 Mask */ - -#define TZC_PID2_jep106_id_6_4_Pos (0) /*!< TZC_T::PID2: jep106_id_6_4 Position */ -#define TZC_PID2_jep106_id_6_4_Msk (0x7ul << TZC_PID2_jep106_id_6_4_Pos) /*!< TZC_T::PID2: jep106_id_6_4 Mask */ - -#define TZC_PID2_jedec_used_Pos (3) /*!< TZC_T::PID2: jedec_used Position */ -#define TZC_PID2_jedec_used_Msk (0x1ul << TZC_PID2_jedec_used_Pos) /*!< TZC_T::PID2: jedec_used Mask */ - -#define TZC_PID2_revision_Pos (4) /*!< TZC_T::PID2: revision Position */ -#define TZC_PID2_revision_Msk (0xful << TZC_PID2_revision_Pos) /*!< TZC_T::PID2: revision Mask */ - -#define TZC_PID3_mod_number_Pos (0) /*!< TZC_T::PID3: mod_number Position */ -#define TZC_PID3_mod_number_Msk (0xful << TZC_PID3_mod_number_Pos) /*!< TZC_T::PID3: mod_number Mask */ - -#define TZC_PID3_RevAnd_Pos (4) /*!< TZC_T::PID3: RevAnd Position */ -#define TZC_PID3_RevAnd_Msk (0xful << TZC_PID3_RevAnd_Pos) /*!< TZC_T::PID3: RevAnd Mask */ - -#define TZC_CID0_comp_id_0_Pos (0) /*!< TZC_T::CID0: comp_id_0 Position */ -#define TZC_CID0_comp_id_0_Msk (0xfful << TZC_CID0_comp_id_0_Pos) /*!< TZC_T::CID0: comp_id_0 Mask */ - -#define TZC_CID1_comp_id_0_Pos (0) /*!< TZC_T::CID1: comp_id_0 Position */ -#define TZC_CID1_comp_id_0_Msk (0xfful << TZC_CID1_comp_id_0_Pos) /*!< TZC_T::CID1: comp_id_0 Mask */ - -#define TZC_CID2_comp_id_2_Pos (0) /*!< TZC_T::CID2: comp_id_2 Position */ -#define TZC_CID2_comp_id_2_Msk (0xfful << TZC_CID2_comp_id_2_Pos) /*!< TZC_T::CID2: comp_id_2 Mask */ - -#define TZC_CID3_comp_id_3_Pos (0) /*!< TZC_T::CID3: comp_id_3 Position */ -#define TZC_CID3_comp_id_3_Msk (0xfful << TZC_CID3_comp_id_3_Pos) /*!< TZC_T::CID3: comp_id_3 Mask */ - -/**@}*/ /* TZC_CONST */ -/**@}*/ /* end of TZC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SSMCC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sspcc_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sspcc_reg.h deleted file mode 100644 index 5e466df0227..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sspcc_reg.h +++ /dev/null @@ -1,2625 +0,0 @@ -/**************************************************************************//** - * @file sspcc_reg.h - * @brief SSPCC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SSPCC_REG_H__ -#define __SSPCC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - - -/******************************************************************************/ -/* Device Specific Peripheral registers structures */ -/******************************************************************************/ - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - -/*---------------------- System Security Peripheral Configuration Controller -------------------------*/ -/** - @addtogroup SSPCC System Security Peripheral Configuration Controller(SSPCC) - Memory Mapped Structure for SSPCC Controller -@{ */ - -typedef struct -{ - - - /** - * @var SSPCC_T::PSSET0 - * Offset: 0x00 Peripheral Security Attribution Set Register 0 (0x4000_0000~0x400F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[17:16] |PDMA0 |PDMA0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[19:18] |PDMA1 |PDMA1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[21:20] |PDMA2 |PDMA2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PDMA3 |PDMA3 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::PSSET1 - * Offset: 0x04 Peripheral Security Attribution Set Register 1 (0x4010_0000~0x401F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |EBI |EBI Controller Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |SDH0 |SD Host 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[19:18] |SDH1 |SD Host 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[21:20] |NANDC |NAND Controller Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * @var SSPCC_T::PSSET2 - * Offset: 0x08 Peripheral Security Attribution Set Register 2 (0x4020_0000~0x402F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |HSUSBD |HS USB Device Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * @var SSPCC_T::PSSET3 - * Offset: 0x0C Peripheral Security Attribution Set Register 3 (0x4030_0000~0x403F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CRYPTO |Crypto Accelerator Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[25:24] |CANFD0 |CANFD0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |CANFD1 |CANFD1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |CANFD2 |CANFD2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |CANFD3 |CANFD3 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::PSSET4 - * Offset: 0x10 Peripheral Security Attribution Set Register 4 (0x4040_0000~0x404F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:4] |ADC0 |ADC 0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |EADC0 |EADC 0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |WDTWWDT1 |WDTWWDT1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[17:16] |I2S0 |I2S 0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |I2S1 |I2S 1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |KPI |KPI Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |DDRPHYPUB |DDR PHY Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[27:26] |MCTL |DRAM Controller Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * @var SSPCC_T::PSSET5 - * Offset: 0x14 Peripheral Security Attribution Set Register 5 (0x4050_0000~0x405F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TMR01 |TMR01 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[3:2] |TMR23 |TMR23 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |TMR45 |TMR45 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |TMR67 |TMR67 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |TMR89 |TMR89 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |TMR1011 |TMR1011 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |EPWM0 |EPWM 0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |EPWM1 |EPWM 1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |EPWM2 |EPWM 2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::PSSET6 - * Offset: 0x18 Peripheral Security Attribution Set Register 6 (0x4060_0000~0x406F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SPI0 |SPI0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |SPI1 |SPI1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |SPI2 |SPI2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |SPI3 |SPI3 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |QSPI0 |QSPI0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[19:18] |QSPI1 |QSPI1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::PSSET7 - * Offset: 0x1C Peripheral Security Attribution Set Register 7 (0x4070_0000~0x407F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |UART0 |UART0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[3:2] |UART1 |UART1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |UART2 |UART2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |UART3 |UART3 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |UART4 |UART4 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |UART5 |UART5 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |UART6 |UART6 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |UART7 |UART7 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |UART8 |UART8 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |UART9 |UART9 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |UART10 |UART10 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |UART11 |UART11 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |UART12 |UART12 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |UART13 |UART13 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |UART14 |UART14 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |UART15 |UART15 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::PSSET8 - * Offset: 0x20 Peripheral Security Attribution Set Register 8 (0x4080_0000~0x408F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |I2C0 |I2C0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * |[3:2] |I2C1 |I2C1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |I2C2 |I2C2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |I2C3 |I2C3 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |I2C4 |I2C4 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |I2C5 |I2C5 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |UART16 |UART16 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::PSSET9 - * Offset: 0x24 Peripheral Security Attribution Set Register 9 (0x4090_0000~0x409F_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SC0 |SC0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |SC1 |SC1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::PSSET10 - * Offset: 0x28 Peripheral Security Attribution Set Register 10 (0x40A0_0000~0x40AF_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * @var SSPCC_T::PSSET11 - * Offset: 0x2C Peripheral Security Attribution Set Register 11 (0x40B0_0000~0x40BF_FFFF) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |QEI0 |QEI0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |QEI1 |QEI1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |QEI2 |QEI2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |ECAP0 |ECAP0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |ECAP1 |ECAP1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |ECAP2 |ECAP2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |TRNG |TRNG Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Reserved. - * @var SSPCC_T::SRAMSB - * Offset: 0x40 SRAM Security Boundary Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |SR0BOUND |Set SRAM0 Security Boundary - * | | |Set the 16 Kbytes-aligned boundary of SRAM0. - * | | |The SRAM part below the boundary is SubM region and the part higher the boundary is ShareMemory region. - * | | |When the boundary is set to higher than the size of SRAM, the whole SRAM is SubM region. - * |[12:8] |SR1BOUND |Set SRAM1 Security Boundary - * | | |Set the 16 Kbytes-aligned boundary of data SRAM. - * | | |The SRAM part below the boundary is TZS region and the part higher the boundary is TZNS region. - * | | |When the boundary is set to higher than the size of SRAM, the whole SRAM is TZS region. - * @var SSPCC_T::EBISSET - * Offset: 0x50 EBI Memory Security Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |BANK0 |EBI Memory Bank0 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |BANK1 |EBI Memory Bank1 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |BANK2 |EBI Memory Bank2 Security Attribution Bits - * | | |00 = Reserved. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOASSET - * Offset: 0x60 GPIO Port A Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOBSSET - * Offset: 0x64 GPIO Port B Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOCSSET - * Offset: 0x68 GPIO Port C Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IODSSET - * Offset: 0x6C GPIO Port D Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOESSET - * Offset: 0x70 GPIO Port E Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOFSSET - * Offset: 0x74 GPIO Port F Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOGSSET - * Offset: 0x78 GPIO Port G Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOHSSET - * Offset: 0x7C GPIO Port H Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOISSET - * Offset: 0x80 GPIO Port I Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOJSSET - * Offset: 0x84 GPIO Port J Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOKSSET - * Offset: 0x88 GPIO Port K Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOLSSET - * Offset: 0x8C GPIO Port L Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IOMSSET - * Offset: 0x90 GPIO Port M Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::IONSSET - * Offset: 0x94 GPIO Port N Security Attribution Set Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |PIN0 |GPIO Pin 0 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[3:2] |PIN1 |GPIO Pin 1 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[5:4] |PIN2 |GPIO Pin 2 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[7:6] |PIN3 |GPIO Pin 3 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[9:8] |PIN4 |GPIO Pin 4 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[11:10] |PIN5 |GPIO Pin 5 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[13:12] |PIN6 |GPIO Pin 6 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[15:14] |PIN7 |GPIO Pin 7 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[17:16] |PIN8 |GPIO Pin 8 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[19:18] |PIN9 |GPIO Pin 9 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[21:20] |PIN10 |GPIO Pin 10 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[23:22] |PIN11 |GPIO Pin 11 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[25:24] |PIN12 |GPIO Pin 12 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[27:26] |PIN13 |GPIO Pin 13 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[29:28] |PIN14 |GPIO Pin 14 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * |[31:30] |PIN15 |GPIO Pin 15 Security Attribution Bits - * | | |00 = Set to TZS. - * | | |01 = Set to TZNS. - * | | |10 = Reserved. - * | | |11 = Set to SubM. - * @var SSPCC_T::SVIEN - * Offset: 0xF0 Security Violation Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APB0 |APB0 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of APB0 Disabled. - * | | |1 = Interrupt triggered from security violation of APB0 Enabled. - * |[1] |APB3 |APB3 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of APB3 Disabled. - * | | |1 = Interrupt triggered from security violation of APB3 Enabled. - * |[2] |SRAM1 |SRAM1 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of SRAM1 Disabled. - * | | |1 = Interrupt triggered from security violation of SRAM1 Enabled. - * |[3] |SDH0 |SD Host0 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of SD host 0 Disabled. - * | | |1 = Interrupt triggered from security violation of SD host 0 Enabled. - * |[4] |SDH1 |SD Host1 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of SD host 1 Disabled. - * | | |1 = Interrupt triggered from security violation of SD host 1 Enabled. - * |[5] |HSUSBD |HighSpeed USB Device Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of HighSpeed USB Device Disabled. - * | | |1 = Interrupt triggered from security violation of HighSpeed USB Device Enabled. - * |[6] |NANDC |NAND Controller Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of NAND Controller Disabled. - * | | |1 = Interrupt triggered from security violation of NAND Controller Enabled. - * |[7] |PDMA0 |PDMA0 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of PDMA0 Disabled. - * | | |1 = Interrupt triggered from security violation of PDMA0 Enabled. - * |[8] |PDMA1 |PDMA1 Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of PDMA1 Disabled. - * | | |1 = Interrupt triggered from security violation of PDMA1 Enabled. - * |[9] |TRNG |TRNG Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of TRNG Disabled. - * | | |1 = Interrupt triggered from security violation of TRNG Enabled. - * |[10] |CRYPTO |CRYPTO Security Violation Interrupt Enable Bit - * | | |0 = Interrupt triggered from security violation of CRYPTO Disabled. - * | | |1 = Interrupt triggered from security violation of CRYPTO Enabled. - * @var SSPCC_T::SVINTSTS - * Offset: 0xF4 Security Violation Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |APB0 |APB0 Security Violation Interrupt Status - * | | |0 = No APB0 violation interrupt event. - * | | |1 = There is APB0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[1] |APB3 |APB3 Security Violation Interrupt Status - * | | |0 = No APB3 violation interrupt event. - * | | |1 = There is APB3 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[2] |SRAM1 |SRAM1 Security Violation Interrupt Status - * | | |0 = No SRAM1 violation interrupt event. - * | | |1 = There is SRAM1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[3] |SDH0 |SDH0 Security Violation Interrupt Status - * | | |0 = No SDH0 violation interrupt event. - * | | |1 = There is SDH0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[4] |SDH1 |SDH1 Security Violation Interrupt Status - * | | |0 = No SDH1 violation interrupt event. - * | | |1 = There is SDH1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[5] |HSUSBD |High-speed USB Device Security Violation Interrupt Status - * | | |0 = No High-speed USB Device violation interrupt event. - * | | |1 = There is High-speed USB Device violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[6] |NANDC |NAND Controller Security Violation Interrupt Status - * | | |0 = No NAND Controller violation interrupt event. - * | | |1 = There is NAND Controller violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[7] |PDMA0 |PDMA0 Security Violation Interrupt Status - * | | |0 = No PDMA0 violation interrupt event. - * | | |1 = There is PDMA0 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[8] |PDMA1 |PDMA1 Security Violation Interrupt Status - * | | |0 = No PDMA1 violation interrupt event. - * | | |1 = There is PDMA1 violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[9] |TRNG |TRNG Security Violation Interrupt Status - * | | |0 = No TRNG violation interrupt event. - * | | |1 = There is TRNG violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * |[10] |CRYPTO |CRYPTO Security Violation Interrupt Status - * | | |0 = No CRYPTO violation interrupt event. - * | | |1 = There is CRYPTO violation interrupt event. - * | | |Note: Write 1 to clear the interrupt flag. - * @var SSPCC_T::APB0VSRC - * Offset: 0x100 APB0 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::APB3VSRC - * Offset: 0x104 APB3 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::SRAM1VSRC - * Offset: 0x108 SRAM1 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::SDH0VSRC - * Offset: 0x10C SDH0 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::SDH1VSRC - * Offset: 0x110 SDH1 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::HSUSBDVSRC - * Offset: 0x114 HSUSBD Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::NANDCVSRC - * Offset: 0x118 NANDC Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::PDMA0VSRC - * Offset: 0x11C PDMA0 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::PDMA1VSRC - * Offset: 0x120 PDMA1 Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::TRNGVSRC - * Offset: 0x124 TRNG Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::CRYPTOVSRC - * Offset: 0x128 CRYPTO Security Policy Violation Source - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |MASTER |Master Violating Security Policy - * | | |Indicate which master invokes the security violation. - * | | |0x0 = CA35. - * | | |0x1 = CoreSight AP. - * | | |0x3 = Crypto Engine - * | | |0x2 = CM4. - * | | |0x4 = PDMA0. - * | | |0x5 = PDMA1. - * | | |0x6 = PDMA2. - * | | |0x7 = PDMA3. - * | | |0x8 = SDH0. - * | | |0x9 = SDH1. - * | | |0xA = USBH2. - * | | |0xB = USBH0/HSUSBH0. - * | | |0xC = USBH1/HSUSBH1. - * | | |0xD = HSUSBD. - * | | |0xE = NAND. - * | | |Others is undefined. - * @var SSPCC_T::APB0VA - * Offset: 0x180 APB0 Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::APB3VA - * Offset: 0x184 APB3 Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::SRAM1VA - * Offset: 0x188 SRAM1 Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::SDH0VA - * Offset: 0x18C SDH0 Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::SDH1VA - * Offset: 0x190 SDH1 Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::HSUSBDVA - * Offset: 0x194 HSUSBD Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::NANDCVA - * Offset: 0x198 NANDC Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::PDMA0VA - * Offset: 0x19C PDMA0 Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::PDMA1VA - * Offset: 0x1A0 PDMA1 Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::TRNGVA - * Offset: 0x1A4 TRNG Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::CRYPTOVA - * Offset: 0x1A8 CRYPTO Security Policy Violation Address - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |VIOADDR |Violation Address - * | | |Indicate the target address of the access, which invokes the security violation. - * @var SSPCC_T::SINFAEN - * Offset: 0x200 Shared Information Access Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SSPCCSIAEN|SSPCC Shared Information Access Enable Bit - * | | |0 = SSPCC shared information Disabled. - * | | |1 = SSPCC shared information Enabled. - * |[1] |SYSSIAEN |SYS Shared Information Access Enable Bit - * | | |0 = SYS shared information Disabled. - * | | |1 = SYS shared information Enabled. - * | | |Note: Include clock information. - * |[2] |RTCSIAEN |RTC Shared Information Access Enable Bit - * | | |0 = RTC shared information Disabled. - * | | |1 = RTC shared information Enabled. - * |[6] |OTPSIAEN |OTP Controller Shared Information Access Enable Bit - * | | |0 = OTP controller shared information Disabled. - * | | |1 = OTP controller shared information Enabled. - * |[7] |KSSIAEN |Key Store Shared Information Access Enable Bit - * | | |0 = Key Store shared information Disabled. - * | | |1 = Key Store shared information Enabled. - * @var SSPCC_T::SCWP - * Offset: 0x204 Security Configuration Write Protection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ENABLE |Write Protection Enable Bit - * | | |0 = Write Protection Disabled. - * | | |1 = Write Protection Enabled. - * |[1] |LOCK |Enable Write Protection Lock Bit (Write Once) - * | | |0 = Write protection lock Disabled. - * | | |1 = Write protection Enabled and locked. - * | | |Note: This bit cannot be cleared to 0 after set to 1. - * |[31:16] |WVCODE |Write Verify Code - * | | |Read operation: - * | | |Reserved, all zeros. - * | | |Write operation: - * | | |0x475A = The write verify code, 0x475A, is needed to do a valid write to SSPCC_SCWP. - * | | |Others = Invalid write verify code. - */ - __IO uint32_t PSSET0; /*!< [0x0000] Peripheral Security Attribution Set Register 0 (0x4000_0000~0x400F_FFFF) */ - __IO uint32_t PSSET1; /*!< [0x0004] Peripheral Security Attribution Set Register 1 (0x4010_0000~0x401F_FFFF) */ - __IO uint32_t PSSET2; /*!< [0x0008] Peripheral Security Attribution Set Register 2 (0x4020_0000~0x402F_FFFF) */ - __IO uint32_t PSSET3; /*!< [0x000c] Peripheral Security Attribution Set Register 3 (0x4030_0000~0x403F_FFFF) */ - __IO uint32_t PSSET4; /*!< [0x0010] Peripheral Security Attribution Set Register 4 (0x4040_0000~0x404F_FFFF) */ - __IO uint32_t PSSET5; /*!< [0x0014] Peripheral Security Attribution Set Register 5 (0x4050_0000~0x405F_FFFF) */ - __IO uint32_t PSSET6; /*!< [0x0018] Peripheral Security Attribution Set Register 6 (0x4060_0000~0x406F_FFFF) */ - __IO uint32_t PSSET7; /*!< [0x001c] Peripheral Security Attribution Set Register 7 (0x4070_0000~0x407F_FFFF) */ - __IO uint32_t PSSET8; /*!< [0x0020] Peripheral Security Attribution Set Register 8 (0x4080_0000~0x408F_FFFF) */ - __IO uint32_t PSSET9; /*!< [0x0024] Peripheral Security Attribution Set Register 9 (0x4090_0000~0x409F_FFFF) */ - __IO uint32_t PSSET10; /*!< [0x0028] Peripheral Security Attribution Set Register 10 (0x40A0_0000~0x40AF_FFFF) */ - __IO uint32_t PSSET11; /*!< [0x002c] Peripheral Security Attribution Set Register 11 (0x40B0_0000~0x40BF_FFFF) */ - __I uint32_t RESERVE0[4]; - __IO uint32_t SRAMSB; /*!< [0x0040] SRAM Security Boundary Set Register */ - __I uint32_t RESERVE1[3]; - __IO uint32_t EBISSET; /*!< [0x0050] EBI Memory Security Set Register */ - __I uint32_t RESERVE2[3]; - __IO uint32_t IOASSET; /*!< [0x0060] GPIO Port A Security Attribution Set Register */ - __IO uint32_t IOBSSET; /*!< [0x0064] GPIO Port B Security Attribution Set Register */ - __IO uint32_t IOCSSET; /*!< [0x0068] GPIO Port C Security Attribution Set Register */ - __IO uint32_t IODSSET; /*!< [0x006c] GPIO Port D Security Attribution Set Register */ - __IO uint32_t IOESSET; /*!< [0x0070] GPIO Port E Security Attribution Set Register */ - __IO uint32_t IOFSSET; /*!< [0x0074] GPIO Port F Security Attribution Set Register */ - __IO uint32_t IOGSSET; /*!< [0x0078] GPIO Port G Security Attribution Set Register */ - __IO uint32_t IOHSSET; /*!< [0x007c] GPIO Port H Security Attribution Set Register */ - __IO uint32_t IOISSET; /*!< [0x0080] GPIO Port I Security Attribution Set Register */ - __IO uint32_t IOJSSET; /*!< [0x0084] GPIO Port J Security Attribution Set Register */ - __IO uint32_t IOKSSET; /*!< [0x0088] GPIO Port K Security Attribution Set Register */ - __IO uint32_t IOLSSET; /*!< [0x008c] GPIO Port L Security Attribution Set Register */ - __IO uint32_t IOMSSET; /*!< [0x0090] GPIO Port M Security Attribution Set Register */ - __IO uint32_t IONSSET; /*!< [0x0094] GPIO Port N Security Attribution Set Register */ - __I uint32_t RESERVE3[22]; - __IO uint32_t SVIEN; /*!< [0x00f0] Security Violation Interrupt Enable Register */ - __IO uint32_t SVINTSTS; /*!< [0x00f4] Security Violation Interrupt Status Register */ - __I uint32_t RESERVE4[2]; - __I uint32_t APB0VSRC; /*!< [0x0100] APB0 Security Policy Violation Source */ - __I uint32_t APB3VSRC; /*!< [0x0104] APB3 Security Policy Violation Source */ - __I uint32_t SRAM1VSRC; /*!< [0x0108] SRAM1 Security Policy Violation Source */ - __I uint32_t SDH0VSRC; /*!< [0x010c] SDH0 Security Policy Violation Source */ - __I uint32_t SDH1VSRC; /*!< [0x0110] SDH1 Security Policy Violation Source */ - __I uint32_t HSUSBDVSRC; /*!< [0x0114] HSUSBD Security Policy Violation Source */ - __I uint32_t NANDCVSRC; /*!< [0x0118] NANDC Security Policy Violation Source */ - __I uint32_t PDMA0VSRC; /*!< [0x011c] PDMA0 Security Policy Violation Source */ - __I uint32_t PDMA1VSRC; /*!< [0x0120] PDMA1 Security Policy Violation Source */ - __I uint32_t TRNGVSRC; /*!< [0x0124] TRNG Security Policy Violation Source */ - __I uint32_t CRYPTOVSRC; /*!< [0x0128] CRYPTO Security Policy Violation Source */ - __I uint32_t RESERVE5[21]; - __I uint32_t APB0VA; /*!< [0x0180] APB0 Security Policy Violation Address */ - __I uint32_t APB3VA; /*!< [0x0184] APB3 Security Policy Violation Address */ - __I uint32_t SRAM1VA; /*!< [0x0188] SRAM1 Security Policy Violation Address */ - __I uint32_t SDH0VA; /*!< [0x018c] SDH0 Security Policy Violation Address */ - __I uint32_t SDH1VA; /*!< [0x0190] SDH1 Security Policy Violation Address */ - __I uint32_t HSUSBDVA; /*!< [0x0194] HSUSBD Security Policy Violation Address */ - __I uint32_t NANDCVA; /*!< [0x0198] NANDC Security Policy Violation Address */ - __I uint32_t PDMA0VA; /*!< [0x019c] PDMA0 Security Policy Violation Address */ - __I uint32_t PDMA1VA; /*!< [0x01a0] PDMA1 Security Policy Violation Address */ - __I uint32_t TRNGVA; /*!< [0x01a4] TRNG Security Policy Violation Address */ - __I uint32_t CRYPTOVA; /*!< [0x01a8] CRYPTO Security Policy Violation Address */ - __I uint32_t RESERVE6[21]; - __IO uint32_t SINFAEN; /*!< [0x0200] Shared Information Access Enable Register */ - __IO uint32_t SCWP; /*!< [0x0204] Security Configuration Write Protection Register */ - -} SSPCC_T; - -/** - @addtogroup SSPCC_CONST SSPCC Bit Field Definition - Constant Definitions for SSPCC Controller -@{ */ - -#define SSPCC_PSSET0_PDMA0_Pos (16) /*!< SSPCC_T::PSSET0: PDMA0 Position */ -#define SSPCC_PSSET0_PDMA0_Msk (0x3ul << SSPCC_PSSET0_PDMA0_Pos) /*!< SSPCC_T::PSSET0: PDMA0 Mask */ - -#define SSPCC_PSSET0_PDMA1_Pos (18) /*!< SSPCC_T::PSSET0: PDMA1 Position */ -#define SSPCC_PSSET0_PDMA1_Msk (0x3ul << SSPCC_PSSET0_PDMA1_Pos) /*!< SSPCC_T::PSSET0: PDMA1 Mask */ - -#define SSPCC_PSSET0_PDMA2_Pos (20) /*!< SSPCC_T::PSSET0: PDMA2 Position */ -#define SSPCC_PSSET0_PDMA2_Msk (0x3ul << SSPCC_PSSET0_PDMA2_Pos) /*!< SSPCC_T::PSSET0: PDMA2 Mask */ - -#define SSPCC_PSSET0_PDMA3_Pos (22) /*!< SSPCC_T::PSSET0: PDMA3 Position */ -#define SSPCC_PSSET0_PDMA3_Msk (0x3ul << SSPCC_PSSET0_PDMA3_Pos) /*!< SSPCC_T::PSSET0: PDMA3 Mask */ - -#define SSPCC_PSSET1_EBI_Pos (0) /*!< SSPCC_T::PSSET1: EBI Position */ -#define SSPCC_PSSET1_EBI_Msk (0x3ul << SSPCC_PSSET1_EBI_Pos) /*!< SSPCC_T::PSSET1: EBI Mask */ - -#define SSPCC_PSSET1_SDH0_Pos (16) /*!< SSPCC_T::PSSET1: SDH0 Position */ -#define SSPCC_PSSET1_SDH0_Msk (0x3ul << SSPCC_PSSET1_SDH0_Pos) /*!< SSPCC_T::PSSET1: SDH0 Mask */ - -#define SSPCC_PSSET1_SDH1_Pos (18) /*!< SSPCC_T::PSSET1: SDH1 Position */ -#define SSPCC_PSSET1_SDH1_Msk (0x3ul << SSPCC_PSSET1_SDH1_Pos) /*!< SSPCC_T::PSSET1: SDH1 Mask */ - -#define SSPCC_PSSET1_NANDC_Pos (20) /*!< SSPCC_T::PSSET1: NANDC Position */ -#define SSPCC_PSSET1_NANDC_Msk (0x3ul << SSPCC_PSSET1_NANDC_Pos) /*!< SSPCC_T::PSSET1: NANDC Mask */ - -#define SSPCC_PSSET2_HSUSBD_Pos (0) /*!< SSPCC_T::PSSET2: HSUSBD Position */ -#define SSPCC_PSSET2_HSUSBD_Msk (0x3ul << SSPCC_PSSET2_HSUSBD_Pos) /*!< SSPCC_T::PSSET2: HSUSBD Mask */ - -#define SSPCC_PSSET3_CRYPTO_Pos (0) /*!< SSPCC_T::PSSET3: CRYPTO Position */ -#define SSPCC_PSSET3_CRYPTO_Msk (0x3ul << SSPCC_PSSET3_CRYPTO_Pos) /*!< SSPCC_T::PSSET3: CRYPTO Mask */ - -#define SSPCC_PSSET3_CANFD0_Pos (24) /*!< SSPCC_T::PSSET3: CANFD0 Position */ -#define SSPCC_PSSET3_CANFD0_Msk (0x3ul << SSPCC_PSSET3_CANFD0_Pos) /*!< SSPCC_T::PSSET3: CANFD0 Mask */ - -#define SSPCC_PSSET3_CANFD1_Pos (26) /*!< SSPCC_T::PSSET3: CANFD1 Position */ -#define SSPCC_PSSET3_CANFD1_Msk (0x3ul << SSPCC_PSSET3_CANFD1_Pos) /*!< SSPCC_T::PSSET3: CANFD1 Mask */ - -#define SSPCC_PSSET3_CANFD2_Pos (28) /*!< SSPCC_T::PSSET3: CANFD2 Position */ -#define SSPCC_PSSET3_CANFD2_Msk (0x3ul << SSPCC_PSSET3_CANFD2_Pos) /*!< SSPCC_T::PSSET3: CANFD2 Mask */ - -#define SSPCC_PSSET3_CANFD3_Pos (30) /*!< SSPCC_T::PSSET3: CANFD3 Position */ -#define SSPCC_PSSET3_CANFD3_Msk (0x3ul << SSPCC_PSSET3_CANFD3_Pos) /*!< SSPCC_T::PSSET3: CANFD3 Mask */ - -#define SSPCC_PSSET4_ADC0_Pos (4) /*!< SSPCC_T::PSSET4: ADC0 Position */ -#define SSPCC_PSSET4_ADC0_Msk (0x3ul << SSPCC_PSSET4_ADC0_Pos) /*!< SSPCC_T::PSSET4: ADC0 Mask */ - -#define SSPCC_PSSET4_EADC0_Pos (6) /*!< SSPCC_T::PSSET4: EADC0 Position */ -#define SSPCC_PSSET4_EADC0_Msk (0x3ul << SSPCC_PSSET4_EADC0_Pos) /*!< SSPCC_T::PSSET4: EADC0 Mask */ - -#define SSPCC_PSSET4_WDTWWDT1_Pos (8) /*!< SSPCC_T::PSSET4: WDTWWDT1 Position */ -#define SSPCC_PSSET4_WDTWWDT1_Msk (0x3ul << SSPCC_PSSET4_WDTWWDT1_Pos) /*!< SSPCC_T::PSSET4: WDTWWDT1 Mask */ - -#define SSPCC_PSSET4_I2S0_Pos (16) /*!< SSPCC_T::PSSET4: I2S0 Position */ -#define SSPCC_PSSET4_I2S0_Msk (0x3ul << SSPCC_PSSET4_I2S0_Pos) /*!< SSPCC_T::PSSET4: I2S0 Mask */ - -#define SSPCC_PSSET4_I2S1_Pos (18) /*!< SSPCC_T::PSSET4: I2S1 Position */ -#define SSPCC_PSSET4_I2S1_Msk (0x3ul << SSPCC_PSSET4_I2S1_Pos) /*!< SSPCC_T::PSSET4: I2S1 Mask */ - -#define SSPCC_PSSET4_KPI_Pos (20) /*!< SSPCC_T::PSSET4: KPI Position */ -#define SSPCC_PSSET4_KPI_Msk (0x3ul << SSPCC_PSSET4_KPI_Pos) /*!< SSPCC_T::PSSET4: KPI Mask */ - -#define SSPCC_PSSET4_DDRPHYPUB_Pos (24) /*!< SSPCC_T::PSSET4: DDRPHYPUB Position */ -#define SSPCC_PSSET4_DDRPHYPUB_Msk (0x3ul << SSPCC_PSSET4_DDRPHYPUB_Pos) /*!< SSPCC_T::PSSET4: DDRPHYPUB Mask */ - -#define SSPCC_PSSET4_MCTL_Pos (26) /*!< SSPCC_T::PSSET4: MCTL Position */ -#define SSPCC_PSSET4_MCTL_Msk (0x3ul << SSPCC_PSSET4_MCTL_Pos) /*!< SSPCC_T::PSSET4: MCTL Mask */ - -#define SSPCC_PSSET5_TMR01_Pos (0) /*!< SSPCC_T::PSSET5: TMR01 Position */ -#define SSPCC_PSSET5_TMR01_Msk (0x3ul << SSPCC_PSSET5_TMR01_Pos) /*!< SSPCC_T::PSSET5: TMR01 Mask */ - -#define SSPCC_PSSET5_TMR23_Pos (2) /*!< SSPCC_T::PSSET5: TMR23 Position */ -#define SSPCC_PSSET5_TMR23_Msk (0x3ul << SSPCC_PSSET5_TMR23_Pos) /*!< SSPCC_T::PSSET5: TMR23 Mask */ - -#define SSPCC_PSSET5_TMR45_Pos (4) /*!< SSPCC_T::PSSET5: TMR45 Position */ -#define SSPCC_PSSET5_TMR45_Msk (0x3ul << SSPCC_PSSET5_TMR45_Pos) /*!< SSPCC_T::PSSET5: TMR45 Mask */ - -#define SSPCC_PSSET5_TMR67_Pos (6) /*!< SSPCC_T::PSSET5: TMR67 Position */ -#define SSPCC_PSSET5_TMR67_Msk (0x3ul << SSPCC_PSSET5_TMR67_Pos) /*!< SSPCC_T::PSSET5: TMR67 Mask */ - -#define SSPCC_PSSET5_TMR89_Pos (8) /*!< SSPCC_T::PSSET5: TMR89 Position */ -#define SSPCC_PSSET5_TMR89_Msk (0x3ul << SSPCC_PSSET5_TMR89_Pos) /*!< SSPCC_T::PSSET5: TMR89 Mask */ - -#define SSPCC_PSSET5_TMR1011_Pos (10) /*!< SSPCC_T::PSSET5: TMR1011 Position */ -#define SSPCC_PSSET5_TMR1011_Msk (0x3ul << SSPCC_PSSET5_TMR1011_Pos) /*!< SSPCC_T::PSSET5: TMR1011 Mask */ - -#define SSPCC_PSSET5_EPWM0_Pos (16) /*!< SSPCC_T::PSSET5: EPWM0 Position */ -#define SSPCC_PSSET5_EPWM0_Msk (0x3ul << SSPCC_PSSET5_EPWM0_Pos) /*!< SSPCC_T::PSSET5: EPWM0 Mask */ - -#define SSPCC_PSSET5_EPWM1_Pos (18) /*!< SSPCC_T::PSSET5: EPWM1 Position */ -#define SSPCC_PSSET5_EPWM1_Msk (0x3ul << SSPCC_PSSET5_EPWM1_Pos) /*!< SSPCC_T::PSSET5: EPWM1 Mask */ - -#define SSPCC_PSSET5_EPWM2_Pos (20) /*!< SSPCC_T::PSSET5: EPWM2 Position */ -#define SSPCC_PSSET5_EPWM2_Msk (0x3ul << SSPCC_PSSET5_EPWM2_Pos) /*!< SSPCC_T::PSSET5: EPWM2 Mask */ - -#define SSPCC_PSSET6_SPI0_Pos (0) /*!< SSPCC_T::PSSET6: SPI0 Position */ -#define SSPCC_PSSET6_SPI0_Msk (0x3ul << SSPCC_PSSET6_SPI0_Pos) /*!< SSPCC_T::PSSET6: SPI0 Mask */ - -#define SSPCC_PSSET6_SPI1_Pos (2) /*!< SSPCC_T::PSSET6: SPI1 Position */ -#define SSPCC_PSSET6_SPI1_Msk (0x3ul << SSPCC_PSSET6_SPI1_Pos) /*!< SSPCC_T::PSSET6: SPI1 Mask */ - -#define SSPCC_PSSET6_SPI2_Pos (4) /*!< SSPCC_T::PSSET6: SPI2 Position */ -#define SSPCC_PSSET6_SPI2_Msk (0x3ul << SSPCC_PSSET6_SPI2_Pos) /*!< SSPCC_T::PSSET6: SPI2 Mask */ - -#define SSPCC_PSSET6_SPI3_Pos (6) /*!< SSPCC_T::PSSET6: SPI3 Position */ -#define SSPCC_PSSET6_SPI3_Msk (0x3ul << SSPCC_PSSET6_SPI3_Pos) /*!< SSPCC_T::PSSET6: SPI3 Mask */ - -#define SSPCC_PSSET6_QSPI0_Pos (16) /*!< SSPCC_T::PSSET6: QSPI0 Position */ -#define SSPCC_PSSET6_QSPI0_Msk (0x3ul << SSPCC_PSSET6_QSPI0_Pos) /*!< SSPCC_T::PSSET6: QSPI0 Mask */ - -#define SSPCC_PSSET6_QSPI1_Pos (18) /*!< SSPCC_T::PSSET6: QSPI1 Position */ -#define SSPCC_PSSET6_QSPI1_Msk (0x3ul << SSPCC_PSSET6_QSPI1_Pos) /*!< SSPCC_T::PSSET6: QSPI1 Mask */ - -#define SSPCC_PSSET7_UART0_Pos (0) /*!< SSPCC_T::PSSET7: UART0 Position */ -#define SSPCC_PSSET7_UART0_Msk (0x3ul << SSPCC_PSSET7_UART0_Pos) /*!< SSPCC_T::PSSET7: UART0 Mask */ - -#define SSPCC_PSSET7_UART1_Pos (2) /*!< SSPCC_T::PSSET7: UART1 Position */ -#define SSPCC_PSSET7_UART1_Msk (0x3ul << SSPCC_PSSET7_UART1_Pos) /*!< SSPCC_T::PSSET7: UART1 Mask */ - -#define SSPCC_PSSET7_UART2_Pos (4) /*!< SSPCC_T::PSSET7: UART2 Position */ -#define SSPCC_PSSET7_UART2_Msk (0x3ul << SSPCC_PSSET7_UART2_Pos) /*!< SSPCC_T::PSSET7: UART2 Mask */ - -#define SSPCC_PSSET7_UART3_Pos (6) /*!< SSPCC_T::PSSET7: UART3 Position */ -#define SSPCC_PSSET7_UART3_Msk (0x3ul << SSPCC_PSSET7_UART3_Pos) /*!< SSPCC_T::PSSET7: UART3 Mask */ - -#define SSPCC_PSSET7_UART4_Pos (8) /*!< SSPCC_T::PSSET7: UART4 Position */ -#define SSPCC_PSSET7_UART4_Msk (0x3ul << SSPCC_PSSET7_UART4_Pos) /*!< SSPCC_T::PSSET7: UART4 Mask */ - -#define SSPCC_PSSET7_UART5_Pos (10) /*!< SSPCC_T::PSSET7: UART5 Position */ -#define SSPCC_PSSET7_UART5_Msk (0x3ul << SSPCC_PSSET7_UART5_Pos) /*!< SSPCC_T::PSSET7: UART5 Mask */ - -#define SSPCC_PSSET7_UART6_Pos (12) /*!< SSPCC_T::PSSET7: UART6 Position */ -#define SSPCC_PSSET7_UART6_Msk (0x3ul << SSPCC_PSSET7_UART6_Pos) /*!< SSPCC_T::PSSET7: UART6 Mask */ - -#define SSPCC_PSSET7_UART7_Pos (14) /*!< SSPCC_T::PSSET7: UART7 Position */ -#define SSPCC_PSSET7_UART7_Msk (0x3ul << SSPCC_PSSET7_UART7_Pos) /*!< SSPCC_T::PSSET7: UART7 Mask */ - -#define SSPCC_PSSET7_UART8_Pos (16) /*!< SSPCC_T::PSSET7: UART8 Position */ -#define SSPCC_PSSET7_UART8_Msk (0x3ul << SSPCC_PSSET7_UART8_Pos) /*!< SSPCC_T::PSSET7: UART8 Mask */ - -#define SSPCC_PSSET7_UART9_Pos (18) /*!< SSPCC_T::PSSET7: UART9 Position */ -#define SSPCC_PSSET7_UART9_Msk (0x3ul << SSPCC_PSSET7_UART9_Pos) /*!< SSPCC_T::PSSET7: UART9 Mask */ - -#define SSPCC_PSSET7_UART10_Pos (20) /*!< SSPCC_T::PSSET7: UART10 Position */ -#define SSPCC_PSSET7_UART10_Msk (0x3ul << SSPCC_PSSET7_UART10_Pos) /*!< SSPCC_T::PSSET7: UART10 Mask */ - -#define SSPCC_PSSET7_UART11_Pos (22) /*!< SSPCC_T::PSSET7: UART11 Position */ -#define SSPCC_PSSET7_UART11_Msk (0x3ul << SSPCC_PSSET7_UART11_Pos) /*!< SSPCC_T::PSSET7: UART11 Mask */ - -#define SSPCC_PSSET7_UART12_Pos (24) /*!< SSPCC_T::PSSET7: UART12 Position */ -#define SSPCC_PSSET7_UART12_Msk (0x3ul << SSPCC_PSSET7_UART12_Pos) /*!< SSPCC_T::PSSET7: UART12 Mask */ - -#define SSPCC_PSSET7_UART13_Pos (26) /*!< SSPCC_T::PSSET7: UART13 Position */ -#define SSPCC_PSSET7_UART13_Msk (0x3ul << SSPCC_PSSET7_UART13_Pos) /*!< SSPCC_T::PSSET7: UART13 Mask */ - -#define SSPCC_PSSET7_UART14_Pos (28) /*!< SSPCC_T::PSSET7: UART14 Position */ -#define SSPCC_PSSET7_UART14_Msk (0x3ul << SSPCC_PSSET7_UART14_Pos) /*!< SSPCC_T::PSSET7: UART14 Mask */ - -#define SSPCC_PSSET7_UART15_Pos (30) /*!< SSPCC_T::PSSET7: UART15 Position */ -#define SSPCC_PSSET7_UART15_Msk (0x3ul << SSPCC_PSSET7_UART15_Pos) /*!< SSPCC_T::PSSET7: UART15 Mask */ - -#define SSPCC_PSSET8_I2C0_Pos (0) /*!< SSPCC_T::PSSET8: I2C0 Position */ -#define SSPCC_PSSET8_I2C0_Msk (0x3ul << SSPCC_PSSET8_I2C0_Pos) /*!< SSPCC_T::PSSET8: I2C0 Mask */ - -#define SSPCC_PSSET8_I2C1_Pos (2) /*!< SSPCC_T::PSSET8: I2C1 Position */ -#define SSPCC_PSSET8_I2C1_Msk (0x3ul << SSPCC_PSSET8_I2C1_Pos) /*!< SSPCC_T::PSSET8: I2C1 Mask */ - -#define SSPCC_PSSET8_I2C2_Pos (4) /*!< SSPCC_T::PSSET8: I2C2 Position */ -#define SSPCC_PSSET8_I2C2_Msk (0x3ul << SSPCC_PSSET8_I2C2_Pos) /*!< SSPCC_T::PSSET8: I2C2 Mask */ - -#define SSPCC_PSSET8_I2C3_Pos (6) /*!< SSPCC_T::PSSET8: I2C3 Position */ -#define SSPCC_PSSET8_I2C3_Msk (0x3ul << SSPCC_PSSET8_I2C3_Pos) /*!< SSPCC_T::PSSET8: I2C3 Mask */ - -#define SSPCC_PSSET8_I2C4_Pos (8) /*!< SSPCC_T::PSSET8: I2C4 Position */ -#define SSPCC_PSSET8_I2C4_Msk (0x3ul << SSPCC_PSSET8_I2C4_Pos) /*!< SSPCC_T::PSSET8: I2C4 Mask */ - -#define SSPCC_PSSET8_I2C5_Pos (10) /*!< SSPCC_T::PSSET8: I2C5 Position */ -#define SSPCC_PSSET8_I2C5_Msk (0x3ul << SSPCC_PSSET8_I2C5_Pos) /*!< SSPCC_T::PSSET8: I2C5 Mask */ - -#define SSPCC_PSSET8_UART16_Pos (16) /*!< SSPCC_T::PSSET8: UART16 Position */ -#define SSPCC_PSSET8_UART16_Msk (0x3ul << SSPCC_PSSET8_UART16_Pos) /*!< SSPCC_T::PSSET8: UART16 Mask */ - -#define SSPCC_PSSET9_SC0_Pos (0) /*!< SSPCC_T::PSSET9: SC0 Position */ -#define SSPCC_PSSET9_SC0_Msk (0x3ul << SSPCC_PSSET9_SC0_Pos) /*!< SSPCC_T::PSSET9: SC0 Mask */ - -#define SSPCC_PSSET9_SC1_Pos (2) /*!< SSPCC_T::PSSET9: SC1 Position */ -#define SSPCC_PSSET9_SC1_Msk (0x3ul << SSPCC_PSSET9_SC1_Pos) /*!< SSPCC_T::PSSET9: SC1 Mask */ - -#define SSPCC_PSSET11_QEI0_Pos (0) /*!< SSPCC_T::PSSET11: QEI0 Position */ -#define SSPCC_PSSET11_QEI0_Msk (0x3ul << SSPCC_PSSET11_QEI0_Pos) /*!< SSPCC_T::PSSET11: QEI0 Mask */ - -#define SSPCC_PSSET11_QEI1_Pos (2) /*!< SSPCC_T::PSSET11: QEI1 Position */ -#define SSPCC_PSSET11_QEI1_Msk (0x3ul << SSPCC_PSSET11_QEI1_Pos) /*!< SSPCC_T::PSSET11: QEI1 Mask */ - -#define SSPCC_PSSET11_QEI2_Pos (4) /*!< SSPCC_T::PSSET11: QEI2 Position */ -#define SSPCC_PSSET11_QEI2_Msk (0x3ul << SSPCC_PSSET11_QEI2_Pos) /*!< SSPCC_T::PSSET11: QEI2 Mask */ - -#define SSPCC_PSSET11_ECAP0_Pos (8) /*!< SSPCC_T::PSSET11: ECAP0 Position */ -#define SSPCC_PSSET11_ECAP0_Msk (0x3ul << SSPCC_PSSET11_ECAP0_Pos) /*!< SSPCC_T::PSSET11: ECAP0 Mask */ - -#define SSPCC_PSSET11_ECAP1_Pos (10) /*!< SSPCC_T::PSSET11: ECAP1 Position */ -#define SSPCC_PSSET11_ECAP1_Msk (0x3ul << SSPCC_PSSET11_ECAP1_Pos) /*!< SSPCC_T::PSSET11: ECAP1 Mask */ - -#define SSPCC_PSSET11_ECAP2_Pos (12) /*!< SSPCC_T::PSSET11: ECAP2 Position */ -#define SSPCC_PSSET11_ECAP2_Msk (0x3ul << SSPCC_PSSET11_ECAP2_Pos) /*!< SSPCC_T::PSSET11: ECAP2 Mask */ - -#define SSPCC_PSSET11_TRNG_Pos (18) /*!< SSPCC_T::PSSET11: TRNG Position */ -#define SSPCC_PSSET11_TRNG_Msk (0x3ul << SSPCC_PSSET11_TRNG_Pos) /*!< SSPCC_T::PSSET11: TRNG Mask */ - -#define SSPCC_SRAMSB_SR0BOUND_Pos (0) /*!< SSPCC_T::SRAMSB: SR0BOUND Position */ -#define SSPCC_SRAMSB_SR0BOUND_Msk (0x1ful << SSPCC_SRAMSB_SR0BOUND_Pos) /*!< SSPCC_T::SRAMSB: SR0BOUND Mask */ - -#define SSPCC_SRAMSB_SR1BOUND_Pos (8) /*!< SSPCC_T::SRAMSB: SR1BOUND Position */ -#define SSPCC_SRAMSB_SR1BOUND_Msk (0x1ful << SSPCC_SRAMSB_SR1BOUND_Pos) /*!< SSPCC_T::SRAMSB: SR1BOUND Mask */ - -#define SSPCC_EBISSET_BANK0_Pos (0) /*!< SSPCC_T::EBISSET: BANK0 Position */ -#define SSPCC_EBISSET_BANK0_Msk (0x3ul << SSPCC_EBISSET_BANK0_Pos) /*!< SSPCC_T::EBISSET: BANK0 Mask */ - -#define SSPCC_EBISSET_BANK1_Pos (2) /*!< SSPCC_T::EBISSET: BANK1 Position */ -#define SSPCC_EBISSET_BANK1_Msk (0x3ul << SSPCC_EBISSET_BANK1_Pos) /*!< SSPCC_T::EBISSET: BANK1 Mask */ - -#define SSPCC_EBISSET_BANK2_Pos (4) /*!< SSPCC_T::EBISSET: BANK2 Position */ -#define SSPCC_EBISSET_BANK2_Msk (0x3ul << SSPCC_EBISSET_BANK2_Pos) /*!< SSPCC_T::EBISSET: BANK2 Mask */ - -#define SSPCC_IOxSSET_PIN0_Pos (0) /*!< SSPCC_T::IOxSSET: PIN0 Position */ -#define SSPCC_IOxSSET_PIN0_Msk (0x3ul << SSPCC_IOxSSET_PIN0_Pos) /*!< SSPCC_T::IOxSSET: PIN0 Mask */ - -#define SSPCC_IOxSSET_PIN1_Pos (2) /*!< SSPCC_T::IOxSSET: PIN1 Position */ -#define SSPCC_IOxSSET_PIN1_Msk (0x3ul << SSPCC_IOxSSET_PIN1_Pos) /*!< SSPCC_T::IOxSSET: PIN1 Mask */ - -#define SSPCC_IOxSSET_PIN2_Pos (4) /*!< SSPCC_T::IOxSSET: PIN2 Position */ -#define SSPCC_IOxSSET_PIN2_Msk (0x3ul << SSPCC_IOxSSET_PIN2_Pos) /*!< SSPCC_T::IOxSSET: PIN2 Mask */ - -#define SSPCC_IOxSSET_PIN3_Pos (6) /*!< SSPCC_T::IOxSSET: PIN3 Position */ -#define SSPCC_IOxSSET_PIN3_Msk (0x3ul << SSPCC_IOxSSET_PIN3_Pos) /*!< SSPCC_T::IOxSSET: PIN3 Mask */ - -#define SSPCC_IOxSSET_PIN4_Pos (8) /*!< SSPCC_T::IOxSSET: PIN4 Position */ -#define SSPCC_IOxSSET_PIN4_Msk (0x3ul << SSPCC_IOxSSET_PIN4_Pos) /*!< SSPCC_T::IOxSSET: PIN4 Mask */ - -#define SSPCC_IOxSSET_PIN5_Pos (10) /*!< SSPCC_T::IOxSSET: PIN5 Position */ -#define SSPCC_IOxSSET_PIN5_Msk (0x3ul << SSPCC_IOxSSET_PIN5_Pos) /*!< SSPCC_T::IOxSSET: PIN5 Mask */ - -#define SSPCC_IOxSSET_PIN6_Pos (12) /*!< SSPCC_T::IOxSSET: PIN6 Position */ -#define SSPCC_IOxSSET_PIN6_Msk (0x3ul << SSPCC_IOxSSET_PIN6_Pos) /*!< SSPCC_T::IOxSSET: PIN6 Mask */ - -#define SSPCC_IOxSSET_PIN7_Pos (14) /*!< SSPCC_T::IOxSSET: PIN7 Position */ -#define SSPCC_IOxSSET_PIN7_Msk (0x3ul << SSPCC_IOxSSET_PIN7_Pos) /*!< SSPCC_T::IOxSSET: PIN7 Mask */ - -#define SSPCC_IOxSSET_PIN8_Pos (16) /*!< SSPCC_T::IOxSSET: PIN8 Position */ -#define SSPCC_IOxSSET_PIN8_Msk (0x3ul << SSPCC_IOxSSET_PIN8_Pos) /*!< SSPCC_T::IOxSSET: PIN8 Mask */ - -#define SSPCC_IOxSSET_PIN9_Pos (18) /*!< SSPCC_T::IOxSSET: PIN9 Position */ -#define SSPCC_IOxSSET_PIN9_Msk (0x3ul << SSPCC_IOxSSET_PIN9_Pos) /*!< SSPCC_T::IOxSSET: PIN9 Mask */ - -#define SSPCC_IOxSSET_PIN10_Pos (20) /*!< SSPCC_T::IOxSSET: PIN10 Position */ -#define SSPCC_IOxSSET_PIN10_Msk (0x3ul << SSPCC_IOxSSET_PIN10_Pos) /*!< SSPCC_T::IOxSSET: PIN10 Mask */ - -#define SSPCC_IOxSSET_PIN11_Pos (22) /*!< SSPCC_T::IOxSSET: PIN11 Position */ -#define SSPCC_IOxSSET_PIN11_Msk (0x3ul << SSPCC_IOxSSET_PIN11_Pos) /*!< SSPCC_T::IOxSSET: PIN11 Mask */ - -#define SSPCC_IOxSSET_PIN12_Pos (24) /*!< SSPCC_T::IOxSSET: PIN12 Position */ -#define SSPCC_IOxSSET_PIN12_Msk (0x3ul << SSPCC_IOxSSET_PIN12_Pos) /*!< SSPCC_T::IOxSSET: PIN12 Mask */ - -#define SSPCC_IOxSSET_PIN13_Pos (26) /*!< SSPCC_T::IOxSSET: PIN13 Position */ -#define SSPCC_IOxSSET_PIN13_Msk (0x3ul << SSPCC_IOxSSET_PIN13_Pos) /*!< SSPCC_T::IOxSSET: PIN13 Mask */ - -#define SSPCC_IOxSSET_PIN14_Pos (28) /*!< SSPCC_T::IOxSSET: PIN14 Position */ -#define SSPCC_IOxSSET_PIN14_Msk (0x3ul << SSPCC_IOxSSET_PIN14_Pos) /*!< SSPCC_T::IOxSSET: PIN14 Mask */ - -#define SSPCC_IOxSSET_PIN15_Pos (30) /*!< SSPCC_T::IOxSSET: PIN15 Position */ -#define SSPCC_IOxSSET_PIN15_Msk (0x3ul << SSPCC_IOxSSET_PIN15_Pos) /*!< SSPCC_T::IOxSSET: PIN15 Mask */ - -#define SSPCC_SVIEN_APB0_Pos (0) /*!< SSPCC_T::SVIEN: APB0 Position */ -#define SSPCC_SVIEN_APB0_Msk (0x1ul << SSPCC_SVIEN_APB0_Pos) /*!< SSPCC_T::SVIEN: APB0 Mask */ - -#define SSPCC_SVIEN_APB3_Pos (1) /*!< SSPCC_T::SVIEN: APB3 Position */ -#define SSPCC_SVIEN_APB3_Msk (0x1ul << SSPCC_SVIEN_APB3_Pos) /*!< SSPCC_T::SVIEN: APB3 Mask */ - -#define SSPCC_SVIEN_SRAM1_Pos (2) /*!< SSPCC_T::SVIEN: SRAM1 Position */ -#define SSPCC_SVIEN_SRAM1_Msk (0x1ul << SSPCC_SVIEN_SRAM1_Pos) /*!< SSPCC_T::SVIEN: SRAM1 Mask */ - -#define SSPCC_SVIEN_SDH0_Pos (3) /*!< SSPCC_T::SVIEN: SDH0 Position */ -#define SSPCC_SVIEN_SDH0_Msk (0x1ul << SSPCC_SVIEN_SDH0_Pos) /*!< SSPCC_T::SVIEN: SDH0 Mask */ - -#define SSPCC_SVIEN_SDH1_Pos (4) /*!< SSPCC_T::SVIEN: SDH1 Position */ -#define SSPCC_SVIEN_SDH1_Msk (0x1ul << SSPCC_SVIEN_SDH1_Pos) /*!< SSPCC_T::SVIEN: SDH1 Mask */ - -#define SSPCC_SVIEN_HSUSBD_Pos (5) /*!< SSPCC_T::SVIEN: HSUSBD Position */ -#define SSPCC_SVIEN_HSUSBD_Msk (0x1ul << SSPCC_SVIEN_HSUSBD_Pos) /*!< SSPCC_T::SVIEN: HSUSBD Mask */ - -#define SSPCC_SVIEN_NANDC_Pos (6) /*!< SSPCC_T::SVIEN: NANDC Position */ -#define SSPCC_SVIEN_NANDC_Msk (0x1ul << SSPCC_SVIEN_NANDC_Pos) /*!< SSPCC_T::SVIEN: NANDC Mask */ - -#define SSPCC_SVIEN_PDMA0_Pos (7) /*!< SSPCC_T::SVIEN: PDMA0 Position */ -#define SSPCC_SVIEN_PDMA0_Msk (0x1ul << SSPCC_SVIEN_PDMA0_Pos) /*!< SSPCC_T::SVIEN: PDMA0 Mask */ - -#define SSPCC_SVIEN_PDMA1_Pos (8) /*!< SSPCC_T::SVIEN: PDMA1 Position */ -#define SSPCC_SVIEN_PDMA1_Msk (0x1ul << SSPCC_SVIEN_PDMA1_Pos) /*!< SSPCC_T::SVIEN: PDMA1 Mask */ - -#define SSPCC_SVIEN_TRNG_Pos (9) /*!< SSPCC_T::SVIEN: TRNG Position */ -#define SSPCC_SVIEN_TRNG_Msk (0x1ul << SSPCC_SVIEN_TRNG_Pos) /*!< SSPCC_T::SVIEN: TRNG Mask */ - -#define SSPCC_SVIEN_CRYPTO_Pos (10) /*!< SSPCC_T::SVIEN: CRYPTO Position */ -#define SSPCC_SVIEN_CRYPTO_Msk (0x1ul << SSPCC_SVIEN_CRYPTO_Pos) /*!< SSPCC_T::SVIEN: CRYPTO Mask */ - -#define SSPCC_SVINTSTS_APB0_Pos (0) /*!< SSPCC_T::SVINTSTS: APB0 Position */ -#define SSPCC_SVINTSTS_APB0_Msk (0x1ul << SSPCC_SVINTSTS_APB0_Pos) /*!< SSPCC_T::SVINTSTS: APB0 Mask */ - -#define SSPCC_SVINTSTS_APB3_Pos (1) /*!< SSPCC_T::SVINTSTS: APB3 Position */ -#define SSPCC_SVINTSTS_APB3_Msk (0x1ul << SSPCC_SVINTSTS_APB3_Pos) /*!< SSPCC_T::SVINTSTS: APB3 Mask */ - -#define SSPCC_SVINTSTS_SRAM1_Pos (2) /*!< SSPCC_T::SVINTSTS: SRAM1 Position */ -#define SSPCC_SVINTSTS_SRAM1_Msk (0x1ul << SSPCC_SVINTSTS_SRAM1_Pos) /*!< SSPCC_T::SVINTSTS: SRAM1 Mask */ - -#define SSPCC_SVINTSTS_SDH0_Pos (3) /*!< SSPCC_T::SVINTSTS: SDH0 Position */ -#define SSPCC_SVINTSTS_SDH0_Msk (0x1ul << SSPCC_SVINTSTS_SDH0_Pos) /*!< SSPCC_T::SVINTSTS: SDH0 Mask */ - -#define SSPCC_SVINTSTS_SDH1_Pos (4) /*!< SSPCC_T::SVINTSTS: SDH1 Position */ -#define SSPCC_SVINTSTS_SDH1_Msk (0x1ul << SSPCC_SVINTSTS_SDH1_Pos) /*!< SSPCC_T::SVINTSTS: SDH1 Mask */ - -#define SSPCC_SVINTSTS_HSUSBD_Pos (5) /*!< SSPCC_T::SVINTSTS: HSUSBD Position */ -#define SSPCC_SVINTSTS_HSUSBD_Msk (0x1ul << SSPCC_SVINTSTS_HSUSBD_Pos) /*!< SSPCC_T::SVINTSTS: HSUSBD Mask */ - -#define SSPCC_SVINTSTS_NANDC_Pos (6) /*!< SSPCC_T::SVINTSTS: NANDC Position */ -#define SSPCC_SVINTSTS_NANDC_Msk (0x1ul << SSPCC_SVINTSTS_NANDC_Pos) /*!< SSPCC_T::SVINTSTS: NANDC Mask */ - -#define SSPCC_SVINTSTS_PDMA0_Pos (7) /*!< SSPCC_T::SVINTSTS: PDMA0 Position */ -#define SSPCC_SVINTSTS_PDMA0_Msk (0x1ul << SSPCC_SVINTSTS_PDMA0_Pos) /*!< SSPCC_T::SVINTSTS: PDMA0 Mask */ - -#define SSPCC_SVINTSTS_PDMA1_Pos (8) /*!< SSPCC_T::SVINTSTS: PDMA1 Position */ -#define SSPCC_SVINTSTS_PDMA1_Msk (0x1ul << SSPCC_SVINTSTS_PDMA1_Pos) /*!< SSPCC_T::SVINTSTS: PDMA1 Mask */ - -#define SSPCC_SVINTSTS_TRNG_Pos (9) /*!< SSPCC_T::SVINTSTS: TRNG Position */ -#define SSPCC_SVINTSTS_TRNG_Msk (0x1ul << SSPCC_SVINTSTS_TRNG_Pos) /*!< SSPCC_T::SVINTSTS: TRNG Mask */ - -#define SSPCC_SVINTSTS_CRYPTO_Pos (10) /*!< SSPCC_T::SVINTSTS: CRYPTO Position */ -#define SSPCC_SVINTSTS_CRYPTO_Msk (0x1ul << SSPCC_SVINTSTS_CRYPTO_Pos) /*!< SSPCC_T::SVINTSTS: CRYPTO Mask */ - -#define SSPCC_APB0VSRC_MASTER_Pos (0) /*!< SSPCC_T::APB0VSRC: MASTER Position */ -#define SSPCC_APB0VSRC_MASTER_Msk (0xful << SSPCC_APB0VSRC_MASTER_Pos) /*!< SSPCC_T::APB0VSRC: MASTER Mask */ - -#define SSPCC_APB3VSRC_MASTER_Pos (0) /*!< SSPCC_T::APB3VSRC: MASTER Position */ -#define SSPCC_APB3VSRC_MASTER_Msk (0xful << SSPCC_APB3VSRC_MASTER_Pos) /*!< SSPCC_T::APB3VSRC: MASTER Mask */ - -#define SSPCC_SRAM1VSRC_MASTER_Pos (0) /*!< SSPCC_T::SRAM1VSRC: MASTER Position */ -#define SSPCC_SRAM1VSRC_MASTER_Msk (0xful << SSPCC_SRAM1VSRC_MASTER_Pos) /*!< SSPCC_T::SRAM1VSRC: MASTER Mask */ - -#define SSPCC_SDH0VSRC_MASTER_Pos (0) /*!< SSPCC_T::SDH0VSRC: MASTER Position */ -#define SSPCC_SDH0VSRC_MASTER_Msk (0xful << SSPCC_SDH0VSRC_MASTER_Pos) /*!< SSPCC_T::SDH0VSRC: MASTER Mask */ - -#define SSPCC_SDH1VSRC_MASTER_Pos (0) /*!< SSPCC_T::SDH1VSRC: MASTER Position */ -#define SSPCC_SDH1VSRC_MASTER_Msk (0xful << SSPCC_SDH1VSRC_MASTER_Pos) /*!< SSPCC_T::SDH1VSRC: MASTER Mask */ - -#define SSPCC_HSUSBDVSRC_MASTER_Pos (0) /*!< SSPCC_T::HSUSBDVSRC: MASTER Position */ -#define SSPCC_HSUSBDVSRC_MASTER_Msk (0xful << SSPCC_HSUSBDVSRC_MASTER_Pos) /*!< SSPCC_T::HSUSBDVSRC: MASTER Mask */ - -#define SSPCC_NANDCVSRC_MASTER_Pos (0) /*!< SSPCC_T::NANDCVSRC: MASTER Position */ -#define SSPCC_NANDCVSRC_MASTER_Msk (0xful << SSPCC_NANDCVSRC_MASTER_Pos) /*!< SSPCC_T::NANDCVSRC: MASTER Mask */ - -#define SSPCC_PDMA0VSRC_MASTER_Pos (0) /*!< SSPCC_T::PDMA0VSRC: MASTER Position */ -#define SSPCC_PDMA0VSRC_MASTER_Msk (0xful << SSPCC_PDMA0VSRC_MASTER_Pos) /*!< SSPCC_T::PDMA0VSRC: MASTER Mask */ - -#define SSPCC_PDMA1VSRC_MASTER_Pos (0) /*!< SSPCC_T::PDMA1VSRC: MASTER Position */ -#define SSPCC_PDMA1VSRC_MASTER_Msk (0xful << SSPCC_PDMA1VSRC_MASTER_Pos) /*!< SSPCC_T::PDMA1VSRC: MASTER Mask */ - -#define SSPCC_TRNGVSRC_MASTER_Pos (0) /*!< SSPCC_T::TRNGVSRC: MASTER Position */ -#define SSPCC_TRNGVSRC_MASTER_Msk (0xful << SSPCC_TRNGVSRC_MASTER_Pos) /*!< SSPCC_T::TRNGVSRC: MASTER Mask */ - -#define SSPCC_CRYPTOVSRC_MASTER_Pos (0) /*!< SSPCC_T::CRYPTOVSRC: MASTER Position */ -#define SSPCC_CRYPTOVSRC_MASTER_Msk (0xful << SSPCC_CRYPTOVSRC_MASTER_Pos) /*!< SSPCC_T::CRYPTOVSRC: MASTER Mask */ - -#define SSPCC_APB0VA_VIOADDR_Pos (0) /*!< SSPCC_T::APB0VA: VIOADDR Position */ -#define SSPCC_APB0VA_VIOADDR_Msk (0xfffffffful << SSPCC_APB0VA_VIOADDR_Pos) /*!< SSPCC_T::APB0VA: VIOADDR Mask */ - -#define SSPCC_APB3VA_VIOADDR_Pos (0) /*!< SSPCC_T::APB3VA: VIOADDR Position */ -#define SSPCC_APB3VA_VIOADDR_Msk (0xfffffffful << SSPCC_APB3VA_VIOADDR_Pos) /*!< SSPCC_T::APB3VA: VIOADDR Mask */ - -#define SSPCC_SRAM1VA_VIOADDR_Pos (0) /*!< SSPCC_T::SRAM1VA: VIOADDR Position */ -#define SSPCC_SRAM1VA_VIOADDR_Msk (0xfffffffful << SSPCC_SRAM1VA_VIOADDR_Pos) /*!< SSPCC_T::SRAM1VA: VIOADDR Mask */ - -#define SSPCC_SDH0VA_VIOADDR_Pos (0) /*!< SSPCC_T::SDH0VA: VIOADDR Position */ -#define SSPCC_SDH0VA_VIOADDR_Msk (0xfffffffful << SSPCC_SDH0VA_VIOADDR_Pos) /*!< SSPCC_T::SDH0VA: VIOADDR Mask */ - -#define SSPCC_SDH1VA_VIOADDR_Pos (0) /*!< SSPCC_T::SDH1VA: VIOADDR Position */ -#define SSPCC_SDH1VA_VIOADDR_Msk (0xfffffffful << SSPCC_SDH1VA_VIOADDR_Pos) /*!< SSPCC_T::SDH1VA: VIOADDR Mask */ - -#define SSPCC_HSUSBDVA_VIOADDR_Pos (0) /*!< SSPCC_T::HSUSBDVA: VIOADDR Position */ -#define SSPCC_HSUSBDVA_VIOADDR_Msk (0xfffffffful << SSPCC_HSUSBDVA_VIOADDR_Pos) /*!< SSPCC_T::HSUSBDVA: VIOADDR Mask */ - -#define SSPCC_NANDCVA_VIOADDR_Pos (0) /*!< SSPCC_T::NANDCVA: VIOADDR Position */ -#define SSPCC_NANDCVA_VIOADDR_Msk (0xfffffffful << SSPCC_NANDCVA_VIOADDR_Pos) /*!< SSPCC_T::NANDCVA: VIOADDR Mask */ - -#define SSPCC_PDMA0VA_VIOADDR_Pos (0) /*!< SSPCC_T::PDMA0VA: VIOADDR Position */ -#define SSPCC_PDMA0VA_VIOADDR_Msk (0xfffffffful << SSPCC_PDMA0VA_VIOADDR_Pos) /*!< SSPCC_T::PDMA0VA: VIOADDR Mask */ - -#define SSPCC_PDMA1VA_VIOADDR_Pos (0) /*!< SSPCC_T::PDMA1VA: VIOADDR Position */ -#define SSPCC_PDMA1VA_VIOADDR_Msk (0xfffffffful << SSPCC_PDMA1VA_VIOADDR_Pos) /*!< SSPCC_T::PDMA1VA: VIOADDR Mask */ - -#define SSPCC_TRNGVA_VIOADDR_Pos (0) /*!< SSPCC_T::TRNGVA: VIOADDR Position */ -#define SSPCC_TRNGVA_VIOADDR_Msk (0xfffffffful << SSPCC_TRNGVA_VIOADDR_Pos) /*!< SSPCC_T::TRNGVA: VIOADDR Mask */ - -#define SSPCC_CRYPTOVA_VIOADDR_Pos (0) /*!< SSPCC_T::CRYPTOVA: VIOADDR Position */ -#define SSPCC_CRYPTOVA_VIOADDR_Msk (0xfffffffful << SSPCC_CRYPTOVA_VIOADDR_Pos) /*!< SSPCC_T::CRYPTOVA: VIOADDR Mask */ - -#define SSPCC_SINFAEN_SSPCCSIAEN_Pos (0) /*!< SSPCC_T::SINFAEN: SSPCCSIAEN Position */ -#define SSPCC_SINFAEN_SSPCCSIAEN_Msk (0x1ul << SSPCC_SINFAEN_SSPCCSIAEN_Pos) /*!< SSPCC_T::SINFAEN: SSPCCSIAEN Mask */ - -#define SSPCC_SINFAEN_SYSSIAEN_Pos (1) /*!< SSPCC_T::SINFAEN: SYSSIAEN Position */ -#define SSPCC_SINFAEN_SYSSIAEN_Msk (0x1ul << SSPCC_SINFAEN_SYSSIAEN_Pos) /*!< SSPCC_T::SINFAEN: SYSSIAEN Mask */ - -#define SSPCC_SINFAEN_RTCSIAEN_Pos (2) /*!< SSPCC_T::SINFAEN: RTCSIAEN Position */ -#define SSPCC_SINFAEN_RTCSIAEN_Msk (0x1ul << SSPCC_SINFAEN_RTCSIAEN_Pos) /*!< SSPCC_T::SINFAEN: RTCSIAEN Mask */ - -#define SSPCC_SINFAEN_OTPSIAEN_Pos (6) /*!< SSPCC_T::SINFAEN: OTPSIAEN Position */ -#define SSPCC_SINFAEN_OTPSIAEN_Msk (0x1ul << SSPCC_SINFAEN_OTPSIAEN_Pos) /*!< SSPCC_T::SINFAEN: OTPSIAEN Mask */ - -#define SSPCC_SINFAEN_KSSIAEN_Pos (7) /*!< SSPCC_T::SINFAEN: KSSIAEN Position */ -#define SSPCC_SINFAEN_KSSIAEN_Msk (0x1ul << SSPCC_SINFAEN_KSSIAEN_Pos) /*!< SSPCC_T::SINFAEN: KSSIAEN Mask */ - -#define SSPCC_SCWP_ENABLE_Pos (0) /*!< SSPCC_T::SCWP: ENABLE Position */ -#define SSPCC_SCWP_ENABLE_Msk (0x1ul << SSPCC_SCWP_ENABLE_Pos) /*!< SSPCC_T::SCWP: ENABLE Mask */ - -#define SSPCC_SCWP_LOCK_Pos (1) /*!< SSPCC_T::SCWP: LOCK Position */ -#define SSPCC_SCWP_LOCK_Msk (0x1ul << SSPCC_SCWP_LOCK_Pos) /*!< SSPCC_T::SCWP: LOCK Mask */ - -#define SSPCC_SCWP_WVCODE_Pos (16) /*!< SSPCC_T::SCWP: WVCODE Position */ -#define SSPCC_SCWP_WVCODE_Msk (0xfffful << SSPCC_SCWP_WVCODE_Pos) /*!< SSPCC_T::SCWP: WVCODE Mask */ - -/**@}*/ /* SSPCC_CONST */ -/**@}*/ /* end of SSPCC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SSPCC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sys_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sys_reg.h deleted file mode 100644 index 0b5cedd15b5..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/sys_reg.h +++ /dev/null @@ -1,5816 +0,0 @@ -/**************************************************************************//** - * @file sys_reg.h - * @brief SYS register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __SYS_REG_H__ -#define __SYS_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SYS System Manger Controller(SYS) - Memory Mapped Structure for SYS Controller -@{ */ - -typedef struct -{ - - - /** - * @var SYS_T::PDID - * Offset: 0x00 Product and Device Identifier Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PID |Product ID - * | | |This field stores the 16-bit Product ID loaded from OTP memory. - * |[27:16] |DID |Device ID - * | | |This field stores the 8-bit Device ID loaded from OTP memory. - * @var SYS_T::PWRONOTP - * Offset: 0x04 Power-on Setting OTP Source Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PWRONSRC |Power on Setting Source Control (Read Only) - * | | |0 = Power on setting values come from pin. (Default) - * | | |1 = Power on setting values come from OTP. - * |[1] |QSPI0CKSEL|QSPI0_CLK Frequency Selection (Read Only) - * | | |0 = QSPI0_CLK frequency is 30 MHz. - * | | |1 = QSPI0_CLK frequency is 50 MHz. - * | | |Note: The value of WDT0ON latched from OTP when pin nRESET transited from low to high. - * |[2] |WDT0ON |Watchdog Timer 0 ON/OFF Selection (Read Only) - * | | |0 = After power-on, WDT 0 Disabled. - * | | |1 = after power-on WDT 0 Enabled. - * | | |Note: The value of WDT0ON latched from OTP when pin nRESET transited from low to high. - * |[4] |UR0DBGDIS |UART 0 Debug Message Output Disable Bit (Read Only) - * | | |0= UART 0 debug message output Enabled. - * | | |1= UART 0 debug message output Disabled. - * | | |Note: The value of UR0DBGDIS latched from OTP when pin nRESET transited from low to high. - * |[5] |SD0BKEN |SD0 Back Up Boot Enable Bit (Read Only) - * | | |0 = SD0 back up boot Disabled (Default). - * | | |1 = SD0 back up boot Enabled. - * | | |Note: SD0BKEN didn't take effect if BTSRCSEL= 01 and BTOPTION = 00.. - * |[11:10] |BTSRCSEL |Boot Source Selection (Read Only) - * | | |00 = Boot from SPI Flash (Default). - * | | |01 = Boot from SD/eMMC. - * | | |10 = Boot from NAND Flash. - * | | |11 = Boot from USB. - * | | |Note: If PWRONSRC = 0, the value of pin PG[3:2] latched to BTSRCSEL when pin nRESET transited from low to high - * | | |If PWRONSRC = 1, the value of BTSRCSEL latched from OTP's BTSRCSEL. - * |[13:12] |NPAGESEL |NAND Flash Page Size Selection (Read Only) - * | | |00 = NAND Flash page size is 2 KB. - * | | |01 = NAND Flash page size is 4 KB. - * | | |10 = NAND Flash page size is 8 KB. - * | | |11 = Ignore. - * | | |Note: If PWRONSRC = 0, the value of pin PG[5:4] latched to NPAGSEL when pin nRESET transited from low to high - * | | |If PWRONSRC = 1, the value of NPAGSEL latched from OTP's BTNANDPS. - * |[15:14] |MISCCFG |Miscellaneous Configuration (Read Only) - * | | |If BTSRCSEL = 01, boot from SD/eMMC. - * | | |MISCCFG[0]: - * | | |0 = SD0/eMMC0 booting. (Default) - * | | |1 = SD1/eMMC1 booting. - * | | |MISCCFG[1]: - * | | |0 = eMMC 4-bit booting. (Default) - * | | |1 = eMMC 8-bit booting.00 = SD0/eMMC0 booting (Default). - * | | |01 = SD1/eMMC1 booting. - * | | |10 = SD1/eMMC1 booting. - * | | |11 = SD1/eMMC1 booting. - * | | |If BTSRCSEL = 10, boot from NAND Flash. - * | | |00 = No ECC (Default). - * | | |01 = ECC is BCH T12. - * | | |10 = ECC is BCH T24. - * | | |11 = Ignore. - * | | |If BTSRCSEL = 00, the Boot from SPI Flash. - * | | |00 = SPI-NAND Flash with 1-bit mode booting (Default). - * | | |01 = SPI-NAND Flash with 4-bit mode booting. - * | | |10 = SPI-NOR Flash with 1-bit mode booting. - * | | |11 = SPI-NOR Flash with 4-bit mode booting. - * | | |Note: If PWRONSRC = 0, the value of pin PG[7:6] latched to MISCCFG when pin nRESET transited from low to high - * | | |If PWRONSRC = 1, the value of MISCCFG latched from OTP's BTOPTION. - * |[16] |USBP0ID |USB Port 0 ID Pin Status - * | | |0= USB port 0 used as a USB device. - * | | |1= USB port 0 used as a USB host. - * |[31:24] |SECBTPSWD |Secure Boot Disable Password (Read Only) - * | | |If SECBTPSWD is 0x5A, the secure boot Disabled. - * | | |Note 1: SECBTPSWD didn't take effect and PG[0] used as Secure Boot Disable if PWRONSRC = 0. - * | | |Note 2: In RMA mode, SECBTPSWD didn't take effect and PG[0] used as Secure Boot Disable. - * @var SYS_T::PWRONPIN - * Offset: 0x08 Power-on Setting Pin Source Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SECBTDIS |Secure Boot Disable Bit (Read Only) - * | | |0 = Secure Boot Enabled (Default). - * | | |1 = Secure Boot Disabled. - * | | |Note: If PWRONSRC = 0, the value of pin PG[0] latched to SECBTDIS when pin nRESET transited from low to high - * | | |If PWRONSRC = 1, the value of SECBTDIS latched from OTP's SECBTDIS. - * |[3:2] |BTSRCSEL |Boot Source Selection (Read Only) - * | | |00 = Boot from SPI Flash (Default). - * | | |01 = Boot from SD/eMMC. - * | | |10 = Boot from NAND Flash. - * | | |11 = Boot from USB. - * | | |Note: If PWRONSRC = 0, the value of pin PG[3:2] latched to BTSRCSEL when pin nRESET transited from low to high - * | | |If PWRONSRC = 1, the value of BTSRCSEL latched from OTP's BTSRCSEL. - * |[5:4] |NPAGESEL |NAND Flash Page Size Selection (Read Only) - * | | |00 = NAND Flash page size is 2 KB. - * | | |01 = NAND Flash page size is 4 KB. - * | | |10 = NAND Flash page size is 8 KB. - * | | |11 = Ignore. - * | | |Note: If PWRONSRC = 0, the value of pin PG[5:4] latched to NPAGSEL when pin nRESET transited from low to high - * | | |If PWRONSRC = 1, the value of NPAGSEL latched from OTP's BTNANDPS. - * |[7:6] |MISCCFG |Miscellaneous Configuration (Read Only) - * | | |If BTSRCSEL = 01, boot from SD/eMMC. - * | | |MISCCFG[0]: - * | | |0 = SD0/eMMC0 booting. (Default) - * | | |1 = SD1/eMMC1 booting. - * | | |MISCCFG[1]: - * | | |0 = eMMC 4-bit booting. (Default) - * | | |1 = eMMC 8-bit booting.00 = SD0/eMMC0 booting (Default). - * | | |01 = SD1/eMMC1 booting. - * | | |10 = SD1/eMMC1 booting. - * | | |11 = SD1/eMMC1 booting. - * | | |If BTSRCSEL = 10, boot from NAND Flash. - * | | |00 = No ECC (Default). - * | | |01 = ECC is BCH T12. - * | | |10 = ECC is BCH T24. - * | | |11 = Ignore. - * | | |If BTSRCSEL = 00, the Boot from SPI Flash. - * | | |00 = SPI-NAND Flash with 1-bit mode booting (Default). - * | | |01 = SPI-NAND Flash with 4-bit mode booting. - * | | |10 = SPI-NOR Flash with 1-bit mode booting. - * | | |11 = SPI-NOR Flash with 4-bit mode booting. - * | | |Note: If PWRONSRC = 0, the value of pin PG[7:6] latched to MISCCFG when pin nRESET transited from low to high - * | | |If PWRONSRC = 1, the value of MISCCFG latched from OTP's BTOPTION. - * @var SYS_T::RSTSTS - * Offset: 0x10 Reset Source Active Status Register (Shared) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PORF |POR Reset Flag - * | | |0 = No reset from POR. - * | | |1 = POR had issued reset signal to reset the chip. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |PINRF |NRESET Pin Reset Flag - * | | |0 = No reset from nRESET pin. - * | | |1 = nRESET pin had issued reset signal to reset the chip. - * | | |Note: Write 1 to clear this bit to 0. - * |[2] |WDT0RF |WDT 0 Reset Flag - * | | |The WDT 0 reset flag is set by the "Reset Signal" from the Watchdog Timer 0 or Window Watchdog Timer 0 to indicate the previous reset source. - * | | |0 = No reset from watchdog timer 0 or window watchdog timer 0. - * | | |1 = The watchdog timer 0 or window watchdog timer 0 had issued the reset signal to reset the system. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer 0 register RSTF(WDT0_CTL[2]) bit is set if the system has been reset by WDT 0 time-out reset - * | | |Window Watchdog Timer 0 register WWDTRF(WWDT0_STATUS[1]) bit is set if the system has been reset by WWDT 0 time-out reset. - * |[3] |LVRF |LVR Reset Flag - * | | |The LVR reset flag is set by the "Reset Signal" from the Low Voltage Reset Controller to indicate the previous reset source. - * | | |0 = No reset from LVR. - * | | |1 = LVR had issued reset signal to reset the chip. - * | | |Note: Write 1 to clear this bit to 0. - * |[4] |CPU0DBGRF |Cortex-A35 Core 0 Debug Reset Flag - * | | |The Cortex-A35 core 0 debug reset flag is set by the "Reset Signal" from DBGRSTREQ of Cortex-A35 core 0 to indicate the previous reset source. - * | | |0 = No reset from DBGRSTREQ of Cortex-A35 core 0. - * | | |1 = The Cortex-A35 core 0 had issued DBGRSTREQ reset signal to reset itself. - * | | |Note: Write 1 to clear this bit to 0. - * |[5] |CPU0WARMRF|Cortex-A35 Core 0 Warm Reset Flag - * | | |The Cortex-A35 core 0 warm reset flag is set by the "Reset Signal" from WARMRSTREQ of Cortex-A35 core 0 to indicate the previous reset source - * | | |The WARMRSTREQ of Cortex-A35 core 0 trigger by writing 1 to the bit RR (RMR[1], Reset Management Register of Cortex-A35 core 0) - * | | |0 = No reset from WARMRSTREQ of Cortex-A35 core 0. - * | | |1 = The Cortex-A35 core 0 had issued WARMRSTREQ reset signal to reset itself. - * | | |Note: Write 1 to clear this bit to 0. - * |[6] |HRESETRF |HRESET Reset Flag - * | | |The HRESET reset flag is set by the "Reset Signal" from the HRESET. - * | | |0 = No reset from HRESET. - * | | |1 = Reset from HRESET. - * | | |Note: Write 1 to clear this bit to 0. - * |[7] |CPU0RF |CPU 0 Reset Flag - * | | |The CPU 0 reset flag is set by hardware if software writes CA35CR0RST (SYS_IPRST0[1]) 1 to reset Cortex-A35 Core 0. - * | | |0 = No reset to CPU. - * | | |1 = The Cortex-A35 Core 0 is reset by software setting CA35CR0RST (SYS_IPRST0[1]) to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[10] |WDT1RF |WDT 1 Reset Flag - * | | |The WDT 1 reset flag is set by the "Reset Signal" from the Watchdog Timer 1 or Window Watchdog Timer 1 to indicate the previous reset source. - * | | |0 = No reset from watchdog timer 1 or window watchdog timer 1. - * | | |1 = The watchdog timer 1 or window watchdog timer 1 had issued the reset signal to reset the system. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer 1 register RSTF (WDT1_CTL[2]) bit is set if the system has been reset by WDT 1 time-out reset - * | | |Window Watchdog Timer 1 register WWDTRF (WWDT1_STATUS[1]) bit is set if the system has been reset by WWDT 1 time-out reset. - * | | |Note 3: This flag only take effect when WDT1RSTAEN (SYS_MISCRFCR[16]) is 1. - * |[11] |WDT2RFA |WDT 2 Reset Flag for Cortex-A35 - * | | |The WDT 2 reset flag is set by the "Reset Signal" from the Watchdog Timer 2 or Window Watchdog Timer 2 to indicate the previous reset source. - * | | |0 = No reset from watchdog timer 2 or window watchdog timer 2. - * | | |1 = The watchdog timer 2 or window watchdog timer 2 had issued the reset signal to reset the system. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer 2 register RSTF(WDT2_CTL[2]) bit is set if the system has been reset by WDT 2 time-out reset - * | | |Window Watchdog Timer 2 register WWDTRF(WWDT2_STATUS[1]) bit is set if the system has been reset by WWDT 2 time-out reset. - * | | |Note 3: This flag only take effect when WDT2RSTAEN (SYS_MISCRFCR[17]) is 1. - * |[12] |CPU1DBGRF |Cortex-A35 Core 1 Debug Reset Flag - * | | |The Cortex-A35 core 1 debug reset flag is set by the "Reset Signal" from DBGRSTREQ of Cortex-A35 core 1 to indicate the previous reset source. - * | | |0 = No reset from DBGRSTREQ of Cortex-A35 core 1. - * | | |1 = The Cortex-A35 core 1 had issued DBGRSTREQ reset signal to reset itself. - * | | |Note: Write 1 to clear this bit to 0. - * |[13] |CPU1WARMRF|Cortex-A35 Core 1 Warm Reset Flag - * | | |The Cortex-A35 core 1 warm reset flag is set by the "Reset Signal" from WARMRSTREQ of Cortex-A35 core 1 to indicate the previous reset source - * | | |The WARMRSTREQ of Cortex-A35 core 1 trigger by writing 1 to the bit RR (RMR[1], Reset Management Register of Cortex-A35 core 1) - * | | |0 = No reset from WARMRSTREQ of Cortex-A35 core 1. - * | | |1 = The Cortex-A35 core 1 had issued WARMRSTREQ reset signal to reset itself. - * | | |Note: Write 1 to clear this bit to 0. - * |[15] |CPU1RF |Cortex-A35 Core 1 Reset Flag - * | | |The Cortex-A35 Core 1 reset flag is set by hardware if software writes CA35CR1RST (SYS_IPRST0[2]) 1 to reset Cortex-A35 Core 1. - * | | |0 = No reset to Cortex-A35 Core 1. - * | | |1 = The Cortex-A35 Core 1 is reset by software setting CA35CR1RST (SYS_IPRST0[2]) to 1. - * | | |Note: Write 1 to clear this bit to 0. - * |[18] |WDT1RFM |WDT 1 Reset Flag for RTP Cortex-M4 - * | | |The WDT 1 reset flag is set by the "Reset Signal" from the Watchdog Timer 1 or Window Watchdog Timer 1 to indicate the previous reset source. - * | | |0 = No reset from watchdog timer 1 or window watchdog timer 1. - * | | |1 = The watchdog timer 1 or window watchdog timer 1 had issued the reset signal to reset the system. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer 1 register RSTF(WDT1_CTL[2]) bit is set if the system has been reset by WDT 1 time-out reset - * | | |Window Watchdog Timer 1 register WWDTRF(WWDT1_STATUS[1]) bit is set if the system has been reset by WWDT 1 time-out reset. - * | | |Note 3: This flag only take effect when WDT1RSTMEN (SYS_MISCRFCR[18]) is 1. - * |[19] |WDT2RF |WDT 2 Reset Flag for RTP Cortex-M4 - * | | |The WDT 2 reset flag is set by the "Reset Signal" from the Watchdog Timer 2 or Window Watchdog Timer 2 to indicate the previous reset source. - * | | |0 = No reset from watchdog timer 2 or window watchdog timer 2. - * | | |1 = The watchdog timer 2 or window watchdog timer 2 had issued the reset signal to reset the system. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer 2 register RSTF(WDT2_CTL[2]) bit is set if the system has been reset by WDT 2 time-out reset - * | | |Window Watchdog Timer 2 register WWDTRF(WWDT2_STATUS[1]) bit is set if the system has been reset by WWDT 2 time-out reset. - * |[20] |RTPM4LKRF |RTP M4 CPU Lockup Reset Flag - * | | |0 = No reset from RTP M4 CPU lockup happened. - * | | |1 = The RTP Cortex-M4 lockup happened and chip is reset. - * | | |Note 1: Write 1 to clear this bit to 0. - * | | |Note 2: When CPU lockup happened under ICE is connected, this flag will set to 1 but chip will not reset. - * |[21] |RTPM4SYSRF|RTP M4 System Reset Flag - * | | |The system reset flag is set by the "Reset Signal" from the Cortex-M4 Core to indicate the previous reset source. - * | | |0 = No reset from Cortex-M4. - * | | |1 = The Cortex-M4 had issued the reset signal to reset the system by writing 1 to the bit SYSRESETREQ(AIRCR[2], Application Interrupt and Reset Control Register, address = 0xE000ED0C) in system control registers of Cortex-M4 core. - * | | |Note: Write 1 to clear this bit to 0. - * |[22] |RTPPMUSYSRF|RTP PMU System Reset Flag - * | | |The system reset flag is set by the "Reset Signal" from the PMU of Cortex-M4 Core to indicate the previous reset source. - * | | |0 = No reset from PMU of Cortex-M4. - * | | |1 = The PMU of Cortex-M4 had issued the reset signal (PMURESETREQ) to reset the system. - * | | |Note: Write 1 to clear this bit to 0. - * |[23] |RTPM4CPURF|RTP M4 CPU Reset Flag - * | | |The RTP M4 CPU reset flag is set by hardware if software writes CM4RST (SYS_IPRST0[3]) 1 to reset Cortex-M4 Core. - * | | |0 = No reset to RTP M4 CPU. - * | | |1 = The RTP M4 CPU core is reset by software setting CM4RST (SYS_IPRST0[3]) to 1. - * | | |Note: Write 1 to clear this bit to 0. - * @var SYS_T::MISCRFCR - * Offset: 0x14 Miscellaneous Reset Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PORDISCODE|Power-on-reset Disable Code (Write Protect) - * | | |When powered on, the Power-On-Reset (POR) circuit generates a reset signal to reset whole chip function - * | | |However, after power is ready, the POR circuit would consume a few power - * | | |To minimize the POR circuit power consumption, user to disable POR circuit by writing 0x5AA5 to this field. - * | | |The POR circuit will become active again when this field is set to other value or chip is reset by other reset source, including /RESET pin, Watchdog, LVR reset and the software chip reset function. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[16] |WDT1RSTAEN|WDT 1 Reset Cortex-A35 Enable Bit (Write Protect) - * | | |0 = WDT 1 reset Cortex-A35 Disabled. (Default) - * | | |1 = WDT 1 reset Cortex-A35 Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[17] |WDT2RSTAEN|WDT 2 Reset Cortex-A35 Enable Bit (Write Protect) - * | | |0 = WDT 2 reset Cortex-A35 Disabled. (Default) - * | | |1 = WDT 2 reset Cortex-A35 Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[18] |WDT1RSTMEN|WDT 1 Reset Real Time Cortex-M4 Sub-system Enable Bit (Write Protect) - * | | |0 = WDT 1 reset real time Cortex-M4 sub-system Disabled. (Default) - * | | |1 = WDT 1 reset real time Cortex-M4 sub-system Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * @var SYS_T::RSTDEBCTL - * Offset: 0x18 Reset Pin De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DEBCNT |Power-on-reset Disable Code (Write Protect) - * | | |This 16-bit external RESET De-bounce Counter can specify the external RESET de-bounce time up to around 5.46ms (0xFFFF) @ XIN=12 MHz. - * | | |The default external RESET de-bounce time is 0.1ms (0x04B0) @ XIN = 12 MHz. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[31] |RSTDEBEN |Reset Pin De-bounce Enable Bit (Write Protect) - * | | |0 = Reset pin de-bounce Disabled. - * | | |1 = Reset pin de-bounce Enabled. (Default) - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * @var SYS_T::LVRDCR - * Offset: 0x1C Low Voltage Reset & Detect Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LVREN |Low Voltage Reset Enable Bit (Write Protect) - * | | |0 = Low voltage reset function Disabled. - * | | |1 = Low voltage reset function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[3:1] |LVRDGSEL |LVR Output De-glitch Time Select (Write Protect) - * | | |000 = Without de-glitch function. - * | | |001 = 4 system clock (LVRDGCLK). - * | | |010 = 8 system clock (LVRDGCLK). - * | | |011 = 16 system clock (LVRDGCLK). - * | | |100 = 32 system clock (LVRDGCLK). - * | | |101 = 64 system clock (LVRDGCLK). - * | | |110 = 128 system clock (LVRDGCLK). - * | | |111 = 256 system clock (LVRDGCLK). - * | | |Note 1: These bits are write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: Refer to LVRDBSEL (CLK_CLKSEL0[3]) for LVRDGCLK clock source selection. - * |[8] |LVDEN |Low Voltage Detect Enable Bit (Write Protect) - * | | |0 = Low voltage detect function Disabled. - * | | |1 = Low voltage detect function Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[9] |LVDSEL |Low Voltage Detect Threshold Selection (Write Protect) - * | | |0 = Low voltage detection level is 2.8V. - * | | |1 = Low voltage detection level is 2.6V. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[10] |LVDWKA35EN|Low Voltage Detect Wake-up Cortex-A35 Enable Control Bit (Write Protect) - * | | |0 = Low voltage detection wakeup A35 Disabled. - * | | |1 = Low voltage detection wakeup A35 Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[11] |LVDWKRTPEN|Low Voltage Detect Wake-up RTP Cortex-M4 Enable Control Bit (Write Protect) - * | | |0 = Low voltage detection wakeup RTP Cortex-M4 Disabled. - * | | |1 = Low voltage detection wakeup RTP Cortex-M4 Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[14:12] |LVDODGSEL |LVD Output De-glitch Time Select (Write Protect) - * | | |000 = Without de-glitch function. - * | | |001 = 4 system clock (LVRDGCLK). - * | | |010 = 8 system clock (LVRDGCLK). - * | | |011 = 16 system clock (LVRDGCLK). - * | | |100 = 32 system clock (LVRDGCLK). - * | | |101 = 64 system clock (LVRDGCLK). - * | | |110 = 128 system clock (LVRDGCLK). - * | | |111 = 256 system clock (LVRDGCLK). - * | | |Note 1: These bits are write protected. Refer to the SYS_RLKTZS register. - * | | |Note 2: Refer to LVRDBSEL (CLK_CLKSEL0[3]) for LVRDGCLK clock source selection. - * @var SYS_T::IPRST0 - * Offset: 0x20 Reset Control Register 0 (Shared) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CHIPRST |Chip One-shot Reset Enable Bit (Write Protect) - * | | |0 = Chip one-shot reset Disabled. - * | | |1 = Chip one-shot reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[1] |CA35CR0RST|Cortex-A35 Core 0 One-shot Reset (Write Protect) - * | | |0 = Cortex-A35 core 0 one-shot reset Disabled. - * | | |1 = Cortex-A35 core 0 one-shot reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[2] |CA35CR1RST|Cortex-A35 Core 1 One-shot Reset (Write Protect) - * | | |0 = Cortex-A35 core 1 one-shot reset Disabled. - * | | |1 = Cortex-A35 core 1 one-shot reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[3] |CM4RST |Cortex-M4 Core Reset (Write Protect) - * | | |0 = Cortex-M4 core reset Disabled. - * | | |1 = Cortex-M4 core reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[4] |PDMA0RST |PDMA 0 Reset Enable Bit (Write Protect) - * | | |0 = PDMA 0 reset Disabled. - * | | |1 = PDMA 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[5] |PDMA1RST |PDMA 1 Reset Enable Bit (Write Protect) - * | | |0 = PDMA 1 reset Disabled. - * | | |1 = PDMA 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[6] |PDMA2RST |PDMA2 Reset Enable Bit (Write Protect) - * | | |0 = PDMA 2 reset Disabled. - * | | |1 = PDMA 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[7] |PDMA3RST |PDMA 3 Reset Enable Bit (Write Protect) - * | | |0 = PDMA 3 reset Disabled. - * | | |1 = PDMA 3 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[9] |DISPCRST |LCD Display Controller Reset Enable Bit (Write Protect) - * | | |0 = LCD Display Controller reset Disabled. - * | | |1 = LCD Display Controller reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[10] |VCAP0RST |Video Capture Sensor Interface 0 Reset Enable Bit (Write Protect) - * | | |0 = Video Capture sensor interface 0 reset Disabled. - * | | |1 = Video Capture sensor interface 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[11] |VCAP1RST |Video Capture Sensor Interface 1 Reset Enable Bit (Write Protect) - * | | |0 = Video Capture sensor interface 1 reset Disabled. - * | | |1 = Video Capture sensor interface 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[12] |GFXRST |Graphic Engine Reset Enable Bit (Write Protect) - * | | |0 = Graphic Engine reset Disabled. - * | | |1 = Graphic Engine reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[13] |VDECRST |Video Decoder Reset Enable Bit (Write Protect) - * | | |0 = Video Decoder (H.264/JPEG) reset Disabled. - * | | |1 = Video Decoder (H.264/JPEG) reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[14] |WRHO0RST |Wormhole 0 Reset Enable Bit (Write Protect) - * | | |0 = Wormhole 0 reset Disabled. - * | | |1 = Wormhole 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[15] |WRHO1RST |Wormhole 1 Reset Enable Bit (Write Protect) - * | | |0 = Wormhole 1 reset Disabled. - * | | |1 = Wormhole 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[16] |GMAC0RST |Gigabit Ethernet MAC 0 Reset Enable Bit (Write Protect) - * | | |0 = Gigabit Ethernet MAC 0 reset Disabled. - * | | |1 = Gigabit Ethernet MAC 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[17] |GMAC1RST |Gigabit Ethernet MAC 1 Reset Enable Bit (Write Protect) - * | | |0 = Gigabit Ethernet MAC 1 reset Disabled. - * | | |1 = Gigabit Ethernet MAC 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[18] |HWSEMRST |Hardware Semaphore Reset Enable Bit (Write Protect) - * | | |0 = Hardware Semaphore reset Disabled. - * | | |1 = Hardware Semaphore reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[19] |EBIRST |EBI Controller Reset (Write Protect) - * | | |0 = EBI controller reset Disabled. - * | | |1 = EBI controller reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[20] |HSUSBH0RST|High-speed USB Host Controller 0 Reset Enable Bit (Write Protect) - * | | |0 = High-Speed USB host controller 0 reset Disabled. - * | | |1 = High-Speed USB host controller 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[21] |HSUSBH1RST|High-speed USB Host Controller 1 Reset Enable Bit (Write Protect) - * | | |0 = High-Speed USB host controller 1 reset Disabled. - * | | |1 = High-Speed USB host controller 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[22] |HSUSBDRST |High-speed USB Device Controller Reset Enable Bit (Write Protect) - * | | |0 = High-Speed USB device controller reset Disabled. - * | | |1 = High-Speed USB device controller reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[24] |SDH0RST |SDIO Controller 0 Reset Enable Bit (Write Protect) - * | | |0 = SDIO controller 0 reset Disabled. - * | | |1 = SDIO controller 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[25] |SDH1RST |SDIO Controller 1 Reset Enable Bit (Write Protect) - * | | |0 = SDIO controller 1 reset Disabled. - * | | |1 = SDIO controller 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[26] |NANDRST |NAND Flash Controller Reset Enable Bit (Write Protect) - * | | |0 = NAND Flash controller reset Disabled. - * | | |1 = NAND Flash controller reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[27] |GPIORST |GPIO Reset Enable Bit (Write Protect) - * | | |0 = GPIO reset Disabled. - * | | |1 = GPIO reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[28] |MCTLPRST |DDR Memory Controller MCTL2 APB Interface Reset Enable Bit (Write Protect) - * | | |Write 1 to enable MCTL2 APB reset to reset APB interface logic of MCTL2. - * | | |Write 0 to trigger a reset disable procedure and this bit cleared automatically after 128 pclk. - * | | |0 = DDR Memory Controller MCTL2 APB interface reset Disabled. - * | | |1 = DDR Memory Controller MCTL2 APB interface reset Enabled. - * | | |Note 1: Once trigger reset disable procedure, it's necessary to poll MCTLPRST till its 0. - * | | |Note 2: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[29] |MCTLCRST |DDR Memory Controller MCTL2 Core Reset Enable Bit (Write Protect) - * | | |0 = DDR Memory Controller MCTL2 core reset Disabled. - * | | |1 = DDR Memory Controller MCTL2 core reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[30] |DDRPUBRST |DDR PHY PUB Reset Enable Bit (Write Protect) - * | | |0 = DDR PHY PUB reset Disabled. - * | | |1 = DDR PHY PUB reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * @var SYS_T::IPRST1 - * Offset: 0x24 Reset Control Register 1 (Shared) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |TMR0RST |TIMER 0 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 0 reset Disabled. - * | | |1 = TIMER 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[3] |TMR1RST |TIMER 1 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 1 reset Disabled. - * | | |1 = TIMER 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[4] |TMR2RST |TIMER 2 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 2 reset Disabled. - * | | |1 = TIMER 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[5] |TMR3RST |TIMER 3 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 3 reset Disabled. - * | | |1 = TIMER 3 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[8] |I2C0RST |I2C 0 Reset Enable Bit (Write Protect) - * | | |0 = I2C 0 reset Disabled. - * | | |1 = I2C 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[9] |I2C1RST |I2C 1 Reset Enable Bit (Write Protect) - * | | |0 = I2C 1 reset Disabled. - * | | |1 = I2C 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[10] |I2C2RST |I2C 2 Reset Enable Bit (Write Protect) - * | | |0 = I2C 2 reset Disabled. - * | | |1 = I2C 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[11] |I2C3RST |I2C 3 Reset Enable Bit (Write Protect) - * | | |0 = I2C 3 reset Disabled. - * | | |1 = I2C 3 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[12] |QSPI0RST |QSPI 0 Reset Enable Bit (Write Protect) - * | | |0 = QSPI 0 reset Disabled. - * | | |1 = QSPI 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[13] |SPI0RST |SPI 0 Reset Enable Bit (Write Protect) - * | | |0 = SPI 0 reset Disabled. - * | | |1 = SPI 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[14] |SPI1RST |SPI 1 Reset Enable Bit (Write Protect) - * | | |0 = SPI 1 reset Disabled. - * | | |1 = SPI 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[15] |SPI2RST |SPI 2 Reset Enable Bit (Write Protect) - * | | |0 = SPI 2 reset Disabled. - * | | |1 = SPI 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[16] |UART0RST |UART 0 Reset Enable Bit (Write Protect) - * | | |0 = UART 0 reset Disabled. - * | | |1 = UART 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[17] |UART1RST |UART 1 Reset Enable Bit (Write Protect) - * | | |0 = UART 1 reset Disabled. - * | | |1 = UART 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[18] |UART2RST |UART 2 Reset Enable Bit (Write Protect) - * | | |0 = UART 2 reset Disabled. - * | | |1 = UART 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[19] |UART3RST |UART 3 Reset Enable Bit (Write Protect) - * | | |0 = UART 3 reset Disabled. - * | | |1 = UART 3 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[20] |UART4RST |UART 4 Reset Enable Bit (Write Protect) - * | | |0 = UART 4 reset Disabled. - * | | |1 = UART 4 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[21] |UART5RST |UART 5 Reset Enable Bit (Write Protect) - * | | |0 = UART 5 reset Disabled. - * | | |1 = UART 5 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[22] |UART6RST |UART 6 Reset Enable Bit (Write Protect) - * | | |0 = UART 6 reset Disabled. - * | | |1 = UART 6 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[23] |UART7RST |UART 7 Reset Enable Bit (Write Protect) - * | | |0 = UART 7 reset Disabled. - * | | |1 = UART 7 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[24] |CANFD0RST |CAN FD 1 Reset Enable Bit (Write Protect) - * | | |0 = CAN FD 1 reset Disabled. - * | | |1 = CAN FD 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[25] |CANFD1RST |CAN FD 1 Reset Enable Bit (Write Protect) - * | | |0 = CAN FD 1 reset Disabled. - * | | |1 = CAN FD 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[28] |EADC0RST |EADC 0 Reset Enable Bit (Write Protect) - * | | |0 = EADC 0 reset Disabled. - * | | |1 = EADC 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[29] |I2S0RST |I2S 0 Reset Enable Bit (Write Protect) - * | | |0 = I2S 0 reset Disabled. - * | | |1 = I2S 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * @var SYS_T::IPRST2 - * Offset: 0x28 Reset Control Register 2 (Shared) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SC0RST |SC 0 Reset Enable Bit (Write Protect) - * | | |0 = SC 0 reset Disabled. - * | | |1 = SC 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[1] |SC1RST |SC 1 Reset Enable Bit (Write Protect) - * | | |0 = SC 1 reset Disabled. - * | | |1 = SC 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[4] |QSPI1RST |QSPI 1 Reset Enable Bit (Write Protect) - * | | |0 = QSPI 1 reset Disabled. - * | | |1 = QSPI 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[6] |SPI3RST |SPI 3 Reset Enable Bit (Write Protect) - * | | |0 = SPI 3 reset Disabled. - * | | |1 = SPI 3 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[16] |EPWM0RST |EPWM 0 Reset Enable Bit (Write Protect) - * | | |0 = EPWM 0 reset Disabled. - * | | |1 = EPWM 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[17] |EPWM1RST |EPWM 1 Reset Enable Bit (Write Protect) - * | | |0 = EPWM 1 reset Disabled. - * | | |1 = EPWM 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[22] |QEI0RST |QEI 0 Reset Enable Bit (Write Protect) - * | | |0 = QEI 0 reset Disabled. - * | | |1 = QEI 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[23] |QEI1RST |QEI 1 Reset Enable Bit (Write Protect) - * | | |0 = QEI 1 reset Disabled. - * | | |1 = QEI 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[26] |ECAP0RST |ECAP 0 Reset Enable Bit (Write Protect) - * | | |0 = ECAP 0 reset Disabled. - * | | |1 = ECAP 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[27] |ECAP1RST |ECAP 1 Reset Enable Bit (Write Protect) - * | | |0 = ECAP 1 reset Disabled. - * | | |1 = ECAP 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[28] |CANFD2RST |CAN FD 2 Reset Enable Bit (Write Protect) - * | | |0 = CAN FD 2 reset Disabled. - * | | |1 = CAN FD 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[31] |ADC0RST |ADC 0 Reset Enable Bit (Write Protect) - * | | |0 = ADC 0 reset Disabled. - * | | |1 = ADC 0 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * @var SYS_T::IPRST3 - * Offset: 0x2C Reset Control Register 3 (Shared) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TMR4RST |TIMER 4 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 4 reset Disabled. - * | | |1 = TIMER 4 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[1] |TMR5RST |TIMER 5 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 5 reset Disabled. - * | | |1 = TIMER 5 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[2] |TMR6RST |TIMER 6 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 6 reset Disabled. - * | | |1 = TIMER 6 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[3] |TMR7RST |TIMER 7 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 7 reset Disabled. - * | | |1 = TIMER 7 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[4] |TMR8RST |TIMER 8 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 8 reset Disabled. - * | | |1 = TIMER 8 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[5] |TMR9RST |TIMER 9 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 9 reset Disabled. - * | | |1 = TIMER 9 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[6] |TMR10RST |TIMER 10 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 10 reset Disabled. - * | | |1 = TIMER 10 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[7] |TMR11RST |TIMER 11 Reset Enable Bit (Write Protect) - * | | |0 = TIMER 11 reset Disabled. - * | | |1 = TIMER 11 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[8] |UART8RST |UART 8 Reset Enable Bit (Write Protect) - * | | |0 = UART 8 reset Disabled. - * | | |1 = UART 8 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[9] |UART9RST |UART 9 Reset Enable Bit (Write Protect) - * | | |0 = UART 9 reset Disabled. - * | | |1 = UART 9 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[10] |UART10RST |UART 10 Reset Enable Bit (Write Protect) - * | | |0 = UART 10 reset Disabled. - * | | |1 = UART 10 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[11] |UART11RST |UART 11 Reset Enable Bit (Write Protect) - * | | |0 = UART 11 reset Disabled. - * | | |1 = UART 11 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[12] |UART12RST |UART 12 Reset Enable Bit (Write Protect) - * | | |0 = UART 12 reset Disabled. - * | | |1 = UART 12 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[13] |UART13RST |UART 13 Reset Enable Bit (Write Protect) - * | | |0 = UART 13 reset Disabled. - * | | |1 = UART 13 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[14] |UART14RST |UART 14 Reset Enable Bit (Write Protect) - * | | |0 = UART 14 reset Disabled. - * | | |1 = UART 14 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[15] |UART15RST |UART 15 Reset Enable Bit (Write Protect) - * | | |0 = UART 15 reset Disabled. - * | | |1 = UART 15 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[16] |UART16RST |UART 16 Reset Enable Bit (Write Protect) - * | | |0 = UART 16 reset Disabled. - * | | |1 = UART 16 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[17] |I2S1RST |I2S 1 Reset Enable Bit (Write Protect) - * | | |0 = I2S 1 reset Disabled. - * | | |1 = I2S 1 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[18] |I2C4RST |I2C 4 Reset Enable Bit (Write Protect) - * | | |0 = I2C 4 reset Disabled. - * | | |1 = I2C 4reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[19] |I2C5RST |I2C 5 Reset Enable Bit (Write Protect) - * | | |0 = I2C 5 reset Disabled. - * | | |1 = I2C 5 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[20] |EPWM2RST |EPWM 2 Reset Enable Bit (Write Protect) - * | | |0 = EPWM 2 reset Disabled. - * | | |1 = EPWM 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[21] |ECAP2RST |ECAP 2 Reset Enable Bit (Write Protect) - * | | |0 = ECAP 2 reset Disabled. - * | | |1 = ECAP 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[22] |QEI2RST |QEI 2 Reset Enable Bit (Write Protect) - * | | |0 = QEI 2 reset Disabled. - * | | |1 = QEI 2 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[23] |CANFD3RST |CAN FD 3 Reset Enable Bit (Write Protect) - * | | |0 = CAN FD 3 reset Disabled. - * | | |1 = CAN FD 3 reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[24] |KPIRST |KPI Reset Enable Bit (Write Protect) - * | | |0 = KPI reset Disabled. - * | | |1 = KPI reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[28] |GICRST |GIC Reset Enable Bit (Write Protect) - * | | |0 = GIC reset Disabled. - * | | |1 = GIC reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[30] |SSMCCRST |SSMCC Reset Enable Bit (Write Protect) - * | | |0 = SSMCC reset Disabled. - * | | |1 = SSMCC reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[31] |SSPCCRST |SSPCC Reset Enable Bit (Write Protect) - * | | |0 = SSPCC reset Disabled. - * | | |1 = SSPCC reset Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * @var SYS_T::PMUCR - * Offset: 0x30 Power Management Unit Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |A35PGEN |Cortex-A35 Power Gating Enable (Write Protect) - * | | |0 = Cortex-A35 dual core power gating Disabled. - * | | |1 = Cortex-A35 dual core power gating Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[4] |AUTOL2FDIS|Automatic L2 Cache Flush Disable (Write Protect) - * | | |0 = Automatic L2 cache flush Enabled. - * | | |1 = Automatic L2 cache flush Disabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[6] |PDWKDLY |Wake-up Delay Counter Enable Bit (Write Protect) - * | | |When the Cortex-A35 wakes up from Power-down mode, the clock control will delay certain clock cycles to wait system clock stable. - * | | |The delayed clock cycle is 4096 clock cycles when chip works at 24 Mhz external high speed crystal oscillator (HXT), and 256 clock cycles when chip works at 12 MHz internal high speed RC oscillator (HIRC). - * | | |0 = Wake-up delay counter Disabled. - * | | |1 = Wake-up delay counter Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[11:8] |PWRSTBTM |Power Gating Acknowledgement Stable Time (Write Protect) - * | | |The PWRSTBTM indicates the stable time after receiving power gating acknowledgement. - * | | |0000 = 5us (Default). - * | | |0001 = 10us. - * | | |0010 = 20us. - * | | |0011 = 40us. - * | | |0100 = 60us. - * | | |0101 = 80us. - * | | |0110 = 100us. - * | | |0111 = 200us. - * | | |1000 = 400us. - * | | |1001 = 600us. - * | | |1010 = 800us. - * | | |1011 = 1ms. - * | | |1100 = 2ms. - * | | |1101 = 4ms. - * | | |1110 = 5.4ms. - * | | |1111 = 0us. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[15:12] |PWRACKTO |Power Gating Acknowledgement Time Out Selection (Write Protect) - * | | |0000 = 20us (Default). - * | | |0001 = 30us. - * | | |0010 = 40us. - * | | |0011 = 50us. - * | | |0100 = 60us. - * | | |0101 = 80us. - * | | |0110 = 100us. - * | | |0111 = 200us. - * | | |1000 = 400us. - * | | |1001 = 600us. - * | | |1010 = 800us. - * | | |1011 = 1ms. - * | | |1100 = 2ms. - * | | |1101 = 4ms. - * | | |1110 = 5.4ms. - * | | |1111 = 0us. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[16] |A35PDEN |Cortex-A35 Power Down Enable Bit (Write Protect) - * | | |When this bit is set to 1, Power-down mode is enabled and the chip keeps active till the CPU sleep mode is also active and then the chip enters Power-down mode. - * | | |When chip wakes up from Power-down mode, this bit is auto cleared - * | | |Users need to set this bit again for next Power-down. - * | | |In Power-down mode, HXT, HIRC, HIRC48, PLL and system clock will be disabled and ignored the clock source selection - * | | |The clocks of peripheral are not controlled by Power-down mode, if the peripheral clock source is from LXT or LIRC. - * | | |0 = Chip operating normally or chip in idle mode because of WFI command. - * | | |1 = Chip waits CPU sleep command WFI and then enters Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[18] |A35DBPDEN |Cortex-A35 Entering Power-down Even ICE Connected (Write Protect) - * | | |0 = Cortex-A35 does not enter Power-down during Debug mode. - * | | |1 = Cortex-A35 enters power-down in Debug mode. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[24] |RTPPDEN |RTP M4 Power Down Enable (Write Protect) - * | | |When this bit is set to 1, Power-down mode is enabled and the chip keeps active till the CPU sleep mode is also active and then the chip enters Power-down mode. - * | | |When chip wakes up from Power-down mode, this bit is auto cleared - * | | |Users need to set this bit again for next Power-down. - * | | |In Power-down mode, HXT, HIRC, HIRC48, PLL and system clock will be disabled and ignored the clock source selection - * | | |The clocks of peripheral are not controlled by Power-down mode, if the peripheral clock source is from LXT or LIRC. - * | | |0 = Chip operating normally or chip in idle mode because of WFI command. - * | | |1 = Chip waits CPU sleep command WFI and then enters Power-down mode. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[26] |RTPDBPDEN |RTP M4 Entering Power-down Even ICE Connected (Write Protect) - * | | |0 = RTP M4 does not enter Power-down during Debug mode. - * | | |1 = RTP M4 enters power-down in Debug mode. - * | | |Note: This bit is write protected. Refer to the SYS_RLKSUBM register. - * @var SYS_T::DDRCQCSR - * Offset: 0x34 DDR Controller Q Channel Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |AXIQBYPAS |DDR Controller AXI Port 7 ~ Port 0 Q Channel Handshake Bypass (Write Protect) - * | | |The AXIQBYPAS indicates to bypass DDR controller's AXI port Q channel handshake mechanism - * | | |The each bit of AXIQBYPAS is for corresponding AXI port of DDR controller. - * | | |AXIQBYPAS[x] - * | | |0 = Q channel handshake mechanism of AXI port x Not Bypassed (x=0, 1, ?? 7). - * | | |1 = Q channel handshake mechanism of AXI port x Bypassed (x=0, 1, ?? 7). - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[15:8] |AXIQDENYIF|DDR Controller AXI Port 7 ~ Port 0 Q Channel Interrupt Flag - * | | |0 = Q channel power down request accept by DDR controller AXI port x (x=0, 1, ?? 7). - * | | |1 = Q channel power down request reject by DDR controller AXI port x, AXI port x wouldn't enter low power mode and clock of AXI port x keep clocking (x=0, 1, ?? 7). - * |[16] |DDRCQBYPAS|DDR Controller Core Q Channel Handshake Bypass (Write Protect) - * | | |0 = Q channel handshake of DDR controller core Not Bypassed. - * | | |1 = Q channel handshake of DDR controller core Bypassed. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[17] |DDRCQDENYIF|DDR Controller Core Q Channel Deny Interrupt Flag - * | | |0 = Q channel power down request accept by DDR controller core. - * | | |1 = Q channel power down request reject by DDR controller core and DDR controller wouldn't enter self-refresh mode. - * |[27:24] |DDRQREQDLY|DDR Controller Q Channel Request Delay Time Selection (Write Protect) - * | | |0000 = 20us (Default). - * | | |0001 = 30us. - * | | |0010 = 40us. - * | | |0011 = 50us. - * | | |0100 = 60us. - * | | |0101 = 80us. - * | | |0110 = 100us. - * | | |0111 = 200us. - * | | |1000 = 400us. - * | | |1001 = 600us. - * | | |1010 = 800us. - * | | |1011 = 1ms. - * | | |1100 = 2ms. - * | | |1101 = 3ms. - * | | |1110 = 5.4ms. - * | | |1111 = 0us. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[31:28] |DDRQACKTO |DDR Controller Q Channel Acknowledgement Time Out Selection (Write Protect) - * | | |0000 = 20us (Default). - * | | |0001 = 30us. - * | | |0010 = 40us. - * | | |0011 = 50us. - * | | |0100 = 60us. - * | | |0101 = 80us. - * | | |0110 = 100us. - * | | |0111 = 200us. - * | | |1000 = 400us. - * | | |1001 = 600us. - * | | |1010 = 800us. - * | | |1011 = 1ms. - * | | |1100 = 2ms. - * | | |1101 = 3ms. - * | | |1110 = 5.4ms. - * | | |1111 = 0us. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * @var SYS_T::PMUIEN - * Offset: 0x38 Power Management Unit Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PMUIEN |PMU Interrupt Enable Control Bit (Write Protect) - * | | |0 = PMU interrupt Disabled. - * | | |1 = PMU interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[8] |A35PDWKIEN|Cortex-A35 Power-down Wake-up Interrupt Enable Control Bit (Write Protect) - * | | |0 = Cortex-a35 wake-up interrupt Disabled. - * | | |1 = Cortex-a35 wake-up interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKTZS register. - * |[12] |RTPPDWKIEN|RTP M4 Power-down Wake-up Interrupt Enable Control Bit (Write Protect) - * | | |0 = RTP M4 wake-up interrupt Disabled. - * | | |1 = RTP M4 wake-up interrupt Enabled. - * | | |Note: This bit is write protected. Refer to the SYS_RLKSUBM register. - * @var SYS_T::PMUSTS - * Offset: 0x3C Power Management Unit Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PMUIF |PMU Interrupt Flag - * | | |When PMUIEN high, this bit high to indicate that PGTOIF, DDRCQDENYIF or AXIQDENYIF is active - * | | |When PMUIEN low, this bit didn't take effect. - * | | |0 = PGTOIF, DDRCQDENYIF and AXIQDENYIF are not active. - * | | |1 = PGTOIF, DDRCQDENYIF or AXIQDENYIF is active. - * |[1] |PGTOIF |Power Gating Time Out Interrupt Flag - * | | |0 = Power gating acknowledgement counter is not time-out yet. - * | | |1 = Power gating acknowledgement counter is time-out. - * |[5] |L2FDONE |Cortex-A35 L2 Cache Flush Done Status - * | | |0 = Cortex-A35 L2 cache flush didn't finish yet. - * | | |1 = Cortex-A35 L2 cache flush done. - * |[8] |A35PDWKIF |Cortex-A35 Power-down Wake-up Interrupt Flag - * | | |0 = Cortex-A35 didn't wake-up from power-down mode. - * | | |1 = Cortex-A35 receive a wake-up event and wake-up from power-down mode. - * |[12] |RTPPDWKIF |RTP M4 Power-down Wake-up Interrupt Flag - * | | |0 = RTP M4 didn't wake-up from power-down mode. - * | | |1 = RTP M4 receive a wake-up event and wake-up from power-down mode. - * |[31:16] |PWRACKCNT |Power Gating Acknowledgement Timing Counter Value - * | | |The PWRACKCNT show the value of power gating acknowledgement time-out counter. - * @var SYS_T::CA35WRBADR0 - * Offset: 0x40 Cortexu00AE-A35 Core 0 Warm-boot Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WRMBTADDR |Warm Boot Address - * | | |The WRMBTADDR indicates the warm boot run address for Cortex-A35 Core 0. - * @var SYS_T::CA35WRBPAR0 - * Offset: 0x44 Cortexu00AE-A35 Core 0 Warm-boot Parameter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WRMBTPARA |Warm Boot Parameter - * | | |The WRMBTPARA indicates the warm boot parameters for Cortex-A35 Core 0. - * @var SYS_T::CA35WRBADR1 - * Offset: 0x48 Cortexu00AE-A35 Core 1 Warm-boot Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WRMBTADDR |Warm Boot Address - * | | |The WRMBTADDR indicates the warm boot run address for Cortex-A35 Core 1. - * @var SYS_T::CA35WRBPAR1 - * Offset: 0x4C Cortexu00AE-A35 Core 1 Warm-boot Parameter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WRMBTPARA |Warm Boot Parameter - * | | |The WRMBTPARA indicates the warm boot parameters for Cortex-A35 Core 1. - * @var SYS_T::USBPMISCR - * Offset: 0x60 USB PHY Miscellaneous Control Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PHY0POR |USB 2.0 Port 0 High-speed PHY Power-On Reset Control Bit - * | | |0 = All test registers and state machines in the USB 2.0 port 0 high-speed PHY are not in reset state. - * | | |1 = All test registers and state machines in the USB 2.0 port 0 high-speed PHY are in reset state. - * |[1] |PHY0SUSPEND|USB 2.0 Port 0 High-speed PHY Suspend Control Bit - * | | |0 = USB 2.0 port 0 high-speed PHY is in Suspend mode. - * | | |1 = USB 2.0 port 0 high-speed PHY is in Normal operating mode. - * |[2] |PHY0COMN |USB 2.0 Port 0 High-speed PHY Common Block Power-Down Control Bit - * | | |0 = In Suspend or Sleep modes, the REFCLK_LOGIC, Bias and PLL blocks of USB 2.0 port 0 high-speed PHY remain powered - * | | |With this setting, the input reference clock must remain on and valid during suspend or sleep. - * | | |1 = In Suspend mode, the REFCLK_LOGIC, Bias and PLL blocks of USB 2.0 port 0 high-speed PHY are powered down - * | | |In Sleep mode, the Bias and PLL blocks of USB 2.0 port 0 high-speed PHY are powered down. - * |[6:4] |VBUSDGSEL |VBUS Detect De-glitch Time Select - * | | |000 = Without de-glitch function. - * | | |001 = 4 HIRC clock. - * | | |010 = 8 HIRC clock. - * | | |011 = 16 HIRC clock. - * | | |100 = 32 HIRC clock. - * | | |101 = 64 HIRC clock. - * | | |110 = 128 HIRC clock. - * | | |111 = 256 HIRC clock. - * |[7] |EFUSESEL0 |USB 2.0 Port 0 High-speed PHY Resistor Calibration with External Resistor Control Bit - * | | |0 = An external resistor (REXT) is needed and internal digital calibration code is based on REXT. - * | | |1 = Enable the internal resistor method with RCALCODE1 resistance control up to +/- 18%, allowing the removal of the REXT resistor. - * |[8] |PHY0HSTCKSTB|USB 2.0 Port 0 High-speed PHY 60 MHz UTMI Interface Clock for Host Stable Flag - * | | |0 = USB 2.0 port 0 high-speed PHY UTMI Interface clock for Host is not stable. - * | | |1 = USB 2.0 port 0 high-speed PHY UTMI Interface clock for Host is stable. - * |[9] |PHY0CK12MSTB|USB 2.0 Port 0 High-speed PHY 12 MHz Clock Stable Flag - * | | |0 = USB 2.0 port 0 high-speed PHY 12 MHz clock is not stable. - * | | |1 = USB 2.0 port 0 high-speed PHY 12 MHz clock is stable. - * |[10] |PHY0DEVCKSTB|USB 2.0 Port 0 High-speed PHY 60 MHz UTMI Interface Clock for Device Stable Flag - * | | |0 = USB 2.0 port 0 high-speed PHY UTMI Interface clock for Device is not stable. - * | | |1 = USB 2.0 port 0 high-speed PHY UTMI Interface clock for Device is stable. - * |[11] |RTUNESEL0 |USB 2.0 Port 0 High-speed PHY Source Impedance Tuning Method Selection - * | | |0 = Internal digital calibration codes are used for tuning the high-speed source impedance. - * | | |1 = The RCALCODE0 value is used for tuning the high-speed source impedance. - * |[15:12] |RCALCODE0 |USB 2.0 Port 0 High-Speed PHY Internal Resistor Trim Code - * | | |If RTUNESEL0 = 1, RCALCODE0 provides the tuning code for high-speed source impedance directly. - * | | |If RTUNESEL0 = 0, RCALCODE0 provides the tuning code for on-chip resistor within +/- 18% resistance tuning range. - * | | |0000 = +18% (236 u03A9). - * | | |0001 = +15.6%. - * | | |0010 = +13.2%. - * | | |0011 = +10.8%. - * | | |0100 = +8.4%. - * | | |0101 = +6%. - * | | |0110 = +3.6%. - * | | |0111 = +1.2%. - * | | |1000 = -1.2%. - * | | |1001 = -3.6%. - * | | |1010 = -6%. - * | | |1011 = -8.4%. - * | | |1100 = -10.8%. - * | | |1101 = -13.2%. - * | | |1110 = -15.6%. - * | | |1111 = -18% (164 u03A9). - * |[16] |PHY1POR |USB 2.0 Port 1 High-speed PHY Power-On Reset Control Bit - * | | |0 = All test registers and state machines in the USB 2.0 port 1 high-speed PHY are not in reset state. - * | | |1 = All test registers and state machines in the USB 2.0 port 1 high-speed PHY are in reset state. - * |[17] |PHY1SUSPEND|USB 2.0 Port 1 High-speed PHY Suspend Control Bit - * | | |0 = USB 2.0 port 1 high-speed PHY is in Suspend mode. - * | | |1 = USB 2.0 port 1 high-speed PHY is in Normal operating mode. - * |[18] |PHY1COMN |USB 2.0 Port 1 High-speed PHY Common Block Power-Down Control Bit - * | | |0 = In Suspend or Sleep modes, the REFCLK_LOGIC, Bias and PLL blocks of USB 2.0 port 1 high-speed PHY remain powered - * | | |With this setting, the input reference clock must remain on and valid during suspend or sleep. - * | | |1 = In Suspend mode, the REFCLK_LOGIC, Bias and PLL blocks of USB 2.0 port 1 high-speed PHY are powered down - * | | |In Sleep mode, the Bias and PLL blocks of USB 2.0 port 1 high-speed PHY are powered down. - * |[23] |EFUSESEL1 |USB 2.0 Port 1 High-speed PHY Resistor Calibration with External Resistor Control Bit - * | | |0 = An external resistor (REXT) is needed and internal digital calibration code is based on REXT. - * | | |1 = Enable the internal resistor method with RCALCODE1 resistance control up to +/- 18%, allowing the removal of the REXT resistor. - * |[24] |PHY1HSTCKSTB|USB 2.0 Port 1 High-speed PHY 60 MHz UTMI Interface Clock for Host Stable Flag - * | | |0 = USB 2.0 port 1 high-speed PHY UTMI Interface clock for Host is not stable. - * | | |1 = USB 2.0 port 1 high-speed PHY UTMI Interface clock for Host is stable. - * |[25] |PHY1CK12MSTB|USB 2.0 Port 1 High-speed PHY 12 MHz Clock Stable Flag - * | | |0 = USB 2.0 port 1 high-speed PHY 12 MHz clock is not stable. - * | | |1 = USB 2.0 port 1 high-speed PHY 12 MHz clock is stable. - * |[27] |RTUNESEL1 |USB 2.0 Port 1 High-speed PHY Source Impedance Tuning Method Selection - * | | |0 = Internal digital calibration codes are used for tuning the high-speed source impedance. - * | | |1 = The RCALCODE1 value is used for tuning the high-speed source impedance. - * |[31:28] |RCALCODE1 |USB 2.0 Port 1 High-Speed PHY Internal Resistor Trim Code - * | | |If RTUNESEL1 = 1, RCALCODE1 provides the tuning code for high-speed source impedance directly. - * | | |If RTUNESEL1 = 0, RCALCODE1 provides the tuning code for on-chip resistor within +/- 18% resistance tuning range. - * | | |0000 = +18% (236 u03A9). - * | | |0001 = +15.6%. - * | | |0010 = +13.2%. - * | | |0011 = +10.8%. - * | | |0100 = +8.4%. - * | | |0101 = +6%. - * | | |0110 = +3.6%. - * | | |0111 = +1.2%. - * | | |1000 = -1.2%. - * | | |1001 = -3.6%. - * | | |1010 = -6%. - * | | |1011 = -8.4%. - * | | |1100 = -10.8%. - * | | |1101 = -13.2%. - * | | |1110 = -15.6%. - * | | |1111 = -18% (164 u03A9). - * @var SYS_T::USBP0PCR - * Offset: 0x64 USB Port 0 PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |COMPDISTUNE|USB 2.0 High-speed Disconnect Threshold Adjustment - * | | |The SQRXTUNE adjusts the voltage level for the threshold used to detect a disconnect event at the host. - * | | |000 = -5.48%. - * | | |001 = 0. (Default) - * | | |010 = +6.04%. - * | | |011 = +12.75%. - * | | |100 = +19.66%. - * | | |101 = +28.24%. - * | | |110 = +38.31%. - * | | |111 = +50.28%. - * |[3] |EQBYPASSENB|USB 2.0 High-speed PHY Squelch Equalizer Bypass Control Bit - * | | |0 = Equalizer is Enabled. - * | | |1 = Equalizer is bypassed and acts as a simple differential input amplifier. - * |[6:4] |SQRXTUNE |USB 2.0 High-speed PHY Squelch Threshold Adjustment - * | | |The SQRXTUNE adjusts the voltage level for the threshold used to detect valid high-speed data. - * | | |000 = +15.5%. - * | | |001 = +10.87%. - * | | |010 = +5.86%. - * | | |011 = 0 (Default). - * | | |100 = -5.86%. - * | | |101 = -13.33%. - * | | |110 = -21.56%. - * | | |111 = -31.54%. - * |[7] |TXPREEMPPULSETUNE|USB 2.0 High-speed PHY Squelch Equalizer Bypass Control Bit - * | | |0 = Equalizer is Enabled. - * | | |1 = Equalizer is bypassed and acts as a simple differential input amplifier. - * |[11:8] |PLLPTUNE |USB 2.0 High-speed PHY PLL Proportional Path Tune - * | | |The value of PLLPTUNE should be keep in default. - * | | |0000 = 4.0x. - * | | |0001 = 4.5x. - * | | |0010 = 5.0x. - * | | |0011 = 5.5x. - * | | |0100 = 6.0x. - * | | |0101 = 6.5x. - * | | |0110 = 7.0x. - * | | |0111 = 7.5x. - * | | |1000 = 8.0x. - * | | |1001 = 8.5x. - * | | |1010 = 9.0x. - * | | |1011 = 9.5x. - * | | |1100 = 10.0x (Default). - * | | |1101 = 10.5x. - * | | |1110 = 11.0x. - * | | |1111 = 11.5x. - * |[15:12] |TXFSLSTUNE|USB 2.0 High-speed PHY FS/LS Source Impedance Adjustment - * | | |The TXFSLSTUNE adjusts the low- and full-speed single-ended source impedance while driving high. - * | | |0000 = +14.2%. - * | | |0001 = +6.60% - * | | |0011 = 0 (Default). - * | | |0111 = -5.48% - * | | |1111 = -10.29% - * |[17:16] |PLLITUNE |USB 2.0 High-speed PHY Integral Path Tune - * | | |The value of PLLITUNE should be keep in default. - * | | |00 = 1.0x (Default). - * | | |01 = 2.0x - * | | |10 = 3.0x - * | | |11 = 4.0x - * |[21:20] |TXPREEMPAMPTUNE|USB 2.0 High-speed PHY HS Transmitter Pre-Emphasis Current Control - * | | |00 = HS Transmitter pre-emphasis is disabled. (Default) - * | | |01 = HS Transmitter pre-emphasis circuit sources 1x pre-emphasis current. - * | | |10 = HS Transmitter pre-emphasis circuit sources 2x pre-emphasis current. - * | | |11 = HS Transmitter pre-emphasis circuit sources 3x pre-emphasis current. - * |[23:22] |TXRISETUNE|USB 2.0 High-speed PHY HS Transmitter Rise/Fall Time Adjustment - * | | |The TXRISETUNE adjusts the rise/fall times of the high-speed waveform. - * | | |00 = +7.34%. - * | | |01 = 0 (Default) - * | | |10 = -5.98%. - * | | |11 = -7.49% - * |[27:24] |TXVREFTUNE|USB 2.0 High-speed PHY HS DC Voltage Level Adjustment - * | | |The TXVREFTUNE adjusts the high-speed DC level voltage. - * | | |0000 = -9.37%. - * | | |0001 = -6.24%. - * | | |0010 = -3.12%. - * | | |0011 = 0 (Default) - * | | |0100 = +2.75%. - * | | |0101 = +5.87%. - * | | |0110 = +8.99%. - * | | |0111 = +12.11%. - * | | |1000 = +14.71%. - * | | |1001 = +17.82%. - * | | |1010 = +20.94%. - * | | |1011 = +24.06%. - * | | |1100 = +26.81%. - * | | |1101 = +29.94%. - * | | |1110 = +33.06%. - * | | |1111 = +36.18%. - * |[29:28] |TXHSXVTUNE|USB 2.0 High-speed PHY Transmitter High-Speed Crossover Adjustment - * | | |The TXHSXVTUNE adjusts the voltage at which the DP and DM signals cross while transmitting in HS mode. - * | | |00 = Reserved - * | | |01 = -9.16mV - * | | |10 = +9.42mV - * | | |11 = 0 (Default) - * |[31:30] |TXRESTUNE |USB 2.0 High-speed PHY USB Source Impedance Adjustment - * | | |00 = Source Impedance is increased by approximately 3.03 u03A9 - * | | |01 = 0 (Default) - * | | |10 = Source Impedance is increased by approximately 2.11 u03A9 - * | | |11 = Source Impedance is increased by approximately 4.51 u03A9 - * @var SYS_T::USBP1PCR - * Offset: 0x68 USB Port 1 PHY Control Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |COMPDISTUNE|USB 2.0 High-speed Disconnect Threshold Adjustment - * | | |The SQRXTUNE adjusts the voltage level for the threshold used to detect a disconnect event at the host. - * | | |000 = -5.48%. - * | | |001 = 0. (Default) - * | | |010 = +6.04%. - * | | |011 = +12.75%. - * | | |100 = +19.66%. - * | | |101 = +28.24%. - * | | |110 = +38.31%. - * | | |111 = +50.28%. - * |[3] |EQBYPASSENB|USB 2.0 High-speed PHY Squelch Equalizer Bypass Control Bit - * | | |0 = Equalizer is Enabled. - * | | |1 = Equalizer is bypassed and acts as a simple differential input amplifier. - * |[6:4] |SQRXTUNE |USB 2.0 High-speed PHY Squelch Threshold Adjustment - * | | |The SQRXTUNE adjusts the voltage level for the threshold used to detect valid high-speed data. - * | | |000 = +15.5%. - * | | |001 = +10.87%. - * | | |010 = +5.86%. - * | | |011 = 0 (Default). - * | | |100 = -5.86%. - * | | |101 = -13.33%. - * | | |110 = -21.56%. - * | | |111 = -31.54%. - * |[7] |TXPREEMPPULSETUNE|USB 2.0 High-speed PHY Squelch Equalizer Bypass Control Bit - * | | |0 = Equalizer is Enabled. - * | | |1 = Equalizer is bypassed and acts as a simple differential input amplifier. - * |[11:8] |PLLPTUNE |USB 2.0 High-speed PHY PLL Proportional Path Tune - * | | |The value of PLLPTUNE should be keep in default. - * | | |0000 = 4.0x. - * | | |0001 = 4.5x. - * | | |0010 = 5.0x. - * | | |0011 = 5.5x. - * | | |0100 = 6.0x. - * | | |0101 = 6.5x. - * | | |0110 = 7.0x. - * | | |0111 = 7.5x. - * | | |1000 = 8.0x. - * | | |1001 = 8.5x. - * | | |1010 = 9.0x. - * | | |1011 = 9.5x. - * | | |1100 = 10.0x (Default). - * | | |1101 = 10.5x. - * | | |1110 = 11.0x. - * | | |1111 = 11.5x. - * |[15:12] |TXFSLSTUNE|USB 2.0 High-speed PHY FS/LS Source Impedance Adjustment - * | | |The TXFSLSTUNE adjusts the low- and full-speed single-ended source impedance while driving high. - * | | |0000 = +14.2%. - * | | |0001 = +6.60% - * | | |0011 = 0 (Default). - * | | |0111 = -5.48% - * | | |1111 = -10.29% - * |[17:16] |PLLITUNE |USB 2.0 High-speed PHY Integral Path Tune - * | | |The value of PLLITUNE should be keep in default. - * | | |00 = 1.0x (Default). - * | | |01 = 2.0x - * | | |10 = 3.0x - * | | |11 = 4.0x - * |[21:20] |TXPREEMPAMPTUNE|USB 2.0 High-speed PHY HS Transmitter Pre-Emphasis Current Control - * | | |00 = HS Transmitter pre-emphasis is disabled. (Default) - * | | |01 = HS Transmitter pre-emphasis circuit sources 1x pre-emphasis current. - * | | |10 = HS Transmitter pre-emphasis circuit sources 2x pre-emphasis current. - * | | |11 = HS Transmitter pre-emphasis circuit sources 3x pre-emphasis current. - * |[23:22] |TXRISETUNE|USB 2.0 High-speed PHY HS Transmitter Rise/Fall Time Adjustment - * | | |The TXRISETUNE adjusts the rise/fall times of the high-speed waveform. - * | | |00 = +7.34%. - * | | |01 = 0 (Default) - * | | |10 = -5.98%. - * | | |11 = -7.49% - * |[27:24] |TXVREFTUNE|USB 2.0 High-speed PHY HS DC Voltage Level Adjustment - * | | |The TXVREFTUNE adjusts the high-speed DC level voltage. - * | | |0000 = -9.37%. - * | | |0001 = -6.24%. - * | | |0010 = -3.12%. - * | | |0011 = 0 (Default) - * | | |0100 = +2.75%. - * | | |0101 = +5.87%. - * | | |0110 = +8.99%. - * | | |0111 = +12.11%. - * | | |1000 = +14.71%. - * | | |1001 = +17.82%. - * | | |1010 = +20.94%. - * | | |1011 = +24.06%. - * | | |1100 = +26.81%. - * | | |1101 = +29.94%. - * | | |1110 = +33.06%. - * | | |1111 = +36.18%. - * |[29:28] |TXHSXVTUNE|USB 2.0 High-speed PHY Transmitter High-Speed Crossover Adjustment - * | | |The TXHSXVTUNE adjusts the voltage at which the DP and DM signals cross while transmitting in HS mode. - * | | |00 = Reserved - * | | |01 = -9.16mV - * | | |10 = +9.42mV - * | | |11 = 0 (Default) - * |[31:30] |TXRESTUNE |USB 2.0 High-speed PHY USB Source Impedance Adjustment - * | | |00 = Source Impedance is increased by approximately 3.03 u03A9 - * | | |01 = 0 (Default) - * | | |10 = Source Impedance is increased by approximately 2.11 u03A9 - * | | |11 = Source Impedance is increased by approximately 4.51 u03A9 - * @var SYS_T::MISCFCR0 - * Offset: 0x70 Miscellaneous Function Control Register 0 (Shared) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RTPICACHEN|Real-time Cortex-M4 Processor Instruction Cache Enable Bit (SUBM) - * | | |0 = Real-Time Cortex-M4 processor instruction cache Disabled. - * | | |1 = Real-Time Cortex-M4 processor instruction cache Enabled. - * |[1] |RTPDCACHEN|Real-time Cortex-M4 Processor Data Cache Enable Bit (SUBM) - * | | |0 = Real-Time Cortex-M4 processor data cache Disabled. - * | | |1 = Real-Time Cortex-M4 processor data cache Enabled. - * |[8] |WDT0RSTEN |WatchDog Timer 0 Reset Connection Enable Bit - * | | |This bit is use to enable the function that connect watch-dog timer 0 reset to nRESET pin - * | | |If this bit is enabled, the watch-dog timer 0 reset is connected to nRESET pin internally - * | | |0 = Watch-dog timer 0 reset not connected to nRESET pin internally. - * | | |1 = Watch-dog timer 0 reset connected to nRESET pin internally. - * |[9] |HDSPUEN |HDS Pin Internal Pull-up Enable Bit (TZNS) - * | | |0 = HDS pin internal pull-up resister Disabled. - * | | |1 = HDS pin internal pull-up resister Enabled. - * |[12] |UHOVRCURH |USB Host Overcurrent Detection High Active (TZNS) - * | | |0 = USB host overcurrent detection signal is low active. - * | | |1 = USB host overcurrent detection signal is high active. - * |[13] |SELFTEST |Self-test Mode Enable Bit - * | | |0 = Self-Test mode Disabled. - * | | |1 = Self-Test mode Enabled. - * |[14] |WDT1RSTEN |WatchDog Timer 1 Reset Connection Enable Bit (TZNS) - * | | |This bit is use to enable the function that connect watch-dog timer 1 reset to nRESET pin - * | | |If this bit is enabled, the watch-dog timer 1 reset is connected to nRESET pin internally - * | | |0 = Watch-dog timer 1 reset not connected to nRESET pin internally. - * | | |1 = Watch-dog timer 1 reset connected to nRESET pin internally. - * |[15] |WDT2RSTEN |WatchDog Timer 2 Reset Connection Enable Bit (SUBM) - * | | |This bit is use to enable the function that connect watch-dog timer 2 reset to nRESET pin - * | | |If this bit is enabled, the watch-dog timer 2 reset is connected to nRESET pin internally - * | | |0 = Watch-dog timer 2 reset not connected to nRESET pin internally. - * | | |1 = Watch-dog timer 2 reset connected to nRESET pin internally. - * |[16] |SDH0VSTB |Voltage Stable Indicator to SDH 0 (TZNS) - * | | |Set this bit high to indicate SDH 0 that I/O voltage is stable. - * | | |0 = Voltage of I/O used as SDH 0 is not stable. - * | | |1 = Voltage of I/O used as SDH 0 is stable. - * |[17] |SDH1VSTB |Voltage Stable Indicator to SDH 1 (TZNS) - * | | |Set this bit high to indicate SDH 1 that I/O voltage is stable. - * | | |0 = Voltage of I/O used as SDH 1 is not stable. - * | | |1 = Voltage of I/O used as SDH 1 is stable. - * |[18] |VBUSWKEN |HSUSBD VBUS Detect Wakeup Enable Control Bit (TZNS) - * | | |0 = HSUSBD VBUS detect wakeup system from Power-down mode Disabled. - * | | |1 = HSUSBD VBUS detect wakeup system from Power-down mode Enabled. - * |[19] |LNSTWKEN |HSUSBD Line State Wakeup Enable Control Bit (TZNS) - * | | |0 = HSUSBD line state wakeup system from Power-down mode Disabled. - * | | |1 = HSUSBD line state wakeup system from Power-down mode Enabled. - * |[23] |DDRCGDIS |DDR Controller Core Clock Gating Disable Bit - * | | |0 = DDR controller core clock gating in auto self-refresh mode Enabled. - * | | |1 = DDR controller core clock gating in auto self-refresh mode Disabled. - * | | |Note: This register needs to be set to 1'b1 to bypass clock gating function of DDR core clock before user writes/reads control registers or status registers of DDR memory controller. - * | | |Therefore the signals in PCLK domain of DDR memory controller can be synchronous to core clock domain of DDR memory controller, and the signals in core clock domain of DDR memory controller can be synchronous to PCLK domain of DDR memory controller correctly. - * | | |After user writes/reads control registers or status registers of DDR memory controller, this register can be set to 1'b0 to enable clock gating function of DDR core clock. - * |[31:24] |DRATSRDLY |DDR Auto Self Refresh Delay Count - * | | |This register uses to set the delay cycles of DDR memory controller before the core clock of DDR memory controller is gating - * | | |It allows for the self-refresh status to propagate to the APB domain so the STAT.selfref_type register field also reflects the status. - * | | |It is sufficient to set this delay cycles to 31 cycles normally - * | | |In particular, if the AXI frequency is much less than the DDRC frequency, a higher value may be required in order to ensure that all read data is synchronized to the AXI domain before the clock is removed. - * | | |Note: User can set this register value during core reset of DDR memory controller is asserted (i.e - * | | |MCTLCRST (SYS_IPRST0[29]) set to 1'b1). - * @var SYS_T::MISCFCR1 - * Offset: 0x74 Miscellaneous Function Control Register 1 (Shared) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CANFD0PDEN|CAN FD 0 Power Down Enable Bit - * | | |0 = CAN FD 0 Power-down mode Disabled. - * | | |1 = CAN FD 0 Power-down mode Enabled. - * |[1] |CANFD1PDEN|CAN FD 1 Power Down Enable Bit - * | | |0 = CAN FD 1 Power-down mode Disabled. - * | | |1 = CAN FD 1 Power-down mode Enabled. - * |[2] |CANFD2PDEN|CAN FD 2 Power Down Enable Bit - * | | |0 = CAN FD 2 Power-down mode Disabled. - * | | |1 = CAN FD 2 Power-down mode Enabled. - * |[3] |CANFD3PDEN|CAN FD 3 Power Down Enable Bit - * | | |0 = CAN FD 3 Power-down mode Disabled. - * | | |1 = CAN FD 3 Power-down mode Enabled. - * |[4] |CANFD0CKSTP|CAN FD 0 Clock Stop Acknowledgement (Read Only) - * | | |0 = CAN FD 0 clock didn't stop. - * | | |1 = CAN FD 0 clock stop. - * |[5] |CANFD1CKSTP|CAN FD 1 Clock Stop Acknowledgement (Read Only) - * | | |0 = CAN FD 1 clock didn't stop. - * | | |1 = CAN FD 1 clock stop. - * |[6] |CANFD2CKSTP|CAN FD 2 Clock Stop Acknowledgement (Read Only) - * | | |0 = CAN FD 2 clock didn't stop. - * | | |1 = CAN FD 2 clock stop. - * |[7] |CANFD3CKSTP|CAN FD 3 Clock Stop Acknowledgement (Read Only) - * | | |0 = CAN FD 3 clock didn't stop. - * | | |1 = CAN FD 3 clock stop. - * |[9:8] |HXTDS |HXT Driving Current Selection (Write Protect) - * | | |00 = Low power consumption mode for 2.5V~3.3V operating voltage. - * | | |01 = High noise immunity mode for 2.5V~3.3V operating voltage. - * | | |10 = Low power consumption mode for 1.8V~2.5V operating voltage. - * | | |11 = High noise immunity mode for 1.8V~2.5V operating voltage. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[15:12] |TSENSRTRIM|Temperature Sensor VTRIM (Write Protect) - * | | |Trimming for temperature sensor calibration. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[16] |RMEL1RAM |Cortex-A35 L1 Cache SRAM Macro RME Control Bit (Write Protect) - * | | |0 = Default read-write margin of Cortex-A35 L1 cache SRAM selected. - * | | |1 = High speed read-write margin of Cortex-A35 L1 cache SRAM selected. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * |[17] |RMESYSRAM |System SRAM Macro RME Control Bit (Write Protect) - * | | |0 = Default read-write margin of system SRAM selected. - * | | |1 = High speed read-write margin of system SRAM selected. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS, SYS_RLKTZNS or SYS_RLKSUBM register according to security attribute of each circuit. - * @var SYS_T::MISCIER - * Offset: 0x78 Miscellaneous Interrupt Enable Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LVDIEN |Low Voltage Detect Interrupt Enable Bit - * | | |0 = Low voltage detect interrupt Disabled. - * | | |1 = Low voltage detect interrupt Enabled. - * |[1] |USB0IDCHGIEN|USB0_ID Pin Status Change Interrupt Enable Bit - * | | |0 = USB0_ID pin status change interrupt Disabled. - * | | |1 = USB0_ID pin status change interrupt Enabled. - * |[2] |VBUSCHGIEN|USUSB0_VBUSVLD Pin Status Change Interrupt Enable Bit - * | | |0 = USUSB0_VBUSVLD pin status change interrupt Disabled. - * | | |1 = USUSB0_VBUSVLD pin status change interrupt Enabled. - * @var SYS_T::MISCISR - * Offset: 0x7C Miscellaneous Interrupt Status Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LVDIF |Low Voltage Detect Interrupt Flag - * | | |0 = No low voltage event. - * | | |1 = Low voltage event detected. - * |[1] |USB0IDCHGIF|USB0_ID Pin State Change Interrupt Flag - * | | |0 = USB0_ID state didn't change. - * | | |1 = USB0_ID state changed from low to high or from high to low. - * |[2] |VBUSCHGIF |USUSB0_VBUSVLD Pin State Change Interrupt Flag - * | | |0 = USUSB0_VBUSVLD pin state didn't change. - * | | |1 = USUSB0_VBUSVLD pin state changed from low to high or from high to low. - * |[16] |LVDSTS |Low Voltage Detect State - * | | |0 = Low voltage detect state is low. - * | | |1 = Low voltage detect state is high. - * |[17] |USB0IDSTS |USB0_ID Pin State - * | | |0 = USB port 0 used as a USB device port. - * | | |1 = USB port 0 used as a USB host port. - * |[18] |VBUSSTS |VBUS Detect Pin State - * | | |0 = VBUS detect pin state is low. - * | | |1 = VBUS detect pin state is high. - * @var SYS_T::GPA_MFPL - * Offset: 0x80 GPIOA Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA0MFP |PA.0 Multi-function Pin Selection - * |[7:4] |PA1MFP |PA.1 Multi-function Pin Selection - * |[11:8] |PA2MFP |PA.2 Multi-function Pin Selection - * |[15:12] |PA3MFP |PA.3 Multi-function Pin Selection - * |[19:16] |PA4MFP |PA.4 Multi-function Pin Selection - * |[23:20] |PA5MFP |PA.5 Multi-function Pin Selection - * |[27:24] |PA6MFP |PA.6 Multi-function Pin Selection - * |[31:28] |PA7MFP |PA.7 Multi-function Pin Selection - * @var SYS_T::GPA_MFPH - * Offset: 0x84 GPIOA High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PA8MFP |PA.8 Multi-function Pin Selection - * |[7:4] |PA9MFP |PA.9 Multi-function Pin Selection - * |[11:8] |PA10MFP |PA.10 Multi-function Pin Selection - * |[15:12] |PA11MFP |PA.11 Multi-function Pin Selection - * |[19:16] |PA12MFP |PA.12 Multi-function Pin Selection - * |[23:20] |PA13MFP |PA.13 Multi-function Pin Selection - * |[27:24] |PA14MFP |PA.14 Multi-function Pin Selection - * |[31:28] |PA15MFP |PA.15 Multi-function Pin Selection - * @var SYS_T::GPB_MFPL - * Offset: 0x88 GPIOB Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB0MFP |PB.0 Multi-function Pin Selection - * |[7:4] |PB1MFP |PB.1 Multi-function Pin Selection - * |[11:8] |PB2MFP |PB.2 Multi-function Pin Selection - * |[15:12] |PB3MFP |PB.3 Multi-function Pin Selection - * |[19:16] |PB4MFP |PB.4 Multi-function Pin Selection - * |[23:20] |PB5MFP |PB.5 Multi-function Pin Selection - * |[27:24] |PB6MFP |PB.6 Multi-function Pin Selection - * |[31:28] |PB7MFP |PB.7 Multi-function Pin Selection - * @var SYS_T::GPB_MFPH - * Offset: 0x8C GPIOB High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PB8MFP |PB.8 Multi-function Pin Selection - * |[7:4] |PB9MFP |PB.9 Multi-function Pin Selection - * |[11:8] |PB10MFP |PB.10 Multi-function Pin Selection - * |[15:12] |PB11MFP |PB.11 Multi-function Pin Selection - * |[19:16] |PB12MFP |PB.12 Multi-function Pin Selection - * |[23:20] |PB13MFP |PB.13 Multi-function Pin Selection - * |[27:24] |PB14MFP |PB.14 Multi-function Pin Selection - * |[31:28] |PB15MFP |PB.15 Multi-function Pin Selection - * @var SYS_T::GPC_MFPL - * Offset: 0x90 GPIOC Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC0MFP |PC.0 Multi-function Pin Selection - * |[7:4] |PC1MFP |PC.1 Multi-function Pin Selection - * |[11:8] |PC2MFP |PC.2 Multi-function Pin Selection - * |[15:12] |PC3MFP |PC.3 Multi-function Pin Selection - * |[19:16] |PC4MFP |PC.4 Multi-function Pin Selection - * |[23:20] |PC5MFP |PC.5 Multi-function Pin Selection - * |[27:24] |PC6MFP |PC.6 Multi-function Pin Selection - * |[31:28] |PC7MFP |PC.7 Multi-function Pin Selection - * @var SYS_T::GPC_MFPH - * Offset: 0x94 GPIOC High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PC8MFP |PC.8 Multi-function Pin Selection - * |[7:4] |PC9MFP |PC.9 Multi-function Pin Selection - * |[11:8] |PC10MFP |PC.10 Multi-function Pin Selection - * |[15:12] |PC11MFP |PC.11 Multi-function Pin Selection - * |[19:16] |PC12MFP |PC.12 Multi-function Pin Selection - * |[23:20] |PC13MFP |PC.13 Multi-function Pin Selection - * |[27:24] |PC14MFP |PC.14 Multi-function Pin Selection - * |[31:28] |PC15MFP |PC.15 Multi-function Pin Selection - * @var SYS_T::GPD_MFPL - * Offset: 0x98 GPIOD Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD0MFP |PD.0 Multi-function Pin Selection - * |[7:4] |PD1MFP |PD.1 Multi-function Pin Selection - * |[11:8] |PD2MFP |PD.2 Multi-function Pin Selection - * |[15:12] |PD3MFP |PD.3 Multi-function Pin Selection - * |[19:16] |PD4MFP |PD.4 Multi-function Pin Selection - * |[23:20] |PD5MFP |PD.5 Multi-function Pin Selection - * |[27:24] |PD6MFP |PD.6 Multi-function Pin Selection - * |[31:28] |PD7MFP |PD.7 Multi-function Pin Selection - * @var SYS_T::GPD_MFPH - * Offset: 0x9C GPIOD High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PD8MFP |PD.8 Multi-function Pin Selection - * |[7:4] |PD9MFP |PD.9 Multi-function Pin Selection - * |[11:8] |PD10MFP |PD.10 Multi-function Pin Selection - * |[15:12] |PD11MFP |PD.11 Multi-function Pin Selection - * |[19:16] |PD12MFP |PD.12 Multi-function Pin Selection - * |[23:20] |PD13MFP |PD.13 Multi-function Pin Selection - * |[27:24] |PD14MFP |PD.14 Multi-function Pin Selection - * |[31:28] |PD15MFP |PD.15 Multi-function Pin Selection - * @var SYS_T::GPE_MFPL - * Offset: 0xA0 GPIOE Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PE0MFP |PE.0 Multi-function Pin Selection - * |[7:4] |PE1MFP |PE.1 Multi-function Pin Selection - * |[11:8] |PE2MFP |PE.2 Multi-function Pin Selection - * |[15:12] |PE3MFP |PE.3 Multi-function Pin Selection - * |[19:16] |PE4MFP |PE.4 Multi-function Pin Selection - * |[23:20] |PE5MFP |PE.5 Multi-function Pin Selection - * |[27:24] |PE6MFP |PE.6 Multi-function Pin Selection - * |[31:28] |PE7MFP |PE.7 Multi-function Pin Selection - * @var SYS_T::GPE_MFPH - * Offset: 0xA4 GPIOE High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PE8MFP |PE.8 Multi-function Pin Selection - * |[7:4] |PE9MFP |PE.9 Multi-function Pin Selection - * |[11:8] |PE10MFP |PE.10 Multi-function Pin Selection - * |[15:12] |PE11MFP |PE.11 Multi-function Pin Selection - * |[19:16] |PE12MFP |PE.12 Multi-function Pin Selection - * |[23:20] |PE13MFP |PE.13 Multi-function Pin Selection - * |[27:24] |PE14MFP |PE.14 Multi-function Pin Selection - * |[31:28] |PE15MFP |PE.15 Multi-function Pin Selection - * @var SYS_T::GPF_MFPL - * Offset: 0xA8 GPIOF Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF0MFP |PF.0 Multi-function Pin Selection - * |[7:4] |PF1MFP |PF.1 Multi-function Pin Selection - * |[11:8] |PF2MFP |PF.2 Multi-function Pin Selection - * |[15:12] |PF3MFP |PF.3 Multi-function Pin Selection - * |[19:16] |PF4MFP |PF.4 Multi-function Pin Selection - * |[23:20] |PF5MFP |PF.5 Multi-function Pin Selection - * |[27:24] |PF6MFP |PF.6 Multi-function Pin Selection - * |[31:28] |PF7MFP |PF.7 Multi-function Pin Selection - * @var SYS_T::GPF_MFPH - * Offset: 0xAC GPIOF High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PF8MFP |PF.8 Multi-function Pin Selection - * |[7:4] |PF9MFP |PF.9 Multi-function Pin Selection - * |[11:8] |PF10MFP |PF.10 Multi-function Pin Selection - * |[15:12] |PF11MFP |PF.11 Multi-function Pin Selection - * |[19:16] |PF12MFP |PF.12 Multi-function Pin Selection - * |[23:20] |PF13MFP |PF.13 Multi-function Pin Selection - * |[27:24] |PF14MFP |PF.14 Multi-function Pin Selection - * |[31:28] |PF15MFP |PF.15 Multi-function Pin Selection - * @var SYS_T::GPG_MFPL - * Offset: 0xB0 GPIOG Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PG0MFP |PG.0 Multi-function Pin Selection - * |[7:4] |PG1MFP |PG.1 Multi-function Pin Selection - * |[11:8] |PG2MFP |PG.2 Multi-function Pin Selection - * |[15:12] |PG3MFP |PG.3 Multi-function Pin Selection - * |[19:16] |PG4MFP |PG.4 Multi-function Pin Selection - * |[23:20] |PG5MFP |PG.5 Multi-function Pin Selection - * |[27:24] |PG6MFP |PG.6 Multi-function Pin Selection - * |[31:28] |PG7MFP |PG.7 Multi-function Pin Selection - * @var SYS_T::GPG_MFPH - * Offset: 0xB4 GPIOG High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PG8MFP |PG.8 Multi-function Pin Selection - * |[7:4] |PG9MFP |PG.9 Multi-function Pin Selection - * |[11:8] |PG10MFP |PG.10 Multi-function Pin Selection - * |[15:12] |PG11MFP |PG.11 Multi-function Pin Selection - * |[19:16] |PG12MFP |PG.12 Multi-function Pin Selection - * |[23:20] |PG13MFP |PG.13 Multi-function Pin Selection - * |[27:24] |PG14MFP |PG.14 Multi-function Pin Selection - * |[31:28] |PG15MFP |PG.15 Multi-function Pin Selection - * @var SYS_T::GPH_MFPL - * Offset: 0xB8 GPIOH Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PH0MFP |PH.0 Multi-function Pin Selection - * |[7:4] |PH1MFP |PH.1 Multi-function Pin Selection - * |[11:8] |PH2MFP |PH.2 Multi-function Pin Selection - * |[15:12] |PH3MFP |PH.3 Multi-function Pin Selection - * |[19:16] |PH4MFP |PH.4 Multi-function Pin Selection - * |[23:20] |PH5MFP |PH.5 Multi-function Pin Selection - * |[27:24] |PH6MFP |PH.6 Multi-function Pin Selection - * |[31:28] |PH7MFP |PH.7 Multi-function Pin Selection - * @var SYS_T::GPH_MFPH - * Offset: 0xBC GPIOH High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PH8MFP |PH.8 Multi-function Pin Selection - * |[7:4] |PH9MFP |PH.9 Multi-function Pin Selection - * |[11:8] |PH10MFP |PH.10 Multi-function Pin Selection - * |[15:12] |PH11MFP |PH.11 Multi-function Pin Selection - * |[19:16] |PH12MFP |PH.12 Multi-function Pin Selection - * |[23:20] |PH13MFP |PH.13 Multi-function Pin Selection - * |[27:24] |PH14MFP |PH.14 Multi-function Pin Selection - * |[31:28] |PH15MFP |PH.15 Multi-function Pin Selection - * @var SYS_T::GPI_MFPL - * Offset: 0xC0 GPIOI Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PI0MFP |PI.0 Multi-function Pin Selection - * |[7:4] |PI1MFP |PI.1 Multi-function Pin Selection - * |[11:8] |PI2MFP |PI.2 Multi-function Pin Selection - * |[15:12] |PI3MFP |PI.3 Multi-function Pin Selection - * |[19:16] |PI4MFP |PI.4 Multi-function Pin Selection - * |[23:20] |PI5MFP |PI.5 Multi-function Pin Selection - * |[27:24] |PI6MFP |PI.6 Multi-function Pin Selection - * |[31:28] |PI7MFP |PI.7 Multi-function Pin Selection - * @var SYS_T::GPI_MFPH - * Offset: 0xC4 GPIOI High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PI8MFP |PI.8 Multi-function Pin Selection - * |[7:4] |PI9MFP |PI.9 Multi-function Pin Selection - * |[11:8] |PI10MFP |PI.10 Multi-function Pin Selection - * |[15:12] |PI11MFP |PI.11 Multi-function Pin Selection - * |[19:16] |PI12MFP |PI.12 Multi-function Pin Selection - * |[23:20] |PI13MFP |PI.13 Multi-function Pin Selection - * |[27:24] |PI14MFP |PI.14 Multi-function Pin Selection - * |[31:28] |PI15MFP |PI.15 Multi-function Pin Selection - * @var SYS_T::GPJ_MFPL - * Offset: 0xC8 GPIOJ Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PJ0MFP |PJ.0 Multi-function Pin Selection - * |[7:4] |PJ1MFP |PJ.1 Multi-function Pin Selection - * |[11:8] |PJ2MFP |PJ.2 Multi-function Pin Selection - * |[15:12] |PJ3MFP |PJ.3 Multi-function Pin Selection - * |[19:16] |PJ4MFP |PJ.4 Multi-function Pin Selection - * |[23:20] |PJ5MFP |PJ.5 Multi-function Pin Selection - * |[27:24] |PJ6MFP |PJ.6 Multi-function Pin Selection - * |[31:28] |PJ7MFP |PJ.7 Multi-function Pin Selection - * @var SYS_T::GPJ_MFPH - * Offset: 0xCC GPIOJ High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PJ8MFP |PJ.8 Multi-function Pin Selection - * |[7:4] |PJ9MFP |PJ.9 Multi-function Pin Selection - * |[11:8] |PJ10MFP |PJ.10 Multi-function Pin Selection - * |[15:12] |PJ11MFP |PJ.11 Multi-function Pin Selection - * |[19:16] |PJ12MFP |PJ.12 Multi-function Pin Selection - * |[23:20] |PJ13MFP |PJ.13 Multi-function Pin Selection - * |[27:24] |PJ14MFP |PJ.14 Multi-function Pin Selection - * |[31:28] |PJ15MFP |PJ.15 Multi-function Pin Selection - * @var SYS_T::GPK_MFPL - * Offset: 0xD0 GPIOK Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PK0MFP |PK.0 Multi-function Pin Selection - * |[7:4] |PK1MFP |PK.1 Multi-function Pin Selection - * |[11:8] |PK2MFP |PK.2 Multi-function Pin Selection - * |[15:12] |PK3MFP |PK.3 Multi-function Pin Selection - * |[19:16] |PK4MFP |PK.4 Multi-function Pin Selection - * |[23:20] |PK5MFP |PK.5 Multi-function Pin Selection - * |[27:24] |PK6MFP |PK.6 Multi-function Pin Selection - * |[31:28] |PK7MFP |PK.7 Multi-function Pin Selection - * @var SYS_T::GPK_MFPH - * Offset: 0xD4 GPIOK High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PK8MFP |PK.8 Multi-function Pin Selection - * |[7:4] |PK9MFP |PK.9 Multi-function Pin Selection - * |[11:8] |PK10MFP |PK.10 Multi-function Pin Selection - * |[15:12] |PK11MFP |PK.11 Multi-function Pin Selection - * |[19:16] |PK12MFP |PK.12 Multi-function Pin Selection - * |[23:20] |PK13MFP |PK.13 Multi-function Pin Selection - * |[27:24] |PK14MFP |PK.14 Multi-function Pin Selection - * |[31:28] |PK15MFP |PK.15 Multi-function Pin Selection - * @var SYS_T::GPL_MFPL - * Offset: 0xD8 GPIOL Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PL0MFP |PL.0 Multi-function Pin Selection - * |[7:4] |PL1MFP |PL.1 Multi-function Pin Selection - * |[11:8] |PL2MFP |PL.2 Multi-function Pin Selection - * |[15:12] |PL3MFP |PL.3 Multi-function Pin Selection - * |[19:16] |PL4MFP |PL.4 Multi-function Pin Selection - * |[23:20] |PL5MFP |PL.5 Multi-function Pin Selection - * |[27:24] |PL6MFP |PL.6 Multi-function Pin Selection - * |[31:28] |PL7MFP |PL.7 Multi-function Pin Selection - * @var SYS_T::GPL_MFPH - * Offset: 0xDC GPIOL High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PL8MFP |PL.8 Multi-function Pin Selection - * |[7:4] |PL9MFP |PL.9 Multi-function Pin Selection - * |[11:8] |PL10MFP |PL.10 Multi-function Pin Selection - * |[15:12] |PL11MFP |PL.11 Multi-function Pin Selection - * |[19:16] |PL12MFP |PL.12 Multi-function Pin Selection - * |[23:20] |PL13MFP |PL.13 Multi-function Pin Selection - * |[27:24] |PL14MFP |PL.14 Multi-function Pin Selection - * |[31:28] |PL15MFP |PL.15 Multi-function Pin Selection - * @var SYS_T::GPM_MFPL - * Offset: 0xE0 GPIOM Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PM0MFP |PM.0 Multi-function Pin Selection - * |[7:4] |PM1MFP |PM.1 Multi-function Pin Selection - * |[11:8] |PM2MFP |PM.2 Multi-function Pin Selection - * |[15:12] |PM3MFP |PM.3 Multi-function Pin Selection - * |[19:16] |PM4MFP |PM.4 Multi-function Pin Selection - * |[23:20] |PM5MFP |PM.5 Multi-function Pin Selection - * |[27:24] |PM6MFP |PM.6 Multi-function Pin Selection - * |[31:28] |PM7MFP |PM.7 Multi-function Pin Selection - * @var SYS_T::GPM_MFPH - * Offset: 0xE4 GPIOM High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PM8MFP |PM.8 Multi-function Pin Selection - * |[7:4] |PM9MFP |PM.9 Multi-function Pin Selection - * |[11:8] |PM10MFP |PM.10 Multi-function Pin Selection - * |[15:12] |PM11MFP |PM.11 Multi-function Pin Selection - * |[19:16] |PM12MFP |PM.12 Multi-function Pin Selection - * |[23:20] |PM13MFP |PM.13 Multi-function Pin Selection - * |[27:24] |PM14MFP |PM.14 Multi-function Pin Selection - * |[31:28] |PM15MFP |PM.15 Multi-function Pin Selection - * @var SYS_T::GPN_MFPL - * Offset: 0xE8 GPION Low Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PN0MFP |PN.0 Multi-function Pin Selection - * |[7:4] |PN1MFP |PN.1 Multi-function Pin Selection - * |[11:8] |PN2MFP |PN.2 Multi-function Pin Selection - * |[15:12] |PN3MFP |PN.3 Multi-function Pin Selection - * |[19:16] |PN4MFP |PN.4 Multi-function Pin Selection - * |[23:20] |PN5MFP |PN.5 Multi-function Pin Selection - * |[27:24] |PN6MFP |PN.6 Multi-function Pin Selection - * |[31:28] |PN7MFP |PN.7 Multi-function Pin Selection - * @var SYS_T::GPN_MFPH - * Offset: 0xEC GPION High Byte Multiple Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |PN8MFP |PN.8 Multi-function Pin Selection - * |[7:4] |PN9MFP |PN.9 Multi-function Pin Selection - * |[11:8] |PN10MFP |PN.10 Multi-function Pin Selection - * |[15:12] |PN11MFP |PN.11 Multi-function Pin Selection - * |[19:16] |PN12MFP |PN.12 Multi-function Pin Selection - * |[23:20] |PN13MFP |PN.13 Multi-function Pin Selection - * |[27:24] |PN14MFP |PN.14 Multi-function Pin Selection - * |[31:28] |PN15MFP |PN.15 Multi-function Pin Selection - * @var SYS_T::TSENSRFCR - * Offset: 0x104 Temperature Sensor Function Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TSENSRREF0|Temperature Sensor Reference Value 0 - * | | |TSENSRREF0 keeps 8-bit value measured at 25C for temperature conversion formula variable A calibration. - * |[15:8] |TSENSRREF1|Temperature Sensor Reference Value 1 - * | | |TSENSRREF1 keeps 8-bit value measured at 25C for temperature conversion formula variable B calibration. - * |[27:16] |TSENSRDATA|Temperature Sensor Data - * | | |TSENSRDATA keeps 12-bit value measured by temperature sensor. - * |[28] |PD |Temperature Sensor Power Down - * | | |0 = Temperature sensor data is in normal operation. - * | | |1 = Temperature sensor data is in power down. - * |[29] |REFUDEN |Temperature Sensor Reference Data Update Enable Bit - * | | |0 = Write to update TSENSRREF0 and TSENSRREF1 is Disabled. - * | | |1 = Write to update TSENSRREF0 and TSENSRREF1 is Enabled. - * |[31] |DATAVALID |Temperature Sensor Data Valid - * | | |0 = Temperature sensor data in TSENSRDATA is not valid. - * | | |1 = Temperature sensor data in TSENSRDATA is valid. - * | | |Note: This bit is only cleared by writing 1 to it. - * @var SYS_T::GMAC0MISCR - * Offset: 0x108 GMAC 0 Miscellaneous Control Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RMIIEN |RMII Mode Enable Bit - * | | |0 = GMAC 0 is in RGMII mode. - * | | |1 = GMAC 0 is in RMII mode. - * |[1] |PFRMTXEN |Pause Frame Transmit Enable Bit - * | | |0 = Pause frame transmit Disabled. - * | | |1 = Pause frame transmit Enabled. - * |[8] |TXCLKINV |Transmit Clock Inverter Enable Bit - * | | |0 = Transmit clock (output) inverter Disabled. - * | | |1 = Transmit clock (output) inverter Enabled. - * | | |Note: This bit is reserved when GMAC 0 is in RMII mode. - * |[9] |TXCLKGEN |Transmit Clock Gating Enable Bit - * | | |0 = Transmit clock (output) gating when entered LPI mode Disabled. - * | | |1 = Transmit clock (output) gating when entered LPI mode Enabled. - * | | |Note: This bit is reserved when GMAC 0 is in RMII mode. - * |[12] |RXCLKINV |Receive Clock Inverter Enable Bit - * | | |0 = Receive clock (input) inverter Disabled. - * | | |1 = Receive clock (input) inverter Enabled. - * | | |Note: This bit is reserved when GMAC 0 is in RMII mode. - * |[19:16] |TXCLKDLY |Transmit Clock Path Delay Control - * | | |0000 = 0.00ns (Default). - * | | |0001 = 0.13ns. - * | | |0010 = 0.27ns. - * | | |0011 = 0.40ns. - * | | |0100 = 0.53ns. - * | | |0101 = 0.67ns. - * | | |0110 = 0.80ns. - * | | |0111 = 0.93ns. - * | | |1000 = 1.07ns. - * | | |1001 = 1.20ns. - * | | |1010 = 1.33ns. - * | | |1011 = 1.47ns. - * | | |1100 = 1.60ns. - * | | |1101 = 1.73ns. - * | | |1110 = 1.87ns. - * | | |1111 = 2.00ns. - * | | |Note: These bits are reserved when GMAC 0 is in RMII mode. - * |[23:20] |RXCLKDLY |Receive Clock Path Delay Control - * | | |0000 = 0.00ns (Default). - * | | |0001 = 0.13ns. - * | | |0010 = 0.27ns. - * | | |0011 = 0.40ns. - * | | |0100 = 0.53ns. - * | | |0101 = 0.67ns. - * | | |0110 = 0.80ns. - * | | |0111 = 0.93ns. - * | | |1000 = 1.07ns. - * | | |1001 = 1.20ns. - * | | |1010 = 1.33ns. - * | | |1011 = 1.47ns. - * | | |1100 = 1.60ns. - * | | |1101 = 1.73ns. - * | | |1110 = 1.87ns. - * | | |1111 = 2.00ns. - * | | |Note: These bits are reserved when GMAC 0 is in RMII mode. - * @var SYS_T::GMAC1MISCR - * Offset: 0x10C GMAC 1 Miscellaneous Control Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RMIIEN |RMII Mode Enable Bit - * | | |0 = GMAC 1 is in RGMII mode. - * | | |1 = GMAC 1 is in RMII mode. - * |[1] |PFRMTXEN |Pause Frame Transmit Enable Bit - * | | |0 = Pause frame transmit Disabled. - * | | |1 = Pause frame transmit Enabled. - * |[8] |TXCLKINV |Transmit Clock Inverter Enable Bit - * | | |0 = Transmit clock (output) inverter Disabled. - * | | |1 = Transmit clock (output) inverter Enabled. - * | | |Note: This bit is reserved when GMAC 1 is in RMII mode. - * |[9] |TXCLKGEN |Transmit Clock Gating Enable Bit - * | | |0 = Transmit clock (output) gating when entered LPI mode Disabled. - * | | |1 = Transmit clock (output) gating when entered LPI mode Enabled. - * | | |Note: This bit is reserved when GMAC 1 is in RMII mode. - * |[12] |RXCLKINV |Receive Clock Inverter Enable Bit - * | | |0 = Receive clock (input) inverter Disabled. - * | | |1 = Receive clock (input) inverter Enabled. - * | | |Note: This bit is reserved when GMAC 1 is in RMII mode. - * |[19:16] |TXCLKDLY |Transmit Clock Path Delay Control - * | | |0000 = 0.00ns (Default). - * | | |0001 = 0.13ns. - * | | |0010 = 0.27ns. - * | | |0011 = 0.40ns. - * | | |0100 = 0.53ns. - * | | |0101 = 0.67ns. - * | | |0110 = 0.80ns. - * | | |0111 = 0.93ns. - * | | |1000 = 1.07ns. - * | | |1001 = 1.20ns. - * | | |1010 = 1.33ns. - * | | |1011 = 1.47ns. - * | | |1100 = 1.60ns. - * | | |1101 = 1.73ns. - * | | |1110 = 1.87ns. - * | | |1111 = 2.00ns. - * | | |Note: These bits are reserved when GMAC 1 is in RMII mode. - * |[23:20] |RXCLKDLY |Receive Clock Path Delay Control - * | | |0000 = 0.00ns (Default). - * | | |0001 = 0.13ns. - * | | |0010 = 0.27ns. - * | | |0011 = 0.40ns. - * | | |0100 = 0.53ns. - * | | |0101 = 0.67ns. - * | | |0110 = 0.80ns. - * | | |0111 = 0.93ns. - * | | |1000 = 1.07ns. - * | | |1001 = 1.20ns. - * | | |1010 = 1.33ns. - * | | |1011 = 1.47ns. - * | | |1100 = 1.60ns. - * | | |1101 = 1.73ns. - * | | |1110 = 1.87ns. - * | | |1111 = 2.00ns. - * | | |Note: These bits are reserved when GMAC 1 is in RMII mode. - * @var SYS_T::MACAD0LSR - * Offset: 0x110 MAC Address 0 Low Significant Word Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MACADRLSR |MAC Address Low Significant Word Register - * @var SYS_T::MACAD0HSR - * Offset: 0x114 MAC Address 0 High Significant Word Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MACADRHSR |MAC Address High Significant Word Register - * @var SYS_T::MACAD1LSR - * Offset: 0x118 MAC Address 1 Low Significant Word Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |MACADRLSR |MAC Address Low Significant Word Register - * @var SYS_T::MACAD1HSR - * Offset: 0x11C MAC Address 1 High Significant Word Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MACADRHSR |MAC Address High Significant Word Register - * @var SYS_T::CSDBGCTL - * Offset: 0x120 CoreSight Debug Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DBGRST |Debug Reset Bit - * | | |0 = Release the reset for all debug component including A35, RTP and Coresight - * | | |1 = Reset all debug component including A35, RTP and Coresight - * |[1] |DBGPWRUPREQ|Debug Power Up Request Bit - * | | |0 = Disable the power-up request. - * | | |1 = Enable the power-up request - * | | |Note: If user wants to do self-hosted debug, it has to write the DBGPWRUPREQ to 1, and check the DBGPWRUPACK to 1 before self-hosted debug start - * | | |This bit will enable A35 power and clock and RTP clock. - * |[2] |DBGPWRUPACK|Debug Power Up Acknowledge Bit - * | | |0 = Debug power-up request is not ready - * | | |1 = Debug power-up request is ready - * |[3] |LPEMU |Low Power Emulation Enable Bit - * | | |0 = Low power Emulation Enabled. - * | | |1 = Low power Emulation Disabled. - * | | |When this bit is on, CA35 and RTP's clock and power will be maintained even the SOC in power-down mode. - * @var SYS_T::GPAB_MFOS - * Offset: 0x140 GPIOA and GPIOB Multiple Function Output Mode Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GPIOxMFOS0|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[1] |GPIOxMFOS1|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[2] |GPIOxMFOS2|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[3] |GPIOxMFOS3|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[4] |GPIOxMFOS4|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[5] |GPIOxMFOS5|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[6] |GPIOxMFOS6|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[7] |GPIOxMFOS7|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[8] |GPIOxMFOS8|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[9] |GPIOxMFOS9|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[10] |GPIOxMFOS10|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[11] |GPIOxMFOS11|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[12] |GPIOxMFOS12|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[13] |GPIOxMFOS13|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[14] |GPIOxMFOS14|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[15] |GPIOxMFOS15|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[16] |GPIOyMFOS16|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[17] |GPIOyMFOS17|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[18] |GPIOyMFOS18|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[19] |GPIOyMFOS19|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[20] |GPIOyMFOS20|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[21] |GPIOyMFOS21|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[22] |GPIOyMFOS22|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[23] |GPIOyMFOS23|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[24] |GPIOyMFOS24|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[25] |GPIOyMFOS25|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[26] |GPIOyMFOS26|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[27] |GPIOyMFOS27|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[28] |GPIOyMFOS28|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[29] |GPIOyMFOS29|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[30] |GPIOyMFOS30|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[31] |GPIOyMFOS31|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * @var SYS_T::GPCD_MFOS - * Offset: 0x144 GPIOC and GPIOD Multiple Function Output Mode Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GPIOxMFOS0|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[1] |GPIOxMFOS1|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[2] |GPIOxMFOS2|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[3] |GPIOxMFOS3|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[4] |GPIOxMFOS4|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[5] |GPIOxMFOS5|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[6] |GPIOxMFOS6|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[7] |GPIOxMFOS7|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[8] |GPIOxMFOS8|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[9] |GPIOxMFOS9|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[10] |GPIOxMFOS10|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[11] |GPIOxMFOS11|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[12] |GPIOxMFOS12|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[13] |GPIOxMFOS13|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[14] |GPIOxMFOS14|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[15] |GPIOxMFOS15|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[16] |GPIOyMFOS16|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[17] |GPIOyMFOS17|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[18] |GPIOyMFOS18|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[19] |GPIOyMFOS19|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[20] |GPIOyMFOS20|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[21] |GPIOyMFOS21|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[22] |GPIOyMFOS22|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[23] |GPIOyMFOS23|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[24] |GPIOyMFOS24|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[25] |GPIOyMFOS25|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[26] |GPIOyMFOS26|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[27] |GPIOyMFOS27|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[28] |GPIOyMFOS28|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[29] |GPIOyMFOS29|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[30] |GPIOyMFOS30|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[31] |GPIOyMFOS31|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * @var SYS_T::GPEF_MFOS - * Offset: 0x148 GPIOE and GPIOF Multiple Function Output Mode Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GPIOxMFOS0|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[1] |GPIOxMFOS1|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[2] |GPIOxMFOS2|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[3] |GPIOxMFOS3|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[4] |GPIOxMFOS4|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[5] |GPIOxMFOS5|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[6] |GPIOxMFOS6|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[7] |GPIOxMFOS7|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[8] |GPIOxMFOS8|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[9] |GPIOxMFOS9|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[10] |GPIOxMFOS10|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[11] |GPIOxMFOS11|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[12] |GPIOxMFOS12|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[13] |GPIOxMFOS13|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[14] |GPIOxMFOS14|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[15] |GPIOxMFOS15|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[16] |GPIOyMFOS16|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[17] |GPIOyMFOS17|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[18] |GPIOyMFOS18|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[19] |GPIOyMFOS19|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[20] |GPIOyMFOS20|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[21] |GPIOyMFOS21|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[22] |GPIOyMFOS22|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[23] |GPIOyMFOS23|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[24] |GPIOyMFOS24|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[25] |GPIOyMFOS25|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[26] |GPIOyMFOS26|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[27] |GPIOyMFOS27|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[28] |GPIOyMFOS28|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[29] |GPIOyMFOS29|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[30] |GPIOyMFOS30|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[31] |GPIOyMFOS31|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * @var SYS_T::GPGH_MFOS - * Offset: 0x14C GPIOG and GPIOH Multiple Function Output Mode Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GPIOxMFOS0|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[1] |GPIOxMFOS1|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[2] |GPIOxMFOS2|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[3] |GPIOxMFOS3|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[4] |GPIOxMFOS4|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[5] |GPIOxMFOS5|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[6] |GPIOxMFOS6|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[7] |GPIOxMFOS7|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[8] |GPIOxMFOS8|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[9] |GPIOxMFOS9|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[10] |GPIOxMFOS10|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[11] |GPIOxMFOS11|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[12] |GPIOxMFOS12|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[13] |GPIOxMFOS13|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[14] |GPIOxMFOS14|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[15] |GPIOxMFOS15|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[16] |GPIOyMFOS16|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[17] |GPIOyMFOS17|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[18] |GPIOyMFOS18|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[19] |GPIOyMFOS19|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[20] |GPIOyMFOS20|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[21] |GPIOyMFOS21|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[22] |GPIOyMFOS22|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[23] |GPIOyMFOS23|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[24] |GPIOyMFOS24|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[25] |GPIOyMFOS25|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[26] |GPIOyMFOS26|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[27] |GPIOyMFOS27|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[28] |GPIOyMFOS28|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[29] |GPIOyMFOS29|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[30] |GPIOyMFOS30|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[31] |GPIOyMFOS31|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * @var SYS_T::GPIJ_MFOS - * Offset: 0x150 GPIOI and GPIOJ Multiple Function Output Mode Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GPIOxMFOS0|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[1] |GPIOxMFOS1|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[2] |GPIOxMFOS2|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[3] |GPIOxMFOS3|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[4] |GPIOxMFOS4|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[5] |GPIOxMFOS5|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[6] |GPIOxMFOS6|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[7] |GPIOxMFOS7|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[8] |GPIOxMFOS8|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[9] |GPIOxMFOS9|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[10] |GPIOxMFOS10|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[11] |GPIOxMFOS11|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[12] |GPIOxMFOS12|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[13] |GPIOxMFOS13|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[14] |GPIOxMFOS14|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[15] |GPIOxMFOS15|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[16] |GPIOyMFOS16|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[17] |GPIOyMFOS17|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[18] |GPIOyMFOS18|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[19] |GPIOyMFOS19|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[20] |GPIOyMFOS20|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[21] |GPIOyMFOS21|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[22] |GPIOyMFOS22|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[23] |GPIOyMFOS23|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[24] |GPIOyMFOS24|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[25] |GPIOyMFOS25|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[26] |GPIOyMFOS26|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[27] |GPIOyMFOS27|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[28] |GPIOyMFOS28|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[29] |GPIOyMFOS29|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[30] |GPIOyMFOS30|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[31] |GPIOyMFOS31|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * @var SYS_T::GPKL_MFOS - * Offset: 0x154 GPIOK and GPIOL Multiple Function Output Mode Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GPIOxMFOS0|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[1] |GPIOxMFOS1|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[2] |GPIOxMFOS2|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[3] |GPIOxMFOS3|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[4] |GPIOxMFOS4|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[5] |GPIOxMFOS5|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[6] |GPIOxMFOS6|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[7] |GPIOxMFOS7|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[8] |GPIOxMFOS8|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[9] |GPIOxMFOS9|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[10] |GPIOxMFOS10|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[11] |GPIOxMFOS11|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[12] |GPIOxMFOS12|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[13] |GPIOxMFOS13|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[14] |GPIOxMFOS14|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[15] |GPIOxMFOS15|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[16] |GPIOyMFOS16|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[17] |GPIOyMFOS17|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[18] |GPIOyMFOS18|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[19] |GPIOyMFOS19|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[20] |GPIOyMFOS20|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[21] |GPIOyMFOS21|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[22] |GPIOyMFOS22|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[23] |GPIOyMFOS23|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[24] |GPIOyMFOS24|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[25] |GPIOyMFOS25|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[26] |GPIOyMFOS26|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[27] |GPIOyMFOS27|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[28] |GPIOyMFOS28|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[29] |GPIOyMFOS29|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[30] |GPIOyMFOS30|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[31] |GPIOyMFOS31|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * @var SYS_T::GPMN_MFOS - * Offset: 0x158 GPIOM and GPION Multiple Function Output Mode Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GPIOxMFOS0|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[1] |GPIOxMFOS1|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[2] |GPIOxMFOS2|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[3] |GPIOxMFOS3|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[4] |GPIOxMFOS4|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[5] |GPIOxMFOS5|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[6] |GPIOxMFOS6|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[7] |GPIOxMFOS7|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[8] |GPIOxMFOS8|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[9] |GPIOxMFOS9|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[10] |GPIOxMFOS10|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[11] |GPIOxMFOS11|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[12] |GPIOxMFOS12|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[13] |GPIOxMFOS13|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[14] |GPIOxMFOS14|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[15] |GPIOxMFOS15|GPIOx Pin[m] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Px.m pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: Max. m=15. - * | | |Note: y= A, C, E, F, I, K, M - * |[16] |GPIOyMFOS16|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[17] |GPIOyMFOS17|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[18] |GPIOyMFOS18|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[19] |GPIOyMFOS19|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[20] |GPIOyMFOS20|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[21] |GPIOyMFOS21|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[22] |GPIOyMFOS22|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[23] |GPIOyMFOS23|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[24] |GPIOyMFOS24|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[25] |GPIOyMFOS25|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[26] |GPIOyMFOS26|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[27] |GPIOyMFOS27|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[28] |GPIOyMFOS28|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[29] |GPIOyMFOS29|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[30] |GPIOyMFOS30|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * |[31] |GPIOyMFOS31|GPIOy Pin[n] Multiple Function Pin Output Mode Select - * | | |This bit used to select multiple function pin output mode type for Py.n pin - * | | |0 = Multiple function pin output mode type is Push-pull mode. - * | | |1 = Multiple function pin output mode type is Open-drain mode. - * | | |Note: n=0, 1..15, Max. n=15. - * | | |Note: y= B, D, F, H, J, L, N - * @var SYS_T::UID0 - * Offset: 0x180 Unique Identifier Word 0 Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UID |Unique ID - * | | |Unique identify number of the chip. - * | | |Loaded from OTP automatically during chip power on. - * @var SYS_T::UID1 - * Offset: 0x184 Unique Identifier Word 1 Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UID |Unique ID - * | | |Unique identify number of the chip. - * | | |Loaded from OTP automatically during chip power on. - * @var SYS_T::UID2 - * Offset: 0x188 Unique Identifier Word 2 Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UID |Unique ID - * | | |Unique identify number of the chip. - * | | |Loaded from OTP automatically during chip power on. - * @var SYS_T::UCID0 - * Offset: 0x190 Unique Customer Identifier Word 0 Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UCID |Unique Customer ID - * | | |Unique customer identifier number of the chip. - * | | |Loaded from OTP automatically during chip power on. - * @var SYS_T::UCID1 - * Offset: 0x194 Unique Customer Identifier Word 1 Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UCID |Unique Customer ID - * | | |Unique customer identifier number of the chip. - * | | |Loaded from OTP automatically during chip power on. - * @var SYS_T::UCID2 - * Offset: 0x198 Unique Customer Identifier Word 2 Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |UCID |Unique Customer ID - * | | |Unique customer identifier number of the chip. - * | | |Loaded from OTP automatically during chip power on. - * @var SYS_T::RLKTZS - * Offset: 0x1A0 TZS Register Lock Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REGLCTL |Register Lock Control Code (Write Only) - * | | |Some registers have write-protection function - * | | |Writing these registers have to disable the protected function by writing the sequence value "59h", "16h", "88h" to this field - * | | |After this sequence is completed, the REGLCTL bit will be set to 1 and write-protection registers can be normal write. - * | | |REGLCTL[0] - * | | |Register Lock Control Disable Index (Read Only) - * | | |0 = Write-protection Enabled for writing protected registers - * | | |Any write to the protected register is ignored. - * | | |1 = Write-protection Disabled for writing protected registers. - * @var SYS_T::RLKTZNS - * Offset: 0x1A4 TZNS Register Lock Control Register (TZNS) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REGLCTL |Register Lock Control Code (Write Only) - * | | |Some registers have write-protection function - * | | |Writing these registers have to disable the protected function by writing the sequence value "59h", "16h", "88h" to this field - * | | |After this sequence is completed, the REGLCTL bit will be set to 1 and write-protection registers can be normal write. - * | | |REGLCTL[0] - * | | |Register Lock Control Disable Index (Read Only) - * | | |0 = Write-protection Enabled for writing protected registers - * | | |Any write to the protected register is ignored. - * | | |1 = Write-protection Disabled for writing protected registers. - * @var SYS_T::RLKSUBM - * Offset: 0x1A8 SUBM Register Lock Control Register (SUBM) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REGLCTL |Register Lock Control Code (Write Only) - * | | |Some registers have write-protection function - * | | |Writing these registers have to disable the protected function by writing the sequence value "59h", "16h", "88h" to this field - * | | |After this sequence is completed, the REGLCTL bit will be set to 1 and write-protection registers can be normal write. - * | | |REGLCTL[0] - * | | |Register Lock Control Disable Index (Read Only) - * | | |0 = Write-protection Enabled for writing protected registers - * | | |Any write to the protected register is ignored. - * | | |1 = Write-protection Disabled for writing protected registers. - */ - __I uint32_t PDID; /*!< [0x0000] Product and Device Identifier Register (TZNS) */ - __I uint32_t PWRONOTP; /*!< [0x0004] Power-on Setting OTP Source Register (TZNS) */ - __I uint32_t PWRONPIN; /*!< [0x0008] Power-on Setting Pin Source Register (TZNS) */ - __I uint32_t RESERVE0[1]; - __IO uint32_t RSTSTS; /*!< [0x0010] Reset Source Active Status Register (Shared) */ - __IO uint32_t MISCRFCR; /*!< [0x0014] Miscellaneous Reset Function Control Register */ - __IO uint32_t RSTDEBCTL; /*!< [0x0018] Reset Pin De-bounce Control Register */ - __IO uint32_t LVRDCR; /*!< [0x001c] Low Voltage Reset & Detect Control Register */ - __IO uint32_t IPRST0; /*!< [0x0020] Reset Control Register 0 (Shared) */ - __IO uint32_t IPRST1; /*!< [0x0024] Reset Control Register 1 (Shared) */ - __IO uint32_t IPRST2; /*!< [0x0028] Reset Control Register 2 (Shared) */ - __IO uint32_t IPRST3; /*!< [0x002c] Reset Control Register 3 (Shared) */ - __IO uint32_t PMUCR; /*!< [0x0030] Power Management Unit Control Register */ - __IO uint32_t DDRCQCSR; /*!< [0x0034] DDR Controller Q Channel Control and Status Register */ - __IO uint32_t PMUIEN; /*!< [0x0038] Power Management Unit Interrupt Enable Register */ - __IO uint32_t PMUSTS; /*!< [0x003c] Power Management Unit Status Register */ - __IO uint32_t CA35WRBADR0; /*!< [0x0040] Cortexu00AE-A35 Core 0 Warm-boot Address Register */ - __IO uint32_t CA35WRBPAR0; /*!< [0x0044] Cortexu00AE-A35 Core 0 Warm-boot Parameter Register */ - __IO uint32_t CA35WRBADR1; /*!< [0x0048] Cortexu00AE-A35 Core 1 Warm-boot Address Register */ - __IO uint32_t CA35WRBPAR1; /*!< [0x004c] Cortexu00AE-A35 Core 1 Warm-boot Parameter Register */ - __I uint32_t RESERVE1[4]; - __IO uint32_t USBPMISCR; /*!< [0x0060] USB PHY Miscellaneous Control Register (TZNS) */ - __IO uint32_t USBP0PCR; /*!< [0x0064] USB Port 0 PHY Control Register */ - __IO uint32_t USBP1PCR; /*!< [0x0068] USB Port 1 PHY Control Register (TZNS) */ - __I uint32_t RESERVE2[1]; - __IO uint32_t MISCFCR0; /*!< [0x0070] Miscellaneous Function Control Register 0 (Shared) */ - __IO uint32_t MISCFCR1; /*!< [0x0074] Miscellaneous Function Control Register 1 (Shared) */ - __IO uint32_t MISCIER; /*!< [0x0078] Miscellaneous Interrupt Enable Register (TZNS) */ - __IO uint32_t MISCISR; /*!< [0x007c] Miscellaneous Interrupt Status Register (TZNS) */ - __IO uint32_t GPA_MFPL; /*!< [0x0080] GPIOA Low Byte Multiple Function Control Register */ - __IO uint32_t GPA_MFPH; /*!< [0x0084] GPIOA High Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPL; /*!< [0x0088] GPIOB Low Byte Multiple Function Control Register */ - __IO uint32_t GPB_MFPH; /*!< [0x008c] GPIOB High Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPL; /*!< [0x0090] GPIOC Low Byte Multiple Function Control Register */ - __IO uint32_t GPC_MFPH; /*!< [0x0094] GPIOC High Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPL; /*!< [0x0098] GPIOD Low Byte Multiple Function Control Register */ - __IO uint32_t GPD_MFPH; /*!< [0x009c] GPIOD High Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPL; /*!< [0x00a0] GPIOE Low Byte Multiple Function Control Register */ - __IO uint32_t GPE_MFPH; /*!< [0x00a4] GPIOE High Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPL; /*!< [0x00a8] GPIOF Low Byte Multiple Function Control Register */ - __IO uint32_t GPF_MFPH; /*!< [0x00ac] GPIOF High Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPL; /*!< [0x00b0] GPIOG Low Byte Multiple Function Control Register */ - __IO uint32_t GPG_MFPH; /*!< [0x00b4] GPIOG High Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPL; /*!< [0x00b8] GPIOH Low Byte Multiple Function Control Register */ - __IO uint32_t GPH_MFPH; /*!< [0x00bc] GPIOH High Byte Multiple Function Control Register */ - __IO uint32_t GPI_MFPL; /*!< [0x00c0] GPIOI Low Byte Multiple Function Control Register */ - __IO uint32_t GPI_MFPH; /*!< [0x00c4] GPIOI High Byte Multiple Function Control Register */ - __IO uint32_t GPJ_MFPL; /*!< [0x00c8] GPIOJ Low Byte Multiple Function Control Register */ - __IO uint32_t GPJ_MFPH; /*!< [0x00cc] GPIOJ High Byte Multiple Function Control Register */ - __IO uint32_t GPK_MFPL; /*!< [0x00d0] GPIOK Low Byte Multiple Function Control Register */ - __IO uint32_t GPK_MFPH; /*!< [0x00d4] GPIOK High Byte Multiple Function Control Register */ - __IO uint32_t GPL_MFPL; /*!< [0x00d8] GPIOL Low Byte Multiple Function Control Register */ - __IO uint32_t GPL_MFPH; /*!< [0x00dc] GPIOL High Byte Multiple Function Control Register */ - __IO uint32_t GPM_MFPL; /*!< [0x00e0] GPIOM Low Byte Multiple Function Control Register */ - __IO uint32_t GPM_MFPH; /*!< [0x00e4] GPIOM High Byte Multiple Function Control Register */ - __IO uint32_t GPN_MFPL; /*!< [0x00e8] GPION Low Byte Multiple Function Control Register */ - __IO uint32_t GPN_MFPH; /*!< [0x00ec] GPION High Byte Multiple Function Control Register */ - __I uint32_t RESERVE3[5]; - __IO uint32_t TSENSRFCR; /*!< [0x0104] Temperature Sensor Function Control Register */ - __IO uint32_t GMAC0MISCR; /*!< [0x0108] GMAC 0 Miscellaneous Control Register (TZNS) */ - __IO uint32_t GMAC1MISCR; /*!< [0x010c] GMAC 1 Miscellaneous Control Register (TZNS) */ - __I uint32_t MACAD0LSR; /*!< [0x0110] MAC Address 0 Low Significant Word Register (TZNS) */ - __I uint32_t MACAD0HSR; /*!< [0x0114] MAC Address 0 High Significant Word Register (TZNS) */ - __I uint32_t MACAD1LSR; /*!< [0x0118] MAC Address 1 Low Significant Word Register (TZNS) */ - __I uint32_t MACAD1HSR; /*!< [0x011c] MAC Address 1 High Significant Word Register (TZNS) */ - __IO uint32_t CSDBGCTL; /*!< [0x0120] CoreSight Debug Control Register */ - __I uint32_t RESERVE4[7]; - __IO uint32_t GPAB_MFOS; /*!< [0x0140] GPIOA and GPIOB Multiple Function Output Mode Select Register */ - __IO uint32_t GPCD_MFOS; /*!< [0x0144] GPIOC and GPIOD Multiple Function Output Mode Select Register */ - __IO uint32_t GPEF_MFOS; /*!< [0x0148] GPIOE and GPIOF Multiple Function Output Mode Select Register */ - __IO uint32_t GPGH_MFOS; /*!< [0x014c] GPIOG and GPIOH Multiple Function Output Mode Select Register */ - __IO uint32_t GPIJ_MFOS; /*!< [0x0150] GPIOI and GPIOJ Multiple Function Output Mode Select Register */ - __IO uint32_t GPKL_MFOS; /*!< [0x0154] GPIOK and GPIOL Multiple Function Output Mode Select Register */ - __IO uint32_t GPMN_MFOS; /*!< [0x0158] GPIOM and GPION Multiple Function Output Mode Select Register */ - __I uint32_t RESERVE5[9]; - __I uint32_t UID0; /*!< [0x0180] Unique Identifier Word 0 Register (TZNS) */ - __I uint32_t UID1; /*!< [0x0184] Unique Identifier Word 1 Register (TZNS) */ - __I uint32_t UID2; /*!< [0x0188] Unique Identifier Word 2 Register (TZNS) */ - __I uint32_t RESERVE6[1]; - __I uint32_t UCID0; /*!< [0x0190] Unique Customer Identifier Word 0 Register (TZNS) */ - __I uint32_t UCID1; /*!< [0x0194] Unique Customer Identifier Word 1 Register (TZNS) */ - __I uint32_t UCID2; /*!< [0x0198] Unique Customer Identifier Word 2 Register (TZNS) */ - __I uint32_t RESERVE7[1]; - __O uint32_t RLKTZS; /*!< [0x01a0] TZS Register Lock Control Register */ - __O uint32_t RLKTZNS; /*!< [0x01a4] TZNS Register Lock Control Register (TZNS) */ - __O uint32_t RLKSUBM; /*!< [0x01a8] SUBM Register Lock Control Register (SUBM) */ - -} SYS_T; - -/** - @addtogroup SYS_CONST SYS Bit Field Definition - Constant Definitions for SYS Controller -@{ */ - -#define SYS_PDID_PID_Pos (0) /*!< SYS_T::PDID: PID Position */ -#define SYS_PDID_PID_Msk (0xfffful << SYS_PDID_PID_Pos) /*!< SYS_T::PDID: PID Mask */ - -#define SYS_PDID_DID_Pos (16) /*!< SYS_T::PDID: DID Position */ -#define SYS_PDID_DID_Msk (0xffful << SYS_PDID_DID_Pos) /*!< SYS_T::PDID: DID Mask */ - -#define SYS_PWRONOTP_PWRONSRC_Pos (0) /*!< SYS_T::PWRONOTP: PWRONSRC Position */ -#define SYS_PWRONOTP_PWRONSRC_Msk (0x1ul << SYS_PWRONOTP_PWRONSRC_Pos) /*!< SYS_T::PWRONOTP: PWRONSRC Mask */ - -#define SYS_PWRONOTP_QSPI0CKSEL_Pos (1) /*!< SYS_T::PWRONOTP: QSPI0CKSEL Position */ -#define SYS_PWRONOTP_QSPI0CKSEL_Msk (0x1ul << SYS_PWRONOTP_QSPI0CKSEL_Pos) /*!< SYS_T::PWRONOTP: QSPI0CKSEL Mask */ - -#define SYS_PWRONOTP_WDT0ON_Pos (2) /*!< SYS_T::PWRONOTP: WDT0ON Position */ -#define SYS_PWRONOTP_WDT0ON_Msk (0x1ul << SYS_PWRONOTP_WDT0ON_Pos) /*!< SYS_T::PWRONOTP: WDT0ON Mask */ - -#define SYS_PWRONOTP_UR0DBGDIS_Pos (4) /*!< SYS_T::PWRONOTP: UR0DBGDIS Position */ -#define SYS_PWRONOTP_UR0DBGDIS_Msk (0x1ul << SYS_PWRONOTP_UR0DBGDIS_Pos) /*!< SYS_T::PWRONOTP: UR0DBGDIS Mask */ - -#define SYS_PWRONOTP_SD0BKEN_Pos (5) /*!< SYS_T::PWRONOTP: SD0BKEN Position */ -#define SYS_PWRONOTP_SD0BKEN_Msk (0x1ul << SYS_PWRONOTP_SD0BKEN_Pos) /*!< SYS_T::PWRONOTP: SD0BKEN Mask */ - -#define SYS_PWRONOTP_BTSRCSEL_Pos (10) /*!< SYS_T::PWRONOTP: BTSRCSEL Position */ -#define SYS_PWRONOTP_BTSRCSEL_Msk (0x3ul << SYS_PWRONOTP_BTSRCSEL_Pos) /*!< SYS_T::PWRONOTP: BTSRCSEL Mask */ - -#define SYS_PWRONOTP_NPAGESEL_Pos (12) /*!< SYS_T::PWRONOTP: NPAGESEL Position */ -#define SYS_PWRONOTP_NPAGESEL_Msk (0x3ul << SYS_PWRONOTP_NPAGESEL_Pos) /*!< SYS_T::PWRONOTP: NPAGESEL Mask */ - -#define SYS_PWRONOTP_MISCCFG_Pos (14) /*!< SYS_T::PWRONOTP: MISCCFG Position */ -#define SYS_PWRONOTP_MISCCFG_Msk (0x3ul << SYS_PWRONOTP_MISCCFG_Pos) /*!< SYS_T::PWRONOTP: MISCCFG Mask */ - -#define SYS_PWRONOTP_USBP0ID_Pos (16) /*!< SYS_T::PWRONOTP: USBP0ID Position */ -#define SYS_PWRONOTP_USBP0ID_Msk (0x1ul << SYS_PWRONOTP_USBP0ID_Pos) /*!< SYS_T::PWRONOTP: USBP0ID Mask */ - -#define SYS_PWRONOTP_SECBTPSWD_Pos (24) /*!< SYS_T::PWRONOTP: SECBTPSWD Position */ -#define SYS_PWRONOTP_SECBTPSWD_Msk (0xfful << SYS_PWRONOTP_SECBTPSWD_Pos) /*!< SYS_T::PWRONOTP: SECBTPSWD Mask */ - -#define SYS_PWRONPIN_SECBTDIS_Pos (0) /*!< SYS_T::PWRONPIN: SECBTDIS Position */ -#define SYS_PWRONPIN_SECBTDIS_Msk (0x1ul << SYS_PWRONPIN_SECBTDIS_Pos) /*!< SYS_T::PWRONPIN: SECBTDIS Mask */ - -#define SYS_PWRONPIN_BTSRCSEL_Pos (2) /*!< SYS_T::PWRONPIN: BTSRCSEL Position */ -#define SYS_PWRONPIN_BTSRCSEL_Msk (0x3ul << SYS_PWRONPIN_BTSRCSEL_Pos) /*!< SYS_T::PWRONPIN: BTSRCSEL Mask */ - -#define SYS_PWRONPIN_NPAGESEL_Pos (4) /*!< SYS_T::PWRONPIN: NPAGESEL Position */ -#define SYS_PWRONPIN_NPAGESEL_Msk (0x3ul << SYS_PWRONPIN_NPAGESEL_Pos) /*!< SYS_T::PWRONPIN: NPAGESEL Mask */ - -#define SYS_PWRONPIN_MISCCFG_Pos (6) /*!< SYS_T::PWRONPIN: MISCCFG Position */ -#define SYS_PWRONPIN_MISCCFG_Msk (0x3ul << SYS_PWRONPIN_MISCCFG_Pos) /*!< SYS_T::PWRONPIN: MISCCFG Mask */ - -#define SYS_RSTSTS_PORF_Pos (0) /*!< SYS_T::RSTSTS: PORF Position */ -#define SYS_RSTSTS_PORF_Msk (0x1ul << SYS_RSTSTS_PORF_Pos) /*!< SYS_T::RSTSTS: PORF Mask */ - -#define SYS_RSTSTS_PINRF_Pos (1) /*!< SYS_T::RSTSTS: PINRF Position */ -#define SYS_RSTSTS_PINRF_Msk (0x1ul << SYS_RSTSTS_PINRF_Pos) /*!< SYS_T::RSTSTS: PINRF Mask */ - -#define SYS_RSTSTS_WDT0RF_Pos (2) /*!< SYS_T::RSTSTS: WDT0RF Position */ -#define SYS_RSTSTS_WDT0RF_Msk (0x1ul << SYS_RSTSTS_WDT0RF_Pos) /*!< SYS_T::RSTSTS: WDT0RF Mask */ - -#define SYS_RSTSTS_LVRF_Pos (3) /*!< SYS_T::RSTSTS: LVRF Position */ -#define SYS_RSTSTS_LVRF_Msk (0x1ul << SYS_RSTSTS_LVRF_Pos) /*!< SYS_T::RSTSTS: LVRF Mask */ - -#define SYS_RSTSTS_CPU0DBGRF_Pos (4) /*!< SYS_T::RSTSTS: CPU0DBGRF Position */ -#define SYS_RSTSTS_CPU0DBGRF_Msk (0x1ul << SYS_RSTSTS_CPU0DBGRF_Pos) /*!< SYS_T::RSTSTS: CPU0DBGRF Mask */ - -#define SYS_RSTSTS_CPU0WARMRF_Pos (5) /*!< SYS_T::RSTSTS: CPU0WARMRF Position */ -#define SYS_RSTSTS_CPU0WARMRF_Msk (0x1ul << SYS_RSTSTS_CPU0WARMRF_Pos) /*!< SYS_T::RSTSTS: CPU0WARMRF Mask */ - -#define SYS_RSTSTS_HRESETRF_Pos (6) /*!< SYS_T::RSTSTS: HRESETRF Position */ -#define SYS_RSTSTS_HRESETRF_Msk (0x1ul << SYS_RSTSTS_HRESETRF_Pos) /*!< SYS_T::RSTSTS: HRESETRF Mask */ - -#define SYS_RSTSTS_CPU0RF_Pos (7) /*!< SYS_T::RSTSTS: CPU0RF Position */ -#define SYS_RSTSTS_CPU0RF_Msk (0x1ul << SYS_RSTSTS_CPU0RF_Pos) /*!< SYS_T::RSTSTS: CPU0RF Mask */ - -#define SYS_RSTSTS_WDT1RF_Pos (10) /*!< SYS_T::RSTSTS: WDT1RF Position */ -#define SYS_RSTSTS_WDT1RF_Msk (0x1ul << SYS_RSTSTS_WDT1RF_Pos) /*!< SYS_T::RSTSTS: WDT1RF Mask */ - -#define SYS_RSTSTS_WDT2RFA_Pos (11) /*!< SYS_T::RSTSTS: WDT2RFA Position */ -#define SYS_RSTSTS_WDT2RFA_Msk (0x1ul << SYS_RSTSTS_WDT2RFA_Pos) /*!< SYS_T::RSTSTS: WDT2RFA Mask */ - -#define SYS_RSTSTS_CPU1DBGRF_Pos (12) /*!< SYS_T::RSTSTS: CPU1DBGRF Position */ -#define SYS_RSTSTS_CPU1DBGRF_Msk (0x1ul << SYS_RSTSTS_CPU1DBGRF_Pos) /*!< SYS_T::RSTSTS: CPU1DBGRF Mask */ - -#define SYS_RSTSTS_CPU1WARMRF_Pos (13) /*!< SYS_T::RSTSTS: CPU1WARMRF Position */ -#define SYS_RSTSTS_CPU1WARMRF_Msk (0x1ul << SYS_RSTSTS_CPU1WARMRF_Pos) /*!< SYS_T::RSTSTS: CPU1WARMRF Mask */ - -#define SYS_RSTSTS_CPU1RF_Pos (15) /*!< SYS_T::RSTSTS: CPU1RF Position */ -#define SYS_RSTSTS_CPU1RF_Msk (0x1ul << SYS_RSTSTS_CPU1RF_Pos) /*!< SYS_T::RSTSTS: CPU1RF Mask */ - -#define SYS_RSTSTS_WDT1RFM_Pos (18) /*!< SYS_T::RSTSTS: WDT1RFM Position */ -#define SYS_RSTSTS_WDT1RFM_Msk (0x1ul << SYS_RSTSTS_WDT1RFM_Pos) /*!< SYS_T::RSTSTS: WDT1RFM Mask */ - -#define SYS_RSTSTS_WDT2RF_Pos (19) /*!< SYS_T::RSTSTS: WDT2RF Position */ -#define SYS_RSTSTS_WDT2RF_Msk (0x1ul << SYS_RSTSTS_WDT2RF_Pos) /*!< SYS_T::RSTSTS: WDT2RF Mask */ - -#define SYS_RSTSTS_RTPM4LKRF_Pos (20) /*!< SYS_T::RSTSTS: RTPM4LKRF Position */ -#define SYS_RSTSTS_RTPM4LKRF_Msk (0x1ul << SYS_RSTSTS_RTPM4LKRF_Pos) /*!< SYS_T::RSTSTS: RTPM4LKRF Mask */ - -#define SYS_RSTSTS_RTPM4SYSRF_Pos (21) /*!< SYS_T::RSTSTS: RTPM4SYSRF Position */ -#define SYS_RSTSTS_RTPM4SYSRF_Msk (0x1ul << SYS_RSTSTS_RTPM4SYSRF_Pos) /*!< SYS_T::RSTSTS: RTPM4SYSRF Mask */ - -#define SYS_RSTSTS_RTPPMUSYSRF_Pos (22) /*!< SYS_T::RSTSTS: RTPPMUSYSRF Position */ -#define SYS_RSTSTS_RTPPMUSYSRF_Msk (0x1ul << SYS_RSTSTS_RTPPMUSYSRF_Pos) /*!< SYS_T::RSTSTS: RTPPMUSYSRF Mask */ - -#define SYS_RSTSTS_RTPM4CPURF_Pos (23) /*!< SYS_T::RSTSTS: RTPM4CPURF Position */ -#define SYS_RSTSTS_RTPM4CPURF_Msk (0x1ul << SYS_RSTSTS_RTPM4CPURF_Pos) /*!< SYS_T::RSTSTS: RTPM4CPURF Mask */ - -#define SYS_MISCRFCR_PORDISCODE_Pos (0) /*!< SYS_T::MISCRFCR: PORDISCODE Position */ -#define SYS_MISCRFCR_PORDISCODE_Msk (0xfffful << SYS_MISCRFCR_PORDISCODE_Pos) /*!< SYS_T::MISCRFCR: PORDISCODE Mask */ - -#define SYS_MISCRFCR_WDT1RSTAEN_Pos (16) /*!< SYS_T::MISCRFCR: WDT1RSTAEN Position */ -#define SYS_MISCRFCR_WDT1RSTAEN_Msk (0x1ul << SYS_MISCRFCR_WDT1RSTAEN_Pos) /*!< SYS_T::MISCRFCR: WDT1RSTAEN Mask */ - -#define SYS_MISCRFCR_WDT2RSTAEN_Pos (17) /*!< SYS_T::MISCRFCR: WDT2RSTAEN Position */ -#define SYS_MISCRFCR_WDT2RSTAEN_Msk (0x1ul << SYS_MISCRFCR_WDT2RSTAEN_Pos) /*!< SYS_T::MISCRFCR: WDT2RSTAEN Mask */ - -#define SYS_MISCRFCR_WDT1RSTMEN_Pos (18) /*!< SYS_T::MISCRFCR: WDT1RSTMEN Position */ -#define SYS_MISCRFCR_WDT1RSTMEN_Msk (0x1ul << SYS_MISCRFCR_WDT1RSTMEN_Pos) /*!< SYS_T::MISCRFCR: WDT1RSTMEN Mask */ - -#define SYS_RSTDEBCTL_DEBCNT_Pos (0) /*!< SYS_T::RSTDEBCTL: DEBCNT Position */ -#define SYS_RSTDEBCTL_DEBCNT_Msk (0xfffful << SYS_RSTDEBCTL_DEBCNT_Pos) /*!< SYS_T::RSTDEBCTL: DEBCNT Mask */ - -#define SYS_RSTDEBCTL_RSTDEBEN_Pos (31) /*!< SYS_T::RSTDEBCTL: RSTDEBEN Position */ -#define SYS_RSTDEBCTL_RSTDEBEN_Msk (0x1ul << SYS_RSTDEBCTL_RSTDEBEN_Pos) /*!< SYS_T::RSTDEBCTL: RSTDEBEN Mask */ - -#define SYS_LVRDCR_LVREN_Pos (0) /*!< SYS_T::LVRDCR: LVREN Position */ -#define SYS_LVRDCR_LVREN_Msk (0x1ul << SYS_LVRDCR_LVREN_Pos) /*!< SYS_T::LVRDCR: LVREN Mask */ - -#define SYS_LVRDCR_LVRDGSEL_Pos (1) /*!< SYS_T::LVRDCR: LVRDGSEL Position */ -#define SYS_LVRDCR_LVRDGSEL_Msk (0x7ul << SYS_LVRDCR_LVRDGSEL_Pos) /*!< SYS_T::LVRDCR: LVRDGSEL Mask */ - -#define SYS_LVRDCR_LVDEN_Pos (8) /*!< SYS_T::LVRDCR: LVDEN Position */ -#define SYS_LVRDCR_LVDEN_Msk (0x1ul << SYS_LVRDCR_LVDEN_Pos) /*!< SYS_T::LVRDCR: LVDEN Mask */ - -#define SYS_LVRDCR_LVDSEL_Pos (9) /*!< SYS_T::LVRDCR: LVDSEL Position */ -#define SYS_LVRDCR_LVDSEL_Msk (0x1ul << SYS_LVRDCR_LVDSEL_Pos) /*!< SYS_T::LVRDCR: LVDSEL Mask */ - -#define SYS_LVRDCR_LVDWKA35EN_Pos (10) /*!< SYS_T::LVRDCR: LVDWKA35EN Position */ -#define SYS_LVRDCR_LVDWKA35EN_Msk (0x1ul << SYS_LVRDCR_LVDWKA35EN_Pos) /*!< SYS_T::LVRDCR: LVDWKA35EN Mask */ - -#define SYS_LVRDCR_LVDWKRTPEN_Pos (11) /*!< SYS_T::LVRDCR: LVDWKRTPEN Position */ -#define SYS_LVRDCR_LVDWKRTPEN_Msk (0x1ul << SYS_LVRDCR_LVDWKRTPEN_Pos) /*!< SYS_T::LVRDCR: LVDWKRTPEN Mask */ - -#define SYS_LVRDCR_LVDODGSEL_Pos (12) /*!< SYS_T::LVRDCR: LVDODGSEL Position */ -#define SYS_LVRDCR_LVDODGSEL_Msk (0x7ul << SYS_LVRDCR_LVDODGSEL_Pos) /*!< SYS_T::LVRDCR: LVDODGSEL Mask */ - -#define SYS_IPRST0_CHIPRST_Pos (0) /*!< SYS_T::IPRST0: CHIPRST Position */ -#define SYS_IPRST0_CHIPRST_Msk (0x1ul << SYS_IPRST0_CHIPRST_Pos) /*!< SYS_T::IPRST0: CHIPRST Mask */ - -#define SYS_IPRST0_CA35CR0RST_Pos (1) /*!< SYS_T::IPRST0: CA35CR0RST Position */ -#define SYS_IPRST0_CA35CR0RST_Msk (0x1ul << SYS_IPRST0_CA35CR0RST_Pos) /*!< SYS_T::IPRST0: CA35CR0RST Mask */ - -#define SYS_IPRST0_CA35CR1RST_Pos (2) /*!< SYS_T::IPRST0: CA35CR1RST Position */ -#define SYS_IPRST0_CA35CR1RST_Msk (0x1ul << SYS_IPRST0_CA35CR1RST_Pos) /*!< SYS_T::IPRST0: CA35CR1RST Mask */ - -#define SYS_IPRST0_CM4RST_Pos (3) /*!< SYS_T::IPRST0: CM4RST Position */ -#define SYS_IPRST0_CM4RST_Msk (0x1ul << SYS_IPRST0_CM4RST_Pos) /*!< SYS_T::IPRST0: CM4RST Mask */ - -#define SYS_IPRST0_PDMA0RST_Pos (4) /*!< SYS_T::IPRST0: PDMA0RST Position */ -#define SYS_IPRST0_PDMA0RST_Msk (0x1ul << SYS_IPRST0_PDMA0RST_Pos) /*!< SYS_T::IPRST0: PDMA0RST Mask */ - -#define SYS_IPRST0_PDMA1RST_Pos (5) /*!< SYS_T::IPRST0: PDMA1RST Position */ -#define SYS_IPRST0_PDMA1RST_Msk (0x1ul << SYS_IPRST0_PDMA1RST_Pos) /*!< SYS_T::IPRST0: PDMA1RST Mask */ - -#define SYS_IPRST0_PDMA2RST_Pos (6) /*!< SYS_T::IPRST0: PDMA2RST Position */ -#define SYS_IPRST0_PDMA2RST_Msk (0x1ul << SYS_IPRST0_PDMA2RST_Pos) /*!< SYS_T::IPRST0: PDMA2RST Mask */ - -#define SYS_IPRST0_PDMA3RST_Pos (7) /*!< SYS_T::IPRST0: PDMA3RST Position */ -#define SYS_IPRST0_PDMA3RST_Msk (0x1ul << SYS_IPRST0_PDMA3RST_Pos) /*!< SYS_T::IPRST0: PDMA3RST Mask */ - -#define SYS_IPRST0_DISPCRST_Pos (9) /*!< SYS_T::IPRST0: DISPCRST Position */ -#define SYS_IPRST0_DISPCRST_Msk (0x1ul << SYS_IPRST0_DISPCRST_Pos) /*!< SYS_T::IPRST0: DISPCRST Mask */ - -#define SYS_IPRST0_CCAP0RST_Pos (10) /*!< SYS_T::IPRST0: CCAP0RST Position */ -#define SYS_IPRST0_CCAP0RST_Msk (0x1ul << SYS_IPRST0_CCAP0RST_Pos) /*!< SYS_T::IPRST0: CCAP0RST Mask */ - -#define SYS_IPRST0_CCAP1RST_Pos (11) /*!< SYS_T::IPRST0: CCAP1RST Position */ -#define SYS_IPRST0_CCAP1RST_Msk (0x1ul << SYS_IPRST0_CCAP1RST_Pos) /*!< SYS_T::IPRST0: CCAP1RST Mask */ - -#define SYS_IPRST0_GFXRST_Pos (12) /*!< SYS_T::IPRST0: GFXRST Position */ -#define SYS_IPRST0_GFXRST_Msk (0x1ul << SYS_IPRST0_GFXRST_Pos) /*!< SYS_T::IPRST0: GFXRST Mask */ - -#define SYS_IPRST0_VDECRST_Pos (13) /*!< SYS_T::IPRST0: VDECRST Position */ -#define SYS_IPRST0_VDECRST_Msk (0x1ul << SYS_IPRST0_VDECRST_Pos) /*!< SYS_T::IPRST0: VDECRST Mask */ - -#define SYS_IPRST0_WRHO0RST_Pos (14) /*!< SYS_T::IPRST0: WRHO0RST Position */ -#define SYS_IPRST0_WRHO0RST_Msk (0x1ul << SYS_IPRST0_WRHO0RST_Pos) /*!< SYS_T::IPRST0: WRHO0RST Mask */ - -#define SYS_IPRST0_WRHO1RST_Pos (15) /*!< SYS_T::IPRST0: WRHO1RST Position */ -#define SYS_IPRST0_WRHO1RST_Msk (0x1ul << SYS_IPRST0_WRHO1RST_Pos) /*!< SYS_T::IPRST0: WRHO1RST Mask */ - -#define SYS_IPRST0_GMAC0RST_Pos (16) /*!< SYS_T::IPRST0: GMAC0RST Position */ -#define SYS_IPRST0_GMAC0RST_Msk (0x1ul << SYS_IPRST0_GMAC0RST_Pos) /*!< SYS_T::IPRST0: GMAC0RST Mask */ - -#define SYS_IPRST0_GMAC1RST_Pos (17) /*!< SYS_T::IPRST0: GMAC1RST Position */ -#define SYS_IPRST0_GMAC1RST_Msk (0x1ul << SYS_IPRST0_GMAC1RST_Pos) /*!< SYS_T::IPRST0: GMAC1RST Mask */ - -#define SYS_IPRST0_HWSEMRST_Pos (18) /*!< SYS_T::IPRST0: HWSEMRST Position */ -#define SYS_IPRST0_HWSEMRST_Msk (0x1ul << SYS_IPRST0_HWSEMRST_Pos) /*!< SYS_T::IPRST0: HWSEMRST Mask */ - -#define SYS_IPRST0_EBIRST_Pos (19) /*!< SYS_T::IPRST0: EBIRST Position */ -#define SYS_IPRST0_EBIRST_Msk (0x1ul << SYS_IPRST0_EBIRST_Pos) /*!< SYS_T::IPRST0: EBIRST Mask */ - -#define SYS_IPRST0_HSUSBH0RST_Pos (20) /*!< SYS_T::IPRST0: HSUSBH0RST Position */ -#define SYS_IPRST0_HSUSBH0RST_Msk (0x1ul << SYS_IPRST0_HSUSBH0RST_Pos) /*!< SYS_T::IPRST0: HSUSBH0RST Mask */ - -#define SYS_IPRST0_HSUSBH1RST_Pos (21) /*!< SYS_T::IPRST0: HSUSBH1RST Position */ -#define SYS_IPRST0_HSUSBH1RST_Msk (0x1ul << SYS_IPRST0_HSUSBH1RST_Pos) /*!< SYS_T::IPRST0: HSUSBH1RST Mask */ - -#define SYS_IPRST0_HSUSBDRST_Pos (22) /*!< SYS_T::IPRST0: HSUSBDRST Position */ -#define SYS_IPRST0_HSUSBDRST_Msk (0x1ul << SYS_IPRST0_HSUSBDRST_Pos) /*!< SYS_T::IPRST0: HSUSBDRST Mask */ - -#define SYS_IPRST0_SDH0RST_Pos (24) /*!< SYS_T::IPRST0: SDH0RST Position */ -#define SYS_IPRST0_SDH0RST_Msk (0x1ul << SYS_IPRST0_SDH0RST_Pos) /*!< SYS_T::IPRST0: SDH0RST Mask */ - -#define SYS_IPRST0_SDH1RST_Pos (25) /*!< SYS_T::IPRST0: SDH1RST Position */ -#define SYS_IPRST0_SDH1RST_Msk (0x1ul << SYS_IPRST0_SDH1RST_Pos) /*!< SYS_T::IPRST0: SDH1RST Mask */ - -#define SYS_IPRST0_NANDRST_Pos (26) /*!< SYS_T::IPRST0: NANDRST Position */ -#define SYS_IPRST0_NANDRST_Msk (0x1ul << SYS_IPRST0_NANDRST_Pos) /*!< SYS_T::IPRST0: NANDRST Mask */ - -#define SYS_IPRST0_GPIORST_Pos (27) /*!< SYS_T::IPRST0: GPIORST Position */ -#define SYS_IPRST0_GPIORST_Msk (0x1ul << SYS_IPRST0_GPIORST_Pos) /*!< SYS_T::IPRST0: GPIORST Mask */ - -#define SYS_IPRST0_MCTLPRST_Pos (28) /*!< SYS_T::IPRST0: MCTLPRST Position */ -#define SYS_IPRST0_MCTLPRST_Msk (0x1ul << SYS_IPRST0_MCTLPRST_Pos) /*!< SYS_T::IPRST0: MCTLPRST Mask */ - -#define SYS_IPRST0_MCTLCRST_Pos (29) /*!< SYS_T::IPRST0: MCTLCRST Position */ -#define SYS_IPRST0_MCTLCRST_Msk (0x1ul << SYS_IPRST0_MCTLCRST_Pos) /*!< SYS_T::IPRST0: MCTLCRST Mask */ - -#define SYS_IPRST0_DDRPUBRST_Pos (30) /*!< SYS_T::IPRST0: DDRPUBRST Position */ -#define SYS_IPRST0_DDRPUBRST_Msk (0x1ul << SYS_IPRST0_DDRPUBRST_Pos) /*!< SYS_T::IPRST0: DDRPUBRST Mask */ - -#define SYS_IPRST1_TMR0RST_Pos (2) /*!< SYS_T::IPRST1: TMR0RST Position */ -#define SYS_IPRST1_TMR0RST_Msk (0x1ul << SYS_IPRST1_TMR0RST_Pos) /*!< SYS_T::IPRST1: TMR0RST Mask */ - -#define SYS_IPRST1_TMR1RST_Pos (3) /*!< SYS_T::IPRST1: TMR1RST Position */ -#define SYS_IPRST1_TMR1RST_Msk (0x1ul << SYS_IPRST1_TMR1RST_Pos) /*!< SYS_T::IPRST1: TMR1RST Mask */ - -#define SYS_IPRST1_TMR2RST_Pos (4) /*!< SYS_T::IPRST1: TMR2RST Position */ -#define SYS_IPRST1_TMR2RST_Msk (0x1ul << SYS_IPRST1_TMR2RST_Pos) /*!< SYS_T::IPRST1: TMR2RST Mask */ - -#define SYS_IPRST1_TMR3RST_Pos (5) /*!< SYS_T::IPRST1: TMR3RST Position */ -#define SYS_IPRST1_TMR3RST_Msk (0x1ul << SYS_IPRST1_TMR3RST_Pos) /*!< SYS_T::IPRST1: TMR3RST Mask */ - -#define SYS_IPRST1_I2C0RST_Pos (8) /*!< SYS_T::IPRST1: I2C0RST Position */ -#define SYS_IPRST1_I2C0RST_Msk (0x1ul << SYS_IPRST1_I2C0RST_Pos) /*!< SYS_T::IPRST1: I2C0RST Mask */ - -#define SYS_IPRST1_I2C1RST_Pos (9) /*!< SYS_T::IPRST1: I2C1RST Position */ -#define SYS_IPRST1_I2C1RST_Msk (0x1ul << SYS_IPRST1_I2C1RST_Pos) /*!< SYS_T::IPRST1: I2C1RST Mask */ - -#define SYS_IPRST1_I2C2RST_Pos (10) /*!< SYS_T::IPRST1: I2C2RST Position */ -#define SYS_IPRST1_I2C2RST_Msk (0x1ul << SYS_IPRST1_I2C2RST_Pos) /*!< SYS_T::IPRST1: I2C2RST Mask */ - -#define SYS_IPRST1_I2C3RST_Pos (11) /*!< SYS_T::IPRST1: I2C3RST Position */ -#define SYS_IPRST1_I2C3RST_Msk (0x1ul << SYS_IPRST1_I2C3RST_Pos) /*!< SYS_T::IPRST1: I2C3RST Mask */ - -#define SYS_IPRST1_QSPI0RST_Pos (12) /*!< SYS_T::IPRST1: QSPI0RST Position */ -#define SYS_IPRST1_QSPI0RST_Msk (0x1ul << SYS_IPRST1_QSPI0RST_Pos) /*!< SYS_T::IPRST1: QSPI0RST Mask */ - -#define SYS_IPRST1_SPI0RST_Pos (13) /*!< SYS_T::IPRST1: SPI0RST Position */ -#define SYS_IPRST1_SPI0RST_Msk (0x1ul << SYS_IPRST1_SPI0RST_Pos) /*!< SYS_T::IPRST1: SPI0RST Mask */ - -#define SYS_IPRST1_SPI1RST_Pos (14) /*!< SYS_T::IPRST1: SPI1RST Position */ -#define SYS_IPRST1_SPI1RST_Msk (0x1ul << SYS_IPRST1_SPI1RST_Pos) /*!< SYS_T::IPRST1: SPI1RST Mask */ - -#define SYS_IPRST1_SPI2RST_Pos (15) /*!< SYS_T::IPRST1: SPI2RST Position */ -#define SYS_IPRST1_SPI2RST_Msk (0x1ul << SYS_IPRST1_SPI2RST_Pos) /*!< SYS_T::IPRST1: SPI2RST Mask */ - -#define SYS_IPRST1_UART0RST_Pos (16) /*!< SYS_T::IPRST1: UART0RST Position */ -#define SYS_IPRST1_UART0RST_Msk (0x1ul << SYS_IPRST1_UART0RST_Pos) /*!< SYS_T::IPRST1: UART0RST Mask */ - -#define SYS_IPRST1_UART1RST_Pos (17) /*!< SYS_T::IPRST1: UART1RST Position */ -#define SYS_IPRST1_UART1RST_Msk (0x1ul << SYS_IPRST1_UART1RST_Pos) /*!< SYS_T::IPRST1: UART1RST Mask */ - -#define SYS_IPRST1_UART2RST_Pos (18) /*!< SYS_T::IPRST1: UART2RST Position */ -#define SYS_IPRST1_UART2RST_Msk (0x1ul << SYS_IPRST1_UART2RST_Pos) /*!< SYS_T::IPRST1: UART2RST Mask */ - -#define SYS_IPRST1_UART3RST_Pos (19) /*!< SYS_T::IPRST1: UART3RST Position */ -#define SYS_IPRST1_UART3RST_Msk (0x1ul << SYS_IPRST1_UART3RST_Pos) /*!< SYS_T::IPRST1: UART3RST Mask */ - -#define SYS_IPRST1_UART4RST_Pos (20) /*!< SYS_T::IPRST1: UART4RST Position */ -#define SYS_IPRST1_UART4RST_Msk (0x1ul << SYS_IPRST1_UART4RST_Pos) /*!< SYS_T::IPRST1: UART4RST Mask */ - -#define SYS_IPRST1_UART5RST_Pos (21) /*!< SYS_T::IPRST1: UART5RST Position */ -#define SYS_IPRST1_UART5RST_Msk (0x1ul << SYS_IPRST1_UART5RST_Pos) /*!< SYS_T::IPRST1: UART5RST Mask */ - -#define SYS_IPRST1_UART6RST_Pos (22) /*!< SYS_T::IPRST1: UART6RST Position */ -#define SYS_IPRST1_UART6RST_Msk (0x1ul << SYS_IPRST1_UART6RST_Pos) /*!< SYS_T::IPRST1: UART6RST Mask */ - -#define SYS_IPRST1_UART7RST_Pos (23) /*!< SYS_T::IPRST1: UART7RST Position */ -#define SYS_IPRST1_UART7RST_Msk (0x1ul << SYS_IPRST1_UART7RST_Pos) /*!< SYS_T::IPRST1: UART7RST Mask */ - -#define SYS_IPRST1_CANFD0RST_Pos (24) /*!< SYS_T::IPRST1: CANFD0RST Position */ -#define SYS_IPRST1_CANFD0RST_Msk (0x1ul << SYS_IPRST1_CANFD0RST_Pos) /*!< SYS_T::IPRST1: CANFD0RST Mask */ - -#define SYS_IPRST1_CANFD1RST_Pos (25) /*!< SYS_T::IPRST1: CANFD1RST Position */ -#define SYS_IPRST1_CANFD1RST_Msk (0x1ul << SYS_IPRST1_CANFD1RST_Pos) /*!< SYS_T::IPRST1: CANFD1RST Mask */ - -#define SYS_IPRST1_EADC0RST_Pos (28) /*!< SYS_T::IPRST1: EADC0RST Position */ -#define SYS_IPRST1_EADC0RST_Msk (0x1ul << SYS_IPRST1_EADC0RST_Pos) /*!< SYS_T::IPRST1: EADC0RST Mask */ - -#define SYS_IPRST1_I2S0RST_Pos (29) /*!< SYS_T::IPRST1: I2S0RST Position */ -#define SYS_IPRST1_I2S0RST_Msk (0x1ul << SYS_IPRST1_I2S0RST_Pos) /*!< SYS_T::IPRST1: I2S0RST Mask */ - -#define SYS_IPRST2_SC0RST_Pos (0) /*!< SYS_T::IPRST2: SC0RST Position */ -#define SYS_IPRST2_SC0RST_Msk (0x1ul << SYS_IPRST2_SC0RST_Pos) /*!< SYS_T::IPRST2: SC0RST Mask */ - -#define SYS_IPRST2_SC1RST_Pos (1) /*!< SYS_T::IPRST2: SC1RST Position */ -#define SYS_IPRST2_SC1RST_Msk (0x1ul << SYS_IPRST2_SC1RST_Pos) /*!< SYS_T::IPRST2: SC1RST Mask */ - -#define SYS_IPRST2_QSPI1RST_Pos (4) /*!< SYS_T::IPRST2: QSPI1RST Position */ -#define SYS_IPRST2_QSPI1RST_Msk (0x1ul << SYS_IPRST2_QSPI1RST_Pos) /*!< SYS_T::IPRST2: QSPI1RST Mask */ - -#define SYS_IPRST2_SPI3RST_Pos (6) /*!< SYS_T::IPRST2: SPI3RST Position */ -#define SYS_IPRST2_SPI3RST_Msk (0x1ul << SYS_IPRST2_SPI3RST_Pos) /*!< SYS_T::IPRST2: SPI3RST Mask */ - -#define SYS_IPRST2_EPWM0RST_Pos (16) /*!< SYS_T::IPRST2: EPWM0RST Position */ -#define SYS_IPRST2_EPWM0RST_Msk (0x1ul << SYS_IPRST2_EPWM0RST_Pos) /*!< SYS_T::IPRST2: EPWM0RST Mask */ - -#define SYS_IPRST2_EPWM1RST_Pos (17) /*!< SYS_T::IPRST2: EPWM1RST Position */ -#define SYS_IPRST2_EPWM1RST_Msk (0x1ul << SYS_IPRST2_EPWM1RST_Pos) /*!< SYS_T::IPRST2: EPWM1RST Mask */ - -#define SYS_IPRST2_QEI0RST_Pos (22) /*!< SYS_T::IPRST2: QEI0RST Position */ -#define SYS_IPRST2_QEI0RST_Msk (0x1ul << SYS_IPRST2_QEI0RST_Pos) /*!< SYS_T::IPRST2: QEI0RST Mask */ - -#define SYS_IPRST2_QEI1RST_Pos (23) /*!< SYS_T::IPRST2: QEI1RST Position */ -#define SYS_IPRST2_QEI1RST_Msk (0x1ul << SYS_IPRST2_QEI1RST_Pos) /*!< SYS_T::IPRST2: QEI1RST Mask */ - -#define SYS_IPRST2_ECAP0RST_Pos (26) /*!< SYS_T::IPRST2: ECAP0RST Position */ -#define SYS_IPRST2_ECAP0RST_Msk (0x1ul << SYS_IPRST2_ECAP0RST_Pos) /*!< SYS_T::IPRST2: ECAP0RST Mask */ - -#define SYS_IPRST2_ECAP1RST_Pos (27) /*!< SYS_T::IPRST2: ECAP1RST Position */ -#define SYS_IPRST2_ECAP1RST_Msk (0x1ul << SYS_IPRST2_ECAP1RST_Pos) /*!< SYS_T::IPRST2: ECAP1RST Mask */ - -#define SYS_IPRST2_CANFD2RST_Pos (28) /*!< SYS_T::IPRST2: CANFD2RST Position */ -#define SYS_IPRST2_CANFD2RST_Msk (0x1ul << SYS_IPRST2_CANFD2RST_Pos) /*!< SYS_T::IPRST2: CANFD2RST Mask */ - -#define SYS_IPRST2_ADC0RST_Pos (31) /*!< SYS_T::IPRST2: ADC0RST Position */ -#define SYS_IPRST2_ADC0RST_Msk (0x1ul << SYS_IPRST2_ADC0RST_Pos) /*!< SYS_T::IPRST2: ADC0RST Mask */ - -#define SYS_IPRST3_TMR4RST_Pos (0) /*!< SYS_T::IPRST3: TMR4RST Position */ -#define SYS_IPRST3_TMR4RST_Msk (0x1ul << SYS_IPRST3_TMR4RST_Pos) /*!< SYS_T::IPRST3: TMR4RST Mask */ - -#define SYS_IPRST3_TMR5RST_Pos (1) /*!< SYS_T::IPRST3: TMR5RST Position */ -#define SYS_IPRST3_TMR5RST_Msk (0x1ul << SYS_IPRST3_TMR5RST_Pos) /*!< SYS_T::IPRST3: TMR5RST Mask */ - -#define SYS_IPRST3_TMR6RST_Pos (2) /*!< SYS_T::IPRST3: TMR6RST Position */ -#define SYS_IPRST3_TMR6RST_Msk (0x1ul << SYS_IPRST3_TMR6RST_Pos) /*!< SYS_T::IPRST3: TMR6RST Mask */ - -#define SYS_IPRST3_TMR7RST_Pos (3) /*!< SYS_T::IPRST3: TMR7RST Position */ -#define SYS_IPRST3_TMR7RST_Msk (0x1ul << SYS_IPRST3_TMR7RST_Pos) /*!< SYS_T::IPRST3: TMR7RST Mask */ - -#define SYS_IPRST3_TMR8RST_Pos (4) /*!< SYS_T::IPRST3: TMR8RST Position */ -#define SYS_IPRST3_TMR8RST_Msk (0x1ul << SYS_IPRST3_TMR8RST_Pos) /*!< SYS_T::IPRST3: TMR8RST Mask */ - -#define SYS_IPRST3_TMR9RST_Pos (5) /*!< SYS_T::IPRST3: TMR9RST Position */ -#define SYS_IPRST3_TMR9RST_Msk (0x1ul << SYS_IPRST3_TMR9RST_Pos) /*!< SYS_T::IPRST3: TMR9RST Mask */ - -#define SYS_IPRST3_TMR10RST_Pos (6) /*!< SYS_T::IPRST3: TMR10RST Position */ -#define SYS_IPRST3_TMR10RST_Msk (0x1ul << SYS_IPRST3_TMR10RST_Pos) /*!< SYS_T::IPRST3: TMR10RST Mask */ - -#define SYS_IPRST3_TMR11RST_Pos (7) /*!< SYS_T::IPRST3: TMR11RST Position */ -#define SYS_IPRST3_TMR11RST_Msk (0x1ul << SYS_IPRST3_TMR11RST_Pos) /*!< SYS_T::IPRST3: TMR11RST Mask */ - -#define SYS_IPRST3_UART8RST_Pos (8) /*!< SYS_T::IPRST3: UART8RST Position */ -#define SYS_IPRST3_UART8RST_Msk (0x1ul << SYS_IPRST3_UART8RST_Pos) /*!< SYS_T::IPRST3: UART8RST Mask */ - -#define SYS_IPRST3_UART9RST_Pos (9) /*!< SYS_T::IPRST3: UART9RST Position */ -#define SYS_IPRST3_UART9RST_Msk (0x1ul << SYS_IPRST3_UART9RST_Pos) /*!< SYS_T::IPRST3: UART9RST Mask */ - -#define SYS_IPRST3_UART10RST_Pos (10) /*!< SYS_T::IPRST3: UART10RST Position */ -#define SYS_IPRST3_UART10RST_Msk (0x1ul << SYS_IPRST3_UART10RST_Pos) /*!< SYS_T::IPRST3: UART10RST Mask */ - -#define SYS_IPRST3_UART11RST_Pos (11) /*!< SYS_T::IPRST3: UART11RST Position */ -#define SYS_IPRST3_UART11RST_Msk (0x1ul << SYS_IPRST3_UART11RST_Pos) /*!< SYS_T::IPRST3: UART11RST Mask */ - -#define SYS_IPRST3_UART12RST_Pos (12) /*!< SYS_T::IPRST3: UART12RST Position */ -#define SYS_IPRST3_UART12RST_Msk (0x1ul << SYS_IPRST3_UART12RST_Pos) /*!< SYS_T::IPRST3: UART12RST Mask */ - -#define SYS_IPRST3_UART13RST_Pos (13) /*!< SYS_T::IPRST3: UART13RST Position */ -#define SYS_IPRST3_UART13RST_Msk (0x1ul << SYS_IPRST3_UART13RST_Pos) /*!< SYS_T::IPRST3: UART13RST Mask */ - -#define SYS_IPRST3_UART14RST_Pos (14) /*!< SYS_T::IPRST3: UART14RST Position */ -#define SYS_IPRST3_UART14RST_Msk (0x1ul << SYS_IPRST3_UART14RST_Pos) /*!< SYS_T::IPRST3: UART14RST Mask */ - -#define SYS_IPRST3_UART15RST_Pos (15) /*!< SYS_T::IPRST3: UART15RST Position */ -#define SYS_IPRST3_UART15RST_Msk (0x1ul << SYS_IPRST3_UART15RST_Pos) /*!< SYS_T::IPRST3: UART15RST Mask */ - -#define SYS_IPRST3_UART16RST_Pos (16) /*!< SYS_T::IPRST3: UART16RST Position */ -#define SYS_IPRST3_UART16RST_Msk (0x1ul << SYS_IPRST3_UART16RST_Pos) /*!< SYS_T::IPRST3: UART16RST Mask */ - -#define SYS_IPRST3_I2S1RST_Pos (17) /*!< SYS_T::IPRST3: I2S1RST Position */ -#define SYS_IPRST3_I2S1RST_Msk (0x1ul << SYS_IPRST3_I2S1RST_Pos) /*!< SYS_T::IPRST3: I2S1RST Mask */ - -#define SYS_IPRST3_I2C4RST_Pos (18) /*!< SYS_T::IPRST3: I2C4RST Position */ -#define SYS_IPRST3_I2C4RST_Msk (0x1ul << SYS_IPRST3_I2C4RST_Pos) /*!< SYS_T::IPRST3: I2C4RST Mask */ - -#define SYS_IPRST3_I2C5RST_Pos (19) /*!< SYS_T::IPRST3: I2C5RST Position */ -#define SYS_IPRST3_I2C5RST_Msk (0x1ul << SYS_IPRST3_I2C5RST_Pos) /*!< SYS_T::IPRST3: I2C5RST Mask */ - -#define SYS_IPRST3_EPWM2RST_Pos (20) /*!< SYS_T::IPRST3: EPWM2RST Position */ -#define SYS_IPRST3_EPWM2RST_Msk (0x1ul << SYS_IPRST3_EPWM2RST_Pos) /*!< SYS_T::IPRST3: EPWM2RST Mask */ - -#define SYS_IPRST3_ECAP2RST_Pos (21) /*!< SYS_T::IPRST3: ECAP2RST Position */ -#define SYS_IPRST3_ECAP2RST_Msk (0x1ul << SYS_IPRST3_ECAP2RST_Pos) /*!< SYS_T::IPRST3: ECAP2RST Mask */ - -#define SYS_IPRST3_QEI2RST_Pos (22) /*!< SYS_T::IPRST3: QEI2RST Position */ -#define SYS_IPRST3_QEI2RST_Msk (0x1ul << SYS_IPRST3_QEI2RST_Pos) /*!< SYS_T::IPRST3: QEI2RST Mask */ - -#define SYS_IPRST3_CANFD3RST_Pos (23) /*!< SYS_T::IPRST3: CANFD3RST Position */ -#define SYS_IPRST3_CANFD3RST_Msk (0x1ul << SYS_IPRST3_CANFD3RST_Pos) /*!< SYS_T::IPRST3: CANFD3RST Mask */ - -#define SYS_IPRST3_KPIRST_Pos (24) /*!< SYS_T::IPRST3: KPIRST Position */ -#define SYS_IPRST3_KPIRST_Msk (0x1ul << SYS_IPRST3_KPIRST_Pos) /*!< SYS_T::IPRST3: KPIRST Mask */ - -#define SYS_IPRST3_GICRST_Pos (28) /*!< SYS_T::IPRST3: GICRST Position */ -#define SYS_IPRST3_GICRST_Msk (0x1ul << SYS_IPRST3_GICRST_Pos) /*!< SYS_T::IPRST3: GICRST Mask */ - -#define SYS_IPRST3_SSMCCRST_Pos (30) /*!< SYS_T::IPRST3: SSMCCRST Position */ -#define SYS_IPRST3_SSMCCRST_Msk (0x1ul << SYS_IPRST3_SSMCCRST_Pos) /*!< SYS_T::IPRST3: SSMCCRST Mask */ - -#define SYS_IPRST3_SSPCCRST_Pos (31) /*!< SYS_T::IPRST3: SSPCCRST Position */ -#define SYS_IPRST3_SSPCCRST_Msk (0x1ul << SYS_IPRST3_SSPCCRST_Pos) /*!< SYS_T::IPRST3: SSPCCRST Mask */ - -#define SYS_PMUCR_A35PGEN_Pos (0) /*!< SYS_T::PMUCR: A35PGEN Position */ -#define SYS_PMUCR_A35PGEN_Msk (0x1ul << SYS_PMUCR_A35PGEN_Pos) /*!< SYS_T::PMUCR: A35PGEN Mask */ - -#define SYS_PMUCR_AUTOL2FDIS_Pos (4) /*!< SYS_T::PMUCR: AUTOL2FDIS Position */ -#define SYS_PMUCR_AUTOL2FDIS_Msk (0x1ul << SYS_PMUCR_AUTOL2FDIS_Pos) /*!< SYS_T::PMUCR: AUTOL2FDIS Mask */ - -#define SYS_PMUCR_PDWKDLY_Pos (6) /*!< SYS_T::PMUCR: PDWKDLY Position */ -#define SYS_PMUCR_PDWKDLY_Msk (0x1ul << SYS_PMUCR_PDWKDLY_Pos) /*!< SYS_T::PMUCR: PDWKDLY Mask */ - -#define SYS_PMUCR_PWRSTBTM_Pos (8) /*!< SYS_T::PMUCR: PWRSTBTM Position */ -#define SYS_PMUCR_PWRSTBTM_Msk (0xful << SYS_PMUCR_PWRSTBTM_Pos) /*!< SYS_T::PMUCR: PWRSTBTM Mask */ - -#define SYS_PMUCR_PWRACKTO_Pos (12) /*!< SYS_T::PMUCR: PWRACKTO Position */ -#define SYS_PMUCR_PWRACKTO_Msk (0xful << SYS_PMUCR_PWRACKTO_Pos) /*!< SYS_T::PMUCR: PWRACKTO Mask */ - -#define SYS_PMUCR_A35PDEN_Pos (16) /*!< SYS_T::PMUCR: A35PDEN Position */ -#define SYS_PMUCR_A35PDEN_Msk (0x1ul << SYS_PMUCR_A35PDEN_Pos) /*!< SYS_T::PMUCR: A35PDEN Mask */ - -#define SYS_PMUCR_A35DBPDEN_Pos (18) /*!< SYS_T::PMUCR: A35DBPDEN Position */ -#define SYS_PMUCR_A35DBPDEN_Msk (0x1ul << SYS_PMUCR_A35DBPDEN_Pos) /*!< SYS_T::PMUCR: A35DBPDEN Mask */ - -#define SYS_PMUCR_RTPPDEN_Pos (24) /*!< SYS_T::PMUCR: RTPPDEN Position */ -#define SYS_PMUCR_RTPPDEN_Msk (0x1ul << SYS_PMUCR_RTPPDEN_Pos) /*!< SYS_T::PMUCR: RTPPDEN Mask */ - -#define SYS_PMUCR_RTPDBPDEN_Pos (26) /*!< SYS_T::PMUCR: RTPDBPDEN Position */ -#define SYS_PMUCR_RTPDBPDEN_Msk (0x1ul << SYS_PMUCR_RTPDBPDEN_Pos) /*!< SYS_T::PMUCR: RTPDBPDEN Mask */ - -#define SYS_DDRCQCSR_AXIQBYPAS_Pos (0) /*!< SYS_T::DDRCQCSR: AXIQBYPAS Position */ -#define SYS_DDRCQCSR_AXIQBYPAS_Msk (0xfful << SYS_DDRCQCSR_AXIQBYPAS_Pos) /*!< SYS_T::DDRCQCSR: AXIQBYPAS Mask */ - -#define SYS_DDRCQCSR_AXIQDENYIF_Pos (8) /*!< SYS_T::DDRCQCSR: AXIQDENYIF Position */ -#define SYS_DDRCQCSR_AXIQDENYIF_Msk (0xfful << SYS_DDRCQCSR_AXIQDENYIF_Pos) /*!< SYS_T::DDRCQCSR: AXIQDENYIF Mask */ - -#define SYS_DDRCQCSR_DDRCQBYPAS_Pos (16) /*!< SYS_T::DDRCQCSR: DDRCQBYPAS Position */ -#define SYS_DDRCQCSR_DDRCQBYPAS_Msk (0x1ul << SYS_DDRCQCSR_DDRCQBYPAS_Pos) /*!< SYS_T::DDRCQCSR: DDRCQBYPAS Mask */ - -#define SYS_DDRCQCSR_DDRCQDENYIF_Pos (17) /*!< SYS_T::DDRCQCSR: DDRCQDENYIF Position */ -#define SYS_DDRCQCSR_DDRCQDENYIF_Msk (0x1ul << SYS_DDRCQCSR_DDRCQDENYIF_Pos) /*!< SYS_T::DDRCQCSR: DDRCQDENYIF Mask */ - -#define SYS_DDRCQCSR_DDRQREQDLY_Pos (24) /*!< SYS_T::DDRCQCSR: DDRQREQDLY Position */ -#define SYS_DDRCQCSR_DDRQREQDLY_Msk (0xful << SYS_DDRCQCSR_DDRQREQDLY_Pos) /*!< SYS_T::DDRCQCSR: DDRQREQDLY Mask */ - -#define SYS_DDRCQCSR_DDRQACKTO_Pos (28) /*!< SYS_T::DDRCQCSR: DDRQACKTO Position */ -#define SYS_DDRCQCSR_DDRQACKTO_Msk (0xful << SYS_DDRCQCSR_DDRQACKTO_Pos) /*!< SYS_T::DDRCQCSR: DDRQACKTO Mask */ - -#define SYS_PMUIEN_PMUIEN_Pos (0) /*!< SYS_T::PMUIEN: PMUIEN Position */ -#define SYS_PMUIEN_PMUIEN_Msk (0x1ul << SYS_PMUIEN_PMUIEN_Pos) /*!< SYS_T::PMUIEN: PMUIEN Mask */ - -#define SYS_PMUIEN_A35PDWKIEN_Pos (8) /*!< SYS_T::PMUIEN: A35PDWKIEN Position */ -#define SYS_PMUIEN_A35PDWKIEN_Msk (0x1ul << SYS_PMUIEN_A35PDWKIEN_Pos) /*!< SYS_T::PMUIEN: A35PDWKIEN Mask */ - -#define SYS_PMUIEN_RTPPDWKIEN_Pos (12) /*!< SYS_T::PMUIEN: RTPPDWKIEN Position */ -#define SYS_PMUIEN_RTPPDWKIEN_Msk (0x1ul << SYS_PMUIEN_RTPPDWKIEN_Pos) /*!< SYS_T::PMUIEN: RTPPDWKIEN Mask */ - -#define SYS_PMUSTS_PMUIF_Pos (0) /*!< SYS_T::PMUSTS: PMUIF Position */ -#define SYS_PMUSTS_PMUIF_Msk (0x1ul << SYS_PMUSTS_PMUIF_Pos) /*!< SYS_T::PMUSTS: PMUIF Mask */ - -#define SYS_PMUSTS_PGTOIF_Pos (1) /*!< SYS_T::PMUSTS: PGTOIF Position */ -#define SYS_PMUSTS_PGTOIF_Msk (0x1ul << SYS_PMUSTS_PGTOIF_Pos) /*!< SYS_T::PMUSTS: PGTOIF Mask */ - -#define SYS_PMUSTS_L2FDONE_Pos (5) /*!< SYS_T::PMUSTS: L2FDONE Position */ -#define SYS_PMUSTS_L2FDONE_Msk (0x1ul << SYS_PMUSTS_L2FDONE_Pos) /*!< SYS_T::PMUSTS: L2FDONE Mask */ - -#define SYS_PMUSTS_A35PDWKIF_Pos (8) /*!< SYS_T::PMUSTS: A35PDWKIF Position */ -#define SYS_PMUSTS_A35PDWKIF_Msk (0x1ul << SYS_PMUSTS_A35PDWKIF_Pos) /*!< SYS_T::PMUSTS: A35PDWKIF Mask */ - -#define SYS_PMUSTS_RTPPDWKIF_Pos (12) /*!< SYS_T::PMUSTS: RTPPDWKIF Position */ -#define SYS_PMUSTS_RTPPDWKIF_Msk (0x1ul << SYS_PMUSTS_RTPPDWKIF_Pos) /*!< SYS_T::PMUSTS: RTPPDWKIF Mask */ - -#define SYS_PMUSTS_PWRACKCNT_Pos (16) /*!< SYS_T::PMUSTS: PWRACKCNT Position */ -#define SYS_PMUSTS_PWRACKCNT_Msk (0xfffful << SYS_PMUSTS_PWRACKCNT_Pos) /*!< SYS_T::PMUSTS: PWRACKCNT Mask */ - -#define SYS_CA35WRBADR0_WRMBTADDR_Pos (0) /*!< SYS_T::CA35WRBADR0: WRMBTADDR Position */ -#define SYS_CA35WRBADR0_WRMBTADDR_Msk (0xfffffffful << SYS_CA35WRBADR0_WRMBTADDR_Pos) /*!< SYS_T::CA35WRBADR0: WRMBTADDR Mask */ - -#define SYS_CA35WRBPAR0_WRMBTPARA_Pos (0) /*!< SYS_T::CA35WRBPAR0: WRMBTPARA Position */ -#define SYS_CA35WRBPAR0_WRMBTPARA_Msk (0xfffffffful << SYS_CA35WRBPAR0_WRMBTPARA_Pos) /*!< SYS_T::CA35WRBPAR0: WRMBTPARA Mask */ - -#define SYS_CA35WRBADR1_WRMBTADDR_Pos (0) /*!< SYS_T::CA35WRBADR1: WRMBTADDR Position */ -#define SYS_CA35WRBADR1_WRMBTADDR_Msk (0xfffffffful << SYS_CA35WRBADR1_WRMBTADDR_Pos) /*!< SYS_T::CA35WRBADR1: WRMBTADDR Mask */ - -#define SYS_CA35WRBPAR1_WRMBTPARA_Pos (0) /*!< SYS_T::CA35WRBPAR1: WRMBTPARA Position */ -#define SYS_CA35WRBPAR1_WRMBTPARA_Msk (0xfffffffful << SYS_CA35WRBPAR1_WRMBTPARA_Pos) /*!< SYS_T::CA35WRBPAR1: WRMBTPARA Mask */ - -#define SYS_USBPMISCR_PHY0POR_Pos (0) /*!< SYS_T::USBPMISCR: PHY0POR Position */ -#define SYS_USBPMISCR_PHY0POR_Msk (0x1ul << SYS_USBPMISCR_PHY0POR_Pos) /*!< SYS_T::USBPMISCR: PHY0POR Mask */ - -#define SYS_USBPMISCR_PHY0SUSPEND_Pos (1) /*!< SYS_T::USBPMISCR: PHY0SUSPEND Position */ -#define SYS_USBPMISCR_PHY0SUSPEND_Msk (0x1ul << SYS_USBPMISCR_PHY0SUSPEND_Pos) /*!< SYS_T::USBPMISCR: PHY0SUSPEND Mask */ - -#define SYS_USBPMISCR_PHY0COMN_Pos (2) /*!< SYS_T::USBPMISCR: PHY0COMN Position */ -#define SYS_USBPMISCR_PHY0COMN_Msk (0x1ul << SYS_USBPMISCR_PHY0COMN_Pos) /*!< SYS_T::USBPMISCR: PHY0COMN Mask */ - -#define SYS_USBPMISCR_VBUSDGSEL_Pos (4) /*!< SYS_T::USBPMISCR: VBUSDGSEL Position */ -#define SYS_USBPMISCR_VBUSDGSEL_Msk (0x7ul << SYS_USBPMISCR_VBUSDGSEL_Pos) /*!< SYS_T::USBPMISCR: VBUSDGSEL Mask */ - -#define SYS_USBPMISCR_EFUSESEL0_Pos (7) /*!< SYS_T::USBPMISCR: EFUSESEL0 Position */ -#define SYS_USBPMISCR_EFUSESEL0_Msk (0x1ul << SYS_USBPMISCR_EFUSESEL0_Pos) /*!< SYS_T::USBPMISCR: EFUSESEL0 Mask */ - -#define SYS_USBPMISCR_PHY0HSTCKSTB_Pos (8) /*!< SYS_T::USBPMISCR: PHY0HSTCKSTB Position*/ -#define SYS_USBPMISCR_PHY0HSTCKSTB_Msk (0x1ul << SYS_USBPMISCR_PHY0HSTCKSTB_Pos) /*!< SYS_T::USBPMISCR: PHY0HSTCKSTB Mask */ - -#define SYS_USBPMISCR_PHY0CK12MSTB_Pos (9) /*!< SYS_T::USBPMISCR: PHY0CK12MSTB Position*/ -#define SYS_USBPMISCR_PHY0CK12MSTB_Msk (0x1ul << SYS_USBPMISCR_PHY0CK12MSTB_Pos) /*!< SYS_T::USBPMISCR: PHY0CK12MSTB Mask */ - -#define SYS_USBPMISCR_PHY0DEVCKSTB_Pos (10) /*!< SYS_T::USBPMISCR: PHY0DEVCKSTB Position*/ -#define SYS_USBPMISCR_PHY0DEVCKSTB_Msk (0x1ul << SYS_USBPMISCR_PHY0DEVCKSTB_Pos) /*!< SYS_T::USBPMISCR: PHY0DEVCKSTB Mask */ - -#define SYS_USBPMISCR_RTUNESEL0_Pos (11) /*!< SYS_T::USBPMISCR: RTUNESEL0 Position */ -#define SYS_USBPMISCR_RTUNESEL0_Msk (0x1ul << SYS_USBPMISCR_RTUNESEL0_Pos) /*!< SYS_T::USBPMISCR: RTUNESEL0 Mask */ - -#define SYS_USBPMISCR_RCALCODE0_Pos (12) /*!< SYS_T::USBPMISCR: RCALCODE0 Position */ -#define SYS_USBPMISCR_RCALCODE0_Msk (0xful << SYS_USBPMISCR_RCALCODE0_Pos) /*!< SYS_T::USBPMISCR: RCALCODE0 Mask */ - -#define SYS_USBPMISCR_PHY1POR_Pos (16) /*!< SYS_T::USBPMISCR: PHY1POR Position */ -#define SYS_USBPMISCR_PHY1POR_Msk (0x1ul << SYS_USBPMISCR_PHY1POR_Pos) /*!< SYS_T::USBPMISCR: PHY1POR Mask */ - -#define SYS_USBPMISCR_PHY1SUSPEND_Pos (17) /*!< SYS_T::USBPMISCR: PHY1SUSPEND Position */ -#define SYS_USBPMISCR_PHY1SUSPEND_Msk (0x1ul << SYS_USBPMISCR_PHY1SUSPEND_Pos) /*!< SYS_T::USBPMISCR: PHY1SUSPEND Mask */ - -#define SYS_USBPMISCR_PHY1COMN_Pos (18) /*!< SYS_T::USBPMISCR: PHY1COMN Position */ -#define SYS_USBPMISCR_PHY1COMN_Msk (0x1ul << SYS_USBPMISCR_PHY1COMN_Pos) /*!< SYS_T::USBPMISCR: PHY1COMN Mask */ - -#define SYS_USBPMISCR_EFUSESEL1_Pos (23) /*!< SYS_T::USBPMISCR: EFUSESEL1 Position */ -#define SYS_USBPMISCR_EFUSESEL1_Msk (0x1ul << SYS_USBPMISCR_EFUSESEL1_Pos) /*!< SYS_T::USBPMISCR: EFUSESEL1 Mask */ - -#define SYS_USBPMISCR_PHY1HSTCKSTB_Pos (24) /*!< SYS_T::USBPMISCR: PHY1HSTCKSTB Position*/ -#define SYS_USBPMISCR_PHY1HSTCKSTB_Msk (0x1ul << SYS_USBPMISCR_PHY1HSTCKSTB_Pos) /*!< SYS_T::USBPMISCR: PHY1HSTCKSTB Mask */ - -#define SYS_USBPMISCR_PHY1CK12MSTB_Pos (25) /*!< SYS_T::USBPMISCR: PHY1CK12MSTB Position*/ -#define SYS_USBPMISCR_PHY1CK12MSTB_Msk (0x1ul << SYS_USBPMISCR_PHY1CK12MSTB_Pos) /*!< SYS_T::USBPMISCR: PHY1CK12MSTB Mask */ - -#define SYS_USBPMISCR_RTUNESEL1_Pos (27) /*!< SYS_T::USBPMISCR: RTUNESEL1 Position */ -#define SYS_USBPMISCR_RTUNESEL1_Msk (0x1ul << SYS_USBPMISCR_RTUNESEL1_Pos) /*!< SYS_T::USBPMISCR: RTUNESEL1 Mask */ - -#define SYS_USBPMISCR_RCALCODE1_Pos (28) /*!< SYS_T::USBPMISCR: RCALCODE1 Position */ -#define SYS_USBPMISCR_RCALCODE1_Msk (0xful << SYS_USBPMISCR_RCALCODE1_Pos) /*!< SYS_T::USBPMISCR: RCALCODE1 Mask */ - -#define SYS_USBP0PCR_COMPDISTUNE_Pos (0) /*!< SYS_T::USBP0PCR: COMPDISTUNE Position */ -#define SYS_USBP0PCR_COMPDISTUNE_Msk (0x7ul << SYS_USBP0PCR_COMPDISTUNE_Pos) /*!< SYS_T::USBP0PCR: COMPDISTUNE Mask */ - -#define SYS_USBP0PCR_EQBYPASSENB_Pos (3) /*!< SYS_T::USBP0PCR: EQBYPASSENB Position */ -#define SYS_USBP0PCR_EQBYPASSENB_Msk (0x1ul << SYS_USBP0PCR_EQBYPASSENB_Pos) /*!< SYS_T::USBP0PCR: EQBYPASSENB Mask */ - -#define SYS_USBP0PCR_SQRXTUNE_Pos (4) /*!< SYS_T::USBP0PCR: SQRXTUNE Position */ -#define SYS_USBP0PCR_SQRXTUNE_Msk (0x7ul << SYS_USBP0PCR_SQRXTUNE_Pos) /*!< SYS_T::USBP0PCR: SQRXTUNE Mask */ - -#define SYS_USBP0PCR_TXPREEMPPULSETUNE_Pos (7) /*!< SYS_T::USBP0PCR: TXPREEMPPULSETUNE Position*/ -#define SYS_USBP0PCR_TXPREEMPPULSETUNE_Msk (0x1ul << SYS_USBP0PCR_TXPREEMPPULSETUNE_Pos) /*!< SYS_T::USBP0PCR: TXPREEMPPULSETUNE Mask*/ - -#define SYS_USBP0PCR_PLLPTUNE_Pos (8) /*!< SYS_T::USBP0PCR: PLLPTUNE Position */ -#define SYS_USBP0PCR_PLLPTUNE_Msk (0xful << SYS_USBP0PCR_PLLPTUNE_Pos) /*!< SYS_T::USBP0PCR: PLLPTUNE Mask */ - -#define SYS_USBP0PCR_TXFSLSTUNE_Pos (12) /*!< SYS_T::USBP0PCR: TXFSLSTUNE Position */ -#define SYS_USBP0PCR_TXFSLSTUNE_Msk (0xful << SYS_USBP0PCR_TXFSLSTUNE_Pos) /*!< SYS_T::USBP0PCR: TXFSLSTUNE Mask */ - -#define SYS_USBP0PCR_PLLITUNE_Pos (16) /*!< SYS_T::USBP0PCR: PLLITUNE Position */ -#define SYS_USBP0PCR_PLLITUNE_Msk (0x3ul << SYS_USBP0PCR_PLLITUNE_Pos) /*!< SYS_T::USBP0PCR: PLLITUNE Mask */ - -#define SYS_USBP0PCR_TXPREEMPAMPTUNE_Pos (20) /*!< SYS_T::USBP0PCR: TXPREEMPAMPTUNE Position*/ -#define SYS_USBP0PCR_TXPREEMPAMPTUNE_Msk (0x3ul << SYS_USBP0PCR_TXPREEMPAMPTUNE_Pos) /*!< SYS_T::USBP0PCR: TXPREEMPAMPTUNE Mask */ - -#define SYS_USBP0PCR_TXRISETUNE_Pos (22) /*!< SYS_T::USBP0PCR: TXRISETUNE Position */ -#define SYS_USBP0PCR_TXRISETUNE_Msk (0x3ul << SYS_USBP0PCR_TXRISETUNE_Pos) /*!< SYS_T::USBP0PCR: TXRISETUNE Mask */ - -#define SYS_USBP0PCR_TXVREFTUNE_Pos (24) /*!< SYS_T::USBP0PCR: TXVREFTUNE Position */ -#define SYS_USBP0PCR_TXVREFTUNE_Msk (0xful << SYS_USBP0PCR_TXVREFTUNE_Pos) /*!< SYS_T::USBP0PCR: TXVREFTUNE Mask */ - -#define SYS_USBP0PCR_TXHSXVTUNE_Pos (28) /*!< SYS_T::USBP0PCR: TXHSXVTUNE Position */ -#define SYS_USBP0PCR_TXHSXVTUNE_Msk (0x3ul << SYS_USBP0PCR_TXHSXVTUNE_Pos) /*!< SYS_T::USBP0PCR: TXHSXVTUNE Mask */ - -#define SYS_USBP0PCR_TXRESTUNE_Pos (30) /*!< SYS_T::USBP0PCR: TXRESTUNE Position */ -#define SYS_USBP0PCR_TXRESTUNE_Msk (0x3ul << SYS_USBP0PCR_TXRESTUNE_Pos) /*!< SYS_T::USBP0PCR: TXRESTUNE Mask */ - -#define SYS_USBP1PCR_COMPDISTUNE_Pos (0) /*!< SYS_T::USBP1PCR: COMPDISTUNE Position */ -#define SYS_USBP1PCR_COMPDISTUNE_Msk (0x7ul << SYS_USBP1PCR_COMPDISTUNE_Pos) /*!< SYS_T::USBP1PCR: COMPDISTUNE Mask */ - -#define SYS_USBP1PCR_EQBYPASSENB_Pos (3) /*!< SYS_T::USBP1PCR: EQBYPASSENB Position */ -#define SYS_USBP1PCR_EQBYPASSENB_Msk (0x1ul << SYS_USBP1PCR_EQBYPASSENB_Pos) /*!< SYS_T::USBP1PCR: EQBYPASSENB Mask */ - -#define SYS_USBP1PCR_SQRXTUNE_Pos (4) /*!< SYS_T::USBP1PCR: SQRXTUNE Position */ -#define SYS_USBP1PCR_SQRXTUNE_Msk (0x7ul << SYS_USBP1PCR_SQRXTUNE_Pos) /*!< SYS_T::USBP1PCR: SQRXTUNE Mask */ - -#define SYS_USBP1PCR_TXPREEMPPULSETUNE_Pos (7) /*!< SYS_T::USBP1PCR: TXPREEMPPULSETUNE Position*/ -#define SYS_USBP1PCR_TXPREEMPPULSETUNE_Msk (0x1ul << SYS_USBP1PCR_TXPREEMPPULSETUNE_Pos) /*!< SYS_T::USBP1PCR: TXPREEMPPULSETUNE Mask*/ - -#define SYS_USBP1PCR_PLLPTUNE_Pos (8) /*!< SYS_T::USBP1PCR: PLLPTUNE Position */ -#define SYS_USBP1PCR_PLLPTUNE_Msk (0xful << SYS_USBP1PCR_PLLPTUNE_Pos) /*!< SYS_T::USBP1PCR: PLLPTUNE Mask */ - -#define SYS_USBP1PCR_TXFSLSTUNE_Pos (12) /*!< SYS_T::USBP1PCR: TXFSLSTUNE Position */ -#define SYS_USBP1PCR_TXFSLSTUNE_Msk (0xful << SYS_USBP1PCR_TXFSLSTUNE_Pos) /*!< SYS_T::USBP1PCR: TXFSLSTUNE Mask */ - -#define SYS_USBP1PCR_PLLITUNE_Pos (16) /*!< SYS_T::USBP1PCR: PLLITUNE Position */ -#define SYS_USBP1PCR_PLLITUNE_Msk (0x3ul << SYS_USBP1PCR_PLLITUNE_Pos) /*!< SYS_T::USBP1PCR: PLLITUNE Mask */ - -#define SYS_USBP1PCR_TXPREEMPAMPTUNE_Pos (20) /*!< SYS_T::USBP1PCR: TXPREEMPAMPTUNE Position*/ -#define SYS_USBP1PCR_TXPREEMPAMPTUNE_Msk (0x3ul << SYS_USBP1PCR_TXPREEMPAMPTUNE_Pos) /*!< SYS_T::USBP1PCR: TXPREEMPAMPTUNE Mask */ - -#define SYS_USBP1PCR_TXRISETUNE_Pos (22) /*!< SYS_T::USBP1PCR: TXRISETUNE Position */ -#define SYS_USBP1PCR_TXRISETUNE_Msk (0x3ul << SYS_USBP1PCR_TXRISETUNE_Pos) /*!< SYS_T::USBP1PCR: TXRISETUNE Mask */ - -#define SYS_USBP1PCR_TXVREFTUNE_Pos (24) /*!< SYS_T::USBP1PCR: TXVREFTUNE Position */ -#define SYS_USBP1PCR_TXVREFTUNE_Msk (0xful << SYS_USBP1PCR_TXVREFTUNE_Pos) /*!< SYS_T::USBP1PCR: TXVREFTUNE Mask */ - -#define SYS_USBP1PCR_TXHSXVTUNE_Pos (28) /*!< SYS_T::USBP1PCR: TXHSXVTUNE Position */ -#define SYS_USBP1PCR_TXHSXVTUNE_Msk (0x3ul << SYS_USBP1PCR_TXHSXVTUNE_Pos) /*!< SYS_T::USBP1PCR: TXHSXVTUNE Mask */ - -#define SYS_USBP1PCR_TXRESTUNE_Pos (30) /*!< SYS_T::USBP1PCR: TXRESTUNE Position */ -#define SYS_USBP1PCR_TXRESTUNE_Msk (0x3ul << SYS_USBP1PCR_TXRESTUNE_Pos) /*!< SYS_T::USBP1PCR: TXRESTUNE Mask */ - -#define SYS_MISCFCR0_RTPICACHEN_Pos (0) /*!< SYS_T::MISCFCR0: RTPICACHEN Position */ -#define SYS_MISCFCR0_RTPICACHEN_Msk (0x1ul << SYS_MISCFCR0_RTPICACHEN_Pos) /*!< SYS_T::MISCFCR0: RTPICACHEN Mask */ - -#define SYS_MISCFCR0_RTPDCACHEN_Pos (1) /*!< SYS_T::MISCFCR0: RTPDCACHEN Position */ -#define SYS_MISCFCR0_RTPDCACHEN_Msk (0x1ul << SYS_MISCFCR0_RTPDCACHEN_Pos) /*!< SYS_T::MISCFCR0: RTPDCACHEN Mask */ - -#define SYS_MISCFCR0_RTPDRMAEN_Pos (2) /*!< SYS_T::MISCFCR0: RTPDRMAEN Position */ -#define SYS_MISCFCR0_RTPDRMAEN_Msk (0x1ul << SYS_MISCFCR0_RTPDRMAEN_Pos) /*!< SYS_T::MISCFCR0: RTPDRMAEN Mask */ - -#define SYS_MISCFCR0_WDT0RSTEN_Pos (8) /*!< SYS_T::MISCFCR0: WDT0RSTEN Position */ -#define SYS_MISCFCR0_WDT0RSTEN_Msk (0x1ul << SYS_MISCFCR0_WDT0RSTEN_Pos) /*!< SYS_T::MISCFCR0: WDT0RSTEN Mask */ - -#define SYS_MISCFCR0_HDSPUEN_Pos (9) /*!< SYS_T::MISCFCR0: HDSPUEN Position */ -#define SYS_MISCFCR0_HDSPUEN_Msk (0x1ul << SYS_MISCFCR0_HDSPUEN_Pos) /*!< SYS_T::MISCFCR0: HDSPUEN Mask */ - -#define SYS_MISCFCR0_UHOVRCURH_Pos (12) /*!< SYS_T::MISCFCR0: UHOVRCURH Position */ -#define SYS_MISCFCR0_UHOVRCURH_Msk (0x1ul << SYS_MISCFCR0_UHOVRCURH_Pos) /*!< SYS_T::MISCFCR0: UHOVRCURH Mask */ - -#define SYS_MISCFCR0_SELFTEST_Pos (13) /*!< SYS_T::MISCFCR0: SELFTEST Position */ -#define SYS_MISCFCR0_SELFTEST_Msk (0x1ul << SYS_MISCFCR0_SELFTEST_Pos) /*!< SYS_T::MISCFCR0: SELFTEST Mask */ - -#define SYS_MISCFCR0_WDT1RSTEN_Pos (14) /*!< SYS_T::MISCFCR0: WDT1RSTEN Position */ -#define SYS_MISCFCR0_WDT1RSTEN_Msk (0x1ul << SYS_MISCFCR0_WDT1RSTEN_Pos) /*!< SYS_T::MISCFCR0: WDT1RSTEN Mask */ - -#define SYS_MISCFCR0_WDT2RSTEN_Pos (15) /*!< SYS_T::MISCFCR0: WDT2RSTEN Position */ -#define SYS_MISCFCR0_WDT2RSTEN_Msk (0x1ul << SYS_MISCFCR0_WDT2RSTEN_Pos) /*!< SYS_T::MISCFCR0: WDT2RSTEN Mask */ - -#define SYS_MISCFCR0_SDH0VSTB_Pos (16) /*!< SYS_T::MISCFCR0: SDH0VSTB Position */ -#define SYS_MISCFCR0_SDH0VSTB_Msk (0x1ul << SYS_MISCFCR0_SDH0VSTB_Pos) /*!< SYS_T::MISCFCR0: SDH0VSTB Mask */ - -#define SYS_MISCFCR0_SDH1VSTB_Pos (17) /*!< SYS_T::MISCFCR0: SDH1VSTB Position */ -#define SYS_MISCFCR0_SDH1VSTB_Msk (0x1ul << SYS_MISCFCR0_SDH1VSTB_Pos) /*!< SYS_T::MISCFCR0: SDH1VSTB Mask */ - -#define SYS_MISCFCR0_VBUSWKEN_Pos (18) /*!< SYS_T::MISCFCR0: VBUSWKEN Position */ -#define SYS_MISCFCR0_VBUSWKEN_Msk (0x1ul << SYS_MISCFCR0_VBUSWKEN_Pos) /*!< SYS_T::MISCFCR0: VBUSWKEN Mask */ - -#define SYS_MISCFCR0_LNSTWKEN_Pos (19) /*!< SYS_T::MISCFCR0: LNSTWKEN Position */ -#define SYS_MISCFCR0_LNSTWKEN_Msk (0x1ul << SYS_MISCFCR0_LNSTWKEN_Pos) /*!< SYS_T::MISCFCR0: LNSTWKEN Mask */ - -#define SYS_MISCFCR0_DDRCGDIS_Pos (23) /*!< SYS_T::MISCFCR0: DDRCGDIS Position */ -#define SYS_MISCFCR0_DDRCGDIS_Msk (0x1ul << SYS_MISCFCR0_DDRCGDIS_Pos) /*!< SYS_T::MISCFCR0: DDRCGDIS Mask */ - -#define SYS_MISCFCR0_DRATSRDLY_Pos (24) /*!< SYS_T::MISCFCR0: DRATSRDLY Position */ -#define SYS_MISCFCR0_DRATSRDLY_Msk (0xfful << SYS_MISCFCR0_DRATSRDLY_Pos) /*!< SYS_T::MISCFCR0: DRATSRDLY Mask */ - -#define SYS_MISCFCR1_CANFD0PDEN_Pos (0) /*!< SYS_T::MISCFCR1: CANFD0PDEN Position */ -#define SYS_MISCFCR1_CANFD0PDEN_Msk (0x1ul << SYS_MISCFCR1_CANFD0PDEN_Pos) /*!< SYS_T::MISCFCR1: CANFD0PDEN Mask */ - -#define SYS_MISCFCR1_CANFD1PDEN_Pos (1) /*!< SYS_T::MISCFCR1: CANFD1PDEN Position */ -#define SYS_MISCFCR1_CANFD1PDEN_Msk (0x1ul << SYS_MISCFCR1_CANFD1PDEN_Pos) /*!< SYS_T::MISCFCR1: CANFD1PDEN Mask */ - -#define SYS_MISCFCR1_CANFD2PDEN_Pos (2) /*!< SYS_T::MISCFCR1: CANFD2PDEN Position */ -#define SYS_MISCFCR1_CANFD2PDEN_Msk (0x1ul << SYS_MISCFCR1_CANFD2PDEN_Pos) /*!< SYS_T::MISCFCR1: CANFD2PDEN Mask */ - -#define SYS_MISCFCR1_CANFD3PDEN_Pos (3) /*!< SYS_T::MISCFCR1: CANFD3PDEN Position */ -#define SYS_MISCFCR1_CANFD3PDEN_Msk (0x1ul << SYS_MISCFCR1_CANFD3PDEN_Pos) /*!< SYS_T::MISCFCR1: CANFD3PDEN Mask */ - -#define SYS_MISCFCR1_CANFD0CKSTP_Pos (4) /*!< SYS_T::MISCFCR1: CANFD0CKSTP Position */ -#define SYS_MISCFCR1_CANFD0CKSTP_Msk (0x1ul << SYS_MISCFCR1_CANFD0CKSTP_Pos) /*!< SYS_T::MISCFCR1: CANFD0CKSTP Mask */ - -#define SYS_MISCFCR1_CANFD1CKSTP_Pos (5) /*!< SYS_T::MISCFCR1: CANFD1CKSTP Position */ -#define SYS_MISCFCR1_CANFD1CKSTP_Msk (0x1ul << SYS_MISCFCR1_CANFD1CKSTP_Pos) /*!< SYS_T::MISCFCR1: CANFD1CKSTP Mask */ - -#define SYS_MISCFCR1_CANFD2CKSTP_Pos (6) /*!< SYS_T::MISCFCR1: CANFD2CKSTP Position */ -#define SYS_MISCFCR1_CANFD2CKSTP_Msk (0x1ul << SYS_MISCFCR1_CANFD2CKSTP_Pos) /*!< SYS_T::MISCFCR1: CANFD2CKSTP Mask */ - -#define SYS_MISCFCR1_CANFD3CKSTP_Pos (7) /*!< SYS_T::MISCFCR1: CANFD3CKSTP Position */ -#define SYS_MISCFCR1_CANFD3CKSTP_Msk (0x1ul << SYS_MISCFCR1_CANFD3CKSTP_Pos) /*!< SYS_T::MISCFCR1: CANFD3CKSTP Mask */ - -#define SYS_MISCFCR1_HXTDS_Pos (8) /*!< SYS_T::MISCFCR1: HXTDS Position */ -#define SYS_MISCFCR1_HXTDS_Msk (0x3ul << SYS_MISCFCR1_HXTDS_Pos) /*!< SYS_T::MISCFCR1: HXTDS Mask */ - -#define SYS_MISCFCR1_TSENSRTRIM_Pos (12) /*!< SYS_T::MISCFCR1: TSENSRTRIM Position */ -#define SYS_MISCFCR1_TSENSRTRIM_Msk (0xful << SYS_MISCFCR1_TSENSRTRIM_Pos) /*!< SYS_T::MISCFCR1: TSENSRTRIM Mask */ - -#define SYS_MISCFCR1_RMEL1RAM_Pos (16) /*!< SYS_T::MISCFCR1: RMEL1RAM Position */ -#define SYS_MISCFCR1_RMEL1RAM_Msk (0x1ul << SYS_MISCFCR1_RMEL1RAM_Pos) /*!< SYS_T::MISCFCR1: RMEL1RAM Mask */ - -#define SYS_MISCFCR1_RMESYSRAM_Pos (17) /*!< SYS_T::MISCFCR1: RMESYSRAM Position */ -#define SYS_MISCFCR1_RMESYSRAM_Msk (0x1ul << SYS_MISCFCR1_RMESYSRAM_Pos) /*!< SYS_T::MISCFCR1: RMESYSRAM Mask */ - -#define SYS_MISCIER_LVDIEN_Pos (0) /*!< SYS_T::MISCIER: LVDIEN Position */ -#define SYS_MISCIER_LVDIEN_Msk (0x1ul << SYS_MISCIER_LVDIEN_Pos) /*!< SYS_T::MISCIER: LVDIEN Mask */ - -#define SYS_MISCIER_USB0IDCHGIEN_Pos (1) /*!< SYS_T::MISCIER: USB0IDCHGIEN Position */ -#define SYS_MISCIER_USB0IDCHGIEN_Msk (0x1ul << SYS_MISCIER_USB0IDCHGIEN_Pos) /*!< SYS_T::MISCIER: USB0IDCHGIEN Mask */ - -#define SYS_MISCIER_VBUSCHGIEN_Pos (2) /*!< SYS_T::MISCIER: VBUSCHGIEN Position */ -#define SYS_MISCIER_VBUSCHGIEN_Msk (0x1ul << SYS_MISCIER_VBUSCHGIEN_Pos) /*!< SYS_T::MISCIER: VBUSCHGIEN Mask */ - -#define SYS_MISCISR_LVDIF_Pos (0) /*!< SYS_T::MISCISR: LVDIF Position */ -#define SYS_MISCISR_LVDIF_Msk (0x1ul << SYS_MISCISR_LVDIF_Pos) /*!< SYS_T::MISCISR: LVDIF Mask */ - -#define SYS_MISCISR_USB0IDCHGIF_Pos (1) /*!< SYS_T::MISCISR: USB0IDCHGIF Position */ -#define SYS_MISCISR_USB0IDCHGIF_Msk (0x1ul << SYS_MISCISR_USB0IDCHGIF_Pos) /*!< SYS_T::MISCISR: USB0IDCHGIF Mask */ - -#define SYS_MISCISR_VBUSCHGIF_Pos (2) /*!< SYS_T::MISCISR: VBUSCHGIF Position */ -#define SYS_MISCISR_VBUSCHGIF_Msk (0x1ul << SYS_MISCISR_VBUSCHGIF_Pos) /*!< SYS_T::MISCISR: VBUSCHGIF Mask */ - -#define SYS_MISCISR_LVDSTS_Pos (16) /*!< SYS_T::MISCISR: LVDSTS Position */ -#define SYS_MISCISR_LVDSTS_Msk (0x1ul << SYS_MISCISR_LVDSTS_Pos) /*!< SYS_T::MISCISR: LVDSTS Mask */ - -#define SYS_MISCISR_USB0IDSTS_Pos (17) /*!< SYS_T::MISCISR: USB0IDSTS Position */ -#define SYS_MISCISR_USB0IDSTS_Msk (0x1ul << SYS_MISCISR_USB0IDSTS_Pos) /*!< SYS_T::MISCISR: USB0IDSTS Mask */ - -#define SYS_MISCISR_VBUSSTS_Pos (18) /*!< SYS_T::MISCISR: VBUSSTS Position */ -#define SYS_MISCISR_VBUSSTS_Msk (0x1ul << SYS_MISCISR_VBUSSTS_Pos) /*!< SYS_T::MISCISR: VBUSSTS Mask */ - -#define SYS_GPA_MFPL_PA0MFP_Pos (0) /*!< SYS_T::GPA_MFPL: PA0MFP Position */ -#define SYS_GPA_MFPL_PA0MFP_Msk (0xful << SYS_GPA_MFPL_PA0MFP_Pos) /*!< SYS_T::GPA_MFPL: PA0MFP Mask */ - -#define SYS_GPA_MFPL_PA1MFP_Pos (4) /*!< SYS_T::GPA_MFPL: PA1MFP Position */ -#define SYS_GPA_MFPL_PA1MFP_Msk (0xful << SYS_GPA_MFPL_PA1MFP_Pos) /*!< SYS_T::GPA_MFPL: PA1MFP Mask */ - -#define SYS_GPA_MFPL_PA2MFP_Pos (8) /*!< SYS_T::GPA_MFPL: PA2MFP Position */ -#define SYS_GPA_MFPL_PA2MFP_Msk (0xful << SYS_GPA_MFPL_PA2MFP_Pos) /*!< SYS_T::GPA_MFPL: PA2MFP Mask */ - -#define SYS_GPA_MFPL_PA3MFP_Pos (12) /*!< SYS_T::GPA_MFPL: PA3MFP Position */ -#define SYS_GPA_MFPL_PA3MFP_Msk (0xful << SYS_GPA_MFPL_PA3MFP_Pos) /*!< SYS_T::GPA_MFPL: PA3MFP Mask */ - -#define SYS_GPA_MFPL_PA4MFP_Pos (16) /*!< SYS_T::GPA_MFPL: PA4MFP Position */ -#define SYS_GPA_MFPL_PA4MFP_Msk (0xful << SYS_GPA_MFPL_PA4MFP_Pos) /*!< SYS_T::GPA_MFPL: PA4MFP Mask */ - -#define SYS_GPA_MFPL_PA5MFP_Pos (20) /*!< SYS_T::GPA_MFPL: PA5MFP Position */ -#define SYS_GPA_MFPL_PA5MFP_Msk (0xful << SYS_GPA_MFPL_PA5MFP_Pos) /*!< SYS_T::GPA_MFPL: PA5MFP Mask */ - -#define SYS_GPA_MFPL_PA6MFP_Pos (24) /*!< SYS_T::GPA_MFPL: PA6MFP Position */ -#define SYS_GPA_MFPL_PA6MFP_Msk (0xful << SYS_GPA_MFPL_PA6MFP_Pos) /*!< SYS_T::GPA_MFPL: PA6MFP Mask */ - -#define SYS_GPA_MFPL_PA7MFP_Pos (28) /*!< SYS_T::GPA_MFPL: PA7MFP Position */ -#define SYS_GPA_MFPL_PA7MFP_Msk (0xful << SYS_GPA_MFPL_PA7MFP_Pos) /*!< SYS_T::GPA_MFPL: PA7MFP Mask */ - -#define SYS_GPA_MFPH_PA8MFP_Pos (0) /*!< SYS_T::GPA_MFPH: PA8MFP Position */ -#define SYS_GPA_MFPH_PA8MFP_Msk (0xful << SYS_GPA_MFPH_PA8MFP_Pos) /*!< SYS_T::GPA_MFPH: PA8MFP Mask */ - -#define SYS_GPA_MFPH_PA9MFP_Pos (4) /*!< SYS_T::GPA_MFPH: PA9MFP Position */ -#define SYS_GPA_MFPH_PA9MFP_Msk (0xful << SYS_GPA_MFPH_PA9MFP_Pos) /*!< SYS_T::GPA_MFPH: PA9MFP Mask */ - -#define SYS_GPA_MFPH_PA10MFP_Pos (8) /*!< SYS_T::GPA_MFPH: PA10MFP Position */ -#define SYS_GPA_MFPH_PA10MFP_Msk (0xful << SYS_GPA_MFPH_PA10MFP_Pos) /*!< SYS_T::GPA_MFPH: PA10MFP Mask */ - -#define SYS_GPA_MFPH_PA11MFP_Pos (12) /*!< SYS_T::GPA_MFPH: PA11MFP Position */ -#define SYS_GPA_MFPH_PA11MFP_Msk (0xful << SYS_GPA_MFPH_PA11MFP_Pos) /*!< SYS_T::GPA_MFPH: PA11MFP Mask */ - -#define SYS_GPA_MFPH_PA12MFP_Pos (16) /*!< SYS_T::GPA_MFPH: PA12MFP Position */ -#define SYS_GPA_MFPH_PA12MFP_Msk (0xful << SYS_GPA_MFPH_PA12MFP_Pos) /*!< SYS_T::GPA_MFPH: PA12MFP Mask */ - -#define SYS_GPA_MFPH_PA13MFP_Pos (20) /*!< SYS_T::GPA_MFPH: PA13MFP Position */ -#define SYS_GPA_MFPH_PA13MFP_Msk (0xful << SYS_GPA_MFPH_PA13MFP_Pos) /*!< SYS_T::GPA_MFPH: PA13MFP Mask */ - -#define SYS_GPA_MFPH_PA14MFP_Pos (24) /*!< SYS_T::GPA_MFPH: PA14MFP Position */ -#define SYS_GPA_MFPH_PA14MFP_Msk (0xful << SYS_GPA_MFPH_PA14MFP_Pos) /*!< SYS_T::GPA_MFPH: PA14MFP Mask */ - -#define SYS_GPA_MFPH_PA15MFP_Pos (28) /*!< SYS_T::GPA_MFPH: PA15MFP Position */ -#define SYS_GPA_MFPH_PA15MFP_Msk (0xful << SYS_GPA_MFPH_PA15MFP_Pos) /*!< SYS_T::GPA_MFPH: PA15MFP Mask */ - -#define SYS_GPB_MFPL_PB0MFP_Pos (0) /*!< SYS_T::GPB_MFPL: PB0MFP Position */ -#define SYS_GPB_MFPL_PB0MFP_Msk (0xful << SYS_GPB_MFPL_PB0MFP_Pos) /*!< SYS_T::GPB_MFPL: PB0MFP Mask */ - -#define SYS_GPB_MFPL_PB1MFP_Pos (4) /*!< SYS_T::GPB_MFPL: PB1MFP Position */ -#define SYS_GPB_MFPL_PB1MFP_Msk (0xful << SYS_GPB_MFPL_PB1MFP_Pos) /*!< SYS_T::GPB_MFPL: PB1MFP Mask */ - -#define SYS_GPB_MFPL_PB2MFP_Pos (8) /*!< SYS_T::GPB_MFPL: PB2MFP Position */ -#define SYS_GPB_MFPL_PB2MFP_Msk (0xful << SYS_GPB_MFPL_PB2MFP_Pos) /*!< SYS_T::GPB_MFPL: PB2MFP Mask */ - -#define SYS_GPB_MFPL_PB3MFP_Pos (12) /*!< SYS_T::GPB_MFPL: PB3MFP Position */ -#define SYS_GPB_MFPL_PB3MFP_Msk (0xful << SYS_GPB_MFPL_PB3MFP_Pos) /*!< SYS_T::GPB_MFPL: PB3MFP Mask */ - -#define SYS_GPB_MFPL_PB4MFP_Pos (16) /*!< SYS_T::GPB_MFPL: PB4MFP Position */ -#define SYS_GPB_MFPL_PB4MFP_Msk (0xful << SYS_GPB_MFPL_PB4MFP_Pos) /*!< SYS_T::GPB_MFPL: PB4MFP Mask */ - -#define SYS_GPB_MFPL_PB5MFP_Pos (20) /*!< SYS_T::GPB_MFPL: PB5MFP Position */ -#define SYS_GPB_MFPL_PB5MFP_Msk (0xful << SYS_GPB_MFPL_PB5MFP_Pos) /*!< SYS_T::GPB_MFPL: PB5MFP Mask */ - -#define SYS_GPB_MFPL_PB6MFP_Pos (24) /*!< SYS_T::GPB_MFPL: PB6MFP Position */ -#define SYS_GPB_MFPL_PB6MFP_Msk (0xful << SYS_GPB_MFPL_PB6MFP_Pos) /*!< SYS_T::GPB_MFPL: PB6MFP Mask */ - -#define SYS_GPB_MFPL_PB7MFP_Pos (28) /*!< SYS_T::GPB_MFPL: PB7MFP Position */ -#define SYS_GPB_MFPL_PB7MFP_Msk (0xful << SYS_GPB_MFPL_PB7MFP_Pos) /*!< SYS_T::GPB_MFPL: PB7MFP Mask */ - -#define SYS_GPB_MFPH_PB8MFP_Pos (0) /*!< SYS_T::GPB_MFPH: PB8MFP Position */ -#define SYS_GPB_MFPH_PB8MFP_Msk (0xful << SYS_GPB_MFPH_PB8MFP_Pos) /*!< SYS_T::GPB_MFPH: PB8MFP Mask */ - -#define SYS_GPB_MFPH_PB9MFP_Pos (4) /*!< SYS_T::GPB_MFPH: PB9MFP Position */ -#define SYS_GPB_MFPH_PB9MFP_Msk (0xful << SYS_GPB_MFPH_PB9MFP_Pos) /*!< SYS_T::GPB_MFPH: PB9MFP Mask */ - -#define SYS_GPB_MFPH_PB10MFP_Pos (8) /*!< SYS_T::GPB_MFPH: PB10MFP Position */ -#define SYS_GPB_MFPH_PB10MFP_Msk (0xful << SYS_GPB_MFPH_PB10MFP_Pos) /*!< SYS_T::GPB_MFPH: PB10MFP Mask */ - -#define SYS_GPB_MFPH_PB11MFP_Pos (12) /*!< SYS_T::GPB_MFPH: PB11MFP Position */ -#define SYS_GPB_MFPH_PB11MFP_Msk (0xful << SYS_GPB_MFPH_PB11MFP_Pos) /*!< SYS_T::GPB_MFPH: PB11MFP Mask */ - -#define SYS_GPB_MFPH_PB12MFP_Pos (16) /*!< SYS_T::GPB_MFPH: PB12MFP Position */ -#define SYS_GPB_MFPH_PB12MFP_Msk (0xful << SYS_GPB_MFPH_PB12MFP_Pos) /*!< SYS_T::GPB_MFPH: PB12MFP Mask */ - -#define SYS_GPB_MFPH_PB13MFP_Pos (20) /*!< SYS_T::GPB_MFPH: PB13MFP Position */ -#define SYS_GPB_MFPH_PB13MFP_Msk (0xful << SYS_GPB_MFPH_PB13MFP_Pos) /*!< SYS_T::GPB_MFPH: PB13MFP Mask */ - -#define SYS_GPB_MFPH_PB14MFP_Pos (24) /*!< SYS_T::GPB_MFPH: PB14MFP Position */ -#define SYS_GPB_MFPH_PB14MFP_Msk (0xful << SYS_GPB_MFPH_PB14MFP_Pos) /*!< SYS_T::GPB_MFPH: PB14MFP Mask */ - -#define SYS_GPB_MFPH_PB15MFP_Pos (28) /*!< SYS_T::GPB_MFPH: PB15MFP Position */ -#define SYS_GPB_MFPH_PB15MFP_Msk (0xful << SYS_GPB_MFPH_PB15MFP_Pos) /*!< SYS_T::GPB_MFPH: PB15MFP Mask */ - -#define SYS_GPC_MFPL_PC0MFP_Pos (0) /*!< SYS_T::GPC_MFPL: PC0MFP Position */ -#define SYS_GPC_MFPL_PC0MFP_Msk (0xful << SYS_GPC_MFPL_PC0MFP_Pos) /*!< SYS_T::GPC_MFPL: PC0MFP Mask */ - -#define SYS_GPC_MFPL_PC1MFP_Pos (4) /*!< SYS_T::GPC_MFPL: PC1MFP Position */ -#define SYS_GPC_MFPL_PC1MFP_Msk (0xful << SYS_GPC_MFPL_PC1MFP_Pos) /*!< SYS_T::GPC_MFPL: PC1MFP Mask */ - -#define SYS_GPC_MFPL_PC2MFP_Pos (8) /*!< SYS_T::GPC_MFPL: PC2MFP Position */ -#define SYS_GPC_MFPL_PC2MFP_Msk (0xful << SYS_GPC_MFPL_PC2MFP_Pos) /*!< SYS_T::GPC_MFPL: PC2MFP Mask */ - -#define SYS_GPC_MFPL_PC3MFP_Pos (12) /*!< SYS_T::GPC_MFPL: PC3MFP Position */ -#define SYS_GPC_MFPL_PC3MFP_Msk (0xful << SYS_GPC_MFPL_PC3MFP_Pos) /*!< SYS_T::GPC_MFPL: PC3MFP Mask */ - -#define SYS_GPC_MFPL_PC4MFP_Pos (16) /*!< SYS_T::GPC_MFPL: PC4MFP Position */ -#define SYS_GPC_MFPL_PC4MFP_Msk (0xful << SYS_GPC_MFPL_PC4MFP_Pos) /*!< SYS_T::GPC_MFPL: PC4MFP Mask */ - -#define SYS_GPC_MFPL_PC5MFP_Pos (20) /*!< SYS_T::GPC_MFPL: PC5MFP Position */ -#define SYS_GPC_MFPL_PC5MFP_Msk (0xful << SYS_GPC_MFPL_PC5MFP_Pos) /*!< SYS_T::GPC_MFPL: PC5MFP Mask */ - -#define SYS_GPC_MFPL_PC6MFP_Pos (24) /*!< SYS_T::GPC_MFPL: PC6MFP Position */ -#define SYS_GPC_MFPL_PC6MFP_Msk (0xful << SYS_GPC_MFPL_PC6MFP_Pos) /*!< SYS_T::GPC_MFPL: PC6MFP Mask */ - -#define SYS_GPC_MFPL_PC7MFP_Pos (28) /*!< SYS_T::GPC_MFPL: PC7MFP Position */ -#define SYS_GPC_MFPL_PC7MFP_Msk (0xful << SYS_GPC_MFPL_PC7MFP_Pos) /*!< SYS_T::GPC_MFPL: PC7MFP Mask */ - -#define SYS_GPC_MFPH_PC8MFP_Pos (0) /*!< SYS_T::GPC_MFPH: PC8MFP Position */ -#define SYS_GPC_MFPH_PC8MFP_Msk (0xful << SYS_GPC_MFPH_PC8MFP_Pos) /*!< SYS_T::GPC_MFPH: PC8MFP Mask */ - -#define SYS_GPC_MFPH_PC9MFP_Pos (4) /*!< SYS_T::GPC_MFPH: PC9MFP Position */ -#define SYS_GPC_MFPH_PC9MFP_Msk (0xful << SYS_GPC_MFPH_PC9MFP_Pos) /*!< SYS_T::GPC_MFPH: PC9MFP Mask */ - -#define SYS_GPC_MFPH_PC10MFP_Pos (8) /*!< SYS_T::GPC_MFPH: PC10MFP Position */ -#define SYS_GPC_MFPH_PC10MFP_Msk (0xful << SYS_GPC_MFPH_PC10MFP_Pos) /*!< SYS_T::GPC_MFPH: PC10MFP Mask */ - -#define SYS_GPC_MFPH_PC11MFP_Pos (12) /*!< SYS_T::GPC_MFPH: PC11MFP Position */ -#define SYS_GPC_MFPH_PC11MFP_Msk (0xful << SYS_GPC_MFPH_PC11MFP_Pos) /*!< SYS_T::GPC_MFPH: PC11MFP Mask */ - -#define SYS_GPC_MFPH_PC12MFP_Pos (16) /*!< SYS_T::GPC_MFPH: PC12MFP Position */ -#define SYS_GPC_MFPH_PC12MFP_Msk (0xful << SYS_GPC_MFPH_PC12MFP_Pos) /*!< SYS_T::GPC_MFPH: PC12MFP Mask */ - -#define SYS_GPC_MFPH_PC13MFP_Pos (20) /*!< SYS_T::GPC_MFPH: PC13MFP Position */ -#define SYS_GPC_MFPH_PC13MFP_Msk (0xful << SYS_GPC_MFPH_PC13MFP_Pos) /*!< SYS_T::GPC_MFPH: PC13MFP Mask */ - -#define SYS_GPC_MFPH_PC14MFP_Pos (24) /*!< SYS_T::GPC_MFPH: PC14MFP Position */ -#define SYS_GPC_MFPH_PC14MFP_Msk (0xful << SYS_GPC_MFPH_PC14MFP_Pos) /*!< SYS_T::GPC_MFPH: PC14MFP Mask */ - -#define SYS_GPC_MFPH_PC15MFP_Pos (28) /*!< SYS_T::GPC_MFPH: PC15MFP Position */ -#define SYS_GPC_MFPH_PC15MFP_Msk (0xful << SYS_GPC_MFPH_PC15MFP_Pos) /*!< SYS_T::GPC_MFPH: PC15MFP Mask */ - -#define SYS_GPD_MFPL_PD0MFP_Pos (0) /*!< SYS_T::GPD_MFPL: PD0MFP Position */ -#define SYS_GPD_MFPL_PD0MFP_Msk (0xful << SYS_GPD_MFPL_PD0MFP_Pos) /*!< SYS_T::GPD_MFPL: PD0MFP Mask */ - -#define SYS_GPD_MFPL_PD1MFP_Pos (4) /*!< SYS_T::GPD_MFPL: PD1MFP Position */ -#define SYS_GPD_MFPL_PD1MFP_Msk (0xful << SYS_GPD_MFPL_PD1MFP_Pos) /*!< SYS_T::GPD_MFPL: PD1MFP Mask */ - -#define SYS_GPD_MFPL_PD2MFP_Pos (8) /*!< SYS_T::GPD_MFPL: PD2MFP Position */ -#define SYS_GPD_MFPL_PD2MFP_Msk (0xful << SYS_GPD_MFPL_PD2MFP_Pos) /*!< SYS_T::GPD_MFPL: PD2MFP Mask */ - -#define SYS_GPD_MFPL_PD3MFP_Pos (12) /*!< SYS_T::GPD_MFPL: PD3MFP Position */ -#define SYS_GPD_MFPL_PD3MFP_Msk (0xful << SYS_GPD_MFPL_PD3MFP_Pos) /*!< SYS_T::GPD_MFPL: PD3MFP Mask */ - -#define SYS_GPD_MFPL_PD4MFP_Pos (16) /*!< SYS_T::GPD_MFPL: PD4MFP Position */ -#define SYS_GPD_MFPL_PD4MFP_Msk (0xful << SYS_GPD_MFPL_PD4MFP_Pos) /*!< SYS_T::GPD_MFPL: PD4MFP Mask */ - -#define SYS_GPD_MFPL_PD5MFP_Pos (20) /*!< SYS_T::GPD_MFPL: PD5MFP Position */ -#define SYS_GPD_MFPL_PD5MFP_Msk (0xful << SYS_GPD_MFPL_PD5MFP_Pos) /*!< SYS_T::GPD_MFPL: PD5MFP Mask */ - -#define SYS_GPD_MFPL_PD6MFP_Pos (24) /*!< SYS_T::GPD_MFPL: PD6MFP Position */ -#define SYS_GPD_MFPL_PD6MFP_Msk (0xful << SYS_GPD_MFPL_PD6MFP_Pos) /*!< SYS_T::GPD_MFPL: PD6MFP Mask */ - -#define SYS_GPD_MFPL_PD7MFP_Pos (28) /*!< SYS_T::GPD_MFPL: PD7MFP Position */ -#define SYS_GPD_MFPL_PD7MFP_Msk (0xful << SYS_GPD_MFPL_PD7MFP_Pos) /*!< SYS_T::GPD_MFPL: PD7MFP Mask */ - -#define SYS_GPD_MFPH_PD8MFP_Pos (0) /*!< SYS_T::GPD_MFPH: PD8MFP Position */ -#define SYS_GPD_MFPH_PD8MFP_Msk (0xful << SYS_GPD_MFPH_PD8MFP_Pos) /*!< SYS_T::GPD_MFPH: PD8MFP Mask */ - -#define SYS_GPD_MFPH_PD9MFP_Pos (4) /*!< SYS_T::GPD_MFPH: PD9MFP Position */ -#define SYS_GPD_MFPH_PD9MFP_Msk (0xful << SYS_GPD_MFPH_PD9MFP_Pos) /*!< SYS_T::GPD_MFPH: PD9MFP Mask */ - -#define SYS_GPD_MFPH_PD10MFP_Pos (8) /*!< SYS_T::GPD_MFPH: PD10MFP Position */ -#define SYS_GPD_MFPH_PD10MFP_Msk (0xful << SYS_GPD_MFPH_PD10MFP_Pos) /*!< SYS_T::GPD_MFPH: PD10MFP Mask */ - -#define SYS_GPD_MFPH_PD11MFP_Pos (12) /*!< SYS_T::GPD_MFPH: PD11MFP Position */ -#define SYS_GPD_MFPH_PD11MFP_Msk (0xful << SYS_GPD_MFPH_PD11MFP_Pos) /*!< SYS_T::GPD_MFPH: PD11MFP Mask */ - -#define SYS_GPD_MFPH_PD12MFP_Pos (16) /*!< SYS_T::GPD_MFPH: PD12MFP Position */ -#define SYS_GPD_MFPH_PD12MFP_Msk (0xful << SYS_GPD_MFPH_PD12MFP_Pos) /*!< SYS_T::GPD_MFPH: PD12MFP Mask */ - -#define SYS_GPD_MFPH_PD13MFP_Pos (20) /*!< SYS_T::GPD_MFPH: PD13MFP Position */ -#define SYS_GPD_MFPH_PD13MFP_Msk (0xful << SYS_GPD_MFPH_PD13MFP_Pos) /*!< SYS_T::GPD_MFPH: PD13MFP Mask */ - -#define SYS_GPD_MFPH_PD14MFP_Pos (24) /*!< SYS_T::GPD_MFPH: PD14MFP Position */ -#define SYS_GPD_MFPH_PD14MFP_Msk (0xful << SYS_GPD_MFPH_PD14MFP_Pos) /*!< SYS_T::GPD_MFPH: PD14MFP Mask */ - -#define SYS_GPD_MFPH_PD15MFP_Pos (28) /*!< SYS_T::GPD_MFPH: PD15MFP Position */ -#define SYS_GPD_MFPH_PD15MFP_Msk (0xful << SYS_GPD_MFPH_PD15MFP_Pos) /*!< SYS_T::GPD_MFPH: PD15MFP Mask */ - -#define SYS_GPE_MFPL_PE0MFP_Pos (0) /*!< SYS_T::GPE_MFPL: PE0MFP Position */ -#define SYS_GPE_MFPL_PE0MFP_Msk (0xful << SYS_GPE_MFPL_PE0MFP_Pos) /*!< SYS_T::GPE_MFPL: PE0MFP Mask */ - -#define SYS_GPE_MFPL_PE1MFP_Pos (4) /*!< SYS_T::GPE_MFPL: PE1MFP Position */ -#define SYS_GPE_MFPL_PE1MFP_Msk (0xful << SYS_GPE_MFPL_PE1MFP_Pos) /*!< SYS_T::GPE_MFPL: PE1MFP Mask */ - -#define SYS_GPE_MFPL_PE2MFP_Pos (8) /*!< SYS_T::GPE_MFPL: PE2MFP Position */ -#define SYS_GPE_MFPL_PE2MFP_Msk (0xful << SYS_GPE_MFPL_PE2MFP_Pos) /*!< SYS_T::GPE_MFPL: PE2MFP Mask */ - -#define SYS_GPE_MFPL_PE3MFP_Pos (12) /*!< SYS_T::GPE_MFPL: PE3MFP Position */ -#define SYS_GPE_MFPL_PE3MFP_Msk (0xful << SYS_GPE_MFPL_PE3MFP_Pos) /*!< SYS_T::GPE_MFPL: PE3MFP Mask */ - -#define SYS_GPE_MFPL_PE4MFP_Pos (16) /*!< SYS_T::GPE_MFPL: PE4MFP Position */ -#define SYS_GPE_MFPL_PE4MFP_Msk (0xful << SYS_GPE_MFPL_PE4MFP_Pos) /*!< SYS_T::GPE_MFPL: PE4MFP Mask */ - -#define SYS_GPE_MFPL_PE5MFP_Pos (20) /*!< SYS_T::GPE_MFPL: PE5MFP Position */ -#define SYS_GPE_MFPL_PE5MFP_Msk (0xful << SYS_GPE_MFPL_PE5MFP_Pos) /*!< SYS_T::GPE_MFPL: PE5MFP Mask */ - -#define SYS_GPE_MFPL_PE6MFP_Pos (24) /*!< SYS_T::GPE_MFPL: PE6MFP Position */ -#define SYS_GPE_MFPL_PE6MFP_Msk (0xful << SYS_GPE_MFPL_PE6MFP_Pos) /*!< SYS_T::GPE_MFPL: PE6MFP Mask */ - -#define SYS_GPE_MFPL_PE7MFP_Pos (28) /*!< SYS_T::GPE_MFPL: PE7MFP Position */ -#define SYS_GPE_MFPL_PE7MFP_Msk (0xful << SYS_GPE_MFPL_PE7MFP_Pos) /*!< SYS_T::GPE_MFPL: PE7MFP Mask */ - -#define SYS_GPE_MFPH_PE8MFP_Pos (0) /*!< SYS_T::GPE_MFPH: PE8MFP Position */ -#define SYS_GPE_MFPH_PE8MFP_Msk (0xful << SYS_GPE_MFPH_PE8MFP_Pos) /*!< SYS_T::GPE_MFPH: PE8MFP Mask */ - -#define SYS_GPE_MFPH_PE9MFP_Pos (4) /*!< SYS_T::GPE_MFPH: PE9MFP Position */ -#define SYS_GPE_MFPH_PE9MFP_Msk (0xful << SYS_GPE_MFPH_PE9MFP_Pos) /*!< SYS_T::GPE_MFPH: PE9MFP Mask */ - -#define SYS_GPE_MFPH_PE10MFP_Pos (8) /*!< SYS_T::GPE_MFPH: PE10MFP Position */ -#define SYS_GPE_MFPH_PE10MFP_Msk (0xful << SYS_GPE_MFPH_PE10MFP_Pos) /*!< SYS_T::GPE_MFPH: PE10MFP Mask */ - -#define SYS_GPE_MFPH_PE11MFP_Pos (12) /*!< SYS_T::GPE_MFPH: PE11MFP Position */ -#define SYS_GPE_MFPH_PE11MFP_Msk (0xful << SYS_GPE_MFPH_PE11MFP_Pos) /*!< SYS_T::GPE_MFPH: PE11MFP Mask */ - -#define SYS_GPE_MFPH_PE12MFP_Pos (16) /*!< SYS_T::GPE_MFPH: PE12MFP Position */ -#define SYS_GPE_MFPH_PE12MFP_Msk (0xful << SYS_GPE_MFPH_PE12MFP_Pos) /*!< SYS_T::GPE_MFPH: PE12MFP Mask */ - -#define SYS_GPE_MFPH_PE13MFP_Pos (20) /*!< SYS_T::GPE_MFPH: PE13MFP Position */ -#define SYS_GPE_MFPH_PE13MFP_Msk (0xful << SYS_GPE_MFPH_PE13MFP_Pos) /*!< SYS_T::GPE_MFPH: PE13MFP Mask */ - -#define SYS_GPE_MFPH_PE14MFP_Pos (24) /*!< SYS_T::GPE_MFPH: PE14MFP Position */ -#define SYS_GPE_MFPH_PE14MFP_Msk (0xful << SYS_GPE_MFPH_PE14MFP_Pos) /*!< SYS_T::GPE_MFPH: PE14MFP Mask */ - -#define SYS_GPE_MFPH_PE15MFP_Pos (28) /*!< SYS_T::GPE_MFPH: PE15MFP Position */ -#define SYS_GPE_MFPH_PE15MFP_Msk (0xful << SYS_GPE_MFPH_PE15MFP_Pos) /*!< SYS_T::GPE_MFPH: PE15MFP Mask */ - -#define SYS_GPF_MFPL_PF0MFP_Pos (0) /*!< SYS_T::GPF_MFPL: PF0MFP Position */ -#define SYS_GPF_MFPL_PF0MFP_Msk (0xful << SYS_GPF_MFPL_PF0MFP_Pos) /*!< SYS_T::GPF_MFPL: PF0MFP Mask */ - -#define SYS_GPF_MFPL_PF1MFP_Pos (4) /*!< SYS_T::GPF_MFPL: PF1MFP Position */ -#define SYS_GPF_MFPL_PF1MFP_Msk (0xful << SYS_GPF_MFPL_PF1MFP_Pos) /*!< SYS_T::GPF_MFPL: PF1MFP Mask */ - -#define SYS_GPF_MFPL_PF2MFP_Pos (8) /*!< SYS_T::GPF_MFPL: PF2MFP Position */ -#define SYS_GPF_MFPL_PF2MFP_Msk (0xful << SYS_GPF_MFPL_PF2MFP_Pos) /*!< SYS_T::GPF_MFPL: PF2MFP Mask */ - -#define SYS_GPF_MFPL_PF3MFP_Pos (12) /*!< SYS_T::GPF_MFPL: PF3MFP Position */ -#define SYS_GPF_MFPL_PF3MFP_Msk (0xful << SYS_GPF_MFPL_PF3MFP_Pos) /*!< SYS_T::GPF_MFPL: PF3MFP Mask */ - -#define SYS_GPF_MFPL_PF4MFP_Pos (16) /*!< SYS_T::GPF_MFPL: PF4MFP Position */ -#define SYS_GPF_MFPL_PF4MFP_Msk (0xful << SYS_GPF_MFPL_PF4MFP_Pos) /*!< SYS_T::GPF_MFPL: PF4MFP Mask */ - -#define SYS_GPF_MFPL_PF5MFP_Pos (20) /*!< SYS_T::GPF_MFPL: PF5MFP Position */ -#define SYS_GPF_MFPL_PF5MFP_Msk (0xful << SYS_GPF_MFPL_PF5MFP_Pos) /*!< SYS_T::GPF_MFPL: PF5MFP Mask */ - -#define SYS_GPF_MFPL_PF6MFP_Pos (24) /*!< SYS_T::GPF_MFPL: PF6MFP Position */ -#define SYS_GPF_MFPL_PF6MFP_Msk (0xful << SYS_GPF_MFPL_PF6MFP_Pos) /*!< SYS_T::GPF_MFPL: PF6MFP Mask */ - -#define SYS_GPF_MFPL_PF7MFP_Pos (28) /*!< SYS_T::GPF_MFPL: PF7MFP Position */ -#define SYS_GPF_MFPL_PF7MFP_Msk (0xful << SYS_GPF_MFPL_PF7MFP_Pos) /*!< SYS_T::GPF_MFPL: PF7MFP Mask */ - -#define SYS_GPF_MFPH_PF8MFP_Pos (0) /*!< SYS_T::GPF_MFPH: PF8MFP Position */ -#define SYS_GPF_MFPH_PF8MFP_Msk (0xful << SYS_GPF_MFPH_PF8MFP_Pos) /*!< SYS_T::GPF_MFPH: PF8MFP Mask */ - -#define SYS_GPF_MFPH_PF9MFP_Pos (4) /*!< SYS_T::GPF_MFPH: PF9MFP Position */ -#define SYS_GPF_MFPH_PF9MFP_Msk (0xful << SYS_GPF_MFPH_PF9MFP_Pos) /*!< SYS_T::GPF_MFPH: PF9MFP Mask */ - -#define SYS_GPF_MFPH_PF10MFP_Pos (8) /*!< SYS_T::GPF_MFPH: PF10MFP Position */ -#define SYS_GPF_MFPH_PF10MFP_Msk (0xful << SYS_GPF_MFPH_PF10MFP_Pos) /*!< SYS_T::GPF_MFPH: PF10MFP Mask */ - -#define SYS_GPF_MFPH_PF11MFP_Pos (12) /*!< SYS_T::GPF_MFPH: PF11MFP Position */ -#define SYS_GPF_MFPH_PF11MFP_Msk (0xful << SYS_GPF_MFPH_PF11MFP_Pos) /*!< SYS_T::GPF_MFPH: PF11MFP Mask */ - -#define SYS_GPF_MFPH_PF12MFP_Pos (16) /*!< SYS_T::GPF_MFPH: PF12MFP Position */ -#define SYS_GPF_MFPH_PF12MFP_Msk (0xful << SYS_GPF_MFPH_PF12MFP_Pos) /*!< SYS_T::GPF_MFPH: PF12MFP Mask */ - -#define SYS_GPF_MFPH_PF13MFP_Pos (20) /*!< SYS_T::GPF_MFPH: PF13MFP Position */ -#define SYS_GPF_MFPH_PF13MFP_Msk (0xful << SYS_GPF_MFPH_PF13MFP_Pos) /*!< SYS_T::GPF_MFPH: PF13MFP Mask */ - -#define SYS_GPF_MFPH_PF14MFP_Pos (24) /*!< SYS_T::GPF_MFPH: PF14MFP Position */ -#define SYS_GPF_MFPH_PF14MFP_Msk (0xful << SYS_GPF_MFPH_PF14MFP_Pos) /*!< SYS_T::GPF_MFPH: PF14MFP Mask */ - -#define SYS_GPF_MFPH_PF15MFP_Pos (28) /*!< SYS_T::GPF_MFPH: PF15MFP Position */ -#define SYS_GPF_MFPH_PF15MFP_Msk (0xful << SYS_GPF_MFPH_PF15MFP_Pos) /*!< SYS_T::GPF_MFPH: PF15MFP Mask */ - -#define SYS_GPG_MFPL_PG0MFP_Pos (0) /*!< SYS_T::GPG_MFPL: PG0MFP Position */ -#define SYS_GPG_MFPL_PG0MFP_Msk (0xful << SYS_GPG_MFPL_PG0MFP_Pos) /*!< SYS_T::GPG_MFPL: PG0MFP Mask */ - -#define SYS_GPG_MFPL_PG1MFP_Pos (4) /*!< SYS_T::GPG_MFPL: PG1MFP Position */ -#define SYS_GPG_MFPL_PG1MFP_Msk (0xful << SYS_GPG_MFPL_PG1MFP_Pos) /*!< SYS_T::GPG_MFPL: PG1MFP Mask */ - -#define SYS_GPG_MFPL_PG2MFP_Pos (8) /*!< SYS_T::GPG_MFPL: PG2MFP Position */ -#define SYS_GPG_MFPL_PG2MFP_Msk (0xful << SYS_GPG_MFPL_PG2MFP_Pos) /*!< SYS_T::GPG_MFPL: PG2MFP Mask */ - -#define SYS_GPG_MFPL_PG3MFP_Pos (12) /*!< SYS_T::GPG_MFPL: PG3MFP Position */ -#define SYS_GPG_MFPL_PG3MFP_Msk (0xful << SYS_GPG_MFPL_PG3MFP_Pos) /*!< SYS_T::GPG_MFPL: PG3MFP Mask */ - -#define SYS_GPG_MFPL_PG4MFP_Pos (16) /*!< SYS_T::GPG_MFPL: PG4MFP Position */ -#define SYS_GPG_MFPL_PG4MFP_Msk (0xful << SYS_GPG_MFPL_PG4MFP_Pos) /*!< SYS_T::GPG_MFPL: PG4MFP Mask */ - -#define SYS_GPG_MFPL_PG5MFP_Pos (20) /*!< SYS_T::GPG_MFPL: PG5MFP Position */ -#define SYS_GPG_MFPL_PG5MFP_Msk (0xful << SYS_GPG_MFPL_PG5MFP_Pos) /*!< SYS_T::GPG_MFPL: PG5MFP Mask */ - -#define SYS_GPG_MFPL_PG6MFP_Pos (24) /*!< SYS_T::GPG_MFPL: PG6MFP Position */ -#define SYS_GPG_MFPL_PG6MFP_Msk (0xful << SYS_GPG_MFPL_PG6MFP_Pos) /*!< SYS_T::GPG_MFPL: PG6MFP Mask */ - -#define SYS_GPG_MFPL_PG7MFP_Pos (28) /*!< SYS_T::GPG_MFPL: PG7MFP Position */ -#define SYS_GPG_MFPL_PG7MFP_Msk (0xful << SYS_GPG_MFPL_PG7MFP_Pos) /*!< SYS_T::GPG_MFPL: PG7MFP Mask */ - -#define SYS_GPG_MFPH_PG8MFP_Pos (0) /*!< SYS_T::GPG_MFPH: PG8MFP Position */ -#define SYS_GPG_MFPH_PG8MFP_Msk (0xful << SYS_GPG_MFPH_PG8MFP_Pos) /*!< SYS_T::GPG_MFPH: PG8MFP Mask */ - -#define SYS_GPG_MFPH_PG9MFP_Pos (4) /*!< SYS_T::GPG_MFPH: PG9MFP Position */ -#define SYS_GPG_MFPH_PG9MFP_Msk (0xful << SYS_GPG_MFPH_PG9MFP_Pos) /*!< SYS_T::GPG_MFPH: PG9MFP Mask */ - -#define SYS_GPG_MFPH_PG10MFP_Pos (8) /*!< SYS_T::GPG_MFPH: PG10MFP Position */ -#define SYS_GPG_MFPH_PG10MFP_Msk (0xful << SYS_GPG_MFPH_PG10MFP_Pos) /*!< SYS_T::GPG_MFPH: PG10MFP Mask */ - -#define SYS_GPG_MFPH_PG11MFP_Pos (12) /*!< SYS_T::GPG_MFPH: PG11MFP Position */ -#define SYS_GPG_MFPH_PG11MFP_Msk (0xful << SYS_GPG_MFPH_PG11MFP_Pos) /*!< SYS_T::GPG_MFPH: PG11MFP Mask */ - -#define SYS_GPG_MFPH_PG12MFP_Pos (16) /*!< SYS_T::GPG_MFPH: PG12MFP Position */ -#define SYS_GPG_MFPH_PG12MFP_Msk (0xful << SYS_GPG_MFPH_PG12MFP_Pos) /*!< SYS_T::GPG_MFPH: PG12MFP Mask */ - -#define SYS_GPG_MFPH_PG13MFP_Pos (20) /*!< SYS_T::GPG_MFPH: PG13MFP Position */ -#define SYS_GPG_MFPH_PG13MFP_Msk (0xful << SYS_GPG_MFPH_PG13MFP_Pos) /*!< SYS_T::GPG_MFPH: PG13MFP Mask */ - -#define SYS_GPG_MFPH_PG14MFP_Pos (24) /*!< SYS_T::GPG_MFPH: PG14MFP Position */ -#define SYS_GPG_MFPH_PG14MFP_Msk (0xful << SYS_GPG_MFPH_PG14MFP_Pos) /*!< SYS_T::GPG_MFPH: PG14MFP Mask */ - -#define SYS_GPG_MFPH_PG15MFP_Pos (28) /*!< SYS_T::GPG_MFPH: PG15MFP Position */ -#define SYS_GPG_MFPH_PG15MFP_Msk (0xful << SYS_GPG_MFPH_PG15MFP_Pos) /*!< SYS_T::GPG_MFPH: PG15MFP Mask */ - -#define SYS_GPH_MFPL_PH0MFP_Pos (0) /*!< SYS_T::GPH_MFPL: PH0MFP Position */ -#define SYS_GPH_MFPL_PH0MFP_Msk (0xful << SYS_GPH_MFPL_PH0MFP_Pos) /*!< SYS_T::GPH_MFPL: PH0MFP Mask */ - -#define SYS_GPH_MFPL_PH1MFP_Pos (4) /*!< SYS_T::GPH_MFPL: PH1MFP Position */ -#define SYS_GPH_MFPL_PH1MFP_Msk (0xful << SYS_GPH_MFPL_PH1MFP_Pos) /*!< SYS_T::GPH_MFPL: PH1MFP Mask */ - -#define SYS_GPH_MFPL_PH2MFP_Pos (8) /*!< SYS_T::GPH_MFPL: PH2MFP Position */ -#define SYS_GPH_MFPL_PH2MFP_Msk (0xful << SYS_GPH_MFPL_PH2MFP_Pos) /*!< SYS_T::GPH_MFPL: PH2MFP Mask */ - -#define SYS_GPH_MFPL_PH3MFP_Pos (12) /*!< SYS_T::GPH_MFPL: PH3MFP Position */ -#define SYS_GPH_MFPL_PH3MFP_Msk (0xful << SYS_GPH_MFPL_PH3MFP_Pos) /*!< SYS_T::GPH_MFPL: PH3MFP Mask */ - -#define SYS_GPH_MFPL_PH4MFP_Pos (16) /*!< SYS_T::GPH_MFPL: PH4MFP Position */ -#define SYS_GPH_MFPL_PH4MFP_Msk (0xful << SYS_GPH_MFPL_PH4MFP_Pos) /*!< SYS_T::GPH_MFPL: PH4MFP Mask */ - -#define SYS_GPH_MFPL_PH5MFP_Pos (20) /*!< SYS_T::GPH_MFPL: PH5MFP Position */ -#define SYS_GPH_MFPL_PH5MFP_Msk (0xful << SYS_GPH_MFPL_PH5MFP_Pos) /*!< SYS_T::GPH_MFPL: PH5MFP Mask */ - -#define SYS_GPH_MFPL_PH6MFP_Pos (24) /*!< SYS_T::GPH_MFPL: PH6MFP Position */ -#define SYS_GPH_MFPL_PH6MFP_Msk (0xful << SYS_GPH_MFPL_PH6MFP_Pos) /*!< SYS_T::GPH_MFPL: PH6MFP Mask */ - -#define SYS_GPH_MFPL_PH7MFP_Pos (28) /*!< SYS_T::GPH_MFPL: PH7MFP Position */ -#define SYS_GPH_MFPL_PH7MFP_Msk (0xful << SYS_GPH_MFPL_PH7MFP_Pos) /*!< SYS_T::GPH_MFPL: PH7MFP Mask */ - -#define SYS_GPH_MFPH_PH8MFP_Pos (0) /*!< SYS_T::GPH_MFPH: PH8MFP Position */ -#define SYS_GPH_MFPH_PH8MFP_Msk (0xful << SYS_GPH_MFPH_PH8MFP_Pos) /*!< SYS_T::GPH_MFPH: PH8MFP Mask */ - -#define SYS_GPH_MFPH_PH9MFP_Pos (4) /*!< SYS_T::GPH_MFPH: PH9MFP Position */ -#define SYS_GPH_MFPH_PH9MFP_Msk (0xful << SYS_GPH_MFPH_PH9MFP_Pos) /*!< SYS_T::GPH_MFPH: PH9MFP Mask */ - -#define SYS_GPH_MFPH_PH10MFP_Pos (8) /*!< SYS_T::GPH_MFPH: PH10MFP Position */ -#define SYS_GPH_MFPH_PH10MFP_Msk (0xful << SYS_GPH_MFPH_PH10MFP_Pos) /*!< SYS_T::GPH_MFPH: PH10MFP Mask */ - -#define SYS_GPH_MFPH_PH11MFP_Pos (12) /*!< SYS_T::GPH_MFPH: PH11MFP Position */ -#define SYS_GPH_MFPH_PH11MFP_Msk (0xful << SYS_GPH_MFPH_PH11MFP_Pos) /*!< SYS_T::GPH_MFPH: PH11MFP Mask */ - -#define SYS_GPH_MFPH_PH12MFP_Pos (16) /*!< SYS_T::GPH_MFPH: PH12MFP Position */ -#define SYS_GPH_MFPH_PH12MFP_Msk (0xful << SYS_GPH_MFPH_PH12MFP_Pos) /*!< SYS_T::GPH_MFPH: PH12MFP Mask */ - -#define SYS_GPH_MFPH_PH13MFP_Pos (20) /*!< SYS_T::GPH_MFPH: PH13MFP Position */ -#define SYS_GPH_MFPH_PH13MFP_Msk (0xful << SYS_GPH_MFPH_PH13MFP_Pos) /*!< SYS_T::GPH_MFPH: PH13MFP Mask */ - -#define SYS_GPH_MFPH_PH14MFP_Pos (24) /*!< SYS_T::GPH_MFPH: PH14MFP Position */ -#define SYS_GPH_MFPH_PH14MFP_Msk (0xful << SYS_GPH_MFPH_PH14MFP_Pos) /*!< SYS_T::GPH_MFPH: PH14MFP Mask */ - -#define SYS_GPH_MFPH_PH15MFP_Pos (28) /*!< SYS_T::GPH_MFPH: PH15MFP Position */ -#define SYS_GPH_MFPH_PH15MFP_Msk (0xful << SYS_GPH_MFPH_PH15MFP_Pos) /*!< SYS_T::GPH_MFPH: PH15MFP Mask */ - -#define SYS_GPI_MFPL_PI0MFP_Pos (0) /*!< SYS_T::GPI_MFPL: PI0MFP Position */ -#define SYS_GPI_MFPL_PI0MFP_Msk (0xful << SYS_GPI_MFPL_PI0MFP_Pos) /*!< SYS_T::GPI_MFPL: PI0MFP Mask */ - -#define SYS_GPI_MFPL_PI1MFP_Pos (4) /*!< SYS_T::GPI_MFPL: PI1MFP Position */ -#define SYS_GPI_MFPL_PI1MFP_Msk (0xful << SYS_GPI_MFPL_PI1MFP_Pos) /*!< SYS_T::GPI_MFPL: PI1MFP Mask */ - -#define SYS_GPI_MFPL_PI2MFP_Pos (8) /*!< SYS_T::GPI_MFPL: PI2MFP Position */ -#define SYS_GPI_MFPL_PI2MFP_Msk (0xful << SYS_GPI_MFPL_PI2MFP_Pos) /*!< SYS_T::GPI_MFPL: PI2MFP Mask */ - -#define SYS_GPI_MFPL_PI3MFP_Pos (12) /*!< SYS_T::GPI_MFPL: PI3MFP Position */ -#define SYS_GPI_MFPL_PI3MFP_Msk (0xful << SYS_GPI_MFPL_PI3MFP_Pos) /*!< SYS_T::GPI_MFPL: PI3MFP Mask */ - -#define SYS_GPI_MFPL_PI4MFP_Pos (16) /*!< SYS_T::GPI_MFPL: PI4MFP Position */ -#define SYS_GPI_MFPL_PI4MFP_Msk (0xful << SYS_GPI_MFPL_PI4MFP_Pos) /*!< SYS_T::GPI_MFPL: PI4MFP Mask */ - -#define SYS_GPI_MFPL_PI5MFP_Pos (20) /*!< SYS_T::GPI_MFPL: PI5MFP Position */ -#define SYS_GPI_MFPL_PI5MFP_Msk (0xful << SYS_GPI_MFPL_PI5MFP_Pos) /*!< SYS_T::GPI_MFPL: PI5MFP Mask */ - -#define SYS_GPI_MFPL_PI6MFP_Pos (24) /*!< SYS_T::GPI_MFPL: PI6MFP Position */ -#define SYS_GPI_MFPL_PI6MFP_Msk (0xful << SYS_GPI_MFPL_PI6MFP_Pos) /*!< SYS_T::GPI_MFPL: PI6MFP Mask */ - -#define SYS_GPI_MFPL_PI7MFP_Pos (28) /*!< SYS_T::GPI_MFPL: PI7MFP Position */ -#define SYS_GPI_MFPL_PI7MFP_Msk (0xful << SYS_GPI_MFPL_PI7MFP_Pos) /*!< SYS_T::GPI_MFPL: PI7MFP Mask */ - -#define SYS_GPI_MFPH_PI8MFP_Pos (0) /*!< SYS_T::GPI_MFPH: PI8MFP Position */ -#define SYS_GPI_MFPH_PI8MFP_Msk (0xful << SYS_GPI_MFPH_PI8MFP_Pos) /*!< SYS_T::GPI_MFPH: PI8MFP Mask */ - -#define SYS_GPI_MFPH_PI9MFP_Pos (4) /*!< SYS_T::GPI_MFPH: PI9MFP Position */ -#define SYS_GPI_MFPH_PI9MFP_Msk (0xful << SYS_GPI_MFPH_PI9MFP_Pos) /*!< SYS_T::GPI_MFPH: PI9MFP Mask */ - -#define SYS_GPI_MFPH_PI10MFP_Pos (8) /*!< SYS_T::GPI_MFPH: PI10MFP Position */ -#define SYS_GPI_MFPH_PI10MFP_Msk (0xful << SYS_GPI_MFPH_PI10MFP_Pos) /*!< SYS_T::GPI_MFPH: PI10MFP Mask */ - -#define SYS_GPI_MFPH_PI11MFP_Pos (12) /*!< SYS_T::GPI_MFPH: PI11MFP Position */ -#define SYS_GPI_MFPH_PI11MFP_Msk (0xful << SYS_GPI_MFPH_PI11MFP_Pos) /*!< SYS_T::GPI_MFPH: PI11MFP Mask */ - -#define SYS_GPI_MFPH_PI12MFP_Pos (16) /*!< SYS_T::GPI_MFPH: PI12MFP Position */ -#define SYS_GPI_MFPH_PI12MFP_Msk (0xful << SYS_GPI_MFPH_PI12MFP_Pos) /*!< SYS_T::GPI_MFPH: PI12MFP Mask */ - -#define SYS_GPI_MFPH_PI13MFP_Pos (20) /*!< SYS_T::GPI_MFPH: PI13MFP Position */ -#define SYS_GPI_MFPH_PI13MFP_Msk (0xful << SYS_GPI_MFPH_PI13MFP_Pos) /*!< SYS_T::GPI_MFPH: PI13MFP Mask */ - -#define SYS_GPI_MFPH_PI14MFP_Pos (24) /*!< SYS_T::GPI_MFPH: PI14MFP Position */ -#define SYS_GPI_MFPH_PI14MFP_Msk (0xful << SYS_GPI_MFPH_PI14MFP_Pos) /*!< SYS_T::GPI_MFPH: PI14MFP Mask */ - -#define SYS_GPI_MFPH_PI15MFP_Pos (28) /*!< SYS_T::GPI_MFPH: PI15MFP Position */ -#define SYS_GPI_MFPH_PI15MFP_Msk (0xful << SYS_GPI_MFPH_PI15MFP_Pos) /*!< SYS_T::GPI_MFPH: PI15MFP Mask */ - -#define SYS_GPJ_MFPL_PJ0MFP_Pos (0) /*!< SYS_T::GPJ_MFPL: PJ0MFP Position */ -#define SYS_GPJ_MFPL_PJ0MFP_Msk (0xful << SYS_GPJ_MFPL_PJ0MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ0MFP Mask */ - -#define SYS_GPJ_MFPL_PJ1MFP_Pos (4) /*!< SYS_T::GPJ_MFPL: PJ1MFP Position */ -#define SYS_GPJ_MFPL_PJ1MFP_Msk (0xful << SYS_GPJ_MFPL_PJ1MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ1MFP Mask */ - -#define SYS_GPJ_MFPL_PJ2MFP_Pos (8) /*!< SYS_T::GPJ_MFPL: PJ2MFP Position */ -#define SYS_GPJ_MFPL_PJ2MFP_Msk (0xful << SYS_GPJ_MFPL_PJ2MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ2MFP Mask */ - -#define SYS_GPJ_MFPL_PJ3MFP_Pos (12) /*!< SYS_T::GPJ_MFPL: PJ3MFP Position */ -#define SYS_GPJ_MFPL_PJ3MFP_Msk (0xful << SYS_GPJ_MFPL_PJ3MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ3MFP Mask */ - -#define SYS_GPJ_MFPL_PJ4MFP_Pos (16) /*!< SYS_T::GPJ_MFPL: PJ4MFP Position */ -#define SYS_GPJ_MFPL_PJ4MFP_Msk (0xful << SYS_GPJ_MFPL_PJ4MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ4MFP Mask */ - -#define SYS_GPJ_MFPL_PJ5MFP_Pos (20) /*!< SYS_T::GPJ_MFPL: PJ5MFP Position */ -#define SYS_GPJ_MFPL_PJ5MFP_Msk (0xful << SYS_GPJ_MFPL_PJ5MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ5MFP Mask */ - -#define SYS_GPJ_MFPL_PJ6MFP_Pos (24) /*!< SYS_T::GPJ_MFPL: PJ6MFP Position */ -#define SYS_GPJ_MFPL_PJ6MFP_Msk (0xful << SYS_GPJ_MFPL_PJ6MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ6MFP Mask */ - -#define SYS_GPJ_MFPL_PJ7MFP_Pos (28) /*!< SYS_T::GPJ_MFPL: PJ7MFP Position */ -#define SYS_GPJ_MFPL_PJ7MFP_Msk (0xful << SYS_GPJ_MFPL_PJ7MFP_Pos) /*!< SYS_T::GPJ_MFPL: PJ7MFP Mask */ - -#define SYS_GPJ_MFPH_PJ8MFP_Pos (0) /*!< SYS_T::GPJ_MFPH: PJ8MFP Position */ -#define SYS_GPJ_MFPH_PJ8MFP_Msk (0xful << SYS_GPJ_MFPH_PJ8MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ8MFP Mask */ - -#define SYS_GPJ_MFPH_PJ9MFP_Pos (4) /*!< SYS_T::GPJ_MFPH: PJ9MFP Position */ -#define SYS_GPJ_MFPH_PJ9MFP_Msk (0xful << SYS_GPJ_MFPH_PJ9MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ9MFP Mask */ - -#define SYS_GPJ_MFPH_PJ10MFP_Pos (8) /*!< SYS_T::GPJ_MFPH: PJ10MFP Position */ -#define SYS_GPJ_MFPH_PJ10MFP_Msk (0xful << SYS_GPJ_MFPH_PJ10MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ10MFP Mask */ - -#define SYS_GPJ_MFPH_PJ11MFP_Pos (12) /*!< SYS_T::GPJ_MFPH: PJ11MFP Position */ -#define SYS_GPJ_MFPH_PJ11MFP_Msk (0xful << SYS_GPJ_MFPH_PJ11MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ11MFP Mask */ - -#define SYS_GPJ_MFPH_PJ12MFP_Pos (16) /*!< SYS_T::GPJ_MFPH: PJ12MFP Position */ -#define SYS_GPJ_MFPH_PJ12MFP_Msk (0xful << SYS_GPJ_MFPH_PJ12MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ12MFP Mask */ - -#define SYS_GPJ_MFPH_PJ13MFP_Pos (20) /*!< SYS_T::GPJ_MFPH: PJ13MFP Position */ -#define SYS_GPJ_MFPH_PJ13MFP_Msk (0xful << SYS_GPJ_MFPH_PJ13MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ13MFP Mask */ - -#define SYS_GPJ_MFPH_PJ14MFP_Pos (24) /*!< SYS_T::GPJ_MFPH: PJ14MFP Position */ -#define SYS_GPJ_MFPH_PJ14MFP_Msk (0xful << SYS_GPJ_MFPH_PJ14MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ14MFP Mask */ - -#define SYS_GPJ_MFPH_PJ15MFP_Pos (28) /*!< SYS_T::GPJ_MFPH: PJ15MFP Position */ -#define SYS_GPJ_MFPH_PJ15MFP_Msk (0xful << SYS_GPJ_MFPH_PJ15MFP_Pos) /*!< SYS_T::GPJ_MFPH: PJ15MFP Mask */ - -#define SYS_GPK_MFPL_PK0MFP_Pos (0) /*!< SYS_T::GPK_MFPL: PK0MFP Position */ -#define SYS_GPK_MFPL_PK0MFP_Msk (0xful << SYS_GPK_MFPL_PK0MFP_Pos) /*!< SYS_T::GPK_MFPL: PK0MFP Mask */ - -#define SYS_GPK_MFPL_PK1MFP_Pos (4) /*!< SYS_T::GPK_MFPL: PK1MFP Position */ -#define SYS_GPK_MFPL_PK1MFP_Msk (0xful << SYS_GPK_MFPL_PK1MFP_Pos) /*!< SYS_T::GPK_MFPL: PK1MFP Mask */ - -#define SYS_GPK_MFPL_PK2MFP_Pos (8) /*!< SYS_T::GPK_MFPL: PK2MFP Position */ -#define SYS_GPK_MFPL_PK2MFP_Msk (0xful << SYS_GPK_MFPL_PK2MFP_Pos) /*!< SYS_T::GPK_MFPL: PK2MFP Mask */ - -#define SYS_GPK_MFPL_PK3MFP_Pos (12) /*!< SYS_T::GPK_MFPL: PK3MFP Position */ -#define SYS_GPK_MFPL_PK3MFP_Msk (0xful << SYS_GPK_MFPL_PK3MFP_Pos) /*!< SYS_T::GPK_MFPL: PK3MFP Mask */ - -#define SYS_GPK_MFPL_PK4MFP_Pos (16) /*!< SYS_T::GPK_MFPL: PK4MFP Position */ -#define SYS_GPK_MFPL_PK4MFP_Msk (0xful << SYS_GPK_MFPL_PK4MFP_Pos) /*!< SYS_T::GPK_MFPL: PK4MFP Mask */ - -#define SYS_GPK_MFPL_PK5MFP_Pos (20) /*!< SYS_T::GPK_MFPL: PK5MFP Position */ -#define SYS_GPK_MFPL_PK5MFP_Msk (0xful << SYS_GPK_MFPL_PK5MFP_Pos) /*!< SYS_T::GPK_MFPL: PK5MFP Mask */ - -#define SYS_GPK_MFPL_PK6MFP_Pos (24) /*!< SYS_T::GPK_MFPL: PK6MFP Position */ -#define SYS_GPK_MFPL_PK6MFP_Msk (0xful << SYS_GPK_MFPL_PK6MFP_Pos) /*!< SYS_T::GPK_MFPL: PK6MFP Mask */ - -#define SYS_GPK_MFPL_PK7MFP_Pos (28) /*!< SYS_T::GPK_MFPL: PK7MFP Position */ -#define SYS_GPK_MFPL_PK7MFP_Msk (0xful << SYS_GPK_MFPL_PK7MFP_Pos) /*!< SYS_T::GPK_MFPL: PK7MFP Mask */ - -#define SYS_GPK_MFPH_PK8MFP_Pos (0) /*!< SYS_T::GPK_MFPH: PK8MFP Position */ -#define SYS_GPK_MFPH_PK8MFP_Msk (0xful << SYS_GPK_MFPH_PK8MFP_Pos) /*!< SYS_T::GPK_MFPH: PK8MFP Mask */ - -#define SYS_GPK_MFPH_PK9MFP_Pos (4) /*!< SYS_T::GPK_MFPH: PK9MFP Position */ -#define SYS_GPK_MFPH_PK9MFP_Msk (0xful << SYS_GPK_MFPH_PK9MFP_Pos) /*!< SYS_T::GPK_MFPH: PK9MFP Mask */ - -#define SYS_GPK_MFPH_PK10MFP_Pos (8) /*!< SYS_T::GPK_MFPH: PK10MFP Position */ -#define SYS_GPK_MFPH_PK10MFP_Msk (0xful << SYS_GPK_MFPH_PK10MFP_Pos) /*!< SYS_T::GPK_MFPH: PK10MFP Mask */ - -#define SYS_GPK_MFPH_PK11MFP_Pos (12) /*!< SYS_T::GPK_MFPH: PK11MFP Position */ -#define SYS_GPK_MFPH_PK11MFP_Msk (0xful << SYS_GPK_MFPH_PK11MFP_Pos) /*!< SYS_T::GPK_MFPH: PK11MFP Mask */ - -#define SYS_GPK_MFPH_PK12MFP_Pos (16) /*!< SYS_T::GPK_MFPH: PK12MFP Position */ -#define SYS_GPK_MFPH_PK12MFP_Msk (0xful << SYS_GPK_MFPH_PK12MFP_Pos) /*!< SYS_T::GPK_MFPH: PK12MFP Mask */ - -#define SYS_GPK_MFPH_PK13MFP_Pos (20) /*!< SYS_T::GPK_MFPH: PK13MFP Position */ -#define SYS_GPK_MFPH_PK13MFP_Msk (0xful << SYS_GPK_MFPH_PK13MFP_Pos) /*!< SYS_T::GPK_MFPH: PK13MFP Mask */ - -#define SYS_GPK_MFPH_PK14MFP_Pos (24) /*!< SYS_T::GPK_MFPH: PK14MFP Position */ -#define SYS_GPK_MFPH_PK14MFP_Msk (0xful << SYS_GPK_MFPH_PK14MFP_Pos) /*!< SYS_T::GPK_MFPH: PK14MFP Mask */ - -#define SYS_GPK_MFPH_PK15MFP_Pos (28) /*!< SYS_T::GPK_MFPH: PK15MFP Position */ -#define SYS_GPK_MFPH_PK15MFP_Msk (0xful << SYS_GPK_MFPH_PK15MFP_Pos) /*!< SYS_T::GPK_MFPH: PK15MFP Mask */ - -#define SYS_GPL_MFPL_PL0MFP_Pos (0) /*!< SYS_T::GPL_MFPL: PL0MFP Position */ -#define SYS_GPL_MFPL_PL0MFP_Msk (0xful << SYS_GPL_MFPL_PL0MFP_Pos) /*!< SYS_T::GPL_MFPL: PL0MFP Mask */ - -#define SYS_GPL_MFPL_PL1MFP_Pos (4) /*!< SYS_T::GPL_MFPL: PL1MFP Position */ -#define SYS_GPL_MFPL_PL1MFP_Msk (0xful << SYS_GPL_MFPL_PL1MFP_Pos) /*!< SYS_T::GPL_MFPL: PL1MFP Mask */ - -#define SYS_GPL_MFPL_PL2MFP_Pos (8) /*!< SYS_T::GPL_MFPL: PL2MFP Position */ -#define SYS_GPL_MFPL_PL2MFP_Msk (0xful << SYS_GPL_MFPL_PL2MFP_Pos) /*!< SYS_T::GPL_MFPL: PL2MFP Mask */ - -#define SYS_GPL_MFPL_PL3MFP_Pos (12) /*!< SYS_T::GPL_MFPL: PL3MFP Position */ -#define SYS_GPL_MFPL_PL3MFP_Msk (0xful << SYS_GPL_MFPL_PL3MFP_Pos) /*!< SYS_T::GPL_MFPL: PL3MFP Mask */ - -#define SYS_GPL_MFPL_PL4MFP_Pos (16) /*!< SYS_T::GPL_MFPL: PL4MFP Position */ -#define SYS_GPL_MFPL_PL4MFP_Msk (0xful << SYS_GPL_MFPL_PL4MFP_Pos) /*!< SYS_T::GPL_MFPL: PL4MFP Mask */ - -#define SYS_GPL_MFPL_PL5MFP_Pos (20) /*!< SYS_T::GPL_MFPL: PL5MFP Position */ -#define SYS_GPL_MFPL_PL5MFP_Msk (0xful << SYS_GPL_MFPL_PL5MFP_Pos) /*!< SYS_T::GPL_MFPL: PL5MFP Mask */ - -#define SYS_GPL_MFPL_PL6MFP_Pos (24) /*!< SYS_T::GPL_MFPL: PL6MFP Position */ -#define SYS_GPL_MFPL_PL6MFP_Msk (0xful << SYS_GPL_MFPL_PL6MFP_Pos) /*!< SYS_T::GPL_MFPL: PL6MFP Mask */ - -#define SYS_GPL_MFPL_PL7MFP_Pos (28) /*!< SYS_T::GPL_MFPL: PL7MFP Position */ -#define SYS_GPL_MFPL_PL7MFP_Msk (0xful << SYS_GPL_MFPL_PL7MFP_Pos) /*!< SYS_T::GPL_MFPL: PL7MFP Mask */ - -#define SYS_GPL_MFPH_PL8MFP_Pos (0) /*!< SYS_T::GPL_MFPH: PL8MFP Position */ -#define SYS_GPL_MFPH_PL8MFP_Msk (0xful << SYS_GPL_MFPH_PL8MFP_Pos) /*!< SYS_T::GPL_MFPH: PL8MFP Mask */ - -#define SYS_GPL_MFPH_PL9MFP_Pos (4) /*!< SYS_T::GPL_MFPH: PL9MFP Position */ -#define SYS_GPL_MFPH_PL9MFP_Msk (0xful << SYS_GPL_MFPH_PL9MFP_Pos) /*!< SYS_T::GPL_MFPH: PL9MFP Mask */ - -#define SYS_GPL_MFPH_PL10MFP_Pos (8) /*!< SYS_T::GPL_MFPH: PL10MFP Position */ -#define SYS_GPL_MFPH_PL10MFP_Msk (0xful << SYS_GPL_MFPH_PL10MFP_Pos) /*!< SYS_T::GPL_MFPH: PL10MFP Mask */ - -#define SYS_GPL_MFPH_PL11MFP_Pos (12) /*!< SYS_T::GPL_MFPH: PL11MFP Position */ -#define SYS_GPL_MFPH_PL11MFP_Msk (0xful << SYS_GPL_MFPH_PL11MFP_Pos) /*!< SYS_T::GPL_MFPH: PL11MFP Mask */ - -#define SYS_GPL_MFPH_PL12MFP_Pos (16) /*!< SYS_T::GPL_MFPH: PL12MFP Position */ -#define SYS_GPL_MFPH_PL12MFP_Msk (0xful << SYS_GPL_MFPH_PL12MFP_Pos) /*!< SYS_T::GPL_MFPH: PL12MFP Mask */ - -#define SYS_GPL_MFPH_PL13MFP_Pos (20) /*!< SYS_T::GPL_MFPH: PL13MFP Position */ -#define SYS_GPL_MFPH_PL13MFP_Msk (0xful << SYS_GPL_MFPH_PL13MFP_Pos) /*!< SYS_T::GPL_MFPH: PL13MFP Mask */ - -#define SYS_GPL_MFPH_PL14MFP_Pos (24) /*!< SYS_T::GPL_MFPH: PL14MFP Position */ -#define SYS_GPL_MFPH_PL14MFP_Msk (0xful << SYS_GPL_MFPH_PL14MFP_Pos) /*!< SYS_T::GPL_MFPH: PL14MFP Mask */ - -#define SYS_GPL_MFPH_PL15MFP_Pos (28) /*!< SYS_T::GPL_MFPH: PL15MFP Position */ -#define SYS_GPL_MFPH_PL15MFP_Msk (0xful << SYS_GPL_MFPH_PL15MFP_Pos) /*!< SYS_T::GPL_MFPH: PL15MFP Mask */ - -#define SYS_GPM_MFPL_PM0MFP_Pos (0) /*!< SYS_T::GPM_MFPL: PM0MFP Position */ -#define SYS_GPM_MFPL_PM0MFP_Msk (0xful << SYS_GPM_MFPL_PM0MFP_Pos) /*!< SYS_T::GPM_MFPL: PM0MFP Mask */ - -#define SYS_GPM_MFPL_PM1MFP_Pos (4) /*!< SYS_T::GPM_MFPL: PM1MFP Position */ -#define SYS_GPM_MFPL_PM1MFP_Msk (0xful << SYS_GPM_MFPL_PM1MFP_Pos) /*!< SYS_T::GPM_MFPL: PM1MFP Mask */ - -#define SYS_GPM_MFPL_PM2MFP_Pos (8) /*!< SYS_T::GPM_MFPL: PM2MFP Position */ -#define SYS_GPM_MFPL_PM2MFP_Msk (0xful << SYS_GPM_MFPL_PM2MFP_Pos) /*!< SYS_T::GPM_MFPL: PM2MFP Mask */ - -#define SYS_GPM_MFPL_PM3MFP_Pos (12) /*!< SYS_T::GPM_MFPL: PM3MFP Position */ -#define SYS_GPM_MFPL_PM3MFP_Msk (0xful << SYS_GPM_MFPL_PM3MFP_Pos) /*!< SYS_T::GPM_MFPL: PM3MFP Mask */ - -#define SYS_GPM_MFPL_PM4MFP_Pos (16) /*!< SYS_T::GPM_MFPL: PM4MFP Position */ -#define SYS_GPM_MFPL_PM4MFP_Msk (0xful << SYS_GPM_MFPL_PM4MFP_Pos) /*!< SYS_T::GPM_MFPL: PM4MFP Mask */ - -#define SYS_GPM_MFPL_PM5MFP_Pos (20) /*!< SYS_T::GPM_MFPL: PM5MFP Position */ -#define SYS_GPM_MFPL_PM5MFP_Msk (0xful << SYS_GPM_MFPL_PM5MFP_Pos) /*!< SYS_T::GPM_MFPL: PM5MFP Mask */ - -#define SYS_GPM_MFPL_PM6MFP_Pos (24) /*!< SYS_T::GPM_MFPL: PM6MFP Position */ -#define SYS_GPM_MFPL_PM6MFP_Msk (0xful << SYS_GPM_MFPL_PM6MFP_Pos) /*!< SYS_T::GPM_MFPL: PM6MFP Mask */ - -#define SYS_GPM_MFPL_PM7MFP_Pos (28) /*!< SYS_T::GPM_MFPL: PM7MFP Position */ -#define SYS_GPM_MFPL_PM7MFP_Msk (0xful << SYS_GPM_MFPL_PM7MFP_Pos) /*!< SYS_T::GPM_MFPL: PM7MFP Mask */ - -#define SYS_GPM_MFPH_PM8MFP_Pos (0) /*!< SYS_T::GPM_MFPH: PM8MFP Position */ -#define SYS_GPM_MFPH_PM8MFP_Msk (0xful << SYS_GPM_MFPH_PM8MFP_Pos) /*!< SYS_T::GPM_MFPH: PM8MFP Mask */ - -#define SYS_GPM_MFPH_PM9MFP_Pos (4) /*!< SYS_T::GPM_MFPH: PM9MFP Position */ -#define SYS_GPM_MFPH_PM9MFP_Msk (0xful << SYS_GPM_MFPH_PM9MFP_Pos) /*!< SYS_T::GPM_MFPH: PM9MFP Mask */ - -#define SYS_GPM_MFPH_PM10MFP_Pos (8) /*!< SYS_T::GPM_MFPH: PM10MFP Position */ -#define SYS_GPM_MFPH_PM10MFP_Msk (0xful << SYS_GPM_MFPH_PM10MFP_Pos) /*!< SYS_T::GPM_MFPH: PM10MFP Mask */ - -#define SYS_GPM_MFPH_PM11MFP_Pos (12) /*!< SYS_T::GPM_MFPH: PM11MFP Position */ -#define SYS_GPM_MFPH_PM11MFP_Msk (0xful << SYS_GPM_MFPH_PM11MFP_Pos) /*!< SYS_T::GPM_MFPH: PM11MFP Mask */ - -#define SYS_GPM_MFPH_PM12MFP_Pos (16) /*!< SYS_T::GPM_MFPH: PM12MFP Position */ -#define SYS_GPM_MFPH_PM12MFP_Msk (0xful << SYS_GPM_MFPH_PM12MFP_Pos) /*!< SYS_T::GPM_MFPH: PM12MFP Mask */ - -#define SYS_GPM_MFPH_PM13MFP_Pos (20) /*!< SYS_T::GPM_MFPH: PM13MFP Position */ -#define SYS_GPM_MFPH_PM13MFP_Msk (0xful << SYS_GPM_MFPH_PM13MFP_Pos) /*!< SYS_T::GPM_MFPH: PM13MFP Mask */ - -#define SYS_GPM_MFPH_PM14MFP_Pos (24) /*!< SYS_T::GPM_MFPH: PM14MFP Position */ -#define SYS_GPM_MFPH_PM14MFP_Msk (0xful << SYS_GPM_MFPH_PM14MFP_Pos) /*!< SYS_T::GPM_MFPH: PM14MFP Mask */ - -#define SYS_GPM_MFPH_PM15MFP_Pos (28) /*!< SYS_T::GPM_MFPH: PM15MFP Position */ -#define SYS_GPM_MFPH_PM15MFP_Msk (0xful << SYS_GPM_MFPH_PM15MFP_Pos) /*!< SYS_T::GPM_MFPH: PM15MFP Mask */ - -#define SYS_GPN_MFPL_PN0MFP_Pos (0) /*!< SYS_T::GPN_MFPL: PN0MFP Position */ -#define SYS_GPN_MFPL_PN0MFP_Msk (0xful << SYS_GPN_MFPL_PN0MFP_Pos) /*!< SYS_T::GPN_MFPL: PN0MFP Mask */ - -#define SYS_GPN_MFPL_PN1MFP_Pos (4) /*!< SYS_T::GPN_MFPL: PN1MFP Position */ -#define SYS_GPN_MFPL_PN1MFP_Msk (0xful << SYS_GPN_MFPL_PN1MFP_Pos) /*!< SYS_T::GPN_MFPL: PN1MFP Mask */ - -#define SYS_GPN_MFPL_PN2MFP_Pos (8) /*!< SYS_T::GPN_MFPL: PN2MFP Position */ -#define SYS_GPN_MFPL_PN2MFP_Msk (0xful << SYS_GPN_MFPL_PN2MFP_Pos) /*!< SYS_T::GPN_MFPL: PN2MFP Mask */ - -#define SYS_GPN_MFPL_PN3MFP_Pos (12) /*!< SYS_T::GPN_MFPL: PN3MFP Position */ -#define SYS_GPN_MFPL_PN3MFP_Msk (0xful << SYS_GPN_MFPL_PN3MFP_Pos) /*!< SYS_T::GPN_MFPL: PN3MFP Mask */ - -#define SYS_GPN_MFPL_PN4MFP_Pos (16) /*!< SYS_T::GPN_MFPL: PN4MFP Position */ -#define SYS_GPN_MFPL_PN4MFP_Msk (0xful << SYS_GPN_MFPL_PN4MFP_Pos) /*!< SYS_T::GPN_MFPL: PN4MFP Mask */ - -#define SYS_GPN_MFPL_PN5MFP_Pos (20) /*!< SYS_T::GPN_MFPL: PN5MFP Position */ -#define SYS_GPN_MFPL_PN5MFP_Msk (0xful << SYS_GPN_MFPL_PN5MFP_Pos) /*!< SYS_T::GPN_MFPL: PN5MFP Mask */ - -#define SYS_GPN_MFPL_PN6MFP_Pos (24) /*!< SYS_T::GPN_MFPL: PN6MFP Position */ -#define SYS_GPN_MFPL_PN6MFP_Msk (0xful << SYS_GPN_MFPL_PN6MFP_Pos) /*!< SYS_T::GPN_MFPL: PN6MFP Mask */ - -#define SYS_GPN_MFPL_PN7MFP_Pos (28) /*!< SYS_T::GPN_MFPL: PN7MFP Position */ -#define SYS_GPN_MFPL_PN7MFP_Msk (0xful << SYS_GPN_MFPL_PN7MFP_Pos) /*!< SYS_T::GPN_MFPL: PN7MFP Mask */ - -#define SYS_GPN_MFPH_PN8MFP_Pos (0) /*!< SYS_T::GPN_MFPH: PN8MFP Position */ -#define SYS_GPN_MFPH_PN8MFP_Msk (0xful << SYS_GPN_MFPH_PN8MFP_Pos) /*!< SYS_T::GPN_MFPH: PN8MFP Mask */ - -#define SYS_GPN_MFPH_PN9MFP_Pos (4) /*!< SYS_T::GPN_MFPH: PN9MFP Position */ -#define SYS_GPN_MFPH_PN9MFP_Msk (0xful << SYS_GPN_MFPH_PN9MFP_Pos) /*!< SYS_T::GPN_MFPH: PN9MFP Mask */ - -#define SYS_GPN_MFPH_PN10MFP_Pos (8) /*!< SYS_T::GPN_MFPH: PN10MFP Position */ -#define SYS_GPN_MFPH_PN10MFP_Msk (0xful << SYS_GPN_MFPH_PN10MFP_Pos) /*!< SYS_T::GPN_MFPH: PN10MFP Mask */ - -#define SYS_GPN_MFPH_PN11MFP_Pos (12) /*!< SYS_T::GPN_MFPH: PN11MFP Position */ -#define SYS_GPN_MFPH_PN11MFP_Msk (0xful << SYS_GPN_MFPH_PN11MFP_Pos) /*!< SYS_T::GPN_MFPH: PN11MFP Mask */ - -#define SYS_GPN_MFPH_PN12MFP_Pos (16) /*!< SYS_T::GPN_MFPH: PN12MFP Position */ -#define SYS_GPN_MFPH_PN12MFP_Msk (0xful << SYS_GPN_MFPH_PN12MFP_Pos) /*!< SYS_T::GPN_MFPH: PN12MFP Mask */ - -#define SYS_GPN_MFPH_PN13MFP_Pos (20) /*!< SYS_T::GPN_MFPH: PN13MFP Position */ -#define SYS_GPN_MFPH_PN13MFP_Msk (0xful << SYS_GPN_MFPH_PN13MFP_Pos) /*!< SYS_T::GPN_MFPH: PN13MFP Mask */ - -#define SYS_GPN_MFPH_PN14MFP_Pos (24) /*!< SYS_T::GPN_MFPH: PN14MFP Position */ -#define SYS_GPN_MFPH_PN14MFP_Msk (0xful << SYS_GPN_MFPH_PN14MFP_Pos) /*!< SYS_T::GPN_MFPH: PN14MFP Mask */ - -#define SYS_GPN_MFPH_PN15MFP_Pos (28) /*!< SYS_T::GPN_MFPH: PN15MFP Position */ -#define SYS_GPN_MFPH_PN15MFP_Msk (0xful << SYS_GPN_MFPH_PN15MFP_Pos) /*!< SYS_T::GPN_MFPH: PN15MFP Mask */ - -#define SYS_TSENSRFCR_TSENSRREF0_Pos (0) /*!< SYS_T::TSENSRFCR: TSENSRREF0 Position */ -#define SYS_TSENSRFCR_TSENSRREF0_Msk (0xfful << SYS_TSENSRFCR_TSENSRREF0_Pos) /*!< SYS_T::TSENSRFCR: TSENSRREF0 Mask */ - -#define SYS_TSENSRFCR_TSENSRREF1_Pos (8) /*!< SYS_T::TSENSRFCR: TSENSRREF1 Position */ -#define SYS_TSENSRFCR_TSENSRREF1_Msk (0xfful << SYS_TSENSRFCR_TSENSRREF1_Pos) /*!< SYS_T::TSENSRFCR: TSENSRREF1 Mask */ - -#define SYS_TSENSRFCR_TSENSRDATA_Pos (16) /*!< SYS_T::TSENSRFCR: TSENSRDATA Position */ -#define SYS_TSENSRFCR_TSENSRDATA_Msk (0xffful << SYS_TSENSRFCR_TSENSRDATA_Pos) /*!< SYS_T::TSENSRFCR: TSENSRDATA Mask */ - -#define SYS_TSENSRFCR_PD_Pos (28) /*!< SYS_T::TSENSRFCR: PD Position */ -#define SYS_TSENSRFCR_PD_Msk (0x1ul << SYS_TSENSRFCR_PD_Pos) /*!< SYS_T::TSENSRFCR: PD Mask */ - -#define SYS_TSENSRFCR_REFUDEN_Pos (29) /*!< SYS_T::TSENSRFCR: REFUDEN Position */ -#define SYS_TSENSRFCR_REFUDEN_Msk (0x1ul << SYS_TSENSRFCR_REFUDEN_Pos) /*!< SYS_T::TSENSRFCR: REFUDEN Mask */ - -#define SYS_TSENSRFCR_DATAVALID_Pos (31) /*!< SYS_T::TSENSRFCR: DATAVALID Position */ -#define SYS_TSENSRFCR_DATAVALID_Msk (0x1ul << SYS_TSENSRFCR_DATAVALID_Pos) /*!< SYS_T::TSENSRFCR: DATAVALID Mask */ - -#define SYS_GMAC0MISCR_RMIIEN_Pos (0) /*!< SYS_T::GMAC0MISCR: RMIIEN Position */ -#define SYS_GMAC0MISCR_RMIIEN_Msk (0x1ul << SYS_GMAC0MISCR_RMIIEN_Pos) /*!< SYS_T::GMAC0MISCR: RMIIEN Mask */ - -#define SYS_GMAC0MISCR_PFRMTXEN_Pos (1) /*!< SYS_T::GMAC0MISCR: PFRMTXEN Position */ -#define SYS_GMAC0MISCR_PFRMTXEN_Msk (0x1ul << SYS_GMAC0MISCR_PFRMTXEN_Pos) /*!< SYS_T::GMAC0MISCR: PFRMTXEN Mask */ - -#define SYS_GMAC0MISCR_TXCLKINV_Pos (8) /*!< SYS_T::GMAC0MISCR: TXCLKINV Position */ -#define SYS_GMAC0MISCR_TXCLKINV_Msk (0x1ul << SYS_GMAC0MISCR_TXCLKINV_Pos) /*!< SYS_T::GMAC0MISCR: TXCLKINV Mask */ - -#define SYS_GMAC0MISCR_TXCLKGEN_Pos (9) /*!< SYS_T::GMAC0MISCR: TXCLKGEN Position */ -#define SYS_GMAC0MISCR_TXCLKGEN_Msk (0x1ul << SYS_GMAC0MISCR_TXCLKGEN_Pos) /*!< SYS_T::GMAC0MISCR: TXCLKGEN Mask */ - -#define SYS_GMAC0MISCR_RXCLKINV_Pos (12) /*!< SYS_T::GMAC0MISCR: RXCLKINV Position */ -#define SYS_GMAC0MISCR_RXCLKINV_Msk (0x1ul << SYS_GMAC0MISCR_RXCLKINV_Pos) /*!< SYS_T::GMAC0MISCR: RXCLKINV Mask */ - -#define SYS_GMAC0MISCR_TXCLKDLY_Pos (16) /*!< SYS_T::GMAC0MISCR: TXCLKDLY Position */ -#define SYS_GMAC0MISCR_TXCLKDLY_Msk (0xful << SYS_GMAC0MISCR_TXCLKDLY_Pos) /*!< SYS_T::GMAC0MISCR: TXCLKDLY Mask */ - -#define SYS_GMAC0MISCR_RXCLKDLY_Pos (20) /*!< SYS_T::GMAC0MISCR: RXCLKDLY Position */ -#define SYS_GMAC0MISCR_RXCLKDLY_Msk (0xful << SYS_GMAC0MISCR_RXCLKDLY_Pos) /*!< SYS_T::GMAC0MISCR: RXCLKDLY Mask */ - -#define SYS_GMAC1MISCR_RMIIEN_Pos (0) /*!< SYS_T::GMAC1MISCR: RMIIEN Position */ -#define SYS_GMAC1MISCR_RMIIEN_Msk (0x1ul << SYS_GMAC1MISCR_RMIIEN_Pos) /*!< SYS_T::GMAC1MISCR: RMIIEN Mask */ - -#define SYS_GMAC1MISCR_PFRMTXEN_Pos (1) /*!< SYS_T::GMAC1MISCR: PFRMTXEN Position */ -#define SYS_GMAC1MISCR_PFRMTXEN_Msk (0x1ul << SYS_GMAC1MISCR_PFRMTXEN_Pos) /*!< SYS_T::GMAC1MISCR: PFRMTXEN Mask */ - -#define SYS_GMAC1MISCR_TXCLKINV_Pos (8) /*!< SYS_T::GMAC1MISCR: TXCLKINV Position */ -#define SYS_GMAC1MISCR_TXCLKINV_Msk (0x1ul << SYS_GMAC1MISCR_TXCLKINV_Pos) /*!< SYS_T::GMAC1MISCR: TXCLKINV Mask */ - -#define SYS_GMAC1MISCR_TXCLKGEN_Pos (9) /*!< SYS_T::GMAC1MISCR: TXCLKGEN Position */ -#define SYS_GMAC1MISCR_TXCLKGEN_Msk (0x1ul << SYS_GMAC1MISCR_TXCLKGEN_Pos) /*!< SYS_T::GMAC1MISCR: TXCLKGEN Mask */ - -#define SYS_GMAC1MISCR_RXCLKINV_Pos (12) /*!< SYS_T::GMAC1MISCR: RXCLKINV Position */ -#define SYS_GMAC1MISCR_RXCLKINV_Msk (0x1ul << SYS_GMAC1MISCR_RXCLKINV_Pos) /*!< SYS_T::GMAC1MISCR: RXCLKINV Mask */ - -#define SYS_GMAC1MISCR_TXCLKDLY_Pos (16) /*!< SYS_T::GMAC1MISCR: TXCLKDLY Position */ -#define SYS_GMAC1MISCR_TXCLKDLY_Msk (0xful << SYS_GMAC1MISCR_TXCLKDLY_Pos) /*!< SYS_T::GMAC1MISCR: TXCLKDLY Mask */ - -#define SYS_GMAC1MISCR_RXCLKDLY_Pos (20) /*!< SYS_T::GMAC1MISCR: RXCLKDLY Position */ -#define SYS_GMAC1MISCR_RXCLKDLY_Msk (0xful << SYS_GMAC1MISCR_RXCLKDLY_Pos) /*!< SYS_T::GMAC1MISCR: RXCLKDLY Mask */ - -#define SYS_MACAD0LSR_MACADRLSR_Pos (0) /*!< SYS_T::MACAD0LSR: MACADRLSR Position */ -#define SYS_MACAD0LSR_MACADRLSR_Msk (0xfffffffful << SYS_MACAD0LSR_MACADRLSR_Pos) /*!< SYS_T::MACAD0LSR: MACADRLSR Mask */ - -#define SYS_MACAD0HSR_MACADRHSR_Pos (0) /*!< SYS_T::MACAD0HSR: MACADRHSR Position */ -#define SYS_MACAD0HSR_MACADRHSR_Msk (0xfffful << SYS_MACAD0HSR_MACADRHSR_Pos) /*!< SYS_T::MACAD0HSR: MACADRHSR Mask */ - -#define SYS_MACAD1LSR_MACADRLSR_Pos (0) /*!< SYS_T::MACAD1LSR: MACADRLSR Position */ -#define SYS_MACAD1LSR_MACADRLSR_Msk (0xfffffffful << SYS_MACAD1LSR_MACADRLSR_Pos) /*!< SYS_T::MACAD1LSR: MACADRLSR Mask */ - -#define SYS_MACAD1HSR_MACADRHSR_Pos (0) /*!< SYS_T::MACAD1HSR: MACADRHSR Position */ -#define SYS_MACAD1HSR_MACADRHSR_Msk (0xfffful << SYS_MACAD1HSR_MACADRHSR_Pos) /*!< SYS_T::MACAD1HSR: MACADRHSR Mask */ - -#define SYS_CSDBGCTL_DBGRST_Pos (0) /*!< SYS_T::CSDBGCTL: DBGRST Position */ -#define SYS_CSDBGCTL_DBGRST_Msk (0x1ul << SYS_CSDBGCTL_DBGRST_Pos) /*!< SYS_T::CSDBGCTL: DBGRST Mask */ - -#define SYS_CSDBGCTL_DBGPWRUPREQ_Pos (1) /*!< SYS_T::CSDBGCTL: DBGPWRUPREQ Position */ -#define SYS_CSDBGCTL_DBGPWRUPREQ_Msk (0x1ul << SYS_CSDBGCTL_DBGPWRUPREQ_Pos) /*!< SYS_T::CSDBGCTL: DBGPWRUPREQ Mask */ - -#define SYS_CSDBGCTL_DBGPWRUPACK_Pos (2) /*!< SYS_T::CSDBGCTL: DBGPWRUPACK Position */ -#define SYS_CSDBGCTL_DBGPWRUPACK_Msk (0x1ul << SYS_CSDBGCTL_DBGPWRUPACK_Pos) /*!< SYS_T::CSDBGCTL: DBGPWRUPACK Mask */ - -#define SYS_CSDBGCTL_LPEMU_Pos (3) /*!< SYS_T::CSDBGCTL: LPEMU Position */ -#define SYS_CSDBGCTL_LPEMU_Msk (0x1ul << SYS_CSDBGCTL_LPEMU_Pos) /*!< SYS_T::CSDBGCTL: LPEMU Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS0_Pos (0) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS0 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS0_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS0_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS0 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS1_Pos (1) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS1 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS1_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS1_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS1 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS2_Pos (2) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS2 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS2_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS2_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS2 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS3_Pos (3) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS3 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS3_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS3_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS3 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS4_Pos (4) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS4 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS4_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS4_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS4 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS5_Pos (5) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS5 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS5_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS5_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS5 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS6_Pos (6) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS6 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS6_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS6_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS6 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS7_Pos (7) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS7 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS7_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS7_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS7 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS8_Pos (8) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS8 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS8_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS8_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS8 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS9_Pos (9) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS9 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS9_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS9_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS9 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS10_Pos (10) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS10 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS10_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS10_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS10 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS11_Pos (11) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS11 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS11_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS11_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS11 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS12_Pos (12) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS12 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS12_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS12_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS12 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS13_Pos (13) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS13 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS13_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS13_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS13 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS14_Pos (14) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS14 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS14_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS14_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS14 Mask */ - -#define SYS_GPAB_MFOS_GPIOxMFOS15_Pos (15) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS15 Position */ -#define SYS_GPAB_MFOS_GPIOxMFOS15_Msk (0x1ul << SYS_GPAB_MFOS_GPIOxMFOS15_Pos) /*!< SYS_T::GPAB_MFOS: GPIOxMFOS15 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS16_Pos (16) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS16 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS16_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS16_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS16 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS17_Pos (17) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS17 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS17_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS17_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS17 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS18_Pos (18) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS18 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS18_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS18_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS18 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS19_Pos (19) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS19 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS19_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS19_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS19 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS20_Pos (20) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS20 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS20_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS20_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS20 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS21_Pos (21) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS21 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS21_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS21_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS21 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS22_Pos (22) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS22 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS22_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS22_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS22 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS23_Pos (23) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS23 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS23_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS23_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS23 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS24_Pos (24) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS24 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS24_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS24_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS24 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS25_Pos (25) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS25 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS25_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS25_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS25 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS26_Pos (26) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS26 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS26_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS26_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS26 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS27_Pos (27) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS27 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS27_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS27_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS27 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS28_Pos (28) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS28 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS28_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS28_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS28 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS29_Pos (29) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS29 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS29_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS29_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS29 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS30_Pos (30) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS30 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS30_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS30_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS30 Mask */ - -#define SYS_GPAB_MFOS_GPIOyMFOS31_Pos (31) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS31 Position */ -#define SYS_GPAB_MFOS_GPIOyMFOS31_Msk (0x1ul << SYS_GPAB_MFOS_GPIOyMFOS31_Pos) /*!< SYS_T::GPAB_MFOS: GPIOyMFOS31 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS0_Pos (0) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS0 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS0_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS0_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS0 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS1_Pos (1) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS1 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS1_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS1_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS1 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS2_Pos (2) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS2 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS2_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS2_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS2 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS3_Pos (3) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS3 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS3_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS3_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS3 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS4_Pos (4) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS4 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS4_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS4_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS4 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS5_Pos (5) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS5 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS5_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS5_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS5 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS6_Pos (6) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS6 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS6_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS6_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS6 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS7_Pos (7) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS7 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS7_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS7_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS7 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS8_Pos (8) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS8 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS8_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS8_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS8 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS9_Pos (9) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS9 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS9_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS9_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS9 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS10_Pos (10) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS10 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS10_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS10_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS10 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS11_Pos (11) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS11 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS11_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS11_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS11 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS12_Pos (12) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS12 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS12_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS12_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS12 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS13_Pos (13) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS13 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS13_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS13_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS13 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS14_Pos (14) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS14 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS14_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS14_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS14 Mask */ - -#define SYS_GPCD_MFOS_GPIOxMFOS15_Pos (15) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS15 Position */ -#define SYS_GPCD_MFOS_GPIOxMFOS15_Msk (0x1ul << SYS_GPCD_MFOS_GPIOxMFOS15_Pos) /*!< SYS_T::GPCD_MFOS: GPIOxMFOS15 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS16_Pos (16) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS16 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS16_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS16_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS16 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS17_Pos (17) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS17 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS17_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS17_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS17 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS18_Pos (18) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS18 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS18_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS18_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS18 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS19_Pos (19) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS19 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS19_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS19_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS19 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS20_Pos (20) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS20 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS20_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS20_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS20 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS21_Pos (21) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS21 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS21_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS21_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS21 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS22_Pos (22) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS22 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS22_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS22_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS22 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS23_Pos (23) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS23 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS23_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS23_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS23 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS24_Pos (24) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS24 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS24_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS24_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS24 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS25_Pos (25) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS25 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS25_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS25_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS25 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS26_Pos (26) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS26 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS26_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS26_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS26 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS27_Pos (27) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS27 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS27_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS27_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS27 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS28_Pos (28) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS28 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS28_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS28_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS28 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS29_Pos (29) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS29 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS29_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS29_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS29 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS30_Pos (30) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS30 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS30_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS30_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS30 Mask */ - -#define SYS_GPCD_MFOS_GPIOyMFOS31_Pos (31) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS31 Position */ -#define SYS_GPCD_MFOS_GPIOyMFOS31_Msk (0x1ul << SYS_GPCD_MFOS_GPIOyMFOS31_Pos) /*!< SYS_T::GPCD_MFOS: GPIOyMFOS31 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS0_Pos (0) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS0 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS0_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS0_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS0 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS1_Pos (1) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS1 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS1_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS1_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS1 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS2_Pos (2) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS2 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS2_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS2_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS2 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS3_Pos (3) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS3 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS3_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS3_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS3 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS4_Pos (4) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS4 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS4_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS4_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS4 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS5_Pos (5) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS5 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS5_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS5_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS5 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS6_Pos (6) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS6 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS6_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS6_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS6 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS7_Pos (7) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS7 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS7_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS7_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS7 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS8_Pos (8) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS8 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS8_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS8_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS8 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS9_Pos (9) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS9 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS9_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS9_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS9 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS10_Pos (10) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS10 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS10_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS10_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS10 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS11_Pos (11) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS11 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS11_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS11_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS11 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS12_Pos (12) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS12 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS12_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS12_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS12 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS13_Pos (13) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS13 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS13_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS13_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS13 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS14_Pos (14) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS14 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS14_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS14_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS14 Mask */ - -#define SYS_GPEF_MFOS_GPIOxMFOS15_Pos (15) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS15 Position */ -#define SYS_GPEF_MFOS_GPIOxMFOS15_Msk (0x1ul << SYS_GPEF_MFOS_GPIOxMFOS15_Pos) /*!< SYS_T::GPEF_MFOS: GPIOxMFOS15 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS16_Pos (16) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS16 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS16_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS16_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS16 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS17_Pos (17) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS17 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS17_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS17_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS17 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS18_Pos (18) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS18 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS18_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS18_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS18 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS19_Pos (19) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS19 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS19_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS19_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS19 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS20_Pos (20) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS20 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS20_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS20_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS20 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS21_Pos (21) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS21 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS21_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS21_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS21 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS22_Pos (22) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS22 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS22_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS22_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS22 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS23_Pos (23) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS23 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS23_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS23_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS23 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS24_Pos (24) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS24 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS24_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS24_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS24 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS25_Pos (25) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS25 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS25_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS25_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS25 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS26_Pos (26) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS26 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS26_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS26_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS26 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS27_Pos (27) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS27 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS27_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS27_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS27 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS28_Pos (28) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS28 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS28_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS28_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS28 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS29_Pos (29) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS29 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS29_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS29_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS29 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS30_Pos (30) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS30 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS30_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS30_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS30 Mask */ - -#define SYS_GPEF_MFOS_GPIOyMFOS31_Pos (31) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS31 Position */ -#define SYS_GPEF_MFOS_GPIOyMFOS31_Msk (0x1ul << SYS_GPEF_MFOS_GPIOyMFOS31_Pos) /*!< SYS_T::GPEF_MFOS: GPIOyMFOS31 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS0_Pos (0) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS0 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS0_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS0_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS0 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS1_Pos (1) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS1 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS1_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS1_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS1 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS2_Pos (2) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS2 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS2_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS2_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS2 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS3_Pos (3) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS3 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS3_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS3_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS3 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS4_Pos (4) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS4 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS4_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS4_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS4 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS5_Pos (5) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS5 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS5_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS5_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS5 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS6_Pos (6) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS6 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS6_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS6_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS6 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS7_Pos (7) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS7 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS7_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS7_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS7 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS8_Pos (8) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS8 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS8_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS8_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS8 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS9_Pos (9) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS9 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS9_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS9_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS9 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS10_Pos (10) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS10 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS10_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS10_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS10 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS11_Pos (11) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS11 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS11_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS11_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS11 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS12_Pos (12) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS12 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS12_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS12_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS12 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS13_Pos (13) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS13 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS13_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS13_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS13 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS14_Pos (14) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS14 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS14_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS14_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS14 Mask */ - -#define SYS_GPGH_MFOS_GPIOxMFOS15_Pos (15) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS15 Position */ -#define SYS_GPGH_MFOS_GPIOxMFOS15_Msk (0x1ul << SYS_GPGH_MFOS_GPIOxMFOS15_Pos) /*!< SYS_T::GPGH_MFOS: GPIOxMFOS15 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS16_Pos (16) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS16 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS16_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS16_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS16 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS17_Pos (17) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS17 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS17_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS17_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS17 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS18_Pos (18) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS18 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS18_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS18_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS18 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS19_Pos (19) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS19 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS19_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS19_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS19 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS20_Pos (20) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS20 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS20_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS20_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS20 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS21_Pos (21) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS21 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS21_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS21_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS21 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS22_Pos (22) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS22 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS22_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS22_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS22 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS23_Pos (23) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS23 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS23_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS23_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS23 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS24_Pos (24) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS24 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS24_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS24_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS24 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS25_Pos (25) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS25 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS25_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS25_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS25 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS26_Pos (26) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS26 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS26_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS26_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS26 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS27_Pos (27) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS27 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS27_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS27_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS27 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS28_Pos (28) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS28 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS28_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS28_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS28 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS29_Pos (29) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS29 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS29_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS29_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS29 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS30_Pos (30) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS30 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS30_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS30_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS30 Mask */ - -#define SYS_GPGH_MFOS_GPIOyMFOS31_Pos (31) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS31 Position */ -#define SYS_GPGH_MFOS_GPIOyMFOS31_Msk (0x1ul << SYS_GPGH_MFOS_GPIOyMFOS31_Pos) /*!< SYS_T::GPGH_MFOS: GPIOyMFOS31 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS0_Pos (0) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS0 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS0_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS0_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS0 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS1_Pos (1) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS1 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS1_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS1_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS1 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS2_Pos (2) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS2 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS2_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS2_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS2 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS3_Pos (3) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS3 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS3_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS3_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS3 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS4_Pos (4) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS4 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS4_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS4_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS4 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS5_Pos (5) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS5 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS5_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS5_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS5 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS6_Pos (6) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS6 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS6_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS6_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS6 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS7_Pos (7) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS7 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS7_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS7_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS7 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS8_Pos (8) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS8 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS8_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS8_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS8 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS9_Pos (9) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS9 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS9_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS9_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS9 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS10_Pos (10) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS10 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS10_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS10_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS10 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS11_Pos (11) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS11 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS11_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS11_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS11 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS12_Pos (12) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS12 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS12_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS12_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS12 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS13_Pos (13) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS13 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS13_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS13_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS13 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS14_Pos (14) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS14 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS14_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS14_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS14 Mask */ - -#define SYS_GPIJ_MFOS_GPIOxMFOS15_Pos (15) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS15 Position */ -#define SYS_GPIJ_MFOS_GPIOxMFOS15_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOxMFOS15_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOxMFOS15 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS16_Pos (16) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS16 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS16_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS16_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS16 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS17_Pos (17) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS17 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS17_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS17_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS17 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS18_Pos (18) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS18 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS18_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS18_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS18 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS19_Pos (19) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS19 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS19_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS19_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS19 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS20_Pos (20) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS20 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS20_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS20_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS20 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS21_Pos (21) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS21 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS21_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS21_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS21 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS22_Pos (22) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS22 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS22_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS22_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS22 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS23_Pos (23) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS23 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS23_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS23_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS23 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS24_Pos (24) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS24 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS24_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS24_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS24 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS25_Pos (25) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS25 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS25_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS25_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS25 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS26_Pos (26) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS26 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS26_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS26_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS26 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS27_Pos (27) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS27 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS27_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS27_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS27 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS28_Pos (28) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS28 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS28_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS28_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS28 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS29_Pos (29) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS29 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS29_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS29_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS29 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS30_Pos (30) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS30 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS30_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS30_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS30 Mask */ - -#define SYS_GPIJ_MFOS_GPIOyMFOS31_Pos (31) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS31 Position */ -#define SYS_GPIJ_MFOS_GPIOyMFOS31_Msk (0x1ul << SYS_GPIJ_MFOS_GPIOyMFOS31_Pos) /*!< SYS_T::GPIJ_MFOS: GPIOyMFOS31 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS0_Pos (0) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS0 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS0_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS0_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS0 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS1_Pos (1) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS1 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS1_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS1_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS1 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS2_Pos (2) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS2 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS2_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS2_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS2 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS3_Pos (3) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS3 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS3_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS3_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS3 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS4_Pos (4) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS4 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS4_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS4_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS4 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS5_Pos (5) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS5 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS5_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS5_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS5 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS6_Pos (6) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS6 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS6_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS6_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS6 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS7_Pos (7) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS7 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS7_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS7_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS7 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS8_Pos (8) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS8 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS8_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS8_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS8 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS9_Pos (9) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS9 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS9_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS9_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS9 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS10_Pos (10) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS10 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS10_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS10_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS10 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS11_Pos (11) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS11 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS11_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS11_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS11 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS12_Pos (12) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS12 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS12_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS12_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS12 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS13_Pos (13) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS13 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS13_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS13_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS13 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS14_Pos (14) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS14 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS14_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS14_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS14 Mask */ - -#define SYS_GPKL_MFOS_GPIOxMFOS15_Pos (15) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS15 Position */ -#define SYS_GPKL_MFOS_GPIOxMFOS15_Msk (0x1ul << SYS_GPKL_MFOS_GPIOxMFOS15_Pos) /*!< SYS_T::GPKL_MFOS: GPIOxMFOS15 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS16_Pos (16) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS16 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS16_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS16_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS16 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS17_Pos (17) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS17 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS17_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS17_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS17 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS18_Pos (18) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS18 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS18_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS18_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS18 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS19_Pos (19) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS19 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS19_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS19_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS19 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS20_Pos (20) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS20 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS20_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS20_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS20 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS21_Pos (21) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS21 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS21_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS21_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS21 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS22_Pos (22) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS22 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS22_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS22_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS22 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS23_Pos (23) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS23 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS23_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS23_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS23 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS24_Pos (24) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS24 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS24_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS24_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS24 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS25_Pos (25) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS25 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS25_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS25_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS25 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS26_Pos (26) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS26 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS26_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS26_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS26 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS27_Pos (27) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS27 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS27_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS27_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS27 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS28_Pos (28) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS28 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS28_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS28_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS28 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS29_Pos (29) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS29 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS29_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS29_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS29 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS30_Pos (30) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS30 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS30_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS30_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS30 Mask */ - -#define SYS_GPKL_MFOS_GPIOyMFOS31_Pos (31) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS31 Position */ -#define SYS_GPKL_MFOS_GPIOyMFOS31_Msk (0x1ul << SYS_GPKL_MFOS_GPIOyMFOS31_Pos) /*!< SYS_T::GPKL_MFOS: GPIOyMFOS31 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS0_Pos (0) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS0 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS0_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS0_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS0 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS1_Pos (1) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS1 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS1_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS1_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS1 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS2_Pos (2) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS2 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS2_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS2_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS2 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS3_Pos (3) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS3 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS3_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS3_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS3 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS4_Pos (4) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS4 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS4_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS4_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS4 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS5_Pos (5) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS5 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS5_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS5_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS5 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS6_Pos (6) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS6 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS6_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS6_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS6 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS7_Pos (7) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS7 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS7_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS7_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS7 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS8_Pos (8) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS8 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS8_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS8_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS8 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS9_Pos (9) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS9 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS9_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS9_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS9 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS10_Pos (10) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS10 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS10_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS10_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS10 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS11_Pos (11) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS11 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS11_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS11_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS11 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS12_Pos (12) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS12 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS12_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS12_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS12 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS13_Pos (13) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS13 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS13_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS13_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS13 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS14_Pos (14) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS14 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS14_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS14_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS14 Mask */ - -#define SYS_GPMN_MFOS_GPIOxMFOS15_Pos (15) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS15 Position */ -#define SYS_GPMN_MFOS_GPIOxMFOS15_Msk (0x1ul << SYS_GPMN_MFOS_GPIOxMFOS15_Pos) /*!< SYS_T::GPMN_MFOS: GPIOxMFOS15 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS16_Pos (16) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS16 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS16_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS16_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS16 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS17_Pos (17) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS17 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS17_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS17_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS17 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS18_Pos (18) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS18 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS18_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS18_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS18 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS19_Pos (19) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS19 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS19_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS19_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS19 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS20_Pos (20) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS20 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS20_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS20_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS20 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS21_Pos (21) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS21 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS21_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS21_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS21 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS22_Pos (22) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS22 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS22_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS22_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS22 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS23_Pos (23) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS23 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS23_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS23_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS23 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS24_Pos (24) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS24 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS24_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS24_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS24 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS25_Pos (25) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS25 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS25_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS25_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS25 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS26_Pos (26) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS26 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS26_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS26_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS26 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS27_Pos (27) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS27 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS27_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS27_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS27 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS28_Pos (28) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS28 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS28_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS28_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS28 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS29_Pos (29) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS29 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS29_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS29_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS29 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS30_Pos (30) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS30 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS30_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS30_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS30 Mask */ - -#define SYS_GPMN_MFOS_GPIOyMFOS31_Pos (31) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS31 Position */ -#define SYS_GPMN_MFOS_GPIOyMFOS31_Msk (0x1ul << SYS_GPMN_MFOS_GPIOyMFOS31_Pos) /*!< SYS_T::GPMN_MFOS: GPIOyMFOS31 Mask */ - -#define SYS_UID0_UID_Pos (0) /*!< SYS_T::UID0: UID Position */ -#define SYS_UID0_UID_Msk (0xfffffffful << SYS_UID0_UID_Pos) /*!< SYS_T::UID0: UID Mask */ - -#define SYS_UID1_UID_Pos (0) /*!< SYS_T::UID1: UID Position */ -#define SYS_UID1_UID_Msk (0xfffffffful << SYS_UID1_UID_Pos) /*!< SYS_T::UID1: UID Mask */ - -#define SYS_UID2_UID_Pos (0) /*!< SYS_T::UID2: UID Position */ -#define SYS_UID2_UID_Msk (0xfffffffful << SYS_UID2_UID_Pos) /*!< SYS_T::UID2: UID Mask */ - -#define SYS_UCID0_UCID_Pos (0) /*!< SYS_T::UCID0: UCID Position */ -#define SYS_UCID0_UCID_Msk (0xfffffffful << SYS_UCID0_UCID_Pos) /*!< SYS_T::UCID0: UCID Mask */ - -#define SYS_UCID1_UCID_Pos (0) /*!< SYS_T::UCID1: UCID Position */ -#define SYS_UCID1_UCID_Msk (0xfffffffful << SYS_UCID1_UCID_Pos) /*!< SYS_T::UCID1: UCID Mask */ - -#define SYS_UCID2_UCID_Pos (0) /*!< SYS_T::UCID2: UCID Position */ -#define SYS_UCID2_UCID_Msk (0xfffffffful << SYS_UCID2_UCID_Pos) /*!< SYS_T::UCID2: UCID Mask */ - -#define SYS_RLKTZS_REGLCTL_Pos (0) /*!< SYS_T::RLKTZS: REGLCTL Position */ -#define SYS_RLKTZS_REGLCTL_Msk (0xfful << SYS_RLKTZS_REGLCTL_Pos) /*!< SYS_T::RLKTZS: REGLCTL Mask */ - -#define SYS_RLKTZNS_REGLCTL_Pos (0) /*!< SYS_T::RLKTZNS: REGLCTL Position */ -#define SYS_RLKTZNS_REGLCTL_Msk (0xfful << SYS_RLKTZNS_REGLCTL_Pos) /*!< SYS_T::RLKTZNS: REGLCTL Mask */ - -#define SYS_RLKSUBM_REGLCTL_Pos (0) /*!< SYS_T::RLKSUBM: REGLCTL Position */ -#define SYS_RLKSUBM_REGLCTL_Msk (0xfful << SYS_RLKSUBM_REGLCTL_Pos) - -/**@}*/ /* SYS_CONST */ -/**@}*/ /* end of SYS register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __SYS_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/system_ma35d1.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/system_ma35d1.h deleted file mode 100644 index 5891fad76f8..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/system_ma35d1.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************//** - * @file system_ma35d1_rtp.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __SYSTEM_MA35D1_RTP_H__ -#define __SYSTEM_MA35D1_RTP_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - -/*---------------------------------------------------------------------------- - Define clocks - *----------------------------------------------------------------------------*/ - -#define __HSI (24000000UL) /*!< PLL default output is 50MHz */ -#define __HXT (24000000UL) /*!< External Crystal Clock Frequency */ -#define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */ -#define __HIRC (12000000UL) /*!< Internal 12M RC Oscillator Frequency */ -#define __LIRC (30000UL) /*!< Internal 10K RC Oscillator Frequency */ -#define __SYS_OSC_CLK ( ___HSI) /* Main oscillator frequency */ - - -#define __SYSTEM_CLOCK (1UL*__HXT) - -extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ -extern uint32_t CyclesPerUs; /*!< Cycles per micro second */ -extern uint32_t PllClock; /*!< PLL Output Clock Frequency */ - - -/** - * Initialize the system - * - * @param none - * @return none - * - * @brief Setup the micro controller system. - * Initialize the System and update the SystemCoreClock variable. - */ -extern void SystemInit(void); - -/** - * Update SystemCoreClock variable - * - * @param none - * @return none - * - * @brief Updates the SystemCoreClock with current core Clock - * retrieved from cpu registers. - */ -extern void SystemCoreClockUpdate(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __SYSTEM_MA35D1_RTP_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/timer_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/timer_reg.h deleted file mode 100644 index a401e163f6a..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/timer_reg.h +++ /dev/null @@ -1,1069 +0,0 @@ -/**************************************************************************//** - * @file timer_reg.h - * @brief TIMER register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TIMER_REG_H__ -#define __TIMER_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup TIMER Timer Controller(TIMER) - Memory Mapped Structure for TIMER Controller -@{ */ - -typedef struct -{ - - - /** - * @var TIMER_T::CTL - * Offset: 0x00 Timer Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |PSC |Prescale Counter - * | | |Timer input clock or event source is divided by (PSC+1) before it is fed to the timer up counter - * | | |If this field is 0 (PSC = 0), then there is no scaling. - * | | |Note: Update prescale counter value will reset internal 8-bit prescale counter and 24-bit up counter value. - * |[19] |INTRGEN |Inter-timer Trigger Mode Enable Bit - * | | |Setting this bit will enable the inter-timer trigger capture function. - * | | |The Timer0/2/4/6/8/10 will be in event counter mode and counting with external clock source or event - * | | |Also, Timer1/3/5/7/9/11 will be in trigger-counting mode of capture function. - * | | |0 = Inter-Timer Trigger Capture mode Disabled. - * | | |1 = Inter-Timer Trigger Capture mode Enabled. - * | | |Note: For Timer1/3/5/7/9/11, this bit is ignored and the read back value is always 0. - * |[20] |PERIOSEL |Periodic Mode Behavior Selection Enable Bit - * | | |0 = The behavior selection in periodic mode is Disabled. - * | | |When user updates CMPDAT while timer is running in periodic mode, - * | | |CNT will be reset to default value. - * | | |1 = The behavior selection in periodic mode is Enabled. - * | | |When user update CMPDAT while timer is running in periodic mode, the limitations as bellows list, - * | | |If updated CMPDAT value > CNT, CMPDAT will be updated and CNT keep running continually. - * | | |If updated CMPDAT value = CNT, timer time-out interrupt will be asserted immediately. - * | | |If updated CMPDAT value < CNT, CNT will be reset to default value. - * |[21] |TGLPINSEL |Toggle-output Pin Select - * | | |0 = Toggle mode output to TMx (Timer Event Counter Pin). - * | | |1 = Toggle mode output to TMx_EXT (Timer External Capture Pin). - * |[22] |CAPSRC |Capture Pin Source Selection - * | | |0 = Capture Function source is from TMx_EXT (x= 0~11) pin. - * | | |1 = Capture Function source is from internal clock source (HIRC 12M, LIRC) or external clock (HXT, LXT). - * | | |Note: When CAPSRC = 1, user can set ICAPSSEL (TIMERx_EXTCTL[10:8]) to decide which clock is as timer capture source. - * |[23] |WKEN |Wake-up Function Enable Bit - * | | |If this bit is set to 1, while timer interrupt flag TIF (TIMERx_INTSTS[0]) is 1 and INTEN (TIMERx_CTL[29]) is enabled, the timer interrupt signal will generate a wake-up trigger event to CPU. - * | | |0 = Wake-up function Disabled if timer interrupt signal generated. - * | | |1 = Wake-up function Enabled if timer interrupt signal generated. - * |[24] |EXTCNTEN |Event Counter Mode Enable Bit - * | | |This bit is for external counting pin function enabled. - * | | |0 = Event counter mode Disabled. - * | | |1 = Event counter mode Enabled. - * | | |Note: When timer is used as an event counter, this bit should be set to 1 and select PCLK as timer clock source. - * |[25] |ACTSTS |Timer Active Status Bit (Read Only) - * | | |This bit indicates the 24-bit up counter status. - * | | |0 = 24-bit up counter is not active. - * | | |1 = 24-bit up counter is active. - * | | |Note: This bit may active when CNT 0 transition to CNT 1. - * |[28:27] |OPMODE |Timer Counting Mode Select - * | | |00 = The Timer controller is operated in One-shot mode. - * | | |01 = The Timer controller is operated in Periodic mode. - * | | |10 = The Timer controller is operated in Toggle-output mode. - * | | |11 = The Timer controller is operated in Continuous Counting mode. - * |[29] |INTEN |Timer Interrupt Enable Bit - * | | |0 = Timer time-out interrupt Disabled. - * | | |1 = Timer time-out interrupt Enabled. - * | | |Note: If this bit is enabled, when the timer time-out interrupt flag TIF is set to 1, the timer interrupt signal is generated and inform to CPU. - * |[30] |CNTEN |Timer Counting Enable Bit - * | | |0 = Stops/Suspends counting. - * | | |1 = Starts counting. - * | | |Note 1: In stop status, and then set CNTEN to 1 will enable the 24-bit up counter to keep counting from the last stop counting value. - * | | |Note 2: This bit is auto-cleared by hardware in one-shot mode (TIMER_CTL[28:27] = 00) when the timer time-out interrupt flag TIF (TIMERx_INTSTS[0]) is generated. - * | | |Note 3: Set enable/disable this bit needs 2 * TMR_CLK period to become active, user can read ACTSTS (TIMERx_CTL[25]) to check enable/disable command is completed or not. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects TIMER counting. - * | | |TIMER counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |TIMER counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * @var TIMER_T::CMP - * Offset: 0x04 Timer Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CMPDAT |Timer Comparator Value - * | | |CMPDAT is a 24-bit compared value register - * | | |When the internal 24-bit up counter value is equal to CMPDAT value, the TIF (TIMERx_INTSTS[0] Timer Interrupt Flag) will set to 1. - * | | |Time-out period = (Period of timer clock input) * (8-bit PSC + 1) * (24-bit CMPDAT). - * | | |Note 1: Never write 0x0 or 0x1 in CMPDAT field, or the core will run into unknown state. - * | | |Note 2: When timer is operating at continuous counting mode, the 24-bit up counter will keep counting continuously even if user writes a new value into CMPDAT field - * | | |But if timer is operating at other modes, the 24-bit up counter will restart counting from 0 and using newest CMPDAT value to be the timer compared value while user writes a new value into CMPDAT field. - * @var TIMER_T::INTSTS - * Offset: 0x08 Timer Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TIF |Timer Interrupt Flag - * | | |This bit indicates the interrupt flag status of Timer while 24-bit timer up counter CNT (TIMERx_CNT[23:0]) value reaches to CMPDAT (TIMERx_CMP[23:0]) value. - * | | |0 = No effect. - * | | |1 = CNT value matches the CMPDAT value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |TWKF |Timer Wake-up Flag - * | | |This bit indicates the interrupt wake-up flag status of timer. - * | | |0 = Timer does not cause CPU wake-up. - * | | |1 = CPU wake-up from Idle or Power-down mode if timer time-out interrupt signal generated. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::CNT - * Offset: 0x0C Timer Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CNT |Timer Data Register - * | | |Read operation. - * | | |Read this register to get CNT value. For example: - * | | |If EXTCNTEN (TIMERx_CTL[24]) is 0, user can read CNT value for getting current 24-bit counter value. - * | | |If EXTCNTEN (TIMERx_CTL[24]) is 1, user can read CNT value for getting current 24-bit event input counter value. - * | | |Write operation. - * | | |Writing any value to this register will reset current CNT value to 0 and reload internal 8-bit prescale counter. - * |[31] |RSTACT |Timer Data Register Reset Active (Read Only) - * | | |This bit indicates if the counter reset operation active. - * | | |When user writes this CNT register, timer starts to reset its internal 24-bit timer up-counter to 0 and reload 8-bit pre-scale counter - * | | |At the same time, timer set this flag to 1 to indicate the counter reset operation is in progress - * | | |Once the counter reset operation done, timer clear this bit to 0 automatically. - * | | |0 = Reset operation is done. - * | | |1 = Reset operation triggered by writing TIMERx_CNT is in progress. - * @var TIMER_T::CAP - * Offset: 0x10 Timer Capture Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |CAPDAT |Timer Capture Data Register - * | | |When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT pin matched the CAPEDGE (TIMERx_EXTCTL[14:12]) setting, CAPIF (TIMERx_EINTSTS[0]) will set to 1 and the current timer counter value CNT (TIMERx_CNT[23:0]) will be auto-loaded into this CAPDAT field. - * @var TIMER_T::EXTCTL - * Offset: 0x14 Timer External Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTPHASE |Timer External Count Phase - * | | |This bit indicates the detection phase of external counting pin TMx (x= 0~11). - * | | |0 = A falling edge of external counting pin will be counted. - * | | |1 = A rising edge of external counting pin will be counted. - * |[3] |CAPEN |Timer External Capture Pin Enable Bit - * | | |This bit enables the TMx_EXT capture pin input function. - * | | |0 =TMx_EXT (x= 0~11) pin Disabled. - * | | |1 =TMx_EXT (x= 0~11) pin Enabled. - * |[4] |CAPFUNCS |Capture Function Selection - * | | |0 = External Capture Mode Enabled. - * | | |1 = External Reset Mode Enabled. - * | | |Note 1: When CAPFUNCS is 0, transition on TMx_EXT (x= 0~11) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field. - * | | |Note 2: When CAPFUNCS is 1, transition on TMx_EXT (x= 0~11) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field then CNT value will be reset immediately. - * |[5] |CAPIEN |Timer External Capture Interrupt Enable Bit - * | | |0 = TMx_EXT (x= 0~11) pin detection Interrupt Disabled. - * | | |1 = TMx_EXT (x= 0~11) pin detection Interrupt Enabled. - * | | |Note: CAPIEN is used to enable timer external interrupt - * | | |If CAPIEN enabled, timer will rise an interrupt when CAPIF (TIMERx_EINTSTS[0]) is 1. - * | | |For example, while CAPIEN = 1, CAPEN = 1, and CAPEDGE = 00, a 1 to 0 transition on the TMx_EXT pin will cause the CAPIF to be set then the interrupt signal is generated and sent to NVIC to inform CPU. - * |[6] |CAPDBEN |Timer External Capture Pin De-bounce Enable Bit - * | | |0 = TMx_EXT (x= 0~11) pin de-bounce Disabled. - * | | |1 = TMx_EXT (x= 0~11) pin de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx_EXT pin is detected with de-bounce circuit. - * |[7] |CNTDBEN |Timer Counter Pin De-bounce Enable Bit - * | | |0 = TMx (x= 0~11) pin de-bounce Disabled. - * | | |1 = TMx (x= 0~11) pin de-bounce Enabled. - * | | |Note: If this bit is enabled, the edge detection of TMx pin is detected with de-bounce circuit. - * |[10:8] |ICAPSSEL |Internal Capture Source Selection - * | | |010 = Capture Function source is from HXT. - * | | |011 = Capture Function source is from LXT. - * | | |100 = Capture Function source is from HIRC. - * | | |101 = Capture Function source is from LIRC. - * | | |110 = Reserved. - * | | |111 = Reserved. - * | | |Note: these bits only available when CAPSRC (TIMERx_CTL[22]) is 1. - * |[14:12] |CAPEDGE |Timer External Capture Pin Edge Detect - * | | |When first capture event is generated, the CNT (TIMERx_CNT[23:0]) will be reset to 0 and first CAPDAT (TIMERx_CAP[23:0]) should be to 0. - * | | |000 = Capture event occurred when detect falling edge transfer on TMx_EXT (x= 0~11) pin. - * | | |001 = Capture event occurred when detect rising edge transfer on TMx_EXT (x= 0~11) pin. - * | | |010 = Capture event occurred when detect both falling and rising edge transfer on TMx_EXT (x= 0~11) pin, and first capture event occurred at falling edge transfer. - * | | |011 = Capture event occurred when detect both rising and falling edge transfer on TMx_EXT (x= 0~11) pin, and first capture event occurred at rising edge transfer. - * | | |110 = First capture event occurred at falling edge, follows capture events are at rising edge transfer on TMx_EXT (x= 0~11) pin. - * | | |111 = First capture event occurred at rising edge, follows capture events are at falling edge transfer on TMx_EXT (x= 0~11) pin. - * | | |100, 101 = Reserved. - * |[16] |ECNTSSEL |Event Counter Source Selection to Trigger Event Counter Function - * | | |0 = Event Counter input source is from TMx (x= 0~11) pin. - * |[31:28] |CAPSDIV |Timer Capture Source Divider - * | | |This bits indicate the divide scale for capture source. - * | | |0000 = Capture source/1. - * | | |0001 = Capture source/2. - * | | |0010 = Capture source/4. - * | | |0011 = Capture source/8. - * | | |0100 = Capture source/16. - * | | |0101 = Capture source/32. - * | | |0110 = Capture source/64. - * | | |0111 = Capture source/128. - * | | |1000 = Capture source/256. - * | | |1001~1111 = Reserved. - * | | |Note: Sets ICAPSSEL (TIMERx_EXTCTL[10:8]) and CAPSRC (TIMERx_CTL[22]) to select capture source. - * @var TIMER_T::EINTSTS - * Offset: 0x18 Timer External Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAPIF |Timer External Capture Interrupt Flag - * | | |This bit indicates the timer external capture interrupt flag status. - * | | |0 = TMx_EXT (x= 0~11) pin interrupt did not occur. - * | | |1 = TMx_EXT (x= 0~11) pin interrupt occurred. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2: When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT (x= 0~11) pin matched the CAPEDGE (TIMERx_EXTCTL[2:1]) setting, this bit will set to 1 by hardware. - * | | |Note 3: There is a new incoming capture event detected before CPU clearing the CAPIF status - * | | |If the above condition occurred, the Timer will keep register TIMERx_CAP unchanged and drop the new capture value. - * @var TIMER_T::TRGCTL - * Offset: 0x1C Timer Trigger Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRGSSEL |Trigger Source Select Bit - * | | |This bit is used to select internal trigger source is form timer time-out interrupt signal or capture interrupt signal. - * | | |0 = Time-out interrupt signal is used to internal trigger EPWM, BPWM, PDMA and ADC. - * | | |1 = Capture interrupt signal is used to internal trigger EPWM, BPWM, PDMA and ADC. - * |[1] |TRGPWM |Trigger EPWM and BPWM Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be as EPWM and BPWM counter clock source. - * | | |0 = Timer interrupt trigger EPWM and BPWM Disabled. - * | | |1 = Timer interrupt trigger EPWM and BPWM Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal as EPWM and BPWM counter clock source. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal as EPWM and BPWM counter clock source. - * |[2] |TRGEADC |Trigger EADC Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered EADC conversion. - * | | |0 = Timer interrupt trigger EADC Disabled. - * | | |1 = Timer interrupt trigger EADC Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger EADC conversion. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger EADC conversion. - * |[4] |TRGPDMA |Trigger PDMA Enable Bit - * | | |If this bit is set to 1, each timer time-out event or capture event can be triggered PDMA transfer. - * | | |0 = Timer interrupt trigger PDMA Disabled. - * | | |1 = Timer interrupt trigger PDMA Enabled. - * | | |Note: If TRGSSEL (TIMERx_TRGCTL[0]) = 0, time-out interrupt signal will trigger PDMA transfer. - * | | |If TRGSSEL (TIMERx_TRGCTL[0]) = 1, capture interrupt signal will trigger PDMA transfer. - * @var TIMER_T::ALTCTL - * Offset: 0x20 Timer Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |FUNCSEL |Function Selection - * | | |0 = Timer controller is used as timer function. - * | | |1 = Timer controller is used as PWM function. - * | | |Note: When timer is used as PWM, the clock source of time controller will be forced to PCLKx automatically. - * @var TIMER_T::PWMCTL - * Offset: 0x40 Timer PWM Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTEN |PWM Counter Enable Bit - * | | |0 = PWM counter and clock prescale Stop Running. - * | | |1 = PWM counter and clock prescale Start Running. - * |[2:1] |CNTTYPE |PWM Counter Behavior Type - * | | |00 = Up count type. - * | | |01 = Down count type. - * | | |10 = Up-down count type. - * | | |11 = Reserved. - * |[3] |CNTMODE |PWM Counter Mode - * | | |0 = Auto-reload mode. - * | | |1 = One-shot mode. - * |[8] |CTRLD |Center Re-load - * | | |In up-down count type, PERIOD will load to PBUF when current PWM period is completed always and CMP will load to CMPBUF at the center point of current period. - * |[9] |IMMLDEN |Immediately Load Enable Bit - * | | |0 = PERIOD will load to PBUF when current PWM period is completed no matter CTRLD is enabled/disabled - * | | |If CTRLD is disabled, CMP will load to CMPBUF when current PWM period is completed; if CTRLD is enabled in up-down count type, CMP will load to CMPBUF at the center point of current period. - * | | |1 = PERIOD/CMP will load to PBUF/CMPBUF immediately when user update PERIOD/CMP. - * | | |Note: If IMMLDEN is enabled, CTRLD will be invalid. - * |[16] |OUTMODE |PWM Output Mode - * | | |This bit controls the output mode of corresponding PWM channel. - * | | |0 = PWM independent mode. - * | | |1 = PWM complementary mode. - * |[30] |DBGHALT |ICE Debug Mode Counter Halt (Write Protect) - * | | |If debug mode counter halt is enabled, PWM counter will keep current value until exit ICE debug mode. - * | | |0 = ICE debug mode counter halt disable. - * | | |1 = ICE debug mode counter halt enable. - * | | |Note: This bit is write protected. Refer to SYS_RLKTZS or SYS_RLKTZND or SYS_RLKSUBM register. - * |[31] |DBGTRIOFF |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement effects PWM output. - * | | |PWM output pin will be forced as tri-state while ICE debug mode acknowledged. - * | | |1 = ICE debug mode acknowledgement disabled. - * | | |PWM output pin will keep output no matter ICE debug mode acknowledged or not. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var TIMER_T::PWMCLKSRC - * Offset: 0x44 Timer PWM Counter Clock Source Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CLKSRC |PWM Counter Clock Source Select - * | | |The PWM counter clock source can be selected from TMRx_CLK or internal timer time-out or capture event. - * | | |0000 = TMRx_CLK. - * | | |0001 = Internal TIMER0 time-out or capture event. - * | | |0010 = Internal TIMER1 time-out or capture event. - * | | |0011 = Internal TIMER2 time-out or capture event. - * | | |0100 = Internal TIMER3 time-out or capture event. - * | | |0101 = Internal TIMER4 time-out or capture event. - * | | |0110 = Internal TIMER5 time-out or capture event. - * | | |0111 = Internal TIMER6 time-out or capture event. - * | | |1000 = Internal TIMER7 time-out or capture event. - * | | |1001 = Internal TIMER8 time-out or capture event. - * | | |1010 = Internal TIMER9 time-out or capture event. - * | | |1011 = Internal TIMER10 time-out or capture event. - * | | |1100 = Internal TIMER11 time-out or capture event. - * | | |Others = Reserved. - * | | |Note: If TIMER0 PWM function is enabled, the PWM counter clock source can be selected from TMR0_CLK, TIMER1 interrupt events, TIMER2 interrupt events, or TIMER3 interrupt events. - * @var TIMER_T::PWMCLKPSC - * Offset: 0x48 Timer PWM Counter Clock Pre-scale Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |CLKPSC |PWM Counter Clock Pre-scale - * | | |The active clock of PWM counter is decided by counter clock prescale and divided by (CLKPSC + 1) - * | | |If CLKPSC is 0, then there is no scaling in PWM counter clock source. - * @var TIMER_T::PWMCNTCLR - * Offset: 0x4C Timer PWM Clear Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTCLR |Clear PWM Counter Control Bit - * | | |It is automatically cleared by hardware. - * | | |0 = No effect. - * | | |1 = Clear 16-bit PWM counter to 0x10000 in up and up-down count type and reset counter value to PERIOD in down count type. - * @var TIMER_T::PWMPERIOD - * Offset: 0x50 Timer PWM Period Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PERIOD |PWM Period Register - * | | |In up count type: PWM counter counts from 0 to PERIOD, and restarts from 0. - * | | |In down count type: PWM counter counts from PERIOD to 0, and restarts from PERIOD. - * | | |In up-down count type: PWM counter counts from 0 to PERIOD, then decrements to 0 and repeats again. - * | | |In up and down count type: - * | | |PWM period time = (PERIOD + 1) * (CLKPSC + 1) * TMRx_PWMCLK. - * | | |In up-down count type: - * | | |PWM period time = 2 * PERIOD * (CLKPSC+ 1) * TMRx_PWMCLK. - * | | |Note: User should take care DIRF (TIMERx_PWMCNT[16]) bit in up/down/up-down count type to monitor current counter direction in each count type. - * @var TIMER_T::PWMCMPDAT - * Offset: 0x54 Timer PWM Comparator Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMP |PWM Comparator Register - * | | |PWM CMP is used to compare with PWM CNT to generate PWM output waveform, interrupt events and trigger ADC to start conversion. - * @var TIMER_T::PWMDTCTL - * Offset: 0x58 Timer PWM Dead-time Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |DTCNT |Dead-time Counter (Write Protect) - * | | |The dead-time can be calculated from the following two formulas: - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK, if DTCKSEL is 0. - * | | |Dead-time = (DTCNT[11:0] + 1) * TMRx_PWMCLK * (CLKPSC + 1), if DTCKSEL is 1. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[16] |DTEN |Enable Dead-time Insertion for PWMx_CH0 and PWMx_CH1 (Write Protect) - * | | |Dead-time insertion function is only active when PWM complementary mode is enabled - * | | |If dead- time insertion is inactive, the outputs of PWMx_CH0 and PWMx_CH1 are complementary without any delay. - * | | |0 = Dead-time insertion Disabled on the pin pair. - * | | |1 = Dead-time insertion Enabled on the pin pair. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[24] |DTCKSEL |Dead-time Clock Select (Write Protect) - * | | |0 = Dead-time clock source from TMRx_PWMCLK without counter clock prescale. - * | | |1 = Dead-time clock source from TMRx_PWMCLK with counter clock prescale. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var TIMER_T::PWMCNT - * Offset: 0x5C Timer PWM Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CNT |PWM Counter Value Register (Read Only) - * | | |User can monitor CNT to know the current counter value in 16-bit period counter. - * |[16] |DIRF |PWM Counter Direction Indicator Flag (Read Only) - * | | |0 = Counter is active in down count. - * | | |1 = Counter is active up count. - * @var TIMER_T::PWMMSKEN - * Offset: 0x60 Timer PWM Output Mask Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKEN0 |PWMx_CH0 Output Mask Enable Bit - * | | |The PWMx_CH0 output signal will be masked when this bit is enabled - * | | |The PWMx_CH0 will output MSKDAT0 (TIMER_PWMMSK[0]) data. - * | | |0 = PWMx_CH0 output signal is non-masked. - * | | |1 = PWMx_CH0 output signal is masked and output MSKDAT0 data. - * |[1] |MSKEN1 |PWMx_CH1 Output Mask Enable Bit - * | | |The PWMx_CH1 output signal will be masked when this bit is enabled - * | | |The PWMx_CH1 will output MSKDAT1 (TIMER_PWMMSK[1]) data. - * | | |0 = PWMx_CH1 output signal is non-masked. - * | | |1 = PWMx_CH1 output signal is masked and output MSKDAT1 data. - * @var TIMER_T::PWMMSK - * Offset: 0x64 Timer PWM Output Mask Data Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MSKDAT0 |PWMx_CH0 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH0 pin when PWMx_CH0 output mask function is enabled (MSKEN0 = 1). - * | | |0 = Output logic Low to PWMx_CH0. - * | | |1 = Output logic High to PWMx_CH0. - * |[1] |MSKDAT1 |PWMx_CH1 Output Mask Data Control Bit - * | | |This bit is used to control the output state of PWMx_CH1 pin when PWMx_CH1 output mask function is enabled (MSKEN1 = 1). - * | | |0 = Output logic Low to PWMx_CH1. - * | | |1 = Output logic High to PWMx_CH1. - * @var TIMER_T::PWMBNF - * Offset: 0x68 Timer PWM Brake Pin Noise Filter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKNFEN |Brake Pin Noise Filter Enable Bit - * | | |0 = Pin noise filter detect of PWMx_BRAKEy Disabled. - * | | |1 = Pin noise filter detect of PWMx_BRAKEy Enabled. - * |[3:1] |BRKNFSEL |Brake Pin Noise Filter Clock Selection - * | | |000 = Noise filter clock is PCLKx. - * | | |001 = Noise filter clock is PCLKx/2. - * | | |010 = Noise filter clock is PCLKx/4. - * | | |011 = Noise filter clock is PCLKx/8. - * | | |100 = Noise filter clock is PCLKx/16. - * | | |101 = Noise filter clock is PCLKx/32. - * | | |110 = Noise filter clock is PCLKx/64. - * | | |111 = Noise filter clock is PCLKx/128. - * |[6:4] |BRKFCNT |Brake Pin Noise Filter Count - * | | |The fields is used to control the active noise filter sample time. - * | | |Once noise filter sample time = (Period time of BRKDBCS) * BRKFCNT. - * |[7] |BRKPINV |Brake Pin Detection Control Bit - * | | |0 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from low to high in edge-detect, or pin status is high in level-detect. - * | | |1 = Brake pin event will be detected if PWMx_BRAKEy pin status transfer from high to low in edge-detect, or pin status is low in level-detect . - * |[18:16] |BKPINSRC |Brake Pin Source Select - * | | |000 = Brake pin source comes from PWM0_BRAKE0 pin. - * | | |001 = Brake pin source comes from PWM0_BRAKE1 pin. - * | | |010 = Brake pin source comes from PWM1_BRAKE0 pin. - * | | |011 = Brake pin source comes from PWM1_BRAKE1 pin. - * | | |100 = Brake pin source comes from PWM2_BRAKE0 pin. - * | | |101 = Brake pin source comes from PWM2_BRAKE1 pin. - * @var TIMER_T::PWMFAILBRK - * Offset: 0x6C Timer PWM System Fail Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CSSBRKEN |Clock Security System Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by clock fail detection Disabled. - * | | |1 = Brake Function triggered by clock fail detection Enabled. - * |[1] |LVDBRKEN |Low Voltage Interrupt Flag Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by LVD interrupt flag event Disabled. - * | | |1 = Brake Function triggered by LVD interrupt flag event Enabled. - * |[3] |CORBRKEN |Core Lockup Detection Trigger PWM Brake Function Enable Bit - * | | |0 = Brake Function triggered by core lockup event Disabled. - * | | |1 = Brake Function triggered by core lockup event Enabled. - * @var TIMER_T::PWMBRKCTL - * Offset: 0x70 Timer PWM Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4] |BRKPEEN |Enable TM_BRAKEx Pin As Edge-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as edge-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[7] |SYSEBEN |Enable System Fail As Edge-detect Brake Source (Write Protect) - * | | |0 = System fail condition as edge-detect brake source Disabled. - * | | |1 = System fail condition as edge-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[12] |BRKPLEN |Enable TM_BRAKEx Pin As Level-detect Brake Source (Write Protect) - * | | |0 = PWMx_BRAKEy pin event as level-detect brake source Disabled. - * | | |1 = PWMx_BRAKEy pin event as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[15] |SYSLBEN |Enable System Fail As Level-detect Brake Source (Write Protect) - * | | |0 = System fail condition as level-detect brake source Disabled. - * | | |1 = System fail condition as level-detect brake source Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[17:16] |BRKAEVEN |PWM Brake Action Select for PWMx_CH0 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH0 output. - * | | |01 = PWMx_CH0 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH0 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH0 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[19:18] |BRKAODD |PWM Brake Action Select for PWMx_CH1 (Write Protect) - * | | |00 = PWMx_BRAKEy brake event will not affect PWMx_CH1 output. - * | | |01 = PWMx_CH1 output tri-state when PWMx_BRAKEy brake event happened. - * | | |10 = PWMx_CH1 output low level when PWMx_BRAKEy brake event happened. - * | | |11 = PWMx_CH1 output high level when PWMx_BRAKEy brake event happened. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var TIMER_T::PWMPOLCTL - * Offset: 0x74 Timer PWM Pin Output Polar Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |PINV0 |PWMx_CH0 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH0 output pin. - * | | |0 = PWMx_CH0 output pin polar inverse Disabled. - * | | |1 = PWMx_CH0 output pin polar inverse Enabled. - * |[1] |PINV1 |PWMx_CH1 Output Pin Polar Control Bit - * | | |The bit is used to control polarity state of PWMx_CH1 output pin. - * | | |0 = PWMx_CH1 output pin polar inverse Disabled. - * | | |1 = PWMx_CH1 output pin polar inverse Enabled. - * @var TIMER_T::PWMPOEN - * Offset: 0x78 Timer PWM Pin Output Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |POEN0 |PWMx_CH0 Output Pin Enable Bit - * | | |0 = PWMx_CH0 pin at tri-state mode. - * | | |1 = PWMx_CH0 pin in output mode. - * |[1] |POEN1 |PWMx_CH1 Output Pin Enable Bit - * | | |0 = PWMx_CH1 pin at tri-state mode. - * | | |1 = PWMx_CH1 pin in output mode. - * @var TIMER_T::PWMSWBRK - * Offset: 0x7C Timer PWM Software Trigger Brake Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKETRG |Software Trigger Edge-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM edge-detect brake source, then BRKEIF0 and BRKEIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[8] |BRKLTRG |Software Trigger Level-detect Brake Source (Write Only) (Write Protect) - * | | |Write 1 to this bit will trigger PWM level-detect brake source, then BRKLIF0 and BRKLIF1 will set to 1 automatically in TIMERx_PWMINTSTS1 register. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var TIMER_T::PWMINTEN0 - * Offset: 0x80 Timer PWM Interrupt Enable Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIEN |PWM Zero Point Interrupt Enable Bit - * | | |0 = Zero point interrupt Disabled. - * | | |1 = Zero point interrupt Enabled. - * |[1] |PIEN |PWM Period Point Interrupt Enable Bit - * | | |0 = Period point interrupt Disabled. - * | | |1 = Period point interrupt Enabled. - * | | |Note: In up-down count type, period point means the center point of current PWM period. - * |[2] |CMPUIEN |PWM Compare Up Count Interrupt Enable Bit - * | | |0 = Compare up count interrupt Disabled. - * | | |1 = Compare up count interrupt Enabled. - * |[3] |CMPDIEN |PWM Compare Down Count Interrupt Enable Bit - * | | |0 = Compare down count interrupt Disabled. - * | | |1 = Compare down count interrupt Enabled. - * @var TIMER_T::PWMINTEN1 - * Offset: 0x84 Timer PWM Interrupt Enable Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIEN |PWM Edge-detect Brake Interrupt Enable Bit - * | | |0 = PWM edge-detect brake interrupt Disabled. - * | | |1 = PWM edge-detect brake interrupt Enabled. - * |[8] |BRKLIEN |PWM Level-detect Brake Interrupt Enable Bit - * | | |0 = PWM level-detect brake interrupt Disabled. - * | | |1 = PWM level-detect brake interrupt Enabled. - * @var TIMER_T::PWMINTSTS0 - * Offset: 0x88 Timer PWM Interrupt Status Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZIF |PWM Zero Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches 0. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |PIF |PWM Period Point Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter reaches PERIOD. - * | | |Note 1: In up-down count type, PIF flag means the center point flag of current PWM period. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[2] |CMPUIF |PWM Compare Up Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in up count direction and reaches CMP. - * | | |Note 1: If CMP equal to PERIOD, there is no CMPUIF flag in up count type and up-down count type. - * | | |Note 2: This bit is cleared by writing 1 to it. - * |[3] |CMPDIF |PWM Compare Down Count Interrupt Flag - * | | |This bit is set by hardware when TIMERx_PWM counter in down count direction and reaches CMP. - * | | |Note 1: If CMP equal to PERIOD, there is no CMPDIF flag in down count type. - * | | |Note 2: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMINTSTS1 - * Offset: 0x8C Timer PWM Interrupt Status Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BRKEIF0 |Edge-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 edge-detect brake event do not happened. - * | | |1 = PWMx_CH0 edge-detect brake event happened. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[1] |BRKEIF1 |Edge-detect Brake Interrupt Flag PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 edge-detect brake event do not happened. - * | | |1 = PWMx_CH1 edge-detect brake event happened. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[8] |BRKLIF0 |Level-detect Brake Interrupt Flag on PWMx_CH0 (Write Protect) - * | | |0 = PWMx_CH0 level-detect brake event do not happened. - * | | |1 = PWMx_CH0 level-detect brake event happened. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[9] |BRKLIF1 |Level-detect Brake Interrupt Flag on PWMx_CH1 (Write Protect) - * | | |0 = PWMx_CH1 level-detect brake event do not happened. - * | | |1 = PWMx_CH1 level-detect brake event happened. - * | | |Note 1: This bit is cleared by writing 1 to it. - * | | |Note 2: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * |[16] |BRKESTS0 |Edge -detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 edge-detect brake state is released. - * | | |1 = PWMx_CH0 at edge-detect brake state. - * | | |Note: User can set BRKEIF0 1 to clear BRKEIF0 flag and PWMx_CH0 will release brake state when current PWM period finished and resume PWMx_CH0 output waveform start from next full PWM period. - * |[17] |BRKESTS1 |Edge-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 edge-detect brake state is released. - * | | |1 = PWMx_CH1 at edge-detect brake state. - * | | |Note: User can set BRKEIF1 1 to clear BRKEIF1 flag and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH1 output waveform start from next full PWM period. - * |[24] |BRKLSTS0 |Level-detect Brake Status of PWMx_CH0 (Read Only) - * | | |0 = PWMx_CH0 level-detect brake state is released. - * | | |1 = PWMx_CH0 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * |[25] |BRKLSTS1 |Level-detect Brake Status of PWMx_CH1 (Read Only) - * | | |0 = PWMx_CH1 level-detect brake state is released. - * | | |1 = PWMx_CH1 at level-detect brake state. - * | | |Note: If TIMERx_PWM level-detect brake source has released, both PWMx_CH0 and PWMx_CH1 will release brake state when current PWM period finished and resume PWMx_CH0 and PWMx_CH1 output waveform start from next full PWM period. - * @var TIMER_T::PWMEADCTS - * Offset: 0x90 Timer PWM EADC Trigger Source Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TRGSEL |PWM Counter Event Source Select to Trigger EADC Conversion - * | | |000 = Trigger EADC conversion at zero point (ZIF). - * | | |001 = Trigger EADC conversion at period point (PIF). - * | | |010 = Trigger EADC conversion at zero or period point (ZIF or PIF). - * | | |011 = Trigger EADC conversion at compare up count point (CMPUIF). - * | | |100 = Trigger EADC conversion at compare down count point (CMPDIF). - * | | |Others = Reserved. - * |[7] |TRGEN |PWM Counter Event Trigger EADC Conversion Enable Bit - * | | |0 = PWM counter event trigger EADC conversion Disabled. - * | | |1 = PWM counter event trigger EADC conversion Enabled. - * @var TIMER_T::PWMSCTL - * Offset: 0x94 Timer PWM Synchronous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |SYNCMODE |PWM Synchronous Mode Enable Select - * | | |00 = PWM synchronous function Disabled. - * | | |01 = PWM synchronous counter start function Enabled. - * | | |10 = Reserved. - * | | |11 = PWM synchronous counter clear function Enabled. - * |[10:8] |SYNCSRC |PWM Synchronous Counter Start/Clear Source Select - * | | |000 = Counter synchronous start/clear by trigger TIMER0_PWMSTRG STRGEN. - * | | |001 = Counter synchronous start/clear by trigger TIMER2_PWMSTRG STRGEN. - * | | |010 = Counter synchronous start/clear by trigger TIMER4_PWMSTRG STRGEN. - * | | |011 = Counter synchronous start/clear by trigger TIMER6_PWMSTRG STRGEN. - * | | |100 = Counter synchronous start/clear by trigger TIMER8_PWMSTRG STRGEN. - * | | |101 = Counter synchronous start/clear by trigger TIMER10_PWMSTRG STRGEN. - * | | |Note 1: If TIMER0/1/2/3 PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8], TIMER1_PWMSCTL[8], TIMER2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be 0. - * | | |Note 2: If TIMER0/1/ PWM counter synchronous source are from TIMER0, TIMER0_PWMSCTL[8] and TIMER1_PWMSCTL[8] should be set 0, and TIMER2/3/ PWM counter synchronous source are from TIMER2, TIME2_PWMSCTL[8] and TIMER3_PWMSCTL[8] should be set 1. - * @var TIMER_T::PWMSTRG - * Offset: 0x98 Timer PWM Synchronous Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |STRGEN |PWM Counter Synchronous Trigger Enable Bit (Write Only) - * | | |PMW counter synchronous function is used to make selected PWM channels (include TIMER0/1/2/3 PWM, TIMER0/1 PWM and TIMER2/3 PWM) start counting or clear counter at the same time according to TIMERx_PWMSCTL setting. - * | | |Note: This bit is only available in TIMER0 and TIMER2. - * @var TIMER_T::PWMSTATUS - * Offset: 0x9C Timer PWM Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CNTMAXF |PWM Counter Equal to 0xFFFF Flag - * | | |0 = The PWM counter value never reached its maximum value 0xFFFF. - * | | |1 = The PWM counter value has reached its maximum value. - * | | |Note: This bit is cleared by writing 1 to it. - * |[16] |EADCTRGF |Trigger EADC Start Conversion Flag - * | | |0 = PWM counter event trigger EADC start conversion is not occurred. - * | | |1 = PWM counter event trigger EADC start conversion has occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var TIMER_T::PWMPBUF - * Offset: 0xA0 Timer PWM Period Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PBUF |PWM Period Buffer Register (Read Only) - * | | |Used as PERIOD active register. - * @var TIMER_T::PWMCMPBUF - * Offset: 0xA4 Timer PWM Comparator Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CMPBUF |PWM Comparator Buffer Register (Read Only) - * | | |Used as CMP active register. - */ - __IO uint32_t CTL; /*!< [0x0000] Timer Control Register */ - __IO uint32_t CMP; /*!< [0x0004] Timer Comparator Register */ - __IO uint32_t INTSTS; /*!< [0x0008] Timer Interrupt Status Register */ - __IO uint32_t CNT; /*!< [0x000c] Timer Data Register */ - __I uint32_t CAP; /*!< [0x0010] Timer Capture Data Register */ - __IO uint32_t EXTCTL; /*!< [0x0014] Timer External Control Register */ - __IO uint32_t EINTSTS; /*!< [0x0018] Timer External Interrupt Status Register */ - __IO uint32_t TRGCTL; /*!< [0x001c] Timer Trigger Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0020] Timer Alternative Control Register */ - __I uint32_t RESERVE0[7]; - __IO uint32_t PWMCTL; /*!< [0x0040] Timer PWM Control Register */ - __IO uint32_t PWMCLKSRC; /*!< [0x0044] Timer PWM Counter Clock Source Register */ - __IO uint32_t PWMCLKPSC; /*!< [0x0048] Timer PWM Counter Clock Pre-scale Register */ - __IO uint32_t PWMCNTCLR; /*!< [0x004c] Timer PWM Clear Counter Register */ - __IO uint32_t PWMPERIOD; /*!< [0x0050] Timer PWM Period Register */ - __IO uint32_t PWMCMPDAT; /*!< [0x0054] Timer PWM Comparator Register */ - __IO uint32_t PWMDTCTL; /*!< [0x0058] Timer PWM Dead-time Control Register */ - __I uint32_t PWMCNT; /*!< [0x005c] Timer PWM Counter Register */ - __IO uint32_t PWMMSKEN; /*!< [0x0060] Timer PWM Output Mask Enable Register */ - __IO uint32_t PWMMSK; /*!< [0x0064] Timer PWM Output Mask Data Control Register */ - __IO uint32_t PWMBNF; /*!< [0x0068] Timer PWM Brake Pin Noise Filter Register */ - __IO uint32_t PWMFAILBRK; /*!< [0x006c] Timer PWM System Fail Brake Control Register */ - __IO uint32_t PWMBRKCTL; /*!< [0x0070] Timer PWM Brake Control Register */ - __IO uint32_t PWMPOLCTL; /*!< [0x0074] Timer PWM Pin Output Polar Control Register */ - __IO uint32_t PWMPOEN; /*!< [0x0078] Timer PWM Pin Output Enable Register */ - __O uint32_t PWMSWBRK; /*!< [0x007c] Timer PWM Software Trigger Brake Control Register */ - __IO uint32_t PWMINTEN0; /*!< [0x0080] Timer PWM Interrupt Enable Register 0 */ - __IO uint32_t PWMINTEN1; /*!< [0x0084] Timer PWM Interrupt Enable Register 1 */ - __IO uint32_t PWMINTSTS0; /*!< [0x0088] Timer PWM Interrupt Status Register 0 */ - __IO uint32_t PWMINTSTS1; /*!< [0x008c] Timer PWM Interrupt Status Register 1 */ - __IO uint32_t PWMEADCTS; /*!< [0x0090] Timer PWM EADC Trigger Source Select Register */ - __IO uint32_t PWMSCTL; /*!< [0x0094] Timer PWM Synchronous Control Register */ - __O uint32_t PWMSTRG; /*!< [0x0098] Timer PWM Synchronous Trigger Register */ - __IO uint32_t PWMSTATUS; /*!< [0x009c] Timer PWM Status Register */ - __I uint32_t PWMPBUF; /*!< [0x00a0] Timer PWM Period Buffer Register */ - __I uint32_t PWMCMPBUF; /*!< [0x00a4] Timer PWM Comparator Buffer Register */ - -} TIMER_T; - -/** - @addtogroup TIMER_CONST TIMER Bit Field Definition - Constant Definitions for TIMER Controller -@{ */ - -#define TIMER_CTL_PSC_Pos (0) /*!< TIMER_T::CTL: PSC Position */ -#define TIMER_CTL_PSC_Msk (0xfful << TIMER_CTL_PSC_Pos) /*!< TIMER_T::CTL: PSC Mask */ - -#define TIMER_CTL_INTRGEN_Pos (19) /*!< TIMER_T::CTL: INTRGEN Position */ -#define TIMER_CTL_INTRGEN_Msk (0x1ul << TIMER_CTL_INTRGEN_Pos) /*!< TIMER_T::CTL: INTRGEN Mask */ - -#define TIMER_CTL_PERIOSEL_Pos (20) /*!< TIMER_T::CTL: PERIOSEL Position */ -#define TIMER_CTL_PERIOSEL_Msk (0x1ul << TIMER_CTL_PERIOSEL_Pos) /*!< TIMER_T::CTL: PERIOSEL Mask */ - -#define TIMER_CTL_TGLPINSEL_Pos (21) /*!< TIMER_T::CTL: TGLPINSEL Position */ -#define TIMER_CTL_TGLPINSEL_Msk (0x1ul << TIMER_CTL_TGLPINSEL_Pos) /*!< TIMER_T::CTL: TGLPINSEL Mask */ - -#define TIMER_CTL_CAPSRC_Pos (22) /*!< TIMER_T::CTL: CAPSRC Position */ -#define TIMER_CTL_CAPSRC_Msk (0x1ul << TIMER_CTL_CAPSRC_Pos) /*!< TIMER_T::CTL: CAPSRC Mask */ - -#define TIMER_CTL_WKEN_Pos (23) /*!< TIMER_T::CTL: WKEN Position */ -#define TIMER_CTL_WKEN_Msk (0x1ul << TIMER_CTL_WKEN_Pos) /*!< TIMER_T::CTL: WKEN Mask */ - -#define TIMER_CTL_EXTCNTEN_Pos (24) /*!< TIMER_T::CTL: EXTCNTEN Position */ -#define TIMER_CTL_EXTCNTEN_Msk (0x1ul << TIMER_CTL_EXTCNTEN_Pos) /*!< TIMER_T::CTL: EXTCNTEN Mask */ - -#define TIMER_CTL_ACTSTS_Pos (25) /*!< TIMER_T::CTL: ACTSTS Position */ -#define TIMER_CTL_ACTSTS_Msk (0x1ul << TIMER_CTL_ACTSTS_Pos) /*!< TIMER_T::CTL: ACTSTS Mask */ - -#define TIMER_CTL_OPMODE_Pos (27) /*!< TIMER_T::CTL: OPMODE Position */ -#define TIMER_CTL_OPMODE_Msk (0x3ul << TIMER_CTL_OPMODE_Pos) /*!< TIMER_T::CTL: OPMODE Mask */ - -#define TIMER_CTL_INTEN_Pos (29) /*!< TIMER_T::CTL: INTEN Position */ -#define TIMER_CTL_INTEN_Msk (0x1ul << TIMER_CTL_INTEN_Pos) /*!< TIMER_T::CTL: INTEN Mask */ - -#define TIMER_CTL_CNTEN_Pos (30) /*!< TIMER_T::CTL: CNTEN Position */ -#define TIMER_CTL_CNTEN_Msk (0x1ul << TIMER_CTL_CNTEN_Pos) /*!< TIMER_T::CTL: CNTEN Mask */ - -#define TIMER_CTL_ICEDEBUG_Pos (31) /*!< TIMER_T::CTL: ICEDEBUG Position */ -#define TIMER_CTL_ICEDEBUG_Msk (0x1ul << TIMER_CTL_ICEDEBUG_Pos) /*!< TIMER_T::CTL: ICEDEBUG Mask */ - -#define TIMER_CMP_CMPDAT_Pos (0) /*!< TIMER_T::CMP: CMPDAT Position */ -#define TIMER_CMP_CMPDAT_Msk (0xfffffful << TIMER_CMP_CMPDAT_Pos) /*!< TIMER_T::CMP: CMPDAT Mask */ - -#define TIMER_INTSTS_TIF_Pos (0) /*!< TIMER_T::INTSTS: TIF Position */ -#define TIMER_INTSTS_TIF_Msk (0x1ul << TIMER_INTSTS_TIF_Pos) /*!< TIMER_T::INTSTS: TIF Mask */ - -#define TIMER_INTSTS_TWKF_Pos (1) /*!< TIMER_T::INTSTS: TWKF Position */ -#define TIMER_INTSTS_TWKF_Msk (0x1ul << TIMER_INTSTS_TWKF_Pos) /*!< TIMER_T::INTSTS: TWKF Mask */ - -#define TIMER_CNT_CNT_Pos (0) /*!< TIMER_T::CNT: CNT Position */ -#define TIMER_CNT_CNT_Msk (0xfffffful << TIMER_CNT_CNT_Pos) /*!< TIMER_T::CNT: CNT Mask */ - -#define TIMER_CNT_RSTACT_Pos (31) /*!< TIMER_T::CNT: RSTACT Position */ -#define TIMER_CNT_RSTACT_Msk (0x1ul << TIMER_CNT_RSTACT_Pos) /*!< TIMER_T::CNT: RSTACT Mask */ - -#define TIMER_CAP_CAPDAT_Pos (0) /*!< TIMER_T::CAP: CAPDAT Position */ -#define TIMER_CAP_CAPDAT_Msk (0xfffffful << TIMER_CAP_CAPDAT_Pos) /*!< TIMER_T::CAP: CAPDAT Mask */ - -#define TIMER_EXTCTL_CNTPHASE_Pos (0) /*!< TIMER_T::EXTCTL: CNTPHASE Position */ -#define TIMER_EXTCTL_CNTPHASE_Msk (0x1ul << TIMER_EXTCTL_CNTPHASE_Pos) /*!< TIMER_T::EXTCTL: CNTPHASE Mask */ - -#define TIMER_EXTCTL_CAPEN_Pos (3) /*!< TIMER_T::EXTCTL: CAPEN Position */ -#define TIMER_EXTCTL_CAPEN_Msk (0x1ul << TIMER_EXTCTL_CAPEN_Pos) /*!< TIMER_T::EXTCTL: CAPEN Mask */ - -#define TIMER_EXTCTL_CAPFUNCS_Pos (4) /*!< TIMER_T::EXTCTL: CAPFUNCS Position */ -#define TIMER_EXTCTL_CAPFUNCS_Msk (0x1ul << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< TIMER_T::EXTCTL: CAPFUNCS Mask */ - -#define TIMER_EXTCTL_CAPIEN_Pos (5) /*!< TIMER_T::EXTCTL: CAPIEN Position */ -#define TIMER_EXTCTL_CAPIEN_Msk (0x1ul << TIMER_EXTCTL_CAPIEN_Pos) /*!< TIMER_T::EXTCTL: CAPIEN Mask */ - -#define TIMER_EXTCTL_CAPDBEN_Pos (6) /*!< TIMER_T::EXTCTL: CAPDBEN Position */ -#define TIMER_EXTCTL_CAPDBEN_Msk (0x1ul << TIMER_EXTCTL_CAPDBEN_Pos) /*!< TIMER_T::EXTCTL: CAPDBEN Mask */ - -#define TIMER_EXTCTL_CNTDBEN_Pos (7) /*!< TIMER_T::EXTCTL: CNTDBEN Position */ -#define TIMER_EXTCTL_CNTDBEN_Msk (0x1ul << TIMER_EXTCTL_CNTDBEN_Pos) /*!< TIMER_T::EXTCTL: CNTDBEN Mask */ - -#define TIMER_EXTCTL_ICAPSSEL_Pos (8) /*!< TIMER_T::EXTCTL: ICAPSSEL Position */ -#define TIMER_EXTCTL_ICAPSSEL_Msk (0x7ul << TIMER_EXTCTL_ICAPSSEL_Pos) /*!< TIMER_T::EXTCTL: ICAPSSEL Mask */ - -#define TIMER_EXTCTL_CAPEDGE_Pos (12) /*!< TIMER_T::EXTCTL: CAPEDGE Position */ -#define TIMER_EXTCTL_CAPEDGE_Msk (0x7ul << TIMER_EXTCTL_CAPEDGE_Pos) /*!< TIMER_T::EXTCTL: CAPEDGE Mask */ - -#define TIMER_EXTCTL_ECNTSSEL_Pos (16) /*!< TIMER_T::EXTCTL: ECNTSSEL Position */ -#define TIMER_EXTCTL_ECNTSSEL_Msk (0x1ul << TIMER_EXTCTL_ECNTSSEL_Pos) /*!< TIMER_T::EXTCTL: ECNTSSEL Mask */ - -#define TIMER_EXTCTL_CAPSDIV_Pos (28) /*!< TIMER_T::EXTCTL: CAPSDIV Position */ -#define TIMER_EXTCTL_CAPSDIV_Msk (0xful << TIMER_EXTCTL_CAPSDIV_Pos) /*!< TIMER_T::EXTCTL: CAPSDIV Mask */ - -#define TIMER_EINTSTS_CAPIF_Pos (0) /*!< TIMER_T::EINTSTS: CAPIF Position */ -#define TIMER_EINTSTS_CAPIF_Msk (0x1ul << TIMER_EINTSTS_CAPIF_Pos) /*!< TIMER_T::EINTSTS: CAPIF Mask */ - -#define TIMER_TRGCTL_TRGSSEL_Pos (0) /*!< TIMER_T::TRGCTL: TRGSSEL Position */ -#define TIMER_TRGCTL_TRGSSEL_Msk (0x1ul << TIMER_TRGCTL_TRGSSEL_Pos) /*!< TIMER_T::TRGCTL: TRGSSEL Mask */ - -#define TIMER_TRGCTL_TRGPWM_Pos (1) /*!< TIMER_T::TRGCTL: TRGPWM Position */ -#define TIMER_TRGCTL_TRGPWM_Msk (0x1ul << TIMER_TRGCTL_TRGPWM_Pos) /*!< TIMER_T::TRGCTL: TRGPWM Mask */ - -#define TIMER_TRGCTL_TRGEADC_Pos (2) /*!< TIMER_T::TRGCTL: TRGEADC Position */ -#define TIMER_TRGCTL_TRGEADC_Msk (0x1ul << TIMER_TRGCTL_TRGEADC_Pos) /*!< TIMER_T::TRGCTL: TRGEADC Mask */ - -#define TIMER_TRGCTL_TRGPDMA_Pos (4) /*!< TIMER_T::TRGCTL: TRGPDMA Position */ -#define TIMER_TRGCTL_TRGPDMA_Msk (0x1ul << TIMER_TRGCTL_TRGPDMA_Pos) /*!< TIMER_T::TRGCTL: TRGPDMA Mask */ - -#define TIMER_ALTCTL_FUNCSEL_Pos (0) /*!< TIMER_T::ALTCTL: FUNCSEL Position */ -#define TIMER_ALTCTL_FUNCSEL_Msk (0x1ul << TIMER_ALTCTL_FUNCSEL_Pos) /*!< TIMER_T::ALTCTL: FUNCSEL Mask */ - -#define TIMER_PWMCTL_CNTEN_Pos (0) /*!< TIMER_T::PWMCTL: CNTEN Position */ -#define TIMER_PWMCTL_CNTEN_Msk (0x1ul << TIMER_PWMCTL_CNTEN_Pos) /*!< TIMER_T::PWMCTL: CNTEN Mask */ - -#define TIMER_PWMCTL_CNTTYPE_Pos (1) /*!< TIMER_T::PWMCTL: CNTTYPE Position */ -#define TIMER_PWMCTL_CNTTYPE_Msk (0x3ul << TIMER_PWMCTL_CNTTYPE_Pos) /*!< TIMER_T::PWMCTL: CNTTYPE Mask */ - -#define TIMER_PWMCTL_CNTMODE_Pos (3) /*!< TIMER_T::PWMCTL: CNTMODE Position */ -#define TIMER_PWMCTL_CNTMODE_Msk (0x1ul << TIMER_PWMCTL_CNTMODE_Pos) /*!< TIMER_T::PWMCTL: CNTMODE Mask */ - -#define TIMER_PWMCTL_CTRLD_Pos (8) /*!< TIMER_T::PWMCTL: CTRLD Position */ -#define TIMER_PWMCTL_CTRLD_Msk (0x1ul << TIMER_PWMCTL_CTRLD_Pos) /*!< TIMER_T::PWMCTL: CTRLD Mask */ - -#define TIMER_PWMCTL_IMMLDEN_Pos (9) /*!< TIMER_T::PWMCTL: IMMLDEN Position */ -#define TIMER_PWMCTL_IMMLDEN_Msk (0x1ul << TIMER_PWMCTL_IMMLDEN_Pos) /*!< TIMER_T::PWMCTL: IMMLDEN Mask */ - -#define TIMER_PWMCTL_OUTMODE_Pos (16) /*!< TIMER_T::PWMCTL: OUTMODE Position */ -#define TIMER_PWMCTL_OUTMODE_Msk (0x1ul << TIMER_PWMCTL_OUTMODE_Pos) /*!< TIMER_T::PWMCTL: OUTMODE Mask */ - -#define TIMER_PWMCTL_DBGHALT_Pos (30) /*!< TIMER_T::PWMCTL: DBGHALT Position */ -#define TIMER_PWMCTL_DBGHALT_Msk (0x1ul << TIMER_PWMCTL_DBGHALT_Pos) /*!< TIMER_T::PWMCTL: DBGHALT Mask */ - -#define TIMER_PWMCTL_DBGTRIOFF_Pos (31) /*!< TIMER_T::PWMCTL: DBGTRIOFF Position */ -#define TIMER_PWMCTL_DBGTRIOFF_Msk (0x1ul << TIMER_PWMCTL_DBGTRIOFF_Pos) /*!< TIMER_T::PWMCTL: DBGTRIOFF Mask */ - -#define TIMER_PWMCLKSRC_CLKSRC_Pos (0) /*!< TIMER_T::PWMCLKSRC: CLKSRC Position */ -#define TIMER_PWMCLKSRC_CLKSRC_Msk (0xful << TIMER_PWMCLKSRC_CLKSRC_Pos) /*!< TIMER_T::PWMCLKSRC: CLKSRC Mask */ - -#define TIMER_PWMCLKPSC_CLKPSC_Pos (0) /*!< TIMER_T::PWMCLKPSC: CLKPSC Position */ -#define TIMER_PWMCLKPSC_CLKPSC_Msk (0xffful << TIMER_PWMCLKPSC_CLKPSC_Pos) /*!< TIMER_T::PWMCLKPSC: CLKPSC Mask */ - -#define TIMER_PWMCNTCLR_CNTCLR_Pos (0) /*!< TIMER_T::PWMCNTCLR: CNTCLR Position */ -#define TIMER_PWMCNTCLR_CNTCLR_Msk (0x1ul << TIMER_PWMCNTCLR_CNTCLR_Pos) /*!< TIMER_T::PWMCNTCLR: CNTCLR Mask */ - -#define TIMER_PWMPERIOD_PERIOD_Pos (0) /*!< TIMER_T::PWMPERIOD: PERIOD Position */ -#define TIMER_PWMPERIOD_PERIOD_Msk (0xfffful << TIMER_PWMPERIOD_PERIOD_Pos) /*!< TIMER_T::PWMPERIOD: PERIOD Mask */ - -#define TIMER_PWMCMPDAT_CMP_Pos (0) /*!< TIMER_T::PWMCMPDAT: CMP Position */ -#define TIMER_PWMCMPDAT_CMP_Msk (0xfffful << TIMER_PWMCMPDAT_CMP_Pos) /*!< TIMER_T::PWMCMPDAT: CMP Mask */ - -#define TIMER_PWMDTCTL_DTCNT_Pos (0) /*!< TIMER_T::PWMDTCTL: DTCNT Position */ -#define TIMER_PWMDTCTL_DTCNT_Msk (0xffful << TIMER_PWMDTCTL_DTCNT_Pos) /*!< TIMER_T::PWMDTCTL: DTCNT Mask */ - -#define TIMER_PWMDTCTL_DTEN_Pos (16) /*!< TIMER_T::PWMDTCTL: DTEN Position */ -#define TIMER_PWMDTCTL_DTEN_Msk (0x1ul << TIMER_PWMDTCTL_DTEN_Pos) /*!< TIMER_T::PWMDTCTL: DTEN Mask */ - -#define TIMER_PWMDTCTL_DTCKSEL_Pos (24) /*!< TIMER_T::PWMDTCTL: DTCKSEL Position */ -#define TIMER_PWMDTCTL_DTCKSEL_Msk (0x1ul << TIMER_PWMDTCTL_DTCKSEL_Pos) /*!< TIMER_T::PWMDTCTL: DTCKSEL Mask */ - -#define TIMER_PWMCNT_CNT_Pos (0) /*!< TIMER_T::PWMCNT: CNT Position */ -#define TIMER_PWMCNT_CNT_Msk (0xfffful << TIMER_PWMCNT_CNT_Pos) /*!< TIMER_T::PWMCNT: CNT Mask */ - -#define TIMER_PWMCNT_DIRF_Pos (16) /*!< TIMER_T::PWMCNT: DIRF Position */ -#define TIMER_PWMCNT_DIRF_Msk (0x1ul << TIMER_PWMCNT_DIRF_Pos) /*!< TIMER_T::PWMCNT: DIRF Mask */ - -#define TIMER_PWMMSKEN_MSKEN0_Pos (0) /*!< TIMER_T::PWMMSKEN: MSKEN0 Position */ -#define TIMER_PWMMSKEN_MSKEN0_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN0_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN0 Mask */ - -#define TIMER_PWMMSKEN_MSKEN1_Pos (1) /*!< TIMER_T::PWMMSKEN: MSKEN1 Position */ -#define TIMER_PWMMSKEN_MSKEN1_Msk (0x1ul << TIMER_PWMMSKEN_MSKEN1_Pos) /*!< TIMER_T::PWMMSKEN: MSKEN1 Mask */ - -#define TIMER_PWMMSK_MSKDAT0_Pos (0) /*!< TIMER_T::PWMMSK: MSKDAT0 Position */ -#define TIMER_PWMMSK_MSKDAT0_Msk (0x1ul << TIMER_PWMMSK_MSKDAT0_Pos) /*!< TIMER_T::PWMMSK: MSKDAT0 Mask */ - -#define TIMER_PWMMSK_MSKDAT1_Pos (1) /*!< TIMER_T::PWMMSK: MSKDAT1 Position */ -#define TIMER_PWMMSK_MSKDAT1_Msk (0x1ul << TIMER_PWMMSK_MSKDAT1_Pos) /*!< TIMER_T::PWMMSK: MSKDAT1 Mask */ - -#define TIMER_PWMBNF_BRKNFEN_Pos (0) /*!< TIMER_T::PWMBNF: BRKNFEN Position */ -#define TIMER_PWMBNF_BRKNFEN_Msk (0x1ul << TIMER_PWMBNF_BRKNFEN_Pos) /*!< TIMER_T::PWMBNF: BRKNFEN Mask */ - -#define TIMER_PWMBNF_BRKNFSEL_Pos (1) /*!< TIMER_T::PWMBNF: BRKNFSEL Position */ -#define TIMER_PWMBNF_BRKNFSEL_Msk (0x7ul << TIMER_PWMBNF_BRKNFSEL_Pos) /*!< TIMER_T::PWMBNF: BRKNFSEL Mask */ - -#define TIMER_PWMBNF_BRKFCNT_Pos (4) /*!< TIMER_T::PWMBNF: BRKFCNT Position */ -#define TIMER_PWMBNF_BRKFCNT_Msk (0x7ul << TIMER_PWMBNF_BRKFCNT_Pos) /*!< TIMER_T::PWMBNF: BRKFCNT Mask */ - -#define TIMER_PWMBNF_BRKPINV_Pos (7) /*!< TIMER_T::PWMBNF: BRKPINV Position */ -#define TIMER_PWMBNF_BRKPINV_Msk (0x1ul << TIMER_PWMBNF_BRKPINV_Pos) /*!< TIMER_T::PWMBNF: BRKPINV Mask */ - -#define TIMER_PWMBNF_BKPINSRC_Pos (16) /*!< TIMER_T::PWMBNF: BKPINSRC Position */ -#define TIMER_PWMBNF_BKPINSRC_Msk (0x7ul << TIMER_PWMBNF_BKPINSRC_Pos) /*!< TIMER_T::PWMBNF: BKPINSRC Mask */ - -#define TIMER_PWMFAILBRK_CSSBRKEN_Pos (0) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Position */ -#define TIMER_PWMFAILBRK_CSSBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CSSBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CSSBRKEN Mask */ - -#define TIMER_PWMFAILBRK_LVDBRKEN_Pos (1) /*!< TIMER_T::PWMFAILBRK: LVDBRKEN Position */ -#define TIMER_PWMFAILBRK_LVDBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_LVDBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: LVDBRKEN Mask */ - -#define TIMER_PWMFAILBRK_CORBRKEN_Pos (3) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Position */ -#define TIMER_PWMFAILBRK_CORBRKEN_Msk (0x1ul << TIMER_PWMFAILBRK_CORBRKEN_Pos) /*!< TIMER_T::PWMFAILBRK: CORBRKEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPEEN_Pos (4) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Position */ -#define TIMER_PWMBRKCTL_BRKPEEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPEEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPEEN Mask */ - -#define TIMER_PWMBRKCTL_SYSEBEN_Pos (7) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Position */ -#define TIMER_PWMBRKCTL_SYSEBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSEBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSEBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKPLEN_Pos (12) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Position */ -#define TIMER_PWMBRKCTL_BRKPLEN_Msk (0x1ul << TIMER_PWMBRKCTL_BRKPLEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKPLEN Mask */ - -#define TIMER_PWMBRKCTL_SYSLBEN_Pos (15) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Position */ -#define TIMER_PWMBRKCTL_SYSLBEN_Msk (0x1ul << TIMER_PWMBRKCTL_SYSLBEN_Pos) /*!< TIMER_T::PWMBRKCTL: SYSLBEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAEVEN_Pos (16) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Position */ -#define TIMER_PWMBRKCTL_BRKAEVEN_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAEVEN_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAEVEN Mask */ - -#define TIMER_PWMBRKCTL_BRKAODD_Pos (18) /*!< TIMER_T::PWMBRKCTL: BRKAODD Position */ -#define TIMER_PWMBRKCTL_BRKAODD_Msk (0x3ul << TIMER_PWMBRKCTL_BRKAODD_Pos) /*!< TIMER_T::PWMBRKCTL: BRKAODD Mask */ - -#define TIMER_PWMPOLCTL_PINV0_Pos (0) /*!< TIMER_T::PWMPOLCTL: PINV0 Position */ -#define TIMER_PWMPOLCTL_PINV0_Msk (0x1ul << TIMER_PWMPOLCTL_PINV0_Pos) /*!< TIMER_T::PWMPOLCTL: PINV0 Mask */ - -#define TIMER_PWMPOLCTL_PINV1_Pos (1) /*!< TIMER_T::PWMPOLCTL: PINV1 Position */ -#define TIMER_PWMPOLCTL_PINV1_Msk (0x1ul << TIMER_PWMPOLCTL_PINV1_Pos) /*!< TIMER_T::PWMPOLCTL: PINV1 Mask */ - -#define TIMER_PWMPOEN_POEN0_Pos (0) /*!< TIMER_T::PWMPOEN: POEN0 Position */ -#define TIMER_PWMPOEN_POEN0_Msk (0x1ul << TIMER_PWMPOEN_POEN0_Pos) /*!< TIMER_T::PWMPOEN: POEN0 Mask */ - -#define TIMER_PWMPOEN_POEN1_Pos (1) /*!< TIMER_T::PWMPOEN: POEN1 Position */ -#define TIMER_PWMPOEN_POEN1_Msk (0x1ul << TIMER_PWMPOEN_POEN1_Pos) /*!< TIMER_T::PWMPOEN: POEN1 Mask */ - -#define TIMER_PWMSWBRK_BRKETRG_Pos (0) /*!< TIMER_T::PWMSWBRK: BRKETRG Position */ -#define TIMER_PWMSWBRK_BRKETRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKETRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKETRG Mask */ - -#define TIMER_PWMSWBRK_BRKLTRG_Pos (8) /*!< TIMER_T::PWMSWBRK: BRKLTRG Position */ -#define TIMER_PWMSWBRK_BRKLTRG_Msk (0x1ul << TIMER_PWMSWBRK_BRKLTRG_Pos) /*!< TIMER_T::PWMSWBRK: BRKLTRG Mask */ - -#define TIMER_PWMINTEN0_ZIEN_Pos (0) /*!< TIMER_T::PWMINTEN0: ZIEN Position */ -#define TIMER_PWMINTEN0_ZIEN_Msk (0x1ul << TIMER_PWMINTEN0_ZIEN_Pos) /*!< TIMER_T::PWMINTEN0: ZIEN Mask */ - -#define TIMER_PWMINTEN0_PIEN_Pos (1) /*!< TIMER_T::PWMINTEN0: PIEN Position */ -#define TIMER_PWMINTEN0_PIEN_Msk (0x1ul << TIMER_PWMINTEN0_PIEN_Pos) /*!< TIMER_T::PWMINTEN0: PIEN Mask */ - -#define TIMER_PWMINTEN0_CMPUIEN_Pos (2) /*!< TIMER_T::PWMINTEN0: CMPUIEN Position */ -#define TIMER_PWMINTEN0_CMPUIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPUIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPUIEN Mask */ - -#define TIMER_PWMINTEN0_CMPDIEN_Pos (3) /*!< TIMER_T::PWMINTEN0: CMPDIEN Position */ -#define TIMER_PWMINTEN0_CMPDIEN_Msk (0x1ul << TIMER_PWMINTEN0_CMPDIEN_Pos) /*!< TIMER_T::PWMINTEN0: CMPDIEN Mask */ - -#define TIMER_PWMINTEN1_BRKEIEN_Pos (0) /*!< TIMER_T::PWMINTEN1: BRKEIEN Position */ -#define TIMER_PWMINTEN1_BRKEIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKEIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKEIEN Mask */ - -#define TIMER_PWMINTEN1_BRKLIEN_Pos (8) /*!< TIMER_T::PWMINTEN1: BRKLIEN Position */ -#define TIMER_PWMINTEN1_BRKLIEN_Msk (0x1ul << TIMER_PWMINTEN1_BRKLIEN_Pos) /*!< TIMER_T::PWMINTEN1: BRKLIEN Mask */ - -#define TIMER_PWMINTSTS0_ZIF_Pos (0) /*!< TIMER_T::PWMINTSTS0: ZIF Position */ -#define TIMER_PWMINTSTS0_ZIF_Msk (0x1ul << TIMER_PWMINTSTS0_ZIF_Pos) /*!< TIMER_T::PWMINTSTS0: ZIF Mask */ - -#define TIMER_PWMINTSTS0_PIF_Pos (1) /*!< TIMER_T::PWMINTSTS0: PIF Position */ -#define TIMER_PWMINTSTS0_PIF_Msk (0x1ul << TIMER_PWMINTSTS0_PIF_Pos) /*!< TIMER_T::PWMINTSTS0: PIF Mask */ - -#define TIMER_PWMINTSTS0_CMPUIF_Pos (2) /*!< TIMER_T::PWMINTSTS0: CMPUIF Position */ -#define TIMER_PWMINTSTS0_CMPUIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPUIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPUIF Mask */ - -#define TIMER_PWMINTSTS0_CMPDIF_Pos (3) /*!< TIMER_T::PWMINTSTS0: CMPDIF Position */ -#define TIMER_PWMINTSTS0_CMPDIF_Msk (0x1ul << TIMER_PWMINTSTS0_CMPDIF_Pos) /*!< TIMER_T::PWMINTSTS0: CMPDIF Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF0_Pos (0) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Position */ -#define TIMER_PWMINTSTS1_BRKEIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKEIF1_Pos (1) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Position */ -#define TIMER_PWMINTSTS1_BRKEIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKEIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKEIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF0_Pos (8) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Position */ -#define TIMER_PWMINTSTS1_BRKLIF0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLIF1_Pos (9) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Position */ -#define TIMER_PWMINTSTS1_BRKLIF1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLIF1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLIF1 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS0_Pos (16) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Position */ -#define TIMER_PWMINTSTS1_BRKESTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKESTS1_Pos (17) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Position */ -#define TIMER_PWMINTSTS1_BRKESTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKESTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKESTS1 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS0_Pos (24) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS0_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS0_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS0 Mask */ - -#define TIMER_PWMINTSTS1_BRKLSTS1_Pos (25) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Position */ -#define TIMER_PWMINTSTS1_BRKLSTS1_Msk (0x1ul << TIMER_PWMINTSTS1_BRKLSTS1_Pos) /*!< TIMER_T::PWMINTSTS1: BRKLSTS1 Mask */ - -#define TIMER_PWMEADCTS_TRGSEL_Pos (0) /*!< TIMER_T::PWMEADCTS: TRGSEL Position */ -#define TIMER_PWMEADCTS_TRGSEL_Msk (0x7ul << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< TIMER_T::PWMEADCTS: TRGSEL Mask */ - -#define TIMER_PWMEADCTS_TRGEN_Pos (7) /*!< TIMER_T::PWMEADCTS: TRGEN Position */ -#define TIMER_PWMEADCTS_TRGEN_Msk (0x1ul << TIMER_PWMEADCTS_TRGEN_Pos) /*!< TIMER_T::PWMEADCTS: TRGEN Mask */ - -#define TIMER_PWMSCTL_SYNCMODE_Pos (0) /*!< TIMER_T::PWMSCTL: SYNCMODE Position */ -#define TIMER_PWMSCTL_SYNCMODE_Msk (0x3ul << TIMER_PWMSCTL_SYNCMODE_Pos) /*!< TIMER_T::PWMSCTL: SYNCMODE Mask */ - -#define TIMER_PWMSCTL_SYNCSRC_Pos (8) /*!< TIMER_T::PWMSCTL: SYNCSRC Position */ -#define TIMER_PWMSCTL_SYNCSRC_Msk (0x7ul << TIMER_PWMSCTL_SYNCSRC_Pos) /*!< TIMER_T::PWMSCTL: SYNCSRC Mask */ - -#define TIMER_PWMSTRG_STRGEN_Pos (0) /*!< TIMER_T::PWMSTRG: STRGEN Position */ -#define TIMER_PWMSTRG_STRGEN_Msk (0x1ul << TIMER_PWMSTRG_STRGEN_Pos) /*!< TIMER_T::PWMSTRG: STRGEN Mask */ - -#define TIMER_PWMSTATUS_CNTMAXF_Pos (0) /*!< TIMER_T::PWMSTATUS: CNTMAXF Position */ -#define TIMER_PWMSTATUS_CNTMAXF_Msk (0x1ul << TIMER_PWMSTATUS_CNTMAXF_Pos) /*!< TIMER_T::PWMSTATUS: CNTMAXF Mask */ - -#define TIMER_PWMSTATUS_EADCTRGF_Pos (16) /*!< TIMER_T::PWMSTATUS: EADCTRGF Position */ -#define TIMER_PWMSTATUS_EADCTRGF_Msk (0x1ul << TIMER_PWMSTATUS_EADCTRGF_Pos) /*!< TIMER_T::PWMSTATUS: EADCTRGF Mask */ - -#define TIMER_PWMPBUF_PBUF_Pos (0) /*!< TIMER_T::PWMPBUF: PBUF Position */ -#define TIMER_PWMPBUF_PBUF_Msk (0xfffful << TIMER_PWMPBUF_PBUF_Pos) /*!< TIMER_T::PWMPBUF: PBUF Mask */ - -#define TIMER_PWMCMPBUF_CMPBUF_Pos (0) /*!< TIMER_T::PWMCMPBUF: CMPBUF Position */ -#define TIMER_PWMCMPBUF_CMPBUF_Msk (0xfffful << TIMER_PWMCMPBUF_CMPBUF_Pos) /*!< TIMER_T::PWMCMPBUF: CMPBUF Mask */ - -/**@}*/ /* TIMER_CONST */ -/**@}*/ /* end of TIMER register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __TIMER_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/trng_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/trng_reg.h deleted file mode 100644 index 64ed957e567..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/trng_reg.h +++ /dev/null @@ -1,922 +0,0 @@ -/**************************************************************************//** - * @file trng_reg.h - * @brief True Random Number Generator register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __TRNG_REG_H__ -#define __TRNG_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/*---------------------- True Random Number Generator -------------------------*/ -/** - @addtogroup TRNG True Random Number Generator(TRNG) - Memory Mapped Structure for TRNG Controller -@{ */ - -typedef struct -{ - /** - * @var TRNG_T::CTL - * Offset: 0x00 The CTRL register is used to cause the TRNG NIST to execute one of a number of actions. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |CMD |Execute a Command - * | | |Enumerated values not listed are 'reserved'. - * | | |0000 = (NOP): Execute a NOP. - * | | |0001 = (GEN_NOISE): Generate full-entropy seed from noise. - * | | |0010 = (GEN_NONCE): Generate seed from host-written nonce. - * | | |0011 = (CREATE_STATE): Move DRBG to create state. - * | | |0100 = (RENEW_STATE): Move DRBG to renew state. - * | | |0101 = (REFRESH_ADDIN): Move DRBG to refresh addin. - * | | |0110 = (GEN_RANDOM): Generate a random number. - * | | |0111 = (ADVANCE_STATE): Advance DRBG state. - * | | |1000 = (RUN_KAT): Run KAT on DRBG or entropy source. - * | | |1111 = (ZEROIZE): Zeroize. - * @var TRNG_T::MODE - * Offset: 0x04 The MODE register is used to enable or disable certain run-time features within the TRNG NIST. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SEC_ALG |Select Security Strength in DRBG - * | | |0 = (SEC_128): AES-128. - * | | |1 = (SEC_256): AES-256. - * |[3] |PRED_RESIST|Prediction Resistance - * | | |0 = (PRED_DISABLE): Prediction resistance is not required. - * | | |1 = (PRED_ENABLED): Prediction resistance is required. - * |[4] |ADDIN_PRESENT|Availability of the Additional Input - * | | |0 = (ADDIN_NOT_REQ): No Additional Input required from host. - * | | |1 = (ADDIN_REQ): Additional input must be provided by host. - * |[6:5] |KAT_VEC |Select Test Vectors for Known-answer Test - * | | |00 = (KAT_VEC0): KAT vector 0. - * | | |01 = (KAT_VEC1): KAT vector 1. - * | | |10 = (KAT_VEC2): KAT vector 2. - * | | |11 = (KAT_ALL): Run all 3 KAT vectors. - * |[8:7] |KAT_SEL |Select Test Component for Known-answer Test - * | | |00 = (KAT_DRBG): KAT on DRBG. - * | | |01 = (KAT_DF): KAT on conditioning component (Derivation Function). - * | | |10 = (KAT_BOTH): KAT on both DRBG and DF. - * | | |11 = Reserved. - * @var TRNG_T::SMODE - * Offset: 0x08 The SMODE register is used to enable or disable certain MISSION mode run-time features. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |NONCE |Set the Core in Nonce Seeding Mode - * | | |0 = (NONCE_DISABLED): Disable nonce mode. - * | | |1 = (NONCE_ENABLED): Enable nonce mode. - * |[1] |MISSION_MODE|Operating Mode - * | | |0 = (RST_TEST_MODE): test mode. - * | | |1 = (RST_MISSION_MODE): mission mode. - * | | |Note: Any change to the state of this field (1 to 0 or 0 to 1) causes the TRNG NIST to zeroize itself. - * |[9:2] |MAX_REJECTS|Maximum Number of Consecutive Bit Rejections Before Issuing Ring Tweak - * | | |Default is to 10 (0xa). - * |[23:16] |INDIV_HT_DISABLE|Statistical Health Tests Individually - * | | |0 = Disable. - * | | |1 = Enable. - * | | |INDIV_HT_DISABLE[0] = Repetition Count test on raw entropy. - * | | |INDIV_HT_DISABLE[1] = Adaptive Proportion test on raw entropy. - * | | |INDIV_HT_DISABLE[2] = Monobit test on raw entropy. - * | | |INDIV_HT_DISABLE[3] = Poker test on raw entropy. - * | | |INDIV_HT_DISABLE[4] = Run test on raw entropy. - * | | |INDIV_HT_DISABLE[5] = Long Run test on raw entropy. - * | | |INDIV_HT_DISABLE[6] = Auto-correlation test on raw entropy. - * | | |INDIV_HT_DISABLE[7] = Repetition Count test on entropy source output. - * | | |Note: Users only can enable/disable statistical health test in TEST mode - * | | |This field cannot change in MISSION mode and its value is always 0 in MISSION mode. - * |[31] |NOISE_COLLECT|Raw Noise Collection Mode - * | | |0 = Disable. - * | | |1 = Enable. - * | | |Note: Users only can enable/disable raw noise collection in TEST mode - * | | |This bit cannot be set to 1 in MISSION mode. - * @var TRNG_T::STAT - * Offset: 0x0C The STAT register allows the user to monitor the internal status of the TRNG NIST. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |LAST_CMD |Last Command - * | | |0000 = (NOP). - * | | |0001 = (GEN_NOISE). - * | | |0011 = (GEN_NONCE). - * | | |0011 = (CREATE_STATE). - * | | |0100 = (RENEW_STATE). - * | | |0101 = (REFRESH_ADDIN). - * | | |0110 = (GEN_RANDOM). - * | | |0111 = (ADVANCE_STATE). - * | | |1000 = (RUN_KAT). - * | | |1111 = (ZEROIZE). - * | | |Others = Reserved. - * |[4] |SEC_ALG |Reflects State of MODE.SEC_ALG - * | | |0 = (SEC_ALG_0): Maximum security strength set to 128. - * | | |1 =(SEC_ALG_1): Maximum security strength set to 256. - * |[5] |NONCE_MODE|Reflects State of SMODE.NONCE - * | | |0 = (NONCE_DISABLE): Nonce mode disabled. - * | | |1 = (NONCE_ENABLE): Nonce mode enabled (allows CTRL.CMD value of 2). - * |[6] |MISSION_MODE|Reflects State of SMODE.MISSION_MODE - * | | |0 = (SEC_MODE_MISSION): Core is in TEST mode. - * | | |1 = (SEC_MODE_TEST): Core is in MISSION mode. - * |[8:7] |DRBG_STATE|Reflects How a DRBG State Is Instantiated - * | | |00 = (DRBG_NOT_INIT): State is not instantiated. - * | | |01 = (DRBG_NS): State is instantiated using the built-in noise source. - * | | |10 = (DRBG_HOST): State is instantiated using the host-provided nonce. - * | | |11 = Reserved. - * |[9] |STARTUP_TEST_STUCK|Indicates Whether the Startup Test Is Stuck - * | | |0 = (STARTUP_TEST_NOT_STUCK): Startup test is not stuck (yet). - * | | |1 = (STARTUP_TEST_IS_STUCK): Startup test is highly likely stuck. - * | | |Note: Only valid when sticky startup test feature Is enabled. - * |[10] |STARTUP_TEST_IN_PROG|Indicates Whether the Startup Test Is in Progress - * | | |0 = (STARTUP_TEST_NOT_STUCK): Startup test is finished. - * | | |1 = (STARTUP_TEST_IS_STUCK): Startup test is in progress. - * |[31] |BUSY |State of the Core - * | | |0 = (BUSY_NOT): Idle. - * | | |1 = (BUSY_EXEC): Currently executing a command. - * @var TRNG_T::IE - * Offset: 0x10 The IE register is used to enable or disable interrupts within the TRNG NIST. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZEROIZED |Include or Exclude ZEROIZED Interrupt Contribution - * | | |0 = (ZEROIZED_DIS): Disable ZEROIZED interrupt contribution. - * | | |1 = (ZEROIZED_EN): Enable ZEROIZED interrupt contribution. - * |[1] |KAT_COMPLETED|Include or Exclude KAT_COMPLETED Interrupt Contribution - * | | |0 = (KAT_COMPLETED_DIS): Disable KAT_COMPLETED interrupt contribution. - * | | |1 = (KAT_COMPLETED_EN): Enable KAT_COMPLETED interrupt contribution. - * |[2] |NOISE_RDY |Include or Exclude NOISE_RDY Interrupt Contribution - * | | |0 = (NOISE_RDY_DIS): Disable NOISE_RDY interrupt contribution. - * | | |1 = (NOISE_RDY_EN): Enable NOISE_RDY interrupt contribution. - * |[3] |ALARMS |Include or Exclude ALARMS Interrupt Contribution - * | | |0 = (ALARMS_DIS): Disable ALARMS interrupt contribution. - * | | |1 = (ALARMS_EN): Enable ALARMS interrupt contribution. - * |[4] |DONE |Include or Exclude DONE Interrupt Contribution - * | | |0 = (DONE_DIS): Disable DONE interrupt contribution. - * | | |1 = (DONE_EN): Enable DONE interrupt contribution. - * |[31] |GLBL |Global Interrupt Enable Signal for the TRNG NIST - * | | |0 = (GLBL_DIS): Disable GLBL interrupt contribution. - * | | |1 = (GLBL_EN): Enable GLBL interrupt contribution. - * @var TRNG_T::ISTAT - * Offset: 0x14 The ISTAT register allows the user to monitor the interrupt contributions of the TRNG NIST. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ZEROIZED |ZEROIZED Flag - * | | |Indicates the Completion of the ZEROIZE Operation - * | | |0 = (ZEROIZED_R0): R0: No unacknowledged ZEROIZED. - * | | | (ZEROIZED_W0): W0: NOP. - * | | |1 = (ZEROIZED_R1): R1: Unacknowledged ZEROIZED. - * | | | (ZEROIZED_W1): W1: Clear ZEROIZED flag. - * |[1] |KAT_COMPLETED|KAT_COMPLETED Flag - * | | |Indicates the Completion of the RUN_KAT Command - * | | |0 = (KAT_COMPLETED_R0): R0: No unacknowledged KAT_COMPLETED. - * | | | (KAT_COMPLETED_W0): W0: NOP. - * | | |1 = (KAT_COMPLETED_R1): R1: Unacknowledged KAT_COMPLETED. - * | | | (KAT_COMPLETED_W1): W1: Clear KAT_COMPLETED flag. - * |[2] |NOISE_RDY |NOISE_RDY Flag - * | | |When TRNG NIST is generating a full-entropy seed in the self-seeding mode, MISSION_MODE(TRNG_SMODE[1]) is 0 (TEST mode) and SMODE.NOISE_COLLECT is set to 1, the NOISE_RDY bit informs the user when 512 bits of noise have been generated - * | | |This interrupt never happens in the MISSION mode of operation. - * | | |0 = (NOISE_RDY_R0): R0: No unacknowledged noise generation completion. - * | | | (NOISE_RDY_W0): W0: NOP. - * | | |1 = (NOISE_RDY_R1): R1: Unacknowledged noise generation completion. - * | | | (NOISE_RDY_W1): W1: Clear NOISE_RDY flag. - * |[3] |ALARMS |ALARMS Flag - * | | |The ALARMS bit allows the user to poll failures - * | | |When an alarm occurs, an automatic zeroize happens - * | | |Clearing this interrupt also clears the O_alarm pin. - * | | |0 = (ALARMS_R0): R0: No unacknowledged ALARMS. - * | | | (ALARMS_W0): W0: NOP. - * | | |1 = (ALARMS_R1): R1: Unacknowledged ALARMS. - * | | | (ALARMS_W1): W1: Clear ALARMS flag. - * |[4] |DONE |DONE Flag - * | | |The DONE bit allows the user to poll the completion of all commands except RUN_KAT and ZEROIZE which have their own interrupt. - * | | |0 = (DONE_R0): R0: No unacknowledged command completion. - * | | | (DONE_W0): W0: NOP. - * | | |1 = (DONE_R1): R1: Unacknowledged command completion. - * | | | (DONE_W1): W1: Clear DONE flag. - * @var TRNG_T::ALARMS - * Offset: 0x18 The ALARMS register allows the user to monitor the source of critical alarms. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |FAILED_TEST_ID|FAILED_TEST_ID Error Flag - * | | |When an alarm is issued, the FAILED_TEST_ID field shows which test has failed - * | | |This fields only shows the first detected failed test and it should not be assumed that the remaining statistical tests are passed. - * | | |0000 = (FAILED_TEST_ID_0): no failure. - * | | |0001 = (FAILED_TEST_ID_1): failure in both KAT and statistical tests. - * | | |0010 = (FAILED_TEST_ID_2): KAT test failure. - * | | |0011 = (FAILED_TEST_ID_3): Monobit test failure. - * | | |0100 = (FAILED_TEST_ID_4): Run test failure. - * | | |0101 = (FAILED_TEST_ID_5): Long Run test failure. - * | | |0110 = (FAILED_TEST_ID_6): Auto-correlation test failure. - * | | |0111 = (FAILED_TEST_ID_7): Poker test failure. - * | | |1000 = (FAILED_TEST_ID_8): Repetition Count test failure. - * | | |1001 = (FAILED_TEST_ID_9): Adaptive Proportion test failure. - * | | |Others = Reserved. - * |[4] |ILLEGAL_CMD_SEQ|ILLEGAL_CMD_SEQ Error Flag - * | | |The ILLEGAL_CMD_SEQ field indicates that the SOFTWARE Driver has executed an illegal command sequence. - * | | |0 = (ILLEGAL_CMD_SEQ _0): no failure. - * | | |1 = (ILLEGAL_CMD_SEQ _1): Executed an illegal command sequence. - * |[5] |FAILED_SEED_ST_HT|FAILED_SEED_ST_HT Error Flag - * | | |The FAILED_SEED_ST_HT field indicates that the statistical tests applied on the entropy source output is failed (Only valid when entropy source output statistical health test feature is included). - * | | |0 = (FAILED_SEED_ST_HT_0): no failure. - * | | |1 = (FAILED_SEED_ST_HT_1): Entropy source health test is failed. - * @var TRNG_T::COREKIT_REL - * Offset: 0x1C Contains the static coreKit release information. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |REL_NUM |The CoreKit Release Version In Pseudo-BCD - * | | |For example, release '2.35e-lca04' is encoded as 0x235e. - * | | |This TRNG version is 0x300a. - * |[23:16] |EXT_VER |The CoreKit Release Extension Version Number - * | | |For example, release '2.35e-lp04' is encoded as 0x4. - * | | |GA releases has a value of 0. - * |[31:28] |EXT_ENUM |The CoreKit Release Extension Type - * | | |For example, release '2.35e-lca04' is encoded as 0x1. - * | | |0000 = (EXT_ENUM_GA): GA release. - * | | |0001 = (EXT_ENUM_LCA): LCA release. - * | | |0010 = (EXT_ENUM_EA): EA release. - * | | |0011 = (EXT_ENUM_LP): LP release. - * | | |0100 = (EXT_ENUM_LPC): LPC release. - * | | |0101 = (EXT_ENUM_SOW): SOW release. - * | | |Others = Reserved. - * @var TRNG_T::FEATURES - * Offset: 0x20 The FEATURES register returns the state of various build-time parameter values. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SECURE_RST_STATE|The Core Resets to MISSION or TEST Mode - * | | |0 = test mode. - * | | |1 = mission mode. - * |[3:1] |DIAG_LEVEL_ST_HLT|Level Of Diagnostic Circuitry For The Health Test - * |[6:4] |DIAG_LEVEL_CLP800|Level Of Diagnostic Circuitry For TRNG When Noise Source - * |[7] |DIAG_LEVEL_NS|Level Of Diagnostic Circuitry For Noise Source Output Registers - * |[8] |PS_PRESENT|The NPA_DATAx Registers Is used As A Personalization String During The Create_State Command - * | | |0 = No. - * | | |1 = Yes. - * |[9] |AES_256 |The Instantiated AES - * | | |0 = AES-128. - * | | |1 = AES-256. - * @var TRNG_T::RAND0 - * Offset: 0x24 The RAND0 register is used by the host to read bits [31:0] of the newly generated 128-bit random data. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RAND |Random Data Word - * @var TRNG_T::RAND1 - * Offset: 0x28 The RAND1 register is used by the host to read bits [63:32] of the newly generated 128-bit random data. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RAND |Random Data Word - * @var TRNG_T::RAND2 - * Offset: 0x2C The RAND2 register is used by the host to read bits [95:64] of the newly generated 128-bit random data. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RAND |Random Data Word - * @var TRNG_T::RAND3 - * Offset: 0x30 The RAND3 register is used by the host to read bits [127:96] of the newly generated 128-bit random data. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RAND |Random Data Word - * @var TRNG_T::NPA_DATA0 - * Offset: 0x34 The NPA_DATA0 register holds Noise/Nonce/Personalization String/Additional Input - bits [31:0]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA1 - * Offset: 0x38 The NPA_DATA1 register holds Noise/Nonce/Personalization String/Additional Input - bits [63:32]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA2 - * Offset: 0x3C The NPA_DATA2 register holds Noise/Nonce/Personalization String/Additional Input - bits [95:64]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA3 - * Offset: 0x40 The NPA_DATA3 register holds Noise/Nonce/Personalization String/Additional Input - bits [127:96]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA4 - * Offset: 0x44 The NPA_DATA4 register holds Noise/Nonce/Personalization String/Additional Input - bits [159:128]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA5 - * Offset: 0x48 The NPA_DATA5 register holds Noise/Nonce/Personalization String/Additional Input - bits [191:160]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA6 - * Offset: 0x4C The NPA_DATA6 register holds Noise/Nonce/Personalization String/Additional Input - bits [223:192]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA7 - * Offset: 0x50 The NPA_DATA7 register holds Noise/Nonce/Personalization String/Additional Input - bits [255:224]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA8 - * Offset: 0x54 The NPA_DATA8 register holds Noise/Nonce/Personalization String/Additional Input - bits [287:256]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA9 - * Offset: 0x58 The NPA_DATA9 register holds Noise/Nonce/Personalization String/Additional Input - bits [319:288]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA10 - * Offset: 0x5C The NPA_DATA10 register holds Noise/Nonce/Personalization String/Additional Input - bits [351:320]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA11 - * Offset: 0x60 The NPA_DATA11 register holds Noise/Nonce/Personalization String/Additional Input - bits [383:352]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA12 - * Offset: 0x64 The NPA_DATA12 register holds Noise/Nonce - bits [415:384]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA13 - * Offset: 0x68 The NPA_DATA13 register holds Noise/Nonce - bits [447:416]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA14 - * Offset: 0x6C The NPA_DATA14 register holds Noise/Nonce - bits [479:448]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::NPA_DATA15 - * Offset: 0x70 The NPA_DATA15 register holds Noise/Nonce - bits [511:480]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |NPA_DATA |NPA data word - * | | |Noise/Nonce can be stored in register NPA_DATA0 ~ NPA_DATA15. - * | | |Personalization String/Additional Input can be stored in register NPA_DATA0 ~ NPA_DATA11. - * @var TRNG_T::SEED0 - * Offset: 0x74 The SEED0 register holds seed value used in the DRBG - bits [31:0]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED1 - * Offset: 0x78 The SEED1 register holds seed value used in the DRBG - bits [63:32]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED2 - * Offset: 0x7C The SEED2 register holds seed value used in the DRBG - bits [95:64]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED3 - * Offset: 0x80 The SEED3 register holds seed value used in the DRBG - bits [127:96]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED4 - * Offset: 0x84 The SEED4 register holds seed value used in the DRBG - bits [159:128]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED5 - * Offset: 0x88 The SEED5 register holds seed value used in the DRBG - bits [191:160]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED6 - * Offset: 0x8C The SEED6 register holds seed value used in the DRBG - bits [223:192]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED7 - * Offset: 0x90 The SEED7 register holds seed value used in the DRBG - bits [255:224]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED8 - * Offset: 0x94 The SEED8 register holds seed value used in the DRBG - bits [287:256]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED9 - * Offset: 0x98 The SEED9 register holds seed value used in the DRBG - bits [319:288]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED10 - * Offset: 0x9C The SEED10 register holds seed value used in the DRBG - bits [351:320]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::SEED11 - * Offset: 0xA0 The SEED11 register holds seed value used in the DRBG - bits [383:352]. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |SEED data word - * @var TRNG_T::TIME_TO_SEED - * Offset: 0xD0 The Time-to-Seed (TTS) register records the number of clock cycles taken to collect the set of raw noise bits used by the previous GEN_NOISE command. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TTS |TRNG Time To Seed Shows the number of system clock cycles taken to generate raw noise for the last GEN_NOISE command. - * @var TRNG_T::BUILD_CFG0 - * Offset: 0xF0 Contains build-time TRNG NIST parameter settings. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CORE_TYPE |Core Type - * | | |00 = (CORE_TYPE_BASE_TRNG): TRNG. - * | | |01 = (CORE_TYPE_BASE_TRNG_WITH_ESM_NONCE): TRNG with ESM nonce I/O. - * | | |10 = (CORE_TYPE_NIST_TRNG): TRNG NIST. - * | | |11 = (CORE_TYPE_NIST_TRNG_WITH_EDU): TRNG NIST with EDU. - * |[7] |BG8 |Indicates Number Of Bit Generators Present - * | | |0 = (SIX_BGS): 6 Bit Generators present. - * | | |1 = (EIGHT_BGS): 8 Bit Generators present.. - * |[9:8] |CDC_SYNC_DEPTH|Depth Of The CDC Resynchronizer Chains - * | | |00 = (CDC_RESYNC_4): CDC resynchronizer depth 4. - * | | |01 = Reserved. - * | | |10 = (CDC_RESYNC_2): CDC resynchronizer depth 2. - * | | |11 = (CDC_RESYNC_3): CDC resynchronizer depth 3. - * |[10] |BACKGROUND_NOISE|Indicates Background Noise Collection Is Present - * | | |0 = (BACKGROUND_NOISE _NOT_PRESENT): not present. - * | | |1 = (BACKGROUND_NOISE_PRESENT): present.. - * |[11] |EDU_PRESENT|Indicates EDU Is Present - * | | |0 = (EDU_PRESENT_NOT_PRESENT): not present. - * | | |1 = (EDU_PRESENT_PRESENT): present.. - * |[12] |AES_DATAPATH|AES Datapath Width - * | | |0 = (AES_DATAPATH_32): 32-bit datapath. - * | | |1 = (AES_DATAPATH_128): 128-bit datapath. - * |[13] |AES_MAX_KEY_SIZE|AES Max Key Size - * | | |0 = (AES_MAX_KEY_SIZE_128): 128-bit key. - * | | |1 = (AES_MAX_KEY_SIZE_256): 256-bit key. - * |[14] |PERSONALIZATION_STR|Personalization String Used - * | | |0 = (PS_NOT_PRESENT): not present. - * | | |1 = (PS_PRESENT): present. - * @var TRNG_T::BUILD_CFG1 - * Offset: 0xF4 Contains additional build-time TRNG NIST parameter settings. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |NUM_RAW_NOISE_BLKS|Number of Raw Noise Blocks Used for Start-up Test - * |[8] |STICKY_STARTUP|Sticky-startup Test Present - * | | |0 = (STICKY_STARTUP_TEST_NOT_PRESENT): not present. - * | | |1 = (STICKY_STARTUP_TEST_PRESENT): present. - * |[12] |AUTO_CORRELATION_TEST|Auto-correlation Test Present - * | | |0 = (AUTO_CORRELATION_TEST_NOT_PRESENT): not present. - * | | |1 = (AUTO_CORRELATION_TEST_PRESENT): present. - * |[13] |MONOBIT_TEST|Monobit Test Present - * | | |0 = (MONOBIT_TEST_NOT_PRESENT): not present. - * | | |1 = (MONOBIT_TEST_PRESENT): present. - * |[14] |RUN_TEST |Run Test Present - * | | |0 = (RUN_TEST_NOT_PRESENT): not present. - * | | |1 = (RUN_TEST_PRESENT): present. - * |[15] |POKER_TEST|Poker Test Present - * | | |0 = (POKER_TEST_NOT_PRESENT): not present. - * | | |1 = (POKER_TEST_PRESENT): present. - * |[18:16] |RAW_HT_ADAP_TEST|Raw Health Adaptive Proportion Test - * | | |000 = (RAW_HT_ADAP_TEST_NOT_PRESENT): not present. - * | | |001 = (RAW_HT_ADAP_TEST_1K_SAMPLES): 1k samples per window. - * | | |010 = (RAW_HT_ADAP_TEST_2K_SAMPLES): 2k samples per window. - * | | |011 = (RAW_HT_ADAP_TEST_4K_SAMPLES): 4k samples per window. - * | | |100 = (RAW_HT_ADAP_TEST_8K_SAMPLES): 8k samples per window. - * | | |101 = (RAW_HT_ADAP_TEST_16K_SAMPLES): 16k samples per window. - * | | |110 = (RAW_HT_ADAP_TEST_32K_SAMPLES): 32k samples per window. - * | | |111 = (RAW_HT_ADAP_TEST_64K_SAMPLES): 64k samples per window. - * |[19] |RAW_HT_REP_TEST|Raw Health Repetition Test Present - * | | |0 = (RAW_HT_REP_TEST_NOT_PRESENT): not present. - * | | |1 = (RAW_HT_REP_TEST_PRESENT): present. - * |[22:20] |ENT_SRC_REP_SMPL_SIZE|Entropy Source: Sample Size - * | | |000 = (ENT_SRC_REP_SMPL_SIZE_1): Sample size 1. - * | | |001 = (ENT_SRC_REP_SMPL_SIZE_2): Sample size 2. - * | | |010 = (ENT_SRC_REP_SMPL_SIZE_4): Sample size 4. - * | | |011 = (ENT_SRC_REP_SMPL_SIZE_8): Sample size 8. - * | | |100 = (ENT_SRC_REP_SMPL_SIZE_16): Sample size 16. - * | | |101 = (ENT_SRC_REP_SMPL_SIZE_32): Sample size 32. - * | | |110 = (ENT_SRC_REP_SMPL_SIZE_64): Sample size 64. - * | | |111 = (ENT_SRC_REP_SMPL_SIZE_128): Sample size 128. - * |[23] |ENT_SRC_REP_TEST|Entropy Source Repetition Test Present - * | | |0 = (ENT_SRC_REP_TEST_NOT_PRESENT): not present. - * | | |1 = (ENT_SRC_REP_TEST_PRESENT): present. - * |[30:24] |ENT_SRC_REP_MIN_ENTROPY|Entropy Source Repetition Minimum Entropy Per Bit - */ - __O uint32_t CTL; /*!< [0x0000] The CTRL register is used to cause the TRNG NIST to execute one of a number of actions. */ - __IO uint32_t MODE; /*!< [0x0004] The MODE register is used to enable or disable certain run-time features within the TRNG NIST. */ - __IO uint32_t SMODE; /*!< [0x0008] The SMODE register is used to enable or disable certain MISSION mode run-time features. */ - __I uint32_t STAT; /*!< [0x000c] The STAT register allows the user to monitor the internal status of the TRNG NIST. */ - __IO uint32_t IE; /*!< [0x0010] The IE register is used to enable or disable interrupts within the TRNG NIST. */ - __IO uint32_t ISTAT; /*!< [0x0014] The ISTAT register allows the user to monitor the interrupt contributions of the TRNG NIST. */ - __IO uint32_t ALARMS; /*!< [0x0018] The ALARMS register allows the user to monitor the source of critical alarms. */ - __I uint32_t COREKIT_REL; /*!< [0x001c] Contains the static coreKit release information. */ - __I uint32_t FEATURES; /*!< [0x0020] The FEATURES register returns the state of various build-time parameter values. */ - __I uint32_t RAND0; /*!< [0x0024] The RAND0 register is used by the host to read bits [31:0] of the newly generated 128-bit random data. */ - __I uint32_t RAND1; /*!< [0x0028] The RAND1 register is used by the host to read bits [63:32] of the newly generated 128-bit random data. */ - __I uint32_t RAND2; /*!< [0x002c] The RAND2 register is used by the host to read bits [95:64] of the newly generated 128-bit random data. */ - __I uint32_t RAND3; /*!< [0x0030] The RAND3 register is used by the host to read bits [127:96] of the newly generated 128-bit random data. */ - __IO uint32_t NPA_DATA0; /*!< [0x0034] The NPA_DATA0 register holds Noise/Nonce/Personalization String/Additional Input - bits [31:0]. */ - __IO uint32_t NPA_DATA1; /*!< [0x0038] The NPA_DATA1 register holds Noise/Nonce/Personalization String/Additional Input - bits [63:32]. */ - __IO uint32_t NPA_DATA2; /*!< [0x003c] The NPA_DATA2 register holds Noise/Nonce/Personalization String/Additional Input - bits [95:64]. */ - __IO uint32_t NPA_DATA3; /*!< [0x0040] The NPA_DATA3 register holds Noise/Nonce/Personalization String/Additional Input - bits [127:96]. */ - __IO uint32_t NPA_DATA4; /*!< [0x0044] The NPA_DATA4 register holds Noise/Nonce/Personalization String/Additional Input - bits [159:128]. */ - __IO uint32_t NPA_DATA5; /*!< [0x0048] The NPA_DATA5 register holds Noise/Nonce/Personalization String/Additional Input - bits [191:160]. */ - __IO uint32_t NPA_DATA6; /*!< [0x004c] The NPA_DATA6 register holds Noise/Nonce/Personalization String/Additional Input - bits [223:192]. */ - __IO uint32_t NPA_DATA7; /*!< [0x0050] The NPA_DATA7 register holds Noise/Nonce/Personalization String/Additional Input - bits [255:224]. */ - __IO uint32_t NPA_DATA8; /*!< [0x0054] The NPA_DATA8 register holds Noise/Nonce/Personalization String/Additional Input - bits [287:256]. */ - __IO uint32_t NPA_DATA9; /*!< [0x0058] The NPA_DATA9 register holds Noise/Nonce/Personalization String/Additional Input - bits [319:288]. */ - __IO uint32_t NPA_DATA10; /*!< [0x005c] The NPA_DATA10 register holds Noise/Nonce/Personalization String/Additional Input - bits [351:320]. */ - __IO uint32_t NPA_DATA11; /*!< [0x0060] The NPA_DATA11 register holds Noise/Nonce/Personalization String/Additional Input - bits [383:352]. */ - __IO uint32_t NPA_DATA12; /*!< [0x0064] The NPA_DATA12 register holds Noise/Nonce - bits [415:384]. */ - __IO uint32_t NPA_DATA13; /*!< [0x0068] The NPA_DATA13 register holds Noise/Nonce - bits [447:416]. */ - __IO uint32_t NPA_DATA14; /*!< [0x006c] The NPA_DATA14 register holds Noise/Nonce - bits [479:448]. */ - __IO uint32_t NPA_DATA15; /*!< [0x0070] The NPA_DATA15 register holds Noise/Nonce - bits [511:480]. */ - __IO uint32_t SEED0; /*!< [0x0074] The SEED0 register holds seed value used in the DRBG - bits [31:0]. */ - __IO uint32_t SEED1; /*!< [0x0078] The SEED1 register holds seed value used in the DRBG - bits [63:32]. */ - __IO uint32_t SEED2; /*!< [0x007c] The SEED2 register holds seed value used in the DRBG - bits [95:64]. */ - __IO uint32_t SEED3; /*!< [0x0080] The SEED3 register holds seed value used in the DRBG - bits [127:96]. */ - __IO uint32_t SEED4; /*!< [0x0084] The SEED4 register holds seed value used in the DRBG - bits [159:128]. */ - __IO uint32_t SEED5; /*!< [0x0088] The SEED5 register holds seed value used in the DRBG - bits [191:160]. */ - __IO uint32_t SEED6; /*!< [0x008c] The SEED6 register holds seed value used in the DRBG - bits [223:192]. */ - __IO uint32_t SEED7; /*!< [0x0090] The SEED7 register holds seed value used in the DRBG - bits [255:224]. */ - __IO uint32_t SEED8; /*!< [0x0094] The SEED8 register holds seed value used in the DRBG - bits [287:256]. */ - __IO uint32_t SEED9; /*!< [0x0098] The SEED9 register holds seed value used in the DRBG - bits [319:288]. */ - __IO uint32_t SEED10; /*!< [0x009c] The SEED10 register holds seed value used in the DRBG - bits [351:320]. */ - __IO uint32_t SEED11; /*!< [0x00a0] The SEED11 register holds seed value used in the DRBG - bits [383:352]. */ - __I uint32_t RESERVE0[11]; - __I uint32_t TIME_TO_SEED; /*!< [0x00d0] The Time-to-Seed (TTS) register records the number of clock cycles taken to collect the set of raw noise bits used by the previous GEN_NOISE command. */ - __I uint32_t RESERVE1[7]; - __I uint32_t BUILD_CFG0; /*!< [0x00f0] Contains build-time TRNG NIST parameter settings. */ - __I uint32_t BUILD_CFG1; /*!< [0x00f4] Contains additional build-time TRNG NIST parameter settings. */ - -} TRNG_T; - -/** - @addtogroup TRNG_CONST TRNG Bit Field Definition - Constant Definitions for TRNG Controller -@{ */ - -#define TRNG_CTL_CMD_Pos (0) /*!< TRNG_T::CTL: CMD Position */ -#define TRNG_CTL_CMD_Msk (0xful << TRNG_CTL_CMD_Pos) /*!< TRNG_T::CTL: CMD Mask */ - -#define TRNG_MODE_SEC_ALG_Pos (0) /*!< TRNG_T::MODE: SEC_ALG Position */ -#define TRNG_MODE_SEC_ALG_Msk (0x1ul << TRNG_MODE_SEC_ALG_Pos) /*!< TRNG_T::MODE: SEC_ALG Mask */ - -#define TRNG_MODE_PRED_RESIST_Pos (3) /*!< TRNG_T::MODE: PRED_RESIST Position */ -#define TRNG_MODE_PRED_RESIST_Msk (0x1ul << TRNG_MODE_PRED_RESIST_Pos) /*!< TRNG_T::MODE: PRED_RESIST Mask */ - -#define TRNG_MODE_ADDIN_PRESENT_Pos (4) /*!< TRNG_T::MODE: ADDIN_PRESENT Position */ -#define TRNG_MODE_ADDIN_PRESENT_Msk (0x1ul << TRNG_MODE_ADDIN_PRESENT_Pos) /*!< TRNG_T::MODE: ADDIN_PRESENT Mask */ - -#define TRNG_MODE_KAT_VEC_Pos (5) /*!< TRNG_T::MODE: KAT_VEC Position */ -#define TRNG_MODE_KAT_VEC_Msk (0x3ul << TRNG_MODE_KAT_VEC_Pos) /*!< TRNG_T::MODE: KAT_VEC Mask */ - -#define TRNG_MODE_KAT_SEL_Pos (7) /*!< TRNG_T::MODE: KAT_SEL Position */ -#define TRNG_MODE_KAT_SEL_Msk (0x3ul << TRNG_MODE_KAT_SEL_Pos) /*!< TRNG_T::MODE: KAT_SEL Mask */ - -#define TRNG_SMODE_NONCE_Pos (0) /*!< TRNG_T::SMODE: NONCE Position */ -#define TRNG_SMODE_NONCE_Msk (0x1ul << TRNG_SMODE_NONCE_Pos) /*!< TRNG_T::SMODE: NONCE Mask */ - -#define TRNG_SMODE_MISSION_MODE_Pos (1) /*!< TRNG_T::SMODE: MISSION_MODE Position */ -#define TRNG_SMODE_MISSION_MODE_Msk (0x1ul << TRNG_SMODE_MISSION_MODE_Pos) /*!< TRNG_T::SMODE: MISSION_MODE Mask */ - -#define TRNG_SMODE_MAX_REJECTS_Pos (2) /*!< TRNG_T::SMODE: MAX_REJECTS Position */ -#define TRNG_SMODE_MAX_REJECTS_Msk (0xfful << TRNG_SMODE_MAX_REJECTS_Pos) /*!< TRNG_T::SMODE: MAX_REJECTS Mask */ - -#define TRNG_SMODE_INDIV_HT_DISABLE_Pos (16) /*!< TRNG_T::SMODE: INDIV_HT_DISABLE Position*/ -#define TRNG_SMODE_INDIV_HT_DISABLE_Msk (0xfful << TRNG_SMODE_INDIV_HT_DISABLE_Pos) /*!< TRNG_T::SMODE: INDIV_HT_DISABLE Mask */ - -#define TRNG_SMODE_NOISE_COLLECT_Pos (31) /*!< TRNG_T::SMODE: NOISE_COLLECT Position */ -#define TRNG_SMODE_NOISE_COLLECT_Msk (0x1ul << TRNG_SMODE_NOISE_COLLECT_Pos) /*!< TRNG_T::SMODE: NOISE_COLLECT Mask */ - -#define TRNG_STAT_LAST_CMD_Pos (0) /*!< TRNG_T::STAT: LAST_CMD Position */ -#define TRNG_STAT_LAST_CMD_Msk (0xful << TRNG_STAT_LAST_CMD_Pos) /*!< TRNG_T::STAT: LAST_CMD Mask */ - -#define TRNG_STAT_SEC_ALG_Pos (4) /*!< TRNG_T::STAT: SEC_ALG Position */ -#define TRNG_STAT_SEC_ALG_Msk (0x1ul << TRNG_STAT_SEC_ALG_Pos) /*!< TRNG_T::STAT: SEC_ALG Mask */ - -#define TRNG_STAT_NONCE_MODE_Pos (5) /*!< TRNG_T::STAT: NONCE_MODE Position */ -#define TRNG_STAT_NONCE_MODE_Msk (0x1ul << TRNG_STAT_NONCE_MODE_Pos) /*!< TRNG_T::STAT: NONCE_MODE Mask */ - -#define TRNG_STAT_MISSION_MODE_Pos (6) /*!< TRNG_T::STAT: MISSION_MODE Position */ -#define TRNG_STAT_MISSION_MODE_Msk (0x1ul << TRNG_STAT_MISSION_MODE_Pos) /*!< TRNG_T::STAT: MISSION_MODE Mask */ - -#define TRNG_STAT_DRBG_STATE_Pos (7) /*!< TRNG_T::STAT: DRBG_STATE Position */ -#define TRNG_STAT_DRBG_STATE_Msk (0x3ul << TRNG_STAT_DRBG_STATE_Pos) /*!< TRNG_T::STAT: DRBG_STATE Mask */ - -#define TRNG_STAT_STARTUP_TEST_STUCK_Pos (9) /*!< TRNG_T::STAT: STARTUP_TEST_STUCK Position*/ -#define TRNG_STAT_STARTUP_TEST_STUCK_Msk (0x1ul << TRNG_STAT_STARTUP_TEST_STUCK_Pos) /*!< TRNG_T::STAT: STARTUP_TEST_STUCK Mask */ - -#define TRNG_STAT_STARTUP_TEST_IN_PROG_Pos (10) /*!< TRNG_T::STAT: STARTUP_TEST_IN_PROG Position*/ -#define TRNG_STAT_STARTUP_TEST_IN_PROG_Msk (0x1ul << TRNG_STAT_STARTUP_TEST_IN_PROG_Pos) /*!< TRNG_T::STAT: STARTUP_TEST_IN_PROG Mask*/ - -#define TRNG_STAT_BUSY_Pos (31) /*!< TRNG_T::STAT: BUSY Position */ -#define TRNG_STAT_BUSY_Msk (0x1ul << TRNG_STAT_BUSY_Pos) /*!< TRNG_T::STAT: BUSY Mask */ - -#define TRNG_IE_ZEROIZED_Pos (0) /*!< TRNG_T::IE: ZEROIZED Position */ -#define TRNG_IE_ZEROIZED_Msk (0x1ul << TRNG_IE_ZEROIZED_Pos) /*!< TRNG_T::IE: ZEROIZED Mask */ - -#define TRNG_IE_KAT_COMPLETED_Pos (1) /*!< TRNG_T::IE: KAT_COMPLETED Position */ -#define TRNG_IE_KAT_COMPLETED_Msk (0x1ul << TRNG_IE_KAT_COMPLETED_Pos) /*!< TRNG_T::IE: KAT_COMPLETED Mask */ - -#define TRNG_IE_NOISE_RDY_Pos (2) /*!< TRNG_T::IE: NOISE_RDY Position */ -#define TRNG_IE_NOISE_RDY_Msk (0x1ul << TRNG_IE_NOISE_RDY_Pos) /*!< TRNG_T::IE: NOISE_RDY Mask */ - -#define TRNG_IE_ALARMS_Pos (3) /*!< TRNG_T::IE: ALARMS Position */ -#define TRNG_IE_ALARMS_Msk (0x1ul << TRNG_IE_ALARMS_Pos) /*!< TRNG_T::IE: ALARMS Mask */ - -#define TRNG_IE_DONE_Pos (4) /*!< TRNG_T::IE: DONE Position */ -#define TRNG_IE_DONE_Msk (0x1ul << TRNG_IE_DONE_Pos) /*!< TRNG_T::IE: DONE Mask */ - -#define TRNG_IE_GLBL_Pos (31) /*!< TRNG_T::IE: GLBL Position */ -#define TRNG_IE_GLBL_Msk (0x1ul << TRNG_IE_GLBL_Pos) /*!< TRNG_T::IE: GLBL Mask */ - -#define TRNG_ISTAT_ZEROIZED_Pos (0) /*!< TRNG_T::ISTAT: ZEROIZED Position */ -#define TRNG_ISTAT_ZEROIZED_Msk (0x1ul << TRNG_ISTAT_ZEROIZED_Pos) /*!< TRNG_T::ISTAT: ZEROIZED Mask */ - -#define TRNG_ISTAT_KAT_COMPLETED_Pos (1) /*!< TRNG_T::ISTAT: KAT_COMPLETED Position */ -#define TRNG_ISTAT_KAT_COMPLETED_Msk (0x1ul << TRNG_ISTAT_KAT_COMPLETED_Pos) /*!< TRNG_T::ISTAT: KAT_COMPLETED Mask */ - -#define TRNG_ISTAT_NOISE_RDY_Pos (2) /*!< TRNG_T::ISTAT: NOISE_RDY Position */ -#define TRNG_ISTAT_NOISE_RDY_Msk (0x1ul << TRNG_ISTAT_NOISE_RDY_Pos) /*!< TRNG_T::ISTAT: NOISE_RDY Mask */ - -#define TRNG_ISTAT_ALARMS_Pos (3) /*!< TRNG_T::ISTAT: ALARMS Position */ -#define TRNG_ISTAT_ALARMS_Msk (0x1ul << TRNG_ISTAT_ALARMS_Pos) /*!< TRNG_T::ISTAT: ALARMS Mask */ - -#define TRNG_ISTAT_DONE_Pos (4) /*!< TRNG_T::ISTAT: DONE Position */ -#define TRNG_ISTAT_DONE_Msk (0x1ul << TRNG_ISTAT_DONE_Pos) /*!< TRNG_T::ISTAT: DONE Mask */ - -#define TRNG_ALARMS_FAILED_TEST_ID_Pos (0) /*!< TRNG_T::ALARMS: FAILED_TEST_ID Position*/ -#define TRNG_ALARMS_FAILED_TEST_ID_Msk (0xful << TRNG_ALARMS_FAILED_TEST_ID_Pos) /*!< TRNG_T::ALARMS: FAILED_TEST_ID Mask */ - -#define TRNG_ALARMS_ILLEGAL_CMD_SEQ_Pos (4) /*!< TRNG_T::ALARMS: ILLEGAL_CMD_SEQ Position*/ -#define TRNG_ALARMS_ILLEGAL_CMD_SEQ_Msk (0x1ul << TRNG_ALARMS_ILLEGAL_CMD_SEQ_Pos) /*!< TRNG_T::ALARMS: ILLEGAL_CMD_SEQ Mask */ - -#define TRNG_ALARMS_FAILED_SEED_ST_HT_Pos (5) /*!< TRNG_T::ALARMS: FAILED_SEED_ST_HT Position*/ -#define TRNG_ALARMS_FAILED_SEED_ST_HT_Msk (0x1ul << TRNG_ALARMS_FAILED_SEED_ST_HT_Pos) /*!< TRNG_T::ALARMS: FAILED_SEED_ST_HT Mask */ - -#define TRNG_COREKIT_REL_REL_NUM_Pos (0) /*!< TRNG_T::COREKIT_REL: REL_NUM Position */ -#define TRNG_COREKIT_REL_REL_NUM_Msk (0xfffful << TRNG_COREKIT_REL_REL_NUM_Pos) /*!< TRNG_T::COREKIT_REL: REL_NUM Mask */ - -#define TRNG_COREKIT_REL_EXT_VER_Pos (16) /*!< TRNG_T::COREKIT_REL: EXT_VER Position */ -#define TRNG_COREKIT_REL_EXT_VER_Msk (0xfful << TRNG_COREKIT_REL_EXT_VER_Pos) /*!< TRNG_T::COREKIT_REL: EXT_VER Mask */ - -#define TRNG_COREKIT_REL_EXT_ENUM_Pos (28) /*!< TRNG_T::COREKIT_REL: EXT_ENUM Position */ -#define TRNG_COREKIT_REL_EXT_ENUM_Msk (0xful << TRNG_COREKIT_REL_EXT_ENUM_Pos) /*!< TRNG_T::COREKIT_REL: EXT_ENUM Mask */ - -#define TRNG_FEATURES_SECURE_RST_STATE_Pos (0) /*!< TRNG_T::FEATURES: SECURE_RST_STATE Position*/ -#define TRNG_FEATURES_SECURE_RST_STATE_Msk (0x1ul << TRNG_FEATURES_SECURE_RST_STATE_Pos) /*!< TRNG_T::FEATURES: SECURE_RST_STATE Mask*/ - -#define TRNG_FEATURES_DIAG_LEVEL_ST_HLT_Pos (1) /*!< TRNG_T::FEATURES: DIAG_LEVEL_ST_HLT Position*/ -#define TRNG_FEATURES_DIAG_LEVEL_ST_HLT_Msk (0x7ul << TRNG_FEATURES_DIAG_LEVEL_ST_HLT_Pos) /*!< TRNG_T::FEATURES: DIAG_LEVEL_ST_HLT Mask*/ - -#define TRNG_FEATURES_DIAG_LEVEL_CLP800_Pos (4) /*!< TRNG_T::FEATURES: DIAG_LEVEL_CLP800 Position*/ -#define TRNG_FEATURES_DIAG_LEVEL_CLP800_Msk (0x7ul << TRNG_FEATURES_DIAG_LEVEL_CLP800_Pos) /*!< TRNG_T::FEATURES: DIAG_LEVEL_CLP800 Mask*/ - -#define TRNG_FEATURES_DIAG_LEVEL_NS_Pos (7) /*!< TRNG_T::FEATURES: DIAG_LEVEL_NS Position*/ -#define TRNG_FEATURES_DIAG_LEVEL_NS_Msk (0x1ul << TRNG_FEATURES_DIAG_LEVEL_NS_Pos) /*!< TRNG_T::FEATURES: DIAG_LEVEL_NS Mask */ - -#define TRNG_FEATURES_PS_PRESENT_Pos (8) /*!< TRNG_T::FEATURES: PS_PRESENT Position */ -#define TRNG_FEATURES_PS_PRESENT_Msk (0x1ul << TRNG_FEATURES_PS_PRESENT_Pos) /*!< TRNG_T::FEATURES: PS_PRESENT Mask */ - -#define TRNG_FEATURES_AES_256_Pos (9) /*!< TRNG_T::FEATURES: AES_256 Position */ -#define TRNG_FEATURES_AES_256_Msk (0x1ul << TRNG_FEATURES_AES_256_Pos) /*!< TRNG_T::FEATURES: AES_256 Mask */ - -#define TRNG_RAND0_RAND_Pos (0) /*!< TRNG_T::RAND0: RAND Position */ -#define TRNG_RAND0_RAND_Msk (0xfffffffful << TRNG_RAND0_RAND_Pos) /*!< TRNG_T::RAND0: RAND Mask */ - -#define TRNG_RAND1_RAND_Pos (0) /*!< TRNG_T::RAND1: RAND Position */ -#define TRNG_RAND1_RAND_Msk (0xfffffffful << TRNG_RAND1_RAND_Pos) /*!< TRNG_T::RAND1: RAND Mask */ - -#define TRNG_RAND2_RAND_Pos (0) /*!< TRNG_T::RAND2: RAND Position */ -#define TRNG_RAND2_RAND_Msk (0xfffffffful << TRNG_RAND2_RAND_Pos) /*!< TRNG_T::RAND2: RAND Mask */ - -#define TRNG_RAND3_RAND_Pos (0) /*!< TRNG_T::RAND3: RAND Position */ -#define TRNG_RAND3_RAND_Msk (0xfffffffful << TRNG_RAND3_RAND_Pos) /*!< TRNG_T::RAND3: RAND Mask */ - -#define TRNG_NPA_DATA0_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA0: NPA_DATA Position */ -#define TRNG_NPA_DATA0_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA0_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA0: NPA_DATA Mask */ - -#define TRNG_NPA_DATA1_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA1: NPA_DATA Position */ -#define TRNG_NPA_DATA1_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA1_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA1: NPA_DATA Mask */ - -#define TRNG_NPA_DATA2_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA2: NPA_DATA Position */ -#define TRNG_NPA_DATA2_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA2_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA2: NPA_DATA Mask */ - -#define TRNG_NPA_DATA3_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA3: NPA_DATA Position */ -#define TRNG_NPA_DATA3_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA3_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA3: NPA_DATA Mask */ - -#define TRNG_NPA_DATA4_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA4: NPA_DATA Position */ -#define TRNG_NPA_DATA4_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA4_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA4: NPA_DATA Mask */ - -#define TRNG_NPA_DATA5_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA5: NPA_DATA Position */ -#define TRNG_NPA_DATA5_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA5_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA5: NPA_DATA Mask */ - -#define TRNG_NPA_DATA6_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA6: NPA_DATA Position */ -#define TRNG_NPA_DATA6_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA6_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA6: NPA_DATA Mask */ - -#define TRNG_NPA_DATA7_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA7: NPA_DATA Position */ -#define TRNG_NPA_DATA7_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA7_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA7: NPA_DATA Mask */ - -#define TRNG_NPA_DATA8_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA8: NPA_DATA Position */ -#define TRNG_NPA_DATA8_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA8_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA8: NPA_DATA Mask */ - -#define TRNG_NPA_DATA9_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA9: NPA_DATA Position */ -#define TRNG_NPA_DATA9_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA9_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA9: NPA_DATA Mask */ - -#define TRNG_NPA_DATA10_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA10: NPA_DATA Position */ -#define TRNG_NPA_DATA10_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA10_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA10: NPA_DATA Mask */ - -#define TRNG_NPA_DATA11_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA11: NPA_DATA Position */ -#define TRNG_NPA_DATA11_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA11_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA11: NPA_DATA Mask */ - -#define TRNG_NPA_DATA12_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA12: NPA_DATA Position */ -#define TRNG_NPA_DATA12_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA12_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA12: NPA_DATA Mask */ - -#define TRNG_NPA_DATA13_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA13: NPA_DATA Position */ -#define TRNG_NPA_DATA13_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA13_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA13: NPA_DATA Mask */ - -#define TRNG_NPA_DATA14_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA14: NPA_DATA Position */ -#define TRNG_NPA_DATA14_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA14_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA14: NPA_DATA Mask */ - -#define TRNG_NPA_DATA15_NPA_DATA_Pos (0) /*!< TRNG_T::NPA_DATA15: NPA_DATA Position */ -#define TRNG_NPA_DATA15_NPA_DATA_Msk (0xfffffffful << TRNG_NPA_DATA15_NPA_DATA_Pos) /*!< TRNG_T::NPA_DATA15: NPA_DATA Mask */ - -#define TRNG_SEED0_SEED_Pos (0) /*!< TRNG_T::SEED0: SEED Position */ -#define TRNG_SEED0_SEED_Msk (0xfffffffful << TRNG_SEED0_SEED_Pos) /*!< TRNG_T::SEED0: SEED Mask */ - -#define TRNG_SEED1_SEED_Pos (0) /*!< TRNG_T::SEED1: SEED Position */ -#define TRNG_SEED1_SEED_Msk (0xfffffffful << TRNG_SEED1_SEED_Pos) /*!< TRNG_T::SEED1: SEED Mask */ - -#define TRNG_SEED2_SEED_Pos (0) /*!< TRNG_T::SEED2: SEED Position */ -#define TRNG_SEED2_SEED_Msk (0xfffffffful << TRNG_SEED2_SEED_Pos) /*!< TRNG_T::SEED2: SEED Mask */ - -#define TRNG_SEED3_SEED_Pos (0) /*!< TRNG_T::SEED3: SEED Position */ -#define TRNG_SEED3_SEED_Msk (0xfffffffful << TRNG_SEED3_SEED_Pos) /*!< TRNG_T::SEED3: SEED Mask */ - -#define TRNG_SEED4_SEED_Pos (0) /*!< TRNG_T::SEED4: SEED Position */ -#define TRNG_SEED4_SEED_Msk (0xfffffffful << TRNG_SEED4_SEED_Pos) /*!< TRNG_T::SEED4: SEED Mask */ - -#define TRNG_SEED5_SEED_Pos (0) /*!< TRNG_T::SEED5: SEED Position */ -#define TRNG_SEED5_SEED_Msk (0xfffffffful << TRNG_SEED5_SEED_Pos) /*!< TRNG_T::SEED5: SEED Mask */ - -#define TRNG_SEED6_SEED_Pos (0) /*!< TRNG_T::SEED6: SEED Position */ -#define TRNG_SEED6_SEED_Msk (0xfffffffful << TRNG_SEED6_SEED_Pos) /*!< TRNG_T::SEED6: SEED Mask */ - -#define TRNG_SEED7_SEED_Pos (0) /*!< TRNG_T::SEED7: SEED Position */ -#define TRNG_SEED7_SEED_Msk (0xfffffffful << TRNG_SEED7_SEED_Pos) /*!< TRNG_T::SEED7: SEED Mask */ - -#define TRNG_SEED8_SEED_Pos (0) /*!< TRNG_T::SEED8: SEED Position */ -#define TRNG_SEED8_SEED_Msk (0xfffffffful << TRNG_SEED8_SEED_Pos) /*!< TRNG_T::SEED8: SEED Mask */ - -#define TRNG_SEED9_SEED_Pos (0) /*!< TRNG_T::SEED9: SEED Position */ -#define TRNG_SEED9_SEED_Msk (0xfffffffful << TRNG_SEED9_SEED_Pos) /*!< TRNG_T::SEED9: SEED Mask */ - -#define TRNG_SEED10_SEED_Pos (0) /*!< TRNG_T::SEED10: SEED Position */ -#define TRNG_SEED10_SEED_Msk (0xfffffffful << TRNG_SEED10_SEED_Pos) /*!< TRNG_T::SEED10: SEED Mask */ - -#define TRNG_SEED11_SEED_Pos (0) /*!< TRNG_T::SEED11: SEED Position */ -#define TRNG_SEED11_SEED_Msk (0xfffffffful << TRNG_SEED11_SEED_Pos) /*!< TRNG_T::SEED11: SEED Mask */ - -#define TRNG_TIME_TO_SEED_TTS_Pos (0) /*!< TRNG_T::TIME_TO_SEED: TTS Position */ -#define TRNG_TIME_TO_SEED_TTS_Msk (0xfffffffful << TRNG_TIME_TO_SEED_TTS_Pos) /*!< TRNG_T::TIME_TO_SEED: TTS Mask */ - -#define TRNG_BUILD_CFG0_CORE_TYPE_Pos (0) /*!< TRNG_T::BUILD_CFG0: CORE_TYPE Position */ -#define TRNG_BUILD_CFG0_CORE_TYPE_Msk (0x3ul << TRNG_BUILD_CFG0_CORE_TYPE_Pos) /*!< TRNG_T::BUILD_CFG0: CORE_TYPE Mask */ - -#define TRNG_BUILD_CFG0_BG8_Pos (7) /*!< TRNG_T::BUILD_CFG0: BG8 Position */ -#define TRNG_BUILD_CFG0_BG8_Msk (0x1ul << TRNG_BUILD_CFG0_BG8_Pos) /*!< TRNG_T::BUILD_CFG0: BG8 Mask */ - -#define TRNG_BUILD_CFG0_CDC_SYNC_DEPTH_Pos (8) /*!< TRNG_T::BUILD_CFG0: CDC_SYNC_DEPTH Position*/ -#define TRNG_BUILD_CFG0_CDC_SYNC_DEPTH_Msk (0x3ul << TRNG_BUILD_CFG0_CDC_SYNC_DEPTH_Pos) /*!< TRNG_T::BUILD_CFG0: CDC_SYNC_DEPTH Mask*/ - -#define TRNG_BUILD_CFG0_BACKGROUND_NOISE_Pos (10) /*!< TRNG_T::BUILD_CFG0: BACKGROUND_NOISE Position*/ -#define TRNG_BUILD_CFG0_BACKGROUND_NOISE_Msk (0x1ul << TRNG_BUILD_CFG0_BACKGROUND_NOISE_Pos) /*!< TRNG_T::BUILD_CFG0: BACKGROUND_NOISE Mask*/ - -#define TRNG_BUILD_CFG0_EDU_PRESENT_Pos (11) /*!< TRNG_T::BUILD_CFG0: EDU_PRESENT Position*/ -#define TRNG_BUILD_CFG0_EDU_PRESENT_Msk (0x1ul << TRNG_BUILD_CFG0_EDU_PRESENT_Pos) /*!< TRNG_T::BUILD_CFG0: EDU_PRESENT Mask */ - -#define TRNG_BUILD_CFG0_AES_DATAPATH_Pos (12) /*!< TRNG_T::BUILD_CFG0: AES_DATAPATH Position*/ -#define TRNG_BUILD_CFG0_AES_DATAPATH_Msk (0x1ul << TRNG_BUILD_CFG0_AES_DATAPATH_Pos) /*!< TRNG_T::BUILD_CFG0: AES_DATAPATH Mask */ - -#define TRNG_BUILD_CFG0_AES_MAX_KEY_SIZE_Pos (13) /*!< TRNG_T::BUILD_CFG0: AES_MAX_KEY_SIZE Position*/ -#define TRNG_BUILD_CFG0_AES_MAX_KEY_SIZE_Msk (0x1ul << TRNG_BUILD_CFG0_AES_MAX_KEY_SIZE_Pos) /*!< TRNG_T::BUILD_CFG0: AES_MAX_KEY_SIZE Mask*/ - -#define TRNG_BUILD_CFG0_PERSONALIZATION_STR_Pos (14) /*!< TRNG_T::BUILD_CFG0: PERSONALIZATION_STR Position*/ -#define TRNG_BUILD_CFG0_PERSONALIZATION_STR_Msk (0x1ul << TRNG_BUILD_CFG0_PERSONALIZATION_STR_Pos) /*!< TRNG_T::BUILD_CFG0: PERSONALIZATION_STR Mask*/ - -#define TRNG_BUILD_CFG1_NUM_RAW_NOISE_BLKS_Pos (0) /*!< TRNG_T::BUILD_CFG1: NUM_RAW_NOISE_BLKS Position*/ -#define TRNG_BUILD_CFG1_NUM_RAW_NOISE_BLKS_Msk (0xfful << TRNG_BUILD_CFG1_NUM_RAW_NOISE_BLKS_Pos) /*!< TRNG_T::BUILD_CFG1: NUM_RAW_NOISE_BLKS Mask*/ - -#define TRNG_BUILD_CFG1_STICKY_STARTUP_Pos (8) /*!< TRNG_T::BUILD_CFG1: STICKY_STARTUP Position*/ -#define TRNG_BUILD_CFG1_STICKY_STARTUP_Msk (0x1ul << TRNG_BUILD_CFG1_STICKY_STARTUP_Pos) /*!< TRNG_T::BUILD_CFG1: STICKY_STARTUP Mask*/ - -#define TRNG_BUILD_CFG1_AUTO_CORRELATION_TEST_Pos (12) /*!< TRNG_T::BUILD_CFG1: AUTO_CORRELATION_TEST Position*/ -#define TRNG_BUILD_CFG1_AUTO_CORRELATION_TEST_Msk (0x1ul << TRNG_BUILD_CFG1_AUTO_CORRELATION_TEST_Pos) /*!< TRNG_T::BUILD_CFG1: AUTO_CORRELATION_TEST Mask*/ - -#define TRNG_BUILD_CFG1_MONOBIT_TEST_Pos (13) /*!< TRNG_T::BUILD_CFG1: MONOBIT_TEST Position*/ -#define TRNG_BUILD_CFG1_MONOBIT_TEST_Msk (0x1ul << TRNG_BUILD_CFG1_MONOBIT_TEST_Pos) /*!< TRNG_T::BUILD_CFG1: MONOBIT_TEST Mask */ - -#define TRNG_BUILD_CFG1_RUN_TEST_Pos (14) /*!< TRNG_T::BUILD_CFG1: RUN_TEST Position */ -#define TRNG_BUILD_CFG1_RUN_TEST_Msk (0x1ul << TRNG_BUILD_CFG1_RUN_TEST_Pos) /*!< TRNG_T::BUILD_CFG1: RUN_TEST Mask */ - -#define TRNG_BUILD_CFG1_POKER_TEST_Pos (15) /*!< TRNG_T::BUILD_CFG1: POKER_TEST Position*/ -#define TRNG_BUILD_CFG1_POKER_TEST_Msk (0x1ul << TRNG_BUILD_CFG1_POKER_TEST_Pos) /*!< TRNG_T::BUILD_CFG1: POKER_TEST Mask */ - -#define TRNG_BUILD_CFG1_RAW_HT_ADAP_TEST_Pos (16) /*!< TRNG_T::BUILD_CFG1: RAW_HT_ADAP_TEST Position*/ -#define TRNG_BUILD_CFG1_RAW_HT_ADAP_TEST_Msk (0x7ul << TRNG_BUILD_CFG1_RAW_HT_ADAP_TEST_Pos) /*!< TRNG_T::BUILD_CFG1: RAW_HT_ADAP_TEST Mask*/ - -#define TRNG_BUILD_CFG1_RAW_HT_REP_TEST_Pos (19) /*!< TRNG_T::BUILD_CFG1: RAW_HT_REP_TEST Position*/ -#define TRNG_BUILD_CFG1_RAW_HT_REP_TEST_Msk (0x1ul << TRNG_BUILD_CFG1_RAW_HT_REP_TEST_Pos) /*!< TRNG_T::BUILD_CFG1: RAW_HT_REP_TEST Mask*/ - -#define TRNG_BUILD_CFG1_ENT_SRC_REP_SMPL_SIZE_Pos (20) /*!< TRNG_T::BUILD_CFG1: ENT_SRC_REP_SMPL_SIZE Position*/ -#define TRNG_BUILD_CFG1_ENT_SRC_REP_SMPL_SIZE_Msk (0x7ul << TRNG_BUILD_CFG1_ENT_SRC_REP_SMPL_SIZE_Pos) /*!< TRNG_T::BUILD_CFG1: ENT_SRC_REP_SMPL_SIZE Mask*/ - -#define TRNG_BUILD_CFG1_ENT_SRC_REP_TEST_Pos (23) /*!< TRNG_T::BUILD_CFG1: ENT_SRC_REP_TEST Position*/ -#define TRNG_BUILD_CFG1_ENT_SRC_REP_TEST_Msk (0x1ul << TRNG_BUILD_CFG1_ENT_SRC_REP_TEST_Pos) /*!< TRNG_T::BUILD_CFG1: ENT_SRC_REP_TEST Mask*/ - -#define TRNG_BUILD_CFG1_ENT_SRC_REP_MIN_ENTROPY_Pos (24) /*!< TRNG_T::BUILD_CFG1: ENT_SRC_REP_MIN_ENTROPY Position*/ -#define TRNG_BUILD_CFG1_ENT_SRC_REP_MIN_ENTROPY_Msk (0x7ful << TRNG_BUILD_CFG1_ENT_SRC_REP_MIN_ENTROPY_Pos) /*!< TRNG_T::BUILD_CFG1: ENT_SRC_REP_MIN_ENTROPY Mask*/ - -/**@}*/ /* TRNG_CONST */ -/**@}*/ /* end of TRNG register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __TRNG_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/uart_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/uart_reg.h deleted file mode 100644 index 299b1fb8732..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/uart_reg.h +++ /dev/null @@ -1,1061 +0,0 @@ -/**************************************************************************//** - * @file uart_reg.h - * @brief UART register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UART_REG_H__ -#define __UART_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup UART Universal Asynchronous Receiver/Transmitter Controller(UART) - Memory Mapped Structure for UART Controller -@{ */ - -typedef struct -{ - - - /** - * @var UART_T::DAT - * Offset: 0x00 UART Receive/Transmit Buffer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |DAT |Data Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing one byte to this register, the data byte will be stored in transmitter FIFO - * | | |The UART controller will send out the data stored in transmitter FIFO top location through the UART_TXD. - * | | |Read Operation: - * | | |By reading this register, the UART controller will return an 8-bit data received from receiver FIFO. - * |[8] |PARITY |Parity Bit Receive/Transmit Buffer - * | | |Write Operation: - * | | |By writing to this bit, the parity bit will be stored in transmitter FIFO - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set, - * | | |the UART controller will send out this bit follow the DAT (UART_DAT[7:0]) through the UART_TXD. - * | | |Read Operation: - * | | |If PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are enabled, the parity bit can be read by this bit. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) and PSS (UART_LINE[7]) are set. - * @var UART_T::INTEN - * Offset: 0x04 UART Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIEN |Receive Data Available Interrupt Enable Bit - * | | |0 = Receive data available interrupt Disabled. - * | | |1 = Receive data available interrupt Enabled. - * |[1] |THREIEN |Transmit Holding Register Empty Interrupt Enable Bit - * | | |0 = Transmit holding register empty interrupt Disabled. - * | | |1 = Transmit holding register empty interrupt Enabled. - * |[2] |RLSIEN |Receive Line Status Interrupt Enable Bit - * | | |0 = Receive Line Status interrupt Disabled. - * | | |1 = Receive Line Status interrupt Enabled. - * |[3] |MODEMIEN |Modem Status Interrupt Enable Bit - * | | |0 = Modem status interrupt Disabled. - * | | |1 = Modem status interrupt Enabled. - * |[4] |RXTOIEN |RX Time-out Interrupt Enable Bit - * | | |0 = RX time-out interrupt Disabled. - * | | |1 = RX time-out interrupt Enabled. - * |[5] |BUFEIEN |Buffer Error Interrupt Enable Bit - * | | |0 = Buffer error interrupt Disabled. - * | | |1 = Buffer error interrupt Enabled. - * |[6] |WKIEN |Wake-up Interrupt Enable Bit - * | | |0 = Wake-up Interrupt Disabled. - * | | |1 = Wake-up Interrupt Enabled. - * |[11] |TOCNTEN |Receive Buffer Time-out Counter Enable Bit - * | | |0 = Receive Buffer Time-out counter Disabled. - * | | |1 = Receive Buffer Time-out counter Enabled. - * |[12] |ATORTSEN |nRTS Auto-flow Control Enable Bit - * | | |0 = nRTS auto-flow control Disabled. - * | | |1 = nRTS auto-flow control Enabled. - * | | |Note: When nRTS auto-flow is enabled, if the number of bytes in the RX FIFO equals the RTSTRGLV (UART_FIFO[19:16]), the UART will de-assert nRTS signal. - * |[13] |ATOCTSEN |nCTS Auto-flow Control Enable Bit - * | | |0 = nCTS auto-flow control Disabled. - * | | |1 = nCTS auto-flow control Enabled. - * | | |Note: When nCTS auto-flow is enabled, the UART will send data to external device if nCTS input assert (UART will not send data to device until nCTS is asserted). - * |[14] |TXPDMAEN |TX PDMA Enable Bit - * | | |0 = TX PDMA Disabled. - * | | |1 = TX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]), UART PDMA transmit request operation is stopped - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing '1' to corresponding BIF, FEF and PEF to make UART PDMA transmit request operation continue. - * |[15] |RXPDMAEN |RX PDMA Enable Bit - * | | |This bit can enable or disable RX PDMA service. - * | | |0 = RX PDMA Disabled. - * | | |1 = RX PDMA Enabled. - * | | |Note: If RLSIEN (UART_INTEN[2]) is enabled and HWRLSINT (UART_INTSTS[26]) is set to 1, the RLS (Receive Line Status) Interrupt is caused - * | | |If RLS interrupt is caused by Break Error Flag BIF(UART_FIFOSTS[6]), Frame Error Flag FEF(UART_FIFO[5]) or Parity Error Flag PEF(UART_FIFOSTS[4]), UART PDMA receive request operation is stopped - * | | |Clear Break Error Flag BIF or Frame Error Flag FEF or Parity Error Flag PEF by writing '1' to corresponding BIF, FEF and PEF to make UART PDMA receive request operation continue. - * |[16] |SWBEIEN |Single-wire Bit Error Detection Interrupt Enable Bit - * | | |Set this bit, the Single-wire Half Duplex Bit Error Detection Interrupt SWBEINT(UART_INTSTS[24]) is generated when Single-wire Bit Error Detection SWBEIF(UART_INTSTS[16]) is set. - * | | |0 = Single-wire Bit Error Detect Interrupt Disabled. - * | | |1 = Single-wire Bit Error Detect Interrupt Enabled. - * | | |Note: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * |[18] |ABRIEN |Auto-baud Rate Interrupt Enable Bit - * | | |0 = Auto-baud rate interrupt Disabled. - * | | |1 = Auto-baud rate interrupt Enabled. - * |[22] |TXENDIEN |Transmitter Empty Interrupt Enable Bit - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt TXENDINT (UART_INTSTS[30]) will be generated when TXENDIF (UART_INTSTS[22]) is set (TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted). - * | | |0 = Transmitter empty interrupt Disabled. - * | | |1 = Transmitter empty interrupt Enabled. - * @var UART_T::FIFO - * Offset: 0x08 UART FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RXRST |RX Field Software Reset - * | | |When RXRST (UART_FIFO[1]) is set, all the byte in the receiver FIFO and RX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the RX internal state machine and pointers. - * | | |Note 1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note 2: Before setting this bit, it should wait for the RXIDLE (UART_FIFOSTS[29]) be set. - * |[2] |TXRST |TX Field Software Reset - * | | |When TXRST (UART_FIFO[2]) is set, all the byte in the transmit FIFO and TX internal state machine are cleared. - * | | |0 = No effect. - * | | |1 = Reset the TX internal state machine and pointers. - * | | |Note 1: This bit will automatically clear at least 3 UART peripheral clock cycles. - * | | |Note 2: Before setting this bit, it should wait for the TXEMPTYF (UART_FIFOSTS[28]) be set. - * |[7:4] |RFITL |RX FIFO Interrupt Trigger Level - * | | |When the number of bytes in the receive FIFO equals the RFITL, the RDAIF (UART_INTSTS[0]) will be set (if RDAIEN (UART_INTEN [0]) enabled, and an interrupt will be generated). - * | | |0000 = RX FIFO Interrupt Trigger Level is 1 byte. - * | | |0001 = RX FIFO Interrupt Trigger Level is 4 bytes. - * | | |0010 = RX FIFO Interrupt Trigger Level is 8 bytes. - * | | |0011 = RX FIFO Interrupt Trigger Level is 14 bytes. - * | | |Others = Reserved. - * |[8] |RXOFF |Receiver Disable Bit - * | | |The receiver is disabled or not (set 1 to disable receiver). - * | | |0 = Receiver Enabled. - * | | |1 = Receiver Disabled. - * | | |Note: This bit is used for RS-485 Normal Multi-drop mode - * | | |It should be programmed before RS485NMM (UART_ALTCTL [8]) is programmed. - * |[19:16] |RTSTRGLV |nRTS Trigger Level for Auto-flow Control - * | | |0000 = nRTS Trigger Level is 1 byte. - * | | |0001 = nRTS Trigger Level is 4 bytes. - * | | |0010 = nRTS Trigger Level is 8 bytes. - * | | |0011 = nRTS Trigger Level is 14 bytes. - * | | |Others = Reserved. - * | | |Note: This field is used for auto nRTS flow control. - * @var UART_T::LINE - * Offset: 0x0C UART Line Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |WLS |Word Length Selection - * | | |This field sets UART word length. - * | | |00 = 5 bits. - * | | |01 = 6 bits. - * | | |10 = 7 bits. - * | | |11 = 8 bits. - * |[2] |NSB |Number of 'STOP Bit' - * | | |0 = One 'STOP bit' is generated in the transmitted data. - * | | |1 = When select 5-bit word length, 1.5 'STOP bit' is generated in the transmitted data - * | | |When select 6-, 7- and 8-bit word length, 2 'STOP bit' is generated in the transmitted data. - * |[3] |PBE |Parity Bit Enable Bit - * | | |0 = Parity bit generated Disabled. - * | | |1 = Parity bit generated Enabled. - * | | |Note: Parity bit is generated on each outgoing character and is checked on each incoming data. - * |[4] |EPE |Even Parity Enable Bit - * | | |0 = Odd number of logic 1's is transmitted and checked in each word. - * | | |1 = Even number of logic 1's is transmitted and checked in each word. - * | | |Note: This bit has effect only when PBE (UART_LINE[3]) is set. - * |[5] |SPE |Stick Parity Enable Bit - * | | |0 = Stick parity Disabled. - * | | |1 = Stick parity Enabled. - * | | |Note: If PBE (UART_LINE[3]) and EPE (UART_LINE[4]) are logic 1, the parity bit is transmitted and checked as logic 0 - * | | |If PBE (UART_LINE[3]) is 1 and EPE (UART_LINE[4]) is 0 then the parity bit is transmitted and checked as 1. - * |[6] |BCB |Break Control Bit - * | | |0 = Break Control Disabled. - * | | |1 = Break Control Enabled. - * | | |Note: When this bit is set to logic 1, the transmitted serial data output (TX) is forced to the Spacing State (logic 0) - * | | |This bit acts only on TX line and has no effect on the transmitter logic. - * |[7] |PSS |Parity Bit Source Selection - * | | |The parity bit can be selected to be generated and checked automatically or by software. - * | | |0 = Parity bit is generated by EPE (UART_LINE[4]) and SPE (UART_LINE[5]) setting and checked automatically. - * | | |1 = Parity bit generated and checked by software. - * | | |Note 1: This bit has effect only when PBE (UART_LINE[3]) is set. - * | | |Note 2: If PSS is 0, the parity bit is transmitted and checked automatically - * | | |If PSS is 1, the transmitted parity bit value can be determined by writing PARITY (UART_DAT[8]) and the parity bit can be read by reading PARITY (UART_DAT[8]). - * |[8] |TXDINV |TX Data Inverted - * | | |0 = Transmitted data signal inverted Disabled. - * | | |1 = Transmitted data signal inverted Enabled. - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select UART or RS485 function. - * |[9] |RXDINV |RX Data Inverted - * | | |0 = Received data signal inverted Disabled. - * | | |1 = Received data signal inverted Enabled. - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select UART, LIN or RS485 function. - * @var UART_T::MODEM - * Offset: 0x10 UART Modem Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RTS |nRTS Signal Control - * | | |This bit is direct control internal nRTS (Request-to-send) signal active or not, and then drive the nRTS pin output with RTSACTLV bit configuration. - * | | |0 = nRTS signal is active. - * | | |1 = nRTS signal is inactive. - * | | |Note 1: The nRTS signal control bit is not effective when nRTS auto-flow control is enabled in UART function mode. - * | | |Note 2: The nRTS signal control bit is not effective when RS-485 auto direction mode (AUD) is enabled in RS-485 function mode. - * | | |Note 3: Single-wire mode is support this feature. - * |[9] |RTSACTLV |nRTS Pin Active Level - * | | |This bit defines the active level state of nRTS pin output. - * | | |0 = nRTS pin output is high level active. - * | | |1 = nRTS pin output is low level active. (Default) - * | | |Note 1: Refer to Figure 6.24-13 and Figure 6.24-14 for UART function mode. - * | | |Note 2: Refer to Figure 6.24-17 and Figure 6.24-18 for RS-485 function mode. - * | | |Note 3: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * |[13] |RTSSTS |nRTS Pin Status (Read Only) - * | | |This bit mirror from nRTS pin output of voltage logic status. - * | | |0 = nRTS pin output is low level voltage logic state. - * | | |1 = nRTS pin output is high level voltage logic state. - * @var UART_T::MODEMSTS - * Offset: 0x14 UART Modem Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSDETF |Detect nCTS State Change Flag - * | | |This bit is set whenever nCTS input has change state, and it will generate Modem interrupt to CPU when MODEMIEN (UART_INTEN [3]) is set to 1. - * | | |0 = nCTS input has not change state. - * | | |1 = nCTS input has change state. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[4] |CTSSTS |nCTS Pin Status (Read Only) - * | | |This bit mirror from nCTS pin input of voltage logic status. - * | | |0 = nCTS pin input is low level voltage logic state. - * | | |1 = nCTS pin input is high level voltage logic state. - * | | |Note: This bit echoes when UART controller peripheral clock is enabled, and nCTS multi-function port is selected. - * |[8] |CTSACTLV |nCTS Pin Active Level - * | | |This bit defines the active level state of nCTS pin input. - * | | |0 = nCTS pin input is high level active. - * | | |1 = nCTS pin input is low level active. (Default) - * | | |Note: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * @var UART_T::FIFOSTS - * Offset: 0x18 UART FIFO Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXOVIF |RX Overflow Error Interrupt Flag - * | | |This bit is set when RX FIFO overflow. - * | | |If the number of bytes of received data is greater than RX_FIFO (UART_DAT) size 16 bytes, this bit will be set. - * | | |0 = RX FIFO is not overflow. - * | | |1 = RX FIFO is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[1] |ABRDIF |Auto-baud Rate Detect Interrupt Flag - * | | |This bit is set to logic '1' when auto-baud rate detect function is finished. - * | | |0 = Auto-baud rate detect function is not finished. - * | | |1 = Auto-baud rate detect function is finished. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[2] |ABRDTOIF |Auto-baud Rate Detect Time-out Interrupt Flag - * | | |This bit is set to logic '1' in Auto-baud Rate Detect mode when the baud rate counter is overflow. - * | | |0 = Auto-baud rate counter is underflow. - * | | |1 = Auto-baud rate counter is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[3] |ADDRDETF |RS-485 Address Byte Detect Flag - * | | |0 = Receiver detects a data that is not an address bit (bit 9 ='0'). - * | | |1 = Receiver detects a data that is an address bit (bit 9 ='1'). - * | | |Note 1: This field is used for RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1 to enable Address detection mode. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[4] |PEF |Parity Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'parity bit'. - * | | |0 = No parity error is generated. - * | | |1 = Parity error is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[5] |FEF |Framing Error Flag - * | | |This bit is set to logic 1 whenever the received character does not have a valid 'stop bit' - * | | |(that is, the stop bit following the last data bit or parity bit is detected as logic 0). - * | | |0 = No framing error is generated. - * | | |1 = Framing error is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[6] |BIF |Break Interrupt Flag - * | | |This bit is set to logic 1 whenever the received data input (RX) is held in the 'spacing state' (logic 0) - * | | |for longer than a full word transmission time (that is, the total time of 'start bit' + data bits + parity + stop bits). - * | | |0 = No Break interrupt is generated. - * | | |1 = Break interrupt is generated. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[13:8] |RXPTR |RX FIFO Pointer (Read Only) - * | | |This field indicates the RX FIFO Buffer Pointer - * | | |When UART receives one byte from external device, RXPTR increases one - * | | |When one byte of RX FIFO is read by CPU, RXPTR decreases one. - * | | |The Maximum value shown in RXPTR is 15 - * | | |When the using level of RX FIFO Buffer equal to 16, the RXFULL bit is set to 1 and RXPTR will show 0 - * | | |As one byte of RX FIFO is read by CPU, the RXFULL bit is cleared to 0 and RXPTR will show 15 - * |[14] |RXEMPTY |Receiver FIFO Empty (Read Only) - * | | |This bit initiate RX FIFO empty or not. - * | | |0 = RX FIFO is not empty. - * | | |1 = RX FIFO is empty. - * | | |Note: When the last byte of RX FIFO has been read by CPU, hardware sets this bit high - * | | |It will be cleared when UART receives any new data. - * |[15] |RXFULL |Receiver FIFO Full (Read Only) - * | | |This bit initiates RX FIFO full or not. - * | | |0 = RX FIFO is not full. - * | | |1 = RX FIFO is full. - * | | |Note: This bit is set when the number of usage in RX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[21:16] |TXPTR |TX FIFO Pointer (Read Only) - * | | |This field indicates the TX FIFO Buffer Pointer - * | | |When CPU writes one byte into UART_DAT, TXPTR increases one - * | | |When one byte of TX FIFO is transferred to Transmitter Shift Register, TXPTR decreases one. - * | | |The Maximum value shown in TXPTR is 15 - * | | |When the using level of TX FIFO Buffer equal to 16, the TXFULL bit is set to 1 and TXPTR will show 0 - * | | |As one byte of TX FIFO is transferred to Transmitter Shift Register, the TXFULL bit is cleared to 0 and TXPTR will show 15 - * |[22] |TXEMPTY |Transmitter FIFO Empty (Read Only) - * | | |This bit indicates TX FIFO empty or not. - * | | |0 = TX FIFO is not empty. - * | | |1 = TX FIFO is empty. - * | | |Note: When the last byte of TX FIFO has been transferred to Transmitter Shift Register, hardware sets this bit high - * | | |It will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[23] |TXFULL |Transmitter FIFO Full (Read Only) - * | | |This bit indicates TX FIFO full or not. - * | | |0 = TX FIFO is not full. - * | | |1 = TX FIFO is full. - * | | |Note: This bit is set when the number of usage in TX FIFO Buffer is equal to 16, otherwise it is cleared by hardware. - * |[24] |TXOVIF |TX Overflow Error Interrupt Flag - * | | |If TX FIFO (UART_DAT) is full, an additional write to UART_DAT will cause this bit to logic 1. - * | | |0 = TX FIFO is not overflow. - * | | |1 = TX FIFO is overflow. - * | | |Note: This bit can be cleared by writing '1' to it. - * |[28] |TXEMPTYF |Transmitter Empty Flag (Read Only) - * | | |This bit is set by hardware when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted. - * | | |0 = TX FIFO is not empty or the STOP bit of the last byte has been not transmitted. - * | | |1 = TX FIFO is empty and the STOP bit of the last byte has been transmitted. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[29] |RXIDLE |RX Idle Status (Read Only) - * | | |This bit is set by hardware when RX is idle. - * | | |0 = RX is busy. - * | | |1 = RX is idle. (Default) - * |[31] |TXRXACT |TX and RX Active Status (Read Only) - * | | |This bit indicates TX and RX are active or inactive. - * | | |0 = TX and RX are inactive. - * | | |1 = TX and RX are active. (Default) - * | | |Note: When TXRXDIS (UART_FUNCSEL[3]) is set and both TX and RX are in idle state, this bit is cleared - * | | |The UART controller cannot transmit or receive data at this moment - * | | |Otherwise this bit is set. - * @var UART_T::INTSTS - * Offset: 0x1C UART Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RDAIF |Receive Data Available Interrupt Flag - * | | |When the number of bytes in the RX FIFO equals the RFITL then the RDAIF(UART_INTSTS[0]) will be set - * | | |If RDAIEN (UART_INTEN [0]) is enabled, the RDA interrupt will be generated. - * | | |0 = No RDA interrupt flag is generated. - * | | |1 = RDA interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when the number of unread bytes of RX FIFO drops below the threshold level (RFITL(UART_FIFO[7:4]). - * |[1] |THREIF |Transmit Holding Register Empty Interrupt Flag - * | | |This bit is set when the last data of TX FIFO is transferred to Transmitter Shift Register - * | | |If THREIEN (UART_INTEN[1]) is enabled, the THRE interrupt will be generated. - * | | |0 = No THRE interrupt flag is generated. - * | | |1 = THRE interrupt flag is generated. - * | | |Note: This bit is read only and it will be cleared when writing data into UART_DAT (TX FIFO not empty). - * |[2] |RLSIF |Receive Line Interrupt Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]), is set) - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated. - * | | |1 = RLS interrupt flag is generated. - * | | |Note 1: In RS-485 function mode, this field is set include "receiver detect and received address byte character (bit9 = '1') bit" - * | | |At the same time, the bit of ADDRDETF (UART_FIFOSTS[3]) is also set. - * | | |Note 2: This bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note 3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF (UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared. - * |[3] |MODEMIF |MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS[0]) = 1) - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated. - * | | |1 = Modem interrupt flag is generated. - * | | |Note: This bit is read only and reset to 0 when bit CTSDETF is cleared by a write 1 on CTSDETF(UART_MODEMSTS[0]). - * |[4] |RXTOIF |RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]) - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated. - * | | |0 = No RX time-out interrupt flag is generated. - * | | |1 = RX time-out interrupt flag is generated. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[5] |BUFEIF |Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX FIFO or RX FIFO overflows (TXOVIF (UART_FIFOSTS[24]) or RXOVIF (UART_FIFOSTS[0]) is set) - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer is not correct - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated. - * | | |1 = Buffer error interrupt flag is generated. - * | | |Note: This bit is cleared if both of RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]) are cleared to 0 by writing 1 to RXOVIF(UART_FIFOSTS[0]) and TXOVIF(UART_FIFOSTS[24]). - * |[6] |WKIF |UART Wake-up Interrupt Flag (Read Only) - * | | |This bit is set when TOUTWKF (UART_WKSTS[4]), RS485WKF (UART_WKSTS[3]), RFRTWKF (UART_WKSTS[2]), DATWKF (UART_WKSTS[1]) or CTSWKF(UART_WKSTS[0]) is set to 1. - * | | |0 = No UART wake-up interrupt flag is generated. - * | | |1 = UART wake-up interrupt flag is generated. - * | | |Note: This bit is cleared if all of TOUTWKF, RS485WKF, RFRTWKF, DATWKF and CTSWKF are cleared to 0 by writing 1 to the corresponding interrupt flag. - * |[8] |RDAINT |Receive Data Available Interrupt Indicator (Read Only) - * | | |This bit is set if RDAIEN (UART_INTEN[0]) and RDAIF (UART_INTSTS[0]) are both set to 1. - * | | |0 = No RDA interrupt is generated. - * | | |1 = RDA interrupt is generated. - * |[9] |THREINT |Transmit Holding Register Empty Interrupt Indicator (Read Only) - * | | |This bit is set if THREIEN (UART_INTEN[1]) and THREIF(UART_INTSTS[1]) are both set to 1. - * | | |0 = No THRE interrupt is generated. - * | | |1 = THRE interrupt is generated. - * |[10] |RLSINT |Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and RLSIF(UART_INTSTS[2]) are both set to 1. - * | | |0 = No RLS interrupt is generated. - * | | |1 = RLS interrupt is generated. - * |[11] |MODEMINT |MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN(UART_INTEN[3]) and MODEMIF(UART_INTSTS[3]) are both set to 1 - * | | |0 = No Modem interrupt is generated. - * | | |1 = Modem interrupt is generated. - * |[12] |RXTOINT |RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and RXTOIF(UART_INTSTS[4]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated. - * | | |1 = RX time-out interrupt is generated. - * |[13] |BUFEINT |Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN(UART_INTEN[5]) and BUFERRIF(UART_ INTSTS[5]) are both set to 1. - * | | |0 = No buffer error interrupt is generated. - * | | |1 = Buffer error interrupt is generated. - * |[14] |WKINT |UART Wake-up Interrupt Indicator (Read Only) - * | | |This bit is set if WKIEN (UART_INTEN[6]) and WKIF (UART_INTSTS[6]) are both set to 1. - * | | |0 = No UART wake-up interrupt is generated. - * | | |1 = UART wake-up interrupt is generated. - * |[16] |SWBEIF |Single-wire Bit Error Detection Interrupt Flag - * | | |This bit is set when the single wire bus state not equals to UART controller TX state in Single-wire mode. - * | | |0 = No single-wire bit error detection interrupt flag is generated. - * | | |1 = Single-wire bit error detection interrupt flag is generated. - * | | |Note 1: This bit is active when FUNCSEL (UART_FUNCSEL[2:0]) is select UART Single-wire mode. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[18] |PRLSIF |PDMA Mode Receive Line Status Flag (Read Only) - * | | |This bit is set when the RX receive data have parity error, frame error or break error (at least one of 3 bits, BIF (UART_FIFOSTS[6]), FEF (UART_FIFOSTS[5]) and PEF (UART_FIFOSTS[4]) is set) - * | | |If RLSIEN (UART_INTEN [2]) is enabled, the RLS interrupt will be generated. - * | | |0 = No RLS interrupt flag is generated in PDMA mode. - * | | |1 = RLS interrupt flag is generated in PDMA mode. - * | | |Note 1: In RS-485 function mode, this field include "receiver detect any address byte received address byte character (bit9 = '1') bit". - * | | |Note 2: In UART function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]) and PEF(UART_FIFOSTS[4]) are cleared. - * | | |Note 3: In RS-485 function mode, this bit is read only and reset to 0 when all bits of BIF(UART_FIFOSTS[6]), FEF(UART_FIFOSTS[5]), PEF(UART_FIFOSTS[4]) and ADDRDETF (UART_FIFOSTS[3]) are cleared - * |[19] |PMODIF |PDMA Mode MODEM Interrupt Flag (Read Only) - * | | |This bit is set when the nCTS pin has state change (CTSDETF (UART_MODEMSTS [0] =1)) - * | | |If MODEMIEN (UART_INTEN [3]) is enabled, the Modem interrupt will be generated. - * | | |0 = No Modem interrupt flag is generated in PDMA mode. - * | | |1 = Modem interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and reset to 0 when the bit CTSDETF (UART_MODEMSTS[0]) is cleared by writing 1 on CTSDETF (UART_MODEMSTS [0]). - * |[20] |PTOIF |PDMA Mode RX Time-out Interrupt Flag (Read Only) - * | | |This bit is set when the RX FIFO is not empty and no activities occurred in the RX FIFO and the time-out counter equal to TOIC (UART_TOUT[7:0]) - * | | |If RXTOIEN (UART_INTEN [4]) is enabled, the RX time-out interrupt will be generated . - * | | |0 = No RX time-out interrupt flag is generated in PDMA mode. - * | | |1 = RX time-out interrupt flag is generated in PDMA mode. - * | | |Note: This bit is read only and user can read UART_DAT (RX is in active) to clear it. - * |[21] |PBUFEIF |PDMA Mode Buffer Error Interrupt Flag (Read Only) - * | | |This bit is set when the TX or RX FIFO overflows (TXOVIF (UART_FIFOSTS [24]) or RXOVIF (UART_FIFOSTS[0]) is set) - * | | |When BUFERRIF (UART_INTSTS[5]) is set, the transfer maybe is not correct - * | | |If BUFERRIEN (UART_INTEN [5]) is enabled, the buffer error interrupt will be generated. - * | | |0 = No buffer error interrupt flag is generated in PDMA mode. - * | | |1 = Buffer error interrupt flag is generated in PDMA mode. - * | | |Note: This bit is cleared when both TXOVIF (UART_FIFOSTS[24]) and RXOVIF (UART_FIFOSTS[0]) are cleared. - * |[22] |TXENDIF |Transmitter Empty Interrupt Flag - * | | |This bit is set when TX FIFO (UART_DAT) is empty and the STOP bit of the last byte has been transmitted (TXEMPTYF (UART_FIFOSTS[28]) is set) - * | | |If TXENDIEN (UART_INTEN[22]) is enabled, the Transmitter Empty interrupt will be generated. - * | | |0 = No transmitter empty interrupt flag is generated. - * | | |1 = Transmitter empty interrupt flag is generated. - * | | |Note: This bit is cleared automatically when TX FIFO is not empty or the last byte transmission has not completed. - * |[24] |SWBEINT |Single-wire Bit Error Detect Interrupt Indicator (Read Only) - * | | |This bit is set if SWBEIEN (UART_INTEN[16]) and SWBEIF (UART_INTSTS[16]) are both set to 1. - * | | |0 = No Single-wire Bit Error Detection Interrupt generated. - * | | |1 = Single-wire Bit Error Detection Interrupt generated. - * |[26] |PRLSINT |PDMA Mode Receive Line Status Interrupt Indicator (Read Only) - * | | |This bit is set if RLSIEN (UART_INTEN[2]) and HWRLSIF(UART_INTSTS[18]) are both set to 1. - * | | |0 = No RLS interrupt is generated in PDMA mode. - * | | |1 = RLS interrupt is generated in PDMA mode. - * |[27] |PMODINT |PDMA Mode MODEM Status Interrupt Indicator (Read Only) - * | | |This bit is set if MODEMIEN (UART_INTEN[3]) and HWMODIF(UART_INTSTS[19]) are both set to 1. - * | | |0 = No Modem interrupt is generated in PDMA mode. - * | | |1 = Modem interrupt is generated in PDMA mode. - * |[28] |PTOINT |PDMA Mode RX Time-out Interrupt Indicator (Read Only) - * | | |This bit is set if RXTOIEN (UART_INTEN[4]) and HWTOIF(UART_INTSTS[20]) are both set to 1. - * | | |0 = No RX time-out interrupt is generated in PDMA mode. - * | | |1 = RX time-out interrupt is generated in PDMA mode. - * |[29] |PBUFEINT |PDMA Mode Buffer Error Interrupt Indicator (Read Only) - * | | |This bit is set if BUFERRIEN (UART_INTEN[5]) and HWBUFEIF (UART_INTSTS[21]) are both set to 1. - * | | |0 = No buffer error interrupt is generated in PDMA mode. - * | | |1 = Buffer error interrupt is generated in PDMA mode. - * |[30] |TXENDINT |Transmitter Empty Interrupt Indicator (Read Only) - * | | |This bit is set if TXENDIEN (UART_INTEN[22]) and TXENDIF(UART_INTSTS[22]) are both set to 1. - * | | |0 = No Transmitter Empty interrupt is generated. - * | | |1 = Transmitter Empty interrupt is generated. - * |[31] |ABRINT |Auto-baud Rate Interrupt Indicator (Read Only) - * | | |This bit is set if ABRIEN (UART_INTEN[18]) and ABRIF (UART_ALTCTL[17]) are both set to 1. - * | | |0 = No Auto-baud Rate interrupt is generated. - * | | |1 = The Auto-baud Rate interrupt is generated. - * @var UART_T::TOUT - * Offset: 0x20 UART Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |TOIC |Time-out Interrupt Comparator - * | | |The time-out counter resets and starts counting (the counting clock = baud rate) whenever the RX FIFO receives a new data word if time out counter is enabled by setting TOCNTEN (UART_INTEN[11]) - * | | |Once the content of time-out counter is equal to that of time-out interrupt comparator (TOIC (UART_TOUT[7:0])), a receiver time-out interrupt (RXTOINT(UART_INTSTS[12])) is generated if RXTOIEN (UART_INTEN [4]) enabled - * | | |A new incoming data word or RX FIFO empty will clear RXTOIF (UART_INTSTS[4]) - * | | |In order to avoid receiver time-out interrupt generation immediately during one character is being received, TOIC value should be set between 40 and 255 - * | | |So, for example, if TOIC is set with 40, the time-out interrupt is generated after four characters are not received when 1 stop bit and no parity check is set for UART transfer. - * |[15:8] |DLY |TX Delay Time Value - * | | |This field is used to programming the transfer delay time between the last stop bit and next start bit - * | | |The unit is bit time. - * @var UART_T::BAUD - * Offset: 0x24 UART Baud Rate Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |BRD |Baud Rate Divider - * | | |The field indicates the baud rate divider - * | | |This filed is used in baud rate calculation - * | | |The detail description is shown in Table 6.24-4. - * |[27:24] |EDIVM1 |Extra Divider for BAUD Rate Mode 1 - * | | |This field is used for baud rate calculation in mode 1 and has no effect for baud rate calculation in mode 0 and mode 2 - * | | |The detail description is shown in Table 6.24-4 - * |[28] |BAUDM0 |BAUD Rate Mode Selection Bit 0 - * | | |This bit is baud rate mode selection bit 0 - * | | |UART provides three baud rate calculation modes - * | | |This bit combines with BAUDM1 (UART_BAUD[29]) to select baud rate calculation mode - * | | |The detail description is shown in Table 6.24-4. - * |[29] |BAUDM1 |BAUD Rate Mode Selection Bit 1 - * | | |This bit is baud rate mode selection bit 1 - * | | |UART provides three baud rate calculation modes - * | | |This bit combines with BAUDM0 (UART_BAUD[28]) to select baud rate calculation mode - * | | |The detail description is shown in Table 6.24-4. - * | | |Note: In IrDA mode must be operated in mode 0. - * @var UART_T::IRDA - * Offset: 0x28 UART IrDA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |TXEN |IrDA Receiver/Transmitter Selection Enable Bit - * | | |0 = IrDA Transmitter Disabled and Receiver Enabled. (Default) - * | | |1 = IrDA Transmitter Enabled and Receiver Disabled. - * |[5] |TXINV |IrDA Inverse Transmitting Output Signal - * | | |0 = None inverse transmitting signal. (Default). - * | | |1 = Inverse transmitting output signal. - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select IrDA function. - * |[6] |RXINV |IrDA Inverse Receive Input Signal - * | | |0 = None inverse receiving input signal. - * | | |1 = Inverse receiving input signal. (Default) - * | | |Note 1: Before setting this bit, TXRXDIS (UART_FUNCSEL[3]) should be set then waited for TXRXACT (UART_FIFOSTS[31]) is cleared - * | | |When the configuration is done, cleared TXRXDIS (UART_FUNCSEL[3]) to activate UART controller. - * | | |Note 2: This bit is valid when FUNCSEL (UART_FUNCSEL[2:0]) is select IrDA function. - * @var UART_T::ALTCTL - * Offset: 0x2C UART Alternate Control/Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |RS485NMM |RS-485 Normal Multi-drop Operation Mode - * | | |0 = RS-485 Normal Multi-drop Operation mode (NMM) Disabled. - * | | |1 = RS-485 Normal Multi-drop Operation mode (NMM) Enabled. - * | | |Note: It cannot be active with RS-485_AAD operation mode. - * |[9] |RS485AAD |RS-485 Auto Address Detection Operation Mode - * | | |0 = RS-485 Auto Address Detection Operation mode (AAD) Disabled. - * | | |1 = RS-485 Auto Address Detection Operation mode (AAD) Enabled. - * | | |Note: It cannot be active with RS-485_NMM operation mode. - * |[10] |RS485AUD |RS-485 Auto Direction Function - * | | |0 = RS-485 Auto Direction Operation function (AUD) Disabled. - * | | |1 = RS-485 Auto Direction Operation function (AUD) Enabled. - * | | |Note: It can be active with RS-485_AAD or RS-485_NMM operation mode. - * |[15] |ADDRDEN |RS-485 Address Detection Enable Bit - * | | |This bit is used to enable RS-485 Address Detection mode. - * | | |0 = Address detection mode Disabled. - * | | |1 = Address detection mode Enabled. - * | | |Note: This bit is used for RS-485 any operation mode. - * |[17] |ABRIF |Auto-baud Rate Interrupt Flag (Read Only) - * | | |This bit is set when auto-baud rate detection function finished or the auto-baud rate counter was overflow and if ABRIEN(UART_INTEN [18]) is set then the auto-baud rate interrupt will be generated. - * | | |0 = No auto-baud rate interrupt flag is generated. - * | | |1 = Auto-baud rate interrupt flag is generated. - * | | |Note: This bit is read only, but it can be cleared by writing '1' to ABRDTOIF (UART_FIFOSTS[2]) and ABRDIF(UART_FIFOSTS[1]) - * |[18] |ABRDEN |Auto-baud Rate Detect Enable Bit - * | | |0 = Auto-baud rate detect function Disabled. - * | | |1 = Auto-baud rate detect function Enabled. - * | | |Note : This bit is cleared automatically after auto-baud detection is finished. - * |[20:19] |ABRDBITS |Auto-baud Rate Detect Bit Length - * | | |00 = 1-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x01. - * | | |01 = 2-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x02. - * | | |10 = 4-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x08. - * | | |11 = 8-bit time from Start bit to the 1st rising edge. The input pattern shall be 0x80. - * | | |Note : The calculation of bit number includes the START bit. - * |[31:24] |ADDRMV |Address Match Value - * | | |This field contains the RS-485 address match values. - * | | |Note: This field is used for RS-485 auto address detection mode. - * @var UART_T::FUNCSEL - * Offset: 0x30 UART Function Select Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |FUNCSEL |Function Select - * | | |000 = UART function. - * | | |010 = IrDA function. - * | | |011 = RS-485 function. - * | | |100 = UART Single-wire function. - * | | |Others = Reserved. - * |[3] |TXRXDIS |TX and RX Disable Bit - * | | |Setting this bit can disable TX and RX. - * | | |0 = TX and RX Enabled. - * | | |1 = TX and RX Disabled. - * | | |Note: The TX and RX will not be disabled immediately when this bit is set - * | | |The TX and RX complete current task before disable TX and RX are disabled - * | | |When TX and RX are disabled, the TXRXACT (UART_FIFOSTS[31]) is cleared. - * @var UART_T::BRCOMP - * Offset: 0x3C UART Baud Rate Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |BRCOMP |Baud Rate Compensation Patten - * | | |These 9-bits are used to define the relative bit is compensated or not. - * | | |BRCOMP[7:0] is used to define the compensation of DAT (UART_DAT[7:0]) and BRCOM[8] is used to define PARITY (UART_DAT[8]). - * |[31] |BRCOMPD |Baud Rate Compensation Decrease - * | | |0 = Positive (increase one module clock) compensation for each compensated bit. - * | | |1 = Negative (decrease one module clock) compensation for each compensated bit. - * @var UART_T::WKCTL - * Offset: 0x40 UART Wake-up Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WKCTSEN |nCTS Wake-up Enable Bit - * | | |0 = nCTS Wake-up system function Disabled. - * | | |1 = nCTS Wake-up system function Enabled. - * | | |Note: When the system is in Power-down mode, an external nCTS change will wake up system from Power-down mode. - * |[1] |WKDATEN |Incoming Data Wake-up Enable Bit - * | | |0 = Incoming data wake-up system function Disabled. - * | | |1 = Incoming data wake-up system function Enabled. - * | | |Note: When the system is in Power-down mode, incoming data will wake-up system from Power-down mode. - * |[2] |WKRFRTEN |Received Data FIFO Reached Threshold Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold wake-up system function Enabled. - * | | |Note: When the system is in Power-down mode, Received Data FIFO reached threshold will wake-up system from Power-down mode. - * |[3] |WKAADEN |RS-485 Address Match Wake-up Enable Bit - * | | |0 = RS-485 Address Match (AAD mode) wake-up system function Disabled. - * | | |1 = RS-485 Address Match (AAD mode) wake-up system function Enabled. - * | | |Note 1: When the system is in .Power-down mode, RS-485 Address Match will wake -up system from Power-down mode. - * | | |Note 2: This bit is used for RS-485 Auto Address Detection (AAD) mode in RS-485 function mode and ADDRDEN (UART_ALTCTL[15]) is set to 1. - * |[4] |WKTOUTEN |Received Data FIFO Reached Threshold Time-out Wake-up Enable Bit - * | | |0 = Received Data FIFO reached threshold time-out wake-up system function Disabled. - * | | |1 = Received Data FIFO reached threshold time-out wake-up system function Enabled. - * | | |Note 1: When the system is in Power-down mode, Received Data FIFO reached threshold time-out will wake up system from Power-down mode. - * | | |Note 2: It is suggested the function is enabled when the WKRFRTEN (UART_WKCTL[2]) is set to 1. - * @var UART_T::WKSTS - * Offset: 0x44 UART Wake-up Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CTSWKF |nCTS Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by nCTS wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by nCTS wake-up. - * | | |Note 1: If WKCTSEN (UART_WKCTL[0]) is enabled, the nCTS wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[1] |DATWKF |Incoming Data Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by data wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Incoming Data wake-up. - * | | |Note 1: If WKDATEN (UART_WKCTL[1]) is enabled, the Incoming Data wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[2] |RFRTWKF |Received Data FIFO Reached Threshold Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO reached threshold - * | | |wake-up . - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO Reached Threshold wake-up. - * | | |Note 1: If WKRFRTEN (UART_WKCTL[2]) is enabled, the Received Data FIFO Reached Threshold wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[3] |RS485WKF |RS-485 Address Match Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by RS-485 Address Match (AAD mode). - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by RS-485 Address Match (AAD mode) wake-up. - * | | |Note 1: If WKRS485EN (UART_WKCTL[3]) is enabled, the RS-485 Address Match (AAD mode) wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * |[4] |TOUTWKF |Received Data FIFO Threshold Time-out Wake-up Flag - * | | |This bit is set if chip wake-up from power-down state by Received Data FIFO Threshold Time-out wake-up. - * | | |0 = Chip stays in power-down state. - * | | |1 = Chip wake-up from power-down state by Received Data FIFO reached threshold time-out. - * | | |Note 1: If WKTOUTEN (UART_WKCTL[4]) is enabled, the Received Data FIFO reached threshold time-out wake-up cause this bit is set to '1'. - * | | |Note 2: This bit can be cleared by writing '1' to it. - * @var UART_T::DWKCOMP - * Offset: 0x48 UART Incoming Data Wake-up Compensation Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STCOMP |Start Bit Compensation Value - * | | |These bits field indicate how many clock cycle selected by UART_CLK do the UART controller can get the 1st bit (start bit) when the device is woken up from Power-down mode. - * | | |Note: It is valid only when WKDATEN (UART_WKCTL[1]) is set. - */ - __IO uint32_t DAT; /*!< [0x0000] UART Receive/Transmit Buffer Register */ - __IO uint32_t INTEN; /*!< [0x0004] UART Interrupt Enable Register */ - __IO uint32_t FIFO; /*!< [0x0008] UART FIFO Control Register */ - __IO uint32_t LINE; /*!< [0x000c] UART Line Control Register */ - __IO uint32_t MODEM; /*!< [0x0010] UART Modem Control Register */ - __IO uint32_t MODEMSTS; /*!< [0x0014] UART Modem Status Register */ - __IO uint32_t FIFOSTS; /*!< [0x0018] UART FIFO Status Register */ - __IO uint32_t INTSTS; /*!< [0x001c] UART Interrupt Status Register */ - __IO uint32_t TOUT; /*!< [0x0020] UART Time-out Register */ - __IO uint32_t BAUD; /*!< [0x0024] UART Baud Rate Divider Register */ - __IO uint32_t IRDA; /*!< [0x0028] UART IrDA Control Register */ - __IO uint32_t ALTCTL; /*!< [0x002c] UART Alternate Control/Status Register */ - __IO uint32_t FUNCSEL; /*!< [0x0030] UART Function Select Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t BRCOMP; /*!< [0x003c] UART Baud Rate Compensation Register */ - __IO uint32_t WKCTL; /*!< [0x0040] UART Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0044] UART Wake-up Status Register */ - __IO uint32_t DWKCOMP; /*!< [0x0048] UART Incoming Data Wake-up Compensation Register */ - -} UART_T; - -/** - @addtogroup UART_CONST UART Bit Field Definition - Constant Definitions for UART Controller -@{ */ - -#define UART_DAT_DAT_Pos (0) /*!< UART_T::DAT: DAT Position */ -#define UART_DAT_DAT_Msk (0xfful << UART_DAT_DAT_Pos) /*!< UART_T::DAT: DAT Mask */ - -#define UART_DAT_PARITY_Pos (8) /*!< UART_T::DAT: PARITY Position */ -#define UART_DAT_PARITY_Msk (0x1ul << UART_DAT_PARITY_Pos) /*!< UART_T::DAT: PARITY Mask */ - -#define UART_INTEN_RDAIEN_Pos (0) /*!< UART_T::INTEN: RDAIEN Position */ -#define UART_INTEN_RDAIEN_Msk (0x1ul << UART_INTEN_RDAIEN_Pos) /*!< UART_T::INTEN: RDAIEN Mask */ - -#define UART_INTEN_THREIEN_Pos (1) /*!< UART_T::INTEN: THREIEN Position */ -#define UART_INTEN_THREIEN_Msk (0x1ul << UART_INTEN_THREIEN_Pos) /*!< UART_T::INTEN: THREIEN Mask */ - -#define UART_INTEN_RLSIEN_Pos (2) /*!< UART_T::INTEN: RLSIEN Position */ -#define UART_INTEN_RLSIEN_Msk (0x1ul << UART_INTEN_RLSIEN_Pos) /*!< UART_T::INTEN: RLSIEN Mask */ - -#define UART_INTEN_MODEMIEN_Pos (3) /*!< UART_T::INTEN: MODEMIEN Position */ -#define UART_INTEN_MODEMIEN_Msk (0x1ul << UART_INTEN_MODEMIEN_Pos) /*!< UART_T::INTEN: MODEMIEN Mask */ - -#define UART_INTEN_RXTOIEN_Pos (4) /*!< UART_T::INTEN: RXTOIEN Position */ -#define UART_INTEN_RXTOIEN_Msk (0x1ul << UART_INTEN_RXTOIEN_Pos) /*!< UART_T::INTEN: RXTOIEN Mask */ - -#define UART_INTEN_BUFEIEN_Pos (5) /*!< UART_T::INTEN: BUFEIEN Position */ -#define UART_INTEN_BUFEIEN_Msk (0x1ul << UART_INTEN_BUFEIEN_Pos) /*!< UART_T::INTEN: BUFEIEN Mask */ - -#define UART_INTEN_WKIEN_Pos (6) /*!< UART_T::INTEN: WKIEN Position */ -#define UART_INTEN_WKIEN_Msk (0x1ul << UART_INTEN_WKIEN_Pos) /*!< UART_T::INTEN: WKIEN Mask */ - -#define UART_INTEN_TOCNTEN_Pos (11) /*!< UART_T::INTEN: TOCNTEN Position */ -#define UART_INTEN_TOCNTEN_Msk (0x1ul << UART_INTEN_TOCNTEN_Pos) /*!< UART_T::INTEN: TOCNTEN Mask */ - -#define UART_INTEN_ATORTSEN_Pos (12) /*!< UART_T::INTEN: ATORTSEN Position */ -#define UART_INTEN_ATORTSEN_Msk (0x1ul << UART_INTEN_ATORTSEN_Pos) /*!< UART_T::INTEN: ATORTSEN Mask */ - -#define UART_INTEN_ATOCTSEN_Pos (13) /*!< UART_T::INTEN: ATOCTSEN Position */ -#define UART_INTEN_ATOCTSEN_Msk (0x1ul << UART_INTEN_ATOCTSEN_Pos) /*!< UART_T::INTEN: ATOCTSEN Mask */ - -#define UART_INTEN_TXPDMAEN_Pos (14) /*!< UART_T::INTEN: TXPDMAEN Position */ -#define UART_INTEN_TXPDMAEN_Msk (0x1ul << UART_INTEN_TXPDMAEN_Pos) /*!< UART_T::INTEN: TXPDMAEN Mask */ - -#define UART_INTEN_RXPDMAEN_Pos (15) /*!< UART_T::INTEN: RXPDMAEN Position */ -#define UART_INTEN_RXPDMAEN_Msk (0x1ul << UART_INTEN_RXPDMAEN_Pos) /*!< UART_T::INTEN: RXPDMAEN Mask */ - -#define UART_INTEN_SWBEIEN_Pos (16) /*!< UART_T::INTEN: SWBEIEN Position */ -#define UART_INTEN_SWBEIEN_Msk (0x1ul << UART_INTEN_SWBEIEN_Pos) /*!< UART_T::INTEN: SWBEIEN Mask */ - -#define UART_INTEN_ABRIEN_Pos (18) /*!< UART_T::INTEN: ABRIEN Position */ -#define UART_INTEN_ABRIEN_Msk (0x1ul << UART_INTEN_ABRIEN_Pos) /*!< UART_T::INTEN: ABRIEN Mask */ - -#define UART_INTEN_TXENDIEN_Pos (22) /*!< UART_T::INTEN: TXENDIEN Position */ -#define UART_INTEN_TXENDIEN_Msk (0x1ul << UART_INTEN_TXENDIEN_Pos) /*!< UART_T::INTEN: TXENDIEN Mask */ - -#define UART_FIFO_RXRST_Pos (1) /*!< UART_T::FIFO: RXRST Position */ -#define UART_FIFO_RXRST_Msk (0x1ul << UART_FIFO_RXRST_Pos) /*!< UART_T::FIFO: RXRST Mask */ - -#define UART_FIFO_TXRST_Pos (2) /*!< UART_T::FIFO: TXRST Position */ -#define UART_FIFO_TXRST_Msk (0x1ul << UART_FIFO_TXRST_Pos) /*!< UART_T::FIFO: TXRST Mask */ - -#define UART_FIFO_RFITL_Pos (4) /*!< UART_T::FIFO: RFITL Position */ -#define UART_FIFO_RFITL_Msk (0xful << UART_FIFO_RFITL_Pos) /*!< UART_T::FIFO: RFITL Mask */ - -#define UART_FIFO_RXOFF_Pos (8) /*!< UART_T::FIFO: RXOFF Position */ -#define UART_FIFO_RXOFF_Msk (0x1ul << UART_FIFO_RXOFF_Pos) /*!< UART_T::FIFO: RXOFF Mask */ - -#define UART_FIFO_RTSTRGLV_Pos (16) /*!< UART_T::FIFO: RTSTRGLV Position */ -#define UART_FIFO_RTSTRGLV_Msk (0xful << UART_FIFO_RTSTRGLV_Pos) /*!< UART_T::FIFO: RTSTRGLV Mask */ - -#define UART_LINE_WLS_Pos (0) /*!< UART_T::LINE: WLS Position */ -#define UART_LINE_WLS_Msk (0x3ul << UART_LINE_WLS_Pos) /*!< UART_T::LINE: WLS Mask */ - -#define UART_LINE_NSB_Pos (2) /*!< UART_T::LINE: NSB Position */ -#define UART_LINE_NSB_Msk (0x1ul << UART_LINE_NSB_Pos) /*!< UART_T::LINE: NSB Mask */ - -#define UART_LINE_PBE_Pos (3) /*!< UART_T::LINE: PBE Position */ -#define UART_LINE_PBE_Msk (0x1ul << UART_LINE_PBE_Pos) /*!< UART_T::LINE: PBE Mask */ - -#define UART_LINE_EPE_Pos (4) /*!< UART_T::LINE: EPE Position */ -#define UART_LINE_EPE_Msk (0x1ul << UART_LINE_EPE_Pos) /*!< UART_T::LINE: EPE Mask */ - -#define UART_LINE_SPE_Pos (5) /*!< UART_T::LINE: SPE Position */ -#define UART_LINE_SPE_Msk (0x1ul << UART_LINE_SPE_Pos) /*!< UART_T::LINE: SPE Mask */ - -#define UART_LINE_BCB_Pos (6) /*!< UART_T::LINE: BCB Position */ -#define UART_LINE_BCB_Msk (0x1ul << UART_LINE_BCB_Pos) /*!< UART_T::LINE: BCB Mask */ - -#define UART_LINE_PSS_Pos (7) /*!< UART_T::LINE: PSS Position */ -#define UART_LINE_PSS_Msk (0x1ul << UART_LINE_PSS_Pos) /*!< UART_T::LINE: PSS Mask */ - -#define UART_LINE_TXDINV_Pos (8) /*!< UART_T::LINE: TXDINV Position */ -#define UART_LINE_TXDINV_Msk (0x1ul << UART_LINE_TXDINV_Pos) /*!< UART_T::LINE: TXDINV Mask */ - -#define UART_LINE_RXDINV_Pos (9) /*!< UART_T::LINE: RXDINV Position */ -#define UART_LINE_RXDINV_Msk (0x1ul << UART_LINE_RXDINV_Pos) /*!< UART_T::LINE: RXDINV Mask */ - -#define UART_MODEM_RTS_Pos (1) /*!< UART_T::MODEM: RTS Position */ -#define UART_MODEM_RTS_Msk (0x1ul << UART_MODEM_RTS_Pos) /*!< UART_T::MODEM: RTS Mask */ - -#define UART_MODEM_RTSACTLV_Pos (9) /*!< UART_T::MODEM: RTSACTLV Position */ -#define UART_MODEM_RTSACTLV_Msk (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< UART_T::MODEM: RTSACTLV Mask */ - -#define UART_MODEM_RTSSTS_Pos (13) /*!< UART_T::MODEM: RTSSTS Position */ -#define UART_MODEM_RTSSTS_Msk (0x1ul << UART_MODEM_RTSSTS_Pos) /*!< UART_T::MODEM: RTSSTS Mask */ - -#define UART_MODEMSTS_CTSDETF_Pos (0) /*!< UART_T::MODEMSTS: CTSDETF Position */ -#define UART_MODEMSTS_CTSDETF_Msk (0x1ul << UART_MODEMSTS_CTSDETF_Pos) /*!< UART_T::MODEMSTS: CTSDETF Mask */ - -#define UART_MODEMSTS_CTSSTS_Pos (4) /*!< UART_T::MODEMSTS: CTSSTS Position */ -#define UART_MODEMSTS_CTSSTS_Msk (0x1ul << UART_MODEMSTS_CTSSTS_Pos) /*!< UART_T::MODEMSTS: CTSSTS Mask */ - -#define UART_MODEMSTS_CTSACTLV_Pos (8) /*!< UART_T::MODEMSTS: CTSACTLV Position */ -#define UART_MODEMSTS_CTSACTLV_Msk (0x1ul << UART_MODEMSTS_CTSACTLV_Pos) /*!< UART_T::MODEMSTS: CTSACTLV Mask */ - -#define UART_FIFOSTS_RXOVIF_Pos (0) /*!< UART_T::FIFOSTS: RXOVIF Position */ -#define UART_FIFOSTS_RXOVIF_Msk (0x1ul << UART_FIFOSTS_RXOVIF_Pos) /*!< UART_T::FIFOSTS: RXOVIF Mask */ - -#define UART_FIFOSTS_ABRDIF_Pos (1) /*!< UART_T::FIFOSTS: ABRDIF Position */ -#define UART_FIFOSTS_ABRDIF_Msk (0x1ul << UART_FIFOSTS_ABRDIF_Pos) /*!< UART_T::FIFOSTS: ABRDIF Mask */ - -#define UART_FIFOSTS_ABRDTOIF_Pos (2) /*!< UART_T::FIFOSTS: ABRDTOIF Position */ -#define UART_FIFOSTS_ABRDTOIF_Msk (0x1ul << UART_FIFOSTS_ABRDTOIF_Pos) /*!< UART_T::FIFOSTS: ABRDTOIF Mask */ - -#define UART_FIFOSTS_ADDRDETF_Pos (3) /*!< UART_T::FIFOSTS: ADDRDETF Position */ -#define UART_FIFOSTS_ADDRDETF_Msk (0x1ul << UART_FIFOSTS_ADDRDETF_Pos) /*!< UART_T::FIFOSTS: ADDRDETF Mask */ - -#define UART_FIFOSTS_PEF_Pos (4) /*!< UART_T::FIFOSTS: PEF Position */ -#define UART_FIFOSTS_PEF_Msk (0x1ul << UART_FIFOSTS_PEF_Pos) /*!< UART_T::FIFOSTS: PEF Mask */ - -#define UART_FIFOSTS_FEF_Pos (5) /*!< UART_T::FIFOSTS: FEF Position */ -#define UART_FIFOSTS_FEF_Msk (0x1ul << UART_FIFOSTS_FEF_Pos) /*!< UART_T::FIFOSTS: FEF Mask */ - -#define UART_FIFOSTS_BIF_Pos (6) /*!< UART_T::FIFOSTS: BIF Position */ -#define UART_FIFOSTS_BIF_Msk (0x1ul << UART_FIFOSTS_BIF_Pos) /*!< UART_T::FIFOSTS: BIF Mask */ - -#define UART_FIFOSTS_RXPTR_Pos (8) /*!< UART_T::FIFOSTS: RXPTR Position */ -#define UART_FIFOSTS_RXPTR_Msk (0x3ful << UART_FIFOSTS_RXPTR_Pos) /*!< UART_T::FIFOSTS: RXPTR Mask */ - -#define UART_FIFOSTS_RXEMPTY_Pos (14) /*!< UART_T::FIFOSTS: RXEMPTY Position */ -#define UART_FIFOSTS_RXEMPTY_Msk (0x1ul << UART_FIFOSTS_RXEMPTY_Pos) /*!< UART_T::FIFOSTS: RXEMPTY Mask */ - -#define UART_FIFOSTS_RXFULL_Pos (15) /*!< UART_T::FIFOSTS: RXFULL Position */ -#define UART_FIFOSTS_RXFULL_Msk (0x1ul << UART_FIFOSTS_RXFULL_Pos) /*!< UART_T::FIFOSTS: RXFULL Mask */ - -#define UART_FIFOSTS_TXPTR_Pos (16) /*!< UART_T::FIFOSTS: TXPTR Position */ -#define UART_FIFOSTS_TXPTR_Msk (0x3ful << UART_FIFOSTS_TXPTR_Pos) /*!< UART_T::FIFOSTS: TXPTR Mask */ - -#define UART_FIFOSTS_TXEMPTY_Pos (22) /*!< UART_T::FIFOSTS: TXEMPTY Position */ -#define UART_FIFOSTS_TXEMPTY_Msk (0x1ul << UART_FIFOSTS_TXEMPTY_Pos) /*!< UART_T::FIFOSTS: TXEMPTY Mask */ - -#define UART_FIFOSTS_TXFULL_Pos (23) /*!< UART_T::FIFOSTS: TXFULL Position */ -#define UART_FIFOSTS_TXFULL_Msk (0x1ul << UART_FIFOSTS_TXFULL_Pos) /*!< UART_T::FIFOSTS: TXFULL Mask */ - -#define UART_FIFOSTS_TXOVIF_Pos (24) /*!< UART_T::FIFOSTS: TXOVIF Position */ -#define UART_FIFOSTS_TXOVIF_Msk (0x1ul << UART_FIFOSTS_TXOVIF_Pos) /*!< UART_T::FIFOSTS: TXOVIF Mask */ - -#define UART_FIFOSTS_TXEMPTYF_Pos (28) /*!< UART_T::FIFOSTS: TXEMPTYF Position */ -#define UART_FIFOSTS_TXEMPTYF_Msk (0x1ul << UART_FIFOSTS_TXEMPTYF_Pos) /*!< UART_T::FIFOSTS: TXEMPTYF Mask */ - -#define UART_FIFOSTS_RXIDLE_Pos (29) /*!< UART_T::FIFOSTS: RXIDLE Position */ -#define UART_FIFOSTS_RXIDLE_Msk (0x1ul << UART_FIFOSTS_RXIDLE_Pos) /*!< UART_T::FIFOSTS: RXIDLE Mask */ - -#define UART_FIFOSTS_TXRXACT_Pos (31) /*!< UART_T::FIFOSTS: TXRXACT Position */ -#define UART_FIFOSTS_TXRXACT_Msk (0x1ul << UART_FIFOSTS_TXRXACT_Pos) /*!< UART_T::FIFOSTS: TXRXACT Mask */ - -#define UART_INTSTS_RDAIF_Pos (0) /*!< UART_T::INTSTS: RDAIF Position */ -#define UART_INTSTS_RDAIF_Msk (0x1ul << UART_INTSTS_RDAIF_Pos) /*!< UART_T::INTSTS: RDAIF Mask */ - -#define UART_INTSTS_THREIF_Pos (1) /*!< UART_T::INTSTS: THREIF Position */ -#define UART_INTSTS_THREIF_Msk (0x1ul << UART_INTSTS_THREIF_Pos) /*!< UART_T::INTSTS: THREIF Mask */ - -#define UART_INTSTS_RLSIF_Pos (2) /*!< UART_T::INTSTS: RLSIF Position */ -#define UART_INTSTS_RLSIF_Msk (0x1ul << UART_INTSTS_RLSIF_Pos) /*!< UART_T::INTSTS: RLSIF Mask */ - -#define UART_INTSTS_MODEMIF_Pos (3) /*!< UART_T::INTSTS: MODEMIF Position */ -#define UART_INTSTS_MODEMIF_Msk (0x1ul << UART_INTSTS_MODEMIF_Pos) /*!< UART_T::INTSTS: MODEMIF Mask */ - -#define UART_INTSTS_RXTOIF_Pos (4) /*!< UART_T::INTSTS: RXTOIF Position */ -#define UART_INTSTS_RXTOIF_Msk (0x1ul << UART_INTSTS_RXTOIF_Pos) /*!< UART_T::INTSTS: RXTOIF Mask */ - -#define UART_INTSTS_BUFEIF_Pos (5) /*!< UART_T::INTSTS: BUFEIF Position */ -#define UART_INTSTS_BUFEIF_Msk (0x1ul << UART_INTSTS_BUFEIF_Pos) /*!< UART_T::INTSTS: BUFEIF Mask */ - -#define UART_INTSTS_WKIF_Pos (6) /*!< UART_T::INTSTS: WKIF Position */ -#define UART_INTSTS_WKIF_Msk (0x1ul << UART_INTSTS_WKIF_Pos) /*!< UART_T::INTSTS: WKIF Mask */ - -#define UART_INTSTS_RDAINT_Pos (8) /*!< UART_T::INTSTS: RDAINT Position */ -#define UART_INTSTS_RDAINT_Msk (0x1ul << UART_INTSTS_RDAINT_Pos) /*!< UART_T::INTSTS: RDAINT Mask */ - -#define UART_INTSTS_THREINT_Pos (9) /*!< UART_T::INTSTS: THREINT Position */ -#define UART_INTSTS_THREINT_Msk (0x1ul << UART_INTSTS_THREINT_Pos) /*!< UART_T::INTSTS: THREINT Mask */ - -#define UART_INTSTS_RLSINT_Pos (10) /*!< UART_T::INTSTS: RLSINT Position */ -#define UART_INTSTS_RLSINT_Msk (0x1ul << UART_INTSTS_RLSINT_Pos) /*!< UART_T::INTSTS: RLSINT Mask */ - -#define UART_INTSTS_MODEMINT_Pos (11) /*!< UART_T::INTSTS: MODEMINT Position */ -#define UART_INTSTS_MODEMINT_Msk (0x1ul << UART_INTSTS_MODEMINT_Pos) /*!< UART_T::INTSTS: MODEMINT Mask */ - -#define UART_INTSTS_RXTOINT_Pos (12) /*!< UART_T::INTSTS: RXTOINT Position */ -#define UART_INTSTS_RXTOINT_Msk (0x1ul << UART_INTSTS_RXTOINT_Pos) /*!< UART_T::INTSTS: RXTOINT Mask */ - -#define UART_INTSTS_BUFEINT_Pos (13) /*!< UART_T::INTSTS: BUFEINT Position */ -#define UART_INTSTS_BUFEINT_Msk (0x1ul << UART_INTSTS_BUFEINT_Pos) /*!< UART_T::INTSTS: BUFEINT Mask */ - -#define UART_INTSTS_WKINT_Pos (14) /*!< UART_T::INTSTS: WKINT Position */ -#define UART_INTSTS_WKINT_Msk (0x1ul << UART_INTSTS_WKINT_Pos) /*!< UART_T::INTSTS: WKINT Mask */ - -#define UART_INTSTS_SWBEIF_Pos (16) /*!< UART_T::INTSTS: SWBEIF Position */ -#define UART_INTSTS_SWBEIF_Msk (0x1ul << UART_INTSTS_SWBEIF_Pos) /*!< UART_T::INTSTS: SWBEIF Mask */ - -#define UART_INTSTS_PRLSIF_Pos (18) /*!< UART_T::INTSTS: PRLSIF Position */ -#define UART_INTSTS_PRLSIF_Msk (0x1ul << UART_INTSTS_PRLSIF_Pos) /*!< UART_T::INTSTS: PRLSIF Mask */ - -#define UART_INTSTS_PMODIF_Pos (19) /*!< UART_T::INTSTS: PMODIF Position */ -#define UART_INTSTS_PMODIF_Msk (0x1ul << UART_INTSTS_PMODIF_Pos) /*!< UART_T::INTSTS: PMODIF Mask */ - -#define UART_INTSTS_PTOIF_Pos (20) /*!< UART_T::INTSTS: PTOIF Position */ -#define UART_INTSTS_PTOIF_Msk (0x1ul << UART_INTSTS_PTOIF_Pos) /*!< UART_T::INTSTS: PTOIF Mask */ - -#define UART_INTSTS_PBUFEIF_Pos (21) /*!< UART_T::INTSTS: PBUFEIF Position */ -#define UART_INTSTS_PBUFEIF_Msk (0x1ul << UART_INTSTS_PBUFEIF_Pos) /*!< UART_T::INTSTS: PBUFEIF Mask */ - -#define UART_INTSTS_TXENDIF_Pos (22) /*!< UART_T::INTSTS: TXENDIF Position */ -#define UART_INTSTS_TXENDIF_Msk (0x1ul << UART_INTSTS_TXENDIF_Pos) /*!< UART_T::INTSTS: TXENDIF Mask */ - -#define UART_INTSTS_SWBEINT_Pos (24) /*!< UART_T::INTSTS: SWBEINT Position */ -#define UART_INTSTS_SWBEINT_Msk (0x1ul << UART_INTSTS_SWBEINT_Pos) /*!< UART_T::INTSTS: SWBEINT Mask */ - -#define UART_INTSTS_PRLSINT_Pos (26) /*!< UART_T::INTSTS: PRLSINT Position */ -#define UART_INTSTS_PRLSINT_Msk (0x1ul << UART_INTSTS_PRLSINT_Pos) /*!< UART_T::INTSTS: PRLSINT Mask */ - -#define UART_INTSTS_PMODINT_Pos (27) /*!< UART_T::INTSTS: PMODINT Position */ -#define UART_INTSTS_PMODINT_Msk (0x1ul << UART_INTSTS_PMODINT_Pos) /*!< UART_T::INTSTS: PMODINT Mask */ - -#define UART_INTSTS_PTOINT_Pos (28) /*!< UART_T::INTSTS: PTOINT Position */ -#define UART_INTSTS_PTOINT_Msk (0x1ul << UART_INTSTS_PTOINT_Pos) /*!< UART_T::INTSTS: PTOINT Mask */ - -#define UART_INTSTS_PBUFEINT_Pos (29) /*!< UART_T::INTSTS: PBUFEINT Position */ -#define UART_INTSTS_PBUFEINT_Msk (0x1ul << UART_INTSTS_PBUFEINT_Pos) /*!< UART_T::INTSTS: PBUFEINT Mask */ - -#define UART_INTSTS_TXENDINT_Pos (30) /*!< UART_T::INTSTS: TXENDINT Position */ -#define UART_INTSTS_TXENDINT_Msk (0x1ul << UART_INTSTS_TXENDINT_Pos) /*!< UART_T::INTSTS: TXENDINT Mask */ - -#define UART_INTSTS_ABRINT_Pos (31) /*!< UART_T::INTSTS: ABRINT Position */ -#define UART_INTSTS_ABRINT_Msk (0x1ul << UART_INTSTS_ABRINT_Pos) /*!< UART_T::INTSTS: ABRINT Mask */ - -#define UART_TOUT_TOIC_Pos (0) /*!< UART_T::TOUT: TOIC Position */ -#define UART_TOUT_TOIC_Msk (0xfful << UART_TOUT_TOIC_Pos) /*!< UART_T::TOUT: TOIC Mask */ - -#define UART_TOUT_DLY_Pos (8) /*!< UART_T::TOUT: DLY Position */ -#define UART_TOUT_DLY_Msk (0xfful << UART_TOUT_DLY_Pos) /*!< UART_T::TOUT: DLY Mask */ - -#define UART_BAUD_BRD_Pos (0) /*!< UART_T::BAUD: BRD Position */ -#define UART_BAUD_BRD_Msk (0xfffful << UART_BAUD_BRD_Pos) /*!< UART_T::BAUD: BRD Mask */ - -#define UART_BAUD_EDIVM1_Pos (24) /*!< UART_T::BAUD: EDIVM1 Position */ -#define UART_BAUD_EDIVM1_Msk (0xful << UART_BAUD_EDIVM1_Pos) /*!< UART_T::BAUD: EDIVM1 Mask */ - -#define UART_BAUD_BAUDM0_Pos (28) /*!< UART_T::BAUD: BAUDM0 Position */ -#define UART_BAUD_BAUDM0_Msk (0x1ul << UART_BAUD_BAUDM0_Pos) /*!< UART_T::BAUD: BAUDM0 Mask */ - -#define UART_BAUD_BAUDM1_Pos (29) /*!< UART_T::BAUD: BAUDM1 Position */ -#define UART_BAUD_BAUDM1_Msk (0x1ul << UART_BAUD_BAUDM1_Pos) /*!< UART_T::BAUD: BAUDM1 Mask */ - -#define UART_IRDA_TXEN_Pos (1) /*!< UART_T::IRDA: TXEN Position */ -#define UART_IRDA_TXEN_Msk (0x1ul << UART_IRDA_TXEN_Pos) /*!< UART_T::IRDA: TXEN Mask */ - -#define UART_IRDA_TXINV_Pos (5) /*!< UART_T::IRDA: TXINV Position */ -#define UART_IRDA_TXINV_Msk (0x1ul << UART_IRDA_TXINV_Pos) /*!< UART_T::IRDA: TXINV Mask */ - -#define UART_IRDA_RXINV_Pos (6) /*!< UART_T::IRDA: RXINV Position */ -#define UART_IRDA_RXINV_Msk (0x1ul << UART_IRDA_RXINV_Pos) /*!< UART_T::IRDA: RXINV Mask */ - -#define UART_ALTCTL_RS485NMM_Pos (8) /*!< UART_T::ALTCTL: RS485NMM Position */ -#define UART_ALTCTL_RS485NMM_Msk (0x1ul << UART_ALTCTL_RS485NMM_Pos) /*!< UART_T::ALTCTL: RS485NMM Mask */ - -#define UART_ALTCTL_RS485AAD_Pos (9) /*!< UART_T::ALTCTL: RS485AAD Position */ -#define UART_ALTCTL_RS485AAD_Msk (0x1ul << UART_ALTCTL_RS485AAD_Pos) /*!< UART_T::ALTCTL: RS485AAD Mask */ - -#define UART_ALTCTL_RS485AUD_Pos (10) /*!< UART_T::ALTCTL: RS485AUD Position */ -#define UART_ALTCTL_RS485AUD_Msk (0x1ul << UART_ALTCTL_RS485AUD_Pos) /*!< UART_T::ALTCTL: RS485AUD Mask */ - -#define UART_ALTCTL_ADDRDEN_Pos (15) /*!< UART_T::ALTCTL: ADDRDEN Position */ -#define UART_ALTCTL_ADDRDEN_Msk (0x1ul << UART_ALTCTL_ADDRDEN_Pos) /*!< UART_T::ALTCTL: ADDRDEN Mask */ - -#define UART_ALTCTL_ABRIF_Pos (17) /*!< UART_T::ALTCTL: ABRIF Position */ -#define UART_ALTCTL_ABRIF_Msk (0x1ul << UART_ALTCTL_ABRIF_Pos) /*!< UART_T::ALTCTL: ABRIF Mask */ - -#define UART_ALTCTL_ABRDEN_Pos (18) /*!< UART_T::ALTCTL: ABRDEN Position */ -#define UART_ALTCTL_ABRDEN_Msk (0x1ul << UART_ALTCTL_ABRDEN_Pos) /*!< UART_T::ALTCTL: ABRDEN Mask */ - -#define UART_ALTCTL_ABRDBITS_Pos (19) /*!< UART_T::ALTCTL: ABRDBITS Position */ -#define UART_ALTCTL_ABRDBITS_Msk (0x3ul << UART_ALTCTL_ABRDBITS_Pos) /*!< UART_T::ALTCTL: ABRDBITS Mask */ - -#define UART_ALTCTL_ADDRMV_Pos (24) /*!< UART_T::ALTCTL: ADDRMV Position */ -#define UART_ALTCTL_ADDRMV_Msk (0xfful << UART_ALTCTL_ADDRMV_Pos) /*!< UART_T::ALTCTL: ADDRMV Mask */ - -#define UART_FUNCSEL_FUNCSEL_Pos (0) /*!< UART_T::FUNCSEL: FUNCSEL Position */ -#define UART_FUNCSEL_FUNCSEL_Msk (0x7ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_T::FUNCSEL: FUNCSEL Mask */ - -#define UART_FUNCSEL_TXRXDIS_Pos (3) /*!< UART_T::FUNCSEL: TXRXDIS Position */ -#define UART_FUNCSEL_TXRXDIS_Msk (0x1ul << UART_FUNCSEL_TXRXDIS_Pos) /*!< UART_T::FUNCSEL: TXRXDIS Mask */ - -#define UART_BRCOMP_BRCOMP_Pos (0) /*!< UART_T::BRCOMP: BRCOMP Position */ -#define UART_BRCOMP_BRCOMP_Msk (0x1fful << UART_BRCOMP_BRCOMP_Pos) /*!< UART_T::BRCOMP: BRCOMP Mask */ - -#define UART_BRCOMP_BRCOMPD_Pos (31) /*!< UART_T::BRCOMP: BRCOMPD Position */ -#define UART_BRCOMP_BRCOMPD_Msk (0x1ul << UART_BRCOMP_BRCOMPD_Pos) /*!< UART_T::BRCOMP: BRCOMPD Mask */ - -#define UART_WKCTL_WKCTSEN_Pos (0) /*!< UART_T::WKCTL: WKCTSEN Position */ -#define UART_WKCTL_WKCTSEN_Msk (0x1ul << UART_WKCTL_WKCTSEN_Pos) /*!< UART_T::WKCTL: WKCTSEN Mask */ - -#define UART_WKCTL_WKDATEN_Pos (1) /*!< UART_T::WKCTL: WKDATEN Position */ -#define UART_WKCTL_WKDATEN_Msk (0x1ul << UART_WKCTL_WKDATEN_Pos) /*!< UART_T::WKCTL: WKDATEN Mask */ - -#define UART_WKCTL_WKRFRTEN_Pos (2) /*!< UART_T::WKCTL: WKRFRTEN Position */ -#define UART_WKCTL_WKRFRTEN_Msk (0x1ul << UART_WKCTL_WKRFRTEN_Pos) /*!< UART_T::WKCTL: WKRFRTEN Mask */ - -#define UART_WKCTL_WKAADEN_Pos (3) /*!< UART_T::WKCTL: WKAADEN Position */ -#define UART_WKCTL_WKAADEN_Msk (0x1ul << UART_WKCTL_WKAADEN_Pos) /*!< UART_T::WKCTL: WKAADEN Mask */ - -#define UART_WKCTL_WKTOUTEN_Pos (4) /*!< UART_T::WKCTL: WKTOUTEN Position */ -#define UART_WKCTL_WKTOUTEN_Msk (0x1ul << UART_WKCTL_WKTOUTEN_Pos) /*!< UART_T::WKCTL: WKTOUTEN Mask */ - -#define UART_WKSTS_CTSWKF_Pos (0) /*!< UART_T::WKSTS: CTSWKF Position */ -#define UART_WKSTS_CTSWKF_Msk (0x1ul << UART_WKSTS_CTSWKF_Pos) /*!< UART_T::WKSTS: CTSWKF Mask */ - -#define UART_WKSTS_DATWKF_Pos (1) /*!< UART_T::WKSTS: DATWKF Position */ -#define UART_WKSTS_DATWKF_Msk (0x1ul << UART_WKSTS_DATWKF_Pos) /*!< UART_T::WKSTS: DATWKF Mask */ - -#define UART_WKSTS_RFRTWKF_Pos (2) /*!< UART_T::WKSTS: RFRTWKF Position */ -#define UART_WKSTS_RFRTWKF_Msk (0x1ul << UART_WKSTS_RFRTWKF_Pos) /*!< UART_T::WKSTS: RFRTWKF Mask */ - -#define UART_WKSTS_RS485WKF_Pos (3) /*!< UART_T::WKSTS: RS485WKF Position */ -#define UART_WKSTS_RS485WKF_Msk (0x1ul << UART_WKSTS_RS485WKF_Pos) /*!< UART_T::WKSTS: RS485WKF Mask */ - -#define UART_WKSTS_TOUTWKF_Pos (4) /*!< UART_T::WKSTS: TOUTWKF Position */ -#define UART_WKSTS_TOUTWKF_Msk (0x1ul << UART_WKSTS_TOUTWKF_Pos) /*!< UART_T::WKSTS: TOUTWKF Mask */ - -#define UART_DWKCOMP_STCOMP_Pos (0) /*!< UART_T::DWKCOMP: STCOMP Position */ -#define UART_DWKCOMP_STCOMP_Msk (0xfffful << UART_DWKCOMP_STCOMP_Pos) /*!< UART_T::DWKCOMP: STCOMP Mask */ - -/**@}*/ /* UART_CONST */ -/**@}*/ /* end of UART register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __UART_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/umctl2_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/umctl2_reg.h deleted file mode 100644 index e8863701468..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/umctl2_reg.h +++ /dev/null @@ -1,3918 +0,0 @@ -/**************************************************************************//** - * @file umctl2_reg.h - * @brief UMCTL2 register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __UMCTL2_REG_H__ -#define __UMCTL2_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** @addtogroup REGISTER Control Register - - @{ - -*/ - - -/*---------------------- DDR Memory Controller -------------------------*/ -/** - @addtogroup UMCTL2 DDR Memory Controller (UMCTL2) - Memory Mapped Structure for UMCTL2 Controller -@{ */ - -typedef struct -{ - - - /** - * @var UMCTL2_T::MSTR - * Offset: 0x00 Master Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ddr3 |DDR3 SDRAM Type Enable Bit - * | | |Selects DDR3 SDRAM. - * | | |u00B7 1 - DDR3 SDRAM device in use - * | | |u00B7 0 - non-DDR3 SDRAM device in use - * | | |Present only in designs configured to support DDR3. - * | | |Programming Mode: Static - * |[9] |burstchop |Burst-Chop Enable Bit - * | | |When this bit is set, enables burst-chop (BC4 or 8 on-the-fly) in DDR3. - * | | |Burst Chop for reads is exercised only: - * | | |u00B7 If in full bus width mode (MSTR.data_bus_width = 00) - * | | |Burst Chop for writes is exercised only: - * | | |u00B7 If CRC is disabled (CRCPARCTL1.crc_enable = 0) - * | | |BC4 (fixed) mode is not supported. - * | | |Programming Mode: Static - * |[10] |en_2t_timing_mode|2T Timing Mode Enable Bit - * | | |If 1, then uMCTL2 uses 2T timing, otherwise uses 1T timing. - * | | |In 2T timing, all command signals (except chip select) are held for 2 clocks on the SDRAM bus - * | | |Chip select is asserted on the second cycle of the command. - * | | |Programming Mode: Static - * |[13:12] |data_bus_width|DQ Bus Width - * | | |Selects proportion of DQ bus width that is used by the SDRAM. - * | | |u00B7 00 - Full DQ bus width to SDRAM - * | | |u00B7 01 - Half DQ bus width to SDRAM - * | | |u00B7 10 - Reserved - * | | |u00B7 11 - Reserved - * | | |Note that half bus width mode is only supported when the SDRAM bus width is a multiple of 16 - * | | |Bus width refers to DQ bus width (excluding any ECC width). - * | | |Programming Mode: Static - * |[15] |dll_off_mode|DLL Off Mode Enable Bit - * | | |u00B7 1 - When the uMCTL2 and DRAM has to be put in DLL-off mode for low frequency operation - * | | |u00B7 0 - To put uMCTL2 and DRAM in DLL-on mode for normal frequency operation - * | | |Programming Mode: Quasi-dynamic Group 2 - * |[19:16] |burst_rdwr|Burst Length for Read and Write - * | | |Indicates SDRAM burst length used: - * | | |u00B7 0010 - Burst length of 4 - * | | |u00B7 0100 - Burst length of 8 - * | | |All other values are reserved. - * | | |This bit controls the burst size used to access the SDRAM - * | | |This must match the burst length mode register setting in the SDRAM - * | | |(For BC4/8 on-the-fly mode of DDR3, set this field to 0x0100) Burst length of 2 is not supported with AXI ports when MEMC_BURST_LENGTH is 8. - * | | |Burst length of 2 is only supported when the controller is operating in 1:1 frequency mode. - * | | |For DDR3, this must be set to 0x0100 (BL8). - * | | |Programming Mode: Static - * |[25:24] |active_ranks|Active Ranks - * | | |u00B7 01 - One rank - * | | |u00B7 11 - Two ranks - * | | |u00B7 Others - Reserved - * | | |Programming Mode: Static - * @var UMCTL2_T::STAT - * Offset: 0x04 Operating Mode Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |operating_mode|Operating Mode - * | | |u00B7 00 - Init - * | | |u00B7 01 - Normal - * | | |u00B7 10 - Power-down - * | | |u00B7 11 - Self-refresh - * | | |Programming Mode: Static - * |[5:4] |selfref_type|Self-Refresh Type - * | | |Flags if self-refresh is entered, and if it is under automatic self-refresh control only or not. - * | | |u00B7 00 - SDRAM is not in self-refresh - * | | |If retry is enabled by CRCPARCTL1.crc_parity_retry_enable, this also indicates that the SRE command is still in parity error window or retry is in-progress. - * | | |u00B7 11 - SDRAM is in self-refresh, which was caused by Automatic self-refresh only - * | | |If retry is enabled, this ensures that the SRE command is executed correctly without parity error. - * | | |u00B7 10 - SDRAM is in self-refresh, which was not caused solely under automatic self-refresh control - * | | |It could have been caused by Hardware Low Power Interface and/or Software (PWRCTL.selfref_sw) - * | | |If retry is enabled, this ensures that the SRE command is executed correctly without parity error. - * | | |u00B7 01 - SDRAM is in self-refresh, which is caused by PHY Master Request. - * | | |Programming Mode: Static - * |[12] |selfref_cam_not_empty|Self-Refresh with CAMs Not Empty. - * | | |Set to 1 when self-refresh is entered but CAMs are not drained. - * | | |Cleared after exiting self-refresh. - * | | |Programming Mode: Static - * @var UMCTL2_T::MRCTRL0 - * Offset: 0x10 Mode Register Read/Write Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:4] |mr_rank |Mode Register Accessing Rank - * | | |Controls which rank is accessed by MRCTRL0.mr_wr. - * | | |Normally, it is desired to access all ranks, so all bits must be set to 1. - * | | |Examples (assuming uMCTL2 is configured for 2 ranks): - * | | |u00B7 0x1 - Select rank 0 only - * | | |u00B7 0x2 - Select rank 1 only - * | | |u00B7 0x3 - Select ranks 0 and 1 - * | | |Programming Mode: Dynamic - * |[15:12] |mr_addr |Mode Register Address - * | | |Address of the mode register that is to be written to. - * | | |u00B7 0000 - MR0 - * | | |u00B7 0001 - MR1 - * | | |u00B7 0010 - MR2 - * | | |u00B7 0011 - MR3 - * | | |u00B7 0100 - MR4 - * | | |u00B7 0101 - MR5 - * | | |u00B7 0110 - MR6 - * | | |u00B7 0111 - MR7 - * | | |Programming Mode: Dynamic - * |[31] |mr_wr |Mode Register Read or Write Operation Trigger - * | | |Setting this register bit to 1 triggers a mode register read or write operation. - * | | |When the MR operation is complete, the uMCTL2 automatically clears this bit. - * | | |The other fields of this register must be written in a separate APB transaction, before setting this mr_wr bit. - * | | |It is recommended NOT to set this signal if in Init, Deep power-down, or MPSM operating modes. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::MRCTRL1 - * Offset: 0x14 Mode Register Read/Write Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |mr_data |Mode Register Write Data - * | | |Mode register write data for all DDR2/DDR3 modes. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::MRSTAT - * Offset: 0x18 Mode Register Read/Write Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |mr_wr_busy|Mode Register Write Busy - * | | |The SoC might initiate a MR write operation only if this signal is low. - * | | |This signal goes: - * | | |u00B7 High in the clock after the uMCTL2 accepts the MRW/MRR request - * | | |u00B7 Low when the MRW/MRR command is issued to the SDRAM - * | | |It is recommended not to perform MRW/MRR commands when 'MRSTAT.mr_wr_busy' is high. - * | | |u00B7 0 - Indicates that the SoC can initiate a mode register write operation - * | | |u00B7 1 - Indicates that mode register write operation is in progress - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PWRCTL - * Offset: 0x30 Low Power Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |selfref_en|Self-Refresh Enable Bit - * | | |If it is true, then the uMCTL2 puts the SDRAM into self-refresh after a programmable number of cycles "maximum idle clocks before self-refresh (PWRTMG.selfref_to_x32)". - * | | |This register bit may be re-programmed during the course of normal operation. - * | | |Programming Mode: Dynamic - * |[1] |powerdown_en|Power-Down Enable Bit - * | | |If it is true, then the uMCTL2 goes into power-down after a programmable number of cycles "maximum idle clocks before power down" (PWRTMG.powerdown_to_x32). - * | | |This register bit may be re-programmed during the course of normal operation. - * | | |Programming Mode: Dynamic - * |[3] |en_dfi_dram_clk_disable|dfi_dram_clk_disable Enable Bit - * | | |Enables the assertion of dfi_dram_clk_disable whenever a clock is not required by the SDRAM. - * | | |If set to 0, dfi_dram_clk_disable is never asserted. - * | | |Assertion of dfi_dram_clk_disable is as follows: - * | | |In DDR2/DDR3, can only be asserted in self-refresh. - * | | |Programming Mode: Dynamic - * |[5] |selfref_sw|Self-Refresh Entry/Exit by Software - * | | |A value of 1 to this register causes system to move to self-refresh state immediately, as long as it is not in INIT or DPD/MPSM operating_mode. - * | | |This is referred to as Software Entry/Exit to self-refresh. - * | | |u00B7 1 - Software Entry to self-refresh - * | | |u00B7 0 - Software Exit from self-refresh - * | | |Programming Mode: Dynamic - * |[7] |dis_cam_drain_selfref|Disable CAM Drain Before Entering Self-Refresh - * | | |Indicates whether skipping CAM draining is allowed when entering self-refresh. - * | | |This register field cannot be modified while PWRCTL.selfref_sw == 1. - * | | |u00B7 0 - CAMs must be empty before entering SR - * | | |u00B7 1 - CAMs are not emptied before entering SR (unsupported) Note, PWRCTL.dis_cam_drain_selfref=1 is unsupported in this release - * | | |PWRCTL.dis_cam_drain_selfref=0 is required. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PWRTMG - * Offset: 0x34 Low Power Timing Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |powerdown_to_x32|SDRAM Power-Down Enter After This Clock Number - * | | |After this many clocks of the DDRC command channel being idle the uMCTL2 automatically puts the SDRAM into power-down. - * | | |The DDRC command channel is considered idle when there are no HIF commands outstanding - * | | |This must be enabled in the PWRCTL.powerdown_en. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 4 - * |[23:16] |selfref_to_x32|SDRAM Self-Refresh Enter After This Clock Number - * | | |After this many clocks of the DDRC command channel being idle the uMCTL2 automatically puts the SDRAM into self-refresh. - * | | |The DDRC command channel is considered idle when there are no HIF commands outstanding - * | | |This must be enabled in the PWRCTL.selfref_en. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 4 - * @var UMCTL2_T::HWLPCTL - * Offset: 0x38 Hardware Low Power Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |hw_lp_en |Hardware Low Power Interface Enable Bit - * | | |Programming Mode: Quasi-dynamic Group 2 - * |[1] |hw_lp_exit_idle_en|Hardware Exit Idle Enable Bit - * | | |When this bit is programmed to 1 the cactive_in_ddrc pin of the DDRC can be used to exit from the automatic clock stop, automatic power down or automatic self-refresh modes. - * | | |Note, it does not cause exit of self-refresh that was caused by Hardware Low Power Interface and/or Software (PWRCTL.selfref_sw). - * | | |Programming Mode: Static - * |[27:16] |hw_lp_idle_x32|Hardware idle period. - * | | |The cactive_ddrc output is driven low if the DDRC command channel is idle for hw_lp_idle * 32 cycles if not in INIT or DPD/MPSM operating_mode. - * | | |The DDRC command channel is considered idle when there are no HIF commands outstanding - * | | |The hardware idle function is disabled when hw_lp_idle_x32=0 - * | | |hw_lp_idle_x32=1 is an illegal value. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::RFSHCTL0 - * Offset: 0x50 Refresh Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:4] |refresh_burst|Refresh Burst Number - * | | |The programmed value + 1 is the number of refresh timeouts that is allowed to accumulate before traffic is blocked and the refreshes are forced to execute. - * | | |Closing pages to perform a refresh is a one-time penalty that must be paid for each group of refreshes - * | | |Therefore, performing refreshes in a burst reduces the per-refresh penalty of these page closings. - * | | |Higher numbers for RFSHCTL.refresh_burst slightly increase utilization; lower numbers decrease the worst-case latency associated with refreshes. - * | | |u00B7 0 - Single refresh - * | | |u00B7 1 - Burst-of-2 refresh - * | | |u00B7 7 - Burst-of-8 refresh - * | | |For more information on burst refresh feature, see section 3.9 of DDR2 JEDEC specification - JESD79-2F.pdf. - * | | |For DDR2/3, the refresh is always per-rank and not per-bank - * | | |The rank refresh can be accumulated over 8*tREFI cycles using the burst refresh feature. - * | | |If using PHY-initiated updates, care must be taken in the setting of RFSHCTL0.refresh_burst, to ensure that tRFCmax is not violated due to a PHY-initiated update occurring shortly before a refresh burst is due. - * | | |In this situation, the refresh burst is delayed until the PHY-initiated update is complete. - * | | |Programming Mode: Dynamic - Refresh Related - * |[16:12] |refresh_to_x1_x32|SDRAM Bus Idle Period - * | | |If the refresh timer (tRFCnom, also known as tREFI) has expired at least once, then a speculative refresh may be performed. - * | | |A speculative refresh is a refresh performed at a time when refresh would be useful - * | | |When the SDRAM bus is idle for a period of time determined by this RFSHCTL0.refresh_to_x1_x32 and the refresh timer has expired at least once since the last refresh, then a speculative refresh is performed. - * | | |Speculative refreshes continue successively until there are no refreshes pending or until new reads or writes are issued to the uMCTL2. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: DFI clock cycles or multiples of 32 DFI clock cycles, depending on RFSHTMG.t_rfc_nom_x1_sel. - * | | |Programming Mode: Dynamic - Refresh Related - * |[23:20] |refresh_margin|Refresh Margin - * | | |Threshold value in number of DFI clock cycles before the critical refresh or page timer expires. - * | | |A critical refresh is to be issued before this threshold is reached. - * | | |It is recommended that this not be changed from the default value, currently shown as 0x2. - * | | |It must always be less than internally used t_rfc_nom/32. - * | | |Note that internally used t_rfc_nom is equal to RFSHTMG.t_rfc_nom_x1_x32 * 32 if RFSHTMG.t_rfc_nom_x1_sel=0. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Dynamic - Refresh Related - * @var UMCTL2_T::RFSHCTL1 - * Offset: 0x54 Refresh Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |refresh_timer0_start_value_x32|Refresh Timer Start Value for Rank 0 - * | | |only present in multi-rank configurations - * | | |This is useful in staggering the refreshes to multiple ranks to help traffic to proceed. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Dynamic - Refresh Related - * |[27:16] |refresh_timer1_start_value_x32|Refresh Timer Start Value for Rank 1 - * | | |only present in multi-rank configurations - * | | |This is useful in staggering the refreshes to multiple ranks to help traffic to proceed. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Dynamic - Refresh Related - * @var UMCTL2_T::RFSHCTL3 - * Offset: 0x60 Refresh Control Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dis_auto_refresh|Disable Auto-Refresh Enable Bit - * | | |When '1', disable auto-refresh generated by the uMCTL2. - * | | |When auto-refresh is disabled, the SoC must generate refreshes using the registers DBGCMD.rankn_refresh. - * | | |When dis_auto_refresh transitions from 0 to 1, any pending refreshes are immediately scheduled by the uMCTL2. - * | | |This register field is changeable on the fly. - * | | |Programming Mode: Dynamic - Refresh Related - * |[1] |refresh_update_level|Refresh Registers Updated Operation - * | | |Toggle this signal (either from 0 to 1 or from 1 to 0) to indicate that the refresh registers have been updated. - * | | |refresh_update_level must not be toggled when the DDRC is in reset (core_ddrc_rstn = 0). - * | | |The refresh registers are automatically updated when exiting reset. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::RFSHTMG - * Offset: 0x64 Refresh Timing Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |t_rfc_min |Minimum Time from Refresh to Refresh or Activate - * | | |tRFC (min) - * | | |When the controller is operating in 1:1 mode, t_rfc_min must be set to RoundUp(tRFCmin/tCK). - * | | |When the controller is operating in 1:2 mode, t_rfc_min must be set to RoundUp(RoundUp(tRFCmin/tCK)/2). - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Dynamic - Refresh Related - * |[27:16] |t_rfc_nom_x1_x32|Average Time Interval between Refreshes per Rank - * | | |(Specification: 7.8us for DDR2 and DDR3). - * | | |When the controller is operating in 1:1 mode, set this register to RoundDown(tREFI/tCK) - * | | |When the controller is operating in 1:2 mode, set this register to RoundDown(RoundDown(tREFI/tCK)/2) - * | | |In both the previous cases, if RFSHTMG.t_rfc_nom_x1_sel = 0, divide the previous result by 32 and round down. - * | | |Note: - * | | |u00B7 RFSHTMG.t_rfc_nom_x1_x32 must be greater than 0x1 - * | | |u00B7 If RFSHTMG.t_rfc_nom_x1_sel == 1, RFSHTMG.t_rfc_nom_x1_x32 must be greater than RFSHTMG.t_rfc_min - * | | |u00B7 If RFSHTMG.t_rfc_nom_x1_sel == 0, RFSHTMG.t_rfc_nom_x1_x32 * 32 must be greater than RFSHTMG.t_rfc_min - * | | |u00B7 In DDR2/DDR3: RFSHTMG.t_rfc_nom_x1_x32 must be less than or equal to 0xFFE - * | | |Unit: DFI clock cycles or multiples of 32 DFI clock cycles, depending on RFSHTMG.t_rfc_nom_x1_sel. - * | | |Programming Mode: Dynamic - Refresh Related - * @var UMCTL2_T::CRCPARCTL0 - * Offset: 0xC0 CRC Parity Control Register0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dfi_alert_err_int_en|DFI Alert Error Interrupt Enable Bit - * | | |If this bit is set, any parity/CRC error detected on the dfi_alert_n input results in an interrupt being set on CRCPARSTAT.dfi_alert_err_int. - * | | |Programming Mode: Dynamic - * |[1] |dfi_alert_err_int_clr|DFI Alert Error Interrupt Clear Bit - * | | |Interrupt clear bit for DFI alert error - * | | |If this bit is set, the alert error interrupt on CRCPARSTAT.dfi_alert_err_int is cleared - * | | |uMCTL2 automatically clears this bit. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * |[2] |dfi_alert_err_cnt_clr|DFI Alert Error Counter Clear Bit - * | | |Indicates the clear bit for DFI alert error counter. - * | | |Asserting this bit clears the DFI alert error counter, CRCPARSTAT.dfi_alert_err_cnt - * | | |uMCTL2 automatically clears this bit. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::CRCPARSTAT - * Offset: 0xCC CRC Parity Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |dfi_alert_err_cnt|DFI Alert Error Count - * | | |If a parity/CRC error is detected on dfi_alert_n, this counter be incremented - * | | |This is independent of the setting of CRCPARCTL0.dfi_alert_err_int_en - * | | |It saturates at 0xFFFF, and can be cleared by asserting CRCPARCTL0.dfi_alert_err_cnt_clr. - * | | |Programming Mode: Static - * |[16] |dfi_alert_err_int|DFI Alert Error Interrupt - * | | |If a parity/CRC error is detected on dfi_alert_n, and the interrupt is enabled by CRCPARCTL0.dfi_alert_err_int_en, this interrupt bit is set - * | | |It remains set until cleared by CRCPARCTL0.dfi_alert_err_int_clr. - * | | |Programming Mode: Static - * @var UMCTL2_T::INIT0 - * Offset: 0xD0 SDRAM Initialization Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |pre_cke_x1024|Number of Cycles to Wait after Reset before Driving CKE High to Start SDRAM Initialization - * | | |Indicates the number of cycles to wait after reset before driving CKE high to start the SDRAM initialization sequence. - * | | |DDR2 specifications typically require this to be programmed for a delay of >= 200 us. - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to JEDEC spec value divided by 2, and round it up to the next integer value. - * | | |For DDR3 RDIMMs, this must include the time needed to satisfy tSTAB. - * | | |Unit: Multiples of 1024 DFI clock cycles. - * | | |Programming Mode: Static - * |[25:16] |post_cke_x1024|Number of Cycles to Wait after Driving CKE High to Start the SDRAM Initialization - * | | |Indicates the number of cycles to wait after driving CKE high to start the SDRAM initialization sequence. - * | | |DDR2 typically requires a 400 ns delay, requiring this value to be programmed to 2 at all clock speeds. - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to JEDEC spec value divided by 2, and round it up to the next integer value. - * | | |Unit: Multiples of 1024 DFI clock cycles. - * | | |Programming Mode: Static - * |[31:30] |skip_dram_init|SDRAM Initialization Routine Skipped Enable Bit - * | | |If lower bit is enabled the SDRAM initialization routine is skipped - * | | |The upper bit decides what state the controller starts up in when reset is removed. - * | | |u00B7 00 - SDRAM Initialization routine is run after power-up - * | | |u00B7 01 - SDRAM Initialization routine is skipped after power-up - * | | |The controller starts up in normal Mode - * | | |u00B7 11 - SDRAM Initialization routine is skipped after power-up - * | | |The controller starts up in self-refresh Mode - * | | |u00B7 10 - Reserved - * | | |Programming Mode: Quasi-dynamic Group 2 - * @var UMCTL2_T::INIT1 - * Offset: 0xD4 SDRAM Initialization Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |pre_ocd_x32|Wait Period before Driving OCD Complete Command to SDRAM - * | | |Indicates the wait period before driving the OCD complete command to SDRAM. - * | | |There is no known specific requirement for this; it may be set to zero. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Static - * |[24:16] |dram_rstn_x1024|SDRAM Reset During Initialization sequence - * | | |Indicates the number of cycles to assert SDRAM reset signal during initialization sequence. - * | | |This is only present for designs supporting DDR3 devices - * | | |For use with a Synopsys DDR PHY, this must be set to a minimum of 1. - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to JEDEC spec value divided by 2, and round it up to the next integer value. - * | | |Unit: Multiples of 1024 DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::INIT3 - * Offset: 0xDC SDRAM Initialization Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |emr |Write Value to EMR Register - * | | |DDR2: Indicates the value to write to EMR register - * | | |Bits 9:7 are for OCD and the setting in this register is ignored - * | | |The uMCTL2 sets those bits appropriately. - * | | |DDR3: Value to write to MR1 register Set bit 7 to 0. - * | | |Programming Mode: Quasi-dynamic Group 4 - * |[31:16] |mr |Write Value to MR Register - * | | |DDR2:Indicates the value to write to MR register - * | | |Bit 8 is for DLL and the setting here is ignored - * | | |The uMCTL2 sets this bit appropriately. - * | | |DDR3: Value loaded into MR0 register. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 4 - * @var UMCTL2_T::INIT4 - * Offset: 0xE0 SDRAM Initialization Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |emr3 |Write Value to EMR3 Register - * | | |DDR2: Indicates the value to write to EMR3 register. - * | | |DDR3: Value to write to MR3 register. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[31:16] |emr2 |Write Value to EMR2 Register - * | | |DDR2: Indicates the value to write to EMR2 register. - * | | |DDR3: Value to write to MR2 register. - * | | |Programming Mode: Quasi-dynamic Group 4 - * @var UMCTL2_T::INIT5 - * Offset: 0xE4 SDRAM Initialization Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |dev_zqinit_x32|ZQ initial calibration, tZQINIT. - * | | |Present only in designs configured to support DDR3. - * | | |DDR3 typically requires 512 SDRAM clock cycles. - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to JEDEC spec value divided by 2, and round it up to the next integer value. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::DIMMCTL - * Offset: 0xF0 DIMM Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dimm_stagger_cs_en|DIMM Staggering Enable Bit - * | | |Staggering enable for multi-rank accesses (for multi-rank UDIMM, RDIMM and LRDIMM implementations only). - * | | |Note: Even if this bit is set it does not take care of software driven MR commands (through MRCTRL0/MRCTRL1), where software is responsible to send them to separate ranks as appropriate. - * | | |u00B7 1 - DDR2/DDR3 Send all commands to even and odd ranks separately - * | | |u00B7 0 - Do not stagger accesses - * | | |Programming Mode: Static - * |[1] |dimm_addr_mirr_en|DIMM Address Mirroring Enable Bit - * | | |Enables address mirroring (for multi-rank UDIMM implementations). - * | | |Some UDIMMs implement address mirroring for odd ranks, which means that the following address, bank address and bank group bits are swapped: (A3, A4), (A5, A6), (A7, A8), (BA0, BA1). - * | | |Setting this bit ensures that, for mode register accesses during the automatic initialization routine, these bits are swapped within the uMCTL2 to compensate for this UDIMM/RDIMM/LRDIMM swapping. - * | | |Note: This has no effect on the address of any other memory accesses, or of software-driven mode register accesses. - * | | |u00B7 1 - For odd ranks, implement address mirroring for MRS commands during initialization - * | | |u00B7 0 - Do not implement address mirroring - * | | |Programming Mode: Static - * @var UMCTL2_T::RANKCTL - * Offset: 0xF4 Rank Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |max_rank_rd|Maximum Number of Reads that Can be Scheduled Consecutively to Same Rank - * | | |Only present for multi-rank configurations. - * | | |Background: Reads to the same rank can be performed back-to-back - * | | |Reads to different ranks require additional gap dictated by the register RANKCTL.diff_rank_rd_gap. - * | | |This is to avoid possible data bus contention as well as to give PHY enough time to switch the delay when changing ranks. - * | | |The uMCTL2 arbitrates for bus access on a cycle-by-cycle basis; therefore after a read is scheduled, there are few clock cycles (determined by the value on RANKCTL.diff_rank_rd_gap register) in which only reads from the same rank are eligible to be scheduled. - * | | |This prevents reads from other ranks from having fair access to the data bus. - * | | |This parameter represents the maximum number of reads that can be scheduled consecutively to the same rank. - * | | |After this number is reached, a delay equal to RANKCTL.diff_rank_rd_gap is inserted by the scheduler to allow all ranks a fair opportunity to be scheduled. - * | | |Higher numbers increase bandwidth utilization, lower numbers increase fairness. - * | | |This feature can be DISABLED by setting this register to 0 - * | | |When set to 0, the controller stays on the same rank as long as commands are available for it. - * | | |Minimum programmable value is 0 (feature disabled) and maximum programmable value is 0xF. - * | | |For uPCTL2, this register field must be set to 0 (feature disabled) - * | | |FOR PERFORMANCE ONLY. - * | | |Programming Mode: Static - * |[7:4] |diff_rank_rd_gap|Number of Clocks of Gap in Data Responses when Performing Consecutive Reads to Different Ranks - * | | |Only present for multi-rank configurations. - * | | |Indicates the number of clocks of gap in data responses when performing consecutive reads to different ranks. - * | | |This is used to switch the delays in the PHY to match the rank requirements. - * | | |This value must consider both PHY requirement and ODT requirement. - * | | |u00B7 PHY requirement:tphy_rdcsgap (For more information on value of tphy_rdcsgap, see PHY databook) - * | | |u00B7 ODT requirement: The value programmed in this register takes care of the ODT switch off timing requirement when switching ranks during reads: - * | | |diff_rank_rd_gap must be a minimum of ODTCFG.rd_odt_hold - BL/2 - * | | |when the controller is operating in 1:1 mode, program this to the larger of PHY requirement or ODT requirement. - * | | |When the controller is operating in 1:2 mode, program this to the larger value divided by two and round it up to the next integer. - * | | |After PHY has completed training the value programmed may need to be increased - * | | |For more information, see relevant PHY documentation. - * | | |If a value greater than 0xF is needed, the RANKCTL.diff_rank_rd_gap_msb field must be used as extension - * | | |For DFI 1:2 mode, a maximum value of {diff_rank_rd_gap_msb,diff_rank_rd_gap} < 'h11 is supported - * | | |For DFI 1:1 mode a maximum value of {diff_rank_rd_gap_msb,diff_rank_rd_gap} <= 'h1F is supported. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2 - * |[11:8] |diff_rank_wr_gap|Number of Clocks of Gap in Data Responses when Performing Consecutive Writes to Different Ranks - * | | |Only present for multi-rank configurations. - * | | |Indicates the number of clocks of gap in data responses when performing consecutive writes to different ranks. - * | | |This is used to switch the delays in the PHY to match the rank requirements - * | | |This value must consider both PHY requirement and ODT requirement. - * | | |u00B7 PHY requirement - tphy_wrcsgap (For more information on value of tphy_wrcsgap, see PHY databook) - * | | |If CRC feature is enabled, must be increased by 1. - * | | |u00B7 ODT requirement - The value programmed in this register takes care of the ODT switch off timing requirement when switching ranks during writes. - * | | |For other cases, diff_rank_wr_gap must be a minimum of ODTCFG.wr_odt_hold - BL/2 - * | | |When the controller is operating in 1:1 mode, program this to the larger of PHY requirement or ODT requirement. - * | | |If CRC is enabled, the value can be decreased by 2 because the programmed value is internally increased by 1 (it is always 2 in terms of DFI PHY clock cycle as CRC is supported only with 1:2 frequency ratio). - * | | |When the controller is operating in 1:2 mode, program this to the larger value divided by two and round it up to the next integer. - * | | |After PHY has completed training the value programmed may need to be increased - * | | |For more information, see relevant PHY documentation. - * | | |If a value greater than 0xF is needed, the RANKCTL.diff_rank_wr_gap_msb field must be used as extension - * | | |For DFI 1:2 mode, a maximum value of {diff_rank_wr_gap_msb,diff_rank_wr_gap} < 'h11 is supported - * | | |For DFI 1:1 mode a maximum value of {diff_rank_wr_gap_msb,diff_rank_wr_gap} <= 'h1F is supported. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2 - * |[15:12] |max_rank_wr|Maximum Number of Writes that Can be Scheduled Consecutively to Same Rank - * | | |Only present for multi-rank configurations. - * | | |Background: Writes to the same rank can be performed back-to-back - * | | |Writes to different ranks require additional gap dictated by the register RANKCTL.diff_rank_wr_gap. - * | | |This is to avoid possible data bus contention as well as to give PHY enough time to switch the delay when changing ranks. - * | | |The uMCTL2 arbitrates for bus access on a cycle-by-cycle basis; therefore after a write is scheduled, there are few clock cycles (determined by the value on RANKCTL.diff_rank_wr_gap register) in which only writes from the same rank are eligible to be scheduled. - * | | |This prevents writes from other ranks from having fair access to the data bus. - * | | |This parameter represents the maximum number of writes that can be scheduled consecutively to the same rank - * | | |After this number is reached, a delay equal to RANKCTL.diff_rank_wr_gap is inserted by the scheduler to allow all ranks a fair opportunity to be scheduled - * | | |Higher numbers increase bandwidth utilization, lower numbers increase fairness. - * | | |This feature can be DISABLED by setting this register to 0 - * | | |When set to 0, the controller stays on the same rank as long as commands are available for it. - * | | |Minimum programmable value is 0 (feature disabled) and maximum programmable value is 0xF. - * | | |For uPCTL2, this register field must be set to 0 (feature disabled) - * | | |FOR PERFORMANCE ONLY. - * | | |Programming Mode: Static - * |[24] |diff_rank_rd_gap_msb|Different Rank Read Gap Extension Bit - * | | |Only present for multi-rank configurations. - * | | |1-bit extension to be used when RANKCTL.diff_rank_rd_gap field needs to be set to a value greater than 0xF. - * | | |Programming Mode: Quasi-dynamic Group 2 - * |[26] |diff_rank_wr_gap_msb|Different Rank Write Gap Extension Bit - * | | |Only present for multi-rank configurations. - * | | |1-bit extension to be used when RANKCTL.diff_rank_wr_gap field needs to be set to a value greater than 0xF. - * | | |Programming Mode: Quasi-dynamic Group 2 - * @var UMCTL2_T::DRAMTMG0 - * Offset: 0x100 SDRAM Timing Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |t_ras_min |Minimum Time Between Activate and Precharge to the Same Bank (tRAS(min)) - * | | |When the controller is operating in 1:1 frequency ratio mode, t_ras_min must be set to RoundUp(tRASmin/tCK) - * | | |When the controller is operating in 1:2 frequency ratio mode, 1T mode, t_ras_min must be set to RoundDown(RoundUp(tRASmin/tCK)/2) - * | | |When the controller is operating in 1:2 frequency ratio mode, 2T mode, geardown mode or LPDDR4 mode, t_ras min must be set to RoundUp(RoundUp(tRASmin/tCK)/2) - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[14:8] |t_ras_max |Maximum Time Between Activate and Precharge to the Same Bank (tRAS(max)) - * | | |This is the maximum time that a page can be kept open Minimum value of this register is 1 - * | | |Zero is invalid. - * | | |When the controller is operating in 1:1 frequency ratio mode, t_ras_max must be set to RoundDown(tRAS(max)/tCK/1024). - * | | |When the controller is operating in 1:2 frequency ratio mode, t_ras_max must be set to RoundDown((RoundDown(tRAS(max)/tCK/1024)-1)/2). - * | | |Unit: Multiples of 1024 DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[21:16] |t_faw |Four Active Window for 2 Kbytes Page Size - * | | |tFAW - valid only when 8 or more banks(or banks x bank groups) are present. - * | | |In 8-bank design, at most 4 banks must be activated in a rolling window of tFAW cycles. - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to (tFAW/2) and round up to next integer value. - * | | |In a 4-bank design, set this register to 0x1 independent of the 1:1/1:2 frequency mode. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[30:24] |wr2pre |Minimum Time Between Write and Precharge to Same Bank. - * | | |Specifications: WL + BL/2 + tWR = approximately 8 cycles + 15 ns = 14 clocks @400 MHz and less for lower frequencies. - * | | |where: - * | | |u00B7 WL: Write latency - * | | |u00B7 BL: Burst length - * | | |This must match the value programmed in the BL bit of the mode register to the SDRAM - * | | |BST (burst terminate) is not supported at present - * | | |u00B7 tWR: Write recovery time. This comes directly from the SDRAM specification - * | | |When the controller is operating in 1:2 frequency ratio mode, 1T mode, divide the previous value by 2 - * | | |No rounding up. - * | | |When the controller is operating in 1:2 frequency ratio mode, 2T mode, geardown mode, divide the previous value by 2 and round it up to the next integer value. - * | | |Note that, depending on the PHY, if using LRDIMM, it may be necessary to adjust the value of this parameter to compensate for the extra cycle of latency through the LRDIMM. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 2, Group 4 - * @var UMCTL2_T::DRAMTMG1 - * Offset: 0x104 SDRAM Timing Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |t_rc |Minimum Time Between Activates to Same Bank (tRC) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to (tRC/2) and round up to next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[13:8] |rd2pre |Minimum Time from Read to Precharge of Same Bank (tRTP) - * | | |u00B7 DDR2 - tAL + BL/2 + max(RoundUp(tRTP/tCK), 2) - 2 - * | | |u00B7 DDR3 - tAL + max (RoundUp(tRTP/tCK), 4) - * | | |When the controller is operating in 1:2 mode, 1T mode, divide the previous value by 2. No rounding up. - * | | |When the controller is operating in 1:2 mode, 2T mode, geardown mode, divide the previous value by 2 and round it up to the next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 2, Group 4 - * |[20:16] |t_xp |Minimum Time after Power-Down Exit to Any Operation (tXP) - * | | |For DDR3, this must be programmed to tXPDLL if slow power down exit is selected in MR0[12]. - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to (tXP/2) and round it up to the next integer value. - * | | |Units: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * @var UMCTL2_T::DRAMTMG2 - * Offset: 0x108 SDRAM Timing Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |wr2rd |Minimum Time from Write Command to Read Command - * | | |This must include time for bus turn-around and all PHY and system requirements. - * | | |After the PHY has completed training, the value programmed may need to be increased - * | | |Please see the relevant PHY databook for details of what should be included here. - * | | |The following calculations are minimum values, and do not include the PHY/system requirements mentioned above: - * | | |DDR2/DDR3: CWL + BL/2 + tWTR - * | | |Where: - * | | |u00B7 CWL: CAS write latency - * | | |u00B7 WL: Write latency - * | | |u00B7 BL: Burst length - * | | |This must match the value programmed in the BL bit of the mode register to the SDRAM - * | | |u00B7 tWTR: Internal write to read command delay. This comes directly from the SDRAM specification - * | | |Add one extra cycle for LPDDR2/LPDDR3/LPDDR4 operation. - * | | |When the controller is operating in 1:2 mode, divide the value calculated using the previous equation by 2, and round it up to next integer. - * | | |If your configuration has RANKCTL1.wr2rd_dr, write to read bus turn-around between different physical ranks are controlled by RANKCTL1.wr2rd_dr. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 2, Group 4 - * |[13:8] |rd2wr |Minimum Time from Read Command to Write Command - * | | |This must include time for bus turnaround (both within ranks and between ranks) and all PHY and system requirements. - * | | |After the PHY has completed training, the value programmed may need to be increased - * | | |Please see the relevant PHY databook for details of what should be included here. - * | | |The following calculations are minimum values, and do not include the PHY/system requirements mentioned above: - * | | |DDR2/3 : RL + BL/2 + 2 - WL - * | | |Where: - * | | |u00B7 WL: Write latency - * | | |u00B7 BL: Burst length - * | | |This must match the value programmed in the BL bit of the mode register to the SDRAM - * | | |u00B7 RL: Read latency = CAS latency - * | | |When the controller is operating in 1:2 frequency ratio mode, divide the value calculated using the previous equation by 2, and round it up to next integer. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 2, Group 4 - * @var UMCTL2_T::DRAMTMG3 - * Offset: 0x10C SDRAM Timing Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |t_mod |Number of Cycles Between Load Mode Command and Following Non-Load Mode Command (tMOD) - * | | |Used only in DDR3. - * | | |Indicates the number of cycles between load mode command and following non-load mode command. - * | | |If CAL mode is enabled (DFITMG1.dfi_t_cmd_lat > 0), tCAL (=DFITMG1.dfi_cmd_lat) must be added to the previous calculations. - * | | |Set to tMOD if controller is operating in 1:1 frequency ratio mode, or tMOD/2 (rounded up to next integer) if controller is operating in 1:2 frequency ratio mode. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[17:12] |t_mrd |Number of Cycles to Wait after a Mode Register Write or Read (tMRD) - * | | |Depending on the connected SDRAM, tMRD represents: - * | | |u00B7 DDR2: Time from MRS to any command - * | | |u00B7 DDR3: Time from MRS to MRS command - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to (tMRD/2) and round it up to the next integer value. - * | | |If CAL mode is enabled (DFITMG1.dfi_t_cmd_lat > 0), tCAL (=DFITMG1.dfi_cmd_lat) must be added to the previous calculations. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * @var UMCTL2_T::DRAMTMG4 - * Offset: 0x110 SDRAM Timing Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |t_rp |Minimum Time from Single-Bank Precharge to Activate of Same Bank (tRP) - * | | |When the controller is operating in 1:1 frequency ratio mode, t_rp must be set to RoundUp(tRP/tCK). - * | | |When the controller is operating in 1:2 frequency ratio mode, t_rp must be set to RoundDown(RoundUp(tRP/tCK)/2) + 1. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[11:8] |t_rrd |Minimum Time Between Activates from Bank "a" to Bank "b" for Others (tRRD) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to (tRRD/2) and round it up to the next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[19:16] |t_ccd |Minimum Time Between Two Reads or Two Writes for Others (tCCD) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to (tCCD_L/2 or tCCD/2) and round it up to the next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[28:24] |t_rcd |Minimum Time from Activate to Read or Write Command to Same Bank (tRCD - tAL) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to ((tRCD - tAL)/2) and round it up to the next integer value. - * | | |Minimum value allowed for this register is 1, which implies minimum (tRCD - tAL) value to be 2 when the controller is operating in 1:2 frequency ratio mode. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 2, Group 4 - * @var UMCTL2_T::DRAMTMG5 - * Offset: 0x114 SDRAM Timing Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |t_cke |Minimum Number of Cycles of CKE HIGH/LOW During Power-Down and Self-Refresh. - * | | |u00B7 DDR2/DDR3: Set this to tCKE value - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to (value described above)/2 and round it up to the next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[13:8] |t_ckesr |Minimum CKE Low Width for Self-Refresh or Self-Refresh Power Down Entry to Exit Timing in Memory Clock Cycles. - * | | |Recommended settings: - * | | |u00B7 DDR2 : tCKE - * | | |u00B7 DDR3 : tCKE + 1 - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to recommended value divided by two and round it up to next integer. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[22:16] |t_cksre |Time After Self-Refresh Down Entry that CK is Maintained as a Valid Clock. - * | | |Specifies the clock disable delay after SRE. - * | | |Recommended settings: - * | | |u00B7 DDR2 : 1 - * | | |u00B7 DDR3 : Max (10 ns, 5 tCK) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to recommended value divided by two and round it up to next integer. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[27:24] |t_cksrx |Time Before Self-Refresh Exit that CK is Maintained as a Valid Clock Before Issuing SRX. - * | | |Specifies the clock stable time before SRX. - * | | |Recommended settings: - * | | |u00B7 DDR2 : 1 - * | | |u00B7 DDR3 : tCKSRX - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to recommended value divided by two and round it up to next integer. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * @var UMCTL2_T::DRAMTMG8 - * Offset: 0x120 SDRAM Timing Register 8 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |t_xs_x32 |Exit Self-Refresh to Commands Not Requiring a Locked DLL (tXS) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to the previous value divided by 2 and round up to next integer value. - * | | |Note: Used only for DDR2 and DDR3 SDRAMs. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[14:8] |t_xs_dll_x32|Exit Self-Refresh to Commands Requiring a Locked DLL (tXSDLL) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to the previous value divided by 2 and round up to next integer value. - * | | |Note: Used only for DDR2 and DDR3 SDRAMs. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * @var UMCTL2_T::DRAMTMG15 - * Offset: 0x13C SDRAM Timing Register 15 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |t_stab_x32|Stabilization time (tSTAB) - * | | |It is required in the following two cases for DDR3 RDIMM: - * | | |u00B7 When exiting power saving mode, if the clock is stopped, after re-enabling it the clock must be stable for a time specified by tSTAB - * | | |u00B7 After issuing control words that refers to clock timing (Specification: 6us for DDR3) - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to recommended value divided by two and round it up to next integer. - * | | |Unit: Multiples of 32 DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[31] |en_dfi_lp_t_stab|Enable Bit for Using tSTAB When Exiting DFI LP - * | | |u00B7 1 - Enable using tSTAB when exiting DFI LP - * | | |This must be set when the PHY is stopping the clock during DFI LP to save maximum power. - * | | |u00B7 0 - Disable using tSTAB when exiting DFI LP. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * @var UMCTL2_T::ZQCTL0 - * Offset: 0x180 ZQ Control Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |t_zq_short_nop|Number of DFI Clock Cycles of NOP Required After a ZQCS (ZQ Calibration Short)/MPC(ZQ Latch) Command is Issued to SDRAM - * | | |tZQCS for DDR3 - * | | |When the controller is operating in 1:2 frequency ratio mode, program this to tZQCS/2 and round it up to the next integer value. - * | | |This is only present for designs supporting DDR3 devices. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * |[26:16] |t_zq_long_nop|Number of DFI Clock Cycles of NOP Required After a ZQCL (ZQ Calibration Long)/MPC (ZQ Start) Command is Issued to SDRAM - * | | |tZQoper for DDR3 - * | | |When the controller is operating in 1:2 frequency ratio mode: - * | | |DDR3: program this to tZQoper/2 and round it up to the next integer value. - * | | |This is only present for designs supporting DDR3 devices. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * |[29] |zq_resistor_shared|ZQ Resistor Shared Between Ranks - * | | |u00B7 1 - Denotes that ZQ resistor is shared between ranks - * | | |Means ZQinit/ZQCL/ZQCS/MPC(ZQ calibration) commands are sent to one rank at a time with tZQinit/tZQCL/tZQCS/tZQCAL/tZQLAT timing met between commands so that commands to different ranks do not overlap - * | | |u00B7 0 - ZQ resistor is not shared - * | | |This is only present for designs supporting DDR3 devices. - * | | |Programming Mode: Static - * |[30] |dis_srx_zqcl|Disable Issuing of ZQCL/MPC(ZQ Calibration) Command at Self-Refresh/SR-Power Down Exit - * | | |u00B7 1 - Disable issuing of ZQCL/MPC(ZQ calibration) command at self-refresh/SR-Power down exit - * | | |Only applicable when run in DDR3 mode - * | | |u00B7 0 - Enable issuing of ZQCL/MPC(ZQ calibration) command at self-refresh/SR-Power down exit - * | | |Only applicable when run in DDR3 mode - * | | |This is only present for designs supporting DDR3 devices. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[31] |dis_auto_zq|Disable Auto Generation of ZQCS/MPC(ZQ Calibration) Command - * | | |u00B7 1 - Disable uMCTL2 generation of ZQCS/MPC(ZQ calibration) command - * | | |Register DBGCMD.zq_calib_short can be used instead to issue ZQ calibration request from APB module - * | | |u00B7 0 - Internally generate ZQCS/MPC(ZQ calibration) commands based on ZQCTL1.t_zq_short_interval_x1024 - * | | |This is only present for designs supporting DDR3 devices. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::ZQCTL1 - * Offset: 0x184 ZQ Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[19:0] |t_zq_short_interval_x1024|Average Interval to Wait Between Automatically Issuing ZQCS - * | | |Average Interval to Wait Between Automatically Issuing ZQCS (ZQ Calibration Short)/MPC(ZQ Calibration) Commands to DDR3 Devices. - * | | |Meaningless, if ZQCTL0.dis_auto_zq=1. - * | | |This is only present for designs supporting DDR3 devices. - * | | |Unit: Multiples of 1024 DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::DFITMG0 - * Offset: 0x190 DFI Timing Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |dfi_tphy_wrlat|Write latency - * | | |Number of clocks from the write command to write data enable (dfi_wrdata_en) - * | | |This corresponds to the DFI timing parameter tphy_wrlat. - * | | |Refer to PHY specification for correct value. - * | | |Unit: DFI clock cycles or DFI PHY clock cycles, depending on DFITMG0.dfi_wrdata_use_dfi_phy_clk. - * | | |Programming Mode: Quasi-dynamic Group 2, Group 4 - * |[13:8] |dfi_tphy_wrdata|Number of Clock Cycles Between When dfi_wrdata_en is Asserted to When the Associated Write Data is Driven on the dfi_wrdata Signal - * | | |This corresponds to the DFI timing parameter tphy_wrdata - * | | |For more information on correct value, see PHY specification - * | | |Note, maximum supported value is 8. - * | | |Unit: DFI clock cycles or DFI PHY clock cycles, depending on DFITMG0.dfi_wrdata_use_dfi_phy_clk. - * | | |Programming Mode: Quasi-dynamic Group 4 - * |[15] |dfi_wrdata_use_dfi_phy_clk|dfi_wrdata_en/dfi_wrdata/dfi_wrdata_mask is Generated Using HDR (DFI Clock) or SDR (DFI PHY Clock) Values - * | | |Selects whether value in DFITMG0.dfi_tphy_wrlat is in terms of HDR (DFI clock) or SDR (DFI PHY clock) cycles. - * | | |Selects whether value in DFITMG0.dfi_tphy_wrdata is in terms of HDR (DFI clock) or SDR (DFI PHY clock) cycles. - * | | |u00B7 0 in terms of HDR (DFI clock) cycles - * | | |Refer to PHY specification for correct value - * | | |If using a Synopsys DWC DDR3/2 PHY, this field must be set to 0. - * | | |Programming Mode: Static - * |[22:16] |dfi_t_rddata_en|Time from the Assertion of a Read Command on the DFI Interface to the Assertion of the dfi_rddata_en Signal - * | | |Refer to PHY specification for correct value. - * | | |This corresponds to the DFI parameter trddata_en. - * | | |Unit: DFI clock cycles or DFI PHY clock cycles, depending on DFITMG0.dfi_rddata_use_dfi_phy_clk. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 4 - * |[23] |dfi_rddata_use_dfi_phy_clk|dfi_rddata_en/dfi_rddata/dfi_rddata_valid is Generated Using HDR (DFI Clock) or SDR (DFI PHY Clock) Values - * | | |Selects whether value in DFITMG0.dfi_t_rddata_en is in terms of HDR (DFI clock) or SDR (DFI PHY clock) cycles: - * | | |u00B7 0 in terms of HDR (DFI clock) cycles - * | | |Refer to PHY specification for correct value. - * | | |If using a Synopsys DWC DDR3/2 PHY, this field must be set to 0. - * | | |Programming Mode: Static - * |[28:24] |dfi_t_ctrl_delay|Number of DFI Clock Cycles After an Assertion or De-assertion of the DFI Control Signals that the Control Signals at the PHY-DRAM Interface Reflect the Assertion or De-assertion - * | | |If the DFI clock and the memory clock are not phase-aligned, this timing parameter must be rounded up to the next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 4 - * @var UMCTL2_T::DFITMG1 - * Offset: 0x194 DFI Timing Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |dfi_t_dram_clk_enable|Number of DFI Clock Cycles from the De-assertion of the dfi_dram_clk_disable Signal on the DFI Until the First Valid Rising Edge of the Clock to the DRAM Memory Devices, at the PHY-DRAM Boundary - * | | |If the DFI clock and the memory clock are not phase aligned, this timing parameter must be rounded up to the next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 4 - * |[12:8] |dfi_t_dram_clk_disable|Number of DFI Clock Cycles from the Assertion of the dfi_dram_clk_disable Signal on the DFI Until the Clock to the DRAM Memory Devices, at the PHY-DRAM Boundary, Maintains a Low Value - * | | |If the DFI clock and the memory clock are not phase aligned, this timing parameter must be rounded up to the next integer value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 4 - * |[20:16] |dfi_t_wrdata_delay|Number of DFI Clock Cycles Between When the dfi_wrdata_en Signal is Asserted and When the Corresponding Write Data Transfer is Completed on the DRAM Bus - * | | |This corresponds to the DFI timing parameter twrdata_delay. - * | | |For more information on correct value, see PHY specification. - * | | |For DFI 2.1 PHY, set to tphy_wrdata + (delay of DFI write data to the DRAM). - * | | |Value to be programmed is in terms of DFI clocks, not PHY clocks. - * | | |In FREQ_RATIO=2, divide PHY's value by 2 and round up to next integer. - * | | |If using DFITMG0.dfi_wrdata_use_dfi_phy_clk=1, add 1 to the value. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 4 - * |[25:24] |dfi_t_parin_lat|Number of DFI PHY Clock Cycles Between When the dfi_cs signal is Asserted and When the Associated dfi_parity_in Signal is Driven - * | | |Unit: DFI PHY clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 4 - * @var UMCTL2_T::DFILPCFG0 - * Offset: 0x198 DFI Low Power Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dfi_lp_en_pd|Enable Bit for DFI Low Power Interface Handshaking During Power Down Entry/Exit - * | | |u00B7 0 - Disabled - * | | |u00B7 1 - Enabled - * | | |Programming Mode: Static - * |[7:4] |dfi_lp_wakeup_pd|Value in DFI Clock Cycles to Drive on dfi_lp_wakeup Signal When Power-Down Mode is Entered - * | | |Determines the DFI's tlp_wakeup time: - * | | |u00B7 0x0 - 16 cycles - * | | |u00B7 0x1 - 32 cycles - * | | |u00B7 0x2 - 64 cycles - * | | |u00B7 0x3 - 128 cycles - * | | |u00B7 0x4 - 256 cycles - * | | |u00B7 0x5 - 512 cycles - * | | |u00B7 0x6 - 1024 cycles - * | | |u00B7 0x7 - 2048 cycles - * | | |u00B7 0x8 - 4096 cycles - * | | |u00B7 0x9 - 8192 cycles - * | | |u00B7 0xA - 16384 cycles - * | | |u00B7 0xB - 32768 cycles - * | | |u00B7 0xC - 65536 cycles - * | | |u00B7 0xD - 131072 cycles - * | | |u00B7 0xE - 262144 cycles - * | | |u00B7 0xF - Unlimited - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * |[8] |dfi_lp_en_sr|Enable Bit for DFI Low Power Interface Handshaking During Self-Refresh Entry/Exit - * | | |u00B7 0 - Disabled - * | | |u00B7 1 - Enabled - * | | |Programming Mode: Static - * |[15:12] |dfi_lp_wakeup_sr|Value in DFI Clock Cycles to Drive on dfi_lp_wakeup Signal When Self-Refresh Mode is Entered - * | | |Determines the DFI's tlp_wakeup time: - * | | |u00B7 0x0 - 16 cycles - * | | |u00B7 0x1 - 32 cycles - * | | |u00B7 0x2 - 64 cycles - * | | |u00B7 0x3 - 128 cycles - * | | |u00B7 0x4 - 256 cycles - * | | |u00B7 0x5 - 512 cycles - * | | |u00B7 0x6 - 1024 cycles - * | | |u00B7 0x7 - 2048 cycles - * | | |u00B7 0x8 - 4096 cycles - * | | |u00B7 0x9 - 8192 cycles - * | | |u00B7 0xA - 16384 cycles - * | | |u00B7 0xB - 32768 cycles - * | | |u00B7 0xC - 65536 cycles - * | | |u00B7 0xD - 131072 cycles - * | | |u00B7 0xE - 262144 cycles - * | | |u00B7 0xF - Unlimited - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * |[28:24] |dfi_tlp_resp|Setting in DFI Clock Cycles for DFI's tlp_resp Time - * | | |Same value is used for both Power Down, self-refresh, Deep Power Down and Maximum Power Saving modes. - * | | |For more information on recommended values, see PHY databook - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::DFIUPD0 - * Offset: 0x1A0 DFI Update Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |dfi_t_ctrlup_min|Minimum Number of DFI Clock Cycles that the dfi_ctrlupd_req Signal must be Asserted The uMCTL2 expects the PHY to respond within this time. If the PHY does not respond, the uMCTL2 de-asserts dfi_ctrlupd_req after dfi_t_ctrlup_min + 2 cycles. Lowest value to assign to this variable is 0x1. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * |[25:16] |dfi_t_ctrlup_max|Maximum Number of DFI Clock Cycles that the dfi_ctrlupd_req Signal Can Assert - * | | |Lowest value to assign to this variable is 0x40. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * |[29] |ctrlupd_pre_srx|dfi_ctrlupd_req Selection at SRX - * | | |u00B7 0 - Send ctrlupd after SRX - * | | |u00B7 1 - Send ctrlupd before SRX If DFIUPD0.dis_auto_ctrlupd_srx=1, this register has no impact, because no dfi_ctrlupd_req is issued when SRX. - * | | |Programming Mode: Static - * |[30] |dis_auto_ctrlupd_srx|Disable Bit for Automatic dfi_ctrlupd_req Generation by uMCTL2 at Self-Refresh Exit - * | | |When '1', disable the automatic dfi_ctrlupd_req generation by the uMCTL2 at self-refresh exit. - * | | |When '0', uMCTL2 issues a dfi_ctrlupd_req before or after exiting self-refresh, depending on DFIUPD0.ctrlupd_pre_srx. - * | | |Programming Mode: Static - * |[31] |dis_auto_ctrlupd|Disable Bit for Automatic dfi_ctrlupd_req Generation by uMCTL2 - * | | |When '1', disable the automatic dfi_ctrlupd_req generation by the uMCTL2. - * | | |The controller must issue the dfi_ctrlupd_req signal using register DBGCMD.ctrlupd. - * | | |When '0', uMCTL2 issues dfi_ctrlupd_req periodically. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::DFIUPD1 - * Offset: 0x1A4 DFI Update Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |dfi_t_ctrlupd_interval_max_x1024|Maximum Amount of Time Between uMCTL2 Initiated DFI Update Requests - * | | |This timer resets with each update request; when the timer expires dfi_ctrlupd_req is sent and traffic is blocked until the dfi_ctrlupd_ackx is received. - * | | |PHY can use this idle time to recalibrate the delay lines to the DLLs - * | | |The DFI controller update is also used to reset PHY FIFO pointers in case of data capture errors. - * | | |Updates are required to maintain calibration over PVT, but frequent updates may impact performance - * | | |Minimum allowed value for this field is 1. - * | | |Note: Value programmed for DFIUPD1.dfi_t_ctrlupd_interval_max_x1024 must be greater than DFIUPD1.dfi_t_ctrlupd_interval_min_x1024. - * | | |Unit: Multiples of 1024 DFI clock cycles. - * | | |Programming Mode: Static - * |[23:16] |dfi_t_ctrlupd_interval_min_x1024|Minimum Amount of Time Between uMCTL2 Initiated DFI Update Requests (which is Executed whenever the uMCTL2 is Idle) - * | | |Set this number higher to reduce the frequency of update requests, which can have a small impact on the latency of the first read request when the uMCTL2 is idle. - * | | |The minimum allowed value for this field is 1. - * | | |Unit: Multiples of 1024 DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::DFIUPD2 - * Offset: 0x1A8 DFI Update Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31] |dfi_phyupd_en|Enable Bit for Acknowledging PHY-Initiated Updates - * | | |u00B7 0 - Disabled - * | | |u00B7 1 - Enabled - * | | |Programming Mode: Static - * @var UMCTL2_T::DFIMISC - * Offset: 0x1B0 DFI Miscellaneous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dfi_init_complete_en|PHY Initialization Complete Enable Bit - * | | |When asserted the dfi_init_complete signal can be used to trigger SDRAM initialisation - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[4] |ctl_idle_en|Enable Bit for ctl_idle Signal - * | | |It is non-DFI related pin specific to certain Synopsys PHYs. - * | | |For more information on ctl_idle functionality, see signal description of ctl_idle signal. - * | | |Programming Mode: Static - * |[5] |dfi_init_start|PHY Initialization Start Request Signal - * | | |When asserted it triggers the PHY init start request. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[12:8] |dfi_frequency|Operating Frequency of System - * | | |The number of supported frequencies and the mapping of signal values to clock frequencies are defined by the PHY. - * | | |Programming Mode: Quasi-dynamic Group 1 - * @var UMCTL2_T::DFISTAT - * Offset: 0x1BC DFI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dfi_init_complete|Status flag when the DFI initialization has been completed - * | | |The DFI INIT triggered by dfi_init_start signal and then the dfi_init_complete flag is polled to know when the initialization is done. - * | | |Programming Mode: Dynamic - * |[1] |dfi_lp_ack|Value of the dfi_lp_ack to the controller - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::DFIPHYMSTR - * Offset: 0x1C4 DFI PHY Master - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dfi_phymstr_en|PHY Master Interface Enable Bit - * | | |u00B7 0 - Disabled - * | | |u00B7 1 - Enabled - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP0 - * Offset: 0x200 Address Map Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |addrmap_cs_bit0|HIF Address Bits for Rank Address Bit 0 - * | | |Valid Range: 0 to 29, and 31 - * | | |Internal Base: 6 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 31 and then rank address bit 0 is set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP1 - * Offset: 0x204 Address Map Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |addrmap_bank_b0|HIF Address Bits for Bank Address Bit 0 - * | | |Valid Range: 0 to 32, and 63 - * | | |Internal Base: 2 - * | | |The selected HIF address bit for each of the bank address bits is determined by adding the internal base to the value of this field. - * | | |If unused, set to 63 and then bank address bit 0 is set to 0. - * | | |Programming Mode: Static - * |[13:8] |addrmap_bank_b1|HIF Address Bits for Bank Address Bit 1 - * | | |Valid Range: 0 to 32, and 63 - * | | |Internal Base: 3 - * | | |The selected HIF address bit for each of the bank address bits is determined by adding the internal base to the value of this field. - * | | |If unused, set to 63 and then bank address bit 1 is set to 0. - * | | |Programming Mode: Static - * |[21:16] |addrmap_bank_b2|HIF Address Bits for Bank Address Bit 2 - * | | |Valid Range: 0 to 31, and 63 - * | | |Internal Base: 4 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 63 and then bank address bit 2 is set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP2 - * Offset: 0x208 Address Map Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |addrmap_col_b2|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 2 - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 3 - * | | |Valid Range: 0 to 7 - * | | |Internal Base: 2 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |In our chip, we configure hardware parameter "MEMC_BURST_LENGTH" to equal to 8 and Full Bus Width (MSTR.data_bus_width==00), it is recommended to program this to 0 so that HIF[2] maps to column address bit 2. - * | | |Programming Mode: Static - * |[12:8] |addrmap_col_b3|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 3 - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 4 - * | | |Valid Range: 0 to 7. - * | | |Internal Base: 3 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |Programming Mode: Static - * |[19:16] |addrmap_col_b4|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 4 - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 5 - * | | |Valid Range: 0 to 7, and 15 - * | | |Internal Base: 4 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 15 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * |[27:24] |addrmap_col_b5|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 5 - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 6 - * | | |Valid Range: 0 to 7, and 15 - * | | |Internal Base: 5 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 15 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP3 - * Offset: 0x20C Address Map Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |addrmap_col_b6|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 6. - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 7. - * | | |Valid Range: 0 to 7, and 31. - * | | |Internal Base: 6 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 31 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * |[12:8] |addrmap_col_b7|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 7 - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 8 - * | | |Valid Range: 0 to 7, and 31. - * | | |Internal Base: 7 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 31 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * |[20:16] |addrmap_col_b8|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 8 - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 9 - * | | |Valid Range: 0 to 7, and 31. - * | | |Internal Base: 8 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |Note: Per JEDEC DDR2/3 specification, column address bit 10 is reserved for indicating auto-precharge, and hence no source address bit can be mapped to column address bit 10. - * | | |If unused, set to 31 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * |[28:24] |addrmap_col_b9|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 9 - * | | |u00B7 Half bus width mode - Selects the HIF address bit used as column address bit 11 - * | | |Valid Range: 0 to 7. - * | | |Internal Base: 9 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |Note: Per JEDEC DDR2/3 specification, column address bit 10 is reserved for indicating auto-precharge, and hence no source address bit can be mapped to column address bit 10. - * | | |If unused, set to 31 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP4 - * Offset: 0x210 Address Map Register 4 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |addrmap_col_b10|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode: Selects the HIF address bit used as column address bit 11 - * | | |u00B7 Half bus width mode: Selects the HIF address bit used as column address bit 13 - * | | |Valid Range: 0 to 7, and 31. - * | | |Internal Base: 10 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |Note: Per JEDEC DDR2/3 specification, column address bit 10 is reserved for indicating auto-precharge, and hence no source address bit can be mapped to column address bit 10. - * | | |If unused, set to 31 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * |[12:8] |addrmap_col_b11|HIF Address Bit for Column Address Bit for Three Bus Width Modes - * | | |u00B7 Full bus width mode - Selects the HIF address bit used as column address bit 13 - * | | |u00B7 Half bus width mode - UNUSED - * | | |See later in this description for value you need to set to make it unused - * | | |Valid Range: 0 to 7, and 31. - * | | |Internal Base: 11 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |Note: Per JEDEC DDR2/3 specification, column address bit 10 is reserved for indicating auto-precharge, and hence no source address bit can be mapped to column address bit 10. - * | | |If unused, set to 31 and then this column address bit is set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP5 - * Offset: 0x214 Address Map Register 5 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |addrmap_row_b0|HIF Address Bits for Row Address Bit 0 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 6 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field. - * | | |Programming Mode: Static - * |[11:8] |addrmap_row_b1|HIF Address Bits for Row Address Bit 1 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 7 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field. - * | | |Programming Mode: Static - * |[19:16] |addrmap_row_b2_10|HIF Address Bits for Row Address Bits 2 to 10 - * | | |Valid Range: 0 to 11, and 15 - * | | |Internal Base: 8 (for row address bit 2), 9 (for row address bit 3), 10 (for row address bit 4) and so on, increasing to 16 (for row address bit 10) - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field. - * | | |When set to 15, the values of row address bits 2 to 10 are defined by registers ADDRMAP9, ADDRMAP10, ADDRMAP11. - * | | |Programming Mode: Static - * |[27:24] |addrmap_row_b11|HIF Address Bits for Row Address Bit 11 - * | | |Valid Range: 0 to 11, and 15 - * | | |Internal Base: 17 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 15 and then row address bit 11 is set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP6 - * Offset: 0x218 Address Map Register 6 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |addrmap_row_b12|HIF Address Bit for Row Address Bit 12 - * | | |Valid Range: 0 to 11, and 15 - * | | |Internal Base: 18 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 15 and then row address bit 12 is set to 0. - * | | |Programming Mode: Static - * |[11:8] |addrmap_row_b13|HIF Address Bit for Row Address Bit 13 - * | | |Valid Range: 0 to 11, and 15 - * | | |Internal Base: 19 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 15 and then row address bit 13 is set to 0. - * | | |Programming Mode: Static - * |[19:16] |addrmap_row_b14|HIF Address Bit for Row Address Bit 14 - * | | |Valid Range: 0 to 11, and 15 - * | | |Internal Base: 20 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 15 and then row address bit 14 is set to 0. - * | | |Programming Mode: Static - * |[27:24] |addrmap_row_b15|HIF Address Bit for Row Address Bit 15 - * | | |Valid Range: 0 to 11, and 15 - * | | |Internal Base: 21 - * | | |The selected HIF address bit is determined by adding the internal base to the value of this field. - * | | |If unused, set to 15 and then row address bit 15 is set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP9 - * Offset: 0x224 Address Map Register 9 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |addrmap_row_b2|HIF Address Bits for Row Address Bit 2 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 8 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * |[11:8] |addrmap_row_b3|HIF Address Bits for Row Address Bit 3 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 9 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * |[19:16] |addrmap_row_b4|HIF Address Bits for Row Address Bit 4 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 10 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * |[27:24] |addrmap_row_b5|HIF Address Bits for Row Address Bit 5 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 11 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP10 - * Offset: 0x228 Address Map Register 10 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |addrmap_row_b6|HIF Address Bits for Row Address Bit 6 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 12 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * |[11:8] |addrmap_row_b7|HIF Address Bits for Row Address Bit 7 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 13 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * |[19:16] |addrmap_row_b8|HIF Address Bits for Row Address Bit 8 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 14 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * |[27:24] |addrmap_row_b9|HIF Address Bits for Row Address Bit 9 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 15 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * @var UMCTL2_T::ADDRMAP11 - * Offset: 0x22C Address Map Register 11 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |addrmap_row_b10|HIF Address Bits for Row Address Bit 10 - * | | |Valid Range: 0 to 11 - * | | |Internal Base: 16 - * | | |The selected HIF address bit for each of the row address bits is determined by adding the internal base to the value of this field - * | | |This register field is used only when ADDRMAP5.addrmap_row_b2_10 is set to value 15. - * | | |Programming Mode: Static - * @var UMCTL2_T::ODTCFG - * Offset: 0x240 ODT Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:2] |rd_odt_delay|Delay in DFI PHY Clock Cycles from Issuing a Read Command to Setting ODT Values Associated with that Command - * | | |ODT setting must remain constant for the entire time that DQS is driven by the uMCTL2. - * | | |Recommended values: - * | | |DDR2: - * | | |u00B7 CL + AL - 4 (not DDR2-1066), - * | | |u00B7 CL + AL - 5 (DDR2-1066) If (CL + AL - 4 < 0), uMCTL2 does not support ODT for read operation. - * | | |DDR3: - * | | |u00B7 CL - CWL - * | | |Unit: DFI PHY clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 4 - * |[11:8] |rd_odt_hold|DFI PHY Clock Cycles to Hold ODT for a Read Command - * | | |The minimum supported value is 2. - * | | |Recommended values: - * | | |DDR2: - * | | |u00B7 BL8 - 0x6 (not DDR2-1066), 0x7 (DDR2-1066) - * | | |u00B7 BL4 - 0x4 (not DDR2-1066), 0x5 (DDR2-1066) - * | | |DDR3: - * | | |u00B7 BL8 - 0x6 - * | | |Unit: DFI PHY clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 4 - * |[20:16] |wr_odt_delay|Delay in DFI PHY Clock Cycles from Issuing a Write Command to Setting ODT Values Associated with that Command - * | | |ODT setting must remain constant for the entire time that DQS is driven by the uMCTL2. - * | | |Recommended values: - * | | |DDR2: - * | | |u00B7 CWL + AL - 3 (DDR2-400/533/667), - * | | |u00B7 CWL + AL - 4 (DDR2-800), - * | | |u00B7 CWL + AL - 5 (DDR2-1066) If (CWL + AL - 3 < 0), uMCTL2 does not support ODT for write operation. - * | | |DDR3: - * | | |u00B7 0x0 - * | | |Unit: DFI PHY clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 4 - * |[27:24] |wr_odt_hold|DFI PHY Clock Cycles to Hold ODT for a Write Command - * | | |The minimum supported value is 2. - * | | |Recommended values: - * | | |DDR2: - * | | |u00B7 BL8 - 0x5 (DDR2-400/533/667), 0x6 (DDR2-800), 0x7 (DDR2-1066) - * | | |u00B7 BL4 - 0x3 (DDR2-400/533/667), 0x4 (DDR2-800), 0x5 (DDR2-1066) - * | | |DDR3: - * | | |u00B7 BL8 - 0x6 - * | | |Unit: DFI PHY clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 1, Group 4 - * @var UMCTL2_T::ODTMAP - * Offset: 0x244 ODT/Rank Map Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |rank0_wr_odt|Remote ODTs Must be Turned on During a Write to Rank 0. - * | | |Each rank has a remote ODT (in the SDRAM) which can be turned on by setting the appropriate bit here. - * | | |Rank 0 is controlled by the LSB; rank 1 is controlled by bit next to the LSB, and so on. - * | | |For each rank, set its bit to 1 to enable its ODT. - * | | |Programming Mode: Static - * |[5:4] |rank0_rd_odt|Remote ODTs Must be Turned on During a Read from Rank 0 - * | | |Each rank has a remote ODT (in the SDRAM) which can be turned on by setting the appropriate bit here. - * | | |Rank 0 is controlled by the LSB; rank 1 is controlled by bit next to the LSB, and so on. - * | | |For each rank, set its bit to 1 to enable its ODT. - * | | |Programming Mode: Static - * |[9:8] |rank1_wr_odt|Remote ODTs Must be Turned on During a Write to Rank 1 - * | | |Each rank has a remote ODT (in the SDRAM) which can be turned on by setting the appropriate bit here. - * | | |Rank 0 is controlled by the LSB; rank 1 is controlled by bit next to the LSB, and so on. - * | | |For each rank, set its bit to 1 to enable its ODT. - * | | |Present only in configurations that have 2 or more ranks. - * | | |Programming Mode: Static - * |[13:12] |rank1_rd_odt|Remote ODTs Must be Turned on During a Read from Rank 1 - * | | |Each rank has a remote ODT (in the SDRAM) which can be turned on by setting the appropriate bit here. - * | | |Rank 0 is controlled by the LSB; rank 1 is controlled by bit next to the LSB, and so on. - * | | |For each rank, set its bit to 1 to enable its ODT. - * | | |Present only in configurations that have 2 or more ranks. - * | | |Programming Mode: Static - * @var UMCTL2_T::SCHED - * Offset: 0x250 Scheduler Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |prefer_write|Setting Bit for Bank Selector Prefers Writes over Reads - * | | |If set, then the bank selector prefers writes over reads. - * | | |FOR DEBUG ONLY. - * | | |Programming Mode: Static - * |[2] |Pageclose |Page Close Bit - * | | |If true, bank is kept open only while there are page hit transactions available in the CAM to that bank. - * | | |The last read or write command in the CAM with a bank and page hit is executed with auto-precharge if SCHED1.pageclose_timer=0. - * | | |Even if this register set to 1 and SCHED1.pageclose_timer is set to 0, explicit precharge (and not auto-precharge) may be issued in some cases where there is a mode switch between Write and Read or between LPR and HPR - * | | |The Read and Write commands that are executed as part of the ECC scrub requests are also executed without auto-precharge. - * | | |If false, the bank remains open until there is a need to close it (to open a different page, or for page timeout or refresh timeout) - also known as open page policy - * | | |The open page policy can be overridden by setting the per-command-autopre bit on the HIF interface (hif_cmd_autopre). - * | | |The pageclose feature provids a midway between Open and Close page policies. - * | | |FOR PERFORMANCE ONLY. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[12:8] |lpr_num_entries|Number of Entries in the Low Priority Transaction Store - * | | |It is this value + 1. - * | | |(MEMC_NO_OF_ENTRY (hardware configures to 32) - (SCHED.lpr_num_entries + 1)) is the number of entries available for the high priority transaction store. - * | | |Setting this to maximum value allocates all entries to low priority transaction store. - * | | |Setting this to 0 allocates 1 entry to low priority transaction store and the rest to high priority transaction store. - * | | |Programming Mode: Static - * |[23:16] |go2critical_hysteresis|UNUSED. - * | | |Programming Mode: Static - * |[30:24] |rdwr_idle_gap|Switch Clock Cycles Between Different Transaction Store - * | | |When the preferred transaction store is empty for these many clock cycles, switch to the alternate transaction store if it is non-empty. - * | | |The read transaction store (both high and low priority) is the default preferred transaction store and the write transaction store is the alternative store. - * | | |When prefer write over read is set this is reversed. - * | | |0x0 is a legal value for this register - * | | |When set to 0x0, the transaction store switching happens immediately when the switching conditions become true. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::SCHED1 - * Offset: 0x254 Scheduler Control Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |pageclose_timer|Page Close Timer - * | | |This field works in conjunction with SCHED.pageclose - * | | |It only has meaning if SCHED.pageclose equals to 1. - * | | |If SCHED.pageclose==1 and pageclose_timer==0, then an auto-precharge may be scheduled for last read or write command in the CAM with a bank and page hit. - * | | |Note, sometimes an explicit precharge is scheduled instead of the auto-precharge - * | | |For more information, see SCHED.pageclose. - * | | |If SCHED.pageclose==1 and pageclose_timer>0, then an auto-precharge is not scheduled for last read or write command in the CAM with a bank and page hit. - * | | |Instead, a timer is started, with pageclose_timer as the initial value. - * | | |There is a timer on a per bank basis. - * | | |The timer decrements unless the next read or write in the CAM to a bank is a page hit. - * | | |It gets reset to pageclose_timer value if the next read or write in the CAM to a bank is a page hit. - * | | |Once the timer has reached zero, an explicit precharge is attempted to be scheduled. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Static - * @var UMCTL2_T::PERFHPR1 - * Offset: 0x25C High Priority Read CAM Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |hpr_max_starve|Number of DFI Clocks that the HPR Queue can be Starved Before It Goes Critical - * | | |Indicates the number of DFI clocks that the HPR queue can be starved before it goes critical. - * | | |The minimum valid functional value for this register is 0x1. - * | | |Programming it to 0x0 disables the starvation functionality. - * | | |During normal operation, this function must not be disabled as it causes excessive latencies. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[31:24] |hpr_xact_run_length|Number of Transactions that are Serviced once the HPR Queue Goes Critical - * | | |Indicates the number of transactions that are serviced once the HPR queue goes critical is the smaller of: - * | | |u00B7 (a) This number - * | | |u00B7 (b) Number of transactions available - * | | |Unit: Transaction. - * | | |FOR PERFORMANCE ONLY. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PERFLPR1 - * Offset: 0x264 Low Priority Read CAM Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |lpr_max_starve|Number of DFI Clocks that the LPR Queue can be Starved Before It Goes Critical - * | | |Indicates the number of DFI clocks that the LPR queue can be starved before it goes critical. - * | | |The minimum valid functional value for this register is 0x1. - * | | |Programming it to 0x0 disables the starvation functionality. - * | | |During normal operation, this function must not be disabled as it causes excessive latencies. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[31:24] |lpr_xact_run_length|Number of Transactions that are Serviced Once the LPR Queue Goes Critical - * | | |Indicates the number of transactions that are serviced once the LPR queue goes critical is the smaller of: - * | | |u00B7 (a) This number - * | | |u00B7 (b) Number of transactions available - * | | |Unit: Transaction. - * | | |FOR PERFORMANCE ONLY. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PERFWR1 - * Offset: 0x26C Write CAM Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |w_max_starve|Number of DFI Clocks that the WR Queue can be Starved Before It Goes Critical - * | | |Indicates the number of DFI clocks that the WR queue can be starved before it goes critical. - * | | |The minimum valid functional value for this register is 0x1. - * | | |Programming it to 0x0 disables the starvation functionality. - * | | |During normal operation, this function must not be disabled as it causes excessive latencies. - * | | |FOR PERFORMANCE ONLY. - * | | |Unit: DFI clock cycles. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[31:24] |w_xact_run_length|Number of Transactions that are Serviced Once the WR Queue Goes Critical - * | | |Indicates the number of transactions that are serviced once the WR queue goes critical is the smaller of: - * | | |u00B7 (a) This number - * | | |u00B7 (b) Number of transactions available - * | | |Unit: Transaction. - * | | |FOR PERFORMANCE ONLY. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::DBG0 - * Offset: 0x300 Debug Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dis_wc |Disable Bit for Write Combine - * | | |When 1, disable write combine. - * | | |FOR DEBUG ONLY. - * | | |Programming Mode: Static - * |[1] |dis_rd_bypass|Disable Bit for Bypass Path for High Priority Read Page Hits - * | | |Only present in designs supporting read bypass. - * | | |When 1, disable bypass path for high priority read page hits. - * | | |FOR DEBUG ONLY. - * | | |Programming Mode: Static - * |[2] |dis_act_bypass|Disable Bit for Bypass Path for High Priority Read Activates - * | | |Only present in designs supporting activate bypass. - * | | |When 1, disable bypass path for high priority read activates. - * | | |FOR DEBUG ONLY. - * | | |Programming Mode: Static - * |[4] |dis_collision_page_opt|Disable Bit for Collision Page Option - * | | |When this is set to '0', auto-precharge is disabled for the flushed command in a collision case. - * | | |Collision cases are write followed by read to same address, read followed by write to same address, or write followed by write to same address with DBG0.dis_wc bit = 1 (where same address comparisons exclude the two address bits representing critical word). - * | | |FOR DEBUG ONLY. - * | | |Programming Mode: Static - * |[6] |dis_max_rank_rd_opt|Disable Bit to Optimize max_rank_rd and max_logical_rank_rd - * | | |This register is for debug purpose only. - * | | |For normal operation, this register must be set to 0. - * | | |Programming Mode: Static - * |[7] |dis_max_rank_wr_opt|Disable Bit to Optimize max_rank_wr and max_logical_rank_wr - * | | |This register is for debug purpose only. - * | | |For normal operation, this register must be set to 0. - * | | |Programming Mode: Static - * @var UMCTL2_T::DBG1 - * Offset: 0x304 Debug Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |dis_dq |Disable Bit for De-queue Transactions - * | | |When 1, uMCTL2 does not de-queue any transactions from the CAM. - * | | |Bypass is also disabled. - * | | |All transactions are queued in the CAM - * | | |No reads or writes are issued to SDRAM as long as this is asserted. - * | | |This bit may be used to prevent reads or writes being issued by the uMCTL2, which makes it safe to modify certain register fields associated with reads and writes. - * | | |After setting this bit, it is strongly recommended to poll DBGCAM.wr_data_pipeline_empty and DBGCAM.rd_data_pipeline_empty, before making changes to any registers which affect reads and writes. - * | | |This ensures that the relevant logic in the DDRC is idle. - * | | |This bit is intended to be switched on-the-fly. - * | | |Programming Mode: Dynamic - * |[1] |dis_hif |Disable Bit for HIF Command - * | | |When 1, uMCTL2 asserts the HIF command signal hif_cmd_stall. - * | | |uMCTL2 ignores the hif_cmd_valid and all other associated request signals. - * | | |This bit is intended to be switched on-the-fly. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::DBGCAM - * Offset: 0x308 CAM Debug Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |dbg_hpr_q_depth|High Priority Read Queue Depth - * | | |FOR DEBUG ONLY. - * | | |Programming Mode: Dynamic - * |[13:8] |dbg_lpr_q_depth|Low Priority Read Queue Depth - * | | |The last entry of LPR queue is reserved for ECC SCRUB operation - * | | |This entry is not included in the calculation of the queue depth. - * | | |FOR DEBUG ONLY - * | | |Programming Mode: Dynamic - * |[21:16] |dbg_w_q_depth|Write Queue Depth - * | | |The last entry of WR queue is reserved for ECC SCRUB operation - * | | |This entry is not included in the calculation of the queue depth. - * | | |FOR DEBUG ONLY - * | | |Programming Mode: Dynamic - * |[24] |dbg_stall |Command Queues and Data Buffers Stall - * | | |FOR DEBUG ONLY. - * | | |Programming Mode: Dynamic - * |[25] |dbg_rd_q_empty|Read Command Queues and Read Data Buffers Empty - * | | |When 1, all the Read command queues and Read data buffers inside DDRC are empty. - * | | |This register is to be used for debug purpose. - * | | |An example use-case scenario: When the controller enters self-refresh using the Low-Power entry sequence, controller is expected to have executed all the commands in its queues and the write and read data drained - * | | |Hence this register must be 1 at that time. - * | | |FOR DEBUG ONLY - * | | |Programming Mode: Dynamic - * |[26] |dbg_wr_q_empty|Write Command Queues and Write Data Buffers Empty - * | | |When 1, all the Write command queues and Write data buffers inside DDRC are empty. - * | | |This register is to be used for debug purpose. - * | | |An example use-case scenario: When the controller enters self-refresh using the Low-Power entry sequence, controller is expected to have executed all the commands in its queues and the write and read data drained - * | | |Hence this register must be 1 at that time. - * | | |FOR DEBUG ONLY - * | | |Programming Mode: Dynamic - * |[28] |rd_data_pipeline_empty|Read Data Pipeline Empty - * | | |This bit indicates that the read data pipeline on the DFI interface is empty. - * | | |This register is intended to be polled at least twice after setting DBG1.dis_dq, to ensure that all remaining commands/data have completed. - * | | |Programming Mode: Dynamic - * |[29] |wr_data_pipeline_empty|Write Data Pipeline Empty - * | | |This bit indicates that the write data pipeline on the DFI interface is empty. - * | | |This register is intended to be polled at least twice after setting DBG1.dis_dq, to ensure that all remaining commands/data have completed. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::DBGCMD - * Offset: 0x30C Command Debug Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |rank0_refresh|Signal for uMCTL2 to Issue Refresh to Rank 0 - * | | |Setting this register bit to 1 indicates to the uMCTL2 to issue a refresh to rank 0. - * | | |Writing to this bit causes DBGSTAT.rank0_refresh_busy to be set. - * | | |When DBGSTAT.rank0_refresh_busy is cleared, the command has been stored in uMCTL2. - * | | |For 3DS configuration, refresh is sent to rank index 0. - * | | |This operation can be performed only when RFSHCTL3.dis_auto_refresh=1. - * | | |It is recommended NOT to set this register bit if in Init or Deep power-down operating modes or Maximum Power Saving Mode. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * |[1] |rank1_refresh|Signal for uMCTL2 to Issue Refresh to Rank 1 - * | | |Setting this register bit to 1 indicates to the uMCTL2 to issue a refresh to rank 1. - * | | |Writing to this bit causes DBGSTAT.rank1_refresh_busy to be set. - * | | |When DBGSTAT.rank1_refresh_busy is cleared, the command has been stored in uMCTL2. - * | | |For 3DS configuration, refresh is sent to rank index 1. - * | | |This operation can be performed only when RFSHCTL3.dis_auto_refresh=1. - * | | |It is recommended NOT to set this register bit if in Init or Deep power-down operating modes or Maximum Power Saving Mode. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * |[4] |zq_calib_short|Signal for uMCTL2 to Issue ZQCS to SDRAM - * | | |Setting this register bit to 1 indicates to the uMCTL2 to issue a ZQCS (ZQ calibration short)/MPC(ZQ calibration) command to the SDRAM. - * | | |When this request is stored in the uMCTL2, the bit is automatically cleared. - * | | |This operation can be performed only when ZQCTL0.dis_auto_zq=1. - * | | |It is recommended NOT to set this register bit if in Init, in self-refresh or Deep power-down operating modes or Maximum Power Saving Mode. - * | | |For Deep power down and Maximum Power Saving Mode, it is not scheduled, although DBGSTAT.zq_calib_short_busy is de-asserted. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * |[5] |ctrlupd |Signal for uMCTL2 to Issue dfi_ctrlupd_req to PHY - * | | |Setting this register bit to 1 indicates to the uMCTL2 to issue a dfi_ctrlupd_req to the PHY. - * | | |When this request is stored in the uMCTL2, the bit is automatically cleared. - * | | |This operation must only be performed when DFIUPD0.dis_auto_ctrlupd=1. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::DBGSTAT - * Offset: 0x310 Status Debug Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |rank0_refresh_busy|Rank0 Refresh Operation Busy - * | | |SoC might initiate a rank0_refresh operation (refresh operation to rank 0) only if this signal is low. - * | | |This signal goes high in the clock after DBGCMD.rank0_refresh is set to one - * | | |It goes low when the rank0_refresh operation is stored in the uMCTL2. - * | | |It is recommended not to perform rank0_refresh operations when this signal is high. - * | | |u00B7 0 - Indicates that the SoC can initiate a rank0_refresh operation - * | | |u00B7 1 - Indicates that rank0_refresh operation has not been stored yet in the uMCTL2 - * | | |Programming Mode: Dynamic - * |[1] |rank1_refresh_busy|Rank1 Refresh Operation Busy - * | | |SoC might initiate a rank1_refresh operation (refresh operation to rank 1) only if this signal is low. - * | | |This signal goes high in the clock after DBGCMD.rank1_refresh is set to one - * | | |It goes low when the rank1_refresh operation is stored in the uMCTL2. - * | | |It is recommended not to perform rank1_refresh operations when this signal is high. - * | | |u00B7 0 - Indicates that the SoC can initiate a rank1_refresh operation - * | | |u00B7 1 - Indicates that rank1_refresh operation has not been stored yet in the uMCTL2 - * | | |Programming Mode: Dynamic - * |[4] |zq_calib_short_busy|ZQCS Operation Busy State - * | | |SoC might initiate a ZQCS (ZQ calibration short) operation only if this signal is low. - * | | |This signal goes high in the clock after the uMCTL2 accepts the ZQCS request. - * | | |It goes low when the ZQCS operation is initiated in the uMCTL2 - * | | |It is recommended not to perform ZQCS operations when this signal is high. - * | | |u00B7 0 - Indicates that the SoC can initiate a ZQCS operation - * | | |u00B7 1 - Indicates that ZQCS operation has not been initiated yet in the uMCTL2 - * | | |Programming Mode: Dynamic - * |[5] |ctrlupd_busy|ctrlupd Operation Busy State - * | | |SoC might initiate a ctrlupd operation only if this signal is low. - * | | |This signal goes high in the clock after the uMCTL2 accepts the ctrlupd request. - * | | |It goes low when the ctrlupd operation is initiated in the uMCTL2. - * | | |It is recommended not to perform ctrlupd operations when this signal is high. - * | | |u00B7 0 - Indicates that the SoC can initiate a ctrlupd operation - * | | |u00B7 1 - Indicates that ctrlupd operation has not been initiated yet in the uMCTL2 - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::SWCTL - * Offset: 0x320 Software Register Programming Control Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |sw_done |Quasi-Dynamic Register Programming Enable Bit - * | | |Enables quasi-dynamic register programming outside reset. - * | | |Program this register to 0 to enable quasi-dynamic programming. - * | | |Set back register to 1 once programming is done. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::SWSTAT - * Offset: 0x324 Software Register Programming Control Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |sw_done_ack|Register Programming Done ACK - * | | |This register is the echo of SWCTL.sw_done. - * | | |Wait for sw_done value 1 to propagate to sw_done_ack at the end of the programming sequence to ensure that the correct registers values are propagated to the destination clock domains. - * | | |Testable: untestable - * | | |Programming Mode: Static - * @var UMCTL2_T::SWCTLSTATIC - * Offset: 0x328 Static Registers Write Enable - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |sw_static_unlock|Static Register Programming Unlock Bit - * | | |Enables static register programming outside reset. - * | | |Program this register to 1 to enable static register programming. - * | | |Set register back to 0 once programming is done. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::POISONCFG - * Offset: 0x36C AXI Poison Configuration Register. Common for all AXI ports. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |wr_poison_slverr_en|Write Transaction Poisoning SLVERR Response Enable Bit - * | | |If set to 1, enables SLVERR response for write transaction poisoning. - * | | |Programming Mode: Dynamic - * |[4] |wr_poison_intr_en|Write Transaction Poisoning Interrupt Enable Bit - * | | |If set to 1, enables interrupts for write transaction poisoning. - * | | |Programming Mode: Dynamic - * |[8] |wr_poison_intr_clr|Write Transaction Poisoning Interrupt Clear Bit - * | | |Interrupt clear for write transaction poisoning. - * | | |Allow 2/3 clock cycles for correct value to propagate to controller logic and clear the interrupts. - * | | |uMCTL2 automatically clears this bit. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * |[16] |rd_poison_slverr_en|Read Transaction Poisoning SLVERR Response Enable Bit - * | | |If set to 1, enables SLVERR response for read transaction poisoning. - * | | |Programming Mode: Dynamic - * |[20] |rd_poison_intr_en|Read Transaction Poisoning Interrupt Enable Bit - * | | |If set to 1, enables interrupts for read transaction poisoning. - * | | |Programming Mode: Dynamic - * |[24] |rd_poison_intr_clr|Read Transaction Poisoning Interrupt Clear Bit - * | | |Allow 2/3 clock cycles for correct value to propagate to controller logic and clear the interrupts. - * | | |uMCTL2 automatically clears this bit. - * | | |Testable: readOnly - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::POISONSTAT - * Offset: 0x370 AXI Poison Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |wr_poison_intr_0|Write Transaction Poisoning Error Interrupt for Port 0 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[1] |wr_poison_intr_1|Write Transaction Poisoning Error Interrupt for Port 1 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[2] |wr_poison_intr_2|Write Transaction Poisoning Error Interrupt for Port 2 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[3] |wr_poison_intr_3|Write Transaction Poisoning Error Interrupt for Port 3 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[4] |wr_poison_intr_4|Write Transaction Poisoning Error Interrupt for Port 4 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[5] |wr_poison_intr_5|Write Transaction Poisoning Error Interrupt for Port 5 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[6] |wr_poison_intr_6|Write Transaction Poisoning Error Interrupt for Port 6 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[7] |wr_poison_intr_7|Write Transaction Poisoning Error Interrupt for Port 7 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's write address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register wr_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[16] |rd_poison_intr_0|Read Transaction Poisoning Error Interrupt for Port 0 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[17] |rd_poison_intr_1|Read Transaction Poisoning Error Interrupt for Port 1 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[18] |rd_poison_intr_2|Read Transaction Poisoning Error Interrupt for Port 2 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[19] |rd_poison_intr_3|Read Transaction Poisoning Error Interrupt for Port 3 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[20] |rd_poison_intr_4|Read Transaction Poisoning Error Interrupt for Port 4 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[21] |rd_poison_intr_5|Read Transaction Poisoning Error Interrupt for Port 5 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[22] |rd_poison_intr_6|Read Transaction Poisoning Error Interrupt for Port 6 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * |[23] |rd_poison_intr_7|Read Transaction Poisoning Error Interrupt for Port 7 - * | | |This register is a APB clock copy (double register synchronizer) of the interrupt asserted when a transaction is poisoned on the corresponding AXI port's read address channel. - * | | |Bit 0 corresponds to Port 0, and so on - * | | |Interrupt is cleared by register rd_poison_intr_clr, then value propagated to APB clock. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PSTAT - * Offset: 0x3FC Port Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |rd_port_busy_0|Outstanding Reads for AXI Port 0 - * | | |Indicates if there are outstanding reads for AXI port 0. - * | | |Programming Mode: Dynamic - * |[1] |rd_port_busy_1|Outstanding Reads for AXI Port 1 - * | | |Indicates if there are outstanding reads for AXI port 1. - * | | |Programming Mode: Dynamic - * |[2] |rd_port_busy_2|Outstanding Reads for AXI Port 2 - * | | |Indicates if there are outstanding reads for AXI port 2. - * | | |Programming Mode: Dynamic - * |[3] |rd_port_busy_3|Outstanding Reads for AXI Port 3 - * | | |Indicates if there are outstanding reads for AXI port 3. - * | | |Programming Mode: Dynamic - * |[4] |rd_port_busy_4|Outstanding Reads for AXI Port 4 - * | | |Indicates if there are outstanding reads for AXI port 4. - * | | |Programming Mode: Dynamic - * |[5] |rd_port_busy_5|Outstanding Reads for AXI Port 5 - * | | |Indicates if there are outstanding reads for AXI port 5. - * | | |Programming Mode: Dynamic - * |[6] |rd_port_busy_6|Outstanding Reads for AXI Port 6 - * | | |Indicates if there are outstanding reads for AXI port 6. - * | | |Programming Mode: Dynamic - * |[7] |rd_port_busy_7|Outstanding Reads for AXI Port 7 - * | | |Indicates if there are outstanding reads for AXI port 7. - * | | |Programming Mode: Dynamic - * |[16] |wr_port_busy_0|Outstanding Writes for AXI Port 0 - * | | |Indicates if there are outstanding writes for AXI port 0. - * | | |Programming Mode: Dynamic - * |[17] |wr_port_busy_1|Outstanding Writes for AXI Port 1 - * | | |Indicates if there are outstanding writes for AXI port 1. - * | | |Programming Mode: Dynamic - * |[18] |wr_port_busy_2|Outstanding Writes for AXI Port 2 - * | | |Indicates if there are outstanding writes for AXI port 2. - * | | |Programming Mode: Dynamic - * |[19] |wr_port_busy_3|Outstanding Writes for AXI Port 3 - * | | |Indicates if there are outstanding writes for AXI port 3. - * | | |Programming Mode: Dynamic - * |[20] |wr_port_busy_4|Outstanding Writes for AXI Port 4 - * | | |Indicates if there are outstanding writes for AXI port 4. - * | | |Programming Mode: Dynamic - * |[21] |wr_port_busy_5|Outstanding Writes for AXI Port 5 - * | | |Indicates if there are outstanding writes for AXI port 5. - * | | |Programming Mode: Dynamic - * |[22] |wr_port_busy_6|Outstanding Writes for AXI Port 6 - * | | |Indicates if there are outstanding writes for AXI port 6. - * | | |Programming Mode: Dynamic - * |[23] |wr_port_busy_7|Outstanding Writes for AXI Port 7 - * | | |Indicates if there are outstanding writes for AXI port 7. - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCCFG - * Offset: 0x400 Port Common Configuration Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |go2critical_en|go2critical Function Enable Bit - * | | |If set to 1 (enabled), sets co_gs_go2critical_wr and co_gs_go2critical_lpr/co_gs_go2critical_hpr signals going to DDRC based on urgent input (awurgent, arurgent) coming from AXI master. - * | | |If set to 0 (disabled), co_gs_go2critical_wr and co_gs_go2critical_lpr/co_gs_go2critical_hpr signals at DDRC are driven to 1b'0. - * | | |For uPCTL2, this register field must be set to 0. - * | | |Programming Mode: Static - * |[4] |pagematch_limit|Page Match Four Limit - * | | |If set to 1, limits the number of consecutive same page DDRC transactions that can be granted by the Port Arbiter to four when Page Match feature is enabled. - * | | |If set to 0, there is no limit imposed on number of consecutive same page DDRC transactions. - * | | |Programming Mode: Static - * |[8] |bl_exp_mode|Burst Length Expansion Mode - * | | |By default, (that is, bl_exp_mode==0) XPI expands every AXI burst into multiple HIF commands, using the memory burst length as a unit - * | | |If set to 1, then XPI uses half of the memory burst length as a unit. - * | | |This applies to both reads and writes - * | | |When MSTR.data_bus_width==00, setting bl_exp_mode to 1 has no effect. - * | | |Functionality is also not supported if Data Channel Interleave is enabled. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGR_0 - * Offset: 0x404 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Note that this register has an effect only if necessary logic is instantiated through the UMCTL2_RDWR_ORDERED_n parameter. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_0 - * Offset: 0x408 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_0 - * Offset: 0x490 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_0 - * Offset: 0x494 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PCFGR_1 - * Offset: 0x4B4 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_1 - * Offset: 0x4B8 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_1 - * Offset: 0x540 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_1 - * Offset: 0x544 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PCFGR_2 - * Offset: 0x564 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_2 - * Offset: 0x568 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_2 - * Offset: 0x5F0 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_2 - * Offset: 0x5F4 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PCFGR_3 - * Offset: 0x614 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_3 - * Offset: 0x618 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_3 - * Offset: 0x6A0 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_3 - * Offset: 0x6A4 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PCFGR_4 - * Offset: 0x6C4 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_4 - * Offset: 0x6C8 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_4 - * Offset: 0x750 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_4 - * Offset: 0x754 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PCFGR_5 - * Offset: 0x774 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_5 - * Offset: 0x778 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_5 - * Offset: 0x800 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_5 - * Offset: 0x804 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PCFGR_6 - * Offset: 0x824 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_6 - * Offset: 0x828 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_6 - * Offset: 0x8B0 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_6 - * Offset: 0x8B4 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::PCFGR_7 - * Offset: 0x8D4 Port n Configuration Read Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |rd_port_priority|Read Channel of Port Priority - * | | |Determines the initial load value of read aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted - * | | |The higher significant 5-bits of the read aging counter sets the priority of the read channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease. - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level (timeout condition - Priority0). - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (arqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |In this case, external dynamic priority input, arqos (for reads only) can still be used to set the DDRC read priority (2 priority levels: low priority read - LPR, high priority read - HPR) on a command by command basis. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |rd_port_aging_en|Read Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the read channel of the port. - * | | |Programming Mode: Static - * |[13] |rd_port_urgent_en|AXI Urgent Sideband Signal (arurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (arurgent) - * | | |When enabled and arurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_lpr/co_gs_go2critical_hpr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that arurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |rd_port_pagematch_en|Read Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * |[16] |rdwr_ordered_en|Read/Writes Ordered Enable Bit - * | | |If set to 1, preserves the ordering between read transaction and write transaction issued to the same address, on a given port. - * | | |In other words, the controller ensures that all same address read and write commands from the application port interface are transported to the DFI interface in the order of acceptance. - * | | |This feature is useful in cases where software coherency is desired for masters issuing back-to-back read/write transactions without waiting for write/read responses. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCFGW_7 - * Offset: 0x8D8 Port n Configuration Write Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[9:0] |wr_port_priority|Write Channel of Port Priority - * | | |Determines the initial load value of write aging counters. - * | | |These counters are parallel loaded after reset, or after each grant to the corresponding port. - * | | |The aging counters down-count every clock cycle where the port is requesting but not granted. - * | | |The higher significant 5-bits of the write aging counter sets the initial priority of the write channel of a given port. - * | | |Port's priority increases as the higher significant 5-bits of the counter starts to decrease - * | | |When the aging counter becomes 0, the corresponding port channel has the highest priority level. - * | | |For multi-port configurations, the aging counters cannot be used to set port priorities when external dynamic priority inputs (awqos) are enabled (timeout is still applicable). - * | | |For single port configurations, the aging counters are only used when they timeout (become 0) to force read-write direction switching. - * | | |Note: The two LSBs of this register field are tied internally to 2'b00. - * | | |Programming Mode: Static - * |[12] |wr_port_aging_en|Write Channel of Port Aging Function Enable Bit - * | | |If set to 1, enables aging function for the write channel of the port. - * | | |Programming Mode: Static - * |[13] |wr_port_urgent_en|AXI Urgent Sideband Signal (awurgent) Enable Bit - * | | |If set to 1, enables the AXI urgent sideband signal (awurgent). - * | | |When enabled and awurgent is asserted by the master, that port becomes the highest priority and co_gs_go2critical_wr signal to DDRC is asserted if enabled in PCCFG.go2critical_en register. - * | | |Note that awurgent signal can be asserted anytime and as long as required which is independent of address handshaking (it is not associated with any particular command). - * | | |Programming Mode: Static - * |[14] |wr_port_pagematch_en|Write Page Match Enable Bit - * | | |If set to 1, enables the Page Match feature. - * | | |If enabled, once a requesting port is granted, the port is continued to be granted if the following immediate commands are to the same memory page (same rank, same bank and same row). - * | | |See also related PCCFG.pagematch_limit register. - * | | |Programming Mode: Static - * @var UMCTL2_T::PCTRL_7 - * Offset: 0x960 Port n Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |port_en |AXI Port n Enable Bit - * | | |Programming Mode: Dynamic - * @var UMCTL2_T::PCFGQOS0_7 - * Offset: 0x964 Port n Read QoS Configuration Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |rqos_map_level1|End of Region0 Mapping - * | | |Separation level1 indicating the end of region0 mapping; start of region0 is 0 - * | | |Possible values for level1 are 0 to 13 (for dual RAQ) or 0 to 14 (for single RAQ) which corresponds to arqos. - * | | |Note that for PA, arqos values are used directly as port priorities, where the higher the value corresponds to higher port priority. - * | | |All of the map_level* registers must be set to distinct values. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[17:16] |rqos_map_region0|Traffic Class of Region 0 - * | | |This bit field indicates the traffic class of region 0. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region 0 maps to the blue address queue. - * | | |In this case, valid values are: - * | | |0: LPR and 1: VPR only. - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region0 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * |[21:20] |rqos_map_region1|Traffic Class of Region 1 - * | | |This bit field indicates the traffic class of region 1. - * | | |Valid values are: - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR - * | | |u00B7 2 - HPR - * | | |For dual address queue configurations, region1 maps to the blue address queue. - * | | |In this case, valid values are - * | | |u00B7 0 - LPR - * | | |u00B7 1 - VPR only - * | | |When VPR support is disabled (UMCTL2_VPR_EN = 0) and traffic class of region 1 is set to 1 (VPR), VPR traffic is aliased to LPR traffic. - * | | |Programming Mode: Quasi-dynamic Group 3 - * @var UMCTL2_T::SARBASE0 - * Offset: 0xF04 SAR Base Address Register n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |base_addr |Base Address for Address Region n - * | | |Base address for address region n specified as awaddr[UMCTL2_A_ADDRW-1:x] and araddr[UMCTL2_A_ADDRW-1:x], - * | | |where x is determined by the minimum block size parameter UMCTL2_SARMINSIZE: (x=log2(block size)). - * | | |Programming Mode: Static - * @var UMCTL2_T::SARSIZE0 - * Offset: 0xF08 SAR Size Register n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |nblocks |Number of Blocks for Address Region n. - * | | |This register determines the total size of the region in multiples of minimum block size as specified by the hardware parameter UMCTL2_SARMINSIZE - * | | |The register value is encoded as number of blocks = nblocks + 1 - * | | |For example, if register is programmed to 0, region can have 1 block. - * | | |Programming Mode: Static - * @var UMCTL2_T::VER_NUMBER - * Offset: 0xFF0 UMCTL2 Version Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ver_number|Device Version Number Value - * | | |This is in ASCII format, with each byte corresponding to a character of the version number - * | | |Programming Mode: Static - * @var UMCTL2_T::VER_TYPE - * Offset: 0xFF4 UMCTL2 Version Type Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ver_type |Device Version Type Value - * | | |This is in ASCII format, with each byte corresponding to a character of the version type - * | | |Programming Mode: Static - */ - __IO uint32_t MSTR; /*!< [0x0000] Master Register0 */ - __I uint32_t STAT; /*!< [0x0004] Operating Mode Status Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t MRCTRL0; /*!< [0x0010] Mode Register Read/Write Control Register 0 */ - __IO uint32_t MRCTRL1; /*!< [0x0014] Mode Register Read/Write Control Register 1 */ - __I uint32_t MRSTAT; /*!< [0x0018] Mode Register Read/Write Status Register */ - __I uint32_t RESERVE1[5]; - __IO uint32_t PWRCTL; /*!< [0x0030] Low Power Control Register */ - __IO uint32_t PWRTMG; /*!< [0x0034] Low Power Timing Register */ - __IO uint32_t HWLPCTL; /*!< [0x0038] Hardware Low Power Control Register */ - __I uint32_t RESERVE2[5]; - __IO uint32_t RFSHCTL0; /*!< [0x0050] Refresh Control Register 0 */ - __IO uint32_t RFSHCTL1; /*!< [0x0054] Refresh Control Register 1 */ - __I uint32_t RESERVE3[2]; - __IO uint32_t RFSHCTL3; /*!< [0x0060] Refresh Control Register 3 */ - __IO uint32_t RFSHTMG; /*!< [0x0064] Refresh Timing Register */ - __I uint32_t RESERVE4[22]; - __IO uint32_t CRCPARCTL0; /*!< [0x00c0] CRC Parity Control Register0 */ - __I uint32_t RESERVE5[2]; - __I uint32_t CRCPARSTAT; /*!< [0x00cc] CRC Parity Status Register */ - __IO uint32_t INIT0; /*!< [0x00d0] SDRAM Initialization Register 0 */ - __IO uint32_t INIT1; /*!< [0x00d4] SDRAM Initialization Register 1 */ - __I uint32_t RESERVE6[1]; - __IO uint32_t INIT3; /*!< [0x00dc] SDRAM Initialization Register 3 */ - __IO uint32_t INIT4; /*!< [0x00e0] SDRAM Initialization Register 4 */ - __IO uint32_t INIT5; /*!< [0x00e4] SDRAM Initialization Register 5 */ - __I uint32_t RESERVE7[2]; - __IO uint32_t DIMMCTL; /*!< [0x00f0] DIMM Control Register */ - __IO uint32_t RANKCTL; /*!< [0x00f4] Rank Control Register */ - __I uint32_t RESERVE8[2]; - __IO uint32_t DRAMTMG0; /*!< [0x0100] SDRAM Timing Register 0 */ - __IO uint32_t DRAMTMG1; /*!< [0x0104] SDRAM Timing Register 1 */ - __IO uint32_t DRAMTMG2; /*!< [0x0108] SDRAM Timing Register 2 */ - __IO uint32_t DRAMTMG3; /*!< [0x010c] SDRAM Timing Register 3 */ - __IO uint32_t DRAMTMG4; /*!< [0x0110] SDRAM Timing Register 4 */ - __IO uint32_t DRAMTMG5; /*!< [0x0114] SDRAM Timing Register 5 */ - __I uint32_t RESERVE9[2]; - __IO uint32_t DRAMTMG8; /*!< [0x0120] SDRAM Timing Register 8 */ - __I uint32_t RESERVE10[6]; - __IO uint32_t DRAMTMG15; /*!< [0x013c] SDRAM Timing Register 15 */ - __I uint32_t RESERVE11[16]; - __IO uint32_t ZQCTL0; /*!< [0x0180] ZQ Control Register 0 */ - __IO uint32_t ZQCTL1; /*!< [0x0184] ZQ Control Register 1 */ - __I uint32_t RESERVE12[2]; - __IO uint32_t DFITMG0; /*!< [0x0190] DFI Timing Register 0 */ - __IO uint32_t DFITMG1; /*!< [0x0194] DFI Timing Register 1 */ - __IO uint32_t DFILPCFG0; /*!< [0x0198] DFI Low Power Configuration Register 0 */ - __I uint32_t RESERVE13[1]; - __IO uint32_t DFIUPD0; /*!< [0x01a0] DFI Update Register 0 */ - __IO uint32_t DFIUPD1; /*!< [0x01a4] DFI Update Register 1 */ - __IO uint32_t DFIUPD2; /*!< [0x01a8] DFI Update Register 2 */ - __I uint32_t RESERVE14[1]; - __IO uint32_t DFIMISC; /*!< [0x01b0] DFI Miscellaneous Control Register */ - __I uint32_t RESERVE15[2]; - __I uint32_t DFISTAT; /*!< [0x01bc] DFI Status Register */ - __I uint32_t RESERVE16[1]; - __IO uint32_t DFIPHYMSTR; /*!< [0x01c4] DFI PHY Master */ - __I uint32_t RESERVE17[14]; - __IO uint32_t ADDRMAP0; /*!< [0x0200] Address Map Register 0 */ - __IO uint32_t ADDRMAP1; /*!< [0x0204] Address Map Register 1 */ - __IO uint32_t ADDRMAP2; /*!< [0x0208] Address Map Register 2 */ - __IO uint32_t ADDRMAP3; /*!< [0x020c] Address Map Register 3 */ - __IO uint32_t ADDRMAP4; /*!< [0x0210] Address Map Register 4 */ - __IO uint32_t ADDRMAP5; /*!< [0x0214] Address Map Register 5 */ - __IO uint32_t ADDRMAP6; /*!< [0x0218] Address Map Register 6 */ - __I uint32_t RESERVE18[2]; - __IO uint32_t ADDRMAP9; /*!< [0x0224] Address Map Register 9 */ - __IO uint32_t ADDRMAP10; /*!< [0x0228] Address Map Register 10 */ - __IO uint32_t ADDRMAP11; /*!< [0x022c] Address Map Register 11 */ - __I uint32_t RESERVE19[4]; - __IO uint32_t ODTCFG; /*!< [0x0240] ODT Configuration Register */ - __IO uint32_t ODTMAP; /*!< [0x0244] ODT/Rank Map Register */ - __I uint32_t RESERVE20[2]; - __IO uint32_t SCHED; /*!< [0x0250] Scheduler Control Register */ - __IO uint32_t SCHED1; /*!< [0x0254] Scheduler Control Register 1 */ - __I uint32_t RESERVE21[1]; - __IO uint32_t PERFHPR1; /*!< [0x025c] High Priority Read CAM Register 1 */ - __I uint32_t RESERVE22[1]; - __IO uint32_t PERFLPR1; /*!< [0x0264] Low Priority Read CAM Register 1 */ - __I uint32_t RESERVE23[1]; - __IO uint32_t PERFWR1; /*!< [0x026c] Write CAM Register 1 */ - __I uint32_t RESERVE24[36]; - __IO uint32_t DBG0; /*!< [0x0300] Debug Register 0 */ - __IO uint32_t DBG1; /*!< [0x0304] Debug Register 1 */ - __I uint32_t DBGCAM; /*!< [0x0308] CAM Debug Register */ - __IO uint32_t DBGCMD; /*!< [0x030c] Command Debug Register */ - __I uint32_t DBGSTAT; /*!< [0x0310] Status Debug Register */ - __I uint32_t RESERVE25[3]; - __IO uint32_t SWCTL; /*!< [0x0320] Software Register Programming Control Enable */ - __I uint32_t SWSTAT; /*!< [0x0324] Software Register Programming Control Status */ - __IO uint32_t SWCTLSTATIC; /*!< [0x0328] Static Registers Write Enable */ - __I uint32_t RESERVE26[16]; - __IO uint32_t POISONCFG; /*!< [0x036c] AXI Poison Configuration Register. Common for all AXI ports. */ - __I uint32_t POISONSTAT; /*!< [0x0370] AXI Poison Status Register */ - __I uint32_t RESERVE27[34]; - __I uint32_t PSTAT; /*!< [0x03fc] Port Status Register */ - __IO uint32_t PCCFG; /*!< [0x0400] Port Common Configuration Register */ - __IO uint32_t PCFGR_0; /*!< [0x0404] Port n Configuration Read Register */ - __IO uint32_t PCFGW_0; /*!< [0x0408] Port n Configuration Write Register */ - __I uint32_t RESERVE28[33]; - __IO uint32_t PCTRL_0; /*!< [0x0490] Port n Control Register */ - __IO uint32_t PCFGQOS0_0; /*!< [0x0494] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE29[7]; - __IO uint32_t PCFGR_1; /*!< [0x04b4] Port n Configuration Read Register */ - __IO uint32_t PCFGW_1; /*!< [0x04b8] Port n Configuration Write Register */ - __I uint32_t RESERVE30[33]; - __IO uint32_t PCTRL_1; /*!< [0x0540] Port n Control Register */ - __IO uint32_t PCFGQOS0_1; /*!< [0x0544] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE31[7]; - __IO uint32_t PCFGR_2; /*!< [0x0564] Port n Configuration Read Register */ - __IO uint32_t PCFGW_2; /*!< [0x0568] Port n Configuration Write Register */ - __I uint32_t RESERVE32[33]; - __IO uint32_t PCTRL_2; /*!< [0x05f0] Port n Control Register */ - __IO uint32_t PCFGQOS0_2; /*!< [0x05f4] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE33[7]; - __IO uint32_t PCFGR_3; /*!< [0x0614] Port n Configuration Read Register */ - __IO uint32_t PCFGW_3; /*!< [0x0618] Port n Configuration Write Register */ - __I uint32_t RESERVE34[33]; - __IO uint32_t PCTRL_3; /*!< [0x06a0] Port n Control Register */ - __IO uint32_t PCFGQOS0_3; /*!< [0x06a4] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE35[7]; - __IO uint32_t PCFGR_4; /*!< [0x06c4] Port n Configuration Read Register */ - __IO uint32_t PCFGW_4; /*!< [0x06c8] Port n Configuration Write Register */ - __I uint32_t RESERVE36[33]; - __IO uint32_t PCTRL_4; /*!< [0x0750] Port n Control Register */ - __IO uint32_t PCFGQOS0_4; /*!< [0x0754] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE37[7]; - __IO uint32_t PCFGR_5; /*!< [0x0774] Port n Configuration Read Register */ - __IO uint32_t PCFGW_5; /*!< [0x0778] Port n Configuration Write Register */ - __I uint32_t RESERVE38[33]; - __IO uint32_t PCTRL_5; /*!< [0x0800] Port n Control Register */ - __IO uint32_t PCFGQOS0_5; /*!< [0x0804] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE39[7]; - __IO uint32_t PCFGR_6; /*!< [0x0824] Port n Configuration Read Register */ - __IO uint32_t PCFGW_6; /*!< [0x0828] Port n Configuration Write Register */ - __I uint32_t RESERVE40[33]; - __IO uint32_t PCTRL_6; /*!< [0x08b0] Port n Control Register */ - __IO uint32_t PCFGQOS0_6; /*!< [0x08b4] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE41[7]; - __IO uint32_t PCFGR_7; /*!< [0x08d4] Port n Configuration Read Register */ - __IO uint32_t PCFGW_7; /*!< [0x08d8] Port n Configuration Write Register */ - __I uint32_t RESERVE42[33]; - __IO uint32_t PCTRL_7; /*!< [0x0960] Port n Control Register */ - __IO uint32_t PCFGQOS0_7; /*!< [0x0964] Port n Read QoS Configuration Register 0 */ - __I uint32_t RESERVE43[359]; - __IO uint32_t SARBASE0; /*!< [0x0f04] SAR Base Address Register n */ - __IO uint32_t SARSIZE0; /*!< [0x0f08] SAR Size Register n */ - __I uint32_t RESERVE44[57]; - __I uint32_t VER_NUMBER; /*!< [0x0ff0] UMCTL2 Version Number Register */ - __I uint32_t VER_TYPE; /*!< [0x0ff4] UMCTL2 Version Type Register */ - -} UMCTL2_T; - -/** - @addtogroup UMCTL2_CONST UMCTL2 Bit Field Definition - Constant Definitions for UMCTL2 Controller -@{ */ - -#define UMCTL2_MSTR_ddr3_Pos (0) /*!< UMCTL2_T::MSTR: ddr3 Position */ -#define UMCTL2_MSTR_ddr3_Msk (0x1ul << UMCTL2_MSTR_ddr3_Pos) /*!< UMCTL2_T::MSTR: ddr3 Mask */ - -#define UMCTL2_MSTR_burstchop_Pos (9) /*!< UMCTL2_T::MSTR: burstchop Position */ -#define UMCTL2_MSTR_burstchop_Msk (0x1ul << UMCTL2_MSTR_burstchop_Pos) /*!< UMCTL2_T::MSTR: burstchop Mask */ - -#define UMCTL2_MSTR_en_2t_timing_mode_Pos (10) /*!< UMCTL2_T::MSTR: en_2t_timing_mode Position*/ -#define UMCTL2_MSTR_en_2t_timing_mode_Msk (0x1ul << UMCTL2_MSTR_en_2t_timing_mode_Pos) /*!< UMCTL2_T::MSTR: en_2t_timing_mode Mask */ - -#define UMCTL2_MSTR_data_bus_width_Pos (12) /*!< UMCTL2_T::MSTR: data_bus_width Position*/ -#define UMCTL2_MSTR_data_bus_width_Msk (0x3ul << UMCTL2_MSTR_data_bus_width_Pos) /*!< UMCTL2_T::MSTR: data_bus_width Mask */ - -#define UMCTL2_MSTR_dll_off_mode_Pos (15) /*!< UMCTL2_T::MSTR: dll_off_mode Position */ -#define UMCTL2_MSTR_dll_off_mode_Msk (0x1ul << UMCTL2_MSTR_dll_off_mode_Pos) /*!< UMCTL2_T::MSTR: dll_off_mode Mask */ - -#define UMCTL2_MSTR_burst_rdwr_Pos (16) /*!< UMCTL2_T::MSTR: burst_rdwr Position */ -#define UMCTL2_MSTR_burst_rdwr_Msk (0xful << UMCTL2_MSTR_burst_rdwr_Pos) /*!< UMCTL2_T::MSTR: burst_rdwr Mask */ - -#define UMCTL2_MSTR_active_ranks_Pos (24) /*!< UMCTL2_T::MSTR: active_ranks Position */ -#define UMCTL2_MSTR_active_ranks_Msk (0x3ul << UMCTL2_MSTR_active_ranks_Pos) /*!< UMCTL2_T::MSTR: active_ranks Mask */ - -#define UMCTL2_STAT_operating_mode_Pos (0) /*!< UMCTL2_T::STAT: operating_mode Position*/ -#define UMCTL2_STAT_operating_mode_Msk (0x3ul << UMCTL2_STAT_operating_mode_Pos) /*!< UMCTL2_T::STAT: operating_mode Mask */ - -#define UMCTL2_STAT_selfref_type_Pos (4) /*!< UMCTL2_T::STAT: selfref_type Position */ -#define UMCTL2_STAT_selfref_type_Msk (0x3ul << UMCTL2_STAT_selfref_type_Pos) /*!< UMCTL2_T::STAT: selfref_type Mask */ - -#define UMCTL2_STAT_selfref_cam_not_empty_Pos (12) /*!< UMCTL2_T::STAT: selfref_cam_not_empty Position*/ -#define UMCTL2_STAT_selfref_cam_not_empty_Msk (0x1ul << UMCTL2_STAT_selfref_cam_not_empty_Pos) /*!< UMCTL2_T::STAT: selfref_cam_not_empty Mask*/ - -#define UMCTL2_MRCTRL0_mr_rank_Pos (4) /*!< UMCTL2_T::MRCTRL0: mr_rank Position */ -#define UMCTL2_MRCTRL0_mr_rank_Msk (0x3ul << UMCTL2_MRCTRL0_mr_rank_Pos) /*!< UMCTL2_T::MRCTRL0: mr_rank Mask */ - -#define UMCTL2_MRCTRL0_mr_addr_Pos (12) /*!< UMCTL2_T::MRCTRL0: mr_addr Position */ -#define UMCTL2_MRCTRL0_mr_addr_Msk (0xful << UMCTL2_MRCTRL0_mr_addr_Pos) /*!< UMCTL2_T::MRCTRL0: mr_addr Mask */ - -#define UMCTL2_MRCTRL0_mr_wr_Pos (31) /*!< UMCTL2_T::MRCTRL0: mr_wr Position */ -#define UMCTL2_MRCTRL0_mr_wr_Msk (0x1ul << UMCTL2_MRCTRL0_mr_wr_Pos) /*!< UMCTL2_T::MRCTRL0: mr_wr Mask */ - -#define UMCTL2_MRCTRL1_mr_data_Pos (0) /*!< UMCTL2_T::MRCTRL1: mr_data Position */ -#define UMCTL2_MRCTRL1_mr_data_Msk (0xfffful << UMCTL2_MRCTRL1_mr_data_Pos) /*!< UMCTL2_T::MRCTRL1: mr_data Mask */ - -#define UMCTL2_MRSTAT_mr_wr_busy_Pos (0) /*!< UMCTL2_T::MRSTAT: mr_wr_busy Position */ -#define UMCTL2_MRSTAT_mr_wr_busy_Msk (0x1ul << UMCTL2_MRSTAT_mr_wr_busy_Pos) /*!< UMCTL2_T::MRSTAT: mr_wr_busy Mask */ - -#define UMCTL2_PWRCTL_selfref_en_Pos (0) /*!< UMCTL2_T::PWRCTL: selfref_en Position */ -#define UMCTL2_PWRCTL_selfref_en_Msk (0x1ul << UMCTL2_PWRCTL_selfref_en_Pos) /*!< UMCTL2_T::PWRCTL: selfref_en Mask */ - -#define UMCTL2_PWRCTL_powerdown_en_Pos (1) /*!< UMCTL2_T::PWRCTL: powerdown_en Position*/ -#define UMCTL2_PWRCTL_powerdown_en_Msk (0x1ul << UMCTL2_PWRCTL_powerdown_en_Pos) /*!< UMCTL2_T::PWRCTL: powerdown_en Mask */ - -#define UMCTL2_PWRCTL_en_dfi_dram_clk_disable_Pos (3) /*!< UMCTL2_T::PWRCTL: en_dfi_dram_clk_disable Position*/ -#define UMCTL2_PWRCTL_en_dfi_dram_clk_disable_Msk (0x1ul << UMCTL2_PWRCTL_en_dfi_dram_clk_disable_Pos) /*!< UMCTL2_T::PWRCTL: en_dfi_dram_clk_disable Mask*/ - -#define UMCTL2_PWRCTL_selfref_sw_Pos (5) /*!< UMCTL2_T::PWRCTL: selfref_sw Position */ -#define UMCTL2_PWRCTL_selfref_sw_Msk (0x1ul << UMCTL2_PWRCTL_selfref_sw_Pos) /*!< UMCTL2_T::PWRCTL: selfref_sw Mask */ - -#define UMCTL2_PWRCTL_dis_cam_drain_selfref_Pos (7) /*!< UMCTL2_T::PWRCTL: dis_cam_drain_selfref Position*/ -#define UMCTL2_PWRCTL_dis_cam_drain_selfref_Msk (0x1ul << UMCTL2_PWRCTL_dis_cam_drain_selfref_Pos) /*!< UMCTL2_T::PWRCTL: dis_cam_drain_selfref Mask*/ - -#define UMCTL2_PWRTMG_powerdown_to_x32_Pos (0) /*!< UMCTL2_T::PWRTMG: powerdown_to_x32 Position*/ -#define UMCTL2_PWRTMG_powerdown_to_x32_Msk (0x1ful << UMCTL2_PWRTMG_powerdown_to_x32_Pos) /*!< UMCTL2_T::PWRTMG: powerdown_to_x32 Mask*/ - -#define UMCTL2_PWRTMG_selfref_to_x32_Pos (16) /*!< UMCTL2_T::PWRTMG: selfref_to_x32 Position*/ -#define UMCTL2_PWRTMG_selfref_to_x32_Msk (0xfful << UMCTL2_PWRTMG_selfref_to_x32_Pos) /*!< UMCTL2_T::PWRTMG: selfref_to_x32 Mask */ - -#define UMCTL2_HWLPCTL_hw_lp_en_Pos (0) /*!< UMCTL2_T::HWLPCTL: hw_lp_en Position */ -#define UMCTL2_HWLPCTL_hw_lp_en_Msk (0x1ul << UMCTL2_HWLPCTL_hw_lp_en_Pos) /*!< UMCTL2_T::HWLPCTL: hw_lp_en Mask */ - -#define UMCTL2_HWLPCTL_hw_lp_exit_idle_en_Pos (1) /*!< UMCTL2_T::HWLPCTL: hw_lp_exit_idle_en Position*/ -#define UMCTL2_HWLPCTL_hw_lp_exit_idle_en_Msk (0x1ul << UMCTL2_HWLPCTL_hw_lp_exit_idle_en_Pos) /*!< UMCTL2_T::HWLPCTL: hw_lp_exit_idle_en Mask*/ - -#define UMCTL2_HWLPCTL_hw_lp_idle_x32_Pos (16) /*!< UMCTL2_T::HWLPCTL: hw_lp_idle_x32 Position*/ -#define UMCTL2_HWLPCTL_hw_lp_idle_x32_Msk (0xffful << UMCTL2_HWLPCTL_hw_lp_idle_x32_Pos) /*!< UMCTL2_T::HWLPCTL: hw_lp_idle_x32 Mask */ - -#define UMCTL2_RFSHCTL0_refresh_burst_Pos (4) /*!< UMCTL2_T::RFSHCTL0: refresh_burst Position*/ -#define UMCTL2_RFSHCTL0_refresh_burst_Msk (0x3ful << UMCTL2_RFSHCTL0_refresh_burst_Pos) /*!< UMCTL2_T::RFSHCTL0: refresh_burst Mask */ - -#define UMCTL2_RFSHCTL0_refresh_to_x1_x32_Pos (12) /*!< UMCTL2_T::RFSHCTL0: refresh_to_x1_x32 Position*/ -#define UMCTL2_RFSHCTL0_refresh_to_x1_x32_Msk (0x1ful << UMCTL2_RFSHCTL0_refresh_to_x1_x32_Pos) /*!< UMCTL2_T::RFSHCTL0: refresh_to_x1_x32 Mask*/ - -#define UMCTL2_RFSHCTL0_refresh_margin_Pos (20) /*!< UMCTL2_T::RFSHCTL0: refresh_margin Position*/ -#define UMCTL2_RFSHCTL0_refresh_margin_Msk (0xful << UMCTL2_RFSHCTL0_refresh_margin_Pos) /*!< UMCTL2_T::RFSHCTL0: refresh_margin Mask*/ - -#define UMCTL2_RFSHCTL1_refresh_timer0_start_value_x32_Pos (0) /*!< UMCTL2_T::RFSHCTL1: refresh_timer0_start_value_x32 Position*/ -#define UMCTL2_RFSHCTL1_refresh_timer0_start_value_x32_Msk (0xffful << UMCTL2_RFSHCTL1_refresh_timer0_start_value_x32_Pos) /*!< UMCTL2_T::RFSHCTL1: refresh_timer0_start_value_x32 Mask*/ - -#define UMCTL2_RFSHCTL1_refresh_timer1_start_value_x32_Pos (16) /*!< UMCTL2_T::RFSHCTL1: refresh_timer1_start_value_x32 Position*/ -#define UMCTL2_RFSHCTL1_refresh_timer1_start_value_x32_Msk (0xffful << UMCTL2_RFSHCTL1_refresh_timer1_start_value_x32_Pos) /*!< UMCTL2_T::RFSHCTL1: refresh_timer1_start_value_x32 Mask*/ - -#define UMCTL2_RFSHCTL3_dis_auto_refresh_Pos (0) /*!< UMCTL2_T::RFSHCTL3: dis_auto_refresh Position*/ -#define UMCTL2_RFSHCTL3_dis_auto_refresh_Msk (0x1ul << UMCTL2_RFSHCTL3_dis_auto_refresh_Pos) /*!< UMCTL2_T::RFSHCTL3: dis_auto_refresh Mask*/ - -#define UMCTL2_RFSHCTL3_refresh_update_level_Pos (1) /*!< UMCTL2_T::RFSHCTL3: refresh_update_level Position*/ -#define UMCTL2_RFSHCTL3_refresh_update_level_Msk (0x1ul << UMCTL2_RFSHCTL3_refresh_update_level_Pos) /*!< UMCTL2_T::RFSHCTL3: refresh_update_level Mask*/ - -#define UMCTL2_RFSHTMG_t_rfc_min_Pos (0) /*!< UMCTL2_T::RFSHTMG: t_rfc_min Position */ -#define UMCTL2_RFSHTMG_t_rfc_min_Msk (0x3fful << UMCTL2_RFSHTMG_t_rfc_min_Pos) /*!< UMCTL2_T::RFSHTMG: t_rfc_min Mask */ - -#define UMCTL2_RFSHTMG_t_rfc_nom_x1_x32_Pos (16) /*!< UMCTL2_T::RFSHTMG: t_rfc_nom_x1_x32 Position*/ -#define UMCTL2_RFSHTMG_t_rfc_nom_x1_x32_Msk (0xffful << UMCTL2_RFSHTMG_t_rfc_nom_x1_x32_Pos) /*!< UMCTL2_T::RFSHTMG: t_rfc_nom_x1_x32 Mask*/ - -#define UMCTL2_CRCPARCTL0_dfi_alert_err_int_en_Pos (0) /*!< UMCTL2_T::CRCPARCTL0: dfi_alert_err_int_en Position*/ -#define UMCTL2_CRCPARCTL0_dfi_alert_err_int_en_Msk (0x1ul << UMCTL2_CRCPARCTL0_dfi_alert_err_int_en_Pos) /*!< UMCTL2_T::CRCPARCTL0: dfi_alert_err_int_en Mask*/ - -#define UMCTL2_CRCPARCTL0_dfi_alert_err_int_clr_Pos (1) /*!< UMCTL2_T::CRCPARCTL0: dfi_alert_err_int_clr Position*/ -#define UMCTL2_CRCPARCTL0_dfi_alert_err_int_clr_Msk (0x1ul << UMCTL2_CRCPARCTL0_dfi_alert_err_int_clr_Pos) /*!< UMCTL2_T::CRCPARCTL0: dfi_alert_err_int_clr Mask*/ - -#define UMCTL2_CRCPARCTL0_dfi_alert_err_cnt_clr_Pos (2) /*!< UMCTL2_T::CRCPARCTL0: dfi_alert_err_cnt_clr Position*/ -#define UMCTL2_CRCPARCTL0_dfi_alert_err_cnt_clr_Msk (0x1ul << UMCTL2_CRCPARCTL0_dfi_alert_err_cnt_clr_Pos) /*!< UMCTL2_T::CRCPARCTL0: dfi_alert_err_cnt_clr Mask*/ - -#define UMCTL2_CRCPARSTAT_dfi_alert_err_cnt_Pos (0) /*!< UMCTL2_T::CRCPARSTAT: dfi_alert_err_cnt Position*/ -#define UMCTL2_CRCPARSTAT_dfi_alert_err_cnt_Msk (0xfffful << UMCTL2_CRCPARSTAT_dfi_alert_err_cnt_Pos) /*!< UMCTL2_T::CRCPARSTAT: dfi_alert_err_cnt Mask*/ - -#define UMCTL2_CRCPARSTAT_dfi_alert_err_int_Pos (16) /*!< UMCTL2_T::CRCPARSTAT: dfi_alert_err_int Position*/ -#define UMCTL2_CRCPARSTAT_dfi_alert_err_int_Msk (0x1ul << UMCTL2_CRCPARSTAT_dfi_alert_err_int_Pos) /*!< UMCTL2_T::CRCPARSTAT: dfi_alert_err_int Mask*/ - -#define UMCTL2_INIT0_pre_cke_x1024_Pos (0) /*!< UMCTL2_T::INIT0: pre_cke_x1024 Position*/ -#define UMCTL2_INIT0_pre_cke_x1024_Msk (0xffful << UMCTL2_INIT0_pre_cke_x1024_Pos) /*!< UMCTL2_T::INIT0: pre_cke_x1024 Mask */ - -#define UMCTL2_INIT0_post_cke_x1024_Pos (16) /*!< UMCTL2_T::INIT0: post_cke_x1024 Position*/ -#define UMCTL2_INIT0_post_cke_x1024_Msk (0x3fful << UMCTL2_INIT0_post_cke_x1024_Pos) /*!< UMCTL2_T::INIT0: post_cke_x1024 Mask */ - -#define UMCTL2_INIT0_skip_dram_init_Pos (30) /*!< UMCTL2_T::INIT0: skip_dram_init Position*/ -#define UMCTL2_INIT0_skip_dram_init_Msk (0x3ul << UMCTL2_INIT0_skip_dram_init_Pos) /*!< UMCTL2_T::INIT0: skip_dram_init Mask */ - -#define UMCTL2_INIT1_pre_ocd_x32_Pos (0) /*!< UMCTL2_T::INIT1: pre_ocd_x32 Position */ -#define UMCTL2_INIT1_pre_ocd_x32_Msk (0xful << UMCTL2_INIT1_pre_ocd_x32_Pos) /*!< UMCTL2_T::INIT1: pre_ocd_x32 Mask */ - -#define UMCTL2_INIT1_dram_rstn_x1024_Pos (16) /*!< UMCTL2_T::INIT1: dram_rstn_x1024 Position*/ -#define UMCTL2_INIT1_dram_rstn_x1024_Msk (0x1fful << UMCTL2_INIT1_dram_rstn_x1024_Pos) /*!< UMCTL2_T::INIT1: dram_rstn_x1024 Mask */ - -#define UMCTL2_INIT3_emr_Pos (0) /*!< UMCTL2_T::INIT3: emr Position */ -#define UMCTL2_INIT3_emr_Msk (0xfffful << UMCTL2_INIT3_emr_Pos) /*!< UMCTL2_T::INIT3: emr Mask */ - -#define UMCTL2_INIT3_mr_Pos (16) /*!< UMCTL2_T::INIT3: mr Position */ -#define UMCTL2_INIT3_mr_Msk (0xfffful << UMCTL2_INIT3_mr_Pos) /*!< UMCTL2_T::INIT3: mr Mask */ - -#define UMCTL2_INIT4_emr3_Pos (0) /*!< UMCTL2_T::INIT4: emr3 Position */ -#define UMCTL2_INIT4_emr3_Msk (0xfffful << UMCTL2_INIT4_emr3_Pos) /*!< UMCTL2_T::INIT4: emr3 Mask */ - -#define UMCTL2_INIT4_emr2_Pos (16) /*!< UMCTL2_T::INIT4: emr2 Position */ -#define UMCTL2_INIT4_emr2_Msk (0xfffful << UMCTL2_INIT4_emr2_Pos) /*!< UMCTL2_T::INIT4: emr2 Mask */ - -#define UMCTL2_INIT5_dev_zqinit_x32_Pos (16) /*!< UMCTL2_T::INIT5: dev_zqinit_x32 Position*/ -#define UMCTL2_INIT5_dev_zqinit_x32_Msk (0xfful << UMCTL2_INIT5_dev_zqinit_x32_Pos) /*!< UMCTL2_T::INIT5: dev_zqinit_x32 Mask */ - -#define UMCTL2_DIMMCTL_dimm_stagger_cs_en_Pos (0) /*!< UMCTL2_T::DIMMCTL: dimm_stagger_cs_en Position*/ -#define UMCTL2_DIMMCTL_dimm_stagger_cs_en_Msk (0x1ul << UMCTL2_DIMMCTL_dimm_stagger_cs_en_Pos) /*!< UMCTL2_T::DIMMCTL: dimm_stagger_cs_en Mask*/ - -#define UMCTL2_DIMMCTL_dimm_addr_mirr_en_Pos (1) /*!< UMCTL2_T::DIMMCTL: dimm_addr_mirr_en Position*/ -#define UMCTL2_DIMMCTL_dimm_addr_mirr_en_Msk (0x1ul << UMCTL2_DIMMCTL_dimm_addr_mirr_en_Pos) /*!< UMCTL2_T::DIMMCTL: dimm_addr_mirr_en Mask*/ - -#define UMCTL2_RANKCTL_max_rank_rd_Pos (0) /*!< UMCTL2_T::RANKCTL: max_rank_rd Position*/ -#define UMCTL2_RANKCTL_max_rank_rd_Msk (0xful << UMCTL2_RANKCTL_max_rank_rd_Pos) /*!< UMCTL2_T::RANKCTL: max_rank_rd Mask */ - -#define UMCTL2_RANKCTL_diff_rank_rd_gap_Pos (4) /*!< UMCTL2_T::RANKCTL: diff_rank_rd_gap Position*/ -#define UMCTL2_RANKCTL_diff_rank_rd_gap_Msk (0xful << UMCTL2_RANKCTL_diff_rank_rd_gap_Pos) /*!< UMCTL2_T::RANKCTL: diff_rank_rd_gap Mask*/ - -#define UMCTL2_RANKCTL_diff_rank_wr_gap_Pos (8) /*!< UMCTL2_T::RANKCTL: diff_rank_wr_gap Position*/ -#define UMCTL2_RANKCTL_diff_rank_wr_gap_Msk (0xful << UMCTL2_RANKCTL_diff_rank_wr_gap_Pos) /*!< UMCTL2_T::RANKCTL: diff_rank_wr_gap Mask*/ - -#define UMCTL2_RANKCTL_max_rank_wr_Pos (12) /*!< UMCTL2_T::RANKCTL: max_rank_wr Position*/ -#define UMCTL2_RANKCTL_max_rank_wr_Msk (0xful << UMCTL2_RANKCTL_max_rank_wr_Pos) /*!< UMCTL2_T::RANKCTL: max_rank_wr Mask */ - -#define UMCTL2_RANKCTL_diff_rank_rd_gap_msb_Pos (24) /*!< UMCTL2_T::RANKCTL: diff_rank_rd_gap_msb Position*/ -#define UMCTL2_RANKCTL_diff_rank_rd_gap_msb_Msk (0x1ul << UMCTL2_RANKCTL_diff_rank_rd_gap_msb_Pos) /*!< UMCTL2_T::RANKCTL: diff_rank_rd_gap_msb Mask*/ - -#define UMCTL2_RANKCTL_diff_rank_wr_gap_msb_Pos (26) /*!< UMCTL2_T::RANKCTL: diff_rank_wr_gap_msb Position*/ -#define UMCTL2_RANKCTL_diff_rank_wr_gap_msb_Msk (0x1ul << UMCTL2_RANKCTL_diff_rank_wr_gap_msb_Pos) /*!< UMCTL2_T::RANKCTL: diff_rank_wr_gap_msb Mask*/ - -#define UMCTL2_DRAMTMG0_t_ras_min_Pos (0) /*!< UMCTL2_T::DRAMTMG0: t_ras_min Position */ -#define UMCTL2_DRAMTMG0_t_ras_min_Msk (0x3ful << UMCTL2_DRAMTMG0_t_ras_min_Pos) /*!< UMCTL2_T::DRAMTMG0: t_ras_min Mask */ - -#define UMCTL2_DRAMTMG0_t_ras_max_Pos (8) /*!< UMCTL2_T::DRAMTMG0: t_ras_max Position */ -#define UMCTL2_DRAMTMG0_t_ras_max_Msk (0x7ful << UMCTL2_DRAMTMG0_t_ras_max_Pos) /*!< UMCTL2_T::DRAMTMG0: t_ras_max Mask */ - -#define UMCTL2_DRAMTMG0_t_faw_Pos (16) /*!< UMCTL2_T::DRAMTMG0: t_faw Position */ -#define UMCTL2_DRAMTMG0_t_faw_Msk (0x3ful << UMCTL2_DRAMTMG0_t_faw_Pos) /*!< UMCTL2_T::DRAMTMG0: t_faw Mask */ - -#define UMCTL2_DRAMTMG0_wr2pre_Pos (24) /*!< UMCTL2_T::DRAMTMG0: wr2pre Position */ -#define UMCTL2_DRAMTMG0_wr2pre_Msk (0x7ful << UMCTL2_DRAMTMG0_wr2pre_Pos) /*!< UMCTL2_T::DRAMTMG0: wr2pre Mask */ - -#define UMCTL2_DRAMTMG1_t_rc_Pos (0) /*!< UMCTL2_T::DRAMTMG1: t_rc Position */ -#define UMCTL2_DRAMTMG1_t_rc_Msk (0x7ful << UMCTL2_DRAMTMG1_t_rc_Pos) /*!< UMCTL2_T::DRAMTMG1: t_rc Mask */ - -#define UMCTL2_DRAMTMG1_rd2pre_Pos (8) /*!< UMCTL2_T::DRAMTMG1: rd2pre Position */ -#define UMCTL2_DRAMTMG1_rd2pre_Msk (0x3ful << UMCTL2_DRAMTMG1_rd2pre_Pos) /*!< UMCTL2_T::DRAMTMG1: rd2pre Mask */ - -#define UMCTL2_DRAMTMG1_t_xp_Pos (16) /*!< UMCTL2_T::DRAMTMG1: t_xp Position */ -#define UMCTL2_DRAMTMG1_t_xp_Msk (0x1ful << UMCTL2_DRAMTMG1_t_xp_Pos) /*!< UMCTL2_T::DRAMTMG1: t_xp Mask */ - -#define UMCTL2_DRAMTMG2_wr2rd_Pos (0) /*!< UMCTL2_T::DRAMTMG2: wr2rd Position */ -#define UMCTL2_DRAMTMG2_wr2rd_Msk (0x3ful << UMCTL2_DRAMTMG2_wr2rd_Pos) /*!< UMCTL2_T::DRAMTMG2: wr2rd Mask */ - -#define UMCTL2_DRAMTMG2_rd2wr_Pos (8) /*!< UMCTL2_T::DRAMTMG2: rd2wr Position */ -#define UMCTL2_DRAMTMG2_rd2wr_Msk (0x3ful << UMCTL2_DRAMTMG2_rd2wr_Pos) /*!< UMCTL2_T::DRAMTMG2: rd2wr Mask */ - -#define UMCTL2_DRAMTMG3_t_mod_Pos (0) /*!< UMCTL2_T::DRAMTMG3: t_mod Position */ -#define UMCTL2_DRAMTMG3_t_mod_Msk (0x3fful << UMCTL2_DRAMTMG3_t_mod_Pos) /*!< UMCTL2_T::DRAMTMG3: t_mod Mask */ - -#define UMCTL2_DRAMTMG3_t_mrd_Pos (12) /*!< UMCTL2_T::DRAMTMG3: t_mrd Position */ -#define UMCTL2_DRAMTMG3_t_mrd_Msk (0x3ful << UMCTL2_DRAMTMG3_t_mrd_Pos) /*!< UMCTL2_T::DRAMTMG3: t_mrd Mask */ - -#define UMCTL2_DRAMTMG4_t_rp_Pos (0) /*!< UMCTL2_T::DRAMTMG4: t_rp Position */ -#define UMCTL2_DRAMTMG4_t_rp_Msk (0x1ful << UMCTL2_DRAMTMG4_t_rp_Pos) /*!< UMCTL2_T::DRAMTMG4: t_rp Mask */ - -#define UMCTL2_DRAMTMG4_t_rrd_Pos (8) /*!< UMCTL2_T::DRAMTMG4: t_rrd Position */ -#define UMCTL2_DRAMTMG4_t_rrd_Msk (0xful << UMCTL2_DRAMTMG4_t_rrd_Pos) /*!< UMCTL2_T::DRAMTMG4: t_rrd Mask */ - -#define UMCTL2_DRAMTMG4_t_ccd_Pos (16) /*!< UMCTL2_T::DRAMTMG4: t_ccd Position */ -#define UMCTL2_DRAMTMG4_t_ccd_Msk (0xful << UMCTL2_DRAMTMG4_t_ccd_Pos) /*!< UMCTL2_T::DRAMTMG4: t_ccd Mask */ - -#define UMCTL2_DRAMTMG4_t_rcd_Pos (24) /*!< UMCTL2_T::DRAMTMG4: t_rcd Position */ -#define UMCTL2_DRAMTMG4_t_rcd_Msk (0x1ful << UMCTL2_DRAMTMG4_t_rcd_Pos) /*!< UMCTL2_T::DRAMTMG4: t_rcd Mask */ - -#define UMCTL2_DRAMTMG5_t_cke_Pos (0) /*!< UMCTL2_T::DRAMTMG5: t_cke Position */ -#define UMCTL2_DRAMTMG5_t_cke_Msk (0x1ful << UMCTL2_DRAMTMG5_t_cke_Pos) /*!< UMCTL2_T::DRAMTMG5: t_cke Mask */ - -#define UMCTL2_DRAMTMG5_t_ckesr_Pos (8) /*!< UMCTL2_T::DRAMTMG5: t_ckesr Position */ -#define UMCTL2_DRAMTMG5_t_ckesr_Msk (0x3ful << UMCTL2_DRAMTMG5_t_ckesr_Pos) /*!< UMCTL2_T::DRAMTMG5: t_ckesr Mask */ - -#define UMCTL2_DRAMTMG5_t_cksre_Pos (16) /*!< UMCTL2_T::DRAMTMG5: t_cksre Position */ -#define UMCTL2_DRAMTMG5_t_cksre_Msk (0x7ful << UMCTL2_DRAMTMG5_t_cksre_Pos) /*!< UMCTL2_T::DRAMTMG5: t_cksre Mask */ - -#define UMCTL2_DRAMTMG5_t_cksrx_Pos (24) /*!< UMCTL2_T::DRAMTMG5: t_cksrx Position */ -#define UMCTL2_DRAMTMG5_t_cksrx_Msk (0xful << UMCTL2_DRAMTMG5_t_cksrx_Pos) /*!< UMCTL2_T::DRAMTMG5: t_cksrx Mask */ - -#define UMCTL2_DRAMTMG8_t_xs_x32_Pos (0) /*!< UMCTL2_T::DRAMTMG8: t_xs_x32 Position */ -#define UMCTL2_DRAMTMG8_t_xs_x32_Msk (0x7ful << UMCTL2_DRAMTMG8_t_xs_x32_Pos) /*!< UMCTL2_T::DRAMTMG8: t_xs_x32 Mask */ - -#define UMCTL2_DRAMTMG8_t_xs_dll_x32_Pos (8) /*!< UMCTL2_T::DRAMTMG8: t_xs_dll_x32 Position*/ -#define UMCTL2_DRAMTMG8_t_xs_dll_x32_Msk (0x7ful << UMCTL2_DRAMTMG8_t_xs_dll_x32_Pos) /*!< UMCTL2_T::DRAMTMG8: t_xs_dll_x32 Mask */ - -#define UMCTL2_DRAMTMG15_t_stab_x32_Pos (0) /*!< UMCTL2_T::DRAMTMG15: t_stab_x32 Position*/ -#define UMCTL2_DRAMTMG15_t_stab_x32_Msk (0xfful << UMCTL2_DRAMTMG15_t_stab_x32_Pos) /*!< UMCTL2_T::DRAMTMG15: t_stab_x32 Mask */ - -#define UMCTL2_DRAMTMG15_en_dfi_lp_t_stab_Pos (31) /*!< UMCTL2_T::DRAMTMG15: en_dfi_lp_t_stab Position*/ -#define UMCTL2_DRAMTMG15_en_dfi_lp_t_stab_Msk (0x1ul << UMCTL2_DRAMTMG15_en_dfi_lp_t_stab_Pos) /*!< UMCTL2_T::DRAMTMG15: en_dfi_lp_t_stab Mask*/ - -#define UMCTL2_ZQCTL0_t_zq_short_nop_Pos (0) /*!< UMCTL2_T::ZQCTL0: t_zq_short_nop Position*/ -#define UMCTL2_ZQCTL0_t_zq_short_nop_Msk (0x3fful << UMCTL2_ZQCTL0_t_zq_short_nop_Pos) /*!< UMCTL2_T::ZQCTL0: t_zq_short_nop Mask */ - -#define UMCTL2_ZQCTL0_t_zq_long_nop_Pos (16) /*!< UMCTL2_T::ZQCTL0: t_zq_long_nop Position*/ -#define UMCTL2_ZQCTL0_t_zq_long_nop_Msk (0x7fful << UMCTL2_ZQCTL0_t_zq_long_nop_Pos) /*!< UMCTL2_T::ZQCTL0: t_zq_long_nop Mask */ - -#define UMCTL2_ZQCTL0_zq_resistor_shared_Pos (29) /*!< UMCTL2_T::ZQCTL0: zq_resistor_shared Position*/ -#define UMCTL2_ZQCTL0_zq_resistor_shared_Msk (0x1ul << UMCTL2_ZQCTL0_zq_resistor_shared_Pos) /*!< UMCTL2_T::ZQCTL0: zq_resistor_shared Mask*/ - -#define UMCTL2_ZQCTL0_dis_srx_zqcl_Pos (30) /*!< UMCTL2_T::ZQCTL0: dis_srx_zqcl Position*/ -#define UMCTL2_ZQCTL0_dis_srx_zqcl_Msk (0x1ul << UMCTL2_ZQCTL0_dis_srx_zqcl_Pos) /*!< UMCTL2_T::ZQCTL0: dis_srx_zqcl Mask */ - -#define UMCTL2_ZQCTL0_dis_auto_zq_Pos (31) /*!< UMCTL2_T::ZQCTL0: dis_auto_zq Position */ -#define UMCTL2_ZQCTL0_dis_auto_zq_Msk (0x1ul << UMCTL2_ZQCTL0_dis_auto_zq_Pos) /*!< UMCTL2_T::ZQCTL0: dis_auto_zq Mask */ - -#define UMCTL2_ZQCTL1_t_zq_short_interval_x1024_Pos (0) /*!< UMCTL2_T::ZQCTL1: t_zq_short_interval_x1024 Position*/ -#define UMCTL2_ZQCTL1_t_zq_short_interval_x1024_Msk (0xffffful << UMCTL2_ZQCTL1_t_zq_short_interval_x1024_Pos) /*!< UMCTL2_T::ZQCTL1: t_zq_short_interval_x1024 Mask*/ - -#define UMCTL2_DFITMG0_dfi_tphy_wrlat_Pos (0) /*!< UMCTL2_T::DFITMG0: dfi_tphy_wrlat Position*/ -#define UMCTL2_DFITMG0_dfi_tphy_wrlat_Msk (0x3ful << UMCTL2_DFITMG0_dfi_tphy_wrlat_Pos) /*!< UMCTL2_T::DFITMG0: dfi_tphy_wrlat Mask */ - -#define UMCTL2_DFITMG0_dfi_tphy_wrdata_Pos (8) /*!< UMCTL2_T::DFITMG0: dfi_tphy_wrdata Position*/ -#define UMCTL2_DFITMG0_dfi_tphy_wrdata_Msk (0x3ful << UMCTL2_DFITMG0_dfi_tphy_wrdata_Pos) /*!< UMCTL2_T::DFITMG0: dfi_tphy_wrdata Mask*/ - -#define UMCTL2_DFITMG0_dfi_wrdata_use_dfi_phy_clk_Pos (15) /*!< UMCTL2_T::DFITMG0: dfi_wrdata_use_dfi_phy_clk Position*/ -#define UMCTL2_DFITMG0_dfi_wrdata_use_dfi_phy_clk_Msk (0x1ul << UMCTL2_DFITMG0_dfi_wrdata_use_dfi_phy_clk_Pos) /*!< UMCTL2_T::DFITMG0: dfi_wrdata_use_dfi_phy_clk Mask*/ - -#define UMCTL2_DFITMG0_dfi_t_rddata_en_Pos (16) /*!< UMCTL2_T::DFITMG0: dfi_t_rddata_en Position*/ -#define UMCTL2_DFITMG0_dfi_t_rddata_en_Msk (0x7ful << UMCTL2_DFITMG0_dfi_t_rddata_en_Pos) /*!< UMCTL2_T::DFITMG0: dfi_t_rddata_en Mask*/ - -#define UMCTL2_DFITMG0_dfi_rddata_use_dfi_phy_clk_Pos (23) /*!< UMCTL2_T::DFITMG0: dfi_rddata_use_dfi_phy_clk Position*/ -#define UMCTL2_DFITMG0_dfi_rddata_use_dfi_phy_clk_Msk (0x1ul << UMCTL2_DFITMG0_dfi_rddata_use_dfi_phy_clk_Pos) /*!< UMCTL2_T::DFITMG0: dfi_rddata_use_dfi_phy_clk Mask*/ - -#define UMCTL2_DFITMG0_dfi_t_ctrl_delay_Pos (24) /*!< UMCTL2_T::DFITMG0: dfi_t_ctrl_delay Position*/ -#define UMCTL2_DFITMG0_dfi_t_ctrl_delay_Msk (0x1ful << UMCTL2_DFITMG0_dfi_t_ctrl_delay_Pos) /*!< UMCTL2_T::DFITMG0: dfi_t_ctrl_delay Mask*/ - -#define UMCTL2_DFITMG1_dfi_t_dram_clk_enable_Pos (0) /*!< UMCTL2_T::DFITMG1: dfi_t_dram_clk_enable Position*/ -#define UMCTL2_DFITMG1_dfi_t_dram_clk_enable_Msk (0x1ful << UMCTL2_DFITMG1_dfi_t_dram_clk_enable_Pos) /*!< UMCTL2_T::DFITMG1: dfi_t_dram_clk_enable Mask*/ - -#define UMCTL2_DFITMG1_dfi_t_dram_clk_disable_Pos (8) /*!< UMCTL2_T::DFITMG1: dfi_t_dram_clk_disable Position*/ -#define UMCTL2_DFITMG1_dfi_t_dram_clk_disable_Msk (0x1ful << UMCTL2_DFITMG1_dfi_t_dram_clk_disable_Pos) /*!< UMCTL2_T::DFITMG1: dfi_t_dram_clk_disable Mask*/ - -#define UMCTL2_DFITMG1_dfi_t_wrdata_delay_Pos (16) /*!< UMCTL2_T::DFITMG1: dfi_t_wrdata_delay Position*/ -#define UMCTL2_DFITMG1_dfi_t_wrdata_delay_Msk (0x1ful << UMCTL2_DFITMG1_dfi_t_wrdata_delay_Pos) /*!< UMCTL2_T::DFITMG1: dfi_t_wrdata_delay Mask*/ - -#define UMCTL2_DFITMG1_dfi_t_parin_lat_Pos (24) /*!< UMCTL2_T::DFITMG1: dfi_t_parin_lat Position*/ -#define UMCTL2_DFITMG1_dfi_t_parin_lat_Msk (0x3ul << UMCTL2_DFITMG1_dfi_t_parin_lat_Pos) /*!< UMCTL2_T::DFITMG1: dfi_t_parin_lat Mask*/ - -#define UMCTL2_DFILPCFG0_dfi_lp_en_pd_Pos (0) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_en_pd Position*/ -#define UMCTL2_DFILPCFG0_dfi_lp_en_pd_Msk (0x1ul << UMCTL2_DFILPCFG0_dfi_lp_en_pd_Pos) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_en_pd Mask */ - -#define UMCTL2_DFILPCFG0_dfi_lp_wakeup_pd_Pos (4) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_wakeup_pd Position*/ -#define UMCTL2_DFILPCFG0_dfi_lp_wakeup_pd_Msk (0xful << UMCTL2_DFILPCFG0_dfi_lp_wakeup_pd_Pos) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_wakeup_pd Mask*/ - -#define UMCTL2_DFILPCFG0_dfi_lp_en_sr_Pos (8) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_en_sr Position*/ -#define UMCTL2_DFILPCFG0_dfi_lp_en_sr_Msk (0x1ul << UMCTL2_DFILPCFG0_dfi_lp_en_sr_Pos) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_en_sr Mask */ - -#define UMCTL2_DFILPCFG0_dfi_lp_wakeup_sr_Pos (12) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_wakeup_sr Position*/ -#define UMCTL2_DFILPCFG0_dfi_lp_wakeup_sr_Msk (0xful << UMCTL2_DFILPCFG0_dfi_lp_wakeup_sr_Pos) /*!< UMCTL2_T::DFILPCFG0: dfi_lp_wakeup_sr Mask*/ - -#define UMCTL2_DFILPCFG0_dfi_tlp_resp_Pos (24) /*!< UMCTL2_T::DFILPCFG0: dfi_tlp_resp Position*/ -#define UMCTL2_DFILPCFG0_dfi_tlp_resp_Msk (0x1ful << UMCTL2_DFILPCFG0_dfi_tlp_resp_Pos) /*!< UMCTL2_T::DFILPCFG0: dfi_tlp_resp Mask */ - -#define UMCTL2_DFIUPD0_dfi_t_ctrlup_min_Pos (0) /*!< UMCTL2_T::DFIUPD0: dfi_t_ctrlup_min Position*/ -#define UMCTL2_DFIUPD0_dfi_t_ctrlup_min_Msk (0x3fful << UMCTL2_DFIUPD0_dfi_t_ctrlup_min_Pos) /*!< UMCTL2_T::DFIUPD0: dfi_t_ctrlup_min Mask*/ - -#define UMCTL2_DFIUPD0_dfi_t_ctrlup_max_Pos (16) /*!< UMCTL2_T::DFIUPD0: dfi_t_ctrlup_max Position*/ -#define UMCTL2_DFIUPD0_dfi_t_ctrlup_max_Msk (0x3fful << UMCTL2_DFIUPD0_dfi_t_ctrlup_max_Pos) /*!< UMCTL2_T::DFIUPD0: dfi_t_ctrlup_max Mask*/ - -#define UMCTL2_DFIUPD0_ctrlupd_pre_srx_Pos (29) /*!< UMCTL2_T::DFIUPD0: ctrlupd_pre_srx Position*/ -#define UMCTL2_DFIUPD0_ctrlupd_pre_srx_Msk (0x1ul << UMCTL2_DFIUPD0_ctrlupd_pre_srx_Pos) /*!< UMCTL2_T::DFIUPD0: ctrlupd_pre_srx Mask*/ - -#define UMCTL2_DFIUPD0_dis_auto_ctrlupd_srx_Pos (30) /*!< UMCTL2_T::DFIUPD0: dis_auto_ctrlupd_srx Position*/ -#define UMCTL2_DFIUPD0_dis_auto_ctrlupd_srx_Msk (0x1ul << UMCTL2_DFIUPD0_dis_auto_ctrlupd_srx_Pos) /*!< UMCTL2_T::DFIUPD0: dis_auto_ctrlupd_srx Mask*/ - -#define UMCTL2_DFIUPD0_dis_auto_ctrlupd_Pos (31) /*!< UMCTL2_T::DFIUPD0: dis_auto_ctrlupd Position*/ -#define UMCTL2_DFIUPD0_dis_auto_ctrlupd_Msk (0x1ul << UMCTL2_DFIUPD0_dis_auto_ctrlupd_Pos) /*!< UMCTL2_T::DFIUPD0: dis_auto_ctrlupd Mask*/ - -#define UMCTL2_DFIUPD1_dfi_t_ctrlupd_interval_max_x1024_Pos (0) /*!< UMCTL2_T::DFIUPD1: dfi_t_ctrlupd_interval_max_x1024 Position*/ -#define UMCTL2_DFIUPD1_dfi_t_ctrlupd_interval_max_x1024_Msk (0xfful << UMCTL2_DFIUPD1_dfi_t_ctrlupd_interval_max_x1024_Pos) /*!< UMCTL2_T::DFIUPD1: dfi_t_ctrlupd_interval_max_x1024 Mask*/ - -#define UMCTL2_DFIUPD1_dfi_t_ctrlupd_interval_min_x1024_Pos (16) /*!< UMCTL2_T::DFIUPD1: dfi_t_ctrlupd_interval_min_x1024 Position*/ -#define UMCTL2_DFIUPD1_dfi_t_ctrlupd_interval_min_x1024_Msk (0xfful << UMCTL2_DFIUPD1_dfi_t_ctrlupd_interval_min_x1024_Pos) /*!< UMCTL2_T::DFIUPD1: dfi_t_ctrlupd_interval_min_x1024 Mask*/ - -#define UMCTL2_DFIUPD2_dfi_phyupd_en_Pos (31) /*!< UMCTL2_T::DFIUPD2: dfi_phyupd_en Position*/ -#define UMCTL2_DFIUPD2_dfi_phyupd_en_Msk (0x1ul << UMCTL2_DFIUPD2_dfi_phyupd_en_Pos) /*!< UMCTL2_T::DFIUPD2: dfi_phyupd_en Mask */ - -#define UMCTL2_DFIMISC_dfi_init_complete_en_Pos (0) /*!< UMCTL2_T::DFIMISC: dfi_init_complete_en Position*/ -#define UMCTL2_DFIMISC_dfi_init_complete_en_Msk (0x1ul << UMCTL2_DFIMISC_dfi_init_complete_en_Pos) /*!< UMCTL2_T::DFIMISC: dfi_init_complete_en Mask*/ - -#define UMCTL2_DFIMISC_ctl_idle_en_Pos (4) /*!< UMCTL2_T::DFIMISC: ctl_idle_en Position*/ -#define UMCTL2_DFIMISC_ctl_idle_en_Msk (0x1ul << UMCTL2_DFIMISC_ctl_idle_en_Pos) /*!< UMCTL2_T::DFIMISC: ctl_idle_en Mask */ - -#define UMCTL2_DFIMISC_dfi_init_start_Pos (5) /*!< UMCTL2_T::DFIMISC: dfi_init_start Position*/ -#define UMCTL2_DFIMISC_dfi_init_start_Msk (0x1ul << UMCTL2_DFIMISC_dfi_init_start_Pos) /*!< UMCTL2_T::DFIMISC: dfi_init_start Mask */ - -#define UMCTL2_DFIMISC_dfi_frequency_Pos (8) /*!< UMCTL2_T::DFIMISC: dfi_frequency Position*/ -#define UMCTL2_DFIMISC_dfi_frequency_Msk (0x1ful << UMCTL2_DFIMISC_dfi_frequency_Pos) /*!< UMCTL2_T::DFIMISC: dfi_frequency Mask */ - -#define UMCTL2_DFISTAT_dfi_init_complete_Pos (0) /*!< UMCTL2_T::DFISTAT: dfi_init_complete Position*/ -#define UMCTL2_DFISTAT_dfi_init_complete_Msk (0x1ul << UMCTL2_DFISTAT_dfi_init_complete_Pos) /*!< UMCTL2_T::DFISTAT: dfi_init_complete Mask*/ - -#define UMCTL2_DFISTAT_dfi_lp_ack_Pos (1) /*!< UMCTL2_T::DFISTAT: dfi_lp_ack Position */ -#define UMCTL2_DFISTAT_dfi_lp_ack_Msk (0x1ul << UMCTL2_DFISTAT_dfi_lp_ack_Pos) /*!< UMCTL2_T::DFISTAT: dfi_lp_ack Mask */ - -#define UMCTL2_DFIPHYMSTR_dfi_phymstr_en_Pos (0) /*!< UMCTL2_T::DFIPHYMSTR: dfi_phymstr_en Position*/ -#define UMCTL2_DFIPHYMSTR_dfi_phymstr_en_Msk (0x1ul << UMCTL2_DFIPHYMSTR_dfi_phymstr_en_Pos) /*!< UMCTL2_T::DFIPHYMSTR: dfi_phymstr_en Mask*/ - -#define UMCTL2_ADDRMAP0_addrmap_cs_bit0_Pos (0) /*!< UMCTL2_T::ADDRMAP0: addrmap_cs_bit0 Position*/ -#define UMCTL2_ADDRMAP0_addrmap_cs_bit0_Msk (0x1ful << UMCTL2_ADDRMAP0_addrmap_cs_bit0_Pos) /*!< UMCTL2_T::ADDRMAP0: addrmap_cs_bit0 Mask*/ - -#define UMCTL2_ADDRMAP1_addrmap_bank_b0_Pos (0) /*!< UMCTL2_T::ADDRMAP1: addrmap_bank_b0 Position*/ -#define UMCTL2_ADDRMAP1_addrmap_bank_b0_Msk (0x3ful << UMCTL2_ADDRMAP1_addrmap_bank_b0_Pos) /*!< UMCTL2_T::ADDRMAP1: addrmap_bank_b0 Mask*/ - -#define UMCTL2_ADDRMAP1_addrmap_bank_b1_Pos (8) /*!< UMCTL2_T::ADDRMAP1: addrmap_bank_b1 Position*/ -#define UMCTL2_ADDRMAP1_addrmap_bank_b1_Msk (0x3ful << UMCTL2_ADDRMAP1_addrmap_bank_b1_Pos) /*!< UMCTL2_T::ADDRMAP1: addrmap_bank_b1 Mask*/ - -#define UMCTL2_ADDRMAP1_addrmap_bank_b2_Pos (16) /*!< UMCTL2_T::ADDRMAP1: addrmap_bank_b2 Position*/ -#define UMCTL2_ADDRMAP1_addrmap_bank_b2_Msk (0x3ful << UMCTL2_ADDRMAP1_addrmap_bank_b2_Pos) /*!< UMCTL2_T::ADDRMAP1: addrmap_bank_b2 Mask*/ - -#define UMCTL2_ADDRMAP2_addrmap_col_b2_Pos (0) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b2 Position*/ -#define UMCTL2_ADDRMAP2_addrmap_col_b2_Msk (0xful << UMCTL2_ADDRMAP2_addrmap_col_b2_Pos) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b2 Mask*/ - -#define UMCTL2_ADDRMAP2_addrmap_col_b3_Pos (8) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b3 Position*/ -#define UMCTL2_ADDRMAP2_addrmap_col_b3_Msk (0x1ful << UMCTL2_ADDRMAP2_addrmap_col_b3_Pos) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b3 Mask*/ - -#define UMCTL2_ADDRMAP2_addrmap_col_b4_Pos (16) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b4 Position*/ -#define UMCTL2_ADDRMAP2_addrmap_col_b4_Msk (0xful << UMCTL2_ADDRMAP2_addrmap_col_b4_Pos) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b4 Mask*/ - -#define UMCTL2_ADDRMAP2_addrmap_col_b5_Pos (24) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b5 Position*/ -#define UMCTL2_ADDRMAP2_addrmap_col_b5_Msk (0xful << UMCTL2_ADDRMAP2_addrmap_col_b5_Pos) /*!< UMCTL2_T::ADDRMAP2: addrmap_col_b5 Mask*/ - -#define UMCTL2_ADDRMAP3_addrmap_col_b6_Pos (0) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b6 Position*/ -#define UMCTL2_ADDRMAP3_addrmap_col_b6_Msk (0x1ful << UMCTL2_ADDRMAP3_addrmap_col_b6_Pos) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b6 Mask*/ - -#define UMCTL2_ADDRMAP3_addrmap_col_b7_Pos (8) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b7 Position*/ -#define UMCTL2_ADDRMAP3_addrmap_col_b7_Msk (0x1ful << UMCTL2_ADDRMAP3_addrmap_col_b7_Pos) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b7 Mask*/ - -#define UMCTL2_ADDRMAP3_addrmap_col_b8_Pos (16) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b8 Position*/ -#define UMCTL2_ADDRMAP3_addrmap_col_b8_Msk (0x1ful << UMCTL2_ADDRMAP3_addrmap_col_b8_Pos) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b8 Mask*/ - -#define UMCTL2_ADDRMAP3_addrmap_col_b9_Pos (24) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b9 Position*/ -#define UMCTL2_ADDRMAP3_addrmap_col_b9_Msk (0x1ful << UMCTL2_ADDRMAP3_addrmap_col_b9_Pos) /*!< UMCTL2_T::ADDRMAP3: addrmap_col_b9 Mask*/ - -#define UMCTL2_ADDRMAP4_addrmap_col_b10_Pos (0) /*!< UMCTL2_T::ADDRMAP4: addrmap_col_b10 Position*/ -#define UMCTL2_ADDRMAP4_addrmap_col_b10_Msk (0x1ful << UMCTL2_ADDRMAP4_addrmap_col_b10_Pos) /*!< UMCTL2_T::ADDRMAP4: addrmap_col_b10 Mask*/ - -#define UMCTL2_ADDRMAP4_addrmap_col_b11_Pos (8) /*!< UMCTL2_T::ADDRMAP4: addrmap_col_b11 Position*/ -#define UMCTL2_ADDRMAP4_addrmap_col_b11_Msk (0x1ful << UMCTL2_ADDRMAP4_addrmap_col_b11_Pos) /*!< UMCTL2_T::ADDRMAP4: addrmap_col_b11 Mask*/ - -#define UMCTL2_ADDRMAP5_addrmap_row_b0_Pos (0) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b0 Position*/ -#define UMCTL2_ADDRMAP5_addrmap_row_b0_Msk (0xful << UMCTL2_ADDRMAP5_addrmap_row_b0_Pos) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b0 Mask*/ - -#define UMCTL2_ADDRMAP5_addrmap_row_b1_Pos (8) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b1 Position*/ -#define UMCTL2_ADDRMAP5_addrmap_row_b1_Msk (0xful << UMCTL2_ADDRMAP5_addrmap_row_b1_Pos) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b1 Mask*/ - -#define UMCTL2_ADDRMAP5_addrmap_row_b2_10_Pos (16) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b2_10 Position*/ -#define UMCTL2_ADDRMAP5_addrmap_row_b2_10_Msk (0xful << UMCTL2_ADDRMAP5_addrmap_row_b2_10_Pos) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b2_10 Mask*/ - -#define UMCTL2_ADDRMAP5_addrmap_row_b11_Pos (24) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b11 Position*/ -#define UMCTL2_ADDRMAP5_addrmap_row_b11_Msk (0xful << UMCTL2_ADDRMAP5_addrmap_row_b11_Pos) /*!< UMCTL2_T::ADDRMAP5: addrmap_row_b11 Mask*/ - -#define UMCTL2_ADDRMAP6_addrmap_row_b12_Pos (0) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b12 Position*/ -#define UMCTL2_ADDRMAP6_addrmap_row_b12_Msk (0xful << UMCTL2_ADDRMAP6_addrmap_row_b12_Pos) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b12 Mask*/ - -#define UMCTL2_ADDRMAP6_addrmap_row_b13_Pos (8) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b13 Position*/ -#define UMCTL2_ADDRMAP6_addrmap_row_b13_Msk (0xful << UMCTL2_ADDRMAP6_addrmap_row_b13_Pos) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b13 Mask*/ - -#define UMCTL2_ADDRMAP6_addrmap_row_b14_Pos (16) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b14 Position*/ -#define UMCTL2_ADDRMAP6_addrmap_row_b14_Msk (0xful << UMCTL2_ADDRMAP6_addrmap_row_b14_Pos) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b14 Mask*/ - -#define UMCTL2_ADDRMAP6_addrmap_row_b15_Pos (24) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b15 Position*/ -#define UMCTL2_ADDRMAP6_addrmap_row_b15_Msk (0xful << UMCTL2_ADDRMAP6_addrmap_row_b15_Pos) /*!< UMCTL2_T::ADDRMAP6: addrmap_row_b15 Mask*/ - -#define UMCTL2_ADDRMAP9_addrmap_row_b2_Pos (0) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b2 Position*/ -#define UMCTL2_ADDRMAP9_addrmap_row_b2_Msk (0xful << UMCTL2_ADDRMAP9_addrmap_row_b2_Pos) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b2 Mask*/ - -#define UMCTL2_ADDRMAP9_addrmap_row_b3_Pos (8) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b3 Position*/ -#define UMCTL2_ADDRMAP9_addrmap_row_b3_Msk (0xful << UMCTL2_ADDRMAP9_addrmap_row_b3_Pos) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b3 Mask*/ - -#define UMCTL2_ADDRMAP9_addrmap_row_b4_Pos (16) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b4 Position*/ -#define UMCTL2_ADDRMAP9_addrmap_row_b4_Msk (0xful << UMCTL2_ADDRMAP9_addrmap_row_b4_Pos) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b4 Mask*/ - -#define UMCTL2_ADDRMAP9_addrmap_row_b5_Pos (24) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b5 Position*/ -#define UMCTL2_ADDRMAP9_addrmap_row_b5_Msk (0xful << UMCTL2_ADDRMAP9_addrmap_row_b5_Pos) /*!< UMCTL2_T::ADDRMAP9: addrmap_row_b5 Mask*/ - -#define UMCTL2_ADDRMAP10_addrmap_row_b6_Pos (0) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b6 Position*/ -#define UMCTL2_ADDRMAP10_addrmap_row_b6_Msk (0xful << UMCTL2_ADDRMAP10_addrmap_row_b6_Pos) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b6 Mask*/ - -#define UMCTL2_ADDRMAP10_addrmap_row_b7_Pos (8) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b7 Position*/ -#define UMCTL2_ADDRMAP10_addrmap_row_b7_Msk (0xful << UMCTL2_ADDRMAP10_addrmap_row_b7_Pos) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b7 Mask*/ - -#define UMCTL2_ADDRMAP10_addrmap_row_b8_Pos (16) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b8 Position*/ -#define UMCTL2_ADDRMAP10_addrmap_row_b8_Msk (0xful << UMCTL2_ADDRMAP10_addrmap_row_b8_Pos) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b8 Mask*/ - -#define UMCTL2_ADDRMAP10_addrmap_row_b9_Pos (24) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b9 Position*/ -#define UMCTL2_ADDRMAP10_addrmap_row_b9_Msk (0xful << UMCTL2_ADDRMAP10_addrmap_row_b9_Pos) /*!< UMCTL2_T::ADDRMAP10: addrmap_row_b9 Mask*/ - -#define UMCTL2_ADDRMAP11_addrmap_row_b10_Pos (0) /*!< UMCTL2_T::ADDRMAP11: addrmap_row_b10 Position*/ -#define UMCTL2_ADDRMAP11_addrmap_row_b10_Msk (0xful << UMCTL2_ADDRMAP11_addrmap_row_b10_Pos) /*!< UMCTL2_T::ADDRMAP11: addrmap_row_b10 Mask*/ - -#define UMCTL2_ODTCFG_rd_odt_delay_Pos (2) /*!< UMCTL2_T::ODTCFG: rd_odt_delay Position*/ -#define UMCTL2_ODTCFG_rd_odt_delay_Msk (0x1ful << UMCTL2_ODTCFG_rd_odt_delay_Pos) /*!< UMCTL2_T::ODTCFG: rd_odt_delay Mask */ - -#define UMCTL2_ODTCFG_rd_odt_hold_Pos (8) /*!< UMCTL2_T::ODTCFG: rd_odt_hold Position */ -#define UMCTL2_ODTCFG_rd_odt_hold_Msk (0xful << UMCTL2_ODTCFG_rd_odt_hold_Pos) /*!< UMCTL2_T::ODTCFG: rd_odt_hold Mask */ - -#define UMCTL2_ODTCFG_wr_odt_delay_Pos (16) /*!< UMCTL2_T::ODTCFG: wr_odt_delay Position*/ -#define UMCTL2_ODTCFG_wr_odt_delay_Msk (0x1ful << UMCTL2_ODTCFG_wr_odt_delay_Pos) /*!< UMCTL2_T::ODTCFG: wr_odt_delay Mask */ - -#define UMCTL2_ODTCFG_wr_odt_hold_Pos (24) /*!< UMCTL2_T::ODTCFG: wr_odt_hold Position */ -#define UMCTL2_ODTCFG_wr_odt_hold_Msk (0xful << UMCTL2_ODTCFG_wr_odt_hold_Pos) /*!< UMCTL2_T::ODTCFG: wr_odt_hold Mask */ - -#define UMCTL2_ODTMAP_rank0_wr_odt_Pos (0) /*!< UMCTL2_T::ODTMAP: rank0_wr_odt Position*/ -#define UMCTL2_ODTMAP_rank0_wr_odt_Msk (0x3ul << UMCTL2_ODTMAP_rank0_wr_odt_Pos) /*!< UMCTL2_T::ODTMAP: rank0_wr_odt Mask */ - -#define UMCTL2_ODTMAP_rank0_rd_odt_Pos (4) /*!< UMCTL2_T::ODTMAP: rank0_rd_odt Position*/ -#define UMCTL2_ODTMAP_rank0_rd_odt_Msk (0x3ul << UMCTL2_ODTMAP_rank0_rd_odt_Pos) /*!< UMCTL2_T::ODTMAP: rank0_rd_odt Mask */ - -#define UMCTL2_ODTMAP_rank1_wr_odt_Pos (8) /*!< UMCTL2_T::ODTMAP: rank1_wr_odt Position*/ -#define UMCTL2_ODTMAP_rank1_wr_odt_Msk (0x3ul << UMCTL2_ODTMAP_rank1_wr_odt_Pos) /*!< UMCTL2_T::ODTMAP: rank1_wr_odt Mask */ - -#define UMCTL2_ODTMAP_rank1_rd_odt_Pos (12) /*!< UMCTL2_T::ODTMAP: rank1_rd_odt Position*/ -#define UMCTL2_ODTMAP_rank1_rd_odt_Msk (0x3ul << UMCTL2_ODTMAP_rank1_rd_odt_Pos) /*!< UMCTL2_T::ODTMAP: rank1_rd_odt Mask */ - -#define UMCTL2_SCHED_prefer_write_Pos (1) /*!< UMCTL2_T::SCHED: prefer_write Position */ -#define UMCTL2_SCHED_prefer_write_Msk (0x1ul << UMCTL2_SCHED_prefer_write_Pos) /*!< UMCTL2_T::SCHED: prefer_write Mask */ - -#define UMCTL2_SCHED_Pageclose_Pos (2) /*!< UMCTL2_T::SCHED: Pageclose Position */ -#define UMCTL2_SCHED_Pageclose_Msk (0x1ul << UMCTL2_SCHED_Pageclose_Pos) /*!< UMCTL2_T::SCHED: Pageclose Mask */ - -#define UMCTL2_SCHED_lpr_num_entries_Pos (8) /*!< UMCTL2_T::SCHED: lpr_num_entries Position*/ -#define UMCTL2_SCHED_lpr_num_entries_Msk (0x1ful << UMCTL2_SCHED_lpr_num_entries_Pos) /*!< UMCTL2_T::SCHED: lpr_num_entries Mask */ - -#define UMCTL2_SCHED_go2critical_hysteresis_Pos (16) /*!< UMCTL2_T::SCHED: go2critical_hysteresis Position*/ -#define UMCTL2_SCHED_go2critical_hysteresis_Msk (0xfful << UMCTL2_SCHED_go2critical_hysteresis_Pos) /*!< UMCTL2_T::SCHED: go2critical_hysteresis Mask*/ - -#define UMCTL2_SCHED_rdwr_idle_gap_Pos (24) /*!< UMCTL2_T::SCHED: rdwr_idle_gap Position*/ -#define UMCTL2_SCHED_rdwr_idle_gap_Msk (0x7ful << UMCTL2_SCHED_rdwr_idle_gap_Pos) /*!< UMCTL2_T::SCHED: rdwr_idle_gap Mask */ - -#define UMCTL2_SCHED1_pageclose_timer_Pos (0) /*!< UMCTL2_T::SCHED1: pageclose_timer Position*/ -#define UMCTL2_SCHED1_pageclose_timer_Msk (0xfful << UMCTL2_SCHED1_pageclose_timer_Pos) /*!< UMCTL2_T::SCHED1: pageclose_timer Mask */ - -#define UMCTL2_PERFHPR1_hpr_max_starve_Pos (0) /*!< UMCTL2_T::PERFHPR1: hpr_max_starve Position*/ -#define UMCTL2_PERFHPR1_hpr_max_starve_Msk (0xfffful << UMCTL2_PERFHPR1_hpr_max_starve_Pos) /*!< UMCTL2_T::PERFHPR1: hpr_max_starve Mask*/ - -#define UMCTL2_PERFHPR1_hpr_xact_run_length_Pos (24) /*!< UMCTL2_T::PERFHPR1: hpr_xact_run_length Position*/ -#define UMCTL2_PERFHPR1_hpr_xact_run_length_Msk (0xfful << UMCTL2_PERFHPR1_hpr_xact_run_length_Pos) /*!< UMCTL2_T::PERFHPR1: hpr_xact_run_length Mask*/ - -#define UMCTL2_PERFLPR1_lpr_max_starve_Pos (0) /*!< UMCTL2_T::PERFLPR1: lpr_max_starve Position*/ -#define UMCTL2_PERFLPR1_lpr_max_starve_Msk (0xfffful << UMCTL2_PERFLPR1_lpr_max_starve_Pos) /*!< UMCTL2_T::PERFLPR1: lpr_max_starve Mask*/ - -#define UMCTL2_PERFLPR1_lpr_xact_run_length_Pos (24) /*!< UMCTL2_T::PERFLPR1: lpr_xact_run_length Position*/ -#define UMCTL2_PERFLPR1_lpr_xact_run_length_Msk (0xfful << UMCTL2_PERFLPR1_lpr_xact_run_length_Pos) /*!< UMCTL2_T::PERFLPR1: lpr_xact_run_length Mask*/ - -#define UMCTL2_PERFWR1_w_max_starve_Pos (0) /*!< UMCTL2_T::PERFWR1: w_max_starve Position*/ -#define UMCTL2_PERFWR1_w_max_starve_Msk (0xfffful << UMCTL2_PERFWR1_w_max_starve_Pos) /*!< UMCTL2_T::PERFWR1: w_max_starve Mask */ - -#define UMCTL2_PERFWR1_w_xact_run_length_Pos (24) /*!< UMCTL2_T::PERFWR1: w_xact_run_length Position*/ -#define UMCTL2_PERFWR1_w_xact_run_length_Msk (0xfful << UMCTL2_PERFWR1_w_xact_run_length_Pos) /*!< UMCTL2_T::PERFWR1: w_xact_run_length Mask*/ - -#define UMCTL2_DBG0_dis_wc_Pos (0) /*!< UMCTL2_T::DBG0: dis_wc Position */ -#define UMCTL2_DBG0_dis_wc_Msk (0x1ul << UMCTL2_DBG0_dis_wc_Pos) /*!< UMCTL2_T::DBG0: dis_wc Mask */ - -#define UMCTL2_DBG0_dis_rd_bypass_Pos (1) /*!< UMCTL2_T::DBG0: dis_rd_bypass Position */ -#define UMCTL2_DBG0_dis_rd_bypass_Msk (0x1ul << UMCTL2_DBG0_dis_rd_bypass_Pos) /*!< UMCTL2_T::DBG0: dis_rd_bypass Mask */ - -#define UMCTL2_DBG0_dis_act_bypass_Pos (2) /*!< UMCTL2_T::DBG0: dis_act_bypass Position*/ -#define UMCTL2_DBG0_dis_act_bypass_Msk (0x1ul << UMCTL2_DBG0_dis_act_bypass_Pos) /*!< UMCTL2_T::DBG0: dis_act_bypass Mask */ - -#define UMCTL2_DBG0_dis_collision_page_opt_Pos (4) /*!< UMCTL2_T::DBG0: dis_collision_page_opt Position*/ -#define UMCTL2_DBG0_dis_collision_page_opt_Msk (0x1ul << UMCTL2_DBG0_dis_collision_page_opt_Pos) /*!< UMCTL2_T::DBG0: dis_collision_page_opt Mask*/ - -#define UMCTL2_DBG0_dis_max_rank_rd_opt_Pos (6) /*!< UMCTL2_T::DBG0: dis_max_rank_rd_opt Position*/ -#define UMCTL2_DBG0_dis_max_rank_rd_opt_Msk (0x1ul << UMCTL2_DBG0_dis_max_rank_rd_opt_Pos) /*!< UMCTL2_T::DBG0: dis_max_rank_rd_opt Mask*/ - -#define UMCTL2_DBG0_dis_max_rank_wr_opt_Pos (7) /*!< UMCTL2_T::DBG0: dis_max_rank_wr_opt Position*/ -#define UMCTL2_DBG0_dis_max_rank_wr_opt_Msk (0x1ul << UMCTL2_DBG0_dis_max_rank_wr_opt_Pos) /*!< UMCTL2_T::DBG0: dis_max_rank_wr_opt Mask*/ - -#define UMCTL2_DBG1_dis_dq_Pos (0) /*!< UMCTL2_T::DBG1: dis_dq Position */ -#define UMCTL2_DBG1_dis_dq_Msk (0x1ul << UMCTL2_DBG1_dis_dq_Pos) /*!< UMCTL2_T::DBG1: dis_dq Mask */ - -#define UMCTL2_DBG1_dis_hif_Pos (1) /*!< UMCTL2_T::DBG1: dis_hif Position */ -#define UMCTL2_DBG1_dis_hif_Msk (0x1ul << UMCTL2_DBG1_dis_hif_Pos) /*!< UMCTL2_T::DBG1: dis_hif Mask */ - -#define UMCTL2_DBGCAM_dbg_hpr_q_depth_Pos (0) /*!< UMCTL2_T::DBGCAM: dbg_hpr_q_depth Position*/ -#define UMCTL2_DBGCAM_dbg_hpr_q_depth_Msk (0x3ful << UMCTL2_DBGCAM_dbg_hpr_q_depth_Pos) /*!< UMCTL2_T::DBGCAM: dbg_hpr_q_depth Mask */ - -#define UMCTL2_DBGCAM_dbg_lpr_q_depth_Pos (8) /*!< UMCTL2_T::DBGCAM: dbg_lpr_q_depth Position*/ -#define UMCTL2_DBGCAM_dbg_lpr_q_depth_Msk (0x3ful << UMCTL2_DBGCAM_dbg_lpr_q_depth_Pos) /*!< UMCTL2_T::DBGCAM: dbg_lpr_q_depth Mask */ - -#define UMCTL2_DBGCAM_dbg_w_q_depth_Pos (16) /*!< UMCTL2_T::DBGCAM: dbg_w_q_depth Position*/ -#define UMCTL2_DBGCAM_dbg_w_q_depth_Msk (0x3ful << UMCTL2_DBGCAM_dbg_w_q_depth_Pos) /*!< UMCTL2_T::DBGCAM: dbg_w_q_depth Mask */ - -#define UMCTL2_DBGCAM_dbg_stall_Pos (24) /*!< UMCTL2_T::DBGCAM: dbg_stall Position */ -#define UMCTL2_DBGCAM_dbg_stall_Msk (0x1ul << UMCTL2_DBGCAM_dbg_stall_Pos) /*!< UMCTL2_T::DBGCAM: dbg_stall Mask */ - -#define UMCTL2_DBGCAM_dbg_rd_q_empty_Pos (25) /*!< UMCTL2_T::DBGCAM: dbg_rd_q_empty Position*/ -#define UMCTL2_DBGCAM_dbg_rd_q_empty_Msk (0x1ul << UMCTL2_DBGCAM_dbg_rd_q_empty_Pos) /*!< UMCTL2_T::DBGCAM: dbg_rd_q_empty Mask */ - -#define UMCTL2_DBGCAM_dbg_wr_q_empty_Pos (26) /*!< UMCTL2_T::DBGCAM: dbg_wr_q_empty Position*/ -#define UMCTL2_DBGCAM_dbg_wr_q_empty_Msk (0x1ul << UMCTL2_DBGCAM_dbg_wr_q_empty_Pos) /*!< UMCTL2_T::DBGCAM: dbg_wr_q_empty Mask */ - -#define UMCTL2_DBGCAM_rd_data_pipeline_empty_Pos (28) /*!< UMCTL2_T::DBGCAM: rd_data_pipeline_empty Position*/ -#define UMCTL2_DBGCAM_rd_data_pipeline_empty_Msk (0x1ul << UMCTL2_DBGCAM_rd_data_pipeline_empty_Pos) /*!< UMCTL2_T::DBGCAM: rd_data_pipeline_empty Mask*/ - -#define UMCTL2_DBGCAM_wr_data_pipeline_empty_Pos (29) /*!< UMCTL2_T::DBGCAM: wr_data_pipeline_empty Position*/ -#define UMCTL2_DBGCAM_wr_data_pipeline_empty_Msk (0x1ul << UMCTL2_DBGCAM_wr_data_pipeline_empty_Pos) /*!< UMCTL2_T::DBGCAM: wr_data_pipeline_empty Mask*/ - -#define UMCTL2_DBGCMD_rank0_refresh_Pos (0) /*!< UMCTL2_T::DBGCMD: rank0_refresh Position*/ -#define UMCTL2_DBGCMD_rank0_refresh_Msk (0x1ul << UMCTL2_DBGCMD_rank0_refresh_Pos) /*!< UMCTL2_T::DBGCMD: rank0_refresh Mask */ - -#define UMCTL2_DBGCMD_rank1_refresh_Pos (1) /*!< UMCTL2_T::DBGCMD: rank1_refresh Position*/ -#define UMCTL2_DBGCMD_rank1_refresh_Msk (0x1ul << UMCTL2_DBGCMD_rank1_refresh_Pos) /*!< UMCTL2_T::DBGCMD: rank1_refresh Mask */ - -#define UMCTL2_DBGCMD_zq_calib_short_Pos (4) /*!< UMCTL2_T::DBGCMD: zq_calib_short Position*/ -#define UMCTL2_DBGCMD_zq_calib_short_Msk (0x1ul << UMCTL2_DBGCMD_zq_calib_short_Pos) /*!< UMCTL2_T::DBGCMD: zq_calib_short Mask */ - -#define UMCTL2_DBGCMD_ctrlupd_Pos (5) /*!< UMCTL2_T::DBGCMD: ctrlupd Position */ -#define UMCTL2_DBGCMD_ctrlupd_Msk (0x1ul << UMCTL2_DBGCMD_ctrlupd_Pos) /*!< UMCTL2_T::DBGCMD: ctrlupd Mask */ - -#define UMCTL2_DBGSTAT_rank0_refresh_busy_Pos (0) /*!< UMCTL2_T::DBGSTAT: rank0_refresh_busy Position*/ -#define UMCTL2_DBGSTAT_rank0_refresh_busy_Msk (0x1ul << UMCTL2_DBGSTAT_rank0_refresh_busy_Pos) /*!< UMCTL2_T::DBGSTAT: rank0_refresh_busy Mask*/ - -#define UMCTL2_DBGSTAT_rank1_refresh_busy_Pos (1) /*!< UMCTL2_T::DBGSTAT: rank1_refresh_busy Position*/ -#define UMCTL2_DBGSTAT_rank1_refresh_busy_Msk (0x1ul << UMCTL2_DBGSTAT_rank1_refresh_busy_Pos) /*!< UMCTL2_T::DBGSTAT: rank1_refresh_busy Mask*/ - -#define UMCTL2_DBGSTAT_zq_calib_short_busy_Pos (4) /*!< UMCTL2_T::DBGSTAT: zq_calib_short_busy Position*/ -#define UMCTL2_DBGSTAT_zq_calib_short_busy_Msk (0x1ul << UMCTL2_DBGSTAT_zq_calib_short_busy_Pos) /*!< UMCTL2_T::DBGSTAT: zq_calib_short_busy Mask*/ - -#define UMCTL2_DBGSTAT_ctrlupd_busy_Pos (5) /*!< UMCTL2_T::DBGSTAT: ctrlupd_busy Position*/ -#define UMCTL2_DBGSTAT_ctrlupd_busy_Msk (0x1ul << UMCTL2_DBGSTAT_ctrlupd_busy_Pos) /*!< UMCTL2_T::DBGSTAT: ctrlupd_busy Mask */ - -#define UMCTL2_SWCTL_sw_done_Pos (0) /*!< UMCTL2_T::SWCTL: sw_done Position */ -#define UMCTL2_SWCTL_sw_done_Msk (0x1ul << UMCTL2_SWCTL_sw_done_Pos) /*!< UMCTL2_T::SWCTL: sw_done Mask */ - -#define UMCTL2_SWSTAT_sw_done_ack_Pos (0) /*!< UMCTL2_T::SWSTAT: sw_done_ack Position */ -#define UMCTL2_SWSTAT_sw_done_ack_Msk (0x1ul << UMCTL2_SWSTAT_sw_done_ack_Pos) /*!< UMCTL2_T::SWSTAT: sw_done_ack Mask */ - -#define UMCTL2_SWCTLSTATIC_sw_static_unlock_Pos (0) /*!< UMCTL2_T::SWCTLSTATIC: sw_static_unlock Position*/ -#define UMCTL2_SWCTLSTATIC_sw_static_unlock_Msk (0x1ul << UMCTL2_SWCTLSTATIC_sw_static_unlock_Pos) /*!< UMCTL2_T::SWCTLSTATIC: sw_static_unlock Mask*/ - -#define UMCTL2_POISONCFG_wr_poison_slverr_en_Pos (0) /*!< UMCTL2_T::POISONCFG: wr_poison_slverr_en Position*/ -#define UMCTL2_POISONCFG_wr_poison_slverr_en_Msk (0x1ul << UMCTL2_POISONCFG_wr_poison_slverr_en_Pos) /*!< UMCTL2_T::POISONCFG: wr_poison_slverr_en Mask*/ - -#define UMCTL2_POISONCFG_wr_poison_intr_en_Pos (4) /*!< UMCTL2_T::POISONCFG: wr_poison_intr_en Position*/ -#define UMCTL2_POISONCFG_wr_poison_intr_en_Msk (0x1ul << UMCTL2_POISONCFG_wr_poison_intr_en_Pos) /*!< UMCTL2_T::POISONCFG: wr_poison_intr_en Mask*/ - -#define UMCTL2_POISONCFG_wr_poison_intr_clr_Pos (8) /*!< UMCTL2_T::POISONCFG: wr_poison_intr_clr Position*/ -#define UMCTL2_POISONCFG_wr_poison_intr_clr_Msk (0x1ul << UMCTL2_POISONCFG_wr_poison_intr_clr_Pos) /*!< UMCTL2_T::POISONCFG: wr_poison_intr_clr Mask*/ - -#define UMCTL2_POISONCFG_rd_poison_slverr_en_Pos (16) /*!< UMCTL2_T::POISONCFG: rd_poison_slverr_en Position*/ -#define UMCTL2_POISONCFG_rd_poison_slverr_en_Msk (0x1ul << UMCTL2_POISONCFG_rd_poison_slverr_en_Pos) /*!< UMCTL2_T::POISONCFG: rd_poison_slverr_en Mask*/ - -#define UMCTL2_POISONCFG_rd_poison_intr_en_Pos (20) /*!< UMCTL2_T::POISONCFG: rd_poison_intr_en Position*/ -#define UMCTL2_POISONCFG_rd_poison_intr_en_Msk (0x1ul << UMCTL2_POISONCFG_rd_poison_intr_en_Pos) /*!< UMCTL2_T::POISONCFG: rd_poison_intr_en Mask*/ - -#define UMCTL2_POISONCFG_rd_poison_intr_clr_Pos (24) /*!< UMCTL2_T::POISONCFG: rd_poison_intr_clr Position*/ -#define UMCTL2_POISONCFG_rd_poison_intr_clr_Msk (0x1ul << UMCTL2_POISONCFG_rd_poison_intr_clr_Pos) /*!< UMCTL2_T::POISONCFG: rd_poison_intr_clr Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_0_Pos (0) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_0 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_0_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_0_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_0 Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_1_Pos (1) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_1 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_1_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_1_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_1 Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_2_Pos (2) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_2 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_2_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_2_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_2 Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_3_Pos (3) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_3 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_3_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_3_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_3 Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_4_Pos (4) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_4 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_4_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_4_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_4 Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_5_Pos (5) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_5 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_5_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_5_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_5 Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_6_Pos (6) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_6 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_6_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_6_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_6 Mask*/ - -#define UMCTL2_POISONSTAT_wr_poison_intr_7_Pos (7) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_7 Position*/ -#define UMCTL2_POISONSTAT_wr_poison_intr_7_Msk (0x1ul << UMCTL2_POISONSTAT_wr_poison_intr_7_Pos) /*!< UMCTL2_T::POISONSTAT: wr_poison_intr_7 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_0_Pos (16) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_0 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_0_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_0_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_0 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_1_Pos (17) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_1 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_1_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_1_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_1 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_2_Pos (18) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_2 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_2_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_2_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_2 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_3_Pos (19) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_3 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_3_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_3_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_3 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_4_Pos (20) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_4 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_4_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_4_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_4 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_5_Pos (21) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_5 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_5_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_5_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_5 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_6_Pos (22) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_6 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_6_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_6_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_6 Mask*/ - -#define UMCTL2_POISONSTAT_rd_poison_intr_7_Pos (23) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_7 Position*/ -#define UMCTL2_POISONSTAT_rd_poison_intr_7_Msk (0x1ul << UMCTL2_POISONSTAT_rd_poison_intr_7_Pos) /*!< UMCTL2_T::POISONSTAT: rd_poison_intr_7 Mask*/ - -#define UMCTL2_PSTAT_rd_port_busy_0_Pos (0) /*!< UMCTL2_T::PSTAT: rd_port_busy_0 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_0_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_0_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_0 Mask */ - -#define UMCTL2_PSTAT_rd_port_busy_1_Pos (1) /*!< UMCTL2_T::PSTAT: rd_port_busy_1 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_1_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_1_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_1 Mask */ - -#define UMCTL2_PSTAT_rd_port_busy_2_Pos (2) /*!< UMCTL2_T::PSTAT: rd_port_busy_2 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_2_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_2_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_2 Mask */ - -#define UMCTL2_PSTAT_rd_port_busy_3_Pos (3) /*!< UMCTL2_T::PSTAT: rd_port_busy_3 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_3_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_3_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_3 Mask */ - -#define UMCTL2_PSTAT_rd_port_busy_4_Pos (4) /*!< UMCTL2_T::PSTAT: rd_port_busy_4 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_4_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_4_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_4 Mask */ - -#define UMCTL2_PSTAT_rd_port_busy_5_Pos (5) /*!< UMCTL2_T::PSTAT: rd_port_busy_5 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_5_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_5_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_5 Mask */ - -#define UMCTL2_PSTAT_rd_port_busy_6_Pos (6) /*!< UMCTL2_T::PSTAT: rd_port_busy_6 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_6_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_6_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_6 Mask */ - -#define UMCTL2_PSTAT_rd_port_busy_7_Pos (7) /*!< UMCTL2_T::PSTAT: rd_port_busy_7 Position*/ -#define UMCTL2_PSTAT_rd_port_busy_7_Msk (0x1ul << UMCTL2_PSTAT_rd_port_busy_7_Pos) /*!< UMCTL2_T::PSTAT: rd_port_busy_7 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_0_Pos (16) /*!< UMCTL2_T::PSTAT: wr_port_busy_0 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_0_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_0_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_0 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_1_Pos (17) /*!< UMCTL2_T::PSTAT: wr_port_busy_1 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_1_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_1_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_1 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_2_Pos (18) /*!< UMCTL2_T::PSTAT: wr_port_busy_2 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_2_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_2_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_2 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_3_Pos (19) /*!< UMCTL2_T::PSTAT: wr_port_busy_3 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_3_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_3_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_3 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_4_Pos (20) /*!< UMCTL2_T::PSTAT: wr_port_busy_4 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_4_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_4_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_4 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_5_Pos (21) /*!< UMCTL2_T::PSTAT: wr_port_busy_5 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_5_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_5_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_5 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_6_Pos (22) /*!< UMCTL2_T::PSTAT: wr_port_busy_6 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_6_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_6_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_6 Mask */ - -#define UMCTL2_PSTAT_wr_port_busy_7_Pos (23) /*!< UMCTL2_T::PSTAT: wr_port_busy_7 Position*/ -#define UMCTL2_PSTAT_wr_port_busy_7_Msk (0x1ul << UMCTL2_PSTAT_wr_port_busy_7_Pos) /*!< UMCTL2_T::PSTAT: wr_port_busy_7 Mask */ - -#define UMCTL2_PCCFG_go2critical_en_Pos (0) /*!< UMCTL2_T::PCCFG: go2critical_en Position*/ -#define UMCTL2_PCCFG_go2critical_en_Msk (0x1ul << UMCTL2_PCCFG_go2critical_en_Pos) /*!< UMCTL2_T::PCCFG: go2critical_en Mask */ - -#define UMCTL2_PCCFG_pagematch_limit_Pos (4) /*!< UMCTL2_T::PCCFG: pagematch_limit Position*/ -#define UMCTL2_PCCFG_pagematch_limit_Msk (0x1ul << UMCTL2_PCCFG_pagematch_limit_Pos) /*!< UMCTL2_T::PCCFG: pagematch_limit Mask */ - -#define UMCTL2_PCCFG_bl_exp_mode_Pos (8) /*!< UMCTL2_T::PCCFG: bl_exp_mode Position */ -#define UMCTL2_PCCFG_bl_exp_mode_Msk (0x1ul << UMCTL2_PCCFG_bl_exp_mode_Pos) /*!< UMCTL2_T::PCCFG: bl_exp_mode Mask */ - -#define UMCTL2_PCFGR_0_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_0: rd_port_priority Position */ -#define UMCTL2_PCFGR_0_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_0_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_0: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_0_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_0: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_0_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_0_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_0: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_0_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_0: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_0_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_0_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_0: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_0_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_0: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_0_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_0_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_0: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_0_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::PCFGR_0: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_00_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_0_rdwr_ordered_en_Pos) /*!< UMCTL2_T::PCFGR_0: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_0_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_0: wr_port_priority Position */ -#define UMCTL2_PCFGW_0_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_0_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_0: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_0_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_0: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_0_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_0_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_0: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_0_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_0: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_0_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_0_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_0: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_0_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGW_0: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_0_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_0_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGW_0: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_0_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_0: port_en Position */ -#define UMCTL2_PCTRL_0_port_en_Msk (0x1ul << UMCTL2_PCTRL_0_port_en_Pos) /*!< UMCTL2_T::PCTRL_0: port_en Mask */ - -#define UMCTL2_PCFGQOS0_0_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_0: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_0_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_0_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_0: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_0_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_0: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_0_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_0_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_0: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_0_rqos_map_region1_Pos (20) /*!< UMCTL2_T::0: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_0_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_0_rqos_map_region1_Pos) /*!< UMCTL2_T::0: rqos_map_region1 Mask */ - -#define UMCTL2_PCFGR_1_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_1: rd_port_priority Position */ -#define UMCTL2_PCFGR_1_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_1_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_1: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_1_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_1: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_1_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_1_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_1: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_1_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_1: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_1_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_1_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_1: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_1_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_1: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_1_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_1_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_1: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_1_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::PCFGR_1: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_1_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_1_rdwr_ordered_en_Pos) /*!< UMCTL2_T::PCFGR_1: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_1_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_1: wr_port_priority Position */ -#define UMCTL2_PCFGW_1_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_1_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_1: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_1_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_1: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_1_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_1_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_1: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_1_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_1: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_1_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_1_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_1: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_1_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGW_1: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_1_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_1_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGW_1: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_1_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_1: port_en Position */ -#define UMCTL2_PCTRL_1_port_en_Msk (0x1ul << UMCTL2_PCTRL_1_port_en_Pos) /*!< UMCTL2_T::PCTRL_1: port_en Mask */ - -#define UMCTL2_PCFGQOS0_1_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_1: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_1_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_1_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_1: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_1_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_1: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_1_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_1_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_1: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_1_rqos_map_region1_Pos (20) /*!< UMCTL2_T::PCFGQOS0_1: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_1_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_1_rqos_map_region1_Pos) /*!< UMCTL2_T::PCFGQOS0_1: rqos_map_region1 Mask */ - -#define UMCTL2_PCFGR_2_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_2: rd_port_priority Position */ -#define UMCTL2_PCFGR_2_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_2_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_2: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_2_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_2: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_2_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_2_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_2: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_2_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_2: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_2_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_2_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_2: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_2_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_2: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_2_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_2_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_2: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_2_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::2: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_2_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_2_rdwr_ordered_en_Pos) /*!< UMCTL2_T::2: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_2_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_2: wr_port_priority Position */ -#define UMCTL2_PCFGW_2_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_2_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_2: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_2_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_2: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_2_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_2_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_2: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_2_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_2: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_2_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_2_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_2: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_2_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGW_2: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_2_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_2_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGW_2: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_2_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_2: port_en Position */ -#define UMCTL2_PCTRL_2_port_en_Msk (0x1ul << UMCTL2_PCTRL_2_port_en_Pos) /*!< UMCTL2_T::PCTRL_2: port_en Mask */ - -#define UMCTL2_PCFGQOS0_2_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_2: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_2_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_2_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_2: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_2_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_2: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_2_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_2_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_2: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_2_rqos_map_region1_Pos (20) /*!< UMCTL2_T::PCFGQOS0_2: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_2_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_2_rqos_map_region1_Pos) /*!< UMCTL2_T::PCFGQOS0_2: rqos_map_region1 Mask */ - -#define UMCTL2_PCFGR_3_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_3: rd_port_priority Position */ -#define UMCTL2_PCFGR_3_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_3_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_3: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_3_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_3: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_3_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_3_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_3: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_3_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_3: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_3_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_3_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_3: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_3_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_3: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_3_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_3_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_3: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_3_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::PCFGR_3: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_3_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_3_rdwr_ordered_en_Pos) /*!< UMCTL2_T::PCFGR_3: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_3_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_3: wr_port_priority Position */ -#define UMCTL2_PCFGW_3_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_3_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_3: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_3_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_3: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_3_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_3_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_3: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_3_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_3: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_3_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_3_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_3: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_3_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::3: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_3_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_3_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::3: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_3_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_3: port_en Position */ -#define UMCTL2_PCTRL_3_port_en_Msk (0x1ul << UMCTL2_PCTRL_3_port_en_Pos) /*!< UMCTL2_T::PCTRL_3: port_en Mask */ - -#define UMCTL2_PCFGQOS0_3_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_3: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_3_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_3_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_3: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_3_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_3: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_3_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_3_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_3: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_3_rqos_map_region1_Pos (20) /*!< UMCTL2_T::PCFGQOS0_3: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_3_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_3_rqos_map_region1_Pos) /*!< UMCTL2_T::PCFGQOS0_3: rqos_map_region1 Mask */ - -#define UMCTL2_PCFGR_4_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_4: rd_port_priority Position */ -#define UMCTL2_PCFGR_4_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_4_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_4: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_4_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_4: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_4_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_4_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_4: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_4_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_4: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_4_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_4_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_4: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_4_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_4: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_4_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_4_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_4: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_4_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::PCFGR_4: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_4_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_4_rdwr_ordered_en_Pos) /*!< UMCTL2_T::PCFGR_4: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_4_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_4: wr_port_priority Position */ -#define UMCTL2_PCFGW_4_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_4_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_4: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_4_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_4: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_4_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_4_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_4: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_4_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_4: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_4_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_4_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_4: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_4_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGW_4: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_4_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_4_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGW_4: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_4_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_4: port_en Position */ -#define UMCTL2_PCTRL_4_port_en_Msk (0x1ul << UMCTL2_PCTRL_4_port_en_Pos) /*!< UMCTL2_T::PCTRL_4: port_en Mask */ - -#define UMCTL2_PCFGQOS0_4_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_4: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_4_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_4_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_4: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_4_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_4: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_4_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_4_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_4: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_4_rqos_map_region1_Pos (20) /*!< UMCTL2_T::PCFGQOS0_4: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_4_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_4_rqos_map_region1_Pos) /*!< UMCTL2_T::PCFGQOS0_4: rqos_map_region1 Mask */ - -#define UMCTL2_PCFGR_5_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_5: rd_port_priority Position */ -#define UMCTL2_PCFGR_5_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_5_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_5: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_5_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_5: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_5_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_5_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_5: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_5_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_5: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_5_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_5_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_5: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_5_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_5: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_5_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_5_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_5: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_5_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::5: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_5_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_5_rdwr_ordered_en_Pos) /*!< UMCTL2_T::5: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_5_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_5: wr_port_priority Position */ -#define UMCTL2_PCFGW_5_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_5_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_5: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_5_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_5: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_5_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_5_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_5: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_5_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_5: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_5_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_5_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_5: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_5_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGW_5: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_5_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_5_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGW_5: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_5_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_5: port_en Position */ -#define UMCTL2_PCTRL_5_port_en_Msk (0x1ul << UMCTL2_PCTRL_5_port_en_Pos) /*!< UMCTL2_T::PCTRL_5: port_en Mask */ - -#define UMCTL2_PCFGQOS0_5_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_5: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_5_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_5_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_5: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_5_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_5: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_5_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_5_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_5: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_5_rqos_map_region1_Pos (20) /*!< UMCTL2_T::PCFGQOS0_5: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_5_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_5_rqos_map_region1_Pos) /*!< UMCTL2_T::PCFGQOS0_5: rqos_map_region1 Mask */ - -#define UMCTL2_PCFGR_6_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_6: rd_port_priority Position */ -#define UMCTL2_PCFGR_6_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_6_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_6: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_6_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_6: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_6_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_6_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_6: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_6_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_6: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_6_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_6_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_6: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_6_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_6: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_6_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_6_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_6: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_6_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::PCFGR_6: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_6_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_6_rdwr_ordered_en_Pos) /*!< UMCTL2_T::PCFGR_6: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_6_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_6: wr_port_priority Position */ -#define UMCTL2_PCFGW_6_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_6_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_6: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_6_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_6: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_6_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_6_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_6: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_6_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_6: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_6_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_6_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_6: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_6_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGW_6: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_6_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_6_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGW_6: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_6_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_6: port_en Position */ -#define UMCTL2_PCTRL_6_port_en_Msk (0x1ul << UMCTL2_PCTRL_6_port_en_Pos) /*!< UMCTL2_T::PCTRL_6: port_en Mask */ - -#define UMCTL2_PCFGQOS0_6_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_6: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_6_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_6_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_6: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_6_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_6: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_6_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_6_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_6: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_6_rqos_map_region1_Pos (20) /*!< UMCTL2_T::PCFGQOS0_6: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_6_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_6_rqos_map_region1_Pos) /*!< UMCTL2_T::PCFGQOS0_6: rqos_map_region1 Mask */ - -#define UMCTL2_PCFGR_7_rd_port_priority_Pos (0) /*!< UMCTL2_T::PCFGR_7: rd_port_priority Position */ -#define UMCTL2_PCFGR_7_rd_port_priority_Msk (0x3fful << UMCTL2_PCFGR_7_rd_port_priority_Pos) /*!< UMCTL2_T::PCFGR_7: rd_port_priority Mask */ - -#define UMCTL2_PCFGR_7_rd_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGR_7: rd_port_aging_en Position */ -#define UMCTL2_PCFGR_7_rd_port_aging_en_Msk (0x1ul << UMCTL2_PCFGR_7_rd_port_aging_en_Pos) /*!< UMCTL2_T::PCFGR_7: rd_port_aging_en Mask */ - -#define UMCTL2_PCFGR_7_rd_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGR_7: rd_port_urgent_en Position*/ -#define UMCTL2_PCFGR_7_rd_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGR_7_rd_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGR_7: rd_port_urgent_en Mask */ - -#define UMCTL2_PCFGR_7_rd_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGR_7: rd_port_pagematch_en Position*/ -#define UMCTL2_PCFGR_7_rd_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGR_7_rd_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGR_7: rd_port_pagematch_en Mask */ - -#define UMCTL2_PCFGR_7_rdwr_ordered_en_Pos (16) /*!< UMCTL2_T::PCFGR_7: rdwr_ordered_en Position */ -#define UMCTL2_PCFGR_7_rdwr_ordered_en_Msk (0x1ul << UMCTL2_PCFGR_7_rdwr_ordered_en_Pos) /*!< UMCTL2_T::PCFGR_7: rdwr_ordered_en Mask */ - -#define UMCTL2_PCFGW_7_wr_port_priority_Pos (0) /*!< UMCTL2_T::PCFGW_7: wr_port_priority Position */ -#define UMCTL2_PCFGW_7_wr_port_priority_Msk (0x3fful << UMCTL2_PCFGW_7_wr_port_priority_Pos) /*!< UMCTL2_T::PCFGW_7: wr_port_priority Mask */ - -#define UMCTL2_PCFGW_7_wr_port_aging_en_Pos (12) /*!< UMCTL2_T::PCFGW_7: wr_port_aging_en Position */ -#define UMCTL2_PCFGW_7_wr_port_aging_en_Msk (0x1ul << UMCTL2_PCFGW_7_wr_port_aging_en_Pos) /*!< UMCTL2_T::PCFGW_7: wr_port_aging_en Mask */ - -#define UMCTL2_PCFGW_7_wr_port_urgent_en_Pos (13) /*!< UMCTL2_T::PCFGW_7: wr_port_urgent_en Position*/ -#define UMCTL2_PCFGW_7_wr_port_urgent_en_Msk (0x1ul << UMCTL2_PCFGW_7_wr_port_urgent_en_Pos) /*!< UMCTL2_T::PCFGW_7: wr_port_urgent_en Mask */ - -#define UMCTL2_PCFGW_7_wr_port_pagematch_en_Pos (14) /*!< UMCTL2_T::PCFGW_7: wr_port_pagematch_en Position*/ -#define UMCTL2_PCFGW_7_wr_port_pagematch_en_Msk (0x1ul << UMCTL2_PCFGW_7_wr_port_pagematch_en_Pos) /*!< UMCTL2_T::PCFGW_7: wr_port_pagematch_en Mask */ - -#define UMCTL2_PCTRL_7_port_en_Pos (0) /*!< UMCTL2_T::PCTRL_7: port_en Position */ -#define UMCTL2_PCTRL_7_port_en_Msk (0x1ul << UMCTL2_PCTRL_7_port_en_Pos) /*!< UMCTL2_T::PCTRL_7: port_en Mask */ - -#define UMCTL2_PCFGQOS0_7_rqos_map_level1_Pos (0) /*!< UMCTL2_T::PCFGQOS0_7: rqos_map_level1 Position */ -#define UMCTL2_PCFGQOS0_7_rqos_map_level1_Msk (0xful << UMCTL2_PCFGQOS0_7_rqos_map_level1_Pos) /*!< UMCTL2_T::PCFGQOS0_7: rqos_map_level1 Mask */ - -#define UMCTL2_PCFGQOS0_7_rqos_map_region0_Pos (16) /*!< UMCTL2_T::PCFGQOS0_7: rqos_map_region0 Position */ -#define UMCTL2_PCFGQOS0_7_rqos_map_region0_Msk (0x3ul << UMCTL2_PCFGQOS0_7_rqos_map_region0_Pos) /*!< UMCTL2_T::PCFGQOS0_7: rqos_map_region0 Mask */ - -#define UMCTL2_PCFGQOS0_7_rqos_map_region1_Pos (20) /*!< UMCTL2_T::PCFGQOS0_7: rqos_map_region1 Position */ -#define UMCTL2_PCFGQOS0_7_rqos_map_region1_Msk (0x3ul << UMCTL2_PCFGQOS0_7_rqos_map_region1_Pos) /*!< UMCTL2_T::PCFGQOS0_7: rqos_map_region1 Mask */ - -#define UMCTL2_SARBASE0_base_addr_Pos (0) /*!< UMCTL2_T::SARBASE0: base_addr Position */ -#define UMCTL2_SARBASE0_base_addr_Msk (0x3ul << UMCTL2_SARBASE0_base_addr_Pos) /*!< UMCTL2_T::SARBASE0: base_addr Mask */ - -#define UMCTL2_SARSIZE0_nblocks_Pos (0) /*!< UMCTL2_T::SARSIZE0: nblocks Position */ -#define UMCTL2_SARSIZE0_nblocks_Msk (0xfful << UMCTL2_SARSIZE0_nblocks_Pos) /*!< UMCTL2_T::SARSIZE0: nblocks Mask */ - -#define UMCTL2_VER_NUMBER_ver_number_Pos (0) /*!< UMCTL2_T::VER_NUMBER: ver_number Position*/ -#define UMCTL2_VER_NUMBER_ver_number_Msk (0xfffffffful << UMCTL2_VER_NUMBER_ver_number_Pos) /*!< UMCTL2_T::VER_NUMBER: ver_number Mask */ - -#define UMCTL2_VER_TYPE_ver_type_Pos (0) /*!< UMCTL2_T::VER_TYPE: ver_type Position */ -#define UMCTL2_VER_TYPE_ver_type_Msk (0xfffffffful << UMCTL2_VER_TYPE_ver_type_Pos) /*!< UMCTL2_T::VER_TYPE: ver_type Mask */ - -/**@}*/ /* UMCTL2_CONST */ -/**@}*/ /* end of UMCTL2 register group */ - - -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __UMCTL2_REG_H__ */ - - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/usbh_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/usbh_reg.h deleted file mode 100644 index 368cdc2fb17..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/usbh_reg.h +++ /dev/null @@ -1,796 +0,0 @@ -/**************************************************************************//** - * @file usbh_reg.h - * @brief USBH register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __USBH_REG_H__ -#define __USBH_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup USBH USB Host Controller(USBH) - Memory Mapped Structure for USBH Controller -@{ */ - -typedef struct -{ - - - /** - * @var USBH_T::HcRevision - * Offset: 0x00 Host Controller Revision Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REV |Revision Number - * | | |Indicates the Open HCI Specification revision number implemented by the Hardware - * | | |Host Controller supports 1.1 specification. - * | | |(X.Y = XYh). - * @var USBH_T::HcControl - * Offset: 0x04 Host Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CBSR |Control Bulk Service Ratio - * | | |This specifies the service ratio between Control and Bulk EDs - * | | |Before processing any of the non-periodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs - * | | |The internal count will be retained when crossing the frame boundary - * | | |In case of reset, HCD is responsible for restoring this value. - * | | |00 = Number of Control EDs over Bulk EDs served is 1:1. - * | | |01 = Number of Control EDs over Bulk EDs served is 2:1. - * | | |10 = Number of Control EDs over Bulk EDs served is 3:1. - * | | |11 = Number of Control EDs over Bulk EDs served is 4:1. - * |[2] |PLE |Periodic List Enable Bit - * | | |When set, this bit enables processing of the Periodic (interrupt and isochronous) list - * | | |The Host Controller checks this bit prior to attempting any periodic transfers in a frame. - * | | |0 = Processing of the Periodic (Interrupt and Isochronous) list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Periodic (Interrupt and Isochronous) list in the next frame Enabled. - * | | |Note: To enable the processing of the Isochronous list, user has to set both PLE and IE (HcControl[3]) high. - * |[3] |IE |Isochronous List Enable Bit - * | | |Both ISOEn and PLE (HcControl[2]) high enables Host Controller to process the Isochronous list - * | | |Either ISOEn or PLE (HcControl[2]) is low disables Host Controller to process the Isochronous list. - * | | |0 = Processing of the Isochronous list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Isochronous list in the next frame Enabled, if the PLE (HcControl[2]) is high, too. - * |[4] |CLE |Control List Enable Bit - * | | |0 = Processing of the Control list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Control list in the next frame Enabled. - * |[5] |BLE |Bulk List Enable Bit - * | | |0 = Processing of the Bulk list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Bulk list in the next frame Enabled. - * |[7:6] |HCFS |Host Controller Functional State - * | | |This field sets the Host Controller state - * | | |The Controller may force a state change from USBSUSPEND to USBRESUME after detecting resume signaling from a downstream port - * | | |States are: - * | | |00 = USBSUSPEND. - * | | |01 = USBOPERATIONAL. - * | | |10 = USBRESUME. - * | | |11 = USBRESET. - * @var USBH_T::HcCommandStatus - * Offset: 0x08 Host Controller Command Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HCR |Host Controller Reset - * | | |This bit is set to initiate the software reset of Host Controller - * | | |This bit is cleared by the Host Controller, upon completed of the reset operation. - * | | |This bit, when set, didn't reset the Root Hub and no subsequent reset signaling be asserted to its downstream ports. - * | | |0 = Host Controller is not in software reset state. - * | | |1 = Host Controller is in software reset state. - * |[1] |CLF |Control List Filled - * | | |Set high to indicate there is an active TD on the Control List - * | | |It may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Control List. - * | | |0 = No active TD found or Host Controller begins to process the head of the Control list. - * | | |1 = An active TD added or found on the Control list. - * |[2] |BLF |Bulk List Filled - * | | |Set high to indicate there is an active TD on the Bulk list - * | | |This bit may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Bulk list. - * | | |0 = No active TD found or Host Controller begins to process the head of the Bulk list. - * | | |1 = An active TD added or found on the Bulk list. - * |[17:16] |SOC |Schedule Overrun Count (Read Only) - * | | |These bits are incremented on each scheduling overrun error - * | | |It is initialized to 00b and wraps around at 11b - * | | |This will be incremented when a scheduling overrun is detected even if SO (HcInterruptStatus[0]) has already been set. - * @var USBH_T::HcInterruptStatus - * Offset: 0x0C Host Controller Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun - * | | |Set when the List Processor determines a Schedule Overrun has occurred. - * | | |0 = Schedule Overrun didn't occur. - * | | |1 = Schedule Overrun has occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WDH |Write Back Done Head - * | | |Set after the Host Controller has written HcDoneHead to HccaDoneHead - * | | |Further updates of the HccaDoneHead will not occur until this bit has been cleared. - * | | |0 = Host Controller didn't update HccaDoneHead. - * | | |1 = Host Controller has written HcDoneHead to HccaDoneHead. - * | | |Note: This bit is cleared by writing 1 to it. - * |[2] |SF |Start of Frame - * | | |Set when the Frame Management functional block signals a 'Start of Frame' event - * | | |Host Control generates a SOF token at the same time. - * | | |0 = Not the start of a frame. - * | | |1 = Indicate the start of a frame and Host Controller generates a SOF token. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |RD |Resume Detected - * | | |Set when Host Controller detects resume signaling on a downstream port. - * | | |0 = No resume signaling detected on a downstream port. - * | | |1 = Resume signaling detected on a downstream port. - * | | |Note: This bit is cleared by writing 1 to it. - * |[5] |FNO |Frame Number Overflow - * | | |This bit is set when bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |0 = The bit 15 of Frame Number didn't change. - * | | |1 = The bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |RHSC |Root Hub Status Change - * | | |This bit is set when the content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |0 = The content of HcRhStatus and the content of HcRhPortStatus register didn't change. - * | | |1 = The content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |Note: This bit is cleared by writing h'1f to HcRhPortStatus6[20:16]. - * @var USBH_T::HcInterruptEnable - * Offset: 0x10 Host Controller Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Enable Bit - * | | |This bit is a global interrupt enable - * | | |A write of '1' allows interrupts to be enabled via the specific enable bits listed above. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcInterruptDisable - * Offset: 0x14 Host Controller Interrupt Disable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Disable Bit - * | | |Global interrupt disable. Writing '1' to disable all interrupts. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcHCCA - * Offset: 0x18 Host Controller Communication Area Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:8] |HCCA |Host Controller Communication Area - * | | |Pointer to indicate base address of the Host Controller Communication Area (HCCA). - * @var USBH_T::HcPeriodCurrentED - * Offset: 0x1C Host Controller Period Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |PCED |Periodic Current ED - * | | |Pointer to indicate physical address of the current Isochronous or Interrupt Endpoint Descriptor. - * @var USBH_T::HcControlHeadED - * Offset: 0x20 Host Controller Control Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CHED |Control Head ED - * | | |Pointer to indicate physical address of the first Endpoint Descriptor of the Control list. - * @var USBH_T::HcControlCurrentED - * Offset: 0x24 Host Controller Control Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CCED |Control Current Head ED - * | | |Pointer to indicate the physical address of the current Endpoint Descriptor of the Control list. - * @var USBH_T::HcBulkHeadED - * Offset: 0x28 Host Controller Bulk Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BHED |Bulk Head ED - * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Bulk list. - * @var USBH_T::HcBulkCurrentED - * Offset: 0x2C Host Controller Bulk Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BCED |Bulk Current Head ED - * | | |Pointer to indicate the physical address of the current endpoint of the Bulk list. - * @var USBH_T::HcDoneHead - * Offset: 0x30 Host Controller Done Head Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |DH |Done Head - * | | |Pointer to indicate the physical address of the last completed Transfer Descriptor that was added to the Done queue. - * @var USBH_T::HcFmInterval - * Offset: 0x34 Host Controller Frame Interval Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Interval - * | | |This field specifies the length of a frame as (bit times - 1) - * | | |For 12,000 bit times in a frame, a value of 11,999 is stored here. - * |[29:16] |FSMPS |FS Largest Data Packet - * | | |This field specifies a value that is loaded into the Largest Data Packet Counter at the beginning of each frame. - * |[31] |FIT |Frame Interval Toggle - * | | |This bit is toggled by Host Controller Driver when it loads a new value into FI (HcFmInterval[13:0]). - * | | |0 = Host Controller Driver didn't load new value into FI (HcFmInterval[13:0]). - * | | |1 = Host Controller Driver loads a new value into FI (HcFmInterval[13:0]). - * @var USBH_T::HcFmRemaining - * Offset: 0x38 Host Controller Frame Remaining Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FR |Frame Remaining - * | | |When the Host Controller is in the USBOPERATIONAL state, this 14-bit field decrements each 12 MHz clock period - * | | |When the count reaches 0, (end of frame) the counter reloads with Frame Interval - * | | |In addition, the counter loads when the Host Controller transitions into USBOPERATIONAL. - * |[31] |FRT |Frame Remaining Toggle - * | | |This bit is loaded from the FIT (HcFmInterval[31]) whenever FR (HcFmRemaining[13:0]) reaches 0. - * @var USBH_T::HcFmNumber - * Offset: 0x3C Host Controller Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FN |Frame Number - * | | |This 16-bit incrementing counter field is incremented coincident with the re-load of FR (HcFmRemaining[13:0]) - * | | |The count rolls over from 'FFFFh' to '0h.' - * @var USBH_T::HcPeriodicStart - * Offset: 0x40 Host Controller Periodic Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PS |Periodic Start - * | | |This field contains a value used by the List Processor to determine where in a frame the Periodic List processing must begin. - * @var USBH_T::HcLSThreshold - * Offset: 0x44 Host Controller Low-speed Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |LST |Low-speed Threshold - * | | |This field contains a value which is compared to the FR (HcFmRemaining[13:0]) field prior to initiating a Low-speed transaction - * | | |The transaction is started only if FR (HcFmRemaining[13:0]) >= this field - * | | |The value is calculated by Host Controller Driver with the consideration of transmission and setup overhead. - * @var USBH_T::HcRhDescriptorA - * Offset: 0x48 Host Controller Root Hub Descriptor A Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |NDP |Number Downstream Ports - * | | |USB host control supports two downstream ports and only one port is available in this series of chip. - * | | |Note: NDP = 6 in this series of chip. - * |[8] |PSM |Power Switching Mode - * | | |This bit is used to specify how the power switching of the Root Hub ports is controlled. - * | | |0 = Global switching. - * | | |1 = Individual switching. - * |[11] |OCPM |Overcurrent Protection Mode - * | | |This bit describes how the overcurrent status for the Root Hub ports reported - * | | |This bit is only valid when NOCP (HcRhDescriptorA[12]) is cleared. - * | | |0 = Global overcurrent. - * | | |1 = Individual overcurrent. - * |[12] |NOCP |No overcurrent Protection - * | | |This bit describes how the overcurrent status for the Root Hub ports reported. - * | | |0 = Overcurrent status is reported. - * | | |1 = Overcurrent status is not reported. - * @var USBH_T::HcRhDescriptorB - * Offset: 0x4C Host Controller Root Hub Descriptor B Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |PPCM |Port Power Control Mask - * | | |Global power switching - * | | |This field is only valid if PowerSwitchingMode is set (individual port switching) - * | | |When set, the port only responds to individual port power switching commands (Set/Clear Port Power) - * | | |When cleared, the port only responds to global power switching commands (Set/Clear Global Power). - * | | |0 = Port power controlled by global power switching. - * | | |1 = Port power controlled by port power switching. - * | | |Note: PPCM[15:2] and PPCM[0] are reserved. - * @var USBH_T::HcRhStatus - * Offset: 0x50 Host Controller Root Hub Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPS |Clear Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to clear all ports' power. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear global power. - * |[1] |OCI |Overcurrent Indicator (Read Only) - * | | |This bit reflects the state of the overcurrent status pin - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) and OCPM (HcRhDescriptorA[11]) are cleared. - * | | |0 = No overcurrent condition. - * | | |1 = Overcurrent condition. - * |[15] |DRWE |Device Remote Wakeup Enable Bit - * | | |This bit controls if port's Connect Status Change as a remote wake-up event. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * | | |Read Operation: - * | | |0 = Connect Status Change as a remote wake-up event Disabled. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * |[16] |LPSC |Set Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to enable power to all ports. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set global power. - * |[17] |OCIC |Overcurrent Indicator Change - * | | |This bit is set by hardware when a change has occurred in OCI (HcRhStatus[1]). - * | | |Write 1 to clear this bit to zero. - * | | |0 = OCI (HcRhStatus[1]) didn't change. - * | | |1 = OCI (HcRhStatus[1]) change. - * |[31] |CRWE |Clear Remote Wake-up Enable Bit - * | | |This bit is use to clear DRWE (HcRhStatus[15]). - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear DRWE (HcRhStatus[15]). - * @var USBH_T::HcRhPortStatus - * Offset: 0x54 Host Controller Root Hub Port Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |Current Connect Status or Clear Port Enable - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port enable. - * | | |Read Operation: - * | | |0 = No device connected. - * | | |1 = Device connected. - * |[1] |PES |Port Enable Status or Set Port Enable - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port enable. - * | | |Read Operation: - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[2] |PSS |Port Suspend Status or Set Port Suspend - * | | |This bit indicates the port is suspended - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port suspend. - * | | |Read Operation: - * | | |0 = Port is not suspended. - * | | |1 = Port is selectively suspended. - * |[3] |POCI |Port overcurrent Indicator or Clear Port Suspend - * | | |This bit reflects the state of the overcurrent status pin dedicated to this port - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) is cleared and OCPM (HcRhDescriptorA[11]) is set. - * | | |This bit is also used to initiate the selective result sequence for the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port suspend. - * | | |Read Operation: - * | | |0 = No overcurrent condition. - * | | |1 = Overcurrent condition. - * |[4] |PRS |Port Reset Status or Set Port Reset - * | | |This bit reflects the reset state of the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port reset. - * | | |Read Operation - * | | |0 = Port reset signal is not active. - * | | |1 = Port reset signal is active. - * |[8] |PPS |Port Power Status or Set Port Power - * | | |This bit reflects the power state of the port regardless of the power switching mode. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Port Power Enabled. - * | | |Read Operation: - * | | |0 = Port power is Disabled. - * | | |1 = Port power is Enabled. - * |[9] |LSDA |Low Speed Device Attached or Clear Port Power - * | | |This bit defines the speed (and bus idle) of the attached device - * | | |It is only valid when CCS (HcRhPortStatus[0]) is set. - * | | |This bit is also used to clear port power. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear PPS (HcRhPortStatus[8]). - * | | |Read Operation: - * | | |0 = Full Speed device. - * | | |1 = Low-speed device. - * |[16] |CSC |Connect Status Change - * | | |This bit indicates connect or disconnect event has been detected (CCS (HcRhPortStatus[0]) changed). - * | | |Write 1 to clear this bit to zero. - * | | |0 = No connect/disconnect event (CCS (HcRhPortStatus[0]) didn't change). - * | | |1 = Hardware detection of connect/disconnect event (CCS (HcRhPortStatus[0]) changed). - * |[17] |PESC |Port Enable Status Change - * | | |This bit indicates that the port has been disabled (PES (HcRhPortStatus6[1]) cleared) due to a hardware event. - * | | |Write 1 to clear this bit to zero. - * | | |0 = PES (HcRhPortStatus[1]) didn't change. - * | | |1 = PES (HcRhPortStatus[1]) changed. - * |[18] |PSSC |Port Suspend Status Change - * | | |This bit indicates the completion of the selective resume sequence for the port. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port resume is not completed. - * | | |1 = Port resume completed. - * |[19] |OCIC |Port overcurrent Indicator Change - * | | |This bit is set when POCI (HcRhPortStatus[3]) changes. - * | | |Write 1 to clear this bit to zero. - * | | |0 = POCI (HcRhPortStatus[3]) didn't change. - * | | |1 = POCI (HcRhPortStatus[3]) changes. - * |[20] |PRSC |Port Reset Status Change - * | | |This bit indicates that the port reset signal has completed. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port reset is not complete. - * | | |1 = Port reset is complete. - * @var USBH_T::HcPhyControl - * Offset: 0x200 Host Controller PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABORT |AHB Bus ERROR Response - * | | |This bit indicates there is an ERROR response received in AHB bus. - * | | |0 = No ERROR response received. - * | | |1 = ERROR response received. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |OCAL |Overcurrent Active Low - * | | |This bit controls the polarity of overcurrent flag from external power IC. - * | | |0 = Overcurrent flag is high active. - * | | |1 = Overcurrent flag is low active. - * |[4] |PPCAL |Port Power Control Active Low - * | | |This bit controls the polarity of port power control to external power IC. - * | | |0 = Port power control is high active. - * | | |1 = Port power control is low active. - * |[16] |DPRT1 |Disable Port 1 - * | | |This bit controls if the connection between USB host controller and transceiver of port 1 is disabled - * | | |If the connection is disabled, the USB host controller will not recognize any event of USB bus. - * | | |Set this bit high, the transceiver of port 1 will also be forced into the standby mode no matter what USB host controller operation is. - * | | |0 = The connection between USB host controller and transceiver of port 1 Enabled. - * | | |1 = The connection between USB host controller and transceiver of port 1 Disabled and the transceiver of port 1 will also be forced into the standby mode. - */ - __I uint32_t HcRevision; /*!< [0x0000] Host Controller Revision Register */ - __IO uint32_t HcControl; /*!< [0x0004] Host Controller Control Register */ - __IO uint32_t HcCommandStatus; /*!< [0x0008] Host Controller Command Status Register */ - __IO uint32_t HcInterruptStatus; /*!< [0x000c] Host Controller Interrupt Status Register */ - __IO uint32_t HcInterruptEnable; /*!< [0x0010] Host Controller Interrupt Enable Register */ - __IO uint32_t HcInterruptDisable; /*!< [0x0014] Host Controller Interrupt Disable Register */ - __IO uint32_t HcHCCA; /*!< [0x0018] Host Controller Communication Area Register */ - __IO uint32_t HcPeriodCurrentED; /*!< [0x001c] Host Controller Period Current ED Register */ - __IO uint32_t HcControlHeadED; /*!< [0x0020] Host Controller Control Head ED Register */ - __IO uint32_t HcControlCurrentED; /*!< [0x0024] Host Controller Control Current ED Register */ - __IO uint32_t HcBulkHeadED; /*!< [0x0028] Host Controller Bulk Head ED Register */ - __IO uint32_t HcBulkCurrentED; /*!< [0x002c] Host Controller Bulk Current ED Register */ - __IO uint32_t HcDoneHead; /*!< [0x0030] Host Controller Done Head Register */ - __IO uint32_t HcFmInterval; /*!< [0x0034] Host Controller Frame Interval Register */ - __I uint32_t HcFmRemaining; /*!< [0x0038] Host Controller Frame Remaining Register */ - __I uint32_t HcFmNumber; /*!< [0x003c] Host Controller Frame Number Register */ - __IO uint32_t HcPeriodicStart; /*!< [0x0040] Host Controller Periodic Start Register */ - __IO uint32_t HcLSThreshold; /*!< [0x0044] Host Controller Low-speed Threshold Register */ - __IO uint32_t HcRhDescriptorA; /*!< [0x0048] Host Controller Root Hub Descriptor A Register */ - __IO uint32_t HcRhDescriptorB; /*!< [0x004c] Host Controller Root Hub Descriptor B Register */ - __IO uint32_t HcRhStatus; /*!< [0x0050] Host Controller Root Hub Status Register */ - __IO uint32_t HcRhPortStatus[1]; /*!< [0x0054] Host Controller Root Hub Port Status */ - __I uint32_t RESERVE0[106]; - __IO uint32_t HcPhyControl; /*!< [0x0200] Host Controller PHY Control Register */ - -} USBH_T; - -/** - @addtogroup USBH_CONST USBH Bit Field Definition - Constant Definitions for USBH Controller -@{ */ - -#define USBH_HcRevision_REV_Pos (0) /*!< USBH_T::HcRevision: REV Position */ -#define USBH_HcRevision_REV_Msk (0xfful << USBH_HcRevision_REV_Pos) /*!< USBH_T::HcRevision: REV Mask */ - -#define USBH_HcControl_CBSR_Pos (0) /*!< USBH_T::HcControl: CBSR Position */ -#define USBH_HcControl_CBSR_Msk (0x3ul << USBH_HcControl_CBSR_Pos) /*!< USBH_T::HcControl: CBSR Mask */ - -#define USBH_HcControl_PLE_Pos (2) /*!< USBH_T::HcControl: PLE Position */ -#define USBH_HcControl_PLE_Msk (0x1ul << USBH_HcControl_PLE_Pos) /*!< USBH_T::HcControl: PLE Mask */ - -#define USBH_HcControl_IE_Pos (3) /*!< USBH_T::HcControl: IE Position */ -#define USBH_HcControl_IE_Msk (0x1ul << USBH_HcControl_IE_Pos) /*!< USBH_T::HcControl: IE Mask */ - -#define USBH_HcControl_CLE_Pos (4) /*!< USBH_T::HcControl: CLE Position */ -#define USBH_HcControl_CLE_Msk (0x1ul << USBH_HcControl_CLE_Pos) /*!< USBH_T::HcControl: CLE Mask */ - -#define USBH_HcControl_BLE_Pos (5) /*!< USBH_T::HcControl: BLE Position */ -#define USBH_HcControl_BLE_Msk (0x1ul << USBH_HcControl_BLE_Pos) /*!< USBH_T::HcControl: BLE Mask */ - -#define USBH_HcControl_HCFS_Pos (6) /*!< USBH_T::HcControl: HCFS Position */ -#define USBH_HcControl_HCFS_Msk (0x3ul << USBH_HcControl_HCFS_Pos) /*!< USBH_T::HcControl: HCFS Mask */ - -#define USBH_HcCommandStatus_HCR_Pos (0) /*!< USBH_T::HcCommandStatus: HCR Position*/ -#define USBH_HcCommandStatus_HCR_Msk (0x1ul << USBH_HcCommandStatus_HCR_Pos) /*!< USBH_T::HcCommandStatus: HCR Mask */ - -#define USBH_HcCommandStatus_CLF_Pos (1) /*!< USBH_T::HcCommandStatus: CLF Position*/ -#define USBH_HcCommandStatus_CLF_Msk (0x1ul << USBH_HcCommandStatus_CLF_Pos) /*!< USBH_T::HcCommandStatus: CLF Mask */ - -#define USBH_HcCommandStatus_BLF_Pos (2) /*!< USBH_T::HcCommandStatus: BLF Position*/ -#define USBH_HcCommandStatus_BLF_Msk (0x1ul << USBH_HcCommandStatus_BLF_Pos) /*!< USBH_T::HcCommandStatus: BLF Mask */ - -#define USBH_HcCommandStatus_SOC_Pos (16) /*!< USBH_T::HcCommandStatus: SOC Position*/ -#define USBH_HcCommandStatus_SOC_Msk (0x3ul << USBH_HcCommandStatus_SOC_Pos) /*!< USBH_T::HcCommandStatus: SOC Mask */ - -#define USBH_HcInterruptStatus_SO_Pos (0) /*!< USBH_T::HcInterruptStatus: SO Position*/ -#define USBH_HcInterruptStatus_SO_Msk (0x1ul << USBH_HcInterruptStatus_SO_Pos) /*!< USBH_T::HcInterruptStatus: SO Mask */ - -#define USBH_HcInterruptStatus_WDH_Pos (1) /*!< USBH_T::HcInterruptStatus: WDH Position*/ -#define USBH_HcInterruptStatus_WDH_Msk (0x1ul << USBH_HcInterruptStatus_WDH_Pos) /*!< USBH_T::HcInterruptStatus: WDH Mask */ - -#define USBH_HcInterruptStatus_SF_Pos (2) /*!< USBH_T::HcInterruptStatus: SF Position*/ -#define USBH_HcInterruptStatus_SF_Msk (0x1ul << USBH_HcInterruptStatus_SF_Pos) /*!< USBH_T::HcInterruptStatus: SF Mask */ - -#define USBH_HcInterruptStatus_RD_Pos (3) /*!< USBH_T::HcInterruptStatus: RD Position*/ -#define USBH_HcInterruptStatus_RD_Msk (0x1ul << USBH_HcInterruptStatus_RD_Pos) /*!< USBH_T::HcInterruptStatus: RD Mask */ - -#define USBH_HcInterruptStatus_FNO_Pos (5) /*!< USBH_T::HcInterruptStatus: FNO Position*/ -#define USBH_HcInterruptStatus_FNO_Msk (0x1ul << USBH_HcInterruptStatus_FNO_Pos) /*!< USBH_T::HcInterruptStatus: FNO Mask */ - -#define USBH_HcInterruptStatus_RHSC_Pos (6) /*!< USBH_T::HcInterruptStatus: RHSC Position*/ -#define USBH_HcInterruptStatus_RHSC_Msk (0x1ul << USBH_HcInterruptStatus_RHSC_Pos) /*!< USBH_T::HcInterruptStatus: RHSC Mask */ - -#define USBH_HcInterruptEnable_SO_Pos (0) /*!< USBH_T::HcInterruptEnable: SO Position*/ -#define USBH_HcInterruptEnable_SO_Msk (0x1ul << USBH_HcInterruptEnable_SO_Pos) /*!< USBH_T::HcInterruptEnable: SO Mask */ - -#define USBH_HcInterruptEnable_WDH_Pos (1) /*!< USBH_T::HcInterruptEnable: WDH Position*/ -#define USBH_HcInterruptEnable_WDH_Msk (0x1ul << USBH_HcInterruptEnable_WDH_Pos) /*!< USBH_T::HcInterruptEnable: WDH Mask */ - -#define USBH_HcInterruptEnable_SF_Pos (2) /*!< USBH_T::HcInterruptEnable: SF Position*/ -#define USBH_HcInterruptEnable_SF_Msk (0x1ul << USBH_HcInterruptEnable_SF_Pos) /*!< USBH_T::HcInterruptEnable: SF Mask */ - -#define USBH_HcInterruptEnable_RD_Pos (3) /*!< USBH_T::HcInterruptEnable: RD Position*/ -#define USBH_HcInterruptEnable_RD_Msk (0x1ul << USBH_HcInterruptEnable_RD_Pos) /*!< USBH_T::HcInterruptEnable: RD Mask */ - -#define USBH_HcInterruptEnable_FNO_Pos (5) /*!< USBH_T::HcInterruptEnable: FNO Position*/ -#define USBH_HcInterruptEnable_FNO_Msk (0x1ul << USBH_HcInterruptEnable_FNO_Pos) /*!< USBH_T::HcInterruptEnable: FNO Mask */ - -#define USBH_HcInterruptEnable_RHSC_Pos (6) /*!< USBH_T::HcInterruptEnable: RHSC Position*/ -#define USBH_HcInterruptEnable_RHSC_Msk (0x1ul << USBH_HcInterruptEnable_RHSC_Pos) /*!< USBH_T::HcInterruptEnable: RHSC Mask */ - -#define USBH_HcInterruptEnable_MIE_Pos (31) /*!< USBH_T::HcInterruptEnable: MIE Position*/ -#define USBH_HcInterruptEnable_MIE_Msk (0x1ul << USBH_HcInterruptEnable_MIE_Pos) /*!< USBH_T::HcInterruptEnable: MIE Mask */ - -#define USBH_HcInterruptDisable_SO_Pos (0) /*!< USBH_T::HcInterruptDisable: SO Position*/ -#define USBH_HcInterruptDisable_SO_Msk (0x1ul << USBH_HcInterruptDisable_SO_Pos) /*!< USBH_T::HcInterruptDisable: SO Mask */ - -#define USBH_HcInterruptDisable_WDH_Pos (1) /*!< USBH_T::HcInterruptDisable: WDH Position*/ -#define USBH_HcInterruptDisable_WDH_Msk (0x1ul << USBH_HcInterruptDisable_WDH_Pos) /*!< USBH_T::HcInterruptDisable: WDH Mask */ - -#define USBH_HcInterruptDisable_SF_Pos (2) /*!< USBH_T::HcInterruptDisable: SF Position*/ -#define USBH_HcInterruptDisable_SF_Msk (0x1ul << USBH_HcInterruptDisable_SF_Pos) /*!< USBH_T::HcInterruptDisable: SF Mask */ - -#define USBH_HcInterruptDisable_RD_Pos (3) /*!< USBH_T::HcInterruptDisable: RD Position*/ -#define USBH_HcInterruptDisable_RD_Msk (0x1ul << USBH_HcInterruptDisable_RD_Pos) /*!< USBH_T::HcInterruptDisable: RD Mask */ - -#define USBH_HcInterruptDisable_FNO_Pos (5) /*!< USBH_T::HcInterruptDisable: FNO Position*/ -#define USBH_HcInterruptDisable_FNO_Msk (0x1ul << USBH_HcInterruptDisable_FNO_Pos) /*!< USBH_T::HcInterruptDisable: FNO Mask */ - -#define USBH_HcInterruptDisable_RHSC_Pos (6) /*!< USBH_T::HcInterruptDisable: RHSC Position*/ -#define USBH_HcInterruptDisable_RHSC_Msk (0x1ul << USBH_HcInterruptDisable_RHSC_Pos) /*!< USBH_T::HcInterruptDisable: RHSC Mask*/ - -#define USBH_HcInterruptDisable_MIE_Pos (31) /*!< USBH_T::HcInterruptDisable: MIE Position*/ -#define USBH_HcInterruptDisable_MIE_Msk (0x1ul << USBH_HcInterruptDisable_MIE_Pos) /*!< USBH_T::HcInterruptDisable: MIE Mask */ - -#define USBH_HcHCCA_HCCA_Pos (8) /*!< USBH_T::HcHCCA: HCCA Position */ -#define USBH_HcHCCA_HCCA_Msk (0xfffffful << USBH_HcHCCA_HCCA_Pos) /*!< USBH_T::HcHCCA: HCCA Mask */ - -#define USBH_HcPeriodCurrentED_PCED_Pos (4) /*!< USBH_T::HcPeriodCurrentED: PCED Position*/ -#define USBH_HcPeriodCurrentED_PCED_Msk (0xffffffful << USBH_HcPeriodCurrentED_PCED_Pos) /*!< USBH_T::HcPeriodCurrentED: PCED Mask */ - -#define USBH_HcControlHeadED_CHED_Pos (4) /*!< USBH_T::HcControlHeadED: CHED Position*/ -#define USBH_HcControlHeadED_CHED_Msk (0xffffffful << USBH_HcControlHeadED_CHED_Pos) /*!< USBH_T::HcControlHeadED: CHED Mask */ - -#define USBH_HcControlCurrentED_CCED_Pos (4) /*!< USBH_T::HcControlCurrentED: CCED Position*/ -#define USBH_HcControlCurrentED_CCED_Msk (0xffffffful << USBH_HcControlCurrentED_CCED_Pos) /*!< USBH_T::HcControlCurrentED: CCED Mask*/ - -#define USBH_HcBulkHeadED_BHED_Pos (4) /*!< USBH_T::HcBulkHeadED: BHED Position */ -#define USBH_HcBulkHeadED_BHED_Msk (0xffffffful << USBH_HcBulkHeadED_BHED_Pos) /*!< USBH_T::HcBulkHeadED: BHED Mask */ - -#define USBH_HcBulkCurrentED_BCED_Pos (4) /*!< USBH_T::HcBulkCurrentED: BCED Position*/ -#define USBH_HcBulkCurrentED_BCED_Msk (0xffffffful << USBH_HcBulkCurrentED_BCED_Pos) /*!< USBH_T::HcBulkCurrentED: BCED Mask */ - -#define USBH_HcDoneHead_DH_Pos (4) /*!< USBH_T::HcDoneHead: DH Position */ -#define USBH_HcDoneHead_DH_Msk (0xffffffful << USBH_HcDoneHead_DH_Pos) /*!< USBH_T::HcDoneHead: DH Mask */ - -#define USBH_HcFmInterval_FI_Pos (0) /*!< USBH_T::HcFmInterval: FI Position */ -#define USBH_HcFmInterval_FI_Msk (0x3ffful << USBH_HcFmInterval_FI_Pos) /*!< USBH_T::HcFmInterval: FI Mask */ - -#define USBH_HcFmInterval_FSMPS_Pos (16) /*!< USBH_T::HcFmInterval: FSMPS Position */ -#define USBH_HcFmInterval_FSMPS_Msk (0x3ffful << USBH_HcFmInterval_FSMPS_Pos) /*!< USBH_T::HcFmInterval: FSMPS Mask */ - -#define USBH_HcFmInterval_FIT_Pos (31) /*!< USBH_T::HcFmInterval: FIT Position */ -#define USBH_HcFmInterval_FIT_Msk (0x1ul << USBH_HcFmInterval_FIT_Pos) /*!< USBH_T::HcFmInterval: FIT Mask */ - -#define USBH_HcFmRemaining_FR_Pos (0) /*!< USBH_T::HcFmRemaining: FR Position */ -#define USBH_HcFmRemaining_FR_Msk (0x3ffful << USBH_HcFmRemaining_FR_Pos) /*!< USBH_T::HcFmRemaining: FR Mask */ - -#define USBH_HcFmRemaining_FRT_Pos (31) /*!< USBH_T::HcFmRemaining: FRT Position */ -#define USBH_HcFmRemaining_FRT_Msk (0x1ul << USBH_HcFmRemaining_FRT_Pos) /*!< USBH_T::HcFmRemaining: FRT Mask */ - -#define USBH_HcFmNumber_FN_Pos (0) /*!< USBH_T::HcFmNumber: FN Position */ -#define USBH_HcFmNumber_FN_Msk (0xfffful << USBH_HcFmNumber_FN_Pos) /*!< USBH_T::HcFmNumber: FN Mask */ - -#define USBH_HcPeriodicStart_PS_Pos (0) /*!< USBH_T::HcPeriodicStart: PS Position */ -#define USBH_HcPeriodicStart_PS_Msk (0x3ffful << USBH_HcPeriodicStart_PS_Pos) /*!< USBH_T::HcPeriodicStart: PS Mask */ - -#define USBH_HcLSThreshold_LST_Pos (0) /*!< USBH_T::HcLSThreshold: LST Position */ -#define USBH_HcLSThreshold_LST_Msk (0xffful << USBH_HcLSThreshold_LST_Pos) /*!< USBH_T::HcLSThreshold: LST Mask */ - -#define USBH_HcRhDescriptorA_NDP_Pos (0) /*!< USBH_T::HcRhDescriptorA: NDP Position*/ -#define USBH_HcRhDescriptorA_NDP_Msk (0xfful << USBH_HcRhDescriptorA_NDP_Pos) /*!< USBH_T::HcRhDescriptorA: NDP Mask */ - -#define USBH_HcRhDescriptorA_PSM_Pos (8) /*!< USBH_T::HcRhDescriptorA: PSM Position*/ -#define USBH_HcRhDescriptorA_PSM_Msk (0x1ul << USBH_HcRhDescriptorA_PSM_Pos) /*!< USBH_T::HcRhDescriptorA: PSM Mask */ - -#define USBH_HcRhDescriptorA_OCPM_Pos (11) /*!< USBH_T::HcRhDescriptorA: OCPM Position*/ -#define USBH_HcRhDescriptorA_OCPM_Msk (0x1ul << USBH_HcRhDescriptorA_OCPM_Pos) /*!< USBH_T::HcRhDescriptorA: OCPM Mask */ - -#define USBH_HcRhDescriptorA_NOCP_Pos (12) /*!< USBH_T::HcRhDescriptorA: NOCP Position*/ -#define USBH_HcRhDescriptorA_NOCP_Msk (0x1ul << USBH_HcRhDescriptorA_NOCP_Pos) /*!< USBH_T::HcRhDescriptorA: NOCP Mask */ - -#define USBH_HcRhDescriptorB_PPCM_Pos (16) /*!< USBH_T::HcRhDescriptorB: PPCM Position*/ -#define USBH_HcRhDescriptorB_PPCM_Msk (0xfffful << USBH_HcRhDescriptorB_PPCM_Pos) /*!< USBH_T::HcRhDescriptorB: PPCM Mask */ - -#define USBH_HcRhStatus_LPS_Pos (0) /*!< USBH_T::HcRhStatus: LPS Position */ -#define USBH_HcRhStatus_LPS_Msk (0x1ul << USBH_HcRhStatus_LPS_Pos) /*!< USBH_T::HcRhStatus: LPS Mask */ - -#define USBH_HcRhStatus_OCI_Pos (1) /*!< USBH_T::HcRhStatus: OCI Position */ -#define USBH_HcRhStatus_OCI_Msk (0x1ul << USBH_HcRhStatus_OCI_Pos) /*!< USBH_T::HcRhStatus: OCI Mask */ - -#define USBH_HcRhStatus_DRWE_Pos (15) /*!< USBH_T::HcRhStatus: DRWE Position */ -#define USBH_HcRhStatus_DRWE_Msk (0x1ul << USBH_HcRhStatus_DRWE_Pos) /*!< USBH_T::HcRhStatus: DRWE Mask */ - -#define USBH_HcRhStatus_LPSC_Pos (16) /*!< USBH_T::HcRhStatus: LPSC Position */ -#define USBH_HcRhStatus_LPSC_Msk (0x1ul << USBH_HcRhStatus_LPSC_Pos) /*!< USBH_T::HcRhStatus: LPSC Mask */ - -#define USBH_HcRhStatus_OCIC_Pos (17) /*!< USBH_T::HcRhStatus: OCIC Position */ -#define USBH_HcRhStatus_OCIC_Msk (0x1ul << USBH_HcRhStatus_OCIC_Pos) /*!< USBH_T::HcRhStatus: OCIC Mask */ - -#define USBH_HcRhStatus_CRWE_Pos (31) /*!< USBH_T::HcRhStatus: CRWE Position */ -#define USBH_HcRhStatus_CRWE_Msk (0x1ul << USBH_HcRhStatus_CRWE_Pos) /*!< USBH_T::HcRhStatus: CRWE Mask */ - -#define USBH_HcRhPortStatus_CCS_Pos (0) /*!< USBH_T::HcRhPortStatus: CCS Position */ -#define USBH_HcRhPortStatus_CCS_Msk (0x1ul << USBH_HcRhPortStatus_CCS_Pos) /*!< USBH_T::HcRhPortStatus: CCS Mask */ - -#define USBH_HcRhPortStatus_PES_Pos (1) /*!< USBH_T::HcRhPortStatus: PES Position */ -#define USBH_HcRhPortStatus_PES_Msk (0x1ul << USBH_HcRhPortStatus_PES_Pos) /*!< USBH_T::HcRhPortStatus: PES Mask */ - -#define USBH_HcRhPortStatus_PSS_Pos (2) /*!< USBH_T::HcRhPortStatus: PSS Position */ -#define USBH_HcRhPortStatus_PSS_Msk (0x1ul << USBH_HcRhPortStatus_PSS_Pos) /*!< USBH_T::HcRhPortStatus: PSS Mask */ - -#define USBH_HcRhPortStatus_POCI_Pos (3) /*!< USBH_T::HcRhPortStatus: POCI Position*/ -#define USBH_HcRhPortStatus_POCI_Msk (0x1ul << USBH_HcRhPortStatus_POCI_Pos) /*!< USBH_T::HcRhPortStatus: POCI Mask */ - -#define USBH_HcRhPortStatus_PRS_Pos (4) /*!< USBH_T::HcRhPortStatus: PRS Position */ -#define USBH_HcRhPortStatus_PRS_Msk (0x1ul << USBH_HcRhPortStatus_PRS_Pos) /*!< USBH_T::HcRhPortStatus: PRS Mask */ - -#define USBH_HcRhPortStatus_PPS_Pos (8) /*!< USBH_T::HcRhPortStatus: PPS Position */ -#define USBH_HcRhPortStatus_PPS_Msk (0x1ul << USBH_HcRhPortStatus_PPS_Pos) /*!< USBH_T::HcRhPortStatus: PPS Mask */ - -#define USBH_HcRhPortStatus_LSDA_Pos (9) /*!< USBH_T::HcRhPortStatus: LSDA Position*/ -#define USBH_HcRhPortStatus_LSDA_Msk (0x1ul << USBH_HcRhPortStatus_LSDA_Pos) /*!< USBH_T::HcRhPortStatus: LSDA Mask */ - -#define USBH_HcRhPortStatus_CSC_Pos (16) /*!< USBH_T::HcRhPortStatus: CSC Position */ -#define USBH_HcRhPortStatus_CSC_Msk (0x1ul << USBH_HcRhPortStatus_CSC_Pos) /*!< USBH_T::HcRhPortStatus: CSC Mask */ - -#define USBH_HcRhPortStatus_PESC_Pos (17) /*!< USBH_T::HcRhPortStatus: PESC Position*/ -#define USBH_HcRhPortStatus_PESC_Msk (0x1ul << USBH_HcRhPortStatus_PESC_Pos) /*!< USBH_T::HcRhPortStatus: PESC Mask */ - -#define USBH_HcRhPortStatus_PSSC_Pos (18) /*!< USBH_T::HcRhPortStatus: PSSC Position*/ -#define USBH_HcRhPortStatus_PSSC_Msk (0x1ul << USBH_HcRhPortStatus_PSSC_Pos) /*!< USBH_T::HcRhPortStatus: PSSC Mask */ - -#define USBH_HcRhPortStatus_OCIC_Pos (19) /*!< USBH_T::HcRhPortStatus: OCIC Position*/ -#define USBH_HcRhPortStatus_OCIC_Msk (0x1ul << USBH_HcRhPortStatus_OCIC_Pos) /*!< USBH_T::HcRhPortStatus: OCIC Mask */ - -#define USBH_HcRhPortStatus_PRSC_Pos (20) /*!< USBH_T::HcRhPortStatus: PRSC Position*/ -#define USBH_HcRhPortStatus_PRSC_Msk (0x1ul << USBH_HcRhPortStatus_PRSC_Pos) /*!< USBH_T::HcRhPortStatus: PRSC Mask */ - -#define USBH_HcPhyControl_ABORT_Pos (1) /*!< USBH_T::HcPhyControl: ABORT Position */ -#define USBH_HcPhyControl_ABORT_Msk (0x1ul << USBH_HcPhyControl_ABORT_Pos) /*!< USBH_T::HcPhyControl: ABORT Mask */ - -#define USBH_HcPhyControl_OCAL_Pos (3) /*!< USBH_T::HcPhyControl: OCAL Position */ -#define USBH_HcPhyControl_OCAL_Msk (0x1ul << USBH_HcPhyControl_OCAL_Pos) /*!< USBH_T::HcPhyControl: OCAL Mask */ - -#define USBH_HcPhyControl_PPCAL_Pos (4) /*!< USBH_T::HcPhyControl: PPCAL Position */ -#define USBH_HcPhyControl_PPCAL_Msk (0x1ul << USBH_HcPhyControl_PPCAL_Pos) /*!< USBH_T::HcPhyControl: PPCAL Mask */ - -#define USBH_HcPhyControl_DPRT1_Pos (16) /*!< USBH_T::HcPhyControl: DPRT1 Position */ -#define USBH_HcPhyControl_DPRT1_Msk (0x1ul << USBH_HcPhyControl_DPRT1_Pos) /*!< USBH_T::HcPhyControl: DPRT1 Mask */ - -/**@}*/ /* USBH_CONST */ -/**@}*/ /* end of USBH register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __USBH_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wdt_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wdt_reg.h deleted file mode 100644 index e621d5c7fe4..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wdt_reg.h +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************//** - * @file wdt_reg.h - * @brief WDT register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WDT_REG_H__ -#define __WDT_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup WDT Watch Dog Timer Controller(WDT) - Memory Mapped Structure for WDT Controller -@{ */ - -typedef struct -{ - - - /** - * @var WDT_T::CTL - * Offset: 0x00 WDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |RSTEN |WDT Time-out Reset Enable Bit (Write Protect) - * | | |Setting this bit will enable the WDT time-out reset function if the WDT up counter value has not been cleared after the specific WDT reset delay period expires. - * | | |0 = WDT time-out reset function Disabled. - * | | |1 = WDT time-out reset function Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[2] |RSTF |WDT Time-out Reset Flag - * | | |This bit indicates the system has been reset by WDT time-out reset or not. - * | | |0 = WDT time-out reset did not occur. - * | | |1 = WDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[3] |IF |WDT Time-out Interrupt Flag - * | | |This bit will be set to 1 while WDT up counter value reaches the selected WDT time-out interval. - * | | |0 = WDT time-out interrupt did not occur. - * | | |1 = WDT time-out interrupt occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * |[4] |WKEN |WDT Time-out Wake-up Function Control (Write Protect) - * | | |If this bit is set to 1, while WDT time-out interrupt flag IF (WDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (WDT_CTL[6]) is enabled, the WDT time-out interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event Disabled if WDT time-out interrupt signal generated. - * | | |1 = Wake-up trigger event Enabled if WDT time-out interrupt signal generated. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * | | |Note 2: Chip can be woken up by WDT time-out interrupt signal generated only if WDT clock source is selected to 32 kHz internal low speed RC oscillator (LIRC) or LXT. - * |[5] |WKF |WDT Time-out Wake-up Flag - * | | |This bit indicates the interrupt wake-up flag status of WDT - * | | |0 = WDT does not cause chip wake-up. - * | | |1 = Chip wake-up from Idle or Power-down mode if WDT time-out interrupt signal generated. - * | | |Note: This bit is cleared by writing 1 to it. - * |[6] |INTEN |WDT Time-out Interrupt Enable Bit (Write Protect) - * | | |If this bit is enabled, the WDT time-out interrupt signal is generated and inform to CPU. - * | | |0 = WDT time-out interrupt Disabled. - * | | |1 = WDT time-out interrupt Enabled. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[7] |WDTEN |WDT Enable Bit (Write Protect) - * | | |0 = WDT Disabled (This action will reset the internal up counter value). - * | | |1 = WDT Enabled. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * | | |Note 2: If CWDTEN[2:0] (combined by Config0[31] and Config0[4:3]) bits is not configured to 111, this bit is forced as 1 and user cannot change this bit to 0. - * |[11:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect) - * | | |These three bits select the time-out interval period for the WDT. - * | | |0000 = 24 * WDT_CLK. - * | | |0001 = 26 * WDT_CLK. - * | | |0010 = 28 * WDT_CLK. - * | | |0011 = 210 * WDT_CLK. - * | | |0100= 212 * WDT_CLK. - * | | |0101 = 214 * WDT_CLK. - * | | |0110 = 216 * WDT_CLK. - * | | |0111 = 218 * WDT_CLK. - * | | |1000 = 220 * WDT_CLK. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * |[30] |SYNC |WDT Enable Control SYNC Flag Indicator (Read Only) - * | | |If user executes enable/disable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is completed or not. - * | | |0 = Set WDTEN bit is completed. - * | | |1 = Set WDTEN bit is synchronizing and not become active yet. - * | | |Note: Performing enable or disable WDTEN bit needs 2 * WDT_CLK period to become active. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit (Write Protect) - * | | |0 = ICE debug mode acknowledgement affects WDT counting. - * | | |WDT up counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |WDT up counter will keep going no matter CPU is held by ICE or not. - * | | |Note: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register - * @var WDT_T::ALTCTL - * Offset: 0x04 WDT Alternative Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RSTDSEL |WDT Reset Delay Selection (Write Protect) - * | | |When WDT time-out happened, user has a time named WDT Reset Delay Period to clear WDT counter by programming 0x5AA5 to RSTCNT to prevent WDT time-out reset happened. - * | | |User can select a suitable setting of RSTDSEL for different WDT Reset Delay Period. - * | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK. - * | | |01 = WDT Reset Delay Period is 130 * WDT_CLK. - * | | |10 = WDT Reset Delay Period is 18 * WDT_CLK. - * | | |11 = WDT Reset Delay Period is 3 * WDT_CLK. - * | | |Note 1: This bit is write protected - * | | |Refer to the SYS_RLKTZS register or SYS_RLKTZNS register or SYS_RLKSUBM register. - * | | |Note 2: This register will be reset to 0 if WDT time-out reset happened. - * @var WDT_T::RSTCNT - * Offset: 0x08 WDT Reset Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RSTCNT |WDT Reset Counter Register - * | | |Writing 0x00005AA5 to this field will reset the internal 20-bit WDT up counter value to 0. - * | | |Note: Performing RSTCNT to reset counter needs 2 * WDT_CLK period to become active. - */ - __IO uint32_t CTL; /*!< [0x0000] WDT Control Register */ - __IO uint32_t ALTCTL; /*!< [0x0004] WDT Alternative Control Register */ - __O uint32_t RSTCNT; /*!< [0x0008] WDT Reset Counter Register */ - -} WDT_T; - -/** - @addtogroup WDT_CONST WDT Bit Field Definition - Constant Definitions for WDT Controller -@{ */ - -#define WDT_CTL_RSTEN_Pos (1) /*!< WDT_T::CTL: RSTEN Position */ -#define WDT_CTL_RSTEN_Msk (0x1ul << WDT_CTL_RSTEN_Pos) /*!< WDT_T::CTL: RSTEN Mask */ - -#define WDT_CTL_RSTF_Pos (2) /*!< WDT_T::CTL: RSTF Position */ -#define WDT_CTL_RSTF_Msk (0x1ul << WDT_CTL_RSTF_Pos) /*!< WDT_T::CTL: RSTF Mask */ - -#define WDT_CTL_IF_Pos (3) /*!< WDT_T::CTL: IF Position */ -#define WDT_CTL_IF_Msk (0x1ul << WDT_CTL_IF_Pos) /*!< WDT_T::CTL: IF Mask */ - -#define WDT_CTL_WKEN_Pos (4) /*!< WDT_T::CTL: WKEN Position */ -#define WDT_CTL_WKEN_Msk (0x1ul << WDT_CTL_WKEN_Pos) /*!< WDT_T::CTL: WKEN Mask */ - -#define WDT_CTL_WKF_Pos (5) /*!< WDT_T::CTL: WKF Position */ -#define WDT_CTL_WKF_Msk (0x1ul << WDT_CTL_WKF_Pos) /*!< WDT_T::CTL: WKF Mask */ - -#define WDT_CTL_INTEN_Pos (6) /*!< WDT_T::CTL: INTEN Position */ -#define WDT_CTL_INTEN_Msk (0x1ul << WDT_CTL_INTEN_Pos) /*!< WDT_T::CTL: INTEN Mask */ - -#define WDT_CTL_WDTEN_Pos (7) /*!< WDT_T::CTL: WDTEN Position */ -#define WDT_CTL_WDTEN_Msk (0x1ul << WDT_CTL_WDTEN_Pos) /*!< WDT_T::CTL: WDTEN Mask */ - -#define WDT_CTL_TOUTSEL_Pos (8) /*!< WDT_T::CTL: TOUTSEL Position */ -#define WDT_CTL_TOUTSEL_Msk (0xful << WDT_CTL_TOUTSEL_Pos) /*!< WDT_T::CTL: TOUTSEL Mask */ - -#define WDT_CTL_SYNC_Pos (30) /*!< WDT_T::CTL: SYNC Position */ -#define WDT_CTL_SYNC_Msk (0x1ul << WDT_CTL_SYNC_Pos) /*!< WDT_T::CTL: SYNC Mask */ - -#define WDT_CTL_ICEDEBUG_Pos (31) /*!< WDT_T::CTL: ICEDEBUG Position */ -#define WDT_CTL_ICEDEBUG_Msk (0x1ul << WDT_CTL_ICEDEBUG_Pos) /*!< WDT_T::CTL: ICEDEBUG Mask */ - -#define WDT_ALTCTL_RSTDSEL_Pos (0) /*!< WDT_T::ALTCTL: RSTDSEL Position */ -#define WDT_ALTCTL_RSTDSEL_Msk (0x3ul << WDT_ALTCTL_RSTDSEL_Pos) /*!< WDT_T::ALTCTL: RSTDSEL Mask */ - -#define WDT_RSTCNT_RSTCNT_Pos (0) /*!< WDT_T::RSTCNT: RSTCNT Position */ -#define WDT_RSTCNT_RSTCNT_Msk (0xfffffffful << WDT_RSTCNT_RSTCNT_Pos) /*!< WDT_T::RSTCNT: RSTCNT Mask */ - -/**@}*/ /* WDT_CONST */ -/**@}*/ /* end of WDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __WDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/whc_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/whc_reg.h deleted file mode 100644 index 8a3cdf5131c..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/whc_reg.h +++ /dev/null @@ -1,1034 +0,0 @@ -/**************************************************************************//** - * @file whc_reg.h - * @brief Wormhole controller register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020~2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WHC_REG_H__ -#define __WHC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ -/** - @addtogroup WHC Wormhole Controller (WHC) - Memory Mapped Structure for WHC Controller -@{ */ - -typedef struct -{ - - - /** - * @var WHC_T::WKCTL - * Offset: 0x00 WHC Wakeup Event Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RST0WKEN |Counterpart First Core Reset Interrupt Wake-up Enable Bit - * | | |Counterpart reset event interrupt wake-up trigger event enable. - * | | |0 = Counterpart reset event interrupt wake-up trigger event Disabled. - * | | |1 = Counterpart reset event interrupt wake-up trigger event Enabled. - * |[1] |POFF0WKEN |Counterpart First Core Power Off State Interrupt Wake-up Enable Bit - * | | |Counterpart power off interrupt wake-up trigger event enable. - * | | |0 = Counterpart power off interrupt wake-up trigger event Disabled. - * | | |1 = Counterpart power off interrupt wake-up trigger event Enabled. - * |[2] |PD0WKEN |Counterpart First Core Power Down State Interrupt Wake-up Enable Bit - * | | |Counterpart power down interrupt wake-up trigger event enable. - * | | |0 = Counterpart power down interrupt wake-up trigger event Disabled. - * | | |1 = Counterpart power down interrupt wake-up trigger event Enabled. - * |[3] |RST1WKEN |A35 Second Core Reset Interrupt Wake-up Enable Bit - * | | |Counterpart reset event interrupt wake-up trigger event enable. - * | | |0 = Counterpart reset event interrupt wake-up trigger event Disabled. - * | | |1 = Counterpart reset event interrupt wake-up trigger event Enabled. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[4] |POFF1WKEN |A35 Second Core Power Off State Interrupt Wake-up Enable Bit - * | | |Counterpart power off interrupt wake-up trigger event enable. - * | | |0 = Counterpart power off interrupt wake-up trigger event Disabled. - * | | |1 = Counterpart power off interrupt wake-up trigger event Enabled. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[5] |PD1WKEN |A35 Second Core Power Down State Interrupt Wake-up Enable Bit - * | | |Counterpart power down interrupt wake-up trigger event enable. - * | | |0 = Counterpart power down interrupt wake-up trigger event Disabled. - * | | |1 = Counterpart power down interrupt wake-up trigger event Enabled. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[8] |GI0WKEN |General Interrupt 0 Wake-up Enable - * | | |If this bit is set to 1, while general interrupt flag is set to 1 and interrupt enable bit is enabled, the general interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event disabled if general interrupt 0 signal generated. - * | | |1 = Wake-up trigger event enabled if general interrupt 0 signal generated. - * |[9] |GI1WKEN |General Interrupt 1 Wake-up Enable - * | | |If this bit is set to 1, while general interrupt flag is set to 1 and interrupt enable bit is enabled, the general interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event disabled if general interrupt 1 signal generated. - * | | |1 = Wake-up trigger event enabled if general interrupt 1 signal generated. - * |[10] |GI2WKEN |General Interrupt 2 Wake-up Enable - * | | |If this bit is set to 1, while general interrupt flag is set to 1 and interrupt enable bit is enabled, the general interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event disabled if general interrupt 2 signal generated. - * | | |1 = Wake-up trigger event enabled if general interrupt 2 signal generated. - * |[11] |GI3WKEN |General Interrupt 3 Wake-up Enable - * | | |If this bit is set to 1, while general interrupt flag is set to 1 and interrupt enable bit is enabled, the general interrupt signal will generate a wake-up trigger event to chip. - * | | |0 = Wake-up trigger event disabled if general interrupt 3 signal generated. - * | | |1 = Wake-up trigger event enabled if general interrupt 3 signal generated. - * |[16] |TX0WKEN |TX Message Channel 0 Interrupt Wake-up Enable Bit - * | | |TX message channel 0 interrupt wake-up trigger event enable. - * | | |0 = Channel 0 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 0 interrupt wake-up trigger event Enabled. - * |[17] |TX1WKEN |TX Message Channel 1 Interrupt Wake-up Enable Bit - * | | |TX message channel 1 interrupt wake-up trigger event enable. - * | | |0 = Channel 1 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 1 interrupt wake-up trigger event Enabled. - * |[18] |TX2WKEN |TX Message Channel 2 Interrupt Wake-up Enable Bit - * | | |TX message channel 2 interrupt wake-up trigger event enable. - * | | |0 = Channel 2 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 2 interrupt wake-up trigger event Enabled. - * |[19] |TX3WKEN |TX Message Channel 3 Interrupt Wake-up Enable Bit - * | | |TX message channel 3 interrupt wake-up trigger event enable. - * | | |0 = Channel 3 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 3 interrupt wake-up trigger event Enabled. - * |[24] |RX0WKEN |RX Message Channel 0 Interrupt Wake-up Enable Bit - * | | |RX message channel 0 interrupt wake-up trigger event enable. - * | | |0 = Channel 0 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 0 interrupt wake-up trigger event Enabled. - * |[25] |RX1WKEN |RX Message Channel 1 Interrupt Wake-up Enable Bit - * | | |RX message channel 1 interrupt wake-up trigger event enable. - * | | |0 = Channel 1 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 1 interrupt wake-up trigger event Enabled. - * |[26] |RX2WKEN |RX Message Channel 2 Interrupt Wake-up Enable Bit - * | | |RX message Channel 2 interrupt wake-up trigger event enable. - * | | |0 = Channel 2 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 2 interrupt wake-up trigger event Enabled. - * |[27] |RX3WKEN |RX Message Channel 3 Interrupt Wake-up Enable Bit - * | | |RX message channel 3 interrupt wake-up trigger event enable. - * | | |0 = Channel 3 interrupt wake-up trigger event Disabled. - * | | |1 = Channel 3 interrupt wake-up trigger event Enabled. - * @var WHC_T::INTEN - * Offset: 0x04 WHC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RST0IEN |Counterpart First Core Reset Event Interrupt Enable Bit - * | | |Counterpart reset event interrupt enable. - * | | |0 = Counterpart status change interrupt Disabled. - * | | |1 = Counterpart status change interrupt Enabled. - * |[1] |POFF0IEN |Counterpart First Core Enter/Exit Power Off Mode Interrupt Enable Bit - * | | |Counterpart Enter/Exit Power Off Mode Interrupt Enable - * | | |0 = Counterpart power Off status change interrupt Disabled. - * | | |1 = Counterpart power Off status change interrupt Enabled. - * |[2] |PD0IEN |Counterpart First Core Enter/Exit Power-down mode Interrupt Enable Bit - * | | |Counterpart Enter/Exit Power-down mode Interrupt Enable - * | | |0 = Counterpart power down status change interrupt Disabled. - * | | |1 = Counterpart power down status change interrupt Enabled. - * |[3] |RST1IEN |A35 Second Core Reset Event Interrupt Enable Bit - * | | |Counterpart reset event interrupt enable. - * | | |0 = Counterpart status change interrupt Disabled. - * | | |1 = Counterpart status change interrupt Enabled. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[4] |POFF1IEN |A35 Second Core Enter/Exit Power Off Mode Interrupt Enable Bit - * | | |Counterpart Enter/Exit Power Off Mode Interrupt Enable - * | | |0 = Counterpart power Off status change interrupt Disabled. - * | | |1 = Counterpart power Off status change interrupt Enabled. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[5] |PD1IEN |A35 Second Core Enter/Exit Power-down mode Interrupt Enable Bit - * | | |Counterpart Enter/Exit Power-down mode Interrupt Enable - * | | |0 = Counterpart power down status change interrupt Disabled. - * | | |1 = Counterpart power down status change interrupt Enabled. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[8] |GI0IEN |General Interrupt 0 Enable Bit - * | | |General interrupt 0 interrupt enable. - * | | |0 = General interrupt 0 interrupt Disabled. - * | | |1 = General interrupt 0 interrupt Enabled. - * |[9] |GI1IEN |General Interrupt 1 Enable Bit - * | | |General interrupt 1 interrupt enable. - * | | |0 = General interrupt 1 interrupt Disabled. - * | | |1 = General interrupt 1 interrupt Enabled. - * |[10] |GI2IEN |General Interrupt 2 Enable Bit - * | | |General interrupt 2 interrupt enable. - * | | |0 = General interrupt 2 interrupt Disabled. - * | | |1 = General interrupt 2 interrupt Enabled. - * |[11] |GI3IEN |General Interrupt 3 Enable Bit - * | | |General interrupt 3 interrupt enable. - * | | |0 = General interrupt 3 interrupt Disabled. - * | | |1 = General interrupt 3 interrupt Enabled. - * |[16] |TX0IEN |TX Message Channel 0 Interrupt Enable Bit - * | | |TX message channel 0 ACK interrupt enable - * | | |0 = Channel 0 ACK interrupt Disabled. - * | | |1 = Channel 0 ACK interrupt Enabled. - * |[17] |TX1IEN |TX Message Channel 1 Interrupt Enable Bit - * | | |TX message channel 1 ACK interrupt enable. - * | | |0 = Channel 1 ACK interrupt Disabled. - * | | |1 = Channel 1 ACK interrupt Enabled. - * |[18] |TX2IEN |TX Message Channel 2 Interrupt Enable Bit - * | | |TX message channel 2 ACK interrupt enable. - * | | |0 = Channel 2 ACK interrupt Disabled. - * | | |1 = Channel 2 ACK interrupt Enabled. - * |[19] |TX3IEN |TX Message Channel 3 Interrupt Enable Bit - * | | |TX message channel 3 ACK interrupt enable - * | | |0 = Channel 3 ACK interrupt Disabled. - * | | |1 = Channel 3 ACK interrupt Enabled. - * |[24] |RX0IEN |RX Message Channel 0 Interrupt Enable Bit - * | | |RX message channel 0 arrive or recall interrupt enable - * | | |0 = Channel 0 arrive or recall interrupt Disabled. - * | | |1 = Channel 0 arrive or recall interrupt Enabled. - * |[25] |RX1IEN |RX Message Channel 1 Interrupt Enable Bit - * | | |RX message channel 1 arrive or recall interrupt enable. - * | | |0 = Channel 1 arrive or recall interrupt Disabled. - * | | |1 = Channel 1 arrive or recall interrupt Enabled. - * |[26] |RX2IEN |RX Message Channel 2 Interrupt Enable Bit - * | | |RX message channel 2 arrive or recall interrupt enable. - * | | |0 = Channel 2 arrive or recall interrupt Disabled. - * | | |1 = Channel 2 arrive or recall interrupt Enabled. - * |[27] |RX3IEN |RX Message Channel 3 Interrupt Enable Bit - * | | |RX message channel 3 arrive or recall interrupt enable - * | | |0 = Channel 3 arrive or recall interrupt Disabled. - * | | |1 = Channel 3 arrive or recall interrupt Enabled. - * @var WHC_T::INTSTS - * Offset: 0x08 WHC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RST0IF |Counterpart First Core Reset Event Interrupt Flag - * | | |Counterpart reset event interrupt flag. - * | | |0 = No counterpart reset status change interrupt generated. - * | | |1 = Counterpart reset status change interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[1] |POFF0IF |Counterpart First Core Enter/Exit Power Off Mode Interrupt Flag - * | | |Counterpart Enter/Exit Power Off Mode Interrupt Flag - * | | |0 = No counterpart power off mode status change interrupt generated. - * | | |1 = Counterpart power off mode status change interrupt generated. - * | | |Note: Write 1 to clear this bit to 0.. - * |[2] |PD0IF |Counterpart First Core Enter/Exit Power-down mode Interrupt Flag - * | | |Counterpart Enter/Exit Power-down mode Interrupt Flag - * | | |0 = No counterpart Power-down mode status change interrupt generated. - * | | |1 = Counterpart Power-down mode status change interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[3] |RST1IF |A35 Second Core Reset Event Interrupt Flag - * | | |Counterpart reset event interrupt flag. - * | | |0 = No counterpart reset status change interrupt generated. - * | | |1 = Counterpart reset status change interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[4] |POFF1IF |A35 Second Core Enter/Exit Power Off Mode Interrupt Flag - * | | |Counterpart Enter/Exit Power Off Mode Interrupt Flag - * | | |0 = No counterpart power off mode status change interrupt generated. - * | | |1 = Counterpart power off mode status change interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[5] |PD1IF |A35 Second Core Enter/Exit Power-down mode Interrupt Flag - * | | |Counterpart Enter/Exit Power-down mode Interrupt Flag - * | | |0 = No counterpart Power-down mode status change interrupt generated. - * | | |1 = Counterpart Power-down mode status change interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * | | |Note: This bit which indicates the second A35 core is only available for M4 side. - * |[8] |GI0IF |General Event 0 Flag - * | | |General event 0 interrupt flag. - * | | |0 = No general event 0 interrupt generated. - * | | |1 = General event 0 interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[9] |GI1IF |General Event 1 Flag - * | | |General event 1 interrupt flag. - * | | |0 = No general event 1 interrupt generated. - * | | |1 = General event 1 interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[10] |GI2IF |General Event 2 Flag - * | | |General event 2 interrupt flag. - * | | |0 = No general event 2 interrupt generated. - * | | |1 = General event 2 interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[11] |GI3IF |General Event 3 Flag - * | | |General event 3 interrupt flag. - * | | |0 = No general event 3 interrupt generated. - * | | |1 = General event 3 interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[16] |TX0IF |TX Message Channel 0 Interrupt Flag - * | | |Tx message channel 0 ACK interrupt flag. - * | | |0 = No channel 0 ACK interrupt generated. - * | | |1 = Channel 0 ACK interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[17] |TX1IF |TX Message Channel 1 Interrupt Flag - * | | |Tx message channel 1 ACK interrupt flag. - * | | |0 = No channel 1 ACK interrupt generated. - * | | |1 = Channel 1 ACK interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[18] |TX2IF |TX Message Channel 2 Interrupt Flag - * | | |Tx message channel 2 ACK interrupt flag. - * | | |0 = No channel 2 ACK interrupt generated. - * | | |1 = Channel 2 ACK interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[19] |TX3IF |TX Message Channel 3 Interrupt Flag - * | | |Tx message channel 3 ACK interrupt flag. - * | | |0 = No channel 3 ACK interrupt generated. - * | | |1 = Channel 3 ACK interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[24] |RX0IF |RX Message Channel 0 Interrupt Flag - * | | |Short message channel 0 arrive or recall interrupt flag. - * | | |0 = No channel 0 arrive or recall interrupt generated. - * | | |1 = Channel 0 arrive or recall interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[25] |RX1IF |RX Message Channel 1 Interrupt Flag - * | | |Short message channel 1 arrive or recall interrupt flag. - * | | |0 = No channel 1 arrive or recall interrupt generated. - * | | |1 = Channel 1 arrive or recall interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[26] |RX2IF |RX Message Channel 2 Interrupt Flag - * | | |Short message channel 2 arrive or recall interrupt flag. - * | | |0 = No channel 2 arrive or recall interrupt generated. - * | | |1 = Channel 2 arrive or recall interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * |[27] |RX3IF |RX Message Channel 3 Interrupt Flag - * | | |RX message channel 3 arrive or recall interrupt flag. - * | | |0 = No channel 3 arrive or recall interrupt generated. - * | | |1 = Channel 3 arrive or recall interrupt generated. - * | | |Note: Write 1 to clear this bit to 0. - * @var WHC_T::CPSTS - * Offset: 0x40 WHC Counterpart Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2] |WDTRF |WDT Reset Flag - * | | |The WDT reset flag is set by the Reset Signal from the Watchdog Timer or Window Watchdog Timer to indicate the previous reset source. - * | | |0 = No reset from watchdog timer or window watchdog timer. - * | | |1 = The watchdog timer or window watchdog timer had issued the reset signal to reset the system. - * | | |Note 1: Read only, write 1 to clear this bit to 0. - * | | |Note 2: Watchdog Timer register RSTF(WDT_CTL[2]) bit is set if the system has been reset by WDT time-out reset - * | | |Window Watchdog Timer register WWDTRF(WWDT_STATUS[1]) bit is set if the system has been reset by WWDT time-out reset. - * |[5] |SYSRF |System Reset Flag - * | | |The system reset flag is set by the Reset Signal from the Cortex-M4 Core to indicate the previous reset source. - * | | |0 = No reset from Cortex-M4. - * | | |1 = The Cortex-M4 had issued the reset signal to reset the system by writing 1 to the bit SYSRESETREQ(AIRCR[2], Application Interrupt and Reset Control Register, address = 0xE000ED0C) in system control registers of Cortex-M4 core. - * | | |Note: Read only, write 1 to clear this bit to 0. - * |[7] |CPURF |CPU Reset Flag - * | | |The CPU reset flag is set by hardware if software writes CPURST (SYS_IPRST0[1]) 1 to reset Cortex-M4 Core and Flash Memory Controller (FMC). - * | | |0 = No reset from CPU. - * | | |1 = The Cortex-M4 Core and FMC are reset by software setting CPURST to 1. - * | | |Note: Read only, write 1 to clear this bit to 0. - * |[8] |CPULKRF |CPU Lockup Reset Flag - * | | |0 = No reset from CPU lockup happened. - * | | |1 = The Cortex-M4 lockup happened and chip is reset. - * | | |Note 1: Read only, write 1 to clear this bit to 0. - * | | |Note 2: When CPU lockup happened under ICE is connected, This flag will set to 1 but chip will not reset. - * |[27:24] |OPMODE0 |Operating Mode of Other Side Core 0, Representing A35/M4 Core 0 (Read Only) - * | | |This bit field indicates the operating mode of the core 0 of the other side. - * | | |0000 = Run mode. - * | | |0001 = Power off mode. - * | | |0010 = Power-down mode. - * | | |Others = Reserved. - * |[31:28] |OPMODE1 |Operating Mode of Other Side Core 1, Representing A35 Core 1 (Read Only) - * | | |This bit field indicates the operating mode of the core 1 of the other side. - * | | |0000 = Run mode. - * | | |0001 = Power off mode. - * | | |0010 = Power-down mode. - * | | |Others = Reserved. - * | | |Note 1: This field can only be accessed by M4 side. - * @var WHC_T::GINTTRG - * Offset: 0x80 WHC General Interrupt Trigger Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TRGGI0 |Trigger General Interrupt 0 - * | | |Write this bit 1 to trigger general interrupt 0. - * |[1] |TRGGI1 |Trigger General Interrupt 1 - * | | |Write this bit 1 to trigger general interrupt 1. - * |[2] |TRGGI2 |Trigger General Interrupt 2 - * | | |Write this bit 1 to trigger general interrupt 2. - * |[3] |TRGGI3 |Trigger General Interrupt 3 - * | | |Write this bit 1 to trigger general interrupt 3. - * @var WHC_T::TXCTL - * Offset: 0xC0 WHC TX Message Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0SND |Send Channel 0 Message - * | | |Write 1 to this bit to send TX channel 0 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 1 or not - * | | |Otherwise, the receiver may get unpredictable data. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * |[1] |CH1SND |Send Channel 1 Message - * | | |Write 1 to this bit to send TX channel 1 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 1 or not - * | | |Otherwise, the receiver may get unpredictable data. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * |[2] |CH2SND |Send Channel 2 Message - * | | |Write 1 to this bit to send TX channel 2 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 1 or not - * | | |Otherwise, the receiver may get unpredictable data. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * |[3] |CH3SND |Send Channel 3 Message - * | | |Write 1 to this bit to send TX channel 3 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 1 or not - * | | |Otherwise, the receiver may get unpredictable data. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * |[16] |CH0RC |Recall Channel 1 Message - * | | |Write 1 to this bit to recall TX channel 1 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 0 or not. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * |[17] |CH1RC |Recall Channel 1 Message - * | | |Write 1 to this bit to recall TX channel 1 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 0 or not. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * |[18] |CH2RC |Recall Channel 2 Message - * | | |Write 1 to this bit to recall TX channel 2 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 0 or not. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * |[19] |CH3RC |Recall Channel 3 Message - * | | |Write 1 to this bit to recall TX channel 3 message - * | | |Before write 1 to this bit, sender should check the corresponding CHxRDY bit in TXSTS is 0 or not. - * | | |Note: Write 0 to this bit has no effect - * | | |Write 1 to SND and RC bits of the same channel simultaneously will yield unpredictable result. - * @var WHC_T::TXSTS - * Offset: 0xC4 WHC TX Message Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0RDY |Channel 0 Message Ready - * | | |0 = No recall event. - * | | |1 = Message channel is available to send new data. - * | | |This bit automatically cleared to 0 after write 1 to CH0SND - * | | |Automatically set to 1 after recall complete or receiver notify message read. - * |[1] |CH1RDY |Channel 1 Message Ready - * | | |0 = No recall event. - * | | |1 = Message channel is available to send new data. - * | | |This bit automatically cleared to 0 after write 1 to CH1SND - * | | |Automatically set to 1 after recall complete or receiver notify message read. - * |[2] |CH2RDY |Channel 2 Message Ready - * | | |0 = No recall event. - * | | |1 = Message channel is available to send new data. - * | | |This bit automatically cleared to 0 after write 1 to CH2SND - * | | |Automatically set to 1 after recall complete or receiver notify message read. - * |[3] |CH3RDY |Channel 3 Message Ready - * | | |0 = No recall event. - * | | |1 = Message channel is available to send new data. - * | | |This bit automatically cleared to 0 after write 1 to CH3SND - * | | |Automatically set to 1 after recall complete or receiver notify message read. - * @var WHC_T::RXCTL - * Offset: 0xC8 WHC RX Message Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0ACK |RX Message Channel 0 ACK - * | | |Write 1 to notify sender that channel 0 message has been read. Write 0 to this bit has no effect. - * | | |Write 1 will clear CH0RDY. - * |[1] |CH1ACK |RX Message Channel 1 ACK - * | | |Write 1 to notify sender that channel 1 message has been read. Write 0 to this bit has no effect. - * | | |Write 1 will clear CH1RDY. - * |[2] |CH2ACK |RX Message Channel 2 ACK - * | | |Write 1 to notify sender that channel 2 message has been read. Write 0 to this bit has no effect. - * | | |Write 1 will clear CH2RDY. - * |[3] |CH3ACK |RX Message Channel 3 ACK - * | | |Write 1 to notify sender that channel 3 message has been read. Write 0 to this bit has no effect. - * | | |Write 1 will clear CH3RDY. - * @var WHC_T::RXSTS - * Offset: 0xCC WHC RX Message Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CH0RDY |RX Channel 0 Message Ready - * | | |0 = RX channel 0 message data is not ready. - * | | |1 = RX channel 0 message data is ready. - * | | |Note: This bit is automatically set to 1 after sender writes 1 to CH0SND - * | | |It is automatically cleared to 0 after recall complete or write 1 to CH0ACK. - * |[1] |CH1RDY |RX Channel 1 Message Ready - * | | |0 = RX channel 1 message data is not ready. - * | | |1 = RX channel 1 message data is ready. - * | | |Note: This bit is automatically set to 1 after sender writes 1 to CH1SND - * | | |It is automatically cleared to 0 after recall complete or write 1 to CH1ACK. - * |[2] |CH2RDY |RX Channel 2 Message Ready - * | | |0 = RX channel 2 message data is not ready. - * | | |1 = RX channel 2 message data is ready. - * | | |Note: This bit is automatically set to 1 after sender writes 1 to CH2SND - * | | |It is automatically cleared to 0 after recall complete or write 1 to CH2ACK. - * |[3] |CH3RDY |RX Channel 3 Message Ready - * | | |0 = RX channel 3 message data is not ready. - * | | |1 = RX channel 3 message data is ready. - * | | |Note: This bit is automatically set to 1 after sender writes 1 to CH3SND - * | | |It is automatically cleared to 0 after recall complete or write 1 to CH3ACK. - * @var WHC_T::TM0DAT0 - * Offset: 0x100 WHC TX Message Channel 0 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM0DAT1 - * Offset: 0x104 WHC TX Message Channel 0 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM0DAT2 - * Offset: 0x108 WHC TX Message Channel 0 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM0DAT3 - * Offset: 0x10C WHC TX Message Channel 0 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM1DAT0 - * Offset: 0x110 WHC TX Message Channel 1 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM1DAT1 - * Offset: 0x114 WHC TX Message Channel 1 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM1DAT2 - * Offset: 0x118 WHC TX Message Channel 1 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM1DAT3 - * Offset: 0x11C WHC TX Message Channel 1 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM2DAT0 - * Offset: 0x120 WHC TX Message Channel 2 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM2DAT1 - * Offset: 0x124 WHC TX Message Channel 2 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM2DAT2 - * Offset: 0x128 WHC TX Message Channel 2 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM2DAT3 - * Offset: 0x12C WHC TX Message Channel 2 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM3DAT0 - * Offset: 0x130 WHC TX Message Channel 3 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM3DAT1 - * Offset: 0x134 WHC TX Message Channel 3 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM3DAT2 - * Offset: 0x138 WHC TX Message Channel 3 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::TM3DAT3 - * Offset: 0x13C WHC TX Message Channel 3 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |TX Message Data - * | | |This field contains the TX message data field - * | | |Sender should only write these registers while ready bit in TXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM0DAT0 - * Offset: 0x200 WHC RX Message Channel 0 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM0DAT1 - * Offset: 0x204 WHC RX Message Channel 0 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM0DAT2 - * Offset: 0x208 WHC RX Message Channel 0 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM0DAT3 - * Offset: 0x20C WHC RX Message Channel 0 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM1DAT0 - * Offset: 0x210 WHC RX Message Channel 1 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM1DAT1 - * Offset: 0x214 WHC RX Message Channel 1 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM1DAT2 - * Offset: 0x218 WHC RX Message Channel 1 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM1DAT3 - * Offset: 0x21C WHC RX Message Channel 1 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM2DAT0 - * Offset: 0x220 WHC RX Message Channel 2 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM2DAT1 - * Offset: 0x224 WHC RX Message Channel 2 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM2DAT2 - * Offset: 0x228 WHC RX Message Channel 2 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM2DAT3 - * Offset: 0x22C WHC RX Message Channel 2 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM3DAT0 - * Offset: 0x230 WHC RX Message Channel 3 Data 0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM3DAT1 - * Offset: 0x234 WHC RX Message Channel 3 Data 1 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM3DAT2 - * Offset: 0x238 WHC RX Message Channel 3 Data 2 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - * @var WHC_T::RM3DAT3 - * Offset: 0x23C WHC RX Message Channel 3 Data 3 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATA |RX Message Data - * | | |This field contains the RX message data field - * | | |Receiver should only read these registers while ready bit in RXSTS register is 1 - * | | |Otherwise, the receiver can read unpredictable data. - */ - __IO uint32_t WKCTL; /*!< [0x0000] WHC Wakeup Event Control Register */ - __IO uint32_t INTEN; /*!< [0x0004] WHC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x0008] WHC Interrupt Status Register */ - __I uint32_t RESERVE0[13]; - __IO uint32_t CPSTS; /*!< [0x0040] WHC Counterpart Status Register */ - __I uint32_t RESERVE1[15]; - __O uint32_t GINTTRG; /*!< [0x0080] WHC General Interrupt Trigger Register */ - __I uint32_t RESERVE2[15]; - __O uint32_t TXCTL; /*!< [0x00c0] WHC TX Message Control Register */ - __I uint32_t TXSTS; /*!< [0x00c4] WHC TX Message Status Register */ - __O uint32_t RXCTL; /*!< [0x00c8] WHC RX Message Control Register */ - __I uint32_t RXSTS; /*!< [0x00cc] WHC RX Message Status Register */ - __I uint32_t RESERVE3[12]; - __O uint32_t TMDAT[4][4]; /*!< [0x0100~0x013C] WHC TX Message Data Register */ - __I uint32_t RESERVE4[48]; - __I uint32_t RMDAT[4][4]; /*!< [0x0200~0x023C] WHC RX Message Data Register */ -} WHC_T; - -/** - @addtogroup WHC_CONST WHC Bit Field Definition - Constant Definitions for WHC Controller -@{ */ - -#define WHC_WKCTL_RST0WKEN_Pos (0) /*!< WHC_T::WKCTL: RST0WKEN Position */ -#define WHC_WKCTL_RST0WKEN_Msk (0x1ul << WHC_WKCTL_RST0WKEN_Pos) /*!< WHC_T::WKCTL: RST0WKEN Mask */ - -#define WHC_WKCTL_POFF0WKEN_Pos (1) /*!< WHC_T::WKCTL: POFF0WKEN Position */ -#define WHC_WKCTL_POFF0WKEN_Msk (0x1ul << WHC_WKCTL_POFF0WKEN_Pos) /*!< WHC_T::WKCTL: POFF0WKEN Mask */ - -#define WHC_WKCTL_PD0WKEN_Pos (2) /*!< WHC_T::WKCTL: PD0WKEN Position */ -#define WHC_WKCTL_PD0WKEN_Msk (0x1ul << WHC_WKCTL_PD0WKEN_Pos) /*!< WHC_T::WKCTL: PD0WKEN Mask */ - -#define WHC_WKCTL_RST1WKEN_Pos (3) /*!< WHC_T::WKCTL: RST1WKEN Position */ -#define WHC_WKCTL_RST1WKEN_Msk (0x1ul << WHC_WKCTL_RST1WKEN_Pos) /*!< WHC_T::WKCTL: RST1WKEN Mask */ - -#define WHC_WKCTL_POFF1WKEN_Pos (4) /*!< WHC_T::WKCTL: POFF1WKEN Position */ -#define WHC_WKCTL_POFF1WKEN_Msk (0x1ul << WHC_WKCTL_POFF1WKEN_Pos) /*!< WHC_T::WKCTL: POFF1WKEN Mask */ - -#define WHC_WKCTL_PD1WKEN_Pos (5) /*!< WHC_T::WKCTL: PD1WKEN Position */ -#define WHC_WKCTL_PD1WKEN_Msk (0x1ul << WHC_WKCTL_PD1WKEN_Pos) /*!< WHC_T::WKCTL: PD1WKEN Mask */ - -#define WHC_WKCTL_GI0WKEN_Pos (8) /*!< WHC_T::WKCTL: GI0WKEN Position */ -#define WHC_WKCTL_GI0WKEN_Msk (0x1ul << WHC_WKCTL_GI0WKEN_Pos) /*!< WHC_T::WKCTL: GI0WKEN Mask */ - -#define WHC_WKCTL_GI1WKEN_Pos (9) /*!< WHC_T::WKCTL: GI1WKEN Position */ -#define WHC_WKCTL_GI1WKEN_Msk (0x1ul << WHC_WKCTL_GI1WKEN_Pos) /*!< WHC_T::WKCTL: GI1WKEN Mask */ - -#define WHC_WKCTL_GI2WKEN_Pos (10) /*!< WHC_T::WKCTL: GI2WKEN Position */ -#define WHC_WKCTL_GI2WKEN_Msk (0x1ul << WHC_WKCTL_GI2WKEN_Pos) /*!< WHC_T::WKCTL: GI2WKEN Mask */ - -#define WHC_WKCTL_GI3WKEN_Pos (11) /*!< WHC_T::WKCTL: GI3WKEN Position */ -#define WHC_WKCTL_GI3WKEN_Msk (0x1ul << WHC_WKCTL_GI3WKEN_Pos) /*!< WHC_T::WKCTL: GI3WKEN Mask */ - -#define WHC_WKCTL_TX0WKEN_Pos (16) /*!< WHC_T::WKCTL: TX0WKEN Position */ -#define WHC_WKCTL_TX0WKEN_Msk (0x1ul << WHC_WKCTL_TX0WKEN_Pos) /*!< WHC_T::WKCTL: TX0WKEN Mask */ - -#define WHC_WKCTL_TX1WKEN_Pos (17) /*!< WHC_T::WKCTL: TX1WKEN Position */ -#define WHC_WKCTL_TX1WKEN_Msk (0x1ul << WHC_WKCTL_TX1WKEN_Pos) /*!< WHC_T::WKCTL: TX1WKEN Mask */ - -#define WHC_WKCTL_TX2WKEN_Pos (18) /*!< WHC_T::WKCTL: TX2WKEN Position */ -#define WHC_WKCTL_TX2WKEN_Msk (0x1ul << WHC_WKCTL_TX2WKEN_Pos) /*!< WHC_T::WKCTL: TX2WKEN Mask */ - -#define WHC_WKCTL_TX3WKEN_Pos (19) /*!< WHC_T::WKCTL: TX3WKEN Position */ -#define WHC_WKCTL_TX3WKEN_Msk (0x1ul << WHC_WKCTL_TX3WKEN_Pos) /*!< WHC_T::WKCTL: TX3WKEN Mask */ - -#define WHC_WKCTL_RX0WKEN_Pos (24) /*!< WHC_T::WKCTL: RX0WKEN Position */ -#define WHC_WKCTL_RX0WKEN_Msk (0x1ul << WHC_WKCTL_RX0WKEN_Pos) /*!< WHC_T::WKCTL: RX0WKEN Mask */ - -#define WHC_WKCTL_RX1WKEN_Pos (25) /*!< WHC_T::WKCTL: RX1WKEN Position */ -#define WHC_WKCTL_RX1WKEN_Msk (0x1ul << WHC_WKCTL_RX1WKEN_Pos) /*!< WHC_T::WKCTL: RX1WKEN Mask */ - -#define WHC_WKCTL_RX2WKEN_Pos (26) /*!< WHC_T::WKCTL: RX2WKEN Position */ -#define WHC_WKCTL_RX2WKEN_Msk (0x1ul << WHC_WKCTL_RX2WKEN_Pos) /*!< WHC_T::WKCTL: RX2WKEN Mask */ - -#define WHC_WKCTL_RX3WKEN_Pos (27) /*!< WHC_T::WKCTL: RX3WKEN Position */ -#define WHC_WKCTL_RX3WKEN_Msk (0x1ul << WHC_WKCTL_RX3WKEN_Pos) /*!< WHC_T::WKCTL: RX3WKEN Mask */ - -#define WHC_INTEN_RST0IEN_Pos (0) /*!< WHC_T::INTEN: RST0IEN Position */ -#define WHC_INTEN_RST0IEN_Msk (0x1ul << WHC_INTEN_RST0IEN_Pos) /*!< WHC_T::INTEN: RST0IEN Mask */ - -#define WHC_INTEN_POFF0IEN_Pos (1) /*!< WHC_T::INTEN: POFF0IEN Position */ -#define WHC_INTEN_POFF0IEN_Msk (0x1ul << WHC_INTEN_POFF0IEN_Pos) /*!< WHC_T::INTEN: POFF0IEN Mask */ - -#define WHC_INTEN_PD0IEN_Pos (2) /*!< WHC_T::INTEN: PD0IEN Position */ -#define WHC_INTEN_PD0IEN_Msk (0x1ul << WHC_INTEN_PD0IEN_Pos) /*!< WHC_T::INTEN: PD0IEN Mask */ - -#define WHC_INTEN_RST1IEN_Pos (3) /*!< WHC_T::INTEN: RST1IEN Position */ -#define WHC_INTEN_RST1IEN_Msk (0x1ul << WHC_INTEN_RST1IEN_Pos) /*!< WHC_T::INTEN: RST1IEN Mask */ - -#define WHC_INTEN_POFF1IEN_Pos (4) /*!< WHC_T::INTEN: POFF1IEN Position */ -#define WHC_INTEN_POFF1IEN_Msk (0x1ul << WHC_INTEN_POFF1IEN_Pos) /*!< WHC_T::INTEN: POFF1IEN Mask */ - -#define WHC_INTEN_PD1IEN_Pos (5) /*!< WHC_T::INTEN: PD1IEN Position */ -#define WHC_INTEN_PD1IEN_Msk (0x1ul << WHC_INTEN_PD1IEN_Pos) /*!< WHC_T::INTEN: PD1IEN Mask */ - -#define WHC_INTEN_GI0IEN_Pos (8) /*!< WHC_T::INTEN: GI0IEN Position */ -#define WHC_INTEN_GI0IEN_Msk (0x1ul << WHC_INTEN_GI0IEN_Pos) /*!< WHC_T::INTEN: GI0IEN Mask */ - -#define WHC_INTEN_GI1IEN_Pos (9) /*!< WHC_T::INTEN: GI1IEN Position */ -#define WHC_INTEN_GI1IEN_Msk (0x1ul << WHC_INTEN_GI1IEN_Pos) /*!< WHC_T::INTEN: GI1IEN Mask */ - -#define WHC_INTEN_GI2IEN_Pos (10) /*!< WHC_T::INTEN: GI2IEN Position */ -#define WHC_INTEN_GI2IEN_Msk (0x1ul << WHC_INTEN_GI2IEN_Pos) /*!< WHC_T::INTEN: GI2IEN Mask */ - -#define WHC_INTEN_GI3IEN_Pos (11) /*!< WHC_T::INTEN: GI3IEN Position */ -#define WHC_INTEN_GI3IEN_Msk (0x1ul << WHC_INTEN_GI3IEN_Pos) /*!< WHC_T::INTEN: GI3IEN Mask */ - -#define WHC_INTEN_TX0IEN_Pos (16) /*!< WHC_T::INTEN: TX0IEN Position */ -#define WHC_INTEN_TX0IEN_Msk (0x1ul << WHC_INTEN_TX0IEN_Pos) /*!< WHC_T::INTEN: TX0IEN Mask */ - -#define WHC_INTEN_TX1IEN_Pos (17) /*!< WHC_T::INTEN: TX1IEN Position */ -#define WHC_INTEN_TX1IEN_Msk (0x1ul << WHC_INTEN_TX1IEN_Pos) /*!< WHC_T::INTEN: TX1IEN Mask */ - -#define WHC_INTEN_TX2IEN_Pos (18) /*!< WHC_T::INTEN: TX2IEN Position */ -#define WHC_INTEN_TX2IEN_Msk (0x1ul << WHC_INTEN_TX2IEN_Pos) /*!< WHC_T::INTEN: TX2IEN Mask */ - -#define WHC_INTEN_TX3IEN_Pos (19) /*!< WHC_T::INTEN: TX3IEN Position */ -#define WHC_INTEN_TX3IEN_Msk (0x1ul << WHC_INTEN_TX3IEN_Pos) /*!< WHC_T::INTEN: TX3IEN Mask */ - -#define WHC_INTEN_RX0IEN_Pos (24) /*!< WHC_T::INTEN: RX0IEN Position */ -#define WHC_INTEN_RX0IEN_Msk (0x1ul << WHC_INTEN_RX0IEN_Pos) /*!< WHC_T::INTEN: RX0IEN Mask */ - -#define WHC_INTEN_RX1IEN_Pos (25) /*!< WHC_T::INTEN: RX1IEN Position */ -#define WHC_INTEN_RX1IEN_Msk (0x1ul << WHC_INTEN_RX1IEN_Pos) /*!< WHC_T::INTEN: RX1IEN Mask */ - -#define WHC_INTEN_RX2IEN_Pos (26) /*!< WHC_T::INTEN: RX2IEN Position */ -#define WHC_INTEN_RX2IEN_Msk (0x1ul << WHC_INTEN_RX2IEN_Pos) /*!< WHC_T::INTEN: RX2IEN Mask */ - -#define WHC_INTEN_RX3IEN_Pos (27) /*!< WHC_T::INTEN: RX3IEN Position */ -#define WHC_INTEN_RX3IEN_Msk (0x1ul << WHC_INTEN_RX3IEN_Pos) /*!< WHC_T::INTEN: RX3IEN Mask */ - -#define WHC_INTSTS_RST0IF_Pos (0) /*!< WHC_T::INTSTS: RST0IF Position */ -#define WHC_INTSTS_RST0IF_Msk (0x1ul << WHC_INTSTS_RST0IF_Pos) /*!< WHC_T::INTSTS: RST0IF Mask */ - -#define WHC_INTSTS_POFF0IF_Pos (1) /*!< WHC_T::INTSTS: POFF0IF Position */ -#define WHC_INTSTS_POFF0IF_Msk (0x1ul << WHC_INTSTS_POFF0IF_Pos) /*!< WHC_T::INTSTS: POFF0IF Mask */ - -#define WHC_INTSTS_PD0IF_Pos (2) /*!< WHC_T::INTSTS: PD0IF Position */ -#define WHC_INTSTS_PD0IF_Msk (0x1ul << WHC_INTSTS_PD0IF_Pos) /*!< WHC_T::INTSTS: PD0IF Mask */ - -#define WHC_INTSTS_RST1IF_Pos (3) /*!< WHC_T::INTSTS: RST1IF Position */ -#define WHC_INTSTS_RST1IF_Msk (0x1ul << WHC_INTSTS_RST1IF_Pos) /*!< WHC_T::INTSTS: RST1IF Mask */ - -#define WHC_INTSTS_POFF1IF_Pos (4) /*!< WHC_T::INTSTS: POFF1IF Position */ -#define WHC_INTSTS_POFF1IF_Msk (0x1ul << WHC_INTSTS_POFF1IF_Pos) /*!< WHC_T::INTSTS: POFF1IF Mask */ - -#define WHC_INTSTS_PD1IF_Pos (5) /*!< WHC_T::INTSTS: PD1IF Position */ -#define WHC_INTSTS_PD1IF_Msk (0x1ul << WHC_INTSTS_PD1IF_Pos) /*!< WHC_T::INTSTS: PD1IF Mask */ - -#define WHC_INTSTS_GI0IF_Pos (8) /*!< WHC_T::INTSTS: GI0IF Position */ -#define WHC_INTSTS_GI0IF_Msk (0x1ul << WHC_INTSTS_GI0IF_Pos) /*!< WHC_T::INTSTS: GI0IF Mask */ - -#define WHC_INTSTS_GI1IF_Pos (9) /*!< WHC_T::INTSTS: GI1IF Position */ -#define WHC_INTSTS_GI1IF_Msk (0x1ul << WHC_INTSTS_GI1IF_Pos) /*!< WHC_T::INTSTS: GI1IF Mask */ - -#define WHC_INTSTS_GI2IF_Pos (10) /*!< WHC_T::INTSTS: GI2IF Position */ -#define WHC_INTSTS_GI2IF_Msk (0x1ul << WHC_INTSTS_GI2IF_Pos) /*!< WHC_T::INTSTS: GI2IF Mask */ - -#define WHC_INTSTS_GI3IF_Pos (11) /*!< WHC_T::INTSTS: GI3IF Position */ -#define WHC_INTSTS_GI3IF_Msk (0x1ul << WHC_INTSTS_GI3IF_Pos) /*!< WHC_T::INTSTS: GI3IF Mask */ - -#define WHC_INTSTS_TX0IF_Pos (16) /*!< WHC_T::INTSTS: TX0IF Position */ -#define WHC_INTSTS_TX0IF_Msk (0x1ul << WHC_INTSTS_TX0IF_Pos) /*!< WHC_T::INTSTS: TX0IF Mask */ - -#define WHC_INTSTS_TX1IF_Pos (17) /*!< WHC_T::INTSTS: TX1IF Position */ -#define WHC_INTSTS_TX1IF_Msk (0x1ul << WHC_INTSTS_TX1IF_Pos) /*!< WHC_T::INTSTS: TX1IF Mask */ - -#define WHC_INTSTS_TX2IF_Pos (18) /*!< WHC_T::INTSTS: TX2IF Position */ -#define WHC_INTSTS_TX2IF_Msk (0x1ul << WHC_INTSTS_TX2IF_Pos) /*!< WHC_T::INTSTS: TX2IF Mask */ - -#define WHC_INTSTS_TX3IF_Pos (19) /*!< WHC_T::INTSTS: TX3IF Position */ -#define WHC_INTSTS_TX3IF_Msk (0x1ul << WHC_INTSTS_TX3IF_Pos) /*!< WHC_T::INTSTS: TX3IF Mask */ - -#define WHC_INTSTS_RX0IF_Pos (24) /*!< WHC_T::INTSTS: RX0IF Position */ -#define WHC_INTSTS_RX0IF_Msk (0x1ul << WHC_INTSTS_RX0IF_Pos) /*!< WHC_T::INTSTS: RX0IF Mask */ - -#define WHC_INTSTS_RX1IF_Pos (25) /*!< WHC_T::INTSTS: RX1IF Position */ -#define WHC_INTSTS_RX1IF_Msk (0x1ul << WHC_INTSTS_RX1IF_Pos) /*!< WHC_T::INTSTS: RX1IF Mask */ - -#define WHC_INTSTS_RX2IF_Pos (26) /*!< WHC_T::INTSTS: RX2IF Position */ -#define WHC_INTSTS_RX2IF_Msk (0x1ul << WHC_INTSTS_RX2IF_Pos) /*!< WHC_T::INTSTS: RX2IF Mask */ - -#define WHC_INTSTS_RX3IF_Pos (27) /*!< WHC_T::INTSTS: RX3IF Position */ -#define WHC_INTSTS_RX3IF_Msk (0x1ul << WHC_INTSTS_RX3IF_Pos) /*!< WHC_T::INTSTS: RX3IF Mask */ - -#define WHC_CPSTS_WDTRF_Pos (2) /*!< WHC_T::CPSTS: WDTRF Position */ -#define WHC_CPSTS_WDTRF_Msk (0x1ul << WHC_CPSTS_WDTRF_Pos) /*!< WHC_T::CPSTS: WDTRF Mask */ - -#define WHC_CPSTS_SYSRF_Pos (5) /*!< WHC_T::CPSTS: SYSRF Position */ -#define WHC_CPSTS_SYSRF_Msk (0x1ul << WHC_CPSTS_SYSRF_Pos) /*!< WHC_T::CPSTS: SYSRF Mask */ - -#define WHC_CPSTS_CPURF_Pos (7) /*!< WHC_T::CPSTS: CPURF Position */ -#define WHC_CPSTS_CPURF_Msk (0x1ul << WHC_CPSTS_CPURF_Pos) /*!< WHC_T::CPSTS: CPURF Mask */ - -#define WHC_CPSTS_CPULKRF_Pos (8) /*!< WHC_T::CPSTS: CPULKRF Position */ -#define WHC_CPSTS_CPULKRF_Msk (0x1ul << WHC_CPSTS_CPULKRF_Pos) /*!< WHC_T::CPSTS: CPULKRF Mask */ - -#define WHC_CPSTS_OPMODE0_Pos (24) /*!< WHC_T::CPSTS: OPMODE0 Position */ -#define WHC_CPSTS_OPMODE0_Msk (0xful << WHC_CPSTS_OPMODE0_Pos) /*!< WHC_T::CPSTS: OPMODE0 Mask */ - -#define WHC_CPSTS_OPMODE1_Pos (28) /*!< WHC_T::CPSTS: OPMODE1 Position */ -#define WHC_CPSTS_OPMODE1_Msk (0xful << WHC_CPSTS_OPMODE1_Pos) /*!< WHC_T::CPSTS: OPMODE1 Mask */ - -#define WHC_GINTTRG_TRGGI0_Pos (0) /*!< WHC_T::GINTTRG: TRGGI0 Position */ -#define WHC_GINTTRG_TRGGI0_Msk (0x1ul << WHC_GINTTRG_TRGGI0_Pos) /*!< WHC_T::GINTTRG: TRGGI0 Mask */ - -#define WHC_GINTTRG_TRGGI1_Pos (1) /*!< WHC_T::GINTTRG: TRGGI1 Position */ -#define WHC_GINTTRG_TRGGI1_Msk (0x1ul << WHC_GINTTRG_TRGGI1_Pos) /*!< WHC_T::GINTTRG: TRGGI1 Mask */ - -#define WHC_GINTTRG_TRGGI2_Pos (2) /*!< WHC_T::GINTTRG: TRGGI2 Position */ -#define WHC_GINTTRG_TRGGI2_Msk (0x1ul << WHC_GINTTRG_TRGGI2_Pos) /*!< WHC_T::GINTTRG: TRGGI2 Mask */ - -#define WHC_GINTTRG_TRGGI3_Pos (3) /*!< WHC_T::GINTTRG: TRGGI3 Position */ -#define WHC_GINTTRG_TRGGI3_Msk (0x1ul << WHC_GINTTRG_TRGGI3_Pos) /*!< WHC_T::GINTTRG: TRGGI3 Mask */ - -#define WHC_TXCTL_CH0SND_Pos (0) /*!< WHC_T::TXCTL: CH0SND Position */ -#define WHC_TXCTL_CH0SND_Msk (0x1ul << WHC_TXCTL_CH0SND_Pos) /*!< WHC_T::TXCTL: CH0SND Mask */ - -#define WHC_TXCTL_CH1SND_Pos (1) /*!< WHC_T::TXCTL: CH1SND Position */ -#define WHC_TXCTL_CH1SND_Msk (0x1ul << WHC_TXCTL_CH1SND_Pos) /*!< WHC_T::TXCTL: CH1SND Mask */ - -#define WHC_TXCTL_CH2SND_Pos (2) /*!< WHC_T::TXCTL: CH2SND Position */ -#define WHC_TXCTL_CH2SND_Msk (0x1ul << WHC_TXCTL_CH2SND_Pos) /*!< WHC_T::TXCTL: CH2SND Mask */ - -#define WHC_TXCTL_CH3SND_Pos (3) /*!< WHC_T::TXCTL: CH3SND Position */ -#define WHC_TXCTL_CH3SND_Msk (0x1ul << WHC_TXCTL_CH3SND_Pos) /*!< WHC_T::TXCTL: CH3SND Mask */ - -#define WHC_TXCTL_CH0RC_Pos (16) /*!< WHC_T::TXCTL: CH0RC Position */ -#define WHC_TXCTL_CH0RC_Msk (0x1ul << WHC_TXCTL_CH0RC_Pos) /*!< WHC_T::TXCTL: CH0RC Mask */ - -#define WHC_TXCTL_CH1RC_Pos (17) /*!< WHC_T::TXCTL: CH1RC Position */ -#define WHC_TXCTL_CH1RC_Msk (0x1ul << WHC_TXCTL_CH1RC_Pos) /*!< WHC_T::TXCTL: CH1RC Mask */ - -#define WHC_TXCTL_CH2RC_Pos (18) /*!< WHC_T::TXCTL: CH2RC Position */ -#define WHC_TXCTL_CH2RC_Msk (0x1ul << WHC_TXCTL_CH2RC_Pos) /*!< WHC_T::TXCTL: CH2RC Mask */ - -#define WHC_TXCTL_CH3RC_Pos (19) /*!< WHC_T::TXCTL: CH3RC Position */ -#define WHC_TXCTL_CH3RC_Msk (0x1ul << WHC_TXCTL_CH3RC_Pos) /*!< WHC_T::TXCTL: CH3RC Mask */ - -#define WHC_TXSTS_CH0RDY_Pos (0) /*!< WHC_T::TXSTS: CH0RDY Position */ -#define WHC_TXSTS_CH0RDY_Msk (0x1ul << WHC_TXSTS_CH0RDY_Pos) /*!< WHC_T::TXSTS: CH0RDY Mask */ - -#define WHC_TXSTS_CH1RDY_Pos (1) /*!< WHC_T::TXSTS: CH1RDY Position */ -#define WHC_TXSTS_CH1RDY_Msk (0x1ul << WHC_TXSTS_CH1RDY_Pos) /*!< WHC_T::TXSTS: CH1RDY Mask */ - -#define WHC_TXSTS_CH2RDY_Pos (2) /*!< WHC_T::TXSTS: CH2RDY Position */ -#define WHC_TXSTS_CH2RDY_Msk (0x1ul << WHC_TXSTS_CH2RDY_Pos) /*!< WHC_T::TXSTS: CH2RDY Mask */ - -#define WHC_TXSTS_CH3RDY_Pos (3) /*!< WHC_T::TXSTS: CH3RDY Position */ -#define WHC_TXSTS_CH3RDY_Msk (0x1ul << WHC_TXSTS_CH3RDY_Pos) /*!< WHC_T::TXSTS: CH3RDY Mask */ - -#define WHC_RXCTL_CH0ACK_Pos (0) /*!< WHC_T::RXCTL: CH0ACK Position */ -#define WHC_RXCTL_CH0ACK_Msk (0x1ul << WHC_RXCTL_CH0ACK_Pos) /*!< WHC_T::RXCTL: CH0ACK Mask */ - -#define WHC_RXCTL_CH1ACK_Pos (1) /*!< WHC_T::RXCTL: CH1ACK Position */ -#define WHC_RXCTL_CH1ACK_Msk (0x1ul << WHC_RXCTL_CH1ACK_Pos) /*!< WHC_T::RXCTL: CH1ACK Mask */ - -#define WHC_RXCTL_CH2ACK_Pos (2) /*!< WHC_T::RXCTL: CH2ACK Position */ -#define WHC_RXCTL_CH2ACK_Msk (0x1ul << WHC_RXCTL_CH2ACK_Pos) /*!< WHC_T::RXCTL: CH2ACK Mask */ - -#define WHC_RXCTL_CH3ACK_Pos (3) /*!< WHC_T::RXCTL: CH3ACK Position */ -#define WHC_RXCTL_CH3ACK_Msk (0x1ul << WHC_RXCTL_CH3ACK_Pos) /*!< WHC_T::RXCTL: CH3ACK Mask */ - -#define WHC_RXSTS_CH0RDY_Pos (0) /*!< WHC_T::RXSTS: CH0RDY Position */ -#define WHC_RXSTS_CH0RDY_Msk (0x1ul << WHC_RXSTS_CH0RDY_Pos) /*!< WHC_T::RXSTS: CH0RDY Mask */ - -#define WHC_RXSTS_CH1RDY_Pos (1) /*!< WHC_T::RXSTS: CH1RDY Position */ -#define WHC_RXSTS_CH1RDY_Msk (0x1ul << WHC_RXSTS_CH1RDY_Pos) /*!< WHC_T::RXSTS: CH1RDY Mask */ - -#define WHC_RXSTS_CH2RDY_Pos (2) /*!< WHC_T::RXSTS: CH2RDY Position */ -#define WHC_RXSTS_CH2RDY_Msk (0x1ul << WHC_RXSTS_CH2RDY_Pos) /*!< WHC_T::RXSTS: CH2RDY Mask */ - -#define WHC_RXSTS_CH3RDY_Pos (3) /*!< WHC_T::RXSTS: CH3RDY Position */ -#define WHC_RXSTS_CH3RDY_Msk (0x1ul << WHC_RXSTS_CH3RDY_Pos) /*!< WHC_T::RXSTS: CH3RDY Mask */ - -#define WHC_TMDAT_DAT_Pos (0) /*!< WHC_T::TMDAT: DATA Position */ -#define WHC_TMDAT_DAT_Msk (0xfffffffful << WHC_TMDAT_DAT_Pos) /*!< WHC_T::TMDAT: DATA Mask */ - -#define WHC_RMDAT_DAT_Pos (0) /*!< WHC_T::RMDAT: DATA Position */ -#define WHC_RMDAT_DAT_Msk (0xfffffffful << WHC_RMDAT_DAT_Pos) /*!< WHC_T::RMDAT: DATA Mask */ - -/**@}*/ /* WHC_CONST */ -/**@}*/ /* end of WHC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __WHC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wwdt_reg.h b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wwdt_reg.h deleted file mode 100644 index d87c7e534e3..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Include/wwdt_reg.h +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************//** - * @file wwdt_reg.h - * @brief WWDT register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __WWDT_REG_H__ -#define __WWDT_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup WWDT Window Watchdog Timer(WWDT) - Memory Mapped Structure for WWDT Controller -@{ */ - -typedef struct -{ - - - /** - * @var WWDT_T::RLDCNT - * Offset: 0x00 WWDT Reload Counter Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RLDCNT |WWDT Reload Counter Register - * | | |Writing 0x00005AA5 to this register will reload the WWDT counter value to 0x3F. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT (WWDT_CTL[21:16]) - * | | |If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, WWDT reset signal will be generated. - * @var WWDT_T::CTL - * Offset: 0x04 WWDT Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTEN |WWDT Enable Bit - * | | |0 = WWDT counter is stopped. - * | | |1 = WWDT counter starts counting. - * |[1] |INTEN |WWDT Interrupt Enable Bit - * | | |If this bit is enabled, the WWDT counter compare match interrupt signal is generated and inform to CPU. - * | | |0 = WWDT counter compare match interrupt Disabled. - * | | |1 = WWDT counter compare match interrupt Enabled. - * |[11:8] |PSCSEL |WWDT Counter Prescale Period Selection - * | | |0000 = Pre-scale is 1; Max time-out period is 1 * 64 * WWDT_CLK. - * | | |0001 = Pre-scale is 2; Max time-out period is 2 * 64 * WWDT_CLK. - * | | |0010 = Pre-scale is 4; Max time-out period is 4 * 64 * WWDT_CLK. - * | | |0011 = Pre-scale is 8; Max time-out period is 8 * 64 * WWDT_CLK. - * | | |0100 = Pre-scale is 16; Max time-out period is 16 * 64 * WWDT_CLK. - * | | |0101 = Pre-scale is 32; Max time-out period is 32 * 64 * WWDT_CLK. - * | | |0110 = Pre-scale is 64; Max time-out period is 64 * 64 * WWDT_CLK. - * | | |0111 = Pre-scale is 128; Max time-out period is 128 * 64 * WWDT_CLK. - * | | |1000 = Pre-scale is 192; Max time-out period is 192 * 64 * WWDT_CLK. - * | | |1001 = Pre-scale is 256; Max time-out period is 256 * 64 * WWDT_CLK. - * | | |1010 = Pre-scale is 384; Max time-out period is 384 * 64 * WWDT_CLK. - * | | |1011 = Pre-scale is 512; Max time-out period is 512 * 64 * WWDT_CLK. - * | | |1100 = Pre-scale is 768; Max time-out period is 768 * 64 * WWDT_CLK. - * | | |1101 = Pre-scale is 1024; Max time-out period is 1024 * 64 * WWDT_CLK. - * | | |1110 = Pre-scale is 1536; Max time-out period is 1536 * 64 * WWDT_CLK. - * | | |1111 = Pre-scale is 2048; Max time-out period is 2048 * 64 * WWDT_CLK. - * |[21:16] |CMPDAT |WWDT Window Compare Register - * | | |Set this register to adjust the valid reload window. - * | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT - * | | |If user writes WWDT_RLDCNT register when current WWDT counter value larger than CMPDAT, WWDT reset signal will generate. - * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit - * | | |0 = ICE debug mode acknowledgement effects WWDT counting. - * | | |WWDT down counter will be held while CPU is held by ICE. - * | | |1 = ICE debug mode acknowledgement Disabled. - * | | |Note: WWDT down counter will keep going no matter CPU is held by ICE or not. - * @var WWDT_T::STATUS - * Offset: 0x08 WWDT Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |WWDTIF |WWDT Compare Match Interrupt Flag - * | | |This bit indicates the interrupt flag status of WWDT while WWDT counter value matches CMPDAT (WWDT_CTL[21:16]). - * | | |0 = No effect. - * | | |1 = WWDT counter value matches CMPDAT. - * | | |Note: This bit is cleared by writing 1 to it. - * |[1] |WWDTRF |WWDT Timer-out Reset Flag - * | | |This bit indicates the system has been reset by WWDT time-out reset or not. - * | | |0 = WWDT time-out reset did not occur. - * | | |1 = WWDT time-out reset occurred. - * | | |Note: This bit is cleared by writing 1 to it. - * @var WWDT_T::CNT - * Offset: 0x0C WWDT Counter Value Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[5:0] |CNTDAT |WWDT Counter Value - * | | |CNTDAT will be updated continuously to monitor 6-bit WWDT down counter value. - */ - __O uint32_t RLDCNT; /*!< [0x0000] WWDT Reload Counter Register */ - __IO uint32_t CTL; /*!< [0x0004] WWDT Control Register */ - __IO uint32_t STATUS; /*!< [0x0008] WWDT Status Register */ - __I uint32_t CNT; /*!< [0x000c] WWDT Counter Value Register */ - -} WWDT_T; - -/** - @addtogroup WWDT_CONST WWDT Bit Field Definition - Constant Definitions for WWDT Controller -@{ */ - -#define WWDT_RLDCNT_RLDCNT_Pos (0) /*!< WWDT_T::RLDCNT: RLDCNT Position */ -#define WWDT_RLDCNT_RLDCNT_Msk (0xfffffffful << WWDT_RLDCNT_RLDCNT_Pos) /*!< WWDT_T::RLDCNT: RLDCNT Mask */ - -#define WWDT_CTL_WWDTEN_Pos (0) /*!< WWDT_T::CTL: WWDTEN Position */ -#define WWDT_CTL_WWDTEN_Msk (0x1ul << WWDT_CTL_WWDTEN_Pos) /*!< WWDT_T::CTL: WWDTEN Mask */ - -#define WWDT_CTL_INTEN_Pos (1) /*!< WWDT_T::CTL: INTEN Position */ -#define WWDT_CTL_INTEN_Msk (0x1ul << WWDT_CTL_INTEN_Pos) /*!< WWDT_T::CTL: INTEN Mask */ - -#define WWDT_CTL_PSCSEL_Pos (8) /*!< WWDT_T::CTL: PSCSEL Position */ -#define WWDT_CTL_PSCSEL_Msk (0xful << WWDT_CTL_PSCSEL_Pos) /*!< WWDT_T::CTL: PSCSEL Mask */ - -#define WWDT_CTL_CMPDAT_Pos (16) /*!< WWDT_T::CTL: CMPDAT Position */ -#define WWDT_CTL_CMPDAT_Msk (0x3ful << WWDT_CTL_CMPDAT_Pos) /*!< WWDT_T::CTL: CMPDAT Mask */ - -#define WWDT_CTL_ICEDEBUG_Pos (31) /*!< WWDT_T::CTL: ICEDEBUG Position */ -#define WWDT_CTL_ICEDEBUG_Msk (0x1ul << WWDT_CTL_ICEDEBUG_Pos) /*!< WWDT_T::CTL: ICEDEBUG Mask */ - -#define WWDT_STATUS_WWDTIF_Pos (0) /*!< WWDT_T::STATUS: WWDTIF Position */ -#define WWDT_STATUS_WWDTIF_Msk (0x1ul << WWDT_STATUS_WWDTIF_Pos) /*!< WWDT_T::STATUS: WWDTIF Mask */ - -#define WWDT_STATUS_WWDTRF_Pos (1) /*!< WWDT_T::STATUS: WWDTRF Position */ -#define WWDT_STATUS_WWDTRF_Msk (0x1ul << WWDT_STATUS_WWDTRF_Pos) /*!< WWDT_T::STATUS: WWDTRF Mask */ - -#define WWDT_CNT_CNTDAT_Pos (0) /*!< WWDT_T::CNT: CNTDAT Position */ -#define WWDT_CNT_CNTDAT_Msk (0x3ful << WWDT_CNT_CNTDAT_Pos) /*!< WWDT_T::CNT: CNTDAT Mask */ - -/**@}*/ /* WWDT_CONST */ -/**@}*/ /* end of WWDT register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __WWDT_REG_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/ARM/startup_ma35d1_subm.s b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/ARM/startup_ma35d1_subm.s deleted file mode 100644 index a8e1659dff9..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/ARM/startup_ma35d1_subm.s +++ /dev/null @@ -1,488 +0,0 @@ -;/****************************************************************************** -; * @file startup_ma35d1_subm.s -; * @brief CMSIS Cortex-M4 Core Device Startup File -; * -; * SPDX-License-Identifier: Apache-2.0 -; * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -;*****************************************************************************/ -;/* -;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ -;*/ - - -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Stack_Size -Stack_Size EQU 0x00001000 - ENDIF - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size - EXPORT __initial_sp -__initial_sp - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - - IF :LNOT: :DEF: Heap_Size -Heap_Size EQU 0x00000100 - ENDIF - - 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 - - ; External Interrupts - DCD LVD_IRQHandler ; 0 - DCD Default_Handler ; 1 - DCD PWRWU_IRQHandler ; 2 - DCD HWSEM0_IRQHandler ; 3 - DCD CKFAIL_IRQHandler ; 4 - DCD WHC0_IRQHandler ; 5 - DCD RTC_IRQHandler ; 6 - DCD TAMPER_IRQHandler ; 7 - DCD WDT2_IRQHandler ; 8 - DCD WWDT2_IRQHandler ; 9 - DCD EINT0_IRQHandler ; 10 - DCD EINT1_IRQHandler ; 11 - DCD EINT2_IRQHandler ; 12 - DCD EINT3_IRQHandler ; 13 - DCD Default_Handler ; 14 - DCD Default_Handler ; 15 - DCD GPA_IRQHandler ; 16 - DCD GPB_IRQHandler ; 17 - DCD GPC_IRQHandler ; 18 - DCD GPD_IRQHandler ; 19 - DCD Default_Handler ; 20 - DCD Default_Handler ; 21 - DCD TMR2_IRQHandler ; 22 - DCD TMR3_IRQHandler ; 23 - DCD BRAKE0_IRQHandler ; 24 - DCD EPWM0P0_IRQHandler ; 25 - DCD EPWM0P1_IRQHandler ; 26 - DCD EPWM0P2_IRQHandler ; 27 - DCD QEI0_IRQHandler ; 28 - DCD ECAP0_IRQHandler ; 29 - DCD Default_Handler ; 30 - DCD QSPI1_IRQHandler ; 31 - DCD Default_Handler ; 32 - DCD Default_Handler ; 33 - DCD Default_Handler ; 34 - DCD UART1_IRQHandler ; 35 - DCD UART2_IRQHandler ; 36 - DCD UART3_IRQHandler ; 37 - DCD UART4_IRQHandler ; 38 - DCD UART5_IRQHandler ; 39 - DCD EADC00_IRQHandler ; 40 - DCD EADC01_IRQHandler ; 41 - DCD EADC02_IRQHandler ; 42 - DCD EADC03_IRQHandler ; 43 - DCD Default_Handler ; 44 - DCD I2C1_IRQHandler ; 45 - DCD I2S0_IRQHandler ; 46 - DCD CANFD00_IRQHandler ; 47 - DCD SC0_IRQHandler ; 48 - DCD GPE_IRQHandler ; 49 - DCD GPF_IRQHandler ; 50 - DCD GPG_IRQHandler ; 51 - DCD GPH_IRQHandler ; 52 - DCD GPI_IRQHandler ; 53 - DCD GPJ_IRQHandler ; 54 - DCD TMR4_IRQHandler ; 55 - DCD TMR5_IRQHandler ; 56 - DCD TMR6_IRQHandler ; 57 - DCD TMR7_IRQHandler ; 58 - DCD BRAKE1_IRQHandler ; 59 - DCD EPWM1P0_IRQHandler ; 60 - DCD EPWM1P1_IRQHandler ; 61 - DCD EPWM1P2_IRQHandler ; 62 - DCD QEI1_IRQHandler ; 63 - DCD ECAP1_IRQHandler ; 64 - DCD SPI0_IRQHandler ; 65 - DCD SPI1_IRQHandler ; 66 - DCD PDMA2_IRQHandler ; 67 - DCD PDMA3_IRQHandler ; 68 - DCD UART6_IRQHandler ; 69 - DCD UART7_IRQHandler ; 70 - DCD UART8_IRQHandler ; 71 - DCD UART9_IRQHandler ; 72 - DCD UART10_IRQHandler ; 73 - DCD UART11_IRQHandler ; 74 - DCD I2C2_IRQHandler ; 75 - DCD I2C3_IRQHandler ; 76 - DCD I2S1_IRQHandler ; 77 - DCD CANFD10_IRQHandler ; 78 - DCD SC1_IRQHandler ; 79 - DCD GPK_IRQHandler ; 80 - DCD GPL_IRQHandler ; 81 - DCD GPM_IRQHandler ; 82 - DCD GPN_IRQHandler ; 83 - DCD TMR8_IRQHandler ; 84 - DCD TMR9_IRQHandler ; 85 - DCD TMR10_IRQHandler ; 86 - DCD TMR11_IRQHandler ; 87 - DCD BRAKE2_IRQHandler ; 88 - DCD EPWM2P0_IRQHandle ; 89 - DCD EPWM2P1_IRQHandle ; 90 - DCD EPWM2P2_IRQHandle ; 91 - DCD QEI2_IRQHandler ; 92 - DCD ECAP2_IRQHandler ; 93 - DCD SPI2_IRQHandler ; 94 - DCD SPI3_IRQHandler ; 95 - DCD UART12_IRQHandler ; 96 - DCD UART13_IRQHandler ; 97 - DCD UART14_IRQHandler ; 98 - DCD UART15_IRQHandler ; 99 - DCD UART16_IRQHandler ; 100 - DCD I2C4_IRQHandler ; 101 - DCD I2C5_IRQHandler ; 102 - DCD CANFD20_IRQHandler ; 103 - DCD CANFD30_IRQHandler ; 104 - DCD KPI_IRQHandler ; 105 - DCD CANFD01_IRQHandler ; 106 - DCD CANFD11_IRQHandler ; 107 - DCD CANFD21_IRQHandler ; 108 - DCD CANFD31_IRQHandler ; 109 - DCD ADC0_IRQHandler ; 110 -__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 LVD_IRQHandler [WEAK] - EXPORT PWRWU_IRQHandler [WEAK] - EXPORT HWSEM0_IRQHandler [WEAK] - EXPORT CKFAIL_IRQHandler [WEAK] - EXPORT WHC0_IRQHandler [WEAK] - EXPORT RTC_IRQHandler [WEAK] - EXPORT TAMPER_IRQHandler [WEAK] - EXPORT WDT2_IRQHandler [WEAK] - EXPORT WWDT2_IRQHandler [WEAK] - EXPORT EINT0_IRQHandler [WEAK] - EXPORT EINT1_IRQHandler [WEAK] - EXPORT EINT2_IRQHandler [WEAK] - EXPORT EINT3_IRQHandler [WEAK] - EXPORT GPA_IRQHandler [WEAK] - EXPORT GPB_IRQHandler [WEAK] - EXPORT GPC_IRQHandler [WEAK] - EXPORT GPD_IRQHandler [WEAK] - EXPORT TMR2_IRQHandler [WEAK] - EXPORT TMR3_IRQHandler [WEAK] - EXPORT BRAKE0_IRQHandler [WEAK] - EXPORT EPWM0P0_IRQHandler [WEAK] - EXPORT EPWM0P1_IRQHandler [WEAK] - EXPORT EPWM0P2_IRQHandler [WEAK] - EXPORT QEI0_IRQHandler [WEAK] - EXPORT ECAP0_IRQHandler [WEAK] - EXPORT QSPI1_IRQHandler [WEAK] - EXPORT UART1_IRQHandler [WEAK] - EXPORT UART2_IRQHandler [WEAK] - EXPORT UART3_IRQHandler [WEAK] - EXPORT UART4_IRQHandler [WEAK] - EXPORT UART5_IRQHandler [WEAK] - EXPORT EADC00_IRQHandler [WEAK] - EXPORT EADC01_IRQHandler [WEAK] - EXPORT EADC02_IRQHandler [WEAK] - EXPORT EADC03_IRQHandler [WEAK] - EXPORT I2C1_IRQHandler [WEAK] - EXPORT I2S0_IRQHandler [WEAK] - EXPORT CANFD00_IRQHandler [WEAK] - EXPORT SC0_IRQHandler [WEAK] - EXPORT GPE_IRQHandler [WEAK] - EXPORT GPF_IRQHandler [WEAK] - EXPORT GPG_IRQHandler [WEAK] - EXPORT GPH_IRQHandler [WEAK] - EXPORT GPI_IRQHandler [WEAK] - EXPORT GPJ_IRQHandler [WEAK] - EXPORT TMR4_IRQHandler [WEAK] - EXPORT TMR5_IRQHandler [WEAK] - EXPORT TMR6_IRQHandler [WEAK] - EXPORT TMR7_IRQHandler [WEAK] - EXPORT BRAKE1_IRQHandler [WEAK] - EXPORT EPWM1P0_IRQHandler [WEAK] - EXPORT EPWM1P1_IRQHandler [WEAK] - EXPORT EPWM1P2_IRQHandler [WEAK] - EXPORT QEI1_IRQHandler [WEAK] - EXPORT ECAP1_IRQHandler [WEAK] - EXPORT SPI0_IRQHandler [WEAK] - EXPORT SPI1_IRQHandler [WEAK] - EXPORT PDMA2_IRQHandler [WEAK] - EXPORT PDMA3_IRQHandler [WEAK] - EXPORT UART6_IRQHandler [WEAK] - EXPORT UART7_IRQHandler [WEAK] - EXPORT UART8_IRQHandler [WEAK] - EXPORT UART9_IRQHandler [WEAK] - EXPORT UART10_IRQHandler [WEAK] - EXPORT UART11_IRQHandler [WEAK] - EXPORT I2C2_IRQHandler [WEAK] - EXPORT I2C3_IRQHandler [WEAK] - EXPORT I2S1_IRQHandler [WEAK] - EXPORT CANFD10_IRQHandler [WEAK] - EXPORT SC1_IRQHandler [WEAK] - EXPORT GPK_IRQHandler [WEAK] - EXPORT GPL_IRQHandler [WEAK] - EXPORT GPM_IRQHandler [WEAK] - EXPORT GPN_IRQHandler [WEAK] - EXPORT TMR8_IRQHandler [WEAK] - EXPORT TMR9_IRQHandler [WEAK] - EXPORT TMR10_IRQHandler [WEAK] - EXPORT TMR11_IRQHandler [WEAK] - EXPORT BRAKE2_IRQHandler [WEAK] - EXPORT EPWM2P0_IRQHandle [WEAK] - EXPORT EPWM2P1_IRQHandle [WEAK] - EXPORT EPWM2P2_IRQHandle [WEAK] - EXPORT QEI2_IRQHandler [WEAK] - EXPORT ECAP2_IRQHandler [WEAK] - EXPORT SPI2_IRQHandler [WEAK] - EXPORT SPI3_IRQHandler [WEAK] - EXPORT UART12_IRQHandler [WEAK] - EXPORT UART13_IRQHandler [WEAK] - EXPORT UART14_IRQHandler [WEAK] - EXPORT UART15_IRQHandler [WEAK] - EXPORT UART16_IRQHandler [WEAK] - EXPORT I2C4_IRQHandler [WEAK] - EXPORT I2C5_IRQHandler [WEAK] - EXPORT CANFD20_IRQHandler [WEAK] - EXPORT CANFD30_IRQHandler [WEAK] - EXPORT KPI_IRQHandler [WEAK] - EXPORT CANFD01_IRQHandler [WEAK] - EXPORT CANFD11_IRQHandler [WEAK] - EXPORT CANFD21_IRQHandler [WEAK] - EXPORT CANFD31_IRQHandler [WEAK] - EXPORT ADC0_IRQHandler [WEAK] - -LVD_IRQHandler -PWRWU_IRQHandler -HWSEM0_IRQHandler -CKFAIL_IRQHandler -WHC0_IRQHandler -RTC_IRQHandler -TAMPER_IRQHandler -WDT2_IRQHandler -WWDT2_IRQHandler -EINT0_IRQHandler -EINT1_IRQHandler -EINT2_IRQHandler -EINT3_IRQHandler -GPA_IRQHandler -GPB_IRQHandler -GPC_IRQHandler -GPD_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -BRAKE0_IRQHandler -EPWM0P0_IRQHandler -EPWM0P1_IRQHandler -EPWM0P2_IRQHandler -QEI0_IRQHandler -ECAP0_IRQHandler -QSPI1_IRQHandler -UART1_IRQHandler -UART2_IRQHandler -UART3_IRQHandler -UART4_IRQHandler -UART5_IRQHandler -EADC00_IRQHandler -EADC01_IRQHandler -EADC02_IRQHandler -EADC03_IRQHandler -I2C1_IRQHandler -I2S0_IRQHandler -CANFD00_IRQHandler -SC0_IRQHandler -GPE_IRQHandler -GPF_IRQHandler -GPG_IRQHandler -GPH_IRQHandler -GPI_IRQHandler -GPJ_IRQHandler -TMR4_IRQHandler -TMR5_IRQHandler -TMR6_IRQHandler -TMR7_IRQHandler -BRAKE1_IRQHandler -EPWM1P0_IRQHandler -EPWM1P1_IRQHandler -EPWM1P2_IRQHandler -QEI1_IRQHandler -ECAP1_IRQHandler -SPI0_IRQHandler -SPI1_IRQHandler -PDMA2_IRQHandler -PDMA3_IRQHandler -UART6_IRQHandler -UART7_IRQHandler -UART8_IRQHandler -UART9_IRQHandler -UART10_IRQHandler -UART11_IRQHandler -I2C2_IRQHandler -I2C3_IRQHandler -I2S1_IRQHandler -CANFD10_IRQHandler -SC1_IRQHandler -GPK_IRQHandler -GPL_IRQHandler -GPM_IRQHandler -GPN_IRQHandler -TMR8_IRQHandler -TMR9_IRQHandler -TMR10_IRQHandler -TMR11_IRQHandler -BRAKE2_IRQHandler -EPWM2P0_IRQHandle -EPWM2P1_IRQHandle -EPWM2P2_IRQHandle -QEI2_IRQHandler -ECAP2_IRQHandler -SPI2_IRQHandler -SPI3_IRQHandler -UART12_IRQHandler -UART13_IRQHandler -UART14_IRQHandler -UART15_IRQHandler -UART16_IRQHandler -I2C4_IRQHandler -I2C5_IRQHandler -CANFD20_IRQHandler -CANFD30_IRQHandler -KPI_IRQHandler -CANFD01_IRQHandler -CANFD11_IRQHandler -CANFD21_IRQHandler -CANFD31_IRQHandler -ADC0_IRQHandler - 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 PROC - LDR R0, = Heap_Mem - LDR R1, =(Stack_Mem + Stack_Size) - LDR R2, = (Heap_Mem + Heap_Size) - LDR R3, = Stack_Mem - BX LR - ENDP - - ALIGN - - ENDIF - - - END - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/GCC/startup_ma35d1_subm.S b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/GCC/startup_ma35d1_subm.S deleted file mode 100644 index c6fdf676f3d..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/GCC/startup_ma35d1_subm.S +++ /dev/null @@ -1,352 +0,0 @@ -/****************************************************************************//** - * @file startup_ma35d1_subm.S - * @brief CMSIS Cortex-M4 Core Device Startup File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - .syntax unified - .cpu cortex-m4 - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - -#ifndef __NO_SYSTEM_INIT - bl SystemInit -#endif - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the application's entry point.*/ - bl entry - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M4. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack /* Top of Stack */ - .word Reset_Handler /* Reset Handler */ - .word NMI_Handler /* NMI Handler */ - .word HardFault_Handler /* Hard Fault Handler */ - .word MemManage_Handler /* MPU Fault Handler */ - .word BusFault_Handler /* Bus Fault Handler */ - .word UsageFault_Handler /* Usage Fault Handler */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SVC_Handler /* SVCall Handler */ - .word DebugMon_Handler /* Debug Monitor Handler */ - .word 0 /* Reserved */ - .word PendSV_Handler /* PendSV Handler */ - .word SysTick_Handler /* SysTick Handler */ - - /* External interrupts */ - .word LVD_IRQHandler /* 0 */ - .word 0 /* 1 */ - .word PWRWU_IRQHandler /* 2 */ - .word HWSEM0_IRQHandler /* 3 */ - .word CKFAIL_IRQHandler /* 4 */ - .word WHC0_IRQHandler /* 5 */ - .word RTC_IRQHandler /* 6 */ - .word TAMPER_IRQHandler /* 7 */ - .word WDT2_IRQHandler /* 8 */ - .word WWDT2_IRQHandler /* 9 */ - .word EINT0_IRQHandler /* 10 */ - .word EINT1_IRQHandler /* 11 */ - .word EINT2_IRQHandler /* 12 */ - .word EINT3_IRQHandler /* 13 */ - .word 0 /* 14 */ - .word 0 /* 15 */ - .word GPA_IRQHandler /* 16 */ - .word GPB_IRQHandler /* 17 */ - .word GPC_IRQHandler /* 18 */ - .word GPD_IRQHandler /* 19 */ - .word 0 /* 20 */ - .word 0 /* 21 */ - .word TMR2_IRQHandler /* 22 */ - .word TMR3_IRQHandler /* 23 */ - .word BRAKE0_IRQHandler /* 24 */ - .word EPWM0P0_IRQHandler /* 25 */ - .word EPWM0P1_IRQHandler /* 26 */ - .word EPWM0P2_IRQHandler /* 27 */ - .word QEI0_IRQHandler /* 28 */ - .word ECAP0_IRQHandler /* 29 */ - .word 0 /* 30 */ - .word QSPI1_IRQHandler /* 31 */ - .word 0 /* 32 */ - .word 0 /* 33 */ - .word 0 /* 34 */ - .word UART1_IRQHandler /* 35 */ - .word UART2_IRQHandler /* 36 */ - .word UART3_IRQHandler /* 37 */ - .word UART4_IRQHandler /* 38 */ - .word UART5_IRQHandler /* 39 */ - .word EADC00_IRQHandler /* 40 */ - .word EADC01_IRQHandler /* 41 */ - .word EADC02_IRQHandler /* 42 */ - .word EADC03_IRQHandler /* 43 */ - .word 0 /* 44 */ - .word I2C1_IRQHandler /* 45 */ - .word I2S0_IRQHandler /* 46 */ - .word MCAN00_IRQHandler /* 47 */ - .word SC0_IRQHandler /* 48 */ - .word GPE_IRQHandler /* 49 */ - .word GPF_IRQHandler /* 50 */ - .word GPG_IRQHandler /* 51 */ - .word GPH_IRQHandler /* 52 */ - .word GPI_IRQHandler /* 53 */ - .word GPJ_IRQHandler /* 54 */ - .word TMR4_IRQHandler /* 55 */ - .word TMR5_IRQHandler /* 56 */ - .word TMR6_IRQHandler /* 57 */ - .word TMR7_IRQHandler /* 58 */ - .word BRAKE1_IRQHandler /* 59 */ - .word EPWM1P0_IRQHandler /* 60 */ - .word EPWM1P1_IRQHandler /* 61 */ - .word EPWM1P2_IRQHandler /* 62 */ - .word QEI1_IRQHandler /* 63 */ - .word ECAP1_IRQHandler /* 64 */ - .word SPI0_IRQHandler /* 65 */ - .word SPI1_IRQHandler /* 66 */ - .word PDMA2_IRQHandler /* 67 */ - .word PDMA3_IRQHandler /* 68 */ - .word UART6_IRQHandler /* 69 */ - .word UART7_IRQHandler /* 70 */ - .word UART8_IRQHandler /* 71 */ - .word UART9_IRQHandler /* 72 */ - .word UART10_IRQHandler /* 73 */ - .word UART11_IRQHandler /* 74 */ - .word I2C2_IRQHandler /* 75 */ - .word I2C3_IRQHandler /* 76 */ - .word I2S1_IRQHandler /* 77 */ - .word MACN10_IRQHandler /* 78 */ - .word SC1_IRQHandler /* 79 */ - .word GPK_IRQHandler /* 80 */ - .word GPL_IRQHandler /* 81 */ - .word GPM_IRQHandler /* 82 */ - .word GPN_IRQHandler /* 83 */ - .word TMR8_IRQHandler /* 84 */ - .word TMR9_IRQHandler /* 85 */ - .word TMR10_IRQHandler /* 86 */ - .word TMR11_IRQHandler /* 87 */ - .word BRAKE2_IRQHandler /* 88 */ - .word EPWM2P0_IRQHandler /* 89 */ - .word EPWM2P1_IRQHandler /* 90 */ - .word EPWM2P2_IRQHandler /* 91 */ - .word QEI2_IRQHandler /* 92 */ - .word ECAP2_IRQHandler /* 93 */ - .word SPI2_IRQHandler /* 94 */ - .word SPI3_IRQHandler /* 95 */ - .word UART12_IRQHandler /* 96 */ - .word UART13_IRQHandler /* 97 */ - .word UART14_IRQHandler /* 98 */ - .word UART15_IRQHandler /* 99 */ - .word UART16_IRQHandler /* 100 */ - .word I2C4_IRQHandler /* 101 */ - .word I2C5_IRQHandler /* 102 */ - .word MCAN20_IRQHandler /* 103 */ - .word MCAN30_IRQHandler /* 104 */ - .word KPI_IRQHandler /* 105 */ - .word MCAN01_IRQHandler /* 106 */ - .word MCAN11_IRQHandler /* 107 */ - .word MCAN21_IRQHandler /* 108 */ - .word MCAN31_IRQHandler /* 109 */ - .word ADC0_IRQHandler /* 110 */ - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, Default_Handler - .endm - - def_irq_handler NMI_Handler - def_irq_handler HardFault_Handler - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SVC_Handler - def_irq_handler DebugMon_Handler - def_irq_handler PendSV_Handler - def_irq_handler SysTick_Handler - - def_irq_handler LVD_IRQHandler - def_irq_handler PWRWU_IRQHandler - def_irq_handler HWSEM0_IRQHandler - def_irq_handler CKFAIL_IRQHandler - def_irq_handler WHC0_IRQHandler - def_irq_handler RTC_IRQHandler - def_irq_handler TAMPER_IRQHandler - def_irq_handler WDT2_IRQHandler - def_irq_handler WWDT2_IRQHandler - def_irq_handler EINT0_IRQHandler - def_irq_handler EINT1_IRQHandler - def_irq_handler EINT2_IRQHandler - def_irq_handler EINT3_IRQHandler - def_irq_handler GPA_IRQHandler - def_irq_handler GPB_IRQHandler - def_irq_handler GPC_IRQHandler - def_irq_handler GPD_IRQHandler - def_irq_handler TMR2_IRQHandler - def_irq_handler TMR3_IRQHandler - def_irq_handler BRAKE0_IRQHandler - def_irq_handler EPWM0P0_IRQHandler - def_irq_handler EPWM0P1_IRQHandler - def_irq_handler EPWM0P2_IRQHandler - def_irq_handler QEI0_IRQHandler - def_irq_handler ECAP0_IRQHandler - def_irq_handler QSPI1_IRQHandler - def_irq_handler UART1_IRQHandler - def_irq_handler UART2_IRQHandler - def_irq_handler UART3_IRQHandler - def_irq_handler UART4_IRQHandler - def_irq_handler UART5_IRQHandler - def_irq_handler EADC00_IRQHandler - def_irq_handler EADC01_IRQHandler - def_irq_handler EADC02_IRQHandler - def_irq_handler EADC03_IRQHandler - def_irq_handler I2C1_IRQHandler - def_irq_handler I2S0_IRQHandler - def_irq_handler MCAN00_IRQHandler - def_irq_handler SC0_IRQHandler - def_irq_handler GPE_IRQHandler - def_irq_handler GPF_IRQHandler - def_irq_handler GPG_IRQHandler - def_irq_handler GPH_IRQHandler - def_irq_handler GPI_IRQHandler - def_irq_handler GPJ_IRQHandler - def_irq_handler TMR4_IRQHandler - def_irq_handler TMR5_IRQHandler - def_irq_handler TMR6_IRQHandler - def_irq_handler TMR7_IRQHandler - def_irq_handler BRAKE1_IRQHandler - def_irq_handler EPWM1P0_IRQHandler - def_irq_handler EPWM1P1_IRQHandler - def_irq_handler EPWM1P2_IRQHandler - def_irq_handler QEI1_IRQHandler - def_irq_handler ECAP1_IRQHandler - def_irq_handler SPI0_IRQHandler - def_irq_handler SPI1_IRQHandler - def_irq_handler PDMA2_IRQHandler - def_irq_handler PDMA3_IRQHandler - def_irq_handler UART6_IRQHandler - def_irq_handler UART7_IRQHandler - def_irq_handler UART8_IRQHandler - def_irq_handler UART9_IRQHandler - def_irq_handler UART10_IRQHandler - def_irq_handler UART11_IRQHandler - def_irq_handler I2C2_IRQHandler - def_irq_handler I2C3_IRQHandler - def_irq_handler I2S1_IRQHandler - def_irq_handler MACN10_IRQHandler - def_irq_handler SC1_IRQHandler - def_irq_handler GPK_IRQHandler - def_irq_handler GPL_IRQHandler - def_irq_handler GPM_IRQHandler - def_irq_handler GPN_IRQHandler - def_irq_handler TMR8_IRQHandler - def_irq_handler TMR9_IRQHandler - def_irq_handler TMR10_IRQHandler - def_irq_handler TMR11_IRQHandler - def_irq_handler BRAKE2_IRQHandler - def_irq_handler EPWM2P0_IRQHandler - def_irq_handler EPWM2P1_IRQHandler - def_irq_handler EPWM2P2_IRQHandler - def_irq_handler QEI2_IRQHandler - def_irq_handler ECAP2_IRQHandler - def_irq_handler SPI2_IRQHandler - def_irq_handler SPI3_IRQHandler - def_irq_handler UART12_IRQHandler - def_irq_handler UART13_IRQHandler - def_irq_handler UART14_IRQHandler - def_irq_handler UART15_IRQHandler - def_irq_handler UART16_IRQHandler - def_irq_handler I2C4_IRQHandler - def_irq_handler I2C5_IRQHandler - def_irq_handler MCAN20_IRQHandler - def_irq_handler MCAN30_IRQHandler - def_irq_handler KPI_IRQHandler - def_irq_handler MCAN01_IRQHandler - def_irq_handler MCAN11_IRQHandler - def_irq_handler MCAN21_IRQHandler - def_irq_handler MCAN31_IRQHandler - def_irq_handler ADC0_IRQHandler - .end diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/IAR/startup_ma35d1_subm.s b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/IAR/startup_ma35d1_subm.s deleted file mode 100644 index 486e6fa384b..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/IAR/startup_ma35d1_subm.s +++ /dev/null @@ -1,430 +0,0 @@ -;/****************************************************************************** -; * @file startup_subm.s -; * @brief CMSIS Cortex-M4 Core Device Startup File -; * -; * SPDX-License-Identifier: Apache-2.0 -; * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -;*****************************************************************************/ - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN HardFault_Handler - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler - DCD HardFault_Handler - DCD MemManage_Handler - DCD BusFault_Handler - DCD UsageFault_Handler -__vector_table_0x1c - DCD 0 - DCD 0 - DCD 0 - DCD 0 - DCD SVC_Handler - DCD DebugMon_Handler - DCD 0 - DCD PendSV_Handler - DCD SysTick_Handler - - ; External Interrupts - DCD LVD_IRQHandler ; 0 - DCD Default_Handler ; 1 - DCD PWRWU_IRQHandler ; 2 - DCD HWSEM0_IRQHandler ; 3 - DCD CKFAIL_IRQHandler ; 4 - DCD WHC0_IRQHandler ; 5 - DCD RTC_IRQHandler ; 6 - DCD TAMPER_IRQHandler ; 7 - DCD WDT2_IRQHandler ; 8 - DCD WWDT2_IRQHandler ; 9 - DCD EINT0_IRQHandler ; 10 - DCD EINT1_IRQHandler ; 11 - DCD EINT2_IRQHandler ; 12 - DCD EINT3_IRQHandler ; 13 - DCD Default_Handler ; 14 - DCD Default_Handler ; 15 - DCD GPA_IRQHandler ; 16 - DCD GPB_IRQHandler ; 17 - DCD GPC_IRQHandler ; 18 - DCD GPD_IRQHandler ; 19 - DCD Default_Handler ; 20 - DCD Default_Handler ; 21 - DCD TMR2_IRQHandler ; 22 - DCD TMR3_IRQHandler ; 23 - DCD BRAKE0_IRQHandler ; 24 - DCD EPWM0P0_IRQHandler ; 25 - DCD EPWM0P1_IRQHandler ; 26 - DCD EPWM0P2_IRQHandler ; 27 - DCD QEI0_IRQHandler ; 28 - DCD ECAP0_IRQHandler ; 29 - DCD Default_Handler ; 30 - DCD QSPI1_IRQHandler ; 31 - DCD Default_Handler ; 32 - DCD Default_Handler ; 33 - DCD Default_Handler ; 34 - DCD UART1_IRQHandler ; 35 - DCD UART2_IRQHandler ; 36 - DCD UART3_IRQHandler ; 37 - DCD UART4_IRQHandler ; 38 - DCD UART5_IRQHandler ; 39 - DCD EADC00_IRQHandler ; 40 - DCD EADC01_IRQHandler ; 41 - DCD EADC02_IRQHandler ; 42 - DCD EADC03_IRQHandler ; 43 - DCD Default_Handler ; 44 - DCD I2C1_IRQHandler ; 45 - DCD I2S0_IRQHandler ; 46 - DCD MCAN00_IRQHandler ; 47 - DCD SC0_IRQHandler ; 48 - DCD GPE_IRQHandler ; 49 - DCD GPF_IRQHandler ; 50 - DCD GPG_IRQHandler ; 51 - DCD GPH_IRQHandler ; 52 - DCD GPI_IRQHandler ; 53 - DCD GPJ_IRQHandler ; 54 - DCD TMR4_IRQHandler ; 55 - DCD TMR5_IRQHandler ; 56 - DCD TMR6_IRQHandler ; 57 - DCD TMR7_IRQHandler ; 58 - DCD BRAKE1_IRQHandler ; 59 - DCD EPWM1P0_IRQHandler ; 60 - DCD EPWM1P1_IRQHandler ; 61 - DCD EPWM1P2_IRQHandler ; 62 - DCD QEI1_IRQHandler ; 63 - DCD ECAP1_IRQHandler ; 64 - DCD SPI0_IRQHandler ; 65 - DCD SPI1_IRQHandler ; 66 - DCD PDMA2_IRQHandler ; 67 - DCD PDMA3_IRQHandler ; 68 - DCD UART6_IRQHandler ; 69 - DCD UART7_IRQHandler ; 70 - DCD UART8_IRQHandler ; 71 - DCD UART9_IRQHandler ; 72 - DCD UART10_IRQHandler ; 73 - DCD UART11_IRQHandler ; 74 - DCD I2C2_IRQHandler ; 75 - DCD I2C3_IRQHandler ; 76 - DCD I2S1_IRQHandler ; 77 - DCD MACN10_IRQHandler ; 78 - DCD SC1_IRQHandler ; 79 - DCD GPK_IRQHandler ; 80 - DCD GPL_IRQHandler ; 81 - DCD GPM_IRQHandler ; 82 - DCD GPN_IRQHandler ; 83 - DCD TMR8_IRQHandler ; 84 - DCD TMR9_IRQHandler ; 85 - DCD TMR10_IRQHandler ; 86 - DCD TMR11_IRQHandler ; 87 - DCD BRAKE2_IRQHandler ; 88 - DCD EPWM2P0_IRQHandle ; 89 - DCD EPWM2P1_IRQHandle ; 90 - DCD EPWM2P2_IRQHandle ; 91 - DCD QEI2_IRQHandler ; 92 - DCD ECAP2_IRQHandler ; 93 - DCD SPI2_IRQHandler ; 94 - DCD SPI3_IRQHandler ; 95 - DCD UART12_IRQHandler ; 96 - DCD UART13_IRQHandler ; 97 - DCD UART14_IRQHandler ; 98 - DCD UART15_IRQHandler ; 99 - DCD UART16_IRQHandler ; 100 - DCD I2C4_IRQHandler ; 101 - DCD I2C5_IRQHandler ; 102 - DCD MCAN20_IRQHandler ; 103 - DCD MCAN30_IRQHandler ; 104 - DCD KPI_IRQHandler ; 105 - DCD MCAN01_IRQHandler ; 106 - DCD MCAN11_IRQHandler ; 107 - DCD MCAN21_IRQHandler ; 108 - DCD MCAN31_IRQHandler ; 109 - DCD ADC0_IRQHandler ; 110 -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - - LDR R0, =SystemInit - BLX R0 - - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B NMI_Handler - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B MemManage_Handler - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B BusFault_Handler - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B UsageFault_Handler - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B SVC_Handler - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B DebugMon_Handler - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B PendSV_Handler - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B SysTick_Handler - - PUBWEAK LVD_IRQHandler - PUBWEAK PWRWU_IRQHandler - PUBWEAK HWSEM0_IRQHandler - PUBWEAK CKFAIL_IRQHandler - PUBWEAK WHC0_IRQHandler - PUBWEAK RTC_IRQHandler - PUBWEAK TAMPER_IRQHandler - PUBWEAK WDT2_IRQHandler - PUBWEAK WWDT2_IRQHandler - PUBWEAK EINT0_IRQHandler - PUBWEAK EINT1_IRQHandler - PUBWEAK EINT2_IRQHandler - PUBWEAK EINT3_IRQHandler - PUBWEAK GPA_IRQHandler - PUBWEAK GPB_IRQHandler - PUBWEAK GPC_IRQHandler - PUBWEAK GPD_IRQHandler - PUBWEAK TMR2_IRQHandler - PUBWEAK TMR3_IRQHandler - PUBWEAK BRAKE0_IRQHandler - PUBWEAK EPWM0P0_IRQHandler - PUBWEAK EPWM0P1_IRQHandler - PUBWEAK EPWM0P2_IRQHandler - PUBWEAK QEI0_IRQHandler - PUBWEAK ECAP0_IRQHandler - PUBWEAK QSPI1_IRQHandler - PUBWEAK UART1_IRQHandler - PUBWEAK UART2_IRQHandler - PUBWEAK UART3_IRQHandler - PUBWEAK UART4_IRQHandler - PUBWEAK UART5_IRQHandler - PUBWEAK EADC00_IRQHandler - PUBWEAK EADC01_IRQHandler - PUBWEAK EADC02_IRQHandler - PUBWEAK EADC03_IRQHandler - PUBWEAK I2C1_IRQHandler - PUBWEAK I2S0_IRQHandler - PUBWEAK MCAN00_IRQHandler - PUBWEAK SC0_IRQHandler - PUBWEAK GPE_IRQHandler - PUBWEAK GPF_IRQHandler - PUBWEAK GPG_IRQHandler - PUBWEAK GPH_IRQHandler - PUBWEAK GPI_IRQHandler - PUBWEAK GPJ_IRQHandler - PUBWEAK TMR4_IRQHandler - PUBWEAK TMR5_IRQHandler - PUBWEAK TMR6_IRQHandler - PUBWEAK TMR7_IRQHandler - PUBWEAK BRAKE1_IRQHandler - PUBWEAK EPWM1P0_IRQHandler - PUBWEAK EPWM1P1_IRQHandler - PUBWEAK EPWM1P2_IRQHandler - PUBWEAK QEI1_IRQHandler - PUBWEAK ECAP1_IRQHandler - PUBWEAK SPI0_IRQHandler - PUBWEAK SPI1_IRQHandler - PUBWEAK PDMA2_IRQHandler - PUBWEAK PDMA3_IRQHandler - PUBWEAK UART6_IRQHandler - PUBWEAK UART7_IRQHandler - PUBWEAK UART8_IRQHandler - PUBWEAK UART9_IRQHandler - PUBWEAK UART10_IRQHandler - PUBWEAK UART11_IRQHandler - PUBWEAK I2C2_IRQHandler - PUBWEAK I2C3_IRQHandler - PUBWEAK I2S1_IRQHandler - PUBWEAK MACN10_IRQHandler - PUBWEAK SC1_IRQHandler - PUBWEAK GPK_IRQHandler - PUBWEAK GPL_IRQHandler - PUBWEAK GPM_IRQHandler - PUBWEAK GPN_IRQHandler - PUBWEAK TMR8_IRQHandler - PUBWEAK TMR9_IRQHandler - PUBWEAK TMR10_IRQHandler - PUBWEAK TMR11_IRQHandler - PUBWEAK BRAKE2_IRQHandler - PUBWEAK EPWM2P0_IRQHandle - PUBWEAK EPWM2P1_IRQHandle - PUBWEAK EPWM2P2_IRQHandle - PUBWEAK QEI2_IRQHandler - PUBWEAK ECAP2_IRQHandler - PUBWEAK SPI2_IRQHandler - PUBWEAK SPI3_IRQHandler - PUBWEAK UART12_IRQHandler - PUBWEAK UART13_IRQHandler - PUBWEAK UART14_IRQHandler - PUBWEAK UART15_IRQHandler - PUBWEAK UART16_IRQHandler - PUBWEAK I2C4_IRQHandler - PUBWEAK I2C5_IRQHandler - PUBWEAK MCAN20_IRQHandler - PUBWEAK MCAN30_IRQHandler - PUBWEAK KPI_IRQHandler - PUBWEAK MCAN01_IRQHandler - PUBWEAK MCAN11_IRQHandler - PUBWEAK MCAN21_IRQHandler - PUBWEAK MCAN31_IRQHandler - PUBWEAK ADC0_IRQHandler - - SECTION .text:CODE:REORDER:NOROOT(1) - -LVD_IRQHandler -PWRWU_IRQHandler -HWSEM0_IRQHandler -CKFAIL_IRQHandler -WHC0_IRQHandler -RTC_IRQHandler -TAMPER_IRQHandler -WDT2_IRQHandler -WWDT2_IRQHandler -EINT0_IRQHandler -EINT1_IRQHandler -EINT2_IRQHandler -EINT3_IRQHandler -GPA_IRQHandler -GPB_IRQHandler -GPC_IRQHandler -GPD_IRQHandler -TMR2_IRQHandler -TMR3_IRQHandler -BRAKE0_IRQHandler -EPWM0P0_IRQHandler -EPWM0P1_IRQHandler -EPWM0P2_IRQHandler -QEI0_IRQHandler -ECAP0_IRQHandler -QSPI1_IRQHandler -UART1_IRQHandler -UART2_IRQHandler -UART3_IRQHandler -UART4_IRQHandler -UART5_IRQHandler -EADC00_IRQHandler -EADC01_IRQHandler -EADC02_IRQHandler -EADC03_IRQHandler -I2C1_IRQHandler -I2S0_IRQHandler -MCAN00_IRQHandler -SC0_IRQHandler -GPE_IRQHandler -GPF_IRQHandler -GPG_IRQHandler -GPH_IRQHandler -GPI_IRQHandler -GPJ_IRQHandler -TMR4_IRQHandler -TMR5_IRQHandler -TMR6_IRQHandler -TMR7_IRQHandler -BRAKE1_IRQHandler -EPWM1P0_IRQHandler -EPWM1P1_IRQHandler -EPWM1P2_IRQHandler -QEI1_IRQHandler -ECAP1_IRQHandler -SPI0_IRQHandler -SPI1_IRQHandler -PDMA2_IRQHandler -PDMA3_IRQHandler -UART6_IRQHandler -UART7_IRQHandler -UART8_IRQHandler -UART9_IRQHandler -UART10_IRQHandler -UART11_IRQHandler -I2C2_IRQHandler -I2C3_IRQHandler -I2S1_IRQHandler -MACN10_IRQHandler -SC1_IRQHandler -GPK_IRQHandler -GPL_IRQHandler -GPM_IRQHandler -GPN_IRQHandler -TMR8_IRQHandler -TMR9_IRQHandler -TMR10_IRQHandler -TMR11_IRQHandler -BRAKE2_IRQHandler -EPWM2P0_IRQHandle -EPWM2P1_IRQHandle -EPWM2P2_IRQHandle -QEI2_IRQHandler -ECAP2_IRQHandler -SPI2_IRQHandler -SPI3_IRQHandler -UART12_IRQHandler -UART13_IRQHandler -UART14_IRQHandler -UART15_IRQHandler -UART16_IRQHandler -I2C4_IRQHandler -I2C5_IRQHandler -MCAN20_IRQHandler -MCAN30_IRQHandler -KPI_IRQHandler -MCAN01_IRQHandler -MCAN11_IRQHandler -MCAN21_IRQHandler -MCAN31_IRQHandler -ADC0_IRQHandler -Default_Handler - B Default_Handler - - END - diff --git a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/system_ma35d1_subm.c b/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/system_ma35d1_subm.c deleted file mode 100644 index 1e27bee5531..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/Nuvoton/MA35D1/Source/system_ma35d1_subm.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************//** - * @file startup_subm.c - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Source File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - - -/*---------------------------------------------------------------------------- - DEFINES - *----------------------------------------------------------------------------*/ - - -/*---------------------------------------------------------------------------- - Clock Variable definitions - *----------------------------------------------------------------------------*/ -uint32_t SystemCoreClock = __SYSTEM_CLOCK; /*!< System Clock Frequency (Core Clock)*/ -uint32_t CyclesPerUs = (__HSI / 1000000UL); /* Cycles per micro second */ - - -/*---------------------------------------------------------------------------- - Clock functions - *----------------------------------------------------------------------------*/ -void SystemCoreClockUpdate(void) /* Get Core Clock Frequency */ -{ - - /* Update System Core Clock */ - SystemCoreClock = 180000000; - CyclesPerUs = (SystemCoreClock + 500000UL) / 1000000UL; - -} - -/** - * @brief Set PF.2 and PF.3 to input mode - * @param None - * @return None - * @details GPIO default state could be configured as input or quasi through user config. - * To use HXT, PF.2 and PF.3 must not set as quasi mode. This function changes - * PF.2 and PF.3 to input mode no matter which mode they are working at. - */ - - -/** - * @brief Initialize the System - * - * @param none - * @return none - */ -void SystemInit(void) -{ - /* Add your system initialize code here. - Do not use global variables because this function is called before - reaching pre-main. RW section maybe overwritten afterwards. */ - - - /* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - SCB->CPACR |= ((3UL << 10 * 2) | /* set CP10 Full Access */ - (3UL << 11 * 2)); /* set CP11 Full Access */ -#endif - - -} - diff --git a/bsp/nuvoton/libraries/ma35/Device/SConscript b/bsp/nuvoton/libraries/ma35/Device/SConscript deleted file mode 100644 index dadef0e3b05..00000000000 --- a/bsp/nuvoton/libraries/ma35/Device/SConscript +++ /dev/null @@ -1,22 +0,0 @@ -import rtconfig -Import('RTT_ROOT') -from building import * - -# get current directory -cwd = GetCurrentDir() -src = [] - -if GetDepend('USE_MA35D1_SUBM'): - src += ['Nuvoton/MA35D1/Source/system_ma35d1_subm.c'] - if rtconfig.CROSS_TOOL == 'gcc': - src = src + ['Nuvoton/MA35D1/Source/GCC/startup_ma35d1_subm.S'] - elif rtconfig.CROSS_TOOL == 'keil': - src = src + ['Nuvoton/MA35D1/Source/ARM/startup_ma35d1_subm.s'] - elif rtconfig.CROSS_TOOL == 'iar': - src = src + ['Nuvoton/MA35D1/Source/IAR/startup_ma35d1_subm.s'] - -path = [cwd + '/Nuvoton/MA35D1/Include',] - -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/SConscript b/bsp/nuvoton/libraries/ma35/StdDriver/SConscript deleted file mode 100644 index 6ccd1e29be4..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/SConscript +++ /dev/null @@ -1,27 +0,0 @@ -# RT-Thread building script for component -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -libs = [] -src = Glob('*src/*.c') + Glob('src/*.cpp') -cpppath = [cwd + '/inc'] -libpath = [cwd + '/lib'] - - -if not GetDepend('BSP_USE_STDDRIVER_SOURCE'): - if rtconfig.CROSS_TOOL == 'keil': - if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'): - libs += ['libstddriver_keil'] - elif rtconfig.CROSS_TOOL == 'gcc' and os.path.isfile('./lib/libstddriver_gcc_CM4.a') and GetDepend('USE_MA35D1_SUBM'): - libs += ['libstddriver_gcc_CM4'] - elif rtconfig.CROSS_TOOL == 'gcc' and os.path.isfile('./lib/libstddriver_gcc_CA35.a') and GetDepend('USE_MA35D1_AARCH32'): - libs += ['libstddriver_gcc_CA35'] - -if not libs: - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath) -else: - src = [] - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath) - -Return('group') diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_adc.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_adc.h deleted file mode 100644 index 7d57468d134..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_adc.h +++ /dev/null @@ -1,287 +0,0 @@ -/**************************************************************************//** - * @file nu_adc.h - * @brief ADC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright(C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_ADC_H__ -#define __NU_ADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ADC_Driver ADC Driver - @{ -*/ - -/** @addtogroup ADC_EXPORTED_CONSTANTS ADC Exported Constants - @{ -*/ - -#include "adc_reg.h" - -#define ADC_CH_0_MASK (1UL << 0) /*!< ADC channel 0 mask \hideinitializer */ -#define ADC_CH_1_MASK (1UL << 1) /*!< ADC channel 1 mask \hideinitializer */ -#define ADC_CH_2_MASK (1UL << 2) /*!< ADC channel 2 mask \hideinitializer */ -#define ADC_CH_3_MASK (1UL << 3) /*!< ADC channel 3 mask \hideinitializer */ -#define ADC_CH_4_MASK (1UL << 4) /*!< ADC channel 4 mask \hideinitializer */ -#define ADC_CH_5_MASK (1UL << 5) /*!< ADC channel 5 mask \hideinitializer */ -#define ADC_CH_6_MASK (1UL << 6) /*!< ADC channel 6 mask \hideinitializer */ -#define ADC_CH_7_MASK (1UL << 7) /*!< ADC channel 7 mask \hideinitializer */ -#define ADC_CH_NUM 8 /*!< Total Channel number \hideinitializer */ -#define ADC_HIGH_SPEED_MODE ADC_CONF_SPEED_Msk /*!< ADC working in high speed mode (3.2MHz <= ECLK <= 16MHz) \hideinitializer */ -#define ADC_NORMAL_SPEED_MODE 0 /*!< ADC working in normal speed mode (ECLK < 3.2MHz) \hideinitializer */ -#define ADC_REFSEL_VREF 0 /*!< ADC reference voltage source selection set to VREF \hideinitializer */ -#define ADC_REFSEL_AVDD (3UL << ADC_CONF_REFSEL_Pos) /*!< ADC reference voltage source selection set to AVDD \hideinitializer */ - -#define ADC_INPUT_MODE_NORMAL_CONV 0 /*!< ADC works in normal conversion mode \hideinitializer */ -#define ADC_INPUT_MODE_4WIRE_TOUCH 1 /*!< ADC works in 4-wire touch screen mode \hideinitializer */ -#define ADC_INPUT_MODE_5WIRE_TOUCH 2 /*!< ADC works in 5-wire touch screen mode \hideinitializer */ - -/*@}*/ /* end of group ADC_EXPORTED_CONSTANTS */ - - -/** @addtogroup ADC_EXPORTED_FUNCTIONS ADC Exported Functions - @{ -*/ - -/** - * @brief Get the latest ADC conversion data - * @param[in] adc Base address of ADC module - * @param[in] u32ChNum Currently not used - * @return Latest ADC conversion data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_DATA(adc, u32ChNum) ((adc)->DATA) - -/** - * @brief Get the latest ADC conversion X data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion X data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_XDATA(adc) ((adc)->XYDATA & ADC_XYDATA_XDATA_Msk) - -/** - * @brief Get the latest ADC conversion Y data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Y data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_YDATA(adc) ((adc)->XYDATA >> ADC_XYDATA_YDATA_Pos) - -/** - * @brief Get the latest ADC conversion Z1 data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Z1 data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_Z1DATA(adc) ((adc)->ZDATA & ADC_ZDATA_Z1DATA_Msk) - -/** - * @brief Get the latest ADC conversion Z2 data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Z2 data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_Z2DATA(adc) ((adc)->ZDATA >> ADC_ZDATA_Z2DATA_Pos) - -/** - * @brief Return the user-specified interrupt flags - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return User specified interrupt flags - * \hideinitializer - */ -#define ADC_GET_INT_FLAG(adc, u32Mask) ((adc)->ISR & (u32Mask)) - -/** - * @brief This macro clear the selected interrupt status bits - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - * \hideinitializer - */ -#define ADC_CLR_INT_FLAG(adc, u32Mask) ((adc)->ISR = (u32Mask)) - -/** - * @brief Return the user-specified interrupt flags - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return User specified interrupt flags - * \hideinitializer - */ -#define ADC_GET_WKINT_FLAG(adc, u32Mask) ((adc)->WKISR & (u32Mask)) - -/** - * @brief Enable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - */ -#define ADC_ENABLE_INT(adc, u32Mask) ((adc)->IER |= u32Mask) - -/** - * @brief Disable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - */ -#define ADC_DISABLE_INT(adc, u32Mask) ((adc)->IER &= ~u32Mask) - -/** - * @brief Power down ADC module - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_POWER_DOWN(adc) ((adc)->CTL &= ~ADC_CTL_ADEN_Msk) - -/** - * @brief Power on ADC module - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_POWER_ON(adc) ((adc)->CTL |= ADC_CTL_ADEN_Msk) - - -/** - * @brief Set ADC input channel. Enabled channel will be converted while ADC starts. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Channel enable bit. Each bit corresponds to a input channel. Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @note ADC can only convert 1 channel at a time. If more than 1 channels are enabled, only channel - * with smallest number will be convert. - * \hideinitializer - */ -#define ADC_SET_INPUT_CHANNEL(adc, u32Mask) do {uint32_t u32Ch = 0, i;\ - for(i = 0; i < ADC_CH_NUM; i++) {\ - if((u32Mask) & (1 << i)) {\ - u32Ch = i;\ - break;\ - }\ - }\ - (adc)->CONF = ((adc)->CONF & ~ADC_CONF_CHSEL_Msk) | (u32Ch << ADC_CONF_CHSEL_Pos);\ - }while(0) - -/** - * @brief Start the A/D conversion. - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_START_CONV(adc) ((adc)->CTL |= ADC_CTL_MST_Msk) - -/** - * @brief Set the reference voltage selection. - * @param[in] adc Base address of ADC module - * @param[in] u32Ref The reference voltage selection. Valid values are: - * - \ref ADC_REFSEL_VREF - * - \ref ADC_REFSEL_AVDD - * @return None - * \hideinitializer - */ -#define ADC_SET_REF_VOLTAGE(adc, u32Ref) ((adc)->CONF = ((adc)->CONF & ~ADC_CONF_REFSEL_Msk) | (u32Ref)) - -/** - * @brief Set ADC to convert X/Y coordinate - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_CONVERT_XY_MODE(adc) do {(adc)->CTL &= ~ADC_CTL_PEDEEN_Msk;\ - (adc)->CONF |= ADC_CONF_TEN_Msk | ADC_CONF_ZEN_Msk;} while(0) - -/** - * @brief Set ADC to detect pen down event - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_DETECT_PD_MODE(adc) do {(adc)->CONF &= ~(ADC_CONF_TEN_Msk | ADC_CONF_ZEN_Msk);\ - (adc)->CTL |= ADC_CTL_PEDEEN_Msk;} while(0) - - -#define ADC_CONF_REFSEL_VREF (0<PSR & CANFD_PSR_ACT_Msk) >> CANFD_PSR_ACT_Pos) - - -/* CAN FD frame data field size. */ -typedef enum -{ - eCANFD_BYTE8 = 0, /*!< 8 byte data field. */ - eCANFD_BYTE12 = 1, /*!< 12 byte data field. */ - eCANFD_BYTE16 = 2, /*!< 16 byte data field. */ - eCANFD_BYTE20 = 3, /*!< 20 byte data field. */ - eCANFD_BYTE24 = 4, /*!< 24 byte data field. */ - eCANFD_BYTE32 = 5, /*!< 32 byte data field. */ - eCANFD_BYTE48 = 6, /*!< 48 byte data field. */ - eCANFD_BYTE64 = 7 /*!< 64 byte data field. */ -} E_CANFD_DATA_FIELD_SIZE; - -/* CAN FD Tx FIFO/Queue Mode. */ -typedef enum -{ - eCANFD_QUEUE_MODE = 0, /*!< Tx FIFO operation. */ - eCANFD_FIFO_MODE = 1 /*!< Tx Queue operation. */ -} E_CANFD_MODE; - -/* CAN FD Test & Bus monitor Mode. */ -typedef enum -{ - eCANFD_NORMAL = 0, /*!< None, Normal mode. */ - - /* - Support: - (1) to receive data frames - (2) to receive remote frames - (3) to give acknowledge to valid frames - Not support: - (1) data frames sending - (2) remote frames sending - (3) active error frames or overload frames sending - */ - eCANFD_RESTRICTED_OPERATION, /*!< Receive external RX frame and always keep recessive state or send dominate bit on ACK bit on TX pin. */ - - /* - Support: - (1) to receive valid data frames - (2) to receive valid remote frames - Not support: - (1) transmission start - (2) acknowledge to valid frames - */ - eCANFD_BUS_MONITOR, /*!< Receive external RX frame and always keep recessive state on TX pin. */ - - /* - Support: - (1) Loopback - (2) Also send out frames - Not support: - (1) to receive external frame - */ - eCANFD_LOOPBACK_EXTERNAL, /*!< Won't receive external RX frame. */ - /* - Support: - (1) Loopback - Not support: - (1) to receive external frame - (2) transmission start - */ - eCANFD_LOOPBACK_INTERNAL /*!< Won't receive external RX frame and always keep recessive state on TX pin */ -} E_CANFD_TEST_MODE; - -/* TX Buffer Configuration Parameters */ -typedef struct -{ - E_CANFD_DATA_FIELD_SIZE eDataFieldSize; /*!< TX Buffer Data Field Size (8byte .. 64byte) */ - E_CANFD_MODE eModeSel; /*!< select: CANFD_QUEUE_MODE/CANFD_FIFO_MODE */ - uint32_t u32ElemCnt; /*!< Elements in FIFO/Queue */ - uint32_t u32DBufNumber; /*!< Number of dedicated TX buffers */ -} CANFD_TX_BUF_CONFIG_T; - - -/* Nominal Bit Timing Parameters */ -typedef struct -{ - uint32_t u32BitRate; /*!< Transceiver baud rate in bps */ - uint16_t u16TDCOffset; /*!< Transceiver Delay Compensation Offset */ - uint16_t u16TDCFltrWin; /*!< Transceiver Delay Compensation Filter Window Length */ - uint8_t u8TDC; /*!< Transceiver Delay Compensation (1:Yes, 0:No) */ -} CANFD_NBT_CONFIG_T; - - -/* Data Bit Timing Parameters */ -typedef struct -{ - uint32_t u32BitRate; /*!< Transceiver baud rate in bps */ - uint16_t u16TDCOffset; /*!< Transceiver Delay Compensation Offset */ - uint16_t u16TDCFltrWin; /*!< Transceiver Delay Compensation Filter Window Length */ - uint8_t u8TDC; /*!< Transceiver Delay Compensation (1:Yes, 0:No) */ -} CANFD_DBT_CONFIG_T; - -/*! CAN FD protocol timing characteristic configuration structure. */ -typedef struct -{ - uint8_t u8PreDivider; /*!< Global Clock Division Factor. */ - uint16_t u16NominalPrescaler; /*!< Nominal clock prescaler. */ - uint8_t u8NominalRJumpwidth; /*!< Nominal Re-sync Jump Width. */ - uint8_t u8NominalPhaseSeg1; /*!< Nominal Phase Segment 1. */ - uint8_t u8NominalPhaseSeg2; /*!< Nominal Phase Segment 2. */ - uint8_t u8NominalPropSeg; /*!< Nominal Propagation Segment. */ - uint8_t u8DataPrescaler; /*!< Data clock prescaler. */ - uint8_t u8DataRJumpwidth; /*!< Data Re-sync Jump Width. */ - uint8_t u8DataPhaseSeg1; /*!< Data Phase Segment 1. */ - uint8_t u8DataPhaseSeg2; /*!< Data Phase Segment 2. */ - uint8_t u8DataPropSeg; /*!< Data Propagation Segment. */ - -} CANFD_TIMEING_CONFIG_T; - -/* CAN FD module configuration structure. */ -typedef struct -{ - CANFD_NBT_CONFIG_T sNormBitRate; /*!< Normal bit rate. */ - CANFD_DBT_CONFIG_T sDataBitRate; /*!< Data bit rate. */ - CANFD_TIMEING_CONFIG_T sConfigBitTing; /*!< Bit timing config*/ - uint8_t bFDEn; /*!< 1 == FD Operation enabled. */ - uint8_t bBitRateSwitch; /*!< 1 == Bit Rate Switch enabled (only evaluated in HW, if FD operation enabled). */ - E_CANFD_TEST_MODE evTestMode; /*!< See E_CANFD_TEST_MODE declaration. */ -} CANFD_FD_BT_CONFIG_T; - -/* CAN FD Message RAM Partitioning - i.e. Start Addresses (BYTE) */ -typedef struct -{ - uint32_t u32SIDFC_FLSSA; /*! EFID1), XIDAM not applied */ -} E_CANFD_XID_FLTR_ELEM_TYPE; - -/* Filter Element Configuration - Can be used for SFEC(Standard Id filter configuration) and EFEC(Extended Id filter configuration) */ -typedef enum -{ - eCANFD_FLTR_ELEM_DIS = 0x0, /*!< Filter Element Disable */ - eCANFD_FLTR_ELEM_STO_FIFO0 = 0x1, /*!< Filter Element Store In Fifo0 */ - eCANFD_FLTR_ELEM_STO_FIFO1 = 0x2, /*!< Filter Element Store In Fifo1 */ - eCANFD_FLTR_ELEM_REJ_ID = 0x3, /*!< Filter Element RejectId */ - eCANFD_FLTR_ELEM_SET_PRI = 0x4, /*!< Filter Element Set Priority */ - eCANFD_FLTR_ELEM_SET_PRI_STO_FIFO0 = 0x5, /*!< Filter Element Set Priority And Store In Fifo0 */ - eCANFD_FLTR_ELEM_SET_PRI_STO_FIFO1 = 0x6, /*!< Filter Element Set Priority And Store In Fifo1 */ - eCANFD_FLTR_ELEM_STO_RX_BUF_OR_DBG_MSG = 0x7 /*!< Filter Element Store In Rx Buf Or Debug Msg */ -} E_CANFD_FLTR_CONFIG; - -/* TX Event FIFO Element Struct */ -typedef struct -{ - E_CANFD_ID_TYPE eIdType; /*!< Standard ID or Extended ID */ - uint32_t u32Id; /*!< Standard ID (11bits) or Extended ID (29bits) */ - uint32_t u32DLC; /*!< Data Length Code used in the frame on the bus */ - uint32_t u32TxTs; /*!< Tx Timestamp */ - uint32_t u32MsgMarker; /*!< Message marker */ - uint8_t bErrStaInd; /*!< Error State Indicator */ - uint8_t bRemote; /*!< Remote transmission request */ - uint8_t bFDFormat; /*!< FD Format */ - uint8_t bBitRateSwitch; /*!< Bit Rate Switch */ -} CANFD_TX_EVNT_ELEM_T; - -#define CANFD_TIMEOUT 1000000 /* 1 second time-out */ -#define CANFD_OK ( 0L) /*!< CANFD operation OK */ -#define CANFD_ERR_FAIL (-1L) /*!< CANFD operation failed */ -#define CANFD_ERR_TIMEOUT (-2L) /*!< CANFD operation abort due to timeout error */ -#define CANFD_READ_REG_TIMEOUT (48UL) /*!< CANFD read register time-out count */ - -void CANFD_Open(CANFD_T *canfd, CANFD_FD_T *psCanfdStr); -void CANFD_Close(CANFD_T *canfd); -void CANFD_EnableInt(CANFD_T *canfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE); -void CANFD_DisableInt(CANFD_T *canfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE); -uint32_t CANFD_TransmitTxMsg(CANFD_T *canfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg); -uint32_t CANFD_TransmitDMsg(CANFD_T *canfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg); -void CANFD_SetGFC(CANFD_T *canfd, E_CANFD_ACC_NON_MATCH_FRM eNMStdFrm, E_CANFD_ACC_NON_MATCH_FRM eEMExtFrm, uint32_t u32RejRmtStdFrm, uint32_t u32RejRmtExtFrm); -void CANFD_SetSIDFltr(CANFD_T *canfd, uint32_t u32FltrIdx, uint32_t u32Filter); -void CANFD_SetXIDFltr(CANFD_T *canfd, uint32_t u32FltrIdx, uint32_t u32FilterLow, uint32_t u32FilterHigh); -uint32_t CANFD_ReadRxBufMsg(CANFD_T *canfd, uint8_t u8MbIdx, CANFD_FD_MSG_T *psMsgBuf); -uint32_t CANFD_ReadRxFifoMsg(CANFD_T *canfd, uint8_t u8FifoIdx, CANFD_FD_MSG_T *psMsgBuf); -void CANFD_CopyDBufToMsgBuf(CANFD_BUF_T *psRxBuffer, CANFD_FD_MSG_T *psMsgBuf); -void CANFD_CopyRxFifoToMsgBuf(CANFD_BUF_T *psRxBuf, CANFD_FD_MSG_T *psMsgBuf); -uint32_t CANFD_GetRxFifoWaterLvl(CANFD_T *canfd, uint32_t u32RxFifoNum); -void CANFD_TxBufCancelReq(CANFD_T *canfd, uint32_t u32TxBufIdx); -uint32_t CANFD_IsTxBufCancelFin(CANFD_T *canfd, uint32_t u32TxBufIdx); -uint32_t CANFD_IsTxBufTransmitOccur(CANFD_T *canfd, uint32_t u32TxBufIdx); -uint32_t CANFD_GetTxEvntFifoWaterLvl(CANFD_T *canfd); -void CANFD_CopyTxEvntFifoToUsrBuf(CANFD_T *canfd, uint32_t u32TxEvntNum, CANFD_TX_EVNT_ELEM_T *psTxEvntElem); -void CANFD_GetBusErrCount(CANFD_T *canfd, uint8_t *pu8TxErrBuf, uint8_t *pu8RxErrBuf); -int32_t CANFD_RunToNormal(CANFD_T *canfd, uint8_t u8Enable); -void CANFD_GetDefaultConfig(CANFD_FD_T *psConfig, uint8_t u8OpMode); -void CANFD_ClearStatusFlag(CANFD_T *canfd, uint32_t u32InterruptFlag); -uint32_t CANFD_GetStatusFlag(CANFD_T *canfd, uint32_t u32IntTypeFlag); -uint32_t CANFD_ReadReg(__I uint32_t *pu32RegAddr); - -/*@}*/ /* end of group CANFD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CANFD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __NU_CANFD_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ccap.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ccap.h deleted file mode 100644 index 5b885b77d77..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ccap.h +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************//** - * @file nu_ccap.h - * @version V3.00 - * @brief M460 Series CCAP Driver Header File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CCAP_H__ -#define __NU_CCAP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CCAP_Driver CCAP Driver - @{ -*/ - -/** @addtogroup CCAP_EXPORTED_CONSTANTS CCAP Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CCAP_CTL_CCAPEN (1ul<CTL & CCAP_CTL_CCAPEN_Msk)?0:1) - -/** - * @brief Clear CCAP flag - * - * @param[in] u32IntMask interrupt flags settings. It could be - * - \ref CCAP_INT_VINTF_Msk - * - \ref CCAP_INT_MEINTF_Msk - * - \ref CCAP_INT_ADDRMINTF_Msk - * - \ref CCAP_INT_MDINTF_Msk - * - * @return None - * - * @details Clear Camera Capture Interface interrupt flag - * \hideinitializer - */ -#define CCAP_CLR_INT_FLAG(ccap, u32IntMask) (ccap->INT |= (u32IntMask)) - -/** - * @brief Get CCAP Interrupt status - * - * @param None - * - * @return CCAP Interrupt Register - * - * @details Get Camera Capture Interface interrupt status. - * \hideinitializer - */ -#define CCAP_GET_INT_STS(ccap) (ccap->INT) - -#define CCAP_SET_CTL(ccap, u32IntMask) (ccap->CTL |= u32IntMask) -#define CCAP_CLR_CTL(ccap, u32IntMask) (ccap->CTL &= ~u32IntMask) - -void CCAP_Open(CCAP_T *ccap, uint32_t u32InFormat, uint32_t u32OutFormat); -void CCAP_SetCroppingWindow(CCAP_T *ccap, uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width); -void CCAP_SetPacketBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_Close(CCAP_T *ccap); -void CCAP_EnableInt(CCAP_T *ccap, uint32_t u32IntMask); -void CCAP_DisableInt(CCAP_T *ccap, uint32_t u32IntMask); -void CCAP_Start(CCAP_T *ccap); -void CCAP_Stop(CCAP_T *ccap, uint32_t u32FrameComplete); -void CCAP_SetPacketScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator); -void CCAP_SetPacketStride(CCAP_T *ccap, uint32_t u32Stride); -void CCAP_EnableMono(CCAP_T *ccap, uint32_t u32Interface); -void CCAP_DisableMono(CCAP_T *ccap); -void CCAP_EnableLumaYOne(CCAP_T *ccap, uint32_t u32th); -void CCAP_DisableLumaYOne(CCAP_T *ccap); - -void CCAP_SetPlanarYBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_SetPlanarUBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_SetPlanarVBuf(CCAP_T *ccap, uint32_t u32Address); -void CCAP_SetPlanarScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator); -void CCAP_SetPlanarStride(CCAP_T *ccap, uint32_t u32Stride); - - -/*@}*/ /* end of group CCAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CCAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_CCAP_H__ diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_clk.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_clk.h deleted file mode 100644 index ac5f0ce84eb..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_clk.h +++ /dev/null @@ -1,622 +0,0 @@ -/**************************************************************************//** - * @file CLK.h - * @brief CLK Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CLK_H__ -#define __NU_CLK_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_CONSTANTS CLK Exported Constants - @{ -*/ - - -#define FREQ_180MHZ 180000000UL /*!< 180 MHz \hideinitializer */ - -#define CAPLL (0x0UL) -#define SYSPLL (0x1UL) -#define DDRPLL (0x2UL) -#define APLL (0x3UL) -#define EPLL (0x4UL) -#define VPLL (0x5UL) - -#define PLL_OPMODE_INTEGER (0x0UL) -#define PLL_OPMODE_FRACTIONAL (0x1UL) -#define PLL_OPMODE_SPREAD_SPECTRUM (0x2UL) -/*---------------------------------------------------------------------------------------------------------*/ -/* CLKSEL0 constant definitions. (Write-protection) */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CLK_CLKSEL0_CA35CKSEL_HXT (0x0UL<>29) & 0x7UL) /*!< Calculate SYSCLK/APBCLK offset on MODULE index, 0x0:SYSCLK0, 0x1:SYSCLK1, 0x2:APBCLK0, 0x3:APBCLK1, 0x4:APBCLK2 \hideinitializer */ -#define MODULE_CLKSEL(x) (((x) >>26) & 0x7UL) /*!< Calculate CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3, 0x4:CLKSEL4 \hideinitializer */ -#define MODULE_CLKSEL_Msk(x) (((x) >>22) & 0xfUL) /*!< Calculate CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos(x) (((x) >>17) & 0x1fUL) /*!< Calculate CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV(x) (((x) >>14) & 0x7UL) /*!< Calculate APBCLK CLKDIV on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV2, 0x3:CLKDIV3, 0x4:CLKDIV4 \hideinitializer */ -#define MODULE_CLKDIV_Msk(x) (((x) >>10) & 0xfUL) /*!< Calculate CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos(x) (((x) >>5 ) & 0x1fUL) /*!< Calculate CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos(x) (((x) >>0 ) & 0x1fUL) /*!< Calculate APBCLK offset on MODULE index \hideinitializer */ -#define MODULE_NoMsk 0x0UL /*!< Not mask on MODULE index \hideinitializer */ -#define NA MODULE_NoMsk /*!< Not Available \hideinitializer */ - -#define MODULE_APBCLK_ENC(x) (((x) & 0x07UL) << 29) /*!< MODULE index, 0x0:SYSCLK0, 0x1:SYSCLK1, 0x2:APBCLK0, 0x3:APBCLK1, 0x4:APBCLK2 \hideinitializer */ -#define MODULE_CLKSEL_ENC(x) (((x) & 0x07UL) << 26) /*!< CLKSEL offset on MODULE index, 0x0:CLKSEL0, 0x1:CLKSEL1, 0x2:CLKSEL2, 0x3:CLKSEL3, 0x4:CLKSEL4 \hideinitializer */ -#define MODULE_CLKSEL_Msk_ENC(x) (((x) & 0x0fUL) << 22) /*!< CLKSEL mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKSEL_Pos_ENC(x) (((x) & 0x1fUL) << 17) /*!< CLKSEL position offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_ENC(x) (((x) & 0x07UL) << 14) /*!< APBCLK CLKDIV on MODULE index, 0x0:CLKDIV0, 0x1:CLKDIV1, 0x2:CLKDIV2, 0x3:CLKDIV3, 0x4:CLKDIV4 \hideinitializer */ -#define MODULE_CLKDIV_Msk_ENC(x) (((x) & 0x0fUL) << 10) /*!< CLKDIV mask offset on MODULE index \hideinitializer */ -#define MODULE_CLKDIV_Pos_ENC(x) (((x) & 0x1fUL) << 5 ) /*!< CLKDIV position offset on MODULE index \hideinitializer */ -#define MODULE_IP_EN_Pos_ENC(x) (((x) & 0x1fUL) << 0 ) /*!< AHBCLK/APBCLK offset on MODULE index \hideinitializer */ - -#define PDMA0_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(0UL<<0)) /*!< PDMA0 Module \hideinitializer */ -#define PDMA1_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(1UL<<0)) /*!< PDMA1 Module \hideinitializer */ -#define PDMA2_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(2UL<<0)) /*!< PDMA2 Module \hideinitializer */ -#define PDMA3_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(3UL<<0)) /*!< PDMA3 Module \hideinitializer */ -#define WHC0_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(4UL<<0)) /*!< WH0 Module \hideinitializer */ -#define WHC1_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(5UL<<0)) /*!< WH1 Module \hideinitializer */ -#define HWSEM0_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(6UL<<0)) /*!< HWS Module \hideinitializer */ -#define EBI_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(7UL<<0)) /*!< EBI Module \hideinitializer */ -#define SRAM0_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(8UL<<0)) /*!< SRAM0 Module \hideinitializer */ -#define SRAM1_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(9UL<<0)) /*!< SRAM1 Module \hideinitializer */ -#define ROM_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(10UL<<0)) /*!< ROM Module \hideinitializer */ -#define TRA_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(11UL<<0)) /*!< TRA Module \hideinitializer */ -#define DBG_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(12UL<<0)) /*!< DBG Module \hideinitializer */ -#define CLKO_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(13UL<<0)) /*!< CLKO Module \hideinitializer */ -#define GTMR_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(14UL<<0)) /*!< GTMR Module \hideinitializer */ -#define GPA_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(16UL<<0)) /*!< GPA Module \hideinitializer */ -#define GPB_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(17UL<<0)) /*!< GPB Module \hideinitializer */ -#define GPC_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(18UL<<0)) /*!< GPC Module \hideinitializer */ -#define GPD_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(19UL<<0)) /*!< GPD Module \hideinitializer */ -#define GPE_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(20UL<<0)) /*!< GPE Module \hideinitializer */ -#define GPF_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(21UL<<0)) /*!< GPF Module \hideinitializer */ -#define GPG_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(22UL<<0)) /*!< GPG Module \hideinitializer */ -#define GPH_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(23UL<<0)) /*!< GPH Module \hideinitializer */ -#define GPI_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(24UL<<0)) /*!< GPI Module \hideinitializer */ -#define GPJ_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(25UL<<0)) /*!< GPJ Module \hideinitializer */ -#define GPK_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(26UL<<0)) /*!< GPK Module \hideinitializer */ -#define GPL_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(27UL<<0)) /*!< GPL Module \hideinitializer */ -#define GPM_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(28UL<<0)) /*!< GPM Module \hideinitializer */ -#define GPN_MODULE ((1UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(29UL<<0)) /*!< GPN Module \hideinitializer */ -#define CA35_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(0UL<<0)) /*!< CA35 Module \hideinitializer */ -#define RTP_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(1UL<<0)) /*!< RTP Module \hideinitializer */ -#define TAHB_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(2UL<<0)) /*!< TAHB Module \hideinitializer */ -#define LVRDB_MODULE ((0UL<<29)|(0UL<<26) |(0x1UL<<22) |(3UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(3UL<<0)) /*!< LVRDB Module \hideinitializer */ -#define DDR0_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(4UL<<0)) /*!< DDR0 Module \hideinitializer */ -#define DDR6_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(5UL<<0)) /*!< DDR6 Module \hideinitializer */ -#define CANFD0_MODULE ((0UL<<29)|(4<<26)|(1<<22)|(16<<17)|(0<<14)|(7<<10)|(0<<5)|(8UL<<0)) /*!< CANFD0 Module \hideinitializer */ -#define CANFD1_MODULE ((0UL<<29)|(4<<26)|(1<<22)|(17<<17)|(0<<14)|(7<<10)|(4<<5)|(9UL<<0)) /*!< CANFD1 Module \hideinitializer */ -#define CANFD2_MODULE ((0UL<<29)|(4<<26)|(1<<22)|(18<<17)|(0<<14)|(7<<10)|(8<<5)|(10UL<<0)) /*!< CANFD2 Module \hideinitializer */ -#define CANFD3_MODULE ((0UL<<29)|(4<<26)|(1<<22)|(19<<17)|(0<<14)|(7<<10)|(12<<5)|(11UL<<0)) /*!< CANFD3 Module \hideinitializer */ -#define SDH0_MODULE ((0UL<<29)|(0UL<<26) |(0x3UL<<22) |(0x10UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(16UL<<0)) /*!< SDH0 Module */ -#define SDH1_MODULE ((0UL<<29)|(0UL<<26) |(0x3UL<<22) |(0x12UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(17UL<<0)) /*!< SDH1 Module */ -#define NAND_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(18UL<<0)) /*!< NAND Module \hideinitializer */ -#define USBD_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(19UL<<0)) /*!< USBD Module \hideinitializer */ -#define USBH_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(20UL<<0)) /*!< USBH Module \hideinitializer */ -#define HUSBH0_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(21UL<<0)) /*!< HUSBH0 Module \hideinitializer */ -#define HUSBH1_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(22UL<<0)) /*!< HUSBH1 Module \hideinitializer */ -#define GFX_MODULE ((0UL<<29)|(0UL<<26) |(0x1UL<<22) |(26UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(24UL<<0)) /*!< GFX Module \hideinitializer */ -#define VDEC_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(25UL<<0)) /*!< VDEC Module \hideinitializer */ -#define DCU_MODULE ((0UL<<29)|(0UL<<26) |(0x1UL<<22) |(24UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(26UL<<0)) /*!< DCU Module \hideinitializer */ -#define GMAC0_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(0UL<<14) |(0x3UL<<10) |(28UL<<5) |(27UL<<0)) /*!< GMAC0 Module \hideinitializer */ -#define GMAC1_MODULE ((0UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(0UL<<14) |(0x3UL<<10) |(30UL<<5) |(28UL<<0)) /*!< GMAC1 Module \hideinitializer */ -#define CCAP0_MODULE ((0UL<<29)|(0UL<<26) |(0x3UL<<22) |(12UL<<17) |(1UL<<14) |(0xFUL<<10) |(8UL<<5) |(29UL<<0)) /*!< CCAP0 Module \hideinitializer */ -#define CCAP1_MODULE ((0UL<<29)|(0UL<<26) |(0x3UL<<22) |(14UL<<17) |(1UL<<14) |(0xFUL<<10) |(12UL<<5) |(30UL<<0)) /*!< CCAP1 Module \hideinitializer */ -#define TMR0_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(0UL<<0)) /*!< TMR0 Module \hideinitializer */ -#define TMR1_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(1UL<<0)) /*!< TMR1 Module \hideinitializer */ -#define TMR2_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(2UL<<0)) /*!< TMR2 Module \hideinitializer */ -#define TMR3_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(3UL<<0)) /*!< TMR3 Module \hideinitializer */ -#define TMR4_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(4UL<<0)) /*!< TMR4 Module \hideinitializer */ -#define TMR5_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(5UL<<0)) /*!< TMR5 Module \hideinitializer */ -#define TMR6_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(6UL<<0)) /*!< TMR6 Module \hideinitializer */ -#define TMR7_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(7UL<<0)) /*!< TMR7 Module \hideinitializer */ -#define TMR8_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(8UL<<0)) /*!< TMR8 Module \hideinitializer */ -#define TMR9_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(9UL<<0)) /*!< TMR9 Module \hideinitializer */ -#define TMR10_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(10UL<<0)) /*!< TMR10 Module \hideinitializer */ -#define TMR11_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(11UL<<0)) /*!< TMR11 Module \hideinitializer */ -#define UART0_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(12UL<<0)) /*!< UART0 Module \hideinitializer */ -#define UART1_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(13UL<<0)) /*!< UART1 Module \hideinitializer */ -#define UART2_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(14UL<<0)) /*!< UART2 Module \hideinitializer */ -#define UART3_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(15UL<<0)) /*!< UART3 Module \hideinitializer */ -#define UART4_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(16UL<<0)) /*!< UART4 Module \hideinitializer */ -#define UART5_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(17UL<<0)) /*!< UART5 Module \hideinitializer */ -#define UART6_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(18UL<<0)) /*!< UART6 Module \hideinitializer */ -#define UART7_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(19UL<<0)) /*!< UART7 Module \hideinitializer */ -#define UART8_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(20UL<<0)) /*!< UART8 Module \hideinitializer */ -#define UART9_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(21UL<<0)) /*!< UART9 Module \hideinitializer */ -#define UART10_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(22UL<<0)) /*!< UART10 Module \hideinitializer */ -#define UART11_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(23UL<<0)) /*!< UART11 Module \hideinitializer */ -#define UART12_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(24UL<<0)) /*!< UART12 Module \hideinitializer */ -#define UART13_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(25UL<<0)) /*!< UART13 Module \hideinitializer */ -#define UART14_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(26UL<<0)) /*!< UART14 Module \hideinitializer */ -#define UART15_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(27UL<<0)) /*!< UART15 Module \hideinitializer */ -#define UART16_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(28UL<<0)) /*!< UART16 Module \hideinitializer */ -#define RTC_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(29UL<<0)) /*!< RTC Module \hideinitializer */ -#define DDRP_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(30UL<<0)) /*!< DDRP Module \hideinitializer */ -#define KPI_MODULE ((2UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(31UL<<0)) /*!< KPI Module \hideinitializer */ -#define I2C0_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(0UL<<0)) /*!< I2C0 Module \hideinitializer */ -#define I2C1_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(1UL<<0)) /*!< I2C1 Module \hideinitializer */ -#define I2C2_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(2UL<<0)) /*!< I2C2 Module \hideinitializer */ -#define I2C3_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(3UL<<0)) /*!< I2C3 Module \hideinitializer */ -#define I2C4_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(4UL<<0)) /*!< I2C4 Module \hideinitializer */ -#define I2C5_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(5UL<<0)) /*!< I2C5 Module \hideinitializer */ -#define QSPI0_MODULE ((3UL<<29)|(4UL<<26) |(0x3UL<<22) |(8UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(6UL<<0)) /*!< QSPI0 Module \hideinitializer */ -#define QSPI1_MODULE ((3UL<<29)|(4UL<<26) |(0x3UL<<22) |(10UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(7UL<<0)) /*!< QSPI1 Module \hideinitializer */ -#define SC0_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(12UL<<0)) /*!< SC0 Module \hideinitializer */ -#define SC1_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(13UL<<0)) /*!< SC1 Module \hideinitializer */ -#define WDT0_MODULE ((3UL<<29)|(3UL<<26) |(0x3UL<<22) |(20UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(16UL<<0)) /*!< WDT0 Module \hideinitializer */ -#define WDT1_MODULE ((3UL<<29)|(3UL<<26) |(0x3UL<<22) |(24UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(17UL<<0)) /*!< WDT1 Module \hideinitializer */ -#define WDT2_MODULE ((3UL<<29)|(3UL<<26) |(0x3UL<<22) |(28UL<<17) |(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(18UL<<0)) /*!< WDT2 Module \hideinitializer */ -#define EPWM0_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(24UL<<0)) /*!< EPWM0 Module \hideinitializer */ -#define EPWM1_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(25UL<<0)) /*!< EPWM1 Module \hideinitializer */ -#define EPWM2_MODULE ((3UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(26UL<<0)) /*!< EPWM2 Module \hideinitializer */ -#define I2S0_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(0UL<<0)) /*!< I2S0 Module \hideinitializer */ -#define I2S1_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(1UL<<0)) /*!< I2S1 Module \hideinitializer */ -#define SSMCC_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(2UL<<0)) /*!< SSMCC Module \hideinitializer */ -#define SSPCC_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(3UL<<0)) /*!< SSPCC Module \hideinitializer */ -#define SPI0_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(4UL<<0)) /*!< SPI0 Module \hideinitializer */ -#define SPI1_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(5UL<<0)) /*!< SPI1 Module \hideinitializer */ -#define SPI2_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(6UL<<0)) /*!< SPI2 Module \hideinitializer */ -#define SPI3_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(7UL<<0)) /*!< SPI3 Module \hideinitializer */ -#define ECAP0_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(8UL<<0)) /*!< ECAP0 Module \hideinitializer */ -#define ECAP1_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(9UL<<0)) /*!< ECAP1 Module \hideinitializer */ -#define ECAP2_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(10UL<<0)) /*!< ECAP2 Module \hideinitializer */ -#define QEI0_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(12UL<<0)) /*!< QEI0 Module \hideinitializer */ -#define QEI1_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(13UL<<0)) /*!< QEI1 Module \hideinitializer */ -#define QEI2_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(14UL<<0)) /*!< QEI2 Module \hideinitializer */ -#define ADC_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(24UL<<0)) /*!< ADCModule \hideinitializer */ -#define EADC0_MODULE ((4UL<<29)|(MODULE_NoMsk<<26)|(MODULE_NoMsk<<22)|(MODULE_NoMsk<<17)|(MODULE_NoMsk<<14)|(MODULE_NoMsk<<10)|(MODULE_NoMsk<<5)|(25UL<<0)) /*!< EADC0 Module \hideinitializer */ - -/*@}*/ /* end of group CLK_EXPORTED_CONSTANTS */ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ - - -#if defined (USE_MA35D1_SUBM) -/*---------------------------------------------------------------------------------------------------------*/ -/* static inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void CLK_SysTickDelay(uint32_t us); -__STATIC_INLINE void CLK_SysTickLongDelay(uint32_t us); - -/** - * @brief This function execute delay function. - * @param[in] us Delay time. The Max value is 2^24 / CPU Clock(MHz). Ex: - * 72MHz => 233016us, 50MHz => 335544us, - * 48MHz => 349525us, 28MHz => 699050us ... - * @return None - * @details Use the SysTick to generate the delay time and the unit is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - */ -__STATIC_INLINE void CLK_SysTickDelay(uint32_t us) -{ - SysTick->LOAD = us * CyclesPerUs; - SysTick->VAL = 0x0UL; - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0UL) - { - } - - /* Disable SysTick counter */ - SysTick->CTRL = 0UL; -} - -/** - * @brief This function execute long delay function. - * @param[in] us Delay time. - * @return None - * @details Use the SysTick to generate the long delay time and the UNIT is in us. - * The SysTick clock source is from HCLK, i.e the same as system core clock. - * User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function. - */ -__STATIC_INLINE void CLK_SysTickLongDelay(uint32_t us) -{ - uint32_t delay; - - /* It should <= 349525us for each delay loop */ - delay = 349525UL; - - do - { - if (us > delay) - { - us -= delay; - } - else - { - delay = us; - us = 0UL; - } - - SysTick->LOAD = delay * CyclesPerUs; - SysTick->VAL = (0x0UL); - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; - - /* Waiting for down-count to zero */ - while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0UL); - - /* Disable SysTick counter */ - SysTick->CTRL = 0UL; - - } - while (us > 0UL); - -} -#else -void SystemCoreClockUpdate(void); -#endif - -__STATIC_INLINE void CLK_SetPLLPowerDown(uint32_t u32PllIdx) -{ - CLK->PLL[u32PllIdx].CTL1 |= CLK_PLLnCTL1_PD_Msk; -} - -void CLK_DisableCKO(void); -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En); -void CLK_PowerDown(void); -uint32_t CLK_GetHXTFreq(void); -uint32_t CLK_GetLXTFreq(void); -uint32_t CLK_GetSYSCLK0Freq(void); -uint32_t CLK_GetSYSCLK1Freq(void); -uint32_t CLK_GetPCLK3Freq(void); -uint32_t CLK_GetCPUFreq(void); -uint32_t CLK_SetCoreClock(uint32_t u32Hclk); -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv); -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc); -void CLK_EnableXtalRC(uint32_t u32ClkMask); -void CLK_DisableXtalRC(uint32_t u32ClkMask); -void CLK_EnableModuleClock(uint32_t u32ModuleIdx); -void CLK_DisableModuleClock(uint32_t u32ModuleIdx); -void CLK_DisablePLL(uint32_t u32PllIdx); -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask); -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count); -void CLK_DisableSysTick(void); -uint32_t CLK_GetCAPLLClockFreq(void); -uint32_t CLK_GetPLLClockFreq(uint32_t u32PllIdx); -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx); -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx); -uint32_t CLK_GetCAPLLClockFreq(void); -uint64_t CLK_SetPLLFreq(uint32_t u32PllIdx, uint32_t u32OpMode, uint64_t PllSrcClk, uint64_t u64PllFreq); -uint32_t CLK_GetPLLClockFreq(uint32_t u32PllIdx); -uint32_t CLK_GetPLLOpMode(uint32_t u32PllIdx); - -#define CLK_GetPCLK0Freq() CLK_GetSYSCLK1Freq() -#define CLK_GetPCLK1Freq() CLK_GetSYSCLK1Freq() -#define CLK_GetPCLK2Freq() CLK_GetSYSCLK1Freq() -#define CLK_GetPCLK3Freq() (CLK_GetSYSCLK1Freq() / 2) -#define CLK_GetPCLK4Freq() (CLK_GetSYSCLK1Freq() / 2) - -#define CLK_GetHCLK0Freq() CLK_GetSYSCLK1Freq() -#define CLK_GetHCLK1Freq() CLK_GetSYSCLK1Freq() -#define CLK_GetHCLK2Freq() CLK_GetSYSCLK1Freq() -#define CLK_GetHCLK3Freq() (CLK_GetSYSCLK1Freq() / 2) - -#define CLK_GetCA35CPUFreq CLK_GetCAPLLClockFreq - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CLK_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_disp.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_disp.h deleted file mode 100644 index 2c9ae7327b3..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_disp.h +++ /dev/null @@ -1,206 +0,0 @@ -/**************************************************************************//** - * @file nu_disp.h - * @brief DISP driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_DISP_H__ -#define __NU_DISP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DISP_Driver DISP Driver - @{ -*/ - -/** @addtogroup DISP_EXPORTED_CONSTANTS DISP Exported Constants - @{ -*/ - -typedef enum -{ - eDispLcd_1024x600 = 0, - eDispLcd_800x480 = 1, - eDispLcd_1920x1080 = 2, - eDispLcd_Cnt -} E_DISP_LCD; - - -typedef enum -{ - ePolarity_Disable = -1, - ePolarity_Positive = 0, - ePolarity_Negative = 1 -} E_POLARITY; - -typedef enum -{ - eDPIFmt_D16CFG1, - eDPIFmt_D16CFG2, - eDPIFmt_D16CFG3, - eDPIFmt_D18CFG1, - eDPIFmt_D18CFG2, - eDPIFmt_D24 -} E_DPI_DATA_FMT; - -typedef enum -{ - eLayer_Video = 0, - eLayer_Overlay = 1, - eLayer_Cnt -} E_DISP_LAYER; - -typedef enum -{ - eYUV_709_BT709 = 1, - eYUV_2020_BT2020 = 3, -} E_YUV_STANDARD; - -typedef enum -{ - eFBFmt_X4R4G4B4 = 0, - eFBFmt_A4R4G4B4 = 1, - eFBFmt_X1R5G5B5 = 2, - eFBFmt_A1R5G5B5 = 3, - eFBFmt_R5G6B5 = 4, - eFBFmt_X8R8G8B8 = 5, - eFBFmt_A8R8G8B8 = 6, - eFBFmt_YUY2 = 7, - eFBFmt_UYVY = 8, - eFBFmt_INDEX8 = 9, - eFBFmt_MONOCHROME = 10, - eFBFmt_YV12 = 15, - eFBFmt_A8 = 16, - eFBFmt_NV12 = 17, - eFBFmt_NV16 = 18, - eFBFmt_RG16 = 19, - eFBFmt_R8 = 20, - eFBFmt_NV12_10BIT = 21, - eFBFmt_A2R10G10B10 = 22, - eFBFmt_NV16_10BIT = 23, - eFBFmt_INDEX1 = 24, - eFBFmt_INDEX2 = 25, - eFBFmt_INDEX4 = 26, - eFBFmt_P010 = 27, - eFBFmt_NV12_10BIT_L1 = 28, - eFBFmt_NV16_10BIT_L1 = 29 -} E_FB_FMT; - -typedef enum -{ - eOPAQUE, - eMASK, - eKEY -} E_TRANSPARENCY_MODE; - -typedef enum -{ - DC_BLEND_MODE_CLEAR, - DC_BLEND_MODE_SRC, - DC_BLEND_MODE_DST, - DC_BLEND_MODE_SRC_OVER, - DC_BLEND_MODE_DST_OVER, - DC_BLEND_MODE_SRC_IN, - DC_BLEND_MODE_DST_IN, - DC_BLEND_MODE_SRC_OUT -} E_DC_BLEND_MODE; - -typedef enum -{ - eGloAM_NORMAL, - eGloAM_GLOBAL, - eGloAM_SCALED -} E_GLOBAL_ALPHA_MODE; - - -typedef enum -{ - eBM_ZERO, - eBM_ONE, - eBM_NORMAL, - eBM_INVERSED, - eBM_COLOR, - eBM_COLOR_INVERSED, - eBM_SATURATED_ALPHA, - eBM_SATURATED_DEST_ALPHA -} E_BLENDING_MODE; - -typedef struct -{ - /* - htotal: u32HA + u32HBP + u32HFP + u32HSL - vtotal: u32VA + u32VBP + u32VFP + u32VSL - clock-frequency: htotal * vtotal * fps - */ - uint32_t u32PCF; // Pixel Clock Frequency - - uint32_t u32HA; // Horizontal Active - uint32_t u32HSL; // Horizontal Sync Length - uint32_t u32HFP; // Horizontal Front Porch - uint32_t u32HBP; // Horizontal Back Porch - uint32_t u32VA; // Vertical Active - uint32_t u32VSL; // Vertical Sync Len - uint32_t u32VFP; // Vertical Front Porch - uint32_t u32VBP; // Vertical Back Porch - - E_POLARITY eHSPP; // HSync Pulse Polarity - E_POLARITY eVSPP; // VSync Pulse Polarity - -} DISP_LCD_TIMING; - -typedef struct -{ - E_DPI_DATA_FMT eDpiFmt; // DPI Data Format - E_POLARITY eDEP; // DE Polarity - E_POLARITY eDP; // DATA Polarity - E_POLARITY eCP; // CLOCK Polarity -} DISP_PANEL_CONF; - -typedef struct -{ - uint32_t u32ResolutionWidth; - uint32_t u32ResolutionHeight; - DISP_LCD_TIMING sLcdTiming; - DISP_PANEL_CONF sPanelConf; -} DISP_LCD_INFO; - -#define DISP_ENABLE_INT() (DISP->DisplayIntrEnable |= DISP_DisplayIntrEnable_DISP0_Msk) -#define DISP_DISABLE_INT() (DISP->DisplayIntrEnable &= ~DISP_DisplayIntrEnable_DISP0_Msk) -#define DISP_GET_INTSTS() (DISP->DisplayIntr & DISP_DisplayIntr_DISP0_Msk) - -const DISP_LCD_INFO *DISP_GetLCDInst(E_DISP_LCD eDispLcd); -int32_t DISP_LCDInit(const DISP_LCD_INFO *psLCDInfo); -int32_t DISP_LCDDeinit(void); -int DISP_SetFBConfig(E_DISP_LAYER eLayer, E_FB_FMT eFbFmt, uint32_t u32ResWidth, uint32_t u32ResHeight, uint32_t u32DMAFBStartAddr); -void DISP_SetPanelConf(DISP_PANEL_CONF *psPanelConf); -void DISP_SetTiming(DISP_LCD_TIMING *psLCDTiming); -int DISP_Trigger(E_DISP_LAYER eLayer, uint32_t u32Action); -int DISP_SetTransparencyMode(E_DISP_LAYER eLayer, E_TRANSPARENCY_MODE eTM); -int DISP_SetBlendOpMode(E_DC_BLEND_MODE eDCBM, E_GLOBAL_ALPHA_MODE eGloAM_Src, E_GLOBAL_ALPHA_MODE eGloAM_Dst); -void DISP_SetBlendValue(uint32_t u32GloAV_Src, uint32_t u32GloAV_Dst); -void DISP_SetColorKeyValue(uint32_t u32ColorKeyLow, uint32_t u32ColorKeyHigh); -int DISP_SetFBAddr(E_DISP_LAYER eLayer, uint32_t u32DMAFBStartAddr); -int DISP_SetFBFmt(E_DISP_LAYER eLayer, E_FB_FMT eFbFmt, uint32_t u32Pitch); -uint32_t DISP_LCDTIMING_GetFPS(const DISP_LCD_TIMING* psDispLCDTiming); - -/*@}*/ /* end of group DISP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group DISP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_DISP_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_eadc.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_eadc.h deleted file mode 100644 index a25919e2d1e..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_eadc.h +++ /dev/null @@ -1,630 +0,0 @@ -/**************************************************************************//** - * @file nu_eadc.h - * @brief EADC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EADC_H__ -#define __NU_EADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_CONSTANTS EADC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* EADC_CTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EADC_CTL_DIFFEN_SINGLE_END (0UL<CTL |= EADC_CTL_ADCRST_Msk) - -/** - * @brief Enable PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details When A/D conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, - * user can enable this bit to generate a PDMA data transfer request. - * @note When set PDMAEN bit (EADC_CTL[11]), user must set ADINTENn (EADC_CTL[5:2], n=0~3) = 0 to disable interrupt. - * \hideinitializer - */ -#define EADC_ENABLE_PDMA(eadc) ((eadc)->CTL |= EADC_CTL_PDMAEN_Msk) - -/** - * @brief Disable PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable PDMA transfer. - * \hideinitializer - */ -#define EADC_DISABLE_PDMA(eadc) ((eadc)->CTL &= (~EADC_CTL_PDMAEN_Msk)) - -/** - * @brief Enable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details When A/D conversion is completed, the converted data is loaded into EADC_DATn (n: 0 ~ 18) register, - * user can enable this bit to generate a PDMA data transfer request. - * \hideinitializer - */ -#define EADC_ENABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL |= u32ModuleMask) - -/** - * @brief Disable Sample Module PDMA transfer. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details This macro is used to disable sample module PDMA transfer. - * \hideinitializer - */ -#define EADC_DISABLE_SAMPLE_MODULE_PDMA(eadc, u32ModuleMask) ((eadc)->PDMACTL &= (~u32ModuleMask)) - -/** - * @brief Enable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details The ADC controller supports a double buffer mode in sample module 0~3. - * If user enable DBMEN (EADC_SCTLn[23], n=0~3), the double buffer mode will enable. - * \hideinitializer - */ -#define EADC_ENABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_DBMEN_Msk) - -/** - * @brief Disable double buffer mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 3. - * @return None - * @details Sample has one sample result register. - * \hideinitializer - */ -#define EADC_DISABLE_DOUBLE_BUFFER(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_DBMEN_Msk) - -/** - * @brief Set ADIFn at A/D end of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the start of conversion. - * \hideinitializer - */ -#define EADC_ENABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] |= EADC_SCTL_INTPOS_Msk) - -/** - * @brief Set ADIFn at A/D start of conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @return None - * @details The A/D converter generates ADIFn (EADC_STATUS2[3:0], n=0~3) at the end of conversion. - * \hideinitializer - */ -#define EADC_DISABLE_INT_POSITION(eadc, u32ModuleNum) ((eadc)->SCTL[(u32ModuleNum)] &= ~EADC_SCTL_INTPOS_Msk) - -/** - * @brief Enable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be enabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details The A/D converter generates a conversion end ADIFn (EADC_STATUS2[n]) upon the end of specific sample module A/D conversion. - * If ADCIENn bit (EADC_CTL[n+2]) is set then conversion end interrupt request ADINTn is generated (n=0~3). - * \hideinitializer - */ -#define EADC_ENABLE_INT(eadc, u32Mask) ((eadc)->CTL |= ((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Disable the interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask Decides the combination of interrupt status bits. Each bit corresponds to a interrupt status. - * This parameter decides which interrupts will be disabled. Bit 0 is ADCIEN0, bit 1 is ADCIEN1..., bit 3 is ADCIEN3. - * @return None - * @details Specific sample module A/D ADINT0 interrupt function Disabled. - * \hideinitializer - */ -#define EADC_DISABLE_INT(eadc, u32Mask) ((eadc)->CTL &= ~((u32Mask) << EADC_CTL_ADCIEN0_Pos)) - -/** - * @brief Enable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be enabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 ADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - * \hideinitializer - */ -#define EADC_ENABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] |= (u32ModuleMask)) - -/** - * @brief Disable the sample module interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32IntSel Decides which interrupt source will be used, valid value are from 0 to 3. - * @param[in] u32ModuleMask the combination of sample module interrupt status bits. Each bit corresponds to a sample module interrupt status. - * This parameter decides which sample module interrupts will be disabled, valid range are between 1~0x7FFFF. - * @return None - * @details There are 4 ADC interrupts ADINT0~3, and each of these interrupts has its own interrupt vector address. - * \hideinitializer - */ -#define EADC_DISABLE_SAMPLE_MODULE_INT(eadc, u32IntSel, u32ModuleMask) ((eadc)->INTSRC[(u32IntSel)] &= ~(u32ModuleMask)) - -/** - * @brief Set the input mode output format. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Format Decides the output format. Valid values are: - * - EADC_CTL_DMOF_STRAIGHT_BINARY :Select the straight binary format as the output format of the conversion result. - * - EADC_CTL_DMOF_TWOS_COMPLEMENT :Select the 2's complement format as the output format of the conversion result. - * @return None - * @details The macro is used to set A/D input mode output format. - * \hideinitializer - */ -#define EADC_SET_DMOF(eadc, u32Format) ((eadc)->CTL = ((eadc)->CTL & ~EADC_CTL_DMOF_Msk) | (u32Format)) - -/** - * @brief Start the A/D conversion. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will be conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module 18. - * @return None - * @details After write EADC_SWTRG register to start ADC conversion, the EADC_PENDSTS register will show which SAMPLE will conversion. - * \hideinitializer - */ -#define EADC_START_CONV(eadc, u32ModuleMask) ((eadc)->SWTRG = (u32ModuleMask)) - -/** - * @brief Cancel the conversion for sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module. Each bit corresponds to a sample module. - * This parameter decides which sample module will stop the conversion, valid range are between 1~0x7FFFF. - * Bit 0 is sample module 0, bit 1 is sample module 1..., bit 18 is sample module18. - * @return None - * @details If user want to disable the conversion of the sample module, user can write EADC_PENDSTS register to clear it. - * \hideinitializer - */ -#define EADC_STOP_CONV(eadc, u32ModuleMask) ((eadc)->PENDSTS = (u32ModuleMask)) - -/** - * @brief Get the conversion pending flag. - * @param[in] eadc The pointer of the specified EADC module. - * @return Return the conversion pending sample module. - * @details This STPFn(EADC_PENDSTS[18:0]) bit remains 1 during pending state, when the respective ADC conversion is end, - * the STPFn (n=0~18) bit is automatically cleared to 0. - * \hideinitializer - */ -#define EADC_GET_PENDING_CONV(eadc) ((eadc)->PENDSTS) - -/** - * @brief Get the conversion data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the conversion data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DATn[15:0], n=0~18) field to get conversion data. - * \hideinitializer - */ -#define EADC_GET_CONV_DATA(eadc, u32ModuleNum) ((eadc)->DAT[(u32ModuleNum)] & EADC_DAT_RESULT_Msk) - -/** - * @brief Get the data overrun flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data overrun status bits. Each bit corresponds to a data overrun status, valid range are between 1~0x7FFFF. - * @return Return the data overrun flag of the user-specified sample module. - * @details This macro is used to read OV bit (EADC_STATUS0[31:16], EADC_STATUS1[18:16]) field to get data overrun status. - * \hideinitializer - */ -#define EADC_GET_DATA_OVERRUN_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 >> EADC_STATUS0_OV_Pos) | ((eadc)->STATUS1 & EADC_STATUS1_OV_Msk)) & (u32ModuleMask)) - -/** - * @brief Get the data valid flag of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of data valid status bits. Each bit corresponds to a data valid status, valid range are between 1~0x7FFFF. - * @return Return the data valid flag of the user-specified sample module. - * @details This macro is used to read VALID bit (EADC_STATUS0[15:0], EADC_STATUS1[2:0]) field to get data valid status. - * \hideinitializer - */ -#define EADC_GET_DATA_VALID_FLAG(eadc, u32ModuleMask) ((((eadc)->STATUS0 & EADC_STATUS0_VALID_Msk) | (((eadc)->STATUS1 & EADC_STATUS1_VALID_Msk) << 16)) & (u32ModuleMask)) - -/** - * @brief Get the double data of the user-specified sample module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @return Return the double data of the user-specified sample module. - * @details This macro is used to read RESULT bit (EADC_DDATn[15:0], n=0~3) field to get conversion data. - * \hideinitializer - */ -#define EADC_GET_DOUBLE_DATA(eadc, u32ModuleNum) ((eadc)->DDAT[(u32ModuleNum)] & EADC_DDAT0_RESULT_Msk) - -/** - * @brief Get the user-specified interrupt flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of interrupt status bits. Each bit corresponds to a interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return Return the user-specified interrupt flags. - * @details This macro is used to get the user-specified interrupt flags. - * \hideinitializer - */ -#define EADC_GET_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 & (u32Mask)) - -/** - * @brief Get the user-specified sample module overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status, valid range are between 1~0x7FFFF. - * @return Return the user-specified sample module overrun flags. - * @details This macro is used to get the user-specified sample module overrun flags. - * \hideinitializer - */ -#define EADC_GET_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS & (u32ModuleMask)) - -/** - * @brief Clear the selected interrupt status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32Mask The combination of compare interrupt status bits. Each bit corresponds to a compare interrupt status. - * Bit 0 is ADIF0, bit 1 is ADIF1..., bit 3 is ADIF3. - * Bit 4 is ADCMPF0, bit 5 is ADCMPF1..., bit 7 is ADCMPF3. - * @return None - * @details This macro is used to clear clear the selected interrupt status bits. - * \hideinitializer - */ -#define EADC_CLR_INT_FLAG(eadc, u32Mask) ((eadc)->STATUS2 = (u32Mask)) - -/** - * @brief Clear the selected sample module overrun status bits. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleMask The combination of sample module overrun status bits. Each bit corresponds to a sample module overrun status. - * Bit 0 is SPOVF0, bit 1 is SPOVF1..., bit 18 is SPOVF18. - * @return None - * @details This macro is used to clear the selected sample module overrun status bits. - * \hideinitializer - */ -#define EADC_CLR_SAMPLE_MODULE_OV_FLAG(eadc, u32ModuleMask) ((eadc)->OVSTS = (u32ModuleMask)) - -/** - * @brief Check all sample module A/D result data register overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register overrun flag is set to 1. - * @retval 1 Any one of sample module data register overrun flag is set to 1. - * @details The AOV bit (EADC_STATUS2[27]) will keep 1 when any one of sample module data register overrun flag OVn (EADC_DATn[16]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_DATA_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AOV_Msk) >> EADC_STATUS2_AOV_Pos) - -/** - * @brief Check all sample module A/D result data register valid flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module data register valid flag is set to 1. - * @retval 1 Any one of sample module data register valid flag is set to 1. - * @details The AVALID bit (EADC_STATUS2[26]) will keep 1 when any one of sample module data register valid flag VALIDn (EADC_DATn[17]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_DATA_VALID(eadc) (((eadc)->STATUS2 & EADC_STATUS2_AVALID_Msk) >> EADC_STATUS2_AVALID_Pos) - -/** - * @brief Check all A/D sample module start of conversion overrun flags. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of sample module event overrun flag is set to 1. - * @retval 1 Any one of sample module event overrun flag is set to 1. - * @details The STOVF bit (EADC_STATUS2[25]) will keep 1 when any one of sample module event overrun flag SPOVFn (EADC_OVSTS[n]) is set to 1. - * \hideinitializer - */ -#define EADC_IS_SAMPLE_MODULE_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_STOVF_Msk) >> EADC_STATUS2_STOVF_Pos) - -/** - * @brief Check all A/D interrupt flag overrun bits. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 None of ADINT interrupt flag is overwritten to 1. - * @retval 1 Any one of ADINT interrupt flag is overwritten to 1. - * @details The ADOVIF bit (EADC_STATUS2[24]) will keep 1 when any one of ADINT interrupt flag ADOVIFn (EADC_STATUS2[11:8]) is overwritten to 1. - * \hideinitializer - */ -#define EADC_IS_INT_FLAG_OV(eadc) (((eadc)->STATUS2 & EADC_STATUS2_ADOVIF_Msk) >> EADC_STATUS2_ADOVIF_Pos) - -/** - * @brief Get the busy state of EADC. - * @param[in] eadc The pointer of the specified EADC module. - * @retval 0 Idle state. - * @retval 1 Busy state. - * @details This macro is used to read BUSY bit (EADC_STATUS2[23]) to get busy state. - * \hideinitializer - */ -#define EADC_IS_BUSY(eadc) (((eadc)->STATUS2 & EADC_STATUS2_BUSY_Msk) >> EADC_STATUS2_BUSY_Pos) - -/** - * @brief Configure the comparator 0 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP0(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 0 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP0(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[0] = (((eadc)->CMP[0] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 1 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP1(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 1 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP1(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[1] = (((eadc)->CMP[1] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 2 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 0~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP2(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_CMPWEN_DISABLE, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 2 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP2(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[2] = (((eadc)->CMP[2] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Configure the comparator 3 and enable it. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum specifies the compare sample module, valid value are from 0 to 18. - * @param[in] u32Condition specifies the compare condition. Valid values are: - * - \ref EADC_CMP_CMPCOND_LESS_THAN :The compare condition is "less than the compare value" - * - \ref EADC_CMP_CMPCOND_GREATER_OR_EQUAL :The compare condition is "greater than or equal to the compare value - * @param[in] u16CMPData specifies the compare value, valid range are between 0~0xFFF. - * @param[in] u32MatchCount specifies the match count setting, valid range are between 1~0xF. - * @return None - * @details For example, ADC_ENABLE_CMP3(EADC, 5, ADC_ADCMPR_CMPCOND_GREATER_OR_EQUAL, 0x800, 10, EADC_CMP_ADCMPIE_ENABLE); - * Means EADC will assert comparator 3 flag if sample module 5 conversion result is greater or - * equal to 0x800 for 10 times continuously, and a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP3(eadc,\ - u32ModuleNum,\ - u32Condition,\ - u16CMPData,\ - u32MatchCount) ((eadc)->CMP[3] = (((eadc)->CMP[3] & ~(EADC_CMP_CMPSPL_Msk|EADC_CMP_CMPCOND_Msk|EADC_CMP_CMPDAT_Msk|EADC_CMP_CMPMCNT_Msk))|\ - (((u32ModuleNum) << EADC_CMP_CMPSPL_Pos)|\ - (u32Condition) |\ - ((u16CMPData) << EADC_CMP_CMPDAT_Pos)| \ - (((u32MatchCount) - 1) << EADC_CMP_CMPMCNT_Pos)|\ - EADC_CMP_ADCMPEN_Msk))) - -/** - * @brief Enable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF0 (EADC_STATUS2[4]) will be set when both EADC_CMP0 and EADC_CMP1 compared condition matched. - * \hideinitializer - */ -#define EADC_ENABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_CMPWEN_Msk) - -/** - * @brief Disable the compare window mode. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are 0 and 2. - * @return None - * @details ADCMPF2 (EADC_STATUS2[6]) will be set when both EADC_CMP2 and EADC_CMP3 compared condition matched. - * \hideinitializer - */ -#define EADC_DISABLE_CMP_WINDOW_MODE(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_CMPWEN_Msk) - -/** - * @brief Enable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details If the compare function is enabled and the compare condition matches the setting of CMPCOND (EADC_CMPn[2], n=0~3) - * and CMPMCNT (EADC_CMPn[11:8], n=0~3), ADCMPFn (EADC_STATUS2[7:4], n=0~3) will be asserted, in the meanwhile, - * if ADCMPIE is set to 1, a compare interrupt request is generated. - * \hideinitializer - */ -#define EADC_ENABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] |= EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable the compare interrupt. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32CMP Specifies the compare register, valid value are from 0 to 3. - * @return None - * @details This macro is used to disable the compare interrupt. - * \hideinitializer - */ -#define EADC_DISABLE_CMP_INT(eadc, u32CMP) ((eadc)->CMP[(u32CMP)] &= ~EADC_CMP_ADCMPIE_Msk) - -/** - * @brief Disable comparator 0. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 0. - * \hideinitializer - */ -#define EADC_DISABLE_CMP0(eadc) ((eadc)->CMP[0] = 0) - -/** - * @brief Disable comparator 1. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 1. - * \hideinitializer - */ -#define EADC_DISABLE_CMP1(eadc) ((eadc)->CMP[1] = 0) - -/** - * @brief Disable comparator 2. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 2. - * \hideinitializer - */ -#define EADC_DISABLE_CMP2(eadc) ((eadc)->CMP[2] = 0) - -/** - * @brief Disable comparator 3. - * @param[in] eadc The pointer of the specified EADC module. - * @return None - * @details This macro is used to disable comparator 3. - * \hideinitializer - */ -#define EADC_DISABLE_CMP3(eadc) ((eadc)->CMP[3] = 0) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EADC functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode); -void EADC_Close(EADC_T *eadc); -void EADC_ConfigSampleModule(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerSrc, uint32_t u32Channel); -void EADC_SetTriggerDelayTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32TriggerDelayTime, uint32_t u32DelayClockDivider); -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime); - -/*@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EADC_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ebi.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ebi.h deleted file mode 100644 index 83b6a686877..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ebi.h +++ /dev/null @@ -1,350 +0,0 @@ -/**************************************************************************//** - * @file nu_ebi.h - * @brief External Bus Interface(EBI) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EBI_H__ -#define __NU_EBI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_CONSTANTS EBI Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0_BASE_ADDR 0x68000000UL /*!< EBI bank0 base address \hideinitializer */ -#define EBI_BANK1_BASE_ADDR 0x68100000UL /*!< EBI bank1 base address \hideinitializer */ -#define EBI_BANK2_BASE_ADDR 0x68200000UL /*!< EBI bank2 base address \hideinitializer */ -#define EBI_MAX_SIZE 0x00100000UL /*!< Maximum EBI size for each bank is 1 MB \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI bank number */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0 0UL /*!< EBI bank 0 \hideinitializer */ -#define EBI_BANK1 1UL /*!< EBI bank 1 \hideinitializer */ -#define EBI_BANK2 2UL /*!< EBI bank 2 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI data bus width */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BUSWIDTH_8BIT 8UL /*!< EBI bus width is 8-bit \hideinitializer */ -#define EBI_BUSWIDTH_16BIT 16UL /*!< EBI bus width is 16-bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI CS Active Level */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_CS_ACTIVE_LOW 0UL /*!< EBI CS active level is low \hideinitializer */ -#define EBI_CS_ACTIVE_HIGH 1UL /*!< EBI CS active level is high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI MCLK divider and Timing */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_MCLKDIV_1 0x0UL /*!< EBI output clock(MCLK) is HCLK/1 \hideinitializer */ -#define EBI_MCLKDIV_2 0x1UL /*!< EBI output clock(MCLK) is HCLK/2 \hideinitializer */ -#define EBI_MCLKDIV_4 0x2UL /*!< EBI output clock(MCLK) is HCLK/4 \hideinitializer */ -#define EBI_MCLKDIV_8 0x3UL /*!< EBI output clock(MCLK) is HCLK/8 \hideinitializer */ -#define EBI_MCLKDIV_16 0x4UL /*!< EBI output clock(MCLK) is HCLK/16 \hideinitializer */ -#define EBI_MCLKDIV_32 0x5UL /*!< EBI output clock(MCLK) is HCLK/32 \hideinitializer */ -#define EBI_MCLKDIV_64 0x6UL /*!< EBI output clock(MCLK) is HCLK/64 \hideinitializer */ -#define EBI_MCLKDIV_128 0x7UL /*!< EBI output clock(MCLK) is HCLK/128 \hideinitializer */ - -#define EBI_TIMING_FASTEST 0x0UL /*!< EBI timing is the fastest \hideinitializer */ -#define EBI_TIMING_VERYFAST 0x1UL /*!< EBI timing is very fast \hideinitializer */ -#define EBI_TIMING_FAST 0x2UL /*!< EBI timing is fast \hideinitializer */ -#define EBI_TIMING_NORMAL 0x3UL /*!< EBI timing is normal \hideinitializer */ -#define EBI_TIMING_SLOW 0x4UL /*!< EBI timing is slow \hideinitializer */ -#define EBI_TIMING_VERYSLOW 0x5UL /*!< EBI timing is very slow \hideinitializer */ -#define EBI_TIMING_SLOWEST 0x6UL /*!< EBI timing is the slowest \hideinitializer */ - -#define EBI_OPMODE_NORMAL 0x0UL /*!< EBI bus operate in normal mode \hideinitializer */ -#define EBI_OPMODE_CACCESS (EBI_CTL_CACCESS_Msk) /*!< EBI bus operate in Continuous Data Access mode \hideinitializer */ -#define EBI_OPMODE_ADSEPARATE (EBI_CTL_ADSEPEN_Msk) /*!< EBI bus operate in AD Separate mode \hideinitializer */ - -/*@}*/ /* end of group EBI_EXPORTED_CONSTANTS */ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Read 8-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Enable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to improve EBI write operation for all EBI banks. - * \hideinitializer - */ -#define EBI_ENABLE_WRITE_BUFFER() (EBI->CTL0 |= EBI_CTL_WBUFEN_Msk); - -/** - * @brief Disable EBI Write Buffer - * - * @param None - * - * @return None - * - * @details This macro is used to disable EBI write buffer function. - * \hideinitializer - */ -#define EBI_DISABLE_WRITE_BUFFER() (EBI->CTL0 &= ~EBI_CTL_WBUFEN_Msk); - -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel); -void EBI_Close(uint32_t u32Bank); -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv); - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ecap.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ecap.h deleted file mode 100644 index a17981ceeca..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_ecap.h +++ /dev/null @@ -1,453 +0,0 @@ -/**************************************************************************//** - * @file nu_ecap.h - * @brief EnHanced Input Capture Timer(ECAP) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_ECAP_H__ -#define __NU_ECAP_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_CONSTANTS ECAP Exported Constants - @{ -*/ - -#define ECAP_IC0 (0UL) /*!< ECAP IC0 Unit \hideinitializer */ -#define ECAP_IC1 (1UL) /*!< ECAP IC1 Unit \hideinitializer */ -#define ECAP_IC2 (2UL) /*!< ECAP IC2 Unit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* ECAP CTL0 constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ECAP_NOISE_FILTER_CLKDIV_1 (0UL<CTL0 = ((ecap)->CTL0 & ~ECAP_CTL0_NFCLKSEL_Msk)|(u32ClkSel)) - -/** - * @brief This macro is used to disable noise filter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the noise filter of input capture. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_DISABLE(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPNFDIS_Msk) - -/** - * @brief This macro is used to enable noise filter - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSel Select noise filter clock divide number - * - \ref ECAP_NOISE_FILTER_CLKDIV_1 - * - \ref ECAP_NOISE_FILTER_CLKDIV_2 - * - \ref ECAP_NOISE_FILTER_CLKDIV_4 - * - \ref ECAP_NOISE_FILTER_CLKDIV_16 - * - \ref ECAP_NOISE_FILTER_CLKDIV_32 - * - \ref ECAP_NOISE_FILTER_CLKDIV_64 - * @return None - * @details This macro will enable the noise filter of input capture and set noise filter clock divide. - * \hideinitializer - */ -#define ECAP_NOISE_FILTER_ENABLE(ecap, u32ClkSel) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPNFDIS_Msk|ECAP_CTL0_NFCLKSEL_Msk))|(u32ClkSel)) - -/** - * @brief This macro is used to enable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will enable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_ENABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel unit - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_CTL0_IC0EN_Msk - * - \ref ECAP_CTL0_IC1EN_Msk - * - \ref ECAP_CTL0_IC2EN_Msk - * @return None - * @details This macro will disable the input channel_n to input capture. - * \hideinitializer - */ -#define ECAP_DISABLE_INPUT_CHANNEL(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to select input channel source - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Src The input source - * - \ref ECAP_CAP_INPUT_SRC_FROM_IC - * - \ref ECAP_CAP_INPUT_SRC_FROM_CH - * @return None - * @details This macro will select the input source from ICx, CHx. - * \hideinitializer - */ -#define ECAP_SEL_INPUT_SRC(ecap, u32Index, u32Src) ((ecap)->CTL0 = ((ecap)->CTL0 & ~(ECAP_CTL0_CAPSEL0_Msk<<((u32Index)<<1)))|(((u32Src)<CTL0 |= (u32Mask)) - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return None - * @details This macro will disable the input channel_n interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_INT(ecap, u32Mask) ((ecap)->CTL0 &= ~(u32Mask)) - -/** - * @brief This macro is used to enable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_OVF_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to disable input channel overflow interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel overflow interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_OVF_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_OVIEN_Msk) - -/** - * @brief This macro is used to enable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to disable input channel compare-match interrupt - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the input channel compare-match interrupt. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP_MATCH_INT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPIEN_Msk) - -/** - * @brief This macro is used to start capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will start capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_START(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to stop capture counter - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will stop capture counter up-counting. - * \hideinitializer - */ -#define ECAP_CNT_STOP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CNTEN_Msk) - -/** - * @brief This macro is used to set event to clear capture counter - * @param[in] ecap Specify ECAP port - * @param[in] u32Event The input channel number - * - \ref ECAP_CTL1_CAP0CLREN_Msk - * - \ref ECAP_CTL1_CAP1CLREN_Msk - * - \ref ECAP_CTL1_CAP2CLREN_Msk - * @return None - * @details This macro will enable and select compare or capture event that can clear capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CLEAR_EVENT(ecap, u32Event) do{ \ - if((u32Event) & ECAP_CTL0_CMPCLREN_Msk) \ - (ecap)->CTL0 |= ECAP_CTL0_CMPCLREN_Msk; \ - else \ - (ecap)->CTL0 &= ~ECAP_CTL0_CMPCLREN_Msk; \ - (ecap)->CTL1 = ((ecap)->CTL1 &~0x700000) | ((u32Event) & 0x700000); \ - }while(0); - -/** - * @brief This macro is used to enable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable the compare function. - * \hideinitializer - */ -#define ECAP_ENABLE_CMP(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to disable compare function - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable the compare function. - * \hideinitializer - */ -#define ECAP_DISABLE_CMP(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CMPEN_Msk) - -/** - * @brief This macro is used to enable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will enable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_ENABLE_CNT(ecap) ((ecap)->CTL0 |= ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to disable input capture function. - * @param[in] ecap Specify ECAP port - * @return None - * @details This macro will disable input capture timer/counter. - * \hideinitializer - */ -#define ECAP_DISABLE_CNT(ecap) ((ecap)->CTL0 &= ~ECAP_CTL0_CAPEN_Msk) - -/** - * @brief This macro is used to select input channel edge detection - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @param[in] u32Edge The input source - * - \ref ECAP_RISING_EDGE - * - \ref ECAP_FALLING_EDGE - * - \ref ECAP_RISING_FALLING_EDGE - * @return None - * @details This macro will select input capture can detect falling edge, rising edge or either rising or falling edge change. - * \hideinitializer - */ -#define ECAP_SEL_CAPTURE_EDGE(ecap, u32Index, u32Edge) ((ecap)->CTL1 = ((ecap)->CTL1 & ~(ECAP_CTL1_EDGESEL0_Msk<<((u32Index)<<1)))|((u32Edge)<<((u32Index)<<1))) - -/** - * @brief This macro is used to select ECAP counter reload trigger source - * @param[in] ecap Specify ECAP port - * @param[in] u32TrigSrc The input source - * - \ref ECAP_CTL1_CAP0RLDEN_Msk - * - \ref ECAP_CTL1_CAP1RLDEN_Msk - * - \ref ECAP_CTL1_CAP2RLDEN_Msk - * - \ref ECAP_CTL1_OVRLDEN_Msk - * @return None - * @details This macro will select capture counter reload trigger source. - * \hideinitializer - */ -#define ECAP_SEL_RELOAD_TRIG_SRC(ecap, u32TrigSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~0xF00)|(u32TrigSrc)) - -/** - * @brief This macro is used to select capture timer clock divide. - * @param[in] ecap Specify ECAP port - * @param[in] u32Clkdiv The input source - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_1 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_4 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_16 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_32 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_64 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_96 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_112 - * - \ref ECAP_CAPTURE_TIMER_CLKDIV_128 - * @return None - * @details This macro will select capture timer clock has a pre-divider with eight divided option. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_DIV(ecap, u32Clkdiv) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CLKSEL_Msk)|(u32Clkdiv)) - -/** - * @brief This macro is used to select capture timer/counter clock source - * @param[in] ecap Specify ECAP port - * @param[in] u32ClkSrc The input source - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP_CLK - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP0 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP1 - * - \ref ECAP_CAPTURE_TIMER_CLK_SRC_CAP2 - * @return None - * @details This macro will select capture timer/clock clock source. - * \hideinitializer - */ -#define ECAP_SEL_TIMER_CLK_SRC(ecap, u32ClkSrc) ((ecap)->CTL1 = ((ecap)->CTL1 & ~ECAP_CTL1_CNTSRCSEL_Msk)|(u32ClkSrc)) - -/** - * @brief This macro is used to read input capture status - * @param[in] ecap Specify ECAP port - * @return Input capture status flags - * @details This macro will get the input capture interrupt status. - * \hideinitializer - */ -#define ECAP_GET_INT_STATUS(ecap) ((ecap)->STATUS) - -/** - * @brief This macro is used to get input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to get the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_GET_CAPTURE_FLAG(ecap, u32Mask) (((ecap)->STATUS & (u32Mask))?1:0) - -/** - * @brief This macro is used to clear input channel interrupt flag - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel mask - * - \ref ECAP_STATUS_CAPTF0_Msk - * - \ref ECAP_STATUS_CAPTF1_Msk - * - \ref ECAP_STATUS_CAPTF2_Msk - * - \ref ECAP_STATUS_CAPOVF_Msk - * - \ref ECAP_STATUS_CAPCMPF_Msk - * @return None - * @details This macro will write 1 to clear the input channel_n interrupt flag. - * \hideinitializer - */ -#define ECAP_CLR_CAPTURE_FLAG(ecap, u32Mask) ((ecap)->STATUS = (u32Mask)) - -/** - * @brief This macro is used to set input capture counter value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Counter value - * @return None - * @details This macro will set a counter value of input capture. - * \hideinitializer - */ -#define ECAP_SET_CNT_VALUE(ecap, u32Val) ((ecap)->CNT = (u32Val)) - -/** - * @brief This macro is used to get input capture counter value - * @param[in] ecap Specify ECAP port - * @return Capture counter value - * @details This macro will get a counter value of input capture. - * \hideinitializer - */ -#define ECAP_GET_CNT_VALUE(ecap) ((ecap)->CNT) - -/** - * @brief This macro is used to get input capture counter hold value - * @param[in] ecap Specify ECAP port - * @param[in] u32Index The input channel number - * - \ref ECAP_IC0 - * - \ref ECAP_IC1 - * - \ref ECAP_IC2 - * @return Capture counter hold value - * @details This macro will get a hold value of input capture channel_n. - * \hideinitializer - */ -#define ECAP_GET_CNT_HOLD_VALUE(ecap, u32Index) (*(__IO uint32_t *) (&((ecap)->HLD0) + (u32Index))) - -/** - * @brief This macro is used to set input capture counter compare value - * @param[in] ecap Specify ECAP port - * @param[in] u32Val Input capture compare value - * @return None - * @details This macro will set a compare value of input capture counter. - * \hideinitializer - */ -#define ECAP_SET_CNT_CMP(ecap, u32Val) ((ecap)->CNTCMP = (u32Val)) - -void ECAP_Open(ECAP_T *ecap, uint32_t u32FuncMask); -void ECAP_Close(ECAP_T *ecap); -void ECAP_EnableINT(ECAP_T *ecap, uint32_t u32Mask); -void ECAP_DisableINT(ECAP_T *ecap, uint32_t u32Mask); -/*@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ECAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_ECAP_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_epwm.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_epwm.h deleted file mode 100644 index 261ec688e33..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_epwm.h +++ /dev/null @@ -1,643 +0,0 @@ -/**************************************************************************//** - * @file nu_epwm.h - * @brief EPWM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EPWM_H__ -#define __NU_EPWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - -/** @addtogroup EPWM_EXPORTED_CONSTANTS EPWM Exported Constants - @{ -*/ -#define EPWM_CHANNEL_NUM (6U) /*!< EPWM channel number \hideinitializer */ -#define EPWM_CH_0_MASK (0x1U) /*!< EPWM channel 0 mask \hideinitializer */ -#define EPWM_CH_1_MASK (0x2U) /*!< EPWM channel 1 mask \hideinitializer */ -#define EPWM_CH_2_MASK (0x4U) /*!< EPWM channel 2 mask \hideinitializer */ -#define EPWM_CH_3_MASK (0x8U) /*!< EPWM channel 3 mask \hideinitializer */ -#define EPWM_CH_4_MASK (0x10U) /*!< EPWM channel 4 mask \hideinitializer */ -#define EPWM_CH_5_MASK (0x20U) /*!< EPWM channel 5 mask \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_UP_COUNTER (0U) /*!< Up counter type \hideinitializer */ -#define EPWM_DOWN_COUNTER (1U) /*!< Down counter type \hideinitializer */ -#define EPWM_UP_DOWN_COUNTER (2U) /*!< Up-Down counter type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Aligned Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_EDGE_ALIGNED (1U) /*!< EPWM working in edge aligned type(down count) \hideinitializer */ -#define EPWM_CENTER_ALIGNED (2U) /*!< EPWM working in center aligned type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_OUTPUT_NOTHING (0U) /*!< EPWM output nothing \hideinitializer */ -#define EPWM_OUTPUT_LOW (1U) /*!< EPWM output low \hideinitializer */ -#define EPWM_OUTPUT_HIGH (2U) /*!< EPWM output high \hideinitializer */ -#define EPWM_OUTPUT_TOGGLE (3U) /*!< EPWM output toggle \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Synchronous Start Function Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EPWM_SSCTL_SSRC_EPWM0 (0U<CTL1 = (epwm)->CTL1 | (0x7ul<CTL1 = (epwm)->CTL1 & ~(0x7ul<CTL0 = (epwm)->CTL0 | EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief This macro disable group mode - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to disable group mode of EPWM module. - * \hideinitializer - */ -#define EPWM_DISABLE_GROUP_MODE(epwm) ((epwm)->CTL0 = (epwm)->CTL0 & ~EPWM_CTL0_GROUPEN_Msk) - -/** - * @brief Enable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32SyncSrc Synchronous start source selection, valid values are: - * - \ref EPWM_SSCTL_SSRC_EPWM0 - * - \ref EPWM_SSCTL_SSRC_EPWM1 - * - \ref EPWM_SSCTL_SSRC_BPWM0 - * - \ref EPWM_SSCTL_SSRC_BPWM1 - * @return None - * @details This macro is used to enable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_TIMER_SYNC(epwm, u32ChannelMask, u32SyncSrc) ((epwm)->SSCTL = ((epwm)->SSCTL & ~EPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | (u32ChannelMask)) - -/** - * @brief Disable timer synchronous start counting function of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to disable timer synchronous start counting function of specified channel(s). - * \hideinitializer - */ -#define EPWM_DISABLE_TIMER_SYNC(epwm, u32ChannelMask) \ - do{ \ - int i;\ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (epwm)->SSCTL &= ~(1UL << i); \ - } \ - }while(0) - -/** - * @brief This macro enable EPWM counter synchronous start counting function. - * @param[in] epwm The pointer of the specified EPWM module - * @return None - * @details This macro is used to make selected EPWM0 and EPWM1 channel(s) start counting at the same time. - * To configure synchronous start counting channel(s) by EPWM_ENABLE_TIMER_SYNC() and EPWM_DISABLE_TIMER_SYNC(). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC_START(epwm) ((epwm)->SSTRG = EPWM_SSTRG_CNTSEN_Msk) - -/** - * @brief This macro enable output inverter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to enable output inverter of specified channel(s). - * \hideinitializer - */ -#define EPWM_ENABLE_OUTPUT_INVERTER(epwm, u32ChannelMask) ((epwm)->POLCTL = (u32ChannelMask)) - -/** - * @brief This macro get captured rising data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured rising data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_RISING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].RCAPDAT) - -/** - * @brief This macro get captured falling data - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This macro is used to get captured falling data of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CAPTURE_FALLING_DATA(epwm, u32ChannelNum) ((epwm)->CAPDAT[(u32ChannelNum)].FCAPDAT) - -/** - * @brief This macro mask output logic to high or low - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32LevelMask Output logic to high or low - * @return None - * @details This macro is used to mask output logic to high or low of specified channel(s). - * @note If u32ChannelMask parameter is 0, then mask function will be disabled. - * \hideinitializer - */ -#define EPWM_MASK_OUTPUT(epwm, u32ChannelMask, u32LevelMask) \ - { \ - (epwm)->MSKEN = (u32ChannelMask); \ - (epwm)->MSK = (u32LevelMask); \ - } - -/** - * @brief This macro set the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @return None - * @details This macro is used to set the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescaler) ((epwm)->CLKPSC[(u32ChannelNum) >> 1] = (u32Prescaler)) - -/** - * @brief This macro get the prescaler of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return Clock prescaler of specified channel. Valid values are between 0 ~ 0xFFF - * @details This macro is used to get the prescaler of specified channel. - * @note Every even channel N, and channel (N + 1) share a prescaler. So if channel 0 prescaler changed, channel 1 will also be affected. - * The clock of EPWM counter is divided by (u32Prescaler + 1). - * \hideinitializer - */ -#define EPWM_GET_PRESCALER(epwm, u32ChannelNum) ((epwm)->CLKPSC[(u32ChannelNum) >> 1U]) - -/** - * @brief This macro set the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CMR Comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_CMR(epwm, u32ChannelNum, u32CMR) ((epwm)->CMPDAT[(u32ChannelNum)]= (u32CMR)) - -/** - * @brief This macro get the comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the comparator of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the comparator of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CMR(epwm, u32ChannelNum) ((epwm)->CMPDAT[(u32ChannelNum)]) - -/** - * @brief This macro set the free trigger comparator of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32FTCMR Free trigger comparator of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the free trigger comparator of specified channel. - * @note This new setting will take effect on next EPWM period. - * \hideinitializer - */ -#define EPWM_SET_FTCMR(epwm, u32ChannelNum, u32FTCMR) (((epwm)->FTCMPDAT[((u32ChannelNum) >> 1U)]) = (u32FTCMR)) - -/** - * @brief This macro set the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF - * @return None - * @details This macro is used to set the period of specified channel. - * @note This new setting will take effect on next EPWM period. - * @note EPWM counter will stop if period length set to 0. - * \hideinitializer - */ -#define EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR) ((epwm)->PERIOD[(u32ChannelNum)] = (u32CNR)) - -/** - * @brief This macro get the period of the selected channel - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Return the period of specified channel. Valid values are between 0~0xFFFF - * @details This macro is used to get the period of specified channel. - * \hideinitializer - */ -#define EPWM_GET_CNR(epwm, u32ChannelNum) ((epwm)->PERIOD[(u32ChannelNum)]) - -/** - * @brief This macro set the EPWM aligned type - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32AlignedType EPWM aligned type, valid values are: - * - \ref EPWM_EDGE_ALIGNED - * - \ref EPWM_CENTER_ALIGNED - * @return None - * @details This macro is used to set the EPWM aligned type of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_ALIGNED_TYPE(epwm, u32ChannelMask, u32AlignedType) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) \ - (epwm)->CTL1 = (((epwm)->CTL1 & ~(3UL << (i << 1))) | ((u32AlignedType) << (i << 1))); \ - } \ - }while(0) - -/** - * @brief Set load window of window loading mode for specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to set load window of window loading mode for specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_LOAD_WINDOW(epwm, u32ChannelMask) ((epwm)->LOAD |= (u32ChannelMask)) - -/** - * @brief Trigger synchronous event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are 0, 2, 4 - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @return None - * @details This macro is used to trigger synchronous event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_SYNC(epwm, u32ChannelNum) ((epwm)->SWSYNC |= (1 << ((u32ChannelNum) >> 1))) - -/** - * @brief Clear counter of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @return None - * @details This macro is used to clear counter of specified channel(s). - * \hideinitializer - */ -#define EPWM_CLR_COUNTER(epwm, u32ChannelMask) ((epwm)->CNTCLR |= (u32ChannelMask)) - -/** - * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32ZeroLevel output level at zero point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpUpLevel output level at compare up point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32PeriodLevel output level at period(center) point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @param[in] u32CmpDownLevel output level at compare down point, valid values are: - * - \ref EPWM_OUTPUT_NOTHING - * - \ref EPWM_OUTPUT_LOW - * - \ref EPWM_OUTPUT_HIGH - * - \ref EPWM_OUTPUT_TOGGLE - * @return None - * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s). - * \hideinitializer - */ -#define EPWM_SET_OUTPUT_LEVEL(epwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \ - do{ \ - int i; \ - for(i = 0; i < 6; i++) { \ - if((u32ChannelMask) & (1 << i)) { \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (i << 1))) | ((u32ZeroLevel) << (i << 1))); \ - (epwm)->WGCTL0 = (((epwm)->WGCTL0 & ~(3UL << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))) | ((u32PeriodLevel) << (EPWM_WGCTL0_PRDPCTL0_Pos + (i << 1)))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (i << 1))) | ((u32CmpUpLevel) << (i << 1))); \ - (epwm)->WGCTL1 = (((epwm)->WGCTL1 & ~(3UL << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))) | ((u32CmpDownLevel) << (EPWM_WGCTL1_CMPDCTL0_Pos + (i << 1)))); \ - } \ - } \ - }while(0) - -/** - * @brief Trigger brake event from specified channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Bit 0 represents channel 0, bit 1 represents channel 2 and bit 2 represents channel 4 - * @param[in] u32BrakeType Type of brake trigger. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This macro is used to trigger brake event from specified channel(s). - * \hideinitializer - */ -#define EPWM_TRIGGER_BRAKE(epwm, u32ChannelMask, u32BrakeType) ((epwm)->SWBRK |= ((u32ChannelMask) << (u32BrakeType))) - -/** - * @brief Set Dead zone clock source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32AfterPrescaler Dead zone clock source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @return None - * @details This macro is used to set Dead zone clock source. Every two channels share the same setting. - * @note The write-protection function should be disabled before using this function. - * \hideinitializer - */ -#define EPWM_SET_DEADZONE_CLK_SRC(epwm, u32ChannelNum, u32AfterPrescaler) \ - ((epwm)->DTCTL[(u32ChannelNum) >> 1] = (((epwm)->DTCTL[(u32ChannelNum) >> 1] & ~EPWM_DTCTL0_1_DTCKSEL_Msk) | \ - ((u32AfterPrescaler) << EPWM_DTCTL0_1_DTCKSEL_Pos))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define EPWM functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge); -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle); -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt); -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition); -uint32_t EPWM_GetDACTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource); -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode); -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration); -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge); -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType); -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource); -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType); -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc); -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode); -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase); -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask); -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm); -void EPWM_EnableSyncPinInverse(EPWM_T *epwm); -void EPWM_DisableSyncPinInverse(EPWM_T *epwm); -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel); -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel); -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum); -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule); -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable); -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel); -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle); -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt); -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum); - -/*@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EPWM_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_gpio.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_gpio.h deleted file mode 100644 index ad033cb432d..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_gpio.h +++ /dev/null @@ -1,600 +0,0 @@ -/**************************************************************************//** - * @file GPIO.h - * @brief GPIO driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_GPIO_H__ -#define __NU_GPIO_H__ - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_CONSTANTS GPIO Exported Constants - @{ -*/ - - -#define GPIO_PIN_MAX 16UL /*!< Specify Maximum Pins of Each GPIO Port \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_MODE_INPUT 0x0UL /*!< Input Mode \hideinitializer */ -#define GPIO_MODE_OUTPUT 0x1UL /*!< Output Mode \hideinitializer */ -#define GPIO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode \hideinitializer */ -#define GPIO_MODE_QUASI 0x3UL /*!< Quasi-bidirectional Mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Interrupt Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INT_RISING 0x00010000UL /*!< Interrupt enable by Input Rising Edge \hideinitializer */ -#define GPIO_INT_FALLING 0x00000001UL /*!< Interrupt enable by Input Falling Edge \hideinitializer */ -#define GPIO_INT_BOTH_EDGE 0x00010001UL /*!< Interrupt enable by both Rising Edge and Falling Edge \hideinitializer */ -#define GPIO_INT_HIGH 0x01010000UL /*!< Interrupt enable by Level-High \hideinitializer */ -#define GPIO_INT_LOW 0x01000001UL /*!< Interrupt enable by Level-Level \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_INTTYPE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INTTYPE_EDGE 0UL /*!< GPIO_INTTYPE Setting for Edge Trigger Mode \hideinitializer */ -#define GPIO_INTTYPE_LEVEL 1UL /*!< GPIO_INTTYPE Setting for Edge Level Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Slew Rate Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_SLEWCTL_NORMAL 0x0UL /*!< GPIO slew setting for normal Mode \hideinitializer */ -#define GPIO_SLEWCTL_HIGH 0x1UL /*!< GPIO slew setting for high Mode \hideinitializer */ -#define GPIO_SLEWCTL_FAST 0x2UL /*!< GPIO slew setting for fast Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Pull-up And Pull-down Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_PUSEL_DISABLE 0x0UL /*!< GPIO PUSEL setting for Disable Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_UP 0x1UL /*!< GPIO PUSEL setting for Pull-up Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_DOWN 0x2UL /*!< GPIO PUSEL setting for Pull-down Mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_DBCTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_DBCTL_ICLK_ON 0x00000020UL /*!< GPIO_DBCTL setting for all IO pins edge detection circuit is always active after reset \hideinitializer */ -#define GPIO_DBCTL_ICLK_OFF 0x00000000UL /*!< GPIO_DBCTL setting for edge detection circuit is active only if IO pin corresponding GPIOx_IEN bit is set to 1 \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSRC_LIRC 0x00000010UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the internal 10 kHz \hideinitializer */ -#define GPIO_DBCTL_DBCLKSRC_HXT 0x00000000UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the HCLK \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSEL_1 0x00000000UL /*!< GPIO_DBCTL setting for sampling cycle = 1 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2 0x00000001UL /*!< GPIO_DBCTL setting for sampling cycle = 2 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4 0x00000002UL /*!< GPIO_DBCTL setting for sampling cycle = 4 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8 0x00000003UL /*!< GPIO_DBCTL setting for sampling cycle = 8 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16 0x00000004UL /*!< GPIO_DBCTL setting for sampling cycle = 16 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32 0x00000005UL /*!< GPIO_DBCTL setting for sampling cycle = 32 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_64 0x00000006UL /*!< GPIO_DBCTL setting for sampling cycle = 64 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_128 0x00000007UL /*!< GPIO_DBCTL setting for sampling cycle = 128 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_256 0x00000008UL /*!< GPIO_DBCTL setting for sampling cycle = 256 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_512 0x00000009UL /*!< GPIO_DBCTL setting for sampling cycle = 512 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_1024 0x0000000AUL /*!< GPIO_DBCTL setting for sampling cycle = 1024 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2048 0x0000000BUL /*!< GPIO_DBCTL setting for sampling cycle = 2048 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4096 0x0000000CUL /*!< GPIO_DBCTL setting for sampling cycle = 4096 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8192 0x0000000DUL /*!< GPIO_DBCTL setting for sampling cycle = 8192 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16384 0x0000000EUL /*!< GPIO_DBCTL setting for sampling cycle = 16384 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32768 0x0000000FUL /*!< GPIO_DBCTL setting for sampling cycle = 32768 clocks \hideinitializer */ - - -/* Define GPIO Pin Data Input/Output. It could be used to control each I/O pin by pin address mapping. - Example 1: - - PA0 = 1; - - It is used to set GPIO PA.0 to high; - - Example 2: - - if (PA0) - PA0 = 0; - - If GPIO PA.0 pin status is high, then set GPIO PA.0 data output to low. - */ -#define GPIO_PIN_DATA(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2)))) /*!< Pin Data Input/Output \hideinitializer */ -#define PA0 GPIO_PIN_DATA(0, 0 ) /*!< Specify PA.0 Pin Data Input/Output \hideinitializer */ -#define PA1 GPIO_PIN_DATA(0, 1 ) /*!< Specify PA.1 Pin Data Input/Output \hideinitializer */ -#define PA2 GPIO_PIN_DATA(0, 2 ) /*!< Specify PA.2 Pin Data Input/Output \hideinitializer */ -#define PA3 GPIO_PIN_DATA(0, 3 ) /*!< Specify PA.3 Pin Data Input/Output \hideinitializer */ -#define PA4 GPIO_PIN_DATA(0, 4 ) /*!< Specify PA.4 Pin Data Input/Output \hideinitializer */ -#define PA5 GPIO_PIN_DATA(0, 5 ) /*!< Specify PA.5 Pin Data Input/Output \hideinitializer */ -#define PA6 GPIO_PIN_DATA(0, 6 ) /*!< Specify PA.6 Pin Data Input/Output \hideinitializer */ -#define PA7 GPIO_PIN_DATA(0, 7 ) /*!< Specify PA.7 Pin Data Input/Output \hideinitializer */ -#define PA8 GPIO_PIN_DATA(0, 8 ) /*!< Specify PA.8 Pin Data Input/Output \hideinitializer */ -#define PA9 GPIO_PIN_DATA(0, 9 ) /*!< Specify PA.9 Pin Data Input/Output \hideinitializer */ -#define PA10 GPIO_PIN_DATA(0, 10) /*!< Specify PA.10 Pin Data Input/Output \hideinitializer */ -#define PA11 GPIO_PIN_DATA(0, 11) /*!< Specify PA.11 Pin Data Input/Output \hideinitializer */ -#define PA12 GPIO_PIN_DATA(0, 12) /*!< Specify PA.12 Pin Data Input/Output \hideinitializer */ -#define PA13 GPIO_PIN_DATA(0, 13) /*!< Specify PA.13 Pin Data Input/Output \hideinitializer */ -#define PA14 GPIO_PIN_DATA(0, 14) /*!< Specify PA.14 Pin Data Input/Output \hideinitializer */ -#define PA15 GPIO_PIN_DATA(0, 15) /*!< Specify PA.15 Pin Data Input/Output \hideinitializer */ -#define PB0 GPIO_PIN_DATA(1, 0 ) /*!< Specify PB.0 Pin Data Input/Output \hideinitializer */ -#define PB1 GPIO_PIN_DATA(1, 1 ) /*!< Specify PB.1 Pin Data Input/Output \hideinitializer */ -#define PB2 GPIO_PIN_DATA(1, 2 ) /*!< Specify PB.2 Pin Data Input/Output \hideinitializer */ -#define PB3 GPIO_PIN_DATA(1, 3 ) /*!< Specify PB.3 Pin Data Input/Output \hideinitializer */ -#define PB4 GPIO_PIN_DATA(1, 4 ) /*!< Specify PB.4 Pin Data Input/Output \hideinitializer */ -#define PB5 GPIO_PIN_DATA(1, 5 ) /*!< Specify PB.5 Pin Data Input/Output \hideinitializer */ -#define PB6 GPIO_PIN_DATA(1, 6 ) /*!< Specify PB.6 Pin Data Input/Output \hideinitializer */ -#define PB7 GPIO_PIN_DATA(1, 7 ) /*!< Specify PB.7 Pin Data Input/Output \hideinitializer */ -#define PB8 GPIO_PIN_DATA(1, 8 ) /*!< Specify PB.8 Pin Data Input/Output \hideinitializer */ -#define PB9 GPIO_PIN_DATA(1, 9 ) /*!< Specify PB.9 Pin Data Input/Output \hideinitializer */ -#define PB10 GPIO_PIN_DATA(1, 10) /*!< Specify PB.10 Pin Data Input/Output \hideinitializer */ -#define PB11 GPIO_PIN_DATA(1, 11) /*!< Specify PB.11 Pin Data Input/Output \hideinitializer */ -#define PB12 GPIO_PIN_DATA(1, 12) /*!< Specify PB.12 Pin Data Input/Output \hideinitializer */ -#define PB13 GPIO_PIN_DATA(1, 13) /*!< Specify PB.13 Pin Data Input/Output \hideinitializer */ -#define PB14 GPIO_PIN_DATA(1, 14) /*!< Specify PB.14 Pin Data Input/Output \hideinitializer */ -#define PB15 GPIO_PIN_DATA(1, 15) /*!< Specify PB.15 Pin Data Input/Output \hideinitializer */ -#define PC0 GPIO_PIN_DATA(2, 0 ) /*!< Specify PC.0 Pin Data Input/Output \hideinitializer */ -#define PC1 GPIO_PIN_DATA(2, 1 ) /*!< Specify PC.1 Pin Data Input/Output \hideinitializer */ -#define PC2 GPIO_PIN_DATA(2, 2 ) /*!< Specify PC.2 Pin Data Input/Output \hideinitializer */ -#define PC3 GPIO_PIN_DATA(2, 3 ) /*!< Specify PC.3 Pin Data Input/Output \hideinitializer */ -#define PC4 GPIO_PIN_DATA(2, 4 ) /*!< Specify PC.4 Pin Data Input/Output \hideinitializer */ -#define PC5 GPIO_PIN_DATA(2, 5 ) /*!< Specify PC.5 Pin Data Input/Output \hideinitializer */ -#define PC6 GPIO_PIN_DATA(2, 6 ) /*!< Specify PC.6 Pin Data Input/Output \hideinitializer */ -#define PC7 GPIO_PIN_DATA(2, 7 ) /*!< Specify PC.7 Pin Data Input/Output \hideinitializer */ -#define PC8 GPIO_PIN_DATA(2, 8 ) /*!< Specify PC.8 Pin Data Input/Output \hideinitializer */ -#define PC9 GPIO_PIN_DATA(2, 9 ) /*!< Specify PC.9 Pin Data Input/Output \hideinitializer */ -#define PC10 GPIO_PIN_DATA(2, 10) /*!< Specify PC.10 Pin Data Input/Output \hideinitializer */ -#define PC11 GPIO_PIN_DATA(2, 11) /*!< Specify PC.11 Pin Data Input/Output \hideinitializer */ -#define PC12 GPIO_PIN_DATA(2, 12) /*!< Specify PC.12 Pin Data Input/Output \hideinitializer */ -#define PC13 GPIO_PIN_DATA(2, 13) /*!< Specify PC.13 Pin Data Input/Output \hideinitializer */ -#define PC14 GPIO_PIN_DATA(2, 14) /*!< Specify PC.14 Pin Data Input/Output \hideinitializer */ -#define PD0 GPIO_PIN_DATA(3, 0 ) /*!< Specify PD.0 Pin Data Input/Output \hideinitializer */ -#define PD1 GPIO_PIN_DATA(3, 1 ) /*!< Specify PD.1 Pin Data Input/Output \hideinitializer */ -#define PD2 GPIO_PIN_DATA(3, 2 ) /*!< Specify PD.2 Pin Data Input/Output \hideinitializer */ -#define PD3 GPIO_PIN_DATA(3, 3 ) /*!< Specify PD.3 Pin Data Input/Output \hideinitializer */ -#define PD4 GPIO_PIN_DATA(3, 4 ) /*!< Specify PD.4 Pin Data Input/Output \hideinitializer */ -#define PD5 GPIO_PIN_DATA(3, 5 ) /*!< Specify PD.5 Pin Data Input/Output \hideinitializer */ -#define PD6 GPIO_PIN_DATA(3, 6 ) /*!< Specify PD.6 Pin Data Input/Output \hideinitializer */ -#define PD7 GPIO_PIN_DATA(3, 7 ) /*!< Specify PD.7 Pin Data Input/Output \hideinitializer */ -#define PD8 GPIO_PIN_DATA(3, 8 ) /*!< Specify PD.8 Pin Data Input/Output \hideinitializer */ -#define PD9 GPIO_PIN_DATA(3, 9 ) /*!< Specify PD.9 Pin Data Input/Output \hideinitializer */ -#define PD10 GPIO_PIN_DATA(3, 10) /*!< Specify PD.10 Pin Data Input/Output \hideinitializer */ -#define PD11 GPIO_PIN_DATA(3, 11) /*!< Specify PD.11 Pin Data Input/Output \hideinitializer */ -#define PD12 GPIO_PIN_DATA(3, 12) /*!< Specify PD.12 Pin Data Input/Output \hideinitializer */ -#define PD13 GPIO_PIN_DATA(3, 13) /*!< Specify PD.13 Pin Data Input/Output \hideinitializer */ -#define PD14 GPIO_PIN_DATA(3, 14) /*!< Specify PD.14 Pin Data Input/Output \hideinitializer */ -#define PE0 GPIO_PIN_DATA(4, 0 ) /*!< Specify PE.0 Pin Data Input/Output \hideinitializer */ -#define PE1 GPIO_PIN_DATA(4, 1 ) /*!< Specify PE.1 Pin Data Input/Output \hideinitializer */ -#define PE2 GPIO_PIN_DATA(4, 2 ) /*!< Specify PE.2 Pin Data Input/Output \hideinitializer */ -#define PE3 GPIO_PIN_DATA(4, 3 ) /*!< Specify PE.3 Pin Data Input/Output \hideinitializer */ -#define PE4 GPIO_PIN_DATA(4, 4 ) /*!< Specify PE.4 Pin Data Input/Output \hideinitializer */ -#define PE5 GPIO_PIN_DATA(4, 5 ) /*!< Specify PE.5 Pin Data Input/Output \hideinitializer */ -#define PE6 GPIO_PIN_DATA(4, 6 ) /*!< Specify PE.6 Pin Data Input/Output \hideinitializer */ -#define PE7 GPIO_PIN_DATA(4, 7 ) /*!< Specify PE.7 Pin Data Input/Output \hideinitializer */ -#define PE8 GPIO_PIN_DATA(4, 8 ) /*!< Specify PE.8 Pin Data Input/Output \hideinitializer */ -#define PE9 GPIO_PIN_DATA(4, 9 ) /*!< Specify PE.9 Pin Data Input/Output \hideinitializer */ -#define PE10 GPIO_PIN_DATA(4, 10) /*!< Specify PE.10 Pin Data Input/Output \hideinitializer */ -#define PE11 GPIO_PIN_DATA(4, 11) /*!< Specify PE.11 Pin Data Input/Output \hideinitializer */ -#define PE12 GPIO_PIN_DATA(4, 12) /*!< Specify PE.12 Pin Data Input/Output \hideinitializer */ -#define PE13 GPIO_PIN_DATA(4, 13) /*!< Specify PE.13 Pin Data Input/Output \hideinitializer */ -#define PE14 GPIO_PIN_DATA(4, 14) /*!< Specify PE.14 Pin Data Input/Output \hideinitializer */ -#define PE15 GPIO_PIN_DATA(4, 15) /*!< Specify PE.15 Pin Data Input/Output \hideinitializer */ -#define PF0 GPIO_PIN_DATA(5, 0 ) /*!< Specify PF.0 Pin Data Input/Output \hideinitializer */ -#define PF1 GPIO_PIN_DATA(5, 1 ) /*!< Specify PF.1 Pin Data Input/Output \hideinitializer */ -#define PF2 GPIO_PIN_DATA(5, 2 ) /*!< Specify PF.2 Pin Data Input/Output \hideinitializer */ -#define PF3 GPIO_PIN_DATA(5, 3 ) /*!< Specify PF.3 Pin Data Input/Output \hideinitializer */ -#define PF4 GPIO_PIN_DATA(5, 4 ) /*!< Specify PF.4 Pin Data Input/Output \hideinitializer */ -#define PF5 GPIO_PIN_DATA(5, 5 ) /*!< Specify PF.5 Pin Data Input/Output \hideinitializer */ -#define PF6 GPIO_PIN_DATA(5, 6 ) /*!< Specify PF.6 Pin Data Input/Output \hideinitializer */ -#define PF7 GPIO_PIN_DATA(5, 7 ) /*!< Specify PF.7 Pin Data Input/Output \hideinitializer */ -#define PF8 GPIO_PIN_DATA(5, 8 ) /*!< Specify PF.8 Pin Data Input/Output \hideinitializer */ -#define PF9 GPIO_PIN_DATA(5, 9 ) /*!< Specify PF.9 Pin Data Input/Output \hideinitializer */ -#define PF10 GPIO_PIN_DATA(5, 10) /*!< Specify PF.10 Pin Data Input/Output \hideinitializer */ -#define PF11 GPIO_PIN_DATA(5, 11) /*!< Specify PF.11 Pin Data Input/Output \hideinitializer */ -#define PG0 GPIO_PIN_DATA(6, 0 ) /*!< Specify PG.0 Pin Data Input/Output \hideinitializer */ -#define PG1 GPIO_PIN_DATA(6, 1 ) /*!< Specify PG.1 Pin Data Input/Output \hideinitializer */ -#define PG2 GPIO_PIN_DATA(6, 2 ) /*!< Specify PG.2 Pin Data Input/Output \hideinitializer */ -#define PG3 GPIO_PIN_DATA(6, 3 ) /*!< Specify PG.3 Pin Data Input/Output \hideinitializer */ -#define PG4 GPIO_PIN_DATA(6, 4 ) /*!< Specify PG.4 Pin Data Input/Output \hideinitializer */ -#define PG5 GPIO_PIN_DATA(6, 5 ) /*!< Specify PG.5 Pin Data Input/Output \hideinitializer */ -#define PG6 GPIO_PIN_DATA(6, 6 ) /*!< Specify PG.6 Pin Data Input/Output \hideinitializer */ -#define PG7 GPIO_PIN_DATA(6, 7 ) /*!< Specify PG.7 Pin Data Input/Output \hideinitializer */ -#define PG8 GPIO_PIN_DATA(6, 8 ) /*!< Specify PG.8 Pin Data Input/Output \hideinitializer */ -#define PG9 GPIO_PIN_DATA(6, 9 ) /*!< Specify PG.9 Pin Data Input/Output \hideinitializer */ -#define PG10 GPIO_PIN_DATA(6, 10) /*!< Specify PG.10 Pin Data Input/Output \hideinitializer */ -#define PG11 GPIO_PIN_DATA(6, 11) /*!< Specify PG.11 Pin Data Input/Output \hideinitializer */ -#define PG12 GPIO_PIN_DATA(6, 12) /*!< Specify PG.12 Pin Data Input/Output \hideinitializer */ -#define PG13 GPIO_PIN_DATA(6, 13) /*!< Specify PG.13 Pin Data Input/Output \hideinitializer */ -#define PG14 GPIO_PIN_DATA(6, 14) /*!< Specify PG.14 Pin Data Input/Output \hideinitializer */ -#define PG15 GPIO_PIN_DATA(6, 15) /*!< Specify PG.15 Pin Data Input/Output \hideinitializer */ -#define PH0 GPIO_PIN_DATA(7, 0 ) /*!< Specify PH.0 Pin Data Input/Output \hideinitializer */ -#define PH1 GPIO_PIN_DATA(7, 1 ) /*!< Specify PH.1 Pin Data Input/Output \hideinitializer */ -#define PH2 GPIO_PIN_DATA(7, 2 ) /*!< Specify PH.2 Pin Data Input/Output \hideinitializer */ -#define PH3 GPIO_PIN_DATA(7, 3 ) /*!< Specify PH.3 Pin Data Input/Output \hideinitializer */ -#define PH4 GPIO_PIN_DATA(7, 4 ) /*!< Specify PH.4 Pin Data Input/Output \hideinitializer */ -#define PH5 GPIO_PIN_DATA(7, 5 ) /*!< Specify PH.5 Pin Data Input/Output \hideinitializer */ -#define PH6 GPIO_PIN_DATA(7, 6 ) /*!< Specify PH.6 Pin Data Input/Output \hideinitializer */ -#define PH7 GPIO_PIN_DATA(7, 7 ) /*!< Specify PH.7 Pin Data Input/Output \hideinitializer */ -#define PH8 GPIO_PIN_DATA(7, 8 ) /*!< Specify PH.8 Pin Data Input/Output \hideinitializer */ -#define PH9 GPIO_PIN_DATA(7, 9 ) /*!< Specify PH.9 Pin Data Input/Output \hideinitializer */ -#define PH10 GPIO_PIN_DATA(7, 10) /*!< Specify PH.10 Pin Data Input/Output \hideinitializer */ -#define PH11 GPIO_PIN_DATA(7, 11) /*!< Specify PH.11 Pin Data Input/Output \hideinitializer */ -#define PH12 GPIO_PIN_DATA(7, 12) /*!< Specify PH.12 Pin Data Input/Output \hideinitializer */ -#define PH13 GPIO_PIN_DATA(7, 13) /*!< Specify PH.13 Pin Data Input/Output \hideinitializer */ -#define PH14 GPIO_PIN_DATA(7, 14) /*!< Specify PH.14 Pin Data Input/Output \hideinitializer */ -#define PH15 GPIO_PIN_DATA(7, 15) /*!< Specify PH.15 Pin Data Input/Output \hideinitializer */ -#define PI0 GPIO_PIN_DATA(8, 0 ) /*!< Specify PI.0 Pin Data Input/Output \hideinitializer */ -#define PI1 GPIO_PIN_DATA(8, 1 ) /*!< Specify PI.1 Pin Data Input/Output \hideinitializer */ -#define PI2 GPIO_PIN_DATA(8, 2 ) /*!< Specify PI.2 Pin Data Input/Output \hideinitializer */ -#define PI3 GPIO_PIN_DATA(8, 3 ) /*!< Specify PI.3 Pin Data Input/Output \hideinitializer */ -#define PI4 GPIO_PIN_DATA(8, 4 ) /*!< Specify PI.4 Pin Data Input/Output \hideinitializer */ -#define PI5 GPIO_PIN_DATA(8, 5 ) /*!< Specify PI.5 Pin Data Input/Output \hideinitializer */ -#define PI6 GPIO_PIN_DATA(8, 6 ) /*!< Specify PI.6 Pin Data Input/Output \hideinitializer */ -#define PI7 GPIO_PIN_DATA(8, 7 ) /*!< Specify PI.7 Pin Data Input/Output \hideinitializer */ -#define PI8 GPIO_PIN_DATA(8, 8 ) /*!< Specify PI.8 Pin Data Input/Output \hideinitializer */ -#define PI9 GPIO_PIN_DATA(8, 9 ) /*!< Specify PI.9 Pin Data Input/Output \hideinitializer */ -#define PI10 GPIO_PIN_DATA(8, 10) /*!< Specify PI.10 Pin Data Input/Output \hideinitializer */ -#define PI11 GPIO_PIN_DATA(8, 11) /*!< Specify PI.11 Pin Data Input/Output \hideinitializer */ -#define PI12 GPIO_PIN_DATA(8, 12) /*!< Specify PI.12 Pin Data Input/Output \hideinitializer */ -#define PI13 GPIO_PIN_DATA(8, 13) /*!< Specify PI.13 Pin Data Input/Output \hideinitializer */ -#define PI14 GPIO_PIN_DATA(8, 14) /*!< Specify PI.14 Pin Data Input/Output \hideinitializer */ -#define PI15 GPIO_PIN_DATA(8, 15) /*!< Specify PI.15 Pin Data Input/Output \hideinitializer */ -#define PJ0 GPIO_PIN_DATA(9, 0 ) /*!< Specify PJ.0 Pin Data Input/Output \hideinitializer */ -#define PJ1 GPIO_PIN_DATA(9, 1 ) /*!< Specify PJ.1 Pin Data Input/Output \hideinitializer */ -#define PJ2 GPIO_PIN_DATA(9, 2 ) /*!< Specify PJ.2 Pin Data Input/Output \hideinitializer */ -#define PJ3 GPIO_PIN_DATA(9, 3 ) /*!< Specify PJ.3 Pin Data Input/Output \hideinitializer */ -#define PJ4 GPIO_PIN_DATA(9, 4 ) /*!< Specify PJ.4 Pin Data Input/Output \hideinitializer */ -#define PJ5 GPIO_PIN_DATA(9, 5 ) /*!< Specify PJ.5 Pin Data Input/Output \hideinitializer */ -#define PJ6 GPIO_PIN_DATA(9, 6 ) /*!< Specify PJ.6 Pin Data Input/Output \hideinitializer */ -#define PJ7 GPIO_PIN_DATA(9, 7 ) /*!< Specify PJ.7 Pin Data Input/Output \hideinitializer */ -#define PJ8 GPIO_PIN_DATA(9, 8 ) /*!< Specify PJ.8 Pin Data Input/Output \hideinitializer */ -#define PJ9 GPIO_PIN_DATA(9, 9 ) /*!< Specify PJ.9 Pin Data Input/Output \hideinitializer */ -#define PJ10 GPIO_PIN_DATA(9, 10) /*!< Specify PJ.10 Pin Data Input/Output \hideinitializer */ -#define PJ11 GPIO_PIN_DATA(9, 11) /*!< Specify PJ.11 Pin Data Input/Output \hideinitializer */ -#define PJ12 GPIO_PIN_DATA(9, 12) /*!< Specify PJ.12 Pin Data Input/Output \hideinitializer */ -#define PJ13 GPIO_PIN_DATA(9, 13) /*!< Specify PJ.13 Pin Data Input/Output \hideinitializer */ -#define PJ14 GPIO_PIN_DATA(9, 14) /*!< Specify PJ.14 Pin Data Input/Output \hideinitializer */ -#define PJ15 GPIO_PIN_DATA(9, 15) /*!< Specify PJ.15 Pin Data Input/Output \hideinitializer */ -#define PK0 GPIO_PIN_DATA(10 , 0 ) /*!< Specify PK.0 Pin Data Input/Output \hideinitializer */ -#define PK1 GPIO_PIN_DATA(10 , 1 ) /*!< Specify PK.1 Pin Data Input/Output \hideinitializer */ -#define PK2 GPIO_PIN_DATA(10 , 2 ) /*!< Specify PK.2 Pin Data Input/Output \hideinitializer */ -#define PK3 GPIO_PIN_DATA(10 , 3 ) /*!< Specify PK.3 Pin Data Input/Output \hideinitializer */ -#define PK4 GPIO_PIN_DATA(10 , 4 ) /*!< Specify PK.4 Pin Data Input/Output \hideinitializer */ -#define PK5 GPIO_PIN_DATA(10 , 5 ) /*!< Specify PK.5 Pin Data Input/Output \hideinitializer */ -#define PK6 GPIO_PIN_DATA(10 , 6 ) /*!< Specify PK.6 Pin Data Input/Output \hideinitializer */ -#define PK7 GPIO_PIN_DATA(10 , 7 ) /*!< Specify PK.7 Pin Data Input/Output \hideinitializer */ -#define PK8 GPIO_PIN_DATA(10 , 8 ) /*!< Specify PK.8 Pin Data Input/Output \hideinitializer */ -#define PK9 GPIO_PIN_DATA(10 , 9 ) /*!< Specify PK.9 Pin Data Input/Output \hideinitializer */ -#define PK10 GPIO_PIN_DATA(10 , 10) /*!< Specify PK.10 Pin Data Input/Output \hideinitializer */ -#define PK11 GPIO_PIN_DATA(10 , 11) /*!< Specify PK.11 Pin Data Input/Output \hideinitializer */ -#define PK12 GPIO_PIN_DATA(10 , 12) /*!< Specify PK.12 Pin Data Input/Output \hideinitializer */ -#define PK13 GPIO_PIN_DATA(10 , 13) /*!< Specify PK.13 Pin Data Input/Output \hideinitializer */ -#define PK14 GPIO_PIN_DATA(10 , 14) /*!< Specify PK.14 Pin Data Input/Output \hideinitializer */ -#define PK15 GPIO_PIN_DATA(10 , 15) /*!< Specify PK.15 Pin Data Input/Output \hideinitializer */ -#define PL0 GPIO_PIN_DATA(11, 0 ) /*!< Specify PL.0 Pin Data Input/Output \hideinitializer */ -#define PL1 GPIO_PIN_DATA(11, 1 ) /*!< Specify PL.1 Pin Data Input/Output \hideinitializer */ -#define PL2 GPIO_PIN_DATA(11, 2 ) /*!< Specify PL.2 Pin Data Input/Output \hideinitializer */ -#define PL3 GPIO_PIN_DATA(11, 3 ) /*!< Specify PL.3 Pin Data Input/Output \hideinitializer */ -#define PL4 GPIO_PIN_DATA(11, 4 ) /*!< Specify PL.4 Pin Data Input/Output \hideinitializer */ -#define PL5 GPIO_PIN_DATA(11, 5 ) /*!< Specify PL.5 Pin Data Input/Output \hideinitializer */ -#define PL6 GPIO_PIN_DATA(11, 6 ) /*!< Specify PL.6 Pin Data Input/Output \hideinitializer */ -#define PL7 GPIO_PIN_DATA(11, 7 ) /*!< Specify PL.7 Pin Data Input/Output \hideinitializer */ -#define PL8 GPIO_PIN_DATA(11, 8 ) /*!< Specify PL.8 Pin Data Input/Output \hideinitializer */ -#define PL9 GPIO_PIN_DATA(11, 9 ) /*!< Specify PL.9 Pin Data Input/Output \hideinitializer */ -#define PL10 GPIO_PIN_DATA(11, 10) /*!< Specify PL.10 Pin Data Input/Output \hideinitializer */ -#define PL11 GPIO_PIN_DATA(11, 11) /*!< Specify PL.11 Pin Data Input/Output \hideinitializer */ -#define PL12 GPIO_PIN_DATA(11, 12) /*!< Specify PL.12 Pin Data Input/Output \hideinitializer */ -#define PL13 GPIO_PIN_DATA(11, 13) /*!< Specify PL.13 Pin Data Input/Output \hideinitializer */ -#define PL14 GPIO_PIN_DATA(11, 14) /*!< Specify PL.14 Pin Data Input/Output \hideinitializer */ -#define PL15 GPIO_PIN_DATA(11, 15) /*!< Specify PL.15 Pin Data Input/Output \hideinitializer */ -#define PM0 GPIO_PIN_DATA(12, 0 ) /*!< Specify PH.0 Pin Data Input/Output \hideinitializer */ -#define PM1 GPIO_PIN_DATA(12, 1 ) /*!< Specify PH.1 Pin Data Input/Output \hideinitializer */ -#define PM2 GPIO_PIN_DATA(12, 2 ) /*!< Specify PH.2 Pin Data Input/Output \hideinitializer */ -#define PM3 GPIO_PIN_DATA(12, 3 ) /*!< Specify PH.3 Pin Data Input/Output \hideinitializer */ -#define PM4 GPIO_PIN_DATA(12, 4 ) /*!< Specify PH.4 Pin Data Input/Output \hideinitializer */ -#define PM5 GPIO_PIN_DATA(12, 5 ) /*!< Specify PH.5 Pin Data Input/Output \hideinitializer */ -#define PM6 GPIO_PIN_DATA(12, 6 ) /*!< Specify PH.6 Pin Data Input/Output \hideinitializer */ -#define PM7 GPIO_PIN_DATA(12, 7 ) /*!< Specify PH.7 Pin Data Input/Output \hideinitializer */ -#define PM8 GPIO_PIN_DATA(12, 8 ) /*!< Specify PH.8 Pin Data Input/Output \hideinitializer */ -#define PM9 GPIO_PIN_DATA(12, 9 ) /*!< Specify PH.9 Pin Data Input/Output \hideinitializer */ -#define PM10 GPIO_PIN_DATA(12, 10) /*!< Specify PH.10 Pin Data Input/Output \hideinitializer */ -#define PM11 GPIO_PIN_DATA(12, 11) /*!< Specify PH.11 Pin Data Input/Output \hideinitializer */ -#define PM12 GPIO_PIN_DATA(12, 12) /*!< Specify PH.12 Pin Data Input/Output \hideinitializer */ -#define PM13 GPIO_PIN_DATA(12, 13) /*!< Specify PH.13 Pin Data Input/Output \hideinitializer */ -#define PM14 GPIO_PIN_DATA(12, 14) /*!< Specify PH.14 Pin Data Input/Output \hideinitializer */ -#define PM15 GPIO_PIN_DATA(12, 15) /*!< Specify PH.15 Pin Data Input/Output \hideinitializer */ -#define PN0 GPIO_PIN_DATA(13, 0 ) /*!< Specify PH.0 Pin Data Input/Output \hideinitializer */ -#define PN1 GPIO_PIN_DATA(13, 1 ) /*!< Specify PH.1 Pin Data Input/Output \hideinitializer */ -#define PN2 GPIO_PIN_DATA(13, 2 ) /*!< Specify PH.2 Pin Data Input/Output \hideinitializer */ -#define PN3 GPIO_PIN_DATA(13, 3 ) /*!< Specify PH.3 Pin Data Input/Output \hideinitializer */ -#define PN4 GPIO_PIN_DATA(13, 4 ) /*!< Specify PH.4 Pin Data Input/Output \hideinitializer */ -#define PN5 GPIO_PIN_DATA(13, 5 ) /*!< Specify PH.5 Pin Data Input/Output \hideinitializer */ -#define PN6 GPIO_PIN_DATA(13, 6 ) /*!< Specify PH.6 Pin Data Input/Output \hideinitializer */ -#define PN7 GPIO_PIN_DATA(13, 7 ) /*!< Specify PH.7 Pin Data Input/Output \hideinitializer */ -#define PN8 GPIO_PIN_DATA(13, 8 ) /*!< Specify PH.8 Pin Data Input/Output \hideinitializer */ -#define PN9 GPIO_PIN_DATA(13, 9 ) /*!< Specify PH.9 Pin Data Input/Output \hideinitializer */ -#define PN10 GPIO_PIN_DATA(13, 10) /*!< Specify PH.10 Pin Data Input/Output \hideinitializer */ -#define PN11 GPIO_PIN_DATA(13, 11) /*!< Specify PH.11 Pin Data Input/Output \hideinitializer */ -#define PN12 GPIO_PIN_DATA(13, 12) /*!< Specify PH.12 Pin Data Input/Output \hideinitializer */ -#define PN13 GPIO_PIN_DATA(13, 13) /*!< Specify PH.13 Pin Data Input/Output \hideinitializer */ -#define PN14 GPIO_PIN_DATA(13, 14) /*!< Specify PH.14 Pin Data Input/Output \hideinitializer */ -#define PN15 GPIO_PIN_DATA(13, 15) /*!< Specify PH.15 Pin Data Input/Output \hideinitializer */ - -/*@}*/ /* end of group GPIO_EXPORTED_CONSTANTS */ - - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Clear GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Clear the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_CLR_INT_FLAG(port, u32PinMask) ((port)->INTSRC = (u32PinMask)) - -/** - * @brief Disable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask)) - -/** - * @brief Enable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * @return None - * - * @details Enable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask)) - -/** - * @brief Disable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16)) - -/** - * @brief Enable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Enable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16)) - -/** - * @brief Disable I/O DOUT mask - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask)) - -/** - * @brief Enable I/O DOUT mask - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Enable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask)) - -/** - * @brief Get GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @retval 0 No interrupt at specified GPIO pin - * @retval 1 The specified GPIO pin generate an interrupt - * - * @details Get the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask)) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] u32Port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32ClkSrc The de-bounce counter clock source. It could be GPIO_DBCTL_DBCLKSRC_HXT or GPIO_DBCTL_DBCLKSRC_LIRC. - * @param[in] u32ClkSel The de-bounce sampling cycle selection. It could be - * - \ref GPIO_DBCTL_DBCLKSEL_1 - * - \ref GPIO_DBCTL_DBCLKSEL_2 - * - \ref GPIO_DBCTL_DBCLKSEL_4 - * - \ref GPIO_DBCTL_DBCLKSEL_8 - * - \ref GPIO_DBCTL_DBCLKSEL_16 - * - \ref GPIO_DBCTL_DBCLKSEL_32 - * - \ref GPIO_DBCTL_DBCLKSEL_64 - * - \ref GPIO_DBCTL_DBCLKSEL_128 - * - \ref GPIO_DBCTL_DBCLKSEL_256 - * - \ref GPIO_DBCTL_DBCLKSEL_512 - * - \ref GPIO_DBCTL_DBCLKSEL_1024 - * - \ref GPIO_DBCTL_DBCLKSEL_2048 - * - \ref GPIO_DBCTL_DBCLKSEL_4096 - * - \ref GPIO_DBCTL_DBCLKSEL_8192 - * - \ref GPIO_DBCTL_DBCLKSEL_16384 - * - \ref GPIO_DBCTL_DBCLKSEL_32768 - * - * @return None - * - * @details Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source. \n - * Example: _GPIO_SET_DEBOUNCE_TIME(GPIO_DBCTL_DBCLKSRC_LIRC, GPIO_DBCTL_DBCLKSEL_4). \n - * It's meaning the De-debounce counter clock source is internal 10 KHz and sampling cycle selection is 4. \n - * Then the target de-bounce sampling cycle time is (4)*(1/(10*1000)) s = 4*0.0001 s = 400 us, - * and system will sampling interrupt input once per 00 us. - * \hideinitializer - */ -#define GPIO_SET_DEBOUNCE_TIME(u32Port, u32ClkSrc, u32ClkSel) (u32Port->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) - -/** - * @brief Get GPIO Port IN Data - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * - * @return The specified port data - * - * @details Get the PIN register of specified GPIO port. - * \hideinitializer - */ -#define GPIO_GET_IN_DATA(port) ((port)->PIN) - -/** - * @brief Set GPIO Port OUT Data - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32Data GPIO port data. - * - * @return None - * - * @details Set the Data into specified GPIO port. - * \hideinitializer - */ -#define GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data)) - -/** - * @brief Toggle Specified GPIO pin - * - * @param[in] u32Pin Pxy - * - * @return None - * - * @details Toggle the specified GPIO pint. - * \hideinitializer - */ -#define GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1) - - -/** - * @brief Enable External GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be \n - * GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_EnableEINT GPIO_EnableInt - -/** - * @brief Disable External GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK,PL, PM and PN. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_DisableEINT GPIO_DisableInt - - -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs); -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin); -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_SetDrivingCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Driving); -void GPIO_SetSchmittTriggere(GPIO_T *port, uint32_t u32PinMask, uint32_t u32SchmittTrigger); -void GPIO_SetPowerMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32PowerMode); -uint32_t GPIO_GetPowerMode(GPIO_T *port, uint32_t u32PinNo); -uint32_t GPIO_GetSchmittTriggere(GPIO_T *port, uint32_t u32PinNo); -uint32_t GPIO_GetDrivingCtl(GPIO_T *port, uint32_t u32PinNo); - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __GPIO_H__ */ diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_hwsem.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_hwsem.h deleted file mode 100644 index a46de00ae00..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_hwsem.h +++ /dev/null @@ -1,205 +0,0 @@ -/**************************************************************************//** - * @file nu_hwsem.h - * @brief HWSEM driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_HWSEM_H__ -#define __NU_HWSEM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifdef __has_include - #if __has_include("rtconfig.h") - #include "rtconfig.h" - #endif -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup HWSEM_Driver HWSEM Driver - @{ -*/ - -/** @addtogroup HWSEM_EXPORTED_CONSTANTS HWSEM Exported Constants - @{ -*/ -#define HWSEM_CNT 8ul /*!CTL |= (HWSEM_CTL_SEM0RST_Msk << (u32Num))) - -/** - * @brief - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * - * @retval 0 The specified semaphore is not locked. - * Otherwise The specified semaphore is locked. - * \hideinitializer - */ -#define HWSEM_IS_LOCKED(hwsem, u32Num) ((hwsem)->SEM[(u32Num)] & (HWSEM_SEM_ID_Msk)) - -/** - * @brief - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * - * @retval 0 The key of specified semaphore. - * \hideinitializer - */ -#define HWSEM_GET_KEY(hwsem, u32Num) (((hwsem)->SEM[(u32Num)]&HWSEM_SEM_KEY_Msk) >> HWSEM_SEM_KEY_Pos) - -/** - * @brief Enable specified HWSEM interrupt - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * - * - * \hideinitializer - */ -#define HWSEM_ENABLE_INT(hwsem, u32Num) ((hwsem)->INTEN_CORE |= (HWSEM_INTEN_SEM0IEN_Msk << (u32Num))) - - -/** - * @brief Disable specified HWSEM interrupt - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * - * - * \hideinitializer - */ -#define HWSEM_DISABLE_INT(hwsem, u32Num) ((hwsem)->INTEN_CORE &= ~(HWSEM_INTEN_SEM0IEN_Msk << (u32Num))) - -/** - * @brief Get specified interrupt flag - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * - * @retval 0 The specified interrupt is not happened. - * Otherwise The specified interrupt is happened. - * \hideinitializer - */ -#define HWSEM_GET_INT_FLAG(hwsem, u32Num) ((hwsem)->INTSTS_CORE & (HWSEM_INTSTS_SEM0IF_Msk << (u32Num))) - - -/** - * @brief Clear specified interrupt flag - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * - * \hideinitializer - */ -#define HWSEM_CLR_INT_FLAG(hwsem, u32Num) ((hwsem)->INTSTS_CORE = (HWSEM_INTSTS_SEM0IF_Msk << (u32Num))) - - -/** - * @brief Unlock specified semaphore - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * @param[in] u8Key HWSEM channel key - * - * \hideinitializer - */ -#define HWSEM_UNLOCK(hwsem, u32Num, u8Key) ((hwsem)->SEM[(u32Num)] = ((u8Key) << HWSEM_SEM_KEY_Pos) & HWSEM_SEM_KEY_Msk) -#define HWSEM_LOCK HWSEM_UNLOCK - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE int32_t HWSEM_Try_Lock(HWSEM_T *hwsem, uint32_t u32Num, uint8_t u8Key); -__STATIC_INLINE void HWSEM_Spin_Lock(HWSEM_T *hwsem, uint32_t u32Num, uint8_t u8Key); - -/** - * @brief Try to lock specified semaphore - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * @param[in] u8Key HWSEM channel key - * @retval 0 Successfully acquire semaphore - * @retval -1 Failed to acquire semaphore - * \hideinitializer - */ -__STATIC_INLINE int32_t HWSEM_Try_Lock(HWSEM_T *hwsem, uint32_t u32Num, uint8_t u8Key) -{ - hwsem->SEM[u32Num] = (u8Key << HWSEM_SEM_KEY_Pos); - if ((hwsem->SEM[u32Num] & HWSEM_SEM_ID_Msk) == HWSEM_LOCK_BY_OWNER && - (hwsem->SEM[u32Num] & HWSEM_SEM_KEY_Msk) == (u8Key << HWSEM_SEM_KEY_Pos)) - return 0; - else - return -1; -} - -/** - * @brief Spin until lock specified semaphore - * - * @param[in] hwsem The pointer of the specified HWSEM module. - * @param[in] u32Num HWSEM number, valid values are between 0~7 - * @param[in] u8Key HWSEM channel key - * - * \hideinitializer - */ -__STATIC_INLINE void HWSEM_Spin_Lock(HWSEM_T *hwsem, uint32_t u32Num, uint8_t u8Key) -{ - while (1) - { - hwsem->SEM[u32Num] = (u8Key << HWSEM_SEM_KEY_Pos); - if ((hwsem->SEM[u32Num] & HWSEM_SEM_ID_Msk) == HWSEM_LOCK_BY_OWNER && - (hwsem->SEM[u32Num] & HWSEM_SEM_KEY_Msk) == (u8Key << HWSEM_SEM_KEY_Pos)) - break; - } -} - -/*@}*/ /* end of group HWSEM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group HWSEM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2c.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2c.h deleted file mode 100644 index 373b02d8c7b..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2c.h +++ /dev/null @@ -1,296 +0,0 @@ -/****************************************************************************//** - * @file nu_i2c.h - * @brief I2C driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_I2C_H__ -#define __NU_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - -/** @addtogroup I2C_EXPORTED_CONSTANTS I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_CTL_STA_SI 0x28UL /*!< I2C_CTL setting for I2C control bits. It would set STA and SI bits \hideinitializer */ -#define I2C_CTL_STA_SI_AA 0x2CUL /*!< I2C_CTL setting for I2C control bits. It would set STA, SI and AA bits \hideinitializer */ -#define I2C_CTL_STO_SI 0x18UL /*!< I2C_CTL setting for I2C control bits. It would set STO and SI bits \hideinitializer */ -#define I2C_CTL_STO_SI_AA 0x1CUL /*!< I2C_CTL setting for I2C control bits. It would set STO, SI and AA bits \hideinitializer */ -#define I2C_CTL_SI 0x08UL /*!< I2C_CTL setting for I2C control bits. It would set SI bit \hideinitializer */ -#define I2C_CTL_SI_AA 0x0CUL /*!< I2C_CTL setting for I2C control bits. It would set SI and AA bits \hideinitializer */ -#define I2C_CTL_STA 0x20UL /*!< I2C_CTL setting for I2C control bits. It would set STA bit \hideinitializer */ -#define I2C_CTL_STO 0x10UL /*!< I2C_CTL setting for I2C control bits. It would set STO bit \hideinitializer */ -#define I2C_CTL_AA 0x04UL /*!< I2C_CTL setting for I2C control bits. It would set AA bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_GCMODE_ENABLE 1 /*!< Enable I2C GC Mode \hideinitializer */ -#define I2C_GCMODE_DISABLE 0 /*!< Disable I2C GC Mode \hideinitializer */ - -/*@}*/ /* end of group I2C_EXPORTED_CONSTANTS */ - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ -/** - * @brief The macro is used to set I2C bus condition at One Time - * - * @param[in] i2c Specify I2C port - * @param[in] u8Ctrl A byte writes to I2C control register - * - * @return None - * - * @details Set I2C_CTL register to control I2C bus conditions of START, STOP, SI, ACK. - * \hideinitializer - */ -#define I2C_SET_CONTROL_REG(i2c, u8Ctrl) ((i2c)->CTL0 = ((i2c)->CTL0 & ~0x3c) | (u8Ctrl)) - -/** - * @brief The macro is used to set START condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus START condition in I2C_CTL register. - * \hideinitializer - */ -#define I2C_START(i2c) ((i2c)->CTL0 = ((i2c)->CTL0 & ~I2C_CTL0_SI_Msk) | I2C_CTL0_STA_Msk) - -/** - * @brief The macro is used to wait I2C bus status get ready - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When a new status is presented of I2C bus, the SI flag will be set in I2C_CTL register. - * \hideinitializer - */ -#define I2C_WAIT_READY(i2c) while(!((i2c)->CTL0 & I2C_CTL0_SI_Msk)) - -/** - * @brief The macro is used to Read I2C Bus Data Register - * - * @param[in] i2c Specify I2C port - * - * @return A byte of I2C data register - * - * @details I2C controller read data from bus and save it in I2CDAT register. - * \hideinitializer - */ -#define I2C_GET_DATA(i2c) ((i2c)->DAT) - -/** - * @brief Write a Data to I2C Data Register - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data A byte that writes to data register - * - * @return None - * - * @details When write a data to I2C_DAT register, the I2C controller will shift it to I2C bus. - * \hideinitializer - */ -#define I2C_SET_DATA(i2c, u8Data) ((i2c)->DAT = (u8Data)) - -/** - * @brief Get I2C Bus status code - * - * @param[in] i2c Specify I2C port - * - * @return I2C status code - * - * @details To get this status code to monitor I2C bus event. - * \hideinitializer - */ -#define I2C_GET_STATUS(i2c) ((i2c)->STATUS0) - -/** - * @brief Get Time-out flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 I2C Bus time-out is not happened - * @retval 1 I2C Bus time-out is happened - * - * @details When I2C bus occurs time-out event, the time-out flag will be set. - * \hideinitializer - */ -#define I2C_GET_TIMEOUT_FLAG(i2c) ( ((i2c)->TOCTL & I2C_TOCTL_TOIF_Msk) == I2C_TOCTL_TOIF_Msk ? 1:0 ) - -/** - * @brief To get wake-up flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details I2C bus occurs wake-up event, wake-up flag will be set. - * \hideinitializer - */ -#define I2C_GET_WAKEUP_FLAG(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKIF_Msk) == I2C_WKSTS_WKIF_Msk ? 1:0 ) - -/** - * @brief To clear wake-up flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define I2C_CLEAR_WAKEUP_FLAG(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKIF_Msk) - -/** - * @brief Enable RX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set RXPDMAEN bit of I2C_CTL1 register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_RX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Enable TX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set TXPDMAEN bit of I2C_CTL1 register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_TX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear RXPDMAEN bit of I2C_CTL1 register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_RX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear TXPDMAEN bit of I2C_CTL1 register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_TX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Enable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Enable this function is to stretch bus by hardware after PDMA transfer is done if SI is not cleared. - * \hideinitializer - */ -#define I2C_ENABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Disable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C will send STOP after PDMA transfers done automatically. - * \hideinitializer - */ -#define I2C_DISABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Reset PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C PDMA engine will be reset after this function is called. - * \hideinitializer - */ -#define I2C_DISABLE_RST_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMARST_Msk) - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c); - -/** - * @brief The macro is used to set STOP condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus STOP condition in I2C_CTL register. - */ -__STATIC_INLINE void I2C_STOP(I2C_T *i2c) -{ - - (i2c)->CTL0 |= (I2C_CTL0_SI_Msk | I2C_CTL0_STO_Msk); - while (i2c->CTL0 & I2C_CTL0_STO_Msk) - { - } -} - -void I2C_ClearTimeoutFlag(I2C_T *i2c); -void I2C_Close(I2C_T *i2c); -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack); -void I2C_DisableInt(I2C_T *i2c); -void I2C_EnableInt(I2C_T *i2c); -uint32_t I2C_GetBusClockFreq(I2C_T *i2c); -uint32_t I2C_GetIntFlag(I2C_T *i2c); -uint32_t I2C_GetStatus(I2C_T *i2c); -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock); -uint8_t I2C_GetData(I2C_T *i2c); -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode); -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask); -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock); -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout); -void I2C_DisableTimeout(I2C_T *i2c); -void I2C_EnableWakeup(I2C_T *i2c); -void I2C_DisableWakeup(I2C_T *i2c); -void I2C_SetData(I2C_T *i2c, uint8_t u8Data); -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr); -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen); - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2s.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2s.h deleted file mode 100644 index b5ac0b597ad..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_i2s.h +++ /dev/null @@ -1,351 +0,0 @@ -/****************************************************************************//** - * @file nu_i2s.h - * @brief I2S driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_I2S_H__ -#define __NU_I2S_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ -#define I2S_DATABIT_8 (0U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 8-bit \hideinitializer */ -#define I2S_DATABIT_16 (1U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 16-bit \hideinitializer */ -#define I2S_DATABIT_24 (2U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 24-bit \hideinitializer */ -#define I2S_DATABIT_32 (3U << I2S_CTL0_DATWIDTH_Pos) /*!< I2S data width is 32-bit \hideinitializer */ - -/* Audio Format */ -#define I2S_ENABLE_MONO I2S_CTL0_MONO_Msk /*!< Mono channel \hideinitializer */ -#define I2S_DISABLE_MONO (0U) /*!< Stereo channel \hideinitializer */ - -/* I2S Data Format */ -#define I2S_FORMAT_I2S (0U << I2S_CTL0_FORMAT_Pos) /*!< I2S data format \hideinitializer */ -#define I2S_FORMAT_I2S_MSB (1U << I2S_CTL0_FORMAT_Pos) /*!< I2S MSB data format \hideinitializer */ -#define I2S_FORMAT_I2S_LSB (2U << I2S_CTL0_FORMAT_Pos) /*!< I2S LSB data format \hideinitializer */ -#define I2S_FORMAT_PCM (4U << I2S_CTL0_FORMAT_Pos) /*!< PCM data format \hideinitializer */ -#define I2S_FORMAT_PCM_MSB (5U << I2S_CTL0_FORMAT_Pos) /*!< PCM MSB data format \hideinitializer */ -#define I2S_FORMAT_PCM_LSB (6U << I2S_CTL0_FORMAT_Pos) /*!< PCM LSB data format \hideinitializer */ - -/* I2S Data Format */ -#define I2S_ORDER_AT_MSB (0U) /*!< Channel data is at MSB \hideinitializer */ -#define I2S_ORDER_AT_LSB I2S_CTL0_ORDER_Msk /*!< Channel data is at LSB \hideinitializer */ - -/* I2S TDM Channel Number */ -#define I2S_TDM_2CH 0U /*!< Use TDM 2 channel \hideinitializer */ -#define I2S_TDM_4CH 1U /*!< Use TDM 4 channel \hideinitializer */ -#define I2S_TDM_6CH 2U /*!< Use TDM 6 channel \hideinitializer */ -#define I2S_TDM_8CH 3U /*!< Use TDM 8 channel \hideinitializer */ - -/* I2S TDM Channel Width */ -#define I2S_TDM_WIDTH_8BIT 0U /*!< TDM channel witch is 8-bit \hideinitializer */ -#define I2S_TDM_WIDTH_16BIT 1U /*!< TDM channel witch is 16-bit \hideinitializer */ -#define I2S_TDM_WIDTH_24BIT 2U /*!< TDM channel witch is 24-bit \hideinitializer */ -#define I2S_TDM_WIDTH_32BIT 3U /*!< TDM channel witch is 32-bit \hideinitializer */ - -/* I2S TDM Sync Width */ -#define I2S_TDM_SYNC_ONE_BCLK 0U /*!< TDM sync widht is one BLCK period \hideinitializer */ -#define I2S_TDM_SYNC_ONE_CHANNEL 1U /*!< TDM sync widht is one channel period \hideinitializer */ - -/* I2S Operation mode */ -#define I2S_MODE_SLAVE I2S_CTL0_SLAVE_Msk /*!< As slave mode \hideinitializer */ -#define I2S_MODE_MASTER (0u) /*!< As master mode \hideinitializer */ - -/* I2S FIFO Threshold */ -#define I2S_FIFO_TX_LEVEL_WORD_0 (0U) /*!< TX threshold is 0 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_1 (1U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_2 (2U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_3 (3U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_4 (4U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_5 (5U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_6 (6U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_7 (7U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_8 (8U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_9 (9U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_10 (10U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_11 (11U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_12 (12U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_13 (13U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_14 (14U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_TX_LEVEL_WORD_15 (15U << I2S_CTL1_TXTH_Pos) /*!< TX threshold is 15 words \hideinitializer */ - -#define I2S_FIFO_RX_LEVEL_WORD_1 (0U) /*!< RX threshold is 1 word \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_2 (1U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 2 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_3 (2U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 3 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_4 (3U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 4 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_5 (4U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 5 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_6 (5U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 6 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_7 (6U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 7 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_8 (7U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 8 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_9 (8U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 9 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_10 (9U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 10 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_11 (10U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 11 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_12 (11U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 12 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_13 (12U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 13 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_14 (13U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 14 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_15 (14U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 15 words \hideinitializer */ -#define I2S_FIFO_RX_LEVEL_WORD_16 (15U << I2S_CTL1_RXTH_Pos) /*!< RX threshold is 16 words \hideinitializer */ - -/* I2S Record Channel */ -#define I2S_MONO_RIGHT (0U) /*!< Record mono right channel \hideinitializer */ -#define I2S_MONO_LEFT I2S_CTL0_RXLCH_Msk /*!< Record mono left channel \hideinitializer */ - -/* I2S Channel */ -#define I2S_RIGHT (0U) /*!< Select right channel \hideinitializer */ -#define I2S_LEFT (1U) /*!< Select left channel \hideinitializer */ - -/*@}*/ /* end of group I2S_EXPORTED_CONSTANTS */ - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ -/** - * @brief Enable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_ENABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if ((u32ChMask > 0U) && (u32ChMask < 9U)) - { - i2s->CTL1 |= ((uint32_t)1U << (u32ChMask - 1U)); - } -} - -/** - * @brief Disable zero cross detect function. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32ChMask is the mask for channel number (valid value is from (1~8). - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_DISABLE_TX_ZCD(I2S_T *i2s, uint32_t u32ChMask) -{ - if ((u32ChMask > 0U) && (u32ChMask < 9U)) - { - i2s->CTL1 &= ~((uint32_t)1U << (u32ChMask - 1U)); - } -} - -/** - * @brief Enable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RXDMA(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RXDMA(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXEN_Msk ) - -/** - * @brief Disable I2S Tx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_TXEN_Msk ) - -/** - * @brief Enable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_RX(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXEN_Msk ) - -/** - * @brief Disable I2S Rx function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_RX(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_RXEN_Msk ) - -/** - * @brief Enable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_ENABLE_TX_MUTE(i2s) ( (i2s)->CTL0 |= I2S_CTL0_MUTE_Msk ) - -/** - * @brief Disable Tx Mute function . - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_DISABLE_TX_MUTE(i2s) ( (i2s)->CTL0 &= ~I2S_CTL0_MUTE_Msk ) - -/** - * @brief Clear Tx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_TX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_TXFBCLR_Msk ) - -/** - * @brief Clear Rx FIFO. Internal pointer is reset to FIFO start point. - * @param[in] i2s is the base address of I2S module. - * @return none - * \hideinitializer - */ -#define I2S_CLR_RX_FIFO(i2s) ( (i2s)->CTL0 |= I2S_CTL0_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref I2S_MONO_LEFT - * - \ref I2S_MONO_RIGHT - * @return none - * \hideinitializer - */ -__STATIC_INLINE void I2S_SET_MONO_RX_CHANNEL(I2S_T *i2s, uint32_t u32Ch) -{ - u32Ch == I2S_MONO_LEFT ? - (i2s->CTL0 |= I2S_CTL0_RXLCH_Msk) : - (i2s->CTL0 &= ~I2S_CTL0_RXLCH_Msk); -} - -/** - * @brief Write data to I2S Tx FIFO. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Data: The data written to FIFO. - * @return none - * \hideinitializer - */ -#define I2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TXFIFO = (u32Data) ) - -/** - * @brief Read Rx FIFO. - * @param[in] i2s is the base address of I2S module. - * @return Data in Rx FIFO. - * \hideinitializer - */ -#define I2S_READ_RX_FIFO(i2s) ( (i2s)->RXFIFO ) - -/** - * @brief This function gets the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 & (u32Mask) ) - -/** - * @brief This function clears the interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS0 |= (u32Mask) ) - -/** - * @brief This function gets the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return The masked bit value of interrupt flag. - * \hideinitializer - */ -#define I2S_GET_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 & (u32Mask) ) - -/** - * @brief This function clears the zero crossing interrupt flag according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the mask for the all interrupt flags. - * @return none - * \hideinitializer - */ -#define I2S_CLR_ZC_INT_FLAG(i2s, u32Mask) ( (i2s)->STATUS1 |= (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_TX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_TXCNT_Msk) >> I2S_STATUS1_TXCNT_Pos) & 0xF ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s is the base address of I2S module. - * @return FIFO level - * \hideinitializer - */ -#define I2S_GET_RX_FIFO_LEVEL(i2s) ( (((i2s)->STATUS1 & I2S_STATUS1_RXCNT_Msk) >> I2S_STATUS1_RXCNT_Pos) & 0xF ) - -void I2S_Close(I2S_T *i2s); -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask); -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask); -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock); -void I2S_DisableMCLK(I2S_T *i2s); -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth); -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat); - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_kpi.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_kpi.h deleted file mode 100644 index ff7fbdcbc15..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_kpi.h +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************//** - * @file nu_kpi.h - * @brief KPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_KPI_H__ -#define __NU_KPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KPI_Driver KPI Driver - @{ -*/ - -/** @addtogroup KPI_EXPORTED_CONSTANTS KPI Exported Constants - @{ -*/ - -#define KPI_ROW_SCAN_DELAY4CLK (0x0 << KPI_KPICONF_SCANROWD_Pos) /*!< Delay cycle when row change */ -#define KPI_ROW_SCAN_DELAY8CLK (0x1 << KPI_KPICONF_SCANROWD_Pos) /*!< Delay cycle when row change */ -#define KPI_ROW_SCAN_DELAY16CLK (0x2 << KPI_KPICONF_SCANROWD_Pos) /*!< Delay cycle when row change */ -#define KPI_ROW_SCAN_DELAY32CLK (0x3 << KPI_KPICONF_SCANROWD_Pos) /*!< Delay cycle when row change */ - -#define KPI_KEY00 (KPI_KPIKEST0_KEST00_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY01 (KPI_KPIKEST0_KEST01_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY02 (KPI_KPIKEST0_KEST02_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY03 (KPI_KPIKEST0_KEST03_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY04 (KPI_KPIKEST0_KEST04_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY05 (KPI_KPIKEST0_KEST05_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY06 (KPI_KPIKEST0_KEST06_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY07 (KPI_KPIKEST0_KEST07_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY10 (KPI_KPIKEST0_KEST10_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY11 (KPI_KPIKEST0_KEST11_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY12 (KPI_KPIKEST0_KEST12_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY13 (KPI_KPIKEST0_KEST13_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY14 (KPI_KPIKEST0_KEST14_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY15 (KPI_KPIKEST0_KEST15_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY16 (KPI_KPIKEST0_KEST16_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY17 (KPI_KPIKEST0_KEST17_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY20 (KPI_KPIKEST0_KEST20_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY21 (KPI_KPIKEST0_KEST21_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY22 (KPI_KPIKEST0_KEST22_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY23 (KPI_KPIKEST0_KEST23_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY24 (KPI_KPIKEST0_KEST24_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY25 (KPI_KPIKEST0_KEST25_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY26 (KPI_KPIKEST0_KEST26_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY27 (KPI_KPIKEST0_KEST27_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY30 (KPI_KPIKEST0_KEST30_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY31 (KPI_KPIKEST0_KEST31_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY32 (KPI_KPIKEST0_KEST32_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY33 (KPI_KPIKEST0_KEST33_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY34 (KPI_KPIKEST0_KEST34_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY35 (KPI_KPIKEST0_KEST35_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY36 (KPI_KPIKEST0_KEST36_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY37 (KPI_KPIKEST0_KEST37_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY40 (KPI_KPIKEST0_KEST40_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY41 (KPI_KPIKEST0_KEST41_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY42 (KPI_KPIKEST0_KEST42_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY43 (KPI_KPIKEST0_KEST43_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY44 (KPI_KPIKEST0_KEST44_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY45 (KPI_KPIKEST0_KEST45_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY46 (KPI_KPIKEST0_KEST46_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY47 (KPI_KPIKEST0_KEST47_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY50 (KPI_KPIKEST0_KEST50_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY51 (KPI_KPIKEST0_KEST51_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY52 (KPI_KPIKEST0_KEST52_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY53 (KPI_KPIKEST0_KEST53_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY54 (KPI_KPIKEST0_KEST54_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY55 (KPI_KPIKEST0_KEST55_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY56 (KPI_KPIKEST0_KEST56_Msk) /*!< Press / Release Key Indicator */ -#define KPI_KEY57 (KPI_KPIKEST0_KEST57_Msk) /*!< Press / Release Key Indicator */ - -#define KPI_GET_KEY_STA_REG0(kpi) (kpi->KPIKEST0) /*!< Get Keypad State Register 0 */ -#define KPI_GET_KEY_STA_REG1(kpi) (kpi->KPIKEST1) /*!< Get Keypad State Register 1 */ -#define KPI_GET_PRESS_KEY_REG0(kpi) (kpi->KPIKPE0) /*!< Get Lower 32 Key Press Event Indicator */ -#define KPI_GET_PRESS_KEY_REG1(kpi) (kpi->KPIKPE1) /*!< Get Upper 32 Key Press Event Indicator */ -#define KPI_GET_RELEASE_KEY_REG0(kpi) (kpi->KPIKRE0) /*!< Get Lower 32 Key Release Event Indicator */ -#define KPI_GET_RELEASE_KEY_REG1(kpi) (kpi->KPIKRE1) /*!< Get Upper 32 Key Release Event Indicator */ - -#define KPI_EN_WAKEUP(kpi) (kpi->KPICONF |= KPI_KPICONF_WAKEUP_Msk) /*!< Enable Lower Power Wakeup */ -#define KPI_DIS_WAKEUP(kpi) (kpi->KPICONF &= ~KPI_KPICONF_WAKEUP_Msk) /*!< Disable Lower Power Wakeup */ - -/** - * @brief Enable KPI specified interrupt - * - * @param[in] u32InterruptFlag The specified interrupt of KPI module. - * - \ref KPI_KPICONF_PKINTEN_Msk : Press Key Interrupt Enable - * - \ref KPI_KPICONF_RKINTEN_Msk : Release Key Interrupt - * - \ref KPI_KPICONF_INTEN_Msk : Key Interrupt Enable - * - * @return None - * - * @details The function is used to enable KPI specified interrupt. - * \hideinitializer - */ -#define KPI_ENABLE_INT(kpi,u32InterruptFlag) (kpi->KPICONF |= u32InterruptFlag) - -/** - * @brief Disable KPI specified interrupt - * - * @param[in] u32InterruptFlag The specified interrupt of KPI module. - * - \ref KPI_KPICONF_PKINTEN_Msk : Press Key Interrupt Enable - * - \ref KPI_KPICONF_RKINTEN_Msk : Release Key Interrupt - * - \ref KPI_KPICONF_INTEN_Msk : Key Interrupt Enable - * - * @return None - * - * @details The function is used to enable KPI specified interrupt. - * \hideinitializer - */ -#define KPI_DISABLE_INT(kpi,u32InterruptFlag) (kpi->KPICONF &= ~u32IntSel) - -/** - * @brief Disable 3Key Reset - * - * @return None - * - * @details The function is used to disable 3key Reset. - * \hideinitializer - */ -#define KPI_DISABLE_3KEY_RESET(kpi) (kpi->KPI3KCONF &= ~KPI_KPI3KCONF_EN3KYRST_Msk) - -/** - * @brief Get interrupt flag - * - * @return \ref KPI_KPISTATUS_PDWAKE_Msk - * \ref KPI_KPISTATUS_RST3KEY_Msk - * \ref KPI_KPISTATUS_KEYINT_Msk - * \ref KPI_KPISTATUS_RKEYINT_Msk - * \ref KPI_KPISTATUS_PKEYINT_Msk - * - * @details The function is used to disable 3key Reset. - * \hideinitializer - */ -#define KPI_GET_INT_FLAG(kpi) (kpi->KPISTATUS) - -void KPI_Open(KPI_T *kpi, uint32_t u32Row, uint32_t u32Col); -void KPI_Close(KPI_T *kpi); -void KPI_ConfigKeyScanTiming(KPI_T *kpi, uint32_t u32PreScale, uint32_t u32Debounce, uint32_t u32ScanDelay); -void KPI_Set3KeyReset(KPI_T *kpi, uint32_t u32Key1, uint32_t u32Key2, uint32_t u32Key3, uint32_t u32RstCnt); - - -/*@}*/ /* end of group KPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group KPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_KPI_H__*/ - - - - - - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_pdma.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_pdma.h deleted file mode 100644 index d50726a8bf7..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_pdma.h +++ /dev/null @@ -1,421 +0,0 @@ -/**************************************************************************//** - * @file nu_pdma.h - * @brief PDMA driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PDMA_H__ -#define __NU_PDMA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - -/** @addtogroup PDMA_EXPORTED_CONSTANTS PDMA Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Operation Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_OP_STOP 0x00000000UL /*!INTSTS)) - -/** - * @brief Get Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_TD_STS(pdma) ((uint32_t)(pdma->TDSTS)) - -/** - * @brief Clear Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TD_FLAG(pdma,u32Mask) ((uint32_t)(pdma->TDSTS = (u32Mask))) - -/** - * @brief Get Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ABORT_STS(pdma) ((uint32_t)(pdma->ABTSTS)) - -/** - * @brief Clear Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ABORT_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ABTSTS = (u32Mask))) - -/** - * @brief Get Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ALIGN_STS(pdma) ((uint32_t)(PDMA->ALIGN)) - -/** - * @brief Clear Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ALIGN_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ALIGN = (u32Mask))) - -/** - * @brief Clear Timeout Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details Clear the selected channel timeout interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TMOUT_FLAG(pdma,u32Ch) ((uint32_t)(pdma->INTSTS = (1 << ((u32Ch) + 8)))) - -/** - * @brief Check Channel Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @retval 0 Idle state - * @retval 1 Busy state - * - * @details Check the selected channel is busy or not. - * \hideinitializer - */ -#define PDMA_IS_CH_BUSY(pdma,u32Ch) ((uint32_t)(pdma->TRGSTS & (1 << (u32Ch)))? 1 : 0) - -/** - * @brief Set Source Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel source address. - * \hideinitializer - */ -#define PDMA_SET_SRC_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].SA = (u32Addr))) - -/** - * @brief Set Destination Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel destination address. - * \hideinitializer - */ -#define PDMA_SET_DST_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].DA = (u32Addr))) - -/** - * @brief Set Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32TransCount Transfer Count - * - * @return None - * - * @details This macro set the selected channel transfer count. - * \hideinitializer - */ -#define PDMA_SET_TRANS_CNT(pdma,u32Ch, u32TransCount) ((uint32_t)(pdma->DSCT[(u32Ch)].CTL=(pdma->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1) << PDMA_DSCT_CTL_TXCNT_Pos))) - -/** - * @brief Set Scatter-gather descriptor Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The descriptor address - * - * @return None - * - * @details This macro set the selected channel scatter-gather descriptor address. - * \hideinitializer - */ -#define PDMA_SET_SCATTER_DESC(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].NEXT = (u32Addr) - (pdma->SCATBA))) - -/** - * @brief Stop the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro stop the selected channel. - * \hideinitializer - */ -#define PDMA_STOP(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch)))) - -/** - * @brief Pause the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro pause the selected channel. - * \hideinitializer - */ -#define PDMA_PAUSE(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch)))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define PDMA functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_Close(PDMA_T *pdma); -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount); -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl); -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr); -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize); -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt); -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch); -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount); -void PDMA_SetRepeat(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount); - - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __PDMA_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qei.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qei.h deleted file mode 100644 index 4707e192a46..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qei.h +++ /dev/null @@ -1,388 +0,0 @@ -/**************************************************************************//** - * @file nu_qei.h - * @brief Quadrature Encoder Interface (QEI) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_QEI_H__ -#define __NU_QEI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QEI_Driver QEI Driver - @{ -*/ - -/** @addtogroup QEI_EXPORTED_CONSTANTS QEI Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* QEI counting mode selection constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define QEI_CTL_X4_FREE_COUNTING_MODE (0x0<CTL &= (~QEI_CTL_CMPEN_Msk)) - -/** - * @brief Enable QEI compare function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI counter compare function. - * \hideinitializer - */ -#define QEI_ENABLE_CNT_CMP(qei) ((qei)->CTL |= QEI_CTL_CMPEN_Msk) - -/** - * @brief Disable QEI index latch function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI index trigger counter latch function. - * \hideinitializer - */ -#define QEI_DISABLE_INDEX_LATCH(qei) ((qei)->CTL &= (~QEI_CTL_IDXLATEN_Msk)) - -/** - * @brief Enable QEI index latch function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI index trigger counter latch function. - * \hideinitializer - */ -#define QEI_ENABLE_INDEX_LATCH(qei) ((qei)->CTL |= QEI_CTL_IDXLATEN_Msk) - -/** - * @brief Disable QEI index reload function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI index trigger counter reload function. - * \hideinitializer - */ -#define QEI_DISABLE_INDEX_RELOAD(qei) ((qei)->CTL &= (~QEI_CTL_IDXRLDEN_Msk)) - -/** - * @brief Enable QEI index reload function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro enable QEI index trigger counter reload function. - * \hideinitializer - */ -#define QEI_ENABLE_INDEX_RELOAD(qei) ((qei)->CTL |= QEI_CTL_IDXRLDEN_Msk) - -/** - * @brief Disable QEI input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type. - * - \ref QEI_CTL_CHAEN_Msk : QEA input - * - \ref QEI_CTL_CHAEN_Msk : QEB input - * - \ref QEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro disable specified QEI signal input. - * \hideinitializer - */ -#define QEI_DISABLE_INPUT(qei, u32InputType) ((qei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable QEI input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type . - * - \ref QEI_CTL_CHAEN_Msk : QEA input - * - \ref QEI_CTL_CHBEN_Msk : QEB input - * - \ref QEI_CTL_IDXEN_Msk : IDX input - * @return None - * @details This macro enable specified QEI signal input. - * \hideinitializer - */ -#define QEI_ENABLE_INPUT(qei, u32InputType) ((qei)->CTL |= (u32InputType)) - -/** - * @brief Disable inverted input polarity - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type . - * - \ref QEI_CTL_CHAINV_Msk : QEA Input - * - \ref QEI_CTL_CHBINV_Msk : QEB Input - * - \ref QEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro disable specified QEI signal inverted input polarity. - * \hideinitializer - */ -#define QEI_DISABLE_INPUT_INV(qei, u32InputType) ((qei)->CTL &= ~(u32InputType)) - -/** - * @brief Enable inverted input polarity - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32InputType Input signal type. - * - \ref QEI_CTL_CHAINV_Msk : QEA Input - * - \ref QEI_CTL_CHBINV_Msk : QEB Input - * - \ref QEI_CTL_IDXINV_Msk : IDX Input - * @return None - * @details This macro inverse specified QEI signal input polarity. - * \hideinitializer - */ -#define QEI_ENABLE_INPUT_INV(qei, u32InputType) ((qei)->CTL |= (u32InputType)) - -/** - * @brief Disable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro disable specified QEI interrupt. - * \hideinitializer - */ -#define QEI_DISABLE_INT(qei, u32IntSel) ((qei)->CTL &= ~(u32IntSel)) - -/** - * @brief Enable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This macro enable specified QEI interrupt. - * \hideinitializer - */ -#define QEI_ENABLE_INT(qei, u32IntSel) ((qei)->CTL |= (u32IntSel)) - -/** - * @brief Disable QEI noise filter - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This macro disable QEI noise filter function. - * \hideinitializer - */ -#define QEI_DISABLE_NOISE_FILTER(qei) ((qei)->CTL |= QEI_CTL_NFDIS_Msk) - -/** - * @brief Enable QEI noise filter - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32ClkSel The sampling frequency of the noise filter clock. - * - \ref QEI_CTL_NFCLKSEL_DIV1 - * - \ref QEI_CTL_NFCLKSEL_DIV2 - * - \ref QEI_CTL_NFCLKSEL_DIV4 - * - \ref QEI_CTL_NFCLKSEL_DIV16 - * - \ref QEI_CTL_NFCLKSEL_DIV32 - * - \ref QEI_CTL_NFCLKSEL_DIV64 - * @return None - * @details This macro enable QEI noise filter function and select noise filter clock. - * \hideinitializer - */ -#define QEI_ENABLE_NOISE_FILTER(qei, u32ClkSel) ((qei)->CTL = ((qei)->CTL & (~(QEI_CTL_NFDIS_Msk|QEI_CTL_NFCLKSEL_Msk))) | (u32ClkSel)) - -/** - * @brief Get QEI counter value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter register value. - * @details This macro get QEI pulse counter value. - * \hideinitializer - */ -#define QEI_GET_CNT_VALUE(qei) ((qei)->CNT) - -/** - * @brief Get QEI counting direction - * @param[in] qei The pointer of the specified QEI module. - * @retval 0 QEI counter is in down-counting. - * @retval 1 QEI counter is in up-counting. - * @details This macro get QEI counting direction. - * \hideinitializer - */ -#define QEI_GET_DIR(qei) (((qei)->STATUS & (QEI_STATUS_DIRF_Msk))?1:0) - -/** - * @brief Get QEI counter hold value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter hold register value. - * @details This macro get QEI pulse counter hold value, which is updated with counter value in hold counter value control. - * \hideinitializer - */ -#define QEI_GET_HOLD_VALUE(qei) ((qei)->CNTHOLD) - -/** - * @brief Get QEI counter index latch value - * @param[in] qei The pointer of the specified QEI module. - * @return QEI pulse counter index latch value - * @details This macro get QEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define QEI_GET_INDEX_LATCH_VALUE(qei) ((qei)->CNTLATCH) - -/** - * @brief Set QEI counter index latch value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Val The latch value. - * @return QEI pulse counter index latch value - * @details This macro set QEI pulse counter index latch value, which is updated with counter value when the index is detected. - * \hideinitializer - */ -#define QEI_SET_INDEX_LATCH_VALUE(qei,u32Val) ((qei)->CNTLATCH = (u32Val)) - -/** - * @brief Get QEI interrupt flag status - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. -* - \ref QEI_STATUS_DIRF_Msk : Counting direction flag - * - \ref QEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref QEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref QEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref QEI_STATUS_IDXF_Msk : Index detected flag - * @retval 0 QEI specified interrupt flag is not set. - * @retval 1 QEI specified interrupt flag is set. - * @details This macro get QEI specified interrupt flag status. - * \hideinitializer - */ -#define QEI_GET_INT_FLAG(qei, u32IntSel) (((qei)->STATUS & (u32IntSel))?1:0) - - -/** - * @brief Clear QEI interrupt flag - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_STATUS_DIRCHGF_Msk : Direction change flag - * - \ref QEI_STATUS_OVUNF_Msk : Counter overflow or underflow flag - * - \ref QEI_STATUS_CMPF_Msk : Compare-match flag - * - \ref QEI_STATUS_IDXF_Msk : Index detected flag - * @return None - * @details This macro clear QEI specified interrupt flag. - * \hideinitializer - */ -#define QEI_CLR_INT_FLAG(qei, u32IntSel) ((qei)->STATUS = (u32IntSel)) - -/** - * @brief Set QEI counter compare value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set QEI pulse counter compare value. - * \hideinitializer - */ -#define QEI_SET_CNT_CMP(qei, u32Value) ((qei)->CNTCMP = (u32Value)) - -/** - * @brief Set QEI counter value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter compare value. - * @return None - * @details This macro set QEI pulse counter value. - * \hideinitializer - */ -#define QEI_SET_CNT_VALUE(qei, u32Value) ((qei)->CNT = (u32Value)) - -/** - * @brief Enable QEI counter hold mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Type The triggered type. - * - \ref QEI_CTL_HOLDCNT_Msk : Hold QEI_CNT control - * - \ref QEI_CTL_HOLDTMR0_Msk : Hold QEI_CNT by Timer0 - * - \ref QEI_CTL_HOLDTMR1_Msk : Hold QEI_CNT by Timer1 - * - \ref QEI_CTL_HOLDTMR2_Msk : Hold QEI_CNT by Timer2 - * - \ref QEI_CTL_HOLDTMR3_Msk : Hold QEI_CNT by Timer3 - * @return None - * @details This macro enable QEI counter hold mode. - * \hideinitializer - */ -#define QEI_ENABLE_HOLD_TRG_SRC(qei, u32Type) ((qei)->CTL |= (u32Type)) - -/** - * @brief Disable QEI counter hold mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Type The triggered type. - * - \ref QEI_CTL_HOLDCNT_Msk : Hold QEI_CNT control - * - \ref QEI_CTL_HOLDTMR0_Msk : Hold QEI_CNT by Timer0 - * - \ref QEI_CTL_HOLDTMR1_Msk : Hold QEI_CNT by Timer1 - * - \ref QEI_CTL_HOLDTMR2_Msk : Hold QEI_CNT by Timer2 - * - \ref QEI_CTL_HOLDTMR3_Msk : Hold QEI_CNT by Timer3 - * @return None - * @details This macro disable QEI counter hold mode. - * \hideinitializer - */ -#define QEI_DISABLE_HOLD_TRG_SRC(qei, u32Type) ((qei)->CTL &= ~(u32Type)) - -/** - * @brief Set QEI maximum count value - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Value The counter maximum value. - * @return QEI maximum count value - * @details This macro set QEI maximum count value. - * \hideinitializer - */ -#define QEI_SET_CNT_MAX(qei, u32Value) ((qei)->CNTMAX = (u32Value)) - -/** - * @brief Set QEI counting mode - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Mode QEI counting mode. - * - \ref QEI_CTL_X4_FREE_COUNTING_MODE - * - \ref QEI_CTL_X2_FREE_COUNTING_MODE - * - \ref QEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref QEI_CTL_X2_COMPARE_COUNTING_MODE - * @return None - * @details This macro set QEI counting mode. - * \hideinitializer - */ -#define QEI_SET_CNT_MODE(qei, u32Mode) ((qei)->CTL = ((qei)->CTL & (~QEI_CTL_MODE_Msk)) | (u32Mode)) - - -void QEI_Close(QEI_T *qei); -void QEI_DisableInt(QEI_T *qei, uint32_t u32IntSel); -void QEI_EnableInt(QEI_T *qei, uint32_t u32IntSel); -void QEI_Open(QEI_T *qei, uint32_t u32Mode, uint32_t u32Value); -void QEI_Start(QEI_T *qei); -void QEI_Stop(QEI_T *qei); - - -/*@}*/ /* end of group QEI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QEI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_QEI_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qspi.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qspi.h deleted file mode 100644 index 28f5fe67c9c..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_qspi.h +++ /dev/null @@ -1,379 +0,0 @@ -/**************************************************************************//** - * @file nu_qspi.h - * @brief QSPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_QSPI_H__ -#define __NU_QSPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - -/** @addtogroup QSPI_EXPORTED_CONSTANTS QSPI Exported Constants - @{ -*/ - -#define QSPI_MODE_0 (QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define QSPI_MODE_1 (QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_2 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_3 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define QSPI_SLAVE (QSPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define QSPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define QSPI_SS (QSPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define QSPI_SS_ACTIVE_HIGH (QSPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define QSPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* QSPI Interrupt Mask */ -#define QSPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define QSPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define QSPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define QSPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define QSPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define QSPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define QSPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* QSPI Status Mask */ -#define QSPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define QSPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define QSPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define QSPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define QSPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define QSPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define QSPI_QSPIEN_STS_MASK (0x40U) /*!< QSPIEN status mask \hideinitializer */ -#define QSPI_SSLINE_STS_MASK (0x80U) /*!< QSPIx_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group QSPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Write 1 to UNITIF bit of QSPI_STATUS register to clear the unit transfer interrupt flag. - * \hideinitializer - */ -#define QSPI_CLR_UNIT_TRANS_INT_FLAG(qspi) ((qspi)->STATUS = QSPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set RXPDMAEN bit of QSPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_RX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit of QSPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_RX_PDMA(qspi) ((qspi)->PDMACTL |= (QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk)) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear RXPDMAEN bit of QSPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit of QSPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of QSPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~(QSPI_PDMACTL_TXPDMAEN_Msk | QSPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] qspi The pointer of the specified QSPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (QSPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_COUNT(qspi) (((qspi)->STATUS & QSPI_STATUS_RXCNT_Msk) >> QSPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of QSPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_RXEMPTY_Msk)>>QSPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of QSPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXEMPTY_Msk)>>QSPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of QSPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_FULL_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXFULL_Msk)>>QSPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Data in RX register. - * @details Read QSPI_RX register to get the received datum. - * \hideinitializer - */ -#define QSPI_READ_RX(qspi) ((qspi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxData The datum which user attempt to transfer through QSPI bus. - * @return None. - * @details Write u32TxData to QSPI_TX register. - * \hideinitializer - */ -#define QSPI_WRITE_TX(qspi, u32TxData) ((qspi)->TX = (u32TxData)) - -/** - * @brief Set QSPIx_SS pin to high state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to high state. - * \hideinitializer - */ -#define QSPI_SET_SS_HIGH(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~QSPI_SSCTL_AUTOSS_Msk)) | (QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk)) - -/** - * @brief Set QSPIx_SS pin to low state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to low state. - * \hideinitializer - */ -#define QSPI_SET_SS_LOW(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk))) | QSPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (QSPI_CTL[7:4]). - * \hideinitializer - */ -#define QSPI_ENABLE_BYTE_REORDER(qspi) ((qspi)->CTL |= QSPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear REORDER bit field of QSPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define QSPI_DISABLE_BYTE_REORDER(qspi) ((qspi)->CTL &= ~QSPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one QSPI bus clock cycle). - * \hideinitializer - */ -#define QSPI_SET_SUSPEND_CYCLE(qspi, u32SuspCycle) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << QSPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the QSPI transfer sequence with LSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set LSB bit of QSPI_CTL register to set the QSPI transfer sequence with LSB first. - * \hideinitializer - */ -#define QSPI_SET_LSB_FIRST(qspi) ((qspi)->CTL |= QSPI_CTL_LSB_Msk) - -/** - * @brief Set the QSPI transfer sequence with MSB first. - * @param[in] qspi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of QSPI_CTL register to set the QSPI transfer sequence with MSB first. - * \hideinitializer - */ -#define QSPI_SET_MSB_FIRST(qspi) ((qspi)->CTL &= ~QSPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a QSPI transaction. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define QSPI_SET_DATA_WIDTH(qspi, u32Width) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << QSPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the QSPI busy state. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 QSPI controller is not busy. - * @retval 1 QSPI controller is busy. - * @details This macro will return the busy state of QSPI controller. - * \hideinitializer - */ -#define QSPI_IS_BUSY(qspi) ( ((qspi)->STATUS & QSPI_STATUS_BUSY_Msk)>>QSPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set QSPIEN (QSPI_CTL[0]) to enable QSPI controller. - * \hideinitializer - */ -#define QSPI_ENABLE(qspi) ((qspi)->CTL |= QSPI_CTL_QSPIEN_Msk) - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear QSPIEN (QSPI_CTL[0]) to disable QSPI controller. - * \hideinitializer - */ -#define QSPI_DISABLE(qspi) ((qspi)->CTL &= ~QSPI_CTL_QSPIEN_Msk) - -/** - * @brief Disable QSPI Dual IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_DUAL_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Disable QSPI Dual IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_QUAD_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Master Receive Phase. - * @param[in] qspi is the base address of QSPI module. - * @param[in] rxdly is the clock cycle of delay for rx phase. - * @return none - * \hideinitializer - */ -#define QSPI_SET_MRXPHASE(qspi, rxdly) ( (qspi)->INTERNAL = ((qspi)->INTERNAL & ~QSPI_INTERNAL_MRXPHASE_Msk) | (rxdly<TALM_M -#define REG_RTC_CALM RTC->CALM_M -#define REG_RTC_INTEN RTC->INTEN_M -#define REG_RTC_INTSTS RTC->INTSTS_M -#define REG_RTC_TICK RTC->TICK_M -#define REG_RTC_TAMSK RTC->TAMSK_M -#define REG_RTC_CAMSK RTC->CAMSK_M -#else -#define REG_RTC_TALM RTC->TALM -#define REG_RTC_CALM RTC->CALM -#define REG_RTC_INTEN RTC->INTEN -#define REG_RTC_INTSTS RTC->INTSTS -#define REG_RTC_TICK RTC->TICK -#define REG_RTC_TAMSK RTC->TAMSK -#define REG_RTC_CAMSK RTC->CAMSK -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_CONSTANTS RTC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Initial Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_INIT_KEY 0xA5EB1357UL /*!< RTC Initiation Key to make RTC leaving reset state \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Time Attribute Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_12 0UL /*!< RTC as 12-hour time scale with AM and PM indication \hideinitializer */ -#define RTC_CLOCK_24 1UL /*!< RTC as 24-hour time scale \hideinitializer */ -#define RTC_AM 1UL /*!< RTC as AM indication \hideinitializer */ -#define RTC_PM 2UL /*!< RTC as PM indication \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tick Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TICK_1_SEC 0x0UL /*!< RTC time tick period is 1 second \hideinitializer */ -#define RTC_TICK_1_2_SEC 0x1UL /*!< RTC time tick period is 1/2 second \hideinitializer */ -#define RTC_TICK_1_4_SEC 0x2UL /*!< RTC time tick period is 1/4 second \hideinitializer */ -#define RTC_TICK_1_8_SEC 0x3UL /*!< RTC time tick period is 1/8 second \hideinitializer */ -#define RTC_TICK_1_16_SEC 0x4UL /*!< RTC time tick period is 1/16 second \hideinitializer */ -#define RTC_TICK_1_32_SEC 0x5UL /*!< RTC time tick period is 1/32 second \hideinitializer */ -#define RTC_TICK_1_64_SEC 0x6UL /*!< RTC time tick period is 1/64 second \hideinitializer */ -#define RTC_TICK_1_128_SEC 0x7UL /*!< RTC time tick period is 1/128 second \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Day of Week Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_SUNDAY 0x0UL /*!< Day of the Week is Sunday \hideinitializer */ -#define RTC_MONDAY 0x1UL /*!< Day of the Week is Monday \hideinitializer */ -#define RTC_TUESDAY 0x2UL /*!< Day of the Week is Tuesday \hideinitializer */ -#define RTC_WEDNESDAY 0x3UL /*!< Day of the Week is Wednesday \hideinitializer */ -#define RTC_THURSDAY 0x4UL /*!< Day of the Week is Thursday \hideinitializer */ -#define RTC_FRIDAY 0x5UL /*!< Day of the Week is Friday \hideinitializer */ -#define RTC_SATURDAY 0x6UL /*!< Day of the Week is Saturday \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_WAIT_COUNT 0xFFFFFFFFUL /*!< Initial Time-out Value \hideinitializer */ -#define RTC_YEAR2000 2000UL /*!< RTC Reference for compute year data \hideinitializer */ - -/*@}*/ /* end of group RTC_EXPORTED_CONSTANTS */ - - -/** @addtogroup RTC_EXPORTED_STRUCTS RTC Exported Structs - @{ -*/ -/** - * @details RTC define Time Data Struct - */ -typedef struct -{ - uint32_t u32Year; /*!< Year value */ - uint32_t u32Month; /*!< Month value */ - uint32_t u32Day; /*!< Day value */ - uint32_t u32DayOfWeek; /*!< Day of week value */ - uint32_t u32Hour; /*!< Hour value */ - uint32_t u32Minute; /*!< Minute value */ - uint32_t u32Second; /*!< Second value */ - uint32_t u32TimeScale; /*!< 12-Hour, 24-Hour */ - uint32_t u32AmPm; /*!< Only Time Scale select 12-hr used */ -} S_RTC_TIME_DATA_T; - -/*@}*/ /* end of group RTC_EXPORTED_STRUCTS */ - - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Indicate is Leap Year or not - * - * @param None - * - * @retval 0 This year is not a leap year - * @retval 1 This year is a leap year - * - * @details According to current date, return this year is leap year or not. - * \hideinitializer - */ -#define RTC_IS_LEAP_YEAR() (RTC->LEAPYEAR & RTC_LEAPYEAR_LEAPYEAR_Msk ? 1:0) - -/** - * @brief Clear RTC Alarm Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC alarm interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_ALARM_INT_FLAG() (REG_RTC_INTSTS = RTC_INTSTS_ALMIF_Msk) - -/** - * @brief Clear RTC Tick Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC tick interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TICK_INT_FLAG() (REG_RTC_INTSTS = RTC_INTSTS_TICKIF_Msk) - -/** - * @brief Get RTC Alarm Interrupt Flag - * - * @param None - * - * @retval 0 RTC alarm interrupt did not occur - * @retval 1 RTC alarm interrupt occurred - * - * @details This macro indicates RTC alarm interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_ALARM_INT_FLAG() ((REG_RTC_INTSTS & RTC_INTSTS_ALMIF_Msk)? 1:0) - -/** - * @brief Get RTC Time Tick Interrupt Flag - * - * @param None - * - * @retval 0 RTC time tick interrupt did not occur - * @retval 1 RTC time tick interrupt occurred - * - * @details This macro indicates RTC time tick interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TICK_INT_FLAG() ((REG_RTC_INTSTS & RTC_INTSTS_TICKIF_Msk)? 1:0) - -/** - * @brief Read Spare Register - * - * @param[in] u32RegNum The spare register number, 0~19. - * - * @return Spare register content - * - * @details Read the specify spare register content. - * @note The returned value is valid only when SPRRDY(SPRCTL[7] SPR Register Ready) bit is set. \n - * And its controlled by RTC Access Enable Register. - * \hideinitializer - */ -#define RTC_READ_SPARE_REGISTER(u32RegNum) (RTC->SPR[(u32RegNum)]) - -int32_t RTC_Open(S_RTC_TIME_DATA_T *sPt); -void RTC_Close(void); - -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek); -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day); -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk); -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk); -uint32_t RTC_GetDayOfWeek(void); -void RTC_SetTickPeriod(uint32_t u32TickSelection); -void RTC_EnableInt(uint32_t u32IntFlagMask); -void RTC_DisableInt(uint32_t u32IntFlagMask); - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RTC_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sc.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sc.h deleted file mode 100644 index 6ebb7bddc58..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sc.h +++ /dev/null @@ -1,266 +0,0 @@ -/**************************************************************************//** - * @file nu_sc.h - * @brief Smartcard (SC) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SC_H__ -#define __NU_SC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_CONSTANTS SC Exported Constants - @{ -*/ -#define SC_INTERFACE_NUM 2 /*!< Smartcard interface numbers \hideinitializer */ -#define SC_PIN_STATE_HIGH 1 /*!< Smartcard pin status high \hideinitializer */ -#define SC_PIN_STATE_LOW 0 /*!< Smartcard pin status low \hideinitializer */ -#define SC_PIN_STATE_IGNORE 0xFFFFFFFF /*!< Ignore pin status \hideinitializer */ -#define SC_CLK_ON 1 /*!< Smartcard clock on \hideinitializer */ -#define SC_CLK_OFF 0 /*!< Smartcard clock off \hideinitializer */ - -#define SC_TMR_MODE_0 (0ul << SC_TMRCTL0_OPMODE_Pos) /*!INTEN |= (u32Mask)) - -/** - * @brief This macro disable smartcard interrupt - * @param[in] sc Base address of smartcard module - * @param[in] u32Mask Interrupt mask to be disabled. A combination of - * - \ref SC_INTEN_ACERRIEN_Msk - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_INITIEN_Msk - * - \ref SC_INTEN_CDIEN_Msk - * - \ref SC_INTEN_BGTIEN_Msk - * - \ref SC_INTEN_TMR2IEN_Msk - * - \ref SC_INTEN_TMR1IEN_Msk - * - \ref SC_INTEN_TMR0IEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * \hideinitializer - */ -#define SC_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief This macro set VCC pin state of smartcard interface - * @param[in] sc Base address of smartcard module - * @param[in] u32State Pin state of VCC pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW - * @return None - * \hideinitializer - */ -#define SC_SET_VCC_PIN(sc, u32State) \ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_PWREN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_PWREN_Msk;\ - }while(0) - - -/** - * @brief This macro turns CLK output on or off - * @param[in] sc Base address of smartcard module - * @param[in] u32OnOff Clock on or off for selected smartcard module, valid values are \ref SC_CLK_ON and \ref SC_CLK_OFF - * @return None - * \hideinitializer - */ -#define SC_SET_CLK_PIN(sc, u32OnOff)\ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32OnOff)\ - (sc)->PINCTL |= SC_PINCTL_CLKKEEP_Msk;\ - else\ - (sc)->PINCTL &= ~(SC_PINCTL_CLKKEEP_Msk);\ - }while(0) - -/** - * @brief This macro set I/O pin state of smartcard interface - * @param[in] sc Base address of smartcard module - * @param[in] u32State Pin state of I/O pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW - * @return None - * \hideinitializer - */ -#define SC_SET_IO_PIN(sc, u32State)\ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_SCDATA_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_SCDATA_Msk;\ - }while(0) - -/** - * @brief This macro set RST pin state of smartcard interface - * @param[in] sc Base address of smartcard module - * @param[in] u32State Pin state of RST pin, valid parameters are \ref SC_PIN_STATE_HIGH and \ref SC_PIN_STATE_LOW - * @return None - * \hideinitializer - */ -#define SC_SET_RST_PIN(sc, u32State)\ - do {\ - while((sc)->PINCTL & SC_PINCTL_SYNC_Msk);\ - if(u32State)\ - (sc)->PINCTL |= SC_PINCTL_RSTEN_Msk;\ - else\ - (sc)->PINCTL &= ~SC_PINCTL_RSTEN_Msk;\ - }while(0) - -/** - * @brief This macro read one byte from smartcard module receive FIFO - * @param[in] sc Base address of smartcard module - * @return One byte read from receive FIFO - * \hideinitializer - */ -#define SC_READ(sc) ((char)((sc)->DAT)) - -/** - * @brief This macro write one byte to smartcard module transmit FIFO - * @param[in] sc Base address of smartcard module - * @param[in] u8Data Data to write to transmit FIFO - * @return None - * \hideinitializer - */ -#define SC_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief This macro set smartcard stop bit length - * @param[in] sc Base address of smartcard module - * @param[in] u32Len Stop bit length, ether 1 or 2. - * @return None - * @details Stop bit length must be 1 for T = 1 protocol and 2 for T = 0 protocol. - * \hideinitializer - */ -#define SC_SET_STOP_BIT_LEN(sc, u32Len) ((sc)->CTL = ((sc)->CTL & ~SC_CTL_NSB_Msk) | ((u32Len) == 1 ? SC_CTL_NSB_Msk : 0)) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count); -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count); - -/** - * @brief Enable/Disable Tx error retry, and set Tx error retry count - * @param[in] sc Base address of smartcard module - * @param[in] u32Count The number of times of Tx error retry count, between 0~8. 0 means disable Tx error retry - * @return None - */ -__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count) -{ - while ((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_TXRTY_Msk | SC_CTL_TXRTYEN_Msk); - - if ((u32Count) != 0UL) - { - while ((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_TXRTY_Pos) | SC_CTL_TXRTYEN_Msk; - } -} - -/** - * @brief Enable/Disable Rx error retry, and set Rx error retry count - * @param[in] sc Base address of smartcard module - * @param[in] u32Count The number of times of Rx error retry count, between 0~8. 0 means disable Rx error retry - * @return None - */ -__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count) -{ - while ((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - /* Retry count must set while enable bit disabled, so disable it first */ - (sc)->CTL &= ~(SC_CTL_RXRTY_Msk | SC_CTL_RXRTYEN_Msk); - - if ((u32Count) != 0UL) - { - while ((sc)->CTL & SC_CTL_SYNC_Msk) - { - ; - } - (sc)->CTL |= (((u32Count) - 1UL) << SC_CTL_RXRTY_Pos) | SC_CTL_RXRTYEN_Msk; - } - -} - - -uint32_t SC_IsCardInserted(SC_T *sc); -void SC_ClearFIFO(SC_T *sc); -void SC_Close(SC_T *sc); -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR); -void SC_ResetReader(SC_T *sc); -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT); -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT); -void SC_StopAllTimer(SC_T *sc); -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount); -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum); -uint32_t SC_GetInterfaceClock(SC_T *sc); - - -/*@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SC_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_scuart.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_scuart.h deleted file mode 100644 index 1224df48ed1..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_scuart.h +++ /dev/null @@ -1,265 +0,0 @@ -/**************************************************************************//** - * @file nu_scuart.h - * @brief Smartcard UART mode (SCUART) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SCUART_H__ -#define __NU_SCUART_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - -/** @addtogroup SCUART_EXPORTED_CONSTANTS SCUART Exported Constants - @{ -*/ -#define SCUART_CHAR_LEN_5 (0x3ul << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 5 bits \hideinitializer */ -#define SCUART_CHAR_LEN_6 (0x2ul << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 6 bits \hideinitializer */ -#define SCUART_CHAR_LEN_7 (0x1ul << SC_UARTCTL_WLS_Pos) /*!< Set SCUART word length to 7 bits \hideinitializer */ -#define SCUART_CHAR_LEN_8 (0UL) /*!< Set SCUART word length to 8 bits \hideinitializer */ - -#define SCUART_PARITY_NONE (SC_UARTCTL_PBOFF_Msk) /*!< Set SCUART transfer with no parity \hideinitializer */ -#define SCUART_PARITY_ODD (SC_UARTCTL_OPE_Msk) /*!< Set SCUART transfer with odd parity \hideinitializer */ -#define SCUART_PARITY_EVEN (0UL) /*!< Set SCUART transfer with even parity \hideinitializer */ - -#define SCUART_STOP_BIT_1 (SC_CTL_NSB_Msk) /*!< Set SCUART transfer with one stop bit \hideinitializer */ -#define SCUART_STOP_BIT_2 (0UL) /*!< Set SCUART transfer with two stop bits \hideinitializer */ - - -/*@}*/ /* end of group SCUART_EXPORTED_CONSTANTS */ - - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/* TX Macros */ -/** - * @brief Write Data to Tx data register - * @param[in] sc The base address of smartcard module. - * @param[in] u8Data Data byte to transmit - * @return None - * \hideinitializer - */ -#define SCUART_WRITE(sc, u8Data) ((sc)->DAT = (u8Data)) - -/** - * @brief Get TX FIFO empty flag status from register - * @param[in] sc The base address of smartcard module - * @return Transmit FIFO empty status - * @retval 0 Transmit FIFO is not empty - * @retval SC_STATUS_TXEMPTY_Msk Transmit FIFO is empty - * \hideinitializer - */ -#define SCUART_GET_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXEMPTY_Msk) - -/** - * @brief Get TX FIFO full flag status from register - * @param[in] sc The base address of smartcard module - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval SC_STATUS_TXFULL_Msk Transmit FIFO is full - * \hideinitializer - */ -#define SCUART_GET_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk) - -/** - * @brief Wait specified smartcard port transmission complete - * @param[in] sc The base address of smartcard module - * @return None - * @note This Macro blocks until transmit complete. - * \hideinitializer - */ -#define SCUART_WAIT_TX_EMPTY(sc) while((sc)->STATUS & SC_STATUS_TXACT_Msk) - -/** - * @brief Check specified smartcard port transmit FIFO is full or not - * @param[in] sc The base address of smartcard module - * @return Transmit FIFO full status - * @retval 0 Transmit FIFO is not full - * @retval 1 Transmit FIFO is full - * \hideinitializer - */ -#define SCUART_IS_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk ? 1 : 0) - -/** - * @brief Check specified smartcard port transmission is over - * @param[in] sc The base address of smartcard module - * @return Transmit complete status - * @retval 0 Transmit is not complete - * @retval 1 Transmit complete - * \hideinitializer - */ -#define SCUART_IS_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXACT_Msk ? 0 : 1) - -/** - * @brief Check specified Smartcard port Transmission Status - * @param[in] sc The pointer of smartcard module. - * @retval 0 Transmit is completed - * @retval 1 Transmit is active - * @details TXACT (SC_STATUS[31]) is set by hardware when Tx transfer is in active and the STOP bit of the last byte has been transmitted. - * \hideinitializer - */ -#define SCUART_IS_TX_ACTIVE(sc) (((sc)->STATUS & SC_STATUS_TXACT_Msk)? 1 : 0) - -/* RX Macros */ - -/** - * @brief Read Rx data register - * @param[in] sc The base address of smartcard module - * @return The oldest data byte in RX FIFO - * \hideinitializer - */ -#define SCUART_READ(sc) ((sc)->DAT) - -/** - * @brief Get RX FIFO empty flag status from register - * @param[in] sc The base address of smartcard module - * @return Receive FIFO empty status - * @retval 0 Receive FIFO is not empty - * @retval SC_STATUS_RXEMPTY_Msk Receive FIFO is empty - * \hideinitializer - */ -#define SCUART_GET_RX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_RXEMPTY_Msk) - - -/** - * @brief Get RX FIFO full flag status from register - * @param[in] sc The base address of smartcard module - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval SC_STATUS_RXFULLF_Msk Receive FIFO is full - * \hideinitializer - */ -#define SCUART_GET_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk) - -/** - * @brief Check if receive data number in FIFO reach FIFO trigger level or not - * @param[in] sc The base address of smartcard module - * @return Receive FIFO data status - * @retval 0 The number of bytes in receive FIFO is less than trigger level - * @retval 1 The number of bytes in receive FIFO equals or larger than trigger level - * @note If receive trigger level is \b not 1 byte, this macro return 0 does not necessary indicates there is \b no data in FIFO - * \hideinitializer - */ -#define SCUART_IS_RX_READY(sc) ((sc)->INTSTS & SC_INTSTS_RDAIF_Msk ? 1 : 0) - -/** - * @brief Check specified smartcard port receive FIFO is full or not - * @param[in] sc The base address of smartcard module - * @return Receive FIFO full status - * @retval 0 Receive FIFO is not full - * @retval 1 Receive FIFO is full - * \hideinitializer - */ -#define SCUART_IS_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk ? 1 : 0) - -/* Interrupt Macros */ - -/** - * @brief Enable specified interrupts - * @param[in] sc The base address of smartcard module - * @param[in] u32Mask Interrupt masks to enable, a combination of following bits - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * \hideinitializer - */ -#define SCUART_ENABLE_INT(sc, u32Mask) ((sc)->INTEN |= (u32Mask)) - -/** - * @brief Disable specified interrupts - * @param[in] sc The base address of smartcard module - * @param[in] u32Mask Interrupt masks to disable, a combination of following bits - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * \hideinitializer - */ -#define SCUART_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask)) - -/** - * @brief Get specified interrupt flag/status - * @param[in] sc The base address of smartcard module - * @param[in] u32Type Interrupt flag/status to check, could be one of following value - * - \ref SC_INTSTS_RXTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * - \ref SC_INTSTS_RDAIF_Msk - * @return The status of specified interrupt - * @retval 0 Specified interrupt does not happened - * @retval 1 Specified interrupt happened - * \hideinitializer - */ -#define SCUART_GET_INT_FLAG(sc, u32Type) ((sc)->INTSTS & (u32Type) ? 1 : 0) - -/** - * @brief Clear specified interrupt flag/status - * @param[in] sc The base address of smartcard module - * @param[in] u32Type Interrupt flag/status to clear, could be the combination of following values - * - \ref SC_INTSTS_RXTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * @return None - * \hideinitializer - */ -#define SCUART_CLR_INT_FLAG(sc, u32Type) ((sc)->INTSTS = (u32Type)) - -/** - * @brief Get receive error flag/status - * @param[in] sc The base address of smartcard module - * @return Current receive error status, could one of following errors: - * @retval SC_STATUS_PEF_Msk Parity error - * @retval SC_STATUS_FEF_Msk Frame error - * @retval SC_STATUS_BEF_Msk Break error - * \hideinitializer - */ -#define SCUART_GET_ERR_FLAG(sc) ((sc)->STATUS & (SC_STATUS_PEF_Msk | SC_STATUS_FEF_Msk | SC_STATUS_BEF_Msk)) - -/** - * @brief Clear specified receive error flag/status - * @param[in] sc The base address of smartcard module - * @param[in] u32Mask Receive error flag/status to clear, combination following values - * - \ref SC_STATUS_PEF_Msk - * - \ref SC_STATUS_FEF_Msk - * - \ref SC_STATUS_BEF_Msk - * @return None - * \hideinitializer - */ -#define SCUART_CLR_ERR_FLAG(sc, u32Mask) ((sc)->STATUS = (u32Mask)) - -void SCUART_Close(SC_T *sc); -uint32_t SCUART_Open(SC_T *sc, uint32_t u32baudrate); -uint32_t SCUART_Read(SC_T *sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -uint32_t SCUART_SetLineConfig(SC_T *sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits); -void SCUART_SetTimeoutCnt(SC_T *sc, uint32_t u32TOC); -void SCUART_Write(SC_T *sc, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); - -/*@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SCUART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SCUART_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sdh.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sdh.h deleted file mode 100644 index 1f6aec5b579..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_sdh.h +++ /dev/null @@ -1,129 +0,0 @@ -/****************************************************************************//** - * @file nu_sdh.h - * @brief SDH driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SDH_H__ -#define __NU_SDH_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - -/** @addtogroup SDH_EXPORTED_CONSTANTS SDH Exported Constants - @{ -*/ - -#define SDH_POWER_ON 0x01 -#define SDH_POWER_180 0x0A -#define SDH_POWER_300 0x0C -#define SDH_POWER_330 0x0E - -#define SDH_RESET_ALL 0x01 -#define SDH_RESET_CMD 0x02 -#define SDH_RESET_DATA 0x04 - -#define SDH_CMD_RESP_MASK 0x03 -#define SDH_CMD_CRC 0x08 -#define SDH_CMD_INDEX 0x10 -#define SDH_CMD_DATA 0x20 -#define SDH_CMD_ABORTCMD 0xC0 - -#define SDH_CMD_RESP_NONE 0x00 -#define SDH_CMD_RESP_LONG 0x01 -#define SDH_CMD_RESP_SHORT 0x02 -#define SDH_CMD_RESP_SHORT_BUSY 0x03 - - -/* MMC command */ -#define MMC_CMD_STOP_TRANSMISSION 12 - -/* MMC response */ -#define MMC_RSP_PRESENT (1 << 0) -#define MMC_RSP_136 (1 << 1) /* 136 bit response */ -#define MMC_RSP_CRC (1 << 2) /* expect valid crc */ -#define MMC_RSP_BUSY (1 << 3) /* card may send busy */ -#define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ - -#define MMC_RSP_NONE (0) -#define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) -#define MMC_RSP_R1b (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) -#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) -#define MMC_RSP_R3 (MMC_RSP_PRESENT) -#define MMC_RSP_R4 (MMC_RSP_PRESENT) -#define MMC_RSP_R5 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) -#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) -#define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) - -#define MMC_DATA_READ 1 -#define MMC_DATA_WRITE 2 - -#define SDH_BLOCK_SIZE 512ul - -struct mmc_cmd -{ - unsigned short cmdidx; - unsigned int resp_type; - unsigned int cmdarg; - unsigned int response[4]; -}; - -struct mmc_data -{ - union - { - char *dest; - const char *src; /* src buffers don't get written to */ - }; - unsigned int flags; - unsigned int blocks; - unsigned int blocksize; -}; - -#define SDH_ISCARDINSERTED(SDH) (SDH->S_PSTATE.CARD_INSERTED && SDH->S_PSTATE.CARD_STABLE) - - -/*@}*/ /* end of group SDH_EXPORTED_CONSTANTS */ - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ - -void SDH_DumpReg(SDH_T *sdh); -void SDH_Reset(SDH_T *sdh, uint8_t u8Mask); -int SDH_SetBusWidth(SDH_T *sdh, uint32_t u32BusWidth); -uint32_t SDH_SetClock(SDH_T *sdh, uint32_t u32SrcFreqInHz, uint32_t u32ExceptedFreqInHz); -int SD_GetBusStatus(SDH_T *sdh, uint32_t cmdidx); -void SDH_SetPower(SDH_T *sdh, uint32_t u32OnOff); - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Standard_Driver */ -#ifdef __cplusplus -} -#endif - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif - - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_spi.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_spi.h deleted file mode 100644 index 873f849c1df..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_spi.h +++ /dev/null @@ -1,607 +0,0 @@ -/**************************************************************************//** - * @file nu_spi.h - * @brief SPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SPI_H__ -#define __NU_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ - -#define SPI_MODE_0 (SPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define SPI_MODE_1 (SPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_2 (SPI_CTL_CLKPOL_Msk | SPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_3 (SPI_CTL_CLKPOL_Msk | SPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define SPI_SLAVE (SPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define SPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define SPI_SS (SPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define SPI_SS_ACTIVE_HIGH (SPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define SPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* SPI Interrupt Mask */ -#define SPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define SPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define SPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define SPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define SPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define SPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define SPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* SPI Status Mask */ -#define SPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define SPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define SPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define SPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define SPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define SPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define SPI_SPIEN_STS_MASK (0x40U) /*!< SPIEN status mask \hideinitializer */ -#define SPI_SSLINE_STS_MASK (0x80U) /*!< SPIx_SS line status mask \hideinitializer */ - - -/* I2S Data Width */ -#define SPII2S_DATABIT_8 (0U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 8-bit \hideinitializer */ -#define SPII2S_DATABIT_16 (1U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 16-bit \hideinitializer */ -#define SPII2S_DATABIT_24 (2U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 24-bit \hideinitializer */ -#define SPII2S_DATABIT_32 (3U << SPI_I2SCTL_WDWIDTH_Pos) /*!< I2S data width is 32-bit \hideinitializer */ - -/* I2S Audio Format */ -#define SPII2S_MONO SPI_I2SCTL_MONO_Msk /*!< Monaural channel \hideinitializer */ -#define SPII2S_STEREO (0U) /*!< Stereo channel \hideinitializer */ - -/* I2S Data Format */ -#define SPII2S_FORMAT_I2S (0U<STATUS = SPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set RXPDMAEN bit of SPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_RX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit of SPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_RX_PDMA(spi) ((spi)->PDMACTL |= (SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk)) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear RXPDMAEN bit of SPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_RX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit of SPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_RX_PDMA(spi) ( (spi)->PDMACTL &= ~(SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] spi The pointer of the specified SPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (SPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_COUNT(spi) (((spi)->STATUS & SPI_STATUS_RXCNT_Msk) >> SPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of SPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_RXEMPTY_Msk)>>SPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of SPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXEMPTY_Msk)>>SPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of SPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_FULL_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXFULL_Msk)>>SPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] spi The pointer of the specified SPI module. - * @return Data in RX register. - * @details Read SPI_RX register to get the received datum. - * \hideinitializer - */ -#define SPI_READ_RX(spi) ((spi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through SPI bus. - * @return None. - * @details Write u32TxData to SPI_TX register. - * \hideinitializer - */ -#define SPI_WRITE_TX(spi, u32TxData) ((spi)->TX = (u32TxData)) - -/** - * @brief Set SPIx_SS pin to high state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to high state. - * \hideinitializer - */ -#define SPI_SET_SS_HIGH(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~SPI_SSCTL_AUTOSS_Msk)) | (SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk)) - -/** - * @brief Set SPIx_SS pin to low state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to low state. - * \hideinitializer - */ -#define SPI_SET_SS_LOW(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk))) | SPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (SPI_CTL[7:4]). - * \hideinitializer - */ -#define SPI_ENABLE_BYTE_REORDER(spi) ((spi)->CTL |= SPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear REORDER bit field of SPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define SPI_DISABLE_BYTE_REORDER(spi) ((spi)->CTL &= ~SPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one SPI bus clock cycle). - * \hideinitializer - */ -#define SPI_SET_SUSPEND_CYCLE(spi, u32SuspCycle) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << SPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the SPI transfer sequence with LSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set LSB bit of SPI_CTL register to set the SPI transfer sequence with LSB first. - * \hideinitializer - */ -#define SPI_SET_LSB_FIRST(spi) ((spi)->CTL |= SPI_CTL_LSB_Msk) - -/** - * @brief Set the SPI transfer sequence with MSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of SPI_CTL register to set the SPI transfer sequence with MSB first. - * \hideinitializer - */ -#define SPI_SET_MSB_FIRST(spi) ((spi)->CTL &= ~SPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a SPI transaction. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define SPI_SET_DATA_WIDTH(spi, u32Width) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << SPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the SPI busy state. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 SPI controller is not busy. - * @retval 1 SPI controller is busy. - * @details This macro will return the busy state of SPI controller. - * \hideinitializer - */ -#define SPI_IS_BUSY(spi) ( ((spi)->STATUS & SPI_STATUS_BUSY_Msk)>>SPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SPIEN (SPI_CTL[0]) to enable SPI controller. - * \hideinitializer - */ -#define SPI_ENABLE(spi) ((spi)->CTL |= SPI_CTL_SPIEN_Msk) - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SPIEN (SPI_CTL[0]) to disable SPI controller. - * \hideinitializer - */ -#define SPI_DISABLE(spi) ((spi)->CTL &= ~SPI_CTL_SPIEN_Msk) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void SPII2S_ENABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask); -__STATIC_INLINE void SPII2S_DISABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask); -__STATIC_INLINE void SPII2S_SET_MONO_RX_CHANNEL(SPI_T *i2s, uint32_t u32Ch); - -/** - * @brief Enable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will set RZCEN or LZCEN bit of SPI_I2SCTL register to enable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_ENABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if (u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL |= SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Disable zero cross detection function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChMask The mask for left or right channel. Valid values are: - * - \ref SPII2S_RIGHT - * - \ref SPII2S_LEFT - * @return None - * @details This function will clear RZCEN or LZCEN bit of SPI_I2SCTL register to disable zero cross detection function. - */ -__STATIC_INLINE void SPII2S_DISABLE_TX_ZCD(SPI_T *i2s, uint32_t u32ChMask) -{ - if (u32ChMask == SPII2S_RIGHT) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCEN_Msk; - } - else - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCEN_Msk; - } -} - -/** - * @brief Enable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXPDMAEN bit of SPI_PDMACTL register to transmit data with PDMA. - * \hideinitializer - */ -#define SPII2S_ENABLE_TXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable I2S TX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXPDMAEN bit of SPI_PDMACTL register to disable TX DMA function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Enable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXPDMAEN bit of SPI_PDMACTL register to receive data with PDMA. - * \hideinitializer - */ -#define SPII2S_ENABLE_RXDMA(i2s) ( (i2s)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable I2S RX DMA function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXPDMAEN bit of SPI_PDMACTL register to disable RX DMA function. - * \hideinitializer - */ -#define SPII2S_DISABLE_RXDMA(i2s) ( (i2s)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Enable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set TXEN bit of SPI_I2SCTL register to enable I2S TX function. - * \hideinitializer - */ -#define SPII2S_ENABLE_TX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Disable I2S TX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TXEN bit of SPI_I2SCTL register to disable I2S TX function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_TXEN_Msk ) - -/** - * @brief Enable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set RXEN bit of SPI_I2SCTL register to enable I2S RX function. - * \hideinitializer - */ -#define SPII2S_ENABLE_RX(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Disable I2S RX function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RXEN bit of SPI_I2SCTL register to disable I2S RX function. - * \hideinitializer - */ -#define SPII2S_DISABLE_RX(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_RXEN_Msk ) - -/** - * @brief Enable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will set MUTE bit of SPI_I2SCTL register to enable I2S TX mute function. - * \hideinitializer - */ -#define SPII2S_ENABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL |= SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Disable TX Mute function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear MUTE bit of SPI_I2SCTL register to disable I2S TX mute function. - * \hideinitializer - */ -#define SPII2S_DISABLE_TX_MUTE(i2s) ( (i2s)->I2SCTL &= ~SPI_I2SCTL_MUTE_Msk ) - -/** - * @brief Clear TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear TX FIFO. The internal TX FIFO pointer will be reset to FIFO start point. - * \hideinitializer - */ -#define SPII2S_CLR_TX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk ) - -/** - * @brief Clear RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details This macro will clear RX FIFO. The internal RX FIFO pointer will be reset to FIFO start point. - * \hideinitializer - */ -#define SPII2S_CLR_RX_FIFO(i2s) ( (i2s)->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk ) - -/** - * @brief This function sets the recording source channel when mono mode is used. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Ch left or right channel. Valid values are: - * - \ref SPII2S_MONO_LEFT - * - \ref SPII2S_MONO_RIGHT - * @return None - * @details This function selects the recording source channel of monaural mode. - * \hideinitializer - */ -__STATIC_INLINE void SPII2S_SET_MONO_RX_CHANNEL(SPI_T *i2s, uint32_t u32Ch) -{ - u32Ch == SPII2S_MONO_LEFT ? - (i2s->I2SCTL |= SPI_I2SCTL_RXLCH_Msk) : - (i2s->I2SCTL &= ~SPI_I2SCTL_RXLCH_Msk); -} - -/** - * @brief Write data to I2S TX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Data The value written to TX FIFO. - * @return None - * @details This macro will write a value to TX FIFO. - * \hideinitializer - */ -#define SPII2S_WRITE_TX_FIFO(i2s, u32Data) ( (i2s)->TX = (u32Data) ) - -/** - * @brief Read RX FIFO. - * @param[in] i2s The pointer of the specified I2S module. - * @return The value read from RX FIFO. - * @details This function will return a value read from RX FIFO. - * \hideinitializer - */ -#define SPII2S_READ_RX_FIFO(i2s) ( (i2s)->RX ) - -/** - * @brief Get the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return The interrupt flags specified by the u32mask parameter. - * @details This macro will return the combination interrupt flags of SPI_I2SSTS register. The flags are specified by the u32mask parameter. - * \hideinitializer - */ -#define SPII2S_GET_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS & (u32Mask) ) - -/** - * @brief Clear the interrupt flag. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The mask value for all interrupt flags. - * @return None - * @details This macro will clear the interrupt flags specified by the u32mask parameter. - * @note Except TX and RX FIFO threshold interrupt flags, the other interrupt flags can be cleared by writing 1 to itself. - * \hideinitializer - */ -#define SPII2S_CLR_INT_FLAG(i2s, u32Mask) ( (i2s)->I2SSTS = (u32Mask) ) - -/** - * @brief Get transmit FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return TX FIFO level - * @details This macro will return the number of available words in TX FIFO. - * \hideinitializer - */ -#define SPII2S_GET_TX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_TXCNT_Msk) >> SPI_I2SSTS_TXCNT_Pos ) - -/** - * @brief Get receive FIFO level - * @param[in] i2s The pointer of the specified I2S module. - * @return RX FIFO level - * @details This macro will return the number of available words in RX FIFO. - * \hideinitializer - */ -#define SPII2S_GET_RX_FIFO_LEVEL(i2s) ( ((i2s)->I2SSTS & SPI_I2SSTS_RXCNT_Msk) >> SPI_I2SSTS_RXCNT_Pos ) - -/** - * @brief Set SPI Master Receive Phase. - * @param[in] spi is the base address of SPI module. - * @param[in] rxdly is the clock cycle of delay for rx phase. - * @return none - * \hideinitializer - */ -#define SPI_SET_MRXPHASE(spi, rxdly) ( (spi)->INTERNAL = ((spi)->INTERNAL & ~SPI_INTERNAL_MRXPHASE_Msk) | (rxdly<GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA0MFP_Msk) ) | SYS_GPA_MFPL_PA0_MFP_SC0_CLK ; - -*/ -/********************* Bit definition of GPA_MFPL register **********************/ -#define SYS_GPA_MFPL_PA0MFP_GPIO (0x00UL<RLKSUBM = 0x59UL; - SYS->RLKSUBM = 0x16UL; - SYS->RLKSUBM = 0x88UL; - } - while (SYS->RLKSUBM == 0UL); -#else - do - { - SYS->RLKTZS = 0x59UL; - SYS->RLKTZS = 0x16UL; - SYS->RLKTZS = 0x88UL; - } - while (SYS->RLKTZS == 0UL); -#endif -} - -/** - * @brief Enable register write-protection function - * @param None - * @return None - * @details This function is used to enable register write-protection function. - * To lock the protected register to forbid write access. - */ -__STATIC_INLINE void SYS_LockReg(void) -{ -#if defined(USE_MA35D1_SUBM) - SYS->RLKSUBM = 0UL; -#else - SYS->RLKTZS = 0UL; -#endif -} - -/** - * @brief Query write-protection is locked or not - * @param None - * @return true or false - * @details - */ -__STATIC_INLINE uint32_t SYS_IsRegLocked(void) -{ -#if defined(USE_MA35D1_SUBM) - return (SYS->RLKSUBM == 0) ? 1 : 0; -#else - return (SYS->RLKTZS == 0) ? 1 : 0; -#endif -} - -void SYS_ResetModule(uint32_t u32ModuleIndex); - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_SYS_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer.h deleted file mode 100644 index 4c3f21c1e49..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer.h +++ /dev/null @@ -1,522 +0,0 @@ -/**************************************************************************//** - * @file nu_timer.h - * @brief Timer Controller(Timer) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_H__ -#define __NU_TIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_CONSTANTS TIMER Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* TIMER Operation Mode, External Counter and Capture Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TIMER_ONESHOT_MODE (0UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in one-shot mode \hideinitializer */ -#define TIMER_PERIODIC_MODE (1UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in periodic mode \hideinitializer */ -#define TIMER_TOGGLE_MODE (2UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in toggle-output mode \hideinitializer */ -#define TIMER_CONTINUOUS_MODE (3UL << TIMER_CTL_OPMODE_Pos) /*!< Timer working in continuous counting mode \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX (0UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx pin \hideinitializer */ -#define TIMER_TOUT_PIN_FROM_TMX_EXT (1UL << TIMER_CTL_TGLPINSEL_Pos) /*!< Timer toggle-output pin is from TMx_EXT pin \hideinitializer */ - -#define TIMER_COUNTER_EVENT_FALLING (0UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on falling edge detection \hideinitializer */ -#define TIMER_COUNTER_EVENT_RISING (1UL << TIMER_EXTCTL_CNTPHASE_Pos) /*!< Counter increase on rising edge detection \hideinitializer */ -#define TIMER_CAPTURE_FREE_COUNTING_MODE (0UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to get timer counter value \hideinitializer */ -#define TIMER_CAPTURE_COUNTER_RESET_MODE (1UL << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< Timer capture event to reset timer counter \hideinitializer */ - -#define TIMER_CAPTURE_EVENT_FALLING (0UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Falling edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING (1UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Rising edge detection to trigger capture event \hideinitializer */ -#define TIMER_CAPTURE_EVENT_FALLING_RISING (2UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both falling and rising edge detection to trigger capture event, and first event at falling edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_RISING_FALLING (3UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< Both rising and falling edge detection to trigger capture event, and first event at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_LOW_PERIOD (6UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at falling edge, follows are at at rising edge \hideinitializer */ -#define TIMER_CAPTURE_EVENT_GET_HIGH_PERIOD (7UL << TIMER_EXTCTL_CAPEDGE_Pos) /*!< First capture event is at rising edge, follows are at at falling edge \hideinitializer */ - -#define TIMER_TRGSRC_TIMEOUT_EVENT (0UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer time-out event \hideinitializer */ -#define TIMER_TRGSRC_CAPTURE_EVENT (1UL << TIMER_TRGCTL_TRGSSEL_Pos) /*!< Select internal trigger source from timer capture event \hideinitializer */ -#define TIMER_TRG_TO_EPWM (TIMER_TRGCTL_TRGEPWM_Msk) /*!< Each timer event as EPWM counter clock source \hideinitializer */ -#define TIMER_TRG_TO_EADC (TIMER_TRGCTL_TRGEADC_Msk) /*!< Each timer event to start ADC conversion \hideinitializer */ -#define TIMER_TRG_TO_DAC (TIMER_TRGCTL_TRGDAC_Msk) /*!< Each timer event to start DAC conversion \hideinitializer */ -#define TIMER_TRG_TO_PDMA (TIMER_TRGCTL_TRGPDMA_Msk) /*!< Each timer event to trigger PDMA transfer \hideinitializer */ - -/*@}*/ /* end of group TIMER_EXPORTED_CONSTANTS */ - - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Set Timer Compared Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Value Timer compare value. Valid values are between 2 to 0xFFFFFF. - * - * @return None - * - * @details This macro is used to set timer compared value to adjust timer time-out interval. - * @note 1. Never write 0x0 or 0x1 in this field, or the core will run into unknown state. \n - * 2. If update timer compared value in continuous counting mode, timer counter value will keep counting continuously. \n - * But if timer is operating at other modes, the timer up counter will restart counting and start from 0. - * \hideinitializer - */ -#define TIMER_SET_CMP_VALUE(timer, u32Value) ((timer)->CMP = (u32Value)) - -/** - * @brief Set Timer Prescale Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32Value Timer prescale value. Valid values are between 0 to 0xFF. - * - * @return None - * - * @details This macro is used to set timer prescale value and timer source clock will be divided by (prescale + 1) \n - * before it is fed into timer. - * \hideinitializer - */ -#define TIMER_SET_PRESCALE_VALUE(timer, u32Value) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_PSC_Msk) | (u32Value)) - -/** - * @brief Check specify Timer Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer 24-bit up counter is inactive - * @retval 1 Timer 24-bit up counter is active - * - * @details This macro is used to check if specify Timer counter is inactive or active. - * \hideinitializer - */ -#define TIMER_IS_ACTIVE(timer) (((timer)->CTL & TIMER_CTL_ACTSTS_Msk)? 1 : 0) - -/** - * @brief Select Toggle-output Pin - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32ToutSel Toggle-output pin selection, valid values are: - * - \ref TIMER_TOUT_PIN_FROM_TMX - * - \ref TIMER_TOUT_PIN_FROM_TMX_EXT - * - * @return None - * - * @details This macro is used to select timer toggle-output pin is output on TMx or TMx_EXT pin. - * \hideinitializer - */ -#define TIMER_SELECT_TOUT_PIN(timer, u32ToutSel) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_TGLPINSEL_Msk) | (u32ToutSel)) - -/** - * @brief Select Timer operating mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] u32OpMode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * - * @return None - * \hideinitializer - */ -#define TIMER_SET_OPMODE(timer, u32OpMode) ((timer)->CTL = ((timer)->CTL & ~TIMER_CTL_OPMODE_Msk) | (u32OpMode)) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer); -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer); -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer); -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer); -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer); -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer); -__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer); - -/** - * @brief Start Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to start Timer counting. - */ -__STATIC_INLINE void TIMER_Start(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to stop/suspend Timer counting. - */ -__STATIC_INLINE void TIMER_Stop(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_CNTEN_Msk; -} - -/** - * @brief Enable Timer Interrupt Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer interrupt wake-up function and interrupt source could be time-out interrupt, \n - * counter event interrupt or capture trigger interrupt. - * @note To wake the system from Power-down mode, timer clock source must be ether LXT or LIRC. - */ -__STATIC_INLINE void TIMER_EnableWakeup(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Disable Timer Wake-up Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer interrupt wake-up function. - */ -__STATIC_INLINE void TIMER_DisableWakeup(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_WKEN_Msk; -} - -/** - * @brief Start Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to start Timer capture function. - */ -__STATIC_INLINE void TIMER_StartCapture(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Stop Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to stop Timer capture function. - */ -__STATIC_INLINE void TIMER_StopCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_EnableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Disable Capture Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of capture pin. - */ -__STATIC_INLINE void TIMER_DisableCaptureDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPDBEN_Msk; -} - -/** - * @brief Enable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_EnableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Disable Counter Pin De-bounce - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the detect de-bounce function of counter pin. - */ -__STATIC_INLINE void TIMER_DisableEventCounterDebounce(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CNTDBEN_Msk; -} - -/** - * @brief Enable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_EnableInt(TIMER_T *timer) -{ - timer->CTL |= TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Disable Timer Time-out Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer time-out interrupt function. - */ -__STATIC_INLINE void TIMER_DisableInt(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTEN_Msk; -} - -/** - * @brief Enable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to enable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_EnableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL |= TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Disable Capture Trigger Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to disable the timer capture trigger interrupt function. - */ -__STATIC_INLINE void TIMER_DisableCaptureInt(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPIEN_Msk; -} - -/** - * @brief Get Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer time-out interrupt did not occur - * @retval 1 Timer time-out interrupt occurred - * - * @details This function indicates timer time-out interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetIntFlag(TIMER_T *timer) -{ - return ((timer->INTSTS & TIMER_INTSTS_TIF_Msk) ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Time-out Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears timer time-out interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearIntFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TIF_Msk; -} - -/** - * @brief Get Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer capture interrupt did not occur - * @retval 1 Timer capture interrupt occurred - * - * @details This function indicates timer capture trigger interrupt occurred or not. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag(TIMER_T *timer) -{ - return timer->EINTSTS; -} - -/** - * @brief Clear Timer Capture Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears timer capture trigger interrupt flag to 0. - */ -__STATIC_INLINE void TIMER_ClearCaptureIntFlag(TIMER_T *timer) -{ - timer->EINTSTS = TIMER_EINTSTS_CAPIF_Msk; -} - -/** - * @brief Get Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer does not cause CPU wake-up - * @retval 1 Timer interrupt event cause CPU wake-up - * - * @details This function indicates timer interrupt event has waked up system or not. - */ -__STATIC_INLINE uint32_t TIMER_GetWakeupFlag(TIMER_T *timer) -{ - return (timer->INTSTS & TIMER_INTSTS_TWKF_Msk ? 1UL : 0UL); -} - -/** - * @brief Clear Timer Wake-up Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function clears the timer wake-up system flag to 0. - */ -__STATIC_INLINE void TIMER_ClearWakeupFlag(TIMER_T *timer) -{ - timer->INTSTS = TIMER_INTSTS_TWKF_Msk; -} - -/** - * @brief Get Capture value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return 24-bit Capture Value - * - * @details This function reports the current 24-bit timer capture value. - */ -__STATIC_INLINE uint32_t TIMER_GetCaptureData(TIMER_T *timer) -{ - return timer->CAP; -} - -/** - * @brief Get Counter value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return 24-bit Counter Value - * - * @details This function reports the current 24-bit timer counter value. - */ -__STATIC_INLINE uint32_t TIMER_GetCounter(TIMER_T *timer) -{ - return timer->CNT; -} - -/** - * @brief Reset Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This function is used to reset current counter value and internal prescale counter value. - */ -__STATIC_INLINE void TIMER_ResetCounter(TIMER_T *timer) -{ - timer->CNT = 0UL; - while ((timer->CNT & TIMER_CNT_RSTACT_Msk) == TIMER_CNT_RSTACT_Msk) - { - ; - } -} - - -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq); -void TIMER_Close(TIMER_T *timer); -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec); -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge); -void TIMER_DisableCapture(TIMER_T *timer); -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge); -void TIMER_DisableEventCounter(TIMER_T *timer); -uint32_t TIMER_GetModuleClock(TIMER_T *timer); -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt); -void TIMER_DisableFreqCounter(TIMER_T *timer); -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src); -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask); - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_TIMER_H__ */ - - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer_pwm.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer_pwm.h deleted file mode 100644 index 05291bc2cc2..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_timer_pwm.h +++ /dev/null @@ -1,745 +0,0 @@ -/**************************************************************************//** - * @file nu_timer_pwm.h - * @brief Timer PWM Controller(Timer PWM) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_PWM_H__ -#define __NU_TIMER_PWM_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_CONSTANTS TIMER PWM Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Channel Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CH0 (BIT0) /*!< Indicate PWMx_CH0 \hideinitializer */ -#define TPWM_CH1 (BIT1) /*!< Indicate PWMx_CH1 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_UP_COUNT (0UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up count type \hideinitializer */ -#define TPWM_DOWN_COUNT (1UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Down count type \hideinitializer */ -#define TPWM_UP_DOWN_COUNT (2UL << TIMER_PWMCTL_CNTTYPE_Pos) /*!< Up-Down count type \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_AUTO_RELOAD_MODE (0UL) /*!< Auto-reload mode \hideinitializer */ -#define TPWM_ONE_SHOT_MODE (TIMER_PWMCTL_CNTMODE_Msk) /*!< One-shot mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Output Level Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_OUTPUT_TOGGLE (0UL) /*!< Timer PWM output toggle \hideinitializer */ -#define TPWM_OUTPUT_NOTHING (1UL) /*!< Timer PWM output nothing \hideinitializer */ -#define TPWM_OUTPUT_LOW (2UL) /*!< Timer PWM output low \hideinitializer */ -#define TPWM_OUTPUT_HIGH (3UL) /*!< Timer PWM output high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Trigger ADC Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TRIGGER_ADC_AT_ZERO_POINT (0UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter zero point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_PERIOD_POINT (1UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_ZERO_OR_PERIOD_POINT (2UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter zero or period point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_COMPARE_UP_COUNT_POINT (3UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter up count compare point event occurred \hideinitializer */ -#define TPWM_TRIGGER_ADC_AT_COMPARE_DOWN_COUNT_POINT (4UL << TIMER_PWMEADCTS_TRGSEL_Pos) /*!< Timer PWM trigger ADC while counter down count compare point event occurred \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Control Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP0 (TIMER_PWMBRKCTL_CPO0EBEN_Msk) /*!< Comparator 0 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_ACMP1 (TIMER_PWMBRKCTL_CPO1EBEN_Msk) /*!< Comparator 1 as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_BKPIN (TIMER_PWMBRKCTL_BRKPEEN_Msk) /*!< Brake pin as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_CSS (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_BOD (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_COR (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as edge-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_EDGE_SYS_RAM (TIMER_PWMBRKCTL_SYSEBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as edge-detect fault brake source \hideinitializer */ - - -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP0 (TIMER_PWMBRKCTL_CPO0LBEN_Msk) /*!< Comparator 0 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_ACMP1 (TIMER_PWMBRKCTL_CPO1LBEN_Msk) /*!< Comparator 1 as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_BKPIN (TIMER_PWMBRKCTL_BRKPLEN_Msk) /*!< Brake pin as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CSSBRKEN_Msk << 16)) /*!< System fail condition: clock security system detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_BODBRKEN_Msk << 16)) /*!< System fail condition: brown-out detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_COR (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_CORBRKEN_Msk << 16)) /*!< System fail condition: core lockup detection as level-detect fault brake source \hideinitializer */ -#define TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM (TIMER_PWMBRKCTL_SYSLBEN_Msk | (TIMER_PWMFAILBRK_RAMBRKEN_Msk << 16)) /*!< System fail condition: SRAM parity error detection as level-detect fault brake source \hideinitializer */ - -#define TPWM_BRAKE_EDGE (TIMER_PWMSWBRK_BRKETRG_Msk) /*!< Edge-detect fault brake \hideinitializer */ -#define TPWM_BRAKE_LEVEL (TIMER_PWMSWBRK_BRKLTRG_Msk) /*!< Level-detect fault brake \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Load Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_LOAD_MODE_PERIOD (0UL) /*!< Timer PWM period load mode \hideinitializer */ -#define TPWM_LOAD_MODE_IMMEDIATE (TIMER_PWMCTL_IMMLDEN_Msk) /*!< Timer PWM immediately load mode \hideinitializer */ -#define TPWM_LOAD_MODE_CENTER (TIMER_PWMCTL_CTRLD_Msk) /*!< Timer PWM center load mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin De-bounce Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_BKP_DBCLK_PCLK_DIV_1 (0UL) /*!< De-bounce clock is PCLK divide by 1 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_2 (1UL) /*!< De-bounce clock is PCLK divide by 2 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_4 (2UL) /*!< De-bounce clock is PCLK divide by 4 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_8 (3UL) /*!< De-bounce clock is PCLK divide by 8 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_16 (4UL) /*!< De-bounce clock is PCLK divide by 16 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_32 (5UL) /*!< De-bounce clock is PCLK divide by 32 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_64 (6UL) /*!< De-bounce clock is PCLK divide by 64 \hideinitializer */ -#define TPWM_BKP_DBCLK_PCLK_DIV_128 (7UL) /*!< De-bounce clock is PCLK divide by 128 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Brake Pin Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_TM_BRAKE0 (0UL) /*!< Brake pin source comes from TM_BRAKE0 \hideinitializer */ -#define TPWM_TM_BRAKE1 (1UL) /*!< Brake pin source comes from TM_BRAKE1 \hideinitializer */ -#define TPWM_TM_BRAKE2 (2UL) /*!< Brake pin source comes from TM_BRAKE2 \hideinitializer */ -#define TPWM_TM_BRAKE3 (3UL) /*!< Brake pin source comes from TM_BRAKE3 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Clock Source Select Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_CLKSRC_TMR_CLK (0UL) /*!< Timer PWM Clock source selects to TMR_CLK \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER0_INT (1UL) /*!< Timer PWM Clock source selects to TIMER0 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER1_INT (2UL) /*!< Timer PWM Clock source selects to TIMER1 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER2_INT (3UL) /*!< Timer PWM Clock source selects to TIMER2 interrupt event \hideinitializer */ -#define TPWM_CNTR_CLKSRC_TIMER3_INT (4UL) /*!< Timer PWM Clock source selects to TIMER3 interrupt event \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Counter Synchronous Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define TPWM_CNTR_SYNC_DISABLE (0UL) /*!< Disable TIMER PWM synchronous function \hideinitializer */ -#define TPWM_CNTR_SYNC_START_BY_TIMER0 ((0<ALTCTL = (1 << TIMER_ALTCTL_FUNCSEL_Pos)) - -/** - * @brief Disable PWM Counter Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable specified Timer channel as PWM counter mode, then timer counter mode is available. - * @note All registers about PWM counter function will be cleared to 0 after executing this macro. - * \hideinitializer - */ -#define TPWM_DISABLE_PWM_MODE(timer) ((timer)->ALTCTL = (0 << TIMER_ALTCTL_FUNCSEL_Pos)) - -/** - * @brief Enable Independent Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable independent mode of TIMER PWM module and complementary mode will be disabled. - * \hideinitializer - */ -#define TPWM_ENABLE_INDEPENDENT_MODE(timer) ((timer)->PWMCTL &= ~(1 << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Enable Complementary Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable complementary mode of Timer PWM module and independent mode will be disabled. - * \hideinitializer - */ -#define TPWM_ENABLE_COMPLEMENTARY_MODE(timer) ((timer)->PWMCTL |= (1 << TIMER_PWMCTL_OUTMODE_Pos)) - -/** - * @brief Set Counter Type - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] type Timer PWM count type, could be one of the following type - * - \ref TPWM_UP_COUNT - * - \ref TPWM_DOWN_COUNT - * - \ref TPWM_UP_DOWN_COUNT - * - * @return None - * - * @details This macro is used to set Timer PWM counter type. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_TYPE(timer, type) ((timer)->PWMCTL = ((timer)->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (type)) - -/** - * @brief Start PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable PWM generator and start counter counting. - * \hideinitializer - */ -#define TPWM_START_COUNTER(timer) ((timer)->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk) - -/** - * @brief Stop PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to stop PWM counter after current period is completed. - * \hideinitializer - */ -#define TPWM_STOP_COUNTER(timer) ((timer)->PWMPERIOD = 0x0) - -/** - * @brief Set Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] prescaler Clock prescaler of specified channel. Valid values are between 0x0~0xFFF. - * - * @return None - * - * @details This macro is used to set the prescaler of specified TIMER PWM. - * @note If prescaler is 0, then there is no scaling in counter clock source. - * \hideinitializer - */ -#define TPWM_SET_PRESCALER(timer, prescaler) ((timer)->PWMCLKPSC = (prescaler)) - -/** - * @brief Get Counter Clock Prescaler - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target prescaler setting, CLKPSC (TIMERx_PWMCLKPSC[11:0]) - * - * @details Get the prescaler setting, the target counter clock divider is (CLKPSC + 1). - * \hideinitializer - */ -#define TPWM_GET_PRESCALER(timer) ((timer)->PWMCLKPSC) - -/** - * @brief Set Counter Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] period Period of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_PERIOD(timer, period) ((timer)->PWMPERIOD = (period)) - -/** - * @brief Get Counter Period - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target period setting, PERIOD (TIMERx_PWMPERIOD[15:0]) - * - * @details This macro is used to get the period of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_PERIOD(timer) ((timer)->PWMPERIOD) - -/** - * @brief Set Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] cmp Comparator of specified channel. Valid values are between 0x0~0xFFFF. - * - * @return None - * - * @details This macro is used to set the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_SET_CMPDAT(timer, cmp) ((timer)->PWMCMPDAT = (cmp)) - -/** - * @brief Get Comparator Value - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return Target comparator setting, CMPDAT (TIMERx_PWMCMPDAT[15:0]) - * - * @details This macro is used to get the comparator value of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_GET_CMPDAT(timer) ((timer)->PWMCMPDAT) - -/** - * @brief Clear Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to clear counter of specified TIMER PWM. - * \hideinitializer - */ -#define TPWM_CLEAR_COUNTER(timer) ((timer)->PWMCNTCLR = TIMER_PWMCNTCLR_CNTCLR_Msk) - -/** - * @brief Software Trigger Brake Event - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] type Type of brake trigger. Valid values are: - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This macro is used to trigger brake event by writing PWMSWBRK register. - * \hideinitializer - */ -#define TPWM_SW_TRIGGER_BRAKE(timer, type) ((timer)->PWMSWBRK = (type)) - -/** - * @brief Enable Output Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Enable specified channel output function. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @return None - * - * @details This macro is used to enable output function of specified output pins. - * @note If the corresponding bit in ch parameter is 0, then output function will be disabled in this channel. - * \hideinitializer - */ -#define TPWM_ENABLE_OUTPUT(timer, ch) ((timer)->PWMPOEN = (ch)) - -/** - * @brief Set Output Inverse - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Set specified channel output is inversed or not. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @return None - * - * @details This macro is used to enable output inverse of specified output pins. - * @note If ch parameter is 0, then output inverse function will be disabled. - * \hideinitializer - */ -#define TPWM_SET_OUTPUT_INVERSE(timer, ch) ((timer)->PWMPOLCTL = (ch)) - -/** - * @brief Enable Output Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] ch Enable specified channel output mask function. Valid values are the combination of: - * - \ref TPWM_CH0 - * - \ref TPWM_CH1 - * - * @param[in] level Output to high or low on specified mask channel. - * - * @return None - * - * @details This macro is used to enable output function of specified output pins. - * @note If ch parameter is 0, then output mask function will be disabled. - * \hideinitializer - */ -#define TPWM_SET_MASK_OUTPUT(timer, ch, level) do {(timer)->PWMMSKEN = (ch); (timer)->PWMMSK = (level); }while(0) - -/** - * @brief Set Counter Synchronous Mode - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @param[in] mode Synchronous mode. Possible options are: - * - \ref TPWM_CNTR_SYNC_DISABLE - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER0 - * - \ref TPWM_CNTR_SYNC_START_BY_TIMER2 - * - \ref TPWM_CNTR_SYNC_CLEAR_BY_TIMER2 - * - * @return None - * - * @details This macro is used to set counter synchronous mode of specified Timer PWM module. - * @note Only support all PWM counters are synchronous by TIMER0 PWM or TIMER0~1 PWM counter synchronous by TIMER0 PWM and - * TIMER2~3 PWM counter synchronous by TIMER2 PWM. - * \hideinitializer - */ -#define TPWM_SET_COUNTER_SYNC_MODE(timer, mode) ((timer)->PWMSCTL = (mode)) - -/** - * @brief Trigger Counter Synchronous - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to trigger synchronous event by specified TIMER PWM. - * @note 1. This macro is only available for TIMER0 PWM and TIMER2 PWM. \n - * 2. STRGEN (PWMSTRG[0]) is write only and always read as 0. - * \hideinitializer - */ -#define TPWM_TRIGGER_COUNTER_SYNC(timer) ((timer)->PWMSTRG = TIMER_PWMSTRG_STRGEN_Msk) - -/** - * @brief Enable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the zero event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Disable Zero Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the zero event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_ZERO_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_ZIEN_Msk) - -/** - * @brief Get Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Zero event interrupt did not occur - * @retval 1 Zero event interrupt occurred - * - * @details This macro indicates zero event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_ZERO_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_ZIF_Msk)? 1 : 0) - -/** - * @brief Clear Zero Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears zero event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_ZERO_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_ZIF_Msk) - -/** - * @brief Enable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Disable Period Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the period event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_PERIOD_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_PIEN_Msk) - -/** - * @brief Get Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Period event interrupt did not occur - * @retval 1 Period event interrupt occurred - * - * @details This macro indicates period event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_PERIOD_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_PIF_Msk)? 1 : 0) - -/** - * @brief Clear Period Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears period event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_PERIOD_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_PIF_Msk) - -/** - * @brief Enable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Disable Compare Up Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the compare up event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_UP_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPUIEN_Msk) - -/** - * @brief Get Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Compare up event interrupt did not occur - * @retval 1 Compare up event interrupt occurred - * - * @details This macro indicates compare up event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_CMP_UP_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPUIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Up Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears compare up event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_UP_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPUIF_Msk) - -/** - * @brief Enable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to enable the compare down event interrupt function. - * \hideinitializer - */ -#define TPWM_ENABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 |= TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Disable Compare Down Event Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to disable the compare down event interrupt function. - * \hideinitializer - */ -#define TPWM_DISABLE_CMP_DOWN_INT(timer) ((timer)->PWMINTEN0 &= ~TIMER_PWMINTEN0_CMPDIEN_Msk) - -/** - * @brief Get Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Compare down event interrupt did not occur - * @retval 1 Compare down event interrupt occurred - * - * @details This macro indicates compare down event occurred or not. - * \hideinitializer - */ -#define TPWM_GET_CMP_DOWN_INT_FLAG(timer) (((timer)->PWMINTSTS0 & TIMER_PWMINTSTS0_CMPDIF_Msk)? 1 : 0) - -/** - * @brief Clear Compare Down Event Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears compare down event interrupt flag. - * \hideinitializer - */ -#define TPWM_CLEAR_CMP_DOWN_INT_FLAG(timer) ((timer)->PWMINTSTS0 = TIMER_PWMINTSTS0_CMPDIF_Msk) - -/** - * @brief Get Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Timer PWM counter never counts to maximum value - * @retval 1 Timer PWM counter counts to maximum value, 0xFFFF - * - * @details This macro indicates Timer PWM counter has count to 0xFFFF or not. - * \hideinitializer - */ -#define TPWM_GET_REACH_MAX_CNT_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_CNTMAXF_Msk)? 1 : 0) - -/** - * @brief Clear Counter Reach Maximum Count Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro clears reach maximum count status. - * \hideinitializer - */ -#define TPWM_CLEAR_REACH_MAX_CNT_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_CNTMAXF_Msk) - -/** - * @brief Get Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @retval 0 Trigger ADC start conversion is not occur - * @retval 1 Specified counter compare event has trigger ADC start conversion - * - * @details This macro is used to indicate PWM counter compare event has triggered ADC start conversion. - * \hideinitializer - */ -#define TPWM_GET_TRG_ADC_STATUS(timer) (((timer)->PWMSTATUS & TIMER_PWMSTATUS_EADCTRGF_Msk)? 1 : 0) - -/** - * @brief Clear Trigger ADC Status - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to clear PWM counter compare event trigger ADC status. - * \hideinitializer - */ -#define TPWM_CLEAR_TRG_ADC_STATUS(timer) ((timer)->PWMSTATUS = TIMER_PWMSTATUS_EADCTRGF_Msk) - -/** - * @brief Set Brake Event at Brake Pin High or Low-to-High - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * @note The default brake pin detection is high level or from low to high. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_HIGH_DETECT(timer) ((timer)->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set Brake Event at Brake Pin Low or High-to-Low - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at low level or transfer from high to low. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_LOW_DETECT(timer) ((timer)->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk) - -/** - * @brief Set External Brake Pin Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * @param[in] pin The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * - * @return None - * - * @details This macro is used to set detect brake event when external brake pin at high level or transfer from low to high. - * \hideinitializer - */ -#define TPWM_SET_BRAKE_PIN_SOURCE(timer, pin) ((timer)->PWMBNF = ((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | ((pin)<> 4ul)-2ul) - - -/** - * @brief Calculate UART baudrate mode2 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode2 divider - * - * @details This macro calculate UART baudrate mode2 divider. - * \hideinitializer - */ -#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)/2ul)) / (u32BaudRate))-2ul) - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UART_WRITE(uart, u8Data) ((uart)->DAT = (u8Data)) - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module - * - * @return The oldest data byte in RX FIFO. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UART_READ(uart) ((uart)->DAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not empty - * @retval >=1 Tx FIFO is empty - * - * @details This macro get Transmitter FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_TX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not empty - * @retval >=1 Rx FIFO is empty - * - * @details This macro get Receiver FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_RX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified UART port transmission is over. - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. - * It indicates if specified UART port transmission is over nor not. - * \hideinitializer - */ -#define UART_IS_TX_EMPTY(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos) - - -/** - * @brief Wait specified UART port transmission is over - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro wait specified UART port transmission is over. - * \hideinitializer - */ -#define UART_WAIT_TX_EMPTY(uart) while(!((((uart)->FIFOSTS) & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos)) - - -/** - * @brief Check RX is ready or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 The number of bytes in the RX FIFO is less than the RFITL - * @retval 1 The number of bytes in the RX FIFO equals or larger than RFITL - * - * @details This macro check receive data available interrupt flag is set or not. - * \hideinitializer - */ -#define UART_IS_RX_READY(uart) (((uart)->INTSTS & UART_INTSTS_RDAIF_Msk)>>UART_INTSTS_RDAIF_Pos) - - -/** - * @brief Check TX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 TX FIFO is full - * @retval 0 TX FIFO is not full - * - * @details This macro check TX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_TX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk)>>UART_FIFOSTS_TXFULL_Pos) - - -/** - * @brief Check RX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 RX FIFO is full - * @retval 0 RX FIFO is not full - * - * @details This macro check RX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_RX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk)>>UART_FIFOSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not full. - * @retval >=1 Tx FIFO is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UART_GET_TX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not full. - * @retval >=1 Rx FIFO is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UART_GET_RX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk) - - -/** - * @brief Enable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_BUFEIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_ENABLE_INT(uart, u32eIntSel) ((uart)->INTEN |= (u32eIntSel)) - - -/** - * @brief Disable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_BUFEIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_DISABLE_INT(uart, u32eIntSel) ((uart)->INTEN &= ~ (u32eIntSel)) - - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref UART_INTSTS_PBUFEINT_Msk : PDMA Mode Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_PTOINT_Msk : PDMA Mode Time-out Interrupt Indicator - * - \ref UART_INTSTS_PMODINT_Msk : PDMA Mode MODEM Status Interrupt Indicator - * - \ref UART_INTSTS_PRLSINT_Msk : PDMA Mode Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_PBUFEIF_Msk : PDMA Mode Buffer Error Interrupt Flag - * - \ref UART_INTSTS_PTOIF_Msk : PDMA Mode Time-out Interrupt Flag - * - \ref UART_INTSTS_PMODIF_Msk : PDMA Mode MODEM Interrupt Flag - * - \ref UART_INTSTS_PRLSIF_Msk : PDMA Mode Receive Line Status Flag - * - \ref UART_INTSTS_BUFEINT_Msk : Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_RXTOINT_Msk : Time-out Interrupt Indicator - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status Interrupt Indicator - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_THREINT_Msk : Transmit Holding Register Empty Interrupt Indicator - * - \ref UART_INTSTS_RDAINT_Msk : Receive Data Available Interrupt Indicator - * - \ref UART_INTSTS_BUFEIF_Msk : Buffer Error Interrupt Flag - * - \ref UART_INTSTS_RXTOIF_Msk : Rx Time-out Interrupt Flag - * - \ref UART_INTSTS_MODEMIF_Msk : Modem Interrupt Flag - * - \ref UART_INTSTS_RLSIF_Msk : Receive Line Status Interrupt Flag - * - \ref UART_INTSTS_THREIF_Msk : Tx Empty Interrupt Flag - * - \ref UART_INTSTS_RDAIF_Msk : Rx Ready Interrupt Flag - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define UART_GET_INT_FLAG(uart,u32eIntTypeFlag) (((uart)->INTSTS & (u32eIntTypeFlag))?1:0) - - -/** - * @brief Clear RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro clear RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_CLEAR_ADDR_FLAG(uart) ((uart)->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk) - - -/** - * @brief Get RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Receiver detects a data that is not an address bit. - * @retval 1 Receiver detects a data that is an address bit. - * - * @details This macro get RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_GET_ADDR_FLAG(uart) (((uart)->FIFOSTS & UART_FIFOSTS_ADDRDETF_Msk) >> UART_FIFOSTS_ADDRDETF_Pos) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T *uart); -__STATIC_INLINE void UART_SET_RTS(UART_T *uart); - - -/** - * @brief Set RTS pin to low - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to low. - */ -__STATIC_INLINE void UART_CLEAR_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - uart->MODEM &= ~UART_MODEM_RTS_Msk; -} - - -/** - * @brief Set RTS pin to high - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to high. - */ -__STATIC_INLINE void UART_SET_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk | UART_MODEM_RTS_Msk; -} - -/** - * @brief Enable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UART_PDMA_ENABLE(uart, u32FuncSel) ((uart)->INTEN |= (u32FuncSel)) -/** - * @brief Disable specified UART PDMA function - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32FuncSel Combination of following functions - * - \ref UART_INTEN_TXPDMAEN_Msk - * - \ref UART_INTEN_RXPDMAEN_Msk - * - * @return None - * - * \hideinitializer - */ -#define UART_PDMA_DISABLE(uart, u32FuncSel) ((uart)->INTEN &= ~(u32FuncSel)) - - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Close(UART_T *uart); -void UART_DisableFlowCtrl(UART_T *uart); -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_EnableFlowCtrl(UART_T *uart); -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Open(UART_T *uart, uint32_t u32baudrate); -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC); -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction); -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr); -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); - - - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /*__NU_UART_H__*/ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wdt.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wdt.h deleted file mode 100644 index 5e8398e3838..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wdt.h +++ /dev/null @@ -1,214 +0,0 @@ -/**************************************************************************//** - * @file nu_wdt.h - * @brief WDT driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WDT_H__ -#define __NU_WDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_CONSTANTS WDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Time-out Interval Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_TIMEOUT_2POW4 (0UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^4 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW6 (1UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^6 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW8 (2UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^8 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW10 (3UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^10 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW12 (4UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^12 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW14 (5UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^14 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW16 (6UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^16 * WDT clocks \hideinitializer */ -#define WDT_TIMEOUT_2POW18 (7UL << WDT_CTL_TOUTSEL_Pos) /*!< Setting WDT time-out interval to 2^18 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Reset Delay Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_DELAY_1026CLK (0UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 1026 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_130CLK (1UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 130 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_18CLK (2UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 18 * WDT clocks \hideinitializer */ -#define WDT_RESET_DELAY_3CLK (3UL << WDT_ALTCTL_RSTDSEL_Pos) /*!< Setting WDT reset delay period to 3 * WDT clocks \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WDT Free Reset Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WDT_RESET_COUNTER_KEYWORD (0x00005AA5UL) /*!< Fill this value to WDT_RSTCNT register to free reset WDT counter \hideinitializer */ - -/*@}*/ /* end of group WDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Clear WDT Reset System Flag - * - * @param wdt - * - * @return None - * - * @details This macro clears WDT time-out reset system flag. - * \hideinitializer - */ -#define WDT_CLEAR_RESET_FLAG(wdt) (wdt->CTL = (wdt->CTL & ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_RSTF_Msk) - -/** - * @brief Clear WDT Time-out Interrupt Flag - * - * @param wdt - * - * @return None - * - * @details This macro clears WDT time-out interrupt flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_INT_FLAG(wdt) (wdt->CTL = (wdt->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_WKF_Msk)) | WDT_CTL_IF_Msk) - -/** - * @brief Clear WDT Wake-up Flag - * - * @param wdt - * - * @return None - * - * @details This macro clears WDT time-out wake-up system flag. - * \hideinitializer - */ -#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG(wdt) (wdt->CTL = (wdt->CTL & ~(WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk)) | WDT_CTL_WKF_Msk) - -/** - * @brief Get WDT Time-out Reset Flag - * - * @param wdt - * - * @retval 0 WDT time-out reset system did not occur - * @retval 1 WDT time-out reset system occurred - * - * @details This macro indicates system has been reset by WDT time-out reset or not. - * \hideinitializer - */ -#define WDT_GET_RESET_FLAG(wdt) ((wdt->CTL & WDT_CTL_RSTF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Interrupt Flag - * - * @param wdt - * - * @retval 0 WDT time-out interrupt did not occur - * @retval 1 WDT time-out interrupt occurred - * - * @details This macro indicates WDT time-out interrupt occurred or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_INT_FLAG(wdt) ((wdt->CTL & WDT_CTL_IF_Msk)? 1UL : 0UL) - -/** - * @brief Get WDT Time-out Wake-up Flag - * - * @param wdt - * - * @retval 0 WDT time-out interrupt does not cause CPU wake-up - * @retval 1 WDT time-out interrupt event cause CPU wake-up - * - * @details This macro indicates WDT time-out interrupt event has waked up system or not. - * \hideinitializer - */ -#define WDT_GET_TIMEOUT_WAKEUP_FLAG(wdt) ((wdt->CTL & WDT_CTL_WKF_Msk)? 1UL : 0UL) - -/** - * @brief Reset WDT Counter - * - * @param wdt - * - * @return None - * - * @details This macro is used to reset the internal 18-bit WDT up counter value. - * @note If WDT is activated and time-out reset system function is enabled also, user should \n - * reset the 18-bit WDT up counter value to avoid generate WDT time-out reset signal to \n - * reset system before the WDT time-out reset delay period expires. - * \hideinitializer - */ -#define WDT_RESET_COUNTER(wdt) (wdt->RSTCNT = WDT_RESET_COUNTER_KEYWORD) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -__STATIC_INLINE void WDT_Close(WDT_T *wdt); -__STATIC_INLINE void WDT_EnableInt(WDT_T *wdt); -__STATIC_INLINE void WDT_DisableInt(WDT_T *wdt); - -/** - * @brief Stop WDT Counting - * - * @param None - * - * @return None - * - * @details This function will stop WDT counting and disable WDT module. - */ -__STATIC_INLINE void WDT_Close(WDT_T *wdt) -{ - wdt->CTL = 0UL; - return; -} - -/** - * @brief Enable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will enable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_EnableInt(WDT_T *wdt) -{ - wdt->CTL |= WDT_CTL_INTEN_Msk; - return; -} - -/** - * @brief Disable WDT Time-out Interrupt - * - * @param None - * - * @return None - * - * @details This function will disable the WDT time-out interrupt function. - */ -__STATIC_INLINE void WDT_DisableInt(WDT_T *wdt) -{ - /* Do not touch another write 1 clear bits */ - wdt->CTL &= ~(WDT_CTL_INTEN_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk); - return; -} - -void WDT_Open(WDT_T *wdt, uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup); - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WDT_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_whc.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_whc.h deleted file mode 100644 index 32ccc070b78..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_whc.h +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************//** - * @file nu_whc.h - * @brief WHC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WHC_H__ -#define __NU_WHC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WHC_Driver WHC Driver - @{ -*/ - -/** @addtogroup WHC_EXPORTED_CONSTANTS WHC Exported Constants - @{ -*/ -#define WHC_CH 4ul /*!TXCTL |= (1ul << (u32Ch + WHC_TXCTL_CH0RC_Pos))) - -/** - * @brief - * - * @param[in] whc The pointer of the specified WHC module. - * @param[in] u32Ch WHC channel, valid channel numbers are 0~3 - * \hideinitializer - */ -#define WHC_IS_TX_READY(whc, u32Ch) ((whc)->TXSTS & (1 << u32Ch)) - -/** - * @brief - * - * @param[in] whc The pointer of the specified WHC module. - * @param[in] u32Ch WHC channel, valid channel numbers are 0~3 - * \hideinitializer - */ -#define WHC_IS_RX_READY(whc, u32Ch) ((whc)->RXSTS & (1 << u32Ch)) - -/** - * @brief Enable specified WHC interrupt - * - * @param[in] whc The pointer of the specified WHC module - * @param[in] u32IntSel Interrupt type select - * - \ref WHC_INTEN_RST0IEN_Msk - * - \ref WHC_INTEN_POFF0IEN_Msk - * - \ref WHC_INTEN_PD0IEN_Msk - * - \ref WHC_INTEN_RST1IEN_Msk - * - \ref WHC_INTEN_POFF1IEN_Msk - * - \ref WHC_INTEN_PD1IEN_Msk - * - \ref WHC_INTEN_GI0IEN_Msk - * - \ref WHC_INTEN_GI1IEN_Msk - * - \ref WHC_INTEN_GI2IEN_Msk - * - \ref WHC_INTEN_GI3IEN_Msk - * - \ref WHC_INTEN_TX0IEN_Msk - * - \ref WHC_INTEN_TX1IEN_Msk - * - \ref WHC_INTEN_TX2IEN_Msk - * - \ref WHC_INTEN_TX3IEN_Msk - * - \ref WHC_INTEN_RX0IEN_Msk - * - \ref WHC_INTEN_RX1IEN_Msk - * - \ref WHC_INTEN_RX2IEN_Msk - * - \ref WHC_INTEN_RX3IEN_Msk - * \hideinitializer - */ -#define WHC_ENABLE_INT(whc, u32IntSel) ((whc)->INTEN |= (u32IntSel)) - - -/** - * @brief Disable specified WHC interrupt - * - * @param[in] whc The pointer of the specified WHC module - * @param[in] u32IntSel Interrupt type select - * - \ref WHC_INTEN_RST0IEN_Msk - * - \ref WHC_INTEN_POFF0IEN_Msk - * - \ref WHC_INTEN_PD0IEN_Msk - * - \ref WHC_INTEN_RST1IEN_Msk - * - \ref WHC_INTEN_POFF1IEN_Msk - * - \ref WHC_INTEN_PD1IEN_Msk - * - \ref WHC_INTEN_GI0IEN_Msk - * - \ref WHC_INTEN_GI1IEN_Msk - * - \ref WHC_INTEN_GI2IEN_Msk - * - \ref WHC_INTEN_GI3IEN_Msk - * - \ref WHC_INTEN_TX0IEN_Msk - * - \ref WHC_INTEN_TX1IEN_Msk - * - \ref WHC_INTEN_TX2IEN_Msk - * - \ref WHC_INTEN_TX3IEN_Msk - * - \ref WHC_INTEN_RX0IEN_Msk - * - \ref WHC_INTEN_RX1IEN_Msk - * - \ref WHC_INTEN_RX2IEN_Msk - * - \ref WHC_INTEN_RX3IEN_Msk - * \hideinitializer - */ -#define WHC_DISABLE_INT(whc, u32IntSel) ((whc)->INTEN &= ~(u32IntSel)) - -/** - * @brief Get specified interrupt flag - * - * @param[in] whc The pointer of the specified WHC module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref WHC_INTSTS_RST0IF_Msk - * - \ref WHC_INTSTS_POFF0IF_Msk - * - \ref WHC_INTSTS_PD0IF_Msk - * - \ref WHC_INTSTS_RST1IF_Msk - * - \ref WHC_INTSTS_POFF1IF_Msk - * - \ref WHC_INTSTS_PD1IF_Msk - * - \ref WHC_INTSTS_GI0IF_Msk - * - \ref WHC_INTSTS_GI1IF_Msk - * - \ref WHC_INTSTS_GI2IF_Msk - * - \ref WHC_INTSTS_GI3IF_Msk - * - \ref WHC_INTSTS_TX0IF_Msk - * - \ref WHC_INTSTS_TX1IF_Msk - * - \ref WHC_INTSTS_TX2IF_Msk - * - \ref WHC_INTSTS_TX3IF_Msk - * - \ref WHC_INTSTS_RX0IF_Msk - * - \ref WHC_INTSTS_RX1IF_Msk - * - \ref WHC_INTSTS_RX2IF_Msk - * - \ref WHC_INTSTS_RX3IF_Msk - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * \hideinitializer - */ -#define WHC_GET_INT_FLAG(whc, u32IntTypeFlag) (((whc)->INTSTS & (u32IntTypeFlag))?1:0) - -/** - * @brief Clear specified interrupt flag - * - * @param[in] whc The pointer of the specified WHC module - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref WHC_INTSTS_RST0IF_Msk - * - \ref WHC_INTSTS_POFF0IF_Msk - * - \ref WHC_INTSTS_PD0IF_Msk - * - \ref WHC_INTSTS_RST1IF_Msk - * - \ref WHC_INTSTS_POFF1IF_Msk - * - \ref WHC_INTSTS_PD1IF_Msk - * - \ref WHC_INTSTS_GI0IF_Msk - * - \ref WHC_INTSTS_GI1IF_Msk - * - \ref WHC_INTSTS_GI2IF_Msk - * - \ref WHC_INTSTS_GI3IF_Msk - * - \ref WHC_INTSTS_TX0IF_Msk - * - \ref WHC_INTSTS_TX1IF_Msk - * - \ref WHC_INTSTS_TX2IF_Msk - * - \ref WHC_INTSTS_TX3IF_Msk - * - \ref WHC_INTSTS_RX0IF_Msk - * - \ref WHC_INTSTS_RX1IF_Msk - * - \ref WHC_INTSTS_RX2IF_Msk - * - \ref WHC_INTSTS_RX3IF_Msk - * \hideinitializer - */ -#define WHC_CLR_INT_FLAG(whc, u32IntTypeFlag) ((whc)->INTSTS = (u32IntTypeFlag)) - -/** - * @brief Trigger WHC general event interrupt - * @param[in] whc The pointer of the specified WHC module - * @param[in] u32IntNum General event interrupt number, valid number are 0~3 - * - * \hideinitializer - */ -#define WHC_TRIGGER_GINT(whc, u32IntNum) ((whc)->GINTTRG = (1ul << u32IntNum)) - -/** - * @brief Get counter part reset flag - * @param[in] whc The pointer of the specified WHC module - * @retval The combination of WHC_CPSTS_WDTRF_Msk, WHC_CPSTS_SYSRF_Msk, and WHC_CPSTS_CPURF_Msk - * - * \hideinitializer - */ -#define WHC_GET_RST_FLAG(whc) ((whc)->CPSTS & (WHC_CPSTS_WDTRF_Msk | WHC_CPSTS_SYSRF_Msk | WHC_CPSTS_CPURF_Msk)) - -/** - * @brief Clear counter part reset flag - * @param[in] whc The pointer of the specified WHC module - * - * \hideinitializer - */ -#define WHC_CLR_RST_FLAG(whc) ((whc)->CPSTS = (whc)->CPSTS) - - -/** - * @brief Set wakeup up source - * - * @param[in] whc The pointer of the specified WHC module - * @param[in] u32WakeupSrc Wake up source. Should be the combination of: - * - \ref WHC_WKCTL_RST0WKEN_Msk - * - \ref WHC_WKCTL_POFF0WKEN_Msk - * - \ref WHC_WKCTL_PD0WKEN_Msk - * - \ref WHC_WKCTL_RST1WKEN_Msk - * - \ref WHC_WKCTL_POFF1WKEN_Msk - * - \ref WHC_WKCTL_PD1WKEN_Msk - * - \ref WHC_WKCTL_GI0WKEN_Msk - * - \ref WHC_WKCTL_GI1WKEN_Msk - * - \ref WHC_WKCTL_GI2WKEN_Msk - * - \ref WHC_WKCTL_GI3WKEN_Msk - * - \ref WHC_WKCTL_TX0WKEN_Msk - * - \ref WHC_WKCTL_TX1WKEN_Msk - * - \ref WHC_WKCTL_TX2WKEN_Msk - * - \ref WHC_WKCTL_TX3WKEN_Msk - * - \ref WHC_WKCTL_RX0WKEN_Msk - * - \ref WHC_WKCTL_RX1WKEN_Msk - * - \ref WHC_WKCTL_RX2WKEN_Msk - * - \ref WHC_WKCTL_RX3WKEN_Msk - * \hideinitializer - */ -#define WHC_SET_WAKEUP_SRC(whc,u32WakeFlag) ((whc)->WKCTL |= (u32WakeFlag)) - - -/** - * @brief Clear wakeup up source - * - * @param[in] whc The pointer of the specified WHC module - * @param[in] u32WakeupSrc Wake up source. Should be the combination of: - * - \ref WHC_WKCTL_RST0WKEN_Msk - * - \ref WHC_WKCTL_POFF0WKEN_Msk - * - \ref WHC_WKCTL_PD0WKEN_Msk - * - \ref WHC_WKCTL_RST1WKEN_Msk - * - \ref WHC_WKCTL_POFF1WKEN_Msk - * - \ref WHC_WKCTL_PD1WKEN_Msk - * - \ref WHC_WKCTL_GI0WKEN_Msk - * - \ref WHC_WKCTL_GI1WKEN_Msk - * - \ref WHC_WKCTL_GI2WKEN_Msk - * - \ref WHC_WKCTL_GI3WKEN_Msk - * - \ref WHC_WKCTL_TX0WKEN_Msk - * - \ref WHC_WKCTL_TX1WKEN_Msk - * - \ref WHC_WKCTL_TX2WKEN_Msk - * - \ref WHC_WKCTL_TX3WKEN_Msk - * - \ref WHC_WKCTL_RX0WKEN_Msk - * - \ref WHC_WKCTL_RX1WKEN_Msk - * - \ref WHC_WKCTL_RX2WKEN_Msk - * - \ref WHC_WKCTL_RX3WKEN_Msk - * \hideinitializer - */ -#define WHC_CLR_WAKEUP_SRC(whc,u32WakeFlag) ((whc)->WKCTL &= ~(u32WakeFlag)) - -int WHC_Send(WHC_T *whc, uint32_t u32Ch, uint32_t *pu32TxBuf); -int WHC_Recv(WHC_T *whc, uint32_t u32Ch, uint32_t *pu32RxBuf); -int WHC_GetCPSts(WHC_T *whc, uint32_t u32Core); - - -/*@}*/ /* end of group WHC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WHC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wwdt.h b/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wwdt.h deleted file mode 100644 index 054876a92d4..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/inc/nu_wwdt.h +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************//** - * @file nu_wwdt.h - * @brief WWDT driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_WWDT_H__ -#define __NU_WWDT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_CONSTANTS WWDT Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Prescale Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_PRESCALER_1 (0 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2 (1 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_4 (2 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 4 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_8 (3 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 8 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_16 (4 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 16 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_32 (5 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 32 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_64 (6 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 64 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_128 (7 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 128 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_192 (8 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 192 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_256 (9 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 256 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_384 (10 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 384 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_512 (11 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 512 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_768 (12 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 768 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1024 (13 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1024 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_1536 (14 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 1536 * (64*WWDT_CLK) \hideinitializer */ -#define WWDT_PRESCALER_2048 (15 << WWDT_CTL_PSCSEL_Pos) /*!< Select max time-out period to 2048 * (64*WWDT_CLK) \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* WWDT Reload Counter Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define WWDT_RELOAD_WORD (0x00005AA5) /*!< Fill this value to WWDT_RLDCNT register to reload WWDT counter \hideinitializer */ - -/*@}*/ /* end of group WWDT_EXPORTED_CONSTANTS */ - - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Clear WWDT Reset System Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT time-out reset system flag. - * \hideinitializer - */ -#define WWDT_CLEAR_RESET_FLAG() (WWDT2->STATUS = WWDT_STATUS_WWDTRF_Msk) - -/** - * @brief Clear WWDT Compared Match Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear WWDT compared match interrupt flag. - * \hideinitializer - */ -#define WWDT_CLEAR_INT_FLAG() (WWDT2->STATUS = WWDT_STATUS_WWDTIF_Msk) - -/** - * @brief Get WWDT Reset System Flag - * - * @param None - * - * @retval 0 WWDT time-out reset system did not occur - * @retval 1 WWDT time-out reset system occurred - * - * @details This macro is used to indicate system has been reset by WWDT time-out reset or not. - * \hideinitializer - */ -#define WWDT_GET_RESET_FLAG() ((WWDT2->STATUS & WWDT_STATUS_WWDTRF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Compared Match Interrupt Flag - * - * @param None - * - * @retval 0 WWDT compare match interrupt did not occur - * @retval 1 WWDT compare match interrupt occurred - * - * @details This macro is used to indicate WWDT counter value matches CMPDAT value or not. - * \hideinitializer - */ -#define WWDT_GET_INT_FLAG() ((WWDT2->STATUS & WWDT_STATUS_WWDTIF_Msk)? 1 : 0) - -/** - * @brief Get WWDT Counter - * - * @param None - * - * @return WWDT Counter Value - * - * @details This macro reflects the current WWDT counter value. - * \hideinitializer - */ -#define WWDT_GET_COUNTER() (WWDT2->CNT) - -/** - * @brief Reload WWDT Counter - * - * @param None - * - * @return None - * - * @details This macro is used to reload the WWDT counter value to 0x3F. - * @note User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value \n - * between 0 and CMPDAT value. If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT, \n - * WWDT reset signal will generate immediately to reset system. - * \hideinitializer - */ -#define WWDT_RELOAD_COUNTER() (WWDT2->RLDCNT = WWDT_RELOAD_WORD) - -void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt); - -/*@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WWDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_WWDT_H__ */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_adc.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_adc.c deleted file mode 100644 index d8dfdf1342c..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_adc.c +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file adc.c - * @brief ADC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright(C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ADC_Driver ADC Driver - @{ -*/ - - -/** @addtogroup ADC_EXPORTED_FUNCTIONS ADC Exported Functions - @{ -*/ - -/** - * @brief This API configures ADC module to be ready for convert the input from selected channel - * @param[in] adc Base address of ADC module - * @param[in] u32InputMode Input mode. Valid values are: - * - \ref ADC_INPUT_MODE_NORMAL_CONV - * - \ref ADC_INPUT_MODE_4WIRE_TOUCH - * - \ref ADC_INPUT_MODE_5WIRE_TOUCH - * @param[in] u32OpMode Could be - * - \ref ADC_HIGH_SPEED_MODE - * - \ref ADC_NORMAL_SPEED_MODE - * @param[in] u32ChMask Channel enable bit. Each bit corresponds to a input channel. Bit 0 is channel 0, bit 1 is channel 1... - * This parameter is only used while u32InputMode set to ADC_INPUT_MODE_NORMAL_CONV. - * @return None - * @note ADC can only convert 1 channel at a time. If more than 1 channels are enabled, only channel - * with smallest number will be convert. - * @note This API does not turn on ADC power nor does trigger ADC conversion - */ -void ADC_Open(ADC_T *adc, - uint32_t u32InputMode, - uint32_t u32OpMode, - uint32_t u32ChMask) -{ - uint32_t u32Ch = 0, i; - - if (u32InputMode == ADC_INPUT_MODE_NORMAL_CONV) - { - for (i = 0; i < ADC_CH_NUM; i++) - { - if (u32ChMask & (1 << i)) - { - u32Ch = i; - break; - } - } - adc->CONF = (u32Ch << ADC_CONF_CHSEL_Pos) | u32OpMode | ADC_CONF_NACEN_Msk; - } - else if (u32InputMode == ADC_INPUT_MODE_4WIRE_TOUCH) - { - adc->CONF = 0; - } - else // 5-wire mode - { - adc->CTL |= ADC_CTL_WMSWCH_Msk; - adc->CONF = 0; - } -} - -/** - * @brief Disable ADC module - * @param[in] adc Base address of ADC module - * @return None - */ -void ADC_Close(ADC_T *adc) -{ - adc->CTL = 0; - adc->CONF = 0; - adc->IER = 0; - adc->ISR = adc->ISR; -} - -/*@}*/ /* end of group ADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_canfd.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_canfd.c deleted file mode 100644 index 55c15dfaeca..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_canfd.c +++ /dev/null @@ -1,1894 +0,0 @@ -/**************************************************************************//** - * @file canfd.c - * @brief CANFD driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" -#include "string.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Minimum number of time quanta in a bit. */ -#define MIN_TIME_QUANTA 9ul -/* Maximum number of time quanta in a bit. */ -#define MAX_TIME_QUANTA 20ul -/* Number of receive FIFOs (1 - 2) */ -#define CANFD_NUM_RX_FIFOS 2ul - -/*CANFD max nominal bit rate*/ -#define MAX_NOMINAL_BAUDRATE (1000000UL) - -/* Tx Event FIFO Element ESI(Error State Indicator) */ -#define TX_FIFO_E0_EVENT_ESI_Pos (31) -#define TX_FIFO_E0_EVENT_ESI_Msk (0x1ul << TX_FIFO_E0_EVENT_ESI_Pos) - -/* Tx Event FIFO Element XTD(Extended Identifier) */ -#define TX_FIFO_E0_EVENT_XTD_Pos (30) -#define TX_FIFO_E0_EVENT_XTD_Msk (0x1ul << TX_FIFO_E0_EVENT_XTD_Pos) - -/* Tx Event FIFO Element RTR(Remote Transmission Request) */ -#define TX_FIFO_E0_EVENT_RTR_Pos (29) -#define TX_FIFO_E0_EVENT_RTR_Msk (0x1ul << TX_FIFO_E0_EVENT_RTR_Pos) - -/* Tx Event FIFO Element ID(Identifier) */ -#define TX_FIFO_E0_EVENT_ID_Pos (0) -#define TX_FIFO_E0_EVENT_ID_Msk (0x1FFFFFFFul << TX_FIFO_E0_EVENT_ID_Pos) - -/* Tx Event FIFO Element MM(Message Marker) */ -#define TX_FIFO_E1_EVENT_MM_Pos (24) -#define TX_FIFO_E1_EVENT_MM_Msk (0xFFul << TX_FIFO_E1_EVENT_MM_Pos) - -/* Tx Event FIFO Element ET(Event Type) */ -#define TX_FIFO_E1_EVENT_ET_Pos (22) -#define TX_FIFO_E1_EVENT_ET_Msk (0x3ul << TX_FIFO_E1_EVENT_ET_Pos) - -/* Tx Event FIFO Element FDF(FD Format) */ -#define TX_FIFO_E1_EVENT_FDF_Pos (21) -#define TX_FIFO_E1_EVENT_FDF_Msk (0x1ul << TX_FIFO_E1_EVENT_FDF_Pos) - -/* Tx Event FIFO Element BRS(Bit Rate Switch) */ -#define TX_FIFO_E1_EVENT_BRS_Pos (20) -#define TX_FIFO_E1_EVENT_BRS_Msk (0x1ul << TX_FIFO_E1_EVENT_BRS_Pos) - -/* Tx Event FIFO Element DLC(Data Length Code) */ -#define TX_FIFO_E1_EVENT_DLC_Pos (16) -#define TX_FIFO_E1_EVENT_DLC_Msk (0xFul << TX_FIFO_E1_EVENT_DLC_Pos) - -/* Tx Event FIFO Element TXTS(Tx Timestamp) */ -#define TX_FIFO_E1A_EVENT_TXTS_Pos (0) -#define TX_FIFO_E1A_EVENT_TXTS_Msk (0xFFFFul << TX_FIFO_E1A_EVENT_TXTS_Pos) - -/* Tx Event FIFO Element MM(Message Marker) */ -#define TX_FIFO_E1B_EVENT_MM_Pos (8) -#define TX_FIFO_E1B_EVENT_MM_Msk (0xFFul << TX_FIFO_E1B_EVENT_MM_Pos) - -/* Tx Event FIFO Element TSC(Timestamp Captured) */ -#define TX_FIFO_E1B_EVENT_TSC_Pos (4) -#define TX_FIFO_E1B_EVENT_TSC_Msk (0x1ul << TX_FIFO_E1B_EVENT_TSC_Pos) - -/* Tx Event FIFO Element TSC(Timestamp Captured) */ -#define TX_FIFO_E1B_EVENT_TXTS_Pos (0) -#define TX_FIFO_E1B_EVENT_TXTS_Msk (0xFul << TX_FIFO_E1B_EVENT_TSC_Pos) - -/* Rx Buffer and FIFO Element ESI2(Error State Indicator) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Pos (31) -#define RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Msk (0x1ul << RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Pos) - -/* Rx Buffer and FIFO Element XTD(Extended Identifier) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Pos (30) -#define RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Msk (0x1ul << RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Pos) - -/* Rx Buffer and FIFO Element RTR(Remote Transmission Request) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Pos (29) -#define RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Msk (0x1ul << RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Pos) - -/* Rx Buffer and FIFO Element ID(Identifier) */ -#define RX_BUFFER_AND_FIFO_R0_ELEM_ID_Pos (0) -#define RX_BUFFER_AND_FIFO_R0_ELEM_ID_Msk (0x1FFFFFFFul << RX_BUFFER_AND_FIFO_R0_ELEM_ID_Pos) - -/* Rx Buffer and FIFO Element ANMF(Accepted Non-matching Frame) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_ANMF_Pos (31) -#define RX_BUFFER_AND_FIFO_R1_ELEM_ANMF_Msk (0x1ul << RX_BUFFER_AND_FIFO_R1_ELEM_ANMF_Pos) - -/* Rx Buffer and FIFO Element FIDX(Filter Index) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_FIDX_Pos (24) -#define RX_BUFFER_AND_FIFO_R1_ELEM_FIDX_Msk (0x7Ful << RX_BUFFER_AND_FIFO_R1_ELEM_FIDX_Pos) - -/* Rx Buffer and FIFO Element FDF(FD Format) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Pos (21) -#define RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Msk (0x1ul << RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Pos) - -/* Rx Buffer and FIFO Element BRS(Bit Rate Swit) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Pos (20) -#define RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Msk (0x1ul << RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Pos) - -/* Rx Buffer and FIFO Element DLC(Bit Rate Swit) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Pos (16) -#define RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Msk (0xFul << RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Pos) - -/* Rx Buffer and FIFO Element RXTS(Rx Timestamp) */ -#define RX_BUFFER_AND_FIFO_R1_ELEM_RXTS_Pos (0) -#define RX_BUFFER_AND_FIFO_R1_ELEM_RXTS_Msk (0xFFFFul << RX_BUFFER_AND_FIFO_R1_ELEM_RXTS_Pos) - -/* Tx Buffer Element ESI(Error State Indicator) */ -#define TX_BUFFER_T0_ELEM_ESI_Pos (31) -#define TX_BUFFER_T0_ELEM_ESI_Msk (0x1ul << TX_BUFFER_T0_ELEM_ESI_Pos) - -/* Tx Buffer Element XTD(Extended Identifier) */ -#define TX_BUFFER_T0_ELEM_XTD_Pos (30) -#define TX_BUFFER_T0_ELEM_XTD_Msk (0x1ul << TX_BUFFER_T0_ELEM_XTD_Pos) - -/* Tx Buffer RTR(Remote Transmission Request) */ -#define TX_BUFFER_T0_ELEM_RTR_Pos (29) -#define TX_BUFFER_T0_ELEM_RTR_Msk (0x1ul << TX_BUFFER_T0_ELEM_RTR_Pos) - -/* Tx Buffer Element ID(Identifier) */ -#define TX_BUFFER_T0_ELEM_ID_Pos (0) -#define TX_BUFFER_T0_ELEM_ID_Msk (0x1FFFFFFFul << TX_BUFFER_T0_ELEM_ID_Pos) - -/* Tx Buffer Element MM(Message Marker) */ -#define TX_BUFFER_T1_ELEM_MM1_Pos (24) -#define TX_BUFFER_T1_ELEM_MM1_Msk (0xFFul << TX_BUFFER_T1_ELEM_MM1_Pos) - -/* Tx Buffer Element EFC(Event FIFO Control) */ -#define TX_BUFFER_T1_ELEM_EFC_Pos (23) -#define TX_BUFFER_T1_ELEM_EFC_Msk (0xFFul << TX_BUFFER_T1_ELEM_EFC_Pos) - -/* Tx Buffer Element TSCE(Time Stamp Capture Enable for TSU) */ -#define TX_BUFFER_T1_ELEM_TSCE_Pos (22) -#define TX_BUFFER_T1_ELEM_TSCE_Msk (0x1ul << TX_BUFFER_T1_ELEM_TSCE_Pos) - -/* Tx Buffer Element FDF(FD Format) */ -#define TX_BUFFER_T1_ELEM_FDF_Pos (21) -#define TX_BUFFER_T1_ELEM_FDF_Msk (0x1ul << TX_BUFFER_T1_ELEM_FDF_Pos) - -/* Tx Buffer Element BRS(Bit Rate Swit) */ -#define TX_BUFFER_T1_ELEM_BSR_Pos (20) -#define TX_BUFFER_T1_ELEM_BSR_Msk (0x1ul << TX_BUFFER_T1_ELEM_BSR_Pos) - -/* Tx Buffer Element DLC(Bit Rate Swit) */ -#define TX_BUFFER_T1_ELEM_DLC_Pos (16) -#define TX_BUFFER_T1_ELEM_DLC_Msk (0xFul << TX_BUFFER_T1_ELEM_DLC_Pos) - -/* Tx Buffer Element MM(Message Marker) */ -#define TX_BUFFER_T1_ELEM_MM0_Pos (8) -#define TX_BUFFER_T1_ELEM_MM0_Msk (0xFFul << TX_BUFFER_T1_ELEM_MM0_Pos) - -#define CANFD_RXFS_RFL CANFD_RXF0S_RF0L_Msk - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CANFD_Driver CAN_FD Driver - @{ -*/ - -/** @addtogroup CANFD_EXPORTED_FUNCTIONS CAN_FD Exported Functions - @{ -*/ - -static void CANFD_InitRxFifo(CANFD_T *canfd, uint32_t u32RxFifoNum, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWM, E_CANFD_DATA_FIELD_SIZE eFifoSize); -static void CANFD_InitRxDBuf(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eRxBufSize); -static void CANFD_InitTxDBuf(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eTxBufSize); -static void CANFD_InitTxEvntFifo(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWaterLvl); -static void CANFD_ConfigSIDFC(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize); -static void CANFD_ConfigXIDFC(CANFD_T *canfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize); - -uint32_t CANFD_ReadReg(__I uint32_t *pu32RegAddr) -{ - uint32_t u32ReadReg; - uint32_t u32TimeOutCnt = CANFD_READ_REG_TIMEOUT; - u32ReadReg = 0UL; - - do - { - u32ReadReg = inpw(pu32RegAddr); - if (--u32TimeOutCnt == 0UL) - { - break; - } - } - while (u32ReadReg == 0UL); - - return u32ReadReg; -} - -/** - * @brief Calculates the CAN FD RAM buffer address. - * - * @param[in] psConfigAddr CAN FD element star address structure. - * @param[in] psConfigSize CAN FD element size structure. - * - * @return None. - * - * @details Calculates the CAN FD RAM buffer address. - */ -static void CANFD_CalculateRamAddress(CANFD_RAM_PART_T *psConfigAddr, CANFD_ELEM_SIZE_T *psConfigSize) -{ - uint32_t u32RamAddrOffset = 0; - - /* Get the Standard Message ID Filter element address */ - if (psConfigSize->u32SIDFC > 0) - { - psConfigAddr->u32SIDFC_FLSSA = 0; - u32RamAddrOffset += psConfigSize->u32SIDFC * sizeof(CANFD_STD_FILTER_T); - } - - /* Get the Extended Message ID Filter element address */ - if (psConfigSize->u32XIDFC > 0) - { - psConfigAddr->u32XIDFC_FLESA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32XIDFC * sizeof(CANFD_EXT_FILTER_T); - } - - /* Get the Rx FIFO0 element address */ - if (psConfigSize->u32RxFifo0 > 0) - { - psConfigAddr->u32RXF0C_F0SA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32RxFifo0 * sizeof(CANFD_BUF_T); - } - - /* Get the Rx FIFO1 element address */ - if (psConfigSize->u32RxFifo1 > 0) - { - psConfigAddr->u32RXF1C_F1SA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32RxFifo1 * sizeof(CANFD_BUF_T); - } - - /* Get the Rx Buffer element address */ - if (psConfigSize->u32RxBuf > 0) - { - psConfigAddr->u32RXBC_RBSA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32RxBuf * sizeof(CANFD_BUF_T); - } - - /* Get the TX Event FIFO element address */ - if (psConfigSize->u32TxEventFifo > 0) - { - psConfigAddr->u32TXEFC_EFSA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32TxEventFifo * sizeof(CANFD_EXT_FILTER_T); - } - - /* Get the Tx Buffer element address */ - if (psConfigSize->u32TxBuf > 0) - { - psConfigAddr->u32TXBC_TBSA = u32RamAddrOffset; - u32RamAddrOffset += psConfigSize->u32TxBuf * sizeof(CANFD_BUF_T); - } -} - -/** - * @brief Get the default configuration structure. - * - * @param[in] psConfig Pointer to CAN FD configuration structure. - * @param[in] u8OpMode Setting the CAN FD Operating mode. - * - * @return None. - * - * @details This function initializes the CAN FD configure structure to default value. - * The default value are: - * sNormBitRate.u32BitRate = 500000bps; - * u32DataBaudRate = 0(CAN mode) or 1000000(CAN FD mode) ; - * u32MRamSize = 8k bytes (2k words); - * bEnableLoopBack = FALSE; - * bBitRateSwitch = FALSE(CAN Mode) or TRUE(CAN FD Mode); - * bFDEn = FALSE(CAN Mode) or TRUE(CAN FD Mode); -*/ -void CANFD_GetDefaultConfig(CANFD_FD_T *psConfig, uint8_t u8OpMode) -{ - memset(psConfig, 0, sizeof(CANFD_FD_T)); - - psConfig->sBtConfig.sNormBitRate.u32BitRate = 500000; - - if (u8OpMode == CANFD_OP_CAN_MODE) - { - psConfig->sBtConfig.sDataBitRate.u32BitRate = 0; - psConfig->sBtConfig.bFDEn = FALSE; - psConfig->sBtConfig.bBitRateSwitch = FALSE; - } - else - { - psConfig->sBtConfig.sDataBitRate.u32BitRate = 10000000; - psConfig->sBtConfig.bFDEn = TRUE; - psConfig->sBtConfig.bBitRateSwitch = TRUE; - } - - /* Set normal mode by default */ - psConfig->sBtConfig.evTestMode = eCANFD_NORMAL; - - /*Get the CAN FD memory address*/ - psConfig->u32MRamSize = CANFD_SRAM_SIZE; - - /* CAN FD Standard message ID elements as 64 elements */ - psConfig->sElemSize.u32SIDFC = 64; - /* CAN FD Extended message ID elements as 64 elements */ - psConfig->sElemSize.u32XIDFC = 64; - /* CAN FD TX Buffer elements as 8 elements */ - psConfig->sElemSize.u32TxBuf = 8; - /* CAN FD RX Buffer elements as 8 elements */ - psConfig->sElemSize.u32RxBuf = 8; - /* CAN FD RX FIFO0 elements as 48 elements */ - psConfig->sElemSize.u32RxFifo0 = 48; - /* CAN FD RX FIFO1 elements as 8 elements */ - psConfig->sElemSize.u32RxFifo1 = 8; - /* CAN FD TX Event FOFI elements as 8 elements */ - psConfig->sElemSize.u32TxEventFifo = 8; - /*Calculates the CAN FD RAM buffer address*/ - CANFD_CalculateRamAddress(&psConfig->sMRamStartAddr, &psConfig->sElemSize); -} - - -/** - * @brief Encode the Data Length Code. - * - * @param[in] u8NumberOfBytes Number of bytes in a message. - * - * @return Data Length Code. - * - * @details Converts number of bytes in a message into a Data Length Code. - */ -static uint8_t CANFD_EncodeDLC(uint8_t u8NumberOfBytes) -{ - if (u8NumberOfBytes <= 8) return u8NumberOfBytes; - else if (u8NumberOfBytes <= 12) return 9; - else if (u8NumberOfBytes <= 16) return 10; - else if (u8NumberOfBytes <= 20) return 11; - else if (u8NumberOfBytes <= 24) return 12; - else if (u8NumberOfBytes <= 32) return 13; - else if (u8NumberOfBytes <= 48) return 14; - else return 15; -} - - -/** - * @brief Decode the Data Length Code. - * - * @param[in] u8Dlc Data Length Code. - * - * @return Number of bytes in a message. - * - * @details Converts a Data Length Code into a number of message bytes. - */ -static uint8_t CANFD_DecodeDLC(uint8_t u8Dlc) -{ - if (u8Dlc <= 8) return u8Dlc; - else if (u8Dlc == 9) return 12; - else if (u8Dlc == 10) return 16; - else if (u8Dlc == 11) return 20; - else if (u8Dlc == 12) return 24; - else if (u8Dlc == 13) return 32; - else if (u8Dlc == 14) return 48; - else return 64; -} - - -/** - * @brief Sets the CAN FD protocol timing characteristic. - * - * @param[in] psCanfd The pointer of the specified CANFD module. - * @param[in] psConfig Pointer to the timing configuration structure. - * - * @return None. - * - * @details This function gives user settings to CAN bus timing characteristic. - * The function is for an experienced user. For less experienced users, call - * the CANFD_Open() and fill the baud rate field with a desired value. - * This provides the default timing characteristics to the module. - */ -static void CANFD_SetTimingConfig(CANFD_T *psCanfd, const CANFD_TIMEING_CONFIG_T *psConfig) -{ - if (psCanfd == (CANFD_T *)CANFD0) - { - /* Set CANFD0 clock divider number */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & ~CLK_CLKDIV0_CANFD0DIV_Msk) | CLK_CLKDIV0_CANFD0(psConfig->u8PreDivider) ; - } - else if (psCanfd == (CANFD_T *)CANFD1) - { - /* Set CANFD1 clock divider number */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & ~CLK_CLKDIV0_CANFD1DIV_Msk) | CLK_CLKDIV0_CANFD1(psConfig->u8PreDivider) ; - } - else if (psCanfd == (CANFD_T *)CANFD2) - { - /* Set CANFD2 clock divider number */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & ~CLK_CLKDIV0_CANFD2DIV_Msk) | CLK_CLKDIV0_CANFD2(psConfig->u8PreDivider) ; - } - else if (psCanfd == (CANFD_T *)CANFD3) - { - /* Set CANFD3 clock divider number */ - CLK->CLKDIV0 = (CLK->CLKDIV0 & ~CLK_CLKDIV0_CANFD3DIV_Msk) | CLK_CLKDIV0_CANFD3(psConfig->u8PreDivider) ; - } - else - { - return; - } - - /* configuration change enable */ - psCanfd->CCCR |= CANFD_CCCR_CCE_Msk; - - /* nominal bit rate */ - psCanfd->NBTP = (((psConfig->u8NominalRJumpwidth & 0x7F) - 1) << 25) + - (((psConfig->u16NominalPrescaler & 0x1FF) - 1) << 16) + - ((((psConfig->u8NominalPhaseSeg1 + psConfig->u8NominalPropSeg) & 0xFF) - 1) << 8) + - (((psConfig->u8NominalPhaseSeg2 & 0x7F) - 1) << 0); - - - /* canfd->DBTP */ - if (psCanfd->CCCR & CANFD_CCCR_FDOE_Msk) - { - psCanfd->DBTP = (((psConfig->u8DataPrescaler & 0x1F) - 1) << 16) + - ((((psConfig->u8DataPhaseSeg1 + psConfig->u8DataPropSeg) & 0x1F) - 1) << 8) + - (((psConfig->u8DataPhaseSeg2 & 0xF) - 1) << 4) + - (((psConfig->u8DataRJumpwidth & 0xF) - 1) << 0); - } -} - - -/** - * @brief Get the segment values. - * - * @param[in] u32NominalBaudRate The nominal speed in bps. - * @param[in] u32DataBaudRate The data speed in bps. - * @param[in] u32Ntq Number of nominal time quanta per bit. - * @param[in] u32Dtq Number of data time quanta per bit. - * @param[in] psConfig Passed is a configuration structure, on return the configuration is stored in the structure - * - * @return None. - * - * @details Calculates the segment values for a single bit time for nominal and data baudrates. - */ -static void CANFD_GetSegments(uint32_t u32NominalBaudRate, uint32_t u32DataBaudRate, uint32_t u32Ntq, uint32_t u32Dtq, CANFD_TIMEING_CONFIG_T *psConfig) -{ - float ideal_sp; - int int32P1; - - /* get ideal sample point */ - if (u32NominalBaudRate >= 1000000) ideal_sp = 0.750; - else if (u32NominalBaudRate >= 800000) ideal_sp = 0.800; - else ideal_sp = 0.875; - - /* distribute time quanta */ - int32P1 = (int)(u32Ntq * ideal_sp); - /* can controller doesn't separate prop seg and phase seg 1 */ - psConfig->u8NominalPropSeg = 0; - /* subtract one TQ for sync seg */ - psConfig->u8NominalPhaseSeg1 = int32P1 - 1; - psConfig->u8NominalPhaseSeg2 = u32Ntq - int32P1; - /* sjw is 20% of total TQ, rounded to nearest int */ - psConfig->u8NominalRJumpwidth = (u32Ntq + (5 - 1)) / 5; - - - /* if using baud rate switching then distribute time quanta for data rate */ - if (u32Dtq > 0) - { - /* get ideal sample point */ - if (u32DataBaudRate >= 1000000) ideal_sp = 0.750; - else if (u32DataBaudRate >= 800000) ideal_sp = 0.800; - else ideal_sp = 0.875; - - /* distribute time quanta */ - int32P1 = (int)(u32Dtq * ideal_sp); - /* can controller doesn't separate prop seg and phase seg 1 */ - psConfig->u8DataPropSeg = 0; - /* subtract one TQ for sync seg */ - psConfig->u8DataPhaseSeg1 = int32P1 - 1; - psConfig->u8DataPhaseSeg2 = u32Dtq - int32P1; - /* sjw is 20% of total TQ, rounded to nearest int */ - psConfig->u8DataRJumpwidth = (u32Dtq + (5 - 1)) / 5; - } - else - { - psConfig->u8DataPropSeg = 0; - psConfig->u8DataPhaseSeg1 = 0; - psConfig->u8DataPhaseSeg2 = 0; - psConfig->u8DataRJumpwidth = 0; - } -} - - -/** - * @brief Calculates the CAN controller timing values for specific baudrates. - * - * @param[in] u32NominalBaudRate The nominal speed in bps. - * @param[in] u32DataBaudRate The data speed in bps. Zero to disable baudrate switching. - * @param[in] u32SourceClock_Hz CAN FD Protocol Engine clock source frequency in Hz. - * @param[in] psConfig Passed is a configuration structure, on return the configuration is stored in the structure - * - * @return true if timing configuration found, false if failed to find configuration. - * - * @details Calculates the CAN controller timing values for specific baudrates. - */ -static uint32_t CANFD_CalculateTimingValues(CANFD_T *psCanfd, uint32_t u32NominalBaudRate, uint32_t u32DataBaudRate, uint32_t u32SourceClock_Hz, CANFD_TIMEING_CONFIG_T *psConfig) -{ - int i32Nclk; - int i32Nclk2; - int i32Ntq; - int i32Dclk; - int i32Dclk2; - int i32Dtq; - - /* observe baud rate maximums */ - if (u32NominalBaudRate > MAX_NOMINAL_BAUDRATE) u32NominalBaudRate = MAX_NOMINAL_BAUDRATE; - - for (i32Ntq = MAX_TIME_QUANTA; i32Ntq >= MIN_TIME_QUANTA; i32Ntq--) - { - i32Nclk = u32NominalBaudRate * i32Ntq; - - for (psConfig->u16NominalPrescaler = 0x001; psConfig->u16NominalPrescaler <= 0x400; (psConfig->u16NominalPrescaler)++) - { - i32Nclk2 = i32Nclk * psConfig->u16NominalPrescaler; - - if (((u32SourceClock_Hz / i32Nclk2) <= 5) && ((u32SourceClock_Hz % i32Nclk2) == 0)) - { - psConfig->u8PreDivider = u32SourceClock_Hz / i32Nclk2; - - /* FD Operation? */ - if (psCanfd->CCCR & CANFD_CCCR_FDOE_Msk) - { - /* Exception case: Let u32DataBaudRate is same with u32NominalBaudRate. */ - if (u32DataBaudRate == 0) - u32DataBaudRate = u32NominalBaudRate; - - /* if baudrates are the same and the solution for nominal will work for - data, then use the nominal settings for both */ - if ((u32DataBaudRate == u32NominalBaudRate) && (psConfig->u16NominalPrescaler <= 0x20)) - { - i32Dtq = i32Ntq; - psConfig->u8DataPrescaler = (uint8_t)psConfig->u16NominalPrescaler; - CANFD_GetSegments(u32NominalBaudRate, u32DataBaudRate, i32Ntq, i32Dtq, psConfig); - return TRUE; - } - - /* calculate data settings */ - for (i32Dtq = MAX_TIME_QUANTA; i32Dtq >= MIN_TIME_QUANTA; i32Dtq--) - { - i32Dclk = u32DataBaudRate * i32Dtq; - - for (psConfig->u8DataPrescaler = 0x01; psConfig->u8DataPrescaler <= 0x20; (psConfig->u8DataPrescaler)++) - { - i32Dclk2 = i32Dclk * psConfig->u8DataPrescaler; - if (u32SourceClock_Hz == ((uint32_t)i32Dclk2 * psConfig->u8PreDivider)) - { - CANFD_GetSegments(u32NominalBaudRate, u32DataBaudRate, i32Ntq, i32Dtq, psConfig); - return TRUE; - } - } - } - } - else - { - psConfig->u8DataPrescaler = 0; - CANFD_GetSegments(u32NominalBaudRate, 0, 0, 0, psConfig); - return TRUE; - } - } - } - } - - /* failed to find solution */ - return FALSE; -} - - -/** - * @brief Config message ram and Set bit-time. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psCanfdStr message ram setting and bit-time setting - * - * @return None. - * - * @details Converts a Data Length Code into a number of message bytes. - */ -void CANFD_Open(CANFD_T *psCanfd, CANFD_FD_T *psCanfdStr) -{ - uint32_t u32SrcCLK; - uint32_t u32RegLockLevel = SYS_IsRegLocked(); - - if (u32RegLockLevel) - SYS_UnlockReg(); - - if (psCanfd == (CANFD_T *)CANFD0) - { - CLK_EnableModuleClock(CANFD0_MODULE); - SYS_ResetModule(CANFD0_RST); - if (CLK_GetModuleClockSource(CANFD0_MODULE) == 1) - { - u32SrcCLK = CLK_GetPLLClockFreq(VPLL); - } - else - { - u32SrcCLK = CLK_GetPLLClockFreq(APLL); - } - } - else if (psCanfd == (CANFD_T *)CANFD1) - { - CLK_EnableModuleClock(CANFD1_MODULE); - SYS_ResetModule(CANFD1_RST); - if (CLK_GetModuleClockSource(CANFD1_MODULE) == 1) - { - u32SrcCLK = CLK_GetPLLClockFreq(VPLL); - } - else - { - u32SrcCLK = CLK_GetPLLClockFreq(APLL); - } - } - else if (psCanfd == (CANFD_T *)CANFD2) - { - CLK_EnableModuleClock(CANFD2_MODULE); - SYS_ResetModule(CANFD2_RST); - if (CLK_GetModuleClockSource(CANFD2_MODULE) == 1) - { - u32SrcCLK = CLK_GetPLLClockFreq(VPLL); - } - else - { - u32SrcCLK = CLK_GetPLLClockFreq(APLL); - } - } - else if (psCanfd == (CANFD_T *)CANFD3) - { - CLK_EnableModuleClock(CANFD3_MODULE); - SYS_ResetModule(CANFD3_RST); - if (CLK_GetModuleClockSource(CANFD3_MODULE) == 1) - { - u32SrcCLK = CLK_GetPLLClockFreq(VPLL); - } - else - { - u32SrcCLK = CLK_GetPLLClockFreq(APLL); - } - } - else - { - if (u32RegLockLevel) - SYS_LockReg(); - - return; - } - - /* Initialization & un-lock */ - CANFD_RunToNormal(psCanfd, FALSE); - - if (psCanfdStr->sBtConfig.bBitRateSwitch) - { - /* enable FD and baud-rate switching */ - psCanfd->CCCR |= CANFD_CCCR_BRSE_Msk; - } - - if (psCanfdStr->sBtConfig.bFDEn) - { - /*FD Operation enabled*/ - psCanfd->CCCR |= CANFD_CCCR_FDOE_Msk; - } - - /*Clear the Rx Fifo0 element setting */ - psCanfd->RXF0C = 0; - /*Clear the Rx Fifo1 element setting */ - psCanfd->RXF1C = 0; - - /* calculate and apply timing */ - if (CANFD_CalculateTimingValues(psCanfd, psCanfdStr->sBtConfig.sNormBitRate.u32BitRate, psCanfdStr->sBtConfig.sDataBitRate.u32BitRate, - u32SrcCLK, &psCanfdStr->sBtConfig.sConfigBitTing)) - { - CANFD_SetTimingConfig(psCanfd, &psCanfdStr->sBtConfig.sConfigBitTing); - } - - if (u32RegLockLevel) - SYS_LockReg(); - - /* Configures the Standard ID Filter element */ - if (psCanfdStr->sElemSize.u32SIDFC != 0) - CANFD_ConfigSIDFC(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize); - - /*Configures the Extended ID Filter element */ - if (psCanfdStr->sElemSize.u32XIDFC != 0) - CANFD_ConfigXIDFC(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize); - - /*Configures the Tx Buffer element */ - if (psCanfdStr->sElemSize.u32RxBuf != 0) - CANFD_InitTxDBuf(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, eCANFD_BYTE64); - - /*Configures the Rx Buffer element */ - if (psCanfdStr->sElemSize.u32RxBuf != 0) - CANFD_InitRxDBuf(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, eCANFD_BYTE64); - - /*Configures the Rx Fifo0 element */ - if (psCanfdStr->sElemSize.u32RxFifo0 != 0) - CANFD_InitRxFifo(psCanfd, 0, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, 0, eCANFD_BYTE64); - - /*Configures the Rx Fifo1 element */ - if (psCanfdStr->sElemSize.u32RxFifo1 != 0) - CANFD_InitRxFifo(psCanfd, 1, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, 0, eCANFD_BYTE64); - - /*Configures the Tx Event FIFO element */ - if (psCanfdStr->sElemSize.u32TxEventFifo != 0) - CANFD_InitTxEvntFifo(psCanfd, &psCanfdStr->sMRamStartAddr, &psCanfdStr->sElemSize, 0); - - /*Reject all Non-matching Frames Extended ID and Frames Standard ID,Reject all remote frames with 11-bit standard IDs and 29-bit extended IDs */ - CANFD_SetGFC(psCanfd, eCANFD_REJ_NON_MATCH_FRM, eCANFD_REJ_NON_MATCH_FRM, 1, 1); - - /* Test mode configuration */ - switch (psCanfdStr->sBtConfig.evTestMode) - { - case eCANFD_RESTRICTED_OPERATION: - psCanfd->CCCR |= (CANFD_CCCR_TEST_Msk | CANFD_CCCR_ASM_Msk); - break; - - case eCANFD_BUS_MONITOR: - psCanfd->CCCR |= (CANFD_CCCR_TEST_Msk | CANFD_CCCR_MON_Msk); - break; - - case eCANFD_LOOPBACK_EXTERNAL: - psCanfd->CCCR |= CANFD_CCCR_TEST_Msk; - psCanfd->TEST |= CANFD_TEST_LBCK_Msk; - break; - - case eCANFD_LOOPBACK_INTERNAL: - psCanfd->CCCR |= (CANFD_CCCR_TEST_Msk | CANFD_CCCR_MON_Msk); - psCanfd->TEST |= CANFD_TEST_LBCK_Msk; - break; - - case eCANFD_NORMAL: /* Normal mode */ - default: - psCanfd->CCCR &= ~(CANFD_CCCR_MON_Msk | CANFD_CCCR_TEST_Msk | CANFD_CCCR_ASM_Msk); - psCanfd->TEST &= ~CANFD_TEST_LBCK_Msk; - break; - } -} - - -/** - * @brief Close the CAN FD Bus. - * - * @param[in] psCanfd The pointer to CANFD module base address. - * - * @return None. - * - * @details Disable the CAN FD clock and Interrupt. - */ -void CANFD_Close(CANFD_T *psCanfd) -{ - if (psCanfd == (CANFD_T *)CANFD0) - { - CLK_DisableModuleClock(CANFD0_MODULE); - } - else if (psCanfd == (CANFD_T *)CANFD1) - { - CLK_DisableModuleClock(CANFD1_MODULE); - } - else if (psCanfd == (CANFD_T *)CANFD2) - { - CLK_DisableModuleClock(CANFD2_MODULE); - } - else if (psCanfd == (CANFD_T *)CANFD3) - { - CLK_DisableModuleClock(CANFD3_MODULE); - } -} - - -/** - * @brief Get the element's address when read transmit buffer. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32Idx The number of the transmit buffer element - * - * @return Address of the element in transmit buffer. - * - * @details The function is used to get the element's address when read transmit buffer. - */ -static uint32_t CANFD_GetTxBufferElementAddress(CANFD_T *psCanfd, uint32_t u32Idx) -{ - uint32_t u32Size = 0; - u32Size = (CANFD_ReadReg(&psCanfd->TXESC) & CANFD_TXESC_TBDS_Msk) >> CANFD_TXESC_TBDS_Pos; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - return (CANFD_ReadReg(&psCanfd->TXBC) & CANFD_TXBC_TBSA_Msk) + u32Idx * u32Size * 4U; -} - -/** - * @brief Enables CAN FD interrupts according to provided mask . - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32IntLine0 The Interrupt Line 0 type select. - * @param[in] u32IntLine1 The Interrupt Line 1 type select. - * - \ref CANFD_IE_ARAE_Msk : Access to Reserved Address Interrupt - * - \ref CANFD_IE_PEDE_Msk : Protocol Error in Data Phase Interrupt - * - \ref CANFD_IE_PEAE_Msk : Protocol Error in Arbitration Phase Interrupt - * - \ref CANFD_IE_WDIE_Msk : Watchdog Interrupt - * - \ref CANFD_IE_BOE_Msk : Bus_Off Status Interrupt - * - \ref CANFD_IE_EWE_Msk : Warning Status Interrupt - * - \ref CANFD_IE_EPE_Msk : Error Passive Interrupt - * - \ref CANFD_IE_ELOE_Msk : Error Logging Overflow Interrupt - * - \ref CANFD_IE_BEUE_Msk : Bit Error Uncorrected Interrupt - * - \ref CANFD_IE_BECE_Msk : Bit Error Corrected Interrupt - * - \ref CANFD_IE_DRXE_Msk : Message stored to Dedicated Rx Buffer Interrupt - * - \ref CANFD_IE_TOOE_Msk : Timeout Occurred Interrupt - * - \ref CANFD_IE_MRAFE_Msk : Message RAM Access Failure Interrupt - * - \ref CANFD_IE_TSWE_Msk : Timestamp Wraparound Interrupt - * - \ref CANFD_IE_TEFLE_Msk : Tx Event FIFO Event Lost Interrupt - * - \ref CANFD_IE_TEFFE_Msk : Tx Event FIFO Full Interrupt - * - \ref CANFD_IE_TEFWE_Msk : Tx Event FIFO Watermark Reached Interrupt - * - \ref CANFD_IE_TEFNE_Msk : Tx Event FIFO New Entry Interrupt - * - \ref CANFD_IE_TFEE_Msk : Tx FIFO Empty Interrupt - * - \ref CANFD_IE_TCFE_Msk : Transmission Cancellation Finished Interrupt - * - \ref CANFD_IE_TCE_Msk : Transmission Completed Interrupt - * - \ref CANFD_IE_HPME_Msk : High Priority Message Interrupt - * - \ref CANFD_IE_RF1LE_Msk : Rx FIFO 1 Message Lost Interrupt - * - \ref CANFD_IE_RF1FE_Msk : Rx FIFO 1 Full Interrupt - * - \ref CANFD_IE_RF1WE_Msk : Rx FIFO 1 Watermark Reached Interrupt - * - \ref CANFD_IE_RF1NE_Msk : Rx FIFO 1 New Message Interrupt - * - \ref CANFD_IE_RF0LE_Msk : Rx FIFO 0 Message Lost Interrupt - * - \ref CANFD_IE_RF0FE_Msk : Rx FIFO 0 Full Interrupt - * - \ref CANFD_IE_RF0WE_Msk : Rx FIFO 0 Watermark Reached Interrupt - * - \ref CANFD_IE_RF0NE_Msk : Rx FIFO 0 New Message Interrupt - * - * @param[in] u32TXBTIE Enable Tx Buffer Transmission 0-31 Interrupt. - * @param[in] u32TXBCIE Enable Tx Buffer Cancellation Finished 0-31 Interrupt. - * @return None. - * - * @details This macro enable specified CAN FD interrupt. - */ -void CANFD_EnableInt(CANFD_T *psCanfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE) -{ - /*Setting the CANFD Interrupt Enabling*/ - psCanfd->IE = CANFD_ReadReg(&psCanfd->IE) | u32IntLine0 | u32IntLine1; - - if (u32IntLine0 != 0) - { - /* Select specified interrupt event of Line0. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) & ~u32IntLine0; - /* Enable Line0 interrupt. */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) | CANFD_ILE_ENT0_Msk; - } - - if (u32IntLine1 != 0) - { - /* Select specified interrupt event of Line1. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) | u32IntLine1; - /* Enable Line1 interrupt. */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) | CANFD_ILE_ENT1_Msk; - } - - /*Setting the Tx Buffer Transmission Interrupt Enable*/ - psCanfd->TXBTIE = CANFD_ReadReg(&psCanfd->TXBTIE) | u32TXBTIE; - - /*Tx Buffer Cancellation Finished Interrupt Enable*/ - psCanfd->TXBCIE = CANFD_ReadReg(&psCanfd->TXBCIE) | u32TXBCIE; -} - - -/** - * @brief Disables CAN FD interrupts according to provided mask . - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32IntLine0 The Interrupt Line 0 type select. - * @param[in] u32IntLine1 The Interrupt Line 1 type select. - * - \ref CANFD_IE_ARAE_Msk : Access to Reserved Address Interrupt - * - \ref CANFD_IE_PEDE_Msk : Protocol Error in Data Phase Interrupt - * - \ref CANFD_IE_PEAE_Msk : Protocol Error in Arbitration Phase Interrupt - * - \ref CANFD_IE_WDIE_Msk : Watchdog Interrupt - * - \ref CANFD_IE_BOE_Msk : Bus_Off Status Interrupt - * - \ref CANFD_IE_EWE_Msk : Warning Status Interrupt - * - \ref CANFD_IE_EPE_Msk : Error Passive Interrupt - * - \ref CANFD_IE_ELOE_Msk : Error Logging Overflow Interrupt - * - \ref CANFD_IE_BEUE_Msk : Bit Error Uncorrected Interrupt - * - \ref CANFD_IE_BECE_Msk : Bit Error Corrected Interrupt - * - \ref CANFD_IE_DRXE_Msk : Message stored to Dedicated Rx Buffer Interrupt - * - \ref CANFD_IE_TOOE_Msk : Timeout Occurred Interrupt - * - \ref CANFD_IE_MRAFE_Msk : Message RAM Access Failure Interrupt - * - \ref CANFD_IE_TSWE_Msk : Timestamp Wraparound Interrupt - * - \ref CANFD_IE_TEFLE_Msk : Tx Event FIFO Event Lost Interrupt - * - \ref CANFD_IE_TEFFE_Msk : Tx Event FIFO Full Interrupt - * - \ref CANFD_IE_TEFWE_Msk : Tx Event FIFO Watermark Reached Interrupt - * - \ref CANFD_IE_TEFNE_Msk : Tx Event FIFO New Entry Interrupt - * - \ref CANFD_IE_TFEE_Msk : Tx FIFO Empty Interrupt - * - \ref CANFD_IE_TCFE_Msk : Transmission Cancellation Finished Interrupt - * - \ref CANFD_IE_TCE_Msk : Transmission Completed Interrupt - * - \ref CANFD_IE_HPME_Msk : High Priority Message Interrupt - * - \ref CANFD_IE_RF1LE_Msk : Rx FIFO 1 Message Lost Interrupt - * - \ref CANFD_IE_RF1FE_Msk : Rx FIFO 1 Full Interrupt - * - \ref CANFD_IE_RF1WE_Msk : Rx FIFO 1 Watermark Reached Interrupt - * - \ref CANFD_IE_RF1NE_Msk : Rx FIFO 1 New Message Interrupt - * - \ref CANFD_IE_RF0LE_Msk : Rx FIFO 0 Message Lost Interrupt - * - \ref CANFD_IE_RF0FE_Msk : Rx FIFO 0 Full Interrupt - * - \ref CANFD_IE_RF0WE_Msk : Rx FIFO 0 Watermark Reached Interrupt - * - \ref CANFD_IE_RF0NE_Msk : Rx FIFO 0 New Message Interrupt - * - * @param[in] u32TXBTIE Disable Tx Buffer Transmission 0-31 Interrupt. - * @param[in] u32TXBCIE Disable Tx Buffer Cancellation Finished 0-31 Interrupt. - * @return None. - * - * @details This macro disable specified CAN FD interrupt. - */ -void CANFD_DisableInt(CANFD_T *psCanfd, uint32_t u32IntLine0, uint32_t u32IntLine1, uint32_t u32TXBTIE, uint32_t u32TXBCIE) -{ - psCanfd->IE = CANFD_ReadReg(&psCanfd->IE) & ~(u32IntLine0 | u32IntLine1); - - if (u32IntLine0 != 0) - { - /* Cancel specified interrupt event of Line0. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) | u32IntLine0; - } - if (CANFD_ReadReg(&psCanfd->ILS) == ~0) - { - /* Disable Line0 interrupt */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) & ~CANFD_ILE_ENT0_Msk; - } - - if (u32IntLine1 != 0) - { - /* Select specified interrupt event of Line1. */ - psCanfd->ILS = CANFD_ReadReg(&psCanfd->ILS) & ~u32IntLine1; - } - if (CANFD_ReadReg(&psCanfd->ILS) == 0) - { - /* Disable Line1 interrupt */ - psCanfd->ILE = CANFD_ReadReg(&psCanfd->ILE) & ~CANFD_ILE_ENT1_Msk; - } - - /*Setting the Tx Buffer Transmission Interrupt Disable*/ - psCanfd->TXBTIE = CANFD_ReadReg(&psCanfd->TXBTIE) & ~u32TXBTIE; - - /*Tx Buffer Cancellation Finished Interrupt Disable*/ - psCanfd->TXBCIE = CANFD_ReadReg(&psCanfd->TXBCIE) & ~u32TXBCIE; -} - - -/** - * @brief Copy Tx Message to TX buffer and Request transmission. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxBufIdx The Message Buffer index. - * @param[in] psTxMsg Message to be copied. - * - * @return number of tx requests set: 0= Tx Message Buffer is currently in use. - * 1= Write Tx Message Buffer Successfully. - * - * @details Copy Tx Message to FIFO/Queue TX buffer and Request transmission. - */ -uint32_t CANFD_TransmitTxMsg(CANFD_T *psCanfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg) -{ - uint32_t u32Success = 0; - uint32_t u32TimeOutCnt = CANFD_TIMEOUT; - - /* write the message to the message buffer */ - u32Success = CANFD_TransmitDMsg(psCanfd, u32TxBufIdx, psTxMsg); - - if (u32Success == 1) - { - /* wait for completion */ - while (!(psCanfd->TXBRP & (1UL << u32TxBufIdx))) - { - if (--u32TimeOutCnt == 0) - { - u32Success = 0; - break; - } - - } - } - - return u32Success; -} - - -/** - * @brief Writes a Tx Message to Transmit Message Buffer. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32TxBufIdx The Message Buffer index. - * @param[in] psTxMsg Pointer to CAN FD message frame to be sent. - * - * @return 1 Write Tx Message Buffer Successfully. - * 0 Tx Message Buffer is currently in use. - * - * @details This function writes a CANFD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CANFD Message transmit. After - * that the function returns immediately. - */ -uint32_t CANFD_TransmitDMsg(CANFD_T *psCanfd, uint32_t u32TxBufIdx, CANFD_FD_MSG_T *psTxMsg) -{ - CANFD_BUF_T *psTxBuffer; - uint32_t u32Idx = 0, u32Success = 1; - uint32_t u32TimeOutCnt = CANFD_TIMEOUT; - - if (u32TxBufIdx >= CANFD_MAX_TX_BUF_ELEMS) return 0; - - /* transmission is pending in this message buffer */ - if (CANFD_ReadReg(&(psCanfd->TXBRP)) & (1UL << u32TxBufIdx)) return 0; - - /*Get the TX Buffer Start Address in the RAM*/ - psTxBuffer = (CANFD_BUF_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (CANFD_ReadReg(&psCanfd->TXBC) & 0xFFFF) + (u32TxBufIdx * sizeof(CANFD_BUF_T))); - - if (psTxMsg->eIdType == eCANFD_XID) - { - psTxBuffer->u32Id = TX_BUFFER_T0_ELEM_XTD_Msk | (psTxMsg->u32Id & 0x1FFFFFFF); - } - else - { - psTxBuffer->u32Id = (psTxMsg->u32Id & 0x7FF) << 18; - } - - if (psTxMsg->eFrmType == eCANFD_REMOTE_FRM) psTxBuffer->u32Id |= TX_BUFFER_T0_ELEM_RTR_Msk; - - psTxBuffer->u32Config = (CANFD_EncodeDLC(psTxMsg->u32DLC) << 16); - - if (psTxMsg->bFDFormat) psTxBuffer->u32Config |= TX_BUFFER_T1_ELEM_FDF_Msk; - - if (psTxMsg->bBitRateSwitch) psTxBuffer->u32Config |= TX_BUFFER_T1_ELEM_BSR_Msk; - - - for (u32Idx = 0; u32Idx < (psTxMsg->u32DLC + (4 - 1)) / 4; u32Idx++) - { - psTxBuffer->au32Data[u32Idx] = psTxMsg->au32Data[u32Idx]; - } - - while (CANFD_GET_COMMUNICATION_STATE(psCanfd) != eCANFD_IDLE) - { - if (--u32TimeOutCnt == 0) return 0; - } - - psCanfd->TXBAR = (1 << u32TxBufIdx); - - return u32Success; -} - - -/** - * @brief Global Filter Configuration (GFC). - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] eNMStdFrm Accept/Reject Non-Matching Standard(11-bits) Frames. - * @param[in] eEMExtFrm Accept/Reject Non-Matching Extended(29-bits) Frames. - * @param[in] u32RejRmtStdFrm Reject/Filter Remote Standard Frames. - * @param[in] u32RejRmtExtFrm Reject/Filter Remote Extended Frames. - * - * @return None. - * - * @details Global Filter Configuration. - */ -void CANFD_SetGFC(CANFD_T *psCanfd, E_CANFD_ACC_NON_MATCH_FRM eNMStdFrm, E_CANFD_ACC_NON_MATCH_FRM eEMExtFrm, uint32_t u32RejRmtStdFrm, uint32_t u32RejRmtExtFrm) -{ - psCanfd->GFC &= ~(CANFD_GFC_ANFS_Msk | CANFD_GFC_ANFE_Msk | CANFD_GFC_RRFS_Msk | CANFD_GFC_RRFE_Msk); - psCanfd->GFC = (eNMStdFrm << CANFD_GFC_ANFS_Pos) | - (eEMExtFrm << CANFD_GFC_ANFE_Pos) | - (u32RejRmtStdFrm << CANFD_GFC_RRFS_Pos) | - (u32RejRmtExtFrm << CANFD_GFC_RRFE_Pos); -} - - -/** - * @brief Rx FIFO Configuration for RX_FIFO_0 and RX_FIFO_1. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32RxFifoNum 0: RX FIFO_0, 1: RX_FIFO_1. - * @param[in] psRamConfig Rx FIFO Size in number of configuration ram address. - * @param[in] psElemSize Rx FIFO Size in number of Rx FIFO elements (element number (max. = 64)). - * @param[in] u32FifoWM Watermark in number of Rx FIFO elements - * @param[in] eFifoSize Maximum data field size that should be stored in this Rx FIFO - * (configure BYTE64 if you are unsure, as this is the largest data field allowed in CAN FD) - * - * @return None. - * - * @details Rx FIFO Configuration for RX_FIFO_0 and RX_FIFO_1. - */ -static void CANFD_InitRxFifo(CANFD_T *psCanfd, uint32_t u32RxFifoNum, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWM, E_CANFD_DATA_FIELD_SIZE eFifoSize) -{ - uint32_t u32Address; - uint32_t u32Size; - - /* ignore if index is too high */ - if (u32RxFifoNum > CANFD_NUM_RX_FIFOS)return; - - /* ignore if index is too high */ - if (psElemSize-> u32RxFifo0 > CANFD_MAX_RX_FIFO0_ELEMS) return; - - /* ignore if index is too high */ - if (psElemSize-> u32RxFifo1 > CANFD_MAX_RX_FIFO1_ELEMS) return; - - switch (u32RxFifoNum) - { - case 0: - if (psElemSize-> u32RxFifo0) - { - /* set size of Rx FIFO 0, set offset, blocking mode */ - psCanfd->RXF0C = (psRamConfig->u32RXF0C_F0SA) | (psElemSize->u32RxFifo0 << CANFD_RXF0C_F0S_Pos) - | (u32FifoWM << CANFD_RXF0C_F0WM_Pos); - psCanfd->RXESC = (psCanfd->RXESC & (~CANFD_RXESC_F0DS_Msk)) | (eFifoSize << CANFD_RXESC_F0DS_Pos); - - /*Get the RX FIFO 0 Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32RXF0C_F0SA & CANFD_RXF0C_F0SA_Msk); - u32Size = eFifoSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the RX FIFO 0 Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32RxFifo0)); - } - else - { - psCanfd->RXF0C = 0; - } - - break; - - case 1: - if (psElemSize-> u32RxFifo1) - { - /* set size of Rx FIFO 1, set offset, blocking mode */ - psCanfd->RXF1C = (psRamConfig->u32RXF1C_F1SA) | (psElemSize->u32RxFifo1 << CANFD_RXF1C_F1S_Pos) - | (u32FifoWM << CANFD_RXF1C_F1WM_Pos); - psCanfd->RXESC = (psCanfd->RXESC & (~CANFD_RXESC_F1DS_Msk)) | (eFifoSize << CANFD_RXESC_F1DS_Pos); - - /*Get the RX FIFO 1 Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32RXF1C_F1SA & CANFD_RXF1C_F1SA_Msk); - - u32Size = eFifoSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the RX FIFO 0 Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32RxFifo1)); - } - else - { - psCanfd->RXF1C = 0; - } - - break; - } -} - - -/** - * @brief Function configures the data structures used by a dedicated Rx Buffer. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Tx buffer configuration ram address. - * @param[in] psElemSize Tx buffer configuration element size. - * @param[in] eTxBufSize Maximum data field size that should be stored in a dedicated Tx Buffer - * (configure BYTE64 if you are unsure, as this is the largest data field allowed in CAN FD)largest data field allowed in CAN FD) - * - * @return None. - * - * @details Function configures the data structures used by a dedicated Rx Buffer. - */ -static void CANFD_InitTxDBuf(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eTxBufSize) -{ - uint32_t u32Address; - uint32_t u32Size; - - /*Setting the Tx Buffer Start Address*/ - psCanfd->TXBC = ((psElemSize->u32TxBuf & 0x3F) << CANFD_TXBC_NDTB_Pos) | (psRamConfig->u32TXBC_TBSA & CANFD_TXBC_TBSA_Msk); - - /*Get the TX Buffer Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32TXBC_TBSA & CANFD_TXBC_TBSA_Msk); - - /*Setting the Tx Buffer Data Field Size*/ - psCanfd->TXESC = (psCanfd->TXESC & (~CANFD_TXESC_TBDS_Msk)) | (eTxBufSize << CANFD_TXESC_TBDS_Pos); - - /*Get the Buffer Data Field Size*/ - u32Size = eTxBufSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the TX Buffer Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32TxBuf)); -} - - -/** - * @brief Function configures the data structures used by a dedicated Rx Buffer. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Rx buffer configuration ram address. - * @param[in] psElemSize Rx buffer configuration element size. - * @param[in] eRxBufSize Maximum data field size that should be stored in a dedicated Rx Buffer - * (configure BYTE64 if you are unsure, as this is the largest data field allowed in CAN FD)largest data field allowed in CAN FD) - * - * @return None. - * - * @details Function configures the data structures used by a dedicated Rx Buffer. - */ -static void CANFD_InitRxDBuf(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, E_CANFD_DATA_FIELD_SIZE eRxBufSize) -{ - uint32_t u32Address; - uint32_t u32Size; - - /*Setting the Rx Buffer Start Address*/ - psCanfd->RXBC = (psRamConfig->u32RXBC_RBSA & CANFD_RXBC_RBSA_Msk); - - /*Get the RX Buffer Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32RXBC_RBSA & CANFD_RXBC_RBSA_Msk); - - /*Setting the Rx Buffer Data Field Size*/ - psCanfd->RXESC = (psCanfd->RXESC & (~CANFD_RXESC_RBDS_Msk)) | (eRxBufSize << CANFD_RXESC_RBDS_Pos); - /*Get the Buffer Data Field Size*/ - u32Size = eRxBufSize; - - if (u32Size < 5U) - { - u32Size += 4U; - } - else - { - u32Size = u32Size * 4U - 10U; - } - - /*Clear the RX Buffer Memory*/ - memset((uint32_t *)(u32Address), 0x00, (u32Size * 4 * psElemSize->u32RxBuf)); -} - - -/** - * @brief Configures the register SIDFC for the 11-bit Standard Message ID Filter elements. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Standard ID filter configuration ram address - * @param[in] psElemSize Standard ID filter configuration element size - * - * @return None. - * - * @details Function configures the data structures used by a dedicated Rx Buffer. - */ -static void CANFD_ConfigSIDFC(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize) -{ - uint32_t u32Address; - - /*Setting the Filter List Standard Start Address and List Size */ - psCanfd->SIDFC = ((psElemSize->u32SIDFC & 0xFF) << CANFD_SIDFC_LSS_Pos) | (psRamConfig->u32SIDFC_FLSSA & CANFD_SIDFC_FLSSA_Msk); - - /*Get the Filter List Standard Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32SIDFC_FLSSA & CANFD_SIDFC_FLSSA_Msk); - - /*Clear the Filter List Memory*/ - memset((uint32_t *)(u32Address), 0x00, (psElemSize->u32SIDFC * sizeof(CANFD_STD_FILTER_T))); -} - - -/** - * @brief Configures the register XIDFC for the 29-bit Extended Message ID Filter elements. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Extended ID filter configuration ram address - * @param[in] psElemSize Extended ID filter configuration element size - * - * @return None. - * - * @details Configures the register XIDFC for the 29-bit Extended Message ID Filter elements. - */ -static void CANFD_ConfigXIDFC(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize) -{ - uint32_t u32Address; - - /*Setting the Filter List Extended Start Address and List Size */ - psCanfd->XIDFC = ((psElemSize->u32XIDFC & 0xFF) << CANFD_XIDFC_LSE_Pos) | (psRamConfig->u32XIDFC_FLESA & CANFD_XIDFC_FLESA_Msk); - - /*Get the Filter List Standard Start Address in the RAM*/ - u32Address = CANFD_SRAM_BASE_ADDR(psCanfd) + (psRamConfig->u32XIDFC_FLESA & CANFD_XIDFC_FLESA_Msk); - - /*Clear the Filter List Memory*/ - memset((uint32_t *)(u32Address), 0x00, (psElemSize->u32XIDFC * sizeof(CANFD_EXT_FILTER_T))); -} - - -/** - * @brief Writes a 11-bit Standard ID filter element in the Message RAM. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32FltrIdx Index at which the filter element should be written in the '11-bit Filter' section of Message RAM - * @param[in] u32Filter Rx Individual filter value. - * - * @return None. - * - * @details Writes a 11-bit Standard ID filter element in the Message RAM. - */ -void CANFD_SetSIDFltr(CANFD_T *psCanfd, uint32_t u32FltrIdx, uint32_t u32Filter) -{ - CANFD_STD_FILTER_T *psFilter; - - /* ignore if index is too high */ - if (u32FltrIdx >= CANFD_MAX_11_BIT_FTR_ELEMS) return; - - /*Get the Filter List Configuration Address in the RAM*/ - psFilter = (CANFD_STD_FILTER_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (psCanfd->SIDFC & CANFD_SIDFC_FLSSA_Msk) + (u32FltrIdx * sizeof(CANFD_STD_FILTER_T))); - - /*Wirted the Standard ID filter element to RAM */ - psFilter->VALUE = u32Filter; -} - - -/** - * @brief Writes a 29-bit extended id filter element in the Message RAM. - * Size of an Extended Id filter element is 2 words. So 2 words are written into the Message RAM for each filter element - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32FltrIdx Index at which the filter element should be written in the '29-bit Filter' section of Message RAM. - * @param[in] u32FilterLow Rx Individual filter low value. - * @param[in] u32FilterHigh Rx Individual filter high value. - * - * @return None. - * - * @details Writes a 29-bit extended id filter element in the Message RAM. - */ -void CANFD_SetXIDFltr(CANFD_T *psCanfd, uint32_t u32FltrIdx, uint32_t u32FilterLow, uint32_t u32FilterHigh) -{ - CANFD_EXT_FILTER_T *psFilter; - - /* ignore if index is too high */ - if (u32FltrIdx >= CANFD_MAX_29_BIT_FTR_ELEMS) return; - - /*Get the Filter List Configuration Address on RAM*/ - psFilter = (CANFD_EXT_FILTER_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (psCanfd->XIDFC & CANFD_XIDFC_FLESA_Msk) + (u32FltrIdx * sizeof(CANFD_EXT_FILTER_T))); - - /*Wirted the Extended ID filter element to RAM */ - psFilter->LOWVALUE = u32FilterLow; - psFilter->HIGHVALUE = u32FilterHigh; -} - - -/** - * @brief Reads a CAN FD Message from Receive Message Buffer. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u8MbIdx The CANFD Message Buffer index. - * @param[in] psMsgBuf Pointer to CAN FD message frame structure for reception. - * - * @return 1:Rx Message Buffer is full and has been read successfully. - * 0:Rx Message Buffer is empty. - * - * @details This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with just received data - * and activates the Message Buffer again.The function returns immediately. -*/ -uint32_t CANFD_ReadRxBufMsg(CANFD_T *psCanfd, uint8_t u8MbIdx, CANFD_FD_MSG_T *psMsgBuf) -{ - CANFD_BUF_T *psRxBuffer; - uint32_t u32Success = 0; - uint32_t newData = 0; - - if (u8MbIdx < CANFD_MAX_RX_BUF_ELEMS) - { - if (u8MbIdx < 32) - newData = (CANFD_ReadReg(&psCanfd->NDAT1) >> u8MbIdx) & 1; - else - newData = (CANFD_ReadReg(&psCanfd->NDAT2) >> (u8MbIdx - 32)) & 1; - - /* new message is waiting to be read */ - if (newData) - { - /* get memory location of rx buffer */ - psRxBuffer = (CANFD_BUF_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (CANFD_ReadReg(&psCanfd->RXBC) & 0xFFFF) + (u8MbIdx * sizeof(CANFD_BUF_T))); - - /* read the message */ - CANFD_CopyDBufToMsgBuf(psRxBuffer, psMsgBuf); - - /* clear 'new data' flag */ - if (u8MbIdx < 32) - psCanfd->NDAT1 = CANFD_ReadReg(&psCanfd->NDAT1) | (1UL << u8MbIdx); - else - psCanfd->NDAT2 = CANFD_ReadReg(&psCanfd->NDAT2) | (1UL << (u8MbIdx - 32)); - - u32Success = 1; - } - } - - return u32Success; -} - - -/** - * @brief Reads a CAN FD Message from Rx FIFO. - * - * @param[in] psCanfd The pointer of the specified CANFD module. - * @param[in] u8FifoIdx Number of the FIFO, 0 or 1. - * @param[in] psMsgBuf Pointer to CANFD message frame structure for reception. - * - * @return 1 Read Message from Rx FIFO successfully. - * 2 Rx FIFO is already overflowed and has been read successfully - * 0 Rx FIFO is not enabled. - * - * @details This function reads a CAN message from the CANFD build-in Rx FIFO. - */ -uint32_t CANFD_ReadRxFifoMsg(CANFD_T *psCanfd, uint8_t u8FifoIdx, CANFD_FD_MSG_T *psMsgBuf) -{ - CANFD_BUF_T *pRxBuffer; - uint8_t GetIndex; - uint32_t u32Success = 0; - __I uint32_t *pRXFS; - __IO uint32_t *pRXFC, *pRXFA; - uint8_t msgLostBit; - - /* check for valid FIFO number */ - if (u8FifoIdx < CANFD_NUM_RX_FIFOS) - { - if (u8FifoIdx == 0) - { - pRXFS = &(psCanfd->RXF0S); - pRXFC = &(psCanfd->RXF0C); - pRXFA = &(psCanfd->RXF0A); - msgLostBit = 3; - } - else - { - pRXFS = &(psCanfd->RXF1S); - pRXFC = &(psCanfd->RXF1C); - pRXFA = &(psCanfd->RXF1A); - msgLostBit = 7; - } - - /* if FIFO is not empty */ - if ((CANFD_ReadReg(pRXFS) & 0x7F) > 0) - { - GetIndex = (uint8_t)((CANFD_ReadReg(pRXFS) >> 8) & 0x3F); - pRxBuffer = (CANFD_BUF_T *)(CANFD_SRAM_BASE_ADDR(psCanfd) + (CANFD_ReadReg(pRXFC) & 0xFFFF) + (GetIndex * sizeof(CANFD_BUF_T))); - - CANFD_CopyRxFifoToMsgBuf(pRxBuffer, psMsgBuf); - - /* we got the message */ - *pRXFA = GetIndex; - - /* check for overflow */ - if (CANFD_ReadReg(pRXFS) & CANFD_RXFS_RFL) - { - /* clear overflow flag */ - psCanfd->IR = (1UL << msgLostBit); - u32Success = 2; - } - else - { - u32Success = 1; - } - } - } - - return u32Success; -} - - -/** - * @brief Copies a message from a dedicated Rx buffer into a message buffer. - * - * @param[in] psRxBuf Buffer to read from. - * @param[in] psMsgBuf Location to store read message. - * - * @return None. - * - * @details Copies a message from a dedicated Rx buffer into a message buffer. - */ -void CANFD_CopyDBufToMsgBuf(CANFD_BUF_T *psRxBuf, CANFD_FD_MSG_T *psMsgBuf) -{ - uint32_t u32Idx; - - if (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_ESI_Msk) - psMsgBuf->bErrStaInd = TRUE; - else - psMsgBuf->bErrStaInd = FALSE; - - /* if 29-bit ID */ - if (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_XTD_Msk) - { - psMsgBuf->u32Id = (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_ID_Msk); - psMsgBuf->eIdType = eCANFD_XID; - } - /* if 11-bit ID */ - else - { - psMsgBuf->u32Id = (psRxBuf->u32Id >> 18) & 0x7FF; - psMsgBuf->eIdType = eCANFD_SID; - } - - if (psRxBuf->u32Id & RX_BUFFER_AND_FIFO_R0_ELEM_RTR_Msk) - psMsgBuf->eFrmType = eCANFD_REMOTE_FRM; - else - psMsgBuf->eFrmType = eCANFD_DATA_FRM; - - - if (psRxBuf->u32Config & RX_BUFFER_AND_FIFO_R1_ELEM_FDF_Msk) - psMsgBuf->bFDFormat = TRUE; - else - psMsgBuf->bFDFormat = FALSE; - - if (psRxBuf->u32Config & RX_BUFFER_AND_FIFO_R1_ELEM_BSR_Msk) - psMsgBuf->bBitRateSwitch = TRUE; - else - psMsgBuf->bBitRateSwitch = FALSE; - - psMsgBuf->u32DLC = CANFD_DecodeDLC((psRxBuf->u32Config & RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Msk) >> RX_BUFFER_AND_FIFO_R1_ELEM_DLC_Pos); - - for (u32Idx = 0 ; u32Idx < psMsgBuf->u32DLC ; u32Idx++) - { - psMsgBuf->au8Data[u32Idx] = psRxBuf->au8Data[u32Idx]; - } -} - - -/** - * @brief Get Rx FIFO water level. - * - * @param[in] psCanfd The pointer to CANFD module base address. - * @param[in] u32RxFifoNum 0: RX FIFO_0, 1: RX_FIFO_1 - * - * @return Rx FIFO water level. - * - * @details Get Rx FIFO water level. - */ -uint32_t CANFD_GetRxFifoWaterLvl(CANFD_T *psCanfd, uint32_t u32RxFifoNum) -{ - uint32_t u32WaterLevel = 0; - - if (u32RxFifoNum == 0) - u32WaterLevel = ((CANFD_ReadReg(&psCanfd->RXF0C) & CANFD_RXF0C_F0WM_Msk) >> CANFD_RXF0C_F0WM_Pos); - else - u32WaterLevel = ((CANFD_ReadReg(&psCanfd->RXF1C) & CANFD_RXF1C_F1WM_Msk) >> CANFD_RXF1C_F1WM_Pos); - - return u32WaterLevel; -} - - -/** - * @brief Copies messages from FIFO into a message buffert. - * - * @param[in] psRxBuf Buffer to read from. - * @param[in] psMsgBuf Location to store read message. - * - * @return None. - * - * @details Copies messages from FIFO into a message buffert. - */ -void CANFD_CopyRxFifoToMsgBuf(CANFD_BUF_T *psRxBuf, CANFD_FD_MSG_T *psMsgBuf) -{ - /*Copies a message from a dedicated Rx FIFO into a message buffer*/ - CANFD_CopyDBufToMsgBuf(psRxBuf, psMsgBuf); -} - - -/** - * @brief Cancel a Tx buffer transmission request. - * - * @param[in] psCanfd The pointer to CANFD module base address. - * @param[in] u32TxBufIdx Tx buffer index number - * - * @return None. - * - * @details Cancel a Tx buffer transmission request. - */ -void CANFD_TxBufCancelReq(CANFD_T *psCanfd, uint32_t u32TxBufIdx) -{ - psCanfd->TXBCR = CANFD_ReadReg(&psCanfd->TXBCR) | (0x1ul << u32TxBufIdx); -} - - -/** - * @brief Checks if a Tx buffer cancellation request has been finished or not. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxBufIdx Tx buffer index number - * - * @return 0: cancellation finished. - * 1: cancellation fail - * - * @details Checks if a Tx buffer cancellation request has been finished or not. - */ -uint32_t CANFD_IsTxBufCancelFin(CANFD_T *psCanfd, uint32_t u32TxBufIdx) -{ - /* wait for completion */ - return ((CANFD_ReadReg(&psCanfd->TXBCR) & (0x1ul << u32TxBufIdx)) >> u32TxBufIdx); -} - - -/** - * @brief Checks if a Tx buffer transmission has occurred or not. - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxBufIdx Tx buffer index number - * - * @return 0: No transmission occurred. - * 1: Transmission occurred - * - * @details Checks if a Tx buffer transmission has occurred or not. - */ -uint32_t CANFD_IsTxBufTransmitOccur(CANFD_T *psCanfd, uint32_t u32TxBufIdx) -{ - return ((CANFD_ReadReg(&psCanfd->TXBTO) & (0x1ul << u32TxBufIdx)) >> u32TxBufIdx); -} - - -/** - * @brief Init Tx event fifo - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] psRamConfig Tx Event Fifo configuration ram address. - * @param[in] psElemSize Tx Event Fifo configuration element size - * @param[in] u32FifoWaterLvl FIFO water level - * - * @return None. - * - * @details Init Tx event fifo. - */ -static void CANFD_InitTxEvntFifo(CANFD_T *psCanfd, CANFD_RAM_PART_T *psRamConfig, CANFD_ELEM_SIZE_T *psElemSize, uint32_t u32FifoWaterLvl) -{ - /* Set TX Event FIFO element size,watermark,start address. */ - psCanfd->TXEFC = (u32FifoWaterLvl << CANFD_TXEFC_EFWN_Pos) | (psElemSize->u32TxEventFifo << CANFD_TXEFC_EFS_Pos) - | (psRamConfig->u32TXEFC_EFSA & CANFD_TXEFC_EFSA_Msk); -} - - -/** - * @brief Get Tx event fifo water level - * - * @param[in] psCanfd The pointer to CANFD module base address. - * - * @return Tx event fifo water level. - * - * @details Get Tx event fifo water level. - */ -uint32_t CANFD_GetTxEvntFifoWaterLvl(CANFD_T *psCanfd) -{ - return ((CANFD_ReadReg(&psCanfd->TXEFC) & CANFD_TXEFC_EFWN_Msk) >> CANFD_TXEFC_EFWN_Pos); -} - - -/** - * @brief Copy Event Elements from TX Event FIFO to user buffer - * - * @param[in] psCanfd The pointer to CAN FD module base address. - * @param[in] u32TxEvntNum Tx Event FIFO number - * @param[in] psTxEvntElem Tx Event Message struct - * - * @return None. - * - * @details Copy all Event Elements from TX Event FIFO to the Software Event List . - */ -void CANFD_CopyTxEvntFifoToUsrBuf(CANFD_T *psCanfd, uint32_t u32TxEvntNum, CANFD_TX_EVNT_ELEM_T *psTxEvntElem) -{ - uint32_t *pu32TxEvnt; - /*Get the Tx Event FIFO Address*/ - pu32TxEvnt = (uint32_t *)CANFD_GetTxBufferElementAddress(psCanfd, u32TxEvntNum); - - /*Get the Error State Indicator*/ - if ((pu32TxEvnt[0] & TX_FIFO_E0_EVENT_ESI_Msk) > 0) - psTxEvntElem->bErrStaInd = TRUE; //Transmitting node is error passive - else - psTxEvntElem->bErrStaInd = FALSE;//Transmitting node is error active - - /*Get the Tx FIFO Identifier type and Identifier*/ - - if ((pu32TxEvnt[0] & TX_FIFO_E0_EVENT_XTD_Msk) > 0) - { - psTxEvntElem-> eIdType = eCANFD_XID; - psTxEvntElem->u32Id = (pu32TxEvnt[0] & TX_FIFO_E0_EVENT_ID_Msk);// Extended ID - } - else - { - psTxEvntElem-> eIdType = eCANFD_SID; - psTxEvntElem->u32Id = (pu32TxEvnt[0] & TX_FIFO_E0_EVENT_ID_Msk) >> 18;// Standard ID - } - - /*Get the Frame type*/ - if ((pu32TxEvnt[0] & TX_FIFO_E0_EVENT_RTR_Msk) > 0) - psTxEvntElem->bRemote = TRUE; //Remote frame - else - psTxEvntElem->bRemote = FALSE; //Data frame - - /*Get the FD Format type*/ - if ((pu32TxEvnt[0] & TX_FIFO_E1_EVENT_FDF_Msk) > 0) - psTxEvntElem->bFDFormat = TRUE; //CAN FD frame format - else - psTxEvntElem->bFDFormat = FALSE; //Classical CAN frame format - - /*Get the Bit Rate Switch type*/ - if ((pu32TxEvnt[0] & TX_FIFO_E1_EVENT_BRS_Msk) > 0) - psTxEvntElem->bBitRateSwitch = TRUE; //Frame transmitted with bit rate switching - else - psTxEvntElem->bBitRateSwitch = FALSE; //Frame transmitted without bit rate switching - - /*Get the Tx FIFO Data Length */ - psTxEvntElem->u32DLC = CANFD_DecodeDLC((uint8_t)((pu32TxEvnt[1] & TX_FIFO_E1_EVENT_DLC_Msk) >> TX_FIFO_E1_EVENT_DLC_Pos)); - - /*Get the Tx FIFO Timestamp */ - psTxEvntElem->u32TxTs = (((pu32TxEvnt[1] & TX_FIFO_E1A_EVENT_TXTS_Msk) >> TX_FIFO_E1A_EVENT_TXTS_Pos)); - /*Get the Tx FIFO Message marker */ - psTxEvntElem->u32MsgMarker = (((pu32TxEvnt[1] & TX_FIFO_E1_EVENT_MM_Msk) >> TX_FIFO_E1_EVENT_MM_Pos)); -} - - -/** - * @brief Get CAN FD interrupts status. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u32IntTypeFlag Interrupt Type Flag, should be - * - \ref CANFD_IR_ARA_Msk : Access to Reserved Address interrupt Indicator - * - \ref CANFD_IR_PED_Msk : Protocol Error in Data Phase interrupt Indicator - * - \ref CANFD_IR_PEA_Msk : Protocol Error in Arbitration Phase interrupt Indicator - * - \ref CANFD_IR_WDI_Msk : Watchdog interrupt Indicator - * - \ref CANFD_IR_BO_Msk : Bus_Off Status interrupt Indicator - * - \ref CANFD_IR_EW_Msk : Warning Status interrupt Indicator - * - \ref CANFD_IR_EP_Msk : Error Passive interrupt Indicator - * - \ref CANFD_IR_ELO_Msk : Error Logging Overflow interrupt Indicator - * - \ref CANFD_IR_DRX_Msk : Message stored to Dedicated Rx Buffer interrupt Indicator - * - \ref CANFD_IR_TOO_Msk : Timeout Occurred interrupt Indicator - * - \ref CANFD_IR_MRAF_Msk : Message RAM Access Failure interrupt Indicator - * - \ref CANFD_IR_TSW_Msk : Timestamp Wraparound interrupt Indicator - * - \ref CANFD_IR_TEFL_Msk : Tx Event FIFO Event Lost interrupt Indicator - * - \ref CANFD_IR_TEFF_Msk : Tx Event FIFO Full Indicator - * - \ref CANFD_IR_TEFW_Msk : Tx Event FIFO Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_TEFN_Msk : Tx Event FIFO New Entry Interrupt Indicator - * - \ref CANFD_IR_TFE_Msk : Tx FIFO Empty Interrupt Indicator - * - \ref CANFD_IR_TCF_Msk : Transmission Cancellation Finished Interrupt Indicator - * - \ref CANFD_IR_TC_Msk : Transmission Completed interrupt Indicator - * - \ref CANFD_IR_HPM_Msk : High Priority Message Interrupt Indicator - * - \ref CANFD_IR_RF1L_Msk : Rx FIFO 1 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF1F_Msk : Rx FIFO 1 Full Interrupt Indicator - * - \ref CANFD_IR_RF1W_Msk : Rx FIFO 1 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF1N_Msk : Rx FIFO 1 New Message Interrupt Indicator - * - \ref CANFD_IR_RF0L_Msk : Rx FIFO 0 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF0F_Msk : Rx FIFO 0 Full Interrupt Indicator - * - \ref CANFD_IR_RF0W_Msk : Rx FIFO 0 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF0N_Msk : Rx FIFO 0 New Message Interrupt Indicator - * - * @return None. - * - * @details This function gets all CAN FD interrupt status flags. - */ -uint32_t CANFD_GetStatusFlag(CANFD_T *psCanfd, uint32_t u32IntTypeFlag) -{ - return (CANFD_ReadReg(&psCanfd->IR) & u32IntTypeFlag); -} - - -/** - * @brief Clears the CAN FD module interrupt flags - * - * @param[in] psCanfd The pointer of the specified CANFD module. - * @param[in] u32InterruptFlag The specified interrupt of CAN FD module - * - \ref CANFD_IR_ARA_Msk : Access to Reserved Address interrupt Indicator - * - \ref CANFD_IR_PED_Msk : Protocol Error in Data Phase interrupt Indicator - * - \ref CANFD_IR_PEA_Msk : Protocol Error in Arbitration Phase interrupt Indicator - * - \ref CANFD_IR_WDI_Msk : Watchdog interrupt Indicator - * - \ref CANFD_IR_BO_Msk : Bus_Off Status interrupt Indicator - * - \ref CANFD_IR_EW_Msk : Warning Status interrupt Indicator - * - \ref CANFD_IR_EP_Msk : Error Passive interrupt Indicator - * - \ref CANFD_IR_ELO_Msk : Error Logging Overflow interrupt Indicator - * - \ref CANFD_IR_DRX_Msk : Message stored to Dedicated Rx Buffer interrupt Indicator - * - \ref CANFD_IR_TOO_Msk : Timeout Occurred interrupt Indicator - * - \ref CANFD_IR_MRAF_Msk : Message RAM Access Failure interrupt Indicator - * - \ref CANFD_IR_TSW_Msk : Timestamp Wraparound interrupt Indicator - * - \ref CANFD_IR_TEFL_Msk : Tx Event FIFO Event Lost interrupt Indicator - * - \ref CANFD_IR_TEFF_Msk : Tx Event FIFO Full Indicator - * - \ref CANFD_IR_TEFW_Msk : Tx Event FIFO Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_TEFN_Msk : Tx Event FIFO New Entry Interrupt Indicator - * - \ref CANFD_IR_TFE_Msk : Tx FIFO Empty Interrupt Indicator - * - \ref CANFD_IR_TCF_Msk : Transmission Cancellation Finished Interrupt Indicator - * - \ref CANFD_IR_TC_Msk : Transmission Completed interrupt Indicator - * - \ref CANFD_IR_HPM_Msk : High Priority Message Interrupt Indicator - * - \ref CANFD_IR_RF1L_Msk : Rx FIFO 1 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF1F_Msk : Rx FIFO 1 Full Interrupt Indicator - * - \ref CANFD_IR_RF1W_Msk : Rx FIFO 1 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF1N_Msk : Rx FIFO 1 New Message Interrupt Indicator - * - \ref CANFD_IR_RF0L_Msk : Rx FIFO 0 Message Lost Interrupt Indicator - * - \ref CANFD_IR_RF0F_Msk : Rx FIFO 0 Full Interrupt Indicator - * - \ref CANFD_IR_RF0W_Msk : Rx FIFO 0 Watermark Reached Interrupt Indicator - * - \ref CANFD_IR_RF0N_Msk : Rx FIFO 0 New Message Interrupt Indicator - * - * @return None. - * - * @details This function clears CAN FD interrupt status flags. - */ -void CANFD_ClearStatusFlag(CANFD_T *psCanfd, uint32_t u32InterruptFlag) -{ - /* Write 1 to clear status flag. */ - psCanfd->IR = CANFD_ReadReg(&psCanfd->IR) | u32InterruptFlag; -} - - -/** - * @brief Gets the CAN FD Bus Error Counter value. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] pu8TxErrBuf TxErrBuf Buffer to store Tx Error Counter value. - * @param[in] pu8RxErrBuf RxErrBuf Buffer to store Rx Error Counter value. - * - * @return None. - * - * @details This function gets the CAN FD Bus Error Counter value for both Tx and Rx direction. - * These values may be needed in the upper layer error handling. - */ -void CANFD_GetBusErrCount(CANFD_T *psCanfd, uint8_t *pu8TxErrBuf, uint8_t *pu8RxErrBuf) -{ - if (pu8TxErrBuf) - { - *pu8TxErrBuf = (uint8_t)((CANFD_ReadReg(&psCanfd->ECR) >> CANFD_ECR_TEC_Pos) & CANFD_ECR_TEC_Msk); - } - - if (pu8RxErrBuf) - { - *pu8RxErrBuf = (uint8_t)((CANFD_ReadReg(&psCanfd->ECR) >> CANFD_ECR_REC_Pos) & CANFD_ECR_REC_Msk); - } -} - - -/** - * @brief CAN FD Run to the Normal Operation. - * - * @param[in] psCanfd The pointer of the specified CAN FD module. - * @param[in] u8Enable TxErrBuf Buffer to store Tx Error Counter value. - * - * @retval CANFD_OK CANFD operation OK. - * @retval CANFD_ERR_TIMEOUT CANFD operation abort due to timeout error. - * - * @details This function gets the CAN FD Bus Error Counter value for both Tx and Rx direction. - * These values may be needed in the upper layer error handling. - */ -int32_t CANFD_RunToNormal(CANFD_T *psCanfd, uint8_t u8Enable) -{ - uint32_t u32TimeOutCnt = CANFD_TIMEOUT; - - if (u8Enable) - { - /* start operation */ - psCanfd->CCCR = CANFD_ReadReg(&psCanfd->CCCR) & ~(CANFD_CCCR_CCE_Msk | CANFD_CCCR_INIT_Msk); - - while (psCanfd->CCCR & CANFD_CCCR_INIT_Msk) - { - if (--u32TimeOutCnt == 0) return CANFD_ERR_TIMEOUT; - } - } - else - { - /* init mode */ - psCanfd->CCCR = CANFD_ReadReg(&psCanfd->CCCR) | CANFD_CCCR_INIT_Msk | CANFD_CCCR_CCE_Msk; - - while (!(psCanfd->CCCR & CANFD_CCCR_INIT_Msk)) - { - if (--u32TimeOutCnt == 0) return CANFD_ERR_TIMEOUT; - } - } - - return CANFD_OK; -} - - - -/*@}*/ /* end of group CANFD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CANFD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ccap.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ccap.c deleted file mode 100644 index a192b7e77ac..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ccap.c +++ /dev/null @@ -1,406 +0,0 @@ -/**************************************************************************//** - * @file ccap.c - * @version V3.00 - * @brief M460 Series CCAP Driver Source File - * - * @copyright SPDX-License-Identifier: Apache-2.0 - * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CCAP_Driver CCAP Driver - @{ -*/ - -int32_t g_CCAP_i32ErrCode = 0; /*!< CCAP global error code */ - -/** @addtogroup CCAP_EXPORTED_FUNCTIONS CCAP Exported Functions - @{ -*/ - -/** - * @brief Open and set CCAP function - * - * @param[in] u32InFormat The bits corresponding VSP, HSP, PCLK, INFMT, SNRTYPE, OUTFMT and PDORD configurations. - * - VSP Sensor Vsync Polarity. It should be either \ref CCAP_PAR_VSP_LOW or \ref CCAP_PAR_VSP_HIGH - * - HSP Sensor Hsync Polarity. It should be either \ref CCAP_PAR_HSP_LOW or \ref CCAP_PAR_HSP_HIGH - * - PCLK Sensor Pixel Clock Polarity. It should be either \ref CCAP_PAR_PCLKP_LOW or \ref CCAP_PAR_PCLKP_HIGH - * - INFMT Sensor Input Data Format. It should be either \ref CCAP_PAR_INFMT_YUV422 or \ref CCAP_PAR_INFMT_RGB565 - * - SNRTYPE Sensor Input Type. It should be either \ref CCAP_PAR_SENTYPE_CCIR601 or \ref CCAP_PAR_SENTYPE_CCIR656 - * - PLNFMT Planar Output YUV Format - * - \ref 0 = YUV422 - * - OUTFMT Image Data Format Output to System Memory. It should be one of the following settings - * - \ref CCAP_PAR_OUTFMT_YUV422 - * - \ref CCAP_PAR_OUTFMT_ONLY_Y - * - \ref CCAP_PAR_OUTFMT_RGB555 - * - \ref CCAP_PAR_OUTFMT_RGB565 - * - PDORD Sensor Input Data Order. It should be one of the following settings - * - \ref CCAP_PAR_INDATORD_YUYV - * - \ref CCAP_PAR_INDATORD_YVYU - * - \ref CCAP_PAR_INDATORD_UYVY - * - \ref CCAP_PAR_INDATORD_VYUY - * - \ref CCAP_PAR_INDATORD_RGGB - * - \ref CCAP_PAR_INDATORD_BGGR - * - \ref CCAP_PAR_INDATORD_GBRG - * - \ref CCAP_PAR_INDATORD_GRBG - * @param[in] u32OutFormat Image Data Output Format. It should be - * - \ref CCAP_CTL_PKTEN - * - * @return None - * - * @details Initialize the Camera Capture Interface. - */ -void CCAP_Open(CCAP_T *ccap, uint32_t u32InFormat, uint32_t u32OutFormat) -{ - ccap->PAR = (ccap->PAR & ~(0x000007BFUL)) | u32InFormat; - ccap->CTL = (ccap->CTL & ~(0x00000060UL)) | u32OutFormat; -} - -/** - * @brief Set Cropping Window Starting Address and Size - * - * @param[in] u32VStart: Cropping Window Vertical Starting Address. It should be 0 ~ 0x7FF. - * @param[in] u32HStart: Cropping Window Horizontal Starting Address. It should be 0 ~ 0x7FF. - * @param[in] u32Height: Cropping Window Height. It should be 0 ~ 0x7FF. - * @param[in] u32Width: Cropping Window Width. It should be 0 ~ 0x7FF. - * - * @return None - * - * @details This function is used to set cropping window starting address and size. - */ -void CCAP_SetCroppingWindow(CCAP_T *ccap, uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width) -{ - ccap->CWSP = (ccap->CWSP & ~(CCAP_CWSP_CWSADDRV_Msk | CCAP_CWSP_CWSADDRH_Msk)) - | (((u32VStart << 16) | u32HStart)); - - ccap->CWS = (ccap->CWS & ~(CCAP_CWS_CWH_Msk | CCAP_CWS_CWW_Msk)) - | ((u32Height << 16) | u32Width); -} - -/** - * @brief Set System Memory Packet Base Address - * - * @param[in] u32Address: Set CCAP_PKTBA0 register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Packet Base Address 0 Register. - */ -void CCAP_SetPacketBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->PKTBA0 = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Set System Memory Planar Y Base Address - * - * @param[in] u32Address: Set CCAP_YBA register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Planar Y Base Address 0 Register. - */ -void CCAP_SetPlanarYBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->YBA = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Set System Memory Planar U Base Address - * - * @param[in] u32Address: Set CCAP_UBA register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Planar U Base Address 0 Register. - */ -void CCAP_SetPlanarUBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->UBA = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Set System Memory Planar V Base Address - * - * @param[in] u32Address: Set CCAP_VBA register. It should be 0x0 ~ 0xFFFFFFFF. - * - * @return None - * - * @details This function is used to set System Memory Planar V Base Address 0 Register. - */ -void CCAP_SetPlanarVBuf(CCAP_T *ccap, uint32_t u32Address) -{ - ccap->VBA = u32Address; - ccap->CTL |= CCAP_CTL_UPDATE_Msk; -} - -/** - * @brief Close Camera Capture Interface - * - * @param None - * - * @return None - * - * @details This function is used to disable Camera Capture Interface. - */ -void CCAP_Close(CCAP_T *ccap) -{ - ccap->CTL &= ~CCAP_CTL_CCAPEN; -} - -/** - * @brief Enable CCAP Interrupt - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CCAP_INT_VIEN_Msk - * - \ref CCAP_INT_MEIEN_Msk - * - \ref CCAP_INT_ADDRMIEN_Msk - * - * @return None - * - * @details This function is used to enable Video Frame End Interrupt, - * Bus Master Transfer Error Interrupt and Memory Address Match Interrupt. - */ -void CCAP_EnableInt(CCAP_T *ccap, uint32_t u32IntMask) -{ - ccap->INT = (ccap->INT & ~(CCAP_INT_VIEN_Msk | CCAP_INT_MEIEN_Msk | CCAP_INT_ADDRMIEN_Msk)) - | u32IntMask; -} - -/** - * @brief Disable CCAP Interrupt - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CCAP_INT_VINTF_Msk - * - \ref CCAP_INT_MEINTF_Msk - * - \ref CCAP_INT_ADDRMINTF_Msk - * - * @return None - * - * @details This function is used to disable Video Frame End Interrupt, - * Bus Master Transfer Error Interrupt and Memory Address Match Interrupt. - */ -void CCAP_DisableInt(CCAP_T *ccap, uint32_t u32IntMask) -{ - ccap->INT = (ccap->INT & ~(u32IntMask)); -} - -/** - * @brief Enable Monochrome CMOS Sensor - * - * @param[in] u32Interface Data I/O interface setting. It could be - * - \ref CCAP_CTL_MY8_MY4 - * - \ref CCAP_CTL_MY8_MY8 - * @return None - * - * @details This function is used to select monochrome CMOS sensor and set data width. - */ -void CCAP_EnableMono(CCAP_T *ccap, uint32_t u32Interface) -{ - ccap->CTL = (ccap->CTL & ~CCAP_CTL_MY8_MY4) | CCAP_CTL_MONO_Msk | u32Interface; -} - -/** - * @brief Disable Monochrome CMOS Sensor - * - * @param None - * - * @return None - * - * @details This function is used to disable monochrome CMOS sensor selection. - */ -void CCAP_DisableMono(CCAP_T *ccap) -{ - ccap->CTL &= ~CCAP_CTL_MONO_Msk; -} - -/** - * @brief Enable Luminance 8-bit Y to 1-bit Y Conversion - * - * @param[in] u32th Luminance Y8 to Y1 Threshold Value. It should be 0 ~ 255. - * - * @return None - * - * @details This function is used to enable luminance Y8 to Y1 function and set its threshold value. - */ -void CCAP_EnableLumaYOne(CCAP_T *ccap, uint32_t u32th) -{ - ccap->CTL |= CCAP_CTL_Luma_Y_One_Msk; - ccap->LUMA_Y1_THD = u32th & 0xff; -} - -/** - * @brief Disable Luminance 8-bit Y to 1-bit Y Conversion - * - * @param None - * - * @return None - * - * @details This function is used to disable luminance Y8 to Y1 function. - * - */ -void CCAP_DisableLumaYOne(CCAP_T *ccap) -{ - ccap->CTL &= ~CCAP_CTL_Luma_Y_One_Msk; -} - -/** - * @brief Start Camera Capture Interface - * - * @param None - * - * @return None - * - * @details This function is used to start Camera Capture Interface function. - */ -void CCAP_Start(CCAP_T *ccap) -{ - ccap->CTL |= CCAP_CTL_CCAPEN; -} - -/** - * @brief Stop Camera Capture Interface - * - * @param[in] u32FrameComplete: - * - \ref TRUE: Capture module disables the CCAP module automatically after a frame had been captured. - * - \ref FALSE: Stop Capture module now. - * - * @return None - * - * @details If u32FrameComplete is set to TRUE then get a new frame and disable CCAP module. - * - * @note This function sets g_CCAP_i32ErrCode to CCAP_TIMEOUT_ERR if the CCAP_IS_STOPPED() longer than expected. - */ -void CCAP_Stop(CCAP_T *ccap, uint32_t u32FrameComplete) -{ - uint32_t u32TimeOutCount = 94539453; - - if (u32FrameComplete == FALSE) - ccap->CTL &= ~CCAP_CTL_CCAPEN; - else - { - ccap->CTL |= CCAP_CTL_SHUTTER_Msk; - while (!CCAP_IS_STOPPED(ccap)) - { - if (--u32TimeOutCount == 0) - { - g_CCAP_i32ErrCode = CCAP_TIMEOUT_ERR; - break; - } - } - } -} - -/** - * @brief Set Packet Scaling Factor - * - * @param[in] u32VNumerator: Packet Scaling Vertical Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32VDenominator: Packet Scaling Vertical Factor M. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HNumerator: Packet Scaling Horizontal Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HDenominator: Packet Scaling Horizontal Factor M. It should be 0x0 ~ 0xFFFF. - * - * @return None - * - * @details This function is used to set Packet Scaling Vertical and Horizontal Factor register. - */ -void CCAP_SetPacketScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator) -{ - uint32_t u32NumeratorL, u32NumeratorH; - uint32_t u32DenominatorL, u32DenominatorH; - - u32NumeratorL = u32VNumerator & 0xFF; - u32NumeratorH = u32VNumerator >> 8; - u32DenominatorL = u32VDenominator & 0xFF; - u32DenominatorH = u32VDenominator >> 8; - ccap->PKTSL = (ccap->PKTSL & ~(CCAP_PKTSL_PKTSVNL_Msk | CCAP_PKTSL_PKTSVML_Msk)) - | ((u32NumeratorL << CCAP_PKTSL_PKTSVNL_Pos) | (u32DenominatorL << CCAP_PKTSL_PKTSVML_Pos)); - ccap->PKTSM = (ccap->PKTSM & ~(CCAP_PKTSM_PKTSVNH_Msk | CCAP_PKTSM_PKTSVMH_Msk)) - | ((u32NumeratorH << CCAP_PKTSL_PKTSVNL_Pos) | (u32DenominatorH << CCAP_PKTSL_PKTSVML_Pos)); - - u32NumeratorL = u32HNumerator & 0xFF; - u32NumeratorH = u32HNumerator >> 8; - u32DenominatorL = u32HDenominator & 0xFF; - u32DenominatorH = u32HDenominator >> 8; - ccap->PKTSL = (ccap->PKTSL & ~(CCAP_PKTSL_PKTSHNL_Msk | CCAP_PKTSL_PKTSHML_Msk)) - | ((u32NumeratorL << CCAP_PKTSL_PKTSHNL_Pos) | (u32DenominatorL << CCAP_PKTSL_PKTSHML_Pos)); - ccap->PKTSM = (ccap->PKTSM & ~(CCAP_PKTSM_PKTSHNH_Msk | CCAP_PKTSM_PKTSHMH_Msk)) - | ((u32NumeratorH << CCAP_PKTSL_PKTSHNL_Pos) | (u32DenominatorH << CCAP_PKTSL_PKTSHML_Pos)); -} - -/** - * @brief Set Planar Scaling Factor - * - * @param[in] u32VNumerator: Planar Scaling Vertical Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32VDenominator: Planar Scaling Vertical Factor M. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HNumerator: Planar Scaling Horizontal Factor N. It should be 0x0 ~ 0xFFFF. - * @param[in] u32HDenominator: Planar Scaling Horizontal Factor M. It should be 0x0 ~ 0xFFFF. - * - * @return None - * - * @details This function is used to set Planar Scaling Vertical and Horizontal Factor register. - */ -void CCAP_SetPlanarScaling(CCAP_T *ccap, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator) -{ - uint32_t u32NumeratorL, u32NumeratorH; - uint32_t u32DenominatorL, u32DenominatorH; - - u32NumeratorL = u32VNumerator & 0xFF; - u32NumeratorH = u32VNumerator >> 8; - u32DenominatorL = u32VDenominator & 0xFF; - u32DenominatorH = u32VDenominator >> 8; - ccap->PLNSL = (ccap->PLNSL & ~(CCAP_PLNSL_PLNSVNL_Msk | CCAP_PLNSL_PLNSVML_Msk)) - | ((u32NumeratorL << CCAP_PLNSL_PLNSVNL_Pos) | (u32DenominatorL << CCAP_PLNSL_PLNSVML_Pos)); - ccap->PLNSM = (ccap->PLNSM & ~(CCAP_PLNSM_PLNSVNH_Msk | CCAP_PLNSM_PLNSVMH_Msk)) - | ((u32NumeratorH << CCAP_PLNSL_PLNSVNL_Pos) | (u32DenominatorH << CCAP_PLNSL_PLNSVML_Pos)); - - u32NumeratorL = u32HNumerator & 0xFF; - u32NumeratorH = u32HNumerator >> 8; - u32DenominatorL = u32HDenominator & 0xFF; - u32DenominatorH = u32HDenominator >> 8; - ccap->PLNSL = (ccap->PLNSL & ~(CCAP_PLNSL_PLNSHNL_Msk | CCAP_PLNSL_PLNSHML_Msk)) - | ((u32NumeratorL << CCAP_PLNSL_PLNSHNL_Pos) | (u32DenominatorL << CCAP_PLNSL_PLNSHML_Pos)); - ccap->PLNSM = (ccap->PLNSM & ~(CCAP_PLNSM_PLNSHNH_Msk | CCAP_PLNSM_PLNSHMH_Msk)) - | ((u32NumeratorH << CCAP_PLNSL_PLNSHNL_Pos) | (u32DenominatorH << CCAP_PLNSL_PLNSHML_Pos)); -} - -/** - * @brief Set Packet Frame Output Pixel Stride Width - * - * @param[in] u32Stride: Set CCAP_STRIDE register. It should be 0x0 ~ 0x3FFF. - * - * @return None - * - * @details This function is used to set Packet Frame Output Pixel Stride Width. - */ -void CCAP_SetPacketStride(CCAP_T *ccap, uint32_t u32Stride) -{ - ccap->STRIDE = (ccap->STRIDE & ~CCAP_STRIDE_PKTSTRIDE_Msk) | (u32Stride << CCAP_STRIDE_PKTSTRIDE_Pos); -} - -/** - * @brief Set Planar Frame Output Pixel Stride Width - * - * @param[in] u32Stride: Set CCAP_STRIDE register. It should be 0x0 ~ 0x3FFF. - * - * @return None - * - * @details This function is used to set Planar Frame Output Pixel Stride Width. - */ -void CCAP_SetPlanarStride(CCAP_T *ccap, uint32_t u32Stride) -{ - ccap->STRIDE = (ccap->STRIDE & ~CCAP_STRIDE_PLNSTRIDE_Msk) | (u32Stride << CCAP_STRIDE_PLNSTRIDE_Pos); -} - - -/*@}*/ /* end of group CCAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CCAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_clk.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_clk.c deleted file mode 100644 index b77fb496247..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_clk.c +++ /dev/null @@ -1,1763 +0,0 @@ -/**************************************************************************//** - * @file clk.c - * @brief series CLK driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CLK_Driver CLK Driver - @{ -*/ - -/** @addtogroup CLK_EXPORTED_FUNCTIONS CLK Exported Functions - @{ -*/ -#define SYSPLLFREQCLK FREQ_180MHZ - -/** - * @brief Disable clock divider output function - * @param None - * @return None - * @details This function disable clock divider output function. - */ -void CLK_DisableCKO(void) -{ - /* Disable CKO clock source */ - CLK_DisableModuleClock(CLKO_MODULE); -} - -/** - * @brief This function enable clock divider output module clock, - * enable clock divider output function and set frequency selection. - * @param[in] u32ClkSrc is frequency divider function clock source. Including : - * - \ref CLK_CLKSEL4_CKOSEL_HXT - * - \ref CLK_CLKSEL4_CKOSEL_LXT - * - \ref CLK_CLKSEL4_CKOSEL_LIRC - * - \ref CLK_CLKSEL4_CKOSEL_HIRC - * - \ref CLK_CLKSEL4_CKOSEL_CAPLL - * - \ref CLK_CLKSEL4_CKOSEL_SYSPLL - * - \ref CLK_CLKSEL4_CKOSEL_APLL - * - \ref CLK_CLKSEL4_CKOSEL_EPLL - * - \ref CLK_CLKSEL4_CKOSEL_VPLL - * @param[in] u32ClkDiv is divider output frequency selection. It could be 0~15. - * @param[in] u32ClkDivBy1En is clock divided by one enabled. - * @return None - * @details Output selected clock to CKO. The output clock frequency is divided by u32ClkDiv. \n - * The formula is: \n - * CKO frequency = (Clock source frequency) / 2^(u32ClkDiv + 1) \n - * This function is just used to set CKO clock. - * User must enable I/O for CKO clock output pin by themselves. \n - */ -void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) -{ - /* CKO = clock source / 2^(u32ClkDiv + 1) */ - CLK->CLKOCTL = CLK_CLKOCTL_CLKOEN_Msk | (u32ClkDiv) | (u32ClkDivBy1En << CLK_CLKOCTL_DIV1EN_Pos); - - /* Enable CKO clock source */ - CLK_EnableModuleClock(CLKO_MODULE); - - /* Select CKO clock source */ - CLK_SetModuleClock(CLKO_MODULE, u32ClkSrc, 0UL); -} - -#if defined(USE_MA35D1_SUBM) -/** - * @brief Enter to Power-down mode - * @param None - * @return None - * @details This function is used to let system enter to Power-down mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_PowerDown(void) -{ - /* Set the processor uses deep sleep as its low power mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* Set system Power-down enabled */ - SYS->PMUCR |= (SYS_PMUCR_RTPPDEN_Msk); - - /* Chip enter Power-down mode after CPU run WFI instruction */ - __WFI(); - -} - -/** - * @brief Enter to Idle mode - * @param None - * @return None - * @details This function let system enter to Idle mode. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_Idle(void) -{ - /* Set the processor uses sleep as its low power mode */ - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - - /* Set chip in idle mode because of WFI command */ - SYS->PMUCR &= ~(SYS_PMUCR_RTPPDEN_Msk); - - /* Chip enter idle mode after CPU run WFI instruction */ - __WFI(); -} -#else -void SystemCoreClockUpdate(void) -{ - -} -#endif - -/** - * @brief Get external high speed crystal clock frequency - * @param None - * @return External high frequency crystal frequency - * @details This function get external high frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetHXTFreq(void) -{ - uint32_t u32Freq; - - if ((CLK->PWRCTL & CLK_PWRCTL_HXTEN_Msk) == CLK_PWRCTL_HXTEN_Msk) - { - u32Freq = __HXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - - -/** - * @brief Get external low speed crystal clock frequency - * @param None - * @return External low speed crystal clock frequency - * @details This function get external low frequency crystal frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetLXTFreq(void) -{ - uint32_t u32Freq; - - if ((CLK->PWRCTL & CLK_PWRCTL_LXTEN_Msk) == CLK_PWRCTL_LXTEN_Msk) - { - u32Freq = __LXT; - } - else - { - u32Freq = 0UL; - } - - return u32Freq; -} - -/** - * @brief Get SYSCLK0 frequency - * @param None - * @return SYSCLK0 frequency - * @details This function get SYSCLK0 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetSYSCLK0Freq(void) -{ - uint32_t u32Freq; - - if ((CLK->CLKSEL0 & CLK_CLKSEL0_SYSCK0SEL_Msk) == CLK_CLKSEL0_SYSCK0SEL_EPLL_DIV2) - { - u32Freq = CLK_GetPLLClockFreq(EPLL) / 2; - } - else - { - u32Freq = SYSPLLFREQCLK; - } - - return u32Freq; -} - -/** - * @brief Get SYSCLK1 frequency - * @param None - * @return SYSCLK1 frequency - * @details This function get SYSCLK1 frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetSYSCLK1Freq(void) -{ - uint32_t u32Freq; - - if ((CLK->CLKSEL0 & CLK_CLKSEL0_SYSCK1SEL_Msk) == CLK_CLKSEL0_SYSCK1SEL_HXT) - { - u32Freq = __HXT; - } - else - { - u32Freq = SYSPLLFREQCLK; - } - - return u32Freq; -} - -/** - * @brief Get CPU frequency - * @param None - * @return CPU frequency - * @details This function get CPU frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetCPUFreq(void) -{ - return CLK_GetSYSCLK1Freq(); -} - -/** - * @brief Set HCLK frequency - * @param[in] u32Hclk is HCLK frequency. The range of u32Hclk is running up to 180MHz. - * @return HCLK frequency - * @details This function is used to set HCLK frequency. The frequency unit is Hz. \n - * The register write-protection function should be disabled before using this function. - */ -uint32_t CLK_SetCoreClock(uint32_t u32Hclk) -{ - /* The range of u32Hclk is running up to SYSPLLFREQCLK MHz */ - if (u32Hclk > SYSPLLFREQCLK) - { - u32Hclk = SYSPLLFREQCLK; - } - - /* Return actually HCLK frequency is PLL frequency divide 1 */ - return u32Hclk; -} - -/** - * @brief This function set HCLK clock source and HCLK clock divider - * @param[in] u32ClkSrc is HCLK clock source. Including : - * - \ref CLK_CLKSEL0_HCLKSEL_HXT - * - \ref CLK_CLKSEL0_HCLKSEL_LXT - * - \ref CLK_CLKSEL0_HCLKSEL_PLL - * - \ref CLK_CLKSEL0_HCLKSEL_LIRC - * - \ref CLK_CLKSEL0_HCLKSEL_HIRC - * @param[in] u32ClkDiv is HCLK clock divider. Including : - * - \ref CLK_CLKDIV0_HCLK(x) - * @return None - * @details This function set HCLK clock source and HCLK clock divider. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetHCLK(uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ -} - -/** - * @brief This function set selected module clock source and module clock divider - * @param[in] u32ModuleIdx is module index. - * @param[in] u32ClkSrc is module clock source. - * @param[in] u32ClkDiv is module clock divider. - * @return None - * @details Valid parameter combinations listed in following table: - * - * |Module index |Clock source |Divider | - * | :---------------- | :----------------------------------- | :------------------------ | - * |\ref CA35CK_MODULE |\ref CLK_CLKSEL0_CA35CKSEL_HXT | x | - * |\ref CA35CK_MODULE |\ref CLK_CLKSEL0_CA35CKSEL_CAPLL | x | - * |\ref SYSCK0_MODULE |\ref CLK_CLKSEL0_SYSCK0SEL_SYSPLL | x | - * |\ref SYSCK0_MODULE |\ref CLK_CLKSEL0_SYSCK0SEL_EPLL | x | - * |\ref LVRDB_MODULE |\ref CLK_CLKSEL0_LVRDBSEL_LIRC | x | - * |\ref LVRDB_MODULE |\ref CLK_CLKSEL0_LVRDBSEL_HIRC | x | - * |\ref SYSCK1_MODULE |\ref CLK_CLKSEL0_SYSCK1SEL_HXT | x | - * |\ref SYSCK1_MODULE |\ref CLK_CLKSEL0_SYSCK1SEL_SYSPLL | x | - * |\ref RTPST_MODULE |\ref CLK_CLKSEL0_RTPSTSEL_HXT | x | - * |\ref RTPST_MODULE |\ref CLK_CLKSEL0_RTPSTSEL_LXT | x | - * |\ref RTPST_MODULE |\ref CLK_CLKSEL0_RTPSTSEL_HXT_DIV2 | x | - * |\ref RTPST_MODULE |\ref CLK_CLKSEL0_RTPSTSEL_SYSCLK1_DIV2 | x | - * |\ref RTPST_MODULE |\ref CLK_CLKSEL0_RTPSTSEL_HIRC | x | - * |\ref CCAP0_MODULE |\ref CLK_CLKSEL0_CCAP0SEL_HXT |\ref CLK_CLKDIV1_CCAP0(x) | - * |\ref CCAP0_MODULE |\ref CLK_CLKSEL0_CCAP0SEL_SYSPLL |\ref CLK_CLKDIV1_CCAP0(x) | - * |\ref CCAP0_MODULE |\ref CLK_CLKSEL0_CCAP0SEL_APLL |\ref CLK_CLKDIV1_CCAP0(x) | - * |\ref CCAP0_MODULE |\ref CLK_CLKSEL0_CCAP0SEL_VPLL |\ref CLK_CLKDIV1_CCAP0(x) | - * |\ref CCAP1_MODULE |\ref CLK_CLKSEL0_CCAP1SEL_HXT |\ref CLK_CLKDIV1_CCAP1(x) | - * |\ref CCAP1_MODULE |\ref CLK_CLKSEL0_CCAP1SEL_SYSPLL |\ref CLK_CLKDIV1_CCAP1(x) | - * |\ref CCAP1_MODULE |\ref CLK_CLKSEL0_CCAP1SEL_APLL |\ref CLK_CLKDIV1_CCAP1(x) | - * |\ref CCAP1_MODULE |\ref CLK_CLKSEL0_CCAP1SEL_VPLL |\ref CLK_CLKDIV1_CCAP1(x) | - * |\ref SD0_MODULE |\ref CLK_CLKSEL0_SD0SEL_SYSPLL | x | - * |\ref SD0_MODULE |\ref CLK_CLKSEL0_SD0SEL_APLL | x | - * |\ref SD1_MODULE |\ref CLK_CLKSEL0_SD1SEL_SYSPLL | x | - * |\ref SD1_MODULE |\ref CLK_CLKSEL0_SD1SEL_APLL | x | - * |\ref DCU_MODULE |\ref CLK_CLKSEL0_DCUSEL_SYSPLL | x | - * |\ref DCU_MODULE |\ref CLK_CLKSEL0_DCUSEL_EPLL | x | - * |\ref GFX_MODULE |\ref CLK_CLKSEL0_GFXSEL_SYSPLL | x | - * |\ref GFX_MODULE |\ref CLK_CLKSEL0_GFXSEL_EPLL | x | - * |\ref DBG_MODULE |\ref CLK_CLKSEL0_DBGSEL_HIRC |\ref CLK_CLKDIV3_DBG(x) | - * |\ref DBG_MODULE |\ref CLK_CLKSEL0_DBGSEL_SYSPLL |\ref CLK_CLKDIV3_DBG(x) | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LXT | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_LIRC | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_HIRC | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_PCLK0 | x | - * |\ref TMR0_MODULE |\ref CLK_CLKSEL1_TMR0SEL_EXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LXT | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_LIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_HIRC | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_PCLK0 | x | - * |\ref TMR1_MODULE |\ref CLK_CLKSEL1_TMR1SEL_EXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LXT | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_LIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_HIRC | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_PCLK1 | x | - * |\ref TMR2_MODULE |\ref CLK_CLKSEL1_TMR2SEL_EXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LXT | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_LIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_HIRC | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_PCLK1 | x | - * |\ref TMR3_MODULE |\ref CLK_CLKSEL1_TMR3SEL_EXT | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL1_TMR4SEL_HXT | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL1_TMR4SEL_LXT | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL1_TMR4SEL_LIRC | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL1_TMR4SEL_HIRC | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL1_TMR4SEL_EXT | x | - * |\ref TMR4_MODULE |\ref CLK_CLKSEL1_TMR4SEL_PCLK2 | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL1_TMR5SEL_HXT | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL1_TMR5SEL_LXT | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL1_TMR5SEL_LIRC | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL1_TMR5SEL_HIRC | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL1_TMR5SEL_EXT | x | - * |\ref TMR5_MODULE |\ref CLK_CLKSEL1_TMR5SEL_PCLK2 | x | - * |\ref TMR6_MODULE |\ref CLK_CLKSEL1_TMR6SEL_HXT | x | - * |\ref TMR6_MODULE |\ref CLK_CLKSEL1_TMR6SEL_LXT | x | - * |\ref TMR6_MODULE |\ref CLK_CLKSEL1_TMR6SEL_LIRC | x | - * |\ref TMR6_MODULE |\ref CLK_CLKSEL1_TMR6SEL_HIRC | x | - * |\ref TMR6_MODULE |\ref CLK_CLKSEL1_TMR6SEL_PCLK0 | x | - * |\ref TMR6_MODULE |\ref CLK_CLKSEL1_TMR6SEL_EXT | x | - * |\ref TMR7_MODULE |\ref CLK_CLKSEL1_TMR7SEL_HXT | x | - * |\ref TMR7_MODULE |\ref CLK_CLKSEL1_TMR7SEL_LXT | x | - * |\ref TMR7_MODULE |\ref CLK_CLKSEL1_TMR7SEL_LIRC | x | - * |\ref TMR7_MODULE |\ref CLK_CLKSEL1_TMR7SEL_HIRC | x | - * |\ref TMR7_MODULE |\ref CLK_CLKSEL1_TMR7SEL_PCLK0 | x | - * |\ref TMR7_MODULE |\ref CLK_CLKSEL1_TMR7SEL_EXT | x | - * |\ref TMR8_MODULE |\ref CLK_CLKSEL2_TMR8SEL_HXT | x | - * |\ref TMR8_MODULE |\ref CLK_CLKSEL2_TMR8SEL_LXT | x | - * |\ref TMR8_MODULE |\ref CLK_CLKSEL2_TMR8SEL_LIRC | x | - * |\ref TMR8_MODULE |\ref CLK_CLKSEL2_TMR8SEL_HIRC | x | - * |\ref TMR8_MODULE |\ref CLK_CLKSEL2_TMR8SEL_PCLK1 | x | - * |\ref TMR8_MODULE |\ref CLK_CLKSEL2_TMR8SEL_EXT | x | - * |\ref TMR9_MODULE |\ref CLK_CLKSEL2_TMR9SEL_HXT | x | - * |\ref TMR9_MODULE |\ref CLK_CLKSEL2_TMR9SEL_LXT | x | - * |\ref TMR9_MODULE |\ref CLK_CLKSEL2_TMR9SEL_LIRC | x | - * |\ref TMR9_MODULE |\ref CLK_CLKSEL2_TMR9SEL_HIRC | x | - * |\ref TMR9_MODULE |\ref CLK_CLKSEL2_TMR9SEL_PCLK1 | x | - * |\ref TMR9_MODULE |\ref CLK_CLKSEL2_TMR9SEL_EXT | x | - * |\ref TMR10_MODULE |\ref CLK_CLKSEL2_TMR10SEL_HXT | x | - * |\ref TMR10_MODULE |\ref CLK_CLKSEL2_TMR10SEL_LXT | x | - * |\ref TMR10_MODULE |\ref CLK_CLKSEL2_TMR10SEL_LIRC | x | - * |\ref TMR10_MODULE |\ref CLK_CLKSEL2_TMR10SEL_HIRC | x | - * |\ref TMR10_MODULE |\ref CLK_CLKSEL2_TMR10SEL_EXT | x | - * |\ref TMR10_MODULE |\ref CLK_CLKSEL2_TMR10SEL_PCLK2 | x | - * |\ref TMR11_MODULE |\ref CLK_CLKSEL2_TMR11SEL_HXT | x | - * |\ref TMR11_MODULE |\ref CLK_CLKSEL2_TMR11SEL_LXT | x | - * |\ref TMR11_MODULE |\ref CLK_CLKSEL2_TMR11SEL_LIRC | x | - * |\ref TMR11_MODULE |\ref CLK_CLKSEL2_TMR11SEL_HIRC | x | - * |\ref TMR11_MODULE |\ref CLK_CLKSEL2_TMR11SEL_EXT | x | - * |\ref TMR11_MODULE |\ref CLK_CLKSEL2_TMR11SEL_PCLK2 | x | - * |\ref UART0_MODULE |\ref CLK_CLKSEL2_UART0SEL_HXT |\ref CLK_CLKDIV1_UART0(x) | - * |\ref UART0_MODULE |\ref CLK_CLKSEL2_UART0SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART0(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL2_UART1SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART1_MODULE |\ref CLK_CLKSEL2_UART1SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL2_UART2SEL_HXT |\ref CLK_CLKDIV1_UART2(x) | - * |\ref UART2_MODULE |\ref CLK_CLKSEL2_UART2SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART2(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL2_UART3SEL_HXT |\ref CLK_CLKDIV1_UART3(x) | - * |\ref UART3_MODULE |\ref CLK_CLKSEL2_UART3SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART3(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL2_UART4SEL_HXT |\ref CLK_CLKDIV2_UART4(x) | - * |\ref UART4_MODULE |\ref CLK_CLKSEL2_UART4SEL_SYSCLK1 |\ref CLK_CLKDIV2_UART4(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL2_UART5SEL_HXT |\ref CLK_CLKDIV2_UART5(x) | - * |\ref UART5_MODULE |\ref CLK_CLKSEL2_UART5SEL_SYSCLK1 |\ref CLK_CLKDIV2_UART5(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL2_UART6SEL_HXT |\ref CLK_CLKDIV2_UART6(x) | - * |\ref UART6_MODULE |\ref CLK_CLKSEL2_UART6SEL_SYSCLK1 |\ref CLK_CLKDIV2_UART6(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL2_UART7SEL_HXT |\ref CLK_CLKDIV2_UART7(x) | - * |\ref UART7_MODULE |\ref CLK_CLKSEL2_UART7SEL_SYSCLK1 |\ref CLK_CLKDIV2_UART7(x) | - * |\ref UART8_MODULE |\ref CLK_CLKSEL3_UART8SEL_HXT |\ref CLK_CLKDIV2_UART8(x) | - * |\ref UART8_MODULE |\ref CLK_CLKSEL3_UART8SEL_SYSCLK1 |\ref CLK_CLKDIV2_UART8(x) | - * |\ref UART9_MODULE |\ref CLK_CLKSEL3_UART9SEL_HXT |\ref CLK_CLKDIV2_UART9(x) | - * |\ref UART9_MODULE |\ref CLK_CLKSEL3_UART9SEL_SYSCLK1 |\ref CLK_CLKDIV2_UART9(x) | - * |\ref UART10_MODULE |\ref CLK_CLKSEL3_UART10SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART10_MODULE |\ref CLK_CLKSEL3_UART10SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART11_MODULE |\ref CLK_CLKSEL3_UART11SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART11_MODULE |\ref CLK_CLKSEL3_UART11SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART12_MODULE |\ref CLK_CLKSEL3_UART12SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART12_MODULE |\ref CLK_CLKSEL3_UART12SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART13_MODULE |\ref CLK_CLKSEL3_UART13SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART13_MODULE |\ref CLK_CLKSEL3_UART13SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART14_MODULE |\ref CLK_CLKSEL3_UART14SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART14_MODULE |\ref CLK_CLKSEL3_UART14SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART15_MODULE |\ref CLK_CLKSEL3_UART15SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART15_MODULE |\ref CLK_CLKSEL3_UART15SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART16_MODULE |\ref CLK_CLKSEL3_UART16SEL_HXT |\ref CLK_CLKDIV1_UART1(x) | - * |\ref UART16_MODULE |\ref CLK_CLKSEL3_UART16SEL_SYSCLK1 |\ref CLK_CLKDIV1_UART1(x) | - * |\ref WDT0_MODULE |\ref CLK_CLKSEL3_WDT0SEL_HXT | x | - * |\ref WDT0_MODULE |\ref CLK_CLKSEL3_WDT0SEL_LXT | x | - * |\ref WDT0_MODULE |\ref CLK_CLKSEL3_WDT0SEL_LIRC | x | - * |\ref WDT0_MODULE |\ref CLK_CLKSEL3_WDT0SEL_PCLK3 | x | - * |\ref WWDT0_MODULE |\ref CLK_CLKSEL3_WWDT0SEL_HXT | x | - * |\ref WWDT0_MODULE |\ref CLK_CLKSEL3_WWDT0SEL_LXT | x | - * |\ref WWDT0_MODULE |\ref CLK_CLKSEL3_WWDT0SEL_LIRC | x | - * |\ref WWDT0_MODULE |\ref CLK_CLKSEL3_WWDT0SEL_PCLK3 | x | - * |\ref WDT1_MODULE |\ref CLK_CLKSEL3_WDT1SEL_HXT | x | - * |\ref WDT1_MODULE |\ref CLK_CLKSEL3_WDT1SEL_LXT | x | - * |\ref WDT1_MODULE |\ref CLK_CLKSEL3_WDT1SEL_LIRC | x | - * |\ref WDT1_MODULE |\ref CLK_CLKSEL3_WDT1SEL_PCLK3 | x | - * |\ref WWDT1_MODULE |\ref CLK_CLKSEL3_WWDT1SEL_HXT | x | - * |\ref WWDT1_MODULE |\ref CLK_CLKSEL3_WWDT1SEL_LXT | x | - * |\ref WWDT1_MODULE |\ref CLK_CLKSEL3_WWDT1SEL_LIRC | x | - * |\ref WWDT1_MODULE |\ref CLK_CLKSEL3_WWDT1SEL_PCLK3 | x | - * |\ref WDT2_MODULE |\ref CLK_CLKSEL3_WDT2SEL_HXT | x | - * |\ref WDT2_MODULE |\ref CLK_CLKSEL3_WDT2SEL_LXT | x | - * |\ref WDT2_MODULE |\ref CLK_CLKSEL3_WDT2SEL_LIRC | x | - * |\ref WDT2_MODULE |\ref CLK_CLKSEL3_WDT2SEL_PCLK4 | x | - * |\ref WWDT2_MODULE |\ref CLK_CLKSEL3_WWDT2SEL_HXT | x | - * |\ref WWDT2_MODULE |\ref CLK_CLKSEL3_WWDT2SEL_LXT | x | - * |\ref WWDT2_MODULE |\ref CLK_CLKSEL3_WWDT2SEL_LIRC | x | - * |\ref WWDT2_MODULE |\ref CLK_CLKSEL3_WWDT2SEL_PCLK4 | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL4_SPI0SEL_PCLK1 | x | - * |\ref SPI0_MODULE |\ref CLK_CLKSEL4_SPI0SEL_APLL | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL4_SPI1SEL_APLL | x | - * |\ref SPI1_MODULE |\ref CLK_CLKSEL4_SPI1SEL_PCLK2 | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL4_SPI2SEL_PCLK1 | x | - * |\ref SPI2_MODULE |\ref CLK_CLKSEL4_SPI2SEL_APLL | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL4_SPI3SEL_APLL | x | - * |\ref SPI3_MODULE |\ref CLK_CLKSEL4_SPI3SEL_PCLK2 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL4_QSPI0SEL_PCLK0 | x | - * |\ref QSPI0_MODULE |\ref CLK_CLKSEL4_QSPI0SEL_APLL | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL4_QSPI1SEL_PCLK0 | x | - * |\ref QSPI1_MODULE |\ref CLK_CLKSEL4_QSPI1SEL_APLL | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL4_I2S0SEL_APLL | x | - * |\ref I2S0_MODULE |\ref CLK_CLKSEL4_I2S0SEL_SYSCLK1 | x | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL4_I2S1SEL_APLL | x | - * |\ref I2S1_MODULE |\ref CLK_CLKSEL4_I2S1SEL_SYSCLK1 | x | - * |\ref CANFD0_MODULE |\ref CLK_CLKSEL4_CANFD0SEL_APLL |\ref CLK_CLKDIV0_CANFD0(x) | - * |\ref CANFD0_MODULE |\ref CLK_CLKSEL4_CANFD0SEL_VPLL |\ref CLK_CLKDIV0_CANFD0(x) | - * |\ref CANFD1_MODULE |\ref CLK_CLKSEL4_CANFD1SEL_APLL |\ref CLK_CLKDIV0_CANFD1(x) | - * |\ref CANFD1_MODULE |\ref CLK_CLKSEL4_CANFD1SEL_VPLL |\ref CLK_CLKDIV0_CANFD1(x) | - * |\ref CANFD2_MODULE |\ref CLK_CLKSEL4_CANFD2SEL_APLL |\ref CLK_CLKDIV0_CANFD2(x) | - * |\ref CANFD2_MODULE |\ref CLK_CLKSEL4_CANFD2SEL_VPLL |\ref CLK_CLKDIV0_CANFD2(x) | - * |\ref CANFD3_MODULE |\ref CLK_CLKSEL4_CANFD3SEL_APLL |\ref CLK_CLKDIV0_CANFD3(x) | - * |\ref CANFD3_MODULE |\ref CLK_CLKSEL4_CANFD3SEL_VPLL |\ref CLK_CLKDIV0_CANFD3(x) | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_HXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_LXT | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_LIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_HIRC | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_CAPLL | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_SYSPLL | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_APLL | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_EPLL | x | - * |\ref CLKO_MODULE |\ref CLK_CLKSEL4_CKOSEL_VPLL | x | - * |\ref SC0_MODULE |\ref CLK_CLKSEL4_SC0SEL_HXT |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC0_MODULE |\ref CLK_CLKSEL4_SC0SEL_PCLK4 |\ref CLK_CLKDIV1_SC0(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL4_SC1SEL_HXT |\ref CLK_CLKDIV1_SC1(x) | - * |\ref SC1_MODULE |\ref CLK_CLKSEL4_SC1SEL_PCLK4 |\ref CLK_CLKDIV1_SC1(x) | - * |\ref KPI_MODULE |\ref CLK_CLKSEL4_KPISEL_HXT |\ref CLK_CLKDIV4_KPI(x) | - * |\ref KPI_MODULE |\ref CLK_CLKSEL4_KPISEL_LXT |\ref CLK_CLKDIV4_KPI(x) | - * |\ref CA35CK_MODULE |\ref CLK_CLKSEL0_CA35CKSEL_HXT | x | - * |\ref CA35CK_MODULE |\ref CLK_CLKSEL0_CA35CKSEL_CAPLL | x | - - * - */ -void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv) -{ - uint32_t u32sel = 0U, u32div = 0U; - - if (u32ModuleIdx == KPI_MODULE) - { - CLK->CLKDIV4 = (CLK->CLKDIV4 & ~(CLK_CLKDIV4_KPIDIV_Msk)) | u32ClkDiv; - CLK->CLKSEL4 = (CLK->CLKSEL4 & ~(CLK_CLKSEL4_KPISEL_Msk)) | u32ClkSrc; - CLK->APBCLK0 = (CLK->APBCLK0 & ~(CLK_APBCLK0_KPICKEN_Msk)) | CLK_APBCLK0_KPICKEN_Msk; - } - else if (u32ModuleIdx == ADC_MODULE) - { - CLK->CLKDIV4 = (CLK->CLKDIV4 & ~(CLK_CLKDIV4_ADCDIV_Msk)) | u32ClkDiv; - CLK->APBCLK2 = (CLK->APBCLK2 & ~(CLK_APBCLK2_ADCCKEN_Msk)) | CLK_APBCLK2_ADCCKEN_Msk; - } - else - { - if (MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock divider control register address */ - u32div = (uint32_t)&CLK->CLKDIV0 + ((MODULE_CLKDIV(u32ModuleIdx)) * 4U); - /* Apply new divider */ - M32(u32div) = (M32(u32div) & (~(MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx)))) | u32ClkDiv; - } - - if (MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32sel = (uint32_t)&CLK->CLKSEL0 + ((MODULE_CLKSEL(u32ModuleIdx)) * 4U); - /* Set new clock selection setting */ - M32(u32sel) = (M32(u32sel) & (~(MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx)))) | u32ClkSrc; - } - } -} - -/** - * @brief Set SysTick clock source - * @param[in] u32ClkSrc is module clock source. Including: - * - \ref CLK_CLKSEL0_RTPSTSEL_HXT - * - \ref CLK_CLKSEL0_RTPSTSEL_LXT - * - \ref CLK_CLKSEL0_RTPSTSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_RTPSTSEL_SYSCLK1_DIV2 - * - \ref CLK_CLKSEL0_RTPSTSEL_HIRC - * @return None - * @details This function set SysTick clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_SetSysTickClockSrc(uint32_t u32ClkSrc) -{ - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_RTPSTSEL_Msk) | u32ClkSrc; -} - -/** - * @brief Enable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * @return None - * @details This function enable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL |= u32ClkMask; -} - -/** - * @brief Disable clock source - * @param[in] u32ClkMask is clock source mask. Including : - * - \ref CLK_PWRCTL_HXTEN_Msk - * - \ref CLK_PWRCTL_LXTEN_Msk - * - \ref CLK_PWRCTL_HIRCEN_Msk - * - \ref CLK_PWRCTL_LIRCEN_Msk - * @return None - * @details This function disable clock source. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_DisableXtalRC(uint32_t u32ClkMask) -{ - CLK->PWRCTL &= ~u32ClkMask; -} - -/** - * @brief Enable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref PDMA2_MODULE - * - \ref PDMA3_MODULE - * - \ref WH0_MODULE - * - \ref WH1_MODULE - * - \ref HWSEM0_MODULE - * - \ref EBI_MODULE - * - \ref SRAM0_MODULE - * - \ref SRAM1_MODULE - * - \ref ROM_MODULE - * - \ref TRA_MODULE - * - \ref DBG_MODULE - * - \ref CLKO_MODULE - * - \ref GTMR_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref GPI_MODULE - * - \ref GPJ_MODULE - * - \ref GPK_MODULE - * - \ref GPL_MODULE - * - \ref GPM_MODULE - * - \ref GPN_MODULE - * - \ref CA35_MODULE - * - \ref RTP_MODULE - * - \ref TAHB_MODULE - * - \ref LVRDB_MODULE - * - \ref DDR0_MODULE - * - \ref DDR6_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref NAND_MODULE - * - \ref USBD_MODULE - * - \ref USBH_MODULE - * - \ref HUSBH0_MODULE - * - \ref HUSBH1_MODULE - * - \ref GFX_MODULE - * - \ref VDEC_MODULE - * - \ref DCU_MODULE - * - \ref GMAC0_MODULE - * - \ref GMAC1_MODULE - * - \ref CCAP0_MODULE - * - \ref CCAP1_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref TMR4_MODULE - * - \ref TMR5_MODULE - * - \ref TMR6_MODULE - * - \ref TMR7_MODULE - * - \ref TMR8_MODULE - * - \ref TMR9_MODULE - * - \ref TMR10_MODULE - * - \ref TMR11_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref UART10_MODULE - * - \ref UART11_MODULE - * - \ref UART12_MODULE - * - \ref UART13_MODULE - * - \ref UART14_MODULE - * - \ref UART15_MODULE - * - \ref UART16_MODULE - * - \ref RTC_MODULE - * - \ref DDRP_MODULE - * - \ref KPI_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref I2C3_MODULE - * - \ref I2C4_MODULE - * - \ref I2C5_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref WDT0_MODULE - * - \ref WDT1_MODULE - * - \ref WDT2_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref EPWM2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SSMCC_MODULE - * - \ref SSPCC_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref ECAP2_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref QEI2_MODULE - * - \ref ADC_MODULE - * - \ref EADC_MODULE - * @return None - * @details This function is used to enable module clock. - */ -void CLK_EnableModuleClock(uint32_t u32ModuleIdx) -{ - vu32 u32tmpVal = 0UL, u32tmpAddr = 0UL; - - u32tmpVal = (1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32tmpAddr = (uint32_t)&CLK->SYSCLK0; - u32tmpAddr += ((MODULE_APBCLK(u32ModuleIdx) * 4UL)); - - *(vu32 *)u32tmpAddr |= u32tmpVal; -} - -/** - * @brief Disable module clock - * @param[in] u32ModuleIdx is module index. Including : - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref PDMA2_MODULE - * - \ref PDMA3_MODULE - * - \ref WH0_MODULE - * - \ref WH1_MODULE - * - \ref HWSEM0_MODULE - * - \ref EBI_MODULE - * - \ref SRAM0_MODULE - * - \ref SRAM1_MODULE - * - \ref ROM_MODULE - * - \ref TRA_MODULE - * - \ref DBG_MODULE - * - \ref CLKO_MODULE - * - \ref GTMR_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref GPI_MODULE - * - \ref GPJ_MODULE - * - \ref GPK_MODULE - * - \ref GPL_MODULE - * - \ref GPM_MODULE - * - \ref GPN_MODULE - * - \ref CA35_MODULE - * - \ref RTP_MODULE - * - \ref TAHB_MODULE - * - \ref LVRDB_MODULE - * - \ref DDR0_MODULE - * - \ref DDR6_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref NAND_MODULE - * - \ref USBD_MODULE - * - \ref USBH_MODULE - * - \ref HUSBH0_MODULE - * - \ref HUSBH1_MODULE - * - \ref GFX_MODULE - * - \ref VDEC_MODULE - * - \ref DCU_MODULE - * - \ref GMAC0_MODULE - * - \ref GMAC1_MODULE - * - \ref CCAP0_MODULE - * - \ref CCAP1_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref TMR4_MODULE - * - \ref TMR5_MODULE - * - \ref TMR6_MODULE - * - \ref TMR7_MODULE - * - \ref TMR8_MODULE - * - \ref TMR9_MODULE - * - \ref TMR10_MODULE - * - \ref TMR11_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref UART10_MODULE - * - \ref UART11_MODULE - * - \ref UART12_MODULE - * - \ref UART13_MODULE - * - \ref UART14_MODULE - * - \ref UART15_MODULE - * - \ref UART16_MODULE - * - \ref RTC_MODULE - * - \ref DDRP_MODULE - * - \ref KPI_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref I2C3_MODULE - * - \ref I2C4_MODULE - * - \ref I2C5_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref WDT0_MODULE - * - \ref WDT1_MODULE - * - \ref WDT2_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref EPWM2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SSMCC_MODULE - * - \ref SSPCC_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref ECAP2_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref QEI2_MODULE - * - \ref ADC_MODULE - * - \ref EADC_MODULE - * @return None - * @details This function is used to disable module clock. - */ -void CLK_DisableModuleClock(uint32_t u32ModuleIdx) -{ - vu32 u32tmpVal = 0UL, u32tmpAddr = 0UL; - - u32tmpVal = ~(1UL << MODULE_IP_EN_Pos(u32ModuleIdx)); - u32tmpAddr = (uint32_t)&CLK->SYSCLK0; - u32tmpAddr += ((MODULE_APBCLK(u32ModuleIdx) * 4UL)); - - *((vu32 *)u32tmpAddr) &= u32tmpVal; -} - -/** - * @brief Get VSI PLL Operation Mode - * @param[in] u32PllIdx is PLL clock index. Including : - * - \ref DDRPLL - * - \ref APLL - * - \ref EPLL - * - \ref VPLL - * @return VSI PLL Operation Mode - * @details This function get VSI PLL Operation Mode. - */ -uint32_t CLK_GetPLLOpMode(uint32_t u32PllIdx) -{ - return (CLK->PLL[u32PllIdx].CTL0 & CLK_PLLnCTL0_MODE_Msk) >> CLK_PLLnCTL0_MODE_Pos; -} - -/** - * @brief This function check selected clock source status - * @param[in] u32ClkMask is selected clock source. Including : - * - \ref CLK_STATUS_HXTSTB_Msk - * - \ref CLK_STATUS_LXTSTB_Msk - * - \ref CLK_STATUS_HIRCSTB_Msk - * - \ref CLK_STATUS_LIRCSTB_Msk - * - \ref CLK_STATUS_CAPLLSTB_Msk - * - \ref CLK_STATUS_DDRPLLSTB_Msk - * - \ref CLK_STATUS_EPLLSTB_Msk - * - \ref CLK_STATUS_APLLSTB_Msk - * - \ref CLK_STATUS_VPLLSTB_Msk - * @retval 0 clock is not stable - * @retval 1 clock is stable - * @details To wait for clock ready by specified clock source stable flag or timeout (~300ms) - */ -uint32_t CLK_WaitClockReady(uint32_t u32ClkMask) -{ - int32_t i32TimeOutCnt = 2160000; - uint32_t u32Ret = 1U; - - while ((CLK->STATUS & u32ClkMask) != u32ClkMask) - { - if (i32TimeOutCnt-- <= 0) - { - u32Ret = 0U; - break; - } - } - - return u32Ret; -} - -#if defined(USE_MA35D1_SUBM) -/** - * @brief Enable System Tick counter - * @param[in] u32ClkSrc is System Tick clock source. Including: - * - \ref CLK_CLKSEL0_RTPSTSEL_HXT - * - \ref CLK_CLKSEL0_RTPSTSEL_LXT - * - \ref CLK_CLKSEL0_RTPSTSEL_HXT_DIV2 - * - \ref CLK_CLKSEL0_RTPSTSEL_SYSCLK1_DIV2 - * - \ref CLK_CLKSEL0_RTPSTSEL_HIRC - * @param[in] u32Count is System Tick reload value. It could be 0~0xFFFFFF. - * @return None - * @details This function set System Tick clock source, reload value, enable System Tick counter and interrupt. \n - * The register write-protection function should be disabled before using this function. - */ -void CLK_EnableSysTick(uint32_t u32ClkSrc, uint32_t u32Count) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; - - /* Set System Tick clock source */ - if (u32ClkSrc == CLK_CLKSEL0_RTPSTSEL_HIRC) - { - SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk; - } - else - { - CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_RTPSTSEL_Msk) | u32ClkSrc; - } - - /* Set System Tick reload value */ - SysTick->LOAD = u32Count; - - /* Clear System Tick current value and counter flag */ - SysTick->VAL = 0UL; - - /* Set System Tick interrupt enabled and counter enabled */ - SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk; -} - -/** - * @brief Disable System Tick counter - * @param None - * @return None - * @details This function disable System Tick counter. - */ -void CLK_DisableSysTick(void) -{ - /* Set System Tick counter disabled */ - SysTick->CTRL = 0UL; -} -#endif - -/** - * @brief Get CAPLL clock frequency - * @param None - * @return PLL frequency - * @details This function get PLL frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetCAPLLClockFreq(void) -{ - uint32_t u32M, u32N, u32P; - uint32_t u32PllClk, u32RefClk; - uint32_t val; - - val = CLK->PLL0CTL0; - - u32N = (val & CLK_PLL0CTL0_FBDIV_Msk); - u32M = (val & CLK_PLL0CTL0_INDIV_Msk) >> (CLK_PLL0CTL0_INDIV_Pos); - u32P = (val & CLK_PLL0CTL0_OUTDIV_Msk) >> (CLK_PLL0CTL0_OUTDIV_Pos); - - if (val & CLK_PLL0CTL0_BP_Msk) - { - u32PllClk = __HXT; - } - else - { - /* u32RefClk is shifted to avoid overflow */ - u32RefClk = __HXT / 100; - - /* Actual PLL output clock frequency */ - u32PllClk = ((u32RefClk * u32N) / ((0x1 << u32P) * u32M)) * 100; - } - - return u32PllClk; -} - -/** - * @brief Get Advanced PLL clock frequency - * @param[in] u32PllIdx is Advanced PLL clock index. Including : - * - \ref DDRPLL - * - \ref APLL - * - \ref EPLL - * - \ref VPLL - * @return Advanced PLL frequency - * @details This function get Advanced PLL frequency. The frequency unit is Hz. - */ -static uint32_t CLK_GetVSIPLLClockFreq(uint32_t u32PllIdx) -{ - uint32_t u32M, u32N, u32P, u32X, u32Mode; - uint32_t u32CTLVal0, u32CTLVal1, u32PllClk = 0ul; - - /* Set PLL Operation mode. */ - u32CTLVal0 = CLK->PLL[u32PllIdx].CTL0; - u32CTLVal1 = CLK->PLL[u32PllIdx].CTL1; - - /* If is power down state, it will return 0 directly. */ - if (u32CTLVal1 & CLK_PLLnCTL1_PD_Msk) - return 0U; - - u32Mode = (u32CTLVal0 & CLK_PLLnCTL0_MODE_Msk) >> CLK_PLLnCTL0_MODE_Pos; - - u32N = (u32CTLVal0 & CLK_PLLnCTL0_FBDIV_Msk); - u32M = (u32CTLVal0 & CLK_PLLnCTL0_INDIV_Msk) >> CLK_PLLnCTL0_INDIV_Pos; - u32P = (u32CTLVal1 & CLK_PLLnCTL1_OUTDIV_Msk) >> CLK_PLLnCTL1_OUTDIV_Pos; - u32X = (u32CTLVal1 & CLK_PLLnCTL1_FRAC_Msk) >> CLK_PLLnCTL1_FRAC_Pos; - - if (u32Mode == 0) - { - /* Actual PLL output clock frequency */ - u32PllClk = (__HXT / (u32P * u32M)) * u32N; - } - else if (u32Mode == 1) - { - /* Actual PLL output clock frequency */ - u32X = (((u32X * 1000) + 500) >> 24); - u32PllClk = (__HXT / 1000) * ((u32N * 1000) + u32X) / (u32P * u32M); - } - else if (u32Mode == 2) - { - //uint32_t u32SR, u32FMOD, u32CTLVal2; - - //u32CTLVal2 = CLK->PLLCTL[u32PllIdx].REG2; - //u32SR = (u32CTLVal0 & (CLK_PLLnCTL0_SSRATE_Msk)) >> CLK_PLLnCTL0_SSRATE_Pos; - //u32FMOD = u32CTLVal2 & CLK_PLLnCTL2_SLOPE_Msk; - - /* Actual PLL output clock frequency */ - u32X = ((u32X * 1000) >> 24); - u32PllClk = (__HXT / 1000) * ((u32N * 1000) + u32X) / (u32P * u32M); - } - - return u32PllClk; -} - -/* VSI-PLL Specification limits */ -#define VSIPLL_FREF_MAX_FREQ 200000000U -#define VSIPLL_FREF_MIN_FREQ 1000000U - -#define VSIPLL_FREFDIVM_MAX_FREQ 40000000U -#define VSIPLL_FREFDIVM_MIN_FREQ0 1000000U -#define VSIPLL_FREFDIVM_MIN_FREQ1 10000000U - -#define VSIPLL_FCLK_MAX_FREQ 2400000000U -#define VSIPLL_FCLK_MIN_FREQ 600000000U - -#define VSIPLL_FCLKO_MAX_FREQ 2400000000U -#define VSIPLL_FCLKO_MIN_FREQ 85700000U - -#define VSIPLL_SPREAD_RANGE 194 -#define VSIPLL_MODULATION_FREQ 50000 - -struct S_PLL_FREQ_MAP -{ - uint64_t freq; - uint32_t mode; - uint32_t ctl0_reg; - uint32_t ctl1_reg; - uint32_t ctl2_reg; -} ; - -static const struct S_PLL_FREQ_MAP s_sVsiPllFreqTbl[] = -{ - { 1000000000, PLL_OPMODE_INTEGER, 0x307d, 0x10, 0 }, /* Mode0 */ - { 884736000, PLL_OPMODE_FRACTIONAL, 0x41024, 0xdd2f1b11, 0 }, /* Mode1 */ - { 533000000, PLL_OPMODE_SPREAD_SPECTRUM, 0x12b8102c, 0x6aaaab20, 0x12317 }, /* Mode2 */ - { } -}; - -static uint64_t CLK_CalPLLFreq_Mode0(uint64_t u64PllSrcClk, uint64_t u64PllFreq, uint32_t *u32Reg) -{ - uint32_t u32Tmp, u32Min, u32MinN, u32MinM, u32MinP; - - uint64_t u64PllClk; - uint64_t u64Con1, u64Con2, u64Con3; - - /* Find best solution */ - u32Min = (uint32_t) - 1; - u32MinM = 0UL; - u32MinN = 0UL; - u32MinP = 0UL; - - if ((u64PllFreq < VSIPLL_FCLKO_MIN_FREQ) || (u64PllFreq > VSIPLL_FCLKO_MAX_FREQ)) - { - u32Reg[0] = s_sVsiPllFreqTbl[0].ctl0_reg; - u32Reg[1] = s_sVsiPllFreqTbl[0].ctl1_reg; - u64PllClk = s_sVsiPllFreqTbl[0].freq; - } - else - { - uint32_t u32TmpM, u32TmpN, u32TmpP; - uint32_t u32RngMinN, u32RngMinM, u32RngMinP; - uint32_t u32RngMaxN, u32RngMaxM, u32RngMaxP; - - /* Find best solution */ - u32RngMinM = 1UL; - u32RngMaxM = 63UL; - - u32RngMinM = ((u64PllSrcClk / VSIPLL_FREFDIVM_MAX_FREQ) > 1) ? - (u64PllSrcClk / VSIPLL_FREFDIVM_MAX_FREQ) : 1; - u32RngMaxM = ((u64PllSrcClk / VSIPLL_FREFDIVM_MIN_FREQ0) < u32RngMaxM) ? - (u64PllSrcClk / VSIPLL_FREFDIVM_MIN_FREQ0) : u32RngMaxM; - - for (u32TmpM = u32RngMinM; u32TmpM < (u32RngMaxM + 1); u32TmpM++) - { - u64Con1 = u64PllSrcClk / u32TmpM; - - u32RngMinN = 16UL; - u32RngMaxN = 2047UL; - - u32RngMinN = ((VSIPLL_FCLK_MIN_FREQ / u64Con1) > u32RngMinN) ? - (VSIPLL_FCLK_MIN_FREQ / u64Con1) : u32RngMinN; - u32RngMaxN = ((VSIPLL_FCLK_MAX_FREQ / u64Con1) < u32RngMaxN) ? - (VSIPLL_FCLK_MAX_FREQ / u64Con1) : u32RngMaxN; - - for (u32TmpN = u32RngMinN; u32TmpN < (u32RngMaxN + 1); u32TmpN++) - { - u64Con2 = u64Con1 * u32TmpN; - - u32RngMinP = 1UL; - u32RngMaxP = 7UL; - - u32RngMinP = ((u64Con2 / VSIPLL_FCLKO_MAX_FREQ) > 1) ? (u64Con2 / - VSIPLL_FCLKO_MAX_FREQ) : 1; - u32RngMaxP = ((u64Con2 / VSIPLL_FCLKO_MIN_FREQ) < u32RngMaxP) ? - (u64Con2 / VSIPLL_FCLKO_MIN_FREQ) : u32RngMaxP; - - for (u32TmpP = u32RngMinP; u32TmpP < (u32RngMaxP + 1); u32TmpP++) - { - u64Con3 = u64Con2 / u32TmpP; - if (u64Con3 > u64PllFreq) - u32Tmp = u64Con3 - u64PllFreq; - else - u32Tmp = u64PllFreq - u64Con3; - - if (u32Tmp < u32Min) - { - u32Min = u32Tmp; - u32MinM = u32TmpM; - u32MinN = u32TmpN; - u32MinP = u32TmpP; - - /* Break when get good results */ - if (u32Min == 0UL) - { - u32Reg[0] = (u32MinM << 12) | (u32MinN); - u32Reg[1] = (u32MinP << 4); - - return ((u64PllSrcClk * u32MinN) / (u32MinP * u32MinM)); - } - } - } - } - - } - - /* Enable and apply new PLL setting. */ - u32Reg[0] = (u32MinM << 12) | (u32MinN); - u32Reg[1] = (u32MinP << 4); - - /* Actual PLL output clock frequency */ - u64PllClk = (u64PllSrcClk * u32MinN) / (u32MinP * u32MinM); - } - - return u64PllClk; -} - - -static uint64_t CLK_CalPLLFreq_Mode1(uint64_t u64PllSrcClk, uint64_t u64PllFreq, uint32_t *u32Reg) -{ - uint64_t u64X, u64N, u64M, u64P, u64tmp, u64tmpP, u64tmpM; - uint64_t u64PllClk, u64FCLKO; - uint32_t u32FRAC, i; - - // check condition 1 - if ((u64PllSrcClk > VSIPLL_FREF_MAX_FREQ) || (u64PllSrcClk < VSIPLL_FREF_MIN_FREQ)) - { - // Fref is incorrect, return fail - return 0; - } - - // check condition 4 - if (u64PllFreq < VSIPLL_FCLKO_MIN_FREQ) - { - // Adjust u64FCLKO - u64FCLKO = 0; - - for (i = 2; i < 100; i++) - { - u64tmp = (i * u64PllFreq); - if (u64tmp > VSIPLL_FCLKO_MIN_FREQ) - { - u64FCLKO = u64tmp; - break; - } - } - - if (u64FCLKO == 0) return 0; - } - else if (u64PllFreq >= VSIPLL_FCLKO_MAX_FREQ) - { - u32Reg[0] = 0x30FA; - u32Reg[1] = (0x2 << 4); - u64PllClk = 1000000000; - return u64PllClk; - } - else - u64FCLKO = u64PllFreq; - - // Find P - u64P = 0; - for (i = 1; i < 8; i++) - { - u64tmpP = i * u64FCLKO; - // it should be condition 3 - if ((u64tmpP <= VSIPLL_FCLKO_MAX_FREQ) && (u64tmpP >= 600000000)) - { - u64P = i; - break; - } - } - - // No reasonable P is found, return fail. - if (u64P == 0) return 0; - - // Find M - u64M = 0; // Initialize it, and use it to judge reasonable M is found or not - for (i = 1; i < 64; i++) - { - u64tmpM = u64PllSrcClk / i; - if ((u64tmpM <= 40000000) && (u64tmpM >= 10000000)) // condition 2 - { - u64M = i; - break; - } - } - - if (u64M == 0) - { - // No reasonable M is found - return 0; - } - - u64tmp = (u64FCLKO * u64P * u64M * 1000) / u64PllSrcClk; - u64N = u64tmp / 1000; - u64X = u64tmp % 1000; - u32FRAC = ((u64X << 24) + 500) / 1000; - - u32Reg[0] = (u64M << 12) | (u64N); - u32Reg[1] = (u64P << 4) | (u32FRAC << 8); - - /* Actual PLL output clock frequency */ - u64PllClk = (u64PllSrcClk * u64tmp) / u64P / u64M / 1000; - - return u64PllClk; -} - -static uint64_t CLK_CalPLLFreq_Mode2(uint64_t PllSrcClk, uint64_t u64PllFreq, uint32_t u32SR, uint32_t u32Fmod, uint32_t *u32Reg) -{ - uint64_t u64PllClk; - uint64_t u64X, u64N, u64M, u64P, u64tmp, u64tmpP, u64tmpM; - uint64_t u64FCLKO, u64SSRATE, u64SLOPE; - uint32_t u32FRAC, i; - - // check condition 1 - if ((PllSrcClk > 200000000) || (PllSrcClk < 1000000)) - { - // Fref is incorrect, return fail case - return 0; - } - - // check condition 4 - if (u64PllFreq < 85700000) - { - u64FCLKO = 0; - for (i = 2; i < 8; i++) - { - u64tmp = (i * u64PllFreq); - if (u64tmp > 85700000) - { - u64FCLKO = u64tmp; - } - } - - if (u64FCLKO == 0) return 0; - } - else if (u64PllFreq >= 2400000000) - { - u32Reg[0] = 0x30FA; - u32Reg[1] = (0x2 << 4); - u64PllClk = 1000000000; - return u64PllClk; - } - else - u64FCLKO = u64PllFreq; - - // Find P - u64P = 0; - for (i = 1; i < 8; i++) - { - u64tmpP = i * u64FCLKO; - if ((u64tmpP <= 2400000000) && (u64tmpP >= 600000000)) - { - u64P = i; - break; - } - } - - // No reasonable P is found, return fail. - if (u64P == 0) return 0; - - // Find M - u64M = 0; // Initialize it, and use it to judge reasonable M is found or not - for (i = 1; i < 64; i++) - { - u64tmpM = PllSrcClk / i; - if ((u64tmpM <= 40000000) && (u64tmpM >= 10000000)) // condition 2 - { - u64M = i; - break; - } - } - - if (u64M == 0) // No reasonable M is found - { - return 0; - } - - u64tmp = (u64FCLKO * u64P * u64M * 1000) / PllSrcClk; - u64N = u64tmp / 1000; - u64X = u64tmp % 1000; - u32FRAC = ((u64X << 24) + 500) / 1000; - - u64SSRATE = ((PllSrcClk >> 1) / (u32Fmod * 2)) - 1; - u64SLOPE = ((u64tmp * u32SR / u64SSRATE) << 24) / 100 / 1000; - - u32Reg[0] = (u64SSRATE << 20) | (u64M << 12) | (u64N); - u32Reg[1] = (u64P << 4) | (u32FRAC << 8); - u32Reg[2] = u64SLOPE; - - /* Actual PLL output clock frequency */ - u64PllClk = (PllSrcClk * u64tmp) / u64P / u64M / 1000; - - return u64PllClk; -} - -/** - * @brief Get Advanced PLL clock frequency - * @param[in] u32PllIdx is Advanced PLL clock index. Including : - * - \ref CAPLL - * - \ref - * - \ref DDRPLL - * - \ref APLL - * - \ref EPLL - * - \ref VPLL - * @return Advanced PLL frequency - * @details This function get Advanced PLL frequency. The frequency unit is Hz. - */ -uint32_t CLK_GetPLLClockFreq(uint32_t u32PllIdx) -{ - uint32_t u32Pllout = 0; - - switch (u32PllIdx) - { - /* SMIC */ - case CAPLL: - u32Pllout = CLK_GetCAPLLClockFreq(); - break; - - case SYSPLL: - u32Pllout = SYSPLLFREQCLK; - break; - - /* VSI */ - case DDRPLL: - case EPLL: - case APLL: - case VPLL: - u32Pllout = CLK_GetVSIPLLClockFreq(u32PllIdx); - break; - - default: - break; - } - - return u32Pllout; -} - -/* CPU-PLL: 1000MHz 800MHz 700MHz */ -static const struct S_PLL_FREQ_MAP s_au32CAPLLMap[] = -{ - { 1000000000u, PLL_OPMODE_INTEGER, 0x000006FA, 0, 0 }, /* 1000 MHz */ - { 800000000u, PLL_OPMODE_INTEGER, 0x00000364, 0, 0 }, /* 800 MHz */ - { 700000000u, PLL_OPMODE_INTEGER, 0x000006AF, 0, 0 }, /* 700 MHz */ -}; -#define ARRARSIZE_CAPLLPLLMAP (sizeof(s_au32CAPLLMap)/sizeof(struct S_PLL_FREQ_MAP)) - -static uint64_t CLK_SetCAPLLClockFreq(uint32_t u32PllIdx, uint32_t u32OpMode, uint64_t PllSrcClk, uint64_t u64PllFreq) -{ - // TODO - uint32_t i; - - for (i = 0; i < ARRARSIZE_CAPLLPLLMAP; i++) - { - if ((u32OpMode == PLL_OPMODE_INTEGER) && (u64PllFreq == s_au32CAPLLMap[i].freq)) - { - CLK->PLL0CTL0 = s_au32CAPLLMap[i].ctl0_reg; - return s_au32CAPLLMap[i].freq; - } - } - - return 0; -} - -static uint64_t CLK_SetVSIPLLFreq(uint32_t u32PllIdx, uint32_t u32OpMode, uint64_t PllSrcClk, uint64_t u64PllFreq) -{ - uint32_t u32CTLVal0, u32CTLVal1, u32CTLVal2; - uint32_t u32Reg[3] = {0}; - uint64_t u64PllClk = 0; - - /* Set PLL Operation mode. */ - u32CTLVal0 = CLK->PLL[u32PllIdx].CTL0; - u32CTLVal1 = CLK->PLL[u32PllIdx].CTL1; - u32CTLVal2 = CLK->PLL[u32PllIdx].CTL2; - - /* Set PLL Operation mode. */ - u32CTLVal0 = (u32CTLVal0 & ~CLK_PLLnCTL0_MODE_Msk) | (u32OpMode << CLK_PLLnCTL0_MODE_Pos); - - if (u32OpMode == PLL_OPMODE_INTEGER) - { - u64PllClk = CLK_CalPLLFreq_Mode0(PllSrcClk, u64PllFreq, &u32Reg[0]); - u32CTLVal0 = (u32CTLVal0 & ~(CLK_PLLnCTL0_INDIV_Msk | CLK_PLLnCTL0_FBDIV_Msk)) | u32Reg[0]; - u32CTLVal1 = (u32CTLVal1 & ~CLK_PLLnCTL1_OUTDIV_Msk) | u32Reg[1]; - } - else if (u32OpMode == PLL_OPMODE_FRACTIONAL) - { - u64PllClk = CLK_CalPLLFreq_Mode1(PllSrcClk, u64PllFreq, &u32Reg[0]); - u32CTLVal0 = (u32CTLVal0 & ~(CLK_PLLnCTL0_INDIV_Msk | CLK_PLLnCTL0_FBDIV_Msk)) | u32Reg[0]; - u32CTLVal1 = (u32CTLVal1 & ~(CLK_PLLnCTL1_OUTDIV_Msk | CLK_PLLnCTL1_FRAC_Msk)) | u32Reg[1]; - } - else if (u32OpMode == PLL_OPMODE_SPREAD_SPECTRUM) - { - u64PllClk = CLK_CalPLLFreq_Mode2(PllSrcClk, u64PllFreq, 50000, 194, &u32Reg[0]); /* 50 khz, 1.94% */ - u32CTLVal0 = (u32CTLVal0 & ~(CLK_PLLnCTL0_SSRATE_Msk | CLK_PLLnCTL0_INDIV_Msk | CLK_PLLnCTL0_FBDIV_Msk)) | u32Reg[0]; - u32CTLVal1 = (u32CTLVal1 & ~(CLK_PLLnCTL1_OUTDIV_Msk | CLK_PLLnCTL1_FRAC_Msk)) | u32Reg[1]; - u32CTLVal2 = u32Reg[2]; - } - else - { - return 0; - } - - CLK->PLL[u32PllIdx].CTL0 = u32CTLVal0; - CLK->PLL[u32PllIdx].CTL1 = u32CTLVal1 & (~CLK_PLLnCTL1_PD_Msk); - CLK->PLL[u32PllIdx].CTL2 = u32CTLVal2; - - return u64PllClk; -} - -uint64_t CLK_SetPLLFreq(uint32_t u32PllIdx, uint32_t u32OpMode, uint64_t PllSrcClk, uint64_t u64PllFreq) -{ - uint64_t u64Pllout = 0; - - switch (u32PllIdx) - { - /* SMIC */ - case CAPLL: - u64Pllout = CLK_SetCAPLLClockFreq(u32PllIdx, u32OpMode, PllSrcClk, u64PllFreq); - break; - - case SYSPLL: - u64Pllout = SYSPLLFREQCLK; - break; - - /* VSI */ - case DDRPLL: - case EPLL: - case APLL: - case VPLL: - u64Pllout = CLK_SetVSIPLLFreq(u32PllIdx, u32OpMode, PllSrcClk, u64PllFreq); - break; - - default: - break; - } - - return u64Pllout; -} - -/** - * @brief Get selected module clock source - * @param[in] u32ModuleIdx is module index. - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref PDMA2_MODULE - * - \ref PDMA3_MODULE - * - \ref WH0_MODULE - * - \ref WH1_MODULE - * - \ref HWSEM0_MODULE - * - \ref EBI_MODULE - * - \ref SRAM0_MODULE - * - \ref SRAM1_MODULE - * - \ref ROM_MODULE - * - \ref TRA_MODULE - * - \ref DBG_MODULE - * - \ref CLKO_MODULE - * - \ref GTMR_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref GPI_MODULE - * - \ref GPJ_MODULE - * - \ref GPK_MODULE - * - \ref GPL_MODULE - * - \ref GPM_MODULE - * - \ref GPN_MODULE - * - \ref CA35_MODULE - * - \ref RTP_MODULE - * - \ref TAHB_MODULE - * - \ref LVRDB_MODULE - * - \ref DDR0_MODULE - * - \ref DDR6_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref NAND_MODULE - * - \ref USBD_MODULE - * - \ref USBH_MODULE - * - \ref HUSBH0_MODULE - * - \ref HUSBH1_MODULE - * - \ref GFX_MODULE - * - \ref VDEC_MODULE - * - \ref DCU_MODULE - * - \ref GMAC0_MODULE - * - \ref GMAC1_MODULE - * - \ref CCAP0_MODULE - * - \ref CCAP1_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref TMR4_MODULE - * - \ref TMR5_MODULE - * - \ref TMR6_MODULE - * - \ref TMR7_MODULE - * - \ref TMR8_MODULE - * - \ref TMR9_MODULE - * - \ref TMR10_MODULE - * - \ref TMR11_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref UART10_MODULE - * - \ref UART11_MODULE - * - \ref UART12_MODULE - * - \ref UART13_MODULE - * - \ref UART14_MODULE - * - \ref UART15_MODULE - * - \ref UART16_MODULE - * - \ref RTC_MODULE - * - \ref DDRP_MODULE - * - \ref KPI_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref I2C3_MODULE - * - \ref I2C4_MODULE - * - \ref I2C5_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref WDT0_MODULE - * - \ref WDT1_MODULE - * - \ref WDT2_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref EPWM2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SSMCC_MODULE - * - \ref SSPCC_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref ECAP2_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref QEI2_MODULE - * - \ref ADC_MODULE - * - \ref EADC_MODULE - * @return Selected module clock source setting - * @details This function get selected module clock source. - */ -uint32_t CLK_GetModuleClockSource(uint32_t u32ModuleIdx) -{ - uint32_t u32sel = 0; - uint32_t u32SelTbl[5] = {0x0, 0x4, 0x8, 0xC, 0x10}; - - /* Get clock source selection setting */ - if (MODULE_CLKSEL_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - /* Get clock select control register address */ - u32sel = (uint32_t)&CLK->CLKSEL0 + (u32SelTbl[MODULE_CLKSEL(u32ModuleIdx)]); - /* Get clock source selection setting */ - return ((M32(u32sel) & (MODULE_CLKSEL_Msk(u32ModuleIdx) << MODULE_CLKSEL_Pos(u32ModuleIdx))) >> MODULE_CLKSEL_Pos(u32ModuleIdx)); - } - else - return 0; -} - -/** - * @brief Get selected module clock divider number - * @param[in] u32ModuleIdx is module index. - * - \ref PDMA0_MODULE - * - \ref PDMA1_MODULE - * - \ref PDMA2_MODULE - * - \ref PDMA3_MODULE - * - \ref WH0_MODULE - * - \ref WH1_MODULE - * - \ref HWSEM0_MODULE - * - \ref EBI_MODULE - * - \ref SRAM0_MODULE - * - \ref SRAM1_MODULE - * - \ref ROM_MODULE - * - \ref TRA_MODULE - * - \ref DBG_MODULE - * - \ref CLKO_MODULE - * - \ref GTMR_MODULE - * - \ref GPA_MODULE - * - \ref GPB_MODULE - * - \ref GPC_MODULE - * - \ref GPD_MODULE - * - \ref GPE_MODULE - * - \ref GPF_MODULE - * - \ref GPG_MODULE - * - \ref GPH_MODULE - * - \ref GPI_MODULE - * - \ref GPJ_MODULE - * - \ref GPK_MODULE - * - \ref GPL_MODULE - * - \ref GPM_MODULE - * - \ref GPN_MODULE - * - \ref CA35_MODULE - * - \ref RTP_MODULE - * - \ref TAHB_MODULE - * - \ref LVRDB_MODULE - * - \ref DDR0_MODULE - * - \ref DDR6_MODULE - * - \ref CANFD0_MODULE - * - \ref CANFD1_MODULE - * - \ref CANFD2_MODULE - * - \ref CANFD3_MODULE - * - \ref SDH0_MODULE - * - \ref SDH1_MODULE - * - \ref NAND_MODULE - * - \ref USBD_MODULE - * - \ref USBH_MODULE - * - \ref HUSBH0_MODULE - * - \ref HUSBH1_MODULE - * - \ref GFX_MODULE - * - \ref VDEC_MODULE - * - \ref DCU_MODULE - * - \ref GMAC0_MODULE - * - \ref GMAC1_MODULE - * - \ref CCAP0_MODULE - * - \ref CCAP1_MODULE - * - \ref TMR0_MODULE - * - \ref TMR1_MODULE - * - \ref TMR2_MODULE - * - \ref TMR3_MODULE - * - \ref TMR4_MODULE - * - \ref TMR5_MODULE - * - \ref TMR6_MODULE - * - \ref TMR7_MODULE - * - \ref TMR8_MODULE - * - \ref TMR9_MODULE - * - \ref TMR10_MODULE - * - \ref TMR11_MODULE - * - \ref UART0_MODULE - * - \ref UART1_MODULE - * - \ref UART2_MODULE - * - \ref UART3_MODULE - * - \ref UART4_MODULE - * - \ref UART5_MODULE - * - \ref UART6_MODULE - * - \ref UART7_MODULE - * - \ref UART8_MODULE - * - \ref UART9_MODULE - * - \ref UART10_MODULE - * - \ref UART11_MODULE - * - \ref UART12_MODULE - * - \ref UART13_MODULE - * - \ref UART14_MODULE - * - \ref UART15_MODULE - * - \ref UART16_MODULE - * - \ref RTC_MODULE - * - \ref DDRP_MODULE - * - \ref KPI_MODULE - * - \ref I2C0_MODULE - * - \ref I2C1_MODULE - * - \ref I2C2_MODULE - * - \ref I2C3_MODULE - * - \ref I2C4_MODULE - * - \ref I2C5_MODULE - * - \ref QSPI0_MODULE - * - \ref QSPI1_MODULE - * - \ref SC0_MODULE - * - \ref SC1_MODULE - * - \ref WDT0_MODULE - * - \ref WDT1_MODULE - * - \ref WDT2_MODULE - * - \ref EPWM0_MODULE - * - \ref EPWM1_MODULE - * - \ref EPWM2_MODULE - * - \ref I2S0_MODULE - * - \ref I2S1_MODULE - * - \ref SSMCC_MODULE - * - \ref SSPCC_MODULE - * - \ref SPI0_MODULE - * - \ref SPI1_MODULE - * - \ref SPI2_MODULE - * - \ref SPI3_MODULE - * - \ref ECAP0_MODULE - * - \ref ECAP1_MODULE - * - \ref ECAP2_MODULE - * - \ref QEI0_MODULE - * - \ref QEI1_MODULE - * - \ref QEI2_MODULE - * - \ref ADC_MODULE - * - \ref EADC_MODULE - * @return Selected module clock divider number setting - * @details This function get selected module clock divider number. - */ -uint32_t CLK_GetModuleClockDivider(uint32_t u32ModuleIdx) -{ - vu32 u32div = 0; - uint32_t u32DivTbl[5] = {0x0, 0x4, 0xc, 0xc, 0x10}; - - if (MODULE_CLKDIV_Msk(u32ModuleIdx) != MODULE_NoMsk) - { - if (u32ModuleIdx == KPI_MODULE) - { - u32div = (CLK->CLKDIV4 & CLK_CLKDIV4_KPIDIV_Msk) >> CLK_CLKDIV4_KPIDIV_Pos; - return u32div; - } - else if (u32ModuleIdx == ADC_MODULE) - { - u32div = (CLK->CLKDIV4 & CLK_CLKDIV4_ADCDIV_Msk) >> CLK_CLKDIV4_ADCDIV_Pos; - return u32div; - } - else - { - /* Get clock divider control register address */ - u32div = (vu32)&CLK->CLKDIV0 + (u32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); - /* Get clock divider number setting */ - return ((M32(u32div) & (MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx))) >> MODULE_CLKDIV_Pos(u32ModuleIdx)); - } - } - else - return 0; -} - - -/*@}*/ /* end of group CLK_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CLK_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_disp.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_disp.c deleted file mode 100644 index eb4284c6d2d..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_disp.c +++ /dev/null @@ -1,577 +0,0 @@ -/**************************************************************************//** - * @file nu_disp.c - * @brief DISP driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup DISP_Driver DISP Driver - @{ -*/ - -/** @addtogroup DISP_EXPORTED_FUNCTIONS DISP Exported Functions - @{ -*/ - -static const DISP_LCD_INFO *g_psDispLcdInfo_Curr = NULL; - -const static DISP_LCD_INFO g_sLcdInfo_arr [eDispLcd_Cnt] = -{ - { - /* eDispLcd_1024x600 */ - .u32ResolutionWidth = 1024, - .u32ResolutionHeight = 600, - .sLcdTiming = - { - .u32PCF = 51000000, - .u32HA = 1024, - .u32HSL = 1, - .u32HFP = 160, - .u32HBP = 160, - .u32VA = 600, - .u32VSL = 1, - .u32VFP = 23, - .u32VBP = 12, - .eHSPP = ePolarity_Positive, - .eVSPP = ePolarity_Positive - }, - .sPanelConf = - { - .eDpiFmt = eDPIFmt_D24, - .eDEP = ePolarity_Positive, - .eDP = ePolarity_Positive, - .eCP = ePolarity_Positive - }, - }, - { - /* eDispLcd_800x480 */ - .u32ResolutionWidth = 800, - .u32ResolutionHeight = 480, - .sLcdTiming = - { - .u32PCF = 45000000, - .u32HA = 800, - .u32HSL = 1, - .u32HFP = 210, - .u32HBP = 46, - .u32VA = 480, - .u32VSL = 1, - .u32VFP = 22, - .u32VBP = 23, - .eHSPP = ePolarity_Positive, - .eVSPP = ePolarity_Positive - }, - .sPanelConf = - { - .eDpiFmt = eDPIFmt_D24, - .eDEP = ePolarity_Positive, - .eDP = ePolarity_Positive, - .eCP = ePolarity_Positive - }, - }, - { - /* eDispLcd_1920x1080 */ - .u32ResolutionWidth = 1920, - .u32ResolutionHeight = 1080, - .sLcdTiming = - { - .u32PCF = 125000000, - .u32HA = 1920, - .u32HSL = 32, - .u32HFP = 120, - .u32HBP = 128, - .u32VA = 1080, - .u32VSL = 14, - .u32VFP = 21, - .u32VBP = 10, - .eHSPP = ePolarity_Positive, - .eVSPP = ePolarity_Positive - }, - .sPanelConf = - { - .eDpiFmt = eDPIFmt_D24, - .eDEP = ePolarity_Positive, - .eDP = ePolarity_Positive, - .eCP = ePolarity_Positive - }, - }, -}; - -static uint32_t DISP_GetBitPerPixel(E_FB_FMT eFbFmt) -{ - uint32_t u32bpp; - - switch (eFbFmt) - { - case eFBFmt_MONOCHROME: - case eFBFmt_R8: - case eFBFmt_INDEX8: - case eFBFmt_NV12: - case eFBFmt_NV16: - u32bpp = 8U; - break; - - case eFBFmt_X4R4G4B4: - case eFBFmt_A4R4G4B4: - case eFBFmt_X1R5G5B5: - case eFBFmt_A1R5G5B5: - case eFBFmt_R5G6B5: - case eFBFmt_YUY2: - case eFBFmt_UYVY: - case eFBFmt_YV12: - case eFBFmt_RG16: - u32bpp = 16U; - break; - - case eFBFmt_INDEX1: - u32bpp = 1U; - break; - - case eFBFmt_INDEX2: - u32bpp = 2U; - break; - - case eFBFmt_INDEX4: - u32bpp = 4U; - break; - - default: - u32bpp = 32U; - break; - } - return u32bpp; -} - -uint64_t DISP_GeneratePixelClk(uint32_t u32PixClkInHz) -{ - uint64_t u64PixClkOut; - - /* Set new VPLL clock frequency. */ - u32PixClkInHz <<= 1U; - u64PixClkOut = CLK_SetPLLFreq(VPLL, PLL_OPMODE_INTEGER, __HXT, (uint64_t)u32PixClkInHz); - - /* Waiting clock ready */ - CLK_WaitClockReady(CLK_STATUS_VPLLSTB_Msk); - - return u64PixClkOut; -} - -void DISP_SuspendPixelClk(void) -{ - /* Stop VPLL forcely. */ - CLK_SetPLLPowerDown(VPLL); -} - -void DISP_SetTiming(DISP_LCD_TIMING *psLCDTiming) -{ - uint32_t u32HEnd, u32HTotal, u32HSyncStart, u32HSyncEnd; - uint32_t u32VEnd, u32VTotal, u32VSyncStart, u32VSyncEnd; - uint32_t u32Value; - - /* Set H- timing */ - u32HEnd = psLCDTiming->u32HA; - u32HTotal = u32HEnd + psLCDTiming->u32HFP + psLCDTiming->u32HBP + psLCDTiming->u32HSL; - u32HSyncStart = u32HEnd + psLCDTiming->u32HFP; - u32HSyncEnd = u32HSyncStart + psLCDTiming->u32HSL; - - u32Value = (u32HTotal << DISP_HDisplay0_TOTAL_Pos) | (u32HEnd << DISP_HDisplay0_DISPLAY_END_Pos); - DISP->HDisplay0 = u32Value; - - u32Value = 0U; - if (psLCDTiming->eHSPP != ePolarity_Disable) - { - u32Value = (psLCDTiming->eHSPP << DISP_HSync0_POLARITY_Pos) | DISP_HSync0_PULSE_Msk; - } - - u32Value |= (u32HSyncEnd << DISP_HSync0_END_Pos) | (u32HSyncStart << DISP_HSync0_START_Pos); - DISP->HSync0 = u32Value; - - /* Set V- timing */ - u32VEnd = psLCDTiming->u32VA; - u32VTotal = u32VEnd + psLCDTiming->u32VFP + psLCDTiming->u32VBP + psLCDTiming->u32VSL; - u32VSyncStart = u32VEnd + psLCDTiming->u32VFP; - u32VSyncEnd = u32VSyncStart + psLCDTiming->u32VSL; - - u32Value = (u32VTotal << DISP_VDisplay0_TOTAL_Pos) | (u32VEnd << DISP_VDisplay0_DISPLAY_END_Pos); - DISP->VDisplay0 = u32Value; - - u32Value = 0U; - if (psLCDTiming->eVSPP != ePolarity_Disable) - { - u32Value = (psLCDTiming->eVSPP << DISP_VSync0_POLARITY_Pos) | DISP_VSync0_PULSE_Msk; - } - - u32Value |= (u32VSyncEnd << DISP_VSync0_END_Pos) | (u32VSyncStart << DISP_VSync0_START_Pos); - DISP->VSync0 = u32Value; -} - -void DISP_SetPanelConf(DISP_PANEL_CONF *psPanelConf) -{ - uint32_t u32Value = 0U; - - if (psPanelConf->eDEP != ePolarity_Disable) - { - u32Value = (psPanelConf->eDEP << DISP_PanelConfig0_DE_POLARITY_Pos) | DISP_PanelConfig0_DE_Msk; - } - - if (psPanelConf->eDP != ePolarity_Disable) - { - u32Value |= ((psPanelConf->eDP << DISP_PanelConfig0_DATA_POLARITY_Pos) | DISP_PanelConfig0_DATA_ENABLE_Msk); - } - - if (psPanelConf->eCP != ePolarity_Disable) - { - u32Value |= ((psPanelConf->eCP << DISP_PanelConfig0_CLOCK_POLARITY_Pos) | DISP_PanelConfig0_CLOCK_Msk); - } - - DISP->DbiConfig0 = 0x00000080U; - DISP->DpiConfig0 = psPanelConf->eDpiFmt << DISP_DpiConfig0_DPI_DATA_FORMAT_Pos; - DISP->PanelConfig0 = u32Value; -} - -int DISP_SetTransparencyMode(E_DISP_LAYER eLayer, E_TRANSPARENCY_MODE eTM) -{ - switch (eLayer) - { - - case eLayer_Video: - DISP->FrameBufferConfig0 &= ~DISP_FrameBufferConfig0_TRANSPARENCY_Msk; - DISP->FrameBufferConfig0 |= (eTM << DISP_FrameBufferConfig0_TRANSPARENCY_Pos); - break; - - case eLayer_Overlay: - DISP->OverlayConfig0 &= ~DISP_OverlayConfig0_TRANSPARENCY_Msk; - DISP->OverlayConfig0 |= (eTM << DISP_OverlayConfig0_TRANSPARENCY_Pos); - break; - - default: - return -1; - } - - return 0; -} - -uint32_t DISP_LCDTIMING_GetFPS(const DISP_LCD_TIMING* psDispLCDTiming) -{ - static uint32_t u32FPS = 0; - - if ( psDispLCDTiming != NULL ) - { - uint32_t u32HTotal, u32VTotal; - - u32HTotal = psDispLCDTiming->u32HA + psDispLCDTiming->u32HBP + psDispLCDTiming->u32HFP + psDispLCDTiming->u32HSL; - u32VTotal = psDispLCDTiming->u32VA + psDispLCDTiming->u32VBP + psDispLCDTiming->u32VFP + psDispLCDTiming->u32VSL; - - u32FPS = psDispLCDTiming->u32PCF / u32HTotal / u32VTotal; - } - - return u32FPS; -} - -int DISP_Trigger(E_DISP_LAYER eLayer, uint32_t u32Action) -{ - switch (eLayer) - { - case eLayer_Video: - if (u32Action) - { - /* Start engine clock. */ - CLK_EnableModuleClock(DCU_MODULE); - - /* Generate Pixel clock */ - DISP_GeneratePixelClk(g_psDispLcdInfo_Curr->sLcdTiming.u32PCF); - - DISP->FrameBufferConfig0 |= DISP_FrameBufferConfig0_OUTPUT_Msk; - } - else - { - DISP->FrameBufferConfig0 &= ~DISP_FrameBufferConfig0_OUTPUT_Msk; - - /* Stop pixel clock. */ - DISP_SuspendPixelClk(); - - /* Stop engine clock. */ - CLK_DisableModuleClock(DCU_MODULE); - } - break; - - case eLayer_Overlay: - if (u32Action) - { - DISP->OverlayConfig0 = (DISP->OverlayConfig0 & ~DISP_OverlayConfig0_ENABLE_Msk) | DISP_OverlayConfig0_ENABLE_Msk; - } - else - { - DISP->OverlayConfig0 &= ~DISP_OverlayConfig0_ENABLE_Msk; - } - break; - - default: - return -1; - } - - return 0; -} - -int DISP_SetBlendOpMode(E_DC_BLEND_MODE eDCBM, E_GLOBAL_ALPHA_MODE eGloAM_Src, E_GLOBAL_ALPHA_MODE eGloAM_Dst) -{ - uint32_t u32Value; - - u32Value = (eGloAM_Dst << DISP_OverlayAlphaBlendConfig0_DST_GLOBAL_ALPHA_MODE_Pos) | - (eGloAM_Src << DISP_OverlayAlphaBlendConfig0_SRC_GLOBAL_ALPHA_MODE_Pos); - - switch (eDCBM) - { - case DC_BLEND_MODE_CLEAR: - u32Value |= (eBM_ZERO << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_ZERO << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - case DC_BLEND_MODE_SRC: - u32Value |= (eBM_ONE << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_ZERO << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - case DC_BLEND_MODE_DST: - u32Value |= (eBM_ZERO << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_ONE << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - case DC_BLEND_MODE_SRC_OVER: - u32Value |= (eBM_ONE << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_INVERSED << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - case DC_BLEND_MODE_DST_OVER: - u32Value |= (eBM_INVERSED << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_ONE << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - case DC_BLEND_MODE_SRC_IN: - u32Value |= (eBM_NORMAL << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_ZERO << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - case DC_BLEND_MODE_DST_IN: - u32Value |= (eBM_ZERO << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_NORMAL << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - case DC_BLEND_MODE_SRC_OUT: - u32Value |= (eBM_INVERSED << DISP_OverlayAlphaBlendConfig0_SRC_BLENDING_MODE_Pos) | - (eBM_ZERO << DISP_OverlayAlphaBlendConfig0_DST_BLENDING_MODE_Pos); - break; - default: - return -1; - } - - DISP->OverlayAlphaBlendConfig0 = u32Value; - - return 0; -} - -void DISP_SetBlendValue(uint32_t u32GloAV_Src, uint32_t u32GloAV_Dst) -{ - DISP->OverlaySrcGlobalColor0 = u32GloAV_Src; - DISP->OverlayDstGlobalColor0 = u32GloAV_Dst; -} - -void DISP_SetColorKeyValue(uint32_t u32ColorKeyLow, uint32_t u32ColorKeyHigh) -{ - DISP->OverlayColorKey0 = u32ColorKeyLow; - DISP->OverlayColorKeyHigh0 = u32ColorKeyHigh; -} - -int DISP_SetFBAddr(E_DISP_LAYER eLayer, uint32_t u32DMAFBStartAddr) -{ - /* Check Start address is 128B alignment. */ - if ((u32DMAFBStartAddr % 128) != 0) - return -1; - - switch (eLayer) - { - case eLayer_Video: - /* Set frame buffer address registers */ - DISP->FrameBufferAddress0 = u32DMAFBStartAddr; - break; - case eLayer_Overlay: - /* Set frame buffer address registers */ - DISP->OverlayAddress0 = u32DMAFBStartAddr; - break; - default: - return -1; - } - return 0; -} - -int DISP_SetFBFmt(E_DISP_LAYER eLayer, E_FB_FMT eFbFmt, uint32_t u32Pitch) -{ - switch (eLayer) - { - case eLayer_Video: - { - uint32_t u32FBConf = DISP->FrameBufferConfig0; - - DISP->FrameBufferConfig0 = 0; - DISP->FrameBufferStride0 = u32Pitch; - u32FBConf = (u32FBConf & ~DISP_FrameBufferConfig0_FORMAT_Msk) | - (eFbFmt << DISP_FrameBufferConfig0_FORMAT_Pos) | - DISP_FrameBufferConfig0_RESET_Msk; - - DISP->FrameBufferConfig0 = u32FBConf; - - break; - } - default: - return -2; - } - - return 0; -} - - -int DISP_SetFBConfig(E_DISP_LAYER eLayer, E_FB_FMT eFbFmt, uint32_t u32ResWidth, uint32_t u32ResHeight, uint32_t u32DMAFBStartAddr) -{ - uint32_t u32bpp; - - /* Check Start address is 128B alignment. */ - if ((u32DMAFBStartAddr % 128) != 0) - return -1; - - u32bpp = DISP_GetBitPerPixel(eFbFmt); - - switch (eLayer) - { - case eLayer_Video: - DISP->FrameBufferUPlanarAddress0 = 0U; - DISP->FrameBufferVPlanarAddress0 = 0U; - DISP->FrameBufferUStride0 = 0U; - DISP->FrameBufferVStride0 = 0U; - DISP->IndexColorTableIndex0 = 0U; - - DISP->FrameBufferSize0 = (u32ResHeight << DISP_FrameBufferSize0_HEIGHT_Pos) | - (u32ResWidth << DISP_FrameBufferSize0_WIDTH_Pos); - - DISP->FrameBufferStride0 = u32ResWidth * (u32bpp >> 3U); - - /* Set frame buffer address registers */ - DISP->FrameBufferAddress0 = u32DMAFBStartAddr; - - DISP->FrameBufferConfig0 = (eFbFmt << DISP_FrameBufferConfig0_FORMAT_Pos) | - (eYUV_709_BT709 << DISP_FrameBufferConfig0_YUV_Pos) | - (DISP_FrameBufferConfig0_RESET_Msk); - - break; - - case eLayer_Overlay: - - DISP->OverlayStride0 = u32ResWidth * (u32bpp >> 3U); - - /* - * eFbFmt is fixed in eFBFmt_A8R8G8B8. - */ - DISP->OverlayConfig0 = (eFBFmt_A8R8G8B8 << DISP_OverlayConfig0_FORMAT_Pos) | - (0 << DISP_OverlayConfig0_SWIZZLE_Pos) | - (0 << DISP_OverlayConfig0_TRANSPARENCY_Pos) | - (eYUV_709_BT709 << DISP_OverlayConfig0_YUV_Pos) | - (0 << DISP_OverlayConfig0_CLEAR_Pos); - - /* Set frame buffer address registers */ - DISP->OverlayAddress0 = u32DMAFBStartAddr; - - DISP->OverlayVStride0 = 0U; - - DISP->OverlayUStride0 = 0U; - DISP->OverlayVStride0 = 0U; - - DISP->OverlaySize0 = (u32ResHeight << DISP_OverlaySize0_HEIGHT_Pos) | - (u32ResWidth << DISP_OverlaySize0_WIDTH_Pos); - - DISP->OverlayTL0 = (0U << DISP_OverlayTL0_Y_Pos) | (0 << DISP_OverlayTL0_X_Pos); - DISP->OverlayBR0 = (u32ResHeight << DISP_OverlayBR0_Y_Pos) | (u32ResWidth << DISP_OverlayBR0_X_Pos); - - /* Default setting */ - DISP_SetBlendOpMode(DC_BLEND_MODE_SRC_OVER, eGloAM_NORMAL, eGloAM_NORMAL); - DISP->OverlayClearValue0 = 0U; - DISP_SetColorKeyValue(0U, 0U); - - DISP->OverlayUPlanarAddress0 = 0U; - DISP->OverlayVPlanarAddress0 = 0U; - - break; - - default: - return -2; - } - - return 0; -} - -int32_t DISP_LCDInit(const DISP_LCD_INFO *psLCDInfo) -{ - vu32 vu32UsDelay = CLK_GetPLLClockFreq(CAPLL) / 1000000; - vu32 vu32Timeout; - DISP_LCD_TIMING *psLCDTiming = (DISP_LCD_TIMING *)&psLCDInfo->sLcdTiming; - DISP_PANEL_CONF *psPanelConf = (DISP_PANEL_CONF *)&psLCDInfo->sPanelConf; - - /* Store to current. */ - g_psDispLcdInfo_Curr = psLCDInfo; - - /* Start engine clock. */ - DISP_SuspendPixelClk(); - - /* Reset */ - SYS->IPRST0 |= SYS_IPRST0_DISPCRST_Msk; - vu32Timeout = 100 * vu32UsDelay; - while (vu32Timeout--); - SYS->IPRST0 &= ~SYS_IPRST0_DISPCRST_Msk; - vu32Timeout = 100 * vu32UsDelay; - while (vu32Timeout--); - - DISP->FrameBufferConfig0 = 0U; - DISP->AQHiClockControl = 0x00071900U; - DISP->AQHiClockControl = 0x00070900U; - - /* Delay 5ms */ - vu32Timeout = 5000 * vu32UsDelay; - while (vu32Timeout--); - - /* Set timing */ - DISP_SetTiming(psLCDTiming); - - /* Set Panel config */ - DISP_SetPanelConf(psPanelConf); - - return 0; -} - -int32_t DISP_LCDDeinit(void) -{ - /* Stop engine clock */ - DISP_SuspendPixelClk(); - - /* Stop engine clock. */ - CLK_DisableModuleClock(DCU_MODULE); - - g_psDispLcdInfo_Curr = NULL; - - return 0; -} - -const DISP_LCD_INFO *DISP_GetLCDInst(E_DISP_LCD eDispLcd) -{ - if (eDispLcd < eDispLcd_Cnt) - return &g_sLcdInfo_arr[eDispLcd]; - - return (const DISP_LCD_INFO *)NULL; -} - -/*@}*/ /* end of group DISP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group DISP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - - - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_eadc.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_eadc.c deleted file mode 100644 index 647e089b21e..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_eadc.c +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************//** - * @file eadc.c - * @brief series EADC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EADC_Driver EADC Driver - @{ -*/ - -/** @addtogroup EADC_EXPORTED_FUNCTIONS EADC Exported Functions - @{ -*/ - -/** - * @brief This function make EADC_module be ready to convert. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32InputMode Decides the input mode. - * - \ref EADC_CTL_DIFFEN_SINGLE_END :Single end input mode. - * - \ref EADC_CTL_DIFFEN_DIFFERENTIAL :Differential input type. - * @return None - * @details This function is used to set analog input mode and enable A/D Converter. - * Before starting A/D conversion function, ADCEN bit (EADC_CTL[0]) should be set to 1. - * @note - */ -void EADC_Open(EADC_T *eadc, uint32_t u32InputMode) -{ - eadc->CTL &= (~EADC_CTL_DIFFEN_Msk); - - eadc->CTL |= (u32InputMode | EADC_CTL_ADCEN_Msk); - while (!(eadc->PWRM & EADC_PWRM_PWUPRDY_Msk)) {} -} - -/** - * @brief Disable EADC_module. - * @param[in] eadc The pointer of the specified EADC module.. - * @return None - * @details Clear ADCEN bit (EADC_CTL[0]) to disable A/D converter analog circuit power consumption. - */ -void EADC_Close(EADC_T *eadc) -{ - eadc->CTL &= ~EADC_CTL_ADCEN_Msk; -} - -/** - * @brief Configure the sample control logic module. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerSrc Decides the trigger source. Valid values are: - * - \ref EADC_SOFTWARE_TRIGGER : Disable trigger - * - \ref EADC_FALLING_EDGE_TRIGGER : STADC pin falling edge trigger - * - \ref EADC_RISING_EDGE_TRIGGER : STADC pin rising edge trigger - * - \ref EADC_FALLING_RISING_EDGE_TRIGGER : STADC pin both falling and rising edge trigger - * - \ref EADC_ADINT0_TRIGGER : EADC ADINT0 interrupt EOC pulse trigger - * - \ref EADC_ADINT1_TRIGGER : EADC ADINT1 interrupt EOC pulse trigger - * - \ref EADC_TIMER0_TRIGGER : Timer0 overflow pulse trigger - * - \ref EADC_TIMER1_TRIGGER : Timer1 overflow pulse trigger - * - \ref EADC_TIMER2_TRIGGER : Timer2 overflow pulse trigger - * - \ref EADC_TIMER3_TRIGGER : Timer3 overflow pulse trigger - * - \ref EADC_EPWM0TG0_TRIGGER : EPWM0TG0 trigger - * - \ref EADC_EPWM0TG1_TRIGGER : EPWM0TG1 trigger - * - \ref EADC_EPWM0TG2_TRIGGER : EPWM0TG2 trigger - * - \ref EADC_EPWM0TG3_TRIGGER : EPWM0TG3 trigger - * - \ref EADC_EPWM0TG4_TRIGGER : EPWM0TG4 trigger - * - \ref EADC_EPWM0TG5_TRIGGER : EPWM0TG5 trigger - * - \ref EADC_EPWM1TG0_TRIGGER : EPWM1TG0 trigger - * - \ref EADC_EPWM1TG1_TRIGGER : EPWM1TG1 trigger - * - \ref EADC_EPWM1TG2_TRIGGER : EPWM1TG2 trigger - * - \ref EADC_EPWM1TG3_TRIGGER : EPWM1TG3 trigger - * - \ref EADC_EPWM1TG4_TRIGGER : EPWM1TG4 trigger - * - \ref EADC_EPWM1TG5_TRIGGER : EPWM1TG5 trigger - * - \ref EADC_BPWM0TG_TRIGGER : BPWM0TG trigger - * - \ref EADC_BPWM1TG_TRIGGER : BPWM1TG trigger - * @param[in] u32Channel Specifies the sample module channel, valid value are from 0 to 15. - * @return None - * @details Each of ADC control logic modules 0~15 which is configurable for ADC converter channel EADC_CH0~15 and trigger source. - * sample module 16~18 is fixed for ADC channel 16, 17, 18 input sources as band-gap voltage, temperature sensor, and battery power (VBAT). - */ -void EADC_ConfigSampleModule(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerSrc, \ - uint32_t u32Channel) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_EXTFEN_Msk | EADC_SCTL_EXTREN_Msk | EADC_SCTL_TRGSEL_Msk | EADC_SCTL_CHSEL_Msk); - eadc->SCTL[u32ModuleNum] |= (u32TriggerSrc | u32Channel); -} - - -/** - * @brief Set trigger delay time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 15. - * @param[in] u32TriggerDelayTime Decides the trigger delay time, valid range are between 0~0xFF. - * @param[in] u32DelayClockDivider Decides the trigger delay clock divider. Valid values are: - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_1 : Trigger delay clock frequency is ADC_CLK/1 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_2 : Trigger delay clock frequency is ADC_CLK/2 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_4 : Trigger delay clock frequency is ADC_CLK/4 - * - \ref EADC_SCTL_TRGDLYDIV_DIVIDER_16 : Trigger delay clock frequency is ADC_CLK/16 - * @return None - * @details User can configure the trigger delay time by setting TRGDLYCNT (EADC_SCTLn[15:8], n=0~15) and TRGDLYDIV (EADC_SCTLn[7:6], n=0~15). - * Trigger delay time = (u32TriggerDelayTime) x Trigger delay clock period. - */ -void EADC_SetTriggerDelayTime(EADC_T *eadc, \ - uint32_t u32ModuleNum, \ - uint32_t u32TriggerDelayTime, \ - uint32_t u32DelayClockDivider) -{ - eadc->SCTL[u32ModuleNum] &= ~(EADC_SCTL_TRGDLYDIV_Msk | EADC_SCTL_TRGDLYCNT_Msk); - eadc->SCTL[u32ModuleNum] |= ((u32TriggerDelayTime << EADC_SCTL_TRGDLYCNT_Pos) | u32DelayClockDivider); -} - -/** - * @brief Set ADC extend sample time. - * @param[in] eadc The pointer of the specified EADC module. - * @param[in] u32ModuleNum Decides the sample module number, valid value are from 0 to 18. - * @param[in] u32ExtendSampleTime Decides the extend sampling time, the range is from 0~255 ADC clock. Valid value are from 0 to 0xFF. - * @return None - * @details When A/D converting at high conversion rate, the sampling time of analog input voltage may not enough if input channel loading is heavy, - * user can extend A/D sampling time after trigger source is coming to get enough sampling time. - */ -void EADC_SetExtendSampleTime(EADC_T *eadc, uint32_t u32ModuleNum, uint32_t u32ExtendSampleTime) -{ - eadc->SCTL[u32ModuleNum] &= ~EADC_SCTL_EXTSMPT_Msk; - - eadc->SCTL[u32ModuleNum] |= (u32ExtendSampleTime << EADC_SCTL_EXTSMPT_Pos); - -} - -/*@}*/ /* end of group EADC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EADC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ebi.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ebi.c deleted file mode 100644 index 5bb90872a93..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ebi.c +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************//** - * @file ebi.c - * @brief External Bus Interface(EBI) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Initialize EBI for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32DataWidth Data bus width. Valid values are: - * - \ref EBI_BUSWIDTH_8BIT - * - \ref EBI_BUSWIDTH_16BIT - * @param[in] u32TimingClass Default timing configuration. Valid values are: - * - \ref EBI_TIMING_FASTEST - * - \ref EBI_TIMING_VERYFAST - * - \ref EBI_TIMING_FAST - * - \ref EBI_TIMING_NORMAL - * - \ref EBI_TIMING_SLOW - * - \ref EBI_TIMING_VERYSLOW - * - \ref EBI_TIMING_SLOWEST - * @param[in] u32BusMode Set EBI bus operate mode. Valid values are: - * - \ref EBI_OPMODE_NORMAL - * - \ref EBI_OPMODE_CACCESS - * - \ref EBI_OPMODE_ADSEPARATE - * @param[in] u32CSActiveLevel CS is active High/Low. Valid values are: - * - \ref EBI_CS_ACTIVE_HIGH - * - \ref EBI_CS_ACTIVE_LOW - * - * @return None - * - * @details This function is used to open specify EBI bank with different bus width, timing setting and \n - * active level of CS pin to access EBI device. - * @note Write Buffer Enable(WBUFEN) and Extend Time Of ALE(TALE) are only available in EBI bank0 control register. - */ -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (uint32_t)u32Bank * 0x10U; - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (uint32_t)u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index0); - volatile uint32_t *pu32EBITCTL = (uint32_t *)(u32Index1); - - if (u32DataWidth == EBI_BUSWIDTH_8BIT) - { - *pu32EBICTL &= ~EBI_CTL_DW16_Msk; - } - else - { - *pu32EBICTL |= EBI_CTL_DW16_Msk; - } - - *pu32EBICTL |= u32BusMode; - - switch (u32TimingClass) - { - case EBI_TIMING_FASTEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_VERYFAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_FAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_NORMAL: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x3U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_SLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_VERYSLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_8 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_SLOWEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk | EBI_CTL_TALE_Msk)) | - (EBI_MCLKDIV_16 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk | - (0x7U << EBI_CTL_TALE_Pos) ; - *pu32EBITCTL = 0x07007738U; - break; - - default: - *pu32EBICTL &= ~EBI_CTL_EN_Msk; - break; - } -} - -/** - * @brief Disable EBI on specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * - * @return None - * - * @details This function is used to close specify EBI function. - */ -void EBI_Close(uint32_t u32Bank) -{ - uint32_t u32Index = (uint32_t)&EBI->CTL0 + u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index); - - *pu32EBICTL &= ~EBI_CTL_EN_Msk; -} - -/** - * @brief Set EBI Bus Timing for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32TimingConfig Configure EBI timing settings, includes TACC, TAHD, W2X and R2R setting. - * @param[in] u32MclkDiv Divider for MCLK. Valid values are: - * - \ref EBI_MCLKDIV_1 - * - \ref EBI_MCLKDIV_2 - * - \ref EBI_MCLKDIV_4 - * - \ref EBI_MCLKDIV_8 - * - \ref EBI_MCLKDIV_16 - * - \ref EBI_MCLKDIV_32 - * - \ref EBI_MCLKDIV_64 - * - \ref EBI_MCLKDIV_128 - * - * @return None - * - * @details This function is used to configure specify EBI bus timing for access EBI device. - */ -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (uint32_t)u32Bank * 0x10U; - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (uint32_t)u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index0); - volatile uint32_t *pu32EBITCTL = (uint32_t *)(u32Index1); - - *pu32EBICTL = (*pu32EBICTL & ~EBI_CTL_MCLKDIV_Msk) | (u32MclkDiv << EBI_CTL_MCLKDIV_Pos); - *pu32EBITCTL = u32TimingConfig; -} - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ecap.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ecap.c deleted file mode 100644 index 2e28c0810ad..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ecap.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file ecap.c - * @brief Enhanced Input Capture Timer (ECAP) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ECAP_Driver ECAP Driver - @{ -*/ - -/** @addtogroup ECAP_EXPORTED_FUNCTIONS ECAP Exported Functions - @{ -*/ - -/** - * @brief Enable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @param[in] u32FuncMask Input capture function select - * - \ref ECAP_DISABLE_COMPARE - * - \ref ECAP_COMPARE_FUNCTION - * @return None - * @details This macro enable input capture function and select compare and reload function. - */ -void ECAP_Open(ECAP_T *ecap, uint32_t u32FuncMask) -{ - /* Clear Input capture mode*/ - ecap->CTL0 = ecap->CTL0 & ~(ECAP_CTL0_CMPEN_Msk); - - /* Enable Input Capture and set mode */ - ecap->CTL0 |= ECAP_CTL0_CAPEN_Msk | (u32FuncMask); -} - - - -/** - * @brief Disable ECAP function - * @param[in] ecap The pointer of the specified ECAP module. - * @return None - * @details This macro disable input capture function. - */ -void ECAP_Close(ECAP_T *ecap) -{ - /* Disable Input Capture*/ - ecap->CTL0 &= ~ECAP_CTL0_CAPEN_Msk; -} - -/** - * @brief This macro is used to enable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel Mask - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will enable the input channel_n interrupt. - */ -void ECAP_EnableINT(ECAP_T *ecap, uint32_t u32Mask) -{ - /* Enable input channel interrupt */ - ecap->CTL0 |= (u32Mask); -} - -/** - * @brief This macro is used to disable input channel interrupt - * @param[in] ecap Specify ECAP port - * @param[in] u32Mask The input channel number - * - \ref ECAP_CTL0_CAPIEN0_Msk - * - \ref ECAP_CTL0_CAPIEN1_Msk - * - \ref ECAP_CTL0_CAPIEN2_Msk - * - \ref ECAP_CTL0_OVIEN_Msk - * - \ref ECAP_CTL0_CMPIEN_Msk - * @return None - * @details This macro will disable the input channel_n interrupt. - */ -void ECAP_DisableINT(ECAP_T *ecap, uint32_t u32Mask) -{ - /* Disable input channel interrupt */ - ecap->CTL0 &= ~(u32Mask); -} - -/*@}*/ /* end of group ECAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ECAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_epwm.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_epwm.c deleted file mode 100644 index c28e78d6471..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_epwm.c +++ /dev/null @@ -1,1616 +0,0 @@ -/**************************************************************************//** - * @file epwm.c - * @brief EPWM driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EPWM_Driver EPWM Driver - @{ -*/ - - -/** @addtogroup EPWM_EXPORTED_FUNCTIONS EPWM Exported Functions - @{ -*/ - -/** - * @brief Configure EPWM capture and get the nearest unit time. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32UnitTimeNsec The unit time of counter - * @param[in] u32CaptureEdge The condition to latch the counter. This parameter is not used - * @return The nearest unit time in nano second. - * @details This function is used to Configure EPWM capture and get the nearest unit time. - */ -uint32_t EPWM_ConfigCaptureChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) -{ - uint32_t u32EPWMClockSrc; - uint32_t u32NearestUnitTimeNsec; - uint32_t u16Prescale = 1U, u16CNR = 0xFFFFU; - - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - u32EPWMClockSrc = CLK_GetPCLK0Freq(); - - u32EPWMClockSrc /= 1000U; - for (u16Prescale = 1U; u16Prescale <= 0x1000U; u16Prescale++) - { - uint32_t u32Exit = 0U; - u32NearestUnitTimeNsec = (1000000U * u16Prescale) / u32EPWMClockSrc; - if (u32NearestUnitTimeNsec < u32UnitTimeNsec) - { - if (u16Prescale == 0x1000U) /* limit to the maximum unit time(nano second) */ - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - if (!((1000000U * (u16Prescale + 1U) > (u32NearestUnitTimeNsec * u32EPWMClockSrc)))) - { - u32Exit = 1U; - } - else - { - u32Exit = 0U; - } - } - else - { - u32Exit = 1U; - } - if (u32Exit == 1U) - { - break; - } - else {} - } - - /* convert to real register value */ - /* every two channels share a prescaler */ - u16Prescale -= 1U; - EPWM_SET_PRESCALER(epwm, u32ChannelNum, u16Prescale); - - /* set EPWM to down count type(edge aligned) */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~(EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1U))) | (1UL << (u32ChannelNum << 1U)); - /* set EPWM to auto-reload mode */ - (epwm)->CTL1 &= ~(EPWM_CTL1_CNTMODE0_Msk << u32ChannelNum); - EPWM_SET_CNR(epwm, u32ChannelNum, u16CNR); - - return (u32NearestUnitTimeNsec); -} - -/** - * @brief This function Configure EPWM generator and get the nearest frequency in edge aligned(up counter type) auto-reload mode - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Frequency Target generator frequency - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... - * @return Nearest frequency clock in nano second - * @note Since every two channels, (0 & 1), (2 & 3), shares a prescaler. Call this API to configure EPWM frequency may affect - * existing frequency of other channel. - * @note This function is used for initial stage. - * To change duty cycle later, it should get the configured period value and calculate the new comparator value. - */ -uint32_t EPWM_ConfigOutputChannel(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32EPWMClockSrc; - uint32_t i; - uint32_t u32Prescale = 1U, u32CNR = 0xFFFFU; - - /* clock source is from PCLK */ - SystemCoreClockUpdate(); - u32EPWMClockSrc = CLK_GetPCLK0Freq(); - - for (u32Prescale = 1U; u32Prescale < 0xFFFU; u32Prescale++) /* prescale could be 0~0xFFF */ - { - i = (u32EPWMClockSrc / u32Frequency) / u32Prescale; - /* If target value is larger than CNR, need to use a larger prescaler */ - if (i < (0x10000U)) - { - u32CNR = i; - break; - } - } - /* Store return value here 'cos we're gonna change u16Prescale & u16CNR to the real value to fill into register */ - i = u32EPWMClockSrc / (u32Prescale * u32CNR); - - /* convert to real register value */ - /* every two channels share a prescaler */ - u32Prescale -= 1U; - EPWM_SET_PRESCALER(epwm, u32ChannelNum, u32Prescale); - /* set EPWM to up counter type(edge aligned) and auto-reload mode */ - (epwm)->CTL1 = ((epwm)->CTL1 & ~((EPWM_CTL1_CNTTYPE0_Msk << (u32ChannelNum << 1U)) | ((1UL << EPWM_CTL1_CNTMODE0_Pos) << u32ChannelNum))); - - u32CNR -= 1U; - EPWM_SET_CNR(epwm, u32ChannelNum, u32CNR); - EPWM_SET_CMR(epwm, u32ChannelNum, u32DutyCycle * (u32CNR + 1U) / 100U); - - (epwm)->WGCTL0 = ((epwm)->WGCTL0 & ~((EPWM_WGCTL0_PRDPCTL0_Msk | EPWM_WGCTL0_ZPCTL0_Msk) << (u32ChannelNum << 1U))) | \ - ((uint32_t)EPWM_OUTPUT_HIGH << ((u32ChannelNum << 1U) + (uint32_t)EPWM_WGCTL0_ZPCTL0_Pos)); - (epwm)->WGCTL1 = ((epwm)->WGCTL1 & ~((EPWM_WGCTL1_CMPDCTL0_Msk | EPWM_WGCTL1_CMPUCTL0_Msk) << (u32ChannelNum << 1U))) | \ - ((uint32_t)EPWM_OUTPUT_LOW << ((u32ChannelNum << 1U) + (uint32_t)EPWM_WGCTL1_CMPUCTL0_Pos)); - - return (i); -} - -/** - * @brief Start EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to start EPWM module. - */ -void EPWM_Start(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN |= u32ChannelMask; -} - -/** - * @brief Stop EPWM module - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM module. - */ -void EPWM_Stop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (epwm)->PERIOD[i] = 0U; - } - } -} - -/** - * @brief Stop EPWM generation immediately by clear channel enable bit - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to stop EPWM generation immediately by clear channel enable bit. - */ -void EPWM_ForceStop(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CNTEN &= ~u32ChannelMask; -} - -/** - * @brief Enable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions: - * - \ref EPWM_TRG_ADC_EVEN_ZERO - * - \ref EPWM_TRG_ADC_EVEN_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_UP - * - \ref EPWM_TRG_ADC_EVEN_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_ODD_ZERO - * - \ref EPWM_TRG_ADC_ODD_PERIOD - * - \ref EPWM_TRG_ADC_ODD_ZERO_PERIOD - * - \ref EPWM_TRG_ADC_ODD_COMPARE_UP - * - \ref EPWM_TRG_ADC_ODD_COMPARE_DOWN - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_0_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_2_FREE_CMP_DOWN - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_UP - * - \ref EPWM_TRG_ADC_CH_4_FREE_CMP_DOWN - * @return None - * @details This function is used to enable selected channel to trigger ADC. - */ -void EPWM_EnableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - if (u32ChannelNum < 4U) - { - (epwm)->EADCTS0 &= ~((EPWM_EADCTS0_TRGSEL0_Msk) << (u32ChannelNum << 3U)); - (epwm)->EADCTS0 |= ((EPWM_EADCTS0_TRGEN0_Msk | u32Condition) << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCTS1 &= ~((EPWM_EADCTS1_TRGSEL4_Msk) << ((u32ChannelNum - 4U) << 3U)); - (epwm)->EADCTS1 |= ((EPWM_EADCTS1_TRGEN4_Msk | u32Condition) << ((u32ChannelNum - 4U) << 3U)); - } -} - -/** - * @brief Disable selected channel to trigger ADC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger ADC. - */ -void EPWM_DisableADCTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - if (u32ChannelNum < 4U) - { - (epwm)->EADCTS0 &= ~(EPWM_EADCTS0_TRGEN0_Msk << (u32ChannelNum << 3U)); - } - else - { - (epwm)->EADCTS1 &= ~(EPWM_EADCTS1_TRGEN4_Msk << ((u32ChannelNum - 4U) << 3U)); - } -} - -/** - * @brief Enable and configure trigger ADC prescale - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32Prescale ADC prescale. Valid values are between 0 to 0xF. - * @param[in] u32PrescaleCnt ADC prescale counter. Valid values are between 0 to 0xF. - * @retval 0 Success. - * @retval -1 Failed. - * @details This function is used to enable and configure trigger ADC prescale. - * @note User can configure only when ADC trigger prescale is disabled. - * @note ADC prescale counter must less than ADC prescale. - */ -int32_t EPWM_EnableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Prescale, uint32_t u32PrescaleCnt) -{ - /* User can write only when PSCENn(n = 0 ~ 5) is 0 */ - if ((epwm)->EADCPSCCTL & (1UL << u32ChannelNum)) - return (-1); - - if (u32ChannelNum < 4UL) - { - (epwm)->EADCPSC0 = ((epwm)->EADCPSC0 & ~((EPWM_EADCPSC0_EADCPSC0_Msk) << (u32ChannelNum << 3))) | \ - (u32Prescale << (u32ChannelNum << 3)); - (epwm)->EADCPSCNT0 = ((epwm)->EADCPSCNT0 & ~((EPWM_EADCPSCNT0_PSCNT0_Msk) << (u32ChannelNum << 3))) | \ - (u32PrescaleCnt << (u32ChannelNum << 3)); - } - else - { - (epwm)->EADCPSC1 = ((epwm)->EADCPSC1 & ~((EPWM_EADCPSC1_EADCPSC4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32Prescale << ((u32ChannelNum - 4UL) << 3)); - (epwm)->EADCPSCNT1 = ((epwm)->EADCPSCNT1 & ~((EPWM_EADCPSCNT1_PSCNT4_Msk) << ((u32ChannelNum - 4UL) << 3))) | \ - (u32PrescaleCnt << ((u32ChannelNum - 4UL) << 3)); - } - - (epwm)->EADCPSCCTL |= EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum; - - return 0; -} - -/** - * @brief Disable Trigger ADC prescale function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable trigger ADC prescale. - */ -void EPWM_DisableADCTriggerPrescale(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->EADCPSCCTL &= ~(EPWM_EADCPSCCTL_PSCEN0_Msk << u32ChannelNum); -} - -/** - * @brief Clear selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition This parameter is not used - * @return None - * @details This function is used to clear selected channel trigger ADC flag. - */ -void EPWM_ClearADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->STATUS = (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum); -} - -/** - * @brief Get selected channel trigger ADC flag - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 The specified channel trigger ADC to start of conversion flag is not set - * @retval 1 The specified channel trigger ADC to start of conversion flag is set - * @details This function is used to get EPWM trigger ADC to start of conversion flag for specified channel. - */ -uint32_t EPWM_GetADCTriggerFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_EADCTRGF0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Enable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Condition The condition to trigger DAC. Combination of following conditions: - * - \ref EPWM_TRIGGER_DAC_ZERO - * - \ref EPWM_TRIGGER_DAC_PERIOD - * - \ref EPWM_TRIGGER_DAC_COMPARE_UP - * - \ref EPWM_TRIGGER_DAC_COMPARE_DOWN - * @return None - * @details This function is used to enable selected channel to trigger DAC. - */ -void EPWM_EnableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Condition) -{ - (epwm)->DACTRGEN |= (u32Condition << u32ChannelNum); -} - -/** - * @brief Disable selected channel to trigger DAC - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable selected channel to trigger DAC. - */ -void EPWM_DisableDACTrigger(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->DACTRGEN &= ~((EPWM_TRIGGER_DAC_ZERO | EPWM_TRIGGER_DAC_PERIOD | EPWM_TRIGGER_DAC_COMPARE_UP | \ - EPWM_TRIGGER_DAC_COMPARE_DOWN) << u32ChannelNum); -} - -/** - * @brief This function enable fault brake of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * @param[in] u32LevelMask Output high or low while fault brake occurs, each bit represent the level of a channel - * while fault brake occurs. Bit 0 represents channel 0, bit 1 represents channel 1... - * @param[in] u32BrakeSource Fault brake source, could be one of following source - * - \ref EPWM_FB_EDGE_ADCRM - * - \ref EPWM_FB_EDGE_ACMP0 - * - \ref EPWM_FB_EDGE_ACMP1 - * - \ref EPWM_FB_EDGE_BKP0 - * - \ref EPWM_FB_EDGE_BKP1 - * - \ref EPWM_FB_EDGE_SYS_CSS - * - \ref EPWM_FB_EDGE_SYS_BOD - * - \ref EPWM_FB_EDGE_SYS_RAM - * - \ref EPWM_FB_EDGE_SYS_COR - * - \ref EPWM_FB_LEVEL_ADCRM - * - \ref EPWM_FB_LEVEL_ACMP0 - * - \ref EPWM_FB_LEVEL_ACMP1 - * - \ref EPWM_FB_LEVEL_BKP0 - * - \ref EPWM_FB_LEVEL_BKP1 - * - \ref EPWM_FB_LEVEL_SYS_CSS - * - \ref EPWM_FB_LEVEL_SYS_BOD - * - \ref EPWM_FB_LEVEL_SYS_RAM - * - \ref EPWM_FB_LEVEL_SYS_COR - * @return None - * @details This function is used to enable fault brake of selected channel(s). - * The write-protection function should be disabled before using this function. - */ -void EPWM_EnableFaultBrake(EPWM_T *epwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource) -{ - uint32_t i; - - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - if ((u32BrakeSource == EPWM_FB_EDGE_SYS_CSS) || (u32BrakeSource == EPWM_FB_EDGE_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_EDGE_SYS_RAM) || (u32BrakeSource == EPWM_FB_EDGE_SYS_COR) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_CSS) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_BOD) || \ - (u32BrakeSource == EPWM_FB_LEVEL_SYS_RAM) || (u32BrakeSource == EPWM_FB_LEVEL_SYS_COR)) - { - (epwm)->BRKCTL[i >> 1U] |= (u32BrakeSource & (EPWM_BRKCTL0_1_SYSEBEN_Msk | EPWM_BRKCTL0_1_SYSLBEN_Msk)); - (epwm)->FAILBRK |= (u32BrakeSource & 0xFU); - } - else - { - (epwm)->BRKCTL[i >> 1U] |= u32BrakeSource; - } - } - - if (u32LevelMask & (1UL << i)) - { - if ((i & 0x1U) == 0U) - { - /* set brake action as high level for even channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3U) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as high level for odd channel */ - (epwm)->BRKCTL[i >> 1] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1] |= ((3U) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - else - { - if ((i & 0x1U) == 0U) - { - /* set brake action as low level for even channel */ - (epwm)->BRKCTL[i >> 1U] &= ~EPWM_BRKCTL0_1_BRKAEVEN_Msk; - (epwm)->BRKCTL[i >> 1U] |= ((2U) << EPWM_BRKCTL0_1_BRKAEVEN_Pos); - } - else - { - /* set brake action as low level for odd channel */ - (epwm)->BRKCTL[i >> 1U] &= ~EPWM_BRKCTL0_1_BRKAODD_Msk; - (epwm)->BRKCTL[i >> 1U] |= ((2U) << EPWM_BRKCTL0_1_BRKAODD_Pos); - } - } - } -} - -/** - * @brief Enable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable capture of selected channel(s). - */ -void EPWM_EnableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN |= u32ChannelMask; - (epwm)->CAPCTL |= u32ChannelMask; -} - -/** - * @brief Disable capture of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable capture of selected channel(s). - */ -void EPWM_DisableCapture(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->CAPINEN &= ~u32ChannelMask; - (epwm)->CAPCTL &= ~u32ChannelMask; -} - -/** - * @brief Enables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... - * @return None - * @details This function is used to enable EPWM output generation of selected channel(s). - */ -void EPWM_EnableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN |= u32ChannelMask; -} - -/** - * @brief Disables EPWM output generation of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel - * Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... - * @return None - * @details This function is used to disable EPWM output generation of selected channel(s). - */ -void EPWM_DisableOutput(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - (epwm)->POEN &= ~u32ChannelMask; -} - -/** - * @brief Enables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @param[in] u32RisingFirst The capture order is rising, falling first. Every two channels share the same setting. Valid values are TRUE and FALSE. - * @param[in] u32Mode Captured data transferred by PDMA interrupt type. It could be either - * - \ref EPWM_CAPTURE_PDMA_RISING_LATCH - * - \ref EPWM_CAPTURE_PDMA_FALLING_LATCH - * - \ref EPWM_CAPTURE_PDMA_RISING_FALLING_LATCH - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - * @note This function can only selects even or odd channel of pairs to do PDMA transfer. - */ -void EPWM_EnablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode) -{ - uint32_t u32IsOddCh; - u32IsOddCh = u32ChannelNum & 0x1U; - (epwm)->PDMACTL = ((epwm)->PDMACTL & ~((EPWM_PDMACTL_CHSEL0_1_Msk | EPWM_PDMACTL_CAPORD0_1_Msk | EPWM_PDMACTL_CAPMOD0_1_Msk) << ((u32ChannelNum >> 1U) << 3U))) | \ - (((u32IsOddCh << EPWM_PDMACTL_CHSEL0_1_Pos) | (u32RisingFirst << EPWM_PDMACTL_CAPORD0_1_Pos) | \ - u32Mode | EPWM_PDMACTL_CHEN0_1_Msk) << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Disables PDMA transfer of selected channel for EPWM capture - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. - * @return None - * @details This function is used to enable PDMA transfer of selected channel(s) for EPWM capture. - */ -void EPWM_DisablePDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->PDMACTL &= ~(EPWM_PDMACTL_CHEN0_1_Msk << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Enable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Duration Dead zone length in EPWM clock count, valid values are between 0~0xFFF, but 0 means there is no Dead zone. - * @return None - * @details This function is used to enable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Duration) -{ - /* every two channels share the same setting */ - (epwm)->DTCTL[(u32ChannelNum) >> 1U] &= ~EPWM_DTCTL0_1_DTCNT_Msk; - (epwm)->DTCTL[(u32ChannelNum) >> 1U] |= EPWM_DTCTL0_1_DTEN_Msk | u32Duration; -} - -/** - * @brief Disable Dead zone of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable Dead zone of selected channel. - * The write-protection function should be disabled before using this function. - */ -void EPWM_DisableDeadZone(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - /* every two channels shares the same setting */ - (epwm)->DTCTL[(u32ChannelNum) >> 1U] &= ~EPWM_DTCTL0_1_DTEN_Msk; -} - -/** - * @brief Enable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to enable capture interrupt of selected channel. - */ -void EPWM_EnableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN |= (u32Edge << u32ChannelNum); -} - -/** - * @brief Disable capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to disable capture interrupt of selected channel. - */ -void EPWM_DisableCaptureInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIEN &= ~(u32Edge << u32ChannelNum); -} - -/** - * @brief Clear capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32Edge Rising or falling edge to latch counter. - * - \ref EPWM_CAPTURE_INT_RISING_LATCH - * - \ref EPWM_CAPTURE_INT_FALLING_LATCH - * @return None - * @details This function is used to clear capture interrupt of selected channel. - */ -void EPWM_ClearCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32Edge) -{ - (epwm)->CAPIF = (u32Edge << u32ChannelNum); -} - -/** - * @brief Get capture interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 No capture interrupt - * @retval 1 Rising edge latch interrupt - * @retval 2 Falling edge latch interrupt - * @retval 3 Rising and falling latch interrupt - * @details This function is used to get capture interrupt of selected channel. - */ -uint32_t EPWM_GetCaptureIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((((epwm)->CAPIF & (EPWM_CAPIF_CFLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL) << 1) | \ - (((epwm)->CAPIF & (EPWM_CAPIF_CRLIF0_Msk << u32ChannelNum)) ? 1UL : 0UL)); -} -/** - * @brief Enable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntDutyType Duty interrupt type, could be either - * - \ref EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP - * - \ref EPWM_DUTY_INT_UP_COUNT_MATCH_CMP - * @return None - * @details This function is used to enable duty interrupt of selected channel. - */ -void EPWM_EnableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) -{ - (epwm)->INTEN0 |= (u32IntDutyType << u32ChannelNum); -} - -/** - * @brief Disable duty interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable duty interrupt of selected channel. - */ -void EPWM_DisableDutyInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((uint32_t)(EPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP | EPWM_DUTY_INT_UP_COUNT_MATCH_CMP) << u32ChannelNum); -} - -/** - * @brief Clear duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear duty interrupt flag of selected channel. - */ -void EPWM_ClearDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = (EPWM_INTSTS0_CMPUIF0_Msk | EPWM_INTSTS0_CMPDIF0_Msk) << u32ChannelNum; -} - -/** - * @brief Get duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Duty interrupt did not occur - * @retval 1 Duty interrupt occurred - * @details This function is used to get duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((EPWM_INTSTS0_CMPDIF0_Msk | EPWM_INTSTS0_CMPUIF0_Msk) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief This function enable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to enable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_EnableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 |= (0x7UL << u32BrakeSource); -} - -/** - * @brief This function disable fault brake interrupt - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to disable fault brake interrupt. - * The write-protection function should be disabled before using this function. - * @note Every two channels share the same setting. - */ -void EPWM_DisableFaultBrakeInt(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTEN1 &= ~(0x7UL << u32BrakeSource); -} - -/** - * @brief This function clear fault brake interrupt of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source. - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return None - * @details This function is used to clear fault brake interrupt of selected source. - * The write-protection function should be disabled before using this function. - */ -void EPWM_ClearFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - (epwm)->INTSTS1 = (0x3fUL << u32BrakeSource); -} - -/** - * @brief This function get fault brake interrupt flag of selected source - * @param[in] epwm The pointer of the specified EPWM module - * @param[in] u32BrakeSource Fault brake source, could be either - * - \ref EPWM_FB_EDGE - * - \ref EPWM_FB_LEVEL - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * @details This function is used to get fault brake interrupt flag of selected source. - */ -uint32_t EPWM_GetFaultBrakeIntFlag(EPWM_T *epwm, uint32_t u32BrakeSource) -{ - return (((epwm)->INTSTS1 & (0x3fUL << u32BrakeSource)) ? 1UL : 0UL); -} - -/** - * @brief Enable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntPeriodType Period interrupt type. This parameter is not used. - * @return None - * @details This function is used to enable period interrupt of selected channel. - */ -void EPWM_EnablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) -{ - (epwm)->INTEN0 |= ((1UL << EPWM_INTEN0_PIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Disable period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable period interrupt of selected channel. - */ -void EPWM_DisablePeriodInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((1UL << EPWM_INTEN0_PIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Clear period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear period interrupt of selected channel. - */ -void EPWM_ClearPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = ((1UL << EPWM_INTSTS0_PIF0_Pos) << u32ChannelNum); -} - -/** - * @brief Get period interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Period interrupt flag of specified channel - * @retval 0 Period interrupt did not occur - * @retval 1 Period interrupt occurred - * @details This function is used to get period interrupt of selected channel. - */ -uint32_t EPWM_GetPeriodIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((1UL << EPWM_INTSTS0_PIF0_Pos) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable zero interrupt of selected channel. - */ -void EPWM_EnableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 |= ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Disable zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable zero interrupt of selected channel. - */ -void EPWM_DisableZeroInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTEN0 &= ~((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Clear zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear zero interrupt of selected channel. - */ -void EPWM_ClearZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->INTSTS0 = ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum); -} - -/** - * @brief Get zero interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Zero interrupt flag of specified channel - * @retval 0 Zero interrupt did not occur - * @retval 1 Zero interrupt occurred - * @details This function is used to get zero interrupt of selected channel. - */ -uint32_t EPWM_GetZeroIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return ((((epwm)->INTSTS0 & ((1UL << EPWM_INTEN0_ZIEN0_Pos) << u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32IntFlagCnt Interrupt flag counter. Valid values are between 0~65535. - * @param[in] u32IntAccSrc Interrupt flag accumulator source selection. - * - \ref EPWM_IFA_ZERO_POINT - * - \ref EPWM_IFA_PERIOD_POINT - * - \ref EPWM_IFA_COMPARE_UP_COUNT_POINT - * - \ref EPWM_IFA_COMPARE_DOWN_COUNT_POINT - * @return None - * @details This function is used to enable interrupt flag accumulator of selected channel. - */ -void EPWM_EnableAcc(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32IntFlagCnt, uint32_t u32IntAccSrc) -{ - (epwm)->IFA[u32ChannelNum] = (((epwm)->IFA[u32ChannelNum] & ~((EPWM_IFA0_IFACNT_Msk | EPWM_IFA0_IFASEL_Msk))) | \ - (EPWM_IFA0_IFAEN_Msk | (u32IntAccSrc << EPWM_IFA0_IFASEL_Pos) | u32IntFlagCnt)); -} - -/** - * @brief Disable interrupt flag accumulator of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to Disable interrupt flag accumulator of selected channel. - */ -void EPWM_DisableAcc(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] = ((epwm)->IFA[u32ChannelNum] & ~(EPWM_IFA0_IFAEN_Msk)); -} - -/** - * @brief Enable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_EnableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_DisableAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTEN &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Clear interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear interrupt flag accumulator interrupt of selected channel. - */ -void EPWM_ClearAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->AINTSTS = (1UL << (u32ChannelNum)); -} - -/** - * @brief Get interrupt flag accumulator interrupt of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @retval 0 Accumulator interrupt did not occur - * @retval 1 Accumulator interrupt occurred - * @details This function is used to Get interrupt flag accumulator interrupt of selected channel. - */ -uint32_t EPWM_GetAccInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->AINTSTS & (1UL << (u32ChannelNum))) ? 1UL : 0UL); -} - -/** - * @brief Enable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_EnableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL |= (1UL << (u32ChannelNum)); -} - -/** - * @brief Disable accumulator PDMA of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable accumulator interrupt trigger PDMA of selected channel. - */ -void EPWM_DisableAccPDMA(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->APDMACTL &= ~(1UL << (u32ChannelNum)); -} - -/** - * @brief Enable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to enable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_EnableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] |= EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Disable interrupt flag accumulator stop mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to disable interrupt flag accumulator stop mode of selected channel. - */ -void EPWM_DisableAccStopMode(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->IFA[u32ChannelNum] &= ~EPWM_IFA0_STPMOD_Msk; -} - -/** - * @brief Clear free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear free trigger duty interrupt flag of selected channel. - */ -void EPWM_ClearFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FTCI = ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1U)); -} - -/** - * @brief Get free trigger duty interrupt flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Duty interrupt flag of specified channel - * @retval 0 Free trigger duty interrupt did not occur - * @retval 1 Free trigger duty interrupt occurred - * @details This function is used to get free trigger duty interrupt flag of selected channel. - */ -uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FTCI & ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1U))) ? 1UL : 0UL); -} - -/** - * @brief Enable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to enable load mode of selected channel. - */ -void EPWM_EnableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 |= (u32LoadMode << u32ChannelNum); -} - -/** - * @brief Disable load mode of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32LoadMode EPWM counter loading mode. - * - \ref EPWM_LOAD_MODE_IMMEDIATE - * - \ref EPWM_LOAD_MODE_WINDOW - * - \ref EPWM_LOAD_MODE_CENTER - * @return None - * @details This function is used to disable load mode of selected channel. - */ -void EPWM_DisableLoadMode(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32LoadMode) -{ - (epwm)->CTL0 &= ~(u32LoadMode << u32ChannelNum); -} - -/** - * @brief Configure synchronization phase of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32SyncSrc EPWM synchronize source selection. - * - \ref EPWM_SYNC_OUT_FROM_SYNCIN_SWSYNC - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_ZERO - * - \ref EPWM_SYNC_OUT_FROM_COUNT_TO_COMPARATOR - * - \ref EPWM_SYNC_OUT_DISABLE - * @param[in] u32Direction Phase direction. Control EPWM counter count decrement or increment after synchronizing. - * - \ref EPWM_PHS_DIR_DECREMENT - * - \ref EPWM_PHS_DIR_INCREMENT - * @param[in] u32StartPhase Synchronous start phase value. Valid values are between 0~65535. - * @return None - * @details This function is used to configure synchronization phase of selected channel. - * @note Every two channels share the same setting. - */ -void EPWM_ConfigSyncPhase(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32SyncSrc, uint32_t u32Direction, uint32_t u32StartPhase) -{ - /* every two channels shares the same setting */ - u32ChannelNum >>= 1U; - (epwm)->SYNC = (((epwm)->SYNC & ~(((3UL << EPWM_SYNC_SINSRC0_Pos) << (u32ChannelNum << 1U)) | ((1UL << EPWM_SYNC_PHSDIR0_Pos) << u32ChannelNum))) | \ - (u32Direction << EPWM_SYNC_PHSDIR0_Pos << u32ChannelNum) | ((u32SyncSrc << EPWM_SYNC_SINSRC0_Pos) << (u32ChannelNum << 1U))); - (epwm)->PHS[(u32ChannelNum)] = u32StartPhase; -} - - -/** - * @brief Enable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to enable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_EnableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC |= ((1UL << EPWM_SYNC_PHSEN0_Pos) << (i >> 1U)); - } - } -} - -/** - * @brief Disable SYNC phase of selected channel(s) - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel. - * Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @details This function is used to disable SYNC phase of selected channel(s). - * @note Every two channels share the same setting. - */ -void EPWM_DisableSyncPhase(EPWM_T *epwm, uint32_t u32ChannelMask) -{ - uint32_t i; - for (i = 0U; i < EPWM_CHANNEL_NUM; i ++) - { - if (u32ChannelMask & (1UL << i)) - { - (epwm)->SYNC &= ~((1UL << EPWM_SYNC_PHSEN0_Pos) << (i >> 1U)); - } - } -} - -/** - * @brief Enable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector. - * The valid value is 0~7. - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM SYNC_IN noise filter function. - */ -void EPWM_EnableSyncNoiseFilter(EPWM_T *epwm, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->SYNC = ((epwm)->SYNC & ~(EPWM_SYNC_SFLTCNT_Msk | EPWM_SYNC_SFLTCSEL_Msk)) | \ - ((u32ClkCnt << EPWM_SYNC_SFLTCNT_Pos) | (u32ClkDivSel << EPWM_SYNC_SFLTCSEL_Pos) | EPWM_SYNC_SNFLTEN_Msk); -} - -/** - * @brief Disable EPWM SYNC_IN noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC_IN noise filter function. - */ -void EPWM_DisableSyncNoiseFilter(EPWM_T *epwm) -{ - (epwm)->SYNC &= ~EPWM_SYNC_SNFLTEN_Msk; -} - -/** - * @brief Enable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to enable EPWM SYNC input pin inverse function. - */ -void EPWM_EnableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC |= EPWM_SYNC_SINPINV_Msk; -} - -/** - * @brief Disable EPWM SYNC input pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @return None - * @details This function is used to Disable EPWM SYNC input pin inverse function. - */ -void EPWM_DisableSyncPinInverse(EPWM_T *epwm) -{ - (epwm)->SYNC &= (~EPWM_SYNC_SINPINV_Msk); -} - -/** - * @brief Set EPWM clock source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @param[in] u32ClkSrcSel EPWM external clock source. - * - \ref EPWM_CLKSRC_EPWM_CLK - * - \ref EPWM_CLKSRC_TIMER0 - * - \ref EPWM_CLKSRC_TIMER1 - * - \ref EPWM_CLKSRC_TIMER2 - * - \ref EPWM_CLKSRC_TIMER3 - * @return None - * @details This function is used to set EPWM clock source. - * @note Every two channels share the same setting. - * @note If the clock source of EPWM counter is selected from TIMERn interrupt events, the TRGEPWM(TIMERn_TRGCTL[1], n=0,1..3) bit must be set as 1. - */ -void EPWM_SetClockSource(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel) -{ - (epwm)->CLKSRC = ((epwm)->CLKSRC & ~(EPWM_CLKSRC_ECLKSRC0_Msk << ((u32ChannelNum >> 1U) << 3U))) | \ - (u32ClkSrcSel << ((u32ChannelNum >> 1U) << 3U)); -} - -/** - * @brief Enable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32ClkCnt SYNC Edge Detector Filter Count. This controls the counter number of edge detector - * @param[in] u32ClkDivSel SYNC Edge Detector Filter Clock Selection. - * - \ref EPWM_NF_CLK_DIV_1 - * - \ref EPWM_NF_CLK_DIV_2 - * - \ref EPWM_NF_CLK_DIV_4 - * - \ref EPWM_NF_CLK_DIV_8 - * - \ref EPWM_NF_CLK_DIV_16 - * - \ref EPWM_NF_CLK_DIV_32 - * - \ref EPWM_NF_CLK_DIV_64 - * - \ref EPWM_NF_CLK_DIV_128 - * @return None - * @details This function is used to enable EPWM brake noise filter function. - */ -void EPWM_EnableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32ClkCnt, uint32_t u32ClkDivSel) -{ - (epwm)->BNF = ((epwm)->BNF & ~((EPWM_BNF_BRK0FCNT_Msk | EPWM_BNF_BRK0NFSEL_Msk) << (u32BrakePinNum << 3U))) | \ - (((u32ClkCnt << EPWM_BNF_BRK0FCNT_Pos) | (u32ClkDivSel << EPWM_BNF_BRK0NFSEL_Pos) | EPWM_BNF_BRK0NFEN_Msk) << (u32BrakePinNum << 3U)); -} - -/** - * @brief Disable EPWM brake noise filter function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake noise filter function. - */ -void EPWM_DisableBrakeNoiseFilter(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0NFEN_Msk << (u32BrakePinNum << 3U)); -} - -/** - * @brief Enable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to enable EPWM brake pin inverse function. - */ -void EPWM_EnableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF |= (EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum << 3U)); -} - -/** - * @brief Disable EPWM brake pin inverse function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @return None - * @details This function is used to disable EPWM brake pin inverse function. - */ -void EPWM_DisableBrakePinInverse(EPWM_T *epwm, uint32_t u32BrakePinNum) -{ - (epwm)->BNF &= ~(EPWM_BNF_BRK0PINV_Msk << (u32BrakePinNum * (uint32_t)EPWM_BNF_BRK1NFEN_Pos)); -} - -/** - * @brief Set EPWM brake pin source - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32BrakePinNum Brake pin selection. Valid values are 0 or 1. - * @param[in] u32SelAnotherModule Select to another module. Valid values are TRUE or FALSE. - * @return None - * @details This function is used to set EPWM brake pin source. - */ -void EPWM_SetBrakePinSource(EPWM_T *epwm, uint32_t u32BrakePinNum, uint32_t u32SelAnotherModule) -{ - (epwm)->BNF = ((epwm)->BNF & ~(EPWM_BNF_BK0SRC_Msk << (u32BrakePinNum << 3U))) | (u32SelAnotherModule << ((uint32_t)EPWM_BNF_BK0SRC_Pos + (u32BrakePinNum << 3U))); -} - -/** - * @brief Set EPWM leading edge blanking function - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32TrigSrcSel Leading edge blanking source selection. - * - \ref EPWM_LEBCTL_SRCEN0 - * - \ref EPWM_LEBCTL_SRCEN2 - * - \ref EPWM_LEBCTL_SRCEN4 - * - \ref EPWM_LEBCTL_SRCEN0_2 - * - \ref EPWM_LEBCTL_SRCEN0_4 - * - \ref EPWM_LEBCTL_SRCEN2_4 - * - \ref EPWM_LEBCTL_SRCEN0_2_4 - * @param[in] u32TrigType Leading edge blanking trigger type. - * - \ref EPWM_LEBCTL_TRGTYPE_RISING - * - \ref EPWM_LEBCTL_TRGTYPE_FALLING - * - \ref EPWM_LEBCTL_TRGTYPE_RISING_OR_FALLING - * @param[in] u32BlankingCnt Leading Edge Blanking Counter. Valid values are between 1~512. - This counter value decides leading edge blanking window size, and this counter clock base is ECLK. - * @param[in] u32BlankingEnable Enable EPWM leading edge blanking function. Valid values are TRUE (ENABLE) or FALSE (DISABLE). - * - \ref FALSE - * - \ref TRUE - * @return None - * @details This function is used to configure EPWM leading edge blanking function that blank the false trigger from ACMP brake source which may cause by EPWM output transition. - * @note EPWM leading edge blanking function is only used for brake source from ACMP. - */ -void EPWM_SetLeadingEdgeBlanking(EPWM_T *epwm, uint32_t u32TrigSrcSel, uint32_t u32TrigType, uint32_t u32BlankingCnt, uint32_t u32BlankingEnable) -{ - (epwm)->LEBCTL = (u32TrigType) | (u32TrigSrcSel) | (u32BlankingEnable); - /* Blanking window size = LEBCNT + 1, so LEBCNT = u32BlankingCnt - 1 */ - (epwm)->LEBCNT = (u32BlankingCnt) - 1U; -} - -/** - * @brief Get the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return Count to max interrupt flag of specified channel - * @retval 0 Count to max interrupt did not occur - * @retval 1 Count to max interrupt occurred - * @details This function is used to get the time-base counter reached its maximum value flag of selected channel. - */ -uint32_t EPWM_GetWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->STATUS & (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum)) ? 1UL : 0UL); -} - -/** - * @brief Clear the time-base counter reached its maximum value flag of selected channel - * @param[in] epwm The pointer of the specified EPWM module - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5 - * @return None - * @details This function is used to clear the time-base counter reached its maximum value flag of selected channel. - */ -void EPWM_ClearWrapAroundFlag(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->STATUS = (EPWM_STATUS_CNTMAXF0_Msk << u32ChannelNum); -} - -/** - * @brief Enable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32AfterPrescaler Fault Detect Clock Source is from prescaler output. Valid values are TRUE (after prescaler) or FALSE (before prescaler). - * @param[in] u32ClkSel Fault Detect Clock Select. - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_1 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_2 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_4 - * - \ref EPWM_FDCTL_FDCKSEL_CLK_DIV_8 - * @return None - * @details This function is used to enable fault detect of selected channel. - */ -void EPWM_EnableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32AfterPrescaler, uint32_t u32ClkSel) -{ - (epwm)->FDEN = ((epwm)->FDEN & ~(EPWM_FDEN_FDCKS0_Msk << (u32ChannelNum))) | \ - ((EPWM_FDEN_FDEN0_Msk | ((u32AfterPrescaler) << EPWM_FDEN_FDCKS0_Pos)) << (u32ChannelNum)); - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & ~EPWM_FDCTL0_FDCKSEL_Msk) | (u32ClkSel); -} - -/** - * @brief Disable fault detect of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect of selected channel. - */ -void EPWM_DisableFaultDetect(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect output of selected channel. - */ -void EPWM_EnableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN &= ~(EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect output of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect output of selected channel. - */ -void EPWM_DisableFaultDetectOutput(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDEN |= (EPWM_FDEN_FDODIS0_Msk << (u32ChannelNum)); -} - -/** - * @brief Enable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32DeglitchSmpCycle Deglitch Sampling Cycle. Valid values are between 0~7. - * @return None - * @details This function is used to enable fault detect deglitch function of selected channel. - */ -void EPWM_EnableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32DeglitchSmpCycle) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_DGSMPCYC_Msk)) | \ - (EPWM_FDCTL0_FDDGEN_Msk | ((u32DeglitchSmpCycle) << EPWM_FDCTL0_DGSMPCYC_Pos)); -} - -/** - * @brief Disable fault detect deglitch function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect deglitch function of selected channel. - */ -void EPWM_DisableFaultDetectDeglitch(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDDGEN_Msk; -} - -/** - * @brief Enable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @param[in] u32MaskCnt Transition mask counter. Valid values are between 0~0x7F. - * @return None - * @details This function is used to enable fault detect mask function of selected channel. - */ -void EPWM_EnableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum, uint32_t u32MaskCnt) -{ - (epwm)->FDCTL[(u32ChannelNum)] = ((epwm)->FDCTL[(u32ChannelNum)] & (~EPWM_FDCTL0_TRMSKCNT_Msk)) | (EPWM_FDCTL0_FDMSKEN_Msk | (u32MaskCnt)); -} - -/** - * @brief Disable fault detect mask function of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect mask function of selected channel. - */ -void EPWM_DisableFaultDetectMask(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDCTL[(u32ChannelNum)] &= ~EPWM_FDCTL0_FDMSKEN_Msk; -} - -/** - * @brief Enable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to enable fault detect interrupt of selected channel. - */ -void EPWM_EnableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN |= (EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Disable fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to disable fault detect interrupt of selected channel. - */ -void EPWM_DisableFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDIEN &= ~(EPWM_FDIEN_FDIEN0_Msk << (u32ChannelNum)); -} - -/** - * @brief Clear fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @return None - * @details This function is used to clear fault detect interrupt of selected channel. - */ -void EPWM_ClearFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - (epwm)->FDSTS = (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum)); -} - -/** - * @brief Get fault detect interrupt of selected channel. - * @param[in] epwm The pointer of the specified EPWM module. - * - EPWM0 : EPWM Group 0 - * - EPWM1 : EPWM Group 1 - * @param[in] u32ChannelNum EPWM channel number. Valid values are between 0~5. - * @retval 0 Fault detect interrupt did not occur. - * @retval 1 Fault detect interrupt occurred. - * @details This function is used to Get fault detect interrupt of selected channel. - */ -uint32_t EPWM_GetFaultDetectInt(EPWM_T *epwm, uint32_t u32ChannelNum) -{ - return (((epwm)->FDSTS & (EPWM_FDSTS_FDIF0_Msk << (u32ChannelNum))) ? 1UL : 0UL); -} - -/*@}*/ /* end of group EPWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EPWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_gpio.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_gpio.c deleted file mode 100644 index 7ea2713ea70..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_gpio.c +++ /dev/null @@ -1,255 +0,0 @@ -/**************************************************************************//** - * @file gpio.c - * @brief GPIO driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Set GPIO operation mode - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * @param[in] u32Mode Operation mode. It could be \n - * GPIO_MODE_INPUT, GPIO_MODE_OUTPUT, GPIO_MODE_OPEN_DRAIN, GPIO_MODE_QUASI. - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if ((u32PinMask & (1ul << i)) == (1ul << i)) - { - port->MODE = (port->MODE & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Enable GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be \n - * GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs) -{ - port->INTTYPE = (port->INTTYPE & ~(1ul << u32Pin)) | (((u32IntAttribs >> 24) & 0xFFUL) << u32Pin); - port->INTEN = (port->INTEN & ~(0x00010001ul << u32Pin)) | ((u32IntAttribs & 0xFFFFFFUL) << u32Pin); -} - - -/** - * @brief Disable GPIO interrupt - * - * @param[in] port GPIO port. It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * - * @return None - * - * @details This function is used to disable specified GPIO pin interrupt. - */ -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin) -{ - port->INTTYPE &= ~(1UL << u32Pin); - port->INTEN &= ~((0x00010001UL) << u32Pin); -} - -/** - * @brief Set GPIO slew rate control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref GPH - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * @param[in] u32Mode Slew rate mode. \ref GPIO_SLEWCTL_NORMAL (maximum 40 MHz at 2.7V) - * \ref GPIO_SLEWCTL_HIGH (maximum 80 MHz at 2.7V) - * \ref GPIO_SLEWCTL_FAST (maximum 100 MHz at 2.7V) - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if (u32PinMask & (1ul << i)) - { - port->SLEWCTL = (port->SLEWCTL & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Set GPIO Pull-up and Pull-down control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref GPH - * @param[in] u32PinMask The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32Mode The pin mode of specified GPIO pin. It could be - * \ref GPIO_PUSEL_DISABLE - * \ref GPIO_PUSEL_PULL_UP - * \ref GPIO_PUSEL_PULL_DOWN - * - * @return None - * - * @details Set the pin mode of specified GPIO pin. - */ -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if (u32PinMask & (1ul << i)) - { - port->PUSEL = (port->PUSEL & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Set GPIO Driving Strength control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref GPH - * @param[in] u32PinMask The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32Driving The pin driving strength of specified GPIO pin. It could be - * \ref 000 = Px.n is minimum deiver strength. - * \ref 111 = Px.n is maximum deiver strength. - * - * @return None - * - * @details Set the driving strength of specified GPIO pin. - */ -void GPIO_SetDrivingCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Driving) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if (u32PinMask & (1ul << i)) - { - volatile uint32_t *pu32DS = &port->DSL + (i / 8); - uint32_t u32Offset = 4 * (i % 8); - *pu32DS = (*pu32DS & ~(0x7ul << u32Offset)) | ((u32Driving & 0x7) << u32Offset); - } - } -} - -uint32_t GPIO_GetDrivingCtl(GPIO_T *port, uint32_t u32PinNo) -{ - volatile uint32_t *pu32DS = &port->DSL + (u32PinNo / 8); - uint32_t u32Offset = 4 * (u32PinNo % 8) ; - return (*pu32DS >> u32Offset) & 0x7; -} - -/** - * @brief Set GPIO Power Mode - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref GPH - * @param[in] u32PinMask The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32PowerMode The pin driving strength of specified GPIO pin. It could be - * \ref 0 = Px.n is 1.8v. - * \ref 1 = Px.n is 3.3v. - * - * @return None - * - * @details Set the power mode of specified GPIO pin. - * Only PB.0~15, PD.1, PE.2~13, PF.0~13, PG.10, PJ.0~11, PK.9~10, PN.10~11 pad voltage can be selected. - */ -void GPIO_SetPowerMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32PowerMode) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if (u32PinMask & (1ul << i)) - { - uint32_t value = port->SPW; - value &= ~(1 << i); - value |= ((u32PowerMode ? 1 : 0) << i); - port->SPW = value; - } - } -} - -uint32_t GPIO_GetPowerMode(GPIO_T *port, uint32_t u32PinNo) -{ - return (port->SPW & (1 << u32PinNo)) >> u32PinNo; -} - -/** - * @brief Set GPIO Input Schmitt Trigger - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref GPH - * @param[in] u32PinMask The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32SchmittTrigger The pin driving strength of specified GPIO pin. It could be - * \ref 0 = Px.n input schmitt trigger function Disabled. - * \ref 1 = Px.n input schmitt trigger function Enabled. - * - * @return None - * - * @details Set the power mode of specified GPIO pin. - * Only PB.0~15, PD.1, PE.2~13, PF.0~13, PG.10, PJ.0~11, PK.9~10, PN.10~11 pad voltage can be selected. - */ -void GPIO_SetSchmittTriggere(GPIO_T *port, uint32_t u32PinMask, uint32_t u32SchmittTrigger) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if (u32PinMask & (1ul << i)) - { - uint32_t value = port->SMTEN; - value &= ~(1 << i); - value |= ((u32SchmittTrigger ? 1 : 0) << i); - port->SMTEN = value; - } - } -} - -uint32_t GPIO_GetSchmittTriggere(GPIO_T *port, uint32_t u32PinNo) -{ - return (port->SMTEN & (1 << u32PinNo)) >> u32PinNo; -} - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2c.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2c.c deleted file mode 100644 index 6baf9e91fbf..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2c.c +++ /dev/null @@ -1,1244 +0,0 @@ -/**************************************************************************//** - * @file i2c.c - * @brief I2C driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ - -/** - * @brief Enable specify I2C Controller and set Clock Divider - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C bus clock in Hz - * - * @return Actual I2C bus clock frequency - * - * @details The function enable the specify I2C Controller and set proper Clock Divider - * in I2C CLOCK DIVIDED REGISTER (I2CLK) according to the target I2C Bus clock. - * I2C Bus clock = PCLK / (4*(divider+1). - * - */ -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - u32Pclk = CLK_GetPCLK0Freq(); - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - /* Enable I2C */ - i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Disable specify I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Reset I2C Controller and disable specify I2C port. - * - */ - -void I2C_Close(I2C_T *i2c) -{ - /* Reset I2C Controller */ - if ((uint32_t)i2c == I2C0_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C0RST_Msk; - } - else if ((uint32_t)i2c == I2C1_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C1RST_Msk; - } - else if ((uint32_t)i2c == I2C2_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C2RST_Msk; - } - else if ((uint32_t)i2c == I2C3_BASE) - { - SYS->IPRST1 |= SYS_IPRST1_I2C3RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2C3RST_Msk; - } - else if ((uint32_t)i2c == I2C4_BASE) - { - SYS->IPRST1 |= SYS_IPRST3_I2C4RST_Pos; - SYS->IPRST1 &= ~SYS_IPRST3_I2C4RST_Pos; - } - else if ((uint32_t)i2c == I2C5_BASE) - { - SYS->IPRST1 |= SYS_IPRST3_I2C5RST_Pos; - SYS->IPRST1 &= ~SYS_IPRST3_I2C5RST_Pos; - } - - /* Disable I2C */ - i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; -} - -/** - * @brief Clear Time-out Counter flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When Time-out flag will be set, use this function to clear I2C Bus Time-out counter flag . - * - */ -void I2C_ClearTimeoutFlag(I2C_T *i2c) -{ - i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; -} - -/** - * @brief Set Control bit of I2C Controller - * - * @param[in] i2c Specify I2C port - * @param[in] u8Start Set I2C START condition - * @param[in] u8Stop Set I2C STOP condition - * @param[in] u8Si Clear SI flag - * @param[in] u8Ack Set I2C ACK bit - * - * @return None - * - * @details The function set I2C Control bit of I2C Bus protocol. - * - */ -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - - if (u8Start) - { - u32Reg |= I2C_CTL_STA; - } - - if (u8Stop) - { - u32Reg |= I2C_CTL_STO; - } - - if (u8Si) - { - u32Reg |= I2C_CTL_SI; - } - - if (u8Ack) - { - u32Reg |= I2C_CTL_AA; - } - - i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; -} - -/** - * @brief Disable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for disable I2C interrupt - * - */ -void I2C_DisableInt(I2C_T *i2c) -{ - i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Enable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for enable I2C interrupt - * - */ -void I2C_EnableInt(I2C_T *i2c) -{ - i2c->CTL0 |= I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Get I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * - * @return The actual I2C Bus clock in Hz - * - * @details To get the actual I2C Bus Clock frequency. - */ -uint32_t I2C_GetBusClockFreq(I2C_T *i2c) -{ - uint32_t u32Divider = i2c->CLKDIV; - uint32_t u32Pclk; - - u32Pclk = CLK_GetPCLK0Freq(); - - return (u32Pclk / ((u32Divider + 1U) << 2U)); -} - -/** - * @brief Set I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C Bus Clock in Hz - * - * @return The actual I2C Bus Clock in Hz - * - * @details To set the actual I2C Bus Clock frequency. - */ -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - u32Pclk = CLK_GetPCLK0Freq(); - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Get Interrupt Flag - * - * @param[in] i2c Specify I2C port - * - * @return I2C interrupt flag status - * - * @details To get I2C Bus interrupt flag. - */ -uint32_t I2C_GetIntFlag(I2C_T *i2c) -{ - uint32_t u32Value; - - if ((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk) - { - u32Value = 1U; - } - else - { - u32Value = 0U; - } - - return u32Value; -} - -/** - * @brief Get I2C Bus Status Code - * - * @param[in] i2c Specify I2C port - * - * @return I2C Status Code - * - * @details To get I2C Bus Status Code. - */ -uint32_t I2C_GetStatus(I2C_T *i2c) -{ - return (i2c->STATUS0); -} - -/** - * @brief Read a Byte from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return I2C Data - * - * @details To read a bytes data from specify I2C port. - */ -uint8_t I2C_GetData(I2C_T *i2c) -{ - return (uint8_t)(i2c->DAT); -} - -/** - * @brief Send a byte to I2C Bus - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data The data to send to I2C bus - * - * @return None - * - * @details This function is used to write a byte to specified I2C port - */ -void I2C_SetData(I2C_T *i2c, uint8_t u8Data) -{ - i2c->DAT = u8Data; -} - -/** - * @brief Set 7-bit Slave Address and GC Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address register (0~3) - * @param[in] u8SlaveAddr 7-bit slave address - * @param[in] u8GCMode Enable/Disable GC mode (I2C_GCMODE_ENABLE / I2C_GCMODE_DISABLE) - * - * @return None - * - * @details This function is used to set 7-bit slave addresses in I2C SLAVE ADDRESS REGISTER (I2CADDR0~3) - * and enable GC Mode. - * - */ -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDR1 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 2: - i2c->ADDR2 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 3: - i2c->ADDR3 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 0: - default: - i2c->ADDR0 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - } -} - -/** - * @brief Configure the mask bits of 7-bit Slave Address - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address mask register (0~3) - * @param[in] u8SlaveAddrMask A byte for slave address mask - * - * @return None - * - * @details This function is used to set 7-bit slave addresses. - * - */ -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDRMSK1 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 2: - i2c->ADDRMSK2 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 3: - i2c->ADDRMSK3 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 0: - default: - i2c->ADDRMSK0 = (uint32_t)u8SlaveAddrMask << 1U; - break; - } -} - -/** - * @brief Enable Time-out Counter Function and support Long Time-out - * - * @param[in] i2c Specify I2C port - * @param[in] u8LongTimeout Configure DIV4 to enable Long Time-out (0/1) - * - * @return None - * - * @details This function enable Time-out Counter function and configure DIV4 to support Long - * Time-out. - * - */ -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) -{ - if (u8LongTimeout) - { - i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; - } - else - { - i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; - } - - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Disable Time-out Counter Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Time-out Counter function in I2CTOC register. - * - */ -void I2C_DisableTimeout(I2C_T *i2c) -{ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Enable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To enable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_EnableWakeup(I2C_T *i2c) -{ - i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_DisableWakeup(I2C_T *i2c) -{ - i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master write a byte data to Slave. - * - */ - -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - - I2C_START(i2c); - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master write multi bytes data to Slave. - * - */ - -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - case 0x28u: - if (u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Send Slave address with write bit */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u32txLen < 1u) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if ((u32txLen < 1u) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] data[] A data array for write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if ((u32txLen < u32wLen) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master to read a byte data from Slave. - * - */ -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify an address(2 bytes) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Addr = 1u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ - u8Ctrl = I2C_CTL_SI; - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write control bit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2s.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2s.c deleted file mode 100644 index f95507f6304..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_i2s.c +++ /dev/null @@ -1,267 +0,0 @@ -/**************************************************************************//** - * @file i2s.c - * @brief I2S driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s); - -/** - * @brief This function make I2S module be ready to transfer. - * @param[in] i2s The pointer of the specified I2S module. - * @return Source clock frequency of I2S peripheral. - * @details - * 0: APLL - * 1: SYSCLK1_DIV2 - */ - -static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s) -{ - uint32_t u32Freq = 0UL, u32ClkSrcSel; - uint32_t u32ClkSelMsk = 0U; - - if (i2s == I2S0) - { - u32ClkSelMsk = CLK_CLKSEL4_I2S0SEL_Msk; - } - else if (i2s == I2S1) - { - u32ClkSelMsk = CLK_CLKSEL4_I2S1SEL_Msk; - } - else - { - return 0U; - } - - /* get I2S selection clock source */ - u32ClkSrcSel = CLK->CLKSEL4 & u32ClkSelMsk; - - switch (u32ClkSrcSel) - { - case CLK_CLKSEL4_I2S0SEL_APLL: - u32Freq = CLK_GetPLLClockFreq(APLL); - break; - - case CLK_CLKSEL4_I2S0SEL_SYSCLK1_DIV2: - u32Freq = CLK_GetSYSCLK1Freq() / 2; - break; - - default: - u32Freq = CLK_GetPLLClockFreq(APLL); - break; - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * The sample rate may not be used from the parameter, it depends on system's clock settings, - * but real sample rate used by system will be returned for reference. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are: - * - \ref I2S_MODE_MASTER - * - \ref I2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are: - * - \ref I2S_DATABIT_8 - * - \ref I2S_DATABIT_16 - * - \ref I2S_DATABIT_24 - * - \ref I2S_DATABIT_32 - * @param[in] u32MonoData: Set audio data to mono or not. Valid values are: - * - \ref I2S_ENABLE_MONO - * - \ref I2S_DISABLE_MONO - * @param[in] u32DataFormat: Data format. This is also used to select I2S or PCM(TDM) function. Valid values are: - * - \ref I2S_FORMAT_I2S - * - \ref I2S_FORMAT_I2S_MSB - * - \ref I2S_FORMAT_I2S_LSB - * - \ref I2S_FORMAT_PCM - * - \ref I2S_FORMAT_PCM_MSB - * - \ref I2S_FORMAT_PCM_LSB - * @return Real sample rate. - */ -uint32_t I2S_Open(I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat) -{ - uint16_t u16Divider; - uint32_t u32BitRate, u32SrcClk; - - /* Reset I2S */ - if (i2s == I2S0) - { - SYS->IPRST1 |= SYS_IPRST1_I2S0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_I2S0RST_Msk; - } - else - { - SYS->IPRST3 |= SYS_IPRST3_I2S1RST_Msk; - SYS->IPRST3 &= ~SYS_IPRST3_I2S1RST_Msk; - } - - i2s->CTL0 = u32MasterSlave | u32WordWidth | u32MonoData | u32DataFormat; - i2s->CTL1 = I2S_FIFO_TX_LEVEL_WORD_8 | I2S_FIFO_RX_LEVEL_WORD_8; - - u32SrcClk = I2S_GetSourceClockFreq(i2s); - - u32BitRate = u32SampleRate * (((u32WordWidth >> 4U) & 0x3U) + 1U) * 16U; - //u16Divider = (uint16_t)((u32SrcClk/u32BitRate) >> 1U) - 1U; - u16Divider = (uint16_t)((((u32SrcClk * 10UL / u32BitRate) >> 1U) + 5UL) / 10UL) - 1U; - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_BCLKDIV_Msk) | ((uint32_t)u16Divider << 8U); - - /* calculate real sample rate */ - u32BitRate = u32SrcClk / (2U * ((uint32_t)u16Divider + 1U)); - u32SampleRate = u32BitRate / ((((u32WordWidth >> 4U) & 0x3U) + 1U) * 16U); - - i2s->CTL0 |= I2S_CTL0_I2SEN_Msk; - - return u32SampleRate; -} - -/** - * @brief Disable I2S function and I2S clock. - * @param[in] i2s is the base address of I2S module. - * @return none - */ -void I2S_Close(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_I2SEN_Msk; -} - -/** - * @brief This function enables the interrupt according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return none - */ -void I2S_EnableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN |= u32Mask; -} - -/** - * @brief This function disables the interrupt according to the mask parameter. - * @param[in] i2s is the base address of I2S module. - * @param[in] u32Mask is the combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * @return none - */ -void I2S_DisableInt(I2S_T *i2s, uint32_t u32Mask) -{ - i2s->IEN &= ~u32Mask; -} - -/** - * @brief Enable MCLK . - * @param[in] i2s is the base address of I2S module. - * @param[in] u32BusClock is the target MCLK clock - * @return Actual MCLK clock - */ -uint32_t I2S_EnableMCLK(I2S_T *i2s, uint32_t u32BusClock) -{ - uint8_t u8Divider; - uint32_t u32SrcClk, u32Reg, u32Clock; - - u32SrcClk = I2S_GetSourceClockFreq(i2s); - if (u32BusClock == u32SrcClk) - { - u8Divider = 0U; - } - else - { - u8Divider = (uint8_t)(u32SrcClk / u32BusClock) >> 1U; - } - - i2s->CLKDIV = (i2s->CLKDIV & ~I2S_CLKDIV_MCLKDIV_Msk) | u8Divider; - - i2s->CTL0 |= I2S_CTL0_MCLKEN_Msk; - - u32Reg = i2s->CLKDIV & I2S_CLKDIV_MCLKDIV_Msk; - - if (u32Reg == 0U) - { - u32Clock = u32SrcClk; - } - else - { - u32Clock = ((u32SrcClk >> 1U) / u32Reg); - } - - return u32Clock; -} - -/** - * @brief Disable MCLK . - * @param[in] i2s is the base address of I2S module. - * @return none - */ -void I2S_DisableMCLK(I2S_T *i2s) -{ - i2s->CTL0 &= ~I2S_CTL0_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_SetFIFO(I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->CTL1 = ((i2s->CTL1 & ~(I2S_CTL1_TXTH_Msk | I2S_CTL1_RXTH_Msk)) | - (u32TxThreshold << I2S_CTL1_TXTH_Pos) | - (u32RxThreshold << I2S_CTL1_RXTH_Pos)); -} - - -/** - * @brief Configure PCM(TDM) function parameters, such as channel width, channel number and sync pulse width - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32ChannelWidth Channel width. Valid values are: - * - \ref I2S_TDM_WIDTH_8BIT - * - \ref I2S_TDM_WIDTH_16BIT - * - \ref I2S_TDM_WIDTH_24BIT - * - \ref I2S_TDM_WIDTH_32BIT - * @param[in] u32ChannelNum Channel number. Valid values are: - * - \ref I2S_TDM_2CH - * - \ref I2S_TDM_4CH - * - \ref I2S_TDM_6CH - * - \ref I2S_TDM_8CH - * @param[in] u32SyncWidth Width for sync pulse. Valid values are: - * - \ref I2S_TDM_SYNC_ONE_BCLK - * - \ref I2S_TDM_SYNC_ONE_CHANNEL - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth) -{ - i2s->CTL0 = ((i2s->CTL0 & ~(I2S_CTL0_TDMCHNUM_Msk | I2S_CTL0_CHWIDTH_Msk | I2S_CTL0_PCMSYNC_Msk)) | - (u32ChannelWidth << I2S_CTL0_CHWIDTH_Pos) | - (u32ChannelNum << I2S_CTL0_TDMCHNUM_Pos) | - (u32SyncWidth << I2S_CTL0_PCMSYNC_Pos)); -} - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_kpi.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_kpi.c deleted file mode 100644 index 435f43cc3ef..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_kpi.c +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************//** - * @file kpi.c - * @brief KPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup KPI_Driver KPI Driver - @{ -*/ - -/** @addtogroup KPI_EXPORTED_FUNCTIONS KPI Exported Functions - @{ -*/ - - -/// @cond HIDDEN_SYMBOLS -#define KPICONF_VALUE 0x00288059 -/// @endcond HIDDEN_SYMBOLS - - -/** - * @brief Open KPI function. - * - * @return TRUE: Success \n - * FALSE: KPI function already open - * - */ -void KPI_Open(KPI_T *kpi, uint32_t u32Row, uint32_t u32Col) -{ - uint32_t u32Reg; - - kpi->KPICONF = 0x0; - kpi->KPI3KCONF = 0x0; - kpi->KPIRSTC = 0x0; - - if (u32Row < 2) - u32Row = 1; - else if (u32Row > 6) - u32Row = 6; - else - u32Row = u32Row - 1; - - if (u32Col < 2) - u32Col = 1; - else if (u32Col > 8) - u32Col = 8; - else - u32Col = u32Col - 1; - - u32Reg = (KPICONF_VALUE | (u32Row << 28) | (u32Col << 24)); - kpi->KPICONF = u32Reg; -} - -/** - * @brief Close KPI function. - * - * @return Successful: Success \n - * kpiNotOpen: KPI function not open - */ -void KPI_Close(KPI_T *kpi) -{ - kpi->KPICONF &= ~KPI_KPICONF_ENKP_Msk; -} - - -/** - * @brief Config KPI scan key timing. - * - * @param[in] u32PreScale: Row Scan Cycle Pre-scale Value. The divided number is from 1 to 256 - * @param[in] u32Debounce: De-bounce Sampling Cycle. The value is from 3 to 13 - * @param[in] u32ScanDelay: Setting delay cycle when row change: - * \ref KPI_ROW_SCAN_DELAY4CLK - * \ref KPI_ROW_SCAN_DELAY8CLK - * \ref KPI_ROW_SCAN_DELAY16CLK - * \ref KPI_ROW_SCAN_DELAY32CLK - * - * @return None - * - */ -void KPI_ConfigKeyScanTiming(KPI_T *kpi, uint32_t u32PreScale, uint32_t u32Debounce, uint32_t u32ScanDelay) -{ - if (u32Debounce < 3) u32Debounce = 3; - if (u32Debounce > 13) u32Debounce = 13; - - kpi->KPICONF &= ~(KPI_KPICONF_PRESCALE_Msk | KPI_KPICONF_DBCLKSEL_Msk | KPI_KPICONF_SCANROWD_Msk); - kpi->KPICONF |= (u32PreScale << KPI_KPICONF_PRESCALE_Pos) | (u32Debounce << KPI_KPICONF_DBCLKSEL_Pos) | - (u32ScanDelay << KPI_KPICONF_SCANROWD_Pos); -} - -/** - * @brief Read KPI Release key Status. - * - * @param[in] u32Key1: \ref KPI_KEY00 ~ \ref KPI_KEY58 - * @param[in] u32Key2: \ref KPI_KEY00 ~ \ref KPI_KEY58 - * @param[in] u32Key3: \ref KPI_KEY00 ~ \ref KPI_KEY58 - * @param[in] u32RSTC: Reset Period Count. The value is from 0 ~ 255. - * - * @return None - */ -void KPI_Set3KeyReset(KPI_T *kpi, uint32_t u32Key1, uint32_t u32Key2, uint32_t u32Key3, uint32_t u32RstCnt) -{ - kpi->KPI3KCONF &= ~(KPI_KPI3KCONF_K30C_Msk | KPI_KPI3KCONF_K30R_Msk | - KPI_KPI3KCONF_K31C_Msk | KPI_KPI3KCONF_K31R_Msk | - KPI_KPI3KCONF_K32C_Msk | KPI_KPI3KCONF_K32R_Msk); - - // Set Key - kpi->KPI3KCONF |= ((u32Key1 / 8) << 3) | (u32Key1 % 8); - kpi->KPI3KCONF |= ((((u32Key1 / 8) << 3) | (u32Key1 % 8)) << 8); - kpi->KPI3KCONF |= ((((u32Key1 / 8) << 3) | (u32Key1 % 16)) << 8); - - // Set Reset Period Count - kpi->KPIRSTC = u32RstCnt; - - // Enable 3Key Reset - kpi->KPI3KCONF |= KPI_KPI3KCONF_EN3KYRST_Msk; -} - -/*@}*/ /* end of group KPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group KPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - - - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_pdma.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_pdma.c deleted file mode 100644 index 3e98dbe14fe..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_pdma.c +++ /dev/null @@ -1,443 +0,0 @@ -/**************************************************************************//** - * @file pdma.c - * @brief PDMA driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - - -/** @addtogroup PDMA_EXPORTED_FUNCTIONS PDMA Exported Functions - @{ -*/ - -/** - * @brief PDMA Open - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable the PDMA channels. - */ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask) -{ - uint32_t i; - - for (i = 0UL; i < PDMA_CH_MAX; i++) - { - if ((1 << i) & u32Mask) - { - pdma->DSCT[i].CTL = 0UL; - } - } - - pdma->CHCTL |= u32Mask; -} - -/** - * @brief PDMA Close - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details This function disable all PDMA channels. - */ -void PDMA_Close(PDMA_T *pdma) -{ - pdma->CHCTL = 0UL; -} - -/** - * @brief Set PDMA Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Width Data width. Valid values are - * - \ref PDMA_WIDTH_8 - * - \ref PDMA_WIDTH_16 - * - \ref PDMA_WIDTH_32 - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected channel data width and transfer count. - */ -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXCNT_Msk | PDMA_DSCT_CTL_TXWIDTH_Msk); - pdma->DSCT[u32Ch].CTL |= (u32Width | ((u32TransCount - 1UL) << PDMA_DSCT_CTL_TXCNT_Pos)); -} - -/** - * @brief Set PDMA Stride Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestLen Destination stride count - * @param[in] u32SrcLen Source stride count - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected stride mode. - */ -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - pdma->STRIDE[u32Ch].ASOCR = ((u32DestLen - 1) << 16) | (u32SrcLen - 1); - pdma->STRIDE[u32Ch].STCR = u32TransCount - 1; -} - -/** - * @brief Set PDMA Repeat - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestInterval Destination address interval count - * @param[in] u32SrcInterval Source address interval count - * @param[in] u32RepeatCount Repeat count - * - * @return None - * - * @details This function set the selected repeat. - */ -void PDMA_SetRepeat(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount) -{ - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - pdma->REPEAT[u32Ch].AICTL = ((u32DestInterval) << 16) | (u32SrcInterval); - pdma->REPEAT[u32Ch].RCNT = u32RepeatCount; -} - -/** - * @brief Set PDMA Transfer Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32SrcAddr Source address - * @param[in] u32SrcCtrl Source control attribute. Valid values are - * - \ref PDMA_SAR_INC - * - \ref PDMA_SAR_FIX - * @param[in] u32DstAddr destination address - * @param[in] u32DstCtrl destination control attribute. Valid values are - * - \ref PDMA_DAR_INC - * - \ref PDMA_DAR_FIX - * - * @return None - * - * @details This function set the selected channel source/destination address and attribute. - */ -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl) -{ - pdma->DSCT[u32Ch].SA = u32SrcAddr; - pdma->DSCT[u32Ch].DA = u32DstAddr; - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_SAINC_Msk | PDMA_DSCT_CTL_DAINC_Msk); - pdma->DSCT[u32Ch].CTL |= (u32SrcCtrl | u32DstCtrl); -} - -/** - * @brief Set PDMA Transfer Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Peripheral The selected peripheral. Valid values are - * - \ref PDMA_MEM - * - \ref PDMA_USB_TX - * - \ref PDMA_USB_RX - * - \ref PDMA_UART0_TX - * - \ref PDMA_UART0_RX - * - \ref PDMA_UART1_TX - * - \ref PDMA_UART1_RX - * - \ref PDMA_UART2_TX - * - \ref PDMA_UART2_RX - * - \ref PDMA_UART3_TX - * - \ref PDMA_UART3_RX - * - \ref PDMA_UART4_TX - * - \ref PDMA_UART4_RX - * - \ref PDMA_UART5_TX - * - \ref PDMA_UART5_RX - * - \ref PDMA_USCI0_TX - * - \ref PDMA_USCI0_RX - * - \ref PDMA_USCI1_TX - * - \ref PDMA_USCI1_RX - * - \ref PDMA_QSPI0_TX - * - \ref PDMA_QSPI0_RX - * - \ref PDMA_SPI0_TX - * - \ref PDMA_SPI0_RX - * - \ref PDMA_SPI1_TX - * - \ref PDMA_SPI1_RX - * - \ref PDMA_SPI2_TX - * - \ref PDMA_SPI2_RX - * - \ref PDMA_SPI3_TX - * - \ref PDMA_SPI3_RX - * - \ref PDMA_EPWM0_P1_RX - * - \ref PDMA_EPWM0_P2_RX - * - \ref PDMA_EPWM0_P3_RX - * - \ref PDMA_EPWM1_P1_RX - * - \ref PDMA_EPWM1_P2_RX - * - \ref PDMA_EPWM1_P3_RX - * - \ref PDMA_I2C0_TX - * - \ref PDMA_I2C0_RX - * - \ref PDMA_I2C1_TX - * - \ref PDMA_I2C1_RX - * - \ref PDMA_I2C2_TX - * - \ref PDMA_I2C2_RX - * - \ref PDMA_I2S0_TX - * - \ref PDMA_I2S0_RX - * - \ref PDMA_TMR0 - * - \ref PDMA_TMR1 - * - \ref PDMA_TMR2 - * - \ref PDMA_TMR3 - * - \ref PDMA_EADC0_RX - * - \ref PDMA_DAC0_TX - * - \ref PDMA_DAC1_TX - * - \ref PDMA_EPWM0_CH0_TX - * - \ref PDMA_EPWM0_CH1_TX - * - \ref PDMA_EPWM0_CH2_TX - * - \ref PDMA_EPWM0_CH3_TX - * - \ref PDMA_EPWM0_CH4_TX - * - \ref PDMA_EPWM0_CH5_TX - * - \ref PDMA_EPWM1_CH0_TX - * - \ref PDMA_EPWM1_CH1_TX - * - \ref PDMA_EPWM1_CH2_TX - * - \ref PDMA_EPWM1_CH3_TX - * - \ref PDMA_EPWM1_CH4_TX - * - \ref PDMA_EPWM1_CH5_TX - * - \ref PDMA_UART6_TX - * - \ref PDMA_UART6_RX - * - \ref PDMA_UART7_TX - * - \ref PDMA_UART7_RX - * - \ref PDMA_EADC1_RX - * @param[in] u32ScatterEn Scatter-gather mode enable - * @param[in] u32DescAddr Scatter-gather descriptor address - * - * @return None - * - * @details This function set the selected channel transfer mode. Include peripheral setting. - */ -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - pau32REQSEL[u32Ch / 4] = (pau32REQSEL[u32Ch / 4] & ~u32REQSEL_Msk) | (u32Peripheral << u32REQSEL_Pos); - - if (u32ScatterEn) - { - pdma->DSCT[u32Ch].NEXT = u32DescAddr; - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_SCATTER; - } - else - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_BASIC; - } - } - else {} -} - -/** - * @brief Set PDMA Burst Type and Size - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32BurstType Burst mode or single mode. Valid values are - * - \ref PDMA_REQ_SINGLE - * - \ref PDMA_REQ_BURST - * @param[in] u32BurstSize Set the size of burst mode. Valid values are - * - \ref PDMA_BURST_128 - * - \ref PDMA_BURST_64 - * - \ref PDMA_BURST_32 - * - \ref PDMA_BURST_16 - * - \ref PDMA_BURST_8 - * - \ref PDMA_BURST_4 - * - \ref PDMA_BURST_2 - * - \ref PDMA_BURST_1 - * - * @return None - * - * @details This function set the selected channel burst type and size. - */ -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXTYPE_Msk | PDMA_DSCT_CTL_BURSIZE_Msk); - pdma->DSCT[u32Ch].CTL |= (u32BurstType | u32BurstSize); -} - -/** - * @brief Enable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable timeout function of the selected channel(s). - */ -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN |= u32Mask; -} - -/** - * @brief Disable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function disable timeout function of the selected channel(s). - */ -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN &= ~u32Mask; -} - -/** - * @brief Set PDMA Timeout Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel, - * @param[in] u32OnOff Enable/disable time out function - * @param[in] u32TimeOutCnt Timeout count - * - * @return None - * - * @details This function set the timeout count. - */ -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32TOC = (__IO uint32_t *)&pdma->TOC0_1; - uint32_t u32TOC_Pos, u32TOC_Msk; - - u32TOC_Pos = (u32Ch % 2) * 16 ; - u32TOC_Msk = PDMA_TOC0_1_TOC0_Msk << u32TOC_Pos; - pau32TOC[u32Ch / 2] = (pau32TOC[u32Ch / 2] & ~u32TOC_Msk) | (u32TimeOutCnt << u32TOC_Pos); - - if (u32OnOff) - pdma->TOUTEN |= (1 << u32Ch); - else - pdma->TOUTEN &= ~(1 << u32Ch); - } - else {} -} - -/** - * @brief Trigger PDMA - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This function trigger the selected channel. - */ -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch) -{ - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk, u32ChReq; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - - u32ChReq = (pau32REQSEL[u32Ch / 4] & u32REQSEL_Msk) >> u32REQSEL_Pos; - - if (u32ChReq == PDMA_MEM) - { - pdma->SWREQ = (1ul << u32Ch); - } - else {} -} - -/** - * @brief Enable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function enable the selected channel interrupt. - */ -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN |= (1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL &= ~PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN |= (1ul << u32Ch); - break; - - default: - break; - } -} - -/** - * @brief Disable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function disable the selected channel interrupt. - */ -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN &= ~(1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN &= ~(1ul << u32Ch); - break; - - default: - break; - } -} - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qei.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qei.c deleted file mode 100644 index a4470a89751..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qei.c +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************//** - * @file qei.c - * @brief Quadrature Encoder Interface (QEI) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QEI_Driver QEI Driver - @{ -*/ - -/** @addtogroup QEI_EXPORTED_FUNCTIONS QEI Exported Functions - @{ -*/ - -/** - * @brief Close QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function reset QEI configuration and stop QEI counting. - */ -void QEI_Close(QEI_T *qei) -{ - /* Reset QEI configuration */ - qei->CTL = (uint32_t)0; -} - -/** - * @brief Disable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function disable QEI specified interrupt. - */ -void QEI_DisableInt(QEI_T *qei, uint32_t u32IntSel) -{ - /* Disable QEI specified interrupt */ - QEI_DISABLE_INT(qei, u32IntSel); -} - -/** - * @brief Enable QEI interrupt - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32IntSel Interrupt type selection. - * - \ref QEI_CTL_DIRIEN_Msk : Direction change interrupt - * - \ref QEI_CTL_OVUNIEN_Msk : Counter overflow or underflow interrupt - * - \ref QEI_CTL_CMPIEN_Msk : Compare-match interrupt - * - \ref QEI_CTL_IDXIEN_Msk : Index detected interrupt - * @return None - * @details This function enable QEI specified interrupt. - */ -void QEI_EnableInt(QEI_T *qei, uint32_t u32IntSel) -{ - /* Enable QEI specified interrupt */ - QEI_ENABLE_INT(qei, u32IntSel); -} - -/** - * @brief Open QEI in specified mode and enable input - * @param[in] qei The pointer of the specified QEI module. - * @param[in] u32Mode QEI counting mode. - * - \ref QEI_CTL_X4_FREE_COUNTING_MODE - * - \ref QEI_CTL_X2_FREE_COUNTING_MODE - * - \ref QEI_CTL_X4_COMPARE_COUNTING_MODE - * - \ref QEI_CTL_X2_COMPARE_COUNTING_MODE - * @param[in] u32Value The counter maximum value in compare-counting mode. - * @return None - * @details This function set QEI in specified mode and enable input. - */ -void QEI_Open(QEI_T *qei, uint32_t u32Mode, uint32_t u32Value) -{ - /* Set QEI function configuration */ - /* Set QEI counting mode */ - /* Enable IDX, QEA and QEB input to QEI controller */ - qei->CTL = (qei->CTL & (~QEI_CTL_MODE_Msk)) | ((u32Mode) | QEI_CTL_CHAEN_Msk | QEI_CTL_CHBEN_Msk | QEI_CTL_IDXEN_Msk); - - /* Set QEI maximum count value in in compare-counting mode */ - qei->CNTMAX = u32Value; -} - -/** - * @brief Start QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function enable QEI function and start QEI counting. - */ -void QEI_Start(QEI_T *qei) -{ - /* Enable QEI controller function */ - qei->CTL |= QEI_CTL_QEIEN_Msk; -} - -/** - * @brief Stop QEI function - * @param[in] qei The pointer of the specified QEI module. - * @return None - * @details This function disable QEI function and stop QEI counting. - */ -void QEI_Stop(QEI_T *qei) -{ - /* Disable QEI controller function */ - qei->CTL &= (~QEI_CTL_QEIEN_Msk); -} - - -/*@}*/ /* end of group QEI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QEI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qspi.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qspi.c deleted file mode 100644 index e9a037a2e4b..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_qspi.c +++ /dev/null @@ -1,788 +0,0 @@ -/**************************************************************************//** - * @file qspi.c - * @brief QSPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ -static uint32_t QSPI_GetSrcClkSetting(QSPI_T *qspi); - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Source clock frequency of QSPI peripheral. - * @details - * 0: APLL - * 1: PCLK0 - */ -static uint32_t QSPI_GetSrcClkSetting(QSPI_T *qspi) -{ - uint32_t u32ClkSrcFreq = 0UL, u32ClkSrcSel; - uint32_t u32ClkSelMsk = 0U, u32ClkSelPos = 0U; - - if (qspi == QSPI0) - { - u32ClkSelMsk = CLK_CLKSEL4_QSPI0SEL_Msk; - u32ClkSelPos = CLK_CLKSEL4_QSPI0SEL_Pos; - } - else if (qspi == QSPI1) - { - u32ClkSelMsk = CLK_CLKSEL4_QSPI1SEL_Msk; - u32ClkSelPos = CLK_CLKSEL4_QSPI1SEL_Pos; - } - else - { - goto Exit_QSPI_GetSrcClkSetting; - } - - u32ClkSrcSel = (CLK->CLKSEL4 & u32ClkSelMsk) >> u32ClkSelPos; - - switch (u32ClkSrcSel) - { - case 0x0U: - /* Clock source is PCLK0 */ - u32ClkSrcFreq = CLK_GetPCLK0Freq(); - break; - case 0x1U: - /* Clock source is APLL */ - u32ClkSrcFreq = CLK_GetPLLClockFreq(APLL); - break; - default: - break; - } - -Exit_QSPI_GetSrcClkSetting: - - return u32ClkSrcFreq; -} - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - */ -static void QSPI_SetSrcClkToPCLK(QSPI_T *qspi) -{ - uint32_t u32ClkSelMsk = 0U, u32ClkSelPos = 0U; - - if (qspi == QSPI0) - { - u32ClkSelMsk = CLK_CLKSEL4_QSPI0SEL_Msk; - u32ClkSelPos = CLK_CLKSEL4_QSPI0SEL_Pos; - } - else if (qspi == QSPI1) - { - u32ClkSelMsk = CLK_CLKSEL4_QSPI1SEL_Msk; - u32ClkSelPos = CLK_CLKSEL4_QSPI1SEL_Pos; - } - - /* Select PCLK as the clock source of QSPI */ - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~u32ClkSelMsk)) | (0x2UL << u32ClkSelPos); -} - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32MasterSlave Decides the QSPI module is operating in master mode or in slave mode. (QSPI_SLAVE, QSPI_MASTER) - * @param[in] u32QSPIMode Decides the transfer timing. (QSPI_MODE_0, QSPI_MODE_1, QSPI_MODE_2, QSPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a QSPI transaction. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI peripheral clock. - * @details By default, the QSPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the QSPI clock divider setting will be 0. - * The actual clock rate may be different from the target QSPI clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the - * actual QSPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the QSPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t QSPI_Open(QSPI_T *qspi, - uint32_t u32MasterSlave, - uint32_t u32QSPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrcFreq = 0U, u32Div, u32HCLKFreq, u32RetValue = 0U; - - if (u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - - if (u32MasterSlave == QSPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetSYSCLK0Freq(); - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - QSPI_SetSrcClkToPCLK(qspi); - } - - /* Check clock source of QSPI */ - u32ClkSrcFreq = QSPI_GetSrcClkSetting(qspi); - - if ((u32BusClock >= u32HCLKFreq) || (u32BusClock >= u32ClkSrcFreq)) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrcFreq; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrcFreq / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrcFreq * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0xFFU) - { - u32Div = 0xFFU; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrcFreq / (0xFFU + 1U)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrcFreq / (u32Div + 1U)); - } - } - } - else /* For slave mode, force the QSPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - - /* Select PCLK as the clock source of QSPI */ - QSPI_SetSrcClkToPCLK(qspi); - - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK0Freq(); - } - - return u32RetValue; -} - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will reset QSPI controller. - */ -void QSPI_Close(QSPI_T *qspi) -{ - /* Reset QSPI */ - if (qspi == QSPI0) - { - SYS->IPRST1 |= SYS_IPRST1_QSPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_QSPI0RST_Msk; - } - else - { - SYS->IPRST2 |= SYS_IPRST2_QSPI1RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_QSPI1RST_Msk; - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI RX FIFO buffer. The RXEMPTY (QSPI_STATUS[8]) will be set to 1. - */ -void QSPI_ClearRxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI TX FIFO buffer. The TXEMPTY (QSPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void QSPI_ClearTxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void QSPI_DisableAutoSS(QSPI_T *qspi) -{ - qspi->SSCTL &= ~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (QSPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (QSPI_SS_ACTIVE_HIGH, QSPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - qspi->SSCTL = (qspi->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | QSPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the QSPI bus clock. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target QSPI bus clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrcFreq, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetSYSCLK0Freq(); - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of QSPI */ - QSPI_SetSrcClkToPCLK(qspi); - } - - /* Check clock source of QSPI */ - u32ClkSrcFreq = QSPI_GetSrcClkSetting(qspi); - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrcFreq; - } - else if (u32BusClock >= u32ClkSrcFreq) - { - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrcFreq; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_qspi = f_qspi_clk_src / (DIVIDER + 1) */ - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrcFreq / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrcFreq * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - qspi->CLKDIV |= QSPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrcFreq / (0xFFU + 1U)); - } - else - { - qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrcFreq / (u32Div + 1U)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - qspi->FIFOCTL = (qspi->FIFOCTL & ~(QSPI_FIFOCTL_TXTH_Msk | QSPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << QSPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << QSPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of QSPI bus clock. Only available in Master mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Actual QSPI bus clock frequency in Hz. - * @details This function will calculate the actual QSPI bus clock rate according to the QSPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t QSPI_GetBusClock(QSPI_T *qspi) -{ - uint32_t u32Div; - uint32_t u32ClkSrcFreq; - - /* Check clock source of QSPI */ - u32ClkSrcFreq = QSPI_GetSrcClkSetting(qspi); - - /* Get DIVIDER setting */ - u32Div = (qspi->CLKDIV & QSPI_CLKDIV_DIVIDER_Msk) >> QSPI_CLKDIV_DIVIDER_Pos; - - /* Return QSPI bus clock rate */ - return (u32ClkSrcFreq / (u32Div + 1U)); -} - -/** - * @brief Enable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL |= QSPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL &= ~QSPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get QSPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = qspi->STATUS & QSPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_UNIT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSINACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVUR_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVBE_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_TXUF_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear QSPI related interrupt flags specified by u32Mask parameter. - */ -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - if (u32Mask & QSPI_UNIT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & QSPI_SSACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & QSPI_SSINACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & QSPI_SLVUR_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & QSPI_SLVBE_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & QSPI_TXUF_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXOV_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get QSPI status. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_BUSY_MASK - * - \ref QSPI_RX_EMPTY_MASK - * - \ref QSPI_RX_FULL_MASK - * - \ref QSPI_TX_EMPTY_MASK - * - \ref QSPI_TX_FULL_MASK - * - \ref QSPI_TXRX_RESET_MASK - * - \ref QSPI_QSPIEN_STS_MASK - * - \ref QSPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = qspi->STATUS & QSPI_STATUS_BUSY_Msk; - /* Check busy status */ - if ((u32Mask & QSPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_BUSY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if ((u32Mask & QSPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if ((u32Mask & QSPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if ((u32Mask & QSPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if ((u32Mask & QSPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if ((u32Mask & QSPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TXRX_RESET_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SPIENSTS_Msk; - /* Check QSPIEN flag */ - if ((u32Mask & QSPI_QSPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_QSPIEN_STS_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SSLINE_Msk; - /* Check QSPIx_SS line status */ - if ((u32Mask & QSPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_rtc.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_rtc.c deleted file mode 100644 index adac9a992d8..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_rtc.c +++ /dev/null @@ -1,731 +0,0 @@ -/**************************************************************************//** - * @file rtc.c - * @brief RTC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @cond HIDDEN_SYMBOLS */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macro, type and constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_GLOBALS - -/*---------------------------------------------------------------------------------------------------------*/ -/* Global file scope (static) variables */ -/*---------------------------------------------------------------------------------------------------------*/ -static volatile uint32_t g_u32hiYear, g_u32loYear, g_u32hiMonth, g_u32loMonth, g_u32hiDay, g_u32loDay; -static volatile uint32_t g_u32hiHour, g_u32loHour, g_u32hiMin, g_u32loMin, g_u32hiSec, g_u32loSec; - -/** @endcond HIDDEN_SYMBOLS */ - - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Initialize RTC module and start counting - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This function is used to: \n - * 1. Write initial key to let RTC start count. \n - * 2. Input parameter indicates start date/time. \n - * 3. User has to make sure that parameters of RTC date/time are reasonable. \n - * @note Null pointer for using default starting date/time. - */ -int32_t RTC_Open(S_RTC_TIME_DATA_T *sPt) -{ - RTC->INIT = RTC_INIT_KEY; - if ((RTC->INIT & RTC_INIT_ACTIVE_Msk) != RTC_INIT_ACTIVE_Msk) - { - uint32_t volatile u32Timeout = 10000000ul; - - RTC->INIT = RTC_INIT_KEY; - while ((u32Timeout > 0) && ((RTC->INIT & RTC_INIT_ACTIVE_Msk) != RTC_INIT_ACTIVE_Msk)) - { - u32Timeout--; - } - if (u32Timeout == 0) return -1; - } - - if (sPt == 0) - { - } - else - { - /* Set RTC date and time */ - RTC_SetDateAndTime(sPt); - } - return 0; -} - -/** - * @brief Disable RTC Clock - * - * @param None - * - * @return None - * - * @details This API will disable RTC peripheral clock and stops RTC counting. - */ -void RTC_Close(void) -{ - CLK->APBCLK0 &= ~CLK_APBCLK0_RTCCKEN_Msk; -} - -/** - * @brief Get Current RTC Date and Time - * - * @param[out] sPt The returned pointer is specified the current RTC value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the current RTC date and time value. - */ -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get [Date digit] data */ - g_u32hiYear = (RTC->CAL & RTC_CAL_TENYEAR_Msk) >> RTC_CAL_TENYEAR_Pos; - g_u32loYear = (RTC->CAL & RTC_CAL_YEAR_Msk) >> RTC_CAL_YEAR_Pos; - g_u32hiMonth = (RTC->CAL & RTC_CAL_TENMON_Msk) >> RTC_CAL_TENMON_Pos; - g_u32loMonth = (RTC->CAL & RTC_CAL_MON_Msk) >> RTC_CAL_MON_Pos; - g_u32hiDay = (RTC->CAL & RTC_CAL_TENDAY_Msk) >> RTC_CAL_TENDAY_Pos; - g_u32loDay = (RTC->CAL & RTC_CAL_DAY_Msk) >> RTC_CAL_DAY_Pos; - - /* Get [Time digit] data */ - g_u32hiHour = (RTC->TIME & RTC_TIME_TENHR_Msk) >> RTC_TIME_TENHR_Pos; - g_u32loHour = (RTC->TIME & RTC_TIME_HR_Msk) >> RTC_TIME_HR_Pos; - g_u32hiMin = (RTC->TIME & RTC_TIME_TENMIN_Msk) >> RTC_TIME_TENMIN_Pos; - g_u32loMin = (RTC->TIME & RTC_TIME_MIN_Msk) >> RTC_TIME_MIN_Pos; - g_u32hiSec = (RTC->TIME & RTC_TIME_TENSEC_Msk) >> RTC_TIME_TENSEC_Pos; - g_u32loSec = (RTC->TIME & RTC_TIME_SEC_Msk) >> RTC_TIME_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10ul); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10ul); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10ul); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21ul) - { - sPt->u32AmPm = RTC_PM; - sPt->u32Hour -= 20ul; - } - else - { - sPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Get RTC Alarm Date and Time - * - * @param[out] sPt The returned pointer is specified the RTC alarm value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the RTC alarm date and time setting. - */ -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get alarm [Date digit] data */ - g_u32hiYear = (REG_RTC_CALM & RTC_CALM_TENYEAR_Msk) >> RTC_CALM_TENYEAR_Pos; - g_u32loYear = (REG_RTC_CALM & RTC_CALM_YEAR_Msk) >> RTC_CALM_YEAR_Pos; - g_u32hiMonth = (REG_RTC_CALM & RTC_CALM_TENMON_Msk) >> RTC_CALM_TENMON_Pos; - g_u32loMonth = (REG_RTC_CALM & RTC_CALM_MON_Msk) >> RTC_CALM_MON_Pos; - g_u32hiDay = (REG_RTC_CALM & RTC_CALM_TENDAY_Msk) >> RTC_CALM_TENDAY_Pos; - g_u32loDay = (REG_RTC_CALM & RTC_CALM_DAY_Msk) >> RTC_CALM_DAY_Pos; - - /* Get alarm [Time digit] data */ - g_u32hiHour = (REG_RTC_TALM & RTC_TALM_TENHR_Msk) >> RTC_TALM_TENHR_Pos; - g_u32loHour = (REG_RTC_TALM & RTC_TALM_HR_Msk) >> RTC_TALM_HR_Pos; - g_u32hiMin = (REG_RTC_TALM & RTC_TALM_TENMIN_Msk) >> RTC_TALM_TENMIN_Pos; - g_u32loMin = (REG_RTC_TALM & RTC_TALM_MIN_Msk) >> RTC_TALM_MIN_Pos; - g_u32hiSec = (REG_RTC_TALM & RTC_TALM_TENSEC_Msk) >> RTC_TALM_TENSEC_Pos; - g_u32loSec = (REG_RTC_TALM & RTC_TALM_SEC_Msk) >> RTC_TALM_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10ul); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10ul); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10ul); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21ul) - { - sPt->u32AmPm = RTC_PM; - sPt->u32Hour -= 20ul; - } - else - { - sPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - - } - else - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Update Current RTC Date and Time - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update current date and time to RTC. - */ -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCAL, u32RegTIME; - - if (sPt == NULL) - { - } - else - { -#if !defined(USE_MA35D1_SUBM) - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == RTC_PM) - { - sPt->u32Hour += 20ul; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } -#endif - - /* Set Day of the Week */ - RTC->WEEKDAY = sPt->u32DayOfWeek; - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Current Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCAL = ((sPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((sPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((sPt->u32Month / 10ul) << 12); - u32RegCAL |= ((sPt->u32Month % 10ul) << 8); - u32RegCAL |= ((sPt->u32Day / 10ul) << 4); - u32RegCAL |= (sPt->u32Day % 10ul); - - u32RegTIME = ((sPt->u32Hour / 10ul) << 20); - u32RegTIME |= ((sPt->u32Hour % 10ul) << 16); - u32RegTIME |= ((sPt->u32Minute / 10ul) << 12); - u32RegTIME |= ((sPt->u32Minute % 10ul) << 8); - u32RegTIME |= ((sPt->u32Second / 10ul) << 4); - u32RegTIME |= (sPt->u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Calender and Time Loading */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC->CAL = (uint32_t)u32RegCAL; - RTC->TIME = (uint32_t)u32RegTIME; - } -} - -/** - * @brief Update RTC Alarm Date and Time - * - * @param[in] sPt Specify the time property and alarm date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update alarm date and time setting to RTC. - */ -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCALM, u32RegTALM; - - if (sPt == NULL) - { - } - else - { -#if !defined(USE_MA35D1_SUBM) - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == RTC_PM) - { - sPt->u32Hour += 20ul; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } -#endif - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Alarm Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCALM = ((sPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((sPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((sPt->u32Month / 10ul) << 12); - u32RegCALM |= ((sPt->u32Month % 10ul) << 8); - u32RegCALM |= ((sPt->u32Day / 10ul) << 4); - u32RegCALM |= (sPt->u32Day % 10ul); - - u32RegTALM = ((sPt->u32Hour / 10ul) << 20); - u32RegTALM |= ((sPt->u32Hour % 10ul) << 16); - u32RegTALM |= ((sPt->u32Minute / 10ul) << 12); - u32RegTALM |= ((sPt->u32Minute % 10ul) << 8); - u32RegTALM |= ((sPt->u32Second / 10ul) << 4); - u32RegTALM |= (sPt->u32Second % 10ul); - - REG_RTC_CALM = (uint32_t)u32RegCALM; - REG_RTC_TALM = (uint32_t)u32RegTALM; - } -} - -/** - * @brief Update RTC Current Date - * - * @param[in] u32Year The year calendar digit of current RTC setting. - * @param[in] u32Month The month calendar digit of current RTC setting. - * @param[in] u32Day The day calendar digit of current RTC setting. - * @param[in] u32DayOfWeek The Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] - * - * @return None - * - * @details This API is used to update current date to RTC. - */ -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek) -{ - uint32_t u32RegCAL; - - u32RegCAL = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((u32Month / 10ul) << 12); - u32RegCAL |= ((u32Month % 10ul) << 8); - u32RegCAL |= ((u32Day / 10ul) << 4); - u32RegCAL |= (u32Day % 10ul); - - /* Set Day of the Week */ - RTC->WEEKDAY = u32DayOfWeek & RTC_WEEKDAY_WEEKDAY_Msk; - - /* Set RTC Calender Loading */ - RTC->CAL = (uint32_t)u32RegCAL; -} - -/** - * @brief Update RTC Current Time - * - * @param[in] u32Hour The hour time digit of current RTC setting. - * @param[in] u32Minute The minute time digit of current RTC setting. - * @param[in] u32Second The second time digit of current RTC setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update current time to RTC. - */ -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTIME; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == RTC_CLOCK_12) && (u32AmPm == RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTIME = ((u32Hour / 10ul) << 20); - u32RegTIME |= ((u32Hour % 10ul) << 16); - u32RegTIME |= ((u32Minute / 10ul) << 12); - u32RegTIME |= ((u32Minute % 10ul) << 8); - u32RegTIME |= ((u32Second / 10ul) << 4); - u32RegTIME |= (u32Second % 10ul); - -#if !defined(USE_MA35D1_SUBM) - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (u32TimeMode == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } -#endif - - RTC->TIME = (uint32_t)u32RegTIME; -} - -/** - * @brief Update RTC Alarm Date - * - * @param[in] u32Year The year calendar digit of RTC alarm setting. - * @param[in] u32Month The month calendar digit of RTC alarm setting. - * @param[in] u32Day The day calendar digit of RTC alarm setting. - * - * @return None - * - * @details This API is used to update alarm date setting to RTC. - */ -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day) -{ - uint32_t u32RegCALM; - - u32RegCALM = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((u32Month / 10ul) << 12); - u32RegCALM |= ((u32Month % 10ul) << 8); - u32RegCALM |= ((u32Day / 10ul) << 4); - u32RegCALM |= (u32Day % 10ul); - - /* Set RTC Alarm Date */ - REG_RTC_CALM = (uint32_t)u32RegCALM; -} - -/** - * @brief Update RTC Alarm Time - * - * @param[in] u32Hour The hour time digit of RTC alarm setting. - * @param[in] u32Minute The minute time digit of RTC alarm setting. - * @param[in] u32Second The second time digit of RTC alarm setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update alarm time setting to RTC. - */ -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTALM; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == RTC_CLOCK_12) && (u32AmPm == RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTALM = ((u32Hour / 10ul) << 20); - u32RegTALM |= ((u32Hour % 10ul) << 16); - u32RegTALM |= ((u32Minute / 10ul) << 12); - u32RegTALM |= ((u32Minute % 10ul) << 8); - u32RegTALM |= ((u32Second / 10ul) << 4); - u32RegTALM |= (u32Second % 10ul); - -#if !defined(USE_MA35D1_SUBM) - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - if (u32TimeMode == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } -#endif - - /* Set RTC Alarm Time */ - REG_RTC_TALM = (uint32_t)u32RegTALM; -} - -/** - * @brief Set RTC Alarm Date Mask Function - * - * @param[in] u8IsTenYMsk 1: enable 10-Year digit alarm mask; 0: disabled. - * @param[in] u8IsYMsk 1: enable 1-Year digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Mon digit alarm mask; 0: disabled. - * @param[in] u8IsTenDMsk 1: enable 10-Day digit alarm mask; 0: disabled. - * @param[in] u8IsDMsk 1: enable 1-Day digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm date mask function. - */ -void RTC_SetAlarmDateMask(uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk) -{ - REG_RTC_CAMSK = ((uint32_t)u8IsTenYMsk << RTC_CAMSK_MTENYEAR_Pos) | - ((uint32_t)u8IsYMsk << RTC_CAMSK_MYEAR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_CAMSK_MTENMON_Pos) | - ((uint32_t)u8IsMMsk << RTC_CAMSK_MMON_Pos) | - ((uint32_t)u8IsTenDMsk << RTC_CAMSK_MTENDAY_Pos) | - ((uint32_t)u8IsDMsk << RTC_CAMSK_MDAY_Pos); -} - -/** - * @brief Set RTC Alarm Time Mask Function - * - * @param[in] u8IsTenHMsk 1: enable 10-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsHMsk 1: enable 1-Hour digit alarm mask; 0: disabled. - * @param[in] u8IsTenMMsk 1: enable 10-Min digit alarm mask; 0: disabled. - * @param[in] u8IsMMsk 1: enable 1-Min digit alarm mask; 0: disabled. - * @param[in] u8IsTenSMsk 1: enable 10-Sec digit alarm mask; 0: disabled. - * @param[in] u8IsSMsk 1: enable 1-Sec digit alarm mask; 0: disabled. - * - * @return None - * - * @details This API is used to enable or disable RTC alarm time mask function. - */ -void RTC_SetAlarmTimeMask(uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk) -{ - REG_RTC_TAMSK = ((uint32_t)u8IsTenHMsk << RTC_TAMSK_MTENHR_Pos) | - ((uint32_t)u8IsHMsk << RTC_TAMSK_MHR_Pos) | - ((uint32_t)u8IsTenMMsk << RTC_TAMSK_MTENMIN_Pos) | - ((uint32_t)u8IsMMsk << RTC_TAMSK_MMIN_Pos) | - ((uint32_t)u8IsTenSMsk << RTC_TAMSK_MTENSEC_Pos) | - ((uint32_t)u8IsSMsk << RTC_TAMSK_MSEC_Pos); -} - -/** - * @brief Get Day of the Week - * - * @param None - * - * @retval 0 Sunday - * @retval 1 Monday - * @retval 2 Tuesday - * @retval 3 Wednesday - * @retval 4 Thursday - * @retval 5 Friday - * @retval 6 Saturday - * - * @details This API is used to get day of the week of current RTC date. - */ -uint32_t RTC_GetDayOfWeek(void) -{ - return (RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk); -} - -/** - * @brief Set RTC Tick Period Time - * - * @param[in] u32TickSelection It is used to set the RTC tick period time for Periodic Time Tick request. \n - * It consists of: - * - \ref RTC_TICK_1_SEC : Time tick is 1 second - * - \ref RTC_TICK_1_2_SEC : Time tick is 1/2 second - * - \ref RTC_TICK_1_4_SEC : Time tick is 1/4 second - * - \ref RTC_TICK_1_8_SEC : Time tick is 1/8 second - * - \ref RTC_TICK_1_16_SEC : Time tick is 1/16 second - * - \ref RTC_TICK_1_32_SEC : Time tick is 1/32 second - * - \ref RTC_TICK_1_64_SEC : Time tick is 1/64 second - * - \ref RTC_TICK_1_128_SEC : Time tick is 1/128 second - * - * @return None - * - * @details This API is used to set RTC tick period time for each tick interrupt. - */ -void RTC_SetTickPeriod(uint32_t u32TickSelection) -{ - REG_RTC_TICK = (REG_RTC_TICK & ~RTC_TICK_TICK_Msk) | u32TickSelection; -} - -/** - * @brief Enable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - * @return None - * - * @details This API is used to enable the specify RTC interrupt function. - */ -void RTC_EnableInt(uint32_t u32IntFlagMask) -{ - REG_RTC_INTEN |= u32IntFlagMask; -} - -/** - * @brief Disable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - * @return None - * - * @details This API is used to disable the specify RTC interrupt function. - */ -void RTC_DisableInt(uint32_t u32IntFlagMask) -{ - REG_RTC_INTEN &= ~u32IntFlagMask; - REG_RTC_INTSTS = u32IntFlagMask; -} - - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sc.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sc.c deleted file mode 100644 index f3286844dde..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sc.c +++ /dev/null @@ -1,368 +0,0 @@ -/**************************************************************************//** - * @file sc.c - * @brief Smartcard(SC) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/* Below are variables used locally by SC driver and does not want to parse by doxygen unless HIDDEN_SYMBOLS is defined */ -/** @cond HIDDEN_SYMBOLS */ -static uint32_t u32CardStateIgnore[SC_INTERFACE_NUM] = {0UL, 0UL}; - -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_FUNCTIONS SC Exported Functions - @{ -*/ - -/** - * @brief This function indicates specified smartcard slot status - * @param[in] sc Base address of smartcard module - * @return Card insert status - * @retval TRUE Card insert - * @retval FALSE Card remove - */ -uint32_t SC_IsCardInserted(SC_T *sc) -{ - uint32_t ret; - /* put conditions into two variable to remove IAR compilation warning */ - uint32_t cond1 = ((sc->STATUS & SC_STATUS_CDPINSTS_Msk) >> SC_STATUS_CDPINSTS_Pos); - uint32_t cond2 = ((sc->CTL & SC_CTL_CDLV_Msk) >> SC_CTL_CDLV_Pos); - - if ((sc == SC0) && (u32CardStateIgnore[0] == 1UL)) - { - ret = (uint32_t)TRUE; - } - else if ((sc == SC1) && (u32CardStateIgnore[1] == 1UL)) - { - ret = (uint32_t)TRUE; - } - else if (cond1 != cond2) - { - ret = (uint32_t)FALSE; - } - else - { - ret = (uint32_t)TRUE; - } - return ret; -} - -/** - * @brief This function reset both transmit and receive FIFO of specified smartcard module - * @param[in] sc Base address of smartcard module - * @return None - */ -void SC_ClearFIFO(SC_T *sc) -{ - while (sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk); -} - -/** - * @brief This function disable specified smartcard module - * @param[in] sc Base address of smartcard module - * @return None - */ -void SC_Close(SC_T *sc) -{ - sc->INTEN = 0UL; - while (sc->PINCTL & SC_PINCTL_SYNC_Msk) - { - ; - } - sc->PINCTL = 0UL; - sc->ALTCTL = 0UL; - while (sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - sc->CTL = 0UL; -} - -/** - * @brief This function initialized smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32CardDet Card detect polarity, select the CD pin state which indicates card absent. Could be - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * -\ref SC_PIN_STATE_IGNORE, no card detect pin, always assumes card present - * @param[in] u32PWR Power on polarity, select the PWR pin state which could set smartcard VCC to high level. Could be - * -\ref SC_PIN_STATE_HIGH - * -\ref SC_PIN_STATE_LOW - * @return None - */ -void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR) -{ - uint32_t u32Reg = 0UL, u32Intf; - - if (sc == SC0) - { - u32Intf = 0UL; - } - else - { - u32Intf = 1UL; - } - - if (u32CardDet != SC_PIN_STATE_IGNORE) - { - u32Reg = u32CardDet ? 0UL : SC_CTL_CDLV_Msk; - u32CardStateIgnore[u32Intf] = 0UL; - } - else - { - u32CardStateIgnore[u32Intf] = 1UL; - } - sc->PINCTL = u32PWR ? 0UL : SC_PINCTL_PWRINV_Msk; - while (sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_TMRSEL_Msk | u32Reg; -} - -/** - * @brief This function reset specified smartcard module to its default state for activate smartcard - * @param[in] sc Base address of smartcard module - * @return None - */ -void SC_ResetReader(SC_T *sc) -{ - uint32_t u32Intf; - - if (sc == SC0) - { - u32Intf = 0UL; - } - else - { - u32Intf = 1UL; - } - - /* Reset FIFO, enable auto de-activation while card removal */ - sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk | SC_ALTCTL_ADACEN_Msk); - /* Set Rx trigger level to 1 character, longest card detect debounce period, disable error retry (EMV ATR does not use error retry) */ - while (sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - sc->CTL &= ~(SC_CTL_RXTRGLV_Msk | - SC_CTL_CDDBSEL_Msk | - SC_CTL_TXRTY_Msk | - SC_CTL_TXRTYEN_Msk | - SC_CTL_RXRTY_Msk | - SC_CTL_RXRTYEN_Msk); - while (sc->CTL & SC_CTL_SYNC_Msk) - { - ; - } - /* Enable auto convention, and all three smartcard internal timers */ - sc->CTL |= SC_CTL_AUTOCEN_Msk | SC_CTL_TMRSEL_Msk; - /* Disable Rx timeout */ - sc->RXTOUT = 0UL; - /* 372 clocks per ETU by default */ - sc->ETUCTL = 371UL; - - - /* Enable necessary interrupt for smartcard operation */ - if (u32CardStateIgnore[u32Intf]) /* Do not enable card detect interrupt if card present state ignore */ - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_ACERRIEN_Msk); - } - else - { - sc->INTEN = (SC_INTEN_RDAIEN_Msk | - SC_INTEN_TERRIEN_Msk | - SC_INTEN_TMR0IEN_Msk | - SC_INTEN_TMR1IEN_Msk | - SC_INTEN_TMR2IEN_Msk | - SC_INTEN_BGTIEN_Msk | - SC_INTEN_CDIEN_Msk | - SC_INTEN_ACERRIEN_Msk); - } - return; -} - -/** - * @brief This function block guard time (BGT) of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32BGT Block guard time using ETU as unit, valid range are between 1 ~ 32 - * @return None - */ -void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT) -{ - sc->CTL = (sc->CTL & ~SC_CTL_BGT_Msk) | ((u32BGT - 1UL) << SC_CTL_BGT_Pos); -} - -/** - * @brief This function character guard time (CGT) of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32CGT Character guard time using ETU as unit, valid range are between 11 ~ 267 - * @return None - */ -void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT) -{ - u32CGT -= sc->CTL & SC_CTL_NSB_Msk ? 11UL : 12UL; - sc->EGT = u32CGT; -} - -/** - * @brief This function stop all smartcard timer of specified smartcard module - * @param[in] sc Base address of smartcard module - * @return None - * @note This function stop the timers within smartcard module, \b not timer module - */ -void SC_StopAllTimer(SC_T *sc) -{ - while (sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - sc->ALTCTL &= ~(SC_ALTCTL_CNTEN0_Msk | SC_ALTCTL_CNTEN1_Msk | SC_ALTCTL_CNTEN2_Msk); -} - -/** - * @brief This function configure and start a smartcard timer of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32TimerNum Timer to start. Valid values are 0, 1, 2. - * @param[in] u32Mode Timer operating mode, valid values are: - * - \ref SC_TMR_MODE_0 - * - \ref SC_TMR_MODE_1 - * - \ref SC_TMR_MODE_2 - * - \ref SC_TMR_MODE_3 - * - \ref SC_TMR_MODE_4 - * - \ref SC_TMR_MODE_5 - * - \ref SC_TMR_MODE_6 - * - \ref SC_TMR_MODE_7 - * - \ref SC_TMR_MODE_8 - * - \ref SC_TMR_MODE_F - * @param[in] u32ETUCount Timer timeout duration, ETU based. For timer 0, valid range are between 1~0x1000000ETUs. - * For timer 1 and timer 2, valid range are between 1 ~ 0x100 ETUs - * @return None - * @note This function start the timer within smartcard module, \b not timer module - * @note Depend on the timer operating mode, timer may not start counting immediately - */ -void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount) -{ - uint32_t reg = u32Mode | (SC_TMRCTL0_CNT_Msk & (u32ETUCount - 1UL)); - while (sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - if (u32TimerNum == 0UL) - { - while (sc->TMRCTL0 & SC_TMRCTL0_SYNC_Msk) - { - ; - } - sc->TMRCTL0 = reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN0_Msk; - } - else if (u32TimerNum == 1UL) - { - while (sc->TMRCTL1 & SC_TMRCTL1_SYNC_Msk) - { - ; - } - sc->TMRCTL1 = reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - while (sc->TMRCTL2 & SC_TMRCTL2_SYNC_Msk) - { - ; - } - sc->TMRCTL2 = reg; - sc->ALTCTL |= SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief This function stop a smartcard timer of specified smartcard module - * @param[in] sc Base address of smartcard module - * @param[in] u32TimerNum Timer to stop. Valid values are 0, 1, 2. - * @return None - * @note This function stop the timer within smartcard module, \b not timer module - */ -void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum) -{ - while (sc->ALTCTL & SC_ALTCTL_SYNC_Msk) - { - ; - } - if (u32TimerNum == 0UL) - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN0_Msk; - } - else if (u32TimerNum == 1UL) - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN1_Msk; - } - else /* timer 2 */ - { - sc->ALTCTL &= ~SC_ALTCTL_CNTEN2_Msk; - } -} - -/** - * @brief This function gets smartcard clock frequency. - * @param[in] sc Base address of smartcard module - * @return Smartcard frequency in kHz - */ -uint32_t SC_GetInterfaceClock(SC_T *sc) -{ - uint32_t u32ClkSrc, u32Num, u32Clk; - - if (sc == SC0) - { - u32Num = 0UL; - } - else - { - u32Num = 1UL; - } - - u32ClkSrc = CLK->CLKSEL4 >> (u32Num + CLK_CLKSEL4_SC0SEL_Pos); - - /* Get smartcard module clock */ - if (u32ClkSrc == 0UL) - { - u32Clk = __HXT; - } - else - { - u32Clk = CLK_GetPCLK3Freq(); - } - - u32Clk /= (((CLK->CLKDIV1 >> (4UL * u32Num)) & CLK_CLKDIV1_SC0DIV_Msk) + 1UL) * 1000UL;; - - return u32Clk; -} - -/*@}*/ /* end of group SC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_scuart.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_scuart.c deleted file mode 100644 index 7af435253ce..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_scuart.c +++ /dev/null @@ -1,222 +0,0 @@ -/**************************************************************************//** - * @file scuart.c - * @brief Smartcard UART mode (SCUART) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -static uint32_t SCUART_GetClock(SC_T *sc); - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/** - * @brief The function is used to disable smartcard interface UART mode. - * @param sc The base address of smartcard module. - * @return None - */ -void SCUART_Close(SC_T *sc) -{ - sc->INTEN = 0UL; - sc->UARTCTL = 0UL; - sc->CTL = 0UL; - -} -/** @cond HIDDEN_SYMBOLS */ -/** - * @brief This function returns module clock of specified SC interface - * @param[in] sc The base address of smartcard module. - * @return Module clock of specified SC interface - */ -static uint32_t SCUART_GetClock(SC_T *sc) -{ - uint32_t u32ClkSrc, u32Num, u32Clk; - - if (sc == SC0) - { - u32Num = 0UL; - } - else - { - u32Num = 1UL; - } - - u32ClkSrc = CLK->CLKSEL4 >> (u32Num + CLK_CLKSEL4_SC0SEL_Msk); - - /* Get smartcard module clock */ - if (u32ClkSrc == 0UL) - { - u32Clk = __HXT; - } - else - { - u32Clk = CLK_GetPCLK3Freq(); - } - - - u32Clk /= (((CLK->CLKDIV1 >> (4UL * u32Num)) & CLK_CLKDIV1_SC0DIV_Msk) + 1UL); - - - return u32Clk; -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief This function use to enable smartcard module UART mode and set baudrate. - * @param[in] sc The base address of smartcard module. - * @param[in] u32baudrate Target baudrate of smartcard module. - * @return Actual baudrate of smartcard mode - * @details This function configures character width to 8 bits, 1 stop bit, and no parity. - * And can use \ref SCUART_SetLineConfig function to update these settings - * The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_Open(SC_T *sc, uint32_t u32baudrate) -{ - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - /* Calculate divider for target baudrate */ - u32Div = (u32Clk + (u32baudrate >> 1) - 1UL) / u32baudrate - 1UL; - - /* Enable smartcard interface and stop bit = 1 */ - sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk; - /* Enable UART mode, disable parity and 8 bit per character */ - sc->UARTCTL = SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk; - sc->ETUCTL = u32Div; - - return (u32Clk / (u32Div + 1UL)); -} - -/** - * @brief The function is used to read Rx data from RX FIFO. - * @param[in] sc The base address of smartcard module. - * @param[in] pu8RxBuf The buffer to store receive the data - * @param[in] u32ReadBytes Target number of characters to receive - * @return Actual character number reads to buffer - * @note This function does not block and return immediately if there's no data available - */ -uint32_t SCUART_Read(SC_T *sc, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count; - - for (u32Count = 0UL; u32Count < u32ReadBytes; u32Count++) - { - if (SCUART_GET_RX_EMPTY(sc)) /* no data available */ - { - break; - } - pu8RxBuf[u32Count] = (uint8_t)SCUART_READ(sc); /* get data from FIFO */ - } - - return u32Count; -} - -/** - * @brief This function use to configure smartcard UART mode line setting. - * @param[in] sc The base address of smartcard module. - * @param[in] u32Baudrate Target baudrate of smartcard module. If this value is 0, UART baudrate will not change. - * @param[in] u32DataWidth The data length, could be - * - \ref SCUART_CHAR_LEN_5 - * - \ref SCUART_CHAR_LEN_6 - * - \ref SCUART_CHAR_LEN_7 - * - \ref SCUART_CHAR_LEN_8 - * @param[in] u32Parity The parity setting, could be - * - \ref SCUART_PARITY_NONE - * - \ref SCUART_PARITY_ODD - * - \ref SCUART_PARITY_EVEN - * @param[in] u32StopBits The stop bit length, could be - * - \ref SCUART_STOP_BIT_1 - * - \ref SCUART_STOP_BIT_2 - * @return Actual baudrate of smartcard - * @details The baudrate clock source comes from SC_CLK/SC_DIV, where SC_CLK is controlled - * by SCxSEL in CLKSEL3 register, SC_DIV is controlled by SCxDIV in CLKDIV1 - * register. Since the baudrate divider is 12-bit wide and must be larger than 4, - * (clock source / baudrate) must be larger or equal to 5 and smaller or equal to - * 4096. Otherwise this function cannot configure SCUART to work with target baudrate. - */ -uint32_t SCUART_SetLineConfig(SC_T *sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits) -{ - - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - if (u32Baudrate == 0UL) /* keep original baudrate setting */ - { - u32Div = sc->ETUCTL & SC_ETUCTL_ETURDIV_Msk; - } - else - { - /* Calculate divider for target baudrate */ - u32Div = (u32Clk + (u32Baudrate >> 1) - 1UL) / u32Baudrate - 1UL; - sc->ETUCTL = u32Div; - } - /* Set stop bit */ - sc->CTL = u32StopBits | SC_CTL_SCEN_Msk; - /* Set character width and parity */ - sc->UARTCTL = u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk; - - return (u32Clk / (u32Div + 1UL)); -} - -/** - * @brief This function use to set receive timeout count. - * @param[in] sc The base address of smartcard module. - * @param[in] u32TOC Rx timeout counter, using baudrate as counter unit. Valid range are 0~0x1FF, - * set this value to 0 will disable timeout counter - * @return None - * @details The time-out counter resets and starts counting whenever the RX buffer received a - * new data word. Once the counter decrease to 1 and no new data is received or CPU - * does not read any data from FIFO, a receiver time-out interrupt will be generated. - */ -void SCUART_SetTimeoutCnt(SC_T *sc, uint32_t u32TOC) -{ - sc->RXTOUT = u32TOC; -} - - -/** - * @brief This function is to write data into transmit FIFO to send data out. - * @param[in] sc The base address of smartcard module. - * @param[in] pu8TxBuf The buffer containing data to send to transmit FIFO. - * @param[in] u32WriteBytes Number of data to send. - * @return None - * @note This function blocks until all data write into FIFO - */ -void SCUART_Write(SC_T *sc, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count; - - for (u32Count = 0UL; u32Count != u32WriteBytes; u32Count++) - { - /* Wait 'til FIFO not full */ - while (SCUART_GET_TX_FULL(sc)) - { - ; - } - /* Write 1 byte to FIFO */ - sc->DAT = pu8TxBuf[u32Count]; - } -} - - -/*@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SCUART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sdh.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sdh.c deleted file mode 100644 index a7f9a9dfef1..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sdh.c +++ /dev/null @@ -1,276 +0,0 @@ -/**************************************************************************//** -* @file nu_sdh.c -* @brief SDH driver source file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" -#include - -/** @addtogroup Standard_Driver Standard Driver -@{ -*/ - -/** @addtogroup SDH_Driver SDH Driver -@{ -*/ - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions -@{ -*/ - -#define SDH_DBG -#if defined(SDH_DBG) - extern int rt_kprintf(const char *fmt, ...); - #define SDH_DBG_PRINT rt_kprintf - extern void rt_hw_us_delay(uint32_t us); - #define DelayMicrosecond rt_hw_us_delay - -#else - #define SDH_DBG_PRINT(...) - #define DelayMicrosecond SDH_Delay -#endif - -/* Print out register information: Name, Offset, Current value, Reset value, match flag. */ -#define DUMP_REG(BASE, NAME, DEFAULT) SDH_DBG_PRINT("| %-24s | 0x%04x | 0x%08x | 0x%08x | %-6s |\n", #NAME, (uint32_t)&BASE->NAME - (uint32_t)BASE, BASE->NAME, DEFAULT, ((BASE->NAME != DEFAULT) ? " N ":" Y ") ) - -#define PACK_MMC_CMD(CMD, IDX, ARG, RESP) ( CMD.cmdidx=IDX, CMD.cmdarg=ARG, CMD.resp_type=RESP ) - -#if !defined(SDH_DBG) -static void SDH_Delay(uint32_t u32LoopTime) -{ - volatile uint32_t i = 0x2000 * u32LoopTime; - for (; i > 0; i--); -} -#endif - -void SDH_DumpReg(SDH_T *sdh) -{ - - SDH_DBG_PRINT("========================================================================\n"); - SDH_DBG_PRINT("SDH_T(0x%08x): %d\n", sdh, sizeof(SDH_T)); - SDH_DBG_PRINT("========================================================================\n"); - SDH_DBG_PRINT("| %-24s | %-6s | %-10s | %-10s | %-6s |\n", "REG NAME", "OFFSET", "CURRENT", "DEFAULT", "MATCH?"); - SDH_DBG_PRINT("========================================================================\n"); - DUMP_REG(sdh, SDMASA, 0x0); - DUMP_REG(sdh, BLOCKSIZE, 0x0); - DUMP_REG(sdh, BLOCKCOUNT, 0x0); - DUMP_REG(sdh, ARGUMENT, 0x0); - DUMP_REG(sdh, XFER_MODE, 0x0); - DUMP_REG(sdh, CMD, 0x0); - DUMP_REG(sdh, RESP01, 0x0); - DUMP_REG(sdh, RESP23, 0x0); - DUMP_REG(sdh, RESP45, 0x0); - DUMP_REG(sdh, RESP67, 0x0); - DUMP_REG(sdh, BUF_DATA, 0x0); - DUMP_REG(sdh, PSTATE, 0x0); - DUMP_REG(sdh, HOST_CTRL1, 0x0); - DUMP_REG(sdh, PWR_CTRL, 0x0); - - DUMP_REG(sdh, BGAP_CTRL, 0x0); - DUMP_REG(sdh, WUP_CTRL, 0x0); - DUMP_REG(sdh, CLK_CTRL, 0x0); - DUMP_REG(sdh, TOUT_CTRL, 0x0); - DUMP_REG(sdh, SW_RST, 0x0); - DUMP_REG(sdh, NORMAL_INT_STAT, 0x0); - DUMP_REG(sdh, ERROR_INT_STAT, 0x0); - DUMP_REG(sdh, NORMAL_INT_STAT_EN, 0x0); - DUMP_REG(sdh, ERROR_INT_STAT_EN, 0x0); - DUMP_REG(sdh, NORMAL_INT_SIGNAL_EN, 0x0); - - DUMP_REG(sdh, ERROR_INT_SIGNAL_EN, 0x0); - DUMP_REG(sdh, AUTO_CMD_STAT, 0x0); - DUMP_REG(sdh, HOST_CTRL2, 0x0); - DUMP_REG(sdh, CAPABILITIES1, 0x276EC898); - DUMP_REG(sdh, CAPABILITIES2, 0x08008077); - DUMP_REG(sdh, CURR_CAPABILITIES1, 0x0); - DUMP_REG(sdh, CURR_CAPABILITIES2, 0x0); - DUMP_REG(sdh, FORCE_AUTO_CMD_STAT, 0x0); - DUMP_REG(sdh, FORCE_ERROR_INT_STAT, 0x0); - DUMP_REG(sdh, ADMA_ERR_STAT, 0x0); - DUMP_REG(sdh, ADMA_SA_LOW, 0x0); - DUMP_REG(sdh, PRESET_INIT, 0x0); - DUMP_REG(sdh, PRESET_DS, 0x0); - DUMP_REG(sdh, PRESET_HS, 0x0); - DUMP_REG(sdh, PRESET_SDR12, 0x0); - DUMP_REG(sdh, PRESET_SDR25, 0x0); - DUMP_REG(sdh, PRESET_SDR50, 0x0); - DUMP_REG(sdh, PRESET_SDR104, 0x0); - DUMP_REG(sdh, PRESET_DDR50, 0x0); - DUMP_REG(sdh, PRESET_UHS2, 0x0); - DUMP_REG(sdh, P_EMBEDDED_CNTRL, 0x0F6C); - DUMP_REG(sdh, P_VENDOR_SPECIFIC_AREA, 0x0500); - DUMP_REG(sdh, P_VENDOR2_SPECIFIC_AREA, 0x0180); - DUMP_REG(sdh, SLOT_INTR_STATUS, 0x0000); - DUMP_REG(sdh, HOST_CNTRL_VERS, 0x0005); - DUMP_REG(sdh, EMBEDDED_CTRL, 0x00000000); - DUMP_REG(sdh, MSHC_VER_ID, 0x3138302A); - DUMP_REG(sdh, MSHC_VER_TYPE, 0x67612A2A); - DUMP_REG(sdh, MSHC_CTRL, 0x01); - DUMP_REG(sdh, MBIU_CTRL, 0x0F); - DUMP_REG(sdh, EMMC_CTRL, 0x000C); - DUMP_REG(sdh, BOOT_CTRL, 0x0000); - - DUMP_REG(sdh, AT_CTRL, 0x03000005); - DUMP_REG(sdh, AT_STAT, 0x00000006); - DUMP_REG(sdh, CQCAP, 0x000030C8); - SDH_DBG_PRINT("========================================================================\n"); -} - -void SDH_Reset(SDH_T *sdh, uint8_t u8Mask) -{ - /* Wait max 100 ms */ - unsigned int timeout = 100; - - sdh->SW_RST |= u8Mask; - while (sdh->SW_RST & u8Mask) - { - if (timeout == 0) - { - SDH_DBG_PRINT("SD Reset fail\n"); - return; - } - timeout--; - DelayMicrosecond(1000); - } -} - -void SDH_SetPower(SDH_T *sdh, uint32_t u32OnOff) -{ - if (u32OnOff) - { - /* Power on VDD1 */ - sdh->S_PWR_CTRL.SD_BUS_PWR_VDD1 = 1; - - /* Set 3.3v for EMMC, SD and */ - sdh->S_PWR_CTRL.SD_BUS_VOL_VDD1 = 7; - } - else - { - /* Power off VDD1 */ - sdh->S_PWR_CTRL.SD_BUS_PWR_VDD1 = 0; - - /* Set 0v for EMMC, SD and */ - sdh->S_PWR_CTRL.SD_BUS_VOL_VDD1 = 0; - } -} - -uint32_t SDH_SetClock(SDH_T *sdh, uint32_t u32SrcFreqInHz, uint32_t u32ExceptedFreqInHz) -{ - uint32_t timeout; - uint32_t div; - - if (u32ExceptedFreqInHz == 0) - goto exit_SDH_SetClock; - - /* Wait max 20 ms */ - timeout = 200; - while (sdh->PSTATE & 0x3) //(SDH_CMD_INHIBIT | SDH_DATA_INHIBIT)) - { - if (timeout == 0) - { - SDH_DBG_PRINT("Timeout to wait cmd & data inhibit\n"); - goto exit_SDH_SetClock; - } - timeout--; - DelayMicrosecond(100); - } - /* Shutdown clocks. */ - sdh->CLK_CTRL = 0; - DelayMicrosecond(1000); - - div = (u32SrcFreqInHz / 2) / u32ExceptedFreqInHz; - if (div > 0) - { - while ((u32SrcFreqInHz / (2 * div)) > u32ExceptedFreqInHz) - { - div++; - } - } - - sdh->S_CLK_CTRL.FREQ_SEL = div & 0xff; - sdh->S_CLK_CTRL.UPPER_FREQ_SEL = (div >> 8) & 0x3; - - sdh->S_CLK_CTRL.INTERNAL_CLK_EN = 1; - - /* Wait stable */ - /* Wait max 20 ms */ - timeout = 200; - while (!sdh->S_CLK_CTRL.INTERNAL_CLK_STABLE) - { - if (timeout == 0) - { - SDH_DBG_PRINT("Timeout to wait CLK stable.\n"); - goto exit_SDH_SetClock; - } - timeout--; - DelayMicrosecond(100); - } - - /* Enable SD CLK */ - sdh->S_CLK_CTRL.SD_CLK_EN = 1; - - return (div == 0) ? u32SrcFreqInHz : u32SrcFreqInHz / (2 * div); - -exit_SDH_SetClock: - - sdh->CLK_CTRL = 0; - - return 0; -} - -#define SDH_CMD_MAX_TIMEOUT 3200 -#define SDH_CMD_DEFAULT_TIMEOUT 100 -#define SDH_MAX_DIV_SPEC_300 2046 - -int SD_GetBusStatus(SDH_T *sdh, uint32_t mask) -{ - volatile unsigned int time = 0; - volatile unsigned int cmd_timeout = SDH_CMD_DEFAULT_TIMEOUT; - - while (sdh->PSTATE & mask) - { - if (time >= cmd_timeout) - { - if (2 * cmd_timeout <= SDH_CMD_MAX_TIMEOUT) - { - cmd_timeout += cmd_timeout; - } - else - { - return -1; - } - } - DelayMicrosecond(1000); - time++; - } - return 0; -} - -int SDH_SetBusWidth(SDH_T *sdh, uint32_t u32BusWidth) -{ - switch (u32BusWidth) - { - case 1: - sdh->S_HOST_CTRL1.DAT_XFER_WIDTH = 0; - sdh->S_HOST_CTRL1.EXT_DAT_XFER = 0; - break; - case 4: - sdh->S_HOST_CTRL1.DAT_XFER_WIDTH = 1; - sdh->S_HOST_CTRL1.EXT_DAT_XFER = 0; - break; - case 8: - sdh->S_HOST_CTRL1.DAT_XFER_WIDTH = 1; - sdh->S_HOST_CTRL1.EXT_DAT_XFER = 1; - break; - } - return 0; -} - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_spi.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_spi.c deleted file mode 100644 index e4bc1b397c8..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_spi.c +++ /dev/null @@ -1,1313 +0,0 @@ -/**************************************************************************//** - * @file spi.c - * @brief SPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s); - -/** - * @brief This function make SPI module be ready to transfer. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32MasterSlave Decides the SPI module is operating in master mode or in slave mode. (SPI_SLAVE, SPI_MASTER) - * @param[in] u32SPIMode Decides the transfer timing. (SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a SPI transaction. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI peripheral clock. - * @details By default, the SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the SPI clock divider setting will be 0. - * The actual clock rate may be different from the target SPI clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the - * actual SPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPI_Open(SPI_T *spi, - uint32_t u32MasterSlave, - uint32_t u32SPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0U, u32Div, u32HCLKFreq, u32RetValue = 0U; - - /* Disable I2S mode */ - spi->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; - - if (u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetSYSCLK0Freq(); - - if (u32MasterSlave == SPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI0SEL_Msk)) | CLK_CLKSEL4_SPI0SEL_PCLK1; - } - else if (spi == SPI1) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI1SEL_Msk)) | CLK_CLKSEL4_SPI1SEL_PCLK2; - } - else if (spi == SPI2) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI2SEL_Msk)) | CLK_CLKSEL4_SPI2SEL_PCLK1; - } - else - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI3SEL_Msk)) | CLK_CLKSEL4_SPI3SEL_PCLK2; - } - } - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - } - else if (spi == SPI1) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32ClkSrc = CLK_GetPCLK2Freq(); - } - } - else if (spi == SPI2) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_PCLK1) - { - u32ClkSrc = CLK_GetPCLK1Freq(); - } - } - else - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32ClkSrc = CLK_GetPCLK2Freq(); - } - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0xFFU) - { - u32Div = 0xFFU; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - } - else /* For slave mode, force the SPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI0SEL_Msk)) | CLK_CLKSEL4_SPI0SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (spi == SPI1) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI1SEL_Msk)) | CLK_CLKSEL4_SPI1SEL_PCLK2; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK2Freq(); - } - else if (spi == SPI2) - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI2SEL_Msk)) | CLK_CLKSEL4_SPI2SEL_PCLK1; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else - { - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI3SEL_Msk)) | CLK_CLKSEL4_SPI3SEL_PCLK2; - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK2Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will reset SPI controller. - */ -void SPI_Close(SPI_T *spi) -{ - if (spi == SPI0) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - else if (spi == SPI1) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI1RST_Msk; - } - else if (spi == SPI2) - { - /* Reset SPI */ - SYS->IPRST1 |= SYS_IPRST1_SPI2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI2RST_Msk; - } - else - { - /* Reset SPI */ - SYS->IPRST2 |= SYS_IPRST2_SPI3RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI3RST_Msk; - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI RX FIFO buffer. The RXEMPTY (SPI_STATUS[8]) will be set to 1. - */ -void SPI_ClearRxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI TX FIFO buffer. The TXEMPTY (SPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void SPI_ClearTxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void SPI_DisableAutoSS(SPI_T *spi) -{ - spi->SSCTL &= ~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (SPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (SPI_SS_ACTIVE_HIGH, SPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - spi->SSCTL = (spi->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | SPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the SPI bus clock. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target SPI bus clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the actual SPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock) -{ - uint32_t u32ClkSrc = 0, u32HCLKFreq; - uint32_t u32Div, u32RetValue; - - /* Get system clock frequency */ - u32HCLKFreq = CLK_GetSYSCLK0Freq(); - - if (u32BusClock >= u32HCLKFreq) - { - /* Select PCLK as the clock source of SPI */ - if (spi == SPI0) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI0SEL_Msk)) | CLK_CLKSEL4_SPI0SEL_PCLK1; - else if (spi == SPI1) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI1SEL_Msk)) | CLK_CLKSEL4_SPI1SEL_PCLK2; - else if (spi == SPI2) - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI2SEL_Msk)) | CLK_CLKSEL4_SPI2SEL_PCLK1; - else - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI3SEL_Msk)) | CLK_CLKSEL4_SPI3SEL_PCLK2; - } - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - } - else if (spi == SPI1) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32ClkSrc = CLK_GetPCLK2Freq(); - } - } - else if (spi == SPI2) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - } - else - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32ClkSrc = CLK_GetPCLK2Freq(); - } - } - - if (u32BusClock >= u32HCLKFreq) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock >= u32ClkSrc) - { - /* Set DIVIDER = 0 */ - spi->CLKDIV = 0U; - /* Return master peripheral clock rate */ - u32RetValue = u32ClkSrc; - } - else if (u32BusClock == 0U) - { - /* Set DIVIDER to the maximum value 0xFF. f_spi = f_spi_clk_src / (DIVIDER + 1) */ - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - u32Div = (((u32ClkSrc * 10U) / u32BusClock + 5U) / 10U) - 1U; /* Round to the nearest integer */ - if (u32Div > 0x1FFU) - { - u32Div = 0x1FFU; - spi->CLKDIV |= SPI_CLKDIV_DIVIDER_Msk; - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (0xFFU + 1U)); - } - else - { - spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); - /* Return master peripheral clock rate */ - u32RetValue = (u32ClkSrc / (u32Div + 1U)); - } - } - - return u32RetValue; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. If data width is 8~16 bits, it could be 0 ~ 7. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. If data width is 8~16 bits, it could be 0 ~ 7. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - spi->FIFOCTL = (spi->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of SPI bus clock. Only available in Master mode. - * @param[in] spi The pointer of the specified SPI module. - * @return Actual SPI bus clock frequency in Hz. - * @details This function will calculate the actual SPI bus clock rate according to the SPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t SPI_GetBusClock(SPI_T *spi) -{ - uint32_t u32Div; - uint32_t u32ClkSrc = 0; - - /* Get DIVIDER setting */ - u32Div = (spi->CLKDIV & SPI_CLKDIV_DIVIDER_Msk) >> SPI_CLKDIV_DIVIDER_Pos; - - /* Check clock source of SPI */ - if (spi == SPI0) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - } - else if (spi == SPI1) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32ClkSrc = CLK_GetPCLK2Freq(); - } - } - else if (spi == SPI2) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32ClkSrc = CLK_GetPCLK1Freq(); - } - } - else - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_APLL) - { - u32ClkSrc = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32ClkSrc = CLK_GetPCLK2Freq(); - } - } - - /* Return SPI bus clock rate */ - return (u32ClkSrc / (u32Div + 1U)); -} - -/** - * @brief Enable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL |= SPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL &= ~SPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get SPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = spi->STATUS & SPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_UNIT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSINACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVUR_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVBE_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_TXUF_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear SPI related interrupt flags specified by u32Mask parameter. - */ -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - if (u32Mask & SPI_UNIT_INT_MASK) - { - spi->STATUS = SPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & SPI_SSACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & SPI_SSINACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & SPI_SLVUR_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & SPI_SLVBE_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & SPI_TXUF_INT_MASK) - { - spi->STATUS = SPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & SPI_FIFO_RXOV_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & SPI_FIFO_RXTO_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get SPI status. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_BUSY_MASK - * - \ref SPI_RX_EMPTY_MASK - * - \ref SPI_RX_FULL_MASK - * - \ref SPI_TX_EMPTY_MASK - * - \ref SPI_TX_FULL_MASK - * - \ref SPI_TXRX_RESET_MASK - * - \ref SPI_SPIEN_STS_MASK - * - \ref SPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = spi->STATUS & SPI_STATUS_BUSY_Msk; - /* Check busy status */ - if ((u32Mask & SPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_BUSY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if ((u32Mask & SPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if ((u32Mask & SPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if ((u32Mask & SPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if ((u32Mask & SPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if ((u32Mask & SPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TXRX_RESET_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SPIENSTS_Msk; - /* Check SPIEN flag */ - if ((u32Mask & SPI_SPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SPIEN_STS_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SSLINE_Msk; - /* Check SPIx_SS line status */ - if ((u32Mask & SPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - - -/** - * @brief This function is used to get I2S source clock frequency. - * @param[in] i2s The pointer of the specified I2S module. - * @return I2S source clock frequency (Hz). - * @details Return the source clock frequency according to the setting of SPI0SEL (CLKSEL2[27:26]). - */ -static uint32_t SPII2S_GetSourceClockFreq(SPI_T *i2s) -{ - uint32_t u32Freq = 0; - - if (i2s == SPI0) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_APLL) - { - u32Freq = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI0SEL_Msk) == CLK_CLKSEL4_SPI0SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32Freq = CLK_GetPCLK1Freq(); - } - } - else if (i2s == SPI1) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_APLL) - { - u32Freq = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI1SEL_Msk) == CLK_CLKSEL4_SPI1SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32Freq = CLK_GetPCLK2Freq(); - } - } - else if (i2s == SPI2) - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_APLL) - { - u32Freq = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI2SEL_Msk) == CLK_CLKSEL4_SPI2SEL_PCLK1) - { - /* Clock source is PCLK1 */ - u32Freq = CLK_GetPCLK1Freq(); - } - } - else - { - if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_APLL) - { - u32Freq = CLK_GetPLLClockFreq(APLL); /* Clock source is APLL */ - } - else if ((CLK->CLKSEL4 & CLK_CLKSEL4_SPI3SEL_Msk) == CLK_CLKSEL4_SPI3SEL_PCLK2) - { - /* Clock source is PCLK2 */ - u32Freq = CLK_GetPCLK2Freq(); - } - } - - return u32Freq; -} - -/** - * @brief This function configures some parameters of I2S interface for general purpose use. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32MasterSlave I2S operation mode. Valid values are listed below. - * - \ref SPII2S_MODE_MASTER - * - \ref SPII2S_MODE_SLAVE - * @param[in] u32SampleRate Sample rate - * @param[in] u32WordWidth Data length. Valid values are listed below. - * - \ref SPII2S_DATABIT_8 - * - \ref SPII2S_DATABIT_16 - * - \ref SPII2S_DATABIT_24 - * - \ref SPII2S_DATABIT_32 - * @param[in] u32Channels Audio format. Valid values are listed below. - * - \ref SPII2S_MONO - * - \ref SPII2S_STEREO - * @param[in] u32DataFormat Data format. Valid values are listed below. - * - \ref SPII2S_FORMAT_I2S - * - \ref SPII2S_FORMAT_MSB - * - \ref SPII2S_FORMAT_PCMA - * - \ref SPII2S_FORMAT_PCMB - * @return Real sample rate of master mode or peripheral clock rate of slave mode. - * @details This function will reset SPI/I2S controller and configure I2S controller according to the input parameters. - * Set TX FIFO threshold to 2 and RX FIFO threshold to 1. Both the TX and RX functions will be enabled. - * The actual sample rate may be different from the target sample rate. The real sample rate will be returned for reference. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPII2S_Open(SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat) -{ - uint32_t u32Divider; - uint32_t u32BitRate, u32SrcClk, u32RetValue; - - /* Reset SPI/I2S */ - if (i2s == SPI0) - { - SYS->IPRST1 |= SYS_IPRST1_SPI0RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI0RST_Msk; - } - else if (i2s == SPI1) - { - SYS->IPRST1 |= SYS_IPRST1_SPI1RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI1RST_Msk; - } - else if (i2s == SPI2) - { - SYS->IPRST1 |= SYS_IPRST1_SPI2RST_Msk; - SYS->IPRST1 &= ~SYS_IPRST1_SPI2RST_Msk; - } - else - { - SYS->IPRST2 |= SYS_IPRST2_SPI3RST_Msk; - SYS->IPRST2 &= ~SYS_IPRST2_SPI3RST_Msk; - } - - /* Configure I2S controller */ - i2s->I2SCTL = u32MasterSlave | u32WordWidth | u32Channels | u32DataFormat; - /* Set TX FIFO threshold to 2 and RX FIFO threshold to 1 */ - SPI_SetFIFO(i2s, 2, 1); - - if (u32MasterSlave == SPI_MASTER) - { - /* Get the source clock rate */ - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - - /* Calculate the bit clock rate */ - u32BitRate = u32SampleRate * ((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1U) * 16U; - u32Divider = ((u32SrcClk / u32BitRate) >> 1U) - 1U; - //u32Divider = ((((u32SrcClk * 10UL / u32BitRate) >> 1U) + 5UL) / 10UL) - 1U; - /* Set BCLKDIV setting */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_BCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_BCLKDIV_Pos); - - /* Calculate bit clock rate */ - u32BitRate = u32SrcClk / ((u32Divider + 1U) * 2U); - /* Calculate real sample rate */ - u32SampleRate = u32BitRate / (((u32WordWidth >> SPI_I2SCTL_WDWIDTH_Pos) + 1U) * 16U); - - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - - /* Return the real sample rate */ - u32RetValue = u32SampleRate; - } - else - { - /* Set BCLKDIV = 0 */ - i2s->I2SCLK &= ~SPI_I2SCLK_BCLKDIV_Msk; - - if (i2s == SPI0) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI0SEL_Msk)) | CLK_CLKSEL4_SPI0SEL_PCLK1; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else if (i2s == SPI1) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI1SEL_Msk)) | CLK_CLKSEL4_SPI1SEL_PCLK2; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK2Freq(); - } - else if (i2s == SPI2) - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI2SEL_Msk)) | CLK_CLKSEL4_SPI2SEL_PCLK1; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK1Freq(); - } - else - { - /* Set the peripheral clock rate to equal APB clock rate */ - CLK->CLKSEL4 = (CLK->CLKSEL4 & (~CLK_CLKSEL4_SPI3SEL_Msk)) | CLK_CLKSEL4_SPI3SEL_PCLK2; - /* Enable TX function, RX function and I2S mode. */ - i2s->I2SCTL |= (SPI_I2SCTL_RXEN_Msk | SPI_I2SCTL_TXEN_Msk | SPI_I2SCTL_I2SEN_Msk); - /* Return slave peripheral clock rate */ - u32RetValue = CLK_GetPCLK2Freq(); - } - } - - return u32RetValue; -} - -/** - * @brief Disable I2S function. - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Disable I2S function. - */ -void SPII2S_Close(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_I2SEN_Msk; -} - -/** - * @brief Enable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * @return None - * @details This function enables the interrupt according to the u32Mask parameter. - */ -void SPII2S_EnableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Enable TX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Enable TX underflow interrupt flag */ - if ((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable right channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_RZCIEN_Msk; - } - - /* Enable left channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL |= SPI_I2SCTL_LZCIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt source. Valid values are listed below. - * - \ref SPII2S_FIFO_TXTH_INT_MASK - * - \ref SPII2S_FIFO_RXTH_INT_MASK - * - \ref SPII2S_FIFO_RXOV_INT_MASK - * - \ref SPII2S_FIFO_RXTO_INT_MASK - * - \ref SPII2S_TXUF_INT_MASK - * - \ref SPII2S_RIGHT_ZC_INT_MASK - * - \ref SPII2S_LEFT_ZC_INT_MASK - * @return None - * @details This function disables the interrupt according to the u32Mask parameter. - */ -void SPII2S_DisableInt(SPI_T *i2s, uint32_t u32Mask) -{ - /* Disable TX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_TXTH_INT_MASK) == SPII2S_FIFO_TXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTH_INT_MASK) == SPII2S_FIFO_RXTH_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXOV_INT_MASK) == SPII2S_FIFO_RXOV_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & SPII2S_FIFO_RXTO_INT_MASK) == SPII2S_FIFO_RXTO_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } - - /* Disable TX underflow interrupt flag */ - if ((u32Mask & SPII2S_TXUF_INT_MASK) == SPII2S_TXUF_INT_MASK) - { - i2s->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable right channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_RIGHT_ZC_INT_MASK) == SPII2S_RIGHT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_RZCIEN_Msk; - } - - /* Disable left channel zero cross interrupt flag */ - if ((u32Mask & SPII2S_LEFT_ZC_INT_MASK) == SPII2S_LEFT_ZC_INT_MASK) - { - i2s->I2SCTL &= ~SPI_I2SCTL_LZCIEN_Msk; - } -} - -/** - * @brief Enable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32BusClock The target MCLK clock rate. - * @return Actual MCLK clock rate - * @details Set the master clock rate according to u32BusClock parameter and enable master clock output. - * The actual master clock rate may be different from the target master clock rate. The real master clock rate will be returned for reference. - */ -uint32_t SPII2S_EnableMCLK(SPI_T *i2s, uint32_t u32BusClock) -{ - uint32_t u32Divider; - uint32_t u32SrcClk, u32RetValue; - - u32SrcClk = SPII2S_GetSourceClockFreq(i2s); - if (u32BusClock == u32SrcClk) - { - u32Divider = 0U; - } - else - { - u32Divider = (u32SrcClk / u32BusClock) >> 1U; - /* MCLKDIV is a 6-bit width configuration. The maximum value is 0x3F. */ - if (u32Divider > 0x3FU) - { - u32Divider = 0x3FU; - } - } - - /* Write u32Divider to MCLKDIV (SPI_I2SCLK[5:0]) */ - i2s->I2SCLK = (i2s->I2SCLK & ~SPI_I2SCLK_MCLKDIV_Msk) | (u32Divider << SPI_I2SCLK_MCLKDIV_Pos); - - /* Enable MCLK output */ - i2s->I2SCTL |= SPI_I2SCTL_MCLKEN_Msk; - - if (u32Divider == 0U) - { - u32RetValue = u32SrcClk; /* If MCLKDIV=0, master clock rate is equal to the source clock rate. */ - } - else - { - u32RetValue = ((u32SrcClk >> 1U) / u32Divider); /* If MCLKDIV>0, master clock rate = source clock rate / (MCLKDIV * 2) */ - } - - return u32RetValue; -} - -/** - * @brief Disable master clock (MCLK). - * @param[in] i2s The pointer of the specified I2S module. - * @return None - * @details Clear MCLKEN bit of SPI_I2SCTL register to disable master clock output. - */ -void SPII2S_DisableMCLK(SPI_T *i2s) -{ - i2s->I2SCTL &= ~SPI_I2SCTL_MCLKEN_Msk; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] i2s The pointer of the specified I2S module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPII2S_SetFIFO(SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - i2s->FIFOCTL = (i2s->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ssmcc.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ssmcc.c deleted file mode 100644 index cb9e0e8cad0..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_ssmcc.c +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************//** - * @file ssmcc.c - * @brief SSMCC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SSMCC_Driver SSMCC Driver - @{ -*/ - -/** @addtogroup SSMCC_EXPORTED_FUNCTIONS SSMCC Exported Functions - @{ -*/ - -/** - * @brief Set TZC Region0. - * @param[in] u32Attr is security attribute for all region 0. - * @return none - * @details - * SSMCC::TZC0:Ch0 CA35, AXI-AP - * SSMCC::TZC0:Ch1 GFX, VC8000 - * SSMCC::TZC0:Ch2 DCUltra - * SSMCC::TZC0:Ch3 GMAC0, GMAC1 - * SSMCC::TZC2:Ch0 CCAP0, CCAP1 - * SSMCC::TZC2:Ch1 CM4 - * PDMA0, PDMA1, PDMA2, PDMA3 - * SDH0, SDH1 - * HSUSBH0, HSUSBH1, USBH0, USBH1, USBH2 - * HSUSBD, NFI - * SSMCC::TZC2:Ch2 CRYPTO - * \hideinitializer - */ -#define TZC0_CH_NUM 4 -#define TZC2_CH_NUM 3 - -void SSMCC_SetRegion0(uint32_t u32Attr) -{ - /* Enable SSMCC clock */ - CLK->APBCLK2 |= CLK_APBCLK2_SSMCCEN_Msk; - - /* Enable IP clocks on channels. */ - CLK->CLKSEL0 |= CLK_CLKSEL0_SYSCK0SEL_SYSPLL; - - CLK->SYSCLK0 |= (CLK_SYSCLK0_CCAP1EN_Msk | - CLK_SYSCLK0_CCAP0EN_Msk | - CLK_SYSCLK0_GMAC1EN_Msk | - CLK_SYSCLK0_GMAC0EN_Msk | - CLK_SYSCLK0_DCUEN_Msk | - CLK_SYSCLK0_VDECEN_Msk | - CLK_SYSCLK0_GFXEN_Msk | - CLK_SYSCLK0_HUSBH1EN_Msk | - CLK_SYSCLK0_HUSBH0EN_Msk | - CLK_SYSCLK0_USBHEN_Msk | - CLK_SYSCLK0_USBDEN_Msk | - CLK_SYSCLK0_NANDEN_Msk | - CLK_SYSCLK0_SDH1EN_Msk | - CLK_SYSCLK0_SDH0EN_Msk); - - /* Set region 0 secure attribute */ - TZC0->REGION[SSMCC_REGION_0].ATTRIBUTES = u32Attr & (TZC_REGION_ATTRIBUTES_s_rd_en_Msk | TZC_REGION_ATTRIBUTES_s_wr_en_Msk); - TZC0->GATE_KEEPER = (1 << TZC0_CH_NUM) - 1; /* CH[0, 1, 2, 3] used, filter mask is 0xF */ - TZC2->REGION[SSMCC_REGION_0].ATTRIBUTES = u32Attr & (TZC_REGION_ATTRIBUTES_s_rd_en_Msk | TZC_REGION_ATTRIBUTES_s_wr_en_Msk); - TZC2->GATE_KEEPER = (1 << TZC2_CH_NUM) - 1; /* CH[0, 1, 2] used, filter mask is 0x7 */ - - while (1) - { - if (((TZC0->GATE_KEEPER & TZC_GATE_KEEPER_open_status_Msk) == (((1 << TZC0_CH_NUM) - 1) << TZC_GATE_KEEPER_open_status_Pos)) - && ((TZC2->GATE_KEEPER & TZC_GATE_KEEPER_open_status_Msk) == (((1 << TZC2_CH_NUM) - 1) << TZC_GATE_KEEPER_open_status_Pos))) - { - break; - } - } - - /* set region 0 non-secure attribute */ - TZC0->REGION[SSMCC_REGION_0].ID_ACCESS = u32Attr & 0x00010001; - TZC2->REGION[SSMCC_REGION_0].ID_ACCESS = u32Attr & 0x00030003; - - CLK->SYSCLK0 &= ~(CLK_SYSCLK0_CCAP1EN_Msk | - CLK_SYSCLK0_CCAP0EN_Msk | - CLK_SYSCLK0_GMAC1EN_Msk | - CLK_SYSCLK0_GMAC0EN_Msk | - CLK_SYSCLK0_DCUEN_Msk | - CLK_SYSCLK0_VDECEN_Msk | - CLK_SYSCLK0_GFXEN_Msk | - CLK_SYSCLK0_HUSBH1EN_Msk | - CLK_SYSCLK0_HUSBH0EN_Msk | - CLK_SYSCLK0_USBHEN_Msk | - CLK_SYSCLK0_USBDEN_Msk | - CLK_SYSCLK0_NANDEN_Msk | - CLK_SYSCLK0_SDH1EN_Msk | - CLK_SYSCLK0_SDH0EN_Msk); - - //CLK->CLKSEL0 &= ~CLK_CLKSEL0_SYSCK0SEL_Msk; -} - -/** - * @brief Set TZC Regions. - * @param[in] psParam is structure pointer of SSMCC parameter. - * @return none - * @details - * \hideinitializer - */ -void SSMCC_SetRegion(SSMCC_PARAM_T *psParam) -{ - if (psParam && - psParam->region_no != SSMCC_REGION_0) - { - TZC0->REGION[psParam->region_no].BASE_LOW = psParam->base_address; - TZC0->REGION[psParam->region_no].TOP_LOW = psParam->base_address + psParam->size - 1; - TZC0->REGION[psParam->region_no].ATTRIBUTES = ((1 << TZC0_CH_NUM) - 1) | (psParam->attribute & (TZC_REGION_ATTRIBUTES_s_rd_en_Msk | TZC_REGION_ATTRIBUTES_s_wr_en_Msk)); - TZC0->REGION[psParam->region_no].ID_ACCESS = psParam->attribute & 0x00010001; - - TZC2->REGION[psParam->region_no].BASE_LOW = psParam->base_address; - TZC2->REGION[psParam->region_no].TOP_LOW = psParam->base_address + psParam->size - 1; - TZC2->REGION[psParam->region_no].ATTRIBUTES = ((1 << TZC2_CH_NUM) - 1) | (psParam->attribute & (TZC_REGION_ATTRIBUTES_s_rd_en_Msk | TZC_REGION_ATTRIBUTES_s_wr_en_Msk)); - TZC2->REGION[psParam->region_no].ID_ACCESS = psParam->attribute & 0x00030003; - } -} - -/*@}*/ /* end of group SSMCC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SSMCC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sspcc.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sspcc.c deleted file mode 100644 index d72def46d5b..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sspcc.c +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************//** - * @file sspcc.c - * @brief SSPCC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SSPCC_Driver SSPCC Driver - @{ -*/ - -/** @addtogroup SSPCC_EXPORTED_FUNCTIONS SSPCC Exported Functions - @{ -*/ - -/** - * @brief Set Peripheral Realm - * - * @param[in] u32Perip SSPCC Peripheral ID. - * @param[in] u32Realm Security set(Realm). It could be \n - * SSPCC_SSET_TZS, SSPCC_SSET_TZNS, SSPCC_SSET_SUBM. - * - * @return None - * - * @details This function is used to set specified realm. - */ -void SSPCC_SetRealm(uint32_t u32Perip, uint32_t u32Realm) -{ - vu32 *pu32SSet = (vu32 *)(SSPCC_BASE + (u32Perip >> SSPCC_REG_Pos)); - uint32_t u32Pos = u32Perip & SSPCC_PS_Msk; - - *pu32SSet = (*pu32SSet & ~(SSPCC_SSET_Msk << u32Pos)) | (u32Realm << u32Pos); -} - -/** - * @brief Get Peripheral Realm - * - * @param[in] u32Perip SSPCC Peripheral ID. - * @param[out] u32Realm Security set(Realm). It could be \n - * SSPCC_SSET_TZS, SSPCC_SSET_TZNS, SSPCC_SSET_SUBM. - * - * @return None - * - * @details This function is used to get specified realm. - */ -uint32_t SSPCC_GetRealm(uint32_t u32Perip) -{ - vu32 *pu32SSet = (vu32 *)(SSPCC_BASE + (u32Perip >> SSPCC_REG_Pos)); - uint32_t u32Pos = u32Perip & SSPCC_PS_Msk; - - return (*pu32SSet & (SSPCC_SSET_Msk << u32Pos)) >> u32Pos; -} - -/** - * @brief Set Pin Realm - * - * @param[in] u32PortBA GPIO port. It could be GPIOA_BASE, GPIOB_BASE, ..., GPIOM_BASE and GPION_BASE. - * @param[in] u32Pin It could be 0 ~ 15 for PA, PB, ..., PM and PN GPIO ports. - * @param[in] u32Realm realm. It could be \n - * SSPCC_SSET_TZS, SSPCC_SSET_TZNS, SSPCC_SSET_SUBM. - * - * @return None - * - * @details This function is used to set specified IO realm. - */ -void SSPCC_SetRealm_GPIO(uint32_t u32PortBA, uint32_t u32Pin, uint32_t u32Realm) -{ - uint32_t u32PortIdx = (u32PortBA - GPIO_BASE) / 0x40; - vu32 *avu32IOSecuritySet = (vu32 *)&SSPCC->IOASSET; - - avu32IOSecuritySet[u32PortIdx] = (avu32IOSecuritySet[u32PortIdx] & ~(SSPCC_SSET_Msk << (u32Pin << 1))) | (u32Realm << (u32Pin << 1)); -} - -/** - * @brief Get Pin Realm - * - * @param[in] u32PortBA GPIO port. It could be GPIOA_BASE, GPIOB_BASE, ..., GPIOM_BASE and GPION_BASE. - * @param[in] u32Pin It could be 0 ~ 15 for PA, PB, ..., PM and PN GPIO ports. - * - * @return It could be \n - * SSPCC_SSET_TZS, SSPCC_SSET_TZNS, SSPCC_SSET_SUBM. - * - * @details This function is used to set specified IO realm. - */ -uint32_t SSPCC_GetRealm_GPIO(uint32_t u32PortBA, uint32_t u32Pin) -{ - uint32_t u32PortIdx = (u32PortBA - GPIO_BASE) / 0x40; - vu32 *avu32IOSecuritySet = (vu32 *)&SSPCC->IOASSET; - uint32_t u32Ret = avu32IOSecuritySet[u32PortIdx] & (SSPCC_SSET_Msk << (u32Pin << 1)); - - return u32Ret >> (u32Pin << 1); -} - -/*@}*/ /* end of group SSPCC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SSPCC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sys.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sys.c deleted file mode 100644 index 38cd15bb6cc..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_sys.c +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************//** - * @file sys.c - * @brief SYS driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include "NuMicro.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - - -/** @addtogroup SYS_EXPORTED_FUNCTIONS SYS Exported Functions - @{ -*/ - -/** - * @brief Reset selected module - * @param[in] u32ModuleIndex is module index. Including : - * - \ref PDMA0_RST - * - \ref PDMA1_RST - * - \ref PDMA2_RST - * - \ref PDMA3_RST - * - \ref DISPC_RST - * - \ref VCAP0_RST - * - \ref VCAP1_RST - * - \ref GFX_RST - * - \ref VDEC_RST - * - \ref WRHO0_RST - * - \ref WRHO1_RST - * - \ref GMAC0_RST - * - \ref GMAC1_RST - * - \ref HWSEM0_RST - * - \ref EBI_RST - * - \ref HSUSBH0_RST - * - \ref HSUSBH1_RST - * - \ref HSUSBD_RST - * - \ref USBHL_RST - * - \ref SDH0_RST - * - \ref SDH1_RST - * - \ref NAND_RST - * - \ref GPIO_RST - * - \ref MCTLP_RST - * - \ref MCTLC_RST - * - \ref DDRPUB_RST - * - \ref TMR0_RST - * - \ref TMR1_RST - * - \ref TMR2_RST - * - \ref TMR3_RST - * - \ref I2C0_RST - * - \ref I2C1_RST - * - \ref I2C2_RST - * - \ref I2C3_RST - * - \ref QSPI0_RST - * - \ref SPI0_RST - * - \ref SPI1_RST - * - \ref SPI2_RST - * - \ref UART0_RST - * - \ref UART1_RST - * - \ref UART2_RST - * - \ref UART3_RST - * - \ref UART4_RST - * - \ref UART5_RST - * - \ref UART6_RST - * - \ref UART7_RST - * - \ref MCAN0_RST - * - \ref MCAN1_RST - * - \ref EADC0_RST - * - \ref I2S0_RST - * - \ref SC0_RST - * - \ref SC1_RST - * - \ref QSPI1_RST - * - \ref SPI3_RST - * - \ref EPWM0_RST - * - \ref EPWM1_RST - * - \ref QEI0_RST - * - \ref QEI1_RST - * - \ref ECAP0_RST - * - \ref ECAP1_RST - * - \ref MCAN2_RST - * - \ref ADC0_RST - * - \ref TMR4_RST - * - \ref TMR5_RST - * - \ref TMR6_RST - * - \ref TMR7_RST - * - \ref TMR8_RST - * - \ref TMR9_RST - * - \ref TMR10_RST - * - \ref TMR11_RST - * - \ref UART8_RST - * - \ref UART9_RST - * - \ref UART10_RST - * - \ref UART11_RST - * - \ref UART12_RST - * - \ref UART13_RST - * - \ref UART14_RST - * - \ref UART15_RST - * - \ref UART16_RST - * - \ref I2S1_RST - * - \ref I2C4_RST - * - \ref I2C5_RST - * - \ref EPWM2_RST - * - \ref ECAP2_RST - * - \ref QEI2_RST - * - \ref MCAN3_RST - * - \ref KPI_RST - * - \ref GIC_RST - * - \ref SSMCC_RST - * - \ref SSPCC_RST - * @return None - * @details This function reset selected module. - */ -void SYS_ResetModule(uint32_t u32ModuleIndex) -{ - uint32_t u32tmpVal = 0UL, u32tmpAddr = 0UL; - - /* Generate reset signal to the corresponding module */ - u32tmpVal = (1UL << (u32ModuleIndex & 0x00ffffffUL)); - u32tmpAddr = (vu32)&SYS->IPRST0 + ((u32ModuleIndex >> 24UL)); - *(vu32 *)u32tmpAddr |= u32tmpVal; - - /* Release corresponding module from reset state */ - u32tmpVal = ~(1UL << (u32ModuleIndex & 0x00ffffffUL)); - *(vu32 *)u32tmpAddr &= u32tmpVal; -} - - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer.c deleted file mode 100644 index d933ec65876..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer.c +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************//** - * @file timer.c - * @brief Timer Controller(Timer) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_Driver TIMER Driver - @{ -*/ - -/** @addtogroup TIMER_EXPORTED_FUNCTIONS TIMER Exported Functions - @{ -*/ - -/** - * @brief Open Timer with Operate Mode and Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32Mode Operation mode. Possible options are - * - \ref TIMER_ONESHOT_MODE - * - \ref TIMER_PERIODIC_MODE - * - \ref TIMER_TOGGLE_MODE - * - \ref TIMER_CONTINUOUS_MODE - * @param[in] u32Freq Target working frequency - * - * @return Real timer working frequency - * - * @details This API is used to configure timer to operate in specified mode and frequency. - * If timer cannot work in target frequency, a closest frequency will be chose and returned. - * @note After calling this API, Timer is \b NOT running yet. But could start timer running be calling - * \ref TIMER_Start macro or program registers directly. - */ -uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Cmpr = 0UL, u32Prescale = 0UL; - - /* Fastest possible timer working freq is (u32Clk / 2). While cmpr = 2, prescaler = 0. */ - if (u32Freq > (u32Clk / 2UL)) - { - u32Cmpr = 2UL; - } - else - { - u32Cmpr = u32Clk / u32Freq; - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - - if (u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CTL = u32Mode | u32Prescale; - timer->CMP = u32Cmpr; - - return (u32Clk / (u32Cmpr * (u32Prescale + 1UL))); -} - -/** - * @brief Stop Timer Counting - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return None - * - * @details This API stops timer counting and disable all timer interrupt function. - */ -void TIMER_Close(TIMER_T *timer) -{ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; -} - -/** - * @brief Create a specify Delay Time - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32Usec Delay period in micro seconds. Valid values are between 100~1000000 (100 micro second ~ 1 second). - * - * @return None - * - * @details This API is used to create a delay loop for u32usec micro seconds by using timer one-shot mode. - * @note This API overwrites the register setting of the timer used to count the delay time. - * @note This API use polling mode. So there is no need to enable interrupt for the timer module used to generate delay. - */ -void TIMER_Delay(TIMER_T *timer, uint32_t u32Usec) -{ -#if 0 - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Prescale = 0UL, delay = (SystemCoreClock / u32Clk) + 1UL; - uint32_t u32Cmpr, u32NsecPerTick; - - /* Clear current timer configuration */ - timer->CTL = 0UL; - timer->EXTCTL = 0UL; - - if (u32Clk <= 1000000UL) /* min delay is 1000 us if timer clock source is <= 1 MHz */ - { - if (u32Usec < 1000UL) - { - u32Usec = 1000UL; - } - - if (u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - else - { - if (u32Usec < 100UL) - { - u32Usec = 100UL; - } - - if (u32Usec > 1000000UL) - { - u32Usec = 1000000UL; - } - } - - if (u32Clk <= 1000000UL) - { - u32Prescale = 0UL; - u32NsecPerTick = 1000000000UL / u32Clk; - u32Cmpr = (u32Usec * 1000UL) / u32NsecPerTick; - } - else - { - u32Cmpr = u32Usec * (u32Clk / 1000000UL); - u32Prescale = (u32Cmpr >> 24); /* for 24 bits CMPDAT */ - - if (u32Prescale > 0UL) - u32Cmpr = u32Cmpr / (u32Prescale + 1UL); - } - - timer->CMP = u32Cmpr; - timer->CTL = TIMER_CTL_CNTEN_Msk | TIMER_ONESHOT_MODE | u32Prescale; - - /* When system clock is faster than timer clock, it is possible timer active bit cannot set in time while we check it. - And the while loop below return immediately, so put a tiny delay here allowing timer start counting and raise active flag. */ - for (; delay > 0UL; delay--) - { - __NOP(); - } - - while (timer->CTL & TIMER_CTL_ACTSTS_Msk) - { - ; - } -#endif -} - -/** - * @brief Enable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32CapMode Timer capture mode. Could be - * - \ref TIMER_CAPTURE_FREE_COUNTING_MODE - * - \ref TIMER_CAPTURE_COUNTER_RESET_MODE - * @param[in] u32Edge Timer capture trigger edge. Possible values are - * - \ref TIMER_CAPTURE_EVENT_FALLING - * - \ref TIMER_CAPTURE_EVENT_RISING - * - \ref TIMER_CAPTURE_EVENT_FALLING_RISING - * - \ref TIMER_CAPTURE_EVENT_RISING_FALLING - * - * @return None - * - * @details This API is used to enable timer capture function with specify capture trigger edge \n - * to get current counter value or reset counter value to 0. - * @note Timer frequency should be configured separately by using \ref TIMER_Open API, or program registers directly. - */ -void TIMER_EnableCapture(TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~(TIMER_EXTCTL_CAPFUNCS_Msk | TIMER_EXTCTL_CAPEDGE_Msk)) | - u32CapMode | u32Edge | TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Disable Timer Capture Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. - * - * @return None - * - * @details This API is used to disable the timer capture function. - */ -void TIMER_DisableCapture(TIMER_T *timer) -{ - timer->EXTCTL &= ~TIMER_EXTCTL_CAPEN_Msk; -} - -/** - * @brief Enable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32Edge Detection edge of counter pin. Could be ether - * - \ref TIMER_COUNTER_EVENT_FALLING, or - * - \ref TIMER_COUNTER_EVENT_RISING - * - * @return None - * - * @details This function is used to enable the timer counter function with specify detection edge. - * @note Timer compare value should be configured separately by using \ref TIMER_SET_CMP_VALUE macro or program registers directly. - * @note While using event counter function, \ref TIMER_TOGGLE_MODE cannot set as timer operation mode. - */ -void TIMER_EnableEventCounter(TIMER_T *timer, uint32_t u32Edge) -{ - timer->EXTCTL = (timer->EXTCTL & ~TIMER_EXTCTL_CNTPHASE_Msk) | u32Edge; - timer->CTL |= TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Disable Timer Counter Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return None - * - * @details This API is used to disable the timer event counter function. - */ -void TIMER_DisableEventCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_EXTCNTEN_Msk; -} - -/** - * @brief Get Timer Clock Frequency - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return Timer clock frequency - * - * @details This API is used to get the timer clock frequency. - * @note This API cannot return correct clock rate if timer source is from external clock input. - */ -uint32_t TIMER_GetModuleClock(TIMER_T *timer) -{ - uint32_t u32Src, u32Clk; - const uint32_t au32Clk[] = {__HXT, __LXT, 0UL, 0UL, 0UL, __LIRC, 0UL, __HIRC}; - - if (timer == TIMER0) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR0SEL_Msk) >> CLK_CLKSEL1_TMR0SEL_Pos; - } - else if (timer == TIMER1) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR1SEL_Msk) >> CLK_CLKSEL1_TMR1SEL_Pos; - } - else if (timer == TIMER2) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR2SEL_Msk) >> CLK_CLKSEL1_TMR2SEL_Pos; - } - else if (timer == TIMER3) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR3SEL_Msk) >> CLK_CLKSEL1_TMR3SEL_Pos; - } - else if (timer == TIMER4) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR4SEL_Msk) >> CLK_CLKSEL1_TMR4SEL_Pos; - } - else if (timer == TIMER5) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR5SEL_Msk) >> CLK_CLKSEL1_TMR5SEL_Pos; - } - else if (timer == TIMER6) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR6SEL_Msk) >> CLK_CLKSEL1_TMR6SEL_Pos; - } - else if (timer == TIMER7) - { - u32Src = (CLK->CLKSEL1 & CLK_CLKSEL1_TMR7SEL_Msk) >> CLK_CLKSEL1_TMR7SEL_Pos; - } - else if (timer == TIMER8) - { - u32Src = (CLK->CLKSEL2 & CLK_CLKSEL2_TMR8SEL_Msk) >> CLK_CLKSEL2_TMR8SEL_Pos; - } - else if (timer == TIMER9) - { - u32Src = (CLK->CLKSEL2 & CLK_CLKSEL2_TMR9SEL_Msk) >> CLK_CLKSEL2_TMR9SEL_Pos; - } - else if (timer == TIMER10) - { - u32Src = (CLK->CLKSEL2 & CLK_CLKSEL2_TMR10SEL_Msk) >> CLK_CLKSEL2_TMR10SEL_Pos; - } - else /* Timer 11 */ - { - u32Src = (CLK->CLKSEL2 & CLK_CLKSEL2_TMR11SEL_Msk) >> CLK_CLKSEL2_TMR11SEL_Pos; - } - - if (u32Src == 2UL) - { - u32Clk = CLK_GetSYSCLK1Freq(); - } - else - { - u32Clk = au32Clk[u32Src]; - } - - return u32Clk; -} - - - -/** - * @brief This function is used to enable the Timer frequency counter function - * @param[in] timer The base address of Timer module. Can be \ref TIMER2 or \ref TIMER4 - * @param[in] u32DropCount This parameter has no effect - * @param[in] u32Timeout This parameter has no effect - * @param[in] u32EnableInt Enable interrupt assertion after capture complete or not. Valid values are TRUE and FALSE - * @return None - * @details This function is used to calculate input event frequency. After enable - * this function, a pair of timers, TIMER2 and TIMER3, or TIMER4 and TIMER5 - * will be configured for this function. The mode used to calculate input - * event frequency is mentioned as "Inter Timer Trigger Mode" in Technical - * Reference Manual - */ -void TIMER_EnableFreqCounter(TIMER_T *timer, - uint32_t u32DropCount, - uint32_t u32Timeout, - uint32_t u32EnableInt) -{ - TIMER_T *t = NULL; /* store the timer base to configure compare value */ - - if (timer == TIMER0) - t = TIMER1; - else if (timer == TIMER2) - t = TIMER3; - else if (timer == TIMER4) - t = TIMER5; - else if (timer == TIMER6) - t = TIMER7; - else if (timer == TIMER8) - t = TIMER9; - else if (timer == TIMER10) - t = TIMER11; - else // Select error - return; - - t->CMP = 0xFFFFFFUL; - t->EXTCTL = u32EnableInt ? TIMER_EXTCTL_CAPIEN_Msk : 0UL; - timer->CTL = TIMER_CTL_INTRGEN_Msk | TIMER_CTL_CNTEN_Msk; - - return; -} -/** - * @brief This function is used to disable the Timer frequency counter function. - * @param[in] timer The base address of Timer module - * @return None - */ -void TIMER_DisableFreqCounter(TIMER_T *timer) -{ - timer->CTL &= ~TIMER_CTL_INTRGEN_Msk; -} - - -/** - * @brief This function is used to select the interrupt source used to trigger other modules. - * @param[in] timer The base address of Timer module - * @param[in] u32Src Selects the interrupt source to trigger other modules. Could be: - * - \ref TIMER_TRGSRC_TIMEOUT_EVENT - * - \ref TIMER_TRGSRC_CAPTURE_EVENT - * @return None - */ -void TIMER_SetTriggerSource(TIMER_T *timer, uint32_t u32Src) -{ - timer->TRGCTL = (timer->TRGCTL & ~TIMER_TRGCTL_TRGSSEL_Msk) | u32Src; -} - -/** - * @brief This function is used to set modules trigger by timer interrupt - * @param[in] timer The base address of Timer module - * @param[in] u32Mask The mask of modules (EPWM, EADC, DAC and PDMA) trigger by timer. Is the combination of - * - \ref TIMER_TRG_TO_EPWM, - * - \ref TIMER_TRG_TO_EADC, and - * - \ref TIMER_TRG_TO_PDMA - * @return None - */ -void TIMER_SetTriggerTarget(TIMER_T *timer, uint32_t u32Mask) -{ - timer->TRGCTL = (timer->TRGCTL & ~(TIMER_TRGCTL_TRGPWM_Msk | TIMER_TRGCTL_TRGEADC_Msk | TIMER_TRGCTL_TRGPDMA_Msk)) | u32Mask; -} - -/*@}*/ /* end of group TIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer_pwm.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer_pwm.c deleted file mode 100644 index 91185641095..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_timer_pwm.c +++ /dev/null @@ -1,437 +0,0 @@ -/**************************************************************************//** - * @file timer_pwm.c - * @brief Timer PWM Controller(Timer PWM) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_Driver TIMER PWM Driver - @{ -*/ - -/** @addtogroup TIMER_PWM_EXPORTED_FUNCTIONS TIMER PWM Exported Functions - @{ -*/ - -/** - * @brief Set PWM Counter Clock Source - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32CntClkSrc PWM counter clock source, could be one of following source - * - \ref TPWM_CNTR_CLKSRC_TMR_CLK - * - \ref TPWM_CNTR_CLKSRC_TIMER2_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER3_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER4_INT - * - \ref TPWM_CNTR_CLKSRC_TIMER5_INT - * - * @return None - * - * @details This function is used to set PWM counter clock source. - */ -void TPWM_SetCounterClockSource(TIMER_T *timer, uint32_t u32CntClkSrc) -{ - (timer)->PWMCLKSRC = ((timer)->PWMCLKSRC & ~TIMER_PWMCLKSRC_CLKSRC_Msk) | u32CntClkSrc; -} - -/** - * @brief Configure PWM Output Frequency and Duty Cycle - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32Frequency Target generator frequency. - * @param[in] u32DutyCycle Target generator duty cycle percentage. Valid range are between 0~100. 10 means 10%, 20 means 20%... - * - * @return Nearest frequency clock in nano second - * - * @details This API is used to configure PWM output frequency and duty cycle in up count type and auto-reload operation mode. - * @note This API is only available if Timer PWM counter clock source is from TMRx_CLK. - */ -uint32_t TPWM_ConfigOutputFreqAndDuty(TIMER_T *timer, uint32_t u32Frequency, uint32_t u32DutyCycle) -{ - uint32_t u32PWMClockFreq, u32TargetFreq; - uint32_t u32Prescaler = 0x1000UL, u32Period, u32CMP; - - u32PWMClockFreq = CLK_GetSYSCLK1Freq(); - - /* Calculate u16PERIOD and u16PSC */ - for (u32Prescaler = 1UL; u32Prescaler <= 0x1000UL; u32Prescaler++) - { - u32Period = (u32PWMClockFreq / u32Prescaler) / u32Frequency; - - /* If target u32Period is larger than 0x10000, need to use a larger prescaler */ - if (u32Period <= 0x10000UL) - { - break; - } - } - - /* Store return value here 'cos we're gonna change u32Prescaler & u32Period to the real value to fill into register */ - u32TargetFreq = (u32PWMClockFreq / u32Prescaler) / u32Period; - - /* Set PWM to up count type */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTTYPE_Msk) | (TPWM_UP_COUNT << TIMER_PWMCTL_CNTTYPE_Pos); - - /* Set PWM to auto-reload mode */ - timer->PWMCTL = (timer->PWMCTL & ~TIMER_PWMCTL_CNTMODE_Msk) | TPWM_AUTO_RELOAD_MODE; - - /* Convert to real register value */ - TPWM_SET_PRESCALER(timer, (u32Prescaler - 1UL)); - - TPWM_SET_PERIOD(timer, (u32Period - 1UL)); - - if (u32DutyCycle) - { - u32CMP = (u32DutyCycle * u32Period) / 100UL; - } - else - { - u32CMP = 0UL; - } - - TPWM_SET_CMPDAT(timer, u32CMP); - - return (u32TargetFreq); -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the same as Timer PWM clock source. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableDeadTime(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Enable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32DTCount Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. - * - * @return None - * - * @details This function is used to enable Dead-Time function and counter source is the Timer PWM clock source with prescale. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableDeadTimeWithPrescale(TIMER_T *timer, uint32_t u32DTCount) -{ - timer->PWMDTCTL = TIMER_PWMDTCTL_DTCKSEL_Msk | TIMER_PWMDTCTL_DTEN_Msk | u32DTCount; -} - -/** - * @brief Disable Dead-Time Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return None - * - * @details This function is used to enable Dead-time of selected channel. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_DisableDeadTime(TIMER_T *timer) -{ - timer->PWMDTCTL = 0x0UL; -} - -/** - * @brief Enable PWM Counter - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return None - * - * @details This function is used to enable PWM generator and start counter counting. - */ -void TPWM_EnableCounter(TIMER_T *timer) -{ - timer->PWMCTL |= TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Disable PWM Generator - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return None - * - * @details This function is used to disable PWM counter immediately by clear CNTEN (TIMERx_PWMCTL[0]) bit. - */ -void TPWM_DisableCounter(TIMER_T *timer) -{ - timer->PWMCTL &= ~TIMER_PWMCTL_CNTEN_Msk; -} - -/** - * @brief Enable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32Condition The condition to trigger ADC. It could be one of following conditions: - * - \ref TPWM_TRIGGER_ADC_AT_ZERO_POINT - * - \ref TPWM_TRIGGER_ADC_AT_PERIOD_POINT - * - \ref TPWM_TRIGGER_ADC_AT_ZERO_OR_PERIOD_POINT - * - \ref TPWM_TRIGGER_ADC_AT_COMPARE_UP_COUNT_POINT - * - \ref TPWM_TRIGGER_ADC_AT_COMPARE_DOWN_COUNT_POINT - * - * @return None - * - * @details This function is used to enable specified counter compare event to trigger ADC. - */ -void TPWM_EnableTriggerADC(TIMER_T *timer, uint32_t u32Condition) -{ - timer->PWMEADCTS = TIMER_PWMEADCTS_TRGEN_Msk | u32Condition; -} - -/** - * @brief Disable Trigger ADC - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return None - * - * @details This function is used to disable counter compare event to trigger ADC. - */ -void TPWM_DisableTriggerADC(TIMER_T *timer) -{ - timer->PWMEADCTS = 0x0UL; -} - -/** - * @brief Enable Fault Brake Function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32CH0Level PWMx_CH0 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32CH1Level PWMx_CH1 output level while fault brake event occurs. Valid value is one of following setting - * - \ref TPWM_OUTPUT_TOGGLE - * - \ref TPWM_OUTPUT_NOTHING - * - \ref TPWM_OUTPUT_LOW - * - \ref TPWM_OUTPUT_HIGH - * @param[in] u32BrakeSource Fault brake source, combination of following source - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_EDGE_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_EDGE_BKPIN - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_EDGE_SYS_RAM - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP0 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_ACMP1 - * - \ref TPWM_BRAKE_SOURCE_LEVEL_BKPIN - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_CSS - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_BOD - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_COR - * - \ref TPWM_BRAKE_SOURCE_LEVEL_SYS_RAM - * - * @return None - * - * @details This function is used to enable fault brake function. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableFaultBrake(TIMER_T *timer, uint32_t u32CH0Level, uint32_t u32CH1Level, uint32_t u32BrakeSource) -{ - timer->PWMFAILBRK |= ((u32BrakeSource >> 16) & 0xFUL); - timer->PWMBRKCTL = (timer->PWMBRKCTL & ~(TIMER_PWMBRKCTL_BRKAEVEN_Msk | TIMER_PWMBRKCTL_BRKAODD_Msk)) | - (u32BrakeSource & 0xFFFFUL) | (u32CH0Level << TIMER_PWMBRKCTL_BRKAEVEN_Pos) | (u32CH1Level << TIMER_PWMBRKCTL_BRKAODD_Pos); -} - -/** - * @brief Enable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to enable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_EnableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 |= u32IntSource; -} - -/** - * @brief Disable Fault Brake Interrupt - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to disable fault brake interrupt. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_DisableFaultBrakeInt(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTEN1 &= ~u32IntSource; -} - -/** - * @brief Indicate Fault Brake Interrupt Flag - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return Fault brake interrupt flag of specified source - * @retval 0 Fault brake interrupt did not occurred - * @retval 1 Fault brake interrupt occurred - * - * @details This function is used to indicate fault brake interrupt flag occurred or not of selected source. - */ -uint32_t TPWM_GetFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - return ((timer->PWMINTSTS1 & (0x3UL << u32IntSource)) ? 1UL : 0UL); -} - -/** - * @brief Clear Fault Brake Interrupt Flags - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32IntSource Interrupt source, could be one of following source - * - \ref TPWM_BRAKE_EDGE - * - \ref TPWM_BRAKE_LEVEL - * - * @return None - * - * @details This function is used to clear fault brake interrupt flags of selected source. - * @note The register write-protection function should be disabled before using this function. - */ -void TPWM_ClearFaultBrakeIntFlag(TIMER_T *timer, uint32_t u32IntSource) -{ - timer->PWMINTSTS1 = (0x3UL << u32IntSource); -} - -/** - * @brief Enable load mode of selected channel - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32LoadMode Timer PWM counter loading mode, could be one of following mode - * - \ref TPWM_LOAD_MODE_PERIOD - * - \ref TPWM_LOAD_MODE_IMMEDIATE - * - \ref TPWM_LOAD_MODE_CENTER - * - * @return None - * - * @details This function is used to enable load mode of selected channel. - * @note The default loading mode is period loading mode. - */ -void TPWM_SetLoadMode(TIMER_T *timer, uint32_t u32LoadMode) -{ - timer->PWMCTL = (timer->PWMCTL & ~(TIMER_PWMCTL_IMMLDEN_Msk | TIMER_PWMCTL_CTRLD_Msk)) | u32LoadMode; -} - -/** - * @brief Enable brake pin noise filter function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32BrakePinSrc The external brake pin source, could be one of following source - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * @param[in] u32DebounceCnt This value controls the real debounce sample time. - * The target debounce sample time is (debounce sample clock period) * (u32DebounceCnt). - * @param[in] u32ClkSrcSel Brake pin detector debounce clock source, could be one of following source - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_1 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_2 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_4 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_8 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_16 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_32 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_64 - * - \ref TPWM_BKP_DBCLK_PCLK_DIV_128 - * - * @return None - * - * @details This function is used to enable external brake pin detector noise filter function. - */ -void TPWM_EnableBrakePinDebounce(TIMER_T *timer, uint32_t u32BrakePinSrc, uint32_t u32DebounceCnt, uint32_t u32ClkSrcSel) -{ - timer->PWMBNF = (timer->PWMBNF & ~(TIMER_PWMBNF_BKPINSRC_Msk | TIMER_PWMBNF_BRKFCNT_Msk | TIMER_PWMBNF_BRKNFSEL_Msk)) | - (u32BrakePinSrc << TIMER_PWMBNF_BKPINSRC_Pos) | - (u32DebounceCnt << TIMER_PWMBNF_BRKFCNT_Pos) | - (u32ClkSrcSel << TIMER_PWMBNF_BRKNFSEL_Pos) | TIMER_PWMBNF_BRKNFEN_Msk; -} - -/** - * @brief Disable brake pin noise filter function - * - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * - * @return None - * - * @details This function is used to disable external brake pin detector noise filter function. - */ -void TPWM_DisableBrakePinDebounce(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKNFEN_Msk; -} - - -/** - * @brief Enable brake pin inverse function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @return None - * @details This function is used to enable PWM brake pin inverse function. - */ -void TPWM_EnableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF |= TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Disable brake pin inverse function - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @return None - * @details This function is used to disable PWM brake pin inverse function. - */ -void TPWM_DisableBrakePinInverse(TIMER_T *timer) -{ - timer->PWMBNF &= ~TIMER_PWMBNF_BRKPINV_Msk; -} - -/** - * @brief Set brake pin source - * @param[in] timer The pointer of the specified Timer module. It could be TIMER2 ~ TIMER11. - * @param[in] u32BrakePinNum Brake pin selection. One of the following: - * - \ref TPWM_TM_BRAKE0 - * - \ref TPWM_TM_BRAKE1 - * - \ref TPWM_TM_BRAKE2 - * - \ref TPWM_TM_BRAKE3 - * @return None - * @details This function is used to set PWM brake pin source. - */ -void TPWM_SetBrakePinSource(TIMER_T *timer, uint32_t u32BrakePinNum) -{ - timer->PWMBNF = (((timer)->PWMBNF & ~TIMER_PWMBNF_BKPINSRC_Msk) | (u32BrakePinNum << TIMER_PWMBNF_BKPINSRC_Pos)); -} - - -/*@}*/ /* end of group TIMER_PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group TIMER_PWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_uart.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_uart.c deleted file mode 100644 index 4b4a8a43f0e..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_uart.c +++ /dev/null @@ -1,545 +0,0 @@ -/**************************************************************************//** - * @file uart.c - * @brief UART driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -static void UART_GetSrcClkSetting(UART_T *uart, uint32_t *pu32ClkSrcFreq, uint32_t *pu32ClkDivNum); - -/** - * @brief This function make UART module be ready to transfer. - * @param[in] pu32ClkSrcFreq will return UART source clock frequency(In HZ). - * @param[in] pu32ClkSrcFreq will return UART source clock frequency(In HZ). - * @param[in] pu32ClkDivNum will return UART source clock divider. - * @return None. - * @details - * 0: HXT - * 1: SYSCLK1 - * 2: LXT - * 3: HIRC - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - */ - -static void UART_GetSrcClkSetting(UART_T *uart, uint32_t *pu32ClkSrcFreq, uint32_t *pu32ClkDivNum) -{ - uint32_t u32UartClkSrcSel = 0u, u32UartClkDivNum = 0u; - uint32_t u32SrcClkFreq = 0u; - uint32_t u32UartPort; - - if (uart == (UART_T *)UART16) - { - u32UartPort = 16; - } - else - { - u32UartPort = ((uint32_t)uart & 0xf0000) >> 16; - } - - if (u32UartPort < 8) - { - u32UartClkSrcSel = ((CLK->CLKSEL2 >> (16 + u32UartPort * 2)) & 0x3ul); - - if (u32UartPort < 4) - { - u32UartClkDivNum = ((CLK->CLKDIV1 >> ((u32UartPort + 4) * 4)) & 0xful); - } - else - { - u32UartClkDivNum = ((CLK->CLKDIV2 >> ((u32UartPort - 4) * 4)) & 0xful); - } - } - else if (u32UartPort <= 16) - { - u32UartClkSrcSel = ((CLK->CLKSEL3 >> ((u32UartPort - 8) * 2)) & 0x3ul); - - if (u32UartPort < 12) - { - u32UartClkDivNum = ((CLK->CLKDIV2 >> ((u32UartPort - 4) * 4)) & 0xful); - } - else - { - u32UartClkDivNum = ((CLK->CLKDIV3 >> ((u32UartPort - 12) * 4)) & 0xful); - } - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - switch (u32UartClkSrcSel) - { - case 0u: - u32SrcClkFreq = __HXT; - break; - case 1u: - u32SrcClkFreq = CLK_GetSYSCLK1Freq(); //TODO - break; - default: - u32SrcClkFreq = 0; - break; - } - - if (pu32ClkSrcFreq) - *pu32ClkSrcFreq = u32SrcClkFreq; - - if (pu32ClkDivNum) - *pu32ClkDivNum = u32UartClkDivNum; -} - -/** - * @brief Clear UART specified interrupt flag - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTSTS_WKIF_Msk : Wake-up interrupt - * - \ref UART_INTSTS_BUFEINT_Msk : Buffer Error interrupt - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status interrupt - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status interrupt - * - * @return None - * - * @details The function is used to clear UART specified interrupt flag. - */ - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag) -{ - - if (u32InterruptFlag & UART_INTSTS_RLSINT_Msk) /* Clear Receive Line Status Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_BIF_Msk | UART_FIFOSTS_FEF_Msk | UART_FIFOSTS_PEF_Msk; - uart->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_MODEMINT_Msk) /* Clear Modem Status Interrupt */ - { - uart->MODEMSTS |= UART_MODEMSTS_CTSDETF_Msk; - } - else - { - } - - if (u32InterruptFlag & UART_INTSTS_BUFEINT_Msk) /* Clear Buffer Error Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_RXOVIF_Msk | UART_FIFOSTS_TXOVIF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_WKINT_Msk) /* Clear Wake-up Interrupt */ - { - uart->WKSTS = UART_WKSTS_CTSWKF_Msk | UART_WKSTS_DATWKF_Msk | - UART_WKSTS_RFRTWKF_Msk | UART_WKSTS_RS485WKF_Msk | - UART_WKSTS_TOUTWKF_Msk; - } - -} - - -/** - * @brief Disable UART interrupt - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART interrupt. - */ -void UART_Close(UART_T *uart) -{ - uart->INTEN = 0ul; -} - - -/** - * @brief Disable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART auto flow control. - */ -void UART_DisableFlowCtrl(UART_T *uart) -{ - uart->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk); -} - - -/** - * @brief Disable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFEIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to disable UART specified interrupt and disable NVIC UART IRQ. - */ -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Disable UART specified interrupt */ - UART_DISABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Enable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to Enable UART auto flow control. - */ -void UART_EnableFlowCtrl(UART_T *uart) -{ - /* Set RTS pin output is low level active */ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - - /* Set CTS pin input is low level active */ - uart->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk; - - /* Set RTS and CTS auto flow control enable */ - uart->INTEN |= UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk; -} - - -/** - * @brief The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module: - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_BUFEIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - */ -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Enable UART specified interrupt */ - UART_ENABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Open and set UART function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The baudrate of UART module. - * - * @return None - * - * @details This function use to enable UART function and set baud-rate. - */ -void UART_Open(UART_T *uart, uint32_t u32baudrate) -{ - uint32_t u32UartSrcClkFreq = 0ul, u32UartClkDivNum = 0ul; - uint32_t u32Baud_Div = 0ul; - - /* Select UART function */ - uart->FUNCSEL = UART_FUNCSEL_UART; - - /* Set UART line configuration */ - uart->LINE = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1; - - /* Set UART Rx and RTS trigger level */ - uart->FIFO &= ~(UART_FIFO_RFITL_Msk | UART_FIFO_RTSTRGLV_Msk); - - /* Get Source clock frequency and its divider of curret setting */ - UART_GetSrcClkSetting(uart, &u32UartSrcClkFreq, &u32UartClkDivNum); - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER(u32UartSrcClkFreq / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER(u32UartSrcClkFreq / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } -} - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive FIFO. - * @param[in] u32ReadBytes The the read bytes number of data. - * - * @return u32Count Receive byte count - * - * @details The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf. - */ -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while (uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - pu8RxBuf[u32Count] = (uint8_t)uart->DAT; /* Get Data from UART RX */ - } - } - - return u32Count; - -} - - -/** - * @brief Set UART line configuration - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The register value of baudrate of UART module. - * If u32baudrate = 0, UART baudrate will not change. - * @param[in] u32data_width The data length of UART module. - * - \ref UART_WORD_LEN_5 - * - \ref UART_WORD_LEN_6 - * - \ref UART_WORD_LEN_7 - * - \ref UART_WORD_LEN_8 - * @param[in] u32parity The parity setting (none/odd/even/mark/space) of UART module. - * - \ref UART_PARITY_NONE - * - \ref UART_PARITY_ODD - * - \ref UART_PARITY_EVEN - * - \ref UART_PARITY_MARK - * - \ref UART_PARITY_SPACE - * @param[in] u32stop_bits The stop bit length (1/1.5/2 bit) of UART module. - * - \ref UART_STOP_BIT_1 - * - \ref UART_STOP_BIT_1_5 - * - \ref UART_STOP_BIT_2 - * - * @return None - * - * @details This function use to config UART line setting. - */ -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32UartSrcClkFreq = 0ul, u32UartClkDivNum = 0ul; - uint32_t u32Baud_Div = 0ul; - - /* Get Source clock frequency and its divider of curret setting */ - UART_GetSrcClkSetting(uart, &u32UartSrcClkFreq, &u32UartClkDivNum); - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER(u32UartSrcClkFreq / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER(u32UartSrcClkFreq / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } - - /* Set UART line configuration */ - uart->LINE = u32data_width | u32parity | u32stop_bits; -} - - -/** - * @brief Set Rx timeout count - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32TOC Rx timeout counter. - * - * @return None - * - * @details This function use to set Rx timeout count. - */ -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC) -{ - /* Set time-out interrupt comparator */ - uart->TOUT = (uart->TOUT & ~UART_TOUT_TOIC_Msk) | (u32TOC); - - /* Set time-out counter enable */ - uart->INTEN |= UART_INTEN_TOCNTEN_Msk; -} - - -/** - * @brief Select and configure IrDA function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Buadrate The baudrate of UART module. - * @param[in] u32Direction The direction of UART module in IrDA mode: - * - \ref UART_IRDA_TXEN - * - \ref UART_IRDA_RXEN - * - * @return None - * - * @details The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate. - */ -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction) -{ - uint32_t u32UartSrcClkFreq = 0ul, u32UartClkDivNum = 0ul; - uint32_t u32Baud_Div; - - /* Select IrDA function mode */ - uart->FUNCSEL = UART_FUNCSEL_IrDA; - - /* Get Source clock frequency and its divider of curret setting */ - UART_GetSrcClkSetting(uart, &u32UartSrcClkFreq, &u32UartClkDivNum); - - /* Set UART IrDA baud rate in mode 0 */ - if (u32Buadrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE0_DIVIDER(u32UartSrcClkFreq / (u32UartClkDivNum + 1ul), u32Buadrate); - - if (u32Baud_Div < 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | u32Baud_Div); - } - else - { - } - } - - /* Configure IrDA relative settings */ - if (u32Direction == UART_IRDA_RXEN) - { - uart->IRDA |= UART_IRDA_RXINV_Msk; /*Rx signal is inverse*/ - uart->IRDA &= ~UART_IRDA_TXEN_Msk; - } - else - { - uart->IRDA &= ~UART_IRDA_TXINV_Msk; /*Tx signal is not inverse*/ - uart->IRDA |= UART_IRDA_TXEN_Msk; - } - -} - - -/** - * @brief Select and configure RS485 function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The operation mode(NMM/AUD/AAD). - * - \ref UART_ALTCTL_RS485NMM_Msk - * - \ref UART_ALTCTL_RS485AUD_Msk - * - \ref UART_ALTCTL_RS485AAD_Msk - * @param[in] u32Addr The RS485 address. - * - * @return None - * - * @details The function is used to set RS485 relative setting. - */ -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr) -{ - /* Select UART RS485 function mode */ - uart->FUNCSEL = UART_FUNCSEL_RS485; - - /* Set RS585 configuration */ - uart->ALTCTL &= ~(UART_ALTCTL_RS485NMM_Msk | UART_ALTCTL_RS485AUD_Msk | UART_ALTCTL_RS485AAD_Msk | UART_ALTCTL_ADDRMV_Msk); - uart->ALTCTL |= (u32Mode | (u32Addr << UART_ALTCTL_ADDRMV_Pos)); -} - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8TxBuf The buffer to send the data to UART transmission FIFO. - * @param[out] u32WriteBytes The byte number of data. - * - * @return u32Count transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by UART. - */ -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while (uart->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) /* Check Tx Full */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - uart->DAT = pu8TxBuf[u32Count]; /* Send UART Data from buffer */ - } - } - - return u32Count; -} - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wdt.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wdt.c deleted file mode 100644 index 71a8efc2d2d..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wdt.c +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************//** - * @file wdt.c - * @brief WDT driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Initialize WDT and start counting - * @param[in] wdt WDT instance. - * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: - * - \ref WDT_TIMEOUT_2POW4 - * - \ref WDT_TIMEOUT_2POW6 - * - \ref WDT_TIMEOUT_2POW8 - * - \ref WDT_TIMEOUT_2POW10 - * - \ref WDT_TIMEOUT_2POW12 - * - \ref WDT_TIMEOUT_2POW14 - * - \ref WDT_TIMEOUT_2POW16 - * - \ref WDT_TIMEOUT_2POW18 - * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: - * - \ref WDT_RESET_DELAY_1026CLK - * - \ref WDT_RESET_DELAY_130CLK - * - \ref WDT_RESET_DELAY_18CLK - * - \ref WDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable WDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - */ -void WDT_Open(WDT_T *wdt, - uint32_t u32TimeoutInterval, - uint32_t u32ResetDelay, - uint32_t u32EnableReset, - uint32_t u32EnableWakeup) -{ - wdt->ALTCTL = u32ResetDelay; - - wdt->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk | - (u32EnableReset << WDT_CTL_RSTEN_Pos) | - (u32EnableWakeup << WDT_CTL_WKEN_Pos); - return; -} - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_whc.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_whc.c deleted file mode 100644 index 3065fb8ff27..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_whc.c +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************//** - * @file whc.c - * @brief WHC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WHC_Driver WHC Driver - @{ -*/ - -/** @addtogroup WHC_EXPORTED_FUNCTIONS WHC Exported Functions - @{ -*/ - -/** - * @brief Send message through a wormhole channel - * @param[in] whc The pointer of the specified WHC module. - * @param[in] u32Ch WHC channel, valid channel numbers are 0~3 - * @param[in] pu32TxBuf The buffer holds the data to send - * @retval 0 Success - * @retval -1 Failed. Channel is busy, previous message hasn't been read yet. - */ -int WHC_Send(WHC_T *whc, uint32_t u32Ch, uint32_t *pu32TxBuf) -{ - int i; - - if (whc->TXSTS & (1ul << u32Ch)) - { - for (i = 0; i < WHC_BUFFER_LEN; i++) - whc->TMDAT[u32Ch][i] = *pu32TxBuf++; - whc->TXCTL = (1ul << u32Ch); - } - else - { - return -1; - - } - return 0; -} - -/** - * @brief Receive message from a wormhole channel - * @param[in] whc The pointer of the specified WHC module. - * @param[in] u32Ch WHC channel, valid channel numbers are 0~3 - * @param[out] pu32RxBuf The buffer to hold the receive data - * @retval 0 Success - * @retval -1 Failed. Channel is empty and no message is available for read. - * @Note This function send an ACK signal after receive complete - */ -int WHC_Recv(WHC_T *whc, uint32_t u32Ch, uint32_t *pu32RxBuf) -{ - int i; - - if (whc->RXSTS & (1ul << u32Ch)) - { - for (i = 0; i < WHC_BUFFER_LEN; i++) - *pu32RxBuf++ = whc->RMDAT[u32Ch][i]; - whc->RXCTL = (1ul << u32Ch); - } - else - { - return -1; - - } - return 0; -} - -/** - * @brief Get counter part status - * @param[in] whc The pointer of the specified WHC module. - * @param[in] u32Core Core number, valid channel numbers are 0~1 - * @retval \ref WHC_RUN_MODE - * @retval \ref WHC_POFF_MODE - * @retval \ref WHC_PD_MODE - */ -int WHC_GetCPSts(WHC_T *whc, uint32_t u32Core) -{ - if (u32Core == 0) - { - return (whc->CPSTS & WHC_CPSTS_OPMODE0_Msk) >> WHC_CPSTS_OPMODE0_Pos; - } - else - { - return (whc->CPSTS & WHC_CPSTS_OPMODE1_Msk) >> WHC_CPSTS_OPMODE1_Pos; - } -} - -/*@}*/ /* end of group WHC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WHC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wwdt.c b/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wwdt.c deleted file mode 100644 index aa0903b5066..00000000000 --- a/bsp/nuvoton/libraries/ma35/StdDriver/src/nu_wwdt.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************//** - * @file wwdt.c - * @brief WWDT driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "NuMicro.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - -/** - * @brief Open WWDT and start counting - * - * @param[in] u32PreScale Pre-scale setting of WWDT counter. Valid values are: - * - \ref WWDT_PRESCALER_1 - * - \ref WWDT_PRESCALER_2 - * - \ref WWDT_PRESCALER_4 - * - \ref WWDT_PRESCALER_8 - * - \ref WWDT_PRESCALER_16 - * - \ref WWDT_PRESCALER_32 - * - \ref WWDT_PRESCALER_64 - * - \ref WWDT_PRESCALER_128 - * - \ref WWDT_PRESCALER_192 - * - \ref WWDT_PRESCALER_256 - * - \ref WWDT_PRESCALER_384 - * - \ref WWDT_PRESCALER_512 - * - \ref WWDT_PRESCALER_768 - * - \ref WWDT_PRESCALER_1024 - * - \ref WWDT_PRESCALER_1536 - * - \ref WWDT_PRESCALER_2048 - * @param[in] u32CmpValue Setting the window compared value. Valid values are between 0x0 to 0x3F. - * @param[in] u32EnableInt Enable WWDT time-out interrupt function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WWDT module start counting with different counter period by pre-scale setting and compared window value. - * @note This WWDT_CTL register can be write only one time after chip is powered on or reset. - */ -void WWDT_Open(uint32_t u32PreScale, - uint32_t u32CmpValue, - uint32_t u32EnableInt) -{ - WWDT2->CTL = u32PreScale | - (u32CmpValue << WWDT_CTL_CMPDAT_Pos) | - ((u32EnableInt == TRUE) ? WWDT_CTL_INTEN_Msk : 0U) | - WWDT_CTL_WWDTEN_Msk; - return; -} - -/*@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WWDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/SConscript b/bsp/nuvoton/libraries/ma35/UsbHostLib/SConscript deleted file mode 100644 index 06c6912a6db..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -group = [] -if GetDepend('BSP_USING_USBH'): - src = Glob('*src/*.c') + Glob('src/*.cpp') - CPPPATH = [cwd + '/inc'] - group = DefineGroup('ma35d1_usbhostlib', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/config.h b/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/config.h deleted file mode 100644 index 327abb47da8..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/config.h +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************//** - * @file config.h - * @version V1.00 - * @brief This header file defines the configuration of USB Host library. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_CONFIG_H_ -#define _USBH_CONFIG_H_ - - -/// @cond HIDDEN_SYMBOLS - -#include -#include "NuMicro.h" -#include "nu_sys.h" -#include "drv_sys.h" - - -/*----------------------------------------------------------------------------------------*/ -/* Hardware settings */ -/*----------------------------------------------------------------------------------------*/ -#define HCLK_MHZ 700 /* used for loop-delay. must be larger than - true HCLK clock MHz */ - -static __inline void ENABLE_OHCI_IRQ(void) -{ - rt_hw_interrupt_umask(USBH0_IRQn); - rt_hw_interrupt_umask(USBH1_IRQn); -} -static __inline void DISABLE_OHCI_IRQ(void) -{ - rt_hw_interrupt_mask(USBH0_IRQn); - rt_hw_interrupt_mask(USBH1_IRQn); -} -static __inline void ENABLE_EHCI_IRQ(void) -{ - rt_hw_interrupt_umask(HSUSBH0_IRQn); - rt_hw_interrupt_umask(HSUSBH1_IRQn); -} -static __inline void DISABLE_EHCI_IRQ(void) -{ - rt_hw_interrupt_mask(HSUSBH0_IRQn); - rt_hw_interrupt_mask(HSUSBH1_IRQn); -} - - -#if defined(BSP_USING_HSUSBH0) - #define ENABLE_EHCI0 - #define ENABLE_OHCI0 -#endif - -#if defined(BSP_USING_HSUSBH1) - #define ENABLE_EHCI1 - #define ENABLE_OHCI1 -#endif - -#define EHCI_PORT_CNT 1 /* Number of EHCI roothub ports */ -#define OHCI_PORT_CNT 1 /* Number of OHCI roothub ports */ -#define OHCI_PER_PORT_POWER /* OHCI root hub per port powered */ - -#define OHCI_ISO_DELAY 4 /* preserved number frames while scheduling - OHCI isochronous transfer */ - -#define EHCI_ISO_DELAY 2 /* preserved number of frames while - scheduling EHCI isochronous transfer */ - -#define EHCI_ISO_RCLM_RANGE 32 /* When inspecting activated iTD/siTD, - unconditionally reclaim iTD/isTD scheduled - in just elapsed EHCI_ISO_RCLM_RANGE ms. */ - -#define MAX_DESC_BUFF_SIZE 4096 /* To hold the configuration descriptor, USB - core will allocate a buffer with this size - for each connected device. USB core does - not release it until device disconnected. */ - -/*----------------------------------------------------------------------------------------*/ -/* Memory allocation settings */ -/*----------------------------------------------------------------------------------------*/ - -#define STATIC_MEMORY_ALLOC 0 /* pre-allocate static memory blocks. No dynamic memory aloocation. - But the maximum number of connected devices and transfers are - limited. */ - -#define MAX_UDEV_DRIVER 8 /*!< Maximum number of registered drivers */ -#define MAX_ALT_PER_IFACE 32 /*!< maximum number of alternative interfaces per interface */ -#define MAX_EP_PER_IFACE 6 /*!< maximum number of endpoints per interface */ -#define MAX_HUB_DEVICE 8 /*!< Maximum number of hub devices */ - -/* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI - are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE. - May allocate one or more units depend on hardware descriptor type. */ - -#define MEM_POOL_UNIT_SIZE 256 /*!< A fixed hard coding setting. Do not change it! */ -#define MEM_POOL_UNIT_NUM 64 /*!< Increase this or heap size if memory allocate failed. */ - -/*----------------------------------------------------------------------------------------*/ -/* Re-defined staff for various compiler */ -/*----------------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ - #define __inline inline -#endif - - -/*----------------------------------------------------------------------------------------*/ -/* Debug settings */ -/*----------------------------------------------------------------------------------------*/ -//#define ENABLE_ERROR_MSG /* enable debug messages */ -//#define ENABLE_DEBUG_MSG /* enable debug messages */ -//#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */ -//#define DUMP_DESCRIPTOR /* dump descriptors */ - -#ifdef ENABLE_ERROR_MSG - #define USB_error rt_kprintf -#else - #define USB_error(...) -#endif - -#ifdef ENABLE_DEBUG_MSG - #define USB_debug rt_kprintf - #ifdef ENABLE_VERBOSE_DEBUG - #define USB_vdebug rt_kprintf - #else - #define USB_vdebug(...) - #endif -#else - #define USB_debug(...) - #define USB_vdebug(...) -#endif -#define ptr_to_u32(x) ((uint32_t)(x)) - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_CONFIG_H_ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/ehci.h b/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/ehci.h deleted file mode 100644 index a5dbe01a116..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/ehci.h +++ /dev/null @@ -1,277 +0,0 @@ -/**************************************************************************//** - * @file ehci.h - * @version V1.00 - * @brief USB EHCI host controller driver header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_EHCI_H_ -#define _USBH_EHCI_H_ - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct qh_t; -struct iso_ep_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------------*/ -/* Periodic Frame List Size (256, 512, or 1024) */ -/*----------------------------------------------------------------------------------------*/ -#define FL_SIZE 1024 /* frame list size can be 256, 512, or 1024 */ -#define NUM_IQH 11 /* depends on FL_SIZE, 256:9, 512:10, 1024:11 */ - - -/*----------------------------------------------------------------------------------------*/ -/* Interrupt Threshold Control (1, 2, 4, 6, .. 64) */ -/*----------------------------------------------------------------------------------------*/ -#define UCMDR_INT_THR_CTRL (0x1< of QH */ -} qTD_T; - - -#define QTD_LIST_END 0x1 /* Indicate the terminate of qTD list. */ -#define QTD_PTR(x) ((qTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Status: qTD Token[7:0] - */ -#define QTD_STS_PS_OUT (0<<0) /* directs the HC to issue an OUT PID */ -#define QTD_STS_PS_PING (1<<0) /* directs the HC to issue an PING PID */ -#define QTD_STS_SPLIT_STRAT (0<<1) /* directs the HC to issue an Start split */ -#define QTD_STS_SPLIT_COMPLETE (1<<1) /* directs the HC to issue an Complete split */ -#define QTD_STS_MISS_MF (1<<2) /* miss a required complete-split transaction */ -#define QTD_STS_XactErr (1<<3) /* Transaction Error occurred */ -#define QTD_STS_BABBLE (1<<4) /* Babble Detected */ -#define QTD_STS_DATA_BUFF_ERR (1<<5) /* Data Buffer Error */ -#define QTD_STS_HALT (1<<6) /* Halted */ -#define QTD_STS_ACTIVE (1<<7) /* Active */ - -/* - * PID: qTD Token[9:8] - */ -#define QTD_PID_Msk (0x3<<8) -#define QTD_PID_OUT (0<<8) /* generates token (E1H) */ -#define QTD_PID_IN (1<<8) /* generates token (69H) */ -#define QTD_PID_SETUP (2<<8) /* generates token (2DH) */ - -#define QTD_ERR_COUNTER (3<<10) /* Token[11:10] */ -#define QTD_IOC (1<<15) /* Token[15] - Interrupt On Complete */ -#define QTD_TODO_LEN_Pos 16 /* Token[31:16] - Total Bytes to Transfer */ -#define QTD_TODO_LEN(x) (((x)>>16) & 0x7FFF) -#define QTD_DT (1UL<<31) /* Token[31] - Data Toggle */ - -/*----------------------------------------------------------------------------------------*/ -/* Queue Head (QH) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct qh_t -{ - /* OHCI spec. Endpoint descriptor */ - uint32_t HLink; /* Queue Head Horizontal Link Pointer */ - uint32_t Chrst; /* Endpoint Characteristics: QH DWord 1 */ - uint32_t Cap; /* Endpoint Capabilities: QH DWord 2 */ - uint32_t Curr_qTD; /* Current qTD Pointer */ - /* - * The followings are qTD Transfer Overlay - */ - uint32_t OL_Next_qTD; /* Next qTD Pointer */ - uint32_t OL_Alt_Next_qTD; /* Alternate Next qTD Pointer */ - uint32_t OL_Token; /* qTD Token */ - uint32_t OL_Bptr[5]; /* qTD Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - qTD_T *qtd_list; /* currently linked qTD transfers */ - qTD_T *done_list; /* currently linked qTD transfers */ - struct qh_t *next; /* point to the next QH in remove list */ -} QH_T; - -/* HLink[0] T field of "Queue Head Horizontal Link Pointer" */ -#define QH_HLNK_END 0x1 - -/* - * HLink[2:1] Typ field of "Queue Head Horizontal Link Pointer" - */ -#define QH_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define QH_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define QH_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define QH_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define QH_PTR(x) ((QH_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Bit fields of "Endpoint Characteristics" - */ -#define QH_NAK_RL (4L<<28) /* Chrst[31:28] - NAK Count Reload */ -#define QH_CTRL_EP_FLAG (1<<27) /* Chrst[27] - Control Endpoint Flag */ -#define QH_RCLM_LIST_HEAD (1<<15) /* Chrst[15] - Head of Reclamation List Flag */ -#define QH_DTC (1<<14) /* Chrst[14] - Data Toggle Control */ -#define QH_EPS_FULL (0<<12) /* Chrst[13:12] - Endpoint Speed (Full) */ -#define QH_EPS_LOW (1<<12) /* Chrst[13:12] - Endpoint Speed (Low) */ -#define QH_EPS_HIGH (2<<12) /* Chrst[13:12] - Endpoint Speed (High) */ -#define QH_I_NEXT (1<<7) /* Chrst[7] - Inactivate on Next Transaction */ - -/* - * Bit fields of "Endpoint Capabilities" - */ -#define QH_MULT_Pos 30 /* Cap[31:30] - High-Bandwidth Pipe Multiplier */ -#define QH_HUB_PORT_Pos 23 /* Cap[29:23] - Hub Port Number */ -#define QH_HUB_ADDR_Pos 16 /* Cap[22:16] - Hub Addr */ -#define QH_C_MASK_Msk 0xFF00 /* Cap[15:8] - uFrame C-mask */ -#define QH_S_MASK_Msk 0x00FF /* Cap[7:0] - uFrame S-mask */ - - -/*----------------------------------------------------------------------------------------*/ -/* Isochronous (High-Speed) Transfer Descriptor (iTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct itd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Transaction[8]; /* Transaction Status and Control */ - uint32_t Bptr[7]; /* Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint32_t buff_base; /* buffer base address */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint8_t trans_mask; /* mask of activated transactions in iTD */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct itd_t *next; /* used by software to maintain iTD list */ -} iTD_T; - -/* - * Next_Link[2:1] Typ field of "Next Schedule Element Pointer" Typ field - */ -#define ITD_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define ITD_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define ITD_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define ITD_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define ITD_PTR(x) ((iTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Transaction[8] - */ -#define ITD_STATUS(x) (((x)>>28)&0xF) -#define ITD_STATUS_ACTIVE (0x80000000UL) /* Active */ -#define ITD_STATUS_BUFF_ERR (0x40000000UL) /* Data Buffer Error */ -#define ITD_STATUS_BABBLE (0x20000000UL) /* Babble Detected */ -#define ITD_STATUS_XACT_ERR (0x10000000UL) /* Transcation Error */ - -#define ITD_XLEN_Pos 16 -#define ITD_XFER_LEN(x) (((x)>>16)&0xFFF) -#define ITD_IOC (1<<15) -#define ITD_PG_Pos 12 -#define ITD_XFER_OFF_Msk 0xFFF - -/* - * Bptr[7] - */ -#define ITD_BUFF_PAGE_Pos 12 -/* Bptr[0] */ -#define ITD_EP_NUM_Pos 8 -#define ITD_EP_NUM(itd) (((itd)->Bptr[0]>>8)&0xF) -#define ITD_DEV_ADDR_Pos 0 -#define ITD_DEV_ADDR(itd) ((itd)->Bptr[0]&0x7F) -/* Bptr[1] */ -#define ITD_DIR_IN (1<<11) -#define ITD_DIR_OUT (0<<11) -#define ITD_MAX_PKTSZ_Pos 0 -#define ITD_MAX_PKTSZ(itd) ((itd)->Bptr[1]&0x7FF) - -/*----------------------------------------------------------------------------------------*/ -/* Split Isochronous (Full-Speed) Transfer Descriptor (siTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct sitd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Chrst; /* Endpoint and Transaction Translator Characteristics */ - uint32_t Sched; /* Micro-frame Schedule Control */ - uint32_t StsCtrl; /* siTD Transfer Status and Control */ - uint32_t Bptr[2]; /* Buffer Page Pointer List */ - uint32_t BackLink; /* siTD Back Link Pointer */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct sitd_t *next; /* used by software to maintain siTD list */ -} siTD_T; - -#define SITD_LIST_END 0x1 /* Indicate the terminate of siTD list. */ - -#define SITD_XFER_IO_Msk (1UL<<31) -#define SITD_XFER_IN (1UL<<31) -#define SITD_XFER_OUT (0UL<<31) - -#define SITD_PORT_NUM_Pos 24 -#define SITD_HUB_ADDR_Pos 16 -#define SITD_EP_NUM_Pos 8 -#define SITD_DEV_ADDR_Pos 0 - -#define SITD_IOC (1UL<<31) -#define SITD_XFER_CNT_Pos 16 -#define SITD_XFER_CNT_Msk (0x3FF<>28) & 0x0F) -#define TD_CC_SET(td, cc) (td) = ((td) & 0x0FFFFFFF) | (((cc) & 0x0F) << 28) -#define TD_T_DATA0 0x02000000 -#define TD_T_DATA1 0x03000000 -#define TD_R 0x00040000 -#define TD_DP 0x00180000 -#define TD_DP_IN 0x00100000 -#define TD_DP_OUT 0x00080000 -#define MAXPSW 8 -/* steel TD reserved bits to keep driver data */ -#define TD_TYPE_Msk (0x3<<16) -#define TD_TYPE_CTRL (0x0<<16) -#define TD_TYPE_BULK (0x1<<16) -#define TD_TYPE_INT (0x2<<16) -#define TD_TYPE_ISO (0x3<<16) -#define TD_CTRL_Msk (0x7<<15) -#define TD_CTRL_DATA (1<<15) - - -/* - * The HCCA (Host Controller Communications Area) is a 256 byte - * structure defined in the OHCI spec. that the host controller is - * told the base address of. It must be 256-byte aligned. - */ -typedef struct -{ - uint32_t int_table[32]; /* Interrupt ED table */ - uint16_t frame_no; /* current frame number */ - uint16_t pad1; /* set to 0 on each frame_no change */ - uint32_t done_head; /* info returned for an interrupt */ - uint8_t reserved_for_hc[116]; -} HCCA_T; - - -/// @endcond - -#endif /* _USBH_OHCI_H_ */ diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usb.h b/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usb.h deleted file mode 100644 index ce223e6c6f0..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usb.h +++ /dev/null @@ -1,386 +0,0 @@ -/**************************************************************************//** - * @file usb.h - * @version V1.00 - * @brief USB Host library header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_H_ -#define _USBH_H_ - -#include "config.h" -#include "usbh_lib.h" -#include "ehci.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct hub_dev_t; -struct iface_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------*/ -/* USB device request setup packet */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) -{ - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} -DEV_REQ_T; - -/* - * bmRequestType[7] - Data transfer direction - */ -#define REQ_TYPE_OUT 0x00 -#define REQ_TYPE_IN 0x80 -/* - * bmRequestType[6:5] - Type - */ -#define REQ_TYPE_STD_DEV 0x00 -#define REQ_TYPE_CLASS_DEV 0x20 -#define REQ_TYPE_VENDOR_DEV 0x40 -/* - * bmRequestType[4:0] - Recipient - */ -#define REQ_TYPE_TO_DEV 0x00 -#define REQ_TYPE_TO_IFACE 0x01 -#define REQ_TYPE_TO_EP 0x02 -#define REQ_TYPE_TO_OTHER 0x03 -/* - * Standard Requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_SET_INTERFACE 0x0B -/* - * Descriptor Types - */ -#define USB_DT_STANDARD 0x00 -#define USB_DT_CLASS 0x20 -#define USB_DT_VENDOR 0x40 - -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIGURATION 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 -#define USB_DT_DEVICE_QUALIFIER 0x06 -#define USB_DT_OTHER_SPEED_CONF 0x07 -#define USB_DT_IFACE_POWER 0x08 - - - -/*----------------------------------------------------------------------------------*/ -/* USB standard descriptors */ -/*----------------------------------------------------------------------------------*/ - -/* Descriptor header */ -typedef struct __attribute__((__packed__)) -{ - uint8_t bLength; - uint8_t bDescriptorType; -} -DESC_HDR_T; - -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) /*!< device descriptor structure */ -{ - uint8_t bLength; /*!< Length of device descriptor */ - uint8_t bDescriptorType; /*!< Device descriptor type */ - uint16_t bcdUSB; /*!< USB version number */ - uint8_t bDeviceClass; /*!< Device class code */ - uint8_t bDeviceSubClass; /*!< Device subclass code */ - uint8_t bDeviceProtocol; /*!< Device protocol code */ - uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - uint16_t idVendor; /*!< Vendor ID */ - uint16_t idProduct; /*!< Product ID */ - uint16_t bcdDevice; /*!< Device ID */ - uint8_t iManufacturer; /*!< Manufacture description string ID */ - uint8_t iProduct; /*!< Product description string ID */ - uint8_t iSerialNumber; /*!< Serial number description string ID */ - uint8_t bNumConfigurations; /*!< Total number of configurations */ -} -DESC_DEV_T; /*!< device descriptor structure */ - -/* - * Configuration Descriptor - */ -typedef struct __attribute__((__packed__)) usb_config_descriptor /*!< Configuration descriptor structure */ -{ - uint8_t bLength; /*!< Length of configuration descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint16_t wTotalLength; /*!< Total length of this configuration */ - uint8_t bNumInterfaces; /*!< Total number of interfaces */ - uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - uint8_t iConfiguration; /*!< String descriptor ID */ - uint8_t bmAttributes; /*!< Configuration characteristics */ - uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ - -/* - * Interface Descriptor - */ -typedef struct __attribute__((__packed__))usb_interface_descriptor /*!< Interface descriptor structure */ -{ - uint8_t bLength; /*!< Length of interface descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bInterfaceNumber; /*!< Interface number */ - uint8_t bAlternateSetting; /*!< Alternate setting number */ - uint8_t bNumEndpoints; /*!< Number of endpoints */ - uint8_t bInterfaceClass; /*!< Interface class code */ - uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ - -/* - * Endpoint Descriptor - */ -typedef struct __attribute__((__packed__)) usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - uint8_t bLength; /*!< Length of endpoint descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bEndpointAddress; /*!< Endpoint address */ - uint8_t bmAttributes; /*!< Endpoint attribute */ - uint16_t wMaxPacketSize; /*!< Maximum packet size */ - uint8_t bInterval; /*!< Synchronous transfer interval */ - uint8_t bRefresh; /*!< Refresh */ - uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ - -/* - * Endpoint descriptor bEndpointAddress[7] - direction - */ -#define EP_ADDR_DIR_MASK 0x80 -#define EP_ADDR_DIR_IN 0x80 -#define EP_ADDR_DIR_OUT 0x00 - -/* - * Endpoint descriptor bmAttributes[1:0] - transfer type - */ -#define EP_ATTR_TT_MASK 0x03 -#define EP_ATTR_TT_CTRL 0x00 -#define EP_ATTR_TT_ISO 0x01 -#define EP_ATTR_TT_BULK 0x02 -#define EP_ATTR_TT_INT 0x03 - - -/*----------------------------------------------------------------------------------*/ -/* USB Host controller driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*init)(void); - void (*shutdown)(void); - void (*suspend)(void); - void (*resume)(void); - int (*ctrl_xfer)(struct utr_t *utr); - int (*bulk_xfer)(struct utr_t *utr); - int (*int_xfer)(struct utr_t *utr); - int (*iso_xfer)(struct utr_t *utr); - int (*quit_xfer)(struct utr_t *utr, struct ep_info_t *ep); - - /* root hub support */ - int (*rthub_port_reset)(int port); - int (*rthub_polling)(void); - void *hc_data; -} HC_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*probe)(struct iface_t *iface); - void (*disconnect)(struct iface_t *iface); - void (*suspend)(struct iface_t *iface); - void (*resume)(struct iface_t *iface); -} UDEV_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device */ -/*----------------------------------------------------------------------------------*/ - -typedef enum -{ - SPEED_LOW, - SPEED_FULL, - SPEED_HIGH -} SPEED_E; - -typedef struct ep_info_t -{ - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint8_t bInterval; - uint8_t bToggle; - uint16_t wMaxPacketSize; - void *hw_pipe; /*!< point to the HC assocaied endpoint \hideinitializer */ -} EP_INFO_T; - -typedef struct udev_t -{ - DESC_DEV_T descriptor; /*!< Device descriptor. \hideinitializer */ - struct hub_dev_t *parent; /*!< parent hub device \hideinitializer */ - uint8_t port_num; /*!< The hub port this device connected on \hideinitializer */ - uint8_t dev_num; /*!< device number \hideinitializer */ - int8_t cur_conf; /*!< Currentll selected configuration \hideinitializer */ - SPEED_E speed; /*!< device speed (low/full/high) \hideinitializer */ - /* - * The followings are lightweight USB stack internal used . - */ - uint8_t *cfd_buff; /*!< Configuration descriptor buffer. \hideinitializer */ - EP_INFO_T ep0; /*!< Endpoint 0 \hideinitializer */ - HC_DRV_T *hc_driver; /*!< host controller driver \hideinitializer */ - struct iface_t *iface_list; /*!< Working interface list \hideinitializer */ - struct udev_t *next; /*!< link for global usb device list \hideinitializer */ -} UDEV_T; - -typedef struct alt_iface_t -{ - DESC_IF_T *ifd; /*!< point to the location of this alternative interface descriptor in UDEV_T->cfd_buff */ - EP_INFO_T ep[MAX_EP_PER_IFACE]; /*!< endpoints of this alternative interface */ -} ALT_IFACE_T; - -typedef struct iface_t -{ - UDEV_T *udev; /*!< USB device \hideinitializer */ - uint8_t if_num; /*!< Interface number \hideinitializer */ - uint8_t num_alt; /*!< Number of alternative interface \hideinitializer */ - ALT_IFACE_T *aif; /*!< Point to the active alternative interface */ - ALT_IFACE_T alt[MAX_ALT_PER_IFACE]; /*!< List of alternative interface \hideinitializer */ - UDEV_DRV_T *driver; /*!< Interface associated driver \hideinitializer */ - void *context; /*!< Reference to device context \hideinitializer */ - struct iface_t *next; /*!< Point to next interface of the same device. Started from UDEV_T->iface_list \hideinitializer */ -} IFACE_T; - - -/*----------------------------------------------------------------------------------*/ -/* URB (USB Request Block) */ -/*----------------------------------------------------------------------------------*/ - -#define IF_PER_UTR 8 /* number of frames per UTR isochronous transfer (DO NOT modify it!) */ - -typedef void (*FUNC_UTR_T)(struct utr_t *); - -typedef struct utr_t -{ - UDEV_T *udev; /*!< point to associated USB device \hideinitializer */ - DEV_REQ_T setup; /*!< buffer for setup packet \hideinitializer */ - EP_INFO_T *ep; /*!< associated endpoint \hideinitializer */ - uint8_t *buff; /*!< transfer buffer \hideinitializer */ - uint8_t bIsTransferDone; /*!< tansfer done? \hideinitializer */ - uint32_t data_len; /*!< length of data to be transferred \hideinitializer */ - uint32_t xfer_len; /*!< length of transferred data \hideinitializer */ - uint8_t bIsoNewSched; /*!< New schedule isochronous transfer \hideinitializer */ - uint16_t iso_sf; /*!< Isochronous start frame number \hideinitializer */ - uint16_t iso_xlen[IF_PER_UTR]; /*!< transfer length of isochronous frames \hideinitializer */ - uint8_t *iso_buff[IF_PER_UTR]; /*!< transfer buffer address of isochronous frames \hideinitializer */ - int iso_status[IF_PER_UTR]; /*!< transfer status of isochronous frames \hideinitializer */ - int td_cnt; /*!< number of transfer descriptors \hideinitializer */ - int status; /*!< return status \hideinitializer */ - int interval; /*!< interrupt/isochronous interval \hideinitializer */ - void *context; /*!< point to deivce proprietary data area \hideinitializer */ - FUNC_UTR_T func; /*!< tansfer done call-back function \hideinitializer */ - struct utr_t *next; /* point to the next UTR of the same endpoint. \hideinitializer */ -} UTR_T; - - -/*----------------------------------------------------------------------------------*/ -/* Global variables */ -/*----------------------------------------------------------------------------------*/ -extern USBH_T *_ohci0, *_ohci1, *_ohci2; -extern HSUSBH_T *_ehci0, *_ehci1; - -extern HC_DRV_T ohci0_driver, ohci1_driver, ohci2_driver; -extern HC_DRV_T ehci0_driver, ehci1_driver; - -extern UDEV_T *g_udev_list; - -/*----------------------------------------------------------------------------------*/ -/* USB stack exported functions */ -/*----------------------------------------------------------------------------------*/ -extern void usbh_delay_ms(int msec); - -extern void usbh_dump_buff_bytes(uint8_t *buff, int nSize); -extern void usbh_dump_interface_descriptor(DESC_IF_T *if_desc); -extern void usbh_dump_endpoint_descriptor(DESC_EP_T *ep_desc); -extern void usbh_dump_iface(IFACE_T *iface); -extern void usbh_dump_ep_info(EP_INFO_T *ep); - -/* - * Memory management functions - */ -extern void USB_InitializeMemoryPool(void); -extern void *USB_malloc(int wanted_size, int boundary); -extern void USB_free(void *); -extern int USB_available_memory(void); -extern int USB_allocated_memory(void); -extern void usbh_memory_init(void); -extern uint32_t usbh_memory_used(void); -extern void *usbh_alloc_mem(int size); -extern void usbh_free_mem(void *p, int size); -extern int alloc_dev_address(void); -extern void free_dev_address(int dev_addr); -extern UDEV_T *alloc_device(void); -extern void free_device(UDEV_T *udev); -extern UTR_T *alloc_utr(UDEV_T *udev); -extern void free_utr(UTR_T *utr); -extern ED_T *alloc_ohci_ED(void); -extern void free_ohci_ED(ED_T *ed); -extern TD_T *alloc_ohci_TD(UTR_T *utr); -extern void free_ohci_TD(TD_T *td); -extern QH_T *alloc_ehci_QH(void); -extern void free_ehci_QH(QH_T *qh); -extern qTD_T *alloc_ehci_qTD(UTR_T *utr); -extern void free_ehci_qTD(qTD_T *qtd); -extern iTD_T *alloc_ehci_iTD(void); -extern void free_ehci_iTD(iTD_T *itd); -extern siTD_T *alloc_ehci_siTD(void); -extern void free_ehci_siTD(siTD_T *sitd); - - -extern void usbh_hub_init(void); -extern int usbh_connect_device(UDEV_T *); -extern void usbh_disconnect_device(UDEV_T *); -extern int usbh_register_driver(UDEV_DRV_T *driver); -extern EP_INFO_T *usbh_iface_find_ep(IFACE_T *iface, uint8_t ep_addr, uint8_t dir_type); -extern int usbh_reset_device(UDEV_T *); -extern int usbh_reset_port(UDEV_T *); - -/* - * USB Standard Request functions - */ -extern int usbh_get_device_descriptor(UDEV_T *udev, DESC_DEV_T *desc_buff); -extern int usbh_get_config_descriptor(UDEV_T *udev, uint8_t *desc_buff, int buff_len); -extern int usbh_set_configuration(UDEV_T *udev, uint8_t conf_val); -extern int usbh_set_interface(IFACE_T *iface, uint16_t alt_setting); -extern int usbh_clear_halt(UDEV_T *udev, uint16_t ep_addr); - -extern int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout); -extern int usbh_bulk_xfer(UTR_T *utr); -extern int usbh_int_xfer(UTR_T *utr); -extern int usbh_iso_xfer(UTR_T *utr); -extern int usbh_quit_utr(UTR_T *utr); -extern int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep); - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_H_ */ diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usbh_lib.h b/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usbh_lib.h deleted file mode 100644 index 90eb8c3de3a..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/inc/usbh_lib.h +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************//** - * @file usbh_lib.h - * @version V1.10 - * @brief USB Host library exported header file. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef _USBH_LIB_H_ -#define _USBH_LIB_H_ - -#include "NuMicro.h" - -#include "usb.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup LIBRARY Library - @{ -*/ - -/** @addtogroup USBH_Library USB Host Library - @{ -*/ - -/** @addtogroup USBH_EXPORTED_CONSTANTS USB Host Exported Constants - @{ -*/ - -#define USBH_OK 0 /*!< No error. */ -#define USBH_ERR_MEMORY_OUT -10 /*!< Out of memory. */ -#define USBH_ERR_IF_ALT_LIMIT -11 /*!< Number of alternative interface > MAX_ALT_PER_IFACE */ -#define USBH_ERR_IF_EP_LIMIT -15 /*!< Number of endpoints > MAX_EP_PER_IFACE */ -#define USBH_ERR_NOT_SUPPORTED -101 /*!< Device/Class/Transfer not supported */ -#define USBH_ERR_NOT_MATCHED -103 /*!< Not macthed */ -#define USBH_ERR_NOT_EXPECTED -104 /*!< Unknown or unexpected */ -#define USBH_ERR_INVALID_PARAM -105 /*!< Invalid parameter */ -#define USBH_ERR_NOT_FOUND -106 /*!< Device or interface not found */ -#define USBH_ERR_EP_NOT_FOUND -107 /*!< Endpoint not found */ -#define USBH_ERR_DESCRIPTOR -137 /*!< Failed to parse USB descriptors */ -#define USBH_ERR_SET_DEV_ADDR -139 /*!< Failed to set device address */ -#define USBH_ERR_SET_CONFIG -151 /*!< Failed to set device configuration */ - -#define USBH_ERR_TRANSFER -201 /*!< USB transfer error */ -#define USBH_ERR_TIMEOUT -203 /*!< USB transfer time-out */ -#define USBH_ERR_ABORT -205 /*!< USB transfer aborted due to disconnect or reset */ -#define USBH_ERR_PORT_RESET -255 /*!< Hub port reset failed */ -#define USBH_ERR_SCH_OVERRUN -257 /*!< USB isochronous schedule overrun */ -#define USBH_ERR_DISCONNECTED -259 /*!< USB device was disconnected */ - -#define USBH_ERR_TRANSACTION -271 /*!< USB transaction timeout, CRC, Bad PID, etc. */ -#define USBH_ERR_BABBLE_DETECTED -272 /*!< A 'babble' is detected during the transaction */ -#define USBH_ERR_DATA_BUFF -274 /*!< Data buffer overrun or underrun */ - -#define USBH_ERR_CC_NO_ERR -280 /*!< OHCI CC code - no error */ -#define USBH_ERR_CRC -281 /*!< USB trasfer CRC error */ -#define USBH_ERR_BIT_STUFF -282 /*!< USB transfer bit stuffing error */ -#define USBH_ERR_DATA_TOGGLE -283 /*!< USB trasfer data toggle error */ -#define USBH_ERR_STALL -284 /*!< USB trasfer STALL error */ -#define USBH_ERR_DEV_NO_RESP -285 /*!< USB trasfer device no response error */ -#define USBH_ERR_PID_CHECK -286 /*!< USB trasfer PID check failure */ -#define USBH_ERR_UNEXPECT_PID -287 /*!< USB trasfer unexpected PID error */ -#define USBH_ERR_DATA_OVERRUN -288 /*!< USB trasfer data overrun error */ -#define USBH_ERR_DATA_UNDERRUN -289 /*!< USB trasfer data underrun error */ -#define USBH_ERR_BUFF_OVERRUN -292 /*!< USB trasfer buffer overrun error */ -#define USBH_ERR_BUFF_UNDERRUN -293 /*!< USB trasfer buffer underrun error */ -#define USBH_ERR_NOT_ACCESS0 -294 /*!< USB trasfer not accessed error */ -#define USBH_ERR_NOT_ACCESS1 -295 /*!< USB trasfer not accessed error */ - -#define USBH_ERR_OHCI_INIT -301 /*!< Failed to initialize OHIC controller. */ -#define USBH_ERR_OHCI_EP_BUSY -303 /*!< The endpoint is under transfer. */ - -#define USBH_ERR_EHCI_INIT -501 /*!< Failed to initialize EHCI controller. */ -#define USBH_ERR_EHCI_QH_BUSY -503 /*!< the Queue Head is busy. */ - -#define UMAS_OK 0 /*!< No error. */ -#define UMAS_ERR_NO_DEVICE -1031 /*!< No Mass Stroage Device found. */ -#define UMAS_ERR_IO -1033 /*!< Device read/write failed. */ -#define UMAS_ERR_INIT_DEVICE -1035 /*!< failed to init MSC device */ -#define UMAS_ERR_CMD_STATUS -1037 /*!< SCSI command status failed */ -#define UMAS_ERR_IVALID_PARM -1038 /*!< Invalid parameter. */ -#define UMAS_ERR_DRIVE_NOT_FOUND -1039 /*!< drive not found */ - -#define HID_RET_OK 0 /*!< Return with no errors. */ -#define HID_RET_DEV_NOT_FOUND -1081 /*!< HID device not found or removed. */ -#define HID_RET_IO_ERR -1082 /*!< USB transfer failed. */ -#define HID_RET_INVALID_PARAMETER -1083 /*!< Invalid parameter. */ -#define HID_RET_OUT_OF_MEMORY -1084 /*!< Out of memory. */ -#define HID_RET_NOT_SUPPORTED -1085 /*!< Function not supported. */ -#define HID_RET_EP_NOT_FOUND -1086 /*!< Endpoint not found. */ -#define HID_RET_PARSING -1087 /*!< Failed to parse HID descriptor */ -#define HID_RET_XFER_IS_RUNNING -1089 /*!< The transfer has been enabled. */ -#define HID_RET_REPORT_NOT_FOUND -1090 /*!< The transfer has been enabled. */ - -#define UAC_RET_OK 0 /*!< Return with no errors. */ -#define UAC_RET_DEV_NOT_FOUND -2001 /*!< Audio Class device not found or removed. */ -#define UAC_RET_FUNC_NOT_FOUND -2002 /*!< Audio device has no this function. */ -#define UAC_RET_IO_ERR -2003 /*!< USB transfer failed. */ -#define UAC_RET_DATA_LEN -2004 /*!< Unexpected transfer length */ -#define UAC_RET_INVALID -2005 /*!< Invalid parameter or usage. */ -#define UAC_RET_OUT_OF_MEMORY -2007 /*!< Out of memory. */ -#define UAC_RET_DRV_NOT_SUPPORTED -2009 /*!< Function not supported by this UAC driver. */ -#define UAC_RET_DEV_NOT_SUPPORTED -2011 /*!< Function not supported by the UAC device. */ -#define UAC_RET_PARSER -2013 /*!< Failed to parse UAC descriptor */ -#define UAC_RET_IS_STREAMING -2015 /*!< Audio pipe is on streaming. */ - - -/*@}*/ /* end of group USBH_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBH_EXPORTED_TYPEDEF USB Host Typedef - @{ -*/ -struct udev_t; -typedef void (CONN_FUNC)(struct udev_t *udev, int param); - -struct line_coding_t; -struct cdc_dev_t; -typedef void (CDC_CB_FUNC)(struct cdc_dev_t *cdev, uint8_t *rdata, int data_len); - -struct usbhid_dev; -typedef void (HID_IR_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *rdata, uint32_t data_len); /*!< interrupt in callback function \hideinitializer */ -typedef void (HID_IW_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *wbuff, uint32_t *data_len); /*!< interrupt out callback function \hideinitializer */ - -struct uac_dev_t; -typedef int (UAC_CB_FUNC)(struct uac_dev_t *dev, uint8_t *data, int len); /*!< audio in callback function \hideinitializer */ - -/*@}*/ /* end of group USBH_EXPORTED_STRUCT */ - - - -/** @addtogroup USBH_EXPORTED_FUNCTIONS USB Host Exported Functions - @{ -*/ - -/*------------------------------------------------------------------*/ -/* */ -/* USB Core Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_core_init(void); -extern int usbh_polling_root_hubs(void); -extern void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func); -extern void usbh_suspend(void); -extern void usbh_resume(void); -extern struct udev_t *usbh_find_device(char *hub_id, int port); - -/** - * @brief A function return current tick count. - * @return Current tick. - * @details User application must provide this function to return current tick. - * The tick should increase by 1 for every 10 ms. - */ -extern uint32_t usbh_get_ticks(void); /* This function must be provided by user application. */ -extern uint32_t usbh_tick_from_millisecond(uint32_t msec); /* This function must be provided by user application. */ - - -/// @cond HIDDEN_SYMBOLS - -//extern void dump_ohci_regs(void); -//extern void dump_ehci_regs(void); -//extern void dump_ohci_ports(void); -//extern void dump_ehci_ports(void); -//extern uint32_t usbh_memory_used(void); - -/// @endcond HIDDEN_SYMBOLS - - -/*@}*/ /* end of group USBH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBH_Library */ - -/*@}*/ /* end of group LIBRARY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _USBH_LIB_H_ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci.c_ b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci.c_ deleted file mode 100644 index 1a1a10701cd..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci.c_ +++ /dev/null @@ -1,1273 +0,0 @@ -/**************************************************************************//** - * @file ehci.c - * @version V1.10 - * @brief USB Host library EHCI (USB 2.0) host controller driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - - -/// @cond HIDDEN_SYMBOLS - -static QH_T *_H_qh __attribute__((section(".usbhostlib._H_qh"))); /* head of reclamation list */ -static qTD_T *_ghost_qtd __attribute__((section(".usbhostlib._ghost_qtd"))); /* used as a terminator qTD */ -static QH_T *qh_remove_list __attribute__((section(".usbhostlib.qh_remove_list"))); - -static uint32_t _PFList_mem[FL_SIZE] __attribute__((section(".usbhostlib._PFList_mem"))) __attribute__((aligned(4096))); /* Periodic frame list */ - -static uint32_t *_PFList __attribute__((section(".usbhostlib._PFList"))); - -static QH_T *_Iqh[NUM_IQH] __attribute__((section(".usbhostlib.QH_T"))) __attribute__((aligned(32)));; - -static int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep); -static void scan_isochronous_list(void); - - -#ifdef ENABLE_ERROR_MSG -static void dump_ehci_regs(void) -{ - USB_debug("Dump HSUSBH(0x%x) registers:\n", ptr_to_u32(&_ehci->EHCVNR)); - USB_debug(" EHCVNR = 0x%08x\n", _ehci->EHCVNR); - USB_debug(" EHCSPR = 0x%08x\n", _ehci->EHCSPR); - USB_debug(" EHCCPR = 0x%08x\n", _ehci->EHCCPR); - USB_debug(" UCMDR = 0x%08x\n", _ehci->UCMDR); - USB_debug(" USTSR = 0x%08x\n", _ehci->USTSR); - USB_debug(" UIENR = 0x%08x\n", _ehci->UIENR); - USB_debug(" UFINDR = 0x%08x\n", _ehci->UFINDR); - USB_debug(" UPFLBAR = 0x%08x\n", _ehci->UPFLBAR); - USB_debug(" UCALAR = 0x%08x\n", _ehci->UCALAR); - USB_debug(" UCFGR = 0x%08x\n", _ehci->UCFGR); - USB_debug(" UPSCR0 = 0x%08x\n", _ehci->UPSCR[0]); -// USB_debug(" UPSCR1 = 0x%08x\n", _ehci->UPSCR[1]); -// USB_debug(" PHYCTL0 = 0x%x\n", _ehci->USBPCR0); -// USB_debug(" PHYCTL1 = 0x%x\n", _ehci->USBPCR1); -} - -static void dump_ehci_ports() -{ - USB_debug("_ehci port0=0x%x, port1=0x%x\n", _ehci->UPSCR[0], _ehci->UPSCR[1]); -} - -static void dump_ehci_qtd(qTD_T *qtd) -{ - USB_debug(" [qTD] - 0x%08x\n", (int)qtd); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qtd->Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qtd->Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token) PID: %s, Bytes: %d, IOC: %d\n", qtd->Token, (((qtd->Token >> 8) & 0x3) == 0) ? "OUT" : ((((qtd->Token >> 8) & 0x3) == 1) ? "IN" : "SETUP"), (qtd->Token >> 16) & 0x7FFF, (qtd->Token >> 15) & 0x1); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qtd->Bptr[0]); - //USB_debug(" 0x%08x (Buffer Pointer (page 1))\n", qtd->Bptr[1]); - //USB_debug(" 0x%08x (Buffer Pointer (page 2))\n", qtd->Bptr[2]); - //USB_debug(" 0x%08x (Buffer Pointer (page 3))\n", qtd->Bptr[3]); - //USB_debug(" 0x%08x (Buffer Pointer (page 4))\n", qtd->Bptr[4]); - USB_debug("\n"); -} - -static void dump_ehci_asynclist(void) -{ - QH_T *qh = _H_qh; - qTD_T *qtd; - - USB_debug(">>> Dump EHCI Asynchronous List <<<\n"); - do - { - USB_debug("[QH] - 0x%08x\n", (int)qh); - USB_debug(" 0x%08x (Queue Head Horizontal Link Pointer, Queue Head DWord 0)\n", qh->HLink); - USB_debug(" 0x%08x (Endpoint Characteristics) DevAddr: %d, EP: 0x%x, PktSz: %d, Speed: %s\n", qh->Chrst, (qh->Chrst & 0x7F), ((qh->Chrst >> 8) & 0xF), ((qh->Chrst >> 16) & 0x7FF), ((qh->Chrst >> 12) & 0x3 == 0) ? "Full" : (((qh->Chrst >> 12) & 0x3 == 1) ? "Low" : "High")); - USB_debug(" 0x%08x (Endpoint Capabilities: Queue Head DWord 2)\n", qh->Cap); - USB_debug(" 0x%08x (Current qtd Pointer)\n", qh->Curr_qTD); - USB_debug(" --- Overlay Area ---\n"); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qh->OL_Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qh->OL_Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token)\n", qh->OL_Token); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qh->OL_Bptr[0]); - USB_debug("\n"); - - qtd = QTD_PTR(qh->Curr_qTD); - while (qtd != NULL) - { - dump_ehci_qtd(qtd); - qtd = QTD_PTR(qtd->Next_qTD); - } - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); -} - -static void dump_ehci_asynclist_simple(void) -{ - QH_T *qh = _H_qh; - - USB_debug(">>> EHCI Asynchronous List <<<\n"); - USB_debug("[QH] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); - USB_debug("\n"); -} - -static void dump_ehci_period_frame_list_simple(void) -{ - QH_T *qh = _Iqh[NUM_IQH - 1]; - - USB_debug(">>> EHCI period frame list simple <<<\n"); - USB_debug("[FList] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != NULL); - USB_debug("\n"); -} - -static void dump_ehci_period_frame_list() -{ - int i; - QH_T *qh; - - for (i = 0; i < FL_SIZE; i++) - { - USB_debug("!%02d: ", i); - qh = QH_PTR(_PFList[i]);; - while (qh != NULL) - { - // USB_debug("0x%x (0x%x) => ", (int)qh, qh->HLink); - USB_debug("0x%x => ", (int)qh); - qh = QH_PTR(qh->HLink); - } - USB_debug("0\n"); - } -} - -#endif /* ENABLE_ERROR_MSG */ - -static void init_periodic_frame_list() -{ - QH_T *qh_p; - int i, idx, interval; - - _PFList = (uint32_t *)((uint32_t)&_PFList_mem[0]); - memset(_PFList, 0, sizeof(_PFList_mem)); - - iso_ep_list = NULL; - - for (i = NUM_IQH - 1; i >= 0; i--) /* interval = i^2 */ - { - _Iqh[i] = alloc_ehci_QH(); - - _Iqh[i]->HLink = QH_HLNK_END; - _Iqh[i]->Curr_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Next_qTD = QTD_LIST_END; - _Iqh[i]->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Token = QTD_STS_HALT; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < FL_SIZE; idx += interval) - { - if (_PFList[idx] == 0) /* is empty list, insert directly */ - { - _PFList[idx] = QH_HLNK_QH(_Iqh[i]); - } - else - { - qh_p = QH_PTR(_PFList[idx]); - - while (1) - { - if (qh_p == _Iqh[i]) - break; /* already chained by previous visit */ - - if (qh_p->HLink == QH_HLNK_END) /* reach end of list? */ - { - qh_p->HLink = QH_HLNK_QH(_Iqh[i]); - break; - } - qh_p = QH_PTR(qh_p->HLink); - } - } - } - } -} - -static QH_T *get_int_tree_head_node(int interval) -{ - int i; - - interval /= 8; /* each frame list entry for 8 micro-frame */ - - for (i = 0; i < NUM_IQH - 1; i++) - { - interval >>= 1; - if (interval == 0) - return _Iqh[i]; - } - return _Iqh[NUM_IQH - 1]; -} - -static int make_int_s_mask(int bInterval) -{ - int order, interval; - - interval = 1; - while (bInterval > 1) - { - interval *= 2; - bInterval--; - } - - if (interval < 2) - return 0xFF; /* interval 1 */ - if (interval < 4) - return 0x55; /* interval 2 */ - if (interval < 8) - return 0x22; /* interval 4 */ - for (order = 0; (interval > 1); order++) - { - interval >>= 1; - } - return (0x1 << (order % 8)); -} - -static int ehci_init(void) -{ - int timeout = 250 * 1000; /* EHCI reset time-out 250 ms */ - - /*------------------------------------------------------------------------------------*/ - /* Reset EHCI host controller */ - /*------------------------------------------------------------------------------------*/ - _ehci->UCMDR = HSUSBH_UCMDR_HCRST_Msk; - while ((_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) && (timeout > 0)) - { - usbh_delay_ms(1); - timeout -= 1000; - } - if (_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) - return USBH_ERR_EHCI_INIT; - - _ehci->UCMDR = UCMDR_INT_THR_CTRL | HSUSBH_UCMDR_RUN_Msk; - - _ghost_qtd = alloc_ehci_qTD(NULL); - _ghost_qtd->Token = 0x11197B7F; //QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It represents a qhost qTD. - - /*------------------------------------------------------------------------------------*/ - /* Initialize asynchronous list */ - /*------------------------------------------------------------------------------------*/ - qh_remove_list = NULL; - - /* Create the QH list head with H-bit 1 */ - _H_qh = alloc_ehci_QH(); - _H_qh->HLink = QH_HLNK_QH(_H_qh); /* circular link to itself, the only one QH */ - _H_qh->Chrst = QH_RCLM_LIST_HEAD; /* it's the head of reclamation list */ - _H_qh->Curr_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Next_qTD = QTD_LIST_END; - _H_qh->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Token = QTD_STS_HALT; - _ehci->UCALAR = (uint32_t)_H_qh; - - /*------------------------------------------------------------------------------------*/ - /* Initialize periodic list */ - /*------------------------------------------------------------------------------------*/ - if (FL_SIZE == 256) - _ehci->UCMDR |= (0x2 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 512) - _ehci->UCMDR |= (0x1 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 1024) - _ehci->UCMDR |= (0x0 << HSUSBH_UCMDR_FLSZ_Pos); - else - return USBH_ERR_EHCI_INIT; /* Invalid FL_SIZE setting! */ - - _ehci->UPFLBAR = (uint32_t)_PFList; - - /*------------------------------------------------------------------------------------*/ - /* start run */ - /*------------------------------------------------------------------------------------*/ - - _ehci->UCFGR = 0x1; /* enable port routing to EHCI */ - _ehci->UIENR = HSUSBH_UIENR_USBIEN_Msk | HSUSBH_UIENR_UERRIEN_Msk | HSUSBH_UIENR_HSERREN_Msk | HSUSBH_UIENR_IAAEN_Msk; - - usbh_delay_ms(1); /* delay 1 ms */ - - _ehci->UPSCR[0] = HSUSBH_UPSCR_PP_Msk; /* enable port 1 port power */ - //_ehci->UPSCR[0] = HSUSBH_UPSCR_PP_Msk | HSUSBH_UPSCR_PO_Msk; /* set port owner to OHCI */ - - init_periodic_frame_list(); - - //usbh_delay_ms(10); /* delay 10 ms */ - //dump_ehci_regs(); - - return 0; -} - -static void ehci_suspend(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] |= HSUSBH_UPSCR_SUSPEND_Msk; -} - -static void ehci_resume(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] = (_ehci->UPSCR[0] & ~HSUSBH_UPSCR_SUSPEND_Msk) | HSUSBH_UPSCR_FPR_Msk; -} - -static void ehci_shutdown(void) -{ - ehci_suspend(); -} - -static void move_qh_to_remove_list(QH_T *qh) -{ - QH_T *q; - - // USB_debug("move_qh_to_remove_list - 0x%x (0x%x)\n", (int)qh, qh->Chrst); - - /* check if this ED found in ed_remove_list */ - q = qh_remove_list; - while (q) - { - if (q == qh) /* This QH found in qh_remove_list. */ - { - return; /* Do nothing, return... */ - } - q = q->next; - } - - DISABLE_EHCI_IRQ(); - - /*------------------------------------------------------------------------------------*/ - /* Search asynchronous frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _H_qh; /* find and remove it from asynchronous list */ - while (QH_PTR(q->HLink) != _H_qh) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - - /*------------------------------------------------------------------------------------*/ - /* Search periodic frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _Iqh[NUM_IQH - 1]; - while (q->HLink != QH_HLNK_END) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - ENABLE_EHCI_IRQ(); -} - -static void append_to_qtd_list_of_QH(QH_T *qh, qTD_T *qtd) -{ - qTD_T *q; - - if (qh->qtd_list == NULL) - { - qh->qtd_list = qtd; - } - else - { - q = qh->qtd_list; - while (q->next != NULL) - { - q = q->next; - } - q->next = qtd; - } -} - -/* - * If ep==NULL, it's a control endpoint QH. - */ -static void write_qh(UDEV_T *udev, EP_INFO_T *ep, QH_T *qh) -{ - uint32_t chrst, cap; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 1 - Endpoint Characteristics */ - /*------------------------------------------------------------------------------------*/ - if (ep == NULL) /* is control endpoint? */ - { - if (udev->descriptor.bMaxPacketSize0 == 0) - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - chrst = QH_DTC | QH_NAK_RL | (udev->descriptor.bMaxPacketSize0 << 16); - if (udev->speed != SPEED_HIGH) - chrst |= QH_CTRL_EP_FLAG; /* non-high-speed control endpoint */ - } - else /* not a control endpoint */ - { - chrst = QH_NAK_RL | (ep->wMaxPacketSize << 16); - chrst |= ((ep->bEndpointAddress & 0xf) << 8); /* Endpoint Address */ - } - - if (udev->speed == SPEED_LOW) - chrst |= QH_EPS_LOW; - else if (udev->speed == SPEED_FULL) - chrst |= QH_EPS_FULL; - else - chrst |= QH_EPS_HIGH; - - chrst |= udev->dev_num; - - qh->Chrst = chrst; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 2 - Endpoint Capabilities */ - /*------------------------------------------------------------------------------------*/ - if (udev->speed == SPEED_HIGH) - { - cap = 0x40000000; - } - else - { - /* - * Backtrace device tree until the USB 2.0 hub found - */ - HUB_DEV_T *hub; - int port_num; - - port_num = udev->port_num; - hub = udev->parent; - - while ((hub != NULL) && (hub->iface->udev->speed != SPEED_HIGH)) - { - port_num = hub->iface->udev->port_num; - hub = hub->iface->udev->parent; - } - - cap = (port_num << QH_HUB_PORT_Pos) | - (hub->iface->udev->dev_num << QH_HUB_ADDR_Pos); - } - - qh->Cap = cap; -} - -static void write_qtd_bptr(qTD_T *qtd, uint32_t buff_addr, int xfer_len) -{ - int i; - - qtd->xfer_len = xfer_len; - qtd->Bptr[0] = buff_addr; - - buff_addr = (buff_addr + 0x1000) & ~0xFFF; - - for (i = 1; i < 5; i++) - { - qtd->Bptr[i] = buff_addr; - buff_addr += 0x1000; - } -} - -static int ehci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - QH_T *qh; - qTD_T *qtd_setup, *qtd_data, *qtd_status; - uint32_t token; - int is_new_qh = 0; - - udev = utr->udev; - - if (utr->data_len > 0) - { - if (((uint32_t)utr->buff + utr->data_len) > (((uint32_t)utr->buff & ~0xFFF) + 0x5000)) - return USBH_ERR_BUFF_OVERRUN; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate and link QH */ - /*------------------------------------------------------------------------------------*/ - if (udev->ep0.hw_pipe != NULL) - { - qh = (QH_T *)udev->ep0.hw_pipe; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - - udev->ep0.hw_pipe = (void *)qh; /* driver can find QH from EP */ - is_new_qh = 1; - } - write_qh(udev, NULL, qh); - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - - /*------------------------------------------------------------------------------------*/ - /* Allocate qTDs */ - /*------------------------------------------------------------------------------------*/ - qtd_setup = alloc_ehci_qTD(utr); /* allocate qTD for SETUP */ - - if (utr->data_len > 0) - qtd_data = alloc_ehci_qTD(utr); /* allocate qTD for DATA */ - else - qtd_data = NULL; - - qtd_status = alloc_ehci_qTD(utr); /* allocate qTD for USTSR */ - - if (qtd_status == NULL) /* out of memory? */ - { - if (qtd_setup) - free_ehci_qTD(qtd_setup); /* free memory */ - if (qtd_data) - free_ehci_qTD(qtd_data); /* free memory */ - return USBH_ERR_MEMORY_OUT; /* out of memory */ - } - - //USB_debug("qh=0x%x, qtd_setup=0x%x, qtd_data=0x%x, qtd_status=0x%x\n", (int)qh, (int)qtd_setup, (int)qtd_data, (int)qtd_status); - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_setup->qh = qh; - //qtd_setup->utr = utr; - write_qtd_bptr(qtd_setup, (uint32_t)&utr->setup, 8); - append_to_qtd_list_of_QH(qh, qtd_setup); - qtd_setup->Token = (8 << 16) | QTD_ERR_COUNTER | QTD_PID_SETUP | QTD_STS_ACTIVE; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage qTD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - qtd_setup->Next_qTD = (uint32_t)qtd_data; - qtd_data->Next_qTD = (uint32_t)qtd_status; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd_data->qh = qh; - //qtd_data->utr = utr; - write_qtd_bptr(qtd_data, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd_data); - qtd_data->Token = QTD_DT | (utr->data_len << 16) | token; - } - else - { - qtd_setup->Next_qTD = (uint32_t)qtd_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare USTSR stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_status->Next_qTD = (uint32_t)_ghost_qtd; - qtd_status->Alt_Next_qTD = QTD_LIST_END; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - - qtd_status->qh = qh; - //qtd_status->utr = utr; - append_to_qtd_list_of_QH(qh, qtd_status); - qtd_status->Token = QTD_DT | QTD_IOC | token; - - /*------------------------------------------------------------------------------------*/ - /* Update QH overlay */ - /*------------------------------------------------------------------------------------*/ - qh->Curr_qTD = 0; - qh->OL_Next_qTD = (uint32_t)qtd_setup; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = 0; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - //dump_ehci_regs(); - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - return 0; -} - -static int ehci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh; - qTD_T *qtd, *qtd_pre; - uint32_t data_len, xfer_len; - uint8_t *buff; - uint32_t token; - int is_new_qh = 0; - - //USB_debug("Bulk XFER =>\n"); - // dump_ehci_asynclist_simple(); - - udev = utr->udev; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - { - return USBH_ERR_EHCI_QH_BUSY; - } - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTDs */ - /*------------------------------------------------------------------------------------*/ - data_len = utr->data_len; - buff = utr->buff; - qtd_pre = NULL; - - while (data_len > 0) - { - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - qtd = qh->qtd_list; - while (qtd != NULL) - { - qtd_pre = qtd; - qtd = qtd->next; - free_ehci_qTD(qtd_pre); - } - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - if (data_len > 0x4000) /* force maximum x'fer length 16K per qTD */ - xfer_len = 0x4000; - else - xfer_len = data_len; /* remaining data length < 4K */ - - qtd->qh = qh; - qtd->Next_qTD = (uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)buff, xfer_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = (xfer_len << 16) | token; - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - if (data_len == 0) /* is this the latest qTD? */ - { - qtd->Token |= QTD_IOC; /* ask to raise an interrupt on the last qTD */ - qtd->Next_qTD = (uint32_t)_ghost_qtd; /* qTD list end */ - } - - if (qtd_pre != NULL) - qtd_pre->Next_qTD = (uint32_t)qtd; - qtd_pre = qtd; - } - - //USB_debug("utr=0x%x, qh=0x%x, qtd=0x%x\n", (int)utr, (int)qh, (int)qh->qtd_list); - - qtd = qh->qtd_list; - - qh->OL_Next_qTD = (uint32_t)qtd; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - - qh->OL_Token = 0; //qtd->Token; - - if (utr->ep->bToggle) - qh->OL_Token |= QTD_DT; - - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - - return 0; -} - -static int ehci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh, *iqh; - qTD_T *qtd; - uint32_t token; - int8_t is_new_qh = 0; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - qh->Chrst &= ~0xF0000000; - - if (udev->speed == SPEED_HIGH) - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & 0xff) | make_int_s_mask(ep->bInterval); - } - else - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & ~(QH_C_MASK_Msk | QH_S_MASK_Msk)) | 0x7802; - } - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTD */ - /*------------------------------------------------------------------------------------*/ - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd->qh = qh; - qtd->Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = QTD_IOC | (utr->data_len << 16) | token; - - DISABLE_EHCI_IRQ(); - - USB_debug("ehci_int_xfer - qh: 0x%x, 0x%x, 0x%x, qtd: 0x%x\n", (int)qh, (int)qh->Chrst, (int)qh->Cap, (int)qtd); - - qh->OL_Next_qTD = (uint32_t)qtd; - - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - qh->OL_Token = qtd->Token; - - if (udev->speed == SPEED_HIGH) /* get head node of this interval */ - iqh = get_int_tree_head_node(ep->bInterval); - else - iqh = get_int_tree_head_node(ep->bInterval * 8); - qh->HLink = iqh->HLink; /* Add to list of the same interval */ - iqh->HLink = QH_HLNK_QH(qh); - } - - ENABLE_EHCI_IRQ(); - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; -} - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ehci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - QH_T *qh; - - // USB_debug("ehci_quit_xfer - utr: 0x%x, ep: 0x%x\n", (int)utr, (int)ep); - - DISABLE_EHCI_IRQ(); - if (ehci_quit_iso_xfer(utr, ep) == 0) - { - ENABLE_EHCI_IRQ(); - return 0; - } - ENABLE_EHCI_IRQ(); - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - qh = (QH_T *)(utr->ep->hw_pipe); - - if (!qh) - return USBH_ERR_NOT_FOUND; - - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - qh = (QH_T *)(ep->hw_pipe); - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - ep->hw_pipe = NULL; - } - usbh_delay_ms(2); - - return 0; -} - -static int visit_qtd(qTD_T *qtd) -{ - if ((qtd->Token == 0x11197B7F) || (qtd->Token == 0x1197B7F)) - return 0; /* A Dummy qTD or qTD on writing, don't touch it. */ - - // USB_debug("Visit qtd 0x%x - 0x%x\n", (int)qtd, qtd->Token); - - if ((qtd->Token & QTD_STS_ACTIVE) == 0) - { - if (qtd->Token & (QTD_STS_HALT | QTD_STS_DATA_BUFF_ERR | QTD_STS_BABBLE | QTD_STS_XactErr | QTD_STS_MISS_MF)) - { - USB_error("qTD 0x%x error token=0x%x! 0x%x\n", (int)qtd, qtd->Token, qtd->Bptr[0]); - if (qtd->utr->status == 0) - qtd->utr->status = USBH_ERR_TRANSACTION; - } - else - { - if ((qtd->Token & QTD_PID_Msk) != QTD_PID_SETUP) - { - qtd->utr->xfer_len += qtd->xfer_len - QTD_TODO_LEN(qtd->Token); - // USB_debug("0x%x utr->xfer_len += %d\n", qtd->Token, qtd->xfer_len - QTD_TODO_LEN(qtd->Token)); - } - } - return 1; - } - return 0; -} - -static void scan_asynchronous_list() -{ - QH_T *qh, *qh_tmp; - qTD_T *q_pre, *qtd, *qtd_tmp; - UTR_T *utr; - - q_pre = NULL; - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - // USB_debug("Scan qh=0x%x, 0x%x\n", (int)qh, qh->OL_Token); - - utr = NULL; - qtd = qh->qtd_list; - while (qtd != NULL) - { - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - /* qTD is completed, will remove it */ - utr = qtd->utr; - if (qtd == qh->qtd_list) - qh->qtd_list = qtd->next; /* unlink the qTD from qtd_list */ - else - q_pre->next = qtd->next; /* unlink the qTD from qtd_list */ - - qtd_tmp = qtd; /* remember this qTD for freeing later */ - qtd = qtd->next; /* advance to the next qTD */ - - qtd_tmp->next = qh->done_list; /* push this qTD to QH's done list */ - qh->done_list = qtd_tmp; - } - else - { - q_pre = qtd; /* remember this qTD as a preceder */ - qtd = qtd->next; /* advance to next qTD */ - } - } - - qh_tmp = qh; - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qh_tmp->qtd_list == NULL) && utr) - { - // printf("T %d [%d]\n", (qh_tmp->Chrst>>8)&0xf, (qh_tmp->OL_Token&QTD_DT) ? 1 : 0); - if (qh_tmp->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - } -} - -static void scan_periodic_frame_list() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Scan interrupt frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - qtd = qh->qtd_list; /* There's only one qTD in list at most. */ - - if (qtd == NULL) - { - /* empty QH */ - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - continue; - } - - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - qtd->next = qh->done_list; /* push qTD into the done list */ - qh->done_list = qtd; - qh->qtd_list = NULL; /* qtd_list becomes empty */ - } - - qtd = qh->done_list; - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qtd != NULL) && (qh->qtd_list == NULL)) - { - utr = qtd->utr; - - if (qh->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Scan isochronous frame list */ - /*------------------------------------------------------------------------------------*/ - - scan_isochronous_list(); -} - -static void iaad_remove_qh() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Remove all QHs in qh_remove_list... */ - /*------------------------------------------------------------------------------------*/ - while (qh_remove_list != NULL) - { - qh = qh_remove_list; - qh_remove_list = qh->next; - - // USB_debug("iaad_remove_qh - remove QH 0x%x\n", (int)qh); - - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - - if (qh->qtd_list != NULL) /* still have incomplete qTDs? */ - { - utr = qh->qtd_list->utr; - while (qh->qtd_list) - { - qtd = qh->qtd_list; - qh->qtd_list = qtd->next; - free_ehci_qTD(qtd); - } - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); /* call back */ - } - free_ehci_QH(qh); /* free the QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each asynchronous QH */ - /*------------------------------------------------------------------------------------*/ - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each QH of periodic frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } -} - -//static irqreturn_t ehci_irq (struct usb_hcd *hcd) -void EHCI_IRQHandler(int vector, void *param) -{ - uint32_t intsts; - - intsts = _ehci->USTSR; - _ehci->USTSR = intsts; /* clear interrupt status */ - - //rt_kprintf("[%s]ehci int_sts = 0x%x\n", __func__, intsts); - - if (intsts & HSUSBH_USTSR_UERRINT_Msk) - { - USB_error("Transfer error!\n"); - } - - if (intsts & (HSUSBH_USTSR_USBINT_Msk | HSUSBH_USTSR_UERRINT_Msk)) - { - if (intsts & HSUSBH_USTSR_UERRINT_Msk) - { - USB_error("Transfer error!\n"); - } - - /* some transfers completed, travel asynchronous */ - /* and periodic lists to find and reclaim them. */ - scan_asynchronous_list(); - - scan_periodic_frame_list(); - } - - if (intsts & HSUSBH_USTSR_IAA_Msk) - { - iaad_remove_qh(); - } -} - -static UDEV_T *ehci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && (udev->speed == SPEED_HIGH)) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ehci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ehci->UPSCR[port] = (_ehci->UPSCR[port] | HSUSBH_UPSCR_PRST_Msk) & ~HSUSBH_UPSCR_PE_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time/10) + 1) ; /* wait at least 50 ms */ - - _ehci->UPSCR[port] &= ~HSUSBH_UPSCR_PRST_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time/10) + 1) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) || - ((_ehci->UPSCR[port] & (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk)) == (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("EHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PEC_Msk; /* clear port enable change status */ - return USBH_OK; /* port reset success */ -} - -static int ehci_rh_polling(void) -{ - UDEV_T *udev; - int ret, change = 0; - int port; - int connect_status, t0, debounce_tick; - - for (port = 0; port < 1; port++) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CSC_Msk)) - continue; - - change = 1; - rt_kprintf("EHCI port%d status change: 0x%x\n", port + 1, _ehci->UPSCR[port]); - - /*--------------------------------------------------------------------------------*/ - /* Disconnect the devices attached to this port. */ - /*--------------------------------------------------------------------------------*/ - while (1) - { - udev = ehci_find_device_by_port(port + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - /*--------------------------------------------------------------------------------*/ - /* Port de-bounce */ - /*--------------------------------------------------------------------------------*/ - t0 = usbh_get_ticks(); - debounce_tick = usbh_tick_from_millisecond(HUB_DEBOUNCE_TIME/10); - connect_status = _ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk; - while (usbh_get_ticks() - t0 < debounce_tick) - { - if (connect_status != (_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk)) - { - /* reset stable time counting */ - t0 = usbh_get_ticks(); - connect_status = _ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk; - } - } - - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear connect status change bit */ - - if (connect_status == HSUSBH_UPSCR_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* A new device connected. */ - /*----------------------------------------------------------------------------*/ - if (ehci_rh_port_reset(port) != USBH_OK) - { - /* port reset failed, maybe an USB 1.1 device */ - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PO_Msk; /* change port owner to OHCI */ - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear all status change bits */ - return 0; - } - - /* - * Port reset success. Start to enumerate this new device. - */ - udev = alloc_device(); - if (udev == NULL) - return 0; /* out-of-memory, do nothing... */ - - udev->parent = NULL; - udev->port_num = port + 1; - udev->speed = SPEED_HIGH; - udev->hc_driver = &ehci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - } - else - { - /* Device disconnected */ - while (1) - { - udev = ehci_find_device_by_port(port + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - } - } - return change; -} - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci_iso.c_ b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci_iso.c_ deleted file mode 100644 index 148132adf30..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ehci_iso.c_ +++ /dev/null @@ -1,902 +0,0 @@ -/**************************************************************************//** - * @file ehci_iso.c - * @version V1.10 - * @brief USB EHCI isochronous transfer driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -/// @cond HIDDEN_SYMBOLS - -//static uint32_t g_flr_cnt; /* frame list rollover counter */ - -static const uint16_t sitd_OUT_Smask [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f }; - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep); - -/* - * Inspect the iTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_itd(iTD_T *itd) -{ - UTR_T *utr; - uint32_t frnidx = itd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int i, fidx; - - // printf("R - %d %d, 0x%x\n", now_frame, frnidx, itd->Transaction[0]); - - if (now_frame == frnidx) - { - for (i = 0; i < 8; i++) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - return 0; /* have any not completed frames */ - } - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this iTD - */ - utr = itd->utr; - fidx = itd->fidx; - for (i = 0; i < 8; i++) - { - if (!(itd->trans_mask & (0x1 << i))) - continue; /* not scheduled micro-frame */ - - if (ITD_STATUS(itd->Transaction[i])) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - utr->status = USBH_ERR_NOT_ACCESS0; - } - else if (itd->Transaction[i] & ITD_STATUS_BABBLE) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (itd->Transaction[i] & ITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - utr->iso_status[fidx] = 0; - utr->iso_xlen[fidx] = ITD_XFER_LEN(itd->Transaction[i]); - } - fidx++; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - - return 1; /* to be reclaimed */ -} - -/* - * Inspect the siTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_sitd(siTD_T *sitd) -{ - UTR_T *utr; - uint32_t frnidx = sitd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int fidx; - uint32_t TotalBytesToTransfer; - - if (now_frame == frnidx) - { - if (SITD_STATUS(sitd->StsCtrl) == SITD_STATUS_ACTIVE) - return 0; - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this siTD - */ - utr = sitd->utr; - fidx = sitd->fidx; - - if (SITD_STATUS(sitd->StsCtrl)) - { - if (sitd->StsCtrl & SITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - } - else if (sitd->StsCtrl & SITD_BABBLE_DETECTED) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (sitd->StsCtrl & SITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - TotalBytesToTransfer = (sitd->StsCtrl & SITD_XFER_CNT_Msk) >> SITD_XFER_CNT_Pos; - utr->iso_xlen[fidx] = utr->iso_xlen[fidx] - TotalBytesToTransfer; - utr->iso_status[fidx] = 0; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - return 1; /* to be reclaimed */ -} - -/* - * Some iTD/siTD may be scheduled but not serviced due to time missed. - * This function scan several earlier frames and drop unserviced iTD/siTD if found. - */ -static void scan_isochronous_list(void) -{ - ISO_EP_T *iso_ep = iso_ep_list; - iTD_T *itd, *itd_pre, *p; - siTD_T *sitd, *sitd_pre, *sp; - uint32_t frnidx; - - DISABLE_EHCI_IRQ(); - - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - /*--------------------------------------------------------------------------------*/ - /* Scan all iTDs */ - /*--------------------------------------------------------------------------------*/ - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - itd_pre = NULL; - while (itd != NULL) /* traverse all iTDs of itd list */ - { - if (review_itd(itd)) /* inspect and reclaim iTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("An iTD lost refernece to periodic frame list! 0x%x -> %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this iTD from iso_ep's iTD list */ - /*------------------------------------------------------------------------*/ - if (itd_pre == NULL) - { - iso_ep->itd_list = itd->next; - } - else - { - itd_pre->next = itd->next; - } - p = itd->next; - free_ehci_iTD(itd); - itd = p; - } - else - { - itd_pre = itd; - itd = itd->next; /* traverse to the next iTD of iTD list */ - } - } - - /*--------------------------------------------------------------------------------*/ - /* Scan all siTDs */ - /*--------------------------------------------------------------------------------*/ - sitd = iso_ep->sitd_list; /* get the first siTD from iso_ep's siTD list */ - sitd_pre = NULL; - while (sitd != NULL) /* traverse all siTDs of sitd list */ - { - if (review_sitd(sitd)) /* inspect and reclaim siTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this siTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = sitd->sched_frnidx; - if (_PFList[frnidx] == SITD_HLNK_SITD(sitd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = sitd->Next_Link; - } - else - { - sp = SITD_PTR(_PFList[frnidx]); /* find the preceding siTD */ - while ((SITD_PTR(sp->Next_Link) != sitd) && (sp != NULL)) - { - sp = SITD_PTR(sp->Next_Link); - } - - if (sp == NULL) /* link list out of control! */ - { - USB_error("An siTD lost reference to periodic frame list! 0x%x -> %d\n", (int)sitd, frnidx); - } - else /* remove iTD from list */ - { - sp->Next_Link = sitd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this siTD from iso_ep's siTD list */ - /*------------------------------------------------------------------------*/ - if (sitd_pre == NULL) - { - iso_ep->sitd_list = sitd->next; - } - else - { - sitd_pre->next = sitd->next; - } - sp = sitd->next; - free_ehci_siTD(sitd); - sitd = sp; - } - else - { - sitd_pre = sitd; - sitd = sitd->next; /* traverse to the next siTD of siTD list */ - } - } - - iso_ep = iso_ep->next; - } - - ENABLE_EHCI_IRQ(); -} - - -static void write_itd_info(UTR_T *utr, iTD_T *itd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int i; - - buff_page_addr = itd->buff_base & 0xFFFFF000; /* 4K page */ - - for (i = 0; i < 7; i++) - { - itd->Bptr[i] = buff_page_addr + (0x1000 * i); - } - /* EndPtr R Device Address */ - itd->Bptr[0] |= (udev->dev_num) | ((ep->bEndpointAddress & 0xF) << ITD_EP_NUM_Pos); - itd->Bptr[1] |= ep->wMaxPacketSize; /* Maximum Packet Size */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - itd->Bptr[1] |= ITD_DIR_IN; - else - itd->Bptr[1] |= ITD_DIR_OUT; - - itd->Bptr[2] |= (ep->wMaxPacketSize + 1023) / 1024; /* Mult */ -} - -static void write_itd_micro_frame(UTR_T *utr, int fidx, iTD_T *itd, int mf) -{ - uint32_t buff_addr; - - buff_addr = (uint32_t)(utr->iso_buff[fidx]); /* xfer buffer start address of this frame */ - - itd->Transaction[mf] = ITD_STATUS_ACTIVE | /* Status */ - ((utr->iso_xlen[fidx] & 0xFFF) << ITD_XLEN_Pos) | /* Transaction Length */ - ((buff_addr & 0xFFFFF000) - (itd->buff_base & 0xFFFFF000)) | /* PG */ - (buff_addr & 0xFFF); /* Transaction offset */ -} - - -static void remove_iso_ep_from_list(ISO_EP_T *iso_ep) -{ - ISO_EP_T *p; - - if (iso_ep_list == iso_ep) - { - iso_ep_list = iso_ep->next; /* it's the first entry, remove it */ - return; - } - - p = iso_ep_list; /* find the previous entry of iso_ep */ - while (p->next != NULL) - { - if (p->next == iso_ep) - { - break; - } - p = p->next; - } - - if (p->next == NULL) - { - return; /* not found */ - } - p->next = iso_ep->next; /* remove iso_ep from list */ -} - - -static __inline void add_itd_to_iso_ep(ISO_EP_T *iso_ep, iTD_T *itd) -{ - iTD_T *p; - - itd->next = NULL; - - if (iso_ep->itd_list == NULL) - { - iso_ep->itd_list = itd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->itd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = itd; -} - -static int ehci_iso_xfer(UTR_T *utr) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - ISO_EP_T *iso_ep; /* software iso endpoint descriptor */ - iTD_T *itd, *itd_next, *itd_list = NULL; - int i, itd_cnt; - int trans_mask; /* bit mask of used xfer in an iTD */ - int fidx; /* index to the 8 iso frames of UTR */ - int interval; /* frame interval of iTD */ - - if (ep->hw_pipe != NULL) - { - iso_ep = (ISO_EP_T *)ep->hw_pipe; /* get reference of the isochronous endpoint */ - - if (utr->bIsoNewSched) - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - } - else - { - /* first time transfer of this iso endpoint */ - iso_ep = usbh_alloc_mem(sizeof(*iso_ep)); - if (iso_ep == NULL) - return USBH_ERR_MEMORY_OUT; - - memset(iso_ep, 0, sizeof(*iso_ep)); - iso_ep->ep = ep; - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - - ep->hw_pipe = iso_ep; - - /* - * Add this iso_ep into iso_ep_list - */ - DISABLE_EHCI_IRQ(); - iso_ep->next = iso_ep_list; - iso_ep_list = iso_ep; - ENABLE_EHCI_IRQ(); - } - - if (utr->udev->speed == SPEED_FULL) - return ehci_iso_split_xfer(utr, iso_ep); - - /*------------------------------------------------------------------------------------*/ - /* Allocate iTDs */ - /*------------------------------------------------------------------------------------*/ - - if (ep->bInterval < 2) /* transfer interval is 1 micro-frame */ - { - trans_mask = 0xFF; - itd_cnt = 1; /* required 1 iTD for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 4) /* transfer interval is 2 micro-frames */ - { - trans_mask = 0x55; - itd_cnt = 2; /* required 2 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 8) /* transfer interval is 4 micro-frames */ - { - trans_mask = 0x44; - itd_cnt = 4; /* required 4 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 16) /* transfer interval is 8 micro-frames */ - { - trans_mask = 0x08; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 32) /* transfer interval is 16 micro-frames */ - { - trans_mask = 0x10; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 2; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 64) /* transfer interval is 32 micro-frames */ - { - trans_mask = 0x02; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 4; /* iTD frame interval of this endpoint */ - } - else /* transfer interval is 64 micro-frames */ - { - trans_mask = 0x04; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 8; /* iTD frame interval of this endpoint */ - } - - for (i = 0; i < itd_cnt; i++) /* allocate all iTDs required by UTR */ - { - itd = alloc_ehci_iTD(); - if (itd == NULL) - goto malloc_failed; - - if (itd_list == NULL) /* link all iTDs */ - { - itd_list = itd; - } - else - { - itd->next = itd_list; - itd_list = itd; - } - } - - utr->td_cnt = itd_cnt; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all iTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (itd = itd_list; (itd != NULL);) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver ITD bug!?\n"); - goto malloc_failed; - } - - itd->utr = utr; - itd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - itd->buff_base = (uint32_t)(utr->iso_buff[fidx]); /* iTD buffer base is buffer of the first UTR iso frame serviced by this iTD */ - itd->trans_mask = trans_mask; - - write_itd_info(utr, itd); - - for (i = 0; i < 8; i++) /* settle xfer into micro-frames */ - { - if (!(trans_mask & (0x1 << i))) - { - itd->Transaction[i] = 0; /* not accesed */ - continue; /* not scheduled micro-frame */ - } - - write_itd_micro_frame(utr, fidx, itd, i); - - fidx++; /* preceed to next UTR iso frame */ - - if (fidx == IF_PER_UTR) /* is the last scheduled micro-frame? */ - { - /* raise interrupt on completed */ - itd->Transaction[i] |= ITD_IOC; - break; - } - } - - itd_next = itd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - DISABLE_EHCI_IRQ(); - itd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - add_itd_to_iso_ep(iso_ep, itd); /* add to software itd list */ - itd->Next_Link = _PFList[itd->sched_frnidx]; /* keep the next link */ - _PFList[itd->sched_frnidx] = ITD_HLNK_ITD(itd); - iso_ep->next_frame = (iso_ep->next_frame + interval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - itd = itd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (itd_list != NULL) - { - itd = itd_list; - itd_list = itd->next; - free_ehci_iTD(itd); - } - return USBH_ERR_MEMORY_OUT; -} - -static __inline void add_sitd_to_iso_ep(ISO_EP_T *iso_ep, siTD_T *sitd) -{ - siTD_T *p; - - sitd->next = NULL; - - if (iso_ep->sitd_list == NULL) - { - iso_ep->sitd_list = sitd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->sitd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = sitd; -} - -static void write_sitd_info(UTR_T *utr, siTD_T *sitd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int xlen = utr->iso_xlen[sitd->fidx]; - int scnt; - - sitd->Chrst = (udev->port_num << SITD_PORT_NUM_Pos) | - (udev->parent->iface->udev->dev_num << SITD_HUB_ADDR_Pos) | - ((ep->bEndpointAddress & 0xF) << SITD_EP_NUM_Pos) | - (udev->dev_num << SITD_DEV_ADDR_Pos); - - buff_page_addr = ((uint32_t)utr->iso_buff[sitd->fidx]) & 0xFFFFF000; - sitd->Bptr[0] = (uint32_t)(utr->iso_buff[sitd->fidx]); - sitd->Bptr[1] = buff_page_addr + 0x1000; - - scnt = (xlen + 187) / 188; - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - { - sitd->Chrst |= SITD_XFER_IN; - sitd->Sched = (1 << (scnt + 2)) - 1; - sitd->Sched = (sitd->Sched << 10) | 0x1; - //sitd->Sched <<= 1; - } - else - { - sitd->Chrst |= SITD_XFER_OUT; - sitd->Sched = sitd_OUT_Smask[scnt - 1]; - if (scnt > 1) - { - sitd->Bptr[1] |= (0x1 << 3); /* Transaction position (TP) 01b: Begin */ - } - sitd->Bptr[1] |= scnt; /* Transaction count (T-Count) */ - } - - if (sitd->fidx == IF_PER_UTR) - { - sitd->Sched |= SITD_IOC; - } - - sitd->StsCtrl = (xlen << SITD_XFER_CNT_Pos) | SITD_STATUS_ACTIVE; - - sitd->BackLink = SITD_LIST_END; -} - - -static void ehci_sitd_adjust_schedule(siTD_T *sitd) -{ - siTD_T *hlink = (siTD_T *)_PFList[sitd->sched_frnidx]; - uint32_t uframe_mask = 0x00; - - while (hlink && !HLINK_IS_TERMINATED(hlink) && HLINK_IS_SITD(hlink)) - { - hlink = SITD_PTR(hlink); - if (hlink != sitd) - { - if ((hlink->Chrst & SITD_XFER_IO_Msk) == SITD_XFER_IN) - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by IN S-mask */ - uframe_mask |= ((hlink->Sched >> 8) & 0xFF); /* mark micro-frames used by IN C-mask */ - } - else - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by OUT S-mask */ - } - } - hlink = SITD_PTR(hlink->Next_Link); - } - - uframe_mask = uframe_mask | (uframe_mask << 8); /* mark both S-mask and C-mask */ - - if (uframe_mask) - { - /* - * Shift afterward one micro-frame until no conflicts. - */ - while (1) - { - if (sitd->Sched & uframe_mask) - { - sitd->Sched = (sitd->Sched & 0xFFFF0000) | ((sitd->Sched << 1) & 0xFFFF); - } - else - { - break; /* no conflit, done. */ - } - } - } -} - - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - siTD_T *sitd, *sitd_next, *sitd_list = NULL; - int i; - int fidx; /* index to the 8 iso frames of UTR */ - - if (utr->udev->parent == NULL) - { - USB_error("siso xfer - parent lost!\n"); - return USBH_ERR_INVALID_PARAM; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate siTDs */ - /*------------------------------------------------------------------------------------*/ - for (i = 0; i < IF_PER_UTR; i++) /* allocate all siTDs required by UTR */ - { - sitd = alloc_ehci_siTD(); - if (sitd == NULL) - goto malloc_failed; - - if (sitd_list == NULL) /* link all siTDs */ - { - sitd_list = sitd; - } - else - { - sitd->next = sitd_list; - sitd_list = sitd; - } - } - - utr->td_cnt = IF_PER_UTR; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all siTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (sitd = sitd_list; (sitd != NULL); fidx++) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver siTD bug!?\n"); - goto malloc_failed; - } - - sitd->utr = utr; - sitd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - - write_sitd_info(utr, sitd); - - sitd_next = sitd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - sitd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - DISABLE_EHCI_IRQ(); - ehci_sitd_adjust_schedule(sitd); - add_sitd_to_iso_ep(iso_ep, sitd); /* add to software itd list */ - sitd->Next_Link = _PFList[sitd->sched_frnidx];/* keep the next link */ - _PFList[sitd->sched_frnidx] = SITD_HLNK_SITD(sitd); - iso_ep->next_frame = (iso_ep->next_frame + ep->bInterval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - sitd = sitd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (sitd_list != NULL) - { - sitd = sitd_list; - sitd_list = sitd->next; - free_ehci_siTD(sitd); - } - return USBH_ERR_MEMORY_OUT; -} - -/* - * If it's an isochronous endpoint, quit current transfer via UTR or hardware EP. - */ -static int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ISO_EP_T *iso_ep; - iTD_T *itd, *itd_next, *p; - uint32_t frnidx; - uint32_t now_frame; - - if (ep == NULL) - { - if (utr == NULL) - return USBH_ERR_NOT_FOUND; - - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ep = utr->ep; - } - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) != EP_ATTR_TT_ISO) - return USBH_ERR_NOT_FOUND; /* not isochronous endpoint */ - - /*------------------------------------------------------------------------------------*/ - /* It's an iso endpoint. Remove it as required. */ - /*------------------------------------------------------------------------------------*/ - iso_ep = iso_ep_list; - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - if (iso_ep->ep == ep) - break; - iso_ep = iso_ep->next; - } - if (iso_ep == NULL) - return 0; /* should have been removed */ - - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - - while (itd != NULL) /* traverse all iTDs of itd list */ - { - itd_next = itd->next; /* remember the next iTD */ - utr = itd->utr; - - /*--------------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*--------------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - - /* - * Prevent to race with Host Controller. If the iTD to be removed is located in - * current or next frame, wait until HC passed through it. - */ - while (1) - { - now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - if ((now_frame == frnidx) || (((now_frame + 1) % 1024) == frnidx)) - continue; - break; - } - - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("ehci_quit_iso_xfer - An iTD lost reference to periodic frame list! 0x%x on %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - utr->status = USBH_ERR_ABORT; - } - free_ehci_iTD(itd); - itd = itd_next; - } - - /* - * Remove iso_ep from iso_ep_list - */ - remove_iso_ep_from_list(iso_ep); - usbh_free_mem(iso_ep, sizeof(*iso_ep)); /* free this iso_ep */ - ep->hw_pipe = NULL; - - if (iso_ep_list == NULL) - _ehci->UCMDR &= ~HSUSBH_UCMDR_PSEN_Msk; - - return 0; -} - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ohci.c_ b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ohci.c_ deleted file mode 100644 index 6c49d921d79..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/_ohci.c_ +++ /dev/null @@ -1,1281 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -/// @cond HIDDEN_SYMBOLS - -//#define TD_debug rt_kprintf -#define TD_debug(...) - -//#define ED_debug rt_kprintf -#define ED_debug(...) - - -#define PORT_CNT (_ohci->HcRhDescriptorA & 0xf) - -static HCCA_T _hcca __attribute__((section(".usbhostlib._hcca"))) __attribute__((aligned(256))); - -static ED_T * _Ied[6] __attribute__((section(".usbhostlib._Ied"))); - - -static ED_T *ed_remove_list; - -#ifdef ENABLE_DEBUG_MSG -static void dump_ohci_regs(void); -#endif - -static void add_to_ED_remove_list(ED_T *ed) -{ - ED_T *p; - - ED_debug("add_to_ED_remove_list - 0x%x (0x%x)\n", (int)ed, ed->Info); - DISABLE_OHCI_IRQ(); - - /* check if this ED found in ed_remove_list */ - p = ed_remove_list; - while (p) - { - if (p == ed) - { - ENABLE_OHCI_IRQ(); /* This ED found in ed_remove_list */ - return; /* do nothing */ - } - p = p->next; - } - - ed->Info |= ED_SKIP; /* ask OHCI controller skip this ED */ - ed->next = ed_remove_list; - ed_remove_list = ed; /* insert to the head of ed_remove_list */ - ENABLE_OHCI_IRQ(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_SF_Msk; - usbh_delay_ms(2); /* Full speed wait 2 ms is enough */ -} - -static int ohci_reset(void) -{ - /* Disable HC interrupts */ - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_MIE_Msk; - - /* HC Reset requires max 10 ms delay */ - _ohci->HcControl = 0; - _ohci->HcCommandStatus = USBH_HcCommandStatus_HCR_Msk; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((_ohci->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB OHCI reset timed out!\n"); - return -1; - } - - _ohci->HcRhStatus = USBH_HcRhStatus_OCI_Msk | USBH_HcRhStatus_LPS_Msk; - - _ohci->HcControl = HCFS_RESET; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((_ohci->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB HC reset timed out!\n"); - return -1; - } - - return 0; -} - -static void init_hcca_int_table() -{ - ED_T *ed_p; - int i, idx, interval; - - memset(_hcca.int_table, 0, sizeof(_hcca.int_table)); - - for (i = 5; i >= 0; i--) /* interval = i^2 */ - { - _Ied[i] = alloc_ohci_ED(); - _Ied[i]->Info = ED_SKIP; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < 32; idx += interval) - { - if (_hcca.int_table[idx] == 0) /* is empty list, insert directly */ - { - _hcca.int_table[idx] = (uint32_t)_Ied[i]; - } - else - { - ed_p = (ED_T *)_hcca.int_table[idx]; - - while (1) - { - if (ed_p == _Ied[i]) - break; /* already chained by previous visit */ - - if (ed_p->NextED == 0) /* reach end of list? */ - { - ed_p->NextED = (uint32_t)_Ied[i]; - break; - } - ed_p = (ED_T *)ed_p->NextED; - } - } - } - } -} - -static ED_T * get_int_tree_head_node(int interval) -{ - int i; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return _Ied[i]; - } - return _Ied[5]; /* for interval >= 32 */ -} - -static int get_ohci_interval(int interval) -{ - int i, bInterval = 1; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return bInterval; - bInterval *= 2; - } - return 32; /* for interval >= 32 */ -} - - -static int ohci_init(void) -{ - uint32_t fminterval; - volatile int i; - - if (ohci_reset() < 0) - return -1; - - ed_remove_list = NULL; - - init_hcca_int_table(); - - /* Tell the controller where the control and bulk lists are - * The lists are empty now. */ - _ohci->HcControlHeadED = 0; /* control ED list head */ - _ohci->HcBulkHeadED = 0; /* bulk ED list head */ - - _ohci->HcHCCA = (uint32_t)&_hcca; /* HCCA area */ - - /* periodic start 90% of frame interval */ - fminterval = 0x2edf; /* 11,999 */ - _ohci->HcPeriodicStart = (fminterval*9)/10; - - /* set FSLargestDataPacket, 10,104 for 0x2edf frame interval */ - fminterval |= ((((fminterval - 210) * 6) / 7) << 16); - _ohci->HcFmInterval = fminterval; - - _ohci->HcLSThreshold = 0x628; - - /* start controller operations */ - _ohci->HcControl = HCFS_OPER | (0x3 << USBH_HcControl_CBSR_Pos); - - if (_ohci->HcRhDescriptorA & USBH_HcRhDescriptorA_PSM_Msk) - { - /* is per-port powered */ - if (PORT_CNT == 1) - _ohci->HcRhDescriptorB = 0x20000; - else - _ohci->HcRhDescriptorB = 0x7E0000; - for (i = 0; i < PORT_CNT; i++) - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_PPS_Msk; - } - else - { - /* is global port powered */ - _ohci->HcRhDescriptorA = (_ohci->HcRhDescriptorA | (1<<9)) & ~USBH_HcRhDescriptorA_PSM_Msk; - _ohci->HcRhStatus = USBH_HcRhStatus_LPSC_Msk; - } - - _ohci->HcInterruptEnable = USBH_HcInterruptEnable_MIE_Msk | USBH_HcInterruptEnable_WDH_Msk | USBH_HcInterruptEnable_SF_Msk; - - /* POTPGT delay is bits 24-31, in 20 ms units. */ - usbh_delay_ms(20); - return 0; -} - -static void ohci_suspend(void) -{ - int i; - - /* set port suspend if connected */ - for (i = 0; i < PORT_CNT; i++) - { - if (_ohci->HcRhPortStatus[i] & 0x1) - _ohci->HcRhPortStatus[i] = 0x4; - } - - /* enable Device Remote Wakeup */ - _ohci->HcRhStatus |= USBH_HcRhStatus_DRWE_Msk; - - /* enable USBH RHSC interrupt for system wakeup */ - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_RHSC_Msk | USBH_HcInterruptEnable_RD_Msk; - - /* set Host Controller enter suspend state */ - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (3 << USBH_HcControl_HCFS_Pos); -} - -static void ohci_resume(void) -{ - int i; - - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (1 << USBH_HcControl_HCFS_Pos); - _ohci->HcControl = (_ohci->HcControl & ~USBH_HcControl_HCFS_Msk) | (2 << USBH_HcControl_HCFS_Pos); - - for (i = 0; i < PORT_CNT; i++) - { - if (_ohci->HcRhPortStatus[i] & 0x4) - _ohci->HcRhPortStatus[i] = 0x8; - } -} - -static void ohci_shutdown(void) -{ - ohci_suspend(); - // NVIC_DisableIRQ(USBH_IRQn); -#ifndef OHCI_PER_PORT_POWER - _ohci->HcRhStatus = USBH_HcRhStatus_LPS_Msk; -#endif -} - - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ohci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ED_T *ed; - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ed = (ED_T *)(utr->ep->hw_pipe); - - if (!ed) - return USBH_ERR_NOT_FOUND; - - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - ed = (ED_T *)(ep->hw_pipe); - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - ep->hw_pipe = NULL; - } - - return 0; -} - -static uint32_t ed_make_info(UDEV_T *udev, EP_INFO_T *ep) -{ - uint32_t info; - - if (ep == NULL) /* is a control endpoint */ - { - /* control endpoint direction is from TD */ - if (udev->descriptor.bMaxPacketSize0 == 0) /* is 0 if device descriptor still not obtained. */ - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - info = (udev->descriptor.bMaxPacketSize0 << 16) /* Control endpoint Maximum Packet Size from device descriptor */ - | ED_DIR_BY_TD /* Direction (Get direction From TD) */ - | ED_FORMAT_GENERAL /* General format */ - | (0 << ED_CTRL_EN_Pos); /* Endpoint address 0 */ - } - else /* Other endpoint direction is from endpoint descriptor */ - { - info = (ep->wMaxPacketSize << 16); /* Maximum Packet Size from endpoint */ - - info |= ((ep->bEndpointAddress & 0xf) << ED_CTRL_EN_Pos); /* Endpoint Number */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) - info |= ED_DIR_IN; - else - info |= ED_DIR_OUT; - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) == EP_ATTR_TT_ISO) - info |= ED_FORMAT_ISO; - else - info |= ED_FORMAT_GENERAL; - } - - info |= ((udev->speed == SPEED_LOW) ? ED_SPEED_LOW : ED_SPEED_FULL); /* Speed */ - info |= (udev->dev_num); /* Function Address */ - - return info; -} - -static void write_td(TD_T *td, uint32_t info, uint8_t *buff, uint32_t data_len) -{ - uint32_t baddr = ptr_to_u32(buff); - - td->Info = info; - td->CBP = (((baddr == 0) || !data_len) ? 0 : baddr); - td->BE = (((baddr == 0) || !data_len) ? 0 : baddr + data_len - 1); - td->buff_start = td->CBP; - // TD_debug("TD [0x%x]: 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->BE); -} - -static int ohci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - ED_T *ed; - TD_T *td_setup, *td_data, *td_status; - uint32_t info; - - udev = utr->udev; - - /*------------------------------------------------------------------------------------*/ - /* Allocate ED and TDs */ - /*------------------------------------------------------------------------------------*/ - td_setup = alloc_ohci_TD(utr); - - if (utr->data_len > 0) - td_data = alloc_ohci_TD(utr); - else - td_data = NULL; - - td_status = alloc_ohci_TD(utr); - - if (td_status == NULL) - { - free_ohci_TD(td_setup); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - - /* Check if there's any transfer pending on this endpoint... */ - if (udev->ep0.hw_pipe == NULL) - { - ed = alloc_ohci_ED(); - if (ed == NULL) - { - free_ohci_TD(td_setup); - free_ohci_TD(td_status); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - } - else - ed = (ED_T *)udev->ep0.hw_pipe; - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage TD */ - /*------------------------------------------------------------------------------------*/ - info = TD_CC | TD_T_DATA0 | TD_TYPE_CTRL; - write_td(td_setup, info, (uint8_t *)&utr->setup, 8); - td_setup->ed = ed; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage TD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - - write_td(td_data, info, utr->buff, utr->data_len); - td_data->ed = ed; - td_setup->NextTD = ptr_to_u32(td_data); - td_setup->next = td_data; - td_data->NextTD = ptr_to_u32(td_status); - td_data->next = td_status; - } - else - { - td_setup->NextTD = ptr_to_u32(td_status); - td_setup->next = td_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare STATUS stage TD */ - /*------------------------------------------------------------------------------------*/ - ed->Info = ed_make_info(udev, NULL); - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL); - else - info = (TD_CC | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL); - - write_td(td_status, info, NULL, 0); - td_status->ed = ed; - td_status->NextTD = 0; - td_status->next = 0; - - /*------------------------------------------------------------------------------------*/ - /* prepare ED */ - /*------------------------------------------------------------------------------------*/ - ed->TailP = 0; - ed->HeadP = ptr_to_u32(td_setup); - ed->Info = ed_make_info(udev, NULL); - ed->NextED = 0; - - //TD_debug("TD SETUP [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_setup, td_setup->Info, td_setup->CBP, td_setup->BE, td_setup->NextTD); - //if (td_data) - // TD_debug("TD DATA [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_data, td_data->Info, td_data->CBP, td_data->BE, td_data->NextTD); - //TD_debug("TD STATUS [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_status, td_status->Info, td_status->CBP, td_status->BE, td_status->NextTD); - ED_debug("Xfer ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", ptr_to_u32(ed), ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - if (utr->data_len > 0) - utr->td_cnt = 3; - else - utr->td_cnt = 2; - - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - udev->ep0.hw_pipe = (void *)ed; /* driver can find ED from EP */ - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - _ohci->HcControlHeadED = ptr_to_u32(ed); /* Link ED to OHCI */ - _ohci->HcControl |= USBH_HcControl_CLE_Msk; /* enable control list */ - ENABLE_OHCI_IRQ(); - _ohci->HcCommandStatus = USBH_HcCommandStatus_CLF_Msk; /* start Control list */ - - return 0; -} - -static int ohci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed; - TD_T *td, *td_p, *td_list = NULL; - uint32_t info; - uint32_t data_len, xfer_len; - int8_t bIsNewED = 0; - uint8_t *buff; - - /*------------------------------------------------------------------------------------*/ - /* Check if there's uncompleted transfer on this endpoint... */ - /* Prepare ED */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - - /* Check if there's any transfer pending on this endpoint... */ - ed = (ED_T *)_ohci->HcBulkHeadED; /* get the head of bulk endpoint list */ - while (ed != NULL) - { - if (ed->Info == info) /* have transfer of this EP not completed? */ - { - if ((ed->HeadP & 0xFFFFFFF0) != (ed->TailP & 0xFFFFFFF0)) - return USBH_ERR_OHCI_EP_BUSY; /* endpoint is busy */ - else - break; /* ED already there... */ - } - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ED_debug("Link BULK ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - } - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - utr->td_cnt = 0; - data_len = utr->data_len; - buff = utr->buff; - - do - { - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_BULK); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_BULK); - - info &= ~(1 << 25); /* Data toggle from ED toggleCarry bit */ - - if (data_len > 4096) /* maximum transfer length is 4K for each TD */ - xfer_len = 4096; - else - xfer_len = data_len; /* remaining data length < 4K */ - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - write_td(td, info, buff, xfer_len); - td->ed = ed; - - utr->td_cnt++; /* increase TD count, for recalim counter */ - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - /* chain to end of TD list */ - if (td_list == NULL) - { - td_list = td; - } - else - { - td_p = td_list; - while (td_p->NextTD != 0) - td_p = (TD_T *)td_p->NextTD; - td_p->NextTD = (uint32_t)td; - } - - } - while (data_len > 0); - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - ed->HeadP = (ed->HeadP & 0x2) | ptr_to_u32(td_list); /* keep toggleCarry bit */ - if (bIsNewED) - { - ed->HeadP = ptr_to_u32(td_list); - /* Link ED to OHCI Bulk List */ - ed->NextED = _ohci->HcBulkHeadED; - _ohci->HcBulkHeadED = ptr_to_u32(ed); - } - ENABLE_OHCI_IRQ(); - _ohci->HcControl |= USBH_HcControl_BLE_Msk; /* enable bulk list */ - _ohci->HcCommandStatus = USBH_HcCommandStatus_BLF_Msk; /* start bulk list */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static int ohci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_new; - uint32_t info; - int8_t bIsNewED = 0; - - if (utr->data_len > 64) /* USB 1.1 interrupt transfer maximum packet size is 64 */ - return USBH_ERR_INVALID_PARAM; - - td_new = alloc_ohci_TD(utr); /* allocate a TD for dummy TD */ - if (td_new == NULL) - return USBH_ERR_MEMORY_OUT; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - - td = alloc_ohci_TD(NULL); /* allocate the initial dummy TD for ED */ - if (td == NULL) - { - free_ohci_ED(ed); - free_ohci_TD(td_new); - return USBH_ERR_MEMORY_OUT; - } - ed->HeadP = ptr_to_u32(td); /* Let both HeadP and TailP point to dummy TD */ - ed->TailP = ed->HeadP; - } - else - { - td = (TD_T *)(ed->TailP & ~0xf); /* TailP always point to the dummy TD */ - } - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TD */ - /*------------------------------------------------------------------------------------*/ - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_INT); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_INT); - - /* Keep data toggle */ - info = (info & ~(1<<25)) | (td->Info & (1<<25)); - - /* fill this TD */ - write_td(td, info, utr->buff, utr->data_len); - td->ed = ed; - td->NextTD = ptr_to_u32(td_new); - td->utr = utr; - utr->td_cnt = 1; /* increase TD count, for recalim counter */ - utr->status = 0; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - - ed->TailP = ptr_to_u32(td_new); - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = ptr_to_u32(ed); - } - - ENABLE_OHCI_IRQ(); - - //printf("Link INT ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - _ohci->HcControl |= USBH_HcControl_PLE_Msk; /* periodic list enable */ - return 0; -} - -static int ohci_iso_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_list, *last_td; - int i; - uint32_t info; - uint32_t buff_addr; - int8_t bIsNewED = 0; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - } - else - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - if (utr->bIsoNewSched) /* Is the starting of isochronous streaming? */ - ed->next_sf = _hcca.frame_no + OHCI_ISO_DELAY; - - utr->td_cnt = 0; - utr->iso_sf = ed->next_sf; - - last_td = NULL; - td_list = NULL; - - for (i = 0; i < IF_PER_UTR; i++) - { - utr->iso_status[i] = USBH_ERR_NOT_ACCESS1; - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - buff_addr = ptr_to_u32(utr->iso_buff[i]); - td->Info = (TD_CC | TD_TYPE_ISO) | ed->next_sf; - ed->next_sf += get_ohci_interval(ed->bInterval); - td->CBP = buff_addr & ~0xFFF; - td->BE = buff_addr + utr->iso_xlen[i] - 1; - td->PSW[0] = 0xE000 | (buff_addr & 0xFFF); - - td->ed = ed; - utr->td_cnt++; /* increase TD count, for reclaim counter */ - - /* chain to end of TD list */ - if (td_list == NULL) - td_list = td; - else - last_td->NextTD = ptr_to_u32(td); - - last_td = td; - }; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - - if ((ed->HeadP & ~0x3) == 0) - ed->HeadP = (ed->HeadP & 0x2) | ptr_to_u32(td_list); /* keep toggleCarry bit */ - else - { - /* find the tail of TDs under this ED */ - td = (TD_T *)(ed->HeadP & ~0x3); - while (td->NextTD != 0) - { - td = (TD_T *)td->NextTD; - } - td->NextTD = (uint32_t)td_list; - } - - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = ptr_to_u32(ed); - } - - ENABLE_OHCI_IRQ(); - ED_debug("Link ISO ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - _ohci->HcControl |= USBH_HcControl_PLE_Msk | USBH_HcControl_IE_Msk; /* enable periodic list and isochronous transfer */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static UDEV_T * ohci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && - ((udev->speed == SPEED_LOW) || (udev->speed == SPEED_FULL))) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ohci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_PRS_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time/10) + 1) - { - /* - * If device is disconnected or port enabled, we can stop port reset. - */ - if (((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) || - ((_ohci->HcRhPortStatus[port] & (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk)) == (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("OHCI port %d - port reset failed!\n", port+1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - return USBH_OK; /* port reset success */ -} - -static int ohci_rh_polling(void) -{ - int i, change = 0; - UDEV_T *udev; - int ret; - - for (i = 0; i < 1; i++) - { - /* clear unwanted port change status */ - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_OCIC_Msk | USBH_HcRhPortStatus_PRSC_Msk | - USBH_HcRhPortStatus_PSSC_Msk | USBH_HcRhPortStatus_PESC_Msk; - - if ((_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CSC_Msk) == 0) - continue; - rt_kprintf("OHCI port%d status change: 0x%x\n", i + 1, _ohci->HcRhPortStatus[i]); - - /*--------------------------------------------------------------------------------*/ - /* connect status change */ - /*--------------------------------------------------------------------------------*/ - - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* First of all, check if there's any previously connected device. */ - /*----------------------------------------------------------------------------*/ - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - rt_kprintf("OHCI connect device.\n"); - - if (ohci_rh_port_reset(i) != USBH_OK) - continue; - - /* - * Port reset success... - */ - udev = alloc_device(); - if (udev == NULL) - continue; - - udev->parent = NULL; - udev->port_num = i + 1; - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_LSDA_Msk) - udev->speed = SPEED_LOW; - else - udev->speed = SPEED_FULL; - udev->hc_driver = &ohci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - - change = 1; - } - else - { - /* - * Device disconnected - */ - rt_kprintf("OHCI disconnect device.\n"); - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - change = 1; - } - } - return change; -} - -static void td_done(TD_T *td) -{ - UTR_T *utr = td->utr; - uint32_t info; - int cc; - - info = td->Info; - - TD_debug("td_done: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->NextTD, td->BE); - - /* ISO ... drivers see per-TD length/status */ - if ((info & TD_TYPE_Msk) == TD_TYPE_ISO) - { - uint16_t sf; - int idx; - - sf = info & 0xFFFF; - idx = ((sf + 0x10000 - utr->iso_sf) & 0xFFFF) / get_ohci_interval(td->ed->bInterval); - if (idx >= IF_PER_UTR) - { - USB_error("ISO invalid index!! %d, %d\n", sf, utr->iso_sf); - goto td_out; - } - - cc = (td->PSW[0] >> 12) & 0xF; - if (cc == 0xF) /* this frame was not transferred */ - { - USB_debug("ISO F %d N/A!\n", sf); - utr->iso_status[idx] = USBH_ERR_SCH_OVERRUN; - goto td_out; - } - if ((cc != 0) && (cc != CC_DATA_UNDERRUN)) - { - utr->iso_status[idx] = USBH_ERR_CC_NO_ERR - cc; - goto td_out; - } - utr->iso_status[idx] = 0; - utr->iso_xlen[idx] = td->PSW[0] & 0x7FF; - } - else - { - cc = TD_CC_GET(info); - - /* short packet is fine */ - if ((cc != CC_NOERROR) && (cc != CC_DATA_UNDERRUN)) - { - USB_error("TD error, CC = 0x%x\n", cc); - if (cc == CC_STALL) - utr->status = USBH_ERR_STALL; - else - utr->status = USBH_ERR_TRANSFER; - } - - switch (info & TD_TYPE_Msk) - { - case TD_TYPE_CTRL: - if (info & TD_CTRL_DATA) - { - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - } - break; - - case TD_TYPE_BULK: - case TD_TYPE_INT: - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - break; - } - } - -td_out: - - utr->td_cnt--; - - /* If all TDs are done, call-back to requester. */ - if (utr->td_cnt == 0) - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } -} - -/* in IRQ context */ -static void remove_ed() -{ - ED_T *ed, *ed_p, *ied; - TD_T *td, *td_next; - UTR_T *utr; - int found; - - while (ed_remove_list != NULL) - { - ED_debug("Remove ED: 0x%x, %d\n", (int)ed_remove_list, ed_remove_list->bInterval); - ed_p = ed_remove_list; - found = 0; - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Control List if found */ - /*--------------------------------------------------------------------------------*/ - if ((ed_p->Info & ED_EP_ADDR_Msk) == 0) - { - if (_ohci->HcControlHeadED == ptr_to_u32(ed_p)) - { - _ohci->HcControlHeadED = ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcControlHeadED; - while (ed != NULL) - { - if (ed->NextED == ptr_to_u32(ed_p)) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove INT or ISO endpoint from HCCA interrupt table */ - /*--------------------------------------------------------------------------------*/ - else if (ed_p->bInterval > 0) - { - ied = get_int_tree_head_node(ed_p->bInterval); - - ed = ied; - while (ed != NULL) - { - if (ed->NextED == ptr_to_u32(ed_p)) - { - ed->NextED = ed_p->NextED; - found = 1; - break; - } - ed = (ED_T *)ed->NextED; - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Bulk List if found */ - /*--------------------------------------------------------------------------------*/ - else - { - if (_ohci->HcBulkHeadED == ptr_to_u32(ed_p)) - { - ed = (ED_T *)ed_p; - _ohci->HcBulkHeadED = ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcBulkHeadED; - while (ed != NULL) - { - if (ed->NextED == ptr_to_u32(ed_p)) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove and free all TDs under this endpoint */ - /*--------------------------------------------------------------------------------*/ - if (found) - { - td = (TD_T *)(ed_p->HeadP & ~0x3); - if (td != NULL) - { - while (td != NULL) - { - utr = td->utr; - td_next = (TD_T *)td->NextTD; - free_ohci_TD(td); - td = td_next; - - utr->td_cnt--; - if (utr->td_cnt == 0) - { - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - } - } - } - - /* - * Done. Remove this ED from [ed_remove_list] and free it. - */ - ed_remove_list = ed_p->next; - free_ohci_ED(ed_p); - } -} - - -//static irqreturn_t ohci_irq (struct usb_hcd *hcd) -void OHCI_IRQHandler(int vector, void *param) -{ - TD_T *td, *td_prev, *td_next; - uint32_t int_sts; - - int_sts = _ohci->HcInterruptStatus; - - //rt_kprintf("[%s]ohci int_sts = 0x%x\n", __func__, int_sts); - - if ((_ohci->HcInterruptEnable & USBH_HcInterruptEnable_SF_Msk) && - (int_sts & USBH_HcInterruptStatus_SF_Msk)) - { - int_sts &= ~USBH_HcInterruptStatus_SF_Msk; - - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_SF_Msk; - remove_ed(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - } - - if (int_sts & USBH_HcInterruptStatus_WDH_Msk) - { - int_sts &= ~USBH_HcInterruptStatus_WDH_Msk; - /* - * reverse done list - */ - td = (TD_T *)(_hcca.done_head & TD_ADDR_MASK); - _hcca.done_head = 0; - td_prev = NULL; - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_WDH_Msk; - - while (td != NULL) - { - //TD_debug("Done list TD 0x%x => 0x%x\n", (int)td, (int)td->NextTD); - td_next = (TD_T *)(td->NextTD & TD_ADDR_MASK); - td->NextTD = ptr_to_u32(td_prev); - td_prev = td; - td = td_next; - } - td = td_prev; /* first TD of the reversed done list */ - - /* - * reclaim TDs - */ - while (td != NULL) - { - TD_debug("Reclaim TD 0x%x, next 0x%x\n", (int)td, td->NextTD); - td_next = (TD_T *)td->NextTD; - td_done(td); - free_ohci_TD(td); - td = td_next; - } - } - - if (int_sts & USBH_HcInterruptStatus_RHSC_Msk) - { - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_RHSC_Msk; - } - - _ohci->HcInterruptStatus = int_sts; -} - -#ifdef ENABLE_DEBUG_MSG - -static void dump_ohci_int_table() -{ - int i; - ED_T *ed; - - for (i = 0; i < 32; i++) -// for (i = 0; i < 1; i++) - - { - USB_debug("%02d: ", i); - - ed = (ED_T *)_hcca.int_table[i]; - - while (ed != NULL) - { - USB_debug("0x%x (0x%x) => ", ptr_to_u32(ed), ed->HeadP); - ed = (ED_T *)ed->NextED; - } - rt_kprintf("0\n"); - } -} - -static void dump_ohci_regs() -{ - USB_debug("Dump OCHI registers: [0x%x]\n", ptr_to_u32(&_ohci->HcRevision)); - USB_debug(" HcRevision = 0x%x\n", _ohci->HcRevision); - USB_debug(" HcControl = 0x%x\n", _ohci->HcControl); - USB_debug(" HcCommandStatus = 0x%x\n", _ohci->HcCommandStatus); - USB_debug(" HcInterruptStatus = 0x%x\n", _ohci->HcInterruptStatus); - USB_debug(" HcInterruptEnable = 0x%x\n", _ohci->HcInterruptEnable); - USB_debug(" HcInterruptDisable = 0x%x\n", _ohci->HcInterruptDisable); - USB_debug(" HcHCCA = 0x%x\n", _ohci->HcHCCA); - USB_debug(" HcPeriodCurrentED = 0x%x\n", _ohci->HcPeriodCurrentED); - USB_debug(" HcControlHeadED = 0x%x\n", _ohci->HcControlHeadED); - USB_debug(" HcControlCurrentED = 0x%x\n", _ohci->HcControlCurrentED); - USB_debug(" HcBulkHeadED = 0x%x\n", _ohci->HcBulkHeadED); - USB_debug(" HcBulkCurrentED = 0x%x\n", _ohci->HcBulkCurrentED); - USB_debug(" HcDoneHead = 0x%x\n", _ohci->HcDoneHead); - USB_debug(" HcFmInterval = 0x%x\n", _ohci->HcFmInterval); - USB_debug(" HcFmRemaining = 0x%x\n", _ohci->HcFmRemaining); - USB_debug(" HcFmNumber = 0x%x\n", _ohci->HcFmNumber); - USB_debug(" HcPeriodicStart = 0x%x\n", _ohci->HcPeriodicStart); - USB_debug(" HcLSThreshold = 0x%x\n", _ohci->HcLSThreshold); - USB_debug(" HcRhDescriptorA = 0x%x\n", _ohci->HcRhDescriptorA); - USB_debug(" HcRhDescriptorB = 0x%x\n", _ohci->HcRhDescriptorB); - USB_debug(" HcRhStatus = 0x%x\n", _ohci->HcRhStatus); - USB_debug(" HcRhPortStatus0 = 0x%x\n", _ohci->HcRhPortStatus[0]); - USB_debug(" HcRhPortStatus1 = 0x%x\n", _ohci->HcRhPortStatus[1]); - USB_debug(" HcPhyControl = 0x%x\n", _ohci->HcPhyControl); - USB_debug(" HcMiscControl = 0x%x\n", _ohci->HcMiscControl); -} - -static void dump_ohci_ports() -{ - USB_debug("_ohci port0=0x%x, port1=0x%x\n", _ohci->HcRhPortStatus[0], _ohci->HcRhPortStatus[1]); -} - -#endif // ENABLE_DEBUG_MSG - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_0.c b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_0.c deleted file mode 100644 index ffb1afe0214..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_0.c +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************//** - * @file ehci_0.c - * @version V1.10 - * @brief USB Host library EHCI (USB 2.0) host controller driver. - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" -#include "ehci.h" - -#define _ehci _ehci0 -#define ehci_driver ehci0_driver - -#define EHCI_IRQHandler EHCI0_IRQHandler - -//static uint16_t port_mask = 0x0001; -static ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ - -#include "_ehci.c_" -#include "_ehci_iso.c_" - -HC_DRV_T ehci0_driver = -{ - ehci_init, /* init */ - ehci_shutdown, /* shutdown */ - ehci_suspend, /* suspend */ - ehci_resume, /* resume */ - ehci_ctrl_xfer, /* ctrl_xfer */ - ehci_bulk_xfer, /* bulk_xfer */ - ehci_int_xfer, /* int_xfer */ - ehci_iso_xfer, /* iso_xfer */ - ehci_quit_xfer, /* quit_xfer */ - ehci_rh_port_reset, /* rthub_port_reset */ - ehci_rh_polling, /* rthub_polling */ -}; - - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_1.c b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_1.c deleted file mode 100644 index bd6343d9036..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ehci_1.c +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************//** - * @file ehci_0.c - * @version V1.10 - * @brief USB Host library EHCI (USB 2.0) host controller driver. - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" -#include "ehci.h" - -#define _ehci _ehci1 -#define ehci_driver ehci1_driver - -#define EHCI_IRQHandler EHCI1_IRQHandler - -//static uint16_t port_mask = 0x0002; -static ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ - -#include "_ehci.c_" -#include "_ehci_iso.c_" - -HC_DRV_T ehci1_driver = -{ - ehci_init, /* init */ - ehci_shutdown, /* shutdown */ - ehci_suspend, /* suspend */ - ehci_resume, /* resume */ - ehci_ctrl_xfer, /* ctrl_xfer */ - ehci_bulk_xfer, /* bulk_xfer */ - ehci_int_xfer, /* int_xfer */ - ehci_iso_xfer, /* iso_xfer */ - ehci_quit_xfer, /* quit_xfer */ - ehci_rh_port_reset, /* rthub_port_reset */ - ehci_rh_polling, /* rthub_polling */ -}; - - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/mem_alloc.c b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/mem_alloc.c deleted file mode 100644 index 9531a959eda..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/mem_alloc.c +++ /dev/null @@ -1,501 +0,0 @@ -/**************************************************************************//** - * @file mem_alloc.c - * @version V1.10 - * @brief USB host library memory allocation functions. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" - - -/// @cond HIDDEN_SYMBOLS - -//#define MEM_DEBUG - -#ifdef MEM_DEBUG - #define mem_debug rt_kprintf -#else - #define mem_debug(...) -#endif - -static uint8_t _mem_pool[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE] __attribute__((section(".usbhostlib._mem_pool"))) __attribute__((aligned(32))); -static uint8_t _unit_used[MEM_POOL_UNIT_NUM]; - -static volatile int _usbh_mem_used; -static volatile int _usbh_max_mem_used; -static volatile int _mem_pool_used; - - -UDEV_T *g_udev_list; - -uint8_t _dev_addr_pool[128] __attribute__((section(".usbhostlib._dev_addr_pool"))); -static volatile int _device_addr; - -static int _sidx = 0;; - -/*--------------------------------------------------------------------------*/ -/* Memory alloc/free recording */ -/*--------------------------------------------------------------------------*/ - -void usbh_memory_init(void) -{ - if (sizeof(TD_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("TD_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - if (sizeof(ED_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("ED_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - _usbh_mem_used = 0L; - _usbh_max_mem_used = 0L; - - memset(_unit_used, 0, sizeof(_unit_used)); - _mem_pool_used = 0; - _sidx = 0; - - g_udev_list = NULL; - - memset(_dev_addr_pool, 0, sizeof(_dev_addr_pool)); - _device_addr = 1; - - USB_InitializeMemoryPool(); -} - -uint32_t usbh_memory_used(void) -{ - mem_debug("USB static memory: %d/%d, heap used: %d\n", _mem_pool_used, MEM_POOL_UNIT_NUM, _usbh_mem_used); - return _usbh_mem_used; -} - -static void memory_counter(int inc, int size) -{ - if (inc) - _usbh_mem_used += size; - else - _usbh_mem_used -= size; - - if (_usbh_mem_used > _usbh_max_mem_used) - _usbh_max_mem_used = _usbh_mem_used; -} - -void *usbh_alloc_mem(int size) -{ - void *p; - - p = USB_malloc(size, 4); - if (p == NULL) - { - USB_error("usbh_alloc_mem failed! %d\n", size); - return NULL; - } - - memset(p, 0, size); - memory_counter(1, size); - return p; -} - -void usbh_free_mem(void *p, int size) -{ - USB_free(p); - memory_counter(0, size); -} - - -/*--------------------------------------------------------------------------*/ -/* USB device allocate/free */ -/*--------------------------------------------------------------------------*/ - -UDEV_T *alloc_device(void) -{ - UDEV_T *udev; - - udev = (UDEV_T *)USB_malloc(sizeof(*udev), 4); - if (udev == NULL) - { - USB_error("alloc_device failed!\n"); - return NULL; - } - memset(udev, 0, sizeof(*udev)); - memory_counter(1, sizeof(*udev)); - udev->cur_conf = -1; /* must! used to identify the first SET CONFIGURATION */ - udev->next = g_udev_list; /* chain to global device list */ - g_udev_list = udev; - return udev; -} - -void free_device(UDEV_T *udev) -{ - UDEV_T *d; - - if (udev == NULL) - return; - - if (udev->cfd_buff != NULL) - usbh_free_mem(udev->cfd_buff, MAX_DESC_BUFF_SIZE); - - /* - * Remove it from the global device list - */ - if (g_udev_list == udev) - { - g_udev_list = g_udev_list->next; - } - else - { - d = g_udev_list; - while (d != NULL) - { - if (d->next == udev) - { - d->next = udev->next; - break; - } - d = d->next; - } - } - USB_free(udev); - memory_counter(0, sizeof(*udev)); -} - -int alloc_dev_address(void) -{ - _device_addr++; - - if (_device_addr >= 128) - _device_addr = 1; - - while (1) - { - if (_dev_addr_pool[_device_addr] == 0) - { - _dev_addr_pool[_device_addr] = 1; - return _device_addr; - } - _device_addr++; - if (_device_addr >= 128) - _device_addr = 1; - } -} - -void free_dev_address(int dev_addr) -{ - if (dev_addr < 128) - _dev_addr_pool[dev_addr] = 0; -} - -/*--------------------------------------------------------------------------*/ -/* UTR (USB Transfer Request) allocate/free */ -/*--------------------------------------------------------------------------*/ - -UTR_T *alloc_utr(UDEV_T *udev) -{ - UTR_T *utr; - - utr = (UTR_T *)USB_malloc(sizeof(*utr), 4); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - memory_counter(1, sizeof(*utr)); - memset(utr, 0, sizeof(*utr)); - utr->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr); - return utr; -} - -void free_utr(UTR_T *utr) -{ - if (utr == NULL) - return; - - mem_debug("[FREE] [UTR] - 0x%x\n", (int)utr); - USB_free(utr); - memory_counter(0, (int)sizeof(*utr)); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI ED allocate/free */ -/*--------------------------------------------------------------------------*/ - -ED_T *alloc_ohci_ED(void) -{ - int i; - ED_T *ed; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - ed = (ED_T *)&_mem_pool[i]; - memset(ed, 0, sizeof(*ed)); - mem_debug("[ALLOC] [ED] - 0x%x\n", (int)ed); - return ed; - } - } - USB_error("alloc_ohci_ED failed!\n"); - return NULL; -} - -void free_ohci_ED(ED_T *ed) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)ed) - { - mem_debug("[FREE] [ED] - 0x%x\n", (int)ed); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ohci_ED - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI TD allocate/free */ -/*--------------------------------------------------------------------------*/ -TD_T *alloc_ohci_TD(UTR_T *utr) -{ - int i; - TD_T *td; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - td = (TD_T *)&_mem_pool[i]; - - memset(td, 0, sizeof(*td)); - td->utr = utr; - mem_debug("[ALLOC] [TD] - 0x%x\n", (int)td); - return td; - } - } - USB_error("alloc_ohci_TD failed!\n"); - return NULL; -} - -void free_ohci_TD(TD_T *td) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)td) - { - mem_debug("[FREE] [TD] - 0x%x\n", (int)td); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ohci_TD - not found!\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI QH allocate/free */ -/*--------------------------------------------------------------------------*/ -QH_T *alloc_ehci_QH(void) -{ - int i; - QH_T *qh = NULL; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qh = (QH_T *)&_mem_pool[i]; - memset(qh, 0, sizeof(*qh)); - mem_debug("[ALLOC] [QH] - 0x%x\n", (int)qh); - break; - } - } - if (qh == NULL) - { - USB_error("alloc_ehci_QH failed!\n"); - return NULL; - } - qh->Curr_qTD = QTD_LIST_END; - qh->OL_Next_qTD = QTD_LIST_END; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = QTD_STS_HALT; - return qh; -} - -void free_ehci_QH(QH_T *qh) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)qh) - { - mem_debug("[FREE] [QH] - 0x%x\n", (int)qh); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ehci_QH - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI qTD allocate/free */ -/*--------------------------------------------------------------------------*/ -qTD_T *alloc_ehci_qTD(UTR_T *utr) -{ - int i; - qTD_T *qtd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qtd = (qTD_T *)&_mem_pool[i]; - - memset(qtd, 0, sizeof(*qtd)); - qtd->Next_qTD = QTD_LIST_END; - qtd->Alt_Next_qTD = QTD_LIST_END; - qtd->Token = 0x1197B7F; // QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It means the qTD still not ready for transfer. - qtd->utr = utr; - mem_debug("[ALLOC] [qTD] - 0x%x\n", (int)qtd); - return qtd; - } - } - USB_error("alloc_ehci_qTD failed!\n"); - return NULL; -} - -void free_ehci_qTD(qTD_T *qtd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)qtd) - { - mem_debug("[FREE] [qTD] - 0x%x\n", (int)qtd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_qTD 0x%x - not found!\n", (int)qtd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -iTD_T *alloc_ehci_iTD(void) -{ - int i; - iTD_T *itd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (i + 2 >= MEM_POOL_UNIT_NUM) - continue; - - if ((_unit_used[i] == 0) && (_unit_used[i + 1] == 0)) - { - _unit_used[i] = _unit_used[i + 1] = 1; - _sidx = i + 1; - _mem_pool_used += 2; - itd = (iTD_T *)&_mem_pool[i]; - memset(itd, 0, sizeof(*itd)); - mem_debug("[ALLOC] [iTD] - 0x%x\n", (int)itd); - return itd; - } - } - USB_error("alloc_ehci_iTD failed!\n"); - return NULL; -} - -void free_ehci_iTD(iTD_T *itd) -{ - int i; - - for (i = 0; i + 1 < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)itd) - { - mem_debug("[FREE] [iTD] - 0x%x\n", (int)itd); - _unit_used[i] = _unit_used[i + 1] = 0; - _mem_pool_used -= 2; - return; - } - } - USB_error("free_ehci_iTD 0x%x - not found!\n", (int)itd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -siTD_T *alloc_ehci_siTD(void) -{ - int i; - siTD_T *sitd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used ++; - sitd = (siTD_T *)&_mem_pool[i]; - memset(sitd, 0, sizeof(*sitd)); - mem_debug("[ALLOC] [siTD] - 0x%x\n", (int)sitd); - return sitd; - } - } - USB_error("alloc_ehci_siTD failed!\n"); - return NULL; -} - -void free_ehci_siTD(siTD_T *sitd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)&_mem_pool[i] == (uint32_t)sitd) - { - mem_debug("[FREE] [siTD] - 0x%x\n", (int)sitd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_siTD 0x%x - not found!\n", (int)sitd); -} - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_0.c b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_0.c deleted file mode 100644 index 40875bb99d1..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_0.c +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -#define _ohci _ohci0 -#define ohci_driver ohci0_driver - -#define OHCI_IRQHandler OHCI0_IRQHandler - -#include "_ohci.c_" - -HC_DRV_T ohci0_driver = -{ - ohci_init, /* init */ - ohci_shutdown, /* shutdown */ - ohci_suspend, /* suspend */ - ohci_resume, /* resume */ - ohci_ctrl_xfer, /* ctrl_xfer */ - ohci_bulk_xfer, /* bulk_xfer */ - ohci_int_xfer, /* int_xfer */ - ohci_iso_xfer, /* iso_xfer */ - ohci_quit_xfer, /* quit_xfer */ - ohci_rh_port_reset, /* rthub_port_reset */ - ohci_rh_polling, /* rthub_polling */ -}; - - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_1.c b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_1.c deleted file mode 100644 index 2dfb1d08ad2..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/ohci_1.c +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -#define _ohci _ohci1 -#define ohci_driver ohci1_driver - -#define OHCI_IRQHandler OHCI1_IRQHandler - -#include "_ohci.c_" - -HC_DRV_T ohci1_driver = -{ - ohci_init, /* init */ - ohci_shutdown, /* shutdown */ - ohci_suspend, /* suspend */ - ohci_resume, /* resume */ - ohci_ctrl_xfer, /* ctrl_xfer */ - ohci_bulk_xfer, /* bulk_xfer */ - ohci_int_xfer, /* int_xfer */ - ohci_iso_xfer, /* iso_xfer */ - ohci_quit_xfer, /* quit_xfer */ - ohci_rh_port_reset, /* rthub_port_reset */ - ohci_rh_polling, /* rthub_polling */ -}; - - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/support.c b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/support.c deleted file mode 100644 index cd3231fba9a..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/support.c +++ /dev/null @@ -1,273 +0,0 @@ -/**************************************************************************//** - * @file support.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief Functions to support USB host driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" - -/// @cond HIDDEN_SYMBOLS - - -#define USB_MEMORY_POOL_SIZE (32*1024) -#define USB_MEM_BLOCK_SIZE 128 - -#define BOUNDARY_WORD 4 - - -static uint32_t _FreeMemorySize; -uint32_t _AllocatedMemorySize; - - -#define USB_MEM_ALLOC_MAGIC 0x19685788 /* magic number in leading block */ - -typedef struct USB_mhdr -{ - uint32_t flag; /* 0:free, 1:allocated, 0x3:first block */ - uint32_t bcnt; /* if allocated, the block count of allocated memory block */ - uint32_t magic; - uint32_t reserved; -} USB_MHDR_T; - -uint8_t _USBMemoryPool[USB_MEMORY_POOL_SIZE] __attribute__((section(".usbhostlib.USBMemoryPool"))) __attribute__((aligned(USB_MEM_BLOCK_SIZE))); - -static USB_MHDR_T *_pCurrent; -uint32_t *_USB_pCurrent = (uint32_t *) &_pCurrent; - -static uint32_t _MemoryPoolBase, _MemoryPoolEnd; - - -void USB_InitializeMemoryPool() -{ - _MemoryPoolBase = (uint32_t)&_USBMemoryPool[0]; - _MemoryPoolEnd = _MemoryPoolBase + USB_MEMORY_POOL_SIZE; - _FreeMemorySize = _MemoryPoolEnd - _MemoryPoolBase; - _AllocatedMemorySize = 0; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; - memset((char *)_MemoryPoolBase, 0, _FreeMemorySize); -} - - -int USB_available_memory() -{ - return _FreeMemorySize; -} - - -int USB_allocated_memory() -{ - return _AllocatedMemorySize; -} - - -void *USB_malloc(int wanted_size, int boundary) -{ - USB_MHDR_T *pPrimitivePos = _pCurrent; - USB_MHDR_T *pFound; - int found_size = -1; - int i, block_count; - int wrap = 0; - void *pvBuf = NULL; - rt_base_t level; - - level = rt_hw_interrupt_disable(); - - if (wanted_size >= _FreeMemorySize) - { - rt_kprintf("USB_malloc - want=%d, free=%d\n", wanted_size, _FreeMemorySize); - goto exit_USB_malloc; - } - - - if ((uint32_t)_pCurrent >= _MemoryPoolEnd) - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - - do - { - if (_pCurrent->flag) /* is not a free block */ - { - if (_pCurrent->magic != USB_MEM_ALLOC_MAGIC) - { - rt_kprintf("\nUSB_malloc - incorrect magic number! C:%x F:%x, wanted:%d, Base:0x%x, End:0x%x\n", (uint32_t)_pCurrent, _FreeMemorySize, wanted_size, (uint32_t)_MemoryPoolBase, (uint32_t)_MemoryPoolEnd); - goto exit_USB_malloc; - } - - if (_pCurrent->flag == 0x3) - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + _pCurrent->bcnt * USB_MEM_BLOCK_SIZE); - else - { - rt_kprintf("USB_malloc warning - not the first block!\n"); - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - } - - if ((uint32_t)_pCurrent > _MemoryPoolEnd) - rt_kprintf("USB_malloc - behind limit!!\n"); - - if ((uint32_t)_pCurrent == _MemoryPoolEnd) - { - //rt_kprintf("USB_alloc - warp!!\n"); - wrap = 1; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - } - - found_size = -1; /* reset the accumlator */ - } - else /* is a free block */ - { - if (found_size == -1) /* the leading block */ - { - pFound = _pCurrent; - block_count = 1; - - if (boundary > BOUNDARY_WORD) - found_size = 0; /* not use the data area of the leading block */ - else - found_size = USB_MEM_BLOCK_SIZE - sizeof(USB_MHDR_T); - - /* check boundary - - * If boundary > BOUNDARY_WORD, the start of next block should - * be the beginning address of allocated memory. Thus, we check - * the boundary of the next block. The leading block will be - * used as a header only. - */ - if ((boundary > BOUNDARY_WORD) && - ((((uint32_t)_pCurrent) + USB_MEM_BLOCK_SIZE >= _MemoryPoolEnd) || - ((((uint32_t)_pCurrent) + USB_MEM_BLOCK_SIZE) % boundary != 0))) - found_size = -1; /* violate boundary, reset the accumlator */ - } - else /* not the leading block */ - { - found_size += USB_MEM_BLOCK_SIZE; - block_count++; - } - - if (found_size >= wanted_size) - { - pFound->bcnt = block_count; - pFound->magic = USB_MEM_ALLOC_MAGIC; - _FreeMemorySize -= block_count * USB_MEM_BLOCK_SIZE; - _AllocatedMemorySize += block_count * USB_MEM_BLOCK_SIZE; - _pCurrent = pFound; - for (i = 0; i < block_count; i++) - { - _pCurrent->flag = 1; /* allocate block */ - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - } - pFound->flag = 0x3; - - if (boundary > BOUNDARY_WORD) - { - pvBuf = (void *)((uint32_t)pFound + USB_MEM_BLOCK_SIZE); - goto exit_USB_malloc; - } - else - { - //USB_debug("USB_malloc(%d,%d):%x\tsize:%d, C:0x%x, %d\n", wanted_size, boundary, (uint32_t)pFound + sizeof(USB_MHDR_T), block_count * USB_MEM_BLOCK_SIZE, _pCurrent, block_count); - pvBuf = (void *)((uint32_t)pFound + sizeof(USB_MHDR_T)); - goto exit_USB_malloc; - } - } - - /* advance to the next block */ - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - if ((uint32_t)_pCurrent >= _MemoryPoolEnd) - { - wrap = 1; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - found_size = -1; /* reset accumlator */ - } - } - } - while ((wrap == 0) || (_pCurrent < pPrimitivePos)); - - rt_kprintf("USB_malloc - No free memory!\n"); - -exit_USB_malloc: - - rt_hw_interrupt_enable(level); - - return pvBuf; -} - - -void USB_free(void *alloc_addr) -{ - USB_MHDR_T *pMblk; - uint32_t addr = (uint32_t)alloc_addr; - int i, count; - rt_base_t level; - - //rt_kprintf("USB_free: 0x%x\n", (int)alloc_addr); - - level = rt_hw_interrupt_disable(); - - if ((addr < _MemoryPoolBase) || (addr >= _MemoryPoolEnd)) - { - if (addr) - { - rt_kprintf("[%s]Wrong!!\n", __func__); - } - goto Exit_USB_free; - } - - //rt_kprintf("USB_free:%x\n", (int32_t)addr+USB_MEM_BLOCK_SIZE); - - /* get the leading block address */ - if (addr % USB_MEM_BLOCK_SIZE == 0) - addr -= USB_MEM_BLOCK_SIZE; - else - addr -= sizeof(USB_MHDR_T); - - if (addr % USB_MEM_BLOCK_SIZE != 0) - { - rt_kprintf("USB_free fatal error on address: %x!!\n", (uint32_t)alloc_addr); - goto Exit_USB_free; - } - - pMblk = (USB_MHDR_T *)addr; - if (pMblk->flag == 0) - { - rt_kprintf("USB_free(), warning - try to free a free block: %x\n", (uint32_t)alloc_addr); - goto Exit_USB_free; - } - if (pMblk->magic != USB_MEM_ALLOC_MAGIC) - { - rt_kprintf("USB_free(), warning - try to free an unknow block at address:%x.\n", addr); - goto Exit_USB_free; - } - - //_pCurrent = pMblk; - - //rt_kprintf("+ 0x%x, %d\n", (int)pMblk, pMblk->bcnt); - - count = pMblk->bcnt; - for (i = 0; i < count; i++) - { - pMblk->flag = 0; /* release block */ - pMblk = (USB_MHDR_T *)((uint32_t)pMblk + USB_MEM_BLOCK_SIZE); - } - - _FreeMemorySize += count * USB_MEM_BLOCK_SIZE; - _AllocatedMemorySize -= count * USB_MEM_BLOCK_SIZE; - - -Exit_USB_free: - - rt_hw_interrupt_enable(level); - - return; -} - - -/// @endcond HIDDEN_SYMBOLS - diff --git a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/usb_core.c b/bsp/nuvoton/libraries/ma35/UsbHostLib/src/usb_core.c deleted file mode 100644 index 83857a54c7f..00000000000 --- a/bsp/nuvoton/libraries/ma35/UsbHostLib/src/usb_core.c +++ /dev/null @@ -1,337 +0,0 @@ -/**************************************************************************//** - * @file usb_core.c - * @version V1.10 - * @brief USB Host library core. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -USBH_T *_ohci0, *_ohci1; -HSUSBH_T *_ehci0, *_ehci1; - -int _IsInUsbInterrupt = 0; - -static UDEV_DRV_T *_drivers[MAX_UDEV_DRIVER]; - -static CONN_FUNC *g_conn_func, *g_disconn_func; - -extern void OHCI0_IRQHandler(int vector, void *param); -extern void OHCI1_IRQHandler(int vector, void *param); -extern void EHCI0_IRQHandler(int vector, void *param); -extern void EHCI1_IRQHandler(int vector, void *param); - - -/// @endcond HIDDEN_SYMBOLS - - -/** - * @brief Initialize MA35D1 USB Host controller and USB stack. - * - * @return None. - */ -void usbh_core_init() -{ - _ehci0 = (HSUSBH_T *)HSUSBH0_BASE; - _ohci0 = (USBH_T *)USBH0_BASE; - _ehci1 = (HSUSBH_T *)HSUSBH1_BASE; - _ohci1 = (USBH_T *)USBH1_BASE; - - memset(_drivers, 0, sizeof(_drivers)); - - g_conn_func = NULL; - g_disconn_func = NULL; - -// usbh_hub_init(); - usbh_memory_init(); - -#ifdef ENABLE_OHCI0 - rt_hw_interrupt_install(USBH0_IRQn, OHCI0_IRQHandler, NULL, "ohci0"); - rt_hw_interrupt_umask(USBH0_IRQn); - ohci0_driver.init(); - rt_kprintf("OHCI0 init done.\n"); -#endif - -#ifdef ENABLE_EHCI0 - rt_hw_interrupt_install(HSUSBH0_IRQn, EHCI0_IRQHandler, NULL, "ehci0"); - rt_hw_interrupt_umask(HSUSBH0_IRQn); - ehci0_driver.init(); - rt_kprintf("EHCI0 init done.\n"); -#endif - -#ifdef ENABLE_OHCI1 - rt_hw_interrupt_install(USBH1_IRQn, OHCI1_IRQHandler, NULL, "ohci1"); - rt_hw_interrupt_umask(USBH1_IRQn); - ohci1_driver.init(); - rt_kprintf("OHCI1 init done.\n"); -#endif - -#ifdef ENABLE_EHCI1 - rt_hw_interrupt_install(HSUSBH1_IRQn, EHCI1_IRQHandler, NULL, "ehci1"); - rt_hw_interrupt_umask(HSUSBH1_IRQn); - ehci1_driver.init(); - rt_kprintf("EHCI1 init done.\n"); -#endif -} - - - - -/** - * @brief Let USB stack polls all root hubs. If there's any hub port - * change found, USB stack will manage the hub events in this function call. - * In this function, USB stack enumerates newly connected devices and remove staff - * of disconnected devices. User's application should periodically invoke this - * function. - * @return There's hub port change or not. - * @retval 0 No any hub port status changes found. - * @retval 1 There's hub port status changes. - */ -int usbh_polling_root_hubs(void) -{ - int ret, change = 0; - -#ifdef ENABLE_EHCI0 - //_ehci0->UPSCR[1] = HSUSBH_UPSCR_PP_Msk | HSUSBH_UPSCR_PO_Msk; /* set port 2 owner to OHCI */ - do - { - ret = ehci0_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); - // scan_isochronous_list(); -#endif - -#ifdef ENABLE_EHCI1 - //_ehci1->UPSCR[1] = HSUSBH_UPSCR_PP_Msk | HSUSBH_UPSCR_PO_Msk; /* set port 2 owner to OHCI */ - do - { - ret = ehci1_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); - // scan_isochronous_list(); -#endif - -#ifdef ENABLE_OHCI0 - do - { - ret = ohci0_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - -#ifdef ENABLE_OHCI1 - do - { - ret = ohci1_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - - return change; -} - -/** - * @brief Force to quit an endpoint transfer. - * @param[in] udev The USB device. - * @param[in] ep The endpoint to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep) -{ - return udev->hc_driver->quit_xfer(NULL, ep); -} - - -int usbh_connect_device(UDEV_T *udev) -{ - usbh_delay_ms(100); /* initially, give 100 ms delay */ - - if (g_conn_func) - g_conn_func(udev, 0); - - return 0; -} - - -void usbh_disconnect_device(UDEV_T *udev) -{ - USB_debug("disconnect device...\n"); - - if (g_disconn_func) - g_disconn_func(udev, 0); - - -#if 1 //CHECK: Maybe create a new API to quit_xfer and free udev for application - usbh_quit_xfer(udev, &(udev->ep0)); /* Quit control transfer if hw_pipe is not NULL. */ - - /* remove device from global device list */ -// free_dev_address(udev->dev_num); - free_device(udev); - -// usbh_memory_used(); -#endif -} - -/** - * @brief Install device connect and disconnect callback function. - * - * @param[in] conn_func Device connect callback function. - * @param[in] disconn_func Device disconnect callback function. - * @return None. - */ -void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func) -{ - g_conn_func = conn_func; - g_disconn_func = disconn_func; -} - -int usbh_reset_port(UDEV_T *udev) -{ - if (udev->parent == NULL) - { - if (udev->hc_driver) - return udev->hc_driver->rthub_port_reset(udev->port_num - 1); - else - return USBH_ERR_NOT_FOUND; - } - else - { - return udev->parent->port_reset(udev->parent, udev->port_num); - } -} - - -/** - * @brief Force to quit an UTR transfer. - * @param[in] utr The UTR transfer to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_utr(UTR_T *utr) -{ - if (!utr || !utr->udev) - return USBH_ERR_NOT_FOUND; - - return utr->udev->hc_driver->quit_xfer(utr, NULL); -} - - -/** - * @brief Execute an USB request in control transfer. This function returns after the request - * was done or aborted. - * @param[in] udev The target USB device. - * @param[in] bmRequestType Characteristics of request - * @param[in] bRequest Specific request - * @param[in] wValue Word-sized field that varies according to request - * @param[in] wIndex Word-sized field that varies according to request - * @param[in] wLength Number of bytes to transfer if there is a Data stage - * @param[in] buff Data buffer used in data stage - * @param[out] xfer_len Transmitted/received length of data - * @param[in] timeout Time-out limit (in 10ms - timer tick) of this transfer - * @retval 0 Transfer success - * @retval < 0 Transfer failed. Refer to error code definitions. - */ -int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, - uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout) -{ - UTR_T *utr; - uint32_t t0, timeout_tick; - int status; - - *xfer_len = 0; - - //if (check_device(udev)) - // return USBH_ERR_INVALID_PARAM; - - utr = alloc_utr(udev); - if (utr == NULL) - return USBH_ERR_MEMORY_OUT; - - utr->setup.bmRequestType = bmRequestType; - utr->setup.bRequest = bRequest; - utr->setup.wValue = wValue; - utr->setup.wIndex = wIndex; - utr->setup.wLength = wLength; - - utr->buff = buff; - utr->data_len = wLength; - utr->bIsTransferDone = 0; - status = udev->hc_driver->ctrl_xfer(utr); - if (status < 0) - { - udev->ep0.hw_pipe = NULL; - free_utr(utr); - return status; - } - - timeout_tick = usbh_tick_from_millisecond(timeout); - t0 = usbh_get_ticks(); - while (utr->bIsTransferDone == 0) - { - if (usbh_get_ticks() - t0 > timeout_tick) - { - usbh_quit_utr(utr); - free_utr(utr); - udev->ep0.hw_pipe = NULL; - return USBH_ERR_TIMEOUT; - } - } - - status = utr->status; - - if (status == 0) - { - *xfer_len = utr->xfer_len; - } - free_utr(utr); - - return status; -} - -/** - * @brief Execute a bulk transfer request. This function will return immediately after - * issued the bulk transfer. USB stack will later call back utr->func() once the bulk - * transfer was done or aborted. - * @param[in] utr The bulk transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_bulk_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->bulk_xfer(utr); -} - -/** - * @brief Execute an interrupt transfer request. This function will return immediately after - * issued the interrupt transfer. USB stack will later call back utr->func() once the - * interrupt transfer was done or aborted. - * @param[in] utr The interrupt transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_int_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->int_xfer(utr); -} - - diff --git a/bsp/nuvoton/libraries/ma35/libcpu/SConscript b/bsp/nuvoton/libraries/ma35/libcpu/SConscript deleted file mode 100644 index 6092707e6d6..00000000000 --- a/bsp/nuvoton/libraries/ma35/libcpu/SConscript +++ /dev/null @@ -1,15 +0,0 @@ -# RT-Thread building script for bridge - -import os -from building import * - -Import('rtconfig') - -cwd = GetCurrentDir() -group = [] -list = os.listdir(cwd) - -if rtconfig.ARCH in list: - group = group + SConscript(os.path.join(rtconfig.ARCH, 'SConscript')) - -Return('group') diff --git a/bsp/nuvoton/libraries/ma35/libcpu/arm/SConscript b/bsp/nuvoton/libraries/ma35/libcpu/arm/SConscript deleted file mode 100644 index 0bf1ca703aa..00000000000 --- a/bsp/nuvoton/libraries/ma35/libcpu/arm/SConscript +++ /dev/null @@ -1,17 +0,0 @@ -# RT-Thread building script for bridge - -import os -from building import * - -Import('rtconfig') - -cwd = GetCurrentDir() -list = os.listdir(cwd) - -group = [] - -# cpu porting code files -if rtconfig.CPU in list: - group = group + SConscript(os.path.join(rtconfig.CPU, 'SConscript')) - -Return('group') diff --git a/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/SConscript b/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/SConscript deleted file mode 100644 index d2804d98264..00000000000 --- a/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/SConscript +++ /dev/null @@ -1,14 +0,0 @@ -# RT-Thread building script for component - -from building import * -Import('RTT_ROOT') - -cwd = GetCurrentDir() -src = Glob('*.c') + Glob('*.cpp') -CPPPATH = [cwd] -group = [] - -# USB driver constrain -group = DefineGroup('CPU', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.c b/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.c deleted file mode 100644 index 38ee902044f..00000000000 --- a/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.c +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************//** -* -* @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. -* -* SPDX-License-Identifier: Apache-2.0 -* -* Change Logs: -* Date Author Notes -* 2021-07-19 Wayne First version -* -******************************************************************************/ - -#include -#include "interrupt.h" - -#define NVIC_INT_OFFSET (16) -#define SYS_MAX_INT_SOURCE (IRQn_Max) - -static struct rt_irq_desc irq_desc[SYS_MAX_INT_SOURCE] = {0}; - -void rt_hw_interrupt_dummy_handler(int vector, void *param) -{ - rt_kprintf("Unhandled interrupt %d occurred!!!\n", vector); - - RT_ASSERT(0); -} - -static uint32_t rt_hw_interrupt_current_irq(void) -{ - return ((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) >> SCB_ICSR_VECTACTIVE_Pos); -} - -void ISR_Trapper(void) -{ - int irq; - - /* Enter interrupt */ - rt_interrupt_enter(); - - /* Get irq number */ - irq = rt_hw_interrupt_current_irq(); - if (irq >= SYS_MAX_INT_SOURCE) - { - rt_kprintf("Over interrupt range - %d!!!\n", irq); - goto exit_rt_interrupt_trap; - } - else if (irq_desc[irq].handler == RT_NULL) - { - rt_kprintf("Unhandled interrupt %d occurred!!!\n", irq); - goto exit_rt_interrupt_trap; - } - else - { - void *param; - rt_isr_handler_t isr_func; - - /* get interrupt service routine */ - isr_func = irq_desc[irq].handler; - param = irq_desc[irq].param; - - /* turn to interrupt service routine */ - isr_func(irq, param); - } - -#ifdef RT_USING_INTERRUPT_INFO - irq_desc[irq].counter ++; -#endif - -exit_rt_interrupt_trap: - - /* Enter interrupt */ - rt_interrupt_leave(); -} - -void rt_hw_interrupt_init(void) -{ - int i; - vu32 *vpu32Vector; - - /* Enter interrupt */ - rt_interrupt_enter(); - - /* Replace user-handler in RAM to ISR_Trapper */ - vpu32Vector = (vu32 *)SCB->VTOR; - for (i = NVIC_INT_OFFSET; i < IRQn_Max; i++) - { - vpu32Vector[i] = (uint32_t)ISR_Trapper; - } - - /* Initial all interrupt handler */ - for (i = 0; i < SYS_MAX_INT_SOURCE; i++) - { - rt_hw_interrupt_install(i, RT_NULL, RT_NULL, (char *)"dummy"); - rt_hw_interrupt_mask(i); - } - - NVIC_SetPriorityGrouping(7); - - /* Enter interrupt */ - rt_interrupt_leave(); -} - -rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, void *param, const char *name) -{ - rt_isr_handler_t old_handler = RT_NULL; - - if (vector > SYS_MAX_INT_SOURCE) - return RT_NULL; - - /* Set default priority IRQ_LEVEL_7 */ - //rt_hw_interrupt_set_priority(vector, IRQ_LEVEL_7); - - old_handler = irq_desc[vector + NVIC_INT_OFFSET].handler; - if (handler != RT_NULL) - { - irq_desc[vector + NVIC_INT_OFFSET].handler = (rt_isr_handler_t)handler; - irq_desc[vector + NVIC_INT_OFFSET].param = param; -#ifdef RT_USING_INTERRUPT_INFO - rt_snprintf(irq_desc[vector + NVIC_INT_OFFSET].name, RT_NAME_MAX - 1, "%s", name); - irq_desc[vector + NVIC_INT_OFFSET].counter = 0; -#endif - } - - return old_handler; -} - -/* Disable interrupt */ -void rt_hw_interrupt_mask(int vector) -{ - NVIC_DisableIRQ((IRQn_Type)vector); - NVIC_ClearPendingIRQ((IRQn_Type)vector); -} - -/* Enable interrupt */ -void rt_hw_interrupt_umask(int vector) -{ - NVIC_EnableIRQ((IRQn_Type)vector); -} - -#ifdef RT_USING_INTERRUPT_INFO -int list_interrupt(int argc, char **argv) -{ - int i; - - for (i = 0; i <= SYS_MAX_INT_SOURCE; i++) - { - if (irq_desc[i].handler != rt_hw_interrupt_dummy_handler) - { - rt_kprintf("[%d] %s: %d\n", i, irq_desc[i].name, irq_desc[i].counter); - } - } - - return 0; -} -MSH_CMD_EXPORT(list_interrupt, list registered interrupts); -#endif diff --git a/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.h b/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.h deleted file mode 100644 index ff8ca32cbad..00000000000 --- a/bsp/nuvoton/libraries/ma35/libcpu/arm/cortex-m4/interrupt.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2006-2022, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2021-07-16 Wayne First version - */ - -#ifndef __INTERRUPT_H__ -#define __INTERRUPT_H__ - -#include -#include - -#define INT_IRQ 0x00 -#define INT_FIQ 0x01 - -void rt_hw_interrupt_init(void); -void rt_hw_interrupt_mask(int vector); -void rt_hw_interrupt_umask(int vector); -rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, - void *param, const char *name); - -#endif - diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/Kconfig b/bsp/nuvoton/libraries/ma35/rtt_port/Kconfig index 18a180732c3..fb6ca917cae 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/Kconfig +++ b/bsp/nuvoton/libraries/ma35/rtt_port/Kconfig @@ -3,6 +3,7 @@ select SOC_FAMILY_NUMICRO select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN + select PKG_USING_NUVOTON_SERIES_DRIVER default y config BSP_USING_SSPCC diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/N9H30.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/N9H30.h deleted file mode 100644 index 2bdc5ebddd0..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/N9H30.h +++ /dev/null @@ -1,2097 +0,0 @@ -/**************************************************************************//** - * @file N9H30.h - * @version V1.00 - * @brief N9H30 peripheral access layer header file. - * This file contains all the peripheral register's definitions - * and memory mapping for NuMicro N9H30 MCU. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -/** - \mainpage NuMicro N9H30 Family Driver Reference Guide - * - * Introduction - * - * This user manual describes the usage of N9H30 family device driver - * - * Disclaimer - * - * The Software is furnished "AS IS", without warranty as to performance or results, and - * the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all - * warranties, express, implied or otherwise, with regard to the Software, its use, or - * operation, including without limitation any and all warranties of merchantability, fitness - * for a particular purpose, and non-infringement of intellectual property rights. - * - * Important Notice - * - * Nuvoton Products are neither intended nor warranted for usage in systems or equipment, - * any malfunction or failure of which may cause loss of human life, bodily injury or severe - * property damage. Such applications are deemed, "Insecure Usage". - * - * Insecure usage includes, but is not limited to: equipment for surgical implementation, - * atomic energy control instruments, airplane or spaceship instruments, the control or - * operation of dynamic, brake or safety systems designed for vehicular use, traffic signal - * instruments, all types of safety devices, and other applications intended to support or - * sustain life. - * - * All Insecure Usage shall be made at customer's risk, and in the event that third parties - * lay claims to Nuvoton as a result of customer's Insecure Usage, customer shall indemnify - * the damages and liabilities thus incurred by Nuvoton. - * - * Please note that all data and specifications are subject to change without notice. All the - * trademarks of products and companies mentioned in this document belong to their respective - * owners. - * - * Copyright Notice - * - * Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - */ - -#ifndef __N9H30_H__ - #define __N9H30_H__ - - #include - - /** @addtogroup N9H30_PERIPHERAL_MEM_MAP N9H30 Peripheral Memory Base - Memory Mapped Structure for N9H30 Peripheral - @{ - */ - - /*!< AHB peripherals */ - #define SYS_BA 0xB0000000 /*!< System Global Control */ - #define CLK_BA 0xB0000200 /*!< Clock Control */ - #define EBI_BA 0xB0001000 /*!< EBI Control */ - #define SDIC_BA 0xB0001800 /*!< SDRAM (SDR/DDR/DDR2) Control */ - #define EMC0_BA 0xB0002000 /*!< Ethernet MAC 0 Control */ - #define EMC1_BA 0xB0003000 /*!< Ethernet MAC 1 Control */ - #define GDMA_BA 0xB0004000 /*!< GDMA control */ - #define USBH_BA 0xB0005000 /*!< USB Host EHCI Control */ - #define USBD_BA 0xB0006000 /*!< USB Device Control */ - #define USBO_BA 0xB0007000 /*!< OHCI USB Host Control */ - #define LCM_BA 0xB0008000 /*!< Display, LCM Interface */ - #define ACTL_BA 0xB0009000 /*!< Audio Control */ - #define JPEG_BA 0xB000A000 /*!< JPEG Engine Control */ - #define GE_BA 0xB000B000 /*!< 2-D Graphic Engine */ - #define SDH_BA 0xB000C000 /*!< SD/SDIO Host Controller */ - #define FMI_BA 0xB000D000 /*!< Flash Memory Card Interface */ - #define CAP_BA 0xB000E000 /*!< Sensor (Capture) Interface Control */ - #define CRPT_BA 0xB000F000 /*!< Crypto Engine Control */ - - /*!< APB peripherals */ - #define UART0_BA 0xB8000000 /*!< UART0 Control */ - #define UART1_BA 0xB8000100 /*!< UART1 Control (High-Speed UART) */ - #define UART2_BA 0xB8000200 /*!< UART2 Control (High-Speed UART) */ - #define UART3_BA 0xB8000300 /*!< UART3 Control */ - #define UART4_BA 0xB8000400 /*!< UART4 Control (High-Speed UART) */ - #define UART5_BA 0xB8000500 /*!< UART5 Control */ - #define UART6_BA 0xB8000600 /*!< UART6 Control (High-Speed UART) */ - #define UART7_BA 0xB8000700 /*!< UART7 Control */ - #define UART8_BA 0xB8000800 /*!< UART8 Control (High-Speed UART) */ - #define UART9_BA 0xB8000900 /*!< UART9 Control */ - #define UARTA_BA 0xB8000A00 /*!< UARTA Control (High-Speed UART) */ - #define TMR0_BA 0xB8001000 /*!< Timer 0 */ - #define TMR1_BA 0xB8001010 /*!< Timer 1 */ - #define TMR2_BA 0xB8001020 /*!< Timer 2 */ - #define TMR3_BA 0xB8001030 /*!< Timer 3 */ - #define TMR4_BA 0xB8001040 /*!< Timer 4 */ - #define ETMR0_BA 0xB8001400 /*!< Enhanced Timer 0 */ - #define ETMR1_BA 0xB8001500 /*!< Enhanced Timer 1 */ - #define ETMR2_BA 0xB8001600 /*!< Enhanced Timer 2 */ - #define ETMR3_BA 0xB8001700 /*!< Enhanced Timer 3 */ - #define WDT_BA 0xB8001800 /*!< Watch Dog Timer */ - #define WWDT_BA 0xB8001900 /*!< Window Watch Dog Timer */ - #define AIC_BA 0xB8002000 /*!< Interrupt Controller */ - #define GPIO_BA 0xB8003000 /*!< GPIO Control */ - #define RTC_BA 0xB8004000 /*!< Real Time Clock Control */ - #define SC0_BA 0xB8005000 /*!< Smart Card 0 Control */ - #define SC1_BA 0xB8005400 /*!< Smart Card 1 Control */ - #define I2C0_BA 0xB8006000 /*!< I2C 0 Control */ - #define I2C1_BA 0xB8006100 /*!< I2C 1 Control */ - #define SPI0_BA 0xB8006200 /*!< Serial Peripheral Interface 0 */ - #define SPI1_BA 0xB8006300 /*!< Serial Peripheral Interface 1 */ - #define PWM_BA 0xB8007000 /*!< Pulse Width Modulation (PWM) Control */ - #define ADC_BA 0xB800A000 /*!< ADC Control */ - #define CAN0_BA 0xB800B000 /*!< CAN 0 Control */ - #define CAN1_BA 0xB800B400 /*!< CAN 1 Control */ - #define MTP_BA 0xB800C000 /*!< MTP Control */ - - /*@}*/ /* end of group N9H30_PERIPHERAL_MEM_MAP */ - - /******************************************************************************/ - /* Device Specific Peripheral registers structures */ - /******************************************************************************/ - /** @addtogroup N9H30_Peripherals N9H30 Control Register - N9H30 Device Specific Peripheral registers structures - @{ - */ - - /*---------------------- System Manger Controller -------------------------*/ - /** - @addtogroup SYS System Manger Controller(SYS) - Memory Mapped Structure for SYS Controller - @{ */ - - #define REG_SYS_PDID (SYS_BA+0x000) /*!< Product Identifier Register */ - #define REG_SYS_PWRON (SYS_BA+0x004) /*!< Power-On Setting Register */ - #define REG_SYS_ARBCON (SYS_BA+0x008) /*!< Arbitration Control Register */ - #define REG_SYS_LVRDCR (SYS_BA+0x020) /*!< Low Voltage Reset & Detect Control Register */ - #define REG_SYS_MISCFCR (SYS_BA+0x030) /*!< Miscellaneous Function Control Register */ - #define REG_SYS_MISCIER (SYS_BA+0x040) /*!< Miscellaneous Interrupt Enable Register */ - #define REG_SYS_MISCISR (SYS_BA+0x044) /*!< Miscellaneous Interrupt Status Register */ - #define REG_SYS_WKUPSER (SYS_BA+0x058) /*!< System Wakeup Source Enable Register */ - #define REG_SYS_WKUPSSR (SYS_BA+0x05C) /*!< System Wakeup Source Status Register */ - #define REG_SYS_AHBIPRST (SYS_BA+0x060) /*!< AHB IP Reset Control Register */ - #define REG_SYS_APBIPRST0 (SYS_BA+0x064) /*!< APB IP Reset Control Register 0 */ - #define REG_SYS_APBIPRST1 (SYS_BA+0x068) /*!< APB IP Reset Control Register 1 */ - #define REG_SYS_RSTSTS (SYS_BA+0x06C) /*!< Reset Source Active Status Register */ - #define REG_SYS_GPA_MFPL (SYS_BA+0x070) /*!< GPIOA Low Byte Multiple Function Control Register */ - #define REG_SYS_GPA_MFPH (SYS_BA+0x074) /*!< GPIOA High Byte Multiple Function Control Register */ - #define REG_SYS_GPB_MFPL (SYS_BA+0x078) /*!< GPIOB Low Byte Multiple Function Control Register */ - #define REG_SYS_GPB_MFPH (SYS_BA+0x07C) /*!< GPIOB High Byte Multiple Function Control Register */ - #define REG_SYS_GPC_MFPL (SYS_BA+0x080) /*!< GPIOC Low Byte Multiple Function Control Register */ - #define REG_SYS_GPC_MFPH (SYS_BA+0x084) /*!< GPIOC High Byte Multiple Function Control Register */ - #define REG_SYS_GPD_MFPL (SYS_BA+0x088) /*!< GPIOD Low Byte Multiple Function Control Register */ - #define REG_SYS_GPD_MFPH (SYS_BA+0x08C) /*!< GPIOD High Byte Multiple Function Control Register */ - #define REG_SYS_GPE_MFPL (SYS_BA+0x090) /*!< GPIOE Low Byte Multiple Function Control Register */ - #define REG_SYS_GPE_MFPH (SYS_BA+0x094) /*!< GPIOE High Byte Multiple Function Control Register */ - #define REG_SYS_GPF_MFPL (SYS_BA+0x098) /*!< GPIOF Low Byte Multiple Function Control Register */ - #define REG_SYS_GPF_MFPH (SYS_BA+0x09C) /*!< GPIOF High Byte Multiple Function Control Register */ - #define REG_SYS_GPG_MFPL (SYS_BA+0x0A0) /*!< GPIOG Low Byte Multiple Function Control Register */ - #define REG_SYS_GPG_MFPH (SYS_BA+0x0A4) /*!< GPIOG High Byte Multiple Function Control Register */ - #define REG_SYS_GPH_MFPL (SYS_BA+0x0A8) /*!< GPIOH Low Byte Multiple Function Control Register */ - #define REG_SYS_GPH_MFPH (SYS_BA+0x0AC) /*!< GPIOH High Byte Multiple Function Control Register */ - #define REG_SYS_GPI_MFPL (SYS_BA+0x0B0) /*!< GPIOI Low Byte Multiple Function Control Register */ - #define REG_SYS_GPI_MFPH (SYS_BA+0x0B4) /*!< GPIOI High Byte Multiple Function Control Register */ - #define REG_SYS_GPJ_MFPL (SYS_BA+0x0B8) /*!< GPIOJ Low Byte Multiple Function Control Register */ - #define REG_SYS_DDR_DSCTL (SYS_BA+0x0F0) /*!< DDR I/O Driving Strength Control Register */ - #define REG_SYS_PORDISCR (SYS_BA+0x100) /*!< Power-On-Reset Disable Control Register */ - #define REG_SYS_ICEDBGCR (SYS_BA+0x104) /*!< ICE Debug Interface Control Register */ - #define REG_SYS_ERRADDCR (SYS_BA+0x108) /*!< Error Response Address Control Regsiter */ - #define REG_SYS_REGWPCTL (SYS_BA+0x1FC) /*!< Register Write-Protection Control Register */ - - /**@}*/ /* end of SYS register group */ - - /*---------------------- System Clock Controller -------------------------*/ - /** - @addtogroup CLK System Clock Controller(CLK) - Memory Mapped Structure for CLK Controller - @{ */ - - #define REG_CLK_PMCON (CLK_BA+0x00) /*!< Power Management Control Register */ - #define REG_CLK_HCLKEN (CLK_BA+0x10) /*!< AHB IP Clock Enable Control Register */ - #define REG_CLK_PCLKEN0 (CLK_BA+0x18) /*!< APB IP Clock Enable Control Register 0 */ - #define REG_CLK_PCLKEN1 (CLK_BA+0x1C) /*!< APB IP Clock Enable Control Register 1 */ - #define REG_CLK_DIVCTL0 (CLK_BA+0x20) /*!< Clock Divider Control Register 0 */ - #define REG_CLK_DIVCTL1 (CLK_BA+0x24) /*!< Clock Divider Control Register 1 */ - #define REG_CLK_DIVCTL2 (CLK_BA+0x28) /*!< Clock Divider Control Register 2 */ - #define REG_CLK_DIVCTL3 (CLK_BA+0x2C) /*!< Clock Divider Control Register 3 */ - #define REG_CLK_DIVCTL4 (CLK_BA+0x30) /*!< Clock Divider Control Register 4 */ - #define REG_CLK_DIVCTL5 (CLK_BA+0x34) /*!< Clock Divider Control Register 5 */ - #define REG_CLK_DIVCTL6 (CLK_BA+0x38) /*!< Clock Divider Control Register 6 */ - #define REG_CLK_DIVCTL7 (CLK_BA+0x3C) /*!< Clock Divider Control Register 7 */ - #define REG_CLK_DIVCTL8 (CLK_BA+0x40) /*!< Clock Divider Control Register 8 */ - #define REG_CLK_DIVCTL9 (CLK_BA+0x44) /*!< Clock Divider Control Register 9 */ - #define REG_CLK_APLLCON (CLK_BA+0x60) /*!< APLL Control Register */ - #define REG_CLK_UPLLCON (CLK_BA+0x64) /*!< UPLL Control Register */ - #define REG_CLK_PLLSTBCNTR (CLK_BA+0x80) /*!< PLL Stable Counter and Test Clock Control Register */ - - /**@}*/ /* end of CLK register group */ - - - /*---------------------- External Bus Interface Controller -------------------------*/ - /** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller - @{ */ - - #define REG_EBI_CTL (EBI_BA+0x000) /*!< EBI control register */ - #define REG_EBI_BNKCTL0 (EBI_BA+0x018) /*!< External I/O 0 control register */ - #define REG_EBI_BNKCTL1 (EBI_BA+0x01C) /*!< External I/O 1 control register */ - #define REG_EBI_BNKCTL2 (EBI_BA+0x020) /*!< External I/O 2 control register */ - #define REG_EBI_BNKCTL3 (EBI_BA+0x024) /*!< External I/O 3 control register */ - #define REG_EBI_BNKCTL4 (EBI_BA+0x028) /*!< External I/O 4 control register */ - - /**@}*/ /* end of EBI register group */ - - - /*---------------------- Ethernet MAC Controller -------------------------*/ - /** - @addtogroup EMAC Ethernet MAC Controller(EMAC) - Memory Mapped Structure for EMAC Controller - @{ */ - - #define REG_EMAC0_CAMCMR (EMC0_BA+0x000) /*!< CAM Command Register */ - #define REG_EMAC0_CAMEN (EMC0_BA+0x004) /*!< CAM Enable Register */ - #define REG_EMAC0_CAM0M (EMC0_BA+0x008) /*!< CAM0 Most Significant Word Register */ - #define REG_EMAC0_CAM0L (EMC0_BA+0x00c) /*!< CAM0 Least Significant Word Register */ - #define REG_EMAC0_CAMxM_Reg(x)(REG_EMAC0_CAM0M+(x)*0x8) /*!< CAMx Most Significant Word Register */ - #define REG_EMAC0_CAMxL_Reg(x)(REG_EMAC0_CAM0L+(x)*0x8) /*!< CAMx Least Significant Word Register */ - #define REG_EMAC0_TXDLSA (EMC0_BA+0x088) /*!< Transmit Descriptor Link List Start Address Register */ - #define REG_EMAC0_RXDLSA (EMC0_BA+0x08C) /*!< Receive Descriptor Link List Start Address Register */ - #define REG_EMAC0_MCMDR (EMC0_BA+0x090) /*!< MAC Command Register */ - #define REG_EMAC0_MIID (EMC0_BA+0x094) /*!< MII Management Data Register */ - #define REG_EMAC0_MIIDA (EMC0_BA+0x098) /*!< MII Management Control and Address Register */ - #define REG_EMAC0_FFTCR (EMC0_BA+0x09C) /*!< FIFO Threshold Control Register */ - #define REG_EMAC0_TSDR (EMC0_BA+0x0a0) /*!< Transmit Start Demand Register */ - #define REG_EMAC0_RSDR (EMC0_BA+0x0a4) /*!< Receive Start Demand Register */ - #define REG_EMAC0_DMARFC (EMC0_BA+0x0a8) /*!< Maximum Receive Frame Control Register */ - #define REG_EMAC0_MIEN (EMC0_BA+0x0ac) /*!< MAC Interrupt Enable Register */ - #define REG_EMAC0_MISTA (EMC0_BA+0x0b0) /*!< MAC Interrupt Status Register */ - #define REG_EMAC0_MGSTA (EMC0_BA+0x0b4) /*!< MAC General Status Register */ - #define REG_EMAC0_MPCNT (EMC0_BA+0x0b8) /*!< Missed Packet Count Register */ - #define REG_EMAC0_MRPC (EMC0_BA+0x0bc) /*!< MAC Receive Pause Count Register */ - #define REG_EMAC0_DMARFS (EMC0_BA+0x0c8) /*!< DMA Receive Frame Status Register */ - #define REG_EMAC0_CTXDSA (EMC0_BA+0x0cc) /*!< Current Transmit Descriptor Start Address Register */ - #define REG_EMAC0_CTXBSA (EMC0_BA+0x0d0) /*!< Current Transmit Buffer Start Address Register */ - #define REG_EMAC0_CRXDSA (EMC0_BA+0x0d4) /*!< Current Receive Descriptor Start Address Register */ - #define REG_EMAC0_CRXBSA (EMC0_BA+0x0d8) /*!< Current Receive Buffer Start Address Register */ - #define REG_EMAC0_TSCTL (EMC0_BA+0x100) /*!< Time Stamp Control Register */ - #define REG_EMAC0_TSSEC (EMC0_BA+0x110) /*!< Time Stamp Counter Second Register */ - #define REG_EMAC0_TSSUBSEC (EMC0_BA+0x114) /*!< Time Stamp Counter Sub Second Register */ - #define REG_EMAC0_TSINC (EMC0_BA+0x118) /*!< Time Stamp Increment Register */ - #define REG_EMAC0_TSADDEN (EMC0_BA+0x11c) /*!< Time Stamp Addend Register */ - #define REG_EMAC0_TSUPDSEC (EMC0_BA+0x120) /*!< Time Stamp Update Second Register */ - #define REG_EMAC0_TSUPDSUBSEC (EMC0_BA+0x124) /*!< Time Stamp Update Sub Second Register */ - #define REG_EMAC0_TSALMSEC (EMC0_BA+0x128) /*!< Time Stamp Alarm Second Register */ - #define REG_EMAC0_TSALMSUBSEC (EMC0_BA+0x12c) /*!< Time Stamp Alarm Sub Second Register */ - - #define REG_EMAC1_CAMCMR (EMC1_BA+0x000) /*!< CAM Command Register */ - #define REG_EMAC1_CAMEN (EMC1_BA+0x004) /*!< CAM Enable Register */ - #define REG_EMAC1_CAM0M (EMC1_BA+0x008) /*!< CAM0 Most Significant Word Register */ - #define REG_EMAC1_CAM0L (EMC1_BA+0x00c) /*!< CAM0 Least Significant Word Register */ - #define REG_EMAC1_CAMxM_Reg(x)(REG_EMAC1_CAM0M+(x)*0x8) /*!< CAMx Most Significant Word Register */ - #define REG_EMAC1_CAMxL_Reg(x)(REG_EMAC1_CAM0L+(x)*0x8) /*!< CAMx Least Significant Word Register */ - #define REG_EMAC1_TXDLSA (EMC1_BA+0x088) /*!< Transmit Descriptor Link List Start Address Register */ - #define REG_EMAC1_RXDLSA (EMC1_BA+0x08C) /*!< Receive Descriptor Link List Start Address Register */ - #define REG_EMAC1_MCMDR (EMC1_BA+0x090) /*!< MAC Command Register */ - #define REG_EMAC1_MIID (EMC1_BA+0x094) /*!< MII Management Data Register */ - #define REG_EMAC1_MIIDA (EMC1_BA+0x098) /*!< MII Management Control and Address Register */ - #define REG_EMAC1_FFTCR (EMC1_BA+0x09C) /*!< FIFO Threshold Control Register */ - #define REG_EMAC1_TSDR (EMC1_BA+0x0a0) /*!< Transmit Start Demand Register */ - #define REG_EMAC1_RSDR (EMC1_BA+0x0a4) /*!< Receive Start Demand Register */ - #define REG_EMAC1_DMARFC (EMC1_BA+0x0a8) /*!< Maximum Receive Frame Control Register */ - #define REG_EMAC1_MIEN (EMC1_BA+0x0ac) /*!< MAC Interrupt Enable Register */ - #define REG_EMAC1_MISTA (EMC1_BA+0x0b0) /*!< MAC Interrupt Status Register */ - #define REG_EMAC1_MGSTA (EMC1_BA+0x0b4) /*!< MAC General Status Register */ - #define REG_EMAC1_MPCNT (EMC1_BA+0x0b8) /*!< Missed Packet Count Register */ - #define REG_EMAC1_MRPC (EMC1_BA+0x0bc) /*!< MAC Receive Pause Count Register */ - #define REG_EMAC1_DMARFS (EMC1_BA+0x0c8) /*!< DMA Receive Frame Status Register */ - #define REG_EMAC1_CTXDSA (EMC1_BA+0x0cc) /*!< Current Transmit Descriptor Start Address Register */ - #define REG_EMAC1_CTXBSA (EMC1_BA+0x0d0) /*!< Current Transmit Buffer Start Address Register */ - #define REG_EMAC1_CRXDSA (EMC1_BA+0x0d4) /*!< Current Receive Descriptor Start Address Register */ - #define REG_EMAC1_CRXBSA (EMC1_BA+0x0d8) /*!< Current Receive Buffer Start Address Register */ - #define REG_EMAC1_TSCTL (EMC1_BA+0x100) /*!< Time Stamp Control Register */ - #define REG_EMAC1_TSSEC (EMC1_BA+0x110) /*!< Time Stamp Counter Second Register */ - #define REG_EMAC1_TSSUBSEC (EMC1_BA+0x114) /*!< Time Stamp Counter Sub Second Register */ - #define REG_EMAC1_TSINC (EMC1_BA+0x118) /*!< Time Stamp Increment Register */ - #define REG_EMAC1_TSADDEN (EMC1_BA+0x11c) /*!< Time Stamp Addend Register */ - #define REG_EMAC1_TSUPDSEC (EMC1_BA+0x120) /*!< Time Stamp Update Second Register */ - #define REG_EMAC1_TSUPDSUBSEC (EMC1_BA+0x124) /*!< Time Stamp Update Sub Second Register */ - #define REG_EMAC1_TSALMSEC (EMC1_BA+0x128) /*!< Time Stamp Alarm Second Register */ - #define REG_EMAC1_TSALMSUBSEC (EMC1_BA+0x12c) /*!< Time Stamp Alarm Sub Second Register */ - - /**@}*/ /* end of EMAC register group */ - - /*---------------------- General Direct Memory Access Controller -------------------------*/ - /** - @addtogroup GDMA General Direct Memory Access Controller(GDMA) - Memory Mapped Structure for GDMA Controller - @{ */ - - #define REG_GDMA_CTL0 (GDMA_BA+0x000) /*!< Channel 0 Control Register */ - #define REG_GDMA_SRCB0 (GDMA_BA+0x004) /*!< Channel 0 Source Base Address Register */ - #define REG_GDMA_DSTB0 (GDMA_BA+0x008) /*!< Channel 0 Destination Base Address Register */ - #define REG_GDMA_TCNT0 (GDMA_BA+0x00C) /*!< Channel 0 Transfer Count Register */ - #define REG_GDMA_CSRC0 (GDMA_BA+0x010) /*!< Channel 0 Current Source Address Register */ - #define REG_GDMA_CDST0 (GDMA_BA+0x014) /*!< Channel 0 Current Destination Address Register */ - #define REG_GDMA_CTCNT0 (GDMA_BA+0x018) /*!< Channel 0 Current Transfer Count Register */ - #define REG_GDMA_DADR0 (GDMA_BA+0x01C) /*!< Channel 0 Descriptor Address Register */ - #define REG_GDMA_CTL1 (GDMA_BA+0x020) /*!< Channel 1 Control Register */ - #define REG_GDMA_SRCB1 (GDMA_BA+0x024) /*!< Channel 1 Source Base Address Register */ - #define REG_GDMA_DSTB1 (GDMA_BA+0x028) /*!< Channel 1 Destination Base Address Register */ - #define REG_GDMA_TCNT1 (GDMA_BA+0x02C) /*!< Channel 1 Transfer Count Register */ - #define REG_GDMA_CSRC1 (GDMA_BA+0x030) /*!< Channel 1 Current Source Address Register */ - #define REG_GDMA_CDST1 (GDMA_BA+0x034) /*!< Channel 1 Current Destination Address Register */ - #define REG_GDMA_CTCNT1 (GDMA_BA+0x038) /*!< Channel 1 Current Transfer Count Register */ - #define REG_GDMA_DADR1 (GDMA_BA+0x03C) /*!< Channel 1 Descriptor Address Register */ - #define REG_GDMA_INTBUF0 (GDMA_BA+0x080) /*!< GDMA Internal Buffer Word 0 */ - #define REG_GDMA_INTBUF1 (GDMA_BA+0x084) /*!< GDMA Internal Buffer Word 1 */ - #define REG_GDMA_INTBUF2 (GDMA_BA+0x088) /*!< GDMA Internal Buffer Word 2 */ - #define REG_GDMA_INTBUF3 (GDMA_BA+0x08C) /*!< GDMA Internal Buffer Word 3 */ - #define REG_GDMA_INTBUF4 (GDMA_BA+0x090) /*!< GDMA Internal Buffer Word 4 */ - #define REG_GDMA_INTBUF5 (GDMA_BA+0x094) /*!< GDMA Internal Buffer Word 5 */ - #define REG_GDMA_INTBUF6 (GDMA_BA+0x098) /*!< GDMA Internal Buffer Word 6 */ - #define REG_GDMA_INTBUF7 (GDMA_BA+0x09C) /*!< GDMA Internal Buffer Word 7 */ - #define REG_GDMA_INTCS (GDMA_BA+0x0A0) /*!< Interrupt Control and Status Register */ - - /**@}*/ /* end of GDMA register group */ - - - - /*---------------------- USB Device Controller -------------------------*/ - /** - @addtogroup USBD USB Device Controller(USBD) - Memory Mapped Structure for USBD Controller - @{ */ - #define REG_USBD_GINTSTS (USBD_BA+0x00) /*!< Interrupt Status Low Register */ - #define REG_USBD_GINTEN (USBD_BA+0x08) /*!< Interrupt Enable Low Register */ - #define REG_USBD_BUSINTSTS (USBD_BA+0x10) /*!< USB Bus Interrupt Status Register */ - #define REG_USBD_BUSINTEN (USBD_BA+0x14) /*!< USB Bus Interrupt Enable Register */ - #define REG_USBD_OPER (USBD_BA+0x18) /*!< USB Operational Register */ - #define REG_USBD_FRAMECNT (USBD_BA+0x1C) /*!< USB Frame Count Register */ - #define REG_USBD_FADDR (USBD_BA+0x20) /*!< USB Function Address Register */ - #define REG_USBD_TEST (USBD_BA+0x24) /*!< USB Test Mode Register */ - #define REG_USBD_CEPDAT (USBD_BA+0x28) /*!< Control-ep data buffer register */ - #define REG_USBD_CEPCTL (USBD_BA+0x2C) /*!< Control-ep control and status register */ - #define REG_USBD_CEPINTEN (USBD_BA+0x30) /*!< Control-ep interrupt enable register */ - #define REG_USBD_CEPINTSTS (USBD_BA+0x34) /*!< Control-ep interrupt status register */ - #define REG_USBD_CEPTXCNT (USBD_BA+0x38) /*!< In-transfer data count register */ - #define REG_USBD_CEPRXCNT (USBD_BA+0x3C) /*!< Out-transfer data count register */ - #define REG_USBD_CEPDATCNT (USBD_BA+0x40) /*!< Control-ep data count register */ - #define REG_USBD_SETUP1_0 (USBD_BA+0x44) /*!< Setup byte1 & byte0 register */ - #define REG_USBD_SETUP3_2 (USBD_BA+0x48) /*!< Setup byte3 & byte2 register */ - #define REG_USBD_SETUP5_4 (USBD_BA+0x4C) /*!< Setup byte5 & byte4 register */ - #define REG_USBD_SETUP7_6 (USBD_BA+0x50) /*!< Setup byte7 & byte6 register */ - #define REG_USBD_CEPBUFSTART (USBD_BA+0x54) /*!< Control-ep ram start address register */ - #define REG_USBD_CEPBUFEND (USBD_BA+0x58) /*!< Control-ep ram end address register */ - #define REG_USBD_DMACTL (USBD_BA+0x5C) /*!< Dma control and status register */ - #define REG_USBD_DMACNT (USBD_BA+0x60) /*!< Dma count register */ - - #define REG_USBD_EPADAT (USBD_BA+0x64) /*!< Endpoint A data buffer register */ - #define REG_USBD_EPAINTSTS (USBD_BA+0x68) /*!< Endpoint A interrupt status register */ - #define REG_USBD_EPAINTEN (USBD_BA+0x6C) /*!< Endpoint A interrupt enable register */ - #define REG_USBD_EPADATCNT (USBD_BA+0x70) /*!< Data count available in endpoint A buffer */ - #define REG_USBD_EPARSPCTL (USBD_BA+0x74) /*!< Endpoint A response register set/clear */ - #define REG_USBD_EPAMPS (USBD_BA+0x78) /*!< Endpoint A max packet size register */ - #define REG_USBD_EPATXCNT (USBD_BA+0x7C) /*!< Endpoint A transfer count register */ - #define REG_USBD_EPACFG (USBD_BA+0x80) /*!< Endpoint A configuration register */ - #define REG_USBD_EPABUFSTART (USBD_BA+0x84) /*!< Endpoint A ram start address register */ - #define REG_USBD_EPABUFEND (USBD_BA+0x88) /*!< Endpoint A ram end address register */ - - #define REG_USBD_EPBDAT (USBD_BA+0x8C) /*!< Endpoint B data buffer register */ - #define REG_USBD_EPBINTSTS (USBD_BA+0x90) /*!< Endpoint B interrupt status register */ - #define REG_USBD_EPBINTEN (USBD_BA+0x94) /*!< Endpoint B interrupt enable register */ - #define REG_USBD_EPBDATCNT (USBD_BA+0x98) /*!< Data count available in endpoint B buffer */ - #define REG_USBD_EPBRSPCTL (USBD_BA+0x9C) /*!< Endpoint B response register set/clear */ - #define REG_USBD_EPBMPS (USBD_BA+0xA0) /*!< Endpoint B max packet size register */ - #define REG_USBD_EPBTXCNT (USBD_BA+0xA4) /*!< Endpoint B transfer count register */ - #define REG_USBD_EPBCFG (USBD_BA+0xA8) /*!< Endpoint B configuration register */ - #define REG_USBD_EPBBUFSTART (USBD_BA+0xAC) /*!< Endpoint B ram start address register */ - #define REG_USBD_EPBBUFEND (USBD_BA+0xB0) /*!< Endpoint B ram end address register */ - - #define REG_USBD_EPCDAT (USBD_BA+0xB4) /*!< Endpoint C data buffer register */ - #define REG_USBD_EPCINTSTS (USBD_BA+0xB8) /*!< Endpoint C interrupt status register */ - #define REG_USBD_EPCINTEN (USBD_BA+0xBC) /*!< Endpoint C interrupt enable register */ - #define REG_USBD_EPCDATCNT (USBD_BA+0xC0) /*!< Data count available in endpoint C buffer */ - #define REG_USBD_EPCRSPCTL (USBD_BA+0xC4) /*!< Endpoint C response register set/clear */ - #define REG_USBD_EPCMPS (USBD_BA+0xC8) /*!< Endpoint C max packet size register */ - #define REG_USBD_EPCTXCNT (USBD_BA+0xCC) /*!< Endpoint C transfer count register */ - #define REG_USBD_EPCCFG (USBD_BA+0xD0) /*!< Endpoint C configuration register */ - #define REG_USBD_EPCBUFSTART (USBD_BA+0xD4) /*!< Endpoint C ram start address register */ - #define REG_USBD_EPCBUFEND (USBD_BA+0xD8) /*!< Endpoint C ram end address register */ - - #define REG_USBD_EPDDAT (USBD_BA+0xDC) /*!< Endpoint D data buffer register */ - #define REG_USBD_EPDINTSTS (USBD_BA+0xE0) /*!< Endpoint D interrupt status register */ - #define REG_USBD_EPDINTEN (USBD_BA+0xE4) /*!< Endpoint D interrupt enable register */ - #define REG_USBD_EPDDATCNT (USBD_BA+0xE8) /*!< Data count available in endpoint D buffer */ - #define REG_USBD_EPDRSPCTL (USBD_BA+0xEC) /*!< Endpoint D response register set/clear */ - #define REG_USBD_EPDMPS (USBD_BA+0xF0) /*!< Endpoint D max packet size register */ - #define REG_USBD_EPDTXCNT (USBD_BA+0xF4) /*!< Endpoint D transfer count register */ - #define REG_USBD_EPDCFG (USBD_BA+0xF8) /*!< Endpoint D configuration register */ - #define REG_USBD_EPDBUFSTART (USBD_BA+0xFC) /*!< Endpoint D ram start address register */ - #define REG_USBD_EPDBUFEND (USBD_BA+0x100) /*!< Endpoint D ram end address register */ - - #define REG_USBD_EPEDAT (USBD_BA+0x104) /*!< Endpoint E data buffer register */ - #define REG_USBD_EPEINTSTS (USBD_BA+0x108) /*!< Endpoint E interrupt status register */ - #define REG_USBD_EPEINTEN (USBD_BA+0x10C) /*!< Endpoint E interrupt enable register */ - #define REG_USBD_EPEDATCNT (USBD_BA+0x110) /*!< Data count available in endpoint E buffer */ - #define REG_USBD_EPERSPCTL (USBD_BA+0x114) /*!< Endpoint E response register set/clear */ - #define REG_USBD_EPEMPS (USBD_BA+0x118) /*!< Endpoint E max packet size register */ - #define REG_USBD_EPETXCNT (USBD_BA+0x11C) /*!< Endpoint E transfer count register */ - #define REG_USBD_EPECFG (USBD_BA+0x120) /*!< Endpoint E configuration register */ - #define REG_USBD_EPEBUFSTART (USBD_BA+0x124) /*!< Endpoint E ram start address register */ - #define REG_USBD_EPEBUFEND (USBD_BA+0x128) /*!< Endpoint E ram end address register */ - - #define REG_USBD_EPFDAT (USBD_BA+0x12C) /*!< Endpoint F data buffer register */ - #define REG_USBD_EPFINTSTS (USBD_BA+0x130) /*!< Endpoint F interrupt status register */ - #define REG_USBD_EPFINTEN (USBD_BA+0x134) /*!< Endpoint F interrupt enable register */ - #define REG_USBD_EPFDATCNT (USBD_BA+0x138) /*!< Data count available in endpoint F buffer */ - #define REG_USBD_EPFRSPCTL (USBD_BA+0x13C) /*!< Endpoint F response register set/clear */ - #define REG_USBD_EPFMPS (USBD_BA+0x140) /*!< Endpoint F max packet size register */ - #define REG_USBD_EPFTXCNT (USBD_BA+0x144) /*!< Endpoint F transfer count register */ - #define REG_USBD_EPFCFG (USBD_BA+0x148) /*!< Endpoint F configuration register */ - #define REG_USBD_EPFBUFSTART (USBD_BA+0x14C) /*!< Endpoint F ram start address register */ - #define REG_USBD_EPFBUFEND (USBD_BA+0x150) /*!< Endpoint F ram end address register */ - - #define REG_USBD_EPGDAT (USBD_BA+0x154) /*!< Endpoint G data buffer register */ - #define REG_USBD_EPGINTSTS (USBD_BA+0x158) /*!< Endpoint G interrupt status register */ - #define REG_USBD_EPGINTEN (USBD_BA+0x15C) /*!< Endpoint G interrupt enable register */ - #define REG_USBD_EPGDATCNT (USBD_BA+0x160) /*!< Data count available in endpoint G buffer */ - #define REG_USBD_EPGRSPCTL (USBD_BA+0x164) /*!< Endpoint G response register set/clear */ - #define REG_USBD_EPGMPS (USBD_BA+0x168) /*!< Endpoint G max packet size register */ - #define REG_USBD_EPGTXCNT (USBD_BA+0x16C) /*!< Endpoint G transfer count register */ - #define REG_USBD_EPGCFG (USBD_BA+0x170) /*!< Endpoint G configuration register */ - #define REG_USBD_EPGBUFSTART (USBD_BA+0x174) /*!< Endpoint G ram start address register */ - #define REG_USBD_EPGBUFEND (USBD_BA+0x178) /*!< Endpoint G ram end address register */ - - #define REG_USBD_EPHDAT (USBD_BA+0x17C) /*!< Endpoint H data buffer register */ - #define REG_USBD_EPHINTSTS (USBD_BA+0x180) /*!< Endpoint H interrupt status register */ - #define REG_USBD_EPHINTEN (USBD_BA+0x184) /*!< Endpoint H interrupt enable register */ - #define REG_USBD_EPHDATCNT (USBD_BA+0x188) /*!< Data count available in endpoint H buffer */ - #define REG_USBD_EPHRSPCTL (USBD_BA+0x18C) /*!< Endpoint H response register set/clear */ - #define REG_USBD_EPHMPS (USBD_BA+0x190) /*!< Endpoint H max packet size register */ - #define REG_USBD_EPHTXCNT (USBD_BA+0x194) /*!< Endpoint H transfer count register */ - #define REG_USBD_EPHCFG (USBD_BA+0x198) /*!< Endpoint H configuration register */ - #define REG_USBD_EPHBUFSTART (USBD_BA+0x19C) /*!< Endpoint H ram start address register */ - #define REG_USBD_EPHBUFEND (USBD_BA+0x1A0) /*!< Endpoint H ram end address register */ - - #define REG_USBD_EPIDAT (USBD_BA+0x1A4) /*!< Endpoint I data buffer register */ - #define REG_USBD_EPIINTSTS (USBD_BA+0x1A8) /*!< Endpoint I interrupt status register */ - #define REG_USBD_EPIINTEN (USBD_BA+0x1AC) /*!< Endpoint I interrupt enable register */ - #define REG_USBD_EPIDATCNT (USBD_BA+0x1B0) /*!< Data count available in endpoint I buffer */ - #define REG_USBD_EPIRSPCTL (USBD_BA+0x1B4) /*!< Endpoint I response register set/clear */ - #define REG_USBD_EPIMPS (USBD_BA+0x1B8) /*!< Endpoint I max packet size register */ - #define REG_USBD_EPITXCNT (USBD_BA+0x1BC) /*!< Endpoint I transfer count register */ - #define REG_USBD_EPICFG (USBD_BA+0x1C0) /*!< Endpoint I configuration register */ - #define REG_USBD_EPIBUFSTART (USBD_BA+0x1C4) /*!< Endpoint I ram start address register */ - #define REG_USBD_EPIBUFEND (USBD_BA+0x1C8) /*!< Endpoint I ram end address register */ - - #define REG_USBD_EPJDAT (USBD_BA+0x1CC) /*!< Endpoint J data buffer register */ - #define REG_USBD_EPJINTSTS (USBD_BA+0x1D0) /*!< Endpoint J interrupt status register */ - #define REG_USBD_EPJINTEN (USBD_BA+0x1D4) /*!< Endpoint J interrupt enable register */ - #define REG_USBD_EPJDATCNT (USBD_BA+0x1D8) /*!< Data count available in endpoint J buffer */ - #define REG_USBD_EPJRSPCTL (USBD_BA+0x1DC) /*!< Endpoint J response register set/clear */ - #define REG_USBD_EPJMPS (USBD_BA+0x1E0) /*!< Endpoint J max packet size register */ - #define REG_USBD_EPJTXCNT (USBD_BA+0x1E4) /*!< Endpoint J transfer count register */ - #define REG_USBD_EPJCFG (USBD_BA+0x1E8) /*!< Endpoint J configuration register */ - #define REG_USBD_EPJBUFSTART (USBD_BA+0x1EC) /*!< Endpoint J ram start address register */ - #define REG_USBD_EPJBUFEND (USBD_BA+0x1F0) /*!< Endpoint J ram end address register */ - - #define REG_USBD_EPKDAT (USBD_BA+0x1F4) /*!< Endpoint K data buffer register */ - #define REG_USBD_EPKINTSTS (USBD_BA+0x1F8) /*!< Endpoint K interrupt status register */ - #define REG_USBD_EPKINTEN (USBD_BA+0x1FC) /*!< Endpoint K interrupt enable register */ - #define REG_USBD_EPKDATCNT (USBD_BA+0x200) /*!< Data count available in endpoint K buffer */ - #define REG_USBD_EPKRSPCTL (USBD_BA+0x204) /*!< Endpoint K response register set/clear */ - #define REG_USBD_EPKMPS (USBD_BA+0x208) /*!< Endpoint K max packet size register */ - #define REG_USBD_EPKTXCNT (USBD_BA+0x20C) /*!< Endpoint K transfer count register */ - #define REG_USBD_EPKCFG (USBD_BA+0x210) /*!< Endpoint K configuration register */ - #define REG_USBD_EPKBUFSTART (USBD_BA+0x214) /*!< Endpoint K ram start address register */ - #define REG_USBD_EPKBUFEND (USBD_BA+0x218) /*!< Endpoint K ram end address register */ - - #define REG_USBD_EPLDAT (USBD_BA+0x21C) /*!< Endpoint L data buffer register */ - #define REG_USBD_EPLINTSTS (USBD_BA+0x220) /*!< Endpoint L interrupt status register */ - #define REG_USBD_EPLINTEN (USBD_BA+0x224) /*!< Endpoint L interrupt enable register */ - #define REG_USBD_EPLDATCNT (USBD_BA+0x228) /*!< Data count available in endpoint L buffer */ - #define REG_USBD_EPLRSPCTL (USBD_BA+0x22C) /*!< Endpoint L response register set/clear */ - #define REG_USBD_EPLMPS (USBD_BA+0x230) /*!< Endpoint L max packet size register */ - #define REG_USBD_EPLTXCNT (USBD_BA+0x234) /*!< Endpoint L transfer count register */ - #define REG_USBD_EPLCFG (USBD_BA+0x238) /*!< Endpoint L configuration register */ - #define REG_USBD_EPLBUFSTART (USBD_BA+0x23C) /*!< Endpoint L ram start address register */ - #define REG_USBD_EPLBUFEND (USBD_BA+0x240) /*!< Endpoint L ram end address register */ - #define REG_USBD_DMAADDR (USBD_BA+0x700) /*!< AHB_DMA address register */ - #define REG_USBD_PHYCTL (USBD_BA+0x704) /*!< USB PHY control register */ - - /**@}*/ /* end of USBD register group */ - - - /*---------------------- LCD Display Interface Controller -------------------------*/ - /** - @addtogroup LCM LCD Display Interface Controller(LCM) - Memory Mapped Structure for LCM Controller - @{ */ - - #define REG_LCM_DCCS (LCM_BA+0x00) /*!< Display Controller Control/Status Register */ - #define REG_LCM_DEV_CTRL (LCM_BA+0x04) /*!< Display Output Device Control Register */ - #define REG_LCM_MPU_CMD (LCM_BA+0x08) /*!< MPU-Interface LCD Write Command */ - #define REG_LCM_INT_CS (LCM_BA+0x0c) /*!< Interrupt Control/Status Register */ - #define REG_LCM_CRTC_SIZE (LCM_BA+0x10) /*!< CRTC Display Size Control Register */ - #define REG_LCM_CRTC_DEND (LCM_BA+0x14) /*!< CRTC Display Enable End */ - #define REG_LCM_CRTC_HR (LCM_BA+0x18) /*!< CRTC Internal Horizontal Retrace Control Register */ - #define REG_LCM_CRTC_HSYNC (LCM_BA+0x1C) /*!< CRTC Horizontal Sync Control Register */ - #define REG_LCM_CRTC_VR (LCM_BA+0x20) /*!< CRTC Internal Vertical Retrace Control Register */ - #define REG_LCM_VA_BADDR0 (LCM_BA+0x24) /*!< Video Stream Frame Buffer-0 Starting Address */ - #define REG_LCM_VA_BADDR1 (LCM_BA+0x28) /*!< Video Stream Frame Buffer-1 Starting Address */ - #define REG_LCM_VA_FBCTRL (LCM_BA+0x2C) /*!< Video Stream Frame Buffer Control Register */ - #define REG_LCM_VA_SCALE (LCM_BA+0x30) /*!< Video Stream Scaling Control Register */ - #define REG_LCM_VA_WIN (LCM_BA+0x38) /*!< Image Stream Active Window Coordinates */ - #define REG_LCM_VA_STUFF (LCM_BA+0x3C) /*!< Image Stream Stuff Pixel */ - #define REG_LCM_OSD_WINS (LCM_BA+0x40) /*!< OSD Window Starting Coordinates */ - #define REG_LCM_OSD_WINE (LCM_BA+0x44) /*!< OSD Window Ending Coordinates */ - #define REG_LCM_OSD_BADDR (LCM_BA+0x48) /*!< OSD Stream Frame Buffer Starting Address */ - #define REG_LCM_OSD_FBCTRL (LCM_BA+0x4c) /*!< OSD Stream Frame Buffer Control Register */ - #define REG_LCM_OSD_OVERLAY (LCM_BA+0x50) /*!< OSD Overlay Control Register */ - #define REG_LCM_OSD_CKEY (LCM_BA+0x54) /*!< OSD Overlay Color-Key Pattern Register */ - #define REG_LCM_OSD_CMASK (LCM_BA+0x58) /*!< OSD Overlay Color-Key Mask Register */ - #define REG_LCM_OSD_SKIP1 (LCM_BA+0x5C) /*!< OSD Window Skip1 Register */ - #define REG_LCM_OSD_SKIP2 (LCM_BA+0x60) /*!< OSD Window Skip2 Register */ - #define REG_LCM_OSD_SCALE (LCM_BA+0x64) /*!< OSD horizontal up scaling control register */ - #define REG_LCM_MPU_VSYNC (LCM_BA+0x68) /*!< MPU Vsync control register */ - #define REG_LCM_HC_CTRL (LCM_BA+0x6C) /*!< Hardware cursor control Register */ - #define REG_LCM_HC_POS (LCM_BA+0x70) /*!< Hardware cursot tip point potison on va picture */ - #define REG_LCM_HC_WBCTRL (LCM_BA+0x74) /*!< Hardware Cursor Window Buffer Control Register */ - #define REG_LCM_HC_BADDR (LCM_BA+0x78) /*!< Hardware cursor memory base address register */ - #define REG_LCM_HC_COLOR0 (LCM_BA+0x7C) /*!< Hardware cursor color ram register mapped to bpp = 0 */ - #define REG_LCM_HC_COLOR1 (LCM_BA+0x80) /*!< Hardware cursor color ram register mapped to bpp = 1 */ - #define REG_LCM_HC_COLOR2 (LCM_BA+0x84) /*!< Hardware cursor color ram register mapped to bpp = 2 */ - #define REG_LCM_HC_COLOR3 (LCM_BA+0x88) /*!< Hardware cursor color ram register mapped to bpp = 3 */ - - /**@}*/ /* end of LCM register group */ - - - /*---------------------- I2S Interface Controller -------------------------*/ - /** - @addtogroup I2S I2S Interface Controller(I2S) - Memory Mapped Structure for I2S Controller - @{ */ - - #define REG_ACTL_CON (ACTL_BA+0x00) /*!< Audio controller control register */ - #define REG_ACTL_RESET (ACTL_BA+0x04) /*!< Sub block reset control register */ - #define REG_ACTL_RDESB (ACTL_BA+0x08) /*!< DMA destination base address register for record */ - #define REG_ACTL_RDES_LENGTH (ACTL_BA+0x0C) /*!< DMA destination length register for record */ - #define REG_ACTL_RDESC (ACTL_BA+0x10) /*!< DMA destination current address for record */ - #define REG_ACTL_PDESB (ACTL_BA+0x14) /*!< DMA destination current address for play */ - #define REG_ACTL_PDES_LENGTH (ACTL_BA+0x18) /*!< DMA destination length register for play */ - #define REG_ACTL_PDESC (ACTL_BA+0x1C) /*!< DMA destination current address register for play */ - #define REG_ACTL_RSR (ACTL_BA+0x20) /*!< Record status register */ - #define REG_ACTL_PSR (ACTL_BA+0x24) /*!< Play status register */ - #define REG_ACTL_I2SCON (ACTL_BA+0x28) /*!< I2S control register */ - #define REG_ACTL_COUNTER (ACTL_BA+0x2C) /*!< DMA count down values */ - #define REG_ACTL_PCMCON (ACTL_BA+0x30) /*!< PCM interface control register */ - #define REG_ACTL_PCMS1ST (ACTL_BA+0x34) /*!< PCM interface slot1 start register */ - #define REG_ACTL_PCMS2ST (ACTL_BA+0x38) /*!< PCM interface slot2 start register */ - #define REG_ACTL_RDESB2 (ACTL_BA+0x40) /*!< DMA destination base address register for record right channel */ - #define REG_ACTL_PDESB2 (ACTL_BA+0x44) /*!< DMA destination base address register for play right channel */ - - /**@}*/ /* end of I2S register group */ - - /*---------------------- 2D Graphic Engine -------------------------*/ - /** - @addtogroup GE2D 2D Graphic Engine(GE2D) - Memory Mapped Structure for GE2D Controller - @{ */ - - #define REG_GE2D_TRG (GE_BA+0x00) /*!< Graphic Engine Trigger Control Register */ - #define REG_GE2D_XYSORG (GE_BA+0x04) /*!< Graphic Engine XY Mode Source Origin Starting Register */ - #define REG_GE2D_TCNTVHSF (GE_BA+0x08) /*!< Graphic Engine Tile Width/Height or V/H Scale Factor N/M */ - #define REG_GE2D_XYRRP (GE_BA+0x0C) /*!< Graphic Engine Rotate Reference Point XY Address */ - #define REG_GE2D_INTSTS (GE_BA+0x10) /*!< Graphic Engine Interrupt Status Register */ - #define REG_GE2D_PATSA (GE_BA+0x14) /*!< Graphic Engine Pattern Location Starting Address Register */ - #define REG_GE2D_BETSC (GE_BA+0x18) /*!< GE Bresenham Error Term Stepping Constant Register */ - #define REG_GE2D_BIEPC (GE_BA+0x1C) /*!< GE Bresenham Initial Error, Pixel Count Major M Register */ - #define REG_GE2D_CTL (GE_BA+0x20) /*!< Graphic Engine Control Register */ - #define REG_GE2D_BGCOLR (GE_BA+0x24) /*!< Graphic Engine Background Color Register */ - #define REG_GE2D_FGCOLR (GE_BA+0x28) /*!< Graphic Engine Foreground Color Register */ - #define REG_GE2D_TRNSCOLR (GE_BA+0x2C) /*!< Graphic Engine Transparency Color Register */ - #define REG_GE2D_TCMSK (GE_BA+0x30) /*!< Graphic Engine Transparency Color Mask Register */ - #define REG_GE2D_XYDORG (GE_BA+0x34) /*!< Graphic Engine XY Mode Display Origin Starting Register */ - #define REG_GE2D_SDPITCH (GE_BA+0x38) /*!< Graphic Engine Source/Destination Pitch Register */ - #define REG_GE2D_SRCSPA (GE_BA+0x3C) /*!< Graphic Engine Source Start XY/Linear Address Register */ - #define REG_GE2D_DSTSPA (GE_BA+0x40) /*!< Graphic Engine Destination Start XY/Linear Register */ - #define REG_GE2D_RTGLSZ (GE_BA+0x44) /*!< Graphic Engine Dimension XY/Linear Register */ - #define REG_GE2D_CLPBTL (GE_BA+0x48) /*!< Graphic Engine Clipping Boundary Top/Left Register */ - #define REG_GE2D_CLPBBR (GE_BA+0x4C) /*!< Graphic Engine Clipping Boundary Bottom/Right Register */ - #define REG_GE2D_PTNA (GE_BA+0x50) /*!< Graphic Engine Pattern A Register */ - #define REG_GE2D_PTNB (GE_BA+0x54) /*!< Graphic Engine Pattern B Register */ - #define REG_GE2D_WRPLNMSK (GE_BA+0x58) /*!< Graphic Engine Write Plane Mask Register */ - #define REG_GE2D_MISCTL (GE_BA+0x5C) /*!< Graphic Engine Miscellaneous Control Register */ - #define REG_GE2D_GEHBDW0 (GE_BA+0x60) /*!< Graphic Engine HostBLT data Port 0 Register */ - #define REG_GE2D_GEHBDW1 (GE_BA+0x64) /*!< Graphic Engine HostBLT data Port 1 Register */ - #define REG_GE2D_GEHBDW2 (GE_BA+0x68) /*!< Graphic Engine HostBLT data Port 2 Register */ - #define REG_GE2D_GEHBDW3 (GE_BA+0x6C) /*!< Graphic Engine HostBLT data Port 3 Register */ - #define REG_GE2D_GEHBDW4 (GE_BA+0x70) /*!< Graphic Engine HostBLT data Port 4 Register */ - #define REG_GE2D_GEHBDW5 (GE_BA+0x74) /*!< Graphic Engine HostBLT data Port 5 Register */ - #define REG_GE2D_GEHBDW6 (GE_BA+0x78) /*!< Graphic Engine HostBLT data Port 6 Register */ - #define REG_GE2D_GEHBDW7 (GE_BA+0x7C) /*!< Graphic Engine HostBLT data Port 7 Register */ - - /**@}*/ /* end of GE2D register group */ - - /*---------------------- Flash Memory Interface -------------------------*/ - /** - @addtogroup FMI Flash Memory Interface(FMI) - Memory Mapped Structure for FMI Controller - @{ */ - - /* DMAC Control Registers*/ - #define REG_FMI_BUFFER (FMI_BA+0x000) /*!< FMI Embedded Buffer Word */ - #define REG_FMI_DMACTL (FMI_BA+0x400) /*!< FMI DMA Control Register */ - #define REG_FMI_DMASA (FMI_BA+0x408) /*!< FMI DMA Transfer Starting Address Register */ - #define REG_FMI_DMABCNT (FMI_BA+0x40C) /*!< FMI DMA Transfer Byte Count Register */ - #define REG_FMI_DMAINTEN (FMI_BA+0x410) /*!< FMI DMA Interrupt Enable Register */ - #define REG_FMI_DMAINTSTS (FMI_BA+0x414) /*!< FMI DMA Interrupt Status Register */ - - #define REG_FMI_CTL (FMI_BA+0x800) /*!< Global Control and Status Register */ - #define REG_FMI_INTEN (FMI_BA+0x804) /*!< Global Interrupt Control Register */ - #define REG_FMI_INTSTS (FMI_BA+0x808) /*!< Global Interrupt Status Register */ - - /* eMMC Registers */ - #define REG_FMI_EMMCCTL (FMI_BA+0x820) /*!< eMMC control and status register */ - #define REG_FMI_EMMCCMD (FMI_BA+0x824) /*!< eMMC command argument register */ - #define REG_FMI_EMMCINTEN (FMI_BA+0x828) /*!< eMMC interrupt enable register */ - #define REG_FMI_EMMCINTSTS (FMI_BA+0x82C) /*!< eMMC interrupt status register */ - #define REG_FMI_EMMCRESP0 (FMI_BA+0x830) /*!< eMMC receive response token register 0 */ - #define REG_FMI_EMMCRESP1 (FMI_BA+0x834) /*!< eMMC receive response token register 1 */ - #define REG_FMI_EMMCBLEN (FMI_BA+0x838) /*!< eMMC block length register */ - #define REG_FMI_EMMCTOUT (FMI_BA+0x83C) /*!< eMMC block length register */ - - /* NAND-type Flash Registers */ - #define REG_NANDCTL (FMI_BA+0x8A0) /*!< NAND Flash Control and Status Register */ - #define REG_NANDTMCTL (FMI_BA+0x8A4) /*!< NAND Flash Timing Control Register */ - #define REG_NANDINTEN (FMI_BA+0x8A8) /*!< NAND Flash Interrupt Control Register */ - #define REG_NANDINTSTS (FMI_BA+0x8AC) /*!< NAND Flash Interrupt Status Register */ - #define REG_NANDCMD (FMI_BA+0x8B0) /*!< NAND Flash Command Port Register */ - #define REG_NANDADDR (FMI_BA+0x8B4) /*!< NAND Flash Address Port Register */ - #define REG_NANDDATA (FMI_BA+0x8B8) /*!< NAND Flash Data Port Register */ - #define REG_NANDRACTL (FMI_BA+0x8BC) /*!< NAND Flash Redundant Area Control Register */ - #define REG_NANDECTL (FMI_BA+0x8C0) /*!< NAND Flash Extend Control Regsiter */ - #define REG_NANDECCES0 (FMI_BA+0x8D0) /*!< NAND Flash ECC Error Status 0 */ - #define REG_NANDECCES1 (FMI_BA+0x8D4) /*!< NAND Flash ECC Error Status 1 */ - #define REG_NANDECCES2 (FMI_BA+0x8D8) /*!< NAND Flash ECC Error Status 2 */ - #define REG_NANDECCES3 (FMI_BA+0x8DC) /*!< NAND Flash ECC Error Status 3 */ - #define REG_NANDPROTA0 (FMI_BA+0x8E0) /*!< NAND Flash Protect Region End Address 0 */ - #define REG_NANDPROTA1 (FMI_BA+0x8E4) /*!< NAND Flash Protect Region End Address 1 */ - - /* NAND-type Flash BCH Error Address Registers */ - #define REG_NANDECCEA0 (FMI_BA+0x900) /*!< NAND Flash ECC Error Byte Address 0 */ - #define REG_NANDECCEA1 (FMI_BA+0x904) /*!< NAND Flash ECC Error Byte Address 1 */ - #define REG_NANDECCEA2 (FMI_BA+0x908) /*!< NAND Flash ECC Error Byte Address 2 */ - #define REG_NANDECCEA3 (FMI_BA+0x90C) /*!< NAND Flash ECC Error Byte Address 3 */ - #define REG_NANDECCEA4 (FMI_BA+0x910) /*!< NAND Flash ECC Error Byte Address 4 */ - #define REG_NANDECCEA5 (FMI_BA+0x914) /*!< NAND Flash ECC Error Byte Address 5 */ - #define REG_NANDECCEA6 (FMI_BA+0x918) /*!< NAND Flash ECC Error Byte Address 6 */ - #define REG_NANDECCEA7 (FMI_BA+0x91C) /*!< NAND Flash ECC Error Byte Address 7 */ - #define REG_NANDECCEA8 (FMI_BA+0x920) /*!< NAND Flash ECC Error Byte Address 8 */ - #define REG_NANDECCEA9 (FMI_BA+0x924) /*!< NAND Flash ECC Error Byte Address 9 */ - #define REG_NANDECCEA10 (FMI_BA+0x928) /*!< NAND Flash ECC Error Byte Address 10 */ - #define REG_NANDECCEA11 (FMI_BA+0x92C) /*!< NAND Flash ECC Error Byte Address 11 */ - - /* NAND-type Flash BCH Error Data Registers */ - #define REG_NANDECCED0 (FMI_BA+0x960) /*!< NAND Flash ECC Error Data Register 0 */ - #define REG_NANDECCED1 (FMI_BA+0x964) /*!< NAND Flash ECC Error Data Register 1 */ - #define REG_NANDECCED2 (FMI_BA+0x968) /*!< NAND Flash ECC Error Data Register 2 */ - #define REG_NANDECCED3 (FMI_BA+0x96C) /*!< NAND Flash ECC Error Data Register 3 */ - #define REG_NANDECCED4 (FMI_BA+0x970) /*!< NAND Flash ECC Error Data Register 4 */ - #define REG_NANDECCED5 (FMI_BA+0x974) /*!< NAND Flash ECC Error Data Register 5 */ - - /* NAND-type Flash Redundant Area Registers */ - #define REG_NANDRA0 (FMI_BA+0xA00) /*!< NAND Flash Redundant Area Register */ - #define REG_NANDRA1 (FMI_BA+0xA04) /*!< NAND Flash Redundant Area Register */ - - /**@}*/ /* end of FMI register group */ - - - /*---------------------- SD/SDIO Host Controller -------------------------*/ - /** - @addtogroup SDH SD/SDIO Host Controller(SDH) - Memory Mapped Structure for SDH Controller - @{ */ - - /* DMAC Control Registers*/ - #define REG_SDH_FB0 (SDH_BA+0x000) /*!< SD Host Embedded Buffer Word */ - #define REG_SDH_DMACTL (SDH_BA+0x400) /*!< SD Host DMA Control and Status Register */ - #define REG_SDH_DMASA (SDH_BA+0x408) /*!< SD Host DMA Transfer Starting Address Register */ - #define REG_SDH_DMABCNT (SDH_BA+0x40C) /*!< SD Host DMA Transfer Byte Count Register */ - #define REG_SDH_DMAINTEN (SDH_BA+0x410) /*!< SD Host DMA Interrupt Enable Register */ - #define REG_SDH_DMAINTSTS (SDH_BA+0x414) /*!< SD Host DMA Interrupt Status Register */ - - #define REG_SDH_GCTL (SDH_BA+0x800) /*!< SD Host Global Control and Status Register */ - #define REG_SDH_GINTEN (SDH_BA+0x804) /*!< SD Host Global Interrupt Control Register */ - #define REG_SDH_GINTSTS (SDH_BA+0x808) /*!< SD Host Global Interrupt Status Register */ - - /* Secure Digit Registers */ - #define REG_SDH_CTL (SDH_BA+0x820) /*!< SD Host control and status register */ - #define REG_SDH_CMD (SDH_BA+0x824) /*!< SD Host command argument register */ - #define REG_SDH_INTEN (SDH_BA+0x828) /*!< SD Host interrupt enable register */ - #define REG_SDH_INTSTS (SDH_BA+0x82C) /*!< SD Host interrupt status register */ - #define REG_SDH_RESP0 (SDH_BA+0x830) /*!< SD Host receive response token register 0 */ - #define REG_SDH_RESP1 (SDH_BA+0x834) /*!< SD Host receive response token register 1 */ - #define REG_SDH_BLEN (SDH_BA+0x838) /*!< SD Host block length register */ - #define REG_SDH_TMOUT (SDH_BA+0x83C) /*!< SD Host Response/Data-in Time-out register */ - #define REG_SDH_ECTL (SDH_BA+0x840) /*!< SD Host Extend Control Register */ - - /**@}*/ /* end of SDH register group */ - - - /*---------------------- Cryptographic Accelerator -------------------------*/ - /** - @addtogroup CRYPTO Cryptographic Accelerator(CRYPTO) - Memory Mapped Structure for Cryptographic Accelerator registers - @{ */ - - /* Crypto Control Registers */ - #define CRPT_INTEN (CRPT_BA+0x000) /*!< Crypto Interrupt Enable Control Register */ - #define CRPT_INTSTS (CRPT_BA+0x004) /*!< Crypto Interrupt Flag */ - - /* PRNG Registers */ - #define CRPT_PRNG_CTL (CRPT_BA+0x008) /*!< PRNG Control Register */ - #define CRPT_PRNG_SEED (CRPT_BA+0x00C) /*!< Seed for PRNG */ - #define CRPT_PRNG_KEY0 (CRPT_BA+0x010) /*!< PRNG Generated Key 0 */ - #define CRPT_PRNG_KEY1 (CRPT_BA+0x014) /*!< PRNG Generated Key 1 */ - #define CRPT_PRNG_KEY2 (CRPT_BA+0x018) /*!< PRNG Generated Key 2 */ - #define CRPT_PRNG_KEY3 (CRPT_BA+0x01C) /*!< PRNG Generated Key 3 */ - #define CRPT_PRNG_KEY4 (CRPT_BA+0x020) /*!< PRNG Generated Key 4 */ - #define CRPT_PRNG_KEY5 (CRPT_BA+0x024) /*!< PRNG Generated Key 5 */ - #define CRPT_PRNG_KEY6 (CRPT_BA+0x028) /*!< PRNG Generated Key 6 */ - #define CRPT_PRNG_KEY7 (CRPT_BA+0x02C) /*!< PRNG Generated Key 7 */ - - /* AES/TDES feedback Registers */ - #define CRPT_AES_FDBCK0 (CRPT_BA+0x050) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_AES_FDBCK1 (CRPT_BA+0x054) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_AES_FDBCK2 (CRPT_BA+0x058) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_AES_FDBCK3 (CRPT_BA+0x05C) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_TDES_FDBCKH (CRPT_BA+0x060) /*!< TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation */ - #define CRPT_TDES_FDBCKL (CRPT_BA+0x064) /*!< TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation */ - - /* AES Control Registers */ - #define CRPT_AES_CTL (CRPT_BA+0x100) /*!< AES Control Register */ - #define CRPT_AES_STS (CRPT_BA+0x104) /*!< AES Engine Flag */ - #define CRPT_AES_DATIN (CRPT_BA+0x108) /*!< AES Engine Data Input Port Register */ - #define CRPT_AES_DATOUT (CRPT_BA+0x10C) /*!< AES Engine Data Output Port Register */ - #define CRPT_AES0_KEY0 (CRPT_BA+0x110) /*!< AES Key Word 0 Register for Channel 0 */ - #define CRPT_AES0_KEY1 (CRPT_BA+0x114) /*!< AES Key Word 1 Register for Channel 0 */ - #define CRPT_AES0_KEY2 (CRPT_BA+0x118) /*!< AES Key Word 2 Register for Channel 0 */ - #define CRPT_AES0_KEY3 (CRPT_BA+0x11C) /*!< AES Key Word 3 Register for Channel 0 */ - #define CRPT_AES0_KEY4 (CRPT_BA+0x120) /*!< AES Key Word 4 Register for Channel 0 */ - #define CRPT_AES0_KEY5 (CRPT_BA+0x124) /*!< AES Key Word 5 Register for Channel 0 */ - #define CRPT_AES0_KEY6 (CRPT_BA+0x128) /*!< AES Key Word 6 Register for Channel 0 */ - #define CRPT_AES0_KEY7 (CRPT_BA+0x12C) /*!< AES Key Word 7 Register for Channel 0 */ - #define CRPT_AES0_IV0 (CRPT_BA+0x130) /*!< AES Initial Vector Word 0 Register for Channel 0 */ - #define CRPT_AES0_IV1 (CRPT_BA+0x134) /*!< AES Initial Vector Word 1 Register for Channel 0 */ - #define CRPT_AES0_IV2 (CRPT_BA+0x138) /*!< AES Initial Vector Word 2 Register for Channel 0 */ - #define CRPT_AES0_IV3 (CRPT_BA+0x13C) /*!< AES Initial Vector Word 3 Register for Channel 0 */ - #define CRPT_AES0_SADDR (CRPT_BA+0x140) /*!< AES DMA Source Address Register for Channel 0 */ - #define CRPT_AES0_DADDR (CRPT_BA+0x144) /*!< AES DMA Destination Address Register for Channel 0 */ - #define CRPT_AES0_CNT (CRPT_BA+0x148) /*!< AES Byte Count Register for Channel 0 */ - #define CRPT_AES1_KEY0 (CRPT_BA+0x14C) /*!< AES Key Word 0 Register for Channel 1 */ - #define CRPT_AES1_KEY1 (CRPT_BA+0x150) /*!< AES Key Word 1 Register for Channel 1 */ - #define CRPT_AES1_KEY2 (CRPT_BA+0x154) /*!< AES Key Word 2 Register for Channel 1 */ - #define CRPT_AES1_KEY3 (CRPT_BA+0x158) /*!< AES Key Word 3 Register for Channel 1 */ - #define CRPT_AES1_KEY4 (CRPT_BA+0x15C) /*!< AES Key Word 4 Register for Channel 1 */ - #define CRPT_AES1_KEY5 (CRPT_BA+0x160) /*!< AES Key Word 5 Register for Channel 1 */ - #define CRPT_AES1_KEY6 (CRPT_BA+0x164) /*!< AES Key Word 6 Register for Channel 1 */ - #define CRPT_AES1_KEY7 (CRPT_BA+0x168) /*!< AES Key Word 7 Register for Channel 1 */ - #define CRPT_AES1_IV0 (CRPT_BA+0x16C) /*!< AES Initial Vector Word 0 Register for Channel 1 */ - #define CRPT_AES1_IV1 (CRPT_BA+0x170) /*!< AES Initial Vector Word 1 Register for Channel 1 */ - #define CRPT_AES1_IV2 (CRPT_BA+0x174) /*!< AES Initial Vector Word 2 Register for Channel 1 */ - #define CRPT_AES1_IV3 (CRPT_BA+0x178) /*!< AES Initial Vector Word 3 Register for Channel 1 */ - #define CRPT_AES1_SADDR (CRPT_BA+0x17C) /*!< AES DMA Source Address Register for Channel 1 */ - #define CRPT_AES1_DADDR (CRPT_BA+0x180) /*!< AES DMA Destination Address Register for Channel 1 */ - #define CRPT_AES1_CNT (CRPT_BA+0x184) /*!< AES Byte Count Register for Channel 1 */ - #define CRPT_AES2_KEY0 (CRPT_BA+0x188) /*!< AES Key Word 0 Register for Channel 2 */ - #define CRPT_AES2_KEY1 (CRPT_BA+0x18C) /*!< AES Key Word 1 Register for Channel 2 */ - #define CRPT_AES2_KEY2 (CRPT_BA+0x190) /*!< AES Key Word 2 Register for Channel 2 */ - #define CRPT_AES2_KEY3 (CRPT_BA+0x194) /*!< AES Key Word 3 Register for Channel 2 */ - #define CRPT_AES2_KEY4 (CRPT_BA+0x198) /*!< AES Key Word 4 Register for Channel 2 */ - #define CRPT_AES2_KEY5 (CRPT_BA+0x19C) /*!< AES Key Word 5 Register for Channel 2 */ - #define CRPT_AES2_KEY6 (CRPT_BA+0x1A0) /*!< AES Key Word 6 Register for Channel 2 */ - #define CRPT_AES2_KEY7 (CRPT_BA+0x1A4) /*!< AES Key Word 7 Register for Channel 2 */ - #define CRPT_AES2_IV0 (CRPT_BA+0x1A8) /*!< AES Initial Vector Word 0 Register for Channel 2 */ - #define CRPT_AES2_IV1 (CRPT_BA+0x1AC) /*!< AES Initial Vector Word 1 Register for Channel 2 */ - #define CRPT_AES2_IV2 (CRPT_BA+0x1B0) /*!< AES Initial Vector Word 2 Register for Channel 2 */ - #define CRPT_AES2_IV3 (CRPT_BA+0x1B4) /*!< AES Initial Vector Word 3 Register for Channel 2 */ - #define CRPT_AES2_SADDR (CRPT_BA+0x1B8) /*!< AES DMA Source Address Register for Channel 2 */ - #define CRPT_AES2_DADDR (CRPT_BA+0x1BC) /*!< AES DMA Destination Address Register for Channel 2 */ - #define CRPT_AES2_CNT (CRPT_BA+0x1C0) /*!< AES Byte Count Register for Channel 2 */ - #define CRPT_AES3_KEY0 (CRPT_BA+0x1C4) /*!< AES Key Word 0 Register for Channel 3 */ - #define CRPT_AES3_KEY1 (CRPT_BA+0x1C8) /*!< AES Key Word 1 Register for Channel 3 */ - #define CRPT_AES3_KEY2 (CRPT_BA+0x1CC) /*!< AES Key Word 2 Register for Channel 3 */ - #define CRPT_AES3_KEY3 (CRPT_BA+0x1D0) /*!< AES Key Word 3 Register for Channel 3 */ - #define CRPT_AES3_KEY4 (CRPT_BA+0x1D4) /*!< AES Key Word 4 Register for Channel 3 */ - #define CRPT_AES3_KEY5 (CRPT_BA+0x1D8) /*!< AES Key Word 5 Register for Channel 3 */ - #define CRPT_AES3_KEY6 (CRPT_BA+0x1DC) /*!< AES Key Word 6 Register for Channel 3 */ - #define CRPT_AES3_KEY7 (CRPT_BA+0x1E0) /*!< AES Key Word 7 Register for Channel 3 */ - #define CRPT_AES3_IV0 (CRPT_BA+0x1E4) /*!< AES Initial Vector Word 0 Register for Channel 3 */ - #define CRPT_AES3_IV1 (CRPT_BA+0x1E8) /*!< AES Initial Vector Word 1 Register for Channel 3 */ - #define CRPT_AES3_IV2 (CRPT_BA+0x1EC) /*!< AES Initial Vector Word 2 Register for Channel 3 */ - #define CRPT_AES3_IV3 (CRPT_BA+0x1F0) /*!< AES Initial Vector Word 3 Register for Channel 3 */ - #define CRPT_AES3_SADDR (CRPT_BA+0x1F4) /*!< AES DMA Source Address Register for Channel 3 */ - #define CRPT_AES3_DADDR (CRPT_BA+0x1F8) /*!< AES DMA Destination Address Register for Channel 3 */ - #define CRPT_AES3_CNT (CRPT_BA+0x1FC) /*!< AES Byte Count Register for Channel 3 */ - - /* DES/TDES Control Registers */ - #define CRPT_TDES_CTL (CRPT_BA+0x200) /*!< TDES/DES Control Register */ - #define CRPT_TDES_STS (CRPT_BA+0x204) /*!< TDES/DES Engine Flag */ - #define CRPT_TDES0_KEY1H (CRPT_BA+0x208) /*!< TDES/DES Key 1 High Word Register for Channel 0 */ - #define CRPT_TDES0_KEY1L (CRPT_BA+0x20C) /*!< TDES/DES Key 1 Low Word Register for Channel 0 */ - #define CRPT_TDES0_KEY2H (CRPT_BA+0x210) /*!< TDES/DES Key 2 High Word Register for Channel 0 */ - #define CRPT_TDES0_KEY2L (CRPT_BA+0x214) /*!< TDES/DES Key 2 Low Word Register for Channel 0 */ - #define CRPT_TDES0_KEY3H (CRPT_BA+0x218) /*!< TDES/DES Key 3 High Word Register for Channel 0 */ - #define CRPT_TDES0_KEY3L (CRPT_BA+0x21C) /*!< TDES/DES Key 3 Low Word Register for Channel 0 */ - #define CRPT_TDES0_IVH (CRPT_BA+0x220) /*!< TDES/DES Initial Vector High Word Register for Channel 0 */ - #define CRPT_TDES0_IVL (CRPT_BA+0x224) /*!< TDES/DES Initial Vector Low Word Register for Channel 0 */ - #define CRPT_TDES0_SADDR (CRPT_BA+0x228) /*!< TDES/DES DMA Source Address Register for Channel 0 */ - #define CRPT_TDES0_DADDR (CRPT_BA+0x22C) /*!< TDES/DES DMA Destination Address Register for Channel 0 */ - #define CRPT_TDES0_CNT (CRPT_BA+0x230) /*!< TDES/DES Byte Count Register for Channel 0 */ - #define CRPT_TDES_DATIN (CRPT_BA+0x234) /*!< TDES/DES Engine Input data Word Register */ - #define CRPT_TDES_DATOUT (CRPT_BA+0x238) /*!< TDES/DES Engine Output data Word Register */ - #define CRPT_TDES1_KEY1H (CRPT_BA+0x248) /*!< TDES/DES Key 1 High Word Register for Channel 1 */ - #define CRPT_TDES1_KEY1L (CRPT_BA+0x24C) /*!< TDES/DES Key 1 Low Word Register for Channel 1 */ - #define CRPT_TDES1_KEY2H (CRPT_BA+0x250) /*!< TDES/DES Key 2 High Word Register for Channel 1 */ - #define CRPT_TDES1_KEY2L (CRPT_BA+0x254) /*!< TDES/DES Key 2 Low Word Register for Channel 1 */ - #define CRPT_TDES1_KEY3H (CRPT_BA+0x258) /*!< TDES/DES Key 3 High Word Register for Channel 1 */ - #define CRPT_TDES1_KEY3L (CRPT_BA+0x25C) /*!< TDES/DES Key 3 Low Word Register for Channel 1 */ - #define CRPT_TDES1_IVH (CRPT_BA+0x260) /*!< TDES/DES Initial Vector High Word Register for Channel 1 */ - #define CRPT_TDES1_IVL (CRPT_BA+0x264) /*!< TDES/DES Initial Vector Low Word Register for Channel 1 */ - #define CRPT_TDES1_SADDR (CRPT_BA+0x268) /*!< TDES/DES DMA Source Address Register for Channel 1 */ - #define CRPT_TDES1_DADDR (CRPT_BA+0x26C) /*!< TDES/DES DMA Destination Address Register for Channel 1 */ - #define CRPT_TDES1_CNT (CRPT_BA+0x270) /*!< TDES/DES Byte Count Register for Channel 1 */ - #define CRPT_TDES2_KEY1H (CRPT_BA+0x288) /*!< TDES/DES Key 1 High Word Register for Channel 2 */ - #define CRPT_TDES2_KEY1L (CRPT_BA+0x28C) /*!< TDES/DES Key 1 Low Word Register for Channel 2 */ - #define CRPT_TDES2_KEY2H (CRPT_BA+0x290) /*!< TDES/DES Key 2 High Word Register for Channel 2 */ - #define CRPT_TDES2_KEY2L (CRPT_BA+0x294) /*!< TDES/DES Key 2 Low Word Register for Channel 2 */ - #define CRPT_TDES2_KEY3H (CRPT_BA+0x298) /*!< TDES/DES Key 3 High Word Register for Channel 2 */ - #define CRPT_TDES2_KEY3L (CRPT_BA+0x29C) /*!< TDES/DES Key 3 Low Word Register for Channel 2 */ - #define CRPT_TDES2_IVH (CRPT_BA+0x2A0) /*!< TDES/DES Initial Vector High Word Register for Channel 2 */ - #define CRPT_TDES2_IVL (CRPT_BA+0x2A4) /*!< TDES/DES Initial Vector Low Word Register for Channel 2 */ - #define CRPT_TDES2_SADDR (CRPT_BA+0x2A8) /*!< TDES/DES DMA Source Address Register for Channel 2 */ - #define CRPT_TDES2_DADDR (CRPT_BA+0x2AC) /*!< TDES/DES DMA Destination Address Register for Channel 2 */ - #define CRPT_TDES2_CNT (CRPT_BA+0x2B0) /*!< TDES/DES Byte Count Register for Channel 3 */ - #define CRPT_TDES3_KEY1H (CRPT_BA+0x2C8) /*!< TDES/DES Key 1 High Word Register for Channel 3 */ - #define CRPT_TDES3_KEY1L (CRPT_BA+0x2CC) /*!< TDES/DES Key 1 Low Word Register for Channel 3 */ - #define CRPT_TDES3_KEY2H (CRPT_BA+0x2D0) /*!< TDES/DES Key 2 High Word Register for Channel 3 */ - #define CRPT_TDES3_KEY2L (CRPT_BA+0x2D4) /*!< TDES/DES Key 2 Low Word Register for Channel 3 */ - #define CRPT_TDES3_KEY3H (CRPT_BA+0x2D8) /*!< TDES/DES Key 3 High Word Register for Channel 3 */ - #define CRPT_TDES3_KEY3L (CRPT_BA+0x2DC) /*!< TDES/DES Key 3 Low Word Register for Channel 3 */ - #define CRPT_TDES3_IVH (CRPT_BA+0x2E0) /*!< TDES/DES Initial Vector High Word Register for Channel 3 */ - #define CRPT_TDES3_IVL (CRPT_BA+0x2E4) /*!< TDES/DES Initial Vector Low Word Register for Channel 3 */ - #define CRPT_TDES3_SADDR (CRPT_BA+0x2E8) /*!< TDES/DES DMA Source Address Register for Channel 3 */ - #define CRPT_TDES3_DADDR (CRPT_BA+0x2EC) /*!< TDES/DES DMA Destination Address Register for Channel 3 */ - #define CRPT_TDES3_CNT (CRPT_BA+0x2F0) /*!< TDES/DES Byte Count Register for Channel 3 */ - - /* SHA/HMAC Control Registers */ - #define CRPT_HMAC_CTL (CRPT_BA+0x300) /*!< SHA/HMAC Control Register */ - #define CRPT_HMAC_STS (CRPT_BA+0x304) /*!< SHA/HMAC Status Flag */ - #define CRPT_HMAC_DGST0 (CRPT_BA+0x308) /*!< SHA/HMAC Digest Message 0 */ - #define CRPT_HMAC_DGST1 (CRPT_BA+0x30C) /*!< SHA/HMAC Digest Message 1 */ - #define CRPT_HMAC_DGST2 (CRPT_BA+0x310) /*!< SHA/HMAC Digest Message 2 */ - #define CRPT_HMAC_DGST3 (CRPT_BA+0x314) /*!< SHA/HMAC Digest Message 3 */ - #define CRPT_HMAC_DGST4 (CRPT_BA+0x318) /*!< SHA/HMAC Digest Message 4 */ - #define CRPT_HMAC_DGST5 (CRPT_BA+0x31C) /*!< SHA/HMAC Digest Message 5 */ - #define CRPT_HMAC_DGST6 (CRPT_BA+0x320) /*!< SHA/HMAC Digest Message 6 */ - #define CRPT_HMAC_DGST7 (CRPT_BA+0x324) /*!< SHA/HMAC Digest Message 7 */ - #define CRPT_HMAC_DGST8 (CRPT_BA+0x328) /*!< SHA/HMAC Digest Message 8 */ - #define CRPT_HMAC_DGST9 (CRPT_BA+0x32C) /*!< SHA/HMAC Digest Message 8 */ - #define CRPT_HMAC_DGST10 (CRPT_BA+0x330) /*!< SHA/HMAC Digest Message 10 */ - #define CRPT_HMAC_DGST11 (CRPT_BA+0x334) /*!< SHA/HMAC Digest Message 11 */ - #define CRPT_HMAC_DGST12 (CRPT_BA+0x338) /*!< SHA/HMAC Digest Message 12 */ - #define CRPT_HMAC_DGST13 (CRPT_BA+0x33C) /*!< SHA/HMAC Digest Message 13 */ - #define CRPT_HMAC_DGST14 (CRPT_BA+0x340) /*!< SHA/HMAC Digest Message 14 */ - #define CRPT_HMAC_DGST15 (CRPT_BA+0x344) /*!< SHA/HMAC Digest Message 15 */ - #define CRPT_HMAC_KEYCNT (CRPT_BA+0x348) /*!< SHA/HMAC Key Byte Count */ - #define CRPT_HMAC_SADDR (CRPT_BA+0x34C) /*!< SHA/HMAC Key Byte Count */ - #define CRPT_HMAC_DMACNT (CRPT_BA+0x350) /*!< SHA/HMAC Byte Count Register */ - #define CRPT_HMAC_DATIN (CRPT_BA+0x354) /*!< SHA/HMAC Engine Non-DMA Mode Data Input Port Register */ - - /**@}*/ /* end of Cryptographic Accelerator register group */ - - - - - /*---------------------- Universal Asynchronous Receiver/Transmitter Controller -------------------------*/ - /** - @addtogroup UART Universal Asynchronous Receiver/Transmitter Controller(UART) - Memory Mapped Structure for UART Controller - @{ */ - - #define REG_UART0_RBR (UART0_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART0_THR (UART0_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART0_IER (UART0_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART0_FCR (UART0_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART0_LCR (UART0_BA+0x0C) /*!< Line Control Register */ - #define REG_UART0_MCR (UART0_BA+0x10) /*!< Modem Control Register */ - #define REG_UART0_MSR (UART0_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART0_FSR (UART0_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART0_ISR (UART0_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART0_TOR (UART0_BA+0x20) /*!< Time-out Register */ - #define REG_UART0_BAUD (UART0_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART0_IRCR (UART0_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART0_ALT_CSR (UART0_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART0_FUN_SEL (UART0_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART0_LIN_CTL (UART0_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART0_LIN_SR (UART0_BA+0x38) /*!< LIN Status Register */ - - - - - /* - UART1 Control Registers - */ - #define REG_UART1_RBR (UART1_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART1_THR (UART1_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART1_IER (UART1_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART1_FCR (UART1_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART1_LCR (UART1_BA+0x0C) /*!< Line Control Register */ - #define REG_UART1_MCR (UART1_BA+0x10) /*!< Modem Control Register */ - #define REG_UART1_MSR (UART1_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART1_FSR (UART1_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART1_ISR (UART1_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART1_TOR (UART1_BA+0x20) /*!< Time-out Register */ - #define REG_UART1_BAUD (UART1_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART1_IRCR (UART1_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART1_ALT_CSR (UART1_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART1_FUN_SEL (UART1_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART1_LIN_CTL (UART1_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART1_LIN_SR (UART1_BA+0x38) /*!< LIN Status Register */ - - /* - UART2 Control Registers - */ - #define REG_UART2_RBR (UART2_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART2_THR (UART2_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART2_IER (UART2_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART2_FCR (UART2_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART2_LCR (UART2_BA+0x0C) /*!< Line Control Register */ - #define REG_UART2_MCR (UART2_BA+0x10) /*!< Modem Control Register */ - #define REG_UART2_MSR (UART2_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART2_FSR (UART2_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART2_ISR (UART2_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART2_TOR (UART2_BA+0x20) /*!< Time-out Register */ - #define REG_UART2_BAUD (UART2_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART2_IRCR (UART2_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART2_ALT_CSR (UART2_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART2_FUN_SEL (UART2_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART2_LIN_CTL (UART2_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART2_LIN_SR (UART2_BA+0x38) /*!< LIN Status Register */ - - /* - UART3 Control Registers - */ - #define REG_UART3_RBR (UART3_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART3_THR (UART3_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART3_IER (UART3_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART3_FCR (UART3_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART3_LCR (UART3_BA+0x0C) /*!< Line Control Register */ - #define REG_UART3_MCR (UART3_BA+0x10) /*!< Modem Control Register */ - #define REG_UART3_MSR (UART3_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART3_FSR (UART3_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART3_ISR (UART3_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART3_TOR (UART3_BA+0x20) /*!< Time-out Register */ - #define REG_UART3_BAUD (UART3_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART3_IRCR (UART3_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART3_ALT_CSR (UART3_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART3_FUN_SEL (UART3_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART3_LIN_CTL (UART3_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART3_LIN_SR (UART3_BA+0x38) /*!< LIN Status Register */ - - - /* - UART4 Control Registers - */ - #define REG_UART4_RBR (UART4_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART4_THR (UART4_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART4_IER (UART4_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART4_FCR (UART4_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART4_LCR (UART4_BA+0x0C) /*!< Line Control Register */ - #define REG_UART4_MCR (UART4_BA+0x10) /*!< Modem Control Register */ - #define REG_UART4_MSR (UART4_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART4_FSR (UART4_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART4_ISR (UART4_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART4_TOR (UART4_BA+0x20) /*!< Time-out Register */ - #define REG_UART4_BAUD (UART4_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART4_IRCR (UART4_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART4_ALT_CSR (UART4_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART4_FUN_SEL (UART4_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART4_LIN_CTL (UART4_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART4_LIN_SR (UART4_BA+0x38) /*!< LIN Status Register */ - - /* - UART5 Control Registers - */ - #define REG_UART5_RBR (UART5_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART5_THR (UART5_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART5_IER (UART5_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART5_FCR (UART5_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART5_LCR (UART5_BA+0x0C) /*!< Line Control Register */ - #define REG_UART5_MCR (UART5_BA+0x10) /*!< Modem Control Register */ - #define REG_UART5_MSR (UART5_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART5_FSR (UART5_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART5_ISR (UART5_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART5_TOR (UART5_BA+0x20) /*!< Time-out Register */ - #define REG_UART5_BAUD (UART5_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART5_IRCR (UART5_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART5_ALT_CSR (UART5_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART5_FUN_SEL (UART5_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART5_LIN_CTL (UART5_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART5_LIN_SR (UART5_BA+0x38) /*!< LIN Status Register */ - - /* - UART6 Control Registers - */ - #define REG_UART6_RBR (UART6_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART6_THR (UART6_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART6_IER (UART6_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART6_FCR (UART6_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART6_LCR (UART6_BA+0x0C) /*!< Line Control Register */ - #define REG_UART6_MCR (UART6_BA+0x10) /*!< Modem Control Register */ - #define REG_UART6_MSR (UART6_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART6_FSR (UART6_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART6_ISR (UART6_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART6_TOR (UART6_BA+0x20) /*!< Time-out Register */ - #define REG_UART6_BAUD (UART6_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART6_IRCR (UART6_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART6_ALT_CSR (UART6_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART6_FUN_SEL (UART6_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART6_LIN_CTL (UART6_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART6_LIN_SR (UART6_BA+0x38) /*!< LIN Status Register */ - - /* - UART7 Control Registers - */ - #define REG_UART7_RBR (UART7_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART7_THR (UART7_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART7_IER (UART7_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART7_FCR (UART7_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART7_LCR (UART7_BA+0x0C) /*!< Line Control Register */ - #define REG_UART7_MCR (UART7_BA+0x10) /*!< Modem Control Register */ - #define REG_UART7_MSR (UART7_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART7_FSR (UART7_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART7_ISR (UART7_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART7_TOR (UART7_BA+0x20) /*!< Time-out Register */ - #define REG_UART7_BAUD (UART7_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART7_IRCR (UART7_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART7_ALT_CSR (UART7_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART7_FUN_SEL (UART7_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART7_LIN_CTL (UART7_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART7_LIN_SR (UART7_BA+0x38) /*!< LIN Status Register */ - - /* - UART8 Control Registers - */ - #define REG_UART8_RBR (UART8_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART8_THR (UART8_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART8_IER (UART8_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART8_FCR (UART8_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART8_LCR (UART8_BA+0x0C) /*!< Line Control Register */ - #define REG_UART8_MCR (UART8_BA+0x10) /*!< Modem Control Register */ - #define REG_UART8_MSR (UART8_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART8_FSR (UART8_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART8_ISR (UART8_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART8_TOR (UART8_BA+0x20) /*!< Time-out Register */ - #define REG_UART8_BAUD (UART8_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART8_IRCR (UART8_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART8_ALT_CSR (UART8_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART8_FUN_SEL (UART8_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART8_LIN_CTL (UART8_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART8_LIN_SR (UART8_BA+0x38) /*!< LIN Status Register */ - - /* - UART9 Control Registers - */ - #define REG_UART9_RBR (UART9_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART9_THR (UART9_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART9_IER (UART9_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART9_FCR (UART9_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART9_LCR (UART9_BA+0x0C) /*!< Line Control Register */ - #define REG_UART9_MCR (UART9_BA+0x10) /*!< Modem Control Register */ - #define REG_UART9_MSR (UART9_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART9_FSR (UART9_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART9_ISR (UART9_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART9_TOR (UART9_BA+0x20) /*!< Time-out Register */ - #define REG_UART9_BAUD (UART9_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART9_IRCR (UART9_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART9_ALT_CSR (UART9_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART9_FUN_SEL (UART9_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART9_LIN_CTL (UART9_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART9_LIN_SR (UART9_BA+0x38) /*!< LIN Status Register */ - - /* - UARTA Control Registers - */ - #define REG_UARTA_RBR (UARTA_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UARTA_THR (UARTA_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UARTA_IER (UARTA_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UARTA_FCR (UARTA_BA+0x08) /*!< FIFO Control Register */ - #define REG_UARTA_LCR (UARTA_BA+0x0C) /*!< Line Control Register */ - #define REG_UARTA_MCR (UARTA_BA+0x10) /*!< Modem Control Register */ - #define REG_UARTA_MSR (UARTA_BA+0x14) /*!< MODEM Status Register */ - #define REG_UARTA_FSR (UARTA_BA+0x18) /*!< FIFO Status Register */ - #define REG_UARTA_ISR (UARTA_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UARTA_TOR (UARTA_BA+0x20) /*!< Time-out Register */ - #define REG_UARTA_BAUD (UARTA_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UARTA_IRCR (UARTA_BA+0x28) /*!< IrDA Control Register */ - #define REG_UARTA_ALT_CSR (UARTA_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UARTA_FUN_SEL (UARTA_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UARTA_LIN_CTL (UARTA_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UARTA_LIN_SR (UARTA_BA+0x38) /*!< LIN Status Register */ - - - /**@}*/ /* end of UART register group */ - - - /*---------------------- Timer Controller -------------------------*/ - /** - @addtogroup TIMER Timer Controller(TIMER) - Memory Mapped Structure for TIMER Controller - @{ */ - - #define REG_TMR0_CSR (TMR0_BA+0x00) /*!< Timer Control and Status Register 0 */ - #define REG_TMR0_CMPR (TMR0_BA+0x04) /*!< Timer Compare Register 0 */ - #define REG_TMR0_DR (TMR0_BA+0x08) /*!< Timer Data Register 0 */ - - #define REG_TMR1_CSR (TMR1_BA+0x00) /*!< Timer Control and Status Register 1 */ - #define REG_TMR1_CMPR (TMR1_BA+0x04) /*!< Timer Compare Register 1 */ - #define REG_TMR1_TDR (TMR1_BA+0x08) /*!< Timer Data Register 1 */ - - #define REG_TMR2_CSR (TMR2_BA+0x00) /*!< Timer Control and Status Register 2 */ - #define REG_TMR2_CMPR (TMR2_BA+0x04) /*!< Timer Compare Register 2 */ - #define REG_TMR2_DR (TMR2_BA+0x08) /*!< Timer Data Register 2 */ - - #define REG_TMR3_CSR (TMR3_BA+0x00) /*!< Timer Control and Status Register 3 */ - #define REG_TMR3_CMPR (TMR3_BA+0x04) /*!< Timer Compare Register 3 */ - #define REG_TMR3_DR (TMR3_BA+0x08) /*!< Timer Data Register 3 */ - - #define REG_TMR4_CSR (TMR4_BA+0x00) /*!< Timer Control and Status Register 4 */ - #define REG_TMR4_CMPR (TMR4_BA+0x04) /*!< Timer Compare Register 4 */ - #define REG_TMR4_DR (TMR4_BA+0x08) /*!< Timer Data Register 4 */ - - #define REG_TMR_ISR (TMR0_BA+0x60) /*!< Timer Interrupt Status Register */ - - /**@}*/ /* end of TIMER register group */ - - /*---------------------- Enhance Timer Controller -------------------------*/ - /** - @addtogroup ETIMER Enhance Timer Controller(ETIMER) - Memory Mapped Structure for TIMER Controller - @{ */ - - #define REG_ETMR0_CTL (ETMR0_BA+0x00) /*!< Enhance Timer 0 Control Register */ - #define REG_ETMR0_PRECNT (ETMR0_BA+0x04) /*!< Enhance Timer 0 Pre-Scale Counter Register */ - #define REG_ETMR0_CMPR (ETMR0_BA+0x08) /*!< Enhance Timer 0 Compare Register */ - #define REG_ETMR0_IER (ETMR0_BA+0x0C) /*!< Enhance Timer 0 Interrupt Enable Register */ - #define REG_ETMR0_ISR (ETMR0_BA+0x10) /*!< Enhance Timer 0 Interrupt Status Register */ - #define REG_ETMR0_DR (ETMR0_BA+0x14) /*!< Enhance Timer 0 Data Register */ - #define REG_ETMR0_TCAP (ETMR0_BA+0x18) /*!< Enhance Timer 0 Capture Data Register */ - - #define REG_ETMR1_CTL (ETMR1_BA+0x00) /*!< Enhance Timer 1 Control Register */ - #define REG_ETMR1_PRECNT (ETMR1_BA+0x04) /*!< Enhance Timer 1 Pre-Scale Counter Register */ - #define REG_ETMR1_CMPR (ETMR1_BA+0x08) /*!< Enhance Timer 1 Compare Register */ - #define REG_ETMR1_IER (ETMR1_BA+0x0C) /*!< Enhance Timer 1 Interrupt Enable Register */ - #define REG_ETMR1_ISR (ETMR1_BA+0x10) /*!< Enhance Timer 1 Interrupt Status Register */ - #define REG_ETMR1_DR (ETMR1_BA+0x14) /*!< Enhance Timer 1 Data Register */ - #define REG_ETMR1_TCAP (ETMR1_BA+0x18) /*!< Enhance Timer 1 Capture Data Register */ - - #define REG_ETMR2_CTL (ETMR2_BA+0x00) /*!< Enhance Timer 2 Control Register */ - #define REG_ETMR2_PRECNT (ETMR2_BA+0x04) /*!< Enhance Timer 2 Pre-Scale Counter Register */ - #define REG_ETMR2_CMPR (ETMR2_BA+0x08) /*!< Enhance Timer 2 Compare Register */ - #define REG_ETMR2_IER (ETMR2_BA+0x0C) /*!< Enhance Timer 2 Interrupt Enable Register */ - #define REG_ETMR2_ISR (ETMR2_BA+0x10) /*!< Enhance Timer 2 Interrupt Status Register */ - #define REG_ETMR2_DR (ETMR2_BA+0x14) /*!< Enhance Timer 2 Data Register */ - #define REG_ETMR2_TCAP (ETMR2_BA+0x18) /*!< Enhance Timer 2 Capture Data Register */ - - #define REG_ETMR3_CTL (ETMR3_BA+0x00) /*!< Enhance Timer 3 Control Register */ - #define REG_ETMR3_PRECNT (ETMR3_BA+0x04) /*!< Enhance Timer 3 Pre-Scale Counter Register */ - #define REG_ETMR3_CMPR (ETMR3_BA+0x08) /*!< Enhance Timer 3 Compare Register */ - #define REG_ETMR3_IER (ETMR3_BA+0x0C) /*!< Enhance Timer 3 Interrupt Enable Register */ - #define REG_ETMR3_ISR (ETMR3_BA+0x10) /*!< Enhance Timer 3 Interrupt Status Register */ - #define REG_ETMR3_DR (ETMR3_BA+0x14) /*!< Enhance Timer 3 Data Register */ - #define REG_ETMR3_TCAP (ETMR3_BA+0x18) /*!< Enhance Timer 3 Capture Data Register */ - /**@}*/ /* end of ETIMER register group */ - - /*---------------------- WDT Controller -------------------------*/ - /** - @addtogroup WDT Watch Dog Timer Controller(WDT) - Memory Mapped Structure for WDT Controller - @{ */ - - #define REG_WDT_CTL (WDT_BA+0x00) /*!< WDT Control Register */ - #define REG_WDT_ALTCTL (WDT_BA+0x04) /*!< WDT Alternative Control Register */ - - /**@}*/ /* end of WDT register group */ - - /*---------------------- WWDT Controller -------------------------*/ - /** - @addtogroup WWDT Window Watch Dog Timer Controller(WWDT) - Memory Mapped Structure for WWDT Controller - @{ */ - - #define REG_WWDT_RLDCNT (WWDT_BA+0x00) /*!< WWDT Reload Counter Register */ - #define REG_WWDT_CTL (WWDT_BA+0x04) /*!< WWDT Control Register */ - #define REG_WWDT_STATUS (WWDT_BA+0x08) /*!< WWDT Status Register */ - #define REG_WWDT_CNT (WWDT_BA+0x0C) /*!< WWDT Counter Value Register */ - - /**@}*/ /* end of WWDT register group */ - - /*---------------------- SC Host Interface -------------------------*/ - /** - @addtogroup SC Smart Card Host Interface (SC) - Memory Mapped Structure for Smart Card Host Interface - @{ */ - - #define REG_SC0_DAT (SC0_BA+0x00) /*!< SC0 Receiving/Transmit Holding Buffer Register */ - #define REG_SC0_CTL (SC0_BA+0x04) /*!< SC0 Control Register */ - #define REG_SC0_ALTCTL (SC0_BA+0x08) /*!< SC0 Alternate Control Register */ - #define REG_SC0_EGT (SC0_BA+0x0C) /*!< SC0 Extend Guard Time Register */ - #define REG_SC0_RXTOUT (SC0_BA+0x10) /*!< SC0 Receive Buffer Time-out Register */ - #define REG_SC0_ETUCTL (SC0_BA+0x14) /*!< SC0 ETU Control Register */ - #define REG_SC0_INTEN (SC0_BA+0x18) /*!< SC0 Interrupt Enable Control Register */ - #define REG_SC0_INTSTS (SC0_BA+0x1C) /*!< SC0 Interrupt Status Register */ - #define REG_SC0_STATUS (SC0_BA+0x20) /*!< SC0 Status Register */ - #define REG_SC0_PINCTL (SC0_BA+0x24) /*!< SC0 Pin Control State Register */ - #define REG_SC0_TMRCTL0 (SC0_BA+0x28) /*!< SC0 Internal Timer Control Register 0 */ - #define REG_SC0_TMRCTL1 (SC0_BA+0x2C) /*!< SC0 Internal Timer Control Register 1 */ - #define REG_SC0_TMRCTL2 (SC0_BA+0x30) /*!< SC0 Internal Timer Control Register 2 */ - #define REG_SC0_UARTCTL (SC0_BA+0x34) /*!< SC0 UART Mode Control Register */ - #define REG_SC0_TMRDAT0 (SC0_BA+0x38) /*!< SC0 Timer Current Data Register 0 */ - #define REG_SC0_TMRDAT1 (SC0_BA+0x3C) /*!< SC0 Timer Current Data Register 1 */ - - #define REG_SC1_DAT (SC1_BA+0x00) /*!< SC1 Receiving/Transmit Holding Buffer Register */ - #define REG_SC1_CTL (SC1_BA+0x04) /*!< SC1 Control Register */ - #define REG_SC1_ALTCTL (SC1_BA+0x08) /*!< SC1 Alternate Control Register */ - #define REG_SC1_EGT (SC1_BA+0x0C) /*!< SC1 Extend Guard Time Register */ - #define REG_SC1_RXTOUT (SC1_BA+0x10) /*!< SC1 Receive Buffer Time-out Register */ - #define REG_SC1_ETUCTL (SC1_BA+0x14) /*!< SC1 ETU Control Register */ - #define REG_SC1_INTEN (SC1_BA+0x18) /*!< SC1 Interrupt Enable Control Register */ - #define REG_SC1_INTSTS (SC1_BA+0x1C) /*!< SC1 Interrupt Status Register */ - #define REG_SC1_STATUS (SC1_BA+0x20) /*!< SC1 Status Register */ - #define REG_SC1_PINCTL (SC1_BA+0x24) /*!< SC1 Pin Control State Register */ - #define REG_SC1_TMRCTL0 (SC1_BA+0x28) /*!< SC1 Internal Timer Control Register 0 */ - #define REG_SC1_TMRCTL1 (SC1_BA+0x2C) /*!< SC1 Internal Timer Control Register 1 */ - #define REG_SC1_TMRCTL2 (SC1_BA+0x30) /*!< SC1 Internal Timer Control Register 2 */ - #define REG_SC1_UARTCTL (SC1_BA+0x34) /*!< SC1 UART Mode Control Register */ - #define REG_SC1_TMRDAT0 (SC1_BA+0x38) /*!< SC1 Timer Current Data Register 0 */ - #define REG_SC1_TMRDAT1 (SC1_BA+0x3C) /*!< SC1 Timer Current Data Register 1 */ - - /**@}*/ /* end of SC register group */ - - - /*---------------------- Advance Interrupt Controller -------------------------*/ - /** - @addtogroup AIC Advance Interrupt Controller(AIC) - Memory Mapped Structure for AIC Controller - @{ */ - - #define REG_AIC_SCR1 (AIC_BA+0x00) /*!< Source control register 1 */ - #define REG_AIC_SCR2 (AIC_BA+0x04) /*!< Source control register 2 */ - #define REG_AIC_SCR3 (AIC_BA+0x08) /*!< Source control register 3 */ - #define REG_AIC_SCR4 (AIC_BA+0x0C) /*!< Source control register 4 */ - #define REG_AIC_SCR5 (AIC_BA+0x10) /*!< Source control register 5 */ - #define REG_AIC_SCR6 (AIC_BA+0x14) /*!< Source control register 6 */ - #define REG_AIC_SCR7 (AIC_BA+0x18) /*!< Source control register 7 */ - #define REG_AIC_SCR8 (AIC_BA+0x1C) /*!< Source control register 8 */ - #define REG_AIC_SCR9 (AIC_BA+0x20) /*!< Source control register 9 */ - #define REG_AIC_SCR10 (AIC_BA+0x24) /*!< Source control register 10 */ - #define REG_AIC_SCR11 (AIC_BA+0x28) /*!< Source control register 11 */ - #define REG_AIC_SCR12 (AIC_BA+0x2C) /*!< Source control register 12 */ - #define REG_AIC_SCR13 (AIC_BA+0x30) /*!< Source control register 13 */ - #define REG_AIC_SCR14 (AIC_BA+0x34) /*!< Source control register 14 */ - #define REG_AIC_SCR15 (AIC_BA+0x38) /*!< Source control register 15 */ - #define REG_AIC_SCR16 (AIC_BA+0x3C) /*!< Source control register 16 */ - #define REG_AIC_IRSR (AIC_BA+0x100) /*!< Interrupt raw status register */ - #define REG_AIC_IRSRH (AIC_BA+0x104) /*!< Interrupt raw status register (Hign) */ - #define REG_AIC_IASR (AIC_BA+0x108) /*!< Interrupt active status register */ - #define REG_AIC_IASRH (AIC_BA+0x10C) /*!< Interrupt active status register (Hign) */ - #define REG_AIC_ISR (AIC_BA+0x110) /*!< Interrupt status register */ - #define REG_AIC_ISRH (AIC_BA+0x114) /*!< Interrupt status register (High) */ - #define REG_AIC_IPER (AIC_BA+0x118) /*!< Interrupt priority encoding register */ - #define REG_AIC_ISNR (AIC_BA+0x120) /*!< Interrupt source number register */ - #define REG_AIC_OISR (AIC_BA+0x124) /*!< Output interrupt status register */ - #define REG_AIC_IMR (AIC_BA+0x128) /*!< Interrupt mask register */ - #define REG_AIC_IMRH (AIC_BA+0x12C) /*!< Interrupt mask register (High) */ - #define REG_AIC_MECR (AIC_BA+0x130) /*!< Mask enable command register */ - #define REG_AIC_MECRH (AIC_BA+0x134) /*!< Mask enable command register (High) */ - #define REG_AIC_MDCR (AIC_BA+0x138) /*!< Mask disable command register */ - #define REG_AIC_MDCRH (AIC_BA+0x13C) /*!< Mask disable command register (High) */ - #define REG_AIC_SSCR (AIC_BA+0x140) /*!< Source Set Command Register */ - #define REG_AIC_SSCRH (AIC_BA+0x144) /*!< Source Set Command Register (High) */ - #define REG_AIC_SCCR (AIC_BA+0x148) /*!< Source Clear Command Register */ - #define REG_AIC_SCCRH (AIC_BA+0x14C) /*!< Source Clear Command Register (High) */ - #define REG_AIC_EOSCR (AIC_BA+0x150) /*!< End of service command register */ - - /**@}*/ /* end of AIC register group */ - - - /*---------------------- General Purpose Input/Output Controller -------------------------*/ - /** - @addtogroup GPIO General Purpose Input/Output Controller(GPIO) - Memory Mapped Structure for GPIO Controller - @{ */ - - #define REG_GPIOA_DIR (GPIO_BA+0x000) /*!< GPIO portA direction control register */ - #define REG_GPIOA_DATAOUT (GPIO_BA+0x004) /*!< GPIO portA data output register */ - #define REG_GPIOA_DATAIN (GPIO_BA+0x008) /*!< GPIO portA data input register */ - #define REG_GPIOA_IMD (GPIO_BA+0x00C) /*!< GPIO Port A Interrupt Mode Register */ - #define REG_GPIOA_IREN (GPIO_BA+0x010) /*!< GPIO Port A Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOA_IFEN (GPIO_BA+0x014) /*!< GPIO Port A Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOA_ISR (GPIO_BA+0x018) /*!< GPIO Port A Interrupt Status Register */ - #define REG_GPIOA_DBEN (GPIO_BA+0x01C) /*!< GPIO Port A De-bounce Enable Register */ - #define REG_GPIOA_PUEN (GPIO_BA+0x020) /*!< GPIO Port A Pull-Up Enable Register */ - #define REG_GPIOA_PDEN (GPIO_BA+0x024) /*!< GPIO Port A Pull-Down Enable Register */ - #define REG_GPIOA_ICEN (GPIO_BA+0x028) /*!< GPIO Port A CMOS Input Enable Register */ - #define REG_GPIOA_ISEN (GPIO_BA+0x02C) /*!< GPIO Port A Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOB_DIR (GPIO_BA+0x040) /*!< GPIO port B direction control register */ - #define REG_GPIOB_DATAOUT (GPIO_BA+0x044) /*!< GPIO port B data output register */ - #define REG_GPIOB_DATAIN (GPIO_BA+0x048) /*!< GPIO port B data input register */ - #define REG_GPIOB_IMD (GPIO_BA+0x04C) /*!< GPIO Port B Interrupt Mode Register */ - #define REG_GPIOB_IREN (GPIO_BA+0x050) /*!< GPIO Port B Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOB_IFEN (GPIO_BA+0x054) /*!< GPIO Port B Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOB_ISR (GPIO_BA+0x058) /*!< GPIO Port B Interrupt Status Register */ - #define REG_GPIOB_DBEN (GPIO_BA+0x05C) /*!< GPIO Port B De-bounce Enable Register */ - #define REG_GPIOB_PUEN (GPIO_BA+0x060) /*!< GPIO Port B Pull-Up Enable Register */ - #define REG_GPIOB_PDEN (GPIO_BA+0x064) /*!< GPIO Port B Pull-Down Enable Register */ - #define REG_GPIOB_ICEN (GPIO_BA+0x068) /*!< GPIO Port B CMOS Input Enable Register */ - #define REG_GPIOB_ISEN (GPIO_BA+0x06C) /*!< GPIO Port B Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOC_DIR (GPIO_BA+0x080) /*!< GPIO port C direction control register */ - #define REG_GPIOC_DATAOUT (GPIO_BA+0x084) /*!< GPIO port C data output register */ - #define REG_GPIOC_DATAIN (GPIO_BA+0x088) /*!< GPIO port C data input register */ - #define REG_GPIOC_IMD (GPIO_BA+0x08C) /*!< GPIO Port C Interrupt Mode Register */ - #define REG_GPIOC_IREN (GPIO_BA+0x090) /*!< GPIO Port C Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOC_IFEN (GPIO_BA+0x094) /*!< GPIO Port C Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOC_ISR (GPIO_BA+0x098) /*!< GPIO Port C Interrupt Status Register */ - #define REG_GPIOC_DBEN (GPIO_BA+0x09C) /*!< GPIO Port C De-bounce Enable Register */ - #define REG_GPIOC_PUEN (GPIO_BA+0x0A0) /*!< GPIO Port C Pull-Up Enable Register */ - #define REG_GPIOC_PDEN (GPIO_BA+0x0A4) /*!< GPIO Port C Pull-Down Enable Register */ - #define REG_GPIOC_ICEN (GPIO_BA+0x0A8) /*!< GPIO Port C CMOS Input Enable Register */ - #define REG_GPIOC_ISEN (GPIO_BA+0x0AC) /*!< GPIO Port C Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOD_DIR (GPIO_BA+0x0C0) /*!< GPIO port D direction control register */ - #define REG_GPIOD_DATAOUT (GPIO_BA+0x0C4) /*!< GPIO port D data output register */ - #define REG_GPIOD_DATAIN (GPIO_BA+0x0C8) /*!< GPIO port D data input register */ - #define REG_GPIOD_IMD (GPIO_BA+0x0CC) /*!< GPIO Port D Interrupt Mode Register */ - #define REG_GPIOD_IREN (GPIO_BA+0x0D0) /*!< GPIO Port D Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOD_IFEN (GPIO_BA+0x0D4) /*!< GPIO Port D Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOD_ISR (GPIO_BA+0x0D8) /*!< GPIO Port D Interrupt Status Register */ - #define REG_GPIOD_DBEN (GPIO_BA+0x0DC) /*!< GPIO Port D De-bounce Enable Register */ - #define REG_GPIOD_PUEN (GPIO_BA+0x0E0) /*!< GPIO Port D Pull-Up Enable Register */ - #define REG_GPIOD_PDEN (GPIO_BA+0x0E4) /*!< GPIO Port D Pull-Down Enable Register */ - #define REG_GPIOD_ICEN (GPIO_BA+0x0E8) /*!< GPIO Port D CMOS Input Enable Register */ - #define REG_GPIOD_ISEN (GPIO_BA+0x0EC) /*!< GPIO Port D Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOE_DIR (GPIO_BA+0x100) /*!< GPIO port E direction control register */ - #define REG_GPIOE_DATAOUT (GPIO_BA+0x104) /*!< GPIO port E data output register */ - #define REG_GPIOE_DATAIN (GPIO_BA+0x108) /*!< GPIO port E data input register */ - #define REG_GPIOE_IMD (GPIO_BA+0x10C) /*!< GPIO Port E Interrupt Mode Register */ - #define REG_GPIOE_IREN (GPIO_BA+0x110) /*!< GPIO Port E Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOE_IFEN (GPIO_BA+0x114) /*!< GPIO Port E Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOE_ISR (GPIO_BA+0x118) /*!< GPIO Port E Interrupt Status Register */ - #define REG_GPIOE_DBEN (GPIO_BA+0x11C) /*!< GPIO Port E De-bounce Enable Register */ - #define REG_GPIOE_PUEN (GPIO_BA+0x120) /*!< GPIO Port E Pull-Up Enable Register */ - #define REG_GPIOE_PDEN (GPIO_BA+0x124) /*!< GPIO Port E Pull-Down Enable Register */ - #define REG_GPIOE_ICEN (GPIO_BA+0x128) /*!< GPIO Port E CMOS Input Enable Register */ - #define REG_GPIOE_ISEN (GPIO_BA+0x12C) /*!< GPIO Port E Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOF_DIR (GPIO_BA+0x140) /*!< GPIO port F direction control register */ - #define REG_GPIOF_DATAOUT (GPIO_BA+0x144) /*!< GPIO port F data output register */ - #define REG_GPIOF_DATAIN (GPIO_BA+0x148) /*!< GPIO port F data input register */ - #define REG_GPIOF_IMD (GPIO_BA+0x14C) /*!< GPIO Port F Interrupt Mode Register */ - #define REG_GPIOF_IREN (GPIO_BA+0x150) /*!< GPIO Port F Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOF_IFEN (GPIO_BA+0x154) /*!< GPIO Port F Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOF_ISR (GPIO_BA+0x158) /*!< GPIO Port F Interrupt Status Register */ - #define REG_GPIOF_DBEN (GPIO_BA+0x15C) /*!< GPIO Port F De-bounce Enable Register */ - #define REG_GPIOF_PUEN (GPIO_BA+0x160) /*!< GPIO Port F Pull-Up Enable Register */ - #define REG_GPIOF_PDEN (GPIO_BA+0x164) /*!< GPIO Port F Pull-Down Enable Register */ - #define REG_GPIOF_ICEN (GPIO_BA+0x168) /*!< GPIO Port F CMOS Input Enable Register */ - #define REG_GPIOF_ISEN (GPIO_BA+0x16C) /*!< GPIO Port F Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOG_DIR (GPIO_BA+0x180) /*!< GPIO port G direction control register */ - #define REG_GPIOG_DATAOUT (GPIO_BA+0x184) /*!< GPIO port G data output register */ - #define REG_GPIOG_DATAIN (GPIO_BA+0x188) /*!< GPIO port G data input register */ - #define REG_GPIOG_IMD (GPIO_BA+0x18C) /*!< GPIO Port G Interrupt Mode Register */ - #define REG_GPIOG_IREN (GPIO_BA+0x190) /*!< GPIO Port G Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOG_IFEN (GPIO_BA+0x194) /*!< GPIO Port G Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOG_ISR (GPIO_BA+0x198) /*!< GPIO Port G Interrupt Status Register */ - #define REG_GPIOG_DBEN (GPIO_BA+0x19C) /*!< GPIO Port G De-bounce Enable Register */ - #define REG_GPIOG_PUEN (GPIO_BA+0x1A0) /*!< GPIO Port G Pull-Up Enable Register */ - #define REG_GPIOG_PDEN (GPIO_BA+0x1A4) /*!< GPIO Port G Pull-Down Enable Register */ - #define REG_GPIOG_ICEN (GPIO_BA+0x1A8) /*!< GPIO Port G CMOS Input Enable Register */ - #define REG_GPIOG_ISEN (GPIO_BA+0x1AC) /*!< GPIO Port G Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOH_DIR (GPIO_BA+0x1C0) /*!< GPIO port H direction control register */ - #define REG_GPIOH_DATAOUT (GPIO_BA+0x1C4) /*!< GPIO port H data output register */ - #define REG_GPIOH_DATAIN (GPIO_BA+0x1C8) /*!< GPIO port H data input register */ - #define REG_GPIOH_IMD (GPIO_BA+0x1CC) /*!< GPIO Port H Interrupt Mode Register */ - #define REG_GPIOH_IREN (GPIO_BA+0x1D0) /*!< GPIO Port H Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOH_IFEN (GPIO_BA+0x1D4) /*!< GPIO Port H Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOH_ISR (GPIO_BA+0x1D8) /*!< GPIO Port H Interrupt Status Register */ - #define REG_GPIOH_DBEN (GPIO_BA+0x1DC) /*!< GPIO Port H De-bounce Enable Register */ - #define REG_GPIOH_PUEN (GPIO_BA+0x1E0) /*!< GPIO Port H Pull-Up Enable Register */ - #define REG_GPIOH_PDEN (GPIO_BA+0x1E4) /*!< GPIO Port H Pull-Down Enable Register */ - #define REG_GPIOH_ICEN (GPIO_BA+0x1E8) /*!< GPIO Port H CMOS Input Enable Register */ - #define REG_GPIOH_ISEN (GPIO_BA+0x1EC) /*!< GPIO Port H Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOI_DIR (GPIO_BA+0x200) /*!< GPIO port I direction control register */ - #define REG_GPIOI_DATAOUT (GPIO_BA+0x204) /*!< GPIO port I data output register */ - #define REG_GPIOI_DATAIN (GPIO_BA+0x208) /*!< GPIO port I data input register */ - #define REG_GPIOI_IMD (GPIO_BA+0x20C) /*!< GPIO Port I Interrupt Mode Register */ - #define REG_GPIOI_IREN (GPIO_BA+0x210) /*!< GPIO Port I Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOI_IFEN (GPIO_BA+0x214) /*!< GPIO Port I Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOI_ISR (GPIO_BA+0x218) /*!< GPIO Port I Interrupt Status Register */ - #define REG_GPIOI_DBEN (GPIO_BA+0x21C) /*!< GPIO Port I De-bounce Enable Register */ - #define REG_GPIOI_PUEN (GPIO_BA+0x220) /*!< GPIO Port I Pull-Up Enable Register */ - #define REG_GPIOI_PDEN (GPIO_BA+0x224) /*!< GPIO Port I Pull-Down Enable Register */ - #define REG_GPIOI_ICEN (GPIO_BA+0x228) /*!< GPIO Port I CMOS Input Enable Register */ - #define REG_GPIOI_ISEN (GPIO_BA+0x22C) /*!< GPIO Port I Schmitt-Trigger Input Enable Register */ - - #define REG_GPIOJ_DIR (GPIO_BA+0x240) /*!< GPIO port J direction control register */ - #define REG_GPIOJ_DATAOUT (GPIO_BA+0x244) /*!< GPIO port J data output register */ - #define REG_GPIOJ_DATAIN (GPIO_BA+0x248) /*!< GPIO port J data input register */ - #define REG_GPIOJ_IMD (GPIO_BA+0x24C) /*!< GPIO Port J Interrupt Mode Register */ - #define REG_GPIOJ_IREN (GPIO_BA+0x250) /*!< GPIO Port J Interrupt Rising-Edge or Level-High Enable Register */ - #define REG_GPIOJ_IFEN (GPIO_BA+0x254) /*!< GPIO Port J Interrupt Falling-Edge or Level-Low Enable Register */ - #define REG_GPIOJ_ISR (GPIO_BA+0x258) /*!< GPIO Port J Interrupt Status Register */ - #define REG_GPIOJ_DBEN (GPIO_BA+0x25C) /*!< GPIO Port J De-bounce Enable Register */ - #define REG_GPIOJ_PUEN (GPIO_BA+0x260) /*!< GPIO Port J Pull-Up Enable Register */ - #define REG_GPIOJ_PDEN (GPIO_BA+0x264) /*!< GPIO Port J Pull-Down Enable Register */ - #define REG_GPIOJ_ICEN (GPIO_BA+0x268) /*!< GPIO Port J CMOS Input Enable Register */ - #define REG_GPIOJ_ISEN (GPIO_BA+0x26C) /*!< GPIO Port J Schmitt-Trigger Input Enable Register */ - - #define REG_GPIO_DBNCECON (GPIO_BA+0x3F0) /*!< GPIO Debounce Control Register */ - #define REG_GPIO_ISR (GPIO_BA+0x3FC) /*!< GPIO Port Interrupt Status Register */ - - /**@}*/ /* end of GPIO register group */ - - - /*---------------------- Real Time Clock Controller -------------------------*/ - /** - @addtogroup RTC Real Time Clock Controller(RTC) - Memory Mapped Structure for RTC Controller - @{ */ - - #define REG_RTC_INIT (RTC_BA+0x00) /*!< RTC Initiation Register */ - #define REG_RTC_RWEN (RTC_BA+0x04) /*!< RTC Access Enable Register */ - #define REG_RTC_FREQADJ (RTC_BA+0x08) /*!< RTC Frequency Compensation Register */ - #define REG_RTC_TIME (RTC_BA+0x0C) /*!< Time Loading Register */ - #define REG_RTC_CAL (RTC_BA+0x10) /*!< Calendar Loading Register */ - #define REG_RTC_TIMEFMT (RTC_BA+0x14) /*!< Time Format Selection Register */ - #define REG_RTC_WEEKDAY (RTC_BA+0x18) /*!< Day of the Week Register */ - #define REG_RTC_TALM (RTC_BA+0x1C) /*!< Time Alarm Register */ - #define REG_RTC_CALM (RTC_BA+0x20) /*!< Calendar Alarm Register */ - #define REG_RTC_LEAPYEAR (RTC_BA+0x24) /*!< Leap year Indicator Register */ - #define REG_RTC_INTEN (RTC_BA+0x28) /*!< RTC Interrupt Enable Register */ - #define REG_RTC_INTSTS (RTC_BA+0x2C) /*!< RTC Interrupt Indicator Register */ - #define REG_RTC_TICK (RTC_BA+0x30) /*!< RTC Time Tick Register */ - #define REG_RTC_PWRCTL (RTC_BA+0x34) /*!< Power Control Register */ - #define REG_RTC_PWRCNT (RTC_BA+0x38) /*!< Power Control Counter Register */ - #define REG_RTC_SPR0 (RTC_BA+0x40) /*!< Spare REgistger 0 */ - #define REG_RTC_SPR1 (RTC_BA+0x44) /*!< Spare REgistger 1 */ - #define REG_RTC_SPR2 (RTC_BA+0x48) /*!< Spare REgistger 2 */ - #define REG_RTC_SPR3 (RTC_BA+0x4C) /*!< Spare REgistger 3 */ - #define REG_RTC_SPR4 (RTC_BA+0x50) /*!< Spare REgistger 4 */ - #define REG_RTC_SPR5 (RTC_BA+0x54) /*!< Spare REgistger 5 */ - #define REG_RTC_SPR6 (RTC_BA+0x58) /*!< Spare REgistger 6 */ - #define REG_RTC_SPR7 (RTC_BA+0x5C) /*!< Spare REgistger 7 */ - #define REG_RTC_SPR8 (RTC_BA+0x60) /*!< Spare REgistger 8 */ - #define REG_RTC_SPR9 (RTC_BA+0x64) /*!< Spare REgistger 9 */ - #define REG_RTC_SPR10 (RTC_BA+0x68) /*!< Spare REgistger 10 */ - #define REG_RTC_SPR11 (RTC_BA+0x6C) /*!< Spare REgistger 11 */ - #define REG_RTC_SPR12 (RTC_BA+0x70) /*!< Spare REgistger 12 */ - #define REG_RTC_SPR13 (RTC_BA+0x74) /*!< Spare REgistger 13 */ - #define REG_RTC_SPR14 (RTC_BA+0x78) /*!< Spare REgistger 14 */ - #define REG_RTC_SPR15 (RTC_BA+0x7C) /*!< Spare REgistger 15 */ - - /**@}*/ /* end of RTC register group */ - - /*---------------------- Inter-IC Bus Controller -------------------------*/ - /** - @addtogroup I2C Inter-IC Bus Controller(I2C) - Memory Mapped Structure for I2C Controller - @{ */ - - #define REG_I2C0_CSR (I2C0_BA+0x00) /*!< Control and Status Register */ - #define REG_I2C0_DIVIDER (I2C0_BA+0x04) /*!< Clock Prescale Register */ - #define REG_I2C0_CMDR (I2C0_BA+0x08) /*!< Command Register */ - #define REG_I2C0_SWR (I2C0_BA+0x0C) /*!< Software Mode Control Register */ - #define REG_I2C0_RXR (I2C0_BA+0x10) /*!< Data Receive Register */ - #define REG_I2C0_TXR (I2C0_BA+0x14) /*!< Data Transmit Register */ - - #define REG_I2C1_CSR (I2C1_BA+0x00) /*!< Control and Status Register */ - #define REG_I2C1_DIVIDER (I2C1_BA+0x04) /*!< Clock Prescale Register */ - #define REG_I2C1_CMDR (I2C1_BA+0x08) /*!< Command Register */ - #define REG_I2C1_SWR (I2C1_BA+0x0C) /*!< Software Mode Control Register */ - #define REG_I2C1_RXR (I2C1_BA+0x10) /*!< Data Receive Register */ - #define REG_I2C1_TXR (I2C1_BA+0x14) /*!< Data Transmit Register */ - - /**@}*/ /* end of I2C register group */ - - - /*---------------------- Serial Peripheral Interface Controller -------------------------*/ - /** - @addtogroup SPI Serial Peripheral Interface Controller(SPI) - Memory Mapped Structure for SPI Controller - @{ */ - - #define REG_SPI0_CNTRL (SPI0_BA+0x00) /*!< Control and Status Register */ - #define REG_SPI0_DIVIDER (SPI0_BA+0x04) /*!< Clock Divider Register */ - #define REG_SPI0_SSR (SPI0_BA+0x08) /*!< Slave Select Register */ - #define REG_SPI0_RX0 (SPI0_BA+0x10) /*!< Data Receive Register 0 */ - #define REG_SPI0_RX1 (SPI0_BA+0x14) /*!< Data Receive Register 1 */ - #define REG_SPI0_RX2 (SPI0_BA+0x18) /*!< Data Receive Register 2 */ - #define REG_SPI0_RX3 (SPI0_BA+0x1C) /*!< Data Receive Register 3 */ - #define REG_SPI0_TX0 (SPI0_BA+0x10) /*!< Data Transmit Register 0 */ - #define REG_SPI0_TX1 (SPI0_BA+0x14) /*!< Data Transmit Register 1 */ - #define REG_SPI0_TX2 (SPI0_BA+0x18) /*!< Data Transmit Register 2 */ - #define REG_SPI0_TX3 (SPI0_BA+0x1C) /*!< Data Transmit Register 3 */ - - #define REG_SPI1_CNTRL (SPI1_BA+0x00) /*!< Control and Status Register */ - #define REG_SPI1_DIVIDER (SPI1_BA+0x04) /*!< Clock Divider Register */ - #define REG_SPI1_SSR (SPI1_BA+0x08) /*!< Slave Select Register */ - #define REG_SPI1_RX0 (SPI1_BA+0x10) /*!< Data Receive Register 0 */ - #define REG_SPI1_RX1 (SPI1_BA+0x14) /*!< Data Receive Register 1 */ - #define REG_SPI1_RX2 (SPI1_BA+0x18) /*!< Data Receive Register 2 */ - #define REG_SPI1_RX3 (SPI1_BA+0x1C) /*!< Data Receive Register 3 */ - #define REG_SPI1_TX0 (SPI1_BA+0x10) /*!< Data Transmit Register 0 */ - #define REG_SPI1_TX1 (SPI1_BA+0x14) /*!< Data Transmit Register 1 */ - #define REG_SPI1_TX2 (SPI1_BA+0x18) /*!< Data Transmit Register 2 */ - #define REG_SPI1_TX3 (SPI1_BA+0x1C) /*!< Data Transmit Register 3 */ - - /**@}*/ /* end of SPI register group */ - - - /*---------------------- Pulse Width Modulation Controller -------------------------*/ - /** - @addtogroup PWM Pulse Width Modulation Controller(PWM) - Memory Mapped Structure for PWM Controller - @{ */ - - #define REG_PWM_PPR (PWM_BA+0x00) /*!< PWM Pre-scale Register 0 */ - #define REG_PWM_CSR (PWM_BA+0x04) /*!< PWM Clock Select Register */ - #define REG_PWM_PCR (PWM_BA+0x08) /*!< PWM Control Register */ - #define REG_PWM_CNR0 (PWM_BA+0x0C) /*!< PWM Counter Register 0 */ - #define REG_PWM_CMR0 (PWM_BA+0x10) /*!< PWM Comparator Register 0 */ - #define REG_PWM_PDR0 (PWM_BA+0x14) /*!< PWM Data Register 0 */ - #define REG_PWM_CNR1 (PWM_BA+0x18) /*!< PWM Counter Register 1 */ - #define REG_PWM_CMR1 (PWM_BA+0x1C) /*!< PWM Comparator Register 1 */ - #define REG_PWM_PDR1 (PWM_BA+0x20) /*!< PWM Data Register 1 */ - #define REG_PWM_CNR2 (PWM_BA+0x24) /*!< PWM Counter Register 2 */ - #define REG_PWM_CMR2 (PWM_BA+0x28) /*!< PWM Comparator Register 2 */ - #define REG_PWM_PDR2 (PWM_BA+0x2C) /*!< PWM Data Register 2 */ - #define REG_PWM_CNR3 (PWM_BA+0x30) /*!< PWM Counter Register 3 */ - #define REG_PWM_CMR3 (PWM_BA+0x34) /*!< PWM Comparator Register 3 */ - #define REG_PWM_PDR3 (PWM_BA+0x38) /*!< PWM Data Register 3 */ - #define REG_PWM_PIER (PWM_BA+0x3C) /*!< PWM Timer Interrupt Enable Register */ - #define REG_PWM_PIIR (PWM_BA+0x40) /*!< PWM Timer Interrupt Identification Register */ - - /**@}*/ /* end of PWM register group */ - - - /*---------------------- Analog to Digital Converter -------------------------*/ - /** - @addtogroup ADC Analog to Digital Converter(ADC) - Memory Mapped Structure for ADC Controller - @{ */ - - #define REG_ADC_CTL (ADC_BA+0x000) /*!< ADC Contrl */ - #define REG_ADC_CONF (ADC_BA+0x004) /*!< ADC Configure */ - #define REG_ADC_IER (ADC_BA+0x008) /*!< ADC Interrupt Enable Register */ - #define REG_ADC_ISR (ADC_BA+0x00C) /*!< ADC Interrupt Status Register */ - #define REG_ADC_WKISR (ADC_BA+0x010) /*!< ADC Wake Up Interrupt Status Register */ - #define REG_ADC_XYDATA (ADC_BA+0x020) /*!< ADC Touch XY Pressure Data */ - #define REG_ADC_ZDATA (ADC_BA+0x024) /*!< ADC Touch Z Pressure Data */ - #define REG_ADC_DATA (ADC_BA+0x028) /*!< ADC Normal Conversion Data */ - #define REG_ADC_VBADATA (ADC_BA+0x02C) /*!< ADC Battery Detection Data */ - #define REG_ADC_KPDATA (ADC_BA+0x030) /*!< ADC Key Pad Data */ - #define REG_ADC_SELFDATA (ADC_BA+0x034) /*!< ADC Self-Test Data */ - #define REG_ADC_XYSORT0 (ADC_BA+0x1F4) /*!< ADC Touch XY Position Mean Value Sort 0 */ - #define REG_ADC_XYSORT1 (ADC_BA+0x1F8) /*!< ADC Touch XY Position Mean Value Sort 1 */ - #define REG_ADC_XYSORT2 (ADC_BA+0x1FC) /*!< ADC Touch XY Position Mean Value Sort 2 */ - #define REG_ADC_XYSORT3 (ADC_BA+0x200) /*!< ADC Touch XY Position Mean Value Sort 3 */ - #define REG_ADC_ZSORT0 (ADC_BA+0x204) /*!< ADC Touch Z Pressure Mean Value Sort 0 */ - #define REG_ADC_ZSORT1 (ADC_BA+0x208) /*!< ADC Touch Z Pressure Mean Value Sort 1 */ - #define REG_ADC_ZSORT2 (ADC_BA+0x20C) /*!< ADC Touch Z Pressure Mean Value Sort 2 */ - #define REG_ADC_ZSORT3 (ADC_BA+0x210) /*!< ADC Touch Z Pressure Mean Value Sort 3 */ - #define REG_ADC_MTMULCK (ADC_BA+0x220) /*!< ADC Manual Test Mode Unlock */ - #define REG_ADC_MTCONF (ADC_BA+0x224) /*!< ADC Manual Test Mode Configure */ - #define REG_ADC_MTCON (ADC_BA+0x228) /*!< ADC Manual Test Mode Control */ - #define REG_ADC_ADCAII (ADC_BA+0x22C) /*!< ADC Analog Interface Information */ - #define REG_ADC_ADCAIIRLT (ADC_BA+0x230) /*!< ADC Analog Interface Information Result */ - - /**@}*/ /* end of ADC register group */ - - /*------------------ Capture Sensor Interface Controller ---------------------*/ - /** - @addtogroup CAP Capture Sensor Interface Controller(CAP) - Memory Mapped Structure for CAP Controller - @{ */ - - #define REG_CAP_CTL (CAP_BA+0x000) /*!< Image Capture Interface Control Register */ - #define REG_CAP_PAR (CAP_BA+0x004) /*!< Image Capture Interface Parameter Register */ - #define REG_CAP_INT (CAP_BA+0x008) /*!< Image Capture Interface Interrupt Registe */ - #define REG_CAP_POSTERIZE (CAP_BA+0x00C) /*!< YUV Component Posterizing Factor Register */ - #define REG_CAP_MD (CAP_BA+0x010) /*!< Motion Detection Register */ - #define REG_CAP_MDADDR (CAP_BA+0x014) /*!< Motion Detection Output Address Register */ - #define REG_CAP_MDYADDR (CAP_BA+0x018) /*!< Motion Detection Temp YOutput Address Register */ - #define REG_CAP_SEPIA (CAP_BA+0x01C) /*!< Sepia Effect Control Register */ - #define REG_CAP_CWSP (CAP_BA+0x020) /*!< Cropping Window Starting Address Register */ - #define REG_CAP_CWS (CAP_BA+0x024) /*!< Cropping Window Size Register */ - #define REG_CAP_PKTSL (CAP_BA+0x028) /*!< Packet Scaling Vertical/Horizontal Factor Register (LSB) */ - #define REG_CAP_PLNSL (CAP_BA+0x02C) /*!< Planar Scaling Vertical/Horizontal Factor Register (LSB) */ - #define REG_CAP_FRCTL (CAP_BA+0x030) /*!< Scaling Frame Rate Factor Register */ - #define REG_CAP_STRIDE (CAP_BA+0x034) /*!< Frame Output Pixel Stride Register */ - #define REG_CAP_FIFOTH (CAP_BA+0x03C) /*!< FIFO threshold Register */ - #define REG_CAP_CMPADDR (CAP_BA+0x040) /*!< Compare Packet Memory Base Address Register */ - #define REG_CAP_PKTSM (CAP_BA+0x048) /*!< Packet Scaling Vertical/Horizontal Factor Register (MSB) */ - #define REG_CAP_PLNSM (CAP_BA+0x04C) /*!< Planar Scaling Vertical/Horizontal Factor Register (MSB) */ - #define REG_CAP_CURADDRP (CAP_BA+0x050) /*!< Current Packet System Memory Address Register */ - #define REG_CAP_CURADDRY (CAP_BA+0x054) /*!< Current Planar Y System Memory Address Register */ - #define REG_CAP_CURADDRU (CAP_BA+0x058) /*!< Current Planar U System Memory Address Register */ - #define REG_CAP_CURADDRV (CAP_BA+0x05C) /*!< Current Planar V System Memory Address Register */ - #define REG_CAP_PKTBA0 (CAP_BA+0x060) /*!< System Memory Packet Base Address Register */ - #define REG_CAP_PKTBA1 (CAP_BA+0x064) /*!< System Memory Packet Base Address Register */ - #define REG_CAP_YBA (CAP_BA+0x080) /*!< System Memory Planar Y Base Address Register */ - #define REG_CAP_UBA (CAP_BA+0x084) /*!< System Memory Planar U Base Address Register */ - #define REG_CAP_VBA (CAP_BA+0x088) /*!< System Memory Planar V Base Address Register */ - - /**@}*/ /* end of CAP register group */ - - /*------------------ SDRAM Interface Controller ---------------------*/ - /** - @addtogroup SDIC SDRAM Interface Controller(SDIC) - Memory Mapped Structure for SDIC Controller - @{ */ - - #define REG_SDIC_OPMCTL (SDIC_BA+0x000) /*!< SDRAM Controller Operation Mode Control Register */ - #define REG_SDIC_CMD (SDIC_BA+0x004) /*!< SDRAM Command Register */ - #define REG_SDIC_REFCTL (SDIC_BA+0x008) /*!< SDRAM Controller Refresh Control Register */ - #define REG_SDIC_SIZE0 (SDIC_BA+0x010) /*!< SDRAM 0 Size Register */ - #define REG_SDIC_SIZE1 (SDIC_BA+0x014) /*!< SDRAM 1 Size Register */ - #define REG_SDIC_MR (SDIC_BA+0x018) /*!< SDRAM Mode Register */ - #define REG_SDIC_EMR (SDIC_BA+0x01C) /*!< SDRAM Extended Mode Register */ - #define REG_SDIC_EMR2 (SDIC_BA+0x020) /*!< SDRAM Extended Mode Register 2 */ - #define REG_SDIC_EMR3 (SDIC_BA+0x024) /*!< SDRAM Extended Mode Register 3 */ - #define REG_SDIC_TIME (SDIC_BA+0x028) /*!< SDRAM Timing Control Register */ - #define REG_SDIC_DQSODS (SDIC_BA+0x030) /*!< DQS Output Delay Selection Register */ - #define REG_SDIC_CKDQSDS (SDIC_BA+0x034) /*!< Clock and DQS Delay Selection Register */ - #define REG_SDIC_DAENSEL (SDIC_BA+0x038) /*!< Data Latch Enable Selection Register */ - - /**@}*/ /* end of SDIC register group */ - - /*---------------------- Controller Area Network -------------------------*/ - /** - @addtogroup CAN Controller Area Network(CAN) - Memory Mapped Structure for CAN Controller - @{ */ - - #define REG_CAN0_CON (CAN0_BA+0x00) /*!< Control Register */ - #define REG_CAN0_STATUS (CAN0_BA+0x04) /*!< Status Register */ - #define REG_CAN0_ERR (CAN0_BA+0x08) /*!< Error Counter Register */ - #define REG_CAN0_BTIME (CAN0_BA+0x0C) /*!< Bit Time Register */ - #define REG_CAN0_IIDR (CAN0_BA+0x10) /*!< Interrupt Identifier Register */ - #define REG_CAN0_TEST (CAN0_BA+0x14) /*!< Test Register */ - #define REG_CAN0_BRPE (CAN0_BA+0x18) /*!< BRP Extension Register */ - #define REG_CAN0_IF1_CREQ (CAN0_BA+0x20) /*!< IF1 Command Request Register */ - #define REG_CAN0_IF2_CREQ (CAN0_BA+0x80) /*!< IF2 Command Request Register */ - #define REG_CAN0_IF1_CMASK (CAN0_BA+0x24) /*!< IF1 Command Mask Register */ - #define REG_CAN0_IF2_CMASK (CAN0_BA+0x84) /*!< IF2 Command Mask Register */ - #define REG_CAN0_IF1_MASK1 (CAN0_BA+0x28) /*!< IF1 Msak 1 Register */ - #define REG_CNA0_IF2_MASK1 (CAN0_BA+0x88) /*!< IF2 Mask 1 Register */ - #define REG_CAN0_IF1_MASK2 (CAN0_BA+0x2C) /*!< IF1 Mask 2 Register */ - #define REG_CAN0_IF2_MASK2 (CAN0_BA+0x8C) /*!< IF2 Mask 2 REgister */ - #define REG_CAN0_IF1_ARB1 (CAN0_BA+0x30) /*!< IF1 Arbitration 1 Register */ - #define REG_CAN0_IF2_ARB1 (CAN0_BA+0x90) /*!< IF2 Arbitration 1 Register */ - #define REG_CAN0_IF1_ARB2 (CAN0_BA+0x34) /*!< IF1 Arbitration 2 Register */ - #define REG_CAN0_IF2_ARB2 (CAN0_BA+0x94) /*!< IF2 Arbitration 2 Register */ - #define REG_CAN0_IF1_MCON (CAN0_BA+0x38) /*!< IF1 Message Control Register */ - #define REG_CAN0_IF2_MCON (CAN0_BA+0x98) /*!< IF2 Message Control Register */ - #define REG_CAN0_IF1_DAT_A1 (CAN0_BA+0x3C) /*!< IF1 Data A1 Register */ - #define REG_CAN0_IF1_DAT_A2 (CAN0_BA+0x40) /*!< IF1 Data A2 Register */ - #define REG_CAN0_IF1_DAT_B1 (CAN0_BA+0x44) /*!< IF1 Data B1 Register */ - #define REG_CAN0_IF1_DAT_B2 (CAN0_BA+0x48) /*!< IF1 Data B2 Register */ - #define REG_CAN0_IF2_DAT_A1 (CAN0_BA+0x9C) /*!< IF2 Data A1 Register */ - #define REG_CAN0_IF2_DAT_A2 (CAN0_BA+0xA0) /*!< IF2 Data A2 Register */ - #define REG_CAN0_IF2_DAT_B1 (CAN0_BA+0xA4) /*!< IF2 Data B1 Register */ - #define REG_CAN0_IF2_DAT_B2 (CAN0_BA+0xA8) /*!< IF2 Data B2 Register */ - #define REG_CAN0_TXREQ1 (CAN0_BA+0x100) /*!< Transmission Request Register 1 */ - #define REG_CAN0_TXREQ2 (CAN0_BA+0x104) /*!< Transmission Request Register 2 */ - #define REG_CAN0_NDAT1 (CAN0_BA+0x120) /*!< New Data Register 1 */ - #define REG_CAN0_NDAT2 (CAN0_BA+0x124) /*!< New Data Register 2 */ - #define REG_CAN0_IPND1 (CAN0_BA+0x140) /*!< Interrupt Pending Register 1 */ - #define REG_CAN0_IPND2 (CAN0_BA+0x142) /*!< Interrupt Pending Register 2 */ - #define REG_CAN0_MVLD1 (CAN0_BA+0x160) /*!< Message Valid Register 1 */ - #define REG_CAN0_MVLD2 (CAN0_BA+0x164) /*!< Message Valid Register 2 */ - #define REG_CAN0_WU_EN (CAN0_BA+0x168) /*!< Wake-up Function Enable */ - #define REG_CAN0_WU_STATUS (CAN0_BA+0x16C) /*!< Wake-up Function Status */ - - #define REG_CAN1_CON (CAN1_BA+0x00) /*!< Control Register */ - #define REG_CAN1_STATUS (CAN1_BA+0x04) /*!< Status Register */ - #define REG_CAN1_ERR (CAN1_BA+0x08) /*!< Error Counter Register */ - #define REG_CAN1_BTIME (CAN1_BA+0x0C) /*!< Bit Time Register */ - #define REG_CAN1_IIDR (CAN1_BA+0x10) /*!< Interrupt Identifier Register */ - #define REG_CAN1_TEST (CAN1_BA+0x14) /*!< Test Register */ - #define REG_CAN1_BRPE (CAN1_BA+0x18) /*!< BRP Extension Register */ - #define REG_CAN1_IF1_CREQ (CAN1_BA+0x20) /*!< IF1 Command Request Register */ - #define REG_CAN1_IF2_CREQ (CAN1_BA+0x80) /*!< IF2 Command Request Register */ - #define REG_CAN1_IF1_CMASK (CAN1_BA+0x24) /*!< IF1 Command Mask Register */ - #define REG_CAN1_IF2_CMASK (CAN1_BA+0x84) /*!< IF2 Command Mask Register */ - #define REG_CAN1_IF1_MASK1 (CAN1_BA+0x28) /*!< IF1 Msak 1 Register */ - #define REG_CNA1_IF2_MASK1 (CAN1_BA+0x88) /*!< IF2 Mask 1 Register */ - #define REG_CAN1_IF1_MASK2 (CAN1_BA+0x2C) /*!< IF1 Mask 2 Register */ - #define REG_CAN1_IF2_MASK2 (CAN1_BA+0x8C) /*!< IF2 Mask 2 REgister */ - #define REG_CAN1_IF1_ARB1 (CAN1_BA+0x30) /*!< IF1 Arbitration 1 Register */ - #define REG_CAN1_IF2_ARB1 (CAN1_BA+0x90) /*!< IF2 Arbitration 1 Register */ - #define REG_CAN1_IF1_ARB2 (CAN1_BA+0x34) /*!< IF1 Arbitration 2 Register */ - #define REG_CAN1_IF2_ARB2 (CAN1_BA+0x94) /*!< IF2 Arbitration 2 Register */ - #define REG_CAN1_IF1_MCON (CAN1_BA+0x38) /*!< IF1 Message Control Register */ - #define REG_CAN1_IF2_MCON (CAN1_BA+0x98) /*!< IF2 Message Control Register */ - #define REG_CAN1_IF1_DAT_A1 (CAN1_BA+0x3C) /*!< IF1 Data A1 Register */ - #define REG_CAN1_IF1_DAT_A2 (CAN1_BA+0x40) /*!< IF1 Data A2 Register */ - #define REG_CAN1_IF1_DAT_B1 (CAN1_BA+0x44) /*!< IF1 Data B1 Register */ - #define REG_CAN1_IF1_DAT_B2 (CAN1_BA+0x48) /*!< IF1 Data B2 Register */ - #define REG_CAN1_IF2_DAT_A1 (CAN1_BA+0x9C) /*!< IF2 Data A1 Register */ - #define REG_CAN1_IF2_DAT_A2 (CAN1_BA+0xA0) /*!< IF2 Data A2 Register */ - #define REG_CAN1_IF2_DAT_B1 (CAN1_BA+0xA4) /*!< IF2 Data B1 Register */ - #define REG_CAN1_IF2_DAT_B2 (CAN1_BA+0xA8) /*!< IF2 Data B2 Register */ - #define REG_CAN1_TXREQ1 (CAN1_BA+0x100) /*!< Transmission Request Register 1 */ - #define REG_CAN1_TXREQ2 (CAN1_BA+0x104) /*!< Transmission Request Register 2 */ - #define REG_CAN1_NDAT1 (CAN1_BA+0x120) /*!< New Data Register 1 */ - #define REG_CAN1_NDAT2 (CAN1_BA+0x124) /*!< New Data Register 2 */ - #define REG_CAN1_IPND1 (CAN1_BA+0x140) /*!< Interrupt Pending Register 1 */ - #define REG_CAN1_IPND2 (CAN1_BA+0x142) /*!< Interrupt Pending Register 2 */ - #define REG_CAN1_MVLD1 (CAN1_BA+0x160) /*!< Message Valid Register 1 */ - #define REG_CAN1_MVLD2 (CAN1_BA+0x164) /*!< Message Valid Register 2 */ - #define REG_CAN1_WU_EN (CAN1_BA+0x168) /*!< Wake-up Function Enable */ - #define REG_CAN1_WU_STATUS (CAN1_BA+0x16C) /*!< Wake-up Function Status */ - - /**@}*/ /* end of CAN register group */ - - - /*------------------- Multi-Time Programmable Controller --------------------*/ - /** - @addtogroup MTP Multi-Time Programmable Controller (MTP) - Memory Mapped Structure for MTP Controller - @{ */ - - #define MTP_KEYEN (MTP_BA+0x000) /*!< MTP Key Enable Register */ - #define MTP_USERDATA (MTP_BA+0x00C) /*!< MTP User Defined Data Register */ - #define MTP_KEY0 (MTP_BA+0x010) /*!< MTP KEY 0 Register */ - #define MTP_KEY1 (MTP_BA+0x014) /*!< MTP KEY 1 Register */ - #define MTP_KEY2 (MTP_BA+0x018) /*!< MTP KEY 2 Register */ - #define MTP_KEY3 (MTP_BA+0x01C) /*!< MTP KEY 3 Register */ - #define MTP_KEY4 (MTP_BA+0x020) /*!< MTP KEY 4 Register */ - #define MTP_KEY5 (MTP_BA+0x024) /*!< MTP KEY 5 Register */ - #define MTP_KEY6 (MTP_BA+0x028) /*!< MTP KEY 6 Register */ - #define MTP_KEY7 (MTP_BA+0x02C) /*!< MTP KEY 7 Register */ - #define MTP_PCYCLE (MTP_BA+0x030) /*!< MTP Program Cycle Program Count Register */ - #define MTP_CTL (MTP_BA+0x034) /*!< MTP Control Register */ - #define MTP_PSTART (MTP_BA+0x038) /*!< MTP Program Start Registe */ - #define MTP_STATUS (MTP_BA+0x040) /*!< MTP Status Registe */ - #define MTP_REGLCTL (MTP_BA+0x050) /*!< MTP Register Write-Protection Control Register*/ - - /**@}*/ /* end of MTP register group */ - - - /*------------------- JPEG Controller --------------------*/ - /** - @addtogroup JPEG JPEG Controller (JPEG) - Memory Mapped Structure for JPEG Controller - @{ */ - #define JMCR (JPEG_BA+0x00) /*!< JPEG Mode Control Register */ - #define JHEADER (JPEG_BA+0x04) /*!< JPEG Encode Header Control Register */ - #define JITCR (JPEG_BA+0x08) /*!< JPEG Image Type Control Register */ - #define JPRIQC (JPEG_BA+0x10) /*!< JPEG Primary Q-Table Control Register */ - #define JTHBQC (JPEG_BA+0x14) /*!< JPEG Thumbnail Q-Table Control Register */ - #define JPRIWH (JPEG_BA+0x18) /*!< JPEG Encode Primary Width/Height Register */ - #define JTHBWH (JPEG_BA+0x1C) /*!< JPEG Encode Thumbnail Width/Height Register */ - #define JPRST (JPEG_BA+0x20) /*!< JPEG Encode Primary Restart Interval Register */ - #define JTRST (JPEG_BA+0x24) /*!< JPEG Encode Thumbnail Restart Interval */ - #define JDECWH (JPEG_BA+0x28) /*!< JPEG Decode Image Width/Height Register */ - #define JINTCR (JPEG_BA+0x2C) /*!< JPEG Interrupt Control and Status Register */ - #define JDOWFBS (JPEG_BA+0x3c) /*!< JPEG Decoding Output Wait Frame Buffer Size */ - #define JPEG_BSBAD (JPEG_BA+0x40) /*!< JPEG Test Control Register */ - #define JWINDEC0 (JPEG_BA+0x44) /*!< JPEG Window Decode Mode Control Register 0 */ - #define JWINDEC1 (JPEG_BA+0x48) /*!< JPEG Window Decode Mode Control Register 1 */ - #define JWINDEC2 (JPEG_BA+0x4C) /*!< JPEG Window Decode Mode Control Register 2 */ - #define JMACR (JPEG_BA+0x50) /*!< JPEG Memory Address Mode Control Register */ - #define JPSCALU (JPEG_BA+0x54) /*!< JPEG Primary Scaling-Up Control Register */ - #define JPSCALD (JPEG_BA+0x58) /*!< JPEG Primary Scaling-Down Control Register */ - #define JTSCALD (JPEG_BA+0x5C) /*!< JPEG Thumbnail Scaling-Down Control Register */ - #define JDBCR (JPEG_BA+0x60) /*!< JPEG Dual-Buffer Control Register */ - #define JRESERVE (JPEG_BA+0x70) /*!< JPEG Encode Primary Bit-stream Reserved Size Register */ - #define JOFFSET (JPEG_BA+0x74) /*!< JPEG Offset Between Primary & Thumbnail Register */ - #define JFSTRIDE (JPEG_BA+0x78) /*!< JPEG Encode Bit-stream Frame Stride Register */ - #define JYADDR0 (JPEG_BA+0x7C) /*!< JPEG Y Component Frame Buffer-0 Starting Address Register */ - #define JUADDR0 (JPEG_BA+0x80) /*!< JPEG U Component Frame Buffer-0 Starting Address Register */ - #define JVADDR0 (JPEG_BA+0x84) /*!< JPEG V Component Frame Buffer-0 Starting Address Register */ - #define JYADDR1 (JPEG_BA+0x88) /*!< JPEG Y Component Frame Buffer-1 Starting Address Register */ - #define JUADDR1 (JPEG_BA+0x8C) /*!< JPEG U Component Frame Buffer-1 Starting Address Register */ - #define JVADDR1 (JPEG_BA+0x90) /*!< JPEG V Component Frame Buffer-1 Starting Address Register */ - #define JYSTRIDE (JPEG_BA+0x94) /*!< JPEG Y Component Frame Buffer Stride Register */ - #define JUSTRIDE (JPEG_BA+0x98) /*!< JPEG U Component Frame Buffer Stride Register */ - #define JVSTRIDE (JPEG_BA+0x9C) /*!< JPEG V Component Frame Buffer Stride Register */ - #define JIOADDR0 (JPEG_BA+0xA0) /*!< JPEG Bit-stream Frame Buffer-0 Starting Address Register */ - #define JIOADDR1 (JPEG_BA+0xA4) /*!< JPEG Bit-stream Frame Buffer-1 Starting Address Register */ - #define JPRI_SIZE (JPEG_BA+0xA8) /*!< JPEG Encode Primary Image Bit-stream Size Register */ - #define JTHB_SIZE (JPEG_BA+0xAC) /*!< JPEG Encode Thumbnail Image Bit-stream Size Register */ - #define JUPRAT (JPEG_BA+0xB0) /*!< JPEG Encode Up-Scale Ratio Register */ - #define JBSFIFO (JPEG_BA+0xB4) /*!< JPEG Bit-stream FIFO Control Register */ - #define JSRCH (JPEG_BA+0xB8) /*!< JPEG Encode Source Image Height */ - #define JQTAB0 (JPEG_BA+0x100) /*!< JPEG Quantization-Table 0 Register */ - #define JQTAB1 (JPEG_BA+0x140) /*!< JPEG Quantization-Table 1 Register */ - #define JQTAB2 (JPEG_BA+0x180) /*!< JPEG Quantization-Table 2 Register */ - - /**@}*/ /* end of JPEG register group */ - - - - /*@}*/ /* end of group N9H30_Peripherals */ - - - /** @addtogroup N9H30_IO_ROUTINE N9H30 I/O Routines - The Declaration of N9H30 I/O Routines - @{ - */ - - typedef volatile unsigned char vu8; ///< Define 8-bit unsigned volatile data type - typedef volatile unsigned short vu16; ///< Define 16-bit unsigned volatile data type - typedef volatile unsigned long vu32; ///< Define 32-bit unsigned volatile data type - - /** - * @brief Get a 8-bit unsigned value from specified address - * @param[in] addr Address to get 8-bit data from - * @return 8-bit unsigned value stored in specified address - */ - #define M8(addr) (*((vu8 *) (addr))) - - /** - * @brief Get a 16-bit unsigned value from specified address - * @param[in] addr Address to get 16-bit data from - * @return 16-bit unsigned value stored in specified address - * @note The input address must be 16-bit aligned - */ - #define M16(addr) (*((vu16 *) (addr))) - - /** - * @brief Get a 32-bit unsigned value from specified address - * @param[in] addr Address to get 32-bit data from - * @return 32-bit unsigned value stored in specified address - * @note The input address must be 32-bit aligned - */ - #define M32(addr) (*((vu32 *) (addr))) - - /** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ - #define outpw(port,value) *((volatile unsigned int *)(port)) = value - - /** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ - #define inpw(port) (*((volatile unsigned int *)(port))) - - /** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ - #define outps(port,value) *((volatile unsigned short *)(port)) = value - - /** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ - #define inps(port) (*((volatile unsigned short *)(port))) - - /** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ - #define outpb(port,value) *((volatile unsigned char *)(port)) = value - - /** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ - #define inpb(port) (*((volatile unsigned char *)(port))) - - /** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ - #define outp32(port,value) *((volatile unsigned int *)(port)) = value - - /** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ - #define inp32(port) (*((volatile unsigned int *)(port))) - - /** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ - #define outp16(port,value) *((volatile unsigned short *)(port)) = value - - /** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ - #define inp16(port) (*((volatile unsigned short *)(port))) - - /** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ - #define outp8(port,value) *((volatile unsigned char *)(port)) = value - - /** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ - #define inp8(port) (*((volatile unsigned char *)(port))) - - - /*@}*/ /* end of group N9H30_IO_ROUTINE */ - - /******************************************************************************/ - /* Legacy Constants */ - /******************************************************************************/ - /** @addtogroup N9H30_legacy_Constants N9H30 Legacy Constants - N9H30 Legacy Constants - @{ - */ - typedef void *PVOID; ///< Define void pointer data type - typedef void VOID; ///< Define void data type - typedef char BOOL; ///< Define bool data type - typedef char *PBOOL; ///< Define bool pointer data type - - typedef char INT8; ///< Define 8-bit singed data type - typedef char CHAR; ///< Define char data type - typedef char *PINT8; ///< Define 8-bit singed pointer data type - typedef char *PCHAR; ///< Define char pointer data type - typedef unsigned char UINT8; ///< Define 8-bit unsigned data type - typedef unsigned char UCHAR; ///< Define char unsigned data type - typedef unsigned char *PUINT8; ///< Define 8-bit unsigned pointer data type - typedef unsigned char *PUCHAR; ///< Define char unsigned pointer data type - typedef char *PSTR; ///< Define string pointer data type - typedef const char *PCSTR; ///< Define constant string pointer data type - - typedef short SHORT; ///< Define short signed data type - typedef short *PSHORT; ///< Define short signed pointer data type - typedef unsigned short USHORT; ///< Define short unsigned data type - typedef unsigned short *PUSHORT; ///< Define short unsigned pointer data type - - typedef short INT16; ///< Define 16-bit signed data type - typedef short *PINT16; ///< Define 16-bit signed pointer data type - typedef unsigned short UINT16; ///< Define 16-bit unsigned data type - typedef unsigned short *PUINT16; ///< Define 16-bit unsigned pointer data type - - typedef int INT; ///< Define integer signed data type - typedef int *PINT; ///< Define integer signed pointer data type - typedef unsigned int UINT; ///< Define integer unsigned data type - typedef unsigned int *PUINT; ///< Define integer unsigned pointer data type - - typedef int INT32; ///< Define 32-bit signed data type - typedef int *PINT32; ///< Define 32-bit signed pointer data type - typedef unsigned int UINT32; ///< Define 32-bit unsigned data type - typedef unsigned int *PUINT32; ///< Define 32-bit unsigned pointer data type - - #if defined ( __GNUC__ ) && !(__CC_ARM) - typedef long long INT64; - typedef unsigned long long UINT64; - #else - typedef __int64 INT64; ///< Define 64-bit signed data type - typedef unsigned __int64 UINT64; ///< Define 64-bit unsigned data type - #endif - - typedef float FLOAT; ///< Define float data type - typedef float *PFLOAT; ///< Define float pointer data type - - typedef double DOUBLE; ///< Define double data type - typedef double *PDOUBLE; ///< Define double pointer data type - - typedef int SIZE_T; ///< Define size of data type - - typedef unsigned char REG8; ///< Define 8-bit register data type - typedef unsigned short REG16; ///< Define 16-bit register data type - typedef unsigned int REG32; ///< Define 32-bit register data type - - - #ifndef NULL - #define NULL (0) ///< NULL pointer - #endif - - #define TRUE (1) ///< Boolean true, define to use in API parameters or return value - #define FALSE (0) ///< Boolean false, define to use in API parameters or return value - - #define ENABLE (1) ///< Enable, define to use in API parameters - #define DISABLE (0) ///< Disable, define to use in API parameters - - - #define Successful 0 ///< Function return value success - #define Fail 1 ///< Function return value failed - - /* Define one bit mask */ - #define BIT0 (0x00000001) ///< Bit 0 mask of an 32 bit integer - #define BIT1 (0x00000002) ///< Bit 1 mask of an 32 bit integer - #define BIT2 (0x00000004) ///< Bit 2 mask of an 32 bit integer - #define BIT3 (0x00000008) ///< Bit 3 mask of an 32 bit integer - #define BIT4 (0x00000010) ///< Bit 4 mask of an 32 bit integer - #define BIT5 (0x00000020) ///< Bit 5 mask of an 32 bit integer - #define BIT6 (0x00000040) ///< Bit 6 mask of an 32 bit integer - #define BIT7 (0x00000080) ///< Bit 7 mask of an 32 bit integer - #define BIT8 (0x00000100) ///< Bit 8 mask of an 32 bit integer - #define BIT9 (0x00000200) ///< Bit 9 mask of an 32 bit integer - #define BIT10 (0x00000400) ///< Bit 10 mask of an 32 bit integer - #define BIT11 (0x00000800) ///< Bit 11 mask of an 32 bit integer - #define BIT12 (0x00001000) ///< Bit 12 mask of an 32 bit integer - #define BIT13 (0x00002000) ///< Bit 13 mask of an 32 bit integer - #define BIT14 (0x00004000) ///< Bit 14 mask of an 32 bit integer - #define BIT15 (0x00008000) ///< Bit 15 mask of an 32 bit integer - #define BIT16 (0x00010000) ///< Bit 16 mask of an 32 bit integer - #define BIT17 (0x00020000) ///< Bit 17 mask of an 32 bit integer - #define BIT18 (0x00040000) ///< Bit 18 mask of an 32 bit integer - #define BIT19 (0x00080000) ///< Bit 19 mask of an 32 bit integer - #define BIT20 (0x00100000) ///< Bit 20 mask of an 32 bit integer - #define BIT21 (0x00200000) ///< Bit 21 mask of an 32 bit integer - #define BIT22 (0x00400000) ///< Bit 22 mask of an 32 bit integer - #define BIT23 (0x00800000) ///< Bit 23 mask of an 32 bit integer - #define BIT24 (0x01000000) ///< Bit 24 mask of an 32 bit integer - #define BIT25 (0x02000000) ///< Bit 25 mask of an 32 bit integer - #define BIT26 (0x04000000) ///< Bit 26 mask of an 32 bit integer - #define BIT27 (0x08000000) ///< Bit 27 mask of an 32 bit integer - #define BIT28 (0x10000000) ///< Bit 28 mask of an 32 bit integer - #define BIT29 (0x20000000) ///< Bit 29 mask of an 32 bit integer - #define BIT30 (0x40000000) ///< Bit 30 mask of an 32 bit integer - #define BIT31 (0x80000000) ///< Bit 31 mask of an 32 bit integer - - /* Byte Mask Definitions */ - #define BYTE0_Msk (0x000000FF) ///< Mask to get bit0~bit7 from a 32 bit integer - #define BYTE1_Msk (0x0000FF00) ///< Mask to get bit8~bit15 from a 32 bit integer - #define BYTE2_Msk (0x00FF0000) ///< Mask to get bit16~bit23 from a 32 bit integer - #define BYTE3_Msk (0xFF000000) ///< Mask to get bit24~bit31 from a 32 bit integer - - #define GET_BYTE0(u32Param) ((u32Param & BYTE0_Msk) ) /*!< Extract Byte 0 (Bit 0~ 7) from parameter u32Param */ - #define GET_BYTE1(u32Param) ((u32Param & BYTE1_Msk) >> 8) /*!< Extract Byte 1 (Bit 8~15) from parameter u32Param */ - #define GET_BYTE2(u32Param) ((u32Param & BYTE2_Msk) >> 16) /*!< Extract Byte 2 (Bit 16~23) from parameter u32Param */ - #define GET_BYTE3(u32Param) ((u32Param & BYTE3_Msk) >> 24) /*!< Extract Byte 3 (Bit 24~31) from parameter u32Param */ - - #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 */ - - extern void __nop(void); - -#endif /* __N9H30_H__ */ - -/*@}*/ /* end of group N9H30_legacy_Constants */ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/NuMicro.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/NuMicro.h deleted file mode 100644 index 6e949c843db..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/NuMicro.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************//** - * @file NuMicro.h - * @version V1.00 - * @brief NuMicro peripheral access layer header file. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NUMICRO_H__ -#define __NUMICRO_H__ - -#include "N9H30.h" -#include "nu_adc.h" -#include "nu_uart.h" -#include "nu_spi.h" -#include "nu_i2c.h" -#include "nu_etimer.h" -#include "nu_emac.h" -#include "nu_sdh.h" -#include "nu_gpio.h" -#include "nu_rtc.h" -#include "nu_wdt.h" -//#include "nu_ebi.h" -#include "nu_scuart.h" -#include "nu_pwm.h" -//#include "nu_crypto.h" -#include "nu_can.h" -#include "nu_i2s.h" -#include "nu_usbd.h" -#include "nu_lcd.h" -#include "nu_jpegcodec.h" -#include "nu_2d.h" -#include "nu_crypto.h" - -#include "nu_sys.h" - -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif - -#ifndef __CLZ - #if defined(__CC_ARM) - #define __CLZ __clz - #else - #define __CLZ __builtin_clz - #endif -#endif - -#endif /* __NUMICRO_H__ */ - - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/adc_reg.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/adc_reg.h deleted file mode 100644 index 4637bb5d190..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/adc_reg.h +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************//** - * @file adc.h - * @brief ADC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020~2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __ADC_REG_H__ -#define __ADC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ADC Analog to Digital Converter(ADC) - Memory Mapped Structure for ADC Controller -@{ */ - -typedef struct -{ - - - /** - * @var ADC_T::CTL - * Offset: 0x00 ADC Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADEN |ADC Power Control - * | | |0 = Power down ADC. - * | | |1 = Power on ADC. - * |[8] |MST |Menu Start Conversion - * | | |0 = Functional menu not started. - * | | |1 = Start all enable bit in ADC_CONF register. - * | | |Note: This bit is set by software and cleared by hardware when all the tasks listed in ADC_CONF are done. - * |[9] |PEDEEN |Pen Down Event Enable Bit - * | | |0 = Pen down event interrupt Disabled. - * | | |1 = Pen down event interrupt Enabled. - * |[11] |WKTEN |Touch Wake Up Enable Bit - * | | |0 = Touch wake-up Disabled. - * | | |1 = Touch wake-up Enabled. - * |[16] |WMSWCH |Wire Mode Switch for 5-wire/4-wire Configuration - * | | |0 = 4-wire mode. - * | | |1 = 5-wire mode. - * @var ADC_T::CONF - * Offset: 0x04 ADC Configure - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TEN |Touch Detection Enable Bit - * | | |0 = Touch detection function Disabled. - * | | |1 = Touch detection function Enabled. - * |[1] |ZEN |Press Measure Enable Bit - * | | |1 = Press measure function Disabled. - * | | |1 = Press measure function Enabled. - * |[2] |NACEN |Normal A/D Conversion Enable Bit - * | | |ADC normal conversion function enable - * | | |0 = Normal A/D Conversion Disabled. - * | | |1 = Normal A/D Conversion Enabled. - * |[7:6] |REFSEL |ADC Reference Select - * | | |ADC reference voltage select when ADC operate in normal conversion. - * | | |00 = AGND33 vs VREF input. - * | | |01 = YM vs YP. - * | | |10 = XM vs XP. - * | | |11 = AGND33 vs AVDD33. - * |[14:12] |CHSEL |Channel Selection - * | | |ADC input channel selection. - * | | |000 = VREF. - * | | |001 = A1. - * | | |010 = A2. - * | | |011 = VSENSE. - * | | |100 = YM. - * | | |101 = YP. - * | | |110 = XM. - * | | |111 = XP. - * |[20] |TMAVDIS |Display T Mean Average Disable Bit - * | | |Touch mean average for X and Y function disable bit. - * | | |0 = Touch mean average for X and Y function Enabled. - * | | |1 = Touch mean average for X and Y function Disabled. - * |[21] |ZMAVDIS |Display Z Mean Average Disable Bit - * | | |Pressure mean average for Z1 and Z2 function disable bit. - * | | |0 = Pressure mean average for Z1 and Z2 function Enabled. - * | | |1 = Pressure mean average for Z1 and Z2 function Disabled. - * |[22] |SPEED |Speed Mode Selection - * | | |0 = All ADC channels set to high speed mode. - * | | |1 = All ADC channels set to low speed mode. - * @var ADC_T::IER - * Offset: 0x08 ADC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MIEN |Menu Interrupt Enable Bit - * | | |Function menu complete interrupt enable. - * | | |0 = Menu interrupt Disabled. - * | | |1 = Menu interrupt Enabled. - * |[2] |PEDEIEN |Pen Down Event Interrupt Enable Bit - * | | |0 = Pen down event detection interrupt Disabled. - * | | |1 = Pen down event detection interrupt Enabled. - * |[3] |WKTIEN |Wake Up Touch Interrupt Enable Bit - * | | |0 = Wake up touch detection interrupt Disabled. - * | | |1 = Wake up touch detection interrupt Enabled. - * |[6] |PEUEIEN |Pen Up Event Interrupt Enable Bit - * | | |0 = Pen up event detection interrupt Disabled. - * | | |1 = Pen up event detection interrupt Enabled. - * @var ADC_T::ISR - * Offset: 0x0C ADC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MF |Menu Complete Flag - * | | |Function menu complete status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[2] |PEDEF |Pen Down Event Flag - * | | |Pen down event status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[4] |PEUEF |Pen Up Event Flag - * | | |Pen up event status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[8] |TF |Touch Conversion Finish - * | | |Functional menu touch detection conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[9] |ZF |Press Conversion Finish - * | | |Functional menu press measure conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[10] |NACF |Normal AD Conversion Finish - * | | |Functional menu normal AD conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[17] |INTTC |Interrupt Signal for Touch Screen Touching Detection - * | | |This signal is directly from analog macro without de-bouncing and can be used to determine the pen down touch event together with PEDEF (ADC_ISR[2]) flag. - * @var ADC_T::WKISR - * Offset: 0x10 ADC Wake-up interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |WPEDEF |Wake Up Pen Down Event Flag - * | | |Pen down event wake up status indicator. - * @var ADC_T::XYDATA - * Offset: 0x20 ADC Touch X,Y Position Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XDATA |ADC X Data - * | | |When TEN (ADC_CONF[0]) is set, the touch x-position will be stored in this register. - * | | |Note: If the TMAVDIS (ADC_CONF[20]) = 0, both x and y position are the results of the mean average of x and y in ADC_XYSORT0 ~ ADC_XYSORT3. - * |[27:16] |YDATA |ADC Y Data - * | | |When TEN (ADC_CONF[0]) is set, the touch y-position will be stored in this register. - * | | |Note: If the TMAVDIS (ADC_CONF[20]) = 0, both x and y position are the results of the mean average of x and y in ADC_XYSORT0 ~ ADC_XYSORT3. - * @var ADC_T::ZDATA - * Offset: 0x24 ADC Touch Z Pressure Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1DATA |ADC Z1 Data - * | | |When ZEN (ADC_CONF[1]) is set; the touch pressure measure Z1 will be stored in this register. - * | | |Note: If the ZMAVDIS (ADC_CONF[21]) = 0, both Z1 and Z2 data is the results of the mean average of Z1 and Z2 in ADC_ZSORT0 ~ ADC_ZSORT3. - * |[27:16] |Z2DATA |ADC Z2 Data - * | | |When ZEN (ADC_CONF[1]) is set; the touch pressure measure Z2 will be stored in this register. - * | | |Note: If the ZMAVDIS (ADC_CONF[21]) = 0, both Z1 and Z2 data is the results of the mean average of Z1 and Z2 in ADC_ZSORT0 ~ ADC_ZSORT3. - * @var ADC_T::DATA - * Offset: 0x28 ADC Normal Conversion Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ADCDATA |ADC Data - * | | |When NACEN (ADC_CONF[2]) is enabled, the AD converting result with corresponding channel is stored in this register. - * @var ADC_T::XYSORT0 - * Offset: 0x1F4 ADC Touch XY Position Mean Value Sort 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT0 |X Position Sort Data 0 - * | | |X position mean average sort data 0. - * |[27:16] |YSORT0 |Y Position Sort Data 0 - * | | |Y position mean average sort data 0. - * @var ADC_T::XYSORT1 - * Offset: 0x1F8 ADC Touch XY Position Mean Value Sort 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT1 |X Position Sort Data 1 - * | | |X position mean average sort data 1. - * |[27:16] |YSORT1 |Y Position Sort Data 1 - * | | |Y position mean average sort data 1. - * @var ADC_T::XYSORT2 - * Offset: 0x1FC ADC Touch XY Position Mean Value Sort 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT2 |X Position Sort Data 2 - * | | |X position mean average sort data 2. - * |[27:16] |YSORT2 |Y Position Sort Data 2 - * | | |Y position mean average sort data 2. - * @var ADC_T::XYSORT3 - * Offset: 0x200 ADC Touch XY Position Mean Value Sort 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT3 |X Position Sort Data 3 - * | | |X position mean average sort data 3. - * |[27:16] |YSORT3 |Y Position Sort Data 3 - * | | |Y position mean average sort data 3. - * @var ADC_T::ZSORT0 - * Offset: 0x204 ADC Touch Z Pressure Mean Value Sort 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT0 |Z1 Position Sort Data 0 - * | | |Z1 position Mean average sort data 0. - * |[27:16] |Z2SORT0 |Z2 Position Sort Data 0 - * | | |Z2 position Mean average sort data 0. - * @var ADC_T::ZSORT1 - * Offset: 0x208 ADC Touch Z Pressure Mean Value Sort 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT1 |Z1 Position Sort Data 1 - * | | |Z1 position Mean average sort data 1. - * |[27:16] |Z2SORT1 |Z2 Position Sort Data 1 - * | | |Z2 position Mean average sort data 1. - * @var ADC_T::ZSORT2 - * Offset: 0x20C ADC Touch Z Pressure Mean Value Sort 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT2 |Z1 Position Sort Data 2 - * | | |Z1 position Mean average sort data 2. - * |[27:16] |Z2SORT2 |Z2 Position Sort Data 2 - * | | |Z2 position Mean average sort data 2. - * @var ADC_T::ZSORT3 - * Offset: 0x210 ADC Touch Z Pressure Mean Value Sort 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT3 |Z1 Position Sort Data 3 - * | | |Z1 position Mean average sort data 3. - * |[27:16] |Z2SORT3 |Z2 Position Sort Data 3 - * | | |Z2 position Mean average sort data 3. - */ - __IO uint32_t CTL; /*!< [0x0000] ADC Control */ - __IO uint32_t CONF; /*!< [0x0004] ADC Configure */ - __IO uint32_t IER; /*!< [0x0008] ADC Interrupt Enable Register */ - __IO uint32_t ISR; /*!< [0x000c] ADC Interrupt Status Register */ - __I uint32_t WKISR; /*!< [0x0010] ADC Wake-up interrupt Status Register */ - __I uint32_t RESERVE0[3]; - __I uint32_t XYDATA; /*!< [0x0020] ADC Touch X,Y Position Data */ - __I uint32_t ZDATA; /*!< [0x0024] ADC Touch Z Pressure Data */ - __I uint32_t DATA; /*!< [0x0028] ADC Normal Conversion Data */ - __I uint32_t RESERVE1[114]; - __I uint32_t XYSORT[4]; /*!< [0x01f4~0x0200] ADC Touch XY Position Mean Value Sort Register */ - __I uint32_t ZSORT0[4]; /*!< [0x0204~0x0210] ADC Touch Z Pressure Mean Value Sort Register */ - -} ADC_T; - -/** - @addtogroup ADC_CONST ADC Bit Field Definition - Constant Definitions for ADC Controller -@{ */ - -#define ADC_CTL_ADEN_Pos (0) /*!< ADC_T::CTL: ADEN Position */ -#define ADC_CTL_ADEN_Msk (0x1ul << ADC_CTL_ADEN_Pos) /*!< ADC_T::CTL: ADEN Mask */ - -#define ADC_CTL_MST_Pos (8) /*!< ADC_T::CTL: MST Position */ -#define ADC_CTL_MST_Msk (0x1ul << ADC_CTL_MST_Pos) /*!< ADC_T::CTL: MST Mask */ - -#define ADC_CTL_PEDEEN_Pos (9) /*!< ADC_T::CTL: PEDEEN Position */ -#define ADC_CTL_PEDEEN_Msk (0x1ul << ADC_CTL_PEDEEN_Pos) /*!< ADC_T::CTL: PEDEEN Mask */ - -#define ADC_CTL_WKTEN_Pos (11) /*!< ADC_T::CTL: WKTEN Position */ -#define ADC_CTL_WKTEN_Msk (0x1ul << ADC_CTL_WKTEN_Pos) /*!< ADC_T::CTL: WKTEN Mask */ - -#define ADC_CTL_WMSWCH_Pos (16) /*!< ADC_T::CTL: WMSWCH Position */ -#define ADC_CTL_WMSWCH_Msk (0x1ul << ADC_CTL_WMSWCH_Pos) /*!< ADC_T::CTL: WMSWCH Mask */ - -#define ADC_CONF_TEN_Pos (0) /*!< ADC_T::CONF: TEN Position */ -#define ADC_CONF_TEN_Msk (0x1ul << ADC_CONF_TEN_Pos) /*!< ADC_T::CONF: TEN Mask */ - -#define ADC_CONF_ZEN_Pos (1) /*!< ADC_T::CONF: ZEN Position */ -#define ADC_CONF_ZEN_Msk (0x1ul << ADC_CONF_ZEN_Pos) /*!< ADC_T::CONF: ZEN Mask */ - -#define ADC_CONF_NACEN_Pos (2) /*!< ADC_T::CONF: NACEN Position */ -#define ADC_CONF_NACEN_Msk (0x1ul << ADC_CONF_NACEN_Pos) /*!< ADC_T::CONF: NACEN Mask */ - -#define ADC_CONF_REFSEL_Pos (6) /*!< ADC_T::CONF: REFSEL Position */ -#define ADC_CONF_REFSEL_Msk (0x3ul << ADC_CONF_REFSEL_Pos) /*!< ADC_T::CONF: REFSEL Mask */ - -#define ADC_CONF_CHSEL_Pos (12) /*!< ADC_T::CONF: CHSEL Position */ -#define ADC_CONF_CHSEL_Msk (0x7ul << ADC_CONF_CHSEL_Pos) /*!< ADC_T::CONF: CHSEL Mask */ - -#define ADC_CONF_TMAVDIS_Pos (20) /*!< ADC_T::CONF: TMAVDIS Position */ -#define ADC_CONF_TMAVDIS_Msk (0x1ul << ADC_CONF_TMAVDIS_Pos) /*!< ADC_T::CONF: TMAVDIS Mask */ - -#define ADC_CONF_ZMAVDIS_Pos (21) /*!< ADC_T::CONF: ZMAVDIS Position */ -#define ADC_CONF_ZMAVDIS_Msk (0x1ul << ADC_CONF_ZMAVDIS_Pos) /*!< ADC_T::CONF: ZMAVDIS Mask */ - -#define ADC_CONF_SPEED_Pos (22) /*!< ADC_T::CONF: SPEED Position */ -#define ADC_CONF_SPEED_Msk (0x1ul << ADC_CONF_SPEED_Pos) /*!< ADC_T::CONF: SPEED Mask */ - -#define ADC_IER_MIEN_Pos (0) /*!< ADC_T::IER: MIEN Position */ -#define ADC_IER_MIEN_Msk (0x1ul << ADC_IER_MIEN_Pos) /*!< ADC_T::IER: MIEN Mask */ - -#define ADC_IER_PEDEIEN_Pos (2) /*!< ADC_T::IER: PEDEIEN Position */ -#define ADC_IER_PEDEIEN_Msk (0x1ul << ADC_IER_PEDEIEN_Pos) /*!< ADC_T::IER: PEDEIEN Mask */ - -#define ADC_IER_WKTIEN_Pos (3) /*!< ADC_T::IER: WKTIEN Position */ -#define ADC_IER_WKTIEN_Msk (0x1ul << ADC_IER_WKTIEN_Pos) /*!< ADC_T::IER: WKTIEN Mask */ - -#define ADC_IER_PEUEIEN_Pos (6) /*!< ADC_T::IER: PEUEIEN Position */ -#define ADC_IER_PEUEIEN_Msk (0x1ul << ADC_IER_PEUEIEN_Pos) /*!< ADC_T::IER: PEUEIEN Mask */ - -#define ADC_ISR_MF_Pos (0) /*!< ADC_T::ISR: MF Position */ -#define ADC_ISR_MF_Msk (0x1ul << ADC_ISR_MF_Pos) /*!< ADC_T::ISR: MF Mask */ - -#define ADC_ISR_PEDEF_Pos (2) /*!< ADC_T::ISR: PEDEF Position */ -#define ADC_ISR_PEDEF_Msk (0x1ul << ADC_ISR_PEDEF_Pos) /*!< ADC_T::ISR: PEDEF Mask */ - -#define ADC_ISR_PEUEF_Pos (4) /*!< ADC_T::ISR: PEUEF Position */ -#define ADC_ISR_PEUEF_Msk (0x1ul << ADC_ISR_PEUEF_Pos) /*!< ADC_T::ISR: PEUEF Mask */ - -#define ADC_ISR_TF_Pos (8) /*!< ADC_T::ISR: TF Position */ -#define ADC_ISR_TF_Msk (0x1ul << ADC_ISR_TF_Pos) /*!< ADC_T::ISR: TF Mask */ - -#define ADC_ISR_ZF_Pos (9) /*!< ADC_T::ISR: ZF Position */ -#define ADC_ISR_ZF_Msk (0x1ul << ADC_ISR_ZF_Pos) /*!< ADC_T::ISR: ZF Mask */ - -#define ADC_ISR_NACF_Pos (10) /*!< ADC_T::ISR: NACF Position */ -#define ADC_ISR_NACF_Msk (0x1ul << ADC_ISR_NACF_Pos) /*!< ADC_T::ISR: NACF Mask */ - -#define ADC_ISR_INTTC_Pos (17) /*!< ADC_T::ISR: INTTC Position */ -#define ADC_ISR_INTTC_Msk (0x1ul << ADC_ISR_INTTC_Pos) /*!< ADC_T::ISR: INTTC Mask */ - -#define ADC_WKISR_WPEDEF_Pos (1) /*!< ADC_T::WKISR: WPEDEF Position */ -#define ADC_WKISR_WPEDEF_Msk (0x1ul << ADC_WKISR_WPEDEF_Pos) /*!< ADC_T::WKISR: WPEDEF Mask */ - -#define ADC_XYDATA_XDATA_Pos (0) /*!< ADC_T::XYDATA: XDATA Position */ -#define ADC_XYDATA_XDATA_Msk (0xffful << ADC_XYDATA_XDATA_Pos) /*!< ADC_T::XYDATA: XDATA Mask */ - -#define ADC_XYDATA_YDATA_Pos (16) /*!< ADC_T::XYDATA: YDATA Position */ -#define ADC_XYDATA_YDATA_Msk (0xffful << ADC_XYDATA_YDATA_Pos) /*!< ADC_T::XYDATA: YDATA Mask */ - -#define ADC_ZDATA_Z1DATA_Pos (0) /*!< ADC_T::ZDATA: Z1DATA Position */ -#define ADC_ZDATA_Z1DATA_Msk (0xffful << ADC_ZDATA_Z1DATA_Pos) /*!< ADC_T::ZDATA: Z1DATA Mask */ - -#define ADC_ZDATA_Z2DATA_Pos (16) /*!< ADC_T::ZDATA: Z2DATA Position */ -#define ADC_ZDATA_Z2DATA_Msk (0xffful << ADC_ZDATA_Z2DATA_Pos) /*!< ADC_T::ZDATA: Z2DATA Mask */ - -#define ADC_DATA_ADCDATA_Pos (0) /*!< ADC_T::DATA: ADCDATA Position */ -#define ADC_DATA_ADCDATA_Msk (0xffful << ADC_DATA_ADCDATA_Pos) /*!< ADC_T::DATA: ADCDATA Mask */ - -#define ADC_XYSORT_XSORT_Pos (0) /*!< ADC_T::XYSORT: XSORT Position */ -#define ADC_XYSORT_XSORT_Msk (0xffful << ADC_XYSORT_XSORT_Pos) /*!< ADC_T::XYSORT: XSORT Mask */ - -#define ADC_XYSORT_YSORT_Pos (16) /*!< ADC_T::XYSORT: YSORT Position */ -#define ADC_XYSORT_YSORT_Msk (0xffful << ADC_XYSORT_YSORT_Pos) /*!< ADC_T::XYSORT: YSORT Mask */ - -#define ADC_ZSORT_Z1SORT_Pos (0) /*!< ADC_T::ZSORT: Z1SORT Position */ -#define ADC_ZSORT_Z1SORT_Msk (0xffful << ADC_ZSORT_Z1SORT_Pos) /*!< ADC_T::ZSORT: Z1SORT Mask */ - -#define ADC_ZSORT_Z2SORT_Pos (16) /*!< ADC_T::ZSORT: Z2SORT Position */ -#define ADC_ZSORT_Z2SORT_Msk (0xffful << ADC_ZSORT_Z2SORT_Pos) /*!< ADC_T::ZSORT: Z2SORT Mask */ - -/**@}*/ /* ADC_CONST */ -/**@}*/ /* end of ADC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif //__ADC_REG_H__ - - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/emac_reg.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/emac_reg.h deleted file mode 100644 index f9ad5efceb5..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/emac_reg.h +++ /dev/null @@ -1,2063 +0,0 @@ -/**************************************************************************//** - * @file emac_reg.h - * @version V1.00 - * @brief EMAC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EMAC_REG_H__ -#define __EMAC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EMAC Ethernet MAC Controller(EMAC) - Memory Mapped Structure for EMAC Controller -@{ */ - -typedef struct -{ - - /** - * @var EMAC_T::CAMCTL - * Offset: 0x00 CAM Comparison Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AUP |Accept Unicast Packet - * | | |The AUP controls the unicast packet reception - * | | |If AUP is enabled, EMAC receives all incoming packet its destination MAC address is a unicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all unicast packets. - * |[1] |AMP |Accept Multicast Packet - * | | |The AMP controls the multicast packet reception - * | | |If AMP is enabled, EMAC receives all incoming packet its destination MAC address is a multicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all multicast packets. - * |[2] |ABP |Accept Broadcast Packet - * | | |The ABP controls the broadcast packet reception - * | | |If ABP is enabled, EMAC receives all incoming packet its destination MAC address is a broadcast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all broadcast packets. - * |[3] |COMPEN |Complement CAM Comparison Enable Bit - * | | |The COMPEN controls the complement of the CAM comparison result - * | | |If the CMPEN and COMPEN are both enabled, the incoming packet with specific destination MAC address - * | | |configured in CAM entry will be dropped - * | | |And the incoming packet with destination MAC address does not configured in any CAM entry will be received. - * | | |0 = Complement CAM comparison result Disabled. - * | | |1 = Complement CAM comparison result Enabled. - * |[4] |CMPEN |CAM Compare Enable Bit - * | | |The CMPEN controls the enable of CAM comparison function for destination MAC address recognition - * | | |If software wants to receive a packet with specific destination MAC address, configures the MAC address - * | | |into CAM 12~0, then enables that CAM entry and set CMPEN to 1. - * | | |0 = CAM comparison function for destination MAC address recognition Disabled. - * | | |1 = CAM comparison function for destination MAC address recognition Enabled. - * @var EMAC_T::CAMEN - * Offset: 0x04 CAM Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAMxEN |CAM Entry X Enable Bit - * | | |The CAMxEN controls the validation of CAM entry x. - * | | |The CAM entry 13, 14 and 15 are for PAUSE control frame transmission - * | | |If software wants to transmit a PAUSE control frame out to network, the enable bits of these three CAM - * | | |entries all must be enabled first. - * | | |0 = CAM entry x Disabled. - * | | |1 = CAM entry x Enabled. - * @var EMAC_T::CAM0M - * Offset: 0x08 CAM0 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM0L - * Offset: 0x0C CAM0 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1M - * Offset: 0x10 CAM1 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1L - * Offset: 0x14 CAM1 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2M - * Offset: 0x18 CAM2 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2L - * Offset: 0x1C CAM2 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3M - * Offset: 0x20 CAM3 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3L - * Offset: 0x24 CAM3 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4M - * Offset: 0x28 CAM4 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4L - * Offset: 0x2C CAM4 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5M - * Offset: 0x30 CAM5 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5L - * Offset: 0x34 CAM5 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6M - * Offset: 0x38 CAM6 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6L - * Offset: 0x3C CAM6 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7M - * Offset: 0x40 CAM7 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7L - * Offset: 0x44 CAM7 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8M - * Offset: 0x48 CAM8 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8L - * Offset: 0x4C CAM8 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9M - * Offset: 0x50 CAM9 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9L - * Offset: 0x54 CAM9 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10M - * Offset: 0x58 CAM10 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10L - * Offset: 0x5C CAM10 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11M - * Offset: 0x60 CAM11 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11L - * Offset: 0x64 CAM11 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12M - * Offset: 0x68 CAM12 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12L - * Offset: 0x6C CAM12 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13M - * Offset: 0x70 CAM13 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13L - * Offset: 0x74 CAM13 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14M - * Offset: 0x78 CAM14 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14L - * Offset: 0x7C CAM14 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM15MSB - * Offset: 0x80 CAM15 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |OPCODE |OP Code Field of PAUSE Control Frame - * | | |In the PAUSE control frame, an op code field defined and is 0x0001. - * |[31:16] |LENGTH |LENGTH Field of PAUSE Control Frame - * | | |In the PAUSE control frame, a LENGTH field defined and is 0x8808. - * @var EMAC_T::CAM15LSB - * Offset: 0x84 CAM15 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:24] |OPERAND |Pause Parameter - * | | |In the PAUSE control frame, an OPERAND field defined and controls how much time the destination - * | | |Ethernet MAC Controller paused - * | | |The unit of the OPERAND is a slot time, the 512-bit time. - * @var EMAC_T::TXDSA - * Offset: 0x88 Transmit Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXDSA |Transmit Descriptor Link-list Start Address - * | | |The TXDSA keeps the start address of transmit descriptor link-list - * | | |If the software enables the bit TXON (EMAC_CTL[8]), the content of TXDSA will be loaded into the - * | | |current transmit descriptor start address register (EMAC_CTXDSA) - * | | |The TXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of TXDSA - * | | |This means that TX descriptors must locate at word boundary memory address. - * @var EMAC_T::RXDSA - * Offset: 0x8C Receive Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXDSA |Receive Descriptor Link-list Start Address - * | | |The RXDSA keeps the start address of receive descriptor link-list - * | | |If the S/W enables the bit RXON (EMAC_CTL[0]), the content of RXDSA will be loaded into the current - * | | |receive descriptor start address register (EMAC_CRXDSA) - * | | |The RXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of RXDSA - * | | |This means that RX descriptors must locate at word boundary memory address. - * @var EMAC_T::CTL - * Offset: 0x90 MAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXON |Frame Reception ON - * | | |The RXON controls the normal packet reception of EMAC - * | | |If the RXON is set to high, the EMAC starts the packet reception process, including the RX - * | | |descriptor fetching, packet reception and RX descriptor modification. - * | | |It is necessary to finish EMAC initial sequence before enable RXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the RXON is disabled during EMAC is receiving an incoming packet, the EMAC stops the packet - * | | |reception process after the current packet reception finished. - * | | |0 = Packet reception process stopped. - * | | |1 = Packet reception process started. - * |[1] |ALP |Accept Long Packet - * | | |The ALP controls the long packet, which packet length is greater than 1518 bytes, reception - * | | |If the ALP is set to high, the EMAC will accept the long packet. - * | | |Otherwise, the long packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the long packet. - * | | |1 = Ethernet MAC controller received the long packet. - * |[2] |ARP |Accept Runt Packet - * | | |The ARP controls the runt packet, which length is less than 64 bytes, reception - * | | |If the ARP is set to high, the EMAC will accept the runt packet. - * | | |Otherwise, the runt packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the runt packet. - * | | |1 = Ethernet MAC controller received the runt packet. - * |[3] |ACP |Accept Control Packet - * | | |The ACP controls the control frame reception - * | | |If the ACP is set to high, the EMAC will accept the control frame - * | | |Otherwise, the control frame will be dropped - * | | |It is recommended that S/W only enable ACP while EMAC is operating on full duplex mode. - * | | |0 = Ethernet MAC controller dropped the control frame. - * | | |1 = Ethernet MAC controller received the control frame. - * |[4] |AEP |Accept CRC Error Packet - * | | |The AEP controls the EMAC accepts or drops the CRC error packet - * | | |If the AEP is set to high, the incoming packet with CRC error will be received by EMAC as a good packet. - * | | |0 = Ethernet MAC controller dropped the CRC error packet. - * | | |1 = Ethernet MAC controller received the CRC error packet. - * |[5] |STRIPCRC |Strip CRC Checksum - * | | |The STRIPCRC controls if the length of incoming packet is calculated with 4 bytes CRC checksum - * | | |If the STRIPCRC is set to high, 4 bytes CRC checksum is excluded from length calculation of incoming packet. - * | | |0 = The 4 bytes CRC checksum is included in packet length calculation. - * | | |1 = The 4 bytes CRC checksum is excluded in packet length calculation. - * |[6] |WOLEN |Wake on LAN Enable Bit - * | | |The WOLEN high enables the functionality that Ethernet MAC controller checked if the incoming packet - * | | |is Magic Packet and wakeup system from Power-down mode. - * | | |If incoming packet was a Magic Packet and the system was in Power-down, the Ethernet MAC controller - * | | |would generate a wakeup event to wake system up from Power-down mode. - * | | |0 = Wake-up by Magic Packet function Disabled. - * | | |1 = Wake-up by Magic Packet function Enabled. - * |[8] |TXON |Frame Transmission ON - * | | |The TXON controls the normal packet transmission of EMAC - * | | |If the TXON is set to high, the EMAC starts the packet transmission process, including the TX - * | | |descriptor fetching, packet transmission and TX descriptor modification. - * | | |It is must to finish EMAC initial sequence before enable TXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the TXON is disabled during EMAC is transmitting a packet out, the EMAC stops the packet - * | | |transmission process after the current packet transmission finished. - * | | |0 = Packet transmission process stopped. - * | | |1 = Packet transmission process started. - * |[9] |NODEF |No Deferral - * | | |The NODEF controls the enable of deferral exceed counter - * | | |If NODEF is set to high, the deferral exceed counter is disabled - * | | |The NODEF is only useful while EMAC is operating on half duplex mode. - * | | |0 = The deferral exceed counter Enabled. - * | | |1 = The deferral exceed counter Disabled. - * |[16] |SDPZ |Send PAUSE Frame - * | | |The SDPZ controls the PAUSE control frame transmission. - * | | |If S/W wants to send a PAUSE control frame out, the CAM entry 13, 14 and 15 must be configured - * | | |first and the corresponding CAM enable bit of CAMEN register also must be set. - * | | |Then, set SDPZ to 1 enables the PAUSE control frame transmission. - * | | |The SDPZ is a self-clear bit - * | | |This means after the PAUSE control frame transmission has completed, the SDPZ will be cleared automatically. - * | | |It is recommended that only enabling SNDPAUSE while EMAC is operating in Full Duplex mode. - * | | |0 = PAUSE control frame transmission completed. - * | | |1 = PAUSE control frame transmission Enabled. - * |[17] |SQECHKEN |SQE Checking Enable Bit - * | | |The SQECHKEN controls the enable of SQE checking - * | | |The SQE checking is only available while EMAC is operating on 10M bps and half duplex mode - * | | |In other words, the SQECHKEN cannot affect EMAC operation, if the EMAC is operating on 100Mbps - * | | |or full duplex mode. - * | | |0 = SQE checking Disabled while EMAC is operating in 10Mbps and Half Duplex mode. - * | | |1 = SQE checking Enabled while EMAC is operating in 10Mbps and Half Duplex mode. - * |[18] |FUDUP |Full Duplex Mode Selection - * | | |The FUDUP controls that if EMAC is operating on full or half duplex mode. - * | | |0 = EMAC operates in half duplex mode. - * | | |1 = EMAC operates in full duplex mode. - * |[19] |RMIIRXCTL |RMII RX Control - * | | |The RMIIRXCTL control the receive data sample in RMII mode - * | | |It's necessary to set this bit high when RMIIEN (EMAC_CTL[ [22]) is high. - * | | |0 = RMII RX control disabled. - * | | |1 = RMII RX control enabled. - * |[20] |OPMODE |Operation Mode Selection - * | | |The OPMODE defines that if the EMAC is operating on 10M or 100M bps mode - * | | |The RST (EMAC_CTL[24]) would not affect OPMODE value. - * | | |0 = EMAC operates in 10Mbps mode. - * | | |1 = EMAC operates in 100Mbps mode. - * |[22] |RMIIEN |RMII Mode Enable Bit - * | | |This bit controls if Ethernet MAC controller connected with off-chip Ethernet PHY by MII - * | | |interface or RMII interface - * | | |The RST (EMAC_CTL[24]) would not affect RMIIEN value. - * | | |0 = Ethernet MAC controller RMII mode Disabled. - * | | |1 = Ethernet MAC controller RMII mode Enabled. - * | | |NOTE: This field must keep 1. - * |[24] |RST |Software Reset - * | | |The RST implements a reset function to make the EMAC return default state - * | | |The RST is a self-clear bit - * | | |This means after the software reset finished, the RST will be cleared automatically - * | | |Enable RST can also reset all control and status registers, exclusive of the control bits - * | | |RMIIEN (EMAC_CTL[22]), and OPMODE (EMAC_CTL[20]). - * | | |The EMAC re-initial is necessary after the software reset completed. - * | | |0 = Software reset completed. - * | | |1 = Software reset Enabled. - * @var EMAC_T::MIIMDAT - * Offset: 0x94 MII Management Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATA |MII Management Data - * | | |The DATA is the 16 bits data that will be written into the registers of external PHY for MII - * | | |Management write command or the data from the registers of external PHY for MII Management read command. - * @var EMAC_T::MIIMCTL - * Offset: 0x98 MII Management Control and Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PHYREG |PHY Register Address - * | | |The PHYREG keeps the address to indicate which register of external PHY is the target of the - * | | |MII management command. - * |[12:8] |PHYADDR |PHY Address - * | | |The PHYADDR keeps the address to differentiate which external PHY is the target of the MII management command. - * |[16] |WRITE |Write Command - * | | |The Write defines the MII management command is a read or write. - * | | |0 = MII management command is a read command. - * | | |1 = MII management command is a write command. - * |[17] |BUSY |Busy Bit - * | | |The BUSY controls the enable of the MII management frame generation - * | | |If S/W wants to access registers of external PHY, it set BUSY to high and EMAC generates - * | | |the MII management frame to external PHY through MII Management I/F - * | | |The BUSY is a self-clear bit - * | | |This means the BUSY will be cleared automatically after the MII management command finished. - * | | |0 = MII management command generation finished. - * | | |1 = MII management command generation Enabled. - * |[18] |PREAMSP |Preamble Suppress - * | | |The PREAMSP controls the preamble field generation of MII management frame - * | | |If the PREAMSP is set to high, the preamble field generation of MII management frame is skipped. - * | | |0 = Preamble field generation of MII management frame not skipped. - * | | |1 = Preamble field generation of MII management frame skipped. - * |[19] |MDCON |MDC Clock ON - * | | |The MDC controls the MDC clock generation. If the MDCON is set to high, the MDC clock is turned on. - * | | |0 = MDC clock off. - * | | |1 = MDC clock on. - * @var EMAC_T::FIFOCTL - * Offset: 0x9C FIFO Threshold Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RXFIFOTH |RXFIFO Low Threshold - * | | |The RXFIFOTH controls when RXDMA requests internal arbiter for data transfer between RXFIFO - * | | |and system memory - * | | |The RXFIFOTH defines not only the high threshold of RXFIFO, but also the low threshold - * | | |The low threshold is the half of high threshold always - * | | |During the packet reception, if the RXFIFO reaches the high threshold, the RXDMA starts to - * | | |transfer frame data from RXFIFO to system memory - * | | |If the frame data in RXFIFO is less than low threshold, RXDMA stops to transfer the frame - * | | |data to system memory. - * | | |00 = Depend on the burst length setting - * | | |If the burst length is 8 words, high threshold is 8 words, too. - * | | |01 = RXFIFO high threshold is 64B and low threshold is 32B. - * | | |10 = RXFIFO high threshold is 128B and low threshold is 64B. - * | | |11 = RXFIFO high threshold is 192B and low threshold is 96B. - * |[9:8] |TXFIFOTH |TXFIFO Low Threshold - * | | |The TXFIFOTH controls when TXDMA requests internal arbiter for data transfer between system - * | | |memory and TXFIFO - * | | |The TXFIFOTH defines not only the low threshold of TXFIFO, but also the high threshold - * | | |The high threshold is the twice of low threshold always - * | | |During the packet transmission, if the TXFIFO reaches the high threshold, the TXDMA stops - * | | |generate request to transfer frame data from system memory to TXFIFO - * | | |If the frame data in TXFIFO is less than low threshold, TXDMA starts to transfer frame data - * | | |from system memory to TXFIFO. - * | | |The TXFIFOTH also defines when the TXMAC starts to transmit frame out to network - * | | |The TXMAC starts to transmit the frame out while the TXFIFO first time reaches the high threshold - * | | |during the transmission of the frame - * | | |If the frame data length is less than TXFIFO high threshold, the TXMAC starts to transmit the frame - * | | |out after the frame data are all inside the TXFIFO. - * | | |00 = Undefined. - * | | |01 = TXFIFO low threshold is 64B and high threshold is 128B. - * | | |10 = TXFIFO low threshold is 80B and high threshold is 160B. - * | | |11 = TXFIFO low threshold is 96B and high threshold is 192B. - * |[21:20] |BURSTLEN |DMA Burst Length - * | | |This defines the burst length of AHB bus cycle while EMAC accesses system memory. - * | | |00 = 4 words. - * | | |01 = 8 words. - * | | |10 = 16 words. - * | | |11 = 16 words. - * @var EMAC_T::TXST - * Offset: 0xA0 Transmit Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXST |Transmit Start Demand - * | | |If the TX descriptor is not available for use of TXDMA after the TXON (EMAC_CTL[8]) is enabled, - * | | |the FSM (Finite State Machine) of TXDMA enters the Halt state and the frame transmission is halted - * | | |After the S/W has prepared the new TX descriptor for frame transmission, it must issue a write - * | | |command to EMAC_TXST register to make TXDMA to leave Halt state and continue the frame transmission. - * | | |The EMAC_TXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_TXST register takes effect only when TXDMA stayed at Halt state. - * @var EMAC_T::RXST - * Offset: 0xA4 Receive Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXST |Receive Start Demand - * | | |If the RX descriptor is not available for use of RXDMA after the RXON (EMAC_CTL[0]) is enabled, - * | | |the FSM (Finite State Machine) of RXDMA enters the Halt state and the frame reception is halted - * | | |After the S/W has prepared the new RX descriptor for frame reception, it must issue a write - * | | |command to EMAC_RXST register to make RXDMA to leave Halt state and continue the frame reception. - * | | |The EMAC_RXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_RXST register take effect only when RXDMA stayed at Halt state. - * @var EMAC_T::MRFL - * Offset: 0xA8 Maximum Receive Frame Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MRFL |Maximum Receive Frame Length - * | | |The MRFL defines the maximum frame length for received frame - * | | |If the frame length of received frame is greater than MRFL, and bit MFLEIEN (EMAC_INTEN[8]) - * | | |is also enabled, the bit MFLEIF (EMAC_INTSTS[8]) is set and the RX interrupt is triggered. - * | | |It is recommended that only use MRFL to qualify the length of received frame while S/W wants to - * | | |receive a frame which length is greater than 1518 bytes. - * @var EMAC_T::INTEN - * Offset: 0xAC MAC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIEN |Receive Interrupt Enable Bit - * | | |The RXIEN controls the RX interrupt generation. - * | | |If RXIEN is enabled and RXIF (EMAC_INTSTS[0]) is high, EMAC generates the RX interrupt to CPU - * | | |If RXIEN is disabled, no RX interrupt is generated to CPU even any status bit EMAC_INTSTS[15:1] - * | | |is set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive RX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any RX interrupt from EMAC, disables this bit. - * | | |0 = RXIF (EMAC_INTSTS[0]) is masked and RX interrupt generation Disabled. - * | | |1 = RXIF (EMAC_INTSTS[0]) is not masked and RX interrupt generation Enabled. - * |[1] |CRCEIEN |CRC Error Interrupt Enable Bit - * | | |The CRCEIEN controls the CRCEIF (EMAC_INTSTS[1]) interrupt generation - * | | |If CRCEIF (EMAC_INTSTS[1]) is set, and both CRCEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CRCEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CRCEIF (EMAC_INTSTS[1]) is set. - * | | |0 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Disabled. - * | | |1 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Enabled. - * |[2] |RXOVIEN |Receive FIFO Overflow Interrupt Enable Bit - * | | |The RXOVIEN controls the RXOVIF (EMAC_INTSTS[2]) interrupt generation - * | | |If RXOVIF (EMAC_INTSTS[2]) is set, and both RXOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXOVIF (EMAC_INTSTS[2]) is set. - * | | |0 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Disabled. - * | | |1 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Enabled. - * |[3] |LPIEN |Long Packet Interrupt Enable Bit - * | | |The LPIEN controls the LPIF (EMAC_INTSTS[3]) interrupt generation - * | | |If LPIF (EMAC_INTSTS[3]) is set, and both LPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If LPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the LPIF - * | | |(EMAC_INTSTS[3]) is set. - * | | |0 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Disabled. - * | | |1 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Enabled. - * |[4] |RXGDIEN |Receive Good Interrupt Enable Bit - * | | |The RXGDIEN controls the RXGDIF (EMAC_INTSTS[4]) interrupt generation - * | | |If RXGDIF (EMAC_INTSTS[4]) is set, and both RXGDIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXGDIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXGDIF (EMAC_INTSTS[4]) is set. - * | | |0 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Disabled. - * | | |1 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Enabled. - * |[5] |ALIEIEN |Alignment Error Interrupt Enable Bit - * | | |The ALIEIEN controls the ALIEIF (EMAC_INTSTS[5]) interrupt generation - * | | |If ALIEIF (EMAC_INTSTS[5]) is set, and both ALIEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If ALIEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |ALIEIF (EMAC_INTSTS[5]) is set. - * | | |0 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Disabled. - * | | |1 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Enabled. - * |[6] |RPIEN |Runt Packet Interrupt Enable Bit - * | | |The RPIEN controls the RPIF (EMAC_INTSTS[6]) interrupt generation - * | | |If RPIF (EMAC_INTSTS[6]) is set, and both RPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If RPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RPIF (EMAC_INTSTS[6]) is set. - * | | |0 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Disabled. - * | | |1 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Enabled. - * |[7] |MPCOVIEN |Miss Packet Counter Overrun Interrupt Enable Bit - * | | |The MPCOVIEN controls the MPCOVIF (EMAC_INTSTS[7]) interrupt generation - * | | |If MPCOVIF (EMAC_INTSTS[7]) is set, and both MPCOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If MPCOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MPCOVIF (EMAC_INTSTS[7]) is set. - * | | |0 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Disabled. - * | | |1 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Enabled. - * |[8] |MFLEIEN |Maximum Frame Length Exceed Interrupt Enable Bit - * | | |The MFLEIEN controls the MFLEIF (EMAC_INTSTS[8]) interrupt generation - * | | |If MFLEIF (EMAC_INTSTS[8]) is set, and both MFLEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If MFLEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MFLEIF (EMAC_INTSTS[8]) is set. - * | | |0 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Disabled. - * | | |1 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Enabled. - * |[9] |DENIEN |DMA Early Notification Interrupt Enable Bit - * | | |The DENIEN controls the DENIF (EMAC_INTSTS[9]) interrupt generation - * | | |If DENIF (EMAC_INTSTS[9]) is set, and both DENIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If DENIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |DENIF (EMAC_INTSTS[9]) is set. - * | | |0 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Disabled. - * | | |1 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Enabled. - * |[10] |RDUIEN |Receive Descriptor Unavailable Interrupt Enable Bit - * | | |The RDUIEN controls the RDUIF (EMAC_INTSTS[10]) interrupt generation - * | | |If RDUIF (EMAC_INTSTS[10]) is set, and both RDUIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RDUIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RDUIF (EMAC_MIOSTA[10]) register is set. - * | | |0 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Disabled. - * | | |1 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Enabled. - * |[11] |RXBEIEN |Receive Bus Error Interrupt Enable Bit - * | | |The RXBEIEN controls the RXBEIF (EMAC_INTSTS[11]) interrupt generation - * | | |If RXBEIF (EMAC_INTSTS[11]) is set, and both RXBEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXBEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXBEIF (EMAC_INTSTS[11]) is set. - * | | |0 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Disabled. - * | | |1 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Enabled. - * |[14] |CFRIEN |Control Frame Receive Interrupt Enable Bit - * | | |The CFRIEN controls the CFRIF (EMAC_INTSTS[14]) interrupt generation - * | | |If CFRIF (EMAC_INTSTS[14]) is set, and both CFRIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CFRIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CFRIF (EMAC_INTSTS[14]) register is set. - * | | |0 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Disabled. - * | | |1 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Enabled. - * |[15] |WOLIEN |Wake on LAN Interrupt Enable Bit - * | | |The WOLIEN controls the WOLIF (EMAC_INTSTS[15]) interrupt generation - * | | |If WOLIF (EMAC_INTSTS[15]) is set, and both WOLIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If WOLIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |WOLIF (EMAC_INTSTS[15]) is set. - * | | |0 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Disabled. - * | | |1 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Enabled. - * |[16] |TXIEN |Transmit Interrupt Enable Bit - * | | |The TXIEN controls the TX interrupt generation. - * | | |If TXIEN is enabled and TXIF (EMAC_INTSTS[16]) is high, EMAC generates the TX interrupt to CPU - * | | |If TXIEN is disabled, no TX interrupt is generated to CPU even any status bit of - * | | |EMAC_INTSTS[24:17] set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive TX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any TX interrupt from EMAC, disables this bit. - * | | |0 = TXIF (EMAC_INTSTS[16]) is masked and TX interrupt generation Disabled. - * | | |1 = TXIF (EMAC_INTSTS[16]) is not masked and TX interrupt generation Enabled. - * |[17] |TXUDIEN |Transmit FIFO Underflow Interrupt Enable Bit - * | | |The TXUDIEN controls the TXUDIF (EMAC_INTSTS[17]) interrupt generation - * | | |If TXUDIF (EMAC_INTSTS[17]) is set, and both TXUDIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXUDIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even - * | | |the TXUDIF (EMAC_INTSTS[17]) is set. - * | | |0 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Disabled. - * | | |1 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Enabled. - * |[18] |TXCPIEN |Transmit Completion Interrupt Enable Bit - * | | |The TXCPIEN controls the TXCPIF (EMAC_INTSTS[18]) interrupt generation - * | | |If TXCPIF (EMAC_INTSTS[18]) is set, and both TXCPIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXCPIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXCPIF (EMAC_INTSTS[18]) is set. - * | | |0 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Disabled. - * | | |1 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Enabled. - * |[19] |EXDEFIEN |Defer Exceed Interrupt Enable Bit - * | | |The EXDEFIEN controls the EXDEFIF (EMAC_INTSTS[19]) interrupt generation - * | | |If EXDEFIF (EMAC_INTSTS[19]) is set, and both EXDEFIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If EXDEFIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |EXDEFIF (EMAC_INTSTS[19]) is set. - * | | |0 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Disabled. - * | | |1 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Enabled. - * |[20] |NCSIEN |No Carrier Sense Interrupt Enable Bit - * | | |The NCSIEN controls the NCSIF (EMAC_INTSTS[20]) interrupt generation - * | | |If NCSIF (EMAC_INTSTS[20]) is set, and both NCSIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If NCSIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |NCSIF (EMAC_INTSTS[20]) is set. - * | | |0 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Disabled. - * | | |1 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Enabled. - * |[21] |TXABTIEN |Transmit Abort Interrupt Enable Bit - * | | |The TXABTIEN controls the TXABTIF (EMAC_INTSTS[21]) interrupt generation - * | | |If TXABTIF (EMAC_INTSTS[21]) is set, and both TXABTIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXABTIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXABTIF (EMAC_INTSTS[21]) is set. - * | | |0 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Disabled. - * | | |1 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Enabled. - * |[22] |LCIEN |Late Collision Interrupt Enable Bit - * | | |The LCIEN controls the LCIF (EMAC_INTSTS[22]) interrupt generation - * | | |If LCIF (EMAC_INTSTS[22]) is set, and both LCIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If LCIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |LCIF (EMAC_INTSTS[22]) is set. - * | | |0 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Disabled. - * | | |1 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Enabled. - * |[23] |TDUIEN |Transmit Descriptor Unavailable Interrupt Enable Bit - * | | |The TDUIEN controls the TDUIF (EMAC_INTSTS[23]) interrupt generation - * | | |If TDUIF (EMAC_INTSTS[23]) is set, and both TDUIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TDUIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TDUIF (EMAC_INTSTS[23]) is set. - * | | |0 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Disabled. - * | | |1 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Enabled. - * |[24] |TXBEIEN |Transmit Bus Error Interrupt Enable Bit - * | | |The TXBEIEN controls the TXBEIF (EMAC_INTSTS[24]) interrupt generation - * | | |If TXBEIF (EMAC_INTSTS[24]) is set, and both TXBEIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TXBEIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXBEIF (EMAC_INTSTS[24]) is set. - * | | |0 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Disabled. - * | | |1 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Enabled. - * |[28] |TSALMIEN |Time Stamp Alarm Interrupt Enable Bit - * | | |The TSALMIEN controls the TSALMIF (EMAC_INTSTS[28]) interrupt generation - * | | |If TSALMIF (EMAC_INTSTS[28]) is set, and both TSALMIEN and TXIEN (EMAC_INTEN[16]) enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TSALMIEN or TXIEN (EMAC_INTEN[16]) disabled, no TX interrupt generated to CPU even the - * | | |TXTSALMIF (EMAC_INTEN[28]) is set. - * | | |0 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Disabled. - * | | |1 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Enabled. - * @var EMAC_T::INTSTS - * Offset: 0xB0 MAC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIF |Receive Interrupt - * | | |The RXIF indicates the RX interrupt status. - * | | |If RXIF high and its corresponding enable bit, RXIEN (EMAC_INTEN[0]), is also high indicates - * | | |the EMAC generates RX interrupt to CPU - * | | |If RXIF is high but RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated. - * | | |The RXIF is logic OR result of bit logic AND result of EMAC_INTSTS[15:1] and EMAC_INTEN[15:1] - * | | |In other words, if any bit of EMAC_INTSTS[15:1] is high and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is also enabled, the RXIF will be high. - * | | |Because the RXIF is a logic OR result, clears EMAC_INTSTS[15:1] makes RXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[15:1] is set or no enable bit in EMAC_INTEN[15:1] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[15:1] is set and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is enabled, too. - * |[1] |CRCEIF |CRC Error Interrupt - * | | |The CRCEIF high indicates the incoming packet incurred the CRC error and the packet is dropped - * | | |If the AEP (EMAC_CTL[4]) is set, the CRC error packet will be regarded as a good packet and - * | | |CRCEIF will not be set. - * | | |If the CRCEIF is high and CRCEIEN (EMAC_INTEN[1]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CRCEIF status. - * | | |0 = The frame does not incur CRC error. - * | | |1 = The frame incurred CRC error. - * |[2] |RXOVIF |Receive FIFO Overflow Interrupt - * | | |The RXOVIF high indicates the RXFIFO overflow occurred during packet reception - * | | |While the RXFIFO overflow occurred, the EMAC drops the current receiving packer - * | | |If the RXFIFO overflow occurred often, it is recommended that modify RXFIFO threshold control, - * | | |the RXFIFOTH of FFTCR register, to higher level. - * | | |If the RXOVIF is high and RXOVIEN (EMAC_INTEN[2]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXOVIF status. - * | | |0 = No RXFIFO overflow occurred during packet reception. - * | | |1 = RXFIFO overflow occurred during packet reception. - * |[3] |LPIF |Long Packet Interrupt Flag - * | | |The LPIF high indicates the length of the incoming packet is greater than 1518 bytes and the - * | | |incoming packet is dropped - * | | |If the ALP (EMAC_CTL[1]) is set, the long packet will be regarded as a good packet and LPIF will not be set. - * | | |If the LPIF is high and LPIEN (EMAC_INTEN[3]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the LPIF status. - * | | |0 = The incoming frame is not a long frame or S/W wants to receive a long frame. - * | | |1 = The incoming frame is a long frame and dropped. - * |[4] |RXGDIF |Receive Good Interrupt - * | | |The RXGDIF high indicates the frame reception has completed. - * | | |If the RXGDIF is high and RXGDIEN (EAMC_MIEN[4]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXGDIF status. - * | | |0 = The frame reception has not complete yet. - * | | |1 = The frame reception has completed. - * |[5] |ALIEIF |Alignment Error Interrupt - * | | |The ALIEIF high indicates the length of the incoming frame is not a multiple of byte - * | | |If the ALIEIF is high and ALIEIEN (EMAC_INTEN[5]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the ALIEIF status. - * | | |0 = The frame length is a multiple of byte. - * | | |1 = The frame length is not a multiple of byte. - * |[6] |RPIF |Runt Packet Interrupt - * | | |The RPIF high indicates the length of the incoming packet is less than 64 bytes and the packet is dropped - * | | |If the ARP (EMAC_CTL[2]) is set, the short packet is regarded as a good packet and RPIF will not be set. - * | | |If the RPIF is high and RPIEN (EMAC_INTEN[6]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RPIF status. - * | | |0 = The incoming frame is not a short frame or S/W wants to receive a short frame. - * | | |1 = The incoming frame is a short frame and dropped. - * |[7] |MPCOVIF |Missed Packet Counter Overrun Interrupt Flag - * | | |The MPCOVIF high indicates the MPCNT, Missed Packet Count, has overflow - * | | |If the MPCOVIF is high and MPCOVIEN (EMAC_INTEN[7]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MPCOVIF status. - * | | |0 = The MPCNT has not rolled over yet. - * | | |1 = The MPCNT has rolled over yet. - * |[8] |MFLEIF |Maximum Frame Length Exceed Interrupt Flag - * | | |The MFLEIF high indicates the length of the incoming packet has exceeded the length limitation - * | | |configured in DMARFC register and the incoming packet is dropped - * | | |If the MFLEIF is high and MFLEIEN (EMAC_INTEN[8]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MFLEIF status. - * | | |0 = The length of the incoming packet does not exceed the length limitation configured in DMARFC. - * | | |1 = The length of the incoming packet has exceeded the length limitation configured in DMARFC. - * |[9] |DENIF |DMA Early Notification Interrupt - * | | |The DENIF high indicates the EMAC has received the LENGTH field of the incoming packet. - * | | |If the DENIF is high and DENIENI (EMAC_INTEN[9]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the DENIF status. - * | | |0 = The LENGTH field of incoming packet has not received yet. - * | | |1 = The LENGTH field of incoming packet has received. - * |[10] |RDUIF |Receive Descriptor Unavailable Interrupt - * | | |The RDUIF high indicates that there is no available RX descriptor for packet reception and - * | | |RXDMA will stay at Halt state - * | | |Once, the RXDMA enters the Halt state, S/W must issues a write command to RSDR register to - * | | |make RXDMA leave Halt state while new RX descriptor is available. - * | | |If the RDUIF is high and RDUIEN (EMAC_INTEN[10]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RDUIF status. - * | | |0 = RX descriptor is available. - * | | |1 = RX descriptor is unavailable. - * |[11] |RXBEIF |Receive Bus Error Interrupt - * | | |The RXBEIF high indicates the memory controller replies ERROR response while EMAC access - * | | |system memory through RXDMA during packet reception process - * | | |Reset EMAC is recommended while RXBEIF status is high. - * | | |If the RXBEIF is high and RXBEIEN (EMAC_INTEN[11]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[14] |CFRIF |Control Frame Receive Interrupt - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |If the CFRIF is high and CFRIEN (EMAC_INTEN[14]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CFRIF status. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[15] |WOLIF |Wake on LAN Interrupt Flag - * | | |The WOLIF high indicates EMAC receives a Magic Packet - * | | |The CFRIF only available while system is in power down mode and WOLEN is set high. - * | | |If the WOLIF is high and WOLIEN (EMAC_INTEN[15]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the WOLIF status. - * | | |0 = The EMAC does not receive the Magic Packet. - * | | |1 = The EMAC receives a Magic Packet. - * |[16] |TXIF |Transmit Interrupt - * | | |The TXIF indicates the TX interrupt status. - * | | |If TXIF high and its corresponding enable bit, TXIEN (EMAC_INTEN[16]), is also high indicates - * | | |the EMAC generates TX interrupt to CPU - * | | |If TXIF is high but TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated. - * | | |The TXIF is logic OR result of bit logic AND result of EMAC_INTSTS[28:17] and EMAC_INTEN[28:17] - * | | |In other words, if any bit of EMAC_INTSTS[28:17] is high and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is also enabled, the TXIF will be high - * | | |Because the TXIF is a logic OR result, clears EMAC_INTSTS[28:17] makes TXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[28:17] is set or no enable bit in EMAC_INTEN[28:17] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[28:17] is set and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is enabled, too. - * |[17] |TXUDIF |Transmit FIFO Underflow Interrupt - * | | |The TXUDIF high indicates the TXFIFO underflow occurred during packet transmission - * | | |While the TXFIFO underflow occurred, the EMAC will retransmit the packet automatically - * | | |without S/W intervention - * | | |If the TXFIFO underflow occurred often, it is recommended that modify TXFIFO threshold control, - * | | |the TXFIFOTH of FFTCR register, to higher level. - * | | |If the TXUDIF is high and TXUDIEN (EMAC_INTEN[17]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXUDIF status. - * | | |0 = No TXFIFO underflow occurred during packet transmission. - * | | |1 = TXFIFO underflow occurred during packet transmission. - * |[18] |TXCPIF |Transmit Completion Interrupt - * | | |The TXCPIF indicates the packet transmission has completed correctly. - * | | |If the TXCPIF is high and TXCPIEN (EMAC_INTEN[18]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXCPIF status. - * | | |0 = The packet transmission not completed. - * | | |1 = The packet transmission has completed. - * |[19] |EXDEFIF |Defer Exceed Interrupt - * | | |The EXDEFIF high indicates the frame waiting for transmission has deferred over 0.32768ms - * | | |on 100Mbps mode, or 3.2768ms on 10Mbps mode. - * | | |The deferral exceed check will only be done while bit NODEF of MCMDR is disabled, and EMAC - * | | |is operating on half-duplex mode. - * | | |If the EXDEFIF is high and EXDEFIEN (EMAC_INTEN[19]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the EXDEFIF status. - * | | |0 = Frame waiting for transmission has not deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * | | |1 = Frame waiting for transmission has deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * |[20] |NCSIF |No Carrier Sense Interrupt - * | | |The NCSIF high indicates the MII I/F signal CRS does not active at the start of or during - * | | |the packet transmission - * | | |The NCSIF is only available while EMAC is operating on half-duplex mode - * | | |If the NCSIF is high and NCSIEN (EMAC_INTEN[20]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the NCSIF status. - * | | |0 = CRS signal actives correctly. - * | | |1 = CRS signal does not active at the start of or during the packet transmission. - * |[21] |TXABTIF |Transmit Abort Interrupt - * | | |The TXABTIF high indicates the packet incurred 16 consecutive collisions during transmission, - * | | |and then the transmission process for this packet is aborted - * | | |The transmission abort is only available while EMAC is operating on half-duplex mode. - * | | |If the TXABTIF is high and TXABTIEN (EMAC_INTEN[21]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXABTIF status. - * | | |0 = Packet does not incur 16 consecutive collisions during transmission. - * | | |1 = Packet incurred 16 consecutive collisions during transmission. - * |[22] |LCIF |Late Collision Interrupt - * | | |The LCIF high indicates the collision occurred in the outside of 64 bytes collision window - * | | |This means after the 64 bytes of a frame has been transmitted out to the network, the collision - * | | |still occurred. - * | | |The late collision check will only be done while EMAC is operating on half-duplex mode - * | | |If the LCIF is high and LCIEN (EMAC_INTEN[22]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the LCIF status. - * | | |0 = No collision occurred in the outside of 64 bytes collision window. - * | | |1 = Collision occurred in the outside of 64 bytes collision window. - * |[23] |TDUIF |Transmit Descriptor Unavailable Interrupt - * | | |The TDUIF high indicates that there is no available TX descriptor for packet transmission and - * | | |TXDMA will stay at Halt state. - * | | |Once, the TXDMA enters the Halt state, S/W must issues a write command to TSDR register to make - * | | |TXDMA leave Halt state while new TX descriptor is available. - * | | |If the TDUIF is high and TDUIEN (EMAC_INTEN[23]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TDUIF status. - * | | |0 = TX descriptor is available. - * | | |1 = TX descriptor is unavailable. - * |[24] |TXBEIF |Transmit Bus Error Interrupt - * | | |The TXBEIF high indicates the memory controller replies ERROR response while EMAC access system - * | | |memory through TXDMA during packet transmission process - * | | |Reset EMAC is recommended while TXBEIF status is high. - * | | |If the TXBEIF is high and TXBEIEN (EMAC_INTEN[24]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[28] |TSALMIF |Time Stamp Alarm Interrupt - * | | |The TSALMIF high indicates the EMAC_TSSEC register value equals to EMAC_ALMSEC register and - * | | |EMAC_TSSUBSEC register value equals to register EMAC_ALMSUBLSR. - * | | |If TSALMIF is high and TSALMIEN (EMAC_INTEN[28]) enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TSALMIF status. - * | | |0 = EMAC_TSSEC did not equal EMAC_ALMSEC or EMAC_TSSUBSEC did not equal EMAC_ALMSUBSEC. - * | | |1 = EMAC_TSSEC equals EMAC_ALMSEC and EMAC_TSSUBSEC equals EMAC_ALMSUBSEC. - * @var EMAC_T::GENSTS - * Offset: 0xB4 MAC General Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CFR |Control Frame Received - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[1] |RXHALT |Receive Halted - * | | |The RXHALT high indicates the next normal packet reception process will be halted because - * | | |the bit RXON of MCMDR is disabled be S/W. - * | | |0 = Next normal packet reception process will go on. - * | | |1 = Next normal packet reception process will be halted. - * |[2] |RXFFULL |RXFIFO Full - * | | |The RXFFULL indicates the RXFIFO is full due to four 64-byte packets are kept in RXFIFO - * | | |and the following incoming packet will be dropped. - * | | |0 = The RXFIFO is not full. - * | | |1 = The RXFIFO is full and the following incoming packet will be dropped. - * |[7:4] |COLCNT |Collision Count - * | | |The COLCNT indicates that how many collisions occurred consecutively during a packet transmission - * | | |If the packet incurred 16 consecutive collisions during transmission, the COLCNT will be - * | | |0 and bit TXABTIF will be set to 1. - * |[8] |DEF |Deferred Transmission - * | | |The DEF high indicates the packet transmission has deferred once - * | | |The DEF is only available while EMAC is operating on half-duplex mode. - * | | |0 = Packet transmission does not defer. - * | | |1 = Packet transmission has deferred once. - * |[9] |TXPAUSED |Transmission Paused - * | | |The TXPAUSED high indicates the next normal packet transmission process will be paused temporally - * | | |because EMAC received a PAUSE control frame. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be paused. - * |[10] |SQE |Signal Quality Error - * | | |The SQE high indicates the SQE error found at end of packet transmission on 10Mbps half-duplex mode - * | | |The SQE error check will only be done while both bit SQECHKEN (EMAC_CTL[17]) is enabled and EMAC - * | | |is operating on 10Mbps half-duplex mode. - * | | |0 = No SQE error found at end of packet transmission. - * | | |1 = SQE error found at end of packet transmission. - * |[11] |TXHALT |Transmission Halted - * | | |The TXHALT high indicates the next normal packet transmission process will be halted because - * | | |the bit TXON (EMAC_CTL[8]) is disabled be S/W. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be halted. - * |[12] |RPSTS |Remote Pause Status - * | | |The RPSTS indicates that remote pause counter down counting actives. - * | | |After Ethernet MAC controller sent PAUSE frame out successfully, it starts the remote pause - * | | |counter down counting - * | | |When this bit high, it's predictable that remote Ethernet MAC controller wouldn't start the packet - * | | |transmission until the down counting done. - * | | |0 = Remote pause counter down counting done. - * | | |1 = Remote pause counter down counting actives. - * @var EMAC_T::MPCNT - * Offset: 0xB8 Missed Packet Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MPCNT |Miss Packet Count - * | | |The MPCNT indicates the number of packets that were dropped due to various types of receive errors - * | | |The following type of receiving error makes missed packet counter increase: - * | | |1. Incoming packet is incurred RXFIFO overflow. - * | | |2. Incoming packet is dropped due to RXON is disabled. - * | | |3. Incoming packet is incurred CRC error. - * @var EMAC_T::RPCNT - * Offset: 0xBC MAC Receive Pause Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RPCNT |MAC Receive Pause Count - * | | |The RPCNT keeps the OPERAND field of the PAUSE control frame - * | | |It indicates how many slot time (512 bit time) the TX of EMAC will be paused. - * @var EMAC_T::FRSTS - * Offset: 0xC8 DMA Receive Frame Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXFLT |Receive Frame LENGTH - * | | |The RXFLT keeps the LENGTH field of each incoming Ethernet packet - * | | |If the bit DENIEN (EMAC_INTEN[9]) is enabled and the LENGTH field of incoming packet has - * | | |received, the bit DENIF (EMAC_INTSTS[9]) will be set and trigger interrupt. - * | | |And, the content of LENGTH field will be stored in RXFLT. - * @var EMAC_T::CTXDSA - * Offset: 0xCC Current Transmit Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXDSA |Current Transmit Descriptor Start Address - * | | |The CTXDSA keeps the start address of TX descriptor that is used by TXDMA currently - * | | |The CTXDSA is read only and write to this register has no effect. - * @var EMAC_T::CTXBSA - * Offset: 0xD0 Current Transmit Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXBSA |Current Transmit Buffer Start Address - * | | |The CTXDSA keeps the start address of TX frame buffer that is used by TXDMA currently - * | | |The CTXBSA is read only and write to this register has no effect. - * @var EMAC_T::CRXDSA - * Offset: 0xD4 Current Receive Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXDSA |Current Receive Descriptor Start Address - * | | |The CRXDSA keeps the start address of RX descriptor that is used by RXDMA currently - * | | |The CRXDSA is read only and write to this register has no effect. - * @var EMAC_T::CRXBSA - * Offset: 0xD8 Current Receive Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXBSA |Current Receive Buffer Start Address - * | | |The CRXBSA keeps the start address of RX frame buffer that is used by RXDMA currently - * | | |The CRXBSA is read only and write to this register has no effect. - * @var EMAC_T::TSCTL - * Offset: 0x100 Time Stamp Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TSEN |Time Stamp Function Enable Bit - * | | |This bit controls if the IEEE 1588 PTP time stamp function is enabled or not. - * | | |Set this bit high to enable IEEE 1588 PTP time stamp function while set this bit low - * | | |to disable IEEE 1588 PTP time stamp function. - * | | |0 = I EEE 1588 PTP time stamp function Disabled. - * | | |1 = IEEE 1588 PTP time stamp function Enabled. - * |[1] |TSIEN |Time Stamp Counter Initialization Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to load value of register EMAC_UPDSEC - * | | |and EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the load operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = Time stamp counter initialization done. - * | | |1 = Time stamp counter initialization Enabled. - * |[2] |TSMODE |Time Stamp Fine Update Enable Bit - * | | |This bit chooses the time stamp counter update mode. - * | | |0 = Time stamp counter is in coarse update mode. - * | | |1 = Time stamp counter is in fine update mode. - * |[3] |TSUPDATE |Time Stamp Counter Time Update Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to add value of register EMAC_UPDSEC and - * | | |EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the add operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = No action. - * | | |1 = EMAC_UPDSEC updated to EMAC_TSSEC and EMAC_UPDSUBSEC updated to EMAC_TSSUBSEC. - * |[5] |TSALMEN |Time Stamp Alarm Enable Bit - * | | |Set this bit high enable Ethernet MAC controller to set TSALMIF (EMAC_INTSTS[28]) high when - * | | |EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |0 = Alarm disabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |1 = Alarm enabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * @var EMAC_T::TSSEC - * Offset: 0x110 Time Stamp Counter Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second - * | | |This register reflects the bit [63:32] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSSUBSEC - * Offset: 0x114 Time Stamp Counter Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second - * | | |This register reflects the bit [31:0] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the sub-second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSINC - * Offset: 0x118 Time Stamp Increment Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNTINC |Time Stamp Counter Increment - * | | |Time stamp counter increment value. - * | | |If TSEN (EMAC_TSCTL[0]) is high, EMAC adds EMAC_TSSUBSEC with this 8-bit value every - * | | |time when it wants to increase the EMAC_TSSUBSEC value. - * @var EMAC_T::TSADDEND - * Offset: 0x11C Time Stamp Addend Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDEND |Time Stamp Counter Addend - * | | |This register keeps a 32-bit value for accumulator to enable increment of EMAC_TSSUBSEC. - * | | |If TSEN (EMAC_TSCTL[0]) and TSMODE (EMAC_TSCTL[2]) are both high, EMAC increases accumulator - * | | |with this 32-bit value in each HCLK - * | | |Once the accumulator is overflow, it generates a enable to increase EMAC_TSSUBSEC with an 8-bit - * | | |value kept in register EMAC_TSINC. - * @var EMAC_T::UPDSEC - * Offset: 0x120 Time Stamp Update Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSEC with this 32-bit value. - * @var EMAC_T::UPDSUBSEC - * Offset: 0x124 Time Stamp Update Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSUBSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSUBSEC with this 32-bit value. - * @var EMAC_T::ALMSEC - * Offset: 0x128 Time Stamp Alarm Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Alarm - * | | |Time stamp counter second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - * @var EMAC_T::ALMSUBSEC - * Offset: 0x12C Time Stamp Alarm Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Alarm - * | | |Time stamp counter sub-second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - */ - __IO uint32_t CAMCTL; /*!< [0x0000] CAM Comparison Control Register */ - __IO uint32_t CAMEN; /*!< [0x0004] CAM Enable Register */ - __IO uint32_t CAM0M; /*!< [0x0008] CAM0 Most Significant Word Register */ - __IO uint32_t CAM0L; /*!< [0x000c] CAM0 Least Significant Word Register */ - __IO uint32_t CAM1M; /*!< [0x0010] CAM1 Most Significant Word Register */ - __IO uint32_t CAM1L; /*!< [0x0014] CAM1 Least Significant Word Register */ - __IO uint32_t CAM2M; /*!< [0x0018] CAM2 Most Significant Word Register */ - __IO uint32_t CAM2L; /*!< [0x001c] CAM2 Least Significant Word Register */ - __IO uint32_t CAM3M; /*!< [0x0020] CAM3 Most Significant Word Register */ - __IO uint32_t CAM3L; /*!< [0x0024] CAM3 Least Significant Word Register */ - __IO uint32_t CAM4M; /*!< [0x0028] CAM4 Most Significant Word Register */ - __IO uint32_t CAM4L; /*!< [0x002c] CAM4 Least Significant Word Register */ - __IO uint32_t CAM5M; /*!< [0x0030] CAM5 Most Significant Word Register */ - __IO uint32_t CAM5L; /*!< [0x0034] CAM5 Least Significant Word Register */ - __IO uint32_t CAM6M; /*!< [0x0038] CAM6 Most Significant Word Register */ - __IO uint32_t CAM6L; /*!< [0x003c] CAM6 Least Significant Word Register */ - __IO uint32_t CAM7M; /*!< [0x0040] CAM7 Most Significant Word Register */ - __IO uint32_t CAM7L; /*!< [0x0044] CAM7 Least Significant Word Register */ - __IO uint32_t CAM8M; /*!< [0x0048] CAM8 Most Significant Word Register */ - __IO uint32_t CAM8L; /*!< [0x004c] CAM8 Least Significant Word Register */ - __IO uint32_t CAM9M; /*!< [0x0050] CAM9 Most Significant Word Register */ - __IO uint32_t CAM9L; /*!< [0x0054] CAM9 Least Significant Word Register */ - __IO uint32_t CAM10M; /*!< [0x0058] CAM10 Most Significant Word Register */ - __IO uint32_t CAM10L; /*!< [0x005c] CAM10 Least Significant Word Register */ - __IO uint32_t CAM11M; /*!< [0x0060] CAM11 Most Significant Word Register */ - __IO uint32_t CAM11L; /*!< [0x0064] CAM11 Least Significant Word Register */ - __IO uint32_t CAM12M; /*!< [0x0068] CAM12 Most Significant Word Register */ - __IO uint32_t CAM12L; /*!< [0x006c] CAM12 Least Significant Word Register */ - __IO uint32_t CAM13M; /*!< [0x0070] CAM13 Most Significant Word Register */ - __IO uint32_t CAM13L; /*!< [0x0074] CAM13 Least Significant Word Register */ - __IO uint32_t CAM14M; /*!< [0x0078] CAM14 Most Significant Word Register */ - __IO uint32_t CAM14L; /*!< [0x007c] CAM14 Least Significant Word Register */ - __IO uint32_t CAM15MSB; /*!< [0x0080] CAM15 Most Significant Word Register */ - __IO uint32_t CAM15LSB; /*!< [0x0084] CAM15 Least Significant Word Register */ - __IO uint32_t TXDSA; /*!< [0x0088] Transmit Descriptor Link List Start Address Register */ - __IO uint32_t RXDSA; /*!< [0x008c] Receive Descriptor Link List Start Address Register */ - __IO uint32_t CTL; /*!< [0x0090] MAC Control Register */ - __IO uint32_t MIIMDAT; /*!< [0x0094] MII Management Data Register */ - __IO uint32_t MIIMCTL; /*!< [0x0098] MII Management Control and Address Register */ - __IO uint32_t FIFOCTL; /*!< [0x009c] FIFO Threshold Control Register */ - __O uint32_t TXST; /*!< [0x00a0] Transmit Start Demand Register */ - __O uint32_t RXST; /*!< [0x00a4] Receive Start Demand Register */ - __IO uint32_t MRFL; /*!< [0x00a8] Maximum Receive Frame Control Register */ - __IO uint32_t INTEN; /*!< [0x00ac] MAC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x00b0] MAC Interrupt Status Register */ - __IO uint32_t GENSTS; /*!< [0x00b4] MAC General Status Register */ - __IO uint32_t MPCNT; /*!< [0x00b8] Missed Packet Count Register */ - __I uint32_t RPCNT; /*!< [0x00bc] MAC Receive Pause Count Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[2]; - /** @endcond */ - __IO uint32_t FRSTS; /*!< [0x00c8] DMA Receive Frame Status Register */ - __I uint32_t CTXDSA; /*!< [0x00cc] Current Transmit Descriptor Start Address Register */ - __I uint32_t CTXBSA; /*!< [0x00d0] Current Transmit Buffer Start Address Register */ - __I uint32_t CRXDSA; /*!< [0x00d4] Current Receive Descriptor Start Address Register */ - __I uint32_t CRXBSA; /*!< [0x00d8] Current Receive Buffer Start Address Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE1[9]; - /** @endcond */ - __IO uint32_t TSCTL; /*!< [0x0100] Time Stamp Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE2[3]; - /** @endcond */ - __I uint32_t TSSEC; /*!< [0x0110] Time Stamp Counter Second Register */ - __I uint32_t TSSUBSEC; /*!< [0x0114] Time Stamp Counter Sub Second Register */ - __IO uint32_t TSINC; /*!< [0x0118] Time Stamp Increment Register */ - __IO uint32_t TSADDEND; /*!< [0x011c] Time Stamp Addend Register */ - __IO uint32_t UPDSEC; /*!< [0x0120] Time Stamp Update Second Register */ - __IO uint32_t UPDSUBSEC; /*!< [0x0124] Time Stamp Update Sub Second Register */ - __IO uint32_t ALMSEC; /*!< [0x0128] Time Stamp Alarm Second Register */ - __IO uint32_t ALMSUBSEC; /*!< [0x012c] Time Stamp Alarm Sub Second Register */ - -} EMAC_T; - -/** - @addtogroup EMAC_CONST EMAC Bit Field Definition - Constant Definitions for EMAC Controller -@{ */ - -#define EMAC_CAMCTL_AUP_Pos (0) /*!< EMAC_T::CAMCTL: AUP Position */ -#define EMAC_CAMCTL_AUP_Msk (0x1ul << EMAC_CAMCTL_AUP_Pos) /*!< EMAC_T::CAMCTL: AUP Mask */ - -#define EMAC_CAMCTL_AMP_Pos (1) /*!< EMAC_T::CAMCTL: AMP Position */ -#define EMAC_CAMCTL_AMP_Msk (0x1ul << EMAC_CAMCTL_AMP_Pos) /*!< EMAC_T::CAMCTL: AMP Mask */ - -#define EMAC_CAMCTL_ABP_Pos (2) /*!< EMAC_T::CAMCTL: ABP Position */ -#define EMAC_CAMCTL_ABP_Msk (0x1ul << EMAC_CAMCTL_ABP_Pos) /*!< EMAC_T::CAMCTL: ABP Mask */ - -#define EMAC_CAMCTL_COMPEN_Pos (3) /*!< EMAC_T::CAMCTL: COMPEN Position */ -#define EMAC_CAMCTL_COMPEN_Msk (0x1ul << EMAC_CAMCTL_COMPEN_Pos) /*!< EMAC_T::CAMCTL: COMPEN Mask */ - -#define EMAC_CAMCTL_CMPEN_Pos (4) /*!< EMAC_T::CAMCTL: CMPEN Position */ -#define EMAC_CAMCTL_CMPEN_Msk (0x1ul << EMAC_CAMCTL_CMPEN_Pos) /*!< EMAC_T::CAMCTL: CMPEN Mask */ - -#define EMAC_CAMEN_CAMxEN_Pos (0) /*!< EMAC_T::CAMEN: CAMxEN Position */ -#define EMAC_CAMEN_CAMxEN_Msk (0x1ul << EMAC_CAMEN_CAMxEN_Pos) /*!< EMAC_T::CAMEN: CAMxEN Mask */ - -#define EMAC_CAM0M_MACADDR2_Pos (0) /*!< EMAC_T::CAM0M: MACADDR2 Position */ -#define EMAC_CAM0M_MACADDR2_Msk (0xfful << EMAC_CAM0M_MACADDR2_Pos) /*!< EMAC_T::CAM0M: MACADDR2 Mask */ - -#define EMAC_CAM0M_MACADDR3_Pos (8) /*!< EMAC_T::CAM0M: MACADDR3 Position */ -#define EMAC_CAM0M_MACADDR3_Msk (0xfful << EMAC_CAM0M_MACADDR3_Pos) /*!< EMAC_T::CAM0M: MACADDR3 Mask */ - -#define EMAC_CAM0M_MACADDR4_Pos (16) /*!< EMAC_T::CAM0M: MACADDR4 Position */ -#define EMAC_CAM0M_MACADDR4_Msk (0xfful << EMAC_CAM0M_MACADDR4_Pos) /*!< EMAC_T::CAM0M: MACADDR4 Mask */ - -#define EMAC_CAM0M_MACADDR5_Pos (24) /*!< EMAC_T::CAM0M: MACADDR5 Position */ -#define EMAC_CAM0M_MACADDR5_Msk (0xfful << EMAC_CAM0M_MACADDR5_Pos) /*!< EMAC_T::CAM0M: MACADDR5 Mask */ - -#define EMAC_CAM0L_MACADDR0_Pos (16) /*!< EMAC_T::CAM0L: MACADDR0 Position */ -#define EMAC_CAM0L_MACADDR0_Msk (0xfful << EMAC_CAM0L_MACADDR0_Pos) /*!< EMAC_T::CAM0L: MACADDR0 Mask */ - -#define EMAC_CAM0L_MACADDR1_Pos (24) /*!< EMAC_T::CAM0L: MACADDR1 Position */ -#define EMAC_CAM0L_MACADDR1_Msk (0xfful << EMAC_CAM0L_MACADDR1_Pos) /*!< EMAC_T::CAM0L: MACADDR1 Mask */ - -#define EMAC_CAM1M_MACADDR2_Pos (0) /*!< EMAC_T::CAM1M: MACADDR2 Position */ -#define EMAC_CAM1M_MACADDR2_Msk (0xfful << EMAC_CAM1M_MACADDR2_Pos) /*!< EMAC_T::CAM1M: MACADDR2 Mask */ - -#define EMAC_CAM1M_MACADDR3_Pos (8) /*!< EMAC_T::CAM1M: MACADDR3 Position */ -#define EMAC_CAM1M_MACADDR3_Msk (0xfful << EMAC_CAM1M_MACADDR3_Pos) /*!< EMAC_T::CAM1M: MACADDR3 Mask */ - -#define EMAC_CAM1M_MACADDR4_Pos (16) /*!< EMAC_T::CAM1M: MACADDR4 Position */ -#define EMAC_CAM1M_MACADDR4_Msk (0xfful << EMAC_CAM1M_MACADDR4_Pos) /*!< EMAC_T::CAM1M: MACADDR4 Mask */ - -#define EMAC_CAM1M_MACADDR5_Pos (24) /*!< EMAC_T::CAM1M: MACADDR5 Position */ -#define EMAC_CAM1M_MACADDR5_Msk (0xfful << EMAC_CAM1M_MACADDR5_Pos) /*!< EMAC_T::CAM1M: MACADDR5 Mask */ - -#define EMAC_CAM1L_MACADDR0_Pos (16) /*!< EMAC_T::CAM1L: MACADDR0 Position */ -#define EMAC_CAM1L_MACADDR0_Msk (0xfful << EMAC_CAM1L_MACADDR0_Pos) /*!< EMAC_T::CAM1L: MACADDR0 Mask */ - -#define EMAC_CAM1L_MACADDR1_Pos (24) /*!< EMAC_T::CAM1L: MACADDR1 Position */ -#define EMAC_CAM1L_MACADDR1_Msk (0xfful << EMAC_CAM1L_MACADDR1_Pos) /*!< EMAC_T::CAM1L: MACADDR1 Mask */ - -#define EMAC_CAM2M_MACADDR2_Pos (0) /*!< EMAC_T::CAM2M: MACADDR2 Position */ -#define EMAC_CAM2M_MACADDR2_Msk (0xfful << EMAC_CAM2M_MACADDR2_Pos) /*!< EMAC_T::CAM2M: MACADDR2 Mask */ - -#define EMAC_CAM2M_MACADDR3_Pos (8) /*!< EMAC_T::CAM2M: MACADDR3 Position */ -#define EMAC_CAM2M_MACADDR3_Msk (0xfful << EMAC_CAM2M_MACADDR3_Pos) /*!< EMAC_T::CAM2M: MACADDR3 Mask */ - -#define EMAC_CAM2M_MACADDR4_Pos (16) /*!< EMAC_T::CAM2M: MACADDR4 Position */ -#define EMAC_CAM2M_MACADDR4_Msk (0xfful << EMAC_CAM2M_MACADDR4_Pos) /*!< EMAC_T::CAM2M: MACADDR4 Mask */ - -#define EMAC_CAM2M_MACADDR5_Pos (24) /*!< EMAC_T::CAM2M: MACADDR5 Position */ -#define EMAC_CAM2M_MACADDR5_Msk (0xfful << EMAC_CAM2M_MACADDR5_Pos) /*!< EMAC_T::CAM2M: MACADDR5 Mask */ - -#define EMAC_CAM2L_MACADDR0_Pos (16) /*!< EMAC_T::CAM2L: MACADDR0 Position */ -#define EMAC_CAM2L_MACADDR0_Msk (0xfful << EMAC_CAM2L_MACADDR0_Pos) /*!< EMAC_T::CAM2L: MACADDR0 Mask */ - -#define EMAC_CAM2L_MACADDR1_Pos (24) /*!< EMAC_T::CAM2L: MACADDR1 Position */ -#define EMAC_CAM2L_MACADDR1_Msk (0xfful << EMAC_CAM2L_MACADDR1_Pos) /*!< EMAC_T::CAM2L: MACADDR1 Mask */ - -#define EMAC_CAM3M_MACADDR2_Pos (0) /*!< EMAC_T::CAM3M: MACADDR2 Position */ -#define EMAC_CAM3M_MACADDR2_Msk (0xfful << EMAC_CAM3M_MACADDR2_Pos) /*!< EMAC_T::CAM3M: MACADDR2 Mask */ - -#define EMAC_CAM3M_MACADDR3_Pos (8) /*!< EMAC_T::CAM3M: MACADDR3 Position */ -#define EMAC_CAM3M_MACADDR3_Msk (0xfful << EMAC_CAM3M_MACADDR3_Pos) /*!< EMAC_T::CAM3M: MACADDR3 Mask */ - -#define EMAC_CAM3M_MACADDR4_Pos (16) /*!< EMAC_T::CAM3M: MACADDR4 Position */ -#define EMAC_CAM3M_MACADDR4_Msk (0xfful << EMAC_CAM3M_MACADDR4_Pos) /*!< EMAC_T::CAM3M: MACADDR4 Mask */ - -#define EMAC_CAM3M_MACADDR5_Pos (24) /*!< EMAC_T::CAM3M: MACADDR5 Position */ -#define EMAC_CAM3M_MACADDR5_Msk (0xfful << EMAC_CAM3M_MACADDR5_Pos) /*!< EMAC_T::CAM3M: MACADDR5 Mask */ - -#define EMAC_CAM3L_MACADDR0_Pos (16) /*!< EMAC_T::CAM3L: MACADDR0 Position */ -#define EMAC_CAM3L_MACADDR0_Msk (0xfful << EMAC_CAM3L_MACADDR0_Pos) /*!< EMAC_T::CAM3L: MACADDR0 Mask */ - -#define EMAC_CAM3L_MACADDR1_Pos (24) /*!< EMAC_T::CAM3L: MACADDR1 Position */ -#define EMAC_CAM3L_MACADDR1_Msk (0xfful << EMAC_CAM3L_MACADDR1_Pos) /*!< EMAC_T::CAM3L: MACADDR1 Mask */ - -#define EMAC_CAM4M_MACADDR2_Pos (0) /*!< EMAC_T::CAM4M: MACADDR2 Position */ -#define EMAC_CAM4M_MACADDR2_Msk (0xfful << EMAC_CAM4M_MACADDR2_Pos) /*!< EMAC_T::CAM4M: MACADDR2 Mask */ - -#define EMAC_CAM4M_MACADDR3_Pos (8) /*!< EMAC_T::CAM4M: MACADDR3 Position */ -#define EMAC_CAM4M_MACADDR3_Msk (0xfful << EMAC_CAM4M_MACADDR3_Pos) /*!< EMAC_T::CAM4M: MACADDR3 Mask */ - -#define EMAC_CAM4M_MACADDR4_Pos (16) /*!< EMAC_T::CAM4M: MACADDR4 Position */ -#define EMAC_CAM4M_MACADDR4_Msk (0xfful << EMAC_CAM4M_MACADDR4_Pos) /*!< EMAC_T::CAM4M: MACADDR4 Mask */ - -#define EMAC_CAM4M_MACADDR5_Pos (24) /*!< EMAC_T::CAM4M: MACADDR5 Position */ -#define EMAC_CAM4M_MACADDR5_Msk (0xfful << EMAC_CAM4M_MACADDR5_Pos) /*!< EMAC_T::CAM4M: MACADDR5 Mask */ - -#define EMAC_CAM4L_MACADDR0_Pos (16) /*!< EMAC_T::CAM4L: MACADDR0 Position */ -#define EMAC_CAM4L_MACADDR0_Msk (0xfful << EMAC_CAM4L_MACADDR0_Pos) /*!< EMAC_T::CAM4L: MACADDR0 Mask */ - -#define EMAC_CAM4L_MACADDR1_Pos (24) /*!< EMAC_T::CAM4L: MACADDR1 Position */ -#define EMAC_CAM4L_MACADDR1_Msk (0xfful << EMAC_CAM4L_MACADDR1_Pos) /*!< EMAC_T::CAM4L: MACADDR1 Mask */ - -#define EMAC_CAM5M_MACADDR2_Pos (0) /*!< EMAC_T::CAM5M: MACADDR2 Position */ -#define EMAC_CAM5M_MACADDR2_Msk (0xfful << EMAC_CAM5M_MACADDR2_Pos) /*!< EMAC_T::CAM5M: MACADDR2 Mask */ - -#define EMAC_CAM5M_MACADDR3_Pos (8) /*!< EMAC_T::CAM5M: MACADDR3 Position */ -#define EMAC_CAM5M_MACADDR3_Msk (0xfful << EMAC_CAM5M_MACADDR3_Pos) /*!< EMAC_T::CAM5M: MACADDR3 Mask */ - -#define EMAC_CAM5M_MACADDR4_Pos (16) /*!< EMAC_T::CAM5M: MACADDR4 Position */ -#define EMAC_CAM5M_MACADDR4_Msk (0xfful << EMAC_CAM5M_MACADDR4_Pos) /*!< EMAC_T::CAM5M: MACADDR4 Mask */ - -#define EMAC_CAM5M_MACADDR5_Pos (24) /*!< EMAC_T::CAM5M: MACADDR5 Position */ -#define EMAC_CAM5M_MACADDR5_Msk (0xfful << EMAC_CAM5M_MACADDR5_Pos) /*!< EMAC_T::CAM5M: MACADDR5 Mask */ - -#define EMAC_CAM5L_MACADDR0_Pos (16) /*!< EMAC_T::CAM5L: MACADDR0 Position */ -#define EMAC_CAM5L_MACADDR0_Msk (0xfful << EMAC_CAM5L_MACADDR0_Pos) /*!< EMAC_T::CAM5L: MACADDR0 Mask */ - -#define EMAC_CAM5L_MACADDR1_Pos (24) /*!< EMAC_T::CAM5L: MACADDR1 Position */ -#define EMAC_CAM5L_MACADDR1_Msk (0xfful << EMAC_CAM5L_MACADDR1_Pos) /*!< EMAC_T::CAM5L: MACADDR1 Mask */ - -#define EMAC_CAM6M_MACADDR2_Pos (0) /*!< EMAC_T::CAM6M: MACADDR2 Position */ -#define EMAC_CAM6M_MACADDR2_Msk (0xfful << EMAC_CAM6M_MACADDR2_Pos) /*!< EMAC_T::CAM6M: MACADDR2 Mask */ - -#define EMAC_CAM6M_MACADDR3_Pos (8) /*!< EMAC_T::CAM6M: MACADDR3 Position */ -#define EMAC_CAM6M_MACADDR3_Msk (0xfful << EMAC_CAM6M_MACADDR3_Pos) /*!< EMAC_T::CAM6M: MACADDR3 Mask */ - -#define EMAC_CAM6M_MACADDR4_Pos (16) /*!< EMAC_T::CAM6M: MACADDR4 Position */ -#define EMAC_CAM6M_MACADDR4_Msk (0xfful << EMAC_CAM6M_MACADDR4_Pos) /*!< EMAC_T::CAM6M: MACADDR4 Mask */ - -#define EMAC_CAM6M_MACADDR5_Pos (24) /*!< EMAC_T::CAM6M: MACADDR5 Position */ -#define EMAC_CAM6M_MACADDR5_Msk (0xfful << EMAC_CAM6M_MACADDR5_Pos) /*!< EMAC_T::CAM6M: MACADDR5 Mask */ - -#define EMAC_CAM6L_MACADDR0_Pos (16) /*!< EMAC_T::CAM6L: MACADDR0 Position */ -#define EMAC_CAM6L_MACADDR0_Msk (0xfful << EMAC_CAM6L_MACADDR0_Pos) /*!< EMAC_T::CAM6L: MACADDR0 Mask */ - -#define EMAC_CAM6L_MACADDR1_Pos (24) /*!< EMAC_T::CAM6L: MACADDR1 Position */ -#define EMAC_CAM6L_MACADDR1_Msk (0xfful << EMAC_CAM6L_MACADDR1_Pos) /*!< EMAC_T::CAM6L: MACADDR1 Mask */ - -#define EMAC_CAM7M_MACADDR2_Pos (0) /*!< EMAC_T::CAM7M: MACADDR2 Position */ -#define EMAC_CAM7M_MACADDR2_Msk (0xfful << EMAC_CAM7M_MACADDR2_Pos) /*!< EMAC_T::CAM7M: MACADDR2 Mask */ - -#define EMAC_CAM7M_MACADDR3_Pos (8) /*!< EMAC_T::CAM7M: MACADDR3 Position */ -#define EMAC_CAM7M_MACADDR3_Msk (0xfful << EMAC_CAM7M_MACADDR3_Pos) /*!< EMAC_T::CAM7M: MACADDR3 Mask */ - -#define EMAC_CAM7M_MACADDR4_Pos (16) /*!< EMAC_T::CAM7M: MACADDR4 Position */ -#define EMAC_CAM7M_MACADDR4_Msk (0xfful << EMAC_CAM7M_MACADDR4_Pos) /*!< EMAC_T::CAM7M: MACADDR4 Mask */ - -#define EMAC_CAM7M_MACADDR5_Pos (24) /*!< EMAC_T::CAM7M: MACADDR5 Position */ -#define EMAC_CAM7M_MACADDR5_Msk (0xfful << EMAC_CAM7M_MACADDR5_Pos) /*!< EMAC_T::CAM7M: MACADDR5 Mask */ - -#define EMAC_CAM7L_MACADDR0_Pos (16) /*!< EMAC_T::CAM7L: MACADDR0 Position */ -#define EMAC_CAM7L_MACADDR0_Msk (0xfful << EMAC_CAM7L_MACADDR0_Pos) /*!< EMAC_T::CAM7L: MACADDR0 Mask */ - -#define EMAC_CAM7L_MACADDR1_Pos (24) /*!< EMAC_T::CAM7L: MACADDR1 Position */ -#define EMAC_CAM7L_MACADDR1_Msk (0xfful << EMAC_CAM7L_MACADDR1_Pos) /*!< EMAC_T::CAM7L: MACADDR1 Mask */ - -#define EMAC_CAM8M_MACADDR2_Pos (0) /*!< EMAC_T::CAM8M: MACADDR2 Position */ -#define EMAC_CAM8M_MACADDR2_Msk (0xfful << EMAC_CAM8M_MACADDR2_Pos) /*!< EMAC_T::CAM8M: MACADDR2 Mask */ - -#define EMAC_CAM8M_MACADDR3_Pos (8) /*!< EMAC_T::CAM8M: MACADDR3 Position */ -#define EMAC_CAM8M_MACADDR3_Msk (0xfful << EMAC_CAM8M_MACADDR3_Pos) /*!< EMAC_T::CAM8M: MACADDR3 Mask */ - -#define EMAC_CAM8M_MACADDR4_Pos (16) /*!< EMAC_T::CAM8M: MACADDR4 Position */ -#define EMAC_CAM8M_MACADDR4_Msk (0xfful << EMAC_CAM8M_MACADDR4_Pos) /*!< EMAC_T::CAM8M: MACADDR4 Mask */ - -#define EMAC_CAM8M_MACADDR5_Pos (24) /*!< EMAC_T::CAM8M: MACADDR5 Position */ -#define EMAC_CAM8M_MACADDR5_Msk (0xfful << EMAC_CAM8M_MACADDR5_Pos) /*!< EMAC_T::CAM8M: MACADDR5 Mask */ - -#define EMAC_CAM8L_MACADDR0_Pos (16) /*!< EMAC_T::CAM8L: MACADDR0 Position */ -#define EMAC_CAM8L_MACADDR0_Msk (0xfful << EMAC_CAM8L_MACADDR0_Pos) /*!< EMAC_T::CAM8L: MACADDR0 Mask */ - -#define EMAC_CAM8L_MACADDR1_Pos (24) /*!< EMAC_T::CAM8L: MACADDR1 Position */ -#define EMAC_CAM8L_MACADDR1_Msk (0xfful << EMAC_CAM8L_MACADDR1_Pos) /*!< EMAC_T::CAM8L: MACADDR1 Mask */ - -#define EMAC_CAM9M_MACADDR2_Pos (0) /*!< EMAC_T::CAM9M: MACADDR2 Position */ -#define EMAC_CAM9M_MACADDR2_Msk (0xfful << EMAC_CAM9M_MACADDR2_Pos) /*!< EMAC_T::CAM9M: MACADDR2 Mask */ - -#define EMAC_CAM9M_MACADDR3_Pos (8) /*!< EMAC_T::CAM9M: MACADDR3 Position */ -#define EMAC_CAM9M_MACADDR3_Msk (0xfful << EMAC_CAM9M_MACADDR3_Pos) /*!< EMAC_T::CAM9M: MACADDR3 Mask */ - -#define EMAC_CAM9M_MACADDR4_Pos (16) /*!< EMAC_T::CAM9M: MACADDR4 Position */ -#define EMAC_CAM9M_MACADDR4_Msk (0xfful << EMAC_CAM9M_MACADDR4_Pos) /*!< EMAC_T::CAM9M: MACADDR4 Mask */ - -#define EMAC_CAM9M_MACADDR5_Pos (24) /*!< EMAC_T::CAM9M: MACADDR5 Position */ -#define EMAC_CAM9M_MACADDR5_Msk (0xfful << EMAC_CAM9M_MACADDR5_Pos) /*!< EMAC_T::CAM9M: MACADDR5 Mask */ - -#define EMAC_CAM9L_MACADDR0_Pos (16) /*!< EMAC_T::CAM9L: MACADDR0 Position */ -#define EMAC_CAM9L_MACADDR0_Msk (0xfful << EMAC_CAM9L_MACADDR0_Pos) /*!< EMAC_T::CAM9L: MACADDR0 Mask */ - -#define EMAC_CAM9L_MACADDR1_Pos (24) /*!< EMAC_T::CAM9L: MACADDR1 Position */ -#define EMAC_CAM9L_MACADDR1_Msk (0xfful << EMAC_CAM9L_MACADDR1_Pos) /*!< EMAC_T::CAM9L: MACADDR1 Mask */ - -#define EMAC_CAM10M_MACADDR2_Pos (0) /*!< EMAC_T::CAM10M: MACADDR2 Position */ -#define EMAC_CAM10M_MACADDR2_Msk (0xfful << EMAC_CAM10M_MACADDR2_Pos) /*!< EMAC_T::CAM10M: MACADDR2 Mask */ - -#define EMAC_CAM10M_MACADDR3_Pos (8) /*!< EMAC_T::CAM10M: MACADDR3 Position */ -#define EMAC_CAM10M_MACADDR3_Msk (0xfful << EMAC_CAM10M_MACADDR3_Pos) /*!< EMAC_T::CAM10M: MACADDR3 Mask */ - -#define EMAC_CAM10M_MACADDR4_Pos (16) /*!< EMAC_T::CAM10M: MACADDR4 Position */ -#define EMAC_CAM10M_MACADDR4_Msk (0xfful << EMAC_CAM10M_MACADDR4_Pos) /*!< EMAC_T::CAM10M: MACADDR4 Mask */ - -#define EMAC_CAM10M_MACADDR5_Pos (24) /*!< EMAC_T::CAM10M: MACADDR5 Position */ -#define EMAC_CAM10M_MACADDR5_Msk (0xfful << EMAC_CAM10M_MACADDR5_Pos) /*!< EMAC_T::CAM10M: MACADDR5 Mask */ - -#define EMAC_CAM10L_MACADDR0_Pos (16) /*!< EMAC_T::CAM10L: MACADDR0 Position */ -#define EMAC_CAM10L_MACADDR0_Msk (0xfful << EMAC_CAM10L_MACADDR0_Pos) /*!< EMAC_T::CAM10L: MACADDR0 Mask */ - -#define EMAC_CAM10L_MACADDR1_Pos (24) /*!< EMAC_T::CAM10L: MACADDR1 Position */ -#define EMAC_CAM10L_MACADDR1_Msk (0xfful << EMAC_CAM10L_MACADDR1_Pos) /*!< EMAC_T::CAM10L: MACADDR1 Mask */ - -#define EMAC_CAM11M_MACADDR2_Pos (0) /*!< EMAC_T::CAM11M: MACADDR2 Position */ -#define EMAC_CAM11M_MACADDR2_Msk (0xfful << EMAC_CAM11M_MACADDR2_Pos) /*!< EMAC_T::CAM11M: MACADDR2 Mask */ - -#define EMAC_CAM11M_MACADDR3_Pos (8) /*!< EMAC_T::CAM11M: MACADDR3 Position */ -#define EMAC_CAM11M_MACADDR3_Msk (0xfful << EMAC_CAM11M_MACADDR3_Pos) /*!< EMAC_T::CAM11M: MACADDR3 Mask */ - -#define EMAC_CAM11M_MACADDR4_Pos (16) /*!< EMAC_T::CAM11M: MACADDR4 Position */ -#define EMAC_CAM11M_MACADDR4_Msk (0xfful << EMAC_CAM11M_MACADDR4_Pos) /*!< EMAC_T::CAM11M: MACADDR4 Mask */ - -#define EMAC_CAM11M_MACADDR5_Pos (24) /*!< EMAC_T::CAM11M: MACADDR5 Position */ -#define EMAC_CAM11M_MACADDR5_Msk (0xfful << EMAC_CAM11M_MACADDR5_Pos) /*!< EMAC_T::CAM11M: MACADDR5 Mask */ - -#define EMAC_CAM11L_MACADDR0_Pos (16) /*!< EMAC_T::CAM11L: MACADDR0 Position */ -#define EMAC_CAM11L_MACADDR0_Msk (0xfful << EMAC_CAM11L_MACADDR0_Pos) /*!< EMAC_T::CAM11L: MACADDR0 Mask */ - -#define EMAC_CAM11L_MACADDR1_Pos (24) /*!< EMAC_T::CAM11L: MACADDR1 Position */ -#define EMAC_CAM11L_MACADDR1_Msk (0xfful << EMAC_CAM11L_MACADDR1_Pos) /*!< EMAC_T::CAM11L: MACADDR1 Mask */ - -#define EMAC_CAM12M_MACADDR2_Pos (0) /*!< EMAC_T::CAM12M: MACADDR2 Position */ -#define EMAC_CAM12M_MACADDR2_Msk (0xfful << EMAC_CAM12M_MACADDR2_Pos) /*!< EMAC_T::CAM12M: MACADDR2 Mask */ - -#define EMAC_CAM12M_MACADDR3_Pos (8) /*!< EMAC_T::CAM12M: MACADDR3 Position */ -#define EMAC_CAM12M_MACADDR3_Msk (0xfful << EMAC_CAM12M_MACADDR3_Pos) /*!< EMAC_T::CAM12M: MACADDR3 Mask */ - -#define EMAC_CAM12M_MACADDR4_Pos (16) /*!< EMAC_T::CAM12M: MACADDR4 Position */ -#define EMAC_CAM12M_MACADDR4_Msk (0xfful << EMAC_CAM12M_MACADDR4_Pos) /*!< EMAC_T::CAM12M: MACADDR4 Mask */ - -#define EMAC_CAM12M_MACADDR5_Pos (24) /*!< EMAC_T::CAM12M: MACADDR5 Position */ -#define EMAC_CAM12M_MACADDR5_Msk (0xfful << EMAC_CAM12M_MACADDR5_Pos) /*!< EMAC_T::CAM12M: MACADDR5 Mask */ - -#define EMAC_CAM12L_MACADDR0_Pos (16) /*!< EMAC_T::CAM12L: MACADDR0 Position */ -#define EMAC_CAM12L_MACADDR0_Msk (0xfful << EMAC_CAM12L_MACADDR0_Pos) /*!< EMAC_T::CAM12L: MACADDR0 Mask */ - -#define EMAC_CAM12L_MACADDR1_Pos (24) /*!< EMAC_T::CAM12L: MACADDR1 Position */ -#define EMAC_CAM12L_MACADDR1_Msk (0xfful << EMAC_CAM12L_MACADDR1_Pos) /*!< EMAC_T::CAM12L: MACADDR1 Mask */ - -#define EMAC_CAM13M_MACADDR2_Pos (0) /*!< EMAC_T::CAM13M: MACADDR2 Position */ -#define EMAC_CAM13M_MACADDR2_Msk (0xfful << EMAC_CAM13M_MACADDR2_Pos) /*!< EMAC_T::CAM13M: MACADDR2 Mask */ - -#define EMAC_CAM13M_MACADDR3_Pos (8) /*!< EMAC_T::CAM13M: MACADDR3 Position */ -#define EMAC_CAM13M_MACADDR3_Msk (0xfful << EMAC_CAM13M_MACADDR3_Pos) /*!< EMAC_T::CAM13M: MACADDR3 Mask */ - -#define EMAC_CAM13M_MACADDR4_Pos (16) /*!< EMAC_T::CAM13M: MACADDR4 Position */ -#define EMAC_CAM13M_MACADDR4_Msk (0xfful << EMAC_CAM13M_MACADDR4_Pos) /*!< EMAC_T::CAM13M: MACADDR4 Mask */ - -#define EMAC_CAM13M_MACADDR5_Pos (24) /*!< EMAC_T::CAM13M: MACADDR5 Position */ -#define EMAC_CAM13M_MACADDR5_Msk (0xfful << EMAC_CAM13M_MACADDR5_Pos) /*!< EMAC_T::CAM13M: MACADDR5 Mask */ - -#define EMAC_CAM13L_MACADDR0_Pos (16) /*!< EMAC_T::CAM13L: MACADDR0 Position */ -#define EMAC_CAM13L_MACADDR0_Msk (0xfful << EMAC_CAM13L_MACADDR0_Pos) /*!< EMAC_T::CAM13L: MACADDR0 Mask */ - -#define EMAC_CAM13L_MACADDR1_Pos (24) /*!< EMAC_T::CAM13L: MACADDR1 Position */ -#define EMAC_CAM13L_MACADDR1_Msk (0xfful << EMAC_CAM13L_MACADDR1_Pos) /*!< EMAC_T::CAM13L: MACADDR1 Mask */ - -#define EMAC_CAM14M_MACADDR2_Pos (0) /*!< EMAC_T::CAM14M: MACADDR2 Position */ -#define EMAC_CAM14M_MACADDR2_Msk (0xfful << EMAC_CAM14M_MACADDR2_Pos) /*!< EMAC_T::CAM14M: MACADDR2 Mask */ - -#define EMAC_CAM14M_MACADDR3_Pos (8) /*!< EMAC_T::CAM14M: MACADDR3 Position */ -#define EMAC_CAM14M_MACADDR3_Msk (0xfful << EMAC_CAM14M_MACADDR3_Pos) /*!< EMAC_T::CAM14M: MACADDR3 Mask */ - -#define EMAC_CAM14M_MACADDR4_Pos (16) /*!< EMAC_T::CAM14M: MACADDR4 Position */ -#define EMAC_CAM14M_MACADDR4_Msk (0xfful << EMAC_CAM14M_MACADDR4_Pos) /*!< EMAC_T::CAM14M: MACADDR4 Mask */ - -#define EMAC_CAM14M_MACADDR5_Pos (24) /*!< EMAC_T::CAM14M: MACADDR5 Position */ -#define EMAC_CAM14M_MACADDR5_Msk (0xfful << EMAC_CAM14M_MACADDR5_Pos) /*!< EMAC_T::CAM14M: MACADDR5 Mask */ - -#define EMAC_CAM14L_MACADDR0_Pos (16) /*!< EMAC_T::CAM14L: MACADDR0 Position */ -#define EMAC_CAM14L_MACADDR0_Msk (0xfful << EMAC_CAM14L_MACADDR0_Pos) /*!< EMAC_T::CAM14L: MACADDR0 Mask */ - -#define EMAC_CAM14L_MACADDR1_Pos (24) /*!< EMAC_T::CAM14L: MACADDR1 Position */ -#define EMAC_CAM14L_MACADDR1_Msk (0xfful << EMAC_CAM14L_MACADDR1_Pos) /*!< EMAC_T::CAM14L: MACADDR1 Mask */ - -#define EMAC_CAM15MSB_OPCODE_Pos (0) /*!< EMAC_T::CAM15MSB: OPCODE Position */ -#define EMAC_CAM15MSB_OPCODE_Msk (0xfffful << EMAC_CAM15MSB_OPCODE_Pos) /*!< EMAC_T::CAM15MSB: OPCODE Mask */ - -#define EMAC_CAM15MSB_LENGTH_Pos (16) /*!< EMAC_T::CAM15MSB: LENGTH Position */ -#define EMAC_CAM15MSB_LENGTH_Msk (0xfffful << EMAC_CAM15MSB_LENGTH_Pos) /*!< EMAC_T::CAM15MSB: LENGTH Mask */ - -#define EMAC_CAM15LSB_OPERAND_Pos (24) /*!< EMAC_T::CAM15LSB: OPERAND Position */ -#define EMAC_CAM15LSB_OPERAND_Msk (0xfful << EMAC_CAM15LSB_OPERAND_Pos) /*!< EMAC_T::CAM15LSB: OPERAND Mask */ - -#define EMAC_TXDSA_TXDSA_Pos (0) /*!< EMAC_T::TXDSA: TXDSA Position */ -#define EMAC_TXDSA_TXDSA_Msk (0xfffffffful << EMAC_TXDSA_TXDSA_Pos) /*!< EMAC_T::TXDSA: TXDSA Mask */ - -#define EMAC_RXDSA_RXDSA_Pos (0) /*!< EMAC_T::RXDSA: RXDSA Position */ -#define EMAC_RXDSA_RXDSA_Msk (0xfffffffful << EMAC_RXDSA_RXDSA_Pos) /*!< EMAC_T::RXDSA: RXDSA Mask */ - -#define EMAC_CTL_RXON_Pos (0) /*!< EMAC_T::CTL: RXON Position */ -#define EMAC_CTL_RXON_Msk (0x1ul << EMAC_CTL_RXON_Pos) /*!< EMAC_T::CTL: RXON Mask */ - -#define EMAC_CTL_ALP_Pos (1) /*!< EMAC_T::CTL: ALP Position */ -#define EMAC_CTL_ALP_Msk (0x1ul << EMAC_CTL_ALP_Pos) /*!< EMAC_T::CTL: ALP Mask */ - -#define EMAC_CTL_ARP_Pos (2) /*!< EMAC_T::CTL: ARP Position */ -#define EMAC_CTL_ARP_Msk (0x1ul << EMAC_CTL_ARP_Pos) /*!< EMAC_T::CTL: ARP Mask */ - -#define EMAC_CTL_ACP_Pos (3) /*!< EMAC_T::CTL: ACP Position */ -#define EMAC_CTL_ACP_Msk (0x1ul << EMAC_CTL_ACP_Pos) /*!< EMAC_T::CTL: ACP Mask */ - -#define EMAC_CTL_AEP_Pos (4) /*!< EMAC_T::CTL: AEP Position */ -#define EMAC_CTL_AEP_Msk (0x1ul << EMAC_CTL_AEP_Pos) /*!< EMAC_T::CTL: AEP Mask */ - -#define EMAC_CTL_STRIPCRC_Pos (5) /*!< EMAC_T::CTL: STRIPCRC Position */ -#define EMAC_CTL_STRIPCRC_Msk (0x1ul << EMAC_CTL_STRIPCRC_Pos) /*!< EMAC_T::CTL: STRIPCRC Mask */ - -#define EMAC_CTL_WOLEN_Pos (6) /*!< EMAC_T::CTL: WOLEN Position */ -#define EMAC_CTL_WOLEN_Msk (0x1ul << EMAC_CTL_WOLEN_Pos) /*!< EMAC_T::CTL: WOLEN Mask */ - -#define EMAC_CTL_TXON_Pos (8) /*!< EMAC_T::CTL: TXON Position */ -#define EMAC_CTL_TXON_Msk (0x1ul << EMAC_CTL_TXON_Pos) /*!< EMAC_T::CTL: TXON Mask */ - -#define EMAC_CTL_NODEF_Pos (9) /*!< EMAC_T::CTL: NODEF Position */ -#define EMAC_CTL_NODEF_Msk (0x1ul << EMAC_CTL_NODEF_Pos) /*!< EMAC_T::CTL: NODEF Mask */ - -#define EMAC_CTL_SDPZ_Pos (16) /*!< EMAC_T::CTL: SDPZ Position */ -#define EMAC_CTL_SDPZ_Msk (0x1ul << EMAC_CTL_SDPZ_Pos) /*!< EMAC_T::CTL: SDPZ Mask */ - -#define EMAC_CTL_SQECHKEN_Pos (17) /*!< EMAC_T::CTL: SQECHKEN Position */ -#define EMAC_CTL_SQECHKEN_Msk (0x1ul << EMAC_CTL_SQECHKEN_Pos) /*!< EMAC_T::CTL: SQECHKEN Mask */ - -#define EMAC_CTL_FUDUP_Pos (18) /*!< EMAC_T::CTL: FUDUP Position */ -#define EMAC_CTL_FUDUP_Msk (0x1ul << EMAC_CTL_FUDUP_Pos) /*!< EMAC_T::CTL: FUDUP Mask */ - -#define EMAC_CTL_RMIIRXCTL_Pos (19) /*!< EMAC_T::CTL: RMIIRXCTL Position */ -#define EMAC_CTL_RMIIRXCTL_Msk (0x1ul << EMAC_CTL_RMIIRXCTL_Pos) /*!< EMAC_T::CTL: RMIIRXCTL Mask */ - -#define EMAC_CTL_OPMODE_Pos (20) /*!< EMAC_T::CTL: OPMODE Position */ -#define EMAC_CTL_OPMODE_Msk (0x1ul << EMAC_CTL_OPMODE_Pos) /*!< EMAC_T::CTL: OPMODE Mask */ - -#define EMAC_CTL_RMIIEN_Pos (22) /*!< EMAC_T::CTL: RMIIEN Position */ -#define EMAC_CTL_RMIIEN_Msk (0x1ul << EMAC_CTL_RMIIEN_Pos) /*!< EMAC_T::CTL: RMIIEN Mask */ - -#define EMAC_CTL_RST_Pos (24) /*!< EMAC_T::CTL: RST Position */ -#define EMAC_CTL_RST_Msk (0x1ul << EMAC_CTL_RST_Pos) /*!< EMAC_T::CTL: RST Mask */ - -#define EMAC_MIIMDAT_DATA_Pos (0) /*!< EMAC_T::MIIMDAT: DATA Position */ -#define EMAC_MIIMDAT_DATA_Msk (0xfffful << EMAC_MIIMDAT_DATA_Pos) /*!< EMAC_T::MIIMDAT: DATA Mask */ - -#define EMAC_MIIMCTL_PHYREG_Pos (0) /*!< EMAC_T::MIIMCTL: PHYREG Position */ -#define EMAC_MIIMCTL_PHYREG_Msk (0x1ful << EMAC_MIIMCTL_PHYREG_Pos) /*!< EMAC_T::MIIMCTL: PHYREG Mask */ - -#define EMAC_MIIMCTL_PHYADDR_Pos (8) /*!< EMAC_T::MIIMCTL: PHYADDR Position */ -#define EMAC_MIIMCTL_PHYADDR_Msk (0x1ful << EMAC_MIIMCTL_PHYADDR_Pos) /*!< EMAC_T::MIIMCTL: PHYADDR Mask */ - -#define EMAC_MIIMCTL_WRITE_Pos (16) /*!< EMAC_T::MIIMCTL: WRITE Position */ -#define EMAC_MIIMCTL_WRITE_Msk (0x1ul << EMAC_MIIMCTL_WRITE_Pos) /*!< EMAC_T::MIIMCTL: WRITE Mask */ - -#define EMAC_MIIMCTL_BUSY_Pos (17) /*!< EMAC_T::MIIMCTL: BUSY Position */ -#define EMAC_MIIMCTL_BUSY_Msk (0x1ul << EMAC_MIIMCTL_BUSY_Pos) /*!< EMAC_T::MIIMCTL: BUSY Mask */ - -#define EMAC_MIIMCTL_PREAMSP_Pos (18) /*!< EMAC_T::MIIMCTL: PREAMSP Position */ -#define EMAC_MIIMCTL_PREAMSP_Msk (0x1ul << EMAC_MIIMCTL_PREAMSP_Pos) /*!< EMAC_T::MIIMCTL: PREAMSP Mask */ - -#define EMAC_MIIMCTL_MDCON_Pos (19) /*!< EMAC_T::MIIMCTL: MDCON Position */ -#define EMAC_MIIMCTL_MDCON_Msk (0x1ul << EMAC_MIIMCTL_MDCON_Pos) /*!< EMAC_T::MIIMCTL: MDCON Mask */ - -#define EMAC_FIFOCTL_RXFIFOTH_Pos (0) /*!< EMAC_T::FIFOCTL: RXFIFOTH Position */ -#define EMAC_FIFOCTL_RXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_RXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: RXFIFOTH Mask */ - -#define EMAC_FIFOCTL_TXFIFOTH_Pos (8) /*!< EMAC_T::FIFOCTL: TXFIFOTH Position */ -#define EMAC_FIFOCTL_TXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_TXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: TXFIFOTH Mask */ - -#define EMAC_FIFOCTL_BURSTLEN_Pos (20) /*!< EMAC_T::FIFOCTL: BURSTLEN Position */ -#define EMAC_FIFOCTL_BURSTLEN_Msk (0x3ul << EMAC_FIFOCTL_BURSTLEN_Pos) /*!< EMAC_T::FIFOCTL: BURSTLEN Mask */ - -#define EMAC_TXST_TXST_Pos (0) /*!< EMAC_T::TXST: TXST Position */ -#define EMAC_TXST_TXST_Msk (0xfffffffful << EMAC_TXST_TXST_Pos) /*!< EMAC_T::TXST: TXST Mask */ - -#define EMAC_RXST_RXST_Pos (0) /*!< EMAC_T::RXST: RXST Position */ -#define EMAC_RXST_RXST_Msk (0xfffffffful << EMAC_RXST_RXST_Pos) /*!< EMAC_T::RXST: RXST Mask */ - -#define EMAC_MRFL_MRFL_Pos (0) /*!< EMAC_T::MRFL: MRFL Position */ -#define EMAC_MRFL_MRFL_Msk (0xfffful << EMAC_MRFL_MRFL_Pos) /*!< EMAC_T::MRFL: MRFL Mask */ - -#define EMAC_INTEN_RXIEN_Pos (0) /*!< EMAC_T::INTEN: RXIEN Position */ -#define EMAC_INTEN_RXIEN_Msk (0x1ul << EMAC_INTEN_RXIEN_Pos) /*!< EMAC_T::INTEN: RXIEN Mask */ - -#define EMAC_INTEN_CRCEIEN_Pos (1) /*!< EMAC_T::INTEN: CRCEIEN Position */ -#define EMAC_INTEN_CRCEIEN_Msk (0x1ul << EMAC_INTEN_CRCEIEN_Pos) /*!< EMAC_T::INTEN: CRCEIEN Mask */ - -#define EMAC_INTEN_RXOVIEN_Pos (2) /*!< EMAC_T::INTEN: RXOVIEN Position */ -#define EMAC_INTEN_RXOVIEN_Msk (0x1ul << EMAC_INTEN_RXOVIEN_Pos) /*!< EMAC_T::INTEN: RXOVIEN Mask */ - -#define EMAC_INTEN_LPIEN_Pos (3) /*!< EMAC_T::INTEN: LPIEN Position */ -#define EMAC_INTEN_LPIEN_Msk (0x1ul << EMAC_INTEN_LPIEN_Pos) /*!< EMAC_T::INTEN: LPIEN Mask */ - -#define EMAC_INTEN_RXGDIEN_Pos (4) /*!< EMAC_T::INTEN: RXGDIEN Position */ -#define EMAC_INTEN_RXGDIEN_Msk (0x1ul << EMAC_INTEN_RXGDIEN_Pos) /*!< EMAC_T::INTEN: RXGDIEN Mask */ - -#define EMAC_INTEN_ALIEIEN_Pos (5) /*!< EMAC_T::INTEN: ALIEIEN Position */ -#define EMAC_INTEN_ALIEIEN_Msk (0x1ul << EMAC_INTEN_ALIEIEN_Pos) /*!< EMAC_T::INTEN: ALIEIEN Mask */ - -#define EMAC_INTEN_RPIEN_Pos (6) /*!< EMAC_T::INTEN: RPIEN Position */ -#define EMAC_INTEN_RPIEN_Msk (0x1ul << EMAC_INTEN_RPIEN_Pos) /*!< EMAC_T::INTEN: RPIEN Mask */ - -#define EMAC_INTEN_MPCOVIEN_Pos (7) /*!< EMAC_T::INTEN: MPCOVIEN Position */ -#define EMAC_INTEN_MPCOVIEN_Msk (0x1ul << EMAC_INTEN_MPCOVIEN_Pos) /*!< EMAC_T::INTEN: MPCOVIEN Mask */ - -#define EMAC_INTEN_MFLEIEN_Pos (8) /*!< EMAC_T::INTEN: MFLEIEN Position */ -#define EMAC_INTEN_MFLEIEN_Msk (0x1ul << EMAC_INTEN_MFLEIEN_Pos) /*!< EMAC_T::INTEN: MFLEIEN Mask */ - -#define EMAC_INTEN_DENIEN_Pos (9) /*!< EMAC_T::INTEN: DENIEN Position */ -#define EMAC_INTEN_DENIEN_Msk (0x1ul << EMAC_INTEN_DENIEN_Pos) /*!< EMAC_T::INTEN: DENIEN Mask */ - -#define EMAC_INTEN_RDUIEN_Pos (10) /*!< EMAC_T::INTEN: RDUIEN Position */ -#define EMAC_INTEN_RDUIEN_Msk (0x1ul << EMAC_INTEN_RDUIEN_Pos) /*!< EMAC_T::INTEN: RDUIEN Mask */ - -#define EMAC_INTEN_RXBEIEN_Pos (11) /*!< EMAC_T::INTEN: RXBEIEN Position */ -#define EMAC_INTEN_RXBEIEN_Msk (0x1ul << EMAC_INTEN_RXBEIEN_Pos) /*!< EMAC_T::INTEN: RXBEIEN Mask */ - -#define EMAC_INTEN_CFRIEN_Pos (14) /*!< EMAC_T::INTEN: CFRIEN Position */ -#define EMAC_INTEN_CFRIEN_Msk (0x1ul << EMAC_INTEN_CFRIEN_Pos) /*!< EMAC_T::INTEN: CFRIEN Mask */ - -#define EMAC_INTEN_WOLIEN_Pos (15) /*!< EMAC_T::INTEN: WOLIEN Position */ -#define EMAC_INTEN_WOLIEN_Msk (0x1ul << EMAC_INTEN_WOLIEN_Pos) /*!< EMAC_T::INTEN: WOLIEN Mask */ - -#define EMAC_INTEN_TXIEN_Pos (16) /*!< EMAC_T::INTEN: TXIEN Position */ -#define EMAC_INTEN_TXIEN_Msk (0x1ul << EMAC_INTEN_TXIEN_Pos) /*!< EMAC_T::INTEN: TXIEN Mask */ - -#define EMAC_INTEN_TXUDIEN_Pos (17) /*!< EMAC_T::INTEN: TXUDIEN Position */ -#define EMAC_INTEN_TXUDIEN_Msk (0x1ul << EMAC_INTEN_TXUDIEN_Pos) /*!< EMAC_T::INTEN: TXUDIEN Mask */ - -#define EMAC_INTEN_TXCPIEN_Pos (18) /*!< EMAC_T::INTEN: TXCPIEN Position */ -#define EMAC_INTEN_TXCPIEN_Msk (0x1ul << EMAC_INTEN_TXCPIEN_Pos) /*!< EMAC_T::INTEN: TXCPIEN Mask */ - -#define EMAC_INTEN_EXDEFIEN_Pos (19) /*!< EMAC_T::INTEN: EXDEFIEN Position */ -#define EMAC_INTEN_EXDEFIEN_Msk (0x1ul << EMAC_INTEN_EXDEFIEN_Pos) /*!< EMAC_T::INTEN: EXDEFIEN Mask */ - -#define EMAC_INTEN_NCSIEN_Pos (20) /*!< EMAC_T::INTEN: NCSIEN Position */ -#define EMAC_INTEN_NCSIEN_Msk (0x1ul << EMAC_INTEN_NCSIEN_Pos) /*!< EMAC_T::INTEN: NCSIEN Mask */ - -#define EMAC_INTEN_TXABTIEN_Pos (21) /*!< EMAC_T::INTEN: TXABTIEN Position */ -#define EMAC_INTEN_TXABTIEN_Msk (0x1ul << EMAC_INTEN_TXABTIEN_Pos) /*!< EMAC_T::INTEN: TXABTIEN Mask */ - -#define EMAC_INTEN_LCIEN_Pos (22) /*!< EMAC_T::INTEN: LCIEN Position */ -#define EMAC_INTEN_LCIEN_Msk (0x1ul << EMAC_INTEN_LCIEN_Pos) /*!< EMAC_T::INTEN: LCIEN Mask */ - -#define EMAC_INTEN_TDUIEN_Pos (23) /*!< EMAC_T::INTEN: TDUIEN Position */ -#define EMAC_INTEN_TDUIEN_Msk (0x1ul << EMAC_INTEN_TDUIEN_Pos) /*!< EMAC_T::INTEN: TDUIEN Mask */ - -#define EMAC_INTEN_TXBEIEN_Pos (24) /*!< EMAC_T::INTEN: TXBEIEN Position */ -#define EMAC_INTEN_TXBEIEN_Msk (0x1ul << EMAC_INTEN_TXBEIEN_Pos) /*!< EMAC_T::INTEN: TXBEIEN Mask */ - -#define EMAC_INTEN_TSALMIEN_Pos (28) /*!< EMAC_T::INTEN: TSALMIEN Position */ -#define EMAC_INTEN_TSALMIEN_Msk (0x1ul << EMAC_INTEN_TSALMIEN_Pos) /*!< EMAC_T::INTEN: TSALMIEN Mask */ - -#define EMAC_INTSTS_RXIF_Pos (0) /*!< EMAC_T::INTSTS: RXIF Position */ -#define EMAC_INTSTS_RXIF_Msk (0x1ul << EMAC_INTSTS_RXIF_Pos) /*!< EMAC_T::INTSTS: RXIF Mask */ - -#define EMAC_INTSTS_CRCEIF_Pos (1) /*!< EMAC_T::INTSTS: CRCEIF Position */ -#define EMAC_INTSTS_CRCEIF_Msk (0x1ul << EMAC_INTSTS_CRCEIF_Pos) /*!< EMAC_T::INTSTS: CRCEIF Mask */ - -#define EMAC_INTSTS_RXOVIF_Pos (2) /*!< EMAC_T::INTSTS: RXOVIF Position */ -#define EMAC_INTSTS_RXOVIF_Msk (0x1ul << EMAC_INTSTS_RXOVIF_Pos) /*!< EMAC_T::INTSTS: RXOVIF Mask */ - -#define EMAC_INTSTS_LPIF_Pos (3) /*!< EMAC_T::INTSTS: LPIF Position */ -#define EMAC_INTSTS_LPIF_Msk (0x1ul << EMAC_INTSTS_LPIF_Pos) /*!< EMAC_T::INTSTS: LPIF Mask */ - -#define EMAC_INTSTS_RXGDIF_Pos (4) /*!< EMAC_T::INTSTS: RXGDIF Position */ -#define EMAC_INTSTS_RXGDIF_Msk (0x1ul << EMAC_INTSTS_RXGDIF_Pos) /*!< EMAC_T::INTSTS: RXGDIF Mask */ - -#define EMAC_INTSTS_ALIEIF_Pos (5) /*!< EMAC_T::INTSTS: ALIEIF Position */ -#define EMAC_INTSTS_ALIEIF_Msk (0x1ul << EMAC_INTSTS_ALIEIF_Pos) /*!< EMAC_T::INTSTS: ALIEIF Mask */ - -#define EMAC_INTSTS_RPIF_Pos (6) /*!< EMAC_T::INTSTS: RPIF Position */ -#define EMAC_INTSTS_RPIF_Msk (0x1ul << EMAC_INTSTS_RPIF_Pos) /*!< EMAC_T::INTSTS: RPIF Mask */ - -#define EMAC_INTSTS_MPCOVIF_Pos (7) /*!< EMAC_T::INTSTS: MPCOVIF Position */ -#define EMAC_INTSTS_MPCOVIF_Msk (0x1ul << EMAC_INTSTS_MPCOVIF_Pos) /*!< EMAC_T::INTSTS: MPCOVIF Mask */ - -#define EMAC_INTSTS_MFLEIF_Pos (8) /*!< EMAC_T::INTSTS: MFLEIF Position */ -#define EMAC_INTSTS_MFLEIF_Msk (0x1ul << EMAC_INTSTS_MFLEIF_Pos) /*!< EMAC_T::INTSTS: MFLEIF Mask */ - -#define EMAC_INTSTS_DENIF_Pos (9) /*!< EMAC_T::INTSTS: DENIF Position */ -#define EMAC_INTSTS_DENIF_Msk (0x1ul << EMAC_INTSTS_DENIF_Pos) /*!< EMAC_T::INTSTS: DENIF Mask */ - -#define EMAC_INTSTS_RDUIF_Pos (10) /*!< EMAC_T::INTSTS: RDUIF Position */ -#define EMAC_INTSTS_RDUIF_Msk (0x1ul << EMAC_INTSTS_RDUIF_Pos) /*!< EMAC_T::INTSTS: RDUIF Mask */ - -#define EMAC_INTSTS_RXBEIF_Pos (11) /*!< EMAC_T::INTSTS: RXBEIF Position */ -#define EMAC_INTSTS_RXBEIF_Msk (0x1ul << EMAC_INTSTS_RXBEIF_Pos) /*!< EMAC_T::INTSTS: RXBEIF Mask */ - -#define EMAC_INTSTS_CFRIF_Pos (14) /*!< EMAC_T::INTSTS: CFRIF Position */ -#define EMAC_INTSTS_CFRIF_Msk (0x1ul << EMAC_INTSTS_CFRIF_Pos) /*!< EMAC_T::INTSTS: CFRIF Mask */ - -#define EMAC_INTSTS_WOLIF_Pos (15) /*!< EMAC_T::INTSTS: WOLIF Position */ -#define EMAC_INTSTS_WOLIF_Msk (0x1ul << EMAC_INTSTS_WOLIF_Pos) /*!< EMAC_T::INTSTS: WOLIF Mask */ - -#define EMAC_INTSTS_TXIF_Pos (16) /*!< EMAC_T::INTSTS: TXIF Position */ -#define EMAC_INTSTS_TXIF_Msk (0x1ul << EMAC_INTSTS_TXIF_Pos) /*!< EMAC_T::INTSTS: TXIF Mask */ - -#define EMAC_INTSTS_TXUDIF_Pos (17) /*!< EMAC_T::INTSTS: TXUDIF Position */ -#define EMAC_INTSTS_TXUDIF_Msk (0x1ul << EMAC_INTSTS_TXUDIF_Pos) /*!< EMAC_T::INTSTS: TXUDIF Mask */ - -#define EMAC_INTSTS_TXCPIF_Pos (18) /*!< EMAC_T::INTSTS: TXCPIF Position */ -#define EMAC_INTSTS_TXCPIF_Msk (0x1ul << EMAC_INTSTS_TXCPIF_Pos) /*!< EMAC_T::INTSTS: TXCPIF Mask */ - -#define EMAC_INTSTS_EXDEFIF_Pos (19) /*!< EMAC_T::INTSTS: EXDEFIF Position */ -#define EMAC_INTSTS_EXDEFIF_Msk (0x1ul << EMAC_INTSTS_EXDEFIF_Pos) /*!< EMAC_T::INTSTS: EXDEFIF Mask */ - -#define EMAC_INTSTS_NCSIF_Pos (20) /*!< EMAC_T::INTSTS: NCSIF Position */ -#define EMAC_INTSTS_NCSIF_Msk (0x1ul << EMAC_INTSTS_NCSIF_Pos) /*!< EMAC_T::INTSTS: NCSIF Mask */ - -#define EMAC_INTSTS_TXABTIF_Pos (21) /*!< EMAC_T::INTSTS: TXABTIF Position */ -#define EMAC_INTSTS_TXABTIF_Msk (0x1ul << EMAC_INTSTS_TXABTIF_Pos) /*!< EMAC_T::INTSTS: TXABTIF Mask */ - -#define EMAC_INTSTS_LCIF_Pos (22) /*!< EMAC_T::INTSTS: LCIF Position */ -#define EMAC_INTSTS_LCIF_Msk (0x1ul << EMAC_INTSTS_LCIF_Pos) /*!< EMAC_T::INTSTS: LCIF Mask */ - -#define EMAC_INTSTS_TDUIF_Pos (23) /*!< EMAC_T::INTSTS: TDUIF Position */ -#define EMAC_INTSTS_TDUIF_Msk (0x1ul << EMAC_INTSTS_TDUIF_Pos) /*!< EMAC_T::INTSTS: TDUIF Mask */ - -#define EMAC_INTSTS_TXBEIF_Pos (24) /*!< EMAC_T::INTSTS: TXBEIF Position */ -#define EMAC_INTSTS_TXBEIF_Msk (0x1ul << EMAC_INTSTS_TXBEIF_Pos) /*!< EMAC_T::INTSTS: TXBEIF Mask */ - -#define EMAC_INTSTS_TSALMIF_Pos (28) /*!< EMAC_T::INTSTS: TSALMIF Position */ -#define EMAC_INTSTS_TSALMIF_Msk (0x1ul << EMAC_INTSTS_TSALMIF_Pos) /*!< EMAC_T::INTSTS: TSALMIF Mask */ - -#define EMAC_GENSTS_CFR_Pos (0) /*!< EMAC_T::GENSTS: CFR Position */ -#define EMAC_GENSTS_CFR_Msk (0x1ul << EMAC_GENSTS_CFR_Pos) /*!< EMAC_T::GENSTS: CFR Mask */ - -#define EMAC_GENSTS_RXHALT_Pos (1) /*!< EMAC_T::GENSTS: RXHALT Position */ -#define EMAC_GENSTS_RXHALT_Msk (0x1ul << EMAC_GENSTS_RXHALT_Pos) /*!< EMAC_T::GENSTS: RXHALT Mask */ - -#define EMAC_GENSTS_RXFFULL_Pos (2) /*!< EMAC_T::GENSTS: RXFFULL Position */ -#define EMAC_GENSTS_RXFFULL_Msk (0x1ul << EMAC_GENSTS_RXFFULL_Pos) /*!< EMAC_T::GENSTS: RXFFULL Mask */ - -#define EMAC_GENSTS_COLCNT_Pos (4) /*!< EMAC_T::GENSTS: COLCNT Position */ -#define EMAC_GENSTS_COLCNT_Msk (0xful << EMAC_GENSTS_COLCNT_Pos) /*!< EMAC_T::GENSTS: COLCNT Mask */ - -#define EMAC_GENSTS_DEF_Pos (8) /*!< EMAC_T::GENSTS: DEF Position */ -#define EMAC_GENSTS_DEF_Msk (0x1ul << EMAC_GENSTS_DEF_Pos) /*!< EMAC_T::GENSTS: DEF Mask */ - -#define EMAC_GENSTS_TXPAUSED_Pos (9) /*!< EMAC_T::GENSTS: TXPAUSED Position */ -#define EMAC_GENSTS_TXPAUSED_Msk (0x1ul << EMAC_GENSTS_TXPAUSED_Pos) /*!< EMAC_T::GENSTS: TXPAUSED Mask */ - -#define EMAC_GENSTS_SQE_Pos (10) /*!< EMAC_T::GENSTS: SQE Position */ -#define EMAC_GENSTS_SQE_Msk (0x1ul << EMAC_GENSTS_SQE_Pos) /*!< EMAC_T::GENSTS: SQE Mask */ - -#define EMAC_GENSTS_TXHALT_Pos (11) /*!< EMAC_T::GENSTS: TXHALT Position */ -#define EMAC_GENSTS_TXHALT_Msk (0x1ul << EMAC_GENSTS_TXHALT_Pos) /*!< EMAC_T::GENSTS: TXHALT Mask */ - -#define EMAC_GENSTS_RPSTS_Pos (12) /*!< EMAC_T::GENSTS: RPSTS Position */ -#define EMAC_GENSTS_RPSTS_Msk (0x1ul << EMAC_GENSTS_RPSTS_Pos) /*!< EMAC_T::GENSTS: RPSTS Mask */ - -#define EMAC_MPCNT_MPCNT_Pos (0) /*!< EMAC_T::MPCNT: MPCNT Position */ -#define EMAC_MPCNT_MPCNT_Msk (0xfffful << EMAC_MPCNT_MPCNT_Pos) /*!< EMAC_T::MPCNT: MPCNT Mask */ - -#define EMAC_RPCNT_RPCNT_Pos (0) /*!< EMAC_T::RPCNT: RPCNT Position */ -#define EMAC_RPCNT_RPCNT_Msk (0xfffful << EMAC_RPCNT_RPCNT_Pos) /*!< EMAC_T::RPCNT: RPCNT Mask */ - -#define EMAC_FRSTS_RXFLT_Pos (0) /*!< EMAC_T::FRSTS: RXFLT Position */ -#define EMAC_FRSTS_RXFLT_Msk (0xfffful << EMAC_FRSTS_RXFLT_Pos) /*!< EMAC_T::FRSTS: RXFLT Mask */ - -#define EMAC_CTXDSA_CTXDSA_Pos (0) /*!< EMAC_T::CTXDSA: CTXDSA Position */ -#define EMAC_CTXDSA_CTXDSA_Msk (0xfffffffful << EMAC_CTXDSA_CTXDSA_Pos) /*!< EMAC_T::CTXDSA: CTXDSA Mask */ - -#define EMAC_CTXBSA_CTXBSA_Pos (0) /*!< EMAC_T::CTXBSA: CTXBSA Position */ -#define EMAC_CTXBSA_CTXBSA_Msk (0xfffffffful << EMAC_CTXBSA_CTXBSA_Pos) /*!< EMAC_T::CTXBSA: CTXBSA Mask */ - -#define EMAC_CRXDSA_CRXDSA_Pos (0) /*!< EMAC_T::CRXDSA: CRXDSA Position */ -#define EMAC_CRXDSA_CRXDSA_Msk (0xfffffffful << EMAC_CRXDSA_CRXDSA_Pos) /*!< EMAC_T::CRXDSA: CRXDSA Mask */ - -#define EMAC_CRXBSA_CRXBSA_Pos (0) /*!< EMAC_T::CRXBSA: CRXBSA Position */ -#define EMAC_CRXBSA_CRXBSA_Msk (0xfffffffful << EMAC_CRXBSA_CRXBSA_Pos) /*!< EMAC_T::CRXBSA: CRXBSA Mask */ - -#define EMAC_TSCTL_TSEN_Pos (0) /*!< EMAC_T::TSCTL: TSEN Position */ -#define EMAC_TSCTL_TSEN_Msk (0x1ul << EMAC_TSCTL_TSEN_Pos) /*!< EMAC_T::TSCTL: TSEN Mask */ - -#define EMAC_TSCTL_TSIEN_Pos (1) /*!< EMAC_T::TSCTL: TSIEN Position */ -#define EMAC_TSCTL_TSIEN_Msk (0x1ul << EMAC_TSCTL_TSIEN_Pos) /*!< EMAC_T::TSCTL: TSIEN Mask */ - -#define EMAC_TSCTL_TSMODE_Pos (2) /*!< EMAC_T::TSCTL: TSMODE Position */ -#define EMAC_TSCTL_TSMODE_Msk (0x1ul << EMAC_TSCTL_TSMODE_Pos) /*!< EMAC_T::TSCTL: TSMODE Mask */ - -#define EMAC_TSCTL_TSUPDATE_Pos (3) /*!< EMAC_T::TSCTL: TSUPDATE Position */ -#define EMAC_TSCTL_TSUPDATE_Msk (0x1ul << EMAC_TSCTL_TSUPDATE_Pos) /*!< EMAC_T::TSCTL: TSUPDATE Mask */ - -#define EMAC_TSCTL_TSALMEN_Pos (5) /*!< EMAC_T::TSCTL: TSALMEN Position */ -#define EMAC_TSCTL_TSALMEN_Msk (0x1ul << EMAC_TSCTL_TSALMEN_Pos) /*!< EMAC_T::TSCTL: TSALMEN Mask */ - -#define EMAC_TSSEC_SEC_Pos (0) /*!< EMAC_T::TSSEC: SEC Position */ -#define EMAC_TSSEC_SEC_Msk (0xfffffffful << EMAC_TSSEC_SEC_Pos) /*!< EMAC_T::TSSEC: SEC Mask */ - -#define EMAC_TSSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::TSSUBSEC: SUBSEC Position */ -#define EMAC_TSSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_TSSUBSEC_SUBSEC_Pos) /*!< EMAC_T::TSSUBSEC: SUBSEC Mask */ - -#define EMAC_TSINC_CNTINC_Pos (0) /*!< EMAC_T::TSINC: CNTINC Position */ -#define EMAC_TSINC_CNTINC_Msk (0xfful << EMAC_TSINC_CNTINC_Pos) /*!< EMAC_T::TSINC: CNTINC Mask */ - -#define EMAC_TSADDEND_ADDEND_Pos (0) /*!< EMAC_T::TSADDEND: ADDEND Position */ -#define EMAC_TSADDEND_ADDEND_Msk (0xfffffffful << EMAC_TSADDEND_ADDEND_Pos) /*!< EMAC_T::TSADDEND: ADDEND Mask */ - -#define EMAC_UPDSEC_SEC_Pos (0) /*!< EMAC_T::UPDSEC: SEC Position */ -#define EMAC_UPDSEC_SEC_Msk (0xfffffffful << EMAC_UPDSEC_SEC_Pos) /*!< EMAC_T::UPDSEC: SEC Mask */ - -#define EMAC_UPDSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::UPDSUBSEC: SUBSEC Position */ -#define EMAC_UPDSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_UPDSUBSEC_SUBSEC_Pos) /*!< EMAC_T::UPDSUBSEC: SUBSEC Mask */ - -#define EMAC_ALMSEC_SEC_Pos (0) /*!< EMAC_T::ALMSEC: SEC Position */ -#define EMAC_ALMSEC_SEC_Msk (0xfffffffful << EMAC_ALMSEC_SEC_Pos) /*!< EMAC_T::ALMSEC: SEC Mask */ - -#define EMAC_ALMSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::ALMSUBSEC: SUBSEC Position */ -#define EMAC_ALMSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_ALMSUBSEC_SUBSEC_Pos) /*!< EMAC_T::ALMSUBSEC: SUBSEC Mask */ - -/**@}*/ /* EMAC_CONST */ -/**@}*/ /* end of EMAC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EMAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_2d.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_2d.h deleted file mode 100644 index 8844f5040b8..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_2d.h +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************//** -* @file 2d.h -* @brief N9H30 2DGE driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_2D_H__ -#define __NU_2D_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_GE2D_Driver GE2D Driver - @{ -*/ - -/** @addtogroup N9H30_GE2D_EXPORTED_CONSTANTS GE2D Exported Constants - @{ -*/ - -/// @cond HIDDEN_SYMBOLS -typedef struct -{ - uint32_t PatternA; - uint32_t PatternB; -} MONOPATTERN; - -#define COLOR_KEY 0xFF000000 -/// @endcond HIDDEN_SYMBOLS - -/////////////////////////////////////////////////////////////////////////////// -// Definition of ROP2 -/////////////////////////////////////////////////////////////////////////////// -#define BLACKNESS 0x00 /*!< rop code: 0 */ -#define DSTINVERT 0x55 /*!< rop code: Dn */ -#define MERGECOPY 0xC0 /*!< rop code: PSa */ -#define MERGEPAINT 0xBB /*!< rop code: DSno */ -#define NOTSRCCOPY 0x33 /*!< rop code: Sn */ -#define NOTSRCERASE 0x11 /*!< rop code: DSon */ -#define PATCOPY 0xF0 /*!< rop code: P */ -#define PATINVERT 0x5A /*!< rop code: DPx */ -#define PATPAINT 0xFB /*!< rop code: DPSnoo */ -#define SRCAND 0x88 /*!< rop code: DSa */ -#define SRCCOPY 0xCC /*!< rop code: S */ -#define SRCERASE 0x44 /*!< rop code: SDna */ -#define SRCINVERT 0x66 /*!< rop code: DSx */ -#define SRCPAINT 0xEE /*!< rop code: DSo */ -#define WHITENESS 0xFF /*!< rop code: 1 */ - -/////////////////////////////////////////////////////////////////////////////// -// Definition of Pen Styles -/////////////////////////////////////////////////////////////////////////////// -#define PS_SOLID 0xffff /*!< pan style: solid */ //1111111111111111 (1111111111111111) -#define PS_DASH 0xcccc /*!< pan style: dash */ //1100110011001100 (1111000011110000) -#define PS_DOT 0xaaaa /*!< pan style: dot */ //1010101010101010 (1100110011001100) -#define PS_DASHDOT 0xe4e4 /*!< pan style: dash and dot */ //1110010011100100 (1111110000110000) -#define PS_DASHDOTDOT 0xeaea /*!< pan style: dash and two dots */ //1110101011101010 (1111110011001100) -#define PS_NULL 0x0000 /*!< pan style: null */ //0000000000000000 (0000000000000000) - -/////////////////////////////////////////////////////////////////////////////// -// Definition of Brush Styles -// -// HS_HORIZONTAL: 00000000 HS_BDIAGONAL: 00000001 -// 00000000 00000010 -// 00000000 00000100 -// 00000000 00001000 -// 11111111 00010000 -// 00000000 00100000 -// 00000000 01000000 -// 00000000 10000000 -// -// HS_VERTICAL: 00001000 HS_CROSS: 00001000 -// 00001000 00001000 -// 00001000 00001000 -// 00001000 00001000 -// 00001000 11111111 -// 00001000 00001000 -// 00001000 00001000 -// 00001000 00001000 -// -// HS_FDIAGONAL: 10000000 HS_DIAGCROSS: 10000001 -// 01000000 01000010 -// 00100000 00100100 -// 00010000 00011000 -// 00001000 00011000 -// 00000100 00100100 -// 00000010 01000010 -// 00000001 10000001 -/////////////////////////////////////////////////////////////////////////////// -#define HS_HORIZONTAL 0 /*!< brush style: horizontal */ -#define HS_VERTICAL 1 /*!< brush style: vertical */ -#define HS_FDIAGONAL 2 /*!< brush style: fdiagonal */ -#define HS_BDIAGONAL 3 /*!< brush style: bdiagonal */ -#define HS_CROSS 4 /*!< brush style: cross */ -#define HS_DIAGCROSS 5 /*!< brush style: diagcross */ - -#define MODE_OPAQUE 0 /*!< opaque mode */ -#define MODE_TRANSPARENT 1 /*!< transparent mode */ -#define MODE_SRC_TRANSPARENT MODE_TRANSPARENT /*!< source transparent mode */ -#define MODE_DEST_TRANSPARENT 2 /*!< destination transparent mode */ - -#define MODE_INSIDE_CLIP 0 /*!< clip inside */ -#define MODE_OUTSIDE_CLIP 1 /*!< clip outside */ - -#define TYPE_MONO 0 /*!< mono */ -#define TYPE_COLOR 1 /*!< color */ - -#define GE_BPP_8 0x00000000 /*!< 8bpp display */ -#define GE_BPP_16 0x00000010 /*!< 16bpp display */ -#define GE_BPP_32 0x00000020 /*!< 32bpp display */ - -#define RGB332 1 /*!< 8bpp display */ -#define RGB565 2 /*!< 16bpp display */ -#define RGB888 3 /*!< 24bpp display */ - -#define F8x8 0 /*!< 8x8 font support */ -#define F8x16 1 /*!< 8x16 font support */ - -/*@}*/ /* end of group N9H30_GE2D_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_GE2D_EXPORTED_FUNCTIONS GE2D Exported Functions - @{ -*/ - -void ge2dClearScreen(int color); -void ge2dSetWriteMask(int mask); -void ge2dSetSourceOriginStarting(void *ptr); -void ge2dSetDestinationOriginStarting(void *ptr); -void ge2dInit(int bpp, int width, int height, void *destination); -void ge2dReset(void); -void ge2dResetFIFO(void); -void ge2dBitblt_SetDrawMode(int opt, int ckey, int mask); -int ge2dBitblt_SetAlphaMode(int opt, int ks, int kd); -void ge2dBitblt_ScreenToScreen(int srcx, int srcy, int destx, int desty, int width, int height); -void ge2dBitblt_ScreenToScreenRop(int srcx, int srcy, int destx, int desty, int width, int height, int rop); -void ge2dBitblt_SourceToDestination(int srcx, int srcy, int destx, int desty, int width, int height, int srcpitch, int destpitch); -void ge2dClip_SetClip(int x1, int y1, int x2, int y2); -void ge2dClip_SetClipMode(int opt); -void ge2dDrawFrame(int x1, int y1, int x2, int y2, int color, int opt); -void ge2dLine_DrawSolidLine(int x1, int y1, int x2, int y2, int color); -void ge2dLine_DrawSolidLine_RGB565(int x1, int y1, int x2, int y2, int color); -void ge2dLine_DrawStyledLine(int x1, int y1, int x2, int y2, int style, int fgcolor, int bkcolor, int draw_mode); -void ge2dLine_DrawStyledLine_RGB565(int x1, int y1, int x2, int y2, int style, int fgcolor, int bkcolor, int draw_mode); -void ge2dFill_Solid(int dx, int dy, int width, int height, int color); -void ge2dFill_Solid_RGB565(int dx, int dy, int width, int height, int color); -void ge2dFill_SolidBackground(int dx, int dy, int width, int height, int color); -void ge2dFill_ColorPattern(int dx, int dy, int width, int height); -void ge2dFill_MonoPattern(int dx, int dy, int width, int height, int opt); -void ge2dFill_ColorPatternROP(int sx, int sy, int width, int height, int rop); -void ge2dFill_MonoPatternROP(int sx, int sy, int width, int height, int rop, int opt); -void ge2dFill_TileBlt(int srcx, int srcy, int destx, int desty, int width, int height, int x_count, int y_count); -void ge2dHostBlt_Write(int x, int y, int width, int height, void *buf); -void ge2dHostBlt_Read(int x, int y, int width, int height, void *buf); -void ge2dHostBlt_Sprite(int x, int y, int width, int height, void *buf); -void ge2dRotation(int srcx, int srcy, int destx, int desty, int width, int height, int ctl); -void ge2dSpriteBlt_Screen(int destx, int desty, int sprite_width, int sprite_height, void *buf); -void ge2dSpriteBltx_Screen(int x, int y, int sprite_sx, int sprite_sy, int width, int height, int sprite_width, int sprite_height, void *buf); -void ge2dSpriteBlt_ScreenRop(int x, int y, int sprite_width, int sprite_height, void *buf, int rop); -void ge2dSpriteBltx_ScreenRop(int x, int y, int sprite_sx, int sprite_sy, int width, int height, int sprite_width, int sprite_height, void *buf, int rop); -void ge2dColorExpansionBlt(int x, int y, int width, int height, int fore_color, int back_color, int opt, void *buf); -void ge2dHostColorExpansionBlt(int x, int y, int width, int height, int fore_color, int back_color, int opt, void *buf); -void ge2dInitMonoPattern(int opt, int fore_color, int back_color); -void ge2dInitMonoInputPattern(uint32_t PatternA, uint32_t PatternB, int fore_color, int back_color); -void ge2dInitColorPattern(int patformat, void *patdata); -void ge2dFont_PutChar(int x, int y, char asc_code, int fore_color, int back_color, int draw_mode, int font_id); -void ge2dFont_PutString(int x, int y, char *str, int fore_color, int back_color, int draw_mode, int font_id); - -/*@}*/ /* end of group N9H30_GE2D_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_GE2D_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif //__NU_2D_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_adc.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_adc.h deleted file mode 100644 index 55b0548b420..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_adc.h +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************//** -* @file nu_adc.h -* @brief N9H30 ADC driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_ADC_H__ -#define __NU_ADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ADC_Driver ADC Driver - @{ -*/ - -/** @addtogroup ADC_EXPORTED_CONSTANTS ADC Exported Constants - @{ -*/ - -#include "adc_reg.h" - -#define ADC_CH_0_MASK (1UL << 0) /*!< ADC channel 0 mask \hideinitializer */ -#define ADC_CH_1_MASK (1UL << 1) /*!< ADC channel 1 mask \hideinitializer */ -#define ADC_CH_2_MASK (1UL << 2) /*!< ADC channel 2 mask \hideinitializer */ -#define ADC_CH_3_MASK (1UL << 3) /*!< ADC channel 3 mask \hideinitializer */ -#define ADC_CH_4_MASK (1UL << 4) /*!< ADC channel 4 mask \hideinitializer */ -#define ADC_CH_5_MASK (1UL << 5) /*!< ADC channel 5 mask \hideinitializer */ -#define ADC_CH_6_MASK (1UL << 6) /*!< ADC channel 6 mask \hideinitializer */ -#define ADC_CH_7_MASK (1UL << 7) /*!< ADC channel 7 mask \hideinitializer */ -#define ADC_CH_NUM 8 /*!< Total Channel number \hideinitializer */ -#define ADC_HIGH_SPEED_MODE ADC_CONF_SPEED_Msk /*!< ADC working in high speed mode (3.2MHz <= ECLK <= 16MHz) \hideinitializer */ -#define ADC_NORMAL_SPEED_MODE 0 /*!< ADC working in normal speed mode (ECLK < 3.2MHz) \hideinitializer */ -#define ADC_REFSEL_VREF 0 /*!< ADC reference voltage source selection set to VREF \hideinitializer */ -#define ADC_REFSEL_AVDD (3UL << ADC_CONF_REFSEL_Pos) /*!< ADC reference voltage source selection set to AVDD \hideinitializer */ - -#define ADC_INPUT_MODE_NORMAL_CONV 0 /*!< ADC works in normal conversion mode \hideinitializer */ -#define ADC_INPUT_MODE_4WIRE_TOUCH 1 /*!< ADC works in 4-wire touch screen mode \hideinitializer */ -#define ADC_INPUT_MODE_5WIRE_TOUCH 2 /*!< ADC works in 5-wire touch screen mode \hideinitializer */ - -/*@}*/ /* end of group ADC_EXPORTED_CONSTANTS */ - - -/** @addtogroup ADC_EXPORTED_FUNCTIONS ADC Exported Functions - @{ -*/ - -/** - * @brief Get the latest ADC conversion data - * @param[in] adc Base address of ADC module - * @param[in] u32ChNum Currently not used - * @return Latest ADC conversion data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_DATA(adc, u32ChNum) ((adc)->DATA) - -/** - * @brief Get the latest ADC conversion X data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion X data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_XDATA(adc) ((adc)->XYDATA & ADC_XYDATA_XDATA_Msk) - -/** - * @brief Get the latest ADC conversion Y data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Y data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_YDATA(adc) ((adc)->XYDATA >> ADC_XYDATA_YDATA_Pos) - -/** - * @brief Get the latest ADC conversion Z1 data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Z1 data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_Z1DATA(adc) ((adc)->ZDATA & ADC_ZDATA_Z1DATA_Msk) - -/** - * @brief Get the latest ADC conversion Z2 data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Z2 data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_Z2DATA(adc) ((adc)->ZDATA >> ADC_ZDATA_Z2DATA_Pos) - -/** - * @brief Return the user-specified interrupt flags - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return User specified interrupt flags - * \hideinitializer - */ -#define ADC_GET_INT_FLAG(adc, u32Mask) ((adc)->ISR & (u32Mask)) - -/** - * @brief This macro clear the selected interrupt status bits - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - * \hideinitializer - */ -#define ADC_CLR_INT_FLAG(adc, u32Mask) ((adc)->ISR = (u32Mask)) - -/** - * @brief Return the user-specified interrupt flags - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return User specified interrupt flags - * \hideinitializer - */ -#define ADC_GET_WKINT_FLAG(adc, u32Mask) ((adc)->WKISR & (u32Mask)) - -/** - * @brief Enable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - */ -#define ADC_ENABLE_INT(adc, u32Mask) ((adc)->IER |= u32Mask) - -/** - * @brief Disable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - */ -#define ADC_DISABLE_INT(adc, u32Mask) ((adc)->IER &= ~u32Mask) - -/** - * @brief Power down ADC module - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_POWER_DOWN(adc) ((adc)->CTL &= ~ADC_CTL_ADEN_Msk) - -/** - * @brief Power on ADC module - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_POWER_ON(adc) ((adc)->CTL |= ADC_CTL_ADEN_Msk) - - -/** - * @brief Set ADC input channel. Enabled channel will be converted while ADC starts. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Channel enable bit. Each bit corresponds to a input channel. Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @note ADC can only convert 1 channel at a time. If more than 1 channels are enabled, only channel - * with smallest number will be convert. - * \hideinitializer - */ -#define ADC_SET_INPUT_CHANNEL(adc, u32Mask) do {uint32_t u32Ch = 0, i;\ - for(i = 0; i < ADC_CH_NUM; i++) {\ - if((u32Mask) & (1 << i)) {\ - u32Ch = i;\ - break;\ - }\ - }\ - (adc)->CONF = ((adc)->CONF & ~ADC_CONF_CHSEL_Msk) | (u32Ch << ADC_CONF_CHSEL_Pos);\ - }while(0) - -/** - * @brief Start the A/D conversion. - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_START_CONV(adc) ((adc)->CTL |= ADC_CTL_MST_Msk) - -/** - * @brief Set the reference voltage selection. - * @param[in] adc Base address of ADC module - * @param[in] u32Ref The reference voltage selection. Valid values are: - * - \ref ADC_REFSEL_VREF - * - \ref ADC_REFSEL_AVDD - * @return None - * \hideinitializer - */ -#define ADC_SET_REF_VOLTAGE(adc, u32Ref) ((adc)->CONF = ((adc)->CONF & ~ADC_CONF_REFSEL_Msk) | (u32Ref)) - -/** - * @brief Set ADC to convert X/Y coordinate - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_CONVERT_XY_MODE(adc) do {(adc)->CTL &= ~ADC_CTL_PEDEEN_Msk;\ - (adc)->CONF |= ADC_CONF_TEN_Msk | ADC_CONF_ZEN_Msk;} while(0) - -/** - * @brief Set ADC to detect pen down event - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_DETECT_PD_MODE(adc) do {(adc)->CONF &= ~(ADC_CONF_TEN_Msk | ADC_CONF_ZEN_Msk);\ - (adc)->CTL |= ADC_CTL_PEDEEN_Msk;} while(0) - - -#define ADC_CONF_REFSEL_VREF (0<STATUS) - -/** - * @brief Get specified interrupt pending status. - * - * @param[in] can The base address of can module. - * - * @return The source of the interrupt. - * - * @details If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt - * with the highest priority, disregarding their chronological order. - * \hideinitializer - */ -#define CAN_GET_INT_PENDING_STATUS(can) ((can)->IIDR) - -/** - * @brief Disable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details The macro is used to disable wake-up function. - * \hideinitializer - */ -#define CAN_DISABLE_WAKEUP(can) ((can)->WU_EN = 0ul) - -/** - * @brief Enable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details User can wake-up system when there is a falling edge in the CAN_Rx pin. - * \hideinitializer - */ -#define CAN_ENABLE_WAKEUP(can) ((can)->WU_EN = CAN_WU_EN_WAKUP_EN_Msk) - -/** - * @brief Get specified Message Object new data into bit value. - * - * @param[in] can The base address of can module. - * @param[in] u32MsgNum Specified Message Object number, valid value are from 0 to 31. - * - * @return Specified Message Object new data into bit value. - * - * @details The NewDat bit (CAN_IFn_MCON[15]) of a specific Message Object can be set/reset by the software through the IFn Message Interface Registers - * or by the Message Handler after reception of a Data Frame or after a successful transmission. - * \hideinitializer - */ -#define CAN_GET_NEW_DATA_IN_BIT(can, u32MsgNum) ((u32MsgNum) < 16 ? (can)->NDAT1 & (1 << (u32MsgNum)) : (can)->NDAT2 & (1 << ((u32MsgNum)-16))) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define CAN functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate); -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode); -void CAN_Close(CAN_T *tCAN); -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum); -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask); -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask); -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg); -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg); -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask); -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg); -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum); -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg); -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg); -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask); -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask); -void CAN_LeaveTestMode(CAN_T *tCAN); -uint32_t CAN_GetCANBitRate(CAN_T *tCAN); -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj); -void CAN_LeaveInitMode(CAN_T *tCAN); -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast); -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast); -void CAN_WaitMsg(CAN_T *tCAN); -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T *pCanMsg); - -/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CAN_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - - -#endif /*__NU_CAN_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_cap.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_cap.h deleted file mode 100644 index dc06ea7f608..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_cap.h +++ /dev/null @@ -1,316 +0,0 @@ -/**************************************************************************//** -* @file cap.h -* @version V1.00 -* $Revision: 2 $ -* $Date: 15/06/12 8:48a $ -* @brief N9H30 CAP driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_CAP_H__ -#define __NU_CAP_H__ - -// #include header file -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_CAP_Driver CAP Driver - @{ -*/ - -/** @addtogroup N9H30_CAP_EXPORTED_CONSTANTS CAP Exported Constants - @{ -*/ - -/* Define data type (struct, union? */ -// #define Constant -#include "N9H30.h" -#include "nu_sys.h" - -/*---------------------------------------------------------------------------------------------------------*/ -/* CAP_CTL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAPEN BIT0 /*!< Interrupt enable for VPE operations */ -#define ADDRSW BIT3 /*!< Packet Buffer Address Switch */ -#define PLNEN BIT5 /*!< Planar Output Enable */ -#define PKTEN BIT6 /*!< Packet Output Enable */ -#define SHUTTER BIT16 /*!< Image Capture Interface Automatically Disable The Capture Inteface After A Frame Had Been Captured */ -#define UPDATE BIT20 /*!< Update Register At New Frame */ -#define VPRST BIT24 /*!< Capture Interface Reset */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CAP_PAR constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define INFMT BIT0 /*!< Sensor Input Data Format */ -#define SENTYPE BIT1 /*!< Sensor Input Type */ -#define INDATORD (BIT2|BIT3) /*!< Sensor Input Data Order */ -#define OUTFMT (BIT4|BIT5) /*!< Image Data Format Output To System Memory */ -#define RANGE BIT6 /*!< Scale Input YUV CCIR601 Color Range To Full Range */ -#define PLNFMT BIT7 /*!< Planar Output YUV Format */ -#define PCLKP BIT8 /*!< Sensor Pixel Clock Polarity */ -#define HSP BIT9 /*!< Sensor Hsync Polarity */ -#define VSP BIT10 /*!< Sensor Vsync Polarity */ -#define COLORCTL (BIT11|BIT12) /*!< Special COLORCTL Processing */ -#define FBB BIT18 /*!< Field By Blank */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CAP_INT constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define MDIEN BIT20 /*!< Motion Detection Output Finish Interrupt Enable */ -#define ADDRMIEN BIT19 /*!< Address Match Interrupt Enable */ -#define MEIEN BIT17 /*!< System Memory Error Interrupt Enable */ -#define VIEN BIT16 /*!< Video Frame End Interrupt Enable */ -#define MDINTF BIT4 /*!< Motion Detection Output Finish Interrupt */ -#define ADDRMINTF BIT3 /*!< Memory Address Match Interrupt */ -#define MEINTF BIT1 /*!< Bus Master Transfer Error Interrupt */ -#define VINTF BIT0 /*!< Video Frame End Interrupt */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CAP_MD constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define MDEN BIT0 /*!< Motion Detection Enable */ -#define MDBS BIT8 /*!< Motion Detection Block Size */ -#define MDSM BIT9 /*!< Motion Detection Save Mode */ -#define MDDF (BIT10|BIT11) /*!< Motion Detection Detect Frequency */ -#define MDTHR (BIT16|BIT17|BIT18|BIT19|BIT20) /*!< Motion Detection Differential Threshold */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* CAP_CWSP constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CWSADDRH (0xFFF<<0) /*!INTEN |= CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro disables PRNG interrupt. - * @return None - * \hideinitializer - */ -#define PRNG_DISABLE_INT() (CRPT->INTEN &= ~CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro gets PRNG interrupt flag. - * @return PRNG interrupt flag. - * \hideinitializer - */ -#define PRNG_GET_INT_FLAG() (CRPT->INTSTS & CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro clears PRNG interrupt flag. - * @return None - * \hideinitializer - */ -#define PRNG_CLR_INT_FLAG() (CRPT->INTSTS = CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro enables AES interrupt. - * @return None - * \hideinitializer - */ -#define AES_ENABLE_INT() (CRPT->INTEN |= (CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESERRIEN_Msk)) - -/** - * @brief This macro disables AES interrupt. - * @return None - * \hideinitializer - */ -#define AES_DISABLE_INT() (CRPT->INTEN &= ~(CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESERRIEN_Msk)) - -/** - * @brief This macro gets AES interrupt flag. - * @return AES interrupt flag. - * \hideinitializer - */ -#define AES_GET_INT_FLAG() (CRPT->INTSTS & (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESERRIF_Msk)) - -/** - * @brief This macro clears AES interrupt flag. - * @return None - * \hideinitializer - */ -#define AES_CLR_INT_FLAG() (CRPT->INTSTS = (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESERRIF_Msk)) - -/** - * @brief This macro enables AES key protection. - * @return None - * \hideinitializer - */ -#define AES_ENABLE_KEY_PROTECT() (CRPT->AES_CTL |= CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables AES key protection. - * @return None - * \hideinitializer - */ -#define AES_DISABLE_KEY_PROTECT() (CRPT->AES_CTL = (CRPT->AES_CTL & ~CRPT_AES_CTL_KEYPRT_Msk) | (0x16<INTEN |= (CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESERRIEN_Msk)) - -/** - * @brief This macro disables TDES interrupt. - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_INT() (CRPT->INTEN &= ~(CRPT_INTEN_TDESIEN_Msk|CRPT_INTEN_TDESERRIEN_Msk)) - -/** - * @brief This macro gets TDES interrupt flag. - * @return TDES interrupt flag. - * \hideinitializer - */ -#define TDES_GET_INT_FLAG() (CRPT->INTSTS & (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESERRIF_Msk)) - -/** - * @brief This macro clears TDES interrupt flag. - * @return None - * \hideinitializer - */ -#define TDES_CLR_INT_FLAG() (CRPT->INTSTS = (CRPT_INTSTS_TDESIF_Msk|CRPT_INTSTS_TDESERRIF_Msk)) - -/** - * @brief This macro enables TDES key protection. - * @return None - * \hideinitializer - */ -#define TDES_ENABLE_KEY_PROTECT() (CRPT->TDES_CTL |= CRPT_TDES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables TDES key protection. - * @return None - * \hideinitializer - */ -#define TDES_DISABLE_KEY_PROTECT() (CRPT->TDES_CTL = (CRPT->TDES_CTL & ~CRPT_TDES_CTL_KEYPRT_Msk) | (0x16<INTEN |= (CRPT_INTEN_SHAIEN_Msk|CRPT_INTEN_SHAERRIEN_Msk)) - -/** - * @brief This macro disables SHA interrupt. - * @return None - * \hideinitializer - */ -#define SHA_DISABLE_INT() (CRPT->INTEN &= ~(CRPT_INTEN_SHAIEN_Msk|CRPT_INTEN_SHAERRIEN_Msk)) - -/** - * @brief This macro gets SHA interrupt flag. - * @return SHA interrupt flag. - * \hideinitializer - */ -#define SHA_GET_INT_FLAG() (CRPT->INTSTS & (CRPT_INTSTS_SHAIF_Msk|CRPT_INTSTS_SHAERRIF_Msk)) - -/** - * @brief This macro clears SHA interrupt flag. - * @return None - * \hideinitializer - */ -#define SHA_CLR_INT_FLAG() (CRPT->INTSTS = (CRPT_INTSTS_SHAIF_Msk|CRPT_INTSTS_SHAERRIF_Msk)) - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -void PRNG_Open(uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed); -void PRNG_Start(void); -void PRNG_Read(uint32_t u32RandKey[]); -void AES_Open(uint32_t u32Channel, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType); -void AES_Start(int32_t u32Channel, uint32_t u32DMAMode); -void AES_SetKey(uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize); -void AES_SetInitVect(uint32_t u32Channel, uint32_t au32IV[]); -void AES_SetDMATransfer(uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt); -void TDES_Open(uint32_t u32Channel, uint32_t u32EncDec, int32_t Is3DES, int32_t Is3Key, uint32_t u32OpMode, uint32_t u32SwapType); -void TDES_Start(int32_t u32Channel, uint32_t u32DMAMode); -void TDES_SetKey(uint32_t u32Channel, uint32_t au32Keys[3][2]); -void TDES_SetInitVect(uint32_t u32Channel, uint32_t u32IVH, uint32_t u32IVL); -void TDES_SetDMATransfer(uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt); -void SHA_Open(uint32_t u32OpMode, uint32_t u32SwapType, int hmac_key_len); -void SHA_Start(uint32_t u32DMAMode); -void SHA_SetDMATransfer(uint32_t u32SrcAddr, uint32_t u32TransCnt); -void SHA_Read(uint32_t u32Digest[]); - - -/*@}*/ /* end of group N9H30_CRYPTO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_CRYPTO_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif // __NU_CRYPTO_H__ - -/*** (C) COPYRIGHT 2015 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_emac.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_emac.h deleted file mode 100644 index f6a5ce86e9c..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_emac.h +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************//** - * @file nu_emac.h - * @version V1.00 - * @brief EMAC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_EMAC_H__ -#define __NU_EMAC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include "emac_reg.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EMAC_Driver EMAC Driver - @{ -*/ - -/** @addtogroup EMAC_EXPORTED_CONSTANTS EMAC Exported Constants - @{ -*/ - -#define EMAC_PHY_ADDR 1UL /*!< PHY address, this address is board dependent \hideinitializer */ -#define EMAC_RX_DESC_SIZE 64UL /*!< Number of Rx Descriptors, should be 2 at least \hideinitializer */ -#define EMAC_TX_DESC_SIZE 32UL /*!< Number of Tx Descriptors, should be 2 at least \hideinitializer */ -#define EMAC_CAMENTRY_NB 16UL /*!< Number of CAM \hideinitializer */ -#define EMAC_MAX_PKT_SIZE 1536UL /*!< Number of HDR + EXTRA + VLAN_TAG + PAYLOAD + CRC \hideinitializer */ - -#define EMAC_LINK_DOWN 0UL /*!< Ethernet link is down \hideinitializer */ -#define EMAC_LINK_100F 1UL /*!< Ethernet link is 100Mbps full duplex \hideinitializer */ -#define EMAC_LINK_100H 2UL /*!< Ethernet link is 100Mbps half duplex \hideinitializer */ -#define EMAC_LINK_10F 3UL /*!< Ethernet link is 10Mbps full duplex \hideinitializer */ -#define EMAC_LINK_10H 4UL /*!< Ethernet link is 10Mbps half duplex \hideinitializer */ - -/*@}*/ /* end of group EMAC_EXPORTED_CONSTANTS */ - - -/** Tx/Rx buffer descriptor structure */ -typedef struct -{ - uint32_t u32Status1; /*!< Status word 1 */ - uint32_t u32Data; /*!< Pointer to data buffer */ - uint32_t u32Status2; /*!< Status word 2 */ - uint32_t u32Next; /*!< Pointer to next descriptor */ - uint32_t u32Backup1; /*!< For backup descriptor fields over written by time stamp */ - uint32_t u32Backup2; /*!< For backup descriptor fields over written by time stamp */ -} EMAC_DESCRIPTOR_T; - -/** Tx/Rx buffer structure */ -typedef struct -{ - uint8_t au8Buf[EMAC_MAX_PKT_SIZE]; -} EMAC_FRAME_T; - -typedef struct -{ - EMAC_T *psEmac; - - uint32_t u32TxDescSize; - uint32_t u32RxDescSize; - - EMAC_DESCRIPTOR_T *psRXDescs; - EMAC_FRAME_T *psRXFrames; - EMAC_DESCRIPTOR_T *psTXDescs; - EMAC_FRAME_T *psTXFrames; - - EMAC_DESCRIPTOR_T *psCurrentTxDesc; - EMAC_DESCRIPTOR_T *psNextTxDesc; - EMAC_DESCRIPTOR_T *psCurrentRxDesc; - -} EMAC_MEMMGR_T; - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Enable EMAC Tx function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_TX(EMAC) (EMAC->CTL |= EMAC_CTL_TXON_Msk) - - -/** - * @brief Enable EMAC Rx function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RX(EMAC) do{EMAC->CTL |= EMAC_CTL_RXON_Msk; EMAC->RXST = 0;}while(0) - -/** - * @brief Disable EMAC Tx function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_TX(EMAC) (EMAC->CTL &= ~EMAC_CTL_TXON_Msk) - - -/** - * @brief Disable EMAC Rx function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RX(EMAC) (EMAC->CTL &= ~EMAC_CTL_RXON_Msk) - -/** - * @brief Enable EMAC Magic Packet Wakeup function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_MAGIC_PKT_WAKEUP(EMAC) (EMAC->CTL |= EMAC_CTL_WOLEN_Msk) - -/** - * @brief Disable EMAC Magic Packet Wakeup function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_MAGIC_PKT_WAKEUP(EMAC) (EMAC->CTL &= ~EMAC_CTL_WOLEN_Msk) - -/** - * @brief Enable EMAC to receive broadcast packets - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RECV_BCASTPKT(EMAC) (EMAC->CAMCTL |= EMAC_CAMCTL_ABP_Msk) - -/** - * @brief Disable EMAC to receive broadcast packets - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RECV_BCASTPKT(EMAC) (EMAC->CAMCTL &= ~EMAC_CAMCTL_ABP_Msk) - -/** - * @brief Enable EMAC to receive multicast packets - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RECV_MCASTPKT(EMAC) (EMAC->CAMCTL |= EMAC_CAMCTL_AMP_Msk) - -/** - * @brief Disable EMAC Magic Packet Wakeup function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RECV_MCASTPKT(EMAC) (EMAC->CAMCTL &= ~EMAC_CAMCTL_AMP_Msk) - -/** - * @brief Check if EMAC time stamp alarm interrupt occurred or not - * @param The pointer of the specified EMAC module - * @return If time stamp alarm interrupt occurred or not - * @retval 0 Alarm interrupt does not occur - * @retval 1 Alarm interrupt occurred - * \hideinitializer - */ -#define EMAC_GET_ALARM_FLAG(EMAC) (EMAC->INTSTS & EMAC_INTSTS_TSALMIF_Msk ? 1 : 0) - -/** - * @brief Clear EMAC time stamp alarm interrupt flag - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_CLR_ALARM_FLAG(EMAC) (EMAC->INTSTS = EMAC_INTSTS_TSALMIF_Msk) - -/** - * @brief Trigger EMAC Rx function - * @param The pointer of the specified EMAC module - * @return None - */ -#define EMAC_TRIGGER_RX(EMAC) do{EMAC->RXST = 0UL;}while(0) - -/** - * @brief Trigger EMAC Tx function - * @param The pointer of the specified EMAC module - * @return None - */ -#define EMAC_TRIGGER_TX(EMAC) do{EMAC->TXST = 0UL;}while(0) - -/** - * @brief Enable specified EMAC interrupt - * - * @param[in] EMAC The pointer of the specified EMAC module - * @param[in] u32eIntSel Interrupt type select - * - \ref EMAC_INTEN_RXIEN_Msk : Receive - * - \ref EMAC_INTEN_CRCEIEN_Msk : CRC Error - * - \ref EMAC_INTEN_RXOVIEN_Msk : Receive FIFO Overflow - * - \ref EMAC_INTEN_LPIEN_Msk : Long Packet - * - \ref EMAC_INTEN_RXGDIEN_Msk : Receive Good - * - \ref EMAC_INTEN_ALIEIEN_Msk : Alignment Error - * - \ref EMAC_INTEN_RPIEN_Msk : Runt Packet - * - \ref EMAC_INTEN_MPCOVIEN_Msk : Miss Packet Counter Overrun - * - \ref EMAC_INTEN_MFLEIEN_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTEN_DENIEN_Msk : DMA Early Notification - * - \ref EMAC_INTEN_RDUIEN_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTEN_RXBEIEN_Msk : Receive Bus Error - * - \ref EMAC_INTEN_CFRIEN_Msk : Control Frame Receive - * - \ref EMAC_INTEN_WOLIEN_Msk : Wake on LAN Interrupt - * - \ref EMAC_INTEN_TXIEN_Msk : Transmit - * - \ref EMAC_INTEN_TXUDIEN_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTEN_TXCPIEN_Msk : Transmit Completion - * - \ref EMAC_INTEN_EXDEFIEN_Msk : Defer Exceed - * - \ref EMAC_INTEN_NCSIEN_Msk : No Carrier Sense - * - \ref EMAC_INTEN_TXABTIEN_Msk : Transmit Abort - * - \ref EMAC_INTEN_LCIEN_Msk : Late Collision - * - \ref EMAC_INTEN_TDUIEN_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTEN_TXBEIEN_Msk : Transmit Bus Error - * - \ref EMAC_INTEN_TSALMIEN_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro enable specified EMAC interrupt. - * \hideinitializer - */ -#define EMAC_ENABLE_INT(EMAC, u32eIntSel) ((EMAC)->INTEN |= (u32eIntSel)) - -/** - * @brief Disable specified EMAC interrupt - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntSel Interrupt type select - * - \ref EMAC_INTEN_RXIEN_Msk : Receive - * - \ref EMAC_INTEN_CRCEIEN_Msk : CRC Error - * - \ref EMAC_INTEN_RXOVIEN_Msk : Receive FIFO Overflow - * - \ref EMAC_INTEN_LPIEN_Msk : Long Packet - * - \ref EMAC_INTEN_RXGDIEN_Msk : Receive Good - * - \ref EMAC_INTEN_ALIEIEN_Msk : Alignment Error - * - \ref EMAC_INTEN_RPIEN_Msk : Runt Packet - * - \ref EMAC_INTEN_MPCOVIEN_Msk : Miss Packet Counter Overrun - * - \ref EMAC_INTEN_MFLEIEN_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTEN_DENIEN_Msk : DMA Early Notification - * - \ref EMAC_INTEN_RDUIEN_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTEN_RXBEIEN_Msk : Receive Bus Error - * - \ref EMAC_INTEN_CFRIEN_Msk : Control Frame Receive - * - \ref EMAC_INTEN_WOLIEN_Msk : Wake on LAN Interrupt - * - \ref EMAC_INTEN_TXIEN_Msk : Transmit - * - \ref EMAC_INTEN_TXUDIEN_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTEN_TXCPIEN_Msk : Transmit Completion - * - \ref EMAC_INTEN_EXDEFIEN_Msk : Defer Exceed - * - \ref EMAC_INTEN_NCSIEN_Msk : No Carrier Sense - * - \ref EMAC_INTEN_TXABTIEN_Msk : Transmit Abort - * - \ref EMAC_INTEN_LCIEN_Msk : Late Collision - * - \ref EMAC_INTEN_TDUIEN_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTEN_TXBEIEN_Msk : Transmit Bus Error - * - \ref EMAC_INTEN_TSALMIEN_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro disable specified EMAC interrupt. - * \hideinitializer - */ -#define EMAC_DISABLE_INT(EMAC, u32eIntSel) ((EMAC)->INTEN &= ~ (u32eIntSel)) - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref EMAC_INTSTS_RXIF_Msk : Receive - * - \ref EMAC_INTSTS_CRCEIF_Msk : CRC Error - * - \ref EMAC_INTSTS_RXOVIF_Msk : Receive FIFO Overflow - * - \ref EMAC_INTSTS_LPIF_Msk : Long Packet - * - \ref EMAC_INTSTS_RXGDIF_Msk : Receive Good - * - \ref EMAC_INTSTS_ALIEIF_Msk : Alignment Error - * - \ref EMAC_INTSTS_RPIF_Msk : Runt Packet - * - \ref EMAC_INTSTS_MPCOVIF_Msk : Missed Packet Counter - * - \ref EMAC_INTSTS_MFLEIF_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTSTS_DENIF_Msk : DMA Early Notification - * - \ref EMAC_INTSTS_RDUIF_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTSTS_RXBEIF_Msk : Receive Bus Error - * - \ref EMAC_INTSTS_CFRIF_Msk : Control Frame Receive - * - \ref EMAC_INTSTS_WOLIF_Msk : Wake on LAN - * - \ref EMAC_INTSTS_TXIF_Msk : Transmit - * - \ref EMAC_INTSTS_TXUDIF_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTSTS_TXCPIF_Msk : Transmit Completion - * - \ref EMAC_INTSTS_EXDEFIF_Msk : Defer Exceed - * - \ref EMAC_INTSTS_NCSIF_Msk : No Carrier Sense - * - \ref EMAC_INTSTS_TXABTIF_Msk : Transmit Abort - * - \ref EMAC_INTSTS_LCIF_Msk : Late Collision - * - \ref EMAC_INTSTS_TDUIF_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTSTS_TXBEIF_Msk : Transmit Bus Error - * - \ref EMAC_INTSTS_TSALMIF_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define EMAC_GET_INT_FLAG(EMAC, u32eIntTypeFlag) (((EMAC)->INTSTS & (u32eIntTypeFlag))?1:0) - -/** - * @brief Clear specified interrupt flag/status - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref EMAC_INTSTS_RXIF_Msk : Receive - * - \ref EMAC_INTSTS_CRCEIF_Msk : CRC Error - * - \ref EMAC_INTSTS_RXOVIF_Msk : Receive FIFO Overflow - * - \ref EMAC_INTSTS_LPIF_Msk : Long Packet - * - \ref EMAC_INTSTS_RXGDIF_Msk : Receive Good - * - \ref EMAC_INTSTS_ALIEIF_Msk : Alignment Error - * - \ref EMAC_INTSTS_RPIF_Msk : Runt Packet - * - \ref EMAC_INTSTS_MPCOVIF_Msk : Missed Packet Counter - * - \ref EMAC_INTSTS_MFLEIF_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTSTS_DENIF_Msk : DMA Early Notification - * - \ref EMAC_INTSTS_RDUIF_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTSTS_RXBEIF_Msk : Receive Bus Error - * - \ref EMAC_INTSTS_CFRIF_Msk : Control Frame Receive - * - \ref EMAC_INTSTS_WOLIF_Msk : Wake on LAN - * - \ref EMAC_INTSTS_TXIF_Msk : Transmit - * - \ref EMAC_INTSTS_TXUDIF_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTSTS_TXCPIF_Msk : Transmit Completion - * - \ref EMAC_INTSTS_EXDEFIF_Msk : Defer Exceed - * - \ref EMAC_INTSTS_NCSIF_Msk : No Carrier Sense - * - \ref EMAC_INTSTS_TXABTIF_Msk : Transmit Abort - * - \ref EMAC_INTSTS_LCIF_Msk : Late Collision - * - \ref EMAC_INTSTS_TDUIF_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTSTS_TXBEIF_Msk : Transmit Bus Error - * - \ref EMAC_INTSTS_TSALMIF_Msk : Time Stamp Alarm - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro clear specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define EMAC_CLEAR_INT_FLAG(EMAC, u32eIntTypeFlag) ((EMAC)->INTSTS |= (u32eIntTypeFlag)) -#define EMAC_CLEAR_ALL_INT_FLAG(EMAC) ((EMAC)->INTSTS |= (EMAC)->INTSTS) - - -void EMAC_Open(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8MacAddr); -void EMAC_Close(EMAC_T *EMAC); -void EMAC_SetMacAddr(EMAC_T *EMAC, uint8_t *pu8MacAddr); -void EMAC_EnableCamEntry(EMAC_T *EMAC, uint32_t u32Entry, uint8_t pu8MacAddr[]); -void EMAC_DisableCamEntry(EMAC_T *EMAC, uint32_t u32Entry); - -uint32_t EMAC_RecvPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size); -uint32_t EMAC_RecvPktTS(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size, uint32_t *pu32Sec, uint32_t *pu32Nsec); -void EMAC_RecvPktDone(EMAC_MEMMGR_T *psMemMgr); - -uint32_t EMAC_SendPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t u32Size); -uint32_t EMAC_SendPktDone(EMAC_MEMMGR_T *psMemMgr); -uint32_t EMAC_SendPktDoneTS(EMAC_MEMMGR_T *psMemMgr, uint32_t *pu32Sec, uint32_t *pu32Nsec); - -void EMAC_EnableTS(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_DisableTS(EMAC_T *EMAC); -void EMAC_GetTime(EMAC_T *EMAC, uint32_t *pu32Sec, uint32_t *pu32Nsec); -void EMAC_SetTime(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_UpdateTime(EMAC_T *EMAC, uint32_t u32Neg, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_EnableAlarm(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_DisableAlarm(EMAC_T *EMAC); - -uint32_t EMAC_CheckLinkStatus(EMAC_T *EMAC); - -void EMAC_Reset(EMAC_T *EMAC); -void EMAC_PhyInit(EMAC_T *EMAC); -int32_t EMAC_FillCamEntry(EMAC_T *EMAC, uint8_t pu8MacAddr[]); -uint8_t *EMAC_ClaimFreeTXBuf(EMAC_MEMMGR_T *psMemMgr); -uint32_t EMAC_GetAvailRXBufSize(EMAC_MEMMGR_T *psMemMgr, uint8_t **ppuDataBuf); -uint32_t EMAC_SendPktWoCopy(EMAC_MEMMGR_T *psMemMgr, uint32_t u32Size); -void EMAC_RecvPktDoneWoRxTrigger(EMAC_MEMMGR_T *psMemMgr); - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EMAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EMAC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_etimer.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_etimer.h deleted file mode 100644 index 4176a1719b6..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_etimer.h +++ /dev/null @@ -1,717 +0,0 @@ -/**************************************************************************//** - * @file etimer.h - * @brief N9H30 series ETIMER driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_ETIMER_H__ -#define __NU_ETIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "N9H30.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_ETIMER_Driver ETIMER Driver - @{ -*/ - -/** @addtogroup N9H30_ETIMER_EXPORTED_CONSTANTS ETIMER Exported Constants - @{ -*/ - -#define ETIMER_ONESHOT_MODE (0UL) /*!< Timer working in one shot mode */ -#define ETIMER_PERIODIC_MODE (1UL << 4) /*!< Timer working in periodic mode */ -#define ETIMER_TOGGLE_MODE (2UL << 4) /*!< Timer working in toggle mode */ -#define ETIMER_CONTINUOUS_MODE (3UL << 4) /*!< Timer working in continuous mode */ - -#define ETIMER_CAPTURE_FREE_COUNTING_MODE (0UL) /*!< Free counting mode */ -#define ETIMER_CAPTURE_TRIGGER_COUNTING_MODE (1UL << 20) /*!< Trigger counting mode */ -#define ETIMER_CAPTURE_COUNTER_RESET_MODE (1UL << 17) /*!< Counter reset mode */ - -#define ETIMER_CAPTURE_FALLING_EDGE (0UL) /*!< Falling edge trigger timer capture */ -#define ETIMER_CAPTURE_RISING_EDGE (1UL << 18) /*!< Rising edge trigger timer capture */ -#define ETIMER_CAPTURE_FALLING_THEN_RISING_EDGE (2UL << 18) /*!< Falling edge then rising edge trigger timer capture */ -#define ETIMER_CAPTURE_RISING_THEN_FALLING_EDGE (3UL << 18) /*!< Rising edge then falling edge trigger timer capture */ - -#define ETIMER_TIMEOUT_TRIGGER (0UL) /*!< Timer timeout trigger other modules */ -#define ETIMER_CAPTURE_TRIGGER (1UL << 11) /*!< Timer capture trigger other modules */ - -#define ETIMER_COUNTER_RISING_EDGE (1UL << 13) /*!< Counter increase on rising edge */ -#define ETIMER_COUNTER_FALLING_EDGE (0UL) /*!< Counter increase on falling edge */ - -/*@}*/ /* end of group ETIMER_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_ETIMER_EXPORTED_FUNCTIONS ETIMER Exported Functions - @{ -*/ - -/** - * @brief This macro is used to set new Timer compared value - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @param[in] u32Value Timer compare value. Valid values are between 2 to 0xFFFFFF - * @return None - * \hideinitializer - */ -#define ETIMER_SET_CMP_VALUE(timer, u32Value) \ - do{\ - if((timer) == 0) {\ - outpw(REG_ETMR0_CMPR, u32Value);\ - } else if((timer) == 1) {\ - outpw(REG_ETMR1_CMPR, u32Value);\ - } else if((timer) == 2) {\ - outpw(REG_ETMR2_CMPR, u32Value);\ - } else {\ - outpw(REG_ETMR3_CMPR, u32Value);\ - }\ - }while(0) - -/** - * @brief This macro is used to set new Timer prescale value - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @param[in] u32Value Timer prescale value. Valid values are between 0 to 0xFF - * @return None - * @note Clock input is divided by (prescale + 1) before it is fed into timer - * \hideinitializer - */ -#define ETIMER_SET_PRESCALE_VALUE(timer, u32Value) \ - do{\ - if((timer) == 0) {\ - outpw(REG_ETMR0_PRECNT, u32Value);\ - } else if((timer) == 1) {\ - outpw(REG_ETMR1_PRECNT, u32Value);\ - } else if((timer) == 2) {\ - outpw(REG_ETMR2_PRECNT, u32Value);\ - } else {\ - outpw(REG_ETMR3_PRECNT, u32Value);\ - }\ - }while(0) - -/** -* @brief Select Timer operating mode -* -* @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. -* @param[in] u32OpMode Operation mode. Possible options are -* - \ref ETIMER_ONESHOT_MODE -* - \ref ETIMER_PERIODIC_MODE -* - \ref ETIMER_TOGGLE_MODE -* - \ref ETIMER_CONTINUOUS_MODE -* -* @return None -* \hideinitializer -*/ -#define ETIMER_SET_OPMODE(timer, u32OpMode) \ - do{\ - if((timer) == 0) {\ - outpw(REG_ETMR0_CTL, (inpw(REG_ETMR0_CTL)&~0x30) | u32OpMode);\ - } else if((timer) == 1) {\ - outpw(REG_ETMR1_CTL, (inpw(REG_ETMR1_CTL)&~0x30) | u32OpMode);\ - } else if((timer) == 2) {\ - outpw(REG_ETMR2_CTL, (inpw(REG_ETMR2_CTL)&~0x30) | u32OpMode);\ - } else {\ - outpw(REG_ETMR3_CTL, (inpw(REG_ETMR3_CTL)&~0x30) | u32OpMode);\ - }\ - }while(0) - -/* - * @brief This macro is used to check if specify Timer is inactive or active - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return timer is activate or inactivate - * @retval 0 Timer 24-bit up counter is inactive - * @retval 1 Timer 24-bit up counter is active - * \hideinitializer - */ -static __inline int ETIMER_Is_Active(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_CTL); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_CTL); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_CTL); - } - else - { - reg = inpw(REG_ETMR3_CTL); - } - return reg & 0x80 ? 1 : 0; -} - -/** - * @brief This function is used to start Timer counting - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_Start(UINT timer) -{ - - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) | 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) | 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) | 1); - } - else - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) | 1); - } -} - -/** - * @brief This function is used to stop Timer counting - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_Stop(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~1); - } - else - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~1); - } -} - -/** - * @brief This function is used to enable the Timer wake-up function - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - * @note To wake the system from power down mode, timer clock source must be ether LXT or LIRC - */ -static __inline void ETIMER_EnableWakeup(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) | 4); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) | 4); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) | 4); - } - else - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) | 4); - } -} - -/** - * @brief This function is used to disable the Timer wake-up function - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_DisableWakeup(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~4); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~4); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~4); - } - else - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~4); - } -} - - -/** - * @brief This function is used to enable the capture pin detection de-bounce function. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_EnableCaptureDebounce(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) | 0x400000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) | 0x400000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) | 0x400000); - } - else - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) | 0x400000); - } -} - -/** - * @brief This function is used to disable the capture pin detection de-bounce function. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_DisableCaptureDebounce(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~0x400000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~0x400000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~0x400000); - } - else - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~0x400000); - } -} - - -/** - * @brief This function is used to enable the Timer time-out interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_EnableInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) | 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) | 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) | 1); - } - else - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) | 1); - } -} - -/** - * @brief This function is used to disable the Timer time-out interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_DisableInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) & ~1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) & ~1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) & ~1); - } - else - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) & ~1); - } -} - -/** - * @brief This function is used to enable the Timer capture trigger interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_EnableCaptureInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) | 2); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) | 2); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) | 2); - } - else - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) | 2); - } -} - -/** - * @brief This function is used to disable the Timer capture trigger interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_DisableCaptureInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) & ~2); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) & ~2); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) & ~2); - } - else - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) & ~2); - } -} - -/** - * @brief This function indicates Timer time-out interrupt occurred or not. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return Timer time-out interrupt occurred or not - * @retval 0 Timer time-out interrupt did not occur - * @retval 1 Timer time-out interrupt occurred - */ -static __inline UINT ETIMER_GetIntFlag(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_ISR); - } - else - { - reg = inpw(REG_ETMR3_ISR); - } - return reg & 1; -} - -/** - * @brief This function clears the Timer time-out interrupt flag. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_ClearIntFlag(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_ISR, 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_ISR, 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_ISR, 1); - } - else - { - outpw(REG_ETMR3_ISR, 1); - } -} - -/** - * @brief This function indicates Timer capture interrupt occurred or not. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return Timer capture interrupt occurred or not - * @retval 0 Timer capture interrupt did not occur - * @retval 1 Timer capture interrupt occurred - */ -static __inline UINT ETIMER_GetCaptureIntFlag(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_ISR); - } - else - { - reg = inpw(REG_ETMR3_ISR); - } - return (reg & 2) >> 1; -} - -/** - * @brief This function clears the Timer capture interrupt flag. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_ClearCaptureIntFlag(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_ISR, 2); - } - else if (timer == 1) - { - outpw(REG_ETMR1_ISR, 2); - } - else if (timer == 2) - { - outpw(REG_ETMR2_ISR, 2); - } - else - { - outpw(REG_ETMR3_ISR, 2); - } -} - -/** -* @brief This function gets the Timer capture falling edge flag. -* @param[in] timer ETIMER number. Range from 0 ~ 5 -* @return None -*/ -static __inline UINT8 ETIMER_GetCaptureFallingEdgeFlag(UINT timer) -{ - UINT ret; - - if (timer == 0) - { - ret = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - ret = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - ret = inpw(REG_ETMR2_ISR); - } - else - { - ret = inpw(REG_ETMR3_ISR); - } - return (ret & (1 << 6)) >> 6; -} - -/* - * @brief This function indicates Timer has waked up system or not. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return Timer has waked up system or not - * @retval 0 Timer did not wake up system - * @retval 1 Timer wake up system - */ -static __inline UINT ETIMER_GetWakeupFlag(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_ISR); - } - else - { - reg = inpw(REG_ETMR3_ISR); - } - return (reg & 0x10) >> 4; -} - -/** - * @brief This function clears the Timer wakeup interrupt flag. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -static __inline void ETIMER_ClearWakeupFlag(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_ISR, 0x10); - } - else if (timer == 1) - { - outpw(REG_ETMR1_ISR, 0x10); - } - else if (timer == 2) - { - outpw(REG_ETMR2_ISR, 0x10); - } - else - { - outpw(REG_ETMR3_ISR, 0x10); - } -} - -/** - * @brief This function gets the Timer compare value. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer compare data value - */ -static __inline UINT ETIMER_GetCompareData(UINT timer) -{ - - if (timer == 0) - { - return inpw(REG_ETMR0_CMPR); - } - else if (timer == 1) - { - return inpw(REG_ETMR1_CMPR); - } - else if (timer == 2) - { - return inpw(REG_ETMR2_CMPR); - } - else - { - return inpw(REG_ETMR3_CMPR); - } -} - -/** - * @brief This function gets the Timer capture data. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return Timer capture data value - */ -static __inline UINT ETIMER_GetCaptureData(UINT timer) -{ - - if (timer == 0) - { - return inpw(REG_ETMR0_TCAP); - } - else if (timer == 1) - { - return inpw(REG_ETMR1_TCAP); - } - else if (timer == 2) - { - return inpw(REG_ETMR2_TCAP); - } - else - { - return inpw(REG_ETMR3_TCAP); - } -} - -/** - * @brief This function reports the current timer counter value. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return Timer counter value - */ -static __inline UINT ETIMER_GetCounter(UINT timer) -{ - if (timer == 0) - { - return inpw(REG_ETMR0_DR); - } - else if (timer == 1) - { - return inpw(REG_ETMR1_DR); - } - else if (timer == 2) - { - return inpw(REG_ETMR2_DR); - } - else - { - return inpw(REG_ETMR3_DR); - } -} - -static __inline UINT ETIMER_ClearCounter(UINT timer) -{ - if (timer == 0) - { - return outpw(REG_ETMR0_DR, 0); - } - else if (timer == 1) - { - return outpw(REG_ETMR1_DR, 0); - } - else if (timer == 2) - { - return outpw(REG_ETMR2_DR, 0); - } - else - { - return outpw(REG_ETMR3_DR, 0); - } -} -UINT ETIMER_Open(UINT timer, UINT u32Mode, UINT u32Freq); -void ETIMER_Close(UINT timer); -void ETIMER_Delay(UINT timer, UINT u32Usec); -void ETIMER_EnableCapture(UINT timer, UINT u32CapMode, UINT u32Edge); -void ETIMER_DisableCapture(UINT timer); -UINT ETIMER_GetModuleClock(UINT timer); - -/*@}*/ /* end of group N9H30_ETIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_ETIMER_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_ETIMER_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_fmi.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_fmi.h deleted file mode 100644 index 0c0e1d69644..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_fmi.h +++ /dev/null @@ -1,394 +0,0 @@ -/**************************************************************************//** - * @file fmi.h - * @brief N9H30 FMI eMMC driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include - -#ifndef __NU_FMI_H__ -#define __NU_FMI_H__ - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_FMI_Driver FMI Driver - @{ -*/ - - -/** @addtogroup N9H30_FMI_EXPORTED_CONSTANTS FMI Exported Constants - @{ -*/ - - -#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 */ - -typedef struct -{ - __IO uint32_t FB[32]; /*!< Shared Buffer (FIFO) */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[224]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMACTL; /*!< [0x0400] DMA Control and Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMASA; /*!< [0x0408] DMA Transfer Starting Address Register */ - __I uint32_t DMABCNT; /*!< [0x040c] DMA Transfer Byte Count Register */ - __IO uint32_t DMAINTEN; /*!< [0x0410] DMA Interrupt Enable Control Register */ - __IO uint32_t DMAINTSTS; /*!< [0x0414] DMA Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[250]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t GCTL; /*!< [0x0800] Global Control and Status Register */ - __IO uint32_t GINTEN; /*!< [0x0804] Global Interrupt Control Register */ - __I uint32_t GINTSTS; /*!< [0x0808] Global Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL; /*!< [0x0820] SD Control and Status Register */ - __IO uint32_t CMDARG; /*!< [0x0824] SD Command Argument Register */ - __IO uint32_t INTEN; /*!< [0x0828] SD Interrupt Control Register */ - __IO uint32_t INTSTS; /*!< [0x082c] SD Interrupt Status Register */ - __I uint32_t RESP0; /*!< [0x0830] SD Receiving Response Token Register 0 */ - __I uint32_t RESP1; /*!< [0x0834] SD Receiving Response Token Register 1 */ - __IO uint32_t BLEN; /*!< [0x0838] SD Block Length Register */ - __IO uint32_t TOUT; /*!< [0x083c] SD Response/Data-in Time-out Register */ - __IO uint32_t ECTL; /*!< [0x0840] SD Host Extend Control Register */ - - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[24]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t NANDCTL; /*!< [0x08A0] NAND Flash Control Register */ - __IO uint32_t NANDTMCTL; /*!< [0x08A4] NAND Flash Timing Control Register */ - __IO uint32_t NANDINTEN; /*!< [0x08A8] NAND Flash Interrupt Enable Register */ - __IO uint32_t NANDINTSTS; /*!< [0x08AC] NAND Flash Interrupt Status Register */ - __O uint32_t NANDCMD; /*!< [0x08B0] NAND Flash Command Port Registe */ - __O uint32_t NANDADDR; /*!< [0x08B4] NAND Flash Address Port Register */ - __IO uint32_t NANDDATA; /*!< [0x08B8] NAND Flash Data Port Registe */ - __IO uint32_t NANDRACTL; /*!< [0x08BC] NAND Flash Redundant Area Control Register */ - __IO uint32_t NANDECTL; /*!< [0x08C0] NAND Flash Extend Control Register */ - __I uint32_t NANDECCES[4]; /*!< [0x08D0] NAND Flash ECC Error Status Register */ - __IO uint32_t NANDPROTA[2]; /*!< [0x08E0] NAND Flash Protect Region End Address Register */ - - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[6]; - /// @endcond //HIDDEN_SYMBOLS - - __I uint32_t NANDECCEA[12]; /*!< [0x0900] NAND Flash ECC Error Byte Address n Register */ - - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE6[12]; - /// @endcond //HIDDEN_SYMBOLS - - __I uint32_t NANDECCED[6]; /*!< [0x0960] NAND Flash ECC Error Data Register N */ - - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE7[34]; - /// @endcond //HIDDEN_SYMBOLS - - __IO uint32_t NANDRA[118]; /*!< [0x0A00]NAND Flash Redundant Area Word n = 0, 1..117 */ - -} FMI_T; - -#define FMI0 ((FMI_T *) FMI_BA) - -/** - @addtogroup FMI_CONST FMI Bit Field Definition - Constant Definitions for FMI Controller -@{ */ - -#define FMI_DMACTL_DMAEN_Pos (0) /*!< FMI DMACTL: DMAEN Position */ -#define FMI_DMACTL_DMAEN_Msk (0x1ul << FMI_DMACTL_DMAEN_Pos) /*!< FMI DMACTL: DMAEN Mask */ - -#define FMI_DMACTL_DMARST_Pos (1) /*!< FMI DMACTL: DMARST Position */ -#define FMI_DMACTL_DMARST_Msk (0x1ul << FMI_DMACTL_DMARST_Pos) /*!< FMI DMACTL: DMARST Mask */ - -#define FMI_DMACTL_SGEN_Pos (3) /*!< FMI DMACTL: SGEN Position */ -#define FMI_DMACTL_SGEN_Msk (0x1ul << FMI_DMACTL_SGEN_Pos) /*!< FMI DMACTL: SGEN Mask */ - -#define FMI_DMACTL_DMABUSY_Pos (9) /*!< FMI DMACTL: DMABUSY Position */ -#define FMI_DMACTL_DMABUSY_Msk (0x1ul << FMI_DMACTL_DMABUSY_Pos) /*!< FMI DMACTL: DMABUSY Mask */ - -#define FMI_DMASA_ORDER_Pos (0) /*!< FMI DMASA: ORDER Position */ -#define FMI_DMASA_ORDER_Msk (0x1ul << FMI_DMASA_ORDER_Pos) /*!< FMI DMASA: ORDER Mask */ - -#define FMI_DMASA_DMASA_Pos (1) /*!< FMI DMASA: DMASA Position */ -#define FMI_DMASA_DMASA_Msk (0x7ffffffful << FMI_DMASA_DMASA_Pos) /*!< FMI DMASA: DMASA Mask */ - -#define FMI_DMABCNT_BCNT_Pos (0) /*!< FMI DMABCNT: BCNT Position */ -#define FMI_DMABCNT_BCNT_Msk (0x3fffffful << FMI_DMABCNT_BCNT_Pos) /*!< FMI DMABCNT: BCNT Mask */ - -#define FMI_DMAINTEN_ABORTIEN_Pos (0) /*!< FMI DMAINTEN: ABORTIEN Position */ -#define FMI_DMAINTEN_ABORTIEN_Msk (0x1ul << FMI_DMAINTEN_ABORTIEN_Pos) /*!< FMI DMAINTEN: ABORTIEN Mask */ - -#define FMI_DMAINTEN_WEOTIEN_Pos (1) /*!< FMI DMAINTEN: WEOTIEN Position */ -#define FMI_DMAINTEN_WEOTIEN_Msk (0x1ul << FMI_DMAINTEN_WEOTIEN_Pos) /*!< FMI DMAINTEN: WEOTIEN Mask */ - -#define FMI_DMAINTSTS_ABORTIF_Pos (0) /*!< FMI DMAINTSTS: ABORTIF Position */ -#define FMI_DMAINTSTS_ABORTIF_Msk (0x1ul << FMI_DMAINTSTS_ABORTIF_Pos) /*!< FMI DMAINTSTS: ABORTIF Mask */ - -#define FMI_DMAINTSTS_WEOTIF_Pos (1) /*!< FMI DMAINTSTS: WEOTIF Position */ -#define FMI_DMAINTSTS_WEOTIF_Msk (0x1ul << FMI_DMAINTSTS_WEOTIF_Pos) /*!< FMI DMAINTSTS: WEOTIF Mask */ - -#define FMI_CTL_CTLRST_Pos (0) /*!< FMI CTL: CTLRST Position */ -#define FMI_CTL_CTLRST_Msk (0x1ul << FMI_CTL_CTLRST_Pos) /*!< FMI CTL: CTLRST Mask */ - -#define FMI_CTL_EMMCEN_Pos (1) /*!< FMI CTL: EMMCEN Position */ -#define FMI_CTL_EMMCEN_Msk (0x1ul << FMI_CTL_EMMCEN_Pos) /*!< FMI CTL: EMMCEN Mask */ - -#define FMI_CTL_NANDEN_Pos (1) /*!< FMI CTL: NANDEN Position */ -#define FMI_CTL_NANDEN_Msk (0x1ul << FMI_CTL_NANDEN_Pos) /*!< FMI CTL: NANDEN Mask */ - -#define FMI_INTEN_DTAIEN_Pos (0) /*!< FMI INTEN: DTAIEN Position */ -#define FMI_INTEN_DTAIEN_Msk (0x1ul << FMI_INTEN_DTAIEN_Pos) /*!< FMI INTEN: DTAIEN Mask */ - -#define FMI_INTSTS_DTAIF_Pos (0) /*!< FMI INTSTS: DTAIF Position */ -#define FMI_INTSTS_DTAIF_Msk (0x1ul << FMI_INTSTS_DTAIF_Pos) /*!< FMI INTSTS: DTAIF Mask */ - -#define FMI_EMMCCTL_COEN_Pos (0) /*!< FMI EMMCCTL: COEN Position */ -#define FMI_EMMCCTL_COEN_Msk (0x1ul << FMI_EMMCCTL_COEN_Pos) /*!< FMI EMMCCTL: COEN Mask */ - -#define FMI_EMMCCTL_RIEN_Pos (1) /*!< FMI EMMCCTL: RIEN Position */ -#define FMI_EMMCCTL_RIEN_Msk (0x1ul << FMI_EMMCCTL_RIEN_Pos) /*!< FMI EMMCCTL: RIEN Mask */ - -#define FMI_EMMCCTL_DIEN_Pos (2) /*!< FMI EMMCCTL: DIEN Position */ -#define FMI_EMMCCTL_DIEN_Msk (0x1ul << FMI_EMMCCTL_DIEN_Pos) /*!< FMI EMMCCTL: DIEN Mask */ - -#define FMI_EMMCCTL_DOEN_Pos (3) /*!< FMI EMMCCTL: DOEN Position */ -#define FMI_EMMCCTL_DOEN_Msk (0x1ul << FMI_EMMCCTL_DOEN_Pos) /*!< FMI EMMCCTL: DOEN Mask */ - -#define FMI_EMMCCTL_R2EN_Pos (4) /*!< FMI EMMCCTL: R2EN Position */ -#define FMI_EMMCCTL_R2EN_Msk (0x1ul << FMI_EMMCCTL_R2EN_Pos) /*!< FMI EMMCCTL: R2EN Mask */ - -#define FMI_EMMCCTL_CLK74OEN_Pos (5) /*!< FMI EMMCCTL: CLK74OEN Position */ -#define FMI_EMMCCTL_CLK74OEN_Msk (0x1ul << FMI_EMMCCTL_CLK74OEN_Pos) /*!< FMI EMMCCTL: CLK74OEN Mask */ - -#define FMI_EMMCCTL_CLK8OEN_Pos (6) /*!< FMI EMMCCTL: CLK8OEN Position */ -#define FMI_EMMCCTL_CLK8OEN_Msk (0x1ul << FMI_EMMCCTL_CLK8OEN_Pos) /*!< FMI EMMCCTL: CLK8OEN Mask */ - -#define FMI_EMMCCTL_CLKKEEP0_Pos (7) /*!< FMI EMMCCTL: CLKKEEP0 Position */ -#define FMI_EMMCCTL_CLKKEEP0_Msk (0x1ul << FMI_EMMCCTL_CLKKEEP0_Pos) /*!< FMI EMMCCTL: CLKKEEP0 Mask */ - -#define FMI_EMMCCTL_CMDCODE_Pos (8) /*!< FMI EMMCCTL: CMDCODE Position */ -#define FMI_EMMCCTL_CMDCODE_Msk (0x3ful << FMI_EMMCCTL_CMDCODE_Pos) /*!< FMI EMMCCTL: CMDCODE Mask */ - -#define FMI_EMMCCTL_CTLRST_Pos (14) /*!< FMI EMMCCTL: CTLRST Position */ -#define FMI_EMMCCTL_CTLRST_Msk (0x1ul << FMI_EMMCCTL_CTLRST_Pos) /*!< FMI EMMCCTL: CTLRST Mask */ - -#define FMI_EMMCCTL_DBW_Pos (15) /*!< FMI EMMCCTL: DBW Position */ -#define FMI_EMMCCTL_DBW_Msk (0x1ul << FMI_EMMCCTL_DBW_Pos) /*!< FMI EMMCCTL: DBW Mask */ - -#define FMI_EMMCCTL_BLKCNT_Pos (16) /*!< FMI EMMCCTL: BLKCNT Position */ -#define FMI_EMMCCTL_BLKCNT_Msk (0xfful << FMI_EMMCCTL_BLKCNT_Pos) /*!< FMI EMMCCTL: BLKCNT Mask */ - -#define FMI_EMMCCTL_SDNWR_Pos (24) /*!< FMI EMMCCTL: SDNWR Position */ -#define FMI_EMMCCTL_SDNWR_Msk (0xful << FMI_EMMCCTL_SDNWR_Pos) /*!< FMI EMMCCTL: SDNWR Mask */ - -#define FMI_EMMCCMD_ARGUMENT_Pos (0) /*!< FMI EMMCCMD: ARGUMENT Position */ -#define FMI_EMMCCMD_ARGUMENT_Msk (0xfffffffful << FMI_EMMCCMD_ARGUMENT_Pos) /*!< FMI EMMCCMD: ARGUMENT Mask */ - -#define FMI_EMMCINTEN_BLKDIEN_Pos (0) /*!< FMI EMMCINTEN: BLKDIEN Position */ -#define FMI_EMMCINTEN_BLKDIEN_Msk (0x1ul << FMI_EMMCINTEN_BLKDIEN_Pos) /*!< FMI EMMCINTEN: BLKDIEN Mask */ - -#define FMI_EMMCINTEN_CRCIEN_Pos (1) /*!< FMI EMMCINTEN: CRCIEN Position */ -#define FMI_EMMCINTEN_CRCIEN_Msk (0x1ul << FMI_EMMCINTEN_CRCIEN_Pos) /*!< FMI EMMCINTEN: CRCIEN Mask */ - -#define FMI_EMMCINTEN_RTOIEN_Pos (12) /*!< FMI EMMCINTEN: RTOIEN Position */ -#define FMI_EMMCINTEN_RTOIEN_Msk (0x1ul << FMI_EMMCINTEN_RTOIEN_Pos) /*!< FMI EMMCINTEN: RTOIEN Mask */ - -#define FMI_EMMCINTEN_DITOIEN_Pos (13) /*!< FMI EMMCINTEN: DITOIEN Position */ -#define FMI_EMMCINTEN_DITOIEN_Msk (0x1ul << FMI_EMMCINTEN_DITOIEN_Pos) /*!< FMI EMMCINTEN: DITOIEN Mask */ - -#define FMI_EMMCINTSTS_BLKDIF_Pos (0) /*!< FMI EMMCINTSTS: BLKDIF Position */ -#define FMI_EMMCINTSTS_BLKDIF_Msk (0x1ul << FMI_EMMCINTSTS_BLKDIF_Pos) /*!< FMI EMMCINTSTS: BLKDIF Mask */ - -#define FMI_EMMCINTSTS_CRCIF_Pos (1) /*!< FMI EMMCINTSTS: CRCIF Position */ -#define FMI_EMMCINTSTS_CRCIF_Msk (0x1ul << FMI_EMMCINTSTS_CRCIF_Pos) /*!< FMI EMMCINTSTS: CRCIF Mask */ - -#define FMI_EMMCINTSTS_CRC7_Pos (2) /*!< FMI EMMCINTSTS: CRC7 Position */ -#define FMI_EMMCINTSTS_CRC7_Msk (0x1ul << FMI_EMMCINTSTS_CRC7_Pos) /*!< FMI EMMCINTSTS: CRC7 Mask */ - -#define FMI_EMMCINTSTS_CRC16_Pos (3) /*!< FMI EMMCINTSTS: CRC16 Position */ -#define FMI_EMMCINTSTS_CRC16_Msk (0x1ul << FMI_EMMCINTSTS_CRC16_Pos) /*!< FMI EMMCINTSTS: CRC16 Mask */ - -#define FMI_EMMCINTSTS_CRCSTS_Pos (4) /*!< FMI EMMCINTSTS: CRCSTS Position */ -#define FMI_EMMCINTSTS_CRCSTS_Msk (0x7ul << FMI_EMMCINTSTS_CRCSTS_Pos) /*!< FMI EMMCINTSTS: CRCSTS Mask */ - -#define FMI_EMMCINTSTS_DAT0STS_Pos (7) /*!< FMI EMMCINTSTS: DAT0STS Position */ -#define FMI_EMMCINTSTS_DAT0STS_Msk (0x1ul << FMI_EMMCINTSTS_DAT0STS_Pos) /*!< FMI EMMCINTSTS: DAT0STS Mask */ - -#define FMI_EMMCINTSTS_RTOIF_Pos (12) /*!< FMI EMMCINTSTS: RTOIF Position */ -#define FMI_EMMCINTSTS_RTOIF_Msk (0x1ul << FMI_EMMCINTSTS_RTOIF_Pos) /*!< FMI EMMCINTSTS: RTOIF Mask */ - -#define FMI_EMMCINTSTS_DINTOIF_Pos (13) /*!< FMI EMMCINTSTS: DINTOIF Position */ -#define FMI_EMMCINTSTS_DINTOIF_Msk (0x1ul << FMI_EMMCINTSTS_DINTOIF_Pos) /*!< FMI EMMCINTSTS: DINTOIF Mask */ - -#define FMI_EMMCRESP0_RESPTK0_Pos (0) /*!< FMI EMMCRESP0: RESPTK0 Position */ -#define FMI_EMMCRESP0_RESPTK0_Msk (0xfffffffful << FMI_EMMCRESP0_RESPTK0_Pos) /*!< FMI EMMCRESP0: RESPTK0 Mask */ - -#define FMI_EMMCRESP1_RESPTK1_Pos (0) /*!< FMI EMMCRESP1: RESPTK1 Position */ -#define FMI_EMMCRESP1_RESPTK1_Msk (0xfful << FMI_EMMCRESP1_RESPTK1_Pos) /*!< FMI EMMCRESP1: RESPTK1 Mask */ - -#define FMI_EMMCBLEN_BLKLEN_Pos (0) /*!< FMI EMMCBLEN: BLKLEN Position */ -#define FMI_EMMCBLEN_BLKLEN_Msk (0x7fful << FMI_EMMCBLEN_BLKLEN_Pos) /*!< FMI EMMCBLEN: BLKLEN Mask */ - -#define FMI_EMMCTOUT_TOUT_Pos (0) /*!< FMI EMMCTOUT: TOUT Position */ -#define FMI_EMMCTOUT_TOUT_Msk (0xfffffful << FMI_EMMCTOUT_TOUT_Pos) /*!< FMI EMMCTOUT: TOUT Mask */ - -/**@}*/ /* FMI_CONST */ - -//--- define type of SD card or MMC -#define EMMC_TYPE_UNKNOWN 0 /*!< Card Type - Unknoen \hideinitializer */ -#define EMMC_TYPE_SD_HIGH 1 /*!< Card Type - SDH \hideinitializer */ -#define EMMC_TYPE_SD_LOW 2 /*!< Card Type - SD \hideinitializer */ -#define EMMC_TYPE_MMC 3 /*!< Card Type - MMC \hideinitializer */ -#define EMMC_TYPE_EMMC 4 /*!< Card Type - eMMC \hideinitializer */ - -#define EMMC_ERR_ID 0xFFFF0180 /*!< FMI Error ID \hideinitializer */ -#define EMMC_TIMEOUT (EMMC_ERR_ID|0x01) /*!< FMI Error - Timeout \hideinitializer */ -#define EMMC_NO_MEMORY (EMMC_ERR_ID|0x02) /*!< FMI Error - No Memory \hideinitializer */ -/* EMMC error */ -#define EMMC_NO_CARD (EMMC_ERR_ID|0x10) /*!< FMI Error - No card \hideinitializer */ -#define EMMC_ERR_DEVICE (EMMC_ERR_ID|0x11) /*!< FMI Error - device err \hideinitializer */ -#define EMMC_INIT_TIMEOUT (EMMC_ERR_ID|0x12) /*!< FMI Error - init timeout \hideinitializer */ -#define EMMC_SELECT_ERROR (EMMC_ERR_ID|0x13) /*!< FMI Error - select err \hideinitializer */ -#define EMMC_WRITE_PROTECT (EMMC_ERR_ID|0x14) /*!< FMI Error - write protect \hideinitializer */ -#define EMMC_INIT_ERROR (EMMC_ERR_ID|0x15) /*!< FMI Error - init err \hideinitializer */ -#define EMMC_CRC7_ERROR (EMMC_ERR_ID|0x16) /*!< FMI Error - crc7 err \hideinitializer */ -#define EMMC_CRC16_ERROR (EMMC_ERR_ID|0x17) /*!< FMI Error - crc16 err \hideinitializer */ -#define EMMC_CRC_ERROR (EMMC_ERR_ID|0x18) /*!< FMI Error - crc err \hideinitializer */ -#define EMMC_CMD8_ERROR (EMMC_ERR_ID|0x19) /*!< FMI Error - CMD8 err \hideinitializer */ - -#define SD_FREQ 25000 /*!< Unit: kHz. Output 25MHz to SD \hideinitializer */ -#define SDHC_FREQ 50000 /*!< Unit: kHz. Output 50MHz to SDH \hideinitializer */ -#define MMC_FREQ 20000 /*!< Unit: kHz. Output 20MHz to MMC \hideinitializer */ -#define EMMC_FREQ 26000 /*!< Unit: kHz. Output 26MHz to eMMC \hideinitializer */ - -/*@}*/ /* end of group N9H30_FMI_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_FMI_EXPORTED_TYPEDEF FMI Exported Type Defines - @{ -*/ -/** \brief Structure type of Card information. - */ -typedef struct eMMC_info_t -{ - unsigned int CardType; /*!< SDHC, SD, or MMC */ - unsigned int RCA; /*!< relative card address */ - unsigned char IsCardInsert; /*!< card insert state */ - unsigned int totalSectorN; /*!< total sector number */ - unsigned int diskSize; /*!< disk size in Kbytes */ - int sectorSize; /*!< sector size in bytes */ -} EMMC_INFO_T; - -/*@}*/ /* end of group N9H30_FMI_EXPORTED_TYPEDEF */ - -/// @cond HIDDEN_SYMBOLS -extern EMMC_INFO_T eMMC; -extern unsigned char volatile _fmi_eMMCDataReady; - -/// @endcond HIDDEN_SYMBOLS - -/** @addtogroup N9H30_FMI_EXPORTED_FUNCTIONS FMI Exported Functions - @{ -*/ - - -/** - * @brief Enable specified interrupt. - * - * @param[in] u32IntMask Interrupt type mask: - * \ref FMI_EMMCINTEN_BLKDIEN_Msk / \ref FMI_EMMCINTEN_CRCIEN_Msk / - * \ref FMI_EMMCINTEN_RTOIEN_Msk / \ref FMI_EMMCINTEN_DITOIEN_Msk / - * - * @return None. - * \hideinitializer - */ -#define FMI_EMMC_ENABLE_INT(u32IntMask) (outpw(REG_FMI_EMMCINTEN, inpw(REG_FMI_EMMCINTEN)|(u32IntMask))) - -/** - * @brief Disable specified interrupt. - * - * @param[in] u32IntMask Interrupt type mask: - * \ref FMI_EMMCINTEN_BLKDIEN_Msk / \ref FMI_EMMCINTEN_CRCIEN_Msk / - * \ref FMI_EMMCINTEN_RTOIEN_Msk / \ref FMI_EMMCINTEN_DITOIEN_Msk / - * - * @return None. - * \hideinitializer - */ -#define FMI_EMMC_DISABLE_INT(u32IntMask) (outpw(REG_FMI_EMMCINTEN, inpw(REG_FMI_EMMCINTEN) & ~(u32IntMask))) - -/** - * @brief Get specified interrupt flag/status. - * - * @param[in] u32IntMask Interrupt type mask: - * \ref FMI_EMMCINTSTS_BLKDIF_Msk / \ref FMI_EMMCINTSTS_CRCIF_Msk / \ref FMI_EMMCINTSTS_CRC7_Msk / - * \ref FMI_EMMCINTSTS_CRC16_Msk / \ref FMI_EMMCINTSTS_CRCSTS_Msk / \ref FMI_EMMCINTSTS_DAT0STS_Msk / - * \ref FMI_EMMCINTSTS_RTOIF_Msk / \ref FMI_EMMCINTSTS_DINTOIF_Msk / - * - * @return 0 = The specified interrupt is not happened. - * 1 = The specified interrupt is happened. - * \hideinitializer - */ -#define FMI_EMMC_GET_INT_FLAG(u32IntMask) ((inpw(REG_FMI_EMMCINTSTS)&(u32IntMask))?1:0) - - -/** - * @brief Clear specified interrupt flag/status. - * - * @param[in] u32IntMask Interrupt type mask: - * \ref FMI_EMMCINTSTS_BLKDIF_Msk / \ref FMI_EMMCINTSTS_CRCIF_Msk / - * \ref FMI_EMMCINTSTS_RTOIF_Msk / \ref FMI_EMMCINTSTS_DINTOIF_Msk - * - * @return None. - * \hideinitializer - */ -#define FMI_EMMC_CLR_INT_FLAG(u32IntMask) (outpw(REG_FMI_EMMCINTSTS, u32IntMask)) - - -/** - * @brief Check eMMC Card inserted or removed. - * - * @return 1: Card inserted. - * 0: Card removed. - * \hideinitializer - */ -#define FMI_EMMC_IS_CARD_PRESENT() (eMMC.IsCardInsert) - -/** - * @brief Get eMMC Card capacity. - * - * @return eMMC Card capacity. (unit: KByte) - * \hideinitializer - */ -#define FMI_EMMC_GET_CARD_CAPACITY() (eMMC.diskSize) - - -void eMMC_Open(void); -void eMMC_Probe(void); -unsigned int eMMC_Read(unsigned char *pu8BufAddr, unsigned int u32StartSec, unsigned int u32SecCount); -unsigned int eMMC_Write(unsigned char *pu8BufAddr, unsigned int u32StartSec, unsigned int u32SecCount); -void FMI_SetReferenceClock(unsigned int u32Clock); -void eMMC_Open_Disk(void); -void eMMC_Close_Disk(void); - - -/*@}*/ /* end of group N9H30_FMI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_FMI_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#endif //end of __NU_FMI_H__ -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_gpio.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_gpio.h deleted file mode 100644 index f644ab12297..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_gpio.h +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************//** -* @file gpio.h -* @version V1.00 -* @brief N9H30 GPIO driver header file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_GPIO_H__ -#define __NU_GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup N9H30_GPIO_EXPORTED_CONSTANTS GPIO Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -/// @cond HIDDEN_SYMBOLS -#ifndef GPIO_ERR_PORT_BUSY -#define GPIO_ERR_PORT_BUSY -1 -#define GPIO_ERR_UNSUPPORTED -2 -#define GPIO_ERR_BIT_BUSY -3 -#define SUCCESSFUL 0 -#endif -/// @endcond HIDDEN_SYMBOLS - -#define MAX_PORT 10 /*!< GPIO Port Number */ - -#define GPIOA_MASK 0x0000FFFF /*!< GPIO Port A Mask */ -#define GPIOB_MASK 0x0000FFFF /*!< GPIO Port B Mask */ -#define GPIOC_MASK 0x00007FFF /*!< GPIO Port C Mask */ -#define GPIOD_MASK 0x0000FFFF /*!< GPIO Port D Mask */ -#define GPIOE_MASK 0x0000FFFF /*!< GPIO Port E Mask */ -#define GPIOF_MASK 0x0000FFFF /*!< GPIO Port F Mask */ -#define GPIOG_MASK 0x0000FFFF /*!< GPIO Port G Mask */ -#define GPIOH_MASK 0x0000FFFF /*!< GPIO Port H Mask */ -#define GPIOI_MASK 0x0000FFFF /*!< GPIO Port I Mask */ -#define GPIOJ_MASK 0x0000003F /*!< GPIO Port J Mask */ - -/// @cond HIDDEN_SYMBOLS -typedef INT32(*GPIO_CALLBACK)(UINT32 status, UINT32 userData); -typedef INT32(*EINT_CALLBACK)(UINT32 status, UINT32 userData); -/// @endcond HIDDEN_SYMBOLS - -/** \brief Structure type of GPIO_PORT - */ -typedef enum -{ - GPIOA = 0x000, /*!< Port A offset of GPIO base address */ - GPIOB = 0x040, /*!< Port B offset of GPIO base address */ - GPIOC = 0x080, /*!< Port C offset of GPIO base address */ - GPIOD = 0x0C0, /*!< Port D offset of GPIO base address */ - GPIOE = 0x100, /*!< Port E offset of GPIO base address */ - GPIOF = 0x140, /*!< Port F offset of GPIO base address */ - GPIOG = 0x180, /*!< Port G offset of GPIO base address */ - GPIOH = 0x1C0, /*!< Port H offset of GPIO base address */ - GPIOI = 0x200, /*!< Port I offset of GPIO base address */ - GPIOJ = 0x240, /*!< Port J offset of GPIO base address */ -} GPIO_PORT; - -/** \brief Structure type of GPIO_DIR - */ -typedef enum -{ - DIR_INPUT, /*!< GPIO Output mode */ - DIR_OUTPUT /*!< GPIO Input mode */ -} GPIO_DIR; - -/** \brief Structure type of GPIO_PULL - */ -typedef enum -{ - NO_PULL_UP, /*!< GPIO Pull-Up Disable */ - PULL_UP, /*!< GPIO Pull-Up Enable */ - PULL_DOWN /*!< GPIO Pull-Down Enable */ -} GPIO_PULL; - -/** \brief Structure type of GPIO_DRV - */ -typedef enum -{ - DRV_LOW, /*!< GPIO Set to Low */ - DRV_HIGH /*!< GPIO Set to High */ -} GPIO_DRV; - -/** \brief Structure type of GPIO_NIRQ - */ -typedef enum -{ - NIRQ0 = 0, /*!< External interrupt 0 */ - NIRQ1, /*!< External interrupt 1 */ - NIRQ2, /*!< External interrupt 2 */ - NIRQ3, /*!< External interrupt 3 */ - NIRQ4, /*!< External interrupt 4 */ - NIRQ5, /*!< External interrupt 5 */ - NIRQ6, /*!< External interrupt 6 */ - NIRQ7, /*!< External interrupt 7 */ -} GPIO_NIRQ; - -/** \brief Structure type of GPIO_TRIGGER_TYPE - */ -typedef enum -{ - LOW, /*!< Trigger type set low */ - HIGH, /*!< Trigger type set high */ - FALLING, /*!< Trigger type set falling edge */ - RISING, /*!< Trigger type set rising edge */ - BOTH_EDGE /*!< Trigger type set falling edge and rising edge */ -} GPIO_TRIGGER_TYPE; - -/// @cond HIDDEN_SYMBOLS -/// @endcond HIDDEN_SYMBOLS - -/*@}*/ /* end of group N9H30_GPIO_EXPORTED_CONSTANTS */ - - -/** @addtogroup N9H30_GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/* General GPIO bit function */ -INT32 GPIO_OpenBit(GPIO_PORT port, UINT32 bit, GPIO_DIR direction, GPIO_PULL pull); -INT32 GPIO_CloseBit(GPIO_PORT port, UINT32 bit); -INT32 GPIO_SetBit(GPIO_PORT port, UINT32 bit); -INT32 GPIO_ClrBit(GPIO_PORT port, UINT32 bit); -INT32 GPIO_ReadBit(GPIO_PORT port, UINT32 bit); -INT32 GPIO_SetBitDir(GPIO_PORT port, UINT32 bit, GPIO_DIR direction); -INT32 GPIO_EnableTriggerType(GPIO_PORT port, UINT32 bit, GPIO_TRIGGER_TYPE triggerType); -INT32 GPIO_DisableTriggerType(GPIO_PORT port, UINT32 bit); - -/* External GPIO interrupt function */ -INT32 GPIO_EnableDebounce(INT32 debounceClkSel); -INT32 GPIO_DisableDebounce(void); - -/*@}*/ /* end of group N9H30_GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_GPIO_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_GPIO_H__ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2c.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2c.h deleted file mode 100644 index ece04bfa83d..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2c.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************//** -* @file i2c.h -* @brief N9H30 I2C driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_I2C_H__ -#define __NU_I2C_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_I2C_Driver I2C Driver - @{ -*/ - -/** @addtogroup N9H30_I2C_EXPORTED_CONSTANTS I2C Exported Constants - @{ -*/ -/// @cond HIDDEN_SYMBOLS - -/*-----------------------------------------*/ -/* marco, type and constant definitions */ -/*-----------------------------------------*/ -#define I2C_MAX_BUF_LEN 450 - -/*-----------------------------------------*/ -/* global interface variables declarations */ -/*-----------------------------------------*/ -/* - bit map in CMDR -*/ -#define I2C_CMD_START 0x10 -#define I2C_CMD_STOP 0x08 -#define I2C_CMD_READ 0x04 -#define I2C_CMD_WRITE 0x02 -#define I2C_CMD_NACK 0x01 - -/* - for transfer use -*/ -#define I2C_WRITE 0x00 -#define I2C_READ 0x01 - -#define I2C_STATE_NOP 0x00 -#define I2C_STATE_READ 0x01 -#define I2C_STATE_WRITE 0x02 -#define I2C_STATE_PROBE 0x03 - -/* - i2c register offset -*/ -#define I2C_CSR (0x00) /*!< Control and Status Register */ -#define I2C_DIVIDER (0x04) /*!< Clock Prescale Register */ -#define I2C_CMDR (0x08) /*!< Command Register */ -#define I2C_SWR (0x0C) /*!< Software Mode Control Register */ -#define I2C_RxR (0x10) /*!< Data Receive Register */ -#define I2C_TxR (0x14) /*!< Data Transmit Register */ - -/// @endcond HIDDEN_SYMBOLS - -/* - ioctl commands -*/ -#define I2C_IOC_SET_DEV_ADDRESS 0 /*!< Set device slave address */ -#define I2C_IOC_SET_SUB_ADDRESS 1 /*!< Set sub address */ -#define I2C_IOC_SET_SPEED 2 /*!< Set I2C interface speed */ - -/* - error code -*/ -#define I2C_ERR_ID 0xFFFF1100 /*!< I2C library ID */ -#define I2C_ERR_NOERROR (0x00) /*!< No error */ -#define I2C_ERR_LOSTARBITRATION (0x01 | I2C_ERR_ID) /*!< Arbitration lost error */ -#define I2C_ERR_BUSBUSY (0x02 | I2C_ERR_ID) /*!< Bus busy error */ -#define I2C_ERR_NACK (0x03 | I2C_ERR_ID) /*!< data transfer error */ -#define I2C_ERR_SLAVENACK (0x04 | I2C_ERR_ID) /*!< slave not respond after address */ -#define I2C_ERR_NODEV (0x05 | I2C_ERR_ID) /*!< Wrong device */ -#define I2C_ERR_BUSY (0x06 | I2C_ERR_ID) /*!< Device busy */ -#define I2C_ERR_IO (0x07 | I2C_ERR_ID) /*!< Interface not open */ -#define I2C_ERR_NOTTY (0x08 | I2C_ERR_ID) /*!< Command not support */ - -/*@}*/ /* end of group N9H30_I2C_EXPORTED_CONSTANTS */ - -/*@}*/ /* end of group N9H30_I2C_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_I2C_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2s.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2s.h deleted file mode 100644 index e7ee11de217..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_i2s.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************//** -* @file i2s.h -* @brief N9H30 I2S driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_I2S_H__ -#define __NU_I2S_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup N9H30_I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ - -#define I2S_ERR_BUSY -1 /*!< Interface is busy */ -#define I2S_ERR_IO -2 /*!< IO contril error */ - -#define I2S_DISABLE 0 /*!< Enable I2S */ -#define I2S_ENABLE 1 /*!< Disable I2S */ - -#define I2S_PLAY 0 /*!< Play I2S audio */ -#define I2S_REC 1 /*!< Reocrd I2S audio */ - -#define PCM_PLAY 0 /*!< Play PCM audio */ -#define PCM_REC 1 /*!< Record PCM audio */ - -#define I2S_SET_PLAY 0 /*!< Start or stop to play */ -#define I2S_START_PLAY 0 /*!< Start to play */ -#define I2S_STOP_PLAY 1 /*!< Stop to play */ - -#define I2S_SET_RECORD 1 /*!< Start or stop to record */ -#define I2S_START_REC 0 /*!< Start to record */ -#define I2S_STOP_REC 1 /*!< Stop to record */ - -#define I2S_SELECT_BLOCK 2 /*!< Select block function */ -#define I2S_BLOCK_I2S 0 /*!< Select I2S function */ -#define I2S_BLOCK_PCM 1 /*!< Select PCM function */ - -#define I2S_SELECT_BIT 3 /*!< Select data bit width */ -#define I2S_BIT_WIDTH_8 0 /*!< 8-bit */ -#define I2S_BIT_WIDTH_16 1 /*!< 16-bit */ -#define I2S_BIT_WIDTH_24 2 /*!< 24-bit */ - -#define I2S_SET_PLAY_DMA_INT_SEL 4 /*!< Select play DMA interrupt request */ -#define I2S_SET_REC_DMA_INT_SEL 5 /*!< Select record DMA interrupt request */ -#define I2S_DMA_INT_END 0 /*!< End of buffer */ -#define I2S_DMA_INT_HALF 1 /*!< Half of buffer */ -#define I2S_DMA_INT_QUARTER 2 /*!< Quarter of buffer */ -#define I2S_DMA_INT_EIGHTH 3 /*!< Eighth of buffer */ - -#define I2S_SET_ZEROCROSS 6 /*!< Enable or disable zero cross function */ -#define I2S_SET_DMACOUNTER 7 /*!< Enable or disable DMA counter function */ - -#define I2S_SET_CHANNEL 8 /*!< Set channel number */ -#define I2S_CHANNEL_P_I2S_ONE 2 /*!< I2S one channel */ -#define I2S_CHANNEL_P_I2S_TWO 3 /*!< I2S two channels */ -#define I2S_CHANNEL_P_PCM_TWO 3 /*!< PCM two slots */ -#define I2S_CHANNEL_P_PCM_TWO_SLOT1 0 /*!< PCM two slots with all slot1 data */ -#define I2S_CHANNEL_P_PCM_TWO_SLOT0 1 /*!< PCM two slots with all slot0 data */ -#define I2S_CHANNEL_P_PCM_ONE_SLOT0 2 /*!< PCM one slot with all slot0 data */ - -#define I2S_CHANNEL_R_I2S_LEFT_PCM_SLOT0 1 /*!< I2S left channel or PCM slot0 */ -#define I2S_CHANNEL_R_I2S_RIGHT_PCM_SLOT1 2 /*!< I2S right channel or PCM slot1 */ -#define I2S_CHANNEL_R_I2S_TWO 3 /*!< I2S two channels */ - -#define I2S_SET_MODE 9 /*!< Select master or slave mode */ -#define I2S_MODE_MASTER 0 /*!< master mode */ -#define I2S_MODE_SLAVE 1 /*!< slave mode */ - -#define I2S_SET_SPLITDATA 10 /*!< Enable or disable split data function */ -#define I2S_SET_DMA_ADDRESS 11 /*!< Set DMA address */ -#define I2S_SET_DMA_LENGTH 12 /*!< Set DMA length */ -#define I2S_GET_DMA_CUR_ADDRESS 13 /*!< Get current DMA address */ - -#define I2S_SET_I2S_FORMAT 14 /*!< Select I2S format */ -#define I2S_FORMAT_I2S 0 /*!< I2S format */ -#define I2S_FORMAT_MSB 1 /*!< MSB foramt */ - -#define I2S_SET_I2S_CALLBACKFUN 15 /*!< Install play or record call-back function */ - -#define I2S_SET_PCMSLOT 16 /*!< Set PCM interface start position of slot */ -#define PCM_SLOT1_IN 0 /*!< Slot-1 in position */ -#define PCM_SLOT1_OUT 1 /*!< Slot-1 out position */ -#define PCM_SLOT2_IN 2 /*!< Slot-2 in position */ -#define PCM_SLOT2_OUT 3 /*!< Slot-2 out position */ - -#define I2S_SET_PCM_FS_PERIOD 17 /*!< Set PCM FS pulse period */ - -/*@}*/ /* end of group N9H30_I2S_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -int32_t i2sOpen(void); -void i2sClose(void); -void i2sInit(void); -int32_t i2sIoctl(uint32_t cmd, uint32_t arg0, uint32_t arg1); -void i2sSetSampleRate(uint32_t u32SourceClockRate, uint32_t u32SampleRate, uint32_t u32DataBit, uint32_t u32Channel); -void i2sSetMCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32SampleRate); -void i2sSetPCMBCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32Rate); - -/*@}*/ /* end of group N9H30_I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_I2S_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_I2S_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpeg.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpeg.h deleted file mode 100644 index 4dcb153d413..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpeg.h +++ /dev/null @@ -1,398 +0,0 @@ -/**************************************************************************//** -* @file jpeg.h -* @brief N9H30 JPEG driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_JPEG_H__ -#define __NU_JPEG_H__ - -#include "nu_jpegcodec.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_JPEG_Driver JPEG Driver - @{ -*/ - -/** @addtogroup N9H30_JPEG_EXPORTED_CONSTANTS JPEG Exported Constants - @{ -*/ - - -/// @cond HIDDEN_SYMBOLS -// Define bits mask -#define NVTBIT(start,end) ((0xFFFFFFFFUL >> (31 - start)) & (0xFFFFFFFFUL >>end << end)) -/// @endcond HIDDEN_SYMBOLS - - -//JMCR -#define RESUMEI BIT9 /*!< Resume JPEG Operation for Input On-the-Fly Mode */ -#define RESUMEO BIT8 /*!< Resume JPEG Operation for Output On-the-Fly Mode */ -#define ENC_DEC BIT7 /*!< JPEG Encode/Decode Mode */ -#define WIN_DEC BIT6 /*!< JPEG Window Decode Mode */ -#define PRI BIT5 /*!< Encode Primary Image */ -#define THB BIT4 /*!< Encode Thumbnail Image */ -#define EY422 BIT3 /*!< Encode Image Format */ -#define QT_BUSY BIT2 /*!< Quantization-Table Busy Status (Read-Only) */ -#define ENG_RST BIT1 /*!< Soft Reset JPEG Engine (Except JPEG Control Registers) */ -#define JPG_EN BIT0 /*!< JPEG Engine Operation Control */ - -//JHEADER -#define P_JFIF BIT7 /*!< Primary JPEG Bit-stream Include JFIF Header */ -#define P_HTAB BIT6 /*!< Primary JPEG Bit-stream Include Huffman-Table */ -#define P_QTAB BIT5 /*!< Primary JPEG Bit-stream Include Quantization-Table */ -#define P_DRI BIT4 /*!< Primary JPEG Bit-stream Include Restart Interval */ -#define T_JFIF BIT3 /*!< Thumbnail JPEG Bit-stream Include JFIF Header */ -#define T_HTAB BIT2 /*!< Thumbnail JPEG Bit-stream Include Huffman-Table */ -#define T_QTAB BIT1 /*!< Thumbnail JPEG Bit-stream Include Quantization-Table */ -#define T_DRI BIT0 /*!< Thumbnail JPEG Bit-stream Include Restart Interval */ - -//JITCR -#define Dec_Scatter_Gather BIT18 -#define DEC_OTF BIT17 /*!< Decoder on the fly with VPE */ -#define ARGB8888 BIT16 /*!< ARGB8888 */ -#define PLANAR_ON BIT15 /*!< Packet On */ -#define ORDER BIT14 /*!< Decode Packet Data Order */ -#define RGB_555_565 BIT13 /*!< RGB555 & RGB565 */ -#define ROTATE NVTBIT(12,11) /*!< Encode Image Rotate */ -#define DYUV_MODE NVTBIT(10,8) /*!< Decoded Image YUV Color Format (Read-Only) */ -#define EXIF BIT7 /*!< Encode Quantization-Table & Huffman-Table Header Format Selection */ -#define EY_ONLY BIT6 /*!< Encode Gray-level (Y-component Only) Image */ -#define DHEND BIT5 /*!< Header Decode Complete Stop Enable */ -#define DTHB BIT4 /*!< Decode Thumbnail Image Only */ -#define E3QTAB BIT3 /*!< Numbers of Quantization-Table are Used For Encode */ -#define D3QTAB BIT2 /*!< Numbers of Quantization-Table are Used For Decode (Read-Only) */ -#define ERR_DIS BIT1 /*!< Decode Error Engine Abort */ -#define PDHTAB BIT0 /*!< Programmable Huffman-Table Function For Decode */ - -//JPRIQC -#define P_QADJUST NVTBIT(7,4) /*!< Primary Quantization-Table Adjustment */ -#define P_QVS NVTBIT(3,0) /*!< Primary Quantization-Table Scaling Control */ - -//JTHBQC -#define T_QADJUST NVTBIT(7,4) /*!< Thumbnail Quantization-Table Adjustment */ -#define T_QVS NVTBIT(3,0) /*!< Thumbnail Quantization-Table Scaling Control */ - -//JPRIWH -#define P_HEIGHT NVTBIT(27,16) /*!< Primary Encode Image Height */ -#define P_WIDTH NVTBIT(11,0) /*!< Primary Encode Image Width */ - -//JTHBWH -#define T_HEIGHT NVTBIT(27,16) /*!< Thumbnail Encode Image Height */ -#define T_WIDTH NVTBIT(11,0) /*!< Thumbnail Encode Image Width */ - -//JPRST -#define P_RST NVTBIT(7,0) /*!< Primary Encode Restart Interval Value */ - -//JTRST -#define T_RST NVTBIT(7,0) /*!< Thumbnail Encode Restart Interval Value */ - -//JDECWH -#define DEC_HEIGHT NVTBIT(31,16) /*!< 13-bit Bit Stream Buffer threshold */ -#define DEC_WIDTH NVTBIT(15,0) /*!< 13-bit Header Offset Address */ - -//JINTCR -#define JPG_DOW_INTE BIT28 /*!< Decoding Output Wait Interrupt Enable */ -#define JPG_DOW_INTS BIT24 /*!< Status of Decoding Output Wait */ -#define JPG_WAITI BIT23 /*!< JPEG Input Wait Status (Read-Only) */ -#define JPG_WAITO BIT22 /*!< JPEG Output Wait Status (Read-Only) */ -#define BAbort BIT16 /*!< JPEG Memory Access Error Status (Read-Only) */ -#define CER_INTE BIT15 /*!< Un-complete Capture On-The-Fly Frame Occur Interrupt Enable */ -#define DHE_INTE BIT14 /*!< JPEG Header Decode End Wait Interrupt Enable */ -#define IPW_INTE BIT13 /*!< Input Wait Interrupt Enable */ -#define OPW_INTE BIT12 /*!< Output Wait Interrupt Enable */ -#define ENC_INTE BIT11 /*!< Encode Complete Interrupt Enable */ -#define DEC_INTE BIT10 /*!< Decode Complete Interrupt Enable */ -#define DER_INTE BIT9 /*!< Decode Error Interrupt Enable */ -#define EER_INTE BIT8 /*!< Encode (On-The-Fly) Error Interrupt Enable */ -#define CER_INTS BIT7 /*!< Un-complete Capture On-The-Fly Frame Occur Interrupt Status */ -#define DHE_INTS BIT6 /*!< JPEG Header Decode End Wait Interrupt Status */ -#define IPW_INTS BIT5 /*!< Input Wait Interrupt Status */ -#define OPW_INTS BIT4 /*!< Output Wait Interrupt Status */ -#define ENC_INTS BIT3 /*!< Encode Complete Interrupt Status */ -#define DEC_INTS BIT2 /*!< Decode Complete Interrupt Status */ -#define DER_INTS BIT1 /*!< Decode Error Interrupt Status */ -#define EER_INTS BIT0 /*!< Encode (On-The-Fly) Error Interrupt Status */ - -//JPEG_BSBAD -#define BIST_ST NVTBIT(23,16) /*!< Internal SRAM BIST Status (Read-Only) */ -#define TEST_DOUT NVTBIT(15,8) /*!< Test Data Output (Read-Only) */ -#define TEST_ON BIT7 /*!< Test Enable */ -#define BIST_ON BIT6 /*!< Internal SRAM BIST Mode Enable */ -#define BIST_FINI BIT5 /*!< Internal SRAM BIST Mode Finish (Read-Only) */ -#define BSBAD_BIST_FAIL BIT4 /*!< Internal SRAM BIST Mode Fail (Read-Only) */ -#define TEST_SEL NVTBIT(3,0) /*!< Test Data Selection */ - -//JWINDEC0 -#define MCU_S_Y NVTBIT(24,16) /*!< MCU Start Position Y For Window Decode Mode */ -#define MCU_S_X NVTBIT(8,0) /*!< MCU Start Position X For Window Decode Mode */ - -//JWINDEC1 -#define MCU_E_Y NVTBIT(24,16) /*!< MCU End Position Y For Window Decode Mode */ -#define MCU_E_X NVTBIT(8,0) /*!< MCU End Position X For Window Decode Mode */ - -//JWINDEC2 -#define WD_WIDTH NVTBIT(11,0)) /*!< Image Width (Y-Stride) For Window Decode Mode */ - -//JMACR -#define FLY_SEL NVTBIT(29,24) /*!< Hardware Memory On-the-Fly Access Image Buffer-Size Selection for Encode */ -#define FLY_TYPE NVTBIT(23,22) /*!< Dual/Single buffer on-the fly */ -#define BSF_SEL NVTBIT(17,8) /*!< Memory On-the-Fly Access Bitstream Buffer-Size Selection */ -#define FLY_ON BIT7 /*!< Hardware Memory On-the-Fly Access Mode */ -#define IP_SF_ON BIT3 /*!< Software Memory On-the-Fly Access Mode for Data Input */ -#define OP_SF_ON BIT2 /*!< Software Memory On-the-Fly Access Mode for Data Output */ -#define ENC_MODE NVTBIT(1,0) /*!< JPEG Memory Address Mode Control */ - -//JPSCALU -#define JPSCALU_8X BIT6 /*!< Primary Image Up-Scaling For Encode */ -#define A_JUMP BIT2 /*!< Reserve Buffer Size In JPEG Bit-stream For Software Application */ - -//JPSCALD -#define PSX_ON BIT15 /*!< Primary Image Horizontal Down-Scaling For Encode/Decode */ -#define PS_LPF_ON BIT14 /*!< Primary Image Down-Scaling Low Pass Filter For Decode */ -#define PSCALX_F NVTBIT(12,8) /*!< Primary Image Horizontal Down-Scaling Factor */ -#define PSCALY_F NVTBIT(5,0) /*!< Primary Image Vertical Down-Scaling Factor */ - -//JTSCALD -#define TSX_ON BIT15 /*!< Thumbnail Image Horizontal Down-Scaling For Encode/Decode */ -#define TSCALX_F NVTBIT(14,8) /*!< Thumbnail Image Horizontal Down-Scaling Factor */ -#define TSCALY_F NVTBIT(7,0) /*!< Thumbnail Image Vertical Down-Scaling Factor */ - -//JDBCR -#define DBF_EN BIT7 /*!< Dual Buffering Control */ -#define IP_BUF BIT4 /*!< Input Dual Buffer Control */ - -//JRESERVE -#define RES_SIZE NVTBIT(15,0) /*!< Primary Encode Bit-stream Reserved Size */ - -//JOFFSET -#define OFFSET_SIZE NVTBIT(23,0) /*!< Primary/Thumbnail Starting Address Offset Size */ - -//JFSTRIDE -#define F_STRIDE NVTBIT(23,0) /*!< JPEG Encode Bit-stream Frame Stride */ - -//JYADDR0 -#define Y_IADDR0 NVTBIT(31,0) /*!< JPEG Y Component Frame Buffer-0 Starting Address */ - -//JUADDR0 -#define U_IADDR0 NVTBIT(31,0) /*!< JPEG U Component Frame Buffer-0 Starting Address */ - -//JVADDR0 -#define V_IADDR0 NVTBIT(31,0) /*!< JPEG V Component Frame Buffer-0 Starting Address */ - -//JYADDR1 -#define Y_IADDR1 NVTBIT(31,0) /*!< JPEG Y Component Frame Buffer-1 Starting Address */ - -//JUADDR1 -#define U_IADDR1 NVTBIT(31,0) /*!< JPEG U Component Frame Buffer-1 Starting Address */ - -//JVADDR1 -#define V_IADDR1 NVTBIT(31,0) /*!< JPEG V Component Frame Buffer-1 Starting Address */ - -//JYSTRIDE -#define Y_STRIDE NVTBIT(11,0) /*!< JPEG Y Component Frame Buffer Stride */ - -//JUSTRIDE -#define U_STRIDE NVTBIT(11,0) /*!< JPEG U Component Frame Buffer Stride */ - -//JVSTRIDE -#define V_STRIDE NVTBIT(11,0) /*!< JPEG V Component Frame Buffer Stride */ - -//JIOADDR0 -#define IO_IADDR0 NVTBIT(31,0) /*!< JPEG Bit-stream Frame Buffer-0 Starting Address */ - -//JIOADDR1 -#define IO_IADDR1 NVTBIT(31,0) /*!< JPEG Bit-stream Frame Buffer-1 Starting Address */ - -//JPRI_SIZE -#define PRI_SIZE NVTBIT(23,0) /*!< JPEG Primary Image Encode Bit-stream Size */ - -//JTHB_SIZE -#define THB_SIZE NVTBIT(15,0) /*!< JPEG Thumbnail Image Encode Bit-stream Size */ - -//JUPRAT -#define S_HEIGHT NVTBIT(29,16) /*!< JPEG Image Height Up-Scale Ratio */ -#define S_WIDTH NVTBIT(13,0) /*!< JPEG Image Width Up-Scale Ratio */ - -//JBSFIFO -#define BSFIFO_HT NVTBIT(6,4) /*!< Bit-stream FIFO High-Threshold Control */ -#define BSFIFO_LT NVTBIT(2,0) /*!< Bit-stream FIFO Low-Threshold Control */ - -//JSRCH -#define JSRCH_JSRCH NVTBIT(11,0) /*!< JPEG Encode Source Image Height */ - -/*@}*/ /* end of group N9H30_JPEG_EXPORTED_CONSTANTS */ - -/// @cond HIDDEN_SYMBOLS - -//Define for Interrupt Status -#define JPEG_EER_INTS EER_INTS -#define JPEG_DER_INTS DER_INTS -#define JPEG_DEC_INTS DEC_INTS -#define JPEG_ENC_INTS ENC_INTS -#define JPEG_DHE_INTS DHE_INTS -#define JPEG_IPW_INTS IPW_INTS - -//Define for Scaling -#define JPEG_ENC_UPSCALE_MODE 0 -#define JPEG_DEC_PACKET_DOWNSCALE_MODE 1 -#define JPEG_DEC_PLANAR_DOWNSCALE_MODE 2 -#define JPEG_ENC_PLANAR_PRIMARY_DOWNSCALE_MODE 3 -#define JPEG_ENC_PLANAR_THUMBNAIL_DOWNSCALE_MODE 4 - -//Define for Interrupt Enable -#define JPEG_EER_INTE ERR_INTE -#define JPEG_DER_INTE DER_INTE -#define JPEG_DEC_INTE DEC_INTE -#define JPEG_ENC_INTE ENC_INTE -#define JPEG_DHE_INTE DHE_INTE -#define JPEG_IPW_INTE IPW_INTE - -//Register -#define REG_JMCR JMCR /*!< JPEG Mode Control Register */ -#define REG_JHEADER JHEADER /*!< JPEG Encode Header Control Register */ -#define REG_JITCR JITCR /*!< JPEG Image Type Control Register */ -#define REG_JPRIQC JPRIQC /*!< JPEG Primary Q-Table Control Register */ -#define REG_JTHBQC JTHBQC /*!< JPEG Thumbnail Q-Table Control Register */ -#define REG_JPRIWH JPRIWH /*!< JPEG Encode Primary Width/Height Register */ -#define REG_JTHBWH JTHBWH /*!< JPEG Encode Thumbnail Width/Height Register */ -#define REG_JPRST JPRST /*!< JPEG Encode Primary Restart Interval Register */ -#define REG_JTRST JTRST /*!< JPEG Encode Thumbnail Restart Interval */ -#define REG_JDECWH JDECWH /*!< JPEG Decode Image Width/Height Register */ -#define REG_JINTCR JINTCR /*!< JPEG Interrupt Control and Status Register */ -#define REG_JTEST JTEST /*!< JPEG Test Control Register */ -#define REG_JWINDEC0 JWINDEC0 /*!< JPEG Window Decode Mode Control Register 0 */ -#define REG_JWINDEC1 JWINDEC1 /*!< JPEG Window Decode Mode Control Register 1 */ -#define REG_JWINDEC2 JWINDEC2 /*!< JPEG Window Decode Mode Control Register 2 */ -#define REG_JMACR JMACR /*!< JPEG Memory Address Mode Control Register */ -#define REG_JPSCALU JPSCALU /*!< JPEG Primary Scaling-Up Control Register */ -#define REG_JPSCALD JPSCALD /*!< JPEG Primary Scaling-Down Control Register */ -#define REG_JTSCALD JTSCALD /*!< JPEG Thumbnail Scaling-Down Control Register */ -#define REG_JDBCR JDBCR /*!< JPEG Dual-Buffer Control Register */ -#define REG_JRESERVE JRESERVE /*!< JPEG Encode Primary Bit-stream Reserved Size Register */ -#define REG_JOFFSET JOFFSET /*!< JPEG Offset Between Primary & Thumbnail Register */ -#define REG_JFSTRIDE JFSTRIDE /*!< JPEG Encode Bit-stream Frame Stride Register */ -#define REG_JYADDR0 JYADDR0 /*!< JPEG Y Component Frame Buffer-0 Starting Address Register */ -#define REG_JUADDR0 JUADDR0 /*!< JPEG U Component Frame Buffer-0 Starting Address Register */ -#define REG_JVADDR0 JVADDR0 /*!< JPEG V Component Frame Buffer-0 Starting Address Register */ -#define REG_JYADDR1 JYADDR1 /*!< JPEG Y Component Frame Buffer-1 Starting Address Register */ -#define REG_JUADDR1 JUADDR1 /*!< JPEG U Component Frame Buffer-1 Starting Address Register */ -#define REG_JVADDR1 JVADDR1 /*!< JPEG V Component Frame Buffer-1 Starting Address Register */ -#define REG_JYSTRIDE JYSTRIDE /*!< JPEG Y Component Frame Buffer Stride Register */ -#define REG_JUSTRIDE JUSTRIDE /*!< JPEG U Component Frame Buffer Stride Register */ -#define REG_JVSTRIDE JVSTRIDE /*!< JPEG V Component Frame Buffer Stride Register */ -#define REG_JIOADDR0 JIOADDR0 /*!< JPEG Bit-stream Frame Buffer-0 Starting Address Register */ -#define REG_JIOADDR1 JIOADDR1 /*!< JPEG Bit-stream Frame Buffer-1 Starting Address Register */ -#define REG_JPRI_SIZE JPRI_SIZE /*!< JPEG Encode Primary Image Bit-stream Size Register */ -#define REG_JTHB_SIZE JTHB_SIZE /*!< JPEG Encode Thumbnail Image Bit-stream Size Register */ -#define REG_JUPRAT JUPRAT /*!< JPEG Encode Up-Scale Ratio Register */ -#define REG_JBSFIFO JBSFIFO /*!< JPEG Bit-stream FIFO Control Register */ -#define REG_JSRCH JSRCH /*!< JPEG Encode Source Image Height */ -#define REG_JQTAB0 JQTAB0 /*!< JPEG Quantization-Table 0 Register */ -#define REG_JQTAB1 JQTAB1 /*!< JPEG Quantization-Table 1 Register */ -#define REG_JQTAB2 JQTAB2 /*!< JPEG Quantization-Table 2 Register */ - -//Export functions -#define JPEG_SET_YADDR(u32Address) outp32(REG_JYADDR0, u32Address) -#define JPEG_SET_UADDR(u32Address) outp32(REG_JUADDR0, u32Address) -#define JPEG_SET_VADDR(u32Address) outp32(REG_JVADDR0, u32Address) -#define JPEG_GET_YADDR() inp32(REG_JYADDR0) -#define JPEG_GET_UADDR() inp32(REG_JUADDR0) -#define JPEG_GET_VADDR() inp32(REG_JVADDR0) -#define JPEG_SET_YSTRIDE(u32Stride) outp32(REG_JYSTRIDE, u32Stride) -#define JPEG_SET_USTRIDE(u32Stride) outp32(REG_JUSTRIDE, u32Stride) -#define JPEG_SET_VSTRIDE(u32Stride) outp32(REG_JVSTRIDE, u32Stride) -#define JPEG_GET_YSTRIDE() inp32(REG_JYSTRIDE) -#define JPEG_GET_USTRIDE() inp32(REG_JUSTRIDE) -#define JPEG_GET_VSTRIDE() inp32(REG_JVSTRIDE) -#define JPEG_SET_BITSTREAM_ADDR(u32Address) outp32(REG_JIOADDR0,u32Address) -#define JPEG_GET_BITSTREAM_ADDR() inp32(REG_JIOADDR0) -#define JPEG_SET_ENC_DEC(u8Mode) outp32(REG_JMCR, (inp32(REG_JMCR) & ~ENC_DEC) | (u8Mode << 7)); - -//Encode -#define JPEG_GET_ENC_PRIMARY_BITSTREAM_SIZE() inp32(REG_JPRI_SIZE) -#define JPEG_GET_ENC_THUMBNAIL_BITSTREAM_SIZE() inp32(REG_JTHB_SIZE) -#define JPEG_SET_SOURCE_IMAGE_HEIGHT(u16Size) outp32(REG_JSRCH,u16Size) -#define JPEG_GET_SOURCE_IMAGE_HEIGHT() inp32(REG_JSRCH) -#define JPEG_ENC_ENABLE_UPSCALING() outp32(REG_JPSCALU,inp32(REG_JPSCALU) | JPSCALU_8X) -#define JPEG_ENC_DISABLE_UPSCALING() outp32(REG_JPSCALU,inp32(REG_JPSCALU) & ~JPSCALU_8X) -#define JPEG_ENC_ISENABLE_UPSCALING() ((inp32(REG_JPSCALU) & JPSCALU_8X) >> 6) -#define JPEG_ENC_SET_HEADER_CONTROL(u8Control) outp32(REG_JHEADER, u8Control) -#define JPEG_ENC_GET_HEADER_CONTROL() inp32(REG_JHEADER) -#define JPEG_ENC_SET_RDI_VALUE(u8Value) outp32(REG_JPRST,u8Value) -#define JPEG_ENC_GET_RDI_VALUE() inp32(REG_JPRST) - -//Decode -#define JPEG_DEC_ENABLE_DOWNSCALING() outp32(REG_JPSCALD, PSX_ON) -#define JPEG_DEC_ISENABLE_DOWNSCALING() ((inp32(REG_JPSCALD) & PSX_ON) >> 15) -#define JPEG_DEC_DISABLE_DOWNSCALING() outp32(REG_JPSCALD,~PSX_ON) -#define JPEG_DEC_GET_DECODED_IMAGE_FORMAT() (inp32(REG_JITCR) & DYUV_MODE) -#define JPEG_DEC_ENABLE_LOW_PASS_FILTER() outp32(REG_JPSCALD,inp32(REG_JPSCALD) | PS_LPF_ON) -#define JPEG_DEC_DISABLE_LOW_PASS_FILTER() outp32(REG_JPSCALD,inp32(REG_JPSCALD) & ~PS_LPF_ON) -#define JPEG_DEC_ISENABLE_LOW_PASS_FILTER() ((inp32(REG_JPSCALD) & PS_LPF_ON) >> 14) -#define JPEG_DEC_SET_INPUT_WAIT(u16Size) outp32(REG_JMACR, 0x00400008 | ((u16Size & 0x3FF)<< 8) ); -#define JPEG_DEC_RESUME_INPUT_WAIT() outp32(REG_JMCR,inp32(REG_JMCR) | RESUMEI); -#define JPEG_DEC_DISABLE_WINDOWDECODE() outp32(REG_JMCR, inp32(REG_JMCR) & ~(WIN_DEC)); - -//Interrupt -#define JPEG_INT_ENABLE(u32Intflag) outp32(REG_JINTCR, u32Intflag) -#define JPEG_INT_DISABLE(u32Intflag) outp32(REG_JINTCR, inp32 (REG_JINTCR) & ~(u32Intflag)) -#define JPEG_GET_INT_STATUS() (inp32(REG_JINTCR) & 0x010000FF) -#define JPEG_CLEAR_INT(u32Intflag) outp32(REG_JINTCR, (inp32 (REG_JINTCR) & ~0xFF) | u32Intflag) - -static INT jpegSetEncodeMode(UINT8 u8SourceFormat, UINT16 u16JpegFormat); -static INT jpegSetDecodeMode(UINT32 u8OutputFormat); -static BOOL jpegPollInt(UINT32 u32Intflag); -static VOID jpegEncodeTrigger(void); -static VOID jpegDecodeTrigger(void); -static VOID jpegGetDecodedDimension( - PUINT16 pu16Height, //Decode/Encode Height - PUINT16 pu16Width //Decode/Encode Width -); -static VOID jpegSetDimension( - UINT16 u16Height, //Decode/Encode Height - UINT16 u16Width //Decode/Encode Width -); -static VOID jpegGetDimension( - PUINT16 pu16Height, //Decoded Height from bit stream - PUINT16 pu16Width //Decoded Width from bit stream -); -static INT jpegSetWindowDecode( - UINT16 u16StartMCUX, //Start X MCU - UINT16 u16StartMCUY, //Horizontal Scaling Factor - UINT16 u16EndMCUX, //Vertical Scaling Factor - UINT16 u16EndMCUY, //Horizontal Scaling Factor - UINT32 u32Stride //Decode Output Stride -); -static INT jpegCalScalingFactor( - UINT8 u8Mode, //Up / Down Scaling - UINT16 u16Height, //Original Height - UINT16 u16Width, //Original Width - UINT16 u16ScalingHeight, //Scaled Height - UINT16 u16ScalingWidth, //Scaled Width - PUINT16 pu16RatioH, //Horizontal Ratio - PUINT16 pu16RatioW //Vertical Ratio -); -static INT jpegSetScalingFactor( - UINT8 u8Mode, //Up / Down Scaling - UINT16 u16FactorH, //Vertical Scaling Factor - UINT16 u16FactorW //Horizontal Scaling Factor -); -static VOID jpegGetScalingFactor( - UINT8 u8Mode, //Up / Down Scaling - PUINT16 pu16FactorH, //Vertical Scaling Factor - PUINT16 pu16FactorW //Horizontal Scaling Factor -); -/// @endcond HIDDEN_SYMBOLS - -/*@}*/ /* end of group N9H30_JPEG_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#endif diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpegcodec.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpegcodec.h deleted file mode 100644 index c18e6ba9ba7..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_jpegcodec.h +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************//** -* @file jpegcodec.h -* @brief N9H30 JPEG driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_JPEGCODEC_H__ -#define __NU_JPEGCODEC_H__ - -//Include header file -#include "N9H30.h" -#include "nu_sys.h" - - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_JPEG_Driver JPEG Driver - @{ -*/ - - -/** @addtogroup N9H30_JPEG_EXPORTED_CONSTANTS JPEG Exported Constants - @{ -*/ - -#define E_FAIL 0 /*!< JPEG function Error */ -#define E_SUCCESS 1 /*!< JPEG function Success */ -#define E_JPEG_INVALID_PARAM 2 /*!< Input invalid paramater */ -#define E_JPEG_TIMEOUT 3 /*!< JPEG function Time-out */ - - -#define JPEG_ENC_PRIMARY 0 /*!< JPEG encode Primary */ -#define JPEG_ENC_THUMBNAIL 1 /*!< JPEG encode Thumbanil */ - -//Define for Encode input Format -#define JPEG_ENC_SOURCE_PLANAR 0 /*!< JPEG encode input formate is Planar */ -#define JPEG_ENC_SOURCE_PACKET 1 /*!< JPEG encode input formate is Packet */ - -//Define for Decode Output Format - -//(PLANAR_ON | PDHTAB | DHEND) -#define JPEG_DEC_PRIMARY_PLANAR_YUV 0x8021 /*!< JPEG decode output Primary Planar YUV */ -//(PDHTAB | DHEND) -#define JPEG_DEC_PRIMARY_PACKET_YUV422 0x0021 /*!< JPEG decode output Primary Packet YUV422 */ - -//(PDHTAB | DHEND | ORDER) -#define JPEG_DEC_PRIMARY_PACKET_RGB555 0x04021 /*!< JPEG decode output Primary Packet RGB555 */ -//(PDHTAB | DHEND | RGB555_565 | ORDER ) -#define JPEG_DEC_PRIMARY_PACKET_RGB565 0x06021 /*!< JPEG decode output Primary Packet RGB565 */ - -//(PDHTAB | DHEND | ORDER) -#define JPEG_DEC_PRIMARY_PACKET_RGB555R1 0x404021 /*!< JPEG decode output Primary Packet RGB555R1 */ -//(PDHTAB | DHEND | RGB555_565 | ORDER ) -#define JPEG_DEC_PRIMARY_PACKET_RGB565R1 0x406021 /*!< JPEG decode output Primary Packet RGB565R1 */ - -#define JPEG_DEC_PRIMARY_PACKET_RGB565R2 0x806021 /*!< JPEG decode output Primary Packet RGB565R2 */ -//(PDHTAB | DHEND | ORDER) -#define JPEG_DEC_PRIMARY_PACKET_RGB555R2 0x804021 /*!< JPEG decode output Primary Packet RGB555R2 */ - -//(PDHTAB | DHEND | RGB555_565 | ORDER ) -#define JPEG_DEC_PRIMARY_PACKET_RGB888 0x14021 /*!< JPEG decode Primary Packet RGB888 */ -//(PLANAR_ON | DTHB | PDHTAB) -#define JPEG_DEC_THUMBNAIL_PLANAR_YUV 0x8031 /*!< JPEG decode Thumbnail Planar YUV */ -//(DTHB | PDHTAB | DHEND) -#define JPEG_DEC_THUMBNAIL_PACKET_YUV422 0x0031 /*!< JPEG decode Thumbnail Packet YUV422 */ -//(DTHB | PDHTAB | DHEND | ORDER) -#define JPEG_DEC_THUMBNAIL_PACKET_RGB555 0x4031 /*!< JPEG decode Thumbnail Packet RGB555 */ - -//Define for Encode Image Format -#define JPEG_ENC_PRIMARY_YUV420 0xA0 /*!< JPEG encode Primary YUV420 */ -#define JPEG_ENC_PRIMARY_YUV422 0xA8 /*!< JPEG encode Primary YUV422 */ -#define JPEG_ENC_PRIMARY_GRAY 0xA1 /*!< JPEG encode Primary Gray */ -#define JPEG_ENC_THUMBNAIL_YUV420 0x90 /*!< JPEG encode Thumbnail YUV420 */ -#define JPEG_ENC_THUMBNAIL_YUV422 0x98 /*!< JPEG encode Thumbnail YUV422 */ -#define JPEG_ENC_THUMBNAIL_GRAY 0x91 /*!< JPEG encode Thumbnail Gray */ - -//Define for Decode Image Format -#define JPEG_DEC_YUV420 0x000 /*!< JPEG decode image formatr is YUV420 */ -#define JPEG_DEC_YUV422 0x100 /*!< JPEG decode image formatr is YUV422 */ -#define JPEG_DEC_YUV444 0x200 /*!< JPEG decode image formatr is YUV444 */ -#define JPEG_DEC_YUV411 0x300 /*!< JPEG decode image formatr is YUV411 */ -#define JPEG_DEC_GRAY 0x400 /*!< JPEG decode image formatr is Gray */ -#define JPEG_DEC_YUV422T 0x500 /*!< JPEG decode image formatr is YUV422T */ - -//Define for Encode Image Header -/*P_DRI*/ -#define JPEG_ENC_PRIMARY_DRI 0x10 /*!< JPEG encode image header Primary DRI */ -/*P_QTAB*/ -#define JPEG_ENC_PRIMARY_QTAB 0x20 /*!< JPEG encode image header Primary Q Table */ -/*P_HTAB*/ -#define JPEG_ENC_PRIMARY_HTAB 0x40 /*!< JPEG encode image header Primary H Table */ -/*P_JFIF*/ -#define JPEG_ENC_PRIMARY_JFIF 0x80 /*!< JPEG encode image header Primary JFIF */ -/*T_DRI*/ -#define JPEG_ENC_THUMBNAIL_DRI 0x1 /*!< JPEG encode image header Thumbnail DRI */ -/*T_QTAB*/ -#define JPEG_ENC_THUMBNAIL_QTAB 0x2 /*!< JPEG encode image header Thumbnail Q Table */ -/*T_HTAB*/ -#define JPEG_ENC_THUMBNAIL_HTAB 0x4 /*!< JPEG encode image header Thumbnail H Table */ -/*T_JFIF*/ -#define JPEG_ENC_THUMBNAIL_JFIF 0x8 /*!< JPEG encode image header Thumbnail JFIF */ - - -#define JPEG_IOCTL_SET_YADDR 0 /*!< Set Y Component Frame Buffer-0 Starting Address Register */ -#define JPEG_IOCTL_SET_YSTRIDE 1 /*!< Set Y Component Frame Buffer Stride Register */ -#define JPEG_IOCTL_SET_USTRIDE 2 /*!< Set U Component Frame Buffer Stride Register */ -#define JPEG_IOCTL_SET_VSTRIDE 3 /*!< Set V Component Frame Buffer Stride Register */ -#define JPEG_IOCTL_SET_BITSTREAM_ADDR 4 /*!< Set Bit-stream Frame Buffer-0 Starting Address Register */ -#define JPEG_IOCTL_SET_SOURCE_IMAGE_HEIGHT 5 /*!< Set JPEG Bit-stream FIFO Control Register */ -#define JPEG_IOCTL_ENC_SET_HEADER_CONTROL 6 /*!< Set JPEG Encode Header Control Register */ -#define JPEG_IOCTL_SET_DEFAULT_QTAB 7 /*!< Set Default Q Table */ -#define JPEG_IOCTL_SET_DECODE_MODE 8 /*!< Set Decode Mode */ -#define JPEG_IOCTL_SET_ENCODE_MODE 9 /*!< Set Encode Mode */ -#define JPEG_IOCTL_SET_DIMENSION 10 /*!< Set Encode Primary Width/Height */ -#define JPEG_IOCTL_ENCODE_TRIGGER 11 /*!< Encode Trigger */ -#define JPEG_IOCTL_DECODE_TRIGGER 12 /*!< Decode Trigger */ -#define JPEG_IOCTL_WINDOW_DECODE 13 /*!< Window Decode Setting */ -#define JPEG_IOCTL_SET_DECODE_STRIDE 14 /*!< Set Decode Stride */ -#define JPEG_IOCTL_SET_DECODE_DOWNSCALE 15 /*!< Set Decode Downscale */ -#define JPEG_IOCTL_SET_ENCODE_UPSCALE 16 /*!< Set Encode Upscale */ -#define JPEG_IOCTL_SET_HEADERDECODE_CALBACKFUN 17 /*!< Set Header decode call back function */ -#define JPEG_IOCTL_SET_DECINPUTWAIT_CALBACKFUN 18 /*!< Set Decode Input Wait call back function */ -#define JPEG_IOCTL_ADJUST_QTAB 19 /*!< Set Primary or Thumbnail Q Table */ -#define JPEG_IOCTL_ENC_RESERVED_FOR_SOFTWARE 20 /*!< Set Encode Reserved Size */ -#define JPEG_IOCTL_SET_UADDR 21 /*!< Set U Component Frame Buffer-0 Starting Address Register */ -#define JPEG_IOCTL_SET_VADDR 22 /*!< Set V Component Frame Buffer-0 Starting Address Register */ -#define JPEG_IOCTL_SET_ENCODE_PRIMARY_RESTART_INTERVAL 23 /*!< Set Encode Primary restart interval */ -#define JPEG_IOCTL_SET_ENCODE_THUMBNAIL_RESTART_INTERVAL 24 /*!< Set Encode Thumbnail restart interval */ -#define JPEG_IOCTL_GET_ENCODE_PRIMARY_RESTART_INTERVAL 25 /*!< Get Encode Primary restart interval */ -#define JPEG_IOCTL_GET_ENCODE_THUMBNAIL_RESTART_INTERVAL 26 /*!< Get Encode Thumbnail restart interval */ -#define JPEG_IOCTL_SET_THUMBNAIL_DIMENSION 27 /*!< Set Encode Thumbnail Width/Height */ -#define JPEG_IOCTL_SET_ENCODE_SW_OFFSET 28 /*!< Set Offset Between Primary & Thumbnail Register */ -#define JPEG_IOCTL_GET_THUMBNAIL_DIMENSION 29 /*!< Get Thumbnail Width/Height */ -#define JPEG_IOCTL_GET_ENCODE_SW_OFFSET 30 /*!< Get Offset Between Primary & Thumbnail Register */ -#define JPEG_IOCTL_SET_ENCODE_PRIMARY_DOWNSCALE 31 /*!< Set Enciode Primary Downscale */ -#define JPEG_IOCTL_SET_ENCODE_THUMBNAIL_DOWNSCALE 32 /*!< Set Encode Thumbnail Downscale */ -#define JPEG_IOCTL_SET_ENCODE_PRIMARY_ROTATE_RIGHT 33 /*!< Set Encode Primary rotate right */ -#define JPEG_IOCTL_SET_ENCODE_PRIMARY_ROTATE_LEFT 34 /*!< Set Encode Primary rotate left */ -#define JPEG_IOCTL_SET_ENCODE_PRIMARY_ROTATE_NORMAL 35 /*!< Set Encode Primary rotate normal */ -#define JPEG_IOCTL_SET_DECOUTPUTWAIT_CALBACKFUN 36 /*!< Set Decode Output wait call back function */ -#define JPEG_IOCTL_SET_DECOUTPUTWAIT 37 /*!< Set Decode Output wait */ -#define JPEG_IOCTL_GET_DECOUTPUTWAIT_ADDR 38 /*!< Get Decode Output wait address */ -#define JPEG_IOCTL_GET_DECOUTPUTWAIT_SIZE 39 /*!< Get Decode Output wait size */ -#define JPEG_IOCTL_SET_DECODE_COMPLETE_CALBACKFUN 40 /*!< Set Decode complete call back function */ -#define JPEG_IOCTL_SET_ENCODE_COMPLETE_CALBACKFUN 41 /*!< Set Encode complete call back function */ -#define JPEG_IOCTL_SET_DECODE_ERROR_CALBACKFUN 42 /*!< Set Decode Error call back function */ - -typedef BOOL (*PFN_JPEG_HEADERDECODE_CALLBACK)(void); /*!< JPEG Header decode call back function */ -typedef BOOL (*PFN_JPEG_CALLBACK)(void); /*!< JPEG call back function */ -typedef BOOL (*PFN_JPEG_DECWAIT_CALLBACK)(UINT32 u32Address, UINT32 u32Size); /*!< JPEG decode wait call back function */ - -/** \brief Structure type of JPEG encode/decode information - */ -typedef struct -{ - /*decode information*/ - UINT32 yuvformat; /*!< JPEG YUV Format for decode*/ - UINT32 width; /*!< Image Width */ - UINT32 height; /*!< Image High */ - UINT32 jpeg_width; /*!< JPEG decode width*/ - UINT32 jpeg_height; /*!< JPEG decode high*/ - UINT32 stride; /*!< Stride for decode*/ - /*encode information*/ - UINT32 bufferend; /*!< Encode buffer */ - UINT32 image_size[2]; /*!< Image size after encoded*/ -} JPEG_INFO_T; - -/** \brief Structure type of JPEG Window Decode information - */ -typedef struct -{ - UINT16 u16StartMCUX; /*!< Start X MCU */ - UINT16 u16StartMCUY; /*!< Horizontal Scaling Factor */ - UINT16 u16EndMCUX; /*!< Vertical Scaling Factor */ - UINT16 u16EndMCUY; /*!< Horizontal Scaling Factor */ - UINT32 u32Stride; /*!< Decode Output Stride */ -} JPEG_WINDOW_DECODE_T; - -struct nu_jpeg_ioctl -{ - UINT32 arg0; - UINT32 arg1; -}; -typedef struct nu_jpeg_ioctl *nu_jpeg_ioctl_t; - -struct nu_jpeg_qtab -{ - PUINT8 puQTable0; - PUINT8 puQTable1; - PUINT8 puQTable2; - UINT8 u8num; -}; -typedef struct nu_jpeg_qtab *nu_jpeg_qtab_t; - -/*@}*/ /* end of group N9H30_JPEG_EXPORTED_CONSTANTS */ - - -/** @addtogroup N9H30_JPEG_EXPORTED_FUNCTIONS JPEG Exported Functions - @{ -*/ -#define JPEG_IOCTL_SET_QTAB 64 /*!< Set User-defined Q Table */ -#define JPEG_IOCTL_INITIAL_CODEC 65 /*!< Reset Initial internal variables */ -#define JPEG_IOCTL_GET_INFO 66 /*!< Set Decode Error call back function */ -#define JPEG_IOCTL_IS_READY 67 /*!< Check JPEG codec is ready or not */ -#define JPEG_IOCTL_WAITDONE 68 /*!< Wait JPEG action done. */ - -INT jpegSetQTAB(PUINT8 puQTable0, PUINT8 puQTable1, PUINT8 puQTable2, UINT8 u8num); -INT jpegOpen(void); -VOID jpegClose(void); -VOID jpegInit(void); -VOID jpegGetInfo(JPEG_INFO_T *info); -BOOL jpegIsReady(void); -INT jpegWait(void); -VOID jpegIoctl(UINT32 cmd, UINT32 arg0, UINT32 arg1); - -/*@}*/ /* end of group N9H30_JPEG_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_JPEG_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#endif diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_lcd.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_lcd.h deleted file mode 100644 index 69b7c747a8b..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_lcd.h +++ /dev/null @@ -1,310 +0,0 @@ -/**************************************************************************//** -* @file lcd.h -* @version V1.00 -* @brief N9H30 LCD driver header file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_LCD_H__ -#define __NU_LCD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_LCD_Driver LCD Driver - @{ -*/ - -/** @addtogroup N9H30_LCD_EXPORTED_CONSTANTS LCD Exported Constants - @{ -*/ -/// @cond HIDDEN_SYMBOLS - -/* bit definition of REG_LCM_DCCS register */ -#define VPOSTB_HC_EN ((UINT32)1<<31) -#define VPOSTB_DISP_ON (1<<25) -#define VPOSTB_ITUEN (1<<15) -#define VPOSTB_OSD_SRC_YUV422 (0<<12) -#define VPOSTB_OSD_SRC_YCBCR422 (1<<12) -#define VPOSTB_OSD_SRC_RGB888 (2<<12) -#define VPOSTB_OSD_SRC_RGB666 (3<<12) -#define VPOSTB_OSD_SRC_RGB565 (4<<12) -#define VPOSTB_OSD_SRC_RGB444_LOW (5<<12) -#define VPOSTB_OSD_SRC_RGB444_HIGH (7<<12) -#define VPOSTB_VA_SRC_YUV422 (0<<8 ) -#define VPOSTB_VA_SRC_YCBCR422 (1<<8 ) -#define VPOSTB_VA_SRC_RGB888 (2<<8 ) -#define VPOSTB_VA_SRC_RGB666 (3<<8 ) -#define VPOSTB_VA_SRC_RGB565 (4<<8 ) -#define VPOSTB_VA_SRC_RGB444_LOW (5<<8 ) -#define VPOSTB_VA_SRC_RGB444_HIGH (7<<8 ) -#define VPOSTB_SINGLE (1<<7 ) -#define VPOSTB_FIELD_INTR (1<<6 ) -#define VPOSTB_CMD_ON (1<<5 ) -#define VPOSTB_DISP_INT_EN (1<<4 ) -#define VPOSTB_DISP_OUT_EN (1<<3 ) -#define VPOSTB_OSD_EN (1<<2 ) -#define VPOSTB_VA_EN (1<<1 ) -#define VPOSTB_ENG_RST (1) - - -/* bit definition of REG_LCM_DEV_CTRL register */ -#define VPOSTB_CMDHIGH (0) -#define VPOSTB_CMDLOW ((UINT32)1<<31) -#define VPOSTB_CM16t18LOW (0) -#define VPOSTB_CM16t18HIGH ((UINT32)1<<30) -#define VPOSTB_CMD8 (0) -#define VPOSTB_CMD16 ((UINT32)1<<29) -#define VPOSTB_IM256K_9or18 (0) -#define VPOSTB_IM256K_8or16 ((UINT32)1<<28) -#define VPOSTB_MPU80 (0) -#define VPOSTB_MPU68 (1<<27) -#define VPOSTB_DATA8or9 (0) -#define VPOSTB_DATA16or18 (1<<26) -#define VPOSTB_COLORTYPE_4K (0) -#define VPOSTB_COLORTYPE_64K (1<<24) -#define VPOSTB_COLORTYPE_256K (2<<24) -#define VPOSTB_COLORTYPE_16M (3<<24) -#define VPOSTB_LACE (1<<23) -#define VPOSTB_VR_LACE (1<<22) -#define VPOSTB_V_POL (1<<21) -#define VPOSTB_H_POL (1<<20) -#define VPOSTB_FAL_D (1<<19) -#define VPOSTB_YUV2CCIR (1<<16) -#define VPOSTB_DEVICE_SYNC_YUV422 (0) -#define VPOSTB_DEVICE_SYNC_UNIPAC (4<<5) -#define VPOSTB_DEVICE_SYNC_EPSON (5<<5) -#define VPOSTB_DEVICE_SYNC_HIGHCOLOR (6<<5) -#define VPOSTB_DEVICE_MPU (7<<5) -#define VPOSTB_SWAP_YUYV (1<<1) - -/* bit definition of REG_LCM_INT_CS register */ -#define VPOSTB_DISP_F_INT ((UINT32)1<<31) -#define VPOSTB_DISP_F_STATUS (1<<30) -#define VPOSTB_UNDERRUN_INT (1<<29) -#define VPOSTB_BUS_ERROR_INT (1<<28) -#define VPOSTB_FLY_ERR (1<<27) -#define VPOSTB_UNDERRUN_EN (1<<1) -#define VPOSTB_DISP_F_EN (1) - -/* bit definition of REG_LCM_VA_FBCTRL register */ -#define VPOSTB_DB_EN ((UINT32)1<<31) -#define VPOSTB_FLY_EN (1<<12) - -/* bit definition of REG_LCM_OSD_OVERLAY register */ -#define VPOSTB_BLI_ON (1<<9) -#define VPOSTB_CKEY_ON (1<<8) - -#define DISPLAY_VIDEO (0) -#define DISPLAY_OSD (1) -#define DISPLAY_SYNTHESIZED (2) - -/// @endcond HIDDEN_SYMBOLS - -#define VA_SRC_YUV422 (0<<8 ) /*!< YUV422 format */ -#define VA_SRC_YCBCR422 (1<<8 ) /*!< YCBCR422 format */ -#define VA_SRC_RGB888 (2<<8 ) /*!< RGB888 format */ -#define VA_SRC_RGB666 (3<<8 ) /*!< RGB666 format */ -#define VA_SRC_RGB565 (4<<8 ) /*!< RGB565 format */ -#define VA_SRC_RGB444_LOW (5<<8 ) /*!< RGB444 low nibble format */ -#define VA_SRC_RGB444_HIGH (7<<8 ) /*!< RGB444 high nibble format */ - -#define OSD_SRC_YUV422 (0<<12) /*!< YUV422 format */ -#define OSD_SRC_YCBCR422 (1<<12) /*!< YCBCR422 format */ -#define OSD_SRC_RGB888 (2<<12) /*!< RGB888 format */ -#define OSD_SRC_RGB666 (3<<12) /*!< RGB666 format */ -#define OSD_SRC_RGB565 (4<<12) /*!< RGB565 format */ -#define OSD_SRC_RGB444_LOW (5<<12) /*!< RGB444 low nibble format */ -#define OSD_SRC_RGB444_HIGH (7<<12) /*!< RGB444 high nibble format */ -#define OSD_SRC_RGB332 (6<<12) /*!< RGB332 format */ - -#define VPOST_DISPLAY_SINGLE 1 /*!< Single display mode */ -#define VPOST_DISPLAY_CONTINUOUS 0 /*!< Continuous display mode */ - -#define VPOSTB_OSD_VUP_1X (0<<16) /*!< OSD vertical scale up 1x */ -#define VPOSTB_OSD_VUP_2X (1<<16) /*!< OSD vertical scale up 2x */ -#define VPOSTB_OSD_VUP_4X (2<<16) /*!< OSD vertical scale up 4x */ - -#define DISPLAY_VIDEO (0) /*!< Display video data */ -#define DISPLAY_OSD (1) /*!< Display OSD data */ -#define DISPLAY_SYNTHESIZED (2) /*!< Display synthesized data */ - -#define VA_SCALE_INTERPOLATION (0) /*!< Scale mode is interpolation */ -#define VA_SCALE_DUPLICATION (1<<15) /*!< Scale mode is duplication */ - -#pragma anon_unions - -typedef enum va_hcmode_e -{ - HC_MODE0, /*!< 32X32X2bpp 4 color */ - HC_MODE1, /*!< 32X32X2bpp 3 color and 1 transparent */ - HC_MODE2, /*!< 64X64X2bpp 4 color */ - HC_MODE3, /*!< 64X64X2bpp 3 color and 1 transparent */ - HC_MODE4, /*!< 128X128X1bpp 2 color */ - HC_MODE5 /*!< 128X128X1bpp 1 color and 1 transparent */ -} VA_HCMODE_E; - -typedef struct -{ - uint32_t ucVASrcFormat; /*!< User input Display source format */ - uint32_t nScreenWidth; /*!< Driver output,LCD width */ - uint32_t nScreenHeight; /*!< Driver output,LCD height */ - uint32_t nFrameBufferSize; /*!< Driver output,Frame buffer size(malloc by driver) */ - uint8_t ucROT90; /*!< Rotate 90 degree or not */ -} LCDFORMATEX; - -typedef struct -{ - uint32_t ucOSDSrcFormat; /*!< User input, OSD source format */ - uint32_t nXstart; /*!< User input, OSD X axis position */ - uint32_t nYstart; /*!< User input, OSD Y axis position */ - uint32_t nOSDWidth; /*!< User input, OSD width */ - uint32_t nOSDHeight; /*!< User input, OSD height */ - uint32_t nImageWidth; /*!< User input, The width of OSD source image width */ - uint32_t *pFrameBuffer; /*!< User input, The address of OSD source image */ -} OSDFORMATEX; - -enum DIS_PANEL -{ - DIS_PANEL_E50A2V1 = 0, - DIS_PANEL_ILI9341_MPU80, - DIS_LSA40AT9001, - DIS_PANEL_FW070TFT, - DIS_PANEL_FW043TFT, - DIS_PANEL_FW070TFT_WSVGA, - DIS_PANEL_CNT -}; - -typedef struct -{ - uint32_t u32DevWidth; /*!< Panel width */ - uint32_t u32DevHeight; /*!< Panel height */ - uint32_t u32CmdLow; /*!< MPU command line low indicator */ - uint32_t u32Cmd16t18; /*!< MPU command width */ - uint32_t u32CmdBusWidth; /*!< MPU bus width */ - uint32_t u32DataBusWidth; /*!< Display bus width */ - uint32_t u32MPU_Mode; /*!< MPU mode */ - uint32_t u32DisplayColors; /*!< Display colors */ - uint32_t u32DevType; /*!< Type of display panel */ - union - { - uint32_t u32Reg_CRTCSIZE; /*!< CRTCSIZE register value */ - struct - { - uint32_t HTT: 11; /*!< Horizontal Total Pixels */ - uint32_t : 5; - uint32_t VTT: 11; /*!< Vertical Total Scan Lines */ - uint32_t : 5; - } sCRTCSIZE; - }; - union - { - uint32_t u32Reg_CRTCDEND; /*!< CRTCDEND register value */ - struct - { - uint32_t HDEND: 11; /*!< Horizontal Display Enable End */ - uint32_t : 5; - uint32_t VDEND: 11; /*!< Vertical Display Enable End */ - uint32_t : 5; - } sCRTCDEND; - }; - union - { - uint32_t u32Reg_CRTCHR; /*!< CRTCHR register value */ - struct - { - uint32_t HRS: 11; /*!< Internal Horizontal Retrace Start Timing */ - uint32_t : 5; - uint32_t HRE: 11; /*!< Internal Horizontal Retrace End Low */ - uint32_t : 5; - } sCRTCHR; - }; - union - { - uint32_t u32Reg_CRTCHSYNC; /*!< CRTCHSYNC register value */ - struct - { - uint32_t HSYNC_S: 11; /*!< Horizontal Sync Start Timing */ - uint32_t : 5; - uint32_t HSYNC_E: 11; /*!< Horizontal Sync End Timing */ - uint32_t : 3; - uint32_t HSYNC_SHIFT: 2; /*!< Hsync Signal Adjustment For Multi-Cycles Per Pixel Mode Of Sync-Based Unipac-LCD */ - } sCRTCHSYNC; - }; - union - { - uint32_t u32Reg_CRTCVR; /*!< CRTCVR register value */ - struct - { - uint32_t VRS: 11; /*!< Vertical Internal Retrace Start Timing */ - uint32_t : 5; - uint32_t VRE: 11; /*!< Vertical Internal Retrace End Low */ - uint32_t : 5; - } sCRTCVR; - }; -} VPOST_T; - -#define LCM_ERR_ID 0xFFFF0400 /*!< LCM library ID */ - -/* error code */ -#define ERR_NULL_BUF (LCM_ERR_ID | 0x04) /*!< error memory location */ -#define ERR_NO_DEVICE (LCM_ERR_ID | 0x05) /*!< error no device */ -#define ERR_BAD_PARAMETER (LCM_ERR_ID | 0x06) /*!< error for bad parameter */ -#define ERR_POWER_STATE (LCM_ERR_ID | 0x07) /*!< error power state control */ -/*@}*/ /* end of group N9H30_LCD_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_LCD_EXPORTED_FUNCTIONS LCD Exported Functions - @{ -*/ - -void vpostLCMInit(uint32_t u32DisplayPanelID); -uint8_t *vpostGetFrameBuffer(void); -uint8_t *vpostGetMultiFrameBuffer(uint32_t u32Cnt); -void vpostLCMDeinit(void); -void vpostSetDisplayMode(uint8_t u8DisplayMode); -void vpostSetVASrc(uint32_t u32VASrcType); -void vpostVAStartTrigger(void); -void vpostVAStopTrigger(void); -void vpostVAScalingCtrl(uint8_t u8HIntegral, uint16_t u16HDecimal, uint8_t u8VIntegral, uint16_t u16VDecimal, uint32_t u32Mode); - -void vpostOSDSetColKey(uint8_t u8CKeyColorR, uint8_t u8CKeyColorG, uint8_t u8CKeyColorB); -void vpostOSDSetColMask(uint8_t u8MaskColorR, uint8_t u8MaskColorG, uint8_t u8MaskColorB); -void vpostOSDSetBlinking(uint8_t u8OSDBlinkVcnt); -void vpostOSDDisableBlinking(void); -void vpostSetOSDSrc(uint32_t u32OSDSrcType); -uint8_t *vpostGetOSDBuffer(void); -void vpostOSDEnable(void); -void vpostOSDDisable(void); -void vpostOSDScalingCtrl(uint8_t u8HIntegral, uint16_t u16HDecimal, uint8_t u8VScall); -void vpostOSDSetWindow(uint32_t u32XStart, uint32_t u32YStart, uint32_t u32Width, uint32_t u32Height); -void vpostHCInit(uint32_t *u32CursorBMPBuff, VA_HCMODE_E ucMode); -void vpostHCPosCtrl(uint32_t u32CursorX, uint32_t u32CursorY); -void vpostOSDSetOverlay(uint8_t u8OSDDisplayMatch, uint8_t u8OSDDisplayUnMatch, uint8_t u8OSDSynW); -void vpostMPUWriteAddr(uint16_t uscmd); -void vpostMPUWriteData(uint16_t usdata); -uint32_t vpostMPUReadData(void); -VPOST_T *vpostLCMGetInstance(uint32_t u32DisplayPanelID); -void vpostSetFrameBuffer(uint8_t *pu8BufPtr); -void vpostSetOSDBuffer(uint8_t *pu8BufPtr); -uint8_t *vpostGetMultiOSDBuffer(uint32_t u32Cnt); - -/*@}*/ /* end of group N9H30_LCD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_LCD_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_LCD_H__ - - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_pwm.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_pwm.h deleted file mode 100644 index 4282d5099ca..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_pwm.h +++ /dev/null @@ -1,238 +0,0 @@ -/**************************************************************************//** - * @file pwm.h - * @brief N9H30 series PWM driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PWM_H__ -#define __NU_PWM_H__ -#include "N9H30.h" -#include "nu_sys.h" -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_PWM_Driver PWM Driver - @{ -*/ - -/** @addtogroup N9H30_PWM_EXPORTED_CONSTANTS PWM Exported Constants - @{ -*/ - -#define PWM_OFFSET 0xc ///< each channel has 3 control registers which occupies 12 bytes - -// Timer channel identity information -#define PWM_TIMER_NUM 4 ///< Total PWM channel count -#define PWM_TIMER_MIN 0 ///< Min PWM channel number -#define PWM_TIMER_MAX 3 ///< Max PWM channel number -#define PWM_TIMER0 0 ///< PWM channel 0 -#define PWM_TIMER1 1 ///< PWM channel 1 -#define PWM_TIMER2 2 ///< PWM channel 2 -#define PWM_TIMER3 3 ///< PWM channel 3 - -//ioctl command -#define START_PWMTIMER 0 ///< Start PWM ioctl command -#define STOP_PWMTIMER 1 ///< Stop PWM ioctl command -#define SET_CSR 2 ///< Set CSR ioctl command -#define SET_CP 3 ///< Set CP ioctl command -#define SET_DZI 4 ///< Set dead zone ioctl command -#define SET_INVERTER 5 ///< Set inverter ioctl command -#define SET_MODE 6 ///< Set OP mode ioctl command -#define ENABLE_DZ_GENERATOR 7 ///< Enable dead zone ioctl command -#define DISABLE_DZ_GENERATOR 8 ///< Disable dead zone ioctl command -#define ENABLE_PWMGPIOOUTPUT 9 ///< Enable PWM output ioctl command - -#define PWM_STOP_METHOD1 1 ///< PWM stop method 1 -#define PWM_STOP_METHOD2 2 ///< PWM stop method 2 -//#define PWM_STOP_METHOD3 3 not recommended - -//Timer default value -#define DEFAULT_CSR CSRD16 ///< Default CSR value -#define DEFAULT_CP 255 ///< Default CP value -#define DEFAULT_DZI 50 ///< Default DZI value -#define DEFAULT_CNR 19531 ///< Default CNR value -#define DEFAULT_CMR (19531/4) ///< Default CMR value -#define DEFAULT_MODE PWM_TOGGLE ///< Default OP mode - -// for PWM_PPR -#define DZI_MIN 0 ///< Min DZI value -#define DZI_MAX 255 ///< Max DZI value -#define CP_MIN 0 ///< Min CP value -#define CP_MAX 255 ///< Max CP value - -// for PWM_CSR -#define CSR_MIN 0 ///< Min CSR value -#define CSR_MAX 4 ///< Mac SCR value -#define CSRD2 0x0 ///< Div by 2 -#define CSRD4 0x1 ///< Div by 4 -#define CSRD8 0x2 ///< Div by 8 -#define CSRD16 0x3 ///< Div by 16 -#define CSRD1 0x4 ///< Div by 1 - -// for PWM_PCR -#define PWMDZG_ENABLE 1 ///< Enable PWM dead zone -#define PWMDZG_DISABLE 0 ///< Disable PWM dead zone -#define PWM_ENABLE 1 ///< Enable PWM channel -#define PWM_DISABLE 0 ///< Disable PWM channel -#define PWM_TOGGLE 1 ///< PWM toggle mode -#define PWM_ONESHOT 0 ///< PWM one-shot mode -#define PWM_INVON 1 ///< Enable PWM inverter -#define PWM_INVOFF 0 ///< Disable PWM inverter - -// for PWM_CNR -#define CNR_MIN 0 ///< Min CNR value -#define CNR_MAX 65535 ///< Mac CNR value - -// for PWM_CMR -#define CMR_MIN 0 ///< Min CMR value -#define CMR_MAX 65535 ///< Max CMR value - -// for pin control -#define PWM0_GPA12 0 ///< PWM0 output on GPA12 -#define PWM0_GPB2 1 ///< PWM0 output on GPB2 -#define PWM1_GPA13 4 ///< PWM1 output on GPA13 -#define PWM1_GPB3 5 ///< PWM1 output on GPB3 -#define PWM2_GPA14 7 ///< PWM2 output on GPA14 -#define PWM2_GPH2 9 ///< PWM2 output on GPH2 -#define PWM3_GPA15 10 ///< PWM3 output on GPA15 -#define PWM3_GPH3 12 ///< PWM3 output on GPH3 - -#define PWM_ERR_ID 0xFFFF1300 ///< PWM library ID - -//PWM Error code -#define pwmInvalidTimerChannel (PWM_ERR_ID|1) ///< Invalid channel number -#define pwmInvalidStructLength (PWM_ERR_ID|2) ///< Invalid structure length -#define pwmInvalidIoctlCommand (PWM_ERR_ID|3) ///< Invalid ioctl command -#define pwmInvalidStopMethod (PWM_ERR_ID|4) ///< Invalid stop mode -#define pwmInvalidCPValue (PWM_ERR_ID|5) ///< Invalid CP value -#define pwmInvalidDZIValue (PWM_ERR_ID|6) ///< Invalid DZI value -#define pwmInvalidCSRValue (PWM_ERR_ID|7) ///< Invalid CSR value -#define pwmInvalidDZGStatus (PWM_ERR_ID|8) ///< Invalid DZ status -#define pwmInvalidTimerStatus (PWM_ERR_ID|9) ///< Invalid timer status -#define pwmInvalidInverterValue (PWM_ERR_ID|10) ///< Invalid inverter value -#define pwmInvalidModeStatus (PWM_ERR_ID|11) ///< Invalid OP mode -#define pwmInvalidCNRValue (PWM_ERR_ID|12) ///< Invalid CNR value -#define pwmInvalidCMRValue (PWM_ERR_ID|13) ///< Invalid CMR value -#define pwmTimerNotOpen (PWM_ERR_ID|14) ///< PWM channel not stop -#define pwmTimerBusy (PWM_ERR_ID|15) ///< PWM channel is busy -#define pwmInvalidPin (PWM_ERR_ID|16) ///< Invalid PWM output pin - -/*@}*/ /* end of group N9H30_PWM_EXPORTED_CONSTANTS */ - -/// @cond HIDDEN_SYMBOLS -/** @addtogroup N9H30_PWM_EXPORTED_STRUCTS PWM Exported Structs - @{ -*/ - -typedef union -{ - UINT value; - struct - { - UINT cp0: 8, cp1: 8, dzi0: 8, dzi1: 8; - } field; -} typePPR; - -typedef union -{ - UINT value; - struct - { - UINT csr0: 3, _reserved3: 1, - csr1: 3, _reserved7: 1, - csr2: 3, _reserved11: 1, - csr3: 3, _reserved15: 1, - _reserved16_31: 16; - } field; -} typeCSR; - -typedef union -{ - UINT value; - struct - { - UINT ch0_en: 1, _reserved1: 1, ch0_inverter: 1, ch0_mode: 1, - grpup0_dzen: 1, grpup1_dzen: 1, - _reserved6_7: 2, - ch1_en: 1, _reserved9: 1, ch1_inverter: 1, ch1_mode: 1, - ch2_en: 1, _reserved13: 1, ch2_inverter: 1, ch2_mode: 1, - ch3_en: 1, _reserved17: 1, ch3_inverter: 1, ch3_mode: 1, - _reserved20_31: 12; - } field; -} typePCR; - -typedef union -{ - UINT value; - struct - { - UINT cnr: 16, _reserved16_31: 16; - } field; -} typeCNR; - -typedef union -{ - UINT value; - struct - { - UINT cmr: 16, _reserved16_31: 16; - } field; -} typeCMR; - -// for write operation -typedef union -{ - UINT value; - struct - { - UINT cnr: 16, cmr: 16; - } field; -} typePWMVALUE; - -// for read operation -typedef struct -{ - UINT volatile PDR; - BOOL volatile InterruptFlag; - BOOL _reversed0; - BOOL _reversed1; - BOOL _reversed2; -} typePWMSTATUS; - -/*@}*/ /* end of group N9H30_PWM_EXPORTED_STRUCTS */ -/// @endcond /* HIDDEN_SYMBOLS */ - -/** @addtogroup N9H30_PWM_EXPORTED_FUNCTIONS PWM Exported Functions - @{ -*/ - -// function definition -INT pwmInit(void); -INT pwmExit(void); -INT pwmOpen(const INT nTimerIdentity); -INT pwmClose(const INT nTimerIdentity); -INT pwmRead(const INT nTimerIdentity, PUCHAR pucStatusValue, const UINT uLength); -INT pwmWrite(const INT nTimerIdentity, PUCHAR pucCNRCMRValue, const UINT uLength); -INT pwmIoctl(const INT nTimerIdentity, const UINT uCommand, const UINT uIndication, UINT uValue); - -/*@}*/ /* end of group N9H30_PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_PWM_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_PWM_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_rtc.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_rtc.h deleted file mode 100644 index 6deb571d156..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_rtc.h +++ /dev/null @@ -1,508 +0,0 @@ -/**************************************************************************//** -* @file RTC.h -* @brief N9H30 RTC driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_RTC_H__ -#define __NU_RTC_H__ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Includes of system headers */ -/*---------------------------------------------------------------------------------------------------------*/ -#include "N9H30.h" -#include "nu_sys.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup N9H30_RTC_EXPORTED_CONSTANTS RTC Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define Error Code */ -/*---------------------------------------------------------------------------------------------------------*/ -#define E_RTC_SUCCESS 0 /*!< success */ -#define E_RTC_ERR_CALENDAR_VALUE 1 /*!< Wrong Calendar Value */ -#define E_RTC_ERR_TIMESACLE_VALUE 2 /*!< Wrong Time Scale Value */ -#define E_RTC_ERR_TIME_VALUE 3 /*!< Wrong Time Value */ -#define E_RTC_ERR_DWR_VALUE 4 /*!< Wrong Day Value */ -#define E_RTC_ERR_FCR_VALUE 5 /*!< Wrong Compenation value */ -#define E_RTC_ERR_EIO 6 /*!< Initial RTC Failed */ -#define E_RTC_ERR_ENOTTY 7 /*!< Command not support, or parameter incorrect */ -#define E_RTC_ERR_ENODEV 8 /*!< Interface number incorrect */ - -#define RTC_FCR_REFERENCE 32761 /*!< RTC Reference for frequency compensation */ - -#define RTC_INIT_KEY 0xa5eb1357 /*!< RTC Access Key \hideinitializer */ -#define RTC_WRITE_KEY 0xa965 /*!< RTC Access Key \hideinitializer */ - -#define RTC_WAIT_COUNT 0xFFFFFFFF /*!< Initial Time Out Value \hideinitializer */ - -#define RTC_YEAR2000 2000 /*!< RTC Reference \hideinitializer */ - -#define RTC_LEAP_YEAR 1 /*!< RTC leap year \hideinitializer */ - -#define RTC_CLOCK_12 0 /*!< RTC 12 Hour */ -#define RTC_CLOCK_24 1 /*!< RTC 24 Hour */ - -#define RTC_AM 1 /*!< RTC AM \hideinitializer */ -#define RTC_PM 2 /*!< RTC PM \hideinitializer */ - -#define RTC_INIT_ACTIVE_Pos (0) /*!< RTC INIT: ACTIVE Position */ -#define RTC_INIT_ACTIVE_Msk (0x1ul << RTC_INIT_ACTIVE_Pos) /*!< RTC INIT: ACTIVE Mask */ - -#define RTC_INIT_INIT_Pos (0) /*!< RTC INIT: INIT Position */ -#define RTC_INIT_INIT_Msk (0xfffffffful << RTC_INIT_INIT_Pos) /*!< RTC INIT: INIT Mask */ - -#define RTC_RWEN_RWENPASSWD_Pos (0) /*!< RTC RWEN: RWEN Position */ -#define RTC_RWEN_RWENPASSWD_Msk (0xfffful << RTC_RWEN_RWEN_Pos) /*!< RTC RWEN: RWEN Mask */ - -#define RTC_RWEN_RWENF_Pos (16) /*!< RTC RWEN: RWENF Position */ -#define RTC_RWEN_RWENF_Msk (0x1ul << RTC_RWEN_RWENF_Pos) /*!< RTC RWEN: RWENF Mask */ - -#define RTC_FREQADJ_FRACTION_Pos (0) /*!< RTC FREQADJ: FRACTION Position */ -#define RTC_FREQADJ_FRACTION_Msk (0x3ful << RTC_FREQADJ_FRACTION_Pos) /*!< RTC FREQADJ: FRACTION Mask */ - -#define RTC_FREQADJ_INTEGER_Pos (8) /*!< RTC FREQADJ: INTEGER Position */ -#define RTC_FREQADJ_INTEGER_Msk (0xful << RTC_FREQADJ_INTEGER_Pos) /*!< RTC FREQADJ: INTEGER Mask */ - -#define RTC_TIME_SEC_Pos (0) /*!< RTC TIME: SEC Position */ -#define RTC_TIME_SEC_Msk (0xful << RTC_TIME_SEC_Pos) /*!< RTC TIME: SEC Mask */ - -#define RTC_TIME_TENSEC_Pos (4) /*!< RTC TIME: TENSEC Position */ -#define RTC_TIME_TENSEC_Msk (0x7ul << RTC_TIME_TENSEC_Pos) /*!< RTC TIME: TENSEC Mask */ - -#define RTC_TIME_MIN_Pos (8) /*!< RTC TIME: MIN Position */ -#define RTC_TIME_MIN_Msk (0xful << RTC_TIME_MIN_Pos) /*!< RTC TIME: MIN Mask */ - -#define RTC_TIME_TENMIN_Pos (12) /*!< RTC TIME: TENMIN Position */ -#define RTC_TIME_TENMIN_Msk (0x7ul << RTC_TIME_TENMIN_Pos) /*!< RTC TIME: TENMIN Mask */ - -#define RTC_TIME_HR_Pos (16) /*!< RTC TIME: HR Position */ -#define RTC_TIME_HR_Msk (0xful << RTC_TIME_HR_Pos) /*!< RTC TIME: HR Mask */ - -#define RTC_TIME_TENHR_Pos (20) /*!< RTC TIME: TENHR Position */ -#define RTC_TIME_TENHR_Msk (0x3ul << RTC_TIME_TENHR_Pos) /*!< RTC TIME: TENHR Mask */ - -#define RTC_CAL_DAY_Pos (0) /*!< RTC CAL: DAY Position */ -#define RTC_CAL_DAY_Msk (0xful << RTC_CAL_DAY_Pos) /*!< RTC CAL: DAY Mask */ - -#define RTC_CAL_TENDAY_Pos (4) /*!< RTC CAL: TENDAY Position */ -#define RTC_CAL_TENDAY_Msk (0x3ul << RTC_CAL_TENDAY_Pos) /*!< RTC CAL: TENDAY Mask */ - -#define RTC_CAL_MON_Pos (8) /*!< RTC CAL: MON Position */ -#define RTC_CAL_MON_Msk (0xful << RTC_CAL_MON_Pos) /*!< RTC CAL: MON Mask */ - -#define RTC_CAL_TENMON_Pos (12) /*!< RTC CAL: TENMON Position */ -#define RTC_CAL_TENMON_Msk (0x1ul << RTC_CAL_TENMON_Pos) /*!< RTC CAL: TENMON Mask */ - -#define RTC_CAL_YEAR_Pos (16) /*!< RTC CAL: YEAR Position */ -#define RTC_CAL_YEAR_Msk (0xful << RTC_CAL_YEAR_Pos) /*!< RTC CAL: YEAR Mask */ - -#define RTC_CAL_TENYEAR_Pos (20) /*!< RTC CAL: TENYEAR Position */ -#define RTC_CAL_TENYEAR_Msk (0xful << RTC_CAL_TENYEAR_Pos) /*!< RTC CAL: TENYEAR Mask */ - -#define RTC_TIMEFMT_24HEN_Pos (0) /*!< RTC CLKFMT: 24HEN Position */ -#define RTC_TIMEFMT_24HEN_Msk (0x1ul << RTC_CLKFMT_24HEN_Pos) /*!< RTC CLKFMT: 24HEN Mask */ - -#define RTC_WEEKDAY_WEEKDAY_Pos (0) /*!< RTC WEEKDAY: WEEKDAY Position */ -#define RTC_WEEKDAY_WEEKDAY_Msk (0x7ul << RTC_WEEKDAY_WEEKDAY_Pos) /*!< RTC WEEKDAY: WEEKDAY Mask */ - -#define RTC_TALM_SEC_Pos (0) /*!< RTC TALM: SEC Position */ -#define RTC_TALM_SEC_Msk (0xful << RTC_TALM_SEC_Pos) /*!< RTC TALM: SEC Mask */ - -#define RTC_TALM_TENSEC_Pos (4) /*!< RTC TALM: TENSEC Position */ -#define RTC_TALM_TENSEC_Msk (0x7ul << RTC_TALM_TENSEC_Pos) /*!< RTC TALM: TENSEC Mask */ - -#define RTC_TALM_MIN_Pos (8) /*!< RTC TALM: MIN Position */ -#define RTC_TALM_MIN_Msk (0xful << RTC_TALM_MIN_Pos) /*!< RTC TALM: MIN Mask */ - -#define RTC_TALM_TENMIN_Pos (12) /*!< RTC TALM: TENMIN Position */ -#define RTC_TALM_TENMIN_Msk (0x7ul << RTC_TALM_TENMIN_Pos) /*!< RTC TALM: TENMIN Mask */ - -#define RTC_TALM_HR_Pos (16) /*!< RTC TALM: HR Position */ -#define RTC_TALM_HR_Msk (0xful << RTC_TALM_HR_Pos) /*!< RTC TALM: HR Mask */ - -#define RTC_TALM_TENHR_Pos (20) /*!< RTC TALM: TENHR Position */ -#define RTC_TALM_TENHR_Msk (0x3ul << RTC_TALM_TENHR_Pos) /*!< RTC TALM: TENHR Mask */ - -#define RTC_CALM_DAY_Pos (0) /*!< RTC CALM: DAY Position */ -#define RTC_CALM_DAY_Msk (0xful << RTC_CALM_DAY_Pos) /*!< RTC CALM: DAY Mask */ - -#define RTC_CALM_TENDAY_Pos (4) /*!< RTC CALM: TENDAY Position */ -#define RTC_CALM_TENDAY_Msk (0x3ul << RTC_CALM_TENDAY_Pos) /*!< RTC CALM: TENDAY Mask */ - -#define RTC_CALM_MON_Pos (8) /*!< RTC CALM: MON Position */ -#define RTC_CALM_MON_Msk (0xful << RTC_CALM_MON_Pos) /*!< RTC CALM: MON Mask */ - -#define RTC_CALM_TENMON_Pos (12) /*!< RTC CALM: TENMON Position */ -#define RTC_CALM_TENMON_Msk (0x1ul << RTC_CALM_TENMON_Pos) /*!< RTC CALM: TENMON Mask */ - -#define RTC_CALM_YEAR_Pos (16) /*!< RTC CALM: YEAR Position */ -#define RTC_CALM_YEAR_Msk (0xful << RTC_CALM_YEAR_Pos) /*!< RTC CALM: YEAR Mask */ - -#define RTC_CALM_TENYEAR_Pos (20) /*!< RTC CALM: TENYEAR Position */ -#define RTC_CALM_TENYEAR_Msk (0xful << RTC_CALM_TENYEAR_Pos) /*!< RTC CALM: TENYEAR Mask */ - -#define RTC_CALM_WEEKDAY_Pos (24) /*!< RTC CALM: WEEKDAY Position */ -#define RTC_CALM_WEEKDAY_Msk (0x7ul << RTC_CALM_WEEKDAY_Pos) /*!< RTC CALM: WEEKDAY Mask */ - -#define RTC_CALM_DAYALM_MSK_Pos (28) /*!< RTC CALM: DAYALM_MSK Position */ -#define RTC_CALM_DAYALM_MSK_Msk (0x1ul << RTC_CALM_DAYALM_MSK_Pos) /*!< RTC CALM: DAYALM_MSK Mask */ - -#define RTC_CALM_MONALM_MSK_Pos (29) /*!< RTC CALM: MONALM_MSK Position */ -#define RTC_CALM_MONALM_MSK_Msk (0x1ul << RTC_CALM_MONALM_MSK_Pos) /*!< RTC CALM: MONALM_MSK Mask */ - -#define RTC_CALM_YRALM_MSK_Pos (30) /*!< RTC CALM: YRALM_MSK Position */ -#define RTC_CALM_YRALM_MSK_Msk (0x1ul << RTC_CALM_YRALM_MSK_Pos) /*!< RTC CALM: YRALM_MSK Mask */ - -#define RTC_CALM_WKDALM_MSK_Pos (31) /*!< RTC CALM: WKDALM_MSK Position */ -#define RTC_CALM_WKDALM_MSK_Msk (0x1ul << RTC_CALM_WKDALM_MSK_Pos) /*!< RTC CALM: WKDALM_MSK Mask */ - - -#define RTC_LEAPYEAR_LEAPYEAR_Pos (0) /*!< RTC LEAPYEAR: LEAPYEAR Position */ -#define RTC_LEAPYEAR_LEAPYEAR_Msk (0x1ul << RTC_LEAPYEAR_LEAPYEAR_Pos) /*!< RTC LEAPYEAR: LEAPYEAR Mask */ - -#define RTC_INTEN_ALMIEN_Pos (0) /*!< RTC INTEN: ALMIEN Position */ -#define RTC_INTEN_ALMIEN_Msk (0x1ul << RTC_INTEN_ALMIEN_Pos) /*!< RTC INTEN: ALMIEN Mask */ - -#define RTC_INTEN_TICKIEN_Pos (1) /*!< RTC INTEN: TICKIEN Position */ -#define RTC_INTEN_TICKIEN_Msk (0x1ul << RTC_INTEN_TICKIEN_Pos) /*!< RTC INTEN: TICKIEN Mask */ - -#define RTC_INTEN_WAKEUPIEN_Pos (2) /*!< RTC INTEN: WAKEUPIEN Position */ -#define RTC_INTEN_WAKEUPIEN_Msk (0x1ul << RTC_INTEN_WAKEUPIEN_Pos) /*!< RTC INTEN: WAKEUPIEN Mask */ - -#define RTC_INTEN_PWRSWIEN_Pos (3) /*!< RTC INTEN: PWRSWIEN Position */ -#define RTC_INTEN_PWRSWIEN_Msk (0x1ul << RTC_INTEN_PWRSWIEN_Pos) /*!< RTC INTEN: PWRSWIEN Mask */ - -#define RTC_INTEN_RELALMIEN_Pos (4) /*!< RTC INTEN: RELALMIEN Position */ -#define RTC_INTEN_RELALMIEN_Msk (0x1ul << RTC_INTEN_RELALMIEN_Pos) /*!< RTC INTEN: RELALMIEN Mask */ - -#define RTC_INTEN_KEYPRESIEN_Pos (5) /*!< RTC INTEN: KEYPRESIEN Position */ -#define RTC_INTEN_KEYPRESIEN_Msk (0x1ul << RTC_INTEN_KEYPRESIEN_Pos) /*!< RTC INTEN: KEYPRESIEN Mask */ - - -#define RTC_INTSTS_ALMINT_Pos (0) /*!< RTC INTSTS: ALMINT Position */ -#define RTC_INTSTS_ALMINT_Msk (0x1ul << RTC_INTSTS_ALMINT_Pos) /*!< RTC INTSTS: ALMINT Mask */ - -#define RTC_INTSTS_TICKINT_Pos (1) /*!< RTC INTSTS: TICKINT Position */ -#define RTC_INTSTS_TICKINT_Msk (0x1ul << RTC_INTSTS_TICKINT_Pos) /*!< RTC INTSTS: TICKINT Mask */ - -#define RTC_INTSTS_WAKEUPINT_Pos (2) /*!< RTC INTSTS: WAKEUPINT Position */ -#define RTC_INTSTS_WAKEUPINT_Msk (0x1ul << RTC_INTSTS_WAKEUPINT_Pos) /*!< RTC INTSTS: WAKEUPINT Mask */ - -#define RTC_INTSTS_PWRSWINT_Pos (3) /*!< RTC INTSTS: PWRSWINT Position */ -#define RTC_INTSTS_PWRSWINT_Msk (0x1ul << RTC_INTSTS_PWRSWINT_Pos) /*!< RTC INTSTS: PWRSWINT Mask */ - -#define RTC_INTSTS_RELALMINT_Pos (4) /*!< RTC INTSTS: RELALMINT Position */ -#define RTC_INTSTS_RELALMINT_Msk (0x1ul << RTC_INTSTS_RELALMINT_Pos) /*!< RTC INTSTS: RELALMINT Mask */ - -#define RTC_INTSTS_KEYPRESINT_Pos (5) /*!< RTC INTSTS: KEYPRESINT Position */ -#define RTC_INTSTS_KEYPRESINT_Msk (0x1ul << RTC_INTSTS_KEYPRESINT_Pos) /*!< RTC INTSTS: KEYPRESINT Mask */ - -#define RTC_INTSTS_REGWRBUSY_Pos (31) /*!< RTC INTSTS: REGWRBUSY Position */ -#define RTC_INTSTS_REGWRBUSY_Msk (0x1ul << RTC_INTSTS_REGWRBUSY_Pos) /*!< RTC INTSTS: REGWRBUSY Mask */ - - -#define RTC_TICK_TTR_Pos (0) /*!< RTC TICK: TTR Position */ -#define RTC_TICK_TTR_Msk (0x7ul << RTC_TICK_TTR_Pos) /*!< RTC TICK: TTR Mask */ - -#define RTC_PWRCTL_PWR_ON_Pos (0) /*!< RTC PWRCTL: PWR_ON Position */ -#define RTC_PWRCTL_PWR_ON_Msk (0x1ul << RTC_PWRCTL_PWR_ON_Pos) /*!< RTC PWRCTL: PWR_ON Mask */ - -#define RTC_PWRCTL_SW_PCLR_Pos (1) /*!< RTC PWRCTL: SW_PCLR Position */ -#define RTC_PWRCTL_SW_PCLR_Msk (0x1ul << RTC_PWRCTL_SW_PCLR_Pos) /*!< RTC PWRCTL: SW_PCLR Mask */ - -#define RTC_PWRCTL_HW_PCLR_EN_Pos (2) /*!< RTC PWRCTL: HW_PCLR_EN Position */ -#define RTC_PWRCTL_HW_PCLR_EN_Msk (0x1ul << RTC_PWRCTL_HW_PCLR_EN_Pos) /*!< RTC PWRCTL: HW_PCLR_EN Mask */ - -#define RTC_PWRCTL_ALARM_EN_Pos (3) /*!< RTC PWRCTL: ALARM_EN Position */ -#define RTC_PWRCTL_ALARM_EN_Msk (0x1ul << RTC_PWRCTL_ALARM_EN_Pos) /*!< RTC PWRCTL: ALARM_EN Mask */ - -#define RTC_PWRCTL_REL_ALARM_EN_Pos (4) /*!< RTC PWRCTL: REL_ALARM_EN Position */ -#define RTC_PWRCTL_REL_ALARM_EN_Msk (0x1ul << RTC_PWRCTL_REL_ALARM_EN_Pos) /*!< RTC PWRCTL: REL_ALARM_EN Mask */ - -#define RTC_PWRCTL_EDGE_TRIG_Pos (5) /*!< RTC PWRCTL: EDGE_TRIG Position */ -#define RTC_PWRCTL_EDGE_TRIG_Msk (0x1ul << RTC_PWRCTL_EDGE_TRIG_Pos) /*!< RTC PWRCTL: EDGE_TRIG Mask */ - -#define RTC_PWRCTL_TIMEUNITL_Pos (6) /*!< RTC PWRCTL: TIMEUNITL Position */ -#define RTC_PWRCTL_TIMEUNITL_Msk (0x1ul << RTC_PWRCTL_TIMEUNITLPos) /*!< RTC PWRCTL: TIMEUNITL Mask */ - -#define RTC_PWRCTL_PWR_KEY_Pos (7) /*!< RTC PWRCTL: PWR_KEY Position */ -#define RTC_PWRCTL_PWR_KEY_Msk (0x1ul << RTC_PWRCTL_PWR_KEY_Pos) /*!< RTC PWRCTL: PWR_KEY Mask */ - -#define RTC_PWRCTL_PWRON_TIME_Pos (8) /*!< RTC PWRCTL: PWRON_TIME Position */ -#define RTC_PWRCTL_PWRON_TIME_Msk (0xful << RTC_PWRCTL_PWRON_TIME_Pos) /*!< RTC PWRCTL: PWRON_TIME Mask */ - -#define RTC_PWRCTL_PWROFF_TIME_Pos (12) /*!< RTC PWRCTL: PWROFF_TIME Position */ -#define RTC_PWRCTL_PWROFF_TIME_Msk (0xful << RTC_PWRCTL_PWROFF_TIME_Pos) /*!< RTC PWRCTL: PWROFF_TIME Mask */ - -#define RTC_PWRCTL_RELALM_TIME_Pos (16) /*!< RTC PWRCTL: RELALM_TIME Position */ -#define RTC_PWRCTL_RELALM_TIME_Msk (0xffful << RTC_PWRCTL_RELALM_TIME_Pos) /*!< RTC PWRCTL: RELALM_TIME Mask */ - -#define RTC_PWRCTL_ALARM_MODE_Pos (28) /*!< RTC PWRCTL: ALARM_MODE Position */ -#define RTC_PWRCTL_ALARM_MODE_Msk (0x1ul << RTC_PWRCTL_ALARM_MODE_Pos) /*!< RTC PWRCTL: ALARM_MODE Mask */ - - -#define RTC_SPRCTL_SNPDEN_Pos (0) /*!< RTC SPRCTL: SNPDEN Position */ -#define RTC_SPRCTL_SNPDEN_Msk (0x1ul << RTC_SPRCTL_SNPDEN_Pos) /*!< RTC SPRCTL: SNPDEN Mask */ - -#define RTC_SPRCTL_SNPTYPE0_Pos (1) /*!< RTC SPRCTL: SNPTYPE0 Position */ -#define RTC_SPRCTL_SNPTYPE0_Msk (0x1ul << RTC_SPRCTL_SNPTYPE0_Pos) /*!< RTC SPRCTL: SNPTYPE0 Mask */ - -#define RTC_SPRCTL_SPRRWEN_Pos (2) /*!< RTC SPRCTL: SPRRWEN Position */ -#define RTC_SPRCTL_SPRRWEN_Msk (0x1ul << RTC_SPRCTL_SPRRWEN_Pos) /*!< RTC SPRCTL: SPRRWEN Mask */ - -#define RTC_SPRCTL_SNPTYPE1_Pos (3) /*!< RTC SPRCTL: SNPTYPE1 Position */ -#define RTC_SPRCTL_SNPTYPE1_Msk (0x1ul << RTC_SPRCTL_SNPTYPE1_Pos) /*!< RTC SPRCTL: SNPTYPE1 Mask */ - -#define RTC_SPRCTL_SPRCSTS_Pos (5) /*!< RTC SPRCTL: SPRCSTS Position */ -#define RTC_SPRCTL_SPRCSTS_Msk (0x1ul << RTC_SPRCTL_SPRCSTS_Pos) /*!< RTC SPRCTL: SPRCSTS Mask */ - -#define RTC_SPRCTL_SPRRWRDY_Pos (7) /*!< RTC SPRCTL: SPRRWRDY Position */ -#define RTC_SPRCTL_SPRRWRDY_Msk (0x1ul << RTC_SPRCTL_SPRRWRDY_Pos) /*!< RTC SPRCTL: SPRRWRDY Mask */ - -#define RTC_SPR0_SPARE_Pos (0) /*!< RTC SPR0: SPARE Position */ -#define RTC_SPR0_SPARE_Msk (0xfffffffful << RTC_SPR0_SPARE_Pos) /*!< RTC SPR0: SPARE Mask */ - -#define RTC_SPR1_SPARE_Pos (0) /*!< RTC SPR1: SPARE Position */ -#define RTC_SPR1_SPARE_Msk (0xfffffffful << RTC_SPR1_SPARE_Pos) /*!< RTC SPR1: SPARE Mask */ - -#define RTC_SPR2_SPARE_Pos (0) /*!< RTC SPR2: SPARE Position */ -#define RTC_SPR2_SPARE_Msk (0xfffffffful << RTC_SPR2_SPARE_Pos) /*!< RTC SPR2: SPARE Mask */ - -#define RTC_SPR3_SPARE_Pos (0) /*!< RTC SPR3: SPARE Position */ -#define RTC_SPR3_SPARE_Msk (0xfffffffful << RTC_SPR3_SPARE_Pos) /*!< RTC SPR3: SPARE Mask */ - -#define RTC_SPR4_SPARE_Pos (0) /*!< RTC SPR4: SPARE Position */ -#define RTC_SPR4_SPARE_Msk (0xfffffffful << RTC_SPR4_SPARE_Pos) /*!< RTC SPR4: SPARE Mask */ - -#define RTC_SPR5_SPARE_Pos (0) /*!< RTC SPR5: SPARE Position */ -#define RTC_SPR5_SPARE_Msk (0xfffffffful << RTC_SPR5_SPARE_Pos) /*!< RTC SPR5: SPARE Mask */ - -#define RTC_SPR6_SPARE_Pos (0) /*!< RTC SPR6: SPARE Position */ -#define RTC_SPR6_SPARE_Msk (0xfffffffful << RTC_SPR6_SPARE_Pos) /*!< RTC SPR6: SPARE Mask */ - -#define RTC_SPR7_SPARE_Pos (0) /*!< RTC SPR7: SPARE Position */ -#define RTC_SPR7_SPARE_Msk (0xfffffffful << RTC_SPR7_SPARE_Pos) /*!< RTC SPR7: SPARE Mask */ - -#define RTC_SPR8_SPARE_Pos (0) /*!< RTC SPR8: SPARE Position */ -#define RTC_SPR8_SPARE_Msk (0xfffffffful << RTC_SPR8_SPARE_Pos) /*!< RTC SPR8: SPARE Mask */ - -#define RTC_SPR9_SPARE_Pos (0) /*!< RTC SPR9: SPARE Position */ -#define RTC_SPR9_SPARE_Msk (0xfffffffful << RTC_SPR9_SPARE_Pos) /*!< RTC SPR9: SPARE Mask */ - -#define RTC_SPR10_SPARE_Pos (0) /*!< RTC SPR10: SPARE Position */ -#define RTC_SPR10_SPARE_Msk (0xfffffffful << RTC_SPR10_SPARE_Pos) /*!< RTC SPR10: SPARE Mask */ - -#define RTC_SPR11_SPARE_Pos (0) /*!< RTC SPR11: SPARE Position */ -#define RTC_SPR11_SPARE_Msk (0xfffffffful << RTC_SPR11_SPARE_Pos) /*!< RTC SPR11: SPARE Mask */ - -#define RTC_SPR12_SPARE_Pos (0) /*!< RTC SPR12: SPARE Position */ -#define RTC_SPR12_SPARE_Msk (0xfffffffful << RTC_SPR12_SPARE_Pos) /*!< RTC SPR12: SPARE Mask */ - -#define RTC_SPR13_SPARE_Pos (0) /*!< RTC SPR13: SPARE Position */ -#define RTC_SPR13_SPARE_Msk (0xfffffffful << RTC_SPR13_SPARE_Pos) /*!< RTC SPR13: SPARE Mask */ - -#define RTC_SPR14_SPARE_Pos (0) /*!< RTC SPR14: SPARE Position */ -#define RTC_SPR14_SPARE_Msk (0xfffffffful << RTC_SPR14_SPARE_Pos) /*!< RTC SPR14: SPARE Mask */ - -#define RTC_SPR15_SPARE_Pos (0) /*!< RTC SPR15: SPARE Position */ -#define RTC_SPR15_SPARE_Msk (0xfffffffful << RTC_SPR15_SPARE_Pos) /*!< RTC SPR15: SPARE Mask */ - -#define RTC_SPR16_SPARE_Pos (0) /*!< RTC SPR16: SPARE Position */ -#define RTC_SPR16_SPARE_Msk (0xfffffffful << RTC_SPR16_SPARE_Pos) /*!< RTC SPR16: SPARE Mask */ - -#define RTC_SPR17_SPARE_Pos (0) /*!< RTC SPR17: SPARE Position */ -#define RTC_SPR17_SPARE_Msk (0xfffffffful << RTC_SPR17_SPARE_Pos) /*!< RTC SPR17: SPARE Mask */ - -#define RTC_SPR18_SPARE_Pos (0) /*!< RTC SPR18: SPARE Position */ -#define RTC_SPR18_SPARE_Msk (0xfffffffful << RTC_SPR18_SPARE_Pos) /*!< RTC SPR18: SPARE Mask */ - -#define RTC_SPR19_SPARE_Pos (0) /*!< RTC SPR19: SPARE Position */ -#define RTC_SPR19_SPARE_Msk (0xfffffffful << RTC_SPR19_SPARE_Pos) /*!< RTC SPR19: SPARE Mask */ - -/** - * @brief RTC define interrupt source - */ -typedef enum -{ - RTC_ALARM_INT = 0x01, /*!< Alarm interrupt */ - RTC_TICK_INT = 0x02, /*!< Tick interrupt */ - RTC_WAKEUP_INT = 0x04, /*!< Wake-up interrupt */ - RTC_PSWI_INT = 0x08, /*!< Power switch interrupt */ - RTC_RELATIVE_ALARM_INT = 0x10, /*!< Releative Alarm interrupt */ - RTC_KEY_PRESS_INT = 0x20, /*!< Power Key press interrupt */ - RTC_ALL_INT = 0x3F /*!< All interrupt */ -} RTC_INT_SOURCE; - -/** - * @brief Define Ioctl commands - */ -typedef enum -{ - RTC_IOC_IDENTIFY_LEAP_YEAR = 0, /*!< Identify leap year */ - RTC_IOC_SET_TICK_MODE = 1, /*!< Set tick mode */ - RTC_IOC_GET_TICK = 2, /*!< Get tick count */ - RTC_IOC_RESTORE_TICK = 3, /*!< Reset tick count */ - RTC_IOC_ENABLE_INT = 4, /*!< Enable RTC interrupt */ - RTC_IOC_DISABLE_INT = 5, /*!< Disable RTC interrupt */ - RTC_IOC_SET_CURRENT_TIME = 6, /*!< Set current time */ - RTC_IOC_SET_ALAMRM_TIME = 7, /*!< set alarm time */ - RTC_IOC_SET_FREQUENCY = 8, /*!< Set frequency compensation value */ - RTC_IOC_SET_POWER_ON = 9, /*!< Set Power on */ - RTC_IOC_SET_POWER_OFF = 10, /*!< Set Power off*/ - RTC_IOC_SET_POWER_OFF_PERIOD = 11, /*!< Set Power off period */ - RTC_IOC_ENABLE_HW_POWEROFF = 12, /*!< Enable H/W Power off */ - RTC_IOC_DISABLE_HW_POWEROFF = 13, /*!< Disable H/W Power off */ - RTC_IOC_GET_POWERKEY_STATUS = 14, /*!< Get Power key status */ - RTC_IOC_SET_PSWI_CALLBACK = 15, /*!< Set Power switch isr call back function */ - //RTC_IOC_GET_SW_STATUS = 16, - //RTC_IOC_SET_SW_STATUS = 17, - RTC_IOC_SET_RELEATIVE_ALARM = 18, /*!< Set releative alarm */ - //RTC_IOC_SET_POWER_KEY_DELAY = 19, - //RTC_IOC_SET_CLOCK_SOURCE = 20, - //RTC_IOC_GET_CLOCK_SOURCE = 21 -} E_RTC_CMD; - -/** - * @brief RTC define Tick mode - */ -typedef enum -{ - RTC_TICK_1_SEC = 0, /*!< Time tick is 1 second */ - RTC_TICK_1_2_SEC = 1, /*!< Time tick is 1/2 second */ - RTC_TICK_1_4_SEC = 2, /*!< Time tick is 1/4 second */ - RTC_TICK_1_8_SEC = 3, /*!< Time tick is 1/8 second */ - RTC_TICK_1_16_SEC = 4, /*!< Time tick is 1/16 second */ - RTC_TICK_1_32_SEC = 5, /*!< Time tick is 1/32 second */ - RTC_TICK_1_64_SEC = 6, /*!< Time tick is 1/64 second */ - RTC_TICK_1_128_SEC = 7 /*!< Time tick is 1/128 second */ -} RTC_TICK; - -typedef void (PFN_RTC_CALLBACK)(void); /*!< Call back function \hideinitializer */ - -/** - * @brief RTC current/alarm time select - */ -typedef enum -{ - RTC_CURRENT_TIME = 0, /*!< Select current time */ - RTC_ALARM_TIME = 1 /*!< Select alarm time */ -} E_RTC_TIME_SELECT; - -/** - * @brief RTC define Day of week parameter - */ -typedef enum -{ - RTC_SUNDAY = 0, /*!< Sunday */ - RTC_MONDAY = 1, /*!< Monday */ - RTC_TUESDAY = 2, /*!< Tuesday */ - RTC_WEDNESDAY = 3, /*!< Wednesday */ - RTC_THURSDAY = 4, /*!< Thursday */ - RTC_FRIDAY = 5, /*!< Friday */ - RTC_SATURDAY = 6 /*!< Saturday */ -} E_RTC_DWR_PARAMETER; - - -/** - * @brief RTC define Time Data Struct - */ -typedef struct -{ - UINT8 u8cClockDisplay; /*!< 12-Hour, 24-Hour */ - UINT8 u8cAmPm; /*!< Time Scale select 12-hr/24-hr */ - UINT32 u32cSecond; /*!< Second value */ - UINT32 u32cMinute; /*!< Minute value */ - UINT32 u32cHour; /*!< Hour value */ - UINT32 u32cDayOfWeek; /*!< Day of week value */ - UINT32 u32cDay; /*!< Day value */ - UINT32 u32cMonth; /*!< Month value */ - UINT32 u32Year; /*!< Year value */ - UINT32 u32AlarmMaskSecond; /*!< Alarm mask second */ - UINT32 u32AlarmMaskMinute; /*!< Alarm mask minute */ - UINT32 u32AlarmMaskHour; /*!< Alarm mask hour */ - PFN_RTC_CALLBACK *pfnAlarmCallBack; /*!< Alarm ISR call back function */ -} S_RTC_TIME_DATA_T; - - -/** - * @brief RTC define Tick Struct - */ -typedef struct -{ - UINT8 ucMode; /*!< Tick Mode */ - PFN_RTC_CALLBACK *pfnTickCallBack; /*!< Tick ISR call back function */ -} RTC_TICK_T; - -/*@}*/ /* end of group N9H30_RTC_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -UINT32 RTC_Init(void); -UINT32 RTC_Open(S_RTC_TIME_DATA_T *sPt); -UINT32 RTC_Ioctl(INT32 i32Num, E_RTC_CMD eCmd, UINT32 u32Arg0, UINT32 u32Arg1); -UINT32 RTC_Read(E_RTC_TIME_SELECT eTime, S_RTC_TIME_DATA_T *sPt); -UINT32 RTC_Write(E_RTC_TIME_SELECT eTime, S_RTC_TIME_DATA_T *sPt); -UINT32 RTC_DoFrequencyCompensation(INT32 i32FrequencyX100); -UINT32 RTC_WriteEnable(BOOL bEnable); -UINT32 RTC_Close(void); -void RTC_EnableClock(BOOL bEnable); -VOID RTC_Check(void); - -#define RTC_DisableInt(u32IntFlag) RTC_Ioctl(0, RTC_IOC_DISABLE_INT, u32IntFlag, 0) -#define RTC_EnableInt(u32IntFlag) RTC_Ioctl(0, RTC_IOC_ENABLE_INT, u32IntFlag, 0) -#define RTC_GET_TICK_INT_FLAG() (inp32(REG_RTC_INTSTS)&RTC_TICK_INT) -#define RTC_GET_ALARM_INT_FLAG() (inp32(REG_RTC_INTSTS)&RTC_ALARM_INT) - -static __inline void RTC_CLEAR_TICK_INT_FLAG(void) -{ - RTC_WriteEnable(1); - outp32(REG_RTC_INTSTS, RTC_TICK_INT); - RTC_Check(); -} - -static __inline void RTC_CLEAR_ALARM_INT_FLAG(void) -{ - RTC_WriteEnable(1); - outp32(REG_RTC_INTSTS, RTC_ALARM_INT); - RTC_Check(); -} - - -/*@}*/ /* end of group N9H30_RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_RTC_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_RTC_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_scuart.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_scuart.h deleted file mode 100644 index 58746264ee0..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_scuart.h +++ /dev/null @@ -1,335 +0,0 @@ -/**************************************************************************//** - * @file scuart.h - * @brief N9H30 series Smartcard UART mode (SCUART) driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SCUART_H__ -#define __NU_SCUART_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_SCUART_Driver SCUART Driver - @{ -*/ - -/** @addtogroup N9H30_SCUART_EXPORTED_CONSTANTS SCUART Exported Constants - @{ -*/ -#define SCUART_CHAR_LEN_5 (0x3ul << 4) /*!< Set SCUART word length to 5 bits */ -#define SCUART_CHAR_LEN_6 (0x2ul << 4) /*!< Set SCUART word length to 6 bits */ -#define SCUART_CHAR_LEN_7 (0x1ul << 4) /*!< Set SCUART word length to 7 bits */ -#define SCUART_CHAR_LEN_8 (0) /*!< Set SCUART word length to 8 bits */ - -#define SCUART_PARITY_NONE (0x00000040) /*!< Set SCUART transfer with no parity */ -#define SCUART_PARITY_ODD (0x00000080) /*!< Set SCUART transfer with odd parity */ -#define SCUART_PARITY_EVEN (0) /*!< Set SCUART transfer with even parity */ - -#define SCUART_STOP_BIT_1 (0x00008000) /*!< Set SCUART transfer with one stop bit */ -#define SCUART_STOP_BIT_2 (0) /*!< Set SCUART transfer with two stop bits */ - -#define SC_STATUS_RXEMPTY_Msk 0x00000002 -#define SC_STATUS_RXFULL_Msk 0x00000004 -#define SC_STATUS_PEF_Msk 0x00000010 -#define SC_STATUS_FEF_Msk 0x00000020 -#define SC_STATUS_BEF_Msk 0x00000040 -#define SC_STATUS_TXEMPTY_Msk 0x00000200 -#define SC_STATUS_TXFULL_Msk 0x00000400 -#define SC_STATUS_TXACT_Msk 0x80000000 - -#define SC_INTEN_RXTOIEN_Msk 0x00000200 -#define SC_INTEN_TERRIEN_Msk 0x00000004 -#define SC_INTEN_TBEIEN_Msk 0x00000002 -#define SC_INTEN_RDAIEN_Msk 0x00000001 - -#define SC_INTSTS_RBTOIF_Msk 0x00000200 -#define SC_INTSTS_TERRIF_Msk 0x00000004 -#define SC_INTSTS_TBEIF_Msk 0x00000002 -#define SC_INTSTS_RDAIF_Msk 0x00000001 - -#define SC_CTL_SCEN_Msk 0x00000001 -#define SC_CTL_NSB_Msk 0x00008000 - -#define SC_UARTCTL_UARTEN_Msk 0x00000001 - -/*@}*/ /* end of group N9H30_SCUART_EXPORTED_CONSTANTS */ - - -/** @addtogroup N9H30_SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/* TX Macros */ -/** - * @brief Write Data to Tx data register. - * @param[in] sc Smartcard module number - * @param[in] u8Data Data byte to transmit. - * @return None - * @details By writing data to DAT register, the SC will send out an 8-bit data. - * \hideinitializer - */ -#define SCUART_WRITE(sc, u8Data) \ -do {\ - if(sc == 0)\ - outpw(REG_SC0_DAT, u8Data);\ - else\ - outpw(REG_SC1_DAT, u8Data);\ -}while(0) - -/** - * @brief Get TX FIFO empty flag status from register. - * @param[in] sc Smartcard module number - * @return Transmit FIFO empty status. - * @retval 0 Transmit FIFO is not empty. - * @retval SC_STATUS_TXEMPTY_Msk Transmit FIFO is empty. - * @details When the last byte of TX buffer has been transferred to Transmitter Shift Register, hardware sets TXEMPTY bit (SC_STATUS[9]) high. - * It will be cleared when writing data into DAT (SC_DAT[7:0]). - * \hideinitializer - */ -#define SCUART_GET_TX_EMPTY(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & SC_STATUS_TXEMPTY_Msk) : (inpw(REG_SC1_STATUS) & SC_STATUS_TXEMPTY_Msk)) - -/** - * @brief Get TX FIFO full flag status from register. - * @param[in] sc Smartcard module number - * @retval 0 Transmit FIFO is not full. - * @retval SC_STATUS_TXFULL_Msk Transmit FIFO is full. - * @details TXFULL(SC_STATUS[10]) is set when TX pointer is equal to 4, otherwise is cleared by hardware. - * \hideinitializer - */ -#define SCUART_GET_TX_FULL(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & SC_STATUS_TXFULL_Msk) : (inpw(REG_SC1_STATUS) & SC_STATUS_TXFULL_Msk)) - -/** - * @brief Wait specified smartcard port transmission complete. - * @param[in] sc Smartcard module number - * @return None - * @details TXACT (SC_STATUS[31]) is cleared automatically when TX transfer is finished or the last byte transmission has completed. - * @note This macro blocks until transmit complete. - * \hideinitializer - */ -#define SCUART_WAIT_TX_EMPTY(sc)\ -do {\ - if(sc == 0)\ - while(inpw(REG_SC0_STATUS) & SC_STATUS_TXACT_Msk);\ - else\ - while(inpw(REG_SC1_STATUS) & SC_STATUS_TXACT_Msk);\ -}while(0) - -/** - * @brief Check specified smartcard port transmit FIFO is full or not. - * @param[in] sc Smartcard module number - * @retval 0 Transmit FIFO is not full. - * @retval 1 Transmit FIFO is full. - * @details TXFULL(SC_STATUS[10]) indicates TX buffer full or not. - * This is set when TX pointer is equal to 4, otherwise is cleared by hardware. - * \hideinitializer - */ -#define SCUART_IS_TX_FULL(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & SC_STATUS_TXFULL_Msk ? 1 : 0) : (inpw(REG_SC1_STATUS) & SC_STATUS_TXFULL_Msk ? 1 : 0)) - -/** - * @brief Check specified smartcard port transmission is over. - * @param[in] sc Smartcard module number - * @retval 0 Transmit is not complete. - * @retval 1 Transmit complete. - * @details TXACT (SC_STATUS[31]) is set by hardware when TX transfer is in active and the STOP bit of the last byte has been transmitted. - * \hideinitializer - */ -#define SCUART_IS_TX_EMPTY(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & SC_STATUS_TXACT_Msk ? 1 : 0) : (inpw(REG_SC1_STATUS) & SC_STATUS_TXACT_Msk ? 1 : 0)) - -/* RX Macros */ - -/** - * @brief Read Rx data register. - * @param[in] sc Smartcard module number - * @return The oldest data byte in RX FIFO. - * @details By reading DAT register, the SC will return an 8-bit received data. - * \hideinitializer - */ -#define SCUART_READ(sc) (sc == 0 ? inpw(REG_SC0_DAT) : inpw(REG_SC1_DAT)) - -/** - * @brief Get RX FIFO empty flag status from register. - * @param[in] sc Smartcard module number - * @retval 0 Receive FIFO is not empty. - * @retval SC_STATUS_RXEMPTY_Msk Receive FIFO is empty. - * @details When the last byte of Rx buffer has been read by CPU, hardware sets RXEMPTY(SC_STATUS[1]) high. - * It will be cleared when SC receives any new data. - * \hideinitializer - */ -#define SCUART_GET_RX_EMPTY(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & SC_STATUS_RXEMPTY_Msk) : (inpw(REG_SC1_STATUS) & SC_STATUS_RXEMPTY_Msk)) - - -/** - * @brief Get RX FIFO full flag status from register. - * @param[in] sc Smartcard module number - * @retval 0 Receive FIFO is not full. - * @retval SC_STATUS_RXFULL_Msk Receive FIFO is full. - * @details RXFULLF(SC_STATUS[2]) is set when RX pointer is equal to 4, otherwise it is cleared by hardware. - * \hideinitializer - */ -#define SCUART_GET_RX_FULL(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & SC_STATUS_RXFULL_Msk) : (inpw(REG_SC1_STATUS) & SC_STATUS_RXFULL_Msk)) - -/** - * @brief Check if receive data number in FIFO reach FIFO trigger level or not. - * @param[in] sc Smartcard module number - * @retval 0 The number of bytes in receive FIFO is less than trigger level. - * @retval 1 The number of bytes in receive FIFO equals or larger than trigger level. - * @details RDAIF(SC_INTSTS[0]) is used for received data reaching trigger level RXTRGLV (SC_CTL[7:6]) interrupt status flag. - * @note If receive trigger level is \b not 1 byte, this macro return 0 does not necessary indicates there is no data in FIFO. - * \hideinitializer - */ -#define SCUART_IS_RX_READY(sc) (sc == 0 ? (inpw(REG_SC0_INTSTS) & SC_INTSTS_RDAIF_Msk ? 1 : 0) : (inpw(REG_SC1_INTSTS) & SC_INTSTS_RDAIF_Msk ? 1 : 0)) - -/** - * @brief Check specified smartcard port receive FIFO is full or not. - * @param[in] sc Smartcard module number - * @retval 0 Receive FIFO is not full. - * @retval 1 Receive FIFO is full. - * @details RXFULLF(SC_STATUS[2]) is set when RX pointer is equal to 4, otherwise it is cleared by hardware. - * \hideinitializer - */ -#define SCUART_IS_RX_FULL(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & SC_STATUS_RXFULL_Msk ? 1 : 0) : (inpw(REG_SC1_STATUS) & SC_STATUS_RXFULL_Msk ? 1 : 0)) - -/* Interrupt Macros */ - -/** - * @brief Enable specified interrupts. - * @param[in] sc Smartcard module number - * @param[in] u32Mask Interrupt masks to enable, a combination of following bits. - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * @details The macro is used to enable receiver buffer time-out interrupt, transfer error interrupt, - * transmit buffer empty interrupt or receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SCUART_ENABLE_INT(sc, u32Mask)\ -do {\ - if(sc == 0)\ - outpw(REG_SC0_INTEN, inpw(REG_SC0_INTEN) | (u32Mask));\ - else\ - outpw(REG_SC1_INTEN, inpw(REG_SC1_INTEN) | (u32Mask));\ -}while(0) - -/** - * @brief Disable specified interrupts. - * @param[in] sc Smartcard module number - * @param[in] u32Mask Interrupt masks to disable, a combination of following bits. - * - \ref SC_INTEN_RXTOIEN_Msk - * - \ref SC_INTEN_TERRIEN_Msk - * - \ref SC_INTEN_TBEIEN_Msk - * - \ref SC_INTEN_RDAIEN_Msk - * @return None - * @details The macro is used to disable receiver buffer time-out interrupt, transfer error interrupt, - * transmit buffer empty interrupt or receive data reach trigger level interrupt. - * \hideinitializer - */ -#define SCUART_DISABLE_INT(sc, u32Mask)\ -do {\ - if(sc == 0)\ - outpw(REG_SC0_INTEN, inpw(REG_SC0_INTEN) & ~(u32Mask));\ - else\ - outpw(REG_SC1_INTEN, inpw(REG_SC1_INTEN) & ~(u32Mask));\ -}while(0) - -/** - * @brief Get specified interrupt flag/status. - * @param[in] sc Smartcard module number - * @param[in] u32Type Interrupt flag/status to check, could be one of following value: - * - \ref SC_INTSTS_RBTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * - \ref SC_INTSTS_RDAIF_Msk - * @return The status of specified interrupt. - * @retval 0 Specified interrupt does not happened. - * @retval 1 Specified interrupt happened. - * @details The macro is used to get receiver buffer time-out interrupt status, transfer error interrupt status, - * transmit buffer empty interrupt status or receive data reach interrupt status. - * \hideinitializer - */ -#define SCUART_GET_INT_FLAG(sc, u32Type) (sc == 0 ? (inpw(REG_SC0_INTSTS) & (u32Type) ? 1 : 0) : (inpw(REG_SC1_INTSTS) & (u32Type) ? 1 : 0)) - -/** - * @brief Clear specified interrupt flag/status. - * @param[in] sc Smartcard module number - * @param[in] u32Type Interrupt flag/status to clear, could be the combination of following values: - * - \ref SC_INTSTS_RBTOIF_Msk - * - \ref SC_INTSTS_TERRIF_Msk - * - \ref SC_INTSTS_TBEIF_Msk - * @return None - * @details The macro is used to clear receiver buffer time-out interrupt flag, transfer error interrupt flag or - * transmit buffer empty interrupt flag. - * \hideinitializer - */ -#define SCUART_CLR_INT_FLAG(sc, u32Type) \ -do {\ - if(sc == 0)\ - outpw(REG_SC0_INTSTS, (u32Type));\ - else\ - outpw(REG_SC1_INTSTS, (u32Type));\ -}while(0) - -/** - * @brief Get receive error flag/status. - * @param[in] sc Smartcard module number - * @return Current receive error status, could one of following errors: - * @retval SC_STATUS_PEF_Msk Parity error. - * @retval SC_STATUS_FEF_Msk Frame error. - * @retval SC_STATUS_BEF_Msk Break error. - * @details The macro is used to get receiver parity error status, receiver frame error status or - * receiver break error status. - * \hideinitializer - */ -#define SCUART_GET_ERR_FLAG(sc) (sc == 0 ? (inpw(REG_SC0_STATUS) & (SC_STATUS_PEF_Msk | SC_STATUS_FEF_Msk | SC_STATUS_BEF_Msk)) : (inpw(REG_SC1_STATUS) & (SC_STATUS_PEF_Msk | SC_STATUS_FEF_Msk | SC_STATUS_BEF_Msk))) - -/** - * @brief Clear specified receive error flag/status. - * @param[in] sc Smartcard module number - * @param[in] u32Mask Receive error flag/status to clear, combination following values: - * - \ref SC_STATUS_PEF_Msk - * - \ref SC_STATUS_FEF_Msk - * - \ref SC_STATUS_BEF_Msk - * @return None - * @details The macro is used to clear receiver parity error flag, receiver frame error flag or - * receiver break error flag. - * \hideinitializer - */ -#define SCUART_CLR_ERR_FLAG(sc, u32Mask)\ -do {\ - if(sc == 0)\ - outpw(REG_SC0_STATUS, (u32Mask));\ - else\ - outpw(REG_SC1_STATUS, (u32Mask));\ -}while(0) - -void SCUART_Close(UINT sc); -UINT SCUART_Open(UINT sc, UINT u32baudrate); -UINT SCUART_Read(UINT sc, char *pu8RxBuf, UINT u32ReadBytes); -UINT SCUART_SetLineConfig(UINT sc, UINT u32Baudrate, UINT u32DataWidth, UINT u32Parity, UINT u32StopBits); -void SCUART_SetTimeoutCnt(UINT sc, UINT u32TOC); -void SCUART_Write(UINT sc, char *pu8TxBuf, UINT u32WriteBytes); - -/*@}*/ /* end of group N9H30_SCUART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_SCUART_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_SCUART_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sdh.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sdh.h deleted file mode 100644 index 3902650271e..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sdh.h +++ /dev/null @@ -1,764 +0,0 @@ -/**************************************************************************//** - * @file sdh.h - * @brief N9H30 SDH driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include - -#ifndef __NU_SDH_H__ -#define __NU_SDH_H__ - -#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 */ - -#define TIMER0 0 - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SDH SD/SDIO Host Controller(SDH) - Memory Mapped Structure for SDH Controller -@{ */ - -typedef struct -{ - - /** - * @var SDH_T::FB - * Offset: 0x00~0x7C Shared Buffer (FIFO) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |BUFFER |Shared Buffer - * | | |Buffer for DMA transfer - * @var SDH_T::DMACTL - * Offset: 0x400 DMA Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMAEN |DMA Engine Enable Bit - * | | |0 = DMA Disabled. - * | | |1 = DMA Enabled. - * | | |If this bit is cleared, DMA will ignore all requests from SD host and force bus master into IDLE state. - * | | |Note: If target abort is occurred, DMAEN will be cleared. - * |[1] |DMARST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset internal state machine and pointers - * | | |The contents of control register will not be cleared - * | | |This bit will auto be cleared after few clock cycles. - * | | |Note: The software reset DMA related registers. - * |[3] |SGEN |Scatter-gather Function Enable Bit - * | | |0 = Scatter-gather function Disabled (DMA will treat the starting address in DMASAR as starting pointer of a single block memory). - * | | |1 = Scatter-gather function Enabled (DMA will treat the starting address in DMASAR as a starting address of Physical Address Descriptor (PAD) table - * | | |The format of these Pads' will be described later). - * |[9] |DMABUSY |DMA Transfer Is in Progress - * | | |This bit indicates if SD Host is granted and doing DMA transfer or not. - * | | |0 = DMA transfer is not in progress. - * | | |1 = DMA transfer is in progress. - * @var SDH_T::DMASA - * Offset: 0x408 DMA Transfer Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ORDER |Determined to the PAD Table Fetching Is in Order or Out of Order - * | | |0 = PAD table is fetched in order. - * | | |1 = PAD table is fetched out of order. - * | | |Note: the bit0 is valid in scatter-gather mode when SGEN = 1. - * |[31:1] |DMASA |DMA Transfer Starting Address - * | | |This field pads 0 as least significant bit indicates a 32-bit starting address of system memory (SRAM) for DMA to retrieve or fill in data. - * | | |If DMA is not in normal mode, this field will be interpreted as a starting address of Physical Address Descriptor (PAD) table. - * | | |Note: Starting address of the SRAM must be word aligned, for example, 0x0000_0000, 0x0000_0004. - * @var SDH_T::DMABCNT - * Offset: 0x40C DMA Transfer Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[25:0] |BCNT |DMA Transfer Byte Count (Read Only) - * | | |This field indicates the remained byte count of DMA transfer - * | | |The value of this field is valid only when DMA is busy; otherwise, it is 0. - * @var SDH_T::DMAINTEN - * Offset: 0x410 DMA Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIEN |DMA Read/Write Target Abort Interrupt Enable Bit - * | | |0 = Target abort interrupt generation Disabled during DMA transfer. - * | | |1 = Target abort interrupt generation Enabled during DMA transfer. - * |[1] |WEOTIEN |Wrong EOT Encountered Interrupt Enable Bit - * | | |0 = Interrupt generation Disabled when wrong EOT is encountered. - * | | |1 = Interrupt generation Enabled when wrong EOT is encountered. - * @var SDH_T::DMAINTSTS - * Offset: 0x414 DMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIF |DMA Read/Write Target Abort Interrupt Flag - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note1: This bit is read only, but can be cleared by writing '1' to it. - * | | |Note2: When DMA's bus master received ERROR response, it means that target abort is happened - * | | |DMA will stop transfer and respond this event and then go to IDLE state - * | | |When target abort occurred or WEOTIF is set, software must reset DMA and SD host, and then transfer those data again. - * |[1] |WEOTIF |Wrong EOT Encountered Interrupt Flag - * | | |When DMA Scatter-Gather function is enabled, and EOT of the descriptor is encountered before DMA transfer finished (that means the total sector count of all PAD is less than the sector count of SD host), this bit will be set. - * | | |0 = No EOT encountered before DMA transfer finished. - * | | |1 = EOT encountered before DMA transfer finished. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::GCTL - * Offset: 0x800 Global Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset SD host - * | | |The contents of control register will not be cleared - * | | |This bit will auto cleared after reset complete. - * |[1] |SDEN |Secure Digital Functionality Enable Bit - * | | |0 = SD functionality disabled. - * | | |1 = SD functionality enabled. - * @var SDH_T::GINTEN - * Offset: 0x804 Global Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIEN |DMA READ/WRITE Target Abort Interrupt Enable Bit - * | | |0 = DMA READ/WRITE target abort interrupt generation disabled. - * | | |1 = DMA READ/WRITE target abort interrupt generation enabled. - * @var SDH_T::GINTSTS - * Offset: 0x808 Global Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIF |DMA READ/WRITE Target Abort Interrupt Flag (Read Only) - * | | |This bit indicates DMA received an ERROR response from internal AHB bus during DMA read/write operation - * | | |When Target Abort is occurred, please reset all engine. - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::CTL - * Offset: 0x820 SD Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |COEN |Command Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output a command to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[1] |RIEN |Response Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[2] |DIEN |Data Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive block data and the CRC16 value from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[3] |DOEN |Data Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will transfer block data and the CRC16 value to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[4] |R2EN |Response R2 Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response R2 from SD card and store the response data into DMC's flash buffer (exclude CRC7). - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[5] |CLK74OEN |Initial 74 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 74 clock cycles to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[6] |CLK8OEN |Generating 8 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 8 clock cycles. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[7] |CLKKEEP |SD Clock Enable Control - * | | |0 = SD host decided when to output clock and when to disable clock output automatically. - * | | |1 = SD clock always keeps free running. - * |[13:8] |CMDCODE |SD Command Code - * | | |This register contains the SD command code (0x00 - 0x3F). - * |[14] |CTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset the internal state machine and counters - * | | |The contents of control register will not be cleared (but RIEN, DIEN, DOEN and R2_EN will be cleared) - * | | |This bit will be auto cleared after few clock cycles. - * |[15] |DBW |SD Data Bus Width (for 1-bit / 4-bit Selection) - * | | |0 = Data bus width is 1-bit. - * | | |1 = Data bus width is 4-bit. - * |[23:16] |BLKCNT |Block Counts to Be Transferred or Received - * | | |This field contains the block counts for data-in and data-out transfer - * | | |For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, software can use this function to accelerate data transfer and improve performance - * | | |Don't fill 0x0 to this field. - * | | |Note: For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, the actual total length is BLKCNT * (BLKLEN +1). - * |[27:24] |SDNWR |NWR Parameter for Block Write Operation - * | | |This value indicates the NWR parameter for data block write operation in SD clock counts - * | | |The actual clock cycle will be SDNWR+1. - * @var SDH_T::CMDARG - * Offset: 0x824 SD Command Argument Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ARGUMENT |SD Command Argument - * | | |This register contains a 32-bit value specifies the argument of SD command from host controller to SD card - * | | |Before trigger COEN (SDH_CTL [0]), software should fill argument in this field. - * @var SDH_T::INTEN - * Offset: 0x828 SD Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIEN |Block Transfer Done Interrupt Enable Bit - * | | |0 = BLKDIF (SDH_INTEN[0]) trigger interrupt Disable. - * | | |1 = BLKDIF (SDH_INTEN[0]) trigger interrupt Enabled. - * |[1] |CRCIEN |CRC7, CRC16 and CRC Status Error Interrupt Enable Bit - * | | |0 = CRCIF (SDH_INTEN[1]) trigger interrupt Disable. - * | | |1 = CRCIF (SDH_INTEN[1]) trigger interrupt Enabled. - * |[8] |CDIEN |SD Card Detection Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when card is inserted or removed. - * | | |0 = CDIF (SDH_INTEN[8]) trigger interrupt Disable. - * | | |1 = CDIF (SDH_INTEN[8]) trigger interrupt Enabled. - * |[12] |RTOIEN |Response Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when receiving response or R2 time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = RTOIF (SDH_INTEN[12]) trigger interrupt Disabled. - * | | |1 = RTOIF (SDH_INTEN[12]) trigger interrupt Enabled. - * |[13] |DITOIEN |Data Input Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when data input time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = DITOIF (SDH_INTEN[13]) trigger interrupt Disabled. - * | | |1 = DITOIF (SDH_INTEN[13]) trigger interrupt Enabled. - * |[14] |WKIEN |Wake-up Signal Generating Enable Bit - * | | |Enable/Disable wake-up signal generating of SD host when current using SD card issues an interrupt (wake-up) via DAT [1] to host. - * | | |0 = SD Card interrupt to wake-up chip Disabled. - * | | |1 = SD Card interrupt to wake-up chip Enabled. - * |[30] |CDSRC |SD Card Detect Source Selection - * | | |0 = From SD card's DAT3 pin. - * | | |Host need clock to got data on pin DAT3 - * | | |Please make sure CLKKEEP (SDH_CTL[7]) is 1 in order to generate free running clock for DAT3 pin. - * | | |1 = From GPIO pin. - * @var SDH_T::INTSTS - * Offset: 0x82C SD Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIF |Block Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has finished all data-in or data-out block transfer - * | | |If there is a CRC16 error or incorrect CRC status during multiple block data transfer, the transfer will be broken and this bit will also be set. - * | | |0 = Not finished yet. - * | | |1 = Done. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[1] |CRCIF |CRC7, CRC16 and CRC Status Error Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has occurred CRC error during response in, data-in or data-out (CRC status error) transfer - * | | |When CRC error is occurred, software should reset SD engine - * | | |Some response (ex - * | | |R3) doesn't have CRC7 information with it; SD host will still calculate CRC7, get CRC error and set this flag - * | | |In this condition, software should ignore CRC error and clears this bit manually. - * | | |0 = No CRC error is occurred. - * | | |1 = CRC error is occurred. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[2] |CRC7 |CRC7 Check Status (Read Only) - * | | |SD host will check CRC7 correctness during each response in - * | | |If that response does not contain CRC7 information (ex - * | | |R3), then software should turn off CRCIEN (SDH_INTEN[1]) and ignore this bit. - * | | |0 = Fault. - * | | |1 = OK. - * |[3] |CRC16 |CRC16 Check Status of Data-in Transfer (Read Only) - * | | |SD host will check CRC16 correctness after data-in transfer. - * | | |0 = Fault. - * | | |1 = OK. - * |[6:4] |CRCSTS |CRC Status Value of Data-out Transfer (Read Only) - * | | |SD host will record CRC status of data-out transfer - * | | |Software could use this value to identify what type of error is during data-out transfer. - * | | |010 = Positive CRC status. - * | | |101 = Negative CRC status. - * | | |111 = SD card programming error occurs. - * |[7] |DAT0STS |DAT0 Pin Status of Current Selected SD Port (Read Only) - * | | |This bit is the DAT0 pin status of current selected SD port. - * |[8] |CDIF |SD Card Detection Interrupt Flag (Read Only) - * | | |This bit indicates that SD card is inserted or removed - * | | |Only when CDIEN (SDH_INTEN[8]) is set to 1, this bit is active. - * | | |0 = No card is inserted or removed. - * | | |1 = There is a card inserted in or removed from SD. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[12] |RTOIF |Response Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving response or R2 (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Response time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[13] |DITOIF |Data Input Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving data (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Data input time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[16] |CDSTS |Card Detect Status of SD (Read Only) - * | | |This bit indicates the card detect pin status of SD, and is used for card detection - * | | |When there is a card inserted in or removed from SD, software should check this bit to confirm if there is really a card insertion or removal. - * | | |If CDSRC (SDH_INTEN[30]) = 0, to select DAT3 for card detection:. - * | | |0 = Card removed. - * | | |1 = Card inserted. - * | | |If CDSRC (SDH_INTEN[30]) = 1, to select GPIO for card detection:. - * | | |0 = Card inserted. - * | | |1 = Card removed. - * |[18] |DAT1STS |DAT1 Pin Status of SD Port (Read Only) - * | | |This bit indicates the DAT1 pin status of SD port. - * @var SDH_T::RESP0 - * Offset: 0x830 SD Receiving Response Token Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RESPTK0 |SD Receiving Response Token 0 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This field contains response bit 47-16 of the response token. - * @var SDH_T::RESP1 - * Offset: 0x834 SD Receiving Response Token Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RESPTK1 |SD Receiving Response Token 1 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This register contains the bit 15-8 of the response token. - * @var SDH_T::BLEN - * Offset: 0x838 SD Block Length Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |BLKLEN |SD BLOCK LENGTH in Byte Unit - * | | |An 11-bit value specifies the SD transfer byte count of a block - * | | |The actual byte count is equal to BLKLEN+1. - * | | |Note: The default SD block length is 512 bytes - * @var SDH_T::TOUT - * Offset: 0x83C SD Response/Data-in Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |TOUT |SD Response/Data-in Time-out Value - * | | |A 24-bit value specifies the time-out counts of response and data input - * | | |SD host controller will wait start bit of response or data-in until this value reached - * | | |The time period depends on SD engine clock frequency - * | | |Do not write a small number into this field, or you may never get response or data due to time-out. - * | | |Note: Filling 0x0 into this field will disable hardware time-out function. - */ - - __IO uint32_t FB[32]; /*!< Shared Buffer (FIFO) */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[224]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMACTL; /*!< [0x0400] DMA Control and Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMASA; /*!< [0x0408] DMA Transfer Starting Address Register */ - __I uint32_t DMABCNT; /*!< [0x040c] DMA Transfer Byte Count Register */ - __IO uint32_t DMAINTEN; /*!< [0x0410] DMA Interrupt Enable Control Register */ - __IO uint32_t DMAINTSTS; /*!< [0x0414] DMA Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[250]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t GCTL; /*!< [0x0800] Global Control and Status Register */ - __IO uint32_t GINTEN; /*!< [0x0804] Global Interrupt Control Register */ - __I uint32_t GINTSTS; /*!< [0x0808] Global Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL; /*!< [0x0820] SD Control and Status Register */ - __IO uint32_t CMDARG; /*!< [0x0824] SD Command Argument Register */ - __IO uint32_t INTEN; /*!< [0x0828] SD Interrupt Control Register */ - __IO uint32_t INTSTS; /*!< [0x082c] SD Interrupt Status Register */ - __I uint32_t RESP0; /*!< [0x0830] SD Receiving Response Token Register 0 */ - __I uint32_t RESP1; /*!< [0x0834] SD Receiving Response Token Register 1 */ - __IO uint32_t BLEN; /*!< [0x0838] SD Block Length Register */ - __IO uint32_t TOUT; /*!< [0x083c] SD Response/Data-in Time-out Register */ - __IO uint32_t ECTL; /*!< [0x0840] SD Host Extend Control Register */ - -} SDH_T; - - -/** - @addtogroup SDH_CONST SDH Bit Field Definition - Constant Definitions for SDH Controller -@{ */ - -#define SDH_DMACTL_DMAEN_Pos (0) /*!< SDH_T::DMACTL: DMAEN Position */ -#define SDH_DMACTL_DMAEN_Msk (0x1ul << SDH_DMACTL_DMAEN_Pos) /*!< SDH_T::DMACTL: DMAEN Mask */ - -#define SDH_DMACTL_DMARST_Pos (1) /*!< SDH_T::DMACTL: DMARST Position */ -#define SDH_DMACTL_DMARST_Msk (0x1ul << SDH_DMACTL_DMARST_Pos) /*!< SDH_T::DMACTL: DMARST Mask */ - -#define SDH_DMACTL_SGEN_Pos (3) /*!< SDH_T::DMACTL: SGEN Position */ -#define SDH_DMACTL_SGEN_Msk (0x1ul << SDH_DMACTL_SGEN_Pos) /*!< SDH_T::DMACTL: SGEN Mask */ - -#define SDH_DMACTL_DMABUSY_Pos (9) /*!< SDH_T::DMACTL: DMABUSY Position */ -#define SDH_DMACTL_DMABUSY_Msk (0x1ul << SDH_DMACTL_DMABUSY_Pos) /*!< SDH_T::DMACTL: DMABUSY Mask */ - -#define SDH_DMASA_ORDER_Pos (0) /*!< SDH_T::DMASA: ORDER Position */ -#define SDH_DMASA_ORDER_Msk (0x1ul << SDH_DMASA_ORDER_Pos) /*!< SDH_T::DMASA: ORDER Mask */ - -#define SDH_DMASA_DMASA_Pos (1) /*!< SDH_T::DMASA: DMASA Position */ -#define SDH_DMASA_DMASA_Msk (0x7ffffffful << SDH_DMASA_DMASA_Pos) /*!< SDH_T::DMASA: DMASA Mask */ - -#define SDH_DMABCNT_BCNT_Pos (0) /*!< SDH_T::DMABCNT: BCNT Position */ -#define SDH_DMABCNT_BCNT_Msk (0x3fffffful << SDH_DMABCNT_BCNT_Pos) /*!< SDH_T::DMABCNT: BCNT Mask */ - -#define SDH_DMAINTEN_ABORTIEN_Pos (0) /*!< SDH_T::DMAINTEN: ABORTIEN Position */ -#define SDH_DMAINTEN_ABORTIEN_Msk (0x1ul << SDH_DMAINTEN_ABORTIEN_Pos) /*!< SDH_T::DMAINTEN: ABORTIEN Mask */ - -#define SDH_DMAINTEN_WEOTIEN_Pos (1) /*!< SDH_T::DMAINTEN: WEOTIEN Position */ -#define SDH_DMAINTEN_WEOTIEN_Msk (0x1ul << SDH_DMAINTEN_WEOTIEN_Pos) /*!< SDH_T::DMAINTEN: WEOTIEN Mask */ - -#define SDH_DMAINTSTS_ABORTIF_Pos (0) /*!< SDH_T::DMAINTSTS: ABORTIF Position */ -#define SDH_DMAINTSTS_ABORTIF_Msk (0x1ul << SDH_DMAINTSTS_ABORTIF_Pos) /*!< SDH_T::DMAINTSTS: ABORTIF Mask */ - -#define SDH_DMAINTSTS_WEOTIF_Pos (1) /*!< SDH_T::DMAINTSTS: WEOTIF Position */ -#define SDH_DMAINTSTS_WEOTIF_Msk (0x1ul << SDH_DMAINTSTS_WEOTIF_Pos) /*!< SDH_T::DMAINTSTS: WEOTIF Mask */ - -#define SDH_GCTL_GCTLRST_Pos (0) /*!< SDH_T::GCTL: GCTLRST Position */ -#define SDH_GCTL_GCTLRST_Msk (0x1ul << SDH_GCTL_GCTLRST_Pos) /*!< SDH_T::GCTL: GCTLRST Mask */ - -#define SDH_GCTL_SDEN_Pos (1) /*!< SDH_T::GCTL: SDEN Position */ -#define SDH_GCTL_SDEN_Msk (0x1ul << SDH_GCTL_SDEN_Pos) /*!< SDH_T::GCTL: SDEN Mask */ - -#define SDH_GINTEN_DTAIEN_Pos (0) /*!< SDH_T::GINTEN: DTAIEN Position */ -#define SDH_GINTEN_DTAIEN_Msk (0x1ul << SDH_GINTEN_DTAIEN_Pos) /*!< SDH_T::GINTEN: DTAIEN Mask */ - -#define SDH_GINTSTS_DTAIF_Pos (0) /*!< SDH_T::GINTSTS: DTAIF Position */ -#define SDH_GINTSTS_DTAIF_Msk (0x1ul << SDH_GINTSTS_DTAIF_Pos) /*!< SDH_T::GINTSTS: DTAIF Mask */ - -#define SDH_CTL_COEN_Pos (0) /*!< SDH_T::CTL: COEN Position */ -#define SDH_CTL_COEN_Msk (0x1ul << SDH_CTL_COEN_Pos) /*!< SDH_T::CTL: COEN Mask */ - -#define SDH_CTL_RIEN_Pos (1) /*!< SDH_T::CTL: RIEN Position */ -#define SDH_CTL_RIEN_Msk (0x1ul << SDH_CTL_RIEN_Pos) /*!< SDH_T::CTL: RIEN Mask */ - -#define SDH_CTL_DIEN_Pos (2) /*!< SDH_T::CTL: DIEN Position */ -#define SDH_CTL_DIEN_Msk (0x1ul << SDH_CTL_DIEN_Pos) /*!< SDH_T::CTL: DIEN Mask */ - -#define SDH_CTL_DOEN_Pos (3) /*!< SDH_T::CTL: DOEN Position */ -#define SDH_CTL_DOEN_Msk (0x1ul << SDH_CTL_DOEN_Pos) /*!< SDH_T::CTL: DOEN Mask */ - -#define SDH_CTL_R2EN_Pos (4) /*!< SDH_T::CTL: R2EN Position */ -#define SDH_CTL_R2EN_Msk (0x1ul << SDH_CTL_R2EN_Pos) /*!< SDH_T::CTL: R2EN Mask */ - -#define SDH_CTL_CLK74OEN_Pos (5) /*!< SDH_T::CTL: CLK74OEN Position */ -#define SDH_CTL_CLK74OEN_Msk (0x1ul << SDH_CTL_CLK74OEN_Pos) /*!< SDH_T::CTL: CLK74OEN Mask */ - -#define SDH_CTL_CLK8OEN_Pos (6) /*!< SDH_T::CTL: CLK8OEN Position */ -#define SDH_CTL_CLK8OEN_Msk (0x1ul << SDH_CTL_CLK8OEN_Pos) /*!< SDH_T::CTL: CLK8OEN Mask */ - -#define SDH_CTL_CLKKEEP0_Pos (7) /*!< SDH_T::CTL: CLKKEEP Position */ -#define SDH_CTL_CLKKEEP0_Msk (0x1ul << SDH_CTL_CLKKEEP0_Pos) /*!< SDH_T::CTL: CLKKEEP Mask */ - -#define SDH_CTL_CMDCODE_Pos (8) /*!< SDH_T::CTL: CMDCODE Position */ -#define SDH_CTL_CMDCODE_Msk (0x3ful << SDH_CTL_CMDCODE_Pos) /*!< SDH_T::CTL: CMDCODE Mask */ - -#define SDH_CTL_CTLRST_Pos (14) /*!< SDH_T::CTL: CTLRST Position */ -#define SDH_CTL_CTLRST_Msk (0x1ul << SDH_CTL_CTLRST_Pos) /*!< SDH_T::CTL: CTLRST Mask */ - -#define SDH_CTL_DBW_Pos (15) /*!< SDH_T::CTL: DBW Position */ -#define SDH_CTL_DBW_Msk (0x1ul << SDH_CTL_DBW_Pos) /*!< SDH_T::CTL: DBW Mask */ - -#define SDH_CTL_BLKCNT_Pos (16) /*!< SDH_T::CTL: BLKCNT Position */ -#define SDH_CTL_BLKCNT_Msk (0xfful << SDH_CTL_BLKCNT_Pos) /*!< SDH_T::CTL: BLKCNT Mask */ - -#define SDH_CTL_SDNWR_Pos (24) /*!< SDH_T::CTL: SDNWR Position */ -#define SDH_CTL_SDNWR_Msk (0xful << SDH_CTL_SDNWR_Pos) /*!< SDH_T::CTL: SDNWR Mask */ - -#define SDH_CTL_SDPORT_Pos (29) /*!< SDH CTL: SDPORT Position */ -#define SDH_CTL_SDPORT_Msk (0x3ul << SDH_CTL_SDPORT_Pos) /*!< SDH CTL: SDPORT Mask */ - -#define SDH_CTL_CLKKEEP1_Pos (31) /*!< SDH CTL: CLKKEEP1 Position */ -#define SDH_CTL_CLKKEEP1_Msk (0x1ul << SDH_CTL_CLKKEEP1_Pos) /*!< SDH CTL: CLKKEEP1 Mask */ - -#define SDH_CMDARG_ARGUMENT_Pos (0) /*!< SDH_T::CMDARG: ARGUMENT Position */ -#define SDH_CMDARG_ARGUMENT_Msk (0xfffffffful << SDH_CMDARG_ARGUMENT_Pos) /*!< SDH_T::CMDARG: ARGUMENT Mask */ - -#define SDH_INTEN_BLKDIEN_Pos (0) /*!< SDH_T::INTEN: BLKDIEN Position */ -#define SDH_INTEN_BLKDIEN_Msk (0x1ul << SDH_INTEN_BLKDIEN_Pos) /*!< SDH_T::INTEN: BLKDIEN Mask */ - -#define SDH_INTEN_CRCIEN_Pos (1) /*!< SDH_T::INTEN: CRCIEN Position */ -#define SDH_INTEN_CRCIEN_Msk (0x1ul << SDH_INTEN_CRCIEN_Pos) /*!< SDH_T::INTEN: CRCIEN Mask */ - -#define SDH_INTEN_CDIEN_Pos (8) /*!< SDH_T::INTEN: CDIEN Position */ -#define SDH_INTEN_CDIEN_Msk (0x1ul << SDH_INTEN_CDIEN_Pos) /*!< SDH_T::INTEN: CDIEN Mask */ - -#define SDH_INTEN_CDIEN1_Pos (9) /*!< SDH INTEN: CDIEN1 Position */ -#define SDH_INTEN_CDIEN1_Msk (0x1ul << SDH_INTEN_CDIEN1_Pos) /*!< SDH INTEN: CDIEN1 Mask */ - -#define SDH_INTEN_SDHOST0IEN_Pos (10) /*!< SDH INTSTS: SDHOST0IEN Position */ -#define SDH_INTEN_SDHOST0IEN_Msk (0x1ul << SDH_INTEN_SDHOST0IEN_Pos) /*!< SDH INTSTS: SDHOST0IEN Mask */ - -#define SDH_INTEN_SDHOST1IEN_Pos (11) /*!< SDH INTSTS: SDHOST1IEN Position */ -#define SDH_INTEN_SDHOST1IEN_Msk (0x1ul << SDH_INTEN_SDHOST1IEN_Pos) /*!< SDH INTSTS: SDHOST1IEN Mask */ - -#define SDH_INTEN_RTOIEN_Pos (12) /*!< SDH INTEN: RTOIEN Position */ -#define SDH_INTEN_RTOIEN_Msk (0x1ul << SDH_INTEN_RTOIEN_Pos) /*!< SDH INTEN: RTOIEN Mask */ - -#define SDH_INTEN_DITOIEN_Pos (13) /*!< SDH_T::INTEN: DITOIEN Position */ -#define SDH_INTEN_DITOIEN_Msk (0x1ul << SDH_INTEN_DITOIEN_Pos) /*!< SDH_T::INTEN: DITOIEN Mask */ - -#define SDH_INTEN_WKIEN_Pos (14) /*!< SDH_T::INTEN: WKIEN Position */ -#define SDH_INTEN_WKIEN_Msk (0x1ul << SDH_INTEN_WKIEN_Pos) /*!< SDH_T::INTEN: WKIEN Mask */ - -#define SDH_INTEN_CDSRC_Pos (30) /*!< SDH_T::INTEN: CDSRC Position */ -#define SDH_INTEN_CDSRC_Msk (0x1ul << SDH_INTEN_CDSRC_Pos) /*!< SDH_T::INTEN: CDSRC Mask */ - -#define SDH_INTEN_CDSRC1_Pos (31) /*!< SDH INTEN: CDSRC1 Position */ -#define SDH_INTEN_CDSRC1_Msk (0x1ul << SDH_INTEN_CDSRC1_Pos) /*!< SDH INTEN: CDSRC1 Mask */ - -#define SDH_INTSTS_BLKDIF_Pos (0) /*!< SDH_T::INTSTS: BLKDIF Position */ -#define SDH_INTSTS_BLKDIF_Msk (0x1ul << SDH_INTSTS_BLKDIF_Pos) /*!< SDH_T::INTSTS: BLKDIF Mask */ - -#define SDH_INTSTS_CRCIF_Pos (1) /*!< SDH_T::INTSTS: CRCIF Position */ -#define SDH_INTSTS_CRCIF_Msk (0x1ul << SDH_INTSTS_CRCIF_Pos) /*!< SDH_T::INTSTS: CRCIF Mask */ - -#define SDH_INTSTS_CRC7_Pos (2) /*!< SDH_T::INTSTS: CRC7 Position */ -#define SDH_INTSTS_CRC7_Msk (0x1ul << SDH_INTSTS_CRC7_Pos) /*!< SDH_T::INTSTS: CRC7 Mask */ - -#define SDH_INTSTS_CRC16_Pos (3) /*!< SDH_T::INTSTS: CRC16 Position */ -#define SDH_INTSTS_CRC16_Msk (0x1ul << SDH_INTSTS_CRC16_Pos) /*!< SDH_T::INTSTS: CRC16 Mask */ - -#define SDH_INTSTS_CRCSTS_Pos (4) /*!< SDH_T::INTSTS: CRCSTS Position */ -#define SDH_INTSTS_CRCSTS_Msk (0x7ul << SDH_INTSTS_CRCSTS_Pos) /*!< SDH_T::INTSTS: CRCSTS Mask */ - -#define SDH_INTSTS_DAT0STS_Pos (7) /*!< SDH_T::INTSTS: DAT0STS Position */ -#define SDH_INTSTS_DAT0STS_Msk (0x1ul << SDH_INTSTS_DAT0STS_Pos) /*!< SDH_T::INTSTS: DAT0STS Mask */ - -#define SDH_INTSTS_CDIF_Pos (8) /*!< SDH_T::INTSTS: CDIF Position */ -#define SDH_INTSTS_CDIF_Msk (0x1ul << SDH_INTSTS_CDIF_Pos) /*!< SDH_T::INTSTS: CDIF Mask */ - -#define SDH_INTSTS_CDIF1_Pos (9) /*!< SDH INTSTS: CDIF1 Position */ -#define SDH_INTSTS_CDIF1_Msk (0x1ul << SDH_INTSTS_CDIF1_Pos) /*!< SDH INTSTS: CDIF1 Mask */ - -#define SDH_INTSTS_SDHOST0IF_Pos (10) /*!< SDH INTSTS: SDHOST0IF Position */ -#define SDH_INTSTS_SDHOST0IF_Msk (0x1ul << SDH_INTSTS_SDHOST0IF_Pos) /*!< SDH INTSTS: SDHOST0IF Mask */ - -#define SDH_INTSTS_SDHOST1IF_Pos (11) /*!< SDH INTSTS: SDHOST1IF Position */ -#define SDH_INTSTS_SDHOST1IF_Msk (0x1ul << SDH_INTSTS_SDHOST1IF_Pos) /*!< SDH INTSTS: SDHOST1IF Mask */ - -#define SDH_INTSTS_RTOIF_Pos (12) /*!< SDH_T::INTSTS: RTOIF Position */ -#define SDH_INTSTS_RTOIF_Msk (0x1ul << SDH_INTSTS_RTOIF_Pos) /*!< SDH_T::INTSTS: RTOIF Mask */ - -#define SDH_INTSTS_DITOIF_Pos (13) /*!< SDH_T::INTSTS: DITOIF Position */ -#define SDH_INTSTS_DITOIF_Msk (0x1ul << SDH_INTSTS_DITOIF_Pos) /*!< SDH_T::INTSTS: DITOIF Mask */ - -#define SDH_INTSTS_CDSTS_Pos (16) /*!< SDH_T::INTSTS: CDSTS Position */ -#define SDH_INTSTS_CDSTS_Msk (0x1ul << SDH_INTSTS_CDSTS_Pos) /*!< SDH_T::INTSTS: CDSTS Mask */ - -#define SDH_INTSTS_CDSTS1_Pos (17) /*!< SDH INTSTS: CDSTS1 Position */ -#define SDH_INTSTS_CDSTS1_Msk (0x1ul << SDH_INTSTS_CDSTS1_Pos) /*!< SDH INTSTS: CDSTS1 Mask */ - -#define SDH_INTSTS_DAT1STS_Pos (18) /*!< SDH_T::INTSTS: DAT1STS Position */ -#define SDH_INTSTS_DAT1STS_Msk (0x1ul << SDH_INTSTS_DAT1STS_Pos) /*!< SDH_T::INTSTS: DAT1STS Mask */ - -#define SDH_RESP0_RESPTK0_Pos (0) /*!< SDH_T::RESP0: RESPTK0 Position */ -#define SDH_RESP0_RESPTK0_Msk (0xfffffffful << SDH_RESP0_RESPTK0_Pos) /*!< SDH_T::RESP0: RESPTK0 Mask */ - -#define SDH_RESP1_RESPTK1_Pos (0) /*!< SDH_T::RESP1: RESPTK1 Position */ -#define SDH_RESP1_RESPTK1_Msk (0xfful << SDH_RESP1_RESPTK1_Pos) /*!< SDH_T::RESP1: RESPTK1 Mask */ - -#define SDH_BLEN_BLKLEN_Pos (0) /*!< SDH_T::BLEN: BLKLEN Position */ -#define SDH_BLEN_BLKLEN_Msk (0x7fful << SDH_BLEN_BLKLEN_Pos) /*!< SDH_T::BLEN: BLKLEN Mask */ - -#define SDH_TOUT_TOUT_Pos (0) /*!< SDH_T::TOUT: TOUT Position */ -#define SDH_TOUT_TOUT_Msk (0xfffffful << SDH_TOUT_TOUT_Pos) /*!< SDH_T::TOUT: TOUT Mask */ - -#define SDH_ECTL_POWEROFF0_Pos (0) /*!< SDH_T::ECTL: POWEROFF0 Position */ -#define SDH_ECTL_POWEROFF0_Msk (0x1ul << SDH_ECTL_POWEROFF0_Pos) /*!< SDH_T::ECTL: POWEROFF0 Mask */ - -#define SDH_ECTL_POWEROFF1_Pos (1) /*!< SDH_T::ECTL: POWEROFF1 Position */ -#define SDH_ECTL_POWEROFF1_Msk (0x1ul << SDH_ECTL_POWEROFF1_Pos) /*!< SDH_T::ECTL: POWEROFF1 Mask */ - -/**@}*/ /* SDH_CONST */ -/**@}*/ /* end of SDH register group */ -/**@}*/ /* end of REGISTER group */ - -#define SDH0 ((SDH_T *) FMI_BA) -#define SDH1 ((SDH_T *) SDH_BA) - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup SDH_EXPORTED_CONSTANTS SDH Exported Constants - @{ -*/ - -#define SDH_ERR_ID 0xFFFF0100ul /*!< SDH error ID \hideinitializer */ - -#define SDH_TIMEOUT (SDH_ERR_ID|0x01ul) /*!< Timeout \hideinitializer */ -#define SDH_NO_MEMORY (SDH_ERR_ID|0x02ul) /*!< OOM \hideinitializer */ - -/*--- define type of SD card or MMC */ -#define SDH_TYPE_UNKNOWN 0ul /*!< Unknown card type \hideinitializer */ -#define SDH_TYPE_SD_HIGH 1ul /*!< SDHC card \hideinitializer */ -#define SDH_TYPE_SD_LOW 2ul /*!< SD card \hideinitializer */ -#define SDH_TYPE_MMC 3ul /*!< MMC card \hideinitializer */ -#define SDH_TYPE_EMMC 4ul /*!< eMMC card \hideinitializer */ - -/* SD error */ -#define SDH_NO_SD_CARD (SDH_ERR_ID|0x10ul) /*!< Card removed \hideinitializer */ -#define SDH_ERR_DEVICE (SDH_ERR_ID|0x11ul) /*!< Device error \hideinitializer */ -#define SDH_INIT_TIMEOUT (SDH_ERR_ID|0x12ul) /*!< Card init timeout \hideinitializer */ -#define SDH_SELECT_ERROR (SDH_ERR_ID|0x13ul) /*!< Card select error \hideinitializer */ -#define SDH_WRITE_PROTECT (SDH_ERR_ID|0x14ul) /*!< Card write protect \hideinitializer */ -#define SDH_INIT_ERROR (SDH_ERR_ID|0x15ul) /*!< Card init error \hideinitializer */ -#define SDH_CRC7_ERROR (SDH_ERR_ID|0x16ul) /*!< CRC 7 error \hideinitializer */ -#define SDH_CRC16_ERROR (SDH_ERR_ID|0x17ul) /*!< CRC 16 error \hideinitializer */ -#define SDH_CRC_ERROR (SDH_ERR_ID|0x18ul) /*!< CRC error \hideinitializer */ -#define SDH_CMD8_ERROR (SDH_ERR_ID|0x19ul) /*!< Command 8 error \hideinitializer */ - -#define MMC_FREQ 20000ul /*!< output 20MHz to MMC \hideinitializer */ -#define SD_FREQ 25000ul /*!< output 25MHz to SD \hideinitializer */ -#define SDHC_FREQ 50000ul /*!< output 50MHz to SDH \hideinitializer */ - -#define SD_PORT0 (1 << 0) /*!< Card select SD0 \hideinitializer */ -#define SD_PORT1 (1 << 2) /*!< Card select SD1 \hideinitializer */ -#define CardDetect_From_GPIO (1ul << 8) /*!< Card detection pin is GPIO \hideinitializer */ -#define CardDetect_From_DAT3 (1ul << 9) /*!< Card detection pin is DAT3 \hideinitializer */ - -/*@}*/ /* end of group N9H30_SDH_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_SDH_EXPORTED_TYPEDEF SDH Exported Type Defines - @{ -*/ - -/** \brief Structure type of inserted Card information. - */ -typedef struct SDH_info_t -{ - unsigned char IsCardInsert; /*!< Card insert state */ - unsigned char R3Flag; - unsigned char R7Flag; - unsigned char volatile DataReadyFlag; - unsigned int CardType; /*!< SDHC, SD, or MMC */ - unsigned int RCA; /*!< Relative card address */ - unsigned int totalSectorN; /*!< Total sector number */ - unsigned int diskSize; /*!< Disk size in K bytes */ - int sectorSize; /*!< Sector size in bytes */ - unsigned char *dmabuf; -} SDH_INFO_T; /*!< Structure holds SD card info */ - -/*@}*/ /* end of group N9H30_SDH_EXPORTED_TYPEDEF */ - -/// @cond HIDDEN_SYMBOLS - -/// @endcond HIDDEN_SYMBOLS - -/** @addtogroup N9H30_SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ - - -/** - * @brief Enable specified interrupt. - * - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN0_Msk / \ref SDH_INTEN_CDIEN1_Msk / - * \ref SDH_INTEN_CDSRC0_Msk / \ref SDH_INTEN_CDSRC1_Msk / \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / - * \ref SDH_INTEN_WKIEN_Msk - * - * @return None. - * \hideinitializer - */ -#define SDH_ENABLE_INT(sdh, u32IntMask) ((sdh)->INTEN |= (u32IntMask)) - -/** - * @brief Disable specified interrupt. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN0_Msk / \ref SDH_INTEN_CDIEN1_Msk / - * \ref SDH_INTEN_SDHOST0IEN_Msk / \ref SDH_INTEN_SDHOST1IEN_Msk / \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / - * \ref SDH_INTEN_WKIEN_Msk / \ref SDH_INTEN_CDSRC0_Msk / \ref SDH_INTEN_CDSRC1_Msk - * - * @return None. - * \hideinitializer - */ -#define SDH_DISABLE_INT(sdh, u32IntMask) ((sdh)->INTEN &= ~(u32IntMask)) - -/** - * @brief Get specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CRC7_Msk / - * \ref SDH_INTSTS_CRC16_Msk / \ref SDH_INTSTS_CRCSTS_Msk / \ref SDH_INTSTS_DAT0STS_Msk / \ref SDH_INTSTS_CDIF0_Msk / - * \ref SDH_INTSTS_CDIF1_Msk / \ref SDH_INTSTS_SDHOST0IF_Msk / \ref SDH_INTSTS_SDHOST1IF_Msk / \ref SDH_INTSTS_RTOIF_Msk / - * \ref SDH_INTSTS_DINTOIF_Msk / \ref SDH_INTSTS_CDSTS0_Msk / \ref SDH_INTSTS_CDSTS1_Msk / \ref SDH_INTSTS_DAT1STS_Msk - * - * - * @return 0 = The specified interrupt is not happened. - * 1 = The specified interrupt is happened. - * \hideinitializer - */ -#define SDH_GET_INT_FLAG(sdh, u32IntMask) (((sdh)->INTSTS & (u32IntMask))?1:0) - - -/** - * @brief Clear specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CDIF0_Msk / - * \ref SDH_INTSTS_CDIF1_Msk / \ref SDH_INTSTS_SDHOST0IF_Msk / \ref SDH_INTSTS_SDHOST1IF_Msk / - * \ref SDH_INTSTS_RTOIF_Msk / \ref SDH_INTSTS_DINTOIF_Msk - * - * - * @return None. - * \hideinitializer - */ -#define SDH_CLR_INT_FLAG(sdh, u32IntMask) ((sdh)->INTSTS = (u32IntMask)) - - -/** - * @brief Check SD Card inserted or removed. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return 1: Card inserted. - * 0: Card removed. - * \hideinitializer - */ -//#define SDH_IS_CARD_PRESENT(sdh) (((sdh) == SDH0)? SD0.IsCardInsert : SD1.IsCardInsert) - -/** - * @brief Get SD Card capacity. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return SD Card capacity. (unit: KByte) - * \hideinitializer - */ -//#define SDH_GET_CARD_CAPACITY(sdh) (((sdh) == SDH0)? SD0.diskSize : SD1.diskSize) - - -void SDH_Open(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t u32CardDetSrc); -uint32_t SDH_Probe(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t card_num); -uint32_t SDH_Read(SDH_T *sdh, SDH_INFO_T *pSD, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -uint32_t SDH_Write(SDH_T *sdh, SDH_INFO_T *pSD, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -void SDH_CardSelect(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t u32CardSrc); -uint32_t SDH_CardDetection(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t card_num); -void SDH_Open_Disk(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t u32CardDetSrc); -void SDH_Close_Disk(SDH_T *sdh, SDH_INFO_T *pSD); -uint32_t SDH_WhichCardIsSelected(SDH_T *sdh); - - -/*@}*/ /* end of group N9H30_SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_SDH_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#endif //end of __NU_SDH_H__ -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_spi.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_spi.h deleted file mode 100644 index 3cb1500f2a4..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_spi.h +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************//** -* @file spi.h -* @brief N9H30 SPI driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SPI_H__ -#define __NU_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup N9H30_SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ -/// @cond HIDDEN_SYMBOLS - -#define CNTRL 0x00 /*!< Control Register Address */ -#define DIVIDER 0x04 /*!< Divider Register Address */ -#define SSR 0x08 /*!< Slave Select Register Address */ -#define RX0 0x10 /*!< Receive Register 0 Address */ -#define RX1 0x14 /*!< Receive Register 1 Address */ -#define RX2 0x18 /*!< Receive Register 2 Address */ -#define RX3 0x1C /*!< Receive Register 3 Address */ -#define TX0 0x10 /*!< Transfer Register 0 Address */ -#define TX1 0x14 /*!< Transfer Register 1 Address */ -#define TX2 0x18 /*!< Transfer Register 2 Address */ -#define TX3 0x1C /*!< Transfer Register 3 Address */ - -#define SPI_INPUT_CLOCK (sysGetClock(SYS_PCLK)*1000000) /* Unit: Hz */ -/// @endcond HIDDEN_SYMBOLS - -#define SPI_NUMBER 2 /*!< 2 spi interfaces */ - -#define SPI_NO_ERR 0 /*!< No error */ - -#define SPI_ERR_NODEV -1 /*!< Wrong device id */ -#define SPI_ERR_BUSY -2 /*!< Interface is busy */ -#define SPI_ERR_IO -3 /*!< IO control error for not opened interface */ -#define SPI_ERR_ARG -4 /*!< Wrong argument in IO control */ - -#define SPI_IOC_TRIGGER 0 /*!< Trigger SPI interface */ -#define SPI_IOC_SET_INTERRUPT 1 /*!< Enable/disable interrupt ,arguments could be \ref SPI_DISABLE_INTERRUPT and \ref SPI_ENABLE_INTERRUPT */ -#define SPI_IOC_SET_SPEED 2 /*!< Set SPI clock speed */ -#define SPI_IOC_SET_DUAL_QUAD_MODE 3 /*!< Enable/disable Quad/Dual mode ,arguments could be \ref SPI_DISABLE_DUAL_QUAD, \ref SPI_DUAL_MODE, \ref SPI_QUAD_MODE*/ -#define SPI_IOC_SET_DUAL_QUAD_DIR 4 /*!< Set Quad/Dual mode direction ,arguments could be \ref SPI_DUAL_QUAD_INPUT, \ref SPI_DUAL_QUAD_OUTPUT */ -#define SPI_IOC_SET_LSB_MSB 5 /*!< Set MSB/LSB ,arguments could be \ref SPI_MSB, \ref SPI_LSB */ -#define SPI_IOC_SET_TX_NUM 6 /*!< Set transfer number */ -#define SPI_IOC_SET_TX_BITLEN 7 /*!< Set transfer bit number */ -#define SPI_IOC_SET_MODE 8 /*!< Set SPI mode ,arguments could be \ref SPI_MODE_0, \ref SPI_MODE_1, \ref SPI_MODE_2, \ref SPI_MODE_3 */ -#define SPI_IOC_ENABLE_SS 9 /*!< Enable slave select pin */ -#define SPI_IOC_DISABLE_SS 10 /*!< Disable slave select pin */ -#define SPI_IOC_SET_AUTOSS 11 /*!< Enable/disable auto slave select function ,arguments could be \ref SPI_DISABLE_AUTOSS, \ref SPI_ENABLE_AUTOSS */ -#define SPI_IOC_SET_SS_ACTIVE_LEVEL 12 /*!< Set slave select active level ,arguments could be \ref SPI_SS_ACTIVE_LOW, \ref SPI_SS_ACTIVE_HIGH */ - -#define SPI_DISABLE_INTERRUPT 0 /*!< Disable interrupt */ -#define SPI_ENABLE_INTERRUPT 1 /*!< Enable interrupt */ - -#define SPI_DISABLE_DUAL_QUAD 0 /*!< Disable quad and dual mode */ -#define SPI_DUAL_MODE 1 /*!< Enable dual mode */ -#define SPI_QUAD_MODE 2 /*!< Enable quad mode */ - -#define SPI_DUAL_QUAD_INPUT 0 /*!< Set dual/quad mode io direction to input */ -#define SPI_DUAL_QUAD_OUTPUT 1 /*!< Set dual/quad mode io direction to output */ - -#define SPI_MSB 0 /*!< Enable MSB */ -#define SPI_LSB 1 /*!< Enable LSB */ - -#define SPI_MODE_0 0 /*!< Set to SPI mode 0 */ -#define SPI_MODE_1 1 /*!< Set to SPI mode 1 */ -#define SPI_MODE_2 2 /*!< Set to SPI mode 2 */ -#define SPI_MODE_3 3 /*!< Set to SPI mode 3 */ - -#define SPI_SS_SS0 0 /*!< Select SS0 */ -#define SPI_SS_SS1 1 /*!< Select SS1 */ -#define SPI_SS_BOTH 2 /*!< Select both SS0/SS1 */ - -#define SPI_DISABLE_AUTOSS 0 /*!< Disable auto slave select function */ -#define SPI_ENABLE_AUTOSS 1 /*!< Enable auto slave select function */ - -#define SPI_SS_ACTIVE_LOW 0 /*!< Set active level of slave select to low */ -#define SPI_SS_ACTIVE_HIGH 1 /*!< Set active level of slave select to high */ - -/*@}*/ /* end of group N9H30_SPI_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ - -int32_t spiInit(int32_t fd); -int32_t spiIoctl(int32_t fd, uint32_t cmd, uint32_t arg0, uint32_t arg1); -int spiOpen(int32_t fd); -uint8_t spiGetBusyStatus(int32_t fd); -uint32_t spiRead(int32_t fd, uint8_t buff_id); -void spiWrite(int32_t fd, uint8_t buff_id, uint32_t data); -/*@}*/ /* end of group N9H30_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_SPI_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_SPI_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sys.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sys.h deleted file mode 100644 index 8a4cea517bc..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_sys.h +++ /dev/null @@ -1,373 +0,0 @@ -/**************************************************************************//** -* @file sys.h -* @brief N9H30 SYS driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_SYS_H__ -#define __NU_SYS_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_SYS_Driver SYS Driver - @{ -*/ - -/** @addtogroup N9H30_SYS_EXPORTED_CONSTANTS SYS Exported Constants - @{ -*/ - -/** - * @details Interrupt Number Definition. - */ -typedef enum IRQn -{ - - /****** N9H30 Specific Interrupt Numbers *****************************************/ - - WDT_IRQn = 1, /*!< Watch Dog Timer Interrupt */ - WWDT_IRQn = 2, /*!< Windowed-WDT Interrupt */ - LVD_IRQn = 3, /*!< Low Voltage Detect Interrupt */ - EINT0_IRQn = 4, /*!< External Interrupt 0 */ - EINT1_IRQn = 5, /*!< External Interrupt 1 */ - EINT2_IRQn = 6, /*!< External Interrupt 2 */ - EINT3_IRQn = 7, /*!< External Interrupt 3 */ - EINT4_IRQn = 8, /*!< External Interrupt 4 */ - EINT5_IRQn = 9, /*!< External Interrupt 5 */ - EINT6_IRQn = 10, /*!< External Interrupt 6 */ - EINT7_IRQn = 11, /*!< External Interrupt 7 */ - ACTL_IRQn = 12, /*!< Audio Controller Interrupt */ - LCD_IRQn = 13, /*!< LCD Controller Interrupt */ - CAP_IRQn = 14, /*!< Sensor Interface Controller Interrupt */ - RTC_IRQn = 15, /*!< Real Time Clock Interrupt */ - TMR0_IRQn = 16, /*!< Timer 0 Interrupt */ - TMR1_IRQn = 17, /*!< Timer 1 Interrupt */ - ADC_IRQn = 18, /*!< ADC Interrupt */ - EMC0_RX_IRQn = 19, /*!< EMC 0 RX Interrupt */ - EMC1_RX_IRQn = 20, /*!< EMC 1 RX Interrupt */ - EMC0_TX_IRQn = 21, /*!< EMC 0 TX Interrupt */ - EMC1_TX_IRQn = 22, /*!< EMC 1 TX Interrupt */ - EHCI_IRQn = 23, /*!< USB 2.0 Host Controller Interrupt */ - OHCI_IRQn = 24, /*!< USB 1.1 Host Controller Interrupt */ - GDMA0_IRQn = 25, /*!< GDMA Channel 0 Interrupt */ - GDMA1_IRQn = 26, /*!< GDMA Channel 1 Interrupt */ - SDH_IRQn = 27, /*!< SD/SDIO Host Interrupt */ - FMI_IRQn = 28, /*!< FMI Interrupt */ - USBD_IRQn = 29, /*!< USB Device Interrupt */ - TMR2_IRQn = 30, /*!< Timer 2 Interrupt */ - TMR3_IRQn = 31, /*!< Timer 3 Interrupt */ - TMR4_IRQn = 32, /*!< Timer 4 Interrupt */ - JPEG_IRQn = 33, /*!< JPEG Engine Interrupt */ - GE2D_IRQn = 34, /*!< 2D Graphic Engine Interrupt */ - CRPT_IRQn = 35, /*!< Cryptographic Accelerator Interrupt */ - UART0_IRQn = 36, /*!< UART 0 Interrupt */ - UART1_IRQn = 37, /*!< UART 1 Interrupt */ - UART2_IRQn = 38, /*!< UART 2 Interrupt */ - UART4_IRQn = 39, /*!< UART 4 Interrupt */ - UART6_IRQn = 40, /*!< UART 6 Interrupt */ - UART8_IRQn = 41, /*!< UART 8 Interrupt */ - UART10_IRQn = 42, /*!< UART 10 Interrupt */ - UART3_IRQn = 43, /*!< UART 3 Interrupt */ - UART5_IRQn = 44, /*!< UART 5 Interrupt */ - UART7_IRQn = 45, /*!< UART 7 Interrupt */ - UART9_IRQn = 46, /*!< UART 9 Interrupt */ - ETMR0_IRQn = 47, /*!< Enhanced Timer 0 Interrupt */ - ETMR1_IRQn = 48, /*!< Enhanced Timer 1 Interrupt */ - ETMR2_IRQn = 49, /*!< Enhanced Timer 2 Interrupt */ - ETMR3_IRQn = 50, /*!< Enhanced Timer 3 Interrupt */ - SPI0_IRQn = 51, /*!< SPI 0 Interrupt */ - SPI1_IRQn = 52, /*!< SPI 1 Interrupt */ - I2C0_IRQn = 53, /*!< I2C 0 Interrupt */ - I2C1_IRQn = 54, /*!< I2C 1 Interrupt */ - SC0_IRQn = 55, /*!< Smart Card 0 Interrupt */ - SC1_IRQn = 56, /*!< Smart Card 1 Interrupt */ - GPIO_IRQn = 57, /*!< GPIO Interrupt */ - CAN0_IRQn = 58, /*!< CAN 0 Interrupt */ - CAN1_IRQn = 59, /*!< CAN 1 Interrupt */ - PWM_IRQn = 60, /*!< PWM Interrupt */ - - /* Renaming for RTT porting */ - IRQ_WDT = 1, /*!< Watch Dog Timer Interrupt */ - IRQ_WWDT = 2, /*!< Windowed-WDT Interrupt */ - IRQ_LVD = 3, /*!< Low Voltage Detect Interrupt */ - IRQ_EINT0 = 4, /*!< External Interrupt 0 */ - IRQ_EINT1 = 5, /*!< External Interrupt 1 */ - IRQ_EINT2 = 6, /*!< External Interrupt 2 */ - IRQ_EINT3 = 7, /*!< External Interrupt 3 */ - IRQ_EINT4 = 8, /*!< External Interrupt 4 */ - IRQ_EINT5 = 9, /*!< External Interrupt 5 */ - IRQ_EINT6 = 10, /*!< External Interrupt 6 */ - IRQ_EINT7 = 11, /*!< External Interrupt 7 */ - IRQ_ACTL = 12, /*!< Audio Controller Interrupt */ - IRQ_LCD = 13, /*!< LCD Controller Interrupt */ - IRQ_CAP = 14, /*!< Sensor Interface Controller Interrupt */ - IRQ_RTC = 15, /*!< Real Time Clock Interrupt */ - IRQ_TMR0 = 16, /*!< Timer 0 Interrupt */ - IRQ_TMR1 = 17, /*!< Timer 1 Interrupt */ - IRQ_ADC = 18, /*!< ADC Interrupt */ - IRQ_EMC0_RX = 19, /*!< EMC 0 RX Interrupt */ - IRQ_EMC1_RX = 20, /*!< EMC 1 RX Interrupt */ - IRQ_EMC0_TX = 21, /*!< EMC 0 TX Interrupt */ - IRQ_EMC1_TX = 22, /*!< EMC 1 TX Interrupt */ - IRQ_EHCI = 23, /*!< USB 2.0 Host Controller Interrupt */ - IRQ_OHCI = 24, /*!< USB 1.1 Host Controller Interrupt */ - IRQ_GDMA0 = 25, /*!< GDMA Channel 0 Interrupt */ - IRQ_GDMA1 = 26, /*!< GDMA Channel 1 Interrupt */ - IRQ_SDH = 27, /*!< SD/SDIO Host Interrupt */ - IRQ_FMI = 28, /*!< FMI Interrupt */ - IRQ_USBD = 29, /*!< USB Device Interrupt */ - IRQ_TMR2 = 30, /*!< Timer 2 Interrupt */ - IRQ_TMR3 = 31, /*!< Timer 3 Interrupt */ - IRQ_TMR4 = 32, /*!< Timer 4 Interrupt */ - IRQ_JPEG = 33, /*!< JPEG Engine Interrupt */ - IRQ_GE2D = 34, /*!< 2D Graphic Engine Interrupt */ - IRQ_CRPT = 35, /*!< Cryptographic Accelerator Interrupt */ - IRQ_UART0 = 36, /*!< UART 0 Interrupt */ - IRQ_UART1 = 37, /*!< UART 1 Interrupt */ - IRQ_UART2 = 38, /*!< UART 2 Interrupt */ - IRQ_UART4 = 39, /*!< UART 4 Interrupt */ - IRQ_UART6 = 40, /*!< UART 6 Interrupt */ - IRQ_UART8 = 41, /*!< UART 8 Interrupt */ - IRQ_UART10 = 42, /*!< UART 10 Interrupt */ - IRQ_UART3 = 43, /*!< UART 3 Interrupt */ - IRQ_UART5 = 44, /*!< UART 5 Interrupt */ - IRQ_UART7 = 45, /*!< UART 7 Interrupt */ - IRQ_UART9 = 46, /*!< UART 9 Interrupt */ - IRQ_ETMR0 = 47, /*!< Enhanced Timer 0 Interrupt */ - IRQ_ETMR1 = 48, /*!< Enhanced Timer 1 Interrupt */ - IRQ_ETMR2 = 49, /*!< Enhanced Timer 2 Interrupt */ - IRQ_ETMR3 = 50, /*!< Enhanced Timer 3 Interrupt */ - IRQ_SPI0 = 51, /*!< SPI 0 Interrupt */ - IRQ_SPI1 = 52, /*!< SPI 1 Interrupt */ - IRQ_I2C0 = 53, /*!< I2C 0 Interrupt */ - IRQ_I2C1 = 54, /*!< I2C 1 Interrupt */ - IRQ_SC0 = 55, /*!< Smart Card 0 Interrupt */ - IRQ_SC1 = 56, /*!< Smart Card 1 Interrupt */ - IRQ_GPIO = 57, /*!< GPIO Interrupt */ - IRQ_CAN0 = 58, /*!< CAN 0 Interrupt */ - IRQ_CAN1 = 59, /*!< CAN 1 Interrupt */ - IRQ_PWM = 60, /*!< PWM Interrupt */ -} -IRQn_Type; - -/* Define constants for use timer in service parameters. */ -#define TIMER0 0 /*!< Select Timer0 */ -#define TIMER1 1 /*!< Select Timer1 */ - -#define ONE_SHOT_MODE 0 /*!< Timer Operation Mode - One Shot */ -#define PERIODIC_MODE 1 /*!< Timer Operation Mode - Periodic */ -#define TOGGLE_MODE 2 /*!< Timer Operation Mode - Toggle */ - -/* The parameters for sysSetInterruptPriorityLevel() and - sysInstallISR() use */ -#define FIQ_LEVEL_0 0 /*!< FIQ Level 0 */ -#define IRQ_LEVEL_1 1 /*!< IRQ Level 1 */ -#define IRQ_LEVEL_2 2 /*!< IRQ Level 2 */ -#define IRQ_LEVEL_3 3 /*!< IRQ Level 3 */ -#define IRQ_LEVEL_4 4 /*!< IRQ Level 4 */ -#define IRQ_LEVEL_5 5 /*!< IRQ Level 5 */ -#define IRQ_LEVEL_6 6 /*!< IRQ Level 6 */ -#define IRQ_LEVEL_7 7 /*!< IRQ Level 7 */ - -#define ONE_HALF_SECS 0 /*!< WDT interval - 1.5s */ -#define FIVE_SECS 1 /*!< WDT interval - 5s */ -#define TEN_SECS 2 /*!< WDT interval - 10s */ -#define TWENTY_SECS 3 /*!< WDT interval - 20s */ - -/* Define constants for use AIC in service parameters. */ -#define SYS_SWI 0 /*!< Exception - SWI */ -#define SYS_D_ABORT 1 /*!< Exception - Data abort */ -#define SYS_I_ABORT 2 /*!< Exception - Instruction abort */ -#define SYS_UNDEFINE 3 /*!< Exception - undefine */ - -/* The parameters for sysSetLocalInterrupt() use */ -#define ENABLE_IRQ 0x7F /*!< Enable I-bit of CP15 */ -#define ENABLE_FIQ 0xBF /*!< Enable F-bit of CP15 */ -#define ENABLE_FIQ_IRQ 0x3F /*!< Enable I-bit and F-bit of CP15 */ -#define DISABLE_IRQ 0x80 /*!< Disable I-bit of CP15 */ -#define DISABLE_FIQ 0x40 /*!< Disable F-bit of CP15 */ -#define DISABLE_FIQ_IRQ 0xC0 /*!< Disable I-bit and F-bit of CP15 */ - -/* Define Cache type */ -#define CACHE_WRITE_BACK 0 /*!< Cache Write-back mode */ -#define CACHE_WRITE_THROUGH 1 /*!< Cache Write-through mode */ -#define CACHE_DISABLE -1 /*!< Cache Disable */ - -/** \brief Structure type of clock source - */ -typedef enum CLKn -{ - - SYS_UPLL = 1, /*!< UPLL clock */ - SYS_APLL = 2, /*!< APLL clock */ - SYS_SYSTEM = 3, /*!< System clock */ - SYS_HCLK1 = 4, /*!< HCLK1 clock */ - SYS_HCLK234 = 5, /*!< HCLK234 clock */ - SYS_PCLK = 6, /*!< PCLK clock */ - SYS_CPU = 7, /*!< CPU clock */ - -} CLK_Type; - - - -/// @cond HIDDEN_SYMBOLS -typedef struct datetime_t -{ - UINT32 year; - UINT32 mon; - UINT32 day; - UINT32 hour; - UINT32 min; - UINT32 sec; -} DateTime_T; - -/* The parameters for sysSetInterruptType() use */ -#define LOW_LEVEL_SENSITIVE 0x00 -#define HIGH_LEVEL_SENSITIVE 0x40 -#define NEGATIVE_EDGE_TRIGGER 0x80 -#define POSITIVE_EDGE_TRIGGER 0xC0 - -/* The parameters for sysSetGlobalInterrupt() use */ -#define ENABLE_ALL_INTERRUPTS 0 -#define DISABLE_ALL_INTERRUPTS 1 - -#define MMU_DIRECT_MAPPING 0 -#define MMU_INVERSE_MAPPING 1 - - -/* Define constants for use Cache in service parameters. */ -#define CACHE_4M 2 -#define CACHE_8M 3 -#define CACHE_16M 4 -#define CACHE_32M 5 -#define I_CACHE 6 -#define D_CACHE 7 -#define I_D_CACHE 8 - - -/** - * @brief Disable register write-protection function - * @param None - * @return None - * @details This function disable register write-protection function. - * To unlock the protected register to allow write access. - */ -static __inline void SYS_UnlockReg(void) -{ - do - { - outpw(0xB00001FC, 0x59UL); - outpw(0xB00001FC, 0x16UL); - outpw(0xB00001FC, 0x88UL); - } - while (inpw(0xB00001FC) == 0UL); -} - -/** - * @brief Enable register write-protection function - * @param None - * @return None - * @details This function is used to enable register write-protection function. - * To lock the protected register to forbid write access. - */ -static __inline void SYS_LockReg(void) -{ - outpw(0xB00001FC, 0); -} - - -/// @endcond HIDDEN_SYMBOLS - -/*@}*/ /* end of group N9H30_SYS_EXPORTED_CONSTANTS */ - - -/** @addtogroup N9H30_SYS_EXPORTED_FUNCTIONS SYS Exported Functions - @{ -*/ - -/* Define system library Timer functions */ -UINT32 sysGetTicks(INT32 nTimeNo); -INT32 sysResetTicks(INT32 nTimeNo); -INT32 sysUpdateTickCount(INT32 nTimeNo, UINT32 uCount); -INT32 sysSetTimerReferenceClock(INT32 nTimeNo, UINT32 uClockRate); -INT32 sysStartTimer(INT32 nTimeNo, UINT32 uTicksPerSecond, INT32 nOpMode); -INT32 sysStopTimer(INT32 nTimeNo); -void sysClearWatchDogTimerCount(void); -void sysClearWatchDogTimerInterruptStatus(void); -void sysDisableWatchDogTimer(void); -void sysDisableWatchDogTimerReset(void); -void sysEnableWatchDogTimer(void); -void sysEnableWatchDogTimerReset(void); -PVOID sysInstallWatchDogTimerISR(INT32 nIntTypeLevel, PVOID pvNewISR); -INT32 sysSetWatchDogTimerInterval(INT32 nWdtInterval); -INT32 sysSetTimerEvent(INT32 nTimeNo, UINT32 uTimeTick, PVOID pvFun); -void sysClearTimerEvent(INT32 nTimeNo, UINT32 uTimeEventNo); -void sysSetLocalTime(DateTime_T ltime); /*!< Set local time \hideinitializer */ -void sysGetCurrentTime(DateTime_T *curTime); /*!< Get current time \hideinitializer */ -void sysDelay(UINT32 uTicks); - -/* Define system library UART functions */ -//INT8 sysGetChar(void); -//INT32 sysInitializeUART(void); -//void sysprintf(PINT8 pcStr, ...); -//void sysPutChar(UINT8 ucCh); -//INT sysIsKbHit(void); - -/* Define system library AIC functions */ -INT32 sysDisableInterrupt(IRQn_Type eIntNo); -INT32 sysEnableInterrupt(IRQn_Type eIntNo); -BOOL sysGetIBitState(void); /*!< Get I bit state \hideinitializer */ -UINT32 sysGetInterruptEnableStatus(void); /*!< Get interrupt enable status \hideinitializer */ -UINT32 sysGetInterruptEnableStatusH(void); /*!< Get interrupt enable status \hideinitializer */ -PVOID sysInstallExceptionHandler(INT32 nExceptType, PVOID pvNewHandler); -PVOID sysInstallFiqHandler(PVOID pvNewISR); -PVOID sysInstallIrqHandler(PVOID pvNewISR); -PVOID sysInstallISR(INT32 nIntTypeLevel, IRQn_Type eIntNo, PVOID pvNewISR); -INT32 sysSetGlobalInterrupt(INT32 nIntState); /*!< Enable/Disable all interrupt \hideinitializer */ -INT32 sysSetInterruptPriorityLevel(IRQn_Type eIntNo, UINT32 uIntLevel); -INT32 sysSetInterruptType(IRQn_Type eIntNo, UINT32 uIntSourceType); /*!< Change interrupt type \hideinitializer */ -INT32 sysSetLocalInterrupt(INT32 nIntState); - - -/* Define system library Cache functions */ -void sysDisableCache(void); -INT32 sysEnableCache(UINT32 uCacheOpMode); -void sysFlushCache(INT32 nCacheType); /*!< flush cache \hideinitializer */ -BOOL sysGetCacheState(void); /*!< get cache state \hideinitializer */ -INT32 sysGetSdramSizebyMB(void); /*!< Get DRAM size \hideinitializer */ -void sysInvalidCache(void); /*!< invalid cache \hideinitializer */ -INT32 sysSetCachePages(UINT32 addr, INT32 size, INT32 cache_mode); /*!< set cache page \hideinitializer */ - -int sysSetMMUMappingMethod(int mode); /*!< MMU mapping \hideinitializer */ - -UINT32 sysGetClock(CLK_Type clk); - -typedef void (*sys_pvFunPtr)(); /* function pointer */ -/// @cond HIDDEN_SYMBOLS -extern sys_pvFunPtr sysIrqHandlerTable[]; -extern BOOL volatile _sys_bIsAICInitial; -/// @endcond -#ifdef __cplusplus -} -#endif - -/*@}*/ /* end of group N9H30_SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_SYS_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#endif //__NU_SYS_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_timer.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_timer.h deleted file mode 100644 index 674cc86eac1..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_timer.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************//** - * @file timer.h - * @brief N9H30 series TIMER driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_TIMER_H__ -#define __NU_TIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "N9H30.h" - -#define TIMER_COUNTER_ENABLE (1UL << 30) /*!< Timer counter enable */ -#define TIMER_INTERRUPT_ENABLE (1UL << 29) /*!< Timer interrupt enable */ - -#define TIMER_ONESHOT_MODE (0UL) /*!< Timer working in one shot mode */ -#define TIMER_PERIODIC_MODE (1UL << 27) /*!< Timer working in periodic mode */ -#define TIMER_CONTINUOUS_MODE (3UL << 27) /*!< Timer working in continuous mode */ - -#define TIMER_COUNTER_RESET (1UL << 26) /*!< Timer reset counter */ -#define TIMER_IS_ALIVE (1UL << 25) /*!< Timer is alive */ - -static __inline void TIMER_ClearIntFlag(uint32_t timer) -{ - outpw(REG_TMR_ISR, (1 << timer)); -} - -static __inline uint32_t TIMER_GetIntFlag(uint32_t timer) -{ - return inpw(REG_TMR_ISR) & (1 << timer); -} - -void TIMER_SET_CMP_VALUE(uint32_t timer, uint32_t u32Cmpr); -void TIMER_SET_OPMODE(uint32_t timer, uint32_t u32OpMode); -void TIMER_SET_PRESCALE_VALUE(uint32_t timer, uint32_t u32PreScale); -uint32_t TIMER_GetModuleClock(uint32_t timer); -void TIMER_Start(uint32_t timer); -void TIMER_Stop(uint32_t timer); -void TIMER_ClearCounter(uint32_t timer); -uint32_t TIMER_GetCounter(uint32_t timer); -uint32_t TIMER_GetCompareData(uint32_t timer); -void TIMER_EnableInt(uint32_t timer); -void TIMER_DisableInt(uint32_t timer); -void TIMER_Close(uint32_t timer); -uint32_t TIMER_Open(uint32_t timer, uint32_t u32Mode, uint32_t u32Freq); -__inline void TIMER_ClearIntFlag(uint32_t timer); -__inline uint32_t TIMER_GetIntFlag(uint32_t timer); - -#ifdef __cplusplus -} -#endif - -#endif //__NU_TIMER_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h deleted file mode 100644 index 898c181eb51..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h +++ /dev/null @@ -1,777 +0,0 @@ -/**************************************************************************//** -* @file uart.h -* @version V1.00 -* @brief N9H30 UART driver header file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_UART_H__ -#define __NU_UART_H__ - -#include "N9H30.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_UART_Driver UART Driver - @{ -*/ - - - -/*-----------------------------------------*/ -/* marco, type and constant definitions */ -/*-----------------------------------------*/ -/// @cond HIDDEN_SYMBOLS -#define UART_NUM 11 - -#define UARTOFFSET 0x100 -/// @endcond HIDDEN_SYMBOLS - -/** @addtogroup N9H30_UART_EXPORTED_CONSTANTS UART Exported Constants - @{ -*/ - -#define UARTWRITESIZE 100 /*!< UART max. write size */ - -#define UARTINTMODE 1 /*!< UART interrupt mode */ -#define UARTPOLLMODE 0 /*!< UART polling mode */ -#define DISABLEALLIER 0 /*!< Disable all interrupt */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART channel number */ -/*---------------------------------------------------------------------------------------------------------*/ -#define ALLCHANNEL 11 /*!< UART ALL channel */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UA_FCR constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define UART_FCR_RFITL_1BYTE (0x0 << UART_FCR_RFITL_Pos) /*!< UA_FCR setting to set RX FIFO Trigger Level to 1 bit */ -#define UART_FCR_RFITL_4BYTES (0x1 << UART_FCR_RFITL_Pos) /*!< UA_FCR setting to set RX FIFO Trigger Level to 4 bits */ -#define UART_FCR_RFITL_8BYTES (0x2 << UART_FCR_RFITL_Pos) /*!< UA_FCR setting to set RX FIFO Trigger Level to 8 bits */ -#define UART_FCR_RFITL_14BYTES (0x3 << UART_FCR_RFITL_Pos) /*!< UA_FCR setting to set RX FIFO Trigger Level to 14 bits */ -#define UART_FCR_RFITL_30BYTES (0x4 << UART_FCR_RFITL_Pos) /*!< UA_FCR setting to set RX FIFO Trigger Level to 30 bits */ -#define UART_FCR_RFITL_46BYTES (0x5 << UART_FCR_RFITL_Pos) /*!< UA_FCR setting to set RX FIFO Trigger Level to 46 bits */ -#define UART_FCR_RFITL_62BYTES (0x6 << UART_FCR_RFITL_Pos) /*!< UA_FCR setting to set RX FIFO Trigger Level to 62 bits */ - -#define UART_FCR_RTS_TRI_LEV_1BYTE (0x0 << UART_FCR_RTS_TRI_LEV_Pos) /*!< UA_FCR setting to set RTS Trigger Level to 1 bit */ -#define UART_FCR_RTS_TRI_LEV_4BYTES (0x1 << UART_FCR_RTS_TRI_LEV_Pos) /*!< UA_FCR setting to set RTS Trigger Level to 4 bits */ -#define UART_FCR_RTS_TRI_LEV_8BYTES (0x2 << UART_FCR_RTS_TRI_LEV_Pos) /*!< UA_FCR setting to set RTS Trigger Level to 8 bits */ -#define UART_FCR_RTS_TRI_LEV_14BYTES (0x3 << UART_FCR_RTS_TRI_LEV_Pos) /*!< UA_FCR setting to set RTS Trigger Level to 14 bits */ -#define UART_FCR_RTS_TRI_LEV_30BYTES (0x4 << UART_FCR_RTS_TRI_LEV_Pos) /*!< UA_FCR setting to set RTS Trigger Level to 30 bits */ -#define UART_FCR_RTS_TRI_LEV_46BYTES (0x5 << UART_FCR_RTS_TRI_LEV_Pos) /*!< UA_FCR setting to set RTS Trigger Level to 46 bits */ -#define UART_FCR_RTS_TRI_LEV_62BYTES (0x6 << UART_FCR_RTS_TRI_LEV_Pos) /*!< UA_FCR setting to set RTS Trigger Level to 62 bits */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UA_LCR constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_WORD_LEN_5 (0) /*!< UA_LCR setting to set UART word length to 5 bits */ -#define UART_WORD_LEN_6 (1) /*!< UA_LCR setting to set UART word length to 6 bits */ -#define UART_WORD_LEN_7 (2) /*!< UA_LCR setting to set UART word length to 7 bits */ -#define UART_WORD_LEN_8 (3) /*!< UA_LCR setting to set UART word length to 8 bits */ - -#define UART_PARITY_NONE (0x0 << UART_LCR_PBE_Pos) /*!< UA_LCR setting to set UART as no parity */ -#define UART_PARITY_ODD (0x1 << UART_LCR_PBE_Pos) /*!< UA_LCR setting to set UART as odd parity */ -#define UART_PARITY_EVEN (0x3 << UART_LCR_PBE_Pos) /*!< UA_LCR setting to set UART as even parity */ -#define UART_PARITY_STICK (0x8 << UART_LCR_PBE_Pos) /*!< UA_LCR setting to set UART as stick parity */ - -#define UART_STOP_BIT_1 (0x0 << UART_LCR_NSB_Pos) /*!< UA_LCR setting for one stop bit */ -#define UART_STOP_BIT_1_5 (0x1 << UART_LCR_NSB_Pos) /*!< UA_LCR setting for 1.5 stop bit when 5-bit word length */ -#define UART_STOP_BIT_2 (0x1 << UART_LCR_NSB_Pos) /*!< UA_LCR setting for two stop bit when 6, 7, 8-bit word length */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART RTS LEVEL TRIGGER constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_RTS_IS_HIGH_LEV_TRG (0x1 << UART_MCR_LEV_RTS_Pos) /*!< Set RTS is High Level Tigger */ -#define UART_RTS_IS_LOW_LEV_TRG (0x0 << UART_MCR_LEV_RTS_Pos) /*!< Set RTS is Low Level Tigger */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART CTS LEVEL TRIGGER constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_CTS_IS_HIGH_LEV_TRG (0x1 << UART_MSR_LEV_CTS_Pos) /*!< Set CTS is High Level Trigger */ -#define UART_CTS_IS_LOW_LEV_TRG (0x0 << UART_MSR_LEV_CTS_Pos) /*!< Set CTS is Low Level Trigger */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UA_FUNC_SEL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_FUNC_SEL_UART (0x0 << UART_FUN_SEL_FUN_SEL_Pos) /*!< UA_FUNC_SEL setting to set UART Function (Default) */ -#define UART_FUNC_SEL_LIN (0x1 << UART_FUN_SEL_FUN_SEL_Pos) /*!< UA_FUNC_SEL setting to set LIN Funciton */ -#define UART_FUNC_SEL_IrDA (0x2 << UART_FUN_SEL_FUN_SEL_Pos) /*!< UA_FUNC_SEL setting to set IrDA Function */ -#define UART_FUNC_SEL_RS485 (0x3 << UART_FUN_SEL_FUN_SEL_Pos) /*!< UA_FUNC_SEL setting to set RS485 Function */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UA_LIN_CTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_LIN_CTL_LINS_EN (0x1UL << UART_LIN_CTL_LINS_EN_Pos) /*!< UA_LIN_CTL setting to set LIN Slave Mode Enable */ -#define UART_LIN_CTL_LINS_HDET_EN (0x1UL << UART_LIN_CTL_LINS_HDET_EN_Pos) /*!< UA_LIN_CTL setting to set LIN Slave Header Detection Enable */ -#define UART_LIN_CTL_LINS_ARS_EN (0x1UL << UART_LIN_CTL_LINS_ARS_EN_Pos) /*!< UA_LIN_CTL setting to set LIN Slave Automatic Resynchronization Mode Enable */ -#define UART_LIN_CTL_LINS_DUM_EN (0x1UL << UART_LIN_CTL_LINS_DUM_EN_Pos) /*!< UA_LIN_CTL setting to set LIN Slave Divider Update Method Enable */ -#define UART_LIN_CTL_LIN_WAKE_EN (0x1UL << UART_LIN_CTL_LIN_WAKE_EN_Pos) /*!< UA_LIN_CTL setting to set LIN Wake-Up Mode Enable */ -#define UART_LIN_CTL_LIN_SHD (0x1UL << UART_LIN_CTL_LIN_SHD_Pos) /*!< UA_LIN_CTL setting to set LIN TX Send Header Enable */ -#define UART_LIN_CTL_LIN_IDPEN (0x1UL << UART_LIN_CTL_LIN_IDPEN_Pos) /*!< UA_LIN_CTL setting to set LIN ID Parity Enable */ -#define UART_LIN_CTL_LIN_BKDET_ENN (0x1UL << UART_LIN_CTL_LIN_BKDET_EN_Pos) /*!< UA_LIN_CTL setting to set LIN Break Detection Enable */ -#define UART_LIN_CTL_LIN_RX_DIS (0x1UL << UART_LIN_CTL_LIN_RX_DIS_Pos) /*!< UA_LIN_CTL setting to set LIN Receiver Disable */ -#define UART_LIN_CTL_BIT_ERR_EN (0x1UL << UART_LIN_CTL_BIT_ERR_EN_Pos) /*!< UA_LIN_CTL setting to set Bit Error Detect Enable */ -#define UART_LIN_CTL_LIN_BKFL(x) (((x)-1) << UART_LIN_CTL_LIN_BKFL_Pos) /*!< UA_LIN_CTL setting to set LIN Break Field Length, x = 10 ~ 15, default value is 12 */ -#define UART_LIN_CTL_LIN_BS_LEN(x) (((x)-1) << UART_LIN_CTL_LIN_BS_LEN_Pos)/*!< UA_LIN_CTL setting to set LIN Break/Sync Delimiter Length, x = 1 ~ 4 */ -#define UART_LIN_CTL_LIN_HEAD_SEL_BREAK (0x0UL << UART_LIN_CTL_LIN_HEAD_SEL_Pos) /*!< UA_LIN_CTL setting to set LIN Header Select to break field */ -#define UART_LIN_CTL_LIN_HEAD_SEL_BREAK_SYNC (0x1UL << UART_LIN_CTL_LIN_HEAD_SEL_Pos) /*!< UA_LIN_CTL setting to set LIN Header Select to break field and sync field */ -#define UART_LIN_CTL_LIN_HEAD_SEL_BREAK_SYNC_ID (0x2UL << UART_LIN_CTL_LIN_HEAD_SEL_Pos) /*!< UA_LIN_CTL setting to set LIN Header Select to break field, sync field and ID field*/ -#define UART_LIN_CTL_LIN_LIN_PID(x) ((x) << UART_LIN_CTL_LIN_PID_Pos) /*!< UA_LIN_CTL setting to set LIN PID value */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* BAUD constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_BAUD_MODE0 (0) /*!< Set UART Baudrate Mode is Mode0 */ -#define UART_BAUD_MODE2 (UART_BAUD_DIV_X_EN_Msk | UART_BAUD_DIV_X_ONE_Msk) /*!< Set UART Baudrate Mode is Mode2 */ - -/* UART THR Bit Field Definitions */ -#define UART_THR_THR_Pos 0 /*!< UART THR: THR Position */ -#define UART_THR_THR_Msk (0xFFul << UART_THR_THR_Pos) /*!< UART THR: THR Mask */ - -/* UART RBR Bit Field Definitions */ -#define UART_RBR_RBR_Pos 0 /*!< UART RBR: RBR Posistion */ -#define UART_RBR_RBR_Msk (0xFFul << UART_RBR_RBR_Pos) /*!< UART RBR: RBR Mask */ - -/* UART IER Bit Field Definitions */ -#define UART_IER_DMA_RX_EN_Pos 15 /*!< UART IER: RX DMA Enable Posistion */ -#define UART_IER_DMA_RX_EN_Msk (1ul << UART_IER_DMA_RX_EN_Pos) /*!< UART IER: RX DMA Enable Mask */ - -#define UART_IER_DMA_TX_EN_Pos 14 /*!< UART IER: TX DMA Enable Posistion */ -#define UART_IER_DMA_TX_EN_Msk (1ul << UART_IER_DMA_TX_EN_Pos) /*!< UART IER: TX DMA Enable Mask */ - -#define UART_IER_AUTO_CTS_EN_Pos 13 /*!< UART IER: AUTO_CTS_EN Posistion */ -#define UART_IER_AUTO_CTS_EN_Msk (1ul << UART_IER_AUTO_CTS_EN_Pos) /*!< UART IER: AUTO_CTS_EN Mask */ - -#define UART_IER_AUTO_RTS_EN_Pos 12 /*!< UART IER: AUTO_RTS_EN Posistion */ -#define UART_IER_AUTO_RTS_EN_Msk (1ul << UART_IER_AUTO_RTS_EN_Pos) /*!< UART IER: AUTO_RTS_EN Mask */ - -#define UART_IER_TIME_OUT_EN_Pos 11 /*!< UART IER: TIME_OUT_EN Posistion */ -#define UART_IER_TIME_OUT_EN_Msk (1ul << UART_IER_TIME_OUT_EN_Pos) /*!< UART IER: TIME_OUT_EN Mask */ - -#define UART_IER_LIN_RX_BRK_IEN_Pos 8 /*!< UART IER: LIN_RX_BRK_IEN Posistion */ -#define UART_IER_LIN_RX_BRK_IEN_Msk (1ul << UART_IER_LIN_RX_BRK_IEN_Pos) /*!< UART IER: LIN_RX_BRK_IEN Mask */ - -#define UART_IER_WAKE_EN_Pos 6 /*!< UART IER: WAKE_EN Posistion */ -#define UART_IER_WAKE_EN_Msk (1ul << UART_IER_WAKE_EN_Pos) /*!< UART IER: WAKE_EN Mask */ - -#define UART_IER_BUF_ERR_IEN_Pos 5 /*!< UART IER: BUF_ERR_IEN Posistion */ -#define UART_IER_BUF_ERR_IEN_Msk (1ul << UART_IER_BUF_ERR_IEN_Pos) /*!< UART IER: BUF_ERR_IEN Mask */ - -#define UART_IER_RTO_IEN_Pos 4 /*!< UART IER: RTO_IEN Posistion */ -#define UART_IER_RTO_IEN_Msk (1ul << UART_IER_RTO_IEN_Pos) /*!< UART IER: RTO_IEN Mask */ - -#define UART_IER_MODEM_IEN_Pos 3 /*!< UART IER: MODEM_IEN Posistion */ -#define UART_IER_MODEM_IEN_Msk (1ul << UART_IER_MODEM_IEN_Pos) /*!< UART IER: MODEM_IEN Mask */ - -#define UART_IER_RLS_IEN_Pos 2 /*!< UART IER: RLS_IEN Posistion */ -#define UART_IER_RLS_IEN_Msk (1ul << UART_IER_RLS_IEN_Pos) /*!< UART IER: RLS_IEN Mask */ - -#define UART_IER_THRE_IEN_Pos 1 /*!< UART IER: THRE_IEN Posistion */ -#define UART_IER_THRE_IEN_Msk (1ul << UART_IER_THRE_IEN_Pos) /*!< UART IER: THRE_IEN Mask */ - -#define UART_IER_RDA_IEN_Pos 0 /*!< UART IER: RDA_IEN Position */ -#define UART_IER_RDA_IEN_Msk (1ul << UART_IER_RDA_IEN_Pos) /*!< UART IER: RDA_IEN Mask */ - -/* UART FCR Bit Field Definitions */ -#define UART_FCR_RTS_TRI_LEV_Pos 16 /*!< UART FCR: RTS_TRI_LEV Position */ -#define UART_FCR_RTS_TRI_LEV_Msk (0xFul << UART_FCR_RTS_TRI_LEV_Pos) /*!< UART FCR: RTS_TRI_LEV Mask */ - -#define UART_FCR_RX_DIS_Pos 8 /*!< UART FCR: RX_DIS Position */ -#define UART_FCR_RX_DIS_Msk (1ul << UART_FCR_RX_DIS_Pos) /*!< UART FCR: RX_DIS Mask */ - -#define UART_FCR_RFITL_Pos 4 /*!< UART FCR: RFITL Position */ -#define UART_FCR_RFITL_Msk (0xFul << UART_FCR_RFITL_Pos) /*!< UART FCR: RFITL Mask */ - -#define UART_FCR_TFR_Pos 2 /*!< UART FCR: TFR Position */ -#define UART_FCR_TFR_Msk (1ul << UART_FCR_TFR_Pos) /*!< UART FCR: TFR Mask */ - -#define UART_FCR_RFR_Pos 1 /*!< UART FCR: RFR Position */ -#define UART_FCR_RFR_Msk (1ul << UART_FCR_RFR_Pos) /*!< UART FCR: RFR Mask */ - -/* UART LCR Bit Field Definitions */ -#define UART_LCR_BCB_Pos 6 /*!< UART LCR: BCB Position */ -#define UART_LCR_BCB_Msk (1ul << UART_LCR_BCB_Pos) /*!< UART LCR: BCB Mask */ - -#define UART_LCR_SPE_Pos 5 /*!< UART LCR: SPE Position */ -#define UART_LCR_SPE_Msk (1ul << UART_LCR_SPE_Pos) /*!< UART LCR: SPE Mask */ - -#define UART_LCR_EPE_Pos 4 /*!< UART LCR: EPE Position */ -#define UART_LCR_EPE_Msk (1ul << UART_LCR_EPE_Pos) /*!< UART LCR: EPE Mask */ - -#define UART_LCR_PBE_Pos 3 /*!< UART LCR: PBE Position */ -#define UART_LCR_PBE_Msk (1ul << UART_LCR_PBE_Pos) /*!< UART LCR: PBE Mask */ - -#define UART_LCR_NSB_Pos 2 /*!< UART LCR: NSB Position */ -#define UART_LCR_NSB_Msk (1ul << UART_LCR_NSB_Pos) /*!< UART LCR: NSB Mask */ - -#define UART_LCR_WLS_Pos 0 /*!< UART LCR: WLS Position */ -#define UART_LCR_WLS_Msk (0x3ul << UART_LCR_WLS_Pos) /*!< UART LCR: WLS Mask */ - -/* UART MCR Bit Field Definitions */ -#define UART_MCR_RTS_ST_Pos 13 /*!< UART MCR: RTS_ST Position */ -#define UART_MCR_RTS_ST_Msk (1ul << UART_MCR_RTS_ST_Pos) /*!< UART MCR: RTS_ST Mask */ - -#define UART_MCR_LEV_RTS_Pos 9 /*!< UART MCR: LEV_RTS Position */ -#define UART_MCR_LEV_RTS_Msk (1ul << UART_MCR_LEV_RTS_Pos) /*!< UART MCR: LEV_RTS Mask */ - -#define UART_MCR_RTS_Pos 1 /*!< UART MCR: RTS Position */ -#define UART_MCR_RTS_Msk (1ul << UART_MCR_RTS_Pos) /*!< UART MCR: RTS Mask */ - -/* UART MSR Bit Field Definitions */ -#define UART_MSR_LEV_CTS_Pos 8 /*!< UART MSR: LEV_CTS Position */ -#define UART_MSR_LEV_CTS_Msk (1ul << UART_MSR_LEV_CTS_Pos) /*!< UART MSR: LEV_CTS Mask */ - -#define UART_MSR_CTS_ST_Pos 4 /*!< UART MSR: CTS_ST Position */ -#define UART_MSR_CTS_ST_Msk (1ul << UART_MSR_CTS_ST_Pos) /*!< UART MSR: CTS_ST Mask */ - -#define UART_MSR_DCTSF_Pos 0 /*!< UART MSR: DCTST Position */ -#define UART_MSR_DCTSF_Msk (1ul << UART_MSR_DCTSF_Pos) /*!< UART MSR: DCTST Mask */ - - -/* UART FSR Bit Field Definitions */ -#define UART_FSR_TE_FLAG_Pos 28 /*!< UART FSR: TE_FLAG Position */ -#define UART_FSR_TE_FLAG_Msk (1ul << UART_FSR_TE_FLAG_Pos) /*!< UART FSR: TE_FLAG Mask */ - -#define UART_FSR_TX_OVER_IF_Pos 24 /*!< UART FSR: TX_OVER_IF Position */ -#define UART_FSR_TX_OVER_IF_Msk (1ul << UART_FSR_TX_OVER_IF_Pos) /*!< UART FSR: TX_OVER_IF Mask */ - -#define UART_FSR_TX_FULL_Pos 23 /*!< UART FSR: TX_FULL Position */ -#define UART_FSR_TX_FULL_Msk (1ul << UART_FSR_TX_FULL_Pos) /*!< UART FSR: TX_FULL Mask */ - -#define UART_FSR_TX_EMPTY_Pos 22 /*!< UART FSR: TX_EMPTY Position */ -#define UART_FSR_TX_EMPTY_Msk (1ul << UART_FSR_TX_EMPTY_Pos) /*!< UART FSR: TX_EMPTY Mask */ - -#define UART_FSR_TX_POINTER_Pos 16 /*!< UART FSR: TX_POINTER Position */ -#define UART_FSR_TX_POINTER_Msk (0x3Ful << UART_FSR_TX_POINTER_Pos) /*!< UART FSR: TX_POINTER Mask */ - -#define UART_FSR_RX_FULL_Pos 15 /*!< UART FSR: RX_FULL Position */ -#define UART_FSR_RX_FULL_Msk (1ul << UART_FSR_RX_FULL_Pos) /*!< UART FSR: RX_FULL Mask */ - -#define UART_FSR_RX_EMPTY_Pos 14 /*!< UART FSR: RX_EMPTY Position */ -#define UART_FSR_RX_EMPTY_Msk (1ul << UART_FSR_RX_EMPTY_Pos) /*!< UART FSR: RX_EMPTY Mask */ - -#define UART_FSR_RX_POINTER_Pos 8 /*!< UART FSR: RX_POINTERS Position */ -#define UART_FSR_RX_POINTER_Msk (0x3Ful << UART_FSR_RX_POINTER_Pos) /*!< UART FSR: RX_POINTER Mask */ - -#define UART_FSR_BIF_Pos 6 /*!< UART FSR: BIF Position */ -#define UART_FSR_BIF_Msk (1ul << UART_FSR_BIF_Pos) /*!< UART FSR: BIF Mask */ - -#define UART_FSR_FEF_Pos 5 /*!< UART FSR: FEF Position */ -#define UART_FSR_FEF_Msk (1ul << UART_FSR_FEF_Pos) /*!< UART FSR: FEF Mask */ - -#define UART_FSR_PEF_Pos 4 /*!< UART FSR: PEF Position */ -#define UART_FSR_PEF_Msk (1ul << UART_FSR_PEF_Pos) /*!< UART FSR: PEF Mask */ - -#define UART_FSR_RS485_ADD_DETF_Pos 3 /*!< UART FSR: RS485_ADD_DETF Position */ -#define UART_FSR_RS485_ADD_DETF_Msk (1ul << UART_FSR_RS485_ADD_DETF_Pos) /*!< UART FSR: RS485_ADD_DETF Mask */ - -#define UART_FSR_RX_OVER_IF_Pos 0 /*!< UART FSR: RX_OVER_IF Position */ -#define UART_FSR_RX_OVER_IF_Msk (1ul << UART_FSR_RX_OVER_IF_Pos) /*!< UART FSR: RX_OVER_IF Mask */ - -/* UART ISR Bit Field Definitions */ -#define UART_ISR_LIN_RX_BREAK_INT_Pos 15 /*!< UART ISR: LIN_RX_BREAK_INT Position */ -#define UART_ISR_LIN_RX_BREAK_INT_Msk (1ul << UART_ISR_LIN_RX_BREAK_INT_Pos) /*!< UART ISR: LIN_RX_BREAK_INT Mask */ - -#define UART_ISR_BUF_ERR_INT_Pos 13 /*!< UART ISR: BUF_ERR_INT Position */ -#define UART_ISR_BUF_ERR_INT_Msk (1ul << UART_ISR_BUF_ERR_INT_Pos) /*!< UART ISR: BUF_ERR_INT Mask */ - -#define UART_ISR_TOUT_INT_Pos 12 /*!< UART ISR: TOUT_INT Position */ -#define UART_ISR_TOUT_INT_Msk (1ul << UART_ISR_TOUT_INT_Pos) /*!< UART ISR: TOUT_INT Mask */ - -#define UART_ISR_MODEM_INT_Pos 11 /*!< UART ISR: MODEM_INT Position */ -#define UART_ISR_MODEM_INT_Msk (1ul << UART_ISR_MODEM_INT_Pos) /*!< UART ISR: MODEM_INT Mask */ - -#define UART_ISR_RLS_INT_Pos 10 /*!< UART ISR: RLS_INT Position */ -#define UART_ISR_RLS_INT_Msk (1ul << UART_ISR_RLS_INT_Pos) /*!< UART ISR: RLS_INT Mask */ - -#define UART_ISR_THRE_INT_Pos 9 /*!< UART ISR: THRE_INT Position */ -#define UART_ISR_THRE_INT_Msk (1ul << UART_ISR_THRE_INT_Pos) /*!< UART ISR: THRE_INT Mask */ - -#define UART_ISR_RDA_INT_Pos 8 /*!< UART ISR: RDA_INT Position */ -#define UART_ISR_RDA_INT_Msk (1ul << UART_ISR_RDA_INT_Pos) /*!< UART ISR: RDA_INT Mask */ - -#define UART_ISR_LIN_RX_BREAK_IF_Pos 7 /*!< UART ISR: LIN RX BREAK IF Position */ -#define UART_ISR_LIN_RX_BREAK_IF_Msk (1ul << UART_ISR_LIN_RX_BREAK_IF_Pos) /*!< UART ISR: LIN RX BREAK IF Mask */ - -#define UART_ISR_BUF_ERR_IF_Pos 5 /*!< UART ISR: BUF_ERR_IF Position */ -#define UART_ISR_BUF_ERR_IF_Msk (1ul << UART_ISR_BUF_ERR_IF_Pos) /*!< UART ISR: BUF_ERR_IF Mask */ - -#define UART_ISR_TOUT_IF_Pos 4 /*!< UART ISR: TOUT_IF Position */ -#define UART_ISR_TOUT_IF_Msk (1ul << UART_ISR_TOUT_IF_Pos) /*!< UART ISR: TOUT_IF Mask */ - -#define UART_ISR_MODEM_IF_Pos 3 /*!< UART ISR: MODEM_IF Position */ -#define UART_ISR_MODEM_IF_Msk (1ul << UART_ISR_MODEM_IF_Pos) /*!< UART ISR: MODEM_IF Mask */ - -#define UART_ISR_RLS_IF_Pos 2 /*!< UART ISR: RLS_IF Position */ -#define UART_ISR_RLS_IF_Msk (1ul << UART_ISR_RLS_IF_Pos) /*!< UART ISR: RLS_IF Mask */ - -#define UART_ISR_THRE_IF_Pos 1 /*!< UART ISR: THRE_IF Position */ -#define UART_ISR_THRE_IF_Msk (1ul << UART_ISR_THRE_IF_Pos) /*!< UART ISR: THRE_IF Mask */ - -#define UART_ISR_RDA_IF_Pos 0 /*!< UART ISR: RDA_IF Position */ -#define UART_ISR_RDA_IF_Msk (1ul << UART_ISR_RDA_IF_Pos) /*!< UART ISR: RDA_IF Mask */ - - -/* UART TOR Bit Field Definitions */ -#define UART_TOR_DLY_Pos 8 /*!< UART TOR: DLY Position */ -#define UART_TOR_DLY_Msk (0xFFul << UART_TOR_DLY_Pos) /*!< UART TOR: DLY Mask */ - -#define UART_TOR_TOIC_Pos 0 /*!< UART TOR: TOIC Position */ -#define UART_TOR_TOIC_Msk (0xFFul << UART_TOR_TOIC_Pos) /*!< UART TOR: TOIC Mask */ - -/* UART BAUD Bit Field Definitions */ -#define UART_BAUD_DIV_X_EN_Pos 29 /*!< UART BARD: DIV_X_EN Position */ -#define UART_BAUD_DIV_X_EN_Msk (1ul << UART_BAUD_DIV_X_EN_Pos) /*!< UART BARD: DIV_X_EN Mask */ - -#define UART_BAUD_DIV_X_ONE_Pos 28 /*!< UART BARD: DIV_X_ONE Position */ -#define UART_BAUD_DIV_X_ONE_Msk (1ul << UART_BAUD_DIV_X_ONE_Pos) /*!< UART BARD: DIV_X_ONE Mask */ - -#define UART_BAUD_DIVIDER_X_Pos 24 /*!< UART BARD: DIVIDER_X Position */ -#define UART_BAUD_DIVIDER_X_Msk (0xFul << UART_BAUD_DIVIDER_X_Pos) /*!< UART BARD: DIVIDER_X Mask */ - -#define UART_BAUD_BRD_Pos 0 /*!< UART BARD: BRD Position */ -#define UART_BAUD_BRD_Msk (0xFFFFul << UART_BAUD_BRD_Pos) /*!< UART BARD: BRD Mask */ - -/* UART IRCR Bit Field Definitions */ -#define UART_IRCR_INV_RX_Pos 6 /*!< UART IRCR: INV_RX Position */ -#define UART_IRCR_INV_RX_Msk (1ul << UART_IRCR_INV_RX_Pos) /*!< UART IRCR: INV_RX Mask */ - -#define UART_IRCR_INV_TX_Pos 5 /*!< UART IRCR: INV_TX Position */ -#define UART_IRCR_INV_TX_Msk (1ul << UART_IRCR_INV_TX_Pos) /*!< UART IRCR: INV_TX Mask */ - -#define UART_IRCR_TX_SELECT_Pos 1 /*!< UART IRCR: TX_SELECT Position */ -#define UART_IRCR_TX_SELECT_Msk (1ul << UART_IRCR_TX_SELECT_Pos) /*!< UART IRCR: TX_SELECT Mask */ - -/* UART ALT_CSR Bit Field Definitions */ -#define UART_ALT_CSR_ADDR_MATCH_Pos 24 /*!< UART ALT_CSR: ADDR_MATCH Position */ -#define UART_ALT_CSR_ADDR_MATCH_Msk (0xFFul << UART_ALT_CSR_ADDR_MATCH_Pos) /*!< UART ALT_CSR: ADDR_MATCH Mask */ - -#define UART_ALT_CSR_RS485_ADD_EN_Pos 15 /*!< UART ALT_CSR: RS485_ADD_EN Position */ -#define UART_ALT_CSR_RS485_ADD_EN_Msk (1ul << UART_ALT_CSR_RS485_ADD_EN_Pos) /*!< UART ALT_CSR: RS485_ADD_EN Mask */ - -#define UART_ALT_CSR_RS485_AUD_Pos 10 /*!< UART ALT_CSR: RS485_AUD Position */ -#define UART_ALT_CSR_RS485_AUD_Msk (1ul << UART_ALT_CSR_RS485_AUD_Pos) /*!< UART ALT_CSR: RS485_AUD Mask */ - -#define UART_ALT_CSR_RS485_AAD_Pos 9 /*!< UART ALT_CSR: RS485_AAD Position */ -#define UART_ALT_CSR_RS485_AAD_Msk (1ul << UART_ALT_CSR_RS485_AAD_Pos) /*!< UART ALT_CSR: RS485_AAD Mask */ - -#define UART_ALT_CSR_RS485_NMM_Pos 8 /*!< UART ALT_CSR: RS485_NMM Position */ -#define UART_ALT_CSR_RS485_NMM_Msk (1ul << UART_ALT_CSR_RS485_NMM_Pos) /*!< UART ALT_CSR: RS485_NMM Mask */ - -#define UART_ALT_CSR_LIN_TX_EN_Pos 7 /*!< UART ALT_CSR: LIN TX Break Mode Enable Position */ -#define UART_ALT_CSR_LIN_TX_EN_Msk (1ul << UART_ALT_CSR_LIN_TX_EN_Pos) /*!< UART ALT_CSR: LIN TX Break Mode Enable Mask */ - -#define UART_ALT_CSR_LIN_RX_EN_Pos 6 /*!< UART ALT_CSR: LIN RX Enable Position */ -#define UART_ALT_CSR_LIN_RX_EN_Msk (1ul << UART_ALT_CSR_LIN_RX_EN_Pos) /*!< UART ALT_CSR: LIN RX Enable Mask */ - -#define UART_ALT_CSR_UA_LIN_BKFL_Pos 0 /*!< UART ALT_CSR: UART LIN Break Field Length Position */ -#define UART_ALT_CSR_UA_LIN_BKFL_Msk (0xFul << UART_ALT_CSR_UA_LIN_BKFL_Pos) /*!< UART ALT_CSR: UART LIN Break Field Length Mask */ - -/* UART FUN_SEL Bit Field Definitions */ -#define UART_FUN_SEL_FUN_SEL_Pos 0 /*!< UART FUN_SEL: FUN_SEL Position */ -#define UART_FUN_SEL_FUN_SEL_Msk (0x3ul << UART_FUN_SEL_FUN_SEL_Pos) /*!< UART FUN_SEL: FUN_SEL Mask */ - -/* UART LIN_CTL Bit Field Definitions */ -#define UART_LIN_CTL_LIN_PID_Pos 24 /*!< UART LIN_CTL: LIN_PID Position */ -#define UART_LIN_CTL_LIN_PID_Msk (0xFFul << UART_LIN_CTL_LIN_PID_Pos) /*!< UART LIN_CTL: LIN_PID Mask */ - -#define UART_LIN_CTL_LIN_HEAD_SEL_Pos 22 /*!< UART LIN_CTL: LIN_HEAD_SEL Position */ -#define UART_LIN_CTL_LIN_HEAD_SEL_Msk (0x3ul << UART_LIN_CTL_LIN_HEAD_SEL_Pos) /*!< UART LIN_CTL: LIN_HEAD_SEL Mask */ - -#define UART_LIN_CTL_LIN_BS_LEN_Pos 20 /*!< UART LIN_CTL: LIN_BS_LEN Position */ -#define UART_LIN_CTL_LIN_BS_LEN_Msk (0x3ul << UART_LIN_CTL_LIN_BS_LEN_Pos) /*!< UART LIN_CTL: LIN_BS_LEN Mask */ - -#define UART_LIN_CTL_LIN_BKFL_Pos 16 /*!< UART LIN_CTL: LIN_BKFL Position */ -#define UART_LIN_CTL_LIN_BKFL_Msk (0xFul << UART_LIN_CTL_LIN_BKFL_Pos) /*!< UART LIN_CTL: LIN_BKFL Mask */ - -#define UART_LIN_CTL_BIT_ERR_EN_Pos 12 /*!< UART LIN_CTL: BIT_ERR_EN Position */ -#define UART_LIN_CTL_BIT_ERR_EN_Msk (1ul << UART_LIN_CTL_BIT_ERR_EN_Pos) /*!< UART LIN_CTL: BIT_ERR_EN Mask */ - -#define UART_LIN_CTL_LIN_RX_DIS_Pos 11 /*!< UART LIN_CTL: LIN_RX_DIS Position */ -#define UART_LIN_CTL_LIN_RX_DIS_Msk (1ul << UART_LIN_CTL_LIN_RX_DIS_Pos) /*!< UART LIN_CTL: LIN_RX_DIS Mask */ - -#define UART_LIN_CTL_LIN_BKDET_EN_Pos 10 /*!< UART LIN_CTL: LIN_BKDET_EN Position */ -#define UART_LIN_CTL_LIN_BKDET_EN_Msk (1ul << UART_LIN_CTL_LIN_BKDET_EN_Pos) /*!< UART LIN_CTL: LIN_BKDET_EN Mask */ - -#define UART_LIN_CTL_LIN_IDPEN_Pos 9 /*!< UART LIN_CTL: LIN_IDPEN Position */ -#define UART_LIN_CTL_LIN_IDPEN_Msk (1ul << UART_LIN_CTL_LIN_IDPEN_Pos) /*!< UART LIN_CTL: LIN_IDPEN Mask */ - -#define UART_LIN_CTL_LIN_SHD_Pos 8 /*!< UART LIN_CTL: LIN_SHD Position */ -#define UART_LIN_CTL_LIN_SHD_Msk (1ul << UART_LIN_CTL_LIN_SHD_Pos) /*!< UART LIN_CTL: LIN_SHD Mask */ - -#define UART_LIN_CTL_LIN_WAKE_EN_Pos 4 /*!< UART LIN_CTL: LIN_WAKE_EN Position */ -#define UART_LIN_CTL_LIN_WAKE_EN_Msk (1ul << UART_LIN_CTL_LIN_WAKE_EN_Pos) /*!< UART LIN_CTL: LIN_WAKE_EN Mask */ - -#define UART_LIN_CTL_LINS_DUM_EN_Pos 3 /*!< UART LIN_CTL: LINS_DUM_EN Position */ -#define UART_LIN_CTL_LINS_DUM_EN_Msk (1ul << UART_LIN_CTL_LINS_DUM_EN_Pos) /*!< UART LIN_CTL: LINS_DUM_EN Mask */ - -#define UART_LIN_CTL_LINS_ARS_EN_Pos 2 /*!< UART LIN_CTL: LINS_ARS_EN Position */ -#define UART_LIN_CTL_LINS_ARS_EN_Msk (1ul << UART_LIN_CTL_LINS_ARS_EN_Pos) /*!< UART LIN_CTL: LINS_ARS_EN Mask */ - -#define UART_LIN_CTL_LINS_HDET_EN_Pos 1 /*!< UART LIN_CTL: LINS_HDET_EN Position */ -#define UART_LIN_CTL_LINS_HDET_EN_Msk (1ul << UART_LIN_CTL_LINS_HDET_EN_Pos) /*!< UART LIN_CTL: LINS_HDET_EN Mask */ - -#define UART_LIN_CTL_LINS_EN_Pos 0 /*!< UART LIN_CTL: LINS_EN Position */ -#define UART_LIN_CTL_LINS_EN_Msk (1ul << UART_LIN_CTL_LINS_EN_Pos) /*!< UART LIN_CTL: LINS_EN Mask */ - -/* UART LIN_SR Bit Field Definitions */ -#define UART_LIN_SR_LINS_SYNC_F_Pos 3 /*!< UART LIN_SR: LINS_SYNC_F Position */ -#define UART_LIN_SR_LINS_SYNC_F_Msk (1ul << UART_LIN_SR_LINS_SYNC_F_Pos) /*!< UART LIN_SR: LINS_SYNC_F Mask */ - -#define UART_LIN_SR_LINS_IDPERR_F_Pos 2 /*!< UART LIN_SR: LINS_IDPERR_F Position */ -#define UART_LIN_SR_LINS_IDPERR_F_Msk (1ul << UART_LIN_SR_LINS_IDPERR_F_Pos) /*!< UART LIN_SR: LINS_IDPERR_F Mask */ - -#define UART_LIN_SR_LINS_HERR_F_Pos 1 /*!< UART LIN_SR: LINS_HERR_F Position */ -#define UART_LIN_SR_LINS_HERR_F_Msk (1ul << UART_LIN_SR_LINS_HERR_F_Pos) /*!< UART LIN_SR: LINS_HERR_F Mask */ - -#define UART_LIN_SR_LINS_HDET_F_Pos 0 /*!< UART LIN_SR: LINS_HDET_F Position */ -#define UART_LIN_SR_LINS_HDET_F_Msk (1ul << UART_LIN_SR_LINS_HDET_F_Pos) /*!< UART LIN_SR: LINS_HDET_F Mask */ - -/* UART DEBUG Bit Field Definitions */ -#define UART_DEBUG_ERR_DIVIA_F_Pos 0 /*!< UART DEBUG: ERR_DIVIA_F Position */ -#define UART_DEBUG_ERR_DIVIA_F_Msk (1ul << UART_DEBUG_ERR_DIVIA_F_Pos) /*!< UART DEBUG: ERR_DIVIA_F Mask */ - -#define UART_DEBUG_ERR_HETIME_OUT_F_Pos 1 /*!< UART DEBUG: ERR_HETIME_OUT_F Position */ -#define UART_DEBUG_ERR_HETIME_OUT_F_Msk (1ul << UART_DEBUG_ERR_HETIME_OUT_F_Pos) /*!< UART DEBUG: ERR_HETIME_OUT_F Mask */ - -#define UART_DEBUG_ERR_HEFE_F_Pos 2 /*!< UART DEBUG: ERR_HEFE_F Position */ -#define UART_DEBUG_ERR_HEFE_F_Msk (1ul << UART_DEBUG_ERR_HEFE_F_Pos) /*!< UART DEBUG: ERR_HEFE_F Mask */ - -#define UART_DEBUG_ERR_SYNC_F_Pos 3 /*!< UART DEBUG: ERR_SYNC_F Position */ -#define UART_DEBUG_ERR_SYNC_F_Msk (1ul << UART_DEBUG_ERR_SYNC_F_Pos) /*!< UART DEBUG: ERR_SYNC_F Mask */ - -/* UART SC_CTL Bit Field Definitions */ -#define UART_SC_CTL_RX_ERETRY_Pos 0 /*!< UART SC_CTL: RX_ERETRY Position */ -#define UART_SC_CTL_RX_ERETRY_Msk (7ul << UART_SC_CTL_RX_ERETRY_Pos) /*!< UART SC_CTL: RX_ERETRY Mask */ - -#define UART_SC_CTL_RX_ERETRY_EN_Pos 3 /*!< UART SC_CTL: RX_ERETRY_EN Position */ -#define UART_SC_CTL_RX_ERETRY_EN_Msk (1ul << UART_SC_CTL_RX_ERETRY_EN_Pos) /*!< UART SC_CTL: RX_ERETRY_EN Mask */ - -#define UART_SC_CTL_TX_ERETRY_Pos 4 /*!< UART SC_CTL: TX_ERETRY Position */ -#define UART_SC_CTL_TX_ERETRY_Msk (7ul << UART_SC_CTL_TX_ERETRY_Pos) /*!< UART SC_CTL: TX_ERETRY Mask */ - -#define UART_SC_CTL_TX_ERETRY_EN_Pos 7 /*!< UART SC_CTL: TX_ERETRY_EN Position */ -#define UART_SC_CTL_TX_ERETRY_EN_Msk (1ul << UART_SC_CTL_TX_ERETRY_EN_Pos) /*!< UART SC_CTL: TX_ERETRY_EN Mask */ - -/* UART SC_FSR Bit Field Definitions */ -#define UART_SC_FSR_RX_OVER_ERETRY_Pos 0 /*!< UART SC_FSR: RX_OVER_ERETRY Position */ -#define UART_SC_FSR_RX_OVER_ERETRY_Msk (1ul << UART_SC_FSR_RX_OVER_ERETRY_Pos) /*!< UART SC_FSR: RX_OVER_ERETRY Mask */ - -#define UART_SC_FSR_TX_OVER_ERETRY_Pos 1 /*!< UART SC_FSR: TX_OVER_ERETRY Position */ -#define UART_SC_FSR_TX_OVER_ERETRY_Msk (1ul << UART_SC_FSR_TX_OVER_ERETRY_Pos) /*!< UART SC_FSR: TX_OVER_ERETRY Mask */ - -#define UART_SC_FSR_RX_ERETRY_F_Pos 8 /*!< UART SC_FSR: RX_ERETRY_F Position */ -#define UART_SC_FSR_RX_ERETRY_F_Msk (1ul << UART_SC_FSR_RX_ERETRY_F_Pos) /*!< UART SC_FSR: RX_ERETRY_F Mask */ - -#define UART_SC_FSR_TX_ERETRY_F_Pos 9 /*!< UART SC_FSR: TX_ERETRY_F Position */ -#define UART_SC_FSR_TX_ERETRY_F_Msk (1ul << UART_SC_FSR_TX_ERETRY_F_Pos) /*!< UART SC_FSR: TX_ERETRY_F Mask */ - -/* Enable/Disable IrDA Mode */ -#define ENABLEIrDA 1 /*!< Enable IrDA */ -#define DISABLEIrDA 0 /*!< Disable IrDA */ - -/* define IrDA Direction */ -#define IrDA_TX 0 /*!< Set IrDA Tx direction*/ -#define IrDA_RX 1 /*!< Set IrDA Rx direction*/ - -/* define RTS signal */ -#define UART_RTS_HIGH 1 /*!< Set RTS high*/ -#define UART_RTS_LOW 0 /*!< Set RTS low*/ - -/* define IOCTL command of UART operation mode, interrupt or pooling mode */ -#define UART_IOC_SETTXMODE 1 /*!< Set Tx Mode */ -#define UART_IOC_SETRXMODE 2 /*!< Set Tx Mode */ -#define UART_IOC_GETRECCHARINFO 3 /*!< Get receive character */ -#define UART_IOC_SETUARTPARAMETER 4 /*!< Config UART */ -//#define UART_IOC_PERFORMBLUETOOTH 5 -#define UART_IOC_PERFORMIrDA 6 /*!< Config IrDA */ -#define UART_IOC_GETUARTREGISTERVALUE 7 /*!< Get UART register value*/ -#define UART_IOC_GETERRNO 8 /*!< Get rrror code */ -//#define UART_IOC_SETMODEMLOOPBACK 9 -//#define UART_IOC_GETDSRSTATE 10 -//#define UART_IOC_SETDTRSIGNAL 11 -#define UART_IOC_SETINTERRUPT 12 /*!< Set interrupt */ -#define UART_IOC_SETBREAKCONTROL 13 /*!< Set break */ -#define UART_IOC_GETBIISTATE 14 /*!< Get break status */ -#define UART_IOC_GETCTSSTATE 15 /*!< Get CTS status */ -#define UART_IOC_SETRTSSIGNAL 16 /*!< Set RTS signal */ -#define UART_IOC_SETMODEMINTERRUPT 17 /*!< Set modem interrupt */ -#define UART_IOC_ENABLEHWFLOWCONTROL 18 /*!< Enable H/W flow control */ -#define UART_IOC_DISABLEHWFLOWCONTROL 19 /*!< Disable H/W flow control */ -//#define UART_IOC_ENABLESWFLOWCONTROL 20 /*!< Enable S/W flow control */ -//#define UART_IOC_DISABLESWFLOWCONTROL 21 /*!< Disable S/W flow control */ -//#define UART_IOC_SETUART1FULLMODEM 22 -//#define UART_IOC_SETUART1HIGHSPEED 23 - -#define UART_IOC_FLUSH_TX_BUFFER 24 /*!< Flush Tx buffer */ -#define UART_IOC_FLUSH_RX_BUFFER 25 /*!< Flus Rx buffer */ - -#define UART_IOC_SET_RS485_MODE 26 /*!< Select RS485 Mode */ -#define UART_IOC_SEND_RS485_ADDRESS 27 /*!< Send RS485 Address*/ -#define UART_IOC_SET_RS485_RXOFF 28 /*!< Select RS485 Mode */ -#define UART_IOC_SET_ALTCTL_REG 29 /*!< Set ALT_CTL register */ -#define UART_IOC_GET_ALTCTL_REG 30 /*!< Get ALT_CTL register */ - -#define UART_IOC_SET_LIN_MODE 31 /*!< Select LIN Mode */ - - -/* Enable/Disable Modem interrupt */ -#define UART_ENABLE_MODEM_INT 0 /*!< Enable Modem interrupt */ -#define UART_DISABLE_MODEM_INT 1 /*!< Disable Modem interrupt */ - -/* These error code can get from UART_IOC_GETERRNO */ -#define UART_ERR_PARITY_INVALID -1 /*!< Parity invalid */ -#define UART_ERR_DATA_BITS_INVALID -2 /*!< Data bits invalid */ -#define UART_ERR_STOP_BITS_INVALID -3 /*!< Stop bit invalid */ -#define UART_ERR_TRIGGERLEVEL_INVALID -4 /*!< Trigger level invalid */ -#define UART_ERR_CHANNEL_INVALID -5 /*!< UART channel invalid */ -#define UART_ERR_ALLOC_MEMORY_FAIL -6 /*!< Allocate memory error */ -//#define UART_ERR_CLOCK_SOURCE_INVALID -7 /*!< Clock Source invalid */ -//#define UART_ERR_BAUDRATE_INVALID -8 /*!< Baudrate invalid */ -//#define UART_ERR_CONFIGURE_BT_FAIL -9 -#define UART_ERR_IrDA_COMMAND_INVALID -10 /*!< IrDA mode invalid */ -#define UART_ERR_TX_BUF_NOT_ENOUGH -11 /*!< Tx buffer not enough */ -#define UART_ERR_OPERATE_MODE_INVALID -12 /*!< Operation mode invalid */ -#define UART_ERR_SET_BAUDRATE_FAIL -13 /*!< Set baudrate fail */ - -/* These are the error code actually returns to user application */ -#define UART_ERR_ID 0xFFFF1700 /*!< UART library ID */ -#define UART_ENOTTY (1 | UART_ERR_ID) /*!< Command not support */ -#define UART_ENODEV (2 | UART_ERR_ID) /*!< Interface number out of range */ -#define UART_EIO (3 | UART_ERR_ID) /*!< Read/Write error */ - -/*@}*/ /* end of group N9H30_UART_EXPORTED_CONSTANTS */ - - -/** @addtogroup N9H30_UART_EXPORTED_STRUCTS UART Exported Structs - @{ -*/ - -/// @cond HIDDEN_SYMBOLS -/*----------------------------------------------------*/ -/* Define UART buffer structure */ -/*----------------------------------------------------*/ -typedef struct UART_BUFFER_STRUCT -{ - UINT32 volatile uUartTxHead, uUartTxTail; - UINT32 volatile uUartRxHead, uUartRxTail; - - PUINT8 pucUartTxBuf; - PUINT8 pucUartRxBuf; - PVOID pvUartVector; - BOOL bIsUseUARTTxInt; - BOOL bIsUseUARTRxInt; - BOOL bIsUARTInitial; - - PINT pucUARTFlag; - PINT pucLINFlag; - INT32 volatile nErrno; - -} UART_BUFFER_T; -/// @endcond HIDDEN_SYMBOLS - -/** \brief Structure type of UART data - */ -#if 0 -#define UART0 0 /*!< UART0 channel */ -#define UART1 1 /*!< UART1 channel */ -#define UART2 2 /*!< UART2 channel */ -#define UART3 3 /*!< UART3 channel */ -#define UART4 4 /*!< UART4 channel */ -#define UART5 5 /*!< UART5 channel */ -#define UART6 6 /*!< UART6 channel */ -#define UART7 7 /*!< UART7 channel */ -#define UART8 8 /*!< UART8 channel */ -#define UART9 9 /*!< UART9 channel */ -#define UARTA 10 /*!< UARTA channel */ - -typedef struct UART_STRUCT -{ - UINT32 uFreq; /*!< UART clock frequency */ - UINT32 uBaudRate; /*!< Baudrate */ - UINT8 ucUartNo; /*!< UART Port */ - UINT8 ucDataBits; /*!< Select Data length */ - UINT8 ucStopBits; /*!< Select stop bit length */ - UINT8 ucParity; /*!< Select Parity */ - UINT8 ucRxTriggerLevel; /*!< Select Rx FIFO trigger level */ -} UART_T; -#else - -typedef struct -{ - __IO uint32_t DAT; /*!< [0x0000] UART Receive/Transmit Buffer Register */ - __IO uint32_t INTEN; /*!< [0x0004] UART Interrupt Enable Register */ - __IO uint32_t FIFO; /*!< [0x0008] UART FIFO Control Register */ - __IO uint32_t LINE; /*!< [0x000c] UART Line Control Register */ - __IO uint32_t MODEM; /*!< [0x0010] UART Modem Control Register */ - __IO uint32_t MODEMSTS; /*!< [0x0014] UART Modem Status Register */ - __IO uint32_t FIFOSTS; /*!< [0x0018] UART FIFO Status Register */ - __IO uint32_t INTSTS; /*!< [0x001c] UART Interrupt Status Register */ - __IO uint32_t TOUT; /*!< [0x0020] UART Time-out Register */ - __IO uint32_t BAUD; /*!< [0x0024] UART Baud Rate Divider Register */ - __IO uint32_t IRDA; /*!< [0x0028] UART IrDA Control Register */ - __IO uint32_t ALTCTL; /*!< [0x002c] UART Alternate Control/Status Register */ - __IO uint32_t FUNCSEL; /*!< [0x0030] UART Function Select Register */ - __IO uint32_t LINCTL; /*!< [0x0034] UART LIN Control Register */ - __IO uint32_t LINSTS; /*!< [0x0038] UART LIN Status Register */ -} UART_T; - -#define UART0 ((UART_T *) UART0_BA) /*!< UART0 channel */ -#define UART1 ((UART_T *) UART1_BA) /*!< UART1 channel */ -#define UART2 ((UART_T *) UART2_BA) /*!< UART2 channel */ -#define UART3 ((UART_T *) UART3_BA) /*!< UART3 channel */ -#define UART4 ((UART_T *) UART4_BA) /*!< UART4 channel */ -#define UART5 ((UART_T *) UART5_BA) /*!< UART5 channel */ -#define UART6 ((UART_T *) UART6_BA) /*!< UART6 channel */ -#define UART7 ((UART_T *) UART7_BA) /*!< UART7 channel */ -#define UART8 ((UART_T *) UART8_BA) /*!< UART8 channel */ -#define UART9 ((UART_T *) UART9_BA) /*!< UART9 channel */ -#define UARTA ((UART_T *) UARTA_BA) /*!< UARTA channel */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_FUNCSEL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_FIFO_RFITL_Pos (4) /*!< UART_T::FIFO: RFITL Position */ -#define UART_FIFO_RFITL_Msk (0xful << UART_FIFO_RFITL_Pos) /*!< UART_T::FIFO: RFITL Mask */ - -#define UART_FIFO_RTSTRGLV_Pos (16) /*!< UART_T::FIFO: RTSTRGLV Position */ -#define UART_FIFO_RTSTRGLV_Msk (0xful << UART_FIFO_RTSTRGLV_Pos) /*!< UART_T::FIFO: RTSTRGLV Mask */ - -#define UART_FUNCSEL_FUNCSEL_Pos (0) /*!< UART_T::FUNCSEL: FUNCSEL Position */ -#define UART_FUNCSEL_FUNCSEL_Msk (0x3ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_T::FUNCSEL: FUNCSEL Mask */ - -#define UART_FUNCSEL_UART (0x0ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set UART Function (Default) \hideinitializer */ -#define UART_FUNCSEL_LIN (0x1ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set LIN Function \hideinitializer */ -#define UART_FUNCSEL_IrDA (0x2ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set IrDA Function \hideinitializer */ -#define UART_FUNCSEL_RS485 (0x3ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set RS485 Function \hideinitializer */ - -#endif - -/** \brief Structure type of UART register - */ -typedef struct UART_REGISTER_STRUCT -{ - UINT32 uUartReg[14][2]; /*!< Store UART register value */ -} UART_REGISTER_T; - -/*@}*/ /* end of group N9H30_UART_EXPORTED_STRUCTS */ - - -/** @addtogroup N9H30_UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -/** - * @brief Calculate UART baudrate mode0 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode0 divider - * \hideinitializer - * - */ -#define UART_BAUD_MODE0_DIVIDER(u32SrcFreq, u32BaudRate) (((u32SrcFreq + (u32BaudRate*8)) / u32BaudRate >> 4)-2) - -/** - * @brief Calculate UART baudrate mode2 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode2 divider - * \hideinitializer - */ -#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) (((u32SrcFreq + (u32BaudRate/2)) / u32BaudRate)-2) - - -/** - * @brief Get Rx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not empty - * @retval >=1 Rx FIFO is empty - * - * @details This macro get Receiver FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_RX_EMPTY(uart) ((uart)->FIFOSTS & UART_FSR_RX_EMPTY_Msk) - -/** - * @brief Check TX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 TX FIFO is full - * @retval 0 TX FIFO is not full - * - * @details This macro check TX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_TX_FULL(uart) (((uart)->FIFOSTS & UART_FSR_TX_FULL_Msk)>>UART_FSR_TX_FULL_Pos) - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UART_WRITE(uart, u8Data) ((uart)->DAT = (u8Data)) - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module - * - * @return The oldest data byte in RX FIFO. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UART_READ(uart) ((uart)->DAT) - -#define UART_ENABLE_INT(uart, u32eIntSel) ((uart)->INTEN |= (u32eIntSel)) -#define UART_DISABLE_INT(uart, u32eIntSel) ((uart)->INTEN &= ~ (u32eIntSel)) - -/*-----------------------------------------*/ -/* interface function declarations */ -/*-----------------------------------------*/ -INT uartOpen(PVOID param); -INT uartInit(void); -INT uartIoctl(INT nNum, UINT32 uCom, UINT32 uArg0, UINT32 uArg1); -INT32 uartRelease(INT nNum); -INT32 uartWrite(INT nNum, PUINT8 pucBuf, UINT32 uLen); -INT32 uartRead(INT nNum, PUINT8 pucBuf, UINT32 uLen); - - -void UART_Open(UART_T *uart, uint32_t u32baudrate); -void UART_Close(UART_T *uart); -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -/*@}*/ /* end of group N9H30_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_UART_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_usbd.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_usbd.h deleted file mode 100644 index 5f8719b45d8..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_usbd.h +++ /dev/null @@ -1,937 +0,0 @@ -/**************************************************************************//** - * @file usbd.h - * @brief N9H30 USBD driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_USBD_H__ -#define __NU_USBD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_USBD_Driver USBD Driver - @{ -*/ - -/** @addtogroup N9H30_USBD_EXPORTED_CONSTANTS USBD Exported Constants - @{ -*/ -/// @cond HIDDEN_SYMBOLS -#define USBD_MAX_EP 12 - -#define Maximum(a,b) (a)>(b) ? (a) : (b) -#define Minimum(a,b) (a)<(b) ? (a) : (b) - - -#define CEP 0xff /*!< Control Endpoint \hideinitializer */ -#define EPA 0 /*!< Endpoint A \hideinitializer */ -#define EPB 1 /*!< Endpoint B \hideinitializer */ -#define EPC 2 /*!< Endpoint C \hideinitializer */ -#define EPD 3 /*!< Endpoint D \hideinitializer */ -#define EPE 4 /*!< Endpoint E \hideinitializer */ -#define EPF 5 /*!< Endpoint F \hideinitializer */ -#define EPG 6 /*!< Endpoint G \hideinitializer */ -#define EPH 7 /*!< Endpoint H \hideinitializer */ -#define EPI 8 /*!< Endpoint I \hideinitializer */ -#define EPJ 9 /*!< Endpoint J \hideinitializer */ -#define EPK 10 /*!< Endpoint K \hideinitializer */ -#define EPL 11 /*!< Endpoint L \hideinitializer */ - -/* USB Request Type */ -#define REQ_STANDARD 0x00 -#define REQ_CLASS 0x20 -#define REQ_VENDOR 0x40 - -/* USB Standard Request */ -#define GET_STATUS 0x00 -#define CLEAR_FEATURE 0x01 -#define SET_FEATURE 0x03 -#define SET_ADDRESS 0x05 -#define GET_DESCRIPTOR 0x06 -#define SET_DESCRIPTOR 0x07 -#define GET_CONFIGURATION 0x08 -#define SET_CONFIGURATION 0x09 -#define GET_INTERFACE 0x0A -#define SET_INTERFACE 0x0B -#define SYNC_FRAME 0x0C - -/* USB Descriptor Type */ -#define DESC_DEVICE 0x01 -#define DESC_CONFIG 0x02 -#define DESC_STRING 0x03 -#define DESC_INTERFACE 0x04 -#define DESC_ENDPOINT 0x05 -#define DESC_QUALIFIER 0x06 -#define DESC_OTHERSPEED 0x07 -#define DESC_IFPOWER 0x08 -#define DESC_OTG 0x09 - -/* USB HID Descriptor Type */ -#define DESC_HID 0x21 -#define DESC_HID_RPT 0x22 - -/* USB Descriptor Length */ -#define LEN_DEVICE 18 -#define LEN_QUALIFIER 10 -#define LEN_CONFIG 9 -#define LEN_INTERFACE 9 -#define LEN_ENDPOINT 7 -#define LEN_OTG 5 -#define LEN_HID 9 - -/* USB Endpoint Type */ -#define EP_ISO 0x01 -#define EP_BULK 0x02 -#define EP_INT 0x03 - -#define EP_INPUT 0x80 -#define EP_OUTPUT 0x00 - -/* USB Feature Selector */ -#define FEATURE_DEVICE_REMOTE_WAKEUP 0x01 -#define FEATURE_ENDPOINT_HALT 0x00 -/// @endcond HIDDEN_SYMBOLS -/********************* Bit definition of CEPCTL register **********************/ -#define USB_CEPCTL_NAKCLR ((uint32_t)0x00000000) /*!PHYCTL |= (USBD_PHYCTL_PHYEN_Msk|USBD_PHYCTL_DPPUEN_Msk))) /*!PHYCTL &= ~USBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= USBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~USBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~USBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= USBD_PHYCTL_DPPUEN_Msk)) /*!FADDR = (addr)) /*!FADDR)) /*!GINTEN = (intr)) /*!BUSINTEN = (intr)) /*!BUSINTSTS) /*!BUSINTSTS = flag) /*!CEPINTEN = (intr)) /*!CEPINTSTS = flag) /*!CEPCTL = flag) /*!CEPTXCNT = size) /*!EP[ep].EPMPS = (size)) /*!EP[ep].EPINTEN = (intr)) /*!EP[ep].EPINTSTS) /*!EP[ep].EPINTSTS = (flag)) /*!DMACNT = len) /*!DMAADDR = addr) /*!DMACTL = (USBD->DMACTL & ~USBD_DMACTL_EPNUM_Msk) | USBD_DMACTL_DMARD_Msk | epnum) /*!DMACTL = (USBD->DMACTL & ~(USBD_DMACTL_EPNUM_Msk | USBD_DMACTL_DMARD_Msk)) | epnum) /*!DMACTL |= USBD_DMACTL_DMAEN_Msk) /*!PHYCTL & USBD_PHYCTL_VBUSDET_Msk)) /*!DMACNT = 0; - USBD->DMACTL = 0x80; - USBD->DMACTL = 0x00; -} -/** - * @brief USBD_SetEpBufAddr, Set Endpoint buffer address - * @param[in] u32Ep Endpoint Number - * @param[in] u32Base Buffer Start Address - * @param[in] u32Len Buffer length - * @retval None. - */ -static __inline void USBD_SetEpBufAddr(uint32_t u32Ep, uint32_t u32Base, uint32_t u32Len) -{ - if (u32Ep == CEP) - { - USBD->CEPBUFSTART = u32Base; - USBD->CEPBUFEND = u32Base + u32Len - 1; - } - else - { - USBD->EP[u32Ep].EPBUFSTART = u32Base; - USBD->EP[u32Ep].EPBUFEND = u32Base + u32Len - 1; - } -} - -/** - * @brief USBD_ConfigEp, Config Endpoint - * @param[in] u32Ep USB endpoint - * @param[in] u32EpNum Endpoint number - * @param[in] u32EpType Endpoint type - * @param[in] u32EpDir Endpoint direction - * @retval None. - */ -static __inline void USBD_ConfigEp(uint32_t u32Ep, uint32_t u32EpNum, uint32_t u32EpType, uint32_t u32EpDir) -{ - if (u32EpType == USB_EP_CFG_TYPE_BULK) - USBD->EP[u32Ep].EPRSPCTL = (USB_EP_RSPCTL_FLUSH | USB_EP_RSPCTL_MODE_AUTO); - else if (u32EpType == USB_EP_CFG_TYPE_INT) - USBD->EP[u32Ep].EPRSPCTL = (USB_EP_RSPCTL_FLUSH | USB_EP_RSPCTL_MODE_MANUAL); - else if (u32EpType == USB_EP_CFG_TYPE_ISO) - USBD->EP[u32Ep].EPRSPCTL = (USB_EP_RSPCTL_FLUSH | USB_EP_RSPCTL_MODE_FLY); - - USBD->EP[u32Ep].EPCFG = (u32EpType | u32EpDir | USB_EP_CFG_VALID | (u32EpNum << 4)); -} - -/** - * @brief Set USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - */ -static __inline void USBD_SetEpStall(uint32_t u32Ep) -{ - if (u32Ep == CEP) - USBD_SET_CEP_STATE(USB_CEPCTL_STALL); - else - { - USBD->EP[u32Ep].EPRSPCTL = USBD->EP[u32Ep].EPRSPCTL & 0xf7 | USB_EP_RSPCTL_HALT; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Set USB endpoint stall state, endpoint will return STALL token. - */ -static __inline void USBD_SetStall(uint32_t u32EpNum) -{ - int i; - - if (u32EpNum == 0) - USBD_SET_CEP_STATE(USB_CEPCTL_STALL); - else - { - for (i = 0; i < USBD_MAX_EP; i++) - { - if (((USBD->EP[i].EPCFG & 0xf0) >> 4) == u32EpNum) - { - USBD->EP[i].EPRSPCTL = USBD->EP[i].EPRSPCTL & 0xf7 | USB_EP_RSPCTL_HALT; - } - } - } -} - -/** - * @brief Clear USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - */ -static __inline void USBD_ClearEpStall(uint32_t u32Ep) -{ - USBD->EP[u32Ep].EPRSPCTL = USB_EP_RSPCTL_TOGGLE; -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Clear USB endpoint stall state, endpoint will return ACK/NAK token. - */ -static __inline void USBD_ClearStall(uint32_t u32EpNum) -{ - int i; - - for (i = 0; i < USBD_MAX_EP; i++) - { - if (((USBD->EP[i].EPCFG & 0xf0) >> 4) == u32EpNum) - { - USBD->EP[i].EPRSPCTL = USB_EP_RSPCTL_TOGGLE; - } - } -} - -/** - * @brief Get USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * @details Get USB endpoint stall state of the specified endpoint ID. - */ -static __inline uint32_t USBD_GetEpStall(uint32_t u32Ep) -{ - return (USBD->EP[u32Ep].EPRSPCTL & USB_EP_RSPCTL_HALT); -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @retval 0: USB endpoint is not stalled. - * @retval non-0: USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - */ -static __inline uint32_t USBD_GetStall(uint32_t u32EpNum) -{ - int i; - - for (i = 0; i < USBD_MAX_EP; i++) - { - if (((USBD->EP[i].EPCFG & 0xf0) >> 4) == u32EpNum) - { - return (USBD->EP[i].EPRSPCTL & USB_EP_RSPCTL_HALT); - } - } - return 0; -} - - -/*-------------------------------------------------------------------------------------------*/ -typedef void (*VENDOR_REQ)(void); /*!CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - /* Check interface 1 is available or not */ - if ((tCAN->IF[0ul].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - if (gu8LockCanIf[u32CanNo][0ul] == 0ul) - { - gu8LockCanIf[u32CanNo][0ul] = 1u; - u32FreeIfNo = 0ul; - } - else - { - } - } - else - { - } - - /* Or check interface 2 is available or not */ - if (u32FreeIfNo == 2ul) - { - if ((tCAN->IF[1ul].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - if (gu8LockCanIf[u32CanNo][1ul] == 0ul) - { - gu8LockCanIf[u32CanNo][1ul] = 1u; - u32FreeIfNo = 1ul; - } - else - { - } - } - else - { - } - } - else - { - } - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - - return u32FreeIfNo; -} - -/** - * @brief Check if any interface is available in a time limitation then lock it for usage. - * @param[in] tCAN The pointer to CAN module base address. - * @retval 0 IF0 is free - * @retval 1 IF1 is free - * @retval 2 No IF is free - * @details Search the first free message interface, starting from 0. If no interface is - * it will try again until time out. If a interface is available, set a flag to - * lock the interface. - */ -static uint32_t LockIF_TL(CAN_T *tCAN) -{ - uint32_t u32Count; - uint32_t u32FreeIfNo; - - for (u32Count = 0ul; u32Count < RETRY_COUNTS; u32Count++) - { - if ((u32FreeIfNo = LockIF(tCAN)) != 2ul) - { - break; - } - else - { - } - } - - return u32FreeIfNo; -} - -/** - * @brief Release locked interface. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Info The interface number, 0 or 1. - * @return none - * @details Release the locked interface. - */ -static void ReleaseIF(CAN_T *tCAN, uint32_t u32IfNo) -{ - uint32_t u32IntMask; - uint32_t u32CanNo; - - if (u32IfNo >= 2ul) - { - } - else - { - if (tCAN == CAN0) - u32CanNo = 0ul; -#if defined(CAN1) - else if (tCAN == CAN1) - u32CanNo = 1ul; -#endif -#if defined(CAN2) - else if (tCAN == CAN2) - u32CanNo = 2ul; -#endif -#if defined(CAN3) - else if (tCAN == CAN3) - u32CanNo = 3ul; -#endif - else - return ; - - - /* Disable CAN interrupt */ - u32IntMask = tCAN->CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - gu8LockCanIf[u32CanNo][u32IfNo] = 0u; - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - } -} - -static int can_update_spt(int sampl_pt, int tseg, int *tseg1, int *tseg2) -{ - *tseg2 = tseg + 1 - (sampl_pt * (tseg + 1)) / 1000; - if (*tseg2 < TSEG2_MIN) - { - *tseg2 = TSEG2_MIN; - } - else - { - } - - if (*tseg2 > TSEG2_MAX) - { - *tseg2 = TSEG2_MAX; - } - else - { - } - - *tseg1 = tseg - *tseg2; - if (*tseg1 > TSEG1_MAX) - { - *tseg1 = TSEG1_MAX; - *tseg2 = tseg - *tseg1; - } - else - { - } - - return 1000 * (tseg + 1 - *tseg2) / (tseg + 1); -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Enter initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8Mask Following values can be used. - * \ref CAN_CON_DAR_Msk Disable automatic retransmission. - * \ref CAN_CON_EIE_Msk Enable error interrupt. - * \ref CAN_CON_SIE_Msk Enable status interrupt. - * \ref CAN_CON_IE_Msk CAN interrupt. - * @return None - * @details This function is used to set CAN to enter initialization mode and enable access bit timing - * register. After bit timing configuration ready, user must call CAN_LeaveInitMode() - * to leave initialization mode and lock bit timing register to let new configuration - * take effect. - */ -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask) -{ - tCAN->CON = u8Mask | (CAN_CON_INIT_Msk | CAN_CON_CCE_Msk); -} - - -/** - * @brief Leave initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to set CAN to leave initialization mode to let - * bit timing configuration take effect after configuration ready. - */ -void CAN_LeaveInitMode(CAN_T *tCAN) -{ - tCAN->CON &= (~(CAN_CON_INIT_Msk | CAN_CON_CCE_Msk)); - while (tCAN->CON & CAN_CON_INIT_Msk) - { - /* Check INIT bit is released */ - } -} - -/** - * @brief Wait message into message buffer in basic mode. - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to wait message into message buffer in basic mode. Please notice the - * function is polling NEWDAT bit of MCON register by while loop and it is used in basic mode. - */ -void CAN_WaitMsg(CAN_T *tCAN) -{ - tCAN->STATUS = 0x0ul; /* clr status */ - - while (1) - { - if (tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) /* check new data */ - { - /* New Data IN */ - break; - } - else - { - } - - if (tCAN->STATUS & CAN_STATUS_RXOK_Msk) - { - /* Rx OK */ - } - else - { - } - - if (tCAN->STATUS & CAN_STATUS_LEC_Msk) - { - /* Error */ - } - else - { - } - } -} - -/** - * @brief Get current bit rate - * @param[in] tCAN The pointer to CAN module base address. - * @return Current Bit-Rate (kilo bit per second) - * @details Return current CAN bit rate according to the user bit-timing parameter settings - */ -uint32_t CAN_GetCANBitRate(CAN_T *tCAN) -{ - uint32_t u32Tseg1, u32Tseg2; - uint32_t u32Bpr; - - u32Tseg1 = (tCAN->BTIME & CAN_BTIME_TSEG1_Msk) >> CAN_BTIME_TSEG1_Pos; - u32Tseg2 = (tCAN->BTIME & CAN_BTIME_TSEG2_Msk) >> CAN_BTIME_TSEG2_Pos; - u32Bpr = (tCAN->BTIME & CAN_BTIME_BRP_Msk) | (tCAN->BRPE << 6ul); - - return (CAN_Clock / (u32Bpr + 1ul) / (u32Tseg1 + u32Tseg2 + 3ul)); -} - -/** - * @brief Switch the CAN into test mode. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8TestMask Specifies the configuration in test modes - * \ref CAN_TEST_BASIC_Msk Enable basic mode of test mode - * \ref CAN_TEST_SILENT_Msk Enable silent mode of test mode - * \ref CAN_TEST_LBACK_Msk Enable Loop Back Mode of test mode - * \ref CAN_TEST_Tx_Msk Control CAN_TX pin bit field - * @return None - * @details Switch the CAN into test mode. There are four test mode (BASIC/SILENT/LOOPBACK/ - * LOOPBACK combined SILENT/CONTROL_TX_PIN)could be selected. After setting test mode,user - * must call CAN_LeaveInitMode() to let the setting take effect. - */ -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST = u8TestMask; -} - - -/** - * @brief Leave the test mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to Leave the test mode (switch into normal mode). - */ -void CAN_LeaveTestMode(CAN_T *tCAN) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST &= ~(CAN_TEST_LBACK_Msk | CAN_TEST_SILENT_Msk | CAN_TEST_BASIC_Msk); - tCAN->CON &= (~CAN_CON_TEST_Msk); -} - -/** - * @brief Get the waiting status of a received message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @retval non-zero The corresponding message object has a new data bit is set. - * @retval 0 No message object has new data. - * @details This function is used to get the waiting status of a received message. - */ -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj) -{ - return (u8MsgObj < 16ul ? tCAN->NDAT1 & (1ul << u8MsgObj) : tCAN->NDAT2 & (1ul << (u8MsgObj - 16ul))); -} - - -/** - * @brief Send CAN message in BASIC mode of test mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure containing data to transmit. - * @return TRUE: Transmission OK - * FALSE: Check busy flag of interface 0 is timeout - * @details The function is used to send CAN message in BASIC mode of test mode. Before call the API, - * the user should be call CAN_EnterTestMode(CAN_TEST_BASIC) and let CAN controller enter - * basic mode of test mode. Please notice IF1 Registers used as Tx Buffer in basic mode. - */ -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg) -{ - uint32_t i = 0ul; - int32_t rev = 1l; - - while (tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - } - - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - if (pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[0].ARB1 = 0ul; - tCAN->IF[0].ARB2 = (((pCanMsg->Id) & 0x7FFul) << 2ul) ; - } - else - { - /* extended ID*/ - tCAN->IF[0].ARB1 = (pCanMsg->Id) & 0xFFFFul; - tCAN->IF[0].ARB2 = ((pCanMsg->Id) & 0x1FFF0000ul) >> 16ul | CAN_IF_ARB2_XTD_Msk; - - } - - if (pCanMsg->FrameType) - { - tCAN->IF[0].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[0].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - tCAN->IF[0].MCON = (tCAN->IF[0].MCON & (~CAN_IF_MCON_DLC_Msk)) | pCanMsg->DLC; - tCAN->IF[0].DAT_A1 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[1] << 8) | pCanMsg->Data[0]); - tCAN->IF[0].DAT_A2 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[3] << 8) | pCanMsg->Data[2]); - tCAN->IF[0].DAT_B1 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[5] << 8) | pCanMsg->Data[4]); - tCAN->IF[0].DAT_B2 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[7] << 8) | pCanMsg->Data[6]); - - /* request transmission*/ - tCAN->IF[0].CREQ &= (~CAN_IF_CREQ_BUSY_Msk); - if (tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /* Cannot clear busy for sending ...*/ - rev = 0l; /* return FALSE */ - } - else - { - tCAN->IF[0].CREQ |= CAN_IF_CREQ_BUSY_Msk; /* sending */ - - for (i = 0ul; i < 0xFFFFFul; i++) - { - if ((tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - break; - } - else - { - } - } - - if (i >= 0xFFFFFul) - { - /* Cannot send out... */ - rev = 0l; /* return FALSE */ - } - else - { - } - } - - return rev; -} - -/** - * @brief Get a message information in BASIC mode. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @return FALSE No any message received. - * TRUE Receive a message success. - * - */ -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - - if ((tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) == 0ul) - { - /* In basic mode, receive data always save in IF2 */ - rev = 0; /* return FALSE */ - } - else - { - - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - tCAN->IF[1].CMASK = CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - if ((tCAN->IF[1].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0ul) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 >> 2) & 0x07FFul; - - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 & 0x1FFFul) << 16; - pCanMsg->Id |= (uint32_t)tCAN->IF[1].ARB1; - } - - pCanMsg->FrameType = (((tCAN->IF[1].ARB2 & CAN_IF_ARB2_DIR_Msk) >> CAN_IF_ARB2_DIR_Pos)) ? 0ul : 1ul; - - pCanMsg->DLC = (uint8_t)(tCAN->IF[1].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - } - - return rev; -} - -/** - * @brief Set Rx message object, include ID mask. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u32idmask Specifies the identifier mask used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* Command Setting */ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFul) << 2; - } - else - { - tCAN->IF[u32MsgIfNum].ARB1 = u32id & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000ul) >> 16; - } - - tCAN->IF[u32MsgIfNum].MASK1 = (u32idmask & 0xFFFFul); - tCAN->IF[u32MsgIfNum].MASK2 = (u32idmask >> 16) & 0xFFFFul; - - /* tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; */ - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if (u8singleOrFifoLast) - { - tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_A2 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B2 = 0ul; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Set Rx message object - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* Command Setting */ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFul) << 2; - } - else - { - tCAN->IF[u32MsgIfNum].ARB1 = u32id & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000ul) >> 16; - } - - /* tCAN->IF[u8MsgIfNum].MCON |= CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; */ - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if (u8singleOrFifoLast) - { - tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_A2 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B2 = 0ul; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Gets the message - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8Release Specifies the message release indicator. - * This parameter can be one of the following values: - * TRUE: the message object is released when getting the data. - * FALSE:the message object is not released. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * @retval TRUE Success - * @retval FALSE No any message received - * @details Gets the message, if received. - */ -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if (!CAN_IsNewDataReceived(tCAN, u8MsgObj)) - { - rev = 0; /* return FALSE */ - } - else - { - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_MASK_Msk - | CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_CLRINTPND_Msk - | (u8Release ? CAN_IF_CMASK_TXRQSTNEWDAT_Msk : 0ul) - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - - while (tCAN->IF[u32MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - - if ((tCAN->IF[u32MsgIfNum].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0ul) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[u32MsgIfNum].ARB2 & CAN_IF_ARB2_ID_Msk) >> 2ul; - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = (((tCAN->IF[u32MsgIfNum].ARB2) & 0x1FFFul) << 16) | tCAN->IF[u32MsgIfNum].ARB1; - } - - pCanMsg->DLC = (uint8_t)(tCAN->IF[u32MsgIfNum].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - - ReleaseIF(tCAN, u32MsgIfNum); - } - } - - return rev; -} - - -/** - * @brief Set bus baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * - * @return u32CurrentBitRate Real baud-rate value. - * - * @details The function is used to set bus timing parameter according current clock and target baud-rate. - */ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate) -{ - long rate; - long best_error = 1000000000, error = 0; - int best_tseg = 0, best_brp = 0, brp = 0; - int tsegall, tseg = 0, tseg1 = 0, tseg2 = 0; - int spt_error = 1000, spt = 0, sampl_pt; - uint64_t clock_freq = (uint64_t)0, u64PCLK_DIV = (uint64_t)1; - uint32_t sjw = (uint32_t)1; - - CAN_EnterInitMode(tCAN, (uint8_t)0); - - CAN_Clock = sysGetClock(SYS_PCLK) * 1000000; - - clock_freq = CAN_Clock / u64PCLK_DIV; - - if (u32BaudRate >= (uint32_t)1000000) - { - u32BaudRate = (uint32_t)1000000; - } - - /* Use CIA recommended sample points */ - if (u32BaudRate > (uint32_t)800000) - { - sampl_pt = (int)750; - } - else if (u32BaudRate > (uint32_t)500000) - { - sampl_pt = (int)800; - } - else - { - sampl_pt = (int)875; - } - - /* tseg even = round down, odd = round up */ - for (tseg = (TSEG1_MAX + TSEG2_MAX) * 2ul + 1ul; tseg >= (TSEG1_MIN + TSEG2_MIN) * 2ul; tseg--) - { - tsegall = 1ul + tseg / 2ul; - /* Compute all possible tseg choices (tseg=tseg1+tseg2) */ - brp = clock_freq / (tsegall * u32BaudRate) + tseg % 2; - /* chose brp step which is possible in system */ - brp = (brp / BRP_INC) * BRP_INC; - - if ((brp < BRP_MIN) || (brp > BRP_MAX)) - { - continue; - } - rate = clock_freq / (brp * tsegall); - - error = u32BaudRate - rate; - - /* tseg brp biterror */ - if (error < 0) - { - error = -error; - } - if (error > best_error) - { - continue; - } - best_error = error; - if (error == 0) - { - spt = can_update_spt(sampl_pt, tseg / 2, &tseg1, &tseg2); - error = sampl_pt - spt; - if (error < 0) - { - error = -error; - } - if (error > spt_error) - { - continue; - } - spt_error = error; - } - best_tseg = tseg / 2; - best_brp = brp; - - if (error == 0) - { - break; - } - } - - spt = can_update_spt(sampl_pt, best_tseg, &tseg1, &tseg2); - - /* check for sjw user settings */ - /* bt->sjw is at least 1 -> sanitize upper bound to sjw_max */ - if (sjw > SJW_MAX) - { - sjw = SJW_MAX; - } - /* bt->sjw must not be higher than tseg2 */ - if (tseg2 < sjw) - { - sjw = tseg2; - } - - /* real bit-rate */ - u32BaudRate = clock_freq / (best_brp * (tseg1 + tseg2 + 1)); - - tCAN->BTIME = ((uint32_t)(tseg2 - 1ul) << CAN_BTIME_TSEG2_Pos) | ((uint32_t)(tseg1 - 1ul) << CAN_BTIME_TSEG1_Pos) | - ((uint32_t)(best_brp - 1ul) & CAN_BTIME_BRP_Msk) | (sjw << CAN_BTIME_SJW_Pos); - tCAN->BRPE = ((uint32_t)(best_brp - 1ul) >> 6) & 0x0Ful; - - /* printf("\n bitrate = %d \n", CAN_GetCANBitRate(tCAN)); */ - - CAN_LeaveInitMode(tCAN); - - return u32BaudRate; -} - -/** - * @brief The function is used to disable all CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * - * @return None - * - * @details No Status Change Interrupt and Error Status Interrupt will be generated. - */ -void CAN_Close(CAN_T *tCAN) -{ - CAN_DisableInt(tCAN, (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - -/** - * @brief Set CAN operation mode and target baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * @param[in] u32Mode The CAN operation mode. Valid values are: - * - \ref CAN_NORMAL_MODE Normal operation. - * - \ref CAN_BASIC_MODE Basic mode. - * @return u32CurrentBitRate Real baud-rate value. - * - * @details Set bus timing parameter according current clock and target baud-rate. - * In Basic mode, IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer. - */ -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode) -{ - uint32_t u32CurrentBitRate; - - u32CurrentBitRate = CAN_SetBaudRate(tCAN, u32BaudRate); - - if (u32Mode == CAN_BASIC_MODE) - { - CAN_EnterTestMode(tCAN, (uint8_t)CAN_TEST_BASIC_Msk); - } - else - { - } - - return u32CurrentBitRate; -} - -/** - * @brief The function is used to configure a transmit object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No useful interface. - * @retval TRUE Config message object success. - * - * @details The two sets of interface registers (IF1 and IF2) control the software access to the Message RAM. - * They buffer the data to be transferred to and from the RAM, avoiding conflicts between software accesses and message reception/transmission. - */ -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* update the contents needed for transmission*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = (((pCanMsg->Id) & 0x7FFul) << 2) | CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - else - { - /* extended ID*/ - tCAN->IF[u32MsgIfNum].ARB1 = (pCanMsg->Id) & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = ((pCanMsg->Id) & 0x1FFF0000ul) >> 16 | - CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_XTD_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - - if (pCanMsg->FrameType) - { - tCAN->IF[u32MsgIfNum].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[1] << 8)) | pCanMsg->Data[0]); - tCAN->IF[u32MsgIfNum].DAT_A2 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[3] << 8)) | pCanMsg->Data[2]); - tCAN->IF[u32MsgIfNum].DAT_B1 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[5] << 8)) | pCanMsg->Data[4]); - tCAN->IF[u32MsgIfNum].DAT_B2 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[7] << 8)) | pCanMsg->Data[6]); - - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_NEWDAT_Msk | pCanMsg->DLC | CAN_IF_MCON_TXIE_Msk | CAN_IF_MCON_EOB_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Set transmit request bit. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return TRUE: Start transmit message. - * - * @details If a transmission is requested by programming bit TxRqst/NewDat (IFn_CMASK[2]), the TxRqst (IFn_MCON[8]) will be ignored. - */ -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk - | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - while (tCAN->IF[u32MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Enable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. Valid values are: - * - \ref CAN_CON_IE_Msk Module interrupt enable. - * - \ref CAN_CON_SIE_Msk Status change interrupt enable. - * - \ref CAN_CON_EIE_Msk Error interrupt enable. - * - * @return None - * - * @details The application software has two possibilities to follow the source of a message interrupt. - * First, it can follow the IntId in the Interrupt Register and second it can poll the Interrupt Pending Register. - */ -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = (tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)) | - (u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - -/** - * @brief Disable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. (CAN_CON_IE_Msk / CAN_CON_SIE_Msk / CAN_CON_EIE_Msk). - * - * @return None - * - * @details The interrupt remains active until the Interrupt Register is back to value zero (the cause of the interrupt is reset) or until IE is reset. - */ -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = tCAN->CON & ~((u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk))); -} - - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32TimeOutCount = 0ul; - - while (CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)TRUE) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)(FALSE); /* return FALSE */ - break; - } - else - { - } - } - - return rev; -} - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * @param[in] u32IDMask Specifies the identifier mask used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32TimeOutCount = 0ul; - - while (CAN_SetRxMsgObjAndMsk(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, u32IDMask, (uint8_t)TRUE) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)FALSE; - break; - } - else - { - } - } - - return rev; -} - -/** - * @brief The function is used to configure several receive message objects. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum The starting MSG RAM number(0 ~ 31). - * @param[in] u32MsgCount the number of MSG RAM of the FIFO. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure receive message objects success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID) -{ - int32_t rev = (int32_t)TRUE; - uint32_t i; - uint32_t u32TimeOutCount; - uint32_t u32EOB_Flag = 0ul; - - for (i = 1ul; i <= u32MsgCount; i++) - { - u32TimeOutCount = 0ul; - - u32MsgNum += (i - 1ul); - - if (i == u32MsgCount) - { - u32EOB_Flag = 1ul; - } - else - { - } - - while (CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)u32EOB_Flag) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)FALSE; - break; - } - else - { - } - } - } - - return rev; -} - - -/** - * @brief Send CAN message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE 1. When operation in basic mode: Transmit message time out. \n - * 2. When operation in normal mode: No useful interface. \n - * @retval TRUE Transmit Message success. - * - * @details The receive/transmit priority for the Message Objects is attached to the message number. - * Message Object 1 has the highest priority, while Message Object 32 has the lowest priority. - */ -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32Tmp; - - u32Tmp = (tCAN->TEST & CAN_TEST_BASIC_Msk); - - if ((tCAN->CON & CAN_CON_TEST_Msk) && u32Tmp) - { - rev = CAN_BasicSendMsg(tCAN, pCanMsg); - } - else - { - if (CAN_SetTxMsg(tCAN, u32MsgNum, pCanMsg) == FALSE) - { - rev = (int32_t)FALSE; - } - else - { - CAN_TriggerTxMsg(tCAN, u32MsgNum); - } - } - - return rev; -} - - -/** - * @brief Gets the message, if received. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No any message received. - * @retval TRUE Receive Message success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32Tmp; - - u32Tmp = (tCAN->TEST & CAN_TEST_BASIC_Msk); - - if ((tCAN->CON & CAN_CON_TEST_Msk) && u32Tmp) - { - rev = CAN_BasicReceiveMsg(tCAN, pCanMsg); - } - else - { - rev = CAN_ReadMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)TRUE, pCanMsg); - } - - return rev; -} - -/** - * @brief Clear interrupt pending bit. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return None - * - * @details An interrupt remains pending until the application software has cleared it. - */ -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum) -{ - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - u32MsgIfNum = 0ul; - } - else - { - } - - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); -} - - -/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CAN_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_cap.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_cap.c deleted file mode 100644 index 0fe3d87424d..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_cap.c +++ /dev/null @@ -1,1520 +0,0 @@ -/**************************************************************************//** -* @file cap.c -* @version V1.00 -* @brief N9H30 CAP driver source file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_cap.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_CAP_Driver CAP Driver - @{ -*/ - -/** @addtogroup N9H30_CAP_EXPORTED_FUNCTIONS CAP Exported Functions - @{ -*/ - -/// @cond HIDDEN_SYMBOLS -PFN_CAP_CALLBACK(pfnCAP_IntHandlerTable)[4] = {0}; -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief CAP interrupt Handler - * - * @param None - * - * @return None - * - * @details Driver internal use API to process the interrupt of CAP - * As interrupt occurrence, the register call back function will be executed - */ -static UINT32 u32EscapeFrame = 0; -//static UINT32 g_u32DeviceType = 0; -static void CAP_IntHandler(void) -{ - UINT32 u32CapInt; - UINT32 uBuf = 0; - - if ((inp32(REG_CLK_HCLKEN) & (0x1 << 26)) == (0x1 << 26)) /* CMOS sensor interface controller clock enabled */ - { - u32CapInt = inp32(REG_CAP_INT); - if ((u32CapInt & (VIEN | VINTF)) == (VIEN | VINTF)) - { - if (pfnCAP_IntHandlerTable[0] != 0) - pfnCAP_IntHandlerTable[0](uBuf, uBuf, u32EscapeFrame); - outp32(REG_CAP_INT, (u32CapInt & ~(MDINTF | ADDRMINTF | MEINTF))); /* Clear Frame end interrupt */ - u32EscapeFrame = u32EscapeFrame + 1; - } - else if ((u32CapInt & (ADDRMIEN | ADDRMINTF)) == (ADDRMIEN | ADDRMINTF)) - { - if (pfnCAP_IntHandlerTable[1] != 0) - pfnCAP_IntHandlerTable[1](uBuf, uBuf, u32EscapeFrame); - outp32(REG_CAP_INT, (u32CapInt & ~(MDINTF | VINTF | MEINTF))); /* Clear Address match interrupt */ - } - else if ((u32CapInt & (MEIEN | MEINTF)) == (MEIEN | MEINTF)) - { - if (pfnCAP_IntHandlerTable[2] != 0) - pfnCAP_IntHandlerTable[2](uBuf, uBuf, u32EscapeFrame); - outp32(REG_CAP_INT, (u32CapInt & ~(MDINTF | VINTF | ADDRMINTF))); /* Clear Memory error interrupt */ - } - else if ((u32CapInt & (MDIEN | MDINTF)) == (MDIEN | MDINTF)) - { - if (pfnCAP_IntHandlerTable[3] != 0) - pfnCAP_IntHandlerTable[3](uBuf, uBuf, u32EscapeFrame); - outp32(REG_CAP_INT, (u32CapInt & ~(VINTF | MEINTF | ADDRMINTF))); /* Clear Memory error interrupt */ - } - } -} - -/** - * @brief Set Inital Frame - * - * @return None - * - * @details If enable interrupt, there is internal counter that records how many frames have pass. - * Set the internal counters to zero. The internal counter may be not a constant - */ -void CAP_SetInitFrame(void) -{ - u32EscapeFrame = 0; -} - -/** - * @brief Get Inital Frame - * - * @retval >0 Internal counters - * - * @details If enable interrupt, there is internal counter that records how many frames have pass. - * Get the internal counters. The internal counter may be not a constant - */ -UINT32 CAP_GetSkipFrame(void) -{ - return u32EscapeFrame; -} - -/** - * @brief CAP Initial - * - * @param[in] bIsEnableSnrClock Enable/Disable sensor clock - * 1 : Enable - * 0 : Disable - * @param[in] eSnrSrc Set CAP clock source. Including : - * - \ref eCAP_SNR_APLL - * - \ref eCAP_SNR_UPLL - * @param[in] u32SensorFreqKHz Specify the sensor clock - * - * @return None - * - * @details To Initial sensor source clock and frequency for CAP interface - */ -void CAP_Init(BOOL bIsEnableSnrClock, E_CAP_SNR_SRC eSnrSrc, UINT32 u32SensorFreqKHz/*KHz unit*/) -{ - UINT32 u32PllClock, u32SenDiv;// u32ExtFreq; - UINT32 u32Div0, u32Div1; - UINT32 u32SenSrc; - volatile UINT32 u32Divider; - - /* MFP_GPI_L : I3=SEN_CLK0, I4=SEN_PCLK, I5=SEN_HSYNC, I6=SEN_VSYNC, I7=SEN_FIFLD*/ - outpw(REG_SYS_GPI_MFPL, (inpw(REG_SYS_GPI_MFPL) & (0x00000FFF)) | 0x33333000); - - /* MFP_GPI_H : SEN_PDATA[0~7]*/ - outpw(REG_SYS_GPI_MFPH, (inpw(REG_SYS_GPI_MFPH) & (0xFFFFFFFF)) | 0x33333333); - - u32SensorFreqKHz = u32SensorFreqKHz * 1000; - switch (eSnrSrc) - { - case eCAP_SNR_APLL: - u32PllClock = sysGetClock(SYS_APLL) * 1000000; - u32SenSrc = 0x2 << 19; //APLL for sensor clock - break; - case eCAP_SNR_UPLL: - u32PllClock = sysGetClock(SYS_UPLL) * 1000000; - u32SenSrc = 0x3 << 19; //UPLL for sensor clock - break; - } - - - u32SenDiv = u32PllClock / (u32SensorFreqKHz); - if (u32PllClock % u32SensorFreqKHz != 0) u32SenDiv = u32SenDiv + 1; - for (u32Div1 = 1; u32Div1 <= 16; u32Div1 = u32Div1 + 1) - { - for (u32Div0 = 1; u32Div0 <= 8; u32Div0 = u32Div0 + 1) - if (u32SenDiv == u32Div0 * u32Div1) break; - if (u32Div0 >= 9) continue; - if (u32SenDiv == u32Div0 * u32Div1) break; - } - //sysprintf("Div0 and Div1 = %d, %d ", u32Div0, u32Div1); - u32Div0 = u32Div0 - 1; - u32Div1 = u32Div1 - 1; - - if (bIsEnableSnrClock) - { - outp32(REG_CLK_HCLKEN, inp32(REG_CLK_HCLKEN) | (1 << 27)); /* CMOS Sensor Reference Clock Output Enable */ - outp32(REG_CLK_HCLKEN, inp32(REG_CLK_HCLKEN) | (1 << 26)); /* CMOS Sensor Interface Controller Clock Enable */ - } - else - { - outp32(REG_CLK_HCLKEN, inp32(REG_CLK_HCLKEN) & ~(1 << 27)); /* CMOS Sensor Reference Clock Output Disabled */ - outp32(REG_CLK_HCLKEN, inp32(REG_CLK_HCLKEN) & ~(1 << 26)); /* CMOS Sensor Interface Controller Clock Disabled */ - } - u32Divider = u32SenSrc | ((u32Div0 << 16) | (u32Div1 << 24)) ; - //sysprintf("Sensor Divider = 0x%08x\n", u32Divider); - - outp32(REG_CLK_DIVCTL3, (inp32(REG_CLK_DIVCTL3) & ~((0x3 << 19) | (0x7 << 16) | (0xF << 24))) | u32Divider); - - -} - -/** - * @brief CAP Open - * - * @param[in] u32SensorFreqKHz Specify the sensor clock - * - * @retval 0 Success - * @retval <0 Error code - * - * @details Initialize the CAP engine. Register a call back for driver internal using - */ -INT32 CAP_Open(UINT32 u32SensorFreqKHz) -{ - - UINT32 u32PllClock;// u32ExtFreq; - UINT32 u32SenDiv; - UINT32 u32Div0, u32Div1; - UINT32 u32SenSrc; - volatile UINT32 u32Divider; - - u32SensorFreqKHz = u32SensorFreqKHz * 1000; - - outp32(REG_CLK_PMCON, inpw(REG_CLK_PMCON) | (0x1 << 4)) ; /* Sensor clock keep on high level */ - outp32(REG_CLK_HCLKEN, inpw(REG_CLK_HCLKEN) | (0x1 << 26)); /* CMOS sensor interface controller clock enable */ - outp32(REG_SYS_AHBIPRST, inp32(REG_SYS_AHBIPRST) | (1 << 10)); /* Video capture (CMOS sensor interface) reset enable. */ - outp32(REG_SYS_AHBIPRST, inp32(REG_SYS_AHBIPRST) & ~(1 << 10)); /* Video capture (CMOS sensor interface) reset disable */ - - switch ((inpw(REG_CLK_DIVCTL3) >> 19) & 0x3) - { - case eCAP_SNR_APLL: - u32PllClock = sysGetClock(SYS_APLL) * 1000000; - u32SenSrc = 0x2 << 19; //APLL for sensor clock - break; - case eCAP_SNR_UPLL: - u32PllClock = sysGetClock(SYS_UPLL) * 1000000; - u32SenSrc = 0x3 << 19; //APLL for sensor clock - break; - } - - u32SenDiv = u32PllClock / (u32SensorFreqKHz); - if (u32PllClock % u32SensorFreqKHz != 0) - u32SenDiv = u32SenDiv + 1; - for (u32Div1 = 1; u32Div1 <= 16; u32Div1 = u32Div1 + 1) - { - for (u32Div0 = 1; u32Div0 <= 8; u32Div0 = u32Div0 + 1) - { - if (u32SenDiv == u32Div0 * u32Div1) - break; - } - if (u32Div0 >= 9) continue; - if (u32SenDiv == u32Div0 * u32Div1) - break; - } - //sysprintf("Div0 and Div1 = %d, %d ", u32Div0, u32Div1); - u32Div0 = u32Div0 - 1; - u32Div1 = u32Div1 - 1; - u32Divider = u32SenSrc | ((u32Div0 << 16) | (u32Div1 << 24)) ; - //sysprintf("Sensor Divider = 0x%08x\n", u32Divider); - - outp32(REG_CLK_DIVCTL3, (inp32(REG_CLK_DIVCTL3) & ~((0x3 << 19) | (0x7 << 16) | (0xF << 24))) | u32Divider); - - sysInstallISR(IRQ_LEVEL_1, CAP_IRQn, (PVOID)CAP_IntHandler); - sysEnableInterrupt(CAP_IRQn); - - return Successful; -} - - -/** - * @brief videoIn Reset - * - * @return None - * - * @details Capture interface reset. - */ -void CAP_Reset(void) -{ - outp32(REG_CAP_CTL, inp32(REG_CAP_CTL) | (VPRST)); - outp32(REG_CAP_CTL, inp32(REG_CAP_CTL) & (~VPRST)); -} - -/** - * @brief videoIn Close - * - * @return None - * - * @details Disable pin function,engine clock and interrupt - */ -void CAP_Close(void) -{ - // 1. Disable IP's interrupt - sysDisableInterrupt(CAP_IRQn); - // 2. Disable IP's clock - outp32(REG_CLK_HCLKEN, inp32(REG_CLK_HCLKEN) & ~(0x1 << 25)); - CAP_Reset(); - outp32(REG_CLK_HCLKEN, inp32(REG_CLK_HCLKEN) & ~(0x1 << 26)); - // 3. Disable Capture pin function -} - -/** - * @brief Configure packet frame buffer. - * - * @param[in] bFrameSwitch Software mode buffer select - * 0: Packet buffer 0 - * 1: Packet buffer 1 - * @return None - * - * @details This function set packet frame buffer control - */ -void CAP_SetPacketFrameBufferControl(BOOL bFrameSwitch) -{ - UINT32 u32Ctl; - u32Ctl = inp32(REG_CAP_CTL) & ~(ADDRSW); - outp32(REG_CAP_CTL, u32Ctl | (bFrameSwitch ? ADDRSW : 0)); -} - -/** -* @brief Get packet frame buffer. - * - * @param pbFrameSwitch Software mode buffer select - * 0: Packet buffer 0 - * 1: Packet buffer 1 - * @return None - * - * @details This function get packet frame buffer control - */ -void CAP_GetPacketFrameBufferControl(PBOOL pbFrameSwitch) -{ - UINT32 u32Ctl = inp32(REG_CAP_CTL); - *pbFrameSwitch = (u32Ctl & ADDRSW) >> 3; -} - -/** -* @brief Configure callback function - * - * @param[in] eIntType Set interrupt type. Including : - * - \ref eCAP_MDINTF - * - \ref eCAP_ADDRMINTF - * - \ref eCAP_MEINTF - * - \ref eCAP_VINTF - * @param[in] pfnCallback Set Callback function. - * The callbakc function : - * void (*PFN_CAP_CALLBACK)(UINT8 u8PacketBufID,UINT8 u8PlanarBufID, UINT8 u8FrameRate); - * @param[in] pfnOldCallback Set Old callback function - * The callbakc function : - * void *(*PFN_CAP_CALLBACK)(UINT8 u8PacketBufID,UINT8 u8PlanarBufID, UINT8 u8FrameRate); - * @retval 0 Success - * @retval <0 Error code - * - * @details This function configure callback function and set trigger level - */ -INT32 CAP_InstallCallback(E_CAP_INT_TYPE eIntType, PFN_CAP_CALLBACK pfnCallback, PFN_CAP_CALLBACK *pfnOldCallback) -{ - if (eIntType == eCAP_VINTF) - { - *pfnOldCallback = pfnCAP_IntHandlerTable[0]; - pfnCAP_IntHandlerTable[0] = (PFN_CAP_CALLBACK)(pfnCallback); - } - else if (eIntType == eCAP_ADDRMINTF) - { - *pfnOldCallback = pfnCAP_IntHandlerTable[1]; - pfnCAP_IntHandlerTable[1] = (PFN_CAP_CALLBACK)(pfnCallback); - } - else if (eIntType == eCAP_MEINTF) - { - *pfnOldCallback = pfnCAP_IntHandlerTable[2]; - pfnCAP_IntHandlerTable[2] = (PFN_CAP_CALLBACK)(pfnCallback); - } - else if (eIntType == eCAP_MDINTF) - { - *pfnOldCallback = pfnCAP_IntHandlerTable[3]; - pfnCAP_IntHandlerTable[3] = (PFN_CAP_CALLBACK)(pfnCallback); - } - else - return E_CAP_INVALID_INT; - return Successful; -} - -/** - * @brief Enable videoIn interrupt. - * - * @param[in] eIntType Interrupt type. Incuding: - * - \ref eCAP_MDINTF - * - \ref eCAP_ADDRMINTF - * - \ref eCAP_MEINTF - * - \ref eCAP_VINTF - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to enable videoIn interrupt. - */ -INT32 CAP_EnableInt(E_CAP_INT_TYPE eIntType) -{ - switch (eIntType) - { - case eCAP_MDINTF: - case eCAP_ADDRMINTF: - case eCAP_MEINTF: - case eCAP_VINTF: - outp32(REG_CAP_INT, inp32(REG_CAP_INT) | eIntType); - break; - default: - return E_CAP_INVALID_INT; - } - return Successful; -} - -/** - * @brief Disable videoIn interrupt - * - * @param[in] eIntType Interrupt type. Incuding: - * - \ref eCAP_MDINTF - * - \ref eCAP_ADDRMINTF - * - \ref eCAP_MEINTF - * - \ref eCAP_VINTF - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to disable videoIn interrupt. - */ -INT32 CAP_DisableInt(E_CAP_INT_TYPE eIntType) -{ - switch (eIntType) - { - case eCAP_MDINTF: - case eCAP_ADDRMINTF: - case eCAP_MEINTF: - case eCAP_VINTF: - outp32(REG_CAP_INT, inp32(REG_CAP_INT) & ~eIntType); - break; - default: - return E_CAP_INVALID_INT; - } - return Successful; -} - -/** - * @brief Check videoIn interrupt - * - * @param[in] eIntType Interrupt type. Incuding: - * - \ref eCAP_MDINTF - * - \ref eCAP_ADDRMINTF - * - \ref eCAP_MEINTF - * - \ref eCAP_VINTF - * @retval 1 Enable - * @retval 0 Disable - * - * @details This function is used to check videoIn interrupt. - */ -BOOL CAP_IsIntEnabled(E_CAP_INT_TYPE eIntType) -{ - UINT32 u32IntEnable = inp32(REG_CAP_INT); - switch (eIntType) - { - case eCAP_MDINTF: - u32IntEnable = u32IntEnable & eCAP_MDINTF; - break; - case eCAP_ADDRMINTF: - u32IntEnable = u32IntEnable & eCAP_ADDRMINTF; - break; - case eCAP_MEINTF: - u32IntEnable = u32IntEnable & eCAP_MEINTF; - break; - case eCAP_VINTF: - u32IntEnable = u32IntEnable & eCAP_VINTF; - break; - } - return (u32IntEnable ? TRUE : FALSE); -} - -/** - * @brief Clear videoIn interrupt flag. - * - * @param[in] eIntType Interrupt type. Incuding: - * - \ref eCAP_MDINTF - * - \ref eCAP_ADDRMINTF - * - \ref eCAP_MEINTF - * - \ref eCAP_VINTF - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to clear videoIn interrupt flag. - */ -INT32 CAP_ClearInt(E_CAP_INT_TYPE eIntType) -{ - UINT32 u32IntChannel = eIntType >> 16; - switch (eIntType) - { - case eCAP_MDINTF: - outp32(REG_CAP_INT, (inp32(REG_CAP_INT) & ~((eCAP_ADDRMINTF | eCAP_MEINTF | eCAP_VINTF) >> 16)) | - u32IntChannel); - break; - case eCAP_ADDRMINTF: - outp32(REG_CAP_INT, (inp32(REG_CAP_INT) & ~((eCAP_MDINTF | eCAP_MEINTF | eCAP_VINTF) >> 16)) | - u32IntChannel); - break; - case eCAP_MEINTF: - outp32(REG_CAP_INT, (inp32(REG_CAP_INT) & ~((eCAP_MDINTF | eCAP_ADDRMINTF | eCAP_VINTF) >> 16)) | - u32IntChannel); - break; - case eCAP_VINTF: - outp32(REG_CAP_INT, (inp32(REG_CAP_INT) & ~((eCAP_MDINTF | eCAP_MEINTF | eCAP_ADDRMINTF) >> 16)) | - u32IntChannel); - break; - default: - return E_CAP_INVALID_INT; - } - return Successful; - - -} - -/** - * @brief Polling videoIn interrupt flag. - * - * @param[in] eIntType Interrupt type. Incuding: - * - \ref eCAP_MDINTF - * - \ref eCAP_ADDRMINTF - * - \ref eCAP_MEINTF - * - \ref eCAP_VINTF - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to poll videoIn interrupt flag. - */ -BOOL CAP_PollInt(E_CAP_INT_TYPE eIntType) -{ - UINT32 u32IntStatus = inp32(REG_CAP_INT); - switch (eIntType) - { - case eCAP_MDINTF: - u32IntStatus = u32IntStatus & (eCAP_MDINTF >> 16); - break; - case eCAP_ADDRMINTF: - u32IntStatus = u32IntStatus & (eCAP_ADDRMINTF >> 16); - break; - case eCAP_MEINTF: - u32IntStatus = u32IntStatus & (eCAP_MEINTF >> 16); - break; - case eCAP_VINTF: - u32IntStatus = u32IntStatus & (eCAP_VINTF >> 16); - break; - } - return (u32IntStatus ? TRUE : FALSE); -} - -/** - * @brief Enable engine clock and turn on the pipe. - * - * @param[in] bEngEnable Enable engine clock. - * 1 : Enable engine clock. - * 0 : Disable engine clock. - * @param[in] ePipeEnable Enable pipe type. Incuding: - * - \ref eCAP_BOTH_PIPE_DISABLE - * - \ref eCAP_PLANAR - * - \ref eCAP_PACKET - * - \ref eCAP_BOTH_PIPE_ENABLE - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to enable engine clock and pipe type. - */ -void CAP_SetPipeEnable( - BOOL bEngEnable, - E_CAP_PIPE ePipeEnable -) -{ - outp32(REG_CAP_CTL, (inp32(REG_CAP_CTL) & ~(CAPEN | PKTEN | PLNEN)) - | (((bEngEnable ? CAPEN : 0x0)) - // | ((ePipeEnable & ~(PKTEN | PLNEN))<<5)) ); - | ((ePipeEnable & 0x03) << 5))); -} // DrvVideoIn_SetPipeEnable - -/** - * @brief Get engine clock and pipe type. - * - * @param[out] pbEngEnable Enable engine clock. - * 1 : Enable engine clock. - * 0 : Disable engine clock. - * @param[out] pePipeEnable Pipe type. Incuding: - * - \ref eCAP_BOTH_PIPE_DISABLE - * - \ref eCAP_PLANAR - * - \ref eCAP_PACKET - * - \ref eCAP_BOTH_PIPE_ENABLE - * @return None - * - * @details This function is used to get engin clock and pipe type. - */ -void CAP_GetPipeEnable(PBOOL pbEngEnable, E_CAP_PIPE *pePipeEnable) -{ - UINT32 u32Temp = inp32(REG_CAP_CTL); - - *pbEngEnable = (u32Temp & CAPEN) ? TRUE : FALSE; - *pePipeEnable = (E_CAP_PIPE)((u32Temp & (PKTEN | PLNEN)) >> 5); -} // DrvVideoIn_GetPipeEnable - - -/** - * @brief Set Shadow(Update) Register - * - * @details This function is used to reload frame buffer address after - * setting shoaw(update) register. - */ -void CAP_SetShadowRegister(void) -{ - outp32(REG_CAP_CTL, inp32(REG_CAP_CTL) | UPDATE); -} // DrvVideoIn_SetShadowRegister - - -/** - * @brief Set sensor polarity. - * - * @param[in] bVsync Sensor Vsync Polarity. - * 1 : High Active - * 0 : Low Active - * @param[in] bHsync Sensor Hsync Polarity. - * 1 : High Active - * 0 : Low Active - * @param[in] bPixelClk Sensor Vsync Polarity. - * 1 : Falling Edge - * 0 : Rising Edig - * @return None - * - * @details This function is used to set sensor polarity. - */ -void CAP_SetSensorPolarity(BOOL bVsync, BOOL bHsync, BOOL bPixelClk) -{ - UINT32 u32Polarity, u32RegVal; - u32RegVal = inp32(REG_CAP_PAR); - //sysprintf("Enter Register addr = 0x%x\n", (REG_CAP_PAR)); - //sysprintf("Enter Register value = 0x%x\n", u32RegVal); - u32Polarity = (((bVsync ? VSP : 0x0) | (bHsync ? HSP : 0x0)) | (bPixelClk ? PCLKP : 0x0)); - u32RegVal = (inp32(REG_CAP_PAR) & ~(VSP | HSP | PCLKP)) ; - //sysprintf("REG_VPEPAR = 0x%x", (u32RegVal | u32Polarity)); - outp32((REG_CAP_PAR), (u32RegVal | u32Polarity)); -} - -/** - * @brief Get sensor polarity. - * - * @param[out] pbVsync Sensor Vsync Polarity. - * 1 : High Active - * 0 : Low Active - * @param[out] pbHsync Sensor Hsync Polarity. - * 1 : High Active - * 0 : Low Active - * @param[out] pbPixelClk Sensor Vsync Polarity. - * 1 : Falling Edge - * 0 : Rising Edig - * @return None - * - * @details This function is used to get sensor polarity. - */ -void CAP_GetSensorPolarity(PBOOL pbVsync, PBOOL pbHsync, PBOOL pbPixelClk) -{ - UINT32 u32Temp = inp32(REG_CAP_PAR); - - *pbVsync = (u32Temp & VSP) ? TRUE : FALSE; - *pbHsync = (u32Temp & HSP) ? TRUE : FALSE; - *pbPixelClk = (u32Temp & PCLKP) ? TRUE : FALSE; -} - -/** - * @brief Set data format and order. - * - * @param[in] eInputOrder Data order for input format.Including : - * - \ref eCAP_IN_UYVY = Y0 U0 Y1 V0 - * - \ref eCAP_IN_YUYV = Y0 V0 Y1 U0 - * - \ref eCAP_IN_VYUY = U0 Y0 V0 Y1 - * - \ref eCAP_IN_YVYU = V0 Y0 U0 Y1 - * @param[in] eInputFormat Input data format.Including : - * - \ref eCAP_IN_YUV422 - * - \ref eCAP_IN_RGB565 - * @param[in] eOutputFormat Sensor Vsync Polarity.Including : - * - \ref eCAP_OUT_YUV422 = YCbCr422 - * - \ref eCAP_OUT_ONLY_Y = only output Y - * - \ref eCAP_OUT_RGB555 = rgb555 - * - \ref eCAP_OUT_RGB565 = rgb565 - * @return None - * - * @details This function is used to set data format and order. - */ -void CAP_SetDataFormatAndOrder(E_CAP_ORDER eInputOrder, E_CAP_IN_FORMAT eInputFormat, E_CAP_OUT_FORMAT eOutputFormat) -{ - outp32((REG_CAP_PAR), (inp32(REG_CAP_PAR) & ~(OUTFMT | INDATORD | INFMT)) - | ((((eInputOrder << 2) & INDATORD) - | (eInputFormat & INFMT)) - | ((eOutputFormat << 4) & OUTFMT))); -} // DrvVideoIn_SetDataFormatAndOrder - -/** - * @brief Get data format and order. - * - * @param[out] peInputOrder Data order for input format.Including : - * - \ref eCAP_IN_UYVY - * - \ref eCAP_IN_YUYV - * - \ref eCAP_IN_VYUY - * - \ref eCAP_IN_YVYU - * @param[out] peInputFormat Input data format.Including : - * - \ref eCAP_IN_YUV422 - * - \ref eCAP_IN_RGB565 - * @param[out] peOutputFormat Sensor Vsync Polarity.Including : - * - \ref eCAP_OUT_YUV422 = YCbCr422 - * - \ref eCAP_OUT_ONLY_Y = only output Y - * - \ref eCAP_OUT_RGB555 = rgb555 - * - \ref eCAP_OUT_RGB565 = rgb565 - * @return None - * - * @details This function is used to get data format and order. - */ -void CAP_GetDataFormatAndOrder(E_CAP_ORDER *peInputOrder, E_CAP_IN_FORMAT *peInputFormat, E_CAP_OUT_FORMAT *peOutputFormat) -{ - UINT32 u32Temp = inp32(REG_CAP_PAR); - - *peInputOrder = (E_CAP_ORDER)((u32Temp & INDATORD) >> 2); - *peInputFormat = (E_CAP_IN_FORMAT)(u32Temp & INFMT); - *peOutputFormat = (E_CAP_OUT_FORMAT)((u32Temp & OUTFMT) >> 4); -} - -/** - * @brief Set planar format. - * - * @param[in] ePlanarFmt Data order for input format.Including : - * - \ref eCAP_PLANAR_YUV422 - * - \ref eCAP_PLANAR_YUV420 - * @return None - * - * @details This function is used to set planar format. - */ -void CAP_SetPlanarFormat(E_CAP_PLANAR_FORMAT ePlanarFmt) -{ - switch (ePlanarFmt) - { - case eCAP_PLANAR_YUV422: - outp32((REG_CAP_PAR), (inp32(REG_CAP_PAR) & ~(PLNFMT))); - break; - case eCAP_PLANAR_YUV420: - outp32((REG_CAP_PAR), ((inp32(REG_CAP_PAR) | (PLNFMT)))); - break; - } -} - -/** - * @brief Get planar format. - * - * @retval - \ref eCAP_PLANAR_YUV422 : Planar format is YUV420. - * @retval - \ref eCAP_PLANAR_YUV420 : Planar format is YUV422. - * - * @details This function is used to get planar format. - */ -BOOL CAP_GetPlanarFormat(void) -{ - return ((inp32(REG_CAP_PAR) & PLNFMT) >> 7); -} - -/** - * @brief Set motion detection parameter. - * - * @param[in] bEnable Enable Motion Detection.Including : - * 0 : Disable motion detection. - * 1 : Enable motion detection. - * @param[in] bBlockSize Motion Detection Block Size.Including : - * 0 : Block size is set to 16x16. - * 1 : Block size is set to 8x8. - * @param[in] bSaveMode Motion Detection Save Mode.Including : - * 0 : 1 bit DIFF + 7 Y Differential. - * 1 : 1 bit DIFF only. - * @return None - * - * @details This function is used to set motion detection parameter. - */ -void CAP_SetMotionDet(BOOL bEnable, BOOL bBlockSize, BOOL bSaveMode) -{ - outp32(REG_CAP_MD, (inp32(REG_CAP_MD) & ~(MDSM | MDBS | MDEN)) | - (((bEnable ? MDEN : 0) | (bBlockSize ? MDBS : 0)) | - (bSaveMode ? MDSM : 0))); -} - -/** - * @brief Get motion detection parameter. - * - * @param[out] pbEnable Enable Motion Detection.Including : - * 0 : Disable motion detection. - * 1 : Enable motion detection. - * @param[out] pbBlockSize Motion Detection Block Size.Including : - * 0 : Block size is set to 16x16. - * 1 : Block size is set to 8x8. - * @param[out] pbSaveMode Motion Detection Save Mode.Including : - * 0 : 1 bit DIFF + 7 Y Differential. - * 1 : 1 bit DIFF only. - * @return None - * - * @details This function is used to get motion detection parameter. - */ -void CAP_GetMotionDet(PBOOL pbEnable, PBOOL pbBlockSize, PBOOL pbSaveMode) -{ - UINT32 u32RegData = inp32(REG_CAP_MD); - *pbEnable = (u32RegData & MDEN); - *pbBlockSize = (u32RegData & MDBS) >> 8; - *pbSaveMode = (u32RegData & MDSM) >> 9; -} - -/** - * @brief Set motion detection parameter externtion. - * - * @param[in] u32DetFreq Motion Detection frequency.Including : - * 0 : Each frame - * 1 : Every 2 frame - * 2 : Every 3 frame - * 3 : Every 4 frame - * @param[in] u32Threshold Motion detection threshold.It should be 0~31. - * - * @param[in] u32OutBuffer Motion Detection Output Address Register.(Word Alignment) - * - * @param[in] u32LumBuffer Motion Detection Temp Y Output Address Register.(Word Alignment) - * - * @return None - * - * @details This function is used to set motion detection parameter externtion. - */ -void CAP_SetMotionDetEx(UINT32 u32DetFreq, UINT32 u32Threshold, UINT32 u32OutBuffer, UINT32 u32LumBuffer) -{ - outp32(REG_CAP_MD, (inp32(REG_CAP_MD) & ~MDDF) | ((u32DetFreq << 10) & MDDF)); - outp32(REG_CAP_MD, (inp32(REG_CAP_MD) & ~MDTHR) | ((u32Threshold << 16) & MDTHR)); - outp32(REG_CAP_MDADDR, u32OutBuffer); - outp32(REG_CAP_MDYADDR, u32LumBuffer); -} - -/** - * @brief Get motion detection parameter externtion. - * - * @param[out] pu32DetFreq Motion Detection frequency.Including : - * 0 : Each frame - * 1 : Every 2 frame - * 2 : Every 3 frame - * 3 : Every 4 frame - * @param[out] pu32Threshold Motion detection threshold.It should be 0~31. - * - * @param[out] pu32OutBuffer Motion Detection Output Address Register.(Word Alignment) - * - * @param[out] pu32LumBuffer Motion Detection Temp Y Output Address Register.(Word Alignment) - * - * @return None - * - * @details This function is used to get motion detection parameter externtion. - */ -void CAP_GetMotionDetEx(PUINT32 pu32DetFreq, PUINT32 pu32Threshold, PUINT32 pu32OutBuffer, PUINT32 pu32LumBuffer) -{ - UINT32 u32RegData; - u32RegData = inp32(REG_CAP_MD); - *pu32DetFreq = u32RegData & MDDF; - *pu32Threshold = u32RegData & MDTHR; - *pu32OutBuffer = inp32(REG_CAP_MDADDR); - *pu32LumBuffer = inp32(REG_CAP_MDYADDR); -} - -/** - * @brief Set motion detection frequency. - * - * @param[in] u32DetFreq Motion Detection frequency.Including : - * 0 : Each frame - * 1 : Every 2 frame - * 2 : Every 3 frame - * 3 : Every 4 frame - * @return None - * - * @details This function is used to set motion detection frequency. - */ -void CAP_SetMotionDetFreq(UINT32 u32DetFreq) -{ - outp32(REG_CAP_MD, (inp32(REG_CAP_MD) & ~MDDF) | - ((u32DetFreq << 10) & MDDF)); -} - -/** - * @brief Get motion detection frequency. - * - * @param[out] pu32DetFreq Motion Detection frequency.Including : - * 0 : Each frame - * 1 : Every 2 frame - * 2 : Every 3 frame - * 3 : Every 4 frame - * @return None - * - * @details This function is used to get motion detection frequency. - */ -void CAP_GetMotionDetFreq(PUINT32 pu32DetFreq) -{ - UINT32 u32RegData; - u32RegData = inp32(REG_CAP_MD); - *pu32DetFreq = u32RegData & MDDF; -} - -/** - * @brief Set One shutte or continuous mode. - * - * @param[in] bIsOneSutterMode Enable One shutte.Including : - * 1 : Enable One shutte mode. - * 0 : Disable One shutte mode. - * @return None - * - * @details This function is used to set one shutte or continuous mode. - * Image capture interface automatically disable the capture - * inteface after a frame bad been captured. - */ -void CAP_SetOperationMode(BOOL bIsOneSutterMode) -{ - outp32(REG_CAP_CTL, (inp32(REG_CAP_CTL) & ~SHUTTER) | - ((bIsOneSutterMode << 16) & SHUTTER)); -} // DrvVideoIn_SetOperationMode - -/** - * @brief Get One shutte or continuous mode. - * - * @retval 1 : Disable one shutte mode - * @retval 0 : Enable one shutte mode - * - * @details This function is used to get one shutte or continuous mode. - * Image capture interface automatically disable the capture - * inteface after a frame bad been captured. - */ -BOOL CAP_GetOperationMode(void) -{ - return ((inp32(REG_CAP_CTL) & SHUTTER) ? TRUE : FALSE); -} // DrvVideoIn_GetOperationMode - - -/** - * @brief Get packet/planar processed data count. - * - * @param[in] ePipe Pipe type. Including : - * - \ref eCAP_PACKET - * - \ref eCAP_PLANAR - * - * @return Get current packet/planar processed data count. - * - * @details This function is used to get packet/planar processed data count. - */ -UINT32 CAP_GetProcessedDataCount(E_CAP_PIPE ePipe) -{ - if (ePipe == eCAP_PACKET) - return inp32(REG_CAP_CURADDRP); /* Packet pipe */ - else if (ePipe == eCAP_PLANAR) - return inp32(REG_CAP_CURADDRY); /* Planar pipe */ - else - return 0; -} - - -/** - * @brief Set cropping window vertical/horizontal starting address. - * - * @param[in] u32VerticalStart Cropping window vertical starting address. - * @param[in] u32HorizontalStart Cropping window horizontal starting address. - * - * @return None. - * - * @details This function is used to set cropping window vertical/horizontal starting address. - */ -void CAP_SetCropWinStartAddr(UINT32 u32VerticalStart, UINT32 u32HorizontalStart) -{ - outp32(REG_CAP_CWSP, (inp32(REG_CAP_CWSP) & ~(CWSADDRV | CWSADDRH)) //(Y|X) - | ((u32VerticalStart << 16) - | u32HorizontalStart)); -} - - -/** - * @brief Get cropping window vertical/horizontal starting address. - * - * @param[out] pu32VerticalStart Cropping window vertical starting address. - * @param[out] pu32HorizontalStart Cropping window horizontal starting address. - * - * @return None. - * - * @details This function is used to get cropping window vertical/horizontal starting address. - */ -void CAP_GetCropWinStartAddr(PUINT32 pu32VerticalStart, PUINT32 pu32HorizontalStart) -{ - UINT32 u32Temp = inp32(REG_CAP_CWSP); - - *pu32VerticalStart = (u32Temp & CWSADDRV) >> 16; - *pu32HorizontalStart = u32Temp & CWSADDRH; -} - -/** - * @brief Set cropping window size. - * - * @param[in] u32Width Cropping window width. - * @param[in] u32Height Cropping window heigh. - * - * @return None. - * - * @details This function is used to set cropping window size. - */ -void CAP_SetCropWinSize(UINT32 u32Height, UINT32 u32Width) -{ - outp32(REG_CAP_CWS, (inp32(REG_CAP_CWS) & ~(CWH | CWW)) - | ((u32Height << 16) - | u32Width)); -} - - -/** - * @brief Get cropping window size. - * - * @param[out] pu32Width Cropping window width. - * @param[out] pu32Height Cropping window heigh. - * - * @return None. - * - * @details This function is used to get cropping window size. - */ -void CAP_GetCropWinSize(PUINT32 pu32Height, PUINT32 pu32Width) -{ - UINT32 u32Temp = inp32(REG_CAP_CWS); - - *pu32Height = (u32Temp & CWH) >> 16; - *pu32Width = u32Temp & CWW; -} - -/** - * @brief Set packet/planar scaling vertical factor. - * - * @param[in] ePipe Pipe type.Including. - * - \ref eCAP_PACKET. - * - \ref eCAP_PLANAR. - * @param[in] u16Numerator Scaling Vertical Factor N. - * @param[in] u16Denominator Scaling Vertical Factor M. - * - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to set packet/planar scaling vertical factor. - * The output image width will be equal to the image width * N/M. - * Note: The value of N must be equal to or less than M - */ -INT32 CAP_SetVerticalScaleFactor(E_CAP_PIPE ePipe, UINT16 u16Numerator, UINT16 u16Denominator) -{ - UINT8 u8NumeratorL = u16Numerator & 0xFF, u8NumeratorH = u16Numerator >> 8; - UINT8 u8DenominatorL = u16Denominator & 0xFF, u8DenominatorH = u16Denominator >> 8; - if (ePipe == eCAP_PACKET) - { - outp32(REG_CAP_PKTSL, (inp32(REG_CAP_PKTSL) & ~(PKTSVNL | PKTSVML)) - | ((u8NumeratorL << 24) - | (u8DenominatorL << 16))); - outp32(REG_CAP_PKTSM, (inp32(REG_CAP_PKTSM) & ~(PKTSHMH | PKTSVMH)) - | ((u8NumeratorH << 24) - | (u8DenominatorH << 16))); - } - else if (ePipe == eCAP_PLANAR) - { - outp32(REG_CAP_PLNSL, (inp32(REG_CAP_PLNSL) & ~(PKTSVNL | PKTSVML)) - | ((u8NumeratorL << 24) - | (u8DenominatorL << 16))); - outp32(REG_CAP_PLNSM, (inp32(REG_CAP_PLNSM) & ~(PKTSHMH | PKTSVMH)) - | ((u8NumeratorH << 24) - | (u8DenominatorH << 16))); - } - else - return E_CAP_INVALID_PIPE; - return Successful; -} - -/** - * @brief Get packet/planar scaling vertical factor. - * - * @param[in] ePipe Pipe type.Including. - * - \ref eCAP_PACKET. - * - \ref eCAP_PLANAR. - * @param[out] pu16Numerator Scaling Vertical Factor N. - * @param[out] pu16Denominator Scaling Vertical Factor M. - * - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to get packet/planar scaling vertical factor. - * The output image width will be equal to the image width * N/M. - * Note: The value of N must be equal to or less than M - */ -INT32 DrvCAP_GetVerticalScaleFactor(E_CAP_PIPE ePipe, PUINT16 pu16Numerator, PUINT16 pu16Denominator) -{ - UINT32 u32Temp1, u32Temp2; - if (ePipe == eCAP_PACKET) - { - u32Temp1 = inp32(REG_CAP_PKTSL); - u32Temp2 = inp32(REG_CAP_PKTSM); - } - else if (ePipe == eCAP_PLANAR) - { - u32Temp1 = inp32(REG_CAP_PLNSL); - u32Temp2 = inp32(REG_CAP_PLNSM); - } - else - return E_CAP_INVALID_PIPE; - *pu16Numerator = ((u32Temp1 & PKTSVNL) >> 24) | (((u32Temp2 & PKTSHMH) >> 24) << 8); - *pu16Denominator = (u32Temp1 & PKTSVML) >> 16 | (((u32Temp2 & PKTSVMH) >> 16) << 8); - return Successful; -} - -/** - * @brief Set packet/planar scaling horizontal factor. - * - * @param[in] bPipe Pipe type.Including. - * - \ref eCAP_PACKET. - * - \ref eCAP_PLANAR. - * @param[in] u16Numerator Scaling Horizontal Factor N. - * @param[in] u16Denominator Scaling Horizontal Factor M. - * - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to set packet/planar scaling horizontal factor. - * The output image width will be equal to the image width * N/M. - * Note: The value of N must be equal to or less than M - */ -INT32 CAP_SetHorizontalScaleFactor(E_CAP_PIPE bPipe, UINT16 u16Numerator, UINT16 u16Denominator) -{ - UINT8 u8NumeratorL = u16Numerator & 0xFF, u8NumeratorH = u16Numerator >> 8; - UINT8 u8DenominatorL = u16Denominator & 0xFF, u8DenominatorH = u16Denominator >> 8; - if (bPipe == eCAP_PACKET) - { - outp32(REG_CAP_PKTSL, (inp32(REG_CAP_PKTSL) & ~(PKTSHNL | PKTSHML)) - | ((u8NumeratorL << 8) - | u8DenominatorL)); - outp32(REG_CAP_PKTSM, (inp32(REG_CAP_PKTSM) & ~(PKTSHNH | PKTSHMH)) - | ((u8NumeratorH << 8) - | u8DenominatorH)); - } - else if (bPipe == eCAP_PLANAR) - { - outp32(REG_CAP_PLNSL, (inp32(REG_CAP_PLNSL) & ~(PKTSHNL | PKTSHML)) - | ((u8NumeratorL << 8) - | u8DenominatorL)); - outp32(REG_CAP_PLNSM, (inp32(REG_CAP_PLNSM) & ~(PKTSHNH | PKTSHMH)) - | ((u8NumeratorH << 8) - | u8DenominatorH)); - } - else - return E_CAP_INVALID_PIPE; - return Successful; -} - -/** - * @brief Get packet/planar scaling horizontal factor. - * - * @param[in] bPipe Pipe type.Including. - * - \ref eCAP_PACKET. - * - \ref eCAP_PLANAR. - * @param[out] pu16Numerator Scaling Horizontal Factor N. - * @param[out] pu16Denominator Scaling Horizontal Factor M. - * - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to get packet/planar scaling horizontal factor. - * The output image width will be equal to the image width * N/M. - * Note: The value of N must be equal to or less than M. - */ -INT32 CAP_GetHorizontalScaleFactor(E_CAP_PIPE bPipe, PUINT16 pu16Numerator, PUINT16 pu16Denominator) -{ - UINT32 u32Temp1, u32Temp2; - if (bPipe == eCAP_PACKET) - { - u32Temp1 = inp32(REG_CAP_PKTSL); - u32Temp2 = inp32(REG_CAP_PKTSM); - } - else if (bPipe == eCAP_PLANAR) - { - u32Temp1 = inp32(REG_CAP_PLNSL); - u32Temp2 = inp32(REG_CAP_PLNSM); - } - else - return E_CAP_INVALID_PIPE; - *pu16Numerator = ((u32Temp1 & PKTSHNL) >> 8) | (u32Temp2 & PKTSHNH); - *pu16Denominator = (u32Temp1 & PKTSHML) | ((u32Temp2 & PKTSHMH) << 8); - return Successful; -} - -/** - * @brief Set scaling frame rate factor. - * - * @param[in] u8Numerator Scaling Frame Rate Factor N. - * @param[in] u8Denominator Scaling Frame Rate Factor M. - * - * @return None. - * - * @details This function is used to set scaling frame rate factor.. - * The output image frame rate will be equal to input image frame rate * (N/M). - * Note: The value of N must be equal to or less than M. - */ -void DrvCAP_SetFrameRateScaleFactor(UINT8 u8Numerator, UINT8 u8Denominator) -{ - outp32(REG_CAP_FRCTL, (inp32(REG_CAP_FRCTL) & ~(FRN | FRM)) - | (((u8Numerator << 8) & FRN) - | (u8Denominator & FRM))); -} // DrvVideoIn_SetFrameRateScaleFactor - -/** - * @brief Get scaling frame rate factor. - * - * @param[out] pu8Numerator Scaling Frame Rate Factor N. - * @param[out] pu8Denominator Scaling Frame Rate Factor M. - * - * @return None. - * - * @details This function is used to get scaling frame rate factor.. - * The output image frame rate will be equal to input image frame rate * (N/M). - * Note: The value of N must be equal to or less than M. - */ -void DrvCAP_GetFrameRateScaleFactor(PUINT8 pu8Numerator, PUINT8 pu8Denominator) -{ - UINT32 u32Temp = inp32(REG_CAP_FRCTL); - - *pu8Numerator = (u32Temp & FRN) >> 8; - *pu8Denominator = u32Temp & FRM; -} - -/** - * @brief Set address match - * - * @param[in] u32AddressMatch Compare Memory Base Address.It should be 0~0xFFFFFFFF. - * - * @return None. - * - * @details This function is used to set compare memory base address. - */ -void DrvCAP_SetAddressMatch(UINT32 u32AddressMatch) -{ - outp32(REG_CAP_CMPADDR, u32AddressMatch); -} - -/** - * @brief Get address match - * - * @param[out] pu32AddressMatch Compare Memory Base Address.It should be 0~0xFFFFFFFF. - * - * @return None. - * - * @details This function is used to get compare memory base address. - */ -void CAP_GetAddressMatch(PUINT32 pu32AddressMatch) -{ - *pu32AddressMatch = inp32(REG_CAP_CMPADDR); -} - -/** - * @brief Set frame output pixel stride width. - * - * @param[in] u32PacketStride Packet frame output pixel stride width.It should be 0~0x3FFF. - * @param[in] u32PlanarStride Planar frame output pixel stride width.It should be 0~0x3FFF. - * - * @return None. - * - * @details This function is used to set frame output pixel stride width. - */ -void CAP_SetStride(UINT32 u32PacketStride, UINT32 u32PlanarStride) -{ - outp32(REG_CAP_STRIDE, ((u32PlanarStride << 16) & PLNSTRIDE) | - (u32PacketStride & PKTSTRIDE)); -} - -/** - * @brief Get frame output pixel stride width. - * - * @param[out] pu32PacketStride Packet frame output pixel stride width.It should be 0~0x3FFF. - * @param[out] pu32PlanarStride Planar frame output pixel stride width.It should be 0~0x3FFF. - * - * @return None. - * - * @details This function is used to get frame output pixel stride width. - */ -void CAP_GetStride(PUINT32 pu32PacketStride, PUINT32 pu32PlanarStride) -{ - UINT32 u32Tmp = inp32(REG_CAP_STRIDE); - *pu32PlanarStride = (u32Tmp & PLNSTRIDE) >> 16; - *pu32PacketStride = u32Tmp & PKTSTRIDE; -} - -/** - * @brief Set system memory packet/planar base address. - * - * @param[in] ePipe Pipe type.Including: - * - \ref eCAP_PACKET - * - \ref eCAP_PLANAR - * - * @param[in] eBuf Packet/Planar buffer address. - * - \ref eCAP_BUF0 : - * Packet : Packet base address 0 - * Planar : Planar Y base address - * - \ref eCAP_BUF1 - * Packet : Packet base address 1 - * Planar : Planar U base address - * - \ref eCAP_BUF2 - * Packet : None. - * Planar : Planar V base address - * - * @param[in] u32BaseStartAddr System Memory Base Address.It should be 0~0xFFFFFFFF. - * - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to set system memory packet/planar base address. - */ -INT32 CAP_SetBaseStartAddress(E_CAP_PIPE ePipe, E_CAP_BUFFER eBuf, UINT32 u32BaseStartAddr) -{ - if (ePipe == eCAP_PACKET) - { - if (eBuf > eCAP_BUF1) - return E_CAP_INVALID_BUF; - outp32(REG_CAP_PKTBA0 + eBuf * 4, u32BaseStartAddr); - } - else if (ePipe == eCAP_PLANAR) - { - if (eBuf > eCAP_BUF2) - return E_CAP_INVALID_BUF; - outp32(REG_CAP_YBA + eBuf * 4, u32BaseStartAddr); - } - else - return E_CAP_INVALID_PIPE; - return Successful; -} - -/** - * @brief Get system memory packet/planar base address. - * - * @param[in] ePipe Pipe type.Including: - * - \ref eCAP_PACKET - * - \ref eCAP_PLANAR - * - * @param[in] eBuf Packet/Planar buffer address. - * - \ref eCAP_BUF0 : - * Packet : Packet base address 0 - * Planar : Planar Y base address - * - \ref eCAP_BUF1 - * Packet : Packet base address 1 - * Planar : Planar U base address - * - \ref eCAP_BUF2 - * Packet : None. - * Planar : Planar V base address - * - * @param[out] pu32BaseStartAddr System Memory Base Address.It should be 0~0xFFFFFFFF. - * - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to get system memory packet/planar base address. - */ -INT32 CAP_GetBaseStartAddress(E_CAP_PIPE ePipe, E_CAP_BUFFER eBuf, PUINT32 pu32BaseStartAddr) -{ - if (ePipe == eCAP_PACKET) - { - if (eBuf > eCAP_BUF1) - return E_CAP_INVALID_BUF; - *pu32BaseStartAddr = inp32(REG_CAP_PKTBA0 + eBuf * 4); - } - else if (ePipe == eCAP_PLANAR) - { - if (eBuf > eCAP_BUF2) - return E_CAP_INVALID_BUF; - *pu32BaseStartAddr = inp32(REG_CAP_YBA + eBuf * 4); - } - else - return E_CAP_INVALID_PIPE; - return Successful; -} - -/** - * @brief Set standard CCIR656. - * - * @param[in] bIsStandard Standard CCIR656. - * - 1 : Standard CCIR656 mode. - * - 0 : Non-Standard CCIR656 mode. (OV7725 or Hynix 702) - * @return None. - * - * @details This function is used to set standard CCIR65/non-standard CCIR65. - */ -void CAP_SetStandardCCIR656(BOOL bIsStandard) -{ - if (bIsStandard == TRUE) - outp32(REG_CAP_PAR, inp32(REG_CAP_PAR) & ~FBB); // Standard - else - outp32(REG_CAP_PAR, inp32(REG_CAP_PAR) | FBB); // Non-Standard -} - -/** - * @brief Set color effect - * - * @param[in] eColorMode Available as following. - * - \ref eCAP_CEF_NORMAL : Normal Color. - * - \ref eCAP_CEF_SEPIA : Sepia effect, - * corresponding U,V component value is set at register - \ref REG_CAP_SEPIA. - * - \ref eCAP_CEF_NEGATIVE : Negative picture. - * - \ref eCAP_CEF_POSTERIZE : Posterize image, - * the Y, U, V components posterizing factor are set at register - \ref REG_CAP_POSTERIZE. - * - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to set color effect. - */ -INT32 CAP_SetColorEffect(E_CAP_CEF eColorMode) -{ - if (eColorMode > eCAP_CEF_POSTERIZE) - return E_CAP_INVALID_COLOR_MODE; - outp32(REG_CAP_PAR, (inp32(REG_CAP_PAR) & ~COLORCTL) | - (eColorMode << 11)); - return Successful; -} - -/** - * @brief Get color effect - * - * @param[out] peColorMode Available as following. - * - \ref eCAP_CEF_NORMAL : Normal Color. - * - \ref eCAP_CEF_SEPIA : Sepia effect, - * corresponding U,V component value is set at register - \ref REG_CAP_SEPIA. - * - \ref eCAP_CEF_NEGATIVE : Negative picture. - * - \ref eCAP_CEF_POSTERIZE : Posterize image, - * the Y, U, V components posterizing factor are set at register - \ref REG_CAP_POSTERIZE. - * - * @return None. - * - * @details This function is used to get color effect. - */ -void DrvCAP_GetColorEffect(E_CAP_CEF *peColorMode) -{ - UINT32 u32Tmp = inp32(REG_CAP_PAR); - *peColorMode = (E_CAP_CEF)((u32Tmp & COLORCTL) >> 11); -} - -/** - * @brief Set color effect parameter - * - * @param[in] u8YComp The constant Y component.If eColorMode is set to - * eCAP_CEF_SEPIA : the constant Y component in - \ref REG_CAP_SEPIA. - * eCAP_CEF_POSTERIZE : the constant Y component in - \ref REG_CAP_POSTERIZE. - * @param[in] u8UComp The constant U component. - * eCAP_CEF_SEPIA : the constant U component in - \ref REG_CAP_SEPIA. - * eCAP_CEF_POSTERIZE : the constant U component in - \ref REG_CAP_POSTERIZE. - * @param[in] u8VComp The constant V component. - * eCAP_CEF_SEPIA : the constant V component in - \ref REG_CAP_SEPIA. - * eCAP_CEF_POSTERIZE : the constant V component in - \ref REG_CAP_POSTERIZE. - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to set color effect parameter. - */ -INT32 CAP_SetColorEffectParameter(UINT8 u8YComp, UINT8 u8UComp, UINT8 u8VComp) -{ - UINT32 u32Tmp = inp32(REG_CAP_PAR); - UINT32 u32ColorMode = (u32Tmp & COLORCTL) >> 11; - if (u32ColorMode == eCAP_CEF_SEPIA) - { - outp32(REG_CAP_SEPIA, (((UINT32)u8UComp << 8) | u8VComp)); - } - else if (u32ColorMode == eCAP_CEF_POSTERIZE) - { - outp32(REG_CAP_POSTERIZE, (((UINT32)u8YComp << 16) | ((UINT32)u8UComp << 8) | u8VComp)); - } - else - { - return E_CAP_WRONG_COLOR_PARAMETER; - } - return Successful; -} - -/** - * @brief Get color effect parameter - * - * @param[out] pu8YComp The constant Y component.If eColorMode is set to - * eCAP_CEF_SEPIA : the constant Y component in - \ref REG_CAP_SEPIA. - * eCAP_CEF_POSTERIZE : the constant Y component in - \ref REG_CAP_POSTERIZE. - * @param[out] pu8UComp The constant U component. - * eCAP_CEF_SEPIA : the constant U component in - \ref REG_CAP_SEPIA. - * eCAP_CEF_POSTERIZE : the constant U component in - \ref REG_CAP_POSTERIZE. - * @param[out] pu8VComp The constant V component. - * eCAP_CEF_SEPIA : the constant V component in - \ref REG_CAP_SEPIA. - * eCAP_CEF_POSTERIZE : the constant V component in - \ref REG_CAP_POSTERIZE. - * @retval 0 Success - * @retval <0 Error code - * - * @details This function is used to get color effect parameter. - */ -INT32 CAP_GetColorEffectParameter(PUINT8 pu8YComp, PUINT8 pu8UComp, PUINT8 pu8VComp) -{ - UINT32 u32Tmp = inp32(REG_CAP_PAR); - UINT32 u32ColorMode = (u32Tmp & COLORCTL) >> 11; - if (u32ColorMode == eCAP_CEF_SEPIA) - { - u32Tmp = inp32(REG_CAP_SEPIA); - *pu8UComp = (u32Tmp & 0xFF00) >> 8; - *pu8VComp = u32Tmp & 0xFF; - } - else if (u32ColorMode == eCAP_CEF_POSTERIZE) - { - u32Tmp = inp32(REG_CAP_POSTERIZE); - *pu8YComp = (u32Tmp & 0xFF0000) >> 16; - *pu8UComp = (u32Tmp & 0xFF00) >> 8; - *pu8VComp = u32Tmp & 0xFF; - } - else - { - return E_CAP_WRONG_COLOR_PARAMETER; - } - return Successful; -} - -/// @cond HIDDEN_SYMBOLS -CAPDEV_T CAP = -{ - CAP_Init, // void (*Init)(BOOL bIsEnableSnrClock, E_CAP_SNR_SRC eSnrSrc, UINT32 u32SensorFreqKHz, E_CAP_DEV_TYPE eDevType): - CAP_Open, // INT32 (*Open)(UINT32 u32SensorFreqKHz); - CAP_Close, // void (*Close)(void); - CAP_SetPipeEnable, // void (*SetPipeEnable)(BOOL bEngEnable, E_CAP_PIPE ePipeEnable); - CAP_SetPlanarFormat, // void (*SetPlanarFormat)(E_CAP_PLANAR_FORMAT ePlanarFmt); - CAP_SetCropWinSize, // void (*SetCropWinSize)(UINT32 u32height, UINT32 u32width); - CAP_SetCropWinStartAddr, // void (*SetCropWinStartAddr)(UINT32 u32VerticalStart, UINT32 u32HorizontalStart); - CAP_SetStride, // void (*SetStride)(UINT32 u16packetstride, UINT32 u32planarstride); - CAP_GetStride, // void (*GetStride)(PUINT32 pu32PacketStride, PUINT32 pu32PlanarStride); - CAP_EnableInt, // INT32 (*EnableInt)(E_CAP_INT_TYPE eIntType); - CAP_DisableInt, // INT32 (*DisableInt)(E_CAP_INT_TYPE eIntType); - CAP_InstallCallback, // INT32 (*InstallCallback)(E_CAP_INT_TYPE eIntType, PFN_CAP_CALLBACK pfnCallback, PFN_CAP_CALLBACK *pfnOldCallback); - CAP_SetBaseStartAddress, // INT32 (*SetBaseStartAddress(E_CAP_PIPE ePipe, E_CAP_BUFFER eBuf, UINT32 u32BaseStartAddr); - CAP_SetOperationMode, // void (*SetOperationMode(BOOL bIsOneSutterMode); - CAP_GetOperationMode, // BOOL (*GetOperationMode)(void); - CAP_SetPacketFrameBufferControl, // void (*videoIn1_SetPacketFrameBufferControl)(BOOL bFrameSwitch, BOOL bFrameBufferSel); - CAP_SetSensorPolarity, // void (*videoIn1_SetSensorPolarity)(BOOL bVsync, BOOL bHsync, BOOL bPixelClk); - CAP_SetColorEffectParameter, // INT32 (*SetColorEffectParameter)(UINT8 u8YComp, UINT8 u8UComp, UINT8 u8VComp); - CAP_SetDataFormatAndOrder, // void (*SetDataFormatAndOrder)(E_CAP_ORDER eInputOrder, E_CAP_IN_FORMAT eInputFormat, E_CAP_OUT_FORMAT eOutputFormat) - CAP_SetMotionDet, // void (*SetMotionDet)(BOOL bEnable, BOOL bBlockSize,BOOL bSaveMode); - CAP_SetMotionDetEx, // void (*SetMotionDetEx)(UINT32 u32Threshold, UINT32 u32OutBuffer, UINT32 u32LumBuffer); - CAP_SetStandardCCIR656, // void (*SetStandardCcir656)(BOOL); - CAP_SetShadowRegister // void (*SetShadowRegister)(void); -}; -/// @endcond HIDDEN_SYMBOLS - -/*@}*/ /* end of group N9H30_CAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_CAP_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_crypto.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_crypto.c deleted file mode 100644 index 498b333e626..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_crypto.c +++ /dev/null @@ -1,394 +0,0 @@ -/**************************************************************************//** - * @file crypto.c - * @version V1.10 - * $Revision: 3 $ - * $Date: 15/06/12 9:42a $ - * @brief Cryptographic Accelerator driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include "N9H30.h" -#include "nu_crypto.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup N9H30_CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - -/// @cond HIDDEN_SYMBOLS - -static uint32_t g_AES_CTL[4]; -static uint32_t g_TDES_CTL[4]; - -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief Open PRNG function - * @param[in] u32KeySize is PRNG key size, including: - * - \ref PRNG_KEY_SIZE_64 - * - \ref PRNG_KEY_SIZE_128 - * - \ref PRNG_KEY_SIZE_192 - * - \ref PRNG_KEY_SIZE_256 - * @param[in] u32SeedReload is PRNG seed reload or not, including: - * - \ref PRNG_SEED_CONT - * - \ref PRNG_SEED_RELOAD - * @param[in] u32Seed The new seed. Only valid when u32SeedReload is PRNG_SEED_RELOAD. - * @return None - */ -void PRNG_Open(uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed) -{ - if (u32SeedReload) - CRPT->PRNG_SEED = u32Seed; - - CRPT->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - (u32SeedReload << CRPT_PRNG_CTL_SEEDRLD_Pos); -} - -/** - * @brief Start to generate one PRNG key. - * @return None - */ -void PRNG_Start(void) -{ - CRPT->PRNG_CTL |= CRPT_PRNG_CTL_START_Msk; -} - -/** - * @brief Read the PRNG key. - * @param[out] u32RandKey The key buffer to store newly generated PRNG key. - * @return None - */ -void PRNG_Read(uint32_t u32RandKey[]) -{ - uint32_t i, wcnt; - - wcnt = (((CRPT->PRNG_CTL & CRPT_PRNG_CTL_KEYSZ_Msk) >> CRPT_PRNG_CTL_KEYSZ_Pos) + 1U) * 2U; - - for (i = 0U; i < wcnt; i++) - { - u32RandKey[i] = CRPT->PRNG_KEY[i]; - } - - CRPT->PRNG_CTL &= ~CRPT_PRNG_CTL_SEEDRLD_Msk; -} - - -/** - * @brief Open AES encrypt/decrypt function. - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32EncDec 1: AES encode; 0: AES decode - * @param[in] u32OpMode AES operation mode, including: - * - \ref AES_MODE_ECB - * - \ref AES_MODE_CBC - * - \ref AES_MODE_CFB - * - \ref AES_MODE_OFB - * - \ref AES_MODE_CTR - * - \ref AES_MODE_CBC_CS1 - * - \ref AES_MODE_CBC_CS2 - * - \ref AES_MODE_CBC_CS3 - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @param[in] u32SwapType is AES input/output data swap control, including: - * - \ref AES_NO_SWAP - * - \ref AES_OUT_SWAP - * - \ref AES_IN_SWAP - * - \ref AES_IN_OUT_SWAP - * @return None - */ -void AES_Open(uint32_t u32Channel, uint32_t u32EncDec, - uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType) -{ - CRPT->AES_CTL = (u32Channel << CRPT_AES_CTL_CHANNEL_Pos) | - (u32EncDec << CRPT_AES_CTL_ENCRPT_Pos) | - (u32OpMode << CRPT_AES_CTL_OPMODE_Pos) | - (u32KeySize << CRPT_AES_CTL_KEYSZ_Pos) | - (u32SwapType << CRPT_AES_CTL_OUTSWAP_Pos); - g_AES_CTL[u32Channel] = CRPT->AES_CTL; -} - -/** - * @brief Start AES encrypt/decrypt - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32DMAMode AES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop AES encrypt/decrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous AES encrypt/decrypt. - * - \ref CRYPTO_DMA_LAST Last AES encrypt/decrypt of a series of AES_Start. - * @return None - */ -void AES_Start(int32_t u32Channel, uint32_t u32DMAMode) -{ - CRPT->AES_CTL = g_AES_CTL[u32Channel]; - CRPT->AES_CTL |= CRPT_AES_CTL_START_Msk | (u32DMAMode << CRPT_AES_CTL_DMALAST_Pos); -} - -/** - * @brief Set AES keys - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32Keys An word array contains AES keys. - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @return None - */ -void AES_SetKey(uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize) -{ - int i, wcnt; - uint32_t *key_ptr; - - key_ptr = (uint32_t *)((uint32_t)&CRPT->AES0_KEY0 + (u32Channel * 0x3C)); - wcnt = 4 + u32KeySize * 2; - for (i = 0; i < wcnt; i++, key_ptr++) - *key_ptr = au32Keys[i]; -} - -/** - * @brief Set AES initial vectors - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] au32IV A four entry word array contains AES initial vectors. - * @return None - */ -void AES_SetInitVect(uint32_t u32Channel, uint32_t au32IV[]) -{ - int i; - uint32_t *key_ptr; - - key_ptr = (uint32_t *)((uint32_t)&CRPT->AES0_IV0 + (u32Channel * 0x3C)); - for (i = 0; i < 4; i++, key_ptr++) - *key_ptr = au32IV[i]; -} - -/** - * @brief Set AES DMA transfer configuration. - * @param[in] u32Channel AES channel. Must be 0~3. - * @param[in] u32SrcAddr AES DMA source address - * @param[in] u32DstAddr AES DMA destination address - * @param[in] u32TransCnt AES DMA transfer byte count - * @return None - */ -void AES_SetDMATransfer(uint32_t u32Channel, uint32_t u32SrcAddr, - uint32_t u32DstAddr, uint32_t u32TransCnt) -{ - *(uint32_t *)((uint32_t)&CRPT->AES0_SADDR + (u32Channel * 0x3C)) = u32SrcAddr; - *(uint32_t *)((uint32_t)&CRPT->AES0_DADDR + (u32Channel * 0x3C)) = u32DstAddr; - *(uint32_t *)((uint32_t)&CRPT->AES0_CNT + (u32Channel * 0x3C)) = u32TransCnt; -} - -/** - * @brief Open TDES encrypt/decrypt function. - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32EncDec 1: TDES encode; 0: TDES decode - * @param[in] u32OpMode TDES operation mode, including: - * - \ref TDES_MODE_ECB - * - \ref TDES_MODE_CBC - * - \ref TDES_MODE_CFB - * - \ref TDES_MODE_OFB - * - \ref TDES_MODE_CTR - * @param[in] u32SwapType is TDES input/output data swap control and word swap control, including: - * - \ref TDES_NO_SWAP - * - \ref TDES_WHL_SWAP - * - \ref TDES_OUT_SWAP - * - \ref TDES_OUT_WHL_SWAP - * - \ref TDES_IN_SWAP - * - \ref TDES_IN_WHL_SWAP - * - \ref TDES_IN_OUT_SWAP - * - \ref TDES_IN_OUT_WHL_SWAP - * @return None - */ -void TDES_Open(uint32_t u32Channel, uint32_t u32EncDec, int32_t Is3DES, int32_t Is3Key, - uint32_t u32OpMode, uint32_t u32SwapType) -{ - g_TDES_CTL[u32Channel] = (u32Channel << CRPT_TDES_CTL_CHANNEL_Pos) | - (u32EncDec << CRPT_TDES_CTL_ENCRPT_Pos) | - u32OpMode | (u32SwapType << CRPT_TDES_CTL_BLKSWAP_Pos); - if (Is3DES) - { - g_TDES_CTL[u32Channel] |= CRPT_TDES_CTL_TMODE_Msk; - } - if (Is3Key) - { - g_TDES_CTL[u32Channel] |= CRPT_TDES_CTL_3KEYS_Msk; - } -} - -/** - * @brief Start TDES encrypt/decrypt - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32DMAMode TDES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop TDES encrypt/decrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous TDES encrypt/decrypt. - * - \ref CRYPTO_DMA_LAST Last TDES encrypt/decrypt of a series of TDES_Start. - * @return None - */ -void TDES_Start(int32_t u32Channel, uint32_t u32DMAMode) -{ - g_TDES_CTL[u32Channel] |= CRPT_TDES_CTL_START_Msk | (u32DMAMode << CRPT_TDES_CTL_DMALAST_Pos); - CRPT->TDES_CTL = g_TDES_CTL[u32Channel]; -} - -/** - * @brief Set TDES keys - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] au8Keys The TDES keys. - * @return None - */ -void TDES_SetKey(uint32_t u32Channel, uint32_t au32Keys[3][2]) -{ - int i; - uint32_t *pu32TKey; - - pu32TKey = (uint32_t *)((uint32_t)&CRPT->TDES0_KEY1H + (0x40 * u32Channel)); - for (i = 0; i < 3; i++) - { - *pu32TKey = au32Keys[i][0]; /* TDESn_KEYxH */ - pu32TKey++; - *pu32TKey = au32Keys[i][1]; /* TDESn_KEYxL */ - pu32TKey++; - } -} - -/** - * @brief Set TDES initial vectors - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32IVH TDES initial vector high word. - * @param[in] u32IVL TDES initial vector low word. - * @return None - */ -void TDES_SetInitVect(uint32_t u32Channel, uint32_t u32IVH, uint32_t u32IVL) -{ - *(uint32_t *)((uint32_t)&CRPT->TDES0_IVH + 0x40 * u32Channel) = u32IVH; - *(uint32_t *)((uint32_t)&CRPT->TDES0_IVL + 0x40 * u32Channel) = u32IVL; -} - -/** - * @brief Set TDES DMA transfer configuration. - * @param[in] u32Channel TDES channel. Must be 0~3. - * @param[in] u32SrcAddr TDES DMA source address - * @param[in] u32DstAddr TDES DMA destination address - * @param[in] u32TransCnt TDES DMA transfer byte count - * @return None - */ -void TDES_SetDMATransfer(uint32_t u32Channel, uint32_t u32SrcAddr, - uint32_t u32DstAddr, uint32_t u32TransCnt) -{ - *(uint32_t *)((uint32_t)&CRPT->TDES0_SADDR + (u32Channel * 0x40)) = u32SrcAddr; - *(uint32_t *)((uint32_t)&CRPT->TDES0_DADDR + (u32Channel * 0x40)) = u32DstAddr; - *(uint32_t *)((uint32_t)&CRPT->TDES0_CNT + (u32Channel * 0x40)) = u32TransCnt; -} - -/** - * @brief Open SHA encrypt function. - * @param[in] u32OpMode SHA operation mode, including: - * - \ref SHA_MODE_SHA1 - * - \ref SHA_MODE_SHA224 - * - \ref SHA_MODE_SHA256 - * - \ref SHA_MODE_SHA384 - * - \ref SHA_MODE_SHA512 - * @param[in] u32SwapType is SHA input/output data swap control, including: - * - \ref SHA_NO_SWAP - * - \ref SHA_OUT_SWAP - * - \ref SHA_IN_SWAP - * - \ref SHA_IN_OUT_SWAP - * @param[in] hmac_key_len The length of HMAC key if HMAC is employed. - * If HMAC is not used, just give hmac_key_len a zero value. - * @return None - */ -void SHA_Open(uint32_t u32OpMode, uint32_t u32SwapType, int hmac_key_len) -{ - CRPT->HMAC_CTL = (u32OpMode << CRPT_HMAC_CTL_OPMODE_Pos) | - (u32SwapType << CRPT_HMAC_CTL_OUTSWAP_Pos); - - if (hmac_key_len > 0) - { - CRPT->HMAC_KEYCNT = hmac_key_len; - CRPT->HMAC_CTL |= CRPT_HMAC_CTL_HMACEN_Msk; - } -} - - -/** - * @brief Start SHA encrypt - * @param[in] u32DMAMode TDES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop SHA encrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous SHA encrypt. - * - \ref CRYPTO_DMA_LAST Last SHA encrypt of a series of SHA_Start. - * @return None - */ -void SHA_Start(uint32_t u32DMAMode) -{ - CRPT->HMAC_CTL &= ~(0x7 << CRPT_HMAC_CTL_DMALAST_Pos); - CRPT->HMAC_CTL |= CRPT_HMAC_CTL_START_Msk | (u32DMAMode << CRPT_HMAC_CTL_DMALAST_Pos); -} - -/** - * @brief Set SHA DMA transfer - * @param[in] u32SrcAddr SHA DMA source address - * @param[in] u32TransCnt SHA DMA transfer byte count - * @return None - */ -void SHA_SetDMATransfer(uint32_t u32SrcAddr, uint32_t u32TransCnt) -{ - CRPT->HMAC_SADDR = u32SrcAddr; - CRPT->HMAC_DMACNT = u32TransCnt; -} - -/** - * @brief Read the SHA digest. - * @param[out] u32Digest The SHA encrypt output digest. - * @return None - */ -void SHA_Read(uint32_t u32Digest[]) -{ - uint32_t i, wcnt; - - i = (CRPT->HMAC_CTL & CRPT_HMAC_CTL_OPMODE_Msk) >> CRPT_HMAC_CTL_OPMODE_Pos; - if (i == SHA_MODE_SHA1) - { - wcnt = 5UL; - } - else if (i == SHA_MODE_SHA224) - { - wcnt = 7UL; - } - else if (i == SHA_MODE_SHA256) - { - wcnt = 8UL; - } - else if (i == SHA_MODE_SHA384) - { - wcnt = 12UL; - } - else - { - /* SHA_MODE_SHA512 */ - wcnt = 16UL; - } - - for (i = 0; i < wcnt; i++) - u32Digest[i] = *(uint32_t *)((uint32_t) & (CRPT->HMAC_DGST0) + (i * 4)); -} - - -/*@}*/ /* end of group N9H30_CRYPTO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_CRYPTO_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2015 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_emac.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_emac.c deleted file mode 100644 index 703c686311c..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_emac.c +++ /dev/null @@ -1,1158 +0,0 @@ -/**************************************************************************//** - * @file emac.c - * @version V1.00 - * @brief M480 EMAC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EMAC_Driver EMAC Driver - @{ -*/ - - -/* Below are structure, definitions, static variables used locally by EMAC driver and does not want to parse by doxygen unless HIDDEN_SYMBOLS is defined */ -/** @cond HIDDEN_SYMBOLS */ - -/** @addtogroup EMAC_EXPORTED_CONSTANTS EMAC Exported Constants - @{ -*/ - -/* PHY Register Description */ -#define PHY_CNTL_REG 0x00UL /*!< PHY control register address */ -#define PHY_STATUS_REG 0x01UL /*!< PHY status register address */ -#define PHY_ID1_REG 0x02UL /*!< PHY ID1 register */ -#define PHY_ID2_REG 0x03UL /*!< PHY ID2 register */ -#define PHY_ANA_REG 0x04UL /*!< PHY auto-negotiation advertisement register */ -#define PHY_ANLPA_REG 0x05UL /*!< PHY auto-negotiation link partner availability register */ -#define PHY_ANE_REG 0x06UL /*!< PHY auto-negotiation expansion register */ - -/* PHY Control Register */ -#define PHY_CNTL_RESET_PHY (1UL << 15UL) -#define PHY_CNTL_DR_100MB (1UL << 13UL) -#define PHY_CNTL_ENABLE_AN (1UL << 12UL) -#define PHY_CNTL_POWER_DOWN (1UL << 11UL) -#define PHY_CNTL_RESTART_AN (1UL << 9UL) -#define PHY_CNTL_FULLDUPLEX (1UL << 8UL) - -/* PHY Status Register */ -#define PHY_STATUS_AN_COMPLETE (1UL << 5UL) -#define PHY_STATUS_LINK_VALID (1UL << 2UL) - -/* PHY Auto-negotiation Advertisement Register */ -#define PHY_ANA_DR100_TX_FULL (1UL << 8UL) -#define PHY_ANA_DR100_TX_HALF (1UL << 7UL) -#define PHY_ANA_DR10_TX_FULL (1UL << 6UL) -#define PHY_ANA_DR10_TX_HALF (1UL << 5UL) -#define PHY_ANA_IEEE_802_3_CSMA_CD (1UL << 0UL) - -/* PHY Auto-negotiation Link Partner Advertisement Register */ -#define PHY_ANLPA_DR100_TX_FULL (1UL << 8UL) -#define PHY_ANLPA_DR100_TX_HALF (1UL << 7UL) -#define PHY_ANLPA_DR10_TX_FULL (1UL << 6UL) -#define PHY_ANLPA_DR10_TX_HALF (1UL << 5UL) - -/* EMAC Tx/Rx descriptor's owner bit */ -#define EMAC_DESC_OWN_EMAC 0x80000000UL /*!< Set owner to EMAC */ -#define EMAC_DESC_OWN_CPU 0x00000000UL /*!< Set owner to CPU */ - -/* Rx Frame Descriptor Status */ -#define EMAC_RXFD_RTSAS 0x0080UL /*!< Time Stamp Available */ -#define EMAC_RXFD_RP 0x0040UL /*!< Runt Packet */ -#define EMAC_RXFD_ALIE 0x0020UL /*!< Alignment Error */ -#define EMAC_RXFD_RXGD 0x0010UL /*!< Receiving Good packet received */ -#define EMAC_RXFD_PTLE 0x0008UL /*!< Packet Too Long Error */ -#define EMAC_RXFD_CRCE 0x0002UL /*!< CRC Error */ -#define EMAC_RXFD_RXINTR 0x0001UL /*!< Interrupt on receive */ - -/* Tx Frame Descriptor's Control bits */ -#define EMAC_TXFD_TTSEN 0x08UL /*!< Tx time stamp enable */ -#define EMAC_TXFD_INTEN 0x04UL /*!< Tx interrupt enable */ -#define EMAC_TXFD_CRCAPP 0x02UL /*!< Append CRC */ -#define EMAC_TXFD_PADEN 0x01UL /*!< Padding mode enable */ - -/* Tx Frame Descriptor Status */ -#define EMAC_TXFD_TXINTR 0x0001UL /*!< Interrupt on Transmit */ -#define EMAC_TXFD_DEF 0x0002UL /*!< Transmit deferred */ -#define EMAC_TXFD_TXCP 0x0008UL /*!< Transmission Completion */ -#define EMAC_TXFD_EXDEF 0x0010UL /*!< Exceed Deferral */ -#define EMAC_TXFD_NCS 0x0020UL /*!< No Carrier Sense Error */ -#define EMAC_TXFD_TXABT 0x0040UL /*!< Transmission Abort */ -#define EMAC_TXFD_LC 0x0080UL /*!< Late Collision */ -#define EMAC_TXFD_TXHA 0x0100UL /*!< Transmission halted */ -#define EMAC_TXFD_PAU 0x0200UL /*!< Paused */ -#define EMAC_TXFD_SQE 0x0400UL /*!< SQE error */ -#define EMAC_TXFD_TTSAS 0x0800UL /*!< Time Stamp available */ - -/*@}*/ /* end of group EMAC_EXPORTED_CONSTANTS */ - -/** @addtogroup EMAC_EXPORTED_TYPEDEF EMAC Exported Type Defines - @{ -*/ - -/*@}*/ /* end of group EMAC_EXPORTED_TYPEDEF */ - -/* local variables */ -static uint32_t s_u32EnableTs = 0UL; - -static void EMAC_MdioWrite(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr, uint32_t u32Data); -static uint32_t EMAC_MdioRead(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr); - -static uint32_t EMAC_Subsec2Nsec(uint32_t subsec); -static uint32_t EMAC_Nsec2Subsec(uint32_t nsec); -static void EMAC_TxDescInit(EMAC_MEMMGR_T *psMemMgr); -static void EMAC_RxDescInit(EMAC_MEMMGR_T *psMemMgr); - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Write PHY register - * @param[in] u32Reg PHY register number - * @param[in] u32Addr PHY address, this address is board dependent - * @param[in] u32Data data to write to PHY register - * @return None - */ -static void EMAC_MdioWrite(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr, uint32_t u32Data) -{ - /* Set data register */ - EMAC->MIIMDAT = u32Data ; - /* Set PHY address, PHY register address, busy bit and write bit */ - EMAC->MIIMCTL = u32Reg | (u32Addr << 8) | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_WRITE_Msk | EMAC_MIIMCTL_MDCON_Msk; - - /* Wait write complete by polling busy bit. */ - while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk) - { - ; - } - -} - -/** - * @brief Read PHY register - * @param[in] u32Reg PHY register number - * @param[in] u32Addr PHY address, this address is board dependent - * @return Value read from PHY register - */ -static uint32_t EMAC_MdioRead(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr) -{ - /* Set PHY address, PHY register address, busy bit */ - EMAC->MIIMCTL = u32Reg | (u32Addr << EMAC_MIIMCTL_PHYADDR_Pos) | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_MDCON_Msk; - - /* Wait read complete by polling busy bit */ - while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk) - { - ; - } - - /* Get return data */ - return EMAC->MIIMDAT; -} - -void EMAC_Reset(EMAC_T *EMAC) -{ - /* Reset MAC */ - EMAC->CTL = 0x1000000; -} - -/** - * @brief Initialize PHY chip, check for the auto-negotiation result. - * @param None - * @return None - */ -void EMAC_PhyInit(EMAC_T *EMAC) -{ - uint32_t reg; - uint32_t i = 0UL; - - /* Reset Phy Chip */ - EMAC_MdioWrite(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR, PHY_CNTL_RESET_PHY); - - /* Wait until reset complete */ - while (1) - { - reg = EMAC_MdioRead(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR) ; - - if ((reg & PHY_CNTL_RESET_PHY) == 0UL) - { - break; - } - } - - while (!(EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID)) - { - if (i++ > 10000UL) /* Cable not connected */ - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - break; - } - } - - if (i <= 10000UL) - { - /* Configure auto negotiation capability */ - EMAC_MdioWrite(EMAC, PHY_ANA_REG, EMAC_PHY_ADDR, PHY_ANA_DR100_TX_FULL | - PHY_ANA_DR100_TX_HALF | - PHY_ANA_DR10_TX_FULL | - PHY_ANA_DR10_TX_HALF | - PHY_ANA_IEEE_802_3_CSMA_CD); - /* Restart auto negotiation */ - EMAC_MdioWrite(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR, EMAC_MdioRead(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR) | PHY_CNTL_RESTART_AN); - - /* Wait for auto-negotiation complete */ - while (!(EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_AN_COMPLETE)) - { - ; - } - - /* Check link valid again. Some PHYs needs to check result after link valid bit set */ - while (!(EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID)) - { - ; - } - - /* Check link partner capability */ - reg = EMAC_MdioRead(EMAC, PHY_ANLPA_REG, EMAC_PHY_ADDR) ; - - if (reg & PHY_ANLPA_DR100_TX_FULL) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - } - else if (reg & PHY_ANLPA_DR100_TX_HALF) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - } - else if (reg & PHY_ANLPA_DR10_TX_FULL) - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - } - else - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - } - } -} - -/** - * @brief Initial EMAC Tx descriptors and get Tx descriptor base address - * @param EMAC_MEMMGR_T pointer - * @return None - */ -static void EMAC_TxDescInit(EMAC_MEMMGR_T *psMemMgr) -{ - uint32_t i; - - /* Get Frame descriptor's base address. */ - psMemMgr->psNextTxDesc = psMemMgr->psCurrentTxDesc = (EMAC_DESCRIPTOR_T *)((uint32_t)&psMemMgr->psTXDescs[0] | BIT31); - - for (i = 0UL; i < psMemMgr->u32TxDescSize; i++) - { - - if (s_u32EnableTs) - { - psMemMgr->psTXDescs[i].u32Status1 = EMAC_TXFD_PADEN | EMAC_TXFD_CRCAPP | EMAC_TXFD_INTEN; - } - else - { - psMemMgr->psTXDescs[i].u32Status1 = EMAC_TXFD_PADEN | EMAC_TXFD_CRCAPP | EMAC_TXFD_INTEN | EMAC_TXFD_TTSEN; - } - - psMemMgr->psTXDescs[i].u32Data = (uint32_t)& psMemMgr->psTXFrames[i] | BIT31; - psMemMgr->psTXDescs[i].u32Status2 = 0UL; - psMemMgr->psTXDescs[i].u32Next = (uint32_t)(&psMemMgr->psTXDescs[(i + 1UL) % EMAC_TX_DESC_SIZE]) | BIT31; - psMemMgr->psTXDescs[i].u32Backup1 = psMemMgr->psTXDescs[i].u32Data; - psMemMgr->psTXDescs[i].u32Backup2 = psMemMgr->psTXDescs[i].u32Next; - } - psMemMgr->psEmac->TXDSA = (uint32_t)psMemMgr->psCurrentTxDesc; -} - - -/** - * @brief Initial EMAC Rx descriptors and get Rx descriptor base address - * @param EMAC_MEMMGR_T pointer - * @return None - */ -static void EMAC_RxDescInit(EMAC_MEMMGR_T *psMemMgr) -{ - - uint32_t i; - - /* Get Frame descriptor's base address. */ - psMemMgr->psCurrentRxDesc = (EMAC_DESCRIPTOR_T *)((uint32_t)&psMemMgr->psRXDescs[0] | BIT31); - - for (i = 0UL; i < psMemMgr->u32RxDescSize; i++) - { - psMemMgr->psRXDescs[i].u32Status1 = EMAC_DESC_OWN_EMAC; - psMemMgr->psRXDescs[i].u32Data = (uint32_t)&psMemMgr->psRXFrames[i] | BIT31; - psMemMgr->psRXDescs[i].u32Status2 = 0UL; - psMemMgr->psRXDescs[i].u32Next = (uint32_t)(&psMemMgr->psRXDescs[(i + 1UL) % EMAC_RX_DESC_SIZE]) | BIT31; - psMemMgr->psRXDescs[i].u32Backup1 = psMemMgr->psRXDescs[i].u32Data; - psMemMgr->psRXDescs[i].u32Backup2 = psMemMgr->psRXDescs[i].u32Next; - } - psMemMgr->psEmac->RXDSA = (uint32_t)psMemMgr->psCurrentRxDesc; -} - -/** - * @brief Convert subsecond value to nano second - * @param[in] subsec Subsecond value to be convert - * @return Nano second - */ -static uint32_t EMAC_Subsec2Nsec(uint32_t subsec) -{ - /* 2^31 subsec == 10^9 ns */ - uint64_t i; - i = 1000000000ull * (uint64_t)subsec; - i >>= 31; - return ((uint32_t)i); -} - -/** - * @brief Convert nano second to subsecond value - * @param[in] nsec Nano second to be convert - * @return Subsecond - */ -static uint32_t EMAC_Nsec2Subsec(uint32_t nsec) -{ - /* 10^9 ns = 2^31 subsec */ - uint64_t i; - i = (1ull << 31) * nsec; - i /= 1000000000ull; - return ((uint32_t)i); -} - - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - - - -/** @endcond HIDDEN_SYMBOLS */ - - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Initialize EMAC interface, including descriptors, MAC address, and PHY. - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - * @note This API configures EMAC to receive all broadcast and multicast packets, but could configure to other settings with - * \ref EMAC_ENABLE_RECV_BCASTPKT, \ref EMAC_DISABLE_RECV_BCASTPKT, \ref EMAC_ENABLE_RECV_MCASTPKT, and \ref EMAC_DISABLE_RECV_MCASTPKT - * @note Receive(RX) and transmit(TX) are not enabled yet, application must call \ref EMAC_ENABLE_RX and \ref EMAC_ENABLE_TX to - * enable receive and transmit function. - */ -void EMAC_Open(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8MacAddr) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Enable transmit and receive descriptor */ - EMAC_TxDescInit(psMemMgr); - EMAC_RxDescInit(psMemMgr); - - /* Set the CAM Control register and the MAC address value */ - EMAC_SetMacAddr(EMAC, pu8MacAddr); - - /* Configure the MAC interrupt enable register. */ - EMAC->INTEN = EMAC_INTEN_RXIEN_Msk | - EMAC_INTEN_TXIEN_Msk | - EMAC_INTEN_RXGDIEN_Msk | - EMAC_INTEN_TXCPIEN_Msk | - EMAC_INTEN_RXBEIEN_Msk | - EMAC_INTEN_TXBEIEN_Msk | - EMAC_INTEN_RDUIEN_Msk | - EMAC_INTEN_TSALMIEN_Msk | - EMAC_INTEN_WOLIEN_Msk; - - /* Configure the MAC control register. */ - EMAC->CTL = EMAC_CTL_STRIPCRC_Msk | - EMAC_CTL_RMIIEN_Msk; - - /* Accept packets for us and all broadcast and multicast packets */ - EMAC->CAMCTL = EMAC_CAMCTL_CMPEN_Msk | - EMAC_CAMCTL_AMP_Msk | - EMAC_CAMCTL_ABP_Msk; - - /* Limit the max receive frame length */ - EMAC->MRFL = EMAC_MAX_PKT_SIZE; -} - -/** - * @brief This function stop all receive and transmit activity and disable MAC interface - * @param None - * @return None - */ - -void EMAC_Close(EMAC_T *EMAC) -{ - EMAC->CTL |= EMAC_CTL_RST_Msk; - - while (EMAC->CTL & EMAC_CTL_RST_Msk) {} -} - -/** - * @brief Set the device MAC address - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - */ -void EMAC_SetMacAddr(EMAC_T *EMAC, uint8_t *pu8MacAddr) -{ - EMAC_EnableCamEntry(EMAC, 0UL, pu8MacAddr); -} - -/** - * @brief Fill a CAM entry for MAC address comparison. - * @param[in] u32Entry MAC entry to fill. Entry 0 is used to store device MAC address, do not overwrite the setting in it. - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - */ -void EMAC_EnableCamEntry(EMAC_T *EMAC, uint32_t u32Entry, uint8_t pu8MacAddr[]) -{ - uint32_t u32Lsw, u32Msw; - uint32_t reg; - u32Lsw = (uint32_t)(((uint32_t)pu8MacAddr[4] << 24) | - ((uint32_t)pu8MacAddr[5] << 16)); - u32Msw = (uint32_t)(((uint32_t)pu8MacAddr[0] << 24) | - ((uint32_t)pu8MacAddr[1] << 16) | - ((uint32_t)pu8MacAddr[2] << 8) | - (uint32_t)pu8MacAddr[3]); - - reg = (uint32_t)&EMAC->CAM0M + u32Entry * 2UL * 4UL; - *(uint32_t volatile *)reg = u32Msw; - reg = (uint32_t)&EMAC->CAM0L + u32Entry * 2UL * 4UL; - *(uint32_t volatile *)reg = u32Lsw; - - EMAC->CAMEN |= (1UL << u32Entry); -} - -/** - * @brief Disable a specified CAM entry - * @param[in] u32Entry CAM entry to be disabled - * @return None - */ -void EMAC_DisableCamEntry(EMAC_T *EMAC, uint32_t u32Entry) -{ - EMAC->CAMEN &= ~(1UL << u32Entry); -} - - -/** - * @brief Receive an Ethernet packet - * @param[in] pu8Data Pointer to a buffer to store received packet (4 byte CRC removed) - * @param[in] pu32Size Received packet size (without 4 byte CRC). - * @return Packet receive success or not - * @retval 0 No packet available for receive - * @retval 1 A packet is received - * @note Return 0 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_RecvPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size) -{ - uint32_t reg; - uint32_t u32Count = 0UL; - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Clear Rx interrupt flags */ - reg = EMAC->INTSTS; - EMAC->INTSTS = reg & 0xFFFFUL; /* Clear all RX related interrupt status */ - - if (reg & EMAC_INTSTS_RXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - /* If we reach last recv Rx descriptor, leave the loop */ - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - uint32_t status = desc->u32Status1 >> 16; - - /* If Rx frame is good, process received frame */ - if (status & EMAC_RXFD_RXGD) - { - /* lower 16 bit in descriptor status1 stores the Rx packet length */ - *pu32Size = desc->u32Status1 & 0xFFFFUL; - memcpy(pu8Data, (uint8_t *)desc->u32Data, *pu32Size); - u32Count = 1UL; - } - else - { - /* Save Error status if necessary */ - if (status & EMAC_RXFD_RP) {} - - if (status & EMAC_RXFD_ALIE) {} - - if (status & EMAC_RXFD_PTLE) {} - - if (status & EMAC_RXFD_CRCE) {} - } - } - } - - return (u32Count); -} - -/** - * @brief Receive an Ethernet packet and the time stamp while it's received - * @param[out] pu8Data Pointer to a buffer to store received packet (4 byte CRC removed) - * @param[out] pu32Size Received packet size (without 4 byte CRC). - * @param[out] pu32Sec Second value while packet received - * @param[out] pu32Nsec Nano second value while packet received - * @return Packet receive success or not - * @retval 0 No packet available for receive - * @retval 1 A packet is received - * @note Return 0 doesn't guarantee the packet will be sent and received successfully. - * @note Largest Ethernet packet is 1514 bytes after stripped CRC, application must give - * a buffer large enough to store such packet - */ -uint32_t EMAC_RecvPktTS(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size, uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - uint32_t reg; - uint32_t u32Count = 0UL; - - /* Clear Rx interrupt flags */ - reg = EMAC->INTSTS; - EMAC->INTSTS = reg & 0xFFFFUL; /* Clear all Rx related interrupt status */ - - if (reg & EMAC_INTSTS_RXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - /* If we reach last recv Rx descriptor, leave the loop */ - if (EMAC->CRXDSA != (uint32_t)desc) - { - if ((desc->u32Status1 | EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - - uint32_t status = desc->u32Status1 >> 16; - - /* If Rx frame is good, process received frame */ - if (status & EMAC_RXFD_RXGD) - { - /* lower 16 bit in descriptor status1 stores the Rx packet length */ - *pu32Size = desc->u32Status1 & 0xFFFFUL; - memcpy(pu8Data, (uint8_t *)desc->u32Data, *pu32Size); - - *pu32Sec = desc->u32Next; /* second stores in descriptor's NEXT field */ - *pu32Nsec = EMAC_Subsec2Nsec(desc->u32Data); /* Sub nano second store in DATA field */ - - u32Count = 1UL; - } - else - { - /* Save Error status if necessary */ - if (status & EMAC_RXFD_RP) {} - - if (status & EMAC_RXFD_ALIE) {} - - if (status & EMAC_RXFD_PTLE) {} - - if (status & EMAC_RXFD_CRCE) {} - } - } - } - } - - return (u32Count); -} - -/** - * @brief Clean up process after a packet is received - * @param None - * @return None - * @details EMAC Rx interrupt service routine \b must call this API to release the resource use by receive process - * @note Application can only call this function once every time \ref EMAC_RecvPkt or \ref EMAC_RecvPktTS returns 1 - */ -void EMAC_RecvPktDone(EMAC_MEMMGR_T *psMemMgr) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - /* Restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - - /* Change ownership to DMA for next use */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get Next Frame Descriptor pointer to process */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Rx descriptor */ - psMemMgr->psCurrentRxDesc = desc; - - EMAC_TRIGGER_RX(EMAC); -} - - -/** - * @brief Send an Ethernet packet - * @param[in] pu8Data Pointer to a buffer holds the packet to transmit - * @param[in] u32Size Packet size (without 4 byte CRC). - * @return Packet transmit success or not - * @retval 0 Transmit failed due to descriptor unavailable. - * @retval 1 Packet is copied to descriptor and triggered to transmit. - * @note Return 1 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_SendPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t u32Size) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Get Tx frame descriptor & data pointer */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psNextTxDesc; - uint32_t status = desc->u32Status1; - uint32_t ret = 0UL; - - /* Check descriptor ownership */ - if ((status & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - memcpy((uint8_t *)desc->u32Data, pu8Data, u32Size); - - /* Set Tx descriptor transmit byte count */ - desc->u32Status2 = u32Size; - - /* Change descriptor ownership to EMAC */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get next Tx descriptor */ - psMemMgr->psNextTxDesc = (EMAC_DESCRIPTOR_T *)(desc->u32Next); - - /* Trigger EMAC to send the packet */ - EMAC_TRIGGER_TX(EMAC); - ret = 1UL; - } - - return (ret); -} - - -/** - * @brief Clean up process after packet(s) are sent - * @param None - * @return Number of packet sent between two function calls - * @details EMAC Tx interrupt service routine \b must call this API or \ref EMAC_SendPktDoneTS to - * release the resource use by transmit process - */ -uint32_t EMAC_SendPktDone(EMAC_MEMMGR_T *psMemMgr) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - uint32_t status, reg; - uint32_t last_tx_desc; - uint32_t u32Count = 0UL; - - reg = EMAC->INTSTS; - /* Clear Tx interrupt flags */ - EMAC->INTSTS = reg & (0xFFFF0000UL & ~EMAC_INTSTS_TSALMIF_Msk); - - - if (reg & EMAC_INTSTS_TXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Get our first descriptor to process */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentTxDesc; - - /* Process the descriptor(s). */ - last_tx_desc = EMAC->CTXDSA ; - - do - { - /* Descriptor ownership is still EMAC, so this packet haven't been send. */ - if (desc->u32Status1 & EMAC_DESC_OWN_EMAC) - { - break; - } - - /* Get Tx status stored in descriptor */ - status = desc->u32Status2 >> 16UL; - - if (status & EMAC_TXFD_TXCP) - { - u32Count++; - } - else - { - /* Do nothing here on error. */ - if (status & EMAC_TXFD_TXABT) {} - - if (status & EMAC_TXFD_DEF) {} - - if (status & EMAC_TXFD_PAU) {} - - if (status & EMAC_TXFD_EXDEF) {} - - if (status & EMAC_TXFD_NCS) {} - - if (status & EMAC_TXFD_SQE) {} - - if (status & EMAC_TXFD_LC) {} - - if (status & EMAC_TXFD_TXHA) {} - } - - /* restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - /* go to next descriptor in link */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - } - while (last_tx_desc != (uint32_t)desc); /* If we reach last sent Tx descriptor, leave the loop */ - - /* Save last processed Tx descriptor */ - psMemMgr->psCurrentTxDesc = (EMAC_DESCRIPTOR_T *)desc; - } - - return (u32Count); -} - -/** - * @brief Clean up process after a packet is sent, and get the time stamp while packet is sent - * @param[in] pu32Sec Second value while packet sent - * @param[in] pu32Nsec Nano second value while packet sent - * @return If a packet sent successfully - * @retval 0 No packet sent successfully, and the value in *pu32Sec and *pu32Nsec are meaningless - * @retval 1 A packet sent successfully, and the value in *pu32Sec and *pu32Nsec is the time stamp while packet sent - * @details EMAC Tx interrupt service routine \b must call this API or \ref EMAC_SendPktDone to - * release the resource use by transmit process - */ -uint32_t EMAC_SendPktDoneTS(EMAC_MEMMGR_T *psMemMgr, uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - uint32_t reg; - uint32_t u32Count = 0UL; - - reg = EMAC->INTSTS; - /* Clear Tx interrupt flags */ - EMAC->INTSTS = reg & (0xFFFF0000UL & ~EMAC_INTSTS_TSALMIF_Msk); - - - if (reg & EMAC_INTSTS_TXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Process the descriptor. - Get our first descriptor to process */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentTxDesc; - - /* Descriptor ownership is still EMAC, so this packet haven't been send. */ - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - /* Get Tx status stored in descriptor */ - uint32_t status = desc->u32Status2 >> 16UL; - - if (status & EMAC_TXFD_TXCP) - { - u32Count = 1UL; - *pu32Sec = desc->u32Next; /* second stores in descriptor's NEXT field */ - *pu32Nsec = EMAC_Subsec2Nsec(desc->u32Data); /* Sub nano second store in DATA field */ - } - else - { - /* Do nothing here on error. */ - if (status & EMAC_TXFD_TXABT) {} - - if (status & EMAC_TXFD_DEF) {} - - if (status & EMAC_TXFD_PAU) {} - - if (status & EMAC_TXFD_EXDEF) {} - - if (status & EMAC_TXFD_NCS) {} - - if (status & EMAC_TXFD_SQE) {} - - if (status & EMAC_TXFD_LC) {} - - if (status & EMAC_TXFD_TXHA) {} - } - - /* restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - /* go to next descriptor in link */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Tx descriptor */ - psMemMgr->psCurrentTxDesc = desc; - } - } - - return (u32Count); -} - -/** - * @brief Enable IEEE1588 time stamp function and set current time - * @param[in] u32Sec Second value - * @param[in] u32Nsec Nano second value - * @return None - */ -void EMAC_EnableTS(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec) -{ -#if 0 - double f; - uint32_t reg; - EMAC->TSCTL = EMAC_TSCTL_TSEN_Msk; - EMAC->UPDSEC = u32Sec; /* Assume current time is 0 sec + 0 nano sec */ - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - - /* PTP source clock is 160MHz (Real chip using PLL). Each tick is 6.25ns - Assume we want to set each tick to 100ns. - Increase register = (100 * 2^31) / (10^9) = 214.71 =~ 215 = 0xD7 - Addend register = 2^32 * tick_freq / (160MHz), where tick_freq = (2^31 / 215) MHz - From above equation, addend register = 2^63 / (160M * 215) ~= 268121280 = 0xFFB34C0 - So: - EMAC->TSIR = 0xD7; - EMAC->TSAR = 0x1E70C600; */ - f = (100.0 * 2147483648.0) / (1000000000.0) + 0.5; - EMAC->TSINC = (reg = (uint32_t)f); - f = (double)9223372036854775808.0 / ((double)(CLK_GetHCLKFreq()) * (double)reg); - EMAC->TSADDEND = (uint32_t)f; - EMAC->TSCTL |= (EMAC_TSCTL_TSUPDATE_Msk | EMAC_TSCTL_TSIEN_Msk | EMAC_TSCTL_TSMODE_Msk); /* Fine update */ -#endif -} - -/** - * @brief Disable IEEE1588 time stamp function - * @param None - * @return None - */ -void EMAC_DisableTS(EMAC_T *EMAC) -{ -#if 0 - EMAC->TSCTL = 0UL; -#endif -} - -/** - * @brief Get current time stamp - * @param[out] pu32Sec Current second value - * @param[out] pu32Nsec Current nano second value - * @return None - */ -void EMAC_GetTime(EMAC_T *EMAC, uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - /* Must read TSLSR firstly. Hardware will preserve TSMSR value at the time TSLSR read. */ - *pu32Nsec = EMAC_Subsec2Nsec(EMAC->TSSUBSEC); - *pu32Sec = EMAC->TSSEC; -} - -/** - * @brief Set current time stamp - * @param[in] u32Sec Second value - * @param[in] u32Nsec Nano second value - * @return None - */ -void EMAC_SetTime(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec) -{ - /* Disable time stamp counter before update time value (clear EMAC_TSCTL_TSIEN_Msk) */ - EMAC->TSCTL = EMAC_TSCTL_TSEN_Msk; - EMAC->UPDSEC = u32Sec; - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - EMAC->TSCTL |= (EMAC_TSCTL_TSIEN_Msk | EMAC_TSCTL_TSMODE_Msk); - -} - -/** - * @brief Enable alarm function and set alarm time - * @param[in] u32Sec Second value to trigger alarm - * @param[in] u32Nsec Nano second value to trigger alarm - * @return None - */ -void EMAC_EnableAlarm(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec) -{ - - EMAC->ALMSEC = u32Sec; - EMAC->ALMSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - EMAC->TSCTL |= EMAC_TSCTL_TSALMEN_Msk; - -} - -/** - * @brief Disable alarm function - * @param None - * @return None - */ -void EMAC_DisableAlarm(EMAC_T *EMAC) -{ - - EMAC->TSCTL &= ~EMAC_TSCTL_TSALMEN_Msk; - -} - -/** - * @brief Add a offset to current time - * @param[in] u32Neg Offset is negative value (u32Neg == 1) or positive value (u32Neg == 0). - * @param[in] u32Sec Second value to add to current time - * @param[in] u32Nsec Nano second value to add to current time - * @return None - */ -void EMAC_UpdateTime(EMAC_T *EMAC, uint32_t u32Neg, uint32_t u32Sec, uint32_t u32Nsec) -{ - EMAC->UPDSEC = u32Sec; - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - - if (u32Neg) - { - EMAC->UPDSUBSEC |= BIT31; /* Set bit 31 indicates this is a negative value */ - } - - EMAC->TSCTL |= EMAC_TSCTL_TSUPDATE_Msk; - -} - -/** - * @brief Check Ethernet link status - * @param None - * @return Current link status, could be one of following value. - * - \ref EMAC_LINK_DOWN - * - \ref EMAC_LINK_100F - * - \ref EMAC_LINK_100H - * - \ref EMAC_LINK_10F - * - \ref EMAC_LINK_10H - * @note This API should be called regularly to sync EMAC setting with real connection status - */ -uint32_t EMAC_CheckLinkStatus(EMAC_T *EMAC) -{ - uint32_t reg, ret = EMAC_LINK_DOWN; - - /* Check link valid again */ - if (EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID) - { - /* Check link partner capability */ - reg = EMAC_MdioRead(EMAC, PHY_ANLPA_REG, EMAC_PHY_ADDR) ; - - if (reg & PHY_ANLPA_DR100_TX_FULL) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_100F; - } - else if (reg & PHY_ANLPA_DR100_TX_HALF) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_100H; - } - else if (reg & PHY_ANLPA_DR10_TX_FULL) - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_10F; - } - else - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_10H; - } - } - - return ret; -} - -/** - * @brief Fill a MAC address to list and enable. - * @param A MAC address - * @return The CAM index - * @retval -1 Failed to fill the MAC address. - * @retval 0~(EMAC_CAMENTRY_NB-1) The index number of entry location. - */ -int32_t EMAC_FillCamEntry(EMAC_T *EMAC, uint8_t pu8MacAddr[]) -{ - uint32_t *EMAC_CAMxM; - uint32_t *EMAC_CAMxL; - int32_t index; - uint8_t mac[6]; - - for (index = 0; index < EMAC_CAMENTRY_NB; index ++) - { - EMAC_CAMxM = (uint32_t *)((uint32_t)&EMAC->CAM0M + (index * 8)); - EMAC_CAMxL = (uint32_t *)((uint32_t)&EMAC->CAM0L + (index * 8)); - - mac[0] = (*EMAC_CAMxM >> 24) & 0xff; - mac[1] = (*EMAC_CAMxM >> 16) & 0xff; - mac[2] = (*EMAC_CAMxM >> 8) & 0xff; - mac[3] = (*EMAC_CAMxM) & 0xff; - mac[4] = (*EMAC_CAMxL >> 24) & 0xff; - mac[5] = (*EMAC_CAMxL >> 16) & 0xff; - - if (memcmp(mac, pu8MacAddr, sizeof(mac)) == 0) - { - goto exit_emac_fillcamentry; - } - - if (*EMAC_CAMxM == 0 && *EMAC_CAMxL == 0) - { - break; - } - } - - if (index < EMAC_CAMENTRY_NB) - { - EMAC_EnableCamEntry(EMAC, index, pu8MacAddr); - goto exit_emac_fillcamentry; - } - - return -1; - -exit_emac_fillcamentry: - - return index; -} - -/** - * @brief Send an Ethernet packet - * @param[in] u32Size Packet size (without 4 byte CRC). - * @return Packet transmit success or not - * @retval 0 Transmit failed due to descriptor unavailable. - * @retval 1 Triggered to transmit. - * @note Return 1 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_SendPktWoCopy(EMAC_MEMMGR_T *psMemMgr, uint32_t u32Size) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Get Tx frame descriptor & data pointer */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psNextTxDesc; - uint32_t status = desc->u32Status1; - uint32_t ret = 0UL; - - /* Check descriptor ownership */ - if ((status & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - /* Set Tx descriptor transmit byte count */ - desc->u32Status2 = u32Size; - - /* Change descriptor ownership to EMAC */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get next Tx descriptor */ - psMemMgr->psNextTxDesc = (EMAC_DESCRIPTOR_T *)(desc->u32Next); - - /* Trigger EMAC to send the packet */ - EMAC_TRIGGER_TX(EMAC); - ret = 1UL; - } - - return (ret); -} - -/** - * @brief Get avaiable TX buffer address - * @param None - * @return An avaiable TX buffer. - * @note This API should be called before EMAC_SendPkt_WoCopy calling. Caller will do data-copy. - */ -uint8_t *EMAC_ClaimFreeTXBuf(EMAC_MEMMGR_T *psMemMgr) -{ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psNextTxDesc; - - if (desc->u32Status1 & EMAC_DESC_OWN_EMAC) - { - return (NULL); - } - else - { - return (uint8_t *)desc->u32Data; - } -} - -/** - * @brief Get data length of avaiable RX buffer. - * @param None - * @return An data length of avaiable RX buffer. - * @note This API should be called before EMAC_RecvPktDone_WoTrigger calling. Caller will do data-copy. - */ -uint32_t EMAC_GetAvailRXBufSize(EMAC_MEMMGR_T *psMemMgr, uint8_t **ppuDataBuf) -{ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - uint32_t status = desc->u32Status1 >> 16; - - /* It is good and no CRC error. */ - if ((status & EMAC_RXFD_RXGD) && !(status & EMAC_RXFD_CRCE)) - { - *ppuDataBuf = (uint8_t *)desc->u32Data; - return desc->u32Status1 & 0xFFFFUL; - } - else - { - // Drop it - EMAC_RecvPktDone(psMemMgr); - } - } - - return 0; -} - - -/** - * @brief Clean up process after a packet is received. - * @param None - * @return None - * @details Caller must call the function to release the resource. - * @note Application can only call this function once every time \ref EMAC_RecvPkt or \ref EMAC_RecvPktTS returns 1 - * @note This function is without doing EMAC_TRIGGER_RX. - */ -void EMAC_RecvPktDoneWoRxTrigger(EMAC_MEMMGR_T *psMemMgr) -{ - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - /* Restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - - /* Change ownership to DMA for next use */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get Next Frame Descriptor pointer to process */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Rx descriptor */ - psMemMgr->psCurrentRxDesc = desc; -} - - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EMAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_etimer.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_etimer.c deleted file mode 100644 index f34db44f6f3..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_etimer.c +++ /dev/null @@ -1,341 +0,0 @@ -/**************************************************************************//** - * @file etimer.c - * @brief N9H30 series ETIMER driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "N9H30.h" -#include "nu_sys.h" - -/// @cond HIDDEN_SYMBOLS -/** - * @brief This API is used to get the clock frequency of Timer - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return Timer clock frequency - * @note This API cannot return correct clock rate if timer source is external clock input. - */ -UINT ETIMER_GetModuleClock(UINT timer) -{ - UINT src; - - src = (inpw(REG_CLK_DIVCTL8) >> (16 + timer * 4)) & 0x3; - - if (src == 0) - return 12000000; - else if (src == 1) - return (sysGetClock(SYS_PCLK) * 1000000); - else if (src == 2) - return (sysGetClock(SYS_PCLK) * 1000000 / 4096); - else - return 32768; - -} - -/// @endcond /* HIDDEN_SYMBOLS */ - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_ETIMER_Driver ETIMER Driver - @{ -*/ - - -/** @addtogroup N9H30_ETIMER_EXPORTED_FUNCTIONS ETIMER Exported Functions - @{ -*/ - -/** - * @brief This API is used to configure timer to operate in specified mode - * and frequency. If timer cannot work in target frequency, a closest - * frequency will be chose and returned. - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @param[in] u32Mode Operation mode. Possible options are - * - \ref ETIMER_ONESHOT_MODE - * - \ref ETIMER_PERIODIC_MODE - * - \ref ETIMER_TOGGLE_MODE - * - \ref ETIMER_CONTINUOUS_MODE - * @param[in] u32Freq Target working frequency - * @return Real Timer working frequency - * @note After calling this API, Timer is \b NOT running yet. But could start timer running be calling - * \ref ETIMER_Start macro or program registers directly - */ -UINT ETIMER_Open(UINT timer, UINT u32Mode, UINT u32Freq) -{ - UINT u32Clk = ETIMER_GetModuleClock(timer); - UINT u32Cmpr = 0, u32Prescale = 0; - - // Fastest possible timer working freq is u32Clk / 2. While cmpr = 2, pre-scale = 0 - if (u32Freq > (u32Clk / 2)) - { - u32Cmpr = 2; - } - else - { - if (u32Clk >= 0x4000000) - { - u32Prescale = 7; // real prescaler value is 8 - u32Clk >>= 3; - } - else if (u32Clk >= 0x2000000) - { - u32Prescale = 3; // real prescaler value is 4 - u32Clk >>= 2; - } - else if (u32Clk >= 0x1000000) - { - u32Prescale = 1; // real prescaler value is 2 - u32Clk >>= 1; - } - u32Cmpr = u32Clk / u32Freq; - } - - if (timer == 0) - { - outpw(REG_ETMR0_CMPR, u32Cmpr); - outpw(REG_ETMR0_PRECNT, u32Prescale); - outpw(REG_ETMR0_CTL, 1 | u32Mode); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CMPR, u32Cmpr); - outpw(REG_ETMR1_PRECNT, u32Prescale); - outpw(REG_ETMR1_CTL, 1 | u32Mode); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CMPR, u32Cmpr); - outpw(REG_ETMR2_PRECNT, u32Prescale); - outpw(REG_ETMR2_CTL, 1 | u32Mode); - } - else - { - outpw(REG_ETMR3_CMPR, u32Cmpr); - outpw(REG_ETMR3_PRECNT, u32Prescale); - outpw(REG_ETMR3_CTL, 1 | u32Mode); - } - - return (u32Clk / (u32Cmpr * (u32Prescale + 1))); -} - -/** - * @brief This API stops Timer counting and disable the Timer interrupt function - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -void ETIMER_Close(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, 0); - outpw(REG_ETMR0_IER, 0); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, 0); - outpw(REG_ETMR1_IER, 0); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, 0); - outpw(REG_ETMR2_IER, 0); - } - else - { - outpw(REG_ETMR3_CTL, 0); - outpw(REG_ETMR3_IER, 0); - } -} - -/** - * @brief This API is used to create a delay loop for u32usec micro seconds - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @param[in] u32Usec Delay period in micro seconds with 10 usec every step. Valid values are between 10~1000000 (10 micro second ~ 1 second) - * @return None - * @note This API overwrites the register setting of the timer used to count the delay time. - * @note This API use polling mode. So there is no need to enable interrupt for the timer module used to generate delay - */ -void ETIMER_Delay(UINT timer, UINT u32Usec) -{ - UINT u32Clk = ETIMER_GetModuleClock(timer); - UINT u32Prescale = 0, delay = 300000000 / u32Clk; - float fCmpr; - - // Clear current timer configuration - if (timer == 0) - { - outpw(REG_ETMR0_CTL, 0); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, 0); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, 0); - } - else - { - outpw(REG_ETMR3_CTL, 0); - } - - if (u32Clk == 10000) // min delay is 100us if timer clock source is LIRC 10k - { - u32Usec = ((u32Usec + 99) / 100) * 100; - } - else // 10 usec every step - { - u32Usec = ((u32Usec + 9) / 10) * 10; - } - - if (u32Clk >= 0x4000000) - { - u32Prescale = 7; // real prescaler value is 8 - u32Clk >>= 3; - } - else if (u32Clk >= 0x2000000) - { - u32Prescale = 3; // real prescaler value is 4 - u32Clk >>= 2; - } - else if (u32Clk >= 0x1000000) - { - u32Prescale = 1; // real prescaler value is 2 - u32Clk >>= 1; - } - - // u32Usec * u32Clk might overflow if using UINT - fCmpr = ((float)u32Usec * (float)u32Clk) / 1000000.0; - - if (timer == 0) - { - outpw(REG_ETMR0_CMPR, (UINT)fCmpr); - outpw(REG_ETMR0_PRECNT, u32Prescale); - outpw(REG_ETMR0_CTL, 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CMPR, (UINT)fCmpr); - outpw(REG_ETMR1_PRECNT, u32Prescale); - outpw(REG_ETMR1_CTL, 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CMPR, (UINT)fCmpr); - outpw(REG_ETMR2_PRECNT, u32Prescale); - outpw(REG_ETMR2_CTL, 1); - } - else - { - outpw(REG_ETMR3_CMPR, (UINT)fCmpr); - outpw(REG_ETMR3_PRECNT, u32Prescale); - outpw(REG_ETMR3_CTL, 1); - } - - // When system clock is faster than timer clock, it is possible timer active bit cannot set in time while we check it. - // And the while loop below return immediately, so put a tiny delay here allowing timer start counting and raise active flag. - for (; delay > 0; delay--) - { -#if defined (__GNUC__) && !(__CC_ARM) - __asm__ __volatile__ - ( - "nop \n" - ); -#else - __asm - { - NOP - } -#endif - } - - if (timer == 0) - { - while (inpw(REG_ETMR0_CTL) & 0x80); - } - else if (timer == 1) - { - while (inpw(REG_ETMR1_CTL) & 0x80); - } - else if (timer == 2) - { - while (inpw(REG_ETMR2_CTL) & 0x80); - } - else - { - while (inpw(REG_ETMR3_CTL) & 0x80); - } -} - -/** - * @brief This API is used to enable timer capture function with specified mode and capture edge - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @param[in] u32CapMode Timer capture mode. Could be - * - \ref ETIMER_CAPTURE_FREE_COUNTING_MODE - * - \ref ETIMER_CAPTURE_TRIGGER_COUNTING_MODE - * - \ref ETIMER_CAPTURE_COUNTER_RESET_MODE - * @param[in] u32Edge Timer capture edge. Possible values are - * - \ref ETIMER_CAPTURE_FALLING_EDGE - * - \ref ETIMER_CAPTURE_RISING_EDGE - * - \ref ETIMER_CAPTURE_FALLING_THEN_RISING_EDGE - * - \ref ETIMER_CAPTURE_RISING_THEN_FALLING_EDGE - * @return None - * @note Timer frequency should be configured separately by using \ref ETIMER_Open API, or program registers directly - */ -void ETIMER_EnableCapture(UINT timer, UINT u32CapMode, UINT u32Edge) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, (inpw(REG_ETMR0_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, (inpw(REG_ETMR1_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, (inpw(REG_ETMR2_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else - { - outpw(REG_ETMR3_CTL, (inpw(REG_ETMR3_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } -} - -/** - * @brief This API is used to disable the Timer capture function - * @param[in] timer ETIMER number. Range from 0 ~ 3 - * @return None - */ -void ETIMER_DisableCapture(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~0x10000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~0x10000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~0x10000); - } - else - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~0x10000); - } - -} - - -/*@}*/ /* end of group N9H30_ETIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_ETIMER_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_fmi.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_fmi.c deleted file mode 100644 index 3f80d5fbb27..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_fmi.c +++ /dev/null @@ -1,920 +0,0 @@ -/**************************************************************************//** - * @file fmi.c - * @brief N9H30 FMI eMMC driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_fmi.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_FMI_Driver FMI Driver - @{ -*/ - - -/** @addtogroup N9H30_FMI_EXPORTED_FUNCTIONS FMI Exported Functions - @{ -*/ -/// @cond HIDDEN_SYMBOLS - -#define FMI_BLOCK_SIZE 512 - -// global variables -// For response R3 (such as ACMD41, CRC-7 is invalid; but FMI controller will still -// calculate CRC-7 and get an error result, software should ignore this error and clear INTSTS [CRC_IF] flag -// _fmi_uR3_CMD is the flag for it. 1 means software should ignore CRC-7 error -unsigned int _fmi_uR3_CMD = 0; -unsigned int _fmi_uR7_CMD = 0; -unsigned char volatile _fmi_eMMCDataReady = FALSE; - -unsigned char *_fmi_peMMCBuffer; -unsigned int gFMIReferenceClock; - -#ifdef __ICCARM__ - #pragma data_alignment = 4096 - unsigned char _fmi_uceMMCBuffer[512]; -#else - unsigned char _fmi_uceMMCBuffer[512] __attribute__((aligned(4096))); -#endif - -int emmc_ok = 0; - -unsigned char peMMC_offset = 0; - -EMMC_INFO_T eMMC; - -void eMMC_CheckRB() -{ - while (1) - { - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CLK8OEN_Msk); - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CLK8OEN_Msk); - if (inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_DAT0STS_Msk) - break; - } -} - - -int eMMC_Command(EMMC_INFO_T *pSD, unsigned char ucCmd, unsigned int uArg) -{ - volatile int buf; - - outpw(REG_FMI_EMMCCMD, uArg); - buf = (inpw(REG_FMI_EMMCCTL) & (~FMI_EMMCCTL_CMDCODE_Msk)) | (ucCmd << 8) | (FMI_EMMCCTL_COEN_Msk); - outpw(REG_FMI_EMMCCTL, buf); - - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_COEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - return 0; -} - - -int eMMC_CmdAndRsp(EMMC_INFO_T *pSD, unsigned char ucCmd, unsigned int uArg, int ntickCount) -{ - volatile int buf; - - outpw(REG_FMI_EMMCCMD, uArg); - buf = (inpw(REG_FMI_EMMCCTL) & (~FMI_EMMCCTL_CMDCODE_Msk)) | (ucCmd << 8) | (FMI_EMMCCTL_COEN_Msk | FMI_EMMCCTL_RIEN_Msk); - outpw(REG_FMI_EMMCCTL, buf); - - if (ntickCount > 0) - { - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_RIEN_Msk) - { - if (ntickCount-- == 0) - { - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CTLRST_Msk); // reset SD engine - return 2; - } - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - } - else - { - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - } - - if (_fmi_uR7_CMD) - { - if (((inpw(REG_FMI_EMMCRESP1) & 0xff) != 0x55) && ((inpw(REG_FMI_EMMCRESP0) & 0xf) != 0x01)) - { - _fmi_uR7_CMD = 0; - return EMMC_CMD8_ERROR; - } - } - - if (!_fmi_uR3_CMD) - { - if (inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC7_Msk) // check CRC7 - return 0; - else - return EMMC_CRC7_ERROR; - } - else // ignore CRC error for R3 case - { - _fmi_uR3_CMD = 0; - outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_CRCIF_Msk); - return 0; - } -} - -int eMMC_Swap32(int val) -{ - int buf; - - buf = val; - val <<= 24; - val |= (buf << 8) & 0xff0000; - val |= (buf >> 8) & 0xff00; - val |= (buf >> 24) & 0xff; - return val; -} - -// Get 16 bytes CID or CSD -int eMMC_CmdAndRsp2(EMMC_INFO_T *pSD, unsigned char ucCmd, unsigned int uArg, unsigned int *puR2ptr) -{ - unsigned int i, buf; - unsigned int tmpBuf[5]; - - outpw(REG_FMI_EMMCCMD, uArg); - buf = (inpw(REG_FMI_EMMCCTL) & (~FMI_EMMCCTL_CMDCODE_Msk)) | (ucCmd << 8) | (FMI_EMMCCTL_COEN_Msk | FMI_EMMCCTL_R2EN_Msk); - outpw(REG_FMI_EMMCCTL, buf); - - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_R2EN_Msk) - { - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - - if (inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC7_Msk) - { - for (i = 0; i < 5; i++) - tmpBuf[i] = eMMC_Swap32(*(int *)(FMI_BA + i * 4)); - for (i = 0; i < 4; i++) - *puR2ptr++ = ((tmpBuf[i] & 0x00ffffff) << 8) | ((tmpBuf[i + 1] & 0xff000000) >> 24); - return 0; - } - else - return EMMC_CRC7_ERROR; -} - - -int eMMC_CmdAndRspDataIn(EMMC_INFO_T *pSD, unsigned char ucCmd, unsigned int uArg) -{ - volatile int buf; - - outpw(REG_FMI_EMMCCMD, uArg); - buf = (inpw(REG_FMI_EMMCCTL) & (~FMI_EMMCCTL_CMDCODE_Msk)) | (ucCmd << 8) | (FMI_EMMCCTL_COEN_Msk | FMI_EMMCCTL_RIEN_Msk | FMI_EMMCCTL_DIEN_Msk); - outpw(REG_FMI_EMMCCTL, buf); - - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_DIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - - if (!(inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC7_Msk)) // check CRC7 - { - return EMMC_CRC7_ERROR; - } - - if (!(inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC16_Msk)) // check CRC16 - { - return EMMC_CRC16_ERROR; - } - return 0; -} - -// there are 3 bits for divider N0, maximum is 8 -#define EMMC_CLK_DIV0_MAX 8 -// there are 8 bits for divider N1, maximum is 256 -#define EMMC_CLK_DIV1_MAX 256 - -void eMMC_Set_clock(unsigned int clock_khz) -{ - UINT32 rate, div0, div1, i; - - //--- calculate the rate that 2 divider have to divide - // _fmi_uFMIReferenceClock is the input clock with unit KHz like as APLL/UPLL and - if (clock_khz > gFMIReferenceClock) - { - //sysprintf("ERROR: wrong eMMC clock %dKHz since it is faster than input clock %dKHz !\n", clock_khz, gFMIReferenceClock); - return; - } - rate = gFMIReferenceClock / clock_khz; - // choose slower clock if system clock cannot divisible by wanted clock - if (gFMIReferenceClock % clock_khz != 0) - rate++; - - if (rate > (EMMC_CLK_DIV0_MAX * EMMC_CLK_DIV1_MAX)) // the maximum divider for EMMC_CLK is (EMMC_CLK_DIV0_MAX * EMMC_CLK_DIV1_MAX) - { - //sysprintf("ERROR: wrong SD clock %dKHz since it is slower than input clock %dKHz/%d !\n", clock_khz, gFMIReferenceClock, EMMC_CLK_DIV0_MAX * EMMC_CLK_DIV1_MAX); - return; - } - - //--- choose a suitable value for first divider - for (div0 = EMMC_CLK_DIV0_MAX; div0 > 0; div0--) // choose the maximum value if can exact division - { - if (rate % div0 == 0) - break; - } - if (div0 == 0) // cannot exact division - { - // if rate <= EMMC_CLK_DIV1_MAX, set div0 to 1 since div1 can exactly divide input clock - div0 = (rate <= EMMC_CLK_DIV1_MAX) ? 1 : EMMC_CLK_DIV0_MAX; - } - - //--- calculate the second divider - div1 = rate / div0; - div1 &= 0xFF; - - //sysprintf("Set_clock(): wanted clock=%d, rate=%d, div0=%d, div1=%d\n", clock_khz, rate, div0, div1); - - //--- setup register - outpw(REG_CLK_DIVCTL3, (inpw(REG_CLK_DIVCTL3) & ~0x18) | (0x3 << 3)); - outpw(REG_CLK_DIVCTL3, (inpw(REG_CLK_DIVCTL3) & ~0x7) | (div0 - 1)); - outpw(REG_CLK_DIVCTL3, (inpw(REG_CLK_DIVCTL3) & ~0xff00) | ((div1 - 1) << 8)); - for (i = 0; i < 1000; i++); // waiting for clock become stable - return; -} - -// Initial -int eMMC_Init(EMMC_INFO_T *pSD) -{ - int volatile i, status; - unsigned int resp; - unsigned int CIDBuffer[4]; - unsigned int volatile u32CmdTimeOut; - - // set the clock to 300KHz - eMMC_Set_clock(300); - - // power ON 74 clock - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CLK74OEN_Msk); - - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CLK74OEN_Msk); - - eMMC_Command(pSD, 0, 0); // reset all cards - for (i = 0x1000; i > 0; i--); - - // initial SDHC - _fmi_uR7_CMD = 1; - u32CmdTimeOut = 5000; - - i = eMMC_CmdAndRsp(pSD, 8, 0x00000155, u32CmdTimeOut); - if (i == 0) - { - // SD 2.0 - eMMC_CmdAndRsp(pSD, 55, 0x00, u32CmdTimeOut); - _fmi_uR3_CMD = 1; - eMMC_CmdAndRsp(pSD, 41, 0x40ff8000, u32CmdTimeOut); // 2.7v-3.6v - resp = inpw(REG_FMI_EMMCRESP0); - - while (!(resp & 0x00800000)) // check if card is ready - { - eMMC_CmdAndRsp(pSD, 55, 0x00, u32CmdTimeOut); - _fmi_uR3_CMD = 1; - eMMC_CmdAndRsp(pSD, 41, 0x40ff8000, u32CmdTimeOut); // 3.0v-3.4v - resp = inpw(REG_FMI_EMMCRESP0); - } - if (resp & 0x00400000) - pSD->CardType = EMMC_TYPE_SD_HIGH; - else - pSD->CardType = EMMC_TYPE_SD_LOW; - } - else - { - // SD 1.1 - eMMC_Command(pSD, 0, 0); // reset all cards - for (i = 0x100; i > 0; i--); - - i = eMMC_CmdAndRsp(pSD, 55, 0x00, u32CmdTimeOut); - if (i == 2) // MMC memory - { - - eMMC_Command(pSD, 0, 0); // reset - for (i = 0x100; i > 0; i--); - - _fmi_uR3_CMD = 1; - - if (eMMC_CmdAndRsp(pSD, 1, 0x40ff8000, u32CmdTimeOut) != 2) // eMMC memory - { - resp = inpw(REG_FMI_EMMCRESP0); - while (!(resp & 0x00800000)) // check if card is ready - { - _fmi_uR3_CMD = 1; - - eMMC_CmdAndRsp(pSD, 1, 0x40ff8000, u32CmdTimeOut); // high voltage - resp = inpw(REG_FMI_EMMCRESP0); - } - - if (resp & 0x00400000) - pSD->CardType = EMMC_TYPE_EMMC; - else - pSD->CardType = EMMC_TYPE_MMC; - } - else - { - pSD->CardType = EMMC_TYPE_UNKNOWN; - return EMMC_ERR_DEVICE; - } - } - else if (i == 0) // SD Memory - { - _fmi_uR3_CMD = 1; - eMMC_CmdAndRsp(pSD, 41, 0x00ff8000, u32CmdTimeOut); // 3.0v-3.4v - resp = inpw(REG_FMI_EMMCRESP0); - while (!(resp & 0x00800000)) // check if card is ready - { - eMMC_CmdAndRsp(pSD, 55, 0x00, u32CmdTimeOut); - _fmi_uR3_CMD = 1; - eMMC_CmdAndRsp(pSD, 41, 0x00ff8000, u32CmdTimeOut); // 3.0v-3.4v - resp = inpw(REG_FMI_EMMCRESP0); - } - pSD->CardType = EMMC_TYPE_SD_LOW; - } - else - { - pSD->CardType = EMMC_TYPE_UNKNOWN; - return EMMC_INIT_ERROR; - } - } - - // CMD2, CMD3 - if (pSD->CardType != EMMC_TYPE_UNKNOWN) - { - eMMC_CmdAndRsp2(pSD, 2, 0x00, CIDBuffer); - if ((pSD->CardType == EMMC_TYPE_MMC) || (pSD->CardType == EMMC_TYPE_EMMC)) - { - if ((status = eMMC_CmdAndRsp(pSD, 3, 0x10000, 0)) != 0) // set RCA - return status; - pSD->RCA = 0x10000; - } - else - { - if ((status = eMMC_CmdAndRsp(pSD, 3, 0x00, 0)) != 0) // get RCA - return status; - else - pSD->RCA = (inpw(REG_FMI_EMMCRESP0) << 8) & 0xffff0000; - } - } - -#if 0 - if (pSD->CardType == EMMC_TYPE_SD_HIGH) - sysprintf("This is high capacity SD memory card\n"); - if (pSD->CardType == EMMC_TYPE_SD_LOW) - sysprintf("This is standard capacity SD memory card\n"); - if (pSD->CardType == EMMC_TYPE_EMMC) - sysprintf("This is eMMC memory card\n"); -#endif - return 0; -} - - -int eMMC_SwitchToHighSpeed(EMMC_INFO_T *pSD) -{ - int volatile status = 0; - unsigned short current_comsumption, busy_status0; - - outpw(REG_FMI_DMASA, (unsigned int)_fmi_peMMCBuffer); // set DMA transfer starting address - outpw(REG_FMI_EMMCBLEN, 63); // 512 bit - - if ((status = eMMC_CmdAndRspDataIn(pSD, 6, 0x00ffff01)) != 0) - return 1; - - current_comsumption = _fmi_peMMCBuffer[0] << 8 | _fmi_peMMCBuffer[1]; - if (!current_comsumption) - return 1; - - busy_status0 = _fmi_peMMCBuffer[28] << 8 | _fmi_peMMCBuffer[29]; - - if (!busy_status0) // function ready - { - outpw(REG_FMI_DMASA, (unsigned int)_fmi_peMMCBuffer); // set DMA transfer starting address - outpw(REG_FMI_EMMCBLEN, 63); // 512 bit - - if ((status = eMMC_CmdAndRspDataIn(pSD, 6, 0x80ffff01)) != 0) - return 1; - - // function change timing: 8 clocks - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CLK8OEN_Msk); - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CLK8OEN_Msk); - - current_comsumption = _fmi_peMMCBuffer[0] << 8 | _fmi_peMMCBuffer[1]; - if (!current_comsumption) - return 1; - - return 0; - } - else - return 1; -} - - -int eMMC_SelectCardType(EMMC_INFO_T *pSD) -{ - int volatile status = 0; - //unsigned int arg; - - if ((status = eMMC_CmdAndRsp(pSD, 7, pSD->RCA, 0)) != 0) - return status; - - eMMC_CheckRB(); - - // if SD card set 4bit - if (pSD->CardType == EMMC_TYPE_SD_HIGH) - { - _fmi_peMMCBuffer = (unsigned char *)((unsigned int)_fmi_uceMMCBuffer); - outpw(REG_FMI_DMASA, (unsigned int)_fmi_peMMCBuffer); // set DMA transfer starting address - outpw(REG_FMI_EMMCBLEN, 0x07); // 64 bit - - if ((status = eMMC_CmdAndRsp(pSD, 55, pSD->RCA, 0)) != 0) - return status; - if ((status = eMMC_CmdAndRspDataIn(pSD, 51, 0x00)) != 0) - return status; - - if ((_fmi_uceMMCBuffer[0] & 0xf) == 0x2) - { - status = eMMC_SwitchToHighSpeed(pSD); - if (status == 0) - { - /* divider */ - eMMC_Set_clock(SDHC_FREQ); - } - } - - if ((status = eMMC_CmdAndRsp(pSD, 55, pSD->RCA, 0)) != 0) - return status; - if ((status = eMMC_CmdAndRsp(pSD, 6, 0x02, 0)) != 0) // set bus width - return status; - - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_DBW_Msk); - } - else if (pSD->CardType == EMMC_TYPE_SD_LOW) - { - _fmi_peMMCBuffer = (unsigned char *)((unsigned int)_fmi_uceMMCBuffer); - outpw(REG_FMI_DMASA, (unsigned int) _fmi_peMMCBuffer); // set DMA transfer starting address - outpw(REG_FMI_EMMCBLEN, 0x07); // 64 bit - - if ((status = eMMC_CmdAndRsp(pSD, 55, pSD->RCA, 0)) != 0) - return status; - if ((status = eMMC_CmdAndRspDataIn(pSD, 51, 0x00)) != 0) - return status; - - // set data bus width. ACMD6 for SD card, SDCR_DBW for host. - if ((status = eMMC_CmdAndRsp(pSD, 55, pSD->RCA, 0)) != 0) - return status; - - if ((status = eMMC_CmdAndRsp(pSD, 6, 0x02, 0)) != 0) // set bus width - return status; - - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_DBW_Msk); - } - else if (pSD->CardType == EMMC_TYPE_MMC) - { - - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) & ~FMI_EMMCCTL_DBW_Msk); - - } - else if (pSD->CardType == EMMC_TYPE_EMMC) - { - - //--- sent CMD6 to MMC card to set bus width to 4 bits mode, skymedi only support 1-bit - // set CMD6 argument Access field to 3, Index to 183, Value to 1 (4-bit mode) -// arg = (3 << 24) | (183 << 16) | (1 << 8); -// if ((status = eMMC_CmdAndRsp(pSD, 6, arg, 0)) != 0) -// return status; -// eMMC_CheckRB(); - -// outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL)| FMI_EMMCCTL_DBW_Msk); - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) & ~FMI_EMMCCTL_DBW_Msk); - } - - if ((status = eMMC_CmdAndRsp(pSD, 16, FMI_BLOCK_SIZE, 0)) != 0) // set block length - return status; - outpw(REG_FMI_EMMCBLEN, FMI_BLOCK_SIZE - 1); // set the block size - - eMMC_Command(pSD, 7, 0); - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CLK8OEN_Msk); - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CLK8OEN_Msk); - - outpw(REG_FMI_EMMCINTEN, inpw(REG_FMI_EMMCINTEN) | FMI_EMMCINTEN_BLKDIEN_Msk); - - return 0; -} - -void eMMC_Get_info(EMMC_INFO_T *pSD) -{ - unsigned int R_LEN, C_Size, MULT, size; - unsigned int Buffer[4]; - unsigned char *ptr; - - eMMC_CmdAndRsp2(pSD, 9, pSD->RCA, Buffer); - - if ((pSD->CardType == EMMC_TYPE_MMC) || (pSD->CardType == EMMC_TYPE_EMMC)) - { - // for MMC/eMMC card - if ((Buffer[0] & 0xc0000000) == 0xc0000000) - { - // CSD_STRUCTURE [127:126] is 3 - // CSD version depend on EXT_CSD register in eMMC v4.4 for card size > 2GB - eMMC_CmdAndRsp(pSD, 7, pSD->RCA, 0); - - ptr = (unsigned char *)((unsigned int)_fmi_uceMMCBuffer); - outpw(REG_FMI_DMASA, (unsigned int)ptr); // set DMA transfer starting address - outpw(REG_FMI_EMMCBLEN, 511); // read 512 bytes for EXT_CSD - - if (eMMC_CmdAndRspDataIn(pSD, 8, 0x00) != 0) - return; - - eMMC_Command(pSD, 7, 0); - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CLK8OEN_Msk); - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CLK8OEN_Msk); - - pSD->totalSectorN = (*(unsigned int *)(ptr + 212)); - pSD->diskSize = pSD->totalSectorN / 2; - } - else - { - // CSD version v1.0/1.1/1.2 in eMMC v4.4 spec for card size <= 2GB - R_LEN = (Buffer[1] & 0x000f0000) >> 16; - C_Size = ((Buffer[1] & 0x000003ff) << 2) | ((Buffer[2] & 0xc0000000) >> 30); - MULT = (Buffer[2] & 0x00038000) >> 15; - size = (C_Size + 1) * (1 << (MULT + 2)) * (1 << R_LEN); - - pSD->diskSize = size / 1024; - pSD->totalSectorN = size / 512; - } - } - else - { - if (Buffer[0] & 0xc0000000) - { - C_Size = ((Buffer[1] & 0x0000003f) << 16) | ((Buffer[2] & 0xffff0000) >> 16); - size = (C_Size + 1) * 512; // Kbytes - - pSD->diskSize = size; - pSD->totalSectorN = size << 1; - } - else - { - R_LEN = (Buffer[1] & 0x000f0000) >> 16; - C_Size = ((Buffer[1] & 0x000003ff) << 2) | ((Buffer[2] & 0xc0000000) >> 30); - MULT = (Buffer[2] & 0x00038000) >> 15; - size = (C_Size + 1) * (1 << (MULT + 2)) * (1 << R_LEN); - - pSD->diskSize = size / 1024; - pSD->totalSectorN = size / 512; - } - } - pSD->sectorSize = 512; - //sysprintf("The size is %d KB\n", pSD->diskSize); -} - -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief This function use to tell FMI eMMC engine clock. - * - * @param[in] u32Clock Set current eMMC engine clock - * - * @return None - */ -void FMI_SetReferenceClock(unsigned int u32Clock) -{ - gFMIReferenceClock = u32Clock; // kHz -} - -/** - * @brief This function use to reset FMI eMMC function. - * - * @return None - */ -void eMMC_Open(void) -{ - // enable DMAC - outpw(REG_FMI_DMACTL, FMI_DMACTL_DMARST_Msk); - while (inpw(REG_FMI_DMACTL) & FMI_DMACTL_DMARST_Msk); - - outpw(REG_FMI_DMACTL, FMI_DMACTL_DMAEN_Msk); - - //Reset Global - outpw(REG_FMI_CTL, FMI_CTL_CTLRST_Msk); - while (inpw(REG_FMI_CTL) & FMI_CTL_CTLRST_Msk); - - // enable eMMC - outpw(REG_FMI_CTL, FMI_CTL_EMMCEN_Msk); - - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CTLRST_Msk); - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CTLRST_Msk); - - memset(&eMMC, 0, sizeof(EMMC_INFO_T)); - eMMC.IsCardInsert = 1; -} - -/** - * @brief This function use to initial eMMC card. - * - * @return None - */ -void eMMC_Probe(void) -{ - // Disable FMI interrupt - outpw(REG_FMI_INTEN, 0); - - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) & ~(FMI_EMMCCTL_SDNWR_Msk | FMI_EMMCCTL_BLKCNT_Msk | FMI_EMMCCTL_DBW_Msk)); - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | (0x09 << FMI_EMMCCTL_SDNWR_Pos) | (0x01 << FMI_EMMCCTL_BLKCNT_Pos)); - - if (eMMC_Init(&eMMC) < 0) - return; - - /* divider */ - if ((eMMC.CardType == EMMC_TYPE_MMC) || (eMMC.CardType == EMMC_TYPE_EMMC)) - eMMC_Set_clock(MMC_FREQ); - else - eMMC_Set_clock(SD_FREQ); - - eMMC_Get_info(&eMMC); - - if (eMMC_SelectCardType(&eMMC)) - return; - - emmc_ok = 1; -} - -/** - * @brief This function use to read data from eMMC card. - * - * @param[out] pu8BufAddr The buffer to receive the data from eMMC card. - * @param[in] u32StartSec The start read sector address. - * @param[in] u32SecCount The the read sector number of data - * - * @return None - */ -unsigned int eMMC_Read(unsigned char *pu8BufAddr, unsigned int u32StartSec, unsigned int u32SecCount) -{ - char volatile bIsSendCmd = FALSE; - unsigned int volatile reg; - int volatile i, loop, status; - unsigned int blksize = FMI_BLOCK_SIZE; - - EMMC_INFO_T *pSD; - pSD = &eMMC; - - //--- check input parameters - if (u32SecCount == 0) - return EMMC_SELECT_ERROR; - - if ((status = eMMC_CmdAndRsp(pSD, 7, pSD->RCA, 0)) != 0) - return status; - eMMC_CheckRB(); - - outpw(REG_FMI_EMMCBLEN, blksize - 1); // the actual byte count is equal to (BLEN+1) - - if ((pSD->CardType == EMMC_TYPE_SD_HIGH) || (pSD->CardType == EMMC_TYPE_EMMC)) - outpw(REG_FMI_EMMCCMD, u32StartSec); - else - outpw(REG_FMI_EMMCCMD, u32StartSec * blksize); - - outpw(REG_FMI_DMASA, (unsigned int)pu8BufAddr); - - loop = u32SecCount / 255; - for (i = 0; i < loop; i++) - { - _fmi_eMMCDataReady = FALSE; - - reg = inpw(REG_FMI_EMMCCTL) & ~FMI_EMMCCTL_CMDCODE_Msk; - reg = reg | 0xff0000; - if (bIsSendCmd == FALSE) - { - outpw(REG_FMI_EMMCCTL, reg | (18 << 8) | (FMI_EMMCCTL_COEN_Msk | FMI_EMMCCTL_RIEN_Msk | FMI_EMMCCTL_DIEN_Msk)); - bIsSendCmd = TRUE; - } - else - outpw(REG_FMI_EMMCCTL, reg | FMI_EMMCCTL_DIEN_Msk); - - while (!_fmi_eMMCDataReady) - { -// if ((inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_BLKDIF_Msk) && (!(inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_DIEN_Msk))) { -// outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_BLKDIF_Msk); -// break; -// } - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - - if (!(inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC7_Msk)) // check CRC7 - { - return EMMC_CRC7_ERROR; - } - - if (!(inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC16_Msk)) // check CRC16 - { - return EMMC_CRC16_ERROR; - } - } - - loop = u32SecCount % 255; - if (loop != 0) - { - _fmi_eMMCDataReady = FALSE; - - reg = inpw(REG_FMI_EMMCCTL) & (~FMI_EMMCCTL_CMDCODE_Msk); - reg = reg & (~FMI_EMMCCTL_BLKCNT_Msk); - reg |= (loop << 16); - - if (bIsSendCmd == FALSE) - { - outpw(REG_FMI_EMMCCTL, reg | (18 << 8) | (FMI_EMMCCTL_COEN_Msk | FMI_EMMCCTL_RIEN_Msk | FMI_EMMCCTL_DIEN_Msk)); - bIsSendCmd = TRUE; - } - else - outpw(REG_FMI_EMMCCTL, reg | FMI_EMMCCTL_DIEN_Msk); - - while (!_fmi_eMMCDataReady) - { -// if ((inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_BLKDIF_Msk) && (!(inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_DIEN_Msk))) { -// outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_BLKDIF_Msk); -// break; -// } - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - - if (!(inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC7_Msk)) // check CRC7 - { - return EMMC_CRC7_ERROR; - } - - if (!(inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRC16_Msk)) // check CRC16 - { - return EMMC_CRC16_ERROR; - } - } - - if (eMMC_CmdAndRsp(pSD, 12, 0, 0)) // stop command - { - //sysprintf("stop command fail !!\n"); - return EMMC_CRC7_ERROR; - } - eMMC_CheckRB(); - - eMMC_Command(pSD, 7, 0); - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CLK8OEN_Msk); - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CLK8OEN_Msk); - - return 0; -} - - -/** - * @brief This function use to write data to eMMC card. - * - * @param[in] pu8BufAddr The buffer to send the data to SD card. - * @param[in] u32StartSec The start write sector address. - * @param[in] u32SecCount The the write sector number of data. - * - * @return - \ref EMMC_SELECT_ERROR u32SecCount is zero. - * - \ref EMMC_NO_CARD SD card be removed. - * - \ref EMMC_CRC_ERROR CRC error happen. - * - \ref EMMC_CRC7_ERROR CRC7 error happen. - * - \ref Successful Write data to eMMC card success. - */ -unsigned int eMMC_Write(unsigned char *pu8BufAddr, unsigned int u32StartSec, unsigned int u32SecCount) -{ - char volatile bIsSendCmd = FALSE; - unsigned int volatile reg; - int volatile i, loop, status; - - EMMC_INFO_T *pSD; - pSD = &eMMC; - - //--- check input parameters - if (u32SecCount == 0) - return EMMC_SELECT_ERROR; - - if ((status = eMMC_CmdAndRsp(pSD, 7, pSD->RCA, 0)) != 0) - return status; - - eMMC_CheckRB(); - - // According to SD Spec v2.0/ eMMC v4.4, the write CMD block size MUST be 512, and the start address MUST be 512*n. - outpw(REG_FMI_EMMCBLEN, FMI_BLOCK_SIZE - 1); // set the block size - - if ((pSD->CardType == EMMC_TYPE_SD_HIGH) || (pSD->CardType == EMMC_TYPE_EMMC)) - outpw(REG_FMI_EMMCCMD, u32StartSec); - else - outpw(REG_FMI_EMMCCMD, u32StartSec * FMI_BLOCK_SIZE); // set start address for CMD - - outpw(REG_FMI_DMASA, (unsigned int)pu8BufAddr); - loop = u32SecCount / 255; // the maximum block count is 0xFF=255 - for (i = 0; i < loop; i++) - { - _fmi_eMMCDataReady = FALSE; - - reg = inpw(REG_FMI_EMMCCTL) & 0xff00c080; - reg = reg | 0xff0000; - if (!bIsSendCmd) - { - outpw(REG_FMI_EMMCCTL, reg | (25 << 8) | (FMI_EMMCCTL_COEN_Msk | FMI_EMMCCTL_RIEN_Msk | FMI_EMMCCTL_DOEN_Msk)); - bIsSendCmd = TRUE; - } - else - outpw(REG_FMI_EMMCCTL, reg | FMI_EMMCCTL_DOEN_Msk); - - while (!_fmi_eMMCDataReady) - { -// if ((inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_BLKDIF_Msk) && (!(inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_DOEN_Msk))) { -// outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_BLKDIF_Msk); -// break; -// } - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - - if ((inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRCIF_Msk) != 0) // check CRC - { - outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_CRCIF_Msk); - return EMMC_CRC_ERROR; - } - } - - loop = u32SecCount % 255; - if (loop != 0) - { - _fmi_eMMCDataReady = FALSE; - - reg = (inpw(REG_FMI_EMMCCTL) & 0xff00c080) | (loop << 16); - if (!bIsSendCmd) - { - outpw(REG_FMI_EMMCCTL, reg | (25 << 8) | (FMI_EMMCCTL_COEN_Msk | FMI_EMMCCTL_RIEN_Msk | FMI_EMMCCTL_DOEN_Msk)); - bIsSendCmd = TRUE; - } - else - outpw(REG_FMI_EMMCCTL, reg | FMI_EMMCCTL_DOEN_Msk); - - while (!_fmi_eMMCDataReady) - { -// if ((inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_BLKDIF_Msk) && (!(inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_DOEN_Msk))) { -// outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_BLKDIF_Msk); -// break; -// } - if (pSD->IsCardInsert == FALSE) - return EMMC_NO_CARD; - } - - if ((inpw(REG_FMI_EMMCINTSTS) & FMI_EMMCINTSTS_CRCIF_Msk) != 0) // check CRC - { - outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_CRCIF_Msk); - return EMMC_CRC_ERROR; - } - } - outpw(REG_FMI_EMMCINTSTS, FMI_EMMCINTSTS_CRCIF_Msk); - - if (eMMC_CmdAndRsp(pSD, 12, 0, 0)) // stop command - { - return EMMC_CRC7_ERROR; - } - eMMC_CheckRB(); - - eMMC_Command(pSD, 7, 0); - outpw(REG_FMI_EMMCCTL, inpw(REG_FMI_EMMCCTL) | FMI_EMMCCTL_CLK8OEN_Msk); - while (inpw(REG_FMI_EMMCCTL) & FMI_EMMCCTL_CLK8OEN_Msk); - - return 0; -} - - -/*@}*/ /* end of group N9H30_FMI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_FMI_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_gpio.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_gpio.c deleted file mode 100644 index 3d4fd76105c..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_gpio.c +++ /dev/null @@ -1,500 +0,0 @@ -/**************************************************************************//** -* @file gpio.c -* @version V1.00 -* @brief N9H30 GPIO driver source file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_gpio.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup N9H30_GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Set GPIO Port - * - * @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ - * @param[in] bitMap GPIO port. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 - * - * @retval <0 Fail - * @retval 0 Success - * - * @details This function is used to set GPIO port output data. - */ -INT32 GPIO_Set(GPIO_PORT port, UINT32 bitMap) -{ - INT32 offset; - INT32 reg; - - offset = (INT32)port; - - reg = inpw(REG_GPIOA_DATAOUT + offset); - reg = reg | bitMap; - outpw(REG_GPIOA_DATAOUT + offset, reg); - - return SUCCESSFUL; -} - -/** -* @brief Clear GPIO port OUT Data -* -* @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ -* @param[in] bitMap GPIO port data. It could be 0x00 ~ 0xFF. -* -* @retval <0 Fail -* @retval 0 Success -* -* @details Clear GPIO port output data to 0. -*/ -INT32 GPIO_Clr(GPIO_PORT port, UINT32 bitMap) -{ - INT32 offset; - INT32 reg; - - offset = (INT32)port; - - reg = inpw(REG_GPIOA_DATAOUT + offset); - reg = reg & (~bitMap); - outpw(REG_GPIOA_DATAOUT + offset, reg); - - return SUCCESSFUL; -} - - - -/** - * @brief Open GPIO bit - * - * @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ - * @param[in] bit GPIO pin. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 - * @param[in] direction GPIO direction. It could be \ref DIR_INPUT or \ref DIR_OUTPUT - * @param[in] pull GPIO pull-up. It could be \ref NO_PULL_UP or \ref PULL_UP - * - * @retval <0 Fail - * @retval 0 Success - * - * @details This function is used to open gpio pin. - */ -INT32 GPIO_OpenBit(GPIO_PORT port, UINT32 bit, GPIO_DIR direction, GPIO_PULL pull) -{ - UINT32 reg; - UINT32 mask; - INT32 offset; - - offset = (INT32)port; - - mask = (UINT32)bit; - - reg = inpw(REG_GPIOA_DIR + offset); - reg = reg & (~mask); - - if (direction == DIR_OUTPUT) - { - reg = reg | mask; - } - - outpw(REG_GPIOA_DIR + offset, reg); - - reg = inpw(REG_GPIOA_PUEN + offset); - reg = reg & (~mask); - - if (pull == PULL_UP) - { - reg = reg | mask; - outpw(REG_GPIOA_PUEN + offset, reg); - } - else if (pull == PULL_DOWN) - { - reg = reg | mask; - outpw(REG_GPIOA_PDEN + offset, reg); - } - else - { - outpw(REG_GPIOA_PUEN + offset, reg); - outpw(REG_GPIOA_PDEN + offset, reg); - } - - return SUCCESSFUL; -} - -/** -* @brief Set GPIO pin OUT Data -* -* @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ -* @param[in] bit GPIO pin. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 -* -* @retval <0 Fail -* @retval 0 Success -* -* @details Set the Data into specified GPIO pin. -*/ -INT32 GPIO_CloseBit(GPIO_PORT port, UINT32 bit) -{ - UINT32 reg; - UINT32 mask; - INT32 offset; - - offset = (INT32)port; - mask = (UINT32)bit; - - reg = inpw(REG_GPIOA_DIR + offset); - reg = reg & (~mask); - outpw(REG_GPIOA_DIR + offset, reg); - - reg = inpw(REG_GPIOA_PUEN + offset); - reg = reg & (~mask); - outpw(REG_GPIOA_PUEN + offset, reg); - - return SUCCESSFUL; -} - - -/** - * @brief Set GPIO pin OUT Data - * - * @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ - * @param[in] bit GPIO pin. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 - * - * @retval <0 Fail - * @retval 0 Success - * - * @details Set the Data into specified GPIO pin. - */ -INT32 GPIO_SetBit(GPIO_PORT port, UINT32 bit) -{ - UINT32 bitMap; - INT32 offset; - INT32 reg; - - offset = (INT32)port; - bitMap = (UINT32)bit; - - reg = inpw(REG_GPIOA_DATAOUT + offset); - reg = reg | bitMap; - outpw(REG_GPIOA_DATAOUT + offset, reg); - - return SUCCESSFUL; -} - -/** -* @brief Clear GPIO port Interrupt Flag -* -* @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ -* @param[in] bitMap GPIO port data. It could be 0x00 ~ 0xFF. -* -* @retval <0 Fail -* @retval 0 Success -* -* @details Clear the interrupt status of specified GPIO port. -*/ -INT32 GPIO_ClrISR(GPIO_PORT port, UINT32 bitMap) -{ - INT32 offset; - - offset = (INT32)port; - - outpw(REG_GPIOA_ISR + offset, bitMap); - - return SUCCESSFUL; -} - -/** - * @brief Clear GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ - * @param[in] bit GPIO pin. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 - * - * @retval <0 Fail - * @retval 0 Success - * - * @details Clear the interrupt status of specified GPIO pin. - */ -INT32 GPIO_ClrISRBit(GPIO_PORT port, UINT32 bit) -{ - UINT32 bitMap; - INT32 offset; - - offset = (INT32)port; - bitMap = (UINT32)bit; - - outpw(REG_GPIOA_ISR + offset, bitMap); - - return SUCCESSFUL; -} - -/** -* @brief Clear GPIO pin OUT Data -* -* @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ -* @param[in] bit GPIO pin. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 -* -* @retval <0 Fail -* @retval 0 Success -* -* @details Set the Data into specified GPIO pin. -*/ -INT32 GPIO_ClrBit(GPIO_PORT port, UINT32 bit) -{ - UINT32 bitMap; - INT32 offset; - INT32 reg; - - offset = (INT32)port; - bitMap = (UINT32)bit; - - reg = inpw(REG_GPIOA_DATAOUT + offset); - reg = reg & (~bitMap); - outpw(REG_GPIOA_DATAOUT + offset, reg); - - return SUCCESSFUL; -} - -/** -* @brief Read GPIO pin In Data -* -* @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ -* @param[in] bit GPIO pin. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 -* -* @retval 1/0 GPIO pin input data. -* -* @details Read the In Data from GPIO pin. -*/ -INT32 GPIO_ReadBit(GPIO_PORT port, UINT32 bit) -{ - UINT32 reg; - UINT32 bitMap; - INT32 offset; - - offset = (INT32)port; - bitMap = (UINT32)bit; - - reg = inpw(REG_GPIOA_DATAIN + offset); - - return ((reg & bitMap) ? 1 : 0); -} - -/** -* @brief Set GPIO pin direction -* -* @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ -* @param[in] bit GPIO pin. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 -* @param[in] direction GPIO direction. It could be \ref DIR_INPUT, \ref DIR_OUTPUT. -* -* @retval <0 Fail -* @retval 0 Success -* -* @details Set the GPIO direction into specified GPIO pin. -*/ -INT32 GPIO_SetBitDir(GPIO_PORT port, UINT32 bit, GPIO_DIR direction) -{ - UINT32 reg; - UINT32 bitMap; - INT32 offset; - - offset = (INT32)port; - bitMap = (UINT32)bit; - - reg = inpw(REG_GPIOA_DIR + offset); - reg = reg & (~bitMap); - - if (direction == DIR_OUTPUT) - { - reg = reg | bitMap; - } - - outpw(REG_GPIOA_DIR + offset, reg); - - return SUCCESSFUL; -} - -/** - * @brief Enable GPIO trigger type. - * - * @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ - * @param[in] bitMap GPIO port. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 - * @param[in] triggerType The triggerType of specified GPIO pin. It could be \n - * \ref RISING, \ref FALLING, \ref BOTH_EDGE, \ref HIGH, \ref LOW. - * - * @retval <0 Fail - * @retval 0 Success - * - * @details This function is used to enable trigger type. - */ -INT32 GPIO_EnableTriggerType(GPIO_PORT port, UINT32 bitMap, GPIO_TRIGGER_TYPE triggerType) -{ - UINT32 reg; - INT32 offset; - - offset = (INT32)port; - - switch (triggerType) - { - case LOW: - reg = inpw(REG_GPIOA_IMD + offset); - outpw(REG_GPIOA_IMD + offset, reg | bitMap); - - reg = inpw(REG_GPIOA_IREN + offset); - outpw(REG_GPIOA_IREN + offset, reg & ~bitMap); - - reg = inpw(REG_GPIOA_IFEN + offset); - outpw(REG_GPIOA_IFEN + offset, reg | bitMap); - break; - case HIGH: - reg = inpw(REG_GPIOA_IMD + offset); - outpw(REG_GPIOA_IMD + offset, reg | bitMap); - - reg = inpw(REG_GPIOA_IREN + offset); - outpw(REG_GPIOA_IREN + offset, reg | bitMap); - - reg = inpw(REG_GPIOA_IFEN + offset); - outpw(REG_GPIOA_IFEN + offset, reg & ~bitMap); - break; - case FALLING: - reg = inpw(REG_GPIOA_IMD + offset); - outpw(REG_GPIOA_IMD + offset, reg & ~bitMap); - - reg = inpw(REG_GPIOA_IREN + offset); - outpw(REG_GPIOA_IREN + offset, reg & ~bitMap); - - reg = inpw(REG_GPIOA_IFEN + offset); - outpw(REG_GPIOA_IFEN + offset, reg | bitMap); - break; - case RISING: - reg = inpw(REG_GPIOA_IMD + offset); - outpw(REG_GPIOA_IMD + offset, reg & ~bitMap); - - reg = inpw(REG_GPIOA_IREN + offset); - outpw(REG_GPIOA_IREN + offset, reg | bitMap); - - reg = inpw(REG_GPIOA_IFEN + offset); - outpw(REG_GPIOA_IFEN + offset, reg & ~bitMap); - break; - case BOTH_EDGE: - reg = inpw(REG_GPIOA_IMD + offset); - outpw(REG_GPIOA_IMD + offset, reg & ~bitMap); - - reg = inpw(REG_GPIOA_IREN + offset); - outpw(REG_GPIOA_IREN + offset, reg | bitMap); - - reg = inpw(REG_GPIOA_IFEN + offset); - outpw(REG_GPIOA_IFEN + offset, reg | bitMap); - break; - } - return SUCCESSFUL; -} - -/** - * @brief Disable GPIO trigger type. - * - * @param[in] port GPIO port. It could be \ref GPIOA, \ref GPIOB, ... or \ref GPIOJ - * @param[in] bitMap GPIO port. It could be \ref BIT0 \ref BIT1, ... or \ref BIT31 - * - * @retval <0 Fail - * @retval 0 Success - * - * @details This function is used to disable trigger type. - */ -INT32 GPIO_DisableTriggerType(GPIO_PORT port, UINT32 bitMap) -{ - UINT32 reg; - INT32 offset; - - offset = (INT32)port; - - reg = inpw(REG_GPIOA_IMD + offset); - outpw(REG_GPIOA_IMD + offset, reg & ~bitMap); - - reg = inpw(REG_GPIOA_IREN + offset); - outpw(REG_GPIOA_IREN + offset, reg & ~bitMap); - - reg = inpw(REG_GPIOA_IFEN + offset); - outpw(REG_GPIOA_IFEN + offset, reg & ~bitMap); - - return SUCCESSFUL; -} - -/** - * @brief Enable GPIO De-bounce Function - * - * @param[in] debounceClkSel The de-bounce sampling cycle selection. It could be 0~0xF. \n - * 0 = Sample interrupt input once per 1 clocks. \n - * 1 = Sample interrupt input once per 2 clocks. \n - * 2 = Sample interrupt input once per 4 clocks. \n - * 3 = Sample interrupt input once per 8 clocks. \n - * 4 = Sample interrupt input once per 16 clocks. \n - * 5 = Sample interrupt input once per 32 clocks. \n - * 6 = Sample interrupt input once per 64 clocks. \n - * 7 = Sample interrupt input once per 128 clocks. \n - * 8 = Sample interrupt input once per 256 clocks. \n - * 9 = Sample interrupt input once per 2*256 clocks. \n - * 10 = Sample interrupt input once per 4*256 clocks. \n - * 11 = Sample interrupt input once per 8*256 clocks. \n - * 12 = Sample interrupt input once per 16*256 clocks. \n - * 13 = Sample interrupt input once per 32*256 clocks. \n - * 14 = Sample interrupt input once per 64*256 clocks. \n - * 15 = Sample interrupt input once per 128*256 clocks - * - * @retval <0 Fail - * @retval 0 Success - * - * @details Enable the interrupt de-bounce function of specified GPIO. - */ -INT32 GPIO_EnableDebounce(INT32 debounceClkSel) -{ - UINT32 reg; - - reg = inpw(REG_GPIO_DBNCECON); - - /* Setting the debounce timing */ - reg = ((reg & ~0xf) | debounceClkSel); - - /* Enable the debounce function */ - reg = reg | 0x20; - outpw(REG_GPIO_DBNCECON, reg); - - return SUCCESSFUL; -} - -/** - * @brief Disable GPIO De-bounce Function. - * - * @retval <0 Fail - * @retval 0 Success - * - * @details Disable the interrupt de-bounce function of specified GPIO. - */ -INT32 GPIO_DisableDebounce(void) -{ - UINT32 reg; - - reg = inpw(REG_GPIO_DBNCECON); - - /* Setting the debounce timing */ - reg = ((reg & ~0xf)); - - /* Enable the debounce function */ - reg = reg | 0x20; - outpw(REG_GPIO_DBNCECON, reg); - - return SUCCESSFUL; -} - -/*@}*/ /* end of group N9H30_GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_GPIO_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_i2s.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_i2s.c deleted file mode 100644 index f5387035260..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_i2s.c +++ /dev/null @@ -1,461 +0,0 @@ -/**************************************************************************//** -* @file i2s.c -* @brief N9H30 I2S driver source file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include - -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_i2s.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup N9H30_I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ - -/// @cond HIDDEN_SYMBOLS - -typedef uint32_t (AU_CB_FUNC_T)(uint32_t); - -static AU_CB_FUNC_T *g_fnPlayCallBack; -static AU_CB_FUNC_T *g_fnRecCallBack; -static uint8_t i2sOpened = 0; - -/// @endcond /* HIDDEN_SYMBOLS */ - -/*@}*/ /* end of group N9H30_I2S_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -/// @cond HIDDEN_SYMBOLS -/** - * @brief Start to play - * @param None - * @return None - */ -static void i2sStartPlay(void) -{ - /* start playing */ - //sysprintf("IIS start playing...\n"); - - outpw(REG_ACTL_PSR, 0x1); - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) | (1 << 5)); -} - -/** - * @brief Stop to play - * @param None - * @return None - */ -static void i2sStopPlay(void) -{ - //sysprintf("IIS stop playing\n"); - - /* stop playing */ - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~(1 << 5)); -} - -/** - * @brief Start to record - * @param None - * @return None - */ -static void i2sStartRecord(void) -{ - /* start recording */ - //sysprintf("IIS start recording...\n"); - - outpw(REG_ACTL_RSR, 0x1); - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) | (1 << 6)); -} - -/** - * @brief Stop to record - * @param None - * @return None - */ -static void i2sStopRecord(void) -{ - //sysprintf("I2S stop recording\n"); - - /* stop recording */ - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~(1 << 6)); -} - -/** - * @brief Delay function - * @param None - * @return None - */ -static void Delay(int nCnt) -{ - int volatile loop; - for (loop = 0; loop < nCnt * 10; loop++); -} - -/** - * @brief Interrupt service routine for i2s - * @param None - * @return None - */ -static void i2sISR(void) -{ - uint8_t u8SN; - - if (inpw(REG_ACTL_CON) & (1 << 10)) - { - outpw(REG_ACTL_CON, inpw(REG_ACTL_CON) | (1 << 10)); //Clear TX INT - - if (inpw(REG_ACTL_PSR) & (1 << 4)) - { - outpw(REG_ACTL_PSR, (1 << 4)); - //sysprintf("\ndebug:DMA_COUNTER_IRQ occur"); - } - - if (inpw(REG_ACTL_PSR) & (1 << 3)) - { - outpw(REG_ACTL_PSR, (1 << 3)); - //sysprintf("\ndebug:DMA_DATA_ZERO_IRQ occur"); - } - - if (inpw(REG_ACTL_PSR) & 0x1) - { - outpw(REG_ACTL_PSR, 0x1); - u8SN = (inpw(REG_ACTL_PSR) >> 5) & 0x7; - g_fnPlayCallBack(u8SN); - } - } - - if (inpw(REG_ACTL_CON) & (1 << 11)) - { - outpw(REG_ACTL_CON, inpw(REG_ACTL_CON) | (1 << 11)); //Clear RX INT - - if (inpw(REG_ACTL_RSR) & 0x1) - { - outpw(REG_ACTL_RSR, 0x1); - u8SN = (inpw(REG_ACTL_RSR) >> 5) & 0x7; - g_fnRecCallBack(u8SN); - } - } -} -/// @endcond /* HIDDEN_SYMBOLS */ - -/** - * @brief Open i2s interface - * @return open status - * @retval I2S_ERR_BUSY error. - * @retval 0 success. - */ -int32_t i2sOpen(void) -{ - if (i2sOpened) - return I2S_ERR_BUSY; - - /* reset audio interface */ - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) | (1 << 16)); - Delay(100); - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~(1 << 16)); - Delay(100); - - /* reset IIS interface */ - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) | 0x1); - Delay(100); - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~0x1); - Delay(100); - - outpw(REG_ACTL_CON, inpw(REG_ACTL_CON) | (1 << 21) | (1 << 20)); - - i2sOpened = 1; - - return 0; -} - -/** - * @brief Close i2s interface - * @return None - */ -void i2sClose(void) -{ - // reset some variables - i2sOpened = 0; - g_fnPlayCallBack = NULL; - g_fnRecCallBack = NULL; - - // reset i2s interface - outpw(REG_SYS_AHBIPRST, inpw(REG_SYS_AHBIPRST) | (1 << 8)); - outpw(REG_SYS_AHBIPRST, inpw(REG_SYS_AHBIPRST) & ~(1 << 8)); -} - -/** - * @brief Initialize i2s interface and setup interrupt - * @return None - */ -void i2sInit(void) -{ - // enable i2s engine clock - outpw(REG_CLK_HCLKEN, inpw(REG_CLK_HCLKEN) | (1 << 24)); - - // enable interrupt and set ISR - sysSetInterruptType(ACTL_IRQn, HIGH_LEVEL_SENSITIVE); - sysInstallISR(IRQ_LEVEL_1, ACTL_IRQn, (PVOID)i2sISR); - sysEnableInterrupt(ACTL_IRQn); - sysSetLocalInterrupt(ENABLE_IRQ); -} - -/** - * @brief IO control for i2s interface - * @param[in] cmd Command for io control, value could be - * - \ref I2S_SET_PLAY - * - \ref I2S_SET_RECORD - * - \ref I2S_SELECT_BLOCK - * - \ref I2S_SELECT_BIT - * - \ref I2S_SET_PLAY_DMA_INT_SEL - * - \ref I2S_SET_REC_DMA_INT_SEL - * - \ref I2S_SET_ZEROCROSS - * - \ref I2S_SET_DMACOUNTER - * - \ref I2S_SET_CHANNEL - * - \ref I2S_SET_MODE - * - \ref I2S_SET_SPLITDATA - * - \ref I2S_SET_DMA_ADDRESS - * - \ref I2S_SET_DMA_LENGTH - * - \ref I2S_GET_DMA_CUR_ADDRESS - * - \ref I2S_SET_I2S_FORMAT - * - \ref I2S_SET_I2S_CALLBACKFUN - * - \ref I2S_SET_PCMSLOT - * @param[in] arg0 argument 0 for io control - * @param[in] arg1 argument 1 for io control - * @retval I2S_ERR_IO Command error. - * @retval 0 success. - */ -int32_t i2sIoctl(uint32_t cmd, uint32_t arg0, uint32_t arg1) -{ - uint32_t *buf; - AU_CB_FUNC_T *ptr; - - switch (cmd) - { - // #define I2S_START_PLAY 0 - // #define I2S_STOP_PLAY 1 - case I2S_SET_PLAY: - if (arg0 == I2S_START_PLAY) - i2sStartPlay(); - else - i2sStopPlay(); - break; - // #define I2S_START_REC 0 - // #define I2S_STOP_REC 1 - case I2S_SET_RECORD: - if (arg0 == I2S_START_REC) - i2sStartRecord(); - else - i2sStopRecord(); - break; - // #define I2S_BLOCK_I2S 0 - // #define I2S_BLOCK_PCM 1 - case I2S_SELECT_BLOCK: - if (arg0 == I2S_BLOCK_I2S) - outpw(REG_ACTL_CON, (inpw(REG_ACTL_CON) & ~0x3) | 0x1); - else - outpw(REG_ACTL_CON, (inpw(REG_ACTL_CON) & ~0x3) | 0x2); - break; - // #define I2S_BIT_WIDTH_8 0 - // #define I2S_BIT_WIDTH_16 1 - // #define I2S_BIT_WIDTH_24 2 - case I2S_SELECT_BIT: - outpw(REG_ACTL_CON, (inpw(REG_ACTL_CON) & ~0x300) | (arg0 << 8)); - break; - // #define I2S_DMA_INT_END 0 - // #define I2S_DMA_INT_HALF 1 - // #define I2S_DMA_INT_QUARTER 2 - // #define I2S_DMA_INT_EIGTH 3 - case I2S_SET_PLAY_DMA_INT_SEL: - outpw(REG_ACTL_CON, (inpw(REG_ACTL_CON) & ~0x3000) | (arg0 << 12)); - break; - - case I2S_SET_REC_DMA_INT_SEL: - outpw(REG_ACTL_CON, (inpw(REG_ACTL_CON) & ~0xc000) | (arg0 << 14)); - break; - - case I2S_SET_ZEROCROSS: - if (arg0 == I2S_ENABLE) - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) | 0x8); - else - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~0x8); - break; - - case I2S_SET_DMACOUNTER: - if (arg0 == I2S_ENABLE) - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) | 0x10); - else - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~0x10); - break; - // #define I2S_CHANNEL_I2S_ONE 2 - // #define I2S_CHANNEL_I2S_TWO 3 - // #define I2S_CHANNEL_PCM_TWO 3 - // #define I2S_CHANNEL_PCM_TWO_SLOT1 0 - // #define I2S_CHANNEL_PCM_TWO_SLOT0 1 - // #define I2S_CHANNEL_PCM_ONE_SLOT0 2 - case I2S_SET_CHANNEL: - if (arg0 == I2S_PLAY) - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~(0x3 << 12) | (arg1 << 12)); - else - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~(0x3 << 14) | (arg1 << 14)); - break; - // #define I2S_MODE_MASTER 0 - // #define I2S_MODE_SLAVE 1 - case I2S_SET_MODE: - if (arg0 == I2S_MODE_MASTER) - outpw(REG_ACTL_I2SCON, inpw(REG_ACTL_I2SCON) & ~(0x1 << 20)); - else - outpw(REG_ACTL_I2SCON, inpw(REG_ACTL_I2SCON) | (0x1 << 20)); - break; - - case I2S_SET_SPLITDATA: - if (arg0 == I2S_ENABLE) - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) | (0x1 << 20)); - else - outpw(REG_ACTL_RESET, inpw(REG_ACTL_RESET) & ~(0x1 << 20)); - break; - - case I2S_SET_DMA_ADDRESS: - if (arg0 == I2S_PLAY) - outpw(REG_ACTL_PDESB, arg1 | 0x80000000); - else if (arg0 == I2S_REC) - outpw(REG_ACTL_RDESB, arg1 | 0x80000000); - else if (arg0 == PCM_PLAY) - outpw(REG_ACTL_PDESB2, arg1 | 0x80000000); - else - outpw(REG_ACTL_RDESB2, arg1 | 0x80000000); - break; - - case I2S_SET_DMA_LENGTH: - if (arg0 == I2S_PLAY) - outpw(REG_ACTL_PDES_LENGTH, arg1); - else - outpw(REG_ACTL_RDES_LENGTH, arg1); - break; - - case I2S_GET_DMA_CUR_ADDRESS: - buf = (uint32_t *)arg0; - if (arg0 == I2S_PLAY) - *buf = inpw(REG_ACTL_PDESC); - else - *buf = inpw(REG_ACTL_RDESC); - break; - - // #define I2S_FORMAT_I2S 0 - // #define I2S_FORMAT_MSB 1 - case I2S_SET_I2S_FORMAT: - if (arg0 == I2S_FORMAT_I2S) - outpw(REG_ACTL_I2SCON, inpw(REG_ACTL_I2SCON) & ~ 0x8); - else - outpw(REG_ACTL_I2SCON, inpw(REG_ACTL_I2SCON) | 0x8); - break; - - case I2S_SET_I2S_CALLBACKFUN: - ptr = (AU_CB_FUNC_T *)arg1; - if (arg0 == I2S_PLAY) - g_fnPlayCallBack = ptr; - else - g_fnRecCallBack = ptr; - break; - // #define PCM_SLOT1_IN 0 - // #define PCM_SLOT1_OUT 1 - // #define PCM_SLOT2_IN 2 - // #define PCM_SLOT2_OUT 3 - case I2S_SET_PCMSLOT: - if (arg0 == PCM_SLOT1_IN) - outpw(REG_ACTL_PCMS1ST, (inpw(REG_ACTL_PCMS1ST) & ~0x3ff) | (arg1 & 0x3ff)); - else if (arg0 == PCM_SLOT1_OUT) - outpw(REG_ACTL_PCMS1ST, (inpw(REG_ACTL_PCMS1ST) & ~0x3ff0000) | ((arg1 & 0x3ff) << 16)); - else if (arg0 == PCM_SLOT2_IN) - outpw(REG_ACTL_PCMS2ST, (inpw(REG_ACTL_PCMS2ST) & ~0x3ff) | (arg1 & 0x3ff)); - else - outpw(REG_ACTL_PCMS2ST, (inpw(REG_ACTL_PCMS2ST) & ~0x3ff0000) | ((arg1 & 0x3ff) << 16)); - break; - - case I2S_SET_PCM_FS_PERIOD: - outpw(REG_ACTL_PCMCON, (inpw(REG_ACTL_PCMCON) & ~0x03FF0000 | (((arg0 - 1) & 0x3ff) << 16))); - break; - - default: - return I2S_ERR_IO; - } - return 0; -} - -/** - * @brief Configure sampling rate for audio - * @param[in] u32SourceClockRate source speed to i2s interface - * @param[in] u32SampleRate sampling rate - * @param[in] u32DataBit data width - * @param[in] u32Channel channel number - * @return None - */ -void i2sSetSampleRate(uint32_t u32SourceClockRate, uint32_t u32SampleRate, uint32_t u32DataBit, uint32_t u32Channel) -{ - uint32_t u32BCLKDiv; - uint32_t u32MCLK, u32MCLKDiv; - - u32MCLK = (u32SampleRate * 256); - u32MCLKDiv = u32SourceClockRate / u32MCLK; - outpw(REG_ACTL_I2SCON, (inpw(REG_ACTL_I2SCON) & ~0x000F0000) | (u32MCLKDiv - 1) << 16); - - u32BCLKDiv = u32MCLK / (u32SampleRate * u32DataBit * u32Channel); - u32BCLKDiv = u32BCLKDiv / 2 - 1; - outpw(REG_ACTL_I2SCON, (inpw(REG_ACTL_I2SCON) & ~0xF0) | u32BCLKDiv << 5); -} - -/** - * @brief Configure MCLK frequency (master mode) - * @param[in] u32SourceClockRate source clock rate - * @param[in] u32SampleRate sampling rate - * @return None - */ -void i2sSetMCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32SampleRate) -{ - uint32_t u32MCLK, u32MCLKDiv; - - u32MCLK = (u32SampleRate * 256); - u32MCLKDiv = u32SourceClockRate / u32MCLK; - outpw(REG_ACTL_I2SCON, (inpw(REG_ACTL_I2SCON) & ~0x000F0000) | (u32MCLKDiv - 1) << 16); -} - -/** - * @brief Configure PCM BCLK frequency (master mode) - * @param[in] u32SourceClockRate source clock rate - * @param[in] u32Rate target rate - * @return None - */ -void i2sSetPCMBCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32Rate) -{ - uint32_t u32BCLKDiv; - - u32BCLKDiv = (u32SourceClockRate / (2 * u32Rate)) - 1; - outpw(REG_ACTL_PCMCON, (inpw(REG_ACTL_PCMCON) & ~0x0000FF00) | (u32BCLKDiv << 8)); -} - - -/*@}*/ /* end of group N9H30_I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_I2S_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_lcd.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_lcd.c deleted file mode 100644 index 82887e427fc..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_lcd.c +++ /dev/null @@ -1,959 +0,0 @@ -/**************************************************************************//** -* @file lcd.c -* @brief N9H30 LCD driver source file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include -#include - -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_lcd.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_LCD_Driver LCD Driver - @{ -*/ - -/** @addtogroup N9H30_LCD_EXPORTED_CONSTANTS LCD Exported Constants - @{ -*/ - -/// @cond HIDDEN_SYMBOLS - -/* LCD attributes */ -static VPOST_T DEF_E50A2V1 = -{ - 800, /*!< Panel width */ - 480, /*!< Panel height */ - 0, /*!< MPU command line low indicator */ - 0, /*!< MPU command width */ - 0, /*!< MPU bus width */ - VPOSTB_DATA16or18, /*!< Display bus width */ - 0, /*!< MPU mode */ - VPOSTB_COLORTYPE_64K, /*!< Display colors */ - VPOSTB_DEVICE_SYNC_HIGHCOLOR, /*!< Type of display panel */ - 0x020d03a0, /*!< CRTCSIZE register value */ - 0x01e00320, /*!< CRTCDEND register value */ - 0x03250321, /*!< CRTCHR register value */ - 0x03780348, /*!< CRTCHSYNC register value */ - 0x01f001ed /*!< CRTCVR register value */ -}; - -static VPOST_T DEF_ILI9341_MPU80 = -{ - 240, /*!< Panel width */ - 320, /*!< Panel height */ - VPOSTB_CMDLOW, /*!< MPU command line low indicator */ - VPOSTB_CM16t18HIGH, /*!< MPU command width */ - VPOSTB_CMD8, /*!< MPU bus width */ - VPOSTB_DATA16or18, /*!< Display bus width */ - VPOSTB_MPU80, /*!< MPU mode */ - VPOSTB_COLORTYPE_64K, /*!< Display colors */ - VPOSTB_DEVICE_MPU, /*!< Type of display panel */ - 0x01600100, /*!< CRTCSIZE register value */ - 0x014000F0, /*!< CRTCDEND register value */ - 0x00FA00F5, /*!< CRTCHR register value */ - 0x00FC00FA, /*!< CRTCHSYNC register value */ - 0x01500145 /*!< CRTCVR register value */ -}; - -static VPOST_T DEF_LSA40AT9001 = -{ - 800, /*!< Panel width */ - 600, /*!< Panel height */ - 0, /*!< MPU command line low indicator */ - 0, /*!< MPU command width */ - 0, /*!< MPU bus width */ - VPOSTB_DATA16or18, /*!< Display bus width */ - 0, /*!< MPU mode */ - VPOSTB_COLORTYPE_64K, /*!< Display colors */ - VPOSTB_DEVICE_SYNC_HIGHCOLOR, /*!< Type of display panel */ - 0x02800425, /*!< CRTCSIZE register value */ - 0x02580320, /*!< CRTCDEND register value */ - 0x032F032A, /*!< CRTCHR register value */ - 0x0334032A, /*!< CRTCHSYNC register value */ - 0x026C0262 /*!< CRTCVR register value */ -}; - - -static VPOST_T DEF_FW070TFT = -{ - 800, /*!< Panel width */ - 480, /*!< Panel height */ - 0, /*!< MPU command line low indicator */ - 0, /*!< MPU command width */ - 0, /*!< MPU bus width */ - VPOSTB_DATA16or18, /*!< Display bus width */ - 0, /*!< MPU mode */ - VPOSTB_COLORTYPE_16M, /*!< Display colors */ - VPOSTB_DEVICE_SYNC_HIGHCOLOR, /*!< Type of display panel */ - 0x020d0420, /*!< CRTCSIZE register value */ - 0x01e00320, /*!< CRTCDEND register value */ - 0x033e0339, /*!< CRTCHR register value */ - 0x040c03f8, /*!< CRTCHSYNC register value */ - 0x020001f6 /*!< CRTCVR register value */ -}; - -#define FW043TFT_WIDTH 480 /*!< XRES */ -#define FW043TFT_HEIGHT 272 /*!< YRES */ -#define FW043TFT_MARGIN_LEFT 30 /*!< HBP (Horizontal Back Porch) */ -#define FW043TFT_MARGIN_RIGHT 5 /*!< HFP (Horizontal Front Porch) */ -#define FW043TFT_MARGIN_UPPER 2 /*!< VBP (Vertical Back Porch) */ -#define FW043TFT_MARGIN_LOWER 27 /*!< VFP (Vertical Front Porch) */ -#define FW043TFT_HSYNC_LEN 41 /*!< HPW (HSYNC plus width) */ -#define FW043TFT_VSYNC_LEN 10 /*!< VPW (VSYNC width) */ -static VPOST_T DEF_FW043TFT = -{ - FW043TFT_WIDTH, /*!< Panel width */ - FW043TFT_HEIGHT, /*!< Panel height */ - 0, /*!< MPU command line low indicator */ - 0, /*!< MPU command width */ - 0, /*!< MPU bus width */ - VPOSTB_DATA16or18, /*!< Display bus width */ - 0, /*!< MPU mode */ - VPOSTB_COLORTYPE_16M, /*!< Display colors */ - VPOSTB_DEVICE_SYNC_HIGHCOLOR, /*!< Type of display panel */ - - .sCRTCSIZE = - { - /*!< Horizontal Total */ - .HTT = FW043TFT_MARGIN_LEFT + FW043TFT_WIDTH + FW043TFT_MARGIN_RIGHT, - - /*!< Vertical Total */ - .VTT = FW043TFT_MARGIN_UPPER + FW043TFT_HEIGHT + FW043TFT_MARGIN_LOWER, - }, - .sCRTCDEND = - { - /*!< Horizontal Display Enable End */ - .HDEND = FW043TFT_WIDTH, - - /*!< Vertical Display Enable End */ - .VDEND = FW043TFT_HEIGHT, - }, - .sCRTCHR = - { - /*!< Internal Horizontal Retrace Start Timing */ - .HRS = FW043TFT_WIDTH + 1, - - /*!< Internal Horizontal Retrace End Low */ - .HRE = FW043TFT_WIDTH + 5, - }, - .sCRTCHSYNC = - { - /*!< Horizontal Sync Start Timing */ - .HSYNC_S = FW043TFT_WIDTH + FW043TFT_MARGIN_LEFT, - - /*!< Horizontal Sync End Timing */ - .HSYNC_E = FW043TFT_WIDTH + FW043TFT_MARGIN_LEFT + FW043TFT_HSYNC_LEN, - - /*!< Hsync Signal Adjustment For Multi-Cycles Per Pixel Mode Of Sync-Based Unipac-LCD */ - .HSYNC_SHIFT = 0, - }, - .sCRTCVR = - { - /*!< Vertical Internal Retrace Start Timing */ - .VRS = FW043TFT_HEIGHT + FW043TFT_MARGIN_UPPER, - - /*!< Vertical Internal Retrace End Low */ - .VRE = FW043TFT_HEIGHT + FW043TFT_MARGIN_UPPER + FW043TFT_VSYNC_LEN, - } -}; - -#define FW070TFT_WSVGA_WIDTH 1024 /*!< XRES */ -#define FW070TFT_WSVGA_HEIGHT 600 /*!< YRES */ -#define FW070TFT_WSVGA_MARGIN_LEFT 160 /*!< HBP (Horizontal Back Porch) */ -#define FW070TFT_WSVGA_MARGIN_RIGHT 160 /*!< HFP (Horizontal Front Porch) */ -#define FW070TFT_WSVGA_MARGIN_UPPER 12 /*!< VBP (Vertical Back Porch) */ -#define FW070TFT_WSVGA_MARGIN_LOWER 23 /*!< VFP (Vertical Front Porch) */ -#define FW070TFT_WSVGA_HSYNC_LEN 1 /*!< HPW (HSYNC plus width) */ -#define FW070TFT_WSVGA_VSYNC_LEN 1 /*!< VPW (VSYNC width) */ -static VPOST_T DEF_FW070TFT_WSVGA = -{ - FW070TFT_WSVGA_WIDTH, /*!< Panel width */ - FW070TFT_WSVGA_HEIGHT, /*!< Panel height */ - 0, /*!< MPU command line low indicator */ - 0, /*!< MPU command width */ - 0, /*!< MPU bus width */ - VPOSTB_DATA16or18, /*!< Display bus width */ - 0, /*!< MPU mode */ - VPOSTB_COLORTYPE_16M, /*!< Display colors */ - VPOSTB_DEVICE_SYNC_HIGHCOLOR, /*!< Type of display panel */ - - .sCRTCSIZE = - { - /*!< Horizontal Total */ - .HTT = FW070TFT_WSVGA_MARGIN_LEFT + FW070TFT_WSVGA_WIDTH + FW070TFT_WSVGA_MARGIN_RIGHT, - - /*!< Vertical Total */ - .VTT = FW070TFT_WSVGA_MARGIN_UPPER + FW070TFT_WSVGA_HEIGHT + FW070TFT_WSVGA_MARGIN_LOWER, - }, - .sCRTCDEND = - { - /*!< Horizontal Display Enable End */ - .HDEND = FW070TFT_WSVGA_WIDTH, - - /*!< Vertical Display Enable End */ - .VDEND = FW070TFT_WSVGA_HEIGHT, - }, - .sCRTCHR = - { - /*!< Internal Horizontal Retrace Start Timing */ - .HRS = FW070TFT_WSVGA_WIDTH + 1, - - /*!< Internal Horizontal Retrace End Low */ - .HRE = FW070TFT_WSVGA_WIDTH + 5, - }, - .sCRTCHSYNC = - { - /*!< Horizontal Sync Start Timing */ - .HSYNC_S = FW070TFT_WSVGA_WIDTH + FW070TFT_WSVGA_MARGIN_LEFT, - - /*!< Horizontal Sync End Timing */ - .HSYNC_E = FW070TFT_WSVGA_WIDTH + FW070TFT_WSVGA_MARGIN_LEFT + FW070TFT_WSVGA_HSYNC_LEN, - - /*!< Hsync Signal Adjustment For Multi-Cycles Per Pixel Mode Of Sync-Based Unipac-LCD */ - .HSYNC_SHIFT = 0, - }, - .sCRTCVR = - { - /*!< Vertical Internal Retrace Start Timing */ - .VRS = FW070TFT_WSVGA_HEIGHT + FW070TFT_WSVGA_MARGIN_UPPER, - - /*!< Vertical Internal Retrace End Low */ - .VRE = FW070TFT_WSVGA_HEIGHT + FW070TFT_WSVGA_MARGIN_UPPER + FW070TFT_WSVGA_VSYNC_LEN, - } -}; - -/* LCD build-in support list */ -static VPOST_T *DisplayDevList[DIS_PANEL_CNT] = -{ - &DEF_E50A2V1, - &DEF_ILI9341_MPU80, - &DEF_LSA40AT9001, - &DEF_FW070TFT, - &DEF_FW043TFT, - &DEF_FW070TFT_WSVGA -}; - -static VPOST_T curDisplayDev; -static OSDFORMATEX curOSDDev = {0}; -static LCDFORMATEX curVADev = {0}; - -/// @endcond /* HIDDEN_SYMBOLS */ - -/*@}*/ /* end of group N9H30_I2C_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_LCD_EXPORTED_FUNCTIONS LCD Exported Functions - @{ -*/ -/// @cond HIDDEN_SYMBOLS - -/* For align 32 */ -static uint32_t shift_pointer(uint32_t ptr, uint32_t align) -{ - uint32_t alignedPTR; - uint32_t remain; - - //printf("pointer position is %x\n",ptr); - if ((ptr % align) != 0) - { - remain = ptr % align; - alignedPTR = ptr + (align - remain); - return alignedPTR; - } - return ptr; -} - -/// @endcond /* HIDDEN_SYMBOLS */ - -/** - * @brief Configure attributes of LCD panel,install interrupt handler and enable LCD engine clock - * @param[in] u32DisplayPanelID is panel id to configure. - * @return none - */ -void vpostLCMInit(uint32_t u32DisplayPanelID) -{ - // enable lcd engine clock - outpw(REG_CLK_HCLKEN, inpw(REG_CLK_HCLKEN) | (1 << 25)); - - memset((void *)&curDisplayDev, 0, sizeof(curDisplayDev)); - memcpy((void *)&curDisplayDev, DisplayDevList[u32DisplayPanelID], sizeof(curDisplayDev)); - - outpw(REG_LCM_DEV_CTRL, curDisplayDev.u32CmdLow - | curDisplayDev.u32Cmd16t18 - | curDisplayDev.u32CmdBusWidth - | curDisplayDev.u32DataBusWidth - | curDisplayDev.u32MPU_Mode - | curDisplayDev.u32DisplayColors - | curDisplayDev.u32DevType); - - outpw(REG_LCM_CRTC_SIZE, curDisplayDev.u32Reg_CRTCSIZE); - outpw(REG_LCM_CRTC_DEND, curDisplayDev.u32Reg_CRTCDEND); - outpw(REG_LCM_CRTC_HR, curDisplayDev.u32Reg_CRTCHR); - outpw(REG_LCM_CRTC_HSYNC, curDisplayDev.u32Reg_CRTCHSYNC); - outpw(REG_LCM_CRTC_VR, curDisplayDev.u32Reg_CRTCVR); - -} - -/** - * @brief Query LCM capacity and configuration by ID - * @param[in] u32DisplayPanelID is panel id to configure. - * @return LCM instance - */ -VPOST_T *vpostLCMGetInstance(uint32_t u32DisplayPanelID) -{ - if (u32DisplayPanelID > (sizeof(DisplayDevList) / sizeof(VPOST_T *))) - return NULL; - - return DisplayDevList[u32DisplayPanelID]; -} - -/** - * @brief Disable LCD engine - * @param none - * @return none - */ -void vpostLCMDeinit(void) -{ - // disable lcd engine clock - outpw(REG_CLK_HCLKEN, inpw(REG_CLK_HCLKEN) & ~(1 << 25)); - - //sysDisableInterrupt(LCD_IRQn); -} - -/** - * @brief Get the pointer of frame buffer - * @param none - * @return pointer of frame buffer - * @retval NULL fail. - * @note before calling this function, display width, height and source format must be set first. - */ -uint8_t *vpostGetFrameBuffer(void) -{ - uint8_t *u8BufPtr; - uint8_t u32BytePerPixel; - - if ((curDisplayDev.u32DevWidth == 0) || (curDisplayDev.u32DevHeight == 0)) - return NULL; - - switch (curVADev.ucVASrcFormat) - { - case VA_SRC_YUV422: - case VA_SRC_YCBCR422: - case VA_SRC_RGB565: - u32BytePerPixel = 2; - break; - - case VA_SRC_RGB666: - case VA_SRC_RGB888: - u32BytePerPixel = 4; - break; - - default: - u32BytePerPixel = 2; - } - - u8BufPtr = (uint8_t *)malloc((curDisplayDev.u32DevWidth * curDisplayDev.u32DevHeight * u32BytePerPixel) + 32); - if (u8BufPtr == NULL) - return NULL; - u8BufPtr = (uint8_t *)shift_pointer((uint32_t)u8BufPtr, 32); - - outpw(REG_LCM_VA_BADDR0, (uint32_t)((uint32_t)u8BufPtr | 0x80000000)); - outpw(REG_LCM_VA_FBCTRL, inpw(REG_LCM_VA_FBCTRL) & ~(1 << 30) & ~VPOSTB_DB_EN); - - return (uint8_t *)((uint32_t)u8BufPtr | 0x80000000); -} - -void vpostSetFrameBuffer(uint8_t *pu8BufPtr) -{ - outpw(REG_LCM_VA_BADDR0, (uint32_t)((uint32_t)pu8BufPtr | 0x80000000)); - outpw(REG_LCM_VA_FBCTRL, inpw(REG_LCM_VA_FBCTRL) & ~(1 << 30) & ~VPOSTB_DB_EN); -} - - -/** - * @brief Get the pointer of frame buffer - * @param[in] u32Cnt is the frame buffer count to allocate. Min value is 1. - * @return pointer of frame buffer - * @retval NULL fail. - * @note before calling this function, display width, height and source format must be set first. - */ -uint8_t *vpostGetMultiFrameBuffer(uint32_t u32Cnt) -{ - uint8_t *u8BufPtr; - uint8_t u32BytePerPixel; - - if ((curDisplayDev.u32DevWidth == 0) || (curDisplayDev.u32DevHeight == 0) || (u32Cnt == 0)) - return NULL; - - switch (curVADev.ucVASrcFormat) - { - case VA_SRC_YUV422: - case VA_SRC_YCBCR422: - case VA_SRC_RGB565: - u32BytePerPixel = 2; - break; - - case VA_SRC_RGB666: - case VA_SRC_RGB888: - u32BytePerPixel = 4; - break; - - default: - u32BytePerPixel = 2; - } - - u8BufPtr = (uint8_t *)malloc((curDisplayDev.u32DevWidth * curDisplayDev.u32DevHeight * u32BytePerPixel) * u32Cnt + 32); - if (u8BufPtr == NULL) - return NULL; - u8BufPtr = (uint8_t *)shift_pointer((uint32_t)u8BufPtr, 32); - - outpw(REG_LCM_VA_BADDR0, (uint32_t)((uint32_t)u8BufPtr | 0x80000000)); - outpw(REG_LCM_VA_FBCTRL, inpw(REG_LCM_VA_FBCTRL) & ~(1 << 30) & ~VPOSTB_DB_EN); - - return (uint8_t *)((uint32_t)u8BufPtr | 0x80000000); -} - -/** - * @brief Set active display window - * @param[in] u16StartY is y start position - * @param[in] u16EndY is y end position - * @param[in] u8BGColorR is background R color - * @param[in] u8BGColorG is background G color - * @param[in] u8BGColorB is background B color - * @return none - */ -void vpostSetActiveWindow(uint16_t u16StartY, uint16_t u16EndY, uint8_t u8BGColorR, uint8_t u8BGColorG, uint8_t u8BGColorB) -{ - outpw(REG_LCM_VA_WIN, (u16StartY << 16) | u16EndY); - outpw(REG_LCM_VA_STUFF, (u8BGColorR << 16) | (u8BGColorG << 8) | u8BGColorB); -} - -/** - * @brief Configure LCD display mode - * @param[in] u8DisplayMode is display mode, value could be - * - \ref VPOST_DISPLAY_SINGLE - * - \ref VPOST_DISPLAY_CONTINUOUS - * @return none - */ -void vpostSetDisplayMode(uint8_t u8DisplayMode) -{ - if (u8DisplayMode == 0) - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) & ~(1 << 7)); //clear setting - else - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) | (u8DisplayMode) << 7); -} - -/** - * @brief Configure display attributes of video interface, - * @param[in] u32VASrcType is display type, value could be - * - \ref VA_SRC_YUV422 - * - \ref VA_SRC_YCBCR422 - * - \ref VA_SRC_RGB888 - * - \ref VA_SRC_RGB666 - * - \ref VA_SRC_RGB565 - * - \ref VA_SRC_RGB444_LOW - * - \ref VA_SRC_RGB444_HIGH - * @return none - */ -void vpostSetVASrc(uint32_t u32VASrcType) -{ - uint32_t u32BytePerPixel, VA_FF, VA_Sride; - - curVADev.ucVASrcFormat = u32VASrcType; - - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) & ~(7 << 8)); - if (u32VASrcType != 0) - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) | u32VASrcType); - else - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) & ~(7 << 8)); - - if ((u32VASrcType == VA_SRC_RGB888) || (u32VASrcType == VA_SRC_RGB666)) - outpw(REG_LCM_VA_FBCTRL, inpw(REG_LCM_VA_FBCTRL) & ~0x7ff07ff | (curDisplayDev.u32DevWidth << 16) | curDisplayDev.u32DevWidth); - else - outpw(REG_LCM_VA_FBCTRL, inpw(REG_LCM_VA_FBCTRL) & ~0x7ff07ff | ((curDisplayDev.u32DevWidth / 2) << 16) | (curDisplayDev.u32DevWidth / 2)); - - switch (u32VASrcType) - { - case VA_SRC_YUV422: - case VA_SRC_YCBCR422: - case VA_SRC_RGB565: - u32BytePerPixel = 2; - break; - - case VA_SRC_RGB666: - case VA_SRC_RGB888: - u32BytePerPixel = 4; - break; - - default: - u32BytePerPixel = 2; - } - - /* set video stream frame buffer control */ - VA_FF = curDisplayDev.u32DevWidth * u32BytePerPixel / 4; - VA_Sride = curDisplayDev.u32DevWidth * u32BytePerPixel / 4; - outpw(REG_LCM_VA_FBCTRL, inpw(REG_LCM_VA_FBCTRL) & ~0x7ff07ff | (VA_FF << 16) | VA_Sride); -} - -/** - * @brief Start to display - * @param none - * @return none - */ -void vpostVAStartTrigger(void) -{ - if ((inpw(REG_LCM_DCCS) & VPOSTB_SINGLE) == VPOSTB_SINGLE) - while ((inpw(REG_LCM_DCCS) & VPOSTB_VA_EN) == VPOSTB_VA_EN); //wait VA_EN low - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) | VPOSTB_DISP_OUT_EN); //display_out-enable - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) | VPOSTB_VA_EN); //va-enable -} - -/** - * @brief Stop to display - * @param none - * @return none - */ -void vpostVAStopTrigger(void) -{ - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) & ~(VPOSTB_DISP_OUT_EN | VPOSTB_VA_EN)); //OSD disable -} - -/** - * @brief Configure LCD scaling attribute - * @param[in] u8HIntegral is horizontal integral - * @param[in] u16HDecimal is horizontal decimal - * @param[in] u8VIntegral is vertical integral - * @param[in] u16VDecimal is vertical decimal - * @param[in] u32Mode is scale mode, value could be - * - \ref VA_SCALE_INTERPOLATION - * - \ref VA_SCALE_DUPLICATION - * @return none - */ -void vpostVAScalingCtrl(uint8_t u8HIntegral, uint16_t u16HDecimal, uint8_t u8VIntegral, uint16_t u16VDecimal, uint32_t u32Mode) -{ - outpw(REG_LCM_VA_SCALE, ((((uint32_t)u8VIntegral << 10) + ((uint32_t)ceil((double)1024 / 10)*u16VDecimal)) << 16) - | (((uint32_t)u8HIntegral << 10) + ((uint32_t)ceil((double)1024 / 10)*u16HDecimal)) | u32Mode); -} - -/** - * @brief Set OSD color key - * @param[in] u8CKeyColorR is color key R color - * @param[in] u8CKeyColorG is color key G color - * @param[in] u8CKeyColorB is color key B color - * @return none - */ -void vpostOSDSetColKey(uint8_t u8CKeyColorR, uint8_t u8CKeyColorG, uint8_t u8CKeyColorB) -{ - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) & ~(VPOSTB_BLI_ON | VPOSTB_CKEY_ON)); //blinking disable, color-key disable - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) | VPOSTB_CKEY_ON);//color-key enable - outpw(REG_LCM_OSD_CKEY, ((uint32_t)(u8CKeyColorR << 16) | (uint32_t)(u8CKeyColorG << 8) | u8CKeyColorB)); -} - -/** - * @brief Set OSD color mask, OSD data only will be displayed if the mask bit is set as 1. - * @param[in] u8MaskColorR is color key R color - * @param[in] u8MaskColorG is color key G color - * @param[in] u8MaskColorB is color key B color - * @return none - */ -void vpostOSDSetColMask(uint8_t u8MaskColorR, uint8_t u8MaskColorG, uint8_t u8MaskColorB) -{ - outpw(REG_LCM_OSD_CMASK, ((u8MaskColorR << 16) | (u8MaskColorG << 8) | u8MaskColorB)); -} - -/** - * @brief Set OSD blinking function - * @param[in] u8OSDBlinkVcnt is blinking cycle time, unit is VSync - * @return none - */ -void vpostOSDSetBlinking(uint8_t u8OSDBlinkVcnt) -{ - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) & ~(VPOSTB_BLI_ON | VPOSTB_CKEY_ON)); //blinking disable, color-key disable - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) | VPOSTB_BLI_ON); - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) | ((uint32_t)(u8OSDBlinkVcnt) << 16)); -} - -/** - * @brief Disable OSD blinking function - * @param none - * @return none - */ -void vpostOSDDisableBlinking(void) -{ - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) & ~ VPOSTB_BLI_ON); -} - -/** - * @brief Configure display attributes of OSD - * @param[in] u32OSDSrcType is display type, value could be - * - \ref OSD_SRC_YUV422 - * - \ref OSD_SRC_YCBCR422 - * - \ref OSD_SRC_RGB888 - * - \ref OSD_SRC_RGB666 - * - \ref OSD_SRC_RGB565 - * - \ref OSD_SRC_RGB444_LOW - * - \ref OSD_SRC_RGB444_HIGH - * - \ref OSD_SRC_RGB332 - * @return none - */ -void vpostSetOSDSrc(uint32_t u32OSDSrcType) -{ - uint32_t u32BytePerPixel, VA_FF, VA_Sride; - - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) & ~(7 << 12) | u32OSDSrcType); - curOSDDev.ucOSDSrcFormat = u32OSDSrcType; - - switch (u32OSDSrcType) - { - case OSD_SRC_YUV422: - case OSD_SRC_YCBCR422: - case OSD_SRC_RGB565: - u32BytePerPixel = 2; - break; - - case OSD_SRC_RGB666: - case OSD_SRC_RGB888: - u32BytePerPixel = 4; - break; - - default: - u32BytePerPixel = 2; - } - - /* set video stream frame buffer control */ - VA_FF = curOSDDev.nOSDWidth * u32BytePerPixel / 4; - VA_Sride = curOSDDev.nOSDWidth * u32BytePerPixel / 4; - outpw(REG_LCM_OSD_FBCTRL, inpw(REG_LCM_OSD_FBCTRL) & ~0x7ff07ff | (VA_FF << 16) | VA_Sride); -} - -/** - * @brief Get the pointer of OSD frame buffer - * @param none - * @return pointer of OSD frame buffer - * @retval NULL fail. - * @note Must call \ref vpostOSDSetWindow and \ref vpostSetOSDSrc before calling this function - */ -uint8_t *vpostGetOSDBuffer(void) -{ - uint32_t u32BytePerPixel; - uint8_t *u8BufPtr; - - if ((curOSDDev.nOSDWidth == 0) || (curOSDDev.nOSDHeight == 0)) - { - return NULL; - } - - switch (curOSDDev.ucOSDSrcFormat) - { - case OSD_SRC_YUV422: - case OSD_SRC_YCBCR422: - case OSD_SRC_RGB565: - u32BytePerPixel = 2; - break; - - case OSD_SRC_RGB666: - case OSD_SRC_RGB888: - u32BytePerPixel = 4; - break; - - default: - u32BytePerPixel = 2; - } - - u8BufPtr = (uint8_t *)malloc((curOSDDev.nOSDWidth * curOSDDev.nOSDHeight * u32BytePerPixel) + 32); - if (u8BufPtr == NULL) - return NULL; - u8BufPtr = (uint8_t *)shift_pointer((uint32_t)u8BufPtr, 32); - - outpw(REG_LCM_OSD_BADDR, (uint32_t)((uint32_t)u8BufPtr | 0x80000000)); - - return (uint8_t *)((uint32_t)u8BufPtr | 0x80000000); -} - -/** - * @brief Get the pointer of OSD buffer - * @param[in] u32Cnt is the frame buffer count to allocate. Min value is 1. - * @return pointer of frame buffer - * @retval NULL fail. - * @note before calling this function, display width, height and source format must be set first. - */ -uint8_t *vpostGetMultiOSDBuffer(uint32_t u32Cnt) -{ - uint32_t u32BytePerPixel; - uint8_t *u8BufPtr; - - if ((curOSDDev.nOSDWidth == 0) || (curOSDDev.nOSDHeight == 0)) - { - return NULL; - } - - switch (curOSDDev.ucOSDSrcFormat) - { - case OSD_SRC_YUV422: - case OSD_SRC_YCBCR422: - case OSD_SRC_RGB565: - u32BytePerPixel = 2; - break; - - case OSD_SRC_RGB666: - case OSD_SRC_RGB888: - u32BytePerPixel = 4; - break; - - default: - u32BytePerPixel = 2; - } - - u8BufPtr = (uint8_t *)malloc((curOSDDev.nOSDWidth * curOSDDev.nOSDHeight * u32BytePerPixel) * u32Cnt + 32); - if (u8BufPtr == NULL) - return NULL; - u8BufPtr = (uint8_t *)shift_pointer((uint32_t)u8BufPtr, 32); - - outpw(REG_LCM_OSD_BADDR, (uint32_t)((uint32_t)u8BufPtr | 0x80000000)); - - return (uint8_t *)((uint32_t)u8BufPtr | 0x80000000); - -} - -void vpostSetOSDBuffer(uint8_t *u8BufPtr) -{ - outpw(REG_LCM_OSD_BADDR, (uint32_t)((uint32_t)u8BufPtr | 0x80000000)); -} - -/** - * @brief Enable OSD function - * @param none - * @return none - */ -void vpostOSDEnable(void) -{ - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) | VPOSTB_OSD_EN); //OSD enable -} - -/** - * @brief Disable OSD function - * @param none - * @return none - */ -void vpostOSDDisable(void) -{ - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) & ~VPOSTB_OSD_EN); //OSD disable -} - -/** - * @brief Configure OSD scaling attribute - * @param[in] u8HIntegral is horizontal integral - * @param[in] u16HDecimal is horizontal decimal - * @param[in] u8VScall is scale mode, value could be - * - \ref VPOSTB_OSD_VUP_1X - * - \ref VPOSTB_OSD_VUP_2X - * - \ref VPOSTB_OSD_VUP_4X - * @return none - */ -void vpostOSDScalingCtrl(uint8_t u8HIntegral, uint16_t u16HDecimal, uint8_t u8VScall) -{ - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) & 0xfff0ffff); //clear OSD scaling setting - if (u8VScall != 0) - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) | (u8VScall << 16)); - outpw(REG_LCM_OSD_SCALE, ((uint32_t)u8HIntegral << 10) | ((uint32_t)ceil((double)1024 / 10 * u16HDecimal)) << 6); -} - -/** - * @brief Set OSD display window, including start position, width and height. - * @param[in] u32XStart is X start position - * @param[in] u32YStart is Y start position - * @param[in] u32Width is OSD display width - * @param[in] u32Height is OSD display height - * @return none - */ -void vpostOSDSetWindow(uint32_t u32XStart, uint32_t u32YStart, uint32_t u32Width, uint32_t u32Height) -{ - outpw(REG_LCM_OSD_WINS, ((u32YStart + 1) << 16) | (u32XStart + 1)); - outpw(REG_LCM_OSD_WINE, ((u32YStart + u32Height) << 16) | (u32XStart + u32Width)); - - curOSDDev.nOSDWidth = u32Width; - curOSDDev.nOSDHeight = u32Height; -} - -/** - * @brief Initialize hardware cursor function - * @param[in] u32CursorBMPBuff is pointer of hardware cursor image - * @param[in] ucMode is hardware cursor mode, value could be - * - \ref HC_MODE0 - * - \ref HC_MODE1 - * - \ref HC_MODE2 - * - \ref HC_MODE3 - * - \ref HC_MODE4 - * - \ref HC_MODE5 - * @return none - */ -void vpostHCInit(uint32_t *u32CursorBMPBuff, VA_HCMODE_E ucMode) -{ - int bpp = 2; - int BlockWidth = 32; - int bpw = 32; - - outpw(REG_LCM_HC_CTRL, inpw(REG_LCM_HC_CTRL) & ~0x003f3f00 | (0x00 << 8) | (0x00 << 16)); //set TIP - if (ucMode == HC_MODE0) - { - bpp = 2; - BlockWidth = 32; - outpw(REG_LCM_HC_CTRL, inpw(REG_LCM_HC_CTRL) & ~0x7); //set mode 0 32X32X2bpp 4 color - - } - else if (ucMode == HC_MODE1) - { - bpp = 2; - BlockWidth = 32; - outpw(REG_LCM_HC_CTRL, inpw(REG_LCM_HC_CTRL) & ~0x7 | 0x1); //set mode 1 32X32X2bpp 3 color and 1 transparent - } - else if (ucMode == HC_MODE2) - { - bpp = 2; - BlockWidth = 64; - outpw(REG_LCM_HC_CTRL, inpw(REG_LCM_HC_CTRL) & ~0x7 | 0x2); //set mode 2 64X64X2bpp 4 color - } - else if (ucMode == HC_MODE3) - { - bpp = 2; - BlockWidth = 64; - outpw(REG_LCM_HC_CTRL, inpw(REG_LCM_HC_CTRL) & ~0x7 | 0x3); //set mode 3 64X64X2bpp 3 color and 1 transparent - } - else if (ucMode == HC_MODE4) - { - bpp = 1; - BlockWidth = 128; - outpw(REG_LCM_HC_CTRL, inpw(REG_LCM_HC_CTRL) & ~0x7 | 0x4); //set mode 4 128X128X1bpp 2 color - } - else if (ucMode == HC_MODE5) - { - bpp = 1; - BlockWidth = 128; - outpw(REG_LCM_HC_CTRL, inpw(REG_LCM_HC_CTRL) & ~0x7 | 0x5); //set mode 5 128X128X1bpp 1 color and 1 transparent - } - - outpw(REG_LCM_HC_WBCTRL, ((bpp * BlockWidth / bpw) << 16) | (bpp * BlockWidth / bpw)); - outpw(REG_LCM_HC_BADDR, (uint32_t)u32CursorBMPBuff); - outpw(REG_LCM_HC_COLOR0, 0x00ff0000); // RED color - outpw(REG_LCM_HC_COLOR1, 0x0000ff00); // GREEN color - outpw(REG_LCM_HC_COLOR2, 0x000000ff); // BLUE color - outpw(REG_LCM_HC_COLOR3, 0x00ffff00); // YELLOW color - outpw(REG_LCM_DCCS, inpw(REG_LCM_DCCS) | VPOSTB_HC_EN); -} - -/** - * @brief Set the position of hardware cursor - * @param[in] u32CursorX is X position - * @param[in] u32CursorY is Y position - * @return none - */ -void vpostHCPosCtrl(uint32_t u32CursorX, uint32_t u32CursorY) -{ - outpw(REG_LCM_HC_POS, (u32CursorY << 16) | u32CursorX); //set Cursor position -} - -/** - * @brief Set OSD overlay condition - * @param[in] u8OSDDisplayMatch is display method when mask bit is matched, value could be - * - \ref DISPLAY_VIDEO - * - \ref DISPLAY_OSD - * - \ref DISPLAY_SYNTHESIZED - * @param[in] u8OSDDisplayUnMatch is display method when mask bit is unmatched - * - \ref DISPLAY_VIDEO - * - \ref DISPLAY_OSD - * - \ref DISPLAY_SYNTHESIZED - * @param[in] u8OSDSynW is synthesis video weighting, based on match condition - * @return none - */ -void vpostOSDSetOverlay(uint8_t u8OSDDisplayMatch, uint8_t u8OSDDisplayUnMatch, uint8_t u8OSDSynW) -{ - /* clear OCR0 and OCR1 */ - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) & 0xfffffff0); - - /* match condition */ - if (u8OSDDisplayMatch != 0) - { - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) | (u8OSDDisplayMatch << 2)); - } - - /* unmatch condition */ - if (u8OSDDisplayUnMatch != 0) - { - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) | (u8OSDDisplayUnMatch)); - } - - /* synthesized weight */ - if (u8OSDDisplayMatch == DISPLAY_SYNTHESIZED || u8OSDDisplayUnMatch == DISPLAY_SYNTHESIZED) - { - outpw(REG_LCM_OSD_OVERLAY, inpw(REG_LCM_OSD_OVERLAY) | (u8OSDSynW << 4)); - } -} - -/** - * @brief Write MPU command - * @param[in] uscmd MPU command code - * @return none - */ -void vpostMPUWriteAddr(uint16_t uscmd) -{ - outpw(REG_LCM_MPU_CMD, inpw(REG_LCM_MPU_CMD) & ~(1 << 30)); //RS=0 - outpw(REG_LCM_MPU_CMD, inpw(REG_LCM_MPU_CMD) & ~(1 << 29)); //w - - outpw(REG_LCM_DCCS, (inpw(REG_LCM_DCCS) | (1 << 5))); //CMD ON - outpw(REG_LCM_MPU_CMD, (inpw(REG_LCM_MPU_CMD) & 0xffff0000 | uscmd)); - while (inpw(REG_LCM_MPU_CMD) & (1UL << 31)); - outpw(REG_LCM_DCCS, (inpw(REG_LCM_DCCS) & ~(1 << 5))); //CMD OFF -} - -/** - * @brief Write MPU data - * @param[in] usdata MPU data - * @return none - */ -void vpostMPUWriteData(uint16_t usdata) -{ - outpw(REG_LCM_MPU_CMD, inpw(REG_LCM_MPU_CMD) | (1 << 30)); //RS=1 - outpw(REG_LCM_MPU_CMD, inpw(REG_LCM_MPU_CMD) & ~(1 << 29)); //w - outpw(REG_LCM_DCCS, (inpw(REG_LCM_DCCS) | (1 << 5))); //CMD ON - outpw(REG_LCM_MPU_CMD, inpw(REG_LCM_MPU_CMD) & 0xffff0000 | usdata); - while (inpw(REG_LCM_MPU_CMD) & (1UL << 31)); - outpw(REG_LCM_DCCS, (inpw(REG_LCM_DCCS) & ~(1 << 5))); //CMD OFF -} - -/** - * @brief Read MPU data - * @param none - * @return MPU data - */ -uint32_t vpostMPUReadData(void) -{ - uint32_t udata; - - outpw(REG_LCM_MPU_CMD, inpw(REG_LCM_MPU_CMD) | (1 << 30)); //RS=1 - outpw(REG_LCM_DCCS, (inpw(REG_LCM_DCCS) | (1 << 5))); //CMD ON - outpw(REG_LCM_MPU_CMD, inpw(REG_LCM_MPU_CMD) | (1 << 29)); //r - while (inpw(REG_LCM_MPU_CMD) & (1UL << 31)); - udata = inpw(REG_LCM_MPU_CMD) & 0xffff; - outpw(REG_LCM_DCCS, (inpw(REG_LCM_DCCS) & ~(1 << 5))); //CMD OFF - - return udata; -} - -/*@}*/ /* end of group N9H30_LCD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_LCD_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_pwm.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_pwm.c deleted file mode 100644 index a4e11b69f12..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_pwm.c +++ /dev/null @@ -1,1117 +0,0 @@ -/**************************************************************************//** - * @file pwm.c - * @brief N9H30 series PWM driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_pwm.h" -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_PWM_Driver PWM Driver - @{ -*/ - - -/** @addtogroup N9H30_PWM_EXPORTED_FUNCTIONS PWM Exported Functions - @{ -*/ - -//Internal function definition -/// @cond HIDDEN_SYMBOLS - -void pwmISR(PVOID pvParam); - - -static INT pwmInitGPIO(const INT nTimerIdentity, const INT nValue); -static INT pwmInitTimer(const INT nTimerIdentity); -static INT pwmStartTimer(const INT nTimerIdentity); -static INT pwmStopTimer(const INT nTimerIdentity, const INT nMethod); -// Register operation -static INT pwmSetCP(const INT nTimerIdentity, const INT nValue); -static INT pwmSetDZI(const INT nTimerIdentity, const INT nValue); -static INT pwmSetCSR(const INT nTimerIdentity, const INT nValue); -static INT pwmSetDZGenerator(const INT nTimerIdentity, const INT nStatus); -static INT pwmSetTimerState(const INT nTimerIdentity, const INT nStatus); -static INT pwmSetInverter(const INT nTimerIdentity, const INT nStatus); -static INT pwmSetMode(const INT nTimerIdentity, const INT nStatus); -static INT pwmSetCNR(const INT nTimerIdentity, const INT nValue); -static INT pwmSetCMR(const INT nTimerIdentity, const INT nValue); -static UINT pwmGetPDR(const INT nTimerIdentity); -static INT pwmSetPIER(const INT nTimerIdentity, const INT value); -static INT pwmCleanPIIR(const INT nTimerIdentity); - -//Global variable -static BOOL bPWMIRQFlag = FALSE; //IRQ enable flag, set after PWM IRQ enable -static BOOL bPWMTimerOpenStatus[PWM_TIMER_NUM]; //timer flag which set after open(for disable IRQ decision) -static BOOL bPWMTimerStartStatus[PWM_TIMER_NUM]; //timer flag which set after Start count(to avoid incorrectly stop procedure) -static BOOL bPWMTimerMode[PWM_TIMER_NUM]; //PWM timer toggle/one shot mode -static BOOL volatile bPWMIntFlag[PWM_TIMER_NUM]; //interrupt flag which set by ISR -/// @endcond /* HIDDEN_SYMBOLS */ - - -/** - * @brief The init function of PWM device driver - */ -INT pwmInit(void) -{ - UINT temp; - // Enable PWM clock - temp = inpw(REG_CLK_PCLKEN1); - temp = temp | 0x8000000; - outpw(REG_CLK_PCLKEN1, temp); - - sysInstallISR(IRQ_LEVEL_1, PWM_IRQn, (PVOID)pwmISR); - sysSetLocalInterrupt(ENABLE_IRQ); // Enable CPSR I bit - - return 0; -} - -/** - * @brief The exit function of PWM device driver - */ -INT pwmExit(void) -{ - return 0; -} - -/** - * @brief The open function of PWM device driver - * @param[in] nTimerIdentity PWM Timer channel identity - * @retval Successful PWM successfully opened - * @retval pwmTimerBusy PWM timer already open - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -INT pwmOpen(const INT nTimerIdentity) -{ - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// nTimerIdentity value error - } - if (bPWMTimerOpenStatus[nTimerIdentity] == TRUE) - { - return pwmTimerBusy; - } - if (bPWMIRQFlag == FALSE) - { - - sysEnableInterrupt(PWM_IRQn); - - bPWMIRQFlag = TRUE; - } - bPWMTimerOpenStatus[nTimerIdentity] = TRUE; - - // Set PWM timer default value(CSR->PPR->PCR->CMR->CNR) - pwmInitTimer(nTimerIdentity); - - //Enable PIER - pwmSetPIER(nTimerIdentity, PWM_ENABLE); - - //Reset PIIR - pwmCleanPIIR(nTimerIdentity); - - //Reset PWM timer start count flag - bPWMTimerStartStatus[nTimerIdentity] = FALSE; - - return Successful; - -} - -/** - * @brief The close function of PWM device driver - * @param[in] nTimerIdentity PWM Timer channel identity - * @retval Successful PWM successfully closed - * @retval pwmTimerNotOpen PWM timer not open - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -INT pwmClose(const INT nTimerIdentity) -{ - INT nLoop; - BOOL uAllTimerClose = TRUE; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// nTimerIdentity value error - } - if (bPWMTimerOpenStatus[nTimerIdentity] == FALSE) - { - return pwmTimerNotOpen; - } - bPWMTimerOpenStatus[nTimerIdentity] = FALSE; - //Check if all timer stop, IRQ can be disable - for (nLoop = PWM_TIMER_MIN; nLoop < PWM_TIMER_NUM; nLoop++) - { - if (bPWMTimerOpenStatus[nLoop] == TRUE) - { - uAllTimerClose = FALSE; - } - } - //All timer stop, disable IRQs - if (uAllTimerClose == TRUE) - { - - sysDisableInterrupt(PWM_IRQn); - bPWMIRQFlag = FALSE; - } - - pwmSetPIER(nTimerIdentity, PWM_DISABLE); - pwmCleanPIIR(nTimerIdentity); - - - return Successful; - -} - -/** - * @brief The read function of PWM device driver - * @param[in] nTimerIdentity PWM Timer channel identity - * @param[out] pucStatusValue The point of typePWMSTATUS - * @param[in] uLength The length of typePWMSTATUS - * @retval Successful Read PWM value successfully - * @retval pwmTimerNotOpen PWM timer not open - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidStructLength Struct length error(struct type error) - */ -INT pwmRead(const INT nTimerIdentity, PUCHAR pucStatusValue, const UINT uLength) -{ - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// nTimerIdentity value error - } - if (bPWMTimerOpenStatus[nTimerIdentity] == FALSE) - { - return pwmTimerNotOpen; - } - if (uLength != sizeof(typePWMSTATUS)) - { - return pwmInvalidStructLength;// Struct length error(struct type error) - } - if (sizeof(*((typePWMSTATUS *)pucStatusValue)) != sizeof(typePWMSTATUS)) - { - return pwmInvalidStructLength;// Struct length error(struct type error) - } - ((typePWMSTATUS *)pucStatusValue)->PDR = pwmGetPDR(nTimerIdentity); - if (bPWMIntFlag[nTimerIdentity] == TRUE) - { - bPWMIntFlag[nTimerIdentity] = FALSE; - ((typePWMSTATUS *)pucStatusValue)->InterruptFlag = TRUE; - } - else - { - ((typePWMSTATUS *)pucStatusValue)->InterruptFlag = FALSE; - } - - return Successful; - -} - -/** - * @brief The write function of PWM device driver - * @param[in] nTimerIdentity PWM Timer channel identity - * @param[in] pucCNRCMRValue The value of CNR and CMR - * @param[in] uLength For future usage - * @retval Successful Write PWM setting successfully - * @retval pwmTimerNotOpen PWM timer not open - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -INT pwmWrite(const INT nTimerIdentity, PUCHAR pucCNRCMRValue, const UINT uLength) -{ - typePWMVALUE pwmvalue; - INT nStatus; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// nTimerIdentity value error - } - if (bPWMTimerOpenStatus[nTimerIdentity] == FALSE) - { - return pwmTimerNotOpen; - } - if (uLength != sizeof(typePWMVALUE)) - { - return pwmInvalidStructLength;// Struct length error(struct type error) - } - pwmvalue.value = ((typePWMVALUE *)pucCNRCMRValue)->value; - nStatus = pwmSetCNR(nTimerIdentity, pwmvalue.field.cnr); - - if (nStatus != Successful) - { - return nStatus; - } - nStatus = pwmSetCMR(nTimerIdentity, pwmvalue.field.cmr); - - if (nStatus != Successful) - { - return nStatus; - } - return Successful; - -} - -/** - * @brief The ioctl function of PWM device driver - * @param[in] nTimerIdentity PWM Timer channel identity - * @param[in] uCommand Ioctl command which indicates different operation - * @param[in] uIndication Not use in PWM - * @param[in] uValue The value which use with uCommand - * @retval Successful PWM ioctl execute successfully - * @retval pwmTimerNotOpen PWM timer not open - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidIoctlCommand Ioctl command error - * @retval Others Error according to different uCommand - */ -INT pwmIoctl(const INT nTimerIdentity, const UINT uCommand, const UINT uIndication, UINT uValue) -{ - INT nStatus; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// nTimerIdentity value error - } - if (bPWMTimerOpenStatus[nTimerIdentity] == FALSE) - { - return pwmTimerNotOpen; - } - switch (uCommand) - { - case START_PWMTIMER: - { - nStatus = pwmStartTimer(nTimerIdentity); - break; - } - case STOP_PWMTIMER: - { - // default stop method is 2 - nStatus = pwmStopTimer(nTimerIdentity, PWM_STOP_METHOD2); - break; - } - case SET_CSR: - { - nStatus = pwmSetCSR(nTimerIdentity, uValue); - break; - } - case SET_CP: - { - nStatus = pwmSetCP(nTimerIdentity, uValue); - break; - } - case SET_DZI: - { - nStatus = pwmSetDZI(nTimerIdentity, uValue); - break; - } - case SET_INVERTER: - { - nStatus = pwmSetInverter(nTimerIdentity, uValue); - break; - } - case SET_MODE: - { - nStatus = pwmSetMode(nTimerIdentity, uValue); - break; - } - case ENABLE_DZ_GENERATOR: - { - nStatus = pwmSetDZGenerator(nTimerIdentity, PWM_ENABLE); - break; - } - case DISABLE_DZ_GENERATOR: - { - nStatus = pwmSetDZGenerator(nTimerIdentity, PWM_DISABLE); - break; - } - case ENABLE_PWMGPIOOUTPUT: - { - nStatus = pwmInitGPIO(nTimerIdentity, uValue); - break; - } - default: - { - return pwmInvalidIoctlCommand; - } - } - return nStatus; -} - - -/// @cond HIDDEN_SYMBOLS - -/** - * @brief The interrupt service routines of PWM - * @param[in] pvParam IRQ Parameter(not use in PWM) - */ -VOID pwmISR(PVOID pvParam) -{ - INT i; - - UINT32 uRegisterValue = 0; - uRegisterValue = inpw(REG_PWM_PIIR);// Get PIIR value - for (i = 0; i < PWM_TIMER_NUM ; i++) - { - if (uRegisterValue & (1 << i)) - { - bPWMIntFlag[i] = 1; - outpw(REG_PWM_PIIR, (1 << i)); - } - } -} - -/** - * @brief This function set corresponding GPIO as PWM function according to the - * parameter nTimerIdentity - * @param[in] nTimerIdentity Timer channel number - * @retval Successful PWM init GPIO successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidPin PWM output pin setting error - */ -static INT pwmInitGPIO(const INT nTimerIdentity, const INT nValue) -{ - UINT temp = 0; - - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - - if (nTimerIdentity == PWM_TIMER0) - { - if (nValue == PWM0_GPA12) - { - temp = inpw(REG_SYS_GPA_MFPH); - temp = (temp & ~0x000F0000) | 0xD0000; - outpw(REG_SYS_GPA_MFPH, temp); - } - else if (nValue == PWM0_GPB2) - { - temp = inpw(REG_SYS_GPB_MFPL); - temp = (temp & ~0xF00) | 0xD00; - outpw(REG_SYS_GPB_MFPL, temp); - } - else - return pwmInvalidPin; - } - else if (nTimerIdentity == PWM_TIMER1) - { - if (nValue == PWM1_GPA13) - { - temp = inpw(REG_SYS_GPA_MFPH); - temp = (temp & ~0x00F00000) | 0xD00000; - outpw(REG_SYS_GPA_MFPH, temp); - } - else if (nValue == PWM1_GPB3) - { - temp = inpw(REG_SYS_GPB_MFPL); - temp = (temp & ~0xF000) | 0xD000; - outpw(REG_SYS_GPB_MFPL, temp); - } - else - return pwmInvalidPin; - } - else if (nTimerIdentity == PWM_TIMER2) - { - if (nValue == PWM2_GPA14) - { - temp = inpw(REG_SYS_GPA_MFPH); - temp = (temp & ~0x0F000000) | 0xD000000; - outpw(REG_SYS_GPA_MFPH, temp); - } - else if (nValue == PWM2_GPH2) - { - temp = inpw(REG_SYS_GPH_MFPL); - temp = (temp & ~0xF00) | 0xD00; - outpw(REG_SYS_GPH_MFPL, temp); - } - else - return pwmInvalidPin; - } - else - { - if (nValue == PWM3_GPA15) - { - temp = inpw(REG_SYS_GPA_MFPH); - temp = (temp & ~0xF0000000) | 0xD0000000; - outpw(REG_SYS_GPA_MFPH, temp); - } - else if (nValue == PWM3_GPH3) - { - temp = inpw(REG_SYS_GPH_MFPL); - temp = (temp & ~0xF000) | 0xD000; - outpw(REG_SYS_GPH_MFPL, temp); - } - else - return pwmInvalidPin; - } - - return Successful; -} - - -/** - * @brief This function initiates PWM timer n and set the default setting to CSR, - * PPR, PCR, CNR, CMR - * @param[in] nTimerIdentity Timer channel number - * @retval Successful PWM init timer successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -static INT pwmInitTimer(const INT nTimerIdentity) -{ - typePPR PWMPPR; - INT nStatus; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// nTimerIdentity value error - } - - //Set CSR - nStatus = pwmSetCSR(nTimerIdentity, DEFAULT_CSR); - - if (nStatus != Successful) - { - return nStatus; - } - - //Set PPR - PWMPPR.value = (UINT)inpw(REG_PWM_PPR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - if (PWMPPR.field.cp0 == 0) - { - pwmSetCP(nTimerIdentity, DEFAULT_CP); - } - break; - } - case PWM_TIMER1: - { - if (PWMPPR.field.cp0 == 0) - { - pwmSetCP(nTimerIdentity, DEFAULT_CP); - } - break; - } - case PWM_TIMER2: - { - if (PWMPPR.field.cp1 == 0) - { - pwmSetCP(nTimerIdentity, DEFAULT_CP); - } - break; - } - case PWM_TIMER3: - { - if (PWMPPR.field.cp1 == 0) - { - pwmSetCP(nTimerIdentity, DEFAULT_CP); - } - break; - } - } - - //Set PCR - nStatus = pwmSetMode(nTimerIdentity, DEFAULT_MODE); - - if (nStatus != Successful) - { - return nStatus; - } - bPWMTimerMode[nTimerIdentity] = DEFAULT_MODE; - - //Set CMR - nStatus = pwmSetCMR(nTimerIdentity, DEFAULT_CMR); - - if (nStatus != Successful) - { - return nStatus; - } - - //Set CNR - nStatus = pwmSetCNR(nTimerIdentity, DEFAULT_CNR); - - if (nStatus != Successful) - { - return nStatus; - } - - return Successful; - -} - - -/** - * @brief This function starts PWM timer according to the parameter - * @param[in] nTimerIdentity Timer channel number - * @retval Successful PWM start timer successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -static INT pwmStartTimer(const INT nTimerIdentity) -{ - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - pwmSetTimerState(nTimerIdentity, PWM_ENABLE); - if (bPWMTimerMode[nTimerIdentity] == PWM_TOGGLE) - { - bPWMTimerStartStatus[nTimerIdentity] = TRUE; - } - - return Successful; -} - -/** - * @brief This function stops PWM timer n using method 1, 2, or 3 according to the - * parameter nTimerIdentity and nStatus - * @param[in] nTimerIdentity Timer channel number - * @param[in] nMethod Stop PWM timer method - * @retval Successful PWM stop timer successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidStopMethod Stop method error - */ -static INT pwmStopTimer(const INT nTimerIdentity, INT nMethod) -{ - typeCNR PWMCNR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - // Timer_num value error - return pwmInvalidTimerChannel; - } - //Can't stop before open PWM timer - if (bPWMTimerOpenStatus[nTimerIdentity] == FALSE) - { - return Successful; - } - // one shot mode didn't need stop procedure - if (bPWMTimerMode[nTimerIdentity] == PWM_ONESHOT) - { - return Successful; - } - // Timer stop already, no need to stop again - if (bPWMTimerStartStatus[nTimerIdentity] == FALSE) - { - return Successful; - } - - // Set CNR as 0 - PWMCNR.field.cnr = 0; - outpw(REG_PWM_CNR0 + (PWM_OFFSET * nTimerIdentity), PWMCNR.value); - - switch (nMethod) - { - case PWM_STOP_METHOD1: - { - while (1) - { - if (pwmGetPDR(nTimerIdentity) == 0) // Wait PDR reach to 0 - { - pwmSetTimerState(nTimerIdentity, PWM_DISABLE);// Disable pwm timer - bPWMIntFlag[nTimerIdentity] = FALSE; - bPWMTimerStartStatus[nTimerIdentity] = FALSE; - break; - } - } - break; - } - case PWM_STOP_METHOD2: - { - while (1) - { - if (bPWMIntFlag[nTimerIdentity] == TRUE) // Wait interrupt happen - { - pwmSetTimerState(nTimerIdentity, PWM_DISABLE);// Disable pwm timer - bPWMIntFlag[nTimerIdentity] = FALSE; - bPWMTimerStartStatus[nTimerIdentity] = FALSE; - break; - } - } - break; - } - /*case PWM_STOP_METHOD3: - { - pwmSetPCRState(nTimerIdentity, PWM_DISABLE);// Disable pwm timer - bPWMIntFlag[nTimerIdentity] = FALSE; - bPWMTimerStartStatus[nTimerIdentity] = FALSE; - break; - }*/ - default: - { - return pwmInvalidStopMethod;// Stop method value error - } - } - - return Successful; -} - -/** - * @brief This function set CPn value according to the parameter nTimerIdentity and nValue - * @param[in] nTimerIdentity Timer channel number - * @param[in] nValue The value which want to set in CSRn - * @retval Successful Set CPn successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidCPValue PWM_PPR CPn value out of range - */ -static INT pwmSetCP(const INT nTimerIdentity, const INT nValue) -{ - typePPR PWMPPR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nValue < CP_MIN || nValue > CP_MAX) - { - return pwmInvalidCPValue;// CP value error - } - PWMPPR.value = (UINT)inpw(REG_PWM_PPR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - PWMPPR.field.cp0 = nValue; - break; - } - case PWM_TIMER1: - { - PWMPPR.field.cp0 = nValue; - break; - } - case PWM_TIMER2: - { - PWMPPR.field.cp1 = nValue; - break; - } - case PWM_TIMER3: - { - PWMPPR.field.cp1 = nValue; - break; - } - } - outpw(REG_PWM_PPR, PWMPPR.value); - - return Successful; -} - -/** - * @brief This function set DZIn value according to the parameter nTimerIdentity and nValue - * @param[in] nTimerIdentity Timer channel number - * @param[in] nValue The value which want to set in DZIn - * @retval Successful Set DZIn successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidDZIValue PWM_PPR DZIn value out of range - */ -static INT pwmSetDZI(const INT nTimerIdentity, const INT nValue) -{ - typePPR PWMPPR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nValue < DZI_MIN || nValue > DZI_MAX) - { - return pwmInvalidDZIValue;// CSR value error - } - PWMPPR.value = (UINT)inpw(REG_PWM_PPR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - PWMPPR.field.dzi0 = nValue; - break; - } - case PWM_TIMER1: - { - PWMPPR.field.dzi0 = nValue; - break; - } - case PWM_TIMER2: - { - PWMPPR.field.dzi1 = nValue; - break; - } - case PWM_TIMER3: - { - PWMPPR.field.dzi1 = nValue; - break; - } - } - outpw(REG_PWM_PPR, PWMPPR.value); - - return Successful; -} - -/** - * @brief This function set CSRn value according to the parameter nTimerIdentity and nValue - * @param[in] nTimerIdentity Timer channel number - * @param[in] nValue The value which want to set in CSRn - * @retval Successful Set CSRn successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -static INT pwmSetCSR(const INT nTimerIdentity, const INT nValue) -{ - typeCSR PWMCSR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nValue < CSR_MIN || nValue > CSR_MAX) - { - return pwmInvalidCSRValue;// CSR value error - } - PWMCSR.value = (UINT)inpw(REG_PWM_CSR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - PWMCSR.field.csr0 = nValue; - break; - } - case PWM_TIMER1: - { - PWMCSR.field.csr1 = nValue; - break; - } - case PWM_TIMER2: - { - PWMCSR.field.csr2 = nValue; - break; - } - case PWM_TIMER3: - { - PWMCSR.field.csr3 = nValue; - break; - } - } - outpw(REG_PWM_CSR, PWMCSR.value); - - return Successful; -} - -/** - * @brief This function enable/disable PWM channel n dead zone function according to the - * parameter nTimerIdentity and nStatus - * @param[in] nTimerIdentity Timer channel number - * @param[in] nStatus PWMDZG_ENABLE/PWMDZG_DISABLE - * @retval Successful Set dead zone successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidDZGStatus PWM Dead-Zone Generator enable/disable status error - */ -static INT pwmSetDZGenerator(const INT nTimerIdentity, INT nStatus) -{ - typePCR PWMPCR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nStatus != PWMDZG_ENABLE && nStatus != PWMDZG_DISABLE) - { - return pwmInvalidDZGStatus;// PCR inverter value error - } - PWMPCR.value = (UINT)inpw(REG_PWM_PCR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - PWMPCR.field.grpup0_dzen = nStatus; - break; - } - case PWM_TIMER1: - { - PWMPCR.field.grpup0_dzen = nStatus; - break; - } - case PWM_TIMER2: - { - PWMPCR.field.grpup1_dzen = nStatus; - break; - } - case PWM_TIMER3: - { - PWMPCR.field.grpup1_dzen = nStatus; - break; - } - } - outpw(REG_PWM_PCR, PWMPCR.value); - - return Successful; -} - -/** - * @brief This function set PWM channel n enable/disable according to the - * parameter nTimerIdentity and nStatus - * @param[in] nTimerIdentity Timer channel number - * @param[in] nStatus PWM_ENABLE/PWMDISABLE - * @retval Successful Set channel enable/disable successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -static INT pwmSetTimerState(const INT nTimerIdentity, INT nStatus) -{ - typePCR PWMPCR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nStatus != PWM_ENABLE && nStatus != PWM_DISABLE) - { - return pwmInvalidTimerStatus; - } - PWMPCR.value = (UINT)inpw(REG_PWM_PCR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - PWMPCR.field.ch0_en = nStatus; - break; - } - case PWM_TIMER1: - { - PWMPCR.field.ch1_en = nStatus; - break; - } - case PWM_TIMER2: - { - PWMPCR.field.ch2_en = nStatus; - break; - } - case PWM_TIMER3: - { - PWMPCR.field.ch3_en = nStatus; - break; - } - } - outpw(REG_PWM_PCR, PWMPCR.value); - - return Successful; -} - - -/** - * @brief This function set PWM channel n inverter on/off according to the - * parameter nTimerIdentity and nStatus - * @param[in] nTimerIdentity Timer channel number - * @param[in] nStatus PWM_ENABLE/PWM_DISABLE - * @retval Successful Set inverter successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidInverterValue Inverter value error - */ -static INT pwmSetInverter(const INT nTimerIdentity, INT nStatus) -{ - typePCR PWMPCR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nStatus != PWM_INVON && nStatus != PWM_INVOFF) - { - return pwmInvalidInverterValue;// PCR inverter value error - } - PWMPCR.value = (UINT)inpw(REG_PWM_PCR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - PWMPCR.field.ch0_inverter = nStatus; - break; - } - case PWM_TIMER1: - { - PWMPCR.field.ch1_inverter = nStatus; - break; - } - case PWM_TIMER2: - { - PWMPCR.field.ch2_inverter = nStatus; - break; - } - case PWM_TIMER3: - { - PWMPCR.field.ch3_inverter = nStatus; - break; - } - } - outpw(REG_PWM_PCR, PWMPCR.value); - - return Successful; -} - -/** - * @brief This function set PWM channel n toggle/one shot mode according to the - * parameter nTimerIdentity and nStatus - * @param[in] nTimerIdentity Timer channel number - * @param[in] nStatus PWM_TOGGLE/PWM_ONESHOT - * @retval Successful Set operation mode successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidModeStatus Operating mode error - */ -static INT pwmSetMode(const INT nTimerIdentity, INT nStatus) -{ - typePCR PWMPCR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nStatus != PWM_TOGGLE && nStatus != PWM_ONESHOT) - { - return pwmInvalidModeStatus;// PCR inverter value error - } - PWMPCR.value = (UINT)inpw(REG_PWM_PCR); - switch (nTimerIdentity) - { - case PWM_TIMER0: - { - PWMPCR.field.ch0_mode = nStatus; - break; - } - case PWM_TIMER1: - { - PWMPCR.field.ch1_mode = nStatus; - break; - } - case PWM_TIMER2: - { - PWMPCR.field.ch2_mode = nStatus; - break; - } - case PWM_TIMER3: - { - PWMPCR.field.ch3_mode = nStatus; - break; - } - } - outpw(REG_PWM_PCR, PWMPCR.value); - bPWMTimerMode[nTimerIdentity] = nStatus; - - return Successful; -} - - -/** - * @brief This function set PWM_CNRn value according to the parameter nTimerIdentity and nValue - * @param[in] nTimerIdentity Timer channel number - * @param[in] nValue CNR value - * @retval Successful Set CNR successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidCNRValue Invalid CNR value - */ -static INT pwmSetCNR(const INT nTimerIdentity, INT nValue) -{ - typeCNR PWMCNR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nValue < CNR_MIN || nValue > CNR_MAX) - { - return pwmInvalidCNRValue;// PCR inverter value error - } - PWMCNR.field.cnr = nValue; - outpw(REG_PWM_CNR0 + (PWM_OFFSET * nTimerIdentity), PWMCNR.value); - - return Successful; -} - -/** - * @brief This function set PWM_CMRn value according to the parameter nTimerIdentity and nValue - * @param[in] nTimerIdentity Timer channel number - * @param[in] nValue CMR value - * @retval Successful Set CMR successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval pwmInvalidCMRValue Invalid CMR value - */ -static INT pwmSetCMR(const INT nTimerIdentity, INT nValue) -{ - typeCMR PWMCMR; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - if (nValue < CMR_MIN || nValue > CMR_MAX) - { - return pwmInvalidCMRValue;// CMR value error - } - PWMCMR.field.cmr = nValue; - outpw(REG_PWM_CMR0 + (PWM_OFFSET * nTimerIdentity), PWMCMR.value); - - return Successful; -} - -/** - * @brief This function return the PDR value of PWM timer n - * @param[in] nTimerIdentity Timer channel number - * @retval pwmInvalidTimerChannel PWM Timer channel number error - * @retval Others Current PDR value - */ -static UINT pwmGetPDR(const INT nTimerIdentity) -{ - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - else - { - return (UINT)inpw(REG_PWM_PDR0 + (PWM_OFFSET * nTimerIdentity)); // Return PDR value - } -} - -/** - * @brief This function set the PIERn bit of PWM timer n as 1 or 0 according to the - * parameter nTimerIdentity and nValue - * @param[in] nTimerIdentity Timer channel number - * @param[in] nValue PWM_ENABLE/PWM_DISABLE - * @retval Successful Set PIER successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -static INT pwmSetPIER(const INT nTimerIdentity, INT nValue) -{ - UINT uRegisterValue = 0;; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// Timer_num value error - } - else - { - uRegisterValue = (UINT)inpw(REG_PWM_PIER); - if (nValue == PWM_ENABLE) - { - uRegisterValue = uRegisterValue | (1 << nTimerIdentity); // Set PIER - } - else - { - uRegisterValue = uRegisterValue & (0 << nTimerIdentity); // Clear PIER - } - outpw(REG_PWM_PIER, uRegisterValue);// Write value to PIER - - return Successful; - } -} - - -/** - * @brief This function clear PIIRn bit according to the parameter nTimerIdentity - * @param[in] nTimerIdentity Timer channel number - * @retval Successful Clear PIIR successfully - * @retval pwmInvalidTimerChannel PWM Timer channel number error - */ -static INT pwmCleanPIIR(const INT nTimerIdentity) -{ - UINT uRegisterValue = 0; - if (nTimerIdentity < PWM_TIMER_MIN || nTimerIdentity > PWM_TIMER_MAX) - { - return pwmInvalidTimerChannel;// nTimerIdentity value error - } - uRegisterValue = (UINT)inpw(REG_PWM_PIIR); - uRegisterValue = uRegisterValue & ~(1 << nTimerIdentity); - outpw(REG_PWM_PIIR, uRegisterValue); - - return Successful; -} - -/// @endcond /* HIDDEN_SYMBOLS */ - -/*@}*/ /* end of group N9H30_PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_PWM_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_rtc.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_rtc.c deleted file mode 100644 index 4ec0cdf5068..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_rtc.c +++ /dev/null @@ -1,1153 +0,0 @@ -/**************************************************************************//** -* @file RTC.c -* @brief N9H30 RTC driver source file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_rtc.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup N9H30_RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/// @cond HIDDEN_SYMBOLS - -static CHAR g_chHourMode = 0; -static BOOL volatile g_bIsEnableTickInt = FALSE; -static BOOL volatile g_bIsEnableAlarmInt = FALSE; - -static UINT32 volatile g_u32Reg, g_u32Reg1, g_u32hiYear, g_u32loYear, g_u32hiMonth, g_u32loMonth, g_u32hiDay, g_u32loDay; -static UINT32 volatile g_u32hiHour, g_u32loHour, g_u32hiMin, g_u32loMin, g_u32hiSec, g_u32loSec; -UINT32 volatile i, Wait; - -VOID RTC_Check(void) -{ - i = 0; - - Wait = inp32(REG_RTC_INTSTS) & RTC_INTSTS_REGWRBUSY_Msk; - - while (Wait == RTC_INTSTS_REGWRBUSY_Msk) - { - - Wait = inp32(REG_RTC_INTSTS) & RTC_INTSTS_REGWRBUSY_Msk; - - i++; - - if (i > RTC_WAIT_COUNT) - { - break; - } - } -} - -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief Set 32k Frequency Compensation Data - * - * @param[in] i32FrequencyX100 Specify the RTC clock X100, ex: 3277365 means 32773.65. - * - * @return E_RTC_ERR_FCR_VALUE Wrong Compensation VALUE - * E_RTC_SUCCESS Success - * - * @details This API is used to compensate the 32 kHz frequency by current LXT frequency for RTC application. - */ -UINT32 RTC_DoFrequencyCompensation(INT32 i32FrequencyX100) -{ - INT32 i32RegInt, i32RegFra; - UINT32 u32Reg; - - /* Compute integer and fraction for RTC FCR register */ - i32RegInt = (i32FrequencyX100 / 100) - RTC_FCR_REFERENCE; - i32RegFra = (((i32FrequencyX100 % 100)) * 60) / 100; - - /* Judge Integer part is reasonable */ - if ((i32RegInt < 0) | (i32RegInt > 15)) - { - return E_RTC_ERR_FCR_VALUE; - } - - u32Reg = (uint32_t)((i32RegInt << 8) | i32RegFra); - - RTC_WriteEnable(1); - outp32(REG_RTC_FREQADJ, u32Reg); - RTC_Check(); - - return E_RTC_SUCCESS; -} - -/** - * @brief RTC access register enable - * - * @param[in] bEnable 1: Enable access register - * 0: Disable access register - * - * @retval E_RTC_ERR_EIO Time-out error - * @retval E_RTC_SUCCESS Success - * - */ -UINT32 RTC_WriteEnable(BOOL bEnable) -{ - INT32 volatile i32i; - - RTC_Check(); - - if (bEnable) - { - outp32(REG_RTC_RWEN, RTC_WRITE_KEY); - RTC_Check(); - - for (i32i = 0 ; i32i < RTC_WAIT_COUNT ; i32i++) - { - /*-------------------------------------------------------------------------------------------------*/ - /* check RTC_RWEN[16] to find out RTC write enable */ - /*-------------------------------------------------------------------------------------------------*/ - if (inp32(REG_RTC_RWEN) & 0x10000) - { - break; - } - } - - if (i32i == RTC_WAIT_COUNT) - { - //sysprintf ("\nRTC: 3, set write enable FAILED!\n"); - - return E_RTC_ERR_EIO; - } - } - else - { - for (i32i = 0 ; i32i < RTC_WAIT_COUNT ; i32i++) - { - if (inp32(REG_RTC_RWEN) == 0) - { - break; - } - } - } - - return E_RTC_SUCCESS; -} - -/** - * @brief Initial RTC and install ISR - * @retval E_RTC_ERR_EIO Initial RTC time-out - * @retval E_RTC_SUCCESS Success - * - */ -UINT32 RTC_Init(void) -{ - INT32 i32i; - - /*-----------------------------------------------------------------------------------------------------*/ - /* When RTC is power on, write 0xa5eb1357 to RTC_INIR to reset all logic. */ - /*-----------------------------------------------------------------------------------------------------*/ - - outp32(REG_RTC_INIT, RTC_INIT_KEY); - RTC_Check(); - - for (i32i = 0 ; i32i < RTC_WAIT_COUNT ; i32i++) - { - if (inp32(REG_RTC_INIT) & 0x01) - { - /* Check RTC_INIR[0] to find out RTC reset signal */ - break; - } - } - - if (i32i == RTC_WAIT_COUNT) - { - return E_RTC_ERR_EIO; - } - - /*-----------------------------------------------------------------------------------------------------*/ - /* Install RTC ISR */ - /*-----------------------------------------------------------------------------------------------------*/ - - outp32(REG_RTC_RWEN, RTC_WRITE_KEY); - RTC_Check(); - - for (i32i = 0 ; i32i < RTC_WAIT_COUNT ; i32i++) - { - /*-------------------------------------------------------------------------------------------------*/ - /* check RTC_RWEN[16] to find out RTC write enable */ - /*-------------------------------------------------------------------------------------------------*/ - if (inp32(REG_RTC_RWEN) & 0x10000) - { - break; - } - } - - if (i32i == RTC_WAIT_COUNT) - { - return E_RTC_ERR_EIO; - } - - return E_RTC_SUCCESS; -} - -/** - * @brief Set Current Timer - * - * @param[in] *sPt Specify the time property and current time. It includes: - * - u8cClockDisplay: \ref RTC_CLOCK_12 / \ref RTC_CLOCK_24 - * - u8cAmPm: \ref RTC_AM / \ref RTC_PM - * - u32cSecond: Second value - * - u32cMinute: Minute value - * - u32cHour: Hour value - * - u32cDayOfWeek: Day of week - * - u32cDay: Day value - * - u32cMonth: Month value - * - u32Year: Year value - * - u32AlarmMaskSecond: Mask second alarm - * - u32AlarmMaskMinute: Mask minute alarm - * - u32AlarmMaskHour: Mask hour alarm - * - *pfnAlarmCallBack: Call back function - * - * @retval E_RTC_ERR_EIO Initial RTC time-out - * @retval E_RTC_SUCCESS Success - * - */ -UINT32 RTC_Open(S_RTC_TIME_DATA_T *sPt) -{ - UINT32 volatile u32Reg; - - /*-----------------------------------------------------------------------------------------------------*/ - /* DO BASIC JUDGEMENT TO Check RTC time data value is reasonable or not. */ - /*-----------------------------------------------------------------------------------------------------*/ - if (((sPt->u32Year - RTC_YEAR2000) > 99) | - ((sPt->u32cMonth == 0) || (sPt->u32cMonth > 12)) | - ((sPt->u32cDay == 0) || (sPt->u32cDay > 31))) - { - return E_RTC_ERR_CALENDAR_VALUE; - } - - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - if ((sPt->u32cHour == 0) || (sPt->u32cHour > 12)) - { - return E_RTC_ERR_TIMESACLE_VALUE ; - } - } - else if (sPt->u8cClockDisplay == RTC_CLOCK_24) - { - if (sPt->u32cHour > 23) - { - return E_RTC_ERR_TIMESACLE_VALUE ; - } - } - else - { - return E_RTC_ERR_TIMESACLE_VALUE ; - } - - if ((sPt->u32cMinute > 59) | - (sPt->u32cSecond > 59) | - (sPt->u32cSecond > 59)) - { - return E_RTC_ERR_TIME_VALUE ; - } - if (sPt->u32cDayOfWeek > 6) - { - return E_RTC_ERR_DWR_VALUE ; - } - - /*-----------------------------------------------------------------------------------------------------*/ - /* Second, set RTC time data. */ - /*-----------------------------------------------------------------------------------------------------*/ - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - g_chHourMode = RTC_CLOCK_12; - - RTC_WriteEnable(1); - outp32(REG_RTC_TIMEFMT, RTC_CLOCK_12); - RTC_Check(); - - /*-------------------------------------------------------------------------------------------------*/ - /* important, range of 12-hour PM mode is 21 upto 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u8cAmPm == RTC_PM) - sPt->u32cHour += 20; - } - else /* RTC_CLOCK_24 */ - { - g_chHourMode = RTC_CLOCK_24; - - RTC_WriteEnable(1); - outp32(REG_RTC_TIMEFMT, RTC_CLOCK_24); - RTC_Check(); - } - - - g_u32hiHour = sPt->u32cHour / 10; - g_u32loHour = sPt->u32cHour % 10; - g_u32hiMin = sPt->u32cMinute / 10; - g_u32loMin = sPt->u32cMinute % 10; - g_u32hiSec = sPt->u32cSecond / 10; - g_u32loSec = sPt->u32cSecond % 10; - u32Reg = (g_u32hiHour << 20); - u32Reg |= (g_u32loHour << 16); - u32Reg |= (g_u32hiMin << 12); - u32Reg |= (g_u32loMin << 8); - u32Reg |= (g_u32hiSec << 4); - u32Reg |= g_u32loSec; - g_u32Reg = u32Reg; - - RTC_WriteEnable(1); - outp32(REG_RTC_TIME, (UINT32)g_u32Reg); - RTC_Check(); - - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - if (sPt->u8cAmPm == RTC_PM) - sPt->u32cHour -= 20; - } - - g_u32hiYear = (sPt->u32Year - RTC_YEAR2000) / 10; - g_u32loYear = (sPt->u32Year - RTC_YEAR2000) % 10; - g_u32hiMonth = sPt->u32cMonth / 10; - g_u32loMonth = sPt->u32cMonth % 10; - g_u32hiDay = sPt->u32cDay / 10; - g_u32loDay = sPt->u32cDay % 10; - u32Reg = (g_u32hiYear << 20); - u32Reg |= (g_u32loYear << 16); - u32Reg |= (g_u32hiMonth << 12); - u32Reg |= (g_u32loMonth << 8); - u32Reg |= (g_u32hiDay << 4); - u32Reg |= g_u32loDay; - g_u32Reg = u32Reg; - - RTC_WriteEnable(1); - outp32(REG_RTC_CAL, (UINT32)g_u32Reg); - RTC_Check(); - - RTC_WriteEnable(1); - outp32(REG_RTC_WEEKDAY, (UINT32)sPt->u32cDayOfWeek); - RTC_Check(); - - return E_RTC_SUCCESS; -} - - -/** - * @brief Read current date/time or alarm date/time from RTC - * - * @param[in] eTime \ref RTC_CURRENT_TIME / \ref RTC_ALARM_TIME - * @param[out] *sPt Specify the time property and current time. It includes: - * - u8cClockDisplay: \ref RTC_CLOCK_12 / \ref RTC_CLOCK_24 - * - u8cAmPm: \ref RTC_AM / \ref RTC_PM - * - u32cSecond: Second value - * - u32cMinute: Minute value - * - u32cHour: Hour value - * - u32cDayOfWeek: Day of week - * - u32cDay: Day value - * - u32cMonth: Month value - * - u32Year: Year value - * - u32AlarmMaskSecond: Mask second alarm - * - u32AlarmMaskMinute: Mask minute alarm - * - u32AlarmMaskHour: Mask hour alarm - * - *pfnAlarmCallBack: Call back function - * - * @retval E_RTC_ERR_ENOTTY Wrong select time - * @retval E_RTC_SUCCESS Success - * - */ -UINT32 RTC_Read(E_RTC_TIME_SELECT eTime, S_RTC_TIME_DATA_T *sPt) -{ - UINT32 u32Tmp; - - sPt->u8cClockDisplay = inp32(REG_RTC_TIMEFMT); /* 12/24-hour */ - sPt->u32cDayOfWeek = inp32(REG_RTC_WEEKDAY); /* Day of week */ - - switch (eTime) - { - case RTC_CURRENT_TIME: - { - g_u32Reg = inp32(REG_RTC_CAL); - g_u32Reg1 = inp32(REG_RTC_TIME); - break; - } - case RTC_ALARM_TIME: - { - g_u32Reg = inp32(REG_RTC_CALM); - g_u32Reg1 = inp32(REG_RTC_TALM); - break; - } - default: - { - return E_RTC_ERR_ENOTTY; - } - } - - g_u32hiYear = (g_u32Reg & 0xF00000) >> 20; - g_u32loYear = (g_u32Reg & 0xF0000) >> 16; - g_u32hiMonth = (g_u32Reg & 0x1000) >> 12; - g_u32loMonth = (g_u32Reg & 0xF00) >> 8; - g_u32hiDay = (g_u32Reg & 0x30) >> 4; - g_u32loDay = g_u32Reg & 0xF; - - u32Tmp = (g_u32hiYear * 10); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + RTC_YEAR2000; - - u32Tmp = (g_u32hiMonth * 10); - sPt->u32cMonth = u32Tmp + g_u32loMonth; - - u32Tmp = (g_u32hiDay * 10); - sPt->u32cDay = u32Tmp + g_u32loDay; - - g_u32hiHour = (g_u32Reg1 & 0x300000) >> 20; - g_u32loHour = (g_u32Reg1 & 0xF0000) >> 16; - g_u32hiMin = (g_u32Reg1 & 0x7000) >> 12; - g_u32loMin = (g_u32Reg1 & 0xF00) >> 8; - g_u32hiSec = (g_u32Reg1 & 0x70) >> 4; - g_u32loSec = g_u32Reg1 & 0xF; - - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10); - u32Tmp += g_u32loHour; - sPt->u32cHour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (eTime == RTC_CURRENT_TIME) - { - if (sPt->u32cHour >= 21) - { - sPt->u8cAmPm = RTC_PM; - sPt->u32cHour -= 20; - } - else - { - sPt->u8cAmPm = RTC_AM; - } - } - else - { - if (sPt->u32cHour < 12) - { - if (sPt->u32cHour == 0) - sPt->u32cHour = 12; - sPt->u8cAmPm = RTC_AM; - } - else - { - sPt->u32cHour -= 12; - sPt->u8cAmPm = RTC_PM; - } - } - - u32Tmp = (g_u32hiMin * 10); - u32Tmp += g_u32loMin; - sPt->u32cMinute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10); - u32Tmp += g_u32loSec; - sPt->u32cSecond = u32Tmp; - - } - else - { - /* RTC_CLOCK_24 */ - u32Tmp = (g_u32hiHour * 10); - u32Tmp += g_u32loHour; - sPt->u32cHour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10); - u32Tmp += g_u32loMin; - sPt->u32cMinute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10); - u32Tmp += g_u32loSec; - sPt->u32cSecond = u32Tmp; - } - - return E_RTC_SUCCESS; - -} - - -/** - * @brief Write current date/time or alarm date/time from RTC - * - * @param[in] eTime \ref RTC_CURRENT_TIME / \ref RTC_ALARM_TIME - * @param[in] *sPt Specify the time property and current time. It includes: - * - u8cClockDisplay: \ref RTC_CLOCK_12 / \ref RTC_CLOCK_24 - * - u8cAmPm: \ref RTC_AM / \ref RTC_PM - * - u32cSecond: Second value - * - u32cMinute: Minute value - * - u32cHour: Hour value - * - u32cDayOfWeek: Day of week - * - u32cDay: Day value - * - u32cMonth: Month value - * - u32Year: Year value - * - u32AlarmMaskSecond: Mask second alarm - * - u32AlarmMaskMinute: Mask minute alarm - * - u32AlarmMaskHour: Mask hour alarm - * - *pfnAlarmCallBack: Call back function - * - * @retval E_RTC_ERR_ENOTTY Wrong select time - * @retval E_RTC_ERR_CALENDAR_VALUE Wrong calender value - * @retval E_RTC_ERR_TIME_VALUE Wrong time value - * @retval E_RTC_ERR_DWR_VALUE Wrong day of week value - * @retval E_RTC_SUCCESS Success - * - */ -UINT32 RTC_Write(E_RTC_TIME_SELECT eTime, S_RTC_TIME_DATA_T *sPt) -{ - UINT32 u32Reg; - - /*-----------------------------------------------------------------------------------------------------*/ - /* Check RTC time data value is reasonable or not. */ - /*-----------------------------------------------------------------------------------------------------*/ - if (((sPt->u32Year - RTC_YEAR2000) > 99) | - ((sPt->u32cMonth == 0) || (sPt->u32cMonth > 12)) | - ((sPt->u32cDay == 0) || (sPt->u32cDay > 31))) - { - return E_RTC_ERR_CALENDAR_VALUE; - } - - if ((sPt->u32Year - RTC_YEAR2000) > 99) - { - return E_RTC_ERR_CALENDAR_VALUE; - } - - if ((sPt->u32cMonth == 0) || (sPt->u32cMonth > 12)) - { - return E_RTC_ERR_CALENDAR_VALUE; - } - - if ((sPt->u32cDay == 0) || (sPt->u32cDay > 31)) - { - return E_RTC_ERR_CALENDAR_VALUE; - } - - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - if ((sPt->u32cHour == 0) || (sPt->u32cHour > 12)) - { - return E_RTC_ERR_TIME_VALUE; - } - } - else if (sPt->u8cClockDisplay == RTC_CLOCK_24) - { - if (sPt->u32cHour > 23) - { - return E_RTC_ERR_TIME_VALUE; - } - } - else - { - return E_RTC_ERR_TIME_VALUE; - } - - if (sPt->u32cMinute > 59) - { - return E_RTC_ERR_TIME_VALUE; - } - - if (sPt->u32cSecond > 59) - { - return E_RTC_ERR_TIME_VALUE; - } - - if (sPt->u32cDayOfWeek > 6) - { - return E_RTC_ERR_DWR_VALUE; - } - - switch (eTime) - { - - case RTC_CURRENT_TIME: - { - /*---------------------------------------------------------------------------------------------*/ - /* Second, set RTC time data. */ - /*---------------------------------------------------------------------------------------------*/ - - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - g_chHourMode = RTC_CLOCK_12; - - RTC_WriteEnable(1); - outp32(REG_RTC_TIMEFMT, RTC_CLOCK_12); - RTC_Check(); - - /*-----------------------------------------------------------------------------------------*/ - /* important, range of 12-hour PM mode is 21 upto 32 */ - /*-----------------------------------------------------------------------------------------*/ - if (sPt->u8cAmPm == RTC_PM) - { - sPt->u32cHour += 20; - } - } - else /* RTC_CLOCK_24 */ - { - g_chHourMode = RTC_CLOCK_24; - - RTC_WriteEnable(1); - outp32(REG_RTC_TIMEFMT, RTC_CLOCK_24); - RTC_Check(); - - } - - g_u32hiHour = sPt->u32cHour / 10; - g_u32loHour = sPt->u32cHour % 10; - g_u32hiMin = sPt->u32cMinute / 10; - g_u32loMin = sPt->u32cMinute % 10; - g_u32hiSec = sPt->u32cSecond / 10; - g_u32loSec = sPt->u32cSecond % 10; - - u32Reg = (g_u32hiHour << 20); - u32Reg |= (g_u32loHour << 16); - u32Reg |= (g_u32hiMin << 12); - u32Reg |= (g_u32loMin << 8); - u32Reg |= (g_u32hiSec << 4); - u32Reg |= g_u32loSec; - g_u32Reg = u32Reg; - - RTC_WriteEnable(1); - outp32(REG_RTC_TIME, (UINT32)g_u32Reg); - RTC_Check(); - - g_u32hiYear = (sPt->u32Year - RTC_YEAR2000) / 10; - g_u32loYear = (sPt->u32Year - RTC_YEAR2000) % 10; - g_u32hiMonth = sPt->u32cMonth / 10; - g_u32loMonth = sPt->u32cMonth % 10; - g_u32hiDay = sPt->u32cDay / 10; - g_u32loDay = sPt->u32cDay % 10; - - u32Reg = (g_u32hiYear << 20); - u32Reg |= (g_u32loYear << 16); - u32Reg |= (g_u32hiMonth << 12); - u32Reg |= (g_u32loMonth << 8); - u32Reg |= (g_u32hiDay << 4); - u32Reg |= g_u32loDay; - g_u32Reg = u32Reg; - - RTC_WriteEnable(1); - outp32(REG_RTC_CAL, (UINT32)g_u32Reg); - RTC_Check(); - - RTC_WriteEnable(1); - outp32(REG_RTC_WEEKDAY, (UINT32) sPt->u32cDayOfWeek); - RTC_Check(); - - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - if (sPt->u8cAmPm == RTC_PM) - { - sPt->u32cHour -= 20; - } - } - - return E_RTC_SUCCESS; - - } - case RTC_ALARM_TIME: - { - RTC_WriteEnable(1); - outp32(REG_RTC_PWRCTL, inp32(REG_RTC_PWRCTL) & ~RTC_PWRCTL_ALARM_EN_Msk); - RTC_Check(); - - /*---------------------------------------------------------------------------------------------*/ - /* Second, set alarm time data. */ - /*---------------------------------------------------------------------------------------------*/ - g_u32hiYear = (sPt->u32Year - RTC_YEAR2000) / 10; - g_u32loYear = (sPt->u32Year - RTC_YEAR2000) % 10; - g_u32hiMonth = sPt->u32cMonth / 10; - g_u32loMonth = sPt->u32cMonth % 10; - g_u32hiDay = sPt->u32cDay / 10; - g_u32loDay = sPt->u32cDay % 10; - - //u32Reg = ((sPt->u32AlarmMaskDayOfWeek & 0x1) << 31); - u32Reg = ((sPt->u32cDayOfWeek & 0x7) << 24); - //u32Reg|= ((sPt->u32AlarmMaskYear & 0x1) << 30); - u32Reg |= (g_u32hiYear << 20); - u32Reg |= (g_u32loYear << 16); - //u32Reg|= ((sPt->u32AlarmMaskMonth & 0x1) << 29); - u32Reg |= (g_u32hiMonth << 12); - u32Reg |= (g_u32loMonth << 8); - //u32Reg|= ((sPt->u32AlarmMaskDay & 0x1) << 28); - u32Reg |= (g_u32hiDay << 4); - u32Reg |= g_u32loDay; - - g_u32Reg = u32Reg; - - RTC_WriteEnable(1); - outp32(REG_RTC_CALM, (UINT32)g_u32Reg); - RTC_Check(); - - - if (g_chHourMode == RTC_CLOCK_12) - { - if (sPt->u8cAmPm == RTC_PM) /* important, range of 12-hour PM mode is 21 upto 32 */ - { - sPt->u32cHour += 20; - } - } - g_u32hiHour = sPt->u32cHour / 10; - g_u32loHour = sPt->u32cHour % 10; - g_u32hiMin = sPt->u32cMinute / 10; - g_u32loMin = sPt->u32cMinute % 10; - g_u32hiSec = sPt->u32cSecond / 10; - g_u32loSec = sPt->u32cSecond % 10; - - u32Reg = ((sPt->u32AlarmMaskHour & 0x1) << 30); - u32Reg |= (g_u32hiHour << 20); - u32Reg |= (g_u32loHour << 16); - u32Reg |= ((sPt->u32AlarmMaskMinute & 0x1) << 29); - u32Reg |= (g_u32hiMin << 12); - u32Reg |= (g_u32loMin << 8); - u32Reg |= ((sPt->u32AlarmMaskSecond & 0x1) << 28); - u32Reg |= (g_u32hiSec << 4); - u32Reg |= g_u32loSec; - - g_u32Reg = u32Reg; - - RTC_WriteEnable(1); - outp32(REG_RTC_TALM, (UINT32)g_u32Reg); - RTC_Check(); - - if (sPt->u8cClockDisplay == RTC_CLOCK_12) - { - if (sPt->u8cAmPm == RTC_PM) - { - sPt->u32cHour -= 20; - } - } - /*---------------------------------------------------------------------------------------------*/ - /* Finally, enable alarm interrupt. */ - /*---------------------------------------------------------------------------------------------*/ - - RTC_Ioctl(0, RTC_IOC_ENABLE_INT, RTC_ALARM_INT, 0); - - RTC_WriteEnable(1); - outp32(REG_RTC_PWRCTL, inp32(REG_RTC_PWRCTL) | RTC_PWRCTL_ALARM_EN_Msk); - RTC_Check(); - - return E_RTC_SUCCESS; - } - default: - { - return E_RTC_ERR_ENOTTY; - } - } - -} - - -/** - * @brief Support some commands for application. - * - * @param[in] i32Num Interface number. always set 0 - * @param[in] eCmd Command - * @param[in] u32Arg0 Arguments for the command - * @param[in] u32Arg1 Arguments for the command. - * - * @retval E_RTC_ERR_ENOTTY Wrong command or argument - * @retval E_RTC_ERR_ENODEV Interface number incorrect - * @retval E_RTC_SUCCESS Success - * - */ -UINT32 RTC_Ioctl(INT32 i32Num, E_RTC_CMD eCmd, UINT32 u32Arg0, UINT32 u32Arg1) -{ - INT32 i32Ret; - UINT32 u32Reg; - RTC_TICK_T *ptick; - UINT32 u32Tmp; - - if (i32Num != 0) - return E_RTC_ERR_ENODEV; - - switch (eCmd) - { - - case RTC_IOC_IDENTIFY_LEAP_YEAR: - { - u32Reg = inp32(REG_RTC_LEAPYEAR); - if (u32Reg & 0x01) - { - *(PUINT32)u32Arg0 = RTC_LEAP_YEAR; - } - else - { - *(PUINT32)u32Arg0 = 0; - } - break; - } - case RTC_IOC_SET_TICK_MODE: - { - ptick = (RTC_TICK_T *) u32Arg0; - - if (g_bIsEnableTickInt == TRUE) - { - RTC_Ioctl(0, RTC_IOC_DISABLE_INT, RTC_TICK_INT, 0); - g_bIsEnableTickInt = TRUE; - } - - if (ptick->ucMode > RTC_TICK_1_128_SEC) /*Tick mode 0 to 7 */ - { - return E_RTC_ERR_ENOTTY ; - } - - RTC_WriteEnable(1); - outp32(REG_RTC_TICK, ptick->ucMode); - RTC_Check(); - - /*---------------------------------------------------------------------------------------------*/ - /* Reset tick interrupt status if program enable tick interrupt before. */ - /*---------------------------------------------------------------------------------------------*/ - if (g_bIsEnableTickInt == TRUE) - { - - RTC_Ioctl(0, RTC_IOC_ENABLE_INT, RTC_TICK_INT, 0); - - return E_RTC_SUCCESS; - } - break; - } - - case RTC_IOC_GET_TICK: - { - break; - } - - case RTC_IOC_RESTORE_TICK: - { - break; - } - - case RTC_IOC_ENABLE_INT: - { - - switch ((RTC_INT_SOURCE)u32Arg0) - { - - case RTC_TICK_INT: - { - g_bIsEnableTickInt = TRUE; - u32Tmp = inp32(REG_RTC_INTEN) | RTC_TICK_INT; - break; - } - case RTC_ALARM_INT: - { - g_bIsEnableAlarmInt = TRUE; - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_PWRCTL) | RTC_PWRCTL_ALARM_EN_Msk; - - outp32(REG_RTC_PWRCTL, u32Tmp); - outp32(REG_RTC_INTEN, inp32(REG_RTC_INTEN) | RTC_INTEN_ALMIEN_Msk); - - RTC_Check(); - - u32Tmp = inp32(REG_RTC_INTEN) | RTC_ALARM_INT; - - break; - } - case RTC_RELATIVE_ALARM_INT: - { - g_bIsEnableAlarmInt = TRUE; - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_PWRCTL) | RTC_PWRCTL_REL_ALARM_EN_Msk; - - outp32(REG_RTC_PWRCTL, u32Tmp); - RTC_Check(); - - u32Tmp = inp32(REG_RTC_INTEN) | RTC_RELATIVE_ALARM_INT; - break; - } - case RTC_PSWI_INT: - { - g_bIsEnableAlarmInt = TRUE; - u32Tmp = inp32(REG_RTC_INTEN) | RTC_PSWI_INT; - break; - } - default: - { - return E_RTC_ERR_ENOTTY; - - } - } - - RTC_WriteEnable(1); - outp32(REG_RTC_INTEN, u32Tmp); - RTC_Check(); - - break; - } - case RTC_IOC_DISABLE_INT: - { - - switch ((RTC_INT_SOURCE)u32Arg0) - { - case RTC_TICK_INT: - { - g_bIsEnableTickInt = FALSE; - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_INTEN) & (~RTC_TICK_INT); - - outp32(REG_RTC_INTEN, u32Tmp); - - outp32(REG_RTC_INTSTS, RTC_TICK_INT); - RTC_Check(); - - break; - } - case RTC_ALARM_INT: - { - g_bIsEnableAlarmInt = FALSE; - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_INTEN) & (~RTC_ALARM_INT); - - outp32(REG_RTC_INTEN, u32Tmp); - RTC_Check(); - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_PWRCTL) & ~RTC_PWRCTL_ALARM_EN_Msk; - - outp32(REG_RTC_PWRCTL, u32Tmp); - RTC_Check(); - - outp32(REG_RTC_INTSTS, RTC_ALARM_INT); - - break; - } - case RTC_RELATIVE_ALARM_INT: - { - g_bIsEnableAlarmInt = FALSE; - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_INTEN) & (~RTC_RELATIVE_ALARM_INT); - - outp32(REG_RTC_INTEN, u32Tmp); - RTC_Check(); - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_PWRCTL) & ~RTC_PWRCTL_REL_ALARM_EN_Msk; - - outp32(REG_RTC_PWRCTL, u32Tmp); - RTC_Check(); - - outp32(REG_RTC_INTSTS, RTC_RELATIVE_ALARM_INT); - - break; - } - case RTC_PSWI_INT: - { - g_bIsEnableAlarmInt = FALSE; - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_INTEN) & (~RTC_PSWI_INT); - - outp32(REG_RTC_INTEN, u32Tmp); - RTC_Check(); - - outp32(REG_RTC_INTSTS, RTC_PSWI_INT); - - break; - } - - case RTC_ALL_INT: - { - g_bIsEnableTickInt = FALSE; - g_bIsEnableAlarmInt = FALSE; - - RTC_WriteEnable(1); - outp32(REG_RTC_INTEN, 0); - outp32(REG_RTC_INTSTS, RTC_ALL_INT); - RTC_Check(); - - break; - } - default: - { - return E_RTC_ERR_ENOTTY; - } - } - - - break; - } - - case RTC_IOC_SET_FREQUENCY: - { - i32Ret = RTC_DoFrequencyCompensation(u32Arg0) ; - if (i32Ret != 0) - { - return E_RTC_ERR_ENOTTY; - } - break; - } - case RTC_IOC_SET_POWER_ON: - { - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_PWRCTL) | 0x01; - - outp32(REG_RTC_PWRCTL, u32Tmp); - RTC_Check(); - - while ((inp32(REG_RTC_PWRCTL) & 0x01) != 0x1); - - break; - } - case RTC_IOC_SET_POWER_OFF: - { - RTC_WriteEnable(1); - outp32(REG_RTC_PWRCTL, (inp32(REG_RTC_PWRCTL) & ~0x01) | 2); - RTC_Check(); - - while (1); - - //break; - } - case RTC_IOC_SET_POWER_OFF_PERIOD: - { - if (u32Arg0 < 4) u32Arg0 = 4; - - u32Arg0 = u32Arg0 - 4; - - RTC_WriteEnable(1); - outp32(REG_RTC_PWRCTL, (inp32(REG_RTC_PWRCTL) & ~0xF000) | ((u32Arg0 & 0xF) << 12)); - RTC_Check(); - - break; - } - case RTC_IOC_ENABLE_HW_POWEROFF: - { - RTC_WriteEnable(1); - outp32(REG_RTC_PWRCTL, (inp32(REG_RTC_PWRCTL) | 0x04)); - RTC_Check(); - - break; - } - case RTC_IOC_DISABLE_HW_POWEROFF: - { - RTC_WriteEnable(1); - outp32(REG_RTC_PWRCTL, (inp32(REG_RTC_PWRCTL) & ~0x04)); - RTC_Check(); - - break; - } - case RTC_IOC_SET_PSWI_CALLBACK: - { - - RTC_Ioctl(0, RTC_IOC_ENABLE_INT, RTC_PSWI_INT, 0); - - break; - } - case RTC_IOC_GET_POWERKEY_STATUS: - { - RTC_WriteEnable(1); - if (inp32(REG_RTC_PWRCTL) & 0x80) - *(PUINT32)u32Arg0 = 1; - else - *(PUINT32)u32Arg0 = 0; - - break; - } - case RTC_IOC_SET_RELEATIVE_ALARM: - { - g_bIsEnableAlarmInt = TRUE; - - RTC_WriteEnable(1); - outp32(REG_RTC_PWRCTL, (inp32(REG_RTC_PWRCTL) & ~0xFFF0010)); - RTC_Check(); - - RTC_WriteEnable(1); - u32Tmp = (inp32(REG_RTC_PWRCTL) & ~0xFFF0000) | ((u32Arg0 & 0xFFF) << 16) | RTC_PWRCTL_REL_ALARM_EN_Msk; - - outp32(REG_RTC_PWRCTL, u32Tmp); - RTC_Check(); - - g_bIsEnableAlarmInt = TRUE; - - RTC_WriteEnable(1); - u32Tmp = inp32(REG_RTC_INTEN) | RTC_RELATIVE_ALARM_INT; - - outp32(REG_RTC_INTEN, u32Tmp); - RTC_Check(); - - break; - - } - - default: - { - return E_RTC_ERR_ENOTTY; - } - } - - return E_RTC_SUCCESS; -} - -/** - * @brief Disable AIC channel of RTC and both tick and alarm interrupt. - * - * @param[in] None - * - * @retval E_RTC_SUCCESS Success - * - */ -UINT32 RTC_Close(void) -{ - - g_bIsEnableTickInt = FALSE; - - sysDisableInterrupt(RTC_IRQn); - - - RTC_Ioctl(0, RTC_IOC_DISABLE_INT, RTC_ALL_INT, 0); - - - return E_RTC_SUCCESS; -} - -/** - * @brief Enable RTC clock. - * - * @param[in] bEnable 1: Enable \n - * 2: Disable - * - * @return None - * - */ -void RTC_EnableClock(BOOL bEnable) -{ - if (bEnable) - outp32(REG_CLK_PCLKEN0, inp32(REG_CLK_PCLKEN0) | (1 << 2)); - else - outp32(REG_CLK_PCLKEN0, inp32(REG_CLK_PCLKEN0) & ~(1 << 2)); - -} - - - -/*@}*/ /* end of group N9H30_RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_RTC_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_scuart.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_scuart.c deleted file mode 100644 index 6656e0fe0e9..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_scuart.c +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************//** - * @file scuart.c - * @brief N9H30 series Smartcard UART mode (SCUART) driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "N9H30.h" -#include "nu_scuart.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_SCUART_Driver SCUART Driver - @{ -*/ - - -/** @addtogroup N9H30_SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/** - * @brief Disable smartcard uart interface. - * @param sc Smartcard module number - * @return None - * @details The function is used to disable smartcard interface UART mode. - */ -void SCUART_Close(UINT sc) -{ - if (sc == 0) - { - outpw(REG_SC0_INTEN, 0); - outpw(REG_SC0_UARTCTL, 0); - outpw(REG_SC0_CTL, 0); - } - else - { - outpw(REG_SC1_INTEN, 0); - outpw(REG_SC1_UARTCTL, 0); - outpw(REG_SC1_CTL, 0); - } -} - -/// @cond HIDDEN_SYMBOLS -/** - * @brief This function returns module clock of specified SC interface - * @param[in] sc Smartcard module number - * @return Module clock of specified SC interface - */ -static uint32_t SCUART_GetClock(UINT sc) -{ - uint32_t u32Div; - - if (sc == 0) - u32Div = ((inpw(REG_CLK_DIVCTL6) >> 24) & 0xF) + 1; - else - u32Div = ((inpw(REG_CLK_DIVCTL6) >> 28) & 0xF) + 1; - - return 12000000 / u32Div; -} -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief Enable smartcard uart interface. - * @param[in] sc Smartcard module number - * @param[in] u32baudrate Target baudrate of smartcard module. - * @return Actual baudrate of smartcard mode. - * @details This function use to enable smartcard module UART mode and set baudrate. - * @note This function configures character width to 8 bits, 1 stop bit, and no parity. - * And can use \ref SCUART_SetLineConfig function to update these settings. - */ -UINT SCUART_Open(UINT sc, UINT u32baudrate) -{ - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - // Calculate divider for target baudrate - u32Div = (u32Clk + (u32baudrate >> 1) - 1) / u32baudrate - 1; - - if (sc == 0) - { - outpw(REG_SC0_CTL, SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk); // Enable smartcard interface and stop bit = 1 - outpw(REG_SC0_UARTCTL, SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk); // Enable UART mode, disable parity and 8 bit per character - outpw(REG_SC0_ETUCTL, u32Div); - } - else - { - outpw(REG_SC1_CTL, SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk); // Enable smartcard interface and stop bit = 1 - outpw(REG_SC1_UARTCTL, SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk); // Enable UART mode, disable parity and 8 bit per character - outpw(REG_SC1_ETUCTL, u32Div); - } - - return (u32Clk / (u32Div + 1)); -} - -/** - * @brief Read data from smartcard UART interface. - * @param[in] sc Smartcard module number - * @param[in] pu8RxBuf The buffer to store receive the data. - * @param[in] u32ReadBytes Target number of characters to receive. - * @return Actual character number reads to buffer. - * @details The function is used to read Rx data from RX FIFO. - * @note This function does not block and return immediately if there's no data available. - */ -UINT SCUART_Read(UINT sc, char *pu8RxBuf, UINT u32ReadBytes) -{ - uint32_t u32Count; - - if (sc == 0) - { - for (u32Count = 0; u32Count < u32ReadBytes; u32Count++) - { - if (inpw(REG_SC0_STATUS) & SC_STATUS_RXEMPTY_Msk) // no data available - { - break; - } - pu8RxBuf[u32Count] = inpw(REG_SC0_DAT); // get data from FIFO - } - } - else - { - for (u32Count = 0; u32Count < u32ReadBytes; u32Count++) - { - if (inpw(REG_SC1_STATUS) & SC_STATUS_RXEMPTY_Msk) // no data available - { - break; - } - pu8RxBuf[u32Count] = inpw(REG_SC1_DAT); // get data from FIFO - } - - } - - return u32Count; -} - -/** - * @brief This function use to config smartcard UART mode line setting. - * @param[in] sc Smartcard module number - * @param[in] u32Baudrate Target baudrate of smartcard module. If this value is 0, UART baudrate will not change. - * @param[in] u32DataWidth The data length, could be: - * - \ref SCUART_CHAR_LEN_5 - * - \ref SCUART_CHAR_LEN_6 - * - \ref SCUART_CHAR_LEN_7 - * - \ref SCUART_CHAR_LEN_8 - * @param[in] u32Parity The parity setting, could be: - * - \ref SCUART_PARITY_NONE - * - \ref SCUART_PARITY_ODD - * - \ref SCUART_PARITY_EVEN - * @param[in] u32StopBits The stop bit length, could be: - * - \ref SCUART_STOP_BIT_1 - * - \ref SCUART_STOP_BIT_2 - * @return Actual baudrate of smartcard. - * @details Smartcard UART mode is operated in LIN data frame. - */ -UINT SCUART_SetLineConfig(UINT sc, UINT u32Baudrate, UINT u32DataWidth, UINT u32Parity, UINT u32StopBits) -{ - - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - if (u32Baudrate == 0) // keep original baudrate setting - { - u32Div = (sc == 0) ? inpw(REG_SC0_ETUCTL) & 0xFFF : inpw(REG_SC1_ETUCTL) & 0xFFF; - } - else - { - // Calculate divider for target baudrate - u32Div = (u32Clk + (u32Baudrate >> 1) - 1) / u32Baudrate - 1; - if (sc == 0) - outpw(REG_SC0_ETUCTL, u32Div); - else - outpw(REG_SC1_ETUCTL, u32Div); - } - - if (sc == 0) - { - outpw(REG_SC0_CTL, u32StopBits | SC_CTL_SCEN_Msk); // Set stop bit - outpw(REG_SC0_UARTCTL, u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk); // Set character width and parity - } - else - { - outpw(REG_SC1_CTL, u32StopBits | SC_CTL_SCEN_Msk); // Set stop bit - outpw(REG_SC1_UARTCTL, u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk); // Set character width and parity - } - return (u32Clk / (u32Div + 1)); -} - -/** - * @brief This function use to set receive timeout count. - * @param[in] sc Smartcard module number - * @param[in] u32TOC Rx timeout counter, using baudrate as counter unit. Valid range are 0~0x1FF, - * set this value to 0 will disable timeout counter. - * @return None - * @details The time-out counter resets and starts counting whenever the RX buffer received a - * new data word. Once the counter decrease to 1 and no new data is received or CPU - * does not read any data from FIFO, a receiver time-out interrupt will be generated. - */ -void SCUART_SetTimeoutCnt(UINT sc, UINT u32TOC) -{ - if (sc == 0) - outpw(REG_SC0_RXTOUT, u32TOC); - else - outpw(REG_SC1_RXTOUT, u32TOC); -} - - -/** - * @brief Write data to smartcard UART interface. - * @param[in] sc Smartcard module number - * @param[in] pu8TxBuf The buffer containing data to send to transmit FIFO. - * @param[in] u32WriteBytes Number of data to send. - * @return None - * @details This function is to write data into transmit FIFO to send data out. - * @note This function blocks until all data write into FIFO. - */ -void SCUART_Write(UINT sc, char *pu8TxBuf, UINT u32WriteBytes) -{ - uint32_t u32Count; - - if (sc == 0) - { - for (u32Count = 0; u32Count != u32WriteBytes; u32Count++) - { - while (inpw(REG_SC0_STATUS) & SC_STATUS_TXFULL_Msk); // Wait 'til FIFO not full - outpw(REG_SC0_DAT, pu8TxBuf[u32Count]); // Write 1 byte to FIFO - } - } - else - { - for (u32Count = 0; u32Count != u32WriteBytes; u32Count++) - { - while (inpw(REG_SC0_STATUS) & SC_STATUS_TXFULL_Msk); // Wait 'til FIFO not full - outpw(REG_SC1_DAT, pu8TxBuf[u32Count]); // Write 1 byte to FIFO - } - } -} - - -/*@}*/ /* end of group N9H30_SCUART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_SCUART_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sdh.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sdh.c deleted file mode 100644 index 0cfd172a210..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sdh.c +++ /dev/null @@ -1,1187 +0,0 @@ -/**************************************************************************//** - * @file sdh.c - * @brief N9H30 SDH driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_sdh.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup N9H30_SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ -#define SDH_BLOCK_SIZE 512ul - -/** @cond HIDDEN_SYMBOLS */ - -/* global variables */ -/* For response R3 (such as ACMD41, CRC-7 is invalid; but SD controller will still */ -/* calculate CRC-7 and get an error result, software should ignore this error and clear SDISR [CRC_IF] flag */ -/* _sd_uR3_CMD is the flag for it. 1 means software should ignore CRC-7 error */ - -#ifdef __ICCARM__ - #pragma data_alignment = 32 - static uint8_t _SDH0_ucSDHCBuffer[512]; - static uint8_t _SDH1_ucSDHCBuffer[512]; -#else - static uint8_t _SDH0_ucSDHCBuffer[512] __attribute__((aligned(32))); - static uint8_t _SDH1_ucSDHCBuffer[512] __attribute__((aligned(32))); -#endif - -void SDH_CheckRB(SDH_T *sdh) -{ - while (1) - { - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - if ((sdh->INTSTS & SDH_INTSTS_DAT0STS_Msk) == SDH_INTSTS_DAT0STS_Msk) - { - break; - } - } -} - - -uint32_t SDH_SDCommand(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf, val = 0ul; - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | (SDH_CTL_COEN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_COEN_Msk) == SDH_CTL_COEN_Msk) - { - if (pSD->IsCardInsert == 0ul) - { - val = SDH_NO_SD_CARD; - } - } - return val; -} - - -uint32_t SDH_SDCmdAndRsp(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t ucCmd, uint32_t uArg, uint32_t ntickCount) -{ - volatile uint32_t buf; - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk); - sdh->CTL = buf; - - if (ntickCount > 0ul) - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (ntickCount-- == 0ul) - { - sdh->CTL |= SDH_CTL_CTLRST_Msk; /* reset SD engine */ - return 2ul; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - else - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - - if (pSD->R7Flag) - { - uint32_t tmp0 = 0ul, tmp1 = 0ul; - tmp1 = sdh->RESP1 & 0xfful; - tmp0 = sdh->RESP0 & 0xful; - if ((tmp1 != 0x55ul) && (tmp0 != 0x01ul)) - { - pSD->R7Flag = 0ul; - return SDH_CMD8_ERROR; - } - } - - if (!pSD->R3Flag) - { - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return Successful; - } - else - { - return SDH_CRC7_ERROR; - } - } - else - { - /* ignore CRC error for R3 case */ - pSD->R3Flag = 0ul; - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return Successful; - } -} - - -uint32_t SDH_Swap32(uint32_t val) -{ - uint32_t buf; - - buf = val; - val <<= 24; - val |= (buf << 8) & 0xff0000ul; - val |= (buf >> 8) & 0xff00ul; - val |= (buf >> 24) & 0xfful; - return val; -} - -/* Get 16 bytes CID or CSD */ -uint32_t SDH_SDCmdAndRsp2(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t ucCmd, uint32_t uArg, uint32_t puR2ptr[]) -{ - uint32_t i, buf; - uint32_t tmpBuf[5]; - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_R2EN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_R2EN_Msk) == SDH_CTL_R2EN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) - { - for (i = 0ul; i < 5ul; i++) - { - tmpBuf[i] = SDH_Swap32(sdh->FB[i]); - } - for (i = 0ul; i < 4ul; i++) - { - puR2ptr[i] = ((tmpBuf[i] & 0x00fffffful) << 8) | ((tmpBuf[i + 1ul] & 0xff000000ul) >> 24); - } - } - else - { - return SDH_CRC7_ERROR; - } - return Successful; -} - - -uint32_t SDH_SDCmdAndRspDataIn(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf; - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | - (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - while ((sdh->CTL & SDH_CTL_DIEN_Msk) == SDH_CTL_DIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) - { - /* check CRC7 */ - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) - { - /* check CRC16 */ - return SDH_CRC16_ERROR; - } - return 0ul; -} - -/* there are 8 bits for divider0, maximum is 256 */ -#define SDH_CLK_DIV0_MAX 256ul - - -void SDH_Set_clock(SDH_T *sdh, uint32_t sd_clock_khz) -{ - UINT32 div; - UINT32 reg; - uint32_t SDH_ReferenceClock; - - if (sdh == SDH0) - reg = REG_CLK_DIVCTL3; - else - reg = REG_CLK_DIVCTL9; - - if (sd_clock_khz <= 2000) - { - SDH_ReferenceClock = 12000; - outpw(reg, (inpw(reg) & ~0x18) | (0x0 << 3)); // SD clock from XIN [4:3] - } - else - { - SDH_ReferenceClock = 300000; - outpw(reg, (inpw(reg) & ~0x18) | (0x3 << 3)); // SD clock from UPLL [4:3] - } - div = (SDH_ReferenceClock / sd_clock_khz) - 1; - if (div >= SDH_CLK_DIV0_MAX) div = 0xff; - outpw(reg, (inpw(reg) & ~0xff00) | ((div) << 8)); // SD clock divided by CLKDIV3[SD_N] [15:8] -} - -uint32_t SDH_CardDetection(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t card_num) -{ - uint32_t i, val = TRUE; - uint32_t u32INTEN_CDSRC_Msk; - uint32_t u32INTSTS_CDSTS_Msk; - uint32_t u32CTL_CLKKEEP_Msk; - - if (card_num & SD_PORT0) - { - u32INTEN_CDSRC_Msk = SDH_INTEN_CDSRC_Msk; - u32INTSTS_CDSTS_Msk = SDH_INTSTS_CDSTS_Msk; - u32CTL_CLKKEEP_Msk = SDH_CTL_CLKKEEP0_Msk; - } - else if (card_num & SD_PORT1) - { - u32INTEN_CDSRC_Msk = SDH_INTEN_CDSRC1_Msk; - u32INTSTS_CDSTS_Msk = SDH_INTSTS_CDSTS1_Msk; - u32CTL_CLKKEEP_Msk = SDH_CTL_CLKKEEP1_Msk; - } - else - { - return FALSE; - } - - if ((sdh->INTEN & u32INTEN_CDSRC_Msk) == u32INTEN_CDSRC_Msk) /* Card detect pin from GPIO */ - { - if ((sdh->INTSTS & u32INTSTS_CDSTS_Msk) == u32INTSTS_CDSTS_Msk) /* Card remove */ - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - else - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - - } - else if ((sdh->INTEN & u32INTEN_CDSRC_Msk) != u32INTEN_CDSRC_Msk) - { - sdh->CTL |= u32CTL_CLKKEEP_Msk; - for (i = 0ul; i < 5000ul; i++) - { - } - - if ((sdh->INTSTS & u32INTSTS_CDSTS_Msk) == u32INTSTS_CDSTS_Msk) /* Card insert */ - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - else - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - - sdh->CTL &= ~u32CTL_CLKKEEP_Msk; - } - - return val; -} - -uint32_t SDH_WhichCardIsSelected(SDH_T *sdh) -{ - return (sdh->CTL & SDH_CTL_SDPORT_Msk) ? SD_PORT1 : SD_PORT0; -} - -void SDH_CardSelect(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t u32CardSrc) -{ - if (u32CardSrc & SD_PORT0) - { - sdh->CTL &= ~SDH_CTL_SDPORT_Msk; - } - else if (u32CardSrc & SD_PORT1) - { - sdh->CTL &= ~SDH_CTL_SDPORT_Msk; - sdh->CTL |= (1 << SDH_CTL_SDPORT_Pos); - } - - switch (pSD->CardType) - { - case SDH_TYPE_MMC: - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - SDH_Set_clock(sdh, MMC_FREQ); - break; - case SDH_TYPE_SD_LOW: - case SDH_TYPE_EMMC: - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - SDH_Set_clock(sdh, SD_FREQ); - break; - case SDH_TYPE_SD_HIGH: - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - SDH_Set_clock(sdh, SDHC_FREQ); - break; - case SDH_TYPE_UNKNOWN: - default: - break; - } -} - -uint32_t SDH_Init(SDH_T *sdh, SDH_INFO_T *pSD) -{ - uint32_t volatile i, status; - uint32_t resp; - uint32_t CIDBuffer[4]; - uint32_t volatile u32CmdTimeOut; - - /* set the clock to 300KHz */ - SDH_Set_clock(sdh, 300ul); - - /* power ON 74 clock */ - sdh->CTL |= SDH_CTL_CLK74OEN_Msk; - - while ((sdh->CTL & SDH_CTL_CLK74OEN_Msk) == SDH_CTL_CLK74OEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - SDH_SDCommand(sdh, pSD, 0ul, 0ul); /* reset all cards */ - for (i = 0x1000ul; i > 0ul; i--) - { - } - - /* initial SDHC */ - pSD->R7Flag = 1ul; - u32CmdTimeOut = 0xFFFFFul; - - i = SDH_SDCmdAndRsp(sdh, pSD, 8ul, 0x00000155ul, u32CmdTimeOut); - if (i == Successful) - { - /* SD 2.0 */ - SDH_SDCmdAndRsp(sdh, pSD, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, pSD, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 2.7v-3.6v */ - resp = sdh->RESP0; - - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, pSD, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, pSD, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - } - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_SD_HIGH; - } - else - { - pSD->CardType = SDH_TYPE_SD_LOW; - } - } - else - { - /* SD 1.1 */ - SDH_SDCommand(sdh, pSD, 0ul, 0ul); /* reset all cards */ - for (i = 0x100ul; i > 0ul; i--) - { - } - - i = SDH_SDCmdAndRsp(sdh, pSD, 55ul, 0x00ul, u32CmdTimeOut); - if (i == 2ul) /* MMC memory */ - { - - SDH_SDCommand(sdh, pSD, 0ul, 0ul); /* reset */ - for (i = 0x100ul; i > 0ul; i--) - { - } - - pSD->R3Flag = 1ul; - - if (SDH_SDCmdAndRsp(sdh, pSD, 1ul, 0x40ff8000ul, u32CmdTimeOut) != 2ul) /* eMMC memory */ - { - resp = sdh->RESP0; - while ((resp & 0x00800000ul) != 0x00800000ul) - { - /* check if card is ready */ - pSD->R3Flag = 1ul; - - SDH_SDCmdAndRsp(sdh, pSD, 1ul, 0x40ff8000ul, u32CmdTimeOut); /* high voltage */ - resp = sdh->RESP0; - } - - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_EMMC; - } - else - { - pSD->CardType = SDH_TYPE_MMC; - } - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_ERR_DEVICE; - } - } - else if (i == 0ul) /* SD Memory */ - { - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, pSD, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, pSD, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, pSD, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - } - pSD->CardType = SDH_TYPE_SD_LOW; - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - - return SDH_INIT_ERROR; - } - } - - if (pSD->CardType != SDH_TYPE_UNKNOWN) - { - SDH_SDCmdAndRsp2(sdh, pSD, 2ul, 0x00ul, CIDBuffer); - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 3ul, 0x10000ul, 0ul)) != Successful) /* set RCA */ - { - return status; - } - pSD->RCA = 0x10000ul; - } - else - { - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 3ul, 0x00ul, 0ul)) != Successful) /* get RCA */ - { - return status; - } - else - { - pSD->RCA = (sdh->RESP0 << 8) & 0xffff0000; - } - } - } - return Successful; -} - - -uint32_t SDH_SwitchToHighSpeed(SDH_T *sdh, SDH_INFO_T *pSD) -{ - uint32_t volatile status = 0ul; - uint16_t current_comsumption, busy_status0; - - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; - - if ((status = SDH_SDCmdAndRspDataIn(sdh, pSD, 6ul, 0x00ffff01ul)) != Successful) - { - return Fail; - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - busy_status0 = (uint16_t)(*(pSD->dmabuf + 28)) << 8; - busy_status0 |= (uint16_t)(*(pSD->dmabuf + 29)); - - if (!busy_status0) /* function ready */ - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; /* 512 bit */ - - if ((status = SDH_SDCmdAndRspDataIn(sdh, pSD, 6ul, 0x80ffff01ul)) != Successful) - { - return Fail; - } - - /* function change timing: 8 clocks */ - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - return Successful; - } - else - { - return Fail; - } -} - - -uint32_t SDH_SelectCardType(SDH_T *sdh, SDH_INFO_T *pSD) -{ - uint32_t volatile status = 0ul; - uint32_t param; - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* if SD card set 4bit */ - if (pSD->CardType == SDH_TYPE_SD_HIGH) - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 0x07ul; /* 64 bit */ - sdh->DMACTL |= SDH_DMACTL_DMARST_Msk; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == 0x2); - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, pSD, 51ul, 0x00ul)) != Successful) - { - return status; - } - - if ((*pSD->dmabuf & 0xful) == 0x2ul) - { - status = SDH_SwitchToHighSpeed(sdh, pSD); - if (status == Successful) - { - /* divider */ - SDH_Set_clock(sdh, SDHC_FREQ); - } - } - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 6ul, 0x02ul, 0ul)) != Successful) /* set bus width */ - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if (pSD->CardType == SDH_TYPE_SD_LOW) - { - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 0x07ul; - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, pSD, 51ul, 0x00ul)) != Successful) - { - return status; - } - - /* set data bus width. ACMD6 for SD card, SDCR_DBW for host. */ - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 6ul, 0x02ul, 0ul)) != Successful) - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - - if (pSD->CardType == SDH_TYPE_MMC) - { - sdh->CTL &= ~SDH_CTL_DBW_Msk; - } - - /*--- sent CMD6 to MMC card to set bus width to 4 bits mode */ - /* set CMD6 argument Access field to 3, Index to 183, Value to 1 (4-bit mode) */ - param = (3ul << 24) | (183ul << 16) | (1ul << 8); - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 6ul, param, 0ul)) != Successful) - { - return status; - } - SDH_CheckRB(sdh); - - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - - } - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 16ul, SDH_BLOCK_SIZE, 0ul)) != Successful) - { - return status; - } - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - SDH_SDCommand(sdh, pSD, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - sdh->INTEN |= SDH_INTEN_BLKDIEN_Msk; - - return Successful; -} - -void SDH_Get_SD_info(SDH_T *sdh, SDH_INFO_T *pSD) -{ - unsigned int R_LEN, C_Size, MULT, size; - uint32_t Buffer[4]; - //unsigned char *ptr; - - SDH_SDCmdAndRsp2(sdh, pSD, 9ul, pSD->RCA, Buffer); - - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - /* for MMC/eMMC card */ - if ((Buffer[0] & 0xc0000000) == 0xc0000000) - { - /* CSD_STRUCTURE [127:126] is 3 */ - /* CSD version depend on EXT_CSD register in eMMC v4.4 for card size > 2GB */ - SDH_SDCmdAndRsp(sdh, pSD, 7ul, pSD->RCA, 0ul); - - //ptr = (uint8_t *)((uint32_t)_SDH_ucSDHCBuffer ); - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 511ul; /* read 512 bytes for EXT_CSD */ - - if (SDH_SDCmdAndRspDataIn(sdh, pSD, 8ul, 0x00ul) == Successful) - { - SDH_SDCommand(sdh, pSD, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - pSD->totalSectorN = (uint32_t)(*(pSD->dmabuf + 215)) << 24; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 214)) << 16; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 213)) << 8; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 212)); - pSD->diskSize = pSD->totalSectorN / 2ul; - } - } - else - { - /* CSD version v1.0/1.1/1.2 in eMMC v4.4 spec for card size <= 2GB */ - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size + 1ul) * (1ul << (MULT + 2ul)) * (1ul << R_LEN); - - pSD->diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - else - { - if ((Buffer[0] & 0xc0000000) != 0x0ul) - { - C_Size = ((Buffer[1] & 0x0000003ful) << 16) | ((Buffer[2] & 0xffff0000ul) >> 16); - size = (C_Size + 1ul) * 512ul; /* Kbytes */ - - pSD->diskSize = size; - pSD->totalSectorN = size << 1; - } - else - { - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size + 1ul) * (1ul << (MULT + 2ul)) * (1ul << R_LEN); - - pSD->diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - pSD->sectorSize = (int)512; -// printf("The size is %d KB\n", pSD->diskSize); -} - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief This function use to reset SD function and select card detection source and pin. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32CardDetSrc Select card detection pin from GPIO or DAT3 pin. ( \ref CardDetect_From_GPIO / \ref CardDetect_From_DAT3) - * - * @return None - */ -void SDH_Open(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t u32CardDetSrc) -{ - volatile int i; - - uint32_t u32INTEN_CDSRC_Msk = 0; - uint32_t u32INTSTS_CDIF_Msk = 0; - uint32_t u32INTEN_CDIEN_Msk = 0; - uint32_t u32CTL_CLKKEEP_Msk = 0; - - if (u32CardDetSrc & SD_PORT0) - { - u32INTEN_CDSRC_Msk = SDH_INTEN_CDSRC_Msk; - u32INTSTS_CDIF_Msk = SDH_INTSTS_CDIF_Msk; - u32INTEN_CDIEN_Msk = SDH_INTEN_CDIEN_Msk; - u32CTL_CLKKEEP_Msk = SDH_CTL_CLKKEEP0_Msk; - } - else if (u32CardDetSrc & SD_PORT1) - { - u32INTEN_CDSRC_Msk = SDH_INTEN_CDSRC1_Msk; - u32INTSTS_CDIF_Msk = SDH_INTSTS_CDIF1_Msk; - u32INTEN_CDIEN_Msk = SDH_INTEN_CDIEN1_Msk; - u32CTL_CLKKEEP_Msk = SDH_CTL_CLKKEEP1_Msk; - } - - // Enable DMAC - sdh->DMACTL = SDH_DMACTL_DMARST_Msk; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == SDH_DMACTL_DMARST_Msk) - { - } - sdh->DMACTL = SDH_DMACTL_DMAEN_Msk; - - // Reset Global - sdh->GCTL = SDH_GCTL_GCTLRST_Msk | SDH_GCTL_SDEN_Msk; - while ((sdh->GCTL & SDH_GCTL_GCTLRST_Msk) == SDH_GCTL_GCTLRST_Msk) - { - } - - if (sdh == SDH1) - { - /* Enable Power, 0: Enable, 1:Disable */ - if (u32CardDetSrc & SD_PORT0) - { - sdh->ECTL &= ~SDH_ECTL_POWEROFF0_Msk; - } - else if (u32CardDetSrc & SD_PORT1) - { - sdh->ECTL &= ~SDH_ECTL_POWEROFF1_Msk; - } - /* disable SD clock output */ - sdh->CTL &= ~(0xFF | u32CTL_CLKKEEP_Msk); - } - - sdh->CTL |= SDH_CTL_CTLRST_Msk; - while ((sdh->CTL & SDH_CTL_CTLRST_Msk) == SDH_CTL_CTLRST_Msk) - { - } - - memset(pSD, 0, sizeof(SDH_INFO_T)); - if (sdh == SDH0) - { - pSD->dmabuf = (unsigned char *)((uint32_t)_SDH0_ucSDHCBuffer | 0x80000000); - pSD->IsCardInsert = 1; - } - else if (sdh == SDH1) - { - pSD->dmabuf = (unsigned char *)((uint32_t)_SDH1_ucSDHCBuffer | 0x80000000); - } - else - { - } - - // enable SD - sdh->GCTL = SDH_GCTL_SDEN_Msk; - - if ((u32CardDetSrc & CardDetect_From_DAT3) == CardDetect_From_DAT3) - { - sdh->INTEN &= ~u32INTEN_CDSRC_Msk; - } - else - { - sdh->INTEN |= u32INTEN_CDSRC_Msk; - } - - for (i = 0; i < 0x100; i++); - - sdh->INTSTS = u32INTSTS_CDIF_Msk; - sdh->INTEN |= u32INTEN_CDIEN_Msk; -} - - - -/** - * @brief This function use to initial SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return None - * - * @details This function is used to initial SD card. - * SD initial state needs 400KHz clock output, driver will use HIRC for SD initial clock source. - * And then switch back to the user's setting. - */ -uint32_t SDH_Probe(SDH_T *sdh, SDH_INFO_T *pSD, uint32_t card_num) -{ - uint32_t val; - - // Disable SD host interrupt - sdh->GINTEN = 0ul; - - sdh->CTL &= ~SDH_CTL_SDNWR_Msk; - sdh->CTL |= 0x09ul << SDH_CTL_SDNWR_Pos; /* set SDNWR = 9 */ - sdh->CTL &= ~SDH_CTL_BLKCNT_Msk; - sdh->CTL |= 0x01ul << SDH_CTL_BLKCNT_Pos; /* set BLKCNT = 1 */ - sdh->CTL &= ~SDH_CTL_DBW_Msk; /* SD 1-bit data bus */ - - if (sdh != SDH0) //EMMC - { - if (!(SDH_CardDetection(sdh, pSD, card_num))) - { - return SDH_NO_SD_CARD; - } - } - - if ((val = SDH_Init(sdh, pSD)) != 0ul) - { - return val; - } - - /* divider */ - if (pSD->CardType == SDH_TYPE_MMC) - { - SDH_Set_clock(sdh, MMC_FREQ); - } - else - { - SDH_Set_clock(sdh, SD_FREQ); - } - SDH_Get_SD_info(sdh, pSD); - - if ((val = SDH_SelectCardType(sdh, pSD)) != 0ul) - { - return val; - } - - return 0ul; -} - -/** - * @brief This function use to read data from SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[out] pu8BufAddr The buffer to receive the data from SD card. - * @param[in] u32StartSec The start read sector address. - * @param[in] u32SecCount The the read sector number of data - * - * @return None - */ -uint32_t SDH_Read(SDH_T *sdh, SDH_INFO_T *pSD, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE, buf; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - uint32_t blksize = SDH_BLOCK_SIZE; - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - sdh->BLEN = blksize - 1ul; /* the actual byte count is equal to (SDBLEN+1) */ - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * blksize; - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - - loop = u32SecCount / 255ul; - for (i = 0ul; i < loop; i++) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & ~SDH_CTL_CMDCODE_Msk; - reg = reg | 0xff0000ul; /* set BLK_CNT to 255 */ - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg | (18ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->DataReadyFlag) - { - break; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & (~SDH_CTL_CMDCODE_Msk); - reg = reg & (~SDH_CTL_BLKCNT_Msk); - reg |= (loop << 16); /* setup SDCR_BLKCNT */ - - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg | (18ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - if (SDH_SDCmdAndRsp(sdh, pSD, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, pSD, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - return Successful; -} - - -/** - * @brief This function use to write data to SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] pu8BufAddr The buffer to send the data to SD card. - * @param[in] u32StartSec The start write sector address. - * @param[in] u32SecCount The the write sector number of data. - * - * @return \ref SDH_SELECT_ERROR : u32SecCount is zero. \n - * \ref SDH_NO_SD_CARD : SD card be removed. \n - * \ref SDH_CRC_ERROR : CRC error happen. \n - * \ref SDH_CRC7_ERROR : CRC7 error happen. \n - * \ref Successful : Write data to SD card success. - */ -uint32_t SDH_Write(SDH_T *sdh, SDH_INFO_T *pSD, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, pSD, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* According to SD Spec v2.0, the write CMD block size MUST be 512, and the start address MUST be 512*n. */ - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * SDH_BLOCK_SIZE; /* set start address for SD CMD */ - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - loop = u32SecCount / 255ul; /* the maximum block count is 0xFF=255 for register SDCR[BLK_CNT] */ - for (i = 0ul; i < loop; i++) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & 0xff00c080; - reg = reg | 0xff0000ul; /* set BLK_CNT to 0xFF=255 */ - if (!bIsSendCmd) - { - sdh->CTL = reg | (25ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = (sdh->CTL & 0xff00c080) | (loop << 16); - if (!bIsSendCmd) - { - sdh->CTL = reg | (25ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - - if (SDH_SDCmdAndRsp(sdh, pSD, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, pSD, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - return Successful; -} - -/*@}*/ /* end of group N9H30_SD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_SD_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - - - - - - - - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_spi.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_spi.c deleted file mode 100644 index 3f631238fa3..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_spi.c +++ /dev/null @@ -1,336 +0,0 @@ -/**************************************************************************//** -* @file spi.c -* @brief N9H30 SPI driver source file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -/* Header files */ -#include -#include - -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_spi.h" -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup N9H30_SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ -/// @cond HIDDEN_SYMBOLS - -#define spi_out(dev, byte, addr) outpw((dev)->base + addr, byte) -#define spi_in(dev, addr) inpw((dev)->base + addr) - -typedef struct -{ - uint32_t base; /* spi bus number */ - uint8_t openflag; - uint8_t intflag; -} spi_dev; - -/// @endcond HIDDEN_SYMBOLS -/*@}*/ /* end of group N9H30_EMAC_EXPORTED_CONSTANTS */ - -/** @addtogroup N9H30_SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ -/// @cond HIDDEN_SYMBOLS - -static spi_dev spi_device[SPI_NUMBER]; - -#if 0 -/** - * @brief SPI-0 Interrupt handler - * @param None - * @return None - */ -static void spi0ISR(void) -{ - // clear interrupt flag - outpw(REG_SPI0_CNTRL, spi_in((spi_dev *)((uint32_t)&spi_device[0]), CNTRL) | 0x1 << 16); - spi_device[0].intflag = 1; -} - -/** - * @brief SPI-1 Interrupt handler - * @param None - * @return None - */ -static void spi1ISR(void) -{ - // clear interrupt flag - outpw(REG_SPI1_CNTRL, spi_in((spi_dev *)((uint32_t)&spi_device[1]), CNTRL) | 0x1 << 16); - spi_device[1].intflag = 1; -} -#endif - -/** - * @brief Set SPI divider - * @param[in] dev pointer to spi interface structure - * @param[in] speed desire spi speed - * @return speed set actually - */ -static uint32_t spiSetSpeed(spi_dev *dev, uint32_t speed) -{ - uint16_t div = (uint16_t)(SPI_INPUT_CLOCK / (2 * speed)) - 1; - - spi_out(dev, div, DIVIDER); - return (SPI_INPUT_CLOCK / (2 * (div + 1))); -} - -/// @endcond /* HIDDEN_SYMBOLS */ - -/** - * @brief Initialize spi interface and install interrupt callback function - * @return always 0. - * @retval 0 Success. - */ -int32_t spiInit(int32_t fd) -{ -#if 0 - if (fd == 0) - { - sysInstallISR(IRQ_LEVEL_1, SPI0_IRQn, (PVOID)spi0ISR); - sysEnableInterrupt(SPI0_IRQn); - memset((void *)&spi_device[0], 0, sizeof(spi_dev)); - } - else - { - sysInstallISR(IRQ_LEVEL_1, SPI1_IRQn, (PVOID)spi1ISR); - sysEnableInterrupt(SPI1_IRQn); - memset((void *)&spi_device[1], 0, sizeof(spi_dev)); - } - - sysSetLocalInterrupt(ENABLE_IRQ); -#endif - - return (0); -} - -/** - * @brief Support some spi driver commands for application. - * @param[in] fd is interface number. - * @param[in] cmd is command. - * @param[in] arg0 is the first argument of command. - * @param[in] arg1 is the second argument of command. - * @return command status. - * @retval 0 Success otherwise fail. Fail value could be - * - \ref SPI_ERR_NODEV - * - \ref SPI_ERR_IO - * - \ref SPI_ERR_ARG - */ -int32_t spiIoctl(int32_t fd, uint32_t cmd, uint32_t arg0, uint32_t arg1) -{ - spi_dev *dev; - - if (fd != 0 && fd != 1) - return (SPI_ERR_NODEV); - - dev = (spi_dev *)((uint32_t)&spi_device[fd]); - if (dev->openflag == 0) - return (SPI_ERR_IO); - - switch (cmd) - { - case SPI_IOC_TRIGGER: - dev->intflag = 0; - spi_out(dev, spi_in(dev, CNTRL) | 0x1, CNTRL); - break; - -#if 0 - case SPI_IOC_SET_INTERRUPT: - if (arg0 == SPI_ENABLE_INTERRUPT) - spi_out(dev, spi_in(dev, CNTRL) | (0x1 << 17), CNTRL); - else - spi_out(dev, spi_in(dev, CNTRL) & ~(0x1 << 17), CNTRL); - break; -#endif - - case SPI_IOC_SET_SPEED: - return spiSetSpeed(dev, (uint32_t)arg0); - - case SPI_IOC_SET_DUAL_QUAD_MODE: - if (arg0 == SPI_DISABLE_DUAL_QUAD) - { - spi_out(dev, (spi_in(dev, CNTRL) & ~(0x3 << 21)), CNTRL); - break; - } - - if (arg0 == SPI_DUAL_MODE) - spi_out(dev, (spi_in(dev, CNTRL) & ~(0x3 << 21)) | (0x1 << 22), CNTRL); - else - spi_out(dev, (spi_in(dev, CNTRL) & ~(0x3 << 21)) | (0x1 << 21), CNTRL); - break; - - case SPI_IOC_SET_DUAL_QUAD_DIR: - if (arg0 == SPI_DUAL_QUAD_INPUT) - spi_out(dev, spi_in(dev, CNTRL) & ~(0x1 << 20), CNTRL); - else - spi_out(dev, spi_in(dev, CNTRL) | (0x1 << 20), CNTRL); - break; - - case SPI_IOC_SET_LSB_MSB: - if (arg0 == SPI_MSB) - spi_out(dev, spi_in(dev, CNTRL) & ~(0x1 << 10), CNTRL); - else - spi_out(dev, spi_in(dev, CNTRL) | (0x1 << 10), CNTRL); - break; - - case SPI_IOC_SET_TX_NUM: - if (arg0 < 4) - spi_out(dev, (spi_in(dev, CNTRL) & ~(0x3 << 8)) | (arg0 << 8), CNTRL); - else - return SPI_ERR_ARG; - break; - - case SPI_IOC_SET_TX_BITLEN: - if (arg0 < 32) - spi_out(dev, (spi_in(dev, CNTRL) & ~(0x1f << 3)) | (arg0 << 3), CNTRL); - else - return SPI_ERR_ARG; - break; - - case SPI_IOC_SET_MODE: - if (arg0 > SPI_MODE_3) - return SPI_ERR_ARG; - - if (arg0 == SPI_MODE_0) - spi_out(dev, (spi_in(dev, CNTRL) & ~((0x3 << 1) | (1UL << 31))) | (1 << 2), CNTRL); - else if (arg0 == SPI_MODE_1) - spi_out(dev, (spi_in(dev, CNTRL) & ~((0x3 << 1) | (1UL << 31))) | (1 << 1), CNTRL); - else if (arg0 == SPI_MODE_2) - spi_out(dev, (spi_in(dev, CNTRL) & ~((0x3 << 1) | (1UL << 31))) | ((1UL << 31) | (1 << 2)), CNTRL); - else - spi_out(dev, (spi_in(dev, CNTRL) & ~((0x3 << 1) | (1UL << 31))) | ((1UL << 31) | (1 << 1)), CNTRL); - break; - - case SPI_IOC_ENABLE_SS: - if (arg0 == SPI_SS_SS0) - spi_out(dev, (spi_in(dev, SSR) & ~(0x3)) | 0x1, SSR); - else if (arg0 == SPI_SS_SS1) - spi_out(dev, (spi_in(dev, SSR) & ~(0x3)) | 0x2, SSR); - else if (arg0 == SPI_SS_BOTH) - spi_out(dev, (spi_in(dev, SSR) & ~(0x3)) | 0x3, SSR); - else - return SPI_ERR_ARG; - break; - - case SPI_IOC_DISABLE_SS: - if (arg0 == SPI_SS_SS0) - spi_out(dev, (spi_in(dev, SSR) & ~(0x1)), SSR); - else if (arg0 == SPI_SS_SS1) - spi_out(dev, (spi_in(dev, SSR) & ~(0x2)), SSR); - else if (arg0 == SPI_SS_BOTH) - spi_out(dev, (spi_in(dev, SSR) & ~(0x3)), SSR); - else - return SPI_ERR_ARG; - break; - - case SPI_IOC_SET_AUTOSS: - if (arg0 == SPI_DISABLE_AUTOSS) - spi_out(dev, spi_in(dev, SSR) & ~(0x1 << 3), SSR); - else - spi_out(dev, spi_in(dev, SSR) | (0x1 << 3), SSR); - break; - - case SPI_IOC_SET_SS_ACTIVE_LEVEL: - if (arg0 == SPI_SS_ACTIVE_LOW) - spi_out(dev, spi_in(dev, SSR) & ~(0x1 << 2), SSR); - else - spi_out(dev, spi_in(dev, SSR) | (0x1 << 2), SSR); - default: - break; - } - - return 0; -} - -/** - * @brief Open spi interface and initialize some variables - * @param[in] fd is interface number. - * @return always 0 - * @retval 0 success. - */ -int spiOpen(int32_t fd) -{ - spi_dev *dev; - - if ((uint32_t)fd >= SPI_NUMBER) - return SPI_ERR_NODEV; - - dev = (spi_dev *)((uint32_t)&spi_device[fd]); - - if (dev->openflag != 0) /* a card slot can open only once */ - return (SPI_ERR_BUSY); - - memset(dev, 0, sizeof(spi_dev)); - dev->base = ((uint32_t)fd) ? SPI1_BA : SPI0_BA; - dev->openflag = 1; - dev->intflag = 0; - - return 0; -} - -/** - * @brief Get busy status of spi interface - * @param[in] fd is interface number. - * @return busy or not - * @retval 0 not busy. - * @retval 1 busy. - */ -uint8_t spiGetBusyStatus(int32_t fd) -{ - spi_dev *dev; - - dev = (spi_dev *)((uint32_t)&spi_device[fd]); - - if (spi_in(dev, CNTRL) & (0x1 << 17)) - return (!dev->intflag); - else - return ((spi_in(dev, CNTRL) & 0x1) == 0x1 ? 1 : 0); -} - -/** - * @brief Read data form spi interface - * @param[in] fd is interface number. - * @param[in] buff_id is buffer number. If transfer number is 4, application needs read 4 times (buff_id is from 0 to 3) from buffer. - * @return data - */ -uint32_t spiRead(int32_t fd, uint8_t buff_id) -{ - spi_dev *dev; - - dev = (spi_dev *)((uint32_t)&spi_device[fd]); - return spi_in(dev, (RX0 + 4 * buff_id)); -} - -/** - * @brief Write data to spi interface - * @param[in] fd is interface number. - * @param[in] buff_id is buffer number. If transfer number is 4, application needs write 4 times (buff_id is from 0 to 3) to buffer. - * @param[in] data is data to be written. - * @return none - */ -void spiWrite(int32_t fd, uint8_t buff_id, uint32_t data) -{ - spi_dev *dev; - - dev = (spi_dev *)((uint32_t)&spi_device[fd]); - spi_out(dev, data, (TX0 + 4 * buff_id)); -} - -/*@}*/ /* end of group N9H30_SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_SPI_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sys.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sys.c deleted file mode 100644 index ef3772b025c..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_sys.c +++ /dev/null @@ -1,675 +0,0 @@ -/**************************************************************************//** -* @file sys.c -* @brief N9H30 SYS driver source file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "N9H30.h" -#include "nu_sys.h" - -/// @cond HIDDEN_SYMBOLS - -#define SYS_MIN_INT_SOURCE 1 -#define SYS_MAX_INT_SOURCE 62 -#define SYS_NUM_OF_AICREG 16 - -/* Global variables */ -BOOL volatile _sys_bIsAICInitial = FALSE; - -/* declaration the function prototype */ -extern void SYS_Interrupt_Shell(void); - -/* Interrupt Handler Table */ -//typedef void (*sys_pvFunPtr)(); /* function pointer */ -sys_pvFunPtr sysIrqHandlerTable[] = { 0, /* 0 */ - SYS_Interrupt_Shell, /* 1 */ - SYS_Interrupt_Shell, /* 2 */ - SYS_Interrupt_Shell, /* 3 */ - SYS_Interrupt_Shell, /* 4 */ - SYS_Interrupt_Shell, /* 5 */ - SYS_Interrupt_Shell, /* 6 */ - SYS_Interrupt_Shell, /* 7 */ - SYS_Interrupt_Shell, /* 8 */ - SYS_Interrupt_Shell, /* 9 */ - SYS_Interrupt_Shell, /* 10 */ - SYS_Interrupt_Shell, /* 11 */ - SYS_Interrupt_Shell, /* 12 */ - SYS_Interrupt_Shell, /* 13 */ - SYS_Interrupt_Shell, /* 14 */ - SYS_Interrupt_Shell, /* 15 */ - SYS_Interrupt_Shell, /* 16 */ - SYS_Interrupt_Shell, /* 17 */ - SYS_Interrupt_Shell, /* 18 */ - SYS_Interrupt_Shell, /* 19 */ - SYS_Interrupt_Shell, /* 20 */ - SYS_Interrupt_Shell, /* 21 */ - SYS_Interrupt_Shell, /* 22 */ - SYS_Interrupt_Shell, /* 23 */ - SYS_Interrupt_Shell, /* 24 */ - SYS_Interrupt_Shell, /* 25 */ - SYS_Interrupt_Shell, /* 26 */ - SYS_Interrupt_Shell, /* 27 */ - SYS_Interrupt_Shell, /* 28 */ - SYS_Interrupt_Shell, /* 29 */ - SYS_Interrupt_Shell, /* 30 */ - SYS_Interrupt_Shell, /* 31 */ - SYS_Interrupt_Shell, /* 32 */ - SYS_Interrupt_Shell, /* 33 */ - SYS_Interrupt_Shell, /* 34 */ - SYS_Interrupt_Shell, /* 35 */ - SYS_Interrupt_Shell, /* 36 */ - SYS_Interrupt_Shell, /* 37 */ - SYS_Interrupt_Shell, /* 38 */ - SYS_Interrupt_Shell, /* 39 */ - SYS_Interrupt_Shell, /* 40 */ - SYS_Interrupt_Shell, /* 41 */ - SYS_Interrupt_Shell, /* 42 */ - SYS_Interrupt_Shell, /* 43 */ - SYS_Interrupt_Shell, /* 44 */ - SYS_Interrupt_Shell, /* 45 */ - SYS_Interrupt_Shell, /* 46 */ - SYS_Interrupt_Shell, /* 47 */ - SYS_Interrupt_Shell, /* 48 */ - SYS_Interrupt_Shell, /* 49 */ - SYS_Interrupt_Shell, /* 50 */ - SYS_Interrupt_Shell, /* 51 */ - SYS_Interrupt_Shell, /* 52 */ - SYS_Interrupt_Shell, /* 53 */ - SYS_Interrupt_Shell, /* 54 */ - SYS_Interrupt_Shell, /* 55 */ - SYS_Interrupt_Shell, /* 56 */ - SYS_Interrupt_Shell, /* 57 */ - SYS_Interrupt_Shell, /* 58 */ - SYS_Interrupt_Shell, /* 59 */ - SYS_Interrupt_Shell, /* 60 */ - SYS_Interrupt_Shell /* 61 */ - }; - -sys_pvFunPtr sysFiqHandlerTable[] = { 0, - SYS_Interrupt_Shell, /* 1 */ - SYS_Interrupt_Shell, /* 2 */ - SYS_Interrupt_Shell, /* 3 */ - SYS_Interrupt_Shell, /* 4 */ - SYS_Interrupt_Shell, /* 5 */ - SYS_Interrupt_Shell, /* 6 */ - SYS_Interrupt_Shell, /* 7 */ - SYS_Interrupt_Shell, /* 8 */ - SYS_Interrupt_Shell, /* 9 */ - SYS_Interrupt_Shell, /* 10 */ - SYS_Interrupt_Shell, /* 11 */ - SYS_Interrupt_Shell, /* 12 */ - SYS_Interrupt_Shell, /* 13 */ - SYS_Interrupt_Shell, /* 14 */ - SYS_Interrupt_Shell, /* 15 */ - SYS_Interrupt_Shell, /* 16 */ - SYS_Interrupt_Shell, /* 17 */ - SYS_Interrupt_Shell, /* 18 */ - SYS_Interrupt_Shell, /* 19 */ - SYS_Interrupt_Shell, /* 20 */ - SYS_Interrupt_Shell, /* 21 */ - SYS_Interrupt_Shell, /* 22 */ - SYS_Interrupt_Shell, /* 23 */ - SYS_Interrupt_Shell, /* 24 */ - SYS_Interrupt_Shell, /* 25 */ - SYS_Interrupt_Shell, /* 26 */ - SYS_Interrupt_Shell, /* 27 */ - SYS_Interrupt_Shell, /* 28 */ - SYS_Interrupt_Shell, /* 29 */ - SYS_Interrupt_Shell, /* 30 */ - SYS_Interrupt_Shell, /* 31 */ - SYS_Interrupt_Shell, /* 32 */ - SYS_Interrupt_Shell, /* 33 */ - SYS_Interrupt_Shell, /* 34 */ - SYS_Interrupt_Shell, /* 35 */ - SYS_Interrupt_Shell, /* 36 */ - SYS_Interrupt_Shell, /* 37 */ - SYS_Interrupt_Shell, /* 38 */ - SYS_Interrupt_Shell, /* 39 */ - SYS_Interrupt_Shell, /* 40 */ - SYS_Interrupt_Shell, /* 41 */ - SYS_Interrupt_Shell, /* 42 */ - SYS_Interrupt_Shell, /* 43 */ - SYS_Interrupt_Shell, /* 44 */ - SYS_Interrupt_Shell, /* 45 */ - SYS_Interrupt_Shell, /* 46 */ - SYS_Interrupt_Shell, /* 47 */ - SYS_Interrupt_Shell, /* 48 */ - SYS_Interrupt_Shell, /* 49 */ - SYS_Interrupt_Shell, /* 50 */ - SYS_Interrupt_Shell, /* 51 */ - SYS_Interrupt_Shell, /* 52 */ - SYS_Interrupt_Shell, /* 53 */ - SYS_Interrupt_Shell, /* 54 */ - SYS_Interrupt_Shell, /* 55 */ - SYS_Interrupt_Shell, /* 56 */ - SYS_Interrupt_Shell, /* 57 */ - SYS_Interrupt_Shell, /* 58 */ - SYS_Interrupt_Shell, /* 59 */ - SYS_Interrupt_Shell, /* 60 */ - SYS_Interrupt_Shell /* 61 */ - }; - -/* Interrupt Handler */ -#if defined ( __GNUC__ ) && !(__CC_ARM) - static void __attribute__((interrupt("IRQ"))) sysIrqHandler(void) -#else - __irq void sysIrqHandler() -#endif -{ - UINT32 volatile _mIPER, _mISNR; - - _mIPER = (inpw(REG_AIC_IPER) >> 2) & 0x3f; - _mISNR = inpw(REG_AIC_ISNR); - if (_mIPER != 0) - { - if (_mISNR != 0) - (*sysIrqHandlerTable[_mIPER])(); - outpw(REG_AIC_EOSCR, 1); - } -} - -#if defined ( __GNUC__ ) && !(__CC_ARM) - static void __attribute__((interrupt("FIQ"))) sysFiqHandler(void) -#else - __irq void sysFiqHandler() -#endif -{ - UINT32 volatile _mIPER, _mISNR; - - _mIPER = (inpw(REG_AIC_IPER) >> 2) & 0x3f; - _mISNR = inpw(REG_AIC_ISNR); - if (_mIPER != 0) - { - if (_mISNR != 0) - (*sysFiqHandlerTable[_mIPER])(); - outpw(REG_AIC_EOSCR, 1); - } -} - -void SYS_Interrupt_Shell() -{ - //sysprintf("ISR not found! ISNR=%d\n", inpw(REG_AIC_ISNR)); -} - -void sysInitializeAIC() -{ - *(unsigned int volatile *)0x38 = (unsigned int)sysIrqHandler; - - *(unsigned int volatile *)0x3C = (unsigned int)sysFiqHandler; -} -/// @endcond HIDDEN_SYMBOLS - - -/* Interrupt library functions */ -/** - * @brief system AIC - disable interrupt - * - * @param[in] eIntNo Select interrupt source. \ref IRQn_Type - * - * @return 0 - */ -INT32 sysDisableInterrupt(IRQn_Type eIntNo) -{ - if ((eIntNo > SYS_MAX_INT_SOURCE) || (eIntNo < SYS_MIN_INT_SOURCE)) - return 1; - - if (eIntNo < 32) - outpw(REG_AIC_MDCR, (1 << eIntNo)); - else - outpw(REG_AIC_MDCRH, (1 << (eIntNo - 32))); - - return 0; -} - - -/** - * @brief system AIC - enable interrupt - * - * @param[in] eIntNo Select interrupt source. \ref IRQn_Type - * - * @return 0 - */ -INT32 sysEnableInterrupt(IRQn_Type eIntNo) -{ - if ((eIntNo > SYS_MAX_INT_SOURCE) || (eIntNo < SYS_MIN_INT_SOURCE)) - return 1; - - if (eIntNo < 32) - outpw(REG_AIC_MECR, (1 << eIntNo)); - else - outpw(REG_AIC_MECRH, (1 << (eIntNo - 32))); - - return 0; -} - - -/** - * @brief system AIC - install exception handler - * - * @param[in] nExceptType exception type. ( \ref SYS_SWI / \ref SYS_D_ABORT / \ref SYS_I_ABORT / \ref SYS_UNDEFINE) - * @param[in] pvNewHandler own exception handler - * - * @return old handler - */ -PVOID sysInstallExceptionHandler(INT32 nExceptType, PVOID pvNewHandler) -{ - PVOID _mOldVect = NULL; - - switch (nExceptType) - { - case SYS_SWI: - _mOldVect = *(PVOID volatile *)0x28; - *(PVOID volatile *)0x28 = pvNewHandler; - break; - - case SYS_D_ABORT: - _mOldVect = *(PVOID volatile *)0x30; - *(PVOID volatile *)0x30 = pvNewHandler; - break; - - case SYS_I_ABORT: - _mOldVect = *(PVOID volatile *)0x2C; - *(PVOID volatile *)0x2C = pvNewHandler; - break; - - case SYS_UNDEFINE: - _mOldVect = *(PVOID volatile *)0x24; - *(PVOID volatile *)0x24 = pvNewHandler; - break; - - default: - ; - } - return _mOldVect; -} - -/** - * @brief system AIC - install FIQ handler - * - * @param[in] pvNewISR own fiq handler - * - * @return old handler - */ -PVOID sysInstallFiqHandler(PVOID pvNewISR) -{ - PVOID _mOldVect; - - _mOldVect = *(PVOID volatile *)0x3C; - *(PVOID volatile *)0x3C = pvNewISR; - return _mOldVect; -} - -/** - * @brief system AIC - install IRQ handler - * - * @param[in] pvNewISR own irq handler - * - * @return old handler - */ -PVOID sysInstallIrqHandler(PVOID pvNewISR) -{ - PVOID _mOldVect; - - _mOldVect = *(PVOID volatile *)0x38; - *(PVOID volatile *)0x38 = pvNewISR; - return _mOldVect; -} - - -/** - * @brief system AIC - install Own IRQ service routine - * - * @param[in] nIntTypeLevel Interrupt Level. ( \ref FIQ_LEVEL_0 / \ref IRQ_LEVEL_1 / \ref IRQ_LEVEL_2 / \ref IRQ_LEVEL_3 / - * \ref IRQ_LEVEL_4 / \ref IRQ_LEVEL_5 / \ref IRQ_LEVEL_6 / \ref IRQ_LEVEL_7 ) - * @param[in] eIntNo Interrupt number. \ref IRQn_Type - * @param[in] pvNewISR own irq handler - * - * @return old handler - */ -PVOID sysInstallISR(INT32 nIntTypeLevel, IRQn_Type eIntNo, PVOID pvNewISR) -{ - PVOID _mOldVect; - UINT32 _mRegAddr/*, _mRegValue*/; - INT shift; - - if (!_sys_bIsAICInitial) - { - sysInitializeAIC(); - _sys_bIsAICInitial = TRUE; - } - - _mRegAddr = REG_AIC_SCR1 + ((eIntNo / 4) * 4); - shift = (eIntNo % 4) * 8; - nIntTypeLevel &= 0xff; - outpw(_mRegAddr, (inpw(_mRegAddr) & ~(0x07 << shift)) | (nIntTypeLevel << shift)); - - if ((nIntTypeLevel & 0x7) == FIQ_LEVEL_0) - { - _mOldVect = (PVOID) sysFiqHandlerTable[eIntNo]; - sysFiqHandlerTable[eIntNo] = (sys_pvFunPtr)pvNewISR; - } - else - { - _mOldVect = (PVOID) sysIrqHandlerTable[eIntNo]; - sysIrqHandlerTable[eIntNo] = (sys_pvFunPtr)pvNewISR; - } - return _mOldVect; -} - - -INT32 sysSetGlobalInterrupt(INT32 nIntState) -{ - switch (nIntState) - { - case ENABLE_ALL_INTERRUPTS: - outpw(REG_AIC_MECR, 0xFFFFFFFF); - outpw(REG_AIC_MECRH, 0xFFFFFFFF); - break; - - case DISABLE_ALL_INTERRUPTS: - outpw(REG_AIC_MDCR, 0xFFFFFFFF); - outpw(REG_AIC_MDCRH, 0xFFFFFFFF); - break; - - default: - ; - } - return 0; -} - - -/** - * @brief system AIC - Change interrupt level - * - * @param[in] eIntNo Interrupt number. \ref IRQn_Type - * @param[in] uIntLevel Interrupt Level. ( \ref FIQ_LEVEL_0 / \ref IRQ_LEVEL_1 / \ref IRQ_LEVEL_2 / \ref IRQ_LEVEL_3 / - * \ref IRQ_LEVEL_4 / \ref IRQ_LEVEL_5 / \ref IRQ_LEVEL_6 / \ref IRQ_LEVEL_7 ) - * - * @return 0 - */ -INT32 sysSetInterruptPriorityLevel(IRQn_Type eIntNo, UINT32 uIntLevel) -{ - UINT32 _mRegAddr; - INT shift; - - if ((eIntNo > SYS_MAX_INT_SOURCE) || (eIntNo < SYS_MIN_INT_SOURCE)) - return 1; - - _mRegAddr = REG_AIC_SCR1 + ((eIntNo / 4) * 4); - shift = (eIntNo % 4) * 8; - uIntLevel &= 0x7; - outpw(_mRegAddr, (inpw(_mRegAddr) & ~(0x07 << shift)) | (uIntLevel << shift)); - - return 0; -} - - -INT32 sysSetInterruptType(IRQn_Type eIntNo, UINT32 uIntSourceType) -{ - UINT32 _mRegAddr; - INT shift; - - if ((eIntNo > SYS_MAX_INT_SOURCE) || (eIntNo < SYS_MIN_INT_SOURCE)) - return 1; - - _mRegAddr = REG_AIC_SCR1 + ((eIntNo / 4) * 4); - shift = (eIntNo % 4) * 8; - uIntSourceType &= 0xC0; - outpw(_mRegAddr, (inpw(_mRegAddr) & ~(0xC0 << shift)) | (uIntSourceType << shift)); - - return 0; -} - - -/** - * @brief system AIC - Set CP15 Interrupt Type - * - * @param[in] nIntState Interrupt state. ( \ref ENABLE_IRQ / \ref ENABLE_FIQ / \ref ENABLE_FIQ_IRQ / - * \ref DISABLE_IRQ / \ref DISABLE_FIQ / \ref DISABLE_FIQ_IRQ) - * - * @return 0 - */ -INT32 sysSetLocalInterrupt(INT32 nIntState) -{ -#if defined ( __GNUC__ ) && !(__CC_ARM) - -# else - INT32 temp; -#endif - - switch (nIntState) - { - case ENABLE_IRQ: - case ENABLE_FIQ: - case ENABLE_FIQ_IRQ: -#if defined ( __GNUC__ ) && !(__CC_ARM) - asm - ( - "mrs r0, CPSR \n" - "bic r0, r0, #0x80 \n" - "msr CPSR_c, r0 \n" - ); -#else - __asm - { - MRS temp, CPSR - AND temp, temp, nIntState - MSR CPSR_c, temp - } -#endif - break; - case DISABLE_IRQ: - case DISABLE_FIQ: - case DISABLE_FIQ_IRQ: -#if defined ( __GNUC__ ) && !(__CC_ARM) - asm - ( - "MRS r0, CPSR \n" - "ORR r0, r0, #0x80 \n" - "MSR CPSR_c, r0 \n" - ); -#else - __asm - { - MRS temp, CPSR - ORR temp, temp, nIntState - MSR CPSR_c, temp - } -#endif - break; - - default: - ; - } - return 0; -} - -UINT32 sysGetInterruptEnableStatus(void) -{ - return (inpw(REG_AIC_IMR)); -} - - -UINT32 sysGetInterruptEnableStatusH(void) -{ - return (inpw(REG_AIC_IMRH)); -} - -/// @cond HIDDEN_SYMBOLS -BOOL sysGetIBitState() -{ - INT32 temp; - -#if defined ( __GNUC__ ) && !(__CC_ARM) - asm - ( - "MRS %0, CPSR \n" - :"=r"(temp) : : - ); -#else - __asm - { - MRS temp, CPSR - } -#endif - - if (temp & 0x80) - return FALSE; - else - return TRUE; -} - -INT32 sysGetPLL(UINT32 reg) -{ - UINT32 N, M, P; - - N = ((inpw(reg) & 0x007F) >> 0) + 1; - M = ((inpw(reg) & 0x1F80) >> 7) + 1; - P = ((inpw(reg) & 0xE000) >> 13) + 1; - - return (12 * N / (M * P)); /* 12MHz HXT */ -} -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief system Timer - install WDT interrupt handler - * - * @param[in] clk clock source. \ref CLK_Type - * - * @return MHz - */ -UINT32 sysGetClock(CLK_Type clk) -{ - UINT32 src, divS, divN, reg, div; - - switch (clk) - { - case SYS_UPLL: - return sysGetPLL(REG_CLK_UPLLCON); - - case SYS_APLL: - return sysGetPLL(REG_CLK_APLLCON); - - case SYS_SYSTEM: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divS = (reg & 0x7) + 1; - divN = ((reg & 0xf00) >> 8) + 1; - return (src / divS / divN); - } - - case SYS_HCLK1: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divS = (reg & 0x7) + 1; - divN = ((reg & 0xf00) >> 8) + 1; - return (src / divS / divN / 2); - } - - case SYS_HCLK234: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divS = (reg & 0x7) + 1; - divN = ((reg & 0xf00) >> 8) + 1; - div = ((reg & 0xf00000) >> 20) + 1; - return (src / divS / divN / 2 / div); - } - - case SYS_PCLK: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divS = (reg & 0x7) + 1; - divN = ((reg & 0xf00) >> 8) + 1; - div = ((reg & 0xf000000) >> 24) + 1; - return (src / divS / divN / 2 / div); - } - case SYS_CPU: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divS = (reg & 0x7) + 1; - divN = ((reg & 0xf00) >> 8) + 1; - div = ((reg & 0xf0000) >> 16) + 1; - return (src / divS / divN / div); - } - - default: - ; - } - return 0; -} - - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_timer.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_timer.c deleted file mode 100644 index a5931660a44..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_timer.c +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************//** - * @file timer.c - * @brief N9H30 series TIMER driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_timer.h" - -void TIMER_SET_CMP_VALUE(uint32_t timer, uint32_t u32Cmpr) -{ - uint32_t u32TmrCMPROffset; - - u32TmrCMPROffset = REG_TMR0_CMPR + timer * 0x10; - - outpw(u32TmrCMPROffset, u32Cmpr); -} - -void TIMER_SET_OPMODE(uint32_t timer, uint32_t u32OpMode) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, (inpw(u32TmrCSROffset) & ~(0x3UL << 27)) | u32OpMode); -} - -void TIMER_SET_PRESCALE_VALUE(uint32_t timer, uint32_t u32PreScale) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, (inpw(u32TmrCSROffset) & ~(0xFFUL)) | u32PreScale); -} - -uint32_t TIMER_GetModuleClock(uint32_t timer) -{ - return 12000000; -} - -void TIMER_Start(uint32_t timer) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, inpw(u32TmrCSROffset) | TIMER_COUNTER_ENABLE); -} - -void TIMER_Stop(uint32_t timer) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, inpw(u32TmrCSROffset) & ~TIMER_COUNTER_ENABLE); -} - -void TIMER_ClearCounter(uint32_t timer) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, inpw(u32TmrCSROffset) | TIMER_COUNTER_RESET); -} - -uint32_t TIMER_GetCounter(uint32_t timer) -{ - uint32_t u32TmrDROffset; - - u32TmrDROffset = REG_TMR0_DR + timer * 0x10; - - return inpw(u32TmrDROffset); -} - -uint32_t TIMER_GetCompareData(uint32_t timer) -{ - uint32_t u32TmrCMPROffset; - - u32TmrCMPROffset = REG_TMR0_CMPR + timer * 0x10; - - return inpw(u32TmrCMPROffset); -} - -void TIMER_EnableInt(uint32_t timer) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, inpw(u32TmrCSROffset) | TIMER_INTERRUPT_ENABLE); -} - -void TIMER_DisableInt(uint32_t timer) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, inpw(u32TmrCSROffset) & ~TIMER_INTERRUPT_ENABLE); -} - -void TIMER_Close(uint32_t timer) -{ - uint32_t u32TmrCSROffset; - - u32TmrCSROffset = REG_TMR0_CSR + timer * 0x10; - - outpw(u32TmrCSROffset, 0); -} - -uint32_t TIMER_Open(uint32_t timer, uint32_t u32Mode, uint32_t u32Freq) -{ - uint32_t u32Clk = TIMER_GetModuleClock(timer); - uint32_t u32Cmpr = 0, u32Prescale = 0; - uint32_t u32TmrOffset = 0; - - // Fastest possible timer working freq is u32Clk / 2. While cmpr = 2, pre-scale = 0 - if (u32Freq > (u32Clk / 2)) - { - u32Cmpr = 2; - } - else - { - /* Clock source is only XIN. */ - u32Cmpr = u32Clk / u32Freq; - } - - u32TmrOffset = timer * 0x10; - - TIMER_Close(timer); /* disable timer */ - TIMER_DisableInt(timer); /* clear for safety */ - - outpw(REG_TMR0_CMPR + u32TmrOffset, u32Cmpr); - outpw(REG_TMR0_CSR + u32TmrOffset, u32Mode | u32Prescale); - - return (u32Clk / (u32Cmpr * (u32Prescale + 1))); -} - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_uart.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_uart.c deleted file mode 100644 index 9122b80d63f..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_uart.c +++ /dev/null @@ -1,2200 +0,0 @@ -/**************************************************************************//** -* @file uart.c -* @version V1.00 -* @brief N9H30 UART driver source file -* -* SPDX-License-Identifier: Apache-2.0 -* @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#if 0 -#include -#include -#include -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_uart.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_UART_Driver UART Driver - @{ -*/ - -/** @addtogroup N9H30_UART_EXPORTED_CONSTANTS UART Exported Constants - @{ -*/ - -/*@}*/ /* end of group N9H30_UART_EXPORTED_CONSTANTS */ - -/// @cond HIDDEN_SYMBOLS - -/*-----------------------------------------*/ -/* marco, type and constant definitions */ -/*-----------------------------------------*/ -/* - Define debug level -*/ -//#define UART_DEBUG -//#define UART_FLOWCONTROL_DEBUG -//#define UART1_DEBUG -//#define UART2_DEBUG - -#ifdef UART_DEBUG - #define UDEBUG sysprintf -#else - #define UDEBUG(...) -#endif /* UART_DEBUG */ - -#ifdef UART_FLOWCONTROL_DEBUG - #define FDEBUG sysprintf -#else - #define FDEBUG(...) -#endif /* UART_FLOWCONTROL_DEBUG */ - -#ifdef UART1_DEBUG - #define U1DEBUG sysprintf -#else - #define U1DEBUG(...) -#endif /* UART1_DEBUG */ - -#ifdef UART2_DEBUG - #define U2DEBUG sysprintf -#else - #define U2DEBUG(...) -#endif /* UART1_DEBUG */ - -/*-----------------------------------------*/ -/* global file scope (static) variables */ -/*-----------------------------------------*/ -static UART_BUFFER_T UART_DEV[UART_NUM]; - -static UINT32 UARTTXBUFSIZE[UART_NUM] = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}; /* UART0~10 Tx buffer size */ -static UINT32 UARTRXBUFSIZE[UART_NUM] = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}; /* UART0~10 Rx buffer size */ - - -/* - UART flag declarations. -*/ -static volatile CHAR _uart_cDSRState0 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState1 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState2 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState3 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState4 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState5 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState6 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState7 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState8 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState9 = 0; /* set 1, state change */ -static volatile CHAR _uart_cDSRState10 = 0; /* set 1, state change */ -static volatile CHAR _uart_cBIIState_0 = 0; /* set 1, UART channel 0 break interrupt occur */ -static volatile CHAR _uart_cBIIState_1 = 0; /* set 1, UART channel 1 break interrupt occur */ -static volatile CHAR _uart_cBIIState_2 = 0; /* set 1, UART channel 2 break interrupt occur */ -static volatile CHAR _uart_cBIIState_3 = 0; /* set 1, UART channel 3 break interrupt occur */ -static volatile CHAR _uart_cBIIState_4 = 0; /* set 1, UART channel 4 break interrupt occur */ -static volatile CHAR _uart_cBIIState_5 = 0; /* set 1, UART channel 0 break interrupt occur */ -static volatile CHAR _uart_cBIIState_6 = 0; /* set 1, UART channel 1 break interrupt occur */ -static volatile CHAR _uart_cBIIState_7 = 0; /* set 1, UART channel 2 break interrupt occur */ -static volatile CHAR _uart_cBIIState_8 = 0; /* set 1, UART channel 3 break interrupt occur */ -static volatile CHAR _uart_cBIIState_9 = 0; /* set 1, UART channel 4 break interrupt occur */ -static volatile CHAR _uart_cBIIState_10 = 0; /* set 1, UART channel 4 break interrupt occur */ -static volatile CHAR _uart_cCTSState0 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState1 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState2 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState3 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState4 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState5 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState6 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState7 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState8 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState9 = 0; /* set 1, state change */ -static volatile CHAR _uart_cCTSState10 = 0; /* set 1, state change */ - -/* - Define flow control flags & parameters. -*/ -#define HWFLOWCONTROL 1 -#define SWFLOWCONTROL 2 -static volatile CHAR _uart_cFlowControlMode = 0; /* default no flow control */ -static volatile CHAR _uart_cHWTXStopped = 0; /* Use for H/W flow control. Set 1, stop TX. Set 0, start TX. */ -static volatile CHAR _uart_cHWRXStopped = 0; /* Use for H/W flow control. Set 1, stop RX. Set 0, start RX. */ -static volatile CHAR _uart_cSWTXStopped = 0; /* Use for S/W flow control. Set 1, rec Xoff. Set 0, rec Xon. */ -static volatile CHAR _uart_cSWRXStopped = 0; /* Use for S/W flow control. Set 1, send Xoff. Set 0, send Xon. */ -//static INT _uart_nMaxRxBuf = 0; /* used in uartReceiveChars() */ -//static INT _uart_nMinRxBuf = 0; /* used in uartReadRxBuf() */ - - -/*-----------------------------------------*/ -/* prototypes of static functions */ -/*-----------------------------------------*/ -static UINT32 _uartTxBufGetNextOne(INT nNum, UINT32 uPointer); -static UINT32 _uartRxBufGetNextOne(INT nNum, UINT32 uPointer); -static void _uartEnableInterrupt(INT nNum, UINT32 uVal); -static void _uartDisableInterrupt(INT nNum, UINT32 uVal); -static void _uartReceiveChars(INT nNum); -static void _uartTransmitChars(INT nNum); -static void _uartCheckModemStatus(INT nNum); -static INT _uartSetBaudRate(INT nNum, UART_T *val); -static void _uartInstallISR(UINT8 ucNum); -static BOOL _uartBUFSpaceAlloc(INT nNum); -static BOOL _uartCheckTxBufSpace(INT nNum, UINT32 uHead, UINT32 uTail, UINT32 uLen); -static INT32 _uartReadRxBuf(INT nNum, PUINT8 pucBuf, UINT32 uLen); -static void _uartWriteTxBuf(INT nNum, PUINT8 pucBuf, UINT32 uLen); -static INT _uartConfigureUART(PVOID pvParam); -static INT _uartPerformIrDA(INT nNum, UINT32 uCmd, UINT32 uCmd1); -static INT _uartGetRegisterValue(INT nNum, PVOID pvReg); - - -void RS485_HANDLE(INT nNum) -{ - UINT32 volatile uRegISR, uRegFSR, uRegALT_CSR; - - uRegISR = inpw(REG_UART0_ISR + (nNum * UARTOFFSET)); - uRegFSR = inpw(REG_UART0_FSR + (nNum * UARTOFFSET)); - - if ((uRegISR & UART_ISR_RLS_IF_Msk) && (uRegISR & UART_ISR_RDA_IF_Msk)) /* RLS INT & RDA INT */ //For RS485 Detect Address - { - if (uRegFSR & UART_FSR_RS485_ADD_DETF_Msk) /* ADD_IF, RS485 mode */ - { - _uartReceiveChars(nNum); - outpw((REG_UART0_FSR + (nNum * UARTOFFSET)), UART_FSR_RS485_ADD_DETF_Msk); /* clear ADD_IF flag */ - } - } - else if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Rx Ready or Time-out INT*/ - { - /* Handle received data */ - _uartReceiveChars(nNum); - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART0_FSR + (nNum * UARTOFFSET)); - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_0 = 1; - } -} - -void uart0ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR; - - uRegISR = inpw(REG_UART0_ISR) & 0xff; - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART0); - - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART0); - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART0_FSR); - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_0 = 1; - } - -} - -void uart1ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART1_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART1_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART1); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART1); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART1); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART1_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState1 = 1; - } - else - _uartCheckModemStatus(UART1); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART1_FSR); - U1DEBUG("U1 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_1 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U1 OEI!\n"); - } - } -} - -void uart2ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART2_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART2_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART2); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART2); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART2); - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART2_FSR); - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_2 = 1; - } - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART2_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState2 = 1; - } - else - _uartCheckModemStatus(UART2); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART2_FSR); - U1DEBUG("U2 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_2 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U2 OEI!\n"); - } - } -} - -void uart3ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART3_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART3_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART3); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART3); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) - _uartReceiveChars(UART3); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART3_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState3 = 1; - } - else - _uartCheckModemStatus(UART3); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART3_FSR); - U1DEBUG("U3 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_3 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U3 OEI!\n"); - } - } - -} - -void uart4ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART4_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART4_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART4); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART4); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART4); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART4_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState4 = 1; - } - else - _uartCheckModemStatus(UART4); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART4_FSR); - U1DEBUG("U4 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_4 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U4 OEI!\n"); - } - } - -} - -void uart5ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART5_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART5_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART5); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART5); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART5); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART5_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState5 = 1; - } - else - _uartCheckModemStatus(UART5); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART5_FSR); - U1DEBUG("U5 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_5 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U5 OEI!\n"); - } - } - -} - -void uart6ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART6_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART6_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART6); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART6); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART6); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART6_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState6 = 1; - } - else - _uartCheckModemStatus(UART6); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART6_FSR); - U1DEBUG("U6 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_6 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U6 OEI!\n"); - } - } - -} - -void uart7ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART7_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART7_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART7); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART7); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART7); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART7_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState7 = 1; - } - else - _uartCheckModemStatus(UART7); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART7_FSR); - U1DEBUG("U7 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_7 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U7 OEI!\n"); - } - } - -} - -void uart8ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART8_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART8_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART8); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART8); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART8); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART8_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState8 = 1; - } - else - _uartCheckModemStatus(UART8); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART8_FSR); - U1DEBUG("U8 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_8 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U8 OEI!\n"); - } - } - -} - -void uart9ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UART9_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UART9_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UART9); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UART9); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UART9); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UART9_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState9 = 1; - } - else - _uartCheckModemStatus(UART9); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UART9_FSR); - U1DEBUG("U9 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_9 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U9 OEI!\n"); - } - } - -} - -void uart10ISR(void) -{ - UINT32 volatile uRegISR, uRegFSR, uRegMSR, uRegFUN_SEL; - - uRegISR = inpw(REG_UARTA_ISR) & 0xff; - uRegFUN_SEL = inpw(REG_UARTA_FUN_SEL); - - if (uRegISR & UART_ISR_THRE_IF_Msk) /* TX empty interrupt, check LSR 4 kinds of error further */ - _uartTransmitChars(UARTA); - - if (uRegFUN_SEL == 0x3) - { - RS485_HANDLE(UARTA); - } - else - { - if (uRegISR & (UART_ISR_RDA_IF_Msk | UART_ISR_TOUT_IF_Msk)) /* Received Data Available interrupt */ - _uartReceiveChars(UARTA); - - if (uRegISR & UART_ISR_MODEM_IF_Msk) - { - if (_uart_cFlowControlMode == 0) - { - uRegMSR = inpw(REG_UARTA_MSR); - - if (uRegMSR & 0x01) - _uart_cCTSState10 = 1; - } - else - _uartCheckModemStatus(UARTA); /* H/W flow control */ - } - - if (uRegISR & UART_ISR_RLS_IF_Msk) - { - uRegFSR = inpw(REG_UARTA_FSR); - U1DEBUG("U10 Irpt_RLS [0x%x]!\n", uRegFSR); - - if (uRegFSR & UART_FSR_BIF_Msk) - _uart_cBIIState_10 = 1; - - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - U1DEBUG("U10 OEI!\n"); - } - } - -} - -static UINT32 _uartTxBufGetNextOne(INT nNum, UINT32 uPointer) -{ - if ((uPointer + 1) == UARTTXBUFSIZE[nNum]) - return (UINT32)NULL; - else - return (uPointer + 1); -} - -static UINT32 _uartRxBufGetNextOne(INT nNum, UINT32 uPointer) -{ - if ((uPointer + 1) == UARTRXBUFSIZE[nNum]) - return (UINT32)NULL; - else - return (uPointer + 1); -} - -static void _uartEnableInterrupt(INT nNum, UINT32 uVal) -{ - UINT32 uReg = 0; - - uReg = inpw(REG_UART0_IER + (nNum * UARTOFFSET)); - uReg |= uVal; - outpw(REG_UART0_IER + (nNum * UARTOFFSET), uReg); -} - -static void _uartDisableInterrupt(INT nNum, UINT32 uVal) -{ - UINT32 uReg = 0; - - if (uVal == DISABLEALLIER) - outpw(REG_UART0_IER + (nNum * UARTOFFSET), 0); - else - { - uReg = inpw(REG_UART0_IER + (nNum * UARTOFFSET)); - uReg &= ~uVal; - outpw(REG_UART0_IER + (nNum * UARTOFFSET), uReg); - } -} - -static void _uartReceiveChars(INT nNum) -{ - //UINT32 volatile uRegLSR, uBuf = 0; - UINT32 volatile uRegFSR, uRegALT_CSR, uRegFUN_SEL, uRegFCR, uRegLINSR, uRegISR; - UINT32 volatile uBuf = 0; - UINT32 volatile uOffset = nNum * UARTOFFSET; - INT nMaxCount = 256; - UCHAR ucChar; - - UART_BUFFER_T *dev; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - //uRegFSR = inpw(REG_UART0_FSR+(nNum * UARTOFFSET)); - uRegFUN_SEL = inpw(REG_UART0_FUN_SEL + uOffset); - - do - { - uRegFSR = inpw(REG_UART0_FSR + uOffset); - uRegLINSR = inpw(REG_UART0_LIN_SR + uOffset); - uRegISR = inpw(REG_UART0_ISR + uOffset); - ucChar = inpb(REG_UART0_RBR + uOffset); - - if ((uRegFSR & UART_FSR_RS485_ADD_DETF_Msk) && (uRegFUN_SEL == 0x3)) - { - uRegALT_CSR = inpw(REG_UART0_ALT_CSR + (nNum * UARTOFFSET)); - uRegFCR = inpw(REG_UART0_FCR + (nNum * UARTOFFSET)); - if (uRegALT_CSR & UART_ALT_CSR_RS485_NMM_Msk) - { - if (ucChar == (uRegALT_CSR >> UART_ALT_CSR_ADDR_MATCH_Pos)) - { - uRegFCR &= ~UART_FCR_RX_DIS_Msk; /* Enable RS485 RX */ - outpw((REG_UART0_FCR + (nNum * UARTOFFSET)), uRegFCR); - } - else - { - uRegFCR |= UART_FCR_RX_DIS_Msk; /* Disable RS485 RX */ - uRegFCR |= UART_FCR_RFR_Msk; /* Clear data from RX FIFO */ - outpw((REG_UART0_FCR + (nNum * UARTOFFSET)), uRegFCR); - break; - } - } - } - - - uBuf = _uartRxBufGetNextOne(nNum, dev->uUartRxTail); - if (uBuf == dev->uUartRxHead) /* Rx buffer full */ - { - //ucChar = inpb(REG_UART0_RBR+(nNum * UARTOFFSET)); - - if (_uart_cHWRXStopped) - U1DEBUG("[%d] buf full!\n", nNum); - - break; - } - - //ucChar = inpb(REG_UART0_RBR+(nNum * UARTOFFSET)); - - dev->pucUartRxBuf[dev->uUartRxTail] = ucChar; - - /* Check LSR for BII, FEI, PEI, OEI */ - dev->pucUARTFlag[dev->uUartRxTail] = 0; - - if (uRegFSR & UART_FSR_BIF_Msk) - { - dev->pucUARTFlag[dev->uUartRxTail] = UART_FSR_BIF_Msk; - U1DEBUG("BIF!\n"); - } - else if (uRegFSR & UART_FSR_FEF_Msk) - { - dev->pucUARTFlag[dev->uUartRxTail] = UART_FSR_FEF_Msk; - U1DEBUG("FEF!\n"); - } - else if (uRegFSR & UART_FSR_PEF_Msk) - { - dev->pucUARTFlag[dev->uUartRxTail] = UART_FSR_PEF_Msk; - U1DEBUG("PEF!\n"); - } - else if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - { - dev->pucUARTFlag[dev->uUartRxTail] = UART_FSR_RX_OVER_IF_Msk; - U1DEBUG("OVER_IF!\n"); - } - else if (uRegFSR & UART_FSR_RS485_ADD_DETF_Msk) - { - dev->pucUARTFlag[dev->uUartRxTail] = UART_FSR_RS485_ADD_DETF_Msk; - U1DEBUG("RS485_ADD_DET_IF!\n"); - } - - if (uRegFUN_SEL == 0x1) - { - if (uRegISR & UART_ISR_LIN_RX_BREAK_IF_Msk) - { - dev->pucLINFlag[dev->uUartRxTail] = uRegLINSR; - - // Clear ISR and LIN Status - outpw(REG_UART0_ISR, UART_ISR_LIN_RX_BREAK_IF_Msk); - outpw(REG_UART0_LIN_SR, 0x30F); - } - } - - dev->uUartRxTail = _uartRxBufGetNextOne(nNum, dev->uUartRxTail); - - /* overrun error is special case, H/W ignore the character */ - if (uRegFSR & UART_FSR_RX_OVER_IF_Msk) - { - dev->pucUARTFlag[dev->uUartRxTail] = UART_FSR_RX_OVER_IF_Msk; - dev->uUartRxTail = _uartRxBufGetNextOne(nNum, dev->uUartRxTail); - } - - uRegFSR = inpw(REG_UART0_FSR + (nNum * UARTOFFSET)); - } - while ((!(uRegFSR & UART_FSR_RX_EMPTY_Msk)) && (nMaxCount-- > 0)); - -} - -static void _uartTransmitChars(INT nNum) -{ - UINT32 volatile i; - - UART_BUFFER_T *dev; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - if (dev->uUartTxHead != dev->uUartTxTail) /* buffer is not empty */ - { - for (i = 0; i < 8; i++) - { - outpw(REG_UART0_THR + (nNum * UARTOFFSET), dev->pucUartTxBuf[dev->uUartTxHead]); - dev->uUartTxHead = _uartTxBufGetNextOne(nNum, dev->uUartTxHead); - - if (dev->uUartTxHead == dev->uUartTxTail) /* buffer empty */ - { - _uartDisableInterrupt(nNum, UART_IER_THRE_IEN_Msk); - break; - } - } - } -} - -/* - Call by uart1ISR(). -*/ -static void _uartCheckModemStatus(INT nNum) -{ - UINT32 volatile uRegMSR; - UINT32 uOffset = nNum * UARTOFFSET; - - UART_BUFFER_T *dev; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - FDEBUG("\n Modem INT\n"); - uRegMSR = inpw(REG_UART0_MSR + uOffset); - if (_uart_cHWTXStopped) - { - if (!(uRegMSR & 0x10)) /* CTS high, external signal is low */ - { - _uart_cHWTXStopped = 0; - FDEBUG("H/W flow control ...\n"); - - /* 2007.11.12 modify, PT23 HHWu */ - if (dev->uUartTxHead != dev->uUartTxTail) /* buffer is not empty */ - { - _uartEnableInterrupt(nNum, UART_IER_THRE_IEN_Msk); /* enable TX empty interrupt */ - FDEBUG("buf not empty, TX continued\n"); - } - } - } - else - { - if (!(uRegMSR & 0x10)) /* CTS low, external signal is high */ - { - _uart_cHWTXStopped = 1; - _uartDisableInterrupt(nNum, UART_IER_THRE_IEN_Msk); /* disable TX empty interrupt */ - FDEBUG("H/W flow control, TX stopped\n"); - } - } -} - -static INT _uartSetBaudRate(INT nNum, UART_T *val) -{ - UINT32 u32Reg; - UINT32 uOffset = nNum * UARTOFFSET; - UINT32 u32Baud_Div; - UINT32 u32Clk = val->uFreq; - UINT32 u32baudrate = val->uBaudRate; - - //if (val->uFreq > 200000000) /* Max frequency 200MHz */ - // return -1; - - u32Baud_Div = UART_BAUD_MODE2_DIVIDER(u32Clk, u32baudrate); - - if (u32Baud_Div > 0xFFFF) - u32Reg = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER(u32Clk, u32baudrate)); - else - u32Reg = (UART_BAUD_MODE2 | u32Baud_Div); - - outpw(REG_UART0_BAUD + uOffset, u32Reg); - - return 0; -} - -static void _uartInstallISR(UINT8 ucNum) -{ - UART_BUFFER_T *dev; - - IRQn_Type IRQ; - - dev = (UART_BUFFER_T *) &UART_DEV[ucNum]; - - if (ucNum == UART0) - { - IRQ = UART0_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart0ISR); - } - else if (ucNum == UART1) - { - IRQ = UART1_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart1ISR); - } - else if (ucNum == UART2) - { - IRQ = UART2_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart2ISR); - } - else if (ucNum == UART3) - { - IRQ = UART3_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart3ISR); - } - else if (ucNum == UART4) - { - IRQ = UART4_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart4ISR); - } - else if (ucNum == UART5) - { - IRQ = UART5_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart5ISR); - } - else if (ucNum == UART6) - { - IRQ = UART6_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart6ISR); - } - else if (ucNum == UART7) - { - IRQ = UART7_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart7ISR); - } - else if (ucNum == UART8) - { - IRQ = UART8_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart8ISR); - } - else if (ucNum == UART9) - { - IRQ = UART9_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart9ISR); - } - else if (ucNum == UARTA) - { - IRQ = UART10_IRQn; - dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)uart10ISR); - } - else - { - return; - } - - //dev->pvUartVector = sysInstallISR((IRQ_LEVEL_1 | HIGH_LEVEL_SENSITIVE), IRQ, (PVOID)pvNewISR); - sysSetLocalInterrupt(ENABLE_IRQ); /* enable CPSR I bit */ - sysEnableInterrupt(IRQ); - //DrvUART_EnableInt(TEST_PORT,(DRVUART_RLSINT|DRVUART_THREINT|DRVUART_RDAINT)); - - -} - -static BOOL _uartBUFSpaceAlloc(INT nNum) -{ - UART_BUFFER_T *dev; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - /* Memory allocate Tx buffer */ - dev->pucUartTxBuf = (PUINT8) malloc(UARTTXBUFSIZE[nNum] * sizeof(UINT8)); - if (dev->pucUartTxBuf == NULL) - return FALSE; - - /* Memory allocate Rx buffer */ - dev->pucUartRxBuf = (PUINT8) malloc(UARTRXBUFSIZE[nNum] * sizeof(UINT8)); - if (dev->pucUartRxBuf == NULL) - { - free(dev->pucUartTxBuf); - return FALSE; - } - - /* Memory allocate Rx character flag */ - dev->pucUARTFlag = (PINT) malloc(UARTRXBUFSIZE[nNum] * sizeof(INT)); - if (dev->pucUARTFlag == NULL) - { - free(dev->pucUartTxBuf); - free(dev->pucUartRxBuf); - return FALSE; - } - - /* initial memory */ - memset(dev->pucUartTxBuf, 0, UARTTXBUFSIZE[nNum] * sizeof(UINT8)); - memset(dev->pucUartRxBuf, 0, UARTRXBUFSIZE[nNum] * sizeof(UINT8)); - memset(dev->pucUARTFlag, 0, UARTRXBUFSIZE[nNum] * sizeof(INT)); - - /* inital struct UART_BUFFER_STRUCT, uUartTxHead, uUartTxTail, uUartRxHead, uUartRxTail */ - dev->uUartTxHead = dev->uUartTxTail = (UINT32)NULL; - dev->uUartRxHead = dev->uUartRxTail = (UINT32)NULL; - - return TRUE; -} - -static BOOL _uartCheckTxBufSpace(INT nNum, UINT32 uHead, UINT32 uTail, UINT32 uLen) -{ - UINT32 uBuf; - - uBuf = _uartTxBufGetNextOne(nNum, uTail); - if (uBuf == uHead) /* Tx buffer full */ - return FALSE; - - if (uHead == uTail) /* Tx buffer empty */ - return TRUE; - - if (uTail > uHead) - { - if (uLen >= (UARTTXBUFSIZE[nNum] - (uTail - uHead))) /* 2007.10.29 fix pointer bug, PT23 HHWu */ - return FALSE; /* Tx buffer space isn't enough */ - else - return TRUE; - } - else - { - /* case: uTail < uHead */ - if (uLen >= (uHead - uTail)) /* 2007.10.29 fix pointer bug, PT23 HHWu */ - return FALSE; /* Tx buffer space isn't enough */ - else - return TRUE; - } - - //return TRUE; -} - -static INT32 _uartReadRxBuf(INT nNum, PUINT8 pucBuf, UINT32 uLen) -{ - UINT32 i; - UINT32 uOffset = nNum * UARTOFFSET; - UART_BUFFER_T *dev; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - if (dev->bIsUseUARTRxInt == TRUE) - { - - // disable Rx interrupt ... - - if (dev->uUartRxHead == dev->uUartRxTail) - return 0; - - for (i = uLen ; i > 0 ; i--) - { - *pucBuf++ = dev->pucUartRxBuf[dev->uUartRxHead]; - dev->uUartRxHead = _uartRxBufGetNextOne(nNum, dev->uUartRxHead); - - if (dev->uUartRxHead == dev->uUartRxTail) - break; - } - - uLen = uLen - i + 1; - } - else /* pooling mode */ - { - for (i = 0 ; i < uLen; i++) - { - while (!(inpw(REG_UART0_FSR + uOffset) & UART_FSR_RX_EMPTY_Msk)); - *pucBuf++ = inpb(REG_UART0_RBR + uOffset); - } - } - - return (uLen); -} - -static void _uartWriteTxBuf(INT nNum, PUINT8 pucBuf, UINT32 uLen) -{ - UINT32 i; - UINT32 uOffset = nNum * UARTOFFSET; - UART_BUFFER_T *dev; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - /* Check interrupt or polling mode first */ - if (dev->bIsUseUARTTxInt == TRUE) - { - while (uLen--) - { - dev->pucUartTxBuf[dev->uUartTxTail] = *pucBuf++; - dev->uUartTxTail = _uartTxBufGetNextOne(nNum, dev->uUartTxTail); - } - - if (!(inpw(REG_UART0_IER + uOffset) & UART_IER_THRE_IEN_Msk)) /* Enable Tx empty interrupt */ - _uartEnableInterrupt(nNum, UART_IER_THRE_IEN_Msk); - } - else /* pooling mode */ - { - for (i = 0 ; i < uLen ; i++) - { - /* Wait until the transmitter buffer is empty */ - while (!(inpw(REG_UART0_FSR + uOffset) & UART_FSR_TE_FLAG_Msk)); - outpw(REG_UART0_THR + uOffset, *pucBuf++); - } - } -} - -static INT _uartConfigureUART(PVOID pvParam) -{ - INT retval; - BOOL bIsMemoryAllocOk; - UINT32 u32Reg; - UINT32 uOffset; - UINT32 uNum = 0; - - UART_T *param = (UART_T *) pvParam; - - uOffset = param->ucUartNo * UARTOFFSET; - uNum = param->ucUartNo; - - /* Check UART channel */ - if (uNum > UARTA) - return UART_ERR_CHANNEL_INVALID; - - /* Check the supplied parity */ - if ((param->ucParity != NU_PARITY_NONE) && - (param->ucParity != NU_PARITY_EVEN) && - (param->ucParity != NU_PARITY_ODD) && - (param->ucParity != (NU_PARITY_ODD | NU_PARITY_STICK)) && - (param->ucParity != (NU_PARITY_EVEN | NU_PARITY_STICK))) - return UART_ERR_PARITY_INVALID; - - /* Check the supplied number of data bits */ - if ((param->ucDataBits != NU_DATA_BITS_5) && - (param->ucDataBits != NU_DATA_BITS_6) && - (param->ucDataBits != NU_DATA_BITS_7) && - (param->ucDataBits != NU_DATA_BITS_8)) - return UART_ERR_DATA_BITS_INVALID; - - /* Check the supplied number of stop bits */ - if ((param->ucStopBits != NU_STOP_BITS_1) && - (param->ucStopBits != NU_STOP_BITS_2)) - return UART_ERR_STOP_BITS_INVALID; - - /* Check the supplied number of trigger level bytes */ - if ((param -> ucUartNo == UART1) || (param -> ucUartNo == UART2) || (param -> ucUartNo == UART4) || - (param -> ucUartNo == UART6) || (param -> ucUartNo == UART8) || (param -> ucUartNo == UARTA)) - { - /* UART1,2,4,6,8,A */ - if ((param->ucRxTriggerLevel != UART_FCR_RFITL_1BYTE) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_4BYTES) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_8BYTES) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_14BYTES) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_30BYTES) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_46BYTES) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_62BYTES)) - return UART_ERR_TRIGGERLEVEL_INVALID; - } - else - { - /* UART0,3,5,7,9 */ - if ((param->ucRxTriggerLevel != UART_FCR_RFITL_1BYTE) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_4BYTES) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_8BYTES) && - (param->ucRxTriggerLevel != UART_FCR_RFITL_30BYTES)) - return UART_ERR_TRIGGERLEVEL_INVALID; - } - - /* Enable UART clock */ - if (param->ucUartNo < ALLCHANNEL) - { - outpw(REG_CLK_PCLKEN0, inpw(REG_CLK_PCLKEN0) | (1 << (16 + param->ucUartNo))); - } - - /* Reset TX/RX FIFOs */ - u32Reg = inpw(REG_UART0_FCR + uOffset); - outpw(REG_UART0_FCR + uOffset, (u32Reg | (0x03 << 1))); - - /* Setup baud rate */ - retval = _uartSetBaudRate(param->ucUartNo, param); - if (retval < 0) - return UART_ERR_SET_BAUDRATE_FAIL; - - /* Setup parity, data bits, and stop bits */ - outpw(REG_UART0_LCR + uOffset, (param->ucParity | param->ucDataBits | param->ucStopBits)); - - /* Setup Rx time out value */ - outpw(REG_UART0_TOR + uOffset, 0x80 + 0x20); - - /* Setup FIFO trigger level */ - outpw(REG_UART0_FCR + uOffset, param->ucRxTriggerLevel); - - /* only exec once unless call uartClose() */ - if (UART_DEV[param->ucUartNo].bIsUARTInitial == FALSE) - { - /* Configure GPIO function */ - //_uartConfigureGPIO(param->ucUartNo); - - /* Allocate Tx, Rx buffer */ - bIsMemoryAllocOk = _uartBUFSpaceAlloc(param->ucUartNo); - if (bIsMemoryAllocOk == FALSE) - return UART_ERR_ALLOC_MEMORY_FAIL; - - /* Hook UART interrupt service routine */ - _uartInstallISR(param->ucUartNo); - - /* Enable Rx interrupt */ - if (UART_DEV[param->ucUartNo].bIsUseUARTRxInt == TRUE) - _uartEnableInterrupt(param->ucUartNo, UART_IER_RDA_IEN_Msk); - - } - - UART_DEV[param->ucUartNo].bIsUARTInitial = TRUE; /* it's important to set TRUE */ - return 0; -} - -static INT _uartPerformIrDA(INT nNum, UINT32 uCmd, UINT32 uCmd1) /* UART2 only */ -{ - UINT32 uOffset = nNum * UARTOFFSET; - UINT32 baud; - - switch (uCmd) - { - case ENABLEIrDA: - //_uart_bIsPerformIrDA = TRUE; - - baud = inpw(REG_UART0_BAUD + uOffset); - baud = baud & (0x0000ffff); - baud = baud + 2; - baud = baud / 16; - baud = baud - 2; - - outpw(REG_UART0_BAUD + uOffset, baud); - - if (uCmd1 == IrDA_TX) - outpw(REG_UART0_IRCR + uOffset, UART_IRCR_TX_SELECT_Msk); - else if (uCmd1 == IrDA_RX) - outpw(REG_UART0_IRCR + uOffset, 0x0); - else - return UART_ERR_IrDA_COMMAND_INVALID; - - outpw(REG_UART0_FUN_SEL + uOffset, 0x2); // Select IrDA mode - - break; - - case DISABLEIrDA: - //_uart_bIsPerformIrDA = FALSE; - outpw(REG_UART0_IRCR + uOffset, 0x40); /* Set default value, INV_TX set 0, INV_RX set 1 */ - outpw(REG_UART0_FUN_SEL + uOffset, 0x0); // Select UART mode - break; - - default: - return UART_ERR_IrDA_COMMAND_INVALID; - } - - return 0; -} - -/* - Remark: - 1. LCR & LSR aren't support yet. -*/ -static INT _uartGetRegisterValue(INT nNum, PVOID pvReg) -{ - INT nCnt = 0; - UINT32 uOffset = nNum * UARTOFFSET; - - UART_REGISTER_T *reg = (UART_REGISTER_T *) pvReg; - - memset(reg, 0, sizeof(UART_REGISTER_T)); - - /* Read IER */ - reg->uUartReg[nCnt][0] = REG_UART0_IER + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_IER + uOffset); - - /* Read FCR */ - reg->uUartReg[nCnt][0] = REG_UART0_FCR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_FCR + uOffset); - - /* Read LCR */ - reg->uUartReg[nCnt][0] = REG_UART0_LCR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_LCR + uOffset); - - /* Read MCR, MSR */ - reg->uUartReg[nCnt][0] = REG_UART0_MCR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_MCR + uOffset); - reg->uUartReg[nCnt][0] = REG_UART0_MSR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_MSR + uOffset); - - /* Read FSR */ - reg->uUartReg[nCnt][0] = REG_UART0_FSR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_FSR + uOffset); - - /* Read ISR */ - reg->uUartReg[nCnt][0] = REG_UART0_ISR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_ISR + uOffset); - - /* Read TOR */ - reg->uUartReg[nCnt][0] = REG_UART0_TOR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_TOR + uOffset); - - /* Read BAUD */ - reg->uUartReg[nCnt][0] = REG_UART0_BAUD + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_BAUD + uOffset); - - /* Read IRCR */ - reg->uUartReg[nCnt][0] = REG_UART0_IRCR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_IRCR + uOffset); - - /* Read ALT_CSR */ - reg->uUartReg[nCnt][0] = REG_UART0_ALT_CSR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_ALT_CSR + uOffset); - - /* Read FUN_SEL */ - reg->uUartReg[nCnt][0] = REG_UART0_FUN_SEL + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_FUN_SEL + uOffset); - - /* Read LIN_CTL */ - reg->uUartReg[nCnt][0] = REG_UART0_LIN_CTL + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_LIN_CTL + uOffset); - - /* Read LIN_SR */ - reg->uUartReg[nCnt][0] = REG_UART0_LIN_SR + uOffset; - reg->uUartReg[nCnt++][1] = inpw(REG_UART0_LIN_SR + uOffset); - - return (nCnt); -} - -/// @endcond HIDDEN_SYMBOLS - -/** @addtogroup N9H30_UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -/** - * @brief The function is used to initial device struct parameters. - * - * @return 0 - */ -INT uartInit(void) -{ - INT i; - - /* Initial UART_BUFFER_T struct */ - for (i = 0; i < UART_NUM ; i++) - UART_DEV[i].bIsUARTInitial = FALSE; - - for (i = 0; i < UART_NUM ; i++) - UART_DEV[i].bIsUseUARTTxInt = TRUE; - - for (i = 0; i < UART_NUM ; i++) - UART_DEV[i].bIsUseUARTRxInt = TRUE; - - return 0; -} - -/** - * @brief The function is used to config UART channel. - * - * @param[in] uart: UART Port. ( UART0 / UART1 / UART2 / UART3 / UART 4 /UART 5 / - * UART6 / UART7 / UART8 / UART9 / UARTA ) - * - * @return UART_EIO: UART config Fail - * Successful: UART config success - */ -INT uartOpen(PVOID uart) -{ - INT nValue = 0; - UART_T *dev = (UART_T *) uart; - - if ((nValue = _uartConfigureUART(uart)) < 0) - { - if (nValue != UART_ERR_CHANNEL_INVALID) - UART_DEV[dev->ucUartNo].nErrno = nValue; - - return UART_EIO; - } - else - UART_DEV[dev->ucUartNo].nErrno = 0; - - return Successful; -} - -/** - * @brief The function is used to read RX FIFO returned data or RX driver buffer. - * - * @param[in] nNum: UART Port. ( UART0 / UART1 / UART2 / UART3 / UART 4 /UART 5 / - * UART6 / UART7 / UART8 / UART9 / UARTA ) - * @param[out] pucBuf: The buffer to receive. - * - * @param[in] uLen: The the read bytes number of data. - * - * @return UART_EIO: UART read Fail - * DataLength: Receive byte count - */ -INT32 uartRead(INT nNum, PUINT8 pucBuf, UINT32 uLen) -{ - UART_BUFFER_T *dev; - INT32 DataLength; - - //if((nNum < UART0) || (nNum > UART4)) - // return UART_ENODEV; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - /* Check UART initial status */ - if (dev->bIsUARTInitial == FALSE) - return UART_EIO; - - /* Check uLen value */ - if ((uLen > UARTRXBUFSIZE[nNum]) || (uLen == 0)) - return UART_EIO; - - DataLength = _uartReadRxBuf(nNum, pucBuf, uLen); - - return (DataLength); - -} - - -/** - * @brief The function is used to write data to TX FIFO directly or TX driver buffer. - * - * @param[in] nNum: UART channel. ( UART0 / UART1 / UART2 / UART3 / UART 4 /UART 5 / - * UART6 / UART7 / UART8 / UART9 / UARTA ) - * @param[out] pucBuf: Transmit buffer pointer. - * - * @param[in] uLen: Transmit buffer length. - * - * @return UART_EIO: UART transmit Fail - * uLen: write length on success - */ -INT32 uartWrite(INT nNum, PUINT8 pucBuf, UINT32 uLen) -{ - BOOL bIsTxBufEnough; - - UART_BUFFER_T *dev; - - //if((nNum < UART0) || (nNum > UART4)) - // return UART_ENODEV; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - dev->nErrno = 0; - - /* Check UART initial status */ - if (dev->bIsUARTInitial == FALSE) - return UART_EIO; - - /* Check uLen value */ - if ((uLen > UARTWRITESIZE) || (uLen == 0)) - return UART_EIO; - - /* Check UART Tx buffer */ - if (dev->bIsUseUARTTxInt == TRUE) - { - bIsTxBufEnough = _uartCheckTxBufSpace(nNum, dev->uUartTxHead, dev->uUartTxTail, uLen); - if (bIsTxBufEnough == FALSE) - { - //sysprintf("Tx buf not enough\n"); - dev->nErrno = UART_ERR_TX_BUF_NOT_ENOUGH; - return UART_EIO; - } - } - - /* Move data to UART Tx buffer then transmit */ - _uartWriteTxBuf(nNum, pucBuf, uLen); - - return (uLen); -} - -/** - * @brief Support some UART driver commands for application. - * - * @param[in] nNum: UART channel. ( UART0 / UART1 / UART2 / UART3 / UART 4 /UART 5 / - * UART6 / UART7 / UART8 / UART9 / UARTA ) - * - * @param[in] uCmd: Command. - * - * @param[in] uArg0: Arguments for the command. - * - * @param[in] uArg1: Arguments for the command. - * - * @return UART_ENODEV: UART channel out of range - * UART_EIO: No activated or argument error or configure UART fail - * Successful: Success - */ -INT uartIoctl(INT nNum, UINT32 uCmd, UINT32 uArg0, UINT32 uArg1) -{ - INT32 retval; - UINT32 uReg; - UINT32 uOffset = nNum * UARTOFFSET; - - UART_BUFFER_T *dev; - - if ((nNum < UART0) || (nNum > UARTA)) - return UART_ENODEV; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - /* Check UART initial status */ - if (dev->bIsUARTInitial == FALSE) - { - if ((uCmd != UART_IOC_GETERRNO) && - (uCmd != UART_IOC_GETUARTREGISTERVALUE)) - return UART_EIO; - } - - switch (uCmd) - { - case UART_IOC_SETTXMODE: - if (uArg0 == UARTINTMODE) - dev->bIsUseUARTTxInt = TRUE; - else if (uArg0 == UARTPOLLMODE) - dev->bIsUseUARTTxInt = FALSE; - else - { - dev->nErrno = UART_ERR_OPERATE_MODE_INVALID; - return UART_EIO; - } - - break; - - case UART_IOC_SETRXMODE: - if (uArg0 == UARTINTMODE) - { - dev->bIsUseUARTRxInt = TRUE; - _uartEnableInterrupt(nNum, UART_IER_RDA_IEN_Msk); - } - else if (uArg0 == UARTPOLLMODE) - { - dev->bIsUseUARTRxInt = FALSE; - _uartDisableInterrupt(nNum, UART_IER_RDA_IEN_Msk); - } - else - { - dev->nErrno = UART_ERR_OPERATE_MODE_INVALID; - return UART_EIO; - } - - break; - - case UART_IOC_GETRECCHARINFO: // ..... not test yet - memcpy((PVOID) uArg0, (PVOID) dev, sizeof(struct UART_BUFFER_STRUCT)); - break; - - case UART_IOC_SETUARTPARAMETER: // ..... not test yet - if ((retval = _uartConfigureUART((PVOID) uArg0)) < 0) - { - dev->nErrno = retval; - return UART_EIO; - } - - break; - - case UART_IOC_PERFORMIrDA: - - if ((retval = _uartPerformIrDA(nNum, uArg0, uArg1)) < 0) - { - dev->nErrno = retval; - return UART_EIO; - } - - break; - - case UART_IOC_GETUARTREGISTERVALUE: - return (_uartGetRegisterValue(nNum, (PVOID) uArg0)); - //break; - - case UART_IOC_GETERRNO: - *(PUINT32)uArg0 = dev->nErrno; - break; - - case UART_IOC_SETMODEMINTERRUPT: - - if (uArg0 == UART_ENABLE_MODEM_INT) - _uartEnableInterrupt(nNum, UART_IER_MODEM_IEN_Msk); - else if (uArg0 == UART_DISABLE_MODEM_INT) - _uartDisableInterrupt(nNum, UART_IER_MODEM_IEN_Msk); - else - return UART_EIO; - - break; - - case UART_IOC_GETCTSSTATE: - - if (nNum == UART1) - { - *(PUINT32)uArg0 = _uart_cCTSState1; /* CTS state */ - _uart_cCTSState1 = 0; - } - else if (nNum == UART2) - { - *(PUINT32)uArg0 = _uart_cCTSState2; /* CTS state */ - _uart_cCTSState2 = 0; - } - else if (nNum == UART3) - { - *(PUINT32)uArg0 = _uart_cCTSState3; /* CTS state */ - _uart_cCTSState3 = 0; - } - else if (nNum == UART4) - { - *(PUINT32)uArg0 = _uart_cCTSState4; /* CTS state */ - _uart_cCTSState4 = 0; - } - else if (nNum == UART5) - { - *(PUINT32)uArg0 = _uart_cCTSState5; /* CTS state */ - _uart_cCTSState5 = 0; - } - else if (nNum == UART6) - { - *(PUINT32)uArg0 = _uart_cCTSState6; /* CTS state */ - _uart_cCTSState6 = 0; - } - else if (nNum == UART7) - { - *(PUINT32)uArg0 = _uart_cCTSState7; /* CTS state */ - _uart_cCTSState7 = 0; - } - else if (nNum == UART8) - { - *(PUINT32)uArg0 = _uart_cCTSState8; /* CTS state */ - _uart_cCTSState8 = 0; - } - else if (nNum == UART9) - { - *(PUINT32)uArg0 = _uart_cCTSState9; /* CTS state */ - _uart_cCTSState9 = 0; - } - else if (nNum == UARTA) - { - *(PUINT32)uArg0 = _uart_cCTSState10; /* CTS state */ - _uart_cCTSState10 = 0; - } - - *(PUINT32)uArg1 = (inpw(REG_UART0_MSR + uOffset) & (1 << 4)) >> 4; /* get CTS# value */ - - break; - - case UART_IOC_SETRTSSIGNAL: - - if (uArg0 == UART_RTS_HIGH) /* set RTS signal high */ - outpw(REG_UART0_MCR + uOffset, inpw(REG_UART0_MCR + uOffset) & ~0x02); - else if (uArg0 == UART_RTS_LOW) /* set RTS signal low */ - outpw(REG_UART0_MCR + uOffset, inpw(REG_UART0_MCR + uOffset) | 0x02); - else - return UART_EIO; - - break; - - case UART_IOC_SETINTERRUPT: - if (uArg0 == 1) /* enable interrupt */ - _uartEnableInterrupt(nNum, uArg1); - else if (uArg0 == 0) /* disable interrupt */ - _uartDisableInterrupt(nNum, uArg1); - else - return UART_EIO; - - break; - - case UART_IOC_SETBREAKCONTROL: - uReg = inpw(REG_UART0_LCR + uOffset); - if (uArg0 == 1) /* set break contorl bit */ - { - uReg |= UART_LCR_BCB_Msk; - outpw(REG_UART0_LCR + uOffset, uReg); - } - else if (uArg0 == 0) /* clear break contorl bit */ - { - uReg &= ~UART_LCR_BCB_Msk; - outpw(REG_UART0_LCR + uOffset, uReg); - } - else - return UART_EIO; - - break; - - case UART_IOC_GETBIISTATE: - switch (nNum) - { - case UART0: - *(PUINT32)uArg0 = _uart_cBIIState_0; - break; - case UART1: - *(PUINT32)uArg0 = _uart_cBIIState_1; - break; - case UART2: - *(PUINT32)uArg0 = _uart_cBIIState_2; - break; - case UART3: - *(PUINT32)uArg0 = _uart_cBIIState_3; - break; - case UART4: - *(PUINT32)uArg0 = _uart_cBIIState_4; - break; - case UART5: - *(PUINT32)uArg0 = _uart_cBIIState_5; - break; - case UART6: - *(PUINT32)uArg0 = _uart_cBIIState_6; - break; - case UART7: - *(PUINT32)uArg0 = _uart_cBIIState_7; - break; - case UART8: - *(PUINT32)uArg0 = _uart_cBIIState_8; - break; - case UART9: - *(PUINT32)uArg0 = _uart_cBIIState_9; - break; - case UARTA: - *(PUINT32)uArg0 = _uart_cBIIState_10; - break; - - default: - break; - } - break; - - /* H/W S/W flow control function */ - case UART_IOC_ENABLEHWFLOWCONTROL: - - /* H/W & S/W are alternative */ - if (_uart_cFlowControlMode == SWFLOWCONTROL) - return UART_EIO; - - _uart_cFlowControlMode = HWFLOWCONTROL; - - /* Implement H/W flow control on TX & RX interrupt mode. */ - //dev->bIsUseUARTTxInt = TRUE; - //dev->bIsUseUARTRxInt = TRUE; - _uartEnableInterrupt(nNum, UART_IER_RDA_IEN_Msk); - - /* - Set up RTS mechanism. - In uartReceiveChars(), if uRecCnt >= _uart_nMaxRxBuf then set RTS high to stop RX. - In uartReadRxBuf(), if uRecCnt <= _uart_nMinRxBuf then set RTS low to re-start RX. - */ - //_uart_nMaxRxBuf = (UARTRXBUFSIZE[nNum] * 3) / 4; - //_uart_nMinRxBuf = UARTRXBUFSIZE[nNum] / 2; - //FDEBUG("max[%d] min[%d]\n", _uart_nMaxRxBuf, _uart_nMinRxBuf); - - /* Set RTS high level trigger */ - outpw(REG_UART0_MCR + uOffset, (inpw(REG_UART0_MCR + uOffset) | UART_RTS_IS_HIGH_LEV_TRG)); - /* Set RTS high level trigger */ - outpw(REG_UART0_MSR + uOffset, (inpw(REG_UART0_MSR + uOffset) | UART_CTS_IS_HIGH_LEV_TRG)); - - /* Set Auto CTS/RTS */ - outpw(REG_UART0_IER + uOffset, inpw(REG_UART0_IER + uOffset) | (0x3 << 12)); - - /* Enable MODEM status interrupt */ - //_uartEnableInterrupt(nNum, UART_IER_MODEM_IEN_Msk); - - /* - Maintain H/W flow control flag by read Modem Status Register. - If CTS high, stop TX. - If CTS low, start TX. - */ - //if( inpw(REG_UART0_MSR+uOffset) & 0x10 ) /* CTS external signal is low */ - // _uart_cHWTXStopped = 0; /* TX started */ - //else /* CTS external signal is high */ - // _uart_cHWTXStopped = 1; /* TX stopped */ - - /* Set RTS as logic 0, RX re-start */ - //outpb(REG_UART0_MCR+uOffset, inpb(REG_UART0_MCR+uOffset) | 0x02); /* set RTS signal low */ - //_uart_cHWRXStopped = 0; // RX started - break; - - case UART_IOC_DISABLEHWFLOWCONTROL: - - /* Disable MODEM status interrupt */ - _uartDisableInterrupt(nNum, UART_IER_MODEM_IEN_Msk); - _uart_cFlowControlMode = 0; - _uart_cHWTXStopped = 0; - _uart_cHWRXStopped = 0; - break; - - case UART_IOC_FLUSH_TX_BUFFER: - dev->uUartTxTail = 0; - dev->uUartTxHead = 0; - break; - - case UART_IOC_FLUSH_RX_BUFFER: - dev->uUartRxTail = 0; - dev->uUartRxHead = 0; - break; - - case UART_IOC_SET_RS485_MODE: - outpw((REG_UART0_FUN_SEL + uOffset), 0x3); - outpw((REG_UART0_MCR + uOffset), 0x0); - outpw((REG_UART0_LCR + uOffset), (UART_LCR_SPE_Msk | UART_LCR_EPE_Msk | UART_LCR_PBE_Msk | (0x3 << UART_LCR_WLS_Pos))); - outpw((REG_UART0_ALT_CSR + uOffset), uArg0 | (uArg1 << UART_ALT_CSR_ADDR_MATCH_Pos)); - break; - - case UART_IOC_SEND_RS485_ADDRESS: - - while (!((inpw(REG_UART0_FSR + uOffset)) & UART_FSR_TE_FLAG_Msk)); - uReg = inpw(REG_UART0_LCR + uOffset); - outpw((REG_UART0_LCR + uOffset), (UART_LCR_SPE_Msk | UART_LCR_PBE_Msk | (0x3 << UART_LCR_WLS_Pos))); - outpw((REG_UART0_THR + uOffset), uArg0); - while (!((inpw(REG_UART0_FSR + uOffset)) & UART_FSR_TE_FLAG_Msk)); - - outpw((REG_UART0_LCR + uOffset), uReg); - - break; - - case UART_IOC_SET_RS485_RXOFF: - uReg = inpw(REG_UART0_FCR + uOffset); - if (uArg0 == 1) - uReg |= UART_FCR_RX_DIS_Msk; - else - uReg &= ~UART_FCR_RX_DIS_Msk; - - outpw((REG_UART0_FCR + uOffset), uReg); - - break; - - case UART_IOC_SET_ALTCTL_REG: - - outpw((REG_UART0_ALT_CSR + uOffset), uArg0); - - break; - - case UART_IOC_GET_ALTCTL_REG: - - *(PUINT32)uArg0 = inpw(REG_UART0_ALT_CSR + uOffset); - - break; - - case UART_IOC_SET_LIN_MODE: - - outpw((REG_UART0_FUN_SEL + uOffset), 0x1); // Select LIN function - - /* Select LIN function setting : Tx enable, Rx enable and break field length */ - uReg = inpw(REG_UART0_ALT_CSR + uOffset); - uReg &= ~(UART_ALT_CSR_LIN_TX_EN_Msk | UART_ALT_CSR_LIN_RX_EN_Msk | UART_ALT_CSR_UA_LIN_BKFL_Msk); - uReg |= (uArg0 | (uArg1 << UART_ALT_CSR_UA_LIN_BKFL_Pos)); - outpw((REG_UART0_ALT_CSR + uOffset), uReg); - - break; - - default: - return UART_ENOTTY; - } - - return Successful; -} - -/** - * @brief Release memory resource, disable interrupt. - * - * @param[in] nNum: UART channel. ( UART0 / UART1 / UART2 / UART3 / UART 4 /UART 5 / - * UART6 / UART7 / UART8 / UART9 / UARTA ) - * - * @return UART_ENODEV: UART channel out of range - * UART_EIO: No activated - * Successful: Success - */ -INT32 uartRelease(INT nNum) -{ - UART_BUFFER_T *dev; - - if ((nNum < UART0) || (nNum > UARTA)) - return UART_ENODEV; - - dev = (UART_BUFFER_T *) &UART_DEV[nNum]; - - /* Check UART initial status */ - if (dev->bIsUARTInitial == FALSE) - return UART_EIO; - - /* Disable all interrupt of the specific UART */ - _uartDisableInterrupt(nNum, DISABLEALLIER); - - /* Free memory */ - free(dev->pucUartTxBuf); - free(dev->pucUartRxBuf); - free(dev->pucUARTFlag); - - /* Initial parameter */ - dev->bIsUARTInitial = FALSE; /* it's important */ - - return Successful; -} - -/*@}*/ /* end of group N9H30_UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_UART_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ -#else -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_uart.h" - -/** - * @brief Open and set UART function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The baudrate of UART module. - * - * @return None - * - * @details This function use to enable UART function and set baud-rate. - */ -void UART_Open(UART_T *uart, uint32_t u32baudrate) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - //uint32_t u32ClkTbl[4] = {XIN, LXT, ACLK, UCLK}; - uint32_t u32ClkTbl[4] = {12000000, 0, 75000000, 150000000}; - uint32_t u32Baud_Div = 0ul; - - if ((uint32_t)uart == UART0_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART1_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART2_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART3_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART4_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART5_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART6_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART7_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART8_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART9_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UARTA_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 21)) >> 21; - } - - /* Select UART function */ - uart->FUNCSEL = UART_FUNCSEL_UART; - - /* Set UART line configuration */ - uart->LINE = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1; - - /* Set UART Rx and RTS trigger level */ - uart->FIFO &= ~(UART_FIFO_RFITL_Msk | UART_FIFO_RTSTRGLV_Msk); - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 2ul) // ACLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - if (u32UartClkSrcSel == 3ul) // PCLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } -} - -void UART_Close(UART_T *uart) -{ - uart->INTEN = 0ul; -} - -/** - * @brief Set UART line configuration - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The register value of baudrate of UART module. - * If u32baudrate = 0, UART baudrate will not change. - * @param[in] u32data_width The data length of UART module. - * - \ref UART_WORD_LEN_5 - * - \ref UART_WORD_LEN_6 - * - \ref UART_WORD_LEN_7 - * - \ref UART_WORD_LEN_8 - * @param[in] u32parity The parity setting (none/odd/even/mark/space) of UART module. - * - \ref UART_PARITY_NONE - * - \ref UART_PARITY_ODD - * - \ref UART_PARITY_EVEN - * - \ref UART_PARITY_MARK - * - \ref UART_PARITY_SPACE - * @param[in] u32stop_bits The stop bit length (1/1.5/2 bit) of UART module. - * - \ref UART_STOP_BIT_1 - * - \ref UART_STOP_BIT_1_5 - * - \ref UART_STOP_BIT_2 - * - * @return None - * - * @details This function use to config UART line setting. - */ -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - //uint32_t u32ClkTbl[4] = {XIN, LXT, ACLK, UCLK}; - uint32_t u32ClkTbl[4] = {12000000, 32768, 75000000, 150000000}; - uint32_t u32Baud_Div = 0ul; - - - if ((uint32_t)uart == UART0_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART1_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART2_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART3_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART4_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART5_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART6_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART7_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART8_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART9_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UARTA_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 21)) >> 21; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 2ul) // ACLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - if (u32UartClkSrcSel == 3ul) // PCLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } - - /* Set UART line configuration */ - uart->LINE = u32data_width | u32parity | u32stop_bits; -} -#endif - - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_usbd.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_usbd.c deleted file mode 100644 index 1ed8a1670a7..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_usbd.c +++ /dev/null @@ -1,619 +0,0 @@ -/**************************************************************************//** - * @file usbd.c - * @brief N9H30 USBD driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "N9H30.h" -#include "nu_usbd.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_USBD_Driver USBD Driver - @{ -*/ - - -/** @addtogroup N9H30_USBD_EXPORTED_FUNCTIONS USBD Exported Functions - @{ -*/ -/*--------------------------------------------------------------------------*/ -/// @cond HIDDEN_SYMBOLS - -/*!< Global variables for Control Pipe */ -S_USBD_CMD_T gUsbCmd; -S_USBD_INFO_T *g_usbd_sInfo; - -VENDOR_REQ g_usbd_pfnVendorRequest = 0; -CLASS_REQ g_usbd_pfnClassRequest = 0; -SET_INTERFACE_REQ g_usbd_pfnSetInterface = 0; -uint32_t g_u32EpStallLock = 0; /*!< Bit map flag to lock specified EP when SET_FEATURE */ - -static uint8_t *g_usbd_CtrlInPointer = 0; -static uint32_t g_usbd_CtrlMaxPktSize = 64; -static uint8_t g_usbd_UsbConfig = 0; -static uint8_t g_usbd_UsbAltInterface = 0; -static uint8_t g_usbd_EnableTestMode = 0; -static uint8_t g_usbd_TestSelector = 0; - -#ifdef __ICCARM__ - #pragma data_alignment=4 - static uint8_t g_usbd_buf[12]; -#else - static uint8_t g_usbd_buf[12] __attribute__((aligned(4))); -#endif - - -uint8_t volatile g_usbd_Configured = 0; -uint8_t g_usbd_CtrlZero = 0; -uint8_t g_usbd_UsbAddr = 0; -uint8_t g_usbd_ShortPacket = 0; -uint32_t volatile g_usbd_DmaDone = 0; -uint32_t g_usbd_CtrlInSize = 0; -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief USBD Initial - * - * @param[in] param Descriptor - * @param[in] pfnClassReq Class Request Callback Function - * @param[in] pfnSetInterface SetInterface Request Callback Function - * - * @return None - * - * @details This function is used to initial USBD. - */ -void USBD_Open(S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface) -{ - /* Select Vbus detect pin -> GPH0 */ - outpw(REG_SYS_GPH_MFPL, (inpw(REG_SYS_GPH_MFPL) & ~0xf) | 0x7); - /* Enable USB device clock */ - outpw(REG_CLK_HCLKEN, inpw(REG_CLK_HCLKEN) | 0x80000); - - g_usbd_sInfo = param; - g_usbd_pfnClassRequest = pfnClassReq; - g_usbd_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - g_usbd_CtrlMaxPktSize = g_usbd_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ - /* Enable PHY */ - USBD_ENABLE_PHY(); - /* wait PHY clock ready */ - while (1) - { - USBD->EP[EPA].EPMPS = 0x20; - if (USBD->EP[EPA].EPMPS == 0x20) - break; - } - /* Force SE0, and then clear it to connect*/ - USBD_SET_SE0(); -} - -/** - * @brief USBD Start - * - * @return None - * - * @details This function is used to start transfer - */ -void USBD_Start(void) -{ - USBD_CLR_SE0(); -} - -/** - * @brief Process Setup Packet - * - * @return None - * - * @details This function is used to process Setup packet. - */ -void USBD_ProcessSetupPacket(void) -{ - // Setup packet process - gUsbCmd.bmRequestType = (uint8_t)(USBD->SETUP1_0 & 0xff); - gUsbCmd.bRequest = (int8_t)(USBD->SETUP1_0 >> 8) & 0xff; - gUsbCmd.wValue = (uint16_t)USBD->SETUP3_2; - gUsbCmd.wIndex = (uint16_t)USBD->SETUP5_4; - gUsbCmd.wLength = (uint16_t)USBD->SETUP7_6; - - /* USB device request in setup packet: offset 0, D[6..5]: 0=Standard, 1=Class, 2=Vendor, 3=Reserved */ - switch (gUsbCmd.bmRequestType & 0x60) - { - case REQ_STANDARD: // Standard - { - USBD_StandardRequest(); - break; - } - case REQ_CLASS: // Class - { - if (g_usbd_pfnClassRequest != NULL) - { - g_usbd_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: // Vendor - { - if (g_usbd_pfnVendorRequest != NULL) - { - g_usbd_pfnVendorRequest(); - } - break; - } - default: // reserved - { - /* Setup error, stall the device */ - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - break; - } - } -} - -/** - * @brief Get Descriptor request - * - * @return None - * - * @details This function is used to process GetDescriptor request. - */ -int USBD_GetDescriptor(void) -{ - uint32_t u32Len; - - u32Len = gUsbCmd.wLength; - g_usbd_CtrlZero = 0; - - switch ((gUsbCmd.wValue & 0xff00) >> 8) - { - // Get Device Descriptor - case DESC_DEVICE: - { - u32Len = Minimum(u32Len, LEN_DEVICE); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8DevDesc, u32Len); - break; - } - // Get Configuration Descriptor - case DESC_CONFIG: - { - uint32_t u32TotalLen; - - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8); - - u32Len = Minimum(u32Len, u32TotalLen); - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - g_usbd_CtrlZero = 1; - - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8ConfigDesc, u32Len); - break; - } - // Get Qualifier Descriptor - case DESC_QUALIFIER: - { - u32Len = Minimum(u32Len, LEN_QUALIFIER); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8QualDesc, u32Len); - break; - } - // Get Other Speed Descriptor - Full speed - case DESC_OTHERSPEED: - { - uint32_t u32TotalLen; - - u32TotalLen = g_usbd_sInfo->gu8OtherConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8OtherConfigDesc[2] + (u32TotalLen << 8); - - u32Len = Minimum(u32Len, u32TotalLen); - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - g_usbd_CtrlZero = 1; - - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8OtherConfigDesc, u32Len); - break; - } - // Get HID Descriptor - case DESC_HID: - { - u32Len = Minimum(u32Len, LEN_HID); - USBD_MemCopy(g_usbd_buf, (uint8_t *)&g_usbd_sInfo->gu8ConfigDesc[LEN_CONFIG + LEN_INTERFACE], u32Len); - USBD_PrepareCtrlIn(g_usbd_buf, u32Len); - break; - } - // Get Report Descriptor - case DESC_HID_RPT: - { - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - g_usbd_CtrlZero = 1; - - u32Len = Minimum(u32Len, g_usbd_sInfo->gu32HidReportSize[gUsbCmd.wIndex & 0xff]); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8HidReportDesc[gUsbCmd.wIndex & 0xff], u32Len); - break; - } - // Get String Descriptor - case DESC_STRING: - { - // Get String Descriptor - if ((gUsbCmd.wValue & 0xff) < 4) - { - u32Len = Minimum(u32Len, g_usbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xff][0]); - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - g_usbd_CtrlZero = 1; - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xff], u32Len); - } - else - { - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - return 1; - } - break; - } - default: - // Not support. Reply STALL. - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - return 1; - } - return 0; -} - - -/** - * @brief Process USB standard request - * - * @return None - * - * @details This function is used to process USB Standard Request. - */ -void USBD_StandardRequest(void) -{ - /* clear global variables for new request */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0; - - if (gUsbCmd.bmRequestType & 0x80) /* request data transfer direction */ - { - // Device to host - switch (gUsbCmd.bRequest) - { - case GET_CONFIGURATION: - { - // Return current configuration setting - USBD_PrepareCtrlIn((uint8_t *)&g_usbd_UsbConfig, 1); - - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_DESCRIPTOR: - { - if (!USBD_GetDescriptor()) - { - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - } - break; - } - case GET_INTERFACE: - { - // Return current interface setting - USBD_PrepareCtrlIn((uint8_t *)&g_usbd_UsbAltInterface, 1); - - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_STATUS: - { - // Device - if (gUsbCmd.bmRequestType == 0x80) - { - if (g_usbd_sInfo->gu8ConfigDesc[7] & 0x40) - g_usbd_buf[0] = 1; // Self-Powered - else - g_usbd_buf[0] = 0; // bus-Powered - } - // Interface - else if (gUsbCmd.bmRequestType == 0x81) - g_usbd_buf[0] = 0; - // Endpoint - else if (gUsbCmd.bmRequestType == 0x82) - { - uint8_t ep = gUsbCmd.wIndex & 0xF; - g_usbd_buf[0] = USBD_GetStall(ep) ? 1 : 0; - } - g_usbd_buf[1] = 0; - USBD_PrepareCtrlIn(g_usbd_buf, 2); - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - break; - } - } - } - else - { - // Host to device - switch (gUsbCmd.bRequest) - { - case CLEAR_FEATURE: - { - if ((gUsbCmd.wValue & 0xff) == FEATURE_ENDPOINT_HALT) - { - - int32_t epNum, i; - - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_u32EpStallLock is added to support it */ - epNum = gUsbCmd.wIndex & 0xF; - for (i = 0; i < USBD_MAX_EP; i++) - { - if ((((USBD->EP[i].EPCFG & 0xf0) >> 4) == epNum) && ((g_u32EpStallLock & (1 << i)) == 0)) - { - USBD->EP[i].EPRSPCTL = (USBD->EP[i].EPRSPCTL & 0xef) | USB_EP_RSPCTL_TOGGLE; - } - } - } - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_ADDRESS: - { - g_usbd_UsbAddr = (uint8_t)gUsbCmd.wValue; - - // DATA IN for end of setup - /* Status Stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_CONFIGURATION: - { - g_usbd_UsbConfig = (uint8_t)gUsbCmd.wValue; - g_usbd_Configured = 1; - // DATA IN for end of setup - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_FEATURE: - { - if ((gUsbCmd.wValue & 0x3) == 2) /* TEST_MODE*/ - { - g_usbd_EnableTestMode = 1; - g_usbd_TestSelector = gUsbCmd.wIndex >> 8; - } - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_INTERFACE: - { - g_usbd_UsbAltInterface = (uint8_t)gUsbCmd.wValue; - if (g_usbd_pfnSetInterface != NULL) - g_usbd_pfnSetInterface(g_usbd_UsbAltInterface); - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - break; - } - } - } -} - -#define TEST_J 0x01 /*!< TEST J \hideinitializer */ -#define TEST_K 0x02 /*!< TEST K \hideinitializer */ -#define TEST_SE0_NAK 0x03 /*!< TEST SE0 \hideinitializer */ -#define TEST_PACKET 0x04 /*!< TEST Packet \hideinitializer */ -#define TEST_FORCE_ENABLE 0x05 /*!< TEST Force enable \hideinitializer */ - - -/** - * @brief Update Device State - * - * @return None - * - * @details This function is used to update Device state when Setup packet complete - */ -void USBD_UpdateDeviceState(void) -{ - switch (gUsbCmd.bRequest) - { - case SET_ADDRESS: - { - USBD_SET_ADDR(g_usbd_UsbAddr); - break; - } - case SET_CONFIGURATION: - { - if (g_usbd_UsbConfig == 0) - { - int volatile i; - /* Reset PID DATA0 */ - for (i = 0; i < USBD_MAX_EP; i++) - { - if (USBD->EP[i].EPCFG & 0x1) - { - USBD->EP[i].EPRSPCTL = USB_EP_RSPCTL_TOGGLE; - } - } - } - break; - } - case SET_FEATURE: - { - if (gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - USBD_SetStall(gUsbCmd.wIndex & 0xF); - else if (g_usbd_EnableTestMode) - { - g_usbd_EnableTestMode = 0; - if (g_usbd_TestSelector == TEST_J) - USBD->TEST = TEST_J; - else if (g_usbd_TestSelector == TEST_K) - USBD->TEST = TEST_K; - else if (g_usbd_TestSelector == TEST_SE0_NAK) - USBD->TEST = TEST_SE0_NAK; - else if (g_usbd_TestSelector == TEST_PACKET) - USBD->TEST = TEST_PACKET; - else if (g_usbd_TestSelector == TEST_FORCE_ENABLE) - USBD->TEST = TEST_FORCE_ENABLE; - } - break; - } - case CLEAR_FEATURE: - { - if (gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - USBD_ClearStall(gUsbCmd.wIndex & 0xF); - break; - } - default: - ; - } -} - - -/** - * @brief Prepare Control IN transaction - * - * @param[in] pu8Buf Control IN data pointer - * @param[in] u32Size IN transfer size - * - * @return None - * - * @details This function is used to prepare Control IN transfer - */ -void USBD_PrepareCtrlIn(uint8_t *pu8Buf, uint32_t u32Size) -{ - g_usbd_CtrlInPointer = pu8Buf; - g_usbd_CtrlInSize = u32Size; -} - - - -/** - * @brief Start Control IN transfer - * - * @return None - * - * @details This function is used to start Control IN - */ -void USBD_CtrlIn(void) -{ - int volatile i; - uint32_t volatile count; - - // Process remained data - if (g_usbd_CtrlInSize >= g_usbd_CtrlMaxPktSize) - { - // Data size > MXPLD - for (i = 0; i < (g_usbd_CtrlMaxPktSize >> 2); i++, g_usbd_CtrlInPointer += 4) - USBD->cep.CEPDAT = *(uint32_t *)g_usbd_CtrlInPointer; - USBD_START_CEP_IN(g_usbd_CtrlMaxPktSize); - g_usbd_CtrlInSize -= g_usbd_CtrlMaxPktSize; - } - else - { - // Data size <= MXPLD - for (i = 0; i < (g_usbd_CtrlInSize >> 2); i++, g_usbd_CtrlInPointer += 4) - USBD->cep.CEPDAT = *(uint32_t *)g_usbd_CtrlInPointer; - - count = g_usbd_CtrlInSize % 4; - for (i = 0; i < count; i++) - USBD->cep.CEPDAT_BYTE = *(uint8_t *)(g_usbd_CtrlInPointer + i); - - USBD_START_CEP_IN(g_usbd_CtrlInSize); - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0; - } -} - -/** - * @brief Start Control OUT transaction - * - * @param[in] pu8Buf Control OUT data pointer - * @param[in] u32Size OUT transfer size - * - * @return None - * - * @details This function is used to start Control OUT transfer - */ -void USBD_CtrlOut(uint8_t *pu8Buf, uint32_t u32Size) -{ - int volatile i; - - while (1) - { - if (USBD->CEPINTSTS & USBD_CEPINTSTS_RXPKIF_Msk) - { - for (i = 0; i < u32Size; i++) - *(uint8_t *)(pu8Buf + i) = USBD->cep.CEPDAT_BYTE; - USBD->CEPINTSTS = USBD_CEPINTSTS_RXPKIF_Msk; - break; - } - } -} - -/** - * @brief Clear all software flags - * - * @return None - * - * @details This function is used to clear all software control flag - */ -void USBD_SwReset(void) -{ - // Reset all variables for protocol - g_usbd_UsbAddr = 0; - g_usbd_DmaDone = 0; - g_usbd_ShortPacket = 0; - g_usbd_Configured = 0; - - // Reset USB device address - USBD_SET_ADDR(0); -} - -/** - * @brief USBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set USBD vendor request callback function - */ -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq) -{ - g_usbd_pfnVendorRequest = pfnVendorReq; -} - - -/*@}*/ /* end of group N9H30_USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_USBD_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wdt.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wdt.c deleted file mode 100644 index 70bb6f5a67e..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wdt.c +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************//** - * @file wdt.c - * @brief NUC980 series WDT driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nu_wdt.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Initialize WDT and start counting - * - * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: - * - \ref WDT_TIMEOUT_2POW4 - * - \ref WDT_TIMEOUT_2POW6 - * - \ref WDT_TIMEOUT_2POW8 - * - \ref WDT_TIMEOUT_2POW10 - * - \ref WDT_TIMEOUT_2POW12 - * - \ref WDT_TIMEOUT_2POW14 - * - \ref WDT_TIMEOUT_2POW16 - * - \ref WDT_TIMEOUT_2POW18 - * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: - * - \ref WDT_RESET_DELAY_1026CLK - * - \ref WDT_RESET_DELAY_130CLK - * - \ref WDT_RESET_DELAY_18CLK - * - \ref WDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable WDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - */ -void WDT_Open(UINT32 u32TimeoutInterval, - UINT32 u32ResetDelay, - UINT32 u32EnableReset, - UINT32 u32EnableWakeup) -{ - - outpw(REG_WDT_ALTCTL, u32ResetDelay); - outpw(REG_WDT_CTL, u32TimeoutInterval | 0x80 | - (u32EnableReset << 1) | - (u32EnableWakeup << 4)); - return; -} - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wwdt.c b/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wwdt.c deleted file mode 100644 index 56eafed69d3..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Driver/Source/nu_wwdt.c +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************//** - * @file wwdt.c - * @brief N9H30 WWDT driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "N9H30.h" -#include "nu_sys.h" -#include "nu_wwdt.h" - -/** @addtogroup N9H30_Device_Driver N9H30 Device Driver - @{ -*/ - -/** @addtogroup N9H30_WWDT_Driver WWDT Driver - @{ -*/ - - -/** @addtogroup N9H30_WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - - -/** - * @brief This function make WWDT module start counting with different counter period and compared window value - * @param[in] u32PreScale Prescale period for the WWDT counter period. Valid values are: - * - \ref WWDT_PRESCALER_1 - * - \ref WWDT_PRESCALER_2 - * - \ref WWDT_PRESCALER_4 - * - \ref WWDT_PRESCALER_8 - * - \ref WWDT_PRESCALER_16 - * - \ref WWDT_PRESCALER_32 - * - \ref WWDT_PRESCALER_64 - * - \ref WWDT_PRESCALER_128 - * - \ref WWDT_PRESCALER_192 - * - \ref WWDT_PRESCALER_256 - * - \ref WWDT_PRESCALER_384 - * - \ref WWDT_PRESCALER_512 - * - \ref WWDT_PRESCALER_768 - * - \ref WWDT_PRESCALER_1024 - * - \ref WWDT_PRESCALER_1536 - * - \ref WWDT_PRESCALER_2048 - * @param[in] u32CmpValue Window compared value. Valid values are between 0x0 to 0x3F - * @param[in] u32EnableInt Enable WWDT interrupt or not. Valid values are \ref TRUE and \ref FALSE - * @return None - * @note Application can call this function can only once after boot up - */ -void WWDT_Open(UINT u32PreScale, UINT u32CmpValue, UINT u32EnableInt) -{ - UINT reg; - reg = u32PreScale | - (u32CmpValue << 16) | - 0x1 | // enable - (u32EnableInt ? 0x2 : 0); - outpw(REG_WWDT_CTL, reg); - - return; -} - - - - -/*@}*/ /* end of group N9H30_WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group N9H30_WWDT_Driver */ - -/*@}*/ /* end of group N9H30_Device_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/Script/InitDDR2.ini b/bsp/nuvoton/libraries/n9h30/Script/InitDDR2.ini deleted file mode 100644 index 5a8723c5ef1..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Script/InitDDR2.ini +++ /dev/null @@ -1,2 +0,0 @@ -LOAD %L INCREMENTAL -$ = 0 \ No newline at end of file diff --git a/bsp/nuvoton/libraries/n9h30/Script/N9H30.sct b/bsp/nuvoton/libraries/n9h30/Script/N9H30.sct deleted file mode 100644 index e5f4257b20b..00000000000 --- a/bsp/nuvoton/libraries/n9h30/Script/N9H30.sct +++ /dev/null @@ -1,12 +0,0 @@ - - -LR_IROM1 0x00000000 { ; load region size_region - ER_IROM1 0x00000000 { ; load address = execution address - *.o (NUC_INIT, +First) - *(InRoot$$Sections) - .ANY (+RO) - } - RW_RAM1 +0 { ; RW_RAM1 start address is after ER_ROM1 - .ANY (+RW +ZI) - } -} diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/SConscript b/bsp/nuvoton/libraries/n9h30/UsbHostLib/SConscript deleted file mode 100644 index cc83141d00c..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -group = [] -if GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_USBH'): - src = Glob('*src/*.c') + Glob('src/*.cpp') - CPPPATH = [cwd + '/inc'] - group = DefineGroup('n9h30_usbhostlib', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/config.h b/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/config.h deleted file mode 100644 index be7c96dade7..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/config.h +++ /dev/null @@ -1,1524 +0,0 @@ -/**************************************************************************//** - * @file config.h - * @version V1.00 - * @brief This header file defines the configuration of USB Host library. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_CONFIG_H_ -#define _USBH_CONFIG_H_ - - -/// @cond HIDDEN_SYMBOLS - -#include -#include "N9H30.h" -#include "nu_sys.h" -#include "drv_sys.h" - - -/*----------------------------------------------------------------------------------------*/ -/* Hardware settings */ -/*----------------------------------------------------------------------------------------*/ -#define HCLK_MHZ 300 /* used for loop-delay. must be larger than - true HCLK clock MHz */ - -#define NON_CACHE_MASK (0x80000000) - -#define ENABLE_OHCI_IRQ() rt_hw_interrupt_umask(IRQ_OHCI) -#define DISABLE_OHCI_IRQ() rt_hw_interrupt_mask(IRQ_OHCI) -#define IS_OHCI_IRQ_ENABLED() ((inpw(REG_AIC_IMR)>>OHCI_IRQn) & 0x1) -#define ENABLE_EHCI_IRQ() rt_hw_interrupt_umask(IRQ_EHCI) -#define DISABLE_EHCI_IRQ() rt_hw_interrupt_mask(IRQ_EHCI) -#define IS_EHCI_IRQ_ENABLED() ((inpw(REG_AIC_IMR)>>EHCI_IRQn) & 0x1) - -#define ENABLE_OHCI /* Enable OHCI host controller */ -#define ENABLE_EHCI /* Enable EHCI host controller */ - -#define EHCI_PORT_CNT 2 /* Number of EHCI roothub ports */ -#define OHCI_PORT_CNT 2 /* Number of OHCI roothub ports */ -//#define OHCI_PER_PORT_POWER /* OHCI root hub per port powered */ - -#define OHCI_ISO_DELAY 4 /* preserved number frames while scheduling - OHCI isochronous transfer */ - -#define EHCI_ISO_DELAY 2 /* preserved number of frames while - scheduling EHCI isochronous transfer */ - -#define EHCI_ISO_RCLM_RANGE 32 /* When inspecting activated iTD/siTD, - unconditionally reclaim iTD/isTD scheduled - in just elapsed EHCI_ISO_RCLM_RANGE ms. */ - -#define MAX_DESC_BUFF_SIZE 4096 /* To hold the configuration descriptor, USB - core will allocate a buffer with this size - for each connected device. USB core does - not release it until device disconnected. */ - -/*----------------------------------------------------------------------------------------*/ -/* Memory allocation settings */ -/*----------------------------------------------------------------------------------------*/ - -#define STATIC_MEMORY_ALLOC 0 /* pre-allocate static memory blocks. No dynamic memory aloocation. - But the maximum number of connected devices and transfers are - limited. */ - -#define MAX_UDEV_DRIVER 8 /*!< Maximum number of registered drivers */ -#define MAX_ALT_PER_IFACE 12 /*!< maximum number of alternative interfaces per interface */ -#define MAX_EP_PER_IFACE 8 /*!< maximum number of endpoints per interface */ -#define MAX_HUB_DEVICE 8 /*!< Maximum number of hub devices */ - -/* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI - are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE. - May allocate one or more units depend on hardware descriptor type. */ - -#define MEM_POOL_UNIT_SIZE 128 /*!< A fixed hard coding setting. Do not change it! */ -#define MEM_POOL_UNIT_NUM 256 /*!< Increase this or heap size if memory allocate failed. */ - -/*----------------------------------------------------------------------------------------*/ -/* Re-defined staff for various compiler */ -/*----------------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ - #define __inline inline -#endif - - -/*----------------------------------------------------------------------------------------*/ -/* Debug settings */ -/*----------------------------------------------------------------------------------------*/ -#define ENABLE_ERROR_MSG /* enable debug messages */ -#define ENABLE_DEBUG_MSG /* enable debug messages */ -//#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */ -//#define DUMP_DESCRIPTOR /* dump descriptors */ - -#ifdef ENABLE_ERROR_MSG - #define USB_error rt_kprintf -#else - #define USB_error(...) -#endif - -#ifdef ENABLE_DEBUG_MSG - #define USB_debug rt_kprintf - #ifdef ENABLE_VERBOSE_DEBUG - #define USB_vdebug rt_kprintf - #else - #define USB_vdebug(...) - #endif -#else - #define USB_debug(...) - #define USB_vdebug(...) -#endif - - -#define __I volatile const /*!< Defines 'read only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - - -//typedef unsigned int uint32_t; -//typedef unsigned short uint16_t; -//typedef unsigned char uint8_t; - - - -/*---------------------- USB Host Controller -------------------------*/ -/** - @addtogroup USBH USB Host Controller(USBH) - Memory Mapped Structure for USBH Controller -@{ */ - -typedef struct -{ - - /** - * @var USBH_T::HcRevision - * Offset: 0x00 Host Controller Revision Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REV |Revision Number - * | | |Indicates the Open HCI Specification revision number implemented by the Hardware - * | | |Host Controller supports 1.1 specification. - * | | |(X.Y = XYh). - * @var USBH_T::HcControl - * Offset: 0x04 Host Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CBSR |Control Bulk Service Ratio - * | | |This specifies the service ratio between Control and Bulk EDs - * | | |Before processing any of the non-periodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs - * | | |The internal count will be retained when crossing the frame boundary - * | | |In case of reset, HCD is responsible for restoring this - * | | |Value. - * | | |00 = Number of Control EDs over Bulk EDs served is 1:1. - * | | |01 = Number of Control EDs over Bulk EDs served is 2:1. - * | | |10 = Number of Control EDs over Bulk EDs served is 3:1. - * | | |11 = Number of Control EDs over Bulk EDs served is 4:1. - * |[2] |PLE |Periodic List Enable Bit - * | | |When set, this bit enables processing of the Periodic (interrupt and isochronous) list - * | | |The Host Controller checks this bit prior to attempting any periodic transfers in a frame. - * | | |0 = Processing of the Periodic (Interrupt and Isochronous) list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Periodic (Interrupt and Isochronous) list in the next frame Enabled. - * | | |Note: To enable the processing of the Isochronous list, user has to set both PLE and IE (HcControl[3]) high. - * |[3] |IE |Isochronous List Enable Bit - * | | |Both ISOEn and PLE (HcControl[2]) high enables Host Controller to process the Isochronous list - * | | |Either ISOEn or PLE (HcControl[2]) is low disables Host Controller to process the Isochronous list. - * | | |0 = Processing of the Isochronous list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Isochronous list in the next frame Enabled, if the PLE (HcControl[2]) is high, too. - * |[4] |CLE |Control List Enable Bit - * | | |0 = Processing of the Control list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Control list in the next frame Enabled. - * |[5] |BLE |Bulk List Enable Bit - * | | |0 = Processing of the Bulk list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Bulk list in the next frame Enabled. - * |[7:6] |HCFS |Host Controller Functional State - * | | |This field sets the Host Controller state - * | | |The Controller may force a state change from USBSUSPEND to USBRESUME after detecting resume signaling from a downstream port - * | | |States are: - * | | |00 = USBSUSPEND. - * | | |01 = USBOPERATIONAL. - * | | |10 = USBRESUME. - * | | |11 = USBRESET. - * @var USBH_T::HcCommandStatus - * Offset: 0x08 Host Controller Command Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HCR |Host Controller Reset - * | | |This bit is set to initiate the software reset of Host Controller - * | | |This bit is cleared by the Host Controller, upon completed of the reset operation. - * | | |This bit, when set, didn't reset the Root Hub and no subsequent reset signaling be asserted to its downstream ports. - * | | |0 = Host Controller is not in software reset state. - * | | |1 = Host Controller is in software reset state. - * |[1] |CLF |Control List Filled - * | | |Set high to indicate there is an active TD on the Control List - * | | |It may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Control List. - * | | |0 = No active TD found or Host Controller begins to process the head of the Control list. - * | | |1 = An active TD added or found on the Control list. - * |[2] |BLF |Bulk List Filled - * | | |Set high to indicate there is an active TD on the Bulk list - * | | |This bit may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Bulk list. - * | | |0 = No active TD found or Host Controller begins to process the head of the Bulk list. - * | | |1 = An active TD added or found on the Bulk list. - * |[17:16] |SOC |Schedule Overrun Count - * | | |These bits are incremented on each scheduling overrun error - * | | |It is initialized to 00b and wraps around at 11b - * | | |This will be incremented when a scheduling overrun is detected even if SO (HcInterruptStatus[0]) has already been set. - * @var USBH_T::HcInterruptStatus - * Offset: 0x0C Host Controller Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun - * | | |Set when the List Processor determines a Schedule Overrun has occurred. - * | | |0 = Schedule Overrun didn't occur. - * | | |1 = Schedule Overrun has occurred. - * |[1] |WDH |Write Back Done Head - * | | |Set after the Host Controller has written HcDoneHead to HccaDoneHead - * | | |Further updates of the HccaDoneHead will not occur until this bit has been cleared. - * | | |0 =.Host Controller didn't update HccaDoneHead. - * | | |1 =.Host Controller has written HcDoneHead to HccaDoneHead. - * |[2] |SF |Start of Frame - * | | |Set when the Frame Management functional block signals a 'Start of Frame' event - * | | |Host Control generates a SOF token at the same time. - * | | |0 =.Not the start of a frame. - * | | |1 =.Indicate the start of a frame and Host Controller generates a SOF token. - * |[3] |RD |Resume Detected - * | | |Set when Host Controller detects resume signaling on a downstream port. - * | | |0 = No resume signaling detected on a downstream port. - * | | |1 = Resume signaling detected on a downstream port. - * |[5] |FNO |Frame Number Overflow - * | | |This bit is set when bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |0 = The bit 15 of Frame Number didn't change. - * | | |1 = The bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * |[6] |RHSC |Root Hub Status Change - * | | |This bit is set when the content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |0 = The content of HcRhStatus and the content of HcRhPortStatus register didn't change. - * | | |1 = The content of HcRhStatus or the content of HcRhPortStatus register has changed. - * @var USBH_T::HcInterruptEnable - * Offset: 0x10 Host Controller Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Enable Bit - * | | |This bit is a global interrupt enable - * | | |A write of '1' allows interrupts to be enabled via the specific enable bits listed above. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcInterruptDisable - * Offset: 0x14 Host Controller Interrupt Disable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Disable Bit - * | | |Global interrupt disable. Writing '1' to disable all interrupts. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcHCCA - * Offset: 0x18 Host Controller Communication Area Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:8] |HCCA |Host Controller Communication Area - * | | |Pointer to indicate base address of the Host Controller Communication Area (HCCA). - * @var USBH_T::HcPeriodCurrentED - * Offset: 0x1C Host Controller Period Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |PCED |Periodic Current ED - * | | |Pointer to indicate physical address of the current Isochronous or Interrupt Endpoint Descriptor. - * @var USBH_T::HcControlHeadED - * Offset: 0x20 Host Controller Control Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CHED |Control Head ED - * | | |Pointer to indicate physical address of the first Endpoint Descriptor of the Control list. - * @var USBH_T::HcControlCurrentED - * Offset: 0x24 Host Controller Control Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CCED |Control Current Head ED - * | | |Pointer to indicate the physical address of the current Endpoint Descriptor of the Control list. - * @var USBH_T::HcBulkHeadED - * Offset: 0x28 Host Controller Bulk Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BHED |Bulk Head ED - * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Bulk list. - * @var USBH_T::HcBulkCurrentED - * Offset: 0x2C Host Controller Bulk Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BCED |Bulk Current Head ED - * | | |Pointer to indicate the physical address of the current endpoint of the Bulk list. - * @var USBH_T::HcDoneHead - * Offset: 0x30 Host Controller Done Head Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |DH |Done Head - * | | |Pointer to indicate the physical address of the last completed Transfer Descriptor that was added to the Done queue. - * @var USBH_T::HcFmInterval - * Offset: 0x34 Host Controller Frame Interval Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Interval - * | | |This field specifies the length of a frame as (bit times - 1) - * | | |For 12,000 bit times in a frame, a value of 11,999 is stored here. - * |[30:16] |FSMPS |FS Largest Data Packet - * | | |This field specifies a value that is loaded into the Largest Data Packet Counter at the beginning of each frame. - * |[31] |FIT |Frame Interval Toggle - * | | |This bit is toggled by Host Controller Driver when it loads a new value into FI (HcFmInterval[13:0]). - * | | |0 = Host Controller Driver didn't load new value into FI (HcFmInterval[13:0]). - * | | |1 = Host Controller Driver loads a new value into FI (HcFmInterval[13:0]). - * @var USBH_T::HcFmRemaining - * Offset: 0x38 Host Controller Frame Remaining Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FR |Frame Remaining - * | | |When the Host Controller is in the USBOPERATIONAL state, this 14-bit field decrements each 12 MHz clock period - * | | |When the count reaches 0, (end of frame) the counter reloads with Frame Interval - * | | |In addition, the counter loads when the Host Controller transitions into USBOPERATIONAL. - * |[31] |FRT |Frame Remaining Toggle - * | | |This bit is loaded from the FIT (HcFmInterval[31]) whenever FR (HcFmRemaining[13:0]) reaches 0. - * @var USBH_T::HcFmNumber - * Offset: 0x3C Host Controller Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FN |Frame Number - * | | |This 16-bit incrementing counter field is incremented coincident with the re-load of FR (HcFmRemaining[13:0]) - * | | |The count rolls over from 'FFFFh' to '0h.' - * @var USBH_T::HcPeriodicStart - * Offset: 0x40 Host Controller Periodic Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PS |Periodic Start - * | | |This field contains a value used by the List Processor to determine where in a frame the Periodic List processing must begin. - * @var USBH_T::HcLSThreshold - * Offset: 0x44 Host Controller Low-speed Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |LST |Low-speed Threshold - * | | |This field contains a value which is compared to the FR (HcFmRemaining[13:0]) field prior to initiating a Low-speed transaction - * | | |The transaction is started only if FR (HcFmRemaining[13:0]) >= this field - * | | |The value is calculated by Host Controller Driver with the consideration of transmission and setup overhead. - * @var USBH_T::HcRhDescriptorA - * Offset: 0x48 Host Controller Root Hub Descriptor A Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |NDP |Number Downstream Ports - * | | |USB host control supports two downstream ports and only one port is available in this series of chip. - * |[8] |PSM |Power Switching Mode - * | | |This bit is used to specify how the power switching of the Root Hub ports is controlled. - * | | |0 = Global Switching. - * | | |1 = Individual Switching. - * |[11] |OCPM |over Current Protection Mode - * | | |This bit describes how the over current status for the Root Hub ports reported - * | | |This bit is only valid when NOCP (HcRhDescriptorA[12]) is cleared. - * | | |0 = Global Over current. - * | | |1 = Individual Over current. - * |[12] |NOCP |No over Current Protection - * | | |This bit describes how the over current status for the Root Hub ports reported. - * | | |0 = Over current status is reported. - * | | |1 = Over current status is not reported. - * @var USBH_T::HcRhDescriptorB - * Offset: 0x4C Host Controller Root Hub Descriptor B Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |PPCM |Port Power Control Mask - * | | |Global power switching - * | | |This field is only valid if PowerSwitchingMode is set (individual port switching) - * | | |When set, the port only responds to individual port power switching commands (Set/ClearPortPower) - * | | |When cleared, the port only responds to global power switching commands (Set/ClearGlobalPower). - * | | |0 = Port power controlled by global power switching. - * | | |1 = Port power controlled by port power switching. - * | | |Note: PPCM[15:2] and PPCM[0] are reserved. - * @var USBH_T::HcRhStatus - * Offset: 0x50 Host Controller Root Hub Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPS |Clear Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to clear all ports' power. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear global power. - * |[1] |OCI |over Current Indicator - * | | |This bit reflects the state of the over current status pin - * | | |This field is only valid if NOCP (HcRhDesA[12]) and OCPM (HcRhDesA[11]) are cleared. - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[15] |DRWE |Device Remote Wakeup Enable Bit - * | | |This bit controls if port's Connect Status Change as a remote wake-up event. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * | | |Read Operation: - * | | |0 = Connect Status Change as a remote wake-up event Disabled. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * |[16] |LPSC |Set Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to enable power to all ports. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set global power. - * |[17] |OCIC |over Current Indicator Change - * | | |This bit is set by hardware when a change has occurred in OCI (HcRhStatus[1]). - * | | |Write 1 to clear this bit to zero. - * | | |0 = OCI (HcRhStatus[1]) didn't change. - * | | |1 = OCI (HcRhStatus[1]) change. - * |[31] |CRWE |Clear Remote Wake-up Enable Bit - * | | |This bit is use to clear DRWE (HcRhStatus[15]). - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear DRWE (HcRhStatus[15]). - * @var USBH_T::HcRhPortStatus[2] - * Offset: 0x54 Host Controller Root Hub Port Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |CurrentConnectStatus (Read) or ClearPortEnable Bit (Write) - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port enable. - * | | |Read Operation: - * | | |0 = No device connected. - * | | |1 = Device connected. - * |[1] |PES |Port Enable Status - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port enable. - * | | |Read Operation: - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[2] |PSS |Port Suspend Status - * | | |This bit indicates the port is suspended - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port suspend. - * | | |Read Operation: - * | | |0 = Port is not suspended. - * | | |1 = Port is selectively suspended. - * |[3] |POCI |Port over Current Indicator (Read) or Clear Port Suspend (Write) - * | | |This bit reflects the state of the over current status pin dedicated to this port - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) is cleared and OCPM (HcRhDescriptorA[11]) is set. - * | | |This bit is also used to initiate the selective result sequence for the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port suspend. - * | | |Read Operation: - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[4] |PRS |Port Reset Status - * | | |This bit reflects the reset state of the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port reset. - * | | |Read Operation - * | | |0 = Port reset signal is not active. - * | | |1 = Port reset signal is active. - * |[8] |PPS |Port Power Status - * | | |This bit reflects the power state of the port regardless of the power switching mode. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Port Power Enabled. - * | | |Read Operation: - * | | |0 = Port power is Disabled. - * | | |1 = Port power is Enabled. - * |[9] |LSDA |Low Speed Device Attached (Read) or Clear Port Power (Write) - * | | |This bit defines the speed (and bud idle) of the attached device - * | | |It is only valid when CCS (HcRhPortStatus1[0]) is set. - * | | |This bit is also used to clear port power. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear PPS (HcRhPortStatus1[8]). - * | | |Read Operation: - * | | |0 = Full Speed device. - * | | |1 = Low-speed device. - * |[16] |CSC |Connect Status Change - * | | |This bit indicates connect or disconnect event has been detected (CCS (HcRhPortStatus1[0]) changed). - * | | |Write 1 to clear this bit to zero. - * | | |0 = No connect/disconnect event (CCS (HcRhPortStatus1[0]) didn't change). - * | | |1 = Hardware detection of connect/disconnect event (CCS (HcRhPortStatus1[0]) changed). - * |[17] |PESC |Port Enable Status Change - * | | |This bit indicates that the port has been disabled (PES (HcRhPortStatus1[1]) cleared) due to a hardware event. - * | | |Write 1 to clear this bit to zero. - * | | |0 = PES (HcRhPortStatus1[1]) didn't change. - * | | |1 = PES (HcRhPortStatus1[1]) changed. - * |[18] |PSSC |Port Suspend Status Change - * | | |This bit indicates the completion of the selective resume sequence for the port. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port resume is not completed. - * | | |1 = Port resume completed. - * |[19] |OCIC |Port over Current Indicator Change - * | | |This bit is set when POCI (HcRhPortStatus1[3]) changes. - * | | |Write 1 to clear this bit to zero. - * | | |0 = POCI (HcRhPortStatus1[3]) didn't change. - * | | |1 = POCI (HcRhPortStatus1[3]) changes. - * |[20] |PRSC |Port Reset Status Change - * | | |This bit indicates that the port reset signal has completed. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port reset is not complete. - * | | |1 = Port reset is complete. - * @var USBH_T::HcPhyControl - * Offset: 0x200 Host Controller PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27] |STBYEN |USB Transceiver Standby Enable Bit - * | | |This bit controls if USB transceiver could enter the standby mode to reduce power consumption. - * | | |0 = The USB transceiver would never enter the standby mode. - * | | |1 = The USB transceiver will enter standby mode while port is in power off state (port power is inactive). - * @var USBH_T::HcMiscControl - * Offset: 0x204 Host Controller Miscellaneous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABORT |AHB Bus ERROR Response - * | | |This bit indicates there is an ERROR response received in AHB bus. - * | | |0 = No ERROR response received. - * | | |1 = ERROR response received. - * |[3] |OCAL |over Current Active Low - * | | |This bit controls the polarity of over current flag from external power IC. - * | | |0 = Over current flag is high active. - * | | |1 = Over current flag is low active. - * |[16] |DPRT1 |Disable Port 1 - * | | |This bit controls if the connection between USB host controller and transceiver of port 1 is disabled - * | | |If the connection is disabled, the USB host controller will not recognize any event of USB bus. - * | | |Set this bit high, the transceiver of port 1 will also be forced into the standby mode no matter what USB host controller operation is. - * | | |0 = The connection between USB host controller and transceiver of port 1 Enabled. - * | | |1 = The connection between USB host controller and transceiver of port 1 Disabled and the transceiver of port 1 will also be forced into the standby mode. - */ - __I uint32_t HcRevision; /*!< [0x0000] Host Controller Revision Register */ - __IO uint32_t HcControl; /*!< [0x0004] Host Controller Control Register */ - __IO uint32_t HcCommandStatus; /*!< [0x0008] Host Controller Command Status Register */ - __IO uint32_t HcInterruptStatus; /*!< [0x000c] Host Controller Interrupt Status Register */ - __IO uint32_t HcInterruptEnable; /*!< [0x0010] Host Controller Interrupt Enable Register */ - __IO uint32_t HcInterruptDisable; /*!< [0x0014] Host Controller Interrupt Disable Register */ - __IO uint32_t HcHCCA; /*!< [0x0018] Host Controller Communication Area Register */ - __IO uint32_t HcPeriodCurrentED; /*!< [0x001c] Host Controller Period Current ED Register */ - __IO uint32_t HcControlHeadED; /*!< [0x0020] Host Controller Control Head ED Register */ - __IO uint32_t HcControlCurrentED; /*!< [0x0024] Host Controller Control Current ED Register */ - __IO uint32_t HcBulkHeadED; /*!< [0x0028] Host Controller Bulk Head ED Register */ - __IO uint32_t HcBulkCurrentED; /*!< [0x002c] Host Controller Bulk Current ED Register */ - __IO uint32_t HcDoneHead; /*!< [0x0030] Host Controller Done Head Register */ - __IO uint32_t HcFmInterval; /*!< [0x0034] Host Controller Frame Interval Register */ - __I uint32_t HcFmRemaining; /*!< [0x0038] Host Controller Frame Remaining Register */ - __I uint32_t HcFmNumber; /*!< [0x003c] Host Controller Frame Number Register */ - __IO uint32_t HcPeriodicStart; /*!< [0x0040] Host Controller Periodic Start Register */ - __IO uint32_t HcLSThreshold; /*!< [0x0044] Host Controller Low-speed Threshold Register */ - __IO uint32_t HcRhDescriptorA; /*!< [0x0048] Host Controller Root Hub Descriptor A Register */ - __IO uint32_t HcRhDescriptorB; /*!< [0x004c] Host Controller Root Hub Descriptor B Register */ - __IO uint32_t HcRhStatus; /*!< [0x0050] Host Controller Root Hub Status Register */ - __IO uint32_t HcRhPortStatus[2]; /*!< [0x0054] Host Controller Root Hub Port Status [1] */ - __I uint32_t RESERVE0[105]; - __IO uint32_t HcPhyControl; /*!< [0x0200] Host Controller PHY Control Register */ - __IO uint32_t HcMiscControl; /*!< [0x0204] Host Controller Miscellaneous Control Register */ - -} USBH_T; - -/** - @addtogroup USBH_CONST USBH Bit Field Definition - Constant Definitions for USBH Controller -@{ */ - -#define USBH_HcRevision_REV_Pos (0) /*!< USBH_T::HcRevision: REV Position */ -#define USBH_HcRevision_REV_Msk (0xfful << USBH_HcRevision_REV_Pos) /*!< USBH_T::HcRevision: REV Mask */ - -#define USBH_HcControl_CBSR_Pos (0) /*!< USBH_T::HcControl: CBSR Position */ -#define USBH_HcControl_CBSR_Msk (0x3ul << USBH_HcControl_CBSR_Pos) /*!< USBH_T::HcControl: CBSR Mask */ - -#define USBH_HcControl_PLE_Pos (2) /*!< USBH_T::HcControl: PLE Position */ -#define USBH_HcControl_PLE_Msk (0x1ul << USBH_HcControl_PLE_Pos) /*!< USBH_T::HcControl: PLE Mask */ - -#define USBH_HcControl_IE_Pos (3) /*!< USBH_T::HcControl: IE Position */ -#define USBH_HcControl_IE_Msk (0x1ul << USBH_HcControl_IE_Pos) /*!< USBH_T::HcControl: IE Mask */ - -#define USBH_HcControl_CLE_Pos (4) /*!< USBH_T::HcControl: CLE Position */ -#define USBH_HcControl_CLE_Msk (0x1ul << USBH_HcControl_CLE_Pos) /*!< USBH_T::HcControl: CLE Mask */ - -#define USBH_HcControl_BLE_Pos (5) /*!< USBH_T::HcControl: BLE Position */ -#define USBH_HcControl_BLE_Msk (0x1ul << USBH_HcControl_BLE_Pos) /*!< USBH_T::HcControl: BLE Mask */ - -#define USBH_HcControl_HCFS_Pos (6) /*!< USBH_T::HcControl: HCFS Position */ -#define USBH_HcControl_HCFS_Msk (0x3ul << USBH_HcControl_HCFS_Pos) /*!< USBH_T::HcControl: HCFS Mask */ - -#define USBH_HcCommandStatus_HCR_Pos (0) /*!< USBH_T::HcCommandStatus: HCR Position */ -#define USBH_HcCommandStatus_HCR_Msk (0x1ul << USBH_HcCommandStatus_HCR_Pos) /*!< USBH_T::HcCommandStatus: HCR Mask */ - -#define USBH_HcCommandStatus_CLF_Pos (1) /*!< USBH_T::HcCommandStatus: CLF Position */ -#define USBH_HcCommandStatus_CLF_Msk (0x1ul << USBH_HcCommandStatus_CLF_Pos) /*!< USBH_T::HcCommandStatus: CLF Mask */ - -#define USBH_HcCommandStatus_BLF_Pos (2) /*!< USBH_T::HcCommandStatus: BLF Position */ -#define USBH_HcCommandStatus_BLF_Msk (0x1ul << USBH_HcCommandStatus_BLF_Pos) /*!< USBH_T::HcCommandStatus: BLF Mask */ - -#define USBH_HcCommandStatus_SOC_Pos (16) /*!< USBH_T::HcCommandStatus: SOC Position */ -#define USBH_HcCommandStatus_SOC_Msk (0x3ul << USBH_HcCommandStatus_SOC_Pos) /*!< USBH_T::HcCommandStatus: SOC Mask */ - -#define USBH_HcInterruptStatus_SO_Pos (0) /*!< USBH_T::HcInterruptStatus: SO Position */ -#define USBH_HcInterruptStatus_SO_Msk (0x1ul << USBH_HcInterruptStatus_SO_Pos) /*!< USBH_T::HcInterruptStatus: SO Mask */ - -#define USBH_HcInterruptStatus_WDH_Pos (1) /*!< USBH_T::HcInterruptStatus: WDH Position*/ -#define USBH_HcInterruptStatus_WDH_Msk (0x1ul << USBH_HcInterruptStatus_WDH_Pos) /*!< USBH_T::HcInterruptStatus: WDH Mask */ - -#define USBH_HcInterruptStatus_SF_Pos (2) /*!< USBH_T::HcInterruptStatus: SF Position */ -#define USBH_HcInterruptStatus_SF_Msk (0x1ul << USBH_HcInterruptStatus_SF_Pos) /*!< USBH_T::HcInterruptStatus: SF Mask */ - -#define USBH_HcInterruptStatus_RD_Pos (3) /*!< USBH_T::HcInterruptStatus: RD Position */ -#define USBH_HcInterruptStatus_RD_Msk (0x1ul << USBH_HcInterruptStatus_RD_Pos) /*!< USBH_T::HcInterruptStatus: RD Mask */ - -#define USBH_HcInterruptStatus_FNO_Pos (5) /*!< USBH_T::HcInterruptStatus: FNO Position*/ -#define USBH_HcInterruptStatus_FNO_Msk (0x1ul << USBH_HcInterruptStatus_FNO_Pos) /*!< USBH_T::HcInterruptStatus: FNO Mask */ - -#define USBH_HcInterruptStatus_RHSC_Pos (6) /*!< USBH_T::HcInterruptStatus: RHSC Position*/ -#define USBH_HcInterruptStatus_RHSC_Msk (0x1ul << USBH_HcInterruptStatus_RHSC_Pos) /*!< USBH_T::HcInterruptStatus: RHSC Mask */ - -#define USBH_HcInterruptEnable_SO_Pos (0) /*!< USBH_T::HcInterruptEnable: SO Position */ -#define USBH_HcInterruptEnable_SO_Msk (0x1ul << USBH_HcInterruptEnable_SO_Pos) /*!< USBH_T::HcInterruptEnable: SO Mask */ - -#define USBH_HcInterruptEnable_WDH_Pos (1) /*!< USBH_T::HcInterruptEnable: WDH Position*/ -#define USBH_HcInterruptEnable_WDH_Msk (0x1ul << USBH_HcInterruptEnable_WDH_Pos) /*!< USBH_T::HcInterruptEnable: WDH Mask */ - -#define USBH_HcInterruptEnable_SF_Pos (2) /*!< USBH_T::HcInterruptEnable: SF Position */ -#define USBH_HcInterruptEnable_SF_Msk (0x1ul << USBH_HcInterruptEnable_SF_Pos) /*!< USBH_T::HcInterruptEnable: SF Mask */ - -#define USBH_HcInterruptEnable_RD_Pos (3) /*!< USBH_T::HcInterruptEnable: RD Position */ -#define USBH_HcInterruptEnable_RD_Msk (0x1ul << USBH_HcInterruptEnable_RD_Pos) /*!< USBH_T::HcInterruptEnable: RD Mask */ - -#define USBH_HcInterruptEnable_FNO_Pos (5) /*!< USBH_T::HcInterruptEnable: FNO Position*/ -#define USBH_HcInterruptEnable_FNO_Msk (0x1ul << USBH_HcInterruptEnable_FNO_Pos) /*!< USBH_T::HcInterruptEnable: FNO Mask */ - -#define USBH_HcInterruptEnable_RHSC_Pos (6) /*!< USBH_T::HcInterruptEnable: RHSC Position*/ -#define USBH_HcInterruptEnable_RHSC_Msk (0x1ul << USBH_HcInterruptEnable_RHSC_Pos) /*!< USBH_T::HcInterruptEnable: RHSC Mask */ - -#define USBH_HcInterruptEnable_MIE_Pos (31) /*!< USBH_T::HcInterruptEnable: MIE Position*/ -#define USBH_HcInterruptEnable_MIE_Msk (0x1ul << USBH_HcInterruptEnable_MIE_Pos) /*!< USBH_T::HcInterruptEnable: MIE Mask */ - -#define USBH_HcInterruptDisable_SO_Pos (0) /*!< USBH_T::HcInterruptDisable: SO Position*/ -#define USBH_HcInterruptDisable_SO_Msk (0x1ul << USBH_HcInterruptDisable_SO_Pos) /*!< USBH_T::HcInterruptDisable: SO Mask */ - -#define USBH_HcInterruptDisable_WDH_Pos (1) /*!< USBH_T::HcInterruptDisable: WDH Position*/ -#define USBH_HcInterruptDisable_WDH_Msk (0x1ul << USBH_HcInterruptDisable_WDH_Pos) /*!< USBH_T::HcInterruptDisable: WDH Mask */ - -#define USBH_HcInterruptDisable_SF_Pos (2) /*!< USBH_T::HcInterruptDisable: SF Position*/ -#define USBH_HcInterruptDisable_SF_Msk (0x1ul << USBH_HcInterruptDisable_SF_Pos) /*!< USBH_T::HcInterruptDisable: SF Mask */ - -#define USBH_HcInterruptDisable_RD_Pos (3) /*!< USBH_T::HcInterruptDisable: RD Position*/ -#define USBH_HcInterruptDisable_RD_Msk (0x1ul << USBH_HcInterruptDisable_RD_Pos) /*!< USBH_T::HcInterruptDisable: RD Mask */ - -#define USBH_HcInterruptDisable_FNO_Pos (5) /*!< USBH_T::HcInterruptDisable: FNO Position*/ -#define USBH_HcInterruptDisable_FNO_Msk (0x1ul << USBH_HcInterruptDisable_FNO_Pos) /*!< USBH_T::HcInterruptDisable: FNO Mask */ - -#define USBH_HcInterruptDisable_RHSC_Pos (6) /*!< USBH_T::HcInterruptDisable: RHSC Position*/ -#define USBH_HcInterruptDisable_RHSC_Msk (0x1ul << USBH_HcInterruptDisable_RHSC_Pos) /*!< USBH_T::HcInterruptDisable: RHSC Mask */ - -#define USBH_HcInterruptDisable_MIE_Pos (31) /*!< USBH_T::HcInterruptDisable: MIE Position*/ -#define USBH_HcInterruptDisable_MIE_Msk (0x1ul << USBH_HcInterruptDisable_MIE_Pos) /*!< USBH_T::HcInterruptDisable: MIE Mask */ - -#define USBH_HcHCCA_HCCA_Pos (8) /*!< USBH_T::HcHCCA: HCCA Position */ -#define USBH_HcHCCA_HCCA_Msk (0xfffffful << USBH_HcHCCA_HCCA_Pos) /*!< USBH_T::HcHCCA: HCCA Mask */ - -#define USBH_HcPeriodCurrentED_PCED_Pos (4) /*!< USBH_T::HcPeriodCurrentED: PCED Position*/ -#define USBH_HcPeriodCurrentED_PCED_Msk (0xffffffful << USBH_HcPeriodCurrentED_PCED_Pos) /*!< USBH_T::HcPeriodCurrentED: PCED Mask */ - -#define USBH_HcControlHeadED_CHED_Pos (4) /*!< USBH_T::HcControlHeadED: CHED Position */ -#define USBH_HcControlHeadED_CHED_Msk (0xffffffful << USBH_HcControlHeadED_CHED_Pos) /*!< USBH_T::HcControlHeadED: CHED Mask */ - -#define USBH_HcControlCurrentED_CCED_Pos (4) /*!< USBH_T::HcControlCurrentED: CCED Position*/ -#define USBH_HcControlCurrentED_CCED_Msk (0xffffffful << USBH_HcControlCurrentED_CCED_Pos) /*!< USBH_T::HcControlCurrentED: CCED Mask */ - -#define USBH_HcBulkHeadED_BHED_Pos (4) /*!< USBH_T::HcBulkHeadED: BHED Position */ -#define USBH_HcBulkHeadED_BHED_Msk (0xffffffful << USBH_HcBulkHeadED_BHED_Pos) /*!< USBH_T::HcBulkHeadED: BHED Mask */ - -#define USBH_HcBulkCurrentED_BCED_Pos (4) /*!< USBH_T::HcBulkCurrentED: BCED Position */ -#define USBH_HcBulkCurrentED_BCED_Msk (0xffffffful << USBH_HcBulkCurrentED_BCED_Pos) /*!< USBH_T::HcBulkCurrentED: BCED Mask */ - -#define USBH_HcDoneHead_DH_Pos (4) /*!< USBH_T::HcDoneHead: DH Position */ -#define USBH_HcDoneHead_DH_Msk (0xffffffful << USBH_HcDoneHead_DH_Pos) /*!< USBH_T::HcDoneHead: DH Mask */ - -#define USBH_HcFmInterval_FI_Pos (0) /*!< USBH_T::HcFmInterval: FI Position */ -#define USBH_HcFmInterval_FI_Msk (0x3ffful << USBH_HcFmInterval_FI_Pos) /*!< USBH_T::HcFmInterval: FI Mask */ - -#define USBH_HcFmInterval_FSMPS_Pos (16) /*!< USBH_T::HcFmInterval: FSMPS Position */ -#define USBH_HcFmInterval_FSMPS_Msk (0x7ffful << USBH_HcFmInterval_FSMPS_Pos) /*!< USBH_T::HcFmInterval: FSMPS Mask */ - -#define USBH_HcFmInterval_FIT_Pos (31) /*!< USBH_T::HcFmInterval: FIT Position */ -#define USBH_HcFmInterval_FIT_Msk (0x1ul << USBH_HcFmInterval_FIT_Pos) /*!< USBH_T::HcFmInterval: FIT Mask */ - -#define USBH_HcFmRemaining_FR_Pos (0) /*!< USBH_T::HcFmRemaining: FR Position */ -#define USBH_HcFmRemaining_FR_Msk (0x3ffful << USBH_HcFmRemaining_FR_Pos) /*!< USBH_T::HcFmRemaining: FR Mask */ - -#define USBH_HcFmRemaining_FRT_Pos (31) /*!< USBH_T::HcFmRemaining: FRT Position */ -#define USBH_HcFmRemaining_FRT_Msk (0x1ul << USBH_HcFmRemaining_FRT_Pos) /*!< USBH_T::HcFmRemaining: FRT Mask */ - -#define USBH_HcFmNumber_FN_Pos (0) /*!< USBH_T::HcFmNumber: FN Position */ -#define USBH_HcFmNumber_FN_Msk (0xfffful << USBH_HcFmNumber_FN_Pos) /*!< USBH_T::HcFmNumber: FN Mask */ - -#define USBH_HcPeriodicStart_PS_Pos (0) /*!< USBH_T::HcPeriodicStart: PS Position */ -#define USBH_HcPeriodicStart_PS_Msk (0x3ffful << USBH_HcPeriodicStart_PS_Pos) /*!< USBH_T::HcPeriodicStart: PS Mask */ - -#define USBH_HcLSThreshold_LST_Pos (0) /*!< USBH_T::HcLSThreshold: LST Position */ -#define USBH_HcLSThreshold_LST_Msk (0xffful << USBH_HcLSThreshold_LST_Pos) /*!< USBH_T::HcLSThreshold: LST Mask */ - -#define USBH_HcRhDescriptorA_NDP_Pos (0) /*!< USBH_T::HcRhDescriptorA: NDP Position */ -#define USBH_HcRhDescriptorA_NDP_Msk (0xfful << USBH_HcRhDescriptorA_NDP_Pos) /*!< USBH_T::HcRhDescriptorA: NDP Mask */ - -#define USBH_HcRhDescriptorA_PSM_Pos (8) /*!< USBH_T::HcRhDescriptorA: PSM Position */ -#define USBH_HcRhDescriptorA_PSM_Msk (0x1ul << USBH_HcRhDescriptorA_PSM_Pos) /*!< USBH_T::HcRhDescriptorA: PSM Mask */ - -#define USBH_HcRhDescriptorA_OCPM_Pos (11) /*!< USBH_T::HcRhDescriptorA: OCPM Position */ -#define USBH_HcRhDescriptorA_OCPM_Msk (0x1ul << USBH_HcRhDescriptorA_OCPM_Pos) /*!< USBH_T::HcRhDescriptorA: OCPM Mask */ - -#define USBH_HcRhDescriptorA_NOCP_Pos (12) /*!< USBH_T::HcRhDescriptorA: NOCP Position */ -#define USBH_HcRhDescriptorA_NOCP_Msk (0x1ul << USBH_HcRhDescriptorA_NOCP_Pos) /*!< USBH_T::HcRhDescriptorA: NOCP Mask */ - -#define USBH_HcRhDescriptorB_PPCM_Pos (16) /*!< USBH_T::HcRhDescriptorB: PPCM Position */ -#define USBH_HcRhDescriptorB_PPCM_Msk (0xfffful << USBH_HcRhDescriptorB_PPCM_Pos) /*!< USBH_T::HcRhDescriptorB: PPCM Mask */ - -#define USBH_HcRhStatus_LPS_Pos (0) /*!< USBH_T::HcRhStatus: LPS Position */ -#define USBH_HcRhStatus_LPS_Msk (0x1ul << USBH_HcRhStatus_LPS_Pos) /*!< USBH_T::HcRhStatus: LPS Mask */ - -#define USBH_HcRhStatus_OCI_Pos (1) /*!< USBH_T::HcRhStatus: OCI Position */ -#define USBH_HcRhStatus_OCI_Msk (0x1ul << USBH_HcRhStatus_OCI_Pos) /*!< USBH_T::HcRhStatus: OCI Mask */ - -#define USBH_HcRhStatus_DRWE_Pos (15) /*!< USBH_T::HcRhStatus: DRWE Position */ -#define USBH_HcRhStatus_DRWE_Msk (0x1ul << USBH_HcRhStatus_DRWE_Pos) /*!< USBH_T::HcRhStatus: DRWE Mask */ - -#define USBH_HcRhStatus_LPSC_Pos (16) /*!< USBH_T::HcRhStatus: LPSC Position */ -#define USBH_HcRhStatus_LPSC_Msk (0x1ul << USBH_HcRhStatus_LPSC_Pos) /*!< USBH_T::HcRhStatus: LPSC Mask */ - -#define USBH_HcRhStatus_OCIC_Pos (17) /*!< USBH_T::HcRhStatus: OCIC Position */ -#define USBH_HcRhStatus_OCIC_Msk (0x1ul << USBH_HcRhStatus_OCIC_Pos) /*!< USBH_T::HcRhStatus: OCIC Mask */ - -#define USBH_HcRhStatus_CRWE_Pos (31) /*!< USBH_T::HcRhStatus: CRWE Position */ -#define USBH_HcRhStatus_CRWE_Msk (0x1ul << USBH_HcRhStatus_CRWE_Pos) /*!< USBH_T::HcRhStatus: CRWE Mask */ - -#define USBH_HcRhPortStatus_CCS_Pos (0) /*!< USBH_T::HcRhPortStatus1: CCS Position */ -#define USBH_HcRhPortStatus_CCS_Msk (0x1ul << USBH_HcRhPortStatus_CCS_Pos) /*!< USBH_T::HcRhPortStatus1: CCS Mask */ - -#define USBH_HcRhPortStatus_PES_Pos (1) /*!< USBH_T::HcRhPortStatus1: PES Position */ -#define USBH_HcRhPortStatus_PES_Msk (0x1ul << USBH_HcRhPortStatus_PES_Pos) /*!< USBH_T::HcRhPortStatus1: PES Mask */ - -#define USBH_HcRhPortStatus_PSS_Pos (2) /*!< USBH_T::HcRhPortStatus1: PSS Position */ -#define USBH_HcRhPortStatus_PSS_Msk (0x1ul << USBH_HcRhPortStatus_PSS_Pos) /*!< USBH_T::HcRhPortStatus1: PSS Mask */ - -#define USBH_HcRhPortStatus_POCI_Pos (3) /*!< USBH_T::HcRhPortStatus1: POCI Position */ -#define USBH_HcRhPortStatus_POCI_Msk (0x1ul << USBH_HcRhPortStatus_POCI_Pos) /*!< USBH_T::HcRhPortStatus1: POCI Mask */ - -#define USBH_HcRhPortStatus_PRS_Pos (4) /*!< USBH_T::HcRhPortStatus1: PRS Position */ -#define USBH_HcRhPortStatus_PRS_Msk (0x1ul << USBH_HcRhPortStatus_PRS_Pos) /*!< USBH_T::HcRhPortStatus1: PRS Mask */ - -#define USBH_HcRhPortStatus_PPS_Pos (8) /*!< USBH_T::HcRhPortStatus1: PPS Position */ -#define USBH_HcRhPortStatus_PPS_Msk (0x1ul << USBH_HcRhPortStatus_PPS_Pos) /*!< USBH_T::HcRhPortStatus1: PPS Mask */ - -#define USBH_HcRhPortStatus_LSDA_Pos (9) /*!< USBH_T::HcRhPortStatus1: LSDA Position */ -#define USBH_HcRhPortStatus_LSDA_Msk (0x1ul << USBH_HcRhPortStatus_LSDA_Pos) /*!< USBH_T::HcRhPortStatus1: LSDA Mask */ - -#define USBH_HcRhPortStatus_CSC_Pos (16) /*!< USBH_T::HcRhPortStatus1: CSC Position */ -#define USBH_HcRhPortStatus_CSC_Msk (0x1ul << USBH_HcRhPortStatus_CSC_Pos) /*!< USBH_T::HcRhPortStatus1: CSC Mask */ - -#define USBH_HcRhPortStatus_PESC_Pos (17) /*!< USBH_T::HcRhPortStatus1: PESC Position */ -#define USBH_HcRhPortStatus_PESC_Msk (0x1ul << USBH_HcRhPortStatus_PESC_Pos) /*!< USBH_T::HcRhPortStatus1: PESC Mask */ - -#define USBH_HcRhPortStatus_PSSC_Pos (18) /*!< USBH_T::HcRhPortStatus1: PSSC Position */ -#define USBH_HcRhPortStatus_PSSC_Msk (0x1ul << USBH_HcRhPortStatus_PSSC_Pos) /*!< USBH_T::HcRhPortStatus1: PSSC Mask */ - -#define USBH_HcRhPortStatus_OCIC_Pos (19) /*!< USBH_T::HcRhPortStatus1: OCIC Position */ -#define USBH_HcRhPortStatus_OCIC_Msk (0x1ul << USBH_HcRhPortStatus_OCIC_Pos) /*!< USBH_T::HcRhPortStatus1: OCIC Mask */ - -#define USBH_HcRhPortStatus_PRSC_Pos (20) /*!< USBH_T::HcRhPortStatus1: PRSC Position */ -#define USBH_HcRhPortStatus_PRSC_Msk (0x1ul << USBH_HcRhPortStatus_PRSC_Pos) /*!< USBH_T::HcRhPortStatus1: PRSC Mask */ - -#define USBH_HcPhyControl_STBYEN_Pos (27) /*!< USBH_T::HcPhyControl: STBYEN Position */ -#define USBH_HcPhyControl_STBYEN_Msk (0x1ul << USBH_HcPhyControl_STBYEN_Pos) /*!< USBH_T::HcPhyControl: STBYEN Mask */ - -#define USBH_HcMiscControl_ABORT_Pos (1) /*!< USBH_T::HcMiscControl: ABORT Position */ -#define USBH_HcMiscControl_ABORT_Msk (0x1ul << USBH_HcMiscControl_ABORT_Pos) /*!< USBH_T::HcMiscControl: ABORT Mask */ - -#define USBH_HcMiscControl_OCAL_Pos (3) /*!< USBH_T::HcMiscControl: OCAL Position */ -#define USBH_HcMiscControl_OCAL_Msk (0x1ul << USBH_HcMiscControl_OCAL_Pos) /*!< USBH_T::HcMiscControl: OCAL Mask */ - -#define USBH_HcMiscControl_DPRT1_Pos (16) /*!< USBH_T::HcMiscControl: DPRT1 Position */ -#define USBH_HcMiscControl_DPRT1_Msk (0x1ul << USBH_HcMiscControl_DPRT1_Pos) /*!< USBH_T::HcMiscControl: DPRT1 Mask */ - -/**@}*/ /* USBH_CONST */ -/**@}*/ /* end of USBH register group */ - - -/*---------------------- HSUSBH HSUSB Host Controller -------------------------*/ -/** - @addtogroup HSUSBH High Speed USB Host Controller (HSUSBH) - Memory Mapped Structure for HSUSBH Controller -@{ */ - -typedef struct -{ - - - /** - * @var HSUSBH_T::EHCVNR - * Offset: 0x00 EHCI Version Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CRLEN |Capability Registers Length - * | | |This register is used as an offset to add to register base to find the beginning of the Operational Register Space. - * |[31:16] |VERSION |Host Controller Interface Version Number - * | | |This is a two-byte register containing a BCD encoding of the EHCI revision number supported by this host controller - * | | |The most significant byte of this register represents a major revision and the least significant byte is the minor revision. - * @var HSUSBH_T::EHCSPR - * Offset: 0x04 EHCI Structural Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |N_PORTS |Number of Physical Downstream Ports - * | | |This field specifies the number of physical downstream ports implemented on this host controller - * | | |The value of this field determines how many port registers are addressable in the Operational Register Space (see Table 2-8) - * | | |Valid values are in the range of 1H to FH. - * | | |A zero in this field is undefined. - * |[4] |PPC |Port Power Control - * | | |This field indicates whether the host controller implementation includes port power control - * | | |A one in this bit indicates the ports have port power switches - * | | |A zero in this bit indicates the port do not have port power stitches - * | | |The value of this field affects the functionality of the Port Power field in each port status and control register. - * |[11:8] |N_PCC |Number of Ports Per Companion Controller - * | | |This field indicates the number of ports supported per companion host controller - * | | |It is used to indicate the port routing configuration to system software. - * | | |For example, if N_PORTS has a value of 6 and N_CC has a value of 2 then N_PCC could have a value of 3 - * | | |The convention is that the first N_PCC ports are assumed to be routed to companion controller 1, the next N_PCC ports to companion controller 2, etc - * | | |In the previous example, the N_PCC could have been 4, where the first 4 are routed to companion controller 1 and the last two are routed to companion controller 2. - * | | |The number in this field must be consistent with N_PORTS and N_CC. - * |[15:12] |N_CC |Number of Companion Controller - * | | |This field indicates the number of companion controllers associated with this USB 2.0 host controller. - * | | |A zero in this field indicates there are no companion host controllers - * | | |Port-ownership hand-off is not supported - * | | |Only high-speed devices are supported on the host controller root ports. - * | | |A value larger than zero in this field indicates there are companion USB 1.1 host controller(s) - * | | |Port-ownership hand-offs are supported - * | | |High, Full- and Low-speed devices are supported on the host controller root ports. - * @var HSUSBH_T::EHCCPR - * Offset: 0x08 EHCI Capability Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AC64 |64-bit Addressing Capability - * | | |0 = Data structure using 32-bit address memory pointers. - * |[1] |PFLF |Programmable Frame List Flag - * | | |0 = System software must use a frame list length of 1024 elements with this EHCI host controller. - * |[2] |ASPC |Asynchronous Schedule Park Capability - * | | |0 = This EHCI host controller doesn't support park feature of high-speed queue heads in the Asynchronous Schedule. - * |[7:4] |IST |Isochronous Scheduling Threshold - * | | |This field indicates, relative to the current position of the executing host controller, where software can reliably update the isochronous schedule. - * | | |When bit [7] is zero, the value of the least significant 3 bits indicates the number of micro-frames a host controller can hold a set of isochronous data structures (one or more) before flushing the state. - * |[15:8] |EECP |EHCI Extended Capabilities Pointer (EECP) - * | | |0 = No extended capabilities are implemented. - * @var HSUSBH_T::UCMDR - * Offset: 0x20 USB Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RUN |Run/Stop (R/W) - * | | |When set to a 1, the Host Controller proceeds with execution of the schedule - * | | |The Host Controller continues execution as long as this bit is set to a 1 - * | | |When this bit is set to 0, the Host Controller completes the current and any actively pipelined transactions on the USB and then halts - * | | |The Host Controller must halt within 16 micro-frames after software clears the Run bit - * | | |The HC Halted bit in the status register indicates when the Host Controller has finished its pending pipelined transactions and has entered the stopped state - * | | |Software must not write a one to this field unless the host controller is in the Halted state (i.e. - * | | |HCHalted in the USBSTS register is a one) - * | | |Doing so will yield undefined results. - * | | |0 = Stop. - * | | |1 = Run. - * |[1] |HCRST |Host Controller Reset (HCRESET) (R/W) - * | | |This control bit is used by software to reset the host controller - * | | |The effects of this on Root Hub registers are similar to a Chip Hardware Reset. - * | | |When software writes a one to this bit, the Host Controller resets its internal pipelines, timers, counters, state machines, etc - * | | |to their initial value - * | | |Any transaction currently in progress on USB is immediately terminated - * | | |A USB reset is not driven on downstream ports. - * | | |All operational registers, including port registers and port state machines are set to their initial values - * | | |Port ownership reverts to the companion host controller(s), with the side effects - * | | |Software must reinitialize the host controller in order to return the host controller to an operational state. - * | | |This bit is set to zero by the Host Controller when the reset process is complete - * | | |Software cannot terminate the reset process early by writing a zero to this register. - * | | |Software should not set this bit to a one when the HCHalted bit in the USBSTS register is a zero - * | | |Attempting to reset an actively running host controller will result in undefined behavior. - * |[3:2] |FLSZ |Frame List Size (R/W or RO) - * | | |This field is R/W only if Programmable Frame List Flag in the HCCPARAMS registers is set to a one - * | | |This field specifies the size of the frame list - * | | |The size the frame list controls which bits in the Frame Index Register should be used for the Frame List Current index - * | | |Values mean: - * | | |00 = 1024 elements (4096 bytes) Default value. - * | | |01 = 512 elements (2048 bytes). - * | | |10 = 256 elements (1024 bytes) u2013 for resource-constrained environment. - * | | |11 = Reserved. - * |[4] |PSEN |Periodic Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Periodic Schedule. Values mean: - * | | |0 = Do not process the Periodic Schedule. - * | | |1 = Use the PERIODICLISTBASE register to access the Periodic Schedule. - * |[5] |ASEN |Asynchronous Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Asynchronous Schedule. Values mean: - * | | |0 = Do not process the Asynchronous Schedule. - * | | |1 = Use the ASYNCLISTADDR register to access the Asynchronous Schedule. - * |[6] |IAAD |Interrupt on Asynchronous Advance Doorbell (R/W) - * | | |This bit is used as a doorbell by software to tell the host controller to issue an interrupt the next time it advances asynchronous schedule - * | | |Software must write a 1 to this bit to ring the doorbell. - * | | |When the host controller has evicted all appropriate cached schedule state, it sets the Interrupt on Asynchronous Advance status bit in the USBSTS register - * | | |If the Interrupt on Asynchronous Advance Enable bit in the USBINTR register is a one then the host controller will assert an interrupt at the next interrupt threshold. - * | | |The host controller sets this bit to a zero after it has set the Interrupt on Asynchronous Advance status bit in the USBSTS register to a one. - * | | |Software should not write a one to this bit when the asynchronous schedule is disabled - * | | |Doing so will yield undefined results. - * |[23:16] |ITC |Interrupt Threshold Control (R/W) - * | | |This field is used by system software to select the maximum rate at which the host controller will issue interrupts - * | | |The only valid values are defined below - * | | |If software writes an invalid value to this register, the results are undefined - * | | |Value Maximum Interrupt Interval - * | | |0x00 = Reserved. - * | | |0x01 = 1 micro-frame. - * | | |0x02 = 2 micro-frames. - * | | |0x04 = 4 micro-frames. - * | | |0x08 = 8 micro-frames (default, equates to 1 ms). - * | | |0x10 = 16 micro-frames (2 ms). - * | | |0x20 = 32 micro-frames (4 ms). - * | | |0x40 = 64 micro-frames (8 ms). - * | | |Any other value in this register yields undefined results. - * | | |Software modifications to this bit while HCHalted bit is equal to zero results in undefined behavior. - * @var HSUSBH_T::USTSR - * Offset: 0x24 USB Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBINT |USB Interrupt (USBINT) (R/WC) - * | | |The Host Controller sets this bit to 1 on the completion of a USB transaction, which results in the retirement of a Transfer Descriptor that had its IOC bit set. - * | | |The Host Controller also sets this bit to 1 when a short packet is detected (actual number of bytes received was less than the expected number of bytes). - * |[1] |UERRINT |USB Error Interrupt (USBERRINT) (R/WC) - * | | |The Host Controller sets this bit to 1 when completion of a USB transaction results in an error condition (e.g., error counter underflow) - * | | |If the TD on which the error interrupt occurred also had its IOC bit set, both this bit and USBINT bit are set. - * |[2] |PCD |Port Change Detect (R/WC) - * | | |The Host Controller sets this bit to a one when any port for which the Port Owner bit is set to zero has a change bit transition from a zero to a one or a Force Port Resume bit transition from a zero to a one as a result of a J-K transition detected on a suspended port - * | | |This bit will also be set as a result of the Connect Status Change being set to a one after system software has relinquished ownership of a connected port by writing a one to a port's Port Owner bit. - * | | |This bit is allowed to be maintained in the Auxiliary power well - * | | |Alternatively, it is also acceptable that on a D3 to D0 transition of the EHCI HC device, this bit is loaded with the OR of all of the PORTSC change bits (including: Force port resume, over-current change, enable/disable change and connect status change). - * |[3] |FLR |Frame List Rollover (R/WC) - * | | |The Host Controller sets this bit to a one when the Frame List Index rolls over from its maximum value to zero - * | | |The exact value at which the rollover occurs depends on the frame list size - * | | |For example, if the frame list size (as programmed in the Frame List Size field of the USBCMD register) is 1024, the Frame Index Register rolls over every time FRINDEX[13] toggles - * | | |Similarly, if the size is 512, the Host Controller sets this bit to a one every time FRINDEX[12] toggles. - * |[4] |HSERR |Host System Error (R/WC) - * | | |The Host Controller sets this bit to 1 when a serious error occurs during a host system access involving the Host Controller module. - * |[5] |IAA |Interrupt on Asynchronous Advance (R/WC) - * | | |System software can force the host controller to issue an interrupt the next time the host controller advances the asynchronous schedule by writing a one to the Interrupt on Asynchronous Advance Doorbell bit in the USBCMD register - * | | |This status bit indicates the assertion of that interrupt source. - * |[12] |HCHalted |HCHalted (RO) - * | | |This bit is a zero whenever the Run/Stop bit is a one - * | | |The Host Controller sets this bit to one after it has stopped executing as a result of the Run/Stop bit being set to 0, either by software or by the Host Controller hardware (e.g. - * | | |internal error). - * |[13] |RECLA |Reclamation (RO) - * | | |This is a read-only status bit, which is used to detect an empty asynchronous schedule. - * |[14] |PSS |Periodic Schedule Status (RO) - * | | |The bit reports the current real status of the Periodic Schedule - * | | |If this bit is a zero then the status of the Periodic Schedule is disabled - * | | |If this bit is a one then the status of the Periodic Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Periodic Schedule when software transitions the Periodic Schedule Enable bit in the USBCMD register - * | | |When this bit and the Periodic Schedule Enable bit are the same value, the Periodic Schedule is either enabled (1) or disabled (0). - * |[15] |ASS |Asynchronous Schedule Status (RO) - * | | |The bit reports the current real status of the Asynchronous Schedule - * | | |If this bit is a zero then the status of them Asynchronous Schedule is disabled - * | | |If this bit is a one then the status of the Asynchronous Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Asynchronous Schedule when software transitions the Asynchronous Schedule Enable bit in the USBCMD register - * | | |When this bit and the Asynchronous Schedule Enable bit are the same value, the Asynchronous Schedule is either enabled (1) or disabled (0). - * @var HSUSBH_T::UIENR - * Offset: 0x28 USB Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIEN |USB Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBINT bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBINT bit. - * | | |0 = USB interrupt Disabled. - * | | |1 = USB interrupt Enabled. - * |[1] |UERRIEN |USB Error Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBERRINT bit in the USBSTS register is a one, the host t controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBERRINT bit. - * | | |0 = USB Error interrupt Disabled. - * | | |1 = USB Error interrupt Enabled. - * |[2] |PCIEN |Port Change Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the Port Change Detect bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Port Change Detect bit. - * | | |0 = Port Change interrupt Disabled. - * | | |1 = Port Change interrupt Enabled. - * |[3] |FLREN |Frame List Rollover Enable or Disable Bit - * | | |When this bit is a one, and the Frame List Rollover bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Frame List Rollover bit. - * | | |0 = Frame List Rollover interrupt Disabled. - * | | |1 = Frame List Rollover interrupt Enabled. - * |[4] |HSERREN |Host System Error Enable or Disable Bit - * | | |When this bit is a one, and the Host System Error Status bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Host System Error bit. - * | | |0 = Host System Error interrupt Disabled. - * | | |1 = Host System Error interrupt Enabled. - * |[5] |IAAEN |Interrupt on Asynchronous Advance Enable or Disable Bit - * | | |When this bit is a one, and the Interrupt on Asynchronous Advance bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the Interrupt on Asynchronous Advance bit. - * | | |0 = Interrupt on Asynchronous Advance Disabled. - * | | |1 = Interrupt on Asynchronous Advance Enabled. - * @var HSUSBH_T::UFINDR - * Offset: 0x2C USB Frame Index Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Index - * | | |The value in this register increment at the end of each time frame (e.g. - * | | |micro-frame) - * | | |Bits [N:3] are used for the Frame List current index - * | | |This means that each location of the frame list is accessed 8 times (frames or micro-frames) before moving to the next index - * | | |The following illustrates values of N based on the value of the Frame List Size field in the USBCMD register. - * | | |FLSZ (UCMDR[3:2] Number Elements N - * | | |0x0 1024 12 - * | | |0x1 512 11 - * | | |0x2 256 10 - * | | |0x3 Reserved - * @var HSUSBH_T::UPFLBAR - * Offset: 0x34 USB Periodic Frame List Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |BADDR |Base Address - * | | |These bits correspond to memory address signals [31:12], respectively. - * @var HSUSBH_T::UCALAR - * Offset: 0x38 USB Current Asynchronous List Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:5] |LPL |Link Pointer Low (LPL) - * | | |These bits correspond to memory address signals [31:5], respectively - * | | |This field may only reference a Queue Head (QH). - * @var HSUSBH_T::UASSTR - * Offset: 0x3C USB Asynchronous Schedule Sleep Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ASSTMR |Asynchronous Schedule Sleep Timer - * | | |This field defines the AsyncSchedSleepTime of EHCI spec. - * | | |The asynchronous schedule sleep timer is used to control how often the host controller fetches asynchronous schedule list from system memory while the asynchronous schedule is empty. - * | | |The default value of this timer is 12'hBD6 - * | | |Because this timer is implemented in UTMI clock (30MHz) domain, the default sleeping time will be about 100us. - * @var HSUSBH_T::UCFGR - * Offset: 0x60 USB Configure Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CF |Configure Flag (CF) - * | | |Host software sets this bit as the last action in its process of configuring the Host Controller - * | | |This bit controls the default port-routing control logic - * | | |Bit values and side-effects are listed below. - * | | |0 = Port routing control logic default-routes each port to an implementation dependent classic host controller. - * | | |1 = Port routing control logic default-routes all ports to this host controller. - * @var HSUSBH_T::UPSCR[2] - * Offset: 0x64~0x68 USB Port 0~1 Status and Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |Current Connect Status (RO) - * | | |This value reflects the current state of the port, and may not correspond directly to the event that caused the Connect Status Change bit (Bit 1) to be set. - * | | |This field is zero if Port Power is zero. - * | | |0 = No device is present. - * | | |1 = Device is present on port. - * |[1] |CSC |Connect Status Change (R/W) - * | | |Indicates a change has occurred in the port's Current Connect Status - * | | |The host controller sets this bit for all changes to the port device connect status, even if system software has not cleared an existing connect status change - * | | |For example, the insertion status changes twice before system software has cleared the changed condition, hub hardware will be "setting" an already-set bit (i.e., the bit will remain set).Software sets this bit to 0 by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Change in Current Connect Status. - * |[2] |PE |Port Enabled/Disabled (R/W) - * | | |Ports can only be enabled by the host controller as a part of the reset and enable - * | | |Software cannot enable a port by writing a one to this field - * | | |The host controller will only set this bit to a one when the reset sequence determines that the attached device is a high-speed device. - * | | |Ports can be disabled by either a fault condition (disconnect event or other fault condition) or by host software - * | | |Note that the bit status does not change until the port state actually changes - * | | |There may be a delay in disabling or enabling a port due to other host controller and bus events. - * | | |When the port is disabled (0b) downstream propagation of data is blocked on this port, except for reset. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[3] |PEC |Port Enable/Disable Change (R/WC) - * | | |For the root hub, this bit gets set to a one only when a port is disabled due to the appropriate conditions existing at the EOF2 point (See Chapter 11 of the USB Specification for the definition of a Port Error) - * | | |Software clears this bit by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Port enabled/disabled status has changed. - * |[4] |OCA |Over-current Active (RO) - * | | |This bit will automatically transition from a one to a zero when the over current condition is removed. - * | | |0 = This port does not have an over-current condition. - * | | |1 = This port currently has an over-current condition. - * |[5] |OCC |Over-current Change (R/WC) - * | | |1 = This bit gets set to a one when there is a change to Over-current Active - * | | |Software clears this bit by writing a one to this bit position. - * |[6] |FPR |Force Port Resume (R/W) - * | | |This functionality defined for manipulating this bit depends on the value of the Suspend bit - * | | |For example, if the port is not suspended (Suspend and Enabled bits are a one) and software transitions this bit to a one, then the effects on the bus are undefined. - * | | |Software sets this bit to a 1 to drive resume signaling - * | | |The Host Controller sets this bit to a 1 if a J-to-K transition is detected while the port is in the Suspend state - * | | |When this bit transitions to a one because a J-to-K transition is detected, the Port Change Detect bit in the USBSTS register is also set to a one - * | | |If software sets this bit to a one, the host controller must not set the Port Change Detect bit. - * | | |Note that when the EHCI controller owns the port, the resume sequence follows the defined sequence documented in the USB Specification Revision 2.0 - * | | |The resume signaling (Full-speed 'K') is driven on the port as long as this bit remains a one - * | | |Software must appropriately time the Resume and set this bit to a zero when the appropriate amount of time has elapsed - * | | |Writing a zero (from one) causes the port to return to high-speed mode (forcing the bus below the port into a high-speed idle) - * | | |This bit will remain a one until the port has switched to the high-speed idle - * | | |The host controller must complete this transition within 2 milliseconds of software setting this bit to a zero. - * | | |This field is zero if Port Power is zero. - * | | |0 = No resume (K-state) detected/driven on port. - * | | |1 = Resume detected/driven on port. - * |[7] |SUSPEND |Suspend (R/W) - * | | |Port Enabled Bit and Suspend bit of this register define the port states as follows: - * | | |Port enable is 0 and suspend is 0 = Disable. - * | | |Port enable is 0 and suspend is 1 = Disable. - * | | |Port enable is 1 and suspend is 0 = Enable. - * | | |Port enable is 1 and suspend is 1 = Suspend. - * | | |When in suspend state, downstream propagation of data is blocked on this port, except for port reset - * | | |The blocking occurs at the end of the current transaction, if a transaction was in progress when this bit was written to 1 - * | | |In the suspend state, the port is sensitive to resume detection - * | | |Note that the bit status does not change until the port is suspended and that there may be a delay in suspending a port if there is a transaction currently in progress on the USB. - * | | |A write of zero to this bit is ignored by the host controller - * | | |The host controller will unconditionally set this bit to a zero when: - * | | |Software sets the Force Port Resume bit to a zero (from a one). - * | | |Software sets the Port Reset bit to a one (from a zero). - * | | |If host software sets this bit to a one when the port is not enabled (i.e. - * | | |Port enabled bit is a zero) the results are undefined. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port not in suspend state. - * | | |1 = Port in suspend state. - * |[8] |PRST |Port Reset (R/W) - * | | |When software writes a one to this bit (from a zero), the bus reset sequence as defined in the USB Specification Revision 2.0 is started - * | | |Software writes a zero to this bit to terminate the bus reset sequence - * | | |Software must keep this bit at a one long enough to ensure the reset sequence, as specified in the USB Specification Revision 2.0, completes - * | | |Note: when software writes this bit to a one, it must also write a zero to the Port Enable bit. - * | | |Note that when software writes a zero to this bit there may be a delay before the bit status changes to a zero - * | | |The bit status will not read as a zero until after the reset has completed - * | | |If the port is in high-speed mode after reset is complete, the host controller will automatically enable this port (e.g. - * | | |set the Port Enable bit to a one) - * | | |A host controller must terminate the reset and stabilize the state of the port within 2 milliseconds of software transitioning this bit from a one to a zero - * | | |For example: if the port detects that the attached device is high-speed during reset, then the host controller must have the port in the enabled state within 2ms of software writing this bit to a zero. - * | | |The HCHalted bit in the USBSTS register should be a zero before software attempts to use this bit - * | | |The host controller may hold Port Reset asserted to a one when the HCHalted bit is a one. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port is not in Reset. - * | | |1 = Port is in Reset. - * |[11:10] |LSTS |Line Status (RO) - * | | |These bits reflect the current logical levels of the D+ (bit 11) and D- (bit 10) signal lines - * | | |These bits are used for detection of low-speed USB devices prior to the port reset and enable sequence - * | | |This field is valid only when the port enable bit is zero and the current connect status bit is set to a one. - * | | |The encoding of the bits are: - * | | |Bits[11:10] USB State Interpretation - * | | |00 = SE0 Not Low-speed device, perform EHCI reset. - * | | |01 = K-state Low-speed device, release ownership of port. - * | | |10 = J-state Not Low-speed device, perform EHCI reset. - * | | |11 = Undefined Not Low-speed device, perform EHCI reset. - * | | |This value of this field is undefined if Port Power is zero. - * |[12] |PP |Port Power (PP) - * | | |Host controller has port power control switches - * | | |This bit represents the Current setting of the switch (0 = off, 1 = on) - * | | |When power is not available on a port (i.e. - * | | |PP equals a 0), the port is nonfunctional and will not report attaches, detaches, etc. - * | | |When an over-current condition is detected on a powered port and PPC is a one, the PP bit in each affected port may be transitioned by the host controller from a 1 to 0 (removing power from the port). - * |[13] |PO |Port Owner (R/W) - * | | |This bit unconditionally goes to a 0b when the Configured bit in the CONFIGFLAG register makes a 0 to 1 transition - * | | |This bit unconditionally goes to 1 whenever the Configured bit is zero. - * | | |System software uses this field to release ownership of the port to a selected host controller (in the event that the attached device is not a high-speed device) - * | | |Software writes a one to this bit when the attached device is not a high-speed device - * | | |A one in this bit means that a companion host controller owns and controls the port. - * |[19:16] |PTC |Port Test Control (R/W) - * | | |When this field is zero, the port is NOT operating in a test mode - * | | |A non-zero value indicates that it is operating in test mode and the specific test mode is indicated by the specific value - * | | |The encoding of the test mode bits are (0x6 ~ 0xF are reserved): - * | | |Bits Test Mode - * | | |0x0 = Test mode not enabled. - * | | |0x1 = Test J_STATE. - * | | |0x2 = Test K_STATE. - * | | |0x3 = Test SE0_NAK. - * | | |0x4 = Test Packet. - * | | |0x5 = Test FORCE_ENABLE. - * @var HSUSBH_T::USBPCR0 - * Offset: 0xC4 USB PHY 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 0. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 0 was suspended. - * | | |1 = USB PHY 0 was not suspended. - * |[11] |CLKVALID |UTMI Clock Valid - * | | |This bit is a flag to indicate if the UTMI clock from USB 2.0 PHY is ready - * | | |S/W program must prevent to write other control registers before this UTMI clock valid flag is active. - * | | |0 = UTMI clock is not valid. - * | | |1 = UTMI clock is valid. - * @var HSUSBH_T::USBPCR1 - * Offset: 0xC8 USB PHY 1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 1. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 1 was suspended. - * | | |1 = USB PHY 1 was not suspended. - */ - __I uint32_t EHCVNR; /*!< [0x0000] EHCI Version Number Register */ - __I uint32_t EHCSPR; /*!< [0x0004] EHCI Structural Parameters Register */ - __I uint32_t EHCCPR; /*!< [0x0008] EHCI Capability Parameters Register */ - __I uint32_t RESERVE0[5]; - __IO uint32_t UCMDR; /*!< [0x0020] USB Command Register */ - __IO uint32_t USTSR; /*!< [0x0024] USB Status Register */ - __IO uint32_t UIENR; /*!< [0x0028] USB Interrupt Enable Register */ - __IO uint32_t UFINDR; /*!< [0x002c] USB Frame Index Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t UPFLBAR; /*!< [0x0034] USB Periodic Frame List Base Address Register */ - __IO uint32_t UCALAR; /*!< [0x0038] USB Current Asynchronous List Address Register */ - __IO uint32_t UASSTR; /*!< [0x003c] USB Asynchronous Schedule Sleep Timer Register */ - __I uint32_t RESERVE2[8]; - __IO uint32_t UCFGR; /*!< [0x0060] USB Configure Flag Register */ - __IO uint32_t UPSCR[2]; /*!< [0x0064] ~ [0x0068] USB Port 0 & 1 Status and Control Register */ - __I uint32_t RESERVE3[22]; - __IO uint32_t USBPCR0; /*!< [0x00c4] USB PHY 0 Control Register */ - __IO uint32_t USBPCR1; /*!< [0x00c8] USB PHY 1 Control Register */ - -} HSUSBH_T; - -/** - @addtogroup HSUSBH_CONST HSUSBH Bit Field Definition - Constant Definitions for HSUSBH Controller -@{ */ - -#define HSUSBH_EHCVNR_CRLEN_Pos (0) /*!< HSUSBH_T::EHCVNR: CRLEN Position */ -#define HSUSBH_EHCVNR_CRLEN_Msk (0xfful << HSUSBH_EHCVNR_CRLEN_Pos) /*!< HSUSBH_T::EHCVNR: CRLEN Mask */ - -#define HSUSBH_EHCVNR_VERSION_Pos (16) /*!< HSUSBH_T::EHCVNR: VERSION Position */ -#define HSUSBH_EHCVNR_VERSION_Msk (0xfffful << HSUSBH_EHCVNR_VERSION_Pos) /*!< HSUSBH_T::EHCVNR: VERSION Mask */ - -#define HSUSBH_EHCSPR_N_PORTS_Pos (0) /*!< HSUSBH_T::EHCSPR: N_PORTS Position */ -#define HSUSBH_EHCSPR_N_PORTS_Msk (0xful << HSUSBH_EHCSPR_N_PORTS_Pos) /*!< HSUSBH_T::EHCSPR: N_PORTS Mask */ - -#define HSUSBH_EHCSPR_PPC_Pos (4) /*!< HSUSBH_T::EHCSPR: PPC Position */ -#define HSUSBH_EHCSPR_PPC_Msk (0x1ul << HSUSBH_EHCSPR_PPC_Pos) /*!< HSUSBH_T::EHCSPR: PPC Mask */ - -#define HSUSBH_EHCSPR_N_PCC_Pos (8) /*!< HSUSBH_T::EHCSPR: N_PCC Position */ -#define HSUSBH_EHCSPR_N_PCC_Msk (0xful << HSUSBH_EHCSPR_N_PCC_Pos) /*!< HSUSBH_T::EHCSPR: N_PCC Mask */ - -#define HSUSBH_EHCSPR_N_CC_Pos (12) /*!< HSUSBH_T::EHCSPR: N_CC Position */ -#define HSUSBH_EHCSPR_N_CC_Msk (0xful << HSUSBH_EHCSPR_N_CC_Pos) /*!< HSUSBH_T::EHCSPR: N_CC Mask */ - -#define HSUSBH_EHCCPR_AC64_Pos (0) /*!< HSUSBH_T::EHCCPR: AC64 Position */ -#define HSUSBH_EHCCPR_AC64_Msk (0x1ul << HSUSBH_EHCCPR_AC64_Pos) /*!< HSUSBH_T::EHCCPR: AC64 Mask */ - -#define HSUSBH_EHCCPR_PFLF_Pos (1) /*!< HSUSBH_T::EHCCPR: PFLF Position */ -#define HSUSBH_EHCCPR_PFLF_Msk (0x1ul << HSUSBH_EHCCPR_PFLF_Pos) /*!< HSUSBH_T::EHCCPR: PFLF Mask */ - -#define HSUSBH_EHCCPR_ASPC_Pos (2) /*!< HSUSBH_T::EHCCPR: ASPC Position */ -#define HSUSBH_EHCCPR_ASPC_Msk (0x1ul << HSUSBH_EHCCPR_ASPC_Pos) /*!< HSUSBH_T::EHCCPR: ASPC Mask */ - -#define HSUSBH_EHCCPR_IST_Pos (4) /*!< HSUSBH_T::EHCCPR: IST Position */ -#define HSUSBH_EHCCPR_IST_Msk (0xful << HSUSBH_EHCCPR_IST_Pos) /*!< HSUSBH_T::EHCCPR: IST Mask */ - -#define HSUSBH_EHCCPR_EECP_Pos (8) /*!< HSUSBH_T::EHCCPR: EECP Position */ -#define HSUSBH_EHCCPR_EECP_Msk (0xfful << HSUSBH_EHCCPR_EECP_Pos) /*!< HSUSBH_T::EHCCPR: EECP Mask */ - -#define HSUSBH_UCMDR_RUN_Pos (0) /*!< HSUSBH_T::UCMDR: RUN Position */ -#define HSUSBH_UCMDR_RUN_Msk (0x1ul << HSUSBH_UCMDR_RUN_Pos) /*!< HSUSBH_T::UCMDR: RUN Mask */ - -#define HSUSBH_UCMDR_HCRST_Pos (1) /*!< HSUSBH_T::UCMDR: HCRST Position */ -#define HSUSBH_UCMDR_HCRST_Msk (0x1ul << HSUSBH_UCMDR_HCRST_Pos) /*!< HSUSBH_T::UCMDR: HCRST Mask */ - -#define HSUSBH_UCMDR_FLSZ_Pos (2) /*!< HSUSBH_T::UCMDR: FLSZ Position */ -#define HSUSBH_UCMDR_FLSZ_Msk (0x3ul << HSUSBH_UCMDR_FLSZ_Pos) /*!< HSUSBH_T::UCMDR: FLSZ Mask */ - -#define HSUSBH_UCMDR_PSEN_Pos (4) /*!< HSUSBH_T::UCMDR: PSEN Position */ -#define HSUSBH_UCMDR_PSEN_Msk (0x1ul << HSUSBH_UCMDR_PSEN_Pos) /*!< HSUSBH_T::UCMDR: PSEN Mask */ - -#define HSUSBH_UCMDR_ASEN_Pos (5) /*!< HSUSBH_T::UCMDR: ASEN Position */ -#define HSUSBH_UCMDR_ASEN_Msk (0x1ul << HSUSBH_UCMDR_ASEN_Pos) /*!< HSUSBH_T::UCMDR: ASEN Mask */ - -#define HSUSBH_UCMDR_IAAD_Pos (6) /*!< HSUSBH_T::UCMDR: IAAD Position */ -#define HSUSBH_UCMDR_IAAD_Msk (0x1ul << HSUSBH_UCMDR_IAAD_Pos) /*!< HSUSBH_T::UCMDR: IAAD Mask */ - -#define HSUSBH_UCMDR_ITC_Pos (16) /*!< HSUSBH_T::UCMDR: ITC Position */ -#define HSUSBH_UCMDR_ITC_Msk (0xfful << HSUSBH_UCMDR_ITC_Pos) /*!< HSUSBH_T::UCMDR: ITC Mask */ - -#define HSUSBH_USTSR_USBINT_Pos (0) /*!< HSUSBH_T::USTSR: USBINT Position */ -#define HSUSBH_USTSR_USBINT_Msk (0x1ul << HSUSBH_USTSR_USBINT_Pos) /*!< HSUSBH_T::USTSR: USBINT Mask */ - -#define HSUSBH_USTSR_UERRINT_Pos (1) /*!< HSUSBH_T::USTSR: UERRINT Position */ -#define HSUSBH_USTSR_UERRINT_Msk (0x1ul << HSUSBH_USTSR_UERRINT_Pos) /*!< HSUSBH_T::USTSR: UERRINT Mask */ - -#define HSUSBH_USTSR_PCD_Pos (2) /*!< HSUSBH_T::USTSR: PCD Position */ -#define HSUSBH_USTSR_PCD_Msk (0x1ul << HSUSBH_USTSR_PCD_Pos) /*!< HSUSBH_T::USTSR: PCD Mask */ - -#define HSUSBH_USTSR_FLR_Pos (3) /*!< HSUSBH_T::USTSR: FLR Position */ -#define HSUSBH_USTSR_FLR_Msk (0x1ul << HSUSBH_USTSR_FLR_Pos) /*!< HSUSBH_T::USTSR: FLR Mask */ - -#define HSUSBH_USTSR_HSERR_Pos (4) /*!< HSUSBH_T::USTSR: HSERR Position */ -#define HSUSBH_USTSR_HSERR_Msk (0x1ul << HSUSBH_USTSR_HSERR_Pos) /*!< HSUSBH_T::USTSR: HSERR Mask */ - -#define HSUSBH_USTSR_IAA_Pos (5) /*!< HSUSBH_T::USTSR: IAA Position */ -#define HSUSBH_USTSR_IAA_Msk (0x1ul << HSUSBH_USTSR_IAA_Pos) /*!< HSUSBH_T::USTSR: IAA Mask */ - -#define HSUSBH_USTSR_HCHalted_Pos (12) /*!< HSUSBH_T::USTSR: HCHalted Position */ -#define HSUSBH_USTSR_HCHalted_Msk (0x1ul << HSUSBH_USTSR_HCHalted_Pos) /*!< HSUSBH_T::USTSR: HCHalted Mask */ - -#define HSUSBH_USTSR_RECLA_Pos (13) /*!< HSUSBH_T::USTSR: RECLA Position */ -#define HSUSBH_USTSR_RECLA_Msk (0x1ul << HSUSBH_USTSR_RECLA_Pos) /*!< HSUSBH_T::USTSR: RECLA Mask */ - -#define HSUSBH_USTSR_PSS_Pos (14) /*!< HSUSBH_T::USTSR: PSS Position */ -#define HSUSBH_USTSR_PSS_Msk (0x1ul << HSUSBH_USTSR_PSS_Pos) /*!< HSUSBH_T::USTSR: PSS Mask */ - -#define HSUSBH_USTSR_ASS_Pos (15) /*!< HSUSBH_T::USTSR: ASS Position */ -#define HSUSBH_USTSR_ASS_Msk (0x1ul << HSUSBH_USTSR_ASS_Pos) /*!< HSUSBH_T::USTSR: ASS Mask */ - -#define HSUSBH_UIENR_USBIEN_Pos (0) /*!< HSUSBH_T::UIENR: USBIEN Position */ -#define HSUSBH_UIENR_USBIEN_Msk (0x1ul << HSUSBH_UIENR_USBIEN_Pos) /*!< HSUSBH_T::UIENR: USBIEN Mask */ - -#define HSUSBH_UIENR_UERRIEN_Pos (1) /*!< HSUSBH_T::UIENR: UERRIEN Position */ -#define HSUSBH_UIENR_UERRIEN_Msk (0x1ul << HSUSBH_UIENR_UERRIEN_Pos) /*!< HSUSBH_T::UIENR: UERRIEN Mask */ - -#define HSUSBH_UIENR_PCIEN_Pos (2) /*!< HSUSBH_T::UIENR: PCIEN Position */ -#define HSUSBH_UIENR_PCIEN_Msk (0x1ul << HSUSBH_UIENR_PCIEN_Pos) /*!< HSUSBH_T::UIENR: PCIEN Mask */ - -#define HSUSBH_UIENR_FLREN_Pos (3) /*!< HSUSBH_T::UIENR: FLREN Position */ -#define HSUSBH_UIENR_FLREN_Msk (0x1ul << HSUSBH_UIENR_FLREN_Pos) /*!< HSUSBH_T::UIENR: FLREN Mask */ - -#define HSUSBH_UIENR_HSERREN_Pos (4) /*!< HSUSBH_T::UIENR: HSERREN Position */ -#define HSUSBH_UIENR_HSERREN_Msk (0x1ul << HSUSBH_UIENR_HSERREN_Pos) /*!< HSUSBH_T::UIENR: HSERREN Mask */ - -#define HSUSBH_UIENR_IAAEN_Pos (5) /*!< HSUSBH_T::UIENR: IAAEN Position */ -#define HSUSBH_UIENR_IAAEN_Msk (0x1ul << HSUSBH_UIENR_IAAEN_Pos) /*!< HSUSBH_T::UIENR: IAAEN Mask */ - -#define HSUSBH_UFINDR_FI_Pos (0) /*!< HSUSBH_T::UFINDR: FI Position */ -#define HSUSBH_UFINDR_FI_Msk (0x3ffful << HSUSBH_UFINDR_FI_Pos) /*!< HSUSBH_T::UFINDR: FI Mask */ - -#define HSUSBH_UPFLBAR_BADDR_Pos (12) /*!< HSUSBH_T::UPFLBAR: BADDR Position */ -#define HSUSBH_UPFLBAR_BADDR_Msk (0xffffful << HSUSBH_UPFLBAR_BADDR_Pos) /*!< HSUSBH_T::UPFLBAR: BADDR Mask */ - -#define HSUSBH_UCALAR_LPL_Pos (5) /*!< HSUSBH_T::UCALAR: LPL Position */ -#define HSUSBH_UCALAR_LPL_Msk (0x7fffffful << HSUSBH_UCALAR_LPL_Pos) /*!< HSUSBH_T::UCALAR: LPL Mask */ - -#define HSUSBH_UASSTR_ASSTMR_Pos (0) /*!< HSUSBH_T::UASSTR: ASSTMR Position */ -#define HSUSBH_UASSTR_ASSTMR_Msk (0xffful << HSUSBH_UASSTR_ASSTMR_Pos) /*!< HSUSBH_T::UASSTR: ASSTMR Mask */ - -#define HSUSBH_UCFGR_CF_Pos (0) /*!< HSUSBH_T::UCFGR: CF Position */ -#define HSUSBH_UCFGR_CF_Msk (0x1ul << HSUSBH_UCFGR_CF_Pos) /*!< HSUSBH_T::UCFGR: CF Mask */ - -#define HSUSBH_UPSCR_CCS_Pos (0) /*!< HSUSBH_T::UPSCR[2]: CCS Position */ -#define HSUSBH_UPSCR_CCS_Msk (0x1ul << HSUSBH_UPSCR_CCS_Pos) /*!< HSUSBH_T::UPSCR[2]: CCS Mask */ - -#define HSUSBH_UPSCR_CSC_Pos (1) /*!< HSUSBH_T::UPSCR[2]: CSC Position */ -#define HSUSBH_UPSCR_CSC_Msk (0x1ul << HSUSBH_UPSCR_CSC_Pos) /*!< HSUSBH_T::UPSCR[2]: CSC Mask */ - -#define HSUSBH_UPSCR_PE_Pos (2) /*!< HSUSBH_T::UPSCR[2]: PE Position */ -#define HSUSBH_UPSCR_PE_Msk (0x1ul << HSUSBH_UPSCR_PE_Pos) /*!< HSUSBH_T::UPSCR[2]: PE Mask */ - -#define HSUSBH_UPSCR_PEC_Pos (3) /*!< HSUSBH_T::UPSCR[2]: PEC Position */ -#define HSUSBH_UPSCR_PEC_Msk (0x1ul << HSUSBH_UPSCR_PEC_Pos) /*!< HSUSBH_T::UPSCR[2]: PEC Mask */ - -#define HSUSBH_UPSCR_OCA_Pos (4) /*!< HSUSBH_T::UPSCR[2]: OCA Position */ -#define HSUSBH_UPSCR_OCA_Msk (0x1ul << HSUSBH_UPSCR_OCA_Pos) /*!< HSUSBH_T::UPSCR[2]: OCA Mask */ - -#define HSUSBH_UPSCR_OCC_Pos (5) /*!< HSUSBH_T::UPSCR[2]: OCC Position */ -#define HSUSBH_UPSCR_OCC_Msk (0x1ul << HSUSBH_UPSCR_OCC_Pos) /*!< HSUSBH_T::UPSCR[2]: OCC Mask */ - -#define HSUSBH_UPSCR_FPR_Pos (6) /*!< HSUSBH_T::UPSCR[2]: FPR Position */ -#define HSUSBH_UPSCR_FPR_Msk (0x1ul << HSUSBH_UPSCR_FPR_Pos) /*!< HSUSBH_T::UPSCR[2]: FPR Mask */ - -#define HSUSBH_UPSCR_SUSPEND_Pos (7) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Position */ -#define HSUSBH_UPSCR_SUSPEND_Msk (0x1ul << HSUSBH_UPSCR_SUSPEND_Pos) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Mask */ - -#define HSUSBH_UPSCR_PRST_Pos (8) /*!< HSUSBH_T::UPSCR[2]: PRST Position */ -#define HSUSBH_UPSCR_PRST_Msk (0x1ul << HSUSBH_UPSCR_PRST_Pos) /*!< HSUSBH_T::UPSCR[2]: PRST Mask */ - -#define HSUSBH_UPSCR_LSTS_Pos (10) /*!< HSUSBH_T::UPSCR[2]: LSTS Position */ -#define HSUSBH_UPSCR_LSTS_Msk (0x3ul << HSUSBH_UPSCR_LSTS_Pos) /*!< HSUSBH_T::UPSCR[2]: LSTS Mask */ - -#define HSUSBH_UPSCR_PP_Pos (12) /*!< HSUSBH_T::UPSCR[2]: PP Position */ -#define HSUSBH_UPSCR_PP_Msk (0x1ul << HSUSBH_UPSCR_PP_Pos) /*!< HSUSBH_T::UPSCR[2]: PP Mask */ - -#define HSUSBH_UPSCR_PO_Pos (13) /*!< HSUSBH_T::UPSCR[2]: PO Position */ -#define HSUSBH_UPSCR_PO_Msk (0x1ul << HSUSBH_UPSCR_PO_Pos) /*!< HSUSBH_T::UPSCR[2]: PO Mask */ - -#define HSUSBH_UPSCR_PTC_Pos (16) /*!< HSUSBH_T::UPSCR[2]: PTC Position */ -#define HSUSBH_UPSCR_PTC_Msk (0xful << HSUSBH_UPSCR_PTC_Pos) /*!< HSUSBH_T::UPSCR[2]: PTC Mask */ - -#define HSUSBH_USBPCR0_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR0: SUSPEND Position */ -#define HSUSBH_USBPCR0_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR0_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR0: SUSPEND Mask */ - -#define HSUSBH_USBPCR0_CLKVALID_Pos (11) /*!< HSUSBH_T::USBPCR0: CLKVALID Position */ -#define HSUSBH_USBPCR0_CLKVALID_Msk (0x1ul << HSUSBH_USBPCR0_CLKVALID_Pos) /*!< HSUSBH_T::USBPCR0: CLKVALID Mask */ - -#define HSUSBH_USBPCR1_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR1: SUSPEND Position */ -#define HSUSBH_USBPCR1_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR1_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR1: SUSPEND Mask */ - -/**@}*/ /* HSUSBH_CONST */ -/**@}*/ /* end of HSUSBH register group */ - -#define USBH ((USBH_T *)0xB0007000) -#define HSUSBH ((HSUSBH_T *)0xB0005000) - - -/// @endcond /*HIDDEN_SYMBOLS*/ - -#endif /* _USBH_CONFIG_H_ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/ehci.h b/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/ehci.h deleted file mode 100644 index 4d09ed9b8fc..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/ehci.h +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************//** - * @file ehci.h - * @version V1.00 - * @brief USB EHCI host controller driver header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_EHCI_H_ -#define _USBH_EHCI_H_ - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct qh_t; -struct iso_ep_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------------*/ -/* Periodic Frame List Size (256, 512, or 1024) */ -/*----------------------------------------------------------------------------------------*/ -#define FL_SIZE 1024 /* frame list size can be 256, 512, or 1024 */ -#define NUM_IQH 11 /* depends on FL_SIZE, 256:9, 512:10, 1024:11 */ - - -/*----------------------------------------------------------------------------------------*/ -/* Interrupt Threshold Control (1, 2, 4, 6, .. 64) */ -/*----------------------------------------------------------------------------------------*/ -#define UCMDR_INT_THR_CTRL (0x1< of QH */ -} qTD_T; - - -#define QTD_LIST_END 0x1 /* Indicate the terminate of qTD list. */ -#define QTD_PTR(x) ((qTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Status: qTD Token[7:0] - */ -#define QTD_STS_PS_OUT (0<<0) /* directs the HC to issue an OUT PID */ -#define QTD_STS_PS_PING (1<<0) /* directs the HC to issue an PING PID */ -#define QTD_STS_SPLIT_STRAT (0<<1) /* directs the HC to issue an Start split */ -#define QTD_STS_SPLIT_COMPLETE (1<<1) /* directs the HC to issue an Complete split */ -#define QTD_STS_MISS_MF (1<<2) /* miss a required complete-split transaction */ -#define QTD_STS_XactErr (1<<3) /* Transaction Error occurred */ -#define QTD_STS_BABBLE (1<<4) /* Babble Detected */ -#define QTD_STS_DATA_BUFF_ERR (1<<5) /* Data Buffer Error */ -#define QTD_STS_HALT (1<<6) /* Halted */ -#define QTD_STS_ACTIVE (1<<7) /* Active */ - -/* - * PID: qTD Token[9:8] - */ -#define QTD_PID_Msk (0x3<<8) -#define QTD_PID_OUT (0<<8) /* generates token (E1H) */ -#define QTD_PID_IN (1<<8) /* generates token (69H) */ -#define QTD_PID_SETUP (2<<8) /* generates token (2DH) */ - -#define QTD_ERR_COUNTER (3<<10) /* Token[11:10] */ -#define QTD_IOC (1<<15) /* Token[15] - Interrupt On Complete */ -#define QTD_TODO_LEN_Pos 16 /* Token[31:16] - Total Bytes to Transfer */ -#define QTD_TODO_LEN(x) (((x)>>16) & 0x7FFF) -#define QTD_DT (1UL<<31) /* Token[31] - Data Toggle */ - -/*----------------------------------------------------------------------------------------*/ -/* Queue Head (QH) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct qh_t -{ - /* OHCI spec. Endpoint descriptor */ - uint32_t HLink; /* Queue Head Horizontal Link Pointer */ - uint32_t Chrst; /* Endpoint Characteristics: QH DWord 1 */ - uint32_t Cap; /* Endpoint Capabilities: QH DWord 2 */ - uint32_t Curr_qTD; /* Current qTD Pointer */ - /* - * The followings are qTD Transfer Overlay - */ - uint32_t OL_Next_qTD; /* Next qTD Pointer */ - uint32_t OL_Alt_Next_qTD; /* Alternate Next qTD Pointer */ - uint32_t OL_Token; /* qTD Token */ - uint32_t OL_Bptr[5]; /* qTD Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - qTD_T *qtd_list; /* currently linked qTD transfers */ - qTD_T *done_list; /* currently linked qTD transfers */ - struct qh_t *next; /* point to the next QH in remove list */ -} QH_T; - -/* HLink[0] T field of "Queue Head Horizontal Link Pointer" */ -#define QH_HLNK_END 0x1 - -/* - * HLink[2:1] Typ field of "Queue Head Horizontal Link Pointer" - */ -#define QH_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define QH_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define QH_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define QH_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define QH_PTR(x) ((QH_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Bit fields of "Endpoint Characteristics" - */ -#define QH_NAK_RL (4L<<28) /* Chrst[31:28] - NAK Count Reload */ -#define QH_CTRL_EP_FLAG (1<<27) /* Chrst[27] - Control Endpoint Flag */ -#define QH_RCLM_LIST_HEAD (1<<15) /* Chrst[15] - Head of Reclamation List Flag */ -#define QH_DTC (1<<14) /* Chrst[14] - Data Toggle Control */ -#define QH_EPS_FULL (0<<12) /* Chrst[13:12] - Endpoint Speed (Full) */ -#define QH_EPS_LOW (1<<12) /* Chrst[13:12] - Endpoint Speed (Low) */ -#define QH_EPS_HIGH (2<<12) /* Chrst[13:12] - Endpoint Speed (High) */ -#define QH_I_NEXT (1<<7) /* Chrst[7] - Inactivate on Next Transaction */ - -/* - * Bit fields of "Endpoint Capabilities" - */ -#define QH_MULT_Pos 30 /* Cap[31:30] - High-Bandwidth Pipe Multiplier */ -#define QH_HUB_PORT_Pos 23 /* Cap[29:23] - Hub Port Number */ -#define QH_HUB_ADDR_Pos 16 /* Cap[22:16] - Hub Addr */ -#define QH_C_MASK_Msk 0xFF00 /* Cap[15:8] - uFrame C-mask */ -#define QH_S_MASK_Msk 0x00FF /* Cap[7:0] - uFrame S-mask */ - - -/*----------------------------------------------------------------------------------------*/ -/* Isochronous (High-Speed) Transfer Descriptor (iTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct itd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Transaction[8]; /* Transaction Status and Control */ - uint32_t Bptr[7]; /* Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint32_t buff_base; /* buffer base address */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint8_t trans_mask; /* mask of activated transactions in iTD */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct itd_t *next; /* used by software to maintain iTD list */ -} iTD_T; - -/* - * Next_Link[2:1] Typ field of "Next Schedule Element Pointer" Typ field - */ -#define ITD_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define ITD_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define ITD_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define ITD_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define ITD_PTR(x) ((iTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Transaction[8] - */ -#define ITD_STATUS(x) (((x)>>28)&0xF) -#define ITD_STATUS_ACTIVE (0x80000000UL) /* Active */ -#define ITD_STATUS_BUFF_ERR (0x40000000UL) /* Data Buffer Error */ -#define ITD_STATUS_BABBLE (0x20000000UL) /* Babble Detected */ -#define ITD_STATUS_XACT_ERR (0x10000000UL) /* Transcation Error */ - -#define ITD_XLEN_Pos 16 -#define ITD_XFER_LEN(x) (((x)>>16)&0xFFF) -#define ITD_IOC (1<<15) -#define ITD_PG_Pos 12 -#define ITD_XFER_OFF_Msk 0xFFF - -/* - * Bptr[7] - */ -#define ITD_BUFF_PAGE_Pos 12 -/* Bptr[0] */ -#define ITD_EP_NUM_Pos 8 -#define ITD_EP_NUM(itd) (((itd)->Bptr[0]>>8)&0xF) -#define ITD_DEV_ADDR_Pos 0 -#define ITD_DEV_ADDR(itd) ((itd)->Bptr[0]&0x7F) -/* Bptr[1] */ -#define ITD_DIR_IN (1<<11) -#define ITD_DIR_OUT (0<<11) -#define ITD_MAX_PKTSZ_Pos 0 -#define ITD_MAX_PKTSZ(itd) ((itd)->Bptr[1]&0x7FF) - -/*----------------------------------------------------------------------------------------*/ -/* Split Isochronous (Full-Speed) Transfer Descriptor (siTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct sitd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Chrst; /* Endpoint and Transaction Translator Characteristics */ - uint32_t Sched; /* Micro-frame Schedule Control */ - uint32_t StsCtrl; /* siTD Transfer Status and Control */ - uint32_t Bptr[2]; /* Buffer Page Pointer List */ - uint32_t BackLink; /* siTD Back Link Pointer */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct sitd_t *next; /* used by software to maintain siTD list */ -} siTD_T; - -#define SITD_LIST_END 0x1 /* Indicate the terminate of siTD list. */ - -#define SITD_XFER_IO_Msk (1UL<<31) -#define SITD_XFER_IN (1UL<<31) -#define SITD_XFER_OUT (0UL<<31) - -#define SITD_PORT_NUM_Pos 24 -#define SITD_HUB_ADDR_Pos 16 -#define SITD_EP_NUM_Pos 8 -#define SITD_DEV_ADDR_Pos 0 - -#define SITD_IOC (1UL<<31) -#define SITD_XFER_CNT_Pos 16 -#define SITD_XFER_CNT_Msk (0x3FF<>28) & 0x0F) -#define TD_CC_SET(td, cc) (td) = ((td) & 0x0FFFFFFF) | (((cc) & 0x0F) << 28) -#define TD_T_DATA0 0x02000000 -#define TD_T_DATA1 0x03000000 -#define TD_R 0x00040000 -#define TD_DP 0x00180000 -#define TD_DP_IN 0x00100000 -#define TD_DP_OUT 0x00080000 -#define MAXPSW 8 -/* steel TD reserved bits to keep driver data */ -#define TD_TYPE_Msk (0x3<<16) -#define TD_TYPE_CTRL (0x0<<16) -#define TD_TYPE_BULK (0x1<<16) -#define TD_TYPE_INT (0x2<<16) -#define TD_TYPE_ISO (0x3<<16) -#define TD_CTRL_Msk (0x7<<15) -#define TD_CTRL_DATA (1<<15) - - -/* - * The HCCA (Host Controller Communications Area) is a 256 byte - * structure defined in the OHCI spec. that the host controller is - * told the base address of. It must be 256-byte aligned. - */ -typedef struct -{ - uint32_t int_table[32]; /* Interrupt ED table */ - uint16_t frame_no; /* current frame number */ - uint16_t pad1; /* set to 0 on each frame_no change */ - uint32_t done_head; /* info returned for an interrupt */ - uint8_t reserved_for_hc[116]; -} HCCA_T; - - -/// @endcond - -#endif /* _USBH_OHCI_H_ */ diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usb.h b/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usb.h deleted file mode 100644 index 4f99d4e6c99..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usb.h +++ /dev/null @@ -1,394 +0,0 @@ -/**************************************************************************//** - * @file usb.h - * @version V1.00 - * @brief USB Host library header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_H_ -#define _USBH_H_ - -#include "config.h" -#include "usbh_lib.h" -#include "ehci.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct hub_dev_t; -struct iface_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------*/ -/* USB device request setup packet */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) -{ - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} -DEV_REQ_T; - -/* - * bmRequestType[7] - Data transfer direction - */ -#define REQ_TYPE_OUT 0x00 -#define REQ_TYPE_IN 0x80 -/* - * bmRequestType[6:5] - Type - */ -#define REQ_TYPE_STD_DEV 0x00 -#define REQ_TYPE_CLASS_DEV 0x20 -#define REQ_TYPE_VENDOR_DEV 0x40 -/* - * bmRequestType[4:0] - Recipient - */ -#define REQ_TYPE_TO_DEV 0x00 -#define REQ_TYPE_TO_IFACE 0x01 -#define REQ_TYPE_TO_EP 0x02 -#define REQ_TYPE_TO_OTHER 0x03 -/* - * Standard Requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_SET_INTERFACE 0x0B -/* - * Descriptor Types - */ -#define USB_DT_STANDARD 0x00 -#define USB_DT_CLASS 0x20 -#define USB_DT_VENDOR 0x40 - -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIGURATION 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 -#define USB_DT_DEVICE_QUALIFIER 0x06 -#define USB_DT_OTHER_SPEED_CONF 0x07 -#define USB_DT_IFACE_POWER 0x08 - - - -/*----------------------------------------------------------------------------------*/ -/* USB standard descriptors */ -/*----------------------------------------------------------------------------------*/ - -/* Descriptor header */ -typedef struct __attribute__((__packed__)) -{ - uint8_t bLength; - uint8_t bDescriptorType; -} -DESC_HDR_T; - -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) /*!< device descriptor structure */ -{ - uint8_t bLength; /*!< Length of device descriptor */ - uint8_t bDescriptorType; /*!< Device descriptor type */ - uint16_t bcdUSB; /*!< USB version number */ - uint8_t bDeviceClass; /*!< Device class code */ - uint8_t bDeviceSubClass; /*!< Device subclass code */ - uint8_t bDeviceProtocol; /*!< Device protocol code */ - uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - uint16_t idVendor; /*!< Vendor ID */ - uint16_t idProduct; /*!< Product ID */ - uint16_t bcdDevice; /*!< Device ID */ - uint8_t iManufacturer; /*!< Manufacture description string ID */ - uint8_t iProduct; /*!< Product description string ID */ - uint8_t iSerialNumber; /*!< Serial number description string ID */ - uint8_t bNumConfigurations; /*!< Total number of configurations */ -} -DESC_DEV_T; /*!< device descriptor structure */ - -/* - * Configuration Descriptor - */ -typedef struct __attribute__((__packed__)) usb_config_descriptor /*!< Configuration descriptor structure */ -{ - uint8_t bLength; /*!< Length of configuration descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint16_t wTotalLength; /*!< Total length of this configuration */ - uint8_t bNumInterfaces; /*!< Total number of interfaces */ - uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - uint8_t iConfiguration; /*!< String descriptor ID */ - uint8_t bmAttributes; /*!< Configuration characteristics */ - uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ - -/* - * Interface Descriptor - */ -typedef struct __attribute__((__packed__))usb_interface_descriptor /*!< Interface descriptor structure */ -{ - uint8_t bLength; /*!< Length of interface descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bInterfaceNumber; /*!< Interface number */ - uint8_t bAlternateSetting; /*!< Alternate setting number */ - uint8_t bNumEndpoints; /*!< Number of endpoints */ - uint8_t bInterfaceClass; /*!< Interface class code */ - uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ - -/* - * Endpoint Descriptor - */ -typedef struct __attribute__((__packed__)) usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - uint8_t bLength; /*!< Length of endpoint descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bEndpointAddress; /*!< Endpoint address */ - uint8_t bmAttributes; /*!< Endpoint attribute */ - uint16_t wMaxPacketSize; /*!< Maximum packet size */ - uint8_t bInterval; /*!< Synchronous transfer interval */ - uint8_t bRefresh; /*!< Refresh */ - uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ - -/* - * Endpoint descriptor bEndpointAddress[7] - direction - */ -#define EP_ADDR_DIR_MASK 0x80 -#define EP_ADDR_DIR_IN 0x80 -#define EP_ADDR_DIR_OUT 0x00 - -/* - * Endpoint descriptor bmAttributes[1:0] - transfer type - */ -#define EP_ATTR_TT_MASK 0x03 -#define EP_ATTR_TT_CTRL 0x00 -#define EP_ATTR_TT_ISO 0x01 -#define EP_ATTR_TT_BULK 0x02 -#define EP_ATTR_TT_INT 0x03 - - -/*----------------------------------------------------------------------------------*/ -/* USB Host controller driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*init)(void); - void (*shutdown)(void); - void (*suspend)(void); - void (*resume)(void); - int (*ctrl_xfer)(struct utr_t *utr); - int (*bulk_xfer)(struct utr_t *utr); - int (*int_xfer)(struct utr_t *utr); - int (*iso_xfer)(struct utr_t *utr); - int (*quit_xfer)(struct utr_t *utr, struct ep_info_t *ep); - - /* root hub support */ - int (*rthub_port_reset)(int port); - int (*rthub_polling)(void); -} HC_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*probe)(struct iface_t *iface); - void (*disconnect)(struct iface_t *iface); - void (*suspend)(struct iface_t *iface); - void (*resume)(struct iface_t *iface); -} UDEV_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device */ -/*----------------------------------------------------------------------------------*/ - -typedef enum -{ - SPEED_LOW, - SPEED_FULL, - SPEED_HIGH -} SPEED_E; - -typedef struct ep_info_t -{ - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint8_t bInterval; - uint8_t bToggle; - uint16_t wMaxPacketSize; - void *hw_pipe; /*!< point to the HC assocaied endpoint \hideinitializer */ -} EP_INFO_T; - -typedef struct udev_t -{ - DESC_DEV_T descriptor; /*!< Device descriptor. \hideinitializer */ - struct hub_dev_t *parent; /*!< parent hub device \hideinitializer */ - uint8_t port_num; /*!< The hub port this device connected on \hideinitializer */ - uint8_t dev_num; /*!< device number \hideinitializer */ - int8_t cur_conf; /*!< Currentll selected configuration \hideinitializer */ - SPEED_E speed; /*!< device speed (low/full/high) \hideinitializer */ - /* - * The followings are lightweight USB stack internal used . - */ - uint8_t *cfd_buff; /*!< Configuration descriptor buffer. \hideinitializer */ - EP_INFO_T ep0; /*!< Endpoint 0 \hideinitializer */ - HC_DRV_T *hc_driver; /*!< host controller driver \hideinitializer */ - struct iface_t *iface_list; /*!< Working interface list \hideinitializer */ - struct udev_t *next; /*!< link for global usb device list \hideinitializer */ -} UDEV_T; - -typedef struct alt_iface_t -{ - DESC_IF_T *ifd; /*!< point to the location of this alternative interface descriptor in UDEV_T->cfd_buff */ - EP_INFO_T ep[MAX_EP_PER_IFACE]; /*!< endpoints of this alternative interface */ -} ALT_IFACE_T; - -typedef struct iface_t -{ - UDEV_T *udev; /*!< USB device \hideinitializer */ - uint8_t if_num; /*!< Interface number \hideinitializer */ - uint8_t num_alt; /*!< Number of alternative interface \hideinitializer */ - ALT_IFACE_T *aif; /*!< Point to the active alternative interface */ - ALT_IFACE_T alt[MAX_ALT_PER_IFACE]; /*!< List of alternative interface \hideinitializer */ - UDEV_DRV_T *driver; /*!< Interface associated driver \hideinitializer */ - void *context; /*!< Reference to device context \hideinitializer */ - struct iface_t *next; /*!< Point to next interface of the same device. Started from UDEV_T->iface_list \hideinitializer */ -} IFACE_T; - - -/*----------------------------------------------------------------------------------*/ -/* URB (USB Request Block) */ -/*----------------------------------------------------------------------------------*/ - -#define IF_PER_UTR 8 /* number of frames per UTR isochronous transfer (DO NOT modify it!) */ - -typedef void (*FUNC_UTR_T)(struct utr_t *); - -typedef struct utr_t -{ - UDEV_T *udev; /*!< point to associated USB device \hideinitializer */ - DEV_REQ_T setup; /*!< buffer for setup packet \hideinitializer */ - EP_INFO_T *ep; /*!< associated endpoint \hideinitializer */ - uint8_t *buff; /*!< transfer buffer \hideinitializer */ - uint8_t bIsTransferDone; /*!< tansfer done? \hideinitializer */ - uint32_t data_len; /*!< length of data to be transferred \hideinitializer */ - uint32_t xfer_len; /*!< length of transferred data \hideinitializer */ - uint8_t bIsoNewSched; /*!< New schedule isochronous transfer \hideinitializer */ - uint16_t iso_sf; /*!< Isochronous start frame number \hideinitializer */ - uint16_t iso_xlen[IF_PER_UTR]; /*!< transfer length of isochronous frames \hideinitializer */ - uint8_t *iso_buff[IF_PER_UTR]; /*!< transfer buffer address of isochronous frames \hideinitializer */ - int iso_status[IF_PER_UTR]; /*!< transfer status of isochronous frames \hideinitializer */ - int td_cnt; /*!< number of transfer descriptors \hideinitializer */ - int status; /*!< return status \hideinitializer */ - int interval; /*!< interrupt/isochronous interval \hideinitializer */ - void *context; /*!< point to deivce proprietary data area \hideinitializer */ - FUNC_UTR_T func; /*!< tansfer done call-back function \hideinitializer */ - struct utr_t *next; /* point to the next UTR of the same endpoint. \hideinitializer */ -} UTR_T; - - -/*----------------------------------------------------------------------------------*/ -/* Global variables */ -/*----------------------------------------------------------------------------------*/ -extern USBH_T *_ohci; -extern HSUSBH_T *_ehci; - -extern HC_DRV_T ohci_driver; -extern HC_DRV_T ehci_driver; - -extern UDEV_T *g_udev_list; - -extern volatile int _IsInUsbInterrupt; - -/*----------------------------------------------------------------------------------*/ -/* USB stack exported functions */ -/*----------------------------------------------------------------------------------*/ -extern void usbh_delay_ms(int msec); - -extern void dump_ohci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ohci_int_table(void); -extern void dump_ehci_regs(void); -extern void dump_ehci_qtd(qTD_T *qtd); -extern void dump_ehci_asynclist(void); -extern void dump_ehci_period_frame_list_simple(void); -extern void usbh_dump_buff_bytes(uint8_t *buff, int nSize); -extern void usbh_dump_interface_descriptor(DESC_IF_T *if_desc); -extern void usbh_dump_endpoint_descriptor(DESC_EP_T *ep_desc); -extern void usbh_dump_iface(IFACE_T *iface); -extern void usbh_dump_ep_info(EP_INFO_T *ep); - -/* - * Memory management functions - */ -extern void USB_InitializeMemoryPool(void); -extern void *USB_malloc(int wanted_size, int boundary); -extern void USB_free(void *); -extern int USB_available_memory(void); -extern int USB_allocated_memory(void); -extern void usbh_memory_init(void); -extern uint32_t usbh_memory_used(void); -extern void *usbh_alloc_mem(int size); -extern void usbh_free_mem(void *p, int size); -extern int alloc_dev_address(void); -extern void free_dev_address(int dev_addr); -extern UDEV_T *alloc_device(void); -extern void free_device(UDEV_T *udev); -extern UTR_T *alloc_utr(UDEV_T *udev); -extern void free_utr(UTR_T *utr); -extern ED_T *alloc_ohci_ED(void); -extern void free_ohci_ED(ED_T *ed); -extern TD_T *alloc_ohci_TD(UTR_T *utr); -extern void free_ohci_TD(TD_T *td); -extern QH_T *alloc_ehci_QH(void); -extern void free_ehci_QH(QH_T *qh); -extern qTD_T *alloc_ehci_qTD(UTR_T *utr); -extern void free_ehci_qTD(qTD_T *qtd); -extern iTD_T *alloc_ehci_iTD(void); -extern void free_ehci_iTD(iTD_T *itd); -extern siTD_T *alloc_ehci_siTD(void); -extern void free_ehci_siTD(siTD_T *sitd); - - -extern void usbh_hub_init(void); -extern int usbh_connect_device(UDEV_T *); -extern void usbh_disconnect_device(UDEV_T *); -extern int usbh_register_driver(UDEV_DRV_T *driver); -extern EP_INFO_T *usbh_iface_find_ep(IFACE_T *iface, uint8_t ep_addr, uint8_t dir_type); -extern int usbh_reset_device(UDEV_T *); -extern int usbh_reset_port(UDEV_T *); - -/* - * USB Standard Request functions - */ -extern int usbh_get_device_descriptor(UDEV_T *udev, DESC_DEV_T *desc_buff); -extern int usbh_get_config_descriptor(UDEV_T *udev, uint8_t *desc_buff, int buff_len); -extern int usbh_set_configuration(UDEV_T *udev, uint8_t conf_val); -extern int usbh_set_interface(IFACE_T *iface, uint16_t alt_setting); -extern int usbh_clear_halt(UDEV_T *udev, uint16_t ep_addr); - -extern int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout); -extern int usbh_bulk_xfer(UTR_T *utr); -extern int usbh_int_xfer(UTR_T *utr); -extern int usbh_iso_xfer(UTR_T *utr); -extern int usbh_quit_utr(UTR_T *utr); -extern int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep); - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_H_ */ diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usbh_lib.h b/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usbh_lib.h deleted file mode 100644 index 29b4868f9d8..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/inc/usbh_lib.h +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************//** - * @file usbh_lib.h - * @version V1.10 - * $Revision: 4 $ - * $Date: 15/06/10 2:06p $ - * @brief USB Host library exported header file. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef _USBH_LIB_H_ -#define _USBH_LIB_H_ - -#include "N9H30.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Library Library - @{ -*/ - -/** @addtogroup USBH_Library USB Host Library - @{ -*/ - -/** @addtogroup USBH_EXPORTED_CONSTANTS USB Host Exported Constants - @{ -*/ - -#define USBH_OK 0 /*!< No error. */ -#define USBH_ERR_MEMORY_OUT -10 /*!< Out of memory. */ -#define USBH_ERR_IF_ALT_LIMIT -11 /*!< Number of alternative interface > MAX_ALT_PER_IFACE */ -#define USBH_ERR_IF_EP_LIMIT -15 /*!< Number of endpoints > MAX_EP_PER_IFACE */ -#define USBH_ERR_NOT_SUPPORTED -101 /*!< Device/Class/Transfer not supported */ -#define USBH_ERR_NOT_MATCHED -103 /*!< Not macthed */ -#define USBH_ERR_NOT_EXPECTED -104 /*!< Unknown or unexpected */ -#define USBH_ERR_INVALID_PARAM -105 /*!< Invalid parameter */ -#define USBH_ERR_NOT_FOUND -106 /*!< Device or interface not found */ -#define USBH_ERR_EP_NOT_FOUND -107 /*!< Endpoint not found */ -#define USBH_ERR_DESCRIPTOR -137 /*!< Failed to parse USB descriptors */ -#define USBH_ERR_SET_DEV_ADDR -139 /*!< Failed to set device address */ -#define USBH_ERR_SET_CONFIG -151 /*!< Failed to set device configuration */ - -#define USBH_ERR_TRANSFER -201 /*!< USB transfer error */ -#define USBH_ERR_TIMEOUT -203 /*!< USB transfer time-out */ -#define USBH_ERR_ABORT -205 /*!< USB transfer aborted due to disconnect or reset */ -#define USBH_ERR_PORT_RESET -255 /*!< Hub port reset failed */ -#define USBH_ERR_SCH_OVERRUN -257 /*!< USB isochronous schedule overrun */ -#define USBH_ERR_DISCONNECTED -259 /*!< USB device was disconnected */ - -#define USBH_ERR_TRANSACTION -271 /*!< USB transaction timeout, CRC, Bad PID, etc. */ -#define USBH_ERR_BABBLE_DETECTED -272 /*!< A 'babble' is detected during the transaction */ -#define USBH_ERR_DATA_BUFF -274 /*!< Data buffer overrun or underrun */ - -#define USBH_ERR_CC_NO_ERR -280 /*!< OHCI CC code - no error */ -#define USBH_ERR_CRC -281 /*!< USB trasfer CRC error */ -#define USBH_ERR_BIT_STUFF -282 /*!< USB transfer bit stuffing error */ -#define USBH_ERR_DATA_TOGGLE -283 /*!< USB trasfer data toggle error */ -#define USBH_ERR_STALL -284 /*!< USB trasfer STALL error */ -#define USBH_ERR_DEV_NO_RESP -285 /*!< USB trasfer device no response error */ -#define USBH_ERR_PID_CHECK -286 /*!< USB trasfer PID check failure */ -#define USBH_ERR_UNEXPECT_PID -287 /*!< USB trasfer unexpected PID error */ -#define USBH_ERR_DATA_OVERRUN -288 /*!< USB trasfer data overrun error */ -#define USBH_ERR_DATA_UNDERRUN -289 /*!< USB trasfer data underrun error */ -#define USBH_ERR_BUFF_OVERRUN -292 /*!< USB trasfer buffer overrun error */ -#define USBH_ERR_BUFF_UNDERRUN -293 /*!< USB trasfer buffer underrun error */ -#define USBH_ERR_NOT_ACCESS0 -294 /*!< USB trasfer not accessed error */ -#define USBH_ERR_NOT_ACCESS1 -295 /*!< USB trasfer not accessed error */ - -#define USBH_ERR_OHCI_INIT -301 /*!< Failed to initialize OHIC controller. */ -#define USBH_ERR_OHCI_EP_BUSY -303 /*!< The endpoint is under transfer. */ - -#define USBH_ERR_EHCI_INIT -501 /*!< Failed to initialize EHCI controller. */ -#define USBH_ERR_EHCI_QH_BUSY -503 /*!< the Queue Head is busy. */ - -#define UMAS_OK 0 /*!< No error. */ -#define UMAS_ERR_NO_DEVICE -1031 /*!< No Mass Stroage Device found. */ -#define UMAS_ERR_IO -1033 /*!< Device read/write failed. */ -#define UMAS_ERR_INIT_DEVICE -1035 /*!< failed to init MSC device */ -#define UMAS_ERR_CMD_STATUS -1037 /*!< SCSI command status failed */ -#define UMAS_ERR_IVALID_PARM -1038 /*!< Invalid parameter. */ -#define UMAS_ERR_DRIVE_NOT_FOUND -1039 /*!< drive not found */ - -#define HID_RET_OK 0 /*!< Return with no errors. */ -#define HID_RET_DEV_NOT_FOUND -1081 /*!< HID device not found or removed. */ -#define HID_RET_IO_ERR -1082 /*!< USB transfer failed. */ -#define HID_RET_INVALID_PARAMETER -1083 /*!< Invalid parameter. */ -#define HID_RET_OUT_OF_MEMORY -1084 /*!< Out of memory. */ -#define HID_RET_NOT_SUPPORTED -1085 /*!< Function not supported. */ -#define HID_RET_EP_NOT_FOUND -1086 /*!< Endpoint not found. */ -#define HID_RET_PARSING -1087 /*!< Failed to parse HID descriptor */ -#define HID_RET_XFER_IS_RUNNING -1089 /*!< The transfer has been enabled. */ -#define HID_RET_REPORT_NOT_FOUND -1090 /*!< The transfer has been enabled. */ - -#define UAC_RET_OK 0 /*!< Return with no errors. */ -#define UAC_RET_DEV_NOT_FOUND -2001 /*!< Audio Class device not found or removed. */ -#define UAC_RET_FUNC_NOT_FOUND -2002 /*!< Audio device has no this function. */ -#define UAC_RET_IO_ERR -2003 /*!< USB transfer failed. */ -#define UAC_RET_DATA_LEN -2004 /*!< Unexpected transfer length */ -#define UAC_RET_INVALID -2005 /*!< Invalid parameter or usage. */ -#define UAC_RET_OUT_OF_MEMORY -2007 /*!< Out of memory. */ -#define UAC_RET_DRV_NOT_SUPPORTED -2009 /*!< Function not supported by this UAC driver. */ -#define UAC_RET_DEV_NOT_SUPPORTED -2011 /*!< Function not supported by the UAC device. */ -#define UAC_RET_PARSER -2013 /*!< Failed to parse UAC descriptor */ -#define UAC_RET_IS_STREAMING -2015 /*!< Audio pipe is on streaming. */ - - -/*@}*/ /* end of group USBH_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBH_EXPORTED_TYPEDEF USB Host Typedef - @{ -*/ -struct udev_t; -typedef void (CONN_FUNC)(struct udev_t *udev, int param); - -struct line_coding_t; -struct cdc_dev_t; -typedef void (CDC_CB_FUNC)(struct cdc_dev_t *cdev, uint8_t *rdata, int data_len); - -struct usbhid_dev; -typedef void (HID_IR_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *rdata, uint32_t data_len); /*!< interrupt in callback function \hideinitializer */ -typedef void (HID_IW_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *wbuff, uint32_t *data_len); /*!< interrupt out callback function \hideinitializer */ - -struct uac_dev_t; -typedef int (UAC_CB_FUNC)(struct uac_dev_t *dev, uint8_t *data, int len); /*!< audio in callback function \hideinitializer */ - -/*@}*/ /* end of group USBH_EXPORTED_STRUCT */ - - - -/** @addtogroup USBH_EXPORTED_FUNCTIONS USB Host Exported Functions - @{ -*/ - -/*------------------------------------------------------------------*/ -/* */ -/* USB Core Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_core_init(void); -extern int usbh_polling_root_hubs(void); -extern void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func); -extern void usbh_suspend(void); -extern void usbh_resume(void); -extern struct udev_t *usbh_find_device(char *hub_id, int port); - -/** - * @brief A function return current tick count. - * @return Current tick. - * @details User application must provide this function to return current tick. - * The tick should increase by 1 for every 10 ms. - */ -extern uint32_t usbh_get_ticks(void); /* This function must be provided by user application. */ -extern uint32_t usbh_tick_from_millisecond(uint32_t msec); /* This function must be provided by user application. */ - - -/// @cond HIDDEN_SYMBOLS - -extern void dump_ohci_regs(void); -extern void dump_ehci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ehci_ports(void); -extern uint32_t usbh_memory_used(void); - -/// @endcond HIDDEN_SYMBOLS - - -/*@}*/ /* end of group USBH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBH_Library */ - -/*@}*/ /* end of group LIBRARY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _USBH_LIB_H_ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci.c b/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci.c deleted file mode 100644 index dc20734d0e6..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci.c +++ /dev/null @@ -1,1289 +0,0 @@ -/**************************************************************************//** - * @file ehci.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB Host library EHCI (USB 2.0) host controller driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -static QH_T *_H_qh; /* head of reclamation list */ -static qTD_T *_ghost_qtd; /* used as a terminator qTD */ -static QH_T *qh_remove_list; - -extern ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ -extern int ehci_iso_xfer(UTR_T *utr); /* EHCI isochronous transfer function */ -extern int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep); - -uint32_t _PFList_mem[FL_SIZE] __attribute__((aligned(4096)));/* Periodic frame list (Keil) */ - -uint32_t *_PFList; - - -QH_T *_Iqh[NUM_IQH]; - - -#ifdef ENABLE_ERROR_MSG -void dump_ehci_regs() -{ - USB_debug("Dump HSUSBH(EHCI) registers:\n"); - USB_debug(" UCMDR = 0x%x\n", _ehci->UCMDR); - USB_debug(" USTSR = 0x%x\n", _ehci->USTSR); - USB_debug(" UIENR = 0x%x\n", _ehci->UIENR); - USB_debug(" UFINDR = 0x%x\n", _ehci->UFINDR); - USB_debug(" UPFLBAR = 0x%x\n", _ehci->UPFLBAR); - USB_debug(" UCALAR = 0x%x\n", _ehci->UCALAR); - USB_debug(" UASSTR = 0x%x\n", _ehci->UASSTR); - USB_debug(" UCFGR = 0x%x\n", _ehci->UCFGR); - USB_debug(" UPSCR = 0x%x\n", _ehci->UPSCR[0]); - USB_debug(" PHYCTL0 = 0x%x\n", _ehci->USBPCR0); - USB_debug(" PHYCTL1 = 0x%x\n", _ehci->USBPCR1); -} - -void dump_ehci_ports() -{ - USB_debug("_ehci port0=0x%x, port1=0x%x\n", _ehci->UPSCR[0], _ehci->UPSCR[1]); -} - -void dump_ehci_qtd(qTD_T *qtd) -{ - USB_debug(" [qTD] - 0x%08x\n", (int)qtd); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qtd->Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qtd->Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token) PID: %s, Bytes: %d, IOC: %d\n", qtd->Token, (((qtd->Token >> 8) & 0x3) == 0) ? "OUT" : ((((qtd->Token >> 8) & 0x3) == 1) ? "IN" : "SETUP"), (qtd->Token >> 16) & 0x7FFF, (qtd->Token >> 15) & 0x1); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qtd->Bptr[0]); - //USB_debug(" 0x%08x (Buffer Pointer (page 1))\n", qtd->Bptr[1]); - //USB_debug(" 0x%08x (Buffer Pointer (page 2))\n", qtd->Bptr[2]); - //USB_debug(" 0x%08x (Buffer Pointer (page 3))\n", qtd->Bptr[3]); - //USB_debug(" 0x%08x (Buffer Pointer (page 4))\n", qtd->Bptr[4]); - USB_debug("\n"); -} - -void dump_ehci_asynclist(void) -{ - QH_T *qh = _H_qh; - qTD_T *qtd; - - USB_debug(">>> Dump EHCI Asynchronous List <<<\n"); - do - { - USB_debug("[QH] - 0x%08x\n", (int)qh); - USB_debug(" 0x%08x (Queue Head Horizontal Link Pointer, Queue Head DWord 0)\n", qh->HLink); - USB_debug(" 0x%08x (Endpoint Characteristics) DevAddr: %d, EP: 0x%x, PktSz: %d, Speed: %s\n", qh->Chrst, qh->Chrst & 0x7F, (qh->Chrst >> 8) & 0xF, (qh->Chrst >> 16) & 0x7FF, ((qh->Chrst >> 12) & 0x3 == 0) ? "Full" : (((qh->Chrst >> 12) & 0x3 == 1) ? "Low" : "High")); - USB_debug(" 0x%08x (Endpoint Capabilities: Queue Head DWord 2)\n", qh->Cap); - USB_debug(" 0x%08x (Current qtd Pointer)\n", qh->Curr_qTD); - USB_debug(" --- Overlay Area ---\n"); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qh->OL_Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qh->OL_Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token)\n", qh->OL_Token); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qh->OL_Bptr[0]); - USB_debug("\n"); - - qtd = QTD_PTR(qh->Curr_qTD); - while (qtd != NULL) - { - dump_ehci_qtd(qtd); - qtd = QTD_PTR(qtd->Next_qTD); - } - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); -} - -void dump_ehci_asynclist_simple(void) -{ - QH_T *qh = _H_qh; - - USB_debug(">>> EHCI Asynchronous List <<<\n"); - USB_debug("[QH] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list_simple(void) -{ - QH_T *qh = _Iqh[NUM_IQH - 1]; - - USB_debug(">>> EHCI period frame list simple <<<\n"); - USB_debug("[FList] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != NULL); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list() -{ - int i; - QH_T *qh; - - for (i = 0; i < FL_SIZE; i++) - { - USB_debug("!%02d: ", i); - qh = QH_PTR(_PFList[i]);; - while (qh != NULL) - { - // USB_debug("0x%x (0x%x) => ", (int)qh, qh->HLink); - USB_debug("0x%x => ", (int)qh); - qh = QH_PTR(qh->HLink); - } - USB_debug("0\n"); - } -} - -#endif /* ENABLE_ERROR_MSG */ - -static void init_periodic_frame_list() -{ - QH_T *qh_p; - int i, idx, interval; - - _PFList = (uint32_t *)((uint32_t)_PFList_mem | NON_CACHE_MASK); - memset(_PFList, 0, sizeof(_PFList_mem)); - - iso_ep_list = NULL; - - for (i = NUM_IQH - 1; i >= 0; i--) /* interval = i^2 */ - { - _Iqh[i] = alloc_ehci_QH(); - - _Iqh[i]->HLink = QH_HLNK_END; - _Iqh[i]->Curr_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Next_qTD = QTD_LIST_END; - _Iqh[i]->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Token = QTD_STS_HALT; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < FL_SIZE; idx += interval) - { - if (_PFList[idx] == 0) /* is empty list, insert directly */ - { - _PFList[idx] = QH_HLNK_QH(_Iqh[i]); - } - else - { - qh_p = QH_PTR(_PFList[idx]); - - while (1) - { - if (qh_p == _Iqh[i]) - break; /* already chained by previous visit */ - - if (qh_p->HLink == QH_HLNK_END) /* reach end of list? */ - { - qh_p->HLink = QH_HLNK_QH(_Iqh[i]); - break; - } - qh_p = QH_PTR(qh_p->HLink); - } - } - } - } -} - -static QH_T *get_int_tree_head_node(int interval) -{ - int i; - - interval /= 8; /* each frame list entry for 8 micro-frame */ - - for (i = 0; i < NUM_IQH - 1; i++) - { - interval >>= 1; - if (interval == 0) - return _Iqh[i]; - } - return _Iqh[NUM_IQH - 1]; -} - -static int make_int_s_mask(int bInterval) -{ - int order, interval; - - interval = 1; - while (bInterval > 1) - { - interval *= 2; - bInterval--; - } - - if (interval < 2) - return 0xFF; /* interval 1 */ - if (interval < 4) - return 0x55; /* interval 2 */ - if (interval < 8) - return 0x22; /* interval 4 */ - for (order = 0; (interval > 1); order++) - { - interval >>= 1; - } - return (0x1 << (order % 8)); -} - -static int ehci_init(void) -{ - int timeout = 250 * 1000; /* EHCI reset time-out 250 ms */ - - /*------------------------------------------------------------------------------------*/ - /* Reset EHCI host controller */ - /*------------------------------------------------------------------------------------*/ - _ehci->UCMDR = HSUSBH_UCMDR_HCRST_Msk; - while ((_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) && (timeout > 0)) - { - usbh_delay_ms(1); - timeout -= 1000; - } - if (_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) - return USBH_ERR_EHCI_INIT; - - _ehci->UCMDR = UCMDR_INT_THR_CTRL | HSUSBH_UCMDR_RUN_Msk; - - _ghost_qtd = alloc_ehci_qTD(NULL); - _ghost_qtd->Token = 0x11197B7F; //QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It represents a qhost qTD. - - /*------------------------------------------------------------------------------------*/ - /* Initialize asynchronous list */ - /*------------------------------------------------------------------------------------*/ - qh_remove_list = NULL; - - /* Create the QH list head with H-bit 1 */ - _H_qh = alloc_ehci_QH(); - _H_qh->HLink = QH_HLNK_QH(_H_qh); /* circular link to itself, the only one QH */ - _H_qh->Chrst = QH_RCLM_LIST_HEAD; /* it's the head of reclamation list */ - _H_qh->Curr_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Next_qTD = QTD_LIST_END; - _H_qh->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Token = QTD_STS_HALT; - _ehci->UCALAR = (uint32_t)_H_qh; - - /*------------------------------------------------------------------------------------*/ - /* Initialize periodic list */ - /*------------------------------------------------------------------------------------*/ - if (FL_SIZE == 256) - _ehci->UCMDR |= (0x2 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 512) - _ehci->UCMDR |= (0x1 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 1024) - _ehci->UCMDR |= (0x0 << HSUSBH_UCMDR_FLSZ_Pos); - else - return USBH_ERR_EHCI_INIT; /* Invalid FL_SIZE setting! */ - - /*------------------------------------------------------------------------------------*/ - /* start run */ - /*------------------------------------------------------------------------------------*/ - - _ehci->UCFGR = 0x1; /* enable port routing to EHCI */ - _ehci->UIENR = HSUSBH_UIENR_USBIEN_Msk | HSUSBH_UIENR_UERRIEN_Msk | HSUSBH_UIENR_HSERREN_Msk | HSUSBH_UIENR_IAAEN_Msk; - - _ehci->UASSTR = 0xfff; - - usbh_delay_ms(1); /* delay 1 ms */ - - _ehci->UPSCR[0] = HSUSBH_UPSCR_PP_Msk; /* enable port 1 port power */ - _ehci->UPSCR[1] = HSUSBH_UPSCR_PP_Msk; /* enable port 2 port power */ - - init_periodic_frame_list(); - - _ehci->UPFLBAR = (uint32_t)_PFList; - usbh_delay_ms(10); /* delay 10 ms */ - - return 0; -} - -static void ehci_suspend(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] |= HSUSBH_UPSCR_SUSPEND_Msk; -} - -static void ehci_resume(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] = (HSUSBH->UPSCR[0] & ~HSUSBH_UPSCR_SUSPEND_Msk) | HSUSBH_UPSCR_FPR_Msk; -} - -static void ehci_shutdown(void) -{ - ehci_suspend(); -} - -static void move_qh_to_remove_list(QH_T *qh) -{ - QH_T *q; - - // USB_debug("move_qh_to_remove_list - 0x%x (0x%x)\n", (int)qh, qh->Chrst); - - /* check if this ED found in ed_remove_list */ - q = qh_remove_list; - while (q) - { - if (q == qh) /* This QH found in qh_remove_list. */ - { - return; /* Do nothing, return... */ - } - q = q->next; - } - - DISABLE_EHCI_IRQ(); - - /*------------------------------------------------------------------------------------*/ - /* Search asynchronous frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _H_qh; /* find and remove it from asynchronous list */ - while (QH_PTR(q->HLink) != _H_qh) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - - /*------------------------------------------------------------------------------------*/ - /* Search periodic frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _Iqh[NUM_IQH - 1]; - while (q->HLink != QH_HLNK_END) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - ENABLE_EHCI_IRQ(); -} - -static void append_to_qtd_list_of_QH(QH_T *qh, qTD_T *qtd) -{ - qTD_T *q; - - if (qh->qtd_list == NULL) - { - qh->qtd_list = qtd; - } - else - { - q = qh->qtd_list; - while (q->next != NULL) - { - q = q->next; - } - q->next = qtd; - } -} - -/* - * If ep==NULL, it's a control endpoint QH. - */ -static void write_qh(UDEV_T *udev, EP_INFO_T *ep, QH_T *qh) -{ - uint32_t chrst, cap; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 1 - Endpoint Characteristics */ - /*------------------------------------------------------------------------------------*/ - if (ep == NULL) /* is control endpoint? */ - { - if (udev->descriptor.bMaxPacketSize0 == 0) - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - chrst = QH_DTC | QH_NAK_RL | (udev->descriptor.bMaxPacketSize0 << 16); - if (udev->speed != SPEED_HIGH) - chrst |= QH_CTRL_EP_FLAG; /* non-high-speed control endpoint */ - } - else /* not a control endpoint */ - { - chrst = QH_NAK_RL | (ep->wMaxPacketSize << 16); - chrst |= ((ep->bEndpointAddress & 0xf) << 8); /* Endpoint Address */ - } - - if (udev->speed == SPEED_LOW) - chrst |= QH_EPS_LOW; - else if (udev->speed == SPEED_FULL) - chrst |= QH_EPS_FULL; - else - chrst |= QH_EPS_HIGH; - - chrst |= udev->dev_num; - - qh->Chrst = chrst; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 2 - Endpoint Capabilities */ - /*------------------------------------------------------------------------------------*/ - if (udev->speed == SPEED_HIGH) - { - cap = 0; - } - else - { - /* - * Backtrace device tree until the USB 2.0 hub found - */ - HUB_DEV_T *hub; - int port_num; - - port_num = udev->port_num; - hub = udev->parent; - - while ((hub != NULL) && (hub->iface->udev->speed != SPEED_HIGH)) - { - port_num = hub->iface->udev->port_num; - hub = hub->iface->udev->parent; - } - - cap = (port_num << QH_HUB_PORT_Pos) | - (hub->iface->udev->dev_num << QH_HUB_ADDR_Pos); - } - - qh->Cap = cap; -} - -static void write_qtd_bptr(qTD_T *qtd, uint32_t buff_addr, int xfer_len) -{ - int i; - - qtd->xfer_len = xfer_len; - qtd->Bptr[0] = buff_addr; - - buff_addr = (buff_addr + 0x1000) & ~0xFFF; - - for (i = 1; i < 5; i++) - { - qtd->Bptr[i] = buff_addr; - buff_addr += 0x1000; - } -} - -static int ehci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - QH_T *qh; - qTD_T *qtd_setup, *qtd_data, *qtd_status; - uint32_t token; - int is_new_qh = 0; - - udev = utr->udev; - - if (utr->data_len > 0) - { - if (((uint32_t)utr->buff + utr->data_len) > (((uint32_t)utr->buff & ~0xFFF) + 0x5000)) - return USBH_ERR_BUFF_OVERRUN; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate and link QH */ - /*------------------------------------------------------------------------------------*/ - if (udev->ep0.hw_pipe != NULL) - { - qh = (QH_T *)udev->ep0.hw_pipe; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - - udev->ep0.hw_pipe = (void *)qh; /* driver can find QH from EP */ - is_new_qh = 1; - } - write_qh(udev, NULL, qh); - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - - /*------------------------------------------------------------------------------------*/ - /* Allocate qTDs */ - /*------------------------------------------------------------------------------------*/ - qtd_setup = alloc_ehci_qTD(utr); /* allocate qTD for SETUP */ - - if (utr->data_len > 0) - qtd_data = alloc_ehci_qTD(utr); /* allocate qTD for DATA */ - else - qtd_data = NULL; - - qtd_status = alloc_ehci_qTD(utr); /* allocate qTD for USTSR */ - - if (qtd_status == NULL) /* out of memory? */ - { - if (qtd_setup) - free_ehci_qTD(qtd_setup); /* free memory */ - if (qtd_data) - free_ehci_qTD(qtd_data); /* free memory */ - return USBH_ERR_MEMORY_OUT; /* out of memory */ - } - - //USB_debug("qh=0x%x, qtd_setup=0x%x, qtd_data=0x%x, qtd_status=0x%x\n", (int)qh, (int)qtd_setup, (int)qtd_data, (int)qtd_status); - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_setup->qh = qh; - //qtd_setup->utr = utr; - write_qtd_bptr(qtd_setup, (uint32_t)&utr->setup, 8); - append_to_qtd_list_of_QH(qh, qtd_setup); - qtd_setup->Token = (8 << 16) | QTD_ERR_COUNTER | QTD_PID_SETUP | QTD_STS_ACTIVE; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage qTD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - qtd_setup->Next_qTD = (uint32_t)qtd_data; - qtd_data->Next_qTD = (uint32_t)qtd_status; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd_data->qh = qh; - //qtd_data->utr = utr; - write_qtd_bptr(qtd_data, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd_data); - qtd_data->Token = QTD_DT | (utr->data_len << 16) | token; - } - else - { - qtd_setup->Next_qTD = (uint32_t)qtd_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare USTSR stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_status->Next_qTD = (uint32_t)_ghost_qtd; - qtd_status->Alt_Next_qTD = QTD_LIST_END; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - - qtd_status->qh = qh; - //qtd_status->utr = utr; - append_to_qtd_list_of_QH(qh, qtd_status); - qtd_status->Token = QTD_DT | QTD_IOC | token; - - /*------------------------------------------------------------------------------------*/ - /* Update QH overlay */ - /*------------------------------------------------------------------------------------*/ - qh->Curr_qTD = 0; - qh->OL_Next_qTD = (uint32_t)qtd_setup; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = 0; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - return 0; -} - -static int ehci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh; - qTD_T *qtd, *qtd_pre; - uint32_t data_len, xfer_len; - uint8_t *buff; - uint32_t token; - int is_new_qh = 0; - - //USB_debug("Bulk XFER =>\n"); - // dump_ehci_asynclist_simple(); - - udev = utr->udev; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - { - return USBH_ERR_EHCI_QH_BUSY; - } - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTDs */ - /*------------------------------------------------------------------------------------*/ - data_len = utr->data_len; - buff = utr->buff; - qtd_pre = NULL; - - while (data_len > 0) - { - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - qtd = qh->qtd_list; - while (qtd != NULL) - { - qtd_pre = qtd; - qtd = qtd->next; - free_ehci_qTD(qtd_pre); - } - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - if (data_len > 0x4000) /* force maximum x'fer length 16K per qTD */ - xfer_len = 0x4000; - else - xfer_len = data_len; /* remaining data length < 4K */ - - qtd->qh = qh; - qtd->Next_qTD = (uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)buff, xfer_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = (xfer_len << 16) | token; - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - if (data_len == 0) /* is this the latest qTD? */ - { - qtd->Token |= QTD_IOC; /* ask to raise an interrupt on the last qTD */ - qtd->Next_qTD = (uint32_t)_ghost_qtd; /* qTD list end */ - } - - if (qtd_pre != NULL) - qtd_pre->Next_qTD = (uint32_t)qtd; - qtd_pre = qtd; - } - - //USB_debug("utr=0x%x, qh=0x%x, qtd=0x%x\n", (int)utr, (int)qh, (int)qh->qtd_list); - - qtd = qh->qtd_list; - - qh->OL_Next_qTD = (uint32_t)qtd; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - - qh->OL_Token = 0; //qtd->Token; - - if (utr->ep->bToggle) - qh->OL_Token |= QTD_DT; - - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - - return 0; -} - -static int ehci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh, *iqh; - qTD_T *qtd; - uint32_t token; - int8_t is_new_qh = 0; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - qh->Chrst &= ~0xF0000000; - - if (udev->speed == SPEED_HIGH) - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & 0xff) | make_int_s_mask(ep->bInterval); - } - else - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & ~(QH_C_MASK_Msk | QH_S_MASK_Msk)) | 0x7802; - } - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTD */ - /*------------------------------------------------------------------------------------*/ - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd->qh = qh; - qtd->Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = QTD_IOC | (utr->data_len << 16) | token; - - DISABLE_EHCI_IRQ(); - - USB_debug("ehci_int_xfer - qh: 0x%x, 0x%x, 0x%x, qtd: 0x%x\n", (int)qh, (int)qh->Chrst, (int)qh->Cap, (int)qtd); - - qh->OL_Next_qTD = (uint32_t)qtd; - - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - qh->OL_Token = qtd->Token; - - if (udev->speed == SPEED_HIGH) /* get head node of this interval */ - iqh = get_int_tree_head_node(ep->bInterval); - else - iqh = get_int_tree_head_node(ep->bInterval * 8); - qh->HLink = iqh->HLink; /* Add to list of the same interval */ - iqh->HLink = QH_HLNK_QH(qh); - } - - ENABLE_EHCI_IRQ(); - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; -} - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ehci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - QH_T *qh; - - // USB_debug("ehci_quit_xfer - utr: 0x%x, ep: 0x%x\n", (int)utr, (int)ep); - - DISABLE_EHCI_IRQ(); - if (ehci_quit_iso_xfer(utr, ep) == 0) - { - ENABLE_EHCI_IRQ(); - return 0; - } - ENABLE_EHCI_IRQ(); - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - qh = (QH_T *)(utr->ep->hw_pipe); - - if (!qh) - return USBH_ERR_NOT_FOUND; - - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - qh = (QH_T *)(ep->hw_pipe); - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - ep->hw_pipe = NULL; - } - usbh_delay_ms(2); - - return 0; -} - -static int visit_qtd(qTD_T *qtd) -{ - if ((qtd->Token == 0x11197B7F) || (qtd->Token == 0x1197B7F)) - return 0; /* A Dummy qTD or qTD on writing, don't touch it. */ - - // USB_debug("Visit qtd 0x%x - 0x%x\n", (int)qtd, qtd->Token); - - if ((qtd->Token & QTD_STS_ACTIVE) == 0) - { - if (qtd->Token & (QTD_STS_HALT | QTD_STS_DATA_BUFF_ERR | QTD_STS_BABBLE | QTD_STS_XactErr | QTD_STS_MISS_MF)) - { - USB_error("qTD 0x%x error token=0x%x! 0x%x\n", (int)qtd, qtd->Token, qtd->Bptr[0]); - if (qtd->utr->status == 0) - qtd->utr->status = USBH_ERR_TRANSACTION; - } - else - { - if ((qtd->Token & QTD_PID_Msk) != QTD_PID_SETUP) - { - qtd->utr->xfer_len += qtd->xfer_len - QTD_TODO_LEN(qtd->Token); - // USB_debug("0x%x utr->xfer_len += %d\n", qtd->Token, qtd->xfer_len - QTD_TODO_LEN(qtd->Token)); - } - } - return 1; - } - return 0; -} - -void scan_asynchronous_list() -{ - QH_T *qh, *qh_tmp; - qTD_T *q_pre, *qtd, *qtd_tmp; - UTR_T *utr; - - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - // USB_debug("Scan qh=0x%x, 0x%x\n", (int)qh, qh->OL_Token); - - utr = NULL; - qtd = qh->qtd_list; - while (qtd != NULL) - { - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - /* qTD is completed, will remove it */ - utr = qtd->utr; - if (qtd == qh->qtd_list) - qh->qtd_list = qtd->next; /* unlink the qTD from qtd_list */ - else - q_pre->next = qtd->next; /* unlink the qTD from qtd_list */ - - qtd_tmp = qtd; /* remember this qTD for freeing later */ - qtd = qtd->next; /* advance to the next qTD */ - - qtd_tmp->next = qh->done_list; /* push this qTD to QH's done list */ - qh->done_list = qtd_tmp; - } - else - { - q_pre = qtd; /* remember this qTD as a preceder */ - qtd = qtd->next; /* advance to next qTD */ - } - } - - qh_tmp = qh; - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qh_tmp->qtd_list == NULL) && utr) - { - // printf("T %d [%d]\n", (qh_tmp->Chrst>>8)&0xf, (qh_tmp->OL_Token&QTD_DT) ? 1 : 0); - if (qh_tmp->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - } -} - -static void scan_periodic_frame_list() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Scan interrupt frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - qtd = qh->qtd_list; /* There's only one qTD in list at most. */ - - if (qtd == NULL) - { - /* empty QH */ - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - continue; - } - - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - qtd->next = qh->done_list; /* push qTD into the done list */ - qh->done_list = qtd; - qh->qtd_list = NULL; /* qtd_list becomes empty */ - } - - qtd = qh->done_list; - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qtd != NULL) && (qh->qtd_list == NULL)) - { - utr = qtd->utr; - - if (qh->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Scan isochronous frame list */ - /*------------------------------------------------------------------------------------*/ - - scan_isochronous_list(); -} - -void iaad_remove_qh() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Remove all QHs in qh_remove_list... */ - /*------------------------------------------------------------------------------------*/ - while (qh_remove_list != NULL) - { - qh = qh_remove_list; - qh_remove_list = qh->next; - - // USB_debug("iaad_remove_qh - remove QH 0x%x\n", (int)qh); - - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - - if (qh->qtd_list != NULL) /* still have incomplete qTDs? */ - { - utr = qh->qtd_list->utr; - while (qh->qtd_list) - { - qtd = qh->qtd_list; - qh->qtd_list = qtd->next; - free_ehci_qTD(qtd); - } - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); /* call back */ - } - free_ehci_QH(qh); /* free the QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each asynchronous QH */ - /*------------------------------------------------------------------------------------*/ - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each QH of periodic frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } -} - -//void EHCI_IRQHandler(void) -void nu_ehci_isr(int vector, void *param) -{ - volatile uint32_t intsts = _ehci->USTSR; - - _ehci->USTSR = intsts; /* clear interrupt status */ - - //USB_debug("ehci int_sts = 0x%x\n", intsts); - - if (intsts & HSUSBH_USTSR_UERRINT_Msk) - { - USB_error("Transfer error!\n"); - } - - if (intsts & HSUSBH_USTSR_USBINT_Msk) - { - /* some transfers completed, travel asynchronous */ - /* and periodic lists to find and reclaim them. */ - scan_asynchronous_list(); - - scan_periodic_frame_list(); - } - - if (intsts & HSUSBH_USTSR_IAA_Msk) - { - iaad_remove_qh(); - } -} - -static UDEV_T *ehci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && (udev->speed == SPEED_HIGH)) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ehci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ehci->UPSCR[port] = (_ehci->UPSCR[port] | HSUSBH_UPSCR_PRST_Msk) & ~HSUSBH_UPSCR_PE_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) ; /* wait at least 50 ms */ - - _ehci->UPSCR[port] &= ~HSUSBH_UPSCR_PRST_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) || - ((_ehci->UPSCR[port] & (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk)) == (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("EHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PEC_Msk; /* clear port enable change status */ - return USBH_OK; /* port reset success */ -} - -static int ehci_rh_polling(void) -{ - UDEV_T *udev; - int ret, change = 0; - int port; - int connect_status, t0, debounce_tick; - - for (port = 0; port < EHCI_PORT_CNT; port++) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CSC_Msk)) - continue; - - change = 1; - USB_debug("EHCI port%d status change: 0x%x\n", port + 1, _ehci->UPSCR[port]); - - /*--------------------------------------------------------------------------------*/ - /* Disconnect the devices attached to this port. */ - /*--------------------------------------------------------------------------------*/ - while (1) - { - udev = ehci_find_device_by_port(port + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - /*--------------------------------------------------------------------------------*/ - /* Port de-bounce */ - /*--------------------------------------------------------------------------------*/ - t0 = usbh_get_ticks(); - debounce_tick = usbh_tick_from_millisecond(HUB_DEBOUNCE_TIME); - connect_status = _ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk; - while (usbh_get_ticks() - t0 < debounce_tick) - { - if (connect_status != (_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk)) - { - /* reset stable time counting */ - t0 = usbh_get_ticks(); - connect_status = _ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk; - } - } - - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear connect status change bit */ - - if (connect_status == HSUSBH_UPSCR_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* A new device connected. */ - /*----------------------------------------------------------------------------*/ - if (ehci_rh_port_reset(port) != USBH_OK) - { - /* port reset failed, maybe an USB 1.1 device */ - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PO_Msk; /* change port owner to OHCI */ - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear all status change bits */ - return 0; - } - - /* - * Port reset success. Start to enumerate this new device. - */ - udev = alloc_device(); - if (udev == NULL) - return 0; /* out-of-memory, do nothing... */ - - udev->parent = NULL; - udev->port_num = port + 1; - udev->speed = SPEED_HIGH; - udev->hc_driver = &ehci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - } - else - { - /* Device disconnected */ - while (1) - { - udev = ehci_find_device_by_port(port + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - } - } - return change; -} - - -HC_DRV_T ehci_driver = -{ - ehci_init, /* init */ - ehci_shutdown, /* shutdown */ - ehci_suspend, /* suspend */ - ehci_resume, /* resume */ - ehci_ctrl_xfer, /* ctrl_xfer */ - ehci_bulk_xfer, /* bulk_xfer */ - ehci_int_xfer, /* int_xfer */ - ehci_iso_xfer, /* iso_xfer */ - ehci_quit_xfer, /* quit_xfer */ - ehci_rh_port_reset, /* rthub_port_reset */ - ehci_rh_polling /* rthub_polling */ -}; - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci_iso.c b/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci_iso.c deleted file mode 100644 index 3ba835d4d8e..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ehci_iso.c +++ /dev/null @@ -1,918 +0,0 @@ -/**************************************************************************//** - * @file ehci_iso.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB EHCI isochornous transfer driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "N9H30.h" - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -uint32_t g_flr_cnt; /* frame list rollover counter */ - -ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ - -extern uint32_t *_PFList; /* Periodic frame list */ - -static const uint16_t sitd_OUT_Smask [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f }; - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep); - -/* - * Inspect the iTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_itd(iTD_T *itd) -{ - UTR_T *utr; - uint32_t frnidx = itd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int i, fidx; - - // printf("R - %d %d, 0x%x\n", now_frame, frnidx, itd->Transaction[0]); - - if (now_frame == frnidx) - { - for (i = 0; i < 8; i++) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - return 0; /* have any not completed frames */ - } - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this iTD - */ - utr = itd->utr; - fidx = itd->fidx; - for (i = 0; i < 8; i++) - { - if (!(itd->trans_mask & (0x1 << i))) - continue; /* not scheduled micro-frame */ - - if (ITD_STATUS(itd->Transaction[i])) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - utr->status = USBH_ERR_NOT_ACCESS0; - } - else if (itd->Transaction[i] & ITD_STATUS_BABBLE) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (itd->Transaction[i] & ITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - utr->iso_status[fidx] = 0; - utr->iso_xlen[fidx] = ITD_XFER_LEN(itd->Transaction[i]); - } - fidx++; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - - return 1; /* to be reclaimed */ -} - -/* - * Inspect the siTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_sitd(siTD_T *sitd) -{ - UTR_T *utr; - uint32_t frnidx = sitd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int fidx; - uint32_t TotalBytesToTransfer; - - if (now_frame == frnidx) - { - if (SITD_STATUS(sitd->StsCtrl) == SITD_STATUS_ACTIVE) - return 0; - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this siTD - */ - utr = sitd->utr; - fidx = sitd->fidx; - - if (SITD_STATUS(sitd->StsCtrl)) - { - if (sitd->StsCtrl & SITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - } - else if (sitd->StsCtrl & SITD_BABBLE_DETECTED) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (sitd->StsCtrl & SITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - TotalBytesToTransfer = (sitd->StsCtrl & SITD_XFER_CNT_Msk) >> SITD_XFER_CNT_Pos; - utr->iso_xlen[fidx] = utr->iso_xlen[fidx] - TotalBytesToTransfer; - utr->iso_status[fidx] = 0; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - return 1; /* to be reclaimed */ -} - -/* - * Some iTD/siTD may be scheduled but not serviced due to time missed. - * This function scan several earlier frames and drop unserviced iTD/siTD if found. - */ -void scan_isochronous_list(void) -{ - ISO_EP_T *iso_ep = iso_ep_list; - iTD_T *itd, *itd_pre, *p; - siTD_T *sitd, *sitd_pre, *sp; - uint32_t frnidx; - - DISABLE_EHCI_IRQ(); - - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - /*--------------------------------------------------------------------------------*/ - /* Scan all iTDs */ - /*--------------------------------------------------------------------------------*/ - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - itd_pre = NULL; - while (itd != NULL) /* traverse all iTDs of itd list */ - { - if (review_itd(itd)) /* inspect and reclaim iTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("An iTD lost refernece to periodic frame list! 0x%x -> %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this iTD from iso_ep's iTD list */ - /*------------------------------------------------------------------------*/ - if (itd_pre == NULL) - { - iso_ep->itd_list = itd->next; - } - else - { - itd_pre->next = itd->next; - } - p = itd->next; - free_ehci_iTD(itd); - itd = p; - } - else - { - itd_pre = itd; - itd = itd->next; /* traverse to the next iTD of iTD list */ - } - } - - /*--------------------------------------------------------------------------------*/ - /* Scan all siTDs */ - /*--------------------------------------------------------------------------------*/ - sitd = iso_ep->sitd_list; /* get the first siTD from iso_ep's siTD list */ - sitd_pre = NULL; - while (sitd != NULL) /* traverse all siTDs of sitd list */ - { - if (review_sitd(sitd)) /* inspect and reclaim siTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this siTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = sitd->sched_frnidx; - if (_PFList[frnidx] == SITD_HLNK_SITD(sitd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = sitd->Next_Link; - } - else - { - sp = SITD_PTR(_PFList[frnidx]); /* find the preceding siTD */ - while ((SITD_PTR(sp->Next_Link) != sitd) && (sp != NULL)) - { - sp = SITD_PTR(sp->Next_Link); - } - - if (sp == NULL) /* link list out of control! */ - { - USB_error("An siTD lost reference to periodic frame list! 0x%x -> %d\n", (int)sitd, frnidx); - } - else /* remove iTD from list */ - { - sp->Next_Link = sitd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this siTD from iso_ep's siTD list */ - /*------------------------------------------------------------------------*/ - if (sitd_pre == NULL) - { - iso_ep->sitd_list = sitd->next; - } - else - { - sitd_pre->next = sitd->next; - } - sp = sitd->next; - free_ehci_siTD(sitd); - sitd = sp; - } - else - { - sitd_pre = sitd; - sitd = sitd->next; /* traverse to the next siTD of siTD list */ - } - } - - iso_ep = iso_ep->next; - } - - ENABLE_EHCI_IRQ(); -} - - -static void write_itd_info(UTR_T *utr, iTD_T *itd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int i; - - buff_page_addr = itd->buff_base & 0xFFFFF000; /* 4K page */ - - for (i = 0; i < 7; i++) - { - itd->Bptr[i] = buff_page_addr + (0x1000 * i); - } - /* EndPtr R Device Address */ - itd->Bptr[0] |= (udev->dev_num) | ((ep->bEndpointAddress & 0xF) << ITD_EP_NUM_Pos); - itd->Bptr[1] |= ep->wMaxPacketSize; /* Maximum Packet Size */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - itd->Bptr[1] |= ITD_DIR_IN; - else - itd->Bptr[1] |= ITD_DIR_OUT; - - itd->Bptr[2] |= (ep->wMaxPacketSize + 1023) / 1024; /* Mult */ -} - -static void write_itd_micro_frame(UTR_T *utr, int fidx, iTD_T *itd, int mf) -{ - uint32_t buff_addr; - - buff_addr = (uint32_t)(utr->iso_buff[fidx]); /* xfer buffer start address of this frame */ - - itd->Transaction[mf] = ITD_STATUS_ACTIVE | /* Status */ - ((utr->iso_xlen[fidx] & 0xFFF) << ITD_XLEN_Pos) | /* Transaction Length */ - ((buff_addr & 0xFFFFF000) - (itd->buff_base & 0xFFFFF000)) | /* PG */ - (buff_addr & 0xFFF); /* Transaction offset */ -} - - -static void remove_iso_ep_from_list(ISO_EP_T *iso_ep) -{ - ISO_EP_T *p; - - if (iso_ep_list == iso_ep) - { - iso_ep_list = iso_ep->next; /* it's the first entry, remove it */ - return; - } - - p = iso_ep_list; /* find the previous entry of iso_ep */ - while (p->next != NULL) - { - if (p->next == iso_ep) - { - break; - } - p = p->next; - } - - if (p->next == NULL) - { - return; /* not found */ - } - p->next = iso_ep->next; /* remove iso_ep from list */ -} - - -static __inline void add_itd_to_iso_ep(ISO_EP_T *iso_ep, iTD_T *itd) -{ - iTD_T *p; - - itd->next = NULL; - - if (iso_ep->itd_list == NULL) - { - iso_ep->itd_list = itd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->itd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = itd; -} - -int ehci_iso_xfer(UTR_T *utr) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - ISO_EP_T *iso_ep; /* software iso endpoint descriptor */ - iTD_T *itd, *itd_next, *itd_list = NULL; - int i, itd_cnt; - int trans_mask; /* bit mask of used xfer in an iTD */ - int fidx; /* index to the 8 iso frames of UTR */ - int interval; /* frame interval of iTD */ - - if (ep->hw_pipe != NULL) - { - iso_ep = (ISO_EP_T *)ep->hw_pipe; /* get reference of the isochronous endpoint */ - - if (utr->bIsoNewSched) - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - } - else - { - /* first time transfer of this iso endpoint */ - iso_ep = usbh_alloc_mem(sizeof(*iso_ep)); - if (iso_ep == NULL) - return USBH_ERR_MEMORY_OUT; - - memset(iso_ep, 0, sizeof(*iso_ep)); - iso_ep->ep = ep; - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - - ep->hw_pipe = iso_ep; - - /* - * Add this iso_ep into iso_ep_list - */ - DISABLE_EHCI_IRQ(); - iso_ep->next = iso_ep_list; - iso_ep_list = iso_ep; - ENABLE_EHCI_IRQ(); - } - - if (utr->udev->speed == SPEED_FULL) - return ehci_iso_split_xfer(utr, iso_ep); - - /*------------------------------------------------------------------------------------*/ - /* Allocate iTDs */ - /*------------------------------------------------------------------------------------*/ - - if (ep->bInterval < 2) /* transfer interval is 1 micro-frame */ - { - trans_mask = 0xFF; - itd_cnt = 1; /* required 1 iTD for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 4) /* transfer interval is 2 micro-frames */ - { - trans_mask = 0x55; - itd_cnt = 2; /* required 2 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 8) /* transfer interval is 4 micro-frames */ - { - trans_mask = 0x44; - itd_cnt = 4; /* required 4 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 16) /* transfer interval is 8 micro-frames */ - { - trans_mask = 0x08; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 32) /* transfer interval is 16 micro-frames */ - { - trans_mask = 0x10; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 2; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 64) /* transfer interval is 32 micro-frames */ - { - trans_mask = 0x02; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 4; /* iTD frame interval of this endpoint */ - } - else /* transfer interval is 64 micro-frames */ - { - trans_mask = 0x04; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 8; /* iTD frame interval of this endpoint */ - } - - for (i = 0; i < itd_cnt; i++) /* allocate all iTDs required by UTR */ - { - itd = alloc_ehci_iTD(); - if (itd == NULL) - goto malloc_failed; - - if (itd_list == NULL) /* link all iTDs */ - { - itd_list = itd; - } - else - { - itd->next = itd_list; - itd_list = itd; - } - } - - utr->td_cnt = itd_cnt; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all iTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (itd = itd_list; (itd != NULL);) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver ITD bug!?\n"); - goto malloc_failed; - } - - itd->utr = utr; - itd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - itd->buff_base = (uint32_t)(utr->iso_buff[fidx]); /* iTD buffer base is buffer of the first UTR iso frame serviced by this iTD */ - itd->trans_mask = trans_mask; - - write_itd_info(utr, itd); - - for (i = 0; i < 8; i++) /* settle xfer into micro-frames */ - { - if (!(trans_mask & (0x1 << i))) - { - itd->Transaction[i] = 0; /* not accesed */ - continue; /* not scheduled micro-frame */ - } - - write_itd_micro_frame(utr, fidx, itd, i); - - fidx++; /* preceed to next UTR iso frame */ - - if (fidx == IF_PER_UTR) /* is the last scheduled micro-frame? */ - { - /* raise interrupt on completed */ - itd->Transaction[i] |= ITD_IOC; - break; - } - } - - itd_next = itd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - DISABLE_EHCI_IRQ(); - itd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - add_itd_to_iso_ep(iso_ep, itd); /* add to software itd list */ - itd->Next_Link = _PFList[itd->sched_frnidx]; /* keep the next link */ - _PFList[itd->sched_frnidx] = ITD_HLNK_ITD(itd); - iso_ep->next_frame = (iso_ep->next_frame + interval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - itd = itd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (itd_list != NULL) - { - itd = itd_list; - itd_list = itd->next; - free_ehci_iTD(itd); - } - return USBH_ERR_MEMORY_OUT; -} - -static __inline void add_sitd_to_iso_ep(ISO_EP_T *iso_ep, siTD_T *sitd) -{ - siTD_T *p; - - sitd->next = NULL; - - if (iso_ep->sitd_list == NULL) - { - iso_ep->sitd_list = sitd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->sitd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = sitd; -} - -static void write_sitd_info(UTR_T *utr, siTD_T *sitd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int xlen = utr->iso_xlen[sitd->fidx]; - int scnt; - - sitd->Chrst = (udev->port_num << SITD_PORT_NUM_Pos) | - (udev->parent->iface->udev->dev_num << SITD_HUB_ADDR_Pos) | - ((ep->bEndpointAddress & 0xF) << SITD_EP_NUM_Pos) | - (udev->dev_num << SITD_DEV_ADDR_Pos); - - buff_page_addr = ((uint32_t)utr->iso_buff[sitd->fidx]) & 0xFFFFF000; - sitd->Bptr[0] = (uint32_t)(utr->iso_buff[sitd->fidx]); - sitd->Bptr[1] = buff_page_addr + 0x1000; - - scnt = (xlen + 187) / 188; - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - { - sitd->Chrst |= SITD_XFER_IN; - sitd->Sched = (1 << (scnt + 2)) - 1; - sitd->Sched = (sitd->Sched << 10) | 0x1; - //sitd->Sched <<= 1; - } - else - { - sitd->Chrst |= SITD_XFER_OUT; - sitd->Sched = sitd_OUT_Smask[scnt - 1]; - if (scnt > 1) - { - sitd->Bptr[1] |= (0x1 << 3); /* Transaction position (TP) 01b: Begin */ - } - sitd->Bptr[1] |= scnt; /* Transaction count (T-Count) */ - } - - if (sitd->fidx == IF_PER_UTR) - { - sitd->Sched |= SITD_IOC; - } - - sitd->StsCtrl = (xlen << SITD_XFER_CNT_Pos) | SITD_STATUS_ACTIVE; - - sitd->BackLink = SITD_LIST_END; -} - - -static void ehci_sitd_adjust_schedule(siTD_T *sitd) -{ - siTD_T *hlink = (siTD_T *)_PFList[sitd->sched_frnidx]; - uint32_t uframe_mask = 0x00; - - while (hlink && !HLINK_IS_TERMINATED(hlink) && HLINK_IS_SITD(hlink)) - { - hlink = SITD_PTR(hlink); - if (hlink != sitd) - { - if ((hlink->Chrst & SITD_XFER_IO_Msk) == SITD_XFER_IN) - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by IN S-mask */ - uframe_mask |= ((hlink->Sched >> 8) & 0xFF); /* mark micro-frames used by IN C-mask */ - } - else - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by OUT S-mask */ - } - } - hlink = SITD_PTR(hlink->Next_Link); - } - - uframe_mask = uframe_mask | (uframe_mask << 8); /* mark both S-mask and C-mask */ - - if (uframe_mask) - { - /* - * Shift afterward one micro-frame until no conflicts. - */ - while (1) - { - if (sitd->Sched & uframe_mask) - { - sitd->Sched = (sitd->Sched & 0xFFFF0000) | ((sitd->Sched << 1) & 0xFFFF); - } - else - { - break; /* no conflit, done. */ - } - } - } -} - - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - siTD_T *sitd, *sitd_next, *sitd_list = NULL; - int i; - int fidx; /* index to the 8 iso frames of UTR */ - - if (utr->udev->parent == NULL) - { - USB_error("siso xfer - parent lost!\n"); - return USBH_ERR_INVALID_PARAM; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate siTDs */ - /*------------------------------------------------------------------------------------*/ - for (i = 0; i < IF_PER_UTR; i++) /* allocate all siTDs required by UTR */ - { - sitd = alloc_ehci_siTD(); - if (sitd == NULL) - goto malloc_failed; - - if (sitd_list == NULL) /* link all siTDs */ - { - sitd_list = sitd; - } - else - { - sitd->next = sitd_list; - sitd_list = sitd; - } - } - - utr->td_cnt = IF_PER_UTR; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all siTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (sitd = sitd_list; (sitd != NULL); fidx++) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver siTD bug!?\n"); - goto malloc_failed; - } - - sitd->utr = utr; - sitd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - - write_sitd_info(utr, sitd); - - sitd_next = sitd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - sitd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - DISABLE_EHCI_IRQ(); - ehci_sitd_adjust_schedule(sitd); - add_sitd_to_iso_ep(iso_ep, sitd); /* add to software itd list */ - sitd->Next_Link = _PFList[sitd->sched_frnidx];/* keep the next link */ - _PFList[sitd->sched_frnidx] = SITD_HLNK_SITD(sitd); - iso_ep->next_frame = (iso_ep->next_frame + ep->bInterval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - sitd = sitd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (sitd_list != NULL) - { - sitd = sitd_list; - sitd_list = sitd->next; - free_ehci_siTD(sitd); - } - return USBH_ERR_MEMORY_OUT; -} - -/* - * If it's an isochronous endpoint, quit current transfer via UTR or hardware EP. - */ -int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ISO_EP_T *iso_ep; - iTD_T *itd, *itd_next, *p; - uint32_t frnidx; - uint32_t now_frame; - - if (ep == NULL) - { - if (utr == NULL) - return USBH_ERR_NOT_FOUND; - - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ep = utr->ep; - } - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) != EP_ATTR_TT_ISO) - return USBH_ERR_NOT_FOUND; /* not isochronous endpoint */ - - /*------------------------------------------------------------------------------------*/ - /* It's an iso endpoint. Remove it as required. */ - /*------------------------------------------------------------------------------------*/ - iso_ep = iso_ep_list; - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - if (iso_ep->ep == ep) - break; - iso_ep = iso_ep->next; - } - if (iso_ep == NULL) - return 0; /* should have been removed */ - - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - - while (itd != NULL) /* traverse all iTDs of itd list */ - { - itd_next = itd->next; /* remember the next iTD */ - utr = itd->utr; - - /*--------------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*--------------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - - /* - * Prevent to race with Host Controller. If the iTD to be removed is located in - * current or next frame, wait until HC passed through it. - */ - while (1) - { - now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - if ((now_frame == frnidx) || (((now_frame + 1) % 1024) == frnidx)) - continue; - break; - } - - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("ehci_quit_iso_xfer - An iTD lost reference to periodic frame list! 0x%x on %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - utr->status = USBH_ERR_ABORT; - } - free_ehci_iTD(itd); - itd = itd_next; - } - - /* - * Remove iso_ep from iso_ep_list - */ - remove_iso_ep_from_list(iso_ep); - usbh_free_mem(iso_ep, sizeof(*iso_ep)); /* free this iso_ep */ - ep->hw_pipe = NULL; - - if (iso_ep_list == NULL) - _ehci->UCMDR &= ~HSUSBH_UCMDR_PSEN_Msk; - - return 0; -} - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/mem_alloc.c b/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/mem_alloc.c deleted file mode 100644 index 1ad3cabcb1f..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/mem_alloc.c +++ /dev/null @@ -1,540 +0,0 @@ -/**************************************************************************//** - * @file mem_alloc.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB host library memory allocation functions. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" - - -/// @cond HIDDEN_SYMBOLS - -//#define MEM_DEBUG - -#ifdef MEM_DEBUG - #define mem_debug rt_kprintf -#else - #define mem_debug(...) -#endif - -#ifdef __ICCARM__ - #pragma data_alignment=1024 - uint8_t _mem_pool_buff[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE]; -#else - uint8_t _mem_pool_buff[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE] __attribute__((aligned(1024))); -#endif - -static uint8_t *_mem_pool[MEM_POOL_UNIT_NUM]; -static uint8_t _unit_used[MEM_POOL_UNIT_NUM]; - -static volatile int _usbh_mem_used; -static volatile int _usbh_max_mem_used; -static volatile int _mem_pool_used; - - -UDEV_T *g_udev_list; - -uint8_t _dev_addr_pool[128]; -static volatile int _device_addr; - -static int _sidx = 0;; - -/*--------------------------------------------------------------------------*/ -/* Memory alloc/free recording */ -/*--------------------------------------------------------------------------*/ - -void usbh_memory_init(void) -{ - int i; - - if (sizeof(TD_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("TD_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - if (sizeof(ED_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("ED_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - _unit_used[i] = 0; - _mem_pool[i] = (uint8_t *)((uint32_t)&_mem_pool_buff[i] | NON_CACHE_MASK); - } - - _usbh_mem_used = 0L; - _usbh_max_mem_used = 0L; - - _mem_pool_used = 0; - _sidx = 0; - - g_udev_list = NULL; - - memset(_dev_addr_pool, 0, sizeof(_dev_addr_pool)); - _device_addr = 1; - - USB_InitializeMemoryPool(); -} - -uint32_t usbh_memory_used(void) -{ - mem_debug("USB static memory: %d/%d, heap used: %d\n", _mem_pool_used, MEM_POOL_UNIT_NUM, _usbh_mem_used); - return _usbh_mem_used; -} - -static void memory_counter(int size) -{ - _usbh_mem_used += size; - if (_usbh_mem_used > _usbh_max_mem_used) - _usbh_max_mem_used = _usbh_mem_used; -} - -void *usbh_alloc_mem(int size) -{ - void *p; - - p = USB_malloc(size, 16); - if (p == NULL) - { - USB_error("usbh_alloc_mem failed! %d\n", size); - return NULL; - } - - memset(p, 0, size); - memory_counter(size); - return p; -} - -void usbh_free_mem(void *p, int size) -{ - USB_free(p); - memory_counter(0 - size); -} - - -/*--------------------------------------------------------------------------*/ -/* USB device allocate/free */ -/*--------------------------------------------------------------------------*/ - -UDEV_T *alloc_device(void) -{ - UDEV_T *udev; - - udev = (UDEV_T *)USB_malloc(sizeof(*udev), 16); - if (udev == NULL) - { - USB_error("alloc_device failed!\n"); - return NULL; - } - - memset(udev, 0, sizeof(*udev)); - memory_counter(sizeof(*udev)); - udev->cur_conf = -1; /* must! used to identify the first SET CONFIGURATION */ - udev->next = g_udev_list; /* chain to global device list */ - g_udev_list = udev; - return udev; -} - -void free_device(UDEV_T *udev) -{ - UDEV_T *d; - - if (udev == NULL) - return; - - if (udev->cfd_buff != NULL) - usbh_free_mem(udev->cfd_buff, MAX_DESC_BUFF_SIZE); - - /* - * Remove it from the global device list - */ - if (g_udev_list == udev) - { - g_udev_list = g_udev_list->next; - } - else - { - d = g_udev_list; - while (d != NULL) - { - if (d->next == udev) - { - d->next = udev->next; - break; - } - d = d->next; - } - } - USB_free(udev); - memory_counter(-sizeof(*udev)); -} - -int alloc_dev_address(void) -{ - _device_addr++; - - if (_device_addr >= 128) - _device_addr = 1; - - while (1) - { - if (_dev_addr_pool[_device_addr] == 0) - { - _dev_addr_pool[_device_addr] = 1; - return _device_addr; - } - _device_addr++; - if (_device_addr >= 128) - _device_addr = 1; - } -} - -void free_dev_address(int dev_addr) -{ - if (dev_addr < 128) - _dev_addr_pool[dev_addr] = 0; -} - -/*--------------------------------------------------------------------------*/ -/* UTR (USB Transfer Request) allocate/free */ -/*--------------------------------------------------------------------------*/ - -UTR_T *alloc_utr(UDEV_T *udev) -{ -#if 0 - UTR_T *utr, *utr_noncache; - - utr = (UTR_T *)USB_malloc(sizeof(*utr), 16); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - - utr_noncache = (UTR_T *)((uint32_t)utr | NONCACHEABLE); - - memory_counter(sizeof(*utr)); - memset(utr_noncache, 0, sizeof(*utr)); - utr_noncache->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr_noncache); - return utr_noncache; -#else - UTR_T *utr; - - utr = (UTR_T *)USB_malloc(sizeof(*utr), 16); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - - memory_counter(sizeof(*utr)); - memset(utr, 0, sizeof(*utr)); - utr->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr_noncache); - return utr; -#endif -} - -void free_utr(UTR_T *utr) -{ - if (utr == NULL) - return; - - mem_debug("[FREE] [UTR] - 0x%x\n", (int)utr); - -#if 0 - if ((uint32_t)utr & NONCACHEABLE) - utr = (UTR_T *)((uint32_t)utr & ~NONCACHEABLE); -#endif - - USB_free(utr); - memory_counter(0 - (int)sizeof(*utr)); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI ED allocate/free */ -/*--------------------------------------------------------------------------*/ - -ED_T *alloc_ohci_ED(void) -{ - int i; - ED_T *ed; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - ed = (ED_T *)_mem_pool[i]; - memset(ed, 0, sizeof(*ed)); - mem_debug("[ALLOC] [ED] - 0x%x\n", (int)ed); - return ed; - } - } - USB_error("alloc_ohci_ED failed!\n"); - return NULL; -} - -void free_ohci_ED(ED_T *ed) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)ed) - { - mem_debug("[FREE] [ED] - 0x%x\n", (int)ed); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ohci_ED - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI TD allocate/free */ -/*--------------------------------------------------------------------------*/ -TD_T *alloc_ohci_TD(UTR_T *utr) -{ - int i; - TD_T *td; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - td = (TD_T *)_mem_pool[i]; - - memset(td, 0, sizeof(*td)); - td->utr = utr; - mem_debug("[ALLOC] [TD] - 0x%x\n", (int)td); - return td; - } - } - USB_error("alloc_ohci_TD failed!\n"); - return NULL; -} - -void free_ohci_TD(TD_T *td) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)td) - { - mem_debug("[FREE] [TD] - 0x%x\n", (int)td); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ohci_TD - not found!\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI QH allocate/free */ -/*--------------------------------------------------------------------------*/ -QH_T *alloc_ehci_QH(void) -{ - int i; - QH_T *qh = NULL; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qh = (QH_T *)_mem_pool[i]; - memset(qh, 0, sizeof(*qh)); - mem_debug("[ALLOC] [QH] - 0x%x\n", (int)qh); - break; - } - } - if (qh == NULL) - { - USB_error("alloc_ehci_QH failed!\n"); - return NULL; - } - qh->Curr_qTD = QTD_LIST_END; - qh->OL_Next_qTD = QTD_LIST_END; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = QTD_STS_HALT; - return qh; -} - -void free_ehci_QH(QH_T *qh) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)qh) - { - mem_debug("[FREE] [QH] - 0x%x\n", (int)qh); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ehci_QH - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI qTD allocate/free */ -/*--------------------------------------------------------------------------*/ -qTD_T *alloc_ehci_qTD(UTR_T *utr) -{ - int i; - qTD_T *qtd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qtd = (qTD_T *)_mem_pool[i]; - - memset(qtd, 0, sizeof(*qtd)); - qtd->Next_qTD = QTD_LIST_END; - qtd->Alt_Next_qTD = QTD_LIST_END; - qtd->Token = 0x1197B7F; // QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It means the qTD still not ready for transfer. - qtd->utr = utr; - mem_debug("[ALLOC] [qTD] - 0x%x\n", (int)qtd); - return qtd; - } - } - USB_error("alloc_ehci_qTD failed!\n"); - return NULL; -} - -void free_ehci_qTD(qTD_T *qtd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)qtd) - { - mem_debug("[FREE] [qTD] - 0x%x\n", (int)qtd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_qTD 0x%x - not found!\n", (int)qtd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -iTD_T *alloc_ehci_iTD(void) -{ - int i; - iTD_T *itd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (i + 2 >= MEM_POOL_UNIT_NUM) - continue; - - if ((_unit_used[i] == 0) && (_unit_used[i + 1] == 0)) - { - _unit_used[i] = _unit_used[i + 1] = 1; - _sidx = i + 1; - _mem_pool_used += 2; - itd = (iTD_T *)_mem_pool[i]; - memset(itd, 0, sizeof(*itd)); - mem_debug("[ALLOC] [iTD] - 0x%x\n", (int)itd); - return itd; - } - } - USB_error("alloc_ehci_iTD failed!\n"); - return NULL; -} - -void free_ehci_iTD(iTD_T *itd) -{ - int i; - - for (i = 0; i + 1 < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)itd) - { - mem_debug("[FREE] [iTD] - 0x%x\n", (int)itd); - _unit_used[i] = _unit_used[i + 1] = 0; - _mem_pool_used -= 2; - return; - } - } - USB_error("free_ehci_iTD 0x%x - not found!\n", (int)itd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -siTD_T *alloc_ehci_siTD(void) -{ - int i; - siTD_T *sitd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used ++; - sitd = (siTD_T *)_mem_pool[i]; - memset(sitd, 0, sizeof(*sitd)); - mem_debug("[ALLOC] [siTD] - 0x%x\n", (int)sitd); - return sitd; - } - } - USB_error("alloc_ehci_siTD failed!\n"); - return NULL; -} - -void free_ehci_siTD(siTD_T *sitd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)sitd) - { - mem_debug("[FREE] [siTD] - 0x%x\n", (int)sitd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_siTD 0x%x - not found!\n", (int)sitd); -} - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ohci.c b/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ohci.c deleted file mode 100644 index 7b9e82b257c..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/ohci.c +++ /dev/null @@ -1,1301 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "N9H30.h" - -#include "usb.h" -#include "hub.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -//#define TD_debug rt_kprintf -#define TD_debug(...) - -//#define ED_debug rt_kprintf -#define ED_debug(...) - -uint8_t _hcca_mem[256] __attribute__((aligned(256))); - -HCCA_T *_hcca; - -ED_T *_Ied[6]; - - -static ED_T *ed_remove_list; - -static void add_to_ED_remove_list(ED_T *ed) -{ - ED_T *p; - - ED_debug("add_to_ED_remove_list - 0x%x (0x%x)\n", (int)ed, ed->Info); - DISABLE_OHCI_IRQ(); - - /* check if this ED found in ed_remove_list */ - p = ed_remove_list; - while (p) - { - if (p == ed) - { - ENABLE_OHCI_IRQ(); /* This ED found in ed_remove_list */ - return; /* do nothing */ - } - p = p->next; - } - - ed->Info |= ED_SKIP; /* ask OHCI controller skip this ED */ - ed->next = ed_remove_list; - ed_remove_list = ed; /* insert to the head of ed_remove_list */ - ENABLE_OHCI_IRQ(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_SF_Msk; - usbh_delay_ms(2); /* Full speed wait 2 ms is enough */ -} - -static int ohci_reset(void) -{ - volatile int t0; - - /* Disable HC interrupts */ - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_MIE_Msk; - - /* HC Reset requires max 10 ms delay */ - _ohci->HcControl = 0; - _ohci->HcCommandStatus = USBH_HcCommandStatus_HCR_Msk; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((USBH->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB OHCI reset timed out!\n"); - return -1; - } - - USBH->HcRhStatus = USBH_HcRhStatus_OCI_Msk | USBH_HcRhStatus_LPS_Msk; - - USBH->HcControl = HCFS_RESET; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((USBH->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB HC reset timed out!\n"); - return -1; - } - return 0; -} - -static void init_hcca_int_table() -{ - ED_T *ed_p; - int i, idx, interval; - - memset(_hcca->int_table, 0, sizeof(_hcca->int_table)); - - for (i = 5; i >= 0; i--) /* interval = i^2 */ - { - _Ied[i] = alloc_ohci_ED(); - _Ied[i]->Info = ED_SKIP; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < 32; idx += interval) - { - if (_hcca->int_table[idx] == 0) /* is empty list, insert directly */ - { - _hcca->int_table[idx] = (uint32_t)_Ied[i]; - } - else - { - ed_p = (ED_T *)_hcca->int_table[idx]; - - while (1) - { - if (ed_p == _Ied[i]) - break; /* already chained by previous visit */ - - if (ed_p->NextED == 0) /* reach end of list? */ - { - ed_p->NextED = (uint32_t)_Ied[i]; - break; - } - ed_p = (ED_T *)ed_p->NextED; - } - } - } - } -} - -static ED_T *get_int_tree_head_node(int interval) -{ - int i; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return _Ied[i]; - } - return _Ied[5]; /* for interval >= 32 */ -} - -static int get_ohci_interval(int interval) -{ - int i, bInterval = 1; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return bInterval; - bInterval *= 2; - } - return 32; /* for interval >= 32 */ -} - - -static int ohci_init(void) -{ - uint32_t fminterval; - volatile int i; - - _hcca = (HCCA_T *)((uint32_t)_hcca_mem | NON_CACHE_MASK); - - if (ohci_reset() < 0) - return -1; - - ed_remove_list = NULL; - - init_hcca_int_table(); - - /* Tell the controller where the control and bulk lists are - * The lists are empty now. */ - _ohci->HcControlHeadED = 0; /* control ED list head */ - _ohci->HcBulkHeadED = 0; /* bulk ED list head */ - - _ohci->HcHCCA = (uint32_t)_hcca; /* HCCA area */ - - /* periodic start 90% of frame interval */ - fminterval = 0x2edf; /* 11,999 */ - _ohci->HcPeriodicStart = (fminterval * 9) / 10; - - /* set FSLargestDataPacket, 10,104 for 0x2edf frame interval */ - fminterval |= ((((fminterval - 210) * 6) / 7) << 16); - _ohci->HcFmInterval = fminterval; - - _ohci->HcLSThreshold = 0x628; - - /* start controller operations */ - _ohci->HcControl = HCFS_OPER | (0x3 << USBH_HcControl_CBSR_Pos); - -#ifdef OHCI_PER_PORT_POWER - _ohci->HcRhDescriptorB = 0x60000; - for (i = 0; i < OHCI_PORT_CNT; i++) - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_PPS_Msk; -#else - _ohci->HcRhDescriptorA = (USBH->HcRhDescriptorA | (1 << 9)) & ~USBH_HcRhDescriptorA_PSM_Msk; - _ohci->HcRhStatus = USBH_HcRhStatus_LPSC_Msk; -#endif - - _ohci->HcInterruptEnable = USBH_HcInterruptEnable_MIE_Msk | USBH_HcInterruptEnable_WDH_Msk | USBH_HcInterruptEnable_SF_Msk; - - /* POTPGT delay is bits 24-31, in 20 ms units. */ - usbh_delay_ms(20); - return 0; -} - -static void ohci_suspend(void) -{ - int i; - - for (i = 0; i < OHCI_PORT_CNT; i++) - { - /* set port suspend if connected */ - if (_ohci->HcRhPortStatus[i] & 0x1) - _ohci->HcRhPortStatus[i] = 0x4; - } - - /* enable Device Remote Wakeup */ - _ohci->HcRhStatus |= USBH_HcRhStatus_DRWE_Msk; - - /* enable USBH RHSC interrupt for system wakeup */ - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_RHSC_Msk | USBH_HcInterruptEnable_RD_Msk; - - /* set Host Controller enter suspend state */ - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (3 << USBH_HcControl_HCFS_Pos); -} - -static void ohci_resume(void) -{ - int i; - - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (1 << USBH_HcControl_HCFS_Pos); - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (2 << USBH_HcControl_HCFS_Pos); - - for (i = 0; i < OHCI_PORT_CNT; i++) - { - if (_ohci->HcRhPortStatus[i] & 0x4) - _ohci->HcRhPortStatus[i] = 0x8; - } -} - -static void ohci_shutdown(void) -{ - ohci_suspend(); - DISABLE_OHCI_IRQ(); -#ifndef OHCI_PER_PORT_POWER - _ohci->HcRhStatus = USBH_HcRhStatus_LPS_Msk; -#endif -} - - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ohci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ED_T *ed; - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ed = (ED_T *)(utr->ep->hw_pipe); - - if (!ed) - return USBH_ERR_NOT_FOUND; - - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - ed = (ED_T *)(ep->hw_pipe); - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - ep->hw_pipe = NULL; - } - - return 0; -} - -uint32_t ed_make_info(UDEV_T *udev, EP_INFO_T *ep) -{ - uint32_t info; - - if (ep == NULL) /* is a control endpoint */ - { - /* control endpoint direction is from TD */ - if (udev->descriptor.bMaxPacketSize0 == 0) /* is 0 if device descriptor still not obtained. */ - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - info = (udev->descriptor.bMaxPacketSize0 << 16) /* Control endpoint Maximum Packet Size from device descriptor */ - | ED_DIR_BY_TD /* Direction (Get direction From TD) */ - | ED_FORMAT_GENERAL /* General format */ - | (0 << ED_CTRL_EN_Pos); /* Endpoint address 0 */ - } - else /* Other endpoint direction is from endpoint descriptor */ - { - info = (ep->wMaxPacketSize << 16); /* Maximum Packet Size from endpoint */ - - info |= ((ep->bEndpointAddress & 0xf) << ED_CTRL_EN_Pos); /* Endpoint Number */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) - info |= ED_DIR_IN; - else - info |= ED_DIR_OUT; - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) == EP_ATTR_TT_ISO) - info |= ED_FORMAT_ISO; - else - info |= ED_FORMAT_GENERAL; - } - - info |= ((udev->speed == SPEED_LOW) ? ED_SPEED_LOW : ED_SPEED_FULL); /* Speed */ - info |= (udev->dev_num); /* Function Address */ - - return info; -} - -static void write_td(TD_T *td, uint32_t info, uint8_t *buff, uint32_t data_len) -{ - td->Info = info; - td->CBP = (uint32_t)((!buff || !data_len) ? 0 : buff); - td->BE = (uint32_t)((!buff || !data_len) ? 0 : (uint32_t)buff + data_len - 1); - td->buff_start = td->CBP; - // TD_debug("TD [0x%x]: 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->BE); -} - -static int ohci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - ED_T *ed; - TD_T *td_setup, *td_data, *td_status; - uint32_t info; - - udev = utr->udev; - - /*------------------------------------------------------------------------------------*/ - /* Allocate ED and TDs */ - /*------------------------------------------------------------------------------------*/ - td_setup = alloc_ohci_TD(utr); - - if (utr->data_len > 0) - td_data = alloc_ohci_TD(utr); - else - td_data = NULL; - - td_status = alloc_ohci_TD(utr); - - if (td_status == NULL) - { - free_ohci_TD(td_setup); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - - /* Check if there's any transfer pending on this endpoint... */ - if (udev->ep0.hw_pipe == NULL) - { - ed = alloc_ohci_ED(); - if (ed == NULL) - { - free_ohci_TD(td_setup); - free_ohci_TD(td_status); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - } - else - ed = (ED_T *)udev->ep0.hw_pipe; - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage TD */ - /*------------------------------------------------------------------------------------*/ - info = TD_CC | TD_T_DATA0 | TD_TYPE_CTRL; - write_td(td_setup, info, (uint8_t *)&utr->setup, 8); - td_setup->ed = ed; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage TD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - - write_td(td_data, info, utr->buff, utr->data_len); - td_data->ed = ed; - td_setup->NextTD = (uint32_t)td_data; - td_setup->next = td_data; - td_data->NextTD = (uint32_t)td_status; - td_data->next = td_status; - } - else - { - td_setup->NextTD = (uint32_t)td_status; - td_setup->next = td_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare STATUS stage TD */ - /*------------------------------------------------------------------------------------*/ - ed->Info = ed_make_info(udev, NULL); - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL); - else - info = (TD_CC | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL); - - write_td(td_status, info, NULL, 0); - td_status->ed = ed; - td_status->NextTD = 0; - td_status->next = 0; - - /*------------------------------------------------------------------------------------*/ - /* prepare ED */ - /*------------------------------------------------------------------------------------*/ - ed->TailP = 0; - ed->HeadP = (uint32_t)td_setup; - ed->Info = ed_make_info(udev, NULL); - ed->NextED = 0; - - //TD_debug("TD SETUP [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_setup, td_setup->Info, td_setup->CBP, td_setup->BE, td_setup->NextTD); - //if (td_data) - // TD_debug("TD DATA [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_data, td_data->Info, td_data->CBP, td_data->BE, td_data->NextTD); - //TD_debug("TD STATUS [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_status, td_status->Info, td_status->CBP, td_status->BE, td_status->NextTD); - ED_debug("Xfer ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - if (utr->data_len > 0) - utr->td_cnt = 3; - else - utr->td_cnt = 2; - - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - udev->ep0.hw_pipe = (void *)ed; /* driver can find ED from EP */ - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - _ohci->HcControlHeadED = (uint32_t)ed; /* Link ED to OHCI */ - _ohci->HcControl |= USBH_HcControl_CLE_Msk; /* enable control list */ - ENABLE_OHCI_IRQ(); - _ohci->HcCommandStatus = USBH_HcCommandStatus_CLF_Msk; /* start Control list */ - - return 0; -} - -static int ohci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed; - TD_T *td, *td_p, *td_list = NULL; - uint32_t info; - uint32_t data_len, xfer_len; - int8_t bIsNewED = 0; - uint8_t *buff; - - /*------------------------------------------------------------------------------------*/ - /* Check if there's uncompleted transfer on this endpoint... */ - /* Prepare ED */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - - /* Check if there's any transfer pending on this endpoint... */ - ed = (ED_T *)_ohci->HcBulkHeadED; /* get the head of bulk endpoint list */ - while (ed != NULL) - { - if (ed->Info == info) /* have transfer of this EP not completed? */ - { - if ((ed->HeadP & 0xFFFFFFF0) != (ed->TailP & 0xFFFFFFF0)) - return USBH_ERR_OHCI_EP_BUSY; /* endpoint is busy */ - else - break; /* ED already there... */ - } - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ED_debug("Link BULK ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - } - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - utr->td_cnt = 0; - data_len = utr->data_len; - buff = utr->buff; - - do - { - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_BULK); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_BULK); - - info &= ~(1 << 25); /* Data toggle from ED toggleCarry bit */ - - if (data_len > 4096) /* maximum transfer length is 4K for each TD */ - xfer_len = 4096; - else - xfer_len = data_len; /* remaining data length < 4K */ - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - write_td(td, info, buff, xfer_len); - td->ed = ed; - - utr->td_cnt++; /* increase TD count, for recalim counter */ - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - /* chain to end of TD list */ - if (td_list == NULL) - { - td_list = td; - } - else - { - td_p = td_list; - while (td_p->NextTD != 0) - td_p = (TD_T *)td_p->NextTD; - td_p->NextTD = (uint32_t)td; - } - - } - while (data_len > 0); - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - if (bIsNewED) - { - ed->HeadP = (uint32_t)td_list; - /* Link ED to OHCI Bulk List */ - ed->NextED = _ohci->HcBulkHeadED; - _ohci->HcBulkHeadED = (uint32_t)ed; - } - ENABLE_OHCI_IRQ(); - _ohci->HcControl |= USBH_HcControl_BLE_Msk; /* enable bulk list */ - _ohci->HcCommandStatus = USBH_HcCommandStatus_BLF_Msk; /* start bulk list */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static int ohci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_new; - uint32_t info; - int8_t bIsNewED = 0; - - if (utr->data_len > 64) /* USB 1.1 interrupt transfer maximum packet size is 64 */ - return USBH_ERR_INVALID_PARAM; - - td_new = alloc_ohci_TD(utr); /* allocate a TD for dummy TD */ - if (td_new == NULL) - return USBH_ERR_MEMORY_OUT; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - - td = alloc_ohci_TD(NULL); /* allocate the initial dummy TD for ED */ - if (td == NULL) - { - free_ohci_ED(ed); - free_ohci_TD(td_new); - return USBH_ERR_MEMORY_OUT; - } - ed->HeadP = (uint32_t)td; /* Let both HeadP and TailP point to dummy TD */ - ed->TailP = ed->HeadP; - } - else - { - td = (TD_T *)(ed->TailP & ~0xf); /* TailP always point to the dummy TD */ - } - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TD */ - /*------------------------------------------------------------------------------------*/ - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_INT); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_INT); - - /* Keep data toggle */ - info = (info & ~(1 << 25)) | (td->Info & (1 << 25)); - - /* fill this TD */ - write_td(td, info, utr->buff, utr->data_len); - td->ed = ed; - td->NextTD = (uint32_t)td_new; - td->utr = utr; - utr->td_cnt = 1; /* increase TD count, for recalim counter */ - utr->status = 0; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - - ed->TailP = (uint32_t)td_new; - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - - //printf("Link INT ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - _ohci->HcControl |= USBH_HcControl_PLE_Msk; /* periodic list enable */ - return 0; -} - -static int ohci_iso_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_list, *last_td; - int i; - uint32_t info; - uint32_t buff_addr; - int8_t bIsNewED = 0; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - } - else - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - if (utr->bIsoNewSched) /* Is the starting of isochronous streaming? */ - ed->next_sf = _hcca->frame_no + OHCI_ISO_DELAY; - - utr->td_cnt = 0; - utr->iso_sf = ed->next_sf; - - last_td = NULL; - td_list = NULL; - - for (i = 0; i < IF_PER_UTR; i++) - { - utr->iso_status[i] = USBH_ERR_NOT_ACCESS1; - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - buff_addr = (uint32_t)(utr->iso_buff[i]); - td->Info = (TD_CC | TD_TYPE_ISO) | ed->next_sf; - ed->next_sf += get_ohci_interval(ed->bInterval); - td->CBP = buff_addr & ~0xFFF; - td->BE = buff_addr + utr->iso_xlen[i] - 1; - td->PSW[0] = 0xE000 | (buff_addr & 0xFFF); - - td->ed = ed; - utr->td_cnt++; /* increase TD count, for recalim counter */ - - /* chain to end of TD list */ - if (td_list == NULL) - td_list = td; - else - last_td->NextTD = (uint32_t)td; - - last_td = td; - }; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - - if ((ed->HeadP & ~0x3) == 0) - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - else - { - /* find the tail of TDs under this ED */ - td = (TD_T *)(ed->HeadP & ~0x3); - while (td->NextTD != 0) - { - td = (TD_T *)td->NextTD; - } - td->NextTD = (uint32_t)td_list; - } - - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - ED_debug("Link ISO ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - _ohci->HcControl |= USBH_HcControl_PLE_Msk | USBH_HcControl_IE_Msk; /* enable periodic list and isochronous transfer */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static UDEV_T *ohci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && - ((udev->speed == SPEED_LOW) || (udev->speed == SPEED_FULL))) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ohci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_PRS_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) - { - /* - * If device is disconnected or port enabled, we can stop port reset. - */ - if (((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) || - ((_ohci->HcRhPortStatus[port] & (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk)) == (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("OHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - return USBH_OK; /* port reset success */ -} - -static int ohci_rh_polling(void) -{ - int i, change = 0; - UDEV_T *udev; - int ret; - - for (i = 0; i < OHCI_PORT_CNT; i++) - { - /* clear unwanted port change status */ - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_OCIC_Msk | USBH_HcRhPortStatus_PRSC_Msk | - USBH_HcRhPortStatus_PSSC_Msk | USBH_HcRhPortStatus_PESC_Msk; - - if ((_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CSC_Msk) == 0) - continue; - rt_kprintf("OHCI port%d status change: 0x%x\n", i + 1, _ohci->HcRhPortStatus[i]); - - /*--------------------------------------------------------------------------------*/ - /* connect status change */ - /*--------------------------------------------------------------------------------*/ - - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* First of all, check if there's any previously connected device. */ - /*----------------------------------------------------------------------------*/ - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - rt_kprintf("OHCI connect device.\n"); - - if (ohci_rh_port_reset(i) != USBH_OK) - continue; - - /* - * Port reset success... - */ - udev = alloc_device(); - if (udev == NULL) - continue; - - udev->parent = NULL; - udev->port_num = i + 1; - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_LSDA_Msk) - udev->speed = SPEED_LOW; - else - udev->speed = SPEED_FULL; - udev->hc_driver = &ohci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - - change = 1; - } - else - { - /* - * Device disconnected - */ - rt_kprintf("OHCI disconnect device.\n"); - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - change = 1; - } - } - return change; -} - -void td_done(TD_T *td) -{ - UTR_T *utr = td->utr; - uint32_t info; - int cc; - - info = td->Info; - - TD_debug("td_done: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->NextTD, td->BE); - - /* ISO ... drivers see per-TD length/status */ - if ((info & TD_TYPE_Msk) == TD_TYPE_ISO) - { - uint16_t sf; - int idx; - - sf = info & 0xFFFF; - idx = ((sf + 0x10000 - utr->iso_sf) & 0xFFFF) / get_ohci_interval(td->ed->bInterval); - if (idx >= IF_PER_UTR) - { - USB_error("ISO invalid index!! %d, %d\n", sf, utr->iso_sf); - goto td_out; - } - - cc = (td->PSW[0] >> 12) & 0xF; - if (cc == 0xF) /* this frame was not transferred */ - { - USB_debug("ISO F %d N/A!\n", sf); - utr->iso_status[idx] = USBH_ERR_SCH_OVERRUN; - goto td_out; - } - if ((cc != 0) && (cc != CC_DATA_UNDERRUN)) - { - utr->iso_status[idx] = USBH_ERR_CC_NO_ERR - cc; - goto td_out; - } - utr->iso_status[idx] = 0; - utr->iso_xlen[idx] = td->PSW[0] & 0x7FF; - } - else - { - cc = TD_CC_GET(info); - - /* short packet is fine */ - if ((cc != CC_NOERROR) && (cc != CC_DATA_UNDERRUN)) - { - USB_error("TD error, CC = 0x%x\n", cc); - if (cc == CC_STALL) - utr->status = USBH_ERR_STALL; - else - utr->status = USBH_ERR_TRANSFER; - } - - switch (info & TD_TYPE_Msk) - { - case TD_TYPE_CTRL: - if (info & TD_CTRL_DATA) - { - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - } - break; - - case TD_TYPE_BULK: - case TD_TYPE_INT: - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - break; - } - } - -td_out: - - utr->td_cnt--; - - /* If all TDs are done, call-back to requester. */ - if (utr->td_cnt == 0) - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } -} - -/* in IRQ context */ -static void remove_ed() -{ - ED_T *ed, *ed_p, *ied; - TD_T *td, *td_next; - UTR_T *utr; - int found; - - while (ed_remove_list != NULL) - { - ED_debug("Remove ED: 0x%x, %d\n", (int)ed_remove_list, ed_remove_list->bInterval); - ed_p = ed_remove_list; - found = 0; - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Control List if found */ - /*--------------------------------------------------------------------------------*/ - if ((ed_p->Info & ED_EP_ADDR_Msk) == 0) - { - if (_ohci->HcControlHeadED == (uint32_t)ed_p) - { - _ohci->HcControlHeadED = (uint32_t)ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcControlHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove INT or ISO endpoint from HCCA interrupt table */ - /*--------------------------------------------------------------------------------*/ - else if (ed_p->bInterval > 0) - { - ied = get_int_tree_head_node(ed_p->bInterval); - - ed = ied; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - break; - } - ed = (ED_T *)ed->NextED; - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Bulk List if found */ - /*--------------------------------------------------------------------------------*/ - else - { - if (_ohci->HcBulkHeadED == (uint32_t)ed_p) - { - ed = (ED_T *)ed_p; - _ohci->HcBulkHeadED = ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcBulkHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove and free all TDs under this endpoint */ - /*--------------------------------------------------------------------------------*/ - if (found) - { - td = (TD_T *)(ed_p->HeadP & ~0x3); - if (td != NULL) - { - while (td != NULL) - { - utr = td->utr; - td_next = (TD_T *)td->NextTD; - free_ohci_TD(td); - td = td_next; - - utr->td_cnt--; - if (utr->td_cnt == 0) - { - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - } - } - } - - /* - * Done. Remove this ED from [ed_remove_list] and free it. - */ - ed_remove_list = ed_p->next; - free_ohci_ED(ed_p); - } -} - - -//static irqreturn_t ohci_irq (struct usb_hcd *hcd) -//void OHCI_IRQHandler(void) -void nu_ohci_isr(int vector, void *param) -{ - TD_T *td, *td_prev, *td_next; - uint32_t int_sts; - - //if ( nu_sys_usb0_role() != USB0_ID_HOST ) return; - - int_sts = _ohci->HcInterruptStatus; - - //USB_debug("ohci int_sts = 0x%x\n", int_sts); - - if ((_ohci->HcInterruptEnable & USBH_HcInterruptEnable_SF_Msk) && - (int_sts & USBH_HcInterruptStatus_SF_Msk)) - { - int_sts &= ~USBH_HcInterruptStatus_SF_Msk; - - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_SF_Msk; - remove_ed(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - } - - if (int_sts & USBH_HcInterruptStatus_WDH_Msk) - { - int_sts &= ~USBH_HcInterruptStatus_WDH_Msk; - /* - * reverse done list - */ - td = (TD_T *)(_hcca->done_head & TD_ADDR_MASK); - _hcca->done_head = 0; - td_prev = NULL; - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_WDH_Msk; - - while (td != NULL) - { - //TD_debug("Done list TD 0x%x => 0x%x\n", (int)td, (int)td->NextTD); - td_next = (TD_T *)(td->NextTD & TD_ADDR_MASK); - td->NextTD = (uint32_t)td_prev; - td_prev = td; - td = td_next; - } - td = td_prev; /* first TD of the reversed done list */ - - /* - * reclaim TDs - */ - while (td != NULL) - { - TD_debug("Reclaim TD 0x%x, next 0x%x\n", (int)td, td->NextTD); - td_next = (TD_T *)td->NextTD; - td_done(td); - free_ohci_TD(td); - td = td_next; - } - } - - if (int_sts & USBH_HcInterruptStatus_RHSC_Msk) - { - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_RHSC_Msk; - } - - _ohci->HcInterruptStatus = int_sts; -} - -#ifdef ENABLE_DEBUG_MSG - -void dump_ohci_int_table() -{ - int i; - ED_T *ed; - - for (i = 0; i < 32; i++) -// for (i = 0; i < 1; i++) - - { - USB_debug("%02d: ", i); - - ed = (ED_T *)_hcca->int_table[i]; - - while (ed != NULL) - { - USB_debug("0x%x (0x%x) => ", (int)ed, ed->HeadP); - ed = (ED_T *)ed->NextED; - } - rt_kprintf("0\n"); - } -} - -void dump_ohci_regs() -{ - USB_debug("Dump OCHI registers:\n"); - USB_debug(" HcRevision = 0x%x\n", _ohci->HcRevision); - USB_debug(" HcControl = 0x%x\n", _ohci->HcControl); - USB_debug(" HcCommandStatus = 0x%x\n", _ohci->HcCommandStatus); - USB_debug(" HcInterruptStatus = 0x%x\n", _ohci->HcInterruptStatus); - USB_debug(" HcInterruptEnable = 0x%x\n", _ohci->HcInterruptEnable); - USB_debug(" HcInterruptDisable = 0x%x\n", _ohci->HcInterruptDisable); - USB_debug(" HcHCCA = 0x%x\n", _ohci->HcHCCA); - USB_debug(" HcPeriodCurrentED = 0x%x\n", _ohci->HcPeriodCurrentED); - USB_debug(" HcControlHeadED = 0x%x\n", _ohci->HcControlHeadED); - USB_debug(" HcControlCurrentED = 0x%x\n", _ohci->HcControlCurrentED); - USB_debug(" HcBulkHeadED = 0x%x\n", _ohci->HcBulkHeadED); - USB_debug(" HcBulkCurrentED = 0x%x\n", _ohci->HcBulkCurrentED); - USB_debug(" HcDoneHead = 0x%x\n", _ohci->HcDoneHead); - USB_debug(" HcFmInterval = 0x%x\n", _ohci->HcFmInterval); - USB_debug(" HcFmRemaining = 0x%x\n", _ohci->HcFmRemaining); - USB_debug(" HcFmNumber = 0x%x\n", _ohci->HcFmNumber); - USB_debug(" HcPeriodicStart = 0x%x\n", _ohci->HcPeriodicStart); - USB_debug(" HcLSThreshold = 0x%x\n", _ohci->HcLSThreshold); - USB_debug(" HcRhDescriptorA = 0x%x\n", _ohci->HcRhDescriptorA); - USB_debug(" HcRhDescriptorB = 0x%x\n", _ohci->HcRhDescriptorB); - USB_debug(" HcRhStatus = 0x%x\n", _ohci->HcRhStatus); - USB_debug(" HcRhPortStatus0 = 0x%x\n", _ohci->HcRhPortStatus[0]); - USB_debug(" HcRhPortStatus1 = 0x%x\n", _ohci->HcRhPortStatus[1]); - USB_debug(" HcPhyControl = 0x%x\n", _ohci->HcPhyControl); - USB_debug(" HcMiscControl = 0x%x\n", _ohci->HcMiscControl); -} - -void dump_ohci_ports() -{ - USB_debug("_ohci port0=0x%x, port1=0x%x\n", _ohci->HcRhPortStatus[0], _ohci->HcRhPortStatus[1]); -} - -#endif // ENABLE_DEBUG_MSG - -HC_DRV_T ohci_driver = -{ - ohci_init, /* init */ - ohci_shutdown, /* shutdown */ - ohci_suspend, /* suspend */ - ohci_resume, /* resume */ - ohci_ctrl_xfer, /* ctrl_xfer */ - ohci_bulk_xfer, /* bulk_xfer */ - ohci_int_xfer, /* int_xfer */ - ohci_iso_xfer, /* iso_xfer */ - ohci_quit_xfer, /* quit_xfer */ - ohci_rh_port_reset, /* rthub_port_reset */ - ohci_rh_polling /* rthub_polling */ -}; - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/support.c b/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/support.c deleted file mode 100644 index 45f2a986f54..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/support.c +++ /dev/null @@ -1,282 +0,0 @@ -/**************************************************************************//** - * @file support.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief Functions to support USB host driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" - -/// @cond HIDDEN_SYMBOLS - - -#define USB_MEMORY_POOL_SIZE (32*1024) -#define USB_MEM_BLOCK_SIZE 128 - -#define BOUNDARY_WORD 4 - - -static uint32_t _FreeMemorySize; -uint32_t _AllocatedMemorySize; - - -#define USB_MEM_ALLOC_MAGIC 0x19685788 /* magic number in leading block */ - -typedef struct USB_mhdr -{ - uint32_t flag; /* 0:free, 1:allocated, 0x3:first block */ - uint32_t bcnt; /* if allocated, the block count of allocated memory block */ - uint32_t magic; - uint32_t reserved; -} USB_MHDR_T; - -uint8_t _USBMemoryPool[USB_MEMORY_POOL_SIZE] __attribute__((aligned(USB_MEM_BLOCK_SIZE))); - - -static USB_MHDR_T *_pCurrent; -uint32_t *_USB_pCurrent = (uint32_t *) &_pCurrent; - -static uint32_t _MemoryPoolBase, _MemoryPoolEnd; - - -void USB_InitializeMemoryPool() -{ - _MemoryPoolBase = (uint32_t)&_USBMemoryPool[0] | NON_CACHE_MASK; - _MemoryPoolEnd = _MemoryPoolBase + USB_MEMORY_POOL_SIZE; - _FreeMemorySize = _MemoryPoolEnd - _MemoryPoolBase; - _AllocatedMemorySize = 0; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; - memset((char *)_MemoryPoolBase, 0, _FreeMemorySize); -} - - -int USB_available_memory() -{ - return _FreeMemorySize; -} - - -int USB_allocated_memory() -{ - return _AllocatedMemorySize; -} - - -void *USB_malloc(int wanted_size, int boundary) -{ -#if 0 - void *paddr = rt_malloc_align(wanted_size, 32); - return (void *)((uint32_t)paddr | NON_CACHE_MASK); -#else - USB_MHDR_T *pPrimitivePos = _pCurrent; - USB_MHDR_T *pFound; - int found_size = -1; - int i, block_count; - int wrap = 0; - void *pvBuf = NULL; - rt_base_t level; - - level = rt_hw_interrupt_disable(); - - if (wanted_size >= _FreeMemorySize) - { - rt_kprintf("USB_malloc - want=%d, free=%d\n", wanted_size, _FreeMemorySize); - goto exit_USB_malloc; - } - - - if ((uint32_t)_pCurrent >= _MemoryPoolEnd) - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - - do - { - if (_pCurrent->flag) /* is not a free block */ - { - if (_pCurrent->magic != USB_MEM_ALLOC_MAGIC) - { - rt_kprintf("\nUSB_malloc - incorrect magic number! C:%x F:%x, wanted:%d, Base:0x%x, End:0x%x\n", (uint32_t)_pCurrent, _FreeMemorySize, wanted_size, (uint32_t)_MemoryPoolBase, (uint32_t)_MemoryPoolEnd); - goto exit_USB_malloc; - } - - if (_pCurrent->flag == 0x3) - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + _pCurrent->bcnt * USB_MEM_BLOCK_SIZE); - else - { - rt_kprintf("USB_malloc warning - not the first block!\n"); - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - } - - if ((uint32_t)_pCurrent > _MemoryPoolEnd) - rt_kprintf("USB_malloc - behind limit!!\n"); - - if ((uint32_t)_pCurrent == _MemoryPoolEnd) - { - //rt_kprintf("USB_alloc - warp!!\n"); - wrap = 1; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - } - - found_size = -1; /* reset the accumlator */ - } - else /* is a free block */ - { - if (found_size == -1) /* the leading block */ - { - pFound = _pCurrent; - block_count = 1; - - if (boundary > BOUNDARY_WORD) - found_size = 0; /* not use the data area of the leading block */ - else - found_size = USB_MEM_BLOCK_SIZE - sizeof(USB_MHDR_T); - - /* check boundary - - * If boundary > BOUNDARY_WORD, the start of next block should - * be the beginning address of allocated memory. Thus, we check - * the boundary of the next block. The leading block will be - * used as a header only. - */ - if ((boundary > BOUNDARY_WORD) && - ((((uint32_t)_pCurrent) + USB_MEM_BLOCK_SIZE >= _MemoryPoolEnd) || - ((((uint32_t)_pCurrent) + USB_MEM_BLOCK_SIZE) % boundary != 0))) - found_size = -1; /* violate boundary, reset the accumlator */ - } - else /* not the leading block */ - { - found_size += USB_MEM_BLOCK_SIZE; - block_count++; - } - - if (found_size >= wanted_size) - { - pFound->bcnt = block_count; - pFound->magic = USB_MEM_ALLOC_MAGIC; - _FreeMemorySize -= block_count * USB_MEM_BLOCK_SIZE; - _AllocatedMemorySize += block_count * USB_MEM_BLOCK_SIZE; - _pCurrent = pFound; - for (i = 0; i < block_count; i++) - { - _pCurrent->flag = 1; /* allocate block */ - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - } - pFound->flag = 0x3; - - if (boundary > BOUNDARY_WORD) - { - pvBuf = (void *)((uint32_t)pFound + USB_MEM_BLOCK_SIZE); - goto exit_USB_malloc; - } - else - { - //USB_debug("USB_malloc(%d,%d):%x\tsize:%d, C:0x%x, %d\n", wanted_size, boundary, (uint32_t)pFound + sizeof(USB_MHDR_T), block_count * USB_MEM_BLOCK_SIZE, _pCurrent, block_count); - pvBuf = (void *)((uint32_t)pFound + sizeof(USB_MHDR_T)); - goto exit_USB_malloc; - } - } - - /* advance to the next block */ - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - if ((uint32_t)_pCurrent >= _MemoryPoolEnd) - { - wrap = 1; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - found_size = -1; /* reset accumlator */ - } - } - } - while ((wrap == 0) || (_pCurrent < pPrimitivePos)); - - rt_kprintf("USB_malloc - No free memory!\n"); - -exit_USB_malloc: - - rt_hw_interrupt_enable(level); - - return pvBuf; -#endif - -} - -void USB_free(void *alloc_addr) -{ -#if 0 - rt_free_align((void *)((uint32_t)alloc_addr & ~NON_CACHE_MASK)); -#else - USB_MHDR_T *pMblk; - uint32_t addr = (uint32_t)alloc_addr; - int i, count; - rt_base_t level; - - //rt_kprintf("USB_free: 0x%x\n", (int)alloc_addr); - - level = rt_hw_interrupt_disable(); - - if ((addr < _MemoryPoolBase) || (addr >= _MemoryPoolEnd)) - { - if (addr) - { - rt_kprintf("[%s]Wrong!!\n", __func__); - } - goto Exit_USB_free; - } - - //rt_kprintf("USB_free:%x\n", (int32_t)addr+USB_MEM_BLOCK_SIZE); - - /* get the leading block address */ - if (addr % USB_MEM_BLOCK_SIZE == 0) - addr -= USB_MEM_BLOCK_SIZE; - else - addr -= sizeof(USB_MHDR_T); - - if (addr % USB_MEM_BLOCK_SIZE != 0) - { - rt_kprintf("USB_free fatal error on address: %x!!\n", (uint32_t)alloc_addr); - goto Exit_USB_free; - } - - pMblk = (USB_MHDR_T *)addr; - if (pMblk->flag == 0) - { - rt_kprintf("USB_free(), warning - try to free a free block: %x\n", (uint32_t)alloc_addr); - goto Exit_USB_free; - } - if (pMblk->magic != USB_MEM_ALLOC_MAGIC) - { - rt_kprintf("USB_free(), warning - try to free an unknow block at address:%x.\n", addr); - goto Exit_USB_free; - } - - //_pCurrent = pMblk; - - //rt_kprintf("+ 0x%x, %d\n", (int)pMblk, pMblk->bcnt); - - count = pMblk->bcnt; - for (i = 0; i < count; i++) - { - pMblk->flag = 0; /* release block */ - pMblk = (USB_MHDR_T *)((uint32_t)pMblk + USB_MEM_BLOCK_SIZE); - } - - _FreeMemorySize += count * USB_MEM_BLOCK_SIZE; - _AllocatedMemorySize -= count * USB_MEM_BLOCK_SIZE; - - -Exit_USB_free: - - rt_hw_interrupt_enable(level); -#endif - return; -} - - -/// @endcond HIDDEN_SYMBOLS - diff --git a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/usb_core.c b/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/usb_core.c deleted file mode 100644 index fe09cc12ff0..00000000000 --- a/bsp/nuvoton/libraries/n9h30/UsbHostLib/src/usb_core.c +++ /dev/null @@ -1,312 +0,0 @@ -/**************************************************************************//** - * @file usb_core.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB Host library core. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -USBH_T *_ohci; -HSUSBH_T *_ehci; - -static UDEV_DRV_T *_drivers[MAX_UDEV_DRIVER]; - -static CONN_FUNC *g_conn_func, *g_disconn_func; - - -//extern void EHCI_IRQHandler(void); -//extern void OHCI_IRQHandler(void); -extern void nu_ohci_isr(int vector, void *param); -extern void nu_ehci_isr(int vector, void *param); - - -/// @endcond HIDDEN_SYMBOLS - - -/** - * @brief Initialize NUC980 USB Host controller and USB stack. - * - * @return None. - */ -void usbh_core_init() -{ - DISABLE_EHCI_IRQ(); - DISABLE_OHCI_IRQ(); - - _ohci = USBH; - _ehci = HSUSBH; - - memset(_drivers, 0, sizeof(_drivers)); - - g_conn_func = NULL; - g_disconn_func = NULL; - -// usbh_hub_init(); - - _ehci->USBPCR0 = 0x160; /* enable PHY 0 */ - _ehci->USBPCR1 = 0x520; /* enable PHY 1 */ - usbh_memory_init(); - - //_ohci->HcMiscControl |= USBH_HcMiscControl_OCAL_Msk; /* Over-current active low */ - _ohci->HcMiscControl &= ~USBH_HcMiscControl_OCAL_Msk; /* Over-current active high */ - -#ifdef ENABLE_OHCI - //sysInstallISR(IRQ_LEVEL_1, IRQ_OHCI, (PVOID)OHCI_IRQHandler); - rt_hw_interrupt_install(IRQ_OHCI, nu_ohci_isr, NULL, "ohci"); - //rt_hw_interrupt_set_priority(IRQ_OHCI, IRQ_LEVEL_1); - - ohci_driver.init(); - ENABLE_OHCI_IRQ(); -#endif - -#ifdef ENABLE_EHCI - //sysInstallISR(IRQ_LEVEL_1, IRQ_EHCI, (PVOID)EHCI_IRQHandler); - rt_hw_interrupt_install(IRQ_EHCI, nu_ehci_isr, NULL, "ehci"); - //rt_hw_interrupt_set_priority(IRQ_EHCI, IRQ_LEVEL_1); - - ehci_driver.init(); - ENABLE_EHCI_IRQ(); -#endif -} - - -/** - * @brief Let USB stack polls all root hubs. If there's any hub port - * change found, USB stack will manage the hub events in this function call. - * In this function, USB stack enumerates newly connected devices and remove staff - * of disconnected devices. User's application should periodically invoke this - * function. - * @return There's hub port change or not. - * @retval 0 No any hub port status changes found. - * @retval 1 There's hub port status changes. - */ -int usbh_polling_root_hubs(void) -{ - int ret, change = 0; - -#ifdef ENABLE_EHCI - do - { - ret = ehci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); - - // scan_isochronous_list(); - -#endif - -#ifdef ENABLE_OHCI - do - { - ret = ohci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - - return change; -} - -/** - * @brief Force to quit an endpoint transfer. - * @param[in] udev The USB device. - * @param[in] ep The endpoint to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep) -{ - return udev->hc_driver->quit_xfer(NULL, ep); -} - - -int usbh_connect_device(UDEV_T *udev) -{ - usbh_delay_ms(100); /* initially, give 100 ms delay */ - - if (g_conn_func) - g_conn_func(udev, 0); - - return 0; -} - - -void usbh_disconnect_device(UDEV_T *udev) -{ - USB_debug("disconnect device...\n"); - - if (g_disconn_func) - g_disconn_func(udev, 0); - - -#if 1 //CHECK: Maybe create a new API to quit_xfer and free udev for application - usbh_quit_xfer(udev, &(udev->ep0)); /* Quit control transfer if hw_pipe is not NULL. */ - - /* remove device from global device list */ -// free_dev_address(udev->dev_num); - free_device(udev); - -// usbh_memory_used(); -#endif -} - -/** - * @brief Install device connect and disconnect callback function. - * - * @param[in] conn_func Device connect callback function. - * @param[in] disconn_func Device disconnect callback function. - * @return None. - */ -void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func) -{ - g_conn_func = conn_func; - g_disconn_func = disconn_func; -} - -int usbh_reset_port(UDEV_T *udev) -{ - if (udev->parent == NULL) - { - if (udev->hc_driver) - return udev->hc_driver->rthub_port_reset(udev->port_num - 1); - else - return USBH_ERR_NOT_FOUND; - } - else - { - return udev->parent->port_reset(udev->parent, udev->port_num); - } -} - - -/** - * @brief Force to quit an UTR transfer. - * @param[in] utr The UTR transfer to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_utr(UTR_T *utr) -{ - if (!utr || !utr->udev) - return USBH_ERR_NOT_FOUND; - - return utr->udev->hc_driver->quit_xfer(utr, NULL); -} - - -/** - * @brief Execute an USB request in control transfer. This function returns after the request - * was done or aborted. - * @param[in] udev The target USB device. - * @param[in] bmRequestType Characteristics of request - * @param[in] bRequest Specific request - * @param[in] wValue Word-sized field that varies according to request - * @param[in] wIndex Word-sized field that varies according to request - * @param[in] wLength Number of bytes to transfer if there is a Data stage - * @param[in] buff Data buffer used in data stage - * @param[out] xfer_len Transmitted/received length of data - * @param[in] timeout Time-out limit (in 10ms - timer tick) of this transfer - * @retval 0 Transfer success - * @retval < 0 Transfer failed. Refer to error code definitions. - */ -int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, - uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout) -{ - UTR_T *utr; - uint32_t t0, timeout_tick; - int status; - - *xfer_len = 0; - - //if (check_device(udev)) - // return USBH_ERR_INVALID_PARAM; - - utr = alloc_utr(udev); - if (utr == NULL) - return USBH_ERR_MEMORY_OUT; - - utr->setup.bmRequestType = bmRequestType; - utr->setup.bRequest = bRequest; - utr->setup.wValue = wValue; - utr->setup.wIndex = wIndex; - utr->setup.wLength = wLength; - - utr->buff = buff; - utr->data_len = wLength; - utr->bIsTransferDone = 0; - status = udev->hc_driver->ctrl_xfer(utr); - if (status < 0) - { - udev->ep0.hw_pipe = NULL; - free_utr(utr); - return status; - } - - timeout_tick = usbh_tick_from_millisecond(timeout); - t0 = usbh_get_ticks(); - while (utr->bIsTransferDone == 0) - { - if (usbh_get_ticks() - t0 > timeout_tick) - { - usbh_quit_utr(utr); - free_utr(utr); - udev->ep0.hw_pipe = NULL; - return USBH_ERR_TIMEOUT; - } - } - - status = utr->status; - - if (status == 0) - { - *xfer_len = utr->xfer_len; - } - free_utr(utr); - - return status; -} - -/** - * @brief Execute a bulk transfer request. This function will return immediately after - * issued the bulk transfer. USB stack will later call back utr->func() once the bulk - * transfer was done or aborted. - * @param[in] utr The bulk transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_bulk_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->bulk_xfer(utr); -} - -/** - * @brief Execute an interrupt transfer request. This function will return immediately after - * issued the interrupt transfer. USB stack will later call back utr->func() once the - * interrupt transfer was done or aborted. - * @param[in] utr The interrupt transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_int_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->int_xfer(utr); -} - - diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig b/bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig index ba9697f2564..aab564422ef 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig @@ -4,6 +4,7 @@ config SOC_SERIES_N9H30 select SOC_FAMILY_NUMICRO select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN + select PKG_USING_NUVOTON_ARM926_LIB default y config BSP_USE_STDDRIVER_SOURCE diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/NuMicro.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/NuMicro.h deleted file mode 100644 index ce6086255ba..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/NuMicro.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************//** - * @file NuMicro.h - * @version V1.00 - * @brief NuMicro peripheral access layer header file. - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NUMICRO_H__ -#define __NUMICRO_H__ - -#include "nuc980.h" -#include "nu_adc.h" -#include "nu_uart.h" -#include "nu_spi.h" -#include "nu_qspi.h" -#include "nu_i2c.h" -#include "nu_pdma.h" -#include "nu_etimer.h" -#include "nu_emac.h" -#include "nu_sdh.h" -#include "nu_gpio.h" -#include "nu_rtc.h" -#include "nu_wdt.h" -#include "nu_ebi.h" -#include "nu_scuart.h" -#include "nu_pwm.h" -#include "nu_crypto.h" -#include "nu_can.h" -#include "nu_i2s.h" -#include "nu_usbd.h" - -#include "nu_sys.h" - -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif - -#ifndef __CLZ - #if defined(__CC_ARM) - #define __CLZ __clz - #else - #define __CLZ __builtin_clz - #endif -#endif - -#endif /* __NUMICRO_H__ */ - - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/adc_reg.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/adc_reg.h deleted file mode 100644 index 4637bb5d190..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/adc_reg.h +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************//** - * @file adc.h - * @brief ADC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2020~2021 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __ADC_REG_H__ -#define __ADC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup ADC Analog to Digital Converter(ADC) - Memory Mapped Structure for ADC Controller -@{ */ - -typedef struct -{ - - - /** - * @var ADC_T::CTL - * Offset: 0x00 ADC Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ADEN |ADC Power Control - * | | |0 = Power down ADC. - * | | |1 = Power on ADC. - * |[8] |MST |Menu Start Conversion - * | | |0 = Functional menu not started. - * | | |1 = Start all enable bit in ADC_CONF register. - * | | |Note: This bit is set by software and cleared by hardware when all the tasks listed in ADC_CONF are done. - * |[9] |PEDEEN |Pen Down Event Enable Bit - * | | |0 = Pen down event interrupt Disabled. - * | | |1 = Pen down event interrupt Enabled. - * |[11] |WKTEN |Touch Wake Up Enable Bit - * | | |0 = Touch wake-up Disabled. - * | | |1 = Touch wake-up Enabled. - * |[16] |WMSWCH |Wire Mode Switch for 5-wire/4-wire Configuration - * | | |0 = 4-wire mode. - * | | |1 = 5-wire mode. - * @var ADC_T::CONF - * Offset: 0x04 ADC Configure - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TEN |Touch Detection Enable Bit - * | | |0 = Touch detection function Disabled. - * | | |1 = Touch detection function Enabled. - * |[1] |ZEN |Press Measure Enable Bit - * | | |1 = Press measure function Disabled. - * | | |1 = Press measure function Enabled. - * |[2] |NACEN |Normal A/D Conversion Enable Bit - * | | |ADC normal conversion function enable - * | | |0 = Normal A/D Conversion Disabled. - * | | |1 = Normal A/D Conversion Enabled. - * |[7:6] |REFSEL |ADC Reference Select - * | | |ADC reference voltage select when ADC operate in normal conversion. - * | | |00 = AGND33 vs VREF input. - * | | |01 = YM vs YP. - * | | |10 = XM vs XP. - * | | |11 = AGND33 vs AVDD33. - * |[14:12] |CHSEL |Channel Selection - * | | |ADC input channel selection. - * | | |000 = VREF. - * | | |001 = A1. - * | | |010 = A2. - * | | |011 = VSENSE. - * | | |100 = YM. - * | | |101 = YP. - * | | |110 = XM. - * | | |111 = XP. - * |[20] |TMAVDIS |Display T Mean Average Disable Bit - * | | |Touch mean average for X and Y function disable bit. - * | | |0 = Touch mean average for X and Y function Enabled. - * | | |1 = Touch mean average for X and Y function Disabled. - * |[21] |ZMAVDIS |Display Z Mean Average Disable Bit - * | | |Pressure mean average for Z1 and Z2 function disable bit. - * | | |0 = Pressure mean average for Z1 and Z2 function Enabled. - * | | |1 = Pressure mean average for Z1 and Z2 function Disabled. - * |[22] |SPEED |Speed Mode Selection - * | | |0 = All ADC channels set to high speed mode. - * | | |1 = All ADC channels set to low speed mode. - * @var ADC_T::IER - * Offset: 0x08 ADC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MIEN |Menu Interrupt Enable Bit - * | | |Function menu complete interrupt enable. - * | | |0 = Menu interrupt Disabled. - * | | |1 = Menu interrupt Enabled. - * |[2] |PEDEIEN |Pen Down Event Interrupt Enable Bit - * | | |0 = Pen down event detection interrupt Disabled. - * | | |1 = Pen down event detection interrupt Enabled. - * |[3] |WKTIEN |Wake Up Touch Interrupt Enable Bit - * | | |0 = Wake up touch detection interrupt Disabled. - * | | |1 = Wake up touch detection interrupt Enabled. - * |[6] |PEUEIEN |Pen Up Event Interrupt Enable Bit - * | | |0 = Pen up event detection interrupt Disabled. - * | | |1 = Pen up event detection interrupt Enabled. - * @var ADC_T::ISR - * Offset: 0x0C ADC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |MF |Menu Complete Flag - * | | |Function menu complete status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[2] |PEDEF |Pen Down Event Flag - * | | |Pen down event status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[4] |PEUEF |Pen Up Event Flag - * | | |Pen up event status indicator. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[8] |TF |Touch Conversion Finish - * | | |Functional menu touch detection conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[9] |ZF |Press Conversion Finish - * | | |Functional menu press measure conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[10] |NACF |Normal AD Conversion Finish - * | | |Functional menu normal AD conversion finish. - * | | |Note: Set by hardware and write 1 to clear this bit. - * |[17] |INTTC |Interrupt Signal for Touch Screen Touching Detection - * | | |This signal is directly from analog macro without de-bouncing and can be used to determine the pen down touch event together with PEDEF (ADC_ISR[2]) flag. - * @var ADC_T::WKISR - * Offset: 0x10 ADC Wake-up interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |WPEDEF |Wake Up Pen Down Event Flag - * | | |Pen down event wake up status indicator. - * @var ADC_T::XYDATA - * Offset: 0x20 ADC Touch X,Y Position Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XDATA |ADC X Data - * | | |When TEN (ADC_CONF[0]) is set, the touch x-position will be stored in this register. - * | | |Note: If the TMAVDIS (ADC_CONF[20]) = 0, both x and y position are the results of the mean average of x and y in ADC_XYSORT0 ~ ADC_XYSORT3. - * |[27:16] |YDATA |ADC Y Data - * | | |When TEN (ADC_CONF[0]) is set, the touch y-position will be stored in this register. - * | | |Note: If the TMAVDIS (ADC_CONF[20]) = 0, both x and y position are the results of the mean average of x and y in ADC_XYSORT0 ~ ADC_XYSORT3. - * @var ADC_T::ZDATA - * Offset: 0x24 ADC Touch Z Pressure Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1DATA |ADC Z1 Data - * | | |When ZEN (ADC_CONF[1]) is set; the touch pressure measure Z1 will be stored in this register. - * | | |Note: If the ZMAVDIS (ADC_CONF[21]) = 0, both Z1 and Z2 data is the results of the mean average of Z1 and Z2 in ADC_ZSORT0 ~ ADC_ZSORT3. - * |[27:16] |Z2DATA |ADC Z2 Data - * | | |When ZEN (ADC_CONF[1]) is set; the touch pressure measure Z2 will be stored in this register. - * | | |Note: If the ZMAVDIS (ADC_CONF[21]) = 0, both Z1 and Z2 data is the results of the mean average of Z1 and Z2 in ADC_ZSORT0 ~ ADC_ZSORT3. - * @var ADC_T::DATA - * Offset: 0x28 ADC Normal Conversion Data - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ADCDATA |ADC Data - * | | |When NACEN (ADC_CONF[2]) is enabled, the AD converting result with corresponding channel is stored in this register. - * @var ADC_T::XYSORT0 - * Offset: 0x1F4 ADC Touch XY Position Mean Value Sort 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT0 |X Position Sort Data 0 - * | | |X position mean average sort data 0. - * |[27:16] |YSORT0 |Y Position Sort Data 0 - * | | |Y position mean average sort data 0. - * @var ADC_T::XYSORT1 - * Offset: 0x1F8 ADC Touch XY Position Mean Value Sort 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT1 |X Position Sort Data 1 - * | | |X position mean average sort data 1. - * |[27:16] |YSORT1 |Y Position Sort Data 1 - * | | |Y position mean average sort data 1. - * @var ADC_T::XYSORT2 - * Offset: 0x1FC ADC Touch XY Position Mean Value Sort 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT2 |X Position Sort Data 2 - * | | |X position mean average sort data 2. - * |[27:16] |YSORT2 |Y Position Sort Data 2 - * | | |Y position mean average sort data 2. - * @var ADC_T::XYSORT3 - * Offset: 0x200 ADC Touch XY Position Mean Value Sort 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |XSORT3 |X Position Sort Data 3 - * | | |X position mean average sort data 3. - * |[27:16] |YSORT3 |Y Position Sort Data 3 - * | | |Y position mean average sort data 3. - * @var ADC_T::ZSORT0 - * Offset: 0x204 ADC Touch Z Pressure Mean Value Sort 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT0 |Z1 Position Sort Data 0 - * | | |Z1 position Mean average sort data 0. - * |[27:16] |Z2SORT0 |Z2 Position Sort Data 0 - * | | |Z2 position Mean average sort data 0. - * @var ADC_T::ZSORT1 - * Offset: 0x208 ADC Touch Z Pressure Mean Value Sort 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT1 |Z1 Position Sort Data 1 - * | | |Z1 position Mean average sort data 1. - * |[27:16] |Z2SORT1 |Z2 Position Sort Data 1 - * | | |Z2 position Mean average sort data 1. - * @var ADC_T::ZSORT2 - * Offset: 0x20C ADC Touch Z Pressure Mean Value Sort 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT2 |Z1 Position Sort Data 2 - * | | |Z1 position Mean average sort data 2. - * |[27:16] |Z2SORT2 |Z2 Position Sort Data 2 - * | | |Z2 position Mean average sort data 2. - * @var ADC_T::ZSORT3 - * Offset: 0x210 ADC Touch Z Pressure Mean Value Sort 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |Z1SORT3 |Z1 Position Sort Data 3 - * | | |Z1 position Mean average sort data 3. - * |[27:16] |Z2SORT3 |Z2 Position Sort Data 3 - * | | |Z2 position Mean average sort data 3. - */ - __IO uint32_t CTL; /*!< [0x0000] ADC Control */ - __IO uint32_t CONF; /*!< [0x0004] ADC Configure */ - __IO uint32_t IER; /*!< [0x0008] ADC Interrupt Enable Register */ - __IO uint32_t ISR; /*!< [0x000c] ADC Interrupt Status Register */ - __I uint32_t WKISR; /*!< [0x0010] ADC Wake-up interrupt Status Register */ - __I uint32_t RESERVE0[3]; - __I uint32_t XYDATA; /*!< [0x0020] ADC Touch X,Y Position Data */ - __I uint32_t ZDATA; /*!< [0x0024] ADC Touch Z Pressure Data */ - __I uint32_t DATA; /*!< [0x0028] ADC Normal Conversion Data */ - __I uint32_t RESERVE1[114]; - __I uint32_t XYSORT[4]; /*!< [0x01f4~0x0200] ADC Touch XY Position Mean Value Sort Register */ - __I uint32_t ZSORT0[4]; /*!< [0x0204~0x0210] ADC Touch Z Pressure Mean Value Sort Register */ - -} ADC_T; - -/** - @addtogroup ADC_CONST ADC Bit Field Definition - Constant Definitions for ADC Controller -@{ */ - -#define ADC_CTL_ADEN_Pos (0) /*!< ADC_T::CTL: ADEN Position */ -#define ADC_CTL_ADEN_Msk (0x1ul << ADC_CTL_ADEN_Pos) /*!< ADC_T::CTL: ADEN Mask */ - -#define ADC_CTL_MST_Pos (8) /*!< ADC_T::CTL: MST Position */ -#define ADC_CTL_MST_Msk (0x1ul << ADC_CTL_MST_Pos) /*!< ADC_T::CTL: MST Mask */ - -#define ADC_CTL_PEDEEN_Pos (9) /*!< ADC_T::CTL: PEDEEN Position */ -#define ADC_CTL_PEDEEN_Msk (0x1ul << ADC_CTL_PEDEEN_Pos) /*!< ADC_T::CTL: PEDEEN Mask */ - -#define ADC_CTL_WKTEN_Pos (11) /*!< ADC_T::CTL: WKTEN Position */ -#define ADC_CTL_WKTEN_Msk (0x1ul << ADC_CTL_WKTEN_Pos) /*!< ADC_T::CTL: WKTEN Mask */ - -#define ADC_CTL_WMSWCH_Pos (16) /*!< ADC_T::CTL: WMSWCH Position */ -#define ADC_CTL_WMSWCH_Msk (0x1ul << ADC_CTL_WMSWCH_Pos) /*!< ADC_T::CTL: WMSWCH Mask */ - -#define ADC_CONF_TEN_Pos (0) /*!< ADC_T::CONF: TEN Position */ -#define ADC_CONF_TEN_Msk (0x1ul << ADC_CONF_TEN_Pos) /*!< ADC_T::CONF: TEN Mask */ - -#define ADC_CONF_ZEN_Pos (1) /*!< ADC_T::CONF: ZEN Position */ -#define ADC_CONF_ZEN_Msk (0x1ul << ADC_CONF_ZEN_Pos) /*!< ADC_T::CONF: ZEN Mask */ - -#define ADC_CONF_NACEN_Pos (2) /*!< ADC_T::CONF: NACEN Position */ -#define ADC_CONF_NACEN_Msk (0x1ul << ADC_CONF_NACEN_Pos) /*!< ADC_T::CONF: NACEN Mask */ - -#define ADC_CONF_REFSEL_Pos (6) /*!< ADC_T::CONF: REFSEL Position */ -#define ADC_CONF_REFSEL_Msk (0x3ul << ADC_CONF_REFSEL_Pos) /*!< ADC_T::CONF: REFSEL Mask */ - -#define ADC_CONF_CHSEL_Pos (12) /*!< ADC_T::CONF: CHSEL Position */ -#define ADC_CONF_CHSEL_Msk (0x7ul << ADC_CONF_CHSEL_Pos) /*!< ADC_T::CONF: CHSEL Mask */ - -#define ADC_CONF_TMAVDIS_Pos (20) /*!< ADC_T::CONF: TMAVDIS Position */ -#define ADC_CONF_TMAVDIS_Msk (0x1ul << ADC_CONF_TMAVDIS_Pos) /*!< ADC_T::CONF: TMAVDIS Mask */ - -#define ADC_CONF_ZMAVDIS_Pos (21) /*!< ADC_T::CONF: ZMAVDIS Position */ -#define ADC_CONF_ZMAVDIS_Msk (0x1ul << ADC_CONF_ZMAVDIS_Pos) /*!< ADC_T::CONF: ZMAVDIS Mask */ - -#define ADC_CONF_SPEED_Pos (22) /*!< ADC_T::CONF: SPEED Position */ -#define ADC_CONF_SPEED_Msk (0x1ul << ADC_CONF_SPEED_Pos) /*!< ADC_T::CONF: SPEED Mask */ - -#define ADC_IER_MIEN_Pos (0) /*!< ADC_T::IER: MIEN Position */ -#define ADC_IER_MIEN_Msk (0x1ul << ADC_IER_MIEN_Pos) /*!< ADC_T::IER: MIEN Mask */ - -#define ADC_IER_PEDEIEN_Pos (2) /*!< ADC_T::IER: PEDEIEN Position */ -#define ADC_IER_PEDEIEN_Msk (0x1ul << ADC_IER_PEDEIEN_Pos) /*!< ADC_T::IER: PEDEIEN Mask */ - -#define ADC_IER_WKTIEN_Pos (3) /*!< ADC_T::IER: WKTIEN Position */ -#define ADC_IER_WKTIEN_Msk (0x1ul << ADC_IER_WKTIEN_Pos) /*!< ADC_T::IER: WKTIEN Mask */ - -#define ADC_IER_PEUEIEN_Pos (6) /*!< ADC_T::IER: PEUEIEN Position */ -#define ADC_IER_PEUEIEN_Msk (0x1ul << ADC_IER_PEUEIEN_Pos) /*!< ADC_T::IER: PEUEIEN Mask */ - -#define ADC_ISR_MF_Pos (0) /*!< ADC_T::ISR: MF Position */ -#define ADC_ISR_MF_Msk (0x1ul << ADC_ISR_MF_Pos) /*!< ADC_T::ISR: MF Mask */ - -#define ADC_ISR_PEDEF_Pos (2) /*!< ADC_T::ISR: PEDEF Position */ -#define ADC_ISR_PEDEF_Msk (0x1ul << ADC_ISR_PEDEF_Pos) /*!< ADC_T::ISR: PEDEF Mask */ - -#define ADC_ISR_PEUEF_Pos (4) /*!< ADC_T::ISR: PEUEF Position */ -#define ADC_ISR_PEUEF_Msk (0x1ul << ADC_ISR_PEUEF_Pos) /*!< ADC_T::ISR: PEUEF Mask */ - -#define ADC_ISR_TF_Pos (8) /*!< ADC_T::ISR: TF Position */ -#define ADC_ISR_TF_Msk (0x1ul << ADC_ISR_TF_Pos) /*!< ADC_T::ISR: TF Mask */ - -#define ADC_ISR_ZF_Pos (9) /*!< ADC_T::ISR: ZF Position */ -#define ADC_ISR_ZF_Msk (0x1ul << ADC_ISR_ZF_Pos) /*!< ADC_T::ISR: ZF Mask */ - -#define ADC_ISR_NACF_Pos (10) /*!< ADC_T::ISR: NACF Position */ -#define ADC_ISR_NACF_Msk (0x1ul << ADC_ISR_NACF_Pos) /*!< ADC_T::ISR: NACF Mask */ - -#define ADC_ISR_INTTC_Pos (17) /*!< ADC_T::ISR: INTTC Position */ -#define ADC_ISR_INTTC_Msk (0x1ul << ADC_ISR_INTTC_Pos) /*!< ADC_T::ISR: INTTC Mask */ - -#define ADC_WKISR_WPEDEF_Pos (1) /*!< ADC_T::WKISR: WPEDEF Position */ -#define ADC_WKISR_WPEDEF_Msk (0x1ul << ADC_WKISR_WPEDEF_Pos) /*!< ADC_T::WKISR: WPEDEF Mask */ - -#define ADC_XYDATA_XDATA_Pos (0) /*!< ADC_T::XYDATA: XDATA Position */ -#define ADC_XYDATA_XDATA_Msk (0xffful << ADC_XYDATA_XDATA_Pos) /*!< ADC_T::XYDATA: XDATA Mask */ - -#define ADC_XYDATA_YDATA_Pos (16) /*!< ADC_T::XYDATA: YDATA Position */ -#define ADC_XYDATA_YDATA_Msk (0xffful << ADC_XYDATA_YDATA_Pos) /*!< ADC_T::XYDATA: YDATA Mask */ - -#define ADC_ZDATA_Z1DATA_Pos (0) /*!< ADC_T::ZDATA: Z1DATA Position */ -#define ADC_ZDATA_Z1DATA_Msk (0xffful << ADC_ZDATA_Z1DATA_Pos) /*!< ADC_T::ZDATA: Z1DATA Mask */ - -#define ADC_ZDATA_Z2DATA_Pos (16) /*!< ADC_T::ZDATA: Z2DATA Position */ -#define ADC_ZDATA_Z2DATA_Msk (0xffful << ADC_ZDATA_Z2DATA_Pos) /*!< ADC_T::ZDATA: Z2DATA Mask */ - -#define ADC_DATA_ADCDATA_Pos (0) /*!< ADC_T::DATA: ADCDATA Position */ -#define ADC_DATA_ADCDATA_Msk (0xffful << ADC_DATA_ADCDATA_Pos) /*!< ADC_T::DATA: ADCDATA Mask */ - -#define ADC_XYSORT_XSORT_Pos (0) /*!< ADC_T::XYSORT: XSORT Position */ -#define ADC_XYSORT_XSORT_Msk (0xffful << ADC_XYSORT_XSORT_Pos) /*!< ADC_T::XYSORT: XSORT Mask */ - -#define ADC_XYSORT_YSORT_Pos (16) /*!< ADC_T::XYSORT: YSORT Position */ -#define ADC_XYSORT_YSORT_Msk (0xffful << ADC_XYSORT_YSORT_Pos) /*!< ADC_T::XYSORT: YSORT Mask */ - -#define ADC_ZSORT_Z1SORT_Pos (0) /*!< ADC_T::ZSORT: Z1SORT Position */ -#define ADC_ZSORT_Z1SORT_Msk (0xffful << ADC_ZSORT_Z1SORT_Pos) /*!< ADC_T::ZSORT: Z1SORT Mask */ - -#define ADC_ZSORT_Z2SORT_Pos (16) /*!< ADC_T::ZSORT: Z2SORT Position */ -#define ADC_ZSORT_Z2SORT_Msk (0xffful << ADC_ZSORT_Z2SORT_Pos) /*!< ADC_T::ZSORT: Z2SORT Mask */ - -/**@}*/ /* ADC_CONST */ -/**@}*/ /* end of ADC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif //__ADC_REG_H__ - - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/emac_reg.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/emac_reg.h deleted file mode 100644 index f9ad5efceb5..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/emac_reg.h +++ /dev/null @@ -1,2063 +0,0 @@ -/**************************************************************************//** - * @file emac_reg.h - * @version V1.00 - * @brief EMAC register definition header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __EMAC_REG_H__ -#define __EMAC_REG_H__ - -#if defined ( __CC_ARM ) - #pragma anon_unions -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup EMAC Ethernet MAC Controller(EMAC) - Memory Mapped Structure for EMAC Controller -@{ */ - -typedef struct -{ - - /** - * @var EMAC_T::CAMCTL - * Offset: 0x00 CAM Comparison Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AUP |Accept Unicast Packet - * | | |The AUP controls the unicast packet reception - * | | |If AUP is enabled, EMAC receives all incoming packet its destination MAC address is a unicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all unicast packets. - * |[1] |AMP |Accept Multicast Packet - * | | |The AMP controls the multicast packet reception - * | | |If AMP is enabled, EMAC receives all incoming packet its destination MAC address is a multicast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all multicast packets. - * |[2] |ABP |Accept Broadcast Packet - * | | |The ABP controls the broadcast packet reception - * | | |If ABP is enabled, EMAC receives all incoming packet its destination MAC address is a broadcast address. - * | | |0 = EMAC receives packet depends on the CAM comparison result. - * | | |1 = EMAC receives all broadcast packets. - * |[3] |COMPEN |Complement CAM Comparison Enable Bit - * | | |The COMPEN controls the complement of the CAM comparison result - * | | |If the CMPEN and COMPEN are both enabled, the incoming packet with specific destination MAC address - * | | |configured in CAM entry will be dropped - * | | |And the incoming packet with destination MAC address does not configured in any CAM entry will be received. - * | | |0 = Complement CAM comparison result Disabled. - * | | |1 = Complement CAM comparison result Enabled. - * |[4] |CMPEN |CAM Compare Enable Bit - * | | |The CMPEN controls the enable of CAM comparison function for destination MAC address recognition - * | | |If software wants to receive a packet with specific destination MAC address, configures the MAC address - * | | |into CAM 12~0, then enables that CAM entry and set CMPEN to 1. - * | | |0 = CAM comparison function for destination MAC address recognition Disabled. - * | | |1 = CAM comparison function for destination MAC address recognition Enabled. - * @var EMAC_T::CAMEN - * Offset: 0x04 CAM Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CAMxEN |CAM Entry X Enable Bit - * | | |The CAMxEN controls the validation of CAM entry x. - * | | |The CAM entry 13, 14 and 15 are for PAUSE control frame transmission - * | | |If software wants to transmit a PAUSE control frame out to network, the enable bits of these three CAM - * | | |entries all must be enabled first. - * | | |0 = CAM entry x Disabled. - * | | |1 = CAM entry x Enabled. - * @var EMAC_T::CAM0M - * Offset: 0x08 CAM0 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM0L - * Offset: 0x0C CAM0 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1M - * Offset: 0x10 CAM1 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM1L - * Offset: 0x14 CAM1 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2M - * Offset: 0x18 CAM2 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM2L - * Offset: 0x1C CAM2 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3M - * Offset: 0x20 CAM3 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM3L - * Offset: 0x24 CAM3 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4M - * Offset: 0x28 CAM4 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM4L - * Offset: 0x2C CAM4 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5M - * Offset: 0x30 CAM5 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM5L - * Offset: 0x34 CAM5 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6M - * Offset: 0x38 CAM6 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM6L - * Offset: 0x3C CAM6 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7M - * Offset: 0x40 CAM7 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM7L - * Offset: 0x44 CAM7 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8M - * Offset: 0x48 CAM8 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM8L - * Offset: 0x4C CAM8 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9M - * Offset: 0x50 CAM9 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM9L - * Offset: 0x54 CAM9 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10M - * Offset: 0x58 CAM10 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM10L - * Offset: 0x5C CAM10 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11M - * Offset: 0x60 CAM11 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM11L - * Offset: 0x64 CAM11 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12M - * Offset: 0x68 CAM12 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM12L - * Offset: 0x6C CAM12 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13M - * Offset: 0x70 CAM13 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM13L - * Offset: 0x74 CAM13 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14M - * Offset: 0x78 CAM14 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |MACADDR2 |MAC Address Byte 2 - * |[15:8] |MACADDR3 |MAC Address Byte 3 - * |[23:16] |MACADDR4 |MAC Address Byte 4 - * |[31:24] |MACADDR5 |MAC Address Byte 5 - * | | |The CAMxM keeps the bit 47~16 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM14L - * Offset: 0x7C CAM14 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:16] |MACADDR0 |MAC Address Byte 0 - * |[31:24] |MACADDR1 |MAC Address Byte 1 - * | | |The CAMxL keeps the bit 15~0 of MAC address - * | | |The x can be the 0~14 - * | | |The register pair {EMAC_CAMxM, EMAC_CAMxL} represents a CAM entry and keeps a MAC address. - * | | |For example, if the MAC address 00-50-BA-33-BA-44 kept in CAM entry 1, the register EMAC_CAM1M is - * | | |0x0050_BA33 and EMAC_CAM1L is 0xBA44_0000. - * @var EMAC_T::CAM15MSB - * Offset: 0x80 CAM15 Most Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |OPCODE |OP Code Field of PAUSE Control Frame - * | | |In the PAUSE control frame, an op code field defined and is 0x0001. - * |[31:16] |LENGTH |LENGTH Field of PAUSE Control Frame - * | | |In the PAUSE control frame, a LENGTH field defined and is 0x8808. - * @var EMAC_T::CAM15LSB - * Offset: 0x84 CAM15 Least Significant Word Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:24] |OPERAND |Pause Parameter - * | | |In the PAUSE control frame, an OPERAND field defined and controls how much time the destination - * | | |Ethernet MAC Controller paused - * | | |The unit of the OPERAND is a slot time, the 512-bit time. - * @var EMAC_T::TXDSA - * Offset: 0x88 Transmit Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXDSA |Transmit Descriptor Link-list Start Address - * | | |The TXDSA keeps the start address of transmit descriptor link-list - * | | |If the software enables the bit TXON (EMAC_CTL[8]), the content of TXDSA will be loaded into the - * | | |current transmit descriptor start address register (EMAC_CTXDSA) - * | | |The TXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of TXDSA - * | | |This means that TX descriptors must locate at word boundary memory address. - * @var EMAC_T::RXDSA - * Offset: 0x8C Receive Descriptor Link List Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXDSA |Receive Descriptor Link-list Start Address - * | | |The RXDSA keeps the start address of receive descriptor link-list - * | | |If the S/W enables the bit RXON (EMAC_CTL[0]), the content of RXDSA will be loaded into the current - * | | |receive descriptor start address register (EMAC_CRXDSA) - * | | |The RXDSA does not be updated by EMAC - * | | |During the operation, EMAC will ignore the bits [1:0] of RXDSA - * | | |This means that RX descriptors must locate at word boundary memory address. - * @var EMAC_T::CTL - * Offset: 0x90 MAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXON |Frame Reception ON - * | | |The RXON controls the normal packet reception of EMAC - * | | |If the RXON is set to high, the EMAC starts the packet reception process, including the RX - * | | |descriptor fetching, packet reception and RX descriptor modification. - * | | |It is necessary to finish EMAC initial sequence before enable RXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the RXON is disabled during EMAC is receiving an incoming packet, the EMAC stops the packet - * | | |reception process after the current packet reception finished. - * | | |0 = Packet reception process stopped. - * | | |1 = Packet reception process started. - * |[1] |ALP |Accept Long Packet - * | | |The ALP controls the long packet, which packet length is greater than 1518 bytes, reception - * | | |If the ALP is set to high, the EMAC will accept the long packet. - * | | |Otherwise, the long packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the long packet. - * | | |1 = Ethernet MAC controller received the long packet. - * |[2] |ARP |Accept Runt Packet - * | | |The ARP controls the runt packet, which length is less than 64 bytes, reception - * | | |If the ARP is set to high, the EMAC will accept the runt packet. - * | | |Otherwise, the runt packet will be dropped. - * | | |0 = Ethernet MAC controller dropped the runt packet. - * | | |1 = Ethernet MAC controller received the runt packet. - * |[3] |ACP |Accept Control Packet - * | | |The ACP controls the control frame reception - * | | |If the ACP is set to high, the EMAC will accept the control frame - * | | |Otherwise, the control frame will be dropped - * | | |It is recommended that S/W only enable ACP while EMAC is operating on full duplex mode. - * | | |0 = Ethernet MAC controller dropped the control frame. - * | | |1 = Ethernet MAC controller received the control frame. - * |[4] |AEP |Accept CRC Error Packet - * | | |The AEP controls the EMAC accepts or drops the CRC error packet - * | | |If the AEP is set to high, the incoming packet with CRC error will be received by EMAC as a good packet. - * | | |0 = Ethernet MAC controller dropped the CRC error packet. - * | | |1 = Ethernet MAC controller received the CRC error packet. - * |[5] |STRIPCRC |Strip CRC Checksum - * | | |The STRIPCRC controls if the length of incoming packet is calculated with 4 bytes CRC checksum - * | | |If the STRIPCRC is set to high, 4 bytes CRC checksum is excluded from length calculation of incoming packet. - * | | |0 = The 4 bytes CRC checksum is included in packet length calculation. - * | | |1 = The 4 bytes CRC checksum is excluded in packet length calculation. - * |[6] |WOLEN |Wake on LAN Enable Bit - * | | |The WOLEN high enables the functionality that Ethernet MAC controller checked if the incoming packet - * | | |is Magic Packet and wakeup system from Power-down mode. - * | | |If incoming packet was a Magic Packet and the system was in Power-down, the Ethernet MAC controller - * | | |would generate a wakeup event to wake system up from Power-down mode. - * | | |0 = Wake-up by Magic Packet function Disabled. - * | | |1 = Wake-up by Magic Packet function Enabled. - * |[8] |TXON |Frame Transmission ON - * | | |The TXON controls the normal packet transmission of EMAC - * | | |If the TXON is set to high, the EMAC starts the packet transmission process, including the TX - * | | |descriptor fetching, packet transmission and TX descriptor modification. - * | | |It is must to finish EMAC initial sequence before enable TXON - * | | |Otherwise, the EMAC operation is undefined. - * | | |If the TXON is disabled during EMAC is transmitting a packet out, the EMAC stops the packet - * | | |transmission process after the current packet transmission finished. - * | | |0 = Packet transmission process stopped. - * | | |1 = Packet transmission process started. - * |[9] |NODEF |No Deferral - * | | |The NODEF controls the enable of deferral exceed counter - * | | |If NODEF is set to high, the deferral exceed counter is disabled - * | | |The NODEF is only useful while EMAC is operating on half duplex mode. - * | | |0 = The deferral exceed counter Enabled. - * | | |1 = The deferral exceed counter Disabled. - * |[16] |SDPZ |Send PAUSE Frame - * | | |The SDPZ controls the PAUSE control frame transmission. - * | | |If S/W wants to send a PAUSE control frame out, the CAM entry 13, 14 and 15 must be configured - * | | |first and the corresponding CAM enable bit of CAMEN register also must be set. - * | | |Then, set SDPZ to 1 enables the PAUSE control frame transmission. - * | | |The SDPZ is a self-clear bit - * | | |This means after the PAUSE control frame transmission has completed, the SDPZ will be cleared automatically. - * | | |It is recommended that only enabling SNDPAUSE while EMAC is operating in Full Duplex mode. - * | | |0 = PAUSE control frame transmission completed. - * | | |1 = PAUSE control frame transmission Enabled. - * |[17] |SQECHKEN |SQE Checking Enable Bit - * | | |The SQECHKEN controls the enable of SQE checking - * | | |The SQE checking is only available while EMAC is operating on 10M bps and half duplex mode - * | | |In other words, the SQECHKEN cannot affect EMAC operation, if the EMAC is operating on 100Mbps - * | | |or full duplex mode. - * | | |0 = SQE checking Disabled while EMAC is operating in 10Mbps and Half Duplex mode. - * | | |1 = SQE checking Enabled while EMAC is operating in 10Mbps and Half Duplex mode. - * |[18] |FUDUP |Full Duplex Mode Selection - * | | |The FUDUP controls that if EMAC is operating on full or half duplex mode. - * | | |0 = EMAC operates in half duplex mode. - * | | |1 = EMAC operates in full duplex mode. - * |[19] |RMIIRXCTL |RMII RX Control - * | | |The RMIIRXCTL control the receive data sample in RMII mode - * | | |It's necessary to set this bit high when RMIIEN (EMAC_CTL[ [22]) is high. - * | | |0 = RMII RX control disabled. - * | | |1 = RMII RX control enabled. - * |[20] |OPMODE |Operation Mode Selection - * | | |The OPMODE defines that if the EMAC is operating on 10M or 100M bps mode - * | | |The RST (EMAC_CTL[24]) would not affect OPMODE value. - * | | |0 = EMAC operates in 10Mbps mode. - * | | |1 = EMAC operates in 100Mbps mode. - * |[22] |RMIIEN |RMII Mode Enable Bit - * | | |This bit controls if Ethernet MAC controller connected with off-chip Ethernet PHY by MII - * | | |interface or RMII interface - * | | |The RST (EMAC_CTL[24]) would not affect RMIIEN value. - * | | |0 = Ethernet MAC controller RMII mode Disabled. - * | | |1 = Ethernet MAC controller RMII mode Enabled. - * | | |NOTE: This field must keep 1. - * |[24] |RST |Software Reset - * | | |The RST implements a reset function to make the EMAC return default state - * | | |The RST is a self-clear bit - * | | |This means after the software reset finished, the RST will be cleared automatically - * | | |Enable RST can also reset all control and status registers, exclusive of the control bits - * | | |RMIIEN (EMAC_CTL[22]), and OPMODE (EMAC_CTL[20]). - * | | |The EMAC re-initial is necessary after the software reset completed. - * | | |0 = Software reset completed. - * | | |1 = Software reset Enabled. - * @var EMAC_T::MIIMDAT - * Offset: 0x94 MII Management Data Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |DATA |MII Management Data - * | | |The DATA is the 16 bits data that will be written into the registers of external PHY for MII - * | | |Management write command or the data from the registers of external PHY for MII Management read command. - * @var EMAC_T::MIIMCTL - * Offset: 0x98 MII Management Control and Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[4:0] |PHYREG |PHY Register Address - * | | |The PHYREG keeps the address to indicate which register of external PHY is the target of the - * | | |MII management command. - * |[12:8] |PHYADDR |PHY Address - * | | |The PHYADDR keeps the address to differentiate which external PHY is the target of the MII management command. - * |[16] |WRITE |Write Command - * | | |The Write defines the MII management command is a read or write. - * | | |0 = MII management command is a read command. - * | | |1 = MII management command is a write command. - * |[17] |BUSY |Busy Bit - * | | |The BUSY controls the enable of the MII management frame generation - * | | |If S/W wants to access registers of external PHY, it set BUSY to high and EMAC generates - * | | |the MII management frame to external PHY through MII Management I/F - * | | |The BUSY is a self-clear bit - * | | |This means the BUSY will be cleared automatically after the MII management command finished. - * | | |0 = MII management command generation finished. - * | | |1 = MII management command generation Enabled. - * |[18] |PREAMSP |Preamble Suppress - * | | |The PREAMSP controls the preamble field generation of MII management frame - * | | |If the PREAMSP is set to high, the preamble field generation of MII management frame is skipped. - * | | |0 = Preamble field generation of MII management frame not skipped. - * | | |1 = Preamble field generation of MII management frame skipped. - * |[19] |MDCON |MDC Clock ON - * | | |The MDC controls the MDC clock generation. If the MDCON is set to high, the MDC clock is turned on. - * | | |0 = MDC clock off. - * | | |1 = MDC clock on. - * @var EMAC_T::FIFOCTL - * Offset: 0x9C FIFO Threshold Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |RXFIFOTH |RXFIFO Low Threshold - * | | |The RXFIFOTH controls when RXDMA requests internal arbiter for data transfer between RXFIFO - * | | |and system memory - * | | |The RXFIFOTH defines not only the high threshold of RXFIFO, but also the low threshold - * | | |The low threshold is the half of high threshold always - * | | |During the packet reception, if the RXFIFO reaches the high threshold, the RXDMA starts to - * | | |transfer frame data from RXFIFO to system memory - * | | |If the frame data in RXFIFO is less than low threshold, RXDMA stops to transfer the frame - * | | |data to system memory. - * | | |00 = Depend on the burst length setting - * | | |If the burst length is 8 words, high threshold is 8 words, too. - * | | |01 = RXFIFO high threshold is 64B and low threshold is 32B. - * | | |10 = RXFIFO high threshold is 128B and low threshold is 64B. - * | | |11 = RXFIFO high threshold is 192B and low threshold is 96B. - * |[9:8] |TXFIFOTH |TXFIFO Low Threshold - * | | |The TXFIFOTH controls when TXDMA requests internal arbiter for data transfer between system - * | | |memory and TXFIFO - * | | |The TXFIFOTH defines not only the low threshold of TXFIFO, but also the high threshold - * | | |The high threshold is the twice of low threshold always - * | | |During the packet transmission, if the TXFIFO reaches the high threshold, the TXDMA stops - * | | |generate request to transfer frame data from system memory to TXFIFO - * | | |If the frame data in TXFIFO is less than low threshold, TXDMA starts to transfer frame data - * | | |from system memory to TXFIFO. - * | | |The TXFIFOTH also defines when the TXMAC starts to transmit frame out to network - * | | |The TXMAC starts to transmit the frame out while the TXFIFO first time reaches the high threshold - * | | |during the transmission of the frame - * | | |If the frame data length is less than TXFIFO high threshold, the TXMAC starts to transmit the frame - * | | |out after the frame data are all inside the TXFIFO. - * | | |00 = Undefined. - * | | |01 = TXFIFO low threshold is 64B and high threshold is 128B. - * | | |10 = TXFIFO low threshold is 80B and high threshold is 160B. - * | | |11 = TXFIFO low threshold is 96B and high threshold is 192B. - * |[21:20] |BURSTLEN |DMA Burst Length - * | | |This defines the burst length of AHB bus cycle while EMAC accesses system memory. - * | | |00 = 4 words. - * | | |01 = 8 words. - * | | |10 = 16 words. - * | | |11 = 16 words. - * @var EMAC_T::TXST - * Offset: 0xA0 Transmit Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TXST |Transmit Start Demand - * | | |If the TX descriptor is not available for use of TXDMA after the TXON (EMAC_CTL[8]) is enabled, - * | | |the FSM (Finite State Machine) of TXDMA enters the Halt state and the frame transmission is halted - * | | |After the S/W has prepared the new TX descriptor for frame transmission, it must issue a write - * | | |command to EMAC_TXST register to make TXDMA to leave Halt state and continue the frame transmission. - * | | |The EMAC_TXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_TXST register takes effect only when TXDMA stayed at Halt state. - * @var EMAC_T::RXST - * Offset: 0xA4 Receive Start Demand Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RXST |Receive Start Demand - * | | |If the RX descriptor is not available for use of RXDMA after the RXON (EMAC_CTL[0]) is enabled, - * | | |the FSM (Finite State Machine) of RXDMA enters the Halt state and the frame reception is halted - * | | |After the S/W has prepared the new RX descriptor for frame reception, it must issue a write - * | | |command to EMAC_RXST register to make RXDMA to leave Halt state and continue the frame reception. - * | | |The EMAC_RXST is a write only register and read from this register is undefined. - * | | |The write to EMAC_RXST register take effect only when RXDMA stayed at Halt state. - * @var EMAC_T::MRFL - * Offset: 0xA8 Maximum Receive Frame Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MRFL |Maximum Receive Frame Length - * | | |The MRFL defines the maximum frame length for received frame - * | | |If the frame length of received frame is greater than MRFL, and bit MFLEIEN (EMAC_INTEN[8]) - * | | |is also enabled, the bit MFLEIF (EMAC_INTSTS[8]) is set and the RX interrupt is triggered. - * | | |It is recommended that only use MRFL to qualify the length of received frame while S/W wants to - * | | |receive a frame which length is greater than 1518 bytes. - * @var EMAC_T::INTEN - * Offset: 0xAC MAC Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIEN |Receive Interrupt Enable Bit - * | | |The RXIEN controls the RX interrupt generation. - * | | |If RXIEN is enabled and RXIF (EMAC_INTSTS[0]) is high, EMAC generates the RX interrupt to CPU - * | | |If RXIEN is disabled, no RX interrupt is generated to CPU even any status bit EMAC_INTSTS[15:1] - * | | |is set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive RX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any RX interrupt from EMAC, disables this bit. - * | | |0 = RXIF (EMAC_INTSTS[0]) is masked and RX interrupt generation Disabled. - * | | |1 = RXIF (EMAC_INTSTS[0]) is not masked and RX interrupt generation Enabled. - * |[1] |CRCEIEN |CRC Error Interrupt Enable Bit - * | | |The CRCEIEN controls the CRCEIF (EMAC_INTSTS[1]) interrupt generation - * | | |If CRCEIF (EMAC_INTSTS[1]) is set, and both CRCEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CRCEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CRCEIF (EMAC_INTSTS[1]) is set. - * | | |0 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Disabled. - * | | |1 = CRCEIF (EMAC_INTSTS[1]) trigger RX interrupt Enabled. - * |[2] |RXOVIEN |Receive FIFO Overflow Interrupt Enable Bit - * | | |The RXOVIEN controls the RXOVIF (EMAC_INTSTS[2]) interrupt generation - * | | |If RXOVIF (EMAC_INTSTS[2]) is set, and both RXOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXOVIF (EMAC_INTSTS[2]) is set. - * | | |0 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Disabled. - * | | |1 = RXOVIF (EMAC_INTSTS[2]) trigger RX interrupt Enabled. - * |[3] |LPIEN |Long Packet Interrupt Enable Bit - * | | |The LPIEN controls the LPIF (EMAC_INTSTS[3]) interrupt generation - * | | |If LPIF (EMAC_INTSTS[3]) is set, and both LPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If LPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the LPIF - * | | |(EMAC_INTSTS[3]) is set. - * | | |0 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Disabled. - * | | |1 = LPIF (EMAC_INTSTS[3]) trigger RX interrupt Enabled. - * |[4] |RXGDIEN |Receive Good Interrupt Enable Bit - * | | |The RXGDIEN controls the RXGDIF (EMAC_INTSTS[4]) interrupt generation - * | | |If RXGDIF (EMAC_INTSTS[4]) is set, and both RXGDIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXGDIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXGDIF (EMAC_INTSTS[4]) is set. - * | | |0 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Disabled. - * | | |1 = RXGDIF (EMAC_INTSTS[4]) trigger RX interrupt Enabled. - * |[5] |ALIEIEN |Alignment Error Interrupt Enable Bit - * | | |The ALIEIEN controls the ALIEIF (EMAC_INTSTS[5]) interrupt generation - * | | |If ALIEIF (EMAC_INTSTS[5]) is set, and both ALIEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If ALIEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |ALIEIF (EMAC_INTSTS[5]) is set. - * | | |0 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Disabled. - * | | |1 = ALIEIF (EMAC_INTSTS[5]) trigger RX interrupt Enabled. - * |[6] |RPIEN |Runt Packet Interrupt Enable Bit - * | | |The RPIEN controls the RPIF (EMAC_INTSTS[6]) interrupt generation - * | | |If RPIF (EMAC_INTSTS[6]) is set, and both RPIEN and RXIEN (EMAC_INTEN[0]) are enabled, the EMAC - * | | |generates the RX interrupt to CPU - * | | |If RPIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RPIF (EMAC_INTSTS[6]) is set. - * | | |0 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Disabled. - * | | |1 = RPIF (EMAC_INTSTS[6]) trigger RX interrupt Enabled. - * |[7] |MPCOVIEN |Miss Packet Counter Overrun Interrupt Enable Bit - * | | |The MPCOVIEN controls the MPCOVIF (EMAC_INTSTS[7]) interrupt generation - * | | |If MPCOVIF (EMAC_INTSTS[7]) is set, and both MPCOVIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If MPCOVIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MPCOVIF (EMAC_INTSTS[7]) is set. - * | | |0 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Disabled. - * | | |1 = MPCOVIF (EMAC_INTSTS[7]) trigger RX interrupt Enabled. - * |[8] |MFLEIEN |Maximum Frame Length Exceed Interrupt Enable Bit - * | | |The MFLEIEN controls the MFLEIF (EMAC_INTSTS[8]) interrupt generation - * | | |If MFLEIF (EMAC_INTSTS[8]) is set, and both MFLEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If MFLEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |MFLEIF (EMAC_INTSTS[8]) is set. - * | | |0 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Disabled. - * | | |1 = MFLEIF (EMAC_INTSTS[8]) trigger RX interrupt Enabled. - * |[9] |DENIEN |DMA Early Notification Interrupt Enable Bit - * | | |The DENIEN controls the DENIF (EMAC_INTSTS[9]) interrupt generation - * | | |If DENIF (EMAC_INTSTS[9]) is set, and both DENIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If DENIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |DENIF (EMAC_INTSTS[9]) is set. - * | | |0 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Disabled. - * | | |1 = TDENIF (EMAC_INTSTS[9]) trigger RX interrupt Enabled. - * |[10] |RDUIEN |Receive Descriptor Unavailable Interrupt Enable Bit - * | | |The RDUIEN controls the RDUIF (EMAC_INTSTS[10]) interrupt generation - * | | |If RDUIF (EMAC_INTSTS[10]) is set, and both RDUIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RDUIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RDUIF (EMAC_MIOSTA[10]) register is set. - * | | |0 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Disabled. - * | | |1 = RDUIF (EMAC_INTSTS[10]) trigger RX interrupt Enabled. - * |[11] |RXBEIEN |Receive Bus Error Interrupt Enable Bit - * | | |The RXBEIEN controls the RXBEIF (EMAC_INTSTS[11]) interrupt generation - * | | |If RXBEIF (EMAC_INTSTS[11]) is set, and both RXBEIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If RXBEIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |RXBEIF (EMAC_INTSTS[11]) is set. - * | | |0 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Disabled. - * | | |1 = RXBEIF (EMAC_INTSTS[11]) trigger RX interrupt Enabled. - * |[14] |CFRIEN |Control Frame Receive Interrupt Enable Bit - * | | |The CFRIEN controls the CFRIF (EMAC_INTSTS[14]) interrupt generation - * | | |If CFRIF (EMAC_INTSTS[14]) is set, and both CFRIEN and RXIEN (EMAC_INTEN[0]) are enabled, the - * | | |EMAC generates the RX interrupt to CPU - * | | |If CFRIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |CFRIF (EMAC_INTSTS[14]) register is set. - * | | |0 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Disabled. - * | | |1 = CFRIF (EMAC_INTSTS[14]) trigger RX interrupt Enabled. - * |[15] |WOLIEN |Wake on LAN Interrupt Enable Bit - * | | |The WOLIEN controls the WOLIF (EMAC_INTSTS[15]) interrupt generation - * | | |If WOLIF (EMAC_INTSTS[15]) is set, and both WOLIEN and RXIEN (EMAC_INTEN[0]) are enabled, - * | | |the EMAC generates the RX interrupt to CPU - * | | |If WOLIEN or RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated to CPU even the - * | | |WOLIF (EMAC_INTSTS[15]) is set. - * | | |0 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Disabled. - * | | |1 = WOLIF (EMAC_INTSTS[15]) trigger RX interrupt Enabled. - * |[16] |TXIEN |Transmit Interrupt Enable Bit - * | | |The TXIEN controls the TX interrupt generation. - * | | |If TXIEN is enabled and TXIF (EMAC_INTSTS[16]) is high, EMAC generates the TX interrupt to CPU - * | | |If TXIEN is disabled, no TX interrupt is generated to CPU even any status bit of - * | | |EMAC_INTSTS[24:17] set and the corresponding bit of EMAC_INTEN is enabled - * | | |In other words, if S/W wants to receive TX interrupt from EMAC, this bit must be enabled - * | | |And, if S/W doesn't want to receive any TX interrupt from EMAC, disables this bit. - * | | |0 = TXIF (EMAC_INTSTS[16]) is masked and TX interrupt generation Disabled. - * | | |1 = TXIF (EMAC_INTSTS[16]) is not masked and TX interrupt generation Enabled. - * |[17] |TXUDIEN |Transmit FIFO Underflow Interrupt Enable Bit - * | | |The TXUDIEN controls the TXUDIF (EMAC_INTSTS[17]) interrupt generation - * | | |If TXUDIF (EMAC_INTSTS[17]) is set, and both TXUDIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXUDIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even - * | | |the TXUDIF (EMAC_INTSTS[17]) is set. - * | | |0 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Disabled. - * | | |1 = TXUDIF (EMAC_INTSTS[17]) TX interrupt Enabled. - * |[18] |TXCPIEN |Transmit Completion Interrupt Enable Bit - * | | |The TXCPIEN controls the TXCPIF (EMAC_INTSTS[18]) interrupt generation - * | | |If TXCPIF (EMAC_INTSTS[18]) is set, and both TXCPIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXCPIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXCPIF (EMAC_INTSTS[18]) is set. - * | | |0 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Disabled. - * | | |1 = TXCPIF (EMAC_INTSTS[18]) trigger TX interrupt Enabled. - * |[19] |EXDEFIEN |Defer Exceed Interrupt Enable Bit - * | | |The EXDEFIEN controls the EXDEFIF (EMAC_INTSTS[19]) interrupt generation - * | | |If EXDEFIF (EMAC_INTSTS[19]) is set, and both EXDEFIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If EXDEFIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |EXDEFIF (EMAC_INTSTS[19]) is set. - * | | |0 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Disabled. - * | | |1 = EXDEFIF (EMAC_INTSTS[19]) trigger TX interrupt Enabled. - * |[20] |NCSIEN |No Carrier Sense Interrupt Enable Bit - * | | |The NCSIEN controls the NCSIF (EMAC_INTSTS[20]) interrupt generation - * | | |If NCSIF (EMAC_INTSTS[20]) is set, and both NCSIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If NCSIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |NCSIF (EMAC_INTSTS[20]) is set. - * | | |0 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Disabled. - * | | |1 = NCSIF (EMAC_INTSTS[20]) trigger TX interrupt Enabled. - * |[21] |TXABTIEN |Transmit Abort Interrupt Enable Bit - * | | |The TXABTIEN controls the TXABTIF (EMAC_INTSTS[21]) interrupt generation - * | | |If TXABTIF (EMAC_INTSTS[21]) is set, and both TXABTIEN and TXIEN (EMAC_INTEN[16]) are enabled, - * | | |the EMAC generates the TX interrupt to CPU - * | | |If TXABTIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXABTIF (EMAC_INTSTS[21]) is set. - * | | |0 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Disabled. - * | | |1 = TXABTIF (EMAC_INTSTS[21]) trigger TX interrupt Enabled. - * |[22] |LCIEN |Late Collision Interrupt Enable Bit - * | | |The LCIEN controls the LCIF (EMAC_INTSTS[22]) interrupt generation - * | | |If LCIF (EMAC_INTSTS[22]) is set, and both LCIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If LCIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |LCIF (EMAC_INTSTS[22]) is set. - * | | |0 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Disabled. - * | | |1 = LCIF (EMAC_INTSTS[22]) trigger TX interrupt Enabled. - * |[23] |TDUIEN |Transmit Descriptor Unavailable Interrupt Enable Bit - * | | |The TDUIEN controls the TDUIF (EMAC_INTSTS[23]) interrupt generation - * | | |If TDUIF (EMAC_INTSTS[23]) is set, and both TDUIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TDUIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TDUIF (EMAC_INTSTS[23]) is set. - * | | |0 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Disabled. - * | | |1 = TDUIF (EMAC_INTSTS[23]) trigger TX interrupt Enabled. - * |[24] |TXBEIEN |Transmit Bus Error Interrupt Enable Bit - * | | |The TXBEIEN controls the TXBEIF (EMAC_INTSTS[24]) interrupt generation - * | | |If TXBEIF (EMAC_INTSTS[24]) is set, and both TXBEIEN and TXIEN (EMAC_INTEN[16]) are enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TXBEIEN or TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated to CPU even the - * | | |TXBEIF (EMAC_INTSTS[24]) is set. - * | | |0 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Disabled. - * | | |1 = TXBEIF (EMAC_INTSTS[24]) trigger TX interrupt Enabled. - * |[28] |TSALMIEN |Time Stamp Alarm Interrupt Enable Bit - * | | |The TSALMIEN controls the TSALMIF (EMAC_INTSTS[28]) interrupt generation - * | | |If TSALMIF (EMAC_INTSTS[28]) is set, and both TSALMIEN and TXIEN (EMAC_INTEN[16]) enabled, the - * | | |EMAC generates the TX interrupt to CPU - * | | |If TSALMIEN or TXIEN (EMAC_INTEN[16]) disabled, no TX interrupt generated to CPU even the - * | | |TXTSALMIF (EMAC_INTEN[28]) is set. - * | | |0 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Disabled. - * | | |1 = TXTSALMIF (EMAC_INTSTS[28]) trigger TX interrupt Enabled. - * @var EMAC_T::INTSTS - * Offset: 0xB0 MAC Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXIF |Receive Interrupt - * | | |The RXIF indicates the RX interrupt status. - * | | |If RXIF high and its corresponding enable bit, RXIEN (EMAC_INTEN[0]), is also high indicates - * | | |the EMAC generates RX interrupt to CPU - * | | |If RXIF is high but RXIEN (EMAC_INTEN[0]) is disabled, no RX interrupt is generated. - * | | |The RXIF is logic OR result of bit logic AND result of EMAC_INTSTS[15:1] and EMAC_INTEN[15:1] - * | | |In other words, if any bit of EMAC_INTSTS[15:1] is high and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is also enabled, the RXIF will be high. - * | | |Because the RXIF is a logic OR result, clears EMAC_INTSTS[15:1] makes RXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[15:1] is set or no enable bit in EMAC_INTEN[15:1] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[15:1] is set and its corresponding enable bit in - * | | |EMAC_INTEN[15:1] is enabled, too. - * |[1] |CRCEIF |CRC Error Interrupt - * | | |The CRCEIF high indicates the incoming packet incurred the CRC error and the packet is dropped - * | | |If the AEP (EMAC_CTL[4]) is set, the CRC error packet will be regarded as a good packet and - * | | |CRCEIF will not be set. - * | | |If the CRCEIF is high and CRCEIEN (EMAC_INTEN[1]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CRCEIF status. - * | | |0 = The frame does not incur CRC error. - * | | |1 = The frame incurred CRC error. - * |[2] |RXOVIF |Receive FIFO Overflow Interrupt - * | | |The RXOVIF high indicates the RXFIFO overflow occurred during packet reception - * | | |While the RXFIFO overflow occurred, the EMAC drops the current receiving packer - * | | |If the RXFIFO overflow occurred often, it is recommended that modify RXFIFO threshold control, - * | | |the RXFIFOTH of FFTCR register, to higher level. - * | | |If the RXOVIF is high and RXOVIEN (EMAC_INTEN[2]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXOVIF status. - * | | |0 = No RXFIFO overflow occurred during packet reception. - * | | |1 = RXFIFO overflow occurred during packet reception. - * |[3] |LPIF |Long Packet Interrupt Flag - * | | |The LPIF high indicates the length of the incoming packet is greater than 1518 bytes and the - * | | |incoming packet is dropped - * | | |If the ALP (EMAC_CTL[1]) is set, the long packet will be regarded as a good packet and LPIF will not be set. - * | | |If the LPIF is high and LPIEN (EMAC_INTEN[3]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the LPIF status. - * | | |0 = The incoming frame is not a long frame or S/W wants to receive a long frame. - * | | |1 = The incoming frame is a long frame and dropped. - * |[4] |RXGDIF |Receive Good Interrupt - * | | |The RXGDIF high indicates the frame reception has completed. - * | | |If the RXGDIF is high and RXGDIEN (EAMC_MIEN[4]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXGDIF status. - * | | |0 = The frame reception has not complete yet. - * | | |1 = The frame reception has completed. - * |[5] |ALIEIF |Alignment Error Interrupt - * | | |The ALIEIF high indicates the length of the incoming frame is not a multiple of byte - * | | |If the ALIEIF is high and ALIEIEN (EMAC_INTEN[5]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the ALIEIF status. - * | | |0 = The frame length is a multiple of byte. - * | | |1 = The frame length is not a multiple of byte. - * |[6] |RPIF |Runt Packet Interrupt - * | | |The RPIF high indicates the length of the incoming packet is less than 64 bytes and the packet is dropped - * | | |If the ARP (EMAC_CTL[2]) is set, the short packet is regarded as a good packet and RPIF will not be set. - * | | |If the RPIF is high and RPIEN (EMAC_INTEN[6]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RPIF status. - * | | |0 = The incoming frame is not a short frame or S/W wants to receive a short frame. - * | | |1 = The incoming frame is a short frame and dropped. - * |[7] |MPCOVIF |Missed Packet Counter Overrun Interrupt Flag - * | | |The MPCOVIF high indicates the MPCNT, Missed Packet Count, has overflow - * | | |If the MPCOVIF is high and MPCOVIEN (EMAC_INTEN[7]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MPCOVIF status. - * | | |0 = The MPCNT has not rolled over yet. - * | | |1 = The MPCNT has rolled over yet. - * |[8] |MFLEIF |Maximum Frame Length Exceed Interrupt Flag - * | | |The MFLEIF high indicates the length of the incoming packet has exceeded the length limitation - * | | |configured in DMARFC register and the incoming packet is dropped - * | | |If the MFLEIF is high and MFLEIEN (EMAC_INTEN[8]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the MFLEIF status. - * | | |0 = The length of the incoming packet does not exceed the length limitation configured in DMARFC. - * | | |1 = The length of the incoming packet has exceeded the length limitation configured in DMARFC. - * |[9] |DENIF |DMA Early Notification Interrupt - * | | |The DENIF high indicates the EMAC has received the LENGTH field of the incoming packet. - * | | |If the DENIF is high and DENIENI (EMAC_INTEN[9]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the DENIF status. - * | | |0 = The LENGTH field of incoming packet has not received yet. - * | | |1 = The LENGTH field of incoming packet has received. - * |[10] |RDUIF |Receive Descriptor Unavailable Interrupt - * | | |The RDUIF high indicates that there is no available RX descriptor for packet reception and - * | | |RXDMA will stay at Halt state - * | | |Once, the RXDMA enters the Halt state, S/W must issues a write command to RSDR register to - * | | |make RXDMA leave Halt state while new RX descriptor is available. - * | | |If the RDUIF is high and RDUIEN (EMAC_INTEN[10]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RDUIF status. - * | | |0 = RX descriptor is available. - * | | |1 = RX descriptor is unavailable. - * |[11] |RXBEIF |Receive Bus Error Interrupt - * | | |The RXBEIF high indicates the memory controller replies ERROR response while EMAC access - * | | |system memory through RXDMA during packet reception process - * | | |Reset EMAC is recommended while RXBEIF status is high. - * | | |If the RXBEIF is high and RXBEIEN (EMAC_INTEN[11]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the RXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[14] |CFRIF |Control Frame Receive Interrupt - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |If the CFRIF is high and CFRIEN (EMAC_INTEN[14]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the CFRIF status. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[15] |WOLIF |Wake on LAN Interrupt Flag - * | | |The WOLIF high indicates EMAC receives a Magic Packet - * | | |The CFRIF only available while system is in power down mode and WOLEN is set high. - * | | |If the WOLIF is high and WOLIEN (EMAC_INTEN[15]) is enabled, the RXIF will be high - * | | |Write 1 to this bit clears the WOLIF status. - * | | |0 = The EMAC does not receive the Magic Packet. - * | | |1 = The EMAC receives a Magic Packet. - * |[16] |TXIF |Transmit Interrupt - * | | |The TXIF indicates the TX interrupt status. - * | | |If TXIF high and its corresponding enable bit, TXIEN (EMAC_INTEN[16]), is also high indicates - * | | |the EMAC generates TX interrupt to CPU - * | | |If TXIF is high but TXIEN (EMAC_INTEN[16]) is disabled, no TX interrupt is generated. - * | | |The TXIF is logic OR result of bit logic AND result of EMAC_INTSTS[28:17] and EMAC_INTEN[28:17] - * | | |In other words, if any bit of EMAC_INTSTS[28:17] is high and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is also enabled, the TXIF will be high - * | | |Because the TXIF is a logic OR result, clears EMAC_INTSTS[28:17] makes TXIF be cleared, too. - * | | |0 = No status bit in EMAC_INTSTS[28:17] is set or no enable bit in EMAC_INTEN[28:17] is enabled. - * | | |1 = At least one status in EMAC_INTSTS[28:17] is set and its corresponding enable bit - * | | |in EMAC_INTEN[28:17] is enabled, too. - * |[17] |TXUDIF |Transmit FIFO Underflow Interrupt - * | | |The TXUDIF high indicates the TXFIFO underflow occurred during packet transmission - * | | |While the TXFIFO underflow occurred, the EMAC will retransmit the packet automatically - * | | |without S/W intervention - * | | |If the TXFIFO underflow occurred often, it is recommended that modify TXFIFO threshold control, - * | | |the TXFIFOTH of FFTCR register, to higher level. - * | | |If the TXUDIF is high and TXUDIEN (EMAC_INTEN[17]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXUDIF status. - * | | |0 = No TXFIFO underflow occurred during packet transmission. - * | | |1 = TXFIFO underflow occurred during packet transmission. - * |[18] |TXCPIF |Transmit Completion Interrupt - * | | |The TXCPIF indicates the packet transmission has completed correctly. - * | | |If the TXCPIF is high and TXCPIEN (EMAC_INTEN[18]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXCPIF status. - * | | |0 = The packet transmission not completed. - * | | |1 = The packet transmission has completed. - * |[19] |EXDEFIF |Defer Exceed Interrupt - * | | |The EXDEFIF high indicates the frame waiting for transmission has deferred over 0.32768ms - * | | |on 100Mbps mode, or 3.2768ms on 10Mbps mode. - * | | |The deferral exceed check will only be done while bit NODEF of MCMDR is disabled, and EMAC - * | | |is operating on half-duplex mode. - * | | |If the EXDEFIF is high and EXDEFIEN (EMAC_INTEN[19]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the EXDEFIF status. - * | | |0 = Frame waiting for transmission has not deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * | | |1 = Frame waiting for transmission has deferred over 0.32768ms (100Mbps) or 3.2768ms (10Mbps). - * |[20] |NCSIF |No Carrier Sense Interrupt - * | | |The NCSIF high indicates the MII I/F signal CRS does not active at the start of or during - * | | |the packet transmission - * | | |The NCSIF is only available while EMAC is operating on half-duplex mode - * | | |If the NCSIF is high and NCSIEN (EMAC_INTEN[20]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the NCSIF status. - * | | |0 = CRS signal actives correctly. - * | | |1 = CRS signal does not active at the start of or during the packet transmission. - * |[21] |TXABTIF |Transmit Abort Interrupt - * | | |The TXABTIF high indicates the packet incurred 16 consecutive collisions during transmission, - * | | |and then the transmission process for this packet is aborted - * | | |The transmission abort is only available while EMAC is operating on half-duplex mode. - * | | |If the TXABTIF is high and TXABTIEN (EMAC_INTEN[21]) is enabled, the TXIF will be high - * | | |Write 1 to this bit clears the TXABTIF status. - * | | |0 = Packet does not incur 16 consecutive collisions during transmission. - * | | |1 = Packet incurred 16 consecutive collisions during transmission. - * |[22] |LCIF |Late Collision Interrupt - * | | |The LCIF high indicates the collision occurred in the outside of 64 bytes collision window - * | | |This means after the 64 bytes of a frame has been transmitted out to the network, the collision - * | | |still occurred. - * | | |The late collision check will only be done while EMAC is operating on half-duplex mode - * | | |If the LCIF is high and LCIEN (EMAC_INTEN[22]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the LCIF status. - * | | |0 = No collision occurred in the outside of 64 bytes collision window. - * | | |1 = Collision occurred in the outside of 64 bytes collision window. - * |[23] |TDUIF |Transmit Descriptor Unavailable Interrupt - * | | |The TDUIF high indicates that there is no available TX descriptor for packet transmission and - * | | |TXDMA will stay at Halt state. - * | | |Once, the TXDMA enters the Halt state, S/W must issues a write command to TSDR register to make - * | | |TXDMA leave Halt state while new TX descriptor is available. - * | | |If the TDUIF is high and TDUIEN (EMAC_INTEN[23]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TDUIF status. - * | | |0 = TX descriptor is available. - * | | |1 = TX descriptor is unavailable. - * |[24] |TXBEIF |Transmit Bus Error Interrupt - * | | |The TXBEIF high indicates the memory controller replies ERROR response while EMAC access system - * | | |memory through TXDMA during packet transmission process - * | | |Reset EMAC is recommended while TXBEIF status is high. - * | | |If the TXBEIF is high and TXBEIEN (EMAC_INTEN[24]) is enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TXBEIF status. - * | | |0 = No ERROR response is received. - * | | |1 = ERROR response is received. - * |[28] |TSALMIF |Time Stamp Alarm Interrupt - * | | |The TSALMIF high indicates the EMAC_TSSEC register value equals to EMAC_ALMSEC register and - * | | |EMAC_TSSUBSEC register value equals to register EMAC_ALMSUBLSR. - * | | |If TSALMIF is high and TSALMIEN (EMAC_INTEN[28]) enabled, the TXIF will be high. - * | | |Write 1 to this bit clears the TSALMIF status. - * | | |0 = EMAC_TSSEC did not equal EMAC_ALMSEC or EMAC_TSSUBSEC did not equal EMAC_ALMSUBSEC. - * | | |1 = EMAC_TSSEC equals EMAC_ALMSEC and EMAC_TSSUBSEC equals EMAC_ALMSUBSEC. - * @var EMAC_T::GENSTS - * Offset: 0xB4 MAC General Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CFR |Control Frame Received - * | | |The CFRIF high indicates EMAC receives a flow control frame - * | | |The CFRIF only available while EMAC is operating on full duplex mode. - * | | |0 = The EMAC does not receive the flow control frame. - * | | |1 = The EMAC receives a flow control frame. - * |[1] |RXHALT |Receive Halted - * | | |The RXHALT high indicates the next normal packet reception process will be halted because - * | | |the bit RXON of MCMDR is disabled be S/W. - * | | |0 = Next normal packet reception process will go on. - * | | |1 = Next normal packet reception process will be halted. - * |[2] |RXFFULL |RXFIFO Full - * | | |The RXFFULL indicates the RXFIFO is full due to four 64-byte packets are kept in RXFIFO - * | | |and the following incoming packet will be dropped. - * | | |0 = The RXFIFO is not full. - * | | |1 = The RXFIFO is full and the following incoming packet will be dropped. - * |[7:4] |COLCNT |Collision Count - * | | |The COLCNT indicates that how many collisions occurred consecutively during a packet transmission - * | | |If the packet incurred 16 consecutive collisions during transmission, the COLCNT will be - * | | |0 and bit TXABTIF will be set to 1. - * |[8] |DEF |Deferred Transmission - * | | |The DEF high indicates the packet transmission has deferred once - * | | |The DEF is only available while EMAC is operating on half-duplex mode. - * | | |0 = Packet transmission does not defer. - * | | |1 = Packet transmission has deferred once. - * |[9] |TXPAUSED |Transmission Paused - * | | |The TXPAUSED high indicates the next normal packet transmission process will be paused temporally - * | | |because EMAC received a PAUSE control frame. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be paused. - * |[10] |SQE |Signal Quality Error - * | | |The SQE high indicates the SQE error found at end of packet transmission on 10Mbps half-duplex mode - * | | |The SQE error check will only be done while both bit SQECHKEN (EMAC_CTL[17]) is enabled and EMAC - * | | |is operating on 10Mbps half-duplex mode. - * | | |0 = No SQE error found at end of packet transmission. - * | | |1 = SQE error found at end of packet transmission. - * |[11] |TXHALT |Transmission Halted - * | | |The TXHALT high indicates the next normal packet transmission process will be halted because - * | | |the bit TXON (EMAC_CTL[8]) is disabled be S/W. - * | | |0 = Next normal packet transmission process will go on. - * | | |1 = Next normal packet transmission process will be halted. - * |[12] |RPSTS |Remote Pause Status - * | | |The RPSTS indicates that remote pause counter down counting actives. - * | | |After Ethernet MAC controller sent PAUSE frame out successfully, it starts the remote pause - * | | |counter down counting - * | | |When this bit high, it's predictable that remote Ethernet MAC controller wouldn't start the packet - * | | |transmission until the down counting done. - * | | |0 = Remote pause counter down counting done. - * | | |1 = Remote pause counter down counting actives. - * @var EMAC_T::MPCNT - * Offset: 0xB8 Missed Packet Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |MPCNT |Miss Packet Count - * | | |The MPCNT indicates the number of packets that were dropped due to various types of receive errors - * | | |The following type of receiving error makes missed packet counter increase: - * | | |1. Incoming packet is incurred RXFIFO overflow. - * | | |2. Incoming packet is dropped due to RXON is disabled. - * | | |3. Incoming packet is incurred CRC error. - * @var EMAC_T::RPCNT - * Offset: 0xBC MAC Receive Pause Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RPCNT |MAC Receive Pause Count - * | | |The RPCNT keeps the OPERAND field of the PAUSE control frame - * | | |It indicates how many slot time (512 bit time) the TX of EMAC will be paused. - * @var EMAC_T::FRSTS - * Offset: 0xC8 DMA Receive Frame Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |RXFLT |Receive Frame LENGTH - * | | |The RXFLT keeps the LENGTH field of each incoming Ethernet packet - * | | |If the bit DENIEN (EMAC_INTEN[9]) is enabled and the LENGTH field of incoming packet has - * | | |received, the bit DENIF (EMAC_INTSTS[9]) will be set and trigger interrupt. - * | | |And, the content of LENGTH field will be stored in RXFLT. - * @var EMAC_T::CTXDSA - * Offset: 0xCC Current Transmit Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXDSA |Current Transmit Descriptor Start Address - * | | |The CTXDSA keeps the start address of TX descriptor that is used by TXDMA currently - * | | |The CTXDSA is read only and write to this register has no effect. - * @var EMAC_T::CTXBSA - * Offset: 0xD0 Current Transmit Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CTXBSA |Current Transmit Buffer Start Address - * | | |The CTXDSA keeps the start address of TX frame buffer that is used by TXDMA currently - * | | |The CTXBSA is read only and write to this register has no effect. - * @var EMAC_T::CRXDSA - * Offset: 0xD4 Current Receive Descriptor Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXDSA |Current Receive Descriptor Start Address - * | | |The CRXDSA keeps the start address of RX descriptor that is used by RXDMA currently - * | | |The CRXDSA is read only and write to this register has no effect. - * @var EMAC_T::CRXBSA - * Offset: 0xD8 Current Receive Buffer Start Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CRXBSA |Current Receive Buffer Start Address - * | | |The CRXBSA keeps the start address of RX frame buffer that is used by RXDMA currently - * | | |The CRXBSA is read only and write to this register has no effect. - * @var EMAC_T::TSCTL - * Offset: 0x100 Time Stamp Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TSEN |Time Stamp Function Enable Bit - * | | |This bit controls if the IEEE 1588 PTP time stamp function is enabled or not. - * | | |Set this bit high to enable IEEE 1588 PTP time stamp function while set this bit low - * | | |to disable IEEE 1588 PTP time stamp function. - * | | |0 = I EEE 1588 PTP time stamp function Disabled. - * | | |1 = IEEE 1588 PTP time stamp function Enabled. - * |[1] |TSIEN |Time Stamp Counter Initialization Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to load value of register EMAC_UPDSEC - * | | |and EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the load operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = Time stamp counter initialization done. - * | | |1 = Time stamp counter initialization Enabled. - * |[2] |TSMODE |Time Stamp Fine Update Enable Bit - * | | |This bit chooses the time stamp counter update mode. - * | | |0 = Time stamp counter is in coarse update mode. - * | | |1 = Time stamp counter is in fine update mode. - * |[3] |TSUPDATE |Time Stamp Counter Time Update Enable Bit - * | | |Set this bit high enables Ethernet MAC controller to add value of register EMAC_UPDSEC and - * | | |EMAC_UPDSUBSEC to PTP time stamp counter. - * | | |After the add operation finished, Ethernet MAC controller clear this bit to low automatically. - * | | |0 = No action. - * | | |1 = EMAC_UPDSEC updated to EMAC_TSSEC and EMAC_UPDSUBSEC updated to EMAC_TSSUBSEC. - * |[5] |TSALMEN |Time Stamp Alarm Enable Bit - * | | |Set this bit high enable Ethernet MAC controller to set TSALMIF (EMAC_INTSTS[28]) high when - * | | |EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |0 = Alarm disabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * | | |1 = Alarm enabled when EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to EMAC_ALMSUBSEC. - * @var EMAC_T::TSSEC - * Offset: 0x110 Time Stamp Counter Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second - * | | |This register reflects the bit [63:32] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSSUBSEC - * Offset: 0x114 Time Stamp Counter Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second - * | | |This register reflects the bit [31:0] value of 64-bit reference timing counter - * | | |This 32-bit value is used as the sub-second part of time stamp when TSEN (EMAC_TSCTL[0]) is high. - * @var EMAC_T::TSINC - * Offset: 0x118 Time Stamp Increment Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CNTINC |Time Stamp Counter Increment - * | | |Time stamp counter increment value. - * | | |If TSEN (EMAC_TSCTL[0]) is high, EMAC adds EMAC_TSSUBSEC with this 8-bit value every - * | | |time when it wants to increase the EMAC_TSSUBSEC value. - * @var EMAC_T::TSADDEND - * Offset: 0x11C Time Stamp Addend Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ADDEND |Time Stamp Counter Addend - * | | |This register keeps a 32-bit value for accumulator to enable increment of EMAC_TSSUBSEC. - * | | |If TSEN (EMAC_TSCTL[0]) and TSMODE (EMAC_TSCTL[2]) are both high, EMAC increases accumulator - * | | |with this 32-bit value in each HCLK - * | | |Once the accumulator is overflow, it generates a enable to increase EMAC_TSSUBSEC with an 8-bit - * | | |value kept in register EMAC_TSINC. - * @var EMAC_T::UPDSEC - * Offset: 0x120 Time Stamp Update Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSEC with this 32-bit value. - * @var EMAC_T::UPDSUBSEC - * Offset: 0x124 Time Stamp Update Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Update - * | | |When TSIEN (EMAC_TSCTL[1]) is high - * | | |EMAC loads this 32-bit value to EMAC_TSSUBSEC directly - * | | |When TSUPDATE (EMAC_TSCTL[3]) is high, EMAC increases EMAC_TSSUBSEC with this 32-bit value. - * @var EMAC_T::ALMSEC - * Offset: 0x128 Time Stamp Alarm Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEC |Time Stamp Counter Second Alarm - * | | |Time stamp counter second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - * @var EMAC_T::ALMSUBSEC - * Offset: 0x12C Time Stamp Alarm Sub Second Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SUBSEC |Time Stamp Counter Sub-second Alarm - * | | |Time stamp counter sub-second part alarm value. - * | | |This value is only useful when ALMEN (EMAC_TSCTL[5]) high - * | | |If ALMEN (EMAC_TSCTL[5]) is high, EMAC_TSSEC equals to EMAC_ALMSEC and EMAC_TSSUBSEC equals to - * | | |EMAC_ALMSUBSEC, Ethernet MAC controller set TSALMIF (EMAC_INTSTS[28]) high. - */ - __IO uint32_t CAMCTL; /*!< [0x0000] CAM Comparison Control Register */ - __IO uint32_t CAMEN; /*!< [0x0004] CAM Enable Register */ - __IO uint32_t CAM0M; /*!< [0x0008] CAM0 Most Significant Word Register */ - __IO uint32_t CAM0L; /*!< [0x000c] CAM0 Least Significant Word Register */ - __IO uint32_t CAM1M; /*!< [0x0010] CAM1 Most Significant Word Register */ - __IO uint32_t CAM1L; /*!< [0x0014] CAM1 Least Significant Word Register */ - __IO uint32_t CAM2M; /*!< [0x0018] CAM2 Most Significant Word Register */ - __IO uint32_t CAM2L; /*!< [0x001c] CAM2 Least Significant Word Register */ - __IO uint32_t CAM3M; /*!< [0x0020] CAM3 Most Significant Word Register */ - __IO uint32_t CAM3L; /*!< [0x0024] CAM3 Least Significant Word Register */ - __IO uint32_t CAM4M; /*!< [0x0028] CAM4 Most Significant Word Register */ - __IO uint32_t CAM4L; /*!< [0x002c] CAM4 Least Significant Word Register */ - __IO uint32_t CAM5M; /*!< [0x0030] CAM5 Most Significant Word Register */ - __IO uint32_t CAM5L; /*!< [0x0034] CAM5 Least Significant Word Register */ - __IO uint32_t CAM6M; /*!< [0x0038] CAM6 Most Significant Word Register */ - __IO uint32_t CAM6L; /*!< [0x003c] CAM6 Least Significant Word Register */ - __IO uint32_t CAM7M; /*!< [0x0040] CAM7 Most Significant Word Register */ - __IO uint32_t CAM7L; /*!< [0x0044] CAM7 Least Significant Word Register */ - __IO uint32_t CAM8M; /*!< [0x0048] CAM8 Most Significant Word Register */ - __IO uint32_t CAM8L; /*!< [0x004c] CAM8 Least Significant Word Register */ - __IO uint32_t CAM9M; /*!< [0x0050] CAM9 Most Significant Word Register */ - __IO uint32_t CAM9L; /*!< [0x0054] CAM9 Least Significant Word Register */ - __IO uint32_t CAM10M; /*!< [0x0058] CAM10 Most Significant Word Register */ - __IO uint32_t CAM10L; /*!< [0x005c] CAM10 Least Significant Word Register */ - __IO uint32_t CAM11M; /*!< [0x0060] CAM11 Most Significant Word Register */ - __IO uint32_t CAM11L; /*!< [0x0064] CAM11 Least Significant Word Register */ - __IO uint32_t CAM12M; /*!< [0x0068] CAM12 Most Significant Word Register */ - __IO uint32_t CAM12L; /*!< [0x006c] CAM12 Least Significant Word Register */ - __IO uint32_t CAM13M; /*!< [0x0070] CAM13 Most Significant Word Register */ - __IO uint32_t CAM13L; /*!< [0x0074] CAM13 Least Significant Word Register */ - __IO uint32_t CAM14M; /*!< [0x0078] CAM14 Most Significant Word Register */ - __IO uint32_t CAM14L; /*!< [0x007c] CAM14 Least Significant Word Register */ - __IO uint32_t CAM15MSB; /*!< [0x0080] CAM15 Most Significant Word Register */ - __IO uint32_t CAM15LSB; /*!< [0x0084] CAM15 Least Significant Word Register */ - __IO uint32_t TXDSA; /*!< [0x0088] Transmit Descriptor Link List Start Address Register */ - __IO uint32_t RXDSA; /*!< [0x008c] Receive Descriptor Link List Start Address Register */ - __IO uint32_t CTL; /*!< [0x0090] MAC Control Register */ - __IO uint32_t MIIMDAT; /*!< [0x0094] MII Management Data Register */ - __IO uint32_t MIIMCTL; /*!< [0x0098] MII Management Control and Address Register */ - __IO uint32_t FIFOCTL; /*!< [0x009c] FIFO Threshold Control Register */ - __O uint32_t TXST; /*!< [0x00a0] Transmit Start Demand Register */ - __O uint32_t RXST; /*!< [0x00a4] Receive Start Demand Register */ - __IO uint32_t MRFL; /*!< [0x00a8] Maximum Receive Frame Control Register */ - __IO uint32_t INTEN; /*!< [0x00ac] MAC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x00b0] MAC Interrupt Status Register */ - __IO uint32_t GENSTS; /*!< [0x00b4] MAC General Status Register */ - __IO uint32_t MPCNT; /*!< [0x00b8] Missed Packet Count Register */ - __I uint32_t RPCNT; /*!< [0x00bc] MAC Receive Pause Count Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE0[2]; - /** @endcond */ - __IO uint32_t FRSTS; /*!< [0x00c8] DMA Receive Frame Status Register */ - __I uint32_t CTXDSA; /*!< [0x00cc] Current Transmit Descriptor Start Address Register */ - __I uint32_t CTXBSA; /*!< [0x00d0] Current Transmit Buffer Start Address Register */ - __I uint32_t CRXDSA; /*!< [0x00d4] Current Receive Descriptor Start Address Register */ - __I uint32_t CRXBSA; /*!< [0x00d8] Current Receive Buffer Start Address Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE1[9]; - /** @endcond */ - __IO uint32_t TSCTL; /*!< [0x0100] Time Stamp Control Register */ - /** @cond HIDDEN_SYMBOLS */ - __I uint32_t RESERVE2[3]; - /** @endcond */ - __I uint32_t TSSEC; /*!< [0x0110] Time Stamp Counter Second Register */ - __I uint32_t TSSUBSEC; /*!< [0x0114] Time Stamp Counter Sub Second Register */ - __IO uint32_t TSINC; /*!< [0x0118] Time Stamp Increment Register */ - __IO uint32_t TSADDEND; /*!< [0x011c] Time Stamp Addend Register */ - __IO uint32_t UPDSEC; /*!< [0x0120] Time Stamp Update Second Register */ - __IO uint32_t UPDSUBSEC; /*!< [0x0124] Time Stamp Update Sub Second Register */ - __IO uint32_t ALMSEC; /*!< [0x0128] Time Stamp Alarm Second Register */ - __IO uint32_t ALMSUBSEC; /*!< [0x012c] Time Stamp Alarm Sub Second Register */ - -} EMAC_T; - -/** - @addtogroup EMAC_CONST EMAC Bit Field Definition - Constant Definitions for EMAC Controller -@{ */ - -#define EMAC_CAMCTL_AUP_Pos (0) /*!< EMAC_T::CAMCTL: AUP Position */ -#define EMAC_CAMCTL_AUP_Msk (0x1ul << EMAC_CAMCTL_AUP_Pos) /*!< EMAC_T::CAMCTL: AUP Mask */ - -#define EMAC_CAMCTL_AMP_Pos (1) /*!< EMAC_T::CAMCTL: AMP Position */ -#define EMAC_CAMCTL_AMP_Msk (0x1ul << EMAC_CAMCTL_AMP_Pos) /*!< EMAC_T::CAMCTL: AMP Mask */ - -#define EMAC_CAMCTL_ABP_Pos (2) /*!< EMAC_T::CAMCTL: ABP Position */ -#define EMAC_CAMCTL_ABP_Msk (0x1ul << EMAC_CAMCTL_ABP_Pos) /*!< EMAC_T::CAMCTL: ABP Mask */ - -#define EMAC_CAMCTL_COMPEN_Pos (3) /*!< EMAC_T::CAMCTL: COMPEN Position */ -#define EMAC_CAMCTL_COMPEN_Msk (0x1ul << EMAC_CAMCTL_COMPEN_Pos) /*!< EMAC_T::CAMCTL: COMPEN Mask */ - -#define EMAC_CAMCTL_CMPEN_Pos (4) /*!< EMAC_T::CAMCTL: CMPEN Position */ -#define EMAC_CAMCTL_CMPEN_Msk (0x1ul << EMAC_CAMCTL_CMPEN_Pos) /*!< EMAC_T::CAMCTL: CMPEN Mask */ - -#define EMAC_CAMEN_CAMxEN_Pos (0) /*!< EMAC_T::CAMEN: CAMxEN Position */ -#define EMAC_CAMEN_CAMxEN_Msk (0x1ul << EMAC_CAMEN_CAMxEN_Pos) /*!< EMAC_T::CAMEN: CAMxEN Mask */ - -#define EMAC_CAM0M_MACADDR2_Pos (0) /*!< EMAC_T::CAM0M: MACADDR2 Position */ -#define EMAC_CAM0M_MACADDR2_Msk (0xfful << EMAC_CAM0M_MACADDR2_Pos) /*!< EMAC_T::CAM0M: MACADDR2 Mask */ - -#define EMAC_CAM0M_MACADDR3_Pos (8) /*!< EMAC_T::CAM0M: MACADDR3 Position */ -#define EMAC_CAM0M_MACADDR3_Msk (0xfful << EMAC_CAM0M_MACADDR3_Pos) /*!< EMAC_T::CAM0M: MACADDR3 Mask */ - -#define EMAC_CAM0M_MACADDR4_Pos (16) /*!< EMAC_T::CAM0M: MACADDR4 Position */ -#define EMAC_CAM0M_MACADDR4_Msk (0xfful << EMAC_CAM0M_MACADDR4_Pos) /*!< EMAC_T::CAM0M: MACADDR4 Mask */ - -#define EMAC_CAM0M_MACADDR5_Pos (24) /*!< EMAC_T::CAM0M: MACADDR5 Position */ -#define EMAC_CAM0M_MACADDR5_Msk (0xfful << EMAC_CAM0M_MACADDR5_Pos) /*!< EMAC_T::CAM0M: MACADDR5 Mask */ - -#define EMAC_CAM0L_MACADDR0_Pos (16) /*!< EMAC_T::CAM0L: MACADDR0 Position */ -#define EMAC_CAM0L_MACADDR0_Msk (0xfful << EMAC_CAM0L_MACADDR0_Pos) /*!< EMAC_T::CAM0L: MACADDR0 Mask */ - -#define EMAC_CAM0L_MACADDR1_Pos (24) /*!< EMAC_T::CAM0L: MACADDR1 Position */ -#define EMAC_CAM0L_MACADDR1_Msk (0xfful << EMAC_CAM0L_MACADDR1_Pos) /*!< EMAC_T::CAM0L: MACADDR1 Mask */ - -#define EMAC_CAM1M_MACADDR2_Pos (0) /*!< EMAC_T::CAM1M: MACADDR2 Position */ -#define EMAC_CAM1M_MACADDR2_Msk (0xfful << EMAC_CAM1M_MACADDR2_Pos) /*!< EMAC_T::CAM1M: MACADDR2 Mask */ - -#define EMAC_CAM1M_MACADDR3_Pos (8) /*!< EMAC_T::CAM1M: MACADDR3 Position */ -#define EMAC_CAM1M_MACADDR3_Msk (0xfful << EMAC_CAM1M_MACADDR3_Pos) /*!< EMAC_T::CAM1M: MACADDR3 Mask */ - -#define EMAC_CAM1M_MACADDR4_Pos (16) /*!< EMAC_T::CAM1M: MACADDR4 Position */ -#define EMAC_CAM1M_MACADDR4_Msk (0xfful << EMAC_CAM1M_MACADDR4_Pos) /*!< EMAC_T::CAM1M: MACADDR4 Mask */ - -#define EMAC_CAM1M_MACADDR5_Pos (24) /*!< EMAC_T::CAM1M: MACADDR5 Position */ -#define EMAC_CAM1M_MACADDR5_Msk (0xfful << EMAC_CAM1M_MACADDR5_Pos) /*!< EMAC_T::CAM1M: MACADDR5 Mask */ - -#define EMAC_CAM1L_MACADDR0_Pos (16) /*!< EMAC_T::CAM1L: MACADDR0 Position */ -#define EMAC_CAM1L_MACADDR0_Msk (0xfful << EMAC_CAM1L_MACADDR0_Pos) /*!< EMAC_T::CAM1L: MACADDR0 Mask */ - -#define EMAC_CAM1L_MACADDR1_Pos (24) /*!< EMAC_T::CAM1L: MACADDR1 Position */ -#define EMAC_CAM1L_MACADDR1_Msk (0xfful << EMAC_CAM1L_MACADDR1_Pos) /*!< EMAC_T::CAM1L: MACADDR1 Mask */ - -#define EMAC_CAM2M_MACADDR2_Pos (0) /*!< EMAC_T::CAM2M: MACADDR2 Position */ -#define EMAC_CAM2M_MACADDR2_Msk (0xfful << EMAC_CAM2M_MACADDR2_Pos) /*!< EMAC_T::CAM2M: MACADDR2 Mask */ - -#define EMAC_CAM2M_MACADDR3_Pos (8) /*!< EMAC_T::CAM2M: MACADDR3 Position */ -#define EMAC_CAM2M_MACADDR3_Msk (0xfful << EMAC_CAM2M_MACADDR3_Pos) /*!< EMAC_T::CAM2M: MACADDR3 Mask */ - -#define EMAC_CAM2M_MACADDR4_Pos (16) /*!< EMAC_T::CAM2M: MACADDR4 Position */ -#define EMAC_CAM2M_MACADDR4_Msk (0xfful << EMAC_CAM2M_MACADDR4_Pos) /*!< EMAC_T::CAM2M: MACADDR4 Mask */ - -#define EMAC_CAM2M_MACADDR5_Pos (24) /*!< EMAC_T::CAM2M: MACADDR5 Position */ -#define EMAC_CAM2M_MACADDR5_Msk (0xfful << EMAC_CAM2M_MACADDR5_Pos) /*!< EMAC_T::CAM2M: MACADDR5 Mask */ - -#define EMAC_CAM2L_MACADDR0_Pos (16) /*!< EMAC_T::CAM2L: MACADDR0 Position */ -#define EMAC_CAM2L_MACADDR0_Msk (0xfful << EMAC_CAM2L_MACADDR0_Pos) /*!< EMAC_T::CAM2L: MACADDR0 Mask */ - -#define EMAC_CAM2L_MACADDR1_Pos (24) /*!< EMAC_T::CAM2L: MACADDR1 Position */ -#define EMAC_CAM2L_MACADDR1_Msk (0xfful << EMAC_CAM2L_MACADDR1_Pos) /*!< EMAC_T::CAM2L: MACADDR1 Mask */ - -#define EMAC_CAM3M_MACADDR2_Pos (0) /*!< EMAC_T::CAM3M: MACADDR2 Position */ -#define EMAC_CAM3M_MACADDR2_Msk (0xfful << EMAC_CAM3M_MACADDR2_Pos) /*!< EMAC_T::CAM3M: MACADDR2 Mask */ - -#define EMAC_CAM3M_MACADDR3_Pos (8) /*!< EMAC_T::CAM3M: MACADDR3 Position */ -#define EMAC_CAM3M_MACADDR3_Msk (0xfful << EMAC_CAM3M_MACADDR3_Pos) /*!< EMAC_T::CAM3M: MACADDR3 Mask */ - -#define EMAC_CAM3M_MACADDR4_Pos (16) /*!< EMAC_T::CAM3M: MACADDR4 Position */ -#define EMAC_CAM3M_MACADDR4_Msk (0xfful << EMAC_CAM3M_MACADDR4_Pos) /*!< EMAC_T::CAM3M: MACADDR4 Mask */ - -#define EMAC_CAM3M_MACADDR5_Pos (24) /*!< EMAC_T::CAM3M: MACADDR5 Position */ -#define EMAC_CAM3M_MACADDR5_Msk (0xfful << EMAC_CAM3M_MACADDR5_Pos) /*!< EMAC_T::CAM3M: MACADDR5 Mask */ - -#define EMAC_CAM3L_MACADDR0_Pos (16) /*!< EMAC_T::CAM3L: MACADDR0 Position */ -#define EMAC_CAM3L_MACADDR0_Msk (0xfful << EMAC_CAM3L_MACADDR0_Pos) /*!< EMAC_T::CAM3L: MACADDR0 Mask */ - -#define EMAC_CAM3L_MACADDR1_Pos (24) /*!< EMAC_T::CAM3L: MACADDR1 Position */ -#define EMAC_CAM3L_MACADDR1_Msk (0xfful << EMAC_CAM3L_MACADDR1_Pos) /*!< EMAC_T::CAM3L: MACADDR1 Mask */ - -#define EMAC_CAM4M_MACADDR2_Pos (0) /*!< EMAC_T::CAM4M: MACADDR2 Position */ -#define EMAC_CAM4M_MACADDR2_Msk (0xfful << EMAC_CAM4M_MACADDR2_Pos) /*!< EMAC_T::CAM4M: MACADDR2 Mask */ - -#define EMAC_CAM4M_MACADDR3_Pos (8) /*!< EMAC_T::CAM4M: MACADDR3 Position */ -#define EMAC_CAM4M_MACADDR3_Msk (0xfful << EMAC_CAM4M_MACADDR3_Pos) /*!< EMAC_T::CAM4M: MACADDR3 Mask */ - -#define EMAC_CAM4M_MACADDR4_Pos (16) /*!< EMAC_T::CAM4M: MACADDR4 Position */ -#define EMAC_CAM4M_MACADDR4_Msk (0xfful << EMAC_CAM4M_MACADDR4_Pos) /*!< EMAC_T::CAM4M: MACADDR4 Mask */ - -#define EMAC_CAM4M_MACADDR5_Pos (24) /*!< EMAC_T::CAM4M: MACADDR5 Position */ -#define EMAC_CAM4M_MACADDR5_Msk (0xfful << EMAC_CAM4M_MACADDR5_Pos) /*!< EMAC_T::CAM4M: MACADDR5 Mask */ - -#define EMAC_CAM4L_MACADDR0_Pos (16) /*!< EMAC_T::CAM4L: MACADDR0 Position */ -#define EMAC_CAM4L_MACADDR0_Msk (0xfful << EMAC_CAM4L_MACADDR0_Pos) /*!< EMAC_T::CAM4L: MACADDR0 Mask */ - -#define EMAC_CAM4L_MACADDR1_Pos (24) /*!< EMAC_T::CAM4L: MACADDR1 Position */ -#define EMAC_CAM4L_MACADDR1_Msk (0xfful << EMAC_CAM4L_MACADDR1_Pos) /*!< EMAC_T::CAM4L: MACADDR1 Mask */ - -#define EMAC_CAM5M_MACADDR2_Pos (0) /*!< EMAC_T::CAM5M: MACADDR2 Position */ -#define EMAC_CAM5M_MACADDR2_Msk (0xfful << EMAC_CAM5M_MACADDR2_Pos) /*!< EMAC_T::CAM5M: MACADDR2 Mask */ - -#define EMAC_CAM5M_MACADDR3_Pos (8) /*!< EMAC_T::CAM5M: MACADDR3 Position */ -#define EMAC_CAM5M_MACADDR3_Msk (0xfful << EMAC_CAM5M_MACADDR3_Pos) /*!< EMAC_T::CAM5M: MACADDR3 Mask */ - -#define EMAC_CAM5M_MACADDR4_Pos (16) /*!< EMAC_T::CAM5M: MACADDR4 Position */ -#define EMAC_CAM5M_MACADDR4_Msk (0xfful << EMAC_CAM5M_MACADDR4_Pos) /*!< EMAC_T::CAM5M: MACADDR4 Mask */ - -#define EMAC_CAM5M_MACADDR5_Pos (24) /*!< EMAC_T::CAM5M: MACADDR5 Position */ -#define EMAC_CAM5M_MACADDR5_Msk (0xfful << EMAC_CAM5M_MACADDR5_Pos) /*!< EMAC_T::CAM5M: MACADDR5 Mask */ - -#define EMAC_CAM5L_MACADDR0_Pos (16) /*!< EMAC_T::CAM5L: MACADDR0 Position */ -#define EMAC_CAM5L_MACADDR0_Msk (0xfful << EMAC_CAM5L_MACADDR0_Pos) /*!< EMAC_T::CAM5L: MACADDR0 Mask */ - -#define EMAC_CAM5L_MACADDR1_Pos (24) /*!< EMAC_T::CAM5L: MACADDR1 Position */ -#define EMAC_CAM5L_MACADDR1_Msk (0xfful << EMAC_CAM5L_MACADDR1_Pos) /*!< EMAC_T::CAM5L: MACADDR1 Mask */ - -#define EMAC_CAM6M_MACADDR2_Pos (0) /*!< EMAC_T::CAM6M: MACADDR2 Position */ -#define EMAC_CAM6M_MACADDR2_Msk (0xfful << EMAC_CAM6M_MACADDR2_Pos) /*!< EMAC_T::CAM6M: MACADDR2 Mask */ - -#define EMAC_CAM6M_MACADDR3_Pos (8) /*!< EMAC_T::CAM6M: MACADDR3 Position */ -#define EMAC_CAM6M_MACADDR3_Msk (0xfful << EMAC_CAM6M_MACADDR3_Pos) /*!< EMAC_T::CAM6M: MACADDR3 Mask */ - -#define EMAC_CAM6M_MACADDR4_Pos (16) /*!< EMAC_T::CAM6M: MACADDR4 Position */ -#define EMAC_CAM6M_MACADDR4_Msk (0xfful << EMAC_CAM6M_MACADDR4_Pos) /*!< EMAC_T::CAM6M: MACADDR4 Mask */ - -#define EMAC_CAM6M_MACADDR5_Pos (24) /*!< EMAC_T::CAM6M: MACADDR5 Position */ -#define EMAC_CAM6M_MACADDR5_Msk (0xfful << EMAC_CAM6M_MACADDR5_Pos) /*!< EMAC_T::CAM6M: MACADDR5 Mask */ - -#define EMAC_CAM6L_MACADDR0_Pos (16) /*!< EMAC_T::CAM6L: MACADDR0 Position */ -#define EMAC_CAM6L_MACADDR0_Msk (0xfful << EMAC_CAM6L_MACADDR0_Pos) /*!< EMAC_T::CAM6L: MACADDR0 Mask */ - -#define EMAC_CAM6L_MACADDR1_Pos (24) /*!< EMAC_T::CAM6L: MACADDR1 Position */ -#define EMAC_CAM6L_MACADDR1_Msk (0xfful << EMAC_CAM6L_MACADDR1_Pos) /*!< EMAC_T::CAM6L: MACADDR1 Mask */ - -#define EMAC_CAM7M_MACADDR2_Pos (0) /*!< EMAC_T::CAM7M: MACADDR2 Position */ -#define EMAC_CAM7M_MACADDR2_Msk (0xfful << EMAC_CAM7M_MACADDR2_Pos) /*!< EMAC_T::CAM7M: MACADDR2 Mask */ - -#define EMAC_CAM7M_MACADDR3_Pos (8) /*!< EMAC_T::CAM7M: MACADDR3 Position */ -#define EMAC_CAM7M_MACADDR3_Msk (0xfful << EMAC_CAM7M_MACADDR3_Pos) /*!< EMAC_T::CAM7M: MACADDR3 Mask */ - -#define EMAC_CAM7M_MACADDR4_Pos (16) /*!< EMAC_T::CAM7M: MACADDR4 Position */ -#define EMAC_CAM7M_MACADDR4_Msk (0xfful << EMAC_CAM7M_MACADDR4_Pos) /*!< EMAC_T::CAM7M: MACADDR4 Mask */ - -#define EMAC_CAM7M_MACADDR5_Pos (24) /*!< EMAC_T::CAM7M: MACADDR5 Position */ -#define EMAC_CAM7M_MACADDR5_Msk (0xfful << EMAC_CAM7M_MACADDR5_Pos) /*!< EMAC_T::CAM7M: MACADDR5 Mask */ - -#define EMAC_CAM7L_MACADDR0_Pos (16) /*!< EMAC_T::CAM7L: MACADDR0 Position */ -#define EMAC_CAM7L_MACADDR0_Msk (0xfful << EMAC_CAM7L_MACADDR0_Pos) /*!< EMAC_T::CAM7L: MACADDR0 Mask */ - -#define EMAC_CAM7L_MACADDR1_Pos (24) /*!< EMAC_T::CAM7L: MACADDR1 Position */ -#define EMAC_CAM7L_MACADDR1_Msk (0xfful << EMAC_CAM7L_MACADDR1_Pos) /*!< EMAC_T::CAM7L: MACADDR1 Mask */ - -#define EMAC_CAM8M_MACADDR2_Pos (0) /*!< EMAC_T::CAM8M: MACADDR2 Position */ -#define EMAC_CAM8M_MACADDR2_Msk (0xfful << EMAC_CAM8M_MACADDR2_Pos) /*!< EMAC_T::CAM8M: MACADDR2 Mask */ - -#define EMAC_CAM8M_MACADDR3_Pos (8) /*!< EMAC_T::CAM8M: MACADDR3 Position */ -#define EMAC_CAM8M_MACADDR3_Msk (0xfful << EMAC_CAM8M_MACADDR3_Pos) /*!< EMAC_T::CAM8M: MACADDR3 Mask */ - -#define EMAC_CAM8M_MACADDR4_Pos (16) /*!< EMAC_T::CAM8M: MACADDR4 Position */ -#define EMAC_CAM8M_MACADDR4_Msk (0xfful << EMAC_CAM8M_MACADDR4_Pos) /*!< EMAC_T::CAM8M: MACADDR4 Mask */ - -#define EMAC_CAM8M_MACADDR5_Pos (24) /*!< EMAC_T::CAM8M: MACADDR5 Position */ -#define EMAC_CAM8M_MACADDR5_Msk (0xfful << EMAC_CAM8M_MACADDR5_Pos) /*!< EMAC_T::CAM8M: MACADDR5 Mask */ - -#define EMAC_CAM8L_MACADDR0_Pos (16) /*!< EMAC_T::CAM8L: MACADDR0 Position */ -#define EMAC_CAM8L_MACADDR0_Msk (0xfful << EMAC_CAM8L_MACADDR0_Pos) /*!< EMAC_T::CAM8L: MACADDR0 Mask */ - -#define EMAC_CAM8L_MACADDR1_Pos (24) /*!< EMAC_T::CAM8L: MACADDR1 Position */ -#define EMAC_CAM8L_MACADDR1_Msk (0xfful << EMAC_CAM8L_MACADDR1_Pos) /*!< EMAC_T::CAM8L: MACADDR1 Mask */ - -#define EMAC_CAM9M_MACADDR2_Pos (0) /*!< EMAC_T::CAM9M: MACADDR2 Position */ -#define EMAC_CAM9M_MACADDR2_Msk (0xfful << EMAC_CAM9M_MACADDR2_Pos) /*!< EMAC_T::CAM9M: MACADDR2 Mask */ - -#define EMAC_CAM9M_MACADDR3_Pos (8) /*!< EMAC_T::CAM9M: MACADDR3 Position */ -#define EMAC_CAM9M_MACADDR3_Msk (0xfful << EMAC_CAM9M_MACADDR3_Pos) /*!< EMAC_T::CAM9M: MACADDR3 Mask */ - -#define EMAC_CAM9M_MACADDR4_Pos (16) /*!< EMAC_T::CAM9M: MACADDR4 Position */ -#define EMAC_CAM9M_MACADDR4_Msk (0xfful << EMAC_CAM9M_MACADDR4_Pos) /*!< EMAC_T::CAM9M: MACADDR4 Mask */ - -#define EMAC_CAM9M_MACADDR5_Pos (24) /*!< EMAC_T::CAM9M: MACADDR5 Position */ -#define EMAC_CAM9M_MACADDR5_Msk (0xfful << EMAC_CAM9M_MACADDR5_Pos) /*!< EMAC_T::CAM9M: MACADDR5 Mask */ - -#define EMAC_CAM9L_MACADDR0_Pos (16) /*!< EMAC_T::CAM9L: MACADDR0 Position */ -#define EMAC_CAM9L_MACADDR0_Msk (0xfful << EMAC_CAM9L_MACADDR0_Pos) /*!< EMAC_T::CAM9L: MACADDR0 Mask */ - -#define EMAC_CAM9L_MACADDR1_Pos (24) /*!< EMAC_T::CAM9L: MACADDR1 Position */ -#define EMAC_CAM9L_MACADDR1_Msk (0xfful << EMAC_CAM9L_MACADDR1_Pos) /*!< EMAC_T::CAM9L: MACADDR1 Mask */ - -#define EMAC_CAM10M_MACADDR2_Pos (0) /*!< EMAC_T::CAM10M: MACADDR2 Position */ -#define EMAC_CAM10M_MACADDR2_Msk (0xfful << EMAC_CAM10M_MACADDR2_Pos) /*!< EMAC_T::CAM10M: MACADDR2 Mask */ - -#define EMAC_CAM10M_MACADDR3_Pos (8) /*!< EMAC_T::CAM10M: MACADDR3 Position */ -#define EMAC_CAM10M_MACADDR3_Msk (0xfful << EMAC_CAM10M_MACADDR3_Pos) /*!< EMAC_T::CAM10M: MACADDR3 Mask */ - -#define EMAC_CAM10M_MACADDR4_Pos (16) /*!< EMAC_T::CAM10M: MACADDR4 Position */ -#define EMAC_CAM10M_MACADDR4_Msk (0xfful << EMAC_CAM10M_MACADDR4_Pos) /*!< EMAC_T::CAM10M: MACADDR4 Mask */ - -#define EMAC_CAM10M_MACADDR5_Pos (24) /*!< EMAC_T::CAM10M: MACADDR5 Position */ -#define EMAC_CAM10M_MACADDR5_Msk (0xfful << EMAC_CAM10M_MACADDR5_Pos) /*!< EMAC_T::CAM10M: MACADDR5 Mask */ - -#define EMAC_CAM10L_MACADDR0_Pos (16) /*!< EMAC_T::CAM10L: MACADDR0 Position */ -#define EMAC_CAM10L_MACADDR0_Msk (0xfful << EMAC_CAM10L_MACADDR0_Pos) /*!< EMAC_T::CAM10L: MACADDR0 Mask */ - -#define EMAC_CAM10L_MACADDR1_Pos (24) /*!< EMAC_T::CAM10L: MACADDR1 Position */ -#define EMAC_CAM10L_MACADDR1_Msk (0xfful << EMAC_CAM10L_MACADDR1_Pos) /*!< EMAC_T::CAM10L: MACADDR1 Mask */ - -#define EMAC_CAM11M_MACADDR2_Pos (0) /*!< EMAC_T::CAM11M: MACADDR2 Position */ -#define EMAC_CAM11M_MACADDR2_Msk (0xfful << EMAC_CAM11M_MACADDR2_Pos) /*!< EMAC_T::CAM11M: MACADDR2 Mask */ - -#define EMAC_CAM11M_MACADDR3_Pos (8) /*!< EMAC_T::CAM11M: MACADDR3 Position */ -#define EMAC_CAM11M_MACADDR3_Msk (0xfful << EMAC_CAM11M_MACADDR3_Pos) /*!< EMAC_T::CAM11M: MACADDR3 Mask */ - -#define EMAC_CAM11M_MACADDR4_Pos (16) /*!< EMAC_T::CAM11M: MACADDR4 Position */ -#define EMAC_CAM11M_MACADDR4_Msk (0xfful << EMAC_CAM11M_MACADDR4_Pos) /*!< EMAC_T::CAM11M: MACADDR4 Mask */ - -#define EMAC_CAM11M_MACADDR5_Pos (24) /*!< EMAC_T::CAM11M: MACADDR5 Position */ -#define EMAC_CAM11M_MACADDR5_Msk (0xfful << EMAC_CAM11M_MACADDR5_Pos) /*!< EMAC_T::CAM11M: MACADDR5 Mask */ - -#define EMAC_CAM11L_MACADDR0_Pos (16) /*!< EMAC_T::CAM11L: MACADDR0 Position */ -#define EMAC_CAM11L_MACADDR0_Msk (0xfful << EMAC_CAM11L_MACADDR0_Pos) /*!< EMAC_T::CAM11L: MACADDR0 Mask */ - -#define EMAC_CAM11L_MACADDR1_Pos (24) /*!< EMAC_T::CAM11L: MACADDR1 Position */ -#define EMAC_CAM11L_MACADDR1_Msk (0xfful << EMAC_CAM11L_MACADDR1_Pos) /*!< EMAC_T::CAM11L: MACADDR1 Mask */ - -#define EMAC_CAM12M_MACADDR2_Pos (0) /*!< EMAC_T::CAM12M: MACADDR2 Position */ -#define EMAC_CAM12M_MACADDR2_Msk (0xfful << EMAC_CAM12M_MACADDR2_Pos) /*!< EMAC_T::CAM12M: MACADDR2 Mask */ - -#define EMAC_CAM12M_MACADDR3_Pos (8) /*!< EMAC_T::CAM12M: MACADDR3 Position */ -#define EMAC_CAM12M_MACADDR3_Msk (0xfful << EMAC_CAM12M_MACADDR3_Pos) /*!< EMAC_T::CAM12M: MACADDR3 Mask */ - -#define EMAC_CAM12M_MACADDR4_Pos (16) /*!< EMAC_T::CAM12M: MACADDR4 Position */ -#define EMAC_CAM12M_MACADDR4_Msk (0xfful << EMAC_CAM12M_MACADDR4_Pos) /*!< EMAC_T::CAM12M: MACADDR4 Mask */ - -#define EMAC_CAM12M_MACADDR5_Pos (24) /*!< EMAC_T::CAM12M: MACADDR5 Position */ -#define EMAC_CAM12M_MACADDR5_Msk (0xfful << EMAC_CAM12M_MACADDR5_Pos) /*!< EMAC_T::CAM12M: MACADDR5 Mask */ - -#define EMAC_CAM12L_MACADDR0_Pos (16) /*!< EMAC_T::CAM12L: MACADDR0 Position */ -#define EMAC_CAM12L_MACADDR0_Msk (0xfful << EMAC_CAM12L_MACADDR0_Pos) /*!< EMAC_T::CAM12L: MACADDR0 Mask */ - -#define EMAC_CAM12L_MACADDR1_Pos (24) /*!< EMAC_T::CAM12L: MACADDR1 Position */ -#define EMAC_CAM12L_MACADDR1_Msk (0xfful << EMAC_CAM12L_MACADDR1_Pos) /*!< EMAC_T::CAM12L: MACADDR1 Mask */ - -#define EMAC_CAM13M_MACADDR2_Pos (0) /*!< EMAC_T::CAM13M: MACADDR2 Position */ -#define EMAC_CAM13M_MACADDR2_Msk (0xfful << EMAC_CAM13M_MACADDR2_Pos) /*!< EMAC_T::CAM13M: MACADDR2 Mask */ - -#define EMAC_CAM13M_MACADDR3_Pos (8) /*!< EMAC_T::CAM13M: MACADDR3 Position */ -#define EMAC_CAM13M_MACADDR3_Msk (0xfful << EMAC_CAM13M_MACADDR3_Pos) /*!< EMAC_T::CAM13M: MACADDR3 Mask */ - -#define EMAC_CAM13M_MACADDR4_Pos (16) /*!< EMAC_T::CAM13M: MACADDR4 Position */ -#define EMAC_CAM13M_MACADDR4_Msk (0xfful << EMAC_CAM13M_MACADDR4_Pos) /*!< EMAC_T::CAM13M: MACADDR4 Mask */ - -#define EMAC_CAM13M_MACADDR5_Pos (24) /*!< EMAC_T::CAM13M: MACADDR5 Position */ -#define EMAC_CAM13M_MACADDR5_Msk (0xfful << EMAC_CAM13M_MACADDR5_Pos) /*!< EMAC_T::CAM13M: MACADDR5 Mask */ - -#define EMAC_CAM13L_MACADDR0_Pos (16) /*!< EMAC_T::CAM13L: MACADDR0 Position */ -#define EMAC_CAM13L_MACADDR0_Msk (0xfful << EMAC_CAM13L_MACADDR0_Pos) /*!< EMAC_T::CAM13L: MACADDR0 Mask */ - -#define EMAC_CAM13L_MACADDR1_Pos (24) /*!< EMAC_T::CAM13L: MACADDR1 Position */ -#define EMAC_CAM13L_MACADDR1_Msk (0xfful << EMAC_CAM13L_MACADDR1_Pos) /*!< EMAC_T::CAM13L: MACADDR1 Mask */ - -#define EMAC_CAM14M_MACADDR2_Pos (0) /*!< EMAC_T::CAM14M: MACADDR2 Position */ -#define EMAC_CAM14M_MACADDR2_Msk (0xfful << EMAC_CAM14M_MACADDR2_Pos) /*!< EMAC_T::CAM14M: MACADDR2 Mask */ - -#define EMAC_CAM14M_MACADDR3_Pos (8) /*!< EMAC_T::CAM14M: MACADDR3 Position */ -#define EMAC_CAM14M_MACADDR3_Msk (0xfful << EMAC_CAM14M_MACADDR3_Pos) /*!< EMAC_T::CAM14M: MACADDR3 Mask */ - -#define EMAC_CAM14M_MACADDR4_Pos (16) /*!< EMAC_T::CAM14M: MACADDR4 Position */ -#define EMAC_CAM14M_MACADDR4_Msk (0xfful << EMAC_CAM14M_MACADDR4_Pos) /*!< EMAC_T::CAM14M: MACADDR4 Mask */ - -#define EMAC_CAM14M_MACADDR5_Pos (24) /*!< EMAC_T::CAM14M: MACADDR5 Position */ -#define EMAC_CAM14M_MACADDR5_Msk (0xfful << EMAC_CAM14M_MACADDR5_Pos) /*!< EMAC_T::CAM14M: MACADDR5 Mask */ - -#define EMAC_CAM14L_MACADDR0_Pos (16) /*!< EMAC_T::CAM14L: MACADDR0 Position */ -#define EMAC_CAM14L_MACADDR0_Msk (0xfful << EMAC_CAM14L_MACADDR0_Pos) /*!< EMAC_T::CAM14L: MACADDR0 Mask */ - -#define EMAC_CAM14L_MACADDR1_Pos (24) /*!< EMAC_T::CAM14L: MACADDR1 Position */ -#define EMAC_CAM14L_MACADDR1_Msk (0xfful << EMAC_CAM14L_MACADDR1_Pos) /*!< EMAC_T::CAM14L: MACADDR1 Mask */ - -#define EMAC_CAM15MSB_OPCODE_Pos (0) /*!< EMAC_T::CAM15MSB: OPCODE Position */ -#define EMAC_CAM15MSB_OPCODE_Msk (0xfffful << EMAC_CAM15MSB_OPCODE_Pos) /*!< EMAC_T::CAM15MSB: OPCODE Mask */ - -#define EMAC_CAM15MSB_LENGTH_Pos (16) /*!< EMAC_T::CAM15MSB: LENGTH Position */ -#define EMAC_CAM15MSB_LENGTH_Msk (0xfffful << EMAC_CAM15MSB_LENGTH_Pos) /*!< EMAC_T::CAM15MSB: LENGTH Mask */ - -#define EMAC_CAM15LSB_OPERAND_Pos (24) /*!< EMAC_T::CAM15LSB: OPERAND Position */ -#define EMAC_CAM15LSB_OPERAND_Msk (0xfful << EMAC_CAM15LSB_OPERAND_Pos) /*!< EMAC_T::CAM15LSB: OPERAND Mask */ - -#define EMAC_TXDSA_TXDSA_Pos (0) /*!< EMAC_T::TXDSA: TXDSA Position */ -#define EMAC_TXDSA_TXDSA_Msk (0xfffffffful << EMAC_TXDSA_TXDSA_Pos) /*!< EMAC_T::TXDSA: TXDSA Mask */ - -#define EMAC_RXDSA_RXDSA_Pos (0) /*!< EMAC_T::RXDSA: RXDSA Position */ -#define EMAC_RXDSA_RXDSA_Msk (0xfffffffful << EMAC_RXDSA_RXDSA_Pos) /*!< EMAC_T::RXDSA: RXDSA Mask */ - -#define EMAC_CTL_RXON_Pos (0) /*!< EMAC_T::CTL: RXON Position */ -#define EMAC_CTL_RXON_Msk (0x1ul << EMAC_CTL_RXON_Pos) /*!< EMAC_T::CTL: RXON Mask */ - -#define EMAC_CTL_ALP_Pos (1) /*!< EMAC_T::CTL: ALP Position */ -#define EMAC_CTL_ALP_Msk (0x1ul << EMAC_CTL_ALP_Pos) /*!< EMAC_T::CTL: ALP Mask */ - -#define EMAC_CTL_ARP_Pos (2) /*!< EMAC_T::CTL: ARP Position */ -#define EMAC_CTL_ARP_Msk (0x1ul << EMAC_CTL_ARP_Pos) /*!< EMAC_T::CTL: ARP Mask */ - -#define EMAC_CTL_ACP_Pos (3) /*!< EMAC_T::CTL: ACP Position */ -#define EMAC_CTL_ACP_Msk (0x1ul << EMAC_CTL_ACP_Pos) /*!< EMAC_T::CTL: ACP Mask */ - -#define EMAC_CTL_AEP_Pos (4) /*!< EMAC_T::CTL: AEP Position */ -#define EMAC_CTL_AEP_Msk (0x1ul << EMAC_CTL_AEP_Pos) /*!< EMAC_T::CTL: AEP Mask */ - -#define EMAC_CTL_STRIPCRC_Pos (5) /*!< EMAC_T::CTL: STRIPCRC Position */ -#define EMAC_CTL_STRIPCRC_Msk (0x1ul << EMAC_CTL_STRIPCRC_Pos) /*!< EMAC_T::CTL: STRIPCRC Mask */ - -#define EMAC_CTL_WOLEN_Pos (6) /*!< EMAC_T::CTL: WOLEN Position */ -#define EMAC_CTL_WOLEN_Msk (0x1ul << EMAC_CTL_WOLEN_Pos) /*!< EMAC_T::CTL: WOLEN Mask */ - -#define EMAC_CTL_TXON_Pos (8) /*!< EMAC_T::CTL: TXON Position */ -#define EMAC_CTL_TXON_Msk (0x1ul << EMAC_CTL_TXON_Pos) /*!< EMAC_T::CTL: TXON Mask */ - -#define EMAC_CTL_NODEF_Pos (9) /*!< EMAC_T::CTL: NODEF Position */ -#define EMAC_CTL_NODEF_Msk (0x1ul << EMAC_CTL_NODEF_Pos) /*!< EMAC_T::CTL: NODEF Mask */ - -#define EMAC_CTL_SDPZ_Pos (16) /*!< EMAC_T::CTL: SDPZ Position */ -#define EMAC_CTL_SDPZ_Msk (0x1ul << EMAC_CTL_SDPZ_Pos) /*!< EMAC_T::CTL: SDPZ Mask */ - -#define EMAC_CTL_SQECHKEN_Pos (17) /*!< EMAC_T::CTL: SQECHKEN Position */ -#define EMAC_CTL_SQECHKEN_Msk (0x1ul << EMAC_CTL_SQECHKEN_Pos) /*!< EMAC_T::CTL: SQECHKEN Mask */ - -#define EMAC_CTL_FUDUP_Pos (18) /*!< EMAC_T::CTL: FUDUP Position */ -#define EMAC_CTL_FUDUP_Msk (0x1ul << EMAC_CTL_FUDUP_Pos) /*!< EMAC_T::CTL: FUDUP Mask */ - -#define EMAC_CTL_RMIIRXCTL_Pos (19) /*!< EMAC_T::CTL: RMIIRXCTL Position */ -#define EMAC_CTL_RMIIRXCTL_Msk (0x1ul << EMAC_CTL_RMIIRXCTL_Pos) /*!< EMAC_T::CTL: RMIIRXCTL Mask */ - -#define EMAC_CTL_OPMODE_Pos (20) /*!< EMAC_T::CTL: OPMODE Position */ -#define EMAC_CTL_OPMODE_Msk (0x1ul << EMAC_CTL_OPMODE_Pos) /*!< EMAC_T::CTL: OPMODE Mask */ - -#define EMAC_CTL_RMIIEN_Pos (22) /*!< EMAC_T::CTL: RMIIEN Position */ -#define EMAC_CTL_RMIIEN_Msk (0x1ul << EMAC_CTL_RMIIEN_Pos) /*!< EMAC_T::CTL: RMIIEN Mask */ - -#define EMAC_CTL_RST_Pos (24) /*!< EMAC_T::CTL: RST Position */ -#define EMAC_CTL_RST_Msk (0x1ul << EMAC_CTL_RST_Pos) /*!< EMAC_T::CTL: RST Mask */ - -#define EMAC_MIIMDAT_DATA_Pos (0) /*!< EMAC_T::MIIMDAT: DATA Position */ -#define EMAC_MIIMDAT_DATA_Msk (0xfffful << EMAC_MIIMDAT_DATA_Pos) /*!< EMAC_T::MIIMDAT: DATA Mask */ - -#define EMAC_MIIMCTL_PHYREG_Pos (0) /*!< EMAC_T::MIIMCTL: PHYREG Position */ -#define EMAC_MIIMCTL_PHYREG_Msk (0x1ful << EMAC_MIIMCTL_PHYREG_Pos) /*!< EMAC_T::MIIMCTL: PHYREG Mask */ - -#define EMAC_MIIMCTL_PHYADDR_Pos (8) /*!< EMAC_T::MIIMCTL: PHYADDR Position */ -#define EMAC_MIIMCTL_PHYADDR_Msk (0x1ful << EMAC_MIIMCTL_PHYADDR_Pos) /*!< EMAC_T::MIIMCTL: PHYADDR Mask */ - -#define EMAC_MIIMCTL_WRITE_Pos (16) /*!< EMAC_T::MIIMCTL: WRITE Position */ -#define EMAC_MIIMCTL_WRITE_Msk (0x1ul << EMAC_MIIMCTL_WRITE_Pos) /*!< EMAC_T::MIIMCTL: WRITE Mask */ - -#define EMAC_MIIMCTL_BUSY_Pos (17) /*!< EMAC_T::MIIMCTL: BUSY Position */ -#define EMAC_MIIMCTL_BUSY_Msk (0x1ul << EMAC_MIIMCTL_BUSY_Pos) /*!< EMAC_T::MIIMCTL: BUSY Mask */ - -#define EMAC_MIIMCTL_PREAMSP_Pos (18) /*!< EMAC_T::MIIMCTL: PREAMSP Position */ -#define EMAC_MIIMCTL_PREAMSP_Msk (0x1ul << EMAC_MIIMCTL_PREAMSP_Pos) /*!< EMAC_T::MIIMCTL: PREAMSP Mask */ - -#define EMAC_MIIMCTL_MDCON_Pos (19) /*!< EMAC_T::MIIMCTL: MDCON Position */ -#define EMAC_MIIMCTL_MDCON_Msk (0x1ul << EMAC_MIIMCTL_MDCON_Pos) /*!< EMAC_T::MIIMCTL: MDCON Mask */ - -#define EMAC_FIFOCTL_RXFIFOTH_Pos (0) /*!< EMAC_T::FIFOCTL: RXFIFOTH Position */ -#define EMAC_FIFOCTL_RXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_RXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: RXFIFOTH Mask */ - -#define EMAC_FIFOCTL_TXFIFOTH_Pos (8) /*!< EMAC_T::FIFOCTL: TXFIFOTH Position */ -#define EMAC_FIFOCTL_TXFIFOTH_Msk (0x3ul << EMAC_FIFOCTL_TXFIFOTH_Pos) /*!< EMAC_T::FIFOCTL: TXFIFOTH Mask */ - -#define EMAC_FIFOCTL_BURSTLEN_Pos (20) /*!< EMAC_T::FIFOCTL: BURSTLEN Position */ -#define EMAC_FIFOCTL_BURSTLEN_Msk (0x3ul << EMAC_FIFOCTL_BURSTLEN_Pos) /*!< EMAC_T::FIFOCTL: BURSTLEN Mask */ - -#define EMAC_TXST_TXST_Pos (0) /*!< EMAC_T::TXST: TXST Position */ -#define EMAC_TXST_TXST_Msk (0xfffffffful << EMAC_TXST_TXST_Pos) /*!< EMAC_T::TXST: TXST Mask */ - -#define EMAC_RXST_RXST_Pos (0) /*!< EMAC_T::RXST: RXST Position */ -#define EMAC_RXST_RXST_Msk (0xfffffffful << EMAC_RXST_RXST_Pos) /*!< EMAC_T::RXST: RXST Mask */ - -#define EMAC_MRFL_MRFL_Pos (0) /*!< EMAC_T::MRFL: MRFL Position */ -#define EMAC_MRFL_MRFL_Msk (0xfffful << EMAC_MRFL_MRFL_Pos) /*!< EMAC_T::MRFL: MRFL Mask */ - -#define EMAC_INTEN_RXIEN_Pos (0) /*!< EMAC_T::INTEN: RXIEN Position */ -#define EMAC_INTEN_RXIEN_Msk (0x1ul << EMAC_INTEN_RXIEN_Pos) /*!< EMAC_T::INTEN: RXIEN Mask */ - -#define EMAC_INTEN_CRCEIEN_Pos (1) /*!< EMAC_T::INTEN: CRCEIEN Position */ -#define EMAC_INTEN_CRCEIEN_Msk (0x1ul << EMAC_INTEN_CRCEIEN_Pos) /*!< EMAC_T::INTEN: CRCEIEN Mask */ - -#define EMAC_INTEN_RXOVIEN_Pos (2) /*!< EMAC_T::INTEN: RXOVIEN Position */ -#define EMAC_INTEN_RXOVIEN_Msk (0x1ul << EMAC_INTEN_RXOVIEN_Pos) /*!< EMAC_T::INTEN: RXOVIEN Mask */ - -#define EMAC_INTEN_LPIEN_Pos (3) /*!< EMAC_T::INTEN: LPIEN Position */ -#define EMAC_INTEN_LPIEN_Msk (0x1ul << EMAC_INTEN_LPIEN_Pos) /*!< EMAC_T::INTEN: LPIEN Mask */ - -#define EMAC_INTEN_RXGDIEN_Pos (4) /*!< EMAC_T::INTEN: RXGDIEN Position */ -#define EMAC_INTEN_RXGDIEN_Msk (0x1ul << EMAC_INTEN_RXGDIEN_Pos) /*!< EMAC_T::INTEN: RXGDIEN Mask */ - -#define EMAC_INTEN_ALIEIEN_Pos (5) /*!< EMAC_T::INTEN: ALIEIEN Position */ -#define EMAC_INTEN_ALIEIEN_Msk (0x1ul << EMAC_INTEN_ALIEIEN_Pos) /*!< EMAC_T::INTEN: ALIEIEN Mask */ - -#define EMAC_INTEN_RPIEN_Pos (6) /*!< EMAC_T::INTEN: RPIEN Position */ -#define EMAC_INTEN_RPIEN_Msk (0x1ul << EMAC_INTEN_RPIEN_Pos) /*!< EMAC_T::INTEN: RPIEN Mask */ - -#define EMAC_INTEN_MPCOVIEN_Pos (7) /*!< EMAC_T::INTEN: MPCOVIEN Position */ -#define EMAC_INTEN_MPCOVIEN_Msk (0x1ul << EMAC_INTEN_MPCOVIEN_Pos) /*!< EMAC_T::INTEN: MPCOVIEN Mask */ - -#define EMAC_INTEN_MFLEIEN_Pos (8) /*!< EMAC_T::INTEN: MFLEIEN Position */ -#define EMAC_INTEN_MFLEIEN_Msk (0x1ul << EMAC_INTEN_MFLEIEN_Pos) /*!< EMAC_T::INTEN: MFLEIEN Mask */ - -#define EMAC_INTEN_DENIEN_Pos (9) /*!< EMAC_T::INTEN: DENIEN Position */ -#define EMAC_INTEN_DENIEN_Msk (0x1ul << EMAC_INTEN_DENIEN_Pos) /*!< EMAC_T::INTEN: DENIEN Mask */ - -#define EMAC_INTEN_RDUIEN_Pos (10) /*!< EMAC_T::INTEN: RDUIEN Position */ -#define EMAC_INTEN_RDUIEN_Msk (0x1ul << EMAC_INTEN_RDUIEN_Pos) /*!< EMAC_T::INTEN: RDUIEN Mask */ - -#define EMAC_INTEN_RXBEIEN_Pos (11) /*!< EMAC_T::INTEN: RXBEIEN Position */ -#define EMAC_INTEN_RXBEIEN_Msk (0x1ul << EMAC_INTEN_RXBEIEN_Pos) /*!< EMAC_T::INTEN: RXBEIEN Mask */ - -#define EMAC_INTEN_CFRIEN_Pos (14) /*!< EMAC_T::INTEN: CFRIEN Position */ -#define EMAC_INTEN_CFRIEN_Msk (0x1ul << EMAC_INTEN_CFRIEN_Pos) /*!< EMAC_T::INTEN: CFRIEN Mask */ - -#define EMAC_INTEN_WOLIEN_Pos (15) /*!< EMAC_T::INTEN: WOLIEN Position */ -#define EMAC_INTEN_WOLIEN_Msk (0x1ul << EMAC_INTEN_WOLIEN_Pos) /*!< EMAC_T::INTEN: WOLIEN Mask */ - -#define EMAC_INTEN_TXIEN_Pos (16) /*!< EMAC_T::INTEN: TXIEN Position */ -#define EMAC_INTEN_TXIEN_Msk (0x1ul << EMAC_INTEN_TXIEN_Pos) /*!< EMAC_T::INTEN: TXIEN Mask */ - -#define EMAC_INTEN_TXUDIEN_Pos (17) /*!< EMAC_T::INTEN: TXUDIEN Position */ -#define EMAC_INTEN_TXUDIEN_Msk (0x1ul << EMAC_INTEN_TXUDIEN_Pos) /*!< EMAC_T::INTEN: TXUDIEN Mask */ - -#define EMAC_INTEN_TXCPIEN_Pos (18) /*!< EMAC_T::INTEN: TXCPIEN Position */ -#define EMAC_INTEN_TXCPIEN_Msk (0x1ul << EMAC_INTEN_TXCPIEN_Pos) /*!< EMAC_T::INTEN: TXCPIEN Mask */ - -#define EMAC_INTEN_EXDEFIEN_Pos (19) /*!< EMAC_T::INTEN: EXDEFIEN Position */ -#define EMAC_INTEN_EXDEFIEN_Msk (0x1ul << EMAC_INTEN_EXDEFIEN_Pos) /*!< EMAC_T::INTEN: EXDEFIEN Mask */ - -#define EMAC_INTEN_NCSIEN_Pos (20) /*!< EMAC_T::INTEN: NCSIEN Position */ -#define EMAC_INTEN_NCSIEN_Msk (0x1ul << EMAC_INTEN_NCSIEN_Pos) /*!< EMAC_T::INTEN: NCSIEN Mask */ - -#define EMAC_INTEN_TXABTIEN_Pos (21) /*!< EMAC_T::INTEN: TXABTIEN Position */ -#define EMAC_INTEN_TXABTIEN_Msk (0x1ul << EMAC_INTEN_TXABTIEN_Pos) /*!< EMAC_T::INTEN: TXABTIEN Mask */ - -#define EMAC_INTEN_LCIEN_Pos (22) /*!< EMAC_T::INTEN: LCIEN Position */ -#define EMAC_INTEN_LCIEN_Msk (0x1ul << EMAC_INTEN_LCIEN_Pos) /*!< EMAC_T::INTEN: LCIEN Mask */ - -#define EMAC_INTEN_TDUIEN_Pos (23) /*!< EMAC_T::INTEN: TDUIEN Position */ -#define EMAC_INTEN_TDUIEN_Msk (0x1ul << EMAC_INTEN_TDUIEN_Pos) /*!< EMAC_T::INTEN: TDUIEN Mask */ - -#define EMAC_INTEN_TXBEIEN_Pos (24) /*!< EMAC_T::INTEN: TXBEIEN Position */ -#define EMAC_INTEN_TXBEIEN_Msk (0x1ul << EMAC_INTEN_TXBEIEN_Pos) /*!< EMAC_T::INTEN: TXBEIEN Mask */ - -#define EMAC_INTEN_TSALMIEN_Pos (28) /*!< EMAC_T::INTEN: TSALMIEN Position */ -#define EMAC_INTEN_TSALMIEN_Msk (0x1ul << EMAC_INTEN_TSALMIEN_Pos) /*!< EMAC_T::INTEN: TSALMIEN Mask */ - -#define EMAC_INTSTS_RXIF_Pos (0) /*!< EMAC_T::INTSTS: RXIF Position */ -#define EMAC_INTSTS_RXIF_Msk (0x1ul << EMAC_INTSTS_RXIF_Pos) /*!< EMAC_T::INTSTS: RXIF Mask */ - -#define EMAC_INTSTS_CRCEIF_Pos (1) /*!< EMAC_T::INTSTS: CRCEIF Position */ -#define EMAC_INTSTS_CRCEIF_Msk (0x1ul << EMAC_INTSTS_CRCEIF_Pos) /*!< EMAC_T::INTSTS: CRCEIF Mask */ - -#define EMAC_INTSTS_RXOVIF_Pos (2) /*!< EMAC_T::INTSTS: RXOVIF Position */ -#define EMAC_INTSTS_RXOVIF_Msk (0x1ul << EMAC_INTSTS_RXOVIF_Pos) /*!< EMAC_T::INTSTS: RXOVIF Mask */ - -#define EMAC_INTSTS_LPIF_Pos (3) /*!< EMAC_T::INTSTS: LPIF Position */ -#define EMAC_INTSTS_LPIF_Msk (0x1ul << EMAC_INTSTS_LPIF_Pos) /*!< EMAC_T::INTSTS: LPIF Mask */ - -#define EMAC_INTSTS_RXGDIF_Pos (4) /*!< EMAC_T::INTSTS: RXGDIF Position */ -#define EMAC_INTSTS_RXGDIF_Msk (0x1ul << EMAC_INTSTS_RXGDIF_Pos) /*!< EMAC_T::INTSTS: RXGDIF Mask */ - -#define EMAC_INTSTS_ALIEIF_Pos (5) /*!< EMAC_T::INTSTS: ALIEIF Position */ -#define EMAC_INTSTS_ALIEIF_Msk (0x1ul << EMAC_INTSTS_ALIEIF_Pos) /*!< EMAC_T::INTSTS: ALIEIF Mask */ - -#define EMAC_INTSTS_RPIF_Pos (6) /*!< EMAC_T::INTSTS: RPIF Position */ -#define EMAC_INTSTS_RPIF_Msk (0x1ul << EMAC_INTSTS_RPIF_Pos) /*!< EMAC_T::INTSTS: RPIF Mask */ - -#define EMAC_INTSTS_MPCOVIF_Pos (7) /*!< EMAC_T::INTSTS: MPCOVIF Position */ -#define EMAC_INTSTS_MPCOVIF_Msk (0x1ul << EMAC_INTSTS_MPCOVIF_Pos) /*!< EMAC_T::INTSTS: MPCOVIF Mask */ - -#define EMAC_INTSTS_MFLEIF_Pos (8) /*!< EMAC_T::INTSTS: MFLEIF Position */ -#define EMAC_INTSTS_MFLEIF_Msk (0x1ul << EMAC_INTSTS_MFLEIF_Pos) /*!< EMAC_T::INTSTS: MFLEIF Mask */ - -#define EMAC_INTSTS_DENIF_Pos (9) /*!< EMAC_T::INTSTS: DENIF Position */ -#define EMAC_INTSTS_DENIF_Msk (0x1ul << EMAC_INTSTS_DENIF_Pos) /*!< EMAC_T::INTSTS: DENIF Mask */ - -#define EMAC_INTSTS_RDUIF_Pos (10) /*!< EMAC_T::INTSTS: RDUIF Position */ -#define EMAC_INTSTS_RDUIF_Msk (0x1ul << EMAC_INTSTS_RDUIF_Pos) /*!< EMAC_T::INTSTS: RDUIF Mask */ - -#define EMAC_INTSTS_RXBEIF_Pos (11) /*!< EMAC_T::INTSTS: RXBEIF Position */ -#define EMAC_INTSTS_RXBEIF_Msk (0x1ul << EMAC_INTSTS_RXBEIF_Pos) /*!< EMAC_T::INTSTS: RXBEIF Mask */ - -#define EMAC_INTSTS_CFRIF_Pos (14) /*!< EMAC_T::INTSTS: CFRIF Position */ -#define EMAC_INTSTS_CFRIF_Msk (0x1ul << EMAC_INTSTS_CFRIF_Pos) /*!< EMAC_T::INTSTS: CFRIF Mask */ - -#define EMAC_INTSTS_WOLIF_Pos (15) /*!< EMAC_T::INTSTS: WOLIF Position */ -#define EMAC_INTSTS_WOLIF_Msk (0x1ul << EMAC_INTSTS_WOLIF_Pos) /*!< EMAC_T::INTSTS: WOLIF Mask */ - -#define EMAC_INTSTS_TXIF_Pos (16) /*!< EMAC_T::INTSTS: TXIF Position */ -#define EMAC_INTSTS_TXIF_Msk (0x1ul << EMAC_INTSTS_TXIF_Pos) /*!< EMAC_T::INTSTS: TXIF Mask */ - -#define EMAC_INTSTS_TXUDIF_Pos (17) /*!< EMAC_T::INTSTS: TXUDIF Position */ -#define EMAC_INTSTS_TXUDIF_Msk (0x1ul << EMAC_INTSTS_TXUDIF_Pos) /*!< EMAC_T::INTSTS: TXUDIF Mask */ - -#define EMAC_INTSTS_TXCPIF_Pos (18) /*!< EMAC_T::INTSTS: TXCPIF Position */ -#define EMAC_INTSTS_TXCPIF_Msk (0x1ul << EMAC_INTSTS_TXCPIF_Pos) /*!< EMAC_T::INTSTS: TXCPIF Mask */ - -#define EMAC_INTSTS_EXDEFIF_Pos (19) /*!< EMAC_T::INTSTS: EXDEFIF Position */ -#define EMAC_INTSTS_EXDEFIF_Msk (0x1ul << EMAC_INTSTS_EXDEFIF_Pos) /*!< EMAC_T::INTSTS: EXDEFIF Mask */ - -#define EMAC_INTSTS_NCSIF_Pos (20) /*!< EMAC_T::INTSTS: NCSIF Position */ -#define EMAC_INTSTS_NCSIF_Msk (0x1ul << EMAC_INTSTS_NCSIF_Pos) /*!< EMAC_T::INTSTS: NCSIF Mask */ - -#define EMAC_INTSTS_TXABTIF_Pos (21) /*!< EMAC_T::INTSTS: TXABTIF Position */ -#define EMAC_INTSTS_TXABTIF_Msk (0x1ul << EMAC_INTSTS_TXABTIF_Pos) /*!< EMAC_T::INTSTS: TXABTIF Mask */ - -#define EMAC_INTSTS_LCIF_Pos (22) /*!< EMAC_T::INTSTS: LCIF Position */ -#define EMAC_INTSTS_LCIF_Msk (0x1ul << EMAC_INTSTS_LCIF_Pos) /*!< EMAC_T::INTSTS: LCIF Mask */ - -#define EMAC_INTSTS_TDUIF_Pos (23) /*!< EMAC_T::INTSTS: TDUIF Position */ -#define EMAC_INTSTS_TDUIF_Msk (0x1ul << EMAC_INTSTS_TDUIF_Pos) /*!< EMAC_T::INTSTS: TDUIF Mask */ - -#define EMAC_INTSTS_TXBEIF_Pos (24) /*!< EMAC_T::INTSTS: TXBEIF Position */ -#define EMAC_INTSTS_TXBEIF_Msk (0x1ul << EMAC_INTSTS_TXBEIF_Pos) /*!< EMAC_T::INTSTS: TXBEIF Mask */ - -#define EMAC_INTSTS_TSALMIF_Pos (28) /*!< EMAC_T::INTSTS: TSALMIF Position */ -#define EMAC_INTSTS_TSALMIF_Msk (0x1ul << EMAC_INTSTS_TSALMIF_Pos) /*!< EMAC_T::INTSTS: TSALMIF Mask */ - -#define EMAC_GENSTS_CFR_Pos (0) /*!< EMAC_T::GENSTS: CFR Position */ -#define EMAC_GENSTS_CFR_Msk (0x1ul << EMAC_GENSTS_CFR_Pos) /*!< EMAC_T::GENSTS: CFR Mask */ - -#define EMAC_GENSTS_RXHALT_Pos (1) /*!< EMAC_T::GENSTS: RXHALT Position */ -#define EMAC_GENSTS_RXHALT_Msk (0x1ul << EMAC_GENSTS_RXHALT_Pos) /*!< EMAC_T::GENSTS: RXHALT Mask */ - -#define EMAC_GENSTS_RXFFULL_Pos (2) /*!< EMAC_T::GENSTS: RXFFULL Position */ -#define EMAC_GENSTS_RXFFULL_Msk (0x1ul << EMAC_GENSTS_RXFFULL_Pos) /*!< EMAC_T::GENSTS: RXFFULL Mask */ - -#define EMAC_GENSTS_COLCNT_Pos (4) /*!< EMAC_T::GENSTS: COLCNT Position */ -#define EMAC_GENSTS_COLCNT_Msk (0xful << EMAC_GENSTS_COLCNT_Pos) /*!< EMAC_T::GENSTS: COLCNT Mask */ - -#define EMAC_GENSTS_DEF_Pos (8) /*!< EMAC_T::GENSTS: DEF Position */ -#define EMAC_GENSTS_DEF_Msk (0x1ul << EMAC_GENSTS_DEF_Pos) /*!< EMAC_T::GENSTS: DEF Mask */ - -#define EMAC_GENSTS_TXPAUSED_Pos (9) /*!< EMAC_T::GENSTS: TXPAUSED Position */ -#define EMAC_GENSTS_TXPAUSED_Msk (0x1ul << EMAC_GENSTS_TXPAUSED_Pos) /*!< EMAC_T::GENSTS: TXPAUSED Mask */ - -#define EMAC_GENSTS_SQE_Pos (10) /*!< EMAC_T::GENSTS: SQE Position */ -#define EMAC_GENSTS_SQE_Msk (0x1ul << EMAC_GENSTS_SQE_Pos) /*!< EMAC_T::GENSTS: SQE Mask */ - -#define EMAC_GENSTS_TXHALT_Pos (11) /*!< EMAC_T::GENSTS: TXHALT Position */ -#define EMAC_GENSTS_TXHALT_Msk (0x1ul << EMAC_GENSTS_TXHALT_Pos) /*!< EMAC_T::GENSTS: TXHALT Mask */ - -#define EMAC_GENSTS_RPSTS_Pos (12) /*!< EMAC_T::GENSTS: RPSTS Position */ -#define EMAC_GENSTS_RPSTS_Msk (0x1ul << EMAC_GENSTS_RPSTS_Pos) /*!< EMAC_T::GENSTS: RPSTS Mask */ - -#define EMAC_MPCNT_MPCNT_Pos (0) /*!< EMAC_T::MPCNT: MPCNT Position */ -#define EMAC_MPCNT_MPCNT_Msk (0xfffful << EMAC_MPCNT_MPCNT_Pos) /*!< EMAC_T::MPCNT: MPCNT Mask */ - -#define EMAC_RPCNT_RPCNT_Pos (0) /*!< EMAC_T::RPCNT: RPCNT Position */ -#define EMAC_RPCNT_RPCNT_Msk (0xfffful << EMAC_RPCNT_RPCNT_Pos) /*!< EMAC_T::RPCNT: RPCNT Mask */ - -#define EMAC_FRSTS_RXFLT_Pos (0) /*!< EMAC_T::FRSTS: RXFLT Position */ -#define EMAC_FRSTS_RXFLT_Msk (0xfffful << EMAC_FRSTS_RXFLT_Pos) /*!< EMAC_T::FRSTS: RXFLT Mask */ - -#define EMAC_CTXDSA_CTXDSA_Pos (0) /*!< EMAC_T::CTXDSA: CTXDSA Position */ -#define EMAC_CTXDSA_CTXDSA_Msk (0xfffffffful << EMAC_CTXDSA_CTXDSA_Pos) /*!< EMAC_T::CTXDSA: CTXDSA Mask */ - -#define EMAC_CTXBSA_CTXBSA_Pos (0) /*!< EMAC_T::CTXBSA: CTXBSA Position */ -#define EMAC_CTXBSA_CTXBSA_Msk (0xfffffffful << EMAC_CTXBSA_CTXBSA_Pos) /*!< EMAC_T::CTXBSA: CTXBSA Mask */ - -#define EMAC_CRXDSA_CRXDSA_Pos (0) /*!< EMAC_T::CRXDSA: CRXDSA Position */ -#define EMAC_CRXDSA_CRXDSA_Msk (0xfffffffful << EMAC_CRXDSA_CRXDSA_Pos) /*!< EMAC_T::CRXDSA: CRXDSA Mask */ - -#define EMAC_CRXBSA_CRXBSA_Pos (0) /*!< EMAC_T::CRXBSA: CRXBSA Position */ -#define EMAC_CRXBSA_CRXBSA_Msk (0xfffffffful << EMAC_CRXBSA_CRXBSA_Pos) /*!< EMAC_T::CRXBSA: CRXBSA Mask */ - -#define EMAC_TSCTL_TSEN_Pos (0) /*!< EMAC_T::TSCTL: TSEN Position */ -#define EMAC_TSCTL_TSEN_Msk (0x1ul << EMAC_TSCTL_TSEN_Pos) /*!< EMAC_T::TSCTL: TSEN Mask */ - -#define EMAC_TSCTL_TSIEN_Pos (1) /*!< EMAC_T::TSCTL: TSIEN Position */ -#define EMAC_TSCTL_TSIEN_Msk (0x1ul << EMAC_TSCTL_TSIEN_Pos) /*!< EMAC_T::TSCTL: TSIEN Mask */ - -#define EMAC_TSCTL_TSMODE_Pos (2) /*!< EMAC_T::TSCTL: TSMODE Position */ -#define EMAC_TSCTL_TSMODE_Msk (0x1ul << EMAC_TSCTL_TSMODE_Pos) /*!< EMAC_T::TSCTL: TSMODE Mask */ - -#define EMAC_TSCTL_TSUPDATE_Pos (3) /*!< EMAC_T::TSCTL: TSUPDATE Position */ -#define EMAC_TSCTL_TSUPDATE_Msk (0x1ul << EMAC_TSCTL_TSUPDATE_Pos) /*!< EMAC_T::TSCTL: TSUPDATE Mask */ - -#define EMAC_TSCTL_TSALMEN_Pos (5) /*!< EMAC_T::TSCTL: TSALMEN Position */ -#define EMAC_TSCTL_TSALMEN_Msk (0x1ul << EMAC_TSCTL_TSALMEN_Pos) /*!< EMAC_T::TSCTL: TSALMEN Mask */ - -#define EMAC_TSSEC_SEC_Pos (0) /*!< EMAC_T::TSSEC: SEC Position */ -#define EMAC_TSSEC_SEC_Msk (0xfffffffful << EMAC_TSSEC_SEC_Pos) /*!< EMAC_T::TSSEC: SEC Mask */ - -#define EMAC_TSSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::TSSUBSEC: SUBSEC Position */ -#define EMAC_TSSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_TSSUBSEC_SUBSEC_Pos) /*!< EMAC_T::TSSUBSEC: SUBSEC Mask */ - -#define EMAC_TSINC_CNTINC_Pos (0) /*!< EMAC_T::TSINC: CNTINC Position */ -#define EMAC_TSINC_CNTINC_Msk (0xfful << EMAC_TSINC_CNTINC_Pos) /*!< EMAC_T::TSINC: CNTINC Mask */ - -#define EMAC_TSADDEND_ADDEND_Pos (0) /*!< EMAC_T::TSADDEND: ADDEND Position */ -#define EMAC_TSADDEND_ADDEND_Msk (0xfffffffful << EMAC_TSADDEND_ADDEND_Pos) /*!< EMAC_T::TSADDEND: ADDEND Mask */ - -#define EMAC_UPDSEC_SEC_Pos (0) /*!< EMAC_T::UPDSEC: SEC Position */ -#define EMAC_UPDSEC_SEC_Msk (0xfffffffful << EMAC_UPDSEC_SEC_Pos) /*!< EMAC_T::UPDSEC: SEC Mask */ - -#define EMAC_UPDSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::UPDSUBSEC: SUBSEC Position */ -#define EMAC_UPDSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_UPDSUBSEC_SUBSEC_Pos) /*!< EMAC_T::UPDSUBSEC: SUBSEC Mask */ - -#define EMAC_ALMSEC_SEC_Pos (0) /*!< EMAC_T::ALMSEC: SEC Position */ -#define EMAC_ALMSEC_SEC_Msk (0xfffffffful << EMAC_ALMSEC_SEC_Pos) /*!< EMAC_T::ALMSEC: SEC Mask */ - -#define EMAC_ALMSUBSEC_SUBSEC_Pos (0) /*!< EMAC_T::ALMSUBSEC: SUBSEC Position */ -#define EMAC_ALMSUBSEC_SUBSEC_Msk (0xfffffffful << EMAC_ALMSUBSEC_SUBSEC_Pos) /*!< EMAC_T::ALMSUBSEC: SUBSEC Mask */ - -/**@}*/ /* EMAC_CONST */ -/**@}*/ /* end of EMAC register group */ -/**@}*/ /* end of REGISTER group */ - -#if defined ( __CC_ARM ) - #pragma no_anon_unions -#endif - -#endif /* __EMAC_REG_H__ */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_adc.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_adc.h deleted file mode 100644 index 55b0548b420..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_adc.h +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************//** -* @file nu_adc.h -* @brief N9H30 ADC driver header file -* -* @note -* SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_ADC_H__ -#define __NU_ADC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ADC_Driver ADC Driver - @{ -*/ - -/** @addtogroup ADC_EXPORTED_CONSTANTS ADC Exported Constants - @{ -*/ - -#include "adc_reg.h" - -#define ADC_CH_0_MASK (1UL << 0) /*!< ADC channel 0 mask \hideinitializer */ -#define ADC_CH_1_MASK (1UL << 1) /*!< ADC channel 1 mask \hideinitializer */ -#define ADC_CH_2_MASK (1UL << 2) /*!< ADC channel 2 mask \hideinitializer */ -#define ADC_CH_3_MASK (1UL << 3) /*!< ADC channel 3 mask \hideinitializer */ -#define ADC_CH_4_MASK (1UL << 4) /*!< ADC channel 4 mask \hideinitializer */ -#define ADC_CH_5_MASK (1UL << 5) /*!< ADC channel 5 mask \hideinitializer */ -#define ADC_CH_6_MASK (1UL << 6) /*!< ADC channel 6 mask \hideinitializer */ -#define ADC_CH_7_MASK (1UL << 7) /*!< ADC channel 7 mask \hideinitializer */ -#define ADC_CH_NUM 8 /*!< Total Channel number \hideinitializer */ -#define ADC_HIGH_SPEED_MODE ADC_CONF_SPEED_Msk /*!< ADC working in high speed mode (3.2MHz <= ECLK <= 16MHz) \hideinitializer */ -#define ADC_NORMAL_SPEED_MODE 0 /*!< ADC working in normal speed mode (ECLK < 3.2MHz) \hideinitializer */ -#define ADC_REFSEL_VREF 0 /*!< ADC reference voltage source selection set to VREF \hideinitializer */ -#define ADC_REFSEL_AVDD (3UL << ADC_CONF_REFSEL_Pos) /*!< ADC reference voltage source selection set to AVDD \hideinitializer */ - -#define ADC_INPUT_MODE_NORMAL_CONV 0 /*!< ADC works in normal conversion mode \hideinitializer */ -#define ADC_INPUT_MODE_4WIRE_TOUCH 1 /*!< ADC works in 4-wire touch screen mode \hideinitializer */ -#define ADC_INPUT_MODE_5WIRE_TOUCH 2 /*!< ADC works in 5-wire touch screen mode \hideinitializer */ - -/*@}*/ /* end of group ADC_EXPORTED_CONSTANTS */ - - -/** @addtogroup ADC_EXPORTED_FUNCTIONS ADC Exported Functions - @{ -*/ - -/** - * @brief Get the latest ADC conversion data - * @param[in] adc Base address of ADC module - * @param[in] u32ChNum Currently not used - * @return Latest ADC conversion data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_DATA(adc, u32ChNum) ((adc)->DATA) - -/** - * @brief Get the latest ADC conversion X data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion X data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_XDATA(adc) ((adc)->XYDATA & ADC_XYDATA_XDATA_Msk) - -/** - * @brief Get the latest ADC conversion Y data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Y data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_YDATA(adc) ((adc)->XYDATA >> ADC_XYDATA_YDATA_Pos) - -/** - * @brief Get the latest ADC conversion Z1 data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Z1 data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_Z1DATA(adc) ((adc)->ZDATA & ADC_ZDATA_Z1DATA_Msk) - -/** - * @brief Get the latest ADC conversion Z2 data - * @param[in] adc Base address of ADC module - * @return Latest ADC conversion Z2 data - * \hideinitializer - */ -#define ADC_GET_CONVERSION_Z2DATA(adc) ((adc)->ZDATA >> ADC_ZDATA_Z2DATA_Pos) - -/** - * @brief Return the user-specified interrupt flags - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return User specified interrupt flags - * \hideinitializer - */ -#define ADC_GET_INT_FLAG(adc, u32Mask) ((adc)->ISR & (u32Mask)) - -/** - * @brief This macro clear the selected interrupt status bits - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - * \hideinitializer - */ -#define ADC_CLR_INT_FLAG(adc, u32Mask) ((adc)->ISR = (u32Mask)) - -/** - * @brief Return the user-specified interrupt flags - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return User specified interrupt flags - * \hideinitializer - */ -#define ADC_GET_WKINT_FLAG(adc, u32Mask) ((adc)->WKISR & (u32Mask)) - -/** - * @brief Enable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - */ -#define ADC_ENABLE_INT(adc, u32Mask) ((adc)->IER |= u32Mask) - -/** - * @brief Disable the interrupt(s) selected by u32Mask parameter. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Could be \ref ADC_IER_MIEN_Msk - * @return None - */ -#define ADC_DISABLE_INT(adc, u32Mask) ((adc)->IER &= ~u32Mask) - -/** - * @brief Power down ADC module - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_POWER_DOWN(adc) ((adc)->CTL &= ~ADC_CTL_ADEN_Msk) - -/** - * @brief Power on ADC module - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_POWER_ON(adc) ((adc)->CTL |= ADC_CTL_ADEN_Msk) - - -/** - * @brief Set ADC input channel. Enabled channel will be converted while ADC starts. - * @param[in] adc Base address of ADC module - * @param[in] u32Mask Channel enable bit. Each bit corresponds to a input channel. Bit 0 is channel 0, bit 1 is channel 1... - * @return None - * @note ADC can only convert 1 channel at a time. If more than 1 channels are enabled, only channel - * with smallest number will be convert. - * \hideinitializer - */ -#define ADC_SET_INPUT_CHANNEL(adc, u32Mask) do {uint32_t u32Ch = 0, i;\ - for(i = 0; i < ADC_CH_NUM; i++) {\ - if((u32Mask) & (1 << i)) {\ - u32Ch = i;\ - break;\ - }\ - }\ - (adc)->CONF = ((adc)->CONF & ~ADC_CONF_CHSEL_Msk) | (u32Ch << ADC_CONF_CHSEL_Pos);\ - }while(0) - -/** - * @brief Start the A/D conversion. - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_START_CONV(adc) ((adc)->CTL |= ADC_CTL_MST_Msk) - -/** - * @brief Set the reference voltage selection. - * @param[in] adc Base address of ADC module - * @param[in] u32Ref The reference voltage selection. Valid values are: - * - \ref ADC_REFSEL_VREF - * - \ref ADC_REFSEL_AVDD - * @return None - * \hideinitializer - */ -#define ADC_SET_REF_VOLTAGE(adc, u32Ref) ((adc)->CONF = ((adc)->CONF & ~ADC_CONF_REFSEL_Msk) | (u32Ref)) - -/** - * @brief Set ADC to convert X/Y coordinate - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_CONVERT_XY_MODE(adc) do {(adc)->CTL &= ~ADC_CTL_PEDEEN_Msk;\ - (adc)->CONF |= ADC_CONF_TEN_Msk | ADC_CONF_ZEN_Msk;} while(0) - -/** - * @brief Set ADC to detect pen down event - * @param[in] adc Base address of ADC module - * @return None - * \hideinitializer - */ -#define ADC_DETECT_PD_MODE(adc) do {(adc)->CONF &= ~(ADC_CONF_TEN_Msk | ADC_CONF_ZEN_Msk);\ - (adc)->CTL |= ADC_CTL_PEDEEN_Msk;} while(0) - - -#define ADC_CONF_REFSEL_VREF (0<STATUS) - -/** - * @brief Get specified interrupt pending status. - * - * @param[in] can The base address of can module. - * - * @return The source of the interrupt. - * - * @details If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt - * with the highest priority, disregarding their chronological order. - * \hideinitializer - */ -#define CAN_GET_INT_PENDING_STATUS(can) ((can)->IIDR) - -/** - * @brief Disable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details The macro is used to disable wake-up function. - * \hideinitializer - */ -#define CAN_DISABLE_WAKEUP(can) ((can)->WU_EN = 0ul) - -/** - * @brief Enable wake-up function. - * - * @param[in] can The base address of can module. - * - * @return None - * - * @details User can wake-up system when there is a falling edge in the CAN_Rx pin. - * \hideinitializer - */ -#define CAN_ENABLE_WAKEUP(can) ((can)->WU_EN = CAN_WU_EN_WAKUP_EN_Msk) - -/** - * @brief Get specified Message Object new data into bit value. - * - * @param[in] can The base address of can module. - * @param[in] u32MsgNum Specified Message Object number, valid value are from 0 to 31. - * - * @return Specified Message Object new data into bit value. - * - * @details The NewDat bit (CAN_IFn_MCON[15]) of a specific Message Object can be set/reset by the software through the IFn Message Interface Registers - * or by the Message Handler after reception of a Data Frame or after a successful transmission. - * \hideinitializer - */ -#define CAN_GET_NEW_DATA_IN_BIT(can, u32MsgNum) ((u32MsgNum) < 16 ? (can)->NDAT1 & (1 << (u32MsgNum)) : (can)->NDAT2 & (1 << ((u32MsgNum)-16))) - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define CAN functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate); -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode); -void CAN_Close(CAN_T *tCAN); -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum); -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask); -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask); -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg); -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg); -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID); -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask); -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg); -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum); -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg); -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg); -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask); -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask); -void CAN_LeaveTestMode(CAN_T *tCAN); -uint32_t CAN_GetCANBitRate(CAN_T *tCAN); -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj); -void CAN_LeaveInitMode(CAN_T *tCAN); -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast); -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast); -void CAN_WaitMsg(CAN_T *tCAN); -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T *pCanMsg); - -/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CAN_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - - -#endif /*__NU_CAN_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_cap.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_cap.h deleted file mode 100644 index f15142cf567..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_cap.h +++ /dev/null @@ -1,471 +0,0 @@ -/**************************************************************************//** - * @file cap.h - * @brief Image Capture Driver Header File - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CAP_H__ -#define __NU_CAP_H__ - -#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 */ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/*---------------------- Capture Engine -------------------------*/ -/** - @addtogroup CAP Capture Engine(CAP) - Memory Mapped Structure for CAP Controller -@{ */ - -typedef struct -{ - __IO uint32_t CTL; - __IO uint32_t PAR; - __IO uint32_t INT; - __IO uint32_t POSTERIZE; - __IO uint32_t MD; - __IO uint32_t MDADDR; - __IO uint32_t MDYADDR; - __IO uint32_t SEPIA; - __IO uint32_t CWSP; - __IO uint32_t CWS; - __IO uint32_t PKTSL; - __IO uint32_t PLNSL; - __IO uint32_t FRCTL; - __IO uint32_t STRIDE; - /// @cond HIDDEN_SYMBOLS - uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t FIFOTH; - __IO uint32_t CMPADDR; - /// @cond HIDDEN_SYMBOLS - uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PKTSM; - __IO uint32_t PLNSM; - __I uint32_t CURADDRP; - __I uint32_t CURADDRY; - __I uint32_t CURADDRU; - __I uint32_t CURVADDR; - __IO uint32_t PKTBA0; - __IO uint32_t PKTBA1; - /// @cond HIDDEN_SYMBOLS - uint32_t RESERVE2[6]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t YBA; - __IO uint32_t UBA; - __IO uint32_t VBA; - -} CAP_T; - -/** - @addtogroup CAP_CONST CAP Bit Field Definition - Constant Definitions for CAP Controller -@{ */ - -#define CAP_CTL_CAPEN_Pos (0) /*!< CAP_T::CTL: CAPEN Position */ -#define CAP_CTL_CAPEN_Msk (0x1ul << CAP_CTL_CAPEN_Pos) /*!< CAP_T::CTL: CAPEN Mask */ - -#define CAP_CTL_ADDRSW_Pos (3) /*!< CAP_T::CTL: ADDRSW Position */ -#define CAP_CTL_ADDRSW_Msk (0x1ul << CAP_CTL_ADDRSW_Pos) /*!< CAP_T::CTL: ADDRSW Mask */ - -#define CAP_CTL_PLNEN_Pos (5) /*!< CAP_T::CTL: PLNEN Position */ -#define CAP_CTL_PLNEN_Msk (0x1ul << CAP_CTL_PLNEN_Pos) /*!< CAP_T::CTL: PLNEN Mask */ - -#define CAP_CTL_PKTEN_Pos (6) /*!< CAP_T::CTL: PKTEN Position */ -#define CAP_CTL_PKTEN_Msk (0x1ul << CAP_CTL_PKTEN_Pos) /*!< CAP_T::CTL: PKTEN Mask */ - -#define CAP_CTL_SHUTTER_Pos (16) /*!< CAP_T::CTL: SHUTTER Position */ -#define CAP_CTL_SHUTTER_Msk (0x1ul << CAP_CTL_SHUTTER_Pos) /*!< CAP_T::CTL: SHUTTER Mask */ - -#define CAP_CTL_UPDATE_Pos (20) /*!< CAP_T::CTL: UPDATE Position */ -#define CAP_CTL_UPDATE_Msk (0x1ul << CAP_CTL_UPDATE_Pos) /*!< CAP_T::CTL: UPDATE Mask */ - -#define CAP_CTL_VPRST_Pos (24) /*!< CAP_T::CTL: VPRST Position */ -#define CAP_CTL_VPRST_Msk (0x1ul << CAP_CTL_VPRST_Pos) /*!< CAP_T::CTL: VPRST Mask */ - -#define CAP_PAR_INFMT_Pos (0) /*!< CAP_T::PAR: INFMT Position */ -#define CAP_PAR_INFMT_Msk (0x1ul << CAP_PAR_INFMT_Pos) /*!< CAP_T::PAR: INFMT Mask */ - -#define CAP_PAR_SENTYPE_Pos (1) /*!< CAP_T::PAR: SENTYPE Position */ -#define CAP_PAR_SENTYPE_Msk (0x1ul << CAP_PAR_SENTYPE_Pos) /*!< CAP_T::PAR: SENTYPE Mask */ - -#define CAP_PAR_INDATORD_Pos (2) /*!< CAP_T::PAR: INDATORD Position */ -#define CAP_PAR_INDATORD_Msk (0x3ul << CAP_PAR_INDATORD_Pos) /*!< CAP_T::PAR: INDATORD Mask */ - -#define CAP_PAR_OUTFMT_Pos (4) /*!< CAP_T::PAR: OUTFMT Position */ -#define CAP_PAR_OUTFMT_Msk (0x3ul << CAP_PAR_OUTFMT_Pos) /*!< CAP_T::PAR: OUTFMT Mask */ - -#define CAP_PAR_RANGE_Pos (6) /*!< CAP_T::PAR: RANGE Position */ -#define CAP_PAR_RANGE_Msk (0x1ul << CAP_PAR_RANGE_Pos) /*!< CAP_T::PAR: RANGE Mask */ - -#define CAP_PAR_PLNFMT_Pos (7) /*!< CAP_T::PAR: PLNFMT Position */ -#define CAP_PAR_PLNFMT_Msk (0x1ul << CAP_PAR_PLNFMT_Pos) /*!< CAP_T::PAR: PLNFMT Mask */ - -#define CAP_PAR_PCLKP_Pos (8) /*!< CAP_T::PAR: PCLKP Position */ -#define CAP_PAR_PCLKP_Msk (0x1ul << CAP_PAR_PCLKP_Pos) /*!< CAP_T::PAR: PCLKP Mask */ - -#define CAP_PAR_HSP_Pos (9) /*!< CAP_T::PAR: HSP Position */ -#define CAP_PAR_HSP_Msk (0x1ul << CAP_PAR_HSP_Pos) /*!< CAP_T::PAR: HSP Mask */ - -#define CAP_PAR_VSP_Pos (10) /*!< CAP_T::PAR: VSP Position */ -#define CAP_PAR_VSP_Msk (0x1ul << CAP_PAR_VSP_Pos) /*!< CAP_T::PAR: VSP Mask */ - -#define CAP_PAR_COLORCTL_Pos (11) /*!< CAP_T::PAR: COLORCTL Position */ -#define CAP_PAR_COLORCTL_Msk (0x3ul << CAP_PAR_COLORCTL_Pos) /*!< CAP_T::PAR: COLORCTL Mask */ - -#define CAP_PAR_FBB_Pos (18) /*!< CAP_T::PAR: FBB Position */ -#define CAP_PAR_FBB_Msk (0x1ul << CAP_PAR_FBB_Pos) /*!< CAP_T::PAR: FBB Mask */ - -#define CAP_INT_VINTF_Pos (0) /*!< CAP_T::INT: VINTF Position */ -#define CAP_INT_VINTF_Msk (0x1ul << CAP_INT_VINTF_Pos) /*!< CAP_T::INT: VINTF Mask */ - -#define CAP_INT_MEINTF_Pos (1) /*!< CAP_T::INT: MEINTF Position */ -#define CAP_INT_MEINTF_Msk (0x1ul << CAP_INT_MEINTF_Pos) /*!< CAP_T::INT: MEINTF Mask */ - -#define CAP_INT_ADDRMINTF_Pos (3) /*!< CAP_T::INT: ADDRMINTF Position */ -#define CAP_INT_ADDRMINTF_Msk (0x1ul << CAP_INT_ADDRMINTF_Pos) /*!< CAP_T::INT: ADDRMINTF Mask */ - -#define CAP_INT_MDINTF_Pos (4) /*!< CAP_T::INT: MDINTF Position */ -#define CAP_INT_MDINTF_Msk (0x1ul << CAP_INT_MDINTF_Pos) /*!< CAP_T::INT: MDINTF Mask */ - -#define CAP_INT_VIEN_Pos (16) /*!< CAP_T::INT: VIEN Position */ -#define CAP_INT_VIEN_Msk (0x1ul << CAP_INT_VIEN_Pos) /*!< CAP_T::INT: VIEN Mask */ - -#define CAP_INT_MEIEN_Pos (17) /*!< CAP_T::INT: MEIEN Position */ -#define CAP_INT_MEIEN_Msk (0x1ul << CAP_INT_MEIEN_Pos) /*!< CAP_T::INT: MEIEN Mask */ - -#define CAP_INT_ADDRMIEN_Pos (19) /*!< CAP_T::INT: ADDRMIEN Position */ -#define CAP_INT_ADDRMIEN_Msk (0x1ul << CAP_INT_ADDRMIEN_Pos) /*!< CAP_T::INT: ADDRMIEN Mask */ - -#define CAP_INT_MDIEN_Pos (20) /*!< CAP_T::INT: MDIEN Position */ -#define CAP_INT_MDIEN_Msk (0x1ul << CAP_INT_MDIEN_Pos) /*!< CAP_T::INT: MDIEN Mask */ - -#define CAP_POSTERIZE_VCOMP_Pos (0) /*!< CAP_T::POSTERIZE: VCOMP Position */ -#define CAP_POSTERIZE_VCOMP_Msk (0xfful << CAP_POSTERIZE_VCOMP_Pos) /*!< CAP_T::POSTERIZE: VCOMP Mask */ - -#define CAP_POSTERIZE_UCOMP_Pos (8) /*!< CAP_T::POSTERIZE: UCOMP Position */ -#define CAP_POSTERIZE_UCOMP_Msk (0xfful << CAP_POSTERIZE_UCOMP_Pos) /*!< CAP_T::POSTERIZE: UCOMP Mask */ - -#define CAP_POSTERIZE_YCOMP_Pos (16) /*!< CAP_T::POSTERIZE: YCOMP Position */ -#define CAP_POSTERIZE_YCOMP_Msk (0xfful << CAP_POSTERIZE_YCOMP_Pos) /*!< CAP_T::POSTERIZE: YCOMP Mask */ - -#define CAP_MD_MDEN_Pos (0) /*!< CAP_T::MD: MDEN Position */ -#define CAP_MD_MDEN_Msk (0x1ul << CAP_MD_MDEN_Pos) /*!< CAP_T::MD: MDEN Mask */ - -#define CAP_MD_MDBS_Pos (8) /*!< CAP_T::MD: MDBS Position */ -#define CAP_MD_MDBS_Msk (0x1ul << CAP_MD_MDBS_Pos) /*!< CAP_T::MD: MDBS Mask */ - -#define CAP_MD_MDSM_Pos (9) /*!< CAP_T::MD: MDSM Position */ -#define CAP_MD_MDSM_Msk (0x1ul << CAP_MD_MDSM_Pos) /*!< CAP_T::MD: MDSM Mask */ - -#define CAP_MD_MDDF_Pos (10) /*!< CAP_T::MD: MDDF Position */ -#define CAP_MD_MDDF_Msk (0x3ul << CAP_MD_MDDF_Pos) /*!< CAP_T::MD: MDDF Mask */ - -#define CAP_MD_MDTHR_Pos (16) /*!< CAP_T::MD: MDTHR Position */ -#define CAP_MD_MDTHR_Msk (0x1ful << CAP_MD_MDTHR_Pos) /*!< CAP_T::MD: MDTHR Mask */ - -#define CAP_MDADDR_MDADDR_Pos (0) /*!< CAP_T::MDADDR: MDADDR Position */ -#define CAP_MDADDR_MDADDR_Msk (0xfffffffful << CAP_MDADDR_MDADDR_Pos) /*!< CAP_T::MDADDR: MDADDR Mask */ - -#define CAP_MDYADDR_MDYADDR_Pos (0) /*!< CAP_T::MDYADDR: MDYADDR Position */ -#define CAP_MDYADDR_MDYADDR_Msk (0xfffffffful << CAP_MDYADDR_MDYADDR_Pos) /*!< CAP_T::MDYADDR: MDYADDR Mask */ - -#define CAP_SEPIA_VCOMP_Pos (0) /*!< CAP_T::SEPIA: VCOMP Position */ -#define CAP_SEPIA_VCOMP_Msk (0xfful << CAP_SEPIA_VCOMP_Pos) /*!< CAP_T::SEPIA: VCOMP Mask */ - -#define CAP_SEPIA_UCOMP_Pos (8) /*!< CAP_T::SEPIA: UCOMP Position */ -#define CAP_SEPIA_UCOMP_Msk (0xfful << CAP_SEPIA_UCOMP_Pos) /*!< CAP_T::SEPIA: UCOMP Mask */ - -#define CAP_CWSP_CWSADDRH_Pos (0) /*!< CAP_T::CWSP: CWSADDRH Position */ -#define CAP_CWSP_CWSADDRH_Msk (0xffful << CAP_CWSP_CWSADDRH_Pos) /*!< CAP_T::CWSP: CWSADDRH Mask */ - -#define CAP_CWSP_CWSADDRV_Pos (16) /*!< CAP_T::CWSP: CWSADDRV Position */ -#define CAP_CWSP_CWSADDRV_Msk (0x7fful << CAP_CWSP_CWSADDRV_Pos) /*!< CAP_T::CWSP: CWSADDRV Mask */ - -#define CAP_CWS_CWW_Pos (0) /*!< CAP_T::CWS: CWW Position */ -#define CAP_CWS_CWW_Msk (0xffful << CAP_CWS_CWW_Pos) /*!< CAP_T::CWS: CWW Mask */ - -#define CAP_CWS_CWH_Pos (16) /*!< CAP_T::CWS: CIWH Position */ -#define CAP_CWS_CWH_Msk (0x7fful << CAP_CWS_CWH_Pos) /*!< CAP_T::CWS: CIWH Mask */ - -#define CAP_PKTSL_PKTSHML_Pos (0) /*!< CAP_T::PKTSL: PKTSHML Position */ -#define CAP_PKTSL_PKTSHML_Msk (0xfful << CAP_PKTSL_PKTSHML_Pos) /*!< CAP_T::PKTSL: PKTSHML Mask */ - -#define CAP_PKTSL_PKTSHNL_Pos (8) /*!< CAP_T::PKTSL: PKTSHNL Position */ -#define CAP_PKTSL_PKTSHNL_Msk (0xfful << CAP_PKTSL_PKTSHNL_Pos) /*!< CAP_T::PKTSL: PKTSHNL Mask */ - -#define CAP_PKTSL_PKTSVML_Pos (16) /*!< CAP_T::PKTSL: PKTSVML Position */ -#define CAP_PKTSL_PKTSVML_Msk (0xfful << CAP_PKTSL_PKTSVML_Pos) /*!< CAP_T::PKTSL: PKTSVML Mask */ - -#define CAP_PKTSL_PKTSVNL_Pos (24) /*!< CAP_T::PKTSL: PKTSVNL Position */ -#define CAP_PKTSL_PKTSVNL_Msk (0xfful << CAP_PKTSL_PKTSVNL_Pos) /*!< CAP_T::PKTSL: PKTSVNL Mask */ - -#define CAP_PLNSL_PLNSHML_Pos (0) /*!< CAP_T::PLNSL: PLNSHML Position */ -#define CAP_PLNSL_PLNSHML_Msk (0xfful << CAP_PLNSL_PLNSHML_Pos) /*!< CAP_T::PLNSL: PLNSHML Mask */ - -#define CAP_PLNSL_PLNSHNL_Pos (8) /*!< CAP_T::PLNSL: PLNSHNL Position */ -#define CAP_PLNSL_PLNSHNL_Msk (0xfful << CAP_PLNSL_PLNSHNL_Pos) /*!< CAP_T::PLNSL: PLNSHNL Mask */ - -#define CAP_PLNSL_PLNSVML_Pos (16) /*!< CAP_T::PLNSL: PLNSVML Position */ -#define CAP_PLNSL_PLNSVML_Msk (0xfful << CAP_PLNSL_PLNSVML_Pos) /*!< CAP_T::PLNSL: PLNSVML Mask */ - -#define CAP_PLNSL_PLNSVNL_Pos (24) /*!< CAP_T::PLNSL: PLNSVNL Position */ -#define CAP_PLNSL_PLNSVNL_Msk (0xfful << CAP_PLNSL_PLNSVNL_Pos) /*!< CAP_T::PLNSL: PLNSVNL Mask */ - -#define CAP_FRCTL_FRM_Pos (0) /*!< CAP_T::FRCTL: FRM Position */ -#define CAP_FRCTL_FRM_Msk (0x3ful << CAP_FRCTL_FRM_Pos) /*!< CAP_T::FRCTL: FRM Mask */ - -#define CAP_FRCTL_FRN_Pos (8) /*!< CAP_T::FRCTL: FRN Position */ -#define CAP_FRCTL_FRN_Msk (0x3ful << CAP_FRCTL_FRN_Pos) /*!< CAP_T::FRCTL: FRN Mask */ - -#define CAP_STRIDE_PKTSTRIDE_Pos (0) /*!< CAP_T::STRIDE: PKTSTRIDE Position */ -#define CAP_STRIDE_PKTSTRIDE_Msk (0x3ffful << CAP_STRIDE_PKTSTRIDE_Pos) /*!< CAP_T::STRIDE: PKTSTRIDE Mask */ - -#define CAP_STRIDE_PLNSTRIDE_Pos (16) /*!< CAP_T::STRIDE: PLNSTRIDE Position */ -#define CAP_STRIDE_PLNSTRIDE_Msk (0x3ffful << CAP_STRIDE_PLNSTRIDE_Pos) /*!< CAP_T::STRIDE: PLNSTRIDE Mask */ - -#define CAP_FIFOTH_PLNVFTH_Pos (0) /*!< CAP_T::FIFOTH: PLNVFTH Position */ -#define CAP_FIFOTH_PLNVFTH_Msk (0xful << CAP_FIFOTH_PLNVFTH_Pos) /*!< CAP_T::FIFOTH: PLNVFTH Mask */ - -#define CAP_FIFOTH_PLNUFTH_Pos (8) /*!< CAP_T::FIFOTH: PLNUFTH Position */ -#define CAP_FIFOTH_PLNUFTH_Msk (0xful << CAP_FIFOTH_PLNUFTH_Pos) /*!< CAP_T::FIFOTH: PLNUFTH Mask */ - -#define CAP_FIFOTH_PLNYFTH_Pos (16) /*!< CAP_T::FIFOTH: PLNYFTH Position */ -#define CAP_FIFOTH_PLNYFTH_Msk (0x1ful << CAP_FIFOTH_PLNYFTH_Pos) /*!< CAP_T::FIFOTH: PLNYFTH Mask */ - -#define CAP_FIFOTH_PKTFTH_Pos (24) /*!< CAP_T::FIFOTH: PKTFTH Position */ -#define CAP_FIFOTH_PKTFTH_Msk (0x1ful << CAP_FIFOTH_PKTFTH_Pos) /*!< CAP_T::FIFOTH: PKTFTH Mask */ - -#define CAP_FIFOTH_OVF_Pos (31) /*!< CAP_T::FIFOTH: OVF Position */ -#define CAP_FIFOTH_OVF_Msk (0x1ul << CAP_FIFOTH_OVF_Pos) /*!< CAP_T::FIFOTH: OVF Mask */ - -#define CAP_CMPADDR_CMPADDR_Pos (0) /*!< CAP_T::CMPADDR: CMPADDR Position */ -#define CAP_CMPADDR_CMPADDR_Msk (0xfffffffful << CAP_CMPADDR_CMPADDR_Pos) /*!< CAP_T::CMPADDR: CMPADDR Mask */ - -#define CAP_PKTSM_PKTSHMH_Pos (0) /*!< CAP_T::PKTSM: PKTSHMH Position */ -#define CAP_PKTSM_PKTSHMH_Msk (0xfful << CAP_PKTSM_PKTSHMH_Pos) /*!< CAP_T::PKTSM: PKTSHMH Mask */ - -#define CAP_PKTSM_PKTSHNH_Pos (8) /*!< CAP_T::PKTSM: PKTSHNH Position */ -#define CAP_PKTSM_PKTSHNH_Msk (0xfful << CAP_PKTSM_PKTSHNH_Pos) /*!< CAP_T::PKTSM: PKTSHNH Mask */ - -#define CAP_PKTSM_PKTSVMH_Pos (16) /*!< CAP_T::PKTSM: PKTSVMH Position */ -#define CAP_PKTSM_PKTSVMH_Msk (0xfful << CAP_PKTSM_PKTSVMH_Pos) /*!< CAP_T::PKTSM: PKTSVMH Mask */ - -#define CAP_PKTSM_PKTSVNH_Pos (24) /*!< CAP_T::PKTSM: PKTSVNH Position */ -#define CAP_PKTSM_PKTSVNH_Msk (0xfful << CAP_PKTSM_PKTSVNH_Pos) /*!< CAP_T::PKTSM: PKTSVNH Mask */ - -#define CAP_PLNSM_PLNSHMH_Pos (0) /*!< CAP_T::PLNSM: PLNSHMH Position */ -#define CAP_PLNSM_PLNSHMH_Msk (0xfful << CAP_PLNSM_PLNSHMH_Pos) /*!< CAP_T::PLNSM: PLNSHMH Mask */ - -#define CAP_PLNSM_PLNSHNH_Pos (8) /*!< CAP_T::PLNSM: PLNSHNH Position */ -#define CAP_PLNSM_PLNSHNH_Msk (0xfful << CAP_PLNSM_PLNSHNH_Pos) /*!< CAP_T::PLNSM: PLNSHNH Mask */ - -#define CAP_PLNSM_PLNSVMH_Pos (16) /*!< CAP_T::PLNSM: PLNSVMH Position */ -#define CAP_PLNSM_PLNSVMH_Msk (0xfful << CAP_PLNSM_PLNSVMH_Pos) /*!< CAP_T::PLNSM: PLNSVMH Mask */ - -#define CAP_PLNSM_PLNSVNH_Pos (24) /*!< CAP_T::PLNSM: PLNSVNH Position */ -#define CAP_PLNSM_PLNSVNH_Msk (0xfful << CAP_PLNSM_PLNSVNH_Pos) /*!< CAP_T::PLNSM: PLNSVNH Mask */ - -#define CAP_CURADDRP_CURADDR_Pos (0) /*!< CAP_T::CURADDRP: CURADDR Position */ -#define CAP_CURADDRP_CURADDR_Msk (0xfffffffful << CAP_CURADDRP_CURADDR_Pos) /*!< CAP_T::CURADDRP: CURADDR Mask */ - -#define CAP_CURADDRY_CURADDR_Pos (0) /*!< CAP_T::CURADDRY: CURADDR Position */ -#define CAP_CURADDRY_CURADDR_Msk (0xfffffffful << CAP_CURADDRY_CURADDR_Pos) /*!< CAP_T::CURADDRY: CURADDR Mask */ - -#define CAP_CURADDRU_CURADDR_Pos (0) /*!< CAP_T::CURADDRU: CURADDR Position */ -#define CAP_CURADDRU_CURADDR_Msk (0xfffffffful << CAP_CURADDRU_CURADDR_Pos) /*!< CAP_T::CURADDRU: CURADDR Mask */ - -#define CAP_CURVADDR_CURADDR_Pos (0) /*!< CAP_T::CURVADDR: CURADDR Position */ -#define CAP_CURVADDR_CURADDR_Msk (0xfffffffful << CAP_CURVADDR_CURADDR_Pos) /*!< CAP_T::CURVADDR: CURADDR Mask */ - -#define CAP_PKTBA0_BASEADDR_Pos (0) /*!< CAP_T::PKTBA0: BASEADDR Position */ -#define CAP_PKTBA0_BASEADDR_Msk (0xfffffffful << CAP_PKTBA0_BASEADDR_Pos) /*!< CAP_T::PKTBA0: BASEADDR Mask */ - -#define CAP_PKTBA1_BASEADDR_Pos (0) /*!< CAP_T::PKTBA1: BASEADDR Position */ -#define CAP_PKTBA1_BASEADDR_Msk (0xfffffffful << CAP_PKTBA1_BASEADDR_Pos) /*!< CAP_T::PKTBA1: BASEADDR Mask */ - -#define CAP_YBA_BASEADDR_Pos (0) /*!< CAP_T::YBA: BASEADDR Position */ -#define CAP_YBA_BASEADDR_Msk (0xfffffffful << CAP_YBA_BASEADDR_Pos) /*!< CAP_T::YBA: BASEADDR Mask */ - -#define CAP_UBA_BASEADDR_Pos (0) /*!< CAP_T::UBA: BASEADDR Position */ -#define CAP_UBA_BASEADDR_Msk (0xfffffffful << CAP_UBA_BASEADDR_Pos) /*!< CAP_T::UBA: BASEADDR Mask */ - -#define CAP_VBA_BASEADDR_Pos (0) /*!< CAP_T::VBA: BASEADDR Position */ -#define CAP_VBA_BASEADDR_Msk (0xfffffffful << CAP_VBA_BASEADDR_Pos) /*!< CAP_T::VBA: BASEADDR Mask */ - -/**@}*/ /* CAP_CONST */ -/**@}*/ /* end of CAP register group */ - - -#define CAP0 ((CAP_T *) CAP0_BA) -#define CAP1 ((CAP_T *) CAP1_BA) - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CAP_Driver CAP Driver - @{ -*/ - -/** @addtogroup CAP_EXPORTED_CONSTANTS CAP Exported Constants - @{ -*/ - - - - -/*---------------------------------------------------------------------------------------------------------*/ -/* VINCTRL constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define CAP_CTL_CAPEN (1ul<CTL & CAP_CTL_CAPEN_Msk)?0:1) - -/** - * @brief Clear CAP flag - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32IntMask interrupt flags settings. It could be - * - \ref CAP_INT_VINTF_Msk - * - \ref CAP_INT_MEINTF_Msk - * - \ref CAP_INT_ADDRMINTF_Msk - * - \ref CAP_INT_MDINTF_Msk - * - * @return TRUE(Enable) or FALSE(Disable) - * - * @details Clear Image Capture Interface interrupt flag - * \hideinitializer - */ -#define CAP_CLR_INT_FLAG(VCAP,u32IntMask) (VCAP->INT |=u32IntMask) - -/** - * @brief Get CAP Interrupt status - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @return TRUE(Enable) or FALSE(Disable) - * - * @details Get Image Capture Interface interrupt status. - * \hideinitializer - */ -#define CAP_GET_INT_STS(VCAP) (VCAP->INT) - -void CAP_Open(CAP_T *VCAP, uint32_t u32InFormat, uint32_t u32OutFormet); -void CAP_SetCroppingWindow(CAP_T *VCAP, uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width); -void CAP_SetPacketBuf(CAP_T *VCAP, uint32_t u32Address); -void CAP_SetPlanarBuf(CAP_T *VCAP, uint32_t u32YAddr, uint32_t u32UAddr, uint32_t u32VAddr); -void CAP_Close(CAP_T *VCAP); -void CAP_EnableInt(CAP_T *VCAP, uint32_t u32IntMask); -void CAP_DisableInt(CAP_T *VCAP, uint32_t u32IntMask); -void CAP_Start(CAP_T *VCAP); -void CAP_Stop(CAP_T *VCAP, uint32_t u32FrameComplete); -void CAP_SetPacketScaling(CAP_T *VCAP, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator); -void CAP_SetPlanarScaling(CAP_T *VCAP, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator); -void CAP_SetPacketStride(CAP_T *VCAP, uint32_t u32Stride); -void CAP_SetPlanarStride(CAP_T *VCAP, uint32_t u32Stride); -void CAP_EnableMotionDet(CAP_T *VCAP, uint32_t u32Freq, uint32_t u32BlockSize, uint32_t u32Format, uint32_t u32Threshold, uint32_t u32YDetAddr, uint32_t u32DetAddr); -void CAP_DisableMotionDet(CAP_T *VCAP); - -/*@}*/ /* end of group CAP_EXPORTED_FUNCTIONS */ - - - -/*@}*/ /* end of group CAP_Driver */ - -/*@}*/ /* end of group Device_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__CAP_H__ - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_crypto.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_crypto.h deleted file mode 100644 index cec2d6f1879..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_crypto.h +++ /dev/null @@ -1,1456 +0,0 @@ -/**************************************************************************//** - * @file crypto.h - * @version V1.10 - * @brief Cryptographic Accelerator driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_CRYPTO_H__ -#define __NU_CRYPTO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup Crypto_Driver Crypto Driver - @{ -*/ - -/** - @addtogroup CRPT Cryptographic Accelerator(CRPT) - Memory Mapped Structure for Cryptographic Accelerator -@{ */ - -typedef struct -{ - - /** - * @var CRPT_T::INTEN - * Offset: 0x00 Crypto Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIEN |AES Interrupt Enable Control - * | | |0 = AES interrupt Disabled. - * | | |1 = AES interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in AES_DMA_CNT is fed into the AES engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the AES engine finishes the operation. - * |[1] |AESEIEN |AES Error Flag Enable Control - * | | |0 = AES error interrupt flag Disabled. - * | | |1 = AES error interrupt flag Enabled. - * |[8] |TDESIEN |TDES/DES Interrupt Enable Control - * | | |0 = TDES/DES interrupt Disabled. - * | | |1 = TDES/DES interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in TDES_DMA_CNT is fed into the TDES engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the TDES engine finishes the operation. - * |[9] |TDESEIEN |TDES/DES Error Flag Enable Control - * | | |0 = TDES/DES error interrupt flag Disabled. - * | | |1 = TDES/DES error interrupt flag Enabled. - * |[16] |PRNGIEN |PRNG Interrupt Enable Control - * | | |0 = PRNG interrupt Disabled. - * | | |1 = PRNG interrupt Enabled. - * |[22] |ECCIEN |ECC Interrupt Enable Control - * | | |0 = ECC interrupt Disabled. - * | | |1 = ECC interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in ECC_DMA_CNT is fed into the ECC engine. - * | | |In Non-DMA mode, an interrupt will be triggered when the ECC engine finishes the operation. - * |[23] |ECCEIEN |ECC Error Interrupt Enable Control - * | | |0 = ECC error interrupt flag Disabled. - * | | |1 = ECC error interrupt flag Enabled. - * |[24] |HMACIEN |SHA/HMAC Interrupt Enable Control - * | | |0 = SHA/HMAC interrupt Disabled. - * | | |1 = SHA/HMAC interrupt Enabled. - * | | |In DMA mode, an interrupt will be triggered when amount of data set in SHA _DMA_CNT is fed into the SHA/HMAC engine - * | | |In Non-DMA mode, an interrupt will be triggered when the SHA/HMAC engine finishes the operation. - * |[25] |HMACEIEN |SHA/HMAC Error Interrupt Enable Control - * | | |0 = SHA/HMAC error interrupt flag Disabled. - * | | |1 = SHA/HMAC error interrupt flag Enabled. - * @var CRPT_T::INTSTS - * Offset: 0x04 Crypto Interrupt Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AESIF |AES Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No AES interrupt. - * | | |= AES encryption/decryption done interrupt. - * |[1] |AESEIF |AES Error Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No AES error. - * | | |1 = AES encryption/decryption done interrupt. - * |[8] |TDESIF |TDES/DES Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No TDES/DES interrupt. - * | | |1 = TDES/DES encryption/decryption done interrupt. - * |[9] |TDESEIF |TDES/DES Error Flag - * | | |This bit includes the operating and setting error - * | | |The detailed flag is shown in the CRPT_TDES_STS register - * | | |This includes operating and setting error. - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No TDES/DES error. - * | | |1 = TDES/DES encryption/decryption error interrupt. - * |[16] |PRNGIF |PRNG Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No PRNG interrupt. - * | | |1 = PRNG key generation done interrupt. - * |[22] |ECCIF |ECC Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No ECC interrupt. - * | | |1 = ECC operation done interrupt. - * |[23] |ECCEIF |ECC Error Flag - * | | |This register includes operating and setting error. The detail flag is shown in CRPT_ECC_STS register. - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No ECC error. - * | | |1 = ECC error interrupt. - * |[24] |HMACIF |SHA/HMAC Finish Interrupt Flag - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No SHA/HMAC interrupt. - * | | |1 = SHA/HMAC operation done interrupt. - * |[25] |HMACEIF |SHA/HMAC Error Flag - * | | |This register includes operating and setting error. The detail flag is shown in CRPT_HMAC_STS register. - * | | |This bit is cleared by writing 1, and it has no effect by writing 0. - * | | |0 = No SHA/HMAC error. - * | | |1 = SHA/HMAC error interrupt. - * @var CRPT_T::PRNG_CTL - * Offset: 0x08 PRNG Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |Start PRNG Engine - * | | |0 = Stop PRNG engine. - * | | |1 = Generate new key and store the new key to register CRPT_PRNG_KEYx , which will be cleared when the new key is generated. - * |[1] |SEEDRLD |Reload New Seed for PRNG Engine - * | | |0 = Generating key based on the current seed. - * | | |1 = Reload new seed. - * |[3:2] |KEYSZ |PRNG Generate Key Size - * | | |00 = 64 bits. - * | | |01 = 128 bits. - * | | |10 = 192 bits. - * | | |11 = 256 bits. - * |[8] |BUSY |PRNG Busy (Read Only) - * | | |0 = PRNG engine is idle. - * | | |1 = Indicate that the PRNG engine is generating CRPT_PRNG_KEYx. - * @var CRPT_T::PRNG_SEED - * Offset: 0x0C Seed for PRNG - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SEED |Seed for PRNG (Write Only) - * | | |The bits store the seed for PRNG engine. - * @var CRPT_T::PRNG_KEY[8] - * Offset: 0x10 ~ 0x2C PRNG Generated Key0 ~ Key7 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |Store PRNG Generated Key (Read Only) - * | | |The bits store the key that is generated by PRNG. - * @var CRPT_T::AES_FDBCK[4] - * Offset: 0x50 ~ 0x5C AES Engine Output Feedback Data after Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |AES Feedback Information - * | | |The feedback value is 128 bits in size. - * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AESn_IVx for the next block in DMA cascade mode. - * | | |The AES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to this register in the same channel operation, and then continue the operation with the original setting. - * @var CRPT_T::TDES_FDBCKH - * Offset: 0x60 TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |TDES/DES Feedback - * | | |The feedback value is 64 bits in size. - * | | |The TDES/DES engine uses the data from {CRPT_TDES_FDBCKH, CRPT_TDES_FDBCKL} as the data inputted to {CRPT_TDESn_IVH, CRPT_TDESn_IVL} for the next block in DMA cascade mode - * | | |The feedback register is for CBC, CFB, and OFB mode. - * | | |TDES/DES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to this register in the same channel operation - * | | |Then can continue the operation with the original setting. - * @var CRPT_T::TDES_FDBCKL - * Offset: 0x64 TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |FDBCK |TDES/DES Feedback - * | | |The feedback value is 64 bits in size. - * | | |The TDES/DES engine uses the data from {CRPT_TDES_FDBCKH, CRPT_TDES_FDBCKL} as the data inputted to {CRPT_TDESn_IVH, CRPT_TDESn_IVL} for the next block in DMA cascade mode - * | | |The feedback register is for CBC, CFB, and OFB mode. - * | | |TDES/DES engine outputs feedback information for IV in the next block's operation - * | | |Software can use this feedback information to implement more than four DMA channels - * | | |Software can store that feedback value temporarily - * | | |After switching back, fill the stored feedback value to this register in the same channel operation - * | | |Then can continue the operation with the original setting. - * @var CRPT_T::AES_CTL - * Offset: 0x100 AES Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |AES Engine Start - * | | |0 = No effect. - * | | |1 = Start AES engine. BUSY flag will be set. - * | | |Note: This bit is always 0 when it's read back. - * |[1] |STOP |AES Engine Stop - * | | |0 = No effect. - * | | |1 = Stop AES engine. - * | | |Note: This bit is always 0 when it's read back. - * |[3:2] |KEYSZ |AES Key Size - * | | |This bit defines three different key size for AES operation. - * | | |2'b00 = 128 bits key. - * | | |2'b01 = 192 bits key. - * | | |2'b10 = 256 bits key. - * | | |2'b11 = Reserved. - * | | |If the AES accelerator is operating and the corresponding flag BUSY is 1, updating this register has no effect. - * |[5] |DMALAST |AES Last Block - * | | |In DMA mode, this bit must be set as beginning the last DMA cascade round. - * | | |In Non-DMA mode, this bit must be set when feeding in the last block of data in ECB, CBC, CTR, OFB, and CFB mode, and feeding in the (last-1) block of data at CBC-CS1, CBC-CS2, and CBC-CS3 mode. - * | | |This bit is always 0 when it's read back. Must be written again once START is triggered. - * |[6] |DMACSCAD |AES Engine DMA with Cascade Mode - * | | |0 = DMA cascade function Disabled. - * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation. - * |[7] |DMAEN |AES Engine DMA Enable Control - * | | |0 = AES DMA engine Disabled. - * | | |The AES engine operates in Non-DMA mode, and gets data from the port CRPT_AES_DATIN. - * | | |1 = AES_DMA engine Enabled. - * | | |The AES engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[15:8] |OPMODE |AES Engine Operation Modes - * | | |0x00 = ECB (Electronic Codebook Mode) 0x01 = CBC (Cipher Block Chaining Mode). - * | | |0x02 = CFB (Cipher Feedback Mode). - * | | |0x03 = OFB (Output Feedback Mode). - * | | |0x04 = CTR (Counter Mode). - * | | |0x10 = CBC-CS1 (CBC Ciphertext-Stealing 1 Mode). - * | | |0x11 = CBC-CS2 (CBC Ciphertext-Stealing 2 Mode). - * | | |0x12 = CBC-CS3 (CBC Ciphertext-Stealing 3 Mode). - * |[16] |ENCRPT |AES Encryption/Decryption - * | | |0 = AES engine executes decryption operation. - * | | |1 = AES engine executes encryption operation. - * |[22] |OUTSWAP |AES Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU outputs data from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |AES Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[25:24] |CHANNEL |AES Engine Working Channel - * | | |00 = Current control register setting is for channel 0. - * | | |01 = Current control register setting is for channel 1. - * | | |10 = Current control register setting is for channel 2. - * | | |11 = Current control register setting is for channel 3. - * |[30:26] |KEYUNPRT |Unprotect Key - * | | |Writing 0 to CRPT_AES_CTL[31] and "10110" to CRPT_AES_CTL[30:26] is to unprotect the AES key. - * | | |The KEYUNPRT can be read and written - * | | |When it is written as the AES engine is operating, BUSY flag is 1, there would be no effect on KEYUNPRT. - * |[31] |KEYPRT |Protect Key - * | | |Read as a flag to reflect KEYPRT. - * | | |0 = No effect. - * | | |1 = Protect the content of the AES key from reading - * | | |The return value for reading CRPT_AESn_KEYx is not the content of the registers CRPT_AESn_KEYx - * | | |Once it is set, it can be cleared by asserting KEYUNPRT - * | | |And the key content would be cleared as well. - * @var CRPT_T::AES_STS - * Offset: 0x104 AES Engine Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |AES Engine Busy - * | | |0 = The AES engine is idle or finished. - * | | |1 = The AES engine is under processing. - * |[8] |INBUFEMPTY|AES Input Buffer Empty - * | | |0 = There are some data in input buffer waiting for the AES engine to process. - * | | |1 = AES input buffer is empty - * | | |Software needs to feed data to the AES engine - * | | |Otherwise, the AES engine will be pending to wait for input data. - * |[9] |INBUFFULL |AES Input Buffer Full Flag - * | | |0 = AES input buffer is not full. Software can feed the data into the AES engine. - * | | |1 = AES input buffer is full - * | | |Software cannot feed data to the AES engine - * | | |Otherwise, the flag INBUFERR will be set to 1. - * |[10] |INBUFERR |AES Input Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during feeding data to the AES engine. - * |[12] |CNTERR |CRPT_AESn_CNT Setting Error - * | | |0 = No error in CRPT_AESn_CNT setting. - * | | |1 = CRPT_AESn_CNT is not a multiply of 16 in ECB, CBC, CFB, OFB, and CTR mode. - * |[16] |OUTBUFEMPTY|AES Out Buffer Empty - * | | |0 = AES output buffer is not empty. There are some valid data kept in output buffer. - * | | |1 = AES output buffer is empty - * | | |Software cannot get data from CRPT_AES_DATOUT - * | | |Otherwise, the flag OUTBUFERR will be set to 1 since the output buffer is empty. - * |[17] |OUTBUFFULL|AES Out Buffer Full Flag - * | | |0 = AES output buffer is not full. - * | | |1 = AES output buffer is full, and software needs to get data from CRPT_AES_DATOUT - * | | |Otherwise, the AES engine will be pending since the output buffer is full. - * |[18] |OUTBUFERR |AES Out Buffer Error Flag - * | | |0 = No error. - * | | |1 = Error happens during getting the result from AES engine. - * |[20] |BUSERR |AES DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and AES engine. - * @var CRPT_T::AES_DATIN - * Offset: 0x108 AES Engine Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |AES Engine Input Port - * | | |CPU feeds data to AES engine through this port by checking CRPT_AES_STS. Feed data as INBUFFULL is 0. - * @var CRPT_T::AES_DATOUT - * Offset: 0x10C AES Engine Data Output Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATOUT |AES Engine Output Port - * | | |CPU gets results from the AES engine through this port by checking CRPT_AES_STS - * | | |Get data as OUTBUFEMPTY is 0. - * @var CRPT_T::AES0_KEY[8] - * Offset: 0x110 ~ 0x12C AES Key Word 0 ~ 7 Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEY |CRPT_AESn_KEYx - * | | |The KEY keeps the security key for AES operation. - * | | |n = 0, 1..3. - * | | |x = 0, 1..7. - * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key - * | | |{CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 128-bit security key for AES operation - * | | |{CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 192-bit security key for AES operation - * | | |{CRPT_AESn_KEY7, CRPT_AESn_KEY6, CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 256-bit security key for AES operation. - * @var CRPT_T::AES0_IV[4] - * Offset: 0x130 ~ 0x13C AES Initial Vector Word 0 ~ 3 Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |IV |AES Initial Vectors - * | | |n = 0, 1..3. - * | | |x = 0, 1..3. - * | | |Four initial vectors (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) are for AES operating in CBC, CFB, and OFB mode - * | | |Four registers (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) act as Nonce counter when the AES engine is operating in CTR mode. - * @var CRPT_T::AES0_SADDR - * Offset: 0x140 AES DMA Source Address Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |AES DMA Source Address - * | | |The AES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the AES accelerator can read the plain text from system memory and do AES operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of SADDR are ignored. - * | | |SADDR can be read and written - * | | |Writing to SADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_SADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES0_DADDR - * Offset: 0x144 AES DMA Destination Address Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |AES DMA Destination Address - * | | |The AES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO - * | | |The DADDR keeps the destination address of the data buffer where the engine output's text will be stored - * | | |Based on the destination address, the AES accelerator can write the cipher text back to system memory after the AES operation is finished - * | | |The start of destination address should be located at word boundary - * | | |In other words, bit 1 and 0 of DADDR are ignored. - * | | |DADDR can be read and written - * | | |Writing to DADDR while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of DADDR will be updated later on - * | | |Consequently, software can prepare the destination address for the next AES operation. - * | | |In DMA mode, software can update the next CRPT_AESn_DADDR before triggering START. - * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same. - * @var CRPT_T::AES0_CNT - * Offset: 0x148 AES Byte Count Register for Channel 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CNT |AES Byte Count - * | | |The CRPT_AESn_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode - * | | |The CRPT_AESn_CNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_AESn_CNT can be read and written - * | | |Writing to CRPT_AESn_CNT while the AES accelerator is operating doesn't affect the current AES operation - * | | |But the value of CRPT_AESn_CNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next AES operation. - * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be at least one block - * | | |Operations that are less than one block will output unexpected result. - * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_AESn_CNT must be set as byte count for the last block of data before feeding in the last block of data - * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AESn_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data. - * @var CRPT_T::HMAC_CTL - * Offset: 0x300 SHA/HMAC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |SHA/HMAC Engine Start - * | | |0 = No effect. - * | | |1 = Start SHA/HMAC engine. BUSY flag will be set. - * | | |This bit is always 0 when it's read back. - * |[1] |STOP |SHA/HMAC Engine Stop - * | | |0 = No effect. - * | | |1 = Stop SHA/HMAC engine. - * | | |This bit is always 0 when it's read back. - * |[4] |HMACEN |HMAC_SHA Engine Operating Mode - * | | |0 = execute SHA function. - * | | |1 = execute HMAC function. - * |[5] |DMALAST |SHA/HMAC Last Block - * | | |This bit must be set as feeding in last byte of data. - * |[7] |DMAEN |SHA/HMAC Engine DMA Enable Control - * | | |0 = SHA/HMAC DMA engine Disabled. - * | | |SHA/HMAC engine operates in Non-DMA mode, and gets data from the port CRPT_HMAC_DATIN. - * | | |1 = SHA/HMAC DMA engine Enabled. - * | | |SHA/HMAC engine operates in DMA mode, and data movement from/to the engine is done by DMA logic. - * |[10:8] |OPMODE |SHA/HMAC Engine Operation Modes - * | | |0x0xx: SHA160 - * | | |0x100: SHA256 - * | | |0x101: SHA224 - * | | |0x110: SHA512 - * | | |0x111: SHA384 - * | | |These bits can be read and written. But writing to them wouldn't take effect as BUSY is 1. - * |[22] |OUTSWAP |SHA/HMAC Engine Output Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * |[23] |INSWAP |SHA/HMAC Engine Input Data Swap - * | | |0 = Keep the original order. - * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}. - * @var CRPT_T::HMAC_STS - * Offset: 0x304 SHA/HMAC Status Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |SHA/HMAC Engine Busy - * | | |0 = SHA/HMAC engine is idle or finished. - * | | |1 = SHA/HMAC engine is busy. - * |[1] |DMABUSY |SHA/HMAC Engine DMA Busy Flag - * | | |0 = SHA/HMAC DMA engine is idle or finished. - * | | |1 = SHA/HMAC DMA engine is busy. - * |[8] |DMAERR |SHA/HMAC Engine DMA Error Flag - * | | |0 = Show the SHA/HMAC engine access normal. - * | | |1 = Show the SHA/HMAC engine access error. - * |[16] |DATINREQ |SHA/HMAC Non-DMA Mode Data Input Request - * | | |0 = No effect. - * | | |1 = Request SHA/HMAC Non-DMA mode data input. - * @var CRPT_T::HMAC_DGST[16] - * Offset: 0x308 ~ 0x344 SHA/HMAC Digest Message 0 ~ 15 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DGST |SHA/HMAC Digest Message Output Register - * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4. - * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6. - * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7. - * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11. - * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15. - * @var CRPT_T::HMAC_KEYCNT - * Offset: 0x348 SHA/HMAC Key Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |KEYCNT |SHA/HMAC Key Byte Count - * | | |The CRPT_HMAC_KEYCNT keeps the byte count of key that SHA/HMAC engine operates - * | | |The register is 32-bit and the maximum byte count is 4G bytes - * | | |It can be read and written. - * | | |Writing to the register CRPT_HMAC_KEYCNT as the SHA/HMAC accelerator operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRPT_SHA _KEYCNT will be updated later on - * | | |Consequently, software can prepare the key count for the next SHA/HMAC operation. - * @var CRPT_T::HMAC_SADDR - * Offset: 0x34C SHA/HMAC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |SHA/HMAC DMA Source Address - * | | |The SHA/HMAC accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO - * | | |The CRPT_HMAC_SADDR keeps the source address of the data buffer where the source text is stored - * | | |Based on the source address, the SHA/HMAC accelerator can read the plain text from system memory and do SHA/HMAC operation - * | | |The start of source address should be located at word boundary - * | | |In other words, bit 1 and 0 of CRPT_HMAC_SADDR are ignored. - * | | |CRPT_HMAC_SADDR can be read and written - * | | |Writing to CRPT_HMAC_SADDR while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_SADDR will be updated later on - * | | |Consequently, software can prepare the DMA source address for the next SHA/HMAC operation. - * | | |In DMA mode, software can update the next CRPT_HMAC_SADDR before triggering START. - * | | |CRPT_HMAC_SADDR and CRPT_HMAC_DADDR can be the same in the value. - * @var CRPT_T::HMAC_DMACNT - * Offset: 0x350 SHA/HMAC Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DMACNT |SHA/HMAC Operation Byte Count - * | | |The CRPT_HMAC_DMACNT keeps the byte count of source text that is for the SHA/HMAC engine operating in DMA mode - * | | |The CRPT_HMAC_DMACNT is 32-bit and the maximum of byte count is 4G bytes. - * | | |CRPT_HMAC_DMACNT can be read and written - * | | |Writing to CRPT_HMAC_DMACNT while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation - * | | |But the value of CRPT_HMAC_DMACNT will be updated later on - * | | |Consequently, software can prepare the byte count of data for the next SHA/HMAC operation. - * | | |In Non-DMA mode, CRPT_HMAC_DMACNT must be set as the byte count of the last block before feeding in the last block of data. - * @var CRPT_T::HMAC_DATIN - * Offset: 0x354 SHA/HMAC Engine Non-DMA Mode Data Input Port Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DATIN |SHA/HMAC Engine Input Port - * | | |CPU feeds data to SHA/HMAC engine through this port by checking CRPT_HMAC_STS - * | | |Feed data as DATINREQ is 1. - * @var CRPT_T::ECC_CTL - * Offset: 0x800 ECC Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |START |ECC Accelerator Start - * | | |0 = No effect. - * | | |1 = Start ECC accelerator. BUSY flag will be set. - * | | |This bit is always 0 when it's read back. - * | | |ECC accelerator will ignore this START signal when BUSY flag is 1. - * |[1] |STOP |ECC Accelerator Stop - * | | |0 = No effect. - * | | |1 = Abort ECC accelerator and make it into idle state. - * | | |This bit is always 0 when it's read back. - * | | |Remember to clear ECC interrupt flag after stopping ECC accelerator. - * |[7] |DMAEN |ECC Accelerator DMA Enable Control - * | | |0 = ECC DMA engine Disabled. - * | | |1 = ECC DMA engine Enabled. - * | | |Only when START and DMAEN are 1, ECC DMA engine will be active - * |[8] |FSEL |Field Selection - * | | |0 = Binary Field (GF(2^m)). - * | | |1 = Prime Field (GF(p)). - * |[10:9] |ECCOP |Point Operation for BF and PF - * | | |00 = Point multiplication :. - * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1). - * | | |01 = Modulus operation : choose by MODOP (CRPT_ECC_CTL[12:11]). - * | | |10 = Point addition :. - * | | |(POINTX1, POINTY1) = (POINTX1, POINTY1) +. - * | | |(POINTX2, POINTY2) - * | | |11 = Point doubling :. - * | | |(POINTX1, POINTY1) = 2 * (POINTX1, POINTY1). - * | | |Besides above three input data, point operations still need the parameters of elliptic curve (CURVEA, CURVEB, CURVEN and CURVEM) as shown in Figure 6.27-11 - * |[12:11] |MODOP |Modulus Operation for PF - * | | |00 = Division :. - * | | |POINTX1 = (POINTY1 / POINTX1) % CURVEN. - * | | |01 = Multiplication :. - * | | |POINTX1 = (POINTX1 * POINTY1) % CURVEN. - * | | |10 = Addition :. - * | | |POINTX1 = (POINTX1 + POINTY1) % CURVEN. - * | | |11 = Subtraction :. - * | | |POINTX1 = (POINTX1 - POINTY1) % CURVEN. - * | | |MODOP is active only when ECCOP = 01. - * |[16] |LDP1 |The Control Signal of Register for the X and Y Coordinate of the First Point (POINTX1, POINTY1) - * | | |0 = The register for POINTX1 and POINTY1 is not modified by DMA or user. - * | | |1 = The register for POINTX1 and POINTY1 is modified by DMA or user. - * |[17] |LDP2 |The Control Signal of Register for the X and Y Coordinate of the Second Point (POINTX2, POINTY2) - * | | |0 = The register for POINTX2 and POINTY2 is not modified by DMA or user. - * | | |1 = The register for POINTX2 and POINTY2 is modified by DMA or user. - * |[18] |LDA |The Control Signal of Register for the Parameter CURVEA of Elliptic Curve - * | | |0 = The register for CURVEA is not modified by DMA or user. - * | | |1 = The register for CURVEA is modified by DMA or user. - * |[19] |LDB |The Control Signal of Register for the Parameter CURVEB of Elliptic Curve - * | | |0 = The register for CURVEB is not modified by DMA or user. - * | | |1 = The register for CURVEB is modified by DMA or user. - * |[20] |LDN |The Control Signal of Register for the Parameter CURVEN of Elliptic Curve - * | | |0 = The register for CURVEN is not modified by DMA or user. - * | | |1 = The register for CURVEN is modified by DMA or user. - * |[21] |LDK |The Control Signal of Register for SCALARK - * | | |0 = The register for SCALARK is not modified by DMA or user. - * | | |1 = The register for SCALARK is modified by DMA or user. - * |[31:22] |CURVEM |The key length of elliptic curve. - * @var CRPT_T::ECC_STS - * Offset: 0x804 ECC Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |ECC Accelerator Busy Flag - * | | |0 = The ECC accelerator is idle or finished. - * | | |1 = The ECC accelerator is under processing and protects all registers. - * | | |Remember to clear ECC interrupt flag after ECC accelerator finished - * |[1] |DMABUSY |ECC DMA Busy Flag - * | | |0 = ECC DMA is idle or finished. - * | | |1 = ECC DMA is busy. - * |[16] |BUSERR |ECC DMA Access Bus Error Flag - * | | |0 = No error. - * | | |1 = Bus error will stop DMA operation and ECC accelerator. - * @var CRPT_T::ECC_X1[18] - * Offset: 0x808 ~ 0x84C ECC The X-coordinate word 0 ~ 17 of the first point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX1 |ECC the x-coordinate Value of the First Point (POINTX1) - * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08 - * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12 - * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17 - * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05 - * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06 - * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07 - * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11 - * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16 - * @var CRPT_T::ECC_Y1[18] - * Offset: 0x850 ~ 0x894 ECC The Y-coordinate word 0 ~ 17 of the first point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point (POINTY1) - * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08 - * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12 - * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17 - * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05 - * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06 - * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07 - * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11 - * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16 - * @var CRPT_T::ECC_X2[18] - * Offset: 0x898 ~ 0x8DC ECC The X-coordinate word 0 ~ 17 of the second point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTX2 |ECC the x-coordinate Value of the Second Point (POINTX2) - * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08 - * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12 - * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17 - * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05 - * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06 - * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07 - * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11 - * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16 - * @var CRPT_T::ECC_Y2[18] - * Offset: 0x8E0 ~ 0x924 ECC The Y-coordinate word 0 ~ 17 of the second point - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point (POINTY2) - * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08 - * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12 - * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17 - * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05 - * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06 - * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07 - * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11 - * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16 - * @var CRPT_T::ECC_A[18] - * Offset: 0x928 ~ 0x96C ECC The parameter CURVEA word 0 ~ 17 of elliptic curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve (CURVEA) - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2^m). - * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08 - * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12 - * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17 - * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05 - * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06 - * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07 - * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11 - * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16 - * @var CRPT_T::ECC_B[18] - * Offset: 0x970 ~ 0x9B4 ECC The parameter CURVEB word 0 ~ 17 of elliptic curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve (CURVEA) - * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2^m). - * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08 - * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12 - * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17 - * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05 - * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06 - * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07 - * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11 - * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16 - * @var CRPT_T::ECC_N[18] - * Offset: 0x9B8 ~ 0x9FC ECC The parameter CURVEN word 0 ~ 17 of elliptic curve - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve (CURVEN) - * | | |In GF(p), CURVEN is the prime p. - * | | |In GF(2^m), CURVEN is the irreducible polynomial. - * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08 - * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12 - * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17 - * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05 - * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06 - * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07 - * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11 - * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16 - * @var CRPT_T::ECC_K[18] - * Offset: 0xA00 ~ 0xA44 ECC The scalar SCALARK word0 of point multiplication - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication(SCALARK) - * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK. - * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08 - * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12 - * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17 - * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05 - * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06 - * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07 - * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11 - * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16 - * @var CRPT_T::ECC_SADDR - * Offset: 0xA48 ECC DMA Source Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SADDR |ECC DMA Source Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between - * | | |SRAM memory space and ECC accelerator. The SADDR keeps the source address of the data - * | | |buffer where the source text is stored. Based on the source address, the ECC accelerator - * | | |can read the DATA and PARAMETER from SRAM memory space and do ECC operation. The start - * | | |of source address should be located at word boundary. That is, bit 1 and 0 of SADDR are - * | | |ignored. SADDR can be read and written. In DMA mode, software must update the CRPT_ECC_SADDR - * | | |before triggering START. - * @var CRPT_T::ECC_DADDR - * Offset: 0xA4C ECC DMA Destination Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DADDR |ECC DMA Destination Address - * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between system memory and ECC accelerator - * | | |The DADDR keeps the destination address of the data buffer where output data of ECC engine will be stored - * | | |Based on the destination address, the ECC accelerator can write the result data back to system memory after the ECC operation is finished - * | | |The start of destination address should be located at word boundary - * | | |That is, bit 1 and 0 of DADDR are ignored - * | | |DADDR can be read and written - * | | |In DMA mode, software must update the CRPT_ECC_DADDR before triggering START - * @var CRPT_T::ECC_STARTREG - * Offset: 0xA50 ECC Starting Address of Updated Registers - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |STARTREG |ECC Starting Address of Updated Registers - * | | |The address of the updated registers that DMA feeds the first data or parameter to ECC engine - * | | |When ECC engine is active, ECC accelerator does not allow users to modify STARTREG - * | | |For example, we want to updated input data from register CRPT_ECC POINTX1 - * | | |Thus, the value of STARTREG is 0x808. - * @var CRPT_T::ECC_WORDCNT - * Offset: 0xA54 ECC DMA Word Count - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |WORDCNT |ECC DMA Word Count - * | | |The CRPT_ECC_WORDCNT keeps the word count of source data that is for the required input data of ECC accelerator with various operations in DMA mode - * | | |Although CRPT_ECC_WORDCNT is 32-bit, the maximum of word count in ECC accelerator is 144 words - * | | |CRPT_ECC_WORDCNT can be read and written - */ - __IO uint32_t INTEN; /*!< [0x0000] Crypto Interrupt Enable Control Register */ - __IO uint32_t INTSTS; /*!< [0x0004] Crypto Interrupt Flag */ - __IO uint32_t PRNG_CTL; /*!< [0x0008] PRNG Control Register */ - __O uint32_t PRNG_SEED; /*!< [0x000c] Seed for PRNG */ - __I uint32_t PRNG_KEY[8]; /*!< [0x0010] ~ [0x002c] PRNG Generated Key0 ~ Key7 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[8]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t AES_FDBCK[4]; /*!< [0x0050] ~ [0x005c] AES Engine Output Feedback Data after Cryptographic Operation */ - __I uint32_t TDES_FDBCKH; /*!< [0x0060] TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation */ - __I uint32_t TDES_FDBCKL; /*!< [0x0064] TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[38]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t AES_CTL; /*!< [0x0100] AES Control Register */ - __I uint32_t AES_STS; /*!< [0x0104] AES Engine Flag */ - __IO uint32_t AES_DATIN; /*!< [0x0108] AES Engine Data Input Port Register */ - __I uint32_t AES_DATOUT; /*!< [0x010c] AES Engine Data Output Port Register */ - __IO uint32_t AES0_KEY[8]; /*!< [0x0110] ~ [0x012c] AES Key Word 0~7 Register for Channel 0 */ - __IO uint32_t AES0_IV[4]; /*!< [0x0130] ~ [0x013c] AES Initial Vector Word 0 ~ 3 Register for Channel 0 */ - __IO uint32_t AES0_SADDR; /*!< [0x0140] AES DMA Source Address Register for Channel 0 */ - __IO uint32_t AES0_DADDR; /*!< [0x0144] AES DMA Destination Address Register for Channel 0 */ - __IO uint32_t AES0_CNT; /*!< [0x0148] AES Byte Count Register for Channel 0 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[109]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t HMAC_CTL; /*!< [0x0300] SHA/HMAC Control Register */ - __I uint32_t HMAC_STS; /*!< [0x0304] SHA/HMAC Status Flag */ - __I uint32_t HMAC_DGST[16]; /*!< [0x0308] ~ [0x0344] SHA/HMAC Digest Message 0~15 */ - __IO uint32_t HMAC_KEYCNT; /*!< [0x0348] SHA/HMAC Key Byte Count Register */ - __IO uint32_t HMAC_SADDR; /*!< [0x034c] SHA/HMAC DMA Source Address Register */ - __IO uint32_t HMAC_DMACNT; /*!< [0x0350] SHA/HMAC Byte Count Register */ - __IO uint32_t HMAC_DATIN; /*!< [0x0354] SHA/HMAC Engine Non-DMA Mode Data Input Port Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[298]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ECC_CTL; /*!< [0x0800] ECC Control Register */ - __I uint32_t ECC_STS; /*!< [0x0804] ECC Status Register */ - __IO uint32_t ECC_X1[18]; /*!< [0x0808] ~ [0x084c] ECC The X-coordinate word 0~17 of the first point */ - __IO uint32_t ECC_Y1[18]; /*!< [0x0850] ~ [0x0894] ECC The Y-coordinate word 0~17 of the first point */ - __IO uint32_t ECC_X2[18]; /*!< [0x0898] ~ [0x08dc] ECC The X-coordinate word 0~17 of the second point */ - __IO uint32_t ECC_Y2[18]; /*!< [0x08e0] ~ [0x0924] ECC The Y-coordinate word 0~17 of the second point */ - __IO uint32_t ECC_A[18]; /*!< [0x0928] ~ [0x096c] ECC The parameter CURVEA word 0~17 of elliptic curve */ - __IO uint32_t ECC_B[18]; /*!< [0x0970] ~ [0x09b4] ECC The parameter CURVEB word 0~17 of elliptic curve */ - __IO uint32_t ECC_N[18]; /*!< [0x09b8] ~ [0x09fc] ECC The parameter CURVEN word 0~17 of elliptic curve */ - __O uint32_t ECC_K[18]; /*!< [0x0a00] ~ [0x0a44] ECC The scalar SCALARK word 0~17 of point multiplication */ - __IO uint32_t ECC_SADDR; /*!< [0x0a48] ECC DMA Source Address Register */ - __IO uint32_t ECC_DADDR; /*!< [0x0a4c] ECC DMA Destination Address Register */ - __IO uint32_t ECC_STARTREG; /*!< [0x0a50] ECC Starting Address of Updated Registers */ - __IO uint32_t ECC_WORDCNT; /*!< [0x0a54] ECC DMA Word Count */ - /// @cond HIDDEN_SYMBOLS - uint32_t RESERVE4[358]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t ECC_FSM_DBG; /* Offset 0xFF0: ECC FSM Debug Register */ - /// @cond HIDDEN_SYMBOLS - uint32_t RESERVE5[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t RSA_CTL; /* Offset 0x1000: RSA Control Register */ - __IO uint32_t RSA_STS; /* Offset 0x1004: RSA Status Register */ - __IO uint32_t RSA_M[128]; /* Offset 0x1008: RSA the base of exponentiation words */ - __IO uint32_t RSA_E[128]; /* Offset 0x1208: RSA the exponent of exponentiation words */ - __IO uint32_t RSA_N[128]; /* Offset 0x1408: RSA the base of modulus operation word */ - __IO uint32_t RSA_C[128]; /* Offset 0x1608: RSA the constant value of Montgomery domain words */ - __IO uint32_t RSA_SADDR; /* Offset 0x1808: RSA DMA Source Address Register */ - __IO uint32_t RSA_DADDR; /* Offset 0x180C: RSA DMA Destination Address Register */ - __IO uint32_t RSA_STARTREG; /* Offset 0x1810: RSA Starting Address of Updated Registers */ - __IO uint32_t RSA_WORDCNT; /* Offset 0x1814: RSA DMA Word Count */ -} CRPT_T; - -#define CRPT ((CRPT_T *)0xB001C000) - -/** - @addtogroup CRPT_CONST CRPT Bit Field Definition - Constant Definitions for CRPT Controller -@{ */ - -#define CRPT_INTEN_AESIEN_Pos (0) /*!< CRPT_T::INTEN: AESIEN Position */ -#define CRPT_INTEN_AESIEN_Msk (0x1ul << CRPT_INTEN_AESIEN_Pos) /*!< CRPT_T::INTEN: AESIEN Mask */ - -#define CRPT_INTEN_AESEIEN_Pos (1) /*!< CRPT_T::INTEN: AESEIEN Position */ -#define CRPT_INTEN_AESEIEN_Msk (0x1ul << CRPT_INTEN_AESEIEN_Pos) /*!< CRPT_T::INTEN: AESEIEN Mask */ - -#define CRPT_INTEN_TDESIEN_Pos (8) /*!< CRPT_T::INTEN: TDESIEN Position */ -#define CRPT_INTEN_TDESIEN_Msk (0x1ul << CRPT_INTEN_TDESIEN_Pos) /*!< CRPT_T::INTEN: TDESIEN Mask */ - -#define CRPT_INTEN_TDESEIEN_Pos (9) /*!< CRPT_T::INTEN: TDESEIEN Position */ -#define CRPT_INTEN_TDESEIEN_Msk (0x1ul << CRPT_INTEN_TDESEIEN_Pos) /*!< CRPT_T::INTEN: TDESEIEN Mask */ - -#define CRPT_INTEN_PRNGIEN_Pos (16) /*!< CRPT_T::INTEN: PRNGIEN Position */ -#define CRPT_INTEN_PRNGIEN_Msk (0x1ul << CRPT_INTEN_PRNGIEN_Pos) /*!< CRPT_T::INTEN: PRNGIEN Mask */ - -#define CRPT_INTEN_ECCIEN_Pos (22) /*!< CRPT_T::INTEN: ECCIEN Position */ -#define CRPT_INTEN_ECCIEN_Msk (0x1ul << CRPT_INTEN_ECCIEN_Pos) /*!< CRPT_T::INTEN: ECCIEN Mask */ - -#define CRPT_INTEN_ECCEIEN_Pos (23) /*!< CRPT_T::INTEN: ECCEIEN Position */ -#define CRPT_INTEN_ECCEIEN_Msk (0x1ul << CRPT_INTEN_ECCEIEN_Pos) /*!< CRPT_T::INTEN: ECCEIEN Mask */ - -#define CRPT_INTEN_HMACIEN_Pos (24) /*!< CRPT_T::INTEN: HMACIEN Position */ -#define CRPT_INTEN_HMACIEN_Msk (0x1ul << CRPT_INTEN_HMACIEN_Pos) /*!< CRPT_T::INTEN: HMACIEN Mask */ - -#define CRPT_INTEN_HMACEIEN_Pos (25) /*!< CRPT_T::INTEN: HMACEIEN Position */ -#define CRPT_INTEN_HMACEIEN_Msk (0x1ul << CRPT_INTEN_HMACEIEN_Pos) /*!< CRPT_T::INTEN: HMACEIEN Mask */ - -#define CRPT_INTSTS_AESIF_Pos (0) /*!< CRPT_T::INTSTS: AESIF Position */ -#define CRPT_INTSTS_AESIF_Msk (0x1ul << CRPT_INTSTS_AESIF_Pos) /*!< CRPT_T::INTSTS: AESIF Mask */ - -#define CRPT_INTSTS_AESEIF_Pos (1) /*!< CRPT_T::INTSTS: AESEIF Position */ -#define CRPT_INTSTS_AESEIF_Msk (0x1ul << CRPT_INTSTS_AESEIF_Pos) /*!< CRPT_T::INTSTS: AESEIF Mask */ - -#define CRPT_INTSTS_TDESIF_Pos (8) /*!< CRPT_T::INTSTS: TDESIF Position */ -#define CRPT_INTSTS_TDESIF_Msk (0x1ul << CRPT_INTSTS_TDESIF_Pos) /*!< CRPT_T::INTSTS: TDESIF Mask */ - -#define CRPT_INTSTS_TDESEIF_Pos (9) /*!< CRPT_T::INTSTS: TDESEIF Position */ -#define CRPT_INTSTS_TDESEIF_Msk (0x1ul << CRPT_INTSTS_TDESEIF_Pos) /*!< CRPT_T::INTSTS: TDESEIF Mask */ - -#define CRPT_INTSTS_PRNGIF_Pos (16) /*!< CRPT_T::INTSTS: PRNGIF Position */ -#define CRPT_INTSTS_PRNGIF_Msk (0x1ul << CRPT_INTSTS_PRNGIF_Pos) /*!< CRPT_T::INTSTS: PRNGIF Mask */ - -#define CRPT_INTSTS_ECCIF_Pos (22) /*!< CRPT_T::INTSTS: ECCIF Position */ -#define CRPT_INTSTS_ECCIF_Msk (0x1ul << CRPT_INTSTS_ECCIF_Pos) /*!< CRPT_T::INTSTS: ECCIF Mask */ - -#define CRPT_INTSTS_ECCEIF_Pos (23) /*!< CRPT_T::INTSTS: ECCEIF Position */ -#define CRPT_INTSTS_ECCEIF_Msk (0x1ul << CRPT_INTSTS_ECCEIF_Pos) /*!< CRPT_T::INTSTS: ECCEIF Mask */ - -#define CRPT_INTSTS_HMACIF_Pos (24) /*!< CRPT_T::INTSTS: HMACIF Position */ -#define CRPT_INTSTS_HMACIF_Msk (0x1ul << CRPT_INTSTS_HMACIF_Pos) /*!< CRPT_T::INTSTS: HMACIF Mask */ - -#define CRPT_INTSTS_HMACEIF_Pos (25) /*!< CRPT_T::INTSTS: HMACEIF Position */ -#define CRPT_INTSTS_HMACEIF_Msk (0x1ul << CRPT_INTSTS_HMACEIF_Pos) /*!< CRPT_T::INTSTS: HMACEIF Mask */ - -#define CRPT_PRNG_CTL_START_Pos (0) /*!< CRPT_T::PRNG_CTL: START Position */ -#define CRPT_PRNG_CTL_START_Msk (0x1ul << CRPT_PRNG_CTL_START_Pos) /*!< CRPT_T::PRNG_CTL: START Mask */ - -#define CRPT_PRNG_CTL_SEEDRLD_Pos (1) /*!< CRPT_T::PRNG_CTL: SEEDRLD Position */ -#define CRPT_PRNG_CTL_SEEDRLD_Msk (0x1ul << CRPT_PRNG_CTL_SEEDRLD_Pos) /*!< CRPT_T::PRNG_CTL: SEEDRLD Mask */ - -#define CRPT_PRNG_CTL_KEYSZ_Pos (2) /*!< CRPT_T::PRNG_CTL: KEYSZ Position */ -#define CRPT_PRNG_CTL_KEYSZ_Msk (0x3ul << CRPT_PRNG_CTL_KEYSZ_Pos) /*!< CRPT_T::PRNG_CTL: KEYSZ Mask */ - -#define CRPT_PRNG_CTL_BUSY_Pos (8) /*!< CRPT_T::PRNG_CTL: BUSY Position */ -#define CRPT_PRNG_CTL_BUSY_Msk (0x1ul << CRPT_PRNG_CTL_BUSY_Pos) /*!< CRPT_T::PRNG_CTL: BUSY Mask */ - -#define CRPT_PRNG_SEED_SEED_Pos (0) /*!< CRPT_T::PRNG_SEED: SEED Position */ -#define CRPT_PRNG_SEED_SEED_Msk (0xfffffffful << CRPT_PRNG_SEED_SEED_Pos) /*!< CRPT_T::PRNG_SEED: SEED Mask */ - -#define CRPT_PRNG_KEYx_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY[8]: KEY Position */ -#define CRPT_PRNG_KEYx_KEY_Msk (0xfffffffful << CRPT_PRNG_KEYx_KEY_Pos) /*!< CRPT_T::PRNG_KEY[8]: KEY Mask */ - -#define CRPT_AES_FDBCKx_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK[4]: FDBCK Position */ -#define CRPT_AES_FDBCKx_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCKx_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK[4]: FDBCK Mask */ - -#define CRPT_TDES_FDBCKH_FDBCK_Pos (0) /*!< CRPT_T::TDES_FDBCKH: FDBCK Position */ -#define CRPT_TDES_FDBCKH_FDBCK_Msk (0xfffffffful << CRPT_TDES_FDBCKH_FDBCK_Pos) /*!< CRPT_T::TDES_FDBCKH: FDBCK Mask */ - -#define CRPT_TDES_FDBCKL_FDBCK_Pos (0) /*!< CRPT_T::TDES_FDBCKL: FDBCK Position */ -#define CRPT_TDES_FDBCKL_FDBCK_Msk (0xfffffffful << CRPT_TDES_FDBCKL_FDBCK_Pos) /*!< CRPT_T::TDES_FDBCKL: FDBCK Mask */ - -#define CRPT_AES_CTL_START_Pos (0) /*!< CRPT_T::AES_CTL: START Position */ -#define CRPT_AES_CTL_START_Msk (0x1ul << CRPT_AES_CTL_START_Pos) /*!< CRPT_T::AES_CTL: START Mask */ - -#define CRPT_AES_CTL_STOP_Pos (1) /*!< CRPT_T::AES_CTL: STOP Position */ -#define CRPT_AES_CTL_STOP_Msk (0x1ul << CRPT_AES_CTL_STOP_Pos) /*!< CRPT_T::AES_CTL: STOP Mask */ - -#define CRPT_AES_CTL_KEYSZ_Pos (2) /*!< CRPT_T::AES_CTL: KEYSZ Position */ -#define CRPT_AES_CTL_KEYSZ_Msk (0x3ul << CRPT_AES_CTL_KEYSZ_Pos) /*!< CRPT_T::AES_CTL: KEYSZ Mask */ - -#define CRPT_AES_CTL_DMALAST_Pos (5) /*!< CRPT_T::AES_CTL: DMALAST Position */ -#define CRPT_AES_CTL_DMALAST_Msk (0x1ul << CRPT_AES_CTL_DMALAST_Pos) /*!< CRPT_T::AES_CTL: DMALAST Mask */ - -#define CRPT_AES_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::AES_CTL: DMACSCAD Position */ -#define CRPT_AES_CTL_DMACSCAD_Msk (0x1ul << CRPT_AES_CTL_DMACSCAD_Pos) /*!< CRPT_T::AES_CTL: DMACSCAD Mask */ - -#define CRPT_AES_CTL_DMAEN_Pos (7) /*!< CRPT_T::AES_CTL: DMAEN Position */ -#define CRPT_AES_CTL_DMAEN_Msk (0x1ul << CRPT_AES_CTL_DMAEN_Pos) /*!< CRPT_T::AES_CTL: DMAEN Mask */ - -#define CRPT_AES_CTL_OPMODE_Pos (8) /*!< CRPT_T::AES_CTL: OPMODE Position */ -#define CRPT_AES_CTL_OPMODE_Msk (0xfful << CRPT_AES_CTL_OPMODE_Pos) /*!< CRPT_T::AES_CTL: OPMODE Mask */ - -#define CRPT_AES_CTL_ENCRPT_Pos (16) /*!< CRPT_T::AES_CTL: ENCRPT Position */ -#define CRPT_AES_CTL_ENCRPT_Msk (0x1ul << CRPT_AES_CTL_ENCRPT_Pos) /*!< CRPT_T::AES_CTL: ENCRPT Mask */ - -#define CRPT_AES_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::AES_CTL: OUTSWAP Position */ -#define CRPT_AES_CTL_OUTSWAP_Msk (0x1ul << CRPT_AES_CTL_OUTSWAP_Pos) /*!< CRPT_T::AES_CTL: OUTSWAP Mask */ - -#define CRPT_AES_CTL_INSWAP_Pos (23) /*!< CRPT_T::AES_CTL: INSWAP Position */ -#define CRPT_AES_CTL_INSWAP_Msk (0x1ul << CRPT_AES_CTL_INSWAP_Pos) /*!< CRPT_T::AES_CTL: INSWAP Mask */ - -#define CRPT_AES_CTL_CHANNEL_Pos (24) /*!< CRPT_T::AES_CTL: CHANNEL Position */ -#define CRPT_AES_CTL_CHANNEL_Msk (0x3ul << CRPT_AES_CTL_CHANNEL_Pos) /*!< CRPT_T::AES_CTL: CHANNEL Mask */ - -#define CRPT_AES_CTL_KEYUNPRT_Pos (26) /*!< CRPT_T::AES_CTL: KEYUNPRT Position */ -#define CRPT_AES_CTL_KEYUNPRT_Msk (0x1ful << CRPT_AES_CTL_KEYUNPRT_Pos) /*!< CRPT_T::AES_CTL: KEYUNPRT Mask */ - -#define CRPT_AES_CTL_KEYPRT_Pos (31) /*!< CRPT_T::AES_CTL: KEYPRT Position */ -#define CRPT_AES_CTL_KEYPRT_Msk (0x1ul << CRPT_AES_CTL_KEYPRT_Pos) /*!< CRPT_T::AES_CTL: KEYPRT Mask */ - -#define CRPT_AES_STS_BUSY_Pos (0) /*!< CRPT_T::AES_STS: BUSY Position */ -#define CRPT_AES_STS_BUSY_Msk (0x1ul << CRPT_AES_STS_BUSY_Pos) /*!< CRPT_T::AES_STS: BUSY Mask */ - -#define CRPT_AES_STS_INBUFEMPTY_Pos (8) /*!< CRPT_T::AES_STS: INBUFEMPTY Position */ -#define CRPT_AES_STS_INBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_INBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: INBUFEMPTY Mask */ - -#define CRPT_AES_STS_INBUFFULL_Pos (9) /*!< CRPT_T::AES_STS: INBUFFULL Position */ -#define CRPT_AES_STS_INBUFFULL_Msk (0x1ul << CRPT_AES_STS_INBUFFULL_Pos) /*!< CRPT_T::AES_STS: INBUFFULL Mask */ - -#define CRPT_AES_STS_INBUFERR_Pos (10) /*!< CRPT_T::AES_STS: INBUFERR Position */ -#define CRPT_AES_STS_INBUFERR_Msk (0x1ul << CRPT_AES_STS_INBUFERR_Pos) /*!< CRPT_T::AES_STS: INBUFERR Mask */ - -#define CRPT_AES_STS_CNTERR_Pos (12) /*!< CRPT_T::AES_STS: CNTERR Position */ -#define CRPT_AES_STS_CNTERR_Msk (0x1ul << CRPT_AES_STS_CNTERR_Pos) /*!< CRPT_T::AES_STS: CNTERR Mask */ - -#define CRPT_AES_STS_OUTBUFEMPTY_Pos (16) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Position */ -#define CRPT_AES_STS_OUTBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_OUTBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Mask */ - -#define CRPT_AES_STS_OUTBUFFULL_Pos (17) /*!< CRPT_T::AES_STS: OUTBUFFULL Position */ -#define CRPT_AES_STS_OUTBUFFULL_Msk (0x1ul << CRPT_AES_STS_OUTBUFFULL_Pos) /*!< CRPT_T::AES_STS: OUTBUFFULL Mask */ - -#define CRPT_AES_STS_OUTBUFERR_Pos (18) /*!< CRPT_T::AES_STS: OUTBUFERR Position */ -#define CRPT_AES_STS_OUTBUFERR_Msk (0x1ul << CRPT_AES_STS_OUTBUFERR_Pos) /*!< CRPT_T::AES_STS: OUTBUFERR Mask */ - -#define CRPT_AES_STS_BUSERR_Pos (20) /*!< CRPT_T::AES_STS: BUSERR Position */ -#define CRPT_AES_STS_BUSERR_Msk (0x1ul << CRPT_AES_STS_BUSERR_Pos) /*!< CRPT_T::AES_STS: BUSERR Mask */ - -#define CRPT_AES_DATIN_DATIN_Pos (0) /*!< CRPT_T::AES_DATIN: DATIN Position */ -#define CRPT_AES_DATIN_DATIN_Msk (0xfffffffful << CRPT_AES_DATIN_DATIN_Pos) /*!< CRPT_T::AES_DATIN: DATIN Mask */ - -#define CRPT_AES_DATOUT_DATOUT_Pos (0) /*!< CRPT_T::AES_DATOUT: DATOUT Position */ -#define CRPT_AES_DATOUT_DATOUT_Msk (0xfffffffful << CRPT_AES_DATOUT_DATOUT_Pos) /*!< CRPT_T::AES_DATOUT: DATOUT Mask */ - -#define CRPT_AES0_KEYx_KEY_Pos (0) /*!< CRPT_T::AES0_KEY[8]: KEY Position */ -#define CRPT_AES0_KEYx_KEY_Msk (0xfffffffful << CRPT_AES0_KEYx_KEY_Pos) /*!< CRPT_T::AES0_KEY[8]: KEY Mask */ - -#define CRPT_AES0_IVx_IV_Pos (0) /*!< CRPT_T::AES0_IV[4]: IV Position */ -#define CRPT_AES0_IVx_IV_Msk (0xfffffffful << CRPT_AES0_IVx_IV_Pos) /*!< CRPT_T::AES0_IV[4]: IV Mask */ - -#define CRPT_AES0_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES0_SADDR: SADDR Position */ -#define CRPT_AES0_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES0_SADDR_SADDR_Pos) /*!< CRPT_T::AES0_SADDR: SADDR Mask */ - -#define CRPT_AES0_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES0_DADDR: DADDR Position */ -#define CRPT_AES0_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES0_DADDR_DADDR_Pos) /*!< CRPT_T::AES0_DADDR: DADDR Mask */ - -#define CRPT_AES0_CNT_CNT_Pos (0) /*!< CRPT_T::AES0_CNT: CNT Position */ -#define CRPT_AES0_CNT_CNT_Msk (0xfffffffful << CRPT_AES0_CNT_CNT_Pos) /*!< CRPT_T::AES0_CNT: CNT Mask */ - -#define CRPT_HMAC_CTL_START_Pos (0) /*!< CRPT_T::HMAC_CTL: START Position */ -#define CRPT_HMAC_CTL_START_Msk (0x1ul << CRPT_HMAC_CTL_START_Pos) /*!< CRPT_T::HMAC_CTL: START Mask */ - -#define CRPT_HMAC_CTL_STOP_Pos (1) /*!< CRPT_T::HMAC_CTL: STOP Position */ -#define CRPT_HMAC_CTL_STOP_Msk (0x1ul << CRPT_HMAC_CTL_STOP_Pos) /*!< CRPT_T::HMAC_CTL: STOP Mask */ - -#define CRPT_HMAC_CTL_HMACEN_Pos (4) /*!< CRPT_T::HMAC_CTL: HMACEN Position */ -#define CRPT_HMAC_CTL_HMACEN_Msk (0x1ul << CRPT_HMAC_CTL_HMACEN_Pos) /*!< CRPT_T::HMAC_CTL: HMACEN Mask */ - -#define CRPT_HMAC_CTL_DMALAST_Pos (5) /*!< CRPT_T::HMAC_CTL: DMALAST Position */ -#define CRPT_HMAC_CTL_DMALAST_Msk (0x1ul << CRPT_HMAC_CTL_DMALAST_Pos) /*!< CRPT_T::HMAC_CTL: DMALAST Mask */ - -#define CRPT_HMAC_CTL_DMAEN_Pos (7) /*!< CRPT_T::HMAC_CTL: DMAEN Position */ -#define CRPT_HMAC_CTL_DMAEN_Msk (0x1ul << CRPT_HMAC_CTL_DMAEN_Pos) /*!< CRPT_T::HMAC_CTL: DMAEN Mask */ - -#define CRPT_HMAC_CTL_OPMODE_Pos (8) /*!< CRPT_T::HMAC_CTL: OPMODE Position */ -#define CRPT_HMAC_CTL_OPMODE_Msk (0x7ul << CRPT_HMAC_CTL_OPMODE_Pos) /*!< CRPT_T::HMAC_CTL: OPMODE Mask */ - -#define CRPT_HMAC_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::HMAC_CTL: OUTSWAP Position */ -#define CRPT_HMAC_CTL_OUTSWAP_Msk (0x1ul << CRPT_HMAC_CTL_OUTSWAP_Pos) /*!< CRPT_T::HMAC_CTL: OUTSWAP Mask */ - -#define CRPT_HMAC_CTL_INSWAP_Pos (23) /*!< CRPT_T::HMAC_CTL: INSWAP Position */ -#define CRPT_HMAC_CTL_INSWAP_Msk (0x1ul << CRPT_HMAC_CTL_INSWAP_Pos) /*!< CRPT_T::HMAC_CTL: INSWAP Mask */ - -#define CRPT_HMAC_STS_BUSY_Pos (0) /*!< CRPT_T::HMAC_STS: BUSY Position */ -#define CRPT_HMAC_STS_BUSY_Msk (0x1ul << CRPT_HMAC_STS_BUSY_Pos) /*!< CRPT_T::HMAC_STS: BUSY Mask */ - -#define CRPT_HMAC_STS_DMABUSY_Pos (1) /*!< CRPT_T::HMAC_STS: DMABUSY Position */ -#define CRPT_HMAC_STS_DMABUSY_Msk (0x1ul << CRPT_HMAC_STS_DMABUSY_Pos) /*!< CRPT_T::HMAC_STS: DMABUSY Mask */ - -#define CRPT_HMAC_STS_DMAERR_Pos (8) /*!< CRPT_T::HMAC_STS: DMAERR Position */ -#define CRPT_HMAC_STS_DMAERR_Msk (0x1ul << CRPT_HMAC_STS_DMAERR_Pos) /*!< CRPT_T::HMAC_STS: DMAERR Mask */ - -#define CRPT_HMAC_STS_DATINREQ_Pos (16) /*!< CRPT_T::HMAC_STS: DATINREQ Position */ -#define CRPT_HMAC_STS_DATINREQ_Msk (0x1ul << CRPT_HMAC_STS_DATINREQ_Pos) /*!< CRPT_T::HMAC_STS: DATINREQ Mask */ - -#define CRPT_HMAC_DGSTx_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST[16]: DGST Position */ -#define CRPT_HMAC_DGSTx_DGST_Msk (0xfffffffful << CRPT_HMAC_DGSTx_DGST_Pos) /*!< CRPT_T::HMAC_DGST[16]: DGST Mask */ - -#define CRPT_HMAC_KEYCNT_KEYCNT_Pos (0) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Position */ -#define CRPT_HMAC_KEYCNT_KEYCNT_Msk (0xfffffffful << CRPT_HMAC_KEYCNT_KEYCNT_Pos) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Mask */ - -#define CRPT_HMAC_SADDR_SADDR_Pos (0) /*!< CRPT_T::HMAC_SADDR: SADDR Position */ -#define CRPT_HMAC_SADDR_SADDR_Msk (0xfffffffful << CRPT_HMAC_SADDR_SADDR_Pos) /*!< CRPT_T::HMAC_SADDR: SADDR Mask */ - -#define CRPT_HMAC_DMACNT_DMACNT_Pos (0) /*!< CRPT_T::HMAC_DMACNT: DMACNT Position */ -#define CRPT_HMAC_DMACNT_DMACNT_Msk (0xfffffffful << CRPT_HMAC_DMACNT_DMACNT_Pos) /*!< CRPT_T::HMAC_DMACNT: DMACNT Mask */ - -#define CRPT_HMAC_DATIN_DATIN_Pos (0) /*!< CRPT_T::HMAC_DATIN: DATIN Position */ -#define CRPT_HMAC_DATIN_DATIN_Msk (0xfffffffful << CRPT_HMAC_DATIN_DATIN_Pos) /*!< CRPT_T::HMAC_DATIN: DATIN Mask */ - -#define CRPT_ECC_CTL_START_Pos (0) /*!< CRPT_T::ECC_CTL: START Position */ -#define CRPT_ECC_CTL_START_Msk (0x1ul << CRPT_ECC_CTL_START_Pos) /*!< CRPT_T::ECC_CTL: START Mask */ - -#define CRPT_ECC_CTL_STOP_Pos (1) /*!< CRPT_T::ECC_CTL: STOP Position */ -#define CRPT_ECC_CTL_STOP_Msk (0x1ul << CRPT_ECC_CTL_STOP_Pos) /*!< CRPT_T::ECC_CTL: STOP Mask */ - -#define CRPT_ECC_CTL_DMAEN_Pos (7) /*!< CRPT_T::ECC_CTL: DMAEN Position */ -#define CRPT_ECC_CTL_DMAEN_Msk (0x1ul << CRPT_ECC_CTL_DMAEN_Pos) /*!< CRPT_T::ECC_CTL: DMAEN Mask */ - -#define CRPT_ECC_CTL_FSEL_Pos (8) /*!< CRPT_T::ECC_CTL: FSEL Position */ -#define CRPT_ECC_CTL_FSEL_Msk (0x1ul << CRPT_ECC_CTL_FSEL_Pos) /*!< CRPT_T::ECC_CTL: FSEL Mask */ - -#define CRPT_ECC_CTL_ECCOP_Pos (9) /*!< CRPT_T::ECC_CTL: ECCOP Position */ -#define CRPT_ECC_CTL_ECCOP_Msk (0x3ul << CRPT_ECC_CTL_ECCOP_Pos) /*!< CRPT_T::ECC_CTL: ECCOP Mask */ - -#define CRPT_ECC_CTL_MODOP_Pos (11) /*!< CRPT_T::ECC_CTL: MODOP Position */ -#define CRPT_ECC_CTL_MODOP_Msk (0x3ul << CRPT_ECC_CTL_MODOP_Pos) /*!< CRPT_T::ECC_CTL: MODOP Mask */ - -#define CRPT_ECC_CTL_LDP1_Pos (16) /*!< CRPT_T::ECC_CTL: LDP1 Position */ -#define CRPT_ECC_CTL_LDP1_Msk (0x1ul << CRPT_ECC_CTL_LDP1_Pos) /*!< CRPT_T::ECC_CTL: LDP1 Mask */ - -#define CRPT_ECC_CTL_LDP2_Pos (17) /*!< CRPT_T::ECC_CTL: LDP2 Position */ -#define CRPT_ECC_CTL_LDP2_Msk (0x1ul << CRPT_ECC_CTL_LDP2_Pos) /*!< CRPT_T::ECC_CTL: LDP2 Mask */ - -#define CRPT_ECC_CTL_LDA_Pos (18) /*!< CRPT_T::ECC_CTL: LDA Position */ -#define CRPT_ECC_CTL_LDA_Msk (0x1ul << CRPT_ECC_CTL_LDA_Pos) /*!< CRPT_T::ECC_CTL: LDA Mask */ - -#define CRPT_ECC_CTL_LDB_Pos (19) /*!< CRPT_T::ECC_CTL: LDB Position */ -#define CRPT_ECC_CTL_LDB_Msk (0x1ul << CRPT_ECC_CTL_LDB_Pos) /*!< CRPT_T::ECC_CTL: LDB Mask */ - -#define CRPT_ECC_CTL_LDN_Pos (20) /*!< CRPT_T::ECC_CTL: LDN Position */ -#define CRPT_ECC_CTL_LDN_Msk (0x1ul << CRPT_ECC_CTL_LDN_Pos) /*!< CRPT_T::ECC_CTL: LDN Mask */ - -#define CRPT_ECC_CTL_LDK_Pos (21) /*!< CRPT_T::ECC_CTL: LDK Position */ -#define CRPT_ECC_CTL_LDK_Msk (0x1ul << CRPT_ECC_CTL_LDK_Pos) /*!< CRPT_T::ECC_CTL: LDK Mask */ - -#define CRPT_ECC_CTL_CURVEM_Pos (22) /*!< CRPT_T::ECC_CTL: CURVEM Position */ -#define CRPT_ECC_CTL_CURVEM_Msk (0x3fful << CRPT_ECC_CTL_CURVEM_Pos) /*!< CRPT_T::ECC_CTL: CURVEM Mask */ - -#define CRPT_ECC_STS_BUSY_Pos (0) /*!< CRPT_T::ECC_STS: BUSY Position */ -#define CRPT_ECC_STS_BUSY_Msk (0x1ul << CRPT_ECC_STS_BUSY_Pos) /*!< CRPT_T::ECC_STS: BUSY Mask */ - -#define CRPT_ECC_STS_DMABUSY_Pos (1) /*!< CRPT_T::ECC_STS: DMABUSY Position */ -#define CRPT_ECC_STS_DMABUSY_Msk (0x1ul << CRPT_ECC_STS_DMABUSY_Pos) /*!< CRPT_T::ECC_STS: DMABUSY Mask */ - -#define CRPT_ECC_STS_BUSERR_Pos (16) /*!< CRPT_T::ECC_STS: BUSERR Position */ -#define CRPT_ECC_STS_BUSERR_Msk (0x1ul << CRPT_ECC_STS_BUSERR_Pos) /*!< CRPT_T::ECC_STS: BUSERR Mask */ - -#define CRPT_ECC_X1_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1[18]: POINTX1 Position */ -#define CRPT_ECC_X1_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_POINTX1_Pos) /*!< CRPT_T::ECC_X1[18]: POINTX1 Mask */ - -#define CRPT_ECC_Y1_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1[18]: POINTY1 Position */ -#define CRPT_ECC_Y1_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_POINTY1_Pos) /*!< CRPT_T::ECC_Y1[18]: POINTY1 Mask */ - -#define CRPT_ECC_X2_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2[18]: POINTX2 Position */ -#define CRPT_ECC_X2_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_POINTX2_Pos) /*!< CRPT_T::ECC_X2[18]: POINTX2 Mask */ - -#define CRPT_ECC_Y2_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2[18]: POINTY2 Position */ -#define CRPT_ECC_Y2_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_POINTY2_Pos) /*!< CRPT_T::ECC_Y2[18]: POINTY2 Mask */ - -#define CRPT_ECC_A_CURVEA_Pos (0) /*!< CRPT_T::ECC_A[18]: CURVEA Position */ -#define CRPT_ECC_A_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_CURVEA_Pos) /*!< CRPT_T::ECC_A[18]: CURVEA Mask */ - -#define CRPT_ECC_B_CURVEB_Pos (0) /*!< CRPT_T::ECC_B[18]: CURVEB Position */ -#define CRPT_ECC_B_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_CURVEB_Pos) /*!< CRPT_T::ECC_B[18]: CURVEB Mask */ - -#define CRPT_ECC_N_CURVEN_Pos (0) /*!< CRPT_T::ECC_N[18]: CURVEN Position */ -#define CRPT_ECC_N_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_CURVEN_Pos) /*!< CRPT_T::ECC_N[18]: CURVEN Mask */ - -#define CRPT_ECC_K_SCALARK_Pos (0) /*!< CRPT_T::ECC_K[18]: SCALARK Position */ -#define CRPT_ECC_K_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_SCALARK_Pos) /*!< CRPT_T::ECC_K[18]: SCALARK Mask */ - -#define CRPT_ECC_DADDR_DADDR_Pos (0) /*!< CRPT_T::ECC_DADDR: DADDR Position */ -#define CRPT_ECC_DADDR_DADDR_Msk (0xfffffffful << CRPT_ECC_DADDR_DADDR_Pos) /*!< CRPT_T::ECC_DADDR: DADDR Mask */ - -#define CRPT_ECC_STARTREG_STARTREG_Pos (0) /*!< CRPT_T::ECC_STARTREG: STARTREG Position*/ -#define CRPT_ECC_STARTREG_STARTREG_Msk (0xfffffffful << CRPT_ECC_STARTREG_STARTREG_Pos) /*!< CRPT_T::ECC_STARTREG: STARTREG Mask */ - -#define CRPT_ECC_WORDCNT_WORDCNT_Pos (0) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Position */ -#define CRPT_ECC_WORDCNT_WORDCNT_Msk (0xfffffffful << CRPT_ECC_WORDCNT_WORDCNT_Pos) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Mask */ - -#define CRPT_RSA_CTL_START_Pos (0) /*!< CRPT RSA_CTL: START Position */ -#define CRPT_RSA_CTL_START_Msk (0x1ul << CRPT_RSA_CTL_START_Pos) /*!< CRPT RSA_CTL: START Mask */ - -#define CRPT_RSA_CTL_STOP_Pos (1) /*!< CRPT RSA_CTL: STOP Position */ -#define CRPT_RSA_CTL_STOP_Msk (0x1ul << CRPT_RSA_CTL_STOP_Pos) /*!< CRPT RSA_CTL: STOP Mask */ - -#define CRPT_RSA_CTL_DMAEN_Pos (7) /*!< CRPT RSA_CTL: DMAEN Position */ -#define CRPT_RSA_CTL_DMAEN_Msk (0x1ul << CRPT_RSA_CTL_DMAEN_Pos) /*!< CRPT RSA_CTL: DMAEN Mask */ - -#define CRPT_RSA_CTL_LDM_Pos (8) /*!< CRPT RSA_CTL: LDM Position */ -#define CRPT_RSA_CTL_LDM_Msk (0x1ul << CRPT_RSA_CTL_LDM_Pos) /*!< CRPT RSA_CTL: LDM Mask */ - -#define CRPT_RSA_CTL_LDE_Pos (9) /*!< CRPT RSA_CTL: LDE Position */ -#define CRPT_RSA_CTL_LDE_Msk (0x1ul << CRPT_RSA_CTL_LDE_Pos) /*!< CRPT RSA_CTL: LDE Mask */ - -#define CRPT_RSA_CTL_LDN_Pos (10) /*!< CRPT RSA_CTL: LDN Position */ -#define CRPT_RSA_CTL_LDN_Msk (0x1ul << CRPT_RSA_CTL_LDN_Pos) /*!< CRPT RSA_CTL: LDN Mask */ - -#define CRPT_RSA_CTL_LDC_Pos (11) /*!< CRPT RSA_CTL: LDC Position */ -#define CRPT_RSA_CTL_LDC_Msk (0x1ul << CRPT_RSA_CTL_LDC_Pos) /*!< CRPT RSA_CTL: LDC Mask */ - -#define CRPT_RSA_CTL_KEYLEN_Pos (16) /*!< CRPT RSA_CTL: KEYLEN Position */ -#define CRPT_RSA_CTL_KEYLEN_Msk (0x1FFFul << CRPT_RSA_CTL_KEYLEN_Pos) /*!< CRPT RSA_CTL: KEYLEN Mask */ - -#define CRPT_RSA_STS_BUSY_Pos (0) /*!< CRPT RSA_STS: BUSY Position */ -#define CRPT_RSA_STS_BUSY_Msk (0x1ul << CRPT_RSA_STS_BUSY_Pos) /*!< CRPT RSA_STS: BUSY Mask */ - -#define CRPT_RSA_STS_DMABUSY_Pos (1) /*!< CRPT RSA_STS: DMABUSY Position */ -#define CRPT_RSA_STS_DMABUSY_Msk (0x1ul << CRPT_RSA_STS_DMABUSY_Pos) /*!< CRPT RSA_STS: DMABUSY Mask */ - -#define CRPT_RSA_STS_BUSERR_Pos (16) /*!< CRPT ECC_RSA: BUSERR Position */ -#define CRPT_RSA_STS_BUSERR_Msk (0x1ul << CRPT_RSA_STS_BUSERR_Pos) /*!< CRPT ECC_RSA: BUSERR Mask */ - - -/**@}*/ /* CRPT_CONST CRYPTO */ - -/**@}*/ /* end of CRYPTO register group */ - - -/** @addtogroup CRYPTO_EXPORTED_CONSTANTS CRYPTO Exported Constants - @{ -*/ - -#define PRNG_KEY_SIZE_64 0UL /*!< Select to generate 64-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_128 1UL /*!< Select to generate 128-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_192 2UL /*!< Select to generate 192-bit random key \hideinitializer */ -#define PRNG_KEY_SIZE_256 3UL /*!< Select to generate 256-bit random key \hideinitializer */ - -#define PRNG_SEED_CONT 0UL /*!< PRNG using current seed \hideinitializer */ -#define PRNG_SEED_RELOAD 1UL /*!< PRNG reload new seed \hideinitializer */ - -#define AES_KEY_SIZE_128 0UL /*!< AES select 128-bit key length \hideinitializer */ -#define AES_KEY_SIZE_192 1UL /*!< AES select 192-bit key length \hideinitializer */ -#define AES_KEY_SIZE_256 2UL /*!< AES select 256-bit key length \hideinitializer */ - -#define AES_MODE_ECB 0UL /*!< AES select ECB mode \hideinitializer */ -#define AES_MODE_CBC 1UL /*!< AES select CBC mode \hideinitializer */ -#define AES_MODE_CFB 2UL /*!< AES select CFB mode \hideinitializer */ -#define AES_MODE_OFB 3UL /*!< AES select OFB mode \hideinitializer */ -#define AES_MODE_CTR 4UL /*!< AES select CTR mode \hideinitializer */ -#define AES_MODE_CBC_CS1 0x10UL /*!< AES select CBC CS1 mode \hideinitializer */ -#define AES_MODE_CBC_CS2 0x11UL /*!< AES select CBC CS2 mode \hideinitializer */ -#define AES_MODE_CBC_CS3 0x12UL /*!< AES select CBC CS3 mode \hideinitializer */ - -#define AES_NO_SWAP 0UL /*!< AES do not swap input and output data \hideinitializer */ -#define AES_OUT_SWAP 1UL /*!< AES swap output data \hideinitializer */ -#define AES_IN_SWAP 2UL /*!< AES swap input data \hideinitializer */ -#define AES_IN_OUT_SWAP 3UL /*!< AES swap both input and output data \hideinitializer */ - -#define SHA_MODE_SHA1 0UL /*!< SHA select SHA-1 160-bit \hideinitializer */ -#define SHA_MODE_SHA224 5UL /*!< SHA select SHA-224 224-bit \hideinitializer */ -#define SHA_MODE_SHA256 4UL /*!< SHA select SHA-256 256-bit \hideinitializer */ -#define SHA_MODE_SHA384 7UL /*!< SHA select SHA-384 384-bit \hideinitializer */ -#define SHA_MODE_SHA512 6UL /*!< SHA select SHA-512 512-bit \hideinitializer */ - -#define SHA_NO_SWAP 0UL /*!< SHA do not swap input and output data \hideinitializer */ -#define SHA_OUT_SWAP 1UL /*!< SHA swap output data \hideinitializer */ -#define SHA_IN_SWAP 2UL /*!< SHA swap input data \hideinitializer */ -#define SHA_IN_OUT_SWAP 3UL /*!< SHA swap both input and output data \hideinitializer */ - -#define CRYPTO_DMA_FIRST 0x4UL /*!< Do first encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_ONE_SHOT 0x5UL /*!< Do one shot encrypt/decrypt with DMA \hideinitializer */ -#define CRYPTO_DMA_CONTINUE 0x6UL /*!< Do continuous encrypt/decrypt in DMA cascade \hideinitializer */ -#define CRYPTO_DMA_LAST 0x7UL /*!< Do last encrypt/decrypt in DMA cascade \hideinitializer */ - -typedef enum -{ - /*!< ECC curve \hideinitializer */ - CURVE_P_192, /*!< ECC curve P-192 \hideinitializer */ - CURVE_P_224, /*!< ECC curve P-224 \hideinitializer */ - CURVE_P_256, /*!< ECC curve P-256 \hideinitializer */ - CURVE_P_384, /*!< ECC curve P-384 \hideinitializer */ - CURVE_P_521, /*!< ECC curve P-521 \hideinitializer */ - CURVE_K_163, /*!< ECC curve K-163 \hideinitializer */ - CURVE_K_233, /*!< ECC curve K-233 \hideinitializer */ - CURVE_K_283, /*!< ECC curve K-283 \hideinitializer */ - CURVE_K_409, /*!< ECC curve K-409 \hideinitializer */ - CURVE_K_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_B_163, /*!< ECC curve B-163 \hideinitializer */ - CURVE_B_233, /*!< ECC curve B-233 \hideinitializer */ - CURVE_B_283, /*!< ECC curve B-283 \hideinitializer */ - CURVE_B_409, /*!< ECC curve B-409 \hideinitializer */ - CURVE_B_571, /*!< ECC curve K-571 \hideinitializer */ - CURVE_KO_192, /*!< ECC 192-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_224, /*!< ECC 224-bits "Koblitz" curve \hideinitializer */ - CURVE_KO_256, /*!< ECC 256-bits "Koblitz" curve \hideinitializer */ - CURVE_BP_256, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_384, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_BP_512, /*!< ECC Brainpool 256-bits curve \hideinitializer */ - CURVE_UNDEF, /*!< Invalid curve \hideinitializer */ -} -E_ECC_CURVE; /*!< ECC curve \hideinitializer */ - - -#define RSA_MAX_KLEN (2048) -#define RSA_KBUF_HLEN (RSA_MAX_KLEN/4 + 8) -#define RSA_KBUF_BLEN (RSA_MAX_KLEN + 32) - - -/*@}*/ /* end of group CRYPTO_EXPORTED_CONSTANTS */ - - -/** @addtogroup CRYPTO_EXPORTED_MACROS CRYPTO Exported Macros - @{ -*/ - -/*----------------------------------------------------------------------------------------------*/ -/* Macros */ -/*----------------------------------------------------------------------------------------------*/ - -/** - * @brief This macro enables PRNG interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define PRNG_ENABLE_INT(crpt) ((crpt)->INTEN |= CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro disables PRNG interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define PRNG_DISABLE_INT(crpt) ((crpt)->INTEN &= ~CRPT_INTEN_PRNGIEN_Msk) - -/** - * @brief This macro gets PRNG interrupt flag. - * @param crpt Specified cripto module - * @return PRNG interrupt flag. - * \hideinitializer - */ -#define PRNG_GET_INT_FLAG(crpt) ((crpt)->INTSTS & CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro clears PRNG interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define PRNG_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = CRPT_INTSTS_PRNGIF_Msk) - -/** - * @brief This macro enables AES interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro disables AES interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk)) - -/** - * @brief This macro gets AES interrupt flag. - * @param crpt Specified cripto module - * @return AES interrupt flag. - * \hideinitializer - */ -#define AES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro clears AES interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk)) - -/** - * @brief This macro enables AES key protection. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_ENABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL |= CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro disables AES key protection. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define AES_DISABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL = ((crpt)->AES_CTL & ~CRPT_AES_CTL_KEYPRT_Msk) | (0x16UL<AES_CTL &= ~CRPT_AES_CTL_KEYPRT_Msk) - -/** - * @brief This macro enables SHA interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define SHA_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro disables SHA interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define SHA_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk)) - -/** - * @brief This macro gets SHA interrupt flag. - * @param crpt Specified cripto module - * @return SHA interrupt flag. - * \hideinitializer - */ -#define SHA_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro clears SHA interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define SHA_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk)) - -/** - * @brief This macro enables ECC interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define ECC_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro disables ECC interrupt. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define ECC_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk)) - -/** - * @brief This macro gets ECC interrupt flag. - * @param crpt Specified cripto module - * @return ECC interrupt flag. - * \hideinitializer - */ -#define ECC_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - -/** - * @brief This macro clears ECC interrupt flag. - * @param crpt Specified cripto module - * @return None - * \hideinitializer - */ -#define ECC_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk)) - - -/*@}*/ /* end of group CRYPTO_EXPORTED_MACROS */ - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* Functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed); -void PRNG_Start(CRPT_T *crpt); -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]); -void AES_Open(CRPT_T *crpt, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType); -void AES_Start(CRPT_T *crpt, uint32_t u32DMAMode); -void AES_SetKey(CRPT_T *crpt, uint32_t au32Keys[], uint32_t u32KeySize); -void AES_SetInitVect(CRPT_T *crpt, uint32_t au32IV[]); -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt); -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len); -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode); -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt); -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]); -void ECC_Complete(CRPT_T *crpt); -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]); -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]); -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]); -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]); -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *d, char *k, char *R, char *S); -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *public_k1, char *public_k2, char *R, char *S); -void RSA_Calculate_C(int rsa_len, char *n, char *C); -int32_t RSA_GenerateSignature(CRPT_T *crpt, int rsa_len, char *n, char *d, char *C, char *msg, char *sig); -int32_t RSA_VerifySignature(CRPT_T *crpt, int rsa_len, char *n, char *e, char *C, char *sig, char *msg); - - -/*@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group Crypto_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_CRYPTO_H__ */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_ebi.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_ebi.h deleted file mode 100644 index fa5c5e5f8ec..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_ebi.h +++ /dev/null @@ -1,418 +0,0 @@ -/**************************************************************************//** - * @file ebi.h - * @brief EBI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_EBI_H__ -#define __NU_EBI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "nuc980.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - -/** @addtogroup EBI_EXPORTED_CONSTANTS EBI Exported Constants - @{ -*/ - -#define EBI ((EBI_T *) EBI_BA) - -/*---------------------- External Bus Interface Controller -------------------------*/ -/** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller -@{ */ - - -typedef struct -{ - - __IO uint32_t CTL0; /* Offset: 0x00 External Bus Interface Bank0 Control Register */ - __IO uint32_t TCTL0; /* Offset: 0x04 External Bus Interface Bank0 Timing Control Register */ - __I uint32_t RESERVE0[2]; - __IO uint32_t CTL1; /* Offset: 0x10 External Bus Interface Bank1 Control Register */ - __IO uint32_t TCTL1; /* Offset: 0x14 External Bus Interface Bank1 Timing Control Register */ - __I uint32_t RESERVE1[2]; - __IO uint32_t CTL2; /* Offset: 0x20 External Bus Interface Bank1 Control Register */ - __IO uint32_t TCTL2; /* Offset: 0x24 External Bus Interface Bank1 Timing Control Register */ - -} EBI_T; - - - -/** - @addtogroup EBI_CONST EBI Bit Field Definition - Constant Definitions for EBI Controller -@{ */ - -#define EBI_CTL_EN_Pos (0) /*!< EBI_T::CTL: EN Position \hideinitializer */ -#define EBI_CTL_EN_Msk (0x1ul << EBI_CTL_EN_Pos) /*!< EBI_T::CTL: EN Mask \hideinitializer */ - -#define EBI_CTL_DW16_Pos (1) /*!< EBI_T::CTL: DW16 Position \hideinitializer */ -#define EBI_CTL_DW16_Msk (0x1ul << EBI_CTL_DW16_Pos) /*!< EBI_T::CTL: DW16 Mask \hideinitializer */ - -#define EBI_CTL_CSPOLINV_Pos (2) /*!< EBI_T::CTL: CSPOLINV Position \hideinitializer */ -#define EBI_CTL_CSPOLINV_Msk (0x1ul << EBI_CTL_CSPOLINV_Pos) /*!< EBI_T::CTL: CSPOLINV Mask \hideinitializer */ - -#define EBI_CTL_CACCESS_Pos (4) /*!< EBI EBICON: CS_PINV Position \hideinitializer */ -#define EBI_CTL_CACCESS_Msk (1ul << EBI_CTL_CACCESS_Pos) /*!< EBI EBICON: CS_PINV Mask \hideinitializer */ - -#define EBI_CTL_MCLKDIV_Pos (8) /*!< EBI_T::CTL: MCLKDIV Position \hideinitializer */ -#define EBI_CTL_MCLKDIV_Msk (0x7ul << EBI_CTL_MCLKDIV_Pos) /*!< EBI_T::CTL: MCLKDIV Mask \hideinitializer */ - -#define EBI_CTL_WBUFEN_Pos (24) /*!< EBI_T::CTL: WBUFEN Position \hideinitializer */ -#define EBI_CTL_WBUFEN_Msk (0x1ul << EBI_CTL_WBUFEN_Pos) /*!< EBI_T::CTL: WBUFEN Mask \hideinitializer */ - -#define EBI_TCTL_TACC_Pos (3) /*!< EBI_T::TCTL: TACC Position \hideinitializer */ -#define EBI_TCTL_TACC_Msk (0x1ful << EBI_TCTL_TACC_Pos) /*!< EBI_T::TCTL: TACC Mask \hideinitializer */ - -#define EBI_TCTL_TAHD_Pos (8) /*!< EBI_T::TCTL: TAHD Position \hideinitializer */ -#define EBI_TCTL_TAHD_Msk (0x7ul << EBI_TCTL_TAHD_Pos) /*!< EBI_T::TCTL: TAHD Mask \hideinitializer */ - -#define EBI_TCTL_W2X_Pos (12) /*!< EBI_T::TCTL: W2X Position \hideinitializer */ -#define EBI_TCTL_W2X_Msk (0xful << EBI_TCTL_W2X_Pos) /*!< EBI_T::TCTL: W2X Mask \hideinitializer */ - -#define EBI_TCTL_RAHDOFF_Pos (22) /*!< EBI_T::TCTL: RAHDOFF Position \hideinitializer */ -#define EBI_TCTL_RAHDOFF_Msk (0x1ul << EBI_TCTL_RAHDOFF_Pos) /*!< EBI_T::TCTL: RAHDOFF Mask \hideinitializer */ - -#define EBI_TCTL_WAHDOFF_Pos (23) /*!< EBI_T::TCTL: WAHDOFF Position \hideinitializer */ -#define EBI_TCTL_WAHDOFF_Msk (0x1ul << EBI_TCTL_WAHDOFF_Pos) /*!< EBI_T::TCTL: WAHDOFF Mask \hideinitializer */ - -#define EBI_TCTL_R2R_Pos (24) /*!< EBI_T::TCTL: R2R Position \hideinitializer */ -#define EBI_TCTL_R2R_Msk (0xful << EBI_TCTL_R2R_Pos) /*!< EBI_T::TCTL: R2R Mask \hideinitializer */ - -/**@}*/ /* EBI_CONST */ -/**@}*/ /* end of EBI register group */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0_BASE_ADDR 0x60000000UL /*!< EBI bank0 base address \hideinitializer */ -#define EBI_BANK1_BASE_ADDR 0x60100000UL /*!< EBI bank1 base address \hideinitializer */ -#define EBI_BANK2_BASE_ADDR 0x60200000UL /*!< EBI bank2 base address \hideinitializer */ -#define EBI_MAX_SIZE 0x00100000UL /*!< Maximum EBI size for each bank is 1 MB \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI bank number */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BANK0 0UL /*!< EBI bank 0 \hideinitializer */ -#define EBI_BANK1 1UL /*!< EBI bank 1 \hideinitializer */ -#define EBI_BANK2 2UL /*!< EBI bank 2 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI data bus width */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_BUSWIDTH_8BIT 8UL /*!< EBI bus width is 8-bit \hideinitializer */ -#define EBI_BUSWIDTH_16BIT 16UL /*!< EBI bus width is 16-bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI CS Active Level */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_CS_ACTIVE_LOW 0UL /*!< EBI CS active level is low \hideinitializer */ -#define EBI_CS_ACTIVE_HIGH 1UL /*!< EBI CS active level is high \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Constants for EBI MCLK divider and Timing */ -/*---------------------------------------------------------------------------------------------------------*/ -#define EBI_MCLKDIV_1 0x0UL /*!< EBI output clock(MCLK) is HCLK/1 \hideinitializer */ -#define EBI_MCLKDIV_2 0x1UL /*!< EBI output clock(MCLK) is HCLK/2 \hideinitializer */ -#define EBI_MCLKDIV_4 0x2UL /*!< EBI output clock(MCLK) is HCLK/4 \hideinitializer */ -#define EBI_MCLKDIV_8 0x3UL /*!< EBI output clock(MCLK) is HCLK/8 \hideinitializer */ -#define EBI_MCLKDIV_16 0x4UL /*!< EBI output clock(MCLK) is HCLK/16 \hideinitializer */ -#define EBI_MCLKDIV_32 0x5UL /*!< EBI output clock(MCLK) is HCLK/32 \hideinitializer */ -#define EBI_MCLKDIV_64 0x6UL /*!< EBI output clock(MCLK) is HCLK/64 \hideinitializer */ -#define EBI_MCLKDIV_128 0x7UL /*!< EBI output clock(MCLK) is HCLK/128 \hideinitializer */ - -#define EBI_TIMING_FASTEST 0x0UL /*!< EBI timing is the fastest \hideinitializer */ -#define EBI_TIMING_VERYFAST 0x1UL /*!< EBI timing is very fast \hideinitializer */ -#define EBI_TIMING_FAST 0x2UL /*!< EBI timing is fast \hideinitializer */ -#define EBI_TIMING_NORMAL 0x3UL /*!< EBI timing is normal \hideinitializer */ -#define EBI_TIMING_SLOW 0x4UL /*!< EBI timing is slow \hideinitializer */ -#define EBI_TIMING_VERYSLOW 0x5UL /*!< EBI timing is very slow \hideinitializer */ -#define EBI_TIMING_SLOWEST 0x6UL /*!< EBI timing is the slowest \hideinitializer */ - -#define EBI_OPMODE_NORMAL 0x0UL /*!< EBI bus operate in normal mode \hideinitializer */ -#define EBI_OPMODE_CACCESS (0x1UL << 4) /*!< EBI bus operate in Continuous Data Access mode \hideinitializer */ - - -/*@}*/ /* end of group EBI_EXPORTED_CONSTANTS */ - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Read 8-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank0 - * - * @param[in] u32Addr The data address on EBI bank0. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank0. - * \hideinitializer - */ -#define EBI0_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK0_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank1 - * - * @param[in] u32Addr The data address on EBI bank1. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank1. - * \hideinitializer - */ -#define EBI1_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK1_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 8-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 8-bit Data - * - * @details This macro is used to read 8-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA8(u32Addr) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 8-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 8-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA8(u32Addr, u32Data) (*((volatile unsigned char *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 16-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 16-bit Data - * - * @details This macro is used to read 16-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA16(u32Addr) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 16-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 16-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA16(u32Addr, u32Data) (*((volatile unsigned short *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Read 32-bit data on EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * - * @return 32-bit Data - * - * @details This macro is used to read 32-bit data from specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_READ_DATA32(u32Addr) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr)))) - -/** - * @brief Write 32-bit data to EBI bank2 - * - * @param[in] u32Addr The data address on EBI bank2. - * @param[in] u32Data Specify data to be written. - * - * @return None - * - * @details This macro is used to write 32-bit data to specify address on EBI bank2. - * \hideinitializer - */ -#define EBI2_WRITE_DATA32(u32Addr, u32Data) (*((volatile unsigned int *)(EBI_BANK2_BASE_ADDR+(u32Addr))) = (u32Data)) - -/** - * @brief Enable EBI Write Buffer - * - * @return None - * - * @details This macro is used to improve EBI write operation for EBI all banks. - * \hideinitializer - */ -#define EBI_ENABLE_WRITE_BUFFER() outpw(REG_EBI_CTL0, inpw(REG_EBI_CTL0) | (0x1UL << 24)) - - -/** - * @brief Disable EBI Write Buffer - * - * @return None - * - * @details This macro is used to disable EBI write buffer function. - * \hideinitializer - */ -#define EBI_DISABLE_WRITE_BUFFER() outpw(REG_EBI_CTL0, (inpw(REG_EBI_CTL0) & ~(0x1UL << 24)) | (0x1UL << 24)) - -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel); -void EBI_Close(uint32_t u32Bank); -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv); - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_EBI_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_emac.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_emac.h deleted file mode 100644 index 5db55a6e714..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_emac.h +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************//** - * @file nu_emac.h - * @version V1.00 - * @brief EMAC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_EMAC_H__ -#define __NU_EMAC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include "emac_reg.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EMAC_Driver EMAC Driver - @{ -*/ - -/** @addtogroup EMAC_EXPORTED_CONSTANTS EMAC Exported Constants - @{ -*/ - -#define EMAC_PHY_ADDR 1UL /*!< PHY address, this address is board dependent \hideinitializer */ -#define EMAC_RX_DESC_SIZE 128UL /*!< Number of Rx Descriptors, should be 2 at least \hideinitializer */ -#define EMAC_TX_DESC_SIZE 64UL /*!< Number of Tx Descriptors, should be 2 at least \hideinitializer */ -#define EMAC_CAMENTRY_NB 16UL /*!< Number of CAM \hideinitializer */ -#define EMAC_MAX_PKT_SIZE 1536UL /*!< Number of HDR + EXTRA + VLAN_TAG + PAYLOAD + CRC \hideinitializer */ - -#define EMAC_LINK_DOWN 0UL /*!< Ethernet link is down \hideinitializer */ -#define EMAC_LINK_100F 1UL /*!< Ethernet link is 100Mbps full duplex \hideinitializer */ -#define EMAC_LINK_100H 2UL /*!< Ethernet link is 100Mbps half duplex \hideinitializer */ -#define EMAC_LINK_10F 3UL /*!< Ethernet link is 10Mbps full duplex \hideinitializer */ -#define EMAC_LINK_10H 4UL /*!< Ethernet link is 10Mbps half duplex \hideinitializer */ - -/*@}*/ /* end of group EMAC_EXPORTED_CONSTANTS */ - - -/** Tx/Rx buffer descriptor structure */ -typedef struct -{ - uint32_t u32Status1; /*!< Status word 1 */ - uint32_t u32Data; /*!< Pointer to data buffer */ - uint32_t u32Status2; /*!< Status word 2 */ - uint32_t u32Next; /*!< Pointer to next descriptor */ - uint32_t u32Backup1; /*!< For backup descriptor fields over written by time stamp */ - uint32_t u32Backup2; /*!< For backup descriptor fields over written by time stamp */ - uint32_t u32Reserved1; /*!< For Reserved */ - uint32_t u32Reserved2; /*!< For Reserved */ -} EMAC_DESCRIPTOR_T; - -/** Tx/Rx buffer structure */ -typedef struct -{ - uint8_t au8Buf[EMAC_MAX_PKT_SIZE]; -} EMAC_FRAME_T; - -typedef struct -{ - EMAC_T *psEmac; - - uint32_t u32TxDescSize; - uint32_t u32RxDescSize; - - EMAC_DESCRIPTOR_T *psRXDescs; - EMAC_FRAME_T *psRXFrames; - EMAC_DESCRIPTOR_T *psTXDescs; - EMAC_FRAME_T *psTXFrames; - - EMAC_DESCRIPTOR_T *psCurrentTxDesc; - EMAC_DESCRIPTOR_T *psNextTxDesc; - EMAC_DESCRIPTOR_T *psCurrentRxDesc; - -} EMAC_MEMMGR_T; - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Enable EMAC Tx function - * @param None - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_TX(EMAC) (EMAC->CTL |= EMAC_CTL_TXON_Msk) - - -/** - * @brief Enable EMAC Rx function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RX(EMAC) do{EMAC->CTL |= EMAC_CTL_RXON_Msk; EMAC->RXST = 0;}while(0) - -/** - * @brief Disable EMAC Tx function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_TX(EMAC) (EMAC->CTL &= ~EMAC_CTL_TXON_Msk) - - -/** - * @brief Disable EMAC Rx function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RX(EMAC) (EMAC->CTL &= ~EMAC_CTL_RXON_Msk) - -/** - * @brief Enable EMAC Magic Packet Wakeup function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_MAGIC_PKT_WAKEUP(EMAC) (EMAC->CTL |= EMAC_CTL_WOLEN_Msk) - -/** - * @brief Disable EMAC Magic Packet Wakeup function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_MAGIC_PKT_WAKEUP(EMAC) (EMAC->CTL &= ~EMAC_CTL_WOLEN_Msk) - -/** - * @brief Enable EMAC to receive broadcast packets - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RECV_BCASTPKT(EMAC) (EMAC->CAMCTL |= EMAC_CAMCTL_ABP_Msk) - -/** - * @brief Disable EMAC to receive broadcast packets - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RECV_BCASTPKT(EMAC) (EMAC->CAMCTL &= ~EMAC_CAMCTL_ABP_Msk) - -/** - * @brief Enable EMAC to receive multicast packets - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_ENABLE_RECV_MCASTPKT(EMAC) (EMAC->CAMCTL |= EMAC_CAMCTL_AMP_Msk) - -/** - * @brief Disable EMAC Magic Packet Wakeup function - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_DISABLE_RECV_MCASTPKT(EMAC) (EMAC->CAMCTL &= ~EMAC_CAMCTL_AMP_Msk) - -/** - * @brief Check if EMAC time stamp alarm interrupt occurred or not - * @param The pointer of the specified EMAC module - * @return If time stamp alarm interrupt occurred or not - * @retval 0 Alarm interrupt does not occur - * @retval 1 Alarm interrupt occurred - * \hideinitializer - */ -#define EMAC_GET_ALARM_FLAG(EMAC) (EMAC->INTSTS & EMAC_INTSTS_TSALMIF_Msk ? 1 : 0) - -/** - * @brief Clear EMAC time stamp alarm interrupt flag - * @param The pointer of the specified EMAC module - * @return None - * \hideinitializer - */ -#define EMAC_CLR_ALARM_FLAG(EMAC) (EMAC->INTSTS = EMAC_INTSTS_TSALMIF_Msk) - -/** - * @brief Trigger EMAC Rx function - * @param The pointer of the specified EMAC module - * @return None - */ -#define EMAC_TRIGGER_RX(EMAC) do{EMAC->RXST = 0UL;}while(0) - -/** - * @brief Trigger EMAC Tx function - * @param The pointer of the specified EMAC module - * @return None - */ -#define EMAC_TRIGGER_TX(EMAC) do{EMAC->TXST = 0UL;}while(0) - -/** - * @brief Enable specified EMAC interrupt - * - * @param[in] EMAC The pointer of the specified EMAC module - * @param[in] u32eIntSel Interrupt type select - * - \ref EMAC_INTEN_RXIEN_Msk : Receive - * - \ref EMAC_INTEN_CRCEIEN_Msk : CRC Error - * - \ref EMAC_INTEN_RXOVIEN_Msk : Receive FIFO Overflow - * - \ref EMAC_INTEN_LPIEN_Msk : Long Packet - * - \ref EMAC_INTEN_RXGDIEN_Msk : Receive Good - * - \ref EMAC_INTEN_ALIEIEN_Msk : Alignment Error - * - \ref EMAC_INTEN_RPIEN_Msk : Runt Packet - * - \ref EMAC_INTEN_MPCOVIEN_Msk : Miss Packet Counter Overrun - * - \ref EMAC_INTEN_MFLEIEN_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTEN_DENIEN_Msk : DMA Early Notification - * - \ref EMAC_INTEN_RDUIEN_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTEN_RXBEIEN_Msk : Receive Bus Error - * - \ref EMAC_INTEN_CFRIEN_Msk : Control Frame Receive - * - \ref EMAC_INTEN_WOLIEN_Msk : Wake on LAN Interrupt - * - \ref EMAC_INTEN_TXIEN_Msk : Transmit - * - \ref EMAC_INTEN_TXUDIEN_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTEN_TXCPIEN_Msk : Transmit Completion - * - \ref EMAC_INTEN_EXDEFIEN_Msk : Defer Exceed - * - \ref EMAC_INTEN_NCSIEN_Msk : No Carrier Sense - * - \ref EMAC_INTEN_TXABTIEN_Msk : Transmit Abort - * - \ref EMAC_INTEN_LCIEN_Msk : Late Collision - * - \ref EMAC_INTEN_TDUIEN_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTEN_TXBEIEN_Msk : Transmit Bus Error - * - \ref EMAC_INTEN_TSALMIEN_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro enable specified EMAC interrupt. - * \hideinitializer - */ -#define EMAC_ENABLE_INT(EMAC, u32eIntSel) ((EMAC)->INTEN |= (u32eIntSel)) - -/** - * @brief Disable specified EMAC interrupt - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntSel Interrupt type select - * - \ref EMAC_INTEN_RXIEN_Msk : Receive - * - \ref EMAC_INTEN_CRCEIEN_Msk : CRC Error - * - \ref EMAC_INTEN_RXOVIEN_Msk : Receive FIFO Overflow - * - \ref EMAC_INTEN_LPIEN_Msk : Long Packet - * - \ref EMAC_INTEN_RXGDIEN_Msk : Receive Good - * - \ref EMAC_INTEN_ALIEIEN_Msk : Alignment Error - * - \ref EMAC_INTEN_RPIEN_Msk : Runt Packet - * - \ref EMAC_INTEN_MPCOVIEN_Msk : Miss Packet Counter Overrun - * - \ref EMAC_INTEN_MFLEIEN_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTEN_DENIEN_Msk : DMA Early Notification - * - \ref EMAC_INTEN_RDUIEN_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTEN_RXBEIEN_Msk : Receive Bus Error - * - \ref EMAC_INTEN_CFRIEN_Msk : Control Frame Receive - * - \ref EMAC_INTEN_WOLIEN_Msk : Wake on LAN Interrupt - * - \ref EMAC_INTEN_TXIEN_Msk : Transmit - * - \ref EMAC_INTEN_TXUDIEN_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTEN_TXCPIEN_Msk : Transmit Completion - * - \ref EMAC_INTEN_EXDEFIEN_Msk : Defer Exceed - * - \ref EMAC_INTEN_NCSIEN_Msk : No Carrier Sense - * - \ref EMAC_INTEN_TXABTIEN_Msk : Transmit Abort - * - \ref EMAC_INTEN_LCIEN_Msk : Late Collision - * - \ref EMAC_INTEN_TDUIEN_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTEN_TXBEIEN_Msk : Transmit Bus Error - * - \ref EMAC_INTEN_TSALMIEN_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro disable specified EMAC interrupt. - * \hideinitializer - */ -#define EMAC_DISABLE_INT(EMAC, u32eIntSel) ((EMAC)->INTEN &= ~ (u32eIntSel)) - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref EMAC_INTSTS_RXIF_Msk : Receive - * - \ref EMAC_INTSTS_CRCEIF_Msk : CRC Error - * - \ref EMAC_INTSTS_RXOVIF_Msk : Receive FIFO Overflow - * - \ref EMAC_INTSTS_LPIF_Msk : Long Packet - * - \ref EMAC_INTSTS_RXGDIF_Msk : Receive Good - * - \ref EMAC_INTSTS_ALIEIF_Msk : Alignment Error - * - \ref EMAC_INTSTS_RPIF_Msk : Runt Packet - * - \ref EMAC_INTSTS_MPCOVIF_Msk : Missed Packet Counter - * - \ref EMAC_INTSTS_MFLEIF_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTSTS_DENIF_Msk : DMA Early Notification - * - \ref EMAC_INTSTS_RDUIF_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTSTS_RXBEIF_Msk : Receive Bus Error - * - \ref EMAC_INTSTS_CFRIF_Msk : Control Frame Receive - * - \ref EMAC_INTSTS_WOLIF_Msk : Wake on LAN - * - \ref EMAC_INTSTS_TXIF_Msk : Transmit - * - \ref EMAC_INTSTS_TXUDIF_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTSTS_TXCPIF_Msk : Transmit Completion - * - \ref EMAC_INTSTS_EXDEFIF_Msk : Defer Exceed - * - \ref EMAC_INTSTS_NCSIF_Msk : No Carrier Sense - * - \ref EMAC_INTSTS_TXABTIF_Msk : Transmit Abort - * - \ref EMAC_INTSTS_LCIF_Msk : Late Collision - * - \ref EMAC_INTSTS_TDUIF_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTSTS_TXBEIF_Msk : Transmit Bus Error - * - \ref EMAC_INTSTS_TSALMIF_Msk : Time Stamp Alarm - * - * @return None - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define EMAC_GET_INT_FLAG(EMAC, u32eIntTypeFlag) (((EMAC)->INTSTS & (u32eIntTypeFlag))?1:0) - -/** - * @brief Clear specified interrupt flag/status - * - * @param[in] emac The pointer of the specified EMAC module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref EMAC_INTSTS_RXIF_Msk : Receive - * - \ref EMAC_INTSTS_CRCEIF_Msk : CRC Error - * - \ref EMAC_INTSTS_RXOVIF_Msk : Receive FIFO Overflow - * - \ref EMAC_INTSTS_LPIF_Msk : Long Packet - * - \ref EMAC_INTSTS_RXGDIF_Msk : Receive Good - * - \ref EMAC_INTSTS_ALIEIF_Msk : Alignment Error - * - \ref EMAC_INTSTS_RPIF_Msk : Runt Packet - * - \ref EMAC_INTSTS_MPCOVIF_Msk : Missed Packet Counter - * - \ref EMAC_INTSTS_MFLEIF_Msk : Maximum Frame Length Exceed - * - \ref EMAC_INTSTS_DENIF_Msk : DMA Early Notification - * - \ref EMAC_INTSTS_RDUIF_Msk : Receive Descriptor Unavailable - * - \ref EMAC_INTSTS_RXBEIF_Msk : Receive Bus Error - * - \ref EMAC_INTSTS_CFRIF_Msk : Control Frame Receive - * - \ref EMAC_INTSTS_WOLIF_Msk : Wake on LAN - * - \ref EMAC_INTSTS_TXIF_Msk : Transmit - * - \ref EMAC_INTSTS_TXUDIF_Msk : Transmit FIFO Underflow - * - \ref EMAC_INTSTS_TXCPIF_Msk : Transmit Completion - * - \ref EMAC_INTSTS_EXDEFIF_Msk : Defer Exceed - * - \ref EMAC_INTSTS_NCSIF_Msk : No Carrier Sense - * - \ref EMAC_INTSTS_TXABTIF_Msk : Transmit Abort - * - \ref EMAC_INTSTS_LCIF_Msk : Late Collision - * - \ref EMAC_INTSTS_TDUIF_Msk : Transmit Descriptor Unavailable - * - \ref EMAC_INTSTS_TXBEIF_Msk : Transmit Bus Error - * - \ref EMAC_INTSTS_TSALMIF_Msk : Time Stamp Alarm - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro clear specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define EMAC_CLEAR_INT_FLAG(EMAC, u32eIntTypeFlag) ((EMAC)->INTSTS |= (u32eIntTypeFlag)) -#define EMAC_CLEAR_ALL_INT_FLAG(EMAC) ((EMAC)->INTSTS |= (EMAC)->INTSTS) - - -void EMAC_Open(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8MacAddr); -void EMAC_Close(EMAC_T *EMAC); -void EMAC_SetMacAddr(EMAC_T *EMAC, uint8_t *pu8MacAddr); -void EMAC_EnableCamEntry(EMAC_T *EMAC, uint32_t u32Entry, uint8_t pu8MacAddr[]); -void EMAC_DisableCamEntry(EMAC_T *EMAC, uint32_t u32Entry); - -uint32_t EMAC_RecvPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size); -uint32_t EMAC_RecvPktTS(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size, uint32_t *pu32Sec, uint32_t *pu32Nsec); -void EMAC_RecvPktDone(EMAC_MEMMGR_T *psMemMgr); - -uint32_t EMAC_SendPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t u32Size); -uint32_t EMAC_SendPktDone(EMAC_MEMMGR_T *psMemMgr); -uint32_t EMAC_SendPktDoneTS(EMAC_MEMMGR_T *psMemMgr, uint32_t *pu32Sec, uint32_t *pu32Nsec); - -void EMAC_EnableTS(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_DisableTS(EMAC_T *EMAC); -void EMAC_GetTime(EMAC_T *EMAC, uint32_t *pu32Sec, uint32_t *pu32Nsec); -void EMAC_SetTime(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_UpdateTime(EMAC_T *EMAC, uint32_t u32Neg, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_EnableAlarm(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec); -void EMAC_DisableAlarm(EMAC_T *EMAC); - -uint32_t EMAC_CheckLinkStatus(EMAC_T *EMAC); - -void EMAC_Reset(EMAC_T *EMAC); -void EMAC_PhyInit(EMAC_T *EMAC); -int32_t EMAC_FillCamEntry(EMAC_T *EMAC, uint8_t pu8MacAddr[]); -uint8_t *EMAC_ClaimFreeTXBuf(EMAC_MEMMGR_T *psMemMgr); -uint32_t EMAC_GetAvailRXBufSize(EMAC_MEMMGR_T *psMemMgr, uint8_t **ppuDataBuf); -uint32_t EMAC_SendPktWoCopy(EMAC_MEMMGR_T *psMemMgr, uint32_t u32Size); -EMAC_DESCRIPTOR_T * EMAC_RecvPktDoneWoRxTrigger(EMAC_MEMMGR_T *psMemMgr); -void EMAC_RxTrigger(EMAC_MEMMGR_T *psMemMgr, EMAC_DESCRIPTOR_T * rx_desc); - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EMAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_EMAC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_etimer.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_etimer.h deleted file mode 100644 index 445f02f53de..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_etimer.h +++ /dev/null @@ -1,905 +0,0 @@ -/**************************************************************************//** - * @file etimer.h - * @brief ETIMER driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_ETIMER_H__ -#define __NU_ETIMER_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "nuc980.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ETIMER_Driver ETIMER Driver - @{ -*/ - -/** @addtogroup ETIMER_EXPORTED_CONSTANTS ETIMER Exported Constants - @{ -*/ - -#define ETIMER_ONESHOT_MODE (0UL) /*!< Timer working in one shot mode */ -#define ETIMER_PERIODIC_MODE (1UL << 4) /*!< Timer working in periodic mode */ -#define ETIMER_TOGGLE_MODE (2UL << 4) /*!< Timer working in toggle mode */ -#define ETIMER_CONTINUOUS_MODE (3UL << 4) /*!< Timer working in continuous mode */ - -#define ETIMER_CAPTURE_FREE_COUNTING_MODE (0UL) /*!< Free counting mode */ -#define ETIMER_CAPTURE_TRIGGER_COUNTING_MODE (1UL << 20) /*!< Trigger counting mode */ -#define ETIMER_CAPTURE_COUNTER_RESET_MODE (1UL << 17) /*!< Counter reset mode */ - -#define ETIMER_CAPTURE_FALLING_EDGE (0UL) /*!< Falling edge trigger timer capture */ -#define ETIMER_CAPTURE_RISING_EDGE (1UL << 18) /*!< Rising edge trigger timer capture */ -#define ETIMER_CAPTURE_FALLING_THEN_RISING_EDGE (2UL << 18) /*!< Falling edge then rising edge trigger timer capture */ -#define ETIMER_CAPTURE_RISING_THEN_FALLING_EDGE (3UL << 18) /*!< Rising edge then falling edge trigger timer capture */ - -#define TIMER_TIMEOUT_TRIGGER (0UL) /*!< Timer timeout trigger other modules */ -#define TIMER_CAPTURE_TRIGGER (1UL << 11) /*!< Timer capture trigger other modules */ - -#define TIMER_COUNTER_RISING_EDGE (1UL << 13) /*!< Counter increase on rising edge */ -#define TIMER_COUNTER_FALLING_EDGE (0UL) /*!< Counter increase on falling edge */ - -/*@}*/ /* end of group ETIMER_EXPORTED_CONSTANTS */ - -/** @addtogroup ETIMER_EXPORTED_FUNCTIONS ETIMER Exported Functions - @{ -*/ - -/** - * @brief This macro is used to set new Timer compared value - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @param[in] u32Value Timer compare value. Valid values are between 2 to 0xFFFFFF - * @return None - * \hideinitializer - */ -#define ETIMER_SET_CMP_VALUE(timer, u32Value) \ - do{\ - if((timer) == 0) {\ - outpw(REG_ETMR0_CMPR, u32Value);\ - } else if((timer) == 1) {\ - outpw(REG_ETMR1_CMPR, u32Value);\ - } else if((timer) == 2) {\ - outpw(REG_ETMR2_CMPR, u32Value);\ - } else if((timer) == 3) {\ - outpw(REG_ETMR3_CMPR, u32Value);\ - } else if((timer) == 4) {\ - outpw(REG_ETMR4_CMPR, u32Value);\ - } else {\ - outpw(REG_ETMR5_CMPR, u32Value);\ - }\ - }while(0) - -/** - * @brief This macro is used to set new Timer prescale value - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @param[in] u32Value Timer prescale value. Valid values are between 0 to 0xFF - * @return None - * @note Clock input is divided by (prescale + 1) before it is fed into timer - * \hideinitializer - */ -#define ETIMER_SET_PRESCALE_VALUE(timer, u32Value) \ - do{\ - if((timer) == 0) {\ - outpw(REG_ETMR0_PRECNT, u32Value);\ - } else if((timer) == 1) {\ - outpw(REG_ETMR1_PRECNT, u32Value);\ - } else if((timer) == 2) {\ - outpw(REG_ETMR2_PRECNT, u32Value);\ - } else if((timer) == 3) {\ - outpw(REG_ETMR3_PRECNT, u32Value);\ - } else if((timer) == 4) {\ - outpw(REG_ETMR4_PRECNT, u32Value);\ - } else {\ - outpw(REG_ETMR5_PRECNT, u32Value);\ - }\ - }while(0) - -/** -* @brief Select Timer operating mode -* -* @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. -* @param[in] u32OpMode Operation mode. Possible options are -* - \ref ETIMER_ONESHOT_MODE -* - \ref ETIMER_PERIODIC_MODE -* - \ref ETIMER_TOGGLE_MODE -* - \ref ETIMER_CONTINUOUS_MODE -* -* @return None -* \hideinitializer -*/ -#define ETIMER_SET_OPMODE(timer, u32OpMode) \ - do{\ - if((timer) == 0) {\ - outpw(REG_ETMR0_CTL, (inpw(REG_ETMR0_CTL)&~0x30) | u32OpMode);\ - } else if((timer) == 1) {\ - outpw(REG_ETMR1_CTL, (inpw(REG_ETMR1_CTL)&~0x30) | u32OpMode);\ - } else if((timer) == 2) {\ - outpw(REG_ETMR2_CTL, (inpw(REG_ETMR2_CTL)&~0x30) | u32OpMode);\ - } else if((timer) == 3) {\ - outpw(REG_ETMR3_CTL, (inpw(REG_ETMR3_CTL)&~0x30) | u32OpMode);\ - } else if((timer) == 4) {\ - outpw(REG_ETMR4_CTL, (inpw(REG_ETMR4_CTL)&~0x30) | u32OpMode);\ - } else {\ - outpw(REG_ETMR5_CTL, (inpw(REG_ETMR5_CTL)&~0x30) | u32OpMode);\ - }\ - }while(0) - -/** - * @brief This macro is used to check if specify Timer is inactive or active - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return timer is activate or inactivate - * @retval 0 Timer 24-bit up counter is inactive - * @retval 1 Timer 24-bit up counter is active - * \hideinitializer - */ -static __inline int ETIMER_Is_Active(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_CTL); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_CTL); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_CTL); - } - else if (timer == 3) - { - reg = inpw(REG_ETMR3_CTL); - } - else if (timer == 4) - { - reg = inpw(REG_ETMR4_CTL); - } - else - { - reg = inpw(REG_ETMR5_CTL); - } - return (reg & 0x80) ? 1 : 0; -} - -/** - * @brief This function is used to start Timer counting - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_Start(UINT timer) -{ - - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) | 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) | 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) | 1); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) | 1); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) | 1); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) | 1); - } -} - -/** - * @brief This function is used to stop Timer counting - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_Stop(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~1); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~1); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) & ~1); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) & ~1); - } -} - -/** - * @brief This function is used to enable the Timer wake-up function - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - * @note To wake the system from power down mode, timer clock source must be ether LXT or LIRC - */ -static __inline void ETIMER_EnableWakeup(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) | 4); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) | 4); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) | 4); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) | 4); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) | 4); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) | 4); - } -} - -/** - * @brief This function is used to disable the Timer wake-up function - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_DisableWakeup(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~4); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~4); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~4); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~4); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) & ~4); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) & ~4); - } -} - - -/** - * @brief This function is used to enable the capture pin detection de-bounce function. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_EnableCaptureDebounce(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) | 0x400000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) | 0x400000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) | 0x400000); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) | 0x400000); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) | 0x400000); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) | 0x400000); - } -} - -/** - * @brief This function is used to disable the capture pin detection de-bounce function. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_DisableCaptureDebounce(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~0x400000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~0x400000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~0x400000); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~0x400000); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) & ~0x400000); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) & ~0x400000); - } -} - - -/** - * @brief This function is used to enable the Timer time-out interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_EnableInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) | 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) | 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) | 1); - } - else if (timer == 3) - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) | 1); - } - else if (timer == 4) - { - outpw(REG_ETMR4_IER, inpw(REG_ETMR4_IER) | 1); - } - else - { - outpw(REG_ETMR5_IER, inpw(REG_ETMR5_IER) | 1); - } -} - -/** - * @brief This function is used to disable the Timer time-out interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_DisableInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) & ~1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) & ~1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) & ~1); - } - else if (timer == 3) - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) & ~1); - } - else if (timer == 4) - { - outpw(REG_ETMR4_IER, inpw(REG_ETMR4_IER) & ~1); - } - else - { - outpw(REG_ETMR5_IER, inpw(REG_ETMR5_IER) & ~1); - } -} - -/** - * @brief This function is used to enable the Timer capture trigger interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_EnableCaptureInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) | 2); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) | 2); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) | 2); - } - else if (timer == 3) - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) | 2); - } - else if (timer == 4) - { - outpw(REG_ETMR4_IER, inpw(REG_ETMR4_IER) | 2); - } - else - { - outpw(REG_ETMR5_IER, inpw(REG_ETMR5_IER) | 2); - } -} - -/** - * @brief This function is used to disable the Timer capture trigger interrupt function. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_DisableCaptureInt(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_IER, inpw(REG_ETMR0_IER) & ~2); - } - else if (timer == 1) - { - outpw(REG_ETMR1_IER, inpw(REG_ETMR1_IER) & ~2); - } - else if (timer == 2) - { - outpw(REG_ETMR2_IER, inpw(REG_ETMR2_IER) & ~2); - } - else if (timer == 3) - { - outpw(REG_ETMR3_IER, inpw(REG_ETMR3_IER) & ~2); - } - else if (timer == 4) - { - outpw(REG_ETMR4_IER, inpw(REG_ETMR4_IER) & ~2); - } - else - { - outpw(REG_ETMR5_IER, inpw(REG_ETMR5_IER) & ~2); - } -} - -/** - * @brief This function indicates Timer time-out interrupt occurred or not. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer time-out interrupt occurred or not - * @retval 0 Timer time-out interrupt did not occur - * @retval 1 Timer time-out interrupt occurred - */ -static __inline UINT ETIMER_GetIntFlag(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_ISR); - } - else if (timer == 3) - { - reg = inpw(REG_ETMR3_ISR); - } - else if (timer == 4) - { - reg = inpw(REG_ETMR4_ISR); - } - else - { - reg = inpw(REG_ETMR5_ISR); - } - return reg & 1; -} - -/** - * @brief This function clears the Timer time-out interrupt flag. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_ClearIntFlag(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_ISR, 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_ISR, 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_ISR, 1); - } - else if (timer == 3) - { - outpw(REG_ETMR3_ISR, 1); - } - else if (timer == 4) - { - outpw(REG_ETMR4_ISR, 1); - } - else - { - outpw(REG_ETMR5_ISR, 1); - } -} - -/** - * @brief This function indicates Timer capture interrupt occurred or not. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer capture interrupt occurred or not - * @retval 0 Timer capture interrupt did not occur - * @retval 1 Timer capture interrupt occurred - */ -static __inline UINT ETIMER_GetCaptureIntFlag(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_ISR); - } - else if (timer == 3) - { - reg = inpw(REG_ETMR3_ISR); - } - else if (timer == 4) - { - reg = inpw(REG_ETMR4_ISR); - } - else - { - reg = inpw(REG_ETMR5_ISR); - } - return (reg & 2) >> 1; -} - -/** - * @brief This function clears the Timer capture interrupt flag. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_ClearCaptureIntFlag(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_ISR, 2); - } - else if (timer == 1) - { - outpw(REG_ETMR1_ISR, 2); - } - else if (timer == 2) - { - outpw(REG_ETMR2_ISR, 2); - } - else if (timer == 3) - { - outpw(REG_ETMR3_ISR, 2); - } - else if (timer == 4) - { - outpw(REG_ETMR4_ISR, 2); - } - else - { - outpw(REG_ETMR5_ISR, 2); - } -} - -/** -* @brief This function gets the Timer capture falling edge flag. -* @param[in] timer ETIMER number. Range from 0 ~ 5 -* @return None -*/ -static __inline UINT8 ETIMER_GetCaptureFallingEdgeFlag(UINT timer) -{ - UINT ret; - - if (timer == 0) - { - ret = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - ret = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - ret = inpw(REG_ETMR2_ISR); - } - else if (timer == 3) - { - ret = inpw(REG_ETMR3_ISR); - } - else if (timer == 4) - { - ret = inpw(REG_ETMR4_ISR); - } - else - { - ret = inpw(REG_ETMR5_ISR); - } - return (ret & (1 << 6)) >> 6; -} - -/** - * @brief This function indicates Timer has waked up system or not. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer has waked up system or not - * @retval 0 Timer did not wake up system - * @retval 1 Timer wake up system - */ -static __inline UINT ETIMER_GetWakeupFlag(UINT timer) -{ - int reg; - - if (timer == 0) - { - reg = inpw(REG_ETMR0_ISR); - } - else if (timer == 1) - { - reg = inpw(REG_ETMR1_ISR); - } - else if (timer == 2) - { - reg = inpw(REG_ETMR2_ISR); - } - else if (timer == 3) - { - reg = inpw(REG_ETMR3_ISR); - } - else if (timer == 4) - { - reg = inpw(REG_ETMR4_ISR); - } - else - { - reg = inpw(REG_ETMR5_ISR); - } - return (reg & 0x10) >> 4; -} - -/** - * @brief This function clears the Timer wakeup interrupt flag. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -static __inline void ETIMER_ClearWakeupFlag(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_ISR, 0x10); - } - else if (timer == 1) - { - outpw(REG_ETMR1_ISR, 0x10); - } - else if (timer == 2) - { - outpw(REG_ETMR2_ISR, 0x10); - } - else if (timer == 3) - { - outpw(REG_ETMR3_ISR, 0x10); - } - else if (timer == 4) - { - outpw(REG_ETMR4_ISR, 0x10); - } - else - { - outpw(REG_ETMR5_ISR, 0x10); - } -} - -/** - * @brief This function gets the Timer compare value. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer compare data value - */ -static __inline UINT ETIMER_GetCompareData(UINT timer) -{ - - if (timer == 0) - { - return inpw(REG_ETMR0_CMPR); - } - else if (timer == 1) - { - return inpw(REG_ETMR1_CMPR); - } - else if (timer == 2) - { - return inpw(REG_ETMR2_CMPR); - } - else if (timer == 3) - { - return inpw(REG_ETMR3_CMPR); - } - else if (timer == 4) - { - return inpw(REG_ETMR4_CMPR); - } - else - { - return inpw(REG_ETMR5_CMPR); - } -} - -/** - * @brief This function gets the Timer capture data. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer capture data value - */ -static __inline UINT ETIMER_GetCaptureData(UINT timer) -{ - - if (timer == 0) - { - return inpw(REG_ETMR0_TCAP); - } - else if (timer == 1) - { - return inpw(REG_ETMR1_TCAP); - } - else if (timer == 2) - { - return inpw(REG_ETMR2_TCAP); - } - else if (timer == 3) - { - return inpw(REG_ETMR3_TCAP); - } - else if (timer == 4) - { - return inpw(REG_ETMR4_TCAP); - } - else - { - return inpw(REG_ETMR5_TCAP); - } -} - -/** - * @brief This function reports the current timer counter value. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer counter value - */ -static __inline UINT ETIMER_GetCounter(UINT timer) -{ - if (timer == 0) - { - return inpw(REG_ETMR0_DR); - } - else if (timer == 1) - { - return inpw(REG_ETMR1_DR); - } - else if (timer == 2) - { - return inpw(REG_ETMR2_DR); - } - else if (timer == 3) - { - return inpw(REG_ETMR3_DR); - } - else if (timer == 4) - { - return inpw(REG_ETMR4_DR); - } - else - { - return inpw(REG_ETMR5_DR); - } -} - -static __inline UINT ETIMER_ClearCounter(UINT timer) -{ - if (timer == 0) - { - return outpw(REG_ETMR0_DR, 0); - } - else if (timer == 1) - { - return outpw(REG_ETMR1_DR, 0); - } - else if (timer == 2) - { - return outpw(REG_ETMR2_DR, 0); - } - else if (timer == 3) - { - return outpw(REG_ETMR3_DR, 0); - } - else if (timer == 4) - { - return outpw(REG_ETMR4_DR, 0); - } - else - { - return outpw(REG_ETMR5_DR, 0); - } -} - -UINT ETIMER_Open(UINT timer, UINT u32Mode, UINT u32Freq); -void ETIMER_Close(UINT timer); -void ETIMER_Delay(UINT timer, UINT u32Usec); -void ETIMER_EnableCapture(UINT timer, UINT u32CapMode, UINT u32Edge); -void ETIMER_DisableCapture(UINT timer); -void ETIMER_EnableEventCounter(UINT timer, uint32_t u32Edge); -void ETIMER_DisableEventCounter(UINT timer); -UINT ETIMER_GetModuleClock(UINT timer); - -/*@}*/ /* end of group ETIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ETIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_ETIMER_H__ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_gpio.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_gpio.h deleted file mode 100644 index 2721cc5d395..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_gpio.h +++ /dev/null @@ -1,835 +0,0 @@ -/**************************************************************************//** - * @file GPIO.h - * @brief GPIO driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef __NU_GPIO_H__ -#define __NU_GPIO_H__ - -#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 */ - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup GPIO General Purpose Input/Output Controller(GPIO) - Memory Mapped Structure for GPIO Controller -@{ */ - - -typedef struct -{ - - /** - * @var GPIO_T::MODE - * Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0 Port A-H I/O Mode Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|MODEn |Port A-H I/O Pin[n] Mode Control - * | | |Determine each I/O mode of Px.n pins. - * | | |00 = Px.n is in Input mode. - * | | |01 = Px.n is in Push-pull Output mode. - * | | |10 = Px.n is in Open-drain Output mode. - * | | |11 = Px.n is in Quasi-bidirectional mode. - * | | |Note1: The initial value of this field is defined by CIOINI (CONFIG0 [10]). - * | | |If CIOINI is set to 0, the default value is 0xFFFF_FFFF and all pins will be quasi-bidirectional mode after chip powered on. - * | | |If CIOINI is set to 1, the default value is 0x0000_0000 and all pins will be input mode after chip powered on. - * | | |Note2: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DINOFF - * Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4 Port A-H Digital Input Path Disable Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n+16] |DINOFFn |Port A-H Pin[n] Digital Input Path Disable Control - * | | |Each of these bits is used to control if the digital input path of corresponding Px.n pin is disabled. - * | | |If input is analog signal, users can disable Px.n digital input path to avoid input current leakage. - * | | |0 = Px.n digital input path Enabled. - * | | |1 = Px.n digital input path Disabled (digital input tied to low). - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DOUT - * Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8 Port A-H Data Output Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DOUTn |Port A-H Pin[n] Output Value - * | | |Each of these bits controls the status of a Px.n pin when the Px.n is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |0 = Px.n will drive Low if the Px.n pin is configured as Push-pull output, Open-drain output or Quasi-bidirectional mode. - * | | |1 = Px.n will drive High if the Px.n pin is configured as Push-pull output or Quasi-bidirectional mode. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DATMSK - * Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC Port A-H Data Output Write Mask - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DATMSKn |Port A-H Pin[n] Data Output Write Mask - * | | |These bits are used to protect the corresponding DOUT (Px_DOUT[n]) bit. - * | | |When the DATMSK (Px_DATMSK[n]) bit is set to 1, the corresponding DOUT (Px_DOUT[n]) bit is protected. - * | | |If the write signal is masked, writing data to the protect bit is ignored. - * | | |0 = Corresponding DOUT (Px_DOUT[n]) bit can be updated. - * | | |1 = Corresponding DOUT (Px_DOUT[n]) bit protected. - * | | |Note1: This function only protects the corresponding DOUT (Px_DOUT[n]) bit, and will not protect the corresponding PDIO (Pxn_PDIO[n]) bit. - * | | |Note2: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::PIN - * Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0 Port A-H Pin Value - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |PINn |Port A-H Pin[n] Pin Value - * | | |Each bit of the register reflects the actual status of the respective Px.n pin. - * | | |If the bit is 1, it indicates the corresponding pin status is high; else the pin status is low. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::DBEN - * Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4 Port A-H De-Bounce Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |DBENn |Port A-H Pin[n] Input Signal De-Bounce Enable Bit - * | | |The DBEN[n] bit is used to enable the de-bounce function for each corresponding bit. - * | | |If the input signal pulse width cannot be sampled by continuous two de-bounce sample cycle, the input signal transition is seen as the signal bounce and will not trigger the interrupt. - * | | |The de-bounce clock source is controlled by DBCLKSRC (GPIO_DBCTL [4]), one de-bounce sample cycle period is controlled by DBCLKSEL (GPIO_DBCTL [3:0]). - * | | |0 = Px.n de-bounce function Disabled. - * | | |1 = Px.n de-bounce function Enabled. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::INTTYPE - * Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8 Port A-H Interrupt Trigger Type Control - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |TYPEn |Port A-H Pin[n] Edge or Level Detection Interrupt Trigger Type Control - * | | |TYPE (Px_INTTYPE[n]) bit is used to control the triggered interrupt is by level trigger or by edge trigger. - * | | |If the interrupt is by edge trigger, the trigger source can be controlled by de-bounce. - * | | |If the interrupt is by level trigger, the input source is sampled by one HCLK clock and generates the interrupt. - * | | |0 = Edge trigger interrupt. - * | | |1 = Level trigger interrupt. - * | | |If the pin is set as the level trigger interrupt, only one level can be set on the registers RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]). - * | | |If both levels to trigger interrupt are set, the setting is ignored and no interrupt will occur. - * | | |The de-bounce function is valid only for edge triggered interrupt. - * | | |If the interrupt mode is level triggered, the de-bounce enable bit is ignored. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::INTEN - * Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC Port A-H Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |FLIENn |Port A-H Pin[n] Falling Edge or Low Level Interrupt Trigger Type Enable Bit - * | | |The FLIEN (Px_INTEN[n]) bit is used to enable the interrupt for each of the corresponding input Px.n pin. - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the FLIEN (Px_INTEN[n]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at low level. - * | | |If the interrupt is edge trigger(TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from high to low. - * | | |0 = Px.n level low or high to low interrupt Disabled. - * | | |1 = Px.n level low or high to low interrupt Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * |[n+16] |RHIENn |Port A-H Pin[n] Rising Edge or High Level Interrupt Trigger Type Enable Bit - * | | |The RHIEN (Px_INTEN[n+16]) bit is used to enable the interrupt for each of the corresponding input Px.n pin - * | | |Set bit to 1 also enable the pin wake-up function. - * | | |When setting the RHIEN (Px_INTEN[n+16]) bit to 1 : - * | | |If the interrupt is level trigger (TYPE (Px_INTTYPE[n]) bit is set to 1), the input Px.n pin will generate the interrupt while this pin state is at high level. - * | | |If the interrupt is edge trigger (TYPE (Px_INTTYPE[n]) bit is set to 0), the input Px.n pin will generate the interrupt while this pin state changed from low to high. - * | | |0 = Px.n level high or low to high interrupt Disabled. - * | | |1 = Px.n level high or low to high interrupt Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::INTSRC - * Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0 Port A-H Interrupt Source Flag - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |INTSRCn |Port A-H Pin[n] Interrupt Source Flag - * | | |Write Operation : - * | | |0 = No action. - * | | |1 = Clear the corresponding pending interrupt. - * | | |Read Operation : - * | | |0 = No interrupt at Px.n. - * | | |1 = Px.n generates an interrupt. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::SMTEN - * Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4 Port A-H Input Schmitt Trigger Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[n] |SMTENn |Port A-H Pin[n] Input Schmitt Trigger Enable Bit - * | | |0 = Px.n input Schmitt trigger function Disabled. - * | | |1 = Px.n input Schmitt trigger function Enabled. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::SLEWCTL - * Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8 Port A-H High Slew Rate Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|HSRENn |Port A-H Pin[n] High Slew Rate Control - * | | |00 = Px.n output with normal slew rate mode (maximum 40 MHz at 2.7V). - * | | |01 = Px.n output with high slew rate mode (maximum 80 MHz at 2.7V). - * | | |10 = Px.n output with fast slew rate mode (maximum 100 MHz at 2.7V. - * | | |11 = Reserved. - * | | |Note: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - * @var GPIO_T::PUSEL - * Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0 Port A-H Pull-up and Pull-down Selection Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2n+1:2n]|PUSELn |Port A-H Pin[n] Pull-up and Pull-down Enable Register - * | | |Determine each I/O Pull-up/pull-down of Px.n pins. - * | | |00 = Px.n pull-up and pull-up disable. - * | | |01 = Px.n pull-up enable. - * | | |10 = Px.n pull-down enable. - * | | |11 = Px.n pull-up and pull-up disable. - * | | |Note1: - * | | |Basically, the pull-up control and pull-down control has following behavior limitation - * | | |The independent pull-up control register only valid when MODEn set as tri-state and open-drain mode - * | | |The independent pull-down control register only valid when MODEn set as tri-state mode - * | | |When both pull-up pull-down is set as 1 at tri-state mode, keep I/O in tri-state mode - * | | |Note2: - * | | |Max. n=15 for port A/B/E/G. - * | | |Max. n=14 for port C/D. - * | | |Max. n=11 for port F/H. - */ - - __IO uint32_t MODE; /* Offset: 0x00/0x40/0x80/0xC0/0x100/0x140/0x180/0x1C0 Port A-H I/O Mode Control */ - __IO uint32_t DINOFF; /* Offset: 0x04/0x44/0x84/0xC4/0x104/0x144/0x184/0x1C4 Port A-H Digital Input Path Disable Control */ - __IO uint32_t DOUT; /* Offset: 0x08/0x48/0x88/0xC8/0x108/0x148/0x188/0x1C8 Port A-H Data Output Value */ - __IO uint32_t DATMSK; /* Offset: 0x0C/0x4C/0x8C/0xCC/0x10C/0x14C/0x18C/0x1CC Port A-H Data Output Write Mask */ - __I uint32_t PIN; /* Offset: 0x10/0x50/0x90/0xD0/0x110/0x150/0x190/0x1D0 Port A-H Pin Value */ - __IO uint32_t DBEN; /* Offset: 0x14/0x54/0x94/0xD4/0x114/0x154/0x194/0x1D4 Port A-H De-Bounce Enable Control Register */ - __IO uint32_t INTTYPE; /* Offset: 0x18/0x58/0x98/0xD8/0x118/0x158/0x198/0x1D8 Port A-H Interrupt Trigger Type Control */ - __IO uint32_t INTEN; /* Offset: 0x1C/0x5C/0x9C/0xDC/0x11C/0x15C/0x19C/0x1DC Port A-H Interrupt Enable Control Register */ - __IO uint32_t INTSRC; /* Offset: 0x20/0x60/0xA0/0xE0/0x120/0x160/0x1A0/0x1E0 Port A-H Interrupt Source Flag */ - __IO uint32_t SMTEN; /* Offset: 0x24/0x64/0xA4/0xE4/0x124/0x164/0x1A4/0x1E4 Port A-H Input Schmitt Trigger Enable Register */ - __IO uint32_t SLEWCTL; /* Offset: 0x28/0x68/0xA8/0xE8/0x128/0x168/0x1A8/0x1E8 Port A-H High Slew Rate Control Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t PUSEL; /* Offset: 0x30/0x70/0xB0/0xF0/0x130/0x170/0x1B0/0x1F0 Port A-H Pull-up and Pull-down Enable Register */ - -} GPIO_T; - -typedef struct -{ - - /** - * @var GPIO_DBCTL_T::DBCTL - * Offset: 0x440 Interrupt De-bounce Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |DBCLKSEL |De-Bounce Sampling Cycle Selection - * | | |0000 = Sample interrupt input once per 1 clocks. - * | | |0001 = Sample interrupt input once per 2 clocks. - * | | |0010 = Sample interrupt input once per 4 clocks. - * | | |0011 = Sample interrupt input once per 8 clocks. - * | | |0100 = Sample interrupt input once per 16 clocks. - * | | |0101 = Sample interrupt input once per 32 clocks. - * | | |0110 = Sample interrupt input once per 64 clocks. - * | | |0111 = Sample interrupt input once per 128 clocks. - * | | |1000 = Sample interrupt input once per 256 clocks. - * | | |1001 = Sample interrupt input once per 2*256 clocks. - * | | |1010 = Sample interrupt input once per 4*256 clocks. - * | | |1011 = Sample interrupt input once per 8*256 clocks. - * | | |1100 = Sample interrupt input once per 16*256 clocks. - * | | |1101 = Sample interrupt input once per 32*256 clocks. - * | | |1110 = Sample interrupt input once per 64*256 clocks. - * | | |1111 = Sample interrupt input once per 128*256 clocks. - * |[4] |DBCLKSRC |De-Bounce Counter Clock Source Selection - * | | |0 = De-bounce counter clock source is the HCLK. - * | | |1 = De-bounce counter clock source is the 10 kHz internal low speed RC oscillator (LIRC). - * |[5] |ICLKON |Interrupt Clock On Mode - * | | |0 = Edge detection circuit is active only if I/O pin corresponding RHIEN (Px_INTEN[n+16])/FLIEN (Px_INTEN[n]) bit is set to 1. - * | | |1 = All I/O pins edge detection circuit is always active after reset. - * | | |Note: It is recommended to disable this bit to save system power if no special application concern. - */ - - __IO uint32_t DBCTL; /* Offset: 0x440 Interrupt De-bounce Control Register */ - -} GPIO_DBCTL_T; - -/** - @addtogroup GPIO_CONST GPIO Bit Field Definition - Constant Definitions for GPIO Controller -@{ */ - -#define GPIO_DBCTL_DBCLKSEL_Pos (0) /*!< GPIO_T::DBCTL: DBCLKSEL Position */ -#define GPIO_DBCTL_DBCLKSEL_Msk (0xFul << GPIO_DBCTL_DBCLKSEL_Pos) /*!< GPIO_T::DBCTL: DBCLKSEL Mask */ - -#define GPIO_DBCTL_DBCLKSRC_Pos (4) /*!< GPIO_T::DBCTL: DBCLKSRC Position */ -#define GPIO_DBCTL_DBCLKSRC_Msk (1ul << GPIO_DBCTL_DBCLKSRC_Pos) /*!< GPIO_T::DBCTL: DBCLKSRC Mask */ - -#define GPIO_DBCTL_ICLKON_Pos (5) /*!< GPIO_T::DBCTL: ICLKON Position */ -#define GPIO_DBCTL_ICLKON_Msk (1ul << GPIO_DBCTL_ICLKON_Pos) /*!< GPIO_T::DBCTL: ICLKON Mask */ - -/**@}*/ /* GPIO_CONST */ -/**@}*/ /* end of GPIO register group */ -/**@}*/ /* end of REGISTER group */ - -/** @addtogroup PERIPHERAL_DECLARATION Peripheral Pointer - The Declaration of Peripherals - @{ - */ - -#define GPIO_DBCTL_BASE (0xB0004440ul) -#define PA ((GPIO_T *) PA_BA) -#define PB ((GPIO_T *) PB_BA) -#define PC ((GPIO_T *) PC_BA) -#define PD ((GPIO_T *) PD_BA) -#define PE ((GPIO_T *) PE_BA) -#define PF ((GPIO_T *) PF_BA) -#define PG ((GPIO_T *) PG_BA) -#define GPIOA ((GPIO_T *) PA_BA) -#define GPIOB ((GPIO_T *) PB_BA) -#define GPIOC ((GPIO_T *) PC_BA) -#define GPIOD ((GPIO_T *) PD_BA) -#define GPIOE ((GPIO_T *) PE_BA) -#define GPIOF ((GPIO_T *) PF_BA) -#define GPIOG ((GPIO_T *) PG_BA) -#define GPIO ((GPIO_DBCTL_T *) GPIO_DBCTL_BASE) -#define GPIO_PIN_DATA_BASE (0xB0004800ul) -/*@}*/ /* end of group ERIPHERAL_DECLARATION */ - - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_CONSTANTS GPIO Exported Constants - @{ -*/ - - -#define GPIO_PIN_MAX 16UL /*!< Specify Maximum Pins of Each GPIO Port \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_MODE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_MODE_INPUT 0x0UL /*!< Input Mode \hideinitializer */ -#define GPIO_MODE_OUTPUT 0x1UL /*!< Output Mode \hideinitializer */ -#define GPIO_MODE_OPEN_DRAIN 0x2UL /*!< Open-Drain Mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Interrupt Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INT_RISING 0x00010000UL /*!< Interrupt enable by Input Rising Edge \hideinitializer */ -#define GPIO_INT_FALLING 0x00000001UL /*!< Interrupt enable by Input Falling Edge \hideinitializer */ -#define GPIO_INT_BOTH_EDGE 0x00010001UL /*!< Interrupt enable by both Rising Edge and Falling Edge \hideinitializer */ -#define GPIO_INT_HIGH 0x01010000UL /*!< Interrupt enable by Level-High \hideinitializer */ -#define GPIO_INT_LOW 0x01000001UL /*!< Interrupt enable by Level-Level \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_INTTYPE Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_INTTYPE_EDGE 0UL /*!< GPIO_INTTYPE Setting for Edge Trigger Mode \hideinitializer */ -#define GPIO_INTTYPE_LEVEL 1UL /*!< GPIO_INTTYPE Setting for Edge Level Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Slew Rate Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_SLEWCTL_NORMAL 0x0UL /*!< GPIO slew setting for nornal Mode \hideinitializer */ -#define GPIO_SLEWCTL_HIGH 0x1UL /*!< GPIO slew setting for high Mode \hideinitializer */ -#define GPIO_SLEWCTL_FAST 0x2UL /*!< GPIO slew setting for fast Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO Pull-up And Pull-down Type Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_PUSEL_DISABLE 0x0UL /*!< GPIO PUSEL setting for Disable Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_UP 0x1UL /*!< GPIO PUSEL setting for Pull-up Mode \hideinitializer */ -#define GPIO_PUSEL_PULL_DOWN 0x2UL /*!< GPIO PUSEL setting for Pull-down Mode \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO External interrupt Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_MFP_PA0MFP_EINT0 outpw(REG_SYS_GPA_MFPL, ((inpw(REG_SYS_GPA_MFPL) & 0xFFFFFFF0) | 0x00000005)) /*!< PA0 MFP setting for EINT0 \hideinitializer */ -#define GPIO_MFP_PA13MFP_EINT0 outpw(REG_SYS_GPA_MFPH, ((inpw(REG_SYS_GPA_MFPH) & 0xFF0FFFFF) | 0x00D00000)) /*!< PA13 MFP setting for EINT0 \hideinitializer */ -#define GPIO_MFP_PA1MFP_EINT1 outpw(REG_SYS_GPA_MFPL, ((inpw(REG_SYS_GPA_MFPL) & 0xFFFFFF0F) | 0x000000D0)) /*!< PA1 MFP setting for EINT1 \hideinitializer */ -#define GPIO_MFP_PA14MFP_EINT1 outpw(REG_SYS_GPA_MFPH, ((inpw(REG_SYS_GPA_MFPH) & 0xF0FFFFFF) | 0x08000000)) /*!< PA14 MFP setting for EINT1 \hideinitializer */ -#define GPIO_MFP_PD0MFP_EINT2 outpw(REG_SYS_GPD_MFPL, ((inpw(REG_SYS_GPD_MFPL) & 0xFFFFFFF0) | 0x00000004)) /*!< PD0 MFP setting for EINT2 \hideinitializer */ -#define GPIO_MFP_PE10MFP_EINT2 outpw(REG_SYS_GPE_MFPH, ((inpw(REG_SYS_GPE_MFPH) & 0xFFFFF0FF) | 0x00000500)) /*!< PE10 MFP setting for EINT2 \hideinitializer */ -#define GPIO_MFP_PB3MFP_EINT2 outpw(REG_SYS_GPB_MFPL, ((inpw(REG_SYS_GPB_MFPL) & 0xFFFF0FFF) | 0x00003000)) /*!< PB3 MFP setting for EINT2 \hideinitializer */ -#define GPIO_MFP_PB13MFP_EINT2 outpw(REG_SYS_GPB_MFPH, ((inpw(REG_SYS_GPB_MFPH) & 0xFF0FFFFF) | 0x00200000)) /*!< PB13 MFP setting for EINT2 \hideinitializer */ -#define GPIO_MFP_PD1MFP_EINT3 outpw(REG_SYS_GPD_MFPL, ((inpw(REG_SYS_GPD_MFPL) & 0xFFFFFF0F) | 0x00000040)) /*!< PD1 MFP setting for EINT3 \hideinitializer */ -#define GPIO_MFP_PE12MFP_EINT3 outpw(REG_SYS_GPE_MFPH, ((inpw(REG_SYS_GPE_MFPH) & 0xFFF0FFFF) | 0x00050000)) /*!< PE12 MFP setting for EINT3 \hideinitializer */ -#define GPIO_MFP_PG15MFP_EINT3 outpw(REG_SYS_GPG_MFPH, ((inpw(REG_SYS_GPG_MFPH) & 0x0FFFFFFF) | 0x40000000)) /*!< PG15 MFP setting for EINT3 \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* GPIO_DBCTL Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define GPIO_DBCTL_ICLK_ON 0x00000020UL /*!< GPIO_DBCTL setting for all IO pins edge detection circuit is always active after reset \hideinitializer */ -#define GPIO_DBCTL_ICLK_OFF 0x00000000UL /*!< GPIO_DBCTL setting for edge detection circuit is active only if IO pin corresponding GPIOx_IEN bit is set to 1 \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSRC_LIRC 0x00000010UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the internal 10 kHz \hideinitializer */ -#define GPIO_DBCTL_DBCLKSRC_HCLK 0x00000000UL /*!< GPIO_DBCTL setting for de-bounce counter clock source is the HCLK \hideinitializer */ - -#define GPIO_DBCTL_DBCLKSEL_1 0x00000000UL /*!< GPIO_DBCTL setting for sampling cycle = 1 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2 0x00000001UL /*!< GPIO_DBCTL setting for sampling cycle = 2 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4 0x00000002UL /*!< GPIO_DBCTL setting for sampling cycle = 4 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8 0x00000003UL /*!< GPIO_DBCTL setting for sampling cycle = 8 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16 0x00000004UL /*!< GPIO_DBCTL setting for sampling cycle = 16 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32 0x00000005UL /*!< GPIO_DBCTL setting for sampling cycle = 32 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_64 0x00000006UL /*!< GPIO_DBCTL setting for sampling cycle = 64 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_128 0x00000007UL /*!< GPIO_DBCTL setting for sampling cycle = 128 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_256 0x00000008UL /*!< GPIO_DBCTL setting for sampling cycle = 256 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_512 0x00000009UL /*!< GPIO_DBCTL setting for sampling cycle = 512 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_1024 0x0000000AUL /*!< GPIO_DBCTL setting for sampling cycle = 1024 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_2048 0x0000000BUL /*!< GPIO_DBCTL setting for sampling cycle = 2048 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_4096 0x0000000CUL /*!< GPIO_DBCTL setting for sampling cycle = 4096 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_8192 0x0000000DUL /*!< GPIO_DBCTL setting for sampling cycle = 8192 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_16384 0x0000000EUL /*!< GPIO_DBCTL setting for sampling cycle = 16384 clocks \hideinitializer */ -#define GPIO_DBCTL_DBCLKSEL_32768 0x0000000FUL /*!< GPIO_DBCTL setting for sampling cycle = 32768 clocks \hideinitializer */ - - -/* Define GPIO Pin Data Input/Output. It could be used to control each I/O pin by pin address mapping. - Example 1: - - PA0 = 1; - - It is used to set GPIO PA.0 to high; - - Example 2: - - if (PA0) - PA0 = 0; - - If GPIO PA.0 pin status is high, then set GPIO PA.0 data output to low. - */ -#define GPIO_PIN_DATA(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2)))) /*!< Pin Data Input/Output \hideinitializer */ -#define PA0 GPIO_PIN_DATA(0, 0 ) /*!< Specify PA.0 Pin Data Input/Output \hideinitializer */ -#define PA1 GPIO_PIN_DATA(0, 1 ) /*!< Specify PA.1 Pin Data Input/Output \hideinitializer */ -#define PA2 GPIO_PIN_DATA(0, 2 ) /*!< Specify PA.2 Pin Data Input/Output \hideinitializer */ -#define PA3 GPIO_PIN_DATA(0, 3 ) /*!< Specify PA.3 Pin Data Input/Output \hideinitializer */ -#define PA4 GPIO_PIN_DATA(0, 4 ) /*!< Specify PA.4 Pin Data Input/Output \hideinitializer */ -#define PA5 GPIO_PIN_DATA(0, 5 ) /*!< Specify PA.5 Pin Data Input/Output \hideinitializer */ -#define PA6 GPIO_PIN_DATA(0, 6 ) /*!< Specify PA.6 Pin Data Input/Output \hideinitializer */ -#define PA7 GPIO_PIN_DATA(0, 7 ) /*!< Specify PA.7 Pin Data Input/Output \hideinitializer */ -#define PA8 GPIO_PIN_DATA(0, 8 ) /*!< Specify PA.8 Pin Data Input/Output \hideinitializer */ -#define PA9 GPIO_PIN_DATA(0, 9 ) /*!< Specify PA.9 Pin Data Input/Output \hideinitializer */ -#define PA10 GPIO_PIN_DATA(0, 10) /*!< Specify PA.10 Pin Data Input/Output \hideinitializer */ -#define PA11 GPIO_PIN_DATA(0, 11) /*!< Specify PA.11 Pin Data Input/Output \hideinitializer */ -#define PA12 GPIO_PIN_DATA(0, 12) /*!< Specify PA.12 Pin Data Input/Output \hideinitializer */ -#define PA13 GPIO_PIN_DATA(0, 13) /*!< Specify PA.13 Pin Data Input/Output \hideinitializer */ -#define PA14 GPIO_PIN_DATA(0, 14) /*!< Specify PA.14 Pin Data Input/Output \hideinitializer */ -#define PA15 GPIO_PIN_DATA(0, 15) /*!< Specify PA.15 Pin Data Input/Output \hideinitializer */ -#define PB0 GPIO_PIN_DATA(1, 0 ) /*!< Specify PB.0 Pin Data Input/Output \hideinitializer */ -#define PB1 GPIO_PIN_DATA(1, 1 ) /*!< Specify PB.1 Pin Data Input/Output \hideinitializer */ -#define PB2 GPIO_PIN_DATA(1, 2 ) /*!< Specify PB.2 Pin Data Input/Output \hideinitializer */ -#define PB3 GPIO_PIN_DATA(1, 3 ) /*!< Specify PB.3 Pin Data Input/Output \hideinitializer */ -#define PB4 GPIO_PIN_DATA(1, 4 ) /*!< Specify PB.4 Pin Data Input/Output \hideinitializer */ -#define PB5 GPIO_PIN_DATA(1, 5 ) /*!< Specify PB.5 Pin Data Input/Output \hideinitializer */ -#define PB6 GPIO_PIN_DATA(1, 6 ) /*!< Specify PB.6 Pin Data Input/Output \hideinitializer */ -#define PB7 GPIO_PIN_DATA(1, 7 ) /*!< Specify PB.7 Pin Data Input/Output \hideinitializer */ -#define PB8 GPIO_PIN_DATA(1, 8 ) /*!< Specify PB.8 Pin Data Input/Output \hideinitializer */ -#define PB9 GPIO_PIN_DATA(1, 9 ) /*!< Specify PB.9 Pin Data Input/Output \hideinitializer */ -#define PB10 GPIO_PIN_DATA(1, 10) /*!< Specify PB.10 Pin Data Input/Output \hideinitializer */ -#define PB11 GPIO_PIN_DATA(1, 11) /*!< Specify PB.11 Pin Data Input/Output \hideinitializer */ -#define PB12 GPIO_PIN_DATA(1, 12) /*!< Specify PB.12 Pin Data Input/Output \hideinitializer */ -#define PB13 GPIO_PIN_DATA(1, 13) /*!< Specify PB.13 Pin Data Input/Output \hideinitializer */ -#define PB14 GPIO_PIN_DATA(1, 14) /*!< Specify PB.14 Pin Data Input/Output \hideinitializer */ -#define PB15 GPIO_PIN_DATA(1, 15) /*!< Specify PB.15 Pin Data Input/Output \hideinitializer */ -#define PC0 GPIO_PIN_DATA(2, 0 ) /*!< Specify PC.0 Pin Data Input/Output \hideinitializer */ -#define PC1 GPIO_PIN_DATA(2, 1 ) /*!< Specify PC.1 Pin Data Input/Output \hideinitializer */ -#define PC2 GPIO_PIN_DATA(2, 2 ) /*!< Specify PC.2 Pin Data Input/Output \hideinitializer */ -#define PC3 GPIO_PIN_DATA(2, 3 ) /*!< Specify PC.3 Pin Data Input/Output \hideinitializer */ -#define PC4 GPIO_PIN_DATA(2, 4 ) /*!< Specify PC.4 Pin Data Input/Output \hideinitializer */ -#define PC5 GPIO_PIN_DATA(2, 5 ) /*!< Specify PC.5 Pin Data Input/Output \hideinitializer */ -#define PC6 GPIO_PIN_DATA(2, 6 ) /*!< Specify PC.6 Pin Data Input/Output \hideinitializer */ -#define PC7 GPIO_PIN_DATA(2, 7 ) /*!< Specify PC.7 Pin Data Input/Output \hideinitializer */ -#define PC8 GPIO_PIN_DATA(2, 8 ) /*!< Specify PC.8 Pin Data Input/Output \hideinitializer */ -#define PC9 GPIO_PIN_DATA(2, 9 ) /*!< Specify PC.9 Pin Data Input/Output \hideinitializer */ -#define PC10 GPIO_PIN_DATA(2, 10) /*!< Specify PC.10 Pin Data Input/Output \hideinitializer */ -#define PC11 GPIO_PIN_DATA(2, 11) /*!< Specify PC.11 Pin Data Input/Output \hideinitializer */ -#define PC12 GPIO_PIN_DATA(2, 12) /*!< Specify PC.12 Pin Data Input/Output \hideinitializer */ -#define PC13 GPIO_PIN_DATA(2, 13) /*!< Specify PC.13 Pin Data Input/Output \hideinitializer */ -#define PC14 GPIO_PIN_DATA(2, 14) /*!< Specify PC.14 Pin Data Input/Output \hideinitializer */ -#define PC15 GPIO_PIN_DATA(2, 15) /*!< Specify PC.15 Pin Data Input/Output \hideinitializer */ -#define PD0 GPIO_PIN_DATA(3, 0 ) /*!< Specify PD.0 Pin Data Input/Output \hideinitializer */ -#define PD1 GPIO_PIN_DATA(3, 1 ) /*!< Specify PD.1 Pin Data Input/Output \hideinitializer */ -#define PD2 GPIO_PIN_DATA(3, 2 ) /*!< Specify PD.2 Pin Data Input/Output \hideinitializer */ -#define PD3 GPIO_PIN_DATA(3, 3 ) /*!< Specify PD.3 Pin Data Input/Output \hideinitializer */ -#define PD4 GPIO_PIN_DATA(3, 4 ) /*!< Specify PD.4 Pin Data Input/Output \hideinitializer */ -#define PD5 GPIO_PIN_DATA(3, 5 ) /*!< Specify PD.5 Pin Data Input/Output \hideinitializer */ -#define PD6 GPIO_PIN_DATA(3, 6 ) /*!< Specify PD.6 Pin Data Input/Output \hideinitializer */ -#define PD7 GPIO_PIN_DATA(3, 7 ) /*!< Specify PD.7 Pin Data Input/Output \hideinitializer */ -#define PD8 GPIO_PIN_DATA(3, 8 ) /*!< Specify PD.8 Pin Data Input/Output \hideinitializer */ -#define PD9 GPIO_PIN_DATA(3, 9 ) /*!< Specify PD.9 Pin Data Input/Output \hideinitializer */ -#define PD10 GPIO_PIN_DATA(3, 10) /*!< Specify PD.10 Pin Data Input/Output \hideinitializer */ -#define PD11 GPIO_PIN_DATA(3, 11) /*!< Specify PD.11 Pin Data Input/Output \hideinitializer */ -#define PD12 GPIO_PIN_DATA(3, 12) /*!< Specify PD.12 Pin Data Input/Output \hideinitializer */ -#define PD13 GPIO_PIN_DATA(3, 13) /*!< Specify PD.13 Pin Data Input/Output \hideinitializer */ -#define PD14 GPIO_PIN_DATA(3, 14) /*!< Specify PD.14 Pin Data Input/Output \hideinitializer */ -#define PE0 GPIO_PIN_DATA(4, 0 ) /*!< Specify PE.0 Pin Data Input/Output \hideinitializer */ -#define PE1 GPIO_PIN_DATA(4, 1 ) /*!< Specify PE.1 Pin Data Input/Output \hideinitializer */ -#define PE2 GPIO_PIN_DATA(4, 2 ) /*!< Specify PE.2 Pin Data Input/Output \hideinitializer */ -#define PE3 GPIO_PIN_DATA(4, 3 ) /*!< Specify PE.3 Pin Data Input/Output \hideinitializer */ -#define PE4 GPIO_PIN_DATA(4, 4 ) /*!< Specify PE.4 Pin Data Input/Output \hideinitializer */ -#define PE5 GPIO_PIN_DATA(4, 5 ) /*!< Specify PE.5 Pin Data Input/Output \hideinitializer */ -#define PE6 GPIO_PIN_DATA(4, 6 ) /*!< Specify PE.6 Pin Data Input/Output \hideinitializer */ -#define PE7 GPIO_PIN_DATA(4, 7 ) /*!< Specify PE.7 Pin Data Input/Output \hideinitializer */ -#define PE8 GPIO_PIN_DATA(4, 8 ) /*!< Specify PE.8 Pin Data Input/Output \hideinitializer */ -#define PE9 GPIO_PIN_DATA(4, 9 ) /*!< Specify PE.9 Pin Data Input/Output \hideinitializer */ -#define PE10 GPIO_PIN_DATA(4, 10) /*!< Specify PE.10 Pin Data Input/Output \hideinitializer */ -#define PE11 GPIO_PIN_DATA(4, 11) /*!< Specify PE.11 Pin Data Input/Output \hideinitializer */ -#define PE12 GPIO_PIN_DATA(4, 12) /*!< Specify PE.12 Pin Data Input/Output \hideinitializer */ -#define PE13 GPIO_PIN_DATA(4, 13) /*!< Specify PE.13 Pin Data Input/Output \hideinitializer */ -#define PE14 GPIO_PIN_DATA(4, 14) /*!< Specify PE.14 Pin Data Input/Output \hideinitializer */ -#define PE15 GPIO_PIN_DATA(4, 15) /*!< Specify PE.15 Pin Data Input/Output \hideinitializer */ -#define PF0 GPIO_PIN_DATA(5, 0 ) /*!< Specify PF.0 Pin Data Input/Output \hideinitializer */ -#define PF1 GPIO_PIN_DATA(5, 1 ) /*!< Specify PF.1 Pin Data Input/Output \hideinitializer */ -#define PF2 GPIO_PIN_DATA(5, 2 ) /*!< Specify PF.2 Pin Data Input/Output \hideinitializer */ -#define PF3 GPIO_PIN_DATA(5, 3 ) /*!< Specify PF.3 Pin Data Input/Output \hideinitializer */ -#define PF4 GPIO_PIN_DATA(5, 4 ) /*!< Specify PF.4 Pin Data Input/Output \hideinitializer */ -#define PF5 GPIO_PIN_DATA(5, 5 ) /*!< Specify PF.5 Pin Data Input/Output \hideinitializer */ -#define PF6 GPIO_PIN_DATA(5, 6 ) /*!< Specify PF.6 Pin Data Input/Output \hideinitializer */ -#define PF7 GPIO_PIN_DATA(5, 7 ) /*!< Specify PF.7 Pin Data Input/Output \hideinitializer */ -#define PF8 GPIO_PIN_DATA(5, 8 ) /*!< Specify PF.8 Pin Data Input/Output \hideinitializer */ -#define PF9 GPIO_PIN_DATA(5, 9 ) /*!< Specify PF.9 Pin Data Input/Output \hideinitializer */ -#define PF10 GPIO_PIN_DATA(5, 10) /*!< Specify PF.10 Pin Data Input/Output \hideinitializer */ -#define PF11 GPIO_PIN_DATA(5, 11) /*!< Specify PF.11 Pin Data Input/Output \hideinitializer */ -#define PG0 GPIO_PIN_DATA(6, 0 ) /*!< Specify PG.0 Pin Data Input/Output \hideinitializer */ -#define PG1 GPIO_PIN_DATA(6, 1 ) /*!< Specify PG.1 Pin Data Input/Output \hideinitializer */ -#define PG2 GPIO_PIN_DATA(6, 2 ) /*!< Specify PG.2 Pin Data Input/Output \hideinitializer */ -#define PG3 GPIO_PIN_DATA(6, 3 ) /*!< Specify PG.3 Pin Data Input/Output \hideinitializer */ -#define PG4 GPIO_PIN_DATA(6, 4 ) /*!< Specify PG.4 Pin Data Input/Output \hideinitializer */ -#define PG5 GPIO_PIN_DATA(6, 5 ) /*!< Specify PG.5 Pin Data Input/Output \hideinitializer */ -#define PG6 GPIO_PIN_DATA(6, 6 ) /*!< Specify PG.6 Pin Data Input/Output \hideinitializer */ -#define PG7 GPIO_PIN_DATA(6, 7 ) /*!< Specify PG.7 Pin Data Input/Output \hideinitializer */ -#define PG8 GPIO_PIN_DATA(6, 8 ) /*!< Specify PG.8 Pin Data Input/Output \hideinitializer */ -#define PG9 GPIO_PIN_DATA(6, 9 ) /*!< Specify PG.9 Pin Data Input/Output \hideinitializer */ -#define PG10 GPIO_PIN_DATA(6, 10) /*!< Specify PG.10 Pin Data Input/Output \hideinitializer */ -#define PG11 GPIO_PIN_DATA(6, 11) /*!< Specify PG.11 Pin Data Input/Output \hideinitializer */ -#define PG12 GPIO_PIN_DATA(6, 12) /*!< Specify PG.12 Pin Data Input/Output \hideinitializer */ -#define PG13 GPIO_PIN_DATA(6, 13) /*!< Specify PG.13 Pin Data Input/Output \hideinitializer */ -#define PG14 GPIO_PIN_DATA(6, 14) /*!< Specify PG.14 Pin Data Input/Output \hideinitializer */ -#define PG15 GPIO_PIN_DATA(6, 15) /*!< Specify PG.15 Pin Data Input/Output \hideinitializer */ -#define PH0 GPIO_PIN_DATA(7, 0 ) /*!< Specify PH.0 Pin Data Input/Output \hideinitializer */ -#define PH1 GPIO_PIN_DATA(7, 1 ) /*!< Specify PH.1 Pin Data Input/Output \hideinitializer */ -#define PH2 GPIO_PIN_DATA(7, 2 ) /*!< Specify PH.2 Pin Data Input/Output \hideinitializer */ -#define PH3 GPIO_PIN_DATA(7, 3 ) /*!< Specify PH.3 Pin Data Input/Output \hideinitializer */ -#define PH4 GPIO_PIN_DATA(7, 4 ) /*!< Specify PH.4 Pin Data Input/Output \hideinitializer */ -#define PH5 GPIO_PIN_DATA(7, 5 ) /*!< Specify PH.5 Pin Data Input/Output \hideinitializer */ -#define PH6 GPIO_PIN_DATA(7, 6 ) /*!< Specify PH.6 Pin Data Input/Output \hideinitializer */ -#define PH7 GPIO_PIN_DATA(7, 7 ) /*!< Specify PH.7 Pin Data Input/Output \hideinitializer */ -#define PH8 GPIO_PIN_DATA(7, 8 ) /*!< Specify PH.8 Pin Data Input/Output \hideinitializer */ -#define PH9 GPIO_PIN_DATA(7, 9 ) /*!< Specify PH.9 Pin Data Input/Output \hideinitializer */ -#define PH10 GPIO_PIN_DATA(7, 10) /*!< Specify PH.10 Pin Data Input/Output \hideinitializer */ -#define PH11 GPIO_PIN_DATA(7, 11) /*!< Specify PH.11 Pin Data Input/Output \hideinitializer */ - - -/*@}*/ /* end of group GPIO_EXPORTED_CONSTANTS */ - - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Clear GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Clear the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_CLR_INT_FLAG(port, u32PinMask) ((port)->INTSRC = (u32PinMask)) - -/** - * @brief Disable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask)) - -/** - * @brief Enable Pin De-bounce Function - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * @return None - * - * @details Enable the interrupt de-bounce function of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask)) - -/** - * @brief Disable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16)) - -/** - * @brief Enable I/O Digital Input Path - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Enable I/O digital input path of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16)) - -/** - * @brief Disable I/O DOUT mask - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Disable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask)) - -/** - * @brief Enable I/O DOUT mask - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @return None - * - * @details Enable I/O DOUT mask of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask)) - -/** - * @brief Get GPIO Pin Interrupt Flag - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * - * @retval 0 No interrupt at specified GPIO pin - * @retval 1 The specified GPIO pin generate an interrupt - * - * @details Get the interrupt status of specified GPIO pin. - * \hideinitializer - */ -#define GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask)) - -/** - * @brief Set De-bounce Sampling Cycle Time - * - * @param[in] u32ClkSrc The de-bounce counter clock source. It could be GPIO_DBCTL_DBCLKSRC_HCLK or GPIO_DBCTL_DBCLKSRC_LIRC. - * @param[in] u32ClkSel The de-bounce sampling cycle selection. It could be - * - \ref GPIO_DBCTL_DBCLKSEL_1 - * - \ref GPIO_DBCTL_DBCLKSEL_2 - * - \ref GPIO_DBCTL_DBCLKSEL_4 - * - \ref GPIO_DBCTL_DBCLKSEL_8 - * - \ref GPIO_DBCTL_DBCLKSEL_16 - * - \ref GPIO_DBCTL_DBCLKSEL_32 - * - \ref GPIO_DBCTL_DBCLKSEL_64 - * - \ref GPIO_DBCTL_DBCLKSEL_128 - * - \ref GPIO_DBCTL_DBCLKSEL_256 - * - \ref GPIO_DBCTL_DBCLKSEL_512 - * - \ref GPIO_DBCTL_DBCLKSEL_1024 - * - \ref GPIO_DBCTL_DBCLKSEL_2048 - * - \ref GPIO_DBCTL_DBCLKSEL_4096 - * - \ref GPIO_DBCTL_DBCLKSEL_8192 - * - \ref GPIO_DBCTL_DBCLKSEL_16384 - * - \ref GPIO_DBCTL_DBCLKSEL_32768 - * - * @return None - * - * @details Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source. \n - * Example: _GPIO_SET_DEBOUNCE_TIME(GPIO_DBCTL_DBCLKSRC_LIRC, GPIO_DBCTL_DBCLKSEL_4). \n - * It's meaning the De-debounce counter clock source is internal 10 KHz and sampling cycle selection is 4. \n - * Then the target de-bounce sampling cycle time is (4)*(1/(10*1000)) s = 4*0.0001 s = 400 us, - * and system will sampling interrupt input once per 00 us. - * \hideinitializer - */ -#define GPIO_SET_DEBOUNCE_TIME(u32ClkSrc, u32ClkSel) (GPIO->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) - -/** - * @brief Get GPIO Port IN Data - * -* @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * - * @return The specified port data - * - * @details Get the PIN register of specified GPIO port. - * \hideinitializer - */ -#define GPIO_GET_IN_DATA(port) ((port)->PIN) - -/** - * @brief Set GPIO Port OUT Data - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Data GPIO port data. - * - * @return None - * - * @details Set the Data into specified GPIO port. - * \hideinitializer - */ -#define GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data)) - -/** - * @brief Toggle Specified GPIO pin - * - * @param[in] u32Pin Pxy - * - * @return None - * - * @details Toggle the specified GPIO pint. - * \hideinitializer - */ -#define GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1) - - -/** - * @brief Enable External GPIO interrupt - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be \n - * GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_EnableEINT GPIO_EnableInt - -/** - * @brief Disable External GPIO interrupt - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - * \hideinitializer - */ -#define GPIO_DisableEINT GPIO_DisableInt - - -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs); -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin); -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode); - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __GPIO_H__ */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2c.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2c.h deleted file mode 100644 index 800d409f71e..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2c.h +++ /dev/null @@ -1,541 +0,0 @@ -/****************************************************************************//** - * @file i2c.h - * @version V1.00 - * @brief NUC980 series I2C driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_I2C_H__ -#define __NU_I2C_H__ - -#include -#include -#include -#include "nuc980.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - -/** @addtogroup I2C_EXPORTED_CONSTANTS I2C Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C_CTL constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_CTL_STA_SI 0x28UL /*!< I2C_CTL setting for I2C control bits. It would set STA and SI bits \hideinitializer */ -#define I2C_CTL_STA_SI_AA 0x2CUL /*!< I2C_CTL setting for I2C control bits. It would set STA, SI and AA bits \hideinitializer */ -#define I2C_CTL_STO_SI 0x18UL /*!< I2C_CTL setting for I2C control bits. It would set STO and SI bits \hideinitializer */ -#define I2C_CTL_STO_SI_AA 0x1CUL /*!< I2C_CTL setting for I2C control bits. It would set STO, SI and AA bits \hideinitializer */ -#define I2C_CTL_SI 0x08UL /*!< I2C_CTL setting for I2C control bits. It would set SI bit \hideinitializer */ -#define I2C_CTL_SI_AA 0x0CUL /*!< I2C_CTL setting for I2C control bits. It would set SI and AA bits \hideinitializer */ -#define I2C_CTL_STA 0x20UL /*!< I2C_CTL setting for I2C control bits. It would set STA bit \hideinitializer */ -#define I2C_CTL_STO 0x10UL /*!< I2C_CTL setting for I2C control bits. It would set STO bit \hideinitializer */ -#define I2C_CTL_AA 0x04UL /*!< I2C_CTL setting for I2C control bits. It would set AA bit \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* I2C GCMode constant definitions. */ -/*---------------------------------------------------------------------------------------------------------*/ -#define I2C_GCMODE_ENABLE 1 /*!< Enable I2C GC Mode \hideinitializer */ -#define I2C_GCMODE_DISABLE 0 /*!< Disable I2C GC Mode \hideinitializer */ - -/*@}*/ /* end of group I2C_EXPORTED_CONSTANTS */ - -typedef struct -{ - volatile uint32_t CTL0; /*!< [0x0000] I2C Control Register 0 */ - volatile uint32_t ADDR0; /*!< [0x0004] I2C Slave Address Register0 */ - volatile uint32_t DAT; /*!< [0x0008] I2C Data Register */ - volatile uint32_t STATUS0; /*!< [0x000c] I2C Status Register 0 */ - volatile uint32_t CLKDIV; /*!< [0x0010] I2C Clock Divided Register */ - volatile uint32_t TOCTL; /*!< [0x0014] I2C Time-out Control Register */ - volatile uint32_t ADDR1; /*!< [0x0018] I2C Slave Address Register1 */ - volatile uint32_t ADDR2; /*!< [0x001c] I2C Slave Address Register2 */ - volatile uint32_t ADDR3; /*!< [0x0020] I2C Slave Address Register3 */ - volatile uint32_t ADDRMSK0; /*!< [0x0024] I2C Slave Address Mask Register0 */ - volatile uint32_t ADDRMSK1; /*!< [0x0028] I2C Slave Address Mask Register1 */ - volatile uint32_t ADDRMSK2; /*!< [0x002c] I2C Slave Address Mask Register2 */ - volatile uint32_t ADDRMSK3; /*!< [0x0030] I2C Slave Address Mask Register3 */ - volatile uint32_t RESERVE0[2]; - volatile uint32_t WKCTL; /*!< [0x003c] I2C Wake-up Control Register */ - volatile uint32_t WKSTS; /*!< [0x0040] I2C Wake-up Status Register */ - volatile uint32_t CTL1; /*!< [0x0044] I2C Control Register 1 */ - volatile uint32_t STATUS1; /*!< [0x0048] I2C Status Register 1 */ - volatile uint32_t TMCTL; /*!< [0x004c] I2C Timing Configure Control Register */ - volatile uint32_t BUSCTL; /*!< [0x0050] I2C Bus Management Control Register */ - volatile uint32_t BUSTCTL; /*!< [0x0054] I2C Bus Management Timer Control Register */ - volatile uint32_t BUSSTS; /*!< [0x0058] I2C Bus Management Status Register */ - volatile uint32_t PKTSIZE; /*!< [0x005c] I2C Packet Error Checking Byte Number Register */ - volatile uint32_t PKTCRC; /*!< [0x0060] I2C Packet Error Checking Byte Value Register */ - volatile uint32_t BUSTOUT; /*!< [0x0064] I2C Bus Management Timer Register */ - volatile uint32_t CLKTOUT; /*!< [0x0068] I2C Bus Management Clock Low Timer Register */ - -} I2C_T; - -#define I2C_CTL0_AA_Pos (2) /*!< I2C_T::CTL: AA Position */ -#define I2C_CTL0_AA_Msk (0x1ul << I2C_CTL0_AA_Pos) /*!< I2C_T::CTL: AA Mask */ - -#define I2C_CTL0_SI_Pos (3) /*!< I2C_T::CTL: SI Position */ -#define I2C_CTL0_SI_Msk (0x1ul << I2C_CTL0_SI_Pos) /*!< I2C_T::CTL: SI Mask */ - -#define I2C_CTL0_STO_Pos (4) /*!< I2C_T::CTL: STO Position */ -#define I2C_CTL0_STO_Msk (0x1ul << I2C_CTL0_STO_Pos) /*!< I2C_T::CTL: STO Mask */ - -#define I2C_CTL0_STA_Pos (5) /*!< I2C_T::CTL: STA Position */ -#define I2C_CTL0_STA_Msk (0x1ul << I2C_CTL0_STA_Pos) /*!< I2C_T::CTL: STA Mask */ - -#define I2C_CTL0_I2CEN_Pos (6) /*!< I2C_T::CTL: I2CEN Position */ -#define I2C_CTL0_I2CEN_Msk (0x1ul << I2C_CTL0_I2CEN_Pos) /*!< I2C_T::CTL: I2CEN Mask */ - -#define I2C_CTL0_INTEN_Pos (7) /*!< I2C_T::CTL: INTEN Position */ -#define I2C_CTL0_INTEN_Msk (0x1ul << I2C_CTL0_INTEN_Pos) /*!< I2C_T::CTL: INTEN Mask */ - -#define I2C_ADDR0_GC_Pos (0) /*!< I2C_T::ADDR0: GC Position */ -#define I2C_ADDR0_GC_Msk (0x1ul << I2C_ADDR0_GC_Pos) /*!< I2C_T::ADDR0: GC Mask */ - -#define I2C_ADDR0_ADDR_Pos (1) /*!< I2C_T::ADDR0: ADDR Position */ -#define I2C_ADDR0_ADDR_Msk (0x3fful << I2C_ADDR0_ADDR_Pos) /*!< I2C_T::ADDR0: ADDR Mask */ - -#define I2C_DAT_DAT_Pos (0) /*!< I2C_T::DAT: DAT Position */ -#define I2C_DAT_DAT_Msk (0xfful << I2C_DAT_DAT_Pos) /*!< I2C_T::DAT: DAT Mask */ - -#define I2C_STATUS0_STATUS_Pos (0) /*!< I2C_T::STATUS: STATUS Position */ -#define I2C_STATUS0_STATUS_Msk (0xfful << I2C_STATUS_STATUS0_Pos) /*!< I2C_T::STATUS: STATUS Mask */ - -#define I2C_CLKDIV_DIVIDER_Pos (0) /*!< I2C_T::CLKDIV: DIVIDER Position */ -#define I2C_CLKDIV_DIVIDER_Msk (0x3fful << I2C_CLKDIV_DIVIDER_Pos) /*!< I2C_T::CLKDIV: DIVIDER Mask */ - -#define I2C_TOCTL_TOIF_Pos (0) /*!< I2C_T::TOCTL: TOIF Position */ -#define I2C_TOCTL_TOIF_Msk (0x1ul << I2C_TOCTL_TOIF_Pos) /*!< I2C_T::TOCTL: TOIF Mask */ - -#define I2C_TOCTL_TOCDIV4_Pos (1) /*!< I2C_T::TOCTL: TOCDIV4 Position */ -#define I2C_TOCTL_TOCDIV4_Msk (0x1ul << I2C_TOCTL_TOCDIV4_Pos) /*!< I2C_T::TOCTL: TOCDIV4 Mask */ - -#define I2C_TOCTL_TOCEN_Pos (2) /*!< I2C_T::TOCTL: TOCEN Position */ -#define I2C_TOCTL_TOCEN_Msk (0x1ul << I2C_TOCTL_TOCEN_Pos) /*!< I2C_T::TOCTL: TOCEN Mask */ - -#define I2C_ADDR1_GC_Pos (0) /*!< I2C_T::ADDR1: GC Position */ -#define I2C_ADDR1_GC_Msk (0x1ul << I2C_ADDR1_GC_Pos) /*!< I2C_T::ADDR1: GC Mask */ - -#define I2C_ADDR1_ADDR_Pos (1) /*!< I2C_T::ADDR1: ADDR Position */ -#define I2C_ADDR1_ADDR_Msk (0x3fful << I2C_ADDR1_ADDR_Pos) /*!< I2C_T::ADDR1: ADDR Mask */ - -#define I2C_ADDR2_GC_Pos (0) /*!< I2C_T::ADDR2: GC Position */ -#define I2C_ADDR2_GC_Msk (0x1ul << I2C_ADDR2_GC_Pos) /*!< I2C_T::ADDR2: GC Mask */ - -#define I2C_ADDR2_ADDR_Pos (1) /*!< I2C_T::ADDR2: ADDR Position */ -#define I2C_ADDR2_ADDR_Msk (0x3fful << I2C_ADDR2_ADDR_Pos) /*!< I2C_T::ADDR2: ADDR Mask */ - -#define I2C_ADDR3_GC_Pos (0) /*!< I2C_T::ADDR3: GC Position */ -#define I2C_ADDR3_GC_Msk (0x1ul << I2C_ADDR3_GC_Pos) /*!< I2C_T::ADDR3: GC Mask */ - -#define I2C_ADDR3_ADDR_Pos (1) /*!< I2C_T::ADDR3: ADDR Position */ -#define I2C_ADDR3_ADDR_Msk (0x3fful << I2C_ADDR3_ADDR_Pos) /*!< I2C_T::ADDR3: ADDR Mask */ - -#define I2C_ADDRMSK0_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK0: ADDRMSK Position */ -#define I2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK0_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK0: ADDRMSK Mask */ - -#define I2C_ADDRMSK1_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK1: ADDRMSK Position */ -#define I2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK1_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK1: ADDRMSK Mask */ - -#define I2C_ADDRMSK2_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK2: ADDRMSK Position */ -#define I2C_ADDRMSK2_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK2_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK2: ADDRMSK Mask */ - -#define I2C_ADDRMSK3_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK3: ADDRMSK Position */ -#define I2C_ADDRMSK3_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK3_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK3: ADDRMSK Mask */ - -#define I2C_WKCTL_WKEN_Pos (0) /*!< I2C_T::WKCTL: WKEN Position */ -#define I2C_WKCTL_WKEN_Msk (0x1ul << I2C_WKCTL_WKEN_Pos) /*!< I2C_T::WKCTL: WKEN Mask */ - -#define I2C_WKCTL_NHDBUSEN_Pos (7) /*!< I2C_T::WKCTL: NHDBUSEN Position */ -#define I2C_WKCTL_NHDBUSEN_Msk (0x1ul << I2C_WKCTL_NHDBUSEN_Pos) /*!< I2C_T::WKCTL: NHDBUSEN Mask */ - -#define I2C_WKSTS_WKIF_Pos (0) /*!< I2C_T::WKSTS: WKIF Position */ -#define I2C_WKSTS_WKIF_Msk (0x1ul << I2C_WKSTS_WKIF_Pos) /*!< I2C_T::WKSTS: WKIF Mask */ - -#define I2C_WKSTS_WKAKDONE_Pos (1) /*!< I2C_T::WKSTS: WKAKDONE Position */ -#define I2C_WKSTS_WKAKDONE_Msk (0x1ul << I2C_WKSTS_WKAKDONE_Pos) /*!< I2C_T::WKSTS: WKAKDONE Mask */ - -#define I2C_WKSTS_WRSTSWK_Pos (2) /*!< I2C_T::WKSTS: WRSTSWK Position */ -#define I2C_WKSTS_WRSTSWK_Msk (0x1ul << I2C_WKSTS_WRSTSWK_Pos) /*!< I2C_T::WKSTS: WRSTSWK Mask */ - -#define I2C_CTL1_TXPDMAEN_Pos (0) /*!< I2C_T::CTL1: TXPDMAEN Position */ -#define I2C_CTL1_TXPDMAEN_Msk (0x1ul << I2C_CTL1_TXPDMAEN_Pos) /*!< I2C_T::CTL1: TXPDMAEN Mask */ - -#define I2C_CTL1_RXPDMAEN_Pos (1) /*!< I2C_T::CTL1: RXPDMAEN Position */ -#define I2C_CTL1_RXPDMAEN_Msk (0x1ul << I2C_CTL1_RXPDMAEN_Pos) /*!< I2C_T::CTL1: RXPDMAEN Mask */ - -#define I2C_CTL1_PDMARST_Pos (2) /*!< I2C_T::CTL1: PDMARST Position */ -#define I2C_CTL1_PDMARST_Msk (0x1ul << I2C_CTL1_PDMARST_Pos) /*!< I2C_T::CTL1: PDMARST Mask */ - -#define I2C_CTL1_PDMASTR_Pos (8) /*!< I2C_T::CTL1: PDMASTR Position */ -#define I2C_CTL1_PDMASTR_Msk (0x1ul << I2C_CTL1_PDMASTR_Pos) /*!< I2C_T::CTL1: PDMASTR Mask */ - -#define I2C_CTL1_ADDR10EN_Pos (9) /*!< I2C_T::CTL1: ADDR10EN Position */ -#define I2C_CTL1_ADDR10EN_Msk (0x1ul << I2C_CTL1_ADDR10EN_Pos) /*!< I2C_T::CTL1: ADDR10EN Mask */ - -#define I2C_STATUS1_ADMAT0_Pos (0) /*!< I2C_T::STATUS1: ADMAT0 Position */ -#define I2C_STATUS1_ADMAT0_Msk (0x1ul << I2C_STATUS1_ADMAT0_Pos) /*!< I2C_T::STATUS1: ADMAT0 Mask */ - -#define I2C_STATUS1_ADMAT1_Pos (1) /*!< I2C_T::STATUS1: ADMAT1 Position */ -#define I2C_STATUS1_ADMAT1_Msk (0x1ul << I2C_STATUS1_ADMAT1_Pos) /*!< I2C_T::STATUS1: ADMAT1 Mask */ - -#define I2C_STATUS1_ADMAT2_Pos (2) /*!< I2C_T::STATUS1: ADMAT2 Position */ -#define I2C_STATUS1_ADMAT2_Msk (0x1ul << I2C_STATUS1_ADMAT2_Pos) /*!< I2C_T::STATUS1: ADMAT2 Mask */ - -#define I2C_STATUS1_ADMAT3_Pos (3) /*!< I2C_T::STATUS1: ADMAT3 Position */ -#define I2C_STATUS1_ADMAT3_Msk (0x1ul << I2C_STATUS1_ADMAT3_Pos) /*!< I2C_T::STATUS1: ADMAT3 Mask */ - -#define I2C_STATUS1_ONBUSY_Pos (8) /*!< I2C_T::STATUS1: ONBUSY Position */ -#define I2C_STATUS1_ONBUSY_Msk (0x1ul << I2C_STATUS1_ONBUSY_Pos) /*!< I2C_T::STATUS1: ONBUSY Mask */ - -#define I2C_TMCTL_STCTL_Pos (0) /*!< I2C_T::TMCTL: STCTL Position */ -#define I2C_TMCTL_STCTL_Msk (0x1fful << I2C_TMCTL_STCTL_Pos) /*!< I2C_T::TMCTL: STCTL Mask */ - -#define I2C_TMCTL_HTCTL_Pos (16) /*!< I2C_T::TMCTL: HTCTL Position */ -#define I2C_TMCTL_HTCTL_Msk (0x1fful << I2C_TMCTL_HTCTL_Pos) /*!< I2C_T::TMCTL: HTCTL Mask */ - -#define I2C_BUSCTL_ACKMEN_Pos (0) /*!< I2C_T::BUSCTL: ACKMEN Position */ -#define I2C_BUSCTL_ACKMEN_Msk (0x1ul << I2C_BUSCTL_ACKMEN_Pos) /*!< I2C_T::BUSCTL: ACKMEN Mask */ - -#define I2C_BUSCTL_PECEN_Pos (1) /*!< I2C_T::BUSCTL: PECEN Position */ -#define I2C_BUSCTL_PECEN_Msk (0x1ul << I2C_BUSCTL_PECEN_Pos) /*!< I2C_T::BUSCTL: PECEN Mask */ - -#define I2C_BUSCTL_BMDEN_Pos (2) /*!< I2C_T::BUSCTL: BMDEN Position */ -#define I2C_BUSCTL_BMDEN_Msk (0x1ul << I2C_BUSCTL_BMDEN_Pos) /*!< I2C_T::BUSCTL: BMDEN Mask */ - -#define I2C_BUSCTL_BMHEN_Pos (3) /*!< I2C_T::BUSCTL: BMHEN Position */ -#define I2C_BUSCTL_BMHEN_Msk (0x1ul << I2C_BUSCTL_BMHEN_Pos) /*!< I2C_T::BUSCTL: BMHEN Mask */ - -#define I2C_BUSCTL_ALERTEN_Pos (4) /*!< I2C_T::BUSCTL: ALERTEN Position */ -#define I2C_BUSCTL_ALERTEN_Msk (0x1ul << I2C_BUSCTL_ALERTEN_Pos) /*!< I2C_T::BUSCTL: ALERTEN Mask */ - -#define I2C_BUSCTL_SCTLOSTS_Pos (5) /*!< I2C_T::BUSCTL: SCTLOSTS Position */ -#define I2C_BUSCTL_SCTLOSTS_Msk (0x1ul << I2C_BUSCTL_SCTLOSTS_Pos) /*!< I2C_T::BUSCTL: SCTLOSTS Mask */ - -#define I2C_BUSCTL_SCTLOEN_Pos (6) /*!< I2C_T::BUSCTL: SCTLOEN Position */ -#define I2C_BUSCTL_SCTLOEN_Msk (0x1ul << I2C_BUSCTL_SCTLOEN_Pos) /*!< I2C_T::BUSCTL: SCTLOEN Mask */ - -#define I2C_BUSCTL_BUSEN_Pos (7) /*!< I2C_T::BUSCTL: BUSEN Position */ -#define I2C_BUSCTL_BUSEN_Msk (0x1ul << I2C_BUSCTL_BUSEN_Pos) /*!< I2C_T::BUSCTL: BUSEN Mask */ - -#define I2C_BUSCTL_PECTXEN_Pos (8) /*!< I2C_T::BUSCTL: PECTXEN Position */ -#define I2C_BUSCTL_PECTXEN_Msk (0x1ul << I2C_BUSCTL_PECTXEN_Pos) /*!< I2C_T::BUSCTL: PECTXEN Mask */ - -#define I2C_BUSCTL_TIDLE_Pos (9) /*!< I2C_T::BUSCTL: TIDLE Position */ -#define I2C_BUSCTL_TIDLE_Msk (0x1ul << I2C_BUSCTL_TIDLE_Pos) /*!< I2C_T::BUSCTL: TIDLE Mask */ - -#define I2C_BUSCTL_PECCLR_Pos (10) /*!< I2C_T::BUSCTL: PECCLR Position */ -#define I2C_BUSCTL_PECCLR_Msk (0x1ul << I2C_BUSCTL_PECCLR_Pos) /*!< I2C_T::BUSCTL: PECCLR Mask */ - -#define I2C_BUSCTL_ACKM9SI_Pos (11) /*!< I2C_T::BUSCTL: ACKM9SI Position */ -#define I2C_BUSCTL_ACKM9SI_Msk (0x1ul << I2C_BUSCTL_ACKM9SI_Pos) /*!< I2C_T::BUSCTL: ACKM9SI Mask */ - -#define I2C_BUSCTL_BCDIEN_Pos (12) /*!< I2C_T::BUSCTL: BCDIEN Position */ -#define I2C_BUSCTL_BCDIEN_Msk (0x1ul << I2C_BUSCTL_BCDIEN_Pos) /*!< I2C_T::BUSCTL: BCDIEN Mask */ - -#define I2C_BUSCTL_PECDIEN_Pos (13) /*!< I2C_T::BUSCTL: PECDIEN Position */ -#define I2C_BUSCTL_PECDIEN_Msk (0x1ul << I2C_BUSCTL_PECDIEN_Pos) /*!< I2C_T::BUSCTL: PECDIEN Mask */ - -#define I2C_BUSTCTL_BUSTOEN_Pos (0) /*!< I2C_T::BUSTCTL: BUSTOEN Position */ -#define I2C_BUSTCTL_BUSTOEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOEN Mask */ - -#define I2C_BUSTCTL_CLKTOEN_Pos (1) /*!< I2C_T::BUSTCTL: CLKTOEN Position */ -#define I2C_BUSTCTL_CLKTOEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOEN Mask */ - -#define I2C_BUSTCTL_BUSTOIEN_Pos (2) /*!< I2C_T::BUSTCTL: BUSTOIEN Position */ -#define I2C_BUSTCTL_BUSTOIEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOIEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOIEN Mask */ - -#define I2C_BUSTCTL_CLKTOIEN_Pos (3) /*!< I2C_T::BUSTCTL: CLKTOIEN Position */ -#define I2C_BUSTCTL_CLKTOIEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOIEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOIEN Mask */ - -#define I2C_BUSTCTL_TORSTEN_Pos (4) /*!< I2C_T::BUSTCTL: TORSTEN Position */ -#define I2C_BUSTCTL_TORSTEN_Msk (0x1ul << I2C_BUSTCTL_TORSTEN_Pos) /*!< I2C_T::BUSTCTL: TORSTEN Mask */ - -#define I2C_BUSSTS_BUSY_Pos (0) /*!< I2C_T::BUSSTS: BUSY Position */ -#define I2C_BUSSTS_BUSY_Msk (0x1ul << I2C_BUSSTS_BUSY_Pos) /*!< I2C_T::BUSSTS: BUSY Mask */ - -#define I2C_BUSSTS_BCDONE_Pos (1) /*!< I2C_T::BUSSTS: BCDONE Position */ -#define I2C_BUSSTS_BCDONE_Msk (0x1ul << I2C_BUSSTS_BCDONE_Pos) /*!< I2C_T::BUSSTS: BCDONE Mask */ - -#define I2C_BUSSTS_PECERR_Pos (2) /*!< I2C_T::BUSSTS: PECERR Position */ -#define I2C_BUSSTS_PECERR_Msk (0x1ul << I2C_BUSSTS_PECERR_Pos) /*!< I2C_T::BUSSTS: PECERR Mask */ - -#define I2C_BUSSTS_ALERT_Pos (3) /*!< I2C_T::BUSSTS: ALERT Position */ -#define I2C_BUSSTS_ALERT_Msk (0x1ul << I2C_BUSSTS_ALERT_Pos) /*!< I2C_T::BUSSTS: ALERT Mask */ - -#define I2C_BUSSTS_SCTLDIN_Pos (4) /*!< I2C_T::BUSSTS: SCTLDIN Position */ -#define I2C_BUSSTS_SCTLDIN_Msk (0x1ul << I2C_BUSSTS_SCTLDIN_Pos) /*!< I2C_T::BUSSTS: SCTLDIN Mask */ - -#define I2C_BUSSTS_BUSTO_Pos (5) /*!< I2C_T::BUSSTS: BUSTO Position */ -#define I2C_BUSSTS_BUSTO_Msk (0x1ul << I2C_BUSSTS_BUSTO_Pos) /*!< I2C_T::BUSSTS: BUSTO Mask */ - -#define I2C_BUSSTS_CLKTO_Pos (6) /*!< I2C_T::BUSSTS: CLKTO Position */ -#define I2C_BUSSTS_CLKTO_Msk (0x1ul << I2C_BUSSTS_CLKTO_Pos) /*!< I2C_T::BUSSTS: CLKTO Mask */ - -#define I2C_BUSSTS_PECDONE_Pos (7) /*!< I2C_T::BUSSTS: PECDONE Position */ -#define I2C_BUSSTS_PECDONE_Msk (0x1ul << I2C_BUSSTS_PECDONE_Pos) /*!< I2C_T::BUSSTS: PECDONE Mask */ - -#define I2C_PKTSIZE_PLDSIZE_Pos (0) /*!< I2C_T::PKTSIZE: PLDSIZE Position */ -#define I2C_PKTSIZE_PLDSIZE_Msk (0x1fful << I2C_PKTSIZE_PLDSIZE_Pos) /*!< I2C_T::PKTSIZE: PLDSIZE Mask */ - -#define I2C_PKTCRC_PECCRC_Pos (0) /*!< I2C_T::PKTCRC: PECCRC Position */ -#define I2C_PKTCRC_PECCRC_Msk (0xfful << I2C_PKTCRC_PECCRC_Pos) /*!< I2C_T::PKTCRC: PECCRC Mask */ - -#define I2C_BUSTOUT_BUSTO_Pos (0) /*!< I2C_T::BUSTOUT: BUSTO Position */ -#define I2C_BUSTOUT_BUSTO_Msk (0xfful << I2C_BUSTOUT_BUSTO_Pos) /*!< I2C_T::BUSTOUT: BUSTO Mask */ - -#define I2C_CLKTOUT_CLKTO_Pos (0) /*!< I2C_T::CLKTOUT: CLKTO Position */ -#define I2C_CLKTOUT_CLKTO_Msk (0xfful << I2C_CLKTOUT_CLKTO_Pos) /*!< I2C_T::CLKTOUT: CLKTO Mask */ - - -#define I2C0 ((I2C_T *) I2C0_BA) -#define I2C1 ((I2C_T *) I2C1_BA) -#define I2C2 ((I2C_T *) I2C2_BA) -#define I2C3 ((I2C_T *) I2C3_BA) - - - - - - - - - - - - - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ -/** - * @brief The macro is used to set I2C bus condition at One Time - * - * @param[in] i2c Specify I2C port - * @param[in] u8Ctrl A byte writes to I2C control register - * - * @return None - * - * @details Set I2C_CTL register to control I2C bus conditions of START, STOP, SI, ACK. - * \hideinitializer - */ -#define I2C_SET_CONTROL_REG(i2c, u8Ctrl) ((i2c)->CTL0 = ((i2c)->CTL0 & ~0x3c) | (u8Ctrl)) - -/** - * @brief The macro is used to set START condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus START condition in I2C_CTL register. - * \hideinitializer - */ -#define I2C_START(i2c) ((i2c)->CTL0 = ((i2c)->CTL0 & ~I2C_CTL0_SI_Msk) | I2C_CTL0_STA_Msk) - -/** - * @brief The macro is used to wait I2C bus status get ready - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When a new status is presented of I2C bus, the SI flag will be set in I2C_CTL register. - * \hideinitializer - */ -#define I2C_WAIT_READY(i2c) while(!((i2c)->CTL0 & I2C_CTL0_SI_Msk)) - -/** - * @brief The macro is used to Read I2C Bus Data Register - * - * @param[in] i2c Specify I2C port - * - * @return A byte of I2C data register - * - * @details I2C controller read data from bus and save it in I2CDAT register. - * \hideinitializer - */ -#define I2C_GET_DATA(i2c) ((i2c)->DAT) - -/** - * @brief Write a Data to I2C Data Register - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data A byte that writes to data register - * - * @return None - * - * @details When write a data to I2C_DAT register, the I2C controller will shift it to I2C bus. - * \hideinitializer - */ -#define I2C_SET_DATA(i2c, u8Data) ((i2c)->DAT = (u8Data)) - -/** - * @brief Get I2C Bus status code - * - * @param[in] i2c Specify I2C port - * - * @return I2C status code - * - * @details To get this status code to monitor I2C bus event. - * \hideinitializer - */ -#define I2C_GET_STATUS(i2c) ((i2c)->STATUS0) - -/** - * @brief Get Time-out flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 I2C Bus time-out is not happened - * @retval 1 I2C Bus time-out is happened - * - * @details When I2C bus occurs time-out event, the time-out flag will be set. - * \hideinitializer - */ -#define I2C_GET_TIMEOUT_FLAG(i2c) ( ((i2c)->TOCTL & I2C_TOCTL_TOIF_Msk) == I2C_TOCTL_TOIF_Msk ? 1:0 ) - -/** - * @brief To get wake-up flag from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @retval 0 Chip is not woken-up from power-down mode - * @retval 1 Chip is woken-up from power-down mode - * - * @details I2C bus occurs wake-up event, wake-up flag will be set. - * \hideinitializer - */ -#define I2C_GET_WAKEUP_FLAG(i2c) ( ((i2c)->WKSTS & I2C_WKSTS_WKIF_Msk) == I2C_WKSTS_WKIF_Msk ? 1:0 ) - -/** - * @brief To clear wake-up flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details If wake-up flag is set, use this macro to clear it. - * \hideinitializer - */ -#define I2C_CLEAR_WAKEUP_FLAG(i2c) ((i2c)->WKSTS = I2C_WKSTS_WKIF_Msk) - -/** - * @brief Enable RX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set RXPDMAEN bit of I2C_CTL1 register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_RX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Enable TX PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Set TXPDMAEN bit of I2C_CTL1 register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_ENABLE_TX_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear RXPDMAEN bit of I2C_CTL1 register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_RX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_RXPDMAEN_Msk) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Clear TXPDMAEN bit of I2C_CTL1 register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define I2C_DISABLE_TX_PDMA(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_TXPDMAEN_Msk) - -/** - * @brief Enable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details Enable this function is to stretch bus by hardware after PDMA transfer is done if SI is not cleared. - * \hideinitializer - */ -#define I2C_ENABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Disable PDMA stretch function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C will send STOP after PDMA transfers done automatically. - * \hideinitializer - */ -#define I2C_DISABLE_PDMA_STRETCH(i2c) ((i2c)->CTL1 &= ~I2C_CTL1_PDMASTR_Msk) - -/** - * @brief Reset PDMA function. - * @param[in] i2c The pointer of the specified I2C module. - * @return None. - * @details I2C PDMA engine will be reset after this function is called. - * \hideinitializer - */ -#define I2C_DISABLE_RST_PDMA(i2c) ((i2c)->CTL1 |= I2C_CTL1_PDMARST_Msk) - -/*---------------------------------------------------------------------------------------------------------*/ -/* inline functions */ -/*---------------------------------------------------------------------------------------------------------*/ - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -void I2C_STOP(I2C_T *i2c); - -void I2C_ClearTimeoutFlag(I2C_T *i2c); -void I2C_Close(I2C_T *i2c); -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack); -void I2C_DisableInt(I2C_T *i2c); -void I2C_EnableInt(I2C_T *i2c); -uint32_t I2C_GetBusClockFreq(I2C_T *i2c); -uint32_t I2C_GetIntFlag(I2C_T *i2c); -uint32_t I2C_GetStatus(I2C_T *i2c); -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock); -uint8_t I2C_GetData(I2C_T *i2c); -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode); -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask); -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock); -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout); -void I2C_DisableTimeout(I2C_T *i2c); -void I2C_EnableWakeup(I2C_T *i2c); -void I2C_DisableWakeup(I2C_T *i2c); -void I2C_SetData(I2C_T *i2c, uint8_t u8Data); -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data); -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data); -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen); -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr); -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr); -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen); -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr); -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen); - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#endif - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2s.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2s.h deleted file mode 100644 index 7215fd4b4f0..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_i2s.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************//** -* @file i2s.h -* @version V1.00 -* $Revision: 2 $ -* $Date: 18/08/05 2:12p $ -* @brief I2S driver header file -* -* @note - * SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#ifndef __NU_I2S_H__ -#define __NU_I2S_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ - -#define I2S_ERR_BUSY -1 /*!< Interface is busy */ -#define I2S_ERR_IO -2 /*!< IO contril error */ - -#define I2S_DISABLE 0 /*!< Enable I2S */ -#define I2S_ENABLE 1 /*!< Disable I2S */ - -#define I2S_PLAY 0 /*!< Play I2S audio */ -#define I2S_REC 1 /*!< Reocrd I2S audio */ - -#define PCM_PLAY 0 /*!< Play PCM audio */ -#define PCM_REC 1 /*!< Record PCM audio */ - -#define I2S_SET_PLAY 0 /*!< Start or stop to play */ -#define I2S_START_PLAY 0 /*!< Start to play */ -#define I2S_STOP_PLAY 1 /*!< Stop to play */ - -#define I2S_SET_RECORD 1 /*!< Start or stop to record */ -#define I2S_START_REC 0 /*!< Start to record */ -#define I2S_STOP_REC 1 /*!< Stop to record */ - -#define I2S_SELECT_BLOCK 2 /*!< Select block function */ -#define I2S_BLOCK_I2S 0 /*!< Select I2S function */ -#define I2S_BLOCK_PCM 1 /*!< Select PCM function */ - -#define I2S_SELECT_BIT 3 /*!< Select data bit width */ -#define I2S_BIT_WIDTH_8 0 /*!< 8-bit */ -#define I2S_BIT_WIDTH_16 1 /*!< 16-bit */ -#define I2S_BIT_WIDTH_24 2 /*!< 24-bit */ - -#define I2S_SET_PLAY_DMA_INT_SEL 4 /*!< Select play DMA interrupt request */ -#define I2S_SET_REC_DMA_INT_SEL 5 /*!< Select record DMA interrupt request */ -#define I2S_DMA_INT_END 0 /*!< End of buffer */ -#define I2S_DMA_INT_HALF 1 /*!< Half of buffer */ -#define I2S_DMA_INT_QUARTER 2 /*!< Quarter of buffer */ -#define I2S_DMA_INT_EIGHTH 3 /*!< Eighth of buffer */ - -#define I2S_SET_ZEROCROSS 6 /*!< Enable or disable zero cross function */ -#define I2S_SET_DMACOUNTER 7 /*!< Enable or disable DMA counter function */ - -#define I2S_SET_CHANNEL 8 /*!< Set channel number */ -#define I2S_CHANNEL_P_I2S_ONE 2 /*!< I2S one channel */ -#define I2S_CHANNEL_P_I2S_TWO 3 /*!< I2S two channels */ -#define I2S_CHANNEL_P_PCM_TWO 3 /*!< PCM two slots */ -#define I2S_CHANNEL_P_PCM_TWO_SLOT1 0 /*!< PCM two slots with all slot1 data */ -#define I2S_CHANNEL_P_PCM_TWO_SLOT0 1 /*!< PCM two slots with all slot0 data */ -#define I2S_CHANNEL_P_PCM_ONE_SLOT0 2 /*!< PCM one slot with all slot0 data */ - -#define I2S_CHANNEL_R_I2S_LEFT_PCM_SLOT0 1 /*!< I2S left channel or PCM slot0 */ -#define I2S_CHANNEL_R_I2S_RIGHT_PCM_SLOT1 2 /*!< I2S right channel or PCM slot1 */ -#define I2S_CHANNEL_R_I2S_TWO 3 /*!< I2S two channels */ - -#define I2S_SET_MODE 9 /*!< Select master or slave mode */ -#define I2S_MODE_MASTER 0 /*!< master mode */ -#define I2S_MODE_SLAVE 1 /*!< slave mode */ - -#define I2S_SET_SPLITDATA 10 /*!< Enable or disable split data function */ -#define I2S_SET_DMA_ADDRESS 11 /*!< Set DMA address */ -#define I2S_SET_DMA_LENGTH 12 /*!< Set DMA length */ -#define I2S_GET_DMA_CUR_ADDRESS 13 /*!< Get current DMA address */ - -#define I2S_SET_I2S_FORMAT 14 /*!< Select I2S format */ -#define I2S_FORMAT_I2S 0 /*!< I2S format */ -#define I2S_FORMAT_MSB 1 /*!< MSB foramt */ - -#define I2S_SET_I2S_CALLBACKFUN 15 /*!< Install play or record call-back function */ - -#define I2S_SET_PCMSLOT 16 /*!< Set PCM interface start position of slot */ -#define PCM_SLOT1_IN 0 /*!< Slot-1 in position */ -#define PCM_SLOT1_OUT 1 /*!< Slot-1 out position */ -#define PCM_SLOT2_IN 2 /*!< Slot-2 in position */ -#define PCM_SLOT2_OUT 3 /*!< Slot-2 out position */ - -#define I2S_SET_PCM_FS_PERIOD 17 /*!< Set PCM FS pulse period */ - -/*@}*/ /* end of group ARM9_I2S_EXPORTED_CONSTANTS */ - -/** @addtogroup ARM9_I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -int32_t i2sOpen(void); -void i2sClose(void); -void i2sInit(void); -int32_t i2sIoctl(uint32_t cmd, uint32_t arg0, uint32_t arg1); -void i2sSetSampleRate(uint32_t u32SourceClockRate, uint32_t u32SampleRate, uint32_t u32DataBit, uint32_t u32Channel); -void i2sSetMCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32SampleRate); -void i2sSetPCMBCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32Rate); - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_I2S_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pdma.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pdma.h deleted file mode 100644 index 2253359ae8e..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pdma.h +++ /dev/null @@ -1,1249 +0,0 @@ -/**************************************************************************//** - * @file pdma.h - * @brief PDMA driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PDMA_H__ -#define __NU_PDMA_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup PDMA Peripheral Direct Memory Access Controller(PDMA) - Memory Mapped Structure for PDMA Controller -@{ */ - - -typedef struct -{ - - /** - * @var DSCT_T::CTL - * Offset: 0x00 Descriptor Table Control Register of PDMA Channel n. - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |OPMODE |PDMA Operation Mode Selection - * | | |00 = Idle state: Channel is stopped or this table is complete, when PDMA finish channel table task, OPMODE will be cleared to idle state automatically. - * | | |01 = Basic mode: The descriptor table only has one task - * | | |When this task is finished, the PDMA_INTSTS[n] will be asserted. - * | | |10 = Scatter-Gather mode: When operating in this mode, user must give the next descriptor table address in PDMA_DSCT_NEXT register; PDMA controller will ignore this task, then load the next task to execute. - * | | |11 = Reserved. - * | | |Note: Before filling transfer task in the Descriptor Table, user must check if the descriptor table is complete. - * |[2] |TXTYPE |Transfer Type - * | | |0 = Burst transfer type. - * | | |1 = Single transfer type. - * |[6:4] |BURSIZE |Burst Size - * | | |This field is used for peripheral to determine the burst size or used for determine the re-arbitration size. - * | | |000 = 128 Transfers. - * | | |001 = 64 Transfers. - * | | |010 = 32 Transfers. - * | | |011 = 16 Transfers. - * | | |100 = 8 Transfers. - * | | |101 = 4 Transfers. - * | | |110 = 2 Transfers. - * | | |111 = 1 Transfers. - * | | |Note: This field is only useful in burst transfer type. - * |[7] |TBINTDIS |Table Interrupt Disable Bit - * | | |This field can be used to decide whether to enable table interrupt or not - * | | |If the TBINTDIS bit is enabled when PDMA controller finishes transfer task, it will not generates transfer done interrupt. - * | | |0 = Table interrupt Enabled. - * | | |1 = Table interrupt Disabled. - * |[9:8] |SAINC |Source Address Increment - * | | |This field is used to set the source address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * |[11:10] |DAINC |Destination Address Increment - * | | |This field is used to set the destination address increment size. - * | | |11 = No increment (fixed address). - * | | |Others = Increment and size is depended on TXWIDTH selection. - * |[13:12] |TXWIDTH |Transfer Width Selection - * | | |This field is used for transfer width. - * | | |00 = One byte (8 bit) is transferred for every operation. - * | | |01= One half-word (16 bit) is transferred for every operation. - * | | |10 = One word (32-bit) is transferred for every operation. - * | | |11 = Reserved. - * | | |Note: The PDMA transfer source address (PDMA_DSCT_SA) and PDMA transfer destination address (PDMA_DSCT_DA) should be alignment under the TXWIDTH selection - * |[14] |TXACK |Transfer Acknowledge Selection - * | | |0 = transfer ack when transfer done. - * | | |1 = transfer ack when PDMA get transfer data. - * |[15] |STRIDEEN |Stride Mode Enable Bit - * | | |0 = Stride transfer mode Disabled. - * | | |1 = Stride transfer mode Enabled. - * |[31:16] |TXCNT |Transfer Count - * | | |The TXCNT represents the required number of PDMA transfer, the real transfer count is (TXCNT + 1); The maximum transfer count is 65536 , every transfer may be byte, half-word or word that is dependent on TXWIDTH field. - * | | |Note: When PDMA finish each transfer data, this field will be decrease immediately. - * @var DSCT_T::SA - * Offset: 0x04 Source Address Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |SA |PDMA Transfer Source Address Register - * | | |This field indicates a 32-bit source address of PDMA controller. - * @var DSCT_T::DA - * Offset: 0x08 Destination Address Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |DA |PDMA Transfer Destination Address Register - * | | |This field indicates a 32-bit destination address of PDMA controller. - * @var DSCT_T::NEXT - * Offset: 0x0C Next Scatter-Gather Descriptor Table Offset Address of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |EXENEXT |PDMA Execution Next Descriptor Table Offset - * | | |This field indicates the offset of next descriptor table address of current execution descriptor table in system memory. - * | | |Note: write operation is useless in this field. - * |[31:16] |NEXT |PDMA Next Descriptor Table Offset. - * | | |This field indicates the offset of the next descriptor table address in system memory. - * | | |Write Operation: - * | | |If the system memory based address is 0x2000_0000 (PDMA_SCATBA), and the next descriptor table is start from 0x2000_0100, then this field must fill in 0x0100. - * | | |Read Operation: - * | | |When operating in scatter-gather mode, the last two bits NEXT[1:0] will become reserved, and indicate the first next address of system memory. - * | | |Note1: The descriptor table address must be word boundary. - * | | |Note2: Before filled transfer task in the descriptor table, user must check if the descriptor table is complete. - */ - __IO uint32_t CTL; /*!< [0x0000] Descriptor Table Control Register of PDMA Channel n. */ - __IO uint32_t SA; /*!< [0x0004] Source Address Register of PDMA Channel n */ - __IO uint32_t DA; /*!< [0x0008] Destination Address Register of PDMA Channel n */ - __IO uint32_t NEXT; /*!< [0x000c] First Scatter-Gather Descriptor Table Offset Address of PDMA Channel n */ -} DSCT_T; - - -typedef struct -{ - /** - * @var STRIDE_T::STCR - * Offset: 0x500 Stride Transfer Count Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |STC |PDMA Stride Transfer Count - * | | |The 16-bit register defines the stride transfer count of each row. - * @var STRIDE_T::ASOCR - * Offset: 0x504 Address Stride Offset Register of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SASOL |VDMA Source Address Stride Offset Length - * | | |The 16-bit register defines the source address stride transfer offset count of each row. - * |[31:16] |DASOL |VDMA Destination Address Stride Offset Length - * | | |The 16-bit register defines the destination address stride transfer offset count of each row. - */ - __IO uint32_t STCR; /*!< [0x0500] Stride Transfer Count Register of PDMA Channel 0 */ - __IO uint32_t ASOCR; /*!< [0x0504] Address Stride Offset Register of PDMA Channel 0 */ -} STRIDE_T; - -typedef struct -{ - - - /** - * @var PDMA_T::CURSCAT - * Offset: 0x100 Current Scatter-Gather Descriptor Table Address of PDMA Channel n - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |CURADDR |PDMA Current Description Address Register (Read Only) - * | | |This field indicates a 32-bit current external description address of PDMA controller. - * | | |Note: This field is read only and only used for Scatter-Gather mode to indicate the current external description address. - * @var PDMA_T::CHCTL - * Offset: 0x400 PDMA Channel Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CHENn |PDMA Channel Enable Bit - * | | |Set this bit to 1 to enable PDMAn operation. Channel cannot be active if it is not set as enabled. - * | | |0 = PDMA channel [n] Disabled. - * | | |1 = PDMA channel [n] Enabled. - * | | |Note: Set corresponding bit of PDMA_PAUSE or PDMA_CHRST register will also clear this bit. - * @var PDMA_T::PAUSE - * Offset: 0x404 PDMA Transfer Stop Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |PAUSEn |PDMA Transfer Pause Control Register (Write Only) - * | | |User can set PAUSEn bit field to pause the PDMA transfer - * | | |When user sets PAUSEn bit, the PDMA controller will pause the on-going transfer, then clear the channel enable bit CHEN(PDMA_CHCTL [n], n=0,1..7) and clear request active flag - * | | |If re-enable the paused channel again, the remaining transfers will be processed. - * | | |0 = No effect. - * | | |1 = Pause PDMA channel n transfer. - * @var PDMA_T::SWREQ - * Offset: 0x408 PDMA Software Request Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |SWREQn |PDMA Software Request Register (Write Only) - * | | |Set this bit to 1 to generate a software request to PDMA [n]. - * | | |0 = No effect. - * | | |1 = Generate a software request. - * | | |Note1: User can read PDMA_TRGSTS register to know which channel is on active - * | | |Active flag may be triggered by software request or peripheral request. - * | | |Note2: If user does not enable corresponding PDMA channel, the software request will be ignored. - * @var PDMA_T::TRGSTS - * Offset: 0x40C PDMA Channel Request Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |REQSTSn |PDMA Channel Request Status (Read Only) - * | | |This flag indicates whether channel[n] have a request or not, no matter request from software or peripheral - * | | |When PDMA controller finishes channel transfer, this bit will be cleared automatically. - * | | |0 = PDMA Channel n has no request. - * | | |1 = PDMA Channel n has a request. - * | | |Note: If user pauses or resets each PDMA transfer by setting PDMA_PAUSE or PDMA_CHRST register respectively, this bit will be cleared automatically after finishing current transfer. - * @var PDMA_T::PRISET - * Offset: 0x410 PDMA Fixed Priority Setting Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FPRISETn |PDMA Fixed Priority Setting Register - * | | |Set this bit to 1 to enable fixed priority level. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set PDMA channel [n] to fixed priority channel. - * | | |Read Operation: - * | | |0 = Corresponding PDMA channel is round-robin priority. - * | | |1 = Corresponding PDMA channel is fixed priority. - * | | |Note: This field only set to fixed priority, clear fixed priority use PDMA_PRICLR register. - * @var PDMA_T::PRICLR - * Offset: 0x414 PDMA Fixed Priority Clear Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FPRICLRn |PDMA Fixed Priority Clear Register (Write Only) - * | | |Set this bit to 1 to clear fixed priority level. - * | | |0 = No effect. - * | | |1 = Clear PDMA channel [n] fixed priority setting. - * | | |Note: User can read PDMA_PRISET register to know the channel priority. - * @var PDMA_T::INTEN - * Offset: 0x418 PDMA Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |INTENn |PDMA Interrupt Enable Register - * | | |This field is used for enabling PDMA channel[n] interrupt. - * | | |0 = PDMA channel n interrupt Disabled. - * | | |1 = PDMA channel n interrupt Enabled. - * @var PDMA_T::INTSTS - * Offset: 0x41C PDMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABTIF |PDMA Read/Write Target Abort Interrupt Flag (Read-only) - * | | |This bit indicates that PDMA has target abort error; Software can read PDMA_ABTSTS register to find which channel has target abort error. - * | | |0 = No AHB bus ERROR response received. - * | | |1 = AHB bus ERROR response received. - * |[1] |TDIF |Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that PDMA controller has finished transmission; User can read PDMA_TDSTS register to indicate which channel finished transfer. - * | | |0 = Not finished yet. - * | | |1 = PDMA channel has finished transmission. - * |[2] |ALIGNF |Transfer Alignment Interrupt Flag (Read Only) - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * |[8] |REQTOF0 |Request Time-out Flag for Channel 0 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC0, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * |[9] |REQTOF1 |Request Time-out Flag for Channel 1 - * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC1, user can write 1 to clear these bits. - * | | |0 = No request time-out. - * | | |1 = Peripheral request time-out. - * @var PDMA_T::ABTSTS - * Offset: 0x420 PDMA Channel Read/Write Target Abort Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ABTIFn |PDMA Read/Write Target Abort Interrupt Status Flag - * | | |This bit indicates which PDMA controller has target abort error; User can write 1 to clear these bits. - * | | |0 = No AHB bus ERROR response received when channel n transfer. - * | | |1 = AHB bus ERROR response received when channel n transfer. - * @var PDMA_T::TDSTS - * Offset: 0x424 PDMA Channel Transfer Done Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TDIFn |Transfer Done Flag Register - * | | |This bit indicates whether PDMA controller channel transfer has been finished or not, user can write 1 to clear these bits. - * | | |0 = PDMA channel transfer has not finished. - * | | |1 = PDMA channel has finished transmission. - * @var PDMA_T::ALIGN - * Offset: 0x428 PDMA Transfer Alignment Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |ALIGNn |Transfer Alignment Flag Register - * | | |0 = PDMA channel source address and destination address both follow transfer width setting. - * | | |1 = PDMA channel source address or destination address is not follow transfer width setting. - * @var PDMA_T::TACTSTS - * Offset: 0x42C PDMA Transfer Active Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TXACTFn |Transfer on Active Flag Register (Read Only) - * | | |This bit indicates which PDMA channel is in active. - * | | |0 = PDMA channel is not finished. - * | | |1 = PDMA channel is active. - * @var PDMA_T::TOUTPSC - * Offset: 0x430 PDMA Time-out Prescaler Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[2:0] |TOUTPSC0 |PDMA Channel 0 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 0 time-out clock source is HCLK/28. - * | | |001 = PDMA channel 0 time-out clock source is HCLK/29. - * | | |010 = PDMA channel 0 time-out clock source is HCLK/210. - * | | |011 = PDMA channel 0 time-out clock source is HCLK/211. - * | | |100 = PDMA channel 0 time-out clock source is HCLK/212. - * | | |101 = PDMA channel 0 time-out clock source is HCLK/213. - * | | |110 = PDMA channel 0 time-out clock source is HCLK/214. - * | | |111 = PDMA channel 0 time-out clock source is HCLK/215. - * |[6:4] |TOUTPSC1 |PDMA Channel 1 Time-out Clock Source Prescaler Bits - * | | |000 = PDMA channel 1 time-out clock source is HCLK/28. - * | | |001 = PDMA channel 1 time-out clock source is HCLK/29. - * | | |010 = PDMA channel 1 time-out clock source is HCLK/210. - * | | |011 = PDMA channel 1 time-out clock source is HCLK/211. - * | | |100 = PDMA channel 1 time-out clock source is HCLK/212. - * | | |101 = PDMA channel 1 time-out clock source is HCLK/213. - * | | |110 = PDMA channel 1 time-out clock source is HCLK/214. - * | | |111 = PDMA channel 1 time-out clock source is HCLK/215. - * @var PDMA_T::TOUTEN - * Offset: 0x434 PDMA Time-out Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TOUTENn |PDMA Time-out Enable Bits - * | | |0 = PDMA Channel n time-out function Disable. - * | | |1 = PDMA Channel n time-out function Enable. - * @var PDMA_T::TOUTIEN - * Offset: 0x438 PDMA Time-out Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |TOUTIENn |PDMA Time-out Interrupt Enable Bits - * | | |0 = PDMA Channel n time-out interrupt Disable. - * | | |1 = PDMA Channel n time-out interrupt Enable. - * @var PDMA_T::SCATBA - * Offset: 0x43C PDMA Scatter-Gather Descriptor Table Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |SCATBA |PDMA Scatter-gather Descriptor Table Address Register - * | | |In Scatter-Gather mode, this is the base address for calculating the next link - list address - * | | |The next link address equation is - * | | |Next Link Address = PDMA_SCATBA + PDMA_DSCT_NEXT. - * | | |Note: Only useful in Scatter-Gather mode. - * @var PDMA_T::TOC0_1 - * Offset: 0x440 PDMA Time-out Counter Ch1 and Ch0 Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |TOC0 |Time-out Counter for Channel 0 - * | | |This controls the period of time-out function for channel 0 - * | | |The calculation unit is based on 10 kHz clock. - * |[31:16] |TOC1 |Time-out Counter for Channel 1 - * | | |This controls the period of time-out function for channel 1 - * | | |The calculation unit is based on 10 kHz clock. - * @var PDMA_T::CHRST - * Offset: 0x460 PDMA Channel Reset Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |CHnRST |Channel N Reset - * | | |0 = corresponding channel n not reset. - * | | |1 = corresponding channel n is reset. - * @var PDMA_T::REQSEL0_3 - * Offset: 0x480 PDMA Request Source Select Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC0 |Channel 0 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 0 - * | | |User can configure the peripheral by setting REQSRC0. - * | | |0 = Disable PDMA peripheral request. - * | | |1 = Reserved. - * | | |2 = Channel connects to USB_TX. - * | | |3 = Channel connects to USB_RX. - * | | |4 = Channel connects to UART0_TX. - * | | |5 = Channel connects to UART0_RX. - * | | |6 = Channel connects to UART1_TX. - * | | |7 = Channel connects to UART1_RX. - * | | |8 = Channel connects to UART2_TX. - * | | |9 = Channel connects to UART2_RX. - * | | |10=Channel connects to UART3_TX. - * | | |11 = Channel connects to UART3_RX. - * | | |12 = Channel connects to UART4_TX. - * | | |13 = Channel connects to UART4_RX. - * | | |14 = Channel connects to UART5_TX. - * | | |15 = Channel connects to UART5_RX. - * | | |16 = Channel connects to USCI0_TX. - * | | |17 = Channel connects to USCI0_RX. - * | | |18 = Channel connects to USCI1_TX. - * | | |19 = Channel connects to USCI1_RX. - * | | |20 = Channel connects to QSPI0_TX. - * | | |21 = Channel connects to QSPI0_RX. - * | | |22 = Channel connects to SPI0_TX. - * | | |23 = Channel connects to SPI0_RX. - * | | |24 = Channel connects to SPI1_TX. - * | | |25 = Channel connects to SPI1_RX. - * | | |26 = Channel connects to SPI2_TX. - * | | |27 = Channel connects to SPI2_RX. - * | | |28 = Channel connects to SPI3_TX. - * | | |29 = Channel connects to SPI3_RX. - * | | |30 = Reserved. - * | | |31 = Reserved. - * | | |32 = Channel connects to EPWM0_P1_RX. - * | | |33 = Channel connects to EPWM0_P2_RX. - * | | |34 = Channel connects to EPWM0_P3_RX. - * | | |35 = Channel connects to EPWM1_P1_RX. - * | | |36 = Channel connects to EPWM1_P2_RX. - * | | |37 = Channel connects to EPWM1_P3_RX. - * | | |38 = Channel connects to I2C0_TX. - * | | |39 = Channel connects to I2C0_RX. - * | | |40 = Channel connects to I2C1_TX. - * | | |41 = Channel connects to I2C1_RX. - * | | |42 = Channel connects to I2C2_TX. - * | | |43 = Channel connects to I2C2_RX. - * | | |44 = Channel connects to I2S0_TX. - * | | |45 = Channel connects to I2S0_RX. - * | | |46 = Channel connects to TMR0. - * | | |47 = Channel connects to TMR1. - * | | |48 = Channel connects to TMR2. - * | | |49 = Channel connects to TMR3. - * | | |50 = Channel connects to ADC_RX. - * | | |51 = Channel connects to DAC0_TX. - * | | |52 = Channel connects to DAC1_TX. - * | | |53 = Channel connects to EPWM0_CH0_TX. - * | | |54 = Channel connects to EPWM0_CH1_TX. - * | | |55 = Channel connects to EPWM0_CH2_TX. - * | | |56 = Channel connects to EPWM0_CH3_TX. - * | | |57 = Channel connects to EPWM0_CH4_TX. - * | | |58 = Channel connects to EPWM0_CH5_TX. - * | | |59 = Channel connects to EPWM1_CH0_TX. - * | | |60 = Channel connects to EPWM1_CH1_TX. - * | | |61 = Channel connects to EPWM1_CH2_TX. - * | | |62 = Channel connects to EPWM1_CH3_TX. - * | | |63 = Channel connects to EPWM1_CH4_TX. - * | | |64 = Channel connects to EPWM1_CH5_TX. - * | | |65 = Channel connects to ETMC_RX. - * | | |Others = Reserved. - * | | |Note 1: A peripheral can't assign to two channels at the same time. - * | | |Note 2: This field is useless when transfer between memory and memory. - * |[14:8] |REQSRC1 |Channel 1 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 1 - * | | |User can configure the peripheral setting by REQSRC1. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC2 |Channel 2 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 2 - * | | |User can configure the peripheral setting by REQSRC2. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC3 |Channel 3 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 3 - * | | |User can configure the peripheral setting by REQSRC3. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL4_7 - * Offset: 0x484 PDMA Request Source Select Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC4 |Channel 4 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 4 - * | | |User can configure the peripheral setting by REQSRC4. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[14:8] |REQSRC5 |Channel 5 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 5 - * | | |User can configure the peripheral setting by REQSRC5. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC6 |Channel 6 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 6 - * | | |User can configure the peripheral setting by REQSRC6. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC7 |Channel 7 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 7 - * | | |User can configure the peripheral setting by REQSRC7. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL8_11 - * Offset: 0x488 PDMA Request Source Select Register 2 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC8 |Channel 8 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 8 - * | | |User can configure the peripheral setting by REQSRC8. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[14:8] |REQSRC9 |Channel 9 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 9 - * | | |User can configure the peripheral setting by REQSRC9. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC10 |Channel 10 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 10 - * | | |User can configure the peripheral setting by REQSRC10. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC11 |Channel 11 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 11 - * | | |User can configure the peripheral setting by REQSRC11. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * @var PDMA_T::REQSEL12_15 - * Offset: 0x48C PDMA Request Source Select Register 3 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[6:0] |REQSRC12 |Channel 12 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 12 - * | | |User can configure the peripheral setting by REQSRC12. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[14:8] |REQSRC13 |Channel 13 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 13 - * | | |User can configure the peripheral setting by REQSRC13. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[22:16] |REQSRC14 |Channel 14 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 14 - * | | |User can configure the peripheral setting by REQSRC14. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - * |[30:24] |REQSRC15 |Channel 15 Request Source Selection - * | | |This filed defines which peripheral is connected to PDMA channel 15 - * | | |User can configure the peripheral setting by REQSRC15. - * | | |Note: The channel configuration is the same as REQSRC0 field - * | | |Please refer to the explanation of REQSRC0. - */ - DSCT_T DSCT[16]; - __I uint32_t CURSCAT[16]; /*!< [0x0100] Current Scatter-Gather Descriptor Table Address of PDMA Channel n */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[176]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CHCTL; /*!< [0x0400] PDMA Channel Control Register */ - __O uint32_t PAUSE; /*!< [0x0404] PDMA Transfer Pause Control Register */ - __O uint32_t SWREQ; /*!< [0x0408] PDMA Software Request Register */ - __I uint32_t TRGSTS; /*!< [0x040c] PDMA Channel Request Status Register */ - __IO uint32_t PRISET; /*!< [0x0410] PDMA Fixed Priority Setting Register */ - __O uint32_t PRICLR; /*!< [0x0414] PDMA Fixed Priority Clear Register */ - __IO uint32_t INTEN; /*!< [0x0418] PDMA Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x041c] PDMA Interrupt Status Register */ - __IO uint32_t ABTSTS; /*!< [0x0420] PDMA Channel Read/Write Target Abort Flag Register */ - __IO uint32_t TDSTS; /*!< [0x0424] PDMA Channel Transfer Done Flag Register */ - __IO uint32_t ALIGN; /*!< [0x0428] PDMA Transfer Alignment Status Register */ - __I uint32_t TACTSTS; /*!< [0x042c] PDMA Transfer Active Flag Register */ - __IO uint32_t TOUTPSC; /*!< [0x0430] PDMA Time-out Prescaler Register */ - __IO uint32_t TOUTEN; /*!< [0x0434] PDMA Time-out Enable Register */ - __IO uint32_t TOUTIEN; /*!< [0x0438] PDMA Time-out Interrupt Enable Register */ - __IO uint32_t SCATBA; /*!< [0x043c] PDMA Scatter-Gather Descriptor Table Base Address Register */ - __IO uint32_t TOC0_1; /*!< [0x0440] PDMA Time-out Counter Ch1 and Ch0 Register */ - __IO uint32_t TOC2_3; /*!< [0x0444] PDMA Time-out Counter Ch1 and Ch0 Register */ - __IO uint32_t TOC4_5; /*!< [0x0448] PDMA Time-out Counter Ch1 and Ch0 Register */ - __IO uint32_t TOC6_7; /*!< [0x044c] PDMA Time-out Counter Ch1 and Ch0 Register */ - __IO uint32_t TOC8_9; /*!< [0x0450] PDMA Time-out Counter Ch1 and Ch0 Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CHRST; /*!< [0x0460] PDMA Channel Reset Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE5[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t TOUTPSC2; /*!< [0x0470] PPDMA Time-out Prescaler Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[3]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t REQSEL0_3; /*!< [0x0480] PDMA Request Source Select Register 0 */ - __IO uint32_t REQSEL4_7; /*!< [0x0484] PDMA Request Source Select Register 1 */ - __IO uint32_t REQSEL8_11; /*!< [0x0488] PDMA Request Source Select Register 2 */ - __IO uint32_t REQSEL12_15; /*!< [0x048c] PDMA Request Source Select Register 3 */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE4[28]; - /// @endcond //HIDDEN_SYMBOLS - STRIDE_T STRIDE[6]; -} PDMA_T; - -/** - @addtogroup PDMA_CONST PDMA Bit Field Definition - Constant Definitions for PDMA Controller -@{ */ - -#define PDMA_DSCT_CTL_OPMODE_Pos (0) /*!< PDMA_T::DSCT_CTL: OPMODE Position */ -#define PDMA_DSCT_CTL_OPMODE_Msk (0x3ul << PDMA_DSCT_CTL_OPMODE_Pos) /*!< PDMA_T::DSCT_CTL: OPMODE Mask */ - -#define PDMA_DSCT_CTL_TXTYPE_Pos (2) /*!< PDMA_T::DSCT_CTL: TXTYPE Position */ -#define PDMA_DSCT_CTL_TXTYPE_Msk (0x1ul << PDMA_DSCT_CTL_TXTYPE_Pos) /*!< PDMA_T::DSCT_CTL: TXTYPE Mask */ - -#define PDMA_DSCT_CTL_BURSIZE_Pos (4) /*!< PDMA_T::DSCT_CTL: BURSIZE Position */ -#define PDMA_DSCT_CTL_BURSIZE_Msk (0x7ul << PDMA_DSCT_CTL_BURSIZE_Pos) /*!< PDMA_T::DSCT_CTL: BURSIZE Mask */ - -#define PDMA_DSCT_CTL_TBINTDIS_Pos (7) /*!< PDMA_T::DSCT_CTL: TBINTDIS Position */ -#define PDMA_DSCT_CTL_TBINTDIS_Msk (0x1ul << PDMA_DSCT_CTL_TBINTDIS_Pos) /*!< PDMA_T::DSCT_CTL: TBINTDIS Mask */ - -#define PDMA_DSCT_CTL_SAINC_Pos (8) /*!< PDMA_T::DSCT_CTL: SAINC Position */ -#define PDMA_DSCT_CTL_SAINC_Msk (0x3ul << PDMA_DSCT_CTL_SAINC_Pos) /*!< PDMA_T::DSCT_CTL: SAINC Mask */ - -#define PDMA_DSCT_CTL_DAINC_Pos (10) /*!< PDMA_T::DSCT_CTL: DAINC Position */ -#define PDMA_DSCT_CTL_DAINC_Msk (0x3ul << PDMA_DSCT_CTL_DAINC_Pos) /*!< PDMA_T::DSCT_CTL: DAINC Mask */ - -#define PDMA_DSCT_CTL_TXWIDTH_Pos (12) /*!< PDMA_T::DSCT_CTL: TXWIDTH Position */ -#define PDMA_DSCT_CTL_TXWIDTH_Msk (0x3ul << PDMA_DSCT_CTL_TXWIDTH_Pos) /*!< PDMA_T::DSCT_CTL: TXWIDTH Mask */ - -#define PDMA_DSCT_CTL_TXACK_Pos (14) /*!< PDMA_T::DSCT_CTL: TXACK Position */ -#define PDMA_DSCT_CTL_TXACK_Msk (0x1ul << PDMA_DSCT_CTL_TXACK_Pos) /*!< PDMA_T::DSCT_CTL: TXACK Mask */ - -#define PDMA_DSCT_CTL_STRIDEEN_Pos (15) /*!< PDMA_T::DSCT_CTL: STRIDEEN Position */ -#define PDMA_DSCT_CTL_STRIDEEN_Msk (0x1ul << PDMA_DSCT_CTL_STRIDEEN_Pos) /*!< PDMA_T::DSCT_CTL: STRIDEEN Mask */ - -#define PDMA_DSCT_CTL_TXCNT_Pos (16) /*!< PDMA_T::DSCT_CTL: TXCNT Position */ -#define PDMA_DSCT_CTL_TXCNT_Msk (0xfffful << PDMA_DSCT_CTL_TXCNT_Pos) /*!< PDMA_T::DSCT_CTL: TXCNT Mask */ - -#define PDMA_DSCT_SA_SA_Pos (0) /*!< PDMA_T::DSCT_SA: SA Position */ -#define PDMA_DSCT_SA_SA_Msk (0xfffffffful << PDMA_DSCT_SA_SA_Pos) /*!< PDMA_T::DSCT_SA: SA Mask */ - -#define PDMA_DSCT_DA_DA_Pos (0) /*!< PDMA_T::DSCT_DA: DA Position */ -#define PDMA_DSCT_DA_DA_Msk (0xfffffffful << PDMA_DSCT_DA_DA_Pos) /*!< PDMA_T::DSCT_DA: DA Mask */ - -#define PDMA_DSCT_NEXT_NEXT_Pos (0) /*!< PDMA_T::DSCT_NEXT: NEXT Position */ -#define PDMA_DSCT_NEXT_NEXT_Msk (0xfffful << PDMA_DSCT_NEXT_NEXT_Pos) /*!< PDMA_T::DSCT_NEXT: NEXT Mask */ - -#define PDMA_DSCT_NEXT_EXENEXT_Pos (16) /*!< PDMA_T::DSCT_FIRST: NEXT Position */ -#define PDMA_DSCT_NEXT_EXENEXT_Msk (0xfffful << PDMA_DSCT_NEXT_EXENEXT_Pos) /*!< PDMA_T::DSCT_FIRST: NEXT Mask */ - -#define PDMA_CURSCAT_CURADDR_Pos (0) /*!< PDMA_T::CURSCAT: CURADDR Position */ -#define PDMA_CURSCAT_CURADDR_Msk (0xfffffffful << PDMA_CURSCAT_CURADDR_Pos) /*!< PDMA_T::CURSCAT: CURADDR Mask */ - -#define PDMA_CHCTL_CHENn_Pos (0) /*!< PDMA_T::CHCTL: CHENn Position */ -#define PDMA_CHCTL_CHENn_Msk (0xfffful << PDMA_CHCTL_CHENn_Pos) /*!< PDMA_T::CHCTL: CHENn Mask */ - -#define PDMA_PAUSE_PAUSEn_Pos (0) /*!< PDMA_T::PAUSE: PAUSEn Position */ -#define PDMA_PAUSE_PAUSEn_Msk (0xfffful << PDMA_PAUSE_PAUSEn_Pos) /*!< PDMA_T::PAUSE: PAUSEn Mask */ - -#define PDMA_SWREQ_SWREQn_Pos (0) /*!< PDMA_T::SWREQ: SWREQn Position */ -#define PDMA_SWREQ_SWREQn_Msk (0xfffful << PDMA_SWREQ_SWREQn_Pos) /*!< PDMA_T::SWREQ: SWREQn Mask */ - -#define PDMA_TRGSTS_REQSTSn_Pos (0) /*!< PDMA_T::TRGSTS: REQSTSn Position */ -#define PDMA_TRGSTS_REQSTSn_Msk (0xfffful << PDMA_TRGSTS_REQSTSn_Pos) /*!< PDMA_T::TRGSTS: REQSTSn Mask */ - -#define PDMA_PRISET_FPRISETn_Pos (0) /*!< PDMA_T::PRISET: FPRISETn Position */ -#define PDMA_PRISET_FPRISETn_Msk (0xfffful << PDMA_PRISET_FPRISETn_Pos) /*!< PDMA_T::PRISET: FPRISETn Mask */ - -#define PDMA_PRICLR_FPRICLRn_Pos (0) /*!< PDMA_T::PRICLR: FPRICLRn Position */ -#define PDMA_PRICLR_FPRICLRn_Msk (0xfffful << PDMA_PRICLR_FPRICLRn_Pos) /*!< PDMA_T::PRICLR: FPRICLRn Mask */ - -#define PDMA_INTEN_INTENn_Pos (0) /*!< PDMA_T::INTEN: INTENn Position */ -#define PDMA_INTEN_INTENn_Msk (0xfffful << PDMA_INTEN_INTENn_Pos) /*!< PDMA_T::INTEN: INTENn Mask */ - -#define PDMA_INTSTS_ABTIF_Pos (0) /*!< PDMA_T::INTSTS: ABTIF Position */ -#define PDMA_INTSTS_ABTIF_Msk (0x1ul << PDMA_INTSTS_ABTIF_Pos) /*!< PDMA_T::INTSTS: ABTIF Mask */ - -#define PDMA_INTSTS_TDIF_Pos (1) /*!< PDMA_T::INTSTS: TDIF Position */ -#define PDMA_INTSTS_TDIF_Msk (0x1ul << PDMA_INTSTS_TDIF_Pos) /*!< PDMA_T::INTSTS: TDIF Mask */ - -#define PDMA_INTSTS_ALIGNF_Pos (2) /*!< PDMA_T::INTSTS: ALIGNF Position */ -#define PDMA_INTSTS_ALIGNF_Msk (0x1ul << PDMA_INTSTS_ALIGNF_Pos) /*!< PDMA_T::INTSTS: ALIGNF Mask */ - -#define PDMA_INTSTS_REQTOF0_Pos (8) /*!< PDMA_T::INTSTS: REQTOF0 Position */ -#define PDMA_INTSTS_REQTOF0_Msk (0x1ul << PDMA_INTSTS_REQTOF0_Pos) /*!< PDMA_T::INTSTS: REQTOF0 Mask */ -#define PDMA_INTSTS_REQTOFn_Msk (0x3FFul << PDMA_INTSTS_REQTOF0_Pos) /*!< PDMA_T::INTSTS: REQTOFX Mask */ - -#define PDMA_INTSTS_REQTOF1_Pos (9) /*!< PDMA_T::INTSTS: REQTOF1 Position */ -#define PDMA_INTSTS_REQTOF1_Msk (0x1ul << PDMA_INTSTS_REQTOF1_Pos) /*!< PDMA_T::INTSTS: REQTOF1 Mask */ - -#define PDMA_INTSTS_REQTOF2_Pos (10) /*!< PDMA_T::INTSTS: REQTOF2 Position */ -#define PDMA_INTSTS_REQTOF2_Msk (0x1ul << PDMA_INTSTS_REQTOF2_Pos) /*!< PDMA_T::INTSTS: REQTOF2 Mask */ - -#define PDMA_INTSTS_REQTOF3_Pos (11) /*!< PDMA_T::INTSTS: REQTOF3 Position */ -#define PDMA_INTSTS_REQTOF3_Msk (0x1ul << PDMA_INTSTS_REQTOF3_Pos) /*!< PDMA_T::INTSTS: REQTOF3 Mask */ - -#define PDMA_INTSTS_REQTOF4_Pos (12) /*!< PDMA_T::INTSTS: REQTOF4 Position */ -#define PDMA_INTSTS_REQTOF4_Msk (0x1ul << PDMA_INTSTS_REQTOF4_Pos) /*!< PDMA_T::INTSTS: REQTOF4 Mask */ - -#define PDMA_INTSTS_REQTOF5_Pos (13) /*!< PDMA_T::INTSTS: REQTOF5 Position */ -#define PDMA_INTSTS_REQTOF5_Msk (0x1ul << PDMA_INTSTS_REQTOF5_Pos) /*!< PDMA_T::INTSTS: REQTOF5 Mask */ - -#define PDMA_INTSTS_REQTOF6_Pos (14) /*!< PDMA_T::INTSTS: REQTOF6 Position */ -#define PDMA_INTSTS_REQTOF6_Msk (0x1ul << PDMA_INTSTS_REQTOF6_Pos) /*!< PDMA_T::INTSTS: REQTOF6 Mask */ - -#define PDMA_INTSTS_REQTOF7_Pos (15) /*!< PDMA_T::INTSTS: REQTOF7 Position */ -#define PDMA_INTSTS_REQTOF7_Msk (0x1ul << PDMA_INTSTS_REQTOF7_Pos) /*!< PDMA_T::INTSTS: REQTOF7 Mask */ - -#define PDMA_INTSTS_REQTOF8_Pos (16) /*!< PDMA_T::INTSTS: REQTOF8 Position */ -#define PDMA_INTSTS_REQTOF8_Msk (0x1ul << PDMA_INTSTS_REQTOF8_Pos) /*!< PDMA_T::INTSTS: REQTOF8 Mask */ - -#define PDMA_INTSTS_REQTOF9_Pos (17) /*!< PDMA_T::INTSTS: REQTOF9 Position */ -#define PDMA_INTSTS_REQTOF9_Msk (0x1ul << PDMA_INTSTS_REQTOF9_Pos) /*!< PDMA_T::INTSTS: REQTOF9 Mask */ - -#define PDMA_ABTSTS_ABTIF0_Pos (0) /*!< PDMA_T::ABTSTS: ABTIF0 Position */ -#define PDMA_ABTSTS_ABTIF0_Msk (0x1ul << PDMA_ABTSTS_ABTIF0_Pos) /*!< PDMA_T::ABTSTS: ABTIF0 Mask */ - -#define PDMA_ABTSTS_ABTIF1_Pos (1) /*!< PDMA_T::ABTSTS: ABTIF1 Position */ -#define PDMA_ABTSTS_ABTIF1_Msk (0x1ul << PDMA_ABTSTS_ABTIF1_Pos) /*!< PDMA_T::ABTSTS: ABTIF1 Mask */ - -#define PDMA_ABTSTS_ABTIF2_Pos (2) /*!< PDMA_T::ABTSTS: ABTIF2 Position */ -#define PDMA_ABTSTS_ABTIF2_Msk (0x1ul << PDMA_ABTSTS_ABTIF2_Pos) /*!< PDMA_T::ABTSTS: ABTIF2 Mask */ - -#define PDMA_ABTSTS_ABTIF3_Pos (3) /*!< PDMA_T::ABTSTS: ABTIF3 Position */ -#define PDMA_ABTSTS_ABTIF3_Msk (0x1ul << PDMA_ABTSTS_ABTIF3_Pos) /*!< PDMA_T::ABTSTS: ABTIF3 Mask */ - -#define PDMA_ABTSTS_ABTIF4_Pos (4) /*!< PDMA_T::ABTSTS: ABTIF4 Position */ -#define PDMA_ABTSTS_ABTIF4_Msk (0x1ul << PDMA_ABTSTS_ABTIF4_Pos) /*!< PDMA_T::ABTSTS: ABTIF4 Mask */ - -#define PDMA_ABTSTS_ABTIF5_Pos (5) /*!< PDMA_T::ABTSTS: ABTIF5 Position */ -#define PDMA_ABTSTS_ABTIF5_Msk (0x1ul << PDMA_ABTSTS_ABTIF5_Pos) /*!< PDMA_T::ABTSTS: ABTIF5 Mask */ - -#define PDMA_ABTSTS_ABTIF6_Pos (6) /*!< PDMA_T::ABTSTS: ABTIF6 Position */ -#define PDMA_ABTSTS_ABTIF6_Msk (0x1ul << PDMA_ABTSTS_ABTIF6_Pos) /*!< PDMA_T::ABTSTS: ABTIF6 Mask */ - -#define PDMA_ABTSTS_ABTIF7_Pos (7) /*!< PDMA_T::ABTSTS: ABTIF7 Position */ -#define PDMA_ABTSTS_ABTIF7_Msk (0x1ul << PDMA_ABTSTS_ABTIF7_Pos) /*!< PDMA_T::ABTSTS: ABTIF7 Mask */ - -#define PDMA_ABTSTS_ABTIF8_Pos (8) /*!< PDMA_T::ABTSTS: ABTIF8 Position */ -#define PDMA_ABTSTS_ABTIF8_Msk (0x1ul << PDMA_ABTSTS_ABTIF8_Pos) /*!< PDMA_T::ABTSTS: ABTIF8 Mask */ - -#define PDMA_ABTSTS_ABTIF9_Pos (9) /*!< PDMA_T::ABTSTS: ABTIF9 Position */ -#define PDMA_ABTSTS_ABTIF9_Msk (0x1ul << PDMA_ABTSTS_ABTIF9_Pos) /*!< PDMA_T::ABTSTS: ABTIF9 Mask */ - -#define PDMA_ABTSTS_ABTIF10_Pos (10) /*!< PDMA_T::ABTSTS: ABTIF10 Position */ -#define PDMA_ABTSTS_ABTIF10_Msk (0x1ul << PDMA_ABTSTS_ABTIF10_Pos) /*!< PDMA_T::ABTSTS: ABTIF10 Mask */ - -#define PDMA_ABTSTS_ABTIF11_Pos (11) /*!< PDMA_T::ABTSTS: ABTIF11 Position */ -#define PDMA_ABTSTS_ABTIF11_Msk (0x1ul << PDMA_ABTSTS_ABTIF11_Pos) /*!< PDMA_T::ABTSTS: ABTIF11 Mask */ - -#define PDMA_ABTSTS_ABTIF12_Pos (12) /*!< PDMA_T::ABTSTS: ABTIF12 Position */ -#define PDMA_ABTSTS_ABTIF12_Msk (0x1ul << PDMA_ABTSTS_ABTIF12_Pos) /*!< PDMA_T::ABTSTS: ABTIF12 Mask */ - -#define PDMA_ABTSTS_ABTIF13_Pos (13) /*!< PDMA_T::ABTSTS: ABTIF13 Position */ -#define PDMA_ABTSTS_ABTIF13_Msk (0x1ul << PDMA_ABTSTS_ABTIF13_Pos) /*!< PDMA_T::ABTSTS: ABTIF13 Mask */ - -#define PDMA_ABTSTS_ABTIF14_Pos (14) /*!< PDMA_T::ABTSTS: ABTIF14 Position */ -#define PDMA_ABTSTS_ABTIF14_Msk (0x1ul << PDMA_ABTSTS_ABTIF14_Pos) /*!< PDMA_T::ABTSTS: ABTIF14 Mask */ - -#define PDMA_ABTSTS_ABTIF15_Pos (15) /*!< PDMA_T::ABTSTS: ABTIF15 Position */ -#define PDMA_ABTSTS_ABTIF15_Msk (0x1ul << PDMA_ABTSTS_ABTIF15_Pos) /*!< PDMA_T::ABTSTS: ABTIF15 Mask */ - -#define PDMA_TDSTS_TDIF0_Pos (0) /*!< PDMA_T::TDSTS: TDIF0 Position */ -#define PDMA_TDSTS_TDIF0_Msk (0x1ul << PDMA_TDSTS_TDIF0_Pos) /*!< PDMA_T::TDSTS: TDIF0 Mask */ - -#define PDMA_TDSTS_TDIF1_Pos (1) /*!< PDMA_T::TDSTS: TDIF1 Position */ -#define PDMA_TDSTS_TDIF1_Msk (0x1ul << PDMA_TDSTS_TDIF1_Pos) /*!< PDMA_T::TDSTS: TDIF1 Mask */ - -#define PDMA_TDSTS_TDIF2_Pos (2) /*!< PDMA_T::TDSTS: TDIF2 Position */ -#define PDMA_TDSTS_TDIF2_Msk (0x1ul << PDMA_TDSTS_TDIF2_Pos) /*!< PDMA_T::TDSTS: TDIF2 Mask */ - -#define PDMA_TDSTS_TDIF3_Pos (3) /*!< PDMA_T::TDSTS: TDIF3 Position */ -#define PDMA_TDSTS_TDIF3_Msk (0x1ul << PDMA_TDSTS_TDIF3_Pos) /*!< PDMA_T::TDSTS: TDIF3 Mask */ - -#define PDMA_TDSTS_TDIF4_Pos (4) /*!< PDMA_T::TDSTS: TDIF4 Position */ -#define PDMA_TDSTS_TDIF4_Msk (0x1ul << PDMA_TDSTS_TDIF4_Pos) /*!< PDMA_T::TDSTS: TDIF4 Mask */ - -#define PDMA_TDSTS_TDIF5_Pos (5) /*!< PDMA_T::TDSTS: TDIF5 Position */ -#define PDMA_TDSTS_TDIF5_Msk (0x1ul << PDMA_TDSTS_TDIF5_Pos) /*!< PDMA_T::TDSTS: TDIF5 Mask */ - -#define PDMA_TDSTS_TDIF6_Pos (6) /*!< PDMA_T::TDSTS: TDIF6 Position */ -#define PDMA_TDSTS_TDIF6_Msk (0x1ul << PDMA_TDSTS_TDIF6_Pos) /*!< PDMA_T::TDSTS: TDIF6 Mask */ - -#define PDMA_TDSTS_TDIF7_Pos (7) /*!< PDMA_T::TDSTS: TDIF7 Position */ -#define PDMA_TDSTS_TDIF7_Msk (0x1ul << PDMA_TDSTS_TDIF7_Pos) /*!< PDMA_T::TDSTS: TDIF7 Mask */ - -#define PDMA_TDSTS_TDIF8_Pos (8) /*!< PDMA_T::TDSTS: TDIF8 Position */ -#define PDMA_TDSTS_TDIF8_Msk (0x1ul << PDMA_TDSTS_TDIF8_Pos) /*!< PDMA_T::TDSTS: TDIF8 Mask */ - -#define PDMA_TDSTS_TDIF9_Pos (9) /*!< PDMA_T::TDSTS: TDIF9 Position */ -#define PDMA_TDSTS_TDIF9_Msk (0x1ul << PDMA_TDSTS_TDIF9_Pos) /*!< PDMA_T::TDSTS: TDIF9 Mask */ - -#define PDMA_TDSTS_TDIF10_Pos (10) /*!< PDMA_T::TDSTS: TDIF10 Position */ -#define PDMA_TDSTS_TDIF10_Msk (0x1ul << PDMA_TDSTS_TDIF10_Pos) /*!< PDMA_T::TDSTS: TDIF10 Mask */ - -#define PDMA_TDSTS_TDIF11_Pos (11) /*!< PDMA_T::TDSTS: TDIF11 Position */ -#define PDMA_TDSTS_TDIF11_Msk (0x1ul << PDMA_TDSTS_TDIF11_Pos) /*!< PDMA_T::TDSTS: TDIF11 Mask */ - -#define PDMA_TDSTS_TDIF12_Pos (12) /*!< PDMA_T::TDSTS: TDIF12 Position */ -#define PDMA_TDSTS_TDIF12_Msk (0x1ul << PDMA_TDSTS_TDIF12_Pos) /*!< PDMA_T::TDSTS: TDIF12 Mask */ - -#define PDMA_TDSTS_TDIF13_Pos (13) /*!< PDMA_T::TDSTS: TDIF13 Position */ -#define PDMA_TDSTS_TDIF13_Msk (0x1ul << PDMA_TDSTS_TDIF13_Pos) /*!< PDMA_T::TDSTS: TDIF13 Mask */ - -#define PDMA_TDSTS_TDIF14_Pos (14) /*!< PDMA_T::TDSTS: TDIF14 Position */ -#define PDMA_TDSTS_TDIF14_Msk (0x1ul << PDMA_TDSTS_TDIF14_Pos) /*!< PDMA_T::TDSTS: TDIF14 Mask */ - -#define PDMA_TDSTS_TDIF15_Pos (15) /*!< PDMA_T::TDSTS: TDIF15 Position */ -#define PDMA_TDSTS_TDIF15_Msk (0x1ul << PDMA_TDSTS_TDIF15_Pos) /*!< PDMA_T::TDSTS: TDIF15 Mask */ - -#define PDMA_ALIGN_ALIGNn_Pos (0) /*!< PDMA_T::ALIGN: ALIGNn Position */ -#define PDMA_ALIGN_ALIGNn_Msk (0xfffful << PDMA_ALIGN_ALIGNn_Pos) /*!< PDMA_T::ALIGN: ALIGNn Mask */ - -#define PDMA_TACTSTS_TXACTFn_Pos (0) /*!< PDMA_T::TACTSTS: TXACTFn Position */ -#define PDMA_TACTSTS_TXACTFn_Msk (0xfffful << PDMA_TACTSTS_TXACTFn_Pos) /*!< PDMA_T::TACTSTS: TXACTFn Mask */ - -#define PDMA_TOUTPSC_TOUTPSC0_Pos (0) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Position */ -#define PDMA_TOUTPSC_TOUTPSC0_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC0_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Mask */ - -#define PDMA_TOUTPSC_TOUTPSC1_Pos (4) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Position */ -#define PDMA_TOUTPSC_TOUTPSC1_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC1_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Mask */ - -#define PDMA_TOUTEN_TOUTENn_Pos (0) /*!< PDMA_T::TOUTEN: TOUTENn Position */ -#define PDMA_TOUTEN_TOUTENn_Msk (0x3ul << PDMA_TOUTEN_TOUTENn_Pos) /*!< PDMA_T::TOUTEN: TOUTENn Mask */ - -#define PDMA_TOUTIEN_TOUTIENn_Pos (0) /*!< PDMA_T::TOUTIEN: TOUTIENn Position */ -#define PDMA_TOUTIEN_TOUTIENn_Msk (0x3ul << PDMA_TOUTIEN_TOUTIENn_Pos) /*!< PDMA_T::TOUTIEN: TOUTIENn Mask */ - -#define PDMA_SCATBA_SCATBA_Pos (16) /*!< PDMA_T::SCATBA: SCATBA Position */ -#define PDMA_SCATBA_SCATBA_Msk (0xfffful << PDMA_SCATBA_SCATBA_Pos) /*!< PDMA_T::SCATBA: SCATBA Mask */ - -#define PDMA_TOC0_1_TOC0_Pos (0) /*!< PDMA_T::TOC0_1: TOC0 Position */ -#define PDMA_TOC0_1_TOC0_Msk (0xfffful << PDMA_TOC0_1_TOC0_Pos) /*!< PDMA_T::TOC0_1: TOC0 Mask */ - -#define PDMA_TOC0_1_TOC1_Pos (16) /*!< PDMA_T::TOC0_1: TOC1 Position */ -#define PDMA_TOC0_1_TOC1_Msk (0xfffful << PDMA_TOC0_1_TOC1_Pos) /*!< PDMA_T::TOC0_1: TOC1 Mask */ - -#define PDMA_TOC2_3_TOC2_Pos (0) /*!< PDMA_T::TOC2_3: TOC2 Position */ -#define PDMA_TOC2_3_TOC2_Msk (0xfffful << PDMA_TOC2_3_TOC2_Pos) /*!< PDMA_T::TOC2_3: TOC2 Mask */ - -#define PDMA_TOC2_3_TOC3_Pos (16) /*!< PDMA_T::TOC2_3: TOC3 Position */ -#define PDMA_TOC2_3_TOC3_Msk (0xfffful << PDMA_TOC2_3_TOC3_Pos) /*!< PDMA_T::TOC2_3: TOC3 Mask */ - -#define PDMA_TOC4_5_TOC4_Pos (0) /*!< PDMA_T::TOC4_5: TOC4 Position */ -#define PDMA_TOC4_5_TOC4_Msk (0xfffful << PDMA_TOC4_5_TOC4_Pos) /*!< PDMA_T::TOC4_5: TOC4 Mask */ - -#define PDMA_TOC4_5_TOC5_Pos (16) /*!< PDMA_T::TOC4_5: TOC5 Position */ -#define PDMA_TOC4_5_TOC5_Msk (0xfffful << PDMA_TOC4_5_TOC5_Pos) /*!< PDMA_T::TOC4_5: TOC5 Mask */ - -#define PDMA_TOC6_7_TOC6_Pos (0) /*!< PDMA_T::TOC6_7: TOC6 Position */ -#define PDMA_TOC6_7_TOC6_Msk (0xfffful << PDMA_TOC6_7_TOC6_Pos) /*!< PDMA_T::TOC6_7: TOC6 Mask */ - -#define PDMA_TOC6_7_TOC7_Pos (16) /*!< PDMA_T::TOC6_7: TOC7 Position */ -#define PDMA_TOC6_7_TOC7_Msk (0xfffful << PDMA_TOC6_7_TOC7_Pos) /*!< PDMA_T::TOC6_7: TOC7 Mask */ - -#define PDMA_TOC8_9_TOC8_Pos (0) /*!< PDMA_T::TOC8_9: TOC8 Position */ -#define PDMA_TOC8_9_TOC8_Msk (0xfffful << PDMA_TOC8_9_TOC8_Pos) /*!< PDMA_T::TOC8_9: TOC8 Mask */ - -#define PDMA_TOC8_9_TOC9_Pos (16) /*!< PDMA_T::TOC8_9: TOC9 Position */ -#define PDMA_TOC8_9_TOC9_Msk (0xfffful << PDMA_TOC8_9_TOC9_Pos) /*!< PDMA_T::TOC8_9: TOC9 Mask */ - -#define PDMA_CHRST_CHnRST_Pos (0) /*!< PDMA_T::CHRST: CHnRST Position */ -#define PDMA_CHRST_CHnRST_Msk (0xfffful << PDMA_CHRST_CHnRST_Pos) /*!< PDMA_T::CHRST: CHnRST Mask */ - -#define PDMA_REQSEL0_3_REQSRC0_Pos (0) /*!< PDMA_T::REQSEL0_3: REQSRC0 Position */ -#define PDMA_REQSEL0_3_REQSRC0_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC0_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC0 Mask */ - -#define PDMA_REQSEL0_3_REQSRC1_Pos (8) /*!< PDMA_T::REQSEL0_3: REQSRC1 Position */ -#define PDMA_REQSEL0_3_REQSRC1_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC1_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC1 Mask */ - -#define PDMA_REQSEL0_3_REQSRC2_Pos (16) /*!< PDMA_T::REQSEL0_3: REQSRC2 Position */ -#define PDMA_REQSEL0_3_REQSRC2_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC2_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC2 Mask */ - -#define PDMA_REQSEL0_3_REQSRC3_Pos (24) /*!< PDMA_T::REQSEL0_3: REQSRC3 Position */ -#define PDMA_REQSEL0_3_REQSRC3_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC3_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC3 Mask */ - -#define PDMA_REQSEL4_7_REQSRC4_Pos (0) /*!< PDMA_T::REQSEL4_7: REQSRC4 Position */ -#define PDMA_REQSEL4_7_REQSRC4_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC4_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC4 Mask */ - -#define PDMA_REQSEL4_7_REQSRC5_Pos (8) /*!< PDMA_T::REQSEL4_7: REQSRC5 Position */ -#define PDMA_REQSEL4_7_REQSRC5_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC5_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC5 Mask */ - -#define PDMA_REQSEL4_7_REQSRC6_Pos (16) /*!< PDMA_T::REQSEL4_7: REQSRC6 Position */ -#define PDMA_REQSEL4_7_REQSRC6_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC6_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC6 Mask */ - -#define PDMA_REQSEL4_7_REQSRC7_Pos (24) /*!< PDMA_T::REQSEL4_7: REQSRC7 Position */ -#define PDMA_REQSEL4_7_REQSRC7_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC7_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC7 Mask */ - -#define PDMA_REQSEL8_11_REQSRC8_Pos (0) /*!< PDMA_T::REQSEL8_11: REQSRC8 Position */ -#define PDMA_REQSEL8_11_REQSRC8_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC8_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC8 Mask */ - -#define PDMA_REQSEL8_11_REQSRC9_Pos (8) /*!< PDMA_T::REQSEL8_11: REQSRC9 Position */ -#define PDMA_REQSEL8_11_REQSRC9_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC9_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC9 Mask */ - -#define PDMA_REQSEL8_11_REQSRC10_Pos (16) /*!< PDMA_T::REQSEL8_11: REQSRC10 Position */ -#define PDMA_REQSEL8_11_REQSRC10_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC10_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC10 Mask */ - -#define PDMA_REQSEL8_11_REQSRC11_Pos (24) /*!< PDMA_T::REQSEL8_11: REQSRC11 Position */ -#define PDMA_REQSEL8_11_REQSRC11_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC11_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC11 Mask */ - -#define PDMA_REQSEL12_15_REQSRC12_Pos (0) /*!< PDMA_T::REQSEL12_15: REQSRC12 Position */ -#define PDMA_REQSEL12_15_REQSRC12_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC12_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC12 Mask */ - -#define PDMA_REQSEL12_15_REQSRC13_Pos (8) /*!< PDMA_T::REQSEL12_15: REQSRC13 Position */ -#define PDMA_REQSEL12_15_REQSRC13_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC13_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC13 Mask */ - -#define PDMA_REQSEL12_15_REQSRC14_Pos (16) /*!< PDMA_T::REQSEL12_15: REQSRC14 Position */ -#define PDMA_REQSEL12_15_REQSRC14_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC14_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC14 Mask */ - -#define PDMA_REQSEL12_15_REQSRC15_Pos (24) /*!< PDMA_T::REQSEL12_15: REQSRC15 Position */ -#define PDMA_REQSEL12_15_REQSRC15_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC15_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC15 Mask */ - -#define PDMA_STCRn_STC_Pos (0) /*!< PDMA_T::STCRn: STC Position */ -#define PDMA_STCRn_STC_Msk (0xfffful << PDMA_STCRn_STC_Pos) /*!< PDMA_T::STCRn: STC Mask */ - -#define PDMA_ASOCRn_SASOL_Pos (0) /*!< PDMA_T::ASOCRn: SASOL Position */ -#define PDMA_ASOCRn_SASOL_Msk (0xfffful << PDMA_ASOCRn_SASOL_Pos) /*!< PDMA_T::ASOCRn: SASOL Mask */ - -#define PDMA_ASOCRn_DASOL_Pos (16) /*!< PDMA_T::ASOCRn: DASOL Position */ -#define PDMA_ASOCRn_DASOL_Msk (0xfffful << PDMA_ASOCRn_DASOL_Pos) /*!< PDMA_T::ASOCRn: DASOL Mask */ - -/**@}*/ /* PDMA_CONST */ -/**@}*/ /* end of PDMA register group */ -/**@}*/ /* end of REGISTER group */ - -#define PDMA0 ((PDMA_T *) PDMA0_BA) -#define PDMA1 ((PDMA_T *) PDMA1_BA) - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - -/** @addtogroup PDMA_EXPORTED_CONSTANTS PDMA Exported Constants - @{ -*/ -#define PDMA_CH_MAX 10UL /*!< Specify Maximum Channels of PDMA \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Operation Mode Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define PDMA_OP_STOP 0x00000000UL /*!INTSTS)) - -/** - * @brief Get Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_TD_STS(pdma) ((uint32_t)(pdma->TDSTS)) - -/** - * @brief Clear Transfer Done Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the transfer done Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TD_FLAG(pdma,u32Mask) ((uint32_t)(pdma->TDSTS = (u32Mask))) - -/** - * @brief Get Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ABORT_STS(pdma) ((uint32_t)(pdma->ABTSTS)) - -/** - * @brief Clear Target Abort Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the target abort Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ABORT_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ABTSTS = (u32Mask))) - -/** - * @brief Get Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details Get Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_GET_ALIGN_STS(pdma) ((uint32_t)(PDMA->ALIGN)) - -/** - * @brief Clear Alignment Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Mask The channel mask - * - * @return None - * - * @details Clear the Alignment Interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_ALIGN_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ALIGN = (u32Mask))) - -/** - * @brief Clear Timeout Interrupt Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details Clear the selected channel timeout interrupt status. - * \hideinitializer - */ -#define PDMA_CLR_TMOUT_FLAG(pdma,u32Ch) ((uint32_t)(pdma->INTSTS = (1 << ((u32Ch) + 8)))) - -/** - * @brief Check Channel Status - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @retval 0 Idle state - * @retval 1 Busy state - * - * @details Check the selected channel is busy or not. - * \hideinitializer - */ -#define PDMA_IS_CH_BUSY(pdma,u32Ch) ((uint32_t)(pdma->TRGSTS & (1 << (u32Ch)))? 1 : 0) - -/** - * @brief Set Source Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel source address. - * \hideinitializer - */ -#define PDMA_SET_SRC_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].SA = (u32Addr))) - -/** - * @brief Set Destination Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The selected address - * - * @return None - * - * @details This macro set the selected channel destination address. - * \hideinitializer - */ -#define PDMA_SET_DST_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].DA = (u32Addr))) - -/** - * @brief Set Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32TransCount Transfer Count - * - * @return None - * - * @details This macro set the selected channel transfer count. - * \hideinitializer - */ -#define PDMA_SET_TRANS_CNT(pdma,u32Ch, u32TransCount) ((uint32_t)(pdma->DSCT[(u32Ch)].CTL=(pdma->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1) << PDMA_DSCT_CTL_TXCNT_Pos))) - -/** - * @brief Set Scatter-gather descriptor Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Addr The descriptor address - * - * @return None - * - * @details This macro set the selected channel scatter-gather descriptor address. - * \hideinitializer - */ -#define PDMA_SET_SCATTER_DESC(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].NEXT = (u32Addr) - (pdma->SCATBA))) - -/** - * @brief Stop the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro stop the selected channel. - * \hideinitializer - */ -#define PDMA_STOP(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch)))) - -/** - * @brief Pause the channel - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This macro pause the selected channel. - * \hideinitializer - */ -#define PDMA_PAUSE(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch)))) - -/*---------------------------------------------------------------------------------------------------------*/ -/* Define PDMA functions prototype */ -/*---------------------------------------------------------------------------------------------------------*/ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_Close(PDMA_T *pdma); -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount); -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl); -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr); -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize); -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask); -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt); -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch); -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask); -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount); - - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif /* __NU_PDMA_H__ */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pwm.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pwm.h deleted file mode 100644 index b1431a1856e..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_pwm.h +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************//** - * @file pwm.h - * @version V1.00 - * $Revision: 3 $ - * $Date: 15/05/19 10:16a $ - * @brief NUC980 series PWM driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_PWM_H__ -#define __NU_PWM_H__ -#include "nuc980.h" -#include "nu_sys.h" -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PWM_Driver PWM Driver - @{ -*/ - -/** @addtogroup PWM_EXPORTED_CONSTANTS PWM Exported Constants - @{ -*/ - -#define PWM_OFFSET 0xc ///< each channel has 3 control registers which occupies 12 bytes - -// Timer channel identity information -#define PWM_TIMER_NUM 8 ///< Total PWM channel count -#define PWM_TIMER_MIN 0 ///< Min PWM channel number -#define PWM_TIMER_MAX 7 ///< Max PWM channel number -#define PWM0_TIMER0 0 ///< PWM0 channel 0 -#define PWM0_TIMER1 1 ///< PWM0 channel 1 -#define PWM0_TIMER2 2 ///< PWM0 channel 2 -#define PWM0_TIMER3 3 ///< PWM0 channel 3 -#define PWM1_TIMER0 4 ///< PWM1 channel 0 -#define PWM1_TIMER1 5 ///< PWM1 channel 1 -#define PWM1_TIMER2 6 ///< PWM1 channel 2 -#define PWM1_TIMER3 7 ///< PWM1 channel 3 - -//ioctl command -#define START_PWMTIMER 0 ///< Start PWM ioctl command -#define STOP_PWMTIMER 1 ///< Stop PWM ioctl command -#define SET_CSR 2 ///< Set CSR ioctl command -#define SET_CP 3 ///< Set CP ioctl command -#define SET_DZI 4 ///< Set dead zone ioctl command -#define SET_INVERTER 5 ///< Set inverter ioctl command -#define SET_MODE 6 ///< Set OP mode ioctl command -#define ENABLE_DZ_GENERATOR 7 ///< Enable dead zone ioctl command -#define DISABLE_DZ_GENERATOR 8 ///< Disable dead zone ioctl command -#define ENABLE_PWMGPIOOUTPUT 9 ///< Enable PWM output ioctl command - -#define PWM_STOP_METHOD1 1 ///< PWM stop method 1 -#define PWM_STOP_METHOD2 2 ///< PWM stop method 2 -//#define PWM_STOP_METHOD3 3 not recommended - -//Timer default value -#define DEFAULT_CSR CSRD16 ///< Default CSR value -#define DEFAULT_CP 255 ///< Default CP value -#define DEFAULT_DZI 50 ///< Default DZI value -#define DEFAULT_CNR 19531 ///< Default CNR value -#define DEFAULT_CMR (19531/4) ///< Default CMR value -#define DEFAULT_MODE PWM_TOGGLE ///< Default OP mode - -// for PWM_PPR -#define DZI_MIN 0 ///< Min DZI value -#define DZI_MAX 255 ///< Max DZI value -#define CP_MIN 0 ///< Min CP value -#define CP_MAX 255 ///< Max CP value - -// for PWM_CSR -#define CSR_MIN 0 ///< Min CSR value -#define CSR_MAX 4 ///< Mac SCR value -#define CSRD2 0x0 ///< Div by 2 -#define CSRD4 0x1 ///< Div by 4 -#define CSRD8 0x2 ///< Div by 8 -#define CSRD16 0x3 ///< Div by 16 -#define CSRD1 0x4 ///< Div by 1 - -// for PWM_PCR -#define PWMDZG_ENABLE 1 ///< Enable PWM dead zone -#define PWMDZG_DISABLE 0 ///< Disable PWM dead zone -#define PWM_ENABLE 1 ///< Enable PWM channel -#define PWM_DISABLE 0 ///< Disable PWM channel -#define PWM_TOGGLE 1 ///< PWM toggle mode -#define PWM_ONESHOT 0 ///< PWM one-shot mode -#define PWM_INVON 1 ///< Enable PWM inverter -#define PWM_INVOFF 0 ///< Disable PWM inverter - -// for PWM_CNR -#define CNR_MIN 0 ///< Min CNR value -#define CNR_MAX 65535 ///< Mac CNR value - -// for PWM_CMR -#define CMR_MIN 0 ///< Min CMR value -#define CMR_MAX 65535 ///< Max CMR value - -// for pin control -#define PWM00_GPF5 0 ///< PWM00 output on GPF5 -#define PWM01_GPF6 1 ///< PWM01 output on GPF6 -#define PWM02_GPF7 2 ///< PWM02 output on GPF7 -#define PWM03_GPF8 3 ///< PWM03 output on GPF8 -#define PWM00_GPG0 4 ///< PWM00 output on GPG0 -#define PWM01_GPG1 5 ///< PWM01 output on GPG1 -#define PWM02_GPG2 6 ///< PWM02 output on GPG2 -#define PWM03_GPG3 7 ///< PWM03 output on GPG3 -#define PWM00_GPD12 8 ///< PWM00 output on GPD12 -#define PWM01_GPD13 9 ///< PWM01 output on GPD13 -#define PWM02_GPD14 10 ///< PWM02 output on GPD14 -#define PWM03_GPD15 11 ///< PWM03 output on GPD15 -#define PWM00_GPG10 12 ///< PWM00 output on GPG10 -#define PWM01_GPA15 13 ///< PWM01 output on GPA15 -#define PWM02_GPA14 14 ///< PWM02 output on GPA14 -#define PWM03_GPA13 15 ///< PWM03 output on GPA13 -#define PWM02_GPB13 16 ///< PWM02 output on GPB13 - -#define PWM10_GPB12 17 ///< PWM10 output on GPB12 -#define PWM11_GPB11 18 ///< PWM11 output on GPB11 -#define PWM12_GPB10 19 ///< PWM12 output on GPB10 -#define PWM13_GPB9 20 ///< PWM13 output on GPB9 -#define PWM10_GPG6 21 ///< PWM10 output on GPG6 -#define PWM11_GPG7 22 ///< PWM11 output on GPG7 -#define PWM12_GPG8 23 ///< PWM12 output on GPG8 -#define PWM13_GPG9 24 ///< PWM13 output on GPG9 -#define PWM10_GPG11 25 ///< PWM10 output on GPG11 -#define PWM11_GPG12 26 ///< PWM11 output on GPG12 -#define PWM12_GPG13 27 ///< PWM12 output on GPG13 -#define PWM13_GPG14 28 ///< PWM13 output on GPG14 -#define PWM10_GPF9 29 ///< PWM10 output on GPF9 -#define PWM11_GPF10 30 ///< PWM11 output on GPF10 -#define PWM12_GPE10 31 ///< PWM12 output on GPE10 -#define PWM13_GPE12 32 ///< PWM13 output on GPE12 - -#define PWM_ERR_ID 0xFFFF1300 ///< PWM library ID - -//PWM Error code -#define pwmInvalidTimerChannel (PWM_ERR_ID|1) ///< Invalid channel number -#define pwmInvalidStructLength (PWM_ERR_ID|2) ///< Invalid structure length -#define pwmInvalidIoctlCommand (PWM_ERR_ID|3) ///< Invalid ioctl command -#define pwmInvalidStopMethod (PWM_ERR_ID|4) ///< Invalid stop mode -#define pwmInvalidCPValue (PWM_ERR_ID|5) ///< Invalid CP value -#define pwmInvalidDZIValue (PWM_ERR_ID|6) ///< Invalid DZI value -#define pwmInvalidCSRValue (PWM_ERR_ID|7) ///< Invalid CSR value -#define pwmInvalidDZGStatus (PWM_ERR_ID|8) ///< Invalid DZ status -#define pwmInvalidTimerStatus (PWM_ERR_ID|9) ///< Invalid timer status -#define pwmInvalidInverterValue (PWM_ERR_ID|10) ///< Invalid inverter value -#define pwmInvalidModeStatus (PWM_ERR_ID|11) ///< Invalid OP mode -#define pwmInvalidCNRValue (PWM_ERR_ID|12) ///< Invalid CNR value -#define pwmInvalidCMRValue (PWM_ERR_ID|13) ///< Invalid CMR value -#define pwmTimerNotOpen (PWM_ERR_ID|14) ///< PWM channel not stop -#define pwmTimerBusy (PWM_ERR_ID|15) ///< PWM channel is busy -#define pwmInvalidPin (PWM_ERR_ID|16) ///< Invalid PWM output pin - -/*@}*/ /* end of group PWM_EXPORTED_CONSTANTS */ - -/// @cond HIDDEN_SYMBOLS -/** @addtogroup PWM_EXPORTED_STRUCTS PWM Exported Structs - @{ -*/ - -typedef union -{ - UINT value; - struct - { - UINT cp0: 8, cp1: 8, dzi0: 8, dzi1: 8; - } field; -} typePPR; - -typedef union -{ - UINT value; - struct - { - UINT csr0: 3, _reserved3: 1, - csr1: 3, _reserved7: 1, - csr2: 3, _reserved11: 1, - csr3: 3, _reserved15: 1, - _reserved16_31: 16; - } field; -} typeCSR; - -typedef union -{ - UINT value; - struct - { - UINT ch0_en: 1, _reserved1: 1, ch0_inverter: 1, ch0_mode: 1, - grpup0_dzen: 1, grpup1_dzen: 1, - _reserved6_7: 2, - ch1_en: 1, _reserved9: 1, ch1_inverter: 1, ch1_mode: 1, - ch2_en: 1, _reserved13: 1, ch2_inverter: 1, ch2_mode: 1, - ch3_en: 1, _reserved17: 1, ch3_inverter: 1, ch3_mode: 1, - _reserved20_31: 12; - } field; -} typePCR; - -typedef union -{ - UINT value; - struct - { - UINT cnr: 16, _reserved16_31: 16; - } field; -} typeCNR; - -typedef union -{ - UINT value; - struct - { - UINT cmr: 16, _reserved16_31: 16; - } field; -} typeCMR; - -// for write operation -typedef union -{ - UINT value; - struct - { - UINT cnr: 16, cmr: 16; - } field; -} typePWMVALUE; - -// for read operation -typedef struct -{ - UINT volatile PDR; - BOOL volatile InterruptFlag; - BOOL _reversed0; - BOOL _reversed1; - BOOL _reversed2; -} typePWMSTATUS; - -/*@}*/ /* end of group PWM_EXPORTED_STRUCTS */ -/// @endcond /* HIDDEN_SYMBOLS */ - -/** @addtogroup PWM_EXPORTED_FUNCTIONS PWM Exported Functions - @{ -*/ - -// function definition -INT pwmInit(const INT nTimerIdentity); -INT pwmExit(void); -INT pwmOpen(const INT nTimerIdentity); -INT pwmClose(const INT nTimerIdentity); -INT pwmRead(const INT nTimerIdentity, PUCHAR pucStatusValue, const UINT uLength); -INT pwmWrite(const INT nTimerIdentity, PUCHAR pucCNRCMRValue, const UINT uLength); -INT pwmIoctl(const INT nTimerIdentity, const UINT uCommand, const UINT uIndication, UINT uValue); - -/*@}*/ /* end of group PWM_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PWM_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif //__NU_PWM_H__ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_qspi.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_qspi.h deleted file mode 100644 index 92a952ff42d..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_qspi.h +++ /dev/null @@ -1,929 +0,0 @@ -/**************************************************************************//** - * @file qspi.h - * @brief NUC980 series QSPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_QSPI_H__ -#define __NU_QSPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup QSPI Serial Peripheral Interface Controller(QSPI) - Memory Mapped Structure for QSPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var QSPI_T::CTL - * Offset: 0x00 QSPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |QSPIEN |QSPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1 - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of QSPIx_CTL, QSPIx_CLKDIV, QSPIx_SSCTL and QSPIx_FIFOCTL registers, user shall clear the QSPIEN (QSPIx_CTL[0]) and confirm the QSPIENSTS (QSPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of QSPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of QSPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of QSPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of QSPI bus clock. - * |[3] |CLKPOL |Clock Polarity - * | | |0 = QSPI bus clock is idle low. - * | | |1 = QSPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval (Master Only) - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of QSPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 .... 0.5 QSPICLK clock cycle. - * | | |SUSPITV = 0x1 .... 1.5 QSPICLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE .... 14.5 QSPICLK clock cycle. - * | | |SUSPITV = 0xF .... 15.5 QSPICLK clock cycle. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 .... 8 bits. - * | | |DWIDTH = 0x09 .... 9 bits. - * | | |..... - * | | |DWIDTH = 0x1F .... 31 bits. - * | | |DWIDTH = 0x00 .... 32 bits. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the QSPI TX register, is sent first to the QSPI data output pin, and the first bit received from the QSPI data input pin will be put in the LSB position of the RX register (bit 0 of QSPI_RX). - * |[14] |HALFDPX |QSPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for QSPI transfer - * | | |The bit field DATDIR (QSPIx_CTL[20]) can be used to set the data direction in half-duplex transfer. - * | | |0 = QSPI operates in full-duplex transfer. - * | | |1 = QSPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only Mode Enable Bit (Master Only) - * | | |This bit field is only available in Master mode - * | | |In receive-only mode, QSPI Master will generate QSPI bus clock continuously for receiving data bit from QSPI slave device and assert the BUSY status. - * | | |0 = Receive-only mode Disabled. - * | | |1 = Receive-only mode Enabled. - * |[16] |TWOBIT |2-bit Transfer Mode Enable Bit (Only Supported in QSPI0) - * | | |0 = 2-Bit Transfer mode Disabled. - * | | |1 = 2-Bit Transfer mode Enabled. - * | | |Note: When 2-Bit Transfer mode is enabled, the first serial transmitted bit data is from the first FIFO buffer data, and the 2nd serial transmitted bit data is from the second FIFO buffer data - * | | |As the same as transmitted function, the first received bit data is stored into the first FIFO buffer and the 2nd received bit data is stored into the second FIFO buffer at the same time. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = QSPI unit transfer interrupt Disabled. - * | | |1 = QSPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled - * | | |A byte suspend interval will be inserted among each byte - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction in half-duplex transfer and Dual/Quad transfer - * | | |0 = QSPI data is input direction. - * | | |1 = QSPI data is output direction. - * |[21] |DUALIOEN |Dual I/O Mode Enable Bit (Only Supported in QSPI0) - * | | |0 = Dual I/O mode Disabled. - * | | |1 = Dual I/O mode Enabled. - * |[22] |QUADIOEN |Quad I/O Mode Enable Bit (Only Supported in QSPI0) - * | | |0 = Quad I/O mode Disabled. - * | | |1 = Quad I/O mode Enabled. - * @var QSPI_T::CLKDIV - * Offset: 0x04 QSPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the QSPI bus clock of QSPI Master - * | | |The frequency is obtained according to the following equation. - * | | |where - * | | |is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * @var QSPI_T::SSCTL - * Offset: 0x08 QSPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control (Master Only) - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = set the QSPIx_SS line to inactive state. - * | | |1 = set the QSPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the QSPIx_SS line at inactive state. - * | | |1 = QSPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time - * | | |The active state of QSPIx_SS is specified in SSACTPOL (QSPIx_SSCTL[2]). - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (QSPIx_SS). - * | | |0 = The slave selection signal QSPIx_SS is active low. - * | | |1 = The slave selection signal QSPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit (Master Only) - * | | |0 = Automatic slave selection function Disabled - * | | |Slave selection signal will be asserted/de-asserted according to SS (QSPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * |[4] |SLV3WIRE |Slave 3-wire Mode Enable Bit (Only Supported in QSPI0) - * | | |Slave 3-wire mode is only available in QSPI0 - * | | |In Slave 3-wire mode, the QSPI controller can work with 3-wire interface including QSPI0_CLK, QSPI0_MISO and QSPI0_MOSI pins. - * | | |0 = 4-wire bi-direction interface. - * | | |1 = 3-wire bi-direction interface. - * |[5] |SLVTOIEN |Slave Mode Time-out Interrupt Enable Bit (Only Supported in QSPI0) - * | | |0 = Slave mode time-out interrupt Disabled. - * | | |1 = Slave mode time-out interrupt Enabled. - * |[6] |SLVTORST |Slave Mode Time-out Reset Control (Only Supported in QSPI0) - * | | |0 = When Slave mode time-out event occurs, the TX and RX control circuit will not be reset. - * | | |1 = When Slave mode time-out event occurs, the TX and RX control circuit will be reset by hardware. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * |[31:16] |SLVTOCNT |Slave Mode Time-out Period (Only Supported in QSPI0) - * | | |In Slave mode, these bits indicate the time-out period when there is bus clock input during slave select active - * | | |The clock source of the time-out counter is Slave peripheral clock - * | | |If the value is 0, it indicates the slave mode time-out function is disabled. - * @var QSPI_T::PDMACTL - * Offset: 0x0C QSPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In QSPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the QSPI controller. This bit will be automatically cleared to 0. - * @var QSPI_T::FIFOCTL - * Offset: 0x10 QSPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (QSPIx_STATUS[23]) to check if reset is accomplished or not. - * | | |Note: If TX underflow event occurs in QSPI Slave mode, this bit can be used to make QSPI return to idle state. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Slave Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The QSPI data out is keep 0 if there is TX underflow event in Slave mode. - * | | |1 = The QSPI data out is keep 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is no any data in TX FIFO when the slave selection signal is active. - * | | |2. When TX underflow event occurs, QSPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward - * | | |Data stored in TX FIFO will be sent through QSPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |When TX underflow event occurs in Slave mode, TXUFIF (QSPIx_STATUS[19]) will be set to 1 - * | | |This bit is used to enable the TX underflow interrupt. - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[26:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0 - * |[30:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0 - * @var QSPI_T::STATUS - * Offset: 0x14 QSPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = QSPI controller is in idle state. - * | | |1 = QSPI controller is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. QSPIx_CTL[0] = 1 and TXEMPTY = 0. - * | | |b - * | | |For QSPI Master mode, QSPIx_CTL[0] = 1 and TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For QSPI Master mode, QSPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d - * | | |For QSPI Slave mode, the QSPIx_CTL[0] = 1 and there is serial clock input into the QSPI core logic when slave select is active. - * | | |For QSPI Slave mode, the QSPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = QSPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode - * | | |If SSACTPOL (QSPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the QSPI slave select is in inactive status. - * |[5] |SLVTOIF |Slave Time-out Interrupt Flag (Only Supported in QSPI0) - * | | |When the slave select is active and the value of SLVTOCNT is not 0, as the bus clock is detected, the slave time-out counter in QSPI controller logic will be started - * | | |When the value of time-out counter is greater than or equal to the value of SLVTOCNT (QSPI_SSCTL[31:16]) before one transaction is done, the slave time-out interrupt event will be asserted. - * | | |0 = Slave time-out is not active. - * | | |1 = Slave time-out is active. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBEIF also active when the slave select goes to inactive state - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is overrun. - * | | |1 = Receive FIFO is overrun. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 QSPI peripheral clock periods in Master mode or over 576 QSPI peripheral clock periods in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |QSPIENSTS |QSPI Enable Status (Read Only) - * | | |0 = The QSPI controller is disabled. - * | | |1 = The QSPI controller is enabled. - * | | |Note: The QSPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the QSPI control logic is disabled, this bit indicates the real status of QSPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slave's transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var QSPI_T::TX - * Offset: 0x20 QSPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 4-level transmit FIFO buffers - * | | |The number of valid bits depends on the setting of DWIDTH (QSPIx_CTL[12:8]) in SPI mode. - * | | |In SPI mode, if DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted - * | | |If DWIDTH is set to 0x00 , the QSPI controller will perform a 32-bit transfer. - * | | |If WDWIDTH is set as 0x0, 0x1, or 0x3, all bits of this field are valid - * | | |Note: In Master mode, QSPI controller will start to transfer the QSPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var QSPI_T::RX - * Offset: 0x30 QSPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register - * | | |There are 4-level FIFO buffers in this controller - * | | |The data receive register holds the data received from QSPI data input pin - * | | |This is a read only register. - */ - __IO uint32_t CTL; /*!< [0x0000] QSPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] QSPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] QSPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] QSPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] QSPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] QSPI Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __O uint32_t TX; /*!< [0x0020] QSPI Data Transmit Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t RX; /*!< [0x0030] QSPI Data Receive Register */ - -} QSPI_T; - -/** - @addtogroup QSPI_CONST QSPI Bit Field Definition - Constant Definitions for QSPI Controller -@{ */ - -#define QSPI_CTL_QSPIEN_Pos (0) /*!< QSPI_T::CTL: QSPIEN Position */ -#define QSPI_CTL_QSPIEN_Msk (0x1ul << QSPI_CTL_QSPIEN_Pos) /*!< QSPI_T::CTL: QSPIEN Mask */ - -#define QSPI_CTL_RXNEG_Pos (1) /*!< QSPI_T::CTL: RXNEG Position */ -#define QSPI_CTL_RXNEG_Msk (0x1ul << QSPI_CTL_RXNEG_Pos) /*!< QSPI_T::CTL: RXNEG Mask */ - -#define QSPI_CTL_TXNEG_Pos (2) /*!< QSPI_T::CTL: TXNEG Position */ -#define QSPI_CTL_TXNEG_Msk (0x1ul << QSPI_CTL_TXNEG_Pos) /*!< QSPI_T::CTL: TXNEG Mask */ - -#define QSPI_CTL_CLKPOL_Pos (3) /*!< QSPI_T::CTL: CLKPOL Position */ -#define QSPI_CTL_CLKPOL_Msk (0x1ul << QSPI_CTL_CLKPOL_Pos) /*!< QSPI_T::CTL: CLKPOL Mask */ - -#define QSPI_CTL_SUSPITV_Pos (4) /*!< QSPI_T::CTL: SUSPITV Position */ -#define QSPI_CTL_SUSPITV_Msk (0xful << QSPI_CTL_SUSPITV_Pos) /*!< QSPI_T::CTL: SUSPITV Mask */ - -#define QSPI_CTL_DWIDTH_Pos (8) /*!< QSPI_T::CTL: DWIDTH Position */ -#define QSPI_CTL_DWIDTH_Msk (0x1ful << QSPI_CTL_DWIDTH_Pos) /*!< QSPI_T::CTL: DWIDTH Mask */ - -#define QSPI_CTL_LSB_Pos (13) /*!< QSPI_T::CTL: LSB Position */ -#define QSPI_CTL_LSB_Msk (0x1ul << QSPI_CTL_LSB_Pos) /*!< QSPI_T::CTL: LSB Mask */ - -#define QSPI_CTL_HALFDPX_Pos (14) /*!< QSPI_T::CTL: HALFDPX Position */ -#define QSPI_CTL_HALFDPX_Msk (0x1ul << QSPI_CTL_HALFDPX_Pos) /*!< QSPI_T::CTL: HALFDPX Mask */ - -#define QSPI_CTL_RXONLY_Pos (15) /*!< QSPI_T::CTL: RXONLY Position */ -#define QSPI_CTL_RXONLY_Msk (0x1ul << QSPI_CTL_RXONLY_Pos) /*!< QSPI_T::CTL: RXONLY Mask */ - -#define QSPI_CTL_TWOBIT_Pos (16) /*!< QSPI_T::CTL: TWOBIT Position */ -#define QSPI_CTL_TWOBIT_Msk (0x1ul << QSPI_CTL_TWOBIT_Pos) /*!< QSPI_T::CTL: TWOBIT Mask */ - -#define QSPI_CTL_UNITIEN_Pos (17) /*!< QSPI_T::CTL: UNITIEN Position */ -#define QSPI_CTL_UNITIEN_Msk (0x1ul << QSPI_CTL_UNITIEN_Pos) /*!< QSPI_T::CTL: UNITIEN Mask */ - -#define QSPI_CTL_SLAVE_Pos (18) /*!< QSPI_T::CTL: SLAVE Position */ -#define QSPI_CTL_SLAVE_Msk (0x1ul << QSPI_CTL_SLAVE_Pos) /*!< QSPI_T::CTL: SLAVE Mask */ - -#define QSPI_CTL_REORDER_Pos (19) /*!< QSPI_T::CTL: REORDER Position */ -#define QSPI_CTL_REORDER_Msk (0x1ul << QSPI_CTL_REORDER_Pos) /*!< QSPI_T::CTL: REORDER Mask */ - -#define QSPI_CTL_DATDIR_Pos (20) /*!< QSPI_T::CTL: DATDIR Position */ -#define QSPI_CTL_DATDIR_Msk (0x1ul << QSPI_CTL_DATDIR_Pos) /*!< QSPI_T::CTL: DATDIR Mask */ - -#define QSPI_CTL_DUALIOEN_Pos (21) /*!< QSPI_T::CTL: DUALIOEN Position */ -#define QSPI_CTL_DUALIOEN_Msk (0x1ul << QSPI_CTL_DUALIOEN_Pos) /*!< QSPI_T::CTL: DUALIOEN Mask */ - -#define QSPI_CTL_QUADIOEN_Pos (22) /*!< QSPI_T::CTL: QUADIOEN Position */ -#define QSPI_CTL_QUADIOEN_Msk (0x1ul << QSPI_CTL_QUADIOEN_Pos) /*!< QSPI_T::CTL: QUADIOEN Mask */ - -#define QSPI_CLKDIV_DIVIDER_Pos (0) /*!< QSPI_T::CLKDIV: DIVIDER Position */ -#define QSPI_CLKDIV_DIVIDER_Msk (0x1fful << QSPI_CLKDIV_DIVIDER_Pos) /*!< QSPI_T::CLKDIV: DIVIDER Mask */ - -#define QSPI_SSCTL_SS_Pos (0) /*!< QSPI_T::SSCTL: SS Position */ -#define QSPI_SSCTL_SS_Msk (0x1ul << QSPI_SSCTL_SS_Pos) /*!< QSPI_T::SSCTL: SS Mask */ - -#define QSPI_SSCTL_SSACTPOL_Pos (2) /*!< QSPI_T::SSCTL: SSACTPOL Position */ -#define QSPI_SSCTL_SSACTPOL_Msk (0x1ul << QSPI_SSCTL_SSACTPOL_Pos) /*!< QSPI_T::SSCTL: SSACTPOL Mask */ - -#define QSPI_SSCTL_AUTOSS_Pos (3) /*!< QSPI_T::SSCTL: AUTOSS Position */ -#define QSPI_SSCTL_AUTOSS_Msk (0x1ul << QSPI_SSCTL_AUTOSS_Pos) /*!< QSPI_T::SSCTL: AUTOSS Mask */ - -#define QSPI_SSCTL_SLV3WIRE_Pos (4) /*!< QSPI_T::SSCTL: SLV3WIRE Position */ -#define QSPI_SSCTL_SLV3WIRE_Msk (0x1ul << QSPI_SSCTL_SLV3WIRE_Pos) /*!< QSPI_T::SSCTL: SLV3WIRE Mask */ - -#define QSPI_SSCTL_SLVTOIEN_Pos (5) /*!< QSPI_T::SSCTL: SLVTOIEN Position */ -#define QSPI_SSCTL_SLVTOIEN_Msk (0x1ul << QSPI_SSCTL_SLVTOIEN_Pos) /*!< QSPI_T::SSCTL: SLVTOIEN Mask */ - -#define QSPI_SSCTL_SLVTORST_Pos (6) /*!< QSPI_T::SSCTL: SLVTORST Position */ -#define QSPI_SSCTL_SLVTORST_Msk (0x1ul << QSPI_SSCTL_SLVTORST_Pos) /*!< QSPI_T::SSCTL: SLVTORST Mask */ - -#define QSPI_SSCTL_SLVBEIEN_Pos (8) /*!< QSPI_T::SSCTL: SLVBEIEN Position */ -#define QSPI_SSCTL_SLVBEIEN_Msk (0x1ul << QSPI_SSCTL_SLVBEIEN_Pos) /*!< QSPI_T::SSCTL: SLVBEIEN Mask */ - -#define QSPI_SSCTL_SLVURIEN_Pos (9) /*!< QSPI_T::SSCTL: SLVURIEN Position */ -#define QSPI_SSCTL_SLVURIEN_Msk (0x1ul << QSPI_SSCTL_SLVURIEN_Pos) /*!< QSPI_T::SSCTL: SLVURIEN Mask */ - -#define QSPI_SSCTL_SSACTIEN_Pos (12) /*!< QSPI_T::SSCTL: SSACTIEN Position */ -#define QSPI_SSCTL_SSACTIEN_Msk (0x1ul << QSPI_SSCTL_SSACTIEN_Pos) /*!< QSPI_T::SSCTL: SSACTIEN Mask */ - -#define QSPI_SSCTL_SSINAIEN_Pos (13) /*!< QSPI_T::SSCTL: SSINAIEN Position */ -#define QSPI_SSCTL_SSINAIEN_Msk (0x1ul << QSPI_SSCTL_SSINAIEN_Pos) /*!< QSPI_T::SSCTL: SSINAIEN Mask */ - -#define QSPI_SSCTL_SLVTOCNT_Pos (16) /*!< QSPI_T::SSCTL: SLVTOCNT Position */ -#define QSPI_SSCTL_SLVTOCNT_Msk (0xfffful << QSPI_SSCTL_SLVTOCNT_Pos) /*!< QSPI_T::SSCTL: SLVTOCNT Mask */ - -#define QSPI_PDMACTL_TXPDMAEN_Pos (0) /*!< QSPI_T::PDMACTL: TXPDMAEN Position */ -#define QSPI_PDMACTL_TXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_TXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: TXPDMAEN Mask */ - -#define QSPI_PDMACTL_RXPDMAEN_Pos (1) /*!< QSPI_T::PDMACTL: RXPDMAEN Position */ -#define QSPI_PDMACTL_RXPDMAEN_Msk (0x1ul << QSPI_PDMACTL_RXPDMAEN_Pos) /*!< QSPI_T::PDMACTL: RXPDMAEN Mask */ - -#define QSPI_PDMACTL_PDMARST_Pos (2) /*!< QSPI_T::PDMACTL: PDMARST Position */ -#define QSPI_PDMACTL_PDMARST_Msk (0x1ul << QSPI_PDMACTL_PDMARST_Pos) /*!< QSPI_T::PDMACTL: PDMARST Mask */ - -#define QSPI_FIFOCTL_RXRST_Pos (0) /*!< QSPI_T::FIFOCTL: RXRST Position */ -#define QSPI_FIFOCTL_RXRST_Msk (0x1ul << QSPI_FIFOCTL_RXRST_Pos) /*!< QSPI_T::FIFOCTL: RXRST Mask */ - -#define QSPI_FIFOCTL_TXRST_Pos (1) /*!< QSPI_T::FIFOCTL: TXRST Position */ -#define QSPI_FIFOCTL_TXRST_Msk (0x1ul << QSPI_FIFOCTL_TXRST_Pos) /*!< QSPI_T::FIFOCTL: TXRST Mask */ - -#define QSPI_FIFOCTL_RXTHIEN_Pos (2) /*!< QSPI_T::FIFOCTL: RXTHIEN Position */ -#define QSPI_FIFOCTL_RXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTHIEN Mask */ - -#define QSPI_FIFOCTL_TXTHIEN_Pos (3) /*!< QSPI_T::FIFOCTL: TXTHIEN Position */ -#define QSPI_FIFOCTL_TXTHIEN_Msk (0x1ul << QSPI_FIFOCTL_TXTHIEN_Pos) /*!< QSPI_T::FIFOCTL: TXTHIEN Mask */ - -#define QSPI_FIFOCTL_RXTOIEN_Pos (4) /*!< QSPI_T::FIFOCTL: RXTOIEN Position */ -#define QSPI_FIFOCTL_RXTOIEN_Msk (0x1ul << QSPI_FIFOCTL_RXTOIEN_Pos) /*!< QSPI_T::FIFOCTL: RXTOIEN Mask */ - -#define QSPI_FIFOCTL_RXOVIEN_Pos (5) /*!< QSPI_T::FIFOCTL: RXOVIEN Position */ -#define QSPI_FIFOCTL_RXOVIEN_Msk (0x1ul << QSPI_FIFOCTL_RXOVIEN_Pos) /*!< QSPI_T::FIFOCTL: RXOVIEN Mask */ - -#define QSPI_FIFOCTL_TXUFPOL_Pos (6) /*!< QSPI_T::FIFOCTL: TXUFPOL Position */ -#define QSPI_FIFOCTL_TXUFPOL_Msk (0x1ul << QSPI_FIFOCTL_TXUFPOL_Pos) /*!< QSPI_T::FIFOCTL: TXUFPOL Mask */ - -#define QSPI_FIFOCTL_TXUFIEN_Pos (7) /*!< QSPI_T::FIFOCTL: TXUFIEN Position */ -#define QSPI_FIFOCTL_TXUFIEN_Msk (0x1ul << QSPI_FIFOCTL_TXUFIEN_Pos) /*!< QSPI_T::FIFOCTL: TXUFIEN Mask */ - -#define QSPI_FIFOCTL_RXFBCLR_Pos (8) /*!< QSPI_T::FIFOCTL: RXFBCLR Position */ -#define QSPI_FIFOCTL_RXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_RXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: RXFBCLR Mask */ - -#define QSPI_FIFOCTL_TXFBCLR_Pos (9) /*!< QSPI_T::FIFOCTL: TXFBCLR Position */ -#define QSPI_FIFOCTL_TXFBCLR_Msk (0x1ul << QSPI_FIFOCTL_TXFBCLR_Pos) /*!< QSPI_T::FIFOCTL: TXFBCLR Mask */ - -#define QSPI_FIFOCTL_RXTH_Pos (24) /*!< QSPI_T::FIFOCTL: RXTH Position */ -#define QSPI_FIFOCTL_RXTH_Msk (0x7ul << QSPI_FIFOCTL_RXTH_Pos) /*!< QSPI_T::FIFOCTL: RXTH Mask */ - -#define QSPI_FIFOCTL_TXTH_Pos (28) /*!< QSPI_T::FIFOCTL: TXTH Position */ -#define QSPI_FIFOCTL_TXTH_Msk (0x7ul << QSPI_FIFOCTL_TXTH_Pos) /*!< QSPI_T::FIFOCTL: TXTH Mask */ - -#define QSPI_STATUS_BUSY_Pos (0) /*!< QSPI_T::STATUS: BUSY Position */ -#define QSPI_STATUS_BUSY_Msk (0x1ul << QSPI_STATUS_BUSY_Pos) /*!< QSPI_T::STATUS: BUSY Mask */ - -#define QSPI_STATUS_UNITIF_Pos (1) /*!< QSPI_T::STATUS: UNITIF Position */ -#define QSPI_STATUS_UNITIF_Msk (0x1ul << QSPI_STATUS_UNITIF_Pos) /*!< QSPI_T::STATUS: UNITIF Mask */ - -#define QSPI_STATUS_SSACTIF_Pos (2) /*!< QSPI_T::STATUS: SSACTIF Position */ -#define QSPI_STATUS_SSACTIF_Msk (0x1ul << QSPI_STATUS_SSACTIF_Pos) /*!< QSPI_T::STATUS: SSACTIF Mask */ - -#define QSPI_STATUS_SSINAIF_Pos (3) /*!< QSPI_T::STATUS: SSINAIF Position */ -#define QSPI_STATUS_SSINAIF_Msk (0x1ul << QSPI_STATUS_SSINAIF_Pos) /*!< QSPI_T::STATUS: SSINAIF Mask */ - -#define QSPI_STATUS_SSLINE_Pos (4) /*!< QSPI_T::STATUS: SSLINE Position */ -#define QSPI_STATUS_SSLINE_Msk (0x1ul << QSPI_STATUS_SSLINE_Pos) /*!< QSPI_T::STATUS: SSLINE Mask */ - -#define QSPI_STATUS_SLVTOIF_Pos (5) /*!< QSPI_T::STATUS: SLVTOIF Position */ -#define QSPI_STATUS_SLVTOIF_Msk (0x1ul << QSPI_STATUS_SLVTOIF_Pos) /*!< QSPI_T::STATUS: SLVTOIF Mask */ - -#define QSPI_STATUS_SLVBEIF_Pos (6) /*!< QSPI_T::STATUS: SLVBEIF Position */ -#define QSPI_STATUS_SLVBEIF_Msk (0x1ul << QSPI_STATUS_SLVBEIF_Pos) /*!< QSPI_T::STATUS: SLVBEIF Mask */ - -#define QSPI_STATUS_SLVURIF_Pos (7) /*!< QSPI_T::STATUS: SLVURIF Position */ -#define QSPI_STATUS_SLVURIF_Msk (0x1ul << QSPI_STATUS_SLVURIF_Pos) /*!< QSPI_T::STATUS: SLVURIF Mask */ - -#define QSPI_STATUS_RXEMPTY_Pos (8) /*!< QSPI_T::STATUS: RXEMPTY Position */ -#define QSPI_STATUS_RXEMPTY_Msk (0x1ul << QSPI_STATUS_RXEMPTY_Pos) /*!< QSPI_T::STATUS: RXEMPTY Mask */ - -#define QSPI_STATUS_RXFULL_Pos (9) /*!< QSPI_T::STATUS: RXFULL Position */ -#define QSPI_STATUS_RXFULL_Msk (0x1ul << QSPI_STATUS_RXFULL_Pos) /*!< QSPI_T::STATUS: RXFULL Mask */ - -#define QSPI_STATUS_RXTHIF_Pos (10) /*!< QSPI_T::STATUS: RXTHIF Position */ -#define QSPI_STATUS_RXTHIF_Msk (0x1ul << QSPI_STATUS_RXTHIF_Pos) /*!< QSPI_T::STATUS: RXTHIF Mask */ - -#define QSPI_STATUS_RXOVIF_Pos (11) /*!< QSPI_T::STATUS: RXOVIF Position */ -#define QSPI_STATUS_RXOVIF_Msk (0x1ul << QSPI_STATUS_RXOVIF_Pos) /*!< QSPI_T::STATUS: RXOVIF Mask */ - -#define QSPI_STATUS_RXTOIF_Pos (12) /*!< QSPI_T::STATUS: RXTOIF Position */ -#define QSPI_STATUS_RXTOIF_Msk (0x1ul << QSPI_STATUS_RXTOIF_Pos) /*!< QSPI_T::STATUS: RXTOIF Mask */ - -#define QSPI_STATUS_QSPIENSTS_Pos (15) /*!< QSPI_T::STATUS: QSPIENSTS Position */ -#define QSPI_STATUS_QSPIENSTS_Msk (0x1ul << QSPI_STATUS_QSPIENSTS_Pos) /*!< QSPI_T::STATUS: QSPIENSTS Mask */ - -#define QSPI_STATUS_TXEMPTY_Pos (16) /*!< QSPI_T::STATUS: TXEMPTY Position */ -#define QSPI_STATUS_TXEMPTY_Msk (0x1ul << QSPI_STATUS_TXEMPTY_Pos) /*!< QSPI_T::STATUS: TXEMPTY Mask */ - -#define QSPI_STATUS_TXFULL_Pos (17) /*!< QSPI_T::STATUS: TXFULL Position */ -#define QSPI_STATUS_TXFULL_Msk (0x1ul << QSPI_STATUS_TXFULL_Pos) /*!< QSPI_T::STATUS: TXFULL Mask */ - -#define QSPI_STATUS_TXTHIF_Pos (18) /*!< QSPI_T::STATUS: TXTHIF Position */ -#define QSPI_STATUS_TXTHIF_Msk (0x1ul << QSPI_STATUS_TXTHIF_Pos) /*!< QSPI_T::STATUS: TXTHIF Mask */ - -#define QSPI_STATUS_TXUFIF_Pos (19) /*!< QSPI_T::STATUS: TXUFIF Position */ -#define QSPI_STATUS_TXUFIF_Msk (0x1ul << QSPI_STATUS_TXUFIF_Pos) /*!< QSPI_T::STATUS: TXUFIF Mask */ - -#define QSPI_STATUS_TXRXRST_Pos (23) /*!< QSPI_T::STATUS: TXRXRST Position */ -#define QSPI_STATUS_TXRXRST_Msk (0x1ul << QSPI_STATUS_TXRXRST_Pos) /*!< QSPI_T::STATUS: TXRXRST Mask */ - -#define QSPI_STATUS_RXCNT_Pos (24) /*!< QSPI_T::STATUS: RXCNT Position */ -#define QSPI_STATUS_RXCNT_Msk (0xful << QSPI_STATUS_RXCNT_Pos) /*!< QSPI_T::STATUS: RXCNT Mask */ - -#define QSPI_STATUS_TXCNT_Pos (28) /*!< QSPI_T::STATUS: TXCNT Position */ -#define QSPI_STATUS_TXCNT_Msk (0xful << QSPI_STATUS_TXCNT_Pos) /*!< QSPI_T::STATUS: TXCNT Mask */ - -#define QSPI_TX_TX_Pos (0) /*!< QSPI_T::TX: TX Position */ -#define QSPI_TX_TX_Msk (0xfffffffful << QSPI_TX_TX_Pos) /*!< QSPI_T::TX: TX Mask */ - -#define QSPI_RX_RX_Pos (0) /*!< QSPI_T::RX: RX Position */ -#define QSPI_RX_RX_Msk (0xfffffffful << QSPI_RX_RX_Pos) /*!< QSPI_T::RX: RX Mask */ - - -/**@}*/ /* QSPI_CONST */ -/**@}*/ /* end of QSPI register group */ -/**@}*/ /* end of REGISTER group */ - -#define QSPI0 ((QSPI_T *) QSPI0_BA) - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - -/** @addtogroup QSPI_EXPORTED_CONSTANTS QSPI Exported Constants - @{ -*/ - -#define QSPI_MODE_0 (QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define QSPI_MODE_1 (QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_2 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define QSPI_MODE_3 (QSPI_CTL_CLKPOL_Msk | QSPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define QSPI_SLAVE (QSPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define QSPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define QSPI_SS (QSPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define QSPI_SS_ACTIVE_HIGH (QSPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define QSPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* QSPI Interrupt Mask */ -#define QSPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define QSPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define QSPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define QSPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define QSPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define QSPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define QSPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define QSPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* QSPI Status Mask */ -#define QSPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define QSPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define QSPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define QSPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define QSPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define QSPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define QSPI_QSPIEN_STS_MASK (0x40U) /*!< QSPIEN status mask \hideinitializer */ -#define QSPI_SSLINE_STS_MASK (0x80U) /*!< QSPIx_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group QSPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Write 1 to UNITIF bit of QSPI_STATUS register to clear the unit transfer interrupt flag. - * \hideinitializer - */ -#define QSPI_CLR_UNIT_TRANS_INT_FLAG(qspi) ((qspi)->STATUS = QSPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set RXPDMAEN bit of QSPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_RX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set TXPDMAEN bit of QSPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_TRIGGER_TX_PDMA(qspi) ((qspi)->PDMACTL |= QSPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear RXPDMAEN bit of QSPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_RX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear TXPDMAEN bit of QSPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define QSPI_DISABLE_TX_PDMA(qspi) ( (qspi)->PDMACTL &= ~QSPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] qspi The pointer of the specified QSPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (QSPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_COUNT(qspi) (((qspi)->STATUS & QSPI_STATUS_RXCNT_Msk) >> QSPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of QSPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_RX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_RXEMPTY_Msk)>>QSPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of QSPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_EMPTY_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXEMPTY_Msk)>>QSPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of QSPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define QSPI_GET_TX_FIFO_FULL_FLAG(qspi) (((qspi)->STATUS & QSPI_STATUS_TXFULL_Msk)>>QSPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Data in RX register. - * @details Read QSPI_RX register to get the received datum. - * \hideinitializer - */ -#define QSPI_READ_RX(qspi) ((qspi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxData The datum which user attempt to transfer through QSPI bus. - * @return None. - * @details Write u32TxData to QSPI_TX register. - * \hideinitializer - */ -#define QSPI_WRITE_TX(qspi, u32TxData) ((qspi)->TX = (u32TxData)) - -/** - * @brief Set QSPIx_SS pin to high state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to high state. - * \hideinitializer - */ -#define QSPI_SET_SS_HIGH(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~QSPI_SSCTL_AUTOSS_Msk)) | (QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk)) - -/** - * @brief Set QSPIx_SS pin to low state. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Disable automatic slave selection function and set QSPIx_SS pin to low state. - * \hideinitializer - */ -#define QSPI_SET_SS_LOW(qspi) ((qspi)->SSCTL = ((qspi)->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk))) | QSPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (QSPI_CTL[7:4]). - * \hideinitializer - */ -#define QSPI_ENABLE_BYTE_REORDER(qspi) ((qspi)->CTL |= QSPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear REORDER bit field of QSPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define QSPI_DISABLE_BYTE_REORDER(qspi) ((qspi)->CTL &= ~QSPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one QSPI bus clock cycle). - * \hideinitializer - */ -#define QSPI_SET_SUSPEND_CYCLE(qspi, u32SuspCycle) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << QSPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the QSPI transfer sequence with LSB first. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set LSB bit of QSPI_CTL register to set the QSPI transfer sequence with LSB first. - * \hideinitializer - */ -#define QSPI_SET_LSB_FIRST(qspi) ((qspi)->CTL |= QSPI_CTL_LSB_Msk) - -/** - * @brief Set the QSPI transfer sequence with MSB first. - * @param[in] qspi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of QSPI_CTL register to set the QSPI transfer sequence with MSB first. - * \hideinitializer - */ -#define QSPI_SET_MSB_FIRST(qspi) ((qspi)->CTL &= ~QSPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a QSPI transaction. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define QSPI_SET_DATA_WIDTH(qspi, u32Width) ((qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << QSPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the QSPI busy state. - * @param[in] qspi The pointer of the specified QSPI module. - * @retval 0 QSPI controller is not busy. - * @retval 1 QSPI controller is busy. - * @details This macro will return the busy state of QSPI controller. - * \hideinitializer - */ -#define QSPI_IS_BUSY(qspi) ( ((qspi)->STATUS & QSPI_STATUS_BUSY_Msk)>>QSPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Set QSPIEN (QSPI_CTL[0]) to enable QSPI controller. - * \hideinitializer - */ -#define QSPI_ENABLE(qspi) ((qspi)->CTL |= QSPI_CTL_QSPIEN_Msk) - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None. - * @details Clear QSPIEN (QSPI_CTL[0]) to disable QSPI controller. - * \hideinitializer - */ -#define QSPI_DISABLE(qspi) ((qspi)->CTL &= ~QSPI_CTL_QSPIEN_Msk) - -/** - * @brief Disable QSPI Dual IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_DUAL_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Enable Dual IO function and set QSPI Dual IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_DUAL_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_DUALIOEN_Msk ) - -/** - * @brief Disable QSPI Dual IO function. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_DISABLE_QUAD_MODE(qspi) ( (qspi)->CTL &= ~QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to input. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_INPUT_MODE(qspi) ( (qspi)->CTL = ((qspi)->CTL & ~QSPI_CTL_DATDIR_Msk) | QSPI_CTL_QUADIOEN_Msk ) - -/** - * @brief Set QSPI Quad IO direction to output. - * @param[in] qspi is the base address of QSPI module. - * @return none - * \hideinitializer - */ -#define QSPI_ENABLE_QUAD_OUTPUT_MODE(qspi) ( (qspi)->CTL |= QSPI_CTL_DATDIR_Msk | QSPI_CTL_QUADIOEN_Msk ) - - - - -/* Function prototype declaration */ -uint32_t QSPI_Open(QSPI_T *qspi, uint32_t u32MasterSlave, uint32_t u32QSPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void QSPI_Close(QSPI_T *qspi); -void QSPI_ClearRxFIFO(QSPI_T *qspi); -void QSPI_ClearTxFIFO(QSPI_T *qspi); -void QSPI_DisableAutoSS(QSPI_T *qspi); -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock); -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t QSPI_GetBusClock(QSPI_T *qspi); -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask); -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask); -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask); - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_rtc.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_rtc.h deleted file mode 100644 index 57664229796..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_rtc.h +++ /dev/null @@ -1,445 +0,0 @@ -/**************************************************************************//** - * @file rtc.h - * @version V3.00 - * @brief NUC980 series RTC driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_RTC_H__ -#define __NU_RTC_H__ - -#include -#include -#include -#include "nuc980.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_CONSTANTS RTC Exported Constants - @{ -*/ -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Initial Keyword Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_INIT_KEY 0xA5EB1357UL /*!< RTC Initiation Key to make RTC leaving reset state \hideinitializer */ -#define RTC_WRITE_KEY 0x0000A965UL /*!< RTC Register Access Enable Key to enable RTC read/write accessible and kept 1024 RTC clock \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Time Attribute Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_CLOCK_12 0UL /*!< RTC as 12-hour time scale with AM and PM indication \hideinitializer */ -#define RTC_CLOCK_24 1UL /*!< RTC as 24-hour time scale \hideinitializer */ -#define RTC_AM 1UL /*!< RTC as AM indication \hideinitializer */ -#define RTC_PM 2UL /*!< RTC as PM indication \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Tick Period Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_TICK_1_SEC 0x0UL /*!< RTC time tick period is 1 second \hideinitializer */ -#define RTC_TICK_1_2_SEC 0x1UL /*!< RTC time tick period is 1/2 second \hideinitializer */ -#define RTC_TICK_1_4_SEC 0x2UL /*!< RTC time tick period is 1/4 second \hideinitializer */ -#define RTC_TICK_1_8_SEC 0x3UL /*!< RTC time tick period is 1/8 second \hideinitializer */ -#define RTC_TICK_1_16_SEC 0x4UL /*!< RTC time tick period is 1/16 second \hideinitializer */ -#define RTC_TICK_1_32_SEC 0x5UL /*!< RTC time tick period is 1/32 second \hideinitializer */ -#define RTC_TICK_1_64_SEC 0x6UL /*!< RTC time tick period is 1/64 second \hideinitializer */ -#define RTC_TICK_1_128_SEC 0x7UL /*!< RTC time tick period is 1/128 second \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Day of Week Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_SUNDAY 0x0UL /*!< Day of the Week is Sunday \hideinitializer */ -#define RTC_MONDAY 0x1UL /*!< Day of the Week is Monday \hideinitializer */ -#define RTC_TUESDAY 0x2UL /*!< Day of the Week is Tuesday \hideinitializer */ -#define RTC_WEDNESDAY 0x3UL /*!< Day of the Week is Wednesday \hideinitializer */ -#define RTC_THURSDAY 0x4UL /*!< Day of the Week is Thursday \hideinitializer */ -#define RTC_FRIDAY 0x5UL /*!< Day of the Week is Friday \hideinitializer */ -#define RTC_SATURDAY 0x6UL /*!< Day of the Week is Saturday \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* RTC Miscellaneous Constant Definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_WAIT_COUNT 0xFFFFFFFFUL /*!< Initial Time-out Value \hideinitializer */ -#define RTC_YEAR2000 2000UL /*!< RTC Reference for compute year data \hideinitializer */ -#define RTC_FCR_REFERENCE 32761UL /*!< RTC Reference for frequency compensation \hideinitializer */ - -#define RTC_2POW10_CLK (0x0 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 RTC clock cycles \hideinitializer */ -#define RTC_2POW11_CLK (0x1 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 2 RTC clock cycles \hideinitializer */ -#define RTC_2POW12_CLK (0x2 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 4 RTC clock cycles \hideinitializer */ -#define RTC_2POW13_CLK (0x3 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 6 RTC clock cycles \hideinitializer */ -#define RTC_2POW14_CLK (0x4 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 8 RTC clock cycles \hideinitializer */ -#define RTC_2POW15_CLK (0x5 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 16 RTC clock cycles \hideinitializer */ -#define RTC_2POW16_CLK (0x6 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 32 RTC clock cycles \hideinitializer */ -#define RTC_2POW17_CLK (0x7 << RTC_TAMPCTL_DYNRATE_Pos) /*!< 1024 x 64 RTC clock cycles \hideinitializer */ - -#define REF_RANDOM_PATTERN 0x0 /*!< The new reference pattern is generated by random number generator when the reference pattern run out \hideinitializer */ -#define REF_PREVIOUS_PATTERN 0x1 /*!< The new reference pattern is repeated previous random value when the reference pattern run out \hideinitializer */ -#define REF_SEED 0x3 /*!< The new reference pattern is repeated from SEED (RTC_TAMPSEED[31:0]) when the reference pattern run out \hideinitializer */ - -/*@}*/ /* end of group RTC_EXPORTED_CONSTANTS */ - - -/** @addtogroup RTC_EXPORTED_STRUCTS RTC Exported Structs - @{ -*/ -/** - * @details RTC define Time Data Struct - */ -typedef struct -{ - uint32_t u32Year; /*!< Year value */ - uint32_t u32Month; /*!< Month value */ - uint32_t u32Day; /*!< Day value */ - uint32_t u32DayOfWeek; /*!< Day of week value */ - uint32_t u32Hour; /*!< Hour value */ - uint32_t u32Minute; /*!< Minute value */ - uint32_t u32Second; /*!< Second value */ - uint32_t u32TimeScale; /*!< 12-Hour, 24-Hour */ - uint32_t u32AmPm; /*!< Only Time Scale select 12-hr used */ -} S_RTC_TIME_DATA_T; - -/*@}*/ /* end of group RTC_EXPORTED_STRUCTS */ - - -typedef struct -{ - __IO uint32_t INIT; /*!< [0x0000] RTC Initiation Register */ - __IO uint32_t RWEN; /*!< [0x0004] RTC Access Enable Register */ - __IO uint32_t FREQADJ; /*!< [0x0008] RTC Frequency Compensation Register */ - __IO uint32_t TIME; /*!< [0x000c] RTC Time Loading Register */ - __IO uint32_t CAL; /*!< [0x0010] RTC Calendar Loading Register */ - __IO uint32_t CLKFMT; /*!< [0x0014] RTC Time Scale Selection Register */ - __IO uint32_t WEEKDAY; /*!< [0x0018] RTC Day of the Week Register */ - __IO uint32_t TALM; /*!< [0x001c] RTC Time Alarm Register */ - __IO uint32_t CALM; /*!< [0x0020] RTC Calendar Alarm Register */ - __I uint32_t LEAPYEAR; /*!< [0x0024] RTC Leap Year Indicator Register */ - __IO uint32_t INTEN; /*!< [0x0028] RTC Interrupt Enable Register */ - __IO uint32_t INTSTS; /*!< [0x002c] RTC Interrupt Status Register */ - __IO uint32_t TICK; /*!< [0x0030] RTC Time Tick Register */ - __IO uint32_t PWRCTL; /*!< [0x0034] RTC Power Control Register */ - __IO uint32_t PWRCNT; /*!< [0x0038] RTC Power Control Counter Register */ - __IO uint32_t RESERVE0; /*!< [0x003c] RTC Spare Functional Control Register */ - __I uint32_t SPR[16]; /*!< [0x0040] ~ [0x007c] RTC Spare Register 0 ~ 15 */ -} RTC_T; - -#define RTC_INIT_ACTIVE_Pos (0) /*!< RTC_T::INIT: INIT_ACTIVE Position */ -#define RTC_INIT_ACTIVE_Msk (0x1ul << RTC_INIT_ACTIVE_Pos) /*!< RTC_T::INIT: INIT_ACTIVE Mask */ - -#define RTC_INIT_INIT_Pos (1) /*!< RTC_T::INIT: INIT Position */ -#define RTC_INIT_INIT_Msk (0x7ffffffful << RTC_INIT_INIT_Pos) /*!< RTC_T::INIT: INIT Mask */ - -#define RTC_RWEN_RWENF_Pos (16) /*!< RTC_T::RWEN: RWENF Position */ -#define RTC_RWEN_RWENF_Msk (0x1ul << RTC_RWEN_RWENF_Pos) /*!< RTC_T::RWEN: RWENF Mask */ - -#define RTC_RWEN_RTCBUSY_Pos (24) /*!< RTC_T::RWEN: RTCBUSY Position */ -#define RTC_RWEN_RTCBUSY_Msk (0x1ul << RTC_RWEN_RTCBUSY_Pos) /*!< RTC_T::RWEN: RTCBUSY Mask */ - -#define RTC_FREQADJ_FRACTION_Pos (0) /*!< RTC_T::FRACTION: FRACTION Position */ -#define RTC_FREQADJ_FRACTION_Msk (0x3ful << RTC_FREQADJ_FRACTION_Pos) /*!< RTC_T::FRACTION: FRACTION Mask */ - -#define RTC_INTEGER_FRACTION_Pos (8) /*!< RTC_T::INTEGER: INTEGER Position */ -#define RTC_INTEGER_FRACTION_Msk (0xful << RTC_FREQADJ_INTEGER_Pos) /*!< RTC_T::INTEGER: INTEGER Mask */ - -#define RTC_TIME_SEC_Pos (0) /*!< RTC_T::TIME: SEC Position */ -#define RTC_TIME_SEC_Msk (0xful << RTC_TIME_SEC_Pos) /*!< RTC_T::TIME: SEC Mask */ - -#define RTC_TIME_TENSEC_Pos (4) /*!< RTC_T::TIME: TENSEC Position */ -#define RTC_TIME_TENSEC_Msk (0x7ul << RTC_TIME_TENSEC_Pos) /*!< RTC_T::TIME: TENSEC Mask */ - -#define RTC_TIME_MIN_Pos (8) /*!< RTC_T::TIME: MIN Position */ -#define RTC_TIME_MIN_Msk (0xful << RTC_TIME_MIN_Pos) /*!< RTC_T::TIME: MIN Mask */ - -#define RTC_TIME_TENMIN_Pos (12) /*!< RTC_T::TIME: TENMIN Position */ -#define RTC_TIME_TENMIN_Msk (0x7ul << RTC_TIME_TENMIN_Pos) /*!< RTC_T::TIME: TENMIN Mask */ - -#define RTC_TIME_HR_Pos (16) /*!< RTC_T::TIME: HR Position */ -#define RTC_TIME_HR_Msk (0xful << RTC_TIME_HR_Pos) /*!< RTC_T::TIME: HR Mask */ - -#define RTC_TIME_TENHR_Pos (20) /*!< RTC_T::TIME: TENHR Position */ -#define RTC_TIME_TENHR_Msk (0x3ul << RTC_TIME_TENHR_Pos) /*!< RTC_T::TIME: TENHR Mask */ - -#define RTC_CAL_DAY_Pos (0) /*!< RTC_T::CAL: DAY Position */ -#define RTC_CAL_DAY_Msk (0xful << RTC_CAL_DAY_Pos) /*!< RTC_T::CAL: DAY Mask */ - -#define RTC_CAL_TENDAY_Pos (4) /*!< RTC_T::CAL: TENDAY Position */ -#define RTC_CAL_TENDAY_Msk (0x3ul << RTC_CAL_TENDAY_Pos) /*!< RTC_T::CAL: TENDAY Mask */ - -#define RTC_CAL_MON_Pos (8) /*!< RTC_T::CAL: MON Position */ -#define RTC_CAL_MON_Msk (0xful << RTC_CAL_MON_Pos) /*!< RTC_T::CAL: MON Mask */ - -#define RTC_CAL_TENMON_Pos (12) /*!< RTC_T::CAL: TENMON Position */ -#define RTC_CAL_TENMON_Msk (0x1ul << RTC_CAL_TENMON_Pos) /*!< RTC_T::CAL: TENMON Mask */ - -#define RTC_CAL_YEAR_Pos (16) /*!< RTC_T::CAL: YEAR Position */ -#define RTC_CAL_YEAR_Msk (0xful << RTC_CAL_YEAR_Pos) /*!< RTC_T::CAL: YEAR Mask */ - -#define RTC_CAL_TENYEAR_Pos (20) /*!< RTC_T::CAL: TENYEAR Position */ -#define RTC_CAL_TENYEAR_Msk (0xful << RTC_CAL_TENYEAR_Pos) /*!< RTC_T::CAL: TENYEAR Mask */ - -#define RTC_CLKFMT_24HEN_Pos (0) /*!< RTC_T::CLKFMT: 24HEN Position */ -#define RTC_CLKFMT_24HEN_Msk (0x1ul << RTC_CLKFMT_24HEN_Pos) /*!< RTC_T::CLKFMT: 24HEN Mask */ - -#define RTC_WEEKDAY_WEEKDAY_Pos (0) /*!< RTC_T::WEEKDAY: WEEKDAY Position */ -#define RTC_WEEKDAY_WEEKDAY_Msk (0x7ul << RTC_WEEKDAY_WEEKDAY_Pos) /*!< RTC_T::WEEKDAY: WEEKDAY Mask */ - -#define RTC_TALM_SEC_Pos (0) /*!< RTC_T::TALM: SEC Position */ -#define RTC_TALM_SEC_Msk (0xful << RTC_TALM_SEC_Pos) /*!< RTC_T::TALM: SEC Mask */ - -#define RTC_TALM_TENSEC_Pos (4) /*!< RTC_T::TALM: TENSEC Position */ -#define RTC_TALM_TENSEC_Msk (0x7ul << RTC_TALM_TENSEC_Pos) /*!< RTC_T::TALM: TENSEC Mask */ - -#define RTC_TALM_MIN_Pos (8) /*!< RTC_T::TALM: MIN Position */ -#define RTC_TALM_MIN_Msk (0xful << RTC_TALM_MIN_Pos) /*!< RTC_T::TALM: MIN Mask */ - -#define RTC_TALM_TENMIN_Pos (12) /*!< RTC_T::TALM: TENMIN Position */ -#define RTC_TALM_TENMIN_Msk (0x7ul << RTC_TALM_TENMIN_Pos) /*!< RTC_T::TALM: TENMIN Mask */ - -#define RTC_TALM_HR_Pos (16) /*!< RTC_T::TALM: HR Position */ -#define RTC_TALM_HR_Msk (0xful << RTC_TALM_HR_Pos) /*!< RTC_T::TALM: HR Mask */ - -#define RTC_TALM_TENHR_Pos (20) /*!< RTC_T::TALM: TENHR Position */ -#define RTC_TALM_TENHR_Msk (0x3ul << RTC_TALM_TENHR_Pos) /*!< RTC_T::TALM: TENHR Mask */ - -#define RTC_CALM_DAY_Pos (0) /*!< RTC_T::CALM: DAY Position */ -#define RTC_CALM_DAY_Msk (0xful << RTC_CALM_DAY_Pos) /*!< RTC_T::CALM: DAY Mask */ - -#define RTC_CALM_TENDAY_Pos (4) /*!< RTC_T::CALM: TENDAY Position */ -#define RTC_CALM_TENDAY_Msk (0x3ul << RTC_CALM_TENDAY_Pos) /*!< RTC_T::CALM: TENDAY Mask */ - -#define RTC_CALM_MON_Pos (8) /*!< RTC_T::CALM: MON Position */ -#define RTC_CALM_MON_Msk (0xful << RTC_CALM_MON_Pos) /*!< RTC_T::CALM: MON Mask */ - -#define RTC_CALM_TENMON_Pos (12) /*!< RTC_T::CALM: TENMON Position */ -#define RTC_CALM_TENMON_Msk (0x1ul << RTC_CALM_TENMON_Pos) /*!< RTC_T::CALM: TENMON Mask */ - -#define RTC_CALM_YEAR_Pos (16) /*!< RTC_T::CALM: YEAR Position */ -#define RTC_CALM_YEAR_Msk (0xful << RTC_CALM_YEAR_Pos) /*!< RTC_T::CALM: YEAR Mask */ - -#define RTC_CALM_TENYEAR_Pos (20) /*!< RTC_T::CALM: TENYEAR Position */ -#define RTC_CALM_TENYEAR_Msk (0xful << RTC_CALM_TENYEAR_Pos) /*!< RTC_T::CALM: TENYEAR Mask */ - -#define RTC_LEAPYEAR_LEAPYEAR_Pos (0) /*!< RTC_T::LEAPYEAR: LEAPYEAR Position */ -#define RTC_LEAPYEAR_LEAPYEAR_Msk (0x1ul << RTC_LEAPYEAR_LEAPYEAR_Pos) /*!< RTC_T::LEAPYEAR: LEAPYEAR Mask */ - -#define RTC_INTEN_ALMIEN_Pos (0) /*!< RTC_T::INTEN: ALMIEN Position */ -#define RTC_INTEN_ALMIEN_Msk (0x1ul << RTC_INTEN_ALMIEN_Pos) /*!< RTC_T::INTEN: ALMIEN Mask */ - -#define RTC_INTEN_TICKIEN_Pos (1) /*!< RTC_T::INTEN: TICKIEN Position */ -#define RTC_INTEN_TICKIEN_Msk (0x1ul << RTC_INTEN_TICKIEN_Pos) /*!< RTC_T::INTEN: TICKIEN Mask */ - -#define RTC_INTEN_WAKEUPIEN_Pos (2) /*!< RTC INTEN: WAKEUPIEN Position */ -#define RTC_INTEN_WAKEUPIEN_Msk (0x1ul << RTC_INTEN_WAKEUPIEN_Pos) /*!< RTC INTEN: WAKEUPIEN Mask */ - -#define RTC_INTEN_RELALMIEN_Pos (4) /*!< RTC INTEN: RELALMIEN Position */ -#define RTC_INTEN_RELALMIEN_Msk (0x1ul << RTC_INTEN_RELALMIEN_Pos) /*!< RTC INTEN: RELALMIEN Mask */ - -#define RTC_INTSTS_ALMIF_Pos (0) /*!< RTC_T::INTSTS: ALMIF Position */ -#define RTC_INTSTS_ALMIF_Msk (0x1ul << RTC_INTSTS_ALMIF_Pos) /*!< RTC_T::INTSTS: ALMIF Mask */ - -#define RTC_INTSTS_TICKIF_Pos (1) /*!< RTC_T::INTSTS: TICKIF Position */ -#define RTC_INTSTS_TICKIF_Msk (0x1ul << RTC_INTSTS_TICKIF_Pos) /*!< RTC_T::INTSTS: TICKIF Mask */ - -#define RTC_INTSTS_WAKEUPINT_Pos (2) /*!< RTC INTSTS: WAKEUPINT Position */ -#define RTC_INTSTS_WAKEUPINT_Msk (0x1ul << RTC_INTSTS_WAKEUPINT_Pos) /*!< RTC INTSTS: WAKEUPINT Mask */ - -#define RTC_INTSTS_REGWRBUSY_Pos (31) /*!< RTC INTSTS: REGWRBUSY Position */ -#define RTC_INTSTS_REGWRBUSY_Msk (0x1ul << RTC_INTSTS_REGWRBUSY_Pos) /*!< RTC INTSTS: REGWRBUSY Mask */ - -#define RTC_TICK_TICK_Pos (0) /*!< RTC_T::TICK: TICK Position */ -#define RTC_TICK_TICK_Msk (0x7ul << RTC_TICK_TICK_Pos) /*!< RTC_T::TICK: TICK Mask */ - -#define RTC_PWRCTL_ALARM_EN_Pos (3) -#define RTC_PWRCTL_ALARM_EN_Msk (0x1ul << RTC_PWRCTL_ALARM_EN_Pos) - -#define RTC_PWRCTL_REL_ALARM_EN_Pos (4) -#define RTC_PWRCTL_REL_ALARM_EN_Msk (0x1ul << RTC_PWRCTL_REL_ALARM_EN_Pos) - -#define RTC_PWRCTL_RELALM_TIME_Pos (16) -#define RTC_PWRCTL_RELALM_TIME_Msk (0xffful << RTC_PWRCTL_RELALM_TIME_Pos) - -#define RTC_SPR0_SPARE_Pos (0) /*!< RTC_T::SPR0: SPARE Position */ -#define RTC_SPR0_SPARE_Msk (0xfffffffful << RTC_SPR0_SPARE_Pos) /*!< RTC_T::SPR0: SPARE Mask */ - -#define RTC_SPR1_SPARE_Pos (0) /*!< RTC_T::SPR1: SPARE Position */ -#define RTC_SPR1_SPARE_Msk (0xfffffffful << RTC_SPR1_SPARE_Pos) /*!< RTC_T::SPR1: SPARE Mask */ - -#define RTC_SPR2_SPARE_Pos (0) /*!< RTC_T::SPR2: SPARE Position */ -#define RTC_SPR2_SPARE_Msk (0xfffffffful << RTC_SPR2_SPARE_Pos) /*!< RTC_T::SPR2: SPARE Mask */ - -#define RTC_SPR3_SPARE_Pos (0) /*!< RTC_T::SPR3: SPARE Position */ -#define RTC_SPR3_SPARE_Msk (0xfffffffful << RTC_SPR3_SPARE_Pos) /*!< RTC_T::SPR3: SPARE Mask */ - -#define RTC_SPR4_SPARE_Pos (0) /*!< RTC_T::SPR4: SPARE Position */ -#define RTC_SPR4_SPARE_Msk (0xfffffffful << RTC_SPR4_SPARE_Pos) /*!< RTC_T::SPR4: SPARE Mask */ - -#define RTC_SPR5_SPARE_Pos (0) /*!< RTC_T::SPR5: SPARE Position */ -#define RTC_SPR5_SPARE_Msk (0xfffffffful << RTC_SPR5_SPARE_Pos) /*!< RTC_T::SPR5: SPARE Mask */ - -#define RTC_SPR6_SPARE_Pos (0) /*!< RTC_T::SPR6: SPARE Position */ -#define RTC_SPR6_SPARE_Msk (0xfffffffful << RTC_SPR6_SPARE_Pos) /*!< RTC_T::SPR6: SPARE Mask */ - -#define RTC_SPR7_SPARE_Pos (0) /*!< RTC_T::SPR7: SPARE Position */ -#define RTC_SPR7_SPARE_Msk (0xfffffffful << RTC_SPR7_SPARE_Pos) /*!< RTC_T::SPR7: SPARE Mask */ - -#define RTC_SPR8_SPARE_Pos (0) /*!< RTC_T::SPR8: SPARE Position */ -#define RTC_SPR8_SPARE_Msk (0xfffffffful << RTC_SPR8_SPARE_Pos) /*!< RTC_T::SPR8: SPARE Mask */ - -#define RTC_SPR9_SPARE_Pos (0) /*!< RTC_T::SPR9: SPARE Position */ -#define RTC_SPR9_SPARE_Msk (0xfffffffful << RTC_SPR9_SPARE_Pos) /*!< RTC_T::SPR9: SPARE Mask */ - -#define RTC_SPR10_SPARE_Pos (0) /*!< RTC_T::SPR10: SPARE Position */ -#define RTC_SPR10_SPARE_Msk (0xfffffffful << RTC_SPR10_SPARE_Pos) /*!< RTC_T::SPR10: SPARE Mask */ - -#define RTC_SPR11_SPARE_Pos (0) /*!< RTC_T::SPR11: SPARE Position */ -#define RTC_SPR11_SPARE_Msk (0xfffffffful << RTC_SPR11_SPARE_Pos) /*!< RTC_T::SPR11: SPARE Mask */ - -#define RTC_SPR12_SPARE_Pos (0) /*!< RTC_T::SPR12: SPARE Position */ -#define RTC_SPR12_SPARE_Msk (0xfffffffful << RTC_SPR12_SPARE_Pos) /*!< RTC_T::SPR12: SPARE Mask */ - -#define RTC_SPR13_SPARE_Pos (0) /*!< RTC_T::SPR13: SPARE Position */ -#define RTC_SPR13_SPARE_Msk (0xfffffffful << RTC_SPR13_SPARE_Pos) /*!< RTC_T::SPR13: SPARE Mask */ - -#define RTC_SPR14_SPARE_Pos (0) /*!< RTC_T::SPR14: SPARE Position */ -#define RTC_SPR14_SPARE_Msk (0xfffffffful << RTC_SPR14_SPARE_Pos) /*!< RTC_T::SPR14: SPARE Mask */ - -#define RTC_SPR15_SPARE_Pos (0) /*!< RTC_T::SPR15: SPARE Position */ -#define RTC_SPR15_SPARE_Msk (0xfffffffful << RTC_SPR15_SPARE_Pos) /*!< RTC_T::SPR15: SPARE Mask */ - - -#define RTC ((RTC_T *) RTC_BA) - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Indicate is Leap Year or not - * - * @param None - * - * @retval 0 This year is not a leap year - * @retval 1 This year is a leap year - * - * @details According to current date, return this year is leap year or not. - * \hideinitializer - */ -#define RTC_IS_LEAP_YEAR() (RTC->LEAPYEAR & RTC_LEAPYEAR_LEAPYEAR_Msk ? 1:0) - -/** - * @brief Clear RTC Alarm Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC alarm interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_ALARM_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_ALMIF_Msk) - -/** - * @brief Clear RTC Tick Interrupt Flag - * - * @param None - * - * @return None - * - * @details This macro is used to clear RTC tick interrupt flag. - * \hideinitializer - */ -#define RTC_CLEAR_TICK_INT_FLAG() (RTC->INTSTS = RTC_INTSTS_TICKIF_Msk) - -/** - * @brief Get RTC Alarm Interrupt Flag - * - * @param None - * - * @retval 0 RTC alarm interrupt did not occur - * @retval 1 RTC alarm interrupt occurred - * - * @details This macro indicates RTC alarm interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_ALARM_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_ALMIF_Msk)? 1:0) - -/** - * @brief Get RTC Time Tick Interrupt Flag - * - * @param None - * - * @retval 0 RTC time tick interrupt did not occur - * @retval 1 RTC time tick interrupt occurred - * - * @details This macro indicates RTC time tick interrupt occurred or not. - * \hideinitializer - */ -#define RTC_GET_TICK_INT_FLAG() ((RTC->INTSTS & RTC_INTSTS_TICKIF_Msk)? 1:0) - -/** - * @brief Read Spare Register - * - * @param[in] u32RegNum The spare register number, 0~19. - * - * @return Spare register content - * - * @details Read the specify spare register content. - * @note The returned value is valid only when SPRRDY(SPRCTL[7] SPR Register Ready) bit is set. \n - * And its controlled by RTC Access Enable Register. - * \hideinitializer - */ -#define RTC_READ_SPARE_REGISTER(u32RegNum) (RTC->SPR[(u32RegNum)]) - -/** - * @brief Write Spare Register - * - * @param[in] u32RegNum The spare register number, 0~19. - * @param[in] u32RegValue The spare register value. - * - * @return None - * - * @details Write specify data to spare register. - * @note This macro is effect only when SPRRDY(SPRCTL[7] SPR Register Ready) bit is set. \n - * And its controlled by RTC Access Enable Register(RTC_RWEN). - * \hideinitializer - */ -#define RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue) (RTC->SPR[(u32RegNum)] = (u32RegValue)) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -void RTC_WaitAccessEnable(void); -void RTC_Check(void); - -void RTC_Open(S_RTC_TIME_DATA_T *sPt); -void RTC_Close(void); -void RTC_32KCalibration(int32_t i32FrequencyX100); -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt); -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek); -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek); -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm); -uint32_t RTC_GetDayOfWeek(void); -void RTC_SetTickPeriod(uint32_t u32TickSelection); -void RTC_EnableInt(uint32_t u32IntFlagMask); -void RTC_DisableInt(uint32_t u32IntFlagMask); -void RTC_EnableSpareAccess(void); -void RTC_DisableSpareRegister(void); - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#endif /* __NU_RTC_H__ */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sc.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sc.h deleted file mode 100644 index 935de24b93a..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sc.h +++ /dev/null @@ -1,425 +0,0 @@ -/**************************************************************************//** - * @file sc.h - * @brief NUC980 Smartcard (SC) driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_SC_H__ -#define __NU_SC_H__ -#include "nuc980.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SC_Driver SC Driver - @{ -*/ - -/** @addtogroup SC_EXPORTED_CONSTANTS SC Exported Constants - @{ -*/ -#define SC_INTERFACE_NUM 2 /*!< Smartcard interface numbers */ /* NUC980 series has two SC interface */ -#define SC_PIN_STATE_HIGH 1 /*!< Smartcard pin status high */ -#define SC_PIN_STATE_LOW 0 /*!< Smartcard pin status low */ -#define SC_PIN_STATE_IGNORE 0xFFFFFFFF /*!< Ignore pin status */ -#define SC_CLK_ON 1 /*!< Smartcard clock on */ -#define SC_CLK_OFF 0 /*!< Smartcard clock off */ - -#define SC_TMR_MODE_0 (0ul << 24) /*! - -#ifndef __NU_SDH_H__ -#define __NU_SDH_H__ - -#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 */ - -#define TIMER0 0 - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SDH SD/SDIO Host Controller(SDH) - Memory Mapped Structure for SDH Controller -@{ */ - -typedef struct -{ - - /** - * @var SDH_T::FB - * Offset: 0x00~0x7C Shared Buffer (FIFO) - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |BUFFER |Shared Buffer - * | | |Buffer for DMA transfer - * @var SDH_T::DMACTL - * Offset: 0x400 DMA Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DMAEN |DMA Engine Enable Bit - * | | |0 = DMA Disabled. - * | | |1 = DMA Enabled. - * | | |If this bit is cleared, DMA will ignore all requests from SD host and force bus master into IDLE state. - * | | |Note: If target abort is occurred, DMAEN will be cleared. - * |[1] |DMARST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset internal state machine and pointers - * | | |The contents of control register will not be cleared - * | | |This bit will auto be cleared after few clock cycles. - * | | |Note: The software reset DMA related registers. - * |[3] |SGEN |Scatter-gather Function Enable Bit - * | | |0 = Scatter-gather function Disabled (DMA will treat the starting address in DMASAR as starting pointer of a single block memory). - * | | |1 = Scatter-gather function Enabled (DMA will treat the starting address in DMASAR as a starting address of Physical Address Descriptor (PAD) table - * | | |The format of these Pads' will be described later). - * |[9] |DMABUSY |DMA Transfer Is in Progress - * | | |This bit indicates if SD Host is granted and doing DMA transfer or not. - * | | |0 = DMA transfer is not in progress. - * | | |1 = DMA transfer is in progress. - * @var SDH_T::DMASA - * Offset: 0x408 DMA Transfer Starting Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ORDER |Determined to the PAD Table Fetching Is in Order or Out of Order - * | | |0 = PAD table is fetched in order. - * | | |1 = PAD table is fetched out of order. - * | | |Note: the bit0 is valid in scatter-gather mode when SGEN = 1. - * |[31:1] |DMASA |DMA Transfer Starting Address - * | | |This field pads 0 as least significant bit indicates a 32-bit starting address of system memory (SRAM) for DMA to retrieve or fill in data. - * | | |If DMA is not in normal mode, this field will be interpreted as a starting address of Physical Address Descriptor (PAD) table. - * | | |Note: Starting address of the SRAM must be word aligned, for example, 0x0000_0000, 0x0000_0004. - * @var SDH_T::DMABCNT - * Offset: 0x40C DMA Transfer Byte Count Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[25:0] |BCNT |DMA Transfer Byte Count (Read Only) - * | | |This field indicates the remained byte count of DMA transfer - * | | |The value of this field is valid only when DMA is busy; otherwise, it is 0. - * @var SDH_T::DMAINTEN - * Offset: 0x410 DMA Interrupt Enable Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIEN |DMA Read/Write Target Abort Interrupt Enable Bit - * | | |0 = Target abort interrupt generation Disabled during DMA transfer. - * | | |1 = Target abort interrupt generation Enabled during DMA transfer. - * |[1] |WEOTIEN |Wrong EOT Encountered Interrupt Enable Bit - * | | |0 = Interrupt generation Disabled when wrong EOT is encountered. - * | | |1 = Interrupt generation Enabled when wrong EOT is encountered. - * @var SDH_T::DMAINTSTS - * Offset: 0x414 DMA Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |ABORTIF |DMA Read/Write Target Abort Interrupt Flag - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note1: This bit is read only, but can be cleared by writing '1' to it. - * | | |Note2: When DMA's bus master received ERROR response, it means that target abort is happened - * | | |DMA will stop transfer and respond this event and then go to IDLE state - * | | |When target abort occurred or WEOTIF is set, software must reset DMA and SD host, and then transfer those data again. - * |[1] |WEOTIF |Wrong EOT Encountered Interrupt Flag - * | | |When DMA Scatter-Gather function is enabled, and EOT of the descriptor is encountered before DMA transfer finished (that means the total sector count of all PAD is less than the sector count of SD host), this bit will be set. - * | | |0 = No EOT encountered before DMA transfer finished. - * | | |1 = EOT encountered before DMA transfer finished. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::GCTL - * Offset: 0x800 Global Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |GCTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset SD host - * | | |The contents of control register will not be cleared - * | | |This bit will auto cleared after reset complete. - * |[1] |SDEN |Secure Digital Functionality Enable Bit - * | | |0 = SD functionality disabled. - * | | |1 = SD functionality enabled. - * @var SDH_T::GINTEN - * Offset: 0x804 Global Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIEN |DMA READ/WRITE Target Abort Interrupt Enable Bit - * | | |0 = DMA READ/WRITE target abort interrupt generation disabled. - * | | |1 = DMA READ/WRITE target abort interrupt generation enabled. - * @var SDH_T::GINTSTS - * Offset: 0x808 Global Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |DTAIF |DMA READ/WRITE Target Abort Interrupt Flag (Read Only) - * | | |This bit indicates DMA received an ERROR response from internal AHB bus during DMA read/write operation - * | | |When Target Abort is occurred, please reset all engine. - * | | |0 = No bus ERROR response received. - * | | |1 = Bus ERROR response received. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * @var SDH_T::CTL - * Offset: 0x820 SD Control and Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |COEN |Command Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output a command to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[1] |RIEN |Response Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[2] |DIEN |Data Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive block data and the CRC16 value from SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[3] |DOEN |Data Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will transfer block data and the CRC16 value to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[4] |R2EN |Response R2 Input Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will wait to receive a response R2 from SD card and store the response data into DMC's flash buffer (exclude CRC7). - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[5] |CLK74OEN |Initial 74 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 74 clock cycles to SD card. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[6] |CLK8OEN |Generating 8 Clock Cycles Output Enable Bit - * | | |0 = No effect. (Please use DMARST (SDH_CTL [0]) to clear this bit.) - * | | |1 = Enabled, SD host will output 8 clock cycles. - * | | |Note: When operation is finished, this bit will be cleared automatically, so don't write 0 to this bit (the controller will be abnormal). - * |[7] |CLKKEEP |SD Clock Enable Control - * | | |0 = SD host decided when to output clock and when to disable clock output automatically. - * | | |1 = SD clock always keeps free running. - * |[13:8] |CMDCODE |SD Command Code - * | | |This register contains the SD command code (0x00 - 0x3F). - * |[14] |CTLRST |Software Engine Reset - * | | |0 = No effect. - * | | |1 = Reset the internal state machine and counters - * | | |The contents of control register will not be cleared (but RIEN, DIEN, DOEN and R2_EN will be cleared) - * | | |This bit will be auto cleared after few clock cycles. - * |[15] |DBW |SD Data Bus Width (for 1-bit / 4-bit Selection) - * | | |0 = Data bus width is 1-bit. - * | | |1 = Data bus width is 4-bit. - * |[23:16] |BLKCNT |Block Counts to Be Transferred or Received - * | | |This field contains the block counts for data-in and data-out transfer - * | | |For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, software can use this function to accelerate data transfer and improve performance - * | | |Don't fill 0x0 to this field. - * | | |Note: For READ_MULTIPLE_BLOCK and WRITE_MULTIPLE_BLOCK command, the actual total length is BLKCNT * (BLKLEN +1). - * |[27:24] |SDNWR |NWR Parameter for Block Write Operation - * | | |This value indicates the NWR parameter for data block write operation in SD clock counts - * | | |The actual clock cycle will be SDNWR+1. - * @var SDH_T::CMDARG - * Offset: 0x824 SD Command Argument Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |ARGUMENT |SD Command Argument - * | | |This register contains a 32-bit value specifies the argument of SD command from host controller to SD card - * | | |Before trigger COEN (SDH_CTL [0]), software should fill argument in this field. - * @var SDH_T::INTEN - * Offset: 0x828 SD Interrupt Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIEN |Block Transfer Done Interrupt Enable Bit - * | | |0 = BLKDIF (SDH_INTEN[0]) trigger interrupt Disable. - * | | |1 = BLKDIF (SDH_INTEN[0]) trigger interrupt Enabled. - * |[1] |CRCIEN |CRC7, CRC16 and CRC Status Error Interrupt Enable Bit - * | | |0 = CRCIF (SDH_INTEN[1]) trigger interrupt Disable. - * | | |1 = CRCIF (SDH_INTEN[1]) trigger interrupt Enabled. - * |[8] |CDIEN |SD Card Detection Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when card is inserted or removed. - * | | |0 = CDIF (SDH_INTEN[8]) trigger interrupt Disable. - * | | |1 = CDIF (SDH_INTEN[8]) trigger interrupt Enabled. - * |[12] |RTOIEN |Response Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when receiving response or R2 time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = RTOIF (SDH_INTEN[12]) trigger interrupt Disabled. - * | | |1 = RTOIF (SDH_INTEN[12]) trigger interrupt Enabled. - * |[13] |DITOIEN |Data Input Time-out Interrupt Enable Bit - * | | |Enable/Disable interrupts generation of SD controller when data input time-out - * | | |Time-out value is specified at TOUT register. - * | | |0 = DITOIF (SDH_INTEN[13]) trigger interrupt Disabled. - * | | |1 = DITOIF (SDH_INTEN[13]) trigger interrupt Enabled. - * |[14] |WKIEN |Wake-up Signal Generating Enable Bit - * | | |Enable/Disable wake-up signal generating of SD host when current using SD card issues an interrupt (wake-up) via DAT [1] to host. - * | | |0 = SD Card interrupt to wake-up chip Disabled. - * | | |1 = SD Card interrupt to wake-up chip Enabled. - * |[30] |CDSRC |SD Card Detect Source Selection - * | | |0 = From SD card's DAT3 pin. - * | | |Host need clock to got data on pin DAT3 - * | | |Please make sure CLKKEEP (SDH_CTL[7]) is 1 in order to generate free running clock for DAT3 pin. - * | | |1 = From GPIO pin. - * @var SDH_T::INTSTS - * Offset: 0x82C SD Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BLKDIF |Block Transfer Done Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has finished all data-in or data-out block transfer - * | | |If there is a CRC16 error or incorrect CRC status during multiple block data transfer, the transfer will be broken and this bit will also be set. - * | | |0 = Not finished yet. - * | | |1 = Done. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[1] |CRCIF |CRC7, CRC16 and CRC Status Error Interrupt Flag (Read Only) - * | | |This bit indicates that SD host has occurred CRC error during response in, data-in or data-out (CRC status error) transfer - * | | |When CRC error is occurred, software should reset SD engine - * | | |Some response (ex - * | | |R3) doesn't have CRC7 information with it; SD host will still calculate CRC7, get CRC error and set this flag - * | | |In this condition, software should ignore CRC error and clears this bit manually. - * | | |0 = No CRC error is occurred. - * | | |1 = CRC error is occurred. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[2] |CRC7 |CRC7 Check Status (Read Only) - * | | |SD host will check CRC7 correctness during each response in - * | | |If that response does not contain CRC7 information (ex - * | | |R3), then software should turn off CRCIEN (SDH_INTEN[1]) and ignore this bit. - * | | |0 = Fault. - * | | |1 = OK. - * |[3] |CRC16 |CRC16 Check Status of Data-in Transfer (Read Only) - * | | |SD host will check CRC16 correctness after data-in transfer. - * | | |0 = Fault. - * | | |1 = OK. - * |[6:4] |CRCSTS |CRC Status Value of Data-out Transfer (Read Only) - * | | |SD host will record CRC status of data-out transfer - * | | |Software could use this value to identify what type of error is during data-out transfer. - * | | |010 = Positive CRC status. - * | | |101 = Negative CRC status. - * | | |111 = SD card programming error occurs. - * |[7] |DAT0STS |DAT0 Pin Status of Current Selected SD Port (Read Only) - * | | |This bit is the DAT0 pin status of current selected SD port. - * |[8] |CDIF |SD Card Detection Interrupt Flag (Read Only) - * | | |This bit indicates that SD card is inserted or removed - * | | |Only when CDIEN (SDH_INTEN[8]) is set to 1, this bit is active. - * | | |0 = No card is inserted or removed. - * | | |1 = There is a card inserted in or removed from SD. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[12] |RTOIF |Response Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving response or R2 (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Response time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[13] |DITOIF |Data Input Time-out Interrupt Flag (Read Only) - * | | |This bit indicates that SD host counts to time-out value when receiving data (waiting start bit). - * | | |0 = Not time-out. - * | | |1 = Data input time-out. - * | | |Note: This bit is read only, but can be cleared by writing '1' to it. - * |[16] |CDSTS |Card Detect Status of SD (Read Only) - * | | |This bit indicates the card detect pin status of SD, and is used for card detection - * | | |When there is a card inserted in or removed from SD, software should check this bit to confirm if there is really a card insertion or removal. - * | | |If CDSRC (SDH_INTEN[30]) = 0, to select DAT3 for card detection:. - * | | |0 = Card removed. - * | | |1 = Card inserted. - * | | |If CDSRC (SDH_INTEN[30]) = 1, to select GPIO for card detection:. - * | | |0 = Card inserted. - * | | |1 = Card removed. - * |[18] |DAT1STS |DAT1 Pin Status of SD Port (Read Only) - * | | |This bit indicates the DAT1 pin status of SD port. - * @var SDH_T::RESP0 - * Offset: 0x830 SD Receiving Response Token Register 0 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RESPTK0 |SD Receiving Response Token 0 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This field contains response bit 47-16 of the response token. - * @var SDH_T::RESP1 - * Offset: 0x834 SD Receiving Response Token Register 1 - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |RESPTK1 |SD Receiving Response Token 1 - * | | |SD host controller will receive a response token for getting a reply from SD card when RIEN (SDH_CTL[1]) is set - * | | |This register contains the bit 15-8 of the response token. - * @var SDH_T::BLEN - * Offset: 0x838 SD Block Length Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[10:0] |BLKLEN |SD BLOCK LENGTH in Byte Unit - * | | |An 11-bit value specifies the SD transfer byte count of a block - * | | |The actual byte count is equal to BLKLEN+1. - * | | |Note: The default SD block length is 512 bytes - * @var SDH_T::TOUT - * Offset: 0x83C SD Response/Data-in Time-out Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[23:0] |TOUT |SD Response/Data-in Time-out Value - * | | |A 24-bit value specifies the time-out counts of response and data input - * | | |SD host controller will wait start bit of response or data-in until this value reached - * | | |The time period depends on SD engine clock frequency - * | | |Do not write a small number into this field, or you may never get response or data due to time-out. - * | | |Note: Filling 0x0 into this field will disable hardware time-out function. - */ - - __IO uint32_t FB[32]; /*!< Shared Buffer (FIFO) */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[224]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMACTL; /*!< [0x0400] DMA Control and Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[1]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t DMASA; /*!< [0x0408] DMA Transfer Starting Address Register */ - __I uint32_t DMABCNT; /*!< [0x040c] DMA Transfer Byte Count Register */ - __IO uint32_t DMAINTEN; /*!< [0x0410] DMA Interrupt Enable Control Register */ - __IO uint32_t DMAINTSTS; /*!< [0x0414] DMA Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[250]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t GCTL; /*!< [0x0800] Global Control and Status Register */ - __IO uint32_t GINTEN; /*!< [0x0804] Global Interrupt Control Register */ - __I uint32_t GINTSTS; /*!< [0x0808] Global Interrupt Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE3[5]; - /// @endcond //HIDDEN_SYMBOLS - __IO uint32_t CTL; /*!< [0x0820] SD Control and Status Register */ - __IO uint32_t CMDARG; /*!< [0x0824] SD Command Argument Register */ - __IO uint32_t INTEN; /*!< [0x0828] SD Interrupt Control Register */ - __IO uint32_t INTSTS; /*!< [0x082c] SD Interrupt Status Register */ - __I uint32_t RESP0; /*!< [0x0830] SD Receiving Response Token Register 0 */ - __I uint32_t RESP1; /*!< [0x0834] SD Receiving Response Token Register 1 */ - __IO uint32_t BLEN; /*!< [0x0838] SD Block Length Register */ - __IO uint32_t TOUT; /*!< [0x083c] SD Response/Data-in Time-out Register */ - -} SDH_T; - - -/** - @addtogroup SDH_CONST SDH Bit Field Definition - Constant Definitions for SDH Controller -@{ */ - -#define SDH_DMACTL_DMAEN_Pos (0) /*!< SDH_T::DMACTL: DMAEN Position */ -#define SDH_DMACTL_DMAEN_Msk (0x1ul << SDH_DMACTL_DMAEN_Pos) /*!< SDH_T::DMACTL: DMAEN Mask */ - -#define SDH_DMACTL_DMARST_Pos (1) /*!< SDH_T::DMACTL: DMARST Position */ -#define SDH_DMACTL_DMARST_Msk (0x1ul << SDH_DMACTL_DMARST_Pos) /*!< SDH_T::DMACTL: DMARST Mask */ - -#define SDH_DMACTL_SGEN_Pos (3) /*!< SDH_T::DMACTL: SGEN Position */ -#define SDH_DMACTL_SGEN_Msk (0x1ul << SDH_DMACTL_SGEN_Pos) /*!< SDH_T::DMACTL: SGEN Mask */ - -#define SDH_DMACTL_DMABUSY_Pos (9) /*!< SDH_T::DMACTL: DMABUSY Position */ -#define SDH_DMACTL_DMABUSY_Msk (0x1ul << SDH_DMACTL_DMABUSY_Pos) /*!< SDH_T::DMACTL: DMABUSY Mask */ - -#define SDH_DMASA_ORDER_Pos (0) /*!< SDH_T::DMASA: ORDER Position */ -#define SDH_DMASA_ORDER_Msk (0x1ul << SDH_DMASA_ORDER_Pos) /*!< SDH_T::DMASA: ORDER Mask */ - -#define SDH_DMASA_DMASA_Pos (1) /*!< SDH_T::DMASA: DMASA Position */ -#define SDH_DMASA_DMASA_Msk (0x7ffffffful << SDH_DMASA_DMASA_Pos) /*!< SDH_T::DMASA: DMASA Mask */ - -#define SDH_DMABCNT_BCNT_Pos (0) /*!< SDH_T::DMABCNT: BCNT Position */ -#define SDH_DMABCNT_BCNT_Msk (0x3fffffful << SDH_DMABCNT_BCNT_Pos) /*!< SDH_T::DMABCNT: BCNT Mask */ - -#define SDH_DMAINTEN_ABORTIEN_Pos (0) /*!< SDH_T::DMAINTEN: ABORTIEN Position */ -#define SDH_DMAINTEN_ABORTIEN_Msk (0x1ul << SDH_DMAINTEN_ABORTIEN_Pos) /*!< SDH_T::DMAINTEN: ABORTIEN Mask */ - -#define SDH_DMAINTEN_WEOTIEN_Pos (1) /*!< SDH_T::DMAINTEN: WEOTIEN Position */ -#define SDH_DMAINTEN_WEOTIEN_Msk (0x1ul << SDH_DMAINTEN_WEOTIEN_Pos) /*!< SDH_T::DMAINTEN: WEOTIEN Mask */ - -#define SDH_DMAINTSTS_ABORTIF_Pos (0) /*!< SDH_T::DMAINTSTS: ABORTIF Position */ -#define SDH_DMAINTSTS_ABORTIF_Msk (0x1ul << SDH_DMAINTSTS_ABORTIF_Pos) /*!< SDH_T::DMAINTSTS: ABORTIF Mask */ - -#define SDH_DMAINTSTS_WEOTIF_Pos (1) /*!< SDH_T::DMAINTSTS: WEOTIF Position */ -#define SDH_DMAINTSTS_WEOTIF_Msk (0x1ul << SDH_DMAINTSTS_WEOTIF_Pos) /*!< SDH_T::DMAINTSTS: WEOTIF Mask */ - -#define SDH_GCTL_GCTLRST_Pos (0) /*!< SDH_T::GCTL: GCTLRST Position */ -#define SDH_GCTL_GCTLRST_Msk (0x1ul << SDH_GCTL_GCTLRST_Pos) /*!< SDH_T::GCTL: GCTLRST Mask */ - -#define SDH_GCTL_SDEN_Pos (1) /*!< SDH_T::GCTL: SDEN Position */ -#define SDH_GCTL_SDEN_Msk (0x1ul << SDH_GCTL_SDEN_Pos) /*!< SDH_T::GCTL: SDEN Mask */ - -#define SDH_GINTEN_DTAIEN_Pos (0) /*!< SDH_T::GINTEN: DTAIEN Position */ -#define SDH_GINTEN_DTAIEN_Msk (0x1ul << SDH_GINTEN_DTAIEN_Pos) /*!< SDH_T::GINTEN: DTAIEN Mask */ - -#define SDH_GINTSTS_DTAIF_Pos (0) /*!< SDH_T::GINTSTS: DTAIF Position */ -#define SDH_GINTSTS_DTAIF_Msk (0x1ul << SDH_GINTSTS_DTAIF_Pos) /*!< SDH_T::GINTSTS: DTAIF Mask */ - -#define SDH_CTL_COEN_Pos (0) /*!< SDH_T::CTL: COEN Position */ -#define SDH_CTL_COEN_Msk (0x1ul << SDH_CTL_COEN_Pos) /*!< SDH_T::CTL: COEN Mask */ - -#define SDH_CTL_RIEN_Pos (1) /*!< SDH_T::CTL: RIEN Position */ -#define SDH_CTL_RIEN_Msk (0x1ul << SDH_CTL_RIEN_Pos) /*!< SDH_T::CTL: RIEN Mask */ - -#define SDH_CTL_DIEN_Pos (2) /*!< SDH_T::CTL: DIEN Position */ -#define SDH_CTL_DIEN_Msk (0x1ul << SDH_CTL_DIEN_Pos) /*!< SDH_T::CTL: DIEN Mask */ - -#define SDH_CTL_DOEN_Pos (3) /*!< SDH_T::CTL: DOEN Position */ -#define SDH_CTL_DOEN_Msk (0x1ul << SDH_CTL_DOEN_Pos) /*!< SDH_T::CTL: DOEN Mask */ - -#define SDH_CTL_R2EN_Pos (4) /*!< SDH_T::CTL: R2EN Position */ -#define SDH_CTL_R2EN_Msk (0x1ul << SDH_CTL_R2EN_Pos) /*!< SDH_T::CTL: R2EN Mask */ - -#define SDH_CTL_CLK74OEN_Pos (5) /*!< SDH_T::CTL: CLK74OEN Position */ -#define SDH_CTL_CLK74OEN_Msk (0x1ul << SDH_CTL_CLK74OEN_Pos) /*!< SDH_T::CTL: CLK74OEN Mask */ - -#define SDH_CTL_CLK8OEN_Pos (6) /*!< SDH_T::CTL: CLK8OEN Position */ -#define SDH_CTL_CLK8OEN_Msk (0x1ul << SDH_CTL_CLK8OEN_Pos) /*!< SDH_T::CTL: CLK8OEN Mask */ - -#define SDH_CTL_CLKKEEP_Pos (7) /*!< SDH_T::CTL: CLKKEEP Position */ -#define SDH_CTL_CLKKEEP_Msk (0x1ul << SDH_CTL_CLKKEEP_Pos) /*!< SDH_T::CTL: CLKKEEP Mask */ - -#define SDH_CTL_CMDCODE_Pos (8) /*!< SDH_T::CTL: CMDCODE Position */ -#define SDH_CTL_CMDCODE_Msk (0x3ful << SDH_CTL_CMDCODE_Pos) /*!< SDH_T::CTL: CMDCODE Mask */ - -#define SDH_CTL_CTLRST_Pos (14) /*!< SDH_T::CTL: CTLRST Position */ -#define SDH_CTL_CTLRST_Msk (0x1ul << SDH_CTL_CTLRST_Pos) /*!< SDH_T::CTL: CTLRST Mask */ - -#define SDH_CTL_DBW_Pos (15) /*!< SDH_T::CTL: DBW Position */ -#define SDH_CTL_DBW_Msk (0x1ul << SDH_CTL_DBW_Pos) /*!< SDH_T::CTL: DBW Mask */ - -#define SDH_CTL_BLKCNT_Pos (16) /*!< SDH_T::CTL: BLKCNT Position */ -#define SDH_CTL_BLKCNT_Msk (0xfful << SDH_CTL_BLKCNT_Pos) /*!< SDH_T::CTL: BLKCNT Mask */ - -#define SDH_CTL_SDNWR_Pos (24) /*!< SDH_T::CTL: SDNWR Position */ -#define SDH_CTL_SDNWR_Msk (0xful << SDH_CTL_SDNWR_Pos) /*!< SDH_T::CTL: SDNWR Mask */ - -#define SDH_CMDARG_ARGUMENT_Pos (0) /*!< SDH_T::CMDARG: ARGUMENT Position */ -#define SDH_CMDARG_ARGUMENT_Msk (0xfffffffful << SDH_CMDARG_ARGUMENT_Pos) /*!< SDH_T::CMDARG: ARGUMENT Mask */ - -#define SDH_INTEN_BLKDIEN_Pos (0) /*!< SDH_T::INTEN: BLKDIEN Position */ -#define SDH_INTEN_BLKDIEN_Msk (0x1ul << SDH_INTEN_BLKDIEN_Pos) /*!< SDH_T::INTEN: BLKDIEN Mask */ - -#define SDH_INTEN_CRCIEN_Pos (1) /*!< SDH_T::INTEN: CRCIEN Position */ -#define SDH_INTEN_CRCIEN_Msk (0x1ul << SDH_INTEN_CRCIEN_Pos) /*!< SDH_T::INTEN: CRCIEN Mask */ - -#define SDH_INTEN_CDIEN_Pos (8) /*!< SDH_T::INTEN: CDIEN Position */ -#define SDH_INTEN_CDIEN_Msk (0x1ul << SDH_INTEN_CDIEN_Pos) /*!< SDH_T::INTEN: CDIEN Mask */ - -#define SDH_INTEN_RTOIEN_Pos (12) /*!< SDH_T::INTEN: RTOIEN Position */ -#define SDH_INTEN_RTOIEN_Msk (0x1ul << SDH_INTEN_RTOIEN_Pos) /*!< SDH_T::INTEN: RTOIEN Mask */ - -#define SDH_INTEN_DITOIEN_Pos (13) /*!< SDH_T::INTEN: DITOIEN Position */ -#define SDH_INTEN_DITOIEN_Msk (0x1ul << SDH_INTEN_DITOIEN_Pos) /*!< SDH_T::INTEN: DITOIEN Mask */ - -#define SDH_INTEN_WKIEN_Pos (14) /*!< SDH_T::INTEN: WKIEN Position */ -#define SDH_INTEN_WKIEN_Msk (0x1ul << SDH_INTEN_WKIEN_Pos) /*!< SDH_T::INTEN: WKIEN Mask */ - -#define SDH_INTEN_CDSRC_Pos (30) /*!< SDH_T::INTEN: CDSRC Position */ -#define SDH_INTEN_CDSRC_Msk (0x1ul << SDH_INTEN_CDSRC_Pos) /*!< SDH_T::INTEN: CDSRC Mask */ - -#define SDH_INTSTS_BLKDIF_Pos (0) /*!< SDH_T::INTSTS: BLKDIF Position */ -#define SDH_INTSTS_BLKDIF_Msk (0x1ul << SDH_INTSTS_BLKDIF_Pos) /*!< SDH_T::INTSTS: BLKDIF Mask */ - -#define SDH_INTSTS_CRCIF_Pos (1) /*!< SDH_T::INTSTS: CRCIF Position */ -#define SDH_INTSTS_CRCIF_Msk (0x1ul << SDH_INTSTS_CRCIF_Pos) /*!< SDH_T::INTSTS: CRCIF Mask */ - -#define SDH_INTSTS_CRC7_Pos (2) /*!< SDH_T::INTSTS: CRC7 Position */ -#define SDH_INTSTS_CRC7_Msk (0x1ul << SDH_INTSTS_CRC7_Pos) /*!< SDH_T::INTSTS: CRC7 Mask */ - -#define SDH_INTSTS_CRC16_Pos (3) /*!< SDH_T::INTSTS: CRC16 Position */ -#define SDH_INTSTS_CRC16_Msk (0x1ul << SDH_INTSTS_CRC16_Pos) /*!< SDH_T::INTSTS: CRC16 Mask */ - -#define SDH_INTSTS_CRCSTS_Pos (4) /*!< SDH_T::INTSTS: CRCSTS Position */ -#define SDH_INTSTS_CRCSTS_Msk (0x7ul << SDH_INTSTS_CRCSTS_Pos) /*!< SDH_T::INTSTS: CRCSTS Mask */ - -#define SDH_INTSTS_DAT0STS_Pos (7) /*!< SDH_T::INTSTS: DAT0STS Position */ -#define SDH_INTSTS_DAT0STS_Msk (0x1ul << SDH_INTSTS_DAT0STS_Pos) /*!< SDH_T::INTSTS: DAT0STS Mask */ - -#define SDH_INTSTS_CDIF_Pos (8) /*!< SDH_T::INTSTS: CDIF Position */ -#define SDH_INTSTS_CDIF_Msk (0x1ul << SDH_INTSTS_CDIF_Pos) /*!< SDH_T::INTSTS: CDIF Mask */ - -#define SDH_INTSTS_RTOIF_Pos (12) /*!< SDH_T::INTSTS: RTOIF Position */ -#define SDH_INTSTS_RTOIF_Msk (0x1ul << SDH_INTSTS_RTOIF_Pos) /*!< SDH_T::INTSTS: RTOIF Mask */ - -#define SDH_INTSTS_DITOIF_Pos (13) /*!< SDH_T::INTSTS: DITOIF Position */ -#define SDH_INTSTS_DITOIF_Msk (0x1ul << SDH_INTSTS_DITOIF_Pos) /*!< SDH_T::INTSTS: DITOIF Mask */ - -#define SDH_INTSTS_CDSTS_Pos (16) /*!< SDH_T::INTSTS: CDSTS Position */ -#define SDH_INTSTS_CDSTS_Msk (0x1ul << SDH_INTSTS_CDSTS_Pos) /*!< SDH_T::INTSTS: CDSTS Mask */ - -#define SDH_INTSTS_DAT1STS_Pos (18) /*!< SDH_T::INTSTS: DAT1STS Position */ -#define SDH_INTSTS_DAT1STS_Msk (0x1ul << SDH_INTSTS_DAT1STS_Pos) /*!< SDH_T::INTSTS: DAT1STS Mask */ - -#define SDH_RESP0_RESPTK0_Pos (0) /*!< SDH_T::RESP0: RESPTK0 Position */ -#define SDH_RESP0_RESPTK0_Msk (0xfffffffful << SDH_RESP0_RESPTK0_Pos) /*!< SDH_T::RESP0: RESPTK0 Mask */ - -#define SDH_RESP1_RESPTK1_Pos (0) /*!< SDH_T::RESP1: RESPTK1 Position */ -#define SDH_RESP1_RESPTK1_Msk (0xfful << SDH_RESP1_RESPTK1_Pos) /*!< SDH_T::RESP1: RESPTK1 Mask */ - -#define SDH_BLEN_BLKLEN_Pos (0) /*!< SDH_T::BLEN: BLKLEN Position */ -#define SDH_BLEN_BLKLEN_Msk (0x7fful << SDH_BLEN_BLKLEN_Pos) /*!< SDH_T::BLEN: BLKLEN Mask */ - -#define SDH_TOUT_TOUT_Pos (0) /*!< SDH_T::TOUT: TOUT Position */ -#define SDH_TOUT_TOUT_Msk (0xfffffful << SDH_TOUT_TOUT_Pos) /*!< SDH_T::TOUT: TOUT Mask */ - -/**@}*/ /* SDH_CONST */ -/**@}*/ /* end of SDH register group */ -/**@}*/ /* end of REGISTER group */ - -#define SDH0 ((SDH_T *) FMI_BA) -#define SDH1 ((SDH_T *) SDH_BA) - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup SDH_EXPORTED_CONSTANTS SDH Exported Constants - @{ -*/ - -#define SDH_ERR_ID 0xFFFF0100ul /*!< SDH error ID \hideinitializer */ - -#define SDH_TIMEOUT (SDH_ERR_ID|0x01ul) /*!< Timeout \hideinitializer */ -#define SDH_NO_MEMORY (SDH_ERR_ID|0x02ul) /*!< OOM \hideinitializer */ - -/*--- define type of SD card or MMC */ -#define SDH_TYPE_UNKNOWN 0ul /*!< Unknown card type \hideinitializer */ -#define SDH_TYPE_SD_HIGH 1ul /*!< SDHC card \hideinitializer */ -#define SDH_TYPE_SD_LOW 2ul /*!< SD card \hideinitializer */ -#define SDH_TYPE_MMC 3ul /*!< MMC card \hideinitializer */ -#define SDH_TYPE_EMMC 4ul /*!< eMMC card \hideinitializer */ - -/* SD error */ -#define SDH_NO_SD_CARD (SDH_ERR_ID|0x10ul) /*!< Card removed \hideinitializer */ -#define SDH_ERR_DEVICE (SDH_ERR_ID|0x11ul) /*!< Device error \hideinitializer */ -#define SDH_INIT_TIMEOUT (SDH_ERR_ID|0x12ul) /*!< Card init timeout \hideinitializer */ -#define SDH_SELECT_ERROR (SDH_ERR_ID|0x13ul) /*!< Card select error \hideinitializer */ -#define SDH_WRITE_PROTECT (SDH_ERR_ID|0x14ul) /*!< Card write protect \hideinitializer */ -#define SDH_INIT_ERROR (SDH_ERR_ID|0x15ul) /*!< Card init error \hideinitializer */ -#define SDH_CRC7_ERROR (SDH_ERR_ID|0x16ul) /*!< CRC 7 error \hideinitializer */ -#define SDH_CRC16_ERROR (SDH_ERR_ID|0x17ul) /*!< CRC 16 error \hideinitializer */ -#define SDH_CRC_ERROR (SDH_ERR_ID|0x18ul) /*!< CRC error \hideinitializer */ -#define SDH_CMD8_ERROR (SDH_ERR_ID|0x19ul) /*!< Command 8 error \hideinitializer */ - -#define MMC_FREQ 20000ul /*!< output 20MHz to MMC \hideinitializer */ -#define SD_FREQ 25000ul /*!< output 25MHz to SD \hideinitializer */ -#define SDHC_FREQ 50000ul /*!< output 50MHz to SDH \hideinitializer */ - -#define SD_PORT0 (1 << 0) /*!< Card select SD0 \hideinitializer */ -#define SD_PORT1 (1 << 2) /*!< Card select SD1 \hideinitializer */ -#define CardDetect_From_GPIO (1ul << 8) /*!< Card detection pin is GPIO \hideinitializer */ -#define CardDetect_From_DAT3 (1ul << 9) /*!< Card detection pin is DAT3 \hideinitializer */ - -/*@}*/ /* end of group SDH_EXPORTED_CONSTANTS */ - -/** @addtogroup SDH_EXPORTED_TYPEDEF SDH Exported Type Defines - @{ -*/ -typedef struct SDH_info_t -{ - unsigned char IsCardInsert; /*!< Card insert state */ - unsigned char R3Flag; - unsigned char R7Flag; - unsigned char volatile DataReadyFlag; - unsigned int CardType; /*!< SDHC, SD, or MMC */ - unsigned int RCA; /*!< Relative card address */ - unsigned int totalSectorN; /*!< Total sector number */ - unsigned int diskSize; /*!< Disk size in K bytes */ - int sectorSize; /*!< Sector size in bytes */ - unsigned char *dmabuf; -} SDH_INFO_T; /*!< Structure holds SD card info */ - -/*@}*/ /* end of group SDH_EXPORTED_TYPEDEF */ - -/// @cond HIDDEN_SYMBOLS -extern SDH_INFO_T SD0, SD1; - -/// @endcond HIDDEN_SYMBOLS - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ - -/** - * @brief Enable specified interrupt. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_CDSRC_Msk \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / - * \ref SDH_INTEN_WKIEN_Msk - * - * @return None. - * \hideinitializer - */ -#define SDH_ENABLE_INT(sdh, u32IntMask) ((sdh)->INTEN |= (u32IntMask)) - -/** - * @brief Disable specified interrupt. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTEN_BLKDIEN_Msk / \ref SDH_INTEN_CRCIEN_Msk / \ref SDH_INTEN_CDIEN_Msk / - * \ref SDH_INTEN_RTOIEN_Msk / \ref SDH_INTEN_DITOIEN_Msk / \ref SDH_INTEN_WKIEN_Msk / \ref SDH_INTEN_CDSRC_Msk / - * - * @return None. - * \hideinitializer - */ -#define SDH_DISABLE_INT(sdh, u32IntMask) ((sdh)->INTEN &= ~(u32IntMask)) - -/** - * @brief Get specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CRC7_Msk / - * \ref SDH_INTSTS_CRC16_Msk / \ref SDH_INTSTS_CRCSTS_Msk / \ref SDH_INTSTS_DAT0STS_Msk / - * \ref SDH_INTSTS_CDIF_Msk \ref SDH_INTSTS_RTOIF_Msk / - * \ref SDH_INTSTS_DITOIF_Msk / \ref SDH_INTSTS_CDSTS_Msk / - * \ref SDH_INTSTS_DAT1STS_Msk - * - * - * @return 0 = The specified interrupt is not happened. - * 1 = The specified interrupt is happened. - * \hideinitializer - */ -#define SDH_GET_INT_FLAG(sdh, u32IntMask) (((sdh)->INTSTS & (u32IntMask))?1:0) - - -/** - * @brief Clear specified interrupt flag/status. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32IntMask Interrupt type mask: - * \ref SDH_INTSTS_BLKDIF_Msk / \ref SDH_INTSTS_CRCIF_Msk / \ref SDH_INTSTS_CDIF_Msk / - * \ref SDH_INTSTS_RTOIF_Msk / \ref SDH_INTSTS_DITOIF_Msk - * - * - * @return None. - * \hideinitializer - */ -#define SDH_CLR_INT_FLAG(sdh, u32IntMask) ((sdh)->INTSTS = (u32IntMask)) - - -/** - * @brief Check SD Card inserted or removed. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return 1: Card inserted. - * 0: Card removed. - * \hideinitializer - */ -#define SDH_IS_CARD_PRESENT(sdh) (((sdh) == SDH0)? SD0.IsCardInsert : SD1.IsCardInsert) - -/** - * @brief Get SD Card capacity. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return SD Card capacity. (unit: KByte) - * \hideinitializer - */ -#define SDH_GET_CARD_CAPACITY(sdh) (((sdh) == SDH0)? SD0.diskSize : SD1.diskSize) - - -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc); -uint32_t SDH_Probe(SDH_T *sdh); -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount); - -uint32_t SDH_CardDetection(SDH_T *sdh); -void SDH_Open_Disk(SDH_T *sdh, uint32_t u32CardDetSrc); -void SDH_Close_Disk(SDH_T *sdh); - - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#endif //end of __NU_SDH_H__ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_spi.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_spi.h deleted file mode 100644 index fd1b1622926..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_spi.h +++ /dev/null @@ -1,852 +0,0 @@ -/**************************************************************************//** - * @file spi.h - * @brief NUC980 series SPI driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#ifndef __NU_SPI_H__ -#define __NU_SPI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - @addtogroup REGISTER Control Register - @{ -*/ - -/** - @addtogroup SPI Serial Peripheral Interface Controller(SPI) - Memory Mapped Structure for SPI Controller -@{ */ - -typedef struct -{ - - - /** - * @var SPI_T::CTL - * Offset: 0x00 SPI Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SPIEN |SPI Transfer Control Enable Bit - * | | |In Master mode, the transfer will start when there is data in the FIFO buffer after this bit is set to 1 - * | | |In Slave mode, this device is ready to receive data when this bit is set to 1. - * | | |0 = Transfer control Disabled. - * | | |1 = Transfer control Enabled. - * | | |Note: Before changing the configurations of SPIx_CTL, SPIx_CLKDIV, SPIx_SSCTL and SPIx_FIFOCTL registers, user shall clear the SPIEN (SPIx_CTL[0]) and confirm the SPIENSTS (SPIx_STATUS[15]) is 0. - * |[1] |RXNEG |Receive on Negative Edge - * | | |0 = Received data input signal is latched on the rising edge of SPI bus clock. - * | | |1 = Received data input signal is latched on the falling edge of SPI bus clock. - * |[2] |TXNEG |Transmit on Negative Edge - * | | |0 = Transmitted data output signal is changed on the rising edge of SPI bus clock. - * | | |1 = Transmitted data output signal is changed on the falling edge of SPI bus clock. - * |[3] |CLKPOL |Clock Polarity - * | | |0 = SPI bus clock is idle low. - * | | |1 = SPI bus clock is idle high. - * |[7:4] |SUSPITV |Suspend Interval (Master Only) - * | | |The four bits provide configurable suspend interval between two successive transmit/receive transaction in a transfer - * | | |The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word - * | | |The default value is 0x3 - * | | |The period of the suspend interval is obtained according to the following equation. - * | | |(SUSPITV[3:0] + 0.5) * period of SPICLK clock cycle - * | | |Example: - * | | |SUSPITV = 0x0 .... 0.5 SPICLK clock cycle. - * | | |SUSPITV = 0x1 .... 1.5 SPICLK clock cycle. - * | | |..... - * | | |SUSPITV = 0xE .... 14.5 SPICLK clock cycle. - * | | |SUSPITV = 0xF .... 15.5 SPICLK clock cycle. - * |[12:8] |DWIDTH |Data Width - * | | |This field specifies how many bits can be transmitted / received in one transaction - * | | |The minimum bit length is 8 bits and can up to 32 bits. - * | | |DWIDTH = 0x08 .... 8 bits. - * | | |DWIDTH = 0x09 .... 9 bits. - * | | |..... - * | | |DWIDTH = 0x1F .... 31 bits. - * | | |DWIDTH = 0x00 .... 32 bits. - * | | |Note: For SPI1~SPI4, this bit field will decide the depth of TX/RX FIFO configuration in SPI mode - * | | |Therefore, changing this bit field will clear TX/RX FIFO by hardware automatically in SPI1~SPI4. - * |[13] |LSB |Send LSB First - * | | |0 = The MSB, which bit of transmit/receive register depends on the setting of DWIDTH, is transmitted/received first. - * | | |1 = The LSB, bit 0 of the SPI TX register, is sent first to the SPI data output pin, and the first bit received from the SPI data input pin will be put in the LSB position of the RX register (bit 0 of SPI_RX). - * |[14] |HALFDPX |SPI Half-duplex Transfer Enable Bit - * | | |This bit is used to select full-duplex or half-duplex for SPI transfer - * | | |The bit field DATDIR (SPIx_CTL[20]) can be used to set the data direction in half-duplex transfer. - * | | |0 = SPI operates in full-duplex transfer. - * | | |1 = SPI operates in half-duplex transfer. - * |[15] |RXONLY |Receive-only Mode Enable Bit (Master Only) - * | | |This bit field is only available in Master mode - * | | |In receive-only mode, SPI Master will generate SPI bus clock continuously for receiving data bit from SPI slave device and assert the BUSY status. - * | | |0 = Receive-only mode Disabled. - * | | |1 = Receive-only mode Enabled. - * |[17] |UNITIEN |Unit Transfer Interrupt Enable Bit - * | | |0 = SPI unit transfer interrupt Disabled. - * | | |1 = SPI unit transfer interrupt Enabled. - * |[18] |SLAVE |Slave Mode Control - * | | |0 = Master mode. - * | | |1 = Slave mode. - * |[19] |REORDER |Byte Reorder Function Enable Bit - * | | |0 = Byte Reorder function Disabled. - * | | |1 = Byte Reorder function Enabled - * | | |A byte suspend interval will be inserted among each byte - * | | |The period of the byte suspend interval depends on the setting of SUSPITV. - * | | |Note: Byte Reorder function is only available if DWIDTH is defined as 16, 24, and 32 bits. - * |[20] |DATDIR |Data Port Direction Control - * | | |This bit is used to select the data input/output direction in half-duplex transfer and Dual/Quad transfer - * | | |0 = SPI data is input direction. - * | | |1 = SPI data is output direction. - * @var SPI_T::CLKDIV - * Offset: 0x04 SPI Clock Divider Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8:0] |DIVIDER |Clock Divider - * | | |The value in this field is the frequency divider for generating the peripheral clock, fspi_eclk, and the SPI bus clock of SPI Master - * | | |The frequency is obtained according to the following equation. - * | | |where - * | | |is the peripheral clock source, which is defined in the clock control register, CLK_CLKSEL2. - * | | |Note: Not supported in I2S mode. - * @var SPI_T::SSCTL - * Offset: 0x08 SPI Slave Select Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SS |Slave Selection Control (Master Only) - * | | |If AUTOSS bit is cleared to 0, - * | | |0 = set the SPIx_SS line to inactive state. - * | | |1 = set the SPIx_SS line to active state. - * | | |If the AUTOSS bit is set to 1, - * | | |0 = Keep the SPIx_SS line at inactive state. - * | | |1 = SPIx_SS line will be automatically driven to active state for the duration of data transfer, and will be driven to inactive state for the rest of the time - * | | |The active state of SPIx_SS is specified in SSACTPOL (SPIx_SSCTL[2]). - * |[2] |SSACTPOL |Slave Selection Active Polarity - * | | |This bit defines the active polarity of slave selection signal (SPIx_SS). - * | | |0 = The slave selection signal SPIx_SS is active low. - * | | |1 = The slave selection signal SPIx_SS is active high. - * |[3] |AUTOSS |Automatic Slave Selection Function Enable Bit (Master Only) - * | | |0 = Automatic slave selection function Disabled - * | | |Slave selection signal will be asserted/de-asserted according to SS (SPIx_SSCTL[0]). - * | | |1 = Automatic slave selection function Enabled. - * |[8] |SLVBEIEN |Slave Mode Bit Count Error Interrupt Enable Bit - * | | |0 = Slave mode bit count error interrupt Disabled. - * | | |1 = Slave mode bit count error interrupt Enabled. - * |[9] |SLVURIEN |Slave Mode TX Under Run Interrupt Enable Bit - * | | |0 = Slave mode TX under run interrupt Disabled. - * | | |1 = Slave mode TX under run interrupt Enabled. - * |[12] |SSACTIEN |Slave Select Active Interrupt Enable Bit - * | | |0 = Slave select active interrupt Disabled. - * | | |1 = Slave select active interrupt Enabled. - * |[13] |SSINAIEN |Slave Select Inactive Interrupt Enable Bit - * | | |0 = Slave select inactive interrupt Disabled. - * | | |1 = Slave select inactive interrupt Enabled. - * @var SPI_T::PDMACTL - * Offset: 0x0C SPI PDMA Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |TXPDMAEN |Transmit PDMA Enable Bit - * | | |0 = Transmit PDMA function Disabled. - * | | |1 = Transmit PDMA function Enabled. - * | | |Note: In SPI Master mode with full duplex transfer, if both TX and RX PDMA functions are enabled, RX PDMA function cannot be enabled prior to TX PDMA function - * | | |User can enable TX PDMA function firstly or enable both functions simultaneously. - * |[1] |RXPDMAEN |Receive PDMA Enable Bit - * | | |0 = Receive PDMA function Disabled. - * | | |1 = Receive PDMA function Enabled. - * |[2] |PDMARST |PDMA Reset - * | | |0 = No effect. - * | | |1 = Reset the PDMA control logic of the SPI controller. This bit will be automatically cleared to 0. - * @var SPI_T::FIFOCTL - * Offset: 0x10 SPI FIFO Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RXRST |Receive Reset - * | | |0 = No effect. - * | | |1 = Reset receive FIFO pointer and receive circuit - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * |[1] |TXRST |Transmit Reset - * | | |0 = No effect. - * | | |1 = Reset transmit FIFO pointer and transmit circuit - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 3 system clock cycles + 2 peripheral clock cycles after it is set to 1 - * | | |User can read TXRXRST (SPIx_STATUS[23]) to check if reset is accomplished or not. - * | | |Note: If TX underflow event occurs in SPI Slave mode, this bit can be used to make SPI return to idle state. - * |[2] |RXTHIEN |Receive FIFO Threshold Interrupt Enable Bit - * | | |0 = RX FIFO threshold interrupt Disabled. - * | | |1 = RX FIFO threshold interrupt Enabled. - * |[3] |TXTHIEN |Transmit FIFO Threshold Interrupt Enable Bit - * | | |0 = TX FIFO threshold interrupt Disabled. - * | | |1 = TX FIFO threshold interrupt Enabled. - * |[4] |RXTOIEN |Slave Receive Time-out Interrupt Enable Bit - * | | |0 = Receive time-out interrupt Disabled. - * | | |1 = Receive time-out interrupt Enabled. - * |[5] |RXOVIEN |Receive FIFO Overrun Interrupt Enable Bit - * | | |0 = Receive FIFO overrun interrupt Disabled. - * | | |1 = Receive FIFO overrun interrupt Enabled. - * |[6] |TXUFPOL |TX Underflow Data Polarity - * | | |0 = The SPI data out is keep 0 if there is TX underflow event in Slave mode. - * | | |1 = The SPI data out is keep 1 if there is TX underflow event in Slave mode. - * | | |Note: - * | | |1. The TX underflow event occurs if there is no any data in TX FIFO when the slave selection signal is active. - * | | |2. This bit should be set as 0 in I2S mode. - * | | |3. When TX underflow event occurs, SPIx_MISO pin state will be determined by this setting even though TX FIFO is not empty afterward - * | | |Data stored in TX FIFO will be sent through SPIx_MISO pin in the next transfer frame. - * |[7] |TXUFIEN |TX Underflow Interrupt Enable Bit - * | | |When TX underflow event occurs in Slave mode, TXUFIF (SPIx_STATUS[19]) will be set to 1 - * | | |This bit is used to enable the TX underflow interrupt. - * | | |0 = Slave TX underflow interrupt Disabled. - * | | |1 = Slave TX underflow interrupt Enabled. - * |[8] |RXFBCLR |Receive FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear receive FIFO pointer - * | | |The RXFULL bit will be cleared to 0 and the RXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The RX shift register will not be cleared. - * |[9] |TXFBCLR |Transmit FIFO Buffer Clear - * | | |0 = No effect. - * | | |1 = Clear transmit FIFO pointer - * | | |The TXFULL bit will be cleared to 0 and the TXEMPTY bit will be set to 1 - * | | |This bit will be cleared to 0 by hardware about 1 system clock after it is set to 1. - * | | |Note: The TX shift register will not be cleared. - * |[26:24] |RXTH |Receive FIFO Threshold - * | | |If the valid data count of the receive FIFO buffer is larger than the RXTH setting, the RXTHIF bit will be set to 1, else the RXTHIF bit will be cleared to 0 - * | | |For SPI1~SPI4, the MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length. - * |[30:28] |TXTH |Transmit FIFO Threshold - * | | |If the valid data count of the transmit FIFO buffer is less than or equal to the TXTH setting, the TXTHIF bit will be set to 1, else the TXTHIF bit will be cleared to 0 - * | | |For SPI1~SPI4, the MSB of this bit field is only meaningful while SPI mode 8~16 bits of data length - * @var SPI_T::STATUS - * Offset: 0x14 SPI Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |BUSY |Busy Status (Read Only) - * | | |0 = SPI controller is in idle state. - * | | |1 = SPI controller is in busy state. - * | | |The following listing are the bus busy conditions: - * | | |a. SPIx_CTL[0] = 1 and TXEMPTY = 0. - * | | |b - * | | |For SPI Master mode, SPIx_CTL[0] = 1 and TXEMPTY = 1 but the current transaction is not finished yet. - * | | |c. For SPI Master mode, SPIx_CTL[0] = 1 and RXONLY = 1. - * | | |d - * | | |For SPI Slave mode, the SPIx_CTL[0] = 1 and there is serial clock input into the SPI core logic when slave select is active. - * | | |For SPI Slave mode, the SPIx_CTL[0] = 1 and the transmit buffer or transmit shift register is not empty even if the slave select is inactive. - * |[1] |UNITIF |Unit Transfer Interrupt Flag - * | | |0 = No transaction has been finished since this bit was cleared to 0. - * | | |1 = SPI controller has finished one unit transfer. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[2] |SSACTIF |Slave Select Active Interrupt Flag - * | | |0 = Slave select active interrupt was cleared or not occurred. - * | | |1 = Slave select active interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[3] |SSINAIF |Slave Select Inactive Interrupt Flag - * | | |0 = Slave select inactive interrupt was cleared or not occurred. - * | | |1 = Slave select inactive interrupt event occurred. - * | | |Note: Only available in Slave mode. This bit will be cleared by writing 1 to it. - * |[4] |SSLINE |Slave Select Line Bus Status (Read Only) - * | | |0 = The slave select line status is 0. - * | | |1 = The slave select line status is 1. - * | | |Note: This bit is only available in Slave mode - * | | |If SSACTPOL (SPIx_SSCTL[2]) is set 0, and the SSLINE is 1, the SPI slave select is in inactive status. - * |[6] |SLVBEIF |Slave Mode Bit Count Error Interrupt Flag - * | | |In Slave mode, when the slave select line goes to inactive state, if bit counter is mismatch with DWIDTH, this interrupt flag will be set to 1. - * | | |0 = No Slave mode bit count error event. - * | | |1 = Slave mode bit count error event occurs. - * | | |Note: If the slave select active but there is no any bus clock input, the SLVBEIF also active when the slave select goes to inactive state - * | | |This bit will be cleared by writing 1 to it. - * |[7] |SLVURIF |Slave Mode TX Under Run Interrupt Flag - * | | |In Slave mode, if TX underflow event occurs and the slave select line goes to inactive state, this interrupt flag will be set to 1. - * | | |0 = No Slave TX under run event. - * | | |1 = Slave TX under run event occurs. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[8] |RXEMPTY |Receive FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not empty. - * | | |1 = Receive FIFO buffer is empty. - * |[9] |RXFULL |Receive FIFO Buffer Full Indicator (Read Only) - * | | |0 = Receive FIFO buffer is not full. - * | | |1 = Receive FIFO buffer is full. - * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the receive FIFO buffer is smaller than or equal to the setting value of RXTH. - * | | |1 = The valid data count within the receive FIFO buffer is larger than the setting value of RXTH. - * |[11] |RXOVIF |Receive FIFO Overrun Interrupt Flag - * | | |When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. - * | | |0 = No FIFO is overrun. - * | | |1 = Receive FIFO is overrun. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[12] |RXTOIF |Receive Time-out Interrupt Flag - * | | |0 = No receive FIFO time-out event. - * | | |1 = Receive FIFO buffer is not empty and no read operation on receive FIFO buffer over 64 SPI peripheral clock periods in Master mode or over 576 SPI peripheral clock periods in Slave mode - * | | |When the received FIFO buffer is read by software, the time-out status will be cleared automatically. - * | | |Note: This bit will be cleared by writing 1 to it. - * |[15] |SPIENSTS |SPI Enable Status (Read Only) - * | | |0 = The SPI controller is disabled. - * | | |1 = The SPI controller is enabled. - * | | |Note: The SPI peripheral clock is asynchronous with the system clock - * | | |In order to make sure the SPI control logic is disabled, this bit indicates the real status of SPI controller. - * |[16] |TXEMPTY |Transmit FIFO Buffer Empty Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not empty. - * | | |1 = Transmit FIFO buffer is empty. - * |[17] |TXFULL |Transmit FIFO Buffer Full Indicator (Read Only) - * | | |0 = Transmit FIFO buffer is not full. - * | | |1 = Transmit FIFO buffer is full. - * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only) - * | | |0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TXTH. - * | | |1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TXTH. - * |[19] |TXUFIF |TX Underflow Interrupt Flag - * | | |When the TX underflow event occurs, this bit will be set to 1, the state of data output pin depends on the setting of TXUFPOL. - * | | |0 = No effect. - * | | |1 = No data in Transmit FIFO and TX shift register when the slave selection signal is active. - * | | |Note 1: This bit will be cleared by writing 1 to it. - * | | |Note 2: If reset slave's transmission circuit when slave selection signal is active, this flag will be set to 1 after 2 peripheral clock cycles + 3 system clock cycles since the reset operation is done. - * |[23] |TXRXRST |TX or RX Reset Status (Read Only) - * | | |0 = The reset function of TXRST or RXRST is done. - * | | |1 = Doing the reset function of TXRST or RXRST. - * | | |Note: Both the reset operations of TXRST and RXRST need 3 system clock cycles + 2 peripheral clock cycles - * | | |User can check the status of this bit to monitor the reset function is doing or done. - * |[27:24] |RXCNT |Receive FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of receive FIFO buffer. - * |[31:28] |TXCNT |Transmit FIFO Data Count (Read Only) - * | | |This bit field indicates the valid data count of transmit FIFO buffer. - * @var SPI_T::TX - * Offset: 0x20 SPI Data Transmit Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |TX |Data Transmit Register - * | | |The data transmit registers pass through the transmitted data into the 4-level transmit FIFO buffers - * | | |The number of valid bits depends on the setting of DWIDTH (SPIx_CTL[12:8]) in SPI mode or WDWIDTH (SPIx_I2SCTL[5:4]) in I2S mode. - * | | |In SPI mode, if DWIDTH is set to 0x08, the bits TX[7:0] will be transmitted - * | | |If DWIDTH is set to 0x00 , the SPI controller will perform a 32-bit transfer. - * | | |In I2S mode, if WDWIDTH (SPIx_I2SCTL[5:4]) is set to 0x2, the data width of audio channel is 24-bit and corresponding to TX[23:0] - * | | |If WDWIDTH is set as 0x0, 0x1, or 0x3, all bits of this field are valid and referred to the data arrangement in I2S mode FIFO operation section - * | | |Note: In Master mode, SPI controller will start to transfer the SPI bus clock after 1 APB clock and 6 peripheral clock cycles after user writes to this register. - * @var SPI_T::RX - * Offset: 0x30 SPI Data Receive Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:0] |RX |Data Receive Register - * | | |There are 4-level FIFO buffers in this controller - * | | |The data receive register holds the data received from SPI data input pin - * | | |If the RXEMPTY (SPIx_STATUS[8] or SPIx_I2SSTS[8]) is not set to 1, the receive FIFO buffers can be accessed through software by reading this register - * | | |This is a read only register. - */ - __IO uint32_t CTL; /*!< [0x0000] SPI Control Register */ - __IO uint32_t CLKDIV; /*!< [0x0004] SPI Clock Divider Register */ - __IO uint32_t SSCTL; /*!< [0x0008] SPI Slave Select Control Register */ - __IO uint32_t PDMACTL; /*!< [0x000c] SPI PDMA Control Register */ - __IO uint32_t FIFOCTL; /*!< [0x0010] SPI FIFO Control Register */ - __IO uint32_t STATUS; /*!< [0x0014] SPI Status Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE0[2]; - /// @endcond //HIDDEN_SYMBOLS - __O uint32_t TX; /*!< [0x0020] SPI Data Transmit Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE1[3]; - /// @endcond //HIDDEN_SYMBOLS - __I uint32_t RX; /*!< [0x0030] SPI Data Receive Register */ - /// @cond HIDDEN_SYMBOLS - __I uint32_t RESERVE2[11]; - /// @endcond //HIDDEN_SYMBOLS - -} SPI_T; - -/** - @addtogroup SPI_CONST SPI Bit Field Definition - Constant Definitions for SPI Controller -@{ */ - -#define SPI_CTL_SPIEN_Pos (0) /*!< SPI_T::CTL: SPIEN Position */ -#define SPI_CTL_SPIEN_Msk (0x1ul << SPI_CTL_SPIEN_Pos) /*!< SPI_T::CTL: SPIEN Mask */ - -#define SPI_CTL_RXNEG_Pos (1) /*!< SPI_T::CTL: RXNEG Position */ -#define SPI_CTL_RXNEG_Msk (0x1ul << SPI_CTL_RXNEG_Pos) /*!< SPI_T::CTL: RXNEG Mask */ - -#define SPI_CTL_TXNEG_Pos (2) /*!< SPI_T::CTL: TXNEG Position */ -#define SPI_CTL_TXNEG_Msk (0x1ul << SPI_CTL_TXNEG_Pos) /*!< SPI_T::CTL: TXNEG Mask */ - -#define SPI_CTL_CLKPOL_Pos (3) /*!< SPI_T::CTL: CLKPOL Position */ -#define SPI_CTL_CLKPOL_Msk (0x1ul << SPI_CTL_CLKPOL_Pos) /*!< SPI_T::CTL: CLKPOL Mask */ - -#define SPI_CTL_SUSPITV_Pos (4) /*!< SPI_T::CTL: SUSPITV Position */ -#define SPI_CTL_SUSPITV_Msk (0xful << SPI_CTL_SUSPITV_Pos) /*!< SPI_T::CTL: SUSPITV Mask */ - -#define SPI_CTL_DWIDTH_Pos (8) /*!< SPI_T::CTL: DWIDTH Position */ -#define SPI_CTL_DWIDTH_Msk (0x1ful << SPI_CTL_DWIDTH_Pos) /*!< SPI_T::CTL: DWIDTH Mask */ - -#define SPI_CTL_LSB_Pos (13) /*!< SPI_T::CTL: LSB Position */ -#define SPI_CTL_LSB_Msk (0x1ul << SPI_CTL_LSB_Pos) /*!< SPI_T::CTL: LSB Mask */ - -#define SPI_CTL_HALFDPX_Pos (14) /*!< SPI_T::CTL: HALFDPX Position */ -#define SPI_CTL_HALFDPX_Msk (0x1ul << SPI_CTL_HALFDPX_Pos) /*!< SPI_T::CTL: HALFDPX Mask */ - -#define SPI_CTL_RXONLY_Pos (15) /*!< SPI_T::CTL: RXONLY Position */ -#define SPI_CTL_RXONLY_Msk (0x1ul << SPI_CTL_RXONLY_Pos) /*!< SPI_T::CTL: RXONLY Mask */ - -#define SPI_CTL_UNITIEN_Pos (17) /*!< SPI_T::CTL: UNITIEN Position */ -#define SPI_CTL_UNITIEN_Msk (0x1ul << SPI_CTL_UNITIEN_Pos) /*!< SPI_T::CTL: UNITIEN Mask */ - -#define SPI_CTL_SLAVE_Pos (18) /*!< SPI_T::CTL: SLAVE Position */ -#define SPI_CTL_SLAVE_Msk (0x1ul << SPI_CTL_SLAVE_Pos) /*!< SPI_T::CTL: SLAVE Mask */ - -#define SPI_CTL_REORDER_Pos (19) /*!< SPI_T::CTL: REORDER Position */ -#define SPI_CTL_REORDER_Msk (0x1ul << SPI_CTL_REORDER_Pos) /*!< SPI_T::CTL: REORDER Mask */ - -#define SPI_CTL_DATDIR_Pos (20) /*!< SPI_T::CTL: DATDIR Position */ -#define SPI_CTL_DATDIR_Msk (0x1ul << SPI_CTL_DATDIR_Pos) /*!< SPI_T::CTL: DATDIR Mask */ - -#define SPI_CLKDIV_DIVIDER_Pos (0) /*!< SPI_T::CLKDIV: DIVIDER Position */ -#define SPI_CLKDIV_DIVIDER_Msk (0x1fful << SPI_CLKDIV_DIVIDER_Pos) /*!< SPI_T::CLKDIV: DIVIDER Mask */ - -#define SPI_SSCTL_SS_Pos (0) /*!< SPI_T::SSCTL: SS Position */ -#define SPI_SSCTL_SS_Msk (0x1ul << SPI_SSCTL_SS_Pos) /*!< SPI_T::SSCTL: SS Mask */ - -#define SPI_SSCTL_SSACTPOL_Pos (2) /*!< SPI_T::SSCTL: SSACTPOL Position */ -#define SPI_SSCTL_SSACTPOL_Msk (0x1ul << SPI_SSCTL_SSACTPOL_Pos) /*!< SPI_T::SSCTL: SSACTPOL Mask */ - -#define SPI_SSCTL_AUTOSS_Pos (3) /*!< SPI_T::SSCTL: AUTOSS Position */ -#define SPI_SSCTL_AUTOSS_Msk (0x1ul << SPI_SSCTL_AUTOSS_Pos) /*!< SPI_T::SSCTL: AUTOSS Mask */ - -#define SPI_SSCTL_SLVBEIEN_Pos (8) /*!< SPI_T::SSCTL: SLVBEIEN Position */ -#define SPI_SSCTL_SLVBEIEN_Msk (0x1ul << SPI_SSCTL_SLVBEIEN_Pos) /*!< SPI_T::SSCTL: SLVBEIEN Mask */ - -#define SPI_SSCTL_SLVURIEN_Pos (9) /*!< SPI_T::SSCTL: SLVURIEN Position */ -#define SPI_SSCTL_SLVURIEN_Msk (0x1ul << SPI_SSCTL_SLVURIEN_Pos) /*!< SPI_T::SSCTL: SLVURIEN Mask */ - -#define SPI_SSCTL_SSACTIEN_Pos (12) /*!< SPI_T::SSCTL: SSACTIEN Position */ -#define SPI_SSCTL_SSACTIEN_Msk (0x1ul << SPI_SSCTL_SSACTIEN_Pos) /*!< SPI_T::SSCTL: SSACTIEN Mask */ - -#define SPI_SSCTL_SSINAIEN_Pos (13) /*!< SPI_T::SSCTL: SSINAIEN Position */ -#define SPI_SSCTL_SSINAIEN_Msk (0x1ul << SPI_SSCTL_SSINAIEN_Pos) /*!< SPI_T::SSCTL: SSINAIEN Mask */ - -#define SPI_SSCTL_SLVTOCNT_Pos (16) /*!< SPI_T::SSCTL: SLVTOCNT Position */ -#define SPI_SSCTL_SLVTOCNT_Msk (0xfffful << SPI_SSCTL_SLVTOCNT_Pos) /*!< SPI_T::SSCTL: SLVTOCNT Mask */ - -#define SPI_PDMACTL_TXPDMAEN_Pos (0) /*!< SPI_T::PDMACTL: TXPDMAEN Position */ -#define SPI_PDMACTL_TXPDMAEN_Msk (0x1ul << SPI_PDMACTL_TXPDMAEN_Pos) /*!< SPI_T::PDMACTL: TXPDMAEN Mask */ - -#define SPI_PDMACTL_RXPDMAEN_Pos (1) /*!< SPI_T::PDMACTL: RXPDMAEN Position */ -#define SPI_PDMACTL_RXPDMAEN_Msk (0x1ul << SPI_PDMACTL_RXPDMAEN_Pos) /*!< SPI_T::PDMACTL: RXPDMAEN Mask */ - -#define SPI_PDMACTL_PDMARST_Pos (2) /*!< SPI_T::PDMACTL: PDMARST Position */ -#define SPI_PDMACTL_PDMARST_Msk (0x1ul << SPI_PDMACTL_PDMARST_Pos) /*!< SPI_T::PDMACTL: PDMARST Mask */ - -#define SPI_FIFOCTL_RXRST_Pos (0) /*!< SPI_T::FIFOCTL: RXRST Position */ -#define SPI_FIFOCTL_RXRST_Msk (0x1ul << SPI_FIFOCTL_RXRST_Pos) /*!< SPI_T::FIFOCTL: RXRST Mask */ - -#define SPI_FIFOCTL_TXRST_Pos (1) /*!< SPI_T::FIFOCTL: TXRST Position */ -#define SPI_FIFOCTL_TXRST_Msk (0x1ul << SPI_FIFOCTL_TXRST_Pos) /*!< SPI_T::FIFOCTL: TXRST Mask */ - -#define SPI_FIFOCTL_RXTHIEN_Pos (2) /*!< SPI_T::FIFOCTL: RXTHIEN Position */ -#define SPI_FIFOCTL_RXTHIEN_Msk (0x1ul << SPI_FIFOCTL_RXTHIEN_Pos) /*!< SPI_T::FIFOCTL: RXTHIEN Mask */ - -#define SPI_FIFOCTL_TXTHIEN_Pos (3) /*!< SPI_T::FIFOCTL: TXTHIEN Position */ -#define SPI_FIFOCTL_TXTHIEN_Msk (0x1ul << SPI_FIFOCTL_TXTHIEN_Pos) /*!< SPI_T::FIFOCTL: TXTHIEN Mask */ - -#define SPI_FIFOCTL_RXTOIEN_Pos (4) /*!< SPI_T::FIFOCTL: RXTOIEN Position */ -#define SPI_FIFOCTL_RXTOIEN_Msk (0x1ul << SPI_FIFOCTL_RXTOIEN_Pos) /*!< SPI_T::FIFOCTL: RXTOIEN Mask */ - -#define SPI_FIFOCTL_RXOVIEN_Pos (5) /*!< SPI_T::FIFOCTL: RXOVIEN Position */ -#define SPI_FIFOCTL_RXOVIEN_Msk (0x1ul << SPI_FIFOCTL_RXOVIEN_Pos) /*!< SPI_T::FIFOCTL: RXOVIEN Mask */ - -#define SPI_FIFOCTL_TXUFPOL_Pos (6) /*!< SPI_T::FIFOCTL: TXUFPOL Position */ -#define SPI_FIFOCTL_TXUFPOL_Msk (0x1ul << SPI_FIFOCTL_TXUFPOL_Pos) /*!< SPI_T::FIFOCTL: TXUFPOL Mask */ - -#define SPI_FIFOCTL_TXUFIEN_Pos (7) /*!< SPI_T::FIFOCTL: TXUFIEN Position */ -#define SPI_FIFOCTL_TXUFIEN_Msk (0x1ul << SPI_FIFOCTL_TXUFIEN_Pos) /*!< SPI_T::FIFOCTL: TXUFIEN Mask */ - -#define SPI_FIFOCTL_RXFBCLR_Pos (8) /*!< SPI_T::FIFOCTL: RXFBCLR Position */ -#define SPI_FIFOCTL_RXFBCLR_Msk (0x1ul << SPI_FIFOCTL_RXFBCLR_Pos) /*!< SPI_T::FIFOCTL: RXFBCLR Mask */ - -#define SPI_FIFOCTL_TXFBCLR_Pos (9) /*!< SPI_T::FIFOCTL: TXFBCLR Position */ -#define SPI_FIFOCTL_TXFBCLR_Msk (0x1ul << SPI_FIFOCTL_TXFBCLR_Pos) /*!< SPI_T::FIFOCTL: TXFBCLR Mask */ - -#define SPI_FIFOCTL_RXTH_Pos (24) /*!< SPI_T::FIFOCTL: RXTH Position */ -#define SPI_FIFOCTL_RXTH_Msk (0x7ul << SPI_FIFOCTL_RXTH_Pos) /*!< SPI_T::FIFOCTL: RXTH Mask */ - -#define SPI_FIFOCTL_TXTH_Pos (28) /*!< SPI_T::FIFOCTL: TXTH Position */ -#define SPI_FIFOCTL_TXTH_Msk (0x7ul << SPI_FIFOCTL_TXTH_Pos) /*!< SPI_T::FIFOCTL: TXTH Mask */ - -#define SPI_STATUS_BUSY_Pos (0) /*!< SPI_T::STATUS: BUSY Position */ -#define SPI_STATUS_BUSY_Msk (0x1ul << SPI_STATUS_BUSY_Pos) /*!< SPI_T::STATUS: BUSY Mask */ - -#define SPI_STATUS_UNITIF_Pos (1) /*!< SPI_T::STATUS: UNITIF Position */ -#define SPI_STATUS_UNITIF_Msk (0x1ul << SPI_STATUS_UNITIF_Pos) /*!< SPI_T::STATUS: UNITIF Mask */ - -#define SPI_STATUS_SSACTIF_Pos (2) /*!< SPI_T::STATUS: SSACTIF Position */ -#define SPI_STATUS_SSACTIF_Msk (0x1ul << SPI_STATUS_SSACTIF_Pos) /*!< SPI_T::STATUS: SSACTIF Mask */ - -#define SPI_STATUS_SSINAIF_Pos (3) /*!< SPI_T::STATUS: SSINAIF Position */ -#define SPI_STATUS_SSINAIF_Msk (0x1ul << SPI_STATUS_SSINAIF_Pos) /*!< SPI_T::STATUS: SSINAIF Mask */ - -#define SPI_STATUS_SSLINE_Pos (4) /*!< SPI_T::STATUS: SSLINE Position */ -#define SPI_STATUS_SSLINE_Msk (0x1ul << SPI_STATUS_SSLINE_Pos) /*!< SPI_T::STATUS: SSLINE Mask */ - -#define SPI_STATUS_SLVBEIF_Pos (6) /*!< SPI_T::STATUS: SLVBEIF Position */ -#define SPI_STATUS_SLVBEIF_Msk (0x1ul << SPI_STATUS_SLVBEIF_Pos) /*!< SPI_T::STATUS: SLVBEIF Mask */ - -#define SPI_STATUS_SLVURIF_Pos (7) /*!< SPI_T::STATUS: SLVURIF Position */ -#define SPI_STATUS_SLVURIF_Msk (0x1ul << SPI_STATUS_SLVURIF_Pos) /*!< SPI_T::STATUS: SLVURIF Mask */ - -#define SPI_STATUS_RXEMPTY_Pos (8) /*!< SPI_T::STATUS: RXEMPTY Position */ -#define SPI_STATUS_RXEMPTY_Msk (0x1ul << SPI_STATUS_RXEMPTY_Pos) /*!< SPI_T::STATUS: RXEMPTY Mask */ - -#define SPI_STATUS_RXFULL_Pos (9) /*!< SPI_T::STATUS: RXFULL Position */ -#define SPI_STATUS_RXFULL_Msk (0x1ul << SPI_STATUS_RXFULL_Pos) /*!< SPI_T::STATUS: RXFULL Mask */ - -#define SPI_STATUS_RXTHIF_Pos (10) /*!< SPI_T::STATUS: RXTHIF Position */ -#define SPI_STATUS_RXTHIF_Msk (0x1ul << SPI_STATUS_RXTHIF_Pos) /*!< SPI_T::STATUS: RXTHIF Mask */ - -#define SPI_STATUS_RXOVIF_Pos (11) /*!< SPI_T::STATUS: RXOVIF Position */ -#define SPI_STATUS_RXOVIF_Msk (0x1ul << SPI_STATUS_RXOVIF_Pos) /*!< SPI_T::STATUS: RXOVIF Mask */ - -#define SPI_STATUS_RXTOIF_Pos (12) /*!< SPI_T::STATUS: RXTOIF Position */ -#define SPI_STATUS_RXTOIF_Msk (0x1ul << SPI_STATUS_RXTOIF_Pos) /*!< SPI_T::STATUS: RXTOIF Mask */ - -#define SPI_STATUS_SPIENSTS_Pos (15) /*!< SPI_T::STATUS: SPIENSTS Position */ -#define SPI_STATUS_SPIENSTS_Msk (0x1ul << SPI_STATUS_SPIENSTS_Pos) /*!< SPI_T::STATUS: SPIENSTS Mask */ - -#define SPI_STATUS_TXEMPTY_Pos (16) /*!< SPI_T::STATUS: TXEMPTY Position */ -#define SPI_STATUS_TXEMPTY_Msk (0x1ul << SPI_STATUS_TXEMPTY_Pos) /*!< SPI_T::STATUS: TXEMPTY Mask */ - -#define SPI_STATUS_TXFULL_Pos (17) /*!< SPI_T::STATUS: TXFULL Position */ -#define SPI_STATUS_TXFULL_Msk (0x1ul << SPI_STATUS_TXFULL_Pos) /*!< SPI_T::STATUS: TXFULL Mask */ - -#define SPI_STATUS_TXTHIF_Pos (18) /*!< SPI_T::STATUS: TXTHIF Position */ -#define SPI_STATUS_TXTHIF_Msk (0x1ul << SPI_STATUS_TXTHIF_Pos) /*!< SPI_T::STATUS: TXTHIF Mask */ - -#define SPI_STATUS_TXUFIF_Pos (19) /*!< SPI_T::STATUS: TXUFIF Position */ -#define SPI_STATUS_TXUFIF_Msk (0x1ul << SPI_STATUS_TXUFIF_Pos) /*!< SPI_T::STATUS: TXUFIF Mask */ - -#define SPI_STATUS_TXRXRST_Pos (23) /*!< SPI_T::STATUS: TXRXRST Position */ -#define SPI_STATUS_TXRXRST_Msk (0x1ul << SPI_STATUS_TXRXRST_Pos) /*!< SPI_T::STATUS: TXRXRST Mask */ - -#define SPI_STATUS_RXCNT_Pos (24) /*!< SPI_T::STATUS: RXCNT Position */ -#define SPI_STATUS_RXCNT_Msk (0xful << SPI_STATUS_RXCNT_Pos) /*!< SPI_T::STATUS: RXCNT Mask */ - -#define SPI_STATUS_TXCNT_Pos (28) /*!< SPI_T::STATUS: TXCNT Position */ -#define SPI_STATUS_TXCNT_Msk (0xful << SPI_STATUS_TXCNT_Pos) /*!< SPI_T::STATUS: TXCNT Mask */ - -#define SPI_TX_TX_Pos (0) /*!< SPI_T::TX: TX Position */ -#define SPI_TX_TX_Msk (0xfffffffful << SPI_TX_TX_Pos) /*!< SPI_T::TX: TX Mask */ - -#define SPI_RX_RX_Pos (0) /*!< SPI_T::RX: RX Position */ -#define SPI_RX_RX_Msk (0xfffffffful << SPI_RX_RX_Pos) /*!< SPI_T::RX: RX Mask */ - -/**@}*/ /* SPI_CONST */ -/**@}*/ /* end of SPI register group */ -/**@}*/ /* end of REGISTER group */ - -#define SPI0 ((SPI_T *) SPI0_BA) -#define SPI1 ((SPI_T *) SPI1_BA) - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - -/** @addtogroup SPI_EXPORTED_CONSTANTS SPI Exported Constants - @{ -*/ -#define SPI_MODE_0 (SPI_CTL_TXNEG_Msk) /*!< CLKPOL=0; RXNEG=0; TXNEG=1 \hideinitializer */ -#define SPI_MODE_1 (SPI_CTL_RXNEG_Msk) /*!< CLKPOL=0; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_2 (SPI_CTL_CLKPOL_Msk | SPI_CTL_RXNEG_Msk) /*!< CLKPOL=1; RXNEG=1; TXNEG=0 \hideinitializer */ -#define SPI_MODE_3 (SPI_CTL_CLKPOL_Msk | SPI_CTL_TXNEG_Msk) /*!< CLKPOL=1; RXNEG=0; TXNEG=1 \hideinitializer */ - -#define SPI_SLAVE (SPI_CTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */ -#define SPI_MASTER (0x0U) /*!< Set as master \hideinitializer */ - -#define SPI_SS (SPI_SSCTL_SS_Msk) /*!< Set SS \hideinitializer */ -#define SPI_SS_ACTIVE_HIGH (SPI_SSCTL_SSACTPOL_Msk) /*!< SS active high \hideinitializer */ -#define SPI_SS_ACTIVE_LOW (0x0U) /*!< SS active low \hideinitializer */ - -/* SPI Interrupt Mask */ -#define SPI_UNIT_INT_MASK (0x001U) /*!< Unit transfer interrupt mask \hideinitializer */ -#define SPI_SSACT_INT_MASK (0x002U) /*!< Slave selection signal active interrupt mask \hideinitializer */ -#define SPI_SSINACT_INT_MASK (0x004U) /*!< Slave selection signal inactive interrupt mask \hideinitializer */ -#define SPI_SLVUR_INT_MASK (0x008U) /*!< Slave under run interrupt mask \hideinitializer */ -#define SPI_SLVBE_INT_MASK (0x010U) /*!< Slave bit count error interrupt mask \hideinitializer */ -#define SPI_TXUF_INT_MASK (0x040U) /*!< Slave TX underflow interrupt mask \hideinitializer */ -#define SPI_FIFO_TXTH_INT_MASK (0x080U) /*!< FIFO TX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTH_INT_MASK (0x100U) /*!< FIFO RX threshold interrupt mask \hideinitializer */ -#define SPI_FIFO_RXOV_INT_MASK (0x200U) /*!< FIFO RX overrun interrupt mask \hideinitializer */ -#define SPI_FIFO_RXTO_INT_MASK (0x400U) /*!< FIFO RX time-out interrupt mask \hideinitializer */ - -/* SPI Status Mask */ -#define SPI_BUSY_MASK (0x01U) /*!< Busy status mask \hideinitializer */ -#define SPI_RX_EMPTY_MASK (0x02U) /*!< RX empty status mask \hideinitializer */ -#define SPI_RX_FULL_MASK (0x04U) /*!< RX full status mask \hideinitializer */ -#define SPI_TX_EMPTY_MASK (0x08U) /*!< TX empty status mask \hideinitializer */ -#define SPI_TX_FULL_MASK (0x10U) /*!< TX full status mask \hideinitializer */ -#define SPI_TXRX_RESET_MASK (0x20U) /*!< TX or RX reset status mask \hideinitializer */ -#define SPI_SPIEN_STS_MASK (0x40U) /*!< SPIEN status mask \hideinitializer */ -#define SPI_SSLINE_STS_MASK (0x80U) /*!< SPIx_SS line status mask \hideinitializer */ - -/*@}*/ /* end of group SPI_EXPORTED_CONSTANTS */ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ - -/** - * @brief Clear the unit transfer interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Write 1 to UNITIF bit of SPI_STATUS register to clear the unit transfer interrupt flag. - * \hideinitializer - */ -#define SPI_CLR_UNIT_TRANS_INT_FLAG(spi) ((spi)->STATUS = SPI_STATUS_UNITIF_Msk) - -/** - * @brief Trigger RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set RXPDMAEN bit of SPI_PDMACTL register to enable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_RX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_RXPDMAEN_Msk) - -/** - * @brief Trigger TX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit of SPI_PDMACTL register to enable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_PDMA(spi) ((spi)->PDMACTL |= SPI_PDMACTL_TXPDMAEN_Msk) - -/** - * @brief Trigger TX and RX PDMA function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to enable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_TRIGGER_TX_RX_PDMA(spi) ((spi)->PDMACTL |= (SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk)) - -/** - * @brief Disable RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear RXPDMAEN bit of SPI_PDMACTL register to disable RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_RX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_RXPDMAEN_Msk ) - -/** - * @brief Disable TX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit of SPI_PDMACTL register to disable TX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_PDMA(spi) ( (spi)->PDMACTL &= ~SPI_PDMACTL_TXPDMAEN_Msk ) - -/** - * @brief Disable TX and RX PDMA transfer. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear TXPDMAEN bit and RXPDMAEN bit of SPI_PDMACTL register to disable TX and RX PDMA transfer function. - * \hideinitializer - */ -#define SPI_DISABLE_TX_RX_PDMA(spi) ( (spi)->PDMACTL &= ~(SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk) ) - -/** - * @brief Get the count of available data in RX FIFO. - * @param[in] spi The pointer of the specified SPI module. - * @return The count of available data in RX FIFO. - * @details Read RXCNT (SPI_STATUS[27:24]) to get the count of available data in RX FIFO. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_COUNT(spi) (((spi)->STATUS & SPI_STATUS_RXCNT_Msk) >> SPI_STATUS_RXCNT_Pos) - -/** - * @brief Get the RX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 RX FIFO is not empty. - * @retval 1 RX FIFO is empty. - * @details Read RXEMPTY bit of SPI_STATUS register to get the RX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_RX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_RXEMPTY_Msk)>>SPI_STATUS_RXEMPTY_Pos) - -/** - * @brief Get the TX FIFO empty flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not empty. - * @retval 1 TX FIFO is empty. - * @details Read TXEMPTY bit of SPI_STATUS register to get the TX FIFO empty flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_EMPTY_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXEMPTY_Msk)>>SPI_STATUS_TXEMPTY_Pos) - -/** - * @brief Get the TX FIFO full flag. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 TX FIFO is not full. - * @retval 1 TX FIFO is full. - * @details Read TXFULL bit of SPI_STATUS register to get the TX FIFO full flag. - * \hideinitializer - */ -#define SPI_GET_TX_FIFO_FULL_FLAG(spi) (((spi)->STATUS & SPI_STATUS_TXFULL_Msk)>>SPI_STATUS_TXFULL_Pos) - -/** - * @brief Get the datum read from RX register. - * @param[in] spi The pointer of the specified SPI module. - * @return Data in RX register. - * @details Read SPI_RX register to get the received datum. - * \hideinitializer - */ -#define SPI_READ_RX(spi) ((spi)->RX) - -/** - * @brief Write datum to TX register. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxData The datum which user attempt to transfer through SPI bus. - * @return None. - * @details Write u32TxData to SPI_TX register. - * \hideinitializer - */ -#define SPI_WRITE_TX(spi, u32TxData) ((spi)->TX = (u32TxData)) - -/** - * @brief Set SPIx_SS pin to high state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to high state. - * \hideinitializer - */ -#define SPI_SET_SS_HIGH(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~SPI_SSCTL_AUTOSS_Msk)) | (SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk)) - -/** - * @brief Set SPIx_SS pin to low state. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Disable automatic slave selection function and set SPIx_SS pin to low state. - * \hideinitializer - */ -#define SPI_SET_SS_LOW(spi) ((spi)->SSCTL = ((spi)->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk))) | SPI_SSCTL_SS_Msk) - -/** - * @brief Enable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Enable Byte Reorder function. The suspend interval depends on the setting of SUSPITV (SPI_CTL[7:4]). - * \hideinitializer - */ -#define SPI_ENABLE_BYTE_REORDER(spi) ((spi)->CTL |= SPI_CTL_REORDER_Msk) - -/** - * @brief Disable Byte Reorder function. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear REORDER bit field of SPI_CTL register to disable Byte Reorder function. - * \hideinitializer - */ -#define SPI_DISABLE_BYTE_REORDER(spi) ((spi)->CTL &= ~SPI_CTL_REORDER_Msk) - -/** - * @brief Set the length of suspend interval. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SuspCycle Decides the length of suspend interval. It could be 0 ~ 15. - * @return None. - * @details Set the length of suspend interval according to u32SuspCycle. - * The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one SPI bus clock cycle). - * \hideinitializer - */ -#define SPI_SET_SUSPEND_CYCLE(spi, u32SuspCycle) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_SUSPITV_Msk) | ((u32SuspCycle) << SPI_CTL_SUSPITV_Pos)) - -/** - * @brief Set the SPI transfer sequence with LSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set LSB bit of SPI_CTL register to set the SPI transfer sequence with LSB first. - * \hideinitializer - */ -#define SPI_SET_LSB_FIRST(spi) ((spi)->CTL |= SPI_CTL_LSB_Msk) - -/** - * @brief Set the SPI transfer sequence with MSB first. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear LSB bit of SPI_CTL register to set the SPI transfer sequence with MSB first. - * \hideinitializer - */ -#define SPI_SET_MSB_FIRST(spi) ((spi)->CTL &= ~SPI_CTL_LSB_Msk) - -/** - * @brief Set the data width of a SPI transaction. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Width The bit width of one transaction. - * @return None. - * @details The data width can be 8 ~ 32 bits. - * \hideinitializer - */ -#define SPI_SET_DATA_WIDTH(spi, u32Width) ((spi)->CTL = ((spi)->CTL & ~SPI_CTL_DWIDTH_Msk) | (((u32Width)&0x1F) << SPI_CTL_DWIDTH_Pos)) - -/** - * @brief Get the SPI busy state. - * @param[in] spi The pointer of the specified SPI module. - * @retval 0 SPI controller is not busy. - * @retval 1 SPI controller is busy. - * @details This macro will return the busy state of SPI controller. - * \hideinitializer - */ -#define SPI_IS_BUSY(spi) ( ((spi)->STATUS & SPI_STATUS_BUSY_Msk)>>SPI_STATUS_BUSY_Pos ) - -/** - * @brief Enable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Set SPIEN (SPI_CTL[0]) to enable SPI controller. - * \hideinitializer - */ -#define SPI_ENABLE(spi) ((spi)->CTL |= SPI_CTL_SPIEN_Msk) - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None. - * @details Clear SPIEN (SPI_CTL[0]) to disable SPI controller. - * \hideinitializer - */ -#define SPI_DISABLE(spi) ((spi)->CTL &= ~SPI_CTL_SPIEN_Msk) - - -/* Function prototype declaration */ -uint32_t SPI_Open(SPI_T *spi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock); -void SPI_Close(SPI_T *spi); -void SPI_ClearRxFIFO(SPI_T *spi); -void SPI_ClearTxFIFO(SPI_T *spi); -void SPI_DisableAutoSS(SPI_T *spi); -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel); -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold); -uint32_t SPI_GetBusClock(SPI_T *spi); -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask); -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask); -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask); -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask); - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -#ifdef __cplusplus -} -#endif - -#endif - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sys.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sys.h deleted file mode 100644 index 2308cb19381..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_sys.h +++ /dev/null @@ -1,838 +0,0 @@ -/**************************************************************************//** - * @file sys.h - * @brief SYS driver header file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef __NU_SYS_H__ -#define __NU_SYS_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - - -/** @addtogroup SYS_EXPORTED_CONSTANTS SYS Exported Constants - @{ -*/ - - -/** - * @details Interrupt Number Definition. - */ -typedef enum IRQn -{ - IRQ_WDT = 1, // Watch Dog Timer - IRQ_WWDT = 2, // Windowed-WDT Interrupt - IRQ_LVD = 3, // LVD Interrupt - IRQ_EXTI0 = 4, // External Interrupt 0 - IRQ_EXTI1 = 5, // External Interrupt 1 - IRQ_EXTI2 = 6, // External Interrupt 2 - IRQ_EXTI3 = 7, // External Interrupt 3 - IRQ_GPA = 8, // GPA Interrupt - IRQ_GPB = 9, // GPB Interrupt - IRQ_GPC = 10, // GPC Interrupt - IRQ_GPD = 11, // GPD Interrupt - IRQ_I2S = 12, // I2S Interrupt - IRQ_CAP0 = 14, // Sensor Interface Controller Interrupt - IRQ_RTC = 15, // RTC interrupt - IRQ_TIMER0 = 16, // Timer 0 interrupt - IRQ_TIMER1 = 17, // Timer 1 interrupt - IRQ_ADC = 18, // ADC interrupt - IRQ_EMC0_RX = 19, // EMC 0 RX Interrupt - IRQ_EMC1_RX = 20, // EMC 1 RX Interrupt - IRQ_EMC0_TX = 21, // EMC 0 TX Interrupt - IRQ_EMC1_TX = 22, // EMC 1 TX Interrupt - IRQ_EHCI = 23, // USB 2.0 Host Controller Interrupt - IRQ_OHCI = 24, // USB 1.1 Host Controller Interrupt - IRQ_PDMA0 = 25, // PDMA Channel 0 Interrupt - IRQ_PDMA1 = 26, // PDMA Channel 1 Interrupt - IRQ_SDH = 27, // SD Host Interrupt - IRQ_FMI = 28, // NAND/eMMC Interrupt - IRQ_UDC = 29, // USB Device Controller Interrupt - IRQ_TIMER2 = 30, // Timer 2 interrupt - IRQ_TIMER3 = 31, // Timer 3 interrupt - IRQ_TIMER4 = 32, // Timer 4 interrupt - IRQ_CAP1 = 33, // VCAP1 Engine Interrupt - IRQ_TIMER5 = 34, // Timer 5 interrupt - IRQ_CRYPTO = 35, // CRYPTO Engine Interrupt - IRQ_UART0 = 36, // UART 0 interrupt - IRQ_UART1 = 37, // UART 1 interrupt - IRQ_UART2 = 38, // UART 2 interrupt - IRQ_UART4 = 39, // UART 4 interrupt - IRQ_UART6 = 40, // UART 6 interrupt - IRQ_UART8 = 41, // UART 8 interrupt - IRQ_CAN3 = 42, // CAN 3 interrupt - IRQ_UART3 = 43, // UART 3 interrupt - IRQ_UART5 = 44, // UART 5 interrupt - IRQ_UART7 = 45, // UART 7 interrupt - IRQ_UART9 = 46, // UART 9 interrupt - IRQ_I2C2 = 47, // I2C 2 interrupt - IRQ_I2C3 = 48, // I2C 3 interrupt - IRQ_GPE = 49, // GPE interrupt - IRQ_SPI1 = 50, // SPI 1 interrupt - IRQ_QSPI0 = 51, // QSPI 0 interrupt - IRQ_SPI0 = 52, // SPI 0 interrupt - IRQ_I2C0 = 53, // I2C 0 Interrupt - IRQ_I2C1 = 54, // I2C 1 Interrupt - IRQ_SMC0 = 55, // SmartCard 0 Interrupt - IRQ_SMC1 = 56, // SmartCard 1 Interrupt - IRQ_GPF = 57, // GPF interrupt - IRQ_CAN0 = 58, // CAN 0 interrupt - IRQ_CAN1 = 59, // CAN 1 interrupt - IRQ_PWM0 = 60, // PWM 0 interrupt - IRQ_PWM1 = 61, // PWM 1 interrupt - IRQ_CAN2 = 62, // CAN 2 interrupt - IRQ_GPG = 63, // GPG interrupt -} -IRQn_Type; - -/* Define constants for use AIC in service parameters. */ -#define SYS_SWI 0 -#define SYS_D_ABORT 1 -#define SYS_I_ABORT 2 -#define SYS_UNDEFINE 3 - -/* The parameters for sysSetInterruptPriorityLevel() and - sysInstallISR() use */ -#define FIQ_LEVEL_0 0 /*!< FIQ Level 0 */ -#define IRQ_LEVEL_1 1 /*!< IRQ Level 1 */ -#define IRQ_LEVEL_2 2 /*!< IRQ Level 2 */ -#define IRQ_LEVEL_3 3 /*!< IRQ Level 3 */ -#define IRQ_LEVEL_4 4 /*!< IRQ Level 4 */ -#define IRQ_LEVEL_5 5 /*!< IRQ Level 5 */ -#define IRQ_LEVEL_6 6 /*!< IRQ Level 6 */ -#define IRQ_LEVEL_7 7 /*!< IRQ Level 7 */ - - -/* The parameters for sysSetLocalInterrupt() use */ -#define ENABLE_IRQ 0x7F /*!< Enable I-bit of CP15 */ -#define ENABLE_FIQ 0xBF /*!< Enable F-bit of CP15 */ -#define ENABLE_FIQ_IRQ 0x3F /*!< Enable I-bit and F-bit of CP15 */ -#define DISABLE_IRQ 0x80 /*!< Disable I-bit of CP15 */ -#define DISABLE_FIQ 0x40 /*!< Disable F-bit of CP15 */ -#define DISABLE_FIQ_IRQ 0xC0 /*!< Disable I-bit and F-bit of CP15 */ - -/* Define Cache type */ -#define CACHE_WRITE_BACK 0 /*!< Cache Write-back mode */ -#define CACHE_WRITE_THROUGH 1 /*!< Cache Write-through mode */ -#define CACHE_DISABLE -1 /*!< Cache Disable */ - -/** \brief Structure type of clock source - */ -typedef enum CLKn -{ - - SYS_UPLL = 1, /*!< UPLL clock */ - SYS_APLL = 2, /*!< APLL clock */ - SYS_SYSTEM = 3, /*!< System clock */ - SYS_HCLK = 4, /*!< HCLK1 clock */ - SYS_PCLK01 = 5, /*!< HCLK234 clock */ - SYS_PCLK2 = 6, /*!< PCLK clock */ - SYS_CPU = 7, /*!< CPU clock */ - -} CLK_Type; - -/* The parameters for sysSetInterruptType() use */ -#define LOW_LEVEL_SENSITIVE 0x00 -#define HIGH_LEVEL_SENSITIVE 0x40 -#define NEGATIVE_EDGE_TRIGGER 0x80 -#define POSITIVE_EDGE_TRIGGER 0xC0 - -/* The parameters for sysSetGlobalInterrupt() use */ -#define ENABLE_ALL_INTERRUPTS 0 -#define DISABLE_ALL_INTERRUPTS 1 - -#define MMU_DIRECT_MAPPING 0 - -/* Define constants for use Cache in service parameters. */ -#define I_CACHE 6 -#define D_CACHE 7 -#define I_D_CACHE 8 - - -/// @endcond HIDDEN_SYMBOLS - -/*@}*/ /* end of group SYS_EXPORTED_CONSTANTS */ - -/*---------------------- System Manger Controller -------------------------*/ -/** - @addtogroup SYS System Manger Controller(SYS) - Memory Mapped Structure for SYS Controller -@{ */ - -#define SYS ((SYS_T *) SYS_BA) - -typedef struct -{ - __I uint32_t PDID; /* Offset: 0x00 */ - __IO uint32_t PWRON; /* Offset: 0x04 */ - __IO uint32_t ARBCON; /* Offset: 0x08 */ - __I uint32_t RESERVE0[5]; - __IO uint32_t LVRDCR; /* Offset: 0x20 */ - __I uint32_t RESERVE1[3]; - __IO uint32_t MISCFCR; /* Offset: 0x30 */ - __I uint32_t RESERVE2[3]; - __IO uint32_t MISCIER; /* Offset: 0x40 */ - __IO uint32_t MISCISR; /* Offset: 0x44 */ - __I uint32_t RESERVE3[2]; - __IO uint32_t WKUPSER0; /* Offset: 0x50 */ - __IO uint32_t WKUPSER1; /* Offset: 0x54 */ - __IO uint32_t WKUPSSR0; /* Offset: 0x58 */ - __IO uint32_t WKUPSSR1; /* Offset: 0x5C */ - __IO uint32_t AHBIPRST; /* Offset: 0x60 */ - __IO uint32_t APBIPRST0; /* Offset: 0x64 */ - __IO uint32_t APBIPRST1; /* Offset: 0x68 */ - __IO uint32_t RSTSTS; /* Offset: 0x6C */ - __IO uint32_t GPA_MFPL; /* Offset: 0x70 */ - __IO uint32_t GPA_MFPH; /* Offset: 0x74 */ - __IO uint32_t GPB_MFPL; /* Offset: 0x78 */ - __IO uint32_t GPB_MFPH; /* Offset: 0x7C */ - __IO uint32_t GPC_MFPL; /* Offset: 0x80 */ - __IO uint32_t GPC_MFPH; /* Offset: 0x84 */ - __IO uint32_t GPD_MFPL; /* Offset: 0x88 */ - __IO uint32_t GPD_MFPH; /* Offset: 0x8C */ - __IO uint32_t GPE_MFPL; /* Offset: 0x90 */ - __IO uint32_t GPE_MFPH; /* Offset: 0x94 */ - __IO uint32_t GPF_MFPL; /* Offset: 0x98 */ - __IO uint32_t GPF_MFPH; /* Offset: 0x9c */ - __IO uint32_t GPG_MFPL; /* Offset: 0xA0 */ - __IO uint32_t GPG_MFPH; /* Offset: 0xA4 */ - __I uint32_t RESERVE4[18]; - __IO uint32_t DDR_DSCTL; /* Offset: 0xF0 */ - __I uint32_t RESERVE5[3]; - __IO uint32_t PORDISCR; /* Offset: 0x100 */ - __IO uint32_t ICEDBGCR; /* Offset: 0x104 */ - __IO uint32_t ERRADDCR; /* Offset: 0x108 */ - __I uint32_t RESERVE6[59]; - __IO uint32_t IRCTCTL; /* Offset: 0x1F8 */ - __IO uint32_t REGWPCTL; /* Offset: 0x1FC */ - - -} SYS_T; - - -/* SYS GPA_MFPL Bit Field Definitions */ -#define SYS_GPA_MFPL_PA0MFP_Pos (0) /*!< SYS_T::GPA_MFPL: PA0MFP Position */ -#define SYS_GPA_MFPL_PA0MFP_Msk (0xful << SYS_GPA_MFPL_PA0MFP_Pos) /*!< SYS_T::GPA_MFPL: PA0MFP Mask */ - -#define SYS_GPA_MFPL_PA1MFP_Pos (4) /*!< SYS_T::GPA_MFPL: PA1MFP Position */ -#define SYS_GPA_MFPL_PA1MFP_Msk (0xful << SYS_GPA_MFPL_PA1MFP_Pos) /*!< SYS_T::GPA_MFPL: PA1MFP Mask */ - -#define SYS_GPA_MFPL_PA2MFP_Pos (8) /*!< SYS_T::GPA_MFPL: PA2MFP Position */ -#define SYS_GPA_MFPL_PA2MFP_Msk (0xful << SYS_GPA_MFPL_PA2MFP_Pos) /*!< SYS_T::GPA_MFPL: PA2MFP Mask */ - -#define SYS_GPA_MFPL_PA3MFP_Pos (12) /*!< SYS_T::GPA_MFPL: PA3MFP Position */ -#define SYS_GPA_MFPL_PA3MFP_Msk (0xful << SYS_GPA_MFPL_PA3MFP_Pos) /*!< SYS_T::GPA_MFPL: PA3MFP Mask */ - -#define SYS_GPA_MFPL_PA4MFP_Pos (16) /*!< SYS_T::GPA_MFPL: PA4MFP Position */ -#define SYS_GPA_MFPL_PA4MFP_Msk (0xful << SYS_GPA_MFPL_PA4MFP_Pos) /*!< SYS_T::GPA_MFPL: PA4MFP Mask */ - -#define SYS_GPA_MFPL_PA5MFP_Pos (20) /*!< SYS_T::GPA_MFPL: PA5MFP Position */ -#define SYS_GPA_MFPL_PA5MFP_Msk (0xful << SYS_GPA_MFPL_PA5MFP_Pos) /*!< SYS_T::GPA_MFPL: PA5MFP Mask */ - -#define SYS_GPA_MFPL_PA6MFP_Pos (24) /*!< SYS_T::GPA_MFPL: PA6MFP Position */ -#define SYS_GPA_MFPL_PA6MFP_Msk (0xful << SYS_GPA_MFPL_PA6MFP_Pos) /*!< SYS_T::GPA_MFPL: PA6MFP Mask */ - -#define SYS_GPA_MFPL_PA7MFP_Pos (28) /*!< SYS_T::GPA_MFPL: PA7MFP Position */ -#define SYS_GPA_MFPL_PA7MFP_Msk (0xful << SYS_GPA_MFPL_PA7MFP_Pos) /*!< SYS_T::GPA_MFPL: PA7MFP Mask */ - -/* SYS GPA_MFPH Bit Field Definitions */ -#define SYS_GPA_MFPH_PA8MFP_Pos (0) /*!< SYS_T::GPA_MFPH: PA8MFP Position */ -#define SYS_GPA_MFPH_PA8MFP_Msk (0xful << SYS_GPA_MFPH_PA8MFP_Pos) /*!< SYS_T::GPA_MFPH: PA8MFP Mask */ - -#define SYS_GPA_MFPH_PA9MFP_Pos (4) /*!< SYS_T::GPA_MFPH: PA9MFP Position */ -#define SYS_GPA_MFPH_PA9MFP_Msk (0xful << SYS_GPA_MFPH_PA9MFP_Pos) /*!< SYS_T::GPA_MFPH: PA9MFP Mask */ - -#define SYS_GPA_MFPH_PA10MFP_Pos (8) /*!< SYS_T::GPA_MFPH: PA10MFP Position */ -#define SYS_GPA_MFPH_PA10MFP_Msk (0xful << SYS_GPA_MFPH_PA10MFP_Pos) /*!< SYS_T::GPA_MFPH: PA10MFP Mask */ - -#define SYS_GPA_MFPH_PA11MFP_Pos (12) /*!< SYS_T::GPA_MFPH: PA11MFP Position */ -#define SYS_GPA_MFPH_PA11MFP_Msk (0xful << SYS_GPA_MFPH_PA11MFP_Pos) /*!< SYS_T::GPA_MFPH: PA11MFP Mask */ - -#define SYS_GPA_MFPH_PA12MFP_Pos (16) /*!< SYS_T::GPA_MFPH: PA12MFP Position */ -#define SYS_GPA_MFPH_PA12MFP_Msk (0xful << SYS_GPA_MFPH_PA12MFP_Pos) /*!< SYS_T::GPA_MFPH: PA12MFP Mask */ - -#define SYS_GPA_MFPH_PA13MFP_Pos (20) /*!< SYS_T::GPA_MFPH: PA13MFP Position */ -#define SYS_GPA_MFPH_PA13MFP_Msk (0xful << SYS_GPA_MFPH_PA13MFP_Pos) /*!< SYS_T::GPA_MFPH: PA13MFP Mask */ - -#define SYS_GPA_MFPH_PA14MFP_Pos (24) /*!< SYS_T::GPA_MFPH: PA14MFP Position */ -#define SYS_GPA_MFPH_PA14MFP_Msk (0xful << SYS_GPA_MFPH_PA14MFP_Pos) /*!< SYS_T::GPA_MFPH: PA14MFP Mask */ - -#define SYS_GPA_MFPH_PA15MFP_Pos (28) /*!< SYS_T::GPA_MFPH: PA15MFP Position */ -#define SYS_GPA_MFPH_PA15MFP_Msk (0xful << SYS_GPA_MFPH_PA15MFP_Pos) /*!< SYS_T::GPA_MFPH: PA15MFP Mask */ - -/* SYS GPB_MFPL Bit Field Definitions */ -#define SYS_GPB_MFPL_PB0MFP_Pos (0) /*!< SYS_T::GPB_MFPL: PB0MFP Position */ -#define SYS_GPB_MFPL_PB0MFP_Msk (0xful << SYS_GPB_MFPL_PB0MFP_Pos) /*!< SYS_T::GPB_MFPL: PB0MFP Mask */ - -#define SYS_GPB_MFPL_PB1MFP_Pos (4) /*!< SYS_T::GPB_MFPL: PB1MFP Position */ -#define SYS_GPB_MFPL_PB1MFP_Msk (0xful << SYS_GPB_MFPL_PB1MFP_Pos) /*!< SYS_T::GPB_MFPL: PB1MFP Mask */ - -#define SYS_GPB_MFPL_PB2MFP_Pos (8) /*!< SYS_T::GPB_MFPL: PB2MFP Position */ -#define SYS_GPB_MFPL_PB2MFP_Msk (0xful << SYS_GPB_MFPL_PB2MFP_Pos) /*!< SYS_T::GPB_MFPL: PB2MFP Mask */ - -#define SYS_GPB_MFPL_PB3MFP_Pos (12) /*!< SYS_T::GPB_MFPL: PB3MFP Position */ -#define SYS_GPB_MFPL_PB3MFP_Msk (0xful << SYS_GPB_MFPL_PB3MFP_Pos) /*!< SYS_T::GPB_MFPL: PB3MFP Mask */ - -#define SYS_GPB_MFPL_PB4MFP_Pos (16) /*!< SYS_T::GPB_MFPL: PB4MFP Position */ -#define SYS_GPB_MFPL_PB4MFP_Msk (0xful << SYS_GPB_MFPL_PB4MFP_Pos) /*!< SYS_T::GPB_MFPL: PB4MFP Mask */ - -#define SYS_GPB_MFPL_PB5MFP_Pos (20) /*!< SYS_T::GPB_MFPL: PB5MFP Position */ -#define SYS_GPB_MFPL_PB5MFP_Msk (0xful << SYS_GPB_MFPL_PB5MFP_Pos) /*!< SYS_T::GPB_MFPL: PB5MFP Mask */ - -#define SYS_GPB_MFPL_PB6MFP_Pos (24) /*!< SYS_T::GPB_MFPL: PB6MFP Position */ -#define SYS_GPB_MFPL_PB6MFP_Msk (0xful << SYS_GPB_MFPL_PB6MFP_Pos) /*!< SYS_T::GPB_MFPL: PB6MFP Mask */ - -#define SYS_GPB_MFPL_PB7MFP_Pos (28) /*!< SYS_T::GPB_MFPL: PB7MFP Position */ -#define SYS_GPB_MFPL_PB7MFP_Msk (0xful << SYS_GPB_MFPL_PB7MFP_Pos) /*!< SYS_T::GPB_MFPL: PB7MFP Mask */ - -/* SYS GPB_MFPH Bit Field Definitions */ -#define SYS_GPB_MFPH_PB8MFP_Pos (0) /*!< SYS_T::GPB_MFPH: PB8MFP Position */ -#define SYS_GPB_MFPH_PB8MFP_Msk (0xful << SYS_GPB_MFPH_PB8MFP_Pos) /*!< SYS_T::GPB_MFPH: PB8MFP Mask */ - -#define SYS_GPB_MFPH_PB9MFP_Pos (4) /*!< SYS_T::GPB_MFPH: PB9MFP Position */ -#define SYS_GPB_MFPH_PB9MFP_Msk (0xful << SYS_GPB_MFPH_PB9MFP_Pos) /*!< SYS_T::GPB_MFPH: PB9MFP Mask */ - -#define SYS_GPB_MFPH_PB10MFP_Pos (8) /*!< SYS_T::GPB_MFPH: PB10MFP Position */ -#define SYS_GPB_MFPH_PB10MFP_Msk (0xful << SYS_GPB_MFPH_PB10MFP_Pos) /*!< SYS_T::GPB_MFPH: PB10MFP Mask */ - -#define SYS_GPB_MFPH_PB11MFP_Pos (12) /*!< SYS_T::GPB_MFPH: PB11MFP Position */ -#define SYS_GPB_MFPH_PB11MFP_Msk (0xful << SYS_GPB_MFPH_PB11MFP_Pos) /*!< SYS_T::GPB_MFPH: PB11MFP Mask */ - -#define SYS_GPB_MFPH_PB12MFP_Pos (16) /*!< SYS_T::GPB_MFPH: PB12MFP Position */ -#define SYS_GPB_MFPH_PB12MFP_Msk (0xful << SYS_GPB_MFPH_PB12MFP_Pos) /*!< SYS_T::GPB_MFPH: PB12MFP Mask */ - -#define SYS_GPB_MFPH_PB13MFP_Pos (20) /*!< SYS_T::GPB_MFPH: PB13MFP Position */ -#define SYS_GPB_MFPH_PB13MFP_Msk (0xful << SYS_GPB_MFPH_PB13MFP_Pos) /*!< SYS_T::GPB_MFPH: PB13MFP Mask */ - -#define SYS_GPB_MFPH_PB14MFP_Pos (24) /*!< SYS_T::GPB_MFPH: PB14MFP Position */ -#define SYS_GPB_MFPH_PB14MFP_Msk (0xful << SYS_GPB_MFPH_PB14MFP_Pos) /*!< SYS_T::GPB_MFPH: PB14MFP Mask */ - -#define SYS_GPB_MFPH_PB15MFP_Pos (28) /*!< SYS_T::GPB_MFPH: PB15MFP Position */ -#define SYS_GPB_MFPH_PB15MFP_Msk (0xful << SYS_GPB_MFPH_PB15MFP_Pos) /*!< SYS_T::GPB_MFPH: PB15MFP Mask */ - -/* SYS GPC_MFPL Bit Field Definitions */ -#define SYS_GPC_MFPL_PC0MFP_Pos (0) /*!< SYS_T::GPC_MFPL: PC0MFP Position */ -#define SYS_GPC_MFPL_PC0MFP_Msk (0xful << SYS_GPC_MFPL_PC0MFP_Pos) /*!< SYS_T::GPC_MFPL: PC0MFP Mask */ - -#define SYS_GPC_MFPL_PC1MFP_Pos (4) /*!< SYS_T::GPC_MFPL: PC1MFP Position */ -#define SYS_GPC_MFPL_PC1MFP_Msk (0xful << SYS_GPC_MFPL_PC1MFP_Pos) /*!< SYS_T::GPC_MFPL: PC1MFP Mask */ - -#define SYS_GPC_MFPL_PC2MFP_Pos (8) /*!< SYS_T::GPC_MFPL: PC2MFP Position */ -#define SYS_GPC_MFPL_PC2MFP_Msk (0xful << SYS_GPC_MFPL_PC2MFP_Pos) /*!< SYS_T::GPC_MFPL: PC2MFP Mask */ - -#define SYS_GPC_MFPL_PC3MFP_Pos (12) /*!< SYS_T::GPC_MFPL: PC3MFP Position */ -#define SYS_GPC_MFPL_PC3MFP_Msk (0xful << SYS_GPC_MFPL_PC3MFP_Pos) /*!< SYS_T::GPC_MFPL: PC3MFP Mask */ - -#define SYS_GPC_MFPL_PC4MFP_Pos (16) /*!< SYS_T::GPC_MFPL: PC4MFP Position */ -#define SYS_GPC_MFPL_PC4MFP_Msk (0xful << SYS_GPC_MFPL_PC4MFP_Pos) /*!< SYS_T::GPC_MFPL: PC4MFP Mask */ - -#define SYS_GPC_MFPL_PC5MFP_Pos (20) /*!< SYS_T::GPC_MFPL: PC5MFP Position */ -#define SYS_GPC_MFPL_PC5MFP_Msk (0xful << SYS_GPC_MFPL_PC5MFP_Pos) /*!< SYS_T::GPC_MFPL: PC5MFP Mask */ - -#define SYS_GPC_MFPL_PC6MFP_Pos (24) /*!< SYS_T::GPC_MFPL: PC6MFP Position */ -#define SYS_GPC_MFPL_PC6MFP_Msk (0xful << SYS_GPC_MFPL_PC6MFP_Pos) /*!< SYS_T::GPC_MFPL: PC6MFP Mask */ - -#define SYS_GPC_MFPL_PC7MFP_Pos (28) /*!< SYS_T::GPC_MFPL: PC7MFP Position */ -#define SYS_GPC_MFPL_PC7MFP_Msk (0xful << SYS_GPC_MFPL_PC7MFP_Pos) /*!< SYS_T::GPC_MFPL: PC7MFP Mask */ - -/* SYS GPC_MFPH Bit Field Definitions */ -#define SYS_GPC_MFPH_PC8MFP_Pos (0) /*!< SYS_T::GPC_MFPH: PC8MFP Position */ -#define SYS_GPC_MFPH_PC8MFP_Msk (0xful << SYS_GPC_MFPH_PC8MFP_Pos) /*!< SYS_T::GPC_MFPH: PC8MFP Mask */ - -#define SYS_GPC_MFPH_PC9MFP_Pos (4) /*!< SYS_T::GPC_MFPH: PC9MFP Position */ -#define SYS_GPC_MFPH_PC9MFP_Msk (0xful << SYS_GPC_MFPH_PC9MFP_Pos) /*!< SYS_T::GPC_MFPH: PC9MFP Mask */ - -#define SYS_GPC_MFPH_PC10MFP_Pos (8) /*!< SYS_T::GPC_MFPH: PC10MFP Position */ -#define SYS_GPC_MFPH_PC10MFP_Msk (0xful << SYS_GPC_MFPH_PC10MFP_Pos) /*!< SYS_T::GPC_MFPH: PC10MFP Mask */ - -#define SYS_GPC_MFPH_PC11MFP_Pos (12) /*!< SYS_T::GPC_MFPH: PC11MFP Position */ -#define SYS_GPC_MFPH_PC11MFP_Msk (0xful << SYS_GPC_MFPH_PC11MFP_Pos) /*!< SYS_T::GPC_MFPH: PC11MFP Mask */ - -#define SYS_GPC_MFPH_PC12MFP_Pos (16) /*!< SYS_T::GPC_MFPH: PC12MFP Position */ -#define SYS_GPC_MFPH_PC12MFP_Msk (0xful << SYS_GPC_MFPH_PC12MFP_Pos) /*!< SYS_T::GPC_MFPH: PC12MFP Mask */ - -#define SYS_GPC_MFPH_PC13MFP_Pos (20) /*!< SYS_T::GPC_MFPH: PC13MFP Position */ -#define SYS_GPC_MFPH_PC13MFP_Msk (0xful << SYS_GPC_MFPH_PC13MFP_Pos) /*!< SYS_T::GPC_MFPH: PC13MFP Mask */ - -#define SYS_GPC_MFPH_PC14MFP_Pos (24) /*!< SYS_T::GPC_MFPH: PC14MFP Position */ -#define SYS_GPC_MFPH_PC14MFP_Msk (0xful << SYS_GPC_MFPH_PC14MFP_Pos) /*!< SYS_T::GPC_MFPH: PC14MFP Mask */ - -#define SYS_GPC_MFPH_PC15MFP_Pos (28) /*!< SYS_T::GPC_MFPH: PC15MFP Position */ -#define SYS_GPC_MFPH_PC15MFP_Msk (0xful << SYS_GPC_MFPH_PC15MFP_Pos) /*!< SYS_T::GPC_MFPH: PC15MFP Mask */ - -/* SYS GPD_MFPL Bit Field Definitions */ -#define SYS_GPD_MFPL_PD0MFP_Pos (0) /*!< SYS_T::GPD_MFPL: PD0MFP Position */ -#define SYS_GPD_MFPL_PD0MFP_Msk (0xful << SYS_GPD_MFPL_PD0MFP_Pos) /*!< SYS_T::GPD_MFPL: PD0MFP Mask */ - -#define SYS_GPD_MFPL_PD1MFP_Pos (4) /*!< SYS_T::GPD_MFPL: PD1MFP Position */ -#define SYS_GPD_MFPL_PD1MFP_Msk (0xful << SYS_GPD_MFPL_PD1MFP_Pos) /*!< SYS_T::GPD_MFPL: PD1MFP Mask */ - -#define SYS_GPD_MFPL_PD2MFP_Pos (8) /*!< SYS_T::GPD_MFPL: PD2MFP Position */ -#define SYS_GPD_MFPL_PD2MFP_Msk (0xful << SYS_GPD_MFPL_PD2MFP_Pos) /*!< SYS_T::GPD_MFPL: PD2MFP Mask */ - -#define SYS_GPD_MFPL_PD3MFP_Pos (12) /*!< SYS_T::GPD_MFPL: PD3MFP Position */ -#define SYS_GPD_MFPL_PD3MFP_Msk (0xful << SYS_GPD_MFPL_PD3MFP_Pos) /*!< SYS_T::GPD_MFPL: PD3MFP Mask */ - -#define SYS_GPD_MFPL_PD4MFP_Pos (16) /*!< SYS_T::GPD_MFPL: PD4MFP Position */ -#define SYS_GPD_MFPL_PD4MFP_Msk (0xful << SYS_GPD_MFPL_PD4MFP_Pos) /*!< SYS_T::GPD_MFPL: PD4MFP Mask */ - -#define SYS_GPD_MFPL_PD5MFP_Pos (20) /*!< SYS_T::GPD_MFPL: PD5MFP Position */ -#define SYS_GPD_MFPL_PD5MFP_Msk (0xful << SYS_GPD_MFPL_PD5MFP_Pos) /*!< SYS_T::GPD_MFPL: PD5MFP Mask */ - -#define SYS_GPD_MFPL_PD6MFP_Pos (24) /*!< SYS_T::GPD_MFPL: PD6MFP Position */ -#define SYS_GPD_MFPL_PD6MFP_Msk (0xful << SYS_GPD_MFPL_PD6MFP_Pos) /*!< SYS_T::GPD_MFPL: PD6MFP Mask */ - -#define SYS_GPD_MFPL_PD7MFP_Pos (28) /*!< SYS_T::GPD_MFPL: PD7MFP Position */ -#define SYS_GPD_MFPL_PD7MFP_Msk (0xful << SYS_GPD_MFPL_PD7MFP_Pos) /*!< SYS_T::GPD_MFPL: PD7MFP Mask */ - -/* SYS GPD_MFPH Bit Field Definitions */ -#define SYS_GPD_MFPH_PD8MFP_Pos (0) /*!< SYS_T::GPD_MFPH: PD8MFP Position */ -#define SYS_GPD_MFPH_PD8MFP_Msk (0xful << SYS_GPD_MFPH_PD8MFP_Pos) /*!< SYS_T::GPD_MFPH: PD8MFP Mask */ - -#define SYS_GPD_MFPH_PD9MFP_Pos (4) /*!< SYS_T::GPD_MFPH: PD9MFP Position */ -#define SYS_GPD_MFPH_PD9MFP_Msk (0xful << SYS_GPD_MFPH_PD9MFP_Pos) /*!< SYS_T::GPD_MFPH: PD9MFP Mask */ - -#define SYS_GPD_MFPH_PD10MFP_Pos (8) /*!< SYS_T::GPD_MFPH: PD10MFP Position */ -#define SYS_GPD_MFPH_PD10MFP_Msk (0xful << SYS_GPD_MFPH_PD10MFP_Pos) /*!< SYS_T::GPD_MFPH: PD10MFP Mask */ - -#define SYS_GPD_MFPH_PD11MFP_Pos (12) /*!< SYS_T::GPD_MFPH: PD11MFP Position */ -#define SYS_GPD_MFPH_PD11MFP_Msk (0xful << SYS_GPD_MFPH_PD11MFP_Pos) /*!< SYS_T::GPD_MFPH: PD11MFP Mask */ - -#define SYS_GPD_MFPH_PD12MFP_Pos (16) /*!< SYS_T::GPD_MFPH: PD12MFP Position */ -#define SYS_GPD_MFPH_PD12MFP_Msk (0xful << SYS_GPD_MFPH_PD12MFP_Pos) /*!< SYS_T::GPD_MFPH: PD12MFP Mask */ - -#define SYS_GPD_MFPH_PD13MFP_Pos (20) /*!< SYS_T::GPD_MFPH: PD13MFP Position */ -#define SYS_GPD_MFPH_PD13MFP_Msk (0xful << SYS_GPD_MFPH_PD13MFP_Pos) /*!< SYS_T::GPD_MFPH: PD13MFP Mask */ - -#define SYS_GPD_MFPH_PD14MFP_Pos (24) /*!< SYS_T::GPD_MFPH: PD14MFP Position */ -#define SYS_GPD_MFPH_PD14MFP_Msk (0xful << SYS_GPD_MFPH_PD14MFP_Pos) /*!< SYS_T::GPD_MFPH: PD14MFP Mask */ - -#define SYS_GPD_MFPH_PD15MFP_Pos (28) /*!< SYS_T::GPD_MFPH: PD15MFP Position */ -#define SYS_GPD_MFPH_PD15MFP_Msk (0xful << SYS_GPD_MFPH_PD15MFP_Pos) /*!< SYS_T::GPD_MFPH: PD15MFP Mask */ - -/* SYS GPE_MFPL Bit Field Definitions */ -#define SYS_GPE_MFPL_PE0MFP_Pos (0) /*!< SYS_T::GPE_MFPL: PE0MFP Position */ -#define SYS_GPE_MFPL_PE0MFP_Msk (0xful << SYS_GPE_MFPL_PE0MFP_Pos) /*!< SYS_T::GPE_MFPL: PE0MFP Mask */ - -#define SYS_GPE_MFPL_PE1MFP_Pos (4) /*!< SYS_T::GPE_MFPL: PE1MFP Position */ -#define SYS_GPE_MFPL_PE1MFP_Msk (0xful << SYS_GPE_MFPL_PE1MFP_Pos) /*!< SYS_T::GPE_MFPL: PE1MFP Mask */ - -#define SYS_GPE_MFPL_PE2MFP_Pos (8) /*!< SYS_T::GPE_MFPL: PE2MFP Position */ -#define SYS_GPE_MFPL_PE2MFP_Msk (0xful << SYS_GPE_MFPL_PE2MFP_Pos) /*!< SYS_T::GPE_MFPL: PE2MFP Mask */ - -#define SYS_GPE_MFPL_PE3MFP_Pos (12) /*!< SYS_T::GPE_MFPL: PE3MFP Position */ -#define SYS_GPE_MFPL_PE3MFP_Msk (0xful << SYS_GPE_MFPL_PE3MFP_Pos) /*!< SYS_T::GPE_MFPL: PE3MFP Mask */ - -#define SYS_GPE_MFPL_PE4MFP_Pos (16) /*!< SYS_T::GPE_MFPL: PE4MFP Position */ -#define SYS_GPE_MFPL_PE4MFP_Msk (0xful << SYS_GPE_MFPL_PE4MFP_Pos) /*!< SYS_T::GPE_MFPL: PE4MFP Mask */ - -#define SYS_GPE_MFPL_PE5MFP_Pos (20) /*!< SYS_T::GPE_MFPL: PE5MFP Position */ -#define SYS_GPE_MFPL_PE5MFP_Msk (0xful << SYS_GPE_MFPL_PE5MFP_Pos) /*!< SYS_T::GPE_MFPL: PE5MFP Mask */ - -#define SYS_GPE_MFPL_PE6MFP_Pos (24) /*!< SYS_T::GPE_MFPL: PE6MFP Position */ -#define SYS_GPE_MFPL_PE6MFP_Msk (0xful << SYS_GPE_MFPL_PE6MFP_Pos) /*!< SYS_T::GPE_MFPL: PE6MFP Mask */ - -#define SYS_GPE_MFPL_PE7MFP_Pos (28) /*!< SYS_T::GPE_MFPL: PE7MFP Position */ -#define SYS_GPE_MFPL_PE7MFP_Msk (0xful << SYS_GPE_MFPL_PE7MFP_Pos) /*!< SYS_T::GPE_MFPL: PE7MFP Mask */ - -/* SYS GPE_MFPH Bit Field Definitions */ -#define SYS_GPE_MFPH_PE8MFP_Pos (0) /*!< SYS_T::GPE_MFPH: PE8MFP Position */ -#define SYS_GPE_MFPH_PE8MFP_Msk (0xful << SYS_GPE_MFPH_PE8MFP_Pos) /*!< SYS_T::GPE_MFPH: PE8MFP Mask */ - -#define SYS_GPE_MFPH_PE9MFP_Pos (4) /*!< SYS_T::GPE_MFPH: PE9MFP Position */ -#define SYS_GPE_MFPH_PE9MFP_Msk (0xful << SYS_GPE_MFPH_PE9MFP_Pos) /*!< SYS_T::GPE_MFPH: PE9MFP Mask */ - -#define SYS_GPE_MFPH_PE10MFP_Pos (8) /*!< SYS_T::GPE_MFPH: PE10MFP Position */ -#define SYS_GPE_MFPH_PE10MFP_Msk (0xful << SYS_GPE_MFPH_PE10MFP_Pos) /*!< SYS_T::GPE_MFPH: PE10MFP Mask */ - -#define SYS_GPE_MFPH_PE11MFP_Pos (12) /*!< SYS_T::GPE_MFPH: PE11MFP Position */ -#define SYS_GPE_MFPH_PE11MFP_Msk (0xful << SYS_GPE_MFPH_PE11MFP_Pos) /*!< SYS_T::GPE_MFPH: PE11MFP Mask */ - -#define SYS_GPE_MFPH_PE12MFP_Pos (16) /*!< SYS_T::GPE_MFPH: PE12MFP Position */ -#define SYS_GPE_MFPH_PE12MFP_Msk (0xful << SYS_GPE_MFPH_PE12MFP_Pos) /*!< SYS_T::GPE_MFPH: PE12MFP Mask */ - -#define SYS_GPE_MFPH_PE13MFP_Pos (20) /*!< SYS_T::GPE_MFPH: PE13MFP Position */ -#define SYS_GPE_MFPH_PE13MFP_Msk (0xful << SYS_GPE_MFPH_PE13MFP_Pos) /*!< SYS_T::GPE_MFPH: PE13MFP Mask */ - -#define SYS_GPE_MFPH_PE14MFP_Pos (24) /*!< SYS_T::GPE_MFPH: PE14MFP Position */ -#define SYS_GPE_MFPH_PE14MFP_Msk (0xful << SYS_GPE_MFPH_PE14MFP_Pos) /*!< SYS_T::GPE_MFPH: PE14MFP Mask */ - -#define SYS_GPE_MFPH_PE15MFP_Pos (28) /*!< SYS_T::GPE_MFPH: PE15MFP Position */ -#define SYS_GPE_MFPH_PE15MFP_Msk (0xful << SYS_GPE_MFPH_PE15MFP_Pos) /*!< SYS_T::GPE_MFPH: PE15MFP Mask */ - -/* SYS GPF_MFPL Bit Field Definitions */ -#define SYS_GPF_MFPL_PF0MFP_Pos (0) /*!< SYS_T::GPF_MFPL: PF0MFP Position */ -#define SYS_GPF_MFPL_PF0MFP_Msk (0xful << SYS_GPF_MFPL_PF0MFP_Pos) /*!< SYS_T::GPF_MFPL: PF0MFP Mask */ - -#define SYS_GPF_MFPL_PF1MFP_Pos (4) /*!< SYS_T::GPF_MFPL: PF1MFP Position */ -#define SYS_GPF_MFPL_PF1MFP_Msk (0xful << SYS_GPF_MFPL_PF1MFP_Pos) /*!< SYS_T::GPF_MFPL: PF1MFP Mask */ - -#define SYS_GPF_MFPL_PF2MFP_Pos (8) /*!< SYS_T::GPF_MFPL: PF2MFP Position */ -#define SYS_GPF_MFPL_PF2MFP_Msk (0xful << SYS_GPF_MFPL_PF2MFP_Pos) /*!< SYS_T::GPF_MFPL: PF2MFP Mask */ - -#define SYS_GPF_MFPL_PF3MFP_Pos (12) /*!< SYS_T::GPF_MFPL: PF3MFP Position */ -#define SYS_GPF_MFPL_PF3MFP_Msk (0xful << SYS_GPF_MFPL_PF3MFP_Pos) /*!< SYS_T::GPF_MFPL: PF3MFP Mask */ - -#define SYS_GPF_MFPL_PF4MFP_Pos (16) /*!< SYS_T::GPF_MFPL: PF4MFP Position */ -#define SYS_GPF_MFPL_PF4MFP_Msk (0xful << SYS_GPF_MFPL_PF4MFP_Pos) /*!< SYS_T::GPF_MFPL: PF4MFP Mask */ - -#define SYS_GPF_MFPL_PF5MFP_Pos (20) /*!< SYS_T::GPF_MFPL: PF5MFP Position */ -#define SYS_GPF_MFPL_PF5MFP_Msk (0xful << SYS_GPF_MFPL_PF5MFP_Pos) /*!< SYS_T::GPF_MFPL: PF5MFP Mask */ - -#define SYS_GPF_MFPL_PF6MFP_Pos (24) /*!< SYS_T::GPF_MFPL: PF6MFP Position */ -#define SYS_GPF_MFPL_PF6MFP_Msk (0xful << SYS_GPF_MFPL_PF6MFP_Pos) /*!< SYS_T::GPF_MFPL: PF6MFP Mask */ - -#define SYS_GPF_MFPL_PF7MFP_Pos (28) /*!< SYS_T::GPF_MFPL: PF7MFP Position */ -#define SYS_GPF_MFPL_PF7MFP_Msk (0xful << SYS_GPF_MFPL_PF7MFP_Pos) /*!< SYS_T::GPF_MFPL: PF7MFP Mask */ - -/* SYS GPF_MFPH Bit Field Definitions */ -#define SYS_GPF_MFPH_PF8MFP_Pos (0) /*!< SYS_T::GPF_MFPH: PF8MFP Position */ -#define SYS_GPF_MFPH_PF8MFP_Msk (0xful << SYS_GPF_MFPH_PF8MFP_Pos) /*!< SYS_T::GPF_MFPH: PF8MFP Mask */ - -#define SYS_GPF_MFPH_PF9MFP_Pos (4) /*!< SYS_T::GPF_MFPH: PF9MFP Position */ -#define SYS_GPF_MFPH_PF9MFP_Msk (0xful << SYS_GPF_MFPH_PF9MFP_Pos) /*!< SYS_T::GPF_MFPH: PF9MFP Mask */ - -#define SYS_GPF_MFPH_PF10MFP_Pos (8) /*!< SYS_T::GPF_MFPH: PF10MFP Position */ -#define SYS_GPF_MFPH_PF10MFP_Msk (0xful << SYS_GPF_MFPH_PF10MFP_Pos) /*!< SYS_T::GPF_MFPH: PF10MFP Mask */ - -#define SYS_GPF_MFPH_PF11MFP_Pos (12) /*!< SYS_T::GPF_MFPH: PF11MFP Position */ -#define SYS_GPF_MFPH_PF11MFP_Msk (0xful << SYS_GPF_MFPH_PF11MFP_Pos) /*!< SYS_T::GPF_MFPH: PF11MFP Mask */ - -#define SYS_GPF_MFPH_PF12MFP_Pos (16) /*!< SYS_T::GPF_MFPH: PF12MFP Position */ -#define SYS_GPF_MFPH_PF12MFP_Msk (0xful << SYS_GPF_MFPH_PF12MFP_Pos) /*!< SYS_T::GPF_MFPH: PF12MFP Mask */ - -#define SYS_GPF_MFPH_PF13MFP_Pos (20) /*!< SYS_T::GPF_MFPH: PF13MFP Position */ -#define SYS_GPF_MFPH_PF13MFP_Msk (0xful << SYS_GPF_MFPH_PF13MFP_Pos) /*!< SYS_T::GPF_MFPH: PF13MFP Mask */ - -#define SYS_GPF_MFPH_PF14MFP_Pos (24) /*!< SYS_T::GPF_MFPH: PF14MFP Position */ -#define SYS_GPF_MFPH_PF14MFP_Msk (0xful << SYS_GPF_MFPH_PF14MFP_Pos) /*!< SYS_T::GPF_MFPH: PF14MFP Mask */ - -#define SYS_GPF_MFPH_PF15MFP_Pos (28) /*!< SYS_T::GPF_MFPH: PF15MFP Position */ -#define SYS_GPF_MFPH_PF15MFP_Msk (0xful << SYS_GPF_MFPH_PF15MFP_Pos) /*!< SYS_T::GPF_MFPH: PF15MFP Mask */ - -/* SYS GPG_MFPL Bit Field Definitions */ -#define SYS_GPG_MFPL_PG0MFP_Pos (0) /*!< SYS_T::GPG_MFPL: PG0MFP Position */ -#define SYS_GPG_MFPL_PG0MFP_Msk (0xful << SYS_GPG_MFPL_PG0MFP_Pos) /*!< SYS_T::GPG_MFPL: PG0MFP Mask */ - -#define SYS_GPG_MFPL_PG1MFP_Pos (4) /*!< SYS_T::GPG_MFPL: PG1MFP Position */ -#define SYS_GPG_MFPL_PG1MFP_Msk (0xful << SYS_GPG_MFPL_PG1MFP_Pos) /*!< SYS_T::GPG_MFPL: PG1MFP Mask */ - -#define SYS_GPG_MFPL_PG2MFP_Pos (8) /*!< SYS_T::GPG_MFPL: PG2MFP Position */ -#define SYS_GPG_MFPL_PG2MFP_Msk (0xful << SYS_GPG_MFPL_PG2MFP_Pos) /*!< SYS_T::GPG_MFPL: PG2MFP Mask */ - -#define SYS_GPG_MFPL_PG3MFP_Pos (12) /*!< SYS_T::GPG_MFPL: PG3MFP Position */ -#define SYS_GPG_MFPL_PG3MFP_Msk (0xful << SYS_GPG_MFPL_PG3MFP_Pos) /*!< SYS_T::GPG_MFPL: PG3MFP Mask */ - -#define SYS_GPG_MFPL_PG4MFP_Pos (16) /*!< SYS_T::GPG_MFPL: PG4MFP Position */ -#define SYS_GPG_MFPL_PG4MFP_Msk (0xful << SYS_GPG_MFPL_PG4MFP_Pos) /*!< SYS_T::GPG_MFPL: PG4MFP Mask */ - -#define SYS_GPG_MFPL_PG5MFP_Pos (20) /*!< SYS_T::GPG_MFPL: PG5MFP Position */ -#define SYS_GPG_MFPL_PG5MFP_Msk (0xful << SYS_GPG_MFPL_PG5MFP_Pos) /*!< SYS_T::GPG_MFPL: PG5MFP Mask */ - -#define SYS_GPG_MFPL_PG6MFP_Pos (24) /*!< SYS_T::GPG_MFPL: PG6MFP Position */ -#define SYS_GPG_MFPL_PG6MFP_Msk (0xful << SYS_GPG_MFPL_PG6MFP_Pos) /*!< SYS_T::GPG_MFPL: PG6MFP Mask */ - -#define SYS_GPG_MFPL_PG7MFP_Pos (28) /*!< SYS_T::GPG_MFPL: PG7MFP Position */ -#define SYS_GPG_MFPL_PG7MFP_Msk (0xful << SYS_GPG_MFPL_PG7MFP_Pos) /*!< SYS_T::GPG_MFPL: PG7MFP Mask */ - -/* SYS GPG_MFPH Bit Field Definitions */ -#define SYS_GPG_MFPH_PG8MFP_Pos (0) /*!< SYS_T::GPG_MFPH: PG8MFP Position */ -#define SYS_GPG_MFPH_PG8MFP_Msk (0xful << SYS_GPG_MFPH_PG8MFP_Pos) /*!< SYS_T::GPG_MFPH: PG8MFP Mask */ - -#define SYS_GPG_MFPH_PG9MFP_Pos (4) /*!< SYS_T::GPG_MFPH: PG9MFP Position */ -#define SYS_GPG_MFPH_PG9MFP_Msk (0xful << SYS_GPG_MFPH_PG9MFP_Pos) /*!< SYS_T::GPG_MFPH: PG9MFP Mask */ - -#define SYS_GPG_MFPH_PG10MFP_Pos (8) /*!< SYS_T::GPG_MFPH: PG10MFP Position */ -#define SYS_GPG_MFPH_PG10MFP_Msk (0xful << SYS_GPG_MFPH_PG10MFP_Pos) /*!< SYS_T::GPG_MFPH: PG10MFP Mask */ - -#define SYS_GPG_MFPH_PG11MFP_Pos (12) /*!< SYS_T::GPG_MFPH: PG11MFP Position */ -#define SYS_GPG_MFPH_PG11MFP_Msk (0xful << SYS_GPG_MFPH_PG11MFP_Pos) /*!< SYS_T::GPG_MFPH: PG11MFP Mask */ - -#define SYS_GPG_MFPH_PG12MFP_Pos (16) /*!< SYS_T::GPG_MFPH: PG12MFP Position */ -#define SYS_GPG_MFPH_PG12MFP_Msk (0xful << SYS_GPG_MFPH_PG12MFP_Pos) /*!< SYS_T::GPG_MFPH: PG12MFP Mask */ - -#define SYS_GPG_MFPH_PG13MFP_Pos (20) /*!< SYS_T::GPG_MFPH: PG13MFP Position */ -#define SYS_GPG_MFPH_PG13MFP_Msk (0xful << SYS_GPG_MFPH_PG13MFP_Pos) /*!< SYS_T::GPG_MFPH: PG13MFP Mask */ - -#define SYS_GPG_MFPH_PG14MFP_Pos (24) /*!< SYS_T::GPG_MFPH: PG14MFP Position */ -#define SYS_GPG_MFPH_PG14MFP_Msk (0xful << SYS_GPG_MFPH_PG14MFP_Pos) /*!< SYS_T::GPG_MFPH: PG14MFP Mask */ - -#define SYS_GPG_MFPH_PG15MFP_Pos (28) /*!< SYS_T::GPG_MFPH: PG15MFP Position */ -#define SYS_GPG_MFPH_PG15MFP_Msk (0xful << SYS_GPG_MFPH_PG15MFP_Pos) /*!< SYS_T::GPG_MFPH: PG15MFP Mask */ - -/*@}*/ /* end of group NUC980_SYS_EXPORTED_CONSTANTS */ - - -/********************* Bit definition of GPA_MFPL register **********************/ -#define SYS_GPA_MFPL_PA0MFP_GPIO (0x00UL< -#include -#include -#include "nuc980.h" - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - -/** @addtogroup UART_EXPORTED_CONSTANTS UART Exported Constants - @{ -*/ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART FIFO size constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define UART0_FIFO_SIZE 16ul /*!< UART0 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART1_FIFO_SIZE 16ul /*!< UART1 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART2_FIFO_SIZE 16ul /*!< UART2 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART3_FIFO_SIZE 16ul /*!< UART3 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART4_FIFO_SIZE 16ul /*!< UART3 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ -#define UART5_FIFO_SIZE 16ul /*!< UART3 supports separated receive/transmit 16/16 bytes entry FIFO \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_FIFO constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ - -#define UART_FIFO_RFITL_1BYTE (0x0ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 1 byte \hideinitializer */ -#define UART_FIFO_RFITL_4BYTES (0x1ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 4 bytes \hideinitializer */ -#define UART_FIFO_RFITL_8BYTES (0x2ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 8 bytes \hideinitializer */ -#define UART_FIFO_RFITL_14BYTES (0x3ul << UART_FIFO_RFITL_Pos) /*!< UART_FIFO setting to set RX FIFO Trigger Level to 14 bytes \hideinitializer */ - -#define UART_FIFO_RTSTRGLV_1BYTE (0x0ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 1 byte \hideinitializer */ -#define UART_FIFO_RTSTRGLV_4BYTES (0x1ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 4 bytes \hideinitializer */ -#define UART_FIFO_RTSTRGLV_8BYTES (0x2ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 8 bytes \hideinitializer */ -#define UART_FIFO_RTSTRGLV_14BYTES (0x3ul << UART_FIFO_RTSTRGLV_Pos) /*!< UART_FIFO setting to set RTS Trigger Level to 14 bytes \hideinitializer */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_LINE constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_WORD_LEN_5 (0ul) /*!< UART_LINE setting to set UART word length to 5 bits \hideinitializer */ -#define UART_WORD_LEN_6 (1ul) /*!< UART_LINE setting to set UART word length to 6 bits \hideinitializer */ -#define UART_WORD_LEN_7 (2ul) /*!< UART_LINE setting to set UART word length to 7 bits \hideinitializer */ -#define UART_WORD_LEN_8 (3ul) /*!< UART_LINE setting to set UART word length to 8 bits \hideinitializer */ - -#define UART_PARITY_NONE (0x0ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to set UART as no parity \hideinitializer */ -#define UART_PARITY_ODD (0x1ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to set UART as odd parity \hideinitializer */ -#define UART_PARITY_EVEN (0x3ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to set UART as even parity \hideinitializer */ -#define UART_PARITY_MARK (0x5ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to keep parity bit as '1' \hideinitializer */ -#define UART_PARITY_SPACE (0x7ul << UART_LINE_PBE_Pos) /*!< UART_LINE setting to keep parity bit as '0' \hideinitializer */ - -#define UART_STOP_BIT_1 (0x0ul << UART_LINE_NSB_Pos) /*!< UART_LINE setting for one stop bit \hideinitializer */ -#define UART_STOP_BIT_1_5 (0x1ul << UART_LINE_NSB_Pos) /*!< UART_LINE setting for 1.5 stop bit when 5-bit word length \hideinitializer */ -#define UART_STOP_BIT_2 (0x1ul << UART_LINE_NSB_Pos) /*!< UART_LINE setting for two stop bit when 6, 7, 8-bit word length \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART RTS ACTIVE LEVEL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_RTS_IS_LOW_LEV_ACTIVE (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< Set RTS is Low Level Active \hideinitializer */ -#define UART_RTS_IS_HIGH_LEV_ACTIVE (0x0ul << UART_MODEM_RTSACTLV_Pos) /*!< Set RTS is High Level Active \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_IRDA constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_IRDA_TXEN (0x1ul << UART_IRDA_TXEN_Pos) /*!< Set IrDA function Tx mode \hideinitializer */ -#define UART_IRDA_RXEN (0x0ul << UART_IRDA_TXEN_Pos) /*!< Set IrDA function Rx mode \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_FUNCSEL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_FUNCSEL_UART (0x0ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set UART Function (Default) \hideinitializer */ -#define UART_FUNCSEL_LIN (0x1ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set LIN Function \hideinitializer */ -#define UART_FUNCSEL_IrDA (0x2ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set IrDA Function \hideinitializer */ -#define UART_FUNCSEL_RS485 (0x3ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_FUNCSEL setting to set RS485 Function \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART_LINCTL constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_LINCTL_BRKFL(x) (((x)-1) << UART_LINCTL_BRKFL_Pos) /*!< UART_LINCTL setting to set LIN Break Field Length, x = 10 ~ 15, default value is 12 \hideinitializer */ -#define UART_LINCTL_BSL(x) (((x)-1) << UART_LINCTL_BSL_Pos) /*!< UART_LINCTL setting to set LIN Break/Sync Delimiter Length, x = 1 ~ 4 \hideinitializer */ -#define UART_LINCTL_HSEL_BREAK (0x0UL << UART_LINCTL_HSEL_Pos) /*!< UART_LINCTL setting to set LIN Header Select to break field \hideinitializer */ -#define UART_LINCTL_HSEL_BREAK_SYNC (0x1UL << UART_LINCTL_HSEL_Pos) /*!< UART_LINCTL setting to set LIN Header Select to break field and sync field \hideinitializer */ -#define UART_LINCTL_HSEL_BREAK_SYNC_ID (0x2UL << UART_LINCTL_HSEL_Pos) /*!< UART_LINCTL setting to set LIN Header Select to break field, sync field and ID field \hideinitializer */ -#define UART_LINCTL_PID(x) ((x) << UART_LINCTL_PID_Pos) /*!< UART_LINCTL setting to set LIN PID value \hideinitializer */ - - -/*---------------------------------------------------------------------------------------------------------*/ -/* UART BAUDRATE MODE constants definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define UART_BAUD_MODE0 (0ul) /*!< Set UART Baudrate Mode is Mode0 \hideinitializer */ -#define UART_BAUD_MODE2 (UART_BAUD_BAUDM1_Msk | UART_BAUD_BAUDM0_Msk) /*!< Set UART Baudrate Mode is Mode2 \hideinitializer */ - - -/*@}*/ /* end of group UART_EXPORTED_CONSTANTS */ - -typedef struct -{ - __IO uint32_t DAT; /*!< [0x0000] UART Receive/Transmit Buffer Register */ - __IO uint32_t INTEN; /*!< [0x0004] UART Interrupt Enable Register */ - __IO uint32_t FIFO; /*!< [0x0008] UART FIFO Control Register */ - __IO uint32_t LINE; /*!< [0x000c] UART Line Control Register */ - __IO uint32_t MODEM; /*!< [0x0010] UART Modem Control Register */ - __IO uint32_t MODEMSTS; /*!< [0x0014] UART Modem Status Register */ - __IO uint32_t FIFOSTS; /*!< [0x0018] UART FIFO Status Register */ - __IO uint32_t INTSTS; /*!< [0x001c] UART Interrupt Status Register */ - __IO uint32_t TOUT; /*!< [0x0020] UART Time-out Register */ - __IO uint32_t BAUD; /*!< [0x0024] UART Baud Rate Divider Register */ - __IO uint32_t IRDA; /*!< [0x0028] UART IrDA Control Register */ - __IO uint32_t ALTCTL; /*!< [0x002c] UART Alternate Control/Status Register */ - __IO uint32_t FUNCSEL; /*!< [0x0030] UART Function Select Register */ - __IO uint32_t LINCTL; /*!< [0x0034] UART LIN Control Register */ - __IO uint32_t LINSTS; /*!< [0x0038] UART LIN Status Register */ - __IO uint32_t BRCOMP; /*!< [0x003c] UART Baud Rate Compensation Register */ - __IO uint32_t WKCTL; /*!< [0x0040] UART Wake-up Control Register */ - __IO uint32_t WKSTS; /*!< [0x0044] UART Wake-up Status Register */ - __IO uint32_t DWKCOMP; /*!< [0x0048] UART Incoming Data Wake-up Compensation Register */ - -} UART_T; - -#define UART_DAT_DAT_Pos (0) /*!< UART_T::DAT: DAT Position */ -#define UART_DAT_DAT_Msk (0xfful << UART_DAT_DAT_Pos) /*!< UART_T::DAT: DAT Mask */ - -#define UART_DAT_PARITY_Pos (8) /*!< UART_T::DAT: PARITY Position */ -#define UART_DAT_PARITY_Msk (0x1ul << UART_DAT_PARITY_Pos) /*!< UART_T::DAT: PARITY Mask */ - -#define UART_INTEN_RDAIEN_Pos (0) /*!< UART_T::INTEN: RDAIEN Position */ -#define UART_INTEN_RDAIEN_Msk (0x1ul << UART_INTEN_RDAIEN_Pos) /*!< UART_T::INTEN: RDAIEN Mask */ - -#define UART_INTEN_THREIEN_Pos (1) /*!< UART_T::INTEN: THREIEN Position */ -#define UART_INTEN_THREIEN_Msk (0x1ul << UART_INTEN_THREIEN_Pos) /*!< UART_T::INTEN: THREIEN Mask */ - -#define UART_INTEN_RLSIEN_Pos (2) /*!< UART_T::INTEN: RLSIEN Position */ -#define UART_INTEN_RLSIEN_Msk (0x1ul << UART_INTEN_RLSIEN_Pos) /*!< UART_T::INTEN: RLSIEN Mask */ - -#define UART_INTEN_MODEMIEN_Pos (3) /*!< UART_T::INTEN: MODEMIEN Position */ -#define UART_INTEN_MODEMIEN_Msk (0x1ul << UART_INTEN_MODEMIEN_Pos) /*!< UART_T::INTEN: MODEMIEN Mask */ - -#define UART_INTEN_RXTOIEN_Pos (4) /*!< UART_T::INTEN: RXTOIEN Position */ -#define UART_INTEN_RXTOIEN_Msk (0x1ul << UART_INTEN_RXTOIEN_Pos) /*!< UART_T::INTEN: RXTOIEN Mask */ - -#define UART_INTEN_BUFERRIEN_Pos (5) /*!< UART_T::INTEN: BUFERRIEN Position */ -#define UART_INTEN_BUFERRIEN_Msk (0x1ul << UART_INTEN_BUFERRIEN_Pos) /*!< UART_T::INTEN: BUFERRIEN Mask */ - -#define UART_INTEN_WKIEN_Pos (6) /*!< UART_T::INTEN: WKIEN Position */ -#define UART_INTEN_WKIEN_Msk (0x1ul << UART_INTEN_WKIEN_Pos) /*!< UART_T::INTEN: WKIEN Mask */ - -#define UART_INTEN_LINIEN_Pos (8) /*!< UART_T::INTEN: LINIEN Position */ -#define UART_INTEN_LINIEN_Msk (0x1ul << UART_INTEN_LINIEN_Pos) /*!< UART_T::INTEN: LINIEN Mask */ - -#define UART_INTEN_TOCNTEN_Pos (11) /*!< UART_T::INTEN: TOCNTEN Position */ -#define UART_INTEN_TOCNTEN_Msk (0x1ul << UART_INTEN_TOCNTEN_Pos) /*!< UART_T::INTEN: TOCNTEN Mask */ - -#define UART_INTEN_ATORTSEN_Pos (12) /*!< UART_T::INTEN: ATORTSEN Position */ -#define UART_INTEN_ATORTSEN_Msk (0x1ul << UART_INTEN_ATORTSEN_Pos) /*!< UART_T::INTEN: ATORTSEN Mask */ - -#define UART_INTEN_ATOCTSEN_Pos (13) /*!< UART_T::INTEN: ATOCTSEN Position */ -#define UART_INTEN_ATOCTSEN_Msk (0x1ul << UART_INTEN_ATOCTSEN_Pos) /*!< UART_T::INTEN: ATOCTSEN Mask */ - -#define UART_INTEN_TXPDMAEN_Pos (14) /*!< UART_T::INTEN: TXPDMAEN Position */ -#define UART_INTEN_TXPDMAEN_Msk (0x1ul << UART_INTEN_TXPDMAEN_Pos) /*!< UART_T::INTEN: TXPDMAEN Mask */ - -#define UART_INTEN_RXPDMAEN_Pos (15) /*!< UART_T::INTEN: RXPDMAEN Position */ -#define UART_INTEN_RXPDMAEN_Msk (0x1ul << UART_INTEN_RXPDMAEN_Pos) /*!< UART_T::INTEN: RXPDMAEN Mask */ - -#define UART_INTEN_ABRIEN_Pos (18) /*!< UART_T::INTEN: ABRIEN Position */ -#define UART_INTEN_ABRIEN_Msk (0x1ul << UART_INTEN_ABRIEN_Pos) /*!< UART_T::INTEN: ABRIEN Mask */ - -#define UART_INTEN_TXENDIEN_Pos (22) /*!< UART_T::INTEN: TXENDIEN Position */ -#define UART_INTEN_TXENDIEN_Msk (0x1ul << UART_INTEN_TXENDIEN_Pos) /*!< UART_T::INTEN: TXENDIEN Mask */ - -#define UART_FIFO_RXRST_Pos (1) /*!< UART_T::FIFO: RXRST Position */ -#define UART_FIFO_RXRST_Msk (0x1ul << UART_FIFO_RXRST_Pos) /*!< UART_T::FIFO: RXRST Mask */ - -#define UART_FIFO_TXRST_Pos (2) /*!< UART_T::FIFO: TXRST Position */ -#define UART_FIFO_TXRST_Msk (0x1ul << UART_FIFO_TXRST_Pos) /*!< UART_T::FIFO: TXRST Mask */ - -#define UART_FIFO_RFITL_Pos (4) /*!< UART_T::FIFO: RFITL Position */ -#define UART_FIFO_RFITL_Msk (0xful << UART_FIFO_RFITL_Pos) /*!< UART_T::FIFO: RFITL Mask */ - -#define UART_FIFO_RXOFF_Pos (8) /*!< UART_T::FIFO: RXOFF Position */ -#define UART_FIFO_RXOFF_Msk (0x1ul << UART_FIFO_RXOFF_Pos) /*!< UART_T::FIFO: RXOFF Mask */ - -#define UART_FIFO_RTSTRGLV_Pos (16) /*!< UART_T::FIFO: RTSTRGLV Position */ -#define UART_FIFO_RTSTRGLV_Msk (0xful << UART_FIFO_RTSTRGLV_Pos) /*!< UART_T::FIFO: RTSTRGLV Mask */ - -#define UART_LINE_WLS_Pos (0) /*!< UART_T::LINE: WLS Position */ -#define UART_LINE_WLS_Msk (0x3ul << UART_LINE_WLS_Pos) /*!< UART_T::LINE: WLS Mask */ - -#define UART_LINE_NSB_Pos (2) /*!< UART_T::LINE: NSB Position */ -#define UART_LINE_NSB_Msk (0x1ul << UART_LINE_NSB_Pos) /*!< UART_T::LINE: NSB Mask */ - -#define UART_LINE_PBE_Pos (3) /*!< UART_T::LINE: PBE Position */ -#define UART_LINE_PBE_Msk (0x1ul << UART_LINE_PBE_Pos) /*!< UART_T::LINE: PBE Mask */ - -#define UART_LINE_EPE_Pos (4) /*!< UART_T::LINE: EPE Position */ -#define UART_LINE_EPE_Msk (0x1ul << UART_LINE_EPE_Pos) /*!< UART_T::LINE: EPE Mask */ - -#define UART_LINE_SPE_Pos (5) /*!< UART_T::LINE: SPE Position */ -#define UART_LINE_SPE_Msk (0x1ul << UART_LINE_SPE_Pos) /*!< UART_T::LINE: SPE Mask */ - -#define UART_LINE_BCB_Pos (6) /*!< UART_T::LINE: BCB Position */ -#define UART_LINE_BCB_Msk (0x1ul << UART_LINE_BCB_Pos) /*!< UART_T::LINE: BCB Mask */ - -#define UART_LINE_PSS_Pos (7) /*!< UART_T::LINE: PSS Position */ -#define UART_LINE_PSS_Msk (0x1ul << UART_LINE_PSS_Pos) /*!< UART_T::LINE: PSS Mask */ - -#define UART_LINE_TXDINV_Pos (8) /*!< UART_T::LINE: TXDINV Position */ -#define UART_LINE_TXDINV_Msk (0x1ul << UART_LINE_TXDINV_Pos) /*!< UART_T::LINE: TXDINV Mask */ - -#define UART_LINE_RXDINV_Pos (9) /*!< UART_T::LINE: RXDINV Position */ -#define UART_LINE_RXDINV_Msk (0x1ul << UART_LINE_RXDINV_Pos) /*!< UART_T::LINE: RXDINV Mask */ - -#define UART_MODEM_RTS_Pos (1) /*!< UART_T::MODEM: RTS Position */ -#define UART_MODEM_RTS_Msk (0x1ul << UART_MODEM_RTS_Pos) /*!< UART_T::MODEM: RTS Mask */ - -#define UART_MODEM_RTSACTLV_Pos (9) /*!< UART_T::MODEM: RTSACTLV Position */ -#define UART_MODEM_RTSACTLV_Msk (0x1ul << UART_MODEM_RTSACTLV_Pos) /*!< UART_T::MODEM: RTSACTLV Mask */ - -#define UART_MODEM_RTSSTS_Pos (13) /*!< UART_T::MODEM: RTSSTS Position */ -#define UART_MODEM_RTSSTS_Msk (0x1ul << UART_MODEM_RTSSTS_Pos) /*!< UART_T::MODEM: RTSSTS Mask */ - -#define UART_MODEMSTS_CTSDETF_Pos (0) /*!< UART_T::MODEMSTS: CTSDETF Position */ -#define UART_MODEMSTS_CTSDETF_Msk (0x1ul << UART_MODEMSTS_CTSDETF_Pos) /*!< UART_T::MODEMSTS: CTSDETF Mask */ - -#define UART_MODEMSTS_CTSSTS_Pos (4) /*!< UART_T::MODEMSTS: CTSSTS Position */ -#define UART_MODEMSTS_CTSSTS_Msk (0x1ul << UART_MODEMSTS_CTSSTS_Pos) /*!< UART_T::MODEMSTS: CTSSTS Mask */ - -#define UART_MODEMSTS_CTSACTLV_Pos (8) /*!< UART_T::MODEMSTS: CTSACTLV Position */ -#define UART_MODEMSTS_CTSACTLV_Msk (0x1ul << UART_MODEMSTS_CTSACTLV_Pos) /*!< UART_T::MODEMSTS: CTSACTLV Mask */ - -#define UART_FIFOSTS_RXOVIF_Pos (0) /*!< UART_T::FIFOSTS: RXOVIF Position */ -#define UART_FIFOSTS_RXOVIF_Msk (0x1ul << UART_FIFOSTS_RXOVIF_Pos) /*!< UART_T::FIFOSTS: RXOVIF Mask */ - -#define UART_FIFOSTS_ABRDIF_Pos (1) /*!< UART_T::FIFOSTS: ABRDIF Position */ -#define UART_FIFOSTS_ABRDIF_Msk (0x1ul << UART_FIFOSTS_ABRDIF_Pos) /*!< UART_T::FIFOSTS: ABRDIF Mask */ - -#define UART_FIFOSTS_ABRDTOIF_Pos (2) /*!< UART_T::FIFOSTS: ABRDTOIF Position */ -#define UART_FIFOSTS_ABRDTOIF_Msk (0x1ul << UART_FIFOSTS_ABRDTOIF_Pos) /*!< UART_T::FIFOSTS: ABRDTOIF Mask */ - -#define UART_FIFOSTS_ADDRDETF_Pos (3) /*!< UART_T::FIFOSTS: ADDRDETF Position */ -#define UART_FIFOSTS_ADDRDETF_Msk (0x1ul << UART_FIFOSTS_ADDRDETF_Pos) /*!< UART_T::FIFOSTS: ADDRDETF Mask */ - -#define UART_FIFOSTS_PEF_Pos (4) /*!< UART_T::FIFOSTS: PEF Position */ -#define UART_FIFOSTS_PEF_Msk (0x1ul << UART_FIFOSTS_PEF_Pos) /*!< UART_T::FIFOSTS: PEF Mask */ - -#define UART_FIFOSTS_FEF_Pos (5) /*!< UART_T::FIFOSTS: FEF Position */ -#define UART_FIFOSTS_FEF_Msk (0x1ul << UART_FIFOSTS_FEF_Pos) /*!< UART_T::FIFOSTS: FEF Mask */ - -#define UART_FIFOSTS_BIF_Pos (6) /*!< UART_T::FIFOSTS: BIF Position */ -#define UART_FIFOSTS_BIF_Msk (0x1ul << UART_FIFOSTS_BIF_Pos) /*!< UART_T::FIFOSTS: BIF Mask */ - -#define UART_FIFOSTS_RXPTR_Pos (8) /*!< UART_T::FIFOSTS: RXPTR Position */ -#define UART_FIFOSTS_RXPTR_Msk (0x3ful << UART_FIFOSTS_RXPTR_Pos) /*!< UART_T::FIFOSTS: RXPTR Mask */ - -#define UART_FIFOSTS_RXEMPTY_Pos (14) /*!< UART_T::FIFOSTS: RXEMPTY Position */ -#define UART_FIFOSTS_RXEMPTY_Msk (0x1ul << UART_FIFOSTS_RXEMPTY_Pos) /*!< UART_T::FIFOSTS: RXEMPTY Mask */ - -#define UART_FIFOSTS_RXFULL_Pos (15) /*!< UART_T::FIFOSTS: RXFULL Position */ -#define UART_FIFOSTS_RXFULL_Msk (0x1ul << UART_FIFOSTS_RXFULL_Pos) /*!< UART_T::FIFOSTS: RXFULL Mask */ - -#define UART_FIFOSTS_TXPTR_Pos (16) /*!< UART_T::FIFOSTS: TXPTR Position */ -#define UART_FIFOSTS_TXPTR_Msk (0x3ful << UART_FIFOSTS_TXPTR_Pos) /*!< UART_T::FIFOSTS: TXPTR Mask */ - -#define UART_FIFOSTS_TXEMPTY_Pos (22) /*!< UART_T::FIFOSTS: TXEMPTY Position */ -#define UART_FIFOSTS_TXEMPTY_Msk (0x1ul << UART_FIFOSTS_TXEMPTY_Pos) /*!< UART_T::FIFOSTS: TXEMPTY Mask */ - -#define UART_FIFOSTS_TXFULL_Pos (23) /*!< UART_T::FIFOSTS: TXFULL Position */ -#define UART_FIFOSTS_TXFULL_Msk (0x1ul << UART_FIFOSTS_TXFULL_Pos) /*!< UART_T::FIFOSTS: TXFULL Mask */ - -#define UART_FIFOSTS_TXOVIF_Pos (24) /*!< UART_T::FIFOSTS: TXOVIF Position */ -#define UART_FIFOSTS_TXOVIF_Msk (0x1ul << UART_FIFOSTS_TXOVIF_Pos) /*!< UART_T::FIFOSTS: TXOVIF Mask */ - -#define UART_FIFOSTS_TXEMPTYF_Pos (28) /*!< UART_T::FIFOSTS: TXEMPTYF Position */ -#define UART_FIFOSTS_TXEMPTYF_Msk (0x1ul << UART_FIFOSTS_TXEMPTYF_Pos) /*!< UART_T::FIFOSTS: TXEMPTYF Mask */ - -#define UART_FIFOSTS_RXIDLE_Pos (29) /*!< UART_T::FIFOSTS: RXIDLE Position */ -#define UART_FIFOSTS_RXIDLE_Msk (0x1ul << UART_FIFOSTS_RXIDLE_Pos) /*!< UART_T::FIFOSTS: RXIDLE Mask */ - -#define UART_FIFOSTS_TXRXACT_Pos (31) /*!< UART_T::FIFOSTS: TXRXACT Position */ -#define UART_FIFOSTS_TXRXACT_Msk (0x1ul << UART_FIFOSTS_TXRXACT_Pos) /*!< UART_T::FIFOSTS: TXRXACT Mask */ - -#define UART_INTSTS_RDAIF_Pos (0) /*!< UART_T::INTSTS: RDAIF Position */ -#define UART_INTSTS_RDAIF_Msk (0x1ul << UART_INTSTS_RDAIF_Pos) /*!< UART_T::INTSTS: RDAIF Mask */ - -#define UART_INTSTS_THREIF_Pos (1) /*!< UART_T::INTSTS: THREIF Position */ -#define UART_INTSTS_THREIF_Msk (0x1ul << UART_INTSTS_THREIF_Pos) /*!< UART_T::INTSTS: THREIF Mask */ - -#define UART_INTSTS_RLSIF_Pos (2) /*!< UART_T::INTSTS: RLSIF Position */ -#define UART_INTSTS_RLSIF_Msk (0x1ul << UART_INTSTS_RLSIF_Pos) /*!< UART_T::INTSTS: RLSIF Mask */ - -#define UART_INTSTS_MODEMIF_Pos (3) /*!< UART_T::INTSTS: MODEMIF Position */ -#define UART_INTSTS_MODEMIF_Msk (0x1ul << UART_INTSTS_MODEMIF_Pos) /*!< UART_T::INTSTS: MODEMIF Mask */ - -#define UART_INTSTS_RXTOIF_Pos (4) /*!< UART_T::INTSTS: RXTOIF Position */ -#define UART_INTSTS_RXTOIF_Msk (0x1ul << UART_INTSTS_RXTOIF_Pos) /*!< UART_T::INTSTS: RXTOIF Mask */ - -#define UART_INTSTS_BUFERRIF_Pos (5) /*!< UART_T::INTSTS: BUFERRIF Position */ -#define UART_INTSTS_BUFERRIF_Msk (0x1ul << UART_INTSTS_BUFERRIF_Pos) /*!< UART_T::INTSTS: BUFERRIF Mask */ - -#define UART_INTSTS_WKIF_Pos (6) /*!< UART_T::INTSTS: WKIF Position */ -#define UART_INTSTS_WKIF_Msk (0x1ul << UART_INTSTS_WKIF_Pos) /*!< UART_T::INTSTS: WKIF Mask */ - -#define UART_INTSTS_LINIF_Pos (7) /*!< UART_T::INTSTS: LINIF Position */ -#define UART_INTSTS_LINIF_Msk (0x1ul << UART_INTSTS_LINIF_Pos) /*!< UART_T::INTSTS: LINIF Mask */ - -#define UART_INTSTS_RDAINT_Pos (8) /*!< UART_T::INTSTS: RDAINT Position */ -#define UART_INTSTS_RDAINT_Msk (0x1ul << UART_INTSTS_RDAINT_Pos) /*!< UART_T::INTSTS: RDAINT Mask */ - -#define UART_INTSTS_THREINT_Pos (9) /*!< UART_T::INTSTS: THREINT Position */ -#define UART_INTSTS_THREINT_Msk (0x1ul << UART_INTSTS_THREINT_Pos) /*!< UART_T::INTSTS: THREINT Mask */ - -#define UART_INTSTS_RLSINT_Pos (10) /*!< UART_T::INTSTS: RLSINT Position */ -#define UART_INTSTS_RLSINT_Msk (0x1ul << UART_INTSTS_RLSINT_Pos) /*!< UART_T::INTSTS: RLSINT Mask */ - -#define UART_INTSTS_MODEMINT_Pos (11) /*!< UART_T::INTSTS: MODEMINT Position */ -#define UART_INTSTS_MODEMINT_Msk (0x1ul << UART_INTSTS_MODEMINT_Pos) /*!< UART_T::INTSTS: MODEMINT Mask */ - -#define UART_INTSTS_RXTOINT_Pos (12) /*!< UART_T::INTSTS: RXTOINT Position */ -#define UART_INTSTS_RXTOINT_Msk (0x1ul << UART_INTSTS_RXTOINT_Pos) /*!< UART_T::INTSTS: RXTOINT Mask */ - -#define UART_INTSTS_BUFERRINT_Pos (13) /*!< UART_T::INTSTS: BUFERRINT Position */ -#define UART_INTSTS_BUFERRINT_Msk (0x1ul << UART_INTSTS_BUFERRINT_Pos) /*!< UART_T::INTSTS: BUFERRINT Mask */ - -#define UART_INTSTS_WKINT_Pos (14) /*!< UART_T::INTSTS: WKINT Position */ -#define UART_INTSTS_WKINT_Msk (0x1ul << UART_INTSTS_WKINT_Pos) /*!< UART_T::INTSTS: WKINT Mask */ - -#define UART_INTSTS_LININT_Pos (15) /*!< UART_T::INTSTS: LININT Position */ -#define UART_INTSTS_LININT_Msk (0x1ul << UART_INTSTS_LININT_Pos) /*!< UART_T::INTSTS: LININT Mask */ - -#define UART_INTSTS_HWRLSIF_Pos (18) /*!< UART_T::INTSTS: HWRLSIF Position */ -#define UART_INTSTS_HWRLSIF_Msk (0x1ul << UART_INTSTS_HWRLSIF_Pos) /*!< UART_T::INTSTS: HWRLSIF Mask */ - -#define UART_INTSTS_HWMODIF_Pos (19) /*!< UART_T::INTSTS: HWMODIF Position */ -#define UART_INTSTS_HWMODIF_Msk (0x1ul << UART_INTSTS_HWMODIF_Pos) /*!< UART_T::INTSTS: HWMODIF Mask */ - -#define UART_INTSTS_HWTOIF_Pos (20) /*!< UART_T::INTSTS: HWTOIF Position */ -#define UART_INTSTS_HWTOIF_Msk (0x1ul << UART_INTSTS_HWTOIF_Pos) /*!< UART_T::INTSTS: HWTOIF Mask */ - -#define UART_INTSTS_HWBUFEIF_Pos (21) /*!< UART_T::INTSTS: HWBUFEIF Position */ -#define UART_INTSTS_HWBUFEIF_Msk (0x1ul << UART_INTSTS_HWBUFEIF_Pos) /*!< UART_T::INTSTS: HWBUFEIF Mask */ - -#define UART_INTSTS_TXENDIF_Pos (22) /*!< UART_T::INTSTS: TXENDIF Position */ -#define UART_INTSTS_TXENDIF_Msk (0x1ul << UART_INTSTS_TXENDIF_Pos) /*!< UART_T::INTSTS: TXENDIF Mask */ - -#define UART_INTSTS_HWRLSINT_Pos (26) /*!< UART_T::INTSTS: HWRLSINT Position */ -#define UART_INTSTS_HWRLSINT_Msk (0x1ul << UART_INTSTS_HWRLSINT_Pos) /*!< UART_T::INTSTS: HWRLSINT Mask */ - -#define UART_INTSTS_HWMODINT_Pos (27) /*!< UART_T::INTSTS: HWMODINT Position */ -#define UART_INTSTS_HWMODINT_Msk (0x1ul << UART_INTSTS_HWMODINT_Pos) /*!< UART_T::INTSTS: HWMODINT Mask */ - -#define UART_INTSTS_HWTOINT_Pos (28) /*!< UART_T::INTSTS: HWTOINT Position */ -#define UART_INTSTS_HWTOINT_Msk (0x1ul << UART_INTSTS_HWTOINT_Pos) /*!< UART_T::INTSTS: HWTOINT Mask */ - -#define UART_INTSTS_HWBUFEINT_Pos (29) /*!< UART_T::INTSTS: HWBUFEINT Position */ -#define UART_INTSTS_HWBUFEINT_Msk (0x1ul << UART_INTSTS_HWBUFEINT_Pos) /*!< UART_T::INTSTS: HWBUFEINT Mask */ - -#define UART_INTSTS_TXENDINT_Pos (30) /*!< UART_T::INTSTS: TXENDINT Position */ -#define UART_INTSTS_TXENDINT_Msk (0x1ul << UART_INTSTS_TXENDINT_Pos) /*!< UART_T::INTSTS: TXENDINT Mask */ - -#define UART_INTSTS_ABRINT_Pos (31) /*!< UART_T::INTSTS: ABRINT Position */ -#define UART_INTSTS_ABRINT_Msk (0x1ul << UART_INTSTS_ABRINT_Pos) /*!< UART_T::INTSTS: ABRINT Mask */ - -#define UART_TOUT_TOIC_Pos (0) /*!< UART_T::TOUT: TOIC Position */ -#define UART_TOUT_TOIC_Msk (0xfful << UART_TOUT_TOIC_Pos) /*!< UART_T::TOUT: TOIC Mask */ - -#define UART_TOUT_DLY_Pos (8) /*!< UART_T::TOUT: DLY Position */ -#define UART_TOUT_DLY_Msk (0xfful << UART_TOUT_DLY_Pos) /*!< UART_T::TOUT: DLY Mask */ - -#define UART_BAUD_BRD_Pos (0) /*!< UART_T::BAUD: BRD Position */ -#define UART_BAUD_BRD_Msk (0xfffful << UART_BAUD_BRD_Pos) /*!< UART_T::BAUD: BRD Mask */ - -#define UART_BAUD_EDIVM1_Pos (24) /*!< UART_T::BAUD: EDIVM1 Position */ -#define UART_BAUD_EDIVM1_Msk (0xful << UART_BAUD_EDIVM1_Pos) /*!< UART_T::BAUD: EDIVM1 Mask */ - -#define UART_BAUD_BAUDM0_Pos (28) /*!< UART_T::BAUD: BAUDM0 Position */ -#define UART_BAUD_BAUDM0_Msk (0x1ul << UART_BAUD_BAUDM0_Pos) /*!< UART_T::BAUD: BAUDM0 Mask */ - -#define UART_BAUD_BAUDM1_Pos (29) /*!< UART_T::BAUD: BAUDM1 Position */ -#define UART_BAUD_BAUDM1_Msk (0x1ul << UART_BAUD_BAUDM1_Pos) /*!< UART_T::BAUD: BAUDM1 Mask */ - -#define UART_IRDA_TXEN_Pos (1) /*!< UART_T::IRDA: TXEN Position */ -#define UART_IRDA_TXEN_Msk (0x1ul << UART_IRDA_TXEN_Pos) /*!< UART_T::IRDA: TXEN Mask */ - -#define UART_IRDA_TXINV_Pos (5) /*!< UART_T::IRDA: TXINV Position */ -#define UART_IRDA_TXINV_Msk (0x1ul << UART_IRDA_TXINV_Pos) /*!< UART_T::IRDA: TXINV Mask */ - -#define UART_IRDA_RXINV_Pos (6) /*!< UART_T::IRDA: RXINV Position */ -#define UART_IRDA_RXINV_Msk (0x1ul << UART_IRDA_RXINV_Pos) /*!< UART_T::IRDA: RXINV Mask */ - -#define UART_ALTCTL_BRKFL_Pos (0) /*!< UART_T::ALTCTL: BRKFL Position */ -#define UART_ALTCTL_BRKFL_Msk (0xful << UART_ALTCTL_BRKFL_Pos) /*!< UART_T::ALTCTL: BRKFL Mask */ - -#define UART_ALTCTL_LINRXEN_Pos (6) /*!< UART_T::ALTCTL: LINRXEN Position */ -#define UART_ALTCTL_LINRXEN_Msk (0x1ul << UART_ALTCTL_LINRXEN_Pos) /*!< UART_T::ALTCTL: LINRXEN Mask */ - -#define UART_ALTCTL_LINTXEN_Pos (7) /*!< UART_T::ALTCTL: LINTXEN Position */ -#define UART_ALTCTL_LINTXEN_Msk (0x1ul << UART_ALTCTL_LINTXEN_Pos) /*!< UART_T::ALTCTL: LINTXEN Mask */ - -#define UART_ALTCTL_RS485NMM_Pos (8) /*!< UART_T::ALTCTL: RS485NMM Position */ -#define UART_ALTCTL_RS485NMM_Msk (0x1ul << UART_ALTCTL_RS485NMM_Pos) /*!< UART_T::ALTCTL: RS485NMM Mask */ - -#define UART_ALTCTL_RS485AAD_Pos (9) /*!< UART_T::ALTCTL: RS485AAD Position */ -#define UART_ALTCTL_RS485AAD_Msk (0x1ul << UART_ALTCTL_RS485AAD_Pos) /*!< UART_T::ALTCTL: RS485AAD Mask */ - -#define UART_ALTCTL_RS485AUD_Pos (10) /*!< UART_T::ALTCTL: RS485AUD Position */ -#define UART_ALTCTL_RS485AUD_Msk (0x1ul << UART_ALTCTL_RS485AUD_Pos) /*!< UART_T::ALTCTL: RS485AUD Mask */ - -#define UART_ALTCTL_ADDRDEN_Pos (15) /*!< UART_T::ALTCTL: ADDRDEN Position */ -#define UART_ALTCTL_ADDRDEN_Msk (0x1ul << UART_ALTCTL_ADDRDEN_Pos) /*!< UART_T::ALTCTL: ADDRDEN Mask */ - -#define UART_ALTCTL_ABRIF_Pos (17) /*!< UART_T::ALTCTL: ABRIF Position */ -#define UART_ALTCTL_ABRIF_Msk (0x1ul << UART_ALTCTL_ABRIF_Pos) /*!< UART_T::ALTCTL: ABRIF Mask */ - -#define UART_ALTCTL_ABRDEN_Pos (18) /*!< UART_T::ALTCTL: ABRDEN Position */ -#define UART_ALTCTL_ABRDEN_Msk (0x1ul << UART_ALTCTL_ABRDEN_Pos) /*!< UART_T::ALTCTL: ABRDEN Mask */ - -#define UART_ALTCTL_ABRDBITS_Pos (19) /*!< UART_T::ALTCTL: ABRDBITS Position */ -#define UART_ALTCTL_ABRDBITS_Msk (0x3ul << UART_ALTCTL_ABRDBITS_Pos) /*!< UART_T::ALTCTL: ABRDBITS Mask */ - -#define UART_ALTCTL_ADDRMV_Pos (24) /*!< UART_T::ALTCTL: ADDRMV Position */ -#define UART_ALTCTL_ADDRMV_Msk (0xfful << UART_ALTCTL_ADDRMV_Pos) /*!< UART_T::ALTCTL: ADDRMV Mask */ - -#define UART_FUNCSEL_FUNCSEL_Pos (0) /*!< UART_T::FUNCSEL: FUNCSEL Position */ -#define UART_FUNCSEL_FUNCSEL_Msk (0x3ul << UART_FUNCSEL_FUNCSEL_Pos) /*!< UART_T::FUNCSEL: FUNCSEL Mask */ - -#define UART_FUNCSEL_TXRXDIS_Pos (3) /*!< UART_T::FUNCSEL: TXRXDIS Position */ -#define UART_FUNCSEL_TXRXDIS_Msk (0x1ul << UART_FUNCSEL_TXRXDIS_Pos) /*!< UART_T::FUNCSEL: TXRXDIS Mask */ - -#define UART_LINCTL_SLVEN_Pos (0) /*!< UART_T::LINCTL: SLVEN Position */ -#define UART_LINCTL_SLVEN_Msk (0x1ul << UART_LINCTL_SLVEN_Pos) /*!< UART_T::LINCTL: SLVEN Mask */ - -#define UART_LINCTL_SLVHDEN_Pos (1) /*!< UART_T::LINCTL: SLVHDEN Position */ -#define UART_LINCTL_SLVHDEN_Msk (0x1ul << UART_LINCTL_SLVHDEN_Pos) /*!< UART_T::LINCTL: SLVHDEN Mask */ - -#define UART_LINCTL_SLVAREN_Pos (2) /*!< UART_T::LINCTL: SLVAREN Position */ -#define UART_LINCTL_SLVAREN_Msk (0x1ul << UART_LINCTL_SLVAREN_Pos) /*!< UART_T::LINCTL: SLVAREN Mask */ - -#define UART_LINCTL_SLVDUEN_Pos (3) /*!< UART_T::LINCTL: SLVDUEN Position */ -#define UART_LINCTL_SLVDUEN_Msk (0x1ul << UART_LINCTL_SLVDUEN_Pos) /*!< UART_T::LINCTL: SLVDUEN Mask */ - -#define UART_LINCTL_MUTE_Pos (4) /*!< UART_T::LINCTL: MUTE Position */ -#define UART_LINCTL_MUTE_Msk (0x1ul << UART_LINCTL_MUTE_Pos) /*!< UART_T::LINCTL: MUTE Mask */ - -#define UART_LINCTL_SENDH_Pos (8) /*!< UART_T::LINCTL: SENDH Position */ -#define UART_LINCTL_SENDH_Msk (0x1ul << UART_LINCTL_SENDH_Pos) /*!< UART_T::LINCTL: SENDH Mask */ - -#define UART_LINCTL_IDPEN_Pos (9) /*!< UART_T::LINCTL: IDPEN Position */ -#define UART_LINCTL_IDPEN_Msk (0x1ul << UART_LINCTL_IDPEN_Pos) /*!< UART_T::LINCTL: IDPEN Mask */ - -#define UART_LINCTL_BRKDETEN_Pos (10) /*!< UART_T::LINCTL: BRKDETEN Position */ -#define UART_LINCTL_BRKDETEN_Msk (0x1ul << UART_LINCTL_BRKDETEN_Pos) /*!< UART_T::LINCTL: BRKDETEN Mask */ - -#define UART_LINCTL_LINRXOFF_Pos (11) /*!< UART_T::LINCTL: LINRXOFF Position */ -#define UART_LINCTL_LINRXOFF_Msk (0x1ul << UART_LINCTL_LINRXOFF_Pos) /*!< UART_T::LINCTL: LINRXOFF Mask */ - -#define UART_LINCTL_BITERREN_Pos (12) /*!< UART_T::LINCTL: BITERREN Position */ -#define UART_LINCTL_BITERREN_Msk (0x1ul << UART_LINCTL_BITERREN_Pos) /*!< UART_T::LINCTL: BITERREN Mask */ - -#define UART_LINCTL_BRKFL_Pos (16) /*!< UART_T::LINCTL: BRKFL Position */ -#define UART_LINCTL_BRKFL_Msk (0xful << UART_LINCTL_BRKFL_Pos) /*!< UART_T::LINCTL: BRKFL Mask */ - -#define UART_LINCTL_BSL_Pos (20) /*!< UART_T::LINCTL: BSL Position */ -#define UART_LINCTL_BSL_Msk (0x3ul << UART_LINCTL_BSL_Pos) /*!< UART_T::LINCTL: BSL Mask */ - -#define UART_LINCTL_HSEL_Pos (22) /*!< UART_T::LINCTL: HSEL Position */ -#define UART_LINCTL_HSEL_Msk (0x3ul << UART_LINCTL_HSEL_Pos) /*!< UART_T::LINCTL: HSEL Mask */ - -#define UART_LINCTL_PID_Pos (24) /*!< UART_T::LINCTL: PID Position */ -#define UART_LINCTL_PID_Msk (0xfful << UART_LINCTL_PID_Pos) /*!< UART_T::LINCTL: PID Mask */ - -#define UART_LINSTS_SLVHDETF_Pos (0) /*!< UART_T::LINSTS: SLVHDETF Position */ -#define UART_LINSTS_SLVHDETF_Msk (0x1ul << UART_LINSTS_SLVHDETF_Pos) /*!< UART_T::LINSTS: SLVHDETF Mask */ - -#define UART_LINSTS_SLVHEF_Pos (1) /*!< UART_T::LINSTS: SLVHEF Position */ -#define UART_LINSTS_SLVHEF_Msk (0x1ul << UART_LINSTS_SLVHEF_Pos) /*!< UART_T::LINSTS: SLVHEF Mask */ - -#define UART_LINSTS_SLVIDPEF_Pos (2) /*!< UART_T::LINSTS: SLVIDPEF Position */ -#define UART_LINSTS_SLVIDPEF_Msk (0x1ul << UART_LINSTS_SLVIDPEF_Pos) /*!< UART_T::LINSTS: SLVIDPEF Mask */ - -#define UART_LINSTS_SLVSYNCF_Pos (3) /*!< UART_T::LINSTS: SLVSYNCF Position */ -#define UART_LINSTS_SLVSYNCF_Msk (0x1ul << UART_LINSTS_SLVSYNCF_Pos) /*!< UART_T::LINSTS: SLVSYNCF Mask */ - -#define UART_LINSTS_BRKDETF_Pos (8) /*!< UART_T::LINSTS: BRKDETF Position */ -#define UART_LINSTS_BRKDETF_Msk (0x1ul << UART_LINSTS_BRKDETF_Pos) /*!< UART_T::LINSTS: BRKDETF Mask */ - -#define UART_LINSTS_BITEF_Pos (9) /*!< UART_T::LINSTS: BITEF Position */ -#define UART_LINSTS_BITEF_Msk (0x1ul << UART_LINSTS_BITEF_Pos) /*!< UART_T::LINSTS: BITEF Mask */ - -#define UART_BRCOMP_BRCOMP_Pos (0) /*!< UART_T::BRCOMP: BRCOMP Position */ -#define UART_BRCOMP_BRCOMP_Msk (0x1fful << UART_BRCOMP_BRCOMP_Pos) /*!< UART_T::BRCOMP: BRCOMP Mask */ - -#define UART_BRCOMP_BRCOMPDEC_Pos (31) /*!< UART_T::BRCOMP: BRCOMPDEC Position */ -#define UART_BRCOMP_BRCOMPDEC_Msk (0x1ul << UART_BRCOMP_BRCOMPDEC_Pos) /*!< UART_T::BRCOMP: BRCOMPDEC Mask */ - -#define UART_WKCTL_WKCTSEN_Pos (0) /*!< UART_T::WKCTL: WKCTSEN Position */ -#define UART_WKCTL_WKCTSEN_Msk (0x1ul << UART_WKCTL_WKCTSEN_Pos) /*!< UART_T::WKCTL: WKCTSEN Mask */ - -#define UART_WKCTL_WKDATEN_Pos (1) /*!< UART_T::WKCTL: WKDATEN Position */ -#define UART_WKCTL_WKDATEN_Msk (0x1ul << UART_WKCTL_WKDATEN_Pos) /*!< UART_T::WKCTL: WKDATEN Mask */ - -#define UART_WKCTL_WKRFRTEN_Pos (2) /*!< UART_T::WKCTL: WKRFRTEN Position */ -#define UART_WKCTL_WKRFRTEN_Msk (0x1ul << UART_WKCTL_WKRFRTEN_Pos) /*!< UART_T::WKCTL: WKRFRTEN Mask */ - -#define UART_WKCTL_WKRS485EN_Pos (3) /*!< UART_T::WKCTL: WKRS485EN Position */ -#define UART_WKCTL_WKRS485EN_Msk (0x1ul << UART_WKCTL_WKRS485EN_Pos) /*!< UART_T::WKCTL: WKRS485EN Mask */ - -#define UART_WKCTL_WKTOUTEN_Pos (4) /*!< UART_T::WKCTL: WKTOUTEN Position */ -#define UART_WKCTL_WKTOUTEN_Msk (0x1ul << UART_WKCTL_WKTOUTEN_Pos) /*!< UART_T::WKCTL: WKTOUTEN Mask */ - -#define UART_WKSTS_CTSWKF_Pos (0) /*!< UART_T::WKSTS: CTSWKF Position */ -#define UART_WKSTS_CTSWKF_Msk (0x1ul << UART_WKSTS_CTSWKF_Pos) /*!< UART_T::WKSTS: CTSWKF Mask */ - -#define UART_WKSTS_DATWKF_Pos (1) /*!< UART_T::WKSTS: DATWKF Position */ -#define UART_WKSTS_DATWKF_Msk (0x1ul << UART_WKSTS_DATWKF_Pos) /*!< UART_T::WKSTS: DATWKF Mask */ - -#define UART_WKSTS_RFRTWKF_Pos (2) /*!< UART_T::WKSTS: RFRTWKF Position */ -#define UART_WKSTS_RFRTWKF_Msk (0x1ul << UART_WKSTS_RFRTWKF_Pos) /*!< UART_T::WKSTS: RFRTWKF Mask */ - -#define UART_WKSTS_RS485WKF_Pos (3) /*!< UART_T::WKSTS: RS485WKF Position */ -#define UART_WKSTS_RS485WKF_Msk (0x1ul << UART_WKSTS_RS485WKF_Pos) /*!< UART_T::WKSTS: RS485WKF Mask */ - -#define UART_WKSTS_TOUTWKF_Pos (4) /*!< UART_T::WKSTS: TOUTWKF Position */ -#define UART_WKSTS_TOUTWKF_Msk (0x1ul << UART_WKSTS_TOUTWKF_Pos) /*!< UART_T::WKSTS: TOUTWKF Mask */ - -#define UART_DWKCOMP_STCOMP_Pos (0) /*!< UART_T::DWKCOMP: STCOMP Position */ -#define UART_DWKCOMP_STCOMP_Msk (0xfffful << UART_DWKCOMP_STCOMP_Pos) /*!< UART_T::DWKCOMP: STCOMP Mask */ - - -#define UART0 ((UART_T *) UART0_BA) -#define UART1 ((UART_T *) UART1_BA) -#define UART2 ((UART_T *) UART2_BA) -#define UART3 ((UART_T *) UART3_BA) -#define UART4 ((UART_T *) UART4_BA) -#define UART5 ((UART_T *) UART5_BA) -#define UART6 ((UART_T *) UART6_BA) -#define UART7 ((UART_T *) UART7_BA) -#define UART8 ((UART_T *) UART8_BA) -#define UART9 ((UART_T *) UART9_BA) - - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - - -/** - * @brief Calculate UART baudrate mode0 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode0 divider - * - * @details This macro calculate UART baudrate mode0 divider. - * \hideinitializer - */ -#define UART_BAUD_MODE0_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)*8ul)) / (u32BaudRate) >> 4ul)-2ul) - - -/** - * @brief Calculate UART baudrate mode2 divider - * - * @param[in] u32SrcFreq UART clock frequency - * @param[in] u32BaudRate Baudrate of UART module - * - * @return UART baudrate mode2 divider - * - * @details This macro calculate UART baudrate mode2 divider. - * \hideinitializer - */ -#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) ((((u32SrcFreq) + ((u32BaudRate)/2ul)) / (u32BaudRate))-2ul) - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u8Data Data byte to transmit. - * - * @return None - * - * @details This macro write Data to Tx data register. - * \hideinitializer - */ -#define UART_WRITE(uart, u8Data) ((uart)->DAT = (u8Data)) - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module - * - * @return The oldest data byte in RX FIFO. - * - * @details This macro read Rx data register. - * \hideinitializer - */ -#define UART_READ(uart) ((uart)->DAT) - - -/** - * @brief Get Tx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not empty - * @retval >=1 Tx FIFO is empty - * - * @details This macro get Transmitter FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_TX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTY_Msk) - - -/** - * @brief Get Rx empty - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not empty - * @retval >=1 Rx FIFO is empty - * - * @details This macro get Receiver FIFO empty register value. - * \hideinitializer - */ -#define UART_GET_RX_EMPTY(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) - - -/** - * @brief Check specified UART port transmission is over. - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx transmission is not over - * @retval 1 Tx transmission is over - * - * @details This macro return Transmitter Empty Flag register bit value. - * It indicates if specified UART port transmission is over nor not. - * \hideinitializer - */ -#define UART_IS_TX_EMPTY(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos) - - -/** - * @brief Wait specified UART port transmission is over - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro wait specified UART port transmission is over. - * \hideinitializer - */ -#define UART_WAIT_TX_EMPTY(uart) while(!((((uart)->FIFOSTS) & UART_FIFOSTS_TXEMPTYF_Msk) >> UART_FIFOSTS_TXEMPTYF_Pos)) - - -/** - * @brief Check RX is ready or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 The number of bytes in the RX FIFO is less than the RFITL - * @retval 1 The number of bytes in the RX FIFO equals or larger than RFITL - * - * @details This macro check receive data available interrupt flag is set or not. - * \hideinitializer - */ -#define UART_IS_RX_READY(uart) (((uart)->INTSTS & UART_INTSTS_RDAIF_Msk)>>UART_INTSTS_RDAIF_Pos) - - -/** - * @brief Check TX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 TX FIFO is full - * @retval 0 TX FIFO is not full - * - * @details This macro check TX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_TX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk)>>UART_FIFOSTS_TXFULL_Pos) - - -/** - * @brief Check RX FIFO is full or not - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 1 RX FIFO is full - * @retval 0 RX FIFO is not full - * - * @details This macro check RX FIFO is full or not. - * \hideinitializer - */ -#define UART_IS_RX_FULL(uart) (((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk)>>UART_FIFOSTS_RXFULL_Pos) - - -/** - * @brief Get Tx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Tx FIFO is not full. - * @retval >=1 Tx FIFO is full. - * - * @details This macro get Tx full register value. - * \hideinitializer - */ -#define UART_GET_TX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_TXFULL_Msk) - - -/** - * @brief Get Rx full register value - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Rx FIFO is not full. - * @retval >=1 Rx FIFO is full. - * - * @details This macro get Rx full register value. - * \hideinitializer - */ -#define UART_GET_RX_FULL(uart) ((uart)->FIFOSTS & UART_FIFOSTS_RXFULL_Msk) - - -/** - * @brief Enable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Rx Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_ENABLE_INT(uart, u32eIntSel) ((uart)->INTEN |= (u32eIntSel)) - - -/** - * @brief Disable specified UART interrupt - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntSel Interrupt type select - * - \ref UART_INTEN_ABRIEN_Msk : Auto baud rate interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wakeup interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt - * - * @return None - * - * @details This macro enable specified UART interrupt. - * \hideinitializer - */ -#define UART_DISABLE_INT(uart, u32eIntSel) ((uart)->INTEN &= ~ (u32eIntSel)) - - -/** - * @brief Get specified interrupt flag/status - * - * @param[in] uart The pointer of the specified UART module - * @param[in] u32eIntTypeFlag Interrupt Type Flag, should be - * - \ref UART_INTSTS_HWBUFEINT_Msk : In DMA Mode, Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_HWTOINT_Msk : In DMA Mode, Time-out Interrupt Indicator - * - \ref UART_INTSTS_HWMODINT_Msk : In DMA Mode, MODEM Status Interrupt Indicator - * - \ref UART_INTSTS_HWRLSINT_Msk : In DMA Mode, Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_HWBUFEIF_Msk : In DMA Mode, Buffer Error Interrupt Flag - * - \ref UART_INTSTS_HWTOIF_Msk : In DMA Mode, Time-out Interrupt Flag - * - \ref UART_INTSTS_HWMODIF_Msk : In DMA Mode, MODEM Interrupt Flag - * - \ref UART_INTSTS_HWRLSIF_Msk : In DMA Mode, Receive Line Status Flag - * - \ref UART_INTSTS_LININT_Msk : LIN Bus Interrupt Indicator - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error Interrupt Indicator - * - \ref UART_INTSTS_RXTOINT_Msk : Time-out Interrupt Indicator - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status Interrupt Indicator - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status Interrupt Indicator - * - \ref UART_INTSTS_THREINT_Msk : Transmit Holding Register Empty Interrupt Indicator - * - \ref UART_INTSTS_RDAINT_Msk : Receive Data Available Interrupt Indicator - * - \ref UART_INTSTS_LINIF_Msk : LIN Bus Flag - * - \ref UART_INTSTS_BUFERRIF_Msk : Buffer Error Interrupt Flag - * - \ref UART_INTSTS_RXTOIF_Msk : Rx Time-out Interrupt Flag - * - \ref UART_INTSTS_MODEMIF_Msk : Modem Interrupt Flag - * - \ref UART_INTSTS_RLSIF_Msk : Receive Line Status Interrupt Flag - * - \ref UART_INTSTS_THREIF_Msk : Tx Empty Interrupt Flag - * - \ref UART_INTSTS_RDAIF_Msk : Rx Ready Interrupt Flag - * - * @retval 0 The specified interrupt is not happened. - * 1 The specified interrupt is happened. - * - * @details This macro get specified interrupt flag or interrupt indicator status. - * \hideinitializer - */ -#define UART_GET_INT_FLAG(uart,u32eIntTypeFlag) (((uart)->INTSTS & (u32eIntTypeFlag))?1:0) - - -/** - * @brief Clear RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro clear RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_CLEAR_ADDR_FLAG(uart) ((uart)->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk) - - -/** - * @brief Get RS-485 Address Byte Detection Flag - * - * @param[in] uart The pointer of the specified UART module - * - * @retval 0 Receiver detects a data that is not an address bit. - * @retval 1 Receiver detects a data that is an address bit. - * - * @details This macro get RS-485 address byte detection flag. - * \hideinitializer - */ -#define UART_RS485_GET_ADDR_FLAG(uart) (((uart)->FIFOSTS & UART_FIFOSTS_ADDRDETF_Msk) >> UART_FIFOSTS_ADDRDETF_Pos) - -/* Declare these inline functions here to avoid MISRA C 2004 rule 8.1 error */ -void UART_CLEAR_RTS(UART_T *uart); -void UART_SET_RTS(UART_T *uart); - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Close(UART_T *uart); -void UART_DisableFlowCtrl(UART_T *uart); -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_EnableFlowCtrl(UART_T *uart); -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag); -void UART_Open(UART_T *uart, uint32_t u32baudrate); -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes); -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits); -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC); -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction); -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr); -void UART_SelectLINMode(UART_T *uart, uint32_t u32Mode, uint32_t u32BreakLength); -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes); - - - - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - - -#endif /*__NU_UART_H__*/ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_usbd.h b/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_usbd.h deleted file mode 100644 index 85c5c26edee..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Include/nu_usbd.h +++ /dev/null @@ -1,942 +0,0 @@ -/**************************************************************************//** - * @file usbd.h - * @version V1.00 - * $Revision: 3 $ - * $Date: 18/08/05 10:19a $ - * @brief USBD driver header file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#ifndef __NU_USBD_H__ -#define __NU_USBD_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - -/** @addtogroup USBD_EXPORTED_CONSTANTS USBD Exported Constants - @{ -*/ -/// @cond HIDDEN_SYMBOLS -#define USBD_MAX_EP 12 - -#define Maximum(a,b) (a)>(b) ? (a) : (b) -#define Minimum(a,b) (a)<(b) ? (a) : (b) - - -#define CEP 0xff /*!< Control Endpoint \hideinitializer */ -#define EPA 0 /*!< Endpoint A \hideinitializer */ -#define EPB 1 /*!< Endpoint B \hideinitializer */ -#define EPC 2 /*!< Endpoint C \hideinitializer */ -#define EPD 3 /*!< Endpoint D \hideinitializer */ -#define EPE 4 /*!< Endpoint E \hideinitializer */ -#define EPF 5 /*!< Endpoint F \hideinitializer */ -#define EPG 6 /*!< Endpoint G \hideinitializer */ -#define EPH 7 /*!< Endpoint H \hideinitializer */ -#define EPI 8 /*!< Endpoint I \hideinitializer */ -#define EPJ 9 /*!< Endpoint J \hideinitializer */ -#define EPK 10 /*!< Endpoint K \hideinitializer */ -#define EPL 11 /*!< Endpoint L \hideinitializer */ - -/* USB Request Type */ -#define REQ_STANDARD 0x00 -#define REQ_CLASS 0x20 -#define REQ_VENDOR 0x40 - -/* USB Standard Request */ -#define GET_STATUS 0x00 -#define CLEAR_FEATURE 0x01 -#define SET_FEATURE 0x03 -#define SET_ADDRESS 0x05 -#define GET_DESCRIPTOR 0x06 -#define SET_DESCRIPTOR 0x07 -#define GET_CONFIGURATION 0x08 -#define SET_CONFIGURATION 0x09 -#define GET_INTERFACE 0x0A -#define SET_INTERFACE 0x0B -#define SYNC_FRAME 0x0C - -/* USB Descriptor Type */ -#define DESC_DEVICE 0x01 -#define DESC_CONFIG 0x02 -#define DESC_STRING 0x03 -#define DESC_INTERFACE 0x04 -#define DESC_ENDPOINT 0x05 -#define DESC_QUALIFIER 0x06 -#define DESC_OTHERSPEED 0x07 -#define DESC_IFPOWER 0x08 -#define DESC_OTG 0x09 - -/* USB HID Descriptor Type */ -#define DESC_HID 0x21 -#define DESC_HID_RPT 0x22 - -/* USB Descriptor Length */ -#define LEN_DEVICE 18 -#define LEN_QUALIFIER 10 -#define LEN_CONFIG 9 -#define LEN_INTERFACE 9 -#define LEN_ENDPOINT 7 -#define LEN_OTG 5 -#define LEN_HID 9 - -/* USB Endpoint Type */ -#define EP_ISO 0x01 -#define EP_BULK 0x02 -#define EP_INT 0x03 - -#define EP_INPUT 0x80 -#define EP_OUTPUT 0x00 - -/* USB Feature Selector */ -#define FEATURE_DEVICE_REMOTE_WAKEUP 0x01 -#define FEATURE_ENDPOINT_HALT 0x00 -/// @endcond HIDDEN_SYMBOLS -/********************* Bit definition of CEPCTL register **********************/ -#define USB_CEPCTL_NAKCLR ((uint32_t)0x00000000) /*!PHYCTL |= (USBD_PHYCTL_PHYEN_Msk|USBD_PHYCTL_DPPUEN_Msk))) /*!PHYCTL &= ~USBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= USBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~USBD_PHYCTL_PHYEN_Msk)) /*!PHYCTL &= ~USBD_PHYCTL_DPPUEN_Msk)) /*!PHYCTL |= USBD_PHYCTL_DPPUEN_Msk)) /*!FADDR = (addr)) /*!FADDR)) /*!GINTEN = (intr)) /*!BUSINTEN = (intr)) /*!BUSINTSTS) /*!BUSINTSTS = flag) /*!CEPINTEN = (intr)) /*!CEPINTSTS = flag) /*!CEPCTL = flag) /*!CEPTXCNT = size) /*!EP[ep].EPMPS = (size)) /*!EP[ep].EPINTEN = (intr)) /*!EP[ep].EPINTSTS) /*!EP[ep].EPINTSTS = (flag)) /*!DMACNT = len) /*!DMAADDR = addr) /*!DMACTL = (USBD->DMACTL & ~USBD_DMACTL_EPNUM_Msk) | USBD_DMACTL_DMARD_Msk | epnum | 0x100) /*!DMACTL = (USBD->DMACTL & ~(USBD_DMACTL_EPNUM_Msk | USBD_DMACTL_DMARD_Msk | 0x100)) | epnum) /*!DMACTL |= USBD_DMACTL_DMAEN_Msk) /*!PHYCTL & USBD_PHYCTL_VBUSDET_Msk)) /*!DMACNT = 0; - USBD->DMACTL = 0x80; - USBD->DMACTL = 0x00; -} -/** - * @brief USBD_SetEpBufAddr, Set Endpoint buffer address - * @param[in] u32Ep Endpoint Number - * @param[in] u32Base Buffer Start Address - * @param[in] u32Len Buffer length - * @retval None. - */ -static __inline void USBD_SetEpBufAddr(uint32_t u32Ep, uint32_t u32Base, uint32_t u32Len) -{ - if (u32Ep == CEP) - { - USBD->CEPBUFSTART = u32Base; - USBD->CEPBUFEND = u32Base + u32Len - 1; - } - else - { - USBD->EP[u32Ep].EPBUFSTART = u32Base; - USBD->EP[u32Ep].EPBUFEND = u32Base + u32Len - 1; - } -} - -/** - * @brief USBD_ConfigEp, Config Endpoint - * @param[in] u32Ep USB endpoint - * @param[in] u32EpNum Endpoint number - * @param[in] u32EpType Endpoint type - * @param[in] u32EpDir Endpoint direction - * @retval None. - */ -static __inline void USBD_ConfigEp(uint32_t u32Ep, uint32_t u32EpNum, uint32_t u32EpType, uint32_t u32EpDir) -{ - if (u32EpType == USB_EP_CFG_TYPE_BULK) - USBD->EP[u32Ep].EPRSPCTL = (USB_EP_RSPCTL_FLUSH | USB_EP_RSPCTL_MODE_AUTO); - else if (u32EpType == USB_EP_CFG_TYPE_INT) - USBD->EP[u32Ep].EPRSPCTL = (USB_EP_RSPCTL_FLUSH | USB_EP_RSPCTL_MODE_MANUAL); - else if (u32EpType == USB_EP_CFG_TYPE_ISO) - USBD->EP[u32Ep].EPRSPCTL = (USB_EP_RSPCTL_FLUSH | USB_EP_RSPCTL_MODE_FLY); - - USBD->EP[u32Ep].EPCFG = (u32EpType | u32EpDir | USB_EP_CFG_VALID | (u32EpNum << 4)); -} - -/** - * @brief Set USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically. - */ -static __inline void USBD_SetEpStall(uint32_t u32Ep) -{ - if (u32Ep == CEP) - USBD_SET_CEP_STATE(USB_CEPCTL_STALL); - else - { - USBD->EP[u32Ep].EPRSPCTL = (USBD->EP[u32Ep].EPRSPCTL & 0xf7) | USB_EP_RSPCTL_HALT; - } -} - -/** - * @brief Set USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Set USB endpoint stall state, endpoint will return STALL token. - */ -static __inline void USBD_SetStall(uint32_t u32EpNum) -{ - int i; - - if (u32EpNum == 0) - USBD_SET_CEP_STATE(USB_CEPCTL_STALL); - else - { - for (i = 0; i < USBD_MAX_EP; i++) - { - if (((USBD->EP[i].EPCFG & 0xf0) >> 4) == u32EpNum) - { - USBD->EP[i].EPRSPCTL = USBD->EP[i].EPRSPCTL & 0xf7 | USB_EP_RSPCTL_HALT; - } - } - } -} - -/** - * @brief Clear USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @return None - * @details Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token. - */ -static __inline void USBD_ClearEpStall(uint32_t u32Ep) -{ - USBD->EP[u32Ep].EPRSPCTL = USB_EP_RSPCTL_TOGGLE; -} - -/** - * @brief Clear USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @return None - * - * @details Clear USB endpoint stall state, endpoint will return ACK/NAK token. - */ -static __inline void USBD_ClearStall(uint32_t u32EpNum) -{ - int i; - - for (i = 0; i < USBD_MAX_EP; i++) - { - if (((USBD->EP[i].EPCFG & 0xf0) >> 4) == u32EpNum) - { - USBD->EP[i].EPRSPCTL = USB_EP_RSPCTL_TOGGLE; - } - } -} - -/** - * @brief Get USB endpoint stall state - * @param[in] u32Ep The USB endpoint ID. - * @retval 0 USB endpoint is not stalled. - * @retval Others USB endpoint is stalled. - * @details Get USB endpoint stall state of the specified endpoint ID. - */ -static __inline uint32_t USBD_GetEpStall(uint32_t u32Ep) -{ - return (USBD->EP[u32Ep].EPRSPCTL & USB_EP_RSPCTL_HALT); -} - -/** - * @brief Get USB endpoint stall state - * - * @param[in] u32EpNum USB endpoint - * @retval 0: USB endpoint is not stalled. - * @retval non-0: USB endpoint is stalled. - * - * @details Get USB endpoint stall state. - */ -static __inline uint32_t USBD_GetStall(uint32_t u32EpNum) -{ - int i; - - for (i = 0; i < USBD_MAX_EP; i++) - { - if (((USBD->EP[i].EPCFG & 0xf0) >> 4) == u32EpNum) - { - return (USBD->EP[i].EPRSPCTL & USB_EP_RSPCTL_HALT); - } - } - return 0; -} - - -/*-------------------------------------------------------------------------------------------*/ -typedef void (*VENDOR_REQ)(void); /*!Introduction - * - * This user manual describes the usage of NUC980 family device driver - * - * Disclaimer - * - * The Software is furnished "AS IS", without warranty as to performance or results, and - * the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all - * warranties, express, implied or otherwise, with regard to the Software, its use, or - * operation, including without limitation any and all warranties of merchantability, fitness - * for a particular purpose, and non-infringement of intellectual property rights. - * - * Important Notice - * - * Nuvoton Products are neither intended nor warranted for usage in systems or equipment, - * any malfunction or failure of which may cause loss of human life, bodily injury or severe - * property damage. Such applications are deemed, "Insecure Usage". - * - * Insecure usage includes, but is not limited to: equipment for surgical implementation, - * atomic energy control instruments, airplane or spaceship instruments, the control or - * operation of dynamic, brake or safety systems designed for vehicular use, traffic signal - * instruments, all types of safety devices, and other applications intended to support or - * sustain life. - * - * All Insecure Usage shall be made at customer's risk, and in the event that third parties - * lay claims to Nuvoton as a result of customer's Insecure Usage, customer shall indemnify - * the damages and liabilities thus incurred by Nuvoton. - * - * Please note that all data and specifications are subject to change without notice. All the - * trademarks of products and companies mentioned in this document belong to their respective - * owners. - * - * Copyright Notice - * - * Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. - */ - -#ifndef __NUC980_H__ - #define __NUC980_H__ - - #include - - /** @addtogroup NUC980_PERIPHERAL_MEM_MAP Peripheral Memory Base - Memory Mapped Structure for NUC980 Peripheral - @{ - */ - - /*!< AHB peripherals */ - #define SYS_BA 0xB0000000 /* Global Control */ - #define CLK_BA 0xB0000200 /* Clock Control */ - #define SDIC_BA 0xB0002000 - #define EBI_BA 0xB0010000 /* EBI Control */ - #define GPIO_BA 0xB0004000 - #define PDMA0_BA 0xB0008000 - #define PDMA1_BA 0xB0009000 - #define EMC0_BA 0xB0012000 - #define EHCI_BA 0xB0015000 - #define USBD_BA 0xB0016000 - #define OHCI_BA 0xB0017000 - #define SDH_BA 0xB0018000 - #define FMI_BA 0xB0019000 - #define CRPT_BA 0xB001C000 - #define I2S_BA 0xB0020000 - #define EMC1_BA 0xB0022000 - #define CAP0_BA 0xB0024000 - #define CAP1_BA 0xB0014000 - - #define PA_BA 0xB0004000 - #define PB_BA 0xB0004040 - #define PC_BA 0xB0004080 - #define PD_BA 0xB00040C0 - #define PE_BA 0xB0004100 - #define PF_BA 0xB0004140 - #define PG_BA 0xB0004180 - - /*!< APB peripherals */ - - #define WDT_BA 0xB0040000 /* Watch Dog Timer */ - #define WWDT_BA 0xB0040100 /* Windows Watch Dog Timer */ - #define RTC_BA 0xB0041000 - #define AIC_BA 0xB0042000 /* Interrupt Controller */ - #define ADC_BA 0xB0043000 - #define ETMR0_BA 0xB0050000 /* ETimer0 */ - #define ETMR1_BA 0xB0050100 /* ETimer1 */ - #define ETMR2_BA 0xB0051000 /* ETimer2 */ - #define ETMR3_BA 0xB0051100 /* ETimer3 */ - #define ETMR4_BA 0xB0052000 /* ETimer4 */ - #define ETMR5_BA 0xB0052100 /* ETimer5 */ - #define PWM0_BA 0xB0058000 - #define PWM1_BA 0xB0059000 - #define QSPI0_BA 0xB0060000 - #define SPI0_BA 0xB0061000 - #define SPI1_BA 0xB0062000 - #define UART0_BA 0xB0070000 /* UART0 Control */ - #define UART1_BA 0xB0071000 /* UART1 Control */ - #define UART2_BA 0xB0072000 - #define UART3_BA 0xB0073000 - #define UART4_BA 0xB0074000 - #define UART5_BA 0xB0075000 - #define UART6_BA 0xB0076000 - #define UART7_BA 0xB0077000 - #define UART8_BA 0xB0078000 - #define UART9_BA 0xB0079000 - #define I2C0_BA 0xB0080000 - #define I2C1_BA 0xB0081000 - #define I2C2_BA 0xB0082000 - #define I2C3_BA 0xB0083000 - #define SC0_BA 0xB0090000 - #define SC1_BA 0xB0091000 - #define CAN0_BA 0xB00A0000 - #define CAN1_BA 0xB00A1000 - #define CAN2_BA 0xB00A2000 - #define CAN3_BA 0xB00A3000 - - /*@}*/ /* end of group NUC980_PERIPHERAL_MEM_MAP */ - - /******************************************************************************/ - /* Device Specific Peripheral registers structures */ - /******************************************************************************/ - /** @addtogroup REGISTER Control Register - NUC980 Device Specific Peripheral registers structures - @{ - */ - - /*---------------------- System Manger Controller -------------------------*/ - /** - @addtogroup SYS System Manger Controller(SYS) - Memory Mapped Structure for SYS Controller - @{ */ - - #define REG_SYS_PDID (SYS_BA+0x000) /*!< Product Identifier Register */ - #define REG_SYS_PWRON (SYS_BA+0x004) /*!< Power-On Setting Register */ - #define REG_SYS_ARBCON (SYS_BA+0x008) /*!< Arbitration Control Register */ - #define REG_SYS_LVRDCR (SYS_BA+0x020) /*!< Low Voltage Reset & Detect Control Register */ - #define REG_SYS_MISCFCR (SYS_BA+0x030) /*!< Miscellaneous Function Control Register */ - #define REG_SYS_MISCIER (SYS_BA+0x040) /*!< Miscellaneous Interrupt Enable Register */ - #define REG_SYS_MISCISR (SYS_BA+0x044) /*!< Miscellaneous Interrupt Status Register */ - #define REG_SYS_WKUPSER0 (SYS_BA+0x050) /*!< System Wakeup Source Enable Register0 */ - #define REG_SYS_WKUPSER1 (SYS_BA+0x054) /*!< System Wakeup Source Enable Register1 */ - #define REG_SYS_WKUPSSR0 (SYS_BA+0x058) /*!< System Wakeup Source Status Register0 */ - #define REG_SYS_WKUPSSR1 (SYS_BA+0x05C) /*!< System Wakeup Source Status Register1 */ - #define REG_SYS_AHBIPRST (SYS_BA+0x060) /*!< AHB IP Reset Control Register */ - #define REG_SYS_APBIPRST0 (SYS_BA+0x064) /*!< APB IP Reset Control Register 0 */ - #define REG_SYS_APBIPRST1 (SYS_BA+0x068) /*!< APB IP Reset Control Register 1 */ - #define REG_SYS_RSTSTS (SYS_BA+0x06C) /*!< Reset Source Active Status Register */ - #define REG_SYS_GPA_MFPL (SYS_BA+0x070) /*!< GPIOA Low Byte Multiple Function Control Register */ - #define REG_SYS_GPA_MFPH (SYS_BA+0x074) /*!< GPIOA High Byte Multiple Function Control Register */ - #define REG_SYS_GPB_MFPL (SYS_BA+0x078) /*!< GPIOB Low Byte Multiple Function Control Register */ - #define REG_SYS_GPB_MFPH (SYS_BA+0x07C) /*!< GPIOB High Byte Multiple Function Control Register */ - #define REG_SYS_GPC_MFPL (SYS_BA+0x080) /*!< GPIOC Low Byte Multiple Function Control Register */ - #define REG_SYS_GPC_MFPH (SYS_BA+0x084) /*!< GPIOC High Byte Multiple Function Control Register */ - #define REG_SYS_GPD_MFPL (SYS_BA+0x088) /*!< GPIOD Low Byte Multiple Function Control Register */ - #define REG_SYS_GPD_MFPH (SYS_BA+0x08C) /*!< GPIOD High Byte Multiple Function Control Register */ - #define REG_SYS_GPE_MFPL (SYS_BA+0x090) /*!< GPIOE Low Byte Multiple Function Control Register */ - #define REG_SYS_GPE_MFPH (SYS_BA+0x094) /*!< GPIOE High Byte Multiple Function Control Register */ - #define REG_SYS_GPF_MFPL (SYS_BA+0x098) /*!< GPIOF Low Byte Multiple Function Control Register */ - #define REG_SYS_GPF_MFPH (SYS_BA+0x09C) /*!< GPIOF High Byte Multiple Function Control Register */ - #define REG_SYS_GPG_MFPL (SYS_BA+0x0A0) /*!< GPIOG Low Byte Multiple Function Control Register */ - #define REG_SYS_GPG_MFPH (SYS_BA+0x0A4) /*!< GPIOG High Byte Multiple Function Control Register */ - #define REG_SYS_GPH_MFPL (SYS_BA+0x0A8) /*!< GPIOH Low Byte Multiple Function Control Register */ - #define REG_SYS_GPH_MFPH (SYS_BA+0x0AC) /*!< GPIOH High Byte Multiple Function Control Register */ - #define REG_SYS_GPI_MFPL (SYS_BA+0x0B0) /*!< GPIOI Low Byte Multiple Function Control Register */ - #define REG_SYS_GPI_MFPH (SYS_BA+0x0B4) /*!< GPIOI High Byte Multiple Function Control Register */ - #define REG_SYS_GPJ_MFPL (SYS_BA+0x0B8) /*!< GPIOJ Low Byte Multiple Function Control Register */ - #define REG_SYS_DDR_DSCTL (SYS_BA+0x0F0) /*!< DDR I/O Driving Strength Control Register */ - #define REG_SYS_PORDISCR (SYS_BA+0x100) /*!< Power-On-Reset Disable Control Register */ - #define REG_SYS_ICEDBGCR (SYS_BA+0x104) /*!< ICE Debug Interface Control Register */ - #define REG_SYS_ERRADDCR (SYS_BA+0x108) /*!< Error Response Address Control Regsiter */ - #define REG_SYS_REGWPCTL (SYS_BA+0x1FC) /*!< Register Write-Protection Control Register */ - - /**@}*/ /* end of SYS register group */ - - /*---------------------- System Clock Controller -------------------------*/ - /** - @addtogroup CLK System Clock Controller(CLK) - Memory Mapped Structure for CLK Controller - @{ */ - - #define REG_CLK_PMCON (CLK_BA+0x00) /*!< Power Management Control Register */ - #define REG_CLK_HCLKEN (CLK_BA+0x10) /*!< AHB IP Clock Enable Control Register */ - #define REG_CLK_PCLKEN0 (CLK_BA+0x18) /*!< APB IP Clock Enable Control Register 0 */ - #define REG_CLK_PCLKEN1 (CLK_BA+0x1C) /*!< APB IP Clock Enable Control Register 1 */ - #define REG_CLK_DIVCTL0 (CLK_BA+0x20) /*!< Clock Divider Control Register 0 */ - #define REG_CLK_DIVCTL1 (CLK_BA+0x24) /*!< Clock Divider Control Register 1 */ - #define REG_CLK_DIVCTL2 (CLK_BA+0x28) /*!< Clock Divider Control Register 2 */ - #define REG_CLK_DIVCTL3 (CLK_BA+0x2C) /*!< Clock Divider Control Register 3 */ - #define REG_CLK_DIVCTL4 (CLK_BA+0x30) /*!< Clock Divider Control Register 4 */ - #define REG_CLK_DIVCTL5 (CLK_BA+0x34) /*!< Clock Divider Control Register 5 */ - #define REG_CLK_DIVCTL6 (CLK_BA+0x38) /*!< Clock Divider Control Register 6 */ - #define REG_CLK_DIVCTL7 (CLK_BA+0x3C) /*!< Clock Divider Control Register 7 */ - #define REG_CLK_DIVCTL8 (CLK_BA+0x40) /*!< Clock Divider Control Register 8 */ - #define REG_CLK_DIVCTL9 (CLK_BA+0x44) /*!< Clock Divider Control Register 9 */ - #define REG_CLK_APLLCON (CLK_BA+0x60) /*!< APLL Control Register */ - #define REG_CLK_UPLLCON (CLK_BA+0x64) /*!< UPLL Control Register */ - #define REG_CLK_PLLSTBCNTR (CLK_BA+0x80) /*!< PLL Stable Counter and Test Clock Control Register */ - - /**@}*/ /* end of CLK register group */ - - - /*---------------------- External Bus Interface Controller -------------------------*/ - /** - @addtogroup EBI External Bus Interface Controller(EBI) - Memory Mapped Structure for EBI Controller - @{ */ - - #define REG_EBI_CTL (EBI_BA+0x000) /*!< EBI control register */ - #define REG_EBI_BNKCTL0 (EBI_BA+0x018) /*!< External I/O 0 control register */ - #define REG_EBI_BNKCTL1 (EBI_BA+0x01C) /*!< External I/O 1 control register */ - #define REG_EBI_BNKCTL2 (EBI_BA+0x020) /*!< External I/O 2 control register */ - #define REG_EBI_BNKCTL3 (EBI_BA+0x024) /*!< External I/O 3 control register */ - #define REG_EBI_BNKCTL4 (EBI_BA+0x028) /*!< External I/O 4 control register */ - - /**@}*/ /* end of EBI register group */ - - /*---------------------- Analog to Digital Converter -------------------------*/ - /** - @addtogroup ADC Analog to Digital Converter(ADC) - Memory Mapped Structure for ADC Controller - @{ */ - - #define REG_ADC_CTL (ADC_BA+0x000) /*!< ADC Contrl */ - #define REG_ADC_CONF (ADC_BA+0x004) /*!< ADC Configure */ - #define REG_ADC_IER (ADC_BA+0x008) /*!< ADC Interrupt Enable Register */ - #define REG_ADC_ISR (ADC_BA+0x00C) /*!< ADC Interrupt Status Register */ - #define REG_ADC_WKISR (ADC_BA+0x010) /*!< ADC Wake Up Interrupt Status Register */ - #define REG_ADC_XYDATA (ADC_BA+0x020) /*!< ADC Touch XY Pressure Data */ - #define REG_ADC_ZDATA (ADC_BA+0x024) /*!< ADC Touch Z Pressure Data */ - #define REG_ADC_DATA (ADC_BA+0x028) /*!< ADC Normal Conversion Data */ - #define REG_ADC_VBADATA (ADC_BA+0x02C) /*!< ADC Battery Detection Data */ - #define REG_ADC_KPDATA (ADC_BA+0x030) /*!< ADC Key Pad Data */ - #define REG_ADC_SELFDATA (ADC_BA+0x034) /*!< ADC Self-Test Data */ - #define REG_ADC_XYSORT0 (ADC_BA+0x1F4) /*!< ADC Touch XY Position Mean Value Sort 0 */ - #define REG_ADC_XYSORT1 (ADC_BA+0x1F8) /*!< ADC Touch XY Position Mean Value Sort 1 */ - #define REG_ADC_XYSORT2 (ADC_BA+0x1FC) /*!< ADC Touch XY Position Mean Value Sort 2 */ - #define REG_ADC_XYSORT3 (ADC_BA+0x200) /*!< ADC Touch XY Position Mean Value Sort 3 */ - #define REG_ADC_ZSORT0 (ADC_BA+0x204) /*!< ADC Touch Z Pressure Mean Value Sort 0 */ - #define REG_ADC_ZSORT1 (ADC_BA+0x208) /*!< ADC Touch Z Pressure Mean Value Sort 1 */ - #define REG_ADC_ZSORT2 (ADC_BA+0x20C) /*!< ADC Touch Z Pressure Mean Value Sort 2 */ - #define REG_ADC_ZSORT3 (ADC_BA+0x210) /*!< ADC Touch Z Pressure Mean Value Sort 3 */ - #define REG_ADC_MTMULCK (ADC_BA+0x220) /*!< ADC Manual Test Mode Unlock */ - #define REG_ADC_MTCONF (ADC_BA+0x224) /*!< ADC Manual Test Mode Configure */ - #define REG_ADC_MTCON (ADC_BA+0x228) /*!< ADC Manual Test Mode Control */ - #define REG_ADC_ADCAII (ADC_BA+0x22C) /*!< ADC Analog Interface Information */ - #define REG_ADC_ADCAIIRLT (ADC_BA+0x230) /*!< ADC Analog Interface Information Result */ - - /**@}*/ /* end of ADC register group */ - - - /*---------------------- Ethernet MAC Controller -------------------------*/ - /** - @addtogroup EMAC Ethernet MAC Controller(EMAC) - Memory Mapped Structure for EMAC Controller - @{ */ - - #define REG_EMAC0_CAMCMR (EMC0_BA+0x000) /*!< CAM Command Register */ - #define REG_EMAC0_CAMEN (EMC0_BA+0x004) /*!< CAM Enable Register */ - #define REG_EMAC0_CAM0M (EMC0_BA+0x008) /*!< CAM0 Most Significant Word Register */ - #define REG_EMAC0_CAM0L (EMC0_BA+0x00c) /*!< CAM0 Least Significant Word Register */ - #define REG_EMAC0_CAMxM_Reg(x)(REG_EMAC0_CAM0M+(x)*0x8) /*!< CAMx Most Significant Word Register */ - #define REG_EMAC0_CAMxL_Reg(x)(REG_EMAC0_CAM0L+(x)*0x8) /*!< CAMx Least Significant Word Register */ - #define REG_EMAC0_TXDLSA (EMC0_BA+0x088) /*!< Transmit Descriptor Link List Start Address Register */ - #define REG_EMAC0_RXDLSA (EMC0_BA+0x08C) /*!< Receive Descriptor Link List Start Address Register */ - #define REG_EMAC0_MCMDR (EMC0_BA+0x090) /*!< MAC Command Register */ - #define REG_EMAC0_MIID (EMC0_BA+0x094) /*!< MII Management Data Register */ - #define REG_EMAC0_MIIDA (EMC0_BA+0x098) /*!< MII Management Control and Address Register */ - #define REG_EMAC0_FFTCR (EMC0_BA+0x09C) /*!< FIFO Threshold Control Register */ - #define REG_EMAC0_TSDR (EMC0_BA+0x0a0) /*!< Transmit Start Demand Register */ - #define REG_EMAC0_RSDR (EMC0_BA+0x0a4) /*!< Receive Start Demand Register */ - #define REG_EMAC0_DMARFC (EMC0_BA+0x0a8) /*!< Maximum Receive Frame Control Register */ - #define REG_EMAC0_MIEN (EMC0_BA+0x0ac) /*!< MAC Interrupt Enable Register */ - #define REG_EMAC0_MISTA (EMC0_BA+0x0b0) /*!< MAC Interrupt Status Register */ - #define REG_EMAC0_MGSTA (EMC0_BA+0x0b4) /*!< MAC General Status Register */ - #define REG_EMAC0_MPCNT (EMC0_BA+0x0b8) /*!< Missed Packet Count Register */ - #define REG_EMAC0_MRPC (EMC0_BA+0x0bc) /*!< MAC Receive Pause Count Register */ - #define REG_EMAC0_DMARFS (EMC0_BA+0x0c8) /*!< DMA Receive Frame Status Register */ - #define REG_EMAC0_CTXDSA (EMC0_BA+0x0cc) /*!< Current Transmit Descriptor Start Address Register */ - #define REG_EMAC0_CTXBSA (EMC0_BA+0x0d0) /*!< Current Transmit Buffer Start Address Register */ - #define REG_EMAC0_CRXDSA (EMC0_BA+0x0d4) /*!< Current Receive Descriptor Start Address Register */ - #define REG_EMAC0_CRXBSA (EMC0_BA+0x0d8) /*!< Current Receive Buffer Start Address Register */ - #define REG_EMAC0_TSCTL (EMC0_BA+0x100) /*!< Time Stamp Control Register */ - #define REG_EMAC0_TSSEC (EMC0_BA+0x110) /*!< Time Stamp Counter Second Register */ - #define REG_EMAC0_TSSUBSEC (EMC0_BA+0x114) /*!< Time Stamp Counter Sub Second Register */ - #define REG_EMAC0_TSINC (EMC0_BA+0x118) /*!< Time Stamp Increment Register */ - #define REG_EMAC0_TSADDEN (EMC0_BA+0x11c) /*!< Time Stamp Addend Register */ - #define REG_EMAC0_TSUPDSEC (EMC0_BA+0x120) /*!< Time Stamp Update Second Register */ - #define REG_EMAC0_TSUPDSUBSEC (EMC0_BA+0x124) /*!< Time Stamp Update Sub Second Register */ - #define REG_EMAC0_TSALMSEC (EMC0_BA+0x128) /*!< Time Stamp Alarm Second Register */ - #define REG_EMAC0_TSALMSUBSEC (EMC0_BA+0x12c) /*!< Time Stamp Alarm Sub Second Register */ - - #define REG_EMAC1_CAMCMR (EMC1_BA+0x000) /*!< CAM Command Register */ - #define REG_EMAC1_CAMEN (EMC1_BA+0x004) /*!< CAM Enable Register */ - #define REG_EMAC1_CAM0M (EMC1_BA+0x008) /*!< CAM0 Most Significant Word Register */ - #define REG_EMAC1_CAM0L (EMC1_BA+0x00c) /*!< CAM0 Least Significant Word Register */ - #define REG_EMAC1_CAMxM_Reg(x)(REG_EMAC1_CAM0M+(x)*0x8) /*!< CAMx Most Significant Word Register */ - #define REG_EMAC1_CAMxL_Reg(x)(REG_EMAC1_CAM0L+(x)*0x8) /*!< CAMx Least Significant Word Register */ - #define REG_EMAC1_TXDLSA (EMC1_BA+0x088) /*!< Transmit Descriptor Link List Start Address Register */ - #define REG_EMAC1_RXDLSA (EMC1_BA+0x08C) /*!< Receive Descriptor Link List Start Address Register */ - #define REG_EMAC1_MCMDR (EMC1_BA+0x090) /*!< MAC Command Register */ - #define REG_EMAC1_MIID (EMC1_BA+0x094) /*!< MII Management Data Register */ - #define REG_EMAC1_MIIDA (EMC1_BA+0x098) /*!< MII Management Control and Address Register */ - #define REG_EMAC1_FFTCR (EMC1_BA+0x09C) /*!< FIFO Threshold Control Register */ - #define REG_EMAC1_TSDR (EMC1_BA+0x0a0) /*!< Transmit Start Demand Register */ - #define REG_EMAC1_RSDR (EMC1_BA+0x0a4) /*!< Receive Start Demand Register */ - #define REG_EMAC1_DMARFC (EMC1_BA+0x0a8) /*!< Maximum Receive Frame Control Register */ - #define REG_EMAC1_MIEN (EMC1_BA+0x0ac) /*!< MAC Interrupt Enable Register */ - #define REG_EMAC1_MISTA (EMC1_BA+0x0b0) /*!< MAC Interrupt Status Register */ - #define REG_EMAC1_MGSTA (EMC1_BA+0x0b4) /*!< MAC General Status Register */ - #define REG_EMAC1_MPCNT (EMC1_BA+0x0b8) /*!< Missed Packet Count Register */ - #define REG_EMAC1_MRPC (EMC1_BA+0x0bc) /*!< MAC Receive Pause Count Register */ - #define REG_EMAC1_DMARFS (EMC1_BA+0x0c8) /*!< DMA Receive Frame Status Register */ - #define REG_EMAC1_CTXDSA (EMC1_BA+0x0cc) /*!< Current Transmit Descriptor Start Address Register */ - #define REG_EMAC1_CTXBSA (EMC1_BA+0x0d0) /*!< Current Transmit Buffer Start Address Register */ - #define REG_EMAC1_CRXDSA (EMC1_BA+0x0d4) /*!< Current Receive Descriptor Start Address Register */ - #define REG_EMAC1_CRXBSA (EMC1_BA+0x0d8) /*!< Current Receive Buffer Start Address Register */ - #define REG_EMAC1_TSCTL (EMC1_BA+0x100) /*!< Time Stamp Control Register */ - #define REG_EMAC1_TSSEC (EMC1_BA+0x110) /*!< Time Stamp Counter Second Register */ - #define REG_EMAC1_TSSUBSEC (EMC1_BA+0x114) /*!< Time Stamp Counter Sub Second Register */ - #define REG_EMAC1_TSINC (EMC1_BA+0x118) /*!< Time Stamp Increment Register */ - #define REG_EMAC1_TSADDEN (EMC1_BA+0x11c) /*!< Time Stamp Addend Register */ - #define REG_EMAC1_TSUPDSEC (EMC1_BA+0x120) /*!< Time Stamp Update Second Register */ - #define REG_EMAC1_TSUPDSUBSEC (EMC1_BA+0x124) /*!< Time Stamp Update Sub Second Register */ - #define REG_EMAC1_TSALMSEC (EMC1_BA+0x128) /*!< Time Stamp Alarm Second Register */ - #define REG_EMAC1_TSALMSUBSEC (EMC1_BA+0x12c) /*!< Time Stamp Alarm Sub Second Register */ - - /**@}*/ /* end of EMAC register group */ - - - - /*---------------------- USB Device Controller -------------------------*/ - /** - @addtogroup USBD USB Device Controller(USBD) - Memory Mapped Structure for USBD Controller - @{ */ - #define REG_USBD_GINTSTS (USBD_BA+0x00) /*!< Interrupt Status Low Register */ - #define REG_USBD_GINTEN (USBD_BA+0x08) /*!< Interrupt Enable Low Register */ - #define REG_USBD_BUSINTSTS (USBD_BA+0x10) /*!< USB Bus Interrupt Status Register */ - #define REG_USBD_BUSINTEN (USBD_BA+0x14) /*!< USB Bus Interrupt Enable Register */ - #define REG_USBD_OPER (USBD_BA+0x18) /*!< USB Operational Register */ - #define REG_USBD_FRAMECNT (USBD_BA+0x1C) /*!< USB Frame Count Register */ - #define REG_USBD_FADDR (USBD_BA+0x20) /*!< USB Function Address Register */ - #define REG_USBD_TEST (USBD_BA+0x24) /*!< USB Test Mode Register */ - #define REG_USBD_CEPDAT (USBD_BA+0x28) /*!< Control-ep data buffer register */ - #define REG_USBD_CEPCTL (USBD_BA+0x2C) /*!< Control-ep control and status register */ - #define REG_USBD_CEPINTEN (USBD_BA+0x30) /*!< Control-ep interrupt enable register */ - #define REG_USBD_CEPINTSTS (USBD_BA+0x34) /*!< Control-ep interrupt status register */ - #define REG_USBD_CEPTXCNT (USBD_BA+0x38) /*!< In-transfer data count register */ - #define REG_USBD_CEPRXCNT (USBD_BA+0x3C) /*!< Out-transfer data count register */ - #define REG_USBD_CEPDATCNT (USBD_BA+0x40) /*!< Control-ep data count register */ - #define REG_USBD_SETUP1_0 (USBD_BA+0x44) /*!< Setup byte1 & byte0 register */ - #define REG_USBD_SETUP3_2 (USBD_BA+0x48) /*!< Setup byte3 & byte2 register */ - #define REG_USBD_SETUP5_4 (USBD_BA+0x4C) /*!< Setup byte5 & byte4 register */ - #define REG_USBD_SETUP7_6 (USBD_BA+0x50) /*!< Setup byte7 & byte6 register */ - #define REG_USBD_CEPBUFSTART (USBD_BA+0x54) /*!< Control-ep ram start address register */ - #define REG_USBD_CEPBUFEND (USBD_BA+0x58) /*!< Control-ep ram end address register */ - #define REG_USBD_DMACTL (USBD_BA+0x5C) /*!< Dma control and status register */ - #define REG_USBD_DMACNT (USBD_BA+0x60) /*!< Dma count register */ - - #define REG_USBD_EPADAT (USBD_BA+0x64) /*!< Endpoint A data buffer register */ - #define REG_USBD_EPAINTSTS (USBD_BA+0x68) /*!< Endpoint A interrupt status register */ - #define REG_USBD_EPAINTEN (USBD_BA+0x6C) /*!< Endpoint A interrupt enable register */ - #define REG_USBD_EPADATCNT (USBD_BA+0x70) /*!< Data count available in endpoint A buffer */ - #define REG_USBD_EPARSPCTL (USBD_BA+0x74) /*!< Endpoint A response register set/clear */ - #define REG_USBD_EPAMPS (USBD_BA+0x78) /*!< Endpoint A max packet size register */ - #define REG_USBD_EPATXCNT (USBD_BA+0x7C) /*!< Endpoint A transfer count register */ - #define REG_USBD_EPACFG (USBD_BA+0x80) /*!< Endpoint A configuration register */ - #define REG_USBD_EPABUFSTART (USBD_BA+0x84) /*!< Endpoint A ram start address register */ - #define REG_USBD_EPABUFEND (USBD_BA+0x88) /*!< Endpoint A ram end address register */ - - #define REG_USBD_EPBDAT (USBD_BA+0x8C) /*!< Endpoint B data buffer register */ - #define REG_USBD_EPBINTSTS (USBD_BA+0x90) /*!< Endpoint B interrupt status register */ - #define REG_USBD_EPBINTEN (USBD_BA+0x94) /*!< Endpoint B interrupt enable register */ - #define REG_USBD_EPBDATCNT (USBD_BA+0x98) /*!< Data count available in endpoint B buffer */ - #define REG_USBD_EPBRSPCTL (USBD_BA+0x9C) /*!< Endpoint B response register set/clear */ - #define REG_USBD_EPBMPS (USBD_BA+0xA0) /*!< Endpoint B max packet size register */ - #define REG_USBD_EPBTXCNT (USBD_BA+0xA4) /*!< Endpoint B transfer count register */ - #define REG_USBD_EPBCFG (USBD_BA+0xA8) /*!< Endpoint B configuration register */ - #define REG_USBD_EPBBUFSTART (USBD_BA+0xAC) /*!< Endpoint B ram start address register */ - #define REG_USBD_EPBBUFEND (USBD_BA+0xB0) /*!< Endpoint B ram end address register */ - - #define REG_USBD_EPCDAT (USBD_BA+0xB4) /*!< Endpoint C data buffer register */ - #define REG_USBD_EPCINTSTS (USBD_BA+0xB8) /*!< Endpoint C interrupt status register */ - #define REG_USBD_EPCINTEN (USBD_BA+0xBC) /*!< Endpoint C interrupt enable register */ - #define REG_USBD_EPCDATCNT (USBD_BA+0xC0) /*!< Data count available in endpoint C buffer */ - #define REG_USBD_EPCRSPCTL (USBD_BA+0xC4) /*!< Endpoint C response register set/clear */ - #define REG_USBD_EPCMPS (USBD_BA+0xC8) /*!< Endpoint C max packet size register */ - #define REG_USBD_EPCTXCNT (USBD_BA+0xCC) /*!< Endpoint C transfer count register */ - #define REG_USBD_EPCCFG (USBD_BA+0xD0) /*!< Endpoint C configuration register */ - #define REG_USBD_EPCBUFSTART (USBD_BA+0xD4) /*!< Endpoint C ram start address register */ - #define REG_USBD_EPCBUFEND (USBD_BA+0xD8) /*!< Endpoint C ram end address register */ - - #define REG_USBD_EPDDAT (USBD_BA+0xDC) /*!< Endpoint D data buffer register */ - #define REG_USBD_EPDINTSTS (USBD_BA+0xE0) /*!< Endpoint D interrupt status register */ - #define REG_USBD_EPDINTEN (USBD_BA+0xE4) /*!< Endpoint D interrupt enable register */ - #define REG_USBD_EPDDATCNT (USBD_BA+0xE8) /*!< Data count available in endpoint D buffer */ - #define REG_USBD_EPDRSPCTL (USBD_BA+0xEC) /*!< Endpoint D response register set/clear */ - #define REG_USBD_EPDMPS (USBD_BA+0xF0) /*!< Endpoint D max packet size register */ - #define REG_USBD_EPDTXCNT (USBD_BA+0xF4) /*!< Endpoint D transfer count register */ - #define REG_USBD_EPDCFG (USBD_BA+0xF8) /*!< Endpoint D configuration register */ - #define REG_USBD_EPDBUFSTART (USBD_BA+0xFC) /*!< Endpoint D ram start address register */ - #define REG_USBD_EPDBUFEND (USBD_BA+0x100) /*!< Endpoint D ram end address register */ - - #define REG_USBD_EPEDAT (USBD_BA+0x104) /*!< Endpoint E data buffer register */ - #define REG_USBD_EPEINTSTS (USBD_BA+0x108) /*!< Endpoint E interrupt status register */ - #define REG_USBD_EPEINTEN (USBD_BA+0x10C) /*!< Endpoint E interrupt enable register */ - #define REG_USBD_EPEDATCNT (USBD_BA+0x110) /*!< Data count available in endpoint E buffer */ - #define REG_USBD_EPERSPCTL (USBD_BA+0x114) /*!< Endpoint E response register set/clear */ - #define REG_USBD_EPEMPS (USBD_BA+0x118) /*!< Endpoint E max packet size register */ - #define REG_USBD_EPETXCNT (USBD_BA+0x11C) /*!< Endpoint E transfer count register */ - #define REG_USBD_EPECFG (USBD_BA+0x120) /*!< Endpoint E configuration register */ - #define REG_USBD_EPEBUFSTART (USBD_BA+0x124) /*!< Endpoint E ram start address register */ - #define REG_USBD_EPEBUFEND (USBD_BA+0x128) /*!< Endpoint E ram end address register */ - - #define REG_USBD_EPFDAT (USBD_BA+0x12C) /*!< Endpoint F data buffer register */ - #define REG_USBD_EPFINTSTS (USBD_BA+0x130) /*!< Endpoint F interrupt status register */ - #define REG_USBD_EPFINTEN (USBD_BA+0x134) /*!< Endpoint F interrupt enable register */ - #define REG_USBD_EPFDATCNT (USBD_BA+0x138) /*!< Data count available in endpoint F buffer */ - #define REG_USBD_EPFRSPCTL (USBD_BA+0x13C) /*!< Endpoint F response register set/clear */ - #define REG_USBD_EPFMPS (USBD_BA+0x140) /*!< Endpoint F max packet size register */ - #define REG_USBD_EPFTXCNT (USBD_BA+0x144) /*!< Endpoint F transfer count register */ - #define REG_USBD_EPFCFG (USBD_BA+0x148) /*!< Endpoint F configuration register */ - #define REG_USBD_EPFBUFSTART (USBD_BA+0x14C) /*!< Endpoint F ram start address register */ - #define REG_USBD_EPFBUFEND (USBD_BA+0x150) /*!< Endpoint F ram end address register */ - - #define REG_USBD_EPGDAT (USBD_BA+0x154) /*!< Endpoint G data buffer register */ - #define REG_USBD_EPGINTSTS (USBD_BA+0x158) /*!< Endpoint G interrupt status register */ - #define REG_USBD_EPGINTEN (USBD_BA+0x15C) /*!< Endpoint G interrupt enable register */ - #define REG_USBD_EPGDATCNT (USBD_BA+0x160) /*!< Data count available in endpoint G buffer */ - #define REG_USBD_EPGRSPCTL (USBD_BA+0x164) /*!< Endpoint G response register set/clear */ - #define REG_USBD_EPGMPS (USBD_BA+0x168) /*!< Endpoint G max packet size register */ - #define REG_USBD_EPGTXCNT (USBD_BA+0x16C) /*!< Endpoint G transfer count register */ - #define REG_USBD_EPGCFG (USBD_BA+0x170) /*!< Endpoint G configuration register */ - #define REG_USBD_EPGBUFSTART (USBD_BA+0x174) /*!< Endpoint G ram start address register */ - #define REG_USBD_EPGBUFEND (USBD_BA+0x178) /*!< Endpoint G ram end address register */ - - #define REG_USBD_EPHDAT (USBD_BA+0x17C) /*!< Endpoint H data buffer register */ - #define REG_USBD_EPHINTSTS (USBD_BA+0x180) /*!< Endpoint H interrupt status register */ - #define REG_USBD_EPHINTEN (USBD_BA+0x184) /*!< Endpoint H interrupt enable register */ - #define REG_USBD_EPHDATCNT (USBD_BA+0x188) /*!< Data count available in endpoint H buffer */ - #define REG_USBD_EPHRSPCTL (USBD_BA+0x18C) /*!< Endpoint H response register set/clear */ - #define REG_USBD_EPHMPS (USBD_BA+0x190) /*!< Endpoint H max packet size register */ - #define REG_USBD_EPHTXCNT (USBD_BA+0x194) /*!< Endpoint H transfer count register */ - #define REG_USBD_EPHCFG (USBD_BA+0x198) /*!< Endpoint H configuration register */ - #define REG_USBD_EPHBUFSTART (USBD_BA+0x19C) /*!< Endpoint H ram start address register */ - #define REG_USBD_EPHBUFEND (USBD_BA+0x1A0) /*!< Endpoint H ram end address register */ - - #define REG_USBD_EPIDAT (USBD_BA+0x1A4) /*!< Endpoint I data buffer register */ - #define REG_USBD_EPIINTSTS (USBD_BA+0x1A8) /*!< Endpoint I interrupt status register */ - #define REG_USBD_EPIINTEN (USBD_BA+0x1AC) /*!< Endpoint I interrupt enable register */ - #define REG_USBD_EPIDATCNT (USBD_BA+0x1B0) /*!< Data count available in endpoint I buffer */ - #define REG_USBD_EPIRSPCTL (USBD_BA+0x1B4) /*!< Endpoint I response register set/clear */ - #define REG_USBD_EPIMPS (USBD_BA+0x1B8) /*!< Endpoint I max packet size register */ - #define REG_USBD_EPITXCNT (USBD_BA+0x1BC) /*!< Endpoint I transfer count register */ - #define REG_USBD_EPICFG (USBD_BA+0x1C0) /*!< Endpoint I configuration register */ - #define REG_USBD_EPIBUFSTART (USBD_BA+0x1C4) /*!< Endpoint I ram start address register */ - #define REG_USBD_EPIBUFEND (USBD_BA+0x1C8) /*!< Endpoint I ram end address register */ - - #define REG_USBD_EPJDAT (USBD_BA+0x1CC) /*!< Endpoint J data buffer register */ - #define REG_USBD_EPJINTSTS (USBD_BA+0x1D0) /*!< Endpoint J interrupt status register */ - #define REG_USBD_EPJINTEN (USBD_BA+0x1D4) /*!< Endpoint J interrupt enable register */ - #define REG_USBD_EPJDATCNT (USBD_BA+0x1D8) /*!< Data count available in endpoint J buffer */ - #define REG_USBD_EPJRSPCTL (USBD_BA+0x1DC) /*!< Endpoint J response register set/clear */ - #define REG_USBD_EPJMPS (USBD_BA+0x1E0) /*!< Endpoint J max packet size register */ - #define REG_USBD_EPJTXCNT (USBD_BA+0x1E4) /*!< Endpoint J transfer count register */ - #define REG_USBD_EPJCFG (USBD_BA+0x1E8) /*!< Endpoint J configuration register */ - #define REG_USBD_EPJBUFSTART (USBD_BA+0x1EC) /*!< Endpoint J ram start address register */ - #define REG_USBD_EPJBUFEND (USBD_BA+0x1F0) /*!< Endpoint J ram end address register */ - - #define REG_USBD_EPKDAT (USBD_BA+0x1F4) /*!< Endpoint K data buffer register */ - #define REG_USBD_EPKINTSTS (USBD_BA+0x1F8) /*!< Endpoint K interrupt status register */ - #define REG_USBD_EPKINTEN (USBD_BA+0x1FC) /*!< Endpoint K interrupt enable register */ - #define REG_USBD_EPKDATCNT (USBD_BA+0x200) /*!< Data count available in endpoint K buffer */ - #define REG_USBD_EPKRSPCTL (USBD_BA+0x204) /*!< Endpoint K response register set/clear */ - #define REG_USBD_EPKMPS (USBD_BA+0x208) /*!< Endpoint K max packet size register */ - #define REG_USBD_EPKTXCNT (USBD_BA+0x20C) /*!< Endpoint K transfer count register */ - #define REG_USBD_EPKCFG (USBD_BA+0x210) /*!< Endpoint K configuration register */ - #define REG_USBD_EPKBUFSTART (USBD_BA+0x214) /*!< Endpoint K ram start address register */ - #define REG_USBD_EPKBUFEND (USBD_BA+0x218) /*!< Endpoint K ram end address register */ - - #define REG_USBD_EPLDAT (USBD_BA+0x21C) /*!< Endpoint L data buffer register */ - #define REG_USBD_EPLINTSTS (USBD_BA+0x220) /*!< Endpoint L interrupt status register */ - #define REG_USBD_EPLINTEN (USBD_BA+0x224) /*!< Endpoint L interrupt enable register */ - #define REG_USBD_EPLDATCNT (USBD_BA+0x228) /*!< Data count available in endpoint L buffer */ - #define REG_USBD_EPLRSPCTL (USBD_BA+0x22C) /*!< Endpoint L response register set/clear */ - #define REG_USBD_EPLMPS (USBD_BA+0x230) /*!< Endpoint L max packet size register */ - #define REG_USBD_EPLTXCNT (USBD_BA+0x234) /*!< Endpoint L transfer count register */ - #define REG_USBD_EPLCFG (USBD_BA+0x238) /*!< Endpoint L configuration register */ - #define REG_USBD_EPLBUFSTART (USBD_BA+0x23C) /*!< Endpoint L ram start address register */ - #define REG_USBD_EPLBUFEND (USBD_BA+0x240) /*!< Endpoint L ram end address register */ - #define REG_USBD_DMAADDR (USBD_BA+0x700) /*!< AHB_DMA address register */ - #define REG_USBD_PHYCTL (USBD_BA+0x704) /*!< USB PHY control register */ - - /**@}*/ /* end of USBD register group */ - - - /*---------------------- I2S Interface Controller -------------------------*/ - /** - @addtogroup I2S I2S Interface Controller(I2S) - Memory Mapped Structure for I2S Controller - @{ */ - - #define REG_I2S_CON (I2S_BA+0x00) /*!< Audio controller control register */ - #define REG_I2S_RESET (I2S_BA+0x04) /*!< Sub block reset control register */ - #define REG_I2S_RDESB (I2S_BA+0x08) /*!< DMA destination base address register for record */ - #define REG_I2S_RDES_LENGTH (I2S_BA+0x0C) /*!< DMA destination length register for record */ - #define REG_I2S_RDESC (I2S_BA+0x10) /*!< DMA destination current address for record */ - #define REG_I2S_PDESB (I2S_BA+0x14) /*!< DMA destination current address for play */ - #define REG_I2S_PDES_LENGTH (I2S_BA+0x18) /*!< DMA destination length register for play */ - #define REG_I2S_PDESC (I2S_BA+0x1C) /*!< DMA destination current address register for play */ - #define REG_I2S_RSR (I2S_BA+0x20) /*!< Record status register */ - #define REG_I2S_PSR (I2S_BA+0x24) /*!< Play status register */ - #define REG_I2S_I2SCON (I2S_BA+0x28) /*!< I2S control register */ - #define REG_I2S_COUNTER (I2S_BA+0x2C) /*!< DMA count down values */ - #define REG_I2S_PCMCON (I2S_BA+0x30) /*!< PCM interface control register */ - #define REG_I2S_PCMS1ST (I2S_BA+0x34) /*!< PCM interface slot1 start register */ - #define REG_I2S_PCMS2ST (I2S_BA+0x38) /*!< PCM interface slot2 start register */ - #define REG_I2S_RDESB2 (I2S_BA+0x40) /*!< DMA destination base address register for record right channel */ - #define REG_I2S_PDESB2 (I2S_BA+0x44) /*!< DMA destination base address register for play right channel */ - - /**@}*/ /* end of I2S register group */ - - - /*---------------------- Flash Memory Interface -------------------------*/ - /** - @addtogroup FMI Flash Memory Interface(FMI) - Memory Mapped Structure for FMI Controller - @{ */ - - /* DMAC Control Registers*/ - #define REG_FMI_BUFFER (FMI_BA+0x000) /*!< FMI Embedded Buffer Word */ - #define REG_FMI_DMACTL (FMI_BA+0x400) /*!< FMI DMA Control Register */ - #define REG_FMI_DMASA (FMI_BA+0x408) /*!< FMI DMA Transfer Starting Address Register */ - #define REG_FMI_DMABCNT (FMI_BA+0x40C) /*!< FMI DMA Transfer Byte Count Register */ - #define REG_FMI_DMAINTEN (FMI_BA+0x410) /*!< FMI DMA Interrupt Enable Register */ - #define REG_FMI_DMAINTSTS (FMI_BA+0x414) /*!< FMI DMA Interrupt Status Register */ - - #define REG_FMI_CTL (FMI_BA+0x800) /*!< Global Control and Status Register */ - #define REG_FMI_INTEN (FMI_BA+0x804) /*!< Global Interrupt Control Register */ - #define REG_FMI_INTSTS (FMI_BA+0x808) /*!< Global Interrupt Status Register */ - - /* eMMC Registers */ - #define REG_FMI_EMMCCTL (FMI_BA+0x820) /*!< eMMC control and status register */ - #define REG_FMI_EMMCCMD (FMI_BA+0x824) /*!< eMMC command argument register */ - #define REG_FMI_EMMCINTEN (FMI_BA+0x828) /*!< eMMC interrupt enable register */ - #define REG_FMI_EMMCINTSTS (FMI_BA+0x82C) /*!< eMMC interrupt status register */ - #define REG_FMI_EMMCRESP0 (FMI_BA+0x830) /*!< eMMC receive response token register 0 */ - #define REG_FMI_EMMCRESP1 (FMI_BA+0x834) /*!< eMMC receive response token register 1 */ - #define REG_FMI_EMMCBLEN (FMI_BA+0x838) /*!< eMMC block length register */ - #define REG_FMI_EMMCTOUT (FMI_BA+0x83C) /*!< eMMC block length register */ - - /* NAND-type Flash Registers */ - #define REG_NANDCTL (FMI_BA+0x8A0) /*!< NAND Flash Control and Status Register */ - #define REG_NANDTMCTL (FMI_BA+0x8A4) /*!< NAND Flash Timing Control Register */ - #define REG_NANDINTEN (FMI_BA+0x8A8) /*!< NAND Flash Interrupt Control Register */ - #define REG_NANDINTSTS (FMI_BA+0x8AC) /*!< NAND Flash Interrupt Status Register */ - #define REG_NANDCMD (FMI_BA+0x8B0) /*!< NAND Flash Command Port Register */ - #define REG_NANDADDR (FMI_BA+0x8B4) /*!< NAND Flash Address Port Register */ - #define REG_NANDDATA (FMI_BA+0x8B8) /*!< NAND Flash Data Port Register */ - #define REG_NANDRACTL (FMI_BA+0x8BC) /*!< NAND Flash Redundant Area Control Register */ - #define REG_NANDECTL (FMI_BA+0x8C0) /*!< NAND Flash Extend Control Regsiter */ - #define REG_NANDECCES0 (FMI_BA+0x8D0) /*!< NAND Flash ECC Error Status 0 */ - #define REG_NANDECCES1 (FMI_BA+0x8D4) /*!< NAND Flash ECC Error Status 1 */ - #define REG_NANDECCES2 (FMI_BA+0x8D8) /*!< NAND Flash ECC Error Status 2 */ - #define REG_NANDECCES3 (FMI_BA+0x8DC) /*!< NAND Flash ECC Error Status 3 */ - #define REG_NANDPROTA0 (FMI_BA+0x8E0) /*!< NAND Flash Protect Region End Address 0 */ - #define REG_NANDPROTA1 (FMI_BA+0x8E4) /*!< NAND Flash Protect Region End Address 1 */ - - /* NAND-type Flash BCH Error Address Registers */ - #define REG_NANDECCEA0 (FMI_BA+0x900) /*!< NAND Flash ECC Error Byte Address 0 */ - #define REG_NANDECCEA1 (FMI_BA+0x904) /*!< NAND Flash ECC Error Byte Address 1 */ - #define REG_NANDECCEA2 (FMI_BA+0x908) /*!< NAND Flash ECC Error Byte Address 2 */ - #define REG_NANDECCEA3 (FMI_BA+0x90C) /*!< NAND Flash ECC Error Byte Address 3 */ - #define REG_NANDECCEA4 (FMI_BA+0x910) /*!< NAND Flash ECC Error Byte Address 4 */ - #define REG_NANDECCEA5 (FMI_BA+0x914) /*!< NAND Flash ECC Error Byte Address 5 */ - #define REG_NANDECCEA6 (FMI_BA+0x918) /*!< NAND Flash ECC Error Byte Address 6 */ - #define REG_NANDECCEA7 (FMI_BA+0x91C) /*!< NAND Flash ECC Error Byte Address 7 */ - #define REG_NANDECCEA8 (FMI_BA+0x920) /*!< NAND Flash ECC Error Byte Address 8 */ - #define REG_NANDECCEA9 (FMI_BA+0x924) /*!< NAND Flash ECC Error Byte Address 9 */ - #define REG_NANDECCEA10 (FMI_BA+0x928) /*!< NAND Flash ECC Error Byte Address 10 */ - #define REG_NANDECCEA11 (FMI_BA+0x92C) /*!< NAND Flash ECC Error Byte Address 11 */ - - /* NAND-type Flash BCH Error Data Registers */ - #define REG_NANDECCED0 (FMI_BA+0x960) /*!< NAND Flash ECC Error Data Register 0 */ - #define REG_NANDECCED1 (FMI_BA+0x964) /*!< NAND Flash ECC Error Data Register 1 */ - #define REG_NANDECCED2 (FMI_BA+0x968) /*!< NAND Flash ECC Error Data Register 2 */ - #define REG_NANDECCED3 (FMI_BA+0x96C) /*!< NAND Flash ECC Error Data Register 3 */ - #define REG_NANDECCED4 (FMI_BA+0x970) /*!< NAND Flash ECC Error Data Register 4 */ - #define REG_NANDECCED5 (FMI_BA+0x974) /*!< NAND Flash ECC Error Data Register 5 */ - - /* NAND-type Flash Redundant Area Registers */ - #define REG_NANDRA0 (FMI_BA+0xA00) /*!< NAND Flash Redundant Area Register */ - #define REG_NANDRA1 (FMI_BA+0xA04) /*!< NAND Flash Redundant Area Register */ - - /**@}*/ /* end of FMI register group */ - - - /*---------------------- SD/SDIO Host Controller -------------------------*/ - /** - @addtogroup SDH SD/SDIO Host Controller(SDH) - Memory Mapped Structure for SDH Controller - @{ */ - - /* DMAC Control Registers*/ - #define REG_SDH_FB0 (SDH_BA+0x000) /*!< SD Host Embedded Buffer Word */ - #define REG_SDH_DMACTL (SDH_BA+0x400) /*!< SD Host DMA Control and Status Register */ - #define REG_SDH_DMASA (SDH_BA+0x408) /*!< SD Host DMA Transfer Starting Address Register */ - #define REG_SDH_DMABCNT (SDH_BA+0x40C) /*!< SD Host DMA Transfer Byte Count Register */ - #define REG_SDH_DMAINTEN (SDH_BA+0x410) /*!< SD Host DMA Interrupt Enable Register */ - #define REG_SDH_DMAINTSTS (SDH_BA+0x414) /*!< SD Host DMA Interrupt Status Register */ - - #define REG_SDH_GCTL (SDH_BA+0x800) /*!< SD Host Global Control and Status Register */ - #define REG_SDH_GINTEN (SDH_BA+0x804) /*!< SD Host Global Interrupt Control Register */ - #define REG_SDH_GINTSTS (SDH_BA+0x808) /*!< SD Host Global Interrupt Status Register */ - - /* Secure Digit Registers */ - #define REG_SDH_CTL (SDH_BA+0x820) /*!< SD Host control and status register */ - #define REG_SDH_CMD (SDH_BA+0x824) /*!< SD Host command argument register */ - #define REG_SDH_INTEN (SDH_BA+0x828) /*!< SD Host interrupt enable register */ - #define REG_SDH_INTSTS (SDH_BA+0x82C) /*!< SD Host interrupt status register */ - #define REG_SDH_RESP0 (SDH_BA+0x830) /*!< SD Host receive response token register 0 */ - #define REG_SDH_RESP1 (SDH_BA+0x834) /*!< SD Host receive response token register 1 */ - #define REG_SDH_BLEN (SDH_BA+0x838) /*!< SD Host block length register */ - #define REG_SDH_TMOUT (SDH_BA+0x83C) /*!< SD Host Response/Data-in Time-out register */ - #define REG_SDH_ECTL (SDH_BA+0x840) /*!< SD Host Extend Control Register */ - - /**@}*/ /* end of SDH register group */ - - /*---------------------- Serial Peripheral Interface Controller -------------------------*/ - /** - @addtogroup SPI Serial Peripheral Interface Controller(SPI) - Memory Mapped Structure for SPI Controller - @{ */ - - #define REG_QSPI0_CTL (QSPI0_BA+0x00) /*!< Control Register Address */ - #define REG_QSPI0_CLKDIV (QSPI0_BA+0x04) /*!< Divider Register Address */ - #define REG_QSPI0_SSCTL (QSPI0_BA+0x08) /*!< Slave Select Register Address */ - #define REG_QSPI0_PDMACTL (QSPI0_BA+0x0C) /*!< PDMA Control Register Address */ - #define REG_QSPI0_FIFOCTL (QSPI0_BA+0x10) /*!< FIFO Control Register Address */ - #define REG_QSPI0_STATUS (QSPI0_BA+0x14) /*!< Status Register Address */ - #define REG_QSPI0_TX (QSPI0_BA+0x20) /*!< Data Transmit Register Address */ - #define REG_QSPI0_RX (QSPI0_BA+0x30) /*!< Data Receive Register Address */ - - #define REG_SPI0_CTL (SPI0_BA+0x00) /*!< Control Register Address */ - #define REG_SPI0_CLKDIV (SPI0_BA+0x04) /*!< Divider Register Address */ - #define REG_SPI0_SSCTL (SPI0_BA+0x08) /*!< Slave Select Register Address */ - #define REG_SPI0_PDMACTL (SPI0_BA+0x0C) /*!< PDMA Control Register Address */ - #define REG_SPI0_FIFOCTL (SPI0_BA+0x10) /*!< FIFO Control Register Address */ - #define REG_SPI0_STATUS (SPI0_BA+0x14) /*!< Status Register Address */ - #define REG_SPI0_TX (SPI0_BA+0x20) /*!< Data Transmit Register Address */ - #define REG_SPI0_RX (SPI0_BA+0x30) /*!< Data Receive Register Address */ - - #define REG_SPI1_CTL (SPI1_BA+0x00) /*!< Control Register Address */ - #define REG_SPI1_CLKDIV (SPI1_BA+0x04) /*!< Divider Register Address */ - #define REG_SPI1_SSCTL (SPI1_BA+0x08) /*!< Slave Select Register Address */ - #define REG_SPI1_PDMACTL (SPI1_BA+0x0C) /*!< PDMA Control Register Address */ - #define REG_SPI1_FIFOCTL (SPI1_BA+0x10) /*!< FIFO Control Register Address */ - #define REG_SPI1_STATUS (SPI1_BA+0x14) /*!< Status Register Address */ - #define REG_SPI1_TX (SPI1_BA+0x20) /*!< Data Transmit Register Address */ - #define REG_SPI1_RX (SPI1_BA+0x30) /*!< Data Receive Register Address */ - - /**@}*/ /* end of SPI register group */ - - - - /*---------------------- Cryptographic Accelerator -------------------------*/ - /** - @addtogroup CRYPTO Cryptographic Accelerator(CRYPTO) - Memory Mapped Structure for Cryptographic Accelerator registers - @{ */ - - /* Crypto Control Registers */ - #define CRPT_INTEN (CRPT_BA+0x000) /*!< Crypto Interrupt Enable Control Register */ - #define CRPT_INTSTS (CRPT_BA+0x004) /*!< Crypto Interrupt Flag */ - - /* PRNG Registers */ - #define CRPT_PRNG_CTL (CRPT_BA+0x008) /*!< PRNG Control Register */ - #define CRPT_PRNG_SEED (CRPT_BA+0x00C) /*!< Seed for PRNG */ - #define CRPT_PRNG_KEY0 (CRPT_BA+0x010) /*!< PRNG Generated Key 0 */ - #define CRPT_PRNG_KEY1 (CRPT_BA+0x014) /*!< PRNG Generated Key 1 */ - #define CRPT_PRNG_KEY2 (CRPT_BA+0x018) /*!< PRNG Generated Key 2 */ - #define CRPT_PRNG_KEY3 (CRPT_BA+0x01C) /*!< PRNG Generated Key 3 */ - #define CRPT_PRNG_KEY4 (CRPT_BA+0x020) /*!< PRNG Generated Key 4 */ - #define CRPT_PRNG_KEY5 (CRPT_BA+0x024) /*!< PRNG Generated Key 5 */ - #define CRPT_PRNG_KEY6 (CRPT_BA+0x028) /*!< PRNG Generated Key 6 */ - #define CRPT_PRNG_KEY7 (CRPT_BA+0x02C) /*!< PRNG Generated Key 7 */ - - /* AES/TDES feedback Registers */ - #define CRPT_AES_FDBCK0 (CRPT_BA+0x050) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_AES_FDBCK1 (CRPT_BA+0x054) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_AES_FDBCK2 (CRPT_BA+0x058) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_AES_FDBCK3 (CRPT_BA+0x05C) /*!< AES Engine Output Feedback Data after Cryptographic Operation */ - #define CRPT_TDES_FDBCKH (CRPT_BA+0x060) /*!< TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation */ - #define CRPT_TDES_FDBCKL (CRPT_BA+0x064) /*!< TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation */ - - /* AES Control Registers */ - #define CRPT_AES_CTL (CRPT_BA+0x100) /*!< AES Control Register */ - #define CRPT_AES_STS (CRPT_BA+0x104) /*!< AES Engine Flag */ - #define CRPT_AES_DATIN (CRPT_BA+0x108) /*!< AES Engine Data Input Port Register */ - #define CRPT_AES_DATOUT (CRPT_BA+0x10C) /*!< AES Engine Data Output Port Register */ - #define CRPT_AES0_KEY0 (CRPT_BA+0x110) /*!< AES Key Word 0 Register for Channel 0 */ - #define CRPT_AES0_KEY1 (CRPT_BA+0x114) /*!< AES Key Word 1 Register for Channel 0 */ - #define CRPT_AES0_KEY2 (CRPT_BA+0x118) /*!< AES Key Word 2 Register for Channel 0 */ - #define CRPT_AES0_KEY3 (CRPT_BA+0x11C) /*!< AES Key Word 3 Register for Channel 0 */ - #define CRPT_AES0_KEY4 (CRPT_BA+0x120) /*!< AES Key Word 4 Register for Channel 0 */ - #define CRPT_AES0_KEY5 (CRPT_BA+0x124) /*!< AES Key Word 5 Register for Channel 0 */ - #define CRPT_AES0_KEY6 (CRPT_BA+0x128) /*!< AES Key Word 6 Register for Channel 0 */ - #define CRPT_AES0_KEY7 (CRPT_BA+0x12C) /*!< AES Key Word 7 Register for Channel 0 */ - #define CRPT_AES0_IV0 (CRPT_BA+0x130) /*!< AES Initial Vector Word 0 Register for Channel 0 */ - #define CRPT_AES0_IV1 (CRPT_BA+0x134) /*!< AES Initial Vector Word 1 Register for Channel 0 */ - #define CRPT_AES0_IV2 (CRPT_BA+0x138) /*!< AES Initial Vector Word 2 Register for Channel 0 */ - #define CRPT_AES0_IV3 (CRPT_BA+0x13C) /*!< AES Initial Vector Word 3 Register for Channel 0 */ - #define CRPT_AES0_SADDR (CRPT_BA+0x140) /*!< AES DMA Source Address Register for Channel 0 */ - #define CRPT_AES0_DADDR (CRPT_BA+0x144) /*!< AES DMA Destination Address Register for Channel 0 */ - #define CRPT_AES0_CNT (CRPT_BA+0x148) /*!< AES Byte Count Register for Channel 0 */ - #define CRPT_AES1_KEY0 (CRPT_BA+0x14C) /*!< AES Key Word 0 Register for Channel 1 */ - #define CRPT_AES1_KEY1 (CRPT_BA+0x150) /*!< AES Key Word 1 Register for Channel 1 */ - #define CRPT_AES1_KEY2 (CRPT_BA+0x154) /*!< AES Key Word 2 Register for Channel 1 */ - #define CRPT_AES1_KEY3 (CRPT_BA+0x158) /*!< AES Key Word 3 Register for Channel 1 */ - #define CRPT_AES1_KEY4 (CRPT_BA+0x15C) /*!< AES Key Word 4 Register for Channel 1 */ - #define CRPT_AES1_KEY5 (CRPT_BA+0x160) /*!< AES Key Word 5 Register for Channel 1 */ - #define CRPT_AES1_KEY6 (CRPT_BA+0x164) /*!< AES Key Word 6 Register for Channel 1 */ - #define CRPT_AES1_KEY7 (CRPT_BA+0x168) /*!< AES Key Word 7 Register for Channel 1 */ - #define CRPT_AES1_IV0 (CRPT_BA+0x16C) /*!< AES Initial Vector Word 0 Register for Channel 1 */ - #define CRPT_AES1_IV1 (CRPT_BA+0x170) /*!< AES Initial Vector Word 1 Register for Channel 1 */ - #define CRPT_AES1_IV2 (CRPT_BA+0x174) /*!< AES Initial Vector Word 2 Register for Channel 1 */ - #define CRPT_AES1_IV3 (CRPT_BA+0x178) /*!< AES Initial Vector Word 3 Register for Channel 1 */ - #define CRPT_AES1_SADDR (CRPT_BA+0x17C) /*!< AES DMA Source Address Register for Channel 1 */ - #define CRPT_AES1_DADDR (CRPT_BA+0x180) /*!< AES DMA Destination Address Register for Channel 1 */ - #define CRPT_AES1_CNT (CRPT_BA+0x184) /*!< AES Byte Count Register for Channel 1 */ - #define CRPT_AES2_KEY0 (CRPT_BA+0x188) /*!< AES Key Word 0 Register for Channel 2 */ - #define CRPT_AES2_KEY1 (CRPT_BA+0x18C) /*!< AES Key Word 1 Register for Channel 2 */ - #define CRPT_AES2_KEY2 (CRPT_BA+0x190) /*!< AES Key Word 2 Register for Channel 2 */ - #define CRPT_AES2_KEY3 (CRPT_BA+0x194) /*!< AES Key Word 3 Register for Channel 2 */ - #define CRPT_AES2_KEY4 (CRPT_BA+0x198) /*!< AES Key Word 4 Register for Channel 2 */ - #define CRPT_AES2_KEY5 (CRPT_BA+0x19C) /*!< AES Key Word 5 Register for Channel 2 */ - #define CRPT_AES2_KEY6 (CRPT_BA+0x1A0) /*!< AES Key Word 6 Register for Channel 2 */ - #define CRPT_AES2_KEY7 (CRPT_BA+0x1A4) /*!< AES Key Word 7 Register for Channel 2 */ - #define CRPT_AES2_IV0 (CRPT_BA+0x1A8) /*!< AES Initial Vector Word 0 Register for Channel 2 */ - #define CRPT_AES2_IV1 (CRPT_BA+0x1AC) /*!< AES Initial Vector Word 1 Register for Channel 2 */ - #define CRPT_AES2_IV2 (CRPT_BA+0x1B0) /*!< AES Initial Vector Word 2 Register for Channel 2 */ - #define CRPT_AES2_IV3 (CRPT_BA+0x1B4) /*!< AES Initial Vector Word 3 Register for Channel 2 */ - #define CRPT_AES2_SADDR (CRPT_BA+0x1B8) /*!< AES DMA Source Address Register for Channel 2 */ - #define CRPT_AES2_DADDR (CRPT_BA+0x1BC) /*!< AES DMA Destination Address Register for Channel 2 */ - #define CRPT_AES2_CNT (CRPT_BA+0x1C0) /*!< AES Byte Count Register for Channel 2 */ - #define CRPT_AES3_KEY0 (CRPT_BA+0x1C4) /*!< AES Key Word 0 Register for Channel 3 */ - #define CRPT_AES3_KEY1 (CRPT_BA+0x1C8) /*!< AES Key Word 1 Register for Channel 3 */ - #define CRPT_AES3_KEY2 (CRPT_BA+0x1CC) /*!< AES Key Word 2 Register for Channel 3 */ - #define CRPT_AES3_KEY3 (CRPT_BA+0x1D0) /*!< AES Key Word 3 Register for Channel 3 */ - #define CRPT_AES3_KEY4 (CRPT_BA+0x1D4) /*!< AES Key Word 4 Register for Channel 3 */ - #define CRPT_AES3_KEY5 (CRPT_BA+0x1D8) /*!< AES Key Word 5 Register for Channel 3 */ - #define CRPT_AES3_KEY6 (CRPT_BA+0x1DC) /*!< AES Key Word 6 Register for Channel 3 */ - #define CRPT_AES3_KEY7 (CRPT_BA+0x1E0) /*!< AES Key Word 7 Register for Channel 3 */ - #define CRPT_AES3_IV0 (CRPT_BA+0x1E4) /*!< AES Initial Vector Word 0 Register for Channel 3 */ - #define CRPT_AES3_IV1 (CRPT_BA+0x1E8) /*!< AES Initial Vector Word 1 Register for Channel 3 */ - #define CRPT_AES3_IV2 (CRPT_BA+0x1EC) /*!< AES Initial Vector Word 2 Register for Channel 3 */ - #define CRPT_AES3_IV3 (CRPT_BA+0x1F0) /*!< AES Initial Vector Word 3 Register for Channel 3 */ - #define CRPT_AES3_SADDR (CRPT_BA+0x1F4) /*!< AES DMA Source Address Register for Channel 3 */ - #define CRPT_AES3_DADDR (CRPT_BA+0x1F8) /*!< AES DMA Destination Address Register for Channel 3 */ - #define CRPT_AES3_CNT (CRPT_BA+0x1FC) /*!< AES Byte Count Register for Channel 3 */ - - /* DES/TDES Control Registers */ - #define CRPT_TDES_CTL (CRPT_BA+0x200) /*!< TDES/DES Control Register */ - #define CRPT_TDES_STS (CRPT_BA+0x204) /*!< TDES/DES Engine Flag */ - #define CRPT_TDES0_KEY1H (CRPT_BA+0x208) /*!< TDES/DES Key 1 High Word Register for Channel 0 */ - #define CRPT_TDES0_KEY1L (CRPT_BA+0x20C) /*!< TDES/DES Key 1 Low Word Register for Channel 0 */ - #define CRPT_TDES0_KEY2H (CRPT_BA+0x210) /*!< TDES/DES Key 2 High Word Register for Channel 0 */ - #define CRPT_TDES0_KEY2L (CRPT_BA+0x214) /*!< TDES/DES Key 2 Low Word Register for Channel 0 */ - #define CRPT_TDES0_KEY3H (CRPT_BA+0x218) /*!< TDES/DES Key 3 High Word Register for Channel 0 */ - #define CRPT_TDES0_KEY3L (CRPT_BA+0x21C) /*!< TDES/DES Key 3 Low Word Register for Channel 0 */ - #define CRPT_TDES0_IVH (CRPT_BA+0x220) /*!< TDES/DES Initial Vector High Word Register for Channel 0 */ - #define CRPT_TDES0_IVL (CRPT_BA+0x224) /*!< TDES/DES Initial Vector Low Word Register for Channel 0 */ - #define CRPT_TDES0_SADDR (CRPT_BA+0x228) /*!< TDES/DES DMA Source Address Register for Channel 0 */ - #define CRPT_TDES0_DADDR (CRPT_BA+0x22C) /*!< TDES/DES DMA Destination Address Register for Channel 0 */ - #define CRPT_TDES0_CNT (CRPT_BA+0x230) /*!< TDES/DES Byte Count Register for Channel 0 */ - #define CRPT_TDES_DATIN (CRPT_BA+0x234) /*!< TDES/DES Engine Input data Word Register */ - #define CRPT_TDES_DATOUT (CRPT_BA+0x238) /*!< TDES/DES Engine Output data Word Register */ - #define CRPT_TDES1_KEY1H (CRPT_BA+0x248) /*!< TDES/DES Key 1 High Word Register for Channel 1 */ - #define CRPT_TDES1_KEY1L (CRPT_BA+0x24C) /*!< TDES/DES Key 1 Low Word Register for Channel 1 */ - #define CRPT_TDES1_KEY2H (CRPT_BA+0x250) /*!< TDES/DES Key 2 High Word Register for Channel 1 */ - #define CRPT_TDES1_KEY2L (CRPT_BA+0x254) /*!< TDES/DES Key 2 Low Word Register for Channel 1 */ - #define CRPT_TDES1_KEY3H (CRPT_BA+0x258) /*!< TDES/DES Key 3 High Word Register for Channel 1 */ - #define CRPT_TDES1_KEY3L (CRPT_BA+0x25C) /*!< TDES/DES Key 3 Low Word Register for Channel 1 */ - #define CRPT_TDES1_IVH (CRPT_BA+0x260) /*!< TDES/DES Initial Vector High Word Register for Channel 1 */ - #define CRPT_TDES1_IVL (CRPT_BA+0x264) /*!< TDES/DES Initial Vector Low Word Register for Channel 1 */ - #define CRPT_TDES1_SADDR (CRPT_BA+0x268) /*!< TDES/DES DMA Source Address Register for Channel 1 */ - #define CRPT_TDES1_DADDR (CRPT_BA+0x26C) /*!< TDES/DES DMA Destination Address Register for Channel 1 */ - #define CRPT_TDES1_CNT (CRPT_BA+0x270) /*!< TDES/DES Byte Count Register for Channel 1 */ - #define CRPT_TDES2_KEY1H (CRPT_BA+0x288) /*!< TDES/DES Key 1 High Word Register for Channel 2 */ - #define CRPT_TDES2_KEY1L (CRPT_BA+0x28C) /*!< TDES/DES Key 1 Low Word Register for Channel 2 */ - #define CRPT_TDES2_KEY2H (CRPT_BA+0x290) /*!< TDES/DES Key 2 High Word Register for Channel 2 */ - #define CRPT_TDES2_KEY2L (CRPT_BA+0x294) /*!< TDES/DES Key 2 Low Word Register for Channel 2 */ - #define CRPT_TDES2_KEY3H (CRPT_BA+0x298) /*!< TDES/DES Key 3 High Word Register for Channel 2 */ - #define CRPT_TDES2_KEY3L (CRPT_BA+0x29C) /*!< TDES/DES Key 3 Low Word Register for Channel 2 */ - #define CRPT_TDES2_IVH (CRPT_BA+0x2A0) /*!< TDES/DES Initial Vector High Word Register for Channel 2 */ - #define CRPT_TDES2_IVL (CRPT_BA+0x2A4) /*!< TDES/DES Initial Vector Low Word Register for Channel 2 */ - #define CRPT_TDES2_SADDR (CRPT_BA+0x2A8) /*!< TDES/DES DMA Source Address Register for Channel 2 */ - #define CRPT_TDES2_DADDR (CRPT_BA+0x2AC) /*!< TDES/DES DMA Destination Address Register for Channel 2 */ - #define CRPT_TDES2_CNT (CRPT_BA+0x2B0) /*!< TDES/DES Byte Count Register for Channel 3 */ - #define CRPT_TDES3_KEY1H (CRPT_BA+0x2C8) /*!< TDES/DES Key 1 High Word Register for Channel 3 */ - #define CRPT_TDES3_KEY1L (CRPT_BA+0x2CC) /*!< TDES/DES Key 1 Low Word Register for Channel 3 */ - #define CRPT_TDES3_KEY2H (CRPT_BA+0x2D0) /*!< TDES/DES Key 2 High Word Register for Channel 3 */ - #define CRPT_TDES3_KEY2L (CRPT_BA+0x2D4) /*!< TDES/DES Key 2 Low Word Register for Channel 3 */ - #define CRPT_TDES3_KEY3H (CRPT_BA+0x2D8) /*!< TDES/DES Key 3 High Word Register for Channel 3 */ - #define CRPT_TDES3_KEY3L (CRPT_BA+0x2DC) /*!< TDES/DES Key 3 Low Word Register for Channel 3 */ - #define CRPT_TDES3_IVH (CRPT_BA+0x2E0) /*!< TDES/DES Initial Vector High Word Register for Channel 3 */ - #define CRPT_TDES3_IVL (CRPT_BA+0x2E4) /*!< TDES/DES Initial Vector Low Word Register for Channel 3 */ - #define CRPT_TDES3_SADDR (CRPT_BA+0x2E8) /*!< TDES/DES DMA Source Address Register for Channel 3 */ - #define CRPT_TDES3_DADDR (CRPT_BA+0x2EC) /*!< TDES/DES DMA Destination Address Register for Channel 3 */ - #define CRPT_TDES3_CNT (CRPT_BA+0x2F0) /*!< TDES/DES Byte Count Register for Channel 3 */ - - /* SHA/HMAC Control Registers */ - #define CRPT_HMAC_CTL (CRPT_BA+0x300) /*!< SHA/HMAC Control Register */ - #define CRPT_HMAC_STS (CRPT_BA+0x304) /*!< SHA/HMAC Status Flag */ - #define CRPT_HMAC_DGST0 (CRPT_BA+0x308) /*!< SHA/HMAC Digest Message 0 */ - #define CRPT_HMAC_DGST1 (CRPT_BA+0x30C) /*!< SHA/HMAC Digest Message 1 */ - #define CRPT_HMAC_DGST2 (CRPT_BA+0x310) /*!< SHA/HMAC Digest Message 2 */ - #define CRPT_HMAC_DGST3 (CRPT_BA+0x314) /*!< SHA/HMAC Digest Message 3 */ - #define CRPT_HMAC_DGST4 (CRPT_BA+0x318) /*!< SHA/HMAC Digest Message 4 */ - #define CRPT_HMAC_DGST5 (CRPT_BA+0x31C) /*!< SHA/HMAC Digest Message 5 */ - #define CRPT_HMAC_DGST6 (CRPT_BA+0x320) /*!< SHA/HMAC Digest Message 6 */ - #define CRPT_HMAC_DGST7 (CRPT_BA+0x324) /*!< SHA/HMAC Digest Message 7 */ - #define CRPT_HMAC_DGST8 (CRPT_BA+0x328) /*!< SHA/HMAC Digest Message 8 */ - #define CRPT_HMAC_DGST9 (CRPT_BA+0x32C) /*!< SHA/HMAC Digest Message 8 */ - #define CRPT_HMAC_DGST10 (CRPT_BA+0x330) /*!< SHA/HMAC Digest Message 10 */ - #define CRPT_HMAC_DGST11 (CRPT_BA+0x334) /*!< SHA/HMAC Digest Message 11 */ - #define CRPT_HMAC_DGST12 (CRPT_BA+0x338) /*!< SHA/HMAC Digest Message 12 */ - #define CRPT_HMAC_DGST13 (CRPT_BA+0x33C) /*!< SHA/HMAC Digest Message 13 */ - #define CRPT_HMAC_DGST14 (CRPT_BA+0x340) /*!< SHA/HMAC Digest Message 14 */ - #define CRPT_HMAC_DGST15 (CRPT_BA+0x344) /*!< SHA/HMAC Digest Message 15 */ - #define CRPT_HMAC_KEYCNT (CRPT_BA+0x348) /*!< SHA/HMAC Key Byte Count */ - #define CRPT_HMAC_SADDR (CRPT_BA+0x34C) /*!< SHA/HMAC Key Byte Count */ - #define CRPT_HMAC_DMACNT (CRPT_BA+0x350) /*!< SHA/HMAC Byte Count Register */ - #define CRPT_HMAC_DATIN (CRPT_BA+0x354) /*!< SHA/HMAC Engine Non-DMA Mode Data Input Port Register */ - - /**@}*/ /* end of Cryptographic Accelerator register group */ - - - - - /*---------------------- Universal Asynchronous Receiver/Transmitter Controller -------------------------*/ - /** - @addtogroup UART Universal Asynchronous Receiver/Transmitter Controller(UART) - Memory Mapped Structure for UART Controller - @{ */ - - #define REG_UART0_RBR (UART0_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART0_THR (UART0_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART0_IER (UART0_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART0_FCR (UART0_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART0_LCR (UART0_BA+0x0C) /*!< Line Control Register */ - #define REG_UART0_MCR (UART0_BA+0x10) /*!< Modem Control Register */ - #define REG_UART0_MSR (UART0_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART0_FSR (UART0_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART0_ISR (UART0_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART0_TOR (UART0_BA+0x20) /*!< Time-out Register */ - #define REG_UART0_BAUD (UART0_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART0_IRCR (UART0_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART0_ALT_CSR (UART0_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART0_FUN_SEL (UART0_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART0_LIN_CTL (UART0_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART0_LIN_SR (UART0_BA+0x38) /*!< LIN Status Register */ - - - - - /* - UART1 Control Registers - */ - #define REG_UART1_RBR (UART1_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART1_THR (UART1_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART1_IER (UART1_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART1_FCR (UART1_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART1_LCR (UART1_BA+0x0C) /*!< Line Control Register */ - #define REG_UART1_MCR (UART1_BA+0x10) /*!< Modem Control Register */ - #define REG_UART1_MSR (UART1_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART1_FSR (UART1_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART1_ISR (UART1_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART1_TOR (UART1_BA+0x20) /*!< Time-out Register */ - #define REG_UART1_BAUD (UART1_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART1_IRCR (UART1_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART1_ALT_CSR (UART1_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART1_FUN_SEL (UART1_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART1_LIN_CTL (UART1_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART1_LIN_SR (UART1_BA+0x38) /*!< LIN Status Register */ - - /* - UART2 Control Registers - */ - #define REG_UART2_RBR (UART2_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART2_THR (UART2_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART2_IER (UART2_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART2_FCR (UART2_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART2_LCR (UART2_BA+0x0C) /*!< Line Control Register */ - #define REG_UART2_MCR (UART2_BA+0x10) /*!< Modem Control Register */ - #define REG_UART2_MSR (UART2_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART2_FSR (UART2_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART2_ISR (UART2_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART2_TOR (UART2_BA+0x20) /*!< Time-out Register */ - #define REG_UART2_BAUD (UART2_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART2_IRCR (UART2_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART2_ALT_CSR (UART2_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART2_FUN_SEL (UART2_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART2_LIN_CTL (UART2_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART2_LIN_SR (UART2_BA+0x38) /*!< LIN Status Register */ - - /* - UART3 Control Registers - */ - #define REG_UART3_RBR (UART3_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART3_THR (UART3_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART3_IER (UART3_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART3_FCR (UART3_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART3_LCR (UART3_BA+0x0C) /*!< Line Control Register */ - #define REG_UART3_MCR (UART3_BA+0x10) /*!< Modem Control Register */ - #define REG_UART3_MSR (UART3_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART3_FSR (UART3_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART3_ISR (UART3_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART3_TOR (UART3_BA+0x20) /*!< Time-out Register */ - #define REG_UART3_BAUD (UART3_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART3_IRCR (UART3_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART3_ALT_CSR (UART3_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART3_FUN_SEL (UART3_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART3_LIN_CTL (UART3_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART3_LIN_SR (UART3_BA+0x38) /*!< LIN Status Register */ - - - /* - UART4 Control Registers - */ - #define REG_UART4_RBR (UART4_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART4_THR (UART4_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART4_IER (UART4_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART4_FCR (UART4_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART4_LCR (UART4_BA+0x0C) /*!< Line Control Register */ - #define REG_UART4_MCR (UART4_BA+0x10) /*!< Modem Control Register */ - #define REG_UART4_MSR (UART4_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART4_FSR (UART4_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART4_ISR (UART4_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART4_TOR (UART4_BA+0x20) /*!< Time-out Register */ - #define REG_UART4_BAUD (UART4_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART4_IRCR (UART4_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART4_ALT_CSR (UART4_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART4_FUN_SEL (UART4_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART4_LIN_CTL (UART4_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART4_LIN_SR (UART4_BA+0x38) /*!< LIN Status Register */ - - /* - UART5 Control Registers - */ - #define REG_UART5_RBR (UART5_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART5_THR (UART5_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART5_IER (UART5_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART5_FCR (UART5_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART5_LCR (UART5_BA+0x0C) /*!< Line Control Register */ - #define REG_UART5_MCR (UART5_BA+0x10) /*!< Modem Control Register */ - #define REG_UART5_MSR (UART5_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART5_FSR (UART5_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART5_ISR (UART5_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART5_TOR (UART5_BA+0x20) /*!< Time-out Register */ - #define REG_UART5_BAUD (UART5_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART5_IRCR (UART5_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART5_ALT_CSR (UART5_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART5_FUN_SEL (UART5_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART5_LIN_CTL (UART5_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART5_LIN_SR (UART5_BA+0x38) /*!< LIN Status Register */ - - /* - UART6 Control Registers - */ - #define REG_UART6_RBR (UART6_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART6_THR (UART6_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART6_IER (UART6_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART6_FCR (UART6_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART6_LCR (UART6_BA+0x0C) /*!< Line Control Register */ - #define REG_UART6_MCR (UART6_BA+0x10) /*!< Modem Control Register */ - #define REG_UART6_MSR (UART6_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART6_FSR (UART6_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART6_ISR (UART6_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART6_TOR (UART6_BA+0x20) /*!< Time-out Register */ - #define REG_UART6_BAUD (UART6_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART6_IRCR (UART6_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART6_ALT_CSR (UART6_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART6_FUN_SEL (UART6_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART6_LIN_CTL (UART6_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART6_LIN_SR (UART6_BA+0x38) /*!< LIN Status Register */ - - /* - UART7 Control Registers - */ - #define REG_UART7_RBR (UART7_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART7_THR (UART7_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART7_IER (UART7_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART7_FCR (UART7_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART7_LCR (UART7_BA+0x0C) /*!< Line Control Register */ - #define REG_UART7_MCR (UART7_BA+0x10) /*!< Modem Control Register */ - #define REG_UART7_MSR (UART7_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART7_FSR (UART7_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART7_ISR (UART7_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART7_TOR (UART7_BA+0x20) /*!< Time-out Register */ - #define REG_UART7_BAUD (UART7_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART7_IRCR (UART7_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART7_ALT_CSR (UART7_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART7_FUN_SEL (UART7_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART7_LIN_CTL (UART7_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART7_LIN_SR (UART7_BA+0x38) /*!< LIN Status Register */ - - /* - UART8 Control Registers - */ - #define REG_UART8_RBR (UART8_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART8_THR (UART8_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART8_IER (UART8_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART8_FCR (UART8_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART8_LCR (UART8_BA+0x0C) /*!< Line Control Register */ - #define REG_UART8_MCR (UART8_BA+0x10) /*!< Modem Control Register */ - #define REG_UART8_MSR (UART8_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART8_FSR (UART8_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART8_ISR (UART8_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART8_TOR (UART8_BA+0x20) /*!< Time-out Register */ - #define REG_UART8_BAUD (UART8_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART8_IRCR (UART8_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART8_ALT_CSR (UART8_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART8_FUN_SEL (UART8_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART8_LIN_CTL (UART8_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART8_LIN_SR (UART8_BA+0x38) /*!< LIN Status Register */ - - /* - UART9 Control Registers - */ - #define REG_UART9_RBR (UART9_BA+0x00) /*!< Receive Buffer Register */ - #define REG_UART9_THR (UART9_BA+0x00) /*!< Transmit Holding Register */ - #define REG_UART9_IER (UART9_BA+0x04) /*!< Interrupt Enable Register */ - #define REG_UART9_FCR (UART9_BA+0x08) /*!< FIFO Control Register */ - #define REG_UART9_LCR (UART9_BA+0x0C) /*!< Line Control Register */ - #define REG_UART9_MCR (UART9_BA+0x10) /*!< Modem Control Register */ - #define REG_UART9_MSR (UART9_BA+0x14) /*!< MODEM Status Register */ - #define REG_UART9_FSR (UART9_BA+0x18) /*!< FIFO Status Register */ - #define REG_UART9_ISR (UART9_BA+0x1C) /*!< Interrupt Status Control Register */ - #define REG_UART9_TOR (UART9_BA+0x20) /*!< Time-out Register */ - #define REG_UART9_BAUD (UART9_BA+0x24) /*!< Baud Rate Divider Register */ - #define REG_UART9_IRCR (UART9_BA+0x28) /*!< IrDA Control Register */ - #define REG_UART9_ALT_CSR (UART9_BA+0x2C) /*!< Alternate Control Register */ - #define REG_UART9_FUN_SEL (UART9_BA+0x30) /*!< UART Function Select REgister */ - #define REG_UART9_LIN_CTL (UART9_BA+0x34) /*!< UART LIN Control Register */ - #define REG_UART9_LIN_SR (UART9_BA+0x38) /*!< LIN Status Register */ - - - /**@}*/ /* end of UART register group */ - - - - /*---------------------- Enhance Timer Controller -------------------------*/ - /** - @addtogroup ETIMER Enhance Timer Controller(ETIMER) - Memory Mapped Structure for TIMER Controller - @{ */ - - #define REG_ETMR0_CTL (ETMR0_BA+0x00) /*!< Enhance Timer 0 Control Register */ - #define REG_ETMR0_PRECNT (ETMR0_BA+0x04) /*!< Enhance Timer 0 Pre-Scale Counter Register */ - #define REG_ETMR0_CMPR (ETMR0_BA+0x08) /*!< Enhance Timer 0 Compare Register */ - #define REG_ETMR0_IER (ETMR0_BA+0x0C) /*!< Enhance Timer 0 Interrupt Enable Register */ - #define REG_ETMR0_ISR (ETMR0_BA+0x10) /*!< Enhance Timer 0 Interrupt Status Register */ - #define REG_ETMR0_DR (ETMR0_BA+0x14) /*!< Enhance Timer 0 Data Register */ - #define REG_ETMR0_TCAP (ETMR0_BA+0x18) /*!< Enhance Timer 0 Capture Data Register */ - #define REG_ETMR0_ECTL (ETMR0_BA+0x20) /*!< Enhance Timer 0 Extended Control Register */ - - #define REG_ETMR1_CTL (ETMR1_BA+0x00) /*!< Enhance Timer 1 Control Register */ - #define REG_ETMR1_PRECNT (ETMR1_BA+0x04) /*!< Enhance Timer 1 Pre-Scale Counter Register */ - #define REG_ETMR1_CMPR (ETMR1_BA+0x08) /*!< Enhance Timer 1 Compare Register */ - #define REG_ETMR1_IER (ETMR1_BA+0x0C) /*!< Enhance Timer 1 Interrupt Enable Register */ - #define REG_ETMR1_ISR (ETMR1_BA+0x10) /*!< Enhance Timer 1 Interrupt Status Register */ - #define REG_ETMR1_DR (ETMR1_BA+0x14) /*!< Enhance Timer 1 Data Register */ - #define REG_ETMR1_TCAP (ETMR1_BA+0x18) /*!< Enhance Timer 1 Capture Data Register */ - #define REG_ETMR1_ECTL (ETMR1_BA+0x20) /*!< Enhance Timer 1 Extended Control Register */ - - #define REG_ETMR2_CTL (ETMR2_BA+0x00) /*!< Enhance Timer 2 Control Register */ - #define REG_ETMR2_PRECNT (ETMR2_BA+0x04) /*!< Enhance Timer 2 Pre-Scale Counter Register */ - #define REG_ETMR2_CMPR (ETMR2_BA+0x08) /*!< Enhance Timer 2 Compare Register */ - #define REG_ETMR2_IER (ETMR2_BA+0x0C) /*!< Enhance Timer 2 Interrupt Enable Register */ - #define REG_ETMR2_ISR (ETMR2_BA+0x10) /*!< Enhance Timer 2 Interrupt Status Register */ - #define REG_ETMR2_DR (ETMR2_BA+0x14) /*!< Enhance Timer 2 Data Register */ - #define REG_ETMR2_TCAP (ETMR2_BA+0x18) /*!< Enhance Timer 2 Capture Data Register */ - #define REG_ETMR2_ECTL (ETMR2_BA+0x20) /*!< Enhance Timer 2 Extended Control Register */ - - #define REG_ETMR3_CTL (ETMR3_BA+0x00) /*!< Enhance Timer 3 Control Register */ - #define REG_ETMR3_PRECNT (ETMR3_BA+0x04) /*!< Enhance Timer 3 Pre-Scale Counter Register */ - #define REG_ETMR3_CMPR (ETMR3_BA+0x08) /*!< Enhance Timer 3 Compare Register */ - #define REG_ETMR3_IER (ETMR3_BA+0x0C) /*!< Enhance Timer 3 Interrupt Enable Register */ - #define REG_ETMR3_ISR (ETMR3_BA+0x10) /*!< Enhance Timer 3 Interrupt Status Register */ - #define REG_ETMR3_DR (ETMR3_BA+0x14) /*!< Enhance Timer 3 Data Register */ - #define REG_ETMR3_TCAP (ETMR3_BA+0x18) /*!< Enhance Timer 3 Capture Data Register */ - #define REG_ETMR3_ECTL (ETMR3_BA+0x20) /*!< Enhance Timer 3 Extended Control Register */ - - #define REG_ETMR4_CTL (ETMR4_BA+0x00) /*!< Enhance Timer 4 Control Register */ - #define REG_ETMR4_PRECNT (ETMR4_BA+0x04) /*!< Enhance Timer 4 Pre-Scale Counter Register */ - #define REG_ETMR4_CMPR (ETMR4_BA+0x08) /*!< Enhance Timer 4 Compare Register */ - #define REG_ETMR4_IER (ETMR4_BA+0x0C) /*!< Enhance Timer 4 Interrupt Enable Register */ - #define REG_ETMR4_ISR (ETMR4_BA+0x10) /*!< Enhance Timer 4 Interrupt Status Register */ - #define REG_ETMR4_DR (ETMR4_BA+0x14) /*!< Enhance Timer 4 Data Register */ - #define REG_ETMR4_TCAP (ETMR4_BA+0x18) /*!< Enhance Timer 4 Capture Data Register */ - #define REG_ETMR4_ECTL (ETMR4_BA+0x20) /*!< Enhance Timer 4 Extended Control Register */ - - #define REG_ETMR5_CTL (ETMR5_BA+0x00) /*!< Enhance Timer 5 Control Register */ - #define REG_ETMR5_PRECNT (ETMR5_BA+0x04) /*!< Enhance Timer 5 Pre-Scale Counter Register */ - #define REG_ETMR5_CMPR (ETMR5_BA+0x08) /*!< Enhance Timer 5 Compare Register */ - #define REG_ETMR5_IER (ETMR5_BA+0x0C) /*!< Enhance Timer 5 Interrupt Enable Register */ - #define REG_ETMR5_ISR (ETMR5_BA+0x10) /*!< Enhance Timer 5 Interrupt Status Register */ - #define REG_ETMR5_DR (ETMR5_BA+0x14) /*!< Enhance Timer 5 Data Register */ - #define REG_ETMR5_TCAP (ETMR5_BA+0x18) /*!< Enhance Timer 5 Capture Data Register */ - #define REG_ETMR5_ECTL (ETMR5_BA+0x20) /*!< Enhance Timer 5 Extended Control Register */ - - /**@}*/ /* end of ETIMER register group */ - - /*---------------------- WDT Controller -------------------------*/ - /** - @addtogroup WDT Watch Dog Timer Controller(WDT) - Memory Mapped Structure for WDT Controller - @{ */ - - #define REG_WDT_CTL (WDT_BA+0x00) /*!< WDT Control Register */ - #define REG_WDT_ALTCTL (WDT_BA+0x04) /*!< WDT Alternative Control Register */ - #define REG_WDT_RSTCNT (WDT_BA+0x08) /*!< WDT Reset Counter Register */ - /**@}*/ /* end of WDT register group */ - - /*---------------------- WWDT Controller -------------------------*/ - /** - @addtogroup WWDT Window Watch Dog Timer Controller(WWDT) - Memory Mapped Structure for WWDT Controller - @{ */ - - #define REG_WWDT_RLDCNT (WWDT_BA+0x00) /*!< WWDT Reload Counter Register */ - #define REG_WWDT_CTL (WWDT_BA+0x04) /*!< WWDT Control Register */ - #define REG_WWDT_STATUS (WWDT_BA+0x08) /*!< WWDT Status Register */ - #define REG_WWDT_CNT (WWDT_BA+0x0C) /*!< WWDT Counter Value Register */ - - /**@}*/ /* end of WWDT register group */ - - /*---------------------- SC Host Interface -------------------------*/ - /** - @addtogroup SC Smart Card Host Interface (SC) - Memory Mapped Structure for Smart Card Host Interface - @{ */ - - #define REG_SC0_DAT (SC0_BA+0x00) /*!< SC0 Receiving/Transmit Holding Buffer Register */ - #define REG_SC0_CTL (SC0_BA+0x04) /*!< SC0 Control Register */ - #define REG_SC0_ALTCTL (SC0_BA+0x08) /*!< SC0 Alternate Control Register */ - #define REG_SC0_EGT (SC0_BA+0x0C) /*!< SC0 Extend Guard Time Register */ - #define REG_SC0_RXTOUT (SC0_BA+0x10) /*!< SC0 Receive Buffer Time-out Register */ - #define REG_SC0_ETUCTL (SC0_BA+0x14) /*!< SC0 ETU Control Register */ - #define REG_SC0_INTEN (SC0_BA+0x18) /*!< SC0 Interrupt Enable Control Register */ - #define REG_SC0_INTSTS (SC0_BA+0x1C) /*!< SC0 Interrupt Status Register */ - #define REG_SC0_STATUS (SC0_BA+0x20) /*!< SC0 Status Register */ - #define REG_SC0_PINCTL (SC0_BA+0x24) /*!< SC0 Pin Control State Register */ - #define REG_SC0_TMRCTL0 (SC0_BA+0x28) /*!< SC0 Internal Timer Control Register 0 */ - #define REG_SC0_TMRCTL1 (SC0_BA+0x2C) /*!< SC0 Internal Timer Control Register 1 */ - #define REG_SC0_TMRCTL2 (SC0_BA+0x30) /*!< SC0 Internal Timer Control Register 2 */ - #define REG_SC0_UARTCTL (SC0_BA+0x34) /*!< SC0 UART Mode Control Register */ - #define REG_SC0_ACTCTL (SC0_BA+0x4C) /*!< SC0 Activation Control Register */ - - #define REG_SC1_DAT (SC1_BA+0x00) /*!< SC1 Receiving/Transmit Holding Buffer Register */ - #define REG_SC1_CTL (SC1_BA+0x04) /*!< SC1 Control Register */ - #define REG_SC1_ALTCTL (SC1_BA+0x08) /*!< SC1 Alternate Control Register */ - #define REG_SC1_EGT (SC1_BA+0x0C) /*!< SC1 Extend Guard Time Register */ - #define REG_SC1_RXTOUT (SC1_BA+0x10) /*!< SC1 Receive Buffer Time-out Register */ - #define REG_SC1_ETUCTL (SC1_BA+0x14) /*!< SC1 ETU Control Register */ - #define REG_SC1_INTEN (SC1_BA+0x18) /*!< SC1 Interrupt Enable Control Register */ - #define REG_SC1_INTSTS (SC1_BA+0x1C) /*!< SC1 Interrupt Status Register */ - #define REG_SC1_STATUS (SC1_BA+0x20) /*!< SC1 Status Register */ - #define REG_SC1_PINCTL (SC1_BA+0x24) /*!< SC1 Pin Control State Register */ - #define REG_SC1_TMRCTL0 (SC1_BA+0x28) /*!< SC1 Internal Timer Control Register 0 */ - #define REG_SC1_TMRCTL1 (SC1_BA+0x2C) /*!< SC1 Internal Timer Control Register 1 */ - #define REG_SC1_TMRCTL2 (SC1_BA+0x30) /*!< SC1 Internal Timer Control Register 2 */ - #define REG_SC1_UARTCTL (SC1_BA+0x34) /*!< SC1 UART Mode Control Register */ - #define REG_SC1_ACTCTL (SC1_BA+0x4C) /*!< SC1 Activation Control Register 1 */ - - /**@}*/ /* end of SC register group */ - - - /*---------------------- Advance Interrupt Controller -------------------------*/ - /** - @addtogroup AIC Advance Interrupt Controller(AIC) - Memory Mapped Structure for AIC Controller - @{ */ - - #define REG_AIC_SRCCTL0 (AIC_BA+0x00) /* Source control register 0 */ - #define REG_AIC_SRCCTL1 (AIC_BA+0x04) /* Source control register 1 */ - #define REG_AIC_SRCCTL2 (AIC_BA+0x08) /* Source control register 2 */ - #define REG_AIC_SRCCTL3 (AIC_BA+0x0C) /* Source control register 3 */ - #define REG_AIC_SRCCTL4 (AIC_BA+0x10) /* Source control register 4 */ - #define REG_AIC_SRCCTL5 (AIC_BA+0x14) /* Source control register 5 */ - #define REG_AIC_SRCCTL6 (AIC_BA+0x18) /* Source control register 6 */ - #define REG_AIC_SRCCTL7 (AIC_BA+0x1C) /* Source control register 7 */ - #define REG_AIC_SRCCTL8 (AIC_BA+0x20) /* Source control register 8 */ - #define REG_AIC_SRCCTL9 (AIC_BA+0x24) /* Source control register 9 */ - #define REG_AIC_SRCCTL10 (AIC_BA+0x28) /* Source control register 10 */ - #define REG_AIC_SRCCTL11 (AIC_BA+0x2C) /* Source control register 11 */ - #define REG_AIC_SRCCTL12 (AIC_BA+0x30) /* Source control register 12 */ - #define REG_AIC_SRCCTL13 (AIC_BA+0x34) /* Source control register 13 */ - #define REG_AIC_SRCCTL14 (AIC_BA+0x38) /* Source control register 14 */ - #define REG_AIC_SRCCTL15 (AIC_BA+0x3C) /* Source control register 15 */ - #define REG_AIC_RAWSTS0 (AIC_BA+0x100) /* Interrupt raw status register */ - #define REG_AIC_RAWSTS1 (AIC_BA+0x104) /* Interrupt raw status register (Hign) */ - #define REG_AIC_ACTSTS0 (AIC_BA+0x108) /* Interrupt active status register */ - #define REG_AIC_ACTSTS1 (AIC_BA+0x10C) /* Interrupt active status register (Hign) */ - #define REG_AIC_INTSTS0 (AIC_BA+0x110) /* Interrupt status register */ - #define REG_AIC_INTSTS1 (AIC_BA+0x114) /* Interrupt status register (High) */ - #define REG_AIC_IRQNUM (AIC_BA+0x120) /* Interrupt source number register */ - #define REG_AIC_FIQNUM (AIC_BA+0x124) /* Output interrupt status register */ - #define REG_AIC_INTMSK0 (AIC_BA+0x128) /* Interrupt mask register */ - #define REG_AIC_INTMSK1 (AIC_BA+0x12C) /* Interrupt mask register (High) */ - #define REG_AIC_INTEN0 (AIC_BA+0x130) /* Mask enable command register */ - #define REG_AIC_INTEN1 (AIC_BA+0x134) /* Mask enable command register (High) */ - #define REG_AIC_INTDIS0 (AIC_BA+0x138) /* Mask disable command register */ - #define REG_AIC_INTDIS1 (AIC_BA+0x13C) /* Mask disable command register (High) */ - #define REG_AIC_EOIS (AIC_BA+0x150) /* End of service command register */ - #define REG_AIC_EOFS (AIC_BA+0x154) /* End of service command register */ - - /**@}*/ /* end of AIC register group */ - - - /*---------------------- Real Time Clock Controller -------------------------*/ - /** - @addtogroup RTC Real Time Clock Controller(RTC) - Memory Mapped Structure for RTC Controller - @{ */ - - #define REG_RTC_INIT (RTC_BA+0x00) /*!< RTC Initiation Register */ - #define REG_RTC_RWEN (RTC_BA+0x04) /*!< RTC Access Enable Register */ - #define REG_RTC_FREQADJ (RTC_BA+0x08) /*!< RTC Frequency Compensation Register */ - #define REG_RTC_TIME (RTC_BA+0x0C) /*!< Time Loading Register */ - #define REG_RTC_CAL (RTC_BA+0x10) /*!< Calendar Loading Register */ - #define REG_RTC_TIMEFMT (RTC_BA+0x14) /*!< Time Format Selection Register */ - #define REG_RTC_WEEKDAY (RTC_BA+0x18) /*!< Day of the Week Register */ - #define REG_RTC_TALM (RTC_BA+0x1C) /*!< Time Alarm Register */ - #define REG_RTC_CALM (RTC_BA+0x20) /*!< Calendar Alarm Register */ - #define REG_RTC_LEAPYEAR (RTC_BA+0x24) /*!< Leap year Indicator Register */ - #define REG_RTC_INTEN (RTC_BA+0x28) /*!< RTC Interrupt Enable Register */ - #define REG_RTC_INTSTS (RTC_BA+0x2C) /*!< RTC Interrupt Indicator Register */ - #define REG_RTC_TICK (RTC_BA+0x30) /*!< RTC Time Tick Register */ - #define REG_RTC_PWRCTL (RTC_BA+0x34) /*!< Power Control Register */ - #define REG_RTC_PWRCNT (RTC_BA+0x38) /*!< Power Control Counter Register */ - #define REG_RTC_SPR0 (RTC_BA+0x40) /*!< Spare REgistger 0 */ - #define REG_RTC_SPR1 (RTC_BA+0x44) /*!< Spare REgistger 1 */ - #define REG_RTC_SPR2 (RTC_BA+0x48) /*!< Spare REgistger 2 */ - #define REG_RTC_SPR3 (RTC_BA+0x4C) /*!< Spare REgistger 3 */ - #define REG_RTC_SPR4 (RTC_BA+0x50) /*!< Spare REgistger 4 */ - #define REG_RTC_SPR5 (RTC_BA+0x54) /*!< Spare REgistger 5 */ - #define REG_RTC_SPR6 (RTC_BA+0x58) /*!< Spare REgistger 6 */ - #define REG_RTC_SPR7 (RTC_BA+0x5C) /*!< Spare REgistger 7 */ - #define REG_RTC_SPR8 (RTC_BA+0x60) /*!< Spare REgistger 8 */ - #define REG_RTC_SPR9 (RTC_BA+0x64) /*!< Spare REgistger 9 */ - #define REG_RTC_SPR10 (RTC_BA+0x68) /*!< Spare REgistger 10 */ - #define REG_RTC_SPR11 (RTC_BA+0x6C) /*!< Spare REgistger 11 */ - #define REG_RTC_SPR12 (RTC_BA+0x70) /*!< Spare REgistger 12 */ - #define REG_RTC_SPR13 (RTC_BA+0x74) /*!< Spare REgistger 13 */ - #define REG_RTC_SPR14 (RTC_BA+0x78) /*!< Spare REgistger 14 */ - #define REG_RTC_SPR15 (RTC_BA+0x7C) /*!< Spare REgistger 15 */ - - /**@}*/ /* end of RTC register group */ - - - - /*---------------------- Pulse Width Modulation Controller -------------------------*/ - /** - @addtogroup PWM Pulse Width Modulation Controller(PWM) - Memory Mapped Structure for PWM Controller - @{ */ - - #define REG_PWM0_PPR (PWM0_BA+0x00) /*!< PWM Pre-scale Register 0 */ - #define REG_PWM0_CSR (PWM0_BA+0x04) /*!< PWM Clock Select Register */ - #define REG_PWM0_PCR (PWM0_BA+0x08) /*!< PWM Control Register */ - #define REG_PWM0_CNR0 (PWM0_BA+0x0C) /*!< PWM Counter Register 0 */ - #define REG_PWM0_CMR0 (PWM0_BA+0x10) /*!< PWM Comparator Register 0 */ - #define REG_PWM0_PDR0 (PWM0_BA+0x14) /*!< PWM Data Register 0 */ - #define REG_PWM0_CNR1 (PWM0_BA+0x18) /*!< PWM Counter Register 1 */ - #define REG_PWM0_CMR1 (PWM0_BA+0x1C) /*!< PWM Comparator Register 1 */ - #define REG_PWM0_PDR1 (PWM0_BA+0x20) /*!< PWM Data Register 1 */ - #define REG_PWM0_CNR2 (PWM0_BA+0x24) /*!< PWM Counter Register 2 */ - #define REG_PWM0_CMR2 (PWM0_BA+0x28) /*!< PWM Comparator Register 2 */ - #define REG_PWM0_PDR2 (PWM0_BA+0x2C) /*!< PWM Data Register 2 */ - #define REG_PWM0_CNR3 (PWM0_BA+0x30) /*!< PWM Counter Register 3 */ - #define REG_PWM0_CMR3 (PWM0_BA+0x34) /*!< PWM Comparator Register 3 */ - #define REG_PWM0_PDR3 (PWM0_BA+0x38) /*!< PWM Data Register 3 */ - #define REG_PWM0_PIER (PWM0_BA+0x3C) /*!< PWM Timer Interrupt Enable Register */ - #define REG_PWM0_PIIR (PWM0_BA+0x40) /*!< PWM Timer Interrupt Identification Register */ - - /*---------------------- Analog to Digital Converter -------------------------*/ - /** - @addtogroup ADC Analog to Digital Converter(ADC) - Memory Mapped Structure for ADC Controller - @{ */ - - #define REG_ADC_CTL (ADC_BA+0x000) /*!< ADC Contrl */ - #define REG_ADC_CONF (ADC_BA+0x004) /*!< ADC Configure */ - #define REG_ADC_IER (ADC_BA+0x008) /*!< ADC Interrupt Enable Register */ - #define REG_ADC_ISR (ADC_BA+0x00C) /*!< ADC Interrupt Status Register */ - #define REG_ADC_WKISR (ADC_BA+0x010) /*!< ADC Wake Up Interrupt Status Register */ - #define REG_ADC_XYDATA (ADC_BA+0x020) /*!< ADC Touch XY Pressure Data */ - #define REG_ADC_ZDATA (ADC_BA+0x024) /*!< ADC Touch Z Pressure Data */ - #define REG_ADC_DATA (ADC_BA+0x028) /*!< ADC Normal Conversion Data */ - #define REG_ADC_VBADATA (ADC_BA+0x02C) /*!< ADC Battery Detection Data */ - #define REG_ADC_KPDATA (ADC_BA+0x030) /*!< ADC Key Pad Data */ - #define REG_ADC_SELFDATA (ADC_BA+0x034) /*!< ADC Self-Test Data */ - #define REG_ADC_XYSORT0 (ADC_BA+0x1F4) /*!< ADC Touch XY Position Mean Value Sort 0 */ - #define REG_ADC_XYSORT1 (ADC_BA+0x1F8) /*!< ADC Touch XY Position Mean Value Sort 1 */ - #define REG_ADC_XYSORT2 (ADC_BA+0x1FC) /*!< ADC Touch XY Position Mean Value Sort 2 */ - #define REG_ADC_XYSORT3 (ADC_BA+0x200) /*!< ADC Touch XY Position Mean Value Sort 3 */ - #define REG_ADC_ZSORT0 (ADC_BA+0x204) /*!< ADC Touch Z Pressure Mean Value Sort 0 */ - #define REG_ADC_ZSORT1 (ADC_BA+0x208) /*!< ADC Touch Z Pressure Mean Value Sort 1 */ - #define REG_ADC_ZSORT2 (ADC_BA+0x20C) /*!< ADC Touch Z Pressure Mean Value Sort 2 */ - #define REG_ADC_ZSORT3 (ADC_BA+0x210) /*!< ADC Touch Z Pressure Mean Value Sort 3 */ - #define REG_ADC_MTMULCK (ADC_BA+0x220) /*!< ADC Manual Test Mode Unlock */ - #define REG_ADC_MTCONF (ADC_BA+0x224) /*!< ADC Manual Test Mode Configure */ - #define REG_ADC_MTCON (ADC_BA+0x228) /*!< ADC Manual Test Mode Control */ - #define REG_ADC_ADCAII (ADC_BA+0x22C) /*!< ADC Analog Interface Information */ - #define REG_ADC_ADCAIIRLT (ADC_BA+0x230) /*!< ADC Analog Interface Information Result */ - - /**@}*/ /* end of ADC register group */ - - - /*------------------ Capture Sensor Interface Controller ---------------------*/ - /** - @addtogroup CAP Capture Engine(CAP) - Memory Mapped Structure for CAP Controller - @{ */ - - #define REG_CAP0_CTL (CAP0_BA+0x000) /*!< Image Capture Interface Control Register */ - #define REG_CAP0_PAR (CAP0_BA+0x004) /*!< Image Capture Interface Parameter Register */ - #define REG_CAP0_INT (CAP0_BA+0x008) /*!< Image Capture Interface Interrupt Registe */ - #define REG_CAP0_POSTERIZE (CAP0_BA+0x00C) /*!< YUV Component Posterizing Factor Register */ - #define REG_CAP0_MD (CAP0_BA+0x010) /*!< Motion Detection Register */ - #define REG_CAP0_MDADDR (CAP0_BA+0x014) /*!< Motion Detection Output Address Register */ - #define REG_CAP0_MDYADDR (CAP0_BA+0x018) /*!< Motion Detection Temp YOutput Address Register */ - #define REG_CAP0_SEPIA (CAP0_BA+0x01C) /*!< Sepia Effect Control Register */ - #define REG_CAP0_CWSP (CAP0_BA+0x020) /*!< Cropping Window Starting Address Register */ - #define REG_CAP0_CWS (CAP0_BA+0x024) /*!< Cropping Window Size Register */ - #define REG_CAP0_PKTSL (CAP0_BA+0x028) /*!< Packet Scaling Vertical/Horizontal Factor Register (LSB) */ - #define REG_CAP0_PLNSL (CAP0_BA+0x02C) /*!< Planar Scaling Vertical/Horizontal Factor Register (LSB) */ - #define REG_CAP0_FRCTL (CAP0_BA+0x030) /*!< Scaling Frame Rate Factor Register */ - #define REG_CAP0_STRIDE (CAP0_BA+0x034) /*!< Frame Output Pixel Stride Register */ - #define REG_CAP0_FIFOTH (CAP0_BA+0x03C) /*!< FIFO threshold Register */ - #define REG_CAP0_CMPADDR (CAP0_BA+0x040) /*!< Compare Packet Memory Base Address Register */ - #define REG_CAP0_PKTSM (CAP0_BA+0x048) /*!< Packet Scaling Vertical/Horizontal Factor Register (MSB) */ - #define REG_CAP0_PLNSM (CAP0_BA+0x04C) /*!< Planar Scaling Vertical/Horizontal Factor Register (MSB) */ - #define REG_CAP0_CURADDRP (CAP0_BA+0x050) /*!< Current Packet System Memory Address Register */ - #define REG_CAP0_CURADDRY (CAP0_BA+0x054) /*!< Current Planar Y System Memory Address Register */ - #define REG_CAP0_CURADDRU (CAP0_BA+0x058) /*!< Current Planar U System Memory Address Register */ - #define REG_CAP0_CURADDRV (CAP0_BA+0x05C) /*!< Current Planar V System Memory Address Register */ - #define REG_CAP0_PKTBA0 (CAP0_BA+0x060) /*!< System Memory Packet Base Address Register */ - #define REG_CAP0_PKTBA1 (CAP0_BA+0x064) /*!< System Memory Packet Base Address Register */ - #define REG_CAP0_YBA (CAP0_BA+0x080) /*!< System Memory Planar Y Base Address Register */ - #define REG_CAP0_UBA (CAP0_BA+0x084) /*!< System Memory Planar U Base Address Register */ - #define REG_CAP0_VBA (CAP0_BA+0x088) /*!< System Memory Planar V Base Address Register */ - - /**@}*/ /* end of CAP register group */ - - /*------------------ SDRAM Interface Controller ---------------------*/ - /** - @addtogroup SDIC SDRAM Interface Controller(SDIC) - Memory Mapped Structure for SDIC Controller - @{ */ - - #define REG_SDIC_OPMCTL (SDIC_BA+0x000) /*!< SDRAM Controller Operation Mode Control Register */ - #define REG_SDIC_CMD (SDIC_BA+0x004) /*!< SDRAM Command Register */ - #define REG_SDIC_REFCTL (SDIC_BA+0x008) /*!< SDRAM Controller Refresh Control Register */ - #define REG_SDIC_SIZE0 (SDIC_BA+0x010) /*!< SDRAM 0 Size Register */ - #define REG_SDIC_SIZE1 (SDIC_BA+0x014) /*!< SDRAM 1 Size Register */ - #define REG_SDIC_MR (SDIC_BA+0x018) /*!< SDRAM Mode Register */ - #define REG_SDIC_EMR (SDIC_BA+0x01C) /*!< SDRAM Extended Mode Register */ - #define REG_SDIC_EMR2 (SDIC_BA+0x020) /*!< SDRAM Extended Mode Register 2 */ - #define REG_SDIC_EMR3 (SDIC_BA+0x024) /*!< SDRAM Extended Mode Register 3 */ - #define REG_SDIC_TIME (SDIC_BA+0x028) /*!< SDRAM Timing Control Register */ - #define REG_SDIC_DQSODS (SDIC_BA+0x030) /*!< DQS Output Delay Selection Register */ - #define REG_SDIC_CKDQSDS (SDIC_BA+0x034) /*!< Clock and DQS Delay Selection Register */ - #define REG_SDIC_DAENSEL (SDIC_BA+0x038) /*!< Data Latch Enable Selection Register */ - - /**@}*/ /* end of SDIC register group */ - - /*---------------------- Controller Area Network -------------------------*/ - /** - @addtogroup CAN Controller Area Network(CAN) - Memory Mapped Structure for CAN Controller - @{ */ - - #define REG_CAN0_CON (CAN0_BA+0x00) /*!< Control Register */ - #define REG_CAN0_STATUS (CAN0_BA+0x04) /*!< Status Register */ - #define REG_CAN0_ERR (CAN0_BA+0x08) /*!< Error Counter Register */ - #define REG_CAN0_BTIME (CAN0_BA+0x0C) /*!< Bit Time Register */ - #define REG_CAN0_IIDR (CAN0_BA+0x10) /*!< Interrupt Identifier Register */ - #define REG_CAN0_TEST (CAN0_BA+0x14) /*!< Test Register */ - #define REG_CAN0_BRPE (CAN0_BA+0x18) /*!< BRP Extension Register */ - #define REG_CAN0_IF1_CREQ (CAN0_BA+0x20) /*!< IF1 Command Request Register */ - #define REG_CAN0_IF2_CREQ (CAN0_BA+0x80) /*!< IF2 Command Request Register */ - #define REG_CAN0_IF1_CMASK (CAN0_BA+0x24) /*!< IF1 Command Mask Register */ - #define REG_CAN0_IF2_CMASK (CAN0_BA+0x84) /*!< IF2 Command Mask Register */ - #define REG_CAN0_IF1_MASK1 (CAN0_BA+0x28) /*!< IF1 Msak 1 Register */ - #define REG_CNA0_IF2_MASK1 (CAN0_BA+0x88) /*!< IF2 Mask 1 Register */ - #define REG_CAN0_IF1_MASK2 (CAN0_BA+0x2C) /*!< IF1 Mask 2 Register */ - #define REG_CAN0_IF2_MASK2 (CAN0_BA+0x8C) /*!< IF2 Mask 2 REgister */ - #define REG_CAN0_IF1_ARB1 (CAN0_BA+0x30) /*!< IF1 Arbitration 1 Register */ - #define REG_CAN0_IF2_ARB1 (CAN0_BA+0x90) /*!< IF2 Arbitration 1 Register */ - #define REG_CAN0_IF1_ARB2 (CAN0_BA+0x34) /*!< IF1 Arbitration 2 Register */ - #define REG_CAN0_IF2_ARB2 (CAN0_BA+0x94) /*!< IF2 Arbitration 2 Register */ - #define REG_CAN0_IF1_MCON (CAN0_BA+0x38) /*!< IF1 Message Control Register */ - #define REG_CAN0_IF2_MCON (CAN0_BA+0x98) /*!< IF2 Message Control Register */ - #define REG_CAN0_IF1_DAT_A1 (CAN0_BA+0x3C) /*!< IF1 Data A1 Register */ - #define REG_CAN0_IF1_DAT_A2 (CAN0_BA+0x40) /*!< IF1 Data A2 Register */ - #define REG_CAN0_IF1_DAT_B1 (CAN0_BA+0x44) /*!< IF1 Data B1 Register */ - #define REG_CAN0_IF1_DAT_B2 (CAN0_BA+0x48) /*!< IF1 Data B2 Register */ - #define REG_CAN0_IF2_DAT_A1 (CAN0_BA+0x9C) /*!< IF2 Data A1 Register */ - #define REG_CAN0_IF2_DAT_A2 (CAN0_BA+0xA0) /*!< IF2 Data A2 Register */ - #define REG_CAN0_IF2_DAT_B1 (CAN0_BA+0xA4) /*!< IF2 Data B1 Register */ - #define REG_CAN0_IF2_DAT_B2 (CAN0_BA+0xA8) /*!< IF2 Data B2 Register */ - #define REG_CAN0_TXREQ1 (CAN0_BA+0x100) /*!< Transmission Request Register 1 */ - #define REG_CAN0_TXREQ2 (CAN0_BA+0x104) /*!< Transmission Request Register 2 */ - #define REG_CAN0_NDAT1 (CAN0_BA+0x120) /*!< New Data Register 1 */ - #define REG_CAN0_NDAT2 (CAN0_BA+0x124) /*!< New Data Register 2 */ - #define REG_CAN0_IPND1 (CAN0_BA+0x140) /*!< Interrupt Pending Register 1 */ - #define REG_CAN0_IPND2 (CAN0_BA+0x142) /*!< Interrupt Pending Register 2 */ - #define REG_CAN0_MVLD1 (CAN0_BA+0x160) /*!< Message Valid Register 1 */ - #define REG_CAN0_MVLD2 (CAN0_BA+0x164) /*!< Message Valid Register 2 */ - #define REG_CAN0_WU_EN (CAN0_BA+0x168) /*!< Wake-up Function Enable */ - #define REG_CAN0_WU_STATUS (CAN0_BA+0x16C) /*!< Wake-up Function Status */ - - #define REG_CAN1_CON (CAN1_BA+0x00) /*!< Control Register */ - #define REG_CAN1_STATUS (CAN1_BA+0x04) /*!< Status Register */ - #define REG_CAN1_ERR (CAN1_BA+0x08) /*!< Error Counter Register */ - #define REG_CAN1_BTIME (CAN1_BA+0x0C) /*!< Bit Time Register */ - #define REG_CAN1_IIDR (CAN1_BA+0x10) /*!< Interrupt Identifier Register */ - #define REG_CAN1_TEST (CAN1_BA+0x14) /*!< Test Register */ - #define REG_CAN1_BRPE (CAN1_BA+0x18) /*!< BRP Extension Register */ - #define REG_CAN1_IF1_CREQ (CAN1_BA+0x20) /*!< IF1 Command Request Register */ - #define REG_CAN1_IF2_CREQ (CAN1_BA+0x80) /*!< IF2 Command Request Register */ - #define REG_CAN1_IF1_CMASK (CAN1_BA+0x24) /*!< IF1 Command Mask Register */ - #define REG_CAN1_IF2_CMASK (CAN1_BA+0x84) /*!< IF2 Command Mask Register */ - #define REG_CAN1_IF1_MASK1 (CAN1_BA+0x28) /*!< IF1 Msak 1 Register */ - #define REG_CNA1_IF2_MASK1 (CAN1_BA+0x88) /*!< IF2 Mask 1 Register */ - #define REG_CAN1_IF1_MASK2 (CAN1_BA+0x2C) /*!< IF1 Mask 2 Register */ - #define REG_CAN1_IF2_MASK2 (CAN1_BA+0x8C) /*!< IF2 Mask 2 REgister */ - #define REG_CAN1_IF1_ARB1 (CAN1_BA+0x30) /*!< IF1 Arbitration 1 Register */ - #define REG_CAN1_IF2_ARB1 (CAN1_BA+0x90) /*!< IF2 Arbitration 1 Register */ - #define REG_CAN1_IF1_ARB2 (CAN1_BA+0x34) /*!< IF1 Arbitration 2 Register */ - #define REG_CAN1_IF2_ARB2 (CAN1_BA+0x94) /*!< IF2 Arbitration 2 Register */ - #define REG_CAN1_IF1_MCON (CAN1_BA+0x38) /*!< IF1 Message Control Register */ - #define REG_CAN1_IF2_MCON (CAN1_BA+0x98) /*!< IF2 Message Control Register */ - #define REG_CAN1_IF1_DAT_A1 (CAN1_BA+0x3C) /*!< IF1 Data A1 Register */ - #define REG_CAN1_IF1_DAT_A2 (CAN1_BA+0x40) /*!< IF1 Data A2 Register */ - #define REG_CAN1_IF1_DAT_B1 (CAN1_BA+0x44) /*!< IF1 Data B1 Register */ - #define REG_CAN1_IF1_DAT_B2 (CAN1_BA+0x48) /*!< IF1 Data B2 Register */ - #define REG_CAN1_IF2_DAT_A1 (CAN1_BA+0x9C) /*!< IF2 Data A1 Register */ - #define REG_CAN1_IF2_DAT_A2 (CAN1_BA+0xA0) /*!< IF2 Data A2 Register */ - #define REG_CAN1_IF2_DAT_B1 (CAN1_BA+0xA4) /*!< IF2 Data B1 Register */ - #define REG_CAN1_IF2_DAT_B2 (CAN1_BA+0xA8) /*!< IF2 Data B2 Register */ - #define REG_CAN1_TXREQ1 (CAN1_BA+0x100) /*!< Transmission Request Register 1 */ - #define REG_CAN1_TXREQ2 (CAN1_BA+0x104) /*!< Transmission Request Register 2 */ - #define REG_CAN1_NDAT1 (CAN1_BA+0x120) /*!< New Data Register 1 */ - #define REG_CAN1_NDAT2 (CAN1_BA+0x124) /*!< New Data Register 2 */ - #define REG_CAN1_IPND1 (CAN1_BA+0x140) /*!< Interrupt Pending Register 1 */ - #define REG_CAN1_IPND2 (CAN1_BA+0x142) /*!< Interrupt Pending Register 2 */ - #define REG_CAN1_MVLD1 (CAN1_BA+0x160) /*!< Message Valid Register 1 */ - #define REG_CAN1_MVLD2 (CAN1_BA+0x164) /*!< Message Valid Register 2 */ - #define REG_CAN1_WU_EN (CAN1_BA+0x168) /*!< Wake-up Function Enable */ - #define REG_CAN1_WU_STATUS (CAN1_BA+0x16C) /*!< Wake-up Function Status */ - - /**@}*/ /* end of CAN register group */ - - - /*@}*/ /* end of group REGISTER */ - - - /** @addtogroup IO_ROUTINE I/O Routines - The Declaration of NUC980 I/O Routines - @{ - */ - - typedef volatile unsigned char vu8; ///< Define 8-bit unsigned volatile data type - typedef volatile unsigned short vu16; ///< Define 16-bit unsigned volatile data type - typedef volatile unsigned long vu32; ///< Define 32-bit unsigned volatile data type - - /** - * @brief Get a 8-bit unsigned value from specified address - * @param[in] addr Address to get 8-bit data from - * @return 8-bit unsigned value stored in specified address - */ - #define M8(addr) (*((vu8 *) (addr))) - - /** - * @brief Get a 16-bit unsigned value from specified address - * @param[in] addr Address to get 16-bit data from - * @return 16-bit unsigned value stored in specified address - * @note The input address must be 16-bit aligned - */ - #define M16(addr) (*((vu16 *) (addr))) - - /** - * @brief Get a 32-bit unsigned value from specified address - * @param[in] addr Address to get 32-bit data from - * @return 32-bit unsigned value stored in specified address - * @note The input address must be 32-bit aligned - */ - #define M32(addr) (*((vu32 *) (addr))) - - /** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ - #define outpw(port,value) *((volatile unsigned int *)(port)) = value - - /** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ - #define inpw(port) (*((volatile unsigned int *)(port))) - - /** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ - #define outps(port,value) *((volatile unsigned short *)(port)) = value - - /** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ - #define inps(port) (*((volatile unsigned short *)(port))) - - /** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ - #define outpb(port,value) *((volatile unsigned char *)(port)) = value - - /** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ - #define inpb(port) (*((volatile unsigned char *)(port))) - - /** - * @brief Set a 32-bit unsigned value to specified I/O port - * @param[in] port Port address to set 32-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 32-bit aligned - */ - #define outp32(port,value) *((volatile unsigned int *)(port)) = value - - /** - * @brief Get a 32-bit unsigned value from specified I/O port - * @param[in] port Port address to get 32-bit data from - * @return 32-bit unsigned value stored in specified I/O port - * @note The input port must be 32-bit aligned - */ - #define inp32(port) (*((volatile unsigned int *)(port))) - - /** - * @brief Set a 16-bit unsigned value to specified I/O port - * @param[in] port Port address to set 16-bit data - * @param[in] value Value to write to I/O port - * @return None - * @note The output port must be 16-bit aligned - */ - #define outp16(port,value) *((volatile unsigned short *)(port)) = value - - /** - * @brief Get a 16-bit unsigned value from specified I/O port - * @param[in] port Port address to get 16-bit data from - * @return 16-bit unsigned value stored in specified I/O port - * @note The input port must be 16-bit aligned - */ - #define inp16(port) (*((volatile unsigned short *)(port))) - - /** - * @brief Set a 8-bit unsigned value to specified I/O port - * @param[in] port Port address to set 8-bit data - * @param[in] value Value to write to I/O port - * @return None - */ - #define outp8(port,value) *((volatile unsigned char *)(port)) = value - - /** - * @brief Get a 8-bit unsigned value from specified I/O port - * @param[in] port Port address to get 8-bit data from - * @return 8-bit unsigned value stored in specified I/O port - */ - #define inp8(port) (*((volatile unsigned char *)(port))) - - - /*@}*/ /* end of group IO_ROUTINE */ - - /******************************************************************************/ - /* Legacy Constants */ - /******************************************************************************/ - /** @addtogroup Legacy_Constants Legacy Constants - NUC980 Legacy Constants - @{ - */ - typedef void *PVOID; ///< Define void pointer data type - typedef void VOID; ///< Define void data type - typedef char BOOL; ///< Define bool data type - typedef char *PBOOL; ///< Define bool pointer data type - - typedef char INT8; ///< Define 8-bit singed data type - typedef char CHAR; ///< Define char data type - typedef char *PINT8; ///< Define 8-bit singed pointer data type - typedef char *PCHAR; ///< Define char pointer data type - typedef unsigned char UINT8; ///< Define 8-bit unsigned data type - typedef unsigned char UCHAR; ///< Define char unsigned data type - typedef unsigned char *PUINT8; ///< Define 8-bit unsigned pointer data type - typedef unsigned char *PUCHAR; ///< Define char unsigned pointer data type - typedef char *PSTR; ///< Define string pointer data type - typedef const char *PCSTR; ///< Define constant string pointer data type - - typedef short SHORT; ///< Define short signed data type - typedef short *PSHORT; ///< Define short signed pointer data type - typedef unsigned short USHORT; ///< Define short unsigned data type - typedef unsigned short *PUSHORT; ///< Define short unsigned pointer data type - - typedef short INT16; ///< Define 16-bit signed data type - typedef short *PINT16; ///< Define 16-bit signed pointer data type - typedef unsigned short UINT16; ///< Define 16-bit unsigned data type - typedef unsigned short *PUINT16; ///< Define 16-bit unsigned pointer data type - - typedef int INT; ///< Define integer signed data type - typedef int *PINT; ///< Define integer signed pointer data type - typedef unsigned int UINT; ///< Define integer unsigned data type - typedef unsigned int *PUINT; ///< Define integer unsigned pointer data type - - typedef int INT32; ///< Define 32-bit signed data type - typedef int *PINT32; ///< Define 32-bit signed pointer data type - typedef unsigned int UINT32; ///< Define 32-bit unsigned data type - typedef unsigned int *PUINT32; ///< Define 32-bit unsigned pointer data type - - #if defined (__GNUC__) && !(__CC_ARM) - typedef long long INT64; - typedef unsigned long long UINT64; - #else - typedef __int64 INT64; ///< Define 64-bit signed data type - typedef unsigned __int64 UINT64; ///< Define 64-bit unsigned data type - #endif - - typedef float FLOAT; ///< Define float data type - typedef float *PFLOAT; ///< Define float pointer data type - - typedef double DOUBLE; ///< Define double data type - typedef double *PDOUBLE; ///< Define double pointer data type - - typedef int SIZE_T; ///< Define size of data type - - typedef unsigned char REG8; ///< Define 8-bit register data type - typedef unsigned short REG16; ///< Define 16-bit register data type - typedef unsigned int REG32; ///< Define 32-bit register data type - - - #ifndef NULL - #define NULL (0) ///< NULL pointer - #endif - - #define TRUE (1) ///< Boolean true, define to use in API parameters or return value - #define FALSE (0) ///< Boolean false, define to use in API parameters or return value - - #define ENABLE (1) ///< Enable, define to use in API parameters - #define DISABLE (0) ///< Disable, define to use in API parameters - - - #define Successful 0 ///< Function return value success - #define Fail 1 ///< Function return value failed - - /* Define one bit mask */ - #define BIT0 (0x00000001) ///< Bit 0 mask of an 32 bit integer - #define BIT1 (0x00000002) ///< Bit 1 mask of an 32 bit integer - #define BIT2 (0x00000004) ///< Bit 2 mask of an 32 bit integer - #define BIT3 (0x00000008) ///< Bit 3 mask of an 32 bit integer - #define BIT4 (0x00000010) ///< Bit 4 mask of an 32 bit integer - #define BIT5 (0x00000020) ///< Bit 5 mask of an 32 bit integer - #define BIT6 (0x00000040) ///< Bit 6 mask of an 32 bit integer - #define BIT7 (0x00000080) ///< Bit 7 mask of an 32 bit integer - #define BIT8 (0x00000100) ///< Bit 8 mask of an 32 bit integer - #define BIT9 (0x00000200) ///< Bit 9 mask of an 32 bit integer - #define BIT10 (0x00000400) ///< Bit 10 mask of an 32 bit integer - #define BIT11 (0x00000800) ///< Bit 11 mask of an 32 bit integer - #define BIT12 (0x00001000) ///< Bit 12 mask of an 32 bit integer - #define BIT13 (0x00002000) ///< Bit 13 mask of an 32 bit integer - #define BIT14 (0x00004000) ///< Bit 14 mask of an 32 bit integer - #define BIT15 (0x00008000) ///< Bit 15 mask of an 32 bit integer - #define BIT16 (0x00010000) ///< Bit 16 mask of an 32 bit integer - #define BIT17 (0x00020000) ///< Bit 17 mask of an 32 bit integer - #define BIT18 (0x00040000) ///< Bit 18 mask of an 32 bit integer - #define BIT19 (0x00080000) ///< Bit 19 mask of an 32 bit integer - #define BIT20 (0x00100000) ///< Bit 20 mask of an 32 bit integer - #define BIT21 (0x00200000) ///< Bit 21 mask of an 32 bit integer - #define BIT22 (0x00400000) ///< Bit 22 mask of an 32 bit integer - #define BIT23 (0x00800000) ///< Bit 23 mask of an 32 bit integer - #define BIT24 (0x01000000) ///< Bit 24 mask of an 32 bit integer - #define BIT25 (0x02000000) ///< Bit 25 mask of an 32 bit integer - #define BIT26 (0x04000000) ///< Bit 26 mask of an 32 bit integer - #define BIT27 (0x08000000) ///< Bit 27 mask of an 32 bit integer - #define BIT28 (0x10000000) ///< Bit 28 mask of an 32 bit integer - #define BIT29 (0x20000000) ///< Bit 29 mask of an 32 bit integer - #define BIT30 (0x40000000) ///< Bit 30 mask of an 32 bit integer - #define BIT31 (0x80000000) ///< Bit 31 mask of an 32 bit integer - - /* Byte Mask Definitions */ - #define BYTE0_Msk (0x000000FF) ///< Mask to get bit0~bit7 from a 32 bit integer - #define BYTE1_Msk (0x0000FF00) ///< Mask to get bit8~bit15 from a 32 bit integer - #define BYTE2_Msk (0x00FF0000) ///< Mask to get bit16~bit23 from a 32 bit integer - #define BYTE3_Msk (0xFF000000) ///< Mask to get bit24~bit31 from a 32 bit integer - - #define GET_BYTE0(u32Param) ((u32Param & BYTE0_Msk) ) /*!< Extract Byte 0 (Bit 0~ 7) from parameter u32Param */ - #define GET_BYTE1(u32Param) ((u32Param & BYTE1_Msk) >> 8) /*!< Extract Byte 1 (Bit 8~15) from parameter u32Param */ - #define GET_BYTE2(u32Param) ((u32Param & BYTE2_Msk) >> 16) /*!< Extract Byte 2 (Bit 16~23) from parameter u32Param */ - #define GET_BYTE3(u32Param) ((u32Param & BYTE3_Msk) >> 24) /*!< Extract Byte 3 (Bit 24~31) from parameter u32Param */ - - #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 */ - -#endif /* __NUC980_H__ */ - -/*@}*/ /* end of group Legacy_Constants */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver.uvprojx b/bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver.uvprojx deleted file mode 100644 index 4c4d8b40cad..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver.uvprojx +++ /dev/null @@ -1,495 +0,0 @@ - - - - 2.1 - -
### uVision Project, (C) Keil Software
- - - - libstddriver-nuc980 - 0x4 - ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC - 0 - - - AT91SAM9260 - Atmel - IRAM(0x200000-0x200FFF) IRAM2(0x300000-0x300FFF) IROM(0x100000-0x107FFF) CLOCK(18432000) CPUTYPE(ARM926EJ-S) - - "STARTUP\Atmel\SAM9260.s" ("Atmel AT91SAM9260 Startup Code") - UL2ARM(-UV2077N9E -O47 -S0 -C0 -N00("ARM926EJ-S Core") -D00(0792603F) -L00(4) -FO7 -FD300000 -FC1000 -FN1 -FF0AT91SAM9_DF_P1056_CS1 -FS020000000 -FL083BE00) - 4210 - AT91SAM9260.H - - - - - - - - - - - 0 - 0 - - - - Atmel\SAM9260\ - Atmel\SAM9260\ - - 0 - 0 - 0 - 0 - 1 - - .\build\keil5\ - libstddriver_keil - 0 - 1 - 1 - 1 - 1 - .\build\keil5\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 1 - 0 - xcopy /y ".\build\keil5\@L.lib" "." - - 0 - 0 - 0 - 0 - - 1 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - 1 - - - SARM.DLL - -cAT91SAM9260 - DARMATS9.DLL - -p91SAM9260 - SARM.DLL - - TARMATS9.DLL - -p91SAM9260 - - - - 1 - 0 - 0 - 0 - 16 - - - - - 1 - 0 - 0 - 0 - 1 - 4098 - - 0 - Segger\JLTAgdi.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 - ARM926EJ-S - - 0 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 1 - 0 - 8 - 0 - 0 - 0 - 0 - 3 - 3 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x200000 - 0x1000 - - - 1 - 0x100000 - 0x8000 - - - 0 - 0x0 - 0x0 - - - 1 - 0x20000000 - 0x800000 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x100000 - 0x8000 - - - 1 - 0x0 - 0x0 - - - 0 - 0x20800000 - 0x1800000 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x200000 - 0x1000 - - - 0 - 0x300000 - 0x1000 - - - - - - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 2 - 0 - 0 - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - - --c99 - - - ..\Include;..\Library - - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - 0 - 1 - 0 - 0x20000000 - 0x20800000 - - - - - - - - - - - - - src - - - nu_can.c - 1 - ..\Source\nu_can.c - - - nu_cap.c - 1 - ..\Source\nu_cap.c - - - nu_crypto.c - 1 - ..\Source\nu_crypto.c - - - nu_ebi.c - 1 - ..\Source\nu_ebi.c - - - nu_emac.c - 1 - ..\Source\nu_emac.c - - - nu_etimer.c - 1 - ..\Source\nu_etimer.c - - - nu_gpio.c - 1 - ..\Source\nu_gpio.c - - - nu_i2c.c - 1 - ..\Source\nu_i2c.c - - - nu_i2s.c - 1 - ..\Source\nu_i2s.c - - - nu_pdma.c - 1 - ..\Source\nu_pdma.c - - - nu_qspi.c - 1 - ..\Source\nu_qspi.c - - - nu_rtc.c - 1 - ..\Source\nu_rtc.c - - - nu_scuart.c - 1 - ..\Source\nu_scuart.c - - - nu_sdh.c - 1 - ..\Source\nu_sdh.c - - - nu_spi.c - 1 - ..\Source\nu_spi.c - - - nu_sys.c - 1 - ..\Source\nu_sys.c - - - nu_uart.c - 1 - ..\Source\nu_uart.c - - - nu_usbd.c - 1 - ..\Source\nu_usbd.c - - - nu_wdt.c - 1 - ..\Source\nu_wdt.c - - - nu_wwdt.c - 1 - ..\Source\nu_wwdt.c - - - - - - - - - - - - - -
diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver_4.uvproj b/bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver_4.uvproj deleted file mode 100644 index b5e013f72a6..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Library/libStdDriver_4.uvproj +++ /dev/null @@ -1,501 +0,0 @@ - - - - 1.1 - -
### uVision Project, (C) Keil Software
- - - - libStdDriver_4 - 0x4 - ARM-ADS - - - Nuvoton_ARM9_Series - Nuvoton - - - - - 0 - - - - - - - - - - - - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - .\build\keil4\ - libstddriver_keil4 - 0 - 1 - 1 - 1 - 1 - .\build\keil4\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - - - 1 - 0 - xcopy /y ".\build\keil4\@L.lib" "." - - 0 - 0 - - 0 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - - - SARM.DLL - -cAT91SAM9 - DARMATS9.DLL - -p91SAM9260 - SARM.DLL - - TARMATS9.DLL - -p91SAM9260 - - - - 1 - 0 - 0 - 0 - 16 - - - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - - - 1 - 0 - 1 - 1 - 1 - 1 - 0 - 1 - 1 - - 0 - -1 - - - - - - - - - - - - - - - - - - - 1 - 0 - 0 - 1 - 1 - 4101 - - 0 - NULink\Nu_Link.dll - - - - - - 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 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 3 - 3 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x20000000 - 0x28000 - - - 1 - 0x0 - 0x80000 - - - 0 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - - - - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - --c99 - - - ..\Library;..\Include - - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - 0 - 1 - 0 - 0x00000000 - 0x20000000 - - - - - - - - - - - - src - - - nu_can.c - 1 - ..\Source\nu_can.c - - - nu_cap.c - 1 - ..\Source\nu_cap.c - - - nu_crypto.c - 1 - ..\Source\nu_crypto.c - - - nu_ebi.c - 1 - ..\Source\nu_ebi.c - - - nu_emac.c - 1 - ..\Source\nu_emac.c - - - nu_etimer.c - 1 - ..\Source\nu_etimer.c - - - nu_gpio.c - 1 - ..\Source\nu_gpio.c - - - nu_i2c.c - 1 - ..\Source\nu_i2c.c - - - nu_i2s.c - 1 - ..\Source\nu_i2s.c - - - nu_pdma.c - 1 - ..\Source\nu_pdma.c - - - nu_qspi.c - 1 - ..\Source\nu_qspi.c - - - nu_rtc.c - 1 - ..\Source\nu_rtc.c - - - nu_scuart.c - 1 - ..\Source\nu_scuart.c - - - nu_sdh.c - 1 - ..\Source\nu_sdh.c - - - nu_spi.c - 1 - ..\Source\nu_spi.c - - - nu_sys.c - 1 - ..\Source\nu_sys.c - - - nu_uart.c - 1 - ..\Source\nu_uart.c - - - nu_usbd.c - 1 - ..\Source\nu_usbd.c - - - nu_wdt.c - 1 - ..\Source\nu_wdt.c - - - nu_wwdt.c - 1 - ..\Source\nu_wwdt.c - - - - - - - -
diff --git a/bsp/nuvoton/libraries/nuc980/Driver/SConscript b/bsp/nuvoton/libraries/nuc980/Driver/SConscript deleted file mode 100644 index b2639335d59..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/SConscript +++ /dev/null @@ -1,26 +0,0 @@ -# RT-Thread building script for component -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -libs = [] -src = Glob('Source/*.c') + Glob('Source/*.cpp') -cpppath = [cwd + '/Include'] -libpath = [cwd + '/Library'] - -if not GetDepend('BSP_USE_STDDRIVER_SOURCE'): - if rtconfig.PLATFORM in ['armcc', 'armclang']: - if GetOption('target') == 'mdk4' and os.path.isfile('./Library/libstddriver_keil4.lib'): - libs += ['libstddriver_keil4'] - if GetOption('target') == 'mdk5' and os.path.isfile('./Library/libstddriver_keil.lib'): - libs += ['libstddriver_keil'] - elif rtconfig.PLATFORM in ['gcc'] and os.path.isfile('./Library/libstddriver_gcc.a'): - libs += ['libstddriver_gcc'] - -if not libs: - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath) -else: - src = [] - group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath) - -Return('group') diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_can.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_can.c deleted file mode 100644 index ef93e202fb0..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_can.c +++ /dev/null @@ -1,1286 +0,0 @@ -/**************************************************************************//** - * @file can.c - * @version V2.00 - * @brief NUC980 series CAN driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nu_can.h" -#include "nu_sys.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CAN_Driver CAN Driver - @{ -*/ - -/** @addtogroup CAN_EXPORTED_FUNCTIONS CAN Exported Functions - @{ -*/ - -/** @cond HIDDEN_SYMBOLS */ - -static uint8_t gu8LockCanIf[4ul][2ul] = {0ul}; /* The chip have 4 CANs. */ - -#define RETRY_COUNTS (0x10000000ul) - -#define TSEG1_MIN 2ul -#define TSEG1_MAX 16ul -#define TSEG2_MIN 1ul -#define TSEG2_MAX 8ul -#define BRP_MIN 1ul -#define BRP_MAX 1024ul /* 6-bit BRP field + 4-bit BRPE field*/ -#define SJW_MAX 4ul -#define BRP_INC 1ul - -/* #define DEBUG_PRINTF printf */ -#define DEBUG_PRINTF(...) - -static uint32_t CAN_Clock = 75000000ul; - -static uint32_t LockIF(CAN_T *tCAN); -static uint32_t LockIF_TL(CAN_T *tCAN); -static void ReleaseIF(CAN_T *tCAN, uint32_t u32IfNo); -static int can_update_spt(int sampl_pt, int tseg, int *tseg1, int *tseg2); - -/** - * @brief Check if any interface is available then lock it for usage. - * @param[in] tCAN The pointer to CAN module base address. - * @retval 0 IF0 is free - * @retval 1 IF1 is free - * @retval 2 No IF is free - * @details Search the first free message interface, starting from 0. If a interface is - * available, set a flag to lock the interface. - */ -static uint32_t LockIF(CAN_T *tCAN) -{ - uint32_t u32CanNo; - uint32_t u32FreeIfNo = 2ul; - uint32_t u32IntMask; - - if (tCAN == CAN0) - u32CanNo = 0ul; -#if defined(CAN1) - else if (tCAN == CAN1) - u32CanNo = 1ul; -#endif -#if defined(CAN2) - else if (tCAN == CAN2) - u32CanNo = 2ul; -#endif -#if defined(CAN3) - else if (tCAN == CAN3) - u32CanNo = 3ul; -#endif - else - return u32FreeIfNo; - - /* Disable CAN interrupt */ - u32IntMask = tCAN->CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - /* Check interface 1 is available or not */ - if ((tCAN->IF[0ul].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - if (gu8LockCanIf[u32CanNo][0ul] == 0ul) - { - gu8LockCanIf[u32CanNo][0ul] = 1u; - u32FreeIfNo = 0ul; - } - else - { - } - } - else - { - } - - /* Or check interface 2 is available or not */ - if (u32FreeIfNo == 2ul) - { - if ((tCAN->IF[1ul].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - if (gu8LockCanIf[u32CanNo][1ul] == 0ul) - { - gu8LockCanIf[u32CanNo][1ul] = 1u; - u32FreeIfNo = 1ul; - } - else - { - } - } - else - { - } - } - else - { - } - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - - return u32FreeIfNo; -} - -/** - * @brief Check if any interface is available in a time limitation then lock it for usage. - * @param[in] tCAN The pointer to CAN module base address. - * @retval 0 IF0 is free - * @retval 1 IF1 is free - * @retval 2 No IF is free - * @details Search the first free message interface, starting from 0. If no interface is - * it will try again until time out. If a interface is available, set a flag to - * lock the interface. - */ -static uint32_t LockIF_TL(CAN_T *tCAN) -{ - uint32_t u32Count; - uint32_t u32FreeIfNo; - - for (u32Count = 0ul; u32Count < RETRY_COUNTS; u32Count++) - { - if ((u32FreeIfNo = LockIF(tCAN)) != 2ul) - { - break; - } - else - { - } - } - - return u32FreeIfNo; -} - -/** - * @brief Release locked interface. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Info The interface number, 0 or 1. - * @return none - * @details Release the locked interface. - */ -static void ReleaseIF(CAN_T *tCAN, uint32_t u32IfNo) -{ - uint32_t u32IntMask; - uint32_t u32CanNo; - - if (u32IfNo >= 2ul) - { - } - else - { - if (tCAN == CAN0) - u32CanNo = 0ul; -#if defined(CAN1) - else if (tCAN == CAN1) - u32CanNo = 1ul; -#endif -#if defined(CAN2) - else if (tCAN == CAN2) - u32CanNo = 2ul; -#endif -#if defined(CAN3) - else if (tCAN == CAN3) - u32CanNo = 3ul; -#endif - else - return ; - - - /* Disable CAN interrupt */ - u32IntMask = tCAN->CON & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - tCAN->CON = tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk); - - gu8LockCanIf[u32CanNo][u32IfNo] = 0u; - - /* Enable CAN interrupt */ - tCAN->CON |= u32IntMask; - } -} - -static int can_update_spt(int sampl_pt, int tseg, int *tseg1, int *tseg2) -{ - *tseg2 = tseg + 1 - (sampl_pt * (tseg + 1)) / 1000; - if (*tseg2 < TSEG2_MIN) - { - *tseg2 = TSEG2_MIN; - } - else - { - } - - if (*tseg2 > TSEG2_MAX) - { - *tseg2 = TSEG2_MAX; - } - else - { - } - - *tseg1 = tseg - *tseg2; - if (*tseg1 > TSEG1_MAX) - { - *tseg1 = TSEG1_MAX; - *tseg2 = tseg - *tseg1; - } - else - { - } - - return 1000 * (tseg + 1 - *tseg2) / (tseg + 1); -} - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Enter initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8Mask Following values can be used. - * \ref CAN_CON_DAR_Msk Disable automatic retransmission. - * \ref CAN_CON_EIE_Msk Enable error interrupt. - * \ref CAN_CON_SIE_Msk Enable status interrupt. - * \ref CAN_CON_IE_Msk CAN interrupt. - * @return None - * @details This function is used to set CAN to enter initialization mode and enable access bit timing - * register. After bit timing configuration ready, user must call CAN_LeaveInitMode() - * to leave initialization mode and lock bit timing register to let new configuration - * take effect. - */ -void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask) -{ - tCAN->CON = u8Mask | (CAN_CON_INIT_Msk | CAN_CON_CCE_Msk); -} - - -/** - * @brief Leave initialization mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to set CAN to leave initialization mode to let - * bit timing configuration take effect after configuration ready. - */ -void CAN_LeaveInitMode(CAN_T *tCAN) -{ - tCAN->CON &= (~(CAN_CON_INIT_Msk | CAN_CON_CCE_Msk)); - while (tCAN->CON & CAN_CON_INIT_Msk) - { - /* Check INIT bit is released */ - } -} - -/** - * @brief Wait message into message buffer in basic mode. - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to wait message into message buffer in basic mode. Please notice the - * function is polling NEWDAT bit of MCON register by while loop and it is used in basic mode. - */ -void CAN_WaitMsg(CAN_T *tCAN) -{ - tCAN->STATUS = 0x0ul; /* clr status */ - - while (1) - { - if (tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) /* check new data */ - { - /* New Data IN */ - break; - } - else - { - } - - if (tCAN->STATUS & CAN_STATUS_RXOK_Msk) - { - /* Rx OK */ - } - else - { - } - - if (tCAN->STATUS & CAN_STATUS_LEC_Msk) - { - /* Error */ - } - else - { - } - } -} - -/** - * @brief Get current bit rate - * @param[in] tCAN The pointer to CAN module base address. - * @return Current Bit-Rate (kilo bit per second) - * @details Return current CAN bit rate according to the user bit-timing parameter settings - */ -uint32_t CAN_GetCANBitRate(CAN_T *tCAN) -{ - uint32_t u32Tseg1, u32Tseg2; - uint32_t u32Bpr; - - u32Tseg1 = (tCAN->BTIME & CAN_BTIME_TSEG1_Msk) >> CAN_BTIME_TSEG1_Pos; - u32Tseg2 = (tCAN->BTIME & CAN_BTIME_TSEG2_Msk) >> CAN_BTIME_TSEG2_Pos; - u32Bpr = (tCAN->BTIME & CAN_BTIME_BRP_Msk) | (tCAN->BRPE << 6ul); - - return (CAN_Clock / (u32Bpr + 1ul) / (u32Tseg1 + u32Tseg2 + 3ul)); -} - -/** - * @brief Switch the CAN into test mode. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8TestMask Specifies the configuration in test modes - * \ref CAN_TEST_BASIC_Msk Enable basic mode of test mode - * \ref CAN_TEST_SILENT_Msk Enable silent mode of test mode - * \ref CAN_TEST_LBACK_Msk Enable Loop Back Mode of test mode - * \ref CAN_TEST_Tx_Msk Control CAN_TX pin bit field - * @return None - * @details Switch the CAN into test mode. There are four test mode (BASIC/SILENT/LOOPBACK/ - * LOOPBACK combined SILENT/CONTROL_TX_PIN)could be selected. After setting test mode,user - * must call CAN_LeaveInitMode() to let the setting take effect. - */ -void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST = u8TestMask; -} - - -/** - * @brief Leave the test mode - * @param[in] tCAN The pointer to CAN module base address. - * @return None - * @details This function is used to Leave the test mode (switch into normal mode). - */ -void CAN_LeaveTestMode(CAN_T *tCAN) -{ - tCAN->CON |= CAN_CON_TEST_Msk; - tCAN->TEST &= ~(CAN_TEST_LBACK_Msk | CAN_TEST_SILENT_Msk | CAN_TEST_BASIC_Msk); - tCAN->CON &= (~CAN_CON_TEST_Msk); -} - -/** - * @brief Get the waiting status of a received message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @retval non-zero The corresponding message object has a new data bit is set. - * @retval 0 No message object has new data. - * @details This function is used to get the waiting status of a received message. - */ -uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj) -{ - return (u8MsgObj < 16ul ? tCAN->NDAT1 & (1ul << u8MsgObj) : tCAN->NDAT2 & (1ul << (u8MsgObj - 16ul))); -} - - -/** - * @brief Send CAN message in BASIC mode of test mode - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure containing data to transmit. - * @return TRUE: Transmission OK - * FALSE: Check busy flag of interface 0 is timeout - * @details The function is used to send CAN message in BASIC mode of test mode. Before call the API, - * the user should be call CAN_EnterTestMode(CAN_TEST_BASIC) and let CAN controller enter - * basic mode of test mode. Please notice IF1 Registers used as Tx Buffer in basic mode. - */ -int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg) -{ - uint32_t i = 0ul; - int32_t rev = 1l; - - while (tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - } - - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - if (pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[0].ARB1 = 0ul; - tCAN->IF[0].ARB2 = (((pCanMsg->Id) & 0x7FFul) << 2ul) ; - } - else - { - /* extended ID*/ - tCAN->IF[0].ARB1 = (pCanMsg->Id) & 0xFFFFul; - tCAN->IF[0].ARB2 = ((pCanMsg->Id) & 0x1FFF0000ul) >> 16ul | CAN_IF_ARB2_XTD_Msk; - - } - - if (pCanMsg->FrameType) - { - tCAN->IF[0].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[0].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - tCAN->IF[0].MCON = (tCAN->IF[0].MCON & (~CAN_IF_MCON_DLC_Msk)) | pCanMsg->DLC; - tCAN->IF[0].DAT_A1 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[1] << 8) | pCanMsg->Data[0]); - tCAN->IF[0].DAT_A2 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[3] << 8) | pCanMsg->Data[2]); - tCAN->IF[0].DAT_B1 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[5] << 8) | pCanMsg->Data[4]); - tCAN->IF[0].DAT_B2 = (uint16_t)((uint16_t)((uint16_t)pCanMsg->Data[7] << 8) | pCanMsg->Data[6]); - - /* request transmission*/ - tCAN->IF[0].CREQ &= (~CAN_IF_CREQ_BUSY_Msk); - if (tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /* Cannot clear busy for sending ...*/ - rev = 0l; /* return FALSE */ - } - else - { - tCAN->IF[0].CREQ |= CAN_IF_CREQ_BUSY_Msk; /* sending */ - - for (i = 0ul; i < 0xFFFFFul; i++) - { - if ((tCAN->IF[0].CREQ & CAN_IF_CREQ_BUSY_Msk) == 0ul) - { - break; - } - else - { - } - } - - if (i >= 0xFFFFFul) - { - /* Cannot send out... */ - rev = 0l; /* return FALSE */ - } - else - { - } - } - - return rev; -} - -/** - * @brief Get a message information in BASIC mode. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @return FALSE No any message received. - * TRUE Receive a message success. - * - */ -int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - - if ((tCAN->IF[1].MCON & CAN_IF_MCON_NEWDAT_Msk) == 0ul) - { - /* In basic mode, receive data always save in IF2 */ - rev = 0; /* return FALSE */ - } - else - { - - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - tCAN->IF[1].CMASK = CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - if ((tCAN->IF[1].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0ul) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 >> 2) & 0x07FFul; - - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = (tCAN->IF[1].ARB2 & 0x1FFFul) << 16; - pCanMsg->Id |= (uint32_t)tCAN->IF[1].ARB1; - } - - pCanMsg->FrameType = (((tCAN->IF[1].ARB2 & CAN_IF_ARB2_DIR_Msk) >> CAN_IF_ARB2_DIR_Pos)) ? 0ul : 1ul; - - pCanMsg->DLC = (uint8_t)(tCAN->IF[1].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[1].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[1].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[1].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[1].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - } - - return rev; -} - -/** - * @brief Set Rx message object, include ID mask. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u32idmask Specifies the identifier mask used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* Command Setting */ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFul) << 2; - } - else - { - tCAN->IF[u32MsgIfNum].ARB1 = u32id & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000ul) >> 16; - } - - tCAN->IF[u32MsgIfNum].MASK1 = (u32idmask & 0xFFFFul); - tCAN->IF[u32MsgIfNum].MASK2 = (u32idmask >> 16) & 0xFFFFul; - - /* tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; */ - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if (u8singleOrFifoLast) - { - tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_A2 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B2 = 0ul; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Set Rx message object - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8idType Specifies the identifier type of the frames that will be transmitted - * This parameter can be one of the following values: - * \ref CAN_STD_ID (standard ID, 11-bit) - * \ref CAN_EXT_ID (extended ID, 29-bit) - * @param[in] u32id Specifies the identifier used for acceptance filtering. - * @param[in] u8singleOrFifoLast Specifies the end-of-buffer indicator. - * This parameter can be one of the following values: - * TRUE: for a single receive object or a FIFO receive object that is the last one of the FIFO. - * FALSE: for a FIFO receive object that is not the last one. - * @retval TRUE SUCCESS - * @retval FALSE No useful interface - * @details The function is used to configure a receive message object. - */ -int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* Command Setting */ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (u8idType == CAN_STD_ID) /* According STD/EXT ID format,Configure Mask and Arbitration register */ - { - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | (u32id & 0x7FFul) << 2; - } - else - { - tCAN->IF[u32MsgIfNum].ARB1 = u32id & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = CAN_IF_ARB2_MSGVAL_Msk | CAN_IF_ARB2_XTD_Msk | (u32id & 0x1FFF0000ul) >> 16; - } - - /* tCAN->IF[u8MsgIfNum].MCON |= CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; */ - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_UMASK_Msk | CAN_IF_MCON_RXIE_Msk; - if (u8singleOrFifoLast) - { - tCAN->IF[u32MsgIfNum].MCON |= CAN_IF_MCON_EOB_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].MCON &= (~CAN_IF_MCON_EOB_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_A2 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B1 = 0ul; - tCAN->IF[u32MsgIfNum].DAT_B2 = 0ul; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Gets the message - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u8MsgObj Specifies the Message object number, from 0 to 31. - * @param[in] u8Release Specifies the message release indicator. - * This parameter can be one of the following values: - * TRUE: the message object is released when getting the data. - * FALSE:the message object is not released. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * @retval TRUE Success - * @retval FALSE No any message received - * @details Gets the message, if received. - */ -int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if (!CAN_IsNewDataReceived(tCAN, u8MsgObj)) - { - rev = 0; /* return FALSE */ - } - else - { - /* Get and lock a free interface */ - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - tCAN->STATUS &= (~CAN_STATUS_RXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_MASK_Msk - | CAN_IF_CMASK_ARB_Msk - | CAN_IF_CMASK_CONTROL_Msk - | CAN_IF_CMASK_CLRINTPND_Msk - | (u8Release ? CAN_IF_CMASK_TXRQSTNEWDAT_Msk : 0ul) - | CAN_IF_CMASK_DATAA_Msk - | CAN_IF_CMASK_DATAB_Msk; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u8MsgObj; - - while (tCAN->IF[u32MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - - if ((tCAN->IF[u32MsgIfNum].ARB2 & CAN_IF_ARB2_XTD_Msk) == 0ul) - { - /* standard ID*/ - pCanMsg->IdType = CAN_STD_ID; - pCanMsg->Id = (tCAN->IF[u32MsgIfNum].ARB2 & CAN_IF_ARB2_ID_Msk) >> 2ul; - } - else - { - /* extended ID*/ - pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = (((tCAN->IF[u32MsgIfNum].ARB2) & 0x1FFFul) << 16) | tCAN->IF[u32MsgIfNum].ARB1; - } - - pCanMsg->DLC = (uint8_t)(tCAN->IF[u32MsgIfNum].MCON & CAN_IF_MCON_DLC_Msk); - pCanMsg->Data[0] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA0_Msk); - pCanMsg->Data[1] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_A1 & CAN_IF_DAT_A1_DATA1_Msk) >> CAN_IF_DAT_A1_DATA1_Pos); - pCanMsg->Data[2] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA2_Msk); - pCanMsg->Data[3] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_A2 & CAN_IF_DAT_A2_DATA3_Msk) >> CAN_IF_DAT_A2_DATA3_Pos); - pCanMsg->Data[4] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA4_Msk); - pCanMsg->Data[5] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_B1 & CAN_IF_DAT_B1_DATA5_Msk) >> CAN_IF_DAT_B1_DATA5_Pos); - pCanMsg->Data[6] = (uint8_t)(tCAN->IF[u32MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA6_Msk); - pCanMsg->Data[7] = (uint8_t)((tCAN->IF[u32MsgIfNum].DAT_B2 & CAN_IF_DAT_B2_DATA7_Msk) >> CAN_IF_DAT_B2_DATA7_Pos); - - ReleaseIF(tCAN, u32MsgIfNum); - } - } - - return rev; -} - - -/** - * @brief Set bus baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * - * @return u32CurrentBitRate Real baud-rate value. - * - * @details The function is used to set bus timing parameter according current clock and target baud-rate. - */ -uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate) -{ - long rate; - long best_error = 1000000000, error = 0; - int best_tseg = 0, best_brp = 0, brp = 0; - int tsegall, tseg = 0, tseg1 = 0, tseg2 = 0; - int spt_error = 1000, spt = 0, sampl_pt; - uint64_t clock_freq = (uint64_t)0, u64PCLK_DIV = (uint64_t)1; - uint32_t sjw = (uint32_t)1; - - CAN_EnterInitMode(tCAN, (uint8_t)0); - - CAN_Clock = sysGetClock(SYS_PCLK2) * 1000000; - - clock_freq = CAN_Clock / u64PCLK_DIV; - - if (u32BaudRate >= (uint32_t)1000000) - { - u32BaudRate = (uint32_t)1000000; - } - - /* Use CIA recommended sample points */ - if (u32BaudRate > (uint32_t)800000) - { - sampl_pt = (int)750; - } - else if (u32BaudRate > (uint32_t)500000) - { - sampl_pt = (int)800; - } - else - { - sampl_pt = (int)875; - } - - /* tseg even = round down, odd = round up */ - for (tseg = (TSEG1_MAX + TSEG2_MAX) * 2ul + 1ul; tseg >= (TSEG1_MIN + TSEG2_MIN) * 2ul; tseg--) - { - tsegall = 1ul + tseg / 2ul; - /* Compute all possible tseg choices (tseg=tseg1+tseg2) */ - brp = clock_freq / (tsegall * u32BaudRate) + tseg % 2; - /* chose brp step which is possible in system */ - brp = (brp / BRP_INC) * BRP_INC; - - if ((brp < BRP_MIN) || (brp > BRP_MAX)) - { - continue; - } - rate = clock_freq / (brp * tsegall); - - error = u32BaudRate - rate; - - /* tseg brp biterror */ - if (error < 0) - { - error = -error; - } - if (error > best_error) - { - continue; - } - best_error = error; - if (error == 0) - { - spt = can_update_spt(sampl_pt, tseg / 2, &tseg1, &tseg2); - error = sampl_pt - spt; - if (error < 0) - { - error = -error; - } - if (error > spt_error) - { - continue; - } - spt_error = error; - } - best_tseg = tseg / 2; - best_brp = brp; - - if (error == 0) - { - break; - } - } - - spt = can_update_spt(sampl_pt, best_tseg, &tseg1, &tseg2); - - /* check for sjw user settings */ - /* bt->sjw is at least 1 -> sanitize upper bound to sjw_max */ - if (sjw > SJW_MAX) - { - sjw = SJW_MAX; - } - /* bt->sjw must not be higher than tseg2 */ - if (tseg2 < sjw) - { - sjw = tseg2; - } - - /* real bit-rate */ - u32BaudRate = clock_freq / (best_brp * (tseg1 + tseg2 + 1)); - - tCAN->BTIME = ((uint32_t)(tseg2 - 1ul) << CAN_BTIME_TSEG2_Pos) | ((uint32_t)(tseg1 - 1ul) << CAN_BTIME_TSEG1_Pos) | - ((uint32_t)(best_brp - 1ul) & CAN_BTIME_BRP_Msk) | (sjw << CAN_BTIME_SJW_Pos); - tCAN->BRPE = ((uint32_t)(best_brp - 1ul) >> 6) & 0x0Ful; - - /* printf("\n bitrate = %d \n", CAN_GetCANBitRate(tCAN)); */ - - CAN_LeaveInitMode(tCAN); - - return u32BaudRate; -} - -/** - * @brief The function is used to disable all CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * - * @return None - * - * @details No Status Change Interrupt and Error Status Interrupt will be generated. - */ -void CAN_Close(CAN_T *tCAN) -{ - CAN_DisableInt(tCAN, (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - -/** - * @brief Set CAN operation mode and target baud-rate. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32BaudRate The target CAN baud-rate. The range of u32BaudRate is 1~1000KHz. - * @param[in] u32Mode The CAN operation mode. Valid values are: - * - \ref CAN_NORMAL_MODE Normal operation. - * - \ref CAN_BASIC_MODE Basic mode. - * @return u32CurrentBitRate Real baud-rate value. - * - * @details Set bus timing parameter according current clock and target baud-rate. - * In Basic mode, IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer. - */ -uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode) -{ - uint32_t u32CurrentBitRate; - - u32CurrentBitRate = CAN_SetBaudRate(tCAN, u32BaudRate); - - if (u32Mode == CAN_BASIC_MODE) - { - CAN_EnterTestMode(tCAN, (uint8_t)CAN_TEST_BASIC_Msk); - } - else - { - } - - return u32CurrentBitRate; -} - -/** - * @brief The function is used to configure a transmit object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No useful interface. - * @retval TRUE Config message object success. - * - * @details The two sets of interface registers (IF1 and IF2) control the software access to the Message RAM. - * They buffer the data to be transferred to and from the RAM, avoiding conflicts between software accesses and message reception/transmission. - */ -int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - /* update the contents needed for transmission*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_MASK_Msk | CAN_IF_CMASK_ARB_Msk | - CAN_IF_CMASK_CONTROL_Msk | CAN_IF_CMASK_DATAA_Msk | CAN_IF_CMASK_DATAB_Msk; - - if (pCanMsg->IdType == CAN_STD_ID) - { - /* standard ID*/ - tCAN->IF[u32MsgIfNum].ARB1 = 0ul; - tCAN->IF[u32MsgIfNum].ARB2 = (((pCanMsg->Id) & 0x7FFul) << 2) | CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - else - { - /* extended ID*/ - tCAN->IF[u32MsgIfNum].ARB1 = (pCanMsg->Id) & 0xFFFFul; - tCAN->IF[u32MsgIfNum].ARB2 = ((pCanMsg->Id) & 0x1FFF0000ul) >> 16 | - CAN_IF_ARB2_DIR_Msk | CAN_IF_ARB2_XTD_Msk | CAN_IF_ARB2_MSGVAL_Msk; - } - - if (pCanMsg->FrameType) - { - tCAN->IF[u32MsgIfNum].ARB2 |= CAN_IF_ARB2_DIR_Msk; - } - else - { - tCAN->IF[u32MsgIfNum].ARB2 &= (~CAN_IF_ARB2_DIR_Msk); - } - - tCAN->IF[u32MsgIfNum].DAT_A1 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[1] << 8)) | pCanMsg->Data[0]); - tCAN->IF[u32MsgIfNum].DAT_A2 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[3] << 8)) | pCanMsg->Data[2]); - tCAN->IF[u32MsgIfNum].DAT_B1 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[5] << 8)) | pCanMsg->Data[4]); - tCAN->IF[u32MsgIfNum].DAT_B2 = (uint16_t)((uint16_t)(((uint16_t)pCanMsg->Data[7] << 8)) | pCanMsg->Data[6]); - - tCAN->IF[u32MsgIfNum].MCON = CAN_IF_MCON_NEWDAT_Msk | pCanMsg->DLC | CAN_IF_MCON_TXIE_Msk | CAN_IF_MCON_EOB_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Set transmit request bit. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return TRUE: Start transmit message. - * - * @details If a transmission is requested by programming bit TxRqst/NewDat (IFn_CMASK[2]), the TxRqst (IFn_MCON[8]) will be ignored. - */ -int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum) -{ - int32_t rev = 1l; - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - rev = 0; /* return FALSE */ - } - else - { - tCAN->STATUS &= (~CAN_STATUS_TXOK_Msk); - - /* read the message contents*/ - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk - | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - while (tCAN->IF[u32MsgIfNum].CREQ & CAN_IF_CREQ_BUSY_Msk) - { - /*Wait*/ - } - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_WRRD_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); - } - - return rev; -} - -/** - * @brief Enable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. Valid values are: - * - \ref CAN_CON_IE_Msk Module interrupt enable. - * - \ref CAN_CON_SIE_Msk Status change interrupt enable. - * - \ref CAN_CON_EIE_Msk Error interrupt enable. - * - * @return None - * - * @details The application software has two possibilities to follow the source of a message interrupt. - * First, it can follow the IntId in the Interrupt Register and second it can poll the Interrupt Pending Register. - */ -void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = (tCAN->CON & ~(CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)) | - (u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk)); -} - -/** - * @brief Disable CAN interrupt. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32Mask Interrupt Mask. (CAN_CON_IE_Msk / CAN_CON_SIE_Msk / CAN_CON_EIE_Msk). - * - * @return None - * - * @details The interrupt remains active until the Interrupt Register is back to value zero (the cause of the interrupt is reset) or until IE is reset. - */ -void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask) -{ - tCAN->CON = tCAN->CON & ~((u32Mask & (CAN_CON_IE_Msk | CAN_CON_SIE_Msk | CAN_CON_EIE_Msk))); -} - - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32TimeOutCount = 0ul; - - while (CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)TRUE) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)(FALSE); /* return FALSE */ - break; - } - else - { - } - } - - return rev; -} - -/** - * @brief The function is used to configure a receive message object. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * @param[in] u32IDMask Specifies the identifier mask used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure a receive message object success. - * - * @details If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) - * will be set when a received Data Frame is accepted and stored in the Message Object. - */ -int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32TimeOutCount = 0ul; - - while (CAN_SetRxMsgObjAndMsk(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, u32IDMask, (uint8_t)TRUE) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)FALSE; - break; - } - else - { - } - } - - return rev; -} - -/** - * @brief The function is used to configure several receive message objects. - * - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum The starting MSG RAM number(0 ~ 31). - * @param[in] u32MsgCount the number of MSG RAM of the FIFO. - * @param[in] u32IDType Specifies the identifier type of the frames that will be transmitted. Valid values are: - * - \ref CAN_STD_ID The 11-bit identifier. - * - \ref CAN_EXT_ID The 29-bit identifier. - * @param[in] u32ID Specifies the identifier used for acceptance filtering. - * - * @retval FALSE No useful interface. - * @retval TRUE Configure receive message objects success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID) -{ - int32_t rev = (int32_t)TRUE; - uint32_t i; - uint32_t u32TimeOutCount; - uint32_t u32EOB_Flag = 0ul; - - for (i = 1ul; i <= u32MsgCount; i++) - { - u32TimeOutCount = 0ul; - - u32MsgNum += (i - 1ul); - - if (i == u32MsgCount) - { - u32EOB_Flag = 1ul; - } - else - { - } - - while (CAN_SetRxMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)u32IDType, u32ID, (uint8_t)u32EOB_Flag) == (int32_t)FALSE) - { - if (++u32TimeOutCount >= RETRY_COUNTS) - { - rev = (int32_t)FALSE; - break; - } - else - { - } - } - } - - return rev; -} - - -/** - * @brief Send CAN message. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE 1. When operation in basic mode: Transmit message time out. \n - * 2. When operation in normal mode: No useful interface. \n - * @retval TRUE Transmit Message success. - * - * @details The receive/transmit priority for the Message Objects is attached to the message number. - * Message Object 1 has the highest priority, while Message Object 32 has the lowest priority. - */ -int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32Tmp; - - u32Tmp = (tCAN->TEST & CAN_TEST_BASIC_Msk); - - if ((tCAN->CON & CAN_CON_TEST_Msk) && u32Tmp) - { - rev = CAN_BasicSendMsg(tCAN, pCanMsg); - } - else - { - if (CAN_SetTxMsg(tCAN, u32MsgNum, pCanMsg) == FALSE) - { - rev = (int32_t)FALSE; - } - else - { - CAN_TriggerTxMsg(tCAN, u32MsgNum); - } - } - - return rev; -} - - -/** - * @brief Gets the message, if received. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * @param[in] pCanMsg Pointer to the message structure where received data is copied. - * - * @retval FALSE No any message received. - * @retval TRUE Receive Message success. - * - * @details The Interface Registers avoid conflict between the CPU accesses to the Message RAM and CAN message reception - * and transmission by buffering the data to be transferred. - */ -int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T *pCanMsg) -{ - int32_t rev = (int32_t)TRUE; - uint32_t u32Tmp; - - u32Tmp = (tCAN->TEST & CAN_TEST_BASIC_Msk); - - if ((tCAN->CON & CAN_CON_TEST_Msk) && u32Tmp) - { - rev = CAN_BasicReceiveMsg(tCAN, pCanMsg); - } - else - { - rev = CAN_ReadMsgObj(tCAN, (uint8_t)u32MsgNum, (uint8_t)TRUE, pCanMsg); - } - - return rev; -} - -/** - * @brief Clear interrupt pending bit. - * @param[in] tCAN The pointer to CAN module base address. - * @param[in] u32MsgNum Specifies the Message object number, from 0 to 31. - * - * @return None - * - * @details An interrupt remains pending until the application software has cleared it. - */ -void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum) -{ - uint32_t u32MsgIfNum; - - if ((u32MsgIfNum = LockIF_TL(tCAN)) == 2ul) - { - u32MsgIfNum = 0ul; - } - else - { - } - - tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk | CAN_IF_CMASK_TXRQSTNEWDAT_Msk; - tCAN->IF[u32MsgIfNum].CREQ = 1ul + u32MsgNum; - - ReleaseIF(tCAN, u32MsgIfNum); -} - - -/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CAN_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_cap.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_cap.c deleted file mode 100644 index 9c2f850dd29..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_cap.c +++ /dev/null @@ -1,397 +0,0 @@ -/**************************************************************************//** - * @file cap.c - * @brief CAP driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "nuc980.h" -#include "nu_cap.h" -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CAP_Driver CAP Driver - @{ -*/ - - -/** @addtogroup CAP_EXPORTED_FUNCTIONS CAP Exported Functions - @{ -*/ - -/** - * @brief Open engine clock and sensor clock - * - * @param[in] VCAP The pointer of the specified CAP module - * - * @param[in] u32InFormat The bits corresponding VSP, HSP, PCLK, INFMT, SNRTYPE, OUTFMT, PDORD and PNFMT configurations. - * - VSP should be ether \ref CAP_PAR_VSP_LOW or \ref CAP_PAR_VSP_HIGH - * - HSP should be ether \ref CAP_PAR_HSP_LOW or \ref CAP_PAR_HSP_HIGH - * - PCLK should be ether \ref CAP_PAR_PCLKP_LOW or \ref CAP_PAR_PCLKP_HIGH - * - INFMT should be ether \ref CAP_PAR_INFMT_YUV422 or \ref CAP_PAR_INFMT_RGB565 - * - SNRTYPE should be ether \ref CAP_PAR_SENTYPE_CCIR601 or \ref CAP_PAR_SENTYPE_CCIR656 - * - OUTFMT should be one of the following setting - * - \ref CAP_PAR_OUTFMT_YUV422 - * - \ref CAP_PAR_OUTFMT_ONLY_Y - * - \ref CAP_PAR_OUTFMT_RGB555 - * - \ref CAP_PAR_OUTFMT_RGB565 - * - PDORD should be one of the following setting - * - \ref CAP_PAR_INDATORD_YUYV - * - \ref CAP_PAR_INDATORD_YVYU - * - \ref CAP_PAR_INDATORD_UYVY - * - \ref CAP_PAR_INDATORD_VYUY - * - \ref CAP_PAR_INDATORD_RGGB - * - \ref CAP_PAR_INDATORD_BGGR - * - \ref CAP_PAR_INDATORD_GBRG - * - \ref CAP_PAR_INDATORD_GRBG - * - PNFMT should be one of the following setting - * - \ref CAP_PAR_PLNFMT_YUV422 - * - \ref CAP_PAR_PLNFMT_YUV420 - * - * @param[in] u32OutFormet Capture output format, should be one of following setting - * - \ref CAP_CTL_PKTEN - * - \ref CAP_CTL_PLNEN - * - * @return None - * - * @details Initialize the Image Capture Interface. Register a call back for driver internal using - */ -void CAP_Open(CAP_T *VCAP, uint32_t u32InFormat, uint32_t u32OutFormet) -{ - VCAP->PAR = (VCAP->PAR & ~0x000007BF) | u32InFormat; - VCAP->CTL = (VCAP->CTL & ~0x00000060) | u32OutFormet; -} - -/** - * @brief Set Cropping Window Starting Address and Size - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32VStart: Cropping Window Vertical Starting Address. It should be 0 ~ 0x7FF. - * - * @param[in] u32HStart: Cropping Window Horizontal Starting Address. It should be 0 ~ 0x7FF. - * - * @param[in] u32Height: Cropping Window Height . It should be 0 ~ 0x7FF. - * - * @param[in] u32Width: Cropping Window Width. It should be 0 ~ 0x7FF. - * - * @return None - * - * @details Set Cropping Window Starting Address Register - */ -void CAP_SetCroppingWindow(CAP_T *VCAP, uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width) -{ - VCAP->CWSP = (VCAP->CWSP & ~(CAP_CWSP_CWSADDRV_Msk | CAP_CWSP_CWSADDRH_Msk)) - | (((u32VStart << 16) | u32HStart)); - - VCAP->CWS = (VCAP->CWS & ~(CAP_CWS_CWH_Msk | CAP_CWS_CWW_Msk)) - | ((u32Height << 16) | u32Width); -} - - -/** - * @brief Set System Memory Packet Base Address0 Register - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32Address : set PKTBA0 register, It should be 0x0 ~ 0xFFFFFFFF - * - * @return None - * - * @details Set System Memory Packet Base Address Register - */ -void CAP_SetPacketBuf(CAP_T *VCAP, uint32_t u32Address) -{ - VCAP->PKTBA0 = u32Address; - VCAP->CTL |= CAP_CTL_UPDATE_Msk; -} - -/** - * @brief Set System Memory Planar Y, U and V Base Address Registers. - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32YAddr : set YBA register, It should be 0x0 ~ 0xFFFFFFFF - * - * @param[in] u32UAddr : set UBA register, It should be 0x0 ~ 0xFFFFFFFF - * - * @param[in] u32VAddr : set VBA register, It should be 0x0 ~ 0xFFFFFFFF - * - * @return None - * - * @details Set System Memory Planar Y,U and V Base Address Registers - */ -void CAP_SetPlanarBuf(CAP_T *VCAP, uint32_t u32YAddr, uint32_t u32UAddr, uint32_t u32VAddr) -{ - VCAP->YBA = u32YAddr; - VCAP->UBA = u32UAddr; - VCAP->VBA = u32VAddr; - VCAP->CTL |= CAP_CTL_UPDATE_Msk; -} - - -/** - * @brief Close Image Capture Interface - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @return None - */ -void CAP_Close(CAP_T *VCAP) -{ - VCAP->CTL &= ~CAP_CTL_CAPEN; -} - - -/** - * @brief Set CAP Interrupt - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CAP_INT_VIEN_Msk - * - \ref CAP_INT_MEIEN_Msk - * - \ref CAP_INT_ADDRMIEN_Msk - * - \ref CAP_INT_MDIEN_Msk - * @return None - * - * @details Set Video Frame End Interrupt Enable, - * System Memory Error Interrupt Enable, - * Address Match Interrupt Enable, - * Motion Detection Output Finish Interrupt Enable. - */ -void CAP_EnableInt(CAP_T *VCAP, uint32_t u32IntMask) -{ - VCAP->INT = (VCAP->INT & ~(CAP_INT_VIEN_Msk | CAP_INT_MEIEN_Msk | CAP_INT_ADDRMIEN_Msk | CAP_INT_MDIEN_Msk)) - | u32IntMask; -} - -/** - * @brief Disable CAP Interrupt - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32IntMask Interrupt settings. It could be - * - \ref CAP_INT_VINTF_Msk - * - \ref CAP_INT_MEINTF_Msk - * - \ref CAP_INT_ADDRMINTF_Msk - * - \ref CAP_INT_MDINTF_Msk - * @return None - * - * @details Disable Video Frame End Interrupt , - * System Memory Error Interrupt , - * Address Match Interrupt and - * Motion Detection Output Finish Interrupt . - */ -void CAP_DisableInt(CAP_T *VCAP, uint32_t u32IntMask) -{ - VCAP->INT = (VCAP->INT & ~(u32IntMask)) ; -} - -/** - * @brief Start Image Capture Interface - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @return None - */ -void CAP_Start(CAP_T *VCAP) -{ - VCAP->CTL |= CAP_CTL_CAPEN; -} - -/** - * @brief Stop Image Capture Interface - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32FrameComplete : - * TRUE: Capture module automatically disable the CAP module after a frame had been captured - * FALSE: Stop Capture module now - * @return None - * - * @details if u32FrameComplete is set to TRUE then get a new frame and disable CAP module - */ -void CAP_Stop(CAP_T *VCAP, uint32_t u32FrameComplete) -{ - if (u32FrameComplete == FALSE) - VCAP->CTL &= ~CAP_CTL_CAPEN; - else - { - VCAP->CTL |= CAP_CTL_SHUTTER_Msk; - while (CAP_IS_STOPPED(VCAP)); - } -} - -/** - * @brief Set Packet Scaling Vertical and Horizontal Factor Register - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32VNumerator: Packet Scaling Vertical Factor N. It should be 0 ~ FFFF. - * - * @param[in] u32VDenominator: Packet Scaling Vertical Factor M. It should be 0 ~ FFFF. - * - * @param[in] u32HNumerator: Packet Scaling Vertical Factor N. It should be 0 ~ FFFF. - * - * @param[in] u32HDenominator: Packet Scaling Vertical Factor M. It should be 0 ~ FFFF. - * - * @return None - * - */ -void CAP_SetPacketScaling(CAP_T *VCAP, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator) -{ - uint32_t u32NumeratorL, u32NumeratorH; - uint32_t u32DenominatorL, u32DenominatorH; - - u32NumeratorL = u32VNumerator & 0xFF; - u32NumeratorH = u32VNumerator >> 8; - u32DenominatorL = u32VDenominator & 0xFF; - u32DenominatorH = u32VDenominator >> 8; - VCAP->PKTSL = (VCAP->PKTSL & ~(CAP_PKTSL_PKTSVNL_Msk | CAP_PKTSL_PKTSVML_Msk)) - | ((u32NumeratorL << 24) | (u32DenominatorL << 16)); - VCAP->PKTSM = (VCAP->PKTSM & ~(CAP_PKTSM_PKTSVNH_Msk | CAP_PKTSM_PKTSVMH_Msk)) - | ((u32NumeratorH << 24) | (u32DenominatorH << 16)); - - u32NumeratorL = u32HNumerator & 0xFF; - u32NumeratorH = u32HNumerator >> 8; - u32DenominatorL = u32HDenominator & 0xFF; - u32DenominatorH = u32HDenominator >> 8; - VCAP->PKTSL = (VCAP->PKTSL & ~(CAP_PKTSL_PKTSHNL_Msk | CAP_PKTSL_PKTSHML_Msk)) - | ((u32NumeratorL << 8) | u32DenominatorL); - VCAP->PKTSM = (VCAP->PKTSM & ~(CAP_PKTSM_PKTSHNH_Msk | CAP_PKTSM_PKTSHMH_Msk)) - | ((u32NumeratorH << 8) | u32DenominatorH); -} - -/** - * @brief Set Planar Scaling Vertical and Horizontal Factor Register - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32VNumerator: Planar Scaling Vertical Factor N. It should be 0 ~ FFFF. - * - * @param[in] u32VDenominator: Planar Scaling Vertical Factor M. It should be 0 ~ FFFF. - * - * @param[in] u32HNumerator: Planar Scaling Vertical Factor N. It should be 0 ~ FFFF. - * - * @param[in] u32HDenominator: Planar Scaling Vertical Factor M. It should be 0 ~ FFFF. - * - * @return None - * - */ -void CAP_SetPlanarScaling(CAP_T *VCAP, uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator) -{ - uint32_t u32NumeratorL, u32NumeratorH; - uint32_t u32DenominatorL, u32DenominatorH; - - u32NumeratorL = u32VNumerator & 0xFF; - u32NumeratorH = u32VNumerator >> 8; - u32DenominatorL = u32VDenominator & 0xFF; - u32DenominatorH = u32VDenominator >> 8; - VCAP->PLNSL = (VCAP->PLNSL & ~(CAP_PLNSL_PLNSVNL_Msk | CAP_PLNSL_PLNSVML_Msk)) - | ((u32NumeratorL << 24) | (u32DenominatorL << 16)); - VCAP->PLNSM = (VCAP->PLNSM & ~(CAP_PLNSM_PLNSVNH_Msk | CAP_PLNSM_PLNSVMH_Msk)) - | ((u32NumeratorH << 24) | (u32DenominatorH << 16)); - - u32NumeratorL = u32HNumerator & 0xFF; - u32NumeratorH = u32HNumerator >> 8; - u32DenominatorL = u32HDenominator & 0xFF; - u32DenominatorH = u32HDenominator >> 8; - VCAP->PLNSL = (VCAP->PLNSL & ~(CAP_PLNSL_PLNSHNL_Msk | CAP_PLNSL_PLNSHML_Msk)) - | ((u32NumeratorL << 8) | u32DenominatorL); - VCAP->PLNSM = (VCAP->PLNSM & ~(CAP_PLNSM_PLNSHNH_Msk | CAP_PLNSM_PLNSHMH_Msk)) - | ((u32NumeratorH << 8) | u32DenominatorH); -} - -/** - * @brief Set Packet Frame Output Pixel Stride Width. - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32Stride : set PKTSTRIDE register, It should be 0x0 ~ 0x3FFF - * - * @return None - * - * @details Set Packet Frame Output Pixel Stride Width - */ -void CAP_SetPacketStride(CAP_T *VCAP, uint32_t u32Stride) -{ - VCAP->STRIDE = (VCAP->STRIDE & ~CAP_STRIDE_PKTSTRIDE_Msk) | u32Stride; -} - -/** - * @brief Set Planar Frame Output Pixel Stride Width. - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32Stride : set PLNSTRIDE register, It should be 0x0 ~ 0x3FFF - * - * @return None - * - * @details Set Planar Frame Output Pixel Stride Width - */ -void CAP_SetPlanarStride(CAP_T *VCAP, uint32_t u32Stride) -{ - VCAP->STRIDE = (VCAP->STRIDE & ~CAP_STRIDE_PLNSTRIDE_Msk) | u32Stride << CAP_STRIDE_PLNSTRIDE_Pos; -} - - -/** - * @brief Enable Motion Detection Function - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @param[in] u32Freq: Motion Detection Detect Frequency. It should be 0x0 ~ 0x3. - * - * @param[in] u32BlockSize: Motion Detection Block Size - * FALSE : 16x16 - * TRUE : 8x8 - * - * @param[in] u32Format: Motion Detection Save Mode - * FALSE : 1 bit DIFF + 7 Y Differential - * TRUE : 1 bit DIFF only - * - * @param[in] u32Threshold: Motion Detection Detect Threshold. It should be 0x0 ~ 0x1F. - * - * @param[in] u32YDetAddr : Motion Detection Detect Temp Y Output Address - * - * @param[in] u32DetAddr: Motion Detection Detect Address - * - * @return None - * - * @details Set Planar Frame Output Pixel Stride Width - */ -void CAP_EnableMotionDet(CAP_T *VCAP, uint32_t u32Freq, uint32_t u32BlockSize, uint32_t u32Format, uint32_t u32Threshold, uint32_t u32YDetAddr, uint32_t u32DetAddr) -{ - VCAP->MD = (VCAP->MD & ~(CAP_MD_MDSM_Msk | CAP_MD_MDBS_Msk | CAP_MD_MDEN_Msk)) | - ((CAP_MD_MDEN_Msk | (u32BlockSize ? CAP_MD_MDBS_Msk : 0)) | - (u32Format ? CAP_MD_MDSM_Msk : 0)); - - VCAP->MD = (VCAP->MD & ~CAP_MD_MDDF_Msk) | (u32Freq << CAP_MD_MDDF_Pos); - VCAP->MD = (VCAP->MD & ~CAP_MD_MDTHR_Msk) | (u32Threshold << CAP_MD_MDTHR_Pos); - - VCAP->MDYADDR = u32YDetAddr; - VCAP->MDADDR = u32DetAddr; -} - -/** - * @brief Enable Motion Detection Function - * - * @param[in] VCAP: The pointer of the specified CAP module - * - * @return None - * - * @details Set Planar Frame Output Pixel Stride Width - */ -void CAP_DisableMotionDet(CAP_T *VCAP) -{ - VCAP->MD &= ~CAP_MD_MDEN_Msk; -} - -/*@}*/ /* end of group CAP_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CAP_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_crypto.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_crypto.c deleted file mode 100644 index b74f774bd81..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_crypto.c +++ /dev/null @@ -1,2673 +0,0 @@ -/**************************************************************************//** - * @file crypto.c - * @version V1.10 - * @brief Cryptographic Accelerator driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include "nuc980.h" -#include "nu_crypto.h" - -/** @cond HIDDEN_SYMBOLS */ - -#define ENABLE_DEBUG 0 - -#if ENABLE_DEBUG - #define CRPT_DBGMSG printf -#else - #define CRPT_DBGMSG(...) do { } while (0) /* disable debug */ -#endif - -/** @endcond HIDDEN_SYMBOLS */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup CRYPTO_Driver CRYPTO Driver - @{ -*/ - - -/** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions - @{ -*/ - -/** @cond HIDDEN_SYMBOLS */ - -static uint32_t g_AES_CTL; - -static char hex_char_tbl[] = "0123456789abcdef"; - -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count); -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx); -static void Hex2Reg(char input[], uint32_t volatile reg[]); -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]); -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift); -static char ch2hex(char ch); -static int get_nibble_value(char c); - - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief Open PRNG function - * @param[in] crpt Reference to Crypto module. - * @param[in] u32KeySize is PRNG key size, including: - * - \ref PRNG_KEY_SIZE_64 - * - \ref PRNG_KEY_SIZE_128 - * - \ref PRNG_KEY_SIZE_192 - * - \ref PRNG_KEY_SIZE_256 - * @param[in] u32SeedReload is PRNG seed reload or not, including: - * - \ref PRNG_SEED_CONT - * - \ref PRNG_SEED_RELOAD - * @param[in] u32Seed The new seed. Only valid when u32SeedReload is PRNG_SEED_RELOAD. - * @return None - */ -void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed) -{ - if (u32SeedReload) - { - crpt->PRNG_SEED = u32Seed; - } - - crpt->PRNG_CTL = (u32KeySize << CRPT_PRNG_CTL_KEYSZ_Pos) | - (u32SeedReload << CRPT_PRNG_CTL_SEEDRLD_Pos); -} - -/** - * @brief Start to generate one PRNG key. - * @param[in] crpt Reference to Crypto module. - * @return None - */ -void PRNG_Start(CRPT_T *crpt) -{ - crpt->PRNG_CTL |= CRPT_PRNG_CTL_START_Msk; -} - -/** - * @brief Read the PRNG key. - * @param[in] crpt Reference to Crypto module. - * @param[out] u32RandKey The key buffer to store newly generated PRNG key. - * @return None - */ -void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]) -{ - uint32_t i, wcnt; - - wcnt = (((crpt->PRNG_CTL & CRPT_PRNG_CTL_KEYSZ_Msk) >> CRPT_PRNG_CTL_KEYSZ_Pos) + 1U) * 2U; - - for (i = 0U; i < wcnt; i++) - { - u32RandKey[i] = crpt->PRNG_KEY[i]; - } - - crpt->PRNG_CTL &= ~CRPT_PRNG_CTL_SEEDRLD_Msk; -} - - -/** - * @brief Open AES encrypt/decrypt function. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32EncDec 1: AES encode; 0: AES decode - * @param[in] u32OpMode AES operation mode, including: - * - \ref AES_MODE_ECB - * - \ref AES_MODE_CBC - * - \ref AES_MODE_CFB - * - \ref AES_MODE_OFB - * - \ref AES_MODE_CTR - * - \ref AES_MODE_CBC_CS1 - * - \ref AES_MODE_CBC_CS2 - * - \ref AES_MODE_CBC_CS3 - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @param[in] u32SwapType is AES input/output data swap control, including: - * - \ref AES_NO_SWAP - * - \ref AES_OUT_SWAP - * - \ref AES_IN_SWAP - * - \ref AES_IN_OUT_SWAP - * @return None - */ -void AES_Open(CRPT_T *crpt, uint32_t u32EncDec, - uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType) -{ - crpt->AES_CTL = (u32EncDec << CRPT_AES_CTL_ENCRPT_Pos) | - (u32OpMode << CRPT_AES_CTL_OPMODE_Pos) | - (u32KeySize << CRPT_AES_CTL_KEYSZ_Pos) | - (u32SwapType << CRPT_AES_CTL_OUTSWAP_Pos); - g_AES_CTL = crpt->AES_CTL; -} - -/** - * @brief Start AES encrypt/decrypt - * @param[in] crpt Reference to Crypto module. - * @param[in] u32DMAMode AES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop AES encrypt/decrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous AES encrypt/decrypt. - * - \ref CRYPTO_DMA_LAST Last AES encrypt/decrypt of a series of AES_Start. - * @return None - */ -void AES_Start(CRPT_T *crpt, uint32_t u32DMAMode) -{ - crpt->AES_CTL = g_AES_CTL; - crpt->AES_CTL |= CRPT_AES_CTL_START_Msk | (u32DMAMode << CRPT_AES_CTL_DMALAST_Pos); -} - -/** - * @brief Set AES keys - * @param[in] crpt Reference to Crypto module. - * @param[in] au32Keys An word array contains AES keys. - * @param[in] u32KeySize is AES key size, including: - * - \ref AES_KEY_SIZE_128 - * - \ref AES_KEY_SIZE_192 - * - \ref AES_KEY_SIZE_256 - * @return None - */ -void AES_SetKey(CRPT_T *crpt, uint32_t au32Keys[], uint32_t u32KeySize) -{ - uint32_t i, wcnt, key_reg_addr; - - key_reg_addr = (uint32_t)&crpt->AES0_KEY[0]; - wcnt = 4UL + u32KeySize * 2UL; - - for (i = 0U; i < wcnt; i++) - { - outpw(key_reg_addr, au32Keys[i]); - key_reg_addr += 4UL; - } -} - -/** - * @brief Set AES initial vectors - * @param[in] crpt Reference to Crypto module. - * @param[in] au32IV A four entry word array contains AES initial vectors. - * @return None - */ -void AES_SetInitVect(CRPT_T *crpt, uint32_t au32IV[]) -{ - uint32_t i, key_reg_addr; - - key_reg_addr = (uint32_t)&crpt->AES0_IV[0]; - - for (i = 0U; i < 4U; i++) - { - outpw(key_reg_addr, au32IV[i]); - key_reg_addr += 4UL; - } -} - -/** - * @brief Set AES DMA transfer configuration. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32SrcAddr AES DMA source address - * @param[in] u32DstAddr AES DMA destination address - * @param[in] u32TransCnt AES DMA transfer byte count - * @return None - */ -void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, - uint32_t u32DstAddr, uint32_t u32TransCnt) -{ - uint32_t reg_addr; - - reg_addr = (uint32_t)&crpt->AES0_SADDR; - outpw(reg_addr, u32SrcAddr); - - reg_addr = (uint32_t)&crpt->AES0_DADDR; - outpw(reg_addr, u32DstAddr); - - reg_addr = (uint32_t)&crpt->AES0_CNT; - outpw(reg_addr, u32TransCnt); -} - - -/** - * @brief Open SHA encrypt function. - * @param[in] crpt Reference to Crypto module. - * @param[in] u32OpMode SHA operation mode, including: - * - \ref SHA_MODE_SHA1 - * - \ref SHA_MODE_SHA224 - * - \ref SHA_MODE_SHA256 - * - \ref SHA_MODE_SHA384 - * - \ref SHA_MODE_SHA512 - * @param[in] u32SwapType is SHA input/output data swap control, including: - * - \ref SHA_NO_SWAP - * - \ref SHA_OUT_SWAP - * - \ref SHA_IN_SWAP - * - \ref SHA_IN_OUT_SWAP - * @param[in] hmac_key_len HMAC key byte count - * @return None - */ -void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len) -{ - crpt->HMAC_CTL = (u32OpMode << CRPT_HMAC_CTL_OPMODE_Pos) | - (u32SwapType << CRPT_HMAC_CTL_OUTSWAP_Pos); - - if (hmac_key_len != 0UL) - { - crpt->HMAC_KEYCNT = hmac_key_len; - crpt->HMAC_CTL |= CRPT_HMAC_CTL_HMACEN_Msk; - } -} - -/** - * @brief Start SHA encrypt - * @param[in] crpt Reference to Crypto module. - * @param[in] u32DMAMode TDES DMA control, including: - * - \ref CRYPTO_DMA_ONE_SHOT One shop SHA encrypt. - * - \ref CRYPTO_DMA_CONTINUE Continuous SHA encrypt. - * - \ref CRYPTO_DMA_LAST Last SHA encrypt of a series of SHA_Start. - * @return None - */ -void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode) -{ - crpt->HMAC_CTL &= ~(0x7UL << CRPT_HMAC_CTL_DMALAST_Pos); - crpt->HMAC_CTL |= CRPT_HMAC_CTL_START_Msk | (u32DMAMode << CRPT_HMAC_CTL_DMALAST_Pos); -} - -/** - * @brief Set SHA DMA transfer - * @param[in] crpt Reference to Crypto module. - * @param[in] u32SrcAddr SHA DMA source address - * @param[in] u32TransCnt SHA DMA transfer byte count - * @return None - */ -void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt) -{ - crpt->HMAC_SADDR = u32SrcAddr; - crpt->HMAC_DMACNT = u32TransCnt; -} - -/** - * @brief Read the SHA digest. - * @param[in] crpt Reference to Crypto module. - * @param[out] u32Digest The SHA encrypt output digest. - * @return None - */ -void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]) -{ - uint32_t i, wcnt, reg_addr; - - i = (crpt->HMAC_CTL & CRPT_HMAC_CTL_OPMODE_Msk) >> CRPT_HMAC_CTL_OPMODE_Pos; - - if (i == SHA_MODE_SHA1) - { - wcnt = 5UL; - } - else if (i == SHA_MODE_SHA224) - { - wcnt = 7UL; - } - else if (i == SHA_MODE_SHA256) - { - wcnt = 8UL; - } - else if (i == SHA_MODE_SHA384) - { - wcnt = 12UL; - } - else - { - /* SHA_MODE_SHA512 */ - wcnt = 16UL; - } - - reg_addr = (uint32_t) & (crpt->HMAC_DGST[0]); - for (i = 0UL; i < wcnt; i++) - { - u32Digest[i] = inpw(reg_addr); - reg_addr += 4UL; - } -} - -/** @cond HIDDEN_SYMBOLS */ - -/*-----------------------------------------------------------------------------------------------*/ -/* */ -/* ECC */ -/* */ -/*-----------------------------------------------------------------------------------------------*/ - -#define ECCOP_POINT_MUL (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_MODULE (0x1UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_ADD (0x2UL << CRPT_ECC_CTL_ECCOP_Pos) -#define ECCOP_POINT_DOUBLE (0x0UL << CRPT_ECC_CTL_ECCOP_Pos) - -#define MODOP_DIV (0x0UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_MUL (0x1UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_ADD (0x2UL << CRPT_ECC_CTL_MODOP_Pos) -#define MODOP_SUB (0x3UL << CRPT_ECC_CTL_MODOP_Pos) - -enum -{ - CURVE_GF_P, - CURVE_GF_2M, -}; - -/*-----------------------------------------------------*/ -/* Define elliptic curve (EC): */ -/*-----------------------------------------------------*/ - -typedef struct e_curve_t -{ - E_ECC_CURVE curve_id; - int32_t Echar; - char Ea[144]; - char Eb[144]; - char Px[144]; - char Py[144]; - int32_t Epl; - char Pp[176]; - int32_t Eol; - char Eorder[176]; - int32_t key_len; - int32_t irreducible_k1; - int32_t irreducible_k2; - int32_t irreducible_k3; - int32_t GF; -} ECC_CURVE; - -const ECC_CURVE _Curve[] = -{ - { - /* NIST: Curve P-192 : y^2=x^3-ax+b (mod p) */ - CURVE_P_192, - 48, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", /* "000000000000000000000000000000000000000000000003" */ - "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", - "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012", - "07192b95ffc8da78631011ed6b24cdd573f977a11e794811", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", /* "6277101735386680763835789423207666416083908700390324961279" */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", /* "6277101735386680763835789423176059013767194773182842284081" */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* NIST: Curve P-224 : y^2=x^3-ax+b (mod p) */ - CURVE_P_224, - 56, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", /* "00000000000000000000000000000000000000000000000000000003" */ - "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", - "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", - "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "0026959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", /* "0026959946667150639794667015087019625940457807714424391721682722368061" */ - 224, /* key_len */ - 9, - 8, - 3, - CURVE_GF_P - }, - { - /* NIST: Curve P-256 : y^2=x^3-ax+b (mod p) */ - CURVE_P_256, - 64, /* Echar */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", /* "0000000000000000000000000000000000000000000000000000000000000003" */ - "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", - "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", - "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", - 78, /* Epl */ - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", /* "115792089210356248762697446949407573530086143415290314195533631308867097853951" */ - 78, /* Eol */ - "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", /* "115792089210356248762697446949407573529996955224135760342422259061068512044369" */ - 256, /* key_len */ - 10, - 5, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-384 : y^2=x^3-ax+b (mod p) */ - CURVE_P_384, - 96, /* Echar */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", /* "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", - "aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", - "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", - 116, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", /* "39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319" */ - 116, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", /* "39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643" */ - 384, /* key_len */ - 12, - 3, - 2, - CURVE_GF_P - }, - { - /* NIST: Curve P-521 : y^2=x^3-ax+b (mod p)*/ - CURVE_P_521, - 131, /* Echar */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", /* "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003" */ - "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", - "0c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", - "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", - 157, /* Epl */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151" */ - 157, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", /* "6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449" */ - 521, /* key_len */ - 32, - 32, - 32, - CURVE_GF_P - }, - { - /* NIST: Curve B-163 : y^2+xy=x^3+ax^2+b */ - CURVE_B_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "20a601907b8c953ca1481eb10512f78744a3205fd", - "3f0eba16286a2d57ea0991168d4994637e8343e36", - "0d51fbc6c71a0094fa2cdd545b11c5c0c797324f1", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "40000000000000000000292FE77E70C12A4234C33", /* "5846006549323611672814742442876390689256843201587" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve B-233 : y^2+xy=x^3+ax^2+b */ - CURVE_B_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000001", - "066647ede6c332c7f8c0923bb58213b333b20e9ce4281fe115f7d8f90ad", - "0fac9dfcbac8313bb2139f1bb755fef65bc391f8b36f8f8eb7371fd558b", - "1006a08a41903350678e58528bebf8a0beff867a7ca36716f7e01f81052", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "1000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", /* "6901746346790563787434755862277025555839812737345013555379383634485463" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve B-283 : y^2+xy=x^3+ax^2+b */ - CURVE_B_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000001", - "27b680ac8b8596da5a4af8a19a0303fca97fd7645309fa2a581485af6263e313b79a2f5", - "5f939258db7dd90e1934f8c70b0dfec2eed25b8557eac9c80e2e198f8cdbecd86b12053", - "3676854fe24141cb98fe6d4b20d02b4516ff702350eddb0826779c813f0df45be8112f4", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", /* "7770675568902916283677847627294075626569625924376904889109196526770044277787378692871" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve B-409 : y^2+xy=x^3+ax^2+b */ - CURVE_B_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "021a5c2c8ee9feb5c4b9a753b7b476b7fd6422ef1f3dd674761fa99d6ac27c8a9a197b272822f6cd57a55aa4f50ae317b13545f", - "15d4860d088ddb3496b0c6064756260441cde4af1771d4db01ffe5b34e59703dc255a868a1180515603aeab60794e54bb7996a7", - "061b1cfab6be5f32bbfa78324ed106a7636b9c5a7bd198d0158aa4f5488d08f38514f1fdf4b4f40d2181b3681c364ba0273c706", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "10000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", /* "661055968790248598951915308032771039828404682964281219284648798304157774827374805208143723762179110965979867288366567526771" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve B-571 : y^2+xy=x^3+ax^2+b */ - CURVE_B_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a", - "303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19", - "37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", /* "3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* NIST: Curve K-163 : y^2+xy=x^3+ax^2+b */ - CURVE_K_163, - 41, /* Echar */ - "00000000000000000000000000000000000000001", - "00000000000000000000000000000000000000001", - "2fe13c0537bbc11acaa07d793de4e6d5e5c94eee8", - "289070fb05d38ff58321f2e800536d538ccdaa3d9", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 49, /* Eol */ - "4000000000000000000020108A2E0CC0D99F8A5EF", /* "5846006549323611672814741753598448348329118574063" */ - 163, /* key_len */ - 7, - 6, - 3, - CURVE_GF_2M - }, - { - /* NIST: Curve K-233 : y^2+xy=x^3+ax^2+b */ - CURVE_K_233, - 59, /* Echar 59 */ - "00000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000001", - "17232ba853a7e731af129f22ff4149563a419c26bf50a4c9d6eefad6126", - "1db537dece819b7f70f555a67c427a8cd9bf18aeb9b56e0c11056fae6a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 70, /* Eol */ - "8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", /* "3450873173395281893717377931138512760570940988862252126328087024741343" */ - 233, /* key_len */ - 74, - 74, - 74, - CURVE_GF_2M - }, - { - /* NIST: Curve K-283 : y^2+xy=x^3+ax^2+b */ - CURVE_K_283, - 71, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000001", - "503213f78ca44883f1a3b8162f188e553cd265f23c1567a16876913b0c2ac2458492836", - "1ccda380f1c9e318d90f95d07e5426fe87e45c0e8184698e45962364e34116177dd2259", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 85, /* Eol */ - "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", /* "3885337784451458141838923813647037813284811733793061324295874997529815829704422603873" */ - 283, /* key_len */ - 12, - 7, - 5, - CURVE_GF_2M - }, - { - /* NIST: Curve K-409 : y^2+xy=x^3+ax^2+b */ - CURVE_K_409, - 103, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746", - "1e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 123, /* Eol */ - "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", /* "330527984395124299475957654016385519914202341482140609642324395022880711289249191050673258457777458014096366590617731358671" */ - 409, /* key_len */ - 87, - 87, - 87, - CURVE_GF_2M - }, - { - /* NIST: Curve K-571 : y^2+xy=x^3+ax^2+b */ - CURVE_K_571, - 143, /* Echar */ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "26eb7a859923fbc82189631f8103fe4ac9ca2970012d5d46024804801841ca44370958493b205e647da304db4ceb08cbbd1ba39494776fb988b47174dca88c7e2945283a01c8972", - "349dc807f4fbf374f4aeade3bca95314dd58cec9f307a54ffc61efc006d8a2c9d4979c0ac44aea74fbebbb9f772aedcb620b01a7ba7af1b320430c8591984f601cd4c143ef1c7a3", - 68, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* "26959946667150639794667015087019630673557916260026308143510066298881" */ - 172, /* Eol */ - "20000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", /* "1932268761508629172347675945465993672149463664853217499328617625725759571144780212268133978522706711834706712800825351461273674974066617311929682421617092503555733685276673" */ - 571, /* key_len */ - 10, - 5, - 2, - CURVE_GF_2M - }, - { - /* Koblitz: Curve secp192k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_192, - 48, /* Echar */ - "00000000000000000000000000000000000000000", - "00000000000000000000000000000000000000003", - "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", - "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", - 58, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", /* p */ - 58, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", /* n */ - 192, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp224k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_224, - 56, /* Echar */ - "00000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000005", - "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", - "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", - 70, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", /* p */ - 70, /* Eol */ - "0000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", /* n */ - 224, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Koblitz: Curve secp256k1 : y2 = x3+ax+b over Fp */ - CURVE_KO_256, - 64, /* Echar */ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000007", - "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", - "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", - 78, /* Epl */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", /* p */ - 78, /* Eol */ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", /* n */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP256r1 */ - CURVE_BP_256, - 64, /* Echar */ - "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", /* A */ - "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", /* B */ - "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", /* x */ - "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", /* y */ - 78, /* Epl */ - "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", /* p */ - 78, /* Eol */ - "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", /* q */ - 256, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP384r1 */ - CURVE_BP_384, - 96, /* Echar */ - "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", /* A */ - "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", /* B */ - "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", /* x */ - "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", /* y */ - 116, /* Epl */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", /* p */ - 116, /* Eol */ - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", /* q */ - 384, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, - { - /* Brainpool: Curve brainpoolP512r1 */ - CURVE_BP_512, - 128, /* Echar */ - "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", /* A */ - "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", /* B */ - "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", /* x */ - "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", /* y */ - 156, /* Epl */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", /* p */ - 156, /* Eol */ - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", /* q */ - 512, /* key_len */ - 7, - 2, - 1, - CURVE_GF_P - }, -}; - -static ECC_CURVE *pCurve; -static ECC_CURVE Curve_Copy; - -static ECC_CURVE *get_curve(E_ECC_CURVE ecc_curve); -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve); -static void run_ecc_codec(CRPT_T *crpt, uint32_t mode); - -static char temp_hex_str[160]; - - -#if ENABLE_DEBUG -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ - int32_t i; - - printf("%s => ", str); - for (i = 0; i < count; i++) - { - printf("0x%08x ", regs[i]); - } - printf("\n"); -} -#else -static void dump_ecc_reg(char *str, uint32_t volatile regs[], int32_t count) -{ -} -#endif - -static char ch2hex(char ch) -{ - if (ch <= '9') - { - ch = ch - '0'; - } - else if ((ch <= 'z') && (ch >= 'a')) - { - ch = ch - 'a' + 10U; - } - else - { - ch = ch - 'A' + 10U; - } - return ch; -} - -static void Hex2Reg(char input[], uint32_t volatile reg[]) -{ - char hex; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0; - - while (si >= 0) - { - val32 = 0UL; - for (i = 0UL; (i < 8UL) && (si >= 0); i++) - { - hex = ch2hex(input[si]); - val32 |= (uint32_t)hex << (i * 4UL); - si--; - } - reg[ri++] = val32; - } -} - -static void Hex2RegEx(char input[], uint32_t volatile reg[], int shift) -{ - uint32_t hex, carry; - int si, ri; - uint32_t i, val32; - - si = (int)strlen(input) - 1; - ri = 0L; - carry = 0UL; - while (si >= 0) - { - val32 = 0UL; - for (i = 0UL; (i < 8UL) && (si >= 0L); i++) - { - hex = (uint32_t)ch2hex(input[si]); - hex <<= shift; - - val32 |= (uint32_t)((hex & 0xFUL) | carry) << (i * 4UL); - carry = (hex >> 4UL) & 0xFUL; - si--; - } - reg[ri++] = val32; - } - if (carry != 0UL) - { - reg[ri] = carry; - } -} - -/** - * @brief Extract specified nibble from an unsigned word in character format. - * For example: - * Suppose val32 is 0x786543210, get_Nth_nibble_char(val32, 3) will return a '3'. - * @param[in] val32 The input unsigned word - * @param[in] idx The Nth nibble to be extracted. - * @return The nibble in character format. - */ -static char get_Nth_nibble_char(uint32_t val32, uint32_t idx) -{ - return hex_char_tbl[(val32 >> (idx * 4U)) & 0xfU ]; -} - - -static void Reg2Hex(int32_t count, uint32_t volatile reg[], char output[]) -{ - int32_t idx, ri; - uint32_t i; - - output[count] = 0U; - idx = count - 1; - - for (ri = 0; idx >= 0; ri++) - { - for (i = 0UL; (i < 8UL) && (idx >= 0); i++) - { - output[idx] = get_Nth_nibble_char(reg[ri], i); - idx--; - } - } -} - -static ECC_CURVE *get_curve(E_ECC_CURVE ecc_curve) -{ - uint32_t i; - ECC_CURVE *ret = NULL; - - for (i = 0UL; i < sizeof(_Curve) / sizeof(ECC_CURVE); i++) - { - if (ecc_curve == _Curve[i].curve_id) - { - memcpy((char *)&Curve_Copy, &_Curve[i], sizeof(ECC_CURVE)); - ret = &Curve_Copy; /* (ECC_CURVE *)&_Curve[i]; */ - } - if (ret != NULL) - { - break; - } - } - return ret; -} - -static int32_t ecc_init_curve(CRPT_T *crpt, E_ECC_CURVE ecc_curve) -{ - int32_t i, ret = 0; - - pCurve = get_curve(ecc_curve); - if (pCurve == NULL) - { - CRPT_DBGMSG("Cannot find curve %d!!\n", ecc_curve); - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_A[i] = 0UL; - crpt->ECC_B[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_N[i] = 0UL; - } - - Hex2Reg(pCurve->Ea, crpt->ECC_A); - Hex2Reg(pCurve->Eb, crpt->ECC_B); - Hex2Reg(pCurve->Px, crpt->ECC_X1); - Hex2Reg(pCurve->Py, crpt->ECC_Y1); - - CRPT_DBGMSG("Key length = %d\n", pCurve->key_len); - dump_ecc_reg("CRPT_ECC_CURVE_A", crpt->ECC_A, 10); - dump_ecc_reg("CRPT_ECC_CURVE_B", crpt->ECC_B, 10); - dump_ecc_reg("CRPT_ECC_POINT_X1", crpt->ECC_X1, 10); - dump_ecc_reg("CRPT_ECC_POINT_Y1", crpt->ECC_Y1, 10); - - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_N[0] = 0x1UL; - crpt->ECC_N[(pCurve->key_len) / 32] |= (1UL << ((pCurve->key_len) % 32)); - crpt->ECC_N[(pCurve->irreducible_k1) / 32] |= (1UL << ((pCurve->irreducible_k1) % 32)); - crpt->ECC_N[(pCurve->irreducible_k2) / 32] |= (1UL << ((pCurve->irreducible_k2) % 32)); - crpt->ECC_N[(pCurve->irreducible_k3) / 32] |= (1UL << ((pCurve->irreducible_k3) % 32)); - } - else - { - Hex2Reg(pCurve->Pp, crpt->ECC_N); - } - } - dump_ecc_reg("CRPT_ECC_CURVE_N", crpt->ECC_N, 10); - return ret; -} - -static int get_nibble_value(char c) -{ - if ((c >= '0') && (c <= '9')) - { - c = c - '0'; - } - - if ((c >= 'a') && (c <= 'f')) - { - c = c - 'a' + (char)10; - } - - if ((c >= 'A') && (c <= 'F')) - { - c = c - 'A' + (char)10; - } - return (int)c; -} - -static int ecc_strcmp(char *s1, char *s2) -{ - char c1, c2; - - while (*s1 == '0') s1++; - while (*s2 == '0') s2++; - - for (; *s1 || *s2; s1++, s2++) - { - if ((*s1 >= 'A') && (*s1 <= 'Z')) - c1 = *s1 + 32; - else - c1 = *s1; - - if ((*s2 >= 'A') && (*s2 <= 'Z')) - c2 = *s2 + 32; - else - c2 = *s2; - - if (c1 != c2) - return 1; - } - return 0; -} - -volatile uint32_t g_ECC_done, g_ECCERR_done; - -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief ECC interrupt service routine. User application must invoke this function in - * his CRYPTO_IRQHandler() to let Crypto driver know ECC processing was done. - * @param[in] crpt Reference to Crypto module. - * @return none - */ -void ECC_Complete(CRPT_T *crpt) -{ - if (crpt->INTSTS & CRPT_INTSTS_ECCIF_Msk) - { - g_ECC_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCIF_Msk; - /* printf("ECC done IRQ.\n"); */ - } - - if (crpt->INTSTS & CRPT_INTSTS_ECCEIF_Msk) - { - g_ECCERR_done = 1UL; - crpt->INTSTS = CRPT_INTSTS_ECCEIF_Msk; - /* printf("ECCERRIF is set!!\n"); */ - } -} - -/** - * @brief Check if the private key is located in valid range of curve. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k The input private key. - * @return 1 Is valid. - * @return 0 Is not valid. - * @return -1 Invalid curve. - */ -int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]) -{ - uint32_t i; - int ret = -1; - - pCurve = get_curve(ecc_curve); - if (pCurve == NULL) - { - ret = -1; - } - - if (strlen(private_k) < strlen(pCurve->Eorder)) - { - ret = 1; - } - - if (strlen(private_k) > strlen(pCurve->Eorder)) - { - ret = 0; - } - - for (i = 0UL; i < strlen(private_k); i++) - { - if (get_nibble_value(private_k[i]) < get_nibble_value(pCurve->Eorder[i])) - { - ret = 1; - break; - } - if (get_nibble_value(private_k[i]) > get_nibble_value(pCurve->Eorder[i])) - { - ret = 0; - break; - } - } - return ret; -} - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt Reference to Crypto module. - * @param[in] private_k The input private key. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] public_k1 The output public key 1. - * @param[out] public_k2 The output public key 2. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]) -{ - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(private_k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, public_k1); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, public_k2); - } - - return ret; -} - -/** - * @brief Given a private key and curve to generate the public key pair. - * @param[in] crpt Reference to Crypto module. - * @param[out] x1 The x-coordinate of input point. - * @param[out] y1 The y-coordinate of input point. - * @param[in] k The private key - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[out] x2 The x-coordinate of output point. - * @param[out] y2 The y-coordinate of output point. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]) -{ - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(x1, crpt->ECC_X1); - Hex2Reg(y1, crpt->ECC_Y1); - Hex2Reg(k, crpt->ECC_K); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, x2); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, y2); - } - - return ret; -} - -/** - * @brief Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] private_k One's own private key. - * @param[in] public_k1 The other party's publick key 1. - * @param[in] public_k2 The other party's publick key 2. - * @param[out] secret_z The ECC CDH secret Z. - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]) -{ - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - if ((ecc_curve == CURVE_B_163) || (ecc_curve == CURVE_B_233) || (ecc_curve == CURVE_B_283) || - (ecc_curve == CURVE_B_409) || (ecc_curve == CURVE_B_571) || (ecc_curve == CURVE_K_163)) - { - Hex2RegEx(private_k, crpt->ECC_K, 1); - } - else if ((ecc_curve == CURVE_K_233) || (ecc_curve == CURVE_K_283) || - (ecc_curve == CURVE_K_409) || (ecc_curve == CURVE_K_571)) - { - Hex2RegEx(private_k, crpt->ECC_K, 2); - } - else - { - Hex2Reg(private_k, crpt->ECC_K); - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* set FSEL (Field selection) */ - if (pCurve->GF == (int)CURVE_GF_2M) - { - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | - ECCOP_POINT_MUL | CRPT_ECC_CTL_START_Msk; - - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - Reg2Hex(pCurve->Echar, crpt->ECC_X1, secret_z); - } - - return ret; -} - -/** @cond HIDDEN_SYMBOLS */ - -static void run_ecc_codec(CRPT_T *crpt, uint32_t mode) -{ - if ((mode & CRPT_ECC_CTL_ECCOP_Msk) == ECCOP_MODULE) - { - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - else - { - if (pCurve->GF == (int)CURVE_GF_2M) - { - /* point */ - crpt->ECC_CTL = 0UL; - } - else - { - /* CURVE_GF_P */ - crpt->ECC_CTL = CRPT_ECC_CTL_FSEL_Msk; - } - } - - g_ECC_done = g_ECCERR_done = 0UL; - crpt->ECC_CTL |= ((uint32_t)pCurve->key_len << CRPT_ECC_CTL_CURVEM_Pos) | mode | CRPT_ECC_CTL_START_Msk; - while ((g_ECC_done | g_ECCERR_done) == 0UL) - { - } - - while (crpt->ECC_STS & CRPT_ECC_STS_BUSY_Msk) - { - } -} -/** @endcond HIDDEN_SYMBOLS */ - -/** - * @brief ECDSA digital signature generation. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] d The private key. - * @param[in] k The selected random integer. - * @param[out] R R of the (R,S) pair digital signature - * @param[out] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - */ -int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *d, char *k, char *R, char *S) -{ - uint32_t volatile temp_result1[18], temp_result2[18]; - int32_t i, ret = 0; - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - /* - * 1. Calculate e = HASH(m), where HASH is a cryptographic hashing algorithm, (i.e. SHA-1) - * (1) Use SHA to calculate e - */ - - /* 2. Select a random integer k form [1, n-1] - * (1) Notice that n is order, not prime modulus or irreducible polynomial function - */ - - /* - * 3. Compute r = x1 (mod n), where (x1, y1) = k * G. If r = 0, go to step 2 - * (1) Write the curve parameter A, B, and curve length M to corresponding registers - * (2) Write the prime modulus or irreducible polynomial function to N registers according - * (3) Write the point G(x, y) to X1, Y1 registers - * (4) Write the random integer k to K register - * (5) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Write the curve order and curve length to N ,M registers according - * (10) Write 0x0 to Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 * - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Read X1 registers to get r - */ - - /* 3-(4) Write the random integer k to K register */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_K); - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* 3-(9) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(10) Write 0x0 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* 3-(15) Read X1 registers to get r */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result1, R); - - /* - * 4. Compute s = k ? 1 * (e + d * r)(mod n). If s = 0, go to step 2 - * (1) Write the curve order to N registers according - * (2) Write 0x1 to Y1 registers - * (3) Write the random integer k to X1 registers according - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set START(CRPT_ECC_CTL[0]) to 1 - * (7) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (8) Read X1 registers to get k^-1 - * (9) Write the curve order and curve length to N ,M registers - * (10) Write r, d to X1, Y1 registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (12) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (13) Set START(CRPT_ECC_CTL[0]) to 1 - * (14) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (15) Write the curve order to N registers - * (16) Write e to Y1 registers - * (17) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (18) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (19) Set START(CRPT_ECC_CTL[0]) to 1 - * (20) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (21) Write the curve order and curve length to N ,M registers - * (22) Write k^-1 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get s - */ - - /* S/W: GFp_add_mod_order(pCurve->key_len+2, 0, x1, a, R); */ - - /* 4-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write 0x1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 4-(3) Write the random integer k to X1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(k, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(7) output = %s\n", temp_hex_str); -#endif - - /* 4-(8) Read X1 registers to get k^-1 */ - - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("k^-1 = %s\n", temp_hex_str); -#endif - - /* 4-(9) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(10) Write r, d to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - } - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - Hex2Reg(d, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(14) output = %s\n", temp_hex_str); -#endif - - /* 4-(15) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(16) Write e to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_Y1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("(20) output = %s\n", temp_hex_str); -#endif - - /* 4-(21) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(22) Write k^-1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(27) Read X1 registers to get s */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - - Reg2Hex(pCurve->Echar, temp_result2, S); - - } /* ret == 0 */ - - return ret; -} - -/** - * @brief ECDSA dogotal signature verification. - * @param[in] crpt Reference to Crypto module. - * @param[in] ecc_curve The pre-defined ECC curve. - * @param[in] message The hash value of source context. - * @param[in] public_k1 The public key 1. - * @param[in] public_k2 The public key 2. - * @param[in] R R of the (R,S) pair digital signature - * @param[in] S S of the (R,S) pair digital signature - * @return 0 Success. - * @return -1 "ecc_curve" value is invalid. - * @return -2 Verification failed. - */ -int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, - char *public_k1, char *public_k2, char *R, char *S) -{ - uint32_t temp_result1[18], temp_result2[18]; - uint32_t temp_x[18], temp_y[18]; - int32_t i, ret = 0; - - /* - * 1. Verify that r and s are integers in the interval [1, n-1]. If not, the signature is invalid - * 2. Compute e = HASH (m), where HASH is the hashing algorithm in signature generation - * (1) Use SHA to calculate e - */ - - /* - * 3. Compute w = s^-1 (mod n) - * (1) Write the curve order to N registers - * (2) Write 0x1 to Y1 registers - * (3) Write s to X1 registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (5) Set MOPOP(CRPT_ECC_CTL[12:11]) to 00 - * (6) Set FSEL(CRPT_ECC_CTL[8]) according to used curve of prime field or binary field - * (7) Set START(CRPT_ECC_CTL[0]) to 1 - * (8) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (9) Read X1 registers to get w - */ - - if (ecc_init_curve(crpt, ecc_curve) != 0) - { - ret = -1; - } - - if (ret == 0) - { - /* 3-(1) Write the curve order to N registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 3-(2) Write 0x1 to Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = 0UL; - } - crpt->ECC_Y1[0] = 0x1UL; - - /* 3-(3) Write s to X1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(S, crpt->ECC_X1); - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_DIV); - - /* 3-(9) Read X1 registers to get w */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - CRPT_DBGMSG("e = %s\n", message); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("w = %s\n", temp_hex_str); - CRPT_DBGMSG("o = %s (order)\n", pCurve->Eorder); -#endif - - /* - * 4. Compute u1 = e * w (mod n) and u2 = r * w (mod n) - * (1) Write the curve order and curve length to N ,M registers - * (2) Write e, w to X1, Y1 registers - * (3) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (4) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1 registers to get u1 - * (8) Write the curve order and curve length to N ,M registers - * (9) Write r, w to X1, Y1 registers - * (10) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (11) Set MOPOP(CRPT_ECC_CTL[12:11]) to 01 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Read X1 registers to get u2 - */ - - /* 4-(1) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(2) Write e, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(message, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(7) Read X1 registers to get u1 */ - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("u1 = %s\n", temp_hex_str); -#endif - - /* 4-(8) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* 4-(9) Write r, w to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - } - Hex2Reg(R, crpt->ECC_X1); - - for (i = 0; i < 18; i++) - { - crpt->ECC_Y1[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_MUL); - - /* 4-(14) Read X1 registers to get u2 */ - for (i = 0; i < 18; i++) - { - temp_result2[i] = crpt->ECC_X1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("u2 = %s\n", temp_hex_str); -#endif - - /* - * 5. Compute X' (x1' y1') = u1 * G + u2 * Q - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - * (3) Write u1 to K registers - * (4) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (5) Set START(CRPT_ECC_CTL[0]) to 1 - * (6) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (7) Read X1, Y1 registers to get u1*G - * (8) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (9) Write the public key Q(x,y) to X1, Y1 registers - * (10) Write u2 to K registers - * (11) Set ECCOP(CRPT_ECC_CTL[10:9]) to 00 - * (12) Set START(CRPT_ECC_CTL[0]) to 1 - * (13) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (14) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (15) Write the result data u1*G to X2, Y2 registers - * (16) Set ECCOP(CRPT_ECC_CTL[10:9]) to 10 - * (17) Set START(CRPT_ECC_CTL[0]) to 1 - * (18) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (19) Read X1, Y1 registers to get X('x1', y1') - * (20) Write the curve order and curve length to N ,M registers - * (21) Write x1' to X1 registers - * (22) Write 0x0 to Y1 registers - * (23) Set ECCOP(CRPT_ECC_CTL[10:9]) to 01 - * (24) Set MOPOP(CRPT_ECC_CTL[12:11]) to 10 - * (25) Set START(CRPT_ECC_CTL[0]) to 1 - * (26) Wait for BUSY(CRPT_ECC_STS[0]) be cleared - * (27) Read X1 registers to get x1' (mod n) - * - * 6. The signature is valid if x1' = r, otherwise it is invalid - */ - - /* - * (1) Write the curve parameter A, B, N, and curve length M to corresponding registers - * (2) Write the point G(x, y) to X1, Y1 registers - */ - ecc_init_curve(crpt, ecc_curve); - - /* (3) Write u1 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result1[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - /* (7) Read X1, Y1 registers to get u1*G */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(7) u1*G, y = %s\n", temp_hex_str); -#endif - - /* (8) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* (9) Write the public key Q(x,y) to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = 0UL; - crpt->ECC_Y1[i] = 0UL; - } - - Hex2Reg(public_k1, crpt->ECC_X1); - Hex2Reg(public_k2, crpt->ECC_Y1); - - /* (10) Write u2 to K registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_K[i] = temp_result2[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_MUL); - - for (i = 0; i < 18; i++) - { - temp_result1[i] = crpt->ECC_X1[i]; - temp_result2[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_result1, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, x = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_result2, temp_hex_str); - CRPT_DBGMSG("5-(13) u2*Q, y = %s\n", temp_hex_str); -#endif - - /* (14) Write the curve parameter A, B, N, and curve length M to corresponding registers */ - ecc_init_curve(crpt, ecc_curve); - - /* Write the result data u2*Q to X1, Y1 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_result1[i]; - crpt->ECC_Y1[i] = temp_result2[i]; - } - - /* (15) Write the result data u1*G to X2, Y2 registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X2[i] = temp_x[i]; - crpt->ECC_Y2[i] = temp_y[i]; - } - - run_ecc_codec(crpt, ECCOP_POINT_ADD); - - /* (19) Read X1, Y1 registers to get X'(x1' y1') */ - for (i = 0; i < 18; i++) - { - temp_x[i] = crpt->ECC_X1[i]; - temp_y[i] = crpt->ECC_Y1[i]; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, temp_x, temp_hex_str); - CRPT_DBGMSG("5-(19) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, temp_y, temp_hex_str); - CRPT_DBGMSG("5-(19) y' = %s\n", temp_hex_str); -#endif - - /* (20) Write the curve order and curve length to N ,M registers */ - for (i = 0; i < 18; i++) - { - crpt->ECC_N[i] = 0UL; - } - Hex2Reg(pCurve->Eorder, crpt->ECC_N); - - /* - * (21) Write x1' to X1 registers - * (22) Write 0x0 to Y1 registers - */ - for (i = 0; i < 18; i++) - { - crpt->ECC_X1[i] = temp_x[i]; - crpt->ECC_Y1[i] = 0UL; - } - -#if ENABLE_DEBUG - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(21) x' = %s\n", temp_hex_str); - Reg2Hex(pCurve->Echar, crpt->ECC_Y1, temp_hex_str); - CRPT_DBGMSG("5-(22) y' = %s\n", temp_hex_str); -#endif - - run_ecc_codec(crpt, ECCOP_MODULE | MODOP_ADD); - - /* (27) Read X1 registers to get x1' (mod n) */ - Reg2Hex(pCurve->Echar, crpt->ECC_X1, temp_hex_str); - CRPT_DBGMSG("5-(27) x1' (mod n) = %s\n", temp_hex_str); - - /* 6. The signature is valid if x1' = r, otherwise it is invalid */ - - /* Compare with test pattern to check if r is correct or not */ - if (ecc_strcmp(temp_hex_str, R) != 0) - { - CRPT_DBGMSG("x1' (mod n) != R Test filed!!\n"); - CRPT_DBGMSG("Signature R [%s] is not matched with expected R [%s]!\n", temp_hex_str, R); - ret = -2; - } - } /* ret == 0 */ - - return ret; -} - - -/*-----------------------------------------------------------------------------------------------*/ -/* */ -/* RSA */ -/* */ -/*-----------------------------------------------------------------------------------------------*/ - -/** @cond HIDDEN_SYMBOLS */ - -#define MAX_DIGIT 0xFFFFFFFFUL -#define MAX_HALF_DIGIT 0xFFFFUL /* NB 'L' */ -#define BITS_PER_DIGIT 32 -#define HIBITMASK 0x80000000UL - -#define MAX_FIXED_BIT_LENGTH 8192 -#define MAX_FIXED_DIGITS ((MAX_FIXED_BIT_LENGTH + BITS_PER_DIGIT - 1) / BITS_PER_DIGIT) - -#ifndef max - #define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif - - -static uint32_t qq[MAX_FIXED_DIGITS * 2]; -static uint32_t rr[MAX_FIXED_DIGITS * 2]; - - -/** Returns number of significant digits in a */ -static int mpSizeof(const uint32_t a[], int ndigits) -{ - while (ndigits--) - { - if (a[ndigits] != 0) - return (++ndigits); - } - return 0; -} - - -static int mpBitLength(const uint32_t d[], int ndigits) -/* Returns no of significant bits in d */ -{ - int n, i, bits; - uint32_t mask; - - if (!d || ndigits == 0) - return 0; - - n = mpSizeof(d, ndigits); - if (0 == n) return 0; - - for (i = 0, mask = HIBITMASK; mask > 0; mask >>= 1, i++) - { - if (d[n - 1] & mask) - break; - } - bits = n * BITS_PER_DIGIT - i; - return bits; -} - -static int mpGetBit(const uint32_t a[], int ndigits, int ibit) -/* Returns value 1 or 0 of bit n (0..nbits-1); or -1 if out of range */ -{ - int idigit, bit_to_get; - uint32_t mask; - - /* Which digit? (0-based) */ - idigit = ibit / BITS_PER_DIGIT; - if (idigit >= ndigits) - return -1; - - /* Set mask */ - bit_to_get = ibit % BITS_PER_DIGIT; - mask = 0x01 << bit_to_get; - - return ((a[idigit] & mask) ? 1 : 0); -} - -static uint32_t mpSetZero(volatile uint32_t a[], int ndigits) -{ - /* Sets a = 0 */ - - /* Prevent optimiser ignoring this */ - volatile uint32_t optdummy; - volatile uint32_t *p = a; - - while (ndigits--) - a[ndigits] = 0; - - optdummy = *p; - return optdummy; -} - -static void mpSetEqual(uint32_t a[], const uint32_t b[], int ndigits) -{ - /* Sets a = b */ - int i; - - for (i = 0; i < ndigits; i++) - { - a[i] = b[i]; - } -} - -static void mpSetDigit(uint32_t a[], uint32_t d, int ndigits) -{ - /* Sets a = d where d is a single digit */ - int i; - - for (i = 1; i < ndigits; i++) - { - a[i] = 0; - } - a[0] = d; -} - -/** Returns sign of (a - b) as 0, +1 or -1. Not constant-time. */ -static int mpCompare(const uint32_t a[], const uint32_t b[], int ndigits) -{ - /* if (ndigits == 0) return 0; // deleted [v2.5] */ - - while (ndigits--) - { - if (a[ndigits] > b[ndigits]) - return 1; /* GT */ - if (a[ndigits] < b[ndigits]) - return -1; /* LT */ - } - - return 0; /* EQ */ -} - -static uint32_t mpShiftLeft(uint32_t a[], const uint32_t *b, - int shift, int ndigits) -{ - /* Computes a = b << shift */ - /* [v2.1] Modified to cope with shift > BITS_PERDIGIT */ - int i, y, nw, bits; - uint32_t mask, carry, nextcarry; - - /* Do we shift whole digits? */ - if (shift >= BITS_PER_DIGIT) - { - nw = shift / BITS_PER_DIGIT; - i = ndigits; - while (i--) - { - if (i >= nw) - a[i] = b[i - nw]; - else - a[i] = 0; - } - /* Call again to shift bits inside digits */ - bits = shift % BITS_PER_DIGIT; - carry = b[ndigits - nw] << bits; - if (bits) - carry |= mpShiftLeft(a, a, bits, ndigits); - return carry; - } - else - { - bits = shift; - } - - /* Construct mask = high bits set */ - mask = ~(~(uint32_t)0 >> bits); - - y = BITS_PER_DIGIT - bits; - carry = 0; - for (i = 0; i < ndigits; i++) - { - nextcarry = (b[i] & mask) >> y; - a[i] = b[i] << bits | carry; - carry = nextcarry; - } - - return carry; -} - -static uint32_t mpShiftRight(uint32_t a[], const uint32_t b[], int shift, int ndigits) -{ - /* Computes a = b >> shift */ - /* [v2.1] Modified to cope with shift > BITS_PERDIGIT */ - int i, y, nw, bits; - uint32_t mask, carry, nextcarry; - - /* Do we shift whole digits? */ - if (shift >= BITS_PER_DIGIT) - { - nw = shift / BITS_PER_DIGIT; - for (i = 0; i < ndigits; i++) - { - if ((i + nw) < ndigits) - a[i] = b[i + nw]; - else - a[i] = 0; - } - /* Call again to shift bits inside digits */ - bits = shift % BITS_PER_DIGIT; - carry = b[nw - 1] >> bits; - if (bits) - carry |= mpShiftRight(a, a, bits, ndigits); - return carry; - } - else - { - bits = shift; - } - - /* Construct mask to set low bits */ - /* (thanks to Jesse Chisholm for suggesting this improved technique) */ - mask = ~(~(uint32_t)0 << bits); - - y = BITS_PER_DIGIT - bits; - carry = 0; - i = ndigits; - while (i--) - { - nextcarry = (b[i] & mask) << y; - a[i] = b[i] >> bits | carry; - carry = nextcarry; - } - - return carry; -} - -static uint32_t spDivide(uint32_t *pq, uint32_t *pr, const uint32_t u[2], uint32_t v) -{ - uint64_t uu, q; - uu = (uint64_t)u[1] << 32 | (uint64_t)u[0]; - q = uu / (uint64_t)v; - //r = uu % (uint64_t)v; - *pr = (uint32_t)(uu - q * v); - *pq = (uint32_t)(q & 0xFFFFFFFF); - return (uint32_t)(q >> 32); -} - -static int spMultiply(uint32_t p[2], uint32_t x, uint32_t y) -{ - /* Use a 64-bit temp for product */ - uint64_t t = (uint64_t)x * (uint64_t)y; - /* then split into two parts */ - p[1] = (uint32_t)(t >> 32); - p[0] = (uint32_t)(t & 0xFFFFFFFF); - - return 0; -} - -static uint32_t mpMultSub(uint32_t wn, uint32_t w[], const uint32_t v[], - uint32_t q, int n) -{ - /* Compute w = w - qv - where w = (WnW[n-1]...W[0]) - return modified Wn. - */ - uint32_t k, t[4]; - int i; - - if (q == 0) /* No change */ - return wn; - - k = 0; - - for (i = 0; i < n; i++) - { - spMultiply(t, q, v[i]); - w[i] -= k; - if (w[i] > MAX_DIGIT - k) - k = 1; - else - k = 0; - w[i] -= t[0]; - if (w[i] > MAX_DIGIT - t[0]) - k++; - k += t[1]; - } - - /* Cope with Wn not stored in array w[0..n-1] */ - wn -= k; - - return wn; -} - -static uint32_t mpShortDiv(uint32_t q[], const uint32_t u[], uint32_t v, - int ndigits) -{ - /* Calculates quotient q = u div v - Returns remainder r = u mod v - where q, u are multiprecision integers of ndigits each - and r, v are single precision digits. - - Makes no assumptions about normalisation. - - Ref: Knuth Vol 2 Ch 4.3.1 Exercise 16 p625 - */ - int j; - uint32_t t[4], r; - int shift; - uint32_t bitmask, overflow, *uu; - - if (ndigits == 0) return 0; - if (v == 0) return 0; /* Divide by zero error */ - - /* Normalise first */ - /* Requires high bit of V - to be set, so find most signif. bit then shift left, - i.e. d = 2^shift, u' = u * d, v' = v * d. - */ - bitmask = HIBITMASK; - for (shift = 0; shift < BITS_PER_DIGIT; shift++) - { - if (v & bitmask) - break; - bitmask >>= 1; - } - - if (shift == BITS_PER_DIGIT) return 0; /* Avoid cppcheck false-alarm. */ - - v <<= shift; - overflow = mpShiftLeft(q, u, shift, ndigits); - uu = q; - - /* Step S1 - modified for extra digit. */ - r = overflow; /* New digit Un */ - j = ndigits; - while (j--) - { - /* Step S2. */ - t[1] = r; - t[0] = uu[j]; - overflow = spDivide(&q[j], &r, t, v); - } - - /* Unnormalise */ - r >>= shift; - - return r; -} - -static int QhatTooBig(uint32_t qhat, uint32_t rhat, - uint32_t vn2, uint32_t ujn2) -{ - /* Returns true if Qhat is too big - i.e. if (Qhat * Vn-2) > (b.Rhat + Uj+n-2) - */ - uint32_t t[4]; - - spMultiply(t, qhat, vn2); - if (t[1] < rhat) - return 0; - else if (t[1] > rhat) - return 1; - else if (t[0] > ujn2) - return 1; - - return 0; -} - -static uint32_t mpAdd(uint32_t w[], const uint32_t u[], const uint32_t v[], int ndigits) -{ - /* Calculates w = u + v - where w, u, v are multiprecision integers of ndigits each - Returns carry if overflow. Carry = 0 or 1. - - Ref: Knuth Vol 2 Ch 4.3.1 p 266 Algorithm A. - */ - - uint32_t k; - int j; - - // assert(w != v); - - /* Step A1. Initialise */ - k = 0; - - for (j = 0; j < ndigits; j++) - { - /* Step A2. Add digits w_j = (u_j + v_j + k) - Set k = 1 if carry (overflow) occurs - */ - w[j] = u[j] + k; - if (w[j] < k) - k = 1; - else - k = 0; - - w[j] += v[j]; - if (w[j] < v[j]) - k++; - - } /* Step A3. Loop on j */ - - return k; /* w_n = k */ -} - -static int mpDivide(uint32_t q[], uint32_t r[], const uint32_t u[], - int udigits, uint32_t v[], int vdigits) -{ - /* Computes quotient q = u / v and remainder r = u mod v - where q, r, u are multiple precision digits - all of udigits and the divisor v is vdigits. - - Ref: Knuth Vol 2 Ch 4.3.1 p 272 Algorithm D. - - Do without extra storage space, i.e. use r[] for - normalised u[], unnormalise v[] at end, and cope with - extra digit Uj+n added to u after normalisation. - - WARNING: this trashes q and r first, so cannot do - u = u / v or v = u mod v. - It also changes v temporarily so cannot make it const. - */ - int shift; - int n, m, j; - uint32_t bitmask, overflow; - uint32_t qhat, rhat, t[4]; - uint32_t *uu, *ww; - int qhatOK, cmp; - - /* Clear q and r */ - mpSetZero(q, udigits); - mpSetZero(r, udigits); - - /* Work out exact sizes of u and v */ - n = (int)mpSizeof(v, vdigits); - m = (int)mpSizeof(u, udigits); - m -= n; - - /* Catch special cases */ - if (n == 0) - return -1; /* Error: divide by zero */ - - if (n == 1) - { - /* Use short division instead */ - r[0] = mpShortDiv(q, u, v[0], udigits); - return 0; - } - - if (m < 0) - { - /* v > u, so just set q = 0 and r = u */ - mpSetEqual(r, u, udigits); - return 0; - } - - if (m == 0) - { - /* u and v are the same length */ - cmp = mpCompare(u, v, (int)n); - if (cmp < 0) - { - /* v > u, as above */ - mpSetEqual(r, u, udigits); - return 0; - } - else if (cmp == 0) - { - /* v == u, so set q = 1 and r = 0 */ - mpSetDigit(q, 1, udigits); - return 0; - } - } - - /* In Knuth notation, we have: - Given - u = (Um+n-1 ... U1U0) - v = (Vn-1 ... V1V0) - Compute - q = u/v = (QmQm-1 ... Q0) - r = u mod v = (Rn-1 ... R1R0) - */ - - /* Step D1. Normalise */ - /* Requires high bit of Vn-1 - to be set, so find most signif. bit then shift left, - i.e. d = 2^shift, u' = u * d, v' = v * d. - */ - bitmask = HIBITMASK; - for (shift = 0; shift < BITS_PER_DIGIT; shift++) - { - if (v[n - 1] & bitmask) - break; - bitmask >>= 1; - } - - /* Normalise v in situ - NB only shift non-zero digits */ - overflow = mpShiftLeft(v, v, shift, n); - - /* Copy normalised dividend u*d into r */ - overflow = mpShiftLeft(r, u, shift, n + m); - uu = r; /* Use ptr to keep notation constant */ - - t[0] = overflow; /* Extra digit Um+n */ - - /* Step D2. Initialise j. Set j = m */ - for (j = m; j >= 0; j--) - { - /* Step D3. Set Qhat = [(b.Uj+n + Uj+n-1)/Vn-1] - and Rhat = remainder */ - qhatOK = 0; - t[1] = t[0]; /* This is Uj+n */ - t[0] = uu[j + n - 1]; - overflow = spDivide(&qhat, &rhat, t, v[n - 1]); - - /* Test Qhat */ - if (overflow) - { - /* Qhat == b so set Qhat = b - 1 */ - qhat = MAX_DIGIT; - rhat = uu[j + n - 1]; - rhat += v[n - 1]; - if (rhat < v[n - 1]) /* Rhat >= b, so no re-test */ - qhatOK = 1; - } - /* [VERSION 2: Added extra test "qhat && "] */ - if (qhat && !qhatOK && QhatTooBig(qhat, rhat, v[n - 2], uu[j + n - 2])) - { - /* If Qhat.Vn-2 > b.Rhat + Uj+n-2 - decrease Qhat by one, increase Rhat by Vn-1 - */ - qhat--; - rhat += v[n - 1]; - /* Repeat this test if Rhat < b */ - if (!(rhat < v[n - 1])) - if (QhatTooBig(qhat, rhat, v[n - 2], uu[j + n - 2])) - qhat--; - } - - - /* Step D4. Multiply and subtract */ - ww = &uu[j]; - overflow = mpMultSub(t[1], ww, v, qhat, (int)n); - - /* Step D5. Test remainder. Set Qj = Qhat */ - q[j] = qhat; - if (overflow) - { - /* Step D6. Add back if D4 was negative */ - q[j]--; - overflow = mpAdd(ww, ww, v, (int)n); - } - - t[0] = uu[j + n - 1]; /* Uj+n on next round */ - - } /* Step D7. Loop on j */ - - /* Clear high digits in uu */ - for (j = n; j < m + n; j++) - uu[j] = 0; - - /* Step D8. Unnormalise. */ - - mpShiftRight(r, r, shift, n); - mpShiftRight(v, v, shift, n); - - return 0; -} - -/***************************/ -static int mpModulo(uint32_t r[], const uint32_t u[], int udigits, - uint32_t v[], int vdigits) -{ - /* Computes r = u mod v - where r, v are multiprecision integers of length vdigits - and u is a multiprecision integer of length udigits. - r may overlap v. - - Note that r here is only vdigits long, - whereas in mpDivide it is udigits long. - - Use remainder from mpDivide function. - */ - - int nn = max(udigits, vdigits); - - // [v2.6] increased to two times - if (nn > (MAX_FIXED_DIGITS * 2)) - { - printf("Error!! mpModulo nn overflow!\n"); - return -1; - } - - /* rr[nn] = u mod v */ - mpDivide(qq, rr, u, udigits, v, vdigits); - - /* Final r is only vdigits long */ - mpSetEqual(r, rr, vdigits); - return 0; -} - - -static void Hex2Binary(char *input, char *output) -{ - int i, j, idx, n, klen; - char *p = (char *)input; - - klen = strlen(input); - - if ((klen + 3) > RSA_KBUF_HLEN) - { - printf("Hex2Binary overflow!! %d > %d\n", klen + 3, RSA_KBUF_HLEN); - } - - klen = strlen(input) * 4; - - memset(output, 0, RSA_KBUF_BLEN); - output[klen] = 0; - output[klen + 1] = 0; - - idx = klen - 1; - - for (i = 0; *p != 0; i++, p++) - { - if (input[i] <= '9') - { - n = input[i] - '0'; - } - else if (input[i] >= 'a') - { - n = input[i] - 'a' + 10; - } - else - { - n = input[i] - 'A' + 10; - } - - for (j = 3; j >= 0; j--) - { - output[idx--] = (n >> j) & 0x1; - } - } - if (idx != -1) - { - printf("Hex2Binary unexpected error!!\n"); - } -} - -static void Binary2Hex(int length, char *input, char *output) -{ - int i, idx, n, slen; - - memset(output, 0, RSA_KBUF_HLEN); - - slen = length / 4; - - idx = slen - 1; - - for (i = 0; i < length; i += 4) - { - n = (input[i]) | (input[i + 1] << 1) | (input[i + 2] << 2) | (input[i + 3] << 3); - if (n >= 10) - output[idx] = n - 10 + 'A'; - else - output[idx] = n + '0'; - idx--; - } - - if (idx != -1) - { - printf("Binary2Hex unecpected error! %d\n", idx); - } -} - -#define Hardware_length (2096) - -static uint32_t C_t[(2096 * 2) / 32]; -static uint32_t N_t[(2096 * 2) / 32]; - -static char C[RSA_KBUF_BLEN], N[RSA_KBUF_BLEN]; - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief Calculate the constant value of Montgomery domain. - * @param[in] length RSA bit length. - * @param[in] rsa_N The base of modulus operation. - * @param[out] rsa_C The constant value of Montgomery domain required by NUC980 RSA engine. - */ -void RSA_Calculate_C(int length, char *rsa_N, char *rsa_C) -{ - int i, v, nbits; - uint32_t j; - int scale = (length + 2) * 2; - size_t word_size = (scale / 32) + 1; - - memset(rsa_C, 0, length / 4 + 2); - Hex2Binary(rsa_N, N); - - memset(C_t, 0, sizeof(C_t)); - C_t[word_size - 1] = (uint32_t)(1 << scale - (32 * (word_size - 1))); - - // convert char to uint32_t - memset(N_t, 0, sizeof(N_t)); - j = 0; - for (i = 0; i < length; i++) - { - if (N[i]) - { - j += 1 << (i % 32); - } - - if ((i % 32) == 31) - { - N_t[(i / 32)] = j; - j = 0; - } - } - mpModulo(C_t, C_t, word_size, N_t, word_size); - - // convert uint32_t to char - nbits = (int)mpBitLength(C_t, word_size); - for (i = Hardware_length; i >= 0; i--) - { - if (i > nbits) - C[i] = 0; - else - { - v = mpGetBit(C_t, word_size, i); - C[i] = v ? 1 : 0; - } - } - Binary2Hex(length, C, rsa_C); -} - -/** - * @brief RSA digital signature generation. - * @param[in] crpt Reference to Crypto module. - * @param[in] rsa_len RSA key length - * @param[in] n The modulus for both the public and private keys - * @param[in] d (n,d) is the private key - * @param[in] C The constant value of Montgomery domain. - * @param[in] msg The message to be signed. - * @param[out] sig The output signature. - * @return 0 Success. - * @return -1 Error - */ -int32_t RSA_GenerateSignature(CRPT_T *crpt, int rsa_len, char *n, char *d, char *C, - char *msg, char *sig) -{ - int i; - - for (i = 0; i < 128; i++) - { - crpt->RSA_N[i] = 0; - crpt->RSA_E[i] = 0; - crpt->RSA_M[i] = 0; - } - - Hex2Reg(n, (uint32_t *)&crpt->RSA_N[0]); - Hex2Reg(d, (uint32_t *)&crpt->RSA_E[0]); - Hex2Reg(msg, (uint32_t *)&crpt->RSA_M[0]); - Hex2Reg(C, (uint32_t *)&crpt->RSA_C[0]); - - CRPT->RSA_CTL = (rsa_len << CRPT_RSA_CTL_KEYLEN_Pos) | CRPT_RSA_CTL_START_Msk; - while (CRPT->RSA_STS & CRPT_RSA_STS_BUSY_Msk) ; - - Reg2Hex(rsa_len / 4, (uint32_t *)CRPT->RSA_M, sig); - return 0; -} - -/** - * @brief RSA digital signature generation. - * @param[in] crpt Reference to Crypto module. - * @param[in] rsa_len RSA key length - * @param[in] n The modulus for both the public and private keys - * @param[in] e (n,e) is the public key - * @param[in] C The constant value of Montgomery domain. - * @param[in] sig The signature to be verified. - * @param[out] msg The message to be compared. - * @return 0 Success. - * @return -1 Verify failed - */ -int32_t RSA_VerifySignature(CRPT_T *crpt, int rsa_len, char *n, char *e, char *C, - char *sig, char *msg) -{ - char output[RSA_KBUF_HLEN]; - int i; - - for (i = 0; i < 128; i++) - { - crpt->RSA_N[i] = 0; - crpt->RSA_E[i] = 0; - crpt->RSA_M[i] = 0; - } - - Hex2Reg(n, (uint32_t *)&crpt->RSA_N[0]); - Hex2Reg(e, (uint32_t *)&crpt->RSA_E[0]); - Hex2Reg(sig, (uint32_t *)&crpt->RSA_M[0]); - Hex2Reg(C, (uint32_t *)&crpt->RSA_C[0]); - - CRPT->RSA_CTL = (rsa_len << CRPT_RSA_CTL_KEYLEN_Pos) | CRPT_RSA_CTL_START_Msk; - while (CRPT->RSA_STS & CRPT_RSA_STS_BUSY_Msk) ; - - Reg2Hex(rsa_len / 4, (uint32_t *)CRPT->RSA_M, output); - - printf("RSA verify: %s\n", output); - - if (ecc_strcmp(output, msg) != 0) - { - CRPT_DBGMSG("RSA verify output [%s] is not matched with expected [%s]!\n", output, msg); - return -1; - } - return 0; -} - - - -/*@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group CRYPTO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_ebi.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_ebi.c deleted file mode 100644 index 92297f9a091..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_ebi.c +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************//** - * @file ebi.c - * @version V1.00 - * @brief NUC980 series External Bus Interface(EBI) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nuc980.h" -#include "nu_ebi.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EBI_Driver EBI Driver - @{ -*/ - - -/** @addtogroup EBI_EXPORTED_FUNCTIONS EBI Exported Functions - @{ -*/ - -/** - * @brief Initialize EBI for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32DataWidth Data bus width. Valid values are: - * - \ref EBI_BUSWIDTH_8BIT - * - \ref EBI_BUSWIDTH_16BIT - * @param[in] u32TimingClass Default timing configuration. Valid values are: - * - \ref EBI_TIMING_FASTEST - * - \ref EBI_TIMING_VERYFAST - * - \ref EBI_TIMING_FAST - * - \ref EBI_TIMING_NORMAL - * - \ref EBI_TIMING_SLOW - * - \ref EBI_TIMING_VERYSLOW - * - \ref EBI_TIMING_SLOWEST - * @param[in] u32BusMode Set EBI bus operate mode. Valid values are: - * - \ref EBI_OPMODE_NORMAL - * - \ref EBI_OPMODE_CACCESS - * @param[in] u32CSActiveLevel CS is active High/Low. Valid values are: - * - \ref EBI_CS_ACTIVE_HIGH - * - \ref EBI_CS_ACTIVE_LOW - * - * @return None - * - * @details This function is used to open specify EBI bank with different bus width, timing setting and \n - * active level of CS pin to access EBI device. - * @note Write Buffer Enable(WBUFEN) and Extend Time Of ALE(TALE) are only available in EBI bank0 control register. - */ -void EBI_Open(uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (uint32_t)u32Bank * 0x10U; - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (uint32_t)u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index0); - volatile uint32_t *pu32EBITCTL = (uint32_t *)(u32Index1); - - if (u32DataWidth == EBI_BUSWIDTH_8BIT) - { - *pu32EBICTL &= ~EBI_CTL_DW16_Msk; - } - else - { - *pu32EBICTL |= EBI_CTL_DW16_Msk; - } - - *pu32EBICTL |= u32BusMode; - - switch (u32TimingClass) - { - case EBI_TIMING_FASTEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_VERYFAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk)) | - (EBI_MCLKDIV_1 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_FAST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x0U; - break; - - case EBI_TIMING_NORMAL: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x03003318U; - break; - - case EBI_TIMING_SLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk)) | - (EBI_MCLKDIV_2 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_VERYSLOW: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk)) | - (EBI_MCLKDIV_4 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk ; - *pu32EBITCTL = 0x07007738U; - break; - - case EBI_TIMING_SLOWEST: - *pu32EBICTL = (*pu32EBICTL & ~(EBI_CTL_MCLKDIV_Msk)) | - (EBI_MCLKDIV_8 << EBI_CTL_MCLKDIV_Pos) | - (u32CSActiveLevel << EBI_CTL_CSPOLINV_Pos) | EBI_CTL_EN_Msk; - *pu32EBITCTL = 0x07007738U; - break; - - default: - *pu32EBICTL &= ~EBI_CTL_EN_Msk; - break; - } -} - -/** - * @brief Disable EBI on specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * - * @return None - * - * @details This function is used to close specify EBI function. - */ -void EBI_Close(uint32_t u32Bank) -{ - uint32_t u32Index = (uint32_t)&EBI->CTL0 + u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index); - - *pu32EBICTL &= ~EBI_CTL_EN_Msk; -} - -/** - * @brief Set EBI Bus Timing for specify Bank - * - * @param[in] u32Bank Bank number for EBI. Valid values are: - * - \ref EBI_BANK0 - * - \ref EBI_BANK1 - * - \ref EBI_BANK2 - * @param[in] u32TimingConfig Configure EBI timing settings, includes TACC, TAHD, W2X and R2R setting. - * @param[in] u32MclkDiv Divider for MCLK. Valid values are: - * - \ref EBI_MCLKDIV_1 - * - \ref EBI_MCLKDIV_2 - * - \ref EBI_MCLKDIV_4 - * - \ref EBI_MCLKDIV_8 - * - \ref EBI_MCLKDIV_16 - * - \ref EBI_MCLKDIV_32 - * - \ref EBI_MCLKDIV_64 - * - \ref EBI_MCLKDIV_128 - * - * @return None - * - * @details This function is used to configure specify EBI bus timing for access EBI device. - */ -void EBI_SetBusTiming(uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv) -{ - uint32_t u32Index0 = (uint32_t)&EBI->CTL0 + (uint32_t)u32Bank * 0x10U; - uint32_t u32Index1 = (uint32_t)&EBI->TCTL0 + (uint32_t)u32Bank * 0x10U; - volatile uint32_t *pu32EBICTL = (uint32_t *)(u32Index0); - volatile uint32_t *pu32EBITCTL = (uint32_t *)(u32Index1); - - *pu32EBICTL = (*pu32EBICTL & ~EBI_CTL_MCLKDIV_Msk) | (u32MclkDiv << EBI_CTL_MCLKDIV_Pos); - *pu32EBITCTL = u32TimingConfig; -} - -/*@}*/ /* end of group EBI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EBI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2019 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_emac.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_emac.c deleted file mode 100644 index 9df47d6f2b8..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_emac.c +++ /dev/null @@ -1,1170 +0,0 @@ -/**************************************************************************//** - * @file emac.c - * @version V1.00 - * @brief M480 EMAC driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include "NuMicro.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup EMAC_Driver EMAC Driver - @{ -*/ - - -/* Below are structure, definitions, static variables used locally by EMAC driver and does not want to parse by doxygen unless HIDDEN_SYMBOLS is defined */ -/** @cond HIDDEN_SYMBOLS */ - -/** @addtogroup EMAC_EXPORTED_CONSTANTS EMAC Exported Constants - @{ -*/ - -/* PHY Register Description */ -#define PHY_CNTL_REG 0x00UL /*!< PHY control register address */ -#define PHY_STATUS_REG 0x01UL /*!< PHY status register address */ -#define PHY_ID1_REG 0x02UL /*!< PHY ID1 register */ -#define PHY_ID2_REG 0x03UL /*!< PHY ID2 register */ -#define PHY_ANA_REG 0x04UL /*!< PHY auto-negotiation advertisement register */ -#define PHY_ANLPA_REG 0x05UL /*!< PHY auto-negotiation link partner availability register */ -#define PHY_ANE_REG 0x06UL /*!< PHY auto-negotiation expansion register */ - -/* PHY Control Register */ -#define PHY_CNTL_RESET_PHY (1UL << 15UL) -#define PHY_CNTL_DR_100MB (1UL << 13UL) -#define PHY_CNTL_ENABLE_AN (1UL << 12UL) -#define PHY_CNTL_POWER_DOWN (1UL << 11UL) -#define PHY_CNTL_RESTART_AN (1UL << 9UL) -#define PHY_CNTL_FULLDUPLEX (1UL << 8UL) - -/* PHY Status Register */ -#define PHY_STATUS_AN_COMPLETE (1UL << 5UL) -#define PHY_STATUS_LINK_VALID (1UL << 2UL) - -/* PHY Auto-negotiation Advertisement Register */ -#define PHY_ANA_DR100_TX_FULL (1UL << 8UL) -#define PHY_ANA_DR100_TX_HALF (1UL << 7UL) -#define PHY_ANA_DR10_TX_FULL (1UL << 6UL) -#define PHY_ANA_DR10_TX_HALF (1UL << 5UL) -#define PHY_ANA_IEEE_802_3_CSMA_CD (1UL << 0UL) - -/* PHY Auto-negotiation Link Partner Advertisement Register */ -#define PHY_ANLPA_DR100_TX_FULL (1UL << 8UL) -#define PHY_ANLPA_DR100_TX_HALF (1UL << 7UL) -#define PHY_ANLPA_DR10_TX_FULL (1UL << 6UL) -#define PHY_ANLPA_DR10_TX_HALF (1UL << 5UL) - -/* EMAC Tx/Rx descriptor's owner bit */ -#define EMAC_DESC_OWN_EMAC 0x80000000UL /*!< Set owner to EMAC */ -#define EMAC_DESC_OWN_CPU 0x00000000UL /*!< Set owner to CPU */ - -/* Rx Frame Descriptor Status */ -#define EMAC_RXFD_RTSAS 0x0080UL /*!< Time Stamp Available */ -#define EMAC_RXFD_RP 0x0040UL /*!< Runt Packet */ -#define EMAC_RXFD_ALIE 0x0020UL /*!< Alignment Error */ -#define EMAC_RXFD_RXGD 0x0010UL /*!< Receiving Good packet received */ -#define EMAC_RXFD_PTLE 0x0008UL /*!< Packet Too Long Error */ -#define EMAC_RXFD_CRCE 0x0002UL /*!< CRC Error */ -#define EMAC_RXFD_RXINTR 0x0001UL /*!< Interrupt on receive */ - -/* Tx Frame Descriptor's Control bits */ -#define EMAC_TXFD_TTSEN 0x08UL /*!< Tx time stamp enable */ -#define EMAC_TXFD_INTEN 0x04UL /*!< Tx interrupt enable */ -#define EMAC_TXFD_CRCAPP 0x02UL /*!< Append CRC */ -#define EMAC_TXFD_PADEN 0x01UL /*!< Padding mode enable */ - -/* Tx Frame Descriptor Status */ -#define EMAC_TXFD_TXINTR 0x0001UL /*!< Interrupt on Transmit */ -#define EMAC_TXFD_DEF 0x0002UL /*!< Transmit deferred */ -#define EMAC_TXFD_TXCP 0x0008UL /*!< Transmission Completion */ -#define EMAC_TXFD_EXDEF 0x0010UL /*!< Exceed Deferral */ -#define EMAC_TXFD_NCS 0x0020UL /*!< No Carrier Sense Error */ -#define EMAC_TXFD_TXABT 0x0040UL /*!< Transmission Abort */ -#define EMAC_TXFD_LC 0x0080UL /*!< Late Collision */ -#define EMAC_TXFD_TXHA 0x0100UL /*!< Transmission halted */ -#define EMAC_TXFD_PAU 0x0200UL /*!< Paused */ -#define EMAC_TXFD_SQE 0x0400UL /*!< SQE error */ -#define EMAC_TXFD_TTSAS 0x0800UL /*!< Time Stamp available */ - -/*@}*/ /* end of group EMAC_EXPORTED_CONSTANTS */ - -/** @addtogroup EMAC_EXPORTED_TYPEDEF EMAC Exported Type Defines - @{ -*/ - -/*@}*/ /* end of group EMAC_EXPORTED_TYPEDEF */ - -/* local variables */ -static uint32_t s_u32EnableTs = 0UL; - -static void EMAC_MdioWrite(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr, uint32_t u32Data); -static uint32_t EMAC_MdioRead(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr); - -static uint32_t EMAC_Subsec2Nsec(uint32_t subsec); -static uint32_t EMAC_Nsec2Subsec(uint32_t nsec); -static void EMAC_TxDescInit(EMAC_MEMMGR_T *psMemMgr); -static void EMAC_RxDescInit(EMAC_MEMMGR_T *psMemMgr); - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Write PHY register - * @param[in] u32Reg PHY register number - * @param[in] u32Addr PHY address, this address is board dependent - * @param[in] u32Data data to write to PHY register - * @return None - */ -static void EMAC_MdioWrite(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr, uint32_t u32Data) -{ - /* Set data register */ - EMAC->MIIMDAT = u32Data ; - /* Set PHY address, PHY register address, busy bit and write bit */ - EMAC->MIIMCTL = u32Reg | (u32Addr << 8) | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_WRITE_Msk | EMAC_MIIMCTL_MDCON_Msk; - - /* Wait write complete by polling busy bit. */ - while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk) - { - ; - } - -} - -/** - * @brief Read PHY register - * @param[in] u32Reg PHY register number - * @param[in] u32Addr PHY address, this address is board dependent - * @return Value read from PHY register - */ -static uint32_t EMAC_MdioRead(EMAC_T *EMAC, uint32_t u32Reg, uint32_t u32Addr) -{ - /* Set PHY address, PHY register address, busy bit */ - EMAC->MIIMCTL = u32Reg | (u32Addr << EMAC_MIIMCTL_PHYADDR_Pos) | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_MDCON_Msk; - - /* Wait read complete by polling busy bit */ - while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk) - { - ; - } - - /* Get return data */ - return EMAC->MIIMDAT; -} - -void EMAC_Reset(EMAC_T *EMAC) -{ - /* Reset MAC */ - EMAC->CTL = 0x1000000; -} - -/** - * @brief Initialize PHY chip, check for the auto-negotiation result. - * @param None - * @return None - */ -void EMAC_PhyInit(EMAC_T *EMAC) -{ - uint32_t reg; - uint32_t i = 0UL; - - /* Reset Phy Chip */ - EMAC_MdioWrite(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR, PHY_CNTL_RESET_PHY); - - /* Wait until reset complete */ - while (1) - { - reg = EMAC_MdioRead(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR) ; - - if ((reg & PHY_CNTL_RESET_PHY) == 0UL) - { - break; - } - } - - while (!(EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID)) - { - if (i++ > 10000UL) /* Cable not connected */ - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - break; - } - } - - if (i <= 10000UL) - { - /* Configure auto negotiation capability */ - EMAC_MdioWrite(EMAC, PHY_ANA_REG, EMAC_PHY_ADDR, PHY_ANA_DR100_TX_FULL | - PHY_ANA_DR100_TX_HALF | - PHY_ANA_DR10_TX_FULL | - PHY_ANA_DR10_TX_HALF | - PHY_ANA_IEEE_802_3_CSMA_CD); - /* Restart auto negotiation */ - EMAC_MdioWrite(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR, EMAC_MdioRead(EMAC, PHY_CNTL_REG, EMAC_PHY_ADDR) | PHY_CNTL_RESTART_AN); - - /* Wait for auto-negotiation complete */ - while (!(EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_AN_COMPLETE)) - { - ; - } - - /* Check link valid again. Some PHYs needs to check result after link valid bit set */ - while (!(EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID)) - { - ; - } - - /* Check link partner capability */ - reg = EMAC_MdioRead(EMAC, PHY_ANLPA_REG, EMAC_PHY_ADDR) ; - - if (reg & PHY_ANLPA_DR100_TX_FULL) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - } - else if (reg & PHY_ANLPA_DR100_TX_HALF) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - } - else if (reg & PHY_ANLPA_DR10_TX_FULL) - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - } - else - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - } - } -} - -/** - * @brief Initial EMAC Tx descriptors and get Tx descriptor base address - * @param EMAC_MEMMGR_T pointer - * @return None - */ -static void EMAC_TxDescInit(EMAC_MEMMGR_T *psMemMgr) -{ - uint32_t i; - - /* Get Frame descriptor's base address. */ - psMemMgr->psNextTxDesc = psMemMgr->psCurrentTxDesc = (EMAC_DESCRIPTOR_T *)((uint32_t)&psMemMgr->psTXDescs[0] | BIT31); - - for (i = 0UL; i < psMemMgr->u32TxDescSize; i++) - { - - if (s_u32EnableTs) - { - psMemMgr->psTXDescs[i].u32Status1 = EMAC_TXFD_PADEN | EMAC_TXFD_CRCAPP | EMAC_TXFD_INTEN; - } - else - { - psMemMgr->psTXDescs[i].u32Status1 = EMAC_TXFD_PADEN | EMAC_TXFD_CRCAPP | EMAC_TXFD_INTEN | EMAC_TXFD_TTSEN; - } - - psMemMgr->psTXDescs[i].u32Data = (uint32_t)& psMemMgr->psTXFrames[i] | BIT31; - psMemMgr->psTXDescs[i].u32Status2 = 0UL; - psMemMgr->psTXDescs[i].u32Next = (uint32_t)(&psMemMgr->psTXDescs[(i + 1UL) % EMAC_TX_DESC_SIZE]) | BIT31; - psMemMgr->psTXDescs[i].u32Backup1 = psMemMgr->psTXDescs[i].u32Data; - psMemMgr->psTXDescs[i].u32Backup2 = psMemMgr->psTXDescs[i].u32Next; - } - psMemMgr->psEmac->TXDSA = (uint32_t)psMemMgr->psCurrentTxDesc; -} - - -/** - * @brief Initial EMAC Rx descriptors and get Rx descriptor base address - * @param EMAC_MEMMGR_T pointer - * @return None - */ -static void EMAC_RxDescInit(EMAC_MEMMGR_T *psMemMgr) -{ - - uint32_t i; - - /* Get Frame descriptor's base address. */ - psMemMgr->psCurrentRxDesc = (EMAC_DESCRIPTOR_T *)((uint32_t)&psMemMgr->psRXDescs[0] | BIT31); - - for (i = 0UL; i < psMemMgr->u32RxDescSize; i++) - { - psMemMgr->psRXDescs[i].u32Status1 = EMAC_DESC_OWN_EMAC; - psMemMgr->psRXDescs[i].u32Data = (uint32_t)&psMemMgr->psRXFrames[i]; - psMemMgr->psRXDescs[i].u32Status2 = 0UL; - psMemMgr->psRXDescs[i].u32Next = (uint32_t)(&psMemMgr->psRXDescs[(i + 1UL) % EMAC_RX_DESC_SIZE]) | BIT31; - psMemMgr->psRXDescs[i].u32Backup1 = psMemMgr->psRXDescs[i].u32Data; - psMemMgr->psRXDescs[i].u32Backup2 = psMemMgr->psRXDescs[i].u32Next; - } - psMemMgr->psEmac->RXDSA = (uint32_t)psMemMgr->psCurrentRxDesc; -} - -/** - * @brief Convert subsecond value to nano second - * @param[in] subsec Subsecond value to be convert - * @return Nano second - */ -static uint32_t EMAC_Subsec2Nsec(uint32_t subsec) -{ - /* 2^31 subsec == 10^9 ns */ - uint64_t i; - i = 1000000000ull * (uint64_t)subsec; - i >>= 31; - return ((uint32_t)i); -} - -/** - * @brief Convert nano second to subsecond value - * @param[in] nsec Nano second to be convert - * @return Subsecond - */ -static uint32_t EMAC_Nsec2Subsec(uint32_t nsec) -{ - /* 10^9 ns = 2^31 subsec */ - uint64_t i; - i = (1ull << 31) * nsec; - i /= 1000000000ull; - return ((uint32_t)i); -} - - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - - - -/** @endcond HIDDEN_SYMBOLS */ - - -/** @addtogroup EMAC_EXPORTED_FUNCTIONS EMAC Exported Functions - @{ -*/ - - -/** - * @brief Initialize EMAC interface, including descriptors, MAC address, and PHY. - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - * @note This API configures EMAC to receive all broadcast and multicast packets, but could configure to other settings with - * \ref EMAC_ENABLE_RECV_BCASTPKT, \ref EMAC_DISABLE_RECV_BCASTPKT, \ref EMAC_ENABLE_RECV_MCASTPKT, and \ref EMAC_DISABLE_RECV_MCASTPKT - * @note Receive(RX) and transmit(TX) are not enabled yet, application must call \ref EMAC_ENABLE_RX and \ref EMAC_ENABLE_TX to - * enable receive and transmit function. - */ -void EMAC_Open(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8MacAddr) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Enable transmit and receive descriptor */ - EMAC_TxDescInit(psMemMgr); - EMAC_RxDescInit(psMemMgr); - - /* Set the CAM Control register and the MAC address value */ - EMAC_SetMacAddr(EMAC, pu8MacAddr); - - /* Configure the MAC interrupt enable register. */ - EMAC->INTEN = EMAC_INTEN_RXIEN_Msk | - EMAC_INTEN_TXIEN_Msk | - EMAC_INTEN_RXGDIEN_Msk | - EMAC_INTEN_TXCPIEN_Msk | - EMAC_INTEN_RXBEIEN_Msk | - EMAC_INTEN_TXBEIEN_Msk | - EMAC_INTEN_RDUIEN_Msk | - EMAC_INTEN_TSALMIEN_Msk | - EMAC_INTEN_WOLIEN_Msk; - - /* Configure the MAC control register. */ - EMAC->CTL = EMAC_CTL_STRIPCRC_Msk | - EMAC_CTL_RMIIEN_Msk; - - /* Accept packets for us and all broadcast and multicast packets */ - EMAC->CAMCTL = EMAC_CAMCTL_CMPEN_Msk | - EMAC_CAMCTL_AMP_Msk | - EMAC_CAMCTL_ABP_Msk; - - /* Limit the max receive frame length */ - EMAC->MRFL = EMAC_MAX_PKT_SIZE; -} - -/** - * @brief This function stop all receive and transmit activity and disable MAC interface - * @param None - * @return None - */ - -void EMAC_Close(EMAC_T *EMAC) -{ - EMAC->CTL |= EMAC_CTL_RST_Msk; - - while (EMAC->CTL & EMAC_CTL_RST_Msk) {} -} - -/** - * @brief Set the device MAC address - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - */ -void EMAC_SetMacAddr(EMAC_T *EMAC, uint8_t *pu8MacAddr) -{ - EMAC_EnableCamEntry(EMAC, 0UL, pu8MacAddr); -} - -/** - * @brief Fill a CAM entry for MAC address comparison. - * @param[in] u32Entry MAC entry to fill. Entry 0 is used to store device MAC address, do not overwrite the setting in it. - * @param[in] pu8MacAddr Pointer to uint8_t array holds MAC address - * @return None - */ -void EMAC_EnableCamEntry(EMAC_T *EMAC, uint32_t u32Entry, uint8_t pu8MacAddr[]) -{ - uint32_t u32Lsw, u32Msw; - uint32_t reg; - u32Lsw = (uint32_t)(((uint32_t)pu8MacAddr[4] << 24) | - ((uint32_t)pu8MacAddr[5] << 16)); - u32Msw = (uint32_t)(((uint32_t)pu8MacAddr[0] << 24) | - ((uint32_t)pu8MacAddr[1] << 16) | - ((uint32_t)pu8MacAddr[2] << 8) | - (uint32_t)pu8MacAddr[3]); - - reg = (uint32_t)&EMAC->CAM0M + u32Entry * 2UL * 4UL; - *(uint32_t volatile *)reg = u32Msw; - reg = (uint32_t)&EMAC->CAM0L + u32Entry * 2UL * 4UL; - *(uint32_t volatile *)reg = u32Lsw; - - EMAC->CAMEN |= (1UL << u32Entry); -} - -/** - * @brief Disable a specified CAM entry - * @param[in] u32Entry CAM entry to be disabled - * @return None - */ -void EMAC_DisableCamEntry(EMAC_T *EMAC, uint32_t u32Entry) -{ - EMAC->CAMEN &= ~(1UL << u32Entry); -} - - -/** - * @brief Receive an Ethernet packet - * @param[in] pu8Data Pointer to a buffer to store received packet (4 byte CRC removed) - * @param[in] pu32Size Received packet size (without 4 byte CRC). - * @return Packet receive success or not - * @retval 0 No packet available for receive - * @retval 1 A packet is received - * @note Return 0 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_RecvPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size) -{ - uint32_t reg; - uint32_t u32Count = 0UL; - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Clear Rx interrupt flags */ - reg = EMAC->INTSTS; - EMAC->INTSTS = reg & 0xFFFFUL; /* Clear all RX related interrupt status */ - - if (reg & EMAC_INTSTS_RXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - /* If we reach last recv Rx descriptor, leave the loop */ - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - uint32_t status = desc->u32Status1 >> 16; - - /* If Rx frame is good, process received frame */ - if (status & EMAC_RXFD_RXGD) - { - /* lower 16 bit in descriptor status1 stores the Rx packet length */ - *pu32Size = desc->u32Status1 & 0xFFFFUL; - memcpy(pu8Data, (uint8_t *)desc->u32Data, *pu32Size); - u32Count = 1UL; - } - else - { - /* Save Error status if necessary */ - if (status & EMAC_RXFD_RP) {} - - if (status & EMAC_RXFD_ALIE) {} - - if (status & EMAC_RXFD_PTLE) {} - - if (status & EMAC_RXFD_CRCE) {} - } - } - } - - return (u32Count); -} - -/** - * @brief Receive an Ethernet packet and the time stamp while it's received - * @param[out] pu8Data Pointer to a buffer to store received packet (4 byte CRC removed) - * @param[out] pu32Size Received packet size (without 4 byte CRC). - * @param[out] pu32Sec Second value while packet received - * @param[out] pu32Nsec Nano second value while packet received - * @return Packet receive success or not - * @retval 0 No packet available for receive - * @retval 1 A packet is received - * @note Return 0 doesn't guarantee the packet will be sent and received successfully. - * @note Largest Ethernet packet is 1514 bytes after stripped CRC, application must give - * a buffer large enough to store such packet - */ -uint32_t EMAC_RecvPktTS(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t *pu32Size, uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - uint32_t reg; - uint32_t u32Count = 0UL; - - /* Clear Rx interrupt flags */ - reg = EMAC->INTSTS; - EMAC->INTSTS = reg & 0xFFFFUL; /* Clear all Rx related interrupt status */ - - if (reg & EMAC_INTSTS_RXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - /* If we reach last recv Rx descriptor, leave the loop */ - if (EMAC->CRXDSA != (uint32_t)desc) - { - if ((desc->u32Status1 | EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - - uint32_t status = desc->u32Status1 >> 16; - - /* If Rx frame is good, process received frame */ - if (status & EMAC_RXFD_RXGD) - { - /* lower 16 bit in descriptor status1 stores the Rx packet length */ - *pu32Size = desc->u32Status1 & 0xFFFFUL; - memcpy(pu8Data, (uint8_t *)desc->u32Data, *pu32Size); - - *pu32Sec = desc->u32Next; /* second stores in descriptor's NEXT field */ - *pu32Nsec = EMAC_Subsec2Nsec(desc->u32Data); /* Sub nano second store in DATA field */ - - u32Count = 1UL; - } - else - { - /* Save Error status if necessary */ - if (status & EMAC_RXFD_RP) {} - - if (status & EMAC_RXFD_ALIE) {} - - if (status & EMAC_RXFD_PTLE) {} - - if (status & EMAC_RXFD_CRCE) {} - } - } - } - } - - return (u32Count); -} - -/** - * @brief Clean up process after a packet is received - * @param None - * @return None - * @details EMAC Rx interrupt service routine \b must call this API to release the resource use by receive process - * @note Application can only call this function once every time \ref EMAC_RecvPkt or \ref EMAC_RecvPktTS returns 1 - */ -void EMAC_RecvPktDone(EMAC_MEMMGR_T *psMemMgr) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - /* Restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - - /* Change ownership to DMA for next use */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get Next Frame Descriptor pointer to process */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Rx descriptor */ - psMemMgr->psCurrentRxDesc = desc; - - EMAC_TRIGGER_RX(EMAC); -} - - -/** - * @brief Send an Ethernet packet - * @param[in] pu8Data Pointer to a buffer holds the packet to transmit - * @param[in] u32Size Packet size (without 4 byte CRC). - * @return Packet transmit success or not - * @retval 0 Transmit failed due to descriptor unavailable. - * @retval 1 Packet is copied to descriptor and triggered to transmit. - * @note Return 1 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_SendPkt(EMAC_MEMMGR_T *psMemMgr, uint8_t *pu8Data, uint32_t u32Size) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Get Tx frame descriptor & data pointer */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psNextTxDesc; - uint32_t status = desc->u32Status1; - uint32_t ret = 0UL; - - /* Check descriptor ownership */ - if ((status & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - memcpy((uint8_t *)desc->u32Data, pu8Data, u32Size); - - /* Set Tx descriptor transmit byte count */ - desc->u32Status2 = u32Size; - - /* Change descriptor ownership to EMAC */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get next Tx descriptor */ - psMemMgr->psNextTxDesc = (EMAC_DESCRIPTOR_T *)(desc->u32Next); - - /* Trigger EMAC to send the packet */ - EMAC_TRIGGER_TX(EMAC); - ret = 1UL; - } - - return (ret); -} - - -/** - * @brief Clean up process after packet(s) are sent - * @param None - * @return Number of packet sent between two function calls - * @details EMAC Tx interrupt service routine \b must call this API or \ref EMAC_SendPktDoneTS to - * release the resource use by transmit process - */ -uint32_t EMAC_SendPktDone(EMAC_MEMMGR_T *psMemMgr) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - uint32_t status, reg; - uint32_t last_tx_desc; - uint32_t u32Count = 0UL; - - reg = EMAC->INTSTS; - /* Clear Tx interrupt flags */ - EMAC->INTSTS = reg & (0xFFFF0000UL & ~EMAC_INTSTS_TSALMIF_Msk); - - - if (reg & EMAC_INTSTS_TXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Get our first descriptor to process */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentTxDesc; - - /* Process the descriptor(s). */ - last_tx_desc = EMAC->CTXDSA ; - - do - { - /* Descriptor ownership is still EMAC, so this packet haven't been send. */ - if (desc->u32Status1 & EMAC_DESC_OWN_EMAC) - { - break; - } - - /* Get Tx status stored in descriptor */ - status = desc->u32Status2 >> 16UL; - - if (status & EMAC_TXFD_TXCP) - { - u32Count++; - } - else - { - /* Do nothing here on error. */ - if (status & EMAC_TXFD_TXABT) {} - - if (status & EMAC_TXFD_DEF) {} - - if (status & EMAC_TXFD_PAU) {} - - if (status & EMAC_TXFD_EXDEF) {} - - if (status & EMAC_TXFD_NCS) {} - - if (status & EMAC_TXFD_SQE) {} - - if (status & EMAC_TXFD_LC) {} - - if (status & EMAC_TXFD_TXHA) {} - } - - /* restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - /* go to next descriptor in link */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - } - while (last_tx_desc != (uint32_t)desc); /* If we reach last sent Tx descriptor, leave the loop */ - - /* Save last processed Tx descriptor */ - psMemMgr->psCurrentTxDesc = (EMAC_DESCRIPTOR_T *)desc; - } - - return (u32Count); -} - -/** - * @brief Clean up process after a packet is sent, and get the time stamp while packet is sent - * @param[in] pu32Sec Second value while packet sent - * @param[in] pu32Nsec Nano second value while packet sent - * @return If a packet sent successfully - * @retval 0 No packet sent successfully, and the value in *pu32Sec and *pu32Nsec are meaningless - * @retval 1 A packet sent successfully, and the value in *pu32Sec and *pu32Nsec is the time stamp while packet sent - * @details EMAC Tx interrupt service routine \b must call this API or \ref EMAC_SendPktDone to - * release the resource use by transmit process - */ -uint32_t EMAC_SendPktDoneTS(EMAC_MEMMGR_T *psMemMgr, uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - uint32_t reg; - uint32_t u32Count = 0UL; - - reg = EMAC->INTSTS; - /* Clear Tx interrupt flags */ - EMAC->INTSTS = reg & (0xFFFF0000UL & ~EMAC_INTSTS_TSALMIF_Msk); - - - if (reg & EMAC_INTSTS_TXBEIF_Msk) - { - /* Bus error occurred, this is usually a bad sign about software bug and will occur again... */ - while (1) {} - } - else - { - /* Process the descriptor. - Get our first descriptor to process */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentTxDesc; - - /* Descriptor ownership is still EMAC, so this packet haven't been send. */ - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - /* Get Tx status stored in descriptor */ - uint32_t status = desc->u32Status2 >> 16UL; - - if (status & EMAC_TXFD_TXCP) - { - u32Count = 1UL; - *pu32Sec = desc->u32Next; /* second stores in descriptor's NEXT field */ - *pu32Nsec = EMAC_Subsec2Nsec(desc->u32Data); /* Sub nano second store in DATA field */ - } - else - { - /* Do nothing here on error. */ - if (status & EMAC_TXFD_TXABT) {} - - if (status & EMAC_TXFD_DEF) {} - - if (status & EMAC_TXFD_PAU) {} - - if (status & EMAC_TXFD_EXDEF) {} - - if (status & EMAC_TXFD_NCS) {} - - if (status & EMAC_TXFD_SQE) {} - - if (status & EMAC_TXFD_LC) {} - - if (status & EMAC_TXFD_TXHA) {} - } - - /* restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - /* go to next descriptor in link */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Tx descriptor */ - psMemMgr->psCurrentTxDesc = desc; - } - } - - return (u32Count); -} - -/** - * @brief Enable IEEE1588 time stamp function and set current time - * @param[in] u32Sec Second value - * @param[in] u32Nsec Nano second value - * @return None - */ -void EMAC_EnableTS(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec) -{ -#if 0 - double f; - uint32_t reg; - EMAC->TSCTL = EMAC_TSCTL_TSEN_Msk; - EMAC->UPDSEC = u32Sec; /* Assume current time is 0 sec + 0 nano sec */ - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - - /* PTP source clock is 160MHz (Real chip using PLL). Each tick is 6.25ns - Assume we want to set each tick to 100ns. - Increase register = (100 * 2^31) / (10^9) = 214.71 =~ 215 = 0xD7 - Addend register = 2^32 * tick_freq / (160MHz), where tick_freq = (2^31 / 215) MHz - From above equation, addend register = 2^63 / (160M * 215) ~= 268121280 = 0xFFB34C0 - So: - EMAC->TSIR = 0xD7; - EMAC->TSAR = 0x1E70C600; */ - f = (100.0 * 2147483648.0) / (1000000000.0) + 0.5; - EMAC->TSINC = (reg = (uint32_t)f); - f = (double)9223372036854775808.0 / ((double)(CLK_GetHCLKFreq()) * (double)reg); - EMAC->TSADDEND = (uint32_t)f; - EMAC->TSCTL |= (EMAC_TSCTL_TSUPDATE_Msk | EMAC_TSCTL_TSIEN_Msk | EMAC_TSCTL_TSMODE_Msk); /* Fine update */ -#endif -} - -/** - * @brief Disable IEEE1588 time stamp function - * @param None - * @return None - */ -void EMAC_DisableTS(EMAC_T *EMAC) -{ -#if 0 - EMAC->TSCTL = 0UL; -#endif -} - -/** - * @brief Get current time stamp - * @param[out] pu32Sec Current second value - * @param[out] pu32Nsec Current nano second value - * @return None - */ -void EMAC_GetTime(EMAC_T *EMAC, uint32_t *pu32Sec, uint32_t *pu32Nsec) -{ - /* Must read TSLSR firstly. Hardware will preserve TSMSR value at the time TSLSR read. */ - *pu32Nsec = EMAC_Subsec2Nsec(EMAC->TSSUBSEC); - *pu32Sec = EMAC->TSSEC; -} - -/** - * @brief Set current time stamp - * @param[in] u32Sec Second value - * @param[in] u32Nsec Nano second value - * @return None - */ -void EMAC_SetTime(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec) -{ - /* Disable time stamp counter before update time value (clear EMAC_TSCTL_TSIEN_Msk) */ - EMAC->TSCTL = EMAC_TSCTL_TSEN_Msk; - EMAC->UPDSEC = u32Sec; - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - EMAC->TSCTL |= (EMAC_TSCTL_TSIEN_Msk | EMAC_TSCTL_TSMODE_Msk); - -} - -/** - * @brief Enable alarm function and set alarm time - * @param[in] u32Sec Second value to trigger alarm - * @param[in] u32Nsec Nano second value to trigger alarm - * @return None - */ -void EMAC_EnableAlarm(EMAC_T *EMAC, uint32_t u32Sec, uint32_t u32Nsec) -{ - - EMAC->ALMSEC = u32Sec; - EMAC->ALMSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - EMAC->TSCTL |= EMAC_TSCTL_TSALMEN_Msk; - -} - -/** - * @brief Disable alarm function - * @param None - * @return None - */ -void EMAC_DisableAlarm(EMAC_T *EMAC) -{ - - EMAC->TSCTL &= ~EMAC_TSCTL_TSALMEN_Msk; - -} - -/** - * @brief Add a offset to current time - * @param[in] u32Neg Offset is negative value (u32Neg == 1) or positive value (u32Neg == 0). - * @param[in] u32Sec Second value to add to current time - * @param[in] u32Nsec Nano second value to add to current time - * @return None - */ -void EMAC_UpdateTime(EMAC_T *EMAC, uint32_t u32Neg, uint32_t u32Sec, uint32_t u32Nsec) -{ - EMAC->UPDSEC = u32Sec; - EMAC->UPDSUBSEC = EMAC_Nsec2Subsec(u32Nsec); - - if (u32Neg) - { - EMAC->UPDSUBSEC |= BIT31; /* Set bit 31 indicates this is a negative value */ - } - - EMAC->TSCTL |= EMAC_TSCTL_TSUPDATE_Msk; - -} - -/** - * @brief Check Ethernet link status - * @param None - * @return Current link status, could be one of following value. - * - \ref EMAC_LINK_DOWN - * - \ref EMAC_LINK_100F - * - \ref EMAC_LINK_100H - * - \ref EMAC_LINK_10F - * - \ref EMAC_LINK_10H - * @note This API should be called regularly to sync EMAC setting with real connection status - */ -uint32_t EMAC_CheckLinkStatus(EMAC_T *EMAC) -{ - uint32_t reg, ret = EMAC_LINK_DOWN; - - /* Check link valid again */ - if (EMAC_MdioRead(EMAC, PHY_STATUS_REG, EMAC_PHY_ADDR) & PHY_STATUS_LINK_VALID) - { - /* Check link partner capability */ - reg = EMAC_MdioRead(EMAC, PHY_ANLPA_REG, EMAC_PHY_ADDR) ; - - if (reg & PHY_ANLPA_DR100_TX_FULL) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_100F; - } - else if (reg & PHY_ANLPA_DR100_TX_HALF) - { - EMAC->CTL |= EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_100H; - } - else if (reg & PHY_ANLPA_DR10_TX_FULL) - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL |= EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_10F; - } - else - { - EMAC->CTL &= ~EMAC_CTL_OPMODE_Msk; - EMAC->CTL &= ~EMAC_CTL_FUDUP_Msk; - ret = EMAC_LINK_10H; - } - } - - return ret; -} - -/** - * @brief Fill a MAC address to list and enable. - * @param A MAC address - * @return The CAM index - * @retval -1 Failed to fill the MAC address. - * @retval 0~(EMAC_CAMENTRY_NB-1) The index number of entry location. - */ -int32_t EMAC_FillCamEntry(EMAC_T *EMAC, uint8_t pu8MacAddr[]) -{ - uint32_t *EMAC_CAMxM; - uint32_t *EMAC_CAMxL; - int32_t index; - uint8_t mac[6]; - - for (index = 0; index < EMAC_CAMENTRY_NB; index ++) - { - EMAC_CAMxM = (uint32_t *)((uint32_t)&EMAC->CAM0M + (index * 8)); - EMAC_CAMxL = (uint32_t *)((uint32_t)&EMAC->CAM0L + (index * 8)); - - mac[0] = (*EMAC_CAMxM >> 24) & 0xff; - mac[1] = (*EMAC_CAMxM >> 16) & 0xff; - mac[2] = (*EMAC_CAMxM >> 8) & 0xff; - mac[3] = (*EMAC_CAMxM) & 0xff; - mac[4] = (*EMAC_CAMxL >> 24) & 0xff; - mac[5] = (*EMAC_CAMxL >> 16) & 0xff; - - if (memcmp(mac, pu8MacAddr, sizeof(mac)) == 0) - { - goto exit_emac_fillcamentry; - } - - if (*EMAC_CAMxM == 0 && *EMAC_CAMxL == 0) - { - break; - } - } - - if (index < EMAC_CAMENTRY_NB) - { - EMAC_EnableCamEntry(EMAC, index, pu8MacAddr); - goto exit_emac_fillcamentry; - } - - return -1; - -exit_emac_fillcamentry: - - return index; -} - -/** - * @brief Send an Ethernet packet - * @param[in] u32Size Packet size (without 4 byte CRC). - * @return Packet transmit success or not - * @retval 0 Transmit failed due to descriptor unavailable. - * @retval 1 Triggered to transmit. - * @note Return 1 doesn't guarantee the packet will be sent and received successfully. - */ -uint32_t EMAC_SendPktWoCopy(EMAC_MEMMGR_T *psMemMgr, uint32_t u32Size) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - /* Get Tx frame descriptor & data pointer */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psNextTxDesc; - uint32_t status = desc->u32Status1; - uint32_t ret = 0UL; - - /* Check descriptor ownership */ - if ((status & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) - { - /* Set Tx descriptor transmit byte count */ - desc->u32Status2 = u32Size; - - /* Change descriptor ownership to EMAC */ - desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get next Tx descriptor */ - psMemMgr->psNextTxDesc = (EMAC_DESCRIPTOR_T *)(desc->u32Next); - - /* Trigger EMAC to send the packet */ - EMAC_TRIGGER_TX(EMAC); - ret = 1UL; - } - - return (ret); -} - -/** - * @brief Get avaiable TX buffer address - * @param None - * @return An avaiable TX buffer. - * @note This API should be called before EMAC_SendPkt_WoCopy calling. Caller will do data-copy. - */ -uint8_t *EMAC_ClaimFreeTXBuf(EMAC_MEMMGR_T *psMemMgr) -{ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psNextTxDesc; - - if (desc->u32Status1 & EMAC_DESC_OWN_EMAC) - { - return (NULL); - } - else - { - return (uint8_t *)desc->u32Data; - } -} - -/** - * @brief Get data length of avaiable RX buffer. - * @param None - * @return An data length of avaiable RX buffer. - * @note This API should be called before EMAC_RecvPktDone_WoTrigger calling. Caller will do data-copy. - */ -uint32_t EMAC_GetAvailRXBufSize(EMAC_MEMMGR_T *psMemMgr, uint8_t **ppuDataBuf) -{ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - - if ((desc->u32Status1 & EMAC_DESC_OWN_EMAC) != EMAC_DESC_OWN_EMAC) /* ownership=CPU */ - { - uint32_t status = desc->u32Status1 >> 16; - - /* It is good and no CRC error. */ - if ((status & EMAC_RXFD_RXGD) && !(status & EMAC_RXFD_CRCE)) - { - *ppuDataBuf = (uint8_t *)desc->u32Data; - return desc->u32Status1 & 0xFFFFUL; - } - else - { - // Drop it - EMAC_RecvPktDone(psMemMgr); - } - } - - return 0; -} - - -/** - * @brief Clean up process after a packet is received. - * @param None - * @return None - * @details Caller must call the function to release the resource. - * @note Application can only call this function once every time \ref EMAC_RecvPkt or \ref EMAC_RecvPktTS returns 1 - * @note This function is without doing EMAC_TRIGGER_RX. - */ -EMAC_DESCRIPTOR_T *EMAC_RecvPktDoneWoRxTrigger(EMAC_MEMMGR_T *psMemMgr) -{ - /* Get Rx Frame Descriptor */ - EMAC_DESCRIPTOR_T *desc = (EMAC_DESCRIPTOR_T *)psMemMgr->psCurrentRxDesc; - EMAC_DESCRIPTOR_T *ret = desc; - - /* Restore descriptor link list and data pointer they will be overwrite if time stamp enabled */ - desc->u32Data = desc->u32Backup1; - desc->u32Next = desc->u32Backup2; - - /* Change ownership to DMA for next use */ - // desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Get Next Frame Descriptor pointer to process */ - desc = (EMAC_DESCRIPTOR_T *)desc->u32Next; - - /* Save last processed Rx descriptor */ - psMemMgr->psCurrentRxDesc = desc; - - return ret; -} - -void EMAC_RxTrigger(EMAC_MEMMGR_T *psMemMgr, EMAC_DESCRIPTOR_T *rx_desc) -{ - EMAC_T *EMAC = psMemMgr->psEmac; - - rx_desc->u32Status1 |= EMAC_DESC_OWN_EMAC; - - /* Trigger EMAC to send the packet */ - EMAC_TRIGGER_RX(EMAC); -} - -/*@}*/ /* end of group EMAC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group EMAC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_etimer.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_etimer.c deleted file mode 100644 index 41d927c122a..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_etimer.c +++ /dev/null @@ -1,490 +0,0 @@ -/**************************************************************************//** - * @file etimer.c - * @brief ETIMER driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nuc980.h" -#include "nu_sys.h" - -/// @cond HIDDEN_SYMBOLS - -/** - * @brief This API is used to get the clock frequency of Timer - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return Timer clock frequency - * @note This API cannot return correct clock rate if timer source is external clock input. - */ -UINT ETIMER_GetModuleClock(UINT timer) -{ - UINT src; - - src = (inpw(REG_CLK_DIVCTL8) >> (16 + timer * 2)) & 0x3; - - if (src == 0) - return 12000000; - else if (src == 1) - return (sysGetClock(SYS_PCLK01) * 1000000); - else if (src == 2) - return (sysGetClock(SYS_PCLK01) * 1000000 / 4096); - else - return 32768; - -} - -/// @endcond /* HIDDEN_SYMBOLS */ - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup ETIMER_Driver ETIMER Driver - @{ -*/ - - -/** @addtogroup ETIMER_EXPORTED_FUNCTIONS ETIMER Exported Functions - @{ -*/ - -/** - * @brief This API is used to configure timer to operate in specified mode - * and frequency. If timer cannot work in target frequency, a closest - * frequency will be chose and returned. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @param[in] u32Mode Operation mode. Possible options are - * - \ref ETIMER_ONESHOT_MODE - * - \ref ETIMER_PERIODIC_MODE - * - \ref ETIMER_TOGGLE_MODE - * - \ref ETIMER_CONTINUOUS_MODE - * @param[in] u32Freq Target working frequency - * @return Real Timer working frequency - * @note After calling this API, Timer is \b NOT running yet. But could start timer running be calling - * \ref ETIMER_Start macro or program registers directly - */ -UINT ETIMER_Open(UINT timer, UINT u32Mode, UINT u32Freq) -{ - UINT u32Clk = ETIMER_GetModuleClock(timer); - UINT u32Cmpr = 0, u32Prescale = 0; - - // Fastest possible timer working freq is u32Clk / 2. While cmpr = 2, pre-scale = 0 - if (u32Freq > (u32Clk / 2)) - { - u32Cmpr = 2; - } - else - { - if (u32Clk >= 0x8000000) - { - u32Prescale = 15; // real prescaler value is 16 - u32Clk >>= 4; - } - else if (u32Clk >= 0x4000000) - { - u32Prescale = 7; // real prescaler value is 8 - u32Clk >>= 3; - } - else if (u32Clk >= 0x2000000) - { - u32Prescale = 3; // real prescaler value is 4 - u32Clk >>= 2; - } - else if (u32Clk >= 0x1000000) - { - u32Prescale = 1; // real prescaler value is 2 - u32Clk >>= 1; - } - u32Cmpr = u32Clk / u32Freq; - } - - if (timer == 0) - { - outpw(REG_ETMR0_CMPR, u32Cmpr); - outpw(REG_ETMR0_PRECNT, u32Prescale); - outpw(REG_ETMR0_CTL, 1 | u32Mode); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CMPR, u32Cmpr); - outpw(REG_ETMR1_PRECNT, u32Prescale); - outpw(REG_ETMR1_CTL, 1 | u32Mode); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CMPR, u32Cmpr); - outpw(REG_ETMR2_PRECNT, u32Prescale); - outpw(REG_ETMR2_CTL, 1 | u32Mode); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CMPR, u32Cmpr); - outpw(REG_ETMR3_PRECNT, u32Prescale); - outpw(REG_ETMR3_CTL, 1 | u32Mode); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CMPR, u32Cmpr); - outpw(REG_ETMR4_PRECNT, u32Prescale); - outpw(REG_ETMR4_CTL, 1 | u32Mode); - } - else - { - outpw(REG_ETMR5_CMPR, u32Cmpr); - outpw(REG_ETMR5_PRECNT, u32Prescale); - outpw(REG_ETMR5_CTL, 1 | u32Mode); - } - - return (u32Clk / (u32Cmpr * (u32Prescale + 1))); -} - -/** - * @brief This API stops Timer counting and disable the Timer interrupt function - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -void ETIMER_Close(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, 0); - outpw(REG_ETMR0_IER, 0); - outpw(REG_ETMR0_DR, 0); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, 0); - outpw(REG_ETMR1_IER, 0); - outpw(REG_ETMR1_DR, 0); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, 0); - outpw(REG_ETMR2_IER, 0); - outpw(REG_ETMR2_DR, 0); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, 0); - outpw(REG_ETMR3_IER, 0); - outpw(REG_ETMR3_DR, 0); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, 0); - outpw(REG_ETMR4_IER, 0); - outpw(REG_ETMR4_DR, 0); - } - else - { - outpw(REG_ETMR5_CTL, 0); - outpw(REG_ETMR5_IER, 0); - outpw(REG_ETMR5_DR, 0); - } -} - -/** - * @brief This API is used to create a delay loop for u32usec micro seconds - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @param[in] u32Usec Delay period in micro seconds with 10 usec every step. Valid values are between 10~1000000 (10 micro second ~ 1 second) - * @return None - * @note This API overwrites the register setting of the timer used to count the delay time. - * @note This API use polling mode. So there is no need to enable interrupt for the timer module used to generate delay - */ -void ETIMER_Delay(UINT timer, UINT u32Usec) -{ - UINT u32Clk = ETIMER_GetModuleClock(timer); - UINT u32Prescale = 0, delay = 300000000 / u32Clk; - float fCmpr; - - // Clear current timer configuration - if (timer == 0) - { - outpw(REG_ETMR0_CTL, 0); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, 0); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, 0); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, 0); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, 0); - } - else - { - outpw(REG_ETMR5_CTL, 0); - } - - if (u32Clk == 10000) // min delay is 100us if timer clock source is LIRC 10k - { - u32Usec = ((u32Usec + 99) / 100) * 100; - } - else // 10 usec every step - { - u32Usec = ((u32Usec + 9) / 10) * 10; - } - - if (u32Clk >= 0x4000000) - { - u32Prescale = 7; // real prescaler value is 8 - u32Clk >>= 3; - } - else if (u32Clk >= 0x2000000) - { - u32Prescale = 3; // real prescaler value is 4 - u32Clk >>= 2; - } - else if (u32Clk >= 0x1000000) - { - u32Prescale = 1; // real prescaler value is 2 - u32Clk >>= 1; - } - - // u32Usec * u32Clk might overflow if using UINT - fCmpr = ((float)u32Usec * (float)u32Clk) / 1000000.0; - - if (timer == 0) - { - outpw(REG_ETMR0_CMPR, (UINT)fCmpr); - outpw(REG_ETMR0_PRECNT, u32Prescale); - outpw(REG_ETMR0_CTL, 1); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CMPR, (UINT)fCmpr); - outpw(REG_ETMR1_PRECNT, u32Prescale); - outpw(REG_ETMR1_CTL, 1); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CMPR, (UINT)fCmpr); - outpw(REG_ETMR2_PRECNT, u32Prescale); - outpw(REG_ETMR2_CTL, 1); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CMPR, (UINT)fCmpr); - outpw(REG_ETMR3_PRECNT, u32Prescale); - outpw(REG_ETMR3_CTL, 1); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CMPR, (UINT)fCmpr); - outpw(REG_ETMR4_PRECNT, u32Prescale); - outpw(REG_ETMR4_CTL, 1); - } - else - { - outpw(REG_ETMR5_CMPR, (UINT)fCmpr); - outpw(REG_ETMR5_PRECNT, u32Prescale); - outpw(REG_ETMR5_CTL, 1); - } - - // When system clock is faster than timer clock, it is possible timer active bit cannot set in time while we check it. - // And the while loop below return immediately, so put a tiny delay here allowing timer start counting and raise active flag. - for (; delay > 0; delay--) - { -#if defined (__GNUC__) && !(__CC_ARM) - __asm__ __volatile__ - ( - "nop \n" - ); -#else - __asm - { - NOP - } -#endif - } - - if (timer == 0) - { - while (inpw(REG_ETMR0_CTL) & 0x80); - } - else if (timer == 1) - { - while (inpw(REG_ETMR1_CTL) & 0x80); - } - else if (timer == 2) - { - while (inpw(REG_ETMR2_CTL) & 0x80); - } - else if (timer == 3) - { - while (inpw(REG_ETMR3_CTL) & 0x80); - } - else if (timer == 4) - { - while (inpw(REG_ETMR4_CTL) & 0x80); - } - else - { - while (inpw(REG_ETMR5_CTL) & 0x80); - } -} - -/** - * @brief This API is used to enable timer capture function with specified mode and capture edge - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @param[in] u32CapMode Timer capture mode. Could be - * - \ref ETIMER_CAPTURE_FREE_COUNTING_MODE - * - \ref ETIMER_CAPTURE_TRIGGER_COUNTING_MODE - * - \ref ETIMER_CAPTURE_COUNTER_RESET_MODE - * @param[in] u32Edge Timer capture edge. Possible values are - * - \ref ETIMER_CAPTURE_FALLING_EDGE - * - \ref ETIMER_CAPTURE_RISING_EDGE - * - \ref ETIMER_CAPTURE_FALLING_THEN_RISING_EDGE - * - \ref ETIMER_CAPTURE_RISING_THEN_FALLING_EDGE - * @return None - * @note Timer frequency should be configured separately by using \ref ETIMER_Open API, or program registers directly - */ -void ETIMER_EnableCapture(UINT timer, UINT u32CapMode, UINT u32Edge) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, (inpw(REG_ETMR0_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, (inpw(REG_ETMR1_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, (inpw(REG_ETMR2_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, (inpw(REG_ETMR3_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, (inpw(REG_ETMR4_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } - else - { - outpw(REG_ETMR5_CTL, (inpw(REG_ETMR5_CTL) & ~0x1E0000) | u32CapMode | u32Edge | 0x10000); - } -} - -/** - * @brief This API is used to disable the Timer capture function - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -void ETIMER_DisableCapture(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~0x10000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~0x10000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~0x10000); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~0x10000); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) & ~0x10000); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) & ~0x10000); - } - -} - -/** - * @brief This function is used to enable the Timer counter function with specify detection edge - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @param[in] u32Edge Detection edge of counter pin. Could be ether - * - \ref TIMER_COUNTER_RISING_EDGE, or - * - \ref TIMER_COUNTER_FALLING_EDGE - * @return None - * @note Timer compare value should be configured separately by using \ref ETIMER_SET_CMP_VALUE macro or program registers directly - */ -void ETIMER_EnableEventCounter(UINT timer, uint32_t u32Edge) -{ - - if (timer == 0) - { - outpw(REG_ETMR0_CTL, (inpw(REG_ETMR0_CTL) & ~0x2000) | u32Edge | 0x1000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, (inpw(REG_ETMR1_CTL) & ~0x2000) | u32Edge | 0x1000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, (inpw(REG_ETMR2_CTL) & ~0x2000) | u32Edge | 0x1000); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, (inpw(REG_ETMR3_CTL) & ~0x2000) | u32Edge | 0x1000); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, (inpw(REG_ETMR4_CTL) & ~0x2000) | u32Edge | 0x1000); - } - else - { - outpw(REG_ETMR5_CTL, (inpw(REG_ETMR5_CTL) & ~0x2000) | u32Edge | 0x1000); - } - -} - -/** - * @brief This API is used to disable the Timer event counter function. - * @param[in] timer ETIMER number. Range from 0 ~ 5 - * @return None - */ -void ETIMER_DisableEventCounter(UINT timer) -{ - if (timer == 0) - { - outpw(REG_ETMR0_CTL, inpw(REG_ETMR0_CTL) & ~0x1000); - } - else if (timer == 1) - { - outpw(REG_ETMR1_CTL, inpw(REG_ETMR1_CTL) & ~0x1000); - } - else if (timer == 2) - { - outpw(REG_ETMR2_CTL, inpw(REG_ETMR2_CTL) & ~0x1000); - } - else if (timer == 3) - { - outpw(REG_ETMR3_CTL, inpw(REG_ETMR3_CTL) & ~0x1000); - } - else if (timer == 4) - { - outpw(REG_ETMR4_CTL, inpw(REG_ETMR4_CTL) & ~0x1000); - } - else - { - outpw(REG_ETMR5_CTL, inpw(REG_ETMR5_CTL) & ~0x1000); - } -} - - -/*@}*/ /* end of group ETIMER_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group ETIMER_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_gpio.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_gpio.c deleted file mode 100644 index 745c37595c8..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_gpio.c +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************//** - * @file gpio.c - * @brief GPIO driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "nuc980.h" -#include "nu_gpio.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup GPIO_Driver GPIO Driver - @{ -*/ - -/** @addtogroup GPIO_EXPORTED_FUNCTIONS GPIO Exported Functions - @{ -*/ - -/** - * @brief Set GPIO operation mode - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * It could be BIT0 ~ BIT15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be BIT0 ~ BIT13 for PE GPIO port. - * It could be BIT0 ~ BIT11 for PG GPIO port. - * @param[in] u32Mode Operation mode. It could be \n - * GPIO_MODE_INPUT, GPIO_MODE_OUTPUT, GPIO_MODE_OPEN_DRAIN. - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if ((u32PinMask & (1ul << i)) == (1ul << i)) - { - port->MODE = (port->MODE & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Enable GPIO interrupt - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * @param[in] u32IntAttribs The interrupt attribute of specified GPIO pin. It could be \n - * GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. - * - * @return None - * - * @details This function is used to enable specified GPIO pin interrupt. - */ -void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs) -{ - port->INTTYPE |= (((u32IntAttribs >> 24) & 0xFFUL) << u32Pin); - port->INTEN |= ((u32IntAttribs & 0xFFFFFFUL) << u32Pin); -} - - -/** - * @brief Disable GPIO interrupt - * - * @param[in] port GPIO port. It could be It could be PA, PB, PC, PD, PE, PF, PG or PH. - * @param[in] u32Pin The pin of specified GPIO port. - * It could be 0 ~ 15 for PA, PB, PC, PD, PF and PH GPIO port. - * It could be 0 ~ 13 for PE GPIO port. - * It could be 0 ~ 11 for PG GPIO port. - * - * @return None - * - * @details This function is used to disable specified GPIO pin interrupt. - */ -void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin) -{ - port->INTTYPE &= ~(1UL << u32Pin); - port->INTEN &= ~((0x00010001UL) << u32Pin); -} - -/** - * @brief Set GPIO slew rate control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref PG - * @param[in] u32PinMask The single or multiple pins of specified GPIO port. - * @param[in] u32Mode Slew rate mode. \ref GPIO_SLEWCTL_NORMAL (maximum 40 MHz at 2.7V) - * \ref GPIO_SLEWCTL_HIGH (maximum 80 MHz at 2.7V) - * \ref GPIO_SLEWCTL_FAST (maximum 100 MHz at 2.7V) - * - * @return None - * - * @details This function is used to set specified GPIO operation mode. - */ -void GPIO_SetSlewCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if (u32PinMask & (1ul << i)) - { - port->SLEWCTL = (port->SLEWCTL & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - -/** - * @brief Set GPIO Pull-up and Pull-down control - * - * @param[in] port GPIO port. It could be \ref PA, \ref PB, ... or \ref PG - * @param[in] u32PinMask The pin of specified GPIO port. It could be 0 ~ 15. - * @param[in] u32Mode The pin mode of specified GPIO pin. It could be - * \ref GPIO_PUSEL_DISABLE - * \ref GPIO_PUSEL_PULL_UP - * \ref GPIO_PUSEL_PULL_DOWN - * - * @return None - * - * @details Set the pin mode of specified GPIO pin. - */ -void GPIO_SetPullCtl(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) -{ - uint32_t i; - - for (i = 0ul; i < GPIO_PIN_MAX; i++) - { - if (u32PinMask & (1ul << i)) - { - port->PUSEL = (port->PUSEL & ~(0x3ul << (i << 1))) | (u32Mode << (i << 1)); - } - } -} - - -/*@}*/ /* end of group GPIO_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group GPIO_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2c.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2c.c deleted file mode 100644 index 0b71907ebb3..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2c.c +++ /dev/null @@ -1,1243 +0,0 @@ -/**************************************************************************//** - * @file i2c.c - * @version V3.00 - * @brief NUC980 series I2C driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include "nu_i2c.h" -#include "nu_sys.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2C_Driver I2C Driver - @{ -*/ - - -/** @addtogroup I2C_EXPORTED_FUNCTIONS I2C Exported Functions - @{ -*/ - -/** - * @brief Enable specify I2C Controller and set Clock Divider - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C bus clock in Hz - * - * @return Actual I2C bus clock frequency - * - * @details The function enable the specify I2C Controller and set proper Clock Divider - * in I2C CLOCK DIVIDED REGISTER (I2CLK) according to the target I2C Bus clock. - * I2C Bus clock = PCLK / (4*(divider+1). - * - */ -uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - u32Pclk = (sysGetClock(SYS_PCLK01)) * 1000000; - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - /* Enable I2C */ - i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Disable specify I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Reset I2C Controller and disable specify I2C port. - * - */ - -void I2C_Close(I2C_T *i2c) -{ - /* Reset I2C Controller */ - if ((uint32_t)i2c == I2C0_BA) - { - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) | (0x1 << 0)); - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) & ~(0x1 << 0)); - } - else if ((uint32_t)i2c == I2C1_BA) - { - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) | (0x1 << 1)); - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) & ~(0x1 << 1)); - } - else if ((uint32_t)i2c == I2C2_BA) - { - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) | (0x1 << 2)); - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) & ~(0x1 << 2)); - } - else if ((uint32_t)i2c == I2C3_BA) - { - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) | (0x1 << 3)); - outp32(REG_SYS_APBIPRST1, inpw(REG_SYS_APBIPRST1) & ~(0x1 << 3)); - } - - - /* Disable I2C */ - i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; -} - -/** - * @brief Clear Time-out Counter flag - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details When Time-out flag will be set, use this function to clear I2C Bus Time-out counter flag . - * - */ -void I2C_ClearTimeoutFlag(I2C_T *i2c) -{ - i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; -} - -/** - * @brief Set Control bit of I2C Controller - * - * @param[in] i2c Specify I2C port - * @param[in] u8Start Set I2C START condition - * @param[in] u8Stop Set I2C STOP condition - * @param[in] u8Si Clear SI flag - * @param[in] u8Ack Set I2C ACK bit - * - * @return None - * - * @details The function set I2C Control bit of I2C Bus protocol. - * - */ -void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) -{ - uint32_t u32Reg = 0U; - - if (u8Start) - { - u32Reg |= I2C_CTL_STA; - } - - if (u8Stop) - { - u32Reg |= I2C_CTL_STO; - } - - if (u8Si) - { - u32Reg |= I2C_CTL_SI; - } - - if (u8Ack) - { - u32Reg |= I2C_CTL_AA; - } - - i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; -} - -/** - * @brief Disable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for disable I2C interrupt - * - */ -void I2C_DisableInt(I2C_T *i2c) -{ - i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Enable Interrupt of I2C Controller - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details The function is used for enable I2C interrupt - * - */ -void I2C_EnableInt(I2C_T *i2c) -{ - i2c->CTL0 |= I2C_CTL0_INTEN_Msk; -} - -/** - * @brief Get I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * - * @return The actual I2C Bus clock in Hz - * - * @details To get the actual I2C Bus Clock frequency. - */ -uint32_t I2C_GetBusClockFreq(I2C_T *i2c) -{ - uint32_t u32Divider = i2c->CLKDIV; - uint32_t u32Pclk; - - u32Pclk = (sysGetClock(SYS_PCLK01)) * 1000000; - - return (u32Pclk / ((u32Divider + 1U) << 2U)); -} - -/** - * @brief Set I2C Bus Clock - * - * @param[in] i2c Specify I2C port - * @param[in] u32BusClock The target I2C Bus Clock in Hz - * - * @return The actual I2C Bus Clock in Hz - * - * @details To set the actual I2C Bus Clock frequency. - */ -uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) -{ - uint32_t u32Div; - uint32_t u32Pclk; - - u32Pclk = (sysGetClock(SYS_PCLK01)) * 1000000; - - u32Div = (uint32_t)(((u32Pclk * 10U) / (u32BusClock * 4U) + 5U) / 10U - 1U); /* Compute proper divider for I2C clock */ - i2c->CLKDIV = u32Div; - - return (u32Pclk / ((u32Div + 1U) << 2U)); -} - -/** - * @brief Get Interrupt Flag - * - * @param[in] i2c Specify I2C port - * - * @return I2C interrupt flag status - * - * @details To get I2C Bus interrupt flag. - */ -uint32_t I2C_GetIntFlag(I2C_T *i2c) -{ - uint32_t u32Value; - - if ((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk) - { - u32Value = 1U; - } - else - { - u32Value = 0U; - } - - return u32Value; -} - -/** - * @brief Get I2C Bus Status Code - * - * @param[in] i2c Specify I2C port - * - * @return I2C Status Code - * - * @details To get I2C Bus Status Code. - */ -uint32_t I2C_GetStatus(I2C_T *i2c) -{ - return (i2c->STATUS0); -} - -/** - * @brief Read a Byte from I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return I2C Data - * - * @details To read a bytes data from specify I2C port. - */ -uint8_t I2C_GetData(I2C_T *i2c) -{ - return (uint8_t)(i2c->DAT); -} - -/** - * @brief Send a byte to I2C Bus - * - * @param[in] i2c Specify I2C port - * @param[in] u8Data The data to send to I2C bus - * - * @return None - * - * @details This function is used to write a byte to specified I2C port - */ -void I2C_SetData(I2C_T *i2c, uint8_t u8Data) -{ - i2c->DAT = u8Data; -} - -/** - * @brief Set 7-bit Slave Address and GC Mode - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address register (0~3) - * @param[in] u8SlaveAddr 7-bit slave address - * @param[in] u8GCMode Enable/Disable GC mode (I2C_GCMODE_ENABLE / I2C_GCMODE_DISABLE) - * - * @return None - * - * @details This function is used to set 7-bit slave addresses in I2C SLAVE ADDRESS REGISTER (I2CADDR0~3) - * and enable GC Mode. - * - */ -void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDR1 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 2: - i2c->ADDR2 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 3: - i2c->ADDR3 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - case 0: - default: - i2c->ADDR0 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; - break; - } -} - -/** - * @brief Configure the mask bits of 7-bit Slave Address - * - * @param[in] i2c Specify I2C port - * @param[in] u8SlaveNo Set the number of I2C address mask register (0~3) - * @param[in] u8SlaveAddrMask A byte for slave address mask - * - * @return None - * - * @details This function is used to set 7-bit slave addresses. - * - */ -void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) -{ - switch (u8SlaveNo) - { - case 1: - i2c->ADDRMSK1 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 2: - i2c->ADDRMSK2 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 3: - i2c->ADDRMSK3 = (uint32_t)u8SlaveAddrMask << 1U; - break; - case 0: - default: - i2c->ADDRMSK0 = (uint32_t)u8SlaveAddrMask << 1U; - break; - } -} - -/** - * @brief Enable Time-out Counter Function and support Long Time-out - * - * @param[in] i2c Specify I2C port - * @param[in] u8LongTimeout Configure DIV4 to enable Long Time-out (0/1) - * - * @return None - * - * @details This function enable Time-out Counter function and configure DIV4 to support Long - * Time-out. - * - */ -void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) -{ - if (u8LongTimeout) - { - i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; - } - else - { - i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; - } - - i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Disable Time-out Counter Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Time-out Counter function in I2CTOC register. - * - */ -void I2C_DisableTimeout(I2C_T *i2c) -{ - i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; -} - -/** - * @brief Enable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To enable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_EnableWakeup(I2C_T *i2c) -{ - i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Disable I2C Wake-up Function - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details To disable Wake-up function of I2C Wake-up control register. - * - */ -void I2C_DisableWakeup(I2C_T *i2c) -{ - i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; -} - -/** - * @brief Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master write a byte data to Slave. - * - */ - -uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - - I2C_START(i2c); - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - -/** - * @brief Write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master write multi bytes data to Slave. - * - */ - -uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - case 0x28u: - if (u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify a byte register address and write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] data A byte data to write it to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify a address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Send Slave address with write bit */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u32txLen < 1u) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify a byte register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 byte) of data write to - * @param[in] *data Pointer to array to write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data bytes write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u32txLen < u32wLen) - { - I2C_SET_DATA(i2c, data[u32txLen++]); - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Specify two bytes register address and Write a byte to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 byte) of data write to - * @param[in] data Write a byte data to Slave - * - * @retval 0 Write data success - * @retval 1 Write data fail, or bus occurs error events - * - * @details The function is used for I2C Master specify two bytes address that data write to in Slave. - * - */ - -uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if ((u32txLen < 1u) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data); - u32txLen++; - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return (u8Err | u8Xfering); /* return (Success)/(Fail) status */ -} - - -/** - * @brief Specify two bytes register address and write multi bytes to Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data write to - * @param[in] data[] A data array for write data to Slave - * @param[in] u32wLen How many bytes need to write to Slave - * - * @return A length of how many bytes have been transmitted. - * - * @details The function is used for I2C Master specify a byte address that multi data write to in Slave. - * - */ - -uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32txLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else if ((u32txLen < u32wLen) && (u8Addr == 0u)) - { - I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ - } - else - { - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - } - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32txLen; /* Return bytes length that have been transmitted */ -} - -/** - * @brief Read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master to read a byte data from Slave. - * - */ -uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - - -/** - * @brief Read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master to read multi data bytes from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - - -/** - * @brief Specify a byte register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address(1 byte) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify a byte address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify a byte register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u8DataAddr Specify a address (1 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify a byte address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - u8Ctrl = I2C_CTL_STA_SI; /* Send repeat START */ - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief Specify two bytes register address and read a byte from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify an address(2 bytes) of data read from - * - * @return Read a byte data from Slave - * - * @details The function is used for I2C Master specify two bytes address that a data byte read from Slave. - * - * - */ -uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, rdata = 0u, u8Addr = 1u, u8Ctrl = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x58u: - rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - if (u8Err) - { - rdata = 0u; /* If occurs error, return 0 */ - } - return rdata; /* Return read data */ -} - -/** - * @brief Specify two bytes register address and read multi bytes from Slave - * - * @param[in] *i2c Point to I2C peripheral - * @param[in] u8SlaveAddr Access Slave address(7-bit) - * @param[in] u16DataAddr Specify a address (2 bytes) of data read from - * @param[out] rdata[] A data array to store data from Slave - * @param[in] u32rLen How many bytes need to read from Slave - * - * @return A length of how many bytes have been received - * - * @details The function is used for I2C Master specify two bytes address that multi data bytes read from Slave. - * - * - */ -uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen) -{ - uint8_t u8Xfering = 1u, u8Err = 0u, u8Addr = 1u, u8Ctrl = 0u; - uint32_t u32rxLen = 0u; - - I2C_START(i2c); /* Send START */ - while (u8Xfering && (u8Err == 0u)) - { - I2C_WAIT_READY(i2c) {} - switch (I2C_GET_STATUS(i2c)) - { - case 0x08u: - I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x18u: /* Slave Address ACK */ - I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of register */ - break; - case 0x20u: /* Slave Address NACK */ - case 0x30u: /* Master transmit data NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x28u: - if (u8Addr) - { - I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ - u8Addr = 0u; - } - else - { - u8Ctrl = I2C_CTL_STA_SI; /* Clear SI and send repeat START */ - } - break; - case 0x10u: - I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - break; - case 0x40u: /* Slave Address ACK */ - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - break; - case 0x48u: /* Slave Address NACK */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - case 0x50u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - if (u32rxLen < (u32rLen - 1u)) - { - u8Ctrl = I2C_CTL_SI_AA; /* Clear SI and set ACK */ - } - else - { - u8Ctrl = I2C_CTL_SI; /* Clear SI */ - } - break; - case 0x58u: - rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Xfering = 0u; - break; - case 0x38u: /* Arbitration Lost */ - default: /* Unknow status */ - u8Ctrl = I2C_CTL_STO_SI; /* Clear SI and send STOP */ - u8Err = 1u; - break; - } - I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ - } - return u32rxLen; /* Return bytes length that have been received */ -} - -/** - * @brief The macro is used to set STOP condition of I2C Bus - * - * @param[in] i2c Specify I2C port - * - * @return None - * - * @details Set the I2C bus STOP condition in I2C_CTL register. - */ -void I2C_STOP(I2C_T *i2c) -{ - - (i2c)->CTL0 |= (I2C_CTL0_SI_Msk | I2C_CTL0_STO_Msk); - while (i2c->CTL0 & I2C_CTL0_STO_Msk) - { - } -} - -/*@}*/ /* end of group I2C_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2C_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2s.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2s.c deleted file mode 100644 index 82702b214d9..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_i2s.c +++ /dev/null @@ -1,463 +0,0 @@ -/**************************************************************************//** -* @file i2s.c -* @version V1.00 -* $Revision: 4 $ -* $Date: 18/08/05 2:12p $ -* @brief I2S driver source file -* -* @note - * SPDX-License-Identifier: Apache-2.0 -* Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include - -#include "nuc980.h" -#include "nu_sys.h" -#include "nu_i2s.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup I2S_Driver I2S Driver - @{ -*/ - -/** @addtogroup I2S_EXPORTED_CONSTANTS I2S Exported Constants - @{ -*/ - -/// @cond HIDDEN_SYMBOLS - -typedef uint32_t (AU_CB_FUNC_T)(uint32_t); - -static AU_CB_FUNC_T *g_fnPlayCallBack; -static AU_CB_FUNC_T *g_fnRecCallBack; -static uint8_t i2sOpened = 0; - -/// @endcond /* HIDDEN_SYMBOLS */ - -/*@}*/ /* end of group ARM9_I2S_EXPORTED_CONSTANTS */ - -/** @addtogroup ARM9_I2S_EXPORTED_FUNCTIONS I2S Exported Functions - @{ -*/ - -/// @cond HIDDEN_SYMBOLS -/** - * @brief Start to play - * @param None - * @return None - */ -static void i2sStartPlay(void) -{ - /* start playing */ - printf("IIS start playing...\n"); - - outpw(REG_I2S_PSR, 0x1); - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) | (1 << 5)); -} - -/** - * @brief Stop to play - * @param None - * @return None - */ -static void i2sStopPlay(void) -{ - printf("IIS stop playing\n"); - - /* stop playing */ - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~(1 << 5)); -} - -/** - * @brief Start to record - * @param None - * @return None - */ -static void i2sStartRecord(void) -{ - /* start recording */ - printf("IIS start recording...\n"); - - outpw(REG_I2S_RSR, 0x1); - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) | (1 << 6)); -} - -/** - * @brief Stop to record - * @param None - * @return None - */ -static void i2sStopRecord(void) -{ - printf("I2S stop recording\n"); - - /* stop recording */ - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~(1 << 6)); -} - -/** - * @brief Delay function - * @param None - * @return None - */ -static void Delay(int nCnt) -{ - int volatile loop; - for (loop = 0; loop < nCnt * 10; loop++); -} - -/** - * @brief Interrupt service routine for i2s - * @param None - * @return None - */ -static void i2sISR(void) -{ - uint8_t u8SN; - - if (inpw(REG_I2S_CON) & (1 << 10)) - { - outpw(REG_I2S_CON, inpw(REG_I2S_CON) | (1 << 10)); //Clear TX INT - - if (inpw(REG_I2S_PSR) & (1 << 4)) - { - outpw(REG_I2S_PSR, (1 << 4)); - printf("\ndebug:DMA_COUNTER_IRQ occur"); - } - - if (inpw(REG_I2S_PSR) & (1 << 3)) - { - outpw(REG_I2S_PSR, (1 << 3)); - printf("\ndebug:DMA_DATA_ZERO_IRQ occur"); - } - - if (inpw(REG_I2S_PSR) & 0x1) - { - outpw(REG_I2S_PSR, 0x1); - u8SN = (inpw(REG_I2S_PSR) >> 5) & 0x7; - g_fnPlayCallBack(u8SN); - } - } - - if (inpw(REG_I2S_CON) & (1 << 11)) - { - outpw(REG_I2S_CON, inpw(REG_I2S_CON) | (1 << 11)); //Clear RX INT - - if (inpw(REG_I2S_RSR) & 0x1) - { - outpw(REG_I2S_RSR, 0x1); - u8SN = (inpw(REG_I2S_RSR) >> 5) & 0x7; - g_fnRecCallBack(u8SN); - } - } -} -/// @endcond /* HIDDEN_SYMBOLS */ - -/** - * @brief Open i2s interface - * @return open status - * @retval I2S_ERR_BUSY error. - * @retval 0 success. - */ -int32_t i2sOpen(void) -{ - if (i2sOpened) - return I2S_ERR_BUSY; - - /* reset audio interface */ - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) | (1 << 16)); - Delay(100); - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~(1 << 16)); - Delay(100); - - /* reset IIS interface */ - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) | 0x1); - Delay(100); - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~0x1); - Delay(100); - - outpw(REG_I2S_CON, inpw(REG_I2S_CON) | (1 << 21) | (1 << 20)); - - i2sOpened = 1; - - return 0; -} - -/** - * @brief Close i2s interface - * @return None - */ -void i2sClose(void) -{ - // reset some variables - i2sOpened = 0; - g_fnPlayCallBack = NULL; - g_fnRecCallBack = NULL; - - // reset i2s interface - outpw(REG_SYS_AHBIPRST, inpw(REG_SYS_AHBIPRST) | (1 << 8)); - outpw(REG_SYS_AHBIPRST, inpw(REG_SYS_AHBIPRST) & ~(1 << 8)); -} - -/** - * @brief Initialize i2s interface and setup interrupt - * @return None - */ -void i2sInit(void) -{ - // enable i2s engine clock - outpw(REG_CLK_HCLKEN, inpw(REG_CLK_HCLKEN) | (1 << 24)); - - // enable interrupt and set ISR - sysInstallISR(IRQ_LEVEL_1, IRQ_I2S, (PVOID)i2sISR); - sysEnableInterrupt(IRQ_I2S); - sysSetLocalInterrupt(ENABLE_IRQ); -} - -/** - * @brief IO control for i2s interface - * @param[in] cmd command for io control, value could be - * - \ref I2S_SET_PLAY - * - \ref I2S_SET_RECORD - * - \ref I2S_SELECT_BLOCK - * - \ref I2S_SELECT_BIT - * - \ref I2S_SET_PLAY_DMA_INT_SEL - * - \ref I2S_SET_REC_DMA_INT_SEL - * - \ref I2S_SET_ZEROCROSS - * - \ref I2S_SET_DMACOUNTER - * - \ref I2S_SET_CHANNEL - * - \ref I2S_SET_MODE - * - \ref I2S_SET_SPLITDATA - * - \ref I2S_SET_DMA_ADDRESS - * - \ref I2S_SET_DMA_LENGTH - * - \ref I2S_GET_DMA_CUR_ADDRESS - * - \ref I2S_SET_I2S_FORMAT - * - \ref I2S_SET_I2S_CALLBACKFUN - * - \ref I2S_SET_PCMSLOT - * @param[in] arg0 argument 0 for io control - * @param[in] arg1 argument 1 for io control - * @retval I2S_ERR_IO error. - * @retval 0 success. - */ -int32_t i2sIoctl(uint32_t cmd, uint32_t arg0, uint32_t arg1) -{ - uint32_t *buf; - AU_CB_FUNC_T *ptr; - - switch (cmd) - { - // #define I2S_START_PLAY 0 - // #define I2S_STOP_PLAY 1 - case I2S_SET_PLAY: - if (arg0 == I2S_START_PLAY) - i2sStartPlay(); - else - i2sStopPlay(); - break; - // #define I2S_START_REC 0 - // #define I2S_STOP_REC 1 - case I2S_SET_RECORD: - if (arg0 == I2S_START_REC) - i2sStartRecord(); - else - i2sStopRecord(); - break; - // #define I2S_BLOCK_I2S 0 - // #define I2S_BLOCK_PCM 1 - case I2S_SELECT_BLOCK: - if (arg0 == I2S_BLOCK_I2S) - outpw(REG_I2S_CON, (inpw(REG_I2S_CON) & ~0x3) | 0x1); - else - outpw(REG_I2S_CON, (inpw(REG_I2S_CON) & ~0x3) | 0x2); - break; - // #define I2S_BIT_WIDTH_8 0 - // #define I2S_BIT_WIDTH_16 1 - // #define I2S_BIT_WIDTH_24 2 - case I2S_SELECT_BIT: - outpw(REG_I2S_CON, (inpw(REG_I2S_CON) & ~0x300) | (arg0 << 8)); - break; - // #define I2S_DMA_INT_END 0 - // #define I2S_DMA_INT_HALF 1 - // #define I2S_DMA_INT_QUARTER 2 - // #define I2S_DMA_INT_EIGTH 3 - case I2S_SET_PLAY_DMA_INT_SEL: - outpw(REG_I2S_CON, (inpw(REG_I2S_CON) & ~0x3000) | (arg0 << 12)); - break; - - case I2S_SET_REC_DMA_INT_SEL: - outpw(REG_I2S_CON, (inpw(REG_I2S_CON) & ~0xc000) | (arg0 << 14)); - break; - - case I2S_SET_ZEROCROSS: - if (arg0 == I2S_ENABLE) - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) | 0x8); - else - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~0x8); - break; - - case I2S_SET_DMACOUNTER: - if (arg0 == I2S_ENABLE) - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) | 0x10); - else - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~0x10); - break; - // #define I2S_CHANNEL_I2S_ONE 2 - // #define I2S_CHANNEL_I2S_TWO 3 - // #define I2S_CHANNEL_PCM_TWO 3 - // #define I2S_CHANNEL_PCM_TWO_SLOT1 0 - // #define I2S_CHANNEL_PCM_TWO_SLOT0 1 - // #define I2S_CHANNEL_PCM_ONE_SLOT0 2 - case I2S_SET_CHANNEL: - if (arg0 == I2S_PLAY) - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~(0x3 << 12) | (arg1 << 12)); - else - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~(0x3 << 14) | (arg1 << 14)); - break; - // #define I2S_MODE_MASTER 0 - // #define I2S_MODE_SLAVE 1 - case I2S_SET_MODE: - if (arg0 == I2S_MODE_MASTER) - outpw(REG_I2S_I2SCON, inpw(REG_I2S_I2SCON) & ~(0x1 << 20)); - else - outpw(REG_I2S_I2SCON, inpw(REG_I2S_I2SCON) | (0x1 << 20)); - break; - - case I2S_SET_SPLITDATA: - if (arg0 == I2S_ENABLE) - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) | (0x1 << 20)); - else - outpw(REG_I2S_RESET, inpw(REG_I2S_RESET) & ~(0x1 << 20)); - break; - - case I2S_SET_DMA_ADDRESS: - if (arg0 == I2S_PLAY) - outpw(REG_I2S_PDESB, arg1 | 0x80000000); - else if (arg0 == I2S_REC) - outpw(REG_I2S_RDESB, arg1 | 0x80000000); - else if (arg0 == PCM_PLAY) - outpw(REG_I2S_PDESB2, arg1 | 0x80000000); - else - outpw(REG_I2S_RDESB2, arg1 | 0x80000000); - break; - - case I2S_SET_DMA_LENGTH: - if (arg0 == I2S_PLAY) - outpw(REG_I2S_PDES_LENGTH, arg1); - else - outpw(REG_I2S_RDES_LENGTH, arg1); - break; - - case I2S_GET_DMA_CUR_ADDRESS: - buf = (uint32_t *)arg0; - if (arg0 == I2S_PLAY) - *buf = inpw(REG_I2S_PDESC); - else - *buf = inpw(REG_I2S_RDESC); - break; - - // #define I2S_FORMAT_I2S 0 - // #define I2S_FORMAT_MSB 1 - case I2S_SET_I2S_FORMAT: - if (arg0 == I2S_FORMAT_I2S) - outpw(REG_I2S_I2SCON, inpw(REG_I2S_I2SCON) & ~ 0x8); - else - outpw(REG_I2S_I2SCON, inpw(REG_I2S_I2SCON) | 0x8); - break; - - case I2S_SET_I2S_CALLBACKFUN: - ptr = (AU_CB_FUNC_T *)arg1; - if (arg0 == I2S_PLAY) - g_fnPlayCallBack = ptr; - else - g_fnRecCallBack = ptr; - break; - // #define PCM_SLOT1_IN 0 - // #define PCM_SLOT1_OUT 1 - // #define PCM_SLOT2_IN 2 - // #define PCM_SLOT2_OUT 3 - case I2S_SET_PCMSLOT: - if (arg0 == PCM_SLOT1_IN) - outpw(REG_I2S_PCMS1ST, (inpw(REG_I2S_PCMS1ST) & ~0x3ff) | (arg1 & 0x3ff)); - else if (arg0 == PCM_SLOT1_OUT) - outpw(REG_I2S_PCMS1ST, (inpw(REG_I2S_PCMS1ST) & ~0x3ff0000) | ((arg1 & 0x3ff) << 16)); - else if (arg0 == PCM_SLOT2_IN) - outpw(REG_I2S_PCMS2ST, (inpw(REG_I2S_PCMS2ST) & ~0x3ff) | (arg1 & 0x3ff)); - else - outpw(REG_I2S_PCMS2ST, (inpw(REG_I2S_PCMS2ST) & ~0x3ff0000) | ((arg1 & 0x3ff) << 16)); - break; - - case I2S_SET_PCM_FS_PERIOD: - outpw(REG_I2S_PCMCON, (inpw(REG_I2S_PCMCON) & ~0x03FF0000 | (((arg0 - 1) & 0x3ff) << 16))); - break; - - default: - return I2S_ERR_IO; - } - return 0; -} - -/** - * @brief Configure sampling rate for audio - * @param[in] u32SourceClockRate source speed to i2s interface - * @param[in] u32SampleRate sampling rate - * @param[in] u32DataBit data width - * @param[in] u32Channel channel number - * @return None - */ -void i2sSetSampleRate(uint32_t u32SourceClockRate, uint32_t u32SampleRate, uint32_t u32DataBit, uint32_t u32Channel) -{ - uint32_t u32BCLKDiv; - uint32_t u32MCLK, u32MCLKDiv; - - u32MCLK = (u32SampleRate * 256); - u32MCLKDiv = u32SourceClockRate / u32MCLK; - outpw(REG_I2S_I2SCON, (inpw(REG_I2S_I2SCON) & ~0x000F0000) | (u32MCLKDiv - 1) << 16); - - u32BCLKDiv = u32MCLK / (u32SampleRate * u32DataBit * u32Channel); - u32BCLKDiv = u32BCLKDiv / 2 - 1; - outpw(REG_I2S_I2SCON, (inpw(REG_I2S_I2SCON) & ~0xF0) | u32BCLKDiv << 5); -} - -/** - * @brief Configure MCLK frequency (master mode) - * @param[in] u32SourceClockRate source clock rate - * @param[in] u32SampleRate sampling rate - * @return None - */ -void i2sSetMCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32SampleRate) -{ - uint32_t u32MCLK, u32MCLKDiv; - - u32MCLK = (u32SampleRate * 256); - u32MCLKDiv = u32SourceClockRate / u32MCLK; - outpw(REG_I2S_I2SCON, (inpw(REG_I2S_I2SCON) & ~0x000F0000) | (u32MCLKDiv - 1) << 16); -} - -/** - * @brief Configure PCM BCLK frequency (master mode) - * @param[in] u32SourceClockRate source clock rate - * @param[in] u32Rate target rate - * @return None - */ -void i2sSetPCMBCLKFrequency(uint32_t u32SourceClockRate, uint32_t u32Rate) -{ - uint32_t u32BCLKDiv; - - u32BCLKDiv = (u32SourceClockRate / (2 * u32Rate)) - 1; - outpw(REG_I2S_PCMCON, (inpw(REG_I2S_PCMCON) & ~0x0000FF00) | (u32BCLKDiv << 8)); -} - - -/*@}*/ /* end of group I2S_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group I2S_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_pdma.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_pdma.c deleted file mode 100644 index c742d0050d8..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_pdma.c +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************//** - * @file pdma.c - * @brief PDMA driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nuc980.h" -#include "nu_pdma.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup PDMA_Driver PDMA Driver - @{ -*/ - - -/** @addtogroup PDMA_EXPORTED_FUNCTIONS PDMA Exported Functions - @{ -*/ - -/** - * @brief PDMA Open - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable the PDMA channels. - */ -void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask) -{ - uint32_t i; - - for (i = 0UL; i < PDMA_CH_MAX; i++) - { - if ((1 << i) & u32Mask) - { - pdma->DSCT[i].CTL = 0UL; - } - } - - pdma->CHCTL |= u32Mask; -} - -/** - * @brief PDMA Close - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @return None - * - * @details This function disable all PDMA channels. - */ -void PDMA_Close(PDMA_T *pdma) -{ - pdma->CHCTL = 0UL; -} - -/** - * @brief Set PDMA Transfer Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Width Data width. Valid values are - * - \ref PDMA_WIDTH_8 - * - \ref PDMA_WIDTH_16 - * - \ref PDMA_WIDTH_32 - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected channel data width and transfer count. - */ -void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXCNT_Msk | PDMA_DSCT_CTL_TXWIDTH_Msk); - pdma->DSCT[u32Ch].CTL |= (u32Width | ((u32TransCount - 1UL) << PDMA_DSCT_CTL_TXCNT_Pos)); -} - -/** - * @brief Set PDMA Stride Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32DestLen Destination stride count - * @param[in] u32SrcLen Source stride count - * @param[in] u32TransCount Transfer count - * - * @return None - * - * @details This function set the selected stride mode. - */ -void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount) -{ - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_STRIDEEN_Msk; - pdma->STRIDE[u32Ch].ASOCR = (u32DestLen << 16) | u32SrcLen; - pdma->STRIDE[u32Ch].STCR = u32TransCount; -} - -/** - * @brief Set PDMA Transfer Address - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32SrcAddr Source address - * @param[in] u32SrcCtrl Source control attribute. Valid values are - * - \ref PDMA_SAR_INC - * - \ref PDMA_SAR_FIX - * @param[in] u32DstAddr destination address - * @param[in] u32DstCtrl destination control attribute. Valid values are - * - \ref PDMA_DAR_INC - * - \ref PDMA_DAR_FIX - * - * @return None - * - * @details This function set the selected channel source/destination address and attribute. - */ -void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl) -{ - pdma->DSCT[u32Ch].SA = u32SrcAddr; - pdma->DSCT[u32Ch].DA = u32DstAddr; - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_SAINC_Msk | PDMA_DSCT_CTL_DAINC_Msk); - pdma->DSCT[u32Ch].CTL |= (u32SrcCtrl | u32DstCtrl); -} - -/** - * @brief Set PDMA Transfer Mode - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Peripheral The selected peripheral. Valid values are - * - \ref PDMA_MEM - * - \ref PDMA_UART0_TX - * - \ref PDMA_UART0_RX - * - \ref PDMA_UART1_TX - * - \ref PDMA_UART1_RX - * - \ref PDMA_UART2_TX - * - \ref PDMA_UART2_RX - * - \ref PDMA_UART3_TX - * - \ref PDMA_UART3_RX - * - \ref PDMA_UART4_TX - * - \ref PDMA_UART4_RX - * - \ref PDMA_UART5_TX - * - \ref PDMA_UART5_RX - * - \ref PDMA_UART6_TX - * - \ref PDMA_UART6_RX - * - \ref PDMA_UART7_TX - * - \ref PDMA_UART7_RX - * - \ref PDMA_QSPI0_TX - * - \ref PDMA_QSPI0_RX - * - \ref PDMA_SPI0_TX - * - \ref PDMA_SPI0_RX - * - \ref PDMA_SPI1_TX - * - \ref PDMA_SPI1_RX - * - \ref PDMA_UART8_TX - * - \ref PDMA_UART8_RX - * - \ref PDMA_UART9_TX - * - \ref PDMA_UART9_RX - * - \ref PDMA_I2C0_TX - * - \ref PDMA_I2C0_RX - * - \ref PDMA_I2C1_TX - * - \ref PDMA_I2C1_RX - * - \ref PDMA_I2C2_TX - * - \ref PDMA_I2C2_RX - * - \ref PDMA_I2C3_TX - * - \ref PDMA_I2C3_RX - * - \ref PDMA_TIMER0 - * - \ref PDMA_TIMER1 - * - \ref PDMA_TIMER2 - * - \ref PDMA_TIMER3 - * - \ref PDMA_TIMER4 - * - \ref PDMA_TIMER5 - * @param[in] u32ScatterEn Scatter-gather mode enable - * @param[in] u32DescAddr Scatter-gather descriptor address - * - * @return None - * - * @details This function set the selected channel transfer mode. Include peripheral setting. - */ -void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - pau32REQSEL[u32Ch / 4] = (pau32REQSEL[u32Ch / 4] & ~u32REQSEL_Msk) | (u32Peripheral << u32REQSEL_Pos); - - if (u32ScatterEn) - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_SCATTER; - pdma->DSCT[u32Ch].NEXT = u32DescAddr - (pdma->SCATBA); - } - else - { - pdma->DSCT[u32Ch].CTL = (pdma->DSCT[u32Ch].CTL & ~PDMA_DSCT_CTL_OPMODE_Msk) | PDMA_OP_BASIC; - } - } - else {} -} -/** - * @brief Set PDMA Burst Type and Size - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32BurstType Burst mode or single mode. Valid values are - * - \ref PDMA_REQ_SINGLE - * - \ref PDMA_REQ_BURST - * @param[in] u32BurstSize Set the size of burst mode. Valid values are - * - \ref PDMA_BURST_128 - * - \ref PDMA_BURST_64 - * - \ref PDMA_BURST_32 - * - \ref PDMA_BURST_16 - * - \ref PDMA_BURST_8 - * - \ref PDMA_BURST_4 - * - \ref PDMA_BURST_2 - * - \ref PDMA_BURST_1 - * - * @return None - * - * @details This function set the selected channel burst type and size. - */ -void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize) -{ - pdma->DSCT[u32Ch].CTL &= ~(PDMA_DSCT_CTL_TXTYPE_Msk | PDMA_DSCT_CTL_BURSIZE_Msk); - pdma->DSCT[u32Ch].CTL |= (u32BurstType | u32BurstSize); -} - -/** - * @brief Enable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function enable timeout function of the selected channel(s). - */ -void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN |= u32Mask; -} - -/** - * @brief Disable timeout function - * - * @param[in] pdma The pointer of the specified PDMA module - * - * @param[in] u32Mask Channel enable bits. - * - * @return None - * - * @details This function disable timeout function of the selected channel(s). - */ -void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask) -{ - pdma->TOUTEN &= ~u32Mask; -} - -/** - * @brief Set PDMA Timeout Count - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel, - * @param[in] u32OnOff Enable/disable time out function - * @param[in] u32TimeOutCnt Timeout count - * - * @return None - * - * @details This function set the timeout count. - */ -void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt) -{ - if (u32Ch < PDMA_CH_MAX) - { - __IO uint32_t *pau32TOC = (__IO uint32_t *)&pdma->TOC0_1; - uint32_t u32TOC_Pos, u32TOC_Msk; - - u32TOC_Pos = (u32Ch % 2) * 16 ; - u32TOC_Msk = PDMA_TOC0_1_TOC0_Msk << u32TOC_Pos; - pau32TOC[u32Ch / 2] = (pau32TOC[u32Ch / 2] & ~u32TOC_Msk) | (u32TimeOutCnt << u32TOC_Pos); - - if (u32OnOff) - pdma->TOUTEN |= (1 << u32Ch); - else - pdma->TOUTEN &= ~(1 << u32Ch); - } - else {} -} - -/** - * @brief Trigger PDMA - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * - * @return None - * - * @details This function trigger the selected channel. - */ -void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch) -{ - __IO uint32_t *pau32REQSEL = (__IO uint32_t *)&pdma->REQSEL0_3; - uint32_t u32REQSEL_Pos, u32REQSEL_Msk, u32ChReq; - - u32REQSEL_Pos = (u32Ch % 4) * 8 ; - u32REQSEL_Msk = PDMA_REQSEL0_3_REQSRC0_Msk << u32REQSEL_Pos; - - u32ChReq = (pau32REQSEL[u32Ch / 4] & u32REQSEL_Msk) >> u32REQSEL_Pos; - - if (u32ChReq == PDMA_MEM) - { - pdma->SWREQ = (1ul << u32Ch); - } - else {} -} - -/** - * @brief Enable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function enable the selected channel interrupt. - */ -void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN |= (1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL &= ~PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN |= (1ul << u32Ch); - break; - - default: - break; - } -} - -/** - * @brief Disable Interrupt - * - * @param[in] pdma The pointer of the specified PDMA module - * @param[in] u32Ch The selected channel - * @param[in] u32Mask The Interrupt Type. Valid values are - * - \ref PDMA_INT_TRANS_DONE - * - \ref PDMA_INT_TEMPTY - * - \ref PDMA_INT_TIMEOUT - * - * @return None - * - * @details This function disable the selected channel interrupt. - */ -void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask) -{ - switch (u32Mask) - { - case PDMA_INT_TRANS_DONE: - pdma->INTEN &= ~(1ul << u32Ch); - break; - case PDMA_INT_TEMPTY: - pdma->DSCT[u32Ch].CTL |= PDMA_DSCT_CTL_TBINTDIS_Msk; - break; - case PDMA_INT_TIMEOUT: - pdma->TOUTIEN &= ~(1ul << u32Ch); - break; - - default: - break; - } -} - -/*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group PDMA_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_qspi.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_qspi.c deleted file mode 100644 index f233927c949..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_qspi.c +++ /dev/null @@ -1,598 +0,0 @@ -/**************************************************************************//** - * @file qspi.c - * @brief NUC980 series QSPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nuc980.h" -#include "nu_qspi.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup QSPI_Driver QSPI Driver - @{ -*/ - - -/** @addtogroup QSPI_EXPORTED_FUNCTIONS QSPI Exported Functions - @{ -*/ - -/** - * @brief This function make QSPI module be ready to transfer. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32MasterSlave Decides the QSPI module is operating in master mode or in slave mode. (QSPI_SLAVE, QSPI_MASTER) - * @param[in] u32QSPIMode Decides the transfer timing. (QSPI_MODE_0, QSPI_MODE_1, QSPI_MODE_2, QSPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a QSPI transaction. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI peripheral clock. - * @details By default, the QSPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the QSPI clock divider setting will be 0. - * The actual clock rate may be different from the target QSPI clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the - * actual QSPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the QSPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t QSPI_Open(QSPI_T *qspi, - uint32_t u32MasterSlave, - uint32_t u32QSPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32RetValue = 0U; - - if (u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - if (u32MasterSlave == QSPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_QSPIEN_Msk; - - /* Set DIVIDER */ - qspi->CLKDIV = ((150000000U / u32BusClock) - 1U); - } - else /* For slave mode, force the QSPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - qspi->SSCTL = QSPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - qspi->CTL = u32MasterSlave | (u32DataWidth << QSPI_CTL_DWIDTH_Pos) | (u32QSPIMode) | QSPI_CTL_QSPIEN_Msk; - - /* Set DIVIDER = 0 */ - qspi->CLKDIV = 0U; - } - - return u32RetValue; -} - -/** - * @brief Disable QSPI controller. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will reset QSPI controller. - */ -void QSPI_Close(QSPI_T *qspi) -{ - /* Reset QSPI */ -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI RX FIFO buffer. The RXEMPTY (QSPI_STATUS[8]) will be set to 1. - */ -void QSPI_ClearRxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will clear QSPI TX FIFO buffer. The TXEMPTY (QSPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void QSPI_ClearTxFIFO(QSPI_T *qspi) -{ - qspi->FIFOCTL |= QSPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void QSPI_DisableAutoSS(QSPI_T *qspi) -{ - qspi->SSCTL &= ~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (QSPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (QSPI_SS_ACTIVE_HIGH, QSPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void QSPI_EnableAutoSS(QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - qspi->SSCTL = (qspi->SSCTL & (~(QSPI_SSCTL_AUTOSS_Msk | QSPI_SSCTL_SSACTPOL_Msk | QSPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | QSPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Set the QSPI bus clock. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32BusClock The expected frequency of QSPI bus clock in Hz. - * @return Actual frequency of QSPI bus clock. - * @details This function is only available in Master mode. The actual clock rate may be different from the target QSPI bus clock rate. - * For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI bus clock - * rate will be 6 MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, QSPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= QSPI peripheral clock source, DIVIDER will be set to 0. - */ -uint32_t QSPI_SetBusClock(QSPI_T *qspi, uint32_t u32BusClock) -{ - return 0; -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void QSPI_SetFIFO(QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - qspi->FIFOCTL = (qspi->FIFOCTL & ~(QSPI_FIFOCTL_TXTH_Msk | QSPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << QSPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << QSPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of QSPI bus clock. Only available in Master mode. - * @param[in] qspi The pointer of the specified QSPI module. - * @return Actual QSPI bus clock frequency in Hz. - * @details This function will calculate the actual QSPI bus clock rate according to the QSPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t QSPI_GetBusClock(QSPI_T *qspi) -{ - /* Return QSPI bus clock rate */ - return 0; -} - -/** - * @brief Enable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_EnableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL |= QSPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL |= QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL |= QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable QSPI related interrupts specified by u32Mask parameter. - */ -void QSPI_DisableInt(QSPI_T *qspi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) == QSPI_UNIT_INT_MASK) - { - qspi->CTL &= ~QSPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) == QSPI_SSACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) == QSPI_SSINACT_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) == QSPI_SLVUR_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) == QSPI_SLVBE_INT_MASK) - { - qspi->SSCTL &= ~QSPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) == QSPI_TXUF_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) == QSPI_FIFO_TXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) == QSPI_FIFO_RXTH_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) == QSPI_FIFO_RXOV_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) == QSPI_FIFO_RXTO_INT_MASK) - { - qspi->FIFOCTL &= ~QSPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_TXTH_INT_MASK - * - \ref QSPI_FIFO_RXTH_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get QSPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t QSPI_GetIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = qspi->STATUS & QSPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if ((u32Mask & QSPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_UNIT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & QSPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & QSPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SSINACT_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if ((u32Mask & QSPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVUR_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if ((u32Mask & QSPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_SLVBE_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & QSPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_TXUF_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = qspi->STATUS & QSPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if ((u32Mask & QSPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= QSPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref QSPI_UNIT_INT_MASK - * - \ref QSPI_SSACT_INT_MASK - * - \ref QSPI_SSINACT_INT_MASK - * - \ref QSPI_SLVUR_INT_MASK - * - \ref QSPI_SLVBE_INT_MASK - * - \ref QSPI_TXUF_INT_MASK - * - \ref QSPI_FIFO_RXOV_INT_MASK - * - \ref QSPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear QSPI related interrupt flags specified by u32Mask parameter. - */ -void QSPI_ClearIntFlag(QSPI_T *qspi, uint32_t u32Mask) -{ - if (u32Mask & QSPI_UNIT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & QSPI_SSACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & QSPI_SSINACT_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & QSPI_SLVUR_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & QSPI_SLVBE_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & QSPI_TXUF_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXOV_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & QSPI_FIFO_RXTO_INT_MASK) - { - qspi->STATUS = QSPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get QSPI status. - * @param[in] qspi The pointer of the specified QSPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref QSPI_BUSY_MASK - * - \ref QSPI_RX_EMPTY_MASK - * - \ref QSPI_RX_FULL_MASK - * - \ref QSPI_TX_EMPTY_MASK - * - \ref QSPI_TX_FULL_MASK - * - \ref QSPI_TXRX_RESET_MASK - * - \ref QSPI_QSPIEN_STS_MASK - * - \ref QSPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get QSPI related status specified by u32Mask parameter. - */ -uint32_t QSPI_GetStatus(QSPI_T *qspi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = qspi->STATUS & QSPI_STATUS_BUSY_Msk; - /* Check busy status */ - if ((u32Mask & QSPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_BUSY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if ((u32Mask & QSPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if ((u32Mask & QSPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_RX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if ((u32Mask & QSPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_EMPTY_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if ((u32Mask & QSPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TX_FULL_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if ((u32Mask & QSPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_TXRX_RESET_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_QSPIENSTS_Msk; - /* Check QSPIEN flag */ - if ((u32Mask & QSPI_QSPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_QSPIEN_STS_MASK; - } - - u32TmpValue = qspi->STATUS & QSPI_STATUS_SSLINE_Msk; - /* Check QSPIx_SS line status */ - if ((u32Mask & QSPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= QSPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - - - -/*@}*/ /* end of group QSPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group QSPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_rtc.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_rtc.c deleted file mode 100644 index 1ace1099240..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_rtc.c +++ /dev/null @@ -1,808 +0,0 @@ -/**************************************************************************//** - * @file rtc.c - * @version V3.00 - * $Revision: 5 $ - * $Date: 14/06/10 5:49p $ - * @brief NUC980 series RTC driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nu_rtc.h" - - -/** @cond HIDDEN_SYMBOLS */ - -/*---------------------------------------------------------------------------------------------------------*/ -/* Macro, type and constant definitions */ -/*---------------------------------------------------------------------------------------------------------*/ -#define RTC_GLOBALS - -/*---------------------------------------------------------------------------------------------------------*/ -/* Global file scope (static) variables */ -/*---------------------------------------------------------------------------------------------------------*/ -static volatile uint32_t g_u32hiYear, g_u32loYear, g_u32hiMonth, g_u32loMonth, g_u32hiDay, g_u32loDay; -static volatile uint32_t g_u32hiHour, g_u32loHour, g_u32hiMin, g_u32loMin, g_u32hiSec, g_u32loSec; - -/** @endcond HIDDEN_SYMBOLS */ - - - - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup RTC_Driver RTC Driver - @{ -*/ - -/** @addtogroup RTC_EXPORTED_FUNCTIONS RTC Exported Functions - @{ -*/ - -/** - * @brief Initialize RTC module and start counting - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This function is used to: \n - * 1. Write initial key to let RTC start count. \n - * 2. Input parameter indicates start date/time. \n - * 3. User has to make sure that parameters of RTC date/time are reasonable. \n - * @note Null pointer for using default starting date/time. - */ -void RTC_Open(S_RTC_TIME_DATA_T *sPt) -{ - RTC->INIT = RTC_INIT_KEY; - RTC_Check(); - - if (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - RTC->INIT = RTC_INIT_KEY; - while (RTC->INIT != RTC_INIT_ACTIVE_Msk) - { - } - } - - if (sPt == 0) - { - } - else - { - /* Set RTC date and time */ - RTC_SetDateAndTime(sPt); - } -} - -/** - * @brief Disable RTC Clock - * - * @param None - * - * @return None - * - * @details This API will disable RTC peripheral clock and stops RTC counting. - */ -void RTC_Close(void) -{ - outp32(REG_CLK_PCLKEN0, inp32(REG_CLK_PCLKEN0 & ~(0x1 << 1))); -} - -/** - * @brief Set Frequency Compensation Data - * - * @param[in] i32FrequencyX100 Specify the RTC clock X100, ex: 3277365 means 32773.65. - * - * @return None - * - */ -void RTC_32KCalibration(int32_t i32FrequencyX100) -{ - INT32 i32RegInt, i32RegFra; - UINT32 u32Reg; - - /* Compute integer and fraction for RTC FCR register */ - i32RegInt = (i32FrequencyX100 / 100) - RTC_FCR_REFERENCE; - i32RegFra = (((i32FrequencyX100 % 100)) * 60) / 100; - - /* Judge Integer part is reasonable */ - if (i32RegInt < 0) i32RegInt = 0; - - if (i32RegInt > 15) i32RegInt = 15; - - u32Reg = (uint32_t)((i32RegInt << 8) | i32RegFra); - - RTC_WaitAccessEnable(); - outp32(REG_RTC_FREQADJ, u32Reg); - RTC_Check(); -} - -/** - * @brief Get Current RTC Date and Time - * - * @param[out] sPt The returned pointer is specified the current RTC value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the current RTC date and time value. - */ -void RTC_GetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get [Date digit] data */ - g_u32hiYear = (RTC->CAL & RTC_CAL_TENYEAR_Msk) >> RTC_CAL_TENYEAR_Pos; - g_u32loYear = (RTC->CAL & RTC_CAL_YEAR_Msk) >> RTC_CAL_YEAR_Pos; - g_u32hiMonth = (RTC->CAL & RTC_CAL_TENMON_Msk) >> RTC_CAL_TENMON_Pos; - g_u32loMonth = (RTC->CAL & RTC_CAL_MON_Msk) >> RTC_CAL_MON_Pos; - g_u32hiDay = (RTC->CAL & RTC_CAL_TENDAY_Msk) >> RTC_CAL_TENDAY_Pos; - g_u32loDay = (RTC->CAL & RTC_CAL_DAY_Msk) >> RTC_CAL_DAY_Pos; - - /* Get [Time digit] data */ - g_u32hiHour = (RTC->TIME & RTC_TIME_TENHR_Msk) >> RTC_TIME_TENHR_Pos; - g_u32loHour = (RTC->TIME & RTC_TIME_HR_Msk) >> RTC_TIME_HR_Pos; - g_u32hiMin = (RTC->TIME & RTC_TIME_TENMIN_Msk) >> RTC_TIME_TENMIN_Pos; - g_u32loMin = (RTC->TIME & RTC_TIME_MIN_Msk) >> RTC_TIME_MIN_Pos; - g_u32hiSec = (RTC->TIME & RTC_TIME_TENSEC_Msk) >> RTC_TIME_TENSEC_Pos; - g_u32loSec = (RTC->TIME & RTC_TIME_SEC_Msk) >> RTC_TIME_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10ul); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10ul); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10ul); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21ul) - { - sPt->u32AmPm = RTC_PM; - sPt->u32Hour -= 20ul; - } - else - { - sPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } - else - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Get RTC Alarm Date and Time - * - * @param[out] sPt The returned pointer is specified the RTC alarm value. It includes: \n - * u32Year: Year value \n - * u32Month: Month value \n - * u32Day: Day value \n - * u32DayOfWeek: Day of week \n - * u32Hour: Hour value \n - * u32Minute: Minute value \n - * u32Second: Second value \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to get the RTC alarm date and time setting. - */ -void RTC_GetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32Tmp; - - sPt->u32TimeScale = RTC->CLKFMT & RTC_CLKFMT_24HEN_Msk; /* 12/24-hour */ - sPt->u32DayOfWeek = RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk; /* Day of the week */ - - /* Get alarm [Date digit] data */ - RTC_WaitAccessEnable(); - g_u32hiYear = (RTC->CALM & RTC_CALM_TENYEAR_Msk) >> RTC_CALM_TENYEAR_Pos; - g_u32loYear = (RTC->CALM & RTC_CALM_YEAR_Msk) >> RTC_CALM_YEAR_Pos; - g_u32hiMonth = (RTC->CALM & RTC_CALM_TENMON_Msk) >> RTC_CALM_TENMON_Pos; - g_u32loMonth = (RTC->CALM & RTC_CALM_MON_Msk) >> RTC_CALM_MON_Pos; - g_u32hiDay = (RTC->CALM & RTC_CALM_TENDAY_Msk) >> RTC_CALM_TENDAY_Pos; - g_u32loDay = (RTC->CALM & RTC_CALM_DAY_Msk) >> RTC_CALM_DAY_Pos; - - /* Get alarm [Time digit] data */ - RTC_WaitAccessEnable(); - g_u32hiHour = (RTC->TALM & RTC_TALM_TENHR_Msk) >> RTC_TALM_TENHR_Pos; - g_u32loHour = (RTC->TALM & RTC_TALM_HR_Msk) >> RTC_TALM_HR_Pos; - g_u32hiMin = (RTC->TALM & RTC_TALM_TENMIN_Msk) >> RTC_TALM_TENMIN_Pos; - g_u32loMin = (RTC->TALM & RTC_TALM_MIN_Msk) >> RTC_TALM_MIN_Pos; - g_u32hiSec = (RTC->TALM & RTC_TALM_TENSEC_Msk) >> RTC_TALM_TENSEC_Pos; - g_u32loSec = (RTC->TALM & RTC_TALM_SEC_Msk) >> RTC_TALM_SEC_Pos; - - /* Compute to 20XX year */ - u32Tmp = (g_u32hiYear * 10ul); - u32Tmp += g_u32loYear; - sPt->u32Year = u32Tmp + RTC_YEAR2000; - - /* Compute 0~12 month */ - u32Tmp = (g_u32hiMonth * 10ul); - sPt->u32Month = u32Tmp + g_u32loMonth; - - /* Compute 0~31 day */ - u32Tmp = (g_u32hiDay * 10ul); - sPt->u32Day = u32Tmp + g_u32loDay; - - /* Compute 12/24 hour */ - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; /* AM: 1~12. PM: 21~32. */ - - if (sPt->u32Hour >= 21ul) - { - sPt->u32AmPm = RTC_PM; - sPt->u32Hour -= 20ul; - } - else - { - sPt->u32AmPm = RTC_AM; - } - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - - } - else - { - u32Tmp = (g_u32hiHour * 10ul); - u32Tmp += g_u32loHour; - sPt->u32Hour = u32Tmp; - - u32Tmp = (g_u32hiMin * 10ul); - u32Tmp += g_u32loMin; - sPt->u32Minute = u32Tmp; - - u32Tmp = (g_u32hiSec * 10ul); - u32Tmp += g_u32loSec; - sPt->u32Second = u32Tmp; - } -} - -/** - * @brief Update Current RTC Date and Time - * - * @param[in] sPt Specify the time property and current date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update current date and time to RTC. - */ -void RTC_SetDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCAL, u32RegTIME; - - if (sPt == NULL) - { - } - else - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - RTC_WaitAccessEnable(); - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - RTC_Check(); - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == RTC_PM) - { - sPt->u32Hour += 20ul; - } - } - else - { - RTC_WaitAccessEnable(); - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - RTC_Check(); - } - - /* Set Day of the Week */ - RTC_WaitAccessEnable(); - RTC->WEEKDAY = sPt->u32DayOfWeek; - RTC_Check(); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Current Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCAL = ((sPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((sPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((sPt->u32Month / 10ul) << 12); - u32RegCAL |= ((sPt->u32Month % 10ul) << 8); - u32RegCAL |= ((sPt->u32Day / 10ul) << 4); - u32RegCAL |= (sPt->u32Day % 10ul); - - u32RegTIME = ((sPt->u32Hour / 10ul) << 20); - u32RegTIME |= ((sPt->u32Hour % 10ul) << 16); - u32RegTIME |= ((sPt->u32Minute / 10ul) << 12); - u32RegTIME |= ((sPt->u32Minute % 10ul) << 8); - u32RegTIME |= ((sPt->u32Second / 10ul) << 4); - u32RegTIME |= (sPt->u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Calender and Time Loading */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - RTC->CAL = (uint32_t)u32RegCAL; - RTC_Check(); - RTC_WaitAccessEnable(); - RTC->TIME = (uint32_t)u32RegTIME; - RTC_Check(); - } -} - -/** - * @brief Update RTC Alarm Date and Time - * - * @param[in] sPt Specify the time property and alarm date and time. It includes: \n - * u32Year: Year value, range between 2000 ~ 2099. \n - * u32Month: Month value, range between 1 ~ 12. \n - * u32Day: Day value, range between 1 ~ 31. \n - * u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] \n - * u32Hour: Hour value, range between 0 ~ 23. \n - * u32Minute: Minute value, range between 0 ~ 59. \n - * u32Second: Second value, range between 0 ~ 59. \n - * u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] \n - * u8AmPm: [RTC_AM / RTC_PM] \n - * - * @return None - * - * @details This API is used to update alarm date and time setting to RTC. - */ -void RTC_SetAlarmDateAndTime(S_RTC_TIME_DATA_T *sPt) -{ - uint32_t u32RegCALM, u32RegTALM; - - if (sPt == 0) - { - } - else - { - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (sPt->u32TimeScale == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - - /*-------------------------------------------------------------------------------------------------*/ - /* Important, range of 12-hour PM mode is 21 up to 32 */ - /*-------------------------------------------------------------------------------------------------*/ - if (sPt->u32AmPm == RTC_PM) - { - sPt->u32Hour += 20ul; - } - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - RTC_Check(); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC Alarm Date and Time */ - /*-----------------------------------------------------------------------------------------------------*/ - u32RegCALM = ((sPt->u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((sPt->u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((sPt->u32Month / 10ul) << 12); - u32RegCALM |= ((sPt->u32Month % 10ul) << 8); - u32RegCALM |= ((sPt->u32Day / 10ul) << 4); - u32RegCALM |= (sPt->u32Day % 10ul); - u32RegCALM |= (sPt->u32DayOfWeek << 24); - - u32RegTALM = ((sPt->u32Hour / 10ul) << 20); - u32RegTALM |= ((sPt->u32Hour % 10ul) << 16); - u32RegTALM |= ((sPt->u32Minute / 10ul) << 12); - u32RegTALM |= ((sPt->u32Minute % 10ul) << 8); - u32RegTALM |= ((sPt->u32Second / 10ul) << 4); - u32RegTALM |= (sPt->u32Second % 10ul); - - RTC_WaitAccessEnable(); - RTC->CALM = (uint32_t)u32RegCALM; - RTC_Check(); - RTC_WaitAccessEnable(); - RTC->TALM = (uint32_t)u32RegTALM; - RTC_Check(); - } -} - -/** - * @brief Update RTC Current Date - * - * @param[in] u32Year The year calendar digit of current RTC setting. - * @param[in] u32Month The month calendar digit of current RTC setting. - * @param[in] u32Day The day calendar digit of current RTC setting. - * @param[in] u32DayOfWeek The Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / - * RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / - * RTC_SATURDAY] - * - * @return None - * - * @details This API is used to update current date to RTC. - */ -void RTC_SetDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek) -{ - uint32_t u32RegCAL; - - u32RegCAL = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCAL |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCAL |= ((u32Month / 10ul) << 12); - u32RegCAL |= ((u32Month % 10ul) << 8); - u32RegCAL |= ((u32Day / 10ul) << 4); - u32RegCAL |= (u32Day % 10ul); - - /* Set Day of the Week */ - RTC_WaitAccessEnable(); - RTC->WEEKDAY = u32DayOfWeek & RTC_WEEKDAY_WEEKDAY_Msk; - RTC_Check(); - - /* Set RTC Calender Loading */ - RTC_WaitAccessEnable(); - RTC->CAL = (uint32_t)u32RegCAL; - RTC_Check(); -} - -/** - * @brief Update RTC Current Time - * - * @param[in] u32Hour The hour time digit of current RTC setting. - * @param[in] u32Minute The minute time digit of current RTC setting. - * @param[in] u32Second The second time digit of current RTC setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update current time to RTC. - */ -void RTC_SetTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTIME; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == RTC_CLOCK_12) && (u32AmPm == RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTIME = ((u32Hour / 10ul) << 20); - u32RegTIME |= ((u32Hour % 10ul) << 16); - u32RegTIME |= ((u32Minute / 10ul) << 12); - u32RegTIME |= ((u32Minute % 10ul) << 8); - u32RegTIME |= ((u32Second / 10ul) << 4); - u32RegTIME |= (u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (u32TimeMode == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - RTC_Check(); - - RTC_WaitAccessEnable(); - RTC->TIME = (uint32_t)u32RegTIME; - RTC_Check(); -} - -/** - * @brief Update RTC Alarm Date - * - * @param[in] u32Year The year calendar digit of RTC alarm setting. - * @param[in] u32Month The month calendar digit of RTC alarm setting. - * @param[in] u32Day The day calendar digit of RTC alarm setting. - * @param[in] u32DayOfWeek The day of week - * - * @return None - * - * @details This API is used to update alarm date setting to RTC. - */ -void RTC_SetAlarmDate(uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek) -{ - uint32_t u32RegCALM; - - u32RegCALM = ((u32Year - RTC_YEAR2000) / 10ul) << 20; - u32RegCALM |= (((u32Year - RTC_YEAR2000) % 10ul) << 16); - u32RegCALM |= ((u32Month / 10ul) << 12); - u32RegCALM |= ((u32Month % 10ul) << 8); - u32RegCALM |= ((u32Day / 10ul) << 4); - u32RegCALM |= (u32Day % 10ul); - u32RegCALM |= (u32DayOfWeek << 24); - - RTC_WaitAccessEnable(); - - /* Set RTC Alarm Date */ - RTC->CALM = (uint32_t)u32RegCALM; - RTC_Check(); -} - -/** - * @brief Update RTC Alarm Time - * - * @param[in] u32Hour The hour time digit of RTC alarm setting. - * @param[in] u32Minute The minute time digit of RTC alarm setting. - * @param[in] u32Second The second time digit of RTC alarm setting. - * @param[in] u32TimeMode The 24-Hour / 12-Hour Time Scale Selection. [RTC_CLOCK_12 / RTC_CLOCK_24] - * @param[in] u32AmPm 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [RTC_AM / RTC_PM] - * - * @return None - * - * @details This API is used to update alarm time setting to RTC. - */ -void RTC_SetAlarmTime(uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm) -{ - uint32_t u32RegTALM; - - /* Important, range of 12-hour PM mode is 21 up to 32 */ - if ((u32TimeMode == RTC_CLOCK_12) && (u32AmPm == RTC_PM)) - { - u32Hour += 20ul; - } - - u32RegTALM = ((u32Hour / 10ul) << 20); - u32RegTALM |= ((u32Hour % 10ul) << 16); - u32RegTALM |= ((u32Minute / 10ul) << 12); - u32RegTALM |= ((u32Minute % 10ul) << 8); - u32RegTALM |= ((u32Second / 10ul) << 4); - u32RegTALM |= (u32Second % 10ul); - - /*-----------------------------------------------------------------------------------------------------*/ - /* Set RTC 24/12 hour setting and Day of the Week */ - /*-----------------------------------------------------------------------------------------------------*/ - RTC_WaitAccessEnable(); - if (u32TimeMode == RTC_CLOCK_12) - { - RTC->CLKFMT &= ~RTC_CLKFMT_24HEN_Msk; - } - else - { - RTC->CLKFMT |= RTC_CLKFMT_24HEN_Msk; - } - RTC_Check(); - - /* Set RTC Alarm Time */ - RTC_WaitAccessEnable(); - RTC->TALM = (uint32_t)u32RegTALM; - RTC_Check(); -} - -/** - * @brief Get Day of the Week - * - * @param None - * - * @retval 0 Sunday - * @retval 1 Monday - * @retval 2 Tuesday - * @retval 3 Wednesday - * @retval 4 Thursday - * @retval 5 Friday - * @retval 6 Saturday - * - * @details This API is used to get day of the week of current RTC date. - */ -uint32_t RTC_GetDayOfWeek(void) -{ - return (RTC->WEEKDAY & RTC_WEEKDAY_WEEKDAY_Msk); -} - -/** - * @brief Set RTC Tick Period Time - * - * @param[in] u32TickSelection It is used to set the RTC tick period time for Periodic Time Tick request. \n - * It consists of: - * - \ref RTC_TICK_1_SEC : Time tick is 1 second - * - \ref RTC_TICK_1_2_SEC : Time tick is 1/2 second - * - \ref RTC_TICK_1_4_SEC : Time tick is 1/4 second - * - \ref RTC_TICK_1_8_SEC : Time tick is 1/8 second - * - \ref RTC_TICK_1_16_SEC : Time tick is 1/16 second - * - \ref RTC_TICK_1_32_SEC : Time tick is 1/32 second - * - \ref RTC_TICK_1_64_SEC : Time tick is 1/64 second - * - \ref RTC_TICK_1_128_SEC : Time tick is 1/128 second - * - * @return None - * - * @details This API is used to set RTC tick period time for each tick interrupt. - */ -void RTC_SetTickPeriod(uint32_t u32TickSelection) -{ - RTC_WaitAccessEnable(); - RTC->TICK = (RTC->TICK & ~RTC_TICK_TICK_Msk) | u32TickSelection; - RTC_Check(); -} - -/** - * @brief Enable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - * @return None - * - * @details This API is used to enable the specify RTC interrupt function. - */ -void RTC_EnableInt(uint32_t u32IntFlagMask) -{ - RTC_WaitAccessEnable(); - RTC->INTEN |= u32IntFlagMask; - RTC_Check(); - - if (u32IntFlagMask & RTC_INTEN_ALMIEN_Msk) - { - RTC_WaitAccessEnable(); - RTC->PWRCTL |= RTC_PWRCTL_ALARM_EN_Msk; - RTC_Check(); - } - - if (u32IntFlagMask & RTC_INTEN_RELALMIEN_Msk) - { - RTC_WaitAccessEnable(); - RTC->PWRCTL |= RTC_PWRCTL_REL_ALARM_EN_Msk; - RTC_Check(); - } -} - -/** - * @brief Disable RTC Interrupt - * - * @param[in] u32IntFlagMask Specify the interrupt source. It consists of: - * - \ref RTC_INTEN_ALMIEN_Msk : Alarm interrupt - * - \ref RTC_INTEN_TICKIEN_Msk : Tick interrupt - * - * @return None - * - * @details This API is used to disable the specify RTC interrupt function. - */ -void RTC_DisableInt(uint32_t u32IntFlagMask) -{ - RTC_WaitAccessEnable(); - RTC->INTEN &= ~u32IntFlagMask; - RTC_Check(); - RTC_WaitAccessEnable(); - RTC->INTSTS = u32IntFlagMask; - RTC_Check(); -} - -/** - * @brief Wait RTC Access Enable - * - * @param None - * - * @return None - * - * @details This function is used to enable the maximum RTC read/write accessible time. - */ -void RTC_WaitAccessEnable(void) -{ - INT32 volatile i32i; - - RTC_Check(); - - outp32(REG_RTC_RWEN, RTC_WRITE_KEY); - RTC_Check(); - - while (!(inp32(REG_RTC_RWEN) & 0x10000)); -} - -void RTC_Check(void) -{ - uint32_t i = 0; - uint32_t Wait; - - Wait = inp32(REG_RTC_INTSTS) & RTC_INTSTS_REGWRBUSY_Msk; - - while (Wait == RTC_INTSTS_REGWRBUSY_Msk) - { - - Wait = inp32(REG_RTC_INTSTS) & RTC_INTSTS_REGWRBUSY_Msk; - - i++; - - if (i > RTC_WAIT_COUNT) - { - //printf("Time out\n"); - break; - } - } -} - - -/*@}*/ /* end of group RTC_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group RTC_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_scuart.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_scuart.c deleted file mode 100644 index ca3e509e4b7..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_scuart.c +++ /dev/null @@ -1,242 +0,0 @@ -/**************************************************************************//** - * @file scuart.c - * @brief NUC980 series Smartcard UART mode (SCUART) driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nu_scuart.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SCUART_Driver SCUART Driver - @{ -*/ - - -/** @addtogroup SCUART_EXPORTED_FUNCTIONS SCUART Exported Functions - @{ -*/ - -/** - * @brief Disable smartcard uart interface. - * @param sc Smartcard module number - * @return None - * @details The function is used to disable smartcard interface UART mode. - */ -void SCUART_Close(UINT sc) -{ - if (sc == 0) - { - outpw(REG_SC0_INTEN, 0); - outpw(REG_SC0_UARTCTL, 0); - outpw(REG_SC0_CTL, 0); - } - else - { - outpw(REG_SC1_INTEN, 0); - outpw(REG_SC1_UARTCTL, 0); - outpw(REG_SC1_CTL, 0); - } -} - -/// @cond HIDDEN_SYMBOLS -/** - * @brief This function returns module clock of specified SC interface - * @param[in] sc Smartcard module number - * @return Module clock of specified SC interface - */ -static uint32_t SCUART_GetClock(UINT sc) -{ - uint32_t u32Div; - - if (sc == 0) - u32Div = ((inpw(REG_CLK_DIVCTL6) >> 24) & 0xF) + 1; - else - u32Div = ((inpw(REG_CLK_DIVCTL6) >> 28) & 0xF) + 1; - - return 12000000 / u32Div; -} -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief Enable smartcard uart interface. - * @param[in] sc Smartcard module number - * @param[in] u32baudrate Target baudrate of smartcard module. - * @return Actual baudrate of smartcard mode. - * @details This function use to enable smartcard module UART mode and set baudrate. - * @note This function configures character width to 8 bits, 1 stop bit, and no parity. - * And can use \ref SCUART_SetLineConfig function to update these settings. - */ -UINT SCUART_Open(UINT sc, UINT u32baudrate) -{ - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - // Calculate divider for target baudrate - u32Div = (u32Clk + (u32baudrate >> 1) - 1) / u32baudrate - 1; - - if (sc == 0) - { - outpw(REG_SC0_CTL, SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk); // Enable smartcard interface and stop bit = 1 - outpw(REG_SC0_UARTCTL, SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk); // Enable UART mode, disable parity and 8 bit per character - outpw(REG_SC0_ETUCTL, u32Div); - } - else - { - outpw(REG_SC1_CTL, SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk); // Enable smartcard interface and stop bit = 1 - outpw(REG_SC1_UARTCTL, SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk); // Enable UART mode, disable parity and 8 bit per character - outpw(REG_SC1_ETUCTL, u32Div); - } - - return (u32Clk / (u32Div + 1)); -} - -/** - * @brief Read data from smartcard UART interface. - * @param[in] sc Smartcard module number - * @param[in] pu8RxBuf The buffer to store receive the data. - * @param[in] u32ReadBytes Target number of characters to receive. - * @return Actual character number reads to buffer. - * @details The function is used to read Rx data from RX FIFO. - * @note This function does not block and return immediately if there's no data available. - */ -UINT SCUART_Read(UINT sc, char *pu8RxBuf, UINT u32ReadBytes) -{ - uint32_t u32Count; - - if (sc == 0) - { - for (u32Count = 0; u32Count < u32ReadBytes; u32Count++) - { - if (inpw(REG_SC0_STATUS) & SC_STATUS_RXEMPTY_Msk) // no data available - { - break; - } - pu8RxBuf[u32Count] = inpw(REG_SC0_DAT); // get data from FIFO - } - } - else - { - for (u32Count = 0; u32Count < u32ReadBytes; u32Count++) - { - if (inpw(REG_SC1_STATUS) & SC_STATUS_RXEMPTY_Msk) // no data available - { - break; - } - pu8RxBuf[u32Count] = inpw(REG_SC1_DAT); // get data from FIFO - } - - } - - return u32Count; -} - -/** - * @brief This function use to config smartcard UART mode line setting. - * @param[in] sc Smartcard module number - * @param[in] u32Baudrate Target baudrate of smartcard module. If this value is 0, UART baudrate will not change. - * @param[in] u32DataWidth The data length, could be: - * - \ref SCUART_CHAR_LEN_5 - * - \ref SCUART_CHAR_LEN_6 - * - \ref SCUART_CHAR_LEN_7 - * - \ref SCUART_CHAR_LEN_8 - * @param[in] u32Parity The parity setting, could be: - * - \ref SCUART_PARITY_NONE - * - \ref SCUART_PARITY_ODD - * - \ref SCUART_PARITY_EVEN - * @param[in] u32StopBits The stop bit length, could be: - * - \ref SCUART_STOP_BIT_1 - * - \ref SCUART_STOP_BIT_2 - * @return Actual baudrate of smartcard. - * @details Smartcard UART mode is operated in LIN data frame. - */ -UINT SCUART_SetLineConfig(UINT sc, UINT u32Baudrate, UINT u32DataWidth, UINT u32Parity, UINT u32StopBits) -{ - - uint32_t u32Clk = SCUART_GetClock(sc), u32Div; - - if (u32Baudrate == 0) // keep original baudrate setting - { - u32Div = (sc == 0) ? inpw(REG_SC0_ETUCTL) & 0xFFF : inpw(REG_SC1_ETUCTL) & 0xFFF; - } - else - { - // Calculate divider for target baudrate - u32Div = (u32Clk + (u32Baudrate >> 1) - 1) / u32Baudrate - 1; - if (sc == 0) - outpw(REG_SC0_ETUCTL, u32Div); - else - outpw(REG_SC1_ETUCTL, u32Div); - } - - if (sc == 0) - { - outpw(REG_SC0_CTL, u32StopBits | SC_CTL_SCEN_Msk); // Set stop bit - outpw(REG_SC0_UARTCTL, u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk); // Set character width and parity - } - else - { - outpw(REG_SC1_CTL, u32StopBits | SC_CTL_SCEN_Msk); // Set stop bit - outpw(REG_SC1_UARTCTL, u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk); // Set character width and parity - } - return (u32Clk / (u32Div + 1)); -} - -/** - * @brief This function use to set receive timeout count. - * @param[in] sc Smartcard module number - * @param[in] u32TOC Rx timeout counter, using baudrate as counter unit. Valid range are 0~0x1FF, - * set this value to 0 will disable timeout counter. - * @return None - * @details The time-out counter resets and starts counting whenever the RX buffer received a - * new data word. Once the counter decrease to 1 and no new data is received or CPU - * does not read any data from FIFO, a receiver time-out interrupt will be generated. - */ -void SCUART_SetTimeoutCnt(UINT sc, UINT u32TOC) -{ - if (sc == 0) - outpw(REG_SC0_RXTOUT, u32TOC); - else - outpw(REG_SC1_RXTOUT, u32TOC); -} - - -/** - * @brief Write data to smartcard UART interface. - * @param[in] sc Smartcard module number - * @param[in] pu8TxBuf The buffer containing data to send to transmit FIFO. - * @param[in] u32WriteBytes Number of data to send. - * @return None - * @details This function is to write data into transmit FIFO to send data out. - * @note This function blocks until all data write into FIFO. - */ -void SCUART_Write(UINT sc, char *pu8TxBuf, UINT u32WriteBytes) -{ - uint32_t u32Count; - - if (sc == 0) - { - for (u32Count = 0; u32Count != u32WriteBytes; u32Count++) - { - while (inpw(REG_SC0_STATUS) & SC_STATUS_TXFULL_Msk); // Wait 'til FIFO not full - outpw(REG_SC0_DAT, pu8TxBuf[u32Count]); // Write 1 byte to FIFO - } - } - else - { - for (u32Count = 0; u32Count != u32WriteBytes; u32Count++) - { - while (inpw(REG_SC0_STATUS) & SC_STATUS_TXFULL_Msk); // Wait 'til FIFO not full - outpw(REG_SC1_DAT, pu8TxBuf[u32Count]); // Write 1 byte to FIFO - } - } -} - - -/*@}*/ /* end of group SCUART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SCUART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sdh.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sdh.c deleted file mode 100644 index d574ef447bf..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sdh.c +++ /dev/null @@ -1,1181 +0,0 @@ -/**************************************************************************//** - * @file SDH.c - * @brief SDH driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include -#include -#include -#include "nuc980.h" -#include "nu_sdh.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SDH_Driver SDH Driver - @{ -*/ - - -/** @addtogroup SDH_EXPORTED_FUNCTIONS SDH Exported Functions - @{ -*/ -#define SDH_BLOCK_SIZE 512ul - -/** @cond HIDDEN_SYMBOLS */ - -/* global variables */ -/* For response R3 (such as ACMD41, CRC-7 is invalid; but SD controller will still */ -/* calculate CRC-7 and get an error result, software should ignore this error and clear SDISR [CRC_IF] flag */ -/* _sd_uR3_CMD is the flag for it. 1 means software should ignore CRC-7 error */ - -#ifdef __ICCARM__ - #pragma data_alignment = 32 - static uint8_t _SDH0_ucSDHCBuffer[512]; - static uint8_t _SDH1_ucSDHCBuffer[512]; -#else - static uint8_t _SDH0_ucSDHCBuffer[512] __attribute__((aligned(32))); - static uint8_t _SDH1_ucSDHCBuffer[512] __attribute__((aligned(32))); -#endif - -SDH_INFO_T SD0, SD1; - -void SDH_CheckRB(SDH_T *sdh) -{ - while (1) - { - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - if ((sdh->INTSTS & SDH_INTSTS_DAT0STS_Msk) == SDH_INTSTS_DAT0STS_Msk) - { - break; - } - } -} - - -uint32_t SDH_SDCommand(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf, val = 0ul; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | (SDH_CTL_COEN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_COEN_Msk) == SDH_CTL_COEN_Msk) - { - if (pSD->IsCardInsert == 0ul) - { - val = SDH_NO_SD_CARD; - } - } - return val; -} - - -uint32_t SDH_SDCmdAndRsp(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg, uint32_t ntickCount) -{ - volatile uint32_t buf; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk); - sdh->CTL = buf; - - if (ntickCount > 0ul) - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (ntickCount-- == 0ul) - { - sdh->CTL |= SDH_CTL_CTLRST_Msk; /* reset SD engine */ - return 2ul; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - else - { - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - } - - if (pSD->R7Flag) - { - uint32_t tmp0 = 0ul, tmp1 = 0ul; - tmp1 = sdh->RESP1 & 0xfful; - tmp0 = sdh->RESP0 & 0xful; - if ((tmp1 != 0x55ul) && (tmp0 != 0x01ul)) - { - pSD->R7Flag = 0ul; - return SDH_CMD8_ERROR; - } - } - - if (!pSD->R3Flag) - { - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return Successful; - } - else - { - return SDH_CRC7_ERROR; - } - } - else - { - /* ignore CRC error for R3 case */ - pSD->R3Flag = 0ul; - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return Successful; - } -} - - -uint32_t SDH_Swap32(uint32_t val) -{ - uint32_t buf; - - buf = val; - val <<= 24; - val |= (buf << 8) & 0xff0000ul; - val |= (buf >> 8) & 0xff00ul; - val |= (buf >> 24) & 0xfful; - return val; -} - -/* Get 16 bytes CID or CSD */ -uint32_t SDH_SDCmdAndRsp2(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg, uint32_t puR2ptr[]) -{ - uint32_t i, buf; - uint32_t tmpBuf[5]; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_R2EN_Msk); - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_R2EN_Msk) == SDH_CTL_R2EN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) == SDH_INTSTS_CRC7_Msk) - { - for (i = 0ul; i < 5ul; i++) - { - tmpBuf[i] = SDH_Swap32(sdh->FB[i]); - } - for (i = 0ul; i < 4ul; i++) - { - puR2ptr[i] = ((tmpBuf[i] & 0x00fffffful) << 8) | ((tmpBuf[i + 1ul] & 0xff000000ul) >> 24); - } - } - else - { - return SDH_CRC7_ERROR; - } - return Successful; -} - - -uint32_t SDH_SDCmdAndRspDataIn(SDH_T *sdh, uint32_t ucCmd, uint32_t uArg) -{ - volatile uint32_t buf; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - sdh->CMDARG = uArg; - buf = (sdh->CTL & (~SDH_CTL_CMDCODE_Msk)) | (ucCmd << 8ul) | - (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - - sdh->CTL = buf; - - while ((sdh->CTL & SDH_CTL_RIEN_Msk) == SDH_CTL_RIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - while ((sdh->CTL & SDH_CTL_DIEN_Msk) == SDH_CTL_DIEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) - { - /* check CRC7 */ - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) - { - /* check CRC16 */ - return SDH_CRC16_ERROR; - } - return 0ul; -} - -/* there are 8 bits for divider0, maximum is 256 */ -#define SDH_CLK_DIV0_MAX 256ul - -void SDH_Set_clock(SDH_T *sdh, uint32_t sd_clock_khz) -{ - UINT32 div; - uint32_t SDH_ReferenceClock; - - if (sd_clock_khz <= 2000) - { - SDH_ReferenceClock = 12000; - if (sdh == SDH0) - { - outpw(REG_CLK_DIVCTL9, (inpw(REG_CLK_DIVCTL9) & ~0x18) | (0x0 << 3)); // SD clock from XIN [4:3] - } - else - { - //fixme outpw(REG_CLK_DIVCTL9, (inpw(REG_CLK_DIVCTL9) & ~0x18) | (0x0 << 3)); // SD clock from XIN [4:3] - } - } - else - { - SDH_ReferenceClock = 300000; - if (sdh == SDH0) - { - outpw(REG_CLK_DIVCTL9, (inpw(REG_CLK_DIVCTL9) & ~0x18) | (0x3 << 3)); // SD clock from UPLL [4:3] - } - else - { - //fixme outpw(REG_CLK_DIVCTL9, (inpw(REG_CLK_DIVCTL9) & ~0x18) | (0x3 << 3)); // SD clock from UPLL [4:3] - } - } - div = (SDH_ReferenceClock / sd_clock_khz) - 1; - - if (div >= SDH_CLK_DIV0_MAX) - { - div = 0xff; - } - outpw(REG_CLK_DIVCTL9, (inpw(REG_CLK_DIVCTL9) & ~0xff00) | ((div) << 8)); // SD clock divided by CLKDIV3[SD_N] [15:8] -} - -uint32_t SDH_CardDetection(SDH_T *sdh) -{ - uint32_t i, val = TRUE; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - - if ((sdh->INTEN & SDH_INTEN_CDSRC_Msk) == SDH_INTEN_CDSRC_Msk) /* Card detect pin from GPIO */ - { - if ((sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) == SDH_INTSTS_CDSTS_Msk) /* Card remove */ - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - else - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - } - else if ((sdh->INTEN & SDH_INTEN_CDSRC_Msk) != SDH_INTEN_CDSRC_Msk) - { - sdh->CTL |= SDH_CTL_CLKKEEP_Msk; - for (i = 0ul; i < 5000ul; i++) - { - } - - if ((sdh->INTSTS & SDH_INTSTS_CDSTS_Msk) == SDH_INTSTS_CDSTS_Msk) /* Card insert */ - { - pSD->IsCardInsert = (uint8_t)TRUE; - } - else - { - pSD->IsCardInsert = (uint8_t)FALSE; - val = FALSE; - } - - sdh->CTL &= ~SDH_CTL_CLKKEEP_Msk; - } - - return val; -} - -uint32_t SDH_Init(SDH_T *sdh) -{ - uint32_t volatile i, status; - uint32_t resp; - uint32_t CIDBuffer[4]; - uint32_t volatile u32CmdTimeOut; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - /* set the clock to 300KHz */ - SDH_Set_clock(sdh, 300ul); - - /* power ON 74 clock */ - sdh->CTL |= SDH_CTL_CLK74OEN_Msk; - - while ((sdh->CTL & SDH_CTL_CLK74OEN_Msk) == SDH_CTL_CLK74OEN_Msk) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - SDH_SDCommand(sdh, 0ul, 0ul); /* reset all cards */ - for (i = 0x1000ul; i > 0ul; i--) - { - } - - /* initial SDHC */ - pSD->R7Flag = 1ul; - u32CmdTimeOut = 0xFFFFFul; - - i = SDH_SDCmdAndRsp(sdh, 8ul, 0x00000155ul, u32CmdTimeOut); - if (i == Successful) - { - /* SD 2.0 */ - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 2.7v-3.6v */ - resp = sdh->RESP0; - - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x40ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - } - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_SD_HIGH; - } - else - { - pSD->CardType = SDH_TYPE_SD_LOW; - } - } - else - { - /* SD 1.1 */ - SDH_SDCommand(sdh, 0ul, 0ul); /* reset all cards */ - for (i = 0x100ul; i > 0ul; i--) - { - } - - i = SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - if (i == 2ul) /* MMC memory */ - { - - SDH_SDCommand(sdh, 0ul, 0ul); /* reset */ - for (i = 0x100ul; i > 0ul; i--) - { - } - - pSD->R3Flag = 1ul; - - if (SDH_SDCmdAndRsp(sdh, 1ul, 0x40ff8000ul, u32CmdTimeOut) != 2ul) /* eMMC memory */ - { - resp = sdh->RESP0; - while ((resp & 0x00800000ul) != 0x00800000ul) - { - /* check if card is ready */ - pSD->R3Flag = 1ul; - - SDH_SDCmdAndRsp(sdh, 1ul, 0x40ff8000ul, u32CmdTimeOut); /* high voltage */ - resp = sdh->RESP0; - } - - if ((resp & 0x00400000ul) == 0x00400000ul) - { - pSD->CardType = SDH_TYPE_EMMC; - } - else - { - pSD->CardType = SDH_TYPE_MMC; - } - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_ERR_DEVICE; - } - } - else if (i == 0ul) /* SD Memory */ - { - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - while ((resp & 0x00800000ul) != 0x00800000ul) /* check if card is ready */ - { - SDH_SDCmdAndRsp(sdh, 55ul, 0x00ul, u32CmdTimeOut); - pSD->R3Flag = 1ul; - SDH_SDCmdAndRsp(sdh, 41ul, 0x00ff8000ul, u32CmdTimeOut); /* 3.0v-3.4v */ - resp = sdh->RESP0; - } - pSD->CardType = SDH_TYPE_SD_LOW; - } - else - { - pSD->CardType = SDH_TYPE_UNKNOWN; - return SDH_INIT_ERROR; - } - } - - if (pSD->CardType != SDH_TYPE_UNKNOWN) - { - SDH_SDCmdAndRsp2(sdh, 2ul, 0x00ul, CIDBuffer); - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - if ((status = SDH_SDCmdAndRsp(sdh, 3ul, 0x10000ul, 0ul)) != Successful) /* set RCA */ - { - return status; - } - pSD->RCA = 0x10000ul; - } - else - { - if ((status = SDH_SDCmdAndRsp(sdh, 3ul, 0x00ul, 0ul)) != Successful) /* get RCA */ - { - return status; - } - else - { - pSD->RCA = (sdh->RESP0 << 8) & 0xffff0000; - } - } - } - return Successful; -} - - -uint32_t SDH_SwitchToHighSpeed(SDH_T *sdh, SDH_INFO_T *pSD) -{ - uint32_t volatile status = 0ul; - uint16_t current_comsumption, busy_status0; - - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; - - if ((status = SDH_SDCmdAndRspDataIn(sdh, 6ul, 0x00ffff01ul)) != Successful) - { - return Fail; - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - busy_status0 = (uint16_t)(*(pSD->dmabuf + 28)) << 8; - busy_status0 |= (uint16_t)(*(pSD->dmabuf + 29)); - - if (!busy_status0) /* function ready */ - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 63ul; /* 512 bit */ - - if ((status = SDH_SDCmdAndRspDataIn(sdh, 6ul, 0x80ffff01ul)) != Successful) - { - return Fail; - } - - /* function change timing: 8 clocks */ - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - current_comsumption = (uint16_t)(*pSD->dmabuf) << 8; - current_comsumption |= (uint16_t)(*(pSD->dmabuf + 1)); - if (!current_comsumption) - { - return Fail; - } - - return Successful; - } - else - { - return Fail; - } -} - - -uint32_t SDH_SelectCardType(SDH_T *sdh) -{ - uint32_t volatile status = 0ul; - uint32_t param; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* if SD card set 4bit */ - if (pSD->CardType == SDH_TYPE_SD_HIGH) - { - sdh->DMASA = (uint32_t)pSD->dmabuf; - sdh->BLEN = 0x07ul; /* 64 bit */ - sdh->DMACTL |= SDH_DMACTL_DMARST_Msk; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == 0x2); - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, 51ul, 0x00ul)) != Successful) - { - return status; - } - - if ((*pSD->dmabuf & 0xful) == 0x2ul) - { - status = SDH_SwitchToHighSpeed(sdh, pSD); - if (status == Successful) - { - /* divider */ - SDH_Set_clock(sdh, SDHC_FREQ); - } - } - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, 0x02ul, 0ul)) != Successful) /* set bus width */ - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if (pSD->CardType == SDH_TYPE_SD_LOW) - { - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 0x07ul; - - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - if ((status = SDH_SDCmdAndRspDataIn(sdh, 51ul, 0x00ul)) != Successful) - { - return status; - } - - /* set data bus width. ACMD6 for SD card, SDCR_DBW for host. */ - if ((status = SDH_SDCmdAndRsp(sdh, 55ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, 0x02ul, 0ul)) != Successful) - { - return status; - } - - sdh->CTL |= SDH_CTL_DBW_Msk; - } - else if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - - if (pSD->CardType == SDH_TYPE_MMC) - { - sdh->CTL &= ~SDH_CTL_DBW_Msk; - } - - /*--- sent CMD6 to MMC card to set bus width to 4 bits mode */ - /* set CMD6 argument Access field to 3, Index to 183, Value to 1 (4-bit mode) */ - param = (3ul << 24) | (183ul << 16) | (1ul << 8); - if ((status = SDH_SDCmdAndRsp(sdh, 6ul, param, 0ul)) != Successful) - { - return status; - } - SDH_CheckRB(sdh); - - sdh->CTL |= SDH_CTL_DBW_Msk; /* set bus width to 4-bit mode for SD host controller */ - - } - - if ((status = SDH_SDCmdAndRsp(sdh, 16ul, SDH_BLOCK_SIZE, 0ul)) != Successful) - { - return status; - } - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - sdh->INTEN |= SDH_INTEN_BLKDIEN_Msk; - - return Successful; -} - -void SDH_Get_SD_info(SDH_T *sdh) -{ - unsigned int R_LEN, C_Size, MULT, size; - uint32_t Buffer[4]; - //unsigned char *ptr; - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - SDH_SDCmdAndRsp2(sdh, 9ul, pSD->RCA, Buffer); - - if ((pSD->CardType == SDH_TYPE_MMC) || (pSD->CardType == SDH_TYPE_EMMC)) - { - /* for MMC/eMMC card */ - if ((Buffer[0] & 0xc0000000) == 0xc0000000) - { - /* CSD_STRUCTURE [127:126] is 3 */ - /* CSD version depend on EXT_CSD register in eMMC v4.4 for card size > 2GB */ - SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul); - - //ptr = (uint8_t *)((uint32_t)_SDH_ucSDHCBuffer ); - sdh->DMASA = (uint32_t)pSD->dmabuf;; - sdh->BLEN = 511ul; /* read 512 bytes for EXT_CSD */ - - if (SDH_SDCmdAndRspDataIn(sdh, 8ul, 0x00ul) == Successful) - { - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - pSD->totalSectorN = (uint32_t)(*(pSD->dmabuf + 215)) << 24; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 214)) << 16; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 213)) << 8; - pSD->totalSectorN |= (uint32_t)(*(pSD->dmabuf + 212)); - pSD->diskSize = pSD->totalSectorN / 2ul; - } - } - else - { - /* CSD version v1.0/1.1/1.2 in eMMC v4.4 spec for card size <= 2GB */ - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size + 1ul) * (1ul << (MULT + 2ul)) * (1ul << R_LEN); - - pSD->diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - else - { - if ((Buffer[0] & 0xc0000000) != 0x0ul) - { - C_Size = ((Buffer[1] & 0x0000003ful) << 16) | ((Buffer[2] & 0xffff0000ul) >> 16); - size = (C_Size + 1ul) * 512ul; /* Kbytes */ - - pSD->diskSize = size; - pSD->totalSectorN = size << 1; - } - else - { - R_LEN = (Buffer[1] & 0x000f0000ul) >> 16; - C_Size = ((Buffer[1] & 0x000003fful) << 2) | ((Buffer[2] & 0xc0000000ul) >> 30); - MULT = (Buffer[2] & 0x00038000ul) >> 15; - size = (C_Size + 1ul) * (1ul << (MULT + 2ul)) * (1ul << R_LEN); - - pSD->diskSize = size / 1024ul; - pSD->totalSectorN = size / 512ul; - } - } - pSD->sectorSize = (int)512; -// printf("The size is %d KB\n", pSD->diskSize); -} - -/** @endcond HIDDEN_SYMBOLS */ - - -/** - * @brief This function use to reset SD function and select card detection source and pin. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] u32CardDetSrc Select card detection pin from GPIO or DAT3 pin. ( \ref CardDetect_From_GPIO / \ref CardDetect_From_DAT3) - * - * @return None - */ -void SDH_Open(SDH_T *sdh, uint32_t u32CardDetSrc) -{ - volatile int i; - sdh->DMACTL = SDH_DMACTL_DMARST_Msk; - while ((sdh->DMACTL & SDH_DMACTL_DMARST_Msk) == SDH_DMACTL_DMARST_Msk) - { - } - - sdh->DMACTL = SDH_DMACTL_DMAEN_Msk; - - sdh->GCTL = SDH_GCTL_GCTLRST_Msk | SDH_GCTL_SDEN_Msk; - while ((sdh->GCTL & SDH_GCTL_GCTLRST_Msk) == SDH_GCTL_GCTLRST_Msk) - { - } - - if (sdh == SDH0) - { - memset(&SD0, 0, sizeof(SDH_INFO_T)); - SD0.dmabuf = (unsigned char *)((uint32_t)_SDH0_ucSDHCBuffer | 0x80000000); - } - else if (sdh == SDH1) - { - memset(&SD1, 0, sizeof(SDH_INFO_T)); - SD1.dmabuf = (unsigned char *)((uint32_t)_SDH1_ucSDHCBuffer | 0x80000000); - } - else - { - } - - sdh->GCTL = SDH_GCTL_SDEN_Msk; - - if ((u32CardDetSrc & CardDetect_From_DAT3) == CardDetect_From_DAT3) - { - sdh->INTEN &= ~SDH_INTEN_CDSRC_Msk; - } - else - { - sdh->INTEN |= SDH_INTEN_CDSRC_Msk; - } - for (i = 0; i < 0x100; i++); - sdh->INTSTS = SDH_INTSTS_CDIF_Msk; - sdh->INTEN |= SDH_INTEN_CDIEN_Msk; - - sdh->CTL |= SDH_CTL_CTLRST_Msk; - while ((sdh->CTL & SDH_CTL_CTLRST_Msk) == SDH_CTL_CTLRST_Msk) - { - } -} - -/** - * @brief This function use to initial SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * - * @return None - * - * @details This function is used to initial SD card. - * SD initial state needs 400KHz clock output, driver will use HIRC for SD initial clock source. - * And then switch back to the user's setting. - */ -uint32_t SDH_Probe(SDH_T *sdh) -{ - uint32_t val; - - sdh->GINTEN = 0ul; - sdh->CTL &= ~SDH_CTL_SDNWR_Msk; - sdh->CTL |= 0x09ul << SDH_CTL_SDNWR_Pos; /* set SDNWR = 9 */ - sdh->CTL &= ~SDH_CTL_BLKCNT_Msk; - sdh->CTL |= 0x01ul << SDH_CTL_BLKCNT_Pos; /* set BLKCNT = 1 */ - sdh->CTL &= ~SDH_CTL_DBW_Msk; /* SD 1-bit data bus */ - - if (!(SDH_CardDetection(sdh))) - { - return SDH_NO_SD_CARD; - } - - if ((val = SDH_Init(sdh)) != 0ul) - { - return val; - } - - /* divider */ - if ((SD0.CardType == SDH_TYPE_MMC) || (SD1.CardType == SDH_TYPE_MMC)) - { - SDH_Set_clock(sdh, MMC_FREQ); - } - else - { - SDH_Set_clock(sdh, SD_FREQ); - } - SDH_Get_SD_info(sdh); - - if ((val = SDH_SelectCardType(sdh)) != 0ul) - { - return val; - } - - return 0ul; -} - -/** - * @brief This function use to read data from SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[out] pu8BufAddr The buffer to receive the data from SD card. - * @param[in] u32StartSec The start read sector address. - * @param[in] u32SecCount The the read sector number of data - * - * @return None - */ -uint32_t SDH_Read(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE, buf; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - uint32_t blksize = SDH_BLOCK_SIZE; - - SDH_INFO_T *pSD; - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - SDH_CheckRB(sdh); - - sdh->BLEN = blksize - 1ul; /* the actual byte count is equal to (SDBLEN+1) */ - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * blksize; - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - - loop = u32SecCount / 255ul; - for (i = 0ul; i < loop; i++) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & ~SDH_CTL_CMDCODE_Msk; - reg = reg | 0xff0000ul; /* set BLK_CNT to 255 */ - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg | (18ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->DataReadyFlag) - { - break; - } - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & (~SDH_CTL_CMDCODE_Msk); - reg = reg & (~SDH_CTL_BLKCNT_Msk); - reg |= (loop << 16); /* setup SDCR_BLKCNT */ - - if (bIsSendCmd == FALSE) - { - sdh->CTL = reg | (18ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DIEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DIEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC7_Msk) != SDH_INTSTS_CRC7_Msk) /* check CRC7 */ - { - return SDH_CRC7_ERROR; - } - - if ((sdh->INTSTS & SDH_INTSTS_CRC16_Msk) != SDH_INTSTS_CRC16_Msk) /* check CRC16 */ - { - return SDH_CRC16_ERROR; - } - } - - if (SDH_SDCmdAndRsp(sdh, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - return Successful; -} - - -/** - * @brief This function use to write data to SD card. - * - * @param[in] sdh Select SDH0 or SDH1. - * @param[in] pu8BufAddr The buffer to send the data to SD card. - * @param[in] u32StartSec The start write sector address. - * @param[in] u32SecCount The the write sector number of data. - * - * @return \ref SDH_SELECT_ERROR : u32SecCount is zero. \n - * \ref SDH_NO_SD_CARD : SD card be removed. \n - * \ref SDH_CRC_ERROR : CRC error happen. \n - * \ref SDH_CRC7_ERROR : CRC7 error happen. \n - * \ref Successful : Write data to SD card success. - */ -uint32_t SDH_Write(SDH_T *sdh, uint8_t *pu8BufAddr, uint32_t u32StartSec, uint32_t u32SecCount) -{ - uint32_t volatile bIsSendCmd = FALSE; - uint32_t volatile reg; - uint32_t volatile i, loop, status; - - SDH_INFO_T *pSD; - - if (sdh == SDH0) - { - pSD = &SD0; - } - else - { - pSD = &SD1; - } - - if (u32SecCount == 0ul) - { - return SDH_SELECT_ERROR; - } - - if ((status = SDH_SDCmdAndRsp(sdh, 7ul, pSD->RCA, 0ul)) != Successful) - { - return status; - } - - SDH_CheckRB(sdh); - - /* According to SD Spec v2.0, the write CMD block size MUST be 512, and the start address MUST be 512*n. */ - sdh->BLEN = SDH_BLOCK_SIZE - 1ul; - - if ((pSD->CardType == SDH_TYPE_SD_HIGH) || (pSD->CardType == SDH_TYPE_EMMC)) - { - sdh->CMDARG = u32StartSec; - } - else - { - sdh->CMDARG = u32StartSec * SDH_BLOCK_SIZE; /* set start address for SD CMD */ - } - - sdh->DMASA = (uint32_t)pu8BufAddr; - loop = u32SecCount / 255ul; /* the maximum block count is 0xFF=255 for register SDCR[BLK_CNT] */ - for (i = 0ul; i < loop; i++) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = sdh->CTL & 0xff00c080; - reg = reg | 0xff0000ul; /* set BLK_CNT to 0xFF=255 */ - if (!bIsSendCmd) - { - sdh->CTL = reg | (25ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - - loop = u32SecCount % 255ul; - if (loop != 0ul) - { - pSD->DataReadyFlag = (uint8_t)FALSE; - reg = (sdh->CTL & 0xff00c080) | (loop << 16); - if (!bIsSendCmd) - { - sdh->CTL = reg | (25ul << 8) | (SDH_CTL_COEN_Msk | SDH_CTL_RIEN_Msk | SDH_CTL_DOEN_Msk); - bIsSendCmd = TRUE; - } - else - { - sdh->CTL = reg | SDH_CTL_DOEN_Msk; - } - - while (!pSD->DataReadyFlag) - { - if (pSD->IsCardInsert == FALSE) - { - return SDH_NO_SD_CARD; - } - } - - if ((sdh->INTSTS & SDH_INTSTS_CRCIF_Msk) != 0ul) - { - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - return SDH_CRC_ERROR; - } - } - sdh->INTSTS = SDH_INTSTS_CRCIF_Msk; - - if (SDH_SDCmdAndRsp(sdh, 12ul, 0ul, 0ul)) /* stop command */ - { - return SDH_CRC7_ERROR; - } - SDH_CheckRB(sdh); - - SDH_SDCommand(sdh, 7ul, 0ul); - sdh->CTL |= SDH_CTL_CLK8OEN_Msk; - while ((sdh->CTL & SDH_CTL_CLK8OEN_Msk) == SDH_CTL_CLK8OEN_Msk) - { - } - - return Successful; -} - -/*@}*/ /* end of group SDH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SDH_Driver */ - -/*@}*/ /* end of group Device_Driver */ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_spi.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_spi.c deleted file mode 100644 index 8ffbc32805e..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_spi.c +++ /dev/null @@ -1,603 +0,0 @@ -/**************************************************************************//** - * @file spi.c - * @brief NUC980 series SPI driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nuc980.h" -#include "nu_spi.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SPI_Driver SPI Driver - @{ -*/ - - -/** @addtogroup SPI_EXPORTED_FUNCTIONS SPI Exported Functions - @{ -*/ - -/** - * @brief This function make SPI module be ready to transfer. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32MasterSlave Decides the SPI module is operating in master mode or in slave mode. (SPI_SLAVE, SPI_MASTER) - * @param[in] u32SPIMode Decides the transfer timing. (SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3) - * @param[in] u32DataWidth Decides the data width of a SPI transaction. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI peripheral clock. - * @details By default, the SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic - * slave selection function is disabled. - * In Slave mode, the u32BusClock shall be NULL and the SPI clock divider setting will be 0. - * The actual clock rate may be different from the target SPI clock rate. - * For example, if the SPI source clock rate is 12 MHz and the target SPI bus clock rate is 7 MHz, the - * actual SPI clock rate will be 6MHz. - * @note If u32BusClock = 0, DIVIDER setting will be set to the maximum value. - * @note If u32BusClock >= system clock frequency, SPI peripheral clock source will be set to APB clock and DIVIDER will be set to 0. - * @note If u32BusClock >= SPI peripheral clock source, DIVIDER will be set to 0. - * @note In slave mode, the SPI peripheral clock rate will be equal to APB clock rate. - */ -uint32_t SPI_Open(SPI_T *spi, - uint32_t u32MasterSlave, - uint32_t u32SPIMode, - uint32_t u32DataWidth, - uint32_t u32BusClock) -{ - uint32_t u32RetValue = 0U; - - if (u32DataWidth == 32U) - { - u32DataWidth = 0U; - } - - if (u32MasterSlave == SPI_MASTER) - { - /* Default setting: slave selection signal is active low; disable automatic slave selection function. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - /* Set DIVIDER */ - spi->CLKDIV = (150000000U / u32BusClock) - 1U; - } - else /* For slave mode, force the SPI peripheral clock rate to equal APB clock rate. */ - { - /* Default setting: slave selection signal is low level active. */ - spi->SSCTL = SPI_SS_ACTIVE_LOW; - - /* Default setting: MSB first, disable unit transfer interrupt, SP_CYCLE = 0. */ - spi->CTL = u32MasterSlave | (u32DataWidth << SPI_CTL_DWIDTH_Pos) | (u32SPIMode) | SPI_CTL_SPIEN_Msk; - - /* Set DIVIDER = 1, let slave runs at PCLK/2 = 75MHz */ - spi->CLKDIV = 1U; - } - - return u32RetValue; -} - -/** - * @brief Disable SPI controller. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will reset SPI controller. - */ -void SPI_Close(SPI_T *spi) -{ - if (spi == SPI0) - { - /* Reset SPI */ - } - else - { - /* Reset SPI */ - } -} - -/** - * @brief Clear RX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI RX FIFO buffer. The RXEMPTY (SPI_STATUS[8]) will be set to 1. - */ -void SPI_ClearRxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_RXFBCLR_Msk; -} - -/** - * @brief Clear TX FIFO buffer. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will clear SPI TX FIFO buffer. The TXEMPTY (SPI_STATUS[16]) will be set to 1. - * @note The TX shift register will not be cleared. - */ -void SPI_ClearTxFIFO(SPI_T *spi) -{ - spi->FIFOCTL |= SPI_FIFOCTL_TXFBCLR_Msk; -} - -/** - * @brief Disable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @return None - * @details This function will disable the automatic slave selection function and set slave selection signal to inactive state. - */ -void SPI_DisableAutoSS(SPI_T *spi) -{ - spi->SSCTL &= ~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SS_Msk); -} - -/** - * @brief Enable the automatic slave selection function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32SSPinMask Specifies slave selection pins. (SPI_SS) - * @param[in] u32ActiveLevel Specifies the active level of slave selection signal. (SPI_SS_ACTIVE_HIGH, SPI_SS_ACTIVE_LOW) - * @return None - * @details This function will enable the automatic slave selection function. Only available in Master mode. - * The slave selection pin and the active level will be set in this function. - */ -void SPI_EnableAutoSS(SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) -{ - spi->SSCTL = (spi->SSCTL & (~(SPI_SSCTL_AUTOSS_Msk | SPI_SSCTL_SSACTPOL_Msk | SPI_SSCTL_SS_Msk))) | (u32SSPinMask | u32ActiveLevel | SPI_SSCTL_AUTOSS_Msk); -} - -/** - * @brief Configure FIFO threshold setting. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32TxThreshold Decides the TX FIFO threshold. It could be 0 ~ 3. - * @param[in] u32RxThreshold Decides the RX FIFO threshold. It could be 0 ~ 3. - * @return None - * @details Set TX FIFO threshold and RX FIFO threshold configurations. - */ -void SPI_SetFIFO(SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) -{ - spi->FIFOCTL = (spi->FIFOCTL & ~(SPI_FIFOCTL_TXTH_Msk | SPI_FIFOCTL_RXTH_Msk)) | - (u32TxThreshold << SPI_FIFOCTL_TXTH_Pos) | - (u32RxThreshold << SPI_FIFOCTL_RXTH_Pos); -} - -/** - * @brief Get the actual frequency of SPI bus clock. Only available in Master mode. - * @param[in] spi The pointer of the specified SPI module. - * @return Actual SPI bus clock frequency in Hz. - * @details This function will calculate the actual SPI bus clock rate according to the SPInSEL and DIVIDER settings. Only available in Master mode. - */ -uint32_t SPI_GetBusClock(SPI_T *spi) -{ - return 0; -} - -/** - * @brief Set the SPI bus clock. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32BusClock The expected frequency of SPI bus clock in Hz. - * @return Actual frequency of SPI bus clock. - */ -uint32_t SPI_SetBusClock(SPI_T *spi, uint32_t u32BusClock) -{ - /* Set DIVIDER */ - if (spi->CTL & SPI_CTL_SLAVE_Msk) //Slave - spi->CLKDIV = 1; - else //Master - spi->CLKDIV = (150000000U / u32BusClock) - 1U; - - return SPI_GetBusClock(spi); -} - - -/** - * @brief Enable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt enable bit. - * This parameter decides which interrupts will be enabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Enable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_EnableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Enable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL |= SPI_CTL_UNITIEN_Msk; - } - - /* Enable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSACTIEN_Msk; - } - - /* Enable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SSINAIEN_Msk; - } - - /* Enable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVURIEN_Msk; - } - - /* Enable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL |= SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Enable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Enable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Enable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Enable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Enable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL |= SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Disable interrupt function. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt enable bits. - * Each bit corresponds to a interrupt bit. - * This parameter decides which interrupts will be disabled. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Disable SPI related interrupts specified by u32Mask parameter. - */ -void SPI_DisableInt(SPI_T *spi, uint32_t u32Mask) -{ - /* Disable unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) == SPI_UNIT_INT_MASK) - { - spi->CTL &= ~SPI_CTL_UNITIEN_Msk; - } - - /* Disable slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) == SPI_SSACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSACTIEN_Msk; - } - - /* Disable slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) == SPI_SSINACT_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SSINAIEN_Msk; - } - - /* Disable slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) == SPI_SLVUR_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVURIEN_Msk; - } - - /* Disable slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) == SPI_SLVBE_INT_MASK) - { - spi->SSCTL &= ~SPI_SSCTL_SLVBEIEN_Msk; - } - - /* Disable slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) == SPI_TXUF_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXUFIEN_Msk; - } - - /* Disable TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) == SPI_FIFO_TXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_TXTHIEN_Msk; - } - - /* Disable RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) == SPI_FIFO_RXTH_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTHIEN_Msk; - } - - /* Disable RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) == SPI_FIFO_RXOV_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXOVIEN_Msk; - } - - /* Disable RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) == SPI_FIFO_RXTO_INT_MASK) - { - spi->FIFOCTL &= ~SPI_FIFOCTL_RXTOIEN_Msk; - } -} - -/** - * @brief Get interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be read. It is combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_TXTH_INT_MASK - * - \ref SPI_FIFO_RXTH_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return Interrupt flags of selected sources. - * @details Get SPI related interrupt flags specified by u32Mask parameter. - */ -uint32_t SPI_GetIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32IntFlag = 0U, u32TmpVal; - - u32TmpVal = spi->STATUS & SPI_STATUS_UNITIF_Msk; - /* Check unit transfer interrupt flag */ - if ((u32Mask & SPI_UNIT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_UNIT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSACTIF_Msk; - /* Check slave selection signal active interrupt flag */ - if ((u32Mask & SPI_SSACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SSINAIF_Msk; - /* Check slave selection signal inactive interrupt flag */ - if ((u32Mask & SPI_SSINACT_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SSINACT_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVURIF_Msk; - /* Check slave TX under run interrupt flag */ - if ((u32Mask & SPI_SLVUR_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVUR_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_SLVBEIF_Msk; - /* Check slave bit count error interrupt flag */ - if ((u32Mask & SPI_SLVBE_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_SLVBE_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXUFIF_Msk; - /* Check slave TX underflow interrupt flag */ - if ((u32Mask & SPI_TXUF_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_TXUF_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_TXTHIF_Msk; - /* Check TX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_TXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_TXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTHIF_Msk; - /* Check RX threshold interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTH_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTH_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXOVIF_Msk; - /* Check RX overrun interrupt flag */ - if ((u32Mask & SPI_FIFO_RXOV_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXOV_INT_MASK; - } - - u32TmpVal = spi->STATUS & SPI_STATUS_RXTOIF_Msk; - /* Check RX time-out interrupt flag */ - if ((u32Mask & SPI_FIFO_RXTO_INT_MASK) && (u32TmpVal)) - { - u32IntFlag |= SPI_FIFO_RXTO_INT_MASK; - } - - return u32IntFlag; -} - -/** - * @brief Clear interrupt flag. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related interrupt sources. - * Each bit corresponds to a interrupt source. - * This parameter decides which interrupt flags will be cleared. It could be the combination of: - * - \ref SPI_UNIT_INT_MASK - * - \ref SPI_SSACT_INT_MASK - * - \ref SPI_SSINACT_INT_MASK - * - \ref SPI_SLVUR_INT_MASK - * - \ref SPI_SLVBE_INT_MASK - * - \ref SPI_TXUF_INT_MASK - * - \ref SPI_FIFO_RXOV_INT_MASK - * - \ref SPI_FIFO_RXTO_INT_MASK - * - * @return None - * @details Clear SPI related interrupt flags specified by u32Mask parameter. - */ -void SPI_ClearIntFlag(SPI_T *spi, uint32_t u32Mask) -{ - if (u32Mask & SPI_UNIT_INT_MASK) - { - spi->STATUS = SPI_STATUS_UNITIF_Msk; /* Clear unit transfer interrupt flag */ - } - - if (u32Mask & SPI_SSACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSACTIF_Msk; /* Clear slave selection signal active interrupt flag */ - } - - if (u32Mask & SPI_SSINACT_INT_MASK) - { - spi->STATUS = SPI_STATUS_SSINAIF_Msk; /* Clear slave selection signal inactive interrupt flag */ - } - - if (u32Mask & SPI_SLVUR_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVURIF_Msk; /* Clear slave TX under run interrupt flag */ - } - - if (u32Mask & SPI_SLVBE_INT_MASK) - { - spi->STATUS = SPI_STATUS_SLVBEIF_Msk; /* Clear slave bit count error interrupt flag */ - } - - if (u32Mask & SPI_TXUF_INT_MASK) - { - spi->STATUS = SPI_STATUS_TXUFIF_Msk; /* Clear slave TX underflow interrupt flag */ - } - - if (u32Mask & SPI_FIFO_RXOV_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXOVIF_Msk; /* Clear RX overrun interrupt flag */ - } - - if (u32Mask & SPI_FIFO_RXTO_INT_MASK) - { - spi->STATUS = SPI_STATUS_RXTOIF_Msk; /* Clear RX time-out interrupt flag */ - } -} - -/** - * @brief Get SPI status. - * @param[in] spi The pointer of the specified SPI module. - * @param[in] u32Mask The combination of all related sources. - * Each bit corresponds to a source. - * This parameter decides which flags will be read. It is combination of: - * - \ref SPI_BUSY_MASK - * - \ref SPI_RX_EMPTY_MASK - * - \ref SPI_RX_FULL_MASK - * - \ref SPI_TX_EMPTY_MASK - * - \ref SPI_TX_FULL_MASK - * - \ref SPI_TXRX_RESET_MASK - * - \ref SPI_SPIEN_STS_MASK - * - \ref SPI_SSLINE_STS_MASK - * - * @return Flags of selected sources. - * @details Get SPI related status specified by u32Mask parameter. - */ -uint32_t SPI_GetStatus(SPI_T *spi, uint32_t u32Mask) -{ - uint32_t u32Flag = 0U, u32TmpValue; - - u32TmpValue = spi->STATUS & SPI_STATUS_BUSY_Msk; - /* Check busy status */ - if ((u32Mask & SPI_BUSY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_BUSY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXEMPTY_Msk; - /* Check RX empty flag */ - if ((u32Mask & SPI_RX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_RXFULL_Msk; - /* Check RX full flag */ - if ((u32Mask & SPI_RX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_RX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXEMPTY_Msk; - /* Check TX empty flag */ - if ((u32Mask & SPI_TX_EMPTY_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_EMPTY_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXFULL_Msk; - /* Check TX full flag */ - if ((u32Mask & SPI_TX_FULL_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TX_FULL_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_TXRXRST_Msk; - /* Check TX/RX reset flag */ - if ((u32Mask & SPI_TXRX_RESET_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_TXRX_RESET_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SPIENSTS_Msk; - /* Check SPIEN flag */ - if ((u32Mask & SPI_SPIEN_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SPIEN_STS_MASK; - } - - u32TmpValue = spi->STATUS & SPI_STATUS_SSLINE_Msk; - /* Check SPIx_SS line status */ - if ((u32Mask & SPI_SSLINE_STS_MASK) && (u32TmpValue)) - { - u32Flag |= SPI_SSLINE_STS_MASK; - } - - return u32Flag; -} - -/*@}*/ /* end of group SPI_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SPI_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sys.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sys.c deleted file mode 100644 index 97259b1c8c4..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_sys.c +++ /dev/null @@ -1,723 +0,0 @@ -/**************************************************************************//** - * @file sys.c - * @brief SYS driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ -#include -#include "nuc980.h" -#include "nu_sys.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup SYS_Driver SYS Driver - @{ -*/ - -/** @addtogroup SYS_EXPORTED_CONSTANTS SYS Exported Constants - @{ -*/ - -/// @cond HIDDEN_SYMBOLS - -#define SYS_MIN_INT_SOURCE 1 -#define SYS_MAX_INT_SOURCE 63 -#define SYS_NUM_OF_AICREG 16 - -/* Global variables */ -UINT32 volatile _sys_bIsAICInitial = 0x0; - -/* declaration the function prototype */ -void SYS_IRQ_Shell(void); -void SYS_FIQ_Shell(void); - -/* Interrupt Handler Table */ -//typedef void (*sys_pvFunPtr)(); /* function pointer */ -sys_pvFunPtr sysIrqHandlerTable[] = { 0, /* 0 */ - SYS_IRQ_Shell, /* 1 */ - SYS_IRQ_Shell, /* 2 */ - SYS_IRQ_Shell, /* 3 */ - SYS_IRQ_Shell, /* 4 */ - SYS_IRQ_Shell, /* 5 */ - SYS_IRQ_Shell, /* 6 */ - SYS_IRQ_Shell, /* 7 */ - SYS_IRQ_Shell, /* 8 */ - SYS_IRQ_Shell, /* 9 */ - SYS_IRQ_Shell, /* 10 */ - SYS_IRQ_Shell, /* 11 */ - SYS_IRQ_Shell, /* 12 */ - SYS_IRQ_Shell, /* 13 */ - SYS_IRQ_Shell, /* 14 */ - SYS_IRQ_Shell, /* 15 */ - SYS_IRQ_Shell, /* 16 */ - SYS_IRQ_Shell, /* 17 */ - SYS_IRQ_Shell, /* 18 */ - SYS_IRQ_Shell, /* 19 */ - SYS_IRQ_Shell, /* 20 */ - SYS_IRQ_Shell, /* 21 */ - SYS_IRQ_Shell, /* 22 */ - SYS_IRQ_Shell, /* 23 */ - SYS_IRQ_Shell, /* 24 */ - SYS_IRQ_Shell, /* 25 */ - SYS_IRQ_Shell, /* 26 */ - SYS_IRQ_Shell, /* 27 */ - SYS_IRQ_Shell, /* 28 */ - SYS_IRQ_Shell, /* 29 */ - SYS_IRQ_Shell, /* 30 */ - SYS_IRQ_Shell, /* 31 */ - SYS_IRQ_Shell, /* 32 */ - SYS_IRQ_Shell, /* 33 */ - SYS_IRQ_Shell, /* 34 */ - SYS_IRQ_Shell, /* 35 */ - SYS_IRQ_Shell, /* 36 */ - SYS_IRQ_Shell, /* 37 */ - SYS_IRQ_Shell, /* 38 */ - SYS_IRQ_Shell, /* 39 */ - SYS_IRQ_Shell, /* 40 */ - SYS_IRQ_Shell, /* 41 */ - SYS_IRQ_Shell, /* 42 */ - SYS_IRQ_Shell, /* 43 */ - SYS_IRQ_Shell, /* 44 */ - SYS_IRQ_Shell, /* 45 */ - SYS_IRQ_Shell, /* 46 */ - SYS_IRQ_Shell, /* 47 */ - SYS_IRQ_Shell, /* 48 */ - SYS_IRQ_Shell, /* 49 */ - SYS_IRQ_Shell, /* 50 */ - SYS_IRQ_Shell, /* 51 */ - SYS_IRQ_Shell, /* 52 */ - SYS_IRQ_Shell, /* 53 */ - SYS_IRQ_Shell, /* 54 */ - SYS_IRQ_Shell, /* 55 */ - SYS_IRQ_Shell, /* 56 */ - SYS_IRQ_Shell, /* 57 */ - SYS_IRQ_Shell, /* 58 */ - SYS_IRQ_Shell, /* 59 */ - SYS_IRQ_Shell, /* 60 */ - SYS_IRQ_Shell, /* 61 */ - SYS_IRQ_Shell, /* 62 */ - SYS_IRQ_Shell /* 63 */ - }; - -sys_pvFunPtr sysFiqHandlerTable[] = { 0, - SYS_FIQ_Shell, /* 1 */ - SYS_FIQ_Shell, /* 2 */ - SYS_FIQ_Shell, /* 3 */ - SYS_FIQ_Shell, /* 4 */ - SYS_FIQ_Shell, /* 5 */ - SYS_FIQ_Shell, /* 6 */ - SYS_FIQ_Shell, /* 7 */ - SYS_FIQ_Shell, /* 8 */ - SYS_FIQ_Shell, /* 9 */ - SYS_FIQ_Shell, /* 10 */ - SYS_FIQ_Shell, /* 11 */ - SYS_FIQ_Shell, /* 12 */ - SYS_FIQ_Shell, /* 13 */ - SYS_FIQ_Shell, /* 14 */ - SYS_FIQ_Shell, /* 15 */ - SYS_FIQ_Shell, /* 16 */ - SYS_FIQ_Shell, /* 17 */ - SYS_FIQ_Shell, /* 18 */ - SYS_FIQ_Shell, /* 19 */ - SYS_FIQ_Shell, /* 20 */ - SYS_FIQ_Shell, /* 21 */ - SYS_FIQ_Shell, /* 22 */ - SYS_FIQ_Shell, /* 23 */ - SYS_FIQ_Shell, /* 24 */ - SYS_FIQ_Shell, /* 25 */ - SYS_FIQ_Shell, /* 26 */ - SYS_FIQ_Shell, /* 27 */ - SYS_FIQ_Shell, /* 28 */ - SYS_FIQ_Shell, /* 29 */ - SYS_FIQ_Shell, /* 30 */ - SYS_FIQ_Shell, /* 31 */ - SYS_FIQ_Shell, /* 32 */ - SYS_FIQ_Shell, /* 33 */ - SYS_FIQ_Shell, /* 34 */ - SYS_FIQ_Shell, /* 35 */ - SYS_FIQ_Shell, /* 36 */ - SYS_FIQ_Shell, /* 37 */ - SYS_FIQ_Shell, /* 38 */ - SYS_FIQ_Shell, /* 39 */ - SYS_FIQ_Shell, /* 40 */ - SYS_FIQ_Shell, /* 41 */ - SYS_FIQ_Shell, /* 42 */ - SYS_FIQ_Shell, /* 43 */ - SYS_FIQ_Shell, /* 44 */ - SYS_FIQ_Shell, /* 45 */ - SYS_FIQ_Shell, /* 46 */ - SYS_FIQ_Shell, /* 47 */ - SYS_FIQ_Shell, /* 48 */ - SYS_FIQ_Shell, /* 49 */ - SYS_FIQ_Shell, /* 50 */ - SYS_FIQ_Shell, /* 51 */ - SYS_FIQ_Shell, /* 52 */ - SYS_FIQ_Shell, /* 53 */ - SYS_FIQ_Shell, /* 54 */ - SYS_FIQ_Shell, /* 55 */ - SYS_FIQ_Shell, /* 56 */ - SYS_FIQ_Shell, /* 57 */ - SYS_FIQ_Shell, /* 58 */ - SYS_FIQ_Shell, /* 59 */ - SYS_FIQ_Shell, /* 60 */ - SYS_FIQ_Shell, /* 61 */ - SYS_FIQ_Shell, /* 62 */ - SYS_FIQ_Shell /* 63 */ - }; - -/* Interrupt Handler */ -#if defined (__GNUC__) && !(__CC_ARM) - static void __attribute__((interrupt("IRQ"))) sysIrqHandler(void) -#else - __irq void sysIrqHandler() -#endif -{ - UINT32 volatile num; - - num = inpw(REG_AIC_IRQNUM); - if (num != 0) - (*sysIrqHandlerTable[num])(); - outpw(REG_AIC_EOIS, 1); -} - -#if defined (__GNUC__) && !(__CC_ARM) - static void __attribute__((interrupt("FIQ"))) sysFiqHandler(void) -#else - __irq void sysFiqHandler() -#endif -{ - UINT32 volatile num; - - num = inpw(REG_AIC_FIQNUM); - if (num != 0) - (*sysIrqHandlerTable[num])(); - outpw(REG_AIC_EOFS, 1); -} - -void SYS_IRQ_Shell(void) -{ - printf("ISR not found! ISNR=%d\n", inpw(REG_AIC_IRQNUM)); -} - -void SYS_FIQ_Shell(void) -{ - printf("ISR not found! ISNR=%d\n", inpw(REG_AIC_FIQNUM)); -} - -void sysInitializeAIC() -{ -#if defined (__GNUC__) && !(__CC_ARM) - *(unsigned int volatile *)0x34 = (unsigned int volatile)sysIrqHandler; - - *(unsigned int volatile *)0x38 = (unsigned int volatile)sysFiqHandler; -#else - *(unsigned int volatile *)0x38 = (unsigned int)sysIrqHandler; - - *(unsigned int volatile *)0x3C = (unsigned int)sysFiqHandler; -#endif -} -/// @endcond HIDDEN_SYMBOLS - -/*@}*/ /* end of group SYS_EXPORTED_CONSTANTS */ - -/** @addtogroup SYS_EXPORTED_FUNCTIONS SYS Exported Functions - @{ -*/ - -/// @cond HIDDEN_SYMBOLS - -/* Interrupt library functions */ -/** - * @brief system AIC - disable interrupt - * - * @param[in] eIntNo Select interrupt source. \ref IRQn_Type - * - * @return 0 - */ -INT32 sysDisableInterrupt(IRQn_Type eIntNo) -{ - if ((eIntNo > SYS_MAX_INT_SOURCE) || (eIntNo < SYS_MIN_INT_SOURCE)) - return Fail; - - if (eIntNo < 32) - outpw(REG_AIC_INTDIS0, (1 << eIntNo)); - else - outpw(REG_AIC_INTDIS1, (1 << (eIntNo - 32))); - - return Successful; -} - - -/** - * @brief system AIC - enable interrupt - * - * @param[in] eIntNo Select interrupt source. \ref IRQn_Type - * - * @return 0 - */ -INT32 sysEnableInterrupt(IRQn_Type eIntNo) -{ - if ((eIntNo > SYS_MAX_INT_SOURCE) || (eIntNo < SYS_MIN_INT_SOURCE)) - return Fail; - - if (eIntNo < 32) - outpw(REG_AIC_INTEN0, (1 << eIntNo)); - else - outpw(REG_AIC_INTEN1, (1 << (eIntNo - 32))); - - return Successful; -} - - -/** - * @brief system AIC - install exception handler - * - * @param[in] nExceptType exception type. ( \ref SYS_SWI / \ref SYS_D_ABORT / \ref SYS_I_ABORT / \ref SYS_UNDEFINE) - * @param[in] pvNewHandler own exception handler - * - * @return old handler - */ -PVOID sysInstallExceptionHandler(INT32 nExceptType, PVOID pvNewHandler) -{ - PVOID _mOldVect = NULL; - - switch (nExceptType) - { - case SYS_SWI: - _mOldVect = *(PVOID volatile *)0x28; - *(PVOID volatile *)0x28 = pvNewHandler; - break; - - case SYS_D_ABORT: - _mOldVect = *(PVOID volatile *)0x30; - *(PVOID volatile *)0x30 = pvNewHandler; - break; - - case SYS_I_ABORT: - _mOldVect = *(PVOID volatile *)0x2C; - *(PVOID volatile *)0x2C = pvNewHandler; - break; - - case SYS_UNDEFINE: - _mOldVect = *(PVOID volatile *)0x24; - *(PVOID volatile *)0x24 = pvNewHandler; - break; - - default: - ; - } - return _mOldVect; -} - -/** - * @brief system AIC - install FIQ handler - * - * @param[in] pvNewISR own fiq handler - * - * @return old handler - */ -PVOID sysInstallFiqHandler(PVOID pvNewISR) -{ - PVOID _mOldVect; - - _mOldVect = *(PVOID volatile *)0x3C; - *(PVOID volatile *)0x3C = pvNewISR; - return _mOldVect; -} - -/** - * @brief system AIC - install IRQ handler - * - * @param[in] pvNewISR own irq handler - * - * @return old handler - */ -PVOID sysInstallIrqHandler(PVOID pvNewISR) -{ - PVOID _mOldVect; - - _mOldVect = *(PVOID volatile *)0x38; - *(PVOID volatile *)0x38 = pvNewISR; - return _mOldVect; -} - - -/** - * @brief system AIC - install Own IRQ service routine - * - * @param[in] nIntTypeLevel Interrupt Level. ( \ref FIQ_LEVEL_0 / \ref IRQ_LEVEL_1 / \ref IRQ_LEVEL_2 / \ref IRQ_LEVEL_3 / - * \ref IRQ_LEVEL_4 / \ref IRQ_LEVEL_5 / \ref IRQ_LEVEL_6 / \ref IRQ_LEVEL_7 ) - * @param[in] eIntNo Interrupt number. \ref IRQn_Type - * @param[in] pvNewISR own IRQ handler - * - * @return old handler - */ -PVOID sysInstallISR(INT32 nIntTypeLevel, IRQn_Type eIntNo, PVOID pvNewISR) -{ - PVOID _mOldVect; - UINT32 _mRegAddr;//, _mRegValue; - INT shift; - - if (!_sys_bIsAICInitial) - { - sysInitializeAIC(); - _sys_bIsAICInitial = TRUE; - } - - _mRegAddr = REG_AIC_SRCCTL0 + ((eIntNo / 4) * 4); - shift = (eIntNo % 4) * 8; - nIntTypeLevel &= 0xff; - outpw(_mRegAddr, (inpw(_mRegAddr) & ~(0x0f << shift)) | (nIntTypeLevel << shift)); - - if ((nIntTypeLevel & 0x7) == FIQ_LEVEL_0) - { - _mOldVect = (PVOID) sysFiqHandlerTable[eIntNo]; - sysFiqHandlerTable[eIntNo] = (sys_pvFunPtr)pvNewISR; - } - else - { - _mOldVect = (PVOID) sysIrqHandlerTable[eIntNo]; - sysIrqHandlerTable[eIntNo] = (sys_pvFunPtr)pvNewISR; - } - return _mOldVect; -} - - -INT32 sysSetGlobalInterrupt(INT32 nIntState) -{ - switch (nIntState) - { - case ENABLE_ALL_INTERRUPTS: - outpw(REG_AIC_INTEN0, 0xFFFFFFFF); - outpw(REG_AIC_INTEN1, 0xFFFFFFFF); - break; - - case DISABLE_ALL_INTERRUPTS: - outpw(REG_AIC_INTDIS0, 0xFFFFFFFF); - outpw(REG_AIC_INTDIS1, 0xFFFFFFFF); - break; - - default: - ; - } - return Successful; -} - - -/** - * @brief system AIC - Change interrupt level - * - * @param[in] eIntNo Interrupt number. \ref IRQn_Type - * @param[in] uIntLevel Interrupt Level. ( \ref FIQ_LEVEL_0 / \ref IRQ_LEVEL_1 / \ref IRQ_LEVEL_2 / \ref IRQ_LEVEL_3 / - * \ref IRQ_LEVEL_4 / \ref IRQ_LEVEL_5 / \ref IRQ_LEVEL_6 / \ref IRQ_LEVEL_7 ) - * - * @return 0 - */ -INT32 sysSetInterruptPriorityLevel(IRQn_Type eIntNo, UINT32 uIntLevel) -{ - UINT32 _mRegAddr; - INT shift; - - if ((eIntNo > SYS_MAX_INT_SOURCE) || (eIntNo < SYS_MIN_INT_SOURCE)) - return 1; - - _mRegAddr = REG_AIC_SRCCTL0 + ((eIntNo / 4) * 4); - shift = (eIntNo % 4) * 8; - uIntLevel &= 0x7; - outpw(_mRegAddr, (inpw(_mRegAddr) & ~(0x07 << shift)) | (uIntLevel << shift)); - - return 0; -} - - -/** - * @brief system AIC - Set CP15 Interrupt Type - * - * @param[in] nIntState Interrupt state. ( \ref ENABLE_IRQ / \ref ENABLE_FIQ / \ref ENABLE_FIQ_IRQ / - * \ref DISABLE_IRQ / \ref DISABLE_FIQ / \ref DISABLE_FIQ_IRQ) - * - * @return 0 - */ -INT32 sysSetLocalInterrupt(INT32 nIntState) -{ -#if defined (__GNUC__) && !(__CC_ARM) - -# else - INT32 temp; -#endif - - switch (nIntState) - { - case ENABLE_IRQ: - case ENABLE_FIQ: - case ENABLE_FIQ_IRQ: -#if defined (__GNUC__) && !(__CC_ARM) - __asm__ __volatile__ - ( - "mrs r0, CPSR \n" - "bic r0, r0, #0x80 \n" - "msr CPSR_c, r0 \n" - ); -#else - __asm - { - MRS temp, CPSR - AND temp, temp, nIntState - MSR CPSR_c, temp - } -#endif - break; - - case DISABLE_IRQ: - case DISABLE_FIQ: - case DISABLE_FIQ_IRQ: -#if defined ( __GNUC__ ) && !(__CC_ARM) - __asm__ __volatile__ - ( - "MRS r0, CPSR \n" - "ORR r0, r0, #0x80 \n" - "MSR CPSR_c, r0 \n" - ); -#else - __asm - { - MRS temp, CPSR - ORR temp, temp, nIntState - MSR CPSR_c, temp - } -#endif - break; - - default: - ; - } - return 0; -} - -UINT32 sysGetInterruptEnableStatus(void) -{ - return (inpw(REG_AIC_INTMSK0)); -} - - -UINT32 sysGetInterruptEnableStatusH(void) -{ - return (inpw(REG_AIC_INTMSK1)); -} -/// @endcond HIDDEN_SYMBOLS - -/// @cond HIDDEN_SYMBOLS -BOOL sysGetIBitState() -{ - INT32 temp; -#if defined (__GNUC__) && !(__CC_ARM) - __asm__ __volatile__ - ( - "MRS %0, CPSR \n" - :"=r"(temp) - ); -#else - __asm - { - MRS temp, CPSR - } -#endif - - if (temp & 0x80) - return FALSE; - else - return TRUE; -} - -INT32 sysGetPLL(UINT32 reg) -{ - UINT32 N, M, P; - - N = ((inpw(reg) & 0x007F) >> 0) + 1; - M = ((inpw(reg) & 0x1F80) >> 7) + 1; - P = ((inpw(reg) & 0xE000) >> 13) + 1; - - return (12 * N / (M * P)); /* 12MHz HXT */ -} -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief system Timer - install WDT interrupt handler - * - * @param[in] clk clock source. \ref CLK_Type - * - * @return MHz - */ -UINT32 sysGetClock(CLK_Type clk) -{ - UINT32 src, divN, reg; - - switch (clk) - { - case SYS_UPLL: - return sysGetPLL(REG_CLK_UPLLCON); - - case SYS_APLL: - return sysGetPLL(REG_CLK_APLLCON); - - case SYS_SYSTEM: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divN = ((reg & 0x100) >> 8) + 1; - return (src / divN); - } - - case SYS_HCLK: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divN = ((reg & 0x100) >> 8) + 1; - return (src / divN / 2); - } - - case SYS_PCLK01: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divN = ((reg & 0x100) >> 8) + 1; - return (src / divN / 2); - } - - case SYS_CPU: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divN = ((reg & 0x10000) >> 16) + 1; - return (src / divN); - } - - case SYS_PCLK2: - { - reg = inpw(REG_CLK_DIVCTL0); - switch (reg & 0x18) - { - case 0x0: - src = 12; /* HXT */ - break; - case 0x10: - src = sysGetPLL(REG_CLK_APLLCON); - break; - case 0x18: - src = sysGetPLL(REG_CLK_UPLLCON); - break; - default: - return 0; - } - divN = ((reg & 0x100) >> 8) + 1; - return (src / divN / 2 / 2); - } - default: - ; - } - return 0; //write me!! -} - -INT32 sysGetSdramSizebyMB(void) -{ - unsigned int volatile reg, totalsize = 0; - - reg = inpw(SDIC_BA + 0x10) & 0x07; - switch (reg) - { - case 1: - totalsize += 2; - break; - - case 2: - totalsize += 4; - break; - - case 3: - totalsize += 8; - break; - - case 4: - totalsize += 16; - break; - - case 5: - totalsize += 32; - break; - - case 6: - totalsize += 64; - break; - - case 7: - totalsize += 128; - break; - } - if ((inpw(SDIC_BA + 0x14) & (0xFF << 21)) != 0) - totalsize += totalsize; - - return totalsize; -} - -/*@}*/ /* end of group SYS_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group SYS_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_uart.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_uart.c deleted file mode 100644 index fb373792ba0..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_uart.c +++ /dev/null @@ -1,776 +0,0 @@ -/**************************************************************************//** - * @file uart.c - * @version V3.00 - * @brief NUC980 series UART driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include "nu_uart.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup UART_Driver UART Driver - @{ -*/ - -/** @addtogroup UART_EXPORTED_FUNCTIONS UART Exported Functions - @{ -*/ - -/** - * @brief Clear UART specified interrupt flag - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTSTS_LININT_Msk : LIN bus interrupt - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTSTS_BUFERRINT_Msk : Buffer Error interrupt - * - \ref UART_INTSTS_MODEMINT_Msk : Modem Status interrupt - * - \ref UART_INTSTS_RLSINT_Msk : Receive Line Status interrupt - * - * @return None - * - * @details The function is used to clear UART specified interrupt flag. - */ - -void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag) -{ - - if (u32InterruptFlag & UART_INTSTS_RLSINT_Msk) /* Clear Receive Line Status Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_BIF_Msk | UART_FIFOSTS_FEF_Msk | UART_FIFOSTS_PEF_Msk; - uart->FIFOSTS = UART_FIFOSTS_ADDRDETF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_MODEMINT_Msk) /* Clear Modem Status Interrupt */ - { - uart->MODEMSTS |= UART_MODEMSTS_CTSDETF_Msk; - } - else - { - } - - if (u32InterruptFlag & UART_INTSTS_BUFERRINT_Msk) /* Clear Buffer Error Interrupt */ - { - uart->FIFOSTS = UART_FIFOSTS_RXOVIF_Msk | UART_FIFOSTS_TXOVIF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_WKINT_Msk) /* Clear Wake-up Interrupt */ - { - uart->WKSTS = UART_WKSTS_CTSWKF_Msk | UART_WKSTS_DATWKF_Msk | - UART_WKSTS_RFRTWKF_Msk | UART_WKSTS_RS485WKF_Msk | - UART_WKSTS_TOUTWKF_Msk; - } - - if (u32InterruptFlag & UART_INTSTS_LININT_Msk) /* Clear LIN Bus Interrupt */ - { - uart->INTSTS = UART_INTSTS_LINIF_Msk; - uart->LINSTS = UART_LINSTS_BITEF_Msk | UART_LINSTS_BRKDETF_Msk | - UART_LINSTS_SLVSYNCF_Msk | UART_LINSTS_SLVIDPEF_Msk | - UART_LINSTS_SLVHEF_Msk | UART_LINSTS_SLVHDETF_Msk ; - } -} - - -/** - * @brief Disable UART interrupt - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART interrupt. - */ -void UART_Close(UART_T *uart) -{ - uart->INTEN = 0ul; -} - - -/** - * @brief Disable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to disable UART auto flow control. - */ -void UART_DisableFlowCtrl(UART_T *uart) -{ - uart->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk); -} - - -/** - * @brief Disable UART specified interrupt - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module. - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to disable UART specified interrupt and disable NVIC UART IRQ. - */ -void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Disable UART specified interrupt */ - UART_DISABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Enable UART auto flow control function - * - * @param[in] uart The pointer of the specified UART module. - * - * @return None - * - * @details The function is used to Enable UART auto flow control. - */ -void UART_EnableFlowCtrl(UART_T *uart) -{ - /* Set RTS pin output is low level active */ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - - /* Set CTS pin input is low level active */ - uart->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk; - - /* Set RTS and CTS auto flow control enable */ - uart->INTEN |= UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk; -} - - -/** - * @brief The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32InterruptFlag The specified interrupt of UART module: - * - \ref UART_INTEN_WKIEN_Msk : Wake-up interrupt - * - \ref UART_INTEN_LINIEN_Msk : Lin bus interrupt - * - \ref UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt - * - \ref UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt - * - \ref UART_INTEN_MODEMIEN_Msk : Modem status interrupt - * - \ref UART_INTEN_RLSIEN_Msk : Receive Line status interrupt - * - \ref UART_INTEN_THREIEN_Msk : Tx empty interrupt - * - \ref UART_INTEN_RDAIEN_Msk : Rx ready interrupt * - * - * @return None - * - * @details The function is used to enable UART specified interrupt and enable NVIC UART IRQ. - */ -void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag) -{ - /* Enable UART specified interrupt */ - UART_ENABLE_INT(uart, u32InterruptFlag); -} - - -/** - * @brief Open and set UART function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The baudrate of UART module. - * - * @return None - * - * @details This function use to enable UART function and set baud-rate. - */ -void UART_Open(UART_T *uart, uint32_t u32baudrate) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - //uint32_t u32ClkTbl[4] = {XIN, LXT, ACLK, UCLK}; - uint32_t u32ClkTbl[4] = {12000000, 32768, 75000000, 150000000}; - uint32_t u32Baud_Div = 0ul; - - - if ((uint32_t)uart == UART0_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART1_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART2_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART3_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART4_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART5_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART6_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART7_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART8_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART9_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 13)) >> 13; - } - - /* Select UART function */ - uart->FUNCSEL = UART_FUNCSEL_UART; - - /* Set UART line configuration */ - uart->LINE = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1; - - /* Set UART Rx and RTS trigger level */ - uart->FIFO &= ~(UART_FIFO_RFITL_Msk | UART_FIFO_RTSTRGLV_Msk); - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 2ul) // ACLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - if (u32UartClkSrcSel == 3ul) // PCLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } -} - - -/** - * @brief Read UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8RxBuf The buffer to receive the data of receive FIFO. - * @param[in] u32ReadBytes The the read bytes number of data. - * - * @return u32Count Receive byte count - * - * @details The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf. - */ -uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count < u32ReadBytes; u32Count++) - { - u32delayno = 0ul; - - while (uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) /* Check RX empty => failed */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - pu8RxBuf[u32Count] = (uint8_t)uart->DAT; /* Get Data from UART RX */ - } - } - - return u32Count; - -} - - -/** - * @brief Set UART line configuration - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32baudrate The register value of baudrate of UART module. - * If u32baudrate = 0, UART baudrate will not change. - * @param[in] u32data_width The data length of UART module. - * - \ref UART_WORD_LEN_5 - * - \ref UART_WORD_LEN_6 - * - \ref UART_WORD_LEN_7 - * - \ref UART_WORD_LEN_8 - * @param[in] u32parity The parity setting (none/odd/even/mark/space) of UART module. - * - \ref UART_PARITY_NONE - * - \ref UART_PARITY_ODD - * - \ref UART_PARITY_EVEN - * - \ref UART_PARITY_MARK - * - \ref UART_PARITY_SPACE - * @param[in] u32stop_bits The stop bit length (1/1.5/2 bit) of UART module. - * - \ref UART_STOP_BIT_1 - * - \ref UART_STOP_BIT_1_5 - * - \ref UART_STOP_BIT_2 - * - * @return None - * - * @details This function use to config UART line setting. - */ -void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - //uint32_t u32ClkTbl[4] = {XIN, LXT, ACLK, UCLK}; - uint32_t u32ClkTbl[4] = {12000000, 32768, 75000000, 150000000}; - uint32_t u32Baud_Div = 0ul; - - - if ((uint32_t)uart == UART0_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART1_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART2_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART3_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART4_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART5_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART6_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART7_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART8_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART9_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 13)) >> 13; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 2ul) // ACLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - if (u32UartClkSrcSel == 3ul) // PCLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Set UART baud rate */ - if (u32baudrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE2_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate); - - if (u32Baud_Div > 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32baudrate)); - } - else - { - uart->BAUD = (UART_BAUD_MODE2 | u32Baud_Div); - } - } - - /* Set UART line configuration */ - uart->LINE = u32data_width | u32parity | u32stop_bits; -} - - -/** - * @brief Set Rx timeout count - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32TOC Rx timeout counter. - * - * @return None - * - * @details This function use to set Rx timeout count. - */ -void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC) -{ - /* Set time-out interrupt comparator */ - uart->TOUT = (uart->TOUT & ~UART_TOUT_TOIC_Msk) | (u32TOC); - - /* Set time-out counter enable */ - uart->INTEN |= UART_INTEN_TOCNTEN_Msk; -} - - -/** - * @brief Select and configure IrDA function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Buadrate The baudrate of UART module. - * @param[in] u32Direction The direction of UART module in IrDA mode: - * - \ref UART_IRDA_TXEN - * - \ref UART_IRDA_RXEN - * - * @return None - * - * @details The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate. - */ -void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction) -{ - uint32_t u32UartClkSrcSel = 0ul, u32UartClkDivNum = 0ul; - //uint32_t u32ClkTbl[4] = {XIN, LXT, ACLK, UCLK}; - uint32_t u32ClkTbl[4] = {12000000, 32768, 75000000, 150000000}; - uint32_t u32Baud_Div = 0ul; - - - if ((uint32_t)uart == UART0_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART1_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART2_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART3_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL4) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL4) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART4_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART5_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 13)) >> 13; - } - else if ((uint32_t)uart == UART6_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 19)) >> 19; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 21)) >> 21; - } - else if ((uint32_t)uart == UART7_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL5) & (0x3ul << 27)) >> 27; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL5) & (0x7ul << 29)) >> 29; - } - else if ((uint32_t)uart == UART8_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 3)) >> 3; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 5)) >> 5; - } - else if ((uint32_t)uart == UART9_BA) - { - /* Get UART clock source selection */ - u32UartClkSrcSel = (inp32(REG_CLK_DIVCTL6) & (0x3ul << 11)) >> 11; - /* Get UART clock divider number */ - u32UartClkDivNum = (inp32(REG_CLK_DIVCTL6) & (0x7ul << 13)) >> 13; - } - - /* Get PLL clock frequency if UART clock source selection is PLL */ - if (u32UartClkSrcSel == 2ul) // ACLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - if (u32UartClkSrcSel == 3ul) // PCLK - { - //u32ClkTbl[u32UartClkSrcSel] = CLK_GetPLLClockFreq(); - } - - /* Set UART IrDA baud rate in mode 0 */ - if (u32Buadrate != 0ul) - { - u32Baud_Div = UART_BAUD_MODE0_DIVIDER((u32ClkTbl[u32UartClkSrcSel]) / (u32UartClkDivNum + 1ul), u32Buadrate); - - if (u32Baud_Div < 0xFFFFul) - { - uart->BAUD = (UART_BAUD_MODE0 | u32Baud_Div); - } - else - { - } - } - - /* Configure IrDA relative settings */ - if (u32Direction == UART_IRDA_RXEN) - { - uart->IRDA |= UART_IRDA_RXINV_Msk; /*Rx signal is inverse*/ - uart->IRDA &= ~UART_IRDA_TXEN_Msk; - } - else - { - uart->IRDA &= ~UART_IRDA_TXINV_Msk; /*Tx signal is not inverse*/ - uart->IRDA |= UART_IRDA_TXEN_Msk; - } - -} - - -/** - * @brief Select and configure RS485 function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The operation mode(NMM/AUD/AAD). - * - \ref UART_ALTCTL_RS485NMM_Msk - * - \ref UART_ALTCTL_RS485AUD_Msk - * - \ref UART_ALTCTL_RS485AAD_Msk - * @param[in] u32Addr The RS485 address. - * - * @return None - * - * @details The function is used to set RS485 relative setting. - */ -void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr) -{ - /* Select UART RS485 function mode */ - uart->FUNCSEL = UART_FUNCSEL_RS485; - - /* Set RS585 configuration */ - uart->ALTCTL &= ~(UART_ALTCTL_RS485NMM_Msk | UART_ALTCTL_RS485AUD_Msk | UART_ALTCTL_RS485AAD_Msk | UART_ALTCTL_ADDRMV_Msk); - uart->ALTCTL |= (u32Mode | (u32Addr << UART_ALTCTL_ADDRMV_Pos)); -} - - -/** - * @brief Select and configure LIN function - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] u32Mode The LIN direction : - * - \ref UART_ALTCTL_LINTXEN_Msk - * - \ref UART_ALTCTL_LINRXEN_Msk - * @param[in] u32BreakLength The break field length. - * - * @return None - * - * @details The function is used to set LIN relative setting. - */ -void UART_SelectLINMode(UART_T *uart, uint32_t u32Mode, uint32_t u32BreakLength) -{ - /* Select LIN function mode */ - uart->FUNCSEL = UART_FUNCSEL_LIN; - - /* Select LIN function setting : Tx enable, Rx enable and break field length */ - uart->ALTCTL &= ~(UART_ALTCTL_LINTXEN_Msk | UART_ALTCTL_LINRXEN_Msk | UART_ALTCTL_BRKFL_Msk); - uart->ALTCTL |= (u32Mode | (u32BreakLength << UART_ALTCTL_BRKFL_Pos)); -} - - -/** - * @brief Write UART data - * - * @param[in] uart The pointer of the specified UART module. - * @param[in] pu8TxBuf The buffer to send the data to UART transmission FIFO. - * @param[out] u32WriteBytes The byte number of data. - * - * @return u32Count transfer byte count - * - * @details The function is to write data into TX buffer to transmit data by UART. - */ -uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) -{ - uint32_t u32Count, u32delayno; - uint32_t u32Exit = 0ul; - - for (u32Count = 0ul; u32Count != u32WriteBytes; u32Count++) - { - u32delayno = 0ul; - while ((uart->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) == 0ul) /* Wait Tx empty and Time-out manner */ - { - u32delayno++; - if (u32delayno >= 0x40000000ul) - { - u32Exit = 1ul; - break; - } - else - { - } - } - - if (u32Exit == 1ul) - { - break; - } - else - { - uart->DAT = pu8TxBuf[u32Count]; /* Send UART Data from buffer */ - } - } - - return u32Count; - -} - -/** - * @brief Set RTS pin to low - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to low. - */ -void UART_CLEAR_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk; - uart->MODEM &= ~UART_MODEM_RTS_Msk; -} - -/** - * @brief Set RTS pin to high - * - * @param[in] uart The pointer of the specified UART module - * - * @return None - * - * @details This macro set RTS pin to high. - */ -void UART_SET_RTS(UART_T *uart) -{ - uart->MODEM |= UART_MODEM_RTSACTLV_Msk | UART_MODEM_RTS_Msk; -} - -/*@}*/ /* end of group UART_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group UART_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_usbd.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_usbd.c deleted file mode 100644 index 29c7946ce5b..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_usbd.c +++ /dev/null @@ -1,679 +0,0 @@ -/**************************************************************************//** - * @file usbd.c - * @version V1.00 - * $Revision: 2 $ - * $Date: 18/08/05 2:58p $ - * @brief NuMicro ARM9 USBD driver source file - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nuc980.h" -#include "nu_usbd.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup USBD_Driver USBD Driver - @{ -*/ - -/** @addtogroup USBD_EXPORTED_CONSTANTS USBD Exported Constants - @{ -*/ -/*--------------------------------------------------------------------------*/ -/// @cond HIDDEN_SYMBOLS - -/*!< Global variables for Control Pipe */ -S_USBD_CMD_T gUsbCmd; -S_USBD_INFO_T *g_usbd_sInfo; - -VENDOR_REQ g_usbd_pfnVendorRequest = NULL; -CLASS_REQ g_usbd_pfnClassRequest = NULL; -SET_INTERFACE_REQ g_usbd_pfnSetInterface = NULL; -uint32_t g_u32EpStallLock = 0; /*!< Bit map flag to lock specified EP when SET_FEATURE */ -uint8_t volatile g_usbd_RemoteWakeupEn = 0ul; - -static uint8_t *g_usbd_CtrlInPointer = 0; -static uint32_t g_usbd_CtrlMaxPktSize = 64; -static uint8_t g_usbd_UsbConfig = 0; -static uint8_t g_usbd_UsbAltInterface = 0; -static uint8_t g_usbd_EnableTestMode = 0; -static uint8_t g_usbd_TestSelector = 0; - -#ifdef __ICCARM__ - #pragma data_alignment=4 - static uint8_t g_usbd_buf[12]; -#else - static uint8_t g_usbd_buf[12] __attribute__((aligned(4))); -#endif - - -uint8_t volatile g_usbd_Configured = 0; -uint8_t g_usbd_CtrlZero = 0; -uint8_t g_usbd_UsbAddr = 0; -uint8_t g_usbd_ShortPacket = 0; -uint32_t volatile g_usbd_DmaDone = 0; -uint32_t g_usbd_CtrlInSize = 0; -/// @endcond HIDDEN_SYMBOLS - -/** - * @brief USBD Initial - * - * @param[in] param Descriptor - * @param[in] pfnClassReq Class Request Callback Function - * @param[in] pfnSetInterface SetInterface Request Callback Function - * - * @return None - * - * @details This function is used to initial USBD. - */ -void USBD_Open(S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface) -{ - int volatile i; - /* Select Vbus detect pin -> GPE11 */ - outpw(REG_SYS_GPE_MFPH, (inpw(REG_SYS_GPE_MFPH) & ~0xf000) | 0x1000); - /* Enable USB device clock */ - outpw(REG_CLK_HCLKEN, inpw(REG_CLK_HCLKEN) | 0x80000); - outpw(REG_SYS_AHBIPRST, inpw(REG_SYS_AHBIPRST) | 0x80000); - outpw(REG_SYS_AHBIPRST, inpw(REG_SYS_AHBIPRST) & ~0x80000); - for (i = 0; i < 1000; i++); - - g_usbd_sInfo = param; - g_usbd_pfnClassRequest = pfnClassReq; - g_usbd_pfnSetInterface = pfnSetInterface; - - /* get EP0 maximum packet size */ - g_usbd_CtrlMaxPktSize = g_usbd_sInfo->gu8DevDesc[7]; - - /* Initial USB engine */ - /* Enable PHY */ - USBD_ENABLE_PHY(); - /* wait PHY clock ready */ - while (1) - { - USBD->EP[EPA].EPMPS = 0x20; - if (USBD->EP[EPA].EPMPS == 0x20) - break; - } - /* Force SE0, and then clear it to connect*/ - USBD_SET_SE0(); -} - -/** - * @brief USBD Start - * - * @return None - * - * @details This function is used to start transfer - */ -void USBD_Start(void) -{ - USBD_CLR_SE0(); -} - -/** - * @brief Process Setup Packet - * - * @return None - * - * @details This function is used to process Setup packet. - */ -void USBD_ProcessSetupPacket(void) -{ - // Setup packet process - gUsbCmd.bmRequestType = (uint8_t)(USBD->SETUP1_0 & 0xff); - gUsbCmd.bRequest = (int8_t)(USBD->SETUP1_0 >> 8) & 0xff; - gUsbCmd.wValue = (uint16_t)USBD->SETUP3_2; - gUsbCmd.wIndex = (uint16_t)USBD->SETUP5_4; - gUsbCmd.wLength = (uint16_t)USBD->SETUP7_6; - - /* USB device request in setup packet: offset 0, D[6..5]: 0=Standard, 1=Class, 2=Vendor, 3=Reserved */ - switch (gUsbCmd.bmRequestType & 0x60) - { - case REQ_STANDARD: // Standard - { - USBD_StandardRequest(); - break; - } - case REQ_CLASS: // Class - { - if (g_usbd_pfnClassRequest != NULL) - { - g_usbd_pfnClassRequest(); - } - break; - } - case REQ_VENDOR: // Vendor - { - if (g_usbd_pfnVendorRequest != NULL) - { - g_usbd_pfnVendorRequest(); - } - break; - } - default: // reserved - { - /* Setup error, stall the device */ - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - break; - } - } -} - -/** - * @brief Get Descriptor request - * - * @return None - * - * @details This function is used to process GetDescriptor request. - */ -int USBD_GetDescriptor(void) -{ - uint32_t u32Len; - int val = 0; - - u32Len = gUsbCmd.wLength; - g_usbd_CtrlZero = 0; - USBD->CEPCTL |= USBD_CEPCTL_FLUSH_Msk; - - switch ((gUsbCmd.wValue & 0xff00) >> 8) - { - /* Get Device Descriptor */ - case DESC_DEVICE: - { - u32Len = Minimum(u32Len, LEN_DEVICE); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8DevDesc, u32Len); - break; - } - /* Get Configuration Descriptor */ - case DESC_CONFIG: - { - uint32_t u32TotalLen; - if ((USBD->OPER & 0x04ul) == 0x04ul) - { - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8ConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - { - g_usbd_CtrlZero = 1; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8ConfigDesc, u32Len); - } - else - { - u32TotalLen = g_usbd_sInfo->gu8FullConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8FullConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlZero = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8FullConfigDesc, u32Len); - } - break; - } - /* Get Qualifier Descriptor */ - case DESC_QUALIFIER: - { - u32Len = Minimum(u32Len, LEN_QUALIFIER); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8QualDesc, u32Len); - break; - } - // Get Other Speed Descriptor - Full speed - case DESC_OTHERSPEED: - { - uint32_t u32TotalLen; - if ((USBD->OPER & 0x04ul) == 0x04ul) - { - u32TotalLen = g_usbd_sInfo->gu8HSOtherConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8HSOtherConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - { - g_usbd_CtrlZero = 1; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8HSOtherConfigDesc, u32Len); - } - else - { - u32TotalLen = g_usbd_sInfo->gu8FSOtherConfigDesc[3]; - u32TotalLen = g_usbd_sInfo->gu8FSOtherConfigDesc[2] + (u32TotalLen << 8); - - if (u32Len > u32TotalLen) - { - u32Len = u32TotalLen; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0ul) - { - g_usbd_CtrlZero = (uint8_t)1ul; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8FSOtherConfigDesc, u32Len); - } - break; - } - /* Get HID Descriptor */ - case DESC_HID: - { - u32Len = Minimum(u32Len, LEN_HID); - USBD_MemCopy(g_usbd_buf, (uint8_t *)&g_usbd_sInfo->gu8ConfigDesc[LEN_CONFIG + LEN_INTERFACE], u32Len); - USBD_PrepareCtrlIn(g_usbd_buf, u32Len); - break; - } - // Get Report Descriptor - case DESC_HID_RPT: - { - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - g_usbd_CtrlZero = 1; - - u32Len = Minimum(u32Len, g_usbd_sInfo->gu32HidReportSize[gUsbCmd.wIndex & 0xff]); - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8HidReportDesc[gUsbCmd.wIndex & 0xff], u32Len); - break; - } - /* Get String Descriptor */ - case DESC_STRING: - { - if ((gUsbCmd.wValue & 0xfful) < 8ul) - { - if (u32Len > g_usbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful][0]) - { - u32Len = g_usbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xfful][0]; - if ((u32Len % g_usbd_CtrlMaxPktSize) == 0) - { - g_usbd_CtrlZero = 1; - } - } - USBD_PrepareCtrlIn((uint8_t *)g_usbd_sInfo->gu8StringDesc[gUsbCmd.wValue & 0xff], u32Len); - } - else - { - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - val = 1; - } - break; - } - default: - /* Not support. Reply STALL. */ - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - val = 1; - break; - } - return val; -} - - -/** - * @brief Process USB standard request - * - * @return None - * - * @details This function is used to process USB Standard Request. - */ -void USBD_StandardRequest(void) -{ - /* clear global variables for new request */ - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0; - - if (gUsbCmd.bmRequestType & 0x80) /* request data transfer direction */ - { - // Device to host - switch (gUsbCmd.bRequest) - { - case GET_CONFIGURATION: - { - // Return current configuration setting - USBD_PrepareCtrlIn((uint8_t *)&g_usbd_UsbConfig, 1); - - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_DESCRIPTOR: - { - if (!USBD_GetDescriptor()) - { - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - } - break; - } - case GET_INTERFACE: - { - // Return current interface setting - USBD_PrepareCtrlIn((uint8_t *)&g_usbd_UsbAltInterface, 1); - - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - break; - } - case GET_STATUS: - { - /* Device */ - if (gUsbCmd.bmRequestType == 0x80) - { - g_usbd_buf[0] = (uint8_t)0ul; /* bus-Powered */ - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x40ul) == 0x40ul) - { - g_usbd_buf[0] = (uint8_t)1ul; /* Self-Powered */ - } - - if ((g_usbd_sInfo->gu8ConfigDesc[7] & 0x20ul) == 0x20ul) - g_usbd_buf[0] |= (uint8_t)(g_usbd_RemoteWakeupEn << 1); // Remote wake up - } - // Interface - else if (gUsbCmd.bmRequestType == 0x81) - g_usbd_buf[0] = 0; - // Endpoint - else if (gUsbCmd.bmRequestType == 0x82) - { - uint8_t ep = gUsbCmd.wIndex & 0xF; - g_usbd_buf[0] = USBD_GetStall(ep) ? 1 : 0; - } - g_usbd_buf[1] = 0; - USBD_PrepareCtrlIn(g_usbd_buf, 2); - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_INTKIF_Msk); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_INTKIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - break; - } - } - } - else - { - // Host to device - switch (gUsbCmd.bRequest) - { - case CLEAR_FEATURE: - { - if ((gUsbCmd.wValue & 0xff) == FEATURE_ENDPOINT_HALT) - { - - int32_t epNum, i; - - /* EP number stall is not allow to be clear in MSC class "Error Recovery Test". - a flag: g_u32EpStallLock is added to support it */ - epNum = gUsbCmd.wIndex & 0xF; - for (i = 0; i < USBD_MAX_EP; i++) - { - if ((((USBD->EP[i].EPCFG & 0xf0) >> 4) == epNum) && ((g_u32EpStallLock & (1 << i)) == 0)) - { - USBD->EP[i].EPRSPCTL = (USBD->EP[i].EPRSPCTL & 0xef) | USB_EP_RSPCTL_TOGGLE; - } - } - } - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_ADDRESS: - { - g_usbd_UsbAddr = (uint8_t)gUsbCmd.wValue; - - // DATA IN for end of setup - /* Status Stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_CONFIGURATION: - { - g_usbd_UsbConfig = (uint8_t)gUsbCmd.wValue; - g_usbd_Configured = 1; - // DATA IN for end of setup - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_FEATURE: - { - if ((gUsbCmd.wValue & 0x3) == 2) /* TEST_MODE*/ - { - g_usbd_EnableTestMode = 1; - g_usbd_TestSelector = gUsbCmd.wIndex >> 8; - } - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - case SET_INTERFACE: - { - g_usbd_UsbAltInterface = (uint8_t)gUsbCmd.wValue; - if (g_usbd_pfnSetInterface != NULL) - g_usbd_pfnSetInterface(g_usbd_UsbAltInterface); - /* Status stage */ - USBD_CLR_CEP_INT_FLAG(USBD_CEPINTSTS_STSDONEIF_Msk); - USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR); - USBD_ENABLE_CEP_INT(USBD_CEPINTEN_STSDONEIEN_Msk); - break; - } - default: - { - /* Setup error, stall the device */ - USBD_SET_CEP_STATE(USBD_CEPCTL_STALLEN_Msk); - break; - } - } - } -} - -#define TEST_J 0x01 /*!< TEST J \hideinitializer */ -#define TEST_K 0x02 /*!< TEST K \hideinitializer */ -#define TEST_SE0_NAK 0x03 /*!< TEST SE0 \hideinitializer */ -#define TEST_PACKET 0x04 /*!< TEST Packet \hideinitializer */ -#define TEST_FORCE_ENABLE 0x05 /*!< TEST Force enable \hideinitializer */ - - -/** - * @brief Update Device State - * - * @return None - * - * @details This function is used to update Device state when Setup packet complete - */ -void USBD_UpdateDeviceState(void) -{ - switch (gUsbCmd.bRequest) - { - case SET_ADDRESS: - { - USBD_SET_ADDR(g_usbd_UsbAddr); - break; - } - case SET_CONFIGURATION: - { - if (g_usbd_UsbConfig == 0) - { - int volatile i; - /* Reset PID DATA0 */ - for (i = 0; i < USBD_MAX_EP; i++) - { - if (USBD->EP[i].EPCFG & 0x1) - { - USBD->EP[i].EPRSPCTL = USB_EP_RSPCTL_TOGGLE; - } - } - } - break; - } - case SET_FEATURE: - { - if (gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - USBD_SetStall(gUsbCmd.wIndex & 0xF); - else if (g_usbd_EnableTestMode) - { - g_usbd_EnableTestMode = 0; - if (g_usbd_TestSelector == TEST_J) - USBD->TEST = TEST_J; - else if (g_usbd_TestSelector == TEST_K) - USBD->TEST = TEST_K; - else if (g_usbd_TestSelector == TEST_SE0_NAK) - USBD->TEST = TEST_SE0_NAK; - else if (g_usbd_TestSelector == TEST_PACKET) - USBD->TEST = TEST_PACKET; - else if (g_usbd_TestSelector == TEST_FORCE_ENABLE) - USBD->TEST = TEST_FORCE_ENABLE; - } - break; - } - case CLEAR_FEATURE: - { - if (gUsbCmd.wValue == FEATURE_ENDPOINT_HALT) - USBD_ClearStall(gUsbCmd.wIndex & 0xF); - break; - } - default: - ; - } -} - - -/** - * @brief Prepare Control IN transaction - * - * @param[in] pu8Buf Control IN data pointer - * @param[in] u32Size IN transfer size - * - * @return None - * - * @details This function is used to prepare Control IN transfer - */ -void USBD_PrepareCtrlIn(uint8_t *pu8Buf, uint32_t u32Size) -{ - g_usbd_CtrlInPointer = pu8Buf; - g_usbd_CtrlInSize = u32Size; -} - - - -/** - * @brief Start Control IN transfer - * - * @return None - * - * @details This function is used to start Control IN - */ -void USBD_CtrlIn(void) -{ - int volatile i; - uint32_t volatile count; - - // Process remained data - if (g_usbd_CtrlInSize >= g_usbd_CtrlMaxPktSize) - { - // Data size > MXPLD - for (i = 0; i < (g_usbd_CtrlMaxPktSize >> 2); i++, g_usbd_CtrlInPointer += 4) - USBD->cep.CEPDAT = *(uint32_t *)g_usbd_CtrlInPointer; - USBD_START_CEP_IN(g_usbd_CtrlMaxPktSize); - g_usbd_CtrlInSize -= g_usbd_CtrlMaxPktSize; - } - else - { - // Data size <= MXPLD - for (i = 0; i < (g_usbd_CtrlInSize >> 2); i++, g_usbd_CtrlInPointer += 4) - USBD->cep.CEPDAT = *(uint32_t *)g_usbd_CtrlInPointer; - - count = g_usbd_CtrlInSize % 4; - for (i = 0; i < count; i++) - USBD->cep.CEPDAT_BYTE = *(uint8_t *)(g_usbd_CtrlInPointer + i); - - USBD_START_CEP_IN(g_usbd_CtrlInSize); - g_usbd_CtrlInPointer = 0; - g_usbd_CtrlInSize = 0; - } -} - -/** - * @brief Start Control OUT transaction - * - * @param[in] pu8Buf Control OUT data pointer - * @param[in] u32Size OUT transfer size - * - * @return None - * - * @details This function is used to start Control OUT transfer - */ -void USBD_CtrlOut(uint8_t *pu8Buf, uint32_t u32Size) -{ - int volatile i; - - while (1) - { - if (USBD->CEPINTSTS & USBD_CEPINTSTS_RXPKIF_Msk) - { - for (i = 0; i < u32Size; i++) - *(uint8_t *)(pu8Buf + i) = USBD->cep.CEPDAT_BYTE; - USBD->CEPINTSTS = USBD_CEPINTSTS_RXPKIF_Msk; - break; - } - } -} - -/** - * @brief Clear all software flags - * - * @return None - * - * @details This function is used to clear all software control flag - */ -void USBD_SwReset(void) -{ - // Reset all variables for protocol - g_usbd_UsbAddr = 0; - g_usbd_DmaDone = 0; - g_usbd_ShortPacket = 0; - g_usbd_Configured = 0; - - // Reset USB device address - USBD_SET_ADDR(0); -} - -/** - * @brief USBD Set Vendor Request - * - * @param[in] pfnVendorReq Vendor Request Callback Function - * - * @return None - * - * @details This function is used to set USBD vendor request callback function - */ -void USBD_SetVendorRequest(VENDOR_REQ pfnVendorReq) -{ - g_usbd_pfnVendorRequest = pfnVendorReq; -} - - -/*@}*/ /* end of group USBD_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBD_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wdt.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wdt.c deleted file mode 100644 index 2db0cdc96e3..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wdt.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************//** - * @file wdt.c - * @brief NUC980 series WDT driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nu_wdt.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WDT_Driver WDT Driver - @{ -*/ - -/** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions - @{ -*/ - -/** - * @brief Initialize WDT and start counting - * - * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: - * - \ref WDT_TIMEOUT_2POW4 - * - \ref WDT_TIMEOUT_2POW6 - * - \ref WDT_TIMEOUT_2POW8 - * - \ref WDT_TIMEOUT_2POW10 - * - \ref WDT_TIMEOUT_2POW12 - * - \ref WDT_TIMEOUT_2POW14 - * - \ref WDT_TIMEOUT_2POW16 - * - \ref WDT_TIMEOUT_2POW18 - * * \ref WDT_TIMEOUT_2POW20 - * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: - * - \ref WDT_RESET_DELAY_1026CLK - * - \ref WDT_RESET_DELAY_130CLK - * - \ref WDT_RESET_DELAY_18CLK - * - \ref WDT_RESET_DELAY_3CLK - * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. - * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. - * - * @return None - * - * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n - * enable or disable WDT time-out reset system or wake-up system. - * @note Please make sure that Register Write-Protection Function has been disabled before using this function. - */ -void WDT_Open(UINT32 u32TimeoutInterval, - UINT32 u32ResetDelay, - UINT32 u32EnableReset, - UINT32 u32EnableWakeup) -{ - - outpw(REG_WDT_ALTCTL, u32ResetDelay); - outpw(REG_WDT_CTL, u32TimeoutInterval | 0x80 | - (u32EnableReset << 1) | - (u32EnableWakeup << 4)); - return; -} - -/*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wwdt.c b/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wwdt.c deleted file mode 100644 index 1488a3036f5..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Driver/Source/nu_wwdt.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************//** - * @file wwdt.c - * @brief NUC980 WWDT driver source file - * - * SPDX-License-Identifier: Apache-2.0 - * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ -#include "nu_wwdt.h" - -/** @addtogroup Standard_Driver Standard Driver - @{ -*/ - -/** @addtogroup WWDT_Driver WWDT Driver - @{ -*/ - - -/** @addtogroup WWDT_EXPORTED_FUNCTIONS WWDT Exported Functions - @{ -*/ - - -/** - * @brief This function make WWDT module start counting with different counter period and compared window value - * @param[in] u32PreScale Prescale period for the WWDT counter period. Valid values are: - * - \ref WWDT_PRESCALER_1 - * - \ref WWDT_PRESCALER_2 - * - \ref WWDT_PRESCALER_4 - * - \ref WWDT_PRESCALER_8 - * - \ref WWDT_PRESCALER_16 - * - \ref WWDT_PRESCALER_32 - * - \ref WWDT_PRESCALER_64 - * - \ref WWDT_PRESCALER_128 - * - \ref WWDT_PRESCALER_192 - * - \ref WWDT_PRESCALER_256 - * - \ref WWDT_PRESCALER_384 - * - \ref WWDT_PRESCALER_512 - * - \ref WWDT_PRESCALER_768 - * - \ref WWDT_PRESCALER_1024 - * - \ref WWDT_PRESCALER_1536 - * - \ref WWDT_PRESCALER_2048 - * @param[in] u32CmpValue Window compared value. Valid values are between 0x0 to 0x3F - * @param[in] u32EnableInt Enable WWDT interrupt or not. Valid values are \ref TRUE and \ref FALSE - * @return None - * @note Application can call this function can only once after boot up - */ -void WWDT_Open(UINT u32PreScale, UINT u32CmpValue, UINT u32EnableInt) -{ - UINT reg; - reg = u32PreScale | - (u32CmpValue << 16) | - 0x1 | // enable - (u32EnableInt ? 0x2 : 0); - outpw(REG_WWDT_CTL, reg); - - return; -} - - - -/*@}*/ /* end of group WWDT_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group WWDT_Driver */ - -/*@}*/ /* end of group Standard_Driver */ - diff --git a/bsp/nuvoton/libraries/nuc980/Script/NUC980xx41.ini b/bsp/nuvoton/libraries/nuc980/Script/NUC980xx41.ini deleted file mode 100644 index b9d11473374..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Script/NUC980xx41.ini +++ /dev/null @@ -1,24 +0,0 @@ -E INT 0xB0000264 = 0xC0000018 -E INT 0xB0000220 = 0x01000018 -E INT 0xB0002028 = 0x53DCD84A -E INT 0xB0002008 = 0x00008014 -E INT 0xB0002000 = 0x0003047E -E INT 0xB0002004 = 0x00000021 -E INT 0xB0002004 = 0x00000023 -E INT 0xB0002004 = 0x00000027 -E INT 0xB0002020 = 0x00000000 -E INT 0xB0002024 = 0x00000000 -E INT 0xB000201C = 0x00004000 -E INT 0xB0002018 = 0x00000332 -E INT 0xB0002010 = 0x00000004 -E INT 0xB0002004 = 0x00000027 -E INT 0xB0002004 = 0x0000002B -E INT 0xB0002004 = 0x0000002B -E INT 0xB0002004 = 0x0000002B -E INT 0xB0002018 = 0x00000232 -E INT 0xB000201C = 0x00004781 -E INT 0xB000201C = 0x00004401 -E INT 0xB0002004 = 0x00000020 -E INT 0xB0002034 = 0x00888828 -LOAD %L INCREMENTAL -$ = 0x8000 \ No newline at end of file diff --git a/bsp/nuvoton/libraries/nuc980/Script/NUC980xx61.ini b/bsp/nuvoton/libraries/nuc980/Script/NUC980xx61.ini deleted file mode 100644 index dbc8b7e518b..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Script/NUC980xx61.ini +++ /dev/null @@ -1,24 +0,0 @@ -E INT 0xB0000264 = 0xC0000018 -E INT 0xB0000220 = 0x01000018 -E INT 0xB0002028 = 0x53DCD84A -E INT 0xB0002008 = 0x00008014 -E INT 0xB0002000 = 0x0003047E -E INT 0xB0002004 = 0x00000021 -E INT 0xB0002004 = 0x00000023 -E INT 0xB0002004 = 0x00000027 -E INT 0xB0002020 = 0x00000000 -E INT 0xB0002024 = 0x00000000 -E INT 0xB000201C = 0x00004000 -E INT 0xB0002018 = 0x00000332 -E INT 0xB0002010 = 0x00000006 -E INT 0xB0002004 = 0x00000027 -E INT 0xB0002004 = 0x0000002B -E INT 0xB0002004 = 0x0000002B -E INT 0xB0002004 = 0x0000002B -E INT 0xB0002018 = 0x00000232 -E INT 0xB000201C = 0x00004781 -E INT 0xB000201C = 0x00004401 -E INT 0xB0002004 = 0x00000020 -E INT 0xB0002034 = 0x00888828 -LOAD %L INCREMENTAL -$ = 0x00000000 \ No newline at end of file diff --git a/bsp/nuvoton/libraries/nuc980/Script/NUC980xx71.ini b/bsp/nuvoton/libraries/nuc980/Script/NUC980xx71.ini deleted file mode 100644 index 1ff516d8eb5..00000000000 --- a/bsp/nuvoton/libraries/nuc980/Script/NUC980xx71.ini +++ /dev/null @@ -1,26 +0,0 @@ -E INT 0xB0000264 = 0xC0000018 -E INT 0xB0000220 = 0x00000018 -E INT 0xB0002028 = 0x53EB384A -E INT 0xB0002008 = 0x00008014 -E INT 0xB0002000 = 0x00010476 -E INT 0xB0002004 = 0x00000001 -E INT 0xB0002004 = 0x00000003 -E INT 0xB0002004 = 0x00000007 -E INT 0xB0002020 = 0x00000000 -E INT 0xB0002024 = 0x00000000 -E INT 0xB000201C = 0x00004001 -E INT 0xB0002018 = 0x00000332 -E INT 0xB0002010 = 0x00000007 -E INT 0xB0002004 = 0x00000007 -E INT 0xB0002004 = 0x0000000B -E INT 0xB0002004 = 0x0000000B -E INT 0xB0002004 = 0x0000000B -E INT 0xB0002018 = 0x00000232 -E INT 0xB000201C = 0x000027C5 -E INT 0xB000201C = 0x00002445 -E INT 0xB0002008 = 0x000080C0 -E INT 0xB0002004 = 0x00000020 -E INT 0xB0002030 = 0x00001010 -E INT 0xB0002034 = 0x00CCCC0A -LOAD %L INCREMENTAL -$ = 0x8000 \ No newline at end of file diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/SConscript b/bsp/nuvoton/libraries/nuc980/UsbHostLib/SConscript deleted file mode 100644 index 2044bf324eb..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -group = [] -if GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_USBH'): - src = Glob('*src/*.c') + Glob('src/*.cpp') - CPPPATH = [cwd + '/inc'] - group = DefineGroup('nuc980_usbhostlib', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/config.h b/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/config.h deleted file mode 100644 index 2da683df9eb..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/config.h +++ /dev/null @@ -1,1566 +0,0 @@ -/**************************************************************************//** - * @file config.h - * @version V1.00 - * @brief This header file defines the configuration of USB Host library. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2019 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_CONFIG_H_ -#define _USBH_CONFIG_H_ - -/// @cond HIDDEN_SYMBOLS - -#include -#include "nuc980.h" -#include "nu_sys.h" -#include "drv_sys.h" - - -/*----------------------------------------------------------------------------------------*/ -/* Hardware settings */ -/*----------------------------------------------------------------------------------------*/ -#define HCLK_MHZ 300 /* used for loop-delay. must be larger than - true HCLK clock MHz */ - -#define NON_CACHE_MASK (0x80000000) - -#define ENABLE_OHCI_IRQ() rt_hw_interrupt_umask(IRQ_OHCI) -#define DISABLE_OHCI_IRQ() rt_hw_interrupt_mask(IRQ_OHCI) -#define IS_OHCI_IRQ_ENABLED() ((inpw(REG_AIC_INTMSK0)>>IRQ_OHCI) & 0x1) -#define ENABLE_EHCI_IRQ() rt_hw_interrupt_umask(IRQ_EHCI) -#define DISABLE_EHCI_IRQ() rt_hw_interrupt_mask(IRQ_EHCI) -#define IS_EHCI_IRQ_ENABLED() ((inpw(REG_AIC_INTMSK0)>>IRQ_EHCI) & 0x1) - -#define ENABLE_OHCI /* Enable OHCI host controller */ -#define ENABLE_EHCI /* Enable EHCI host controller */ - -#define EHCI_PORT_CNT 2 /* Number of EHCI roothub ports */ -#define OHCI_PORT_CNT 8 /* Number of OHCI roothub ports */ -//#define OHCI_PER_PORT_POWER /* OHCI root hub per port powered */ - -#define OHCI_ISO_DELAY 4 /* preserved number frames while scheduling - OHCI isochronous transfer */ - -#define EHCI_ISO_DELAY 2 /* preserved number of frames while - scheduling EHCI isochronous transfer */ - -#define EHCI_ISO_RCLM_RANGE 32 /* When inspecting activated iTD/siTD, - unconditionally reclaim iTD/isTD scheduled - in just elapsed EHCI_ISO_RCLM_RANGE ms. */ - -#define MAX_DESC_BUFF_SIZE 4096 /* To hold the configuration descriptor, USB - core will allocate a buffer with this size - for each connected device. USB core does - not release it until device disconnected. */ - -/*----------------------------------------------------------------------------------------*/ -/* Memory allocation settings */ -/*----------------------------------------------------------------------------------------*/ - -#define STATIC_MEMORY_ALLOC 0 /* pre-allocate static memory blocks. No dynamic memory aloocation. - But the maximum number of connected devices and transfers are - limited. */ - -#define MAX_UDEV_DRIVER 8 /*!< Maximum number of registered drivers */ -#define MAX_ALT_PER_IFACE 8 /*!< maximum number of alternative interfaces per interface */ -#define MAX_EP_PER_IFACE 8 /*!< maximum number of endpoints per interface */ -#define MAX_HUB_DEVICE 8 /*!< Maximum number of hub devices */ - -/* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI - are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE. - May allocate one or more units depend on hardware descriptor type. */ - -#define MEM_POOL_UNIT_SIZE 128 /*!< A fixed hard coding setting. Do not change it! */ -#define MEM_POOL_UNIT_NUM 256 /*!< Increase this or heap size if memory allocate failed. */ - -/*----------------------------------------------------------------------------------------*/ -/* Re-defined staff for various compiler */ -/*----------------------------------------------------------------------------------------*/ -#ifdef __ICCARM__ - #define __inline inline -#endif - - -/*----------------------------------------------------------------------------------------*/ -/* Debug settings */ -/*----------------------------------------------------------------------------------------*/ -#define ENABLE_ERROR_MSG /* enable debug messages */ -//#define ENABLE_DEBUG_MSG /* enable debug messages */ -//#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */ -//#define DUMP_DESCRIPTOR /* dump descriptors */ - -#ifdef ENABLE_ERROR_MSG - #define USB_error rt_kprintf -#else - #define USB_error(...) -#endif - -#ifdef ENABLE_DEBUG_MSG - #define USB_debug rt_kprintf - #ifdef ENABLE_VERBOSE_DEBUG - #define USB_vdebug rt_kprintf - #else - #define USB_vdebug(...) - #endif -#else - #define USB_debug(...) - #define USB_vdebug(...) -#endif - - -#define __I volatile const /*!< Defines 'read only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - - -//typedef unsigned int uint32_t; -//typedef unsigned short uint16_t; -//typedef unsigned char uint8_t; - - - -/*---------------------- USB Host Controller -------------------------*/ -/** - @addtogroup USBH USB Host Controller(USBH) - Memory Mapped Structure for USBH Controller -@{ */ - -typedef struct -{ - - /** - * @var USBH_T::HcRevision - * Offset: 0x00 Host Controller Revision Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |REV |Revision Number - * | | |Indicates the Open HCI Specification revision number implemented by the Hardware - * | | |Host Controller supports 1.1 specification. - * | | |(X.Y = XYh). - * @var USBH_T::HcControl - * Offset: 0x04 Host Controller Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1:0] |CBSR |Control Bulk Service Ratio - * | | |This specifies the service ratio between Control and Bulk EDs - * | | |Before processing any of the non-periodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs - * | | |The internal count will be retained when crossing the frame boundary - * | | |In case of reset, HCD is responsible for restoring this - * | | |Value. - * | | |00 = Number of Control EDs over Bulk EDs served is 1:1. - * | | |01 = Number of Control EDs over Bulk EDs served is 2:1. - * | | |10 = Number of Control EDs over Bulk EDs served is 3:1. - * | | |11 = Number of Control EDs over Bulk EDs served is 4:1. - * |[2] |PLE |Periodic List Enable Bit - * | | |When set, this bit enables processing of the Periodic (interrupt and isochronous) list - * | | |The Host Controller checks this bit prior to attempting any periodic transfers in a frame. - * | | |0 = Processing of the Periodic (Interrupt and Isochronous) list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Periodic (Interrupt and Isochronous) list in the next frame Enabled. - * | | |Note: To enable the processing of the Isochronous list, user has to set both PLE and IE (HcControl[3]) high. - * |[3] |IE |Isochronous List Enable Bit - * | | |Both ISOEn and PLE (HcControl[2]) high enables Host Controller to process the Isochronous list - * | | |Either ISOEn or PLE (HcControl[2]) is low disables Host Controller to process the Isochronous list. - * | | |0 = Processing of the Isochronous list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Isochronous list in the next frame Enabled, if the PLE (HcControl[2]) is high, too. - * |[4] |CLE |Control List Enable Bit - * | | |0 = Processing of the Control list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Control list in the next frame Enabled. - * |[5] |BLE |Bulk List Enable Bit - * | | |0 = Processing of the Bulk list after next SOF (Start-Of-Frame) Disabled. - * | | |1 = Processing of the Bulk list in the next frame Enabled. - * |[7:6] |HCFS |Host Controller Functional State - * | | |This field sets the Host Controller state - * | | |The Controller may force a state change from USBSUSPEND to USBRESUME after detecting resume signaling from a downstream port - * | | |States are: - * | | |00 = USBSUSPEND. - * | | |01 = USBOPERATIONAL. - * | | |10 = USBRESUME. - * | | |11 = USBRESET. - * @var USBH_T::HcCommandStatus - * Offset: 0x08 Host Controller Command Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |HCR |Host Controller Reset - * | | |This bit is set to initiate the software reset of Host Controller - * | | |This bit is cleared by the Host Controller, upon completed of the reset operation. - * | | |This bit, when set, didn't reset the Root Hub and no subsequent reset signaling be asserted to its downstream ports. - * | | |0 = Host Controller is not in software reset state. - * | | |1 = Host Controller is in software reset state. - * |[1] |CLF |Control List Filled - * | | |Set high to indicate there is an active TD on the Control List - * | | |It may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Control List. - * | | |0 = No active TD found or Host Controller begins to process the head of the Control list. - * | | |1 = An active TD added or found on the Control list. - * |[2] |BLF |Bulk List Filled - * | | |Set high to indicate there is an active TD on the Bulk list - * | | |This bit may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Bulk list. - * | | |0 = No active TD found or Host Controller begins to process the head of the Bulk list. - * | | |1 = An active TD added or found on the Bulk list. - * |[17:16] |SOC |Schedule Overrun Count - * | | |These bits are incremented on each scheduling overrun error - * | | |It is initialized to 00b and wraps around at 11b - * | | |This will be incremented when a scheduling overrun is detected even if SO (HcInterruptStatus[0]) has already been set. - * @var USBH_T::HcInterruptStatus - * Offset: 0x0C Host Controller Interrupt Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun - * | | |Set when the List Processor determines a Schedule Overrun has occurred. - * | | |0 = Schedule Overrun didn't occur. - * | | |1 = Schedule Overrun has occurred. - * |[1] |WDH |Write Back Done Head - * | | |Set after the Host Controller has written HcDoneHead to HccaDoneHead - * | | |Further updates of the HccaDoneHead will not occur until this bit has been cleared. - * | | |0 =.Host Controller didn't update HccaDoneHead. - * | | |1 =.Host Controller has written HcDoneHead to HccaDoneHead. - * |[2] |SF |Start of Frame - * | | |Set when the Frame Management functional block signals a 'Start of Frame' event - * | | |Host Control generates a SOF token at the same time. - * | | |0 =.Not the start of a frame. - * | | |1 =.Indicate the start of a frame and Host Controller generates a SOF token. - * |[3] |RD |Resume Detected - * | | |Set when Host Controller detects resume signaling on a downstream port. - * | | |0 = No resume signaling detected on a downstream port. - * | | |1 = Resume signaling detected on a downstream port. - * |[5] |FNO |Frame Number Overflow - * | | |This bit is set when bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * | | |0 = The bit 15 of Frame Number didn't change. - * | | |1 = The bit 15 of Frame Number changes from 1 to 0 or from 0 to 1. - * |[6] |RHSC |Root Hub Status Change - * | | |This bit is set when the content of HcRhStatus or the content of HcRhPortStatus register has changed. - * | | |0 = The content of HcRhStatus and the content of HcRhPortStatus register didn't change. - * | | |1 = The content of HcRhStatus or the content of HcRhPortStatus register has changed. - * @var USBH_T::HcInterruptEnable - * Offset: 0x10 Host Controller Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Enable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Enable Bit - * | | |This bit is a global interrupt enable - * | | |A write of '1' allows interrupts to be enabled via the specific enable bits listed above. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcInterruptDisable - * Offset: 0x14 Host Controller Interrupt Disable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |SO |Scheduling Overrun Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled. - * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled. - * |[1] |WDH |Write Back Done Head Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled. - * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled. - * |[2] |SF |Start of Frame Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled. - * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled. - * |[3] |RD |Resume Detected Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled. - * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled. - * |[5] |FNO |Frame Number Overflow Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled. - * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled. - * |[6] |RHSC |Root Hub Status Change Disable Bit - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled. - * |[31] |MIE |Master Interrupt Disable Bit - * | | |Global interrupt disable. Writing '1' to disable all interrupts. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled if the corresponding bit in HcInterruptEnable is high. - * | | |Read Operation: - * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high. - * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high. - * @var USBH_T::HcHCCA - * Offset: 0x18 Host Controller Communication Area Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:8] |HCCA |Host Controller Communication Area - * | | |Pointer to indicate base address of the Host Controller Communication Area (HCCA). - * @var USBH_T::HcPeriodCurrentED - * Offset: 0x1C Host Controller Period Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |PCED |Periodic Current ED - * | | |Pointer to indicate physical address of the current Isochronous or Interrupt Endpoint Descriptor. - * @var USBH_T::HcControlHeadED - * Offset: 0x20 Host Controller Control Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CHED |Control Head ED - * | | |Pointer to indicate physical address of the first Endpoint Descriptor of the Control list. - * @var USBH_T::HcControlCurrentED - * Offset: 0x24 Host Controller Control Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |CCED |Control Current Head ED - * | | |Pointer to indicate the physical address of the current Endpoint Descriptor of the Control list. - * @var USBH_T::HcBulkHeadED - * Offset: 0x28 Host Controller Bulk Head ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BHED |Bulk Head ED - * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Bulk list. - * @var USBH_T::HcBulkCurrentED - * Offset: 0x2C Host Controller Bulk Current ED Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |BCED |Bulk Current Head ED - * | | |Pointer to indicate the physical address of the current endpoint of the Bulk list. - * @var USBH_T::HcDoneHead - * Offset: 0x30 Host Controller Done Head Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:4] |DH |Done Head - * | | |Pointer to indicate the physical address of the last completed Transfer Descriptor that was added to the Done queue. - * @var USBH_T::HcFmInterval - * Offset: 0x34 Host Controller Frame Interval Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Interval - * | | |This field specifies the length of a frame as (bit times - 1) - * | | |For 12,000 bit times in a frame, a value of 11,999 is stored here. - * |[30:16] |FSMPS |FS Largest Data Packet - * | | |This field specifies a value that is loaded into the Largest Data Packet Counter at the beginning of each frame. - * |[31] |FIT |Frame Interval Toggle - * | | |This bit is toggled by Host Controller Driver when it loads a new value into FI (HcFmInterval[13:0]). - * | | |0 = Host Controller Driver didn't load new value into FI (HcFmInterval[13:0]). - * | | |1 = Host Controller Driver loads a new value into FI (HcFmInterval[13:0]). - * @var USBH_T::HcFmRemaining - * Offset: 0x38 Host Controller Frame Remaining Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FR |Frame Remaining - * | | |When the Host Controller is in the USBOPERATIONAL state, this 14-bit field decrements each 12 MHz clock period - * | | |When the count reaches 0, (end of frame) the counter reloads with Frame Interval - * | | |In addition, the counter loads when the Host Controller transitions into USBOPERATIONAL. - * |[31] |FRT |Frame Remaining Toggle - * | | |This bit is loaded from the FIT (HcFmInterval[31]) whenever FR (HcFmRemaining[13:0]) reaches 0. - * @var USBH_T::HcFmNumber - * Offset: 0x3C Host Controller Frame Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[15:0] |FN |Frame Number - * | | |This 16-bit incrementing counter field is incremented coincident with the re-load of FR (HcFmRemaining[13:0]) - * | | |The count rolls over from 'FFFFh' to '0h.' - * @var USBH_T::HcPeriodicStart - * Offset: 0x40 Host Controller Periodic Start Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |PS |Periodic Start - * | | |This field contains a value used by the List Processor to determine where in a frame the Periodic List processing must begin. - * @var USBH_T::HcLSThreshold - * Offset: 0x44 Host Controller Low-speed Threshold Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |LST |Low-speed Threshold - * | | |This field contains a value which is compared to the FR (HcFmRemaining[13:0]) field prior to initiating a Low-speed transaction - * | | |The transaction is started only if FR (HcFmRemaining[13:0]) >= this field - * | | |The value is calculated by Host Controller Driver with the consideration of transmission and setup overhead. - * @var USBH_T::HcRhDescriptorA - * Offset: 0x48 Host Controller Root Hub Descriptor A Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |NDP |Number Downstream Ports - * | | |USB host control supports two downstream ports and only one port is available in this series of chip. - * |[8] |PSM |Power Switching Mode - * | | |This bit is used to specify how the power switching of the Root Hub ports is controlled. - * | | |0 = Global Switching. - * | | |1 = Individual Switching. - * |[11] |OCPM |over Current Protection Mode - * | | |This bit describes how the over current status for the Root Hub ports reported - * | | |This bit is only valid when NOCP (HcRhDescriptorA[12]) is cleared. - * | | |0 = Global Over current. - * | | |1 = Individual Over current. - * |[12] |NOCP |No over Current Protection - * | | |This bit describes how the over current status for the Root Hub ports reported. - * | | |0 = Over current status is reported. - * | | |1 = Over current status is not reported. - * @var USBH_T::HcRhDescriptorB - * Offset: 0x4C Host Controller Root Hub Descriptor B Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:16] |PPCM |Port Power Control Mask - * | | |Global power switching - * | | |This field is only valid if PowerSwitchingMode is set (individual port switching) - * | | |When set, the port only responds to individual port power switching commands (Set/ClearPortPower) - * | | |When cleared, the port only responds to global power switching commands (Set/ClearGlobalPower). - * | | |0 = Port power controlled by global power switching. - * | | |1 = Port power controlled by port power switching. - * | | |Note: PPCM[15:2] and PPCM[0] are reserved. - * @var USBH_T::HcRhStatus - * Offset: 0x50 Host Controller Root Hub Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |LPS |Clear Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to clear all ports' power. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear global power. - * |[1] |OCI |over Current Indicator - * | | |This bit reflects the state of the over current status pin - * | | |This field is only valid if NOCP (HcRhDesA[12]) and OCPM (HcRhDesA[11]) are cleared. - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[15] |DRWE |Device Remote Wakeup Enable Bit - * | | |This bit controls if port's Connect Status Change as a remote wake-up event. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * | | |Read Operation: - * | | |0 = Connect Status Change as a remote wake-up event Disabled. - * | | |1 = Connect Status Change as a remote wake-up event Enabled. - * |[16] |LPSC |Set Global Power - * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to enable power to all ports. - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set global power. - * |[17] |OCIC |over Current Indicator Change - * | | |This bit is set by hardware when a change has occurred in OCI (HcRhStatus[1]). - * | | |Write 1 to clear this bit to zero. - * | | |0 = OCI (HcRhStatus[1]) didn't change. - * | | |1 = OCI (HcRhStatus[1]) change. - * |[31] |CRWE |Clear Remote Wake-up Enable Bit - * | | |This bit is use to clear DRWE (HcRhStatus[15]). - * | | |This bit always read as zero. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear DRWE (HcRhStatus[15]). - * @var USBH_T::HcRhPortStatus[2] - * Offset: 0x54 Host Controller Root Hub Port Status - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |CurrentConnectStatus (Read) or ClearPortEnable Bit (Write) - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port enable. - * | | |Read Operation: - * | | |0 = No device connected. - * | | |1 = Device connected. - * |[1] |PES |Port Enable Status - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port enable. - * | | |Read Operation: - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[2] |PSS |Port Suspend Status - * | | |This bit indicates the port is suspended - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port suspend. - * | | |Read Operation: - * | | |0 = Port is not suspended. - * | | |1 = Port is selectively suspended. - * |[3] |POCI |Port over Current Indicator (Read) or Clear Port Suspend (Write) - * | | |This bit reflects the state of the over current status pin dedicated to this port - * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) is cleared and OCPM (HcRhDescriptorA[11]) is set. - * | | |This bit is also used to initiate the selective result sequence for the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear port suspend. - * | | |Read Operation: - * | | |0 = No over current condition. - * | | |1 = Over current condition. - * |[4] |PRS |Port Reset Status - * | | |This bit reflects the reset state of the port. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Set port reset. - * | | |Read Operation - * | | |0 = Port reset signal is not active. - * | | |1 = Port reset signal is active. - * |[8] |PPS |Port Power Status - * | | |This bit reflects the power state of the port regardless of the power switching mode. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Port Power Enabled. - * | | |Read Operation: - * | | |0 = Port power is Disabled. - * | | |1 = Port power is Enabled. - * |[9] |LSDA |Low Speed Device Attached (Read) or Clear Port Power (Write) - * | | |This bit defines the speed (and bud idle) of the attached device - * | | |It is only valid when CCS (HcRhPortStatus1[0]) is set. - * | | |This bit is also used to clear port power. - * | | |Write Operation: - * | | |0 = No effect. - * | | |1 = Clear PPS (HcRhPortStatus1[8]). - * | | |Read Operation: - * | | |0 = Full Speed device. - * | | |1 = Low-speed device. - * |[16] |CSC |Connect Status Change - * | | |This bit indicates connect or disconnect event has been detected (CCS (HcRhPortStatus1[0]) changed). - * | | |Write 1 to clear this bit to zero. - * | | |0 = No connect/disconnect event (CCS (HcRhPortStatus1[0]) didn't change). - * | | |1 = Hardware detection of connect/disconnect event (CCS (HcRhPortStatus1[0]) changed). - * |[17] |PESC |Port Enable Status Change - * | | |This bit indicates that the port has been disabled (PES (HcRhPortStatus1[1]) cleared) due to a hardware event. - * | | |Write 1 to clear this bit to zero. - * | | |0 = PES (HcRhPortStatus1[1]) didn't change. - * | | |1 = PES (HcRhPortStatus1[1]) changed. - * |[18] |PSSC |Port Suspend Status Change - * | | |This bit indicates the completion of the selective resume sequence for the port. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port resume is not completed. - * | | |1 = Port resume completed. - * |[19] |OCIC |Port over Current Indicator Change - * | | |This bit is set when POCI (HcRhPortStatus1[3]) changes. - * | | |Write 1 to clear this bit to zero. - * | | |0 = POCI (HcRhPortStatus1[3]) didn't change. - * | | |1 = POCI (HcRhPortStatus1[3]) changes. - * |[20] |PRSC |Port Reset Status Change - * | | |This bit indicates that the port reset signal has completed. - * | | |Write 1 to clear this bit to zero. - * | | |0 = Port reset is not complete. - * | | |1 = Port reset is complete. - * @var USBH_T::HcPhyControl - * Offset: 0x200 Host Controller PHY Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[27] |STBYEN |USB Transceiver Standby Enable Bit - * | | |This bit controls if USB transceiver could enter the standby mode to reduce power consumption. - * | | |0 = The USB transceiver would never enter the standby mode. - * | | |1 = The USB transceiver will enter standby mode while port is in power off state (port power is inactive). - * @var USBH_T::HcMiscControl - * Offset: 0x204 Host Controller Miscellaneous Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[1] |ABORT |AHB Bus ERROR Response - * | | |This bit indicates there is an ERROR response received in AHB bus. - * | | |0 = No ERROR response received. - * | | |1 = ERROR response received. - * |[3] |OCAL |over Current Active Low - * | | |This bit controls the polarity of over current flag from external power IC. - * | | |0 = Over current flag is high active. - * | | |1 = Over current flag is low active. - * |[16] |DPRT1 |Disable Port 1 - * | | |This bit controls if the connection between USB host controller and transceiver of port 1 is disabled - * | | |If the connection is disabled, the USB host controller will not recognize any event of USB bus. - * | | |Set this bit high, the transceiver of port 1 will also be forced into the standby mode no matter what USB host controller operation is. - * | | |0 = The connection between USB host controller and transceiver of port 1 Enabled. - * | | |1 = The connection between USB host controller and transceiver of port 1 Disabled and the transceiver of port 1 will also be forced into the standby mode. - */ - __I uint32_t HcRevision; /*!< [0x0000] Host Controller Revision Register */ - __IO uint32_t HcControl; /*!< [0x0004] Host Controller Control Register */ - __IO uint32_t HcCommandStatus; /*!< [0x0008] Host Controller Command Status Register */ - __IO uint32_t HcInterruptStatus; /*!< [0x000c] Host Controller Interrupt Status Register */ - __IO uint32_t HcInterruptEnable; /*!< [0x0010] Host Controller Interrupt Enable Register */ - __IO uint32_t HcInterruptDisable; /*!< [0x0014] Host Controller Interrupt Disable Register */ - __IO uint32_t HcHCCA; /*!< [0x0018] Host Controller Communication Area Register */ - __IO uint32_t HcPeriodCurrentED; /*!< [0x001c] Host Controller Period Current ED Register */ - __IO uint32_t HcControlHeadED; /*!< [0x0020] Host Controller Control Head ED Register */ - __IO uint32_t HcControlCurrentED; /*!< [0x0024] Host Controller Control Current ED Register */ - __IO uint32_t HcBulkHeadED; /*!< [0x0028] Host Controller Bulk Head ED Register */ - __IO uint32_t HcBulkCurrentED; /*!< [0x002c] Host Controller Bulk Current ED Register */ - __IO uint32_t HcDoneHead; /*!< [0x0030] Host Controller Done Head Register */ - __IO uint32_t HcFmInterval; /*!< [0x0034] Host Controller Frame Interval Register */ - __I uint32_t HcFmRemaining; /*!< [0x0038] Host Controller Frame Remaining Register */ - __I uint32_t HcFmNumber; /*!< [0x003c] Host Controller Frame Number Register */ - __IO uint32_t HcPeriodicStart; /*!< [0x0040] Host Controller Periodic Start Register */ - __IO uint32_t HcLSThreshold; /*!< [0x0044] Host Controller Low-speed Threshold Register */ - __IO uint32_t HcRhDescriptorA; /*!< [0x0048] Host Controller Root Hub Descriptor A Register */ - __IO uint32_t HcRhDescriptorB; /*!< [0x004c] Host Controller Root Hub Descriptor B Register */ - __IO uint32_t HcRhStatus; /*!< [0x0050] Host Controller Root Hub Status Register */ - __IO uint32_t HcRhPortStatus[8]; /*!< [0x0054] Host Controller Root Hub Port Status [1] */ - __I uint32_t RESERVE0[99]; - __IO uint32_t HcPhyControl; /*!< [0x0200] Host Controller PHY Control Register */ - __IO uint32_t HcMiscControl; /*!< [0x0204] Host Controller Miscellaneous Control Register */ - -} USBH_T; - -/** - @addtogroup USBH_CONST USBH Bit Field Definition - Constant Definitions for USBH Controller -@{ */ - -#define USBH_HcRevision_REV_Pos (0) /*!< USBH_T::HcRevision: REV Position */ -#define USBH_HcRevision_REV_Msk (0xfful << USBH_HcRevision_REV_Pos) /*!< USBH_T::HcRevision: REV Mask */ - -#define USBH_HcControl_CBSR_Pos (0) /*!< USBH_T::HcControl: CBSR Position */ -#define USBH_HcControl_CBSR_Msk (0x3ul << USBH_HcControl_CBSR_Pos) /*!< USBH_T::HcControl: CBSR Mask */ - -#define USBH_HcControl_PLE_Pos (2) /*!< USBH_T::HcControl: PLE Position */ -#define USBH_HcControl_PLE_Msk (0x1ul << USBH_HcControl_PLE_Pos) /*!< USBH_T::HcControl: PLE Mask */ - -#define USBH_HcControl_IE_Pos (3) /*!< USBH_T::HcControl: IE Position */ -#define USBH_HcControl_IE_Msk (0x1ul << USBH_HcControl_IE_Pos) /*!< USBH_T::HcControl: IE Mask */ - -#define USBH_HcControl_CLE_Pos (4) /*!< USBH_T::HcControl: CLE Position */ -#define USBH_HcControl_CLE_Msk (0x1ul << USBH_HcControl_CLE_Pos) /*!< USBH_T::HcControl: CLE Mask */ - -#define USBH_HcControl_BLE_Pos (5) /*!< USBH_T::HcControl: BLE Position */ -#define USBH_HcControl_BLE_Msk (0x1ul << USBH_HcControl_BLE_Pos) /*!< USBH_T::HcControl: BLE Mask */ - -#define USBH_HcControl_HCFS_Pos (6) /*!< USBH_T::HcControl: HCFS Position */ -#define USBH_HcControl_HCFS_Msk (0x3ul << USBH_HcControl_HCFS_Pos) /*!< USBH_T::HcControl: HCFS Mask */ - -#define USBH_HcCommandStatus_HCR_Pos (0) /*!< USBH_T::HcCommandStatus: HCR Position */ -#define USBH_HcCommandStatus_HCR_Msk (0x1ul << USBH_HcCommandStatus_HCR_Pos) /*!< USBH_T::HcCommandStatus: HCR Mask */ - -#define USBH_HcCommandStatus_CLF_Pos (1) /*!< USBH_T::HcCommandStatus: CLF Position */ -#define USBH_HcCommandStatus_CLF_Msk (0x1ul << USBH_HcCommandStatus_CLF_Pos) /*!< USBH_T::HcCommandStatus: CLF Mask */ - -#define USBH_HcCommandStatus_BLF_Pos (2) /*!< USBH_T::HcCommandStatus: BLF Position */ -#define USBH_HcCommandStatus_BLF_Msk (0x1ul << USBH_HcCommandStatus_BLF_Pos) /*!< USBH_T::HcCommandStatus: BLF Mask */ - -#define USBH_HcCommandStatus_SOC_Pos (16) /*!< USBH_T::HcCommandStatus: SOC Position */ -#define USBH_HcCommandStatus_SOC_Msk (0x3ul << USBH_HcCommandStatus_SOC_Pos) /*!< USBH_T::HcCommandStatus: SOC Mask */ - -#define USBH_HcInterruptStatus_SO_Pos (0) /*!< USBH_T::HcInterruptStatus: SO Position */ -#define USBH_HcInterruptStatus_SO_Msk (0x1ul << USBH_HcInterruptStatus_SO_Pos) /*!< USBH_T::HcInterruptStatus: SO Mask */ - -#define USBH_HcInterruptStatus_WDH_Pos (1) /*!< USBH_T::HcInterruptStatus: WDH Position*/ -#define USBH_HcInterruptStatus_WDH_Msk (0x1ul << USBH_HcInterruptStatus_WDH_Pos) /*!< USBH_T::HcInterruptStatus: WDH Mask */ - -#define USBH_HcInterruptStatus_SF_Pos (2) /*!< USBH_T::HcInterruptStatus: SF Position */ -#define USBH_HcInterruptStatus_SF_Msk (0x1ul << USBH_HcInterruptStatus_SF_Pos) /*!< USBH_T::HcInterruptStatus: SF Mask */ - -#define USBH_HcInterruptStatus_RD_Pos (3) /*!< USBH_T::HcInterruptStatus: RD Position */ -#define USBH_HcInterruptStatus_RD_Msk (0x1ul << USBH_HcInterruptStatus_RD_Pos) /*!< USBH_T::HcInterruptStatus: RD Mask */ - -#define USBH_HcInterruptStatus_FNO_Pos (5) /*!< USBH_T::HcInterruptStatus: FNO Position*/ -#define USBH_HcInterruptStatus_FNO_Msk (0x1ul << USBH_HcInterruptStatus_FNO_Pos) /*!< USBH_T::HcInterruptStatus: FNO Mask */ - -#define USBH_HcInterruptStatus_RHSC_Pos (6) /*!< USBH_T::HcInterruptStatus: RHSC Position*/ -#define USBH_HcInterruptStatus_RHSC_Msk (0x1ul << USBH_HcInterruptStatus_RHSC_Pos) /*!< USBH_T::HcInterruptStatus: RHSC Mask */ - -#define USBH_HcInterruptEnable_SO_Pos (0) /*!< USBH_T::HcInterruptEnable: SO Position */ -#define USBH_HcInterruptEnable_SO_Msk (0x1ul << USBH_HcInterruptEnable_SO_Pos) /*!< USBH_T::HcInterruptEnable: SO Mask */ - -#define USBH_HcInterruptEnable_WDH_Pos (1) /*!< USBH_T::HcInterruptEnable: WDH Position*/ -#define USBH_HcInterruptEnable_WDH_Msk (0x1ul << USBH_HcInterruptEnable_WDH_Pos) /*!< USBH_T::HcInterruptEnable: WDH Mask */ - -#define USBH_HcInterruptEnable_SF_Pos (2) /*!< USBH_T::HcInterruptEnable: SF Position */ -#define USBH_HcInterruptEnable_SF_Msk (0x1ul << USBH_HcInterruptEnable_SF_Pos) /*!< USBH_T::HcInterruptEnable: SF Mask */ - -#define USBH_HcInterruptEnable_RD_Pos (3) /*!< USBH_T::HcInterruptEnable: RD Position */ -#define USBH_HcInterruptEnable_RD_Msk (0x1ul << USBH_HcInterruptEnable_RD_Pos) /*!< USBH_T::HcInterruptEnable: RD Mask */ - -#define USBH_HcInterruptEnable_FNO_Pos (5) /*!< USBH_T::HcInterruptEnable: FNO Position*/ -#define USBH_HcInterruptEnable_FNO_Msk (0x1ul << USBH_HcInterruptEnable_FNO_Pos) /*!< USBH_T::HcInterruptEnable: FNO Mask */ - -#define USBH_HcInterruptEnable_RHSC_Pos (6) /*!< USBH_T::HcInterruptEnable: RHSC Position*/ -#define USBH_HcInterruptEnable_RHSC_Msk (0x1ul << USBH_HcInterruptEnable_RHSC_Pos) /*!< USBH_T::HcInterruptEnable: RHSC Mask */ - -#define USBH_HcInterruptEnable_MIE_Pos (31) /*!< USBH_T::HcInterruptEnable: MIE Position*/ -#define USBH_HcInterruptEnable_MIE_Msk (0x1ul << USBH_HcInterruptEnable_MIE_Pos) /*!< USBH_T::HcInterruptEnable: MIE Mask */ - -#define USBH_HcInterruptDisable_SO_Pos (0) /*!< USBH_T::HcInterruptDisable: SO Position*/ -#define USBH_HcInterruptDisable_SO_Msk (0x1ul << USBH_HcInterruptDisable_SO_Pos) /*!< USBH_T::HcInterruptDisable: SO Mask */ - -#define USBH_HcInterruptDisable_WDH_Pos (1) /*!< USBH_T::HcInterruptDisable: WDH Position*/ -#define USBH_HcInterruptDisable_WDH_Msk (0x1ul << USBH_HcInterruptDisable_WDH_Pos) /*!< USBH_T::HcInterruptDisable: WDH Mask */ - -#define USBH_HcInterruptDisable_SF_Pos (2) /*!< USBH_T::HcInterruptDisable: SF Position*/ -#define USBH_HcInterruptDisable_SF_Msk (0x1ul << USBH_HcInterruptDisable_SF_Pos) /*!< USBH_T::HcInterruptDisable: SF Mask */ - -#define USBH_HcInterruptDisable_RD_Pos (3) /*!< USBH_T::HcInterruptDisable: RD Position*/ -#define USBH_HcInterruptDisable_RD_Msk (0x1ul << USBH_HcInterruptDisable_RD_Pos) /*!< USBH_T::HcInterruptDisable: RD Mask */ - -#define USBH_HcInterruptDisable_FNO_Pos (5) /*!< USBH_T::HcInterruptDisable: FNO Position*/ -#define USBH_HcInterruptDisable_FNO_Msk (0x1ul << USBH_HcInterruptDisable_FNO_Pos) /*!< USBH_T::HcInterruptDisable: FNO Mask */ - -#define USBH_HcInterruptDisable_RHSC_Pos (6) /*!< USBH_T::HcInterruptDisable: RHSC Position*/ -#define USBH_HcInterruptDisable_RHSC_Msk (0x1ul << USBH_HcInterruptDisable_RHSC_Pos) /*!< USBH_T::HcInterruptDisable: RHSC Mask */ - -#define USBH_HcInterruptDisable_MIE_Pos (31) /*!< USBH_T::HcInterruptDisable: MIE Position*/ -#define USBH_HcInterruptDisable_MIE_Msk (0x1ul << USBH_HcInterruptDisable_MIE_Pos) /*!< USBH_T::HcInterruptDisable: MIE Mask */ - -#define USBH_HcHCCA_HCCA_Pos (8) /*!< USBH_T::HcHCCA: HCCA Position */ -#define USBH_HcHCCA_HCCA_Msk (0xfffffful << USBH_HcHCCA_HCCA_Pos) /*!< USBH_T::HcHCCA: HCCA Mask */ - -#define USBH_HcPeriodCurrentED_PCED_Pos (4) /*!< USBH_T::HcPeriodCurrentED: PCED Position*/ -#define USBH_HcPeriodCurrentED_PCED_Msk (0xffffffful << USBH_HcPeriodCurrentED_PCED_Pos) /*!< USBH_T::HcPeriodCurrentED: PCED Mask */ - -#define USBH_HcControlHeadED_CHED_Pos (4) /*!< USBH_T::HcControlHeadED: CHED Position */ -#define USBH_HcControlHeadED_CHED_Msk (0xffffffful << USBH_HcControlHeadED_CHED_Pos) /*!< USBH_T::HcControlHeadED: CHED Mask */ - -#define USBH_HcControlCurrentED_CCED_Pos (4) /*!< USBH_T::HcControlCurrentED: CCED Position*/ -#define USBH_HcControlCurrentED_CCED_Msk (0xffffffful << USBH_HcControlCurrentED_CCED_Pos) /*!< USBH_T::HcControlCurrentED: CCED Mask */ - -#define USBH_HcBulkHeadED_BHED_Pos (4) /*!< USBH_T::HcBulkHeadED: BHED Position */ -#define USBH_HcBulkHeadED_BHED_Msk (0xffffffful << USBH_HcBulkHeadED_BHED_Pos) /*!< USBH_T::HcBulkHeadED: BHED Mask */ - -#define USBH_HcBulkCurrentED_BCED_Pos (4) /*!< USBH_T::HcBulkCurrentED: BCED Position */ -#define USBH_HcBulkCurrentED_BCED_Msk (0xffffffful << USBH_HcBulkCurrentED_BCED_Pos) /*!< USBH_T::HcBulkCurrentED: BCED Mask */ - -#define USBH_HcDoneHead_DH_Pos (4) /*!< USBH_T::HcDoneHead: DH Position */ -#define USBH_HcDoneHead_DH_Msk (0xffffffful << USBH_HcDoneHead_DH_Pos) /*!< USBH_T::HcDoneHead: DH Mask */ - -#define USBH_HcFmInterval_FI_Pos (0) /*!< USBH_T::HcFmInterval: FI Position */ -#define USBH_HcFmInterval_FI_Msk (0x3ffful << USBH_HcFmInterval_FI_Pos) /*!< USBH_T::HcFmInterval: FI Mask */ - -#define USBH_HcFmInterval_FSMPS_Pos (16) /*!< USBH_T::HcFmInterval: FSMPS Position */ -#define USBH_HcFmInterval_FSMPS_Msk (0x7ffful << USBH_HcFmInterval_FSMPS_Pos) /*!< USBH_T::HcFmInterval: FSMPS Mask */ - -#define USBH_HcFmInterval_FIT_Pos (31) /*!< USBH_T::HcFmInterval: FIT Position */ -#define USBH_HcFmInterval_FIT_Msk (0x1ul << USBH_HcFmInterval_FIT_Pos) /*!< USBH_T::HcFmInterval: FIT Mask */ - -#define USBH_HcFmRemaining_FR_Pos (0) /*!< USBH_T::HcFmRemaining: FR Position */ -#define USBH_HcFmRemaining_FR_Msk (0x3ffful << USBH_HcFmRemaining_FR_Pos) /*!< USBH_T::HcFmRemaining: FR Mask */ - -#define USBH_HcFmRemaining_FRT_Pos (31) /*!< USBH_T::HcFmRemaining: FRT Position */ -#define USBH_HcFmRemaining_FRT_Msk (0x1ul << USBH_HcFmRemaining_FRT_Pos) /*!< USBH_T::HcFmRemaining: FRT Mask */ - -#define USBH_HcFmNumber_FN_Pos (0) /*!< USBH_T::HcFmNumber: FN Position */ -#define USBH_HcFmNumber_FN_Msk (0xfffful << USBH_HcFmNumber_FN_Pos) /*!< USBH_T::HcFmNumber: FN Mask */ - -#define USBH_HcPeriodicStart_PS_Pos (0) /*!< USBH_T::HcPeriodicStart: PS Position */ -#define USBH_HcPeriodicStart_PS_Msk (0x3ffful << USBH_HcPeriodicStart_PS_Pos) /*!< USBH_T::HcPeriodicStart: PS Mask */ - -#define USBH_HcLSThreshold_LST_Pos (0) /*!< USBH_T::HcLSThreshold: LST Position */ -#define USBH_HcLSThreshold_LST_Msk (0xffful << USBH_HcLSThreshold_LST_Pos) /*!< USBH_T::HcLSThreshold: LST Mask */ - -#define USBH_HcRhDescriptorA_NDP_Pos (0) /*!< USBH_T::HcRhDescriptorA: NDP Position */ -#define USBH_HcRhDescriptorA_NDP_Msk (0xfful << USBH_HcRhDescriptorA_NDP_Pos) /*!< USBH_T::HcRhDescriptorA: NDP Mask */ - -#define USBH_HcRhDescriptorA_PSM_Pos (8) /*!< USBH_T::HcRhDescriptorA: PSM Position */ -#define USBH_HcRhDescriptorA_PSM_Msk (0x1ul << USBH_HcRhDescriptorA_PSM_Pos) /*!< USBH_T::HcRhDescriptorA: PSM Mask */ - -#define USBH_HcRhDescriptorA_OCPM_Pos (11) /*!< USBH_T::HcRhDescriptorA: OCPM Position */ -#define USBH_HcRhDescriptorA_OCPM_Msk (0x1ul << USBH_HcRhDescriptorA_OCPM_Pos) /*!< USBH_T::HcRhDescriptorA: OCPM Mask */ - -#define USBH_HcRhDescriptorA_NOCP_Pos (12) /*!< USBH_T::HcRhDescriptorA: NOCP Position */ -#define USBH_HcRhDescriptorA_NOCP_Msk (0x1ul << USBH_HcRhDescriptorA_NOCP_Pos) /*!< USBH_T::HcRhDescriptorA: NOCP Mask */ - -#define USBH_HcRhDescriptorB_PPCM_Pos (16) /*!< USBH_T::HcRhDescriptorB: PPCM Position */ -#define USBH_HcRhDescriptorB_PPCM_Msk (0xfffful << USBH_HcRhDescriptorB_PPCM_Pos) /*!< USBH_T::HcRhDescriptorB: PPCM Mask */ - -#define USBH_HcRhStatus_LPS_Pos (0) /*!< USBH_T::HcRhStatus: LPS Position */ -#define USBH_HcRhStatus_LPS_Msk (0x1ul << USBH_HcRhStatus_LPS_Pos) /*!< USBH_T::HcRhStatus: LPS Mask */ - -#define USBH_HcRhStatus_OCI_Pos (1) /*!< USBH_T::HcRhStatus: OCI Position */ -#define USBH_HcRhStatus_OCI_Msk (0x1ul << USBH_HcRhStatus_OCI_Pos) /*!< USBH_T::HcRhStatus: OCI Mask */ - -#define USBH_HcRhStatus_DRWE_Pos (15) /*!< USBH_T::HcRhStatus: DRWE Position */ -#define USBH_HcRhStatus_DRWE_Msk (0x1ul << USBH_HcRhStatus_DRWE_Pos) /*!< USBH_T::HcRhStatus: DRWE Mask */ - -#define USBH_HcRhStatus_LPSC_Pos (16) /*!< USBH_T::HcRhStatus: LPSC Position */ -#define USBH_HcRhStatus_LPSC_Msk (0x1ul << USBH_HcRhStatus_LPSC_Pos) /*!< USBH_T::HcRhStatus: LPSC Mask */ - -#define USBH_HcRhStatus_OCIC_Pos (17) /*!< USBH_T::HcRhStatus: OCIC Position */ -#define USBH_HcRhStatus_OCIC_Msk (0x1ul << USBH_HcRhStatus_OCIC_Pos) /*!< USBH_T::HcRhStatus: OCIC Mask */ - -#define USBH_HcRhStatus_CRWE_Pos (31) /*!< USBH_T::HcRhStatus: CRWE Position */ -#define USBH_HcRhStatus_CRWE_Msk (0x1ul << USBH_HcRhStatus_CRWE_Pos) /*!< USBH_T::HcRhStatus: CRWE Mask */ - -#define USBH_HcRhPortStatus_CCS_Pos (0) /*!< USBH_T::HcRhPortStatus1: CCS Position */ -#define USBH_HcRhPortStatus_CCS_Msk (0x1ul << USBH_HcRhPortStatus_CCS_Pos) /*!< USBH_T::HcRhPortStatus1: CCS Mask */ - -#define USBH_HcRhPortStatus_PES_Pos (1) /*!< USBH_T::HcRhPortStatus1: PES Position */ -#define USBH_HcRhPortStatus_PES_Msk (0x1ul << USBH_HcRhPortStatus_PES_Pos) /*!< USBH_T::HcRhPortStatus1: PES Mask */ - -#define USBH_HcRhPortStatus_PSS_Pos (2) /*!< USBH_T::HcRhPortStatus1: PSS Position */ -#define USBH_HcRhPortStatus_PSS_Msk (0x1ul << USBH_HcRhPortStatus_PSS_Pos) /*!< USBH_T::HcRhPortStatus1: PSS Mask */ - -#define USBH_HcRhPortStatus_POCI_Pos (3) /*!< USBH_T::HcRhPortStatus1: POCI Position */ -#define USBH_HcRhPortStatus_POCI_Msk (0x1ul << USBH_HcRhPortStatus_POCI_Pos) /*!< USBH_T::HcRhPortStatus1: POCI Mask */ - -#define USBH_HcRhPortStatus_PRS_Pos (4) /*!< USBH_T::HcRhPortStatus1: PRS Position */ -#define USBH_HcRhPortStatus_PRS_Msk (0x1ul << USBH_HcRhPortStatus_PRS_Pos) /*!< USBH_T::HcRhPortStatus1: PRS Mask */ - -#define USBH_HcRhPortStatus_PPS_Pos (8) /*!< USBH_T::HcRhPortStatus1: PPS Position */ -#define USBH_HcRhPortStatus_PPS_Msk (0x1ul << USBH_HcRhPortStatus_PPS_Pos) /*!< USBH_T::HcRhPortStatus1: PPS Mask */ - -#define USBH_HcRhPortStatus_LSDA_Pos (9) /*!< USBH_T::HcRhPortStatus1: LSDA Position */ -#define USBH_HcRhPortStatus_LSDA_Msk (0x1ul << USBH_HcRhPortStatus_LSDA_Pos) /*!< USBH_T::HcRhPortStatus1: LSDA Mask */ - -#define USBH_HcRhPortStatus_CSC_Pos (16) /*!< USBH_T::HcRhPortStatus1: CSC Position */ -#define USBH_HcRhPortStatus_CSC_Msk (0x1ul << USBH_HcRhPortStatus_CSC_Pos) /*!< USBH_T::HcRhPortStatus1: CSC Mask */ - -#define USBH_HcRhPortStatus_PESC_Pos (17) /*!< USBH_T::HcRhPortStatus1: PESC Position */ -#define USBH_HcRhPortStatus_PESC_Msk (0x1ul << USBH_HcRhPortStatus_PESC_Pos) /*!< USBH_T::HcRhPortStatus1: PESC Mask */ - -#define USBH_HcRhPortStatus_PSSC_Pos (18) /*!< USBH_T::HcRhPortStatus1: PSSC Position */ -#define USBH_HcRhPortStatus_PSSC_Msk (0x1ul << USBH_HcRhPortStatus_PSSC_Pos) /*!< USBH_T::HcRhPortStatus1: PSSC Mask */ - -#define USBH_HcRhPortStatus_OCIC_Pos (19) /*!< USBH_T::HcRhPortStatus1: OCIC Position */ -#define USBH_HcRhPortStatus_OCIC_Msk (0x1ul << USBH_HcRhPortStatus_OCIC_Pos) /*!< USBH_T::HcRhPortStatus1: OCIC Mask */ - -#define USBH_HcRhPortStatus_PRSC_Pos (20) /*!< USBH_T::HcRhPortStatus1: PRSC Position */ -#define USBH_HcRhPortStatus_PRSC_Msk (0x1ul << USBH_HcRhPortStatus_PRSC_Pos) /*!< USBH_T::HcRhPortStatus1: PRSC Mask */ - -#define USBH_HcPhyControl_STBYEN_Pos (27) /*!< USBH_T::HcPhyControl: STBYEN Position */ -#define USBH_HcPhyControl_STBYEN_Msk (0x1ul << USBH_HcPhyControl_STBYEN_Pos) /*!< USBH_T::HcPhyControl: STBYEN Mask */ - -#define USBH_HcMiscControl_ABORT_Pos (1) /*!< USBH_T::HcMiscControl: ABORT Position */ -#define USBH_HcMiscControl_ABORT_Msk (0x1ul << USBH_HcMiscControl_ABORT_Pos) /*!< USBH_T::HcMiscControl: ABORT Mask */ - -#define USBH_HcMiscControl_OCAL_Pos (3) /*!< USBH_T::HcMiscControl: OCAL Position */ -#define USBH_HcMiscControl_OCAL_Msk (0x1ul << USBH_HcMiscControl_OCAL_Pos) /*!< USBH_T::HcMiscControl: OCAL Mask */ - -#define USBH_HcMiscControl_DPRT1_Pos (16) /*!< USBH_T::HcMiscControl: DPRT1 Position */ -#define USBH_HcMiscControl_DPRT1_Msk (0x1ul << USBH_HcMiscControl_DPRT1_Pos) /*!< USBH_T::HcMiscControl: DPRT1 Mask */ - -/**@}*/ /* USBH_CONST */ -/**@}*/ /* end of USBH register group */ - - -/*---------------------- HSUSBH HSUSB Host Controller -------------------------*/ -/** - @addtogroup HSUSBH High Speed USB Host Controller (HSUSBH) - Memory Mapped Structure for HSUSBH Controller -@{ */ - -typedef struct -{ - - - /** - * @var HSUSBH_T::EHCVNR - * Offset: 0x00 EHCI Version Number Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[7:0] |CRLEN |Capability Registers Length - * | | |This register is used as an offset to add to register base to find the beginning of the Operational Register Space. - * |[31:16] |VERSION |Host Controller Interface Version Number - * | | |This is a two-byte register containing a BCD encoding of the EHCI revision number supported by this host controller - * | | |The most significant byte of this register represents a major revision and the least significant byte is the minor revision. - * @var HSUSBH_T::EHCSPR - * Offset: 0x04 EHCI Structural Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[3:0] |N_PORTS |Number of Physical Downstream Ports - * | | |This field specifies the number of physical downstream ports implemented on this host controller - * | | |The value of this field determines how many port registers are addressable in the Operational Register Space (see Table 2-8) - * | | |Valid values are in the range of 1H to FH. - * | | |A zero in this field is undefined. - * |[4] |PPC |Port Power Control - * | | |This field indicates whether the host controller implementation includes port power control - * | | |A one in this bit indicates the ports have port power switches - * | | |A zero in this bit indicates the port do not have port power stitches - * | | |The value of this field affects the functionality of the Port Power field in each port status and control register. - * |[11:8] |N_PCC |Number of Ports Per Companion Controller - * | | |This field indicates the number of ports supported per companion host controller - * | | |It is used to indicate the port routing configuration to system software. - * | | |For example, if N_PORTS has a value of 6 and N_CC has a value of 2 then N_PCC could have a value of 3 - * | | |The convention is that the first N_PCC ports are assumed to be routed to companion controller 1, the next N_PCC ports to companion controller 2, etc - * | | |In the previous example, the N_PCC could have been 4, where the first 4 are routed to companion controller 1 and the last two are routed to companion controller 2. - * | | |The number in this field must be consistent with N_PORTS and N_CC. - * |[15:12] |N_CC |Number of Companion Controller - * | | |This field indicates the number of companion controllers associated with this USB 2.0 host controller. - * | | |A zero in this field indicates there are no companion host controllers - * | | |Port-ownership hand-off is not supported - * | | |Only high-speed devices are supported on the host controller root ports. - * | | |A value larger than zero in this field indicates there are companion USB 1.1 host controller(s) - * | | |Port-ownership hand-offs are supported - * | | |High, Full- and Low-speed devices are supported on the host controller root ports. - * @var HSUSBH_T::EHCCPR - * Offset: 0x08 EHCI Capability Parameters Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |AC64 |64-bit Addressing Capability - * | | |0 = Data structure using 32-bit address memory pointers. - * |[1] |PFLF |Programmable Frame List Flag - * | | |0 = System software must use a frame list length of 1024 elements with this EHCI host controller. - * |[2] |ASPC |Asynchronous Schedule Park Capability - * | | |0 = This EHCI host controller doesn't support park feature of high-speed queue heads in the Asynchronous Schedule. - * |[7:4] |IST |Isochronous Scheduling Threshold - * | | |This field indicates, relative to the current position of the executing host controller, where software can reliably update the isochronous schedule. - * | | |When bit [7] is zero, the value of the least significant 3 bits indicates the number of micro-frames a host controller can hold a set of isochronous data structures (one or more) before flushing the state. - * |[15:8] |EECP |EHCI Extended Capabilities Pointer (EECP) - * | | |0 = No extended capabilities are implemented. - * @var HSUSBH_T::UCMDR - * Offset: 0x20 USB Command Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |RUN |Run/Stop (R/W) - * | | |When set to a 1, the Host Controller proceeds with execution of the schedule - * | | |The Host Controller continues execution as long as this bit is set to a 1 - * | | |When this bit is set to 0, the Host Controller completes the current and any actively pipelined transactions on the USB and then halts - * | | |The Host Controller must halt within 16 micro-frames after software clears the Run bit - * | | |The HC Halted bit in the status register indicates when the Host Controller has finished its pending pipelined transactions and has entered the stopped state - * | | |Software must not write a one to this field unless the host controller is in the Halted state (i.e. - * | | |HCHalted in the USBSTS register is a one) - * | | |Doing so will yield undefined results. - * | | |0 = Stop. - * | | |1 = Run. - * |[1] |HCRST |Host Controller Reset (HCRESET) (R/W) - * | | |This control bit is used by software to reset the host controller - * | | |The effects of this on Root Hub registers are similar to a Chip Hardware Reset. - * | | |When software writes a one to this bit, the Host Controller resets its internal pipelines, timers, counters, state machines, etc - * | | |to their initial value - * | | |Any transaction currently in progress on USB is immediately terminated - * | | |A USB reset is not driven on downstream ports. - * | | |All operational registers, including port registers and port state machines are set to their initial values - * | | |Port ownership reverts to the companion host controller(s), with the side effects - * | | |Software must reinitialize the host controller in order to return the host controller to an operational state. - * | | |This bit is set to zero by the Host Controller when the reset process is complete - * | | |Software cannot terminate the reset process early by writing a zero to this register. - * | | |Software should not set this bit to a one when the HCHalted bit in the USBSTS register is a zero - * | | |Attempting to reset an actively running host controller will result in undefined behavior. - * |[3:2] |FLSZ |Frame List Size (R/W or RO) - * | | |This field is R/W only if Programmable Frame List Flag in the HCCPARAMS registers is set to a one - * | | |This field specifies the size of the frame list - * | | |The size the frame list controls which bits in the Frame Index Register should be used for the Frame List Current index - * | | |Values mean: - * | | |00 = 1024 elements (4096 bytes) Default value. - * | | |01 = 512 elements (2048 bytes). - * | | |10 = 256 elements (1024 bytes) u2013 for resource-constrained environment. - * | | |11 = Reserved. - * |[4] |PSEN |Periodic Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Periodic Schedule. Values mean: - * | | |0 = Do not process the Periodic Schedule. - * | | |1 = Use the PERIODICLISTBASE register to access the Periodic Schedule. - * |[5] |ASEN |Asynchronous Schedule Enable (R/W) - * | | |This bit controls whether the host controller skips processing the Asynchronous Schedule. Values mean: - * | | |0 = Do not process the Asynchronous Schedule. - * | | |1 = Use the ASYNCLISTADDR register to access the Asynchronous Schedule. - * |[6] |IAAD |Interrupt on Asynchronous Advance Doorbell (R/W) - * | | |This bit is used as a doorbell by software to tell the host controller to issue an interrupt the next time it advances asynchronous schedule - * | | |Software must write a 1 to this bit to ring the doorbell. - * | | |When the host controller has evicted all appropriate cached schedule state, it sets the Interrupt on Asynchronous Advance status bit in the USBSTS register - * | | |If the Interrupt on Asynchronous Advance Enable bit in the USBINTR register is a one then the host controller will assert an interrupt at the next interrupt threshold. - * | | |The host controller sets this bit to a zero after it has set the Interrupt on Asynchronous Advance status bit in the USBSTS register to a one. - * | | |Software should not write a one to this bit when the asynchronous schedule is disabled - * | | |Doing so will yield undefined results. - * |[23:16] |ITC |Interrupt Threshold Control (R/W) - * | | |This field is used by system software to select the maximum rate at which the host controller will issue interrupts - * | | |The only valid values are defined below - * | | |If software writes an invalid value to this register, the results are undefined - * | | |Value Maximum Interrupt Interval - * | | |0x00 = Reserved. - * | | |0x01 = 1 micro-frame. - * | | |0x02 = 2 micro-frames. - * | | |0x04 = 4 micro-frames. - * | | |0x08 = 8 micro-frames (default, equates to 1 ms). - * | | |0x10 = 16 micro-frames (2 ms). - * | | |0x20 = 32 micro-frames (4 ms). - * | | |0x40 = 64 micro-frames (8 ms). - * | | |Any other value in this register yields undefined results. - * | | |Software modifications to this bit while HCHalted bit is equal to zero results in undefined behavior. - * @var HSUSBH_T::USTSR - * Offset: 0x24 USB Status Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBINT |USB Interrupt (USBINT) (R/WC) - * | | |The Host Controller sets this bit to 1 on the completion of a USB transaction, which results in the retirement of a Transfer Descriptor that had its IOC bit set. - * | | |The Host Controller also sets this bit to 1 when a short packet is detected (actual number of bytes received was less than the expected number of bytes). - * |[1] |UERRINT |USB Error Interrupt (USBERRINT) (R/WC) - * | | |The Host Controller sets this bit to 1 when completion of a USB transaction results in an error condition (e.g., error counter underflow) - * | | |If the TD on which the error interrupt occurred also had its IOC bit set, both this bit and USBINT bit are set. - * |[2] |PCD |Port Change Detect (R/WC) - * | | |The Host Controller sets this bit to a one when any port for which the Port Owner bit is set to zero has a change bit transition from a zero to a one or a Force Port Resume bit transition from a zero to a one as a result of a J-K transition detected on a suspended port - * | | |This bit will also be set as a result of the Connect Status Change being set to a one after system software has relinquished ownership of a connected port by writing a one to a port's Port Owner bit. - * | | |This bit is allowed to be maintained in the Auxiliary power well - * | | |Alternatively, it is also acceptable that on a D3 to D0 transition of the EHCI HC device, this bit is loaded with the OR of all of the PORTSC change bits (including: Force port resume, over-current change, enable/disable change and connect status change). - * |[3] |FLR |Frame List Rollover (R/WC) - * | | |The Host Controller sets this bit to a one when the Frame List Index rolls over from its maximum value to zero - * | | |The exact value at which the rollover occurs depends on the frame list size - * | | |For example, if the frame list size (as programmed in the Frame List Size field of the USBCMD register) is 1024, the Frame Index Register rolls over every time FRINDEX[13] toggles - * | | |Similarly, if the size is 512, the Host Controller sets this bit to a one every time FRINDEX[12] toggles. - * |[4] |HSERR |Host System Error (R/WC) - * | | |The Host Controller sets this bit to 1 when a serious error occurs during a host system access involving the Host Controller module. - * |[5] |IAA |Interrupt on Asynchronous Advance (R/WC) - * | | |System software can force the host controller to issue an interrupt the next time the host controller advances the asynchronous schedule by writing a one to the Interrupt on Asynchronous Advance Doorbell bit in the USBCMD register - * | | |This status bit indicates the assertion of that interrupt source. - * |[12] |HCHalted |HCHalted (RO) - * | | |This bit is a zero whenever the Run/Stop bit is a one - * | | |The Host Controller sets this bit to one after it has stopped executing as a result of the Run/Stop bit being set to 0, either by software or by the Host Controller hardware (e.g. - * | | |internal error). - * |[13] |RECLA |Reclamation (RO) - * | | |This is a read-only status bit, which is used to detect an empty asynchronous schedule. - * |[14] |PSS |Periodic Schedule Status (RO) - * | | |The bit reports the current real status of the Periodic Schedule - * | | |If this bit is a zero then the status of the Periodic Schedule is disabled - * | | |If this bit is a one then the status of the Periodic Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Periodic Schedule when software transitions the Periodic Schedule Enable bit in the USBCMD register - * | | |When this bit and the Periodic Schedule Enable bit are the same value, the Periodic Schedule is either enabled (1) or disabled (0). - * |[15] |ASS |Asynchronous Schedule Status (RO) - * | | |The bit reports the current real status of the Asynchronous Schedule - * | | |If this bit is a zero then the status of them Asynchronous Schedule is disabled - * | | |If this bit is a one then the status of the Asynchronous Schedule is enabled - * | | |The Host Controller is not required to immediately disable or enable the Asynchronous Schedule when software transitions the Asynchronous Schedule Enable bit in the USBCMD register - * | | |When this bit and the Asynchronous Schedule Enable bit are the same value, the Asynchronous Schedule is either enabled (1) or disabled (0). - * @var HSUSBH_T::UIENR - * Offset: 0x28 USB Interrupt Enable Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |USBIEN |USB Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBINT bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBINT bit. - * | | |0 = USB interrupt Disabled. - * | | |1 = USB interrupt Enabled. - * |[1] |UERRIEN |USB Error Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the USBERRINT bit in the USBSTS register is a one, the host t controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the USBERRINT bit. - * | | |0 = USB Error interrupt Disabled. - * | | |1 = USB Error interrupt Enabled. - * |[2] |PCIEN |Port Change Interrupt Enable or Disable Bit - * | | |When this bit is a one, and the Port Change Detect bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Port Change Detect bit. - * | | |0 = Port Change interrupt Disabled. - * | | |1 = Port Change interrupt Enabled. - * |[3] |FLREN |Frame List Rollover Enable or Disable Bit - * | | |When this bit is a one, and the Frame List Rollover bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Frame List Rollover bit. - * | | |0 = Frame List Rollover interrupt Disabled. - * | | |1 = Frame List Rollover interrupt Enabled. - * |[4] |HSERREN |Host System Error Enable or Disable Bit - * | | |When this bit is a one, and the Host System Error Status bit in the USBSTS register is a one, the host controller will issue an interrupt - * | | |The interrupt is acknowledged by software clearing the Host System Error bit. - * | | |0 = Host System Error interrupt Disabled. - * | | |1 = Host System Error interrupt Enabled. - * |[5] |IAAEN |Interrupt on Asynchronous Advance Enable or Disable Bit - * | | |When this bit is a one, and the Interrupt on Asynchronous Advance bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold - * | | |The interrupt is acknowledged by software clearing the Interrupt on Asynchronous Advance bit. - * | | |0 = Interrupt on Asynchronous Advance Disabled. - * | | |1 = Interrupt on Asynchronous Advance Enabled. - * @var HSUSBH_T::UFINDR - * Offset: 0x2C USB Frame Index Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[13:0] |FI |Frame Index - * | | |The value in this register increment at the end of each time frame (e.g. - * | | |micro-frame) - * | | |Bits [N:3] are used for the Frame List current index - * | | |This means that each location of the frame list is accessed 8 times (frames or micro-frames) before moving to the next index - * | | |The following illustrates values of N based on the value of the Frame List Size field in the USBCMD register. - * | | |FLSZ (UCMDR[3:2] Number Elements N - * | | |0x0 1024 12 - * | | |0x1 512 11 - * | | |0x2 256 10 - * | | |0x3 Reserved - * @var HSUSBH_T::UPFLBAR - * Offset: 0x34 USB Periodic Frame List Base Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:12] |BADDR |Base Address - * | | |These bits correspond to memory address signals [31:12], respectively. - * @var HSUSBH_T::UCALAR - * Offset: 0x38 USB Current Asynchronous List Address Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[31:5] |LPL |Link Pointer Low (LPL) - * | | |These bits correspond to memory address signals [31:5], respectively - * | | |This field may only reference a Queue Head (QH). - * @var HSUSBH_T::UASSTR - * Offset: 0x3C USB Asynchronous Schedule Sleep Timer Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[11:0] |ASSTMR |Asynchronous Schedule Sleep Timer - * | | |This field defines the AsyncSchedSleepTime of EHCI spec. - * | | |The asynchronous schedule sleep timer is used to control how often the host controller fetches asynchronous schedule list from system memory while the asynchronous schedule is empty. - * | | |The default value of this timer is 12'hBD6 - * | | |Because this timer is implemented in UTMI clock (30MHz) domain, the default sleeping time will be about 100us. - * @var HSUSBH_T::UCFGR - * Offset: 0x60 USB Configure Flag Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CF |Configure Flag (CF) - * | | |Host software sets this bit as the last action in its process of configuring the Host Controller - * | | |This bit controls the default port-routing control logic - * | | |Bit values and side-effects are listed below. - * | | |0 = Port routing control logic default-routes each port to an implementation dependent classic host controller. - * | | |1 = Port routing control logic default-routes all ports to this host controller. - * @var HSUSBH_T::UPSCR[2] - * Offset: 0x64~0x68 USB Port 0~1 Status and Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[0] |CCS |Current Connect Status (RO) - * | | |This value reflects the current state of the port, and may not correspond directly to the event that caused the Connect Status Change bit (Bit 1) to be set. - * | | |This field is zero if Port Power is zero. - * | | |0 = No device is present. - * | | |1 = Device is present on port. - * |[1] |CSC |Connect Status Change (R/W) - * | | |Indicates a change has occurred in the port's Current Connect Status - * | | |The host controller sets this bit for all changes to the port device connect status, even if system software has not cleared an existing connect status change - * | | |For example, the insertion status changes twice before system software has cleared the changed condition, hub hardware will be "setting" an already-set bit (i.e., the bit will remain set).Software sets this bit to 0 by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Change in Current Connect Status. - * |[2] |PE |Port Enabled/Disabled (R/W) - * | | |Ports can only be enabled by the host controller as a part of the reset and enable - * | | |Software cannot enable a port by writing a one to this field - * | | |The host controller will only set this bit to a one when the reset sequence determines that the attached device is a high-speed device. - * | | |Ports can be disabled by either a fault condition (disconnect event or other fault condition) or by host software - * | | |Note that the bit status does not change until the port state actually changes - * | | |There may be a delay in disabling or enabling a port due to other host controller and bus events. - * | | |When the port is disabled (0b) downstream propagation of data is blocked on this port, except for reset. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port Disabled. - * | | |1 = Port Enabled. - * |[3] |PEC |Port Enable/Disable Change (R/WC) - * | | |For the root hub, this bit gets set to a one only when a port is disabled due to the appropriate conditions existing at the EOF2 point (See Chapter 11 of the USB Specification for the definition of a Port Error) - * | | |Software clears this bit by writing a 1 to it. - * | | |This field is zero if Port Power is zero. - * | | |0 = No change. - * | | |1 = Port enabled/disabled status has changed. - * |[4] |OCA |Over-current Active (RO) - * | | |This bit will automatically transition from a one to a zero when the over current condition is removed. - * | | |0 = This port does not have an over-current condition. - * | | |1 = This port currently has an over-current condition. - * |[5] |OCC |Over-current Change (R/WC) - * | | |1 = This bit gets set to a one when there is a change to Over-current Active - * | | |Software clears this bit by writing a one to this bit position. - * |[6] |FPR |Force Port Resume (R/W) - * | | |This functionality defined for manipulating this bit depends on the value of the Suspend bit - * | | |For example, if the port is not suspended (Suspend and Enabled bits are a one) and software transitions this bit to a one, then the effects on the bus are undefined. - * | | |Software sets this bit to a 1 to drive resume signaling - * | | |The Host Controller sets this bit to a 1 if a J-to-K transition is detected while the port is in the Suspend state - * | | |When this bit transitions to a one because a J-to-K transition is detected, the Port Change Detect bit in the USBSTS register is also set to a one - * | | |If software sets this bit to a one, the host controller must not set the Port Change Detect bit. - * | | |Note that when the EHCI controller owns the port, the resume sequence follows the defined sequence documented in the USB Specification Revision 2.0 - * | | |The resume signaling (Full-speed 'K') is driven on the port as long as this bit remains a one - * | | |Software must appropriately time the Resume and set this bit to a zero when the appropriate amount of time has elapsed - * | | |Writing a zero (from one) causes the port to return to high-speed mode (forcing the bus below the port into a high-speed idle) - * | | |This bit will remain a one until the port has switched to the high-speed idle - * | | |The host controller must complete this transition within 2 milliseconds of software setting this bit to a zero. - * | | |This field is zero if Port Power is zero. - * | | |0 = No resume (K-state) detected/driven on port. - * | | |1 = Resume detected/driven on port. - * |[7] |SUSPEND |Suspend (R/W) - * | | |Port Enabled Bit and Suspend bit of this register define the port states as follows: - * | | |Port enable is 0 and suspend is 0 = Disable. - * | | |Port enable is 0 and suspend is 1 = Disable. - * | | |Port enable is 1 and suspend is 0 = Enable. - * | | |Port enable is 1 and suspend is 1 = Suspend. - * | | |When in suspend state, downstream propagation of data is blocked on this port, except for port reset - * | | |The blocking occurs at the end of the current transaction, if a transaction was in progress when this bit was written to 1 - * | | |In the suspend state, the port is sensitive to resume detection - * | | |Note that the bit status does not change until the port is suspended and that there may be a delay in suspending a port if there is a transaction currently in progress on the USB. - * | | |A write of zero to this bit is ignored by the host controller - * | | |The host controller will unconditionally set this bit to a zero when: - * | | |Software sets the Force Port Resume bit to a zero (from a one). - * | | |Software sets the Port Reset bit to a one (from a zero). - * | | |If host software sets this bit to a one when the port is not enabled (i.e. - * | | |Port enabled bit is a zero) the results are undefined. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port not in suspend state. - * | | |1 = Port in suspend state. - * |[8] |PRST |Port Reset (R/W) - * | | |When software writes a one to this bit (from a zero), the bus reset sequence as defined in the USB Specification Revision 2.0 is started - * | | |Software writes a zero to this bit to terminate the bus reset sequence - * | | |Software must keep this bit at a one long enough to ensure the reset sequence, as specified in the USB Specification Revision 2.0, completes - * | | |Note: when software writes this bit to a one, it must also write a zero to the Port Enable bit. - * | | |Note that when software writes a zero to this bit there may be a delay before the bit status changes to a zero - * | | |The bit status will not read as a zero until after the reset has completed - * | | |If the port is in high-speed mode after reset is complete, the host controller will automatically enable this port (e.g. - * | | |set the Port Enable bit to a one) - * | | |A host controller must terminate the reset and stabilize the state of the port within 2 milliseconds of software transitioning this bit from a one to a zero - * | | |For example: if the port detects that the attached device is high-speed during reset, then the host controller must have the port in the enabled state within 2ms of software writing this bit to a zero. - * | | |The HCHalted bit in the USBSTS register should be a zero before software attempts to use this bit - * | | |The host controller may hold Port Reset asserted to a one when the HCHalted bit is a one. - * | | |This field is zero if Port Power is zero. - * | | |0 = Port is not in Reset. - * | | |1 = Port is in Reset. - * |[11:10] |LSTS |Line Status (RO) - * | | |These bits reflect the current logical levels of the D+ (bit 11) and D- (bit 10) signal lines - * | | |These bits are used for detection of low-speed USB devices prior to the port reset and enable sequence - * | | |This field is valid only when the port enable bit is zero and the current connect status bit is set to a one. - * | | |The encoding of the bits are: - * | | |Bits[11:10] USB State Interpretation - * | | |00 = SE0 Not Low-speed device, perform EHCI reset. - * | | |01 = K-state Low-speed device, release ownership of port. - * | | |10 = J-state Not Low-speed device, perform EHCI reset. - * | | |11 = Undefined Not Low-speed device, perform EHCI reset. - * | | |This value of this field is undefined if Port Power is zero. - * |[12] |PP |Port Power (PP) - * | | |Host controller has port power control switches - * | | |This bit represents the Current setting of the switch (0 = off, 1 = on) - * | | |When power is not available on a port (i.e. - * | | |PP equals a 0), the port is nonfunctional and will not report attaches, detaches, etc. - * | | |When an over-current condition is detected on a powered port and PPC is a one, the PP bit in each affected port may be transitioned by the host controller from a 1 to 0 (removing power from the port). - * |[13] |PO |Port Owner (R/W) - * | | |This bit unconditionally goes to a 0b when the Configured bit in the CONFIGFLAG register makes a 0 to 1 transition - * | | |This bit unconditionally goes to 1 whenever the Configured bit is zero. - * | | |System software uses this field to release ownership of the port to a selected host controller (in the event that the attached device is not a high-speed device) - * | | |Software writes a one to this bit when the attached device is not a high-speed device - * | | |A one in this bit means that a companion host controller owns and controls the port. - * |[19:16] |PTC |Port Test Control (R/W) - * | | |When this field is zero, the port is NOT operating in a test mode - * | | |A non-zero value indicates that it is operating in test mode and the specific test mode is indicated by the specific value - * | | |The encoding of the test mode bits are (0x6 ~ 0xF are reserved): - * | | |Bits Test Mode - * | | |0x0 = Test mode not enabled. - * | | |0x1 = Test J_STATE. - * | | |0x2 = Test K_STATE. - * | | |0x3 = Test SE0_NAK. - * | | |0x4 = Test Packet. - * | | |0x5 = Test FORCE_ENABLE. - * @var HSUSBH_T::USBPCR0 - * Offset: 0xC4 USB PHY 0 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 0. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 0 was suspended. - * | | |1 = USB PHY 0 was not suspended. - * |[11] |CLKVALID |UTMI Clock Valid - * | | |This bit is a flag to indicate if the UTMI clock from USB 2.0 PHY is ready - * | | |S/W program must prevent to write other control registers before this UTMI clock valid flag is active. - * | | |0 = UTMI clock is not valid. - * | | |1 = UTMI clock is valid. - * @var HSUSBH_T::USBPCR1 - * Offset: 0xC8 USB PHY 1 Control Register - * --------------------------------------------------------------------------------------------------- - * |Bits |Field |Descriptions - * | :----: | :----: | :---- | - * |[8] |SUSPEND |Suspend Assertion - * | | |This bit controls the suspend mode of USB PHY 1. - * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state. - * | | |This bit is 1'b0 in default - * | | |This means the USB PHY 0 is suspended in default - * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host. - * | | |0 = USB PHY 1 was suspended. - * | | |1 = USB PHY 1 was not suspended. - */ - __I uint32_t EHCVNR; /*!< [0x0000] EHCI Version Number Register */ - __I uint32_t EHCSPR; /*!< [0x0004] EHCI Structural Parameters Register */ - __I uint32_t EHCCPR; /*!< [0x0008] EHCI Capability Parameters Register */ - __I uint32_t RESERVE0[5]; - __IO uint32_t UCMDR; /*!< [0x0020] USB Command Register */ - __IO uint32_t USTSR; /*!< [0x0024] USB Status Register */ - __IO uint32_t UIENR; /*!< [0x0028] USB Interrupt Enable Register */ - __IO uint32_t UFINDR; /*!< [0x002c] USB Frame Index Register */ - __I uint32_t RESERVE1[1]; - __IO uint32_t UPFLBAR; /*!< [0x0034] USB Periodic Frame List Base Address Register */ - __IO uint32_t UCALAR; /*!< [0x0038] USB Current Asynchronous List Address Register */ - __IO uint32_t UASSTR; /*!< [0x003c] USB Asynchronous Schedule Sleep Timer Register */ - __I uint32_t RESERVE2[8]; - __IO uint32_t UCFGR; /*!< [0x0060] USB Configure Flag Register */ - __IO uint32_t UPSCR[2]; /*!< [0x0064] ~ [0x0068] USB Port 0 & 1 Status and Control Register */ - __I uint32_t RESERVE3[22]; - __IO uint32_t USBPCR0; /*!< [0x00c4] USB PHY 0 Control Register */ - __IO uint32_t USBPCR1; /*!< [0x00c8] USB PHY 1 Control Register */ - -} HSUSBH_T; - -/** - @addtogroup HSUSBH_CONST HSUSBH Bit Field Definition - Constant Definitions for HSUSBH Controller -@{ */ - -#define HSUSBH_EHCVNR_CRLEN_Pos (0) /*!< HSUSBH_T::EHCVNR: CRLEN Position */ -#define HSUSBH_EHCVNR_CRLEN_Msk (0xfful << HSUSBH_EHCVNR_CRLEN_Pos) /*!< HSUSBH_T::EHCVNR: CRLEN Mask */ - -#define HSUSBH_EHCVNR_VERSION_Pos (16) /*!< HSUSBH_T::EHCVNR: VERSION Position */ -#define HSUSBH_EHCVNR_VERSION_Msk (0xfffful << HSUSBH_EHCVNR_VERSION_Pos) /*!< HSUSBH_T::EHCVNR: VERSION Mask */ - -#define HSUSBH_EHCSPR_N_PORTS_Pos (0) /*!< HSUSBH_T::EHCSPR: N_PORTS Position */ -#define HSUSBH_EHCSPR_N_PORTS_Msk (0xful << HSUSBH_EHCSPR_N_PORTS_Pos) /*!< HSUSBH_T::EHCSPR: N_PORTS Mask */ - -#define HSUSBH_EHCSPR_PPC_Pos (4) /*!< HSUSBH_T::EHCSPR: PPC Position */ -#define HSUSBH_EHCSPR_PPC_Msk (0x1ul << HSUSBH_EHCSPR_PPC_Pos) /*!< HSUSBH_T::EHCSPR: PPC Mask */ - -#define HSUSBH_EHCSPR_N_PCC_Pos (8) /*!< HSUSBH_T::EHCSPR: N_PCC Position */ -#define HSUSBH_EHCSPR_N_PCC_Msk (0xful << HSUSBH_EHCSPR_N_PCC_Pos) /*!< HSUSBH_T::EHCSPR: N_PCC Mask */ - -#define HSUSBH_EHCSPR_N_CC_Pos (12) /*!< HSUSBH_T::EHCSPR: N_CC Position */ -#define HSUSBH_EHCSPR_N_CC_Msk (0xful << HSUSBH_EHCSPR_N_CC_Pos) /*!< HSUSBH_T::EHCSPR: N_CC Mask */ - -#define HSUSBH_EHCCPR_AC64_Pos (0) /*!< HSUSBH_T::EHCCPR: AC64 Position */ -#define HSUSBH_EHCCPR_AC64_Msk (0x1ul << HSUSBH_EHCCPR_AC64_Pos) /*!< HSUSBH_T::EHCCPR: AC64 Mask */ - -#define HSUSBH_EHCCPR_PFLF_Pos (1) /*!< HSUSBH_T::EHCCPR: PFLF Position */ -#define HSUSBH_EHCCPR_PFLF_Msk (0x1ul << HSUSBH_EHCCPR_PFLF_Pos) /*!< HSUSBH_T::EHCCPR: PFLF Mask */ - -#define HSUSBH_EHCCPR_ASPC_Pos (2) /*!< HSUSBH_T::EHCCPR: ASPC Position */ -#define HSUSBH_EHCCPR_ASPC_Msk (0x1ul << HSUSBH_EHCCPR_ASPC_Pos) /*!< HSUSBH_T::EHCCPR: ASPC Mask */ - -#define HSUSBH_EHCCPR_IST_Pos (4) /*!< HSUSBH_T::EHCCPR: IST Position */ -#define HSUSBH_EHCCPR_IST_Msk (0xful << HSUSBH_EHCCPR_IST_Pos) /*!< HSUSBH_T::EHCCPR: IST Mask */ - -#define HSUSBH_EHCCPR_EECP_Pos (8) /*!< HSUSBH_T::EHCCPR: EECP Position */ -#define HSUSBH_EHCCPR_EECP_Msk (0xfful << HSUSBH_EHCCPR_EECP_Pos) /*!< HSUSBH_T::EHCCPR: EECP Mask */ - -#define HSUSBH_UCMDR_RUN_Pos (0) /*!< HSUSBH_T::UCMDR: RUN Position */ -#define HSUSBH_UCMDR_RUN_Msk (0x1ul << HSUSBH_UCMDR_RUN_Pos) /*!< HSUSBH_T::UCMDR: RUN Mask */ - -#define HSUSBH_UCMDR_HCRST_Pos (1) /*!< HSUSBH_T::UCMDR: HCRST Position */ -#define HSUSBH_UCMDR_HCRST_Msk (0x1ul << HSUSBH_UCMDR_HCRST_Pos) /*!< HSUSBH_T::UCMDR: HCRST Mask */ - -#define HSUSBH_UCMDR_FLSZ_Pos (2) /*!< HSUSBH_T::UCMDR: FLSZ Position */ -#define HSUSBH_UCMDR_FLSZ_Msk (0x3ul << HSUSBH_UCMDR_FLSZ_Pos) /*!< HSUSBH_T::UCMDR: FLSZ Mask */ - -#define HSUSBH_UCMDR_PSEN_Pos (4) /*!< HSUSBH_T::UCMDR: PSEN Position */ -#define HSUSBH_UCMDR_PSEN_Msk (0x1ul << HSUSBH_UCMDR_PSEN_Pos) /*!< HSUSBH_T::UCMDR: PSEN Mask */ - -#define HSUSBH_UCMDR_ASEN_Pos (5) /*!< HSUSBH_T::UCMDR: ASEN Position */ -#define HSUSBH_UCMDR_ASEN_Msk (0x1ul << HSUSBH_UCMDR_ASEN_Pos) /*!< HSUSBH_T::UCMDR: ASEN Mask */ - -#define HSUSBH_UCMDR_IAAD_Pos (6) /*!< HSUSBH_T::UCMDR: IAAD Position */ -#define HSUSBH_UCMDR_IAAD_Msk (0x1ul << HSUSBH_UCMDR_IAAD_Pos) /*!< HSUSBH_T::UCMDR: IAAD Mask */ - -#define HSUSBH_UCMDR_ITC_Pos (16) /*!< HSUSBH_T::UCMDR: ITC Position */ -#define HSUSBH_UCMDR_ITC_Msk (0xfful << HSUSBH_UCMDR_ITC_Pos) /*!< HSUSBH_T::UCMDR: ITC Mask */ - -#define HSUSBH_USTSR_USBINT_Pos (0) /*!< HSUSBH_T::USTSR: USBINT Position */ -#define HSUSBH_USTSR_USBINT_Msk (0x1ul << HSUSBH_USTSR_USBINT_Pos) /*!< HSUSBH_T::USTSR: USBINT Mask */ - -#define HSUSBH_USTSR_UERRINT_Pos (1) /*!< HSUSBH_T::USTSR: UERRINT Position */ -#define HSUSBH_USTSR_UERRINT_Msk (0x1ul << HSUSBH_USTSR_UERRINT_Pos) /*!< HSUSBH_T::USTSR: UERRINT Mask */ - -#define HSUSBH_USTSR_PCD_Pos (2) /*!< HSUSBH_T::USTSR: PCD Position */ -#define HSUSBH_USTSR_PCD_Msk (0x1ul << HSUSBH_USTSR_PCD_Pos) /*!< HSUSBH_T::USTSR: PCD Mask */ - -#define HSUSBH_USTSR_FLR_Pos (3) /*!< HSUSBH_T::USTSR: FLR Position */ -#define HSUSBH_USTSR_FLR_Msk (0x1ul << HSUSBH_USTSR_FLR_Pos) /*!< HSUSBH_T::USTSR: FLR Mask */ - -#define HSUSBH_USTSR_HSERR_Pos (4) /*!< HSUSBH_T::USTSR: HSERR Position */ -#define HSUSBH_USTSR_HSERR_Msk (0x1ul << HSUSBH_USTSR_HSERR_Pos) /*!< HSUSBH_T::USTSR: HSERR Mask */ - -#define HSUSBH_USTSR_IAA_Pos (5) /*!< HSUSBH_T::USTSR: IAA Position */ -#define HSUSBH_USTSR_IAA_Msk (0x1ul << HSUSBH_USTSR_IAA_Pos) /*!< HSUSBH_T::USTSR: IAA Mask */ - -#define HSUSBH_USTSR_HCHalted_Pos (12) /*!< HSUSBH_T::USTSR: HCHalted Position */ -#define HSUSBH_USTSR_HCHalted_Msk (0x1ul << HSUSBH_USTSR_HCHalted_Pos) /*!< HSUSBH_T::USTSR: HCHalted Mask */ - -#define HSUSBH_USTSR_RECLA_Pos (13) /*!< HSUSBH_T::USTSR: RECLA Position */ -#define HSUSBH_USTSR_RECLA_Msk (0x1ul << HSUSBH_USTSR_RECLA_Pos) /*!< HSUSBH_T::USTSR: RECLA Mask */ - -#define HSUSBH_USTSR_PSS_Pos (14) /*!< HSUSBH_T::USTSR: PSS Position */ -#define HSUSBH_USTSR_PSS_Msk (0x1ul << HSUSBH_USTSR_PSS_Pos) /*!< HSUSBH_T::USTSR: PSS Mask */ - -#define HSUSBH_USTSR_ASS_Pos (15) /*!< HSUSBH_T::USTSR: ASS Position */ -#define HSUSBH_USTSR_ASS_Msk (0x1ul << HSUSBH_USTSR_ASS_Pos) /*!< HSUSBH_T::USTSR: ASS Mask */ - -#define HSUSBH_UIENR_USBIEN_Pos (0) /*!< HSUSBH_T::UIENR: USBIEN Position */ -#define HSUSBH_UIENR_USBIEN_Msk (0x1ul << HSUSBH_UIENR_USBIEN_Pos) /*!< HSUSBH_T::UIENR: USBIEN Mask */ - -#define HSUSBH_UIENR_UERRIEN_Pos (1) /*!< HSUSBH_T::UIENR: UERRIEN Position */ -#define HSUSBH_UIENR_UERRIEN_Msk (0x1ul << HSUSBH_UIENR_UERRIEN_Pos) /*!< HSUSBH_T::UIENR: UERRIEN Mask */ - -#define HSUSBH_UIENR_PCIEN_Pos (2) /*!< HSUSBH_T::UIENR: PCIEN Position */ -#define HSUSBH_UIENR_PCIEN_Msk (0x1ul << HSUSBH_UIENR_PCIEN_Pos) /*!< HSUSBH_T::UIENR: PCIEN Mask */ - -#define HSUSBH_UIENR_FLREN_Pos (3) /*!< HSUSBH_T::UIENR: FLREN Position */ -#define HSUSBH_UIENR_FLREN_Msk (0x1ul << HSUSBH_UIENR_FLREN_Pos) /*!< HSUSBH_T::UIENR: FLREN Mask */ - -#define HSUSBH_UIENR_HSERREN_Pos (4) /*!< HSUSBH_T::UIENR: HSERREN Position */ -#define HSUSBH_UIENR_HSERREN_Msk (0x1ul << HSUSBH_UIENR_HSERREN_Pos) /*!< HSUSBH_T::UIENR: HSERREN Mask */ - -#define HSUSBH_UIENR_IAAEN_Pos (5) /*!< HSUSBH_T::UIENR: IAAEN Position */ -#define HSUSBH_UIENR_IAAEN_Msk (0x1ul << HSUSBH_UIENR_IAAEN_Pos) /*!< HSUSBH_T::UIENR: IAAEN Mask */ - -#define HSUSBH_UFINDR_FI_Pos (0) /*!< HSUSBH_T::UFINDR: FI Position */ -#define HSUSBH_UFINDR_FI_Msk (0x3ffful << HSUSBH_UFINDR_FI_Pos) /*!< HSUSBH_T::UFINDR: FI Mask */ - -#define HSUSBH_UPFLBAR_BADDR_Pos (12) /*!< HSUSBH_T::UPFLBAR: BADDR Position */ -#define HSUSBH_UPFLBAR_BADDR_Msk (0xffffful << HSUSBH_UPFLBAR_BADDR_Pos) /*!< HSUSBH_T::UPFLBAR: BADDR Mask */ - -#define HSUSBH_UCALAR_LPL_Pos (5) /*!< HSUSBH_T::UCALAR: LPL Position */ -#define HSUSBH_UCALAR_LPL_Msk (0x7fffffful << HSUSBH_UCALAR_LPL_Pos) /*!< HSUSBH_T::UCALAR: LPL Mask */ - -#define HSUSBH_UASSTR_ASSTMR_Pos (0) /*!< HSUSBH_T::UASSTR: ASSTMR Position */ -#define HSUSBH_UASSTR_ASSTMR_Msk (0xffful << HSUSBH_UASSTR_ASSTMR_Pos) /*!< HSUSBH_T::UASSTR: ASSTMR Mask */ - -#define HSUSBH_UCFGR_CF_Pos (0) /*!< HSUSBH_T::UCFGR: CF Position */ -#define HSUSBH_UCFGR_CF_Msk (0x1ul << HSUSBH_UCFGR_CF_Pos) /*!< HSUSBH_T::UCFGR: CF Mask */ - -#define HSUSBH_UPSCR_CCS_Pos (0) /*!< HSUSBH_T::UPSCR[2]: CCS Position */ -#define HSUSBH_UPSCR_CCS_Msk (0x1ul << HSUSBH_UPSCR_CCS_Pos) /*!< HSUSBH_T::UPSCR[2]: CCS Mask */ - -#define HSUSBH_UPSCR_CSC_Pos (1) /*!< HSUSBH_T::UPSCR[2]: CSC Position */ -#define HSUSBH_UPSCR_CSC_Msk (0x1ul << HSUSBH_UPSCR_CSC_Pos) /*!< HSUSBH_T::UPSCR[2]: CSC Mask */ - -#define HSUSBH_UPSCR_PE_Pos (2) /*!< HSUSBH_T::UPSCR[2]: PE Position */ -#define HSUSBH_UPSCR_PE_Msk (0x1ul << HSUSBH_UPSCR_PE_Pos) /*!< HSUSBH_T::UPSCR[2]: PE Mask */ - -#define HSUSBH_UPSCR_PEC_Pos (3) /*!< HSUSBH_T::UPSCR[2]: PEC Position */ -#define HSUSBH_UPSCR_PEC_Msk (0x1ul << HSUSBH_UPSCR_PEC_Pos) /*!< HSUSBH_T::UPSCR[2]: PEC Mask */ - -#define HSUSBH_UPSCR_OCA_Pos (4) /*!< HSUSBH_T::UPSCR[2]: OCA Position */ -#define HSUSBH_UPSCR_OCA_Msk (0x1ul << HSUSBH_UPSCR_OCA_Pos) /*!< HSUSBH_T::UPSCR[2]: OCA Mask */ - -#define HSUSBH_UPSCR_OCC_Pos (5) /*!< HSUSBH_T::UPSCR[2]: OCC Position */ -#define HSUSBH_UPSCR_OCC_Msk (0x1ul << HSUSBH_UPSCR_OCC_Pos) /*!< HSUSBH_T::UPSCR[2]: OCC Mask */ - -#define HSUSBH_UPSCR_FPR_Pos (6) /*!< HSUSBH_T::UPSCR[2]: FPR Position */ -#define HSUSBH_UPSCR_FPR_Msk (0x1ul << HSUSBH_UPSCR_FPR_Pos) /*!< HSUSBH_T::UPSCR[2]: FPR Mask */ - -#define HSUSBH_UPSCR_SUSPEND_Pos (7) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Position */ -#define HSUSBH_UPSCR_SUSPEND_Msk (0x1ul << HSUSBH_UPSCR_SUSPEND_Pos) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Mask */ - -#define HSUSBH_UPSCR_PRST_Pos (8) /*!< HSUSBH_T::UPSCR[2]: PRST Position */ -#define HSUSBH_UPSCR_PRST_Msk (0x1ul << HSUSBH_UPSCR_PRST_Pos) /*!< HSUSBH_T::UPSCR[2]: PRST Mask */ - -#define HSUSBH_UPSCR_LSTS_Pos (10) /*!< HSUSBH_T::UPSCR[2]: LSTS Position */ -#define HSUSBH_UPSCR_LSTS_Msk (0x3ul << HSUSBH_UPSCR_LSTS_Pos) /*!< HSUSBH_T::UPSCR[2]: LSTS Mask */ - -#define HSUSBH_UPSCR_PP_Pos (12) /*!< HSUSBH_T::UPSCR[2]: PP Position */ -#define HSUSBH_UPSCR_PP_Msk (0x1ul << HSUSBH_UPSCR_PP_Pos) /*!< HSUSBH_T::UPSCR[2]: PP Mask */ - -#define HSUSBH_UPSCR_PO_Pos (13) /*!< HSUSBH_T::UPSCR[2]: PO Position */ -#define HSUSBH_UPSCR_PO_Msk (0x1ul << HSUSBH_UPSCR_PO_Pos) /*!< HSUSBH_T::UPSCR[2]: PO Mask */ - -#define HSUSBH_UPSCR_PTC_Pos (16) /*!< HSUSBH_T::UPSCR[2]: PTC Position */ -#define HSUSBH_UPSCR_PTC_Msk (0xful << HSUSBH_UPSCR_PTC_Pos) /*!< HSUSBH_T::UPSCR[2]: PTC Mask */ - -#define HSUSBH_USBPCR0_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR0: SUSPEND Position */ -#define HSUSBH_USBPCR0_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR0_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR0: SUSPEND Mask */ - -#define HSUSBH_USBPCR0_CLKVALID_Pos (11) /*!< HSUSBH_T::USBPCR0: CLKVALID Position */ -#define HSUSBH_USBPCR0_CLKVALID_Msk (0x1ul << HSUSBH_USBPCR0_CLKVALID_Pos) /*!< HSUSBH_T::USBPCR0: CLKVALID Mask */ - -#define HSUSBH_USBPCR1_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR1: SUSPEND Position */ -#define HSUSBH_USBPCR1_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR1_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR1: SUSPEND Mask */ - -/**@}*/ /* HSUSBH_CONST */ -/**@}*/ /* end of HSUSBH register group */ - -#define USBH ((USBH_T *)0xB0017000) -#define HSUSBH ((HSUSBH_T *)0xB0015000) - -/*----------------------------------------------------------------------------------------*/ -/* Select USBH Lite multi-function pin */ -/*----------------------------------------------------------------------------------------*/ -#define USBHL0_MFP_DP_B4 outpw(REG_SYS_GPB_MFPL, ((inpw(REG_SYS_GPB_MFPL) & 0xFFF0FFFF) | 0x00040000)) -#define USBHL0_MFP_DM_B6 outpw(REG_SYS_GPB_MFPL, ((inpw(REG_SYS_GPB_MFPL) & 0xF0FFFFFF) | 0x04000000)) -#define USBHL0_MFP_DP_B5 outpw(REG_SYS_GPB_MFPL, ((inpw(REG_SYS_GPB_MFPL) & 0xFF0FFFFF) | 0x00400000)) -#define USBHL0_MFP_DM_B7 outpw(REG_SYS_GPB_MFPL, ((inpw(REG_SYS_GPB_MFPL) & 0x0FFFFFFF) | 0x40000000)) -#define USBHL0_MFP_DP_B10 outpw(REG_SYS_GPB_MFPH, ((inpw(REG_SYS_GPB_MFPH) & 0xFFFFF0FF) | 0x00000400)) -#define USBHL0_MFP_DM_B9 outpw(REG_SYS_GPB_MFPH, ((inpw(REG_SYS_GPB_MFPH) & 0xFFFFFF0F) | 0x00000040)) -#define USBHL0_MFP_DP_D15 outpw(REG_SYS_GPD_MFPH, ((inpw(REG_SYS_GPD_MFPH) & 0x0FFFFFFF) | 0x50000000)) -#define USBHL0_MFP_DM_D14 outpw(REG_SYS_GPD_MFPH, ((inpw(REG_SYS_GPD_MFPH) & 0xF0FFFFFF) | 0x05000000)) - -#define USBHL1_MFP_DP_F1 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0xFFFFFF0F) | 0x00000060)) -#define USBHL1_MFP_DM_F0 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0xFFFFFFF0) | 0x00000006)) -#define USBHL1_MFP_DP_E1 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0xFFFFFF0F) | 0x00000060)) -#define USBHL1_MFP_DM_E0 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0xFFFFFFF0) | 0x00000006)) - -#define USBHL2_MFP_DP_F3 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0xFFFF0FFF) | 0x00006000)) -#define USBHL2_MFP_DM_F2 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0xFFFFF0FF) | 0x00000600)) -#define USBHL2_MFP_DP_E3 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0xFFFF0FFF) | 0x00006000)) -#define USBHL2_MFP_DM_E2 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0xFFFFF0FF) | 0x00000600)) - -#define USBHL3_MFP_DP_F5 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0xFF0FFFFF) | 0x00600000)) -#define USBHL3_MFP_DM_F4 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0xFFF0FFFF) | 0x00060000)) -#define USBHL3_MFP_DP_E5 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0xFF0FFFFF) | 0x00600000)) -#define USBHL3_MFP_DM_E4 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0xFFF0FFFF) | 0x00060000)) - -#define USBHL4_MFP_DP_E7 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0x0FFFFFFF) | 0x60000000)) -#define USBHL4_MFP_DM_E6 outpw(REG_SYS_GPE_MFPL, ((inpw(REG_SYS_GPE_MFPL) & 0xF0FFFFFF) | 0x06000000)) -#define USBHL4_MFP_DP_G10 outpw(REG_SYS_GPG_MFPH, ((inpw(REG_SYS_GPG_MFPH) & 0xFFFFF0FF) | 0x00000400)) -#define USBHL4_MFP_DM_A15 outpw(REG_SYS_GPA_MFPH, ((inpw(REG_SYS_GPA_MFPH) & 0x0FFFFFFF) | 0x40000000)) -#define USBHL4_MFP_DP_B13 outpw(REG_SYS_GPB_MFPH, ((inpw(REG_SYS_GPB_MFPH) & 0xFF0FFFFF) | 0x00600000)) -#define USBHL4_MFP_DM_F6 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0xF0FFFFFF) | 0x06000000)) -#define USBHL4_MFP_DP_F7 outpw(REG_SYS_GPF_MFPL, ((inpw(REG_SYS_GPF_MFPL) & 0x0FFFFFFF) | 0x60000000)) - -#define USBHL5_MFP_DP_F9 outpw(REG_SYS_GPF_MFPH, ((inpw(REG_SYS_GPF_MFPH) & 0xFFFFFF0F) | 0x00000060)) -#define USBHL5_MFP_DM_F8 outpw(REG_SYS_GPF_MFPH, ((inpw(REG_SYS_GPF_MFPH) & 0xFFFFFFF0) | 0x00000006)) -#define USBHL5_MFP_DP_E9 outpw(REG_SYS_GPE_MFPH, ((inpw(REG_SYS_GPE_MFPH) & 0xFFFFFF0F) | 0x00000060)) -#define USBHL5_MFP_DM_E8 outpw(REG_SYS_GPE_MFPH, ((inpw(REG_SYS_GPE_MFPH) & 0xFFFFFFF0) | 0x00000006)) -#define USBHL5_MFP_DP_A14 outpw(REG_SYS_GPA_MFPH, ((inpw(REG_SYS_GPA_MFPH) & 0xF0FFFFFF) | 0x04000000)) -#define USBHL5_MFP_DM_A13 outpw(REG_SYS_GPA_MFPH, ((inpw(REG_SYS_GPA_MFPH) & 0xFF0FFFFF) | 0x00400000)) -#define USBHL5_MFP_DP_B12 outpw(REG_SYS_GPB_MFPH, ((inpw(REG_SYS_GPB_MFPH) & 0xFFF0FFFF) | 0x00040000)) -#define USBHL5_MFP_DM_B11 outpw(REG_SYS_GPB_MFPH, ((inpw(REG_SYS_GPB_MFPH) & 0xFFFF0FFF) | 0x00004000)) - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_CONFIG_H_ */ - -/*** (C) COPYRIGHT 2019 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/ehci.h b/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/ehci.h deleted file mode 100644 index 4d09ed9b8fc..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/ehci.h +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************//** - * @file ehci.h - * @version V1.00 - * @brief USB EHCI host controller driver header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_EHCI_H_ -#define _USBH_EHCI_H_ - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct qh_t; -struct iso_ep_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------------*/ -/* Periodic Frame List Size (256, 512, or 1024) */ -/*----------------------------------------------------------------------------------------*/ -#define FL_SIZE 1024 /* frame list size can be 256, 512, or 1024 */ -#define NUM_IQH 11 /* depends on FL_SIZE, 256:9, 512:10, 1024:11 */ - - -/*----------------------------------------------------------------------------------------*/ -/* Interrupt Threshold Control (1, 2, 4, 6, .. 64) */ -/*----------------------------------------------------------------------------------------*/ -#define UCMDR_INT_THR_CTRL (0x1< of QH */ -} qTD_T; - - -#define QTD_LIST_END 0x1 /* Indicate the terminate of qTD list. */ -#define QTD_PTR(x) ((qTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Status: qTD Token[7:0] - */ -#define QTD_STS_PS_OUT (0<<0) /* directs the HC to issue an OUT PID */ -#define QTD_STS_PS_PING (1<<0) /* directs the HC to issue an PING PID */ -#define QTD_STS_SPLIT_STRAT (0<<1) /* directs the HC to issue an Start split */ -#define QTD_STS_SPLIT_COMPLETE (1<<1) /* directs the HC to issue an Complete split */ -#define QTD_STS_MISS_MF (1<<2) /* miss a required complete-split transaction */ -#define QTD_STS_XactErr (1<<3) /* Transaction Error occurred */ -#define QTD_STS_BABBLE (1<<4) /* Babble Detected */ -#define QTD_STS_DATA_BUFF_ERR (1<<5) /* Data Buffer Error */ -#define QTD_STS_HALT (1<<6) /* Halted */ -#define QTD_STS_ACTIVE (1<<7) /* Active */ - -/* - * PID: qTD Token[9:8] - */ -#define QTD_PID_Msk (0x3<<8) -#define QTD_PID_OUT (0<<8) /* generates token (E1H) */ -#define QTD_PID_IN (1<<8) /* generates token (69H) */ -#define QTD_PID_SETUP (2<<8) /* generates token (2DH) */ - -#define QTD_ERR_COUNTER (3<<10) /* Token[11:10] */ -#define QTD_IOC (1<<15) /* Token[15] - Interrupt On Complete */ -#define QTD_TODO_LEN_Pos 16 /* Token[31:16] - Total Bytes to Transfer */ -#define QTD_TODO_LEN(x) (((x)>>16) & 0x7FFF) -#define QTD_DT (1UL<<31) /* Token[31] - Data Toggle */ - -/*----------------------------------------------------------------------------------------*/ -/* Queue Head (QH) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct qh_t -{ - /* OHCI spec. Endpoint descriptor */ - uint32_t HLink; /* Queue Head Horizontal Link Pointer */ - uint32_t Chrst; /* Endpoint Characteristics: QH DWord 1 */ - uint32_t Cap; /* Endpoint Capabilities: QH DWord 2 */ - uint32_t Curr_qTD; /* Current qTD Pointer */ - /* - * The followings are qTD Transfer Overlay - */ - uint32_t OL_Next_qTD; /* Next qTD Pointer */ - uint32_t OL_Alt_Next_qTD; /* Alternate Next qTD Pointer */ - uint32_t OL_Token; /* qTD Token */ - uint32_t OL_Bptr[5]; /* qTD Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - qTD_T *qtd_list; /* currently linked qTD transfers */ - qTD_T *done_list; /* currently linked qTD transfers */ - struct qh_t *next; /* point to the next QH in remove list */ -} QH_T; - -/* HLink[0] T field of "Queue Head Horizontal Link Pointer" */ -#define QH_HLNK_END 0x1 - -/* - * HLink[2:1] Typ field of "Queue Head Horizontal Link Pointer" - */ -#define QH_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define QH_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define QH_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define QH_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define QH_PTR(x) ((QH_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Bit fields of "Endpoint Characteristics" - */ -#define QH_NAK_RL (4L<<28) /* Chrst[31:28] - NAK Count Reload */ -#define QH_CTRL_EP_FLAG (1<<27) /* Chrst[27] - Control Endpoint Flag */ -#define QH_RCLM_LIST_HEAD (1<<15) /* Chrst[15] - Head of Reclamation List Flag */ -#define QH_DTC (1<<14) /* Chrst[14] - Data Toggle Control */ -#define QH_EPS_FULL (0<<12) /* Chrst[13:12] - Endpoint Speed (Full) */ -#define QH_EPS_LOW (1<<12) /* Chrst[13:12] - Endpoint Speed (Low) */ -#define QH_EPS_HIGH (2<<12) /* Chrst[13:12] - Endpoint Speed (High) */ -#define QH_I_NEXT (1<<7) /* Chrst[7] - Inactivate on Next Transaction */ - -/* - * Bit fields of "Endpoint Capabilities" - */ -#define QH_MULT_Pos 30 /* Cap[31:30] - High-Bandwidth Pipe Multiplier */ -#define QH_HUB_PORT_Pos 23 /* Cap[29:23] - Hub Port Number */ -#define QH_HUB_ADDR_Pos 16 /* Cap[22:16] - Hub Addr */ -#define QH_C_MASK_Msk 0xFF00 /* Cap[15:8] - uFrame C-mask */ -#define QH_S_MASK_Msk 0x00FF /* Cap[7:0] - uFrame S-mask */ - - -/*----------------------------------------------------------------------------------------*/ -/* Isochronous (High-Speed) Transfer Descriptor (iTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct itd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Transaction[8]; /* Transaction Status and Control */ - uint32_t Bptr[7]; /* Buffer Page Pointer List */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint32_t buff_base; /* buffer base address */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint8_t trans_mask; /* mask of activated transactions in iTD */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct itd_t *next; /* used by software to maintain iTD list */ -} iTD_T; - -/* - * Next_Link[2:1] Typ field of "Next Schedule Element Pointer" Typ field - */ -#define ITD_HLNK_ITD(x) (((uint32_t)(x) & ~0x1F) | 0x0) -#define ITD_HLNK_QH(x) (((uint32_t)(x) & ~0x1F) | 0x2) -#define ITD_HLNK_SITD(x) (((uint32_t)(x) & ~0x1F) | 0x4) -#define ITD_HLNK_FSTN(x) (((uint32_t)(x) & ~0x1F) | 0x6) -#define ITD_PTR(x) ((iTD_T *)((uint32_t)(x) & ~0x1F)) - -/* - * Transaction[8] - */ -#define ITD_STATUS(x) (((x)>>28)&0xF) -#define ITD_STATUS_ACTIVE (0x80000000UL) /* Active */ -#define ITD_STATUS_BUFF_ERR (0x40000000UL) /* Data Buffer Error */ -#define ITD_STATUS_BABBLE (0x20000000UL) /* Babble Detected */ -#define ITD_STATUS_XACT_ERR (0x10000000UL) /* Transcation Error */ - -#define ITD_XLEN_Pos 16 -#define ITD_XFER_LEN(x) (((x)>>16)&0xFFF) -#define ITD_IOC (1<<15) -#define ITD_PG_Pos 12 -#define ITD_XFER_OFF_Msk 0xFFF - -/* - * Bptr[7] - */ -#define ITD_BUFF_PAGE_Pos 12 -/* Bptr[0] */ -#define ITD_EP_NUM_Pos 8 -#define ITD_EP_NUM(itd) (((itd)->Bptr[0]>>8)&0xF) -#define ITD_DEV_ADDR_Pos 0 -#define ITD_DEV_ADDR(itd) ((itd)->Bptr[0]&0x7F) -/* Bptr[1] */ -#define ITD_DIR_IN (1<<11) -#define ITD_DIR_OUT (0<<11) -#define ITD_MAX_PKTSZ_Pos 0 -#define ITD_MAX_PKTSZ(itd) ((itd)->Bptr[1]&0x7FF) - -/*----------------------------------------------------------------------------------------*/ -/* Split Isochronous (Full-Speed) Transfer Descriptor (siTD) */ -/*----------------------------------------------------------------------------------------*/ -typedef struct sitd_t -{ - uint32_t Next_Link; /* Next Link Pointer */ - uint32_t Chrst; /* Endpoint and Transaction Translator Characteristics */ - uint32_t Sched; /* Micro-frame Schedule Control */ - uint32_t StsCtrl; /* siTD Transfer Status and Control */ - uint32_t Bptr[2]; /* Buffer Page Pointer List */ - uint32_t BackLink; /* siTD Back Link Pointer */ - /* - * The following members are used by USB Host libary. - */ - struct iso_ep_t *iso_ep; /* associated isochronous information block */ - struct utr_t *utr; /* associated UTR */ - uint8_t fidx; /* iTD's first index to UTR iso frames */ - uint32_t sched_frnidx; /* scheduled frame index */ - struct sitd_t *next; /* used by software to maintain siTD list */ -} siTD_T; - -#define SITD_LIST_END 0x1 /* Indicate the terminate of siTD list. */ - -#define SITD_XFER_IO_Msk (1UL<<31) -#define SITD_XFER_IN (1UL<<31) -#define SITD_XFER_OUT (0UL<<31) - -#define SITD_PORT_NUM_Pos 24 -#define SITD_HUB_ADDR_Pos 16 -#define SITD_EP_NUM_Pos 8 -#define SITD_DEV_ADDR_Pos 0 - -#define SITD_IOC (1UL<<31) -#define SITD_XFER_CNT_Pos 16 -#define SITD_XFER_CNT_Msk (0x3FF<>28) & 0x0F) -#define TD_CC_SET(td, cc) (td) = ((td) & 0x0FFFFFFF) | (((cc) & 0x0F) << 28) -#define TD_T_DATA0 0x02000000 -#define TD_T_DATA1 0x03000000 -#define TD_R 0x00040000 -#define TD_DP 0x00180000 -#define TD_DP_IN 0x00100000 -#define TD_DP_OUT 0x00080000 -#define MAXPSW 8 -/* steel TD reserved bits to keep driver data */ -#define TD_TYPE_Msk (0x3<<16) -#define TD_TYPE_CTRL (0x0<<16) -#define TD_TYPE_BULK (0x1<<16) -#define TD_TYPE_INT (0x2<<16) -#define TD_TYPE_ISO (0x3<<16) -#define TD_CTRL_Msk (0x7<<15) -#define TD_CTRL_DATA (1<<15) - - -/* - * The HCCA (Host Controller Communications Area) is a 256 byte - * structure defined in the OHCI spec. that the host controller is - * told the base address of. It must be 256-byte aligned. - */ -typedef struct -{ - uint32_t int_table[32]; /* Interrupt ED table */ - uint16_t frame_no; /* current frame number */ - uint16_t pad1; /* set to 0 on each frame_no change */ - uint32_t done_head; /* info returned for an interrupt */ - uint8_t reserved_for_hc[116]; -} HCCA_T; - - -/// @endcond - -#endif /* _USBH_OHCI_H_ */ diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usb.h b/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usb.h deleted file mode 100644 index 4f99d4e6c99..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usb.h +++ /dev/null @@ -1,394 +0,0 @@ -/**************************************************************************//** - * @file usb.h - * @version V1.00 - * @brief USB Host library header file. - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - *****************************************************************************/ - -#ifndef _USBH_H_ -#define _USBH_H_ - -#include "config.h" -#include "usbh_lib.h" -#include "ehci.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -struct utr_t; -struct udev_t; -struct hub_dev_t; -struct iface_t; -struct ep_info_t; - -/*----------------------------------------------------------------------------------*/ -/* USB device request setup packet */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) -{ - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} -DEV_REQ_T; - -/* - * bmRequestType[7] - Data transfer direction - */ -#define REQ_TYPE_OUT 0x00 -#define REQ_TYPE_IN 0x80 -/* - * bmRequestType[6:5] - Type - */ -#define REQ_TYPE_STD_DEV 0x00 -#define REQ_TYPE_CLASS_DEV 0x20 -#define REQ_TYPE_VENDOR_DEV 0x40 -/* - * bmRequestType[4:0] - Recipient - */ -#define REQ_TYPE_TO_DEV 0x00 -#define REQ_TYPE_TO_IFACE 0x01 -#define REQ_TYPE_TO_EP 0x02 -#define REQ_TYPE_TO_OTHER 0x03 -/* - * Standard Requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_SET_INTERFACE 0x0B -/* - * Descriptor Types - */ -#define USB_DT_STANDARD 0x00 -#define USB_DT_CLASS 0x20 -#define USB_DT_VENDOR 0x40 - -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIGURATION 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 -#define USB_DT_DEVICE_QUALIFIER 0x06 -#define USB_DT_OTHER_SPEED_CONF 0x07 -#define USB_DT_IFACE_POWER 0x08 - - - -/*----------------------------------------------------------------------------------*/ -/* USB standard descriptors */ -/*----------------------------------------------------------------------------------*/ - -/* Descriptor header */ -typedef struct __attribute__((__packed__)) -{ - uint8_t bLength; - uint8_t bDescriptorType; -} -DESC_HDR_T; - -/*----------------------------------------------------------------------------------*/ -/* USB device descriptor */ -/*----------------------------------------------------------------------------------*/ -typedef struct __attribute__((__packed__)) /*!< device descriptor structure */ -{ - uint8_t bLength; /*!< Length of device descriptor */ - uint8_t bDescriptorType; /*!< Device descriptor type */ - uint16_t bcdUSB; /*!< USB version number */ - uint8_t bDeviceClass; /*!< Device class code */ - uint8_t bDeviceSubClass; /*!< Device subclass code */ - uint8_t bDeviceProtocol; /*!< Device protocol code */ - uint8_t bMaxPacketSize0; /*!< Maximum packet size of control endpoint*/ - uint16_t idVendor; /*!< Vendor ID */ - uint16_t idProduct; /*!< Product ID */ - uint16_t bcdDevice; /*!< Device ID */ - uint8_t iManufacturer; /*!< Manufacture description string ID */ - uint8_t iProduct; /*!< Product description string ID */ - uint8_t iSerialNumber; /*!< Serial number description string ID */ - uint8_t bNumConfigurations; /*!< Total number of configurations */ -} -DESC_DEV_T; /*!< device descriptor structure */ - -/* - * Configuration Descriptor - */ -typedef struct __attribute__((__packed__)) usb_config_descriptor /*!< Configuration descriptor structure */ -{ - uint8_t bLength; /*!< Length of configuration descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint16_t wTotalLength; /*!< Total length of this configuration */ - uint8_t bNumInterfaces; /*!< Total number of interfaces */ - uint8_t bConfigurationValue; /*!< Configuration descriptor number */ - uint8_t iConfiguration; /*!< String descriptor ID */ - uint8_t bmAttributes; /*!< Configuration characteristics */ - uint8_t MaxPower; /*!< Maximum power consumption */ -} DESC_CONF_T; /*!< Configuration descriptor structure */ - -/* - * Interface Descriptor - */ -typedef struct __attribute__((__packed__))usb_interface_descriptor /*!< Interface descriptor structure */ -{ - uint8_t bLength; /*!< Length of interface descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bInterfaceNumber; /*!< Interface number */ - uint8_t bAlternateSetting; /*!< Alternate setting number */ - uint8_t bNumEndpoints; /*!< Number of endpoints */ - uint8_t bInterfaceClass; /*!< Interface class code */ - uint8_t bInterfaceSubClass; /*!< Interface subclass code */ - uint8_t bInterfaceProtocol; /*!< Interface protocol code */ - uint8_t iInterface; /*!< Interface ID */ -} DESC_IF_T; /*!< Interface descriptor structure */ - -/* - * Endpoint Descriptor - */ -typedef struct __attribute__((__packed__)) usb_endpoint_descriptor /*!< Endpoint descriptor structure */ -{ - uint8_t bLength; /*!< Length of endpoint descriptor */ - uint8_t bDescriptorType; /*!< Descriptor type */ - uint8_t bEndpointAddress; /*!< Endpoint address */ - uint8_t bmAttributes; /*!< Endpoint attribute */ - uint16_t wMaxPacketSize; /*!< Maximum packet size */ - uint8_t bInterval; /*!< Synchronous transfer interval */ - uint8_t bRefresh; /*!< Refresh */ - uint8_t bSynchAddress; /*!< Sync address */ -} DESC_EP_T; /*!< Endpoint descriptor structure */ - -/* - * Endpoint descriptor bEndpointAddress[7] - direction - */ -#define EP_ADDR_DIR_MASK 0x80 -#define EP_ADDR_DIR_IN 0x80 -#define EP_ADDR_DIR_OUT 0x00 - -/* - * Endpoint descriptor bmAttributes[1:0] - transfer type - */ -#define EP_ATTR_TT_MASK 0x03 -#define EP_ATTR_TT_CTRL 0x00 -#define EP_ATTR_TT_ISO 0x01 -#define EP_ATTR_TT_BULK 0x02 -#define EP_ATTR_TT_INT 0x03 - - -/*----------------------------------------------------------------------------------*/ -/* USB Host controller driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*init)(void); - void (*shutdown)(void); - void (*suspend)(void); - void (*resume)(void); - int (*ctrl_xfer)(struct utr_t *utr); - int (*bulk_xfer)(struct utr_t *utr); - int (*int_xfer)(struct utr_t *utr); - int (*iso_xfer)(struct utr_t *utr); - int (*quit_xfer)(struct utr_t *utr, struct ep_info_t *ep); - - /* root hub support */ - int (*rthub_port_reset)(int port); - int (*rthub_polling)(void); -} HC_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device driver */ -/*----------------------------------------------------------------------------------*/ -typedef struct -{ - int (*probe)(struct iface_t *iface); - void (*disconnect)(struct iface_t *iface); - void (*suspend)(struct iface_t *iface); - void (*resume)(struct iface_t *iface); -} UDEV_DRV_T; - - -/*----------------------------------------------------------------------------------*/ -/* USB device */ -/*----------------------------------------------------------------------------------*/ - -typedef enum -{ - SPEED_LOW, - SPEED_FULL, - SPEED_HIGH -} SPEED_E; - -typedef struct ep_info_t -{ - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint8_t bInterval; - uint8_t bToggle; - uint16_t wMaxPacketSize; - void *hw_pipe; /*!< point to the HC assocaied endpoint \hideinitializer */ -} EP_INFO_T; - -typedef struct udev_t -{ - DESC_DEV_T descriptor; /*!< Device descriptor. \hideinitializer */ - struct hub_dev_t *parent; /*!< parent hub device \hideinitializer */ - uint8_t port_num; /*!< The hub port this device connected on \hideinitializer */ - uint8_t dev_num; /*!< device number \hideinitializer */ - int8_t cur_conf; /*!< Currentll selected configuration \hideinitializer */ - SPEED_E speed; /*!< device speed (low/full/high) \hideinitializer */ - /* - * The followings are lightweight USB stack internal used . - */ - uint8_t *cfd_buff; /*!< Configuration descriptor buffer. \hideinitializer */ - EP_INFO_T ep0; /*!< Endpoint 0 \hideinitializer */ - HC_DRV_T *hc_driver; /*!< host controller driver \hideinitializer */ - struct iface_t *iface_list; /*!< Working interface list \hideinitializer */ - struct udev_t *next; /*!< link for global usb device list \hideinitializer */ -} UDEV_T; - -typedef struct alt_iface_t -{ - DESC_IF_T *ifd; /*!< point to the location of this alternative interface descriptor in UDEV_T->cfd_buff */ - EP_INFO_T ep[MAX_EP_PER_IFACE]; /*!< endpoints of this alternative interface */ -} ALT_IFACE_T; - -typedef struct iface_t -{ - UDEV_T *udev; /*!< USB device \hideinitializer */ - uint8_t if_num; /*!< Interface number \hideinitializer */ - uint8_t num_alt; /*!< Number of alternative interface \hideinitializer */ - ALT_IFACE_T *aif; /*!< Point to the active alternative interface */ - ALT_IFACE_T alt[MAX_ALT_PER_IFACE]; /*!< List of alternative interface \hideinitializer */ - UDEV_DRV_T *driver; /*!< Interface associated driver \hideinitializer */ - void *context; /*!< Reference to device context \hideinitializer */ - struct iface_t *next; /*!< Point to next interface of the same device. Started from UDEV_T->iface_list \hideinitializer */ -} IFACE_T; - - -/*----------------------------------------------------------------------------------*/ -/* URB (USB Request Block) */ -/*----------------------------------------------------------------------------------*/ - -#define IF_PER_UTR 8 /* number of frames per UTR isochronous transfer (DO NOT modify it!) */ - -typedef void (*FUNC_UTR_T)(struct utr_t *); - -typedef struct utr_t -{ - UDEV_T *udev; /*!< point to associated USB device \hideinitializer */ - DEV_REQ_T setup; /*!< buffer for setup packet \hideinitializer */ - EP_INFO_T *ep; /*!< associated endpoint \hideinitializer */ - uint8_t *buff; /*!< transfer buffer \hideinitializer */ - uint8_t bIsTransferDone; /*!< tansfer done? \hideinitializer */ - uint32_t data_len; /*!< length of data to be transferred \hideinitializer */ - uint32_t xfer_len; /*!< length of transferred data \hideinitializer */ - uint8_t bIsoNewSched; /*!< New schedule isochronous transfer \hideinitializer */ - uint16_t iso_sf; /*!< Isochronous start frame number \hideinitializer */ - uint16_t iso_xlen[IF_PER_UTR]; /*!< transfer length of isochronous frames \hideinitializer */ - uint8_t *iso_buff[IF_PER_UTR]; /*!< transfer buffer address of isochronous frames \hideinitializer */ - int iso_status[IF_PER_UTR]; /*!< transfer status of isochronous frames \hideinitializer */ - int td_cnt; /*!< number of transfer descriptors \hideinitializer */ - int status; /*!< return status \hideinitializer */ - int interval; /*!< interrupt/isochronous interval \hideinitializer */ - void *context; /*!< point to deivce proprietary data area \hideinitializer */ - FUNC_UTR_T func; /*!< tansfer done call-back function \hideinitializer */ - struct utr_t *next; /* point to the next UTR of the same endpoint. \hideinitializer */ -} UTR_T; - - -/*----------------------------------------------------------------------------------*/ -/* Global variables */ -/*----------------------------------------------------------------------------------*/ -extern USBH_T *_ohci; -extern HSUSBH_T *_ehci; - -extern HC_DRV_T ohci_driver; -extern HC_DRV_T ehci_driver; - -extern UDEV_T *g_udev_list; - -extern volatile int _IsInUsbInterrupt; - -/*----------------------------------------------------------------------------------*/ -/* USB stack exported functions */ -/*----------------------------------------------------------------------------------*/ -extern void usbh_delay_ms(int msec); - -extern void dump_ohci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ohci_int_table(void); -extern void dump_ehci_regs(void); -extern void dump_ehci_qtd(qTD_T *qtd); -extern void dump_ehci_asynclist(void); -extern void dump_ehci_period_frame_list_simple(void); -extern void usbh_dump_buff_bytes(uint8_t *buff, int nSize); -extern void usbh_dump_interface_descriptor(DESC_IF_T *if_desc); -extern void usbh_dump_endpoint_descriptor(DESC_EP_T *ep_desc); -extern void usbh_dump_iface(IFACE_T *iface); -extern void usbh_dump_ep_info(EP_INFO_T *ep); - -/* - * Memory management functions - */ -extern void USB_InitializeMemoryPool(void); -extern void *USB_malloc(int wanted_size, int boundary); -extern void USB_free(void *); -extern int USB_available_memory(void); -extern int USB_allocated_memory(void); -extern void usbh_memory_init(void); -extern uint32_t usbh_memory_used(void); -extern void *usbh_alloc_mem(int size); -extern void usbh_free_mem(void *p, int size); -extern int alloc_dev_address(void); -extern void free_dev_address(int dev_addr); -extern UDEV_T *alloc_device(void); -extern void free_device(UDEV_T *udev); -extern UTR_T *alloc_utr(UDEV_T *udev); -extern void free_utr(UTR_T *utr); -extern ED_T *alloc_ohci_ED(void); -extern void free_ohci_ED(ED_T *ed); -extern TD_T *alloc_ohci_TD(UTR_T *utr); -extern void free_ohci_TD(TD_T *td); -extern QH_T *alloc_ehci_QH(void); -extern void free_ehci_QH(QH_T *qh); -extern qTD_T *alloc_ehci_qTD(UTR_T *utr); -extern void free_ehci_qTD(qTD_T *qtd); -extern iTD_T *alloc_ehci_iTD(void); -extern void free_ehci_iTD(iTD_T *itd); -extern siTD_T *alloc_ehci_siTD(void); -extern void free_ehci_siTD(siTD_T *sitd); - - -extern void usbh_hub_init(void); -extern int usbh_connect_device(UDEV_T *); -extern void usbh_disconnect_device(UDEV_T *); -extern int usbh_register_driver(UDEV_DRV_T *driver); -extern EP_INFO_T *usbh_iface_find_ep(IFACE_T *iface, uint8_t ep_addr, uint8_t dir_type); -extern int usbh_reset_device(UDEV_T *); -extern int usbh_reset_port(UDEV_T *); - -/* - * USB Standard Request functions - */ -extern int usbh_get_device_descriptor(UDEV_T *udev, DESC_DEV_T *desc_buff); -extern int usbh_get_config_descriptor(UDEV_T *udev, uint8_t *desc_buff, int buff_len); -extern int usbh_set_configuration(UDEV_T *udev, uint8_t conf_val); -extern int usbh_set_interface(IFACE_T *iface, uint16_t alt_setting); -extern int usbh_clear_halt(UDEV_T *udev, uint16_t ep_addr); - -extern int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout); -extern int usbh_bulk_xfer(UTR_T *utr); -extern int usbh_int_xfer(UTR_T *utr); -extern int usbh_iso_xfer(UTR_T *utr); -extern int usbh_quit_utr(UTR_T *utr); -extern int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep); - - -/// @endcond HIDDEN_SYMBOLS - -#endif /* _USBH_H_ */ diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usbh_lib.h b/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usbh_lib.h deleted file mode 100644 index f7a88d6e94d..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/inc/usbh_lib.h +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************//** - * @file usbh_lib.h - * @version V1.10 - * $Revision: 4 $ - * $Date: 15/06/10 2:06p $ - * @brief USB Host library exported header file. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. - ******************************************************************************/ -#ifndef _USBH_LIB_H_ -#define _USBH_LIB_H_ - -#include "nuc980.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @addtogroup Library Library - @{ -*/ - -/** @addtogroup USBH_Library USB Host Library - @{ -*/ - -/** @addtogroup USBH_EXPORTED_CONSTANTS USB Host Exported Constants - @{ -*/ - -#define USBH_OK 0 /*!< No error. */ -#define USBH_ERR_MEMORY_OUT -10 /*!< Out of memory. */ -#define USBH_ERR_IF_ALT_LIMIT -11 /*!< Number of alternative interface > MAX_ALT_PER_IFACE */ -#define USBH_ERR_IF_EP_LIMIT -15 /*!< Number of endpoints > MAX_EP_PER_IFACE */ -#define USBH_ERR_NOT_SUPPORTED -101 /*!< Device/Class/Transfer not supported */ -#define USBH_ERR_NOT_MATCHED -103 /*!< Not macthed */ -#define USBH_ERR_NOT_EXPECTED -104 /*!< Unknown or unexpected */ -#define USBH_ERR_INVALID_PARAM -105 /*!< Invalid parameter */ -#define USBH_ERR_NOT_FOUND -106 /*!< Device or interface not found */ -#define USBH_ERR_EP_NOT_FOUND -107 /*!< Endpoint not found */ -#define USBH_ERR_DESCRIPTOR -137 /*!< Failed to parse USB descriptors */ -#define USBH_ERR_SET_DEV_ADDR -139 /*!< Failed to set device address */ -#define USBH_ERR_SET_CONFIG -151 /*!< Failed to set device configuration */ - -#define USBH_ERR_TRANSFER -201 /*!< USB transfer error */ -#define USBH_ERR_TIMEOUT -203 /*!< USB transfer time-out */ -#define USBH_ERR_ABORT -205 /*!< USB transfer aborted due to disconnect or reset */ -#define USBH_ERR_PORT_RESET -255 /*!< Hub port reset failed */ -#define USBH_ERR_SCH_OVERRUN -257 /*!< USB isochronous schedule overrun */ -#define USBH_ERR_DISCONNECTED -259 /*!< USB device was disconnected */ - -#define USBH_ERR_TRANSACTION -271 /*!< USB transaction timeout, CRC, Bad PID, etc. */ -#define USBH_ERR_BABBLE_DETECTED -272 /*!< A 'babble' is detected during the transaction */ -#define USBH_ERR_DATA_BUFF -274 /*!< Data buffer overrun or underrun */ - -#define USBH_ERR_CC_NO_ERR -280 /*!< OHCI CC code - no error */ -#define USBH_ERR_CRC -281 /*!< USB trasfer CRC error */ -#define USBH_ERR_BIT_STUFF -282 /*!< USB transfer bit stuffing error */ -#define USBH_ERR_DATA_TOGGLE -283 /*!< USB trasfer data toggle error */ -#define USBH_ERR_STALL -284 /*!< USB trasfer STALL error */ -#define USBH_ERR_DEV_NO_RESP -285 /*!< USB trasfer device no response error */ -#define USBH_ERR_PID_CHECK -286 /*!< USB trasfer PID check failure */ -#define USBH_ERR_UNEXPECT_PID -287 /*!< USB trasfer unexpected PID error */ -#define USBH_ERR_DATA_OVERRUN -288 /*!< USB trasfer data overrun error */ -#define USBH_ERR_DATA_UNDERRUN -289 /*!< USB trasfer data underrun error */ -#define USBH_ERR_BUFF_OVERRUN -292 /*!< USB trasfer buffer overrun error */ -#define USBH_ERR_BUFF_UNDERRUN -293 /*!< USB trasfer buffer underrun error */ -#define USBH_ERR_NOT_ACCESS0 -294 /*!< USB trasfer not accessed error */ -#define USBH_ERR_NOT_ACCESS1 -295 /*!< USB trasfer not accessed error */ - -#define USBH_ERR_OHCI_INIT -301 /*!< Failed to initialize OHIC controller. */ -#define USBH_ERR_OHCI_EP_BUSY -303 /*!< The endpoint is under transfer. */ - -#define USBH_ERR_EHCI_INIT -501 /*!< Failed to initialize EHCI controller. */ -#define USBH_ERR_EHCI_QH_BUSY -503 /*!< the Queue Head is busy. */ - -#define UMAS_OK 0 /*!< No error. */ -#define UMAS_ERR_NO_DEVICE -1031 /*!< No Mass Stroage Device found. */ -#define UMAS_ERR_IO -1033 /*!< Device read/write failed. */ -#define UMAS_ERR_INIT_DEVICE -1035 /*!< failed to init MSC device */ -#define UMAS_ERR_CMD_STATUS -1037 /*!< SCSI command status failed */ -#define UMAS_ERR_IVALID_PARM -1038 /*!< Invalid parameter. */ -#define UMAS_ERR_DRIVE_NOT_FOUND -1039 /*!< drive not found */ - -#define HID_RET_OK 0 /*!< Return with no errors. */ -#define HID_RET_DEV_NOT_FOUND -1081 /*!< HID device not found or removed. */ -#define HID_RET_IO_ERR -1082 /*!< USB transfer failed. */ -#define HID_RET_INVALID_PARAMETER -1083 /*!< Invalid parameter. */ -#define HID_RET_OUT_OF_MEMORY -1084 /*!< Out of memory. */ -#define HID_RET_NOT_SUPPORTED -1085 /*!< Function not supported. */ -#define HID_RET_EP_NOT_FOUND -1086 /*!< Endpoint not found. */ -#define HID_RET_PARSING -1087 /*!< Failed to parse HID descriptor */ -#define HID_RET_XFER_IS_RUNNING -1089 /*!< The transfer has been enabled. */ -#define HID_RET_REPORT_NOT_FOUND -1090 /*!< The transfer has been enabled. */ - -#define UAC_RET_OK 0 /*!< Return with no errors. */ -#define UAC_RET_DEV_NOT_FOUND -2001 /*!< Audio Class device not found or removed. */ -#define UAC_RET_FUNC_NOT_FOUND -2002 /*!< Audio device has no this function. */ -#define UAC_RET_IO_ERR -2003 /*!< USB transfer failed. */ -#define UAC_RET_DATA_LEN -2004 /*!< Unexpected transfer length */ -#define UAC_RET_INVALID -2005 /*!< Invalid parameter or usage. */ -#define UAC_RET_OUT_OF_MEMORY -2007 /*!< Out of memory. */ -#define UAC_RET_DRV_NOT_SUPPORTED -2009 /*!< Function not supported by this UAC driver. */ -#define UAC_RET_DEV_NOT_SUPPORTED -2011 /*!< Function not supported by the UAC device. */ -#define UAC_RET_PARSER -2013 /*!< Failed to parse UAC descriptor */ -#define UAC_RET_IS_STREAMING -2015 /*!< Audio pipe is on streaming. */ - - -/*@}*/ /* end of group USBH_EXPORTED_CONSTANTS */ - - -/** @addtogroup USBH_EXPORTED_TYPEDEF USB Host Typedef - @{ -*/ -struct udev_t; -typedef void (CONN_FUNC)(struct udev_t *udev, int param); - -struct line_coding_t; -struct cdc_dev_t; -typedef void (CDC_CB_FUNC)(struct cdc_dev_t *cdev, uint8_t *rdata, int data_len); - -struct usbhid_dev; -typedef void (HID_IR_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *rdata, uint32_t data_len); /*!< interrupt in callback function \hideinitializer */ -typedef void (HID_IW_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *wbuff, uint32_t *data_len); /*!< interrupt out callback function \hideinitializer */ - -struct uac_dev_t; -typedef int (UAC_CB_FUNC)(struct uac_dev_t *dev, uint8_t *data, int len); /*!< audio in callback function \hideinitializer */ - -/*@}*/ /* end of group USBH_EXPORTED_STRUCT */ - - - -/** @addtogroup USBH_EXPORTED_FUNCTIONS USB Host Exported Functions - @{ -*/ - -/*------------------------------------------------------------------*/ -/* */ -/* USB Core Library APIs */ -/* */ -/*------------------------------------------------------------------*/ -extern void usbh_core_init(void); -extern int usbh_polling_root_hubs(void); -extern void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func); -extern void usbh_suspend(void); -extern void usbh_resume(void); -extern struct udev_t *usbh_find_device(char *hub_id, int port); - -/** - * @brief A function return current tick count. - * @return Current tick. - * @details User application must provide this function to return current tick. - * The tick should increase by 1 for every 10 ms. - */ -extern uint32_t usbh_get_ticks(void); /* This function must be provided by user application. */ -extern uint32_t usbh_tick_from_millisecond(uint32_t msec); /* This function must be provided by user application. */ - - -/// @cond HIDDEN_SYMBOLS - -extern void dump_ohci_regs(void); -extern void dump_ehci_regs(void); -extern void dump_ohci_ports(void); -extern void dump_ehci_ports(void); -extern uint32_t usbh_memory_used(void); - -/// @endcond HIDDEN_SYMBOLS - - -/*@}*/ /* end of group USBH_EXPORTED_FUNCTIONS */ - -/*@}*/ /* end of group USBH_Library */ - -/*@}*/ /* end of group LIBRARY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _USBH_LIB_H_ */ - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ - - - diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci.c b/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci.c deleted file mode 100644 index dc20734d0e6..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci.c +++ /dev/null @@ -1,1289 +0,0 @@ -/**************************************************************************//** - * @file ehci.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB Host library EHCI (USB 2.0) host controller driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -static QH_T *_H_qh; /* head of reclamation list */ -static qTD_T *_ghost_qtd; /* used as a terminator qTD */ -static QH_T *qh_remove_list; - -extern ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ -extern int ehci_iso_xfer(UTR_T *utr); /* EHCI isochronous transfer function */ -extern int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep); - -uint32_t _PFList_mem[FL_SIZE] __attribute__((aligned(4096)));/* Periodic frame list (Keil) */ - -uint32_t *_PFList; - - -QH_T *_Iqh[NUM_IQH]; - - -#ifdef ENABLE_ERROR_MSG -void dump_ehci_regs() -{ - USB_debug("Dump HSUSBH(EHCI) registers:\n"); - USB_debug(" UCMDR = 0x%x\n", _ehci->UCMDR); - USB_debug(" USTSR = 0x%x\n", _ehci->USTSR); - USB_debug(" UIENR = 0x%x\n", _ehci->UIENR); - USB_debug(" UFINDR = 0x%x\n", _ehci->UFINDR); - USB_debug(" UPFLBAR = 0x%x\n", _ehci->UPFLBAR); - USB_debug(" UCALAR = 0x%x\n", _ehci->UCALAR); - USB_debug(" UASSTR = 0x%x\n", _ehci->UASSTR); - USB_debug(" UCFGR = 0x%x\n", _ehci->UCFGR); - USB_debug(" UPSCR = 0x%x\n", _ehci->UPSCR[0]); - USB_debug(" PHYCTL0 = 0x%x\n", _ehci->USBPCR0); - USB_debug(" PHYCTL1 = 0x%x\n", _ehci->USBPCR1); -} - -void dump_ehci_ports() -{ - USB_debug("_ehci port0=0x%x, port1=0x%x\n", _ehci->UPSCR[0], _ehci->UPSCR[1]); -} - -void dump_ehci_qtd(qTD_T *qtd) -{ - USB_debug(" [qTD] - 0x%08x\n", (int)qtd); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qtd->Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qtd->Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token) PID: %s, Bytes: %d, IOC: %d\n", qtd->Token, (((qtd->Token >> 8) & 0x3) == 0) ? "OUT" : ((((qtd->Token >> 8) & 0x3) == 1) ? "IN" : "SETUP"), (qtd->Token >> 16) & 0x7FFF, (qtd->Token >> 15) & 0x1); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qtd->Bptr[0]); - //USB_debug(" 0x%08x (Buffer Pointer (page 1))\n", qtd->Bptr[1]); - //USB_debug(" 0x%08x (Buffer Pointer (page 2))\n", qtd->Bptr[2]); - //USB_debug(" 0x%08x (Buffer Pointer (page 3))\n", qtd->Bptr[3]); - //USB_debug(" 0x%08x (Buffer Pointer (page 4))\n", qtd->Bptr[4]); - USB_debug("\n"); -} - -void dump_ehci_asynclist(void) -{ - QH_T *qh = _H_qh; - qTD_T *qtd; - - USB_debug(">>> Dump EHCI Asynchronous List <<<\n"); - do - { - USB_debug("[QH] - 0x%08x\n", (int)qh); - USB_debug(" 0x%08x (Queue Head Horizontal Link Pointer, Queue Head DWord 0)\n", qh->HLink); - USB_debug(" 0x%08x (Endpoint Characteristics) DevAddr: %d, EP: 0x%x, PktSz: %d, Speed: %s\n", qh->Chrst, qh->Chrst & 0x7F, (qh->Chrst >> 8) & 0xF, (qh->Chrst >> 16) & 0x7FF, ((qh->Chrst >> 12) & 0x3 == 0) ? "Full" : (((qh->Chrst >> 12) & 0x3 == 1) ? "Low" : "High")); - USB_debug(" 0x%08x (Endpoint Capabilities: Queue Head DWord 2)\n", qh->Cap); - USB_debug(" 0x%08x (Current qtd Pointer)\n", qh->Curr_qTD); - USB_debug(" --- Overlay Area ---\n"); - USB_debug(" 0x%08x (Next qtd Pointer)\n", qh->OL_Next_qTD); - USB_debug(" 0x%08x (Alternate Next qtd Pointer)\n", qh->OL_Alt_Next_qTD); - USB_debug(" 0x%08x (qtd Token)\n", qh->OL_Token); - USB_debug(" 0x%08x (Buffer Pointer (page 0))\n", qh->OL_Bptr[0]); - USB_debug("\n"); - - qtd = QTD_PTR(qh->Curr_qTD); - while (qtd != NULL) - { - dump_ehci_qtd(qtd); - qtd = QTD_PTR(qtd->Next_qTD); - } - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); -} - -void dump_ehci_asynclist_simple(void) -{ - QH_T *qh = _H_qh; - - USB_debug(">>> EHCI Asynchronous List <<<\n"); - USB_debug("[QH] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != _H_qh); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list_simple(void) -{ - QH_T *qh = _Iqh[NUM_IQH - 1]; - - USB_debug(">>> EHCI period frame list simple <<<\n"); - USB_debug("[FList] => "); - do - { - USB_debug("0x%08x ", (int)qh); - qh = QH_PTR(qh->HLink); - } - while (qh != NULL); - USB_debug("\n"); -} - -void dump_ehci_period_frame_list() -{ - int i; - QH_T *qh; - - for (i = 0; i < FL_SIZE; i++) - { - USB_debug("!%02d: ", i); - qh = QH_PTR(_PFList[i]);; - while (qh != NULL) - { - // USB_debug("0x%x (0x%x) => ", (int)qh, qh->HLink); - USB_debug("0x%x => ", (int)qh); - qh = QH_PTR(qh->HLink); - } - USB_debug("0\n"); - } -} - -#endif /* ENABLE_ERROR_MSG */ - -static void init_periodic_frame_list() -{ - QH_T *qh_p; - int i, idx, interval; - - _PFList = (uint32_t *)((uint32_t)_PFList_mem | NON_CACHE_MASK); - memset(_PFList, 0, sizeof(_PFList_mem)); - - iso_ep_list = NULL; - - for (i = NUM_IQH - 1; i >= 0; i--) /* interval = i^2 */ - { - _Iqh[i] = alloc_ehci_QH(); - - _Iqh[i]->HLink = QH_HLNK_END; - _Iqh[i]->Curr_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Next_qTD = QTD_LIST_END; - _Iqh[i]->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _Iqh[i]->OL_Token = QTD_STS_HALT; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < FL_SIZE; idx += interval) - { - if (_PFList[idx] == 0) /* is empty list, insert directly */ - { - _PFList[idx] = QH_HLNK_QH(_Iqh[i]); - } - else - { - qh_p = QH_PTR(_PFList[idx]); - - while (1) - { - if (qh_p == _Iqh[i]) - break; /* already chained by previous visit */ - - if (qh_p->HLink == QH_HLNK_END) /* reach end of list? */ - { - qh_p->HLink = QH_HLNK_QH(_Iqh[i]); - break; - } - qh_p = QH_PTR(qh_p->HLink); - } - } - } - } -} - -static QH_T *get_int_tree_head_node(int interval) -{ - int i; - - interval /= 8; /* each frame list entry for 8 micro-frame */ - - for (i = 0; i < NUM_IQH - 1; i++) - { - interval >>= 1; - if (interval == 0) - return _Iqh[i]; - } - return _Iqh[NUM_IQH - 1]; -} - -static int make_int_s_mask(int bInterval) -{ - int order, interval; - - interval = 1; - while (bInterval > 1) - { - interval *= 2; - bInterval--; - } - - if (interval < 2) - return 0xFF; /* interval 1 */ - if (interval < 4) - return 0x55; /* interval 2 */ - if (interval < 8) - return 0x22; /* interval 4 */ - for (order = 0; (interval > 1); order++) - { - interval >>= 1; - } - return (0x1 << (order % 8)); -} - -static int ehci_init(void) -{ - int timeout = 250 * 1000; /* EHCI reset time-out 250 ms */ - - /*------------------------------------------------------------------------------------*/ - /* Reset EHCI host controller */ - /*------------------------------------------------------------------------------------*/ - _ehci->UCMDR = HSUSBH_UCMDR_HCRST_Msk; - while ((_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) && (timeout > 0)) - { - usbh_delay_ms(1); - timeout -= 1000; - } - if (_ehci->UCMDR & HSUSBH_UCMDR_HCRST_Msk) - return USBH_ERR_EHCI_INIT; - - _ehci->UCMDR = UCMDR_INT_THR_CTRL | HSUSBH_UCMDR_RUN_Msk; - - _ghost_qtd = alloc_ehci_qTD(NULL); - _ghost_qtd->Token = 0x11197B7F; //QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It represents a qhost qTD. - - /*------------------------------------------------------------------------------------*/ - /* Initialize asynchronous list */ - /*------------------------------------------------------------------------------------*/ - qh_remove_list = NULL; - - /* Create the QH list head with H-bit 1 */ - _H_qh = alloc_ehci_QH(); - _H_qh->HLink = QH_HLNK_QH(_H_qh); /* circular link to itself, the only one QH */ - _H_qh->Chrst = QH_RCLM_LIST_HEAD; /* it's the head of reclamation list */ - _H_qh->Curr_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Next_qTD = QTD_LIST_END; - _H_qh->OL_Alt_Next_qTD = (uint32_t)_ghost_qtd; - _H_qh->OL_Token = QTD_STS_HALT; - _ehci->UCALAR = (uint32_t)_H_qh; - - /*------------------------------------------------------------------------------------*/ - /* Initialize periodic list */ - /*------------------------------------------------------------------------------------*/ - if (FL_SIZE == 256) - _ehci->UCMDR |= (0x2 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 512) - _ehci->UCMDR |= (0x1 << HSUSBH_UCMDR_FLSZ_Pos); - else if (FL_SIZE == 1024) - _ehci->UCMDR |= (0x0 << HSUSBH_UCMDR_FLSZ_Pos); - else - return USBH_ERR_EHCI_INIT; /* Invalid FL_SIZE setting! */ - - /*------------------------------------------------------------------------------------*/ - /* start run */ - /*------------------------------------------------------------------------------------*/ - - _ehci->UCFGR = 0x1; /* enable port routing to EHCI */ - _ehci->UIENR = HSUSBH_UIENR_USBIEN_Msk | HSUSBH_UIENR_UERRIEN_Msk | HSUSBH_UIENR_HSERREN_Msk | HSUSBH_UIENR_IAAEN_Msk; - - _ehci->UASSTR = 0xfff; - - usbh_delay_ms(1); /* delay 1 ms */ - - _ehci->UPSCR[0] = HSUSBH_UPSCR_PP_Msk; /* enable port 1 port power */ - _ehci->UPSCR[1] = HSUSBH_UPSCR_PP_Msk; /* enable port 2 port power */ - - init_periodic_frame_list(); - - _ehci->UPFLBAR = (uint32_t)_PFList; - usbh_delay_ms(10); /* delay 10 ms */ - - return 0; -} - -static void ehci_suspend(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] |= HSUSBH_UPSCR_SUSPEND_Msk; -} - -static void ehci_resume(void) -{ - if (_ehci->UPSCR[0] & 0x1) - _ehci->UPSCR[0] = (HSUSBH->UPSCR[0] & ~HSUSBH_UPSCR_SUSPEND_Msk) | HSUSBH_UPSCR_FPR_Msk; -} - -static void ehci_shutdown(void) -{ - ehci_suspend(); -} - -static void move_qh_to_remove_list(QH_T *qh) -{ - QH_T *q; - - // USB_debug("move_qh_to_remove_list - 0x%x (0x%x)\n", (int)qh, qh->Chrst); - - /* check if this ED found in ed_remove_list */ - q = qh_remove_list; - while (q) - { - if (q == qh) /* This QH found in qh_remove_list. */ - { - return; /* Do nothing, return... */ - } - q = q->next; - } - - DISABLE_EHCI_IRQ(); - - /*------------------------------------------------------------------------------------*/ - /* Search asynchronous frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _H_qh; /* find and remove it from asynchronous list */ - while (QH_PTR(q->HLink) != _H_qh) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - - /*------------------------------------------------------------------------------------*/ - /* Search periodic frame list and remove qh if found in list. */ - /*------------------------------------------------------------------------------------*/ - q = _Iqh[NUM_IQH - 1]; - while (q->HLink != QH_HLNK_END) - { - if (QH_PTR(q->HLink) == qh) - { - /* q's next QH is qh, found... */ - q->HLink = qh->HLink; /* remove qh from list */ - - qh->next = qh_remove_list; /* add qh to qh_remove_list */ - qh_remove_list = qh; - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA interrupt */ - ENABLE_EHCI_IRQ(); - return; /* done */ - } - q = QH_PTR(q->HLink); /* advance to next QH in asynchronous list */ - } - ENABLE_EHCI_IRQ(); -} - -static void append_to_qtd_list_of_QH(QH_T *qh, qTD_T *qtd) -{ - qTD_T *q; - - if (qh->qtd_list == NULL) - { - qh->qtd_list = qtd; - } - else - { - q = qh->qtd_list; - while (q->next != NULL) - { - q = q->next; - } - q->next = qtd; - } -} - -/* - * If ep==NULL, it's a control endpoint QH. - */ -static void write_qh(UDEV_T *udev, EP_INFO_T *ep, QH_T *qh) -{ - uint32_t chrst, cap; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 1 - Endpoint Characteristics */ - /*------------------------------------------------------------------------------------*/ - if (ep == NULL) /* is control endpoint? */ - { - if (udev->descriptor.bMaxPacketSize0 == 0) - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - chrst = QH_DTC | QH_NAK_RL | (udev->descriptor.bMaxPacketSize0 << 16); - if (udev->speed != SPEED_HIGH) - chrst |= QH_CTRL_EP_FLAG; /* non-high-speed control endpoint */ - } - else /* not a control endpoint */ - { - chrst = QH_NAK_RL | (ep->wMaxPacketSize << 16); - chrst |= ((ep->bEndpointAddress & 0xf) << 8); /* Endpoint Address */ - } - - if (udev->speed == SPEED_LOW) - chrst |= QH_EPS_LOW; - else if (udev->speed == SPEED_FULL) - chrst |= QH_EPS_FULL; - else - chrst |= QH_EPS_HIGH; - - chrst |= udev->dev_num; - - qh->Chrst = chrst; - - /*------------------------------------------------------------------------------------*/ - /* Write QH DWord 2 - Endpoint Capabilities */ - /*------------------------------------------------------------------------------------*/ - if (udev->speed == SPEED_HIGH) - { - cap = 0; - } - else - { - /* - * Backtrace device tree until the USB 2.0 hub found - */ - HUB_DEV_T *hub; - int port_num; - - port_num = udev->port_num; - hub = udev->parent; - - while ((hub != NULL) && (hub->iface->udev->speed != SPEED_HIGH)) - { - port_num = hub->iface->udev->port_num; - hub = hub->iface->udev->parent; - } - - cap = (port_num << QH_HUB_PORT_Pos) | - (hub->iface->udev->dev_num << QH_HUB_ADDR_Pos); - } - - qh->Cap = cap; -} - -static void write_qtd_bptr(qTD_T *qtd, uint32_t buff_addr, int xfer_len) -{ - int i; - - qtd->xfer_len = xfer_len; - qtd->Bptr[0] = buff_addr; - - buff_addr = (buff_addr + 0x1000) & ~0xFFF; - - for (i = 1; i < 5; i++) - { - qtd->Bptr[i] = buff_addr; - buff_addr += 0x1000; - } -} - -static int ehci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - QH_T *qh; - qTD_T *qtd_setup, *qtd_data, *qtd_status; - uint32_t token; - int is_new_qh = 0; - - udev = utr->udev; - - if (utr->data_len > 0) - { - if (((uint32_t)utr->buff + utr->data_len) > (((uint32_t)utr->buff & ~0xFFF) + 0x5000)) - return USBH_ERR_BUFF_OVERRUN; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate and link QH */ - /*------------------------------------------------------------------------------------*/ - if (udev->ep0.hw_pipe != NULL) - { - qh = (QH_T *)udev->ep0.hw_pipe; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - - udev->ep0.hw_pipe = (void *)qh; /* driver can find QH from EP */ - is_new_qh = 1; - } - write_qh(udev, NULL, qh); - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - - /*------------------------------------------------------------------------------------*/ - /* Allocate qTDs */ - /*------------------------------------------------------------------------------------*/ - qtd_setup = alloc_ehci_qTD(utr); /* allocate qTD for SETUP */ - - if (utr->data_len > 0) - qtd_data = alloc_ehci_qTD(utr); /* allocate qTD for DATA */ - else - qtd_data = NULL; - - qtd_status = alloc_ehci_qTD(utr); /* allocate qTD for USTSR */ - - if (qtd_status == NULL) /* out of memory? */ - { - if (qtd_setup) - free_ehci_qTD(qtd_setup); /* free memory */ - if (qtd_data) - free_ehci_qTD(qtd_data); /* free memory */ - return USBH_ERR_MEMORY_OUT; /* out of memory */ - } - - //USB_debug("qh=0x%x, qtd_setup=0x%x, qtd_data=0x%x, qtd_status=0x%x\n", (int)qh, (int)qtd_setup, (int)qtd_data, (int)qtd_status); - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_setup->qh = qh; - //qtd_setup->utr = utr; - write_qtd_bptr(qtd_setup, (uint32_t)&utr->setup, 8); - append_to_qtd_list_of_QH(qh, qtd_setup); - qtd_setup->Token = (8 << 16) | QTD_ERR_COUNTER | QTD_PID_SETUP | QTD_STS_ACTIVE; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage qTD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - qtd_setup->Next_qTD = (uint32_t)qtd_data; - qtd_data->Next_qTD = (uint32_t)qtd_status; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd_data->qh = qh; - //qtd_data->utr = utr; - write_qtd_bptr(qtd_data, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd_data); - qtd_data->Token = QTD_DT | (utr->data_len << 16) | token; - } - else - { - qtd_setup->Next_qTD = (uint32_t)qtd_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare USTSR stage qTD */ - /*------------------------------------------------------------------------------------*/ - qtd_status->Next_qTD = (uint32_t)_ghost_qtd; - qtd_status->Alt_Next_qTD = QTD_LIST_END; - - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - - qtd_status->qh = qh; - //qtd_status->utr = utr; - append_to_qtd_list_of_QH(qh, qtd_status); - qtd_status->Token = QTD_DT | QTD_IOC | token; - - /*------------------------------------------------------------------------------------*/ - /* Update QH overlay */ - /*------------------------------------------------------------------------------------*/ - qh->Curr_qTD = 0; - qh->OL_Next_qTD = (uint32_t)qtd_setup; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = 0; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - return 0; -} - -static int ehci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh; - qTD_T *qtd, *qtd_pre; - uint32_t data_len, xfer_len; - uint8_t *buff; - uint32_t token; - int is_new_qh = 0; - - //USB_debug("Bulk XFER =>\n"); - // dump_ehci_asynclist_simple(); - - udev = utr->udev; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - { - return USBH_ERR_EHCI_QH_BUSY; - } - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTDs */ - /*------------------------------------------------------------------------------------*/ - data_len = utr->data_len; - buff = utr->buff; - qtd_pre = NULL; - - while (data_len > 0) - { - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - qtd = qh->qtd_list; - while (qtd != NULL) - { - qtd_pre = qtd; - qtd = qtd->next; - free_ehci_qTD(qtd_pre); - } - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - if (data_len > 0x4000) /* force maximum x'fer length 16K per qTD */ - xfer_len = 0x4000; - else - xfer_len = data_len; /* remaining data length < 4K */ - - qtd->qh = qh; - qtd->Next_qTD = (uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)buff, xfer_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = (xfer_len << 16) | token; - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - if (data_len == 0) /* is this the latest qTD? */ - { - qtd->Token |= QTD_IOC; /* ask to raise an interrupt on the last qTD */ - qtd->Next_qTD = (uint32_t)_ghost_qtd; /* qTD list end */ - } - - if (qtd_pre != NULL) - qtd_pre->Next_qTD = (uint32_t)qtd; - qtd_pre = qtd; - } - - //USB_debug("utr=0x%x, qh=0x%x, qtd=0x%x\n", (int)utr, (int)qh, (int)qh->qtd_list); - - qtd = qh->qtd_list; - - qh->OL_Next_qTD = (uint32_t)qtd; - - /*------------------------------------------------------------------------------------*/ - /* Link QH and start asynchronous transfer */ - /*------------------------------------------------------------------------------------*/ - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - - qh->OL_Token = 0; //qtd->Token; - - if (utr->ep->bToggle) - qh->OL_Token |= QTD_DT; - - qh->HLink = _H_qh->HLink; - _H_qh->HLink = QH_HLNK_QH(qh); - } - - /* Start transfer */ - _ehci->UCMDR |= HSUSBH_UCMDR_ASEN_Msk; /* start asynchronous transfer */ - - return 0; -} - -static int ehci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - QH_T *qh, *iqh; - qTD_T *qtd; - uint32_t token; - int8_t is_new_qh = 0; - - if (ep->hw_pipe != NULL) - { - qh = (QH_T *)ep->hw_pipe ; - if (qh->qtd_list) - return USBH_ERR_EHCI_QH_BUSY; - } - else - { - qh = alloc_ehci_QH(); - if (qh == NULL) - return USBH_ERR_MEMORY_OUT; - is_new_qh = 1; - write_qh(udev, ep, qh); - qh->Chrst &= ~0xF0000000; - - if (udev->speed == SPEED_HIGH) - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & 0xff) | make_int_s_mask(ep->bInterval); - } - else - { - qh->Cap = (0x1 << QH_MULT_Pos) | (qh->Cap & ~(QH_C_MASK_Msk | QH_S_MASK_Msk)) | 0x7802; - } - ep->hw_pipe = (void *)qh; /* associate QH with endpoint */ - } - - /*------------------------------------------------------------------------------------*/ - /* Prepare qTD */ - /*------------------------------------------------------------------------------------*/ - qtd = alloc_ehci_qTD(utr); - if (qtd == NULL) /* failed to allocate a qTD */ - { - if (is_new_qh) - { - free_ehci_QH(qh); - ep->hw_pipe = NULL; - } - return USBH_ERR_MEMORY_OUT; - } - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - token = QTD_ERR_COUNTER | QTD_PID_OUT | QTD_STS_ACTIVE; - else - token = QTD_ERR_COUNTER | QTD_PID_IN | QTD_STS_ACTIVE; - - qtd->qh = qh; - qtd->Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - qtd->Alt_Next_qTD = QTD_LIST_END; //(uint32_t)_ghost_qtd; - write_qtd_bptr(qtd, (uint32_t)utr->buff, utr->data_len); - append_to_qtd_list_of_QH(qh, qtd); - qtd->Token = QTD_IOC | (utr->data_len << 16) | token; - - DISABLE_EHCI_IRQ(); - - USB_debug("ehci_int_xfer - qh: 0x%x, 0x%x, 0x%x, qtd: 0x%x\n", (int)qh, (int)qh->Chrst, (int)qh->Cap, (int)qtd); - - qh->OL_Next_qTD = (uint32_t)qtd; - - if (is_new_qh) - { - memcpy(&(qh->OL_Bptr[0]), &(qtd->Bptr[0]), 20); - qh->Curr_qTD = (uint32_t)qtd; - qh->OL_Token = qtd->Token; - - if (udev->speed == SPEED_HIGH) /* get head node of this interval */ - iqh = get_int_tree_head_node(ep->bInterval); - else - iqh = get_int_tree_head_node(ep->bInterval * 8); - qh->HLink = iqh->HLink; /* Add to list of the same interval */ - iqh->HLink = QH_HLNK_QH(qh); - } - - ENABLE_EHCI_IRQ(); - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; -} - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ehci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - QH_T *qh; - - // USB_debug("ehci_quit_xfer - utr: 0x%x, ep: 0x%x\n", (int)utr, (int)ep); - - DISABLE_EHCI_IRQ(); - if (ehci_quit_iso_xfer(utr, ep) == 0) - { - ENABLE_EHCI_IRQ(); - return 0; - } - ENABLE_EHCI_IRQ(); - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - qh = (QH_T *)(utr->ep->hw_pipe); - - if (!qh) - return USBH_ERR_NOT_FOUND; - - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - qh = (QH_T *)(ep->hw_pipe); - /* add the QH to remove list, it will be removed on the next IAAD interrupt */ - move_qh_to_remove_list(qh); - ep->hw_pipe = NULL; - } - usbh_delay_ms(2); - - return 0; -} - -static int visit_qtd(qTD_T *qtd) -{ - if ((qtd->Token == 0x11197B7F) || (qtd->Token == 0x1197B7F)) - return 0; /* A Dummy qTD or qTD on writing, don't touch it. */ - - // USB_debug("Visit qtd 0x%x - 0x%x\n", (int)qtd, qtd->Token); - - if ((qtd->Token & QTD_STS_ACTIVE) == 0) - { - if (qtd->Token & (QTD_STS_HALT | QTD_STS_DATA_BUFF_ERR | QTD_STS_BABBLE | QTD_STS_XactErr | QTD_STS_MISS_MF)) - { - USB_error("qTD 0x%x error token=0x%x! 0x%x\n", (int)qtd, qtd->Token, qtd->Bptr[0]); - if (qtd->utr->status == 0) - qtd->utr->status = USBH_ERR_TRANSACTION; - } - else - { - if ((qtd->Token & QTD_PID_Msk) != QTD_PID_SETUP) - { - qtd->utr->xfer_len += qtd->xfer_len - QTD_TODO_LEN(qtd->Token); - // USB_debug("0x%x utr->xfer_len += %d\n", qtd->Token, qtd->xfer_len - QTD_TODO_LEN(qtd->Token)); - } - } - return 1; - } - return 0; -} - -void scan_asynchronous_list() -{ - QH_T *qh, *qh_tmp; - qTD_T *q_pre, *qtd, *qtd_tmp; - UTR_T *utr; - - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - // USB_debug("Scan qh=0x%x, 0x%x\n", (int)qh, qh->OL_Token); - - utr = NULL; - qtd = qh->qtd_list; - while (qtd != NULL) - { - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - /* qTD is completed, will remove it */ - utr = qtd->utr; - if (qtd == qh->qtd_list) - qh->qtd_list = qtd->next; /* unlink the qTD from qtd_list */ - else - q_pre->next = qtd->next; /* unlink the qTD from qtd_list */ - - qtd_tmp = qtd; /* remember this qTD for freeing later */ - qtd = qtd->next; /* advance to the next qTD */ - - qtd_tmp->next = qh->done_list; /* push this qTD to QH's done list */ - qh->done_list = qtd_tmp; - } - else - { - q_pre = qtd; /* remember this qTD as a preceder */ - qtd = qtd->next; /* advance to next qTD */ - } - } - - qh_tmp = qh; - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qh_tmp->qtd_list == NULL) && utr) - { - // printf("T %d [%d]\n", (qh_tmp->Chrst>>8)&0xf, (qh_tmp->OL_Token&QTD_DT) ? 1 : 0); - if (qh_tmp->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - } -} - -static void scan_periodic_frame_list() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Scan interrupt frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - qtd = qh->qtd_list; /* There's only one qTD in list at most. */ - - if (qtd == NULL) - { - /* empty QH */ - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - continue; - } - - if (visit_qtd(qtd)) /* if TRUE, reclaim this qtd */ - { - qtd->next = qh->done_list; /* push qTD into the done list */ - qh->done_list = qtd; - qh->qtd_list = NULL; /* qtd_list becomes empty */ - } - - qtd = qh->done_list; - - /* If all TDs are done, call-back to requester and then remove this QH. */ - if ((qtd != NULL) && (qh->qtd_list == NULL)) - { - utr = qtd->utr; - - if (qh->OL_Token & QTD_DT) - utr->ep->bToggle = 1; - else - utr->ep->bToggle = 0; - - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - - _ehci->UCMDR |= HSUSBH_UCMDR_IAAD_Msk; /* trigger IAA to reclaim done_list */ - } - - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Scan isochronous frame list */ - /*------------------------------------------------------------------------------------*/ - - scan_isochronous_list(); -} - -void iaad_remove_qh() -{ - QH_T *qh; - qTD_T *qtd; - UTR_T *utr; - - /*------------------------------------------------------------------------------------*/ - /* Remove all QHs in qh_remove_list... */ - /*------------------------------------------------------------------------------------*/ - while (qh_remove_list != NULL) - { - qh = qh_remove_list; - qh_remove_list = qh->next; - - // USB_debug("iaad_remove_qh - remove QH 0x%x\n", (int)qh); - - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - - if (qh->qtd_list != NULL) /* still have incomplete qTDs? */ - { - utr = qh->qtd_list->utr; - while (qh->qtd_list) - { - qtd = qh->qtd_list; - qh->qtd_list = qtd->next; - free_ehci_qTD(qtd); - } - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); /* call back */ - } - free_ehci_QH(qh); /* free the QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each asynchronous QH */ - /*------------------------------------------------------------------------------------*/ - qh = QH_PTR(_H_qh->HLink); - while (qh != _H_qh) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } - - /*------------------------------------------------------------------------------------*/ - /* Free all qTD in done_list of each QH of periodic frame list */ - /*------------------------------------------------------------------------------------*/ - qh = _Iqh[NUM_IQH - 1]; - while (qh != NULL) - { - while (qh->done_list) /* we can free the qTDs now */ - { - qtd = qh->done_list; - qh->done_list = qtd->next; - free_ehci_qTD(qtd); - } - qh = QH_PTR(qh->HLink); /* advance to the next QH */ - } -} - -//void EHCI_IRQHandler(void) -void nu_ehci_isr(int vector, void *param) -{ - volatile uint32_t intsts = _ehci->USTSR; - - _ehci->USTSR = intsts; /* clear interrupt status */ - - //USB_debug("ehci int_sts = 0x%x\n", intsts); - - if (intsts & HSUSBH_USTSR_UERRINT_Msk) - { - USB_error("Transfer error!\n"); - } - - if (intsts & HSUSBH_USTSR_USBINT_Msk) - { - /* some transfers completed, travel asynchronous */ - /* and periodic lists to find and reclaim them. */ - scan_asynchronous_list(); - - scan_periodic_frame_list(); - } - - if (intsts & HSUSBH_USTSR_IAA_Msk) - { - iaad_remove_qh(); - } -} - -static UDEV_T *ehci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && (udev->speed == SPEED_HIGH)) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ehci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ehci->UPSCR[port] = (_ehci->UPSCR[port] | HSUSBH_UPSCR_PRST_Msk) & ~HSUSBH_UPSCR_PE_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) ; /* wait at least 50 ms */ - - _ehci->UPSCR[port] &= ~HSUSBH_UPSCR_PRST_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) || - ((_ehci->UPSCR[port] & (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk)) == (HSUSBH_UPSCR_CCS_Msk | HSUSBH_UPSCR_PE_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("EHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PEC_Msk; /* clear port enable change status */ - return USBH_OK; /* port reset success */ -} - -static int ehci_rh_polling(void) -{ - UDEV_T *udev; - int ret, change = 0; - int port; - int connect_status, t0, debounce_tick; - - for (port = 0; port < EHCI_PORT_CNT; port++) - { - if (!(_ehci->UPSCR[port] & HSUSBH_UPSCR_CSC_Msk)) - continue; - - change = 1; - USB_debug("EHCI port%d status change: 0x%x\n", port + 1, _ehci->UPSCR[port]); - - /*--------------------------------------------------------------------------------*/ - /* Disconnect the devices attached to this port. */ - /*--------------------------------------------------------------------------------*/ - while (1) - { - udev = ehci_find_device_by_port(port + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - /*--------------------------------------------------------------------------------*/ - /* Port de-bounce */ - /*--------------------------------------------------------------------------------*/ - t0 = usbh_get_ticks(); - debounce_tick = usbh_tick_from_millisecond(HUB_DEBOUNCE_TIME); - connect_status = _ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk; - while (usbh_get_ticks() - t0 < debounce_tick) - { - if (connect_status != (_ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk)) - { - /* reset stable time counting */ - t0 = usbh_get_ticks(); - connect_status = _ehci->UPSCR[port] & HSUSBH_UPSCR_CCS_Msk; - } - } - - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear connect status change bit */ - - if (connect_status == HSUSBH_UPSCR_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* A new device connected. */ - /*----------------------------------------------------------------------------*/ - if (ehci_rh_port_reset(port) != USBH_OK) - { - /* port reset failed, maybe an USB 1.1 device */ - _ehci->UPSCR[port] |= HSUSBH_UPSCR_PO_Msk; /* change port owner to OHCI */ - _ehci->UPSCR[port] |= HSUSBH_UPSCR_CSC_Msk; /* clear all status change bits */ - return 0; - } - - /* - * Port reset success. Start to enumerate this new device. - */ - udev = alloc_device(); - if (udev == NULL) - return 0; /* out-of-memory, do nothing... */ - - udev->parent = NULL; - udev->port_num = port + 1; - udev->speed = SPEED_HIGH; - udev->hc_driver = &ehci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - } - else - { - /* Device disconnected */ - while (1) - { - udev = ehci_find_device_by_port(port + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - } - } - return change; -} - - -HC_DRV_T ehci_driver = -{ - ehci_init, /* init */ - ehci_shutdown, /* shutdown */ - ehci_suspend, /* suspend */ - ehci_resume, /* resume */ - ehci_ctrl_xfer, /* ctrl_xfer */ - ehci_bulk_xfer, /* bulk_xfer */ - ehci_int_xfer, /* int_xfer */ - ehci_iso_xfer, /* iso_xfer */ - ehci_quit_xfer, /* quit_xfer */ - ehci_rh_port_reset, /* rthub_port_reset */ - ehci_rh_polling /* rthub_polling */ -}; - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci_iso.c b/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci_iso.c deleted file mode 100644 index 749314cca9a..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ehci_iso.c +++ /dev/null @@ -1,918 +0,0 @@ -/**************************************************************************//** - * @file ehci_iso.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB EHCI isochornous transfer driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "nuc980.h" - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -uint32_t g_flr_cnt; /* frame list rollover counter */ - -ISO_EP_T *iso_ep_list; /* list of activated isochronous pipes */ - -extern uint32_t *_PFList; /* Periodic frame list */ - -static const uint16_t sitd_OUT_Smask [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f }; - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep); - -/* - * Inspect the iTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_itd(iTD_T *itd) -{ - UTR_T *utr; - uint32_t frnidx = itd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int i, fidx; - - // printf("R - %d %d, 0x%x\n", now_frame, frnidx, itd->Transaction[0]); - - if (now_frame == frnidx) - { - for (i = 0; i < 8; i++) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - return 0; /* have any not completed frames */ - } - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this iTD - */ - utr = itd->utr; - fidx = itd->fidx; - for (i = 0; i < 8; i++) - { - if (!(itd->trans_mask & (0x1 << i))) - continue; /* not scheduled micro-frame */ - - if (ITD_STATUS(itd->Transaction[i])) - { - if (itd->Transaction[i] & ITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - utr->status = USBH_ERR_NOT_ACCESS0; - } - else if (itd->Transaction[i] & ITD_STATUS_BABBLE) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (itd->Transaction[i] & ITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - utr->iso_status[fidx] = 0; - utr->iso_xlen[fidx] = ITD_XFER_LEN(itd->Transaction[i]); - } - fidx++; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - - return 1; /* to be reclaimed */ -} - -/* - * Inspect the siTD can be reclaimed or not. If yes, collect the transaction results. - * Return: 1 - reclaimed - * 0 - not completed - */ -static int review_sitd(siTD_T *sitd) -{ - UTR_T *utr; - uint32_t frnidx = sitd->sched_frnidx; - uint32_t now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - int fidx; - uint32_t TotalBytesToTransfer; - - if (now_frame == frnidx) - { - if (SITD_STATUS(sitd->StsCtrl) == SITD_STATUS_ACTIVE) - return 0; - } - else if (now_frame > frnidx) - { - if ((now_frame - frnidx) > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - else - { - if (now_frame + FL_SIZE - frnidx > EHCI_ISO_RCLM_RANGE) - return 0; /* don't touch it */ - } - - /* - * Reclaim this siTD - */ - utr = sitd->utr; - fidx = sitd->fidx; - - if (SITD_STATUS(sitd->StsCtrl)) - { - if (sitd->StsCtrl & SITD_STATUS_ACTIVE) - { - utr->iso_status[fidx] = USBH_ERR_NOT_ACCESS0; - } - else if (sitd->StsCtrl & SITD_BABBLE_DETECTED) - { - utr->iso_status[fidx] = USBH_ERR_BABBLE_DETECTED; - utr->status = USBH_ERR_TRANSFER; - } - else if (sitd->StsCtrl & SITD_STATUS_BUFF_ERR) - { - utr->iso_status[fidx] = USBH_ERR_DATA_BUFF; - utr->status = USBH_ERR_TRANSFER; - } - else - { - utr->iso_status[fidx] = USBH_ERR_TRANSACTION; - utr->status = USBH_ERR_TRANSFER; - } - } - else - { - TotalBytesToTransfer = (sitd->StsCtrl & SITD_XFER_CNT_Msk) >> SITD_XFER_CNT_Pos; - utr->iso_xlen[fidx] = utr->iso_xlen[fidx] - TotalBytesToTransfer; - utr->iso_status[fidx] = 0; - } - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - return 1; /* to be reclaimed */ -} - -/* - * Some iTD/siTD may be scheduled but not serviced due to time missed. - * This function scan several earlier frames and drop unserviced iTD/siTD if found. - */ -void scan_isochronous_list(void) -{ - ISO_EP_T *iso_ep = iso_ep_list; - iTD_T *itd, *itd_pre, *p; - siTD_T *sitd, *sitd_pre, *sp; - uint32_t frnidx; - - DISABLE_EHCI_IRQ(); - - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - /*--------------------------------------------------------------------------------*/ - /* Scan all iTDs */ - /*--------------------------------------------------------------------------------*/ - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - itd_pre = NULL; - while (itd != NULL) /* traverse all iTDs of itd list */ - { - if (review_itd(itd)) /* inspect and reclaim iTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("An iTD lost refernece to periodic frame list! 0x%x -> %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this iTD from iso_ep's iTD list */ - /*------------------------------------------------------------------------*/ - if (itd_pre == NULL) - { - iso_ep->itd_list = itd->next; - } - else - { - itd_pre->next = itd->next; - } - p = itd->next; - free_ehci_iTD(itd); - itd = p; - } - else - { - itd_pre = itd; - itd = itd->next; /* traverse to the next iTD of iTD list */ - } - } - - /*--------------------------------------------------------------------------------*/ - /* Scan all siTDs */ - /*--------------------------------------------------------------------------------*/ - sitd = iso_ep->sitd_list; /* get the first siTD from iso_ep's siTD list */ - sitd_pre = NULL; - while (sitd != NULL) /* traverse all siTDs of sitd list */ - { - if (review_sitd(sitd)) /* inspect and reclaim siTD */ - { - /*------------------------------------------------------------------------*/ - /* Remove this siTD from period frame list */ - /*------------------------------------------------------------------------*/ - frnidx = sitd->sched_frnidx; - if (_PFList[frnidx] == SITD_HLNK_SITD(sitd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = sitd->Next_Link; - } - else - { - sp = SITD_PTR(_PFList[frnidx]); /* find the preceding siTD */ - while ((SITD_PTR(sp->Next_Link) != sitd) && (sp != NULL)) - { - sp = SITD_PTR(sp->Next_Link); - } - - if (sp == NULL) /* link list out of control! */ - { - USB_error("An siTD lost reference to periodic frame list! 0x%x -> %d\n", (int)sitd, frnidx); - } - else /* remove iTD from list */ - { - sp->Next_Link = sitd->Next_Link; - } - } - - /*------------------------------------------------------------------------*/ - /* Remove this siTD from iso_ep's siTD list */ - /*------------------------------------------------------------------------*/ - if (sitd_pre == NULL) - { - iso_ep->sitd_list = sitd->next; - } - else - { - sitd_pre->next = sitd->next; - } - sp = sitd->next; - free_ehci_siTD(sitd); - sitd = sp; - } - else - { - sitd_pre = sitd; - sitd = sitd->next; /* traverse to the next siTD of siTD list */ - } - } - - iso_ep = iso_ep->next; - } - - ENABLE_EHCI_IRQ(); -} - - -static void write_itd_info(UTR_T *utr, iTD_T *itd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int i; - - buff_page_addr = itd->buff_base & 0xFFFFF000; /* 4K page */ - - for (i = 0; i < 7; i++) - { - itd->Bptr[i] = buff_page_addr + (0x1000 * i); - } - /* EndPtr R Device Address */ - itd->Bptr[0] |= (udev->dev_num) | ((ep->bEndpointAddress & 0xF) << ITD_EP_NUM_Pos); - itd->Bptr[1] |= ep->wMaxPacketSize; /* Maximum Packet Size */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - itd->Bptr[1] |= ITD_DIR_IN; - else - itd->Bptr[1] |= ITD_DIR_OUT; - - itd->Bptr[2] |= (ep->wMaxPacketSize + 1023) / 1024; /* Mult */ -} - -static void write_itd_micro_frame(UTR_T *utr, int fidx, iTD_T *itd, int mf) -{ - uint32_t buff_addr; - - buff_addr = (uint32_t)(utr->iso_buff[fidx]); /* xfer buffer start address of this frame */ - - itd->Transaction[mf] = ITD_STATUS_ACTIVE | /* Status */ - ((utr->iso_xlen[fidx] & 0xFFF) << ITD_XLEN_Pos) | /* Transaction Length */ - ((buff_addr & 0xFFFFF000) - (itd->buff_base & 0xFFFFF000)) | /* PG */ - (buff_addr & 0xFFF); /* Transaction offset */ -} - - -static void remove_iso_ep_from_list(ISO_EP_T *iso_ep) -{ - ISO_EP_T *p; - - if (iso_ep_list == iso_ep) - { - iso_ep_list = iso_ep->next; /* it's the first entry, remove it */ - return; - } - - p = iso_ep_list; /* find the previous entry of iso_ep */ - while (p->next != NULL) - { - if (p->next == iso_ep) - { - break; - } - p = p->next; - } - - if (p->next == NULL) - { - return; /* not found */ - } - p->next = iso_ep->next; /* remove iso_ep from list */ -} - - -static __inline void add_itd_to_iso_ep(ISO_EP_T *iso_ep, iTD_T *itd) -{ - iTD_T *p; - - itd->next = NULL; - - if (iso_ep->itd_list == NULL) - { - iso_ep->itd_list = itd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->itd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = itd; -} - -int ehci_iso_xfer(UTR_T *utr) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - ISO_EP_T *iso_ep; /* software iso endpoint descriptor */ - iTD_T *itd, *itd_next, *itd_list = NULL; - int i, itd_cnt; - int trans_mask; /* bit mask of used xfer in an iTD */ - int fidx; /* index to the 8 iso frames of UTR */ - int interval; /* frame interval of iTD */ - - if (ep->hw_pipe != NULL) - { - iso_ep = (ISO_EP_T *)ep->hw_pipe; /* get reference of the isochronous endpoint */ - - if (utr->bIsoNewSched) - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - } - else - { - /* first time transfer of this iso endpoint */ - iso_ep = usbh_alloc_mem(sizeof(*iso_ep)); - if (iso_ep == NULL) - return USBH_ERR_MEMORY_OUT; - - memset(iso_ep, 0, sizeof(*iso_ep)); - iso_ep->ep = ep; - iso_ep->next_frame = (((_ehci->UFINDR + (EHCI_ISO_DELAY * 8)) & HSUSBH_UFINDR_FI_Msk) >> 3) & 0x3FF; - - ep->hw_pipe = iso_ep; - - /* - * Add this iso_ep into iso_ep_list - */ - DISABLE_EHCI_IRQ(); - iso_ep->next = iso_ep_list; - iso_ep_list = iso_ep; - ENABLE_EHCI_IRQ(); - } - - if (utr->udev->speed == SPEED_FULL) - return ehci_iso_split_xfer(utr, iso_ep); - - /*------------------------------------------------------------------------------------*/ - /* Allocate iTDs */ - /*------------------------------------------------------------------------------------*/ - - if (ep->bInterval < 2) /* transfer interval is 1 micro-frame */ - { - trans_mask = 0xFF; - itd_cnt = 1; /* required 1 iTD for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 4) /* transfer interval is 2 micro-frames */ - { - trans_mask = 0x55; - itd_cnt = 2; /* required 2 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 8) /* transfer interval is 4 micro-frames */ - { - trans_mask = 0x44; - itd_cnt = 4; /* required 4 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 16) /* transfer interval is 8 micro-frames */ - { - trans_mask = 0x08; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 1; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 32) /* transfer interval is 16 micro-frames */ - { - trans_mask = 0x10; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 2; /* iTD frame interval of this endpoint */ - } - else if (ep->bInterval < 64) /* transfer interval is 32 micro-frames */ - { - trans_mask = 0x02; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 4; /* iTD frame interval of this endpoint */ - } - else /* transfer interval is 64 micro-frames */ - { - trans_mask = 0x04; /* there's 1 transfer in one iTD */ - itd_cnt = 8; /* required 8 iTDs for one UTR */ - interval = 8; /* iTD frame interval of this endpoint */ - } - - for (i = 0; i < itd_cnt; i++) /* allocate all iTDs required by UTR */ - { - itd = alloc_ehci_iTD(); - if (itd == NULL) - goto malloc_failed; - - if (itd_list == NULL) /* link all iTDs */ - { - itd_list = itd; - } - else - { - itd->next = itd_list; - itd_list = itd; - } - } - - utr->td_cnt = itd_cnt; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all iTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (itd = itd_list; (itd != NULL);) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver ITD bug!?\n"); - goto malloc_failed; - } - - itd->utr = utr; - itd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - itd->buff_base = (uint32_t)(utr->iso_buff[fidx]); /* iTD buffer base is buffer of the first UTR iso frame serviced by this iTD */ - itd->trans_mask = trans_mask; - - write_itd_info(utr, itd); - - for (i = 0; i < 8; i++) /* settle xfer into micro-frames */ - { - if (!(trans_mask & (0x1 << i))) - { - itd->Transaction[i] = 0; /* not accesed */ - continue; /* not scheduled micro-frame */ - } - - write_itd_micro_frame(utr, fidx, itd, i); - - fidx++; /* preceed to next UTR iso frame */ - - if (fidx == IF_PER_UTR) /* is the last scheduled micro-frame? */ - { - /* raise interrupt on completed */ - itd->Transaction[i] |= ITD_IOC; - break; - } - } - - itd_next = itd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - DISABLE_EHCI_IRQ(); - itd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - add_itd_to_iso_ep(iso_ep, itd); /* add to software itd list */ - itd->Next_Link = _PFList[itd->sched_frnidx]; /* keep the next link */ - _PFList[itd->sched_frnidx] = ITD_HLNK_ITD(itd); - iso_ep->next_frame = (iso_ep->next_frame + interval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - itd = itd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (itd_list != NULL) - { - itd = itd_list; - itd_list = itd->next; - free_ehci_iTD(itd); - } - return USBH_ERR_MEMORY_OUT; -} - -static __inline void add_sitd_to_iso_ep(ISO_EP_T *iso_ep, siTD_T *sitd) -{ - siTD_T *p; - - sitd->next = NULL; - - if (iso_ep->sitd_list == NULL) - { - iso_ep->sitd_list = sitd; - return; - } - - /* - * Find the tail entry of iso_ep->itd_list - */ - p = iso_ep->sitd_list; - while (p->next != NULL) - { - p = p->next; - } - p->next = sitd; -} - -static void write_sitd_info(UTR_T *utr, siTD_T *sitd) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - uint32_t buff_page_addr; - int xlen = utr->iso_xlen[sitd->fidx]; - int scnt; - - sitd->Chrst = (udev->port_num << SITD_PORT_NUM_Pos) | - (udev->parent->iface->udev->dev_num << SITD_HUB_ADDR_Pos) | - ((ep->bEndpointAddress & 0xF) << SITD_EP_NUM_Pos) | - (udev->dev_num << SITD_DEV_ADDR_Pos); - - buff_page_addr = ((uint32_t)utr->iso_buff[sitd->fidx]) & 0xFFFFF000; - sitd->Bptr[0] = (uint32_t)(utr->iso_buff[sitd->fidx]); - sitd->Bptr[1] = buff_page_addr + 0x1000; - - scnt = (xlen + 187) / 188; - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) /* I/O */ - { - sitd->Chrst |= SITD_XFER_IN; - sitd->Sched = (1 << (scnt + 2)) - 1; - sitd->Sched = (sitd->Sched << 10) | 0x1; - //sitd->Sched <<= 1; - } - else - { - sitd->Chrst |= SITD_XFER_OUT; - sitd->Sched = sitd_OUT_Smask[scnt - 1]; - if (scnt > 1) - { - sitd->Bptr[1] |= (0x1 << 3); /* Transaction position (TP) 01b: Begin */ - } - sitd->Bptr[1] |= scnt; /* Transaction count (T-Count) */ - } - - if (sitd->fidx == IF_PER_UTR) - { - sitd->Sched |= SITD_IOC; - } - - sitd->StsCtrl = (xlen << SITD_XFER_CNT_Pos) | SITD_STATUS_ACTIVE; - - sitd->BackLink = SITD_LIST_END; -} - - -static void ehci_sitd_adjust_schedule(siTD_T *sitd) -{ - siTD_T *hlink = (siTD_T *)_PFList[sitd->sched_frnidx]; - uint32_t uframe_mask = 0x00; - - while (hlink && !HLINK_IS_TERMINATED(hlink) && HLINK_IS_SITD(hlink)) - { - hlink = SITD_PTR(hlink); - if (hlink != sitd) - { - if ((hlink->Chrst & SITD_XFER_IO_Msk) == SITD_XFER_IN) - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by IN S-mask */ - uframe_mask |= ((hlink->Sched >> 8) & 0xFF); /* mark micro-frames used by IN C-mask */ - } - else - { - uframe_mask |= (hlink->Sched & 0xFF); /* mark micro-frames used by OUT S-mask */ - } - } - hlink = SITD_PTR(hlink->Next_Link); - } - - uframe_mask = uframe_mask | (uframe_mask << 8); /* mark both S-mask and C-mask */ - - if (uframe_mask) - { - /* - * Shift afterward one micro-frame until no conflicts. - */ - while (1) - { - if (sitd->Sched & uframe_mask) - { - sitd->Sched = (sitd->Sched & 0xFFFF0000) | ((sitd->Sched << 1) & 0xFFFF); - } - else - { - break; /* no conflit, done. */ - } - } - } -} - - -static int ehci_iso_split_xfer(UTR_T *utr, ISO_EP_T *iso_ep) -{ - EP_INFO_T *ep = utr->ep; /* reference to isochronous endpoint */ - siTD_T *sitd, *sitd_next, *sitd_list = NULL; - int i; - int fidx; /* index to the 8 iso frames of UTR */ - - if (utr->udev->parent == NULL) - { - USB_error("siso xfer - parent lost!\n"); - return USBH_ERR_INVALID_PARAM; - } - - /*------------------------------------------------------------------------------------*/ - /* Allocate siTDs */ - /*------------------------------------------------------------------------------------*/ - for (i = 0; i < IF_PER_UTR; i++) /* allocate all siTDs required by UTR */ - { - sitd = alloc_ehci_siTD(); - if (sitd == NULL) - goto malloc_failed; - - if (sitd_list == NULL) /* link all siTDs */ - { - sitd_list = sitd; - } - else - { - sitd->next = sitd_list; - sitd_list = sitd; - } - } - - utr->td_cnt = IF_PER_UTR; - - /*------------------------------------------------------------------------------------*/ - /* Fill and link all siTDs */ - /*------------------------------------------------------------------------------------*/ - - utr->iso_sf = iso_ep->next_frame; - fidx = 0; /* index to UTR iso frmes (total IF_PER_UTR) */ - - for (sitd = sitd_list; (sitd != NULL); fidx++) - { - if (fidx >= IF_PER_UTR) /* unlikely */ - { - USB_error("EHCI driver siTD bug!?\n"); - goto malloc_failed; - } - - sitd->utr = utr; - sitd->fidx = fidx; /* index to UTR's n'th IF_PER_UTR frame */ - - write_sitd_info(utr, sitd); - - sitd_next = sitd->next; /* remember the next itd */ - - // USB_debug("Link iTD 0x%x, %d\n", (int)itd, iso_ep->next_frame); - /* - * Link iTD to period frame list - */ - sitd->sched_frnidx = iso_ep->next_frame; /* remember it for reclamation scan */ - DISABLE_EHCI_IRQ(); - ehci_sitd_adjust_schedule(sitd); - add_sitd_to_iso_ep(iso_ep, sitd); /* add to software itd list */ - sitd->Next_Link = _PFList[sitd->sched_frnidx];/* keep the next link */ - _PFList[sitd->sched_frnidx] = SITD_HLNK_SITD(sitd); - iso_ep->next_frame = (iso_ep->next_frame + ep->bInterval) % FL_SIZE; - ENABLE_EHCI_IRQ(); - - sitd = sitd_next; - } - - _ehci->UCMDR |= HSUSBH_UCMDR_PSEN_Msk; /* periodic list enable */ - return 0; - -malloc_failed: - - while (sitd_list != NULL) - { - sitd = sitd_list; - sitd_list = sitd->next; - free_ehci_siTD(sitd); - } - return USBH_ERR_MEMORY_OUT; -} - -/* - * If it's an isochronous endpoint, quit current transfer via UTR or hardware EP. - */ -int ehci_quit_iso_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ISO_EP_T *iso_ep; - iTD_T *itd, *itd_next, *p; - uint32_t frnidx; - uint32_t now_frame; - - if (ep == NULL) - { - if (utr == NULL) - return USBH_ERR_NOT_FOUND; - - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ep = utr->ep; - } - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) != EP_ATTR_TT_ISO) - return USBH_ERR_NOT_FOUND; /* not isochronous endpoint */ - - /*------------------------------------------------------------------------------------*/ - /* It's an iso endpoint. Remove it as required. */ - /*------------------------------------------------------------------------------------*/ - iso_ep = iso_ep_list; - while (iso_ep != NULL) /* Search all activated iso endpoints */ - { - if (iso_ep->ep == ep) - break; - iso_ep = iso_ep->next; - } - if (iso_ep == NULL) - return 0; /* should have been removed */ - - itd = iso_ep->itd_list; /* get the first iTD from iso_ep's iTD list */ - - while (itd != NULL) /* traverse all iTDs of itd list */ - { - itd_next = itd->next; /* remember the next iTD */ - utr = itd->utr; - - /*--------------------------------------------------------------------------------*/ - /* Remove this iTD from period frame list */ - /*--------------------------------------------------------------------------------*/ - frnidx = itd->sched_frnidx; - - /* - * Prevent to race with Host Controller. If the iTD to be removed is located in - * current or next frame, wait until HC passed through it. - */ - while (1) - { - now_frame = (_ehci->UFINDR >> 3) & 0x3FF; - if ((now_frame == frnidx) || (((now_frame + 1) % 1024) == frnidx)) - continue; - break; - } - - if (_PFList[frnidx] == ITD_HLNK_ITD(itd)) - { - /* is the first entry, just change to next */ - _PFList[frnidx] = itd->Next_Link; - } - else - { - p = ITD_PTR(_PFList[frnidx]); /* find the preceding iTD */ - while ((ITD_PTR(p->Next_Link) != itd) && (p != NULL)) - { - p = ITD_PTR(p->Next_Link); - } - - if (p == NULL) /* link list out of control! */ - { - USB_error("ehci_quit_iso_xfer - An iTD lost reference to periodic frame list! 0x%x on %d\n", (int)itd, frnidx); - } - else /* remove iTD from list */ - { - p->Next_Link = itd->Next_Link; - } - } - - utr->td_cnt--; - - if (utr->td_cnt == 0) /* All iTD of this UTR done */ - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - utr->status = USBH_ERR_ABORT; - } - free_ehci_iTD(itd); - itd = itd_next; - } - - /* - * Remove iso_ep from iso_ep_list - */ - remove_iso_ep_from_list(iso_ep); - usbh_free_mem(iso_ep, sizeof(*iso_ep)); /* free this iso_ep */ - ep->hw_pipe = NULL; - - if (iso_ep_list == NULL) - _ehci->UCMDR &= ~HSUSBH_UCMDR_PSEN_Msk; - - return 0; -} - - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/mem_alloc.c b/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/mem_alloc.c deleted file mode 100644 index 1ad3cabcb1f..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/mem_alloc.c +++ /dev/null @@ -1,540 +0,0 @@ -/**************************************************************************//** - * @file mem_alloc.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB host library memory allocation functions. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" - - -/// @cond HIDDEN_SYMBOLS - -//#define MEM_DEBUG - -#ifdef MEM_DEBUG - #define mem_debug rt_kprintf -#else - #define mem_debug(...) -#endif - -#ifdef __ICCARM__ - #pragma data_alignment=1024 - uint8_t _mem_pool_buff[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE]; -#else - uint8_t _mem_pool_buff[MEM_POOL_UNIT_NUM][MEM_POOL_UNIT_SIZE] __attribute__((aligned(1024))); -#endif - -static uint8_t *_mem_pool[MEM_POOL_UNIT_NUM]; -static uint8_t _unit_used[MEM_POOL_UNIT_NUM]; - -static volatile int _usbh_mem_used; -static volatile int _usbh_max_mem_used; -static volatile int _mem_pool_used; - - -UDEV_T *g_udev_list; - -uint8_t _dev_addr_pool[128]; -static volatile int _device_addr; - -static int _sidx = 0;; - -/*--------------------------------------------------------------------------*/ -/* Memory alloc/free recording */ -/*--------------------------------------------------------------------------*/ - -void usbh_memory_init(void) -{ - int i; - - if (sizeof(TD_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("TD_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - if (sizeof(ED_T) > MEM_POOL_UNIT_SIZE) - { - USB_error("ED_T - MEM_POOL_UNIT_SIZE too small!\n"); - while (1); - } - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - _unit_used[i] = 0; - _mem_pool[i] = (uint8_t *)((uint32_t)&_mem_pool_buff[i] | NON_CACHE_MASK); - } - - _usbh_mem_used = 0L; - _usbh_max_mem_used = 0L; - - _mem_pool_used = 0; - _sidx = 0; - - g_udev_list = NULL; - - memset(_dev_addr_pool, 0, sizeof(_dev_addr_pool)); - _device_addr = 1; - - USB_InitializeMemoryPool(); -} - -uint32_t usbh_memory_used(void) -{ - mem_debug("USB static memory: %d/%d, heap used: %d\n", _mem_pool_used, MEM_POOL_UNIT_NUM, _usbh_mem_used); - return _usbh_mem_used; -} - -static void memory_counter(int size) -{ - _usbh_mem_used += size; - if (_usbh_mem_used > _usbh_max_mem_used) - _usbh_max_mem_used = _usbh_mem_used; -} - -void *usbh_alloc_mem(int size) -{ - void *p; - - p = USB_malloc(size, 16); - if (p == NULL) - { - USB_error("usbh_alloc_mem failed! %d\n", size); - return NULL; - } - - memset(p, 0, size); - memory_counter(size); - return p; -} - -void usbh_free_mem(void *p, int size) -{ - USB_free(p); - memory_counter(0 - size); -} - - -/*--------------------------------------------------------------------------*/ -/* USB device allocate/free */ -/*--------------------------------------------------------------------------*/ - -UDEV_T *alloc_device(void) -{ - UDEV_T *udev; - - udev = (UDEV_T *)USB_malloc(sizeof(*udev), 16); - if (udev == NULL) - { - USB_error("alloc_device failed!\n"); - return NULL; - } - - memset(udev, 0, sizeof(*udev)); - memory_counter(sizeof(*udev)); - udev->cur_conf = -1; /* must! used to identify the first SET CONFIGURATION */ - udev->next = g_udev_list; /* chain to global device list */ - g_udev_list = udev; - return udev; -} - -void free_device(UDEV_T *udev) -{ - UDEV_T *d; - - if (udev == NULL) - return; - - if (udev->cfd_buff != NULL) - usbh_free_mem(udev->cfd_buff, MAX_DESC_BUFF_SIZE); - - /* - * Remove it from the global device list - */ - if (g_udev_list == udev) - { - g_udev_list = g_udev_list->next; - } - else - { - d = g_udev_list; - while (d != NULL) - { - if (d->next == udev) - { - d->next = udev->next; - break; - } - d = d->next; - } - } - USB_free(udev); - memory_counter(-sizeof(*udev)); -} - -int alloc_dev_address(void) -{ - _device_addr++; - - if (_device_addr >= 128) - _device_addr = 1; - - while (1) - { - if (_dev_addr_pool[_device_addr] == 0) - { - _dev_addr_pool[_device_addr] = 1; - return _device_addr; - } - _device_addr++; - if (_device_addr >= 128) - _device_addr = 1; - } -} - -void free_dev_address(int dev_addr) -{ - if (dev_addr < 128) - _dev_addr_pool[dev_addr] = 0; -} - -/*--------------------------------------------------------------------------*/ -/* UTR (USB Transfer Request) allocate/free */ -/*--------------------------------------------------------------------------*/ - -UTR_T *alloc_utr(UDEV_T *udev) -{ -#if 0 - UTR_T *utr, *utr_noncache; - - utr = (UTR_T *)USB_malloc(sizeof(*utr), 16); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - - utr_noncache = (UTR_T *)((uint32_t)utr | NONCACHEABLE); - - memory_counter(sizeof(*utr)); - memset(utr_noncache, 0, sizeof(*utr)); - utr_noncache->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr_noncache); - return utr_noncache; -#else - UTR_T *utr; - - utr = (UTR_T *)USB_malloc(sizeof(*utr), 16); - if (utr == NULL) - { - USB_error("alloc_utr failed!\n"); - return NULL; - } - - memory_counter(sizeof(*utr)); - memset(utr, 0, sizeof(*utr)); - utr->udev = udev; - mem_debug("[ALLOC] [UTR] - 0x%x\n", (int)utr_noncache); - return utr; -#endif -} - -void free_utr(UTR_T *utr) -{ - if (utr == NULL) - return; - - mem_debug("[FREE] [UTR] - 0x%x\n", (int)utr); - -#if 0 - if ((uint32_t)utr & NONCACHEABLE) - utr = (UTR_T *)((uint32_t)utr & ~NONCACHEABLE); -#endif - - USB_free(utr); - memory_counter(0 - (int)sizeof(*utr)); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI ED allocate/free */ -/*--------------------------------------------------------------------------*/ - -ED_T *alloc_ohci_ED(void) -{ - int i; - ED_T *ed; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - ed = (ED_T *)_mem_pool[i]; - memset(ed, 0, sizeof(*ed)); - mem_debug("[ALLOC] [ED] - 0x%x\n", (int)ed); - return ed; - } - } - USB_error("alloc_ohci_ED failed!\n"); - return NULL; -} - -void free_ohci_ED(ED_T *ed) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)ed) - { - mem_debug("[FREE] [ED] - 0x%x\n", (int)ed); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ohci_ED - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* OHCI TD allocate/free */ -/*--------------------------------------------------------------------------*/ -TD_T *alloc_ohci_TD(UTR_T *utr) -{ - int i; - TD_T *td; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _mem_pool_used++; - td = (TD_T *)_mem_pool[i]; - - memset(td, 0, sizeof(*td)); - td->utr = utr; - mem_debug("[ALLOC] [TD] - 0x%x\n", (int)td); - return td; - } - } - USB_error("alloc_ohci_TD failed!\n"); - return NULL; -} - -void free_ohci_TD(TD_T *td) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)td) - { - mem_debug("[FREE] [TD] - 0x%x\n", (int)td); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ohci_TD - not found!\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI QH allocate/free */ -/*--------------------------------------------------------------------------*/ -QH_T *alloc_ehci_QH(void) -{ - int i; - QH_T *qh = NULL; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qh = (QH_T *)_mem_pool[i]; - memset(qh, 0, sizeof(*qh)); - mem_debug("[ALLOC] [QH] - 0x%x\n", (int)qh); - break; - } - } - if (qh == NULL) - { - USB_error("alloc_ehci_QH failed!\n"); - return NULL; - } - qh->Curr_qTD = QTD_LIST_END; - qh->OL_Next_qTD = QTD_LIST_END; - qh->OL_Alt_Next_qTD = QTD_LIST_END; - qh->OL_Token = QTD_STS_HALT; - return qh; -} - -void free_ehci_QH(QH_T *qh) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)qh) - { - mem_debug("[FREE] [QH] - 0x%x\n", (int)qh); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_debug("free_ehci_QH - not found! (ignored in case of multiple UTR)\n"); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI qTD allocate/free */ -/*--------------------------------------------------------------------------*/ -qTD_T *alloc_ehci_qTD(UTR_T *utr) -{ - int i; - qTD_T *qtd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used++; - qtd = (qTD_T *)_mem_pool[i]; - - memset(qtd, 0, sizeof(*qtd)); - qtd->Next_qTD = QTD_LIST_END; - qtd->Alt_Next_qTD = QTD_LIST_END; - qtd->Token = 0x1197B7F; // QTD_STS_HALT; visit_qtd() will not remove a qTD with this mark. It means the qTD still not ready for transfer. - qtd->utr = utr; - mem_debug("[ALLOC] [qTD] - 0x%x\n", (int)qtd); - return qtd; - } - } - USB_error("alloc_ehci_qTD failed!\n"); - return NULL; -} - -void free_ehci_qTD(qTD_T *qtd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)qtd) - { - mem_debug("[FREE] [qTD] - 0x%x\n", (int)qtd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_qTD 0x%x - not found!\n", (int)qtd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -iTD_T *alloc_ehci_iTD(void) -{ - int i; - iTD_T *itd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (i + 2 >= MEM_POOL_UNIT_NUM) - continue; - - if ((_unit_used[i] == 0) && (_unit_used[i + 1] == 0)) - { - _unit_used[i] = _unit_used[i + 1] = 1; - _sidx = i + 1; - _mem_pool_used += 2; - itd = (iTD_T *)_mem_pool[i]; - memset(itd, 0, sizeof(*itd)); - mem_debug("[ALLOC] [iTD] - 0x%x\n", (int)itd); - return itd; - } - } - USB_error("alloc_ehci_iTD failed!\n"); - return NULL; -} - -void free_ehci_iTD(iTD_T *itd) -{ - int i; - - for (i = 0; i + 1 < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)itd) - { - mem_debug("[FREE] [iTD] - 0x%x\n", (int)itd); - _unit_used[i] = _unit_used[i + 1] = 0; - _mem_pool_used -= 2; - return; - } - } - USB_error("free_ehci_iTD 0x%x - not found!\n", (int)itd); -} - -/*--------------------------------------------------------------------------*/ -/* EHCI iTD allocate/free */ -/*--------------------------------------------------------------------------*/ -siTD_T *alloc_ehci_siTD(void) -{ - int i; - siTD_T *sitd; - - for (i = (_sidx + 1) % MEM_POOL_UNIT_NUM; i != _sidx; i = (i + 1) % MEM_POOL_UNIT_NUM) - { - if (_unit_used[i] == 0) - { - _unit_used[i] = 1; - _sidx = i; - _mem_pool_used ++; - sitd = (siTD_T *)_mem_pool[i]; - memset(sitd, 0, sizeof(*sitd)); - mem_debug("[ALLOC] [siTD] - 0x%x\n", (int)sitd); - return sitd; - } - } - USB_error("alloc_ehci_siTD failed!\n"); - return NULL; -} - -void free_ehci_siTD(siTD_T *sitd) -{ - int i; - - for (i = 0; i < MEM_POOL_UNIT_NUM; i++) - { - if ((uint32_t)_mem_pool[i] == (uint32_t)sitd) - { - mem_debug("[FREE] [siTD] - 0x%x\n", (int)sitd); - _unit_used[i] = 0; - _mem_pool_used--; - return; - } - } - USB_error("free_ehci_siTD 0x%x - not found!\n", (int)sitd); -} - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/ - diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ohci.c b/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ohci.c deleted file mode 100644 index 045c44d47d2..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/ohci.c +++ /dev/null @@ -1,1301 +0,0 @@ -/**************************************************************************//** - * @file ohci.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB Host library OHCI (USB 1.1) host controller driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2017 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "nuc980.h" - -#include "usb.h" -#include "hub.h" -#include "ohci.h" - -/// @cond HIDDEN_SYMBOLS - -//#define TD_debug rt_kprintf -#define TD_debug(...) - -//#define ED_debug rt_kprintf -#define ED_debug(...) - -uint8_t _hcca_mem[256] __attribute__((aligned(256))); - -HCCA_T *_hcca; - -ED_T *_Ied[6]; - - -static ED_T *ed_remove_list; - -static void add_to_ED_remove_list(ED_T *ed) -{ - ED_T *p; - - ED_debug("add_to_ED_remove_list - 0x%x (0x%x)\n", (int)ed, ed->Info); - DISABLE_OHCI_IRQ(); - - /* check if this ED found in ed_remove_list */ - p = ed_remove_list; - while (p) - { - if (p == ed) - { - ENABLE_OHCI_IRQ(); /* This ED found in ed_remove_list */ - return; /* do nothing */ - } - p = p->next; - } - - ed->Info |= ED_SKIP; /* ask OHCI controller skip this ED */ - ed->next = ed_remove_list; - ed_remove_list = ed; /* insert to the head of ed_remove_list */ - ENABLE_OHCI_IRQ(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_SF_Msk; - usbh_delay_ms(2); /* Full speed wait 2 ms is enough */ -} - -static int ohci_reset(void) -{ - volatile int t0; - - /* Disable HC interrupts */ - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_MIE_Msk; - - /* HC Reset requires max 10 ms delay */ - _ohci->HcControl = 0; - _ohci->HcCommandStatus = USBH_HcCommandStatus_HCR_Msk; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((USBH->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB OHCI reset timed out!\n"); - return -1; - } - - USBH->HcRhStatus = USBH_HcRhStatus_OCI_Msk | USBH_HcRhStatus_LPS_Msk; - - USBH->HcControl = HCFS_RESET; - - usbh_delay_ms(10); - - /* Check if OHCI reset completed? */ - if ((USBH->HcCommandStatus & USBH_HcCommandStatus_HCR_Msk) != 0) - { - USB_error("Error! - USB HC reset timed out!\n"); - return -1; - } - return 0; -} - -static void init_hcca_int_table() -{ - ED_T *ed_p; - int i, idx, interval; - - memset(_hcca->int_table, 0, sizeof(_hcca->int_table)); - - for (i = 5; i >= 0; i--) /* interval = i^2 */ - { - _Ied[i] = alloc_ohci_ED(); - _Ied[i]->Info = ED_SKIP; - - interval = 0x1 << i; - - for (idx = interval - 1; idx < 32; idx += interval) - { - if (_hcca->int_table[idx] == 0) /* is empty list, insert directly */ - { - _hcca->int_table[idx] = (uint32_t)_Ied[i]; - } - else - { - ed_p = (ED_T *)_hcca->int_table[idx]; - - while (1) - { - if (ed_p == _Ied[i]) - break; /* already chained by previous visit */ - - if (ed_p->NextED == 0) /* reach end of list? */ - { - ed_p->NextED = (uint32_t)_Ied[i]; - break; - } - ed_p = (ED_T *)ed_p->NextED; - } - } - } - } -} - -static ED_T *get_int_tree_head_node(int interval) -{ - int i; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return _Ied[i]; - } - return _Ied[5]; /* for interval >= 32 */ -} - -static int get_ohci_interval(int interval) -{ - int i, bInterval = 1; - - for (i = 0; i < 5; i++) - { - interval >>= 1; - if (interval == 0) - return bInterval; - bInterval *= 2; - } - return 32; /* for interval >= 32 */ -} - - -static int ohci_init(void) -{ - uint32_t fminterval; - volatile int i; - - _hcca = (HCCA_T *)((uint32_t)_hcca_mem | NON_CACHE_MASK); - - if (ohci_reset() < 0) - return -1; - - ed_remove_list = NULL; - - init_hcca_int_table(); - - /* Tell the controller where the control and bulk lists are - * The lists are empty now. */ - _ohci->HcControlHeadED = 0; /* control ED list head */ - _ohci->HcBulkHeadED = 0; /* bulk ED list head */ - - _ohci->HcHCCA = (uint32_t)_hcca; /* HCCA area */ - - /* periodic start 90% of frame interval */ - fminterval = 0x2edf; /* 11,999 */ - _ohci->HcPeriodicStart = (fminterval * 9) / 10; - - /* set FSLargestDataPacket, 10,104 for 0x2edf frame interval */ - fminterval |= ((((fminterval - 210) * 6) / 7) << 16); - _ohci->HcFmInterval = fminterval; - - _ohci->HcLSThreshold = 0x628; - - /* start controller operations */ - _ohci->HcControl = HCFS_OPER | (0x3 << USBH_HcControl_CBSR_Pos); - -#ifdef OHCI_PER_PORT_POWER - _ohci->HcRhDescriptorB = 0x60000; - for (i = 0; i < OHCI_PORT_CNT; i++) - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_PPS_Msk; -#else - _ohci->HcRhDescriptorA = (USBH->HcRhDescriptorA | (1 << 9)) & ~USBH_HcRhDescriptorA_PSM_Msk; - _ohci->HcRhStatus = USBH_HcRhStatus_LPSC_Msk; -#endif - - _ohci->HcInterruptEnable = USBH_HcInterruptEnable_MIE_Msk | USBH_HcInterruptEnable_WDH_Msk | USBH_HcInterruptEnable_SF_Msk; - - /* POTPGT delay is bits 24-31, in 20 ms units. */ - usbh_delay_ms(20); - return 0; -} - -static void ohci_suspend(void) -{ - int i; - - for (i = 0; i < OHCI_PORT_CNT; i++) - { - /* set port suspend if connected */ - if (_ohci->HcRhPortStatus[i] & 0x1) - _ohci->HcRhPortStatus[i] = 0x4; - } - - /* enable Device Remote Wakeup */ - _ohci->HcRhStatus |= USBH_HcRhStatus_DRWE_Msk; - - /* enable USBH RHSC interrupt for system wakeup */ - _ohci->HcInterruptEnable |= USBH_HcInterruptEnable_RHSC_Msk | USBH_HcInterruptEnable_RD_Msk; - - /* set Host Controller enter suspend state */ - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (3 << USBH_HcControl_HCFS_Pos); -} - -static void ohci_resume(void) -{ - int i; - - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (1 << USBH_HcControl_HCFS_Pos); - _ohci->HcControl = (USBH->HcControl & ~USBH_HcControl_HCFS_Msk) | (2 << USBH_HcControl_HCFS_Pos); - - for (i = 0; i < OHCI_PORT_CNT; i++) - { - if (_ohci->HcRhPortStatus[i] & 0x4) - _ohci->HcRhPortStatus[i] = 0x8; - } -} - -static void ohci_shutdown(void) -{ - ohci_suspend(); - DISABLE_OHCI_IRQ(); -#ifndef OHCI_PER_PORT_POWER - _ohci->HcRhStatus = USBH_HcRhStatus_LPS_Msk; -#endif -} - - -/* - * Quit current trasnfer via UTR or hardware EP. - */ -static int ohci_quit_xfer(UTR_T *utr, EP_INFO_T *ep) -{ - ED_T *ed; - - if (utr != NULL) - { - if (utr->ep == NULL) - return USBH_ERR_NOT_FOUND; - - ed = (ED_T *)(utr->ep->hw_pipe); - - if (!ed) - return USBH_ERR_NOT_FOUND; - - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - utr->ep->hw_pipe = NULL; - } - - if ((ep != NULL) && (ep->hw_pipe != NULL)) - { - ed = (ED_T *)(ep->hw_pipe); - /* add the endpoint to remove list, it will be removed on the next start of frame */ - add_to_ED_remove_list(ed); - ep->hw_pipe = NULL; - } - - return 0; -} - -uint32_t ed_make_info(UDEV_T *udev, EP_INFO_T *ep) -{ - uint32_t info; - - if (ep == NULL) /* is a control endpoint */ - { - /* control endpoint direction is from TD */ - if (udev->descriptor.bMaxPacketSize0 == 0) /* is 0 if device descriptor still not obtained. */ - { - if (udev->speed == SPEED_LOW) /* give a default maximum packet size */ - udev->descriptor.bMaxPacketSize0 = 8; - else - udev->descriptor.bMaxPacketSize0 = 64; - } - info = (udev->descriptor.bMaxPacketSize0 << 16) /* Control endpoint Maximum Packet Size from device descriptor */ - | ED_DIR_BY_TD /* Direction (Get direction From TD) */ - | ED_FORMAT_GENERAL /* General format */ - | (0 << ED_CTRL_EN_Pos); /* Endpoint address 0 */ - } - else /* Other endpoint direction is from endpoint descriptor */ - { - info = (ep->wMaxPacketSize << 16); /* Maximum Packet Size from endpoint */ - - info |= ((ep->bEndpointAddress & 0xf) << ED_CTRL_EN_Pos); /* Endpoint Number */ - - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_IN) - info |= ED_DIR_IN; - else - info |= ED_DIR_OUT; - - if ((ep->bmAttributes & EP_ATTR_TT_MASK) == EP_ATTR_TT_ISO) - info |= ED_FORMAT_ISO; - else - info |= ED_FORMAT_GENERAL; - } - - info |= ((udev->speed == SPEED_LOW) ? ED_SPEED_LOW : ED_SPEED_FULL); /* Speed */ - info |= (udev->dev_num); /* Function Address */ - - return info; -} - -static void write_td(TD_T *td, uint32_t info, uint8_t *buff, uint32_t data_len) -{ - td->Info = info; - td->CBP = (uint32_t)((!buff || !data_len) ? 0 : buff); - td->BE = (uint32_t)((!buff || !data_len) ? 0 : (uint32_t)buff + data_len - 1); - td->buff_start = td->CBP; - // TD_debug("TD [0x%x]: 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->BE); -} - -static int ohci_ctrl_xfer(UTR_T *utr) -{ - UDEV_T *udev; - ED_T *ed; - TD_T *td_setup, *td_data, *td_status; - uint32_t info; - - udev = utr->udev; - - /*------------------------------------------------------------------------------------*/ - /* Allocate ED and TDs */ - /*------------------------------------------------------------------------------------*/ - td_setup = alloc_ohci_TD(utr); - - if (utr->data_len > 0) - td_data = alloc_ohci_TD(utr); - else - td_data = NULL; - - td_status = alloc_ohci_TD(utr); - - if (td_status == NULL) - { - free_ohci_TD(td_setup); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - - /* Check if there's any transfer pending on this endpoint... */ - if (udev->ep0.hw_pipe == NULL) - { - ed = alloc_ohci_ED(); - if (ed == NULL) - { - free_ohci_TD(td_setup); - free_ohci_TD(td_status); - if (utr->data_len > 0) - free_ohci_TD(td_data); - return USBH_ERR_MEMORY_OUT; - } - } - else - ed = (ED_T *)udev->ep0.hw_pipe; - - /*------------------------------------------------------------------------------------*/ - /* prepare SETUP stage TD */ - /*------------------------------------------------------------------------------------*/ - info = TD_CC | TD_T_DATA0 | TD_TYPE_CTRL; - write_td(td_setup, info, (uint8_t *)&utr->setup, 8); - td_setup->ed = ed; - - /*------------------------------------------------------------------------------------*/ - /* prepare DATA stage TD */ - /*------------------------------------------------------------------------------------*/ - if (utr->data_len > 0) - { - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL | TD_CTRL_DATA); - - write_td(td_data, info, utr->buff, utr->data_len); - td_data->ed = ed; - td_setup->NextTD = (uint32_t)td_data; - td_setup->next = td_data; - td_data->NextTD = (uint32_t)td_status; - td_data->next = td_status; - } - else - { - td_setup->NextTD = (uint32_t)td_status; - td_setup->next = td_status; - } - - /*------------------------------------------------------------------------------------*/ - /* prepare STATUS stage TD */ - /*------------------------------------------------------------------------------------*/ - ed->Info = ed_make_info(udev, NULL); - if ((utr->setup.bmRequestType & 0x80) == REQ_TYPE_OUT) - info = (TD_CC | TD_DP_IN | TD_T_DATA1 | TD_TYPE_CTRL); - else - info = (TD_CC | TD_DP_OUT | TD_T_DATA1 | TD_TYPE_CTRL); - - write_td(td_status, info, NULL, 0); - td_status->ed = ed; - td_status->NextTD = 0; - td_status->next = 0; - - /*------------------------------------------------------------------------------------*/ - /* prepare ED */ - /*------------------------------------------------------------------------------------*/ - ed->TailP = 0; - ed->HeadP = (uint32_t)td_setup; - ed->Info = ed_make_info(udev, NULL); - ed->NextED = 0; - - //TD_debug("TD SETUP [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_setup, td_setup->Info, td_setup->CBP, td_setup->BE, td_setup->NextTD); - //if (td_data) - // TD_debug("TD DATA [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_data, td_data->Info, td_data->CBP, td_data->BE, td_data->NextTD); - //TD_debug("TD STATUS [0x%x]: 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td_status, td_status->Info, td_status->CBP, td_status->BE, td_status->NextTD); - ED_debug("Xfer ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - if (utr->data_len > 0) - utr->td_cnt = 3; - else - utr->td_cnt = 2; - - utr->ep = &udev->ep0; /* driver can find EP from UTR */ - udev->ep0.hw_pipe = (void *)ed; /* driver can find ED from EP */ - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - _ohci->HcControlHeadED = (uint32_t)ed; /* Link ED to OHCI */ - _ohci->HcControl |= USBH_HcControl_CLE_Msk; /* enable control list */ - ENABLE_OHCI_IRQ(); - _ohci->HcCommandStatus = USBH_HcCommandStatus_CLF_Msk; /* start Control list */ - - return 0; -} - -static int ohci_bulk_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed; - TD_T *td, *td_p, *td_list = NULL; - uint32_t info; - uint32_t data_len, xfer_len; - int8_t bIsNewED = 0; - uint8_t *buff; - - /*------------------------------------------------------------------------------------*/ - /* Check if there's uncompleted transfer on this endpoint... */ - /* Prepare ED */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - - /* Check if there's any transfer pending on this endpoint... */ - ed = (ED_T *)_ohci->HcBulkHeadED; /* get the head of bulk endpoint list */ - while (ed != NULL) - { - if (ed->Info == info) /* have transfer of this EP not completed? */ - { - if ((ed->HeadP & 0xFFFFFFF0) != (ed->TailP & 0xFFFFFFF0)) - return USBH_ERR_OHCI_EP_BUSY; /* endpoint is busy */ - else - break; /* ED already there... */ - } - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ED_debug("Link BULK ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - } - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - utr->td_cnt = 0; - data_len = utr->data_len; - buff = utr->buff; - - do - { - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_BULK); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_BULK); - - info &= ~(1 << 25); /* Data toggle from ED toggleCarry bit */ - - if (data_len > 4096) /* maximum transfer length is 4K for each TD */ - xfer_len = 4096; - else - xfer_len = data_len; /* remaining data length < 4K */ - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - write_td(td, info, buff, xfer_len); - td->ed = ed; - - utr->td_cnt++; /* increase TD count, for recalim counter */ - - buff += xfer_len; /* advanced buffer pointer */ - data_len -= xfer_len; - - /* chain to end of TD list */ - if (td_list == NULL) - { - td_list = td; - } - else - { - td_p = td_list; - while (td_p->NextTD != 0) - td_p = (TD_T *)td_p->NextTD; - td_p->NextTD = (uint32_t)td; - } - - } - while (data_len > 0); - - /*------------------------------------------------------------------------------------*/ - /* Start transfer */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - if (bIsNewED) - { - ed->HeadP = (uint32_t)td_list; - /* Link ED to OHCI Bulk List */ - ed->NextED = _ohci->HcBulkHeadED; - _ohci->HcBulkHeadED = (uint32_t)ed; - } - ENABLE_OHCI_IRQ(); - _ohci->HcControl |= USBH_HcControl_BLE_Msk; /* enable bulk list */ - _ohci->HcCommandStatus = USBH_HcCommandStatus_BLF_Msk; /* start bulk list */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static int ohci_int_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_new; - uint32_t info; - int8_t bIsNewED = 0; - - if (utr->data_len > 64) /* USB 1.1 interrupt transfer maximum packet size is 64 */ - return USBH_ERR_INVALID_PARAM; - - td_new = alloc_ohci_TD(utr); /* allocate a TD for dummy TD */ - if (td_new == NULL) - return USBH_ERR_MEMORY_OUT; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - - td = alloc_ohci_TD(NULL); /* allocate the initial dummy TD for ED */ - if (td == NULL) - { - free_ohci_ED(ed); - free_ohci_TD(td_new); - return USBH_ERR_MEMORY_OUT; - } - ed->HeadP = (uint32_t)td; /* Let both HeadP and TailP point to dummy TD */ - ed->TailP = ed->HeadP; - } - else - { - td = (TD_T *)(ed->TailP & ~0xf); /* TailP always point to the dummy TD */ - } - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TD */ - /*------------------------------------------------------------------------------------*/ - if ((ep->bEndpointAddress & EP_ADDR_DIR_MASK) == EP_ADDR_DIR_OUT) - info = (TD_CC | TD_R | TD_DP_OUT | TD_TYPE_INT); - else - info = (TD_CC | TD_R | TD_DP_IN | TD_TYPE_INT); - - /* Keep data toggle */ - info = (info & ~(1 << 25)) | (td->Info & (1 << 25)); - - /* fill this TD */ - write_td(td, info, utr->buff, utr->data_len); - td->ed = ed; - td->NextTD = (uint32_t)td_new; - td->utr = utr; - utr->td_cnt = 1; /* increase TD count, for recalim counter */ - utr->status = 0; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - DISABLE_OHCI_IRQ(); - - ed->TailP = (uint32_t)td_new; - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - - //printf("Link INT ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - - _ohci->HcControl |= USBH_HcControl_PLE_Msk; /* periodic list enable */ - return 0; -} - -static int ohci_iso_xfer(UTR_T *utr) -{ - UDEV_T *udev = utr->udev; - EP_INFO_T *ep = utr->ep; - ED_T *ed, *ied; - TD_T *td, *td_list, *last_td; - int i; - uint32_t info; - uint32_t buff_addr; - int8_t bIsNewED = 0; - - ied = get_int_tree_head_node(ep->bInterval); /* get head node of this interval */ - - /*------------------------------------------------------------------------------------*/ - /* Find if this ED was already in the list */ - /*------------------------------------------------------------------------------------*/ - info = ed_make_info(udev, ep); - ed = ied; - while (ed != NULL) - { - if (ed->Info == info) - break; /* Endpoint found */ - ed = (ED_T *)ed->NextED; - } - - if (ed == NULL) /* ED not found, create it */ - { - bIsNewED = 1; - ed = alloc_ohci_ED(); /* allocate an Endpoint Descriptor */ - if (ed == NULL) - return USBH_ERR_MEMORY_OUT; - ed->Info = info; - ed->HeadP = 0; - ed->bInterval = ep->bInterval; - } - else - - ep->hw_pipe = (void *)ed; - - /*------------------------------------------------------------------------------------*/ - /* Prepare TDs */ - /*------------------------------------------------------------------------------------*/ - if (utr->bIsoNewSched) /* Is the starting of isochronous streaming? */ - ed->next_sf = _hcca->frame_no + OHCI_ISO_DELAY; - - utr->td_cnt = 0; - utr->iso_sf = ed->next_sf; - - last_td = NULL; - td_list = NULL; - - for (i = 0; i < IF_PER_UTR; i++) - { - utr->iso_status[i] = USBH_ERR_NOT_ACCESS1; - - td = alloc_ohci_TD(utr); /* allocate a TD */ - if (td == NULL) - goto mem_out; - /* fill this TD */ - buff_addr = (uint32_t)(utr->iso_buff[i]); - td->Info = (TD_CC | TD_TYPE_ISO) | ed->next_sf; - ed->next_sf += get_ohci_interval(ed->bInterval); - td->CBP = buff_addr & ~0xFFF; - td->BE = buff_addr + utr->iso_xlen[i] - 1; - td->PSW[0] = 0xE000 | (buff_addr & 0xFFF); - - td->ed = ed; - utr->td_cnt++; /* increase TD count, for recalim counter */ - - /* chain to end of TD list */ - if (td_list == NULL) - td_list = td; - else - last_td->NextTD = (uint32_t)td; - - last_td = td; - }; - - /*------------------------------------------------------------------------------------*/ - /* Hook ED and TD list to HCCA interrupt table */ - /*------------------------------------------------------------------------------------*/ - utr->status = 0; - DISABLE_OHCI_IRQ(); - - if ((ed->HeadP & ~0x3) == 0) - ed->HeadP = (ed->HeadP & 0x2) | (uint32_t)td_list; /* keep toggleCarry bit */ - else - { - /* find the tail of TDs under this ED */ - td = (TD_T *)(ed->HeadP & ~0x3); - while (td->NextTD != 0) - { - td = (TD_T *)td->NextTD; - } - td->NextTD = (uint32_t)td_list; - } - - if (bIsNewED) - { - /* Add to list of the same interval */ - ed->NextED = ied->NextED; - ied->NextED = (uint32_t)ed; - } - - ENABLE_OHCI_IRQ(); - ED_debug("Link ISO ED 0x%x: 0x%x 0x%x 0x%x 0x%x\n", (int)ed, ed->Info, ed->TailP, ed->HeadP, ed->NextED); - _ohci->HcControl |= USBH_HcControl_PLE_Msk | USBH_HcControl_IE_Msk; /* enable periodic list and isochronous transfer */ - - return 0; - -mem_out: - while (td_list != NULL) - { - td = td_list; - td_list = (TD_T *)td_list->NextTD; - free_ohci_TD(td); - } - free_ohci_ED(ed); - return USBH_ERR_MEMORY_OUT; -} - -static UDEV_T *ohci_find_device_by_port(int port) -{ - UDEV_T *udev; - - udev = g_udev_list; - while (udev != NULL) - { - if ((udev->parent == NULL) && (udev->port_num == port) && - ((udev->speed == SPEED_LOW) || (udev->speed == SPEED_FULL))) - return udev; - udev = udev->next; - } - return NULL; -} - -static int ohci_rh_port_reset(int port) -{ - int retry; - int reset_time; - uint32_t t0; - - reset_time = usbh_tick_from_millisecond(PORT_RESET_TIME_MS); - - for (retry = 0; retry < PORT_RESET_RETRY; retry++) - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_PRS_Msk; - - t0 = usbh_get_ticks(); - while (usbh_get_ticks() - t0 < (reset_time) + 1) - { - /* - * If device is disconnected or port enabled, we can stop port reset. - */ - if (((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) || - ((_ohci->HcRhPortStatus[port] & (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk)) == (USBH_HcRhPortStatus_PES_Msk | USBH_HcRhPortStatus_CCS_Msk))) - goto port_reset_done; - } - reset_time += PORT_RESET_RETRY_INC_MS; - } - - USB_debug("OHCI port %d - port reset failed!\n", port + 1); - return USBH_ERR_PORT_RESET; - -port_reset_done: - if ((_ohci->HcRhPortStatus[port] & USBH_HcRhPortStatus_CCS_Msk) == 0) /* check again if device disconnected */ - { - _ohci->HcRhPortStatus[port] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - return USBH_ERR_DISCONNECTED; - } - return USBH_OK; /* port reset success */ -} - -static int ohci_rh_polling(void) -{ - int i, change = 0; - UDEV_T *udev; - int ret; - - for (i = 0; i < OHCI_PORT_CNT; i++) - { - /* clear unwanted port change status */ - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_OCIC_Msk | USBH_HcRhPortStatus_PRSC_Msk | - USBH_HcRhPortStatus_PSSC_Msk | USBH_HcRhPortStatus_PESC_Msk; - - if ((_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CSC_Msk) == 0) - continue; - rt_kprintf("OHCI port%d status change: 0x%x\n", i + 1, _ohci->HcRhPortStatus[i]); - - /*--------------------------------------------------------------------------------*/ - /* connect status change */ - /*--------------------------------------------------------------------------------*/ - - _ohci->HcRhPortStatus[i] = USBH_HcRhPortStatus_CSC_Msk; /* clear CSC */ - - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_CCS_Msk) - { - /*----------------------------------------------------------------------------*/ - /* First of all, check if there's any previously connected device. */ - /*----------------------------------------------------------------------------*/ - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - - rt_kprintf("OHCI connect device.\n"); - - if (ohci_rh_port_reset(i) != USBH_OK) - continue; - - /* - * Port reset success... - */ - udev = alloc_device(); - if (udev == NULL) - continue; - - udev->parent = NULL; - udev->port_num = i + 1; - if (_ohci->HcRhPortStatus[i] & USBH_HcRhPortStatus_LSDA_Msk) - udev->speed = SPEED_LOW; - else - udev->speed = SPEED_FULL; - udev->hc_driver = &ohci_driver; - - ret = usbh_connect_device(udev); - if (ret < 0) - { - USB_error("connect_device error! [%d]\n", ret); - free_device(udev); - } - - change = 1; - } - else - { - /* - * Device disconnected - */ - rt_kprintf("OHCI disconnect device.\n"); - while (1) - { - udev = ohci_find_device_by_port(i + 1); - if (udev == NULL) - break; - usbh_disconnect_device(udev); - } - change = 1; - } - } - return change; -} - -void td_done(TD_T *td) -{ - UTR_T *utr = td->utr; - uint32_t info; - int cc; - - info = td->Info; - - TD_debug("td_done: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", (int)td, td->Info, td->CBP, td->NextTD, td->BE); - - /* ISO ... drivers see per-TD length/status */ - if ((info & TD_TYPE_Msk) == TD_TYPE_ISO) - { - uint16_t sf; - int idx; - - sf = info & 0xFFFF; - idx = ((sf + 0x10000 - utr->iso_sf) & 0xFFFF) / get_ohci_interval(td->ed->bInterval); - if (idx >= IF_PER_UTR) - { - USB_error("ISO invalid index!! %d, %d\n", sf, utr->iso_sf); - goto td_out; - } - - cc = (td->PSW[0] >> 12) & 0xF; - if (cc == 0xF) /* this frame was not transferred */ - { - USB_debug("ISO F %d N/A!\n", sf); - utr->iso_status[idx] = USBH_ERR_SCH_OVERRUN; - goto td_out; - } - if ((cc != 0) && (cc != CC_DATA_UNDERRUN)) - { - utr->iso_status[idx] = USBH_ERR_CC_NO_ERR - cc; - goto td_out; - } - utr->iso_status[idx] = 0; - utr->iso_xlen[idx] = td->PSW[0] & 0x7FF; - } - else - { - cc = TD_CC_GET(info); - - /* short packet is fine */ - if ((cc != CC_NOERROR) && (cc != CC_DATA_UNDERRUN)) - { - USB_error("TD error, CC = 0x%x\n", cc); - if (cc == CC_STALL) - utr->status = USBH_ERR_STALL; - else - utr->status = USBH_ERR_TRANSFER; - } - - switch (info & TD_TYPE_Msk) - { - case TD_TYPE_CTRL: - if (info & TD_CTRL_DATA) - { - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - } - break; - - case TD_TYPE_BULK: - case TD_TYPE_INT: - if (td->CBP == 0) - utr->xfer_len += td->BE - td->buff_start + 1; - else - utr->xfer_len += td->CBP - td->buff_start; - break; - } - } - -td_out: - - utr->td_cnt--; - - /* If all TDs are done, call-back to requester. */ - if (utr->td_cnt == 0) - { - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } -} - -/* in IRQ context */ -static void remove_ed() -{ - ED_T *ed, *ed_p, *ied; - TD_T *td, *td_next; - UTR_T *utr; - int found; - - while (ed_remove_list != NULL) - { - ED_debug("Remove ED: 0x%x, %d\n", (int)ed_remove_list, ed_remove_list->bInterval); - ed_p = ed_remove_list; - found = 0; - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Control List if found */ - /*--------------------------------------------------------------------------------*/ - if ((ed_p->Info & ED_EP_ADDR_Msk) == 0) - { - if (_ohci->HcControlHeadED == (uint32_t)ed_p) - { - _ohci->HcControlHeadED = (uint32_t)ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcControlHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove INT or ISO endpoint from HCCA interrupt table */ - /*--------------------------------------------------------------------------------*/ - else if (ed_p->bInterval > 0) - { - ied = get_int_tree_head_node(ed_p->bInterval); - - ed = ied; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - break; - } - ed = (ED_T *)ed->NextED; - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove endpoint from Bulk List if found */ - /*--------------------------------------------------------------------------------*/ - else - { - if (_ohci->HcBulkHeadED == (uint32_t)ed_p) - { - ed = (ED_T *)ed_p; - _ohci->HcBulkHeadED = ed_p->NextED; - found = 1; - } - else - { - ed = (ED_T *)_ohci->HcBulkHeadED; - while (ed != NULL) - { - if (ed->NextED == (uint32_t)ed_p) - { - ed->NextED = ed_p->NextED; - found = 1; - } - ed = (ED_T *)ed->NextED; - } - } - } - - /*--------------------------------------------------------------------------------*/ - /* Remove and free all TDs under this endpoint */ - /*--------------------------------------------------------------------------------*/ - if (found) - { - td = (TD_T *)(ed_p->HeadP & ~0x3); - if (td != NULL) - { - while (td != NULL) - { - utr = td->utr; - td_next = (TD_T *)td->NextTD; - free_ohci_TD(td); - td = td_next; - - utr->td_cnt--; - if (utr->td_cnt == 0) - { - utr->status = USBH_ERR_ABORT; - utr->bIsTransferDone = 1; - if (utr->func) - utr->func(utr); - } - } - } - } - - /* - * Done. Remove this ED from [ed_remove_list] and free it. - */ - ed_remove_list = ed_p->next; - free_ohci_ED(ed_p); - } -} - - -//static irqreturn_t ohci_irq (struct usb_hcd *hcd) -//void OHCI_IRQHandler(void) -void nu_ohci_isr(int vector, void *param) -{ - TD_T *td, *td_prev, *td_next; - uint32_t int_sts; - - //if ( nu_sys_usb0_role() != USB0_ID_HOST ) return; - - int_sts = _ohci->HcInterruptStatus; - - //USB_debug("ohci int_sts = 0x%x\n", int_sts); - - if ((_ohci->HcInterruptEnable & USBH_HcInterruptEnable_SF_Msk) && - (int_sts & USBH_HcInterruptStatus_SF_Msk)) - { - int_sts &= ~USBH_HcInterruptStatus_SF_Msk; - - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_SF_Msk; - remove_ed(); - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_SF_Msk; - } - - if (int_sts & USBH_HcInterruptStatus_WDH_Msk) - { - int_sts &= ~USBH_HcInterruptStatus_WDH_Msk; - /* - * reverse done list - */ - td = (TD_T *)(_hcca->done_head & TD_ADDR_MASK); - _hcca->done_head = 0; - td_prev = NULL; - _ohci->HcInterruptStatus = USBH_HcInterruptStatus_WDH_Msk; - - while (td != NULL) - { - //TD_debug("Done list TD 0x%x => 0x%x\n", (int)td, (int)td->NextTD); - td_next = (TD_T *)(td->NextTD & TD_ADDR_MASK); - td->NextTD = (uint32_t)td_prev; - td_prev = td; - td = td_next; - } - td = td_prev; /* first TD of the reversed done list */ - - /* - * reclaim TDs - */ - while (td != NULL) - { - TD_debug("Reclaim TD 0x%x, next 0x%x\n", (int)td, td->NextTD); - td_next = (TD_T *)td->NextTD; - td_done(td); - free_ohci_TD(td); - td = td_next; - } - } - - if (int_sts & USBH_HcInterruptStatus_RHSC_Msk) - { - _ohci->HcInterruptDisable = USBH_HcInterruptDisable_RHSC_Msk; - } - - _ohci->HcInterruptStatus = int_sts; -} - -#ifdef ENABLE_DEBUG_MSG - -void dump_ohci_int_table() -{ - int i; - ED_T *ed; - - for (i = 0; i < 32; i++) -// for (i = 0; i < 1; i++) - - { - USB_debug("%02d: ", i); - - ed = (ED_T *)_hcca->int_table[i]; - - while (ed != NULL) - { - USB_debug("0x%x (0x%x) => ", (int)ed, ed->HeadP); - ed = (ED_T *)ed->NextED; - } - rt_kprintf("0\n"); - } -} - -void dump_ohci_regs() -{ - USB_debug("Dump OCHI registers:\n"); - USB_debug(" HcRevision = 0x%x\n", _ohci->HcRevision); - USB_debug(" HcControl = 0x%x\n", _ohci->HcControl); - USB_debug(" HcCommandStatus = 0x%x\n", _ohci->HcCommandStatus); - USB_debug(" HcInterruptStatus = 0x%x\n", _ohci->HcInterruptStatus); - USB_debug(" HcInterruptEnable = 0x%x\n", _ohci->HcInterruptEnable); - USB_debug(" HcInterruptDisable = 0x%x\n", _ohci->HcInterruptDisable); - USB_debug(" HcHCCA = 0x%x\n", _ohci->HcHCCA); - USB_debug(" HcPeriodCurrentED = 0x%x\n", _ohci->HcPeriodCurrentED); - USB_debug(" HcControlHeadED = 0x%x\n", _ohci->HcControlHeadED); - USB_debug(" HcControlCurrentED = 0x%x\n", _ohci->HcControlCurrentED); - USB_debug(" HcBulkHeadED = 0x%x\n", _ohci->HcBulkHeadED); - USB_debug(" HcBulkCurrentED = 0x%x\n", _ohci->HcBulkCurrentED); - USB_debug(" HcDoneHead = 0x%x\n", _ohci->HcDoneHead); - USB_debug(" HcFmInterval = 0x%x\n", _ohci->HcFmInterval); - USB_debug(" HcFmRemaining = 0x%x\n", _ohci->HcFmRemaining); - USB_debug(" HcFmNumber = 0x%x\n", _ohci->HcFmNumber); - USB_debug(" HcPeriodicStart = 0x%x\n", _ohci->HcPeriodicStart); - USB_debug(" HcLSThreshold = 0x%x\n", _ohci->HcLSThreshold); - USB_debug(" HcRhDescriptorA = 0x%x\n", _ohci->HcRhDescriptorA); - USB_debug(" HcRhDescriptorB = 0x%x\n", _ohci->HcRhDescriptorB); - USB_debug(" HcRhStatus = 0x%x\n", _ohci->HcRhStatus); - USB_debug(" HcRhPortStatus0 = 0x%x\n", _ohci->HcRhPortStatus[0]); - USB_debug(" HcRhPortStatus1 = 0x%x\n", _ohci->HcRhPortStatus[1]); - USB_debug(" HcPhyControl = 0x%x\n", _ohci->HcPhyControl); - USB_debug(" HcMiscControl = 0x%x\n", _ohci->HcMiscControl); -} - -void dump_ohci_ports() -{ - USB_debug("_ohci port0=0x%x, port1=0x%x\n", _ohci->HcRhPortStatus[0], _ohci->HcRhPortStatus[1]); -} - -#endif // ENABLE_DEBUG_MSG - -HC_DRV_T ohci_driver = -{ - ohci_init, /* init */ - ohci_shutdown, /* shutdown */ - ohci_suspend, /* suspend */ - ohci_resume, /* resume */ - ohci_ctrl_xfer, /* ctrl_xfer */ - ohci_bulk_xfer, /* bulk_xfer */ - ohci_int_xfer, /* int_xfer */ - ohci_iso_xfer, /* iso_xfer */ - ohci_quit_xfer, /* quit_xfer */ - ohci_rh_port_reset, /* rthub_port_reset */ - ohci_rh_polling /* rthub_polling */ -}; - -/// @endcond HIDDEN_SYMBOLS - -/*** (C) COPYRIGHT 2017 Nuvoton Technology Corp. ***/ diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/support.c b/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/support.c deleted file mode 100644 index 7338f41ab71..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/support.c +++ /dev/null @@ -1,274 +0,0 @@ -/**************************************************************************//** - * @file support.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief Functions to support USB host driver. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" - -/// @cond HIDDEN_SYMBOLS - - -#define USB_MEMORY_POOL_SIZE (32*1024) -#define USB_MEM_BLOCK_SIZE 128 - -#define BOUNDARY_WORD 4 - - -static uint32_t _FreeMemorySize; -uint32_t _AllocatedMemorySize; - - -#define USB_MEM_ALLOC_MAGIC 0x19685788 /* magic number in leading block */ - -typedef struct USB_mhdr -{ - uint32_t flag; /* 0:free, 1:allocated, 0x3:first block */ - uint32_t bcnt; /* if allocated, the block count of allocated memory block */ - uint32_t magic; - uint32_t reserved; -} USB_MHDR_T; - -uint8_t _USBMemoryPool[USB_MEMORY_POOL_SIZE] __attribute__((aligned(USB_MEM_BLOCK_SIZE))); - - -static USB_MHDR_T *_pCurrent; -uint32_t *_USB_pCurrent = (uint32_t *) &_pCurrent; - -static uint32_t _MemoryPoolBase, _MemoryPoolEnd; - - -void USB_InitializeMemoryPool() -{ - _MemoryPoolBase = (uint32_t)&_USBMemoryPool[0] | NON_CACHE_MASK; - _MemoryPoolEnd = _MemoryPoolBase + USB_MEMORY_POOL_SIZE; - _FreeMemorySize = _MemoryPoolEnd - _MemoryPoolBase; - _AllocatedMemorySize = 0; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; - memset((char *)_MemoryPoolBase, 0, _FreeMemorySize); -} - - -int USB_available_memory() -{ - return _FreeMemorySize; -} - - -int USB_allocated_memory() -{ - return _AllocatedMemorySize; -} - - -void *USB_malloc(int wanted_size, int boundary) -{ - USB_MHDR_T *pPrimitivePos = _pCurrent; - USB_MHDR_T *pFound; - int found_size = -1; - int i, block_count; - int wrap = 0; - void *pvBuf = NULL; - rt_base_t level; - - level = rt_hw_interrupt_disable(); - - if (wanted_size >= _FreeMemorySize) - { - rt_kprintf("USB_malloc - want=%d, free=%d\n", wanted_size, _FreeMemorySize); - goto exit_USB_malloc; - } - - - if ((uint32_t)_pCurrent >= _MemoryPoolEnd) - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - - do - { - if (_pCurrent->flag) /* is not a free block */ - { - if (_pCurrent->magic != USB_MEM_ALLOC_MAGIC) - { - rt_kprintf("\nUSB_malloc - incorrect magic number! C:%x F:%x, wanted:%d, Base:0x%x, End:0x%x\n", (uint32_t)_pCurrent, _FreeMemorySize, wanted_size, (uint32_t)_MemoryPoolBase, (uint32_t)_MemoryPoolEnd); - goto exit_USB_malloc; - } - - if (_pCurrent->flag == 0x3) - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + _pCurrent->bcnt * USB_MEM_BLOCK_SIZE); - else - { - rt_kprintf("USB_malloc warning - not the first block!\n"); - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - } - - if ((uint32_t)_pCurrent > _MemoryPoolEnd) - rt_kprintf("USB_malloc - behind limit!!\n"); - - if ((uint32_t)_pCurrent == _MemoryPoolEnd) - { - //rt_kprintf("USB_alloc - warp!!\n"); - wrap = 1; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - } - - found_size = -1; /* reset the accumlator */ - } - else /* is a free block */ - { - if (found_size == -1) /* the leading block */ - { - pFound = _pCurrent; - block_count = 1; - - if (boundary > BOUNDARY_WORD) - found_size = 0; /* not use the data area of the leading block */ - else - found_size = USB_MEM_BLOCK_SIZE - sizeof(USB_MHDR_T); - - /* check boundary - - * If boundary > BOUNDARY_WORD, the start of next block should - * be the beginning address of allocated memory. Thus, we check - * the boundary of the next block. The leading block will be - * used as a header only. - */ - if ((boundary > BOUNDARY_WORD) && - ((((uint32_t)_pCurrent) + USB_MEM_BLOCK_SIZE >= _MemoryPoolEnd) || - ((((uint32_t)_pCurrent) + USB_MEM_BLOCK_SIZE) % boundary != 0))) - found_size = -1; /* violate boundary, reset the accumlator */ - } - else /* not the leading block */ - { - found_size += USB_MEM_BLOCK_SIZE; - block_count++; - } - - if (found_size >= wanted_size) - { - pFound->bcnt = block_count; - pFound->magic = USB_MEM_ALLOC_MAGIC; - _FreeMemorySize -= block_count * USB_MEM_BLOCK_SIZE; - _AllocatedMemorySize += block_count * USB_MEM_BLOCK_SIZE; - _pCurrent = pFound; - for (i = 0; i < block_count; i++) - { - _pCurrent->flag = 1; /* allocate block */ - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - } - pFound->flag = 0x3; - - if (boundary > BOUNDARY_WORD) - { - pvBuf = (void *)((uint32_t)pFound + USB_MEM_BLOCK_SIZE); - goto exit_USB_malloc; - } - else - { - //USB_debug("USB_malloc(%d,%d):%x\tsize:%d, C:0x%x, %d\n", wanted_size, boundary, (uint32_t)pFound + sizeof(USB_MHDR_T), block_count * USB_MEM_BLOCK_SIZE, _pCurrent, block_count); - pvBuf = (void *)((uint32_t)pFound + sizeof(USB_MHDR_T)); - goto exit_USB_malloc; - } - } - - /* advance to the next block */ - _pCurrent = (USB_MHDR_T *)((uint32_t)_pCurrent + USB_MEM_BLOCK_SIZE); - if ((uint32_t)_pCurrent >= _MemoryPoolEnd) - { - wrap = 1; - _pCurrent = (USB_MHDR_T *)_MemoryPoolBase; /* wrapped */ - found_size = -1; /* reset accumlator */ - } - } - } - while ((wrap == 0) || (_pCurrent < pPrimitivePos)); - - rt_kprintf("USB_malloc - No free memory!\n"); - -exit_USB_malloc: - - rt_hw_interrupt_enable(level); - - return pvBuf; -} - - -void USB_free(void *alloc_addr) -{ - USB_MHDR_T *pMblk; - uint32_t addr = (uint32_t)alloc_addr; - int i, count; - rt_base_t level; - - //rt_kprintf("USB_free: 0x%x\n", (int)alloc_addr); - - level = rt_hw_interrupt_disable(); - - if ((addr < _MemoryPoolBase) || (addr >= _MemoryPoolEnd)) - { - if (addr) - { - rt_kprintf("[%s]Wrong!!\n", __func__); - } - goto Exit_USB_free; - } - - //rt_kprintf("USB_free:%x\n", (int32_t)addr+USB_MEM_BLOCK_SIZE); - - /* get the leading block address */ - if (addr % USB_MEM_BLOCK_SIZE == 0) - addr -= USB_MEM_BLOCK_SIZE; - else - addr -= sizeof(USB_MHDR_T); - - if (addr % USB_MEM_BLOCK_SIZE != 0) - { - rt_kprintf("USB_free fatal error on address: %x!!\n", (uint32_t)alloc_addr); - goto Exit_USB_free; - } - - pMblk = (USB_MHDR_T *)addr; - if (pMblk->flag == 0) - { - rt_kprintf("USB_free(), warning - try to free a free block: %x\n", (uint32_t)alloc_addr); - goto Exit_USB_free; - } - if (pMblk->magic != USB_MEM_ALLOC_MAGIC) - { - rt_kprintf("USB_free(), warning - try to free an unknow block at address:%x.\n", addr); - goto Exit_USB_free; - } - - //_pCurrent = pMblk; - - //rt_kprintf("+ 0x%x, %d\n", (int)pMblk, pMblk->bcnt); - - count = pMblk->bcnt; - for (i = 0; i < count; i++) - { - pMblk->flag = 0; /* release block */ - pMblk = (USB_MHDR_T *)((uint32_t)pMblk + USB_MEM_BLOCK_SIZE); - } - - _FreeMemorySize += count * USB_MEM_BLOCK_SIZE; - _AllocatedMemorySize -= count * USB_MEM_BLOCK_SIZE; - - -Exit_USB_free: - - rt_hw_interrupt_enable(level); - - return; -} - - -/// @endcond HIDDEN_SYMBOLS - diff --git a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/usb_core.c b/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/usb_core.c deleted file mode 100644 index 7bb6c30bbeb..00000000000 --- a/bsp/nuvoton/libraries/nuc980/UsbHostLib/src/usb_core.c +++ /dev/null @@ -1,312 +0,0 @@ -/**************************************************************************//** - * @file usb_core.c - * @version V1.10 - * $Revision: 11 $ - * $Date: 14/10/03 1:54p $ - * @brief USB Host library core. - * - * @note - * SPDX-License-Identifier: Apache-2.0 - * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved. -*****************************************************************************/ - -#include -#include -#include - -#include "usb.h" -#include "hub.h" - - -/// @cond HIDDEN_SYMBOLS - -USBH_T *_ohci; -HSUSBH_T *_ehci; - -static UDEV_DRV_T *_drivers[MAX_UDEV_DRIVER]; - -static CONN_FUNC *g_conn_func, *g_disconn_func; - - -//extern void EHCI_IRQHandler(void); -//extern void OHCI_IRQHandler(void); -extern void nu_ohci_isr(int vector, void *param); -extern void nu_ehci_isr(int vector, void *param); - - -/// @endcond HIDDEN_SYMBOLS - - -/** - * @brief Initialize NUC980 USB Host controller and USB stack. - * - * @return None. - */ -void usbh_core_init() -{ - DISABLE_EHCI_IRQ(); - DISABLE_OHCI_IRQ(); - - _ohci = USBH; - _ehci = HSUSBH; - - memset(_drivers, 0, sizeof(_drivers)); - - g_conn_func = NULL; - g_disconn_func = NULL; - -// usbh_hub_init(); - - _ehci->USBPCR0 = 0x160; /* enable PHY 0 */ - _ehci->USBPCR1 = 0x520; /* enable PHY 1 */ - usbh_memory_init(); - - //_ohci->HcMiscControl |= USBH_HcMiscControl_OCAL_Msk; /* Over-current active low */ - _ohci->HcMiscControl &= ~USBH_HcMiscControl_OCAL_Msk; /* Over-current active high */ - -#ifdef ENABLE_OHCI - //sysInstallISR(IRQ_LEVEL_1, IRQ_OHCI, (PVOID)OHCI_IRQHandler); - rt_hw_interrupt_install(IRQ_OHCI, nu_ohci_isr, NULL, "ohci"); - rt_hw_interrupt_set_priority(IRQ_OHCI, IRQ_LEVEL_1); - - ohci_driver.init(); - ENABLE_OHCI_IRQ(); -#endif - -#ifdef ENABLE_EHCI - //sysInstallISR(IRQ_LEVEL_1, IRQ_EHCI, (PVOID)EHCI_IRQHandler); - rt_hw_interrupt_install(IRQ_EHCI, nu_ehci_isr, NULL, "ehci"); - rt_hw_interrupt_set_priority(IRQ_EHCI, IRQ_LEVEL_1); - - ehci_driver.init(); - ENABLE_EHCI_IRQ(); -#endif -} - - -/** - * @brief Let USB stack polls all root hubs. If there's any hub port - * change found, USB stack will manage the hub events in this function call. - * In this function, USB stack enumerates newly connected devices and remove staff - * of disconnected devices. User's application should periodically invoke this - * function. - * @return There's hub port change or not. - * @retval 0 No any hub port status changes found. - * @retval 1 There's hub port status changes. - */ -int usbh_polling_root_hubs(void) -{ - int ret, change = 0; - -#ifdef ENABLE_EHCI - do - { - ret = ehci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); - - // scan_isochronous_list(); - -#endif - -#ifdef ENABLE_OHCI - do - { - ret = ohci_driver.rthub_polling(); - if (ret) - change = 1; - } - while (ret == 1); -#endif - - return change; -} - -/** - * @brief Force to quit an endpoint transfer. - * @param[in] udev The USB device. - * @param[in] ep The endpoint to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_xfer(UDEV_T *udev, EP_INFO_T *ep) -{ - return udev->hc_driver->quit_xfer(NULL, ep); -} - - -int usbh_connect_device(UDEV_T *udev) -{ - usbh_delay_ms(100); /* initially, give 100 ms delay */ - - if (g_conn_func) - g_conn_func(udev, 0); - - return 0; -} - - -void usbh_disconnect_device(UDEV_T *udev) -{ - USB_debug("disconnect device...\n"); - - if (g_disconn_func) - g_disconn_func(udev, 0); - - -#if 1 //CHECK: Maybe create a new API to quit_xfer and free udev for application - usbh_quit_xfer(udev, &(udev->ep0)); /* Quit control transfer if hw_pipe is not NULL. */ - - /* remove device from global device list */ -// free_dev_address(udev->dev_num); - free_device(udev); - -// usbh_memory_used(); -#endif -} - -/** - * @brief Install device connect and disconnect callback function. - * - * @param[in] conn_func Device connect callback function. - * @param[in] disconn_func Device disconnect callback function. - * @return None. - */ -void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func) -{ - g_conn_func = conn_func; - g_disconn_func = disconn_func; -} - -int usbh_reset_port(UDEV_T *udev) -{ - if (udev->parent == NULL) - { - if (udev->hc_driver) - return udev->hc_driver->rthub_port_reset(udev->port_num - 1); - else - return USBH_ERR_NOT_FOUND; - } - else - { - return udev->parent->port_reset(udev->parent, udev->port_num); - } -} - - -/** - * @brief Force to quit an UTR transfer. - * @param[in] utr The UTR transfer to be quit. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_quit_utr(UTR_T *utr) -{ - if (!utr || !utr->udev) - return USBH_ERR_NOT_FOUND; - - return utr->udev->hc_driver->quit_xfer(utr, NULL); -} - - -/** - * @brief Execute an USB request in control transfer. This function returns after the request - * was done or aborted. - * @param[in] udev The target USB device. - * @param[in] bmRequestType Characteristics of request - * @param[in] bRequest Specific request - * @param[in] wValue Word-sized field that varies according to request - * @param[in] wIndex Word-sized field that varies according to request - * @param[in] wLength Number of bytes to transfer if there is a Data stage - * @param[in] buff Data buffer used in data stage - * @param[out] xfer_len Transmitted/received length of data - * @param[in] timeout Time-out limit (in 10ms - timer tick) of this transfer - * @retval 0 Transfer success - * @retval < 0 Transfer failed. Refer to error code definitions. - */ -int usbh_ctrl_xfer(UDEV_T *udev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, - uint16_t wLength, uint8_t *buff, uint32_t *xfer_len, uint32_t timeout) -{ - UTR_T *utr; - uint32_t t0, timeout_tick; - int status; - - *xfer_len = 0; - - //if (check_device(udev)) - // return USBH_ERR_INVALID_PARAM; - - utr = alloc_utr(udev); - if (utr == NULL) - return USBH_ERR_MEMORY_OUT; - - utr->setup.bmRequestType = bmRequestType; - utr->setup.bRequest = bRequest; - utr->setup.wValue = wValue; - utr->setup.wIndex = wIndex; - utr->setup.wLength = wLength; - - utr->buff = buff; - utr->data_len = wLength; - utr->bIsTransferDone = 0; - status = udev->hc_driver->ctrl_xfer(utr); - if (status < 0) - { - udev->ep0.hw_pipe = NULL; - free_utr(utr); - return status; - } - - timeout_tick = usbh_tick_from_millisecond(timeout); - t0 = usbh_get_ticks(); - while (utr->bIsTransferDone == 0) - { - if (usbh_get_ticks() - t0 > timeout_tick) - { - usbh_quit_utr(utr); - free_utr(utr); - udev->ep0.hw_pipe = NULL; - return USBH_ERR_TIMEOUT; - } - } - - status = utr->status; - - if (status == 0) - { - *xfer_len = utr->xfer_len; - } - free_utr(utr); - - return status; -} - -/** - * @brief Execute a bulk transfer request. This function will return immediately after - * issued the bulk transfer. USB stack will later call back utr->func() once the bulk - * transfer was done or aborted. - * @param[in] utr The bulk transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_bulk_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->bulk_xfer(utr); -} - -/** - * @brief Execute an interrupt transfer request. This function will return immediately after - * issued the interrupt transfer. USB stack will later call back utr->func() once the - * interrupt transfer was done or aborted. - * @param[in] utr The interrupt transfer request. - * @retval 0 Transfer success - * @retval < 0 Failed. Refer to error code definitions. - */ -int usbh_int_xfer(UTR_T *utr) -{ - return utr->udev->hc_driver->int_xfer(utr); -} - - diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig b/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig index d5a7f21a812..379c5e84fcf 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig @@ -4,6 +4,7 @@ config SOC_SERIES_NUC980 select SOC_FAMILY_NUMICRO select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN + select PKG_USING_NUVOTON_ARM926_LIB default y config BSP_USE_STDDRIVER_SOURCE diff --git a/bsp/nuvoton/ma35-rtp/.config b/bsp/nuvoton/ma35-rtp/.config index 6aa8226cfba..772a3c8559a 100644 --- a/bsp/nuvoton/ma35-rtp/.config +++ b/bsp/nuvoton/ma35-rtp/.config @@ -601,6 +601,7 @@ CONFIG_UTEST_SMALL_MEM_TC=y # CONFIG_PKG_USING_QMODBUS is not set # CONFIG_PKG_USING_PNET is not set # CONFIG_PKG_USING_OPENER is not set +# CONFIG_PKG_USING_FREEMQTT is not set # end of IoT - internet of things # @@ -830,6 +831,7 @@ CONFIG_UTEST_SMALL_MEM_TC=y # CONFIG_PKG_USING_RMP is not set # CONFIG_PKG_USING_R_RHEALSTONE is not set # CONFIG_PKG_USING_HEARTBEAT is not set +# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set # end of system packages # @@ -953,6 +955,8 @@ CONFIG_UTEST_SMALL_MEM_TC=y # # HC32 DDL Drivers # +# CONFIG_PKG_USING_HC32F4_CMSIS_DRIVER is not set +# CONFIG_PKG_USING_HC32F4_SERIES_DRIVER is not set # end of HC32 DDL Drivers # @@ -966,6 +970,20 @@ CONFIG_UTEST_SMALL_MEM_TC=y # CONFIG_PKG_USING_NXP_IMX6UL_DRIVER is not set # CONFIG_PKG_USING_NXP_IMXRT_DRIVER is not set # end of NXP HAL & SDK Drivers + +# +# NUVOTON Drivers +# +CONFIG_PKG_USING_NUVOTON_CMSIS_DRIVER=y +CONFIG_PKG_NUVOTON_CMSIS_DRIVER_PATH="/packages/peripherals/hal-sdk/nuvoton/nuvoton_cmsis" +CONFIG_PKG_USING_NUVOTON_CMSIS_DRIVER_LATEST_VERSION=y +CONFIG_PKG_NUVOTON_CMSIS_DRIVER_VER="latest" +CONFIG_PKG_USING_NUVOTON_SERIES_DRIVER=y +CONFIG_PKG_NUVOTON_SERIES_DRIVER_PATH="/packages/peripherals/hal-sdk/nuvoton/nuvoton_series" +CONFIG_PKG_USING_NUVOTON_SERIES_DRIVER_LATEST_VERSION=y +CONFIG_PKG_NUVOTON_SERIES_DRIVER_VER="latest" +# CONFIG_PKG_USING_NUVOTON_RAM926_LIB is not set +# end of NUVOTON Drivers # end of HAL & SDK Drivers # diff --git a/bsp/nuvoton/ma35-rtp/SConstruct b/bsp/nuvoton/ma35-rtp/SConstruct index cd14e5b0a76..3cee136a811 100644 --- a/bsp/nuvoton/ma35-rtp/SConstruct +++ b/bsp/nuvoton/ma35-rtp/SConstruct @@ -15,6 +15,25 @@ except: print(RTT_ROOT) exit(-1) +def bsp_pkg_check(): + import subprocess + + check_paths = [ + os.path.join("packages", "nuvoton-cmsis-latest"), + os.path.join("packages", "nuvoton-series-latest") + ] + + need_update = not all(os.path.exists(p) for p in check_paths) + + if need_update: + print("\n===============================================================================") + print("Dependency packages missing, please running 'pkgs --update'...") + print("If no packages are fetched, run 'pkgs --upgrade' first, then 'pkgs --update'...") + print("===============================================================================") + exit(1) + +RegisterPreBuildingAction(bsp_pkg_check) + TARGET = 'rtthread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) diff --git a/bsp/nuvoton/ma35-rtp/rtconfig.h b/bsp/nuvoton/ma35-rtp/rtconfig.h index 5f60301d0f1..6243758c6dc 100644 --- a/bsp/nuvoton/ma35-rtp/rtconfig.h +++ b/bsp/nuvoton/ma35-rtp/rtconfig.h @@ -371,6 +371,14 @@ /* NXP HAL & SDK Drivers */ /* end of NXP HAL & SDK Drivers */ + +/* NUVOTON Drivers */ + +#define PKG_USING_NUVOTON_CMSIS_DRIVER +#define PKG_USING_NUVOTON_CMSIS_DRIVER_LATEST_VERSION +#define PKG_USING_NUVOTON_SERIES_DRIVER +#define PKG_USING_NUVOTON_SERIES_DRIVER_LATEST_VERSION +/* end of NUVOTON Drivers */ /* end of HAL & SDK Drivers */ /* sensors drivers */ diff --git a/bsp/nuvoton/ma35-rtp/rtthread.bin b/bsp/nuvoton/ma35-rtp/rtthread.bin index 71f81136b51f734cf1569f34d448028a9cf01054..4ccc466e7cfda96977b53d369f371b106472cf91 100644 GIT binary patch literal 106648 zcmd?Sdwf*Y)jz!VIcM%eGPwY`K_;05LMFhF0CH1?NpeC68W21pZE9s@BQN? zpEGl2pMBO|d+oK>UTf{OH%InR^3#72atv1!7y4%R?E3z{+sh}T?)9o$^@gAQ-+m9n z{(k-ct^9}Tv9jC$eZS5R{bu!lsQmwrWsDZzbs6l>{RgEt-(8 zDb^G>UX#MhyEHFV0Pa1K5LS|B%2yX9<>M`)E*gt(if`k5W4&*Cd&k}t@ltbF;cLxZPrp`@N1DIuQrpK$LO6AyZMzX|TLZ#>SPAE{ zqg~p{-X=%&(%AkV1q5#h2SVnbpkxuQg}8+OkX9ouLV`gxzO5aUcd86Wshdw9eZESh zzTjP|*0BMa$OmZr(yfUn*t zjul6U6U31LS`hW4C`ru++!Hf?Mm6u&8qKHQC*HPCfj@E8EQg1 zpY8Km1WktG!am0F=v@mnTHIxVp$jt8Jxs9zE_O;k=8O z?{t3}Ak~V7lh>rz-mx`YWYCX!__}0MR1vF_=3+fk_<}P#JOuqFR%*&9J=0G4R}#uS z=2BkzieF|9bE)Otmw7B1Ji|aD>gR7hz2P>DUsuY?xM_EZPkCgBa*M#5{?*gCh!U%Z zG#icx3#-H^(O7KwP%Ew!r=yIG=l9Fghsv3}egB{3NOgcnMoC3M8@)kN37Z2($tuma zqkZ9NNk!Zkv&{jkM0{#e(Yvs7SMP5+D|;7qz0>=fu7VTpcFx2~+0)yfeADD^7k==` zFY!caqCO-2q4$XSPcD)!Gz*qEG4lAK-il7*JxeSfmgF%!1c_Ii_7PIp@kd28WR2ma z?^Rr1)uG@Lnpbxy_*IOS!X8hh%5pT%wR9{=zsvRMAzq}dbk59kkQVcHRgas`$hdIk zkix4-4bQ-5?z9WLdKLs(l*VMk;_ocK{Yx$mQP?mk22v$+Ac-bcA;NgvL8 zxkv#uqg?xZ0&kLdUdW2du?2(`4qKmFFY!V~<6jOXN3HQtRHRq3CaId4Aqj?bdm>9Z&%PZoSsm?c`f zj@cF7_594qoHv`l+HxSDCR6DT10?NN?%290k!Hr$JW@(BtkU!AEt9R%bL*p^S!hKO%42i1fP+YH-(jp5c4F z#gK7X?oVMyzUDj6W5DPi6~si7&$MeY!yL;y2yc~6R;ZkygPPHTZyZ}>74yYJS@O3A zsF9Pt;+CbyG-r!M8d1f15?5+T?{#ejCPeyW1?DvE10G`3YzeE@RzEg*sw;PLri+-u z9VFxDZnQwGQgMaWNz9+Q*GwkT@+#7`q$(eG_f_39`48@g^J8~&((xXWcET0wj4w?y z6KUD{l_@5`=m=L#F^?~5)Ccz~p< zn@t$Wmi91{A!DbPV+MQi-DzJc@34)%6n6J% zU$~&~o~A8;49!KAl0B$%Cd8vm@g+2wQYsBHn(q9XG(WVAlAM<)`Ft%UpDdDgYE(Y8%IDTKGDr&NPT$h!6b`NTFItB6 zMH%bVU~B<sIT+W=F_ibZyW@7|R;$hqF<}8tzxt1$&H{ybEVQfsg zJ}f60r0Z`*~-fL2S_sP(QEyWT=beJP ztUGKi?fP6IeO#_}nhyWg_r=pm=Udt%OW)Xe4r4e2R8~n}1nL{-i8F9#?xATjnyFDK zeK8R31T@N8-c!L~j;bCF?jMz_@cn)D_V|`|Ln(WklaBT?u4Z^BrK~|_fhncu``JkA zMYP#eR$u}aL^=u@u@P1DTYC0C&<^@pLYeph-B_e3A?kdz%)NwT^|?V~hyGt;*ueQx(1 z`(F}wU!f@P^yE&S+dXbSdw<#0x!vmzeCi|0QBpXkb=?8Y@e$9Yjg5~|Ix@&8IXz-- z_p=8QCr!URN;1e#W162dO)S)6mboR5KN(>1$Rx3QND{TqosA6EAG);ne&kyVKGL=% zLc>H=65~{}P;KqHyRuMv2(tPlaA7rJC!p2e1xec6?%4;DO`ipbWtc9{dPZdhZ+y9* zNn%}`{(G1{GRU-0k%y2|!C>&Kd62`ogtX#f^4MC&^#_AYMqetVFAn ziV88=^i^P8&2S$kpazxx7@R48{~^fuk4h(l(K58AAmc+S9Ssh)jjRiM>+f-%wtO*D zhWcF(uGS|yruNMD$6*4yUOuK&S?6wyc z5)->)vN^TweOWVt(z#4xIB8TLx4WY;4?rbpdildAw6= z*+%9}7+#<`cE!M{P5PU~U71Zy#BAgV36^CF!+`{|KPs42t3c`X2$NPNbGu{=qr6KeR*EZZ2TsoNfv-N7wUIKEbJUuMG>RXE;X z5NBoMM$*f=ckEY7=LVBae9>0uq+yR)FnyyayMFb6!gR>nr)Q#nWP;cmNz@*!Xc*6i3o> zT`xo1ci8uz5b6>-xbUeira1)%C)M{bixG1<=C+T!v`apgHIlWKxbuT#9Y?Be@H{^ZX4Udhkxp3@UOYwZsTMr z3;NHWAn8xInY1OtZ?a0S*|o4AtkS>jsS?Ra8Ihvcb=@BQbVu}(r#pC1lS!7q^dPw3 zb9EW`BViAfO8OO${rWv)oY_(^JG;A;S2z-!p?cS@pf(M6^4Uyk3>#0n{~*uTP41+j z7LNG-{&cF?ctKOQWKC34)Ea8u+oGwZ$xPRL3>~DY=A=8o+4U_9``^0Wy>5?sx+Cg; zVDy5A@qN(0=)_NlDEs0~%60|VyFYgQH(hJ(|4r9NdvDS8y#UknjE+j_6l{~Z-FF|H z)AoDViEbC8<=pNE5B?1;1~Z}2x`etot5EarE804t_E6&paM~eQ5)tPkM_^XrP|HGk zxz5eD7#D+3);;53M28+Q?l?$f7(V!@L-PQ>TOk|au+tXJ{0Zb@>H>%DLDy8kY3?9Q&`_!agq$w`~~zRP^8xxd-9SDS^1{j0%!mcDjwV@suabsm|bY!W`V?Mz#(=A7lzgWd*xdwf&ySLAY@;kyJ$*Bp!Z8QuBgPTTR7&UiVj2P8lAIh@ zWDyaOdXY?2&lfII>7RYXN5pOq%JQi6j}xJ|P%v0l#`?(oj1Z3X^=SnH`oOSE5(oXK zWM3zQ<41iYEz2FkGHwXVu`+HK`mZ&`%Xh!+KP6)sdmEPT0n3rMVQKHPd=JY}Qn0Yc zJ)*#DC1#&{7;~+RdAW>v#}MYfIKgPmXgZ8L8y|*$gcPJa<~5$1>3aDDSB$8smre@v zhTZdO2PeEE$3QuLmyc#9cL-cmHj9RayB7t7!m5riJ<7B8;TemQCU@wEo`2`!OHEDF zTMYp^mzXnMwYDC_RbRHHx$0CCTydo_h#ru1MCZhkyic3B;^9^pY&C;D`Sy|n4cbA(ls2oGb}3Jr*aEt_da+>$_grp;Elt`-z)f9P~X%mbn#M

kEaH6gd&OG!yy%JCz; zRdT&?L-mq-g--5&)Qgt*@HuV+Vryxjv)a5kpq?GVfS2+5Q4^@2u{a>ixxJK3yym)v z2{7>eF!aKX)1Vqp7~~|0rwqEjSCA>iX!I8kYk7?8ZLdICy(=oTW>&f)&u%Jxr1zcf zD{)GlEy+WSauq1b=e2Sj z3B!#NX3U5`I!n=V_a@`jgXArV>WLR7i*dzVuewv4od;Si2?+6_r(NfF!i7}KcB*NX!dofi226(M8-=MOT6g5W)JzcT z{p13xji_znj@+K}yAYSD5?04M4f|~T$`4%(gLx~-grlwu@f#0tEDSGR-+<`5@pvik zu%vGkt&+FAFM-A15=0)BbdSpu&&~ZRaI7LGz*(5R^sU`g8WZ4|AEvzzb`OzC%EyVL zpj%ieG55H4!a}w{hdt3(2|s0_E3=eLBvO6(-uS|fN*#;#ElQszE_D4RK;*TBpSaWG z=`2sK6S)y=Qw}YxAD71D7=5k_4?Uxr~#qxJj}Y5S+sJ%`8?8ydEvj zEM++DjbD_`@S7$caz9yWM&vQKd?Ku~vvz9SgH|}hg0V5_3LmE=ooDUOvJ#_VCY`># zN#Bb29c2{Yyz>yxHBeB(2(LZ8vxPL~+cxD4_w;2KnXGSCrjpb&F|^jg?O=8k!-#X< zi2JSK(}1C9K5Vh4dWiF9G@*EU+-GY{PygJ=O zxumPweyNzlNL;q__{=Y-h?88jKa`7Dtes}4T`R{f0?bPI7DW21oxRQ1YKyo!YC?OK zsG>0Es??7Ir2epHD(Gbdy*Bo;n1xlUvaep=acvq8+bp6H7jc0X( z{sn`FbDr_s8Xu};5?gj-(!ojMnYM-@Uq|N)PA7;>ziTIxtkN#~a}ivfQc6_b8!#EE z>994*_8_3eH0Md23O3dtL99|IaH;14Lc^P$apIOXQ)#NmR=E~|!VWt|bWw~a-1#wN zB;3KGWLsPp1BMc=uCU`pO|{5*UsMt!-};6PvZ&9#utmHVa#@gY!$qfX6F(0S!}G3a zDN$e;C8d@E5{vFkJxCFYBhvBUqSP=%?9#-jq7Y?>@x!*gVo}?B@ry;eH4`-YcMoKO z-|JQCDn!mf#(&o)^Q7UY36n%JVQzQ90dVBxkkt0Lt!*DBknwSC7XxbJo3@;bTJMYW z7YT^HPXq@TTLNnP{FN50P(68>B(oCs8Es@7r}I(W^4xtFLzq1kWO(gNjVjvSM#r!4 zgvRUsewBEir%~pzMY8p4ImnNn#C!xDi{9Vg#`;(7`nZjN2k5MKY(=i*)B!;F`s&4i zV1TSoAyO=2(%^S0%4~TB(>h}{=IKv_;PqL=5W6GjR0wVR6LOIs94bS zd!HrzA(s~Mq;A9?6xv!*+iEZ`aKV0_ajdT^!1t+ppYG72T-G$L87@s9IYm<$^aDPN z{zIQ8TzTPuZyxSq!*%Bm`0miJ&NZ|gMNH@4E^BVv1wfkS@f`52lxy&)@c?RkdwFew z&Lv>&SljqmQ$!K7&A-TXwXoVQPqJxt5p->Om+P6al850-Qw}7&?_tWU&u4P#@P zArlR-Z9YIhU=g$Xr;$_94H#_A)pE27zK%NEuF{E#0cav%tJ22G22Y!GH5$BeKe`QPs2sz#Kg?=e)9}XW;qkP zd=_3~R$v`^9v^GgpWo%XgWq8@v@A{d&h?_L)JwU`ER!MgnrD}9C2H`f@c?RkdwEGh zq>FP#4dp3NXMAH#6J>M8&|I-P_hZI)nV)(1+GLZih&mZg#QdELSqih;JuE+gmb4| zRTcBYksA;Wj^xwT7h=UC#)$8xvA<}{9!qC(v9z_$rg6b@V|@6x zqFleL-m8~$62O7TOknHyL^>d^;}dDyu@v*f_CR6wd1{{LvO`}bim!@46~V_R3;~@r zT2c#s_X%jMr(GwYvDD2wFjh~)*H<^gY6^Sq#0ltu0_4ZchE{6o^WQ*3xNlUQqIH%_ zC2J=JY41(#w0B55#h%|QYp1b8+G&HWjd2XLlSEQbG1TqnO#epNcuI``V&lZ1z!7C?nf-oW!gs`tF6-mY%QTI7B#Y1W{dk+ z3EXm~kG@3a3RY|zW+U&23ww(_X~6jBvwqQ(&Cq<%`IgMaFszc#7bA-P<|!8gp84V- zIj3dS5AemZq4EDdUo5;?&U97lf9b0H#$Y;kURy$qC3!ES-@x5clBZ@mp?StpL=FVK z3$cS#+M1o9Kx`%kk&l01?Zod+6K9-ELL_B|bTMdr`npFC9FhvigoNU44KpsW)`7{h@ebf(NzW9s$FMQ3C)n|*#s9or+bOF z7s-60PLDdbN%e{gotkg4oQ=D5TV4CPDFJS_5!Ww0!mJDD=&WHVJ!f^Ld`UrR zcFCsF$`TnG_>fz`=kxQ4RNhRQ7wxA+^DrS6=rw)8yy9A$;iw=|7cafg^LDYO0INnW zBW&oO_IzEe#4iEA7zgpvx+WGYs&7Es{%bh|45bi3xo)9rDn zHTJ&LCr$@GUvxTPU(~j0z`txDw%~N&vV}n_=GDo<^*2gR2dXTm+mpARZcq8y>Gr93 zYsP)21LyJ1)WxR**A@-pIe-UxYE6c*C7gzYSFtZhxALu{buE&#z`;21XG%|ZF-&m3-6bK6# zrnc3@?03%^s)Gn0VY-H0Y}|>FNb7$e8uzQ{_i))Shsx%mKJ;5LovLYt$2fcEkVfCy zY|L`lRBmt4`Y7p;l|hiUqU8#xWari?Dsx(xY9?Jvo2qTMvtc|DO{D94S%hK z)n)5BD@3*Ez=|-LwAOVxmpjWKKG(7;_wKV1iL2%Lb{?X!du=@z-u3F`Ji0XrLKd>@ z^uIxjMleO?kfdz*f_rU!7vOcwA?CZ?du;iL0tt5pJm2IVIZI5)X`KVVDGZr-`jZ}F z!nc~09m4w74soaFugFTY6GTfh7?w|nr+mh+DzUVf^oDiDWgC0-U9*Z1IhuPcw;TBt zT*d|uYv}}5L;mdg%x8p87MzmQtMlosjFKlkYS;x6Cae(YTdZdqmtYKeoz!G5QVicu zol{iBTISKF!AU+wn~x*Qe4qDCFzKF2G@S(l+=> z`*5)sx%wzFppt|BOF`0{y{_b_0$3C@E(xR%dm~qz9Y`?}a6g|_axy7dNK#3a0bVSA zl%)L!mUYQVnnZhr8_$lZA#6qZr&#Oia-C|Yu&$>xX0KaN%%TnIqHK6|3~zAayb)_u zVwjkKyyfUHV*Dq1zv&Ryhc&j2sD&Cm*GE667Uv<}tIu9x+a%X1nJ7w@&H zT9n9?qthN*Ic=r9B2fNJ@eGkp3Hskbp49HfOyra(hjL1S{tx?qx$aqpfnf^6phy&N zz5NyPoB8=R@pw|u|8S7`j+bTMF_1l4Oj|HkRA=c$&7_JxKC-amo97hb$KF-^ELg}? zPm&5d7Q%aDakZYyX^5FT8l+;$VYM@RrDif}@chci%i5`$@xQm}T5iOT%VE;0O}5Nt zb$=Z^Vx!`9w;H-SP$~E{YQd}0=B(;UyKEx3CGcT`|^h5R{UR$ij8aGZqyVg)WE zn{V)&XIF8Qq~fTka$QshSGU zbC!!Lz)}+*B}$jBs3b35Z!lg%Zed9tgYE>^j8liB-13e29^ig%jZHC2HvBle|m=d&$OF6 zV6cx|vpaV^a$;*l#iew3S-IlNVm0&_Vl);O6;XKA!cN<2CEPoA<`y0qCP4W zV#hzvRh)$-oeW)K-jUmPK6<*+`;uDgi`Iy_8f17re)e6jmLEBrW%6o$Beg=-eYqLU zPIx(j?o2@4%5OO!{!3J}YV_&uhFq0TP%XG{KlIWohseZk*XQCK=vn#(dY_>C&?WhSy1*bLsa@`t8Vv;c( zl9;sUQG-J4fE~>u=$Xh}VYT9emZDPuVpk%POlOBLV6jAE3i_`OD8x@aG>O$YIG_}* zjnriAd?xu+yO4=2w@3M+W{*&yKpZH0&4z><02OY-N9L%-0L_Q!8elI zY@2~u%o^b9Sso{G-zh$~ZdEZxViD6@Nkv5>G?$e{hJ+am3TBweSaCex;TayI?=VIK z{kO(Qw+4M!b1H5ma?zvp(Npx^O3rYEV)m!4TXNNB5jnjZkjDJR=64Cq_p>l-0Wq2( zdx6Q*NKw1Syyk2iNv~{p2{Gyy?a7I5x{O+Rr9VEy!*StKdB z;#P4@anOIUKa}UU(LQO->7w%i1Hs!mHFUnl7p+xbZ6(ZWCpzy2`T(Ps{!Bn<04Ejz zyGIgxtNQjH+UeEtDf-npr@bR{1g|NFak>DG#!QSkA!VWGd_7`_YTrn;HTNA*a%wX% zQe%ypq_qGRhivM?jw(UjETrhXg5m?)(wwXdPTdOi{O!q1;7IqU;)V$#*?||>dnlBYIl;tOhX+KOrXe9xEFz$;+M5j5ab(`E>la zUfwsO`J$EhM)K_4G|)(iEEHD%7If(-O{#1dB_;ynqkRgW zEoi{;SpWFgN*&s4V*X>h!lZA;+>)HWl4M+VD-ad0@660ruTj_Pih};T`vJ{sGYmr` zbysBhOUEdNV?MdF@0R?5^4Uyk*2tMwvx02iLx$T2LI2d?1*{K27L3R-*JHm9a-Mnb z!YE?awJ5y&19yrn_k-mQ3etN$GAC7j?B%nlmwzx{lwiA!PAfU86tykte9hhP7gCZ% zGwMDbpm+7SOHL|~wRws^hn%Gn_>CKTfqlf;CayNF2fP*NU^5$($1HyTWo4qNarv+gT2GDCMtme z>=>~p{jJ0u zd%hI!H*jx~x41goJ&$X*T>gl1H)7BvIX*x)ahMT#uZ?3R8uRrF>Y8d#o@7v+R9byM zE+64kWtk)uA16Lo4C$XeqDG6Av{RkGDQ7d?_Q21rs!QV~J5_F8f_;_nJ1doMY0c02 z2(?R3Z?I&&68N))nv`#99V2{yRxD~|kVi{Kjz|yOgdHm`FJ^fdBQ}$y@Y`z4`GFcV ziKMWWF)pE&iLx3kLrm78Wjf)Mi-Y&;smR>VBPZsPI=jR6+*!3{3hF4az8s)qI^BIL ztM5vM1@*qJu$Z_RD4mnJH$IMGsX#{jlH6m>OGFj&+`=8vjVffBsvJsZl*I9KT`DJs zUz}-HE8~_J*LbHnXS`z^t7HC4J2^Vep}4H^sWlpuYaADl=c_ZM?%|}-J(i{szE3or zp7B`qvr6KNI;V5v3MKW8vTL?x%k$AO^y@q9;bA;S@mX(IIkb+n{oq5b^35}WIrU3K zW!?B~kx~^GR--`Hq$=|MIJW13RAMBIFE@^>8{zvorI~ap)?$%006&I~-!iV|FR+|R z*SJcCStV+X{eWh2H|ub>)k&7?ggNbyfF|rn*yH7utcC04O6NZn#FvLMK(i#|jKeos z#QKdE9HeV$1%s}1E>|hO1ZJk~amXa-Qesz#+N7#|*|x9Q8M7h=5{WF&^a^4c2afne zGret?!@90 zoJcEP3`yWtW({ab=btvPXIk&eTHd=rJ1m_GIy!#g5Sy=tVAxf^yK0vCh5c?EDy6D@ zR~bLZx(>O<@9j4xgQtvd%g@)D`DSN;0t2Ip=`tpfTZZ1Ws$RP~0sn_)h}A@iXz z#D~Y*LanM*FI*k54K~#ZG7dG1SjNbh^-L;HbtY8Z3r`>odGj&yZkc;GWXEeACV1Z? zwj2`KxG3LLIl|w#cL2TF~z7mTc7IS1G&nN%p1sugWa7gbh{ zaBAw}i{pyUj$U3g!YO2paE!is%=Z}fO(mDJEPTcXJoa!gpHNvb&Y8Xd9BQOlh$tq9 zxD=dgBwh7Yj8hYxk#!Cme@W?VQI%cac_7LeU6+sp88(e`j^D!gnsN0mxo)KMM`Ovv zGJo{}!^CmUk%iW-vvx@KZo@eEihyOf(=gH6^@*Kk8K%m5;AfbFrute^_bg^sgA@at z%DR;YT2RWkzRkmOGYuON6UJr1m9PPfhP_cta&|zb%lz{W7$%K#{;n{kWdYVLK0xlW zZmG~}xXUn!^QpN}Eof_s!KgB$r75F}78SA9SOzDRzDE9jS@+-ev$|+;O6Hzxm+wYA zXftver{>6SFxf8wHHx4Ws)nVU^`y+NliRH=%#hn<>w*UDB)N5E>jyrArU{w041*Y8 zP(9x;MP_UE7RxUG+s0BA*RFOEk75jVKYvbJ9F=fc&53Nv7>|OS}LuS_b>c)|J_$< zRtEYz)YnC9Ov?QGusbGH?`|2(+55+DV`K96)kx>K9XOEyJ_n0-0volpYehLVsV3pg zM*(FK(|n}sopQ!2bb3OLYSJg*7xomKQm)1ukO@p9F+z(ltwdXOt7aEFpMFdxvUR_Fe`&&HYzt5|ga5?&l7Y305hrd^BQH*i|I` zy4(WE|Feb7tGlj%SL!Afj%&#W2Yev1ePF}fLg52|TQUt6gGrSR=*IA(g4?*|Q(#!u zeQe(lw-_@&xORE8^KPu@Z^XV@@C$n<mvE@Vf;@=(F^t+<#3vGJGr`ZgKryeUIJlVLr&kJTKO zqidIkM!22)6j)+(KiM}tx)00s7ozQxR}yPMyRMRo@V6qJZ(#>YqDUs|TG*^Thw(={ zc_1{0waBwy_zp68ck_*SHt)Su9?}!`&ZoY{6-nTCiQR|gG|sY)MLL%IfKdPLTR z*Pe^JKW+!0k3}3jtYusslP{V%B8SnCaSxk`N!Rb>HprxX&D-MqZJslMwEE2bLI3s>O6LXD-0N>+=iGmDFDS&? zkmclz{Qe2{{-YQl_3^ey?Dr}2|L#D9c@uQpGZifXOT8gg)yg<~SeC6_k5$m=&~uFU z8Py;Cu0>ayx`*Yc?UEtZ+=O@q`&UA3y(vFgzc<7QY~RQ5lb7Wur8nPMG-NYT=~wcT zwYNPP;b1cmJhkJjm+2?i9GuY1W?%|0yz@AdJ?4G!(t~){Dm{f=vcb7&l2J({ZDrmh z!OdhzjTx3=->V@quiIWi(v{VxI;X)R34_!aunR11Dw|b^L@G&_rQ(<`7x%ptroDp0 zxR-Y%?&V}JZni> zo?xnpEipN_!9Pl@3$IxbpEoHIvRr3B=6gKcDs8ie*Qp@iBt5%B%UiqFRWMsIr83;f zX5d2UadqOq`jw@yR(|&7&}?Xb{z_88NJq$~-fbVYrf%8PJ+O9b?IG*@b-N|$l|ZTC zmB90MHp6nD+5^WU@%}$O$~qV3LFa)@ZThX&B!#rRU+0V|ido5K(?3+`>a30(9n!hEa~l zx=~J=9+jhYSi44HpL|puyJvPv$nIbJHKWa6nr^oQ%dq1n#Bt6;TJc`bnRexiNAAgl zeXa3V|a!O`Wu@TR zx`-b(jdO1PUu>RZb~Y+x!o6-K>>jkwM`h3LPTPZ-tTrwdIxPxTPtCB^GgF?6BWsz~ zqFKL*8MYY&Lz!Q{=i!_BeV>d&9dKY{81&zFQ>x#RpS*JO$;BbesZ=9BvEO{M_yoKf zb6T^~wEAv%iCa{TpnpRX@Y*Wl#ovzCe};O|c<~;aVal>Xd*?h@e$bdHLw1;1<`>>9@_wC2UqM^H1CN)Ya%8w3SZC?O(q#F$H$7HRwNcvsdF~ z$Rj^UbcSeg<0g&blR*rW}G{tQWbNmGs?Bkf-UHi`j66$&Am5`oM zZDX2-ZsDM3LOLe7m(^5=LQYxtU-z3!E%4Ah_C#kw&Y!L_U1AddakVZtc%$?{q%$0r zE$RBqKBz*DsjtrtzJ69!!!*bfYPNHJm20BxH84*j=zsOtur5B`6Z9WGcINZXKWFyn zwWmTh=?I@gc;y}wa%aHbrb~#DS8{K|$FXE0lOjVau1=2?33Bzmy=<9+lTZ>W$L_S* zr9t}$-+B(2RPh{6HQI^&HMYGmarM4u_)(6zZA`DZ?3kTot)_JxzByA=z;7t)F4@h- zD6y9DmGb7ZpUBTv?G90L%9WPDjC!Uif`0SOKCF`KEE=j4b8{T-m&xl2Y4qWyBUneKvcB^iG8sjvbZsm=>AL%-hfMIArf}(9bu+{^G)G%DS)a4{3}0 zJv1vbWL0MlTS;a9M{drtadNwAxj(GUC79nLGoy0C>tMyD&ua-mVIwmI{T!Y-{tQpH zz{Rv&LeA>=NJr-teVrcX4#6YN(l`eFSDPc86YeJFW6cv&LVoV@PXJZWOIyR?VM<%kij%97f<*@S_v^8v0o=~^9MLDtG0rj>2RllW8 zCFgi20=Jj0jHqSaB>d&QBQ`rk=ARDwpZYy#8s%7cl{7P6iov`PjZ1x0X{6Hf9%@ub z-}R7Y{Sk7svO(C(JWUFXHl~knVCQGCtfesILRB^>_9_<+J;mNTD(O)}&W=Hi&>A?w zKNcV4*XY;mv{g2o>U`Nw=U|-!v5IK*eSs9qGOT^mtUBAPh~#1|fnxWEO6{%E9_s75 zG3y-md5k2<`{1QTiCEW*R}?4qmiH<9bXe8H{*?k{A3afX=z~KW<6?6XdpC7`>`lt% zy(6>M~5s&O?Q}#cht;xt`pvH4edwhb{l`EW6wc^tkoXVeF9uQ_C za|Am)4Ay6`FM7~F0(0P`OY^W^i983LJ3vk)_Sy#%an{mKHC~Qz#o%;^SnO37 zpwl?hp#R&xM>=BftH9cn6Yyfz=jJF7uQ%fSgV!oQ_E~vNFW;l+jLgP*Ll<_k5Ds=7 z!kTx!?F&3(aNLj6HaID=FSI+Jlm6I0e5dVGA_ftTD8%Ca`SQ+oPWr99$DZwQ=cL|V zwy&O(9tx6VWG+_|Q>c6t{B)}{zEZtyw^yN7L#K_(K*Xx^mGU`=%AZD5o|u3+`btsr zC$80F)pC@O)g(B@!d}i!M`5Q@th=a&Oz9kFg@kQ54ujeuVWDwU{lHEj|;l+TZOAPHPDi+2?gzBcAfGH?2~jG7N9d#@fTdE@EGq z{q*YhUpzba@Fzu^(q8`4+`i}ES`?LY4(kk3*%;`3ru&hbGMDXz&w<=7!o^~f)~@%e z!g1OVi|9omy2&i&6sHco+Jg0jGwmr^G*$mPG}LUtc_xt4K$0%37Pb!fe>bR*&;B^G z9y_r!Px!*Z>sFJ_*m4#(8da{7eY57ABozfSn~A=dUZq9+rN?7Y`g^828;I&$%-&LInENUR*TLQ}(&IIPyn_KA} zkL21r2dbVPI+uf!?&(_xTtn+ptUqGkM$wM%&H?Owk-ogSlbn;vd$c}_RvDms*-8_` zhLhfw+c{gsT7E#r=f^$lDJN~glRvvgJ6q7MqV5j1<4w)AzKIh9>ZX4GgV9~lSKvWC7d%fkai*#+of0c1Cww$~vKUoDBvU0#MGi^*Zt$G4E(5WR+s-?J zY$aGjXHcZzJKDMcxhNXhnn#ci|1ji0<5L;xhj^sD*dOT zN~YvJy)42M;+h6{yI;C=+p%YRE{*)p|Q^U?ZP~bc!VQU=nE#rd~ zqDC&^YC|QFL9UwZgtAIMEoUQV?OIr_mw)fF>$X$qvS>TEttDWnrsGtt*a>FRB7V>peu$lRNzecT z{^$CItuyicG`<((du=~4WtEI`j={{wcCBsLr`S4nNJq0V9MO|0&c^p8+3)?^J~nfF zb|t~2t&7XS2;g%JXjSY_B;#lkLtsY&+HYq)e5aUZv9B`EPit$f!^}^))gL zd91igKfOXzFI{2l#3|O9ppCFqn>^s3)E@yXRHC)3ze4wh6Hz8b%S? zWtBYT$3(@B=f?8b)u(i7w=l0z*rs=IwTz}q`(`3nbP?WY0?ibn4ZJwuKR5U>cE4FP zRNQ+)Q_Y_48PwFOtJ$;mJ~g;*sXN6P-^4}`C&5&ZiE}S$orlF8HeCR#_R{I{&KPy49I z$@EB;F^DNw?9gqWVhX*>>J9iG?4#4j0x-J?c7GGwE}?BM*G( zncHnTaLPA_KhQ=^dPk~LhxiC)0v%*(QiKEfcjHDQzH_4-Qe{FOBJu_rY!M>zbvXY8 z!FgddcO~>5G2hV=;cy~@uMIi7ddCI%vy+|QQ5W_`S6p0<#;LAZ0c%3*93!rP&LHDL zI_Hxgx6Il(?zfcy?k_(BFHatb4@4Sc$@q<`1f{ z%PAEtB6IWv?+%sf4?HYlt@}<3GJvAn4B%4i-Ld1Oo@`BB*bd-Oqpce$GD$q;QPfQ_ z(P_}=ZA7|(nPz^$eKuGevSl)C|553+;KT@KA0YNuZoLQA$9OiccBnL8GFyaM7>Hj6 zL-q(Yg)EZq+>G`gBAyw!G3Y;bg3XnhYORC$n)jVh>}Y~NtFCA9OBPetZD&?BoyLB% z{_lqN_*0J+5eE)7D4W%e_QW)HspyxAy38wgiN~)#U(9%e^s-DFtjLwmUc+V85tY1S zwBH{S6t+%)76c!{8sge?+d~rZ%vE9AOq`;{q^+~>UgV3b5TtK z40Fuw_V4@dN({We>HJC$vkRHcI6TiW+lJX&R3brzGob_#HmpwRL8DXlQEw@ni8;R* zn(?Xh-C)RCaUwIHO1~boOlAEH(QU#2q^98aHb&8_?jOsuxE@dw2Zrl#(j)My*MTqe zrpIBuz;e9pSyqo7XG0Nl@P>V#&KYK&>wjV2kG^Lqs6jD0muY(ovL;7ko{7Wy5x0>W zAM|^VGx?s|{np-yZS3r_(|dJJ%)GMQINFg9JGELqNv$-2N=bvvzM;~KgCg*x(wY8Y z%W>3}C`7V6$Jtyy1sRaVCv@8tb%({7ra2;Xp{!9(<189xgIv3+ao#QiziJ!pRMauc zE9lQX!7Q=;9`@M+t1#$);RMrA|8POK`d{1s+Eu2N_{(he&uMr9Je1R*dt<*`8n_(# zHF)I?aXDlrQtsa`j|)zc+Om2AB02;9YXL>It7&vWjGV1|Famlu5M2;GpJhdThq?by z06M{6uz$r>yakIs=pT8Uc@sf@Gxh|=Z{Thc~s~_$6PY=R_E$>IJ7K7UF z9~=D4lLTmjG_t1!Ipb7}L3ZN_?9Y++#vav+jXhxoL0Sf`;xCz=;&V)o8BXrpXzI2v z*;&r^;jkPi_|EfKO}!ye{7j)hPLuA7q;C7-x65aX$YnBQ!skR*-8?~B)Wm*cl^|J= zB74w715Su;Hr#AS&B`pcgs^7TLN+erW1)6Jczk+{MrM2JRo* zX%@>>pK;U`h?%EvB*qyh?Ma9xBJYe7{}_m&mPS7Dg-m2l7qZOQZ`r9(mKi54M-wL? z4kK#L;3Bkv^)IwCc@yY(afpr~ z{3Otl?RnX~7kXj%8ybTBW9J1K(#@A}GI_Y#h0~N~(^;Er6R|H(6>d9x!z~?|*FlqT z%}d5Pn{iwzO83clb$4EF0w=Cz zd)O@RKKb>UWypL#n+DQ^*AA#Rq|)7A}{Da5?d%@v$Zkb~E4vi!o;E8f9*E-&ORXhZ3ui?QpDUVA_32 zBWOm{OfVMA$8tz7+gbGQ5WPq)lKt{0yJLSpqwnK)Io*KIcj)&sNFN-kHC#LNUHpTk zvD~d%9da9Egj*%I?po-RL+_s-y88^ZPttgyjQa&(Jcuh+e$ytrJ)A=tKb%9#N>~o5 zfE?2KSR0O!jPSz#VOM=Gixg{7au(@7?R@R_z#WTNM(H>58g-gvS6ihPJJ0+c>A@=M zSP1WxAnrixkk?q#^fk9#4LcSYUUG~myXq*$FEnCh-Qy3k@eD(TZ}3LaL9SN4)g&$# zC$iXcAu>)sWI3CoT@lF5jBps_oXt;>vuQxirq-v{Dp0O)7(ML0@I6GjV<4^R)BlII zH-T@eO8dvp&7L-G(*^7Xqzy|qAkZpBP|`HLv`wLGDvl_DqJ~AO>oAV*kOC?wYN4p5 zMFmkr*;=3uTP+GMGcJ>`%oG8sBNAwxncGsxZId>??{kw@be#8nKmY&l*M6Ryd(S<~ zbDr~@{W;Hr+ji0#Okk^IlEfx!*RE1lOKHB$(ghdEYmPIKoLr%vtBTnP9hvJ@>*Ix0 zYDg2LDBW1iyk3xmGC+4Y%8L7VkO^rY$G9=DF2N)jP25`4r~Fw|Fn0B~D+m)+HEtt} zjodEl4o5-S3rZhB&$OyF*8!bxwlLT84rzcN|&ORtJ##u zpf7vg3e4M#T=fb`CNn7>8XeQkf){(&dT{tlm((@!fj>8zv*~d-e&Qk65N&jA5VZt8ai{es~9P0qA7>yhxK9?#u<3NvEl8aPG za*?Z7C~DM@i&T(Yq`pv4Xv#0m=Fw9pWu!xI{mLLuRpW*M>zKTf{C~-97Mxkht5))N zl1w2|aB4~~Wg6+3YNjaU%W15aKz|eY(>m<--3F=V#$O6@=@jVWSN6*nsv%#fuF^|80JvfxAS(AX%Fp`)YCrM1IC5g#G193vvC4}UnC28kxEBe|%JfxkW zeQtufQeMr5ZMP8Rj&{7ef*VG1%qbH8Z*byUnpt=Q`zL1MYDF}5W|$yWn2^s>q)l|p zY56Jj5C7ZLPkgf)mKOd^9$IPO6_Px3JVw2TT&DEJE_sbC*JOn6#P`~myaxB|u-^cE zD)E9$rdmI#bHi?~26kfB%TiVAU%aG#U0#cmD;tAM$v8bYOMp%??9X1PNW{7^;JpdE zl1x~Su}l0A%EqZYST=91tjLue`L;OAN-cZ2HxoHNJ$3kbxs>Bx zUO!^+4SABJ-s84VuHz`z_WoS|B}oz-xgpof=j5BR`8)qZzJGF3jvYVr^=E&P;&0j& zz46a{XTR@p_)db}?3aJgkGyMY+WD`pggriu9|vm4-nfw(k__RPpbVitMQzWA3}Mv! zV^GsfcuPuo>CZ5`oyUIGoBxR>DHVjD!~y zw@K1B6}~xt&}ZpuGp7zYuXz)DCQkh@)Y?RS7Nv<=gJi5a6FvL=px>AdU`e|3nNTXF zlDvyTB9}3LMy=ug3C`{jb^(Q5?tOGuAGLC&&`MD2!5`Gsbl*%}87=79a_o#nOS0cX zcGvEe@ky6{{xv`Jb&~XT!X?&3^1b?*nC}88b-7d~jgZP2!e#qlpfSw-~+q6~a!(>_b7QC(TQy)WZ zds64UyQ$qkWAN@5#qoNQ0n63@)UKQzFFL8M-FxXbNa>8nz;|IUSI!&JvjuxZw9gO) zfC)QAm_Y81O8>QI>Qs`0E5R=Af0BZ#`Cmvu9r_h1D74~`6qLN?Jo31)4F|lPhl!R! z-U-TljFxCgyia-yj_PVPLQVxCAo|NQXJx`yDtW% zkdjK&ufT@EMVu!Mldn&_h%t@J19iUcZ!wvWlIc1uudVul8CUXh)KubO%J{8Hadz*~KY)@0?_FIcl? z*R>ZPN)cq-E>WjXe2=YDtSjww&XcWEuABF8!n*I)>=GmO-z`+Ho3}`d`!lL_3vq@P z@cy=2IaqymA@)-O-f`fxcxex%QPi34!Ck4XYl5@*iHpC`ZU7{u?fggbQD z*|?<{v*x48ot4l{dK>nM#_$GZa}i+qcZSRoefkR?lvlw{VLc z(h}|j)$Arc-w93aeXF0`#xts{)4x&2oJw7o4;yD&D_F)iZh5ESk@{TDw<4vvC}sbTA&L0cCdVItfFupS9H+u@T1Cp%id6ePXkc+VM)RLz6&b0g{FVpw*c;QCzV@L0aSuHoGn=HnpLvMa zY43}rzgjl{rv-6R3Fae@sI%NguCqLE%QZH=zPq9wDV7yc3G8F+nJ9O88iu0fh-#?VIj?t6eWIZ{XSuIwNEeIM@+`o>|3CYm)XpQ9s8D zxKGr<)xp)k)xcH2Rm_Pbn`4mF(JQXFx$GF&7{k5LXqgbDU~Tf)G?!xHP(iLLZQY<7 zY)u~W5|4QIAl}^lz!5kpWYB_5ds|%FDvoe1uK!g`8=(~fU*&v_CzYqY$11GU={$qh z$x_P}G*K(-Dj^f4Cy~+3`vP<>&V2<@kD9wcT&h;ObUG~!n2W=+&B+;LUYSmPYT{4r$?t_ zkRAdL9HrbS*H7KakjE}_8y#C5ccHI&0n+)iUCEtnITPxg2Q64DcAR%oUo_g4vT**w zd(qQaWIyk1s`%PaZ^ML3&S>NXn={f$|21a@pR$mv^m$+FerpX^o7!19-y%3=Z&l1r z*wLm`g7fQ)^WL!=?1zCf&J)p7U+&%FFgm!JEp6dkqV+a@i#^rOMo^jWNqXNJEb#;v z;Y;NRV!Vw?`mW}dH$1ugVg5Fh-RvS;3%By8t|*Qf5cYjbT2lsZ$8B8HdDsl-s9oW# zvOIe3yM?qr^BdqS?ahS6pZ{Z9m^upgYAMI9kiI)emyg^lcXofKJJ1|J6NJH5~k%hK+5ai+~};p*L<)P*&cxRdi2 z9Gz(4_&y#xmGRIfKOJ>C zU7}V|Ql@o_-Dqd&Ke~gM`H;&cSG|YmI>U3fMA-?wT+LQTZQ@qD(GhDk+Sl`|@nr^5 z8P#ia%!E%c?s>$W)cN~8>!C4DCJgSO9p&Yn!}p{tr1!Bs)Q9L&A#Z6gqSvbMEK0tK zFZSqC$)9|ef#;b&u)IQGc{0ditVFp?4W+Gl&?k_u+|a7TEr3ecz8KOptCi{QXqD-f zw=S5oy!HM$O!&LAv~||3Q*C$LaiHlTi|%}u)!8bORkX_GD_R-D?jhIre#^+!O{T_Z zft8lFa%0frB$u>CkCC~|k{!ud$zPsb(i)pBbIq`nwdKnxXC}Psd>d`~G_(apoRxJ) z`cu1=9ZpGtT;3gtr~Gc^)w}Z|Ti$6mC?gSy%YeT>t*Jzi>FC?h`01ogQeXw@)1?B7 zJck{&i zwocPcgNE_EHpTS3RwZX@oC~cu=Da+l!%a+UqO`7@SSPS3MH9y}1Nz^q8fdE83LOCZ zaQj~Ojc%;wJZ_`wK5o~^xNe=0(k*M(wZKQ#-1IT}M-K1Mz2raFl-H``D$N%Y-)iEJ zTYA2!acQeUF=S%$H@ck2bI`z{fSy{Jp<5v!&Q&v{{ZgPqyr5MMtd6(qLSG?y2VeS{ z&YKz$LLheoFkIQ`j8!#NbULGP-|x1m9;(myCaTeN*H87WbWwdPV1q`Fc2kiH=Iu$G_R!NCQx(?PE7!*Fivx;c|Nn|GID#F^WAP8Z)KAKT~3+Rn*P zyK>eo_ZzyYPUOAj)=1PCYTnw2HBWg1W@fsQ&Xy&~ts=$422!+BV2u4}VT_BB!IJD=u5W#TCD9o3I(`GcH$mQY3o?o2Z{H$$(6z9 z(oUxyGtR6J+GLSWw8nk zR@K1L)?@Pg))|kLwtkHEmz;dmP4yJ+hE7hY2LgplKJbtq`sRFQ_=&qGUEj02p-qln z4*2SB?BmNDQQoOjF-FDxN8YZyQ~+FFyhJrj^`((&8Mfy3&|4VQUe0o8WvBXs6}LT9 zyICH3Q&DZ+JgKv1H~FP{e&UPeouBN+n}XzYzzNFboo%~g=v;833S%>F9ao(2)zo~`($??G z%>q`?u$&Q0OX9kTYB!}xDgKpkop{o9FC_2jY;P6DgZcbg;9bTu;KDToykujqu!+*= z8mEYwe_+oc0R1usX1G_>KvzuAuQibKZ+iCytv3zUZ%C6=t{L}h4;V;NJC6xUF*uVT83z~S5m+iobqBoHd;#wly$U=%=~Kfu z;QdjuBS%u+nE!V}Vy`!acQrz$>^49i?MZ1~kHiT?6y*Mj-5dC|1!N`Me#TNyvya!z z2HXqLb<6xi@;8{FVR9<&&RqYaueaT(i}XeRHosM!&-qkBwI%EfX_4pJ1LK^+fQo8Z zw2i5djW4q%CBD6PpRZSl^y#y$t#T{#sjhF6LMw1O9LRPGtYRBN_c#|=Ww}`Wo8L}i zDTC@ynMtCC-TN%ElPh3D_nLE6;sb4R8E3c& zYr-E~2s!!h9+qK-#f&Y`h6=nV1MglgWgql^L;JVMh&!MxKT^V6BVn#;59G>DR3kMg z8Rvsodj)j}>qsB#-Bv&$gILQ>Y%5?LA2{Rrx7#8W=2n&Y9nVMY2K5W()NZxEq*bni z&aYlWx4Lt9xB9BJHB!O4IT3h(hH*vvd;;A;y3TxqvvKE!@aWoDAcMB2a0wUa^S;$7 zJmcJ0VD4Dq+zoBtW!9~2TJ76=5Bh|w%on@S+N!n6B}xWyf*ya9~N$)f0%byCh8hdRt1dEzBY<{4S;JnNdI+Pw%* zG>*=1a&$aahw{S=NnvC$H9Ms|Cd^`1n&mF3;y8PEUYQams72nD-Ne280f547o2 z5ESCKd3gRuSa`4Ym|<)5ulyf8#2=GA8a~29@ke^7&oN=Ht!W6uy%eo*w!87N#vCU6 z1+sCeHhsfD!`(wyryLWv=K(lC^ht4h3d^|WN-p7GLs1DCLzOVRx3tsA8Tc@vpobIO zT>}fl1m=gIEHOX297*8bH5?V<)G~*Ry}HmiAT9*?d*5 zk4V#;dx6P?i7>?A%$HxQFgm%!Y2}mgEhZvE`-^Yux$4%Z+?7uTOD6_G_V^%gNvu z!-g^0%RAK*nWbzuD}QuDZyID3)xvY#O4{{Y*;3E3^*Cc;OktjdGJLd}u{n?pnSucErZ@=nR{<5{*KgqD8d_{RSQGi^Ebcdbr{Ah8B7)7*8cc_(%sQ z=>?}0iu*(Needa}Cs`rX^34;3+!f_^m(Pk+9EZ3BLjVq;v68 z!+0ve5DxhJ?-bR}%>_$abvhNw5bcVA&A(qOh3CB2d&p0A5@3NWRflz7kT1ch@~hL+ z?f)XIBp&X=i!433MT0YvKY%%*6?#IMOxCKA(U|mc`w&@F#;xbL_DPe~*Pd24X)lP* zI>VGnoRx43I}53Uux?pbd;QO`A9(IoD^WfScRB6=<>wbbhhS`?t0Mm+iSpbpD4)}+ zRj6I_Eve?8a&?{m6j+hk7}n$Z#Icb*%}4*(^{`!kEe z9cBBDVdqGP5#dPpTK|{rLv%;lqoNYd4J&zru*Nz_m!Rp^bt|K;on|;_L;dZar z?~`c%9Hg9qfvi70O6{9-3d|gJ2^XX~XuF{-^{$8)+AvJLWH{)hH zQ$QoBI#by#zs}n2EbQFYC4=Xwg#YT{YK>UEQaqM%(TzLCjbcMu2}?aC79KT%CfsoM z-aNs;pdmJLr8tMJ6ldvIiuX?YRy646JV0$yM)M@u>-TG#z7`GaoT$;Ox@BH&Y)Y$| z(`4Wdg#1hRopqNji7AdL+TT^eU}xPIbYJ(y4r9i7OTr6>J)y;!jXE0|_yOU7i0q*Y zFiY{J)vJnBh31aYF=2wTo8f2M}~th!mTgsiJ6+A5T5*p7#A zZ)>OllC87G=&a#_&cFSBdSgxMbasYjZ2h4X?>rPP_+;dVr zwE}y(;lhu;RThgIcBa(S>t69Ui-l(JLO9l>={49{RX`JDI)73$ve&pu$0=gQu_*g>Xlg$}r9j8(KZ) zj=&h|t3MFw_Y24z545H8`RKJacGK^N-RS3Y)CTA}!(F|;&~Hki_lr7PD*9(D!ma40 z-*>yUHV$@LDPLHGHE&1vsM&|{3HH?oyu{eksK-@+I`~uHmOCXj?HwPxnP$nQt*4cx z%{e7Gwzqw%p%ig(4~=XQ?wmd%iBIvf6tzBD5_HTakYajvf4P>ozP;fs~v2S*Ty#$2{Js9tI!T? z4VNpbhP$6y6jT4VD`8ya`h0Kj0|hD<>;z%MLc=tAByxhv(HagLzqJ z`#Vdu;wCHZz_}M=pP~1%M_E0FR|;zaPc15fB_@{PcArE)$O3ZKM@O+Cv7d8@Z-zAw zEE;Ir;!~ykMWco-yCC1>skxy?%*hszx)J-)SZRII3$C$*jg3)!EZVInM3!ST``qKX znbV}_{Ey)yHY$shsAH{gG(h?G)n8w|jlyX=@vf2&KM1Wry_r+lP+1F?GbtGo#KIJ6z;DR@OI;L2fkjJX)(#;xtH*N%|Uf7sNTv z>0(xk47Aa-eavVSkzd6cLY^mPnF>=`id=XkFwUxM`-Ic9eWXF&h6%s>Tr?Zf_|>8n zx}uf@PGbd;E*n52n(nVC3$;7;Jl9Xh5hzP}1C`^)o?#`!r?O!>q)S#=tN{i)(rX}f z&r*$cSR=#Px7wu@p6uRiPur)<8Fr8xcG)xFAoigeWy9i&6N(1dv4YOtVGg%PI|gEw zsuk?r18nj3?ezl+xfHFi#vg|_miB`?wkQ^T{Su2-hzfk`i7JZ5+kJS`1WtH#MUi-0 zh&L|qcMsv)vX^6<(O%d-jwt|_@$846VHU?kxX00+On9z?e<#31+A{=M*8?RF+E`@@ zS~cn3*pIb>qAP_jgI~~R2WCJ@;lnQ68H2kS-=Gm=+8p#>6n>Lm2H!pSO76PQ*E>RA zU-ZkRI7*(}6``-Cp|5}N!(s;F;EoC0$3kBVLtmHrVM7CPlsvf$LSHSRuXf{zTfEP_&&Xit3TgqlB< z^w3#V-sw?O*$CrSx=G1Wz-vaOfo?`Ch3(>y8+_#<-`B-t$#+Nzg=HxeR^ltMw9{@^ z3e&|c3rWj6B(%6K^J2HSu@8fg*o&Ef+YTC}`!xCjrEr_Lbzz^p$<}$YI#*)^@Hpfl zeHhOB<5W_CtgmP!_x`U2Nv>wkXvw965*Z-rkBr^&FlTC5G58tK7pJltlA7gd5xl__ zSLATW-j@r5dbqS`HzdW?k?y#9S*^S#5jJHbZ7~kEJ_2@RrTWLZ)zlb{b$FqlR^#AX zyeo>fJLE{g@8{A4H*Vp0nnCB55X~>c)!!+#>%lAQaMLi8TR#AK>v&iu8>TO^I~Jk8 z`WA7++zh#^-BapWO?crBrcdF7FS}(eTI8hn6X&UmHaj@v^cg~5b#t#@K%Yo?O+)&# z0pi1`--d|7m31279be(W@ZuAqVhqmNXMPM<($V8n7qj(pgW9G>nK)r}H|-m?Bb}~S zh+@21d;#M-(jtB_HN1e7W_6=)ono-7S~SAcZlgnft^2WROBC)?DaNqO&TkCGu?}@6 zRs)>c6>U#~j$dXuCMr_GsjWbx48n0ouZF`~+g)8z5>NDczwC;|K4P!;^DbS;CtQ^6 zr23C6Hl&ao;~iZQwumCOAxQb0?i0ZA_bW%2Y#a87`NNNH8b0%myUYh@JOIx7CD$}* zJMcE&9mHMJpab0=_g(jH?g_K~XI|%0pwoYT;{0Bue+2Ozr{E3y zR3kkPC%Duj6)wd{or`uh#KsSs1y>U=amFop0zAC#}->Bb;SyUWG0?uC>L%e>WP{M~7Bi4*eK zD&_4Rd*vCH=2*cLb?hn^lZ_jCgWT0xc^a&+s7Sr1t8P5i| zj{|Z5RBy?E+=duiOiApN`xjJQmNP|rp?oFWRDSEjQCJZYRm=Tb9>#tUte?nZRKgh_ z^bcVdJ-1O)q$w=zd~LoK`?|sPTRHN0d^h@exOcq9m>n*y0WsT{?79-2BDc+OykMU0 z2*>H)Ogna`7{|dsR#9B!s4?3dM(o=#gN?pm9l`-&oR($E+|m3RHRqx?O#{M@ne9*t z@A;1AAB|$12IG=GQ{k>s>l@?S)viLV+K=xeY04iPp>!AT~FhKj?cvs(}%EE`qLWy zEY|3>);QL#mdi7RW<@sQvSYZT)#~C>swY3_xCFkVl|%Z}3*z=Vz-B<@b9JyCrDnrQ zg;T|U(=P5O5P99*_V?1SA0v-+%!X_X72WD=;ga$AyUZC z1ErnaO)#`7hCE#pajIrE$GAd`uYjL%IXJS?9?%7pTG7?#Gv*Bt4{4tZl{XUS z2g!~l^)g2YVlGe*V>8tv^^8pT$G^@e*yOFDr8%Vc>!bs^Tpc~;;ta*ZS z5Ss7Ufzw(5)$5|d#Z%UTXNGmBVb#Qh!%mogD&%mpUL*V#w{XmmWxK!VfsoI`lFwEM z2&bV>E0f+{b=sx3iPGB|XPSehD23SWOi3bkqw}tk3*v%`yD=N2`Zn+yj31D7BMY$( zy;1YN68kxN;I65S?KF?oyY|9T+ZAY@2-9n8PzpWOsI4epT4CY7Y42Ij*}cllSZUs! zYsoMSl!w>6E~e?V)p8+O%(E$=Z$()JACsyo9D02fuzoWzaMUwV`T`mDDrgM=pQw!O z(Ac0In+Pjw^sac2{5)Q z=4&|snrCTHhgSovUf-xQ8twW<(z_r>pJsr)Lai`L{OLrKc@`Gi116)LdM(%x0v@K9P)@j3z_Z3ayTnKqP?_~Nq)&6-qyT2a)!-j|*EBHU zMNv@*8*fGV^C*P_n7?Tn^#?h2Z3|;_0{BhiWGgZ*0%T{oZuGkUucFu6~x7JTW^z-kpFMy$evDNQK_zXsDgF!^5|ZJ|tX1h%&;WXBRtB+j&+ z_e_(xPAJs~cQ(!j-bYa0r-8S=A+n^*A&0$QE$kbn)rS|Vp}YLJcpT@3VS*K!T(7y% zKjJnd?7HG!AyJolW{t4_Fr_mMklUbv{m(lN!cs*Mh0zGpy0Nmt422ngC}Yr7!I~(n z^B4I=1x)p)#N+y~LP}9B6def@!jWSqa(oXtqR&NY!Q3iv_S}~rSqL2n+5h_bf7WL& z`=Wk1B$=5ZviXyCr|yyDx2;^uf&!HbH?SsXc-(=Qz%sA9ok``=nEVR*frg&H<0eZv zRxrxKSMk29Cwp1oTkNfYCaZztT7b}i^Y@7ZOP}TM$L`X*Khqr?$(zP%M=8i6&uG#f z%&~tqLsuPiu0^&nZdLt!K3U}EBIk$J;+DW}$VuSd>4dl1B4tKvjU}S|pC^Sz+LI(b zDN(Qs7}R;R!Kofy-b|-+Pr9ZSPn|kL98t+q#@NXc;N#Gj^MtFoMA`0??c|e;T+4iv zP=~T@lk9d<39W^@Aw{jR7W3)xCRhwx63BMMTTS+icx&=K#@KST(B7S8<A z-sF&5?@iq*a)vZ3bdC0AJC4WyV9BxH2`kRavt-Q%W9A*4X|&B`pDB(oq{j!m`BI9O zQ2G<`_F4Ro3FGXeUAg@7(NWFAik&y#3fy*Dg4B;D3o#P)4YofeYJdxAaT#1R7;~nI zM>RsbpGv#holum7m5Mw@BV6`Zcrtiy=r+$y=(DM=F8IedR(J*!#um|Av)|_^&*8lR?tZ`~JXgc5BM8-XC7x-ljzB#O z!R<5BTs#)7=TAM02g$9@%+*at+kdZoJb^Gxb<>{v2-6q!oAxaqIgt2`OD|5bQhjU* zm090k=ApKuiD}lHc<8q%rx_Nx!Tn(!Vtbnh6{*^tEFzU_*&K|U8BW{^3(D8sF~zls zgRGAyeCmlS8X(c(9{(qv*rGU4t_hTz<=^Rv#6Bz0WU7Dp$mTOD2{V@Yg-ctgmgr&e zr}0NU2T(quNh7&{gMhxWuZDkL`Ok~-&ItY{++M=iu#ZYR0=GZtY(C)K(L112U7Kq^ zit<``1Gwd--ti93>P!!7CJjf<6w=ON;KzgO?ha5{ohjEm7;jKZdr(U~K1%OzZUttC zrJc>dztiW!oT>02)`uY+jsq|1L!X2F)aXrBu>Txv75{XSJ}c5#F_u@SNVaZ!|1foV zvB|E$-4a%nW;OE86q!)(bEcU)jyf-h7eQ&5w(-{2FVECBN3=)F(cT!>vMN+R33Tg9 zs-G=wS}w|pJ3yv!b}suj>T*|Y0p;mx#*N;(agHAoaIe@o9<3s}`7@+(XR*O*0GEVn zdcsZpTr$lTNE~lv#xZt^PZl0bu98y1Gf9-2wnBPnZhBhNDC4cX1~;{3Sj!Wx7FWW* zW2)=#_cG)AG2PszWt@cR7+^Y6!qR{u=BX=aAPv>iIEY5IAD_X!HyzI5#dI3+vItFcXtWp~8J*9J1Q|o@@tZq|VR4 z^}#y8871i}*z<(vmDB{ZX^n8bo9KqMOLjA6W&^$jY!61b+g1zg4 z=&Dphf0w%ba~VsEYr09Y4tbyd49df0PH=HX+}<&C+8nbuEYso%fz+2U;#BTf` zyGFRZOU55K$X=NM-Jf)t1sfYu94U{|fVcceJm#?Gj+a39`Q0Bv$KxUQK4=}}USY4L z;vQ=};_UZb#EDBBLcM@crQL5L)TeGGG<|A>KXgG;M&{q#k)ZRku9F^RZ7N~1atyDi zB}~GA$wAL7(53}+q49JgAQ#ZrFH(P@f&TI}b>TZPTbZEV0L?Es40Cuco8gY|-2pA; zR#=%qo>H?Pl%2e$E_w%U3olkzeT%bvC(hy5@o({3=qwn)XIZ!576>QH!>mlr^e5CC zS?cv9q=?;f?k@H!mzoExMoVc5lPS&fV)9Y494^OBD0f%Dn-bV&X>R_fbjNa_)F)(P zXKuX9fOD^_^@|r~?#o;lUY~}Y7&T5PKDi>Bk8@vPXLmwjVu@Oa7nSWpWgKthX~yJp zC)#5Rm&{iSaX9@hZ;X*nv9vQZ!p^S6*qb@yjx34-UBlqBwd+J^M@@~lOR{gxva&yDQ|r7job6lbjv( z>r8kPYwra}WBP8Kxx*a*w;JxeU5xF7I}GkoxL0;Eb_(u`_!ls0kgkvt6 z!m}!CY9`NN^|8SZxz(xyyx~L*?`x&~bmz-Bi$lDUd$4B=_<7vyP~0b_xHYTZ)_BA9tD**BXj@1o8Y*+|((lCB_iW38A>R`f);4l>*($iK&G1 zSbuWpJxO}c@F#@cVWS)0Q~d)&?}McGL_hY}rTBxT_ZYuE^gcv-5A#Rh-O!JlOv23+ z!Yy|W_8I`Q0S>@2z-mA>U_0RFw9i>nI7{aA{t z?vHy&it7h&Q5~H_ydMGO4Uxr>B~eqNrmm{HjaugXU>RXQ4QrDRd|}1mMYo6i8PdXz zt+2xf324m2*}XU;K^m0a65y1K_c#FckrPXdj+J#uWN~;B%k;U%!veNqB5e0+lMdbu zE5zhiQZVO4&eWTyj6*+v%E?Agbfr7EF(lEG%df%A|GcQ?(dUmI=i0`9csYul7TM-g zxTOkPfI2noz3zk`S*FOee~Z5IOF&!>_55;oU#?pUPBss*4Z%uHh4br!JsCKCQW=t^ zeR5cl=}B`q4+d90aR!ZWZz#Xd+ye?9LT{oLJ`Id>9QCM8M>UumiF%w^r`4x9f-%%n z+@1(&JuXMuFZ6VH%4;~b6JS1!HVoJfnoI;e<^UD|RsnM0UkMj9%8#82{gOp1>w?%V z>dAI|fnM)|XoVE0)frhjjK^r8*CgcgW(QZPy_>D$Qpe+55;}DP}*i8Fl zm?^EKJP#mk%8zjP67JjR+vrwueg)ME8*xEgwI1-+b9F0mH+Qow-eIbL6X%oau`K0; zh7(Ey)p*-v<8DS@KLgrZCCVlDRO8gPNXmO)Pn8XKXq`0DG2x;U=TjQ=v8%1T@)bzw zC`a(S87I|4jB7Uf&tfqgI&?7GnV11QYMtMpp6=#pWhxWWutGDt$%kY#SQVGL+!oB` zdq4SRTWcI+>nkVIGwpG$b7ot=fovZWRyr#uKVhpy*=GMN{v)CI$3pQF7iRRwALq`t zf*QzWVJK7`tSHE?wHY;CW;6k}q%jLk;Q&aeKu-15}Nz zS3oz{V)xzsVb}PJ;QzWM&^dEYaHJ2GYPuAHxMZ1x)nN}t)@((U*_Pn&X}HwS=com> zS_X-4b^c#w{X~r--fE**_xh_nfddxZqB$Elk?m3wSsAAn!+QtYS3Q4PNh^-L#8-(S5~3 zxSD|jl}F!@T4F%2@tr>fSbU4q3bk-n`fbK(g<3c*{hq*Sgz>Nxw&NTA>yirQbt1txyYplz#W)v_dV^OTW8uTA>zpNWa_tH{tmmoLmHVKQZAQvpg1{bByxF4D6+I z!l+*7;qM1?nJH)DjA7E*$B^P-MUcIQ_E(K?7@X~aWYNm5V4SejIE+4QY%=y>DFp3z zzlSiV5$2JuA3g6m^o7fD@_wdAk@Z*iWrr7fdQEn>CtAu&gyw?}T?-v*Da>a*@+`Sa zQ5f((-qYaOj#?})*D5PGn zs#}8-_hVOxqlVTSdDd|5`u*G{bG^p)8|=0xltXhLtbzXqCy{G; zJ9c6dF`LvM33zvZNMUIPd|ph0Ej`T|1=a%*{IdE->Id@0^_)=EQ+O~Msl+3V-(c@U zc#ad+^sL67Ua@p9AmCjKO#vP5udZkcG&U_xJTM2wiATVD`yn~v4epNzosr0EVhG3J z>8H9#4XV5l2)fT<-K{ax`AfiC0o}mm24&WY@LFm%_h6+<@8l zGd*g4EAL$7U$of*+t(FxtPYrNbGu#z$(ooysTHT{NM?s#r-F~5)H6a5`T0DKeDCM`(@8>Z7Y3j?6I4Uwatg6`jzre z6Fa>h^~i34Is35dY_^yIZON3|S6EGL--mZoX1(08&obnM1{yJ|ot@tIdo-ic9vNjH z+*~MTObg~W@`Oq-b;)a?w}P#-{JB{rq<5|4??oT5wOc`!5wu4=no$fkpgO(J_l&Zq zJ<{UY23xfs?NwqIloRIonmuIWVy%;MWSJ)+13~3L4tDp+^C$!MaE@LO)3#g?HR~>j ztl|M)*YZC4J`Ofw7;bbB&W}OgYPNm9B>|F-in(lLmn*}e$!I&1_Pe**HF9pkrIYDT zt+sT#%pIAj7<)F`z^Noh_(X4pquB!qQN?CUoC`9A!+u#`uUm3qr+Q`lR@9fewk?tB zOIbCdc!+IK5nHdUHg}B0t-0yFgvF=+*?c(l&82EVbA`S#wORGXuol`| z^@HEH1FV&>Q+z-4cLU}C9tS-5zylAggP+23RO_4i$ewvN!l&E#7pIYDbQ|oGs%BG^xdNX1CEoQBdEJ69zRqtLR90(U`cWYo7N46WI z)dPyxRG3RCD^|7oq+4 zoWG(p)+T}zEmfAMPh1d(?p;%wfmW36e=gL9-jdqT=C*t$Ps=(d+qB;j>pBISjc++@ zc6~;I9j63V*0I(Z>?f{t(P;dtAG56q3fMGN#!}k%Bvx6boWQ-ZfU-ti>rAY+e07rK zi{<=mXth;CR`e53r}tmJzC45N_LD@}%_F&VoOG*&!;n>>GuZc>#|9Y%wY=J*am__p zW*6NBK3g0^wI=U@o-nDm+SWx_y<_k6e&Tz}VR%fRQQEAimDOq>TiW^CiE1OyS771WClVJ zAJAILjGp`}^n>gD%~G8|<}#vHqrQLE<5r^u$D_VqM}0$wCQB^V+w>uBGI!L*P@n#Y zpQw4Mdm4T-yJ;^-c$wzZlRE#fXJ6Y)vIeRg;ZF7RwZWVa@88%4sqIl4JO}qnz|aRU zwgG~)yNtaVweX6MH~_09*lqCdmTdyZ7-!lO?Qc2s8B{ly`>FSRhje0`(a zv&AcIt3s5RlS*{>hcDQwsJ35*B<&wUW7|!bWjYuAuxL9*wkMvEMz-+2o|4)Xjcm1O zSGDLViO!h2OYLeYuwPuX$TlB+WRvgIl`vHuQkabtq@GsYH!>bX{Jx&{4aBD%dbLo} zZMV(AxQFwL+`A!txI{*6HQ=rBW$<@FZk~e->Eglima)t3$}kJD&&*DyKGf^x3^Q$0 z5%1wtn=Rm7>4Sv0(A&pvjWTQt=7hP0@>C?`p}s&5LcG2&ep5k*n_7uk8;7*RAw`Tn3}qPV zT!|8NcPn>9wC9Em<{xvI9Aj`pClUG;Xlyb33STb(4=)1{FYg2#2gsH^Z!rteE9Ul7 z{3GP^Tq=#Lx?6C+zWdGsm%Fi4{)QaZ=a^;-*@K%k<|(vKth}#QWFWp&S1xAQi z;W^-N%#Cy&{LmtQ9XhLp*gmTLYFhi^-$Yte_v?`wQST+Ro(p0Qb}6z}n6>LcxqCr5 zs{5a6{yxSpN>(xujaq#y)Rhv68E;P3~{eihQFZZZ=?tD zZ(q&NN7{3W?nTX)W8UPbcnA3RbSZa4?jFRaIntk6EbYc*R#08`)kP`dycev+n*-iU zUArw;+!sXCmf}+7E;f81Zabm%R&ck-M=9HN%Ij{_ZP*1-UtyUlfAbDVJ#ljIDzt>F zD&!+!-6ngiMfbrX1NI~i~rmXy*dW{jbtv=<=4{3tE z$4GIgEg8K)1$vJpY1aH_r1x}J27e#UoR~1ASA$VaEhLCZwwTcDn)(;L&4qA|E=}rO z%&eIZ-U|%CLrfUFGSuoq{FC%E+Q*>{T}0cUIT5v^p%4DN&Fpyp{r8u_uM$AKcFz3_ zG@}H0mQ`&j+G0D2e6y&$>I2B_^A#xXaP+dj;MO93+0d1s1j6ce6xPFQBo zgjR%GylB(QTc9cL5@>me8QOpNo5(81KlS_I?%#@yNHNH9*Aa3d(mRxzk5eG5J;g$# zCl^5h-Cd$);;jqq1+mr|D-#|EEx>D$poX@uAJ9tuz#ABK-k|jqdc2MT*dMJ5O7rCN zjj5F8D)HbY?ABKH@w@UD`4=HZUFu9p-^IhoUj-eVl)t?o3hM#nM}7H?JuLF8Mt)_; zPgRY(FICQhV9zs?-;16n;I)YlqvW^PvOv?8)GW}{BGSFh*C<`7Eu63T-;6-G=_2() zNw!3^h3`S{!9*FUEqsX8<$phdF4gSPj0bP1g!g&}ASD_@wU|Sc3jdHs(O$1Na4SC# zqbRIM`Uit|w}UVHc=r^Ze+1|qkc9ydUlTu<04niLV*!l|*~{jEk4h@INyJA@$fv2O z$@VXj{|`|S8lMQ)5&urfH^Ik4LN%9x`X^jp4ww=zh(}lK#+m@D4rg!->qL5+DZR*Y zjC~LMw6gvMFZ8Xg-$30QDcB&jtv7&EO;L^QI@0(xXT&j{Pngf)RLIG-q!0~ z8ZZHabwY0+KL@oJ{i;XaqYANb}tfgRIg?slsPuj|X3Dwe4%-oeR z)LMJJ!vY!ne5sB;_hs@l)0vO9SncE{5WR6{tg5W24B^!=z22yPivP{|zo+?ufw5 zy4QQWR|cBT&z#`qZtDilx7cn$In5nWF*k$e4ZTG3un^4)T>qPPkzpH-6bR>G*ppd< z)nKo8T`zHusz+8GC9S_zLg5i+*!}}_aG?h}?qLQ8Kn++8zkv5&hd9GWKVU8?yf4R~9TPQW__TBMI( zq&ZSw`*ER-m=^xjPG;ko8Nx_gUgSa#8}Te+UqCtmxVtW~5#v0ZVL0-A`XYs>K`zjj zR3t0x^{PIsM%-P0g3hFdQBy{hjJA!&`52vm22bXCy|KMnpgWx=M&tCa*BjoO9(s?J z-sQd2lhF4#>D||3480GO-mmr;Lhm<8?`=JUib*P(o58BaVEv4FHn{qF58b6q4EdYj zPq%#9dZ=%qwCSX>*ZWmZ4BiKYPWpPipY#OJ=VoI(+=+6~SzpPb;CUZ|8xP0=Oa#yw zUNV5r@$7hak{{?G=VxAKQTdmdjAf9Rw{SlJg?DNl0{JFmj zJ7QUaTBmQ=*=~*uD|wWMJt^CU0-u|umRwN-l&R21_h`u#xv4}nB$tSata4u8_^%Il zefuWP7D#^8SU=Q+TM=nYSm8`rQd_7Ja=PX%s)1|j+OlXP+^nwe7FEMd>q=St8r-2> z^Bk|jHFRxpyaG45>pRB=xba;n3#;J9brtc0uSN?G(WTt(Ns z#V^5SU0W8v2-h#JE&Oh=3Ub3n$35!dr=Evj2cFNVGNEs@#duQ8x~*D0>QvwJ-7Mnt zijoatI`-6l=U$GdG(45M|Er|z#oE0|;PhY|Sm!<4>rq4h49EW#X?`xsg*$ze?#WY+ zjB<70xo-Juhxj z|L)X0xU=EY>%0$733$5ZoP(!tU=999=iPX!#nboB`;gA_;y%y4aGw?D6artp3iAJi zH>LQsbE>Th&zsasPnAed@#+Uo6-iHLRQH~mEIlQvvQF8M!u{g&o)Wn8#1f>Gj+Evg zrF7FbYU`5MA=)L7{$Q5Ak_98#Jn&cTg` z7UTHBlVZ*w)W3MQ^nMH8bMc-fmUwayE=~NqCmZfivBEPJu0i~rXAInA(d{w8jTb-n zjD{O0HhD(D)r%i^M#9yJuY0oKYQznmOt=d11(FNG{&*eQ!BKz<&;k$u3}-5OfB|3v zm;uuOc0f7638(~Y2DkvEJE#usj{rYlHe`wf$Qd!XbUw2R&((l9fC10~cpR_004;gUI9<#(tgvux$8@+OB9}wg%{8|iR?5za z3RXUO3HlWW(x5h~6uNu$^$J_E9XBn68PKpVx>n8CH_ieLH4RFktyfboFVx_h72mpC zX(o;IO}C%nX10Q)eKNT!CcMxs-TG+5Inm@ud|Oc`e;*P9N!)rSa6Pg*=qGHGW~Fv&M@qRVK)prnNd0&H0UwyPHX-Z z1wdxiXO|U-?)+rZI8GX7pmAI`z_qhofzY_8W{S7MUYl(t?6v8j?{((jL|A?M)84Dz z={~adHgmAo6A%4}9UeJsIeZUZiOQIDCa4YF{{KuH`ndm58+yMcbm08oX+sa{b)WI; zy3!~2=}P|>bfup~*;ZR3Bwg`glCJm_kVXEvrg%$z{@^gu4F3f*!~f-ZNqanv2~X8? zx8@J##*>D5uB8mp#fTS$aHE}xUROEt(epl}PyF*}y=}0}%C%Hlv=nLxgIyz*?sdl` za;~f1SGx@u6V}(0{B)RA)-tpHc}tiJ648^8T6lb-c`r$LmrsTSwv;OPV_DL{h!$8! znv`9?R+53Ov3On8iRF_wK{}b-uw`E4Ehqg}RG!f+!{?5NKcx}8NB2UVfrjdRiK_6Bs7__htB-aRr$VXjqwGP^I zak5d5oF%(cuv+BIG(g*K)WdEz>M6GgHkUM}{XDEd)eP7ev@on!7#f5Rzv#caZ&(i+jrt}xUDhXls z3UsPFJKk}gNKCbwjPD?(v7F0!3$-*5d#p_O%&EgE4Qb6^Y~5ge#j>g?ewiMpgc}NI zU*fu(r8hU(`LOf4HuO%$`wLb#K?2=G;q3)pw{+t2ay(BtzUor6JZTvzl`g_H!{)>J zzvYx>w5(}BEu}R8H*O4(Y}6{3>^;aIR({~~cBp+ZOHBL$OOmLwb0W8R6KG9+jc|gi ze!@ekE^|%iWutkQX7pm0e)IHJQt zZ4BkycrJ(Hlh*WaJp*cG6N35YdoYFG=SD2JGxL$VEQj}uRV=@z+w-L5gS|m2OoD#b zr#zouJu08g1#waCdDO$DZ)ul>ku__ic0pi^jO!kz?mzbzKk<*V_Et&cV5!y zdS-mqvbITH4lBYFHGEJa1!dOFgw{6$tR`?_dPrSgxXcN)TJ3Av;9r&YWv%uFwzb^^ z-7yKUefyp>1KiR8IiEnzC_F)zFzB(h-4Qvr`=#Cw+hd|w#|CFwcVzEi=pNI$9GNv} zY2eIoCe%6K;J@Kx`K|54WHU2Z$0xAx7bDbi$Jqa$|F0SS|4%7Eo8Z5N`5PC{{Zoof z@&9?l_nq8sDg1c+R!UE&xf19}nZZBkDG~H=%it>D&V_4$dk6Q@l_ zsb!Dxx1Y(#TyvRfC+9<;C4Zi(MO6zxztmg-Np0&u&3^U5hYtX7K$@d)8 z^La@ZFKOG=|A(`;fs3-r{=lD?d1sVCFcDCP8B_!`6iiCXae&7GR7h>JwA~S`MzkVr z({0-vL|a#F!yc^LAg(J@?#m?>+b2bF?Ewwf1?dwnL-6+H6gF8I+ZaSge7|r1}vAf8X_G8=y?2 zaw$J5_j+3lD3&bq>&zc^ER5E6C_n+PJDJYcoF8`Bz>$vQ>WH?8e{n*u%?OVd;H2yK z_S=gcOz7M&7f5n6F+?S`2)!k(+qJ1J3H%JXp>`-;-0s{1PC$Cnd3J^kZtb4|8#s40J9-!RX_fWHH?0Y?^N&N`V9z61&jL1r zcHpk$Ho{)9sN)HP%esEEo3OPI?X{vQ(q62Az1b4%E^XTs(V{n)^E?`})l-(FfOmvs zy)FfHPB&oX_%m+T1*xQ7%wBl+%Ee94vYF^%Gy0w_8_WZP5iY`JRsn-dN}(12k?IM?k5+wLJu)KA^Gd`2`ok;BWPz;lauP2Sqc7`lsGSM z9yn~&*%d->P3>~pt?%x*xB~r)FuSbl+1)FItDbqnH0n>NVWjoey}Rim`Gz7sSSf7S zQ{3gO=u79E#ODKwYFZn9Sw;R-1_a^5d_4Bt&@$(jZ!hd8@%7Z#5=4#e3rXL4P53SJ z+u~Y>xQC|0!c~Ul+VDz}iPlq#L+PKL#r(7n!Y>PL-#_L^AUP3+&$2(WrXs><2jWnnTvybX)RMo3;p6RRi^^Ix!pP2rj&OAetWy`DHyT+(L$V)qgIO*E;v4XaBR+6^*{``Rz+B$Hw>_$Q3n$U3P(p;Nm zj!NAqs5@BokEi)f>}Vby<|r1OtfSm7UA!N@tisvE5gLW-;1Sncjl$SMYW+P7`6 zN@Wr4mDmf^K@?GW&3k8%6QXb)M+FN2Faqz*k|MiM+BzmR&$TIkV%J}H!5TF`M*T)R zuTZ!1+6bf*uWx*pttG55X%;cPQiU7|DvLO@QUx1L5v)~SY!rUR(r9&&VClHvRMar0 zs2WC4a{p3!QdD|0c^aSlE_!XHSxM`m$nvkoy3ag*jXbKZuTzidTmD->yB7a!zQ?6Dq_1BE4A2ec;G4# zl(n7S-F~)?!-@QFRj7L+(^2pIjl$A#%Bid1>$K1X;x}w**Kz&xzG~B@esqVJ;oU2b!ibFsnL z>UmJL{j?cA{J!xR8gubZW2{x4JZ%OpPk4yl6|ZU6f0`E~=vt>GX(A`0Fl zs6o9?yW*GLGiQ^4b6TUWx>qMm?0RfxgfbX&R7L;16>ZwO(Q0a2qW+&LY~uBYcT(G) zy`*A~!ur%#Z4qu*0tq|p0zj|oE&r`_>+^mEt<`3iwr*S7HSg`vEM#PBXezU++UNZ- z9HHrrZOAifI(A*Vy_3TcINrIav(NP?YfFSK?{9i=TjJrM=fiD?aJY%yS9e8ta`evZ zi~4oYpQxR&lmj1Qhu2=r5V-YY1wlBDbyb^ZwRK|Gkat%nto7jiUwYqv?Ws^}P7iWI zcjMr%)%w#qXR4=I$h_F0?sIC9GV1i@0fX!h+QZ)VgXh$LJ@sp)&Teb6*>Cd>|GTpY#RG}rUX05OUO>T9)Wr3106l56!Gnh0g|1^b03Gd zNhZ-9*JZi=*tN=O$FAx0$F3>I9KFWHXj~s+^eMg^YaWCJ&?)Kz zj0pP?M#EvMKLfvOiG7)XJ}dvmkrH~Mn6T-JIKAJ=hT4C`5n;if@`0^l)F1ZhctDPG z8;}BMpsxdHd){+61#{$@g*gJBKJ*T9%c8pZv(@Zr)by|ddrcd|77Z*yQGC=Bwi|4< z^OZ&YurBGzDN+W$Q91u_--i{|SnqJrf2zySRq-3x19F**j$B)wZO*G>j$EtCNCG^0 zgZ1!rmIC|TQ{Z(i!EO*MmPNY~C|+r7B;L#fif2*yaav8bIEz?^V+%f8@Wiz^xcT|4 ztY|)bSuQS`3%S_!wLIT>KDK#*QCw!>a=$LCEjNiyYfSE@(yw8ikgN&0Q9A?&Zqds0}k7*KOGF zxO&6A`&dX?_E&QFA6*H(5h1clU`9yp)kUlGHBGNTYec(z)y?}u%b)ML*EHeGdMV^I zm71PZl{O|hl73l{)7Bne4$J8^)+gIJ?uhtZ<+DX>4YR4r`gA+X9}$0D$)=pW#2A(q zGG?E5cgT|ZB>Y~bHcd2Q&D-~>e5d&9Dy(qyu!!?HzY+X3=L;#XRrT^0lH~|rYpA2N zKJSJQ%@X>s9M0lL3-`-*A${IeAp_;cbJhBF{0V~@JkzY-U=r??zmJE#z$KwQ*O@1% zL{8u~rJ^R`MeLZ>*85xZbK z9B^!(cX~)6+B`>Fc^Zw7dlsZ#~`7)70MnH$T4vkYbl z-`-$SA^djN#aYZ^1#c3va?^4(o6V@B=@D&h*(185guGZmU0eG|q&>-gCT8PiqBkbK z&x>@ae>YJ{SE5Pg)7tS2+0h){ID%-?KK+8`2yl`R<}|qtQI~jJ|_h~zB~{V$1}+r^Phxvq*E+ezHlINQE{d}3p0{72&-@+ zg}keog?R%r1p!~a8EA)A>E`_BprPj!pR6R!{;1p^+>Cjkpx!VDmW1H_vhM9dUVM>H z&y9Meza>pD<<9qPlc{zlEY59iV^g}@*iHIc?iB_!!*wbHyoncH4=CA~Jiay`c;^C& z&S9+2J0Y0sVQXJ3sdPwfcHK_lSsDJs%)zcOb+}x|wcbM3dP{BvCC zaJCiaaRhcEBc7>*eS>x#BgfNUJ8?E1SXG^qu6%@0X>I4!obi2OQc@NCuV@6JgHeqT zevF?WOvaa(c0D@}-t1PP?h1ude510yL&J{F^|(nBArT)4;z>S|a3795_ko>pw?8oQg`8i&rY<#zfNvpsWq z>UTu^edY9`8UMx~(xI97+R1%_V%^NC?B;KuGex6wV8$gu)I+_ebke3UVK1j+7aMK>)_2s(V+@({k8^Fu?cx4Y!N#2km1*z5iZ zqPWO+pLcwK*`y68cbEpj@hur-cpXGw-Na6TxIG5^`R7_{Yt{Ds>%MBq}K!0sEc-!MKG z=j)v&SmU+Gyz3i3S9c_y@LQH-Lhl$aOzvRR&x1QcmjoETaIzXRPVh0zW1<4OtZjj) z>9KjrfVNYEUa>8p>7Vxhf>-eM>4e*6CLLJV>W^SX!62|CikMrH~Yrd7yH&puo%zxqg3%tD@t_fU2Yfb&>Id#=(sF&(MTYlij(Tbqn_Owp=bkEY%`zM^ z!Y_>*xf`*TNyp3?b_?LEaq9J!Yo4>cWi+dQ14iv$I1lmw65Rh+$S)`n5zYH@>WtZ2wtB%k)zDPK0I!*fn-&WqyWz-MG^R>S>oN`}W1|hrYw2XS1NEQDl)a zEDF#nQOObMNT$4c!^?bJv+g(E3Q+0Id&LRW#0k5RLD!=W^l@mcKqX7dxux`_8nZlGA_? za~0NG)J2~<(7PB8ed05m$EETgroN1_MqHD#uh#UwZ6Nm&L( z`%y)yUDlq%dWGP!T>G3ii}qZy%TDD|nOJc#tZBIgZNAfY!X1ub+|2S9$X4zn&>V=C-uX_FP=v;Lh=|Fk@#$|&@Df$8<whJa+ z9Mj#t`fHW$RC#$C?B~GC2hPXky4zRhiUz)YdD&`O9x0^;L&vP>Bv_70I@*+CEbC!k}6>oJ5N0_mkl4P*uQIn+|=BHKR2T`!@84?|m@`>cU{>ui0xtnvHu zEX1mr94|x6x=3aL%WPG2HNbBO`7j#Mj~BOwnmvSbyl-07Qzn&%bt!Dc-G-Ciu!+8p z$`j=B$WB{v*G`o8Jj$zsUBk>)+Ot%<$d*5yv*?oT?b;_lA>Pk~yyHU=?_E?z$eZ2s z6tPTxKgur)xjak%&vJD)%e8b?Aw^+Nx!M0`x#8fg?fK`@8f2I(zW1|qC3`va&@u}|2eY_ZpoT^>%1p|@O9|C0Uwh&mc z2A>B7FIKg}u0ns?D!jQf_!X=M#@Z(1J}dZ?CklRBcyV4p3!BcAVnpz?M+KYTy!c>1 z0qX+vZbRnbXI2w*7=hno!0%>+B+TJNTnXPf2=fpsWZVC(4ROHHY`;n{I*zIn zPqC?n7V?|RjNIO|5_rgwlmaY{nWJoG`)Jf^8cwoRz}M9TWtWF+85~Bb7XoKIyp6t2 z^n;Tqf0WDL-qXH0`}?E!SsET|C|j8JyF|wb2lZ&8Bn2p99MT^Ph;r}EIh?m1Iyn^t zTYrqID#6~+r$Lh;TaZ7z7^!C?btY1iJunVl3Wg!|w!jrn&i|QigriPQmHK3Fy4#TM zPe_;1lg_YzfNj7O*r4_g06zEnZ^Qp?`G2RsKkna_|KIe-;eM<9U+<5_{VVc+t-owx zdPCj(84YBiBH9)|IT~K8-a;Ao2g(+9LaR6qb+V&PQgNMwum_+lJ z9yWBE<~n|h^g38|&2UrdcHBLJd=^aW^zMTlg~f9Dwaz-nqoDPg$w&6Gsmoj=1V;}9 zF(1@BI=!zV=6T0FCb+)s0}DH*ME9lyczS9t!|&5t}H!}&f+n&!Uu zCY&n(CzHO*6@m1fZ_YbrAkATBS@=!>jb}Ld=;>|$3$;6w_TnXUIBIt)`&aepmAEAq$ab1d#f{=l*3ZWXI zm)^2*Z(I-EV_a(xHX|tTY(U7v{Y->%JUxMEaTlNb4w;|32mj>256diWV6khk8#hY(npCdOm-T4)GxE`bN7%Rqq z-v=H_*Xy@~8Fk!MwvecmxZ}s*htW*M;VXcj<}oymRyQ!o$1cUiXiSm3(|u(N6CLRd z$bpSmC5nfJZDgD+?n=V=9PhgbI(W7x4+*x($x7=}t}ROLbo=T$Kzx_|UGcbRHVQ~DZSw5ZY_yRg^RWEqxGb**7}vBGoQ3d}Q?&5=KYkFhByJp%s*AEMiTzk=|&%}8Q z*s>wMaCxDkL(drPgjJdme<(4qM$KlWugQ3rc2?7?7A!0Ve6t-Y*hi_EeAuHf^5Qt8 zZpBO|?EO5DzGmUWh*27wOL0}nvmF%gBiMwD0=`#*Ce}+;7_Vq9^fsQ>NU+_7*<*3n zUBJ@{iFC2o_TcG_Mc9`^pt)mzdFIHZPH{1}PjZ>p{91WHFr9wnF=kY;Ys6CBh(2!f znprB{>9U1=lI!G_o0P=4Gh4&n=K>>^mMt_2b&i_JtWcPgDRjBmiKM;oom=+hP|4nX zkDzHSTNr~l@`#vf{D!?pboGa3oGz^sInP!Vi+$K1k$WVcw51-;fruxFN>;W=S`;`4 z%e^|(;}O)uDDCjP)vnS+@~7ExaaSYW$4T2!zcW4c`yAKL<@!m*{e>F2S3D?NRh@wv zwkSUm;!X(ymH7=|w}g%7L%0yMYIZJ@~DQY@7`4?p*agyuM=>UjK4F zEBs5+w3Z0)3Lb2hb*)dkSuw7Ad%IfuchB~Al{Ql9N3g?ArDK(d7JY6ECvFM9;vqkR zmd?@rIGoAY?>W>{-<`Npo5DLOs4d5}^*J^@tJ%EfYh^!RHbPhGWNHEPnxT);?!LL| z;eDx?-L044i*JqT;n~WVNX*jNj^3CLQ_M1R)pe}KFpmSpmOYHI$TZubknxi8K{t8{uQ1kg%*pU;A|kmq3S zCc4o4Tkkt-*SNH!_ql-I_w39 zq3P4)4l+!C=soujF*vBlF!|jK6N7iyZ)DB@PoL~%M}YPxE1{dijbL4535#r9Ssn{} zqd!nQ#$-I`!dX_QvSXGSGBqvVIvSEhR-6=CurO7ondQ)I2~W%sMz~;$EVOl%$-zNa zaO; z@njFo==ZLL9YL~DeB9HH(fU0XN>`DkjPBspRo|`JV7;g5L_)hvcdW2Efxh^HOh&z{ zeLndICHUhftK{|K24G@M_bZ<57*j;lcjjV@cfdR0T(h6UY|AOku@c(h!3hEjEeU%6N{~tEL_5*Ch&3MGgSEe( z8>AV^nl}o`)v13gS`uF8fH1rV5#QB`$CzRg-;LROsc!sHf4!x=dXVY)n9`p|FCObZ? zI4-ym9y*x~8dHprC5%G3iV#k|89CVW;nK&srmIJvVsK^C?{x84dCi?4wbTsD>b#rI zjhNE{t}XNH9Wi;ICG<&{XC%#p*7+n~OId(D*)c)y{ULT7BoC^ycp6}1HqyH5B%s{s zR=vuMs&;1zcgq^5F(~;T!GC%TxE>9D=849&DfkaqqvzoB=%}X;u73?SdFG+b7a|-& zID$ZPaXLrFJO$gb2=NGdgcO8Kgb4`LPMmQA+UeImv{MRaR>UqxwZUf~J-4%g@<_JH6XFd~XaHu*o$``C}cIf#* zuFTc&5bAir3O>vEVZ)B$s7*=$#dyHN!lw?KP1wl}Zp}a8#y;Z61Mbw`o%m#S-I&$P zdP<=|98>T^(5Dl1e+q$cwHep<5C~Vta3!25WSpFm2q%hP;3V5NwrK1xaN@=JFAlcm z2`9G$Cr5yj9|OHOvD|`_@&5%UoQ#u^H*wPG2To+_EWC*m(ZAP`HJ`BZ5@CfIH(jqjTRO`bET z_bCLz2lHFZR}lywIk*x&c;jC{BU5C2@V$N68tKb-7u{pK2l&Y8p^+5O$P+R?7Rva@ z0X{CEe?J_cJ`2x5ppw6a^k^l>wIcm>5BlpcP>7Bw+hcB*M0CT`WEOU(Z;Ng5!gF8 zacE$_^^{w+naMchHVOmezO{5dSyx{nd@dY#cG?SG-`*(V#05>xc2xlt@U+8b2^>fNwX* zCW>-wcTVZkk*Rr5cz`$>Fn0oH+Bor_uu;!O`P^fGyU#&O|L`kcnkA@!xrC4on1glR zvr6PtgZ}zQkeQfqN>!_P_^ri1V`_|_^xo<_S$)~=R>=IYMFZZrB`Mtf1Ev3G~ zR1+nw@y|k?$8@vV{ZQ)_{%uy58+*TU|9;;+OXx3SkxAy(HLPaWb>7m?9`_$WKf3~4 zbRiIq;-7|1ECj;M6kG{ED)ci>Gy*@G6xA>K*?;3bxsc$1|3ky=XWnzCzqg;Q4gTM} zXBzNxEAP4Izu;#=1V2CXo;ClA_k?`Z%iah@c+U;r|KL4qe&#(FWLxePsQWww!bvr* z+YtyShj1mFXk?msxf|Sg5Lv_5=Bn0@F9O9_ssy5yJ8eWM#E-%MedDGQM*iv}jEn`f zoC3A%@zMAghw+gph6Pqqd&b9!KU2-nUXFZJV#hv|KN?gsROZP0r2nLv1}VE-)nQ~- z$Q&6nW7dfIz=|I3!>{X@4+@wMPCGwRTcVxEV3`i{-w->NMzBYG59NR1R$ye?hmkEp zH~*QA_|d(-_dPD)q8UNvM@z5=fL~@Y*F?v`15eI6^HZx zgr!ly(xG|;@T5dvFYP=Y(10^2g&zLA2V)j-BpS2sV8zkWn^xk_!%Aq(GD-b!;Yg7& z%P6(ahi_ohj`_q{x1nzl4%!iupU~g-wR%<)$tu5>pX=1HY16@~W;M~M)q=bu{JGK1 zh%>_^nc&1P;bkwPJ2VepJ?`TX2rpV0FH1uaegj)UksJDZHUX%=DTfj+aL_hEE?NyaR z)>(|_b{;$jc*%wxlJK1T;ja5Jf5VwG@#XNqo^fk0=8&o2)X*;qZ;~{|{VC;uA`Pm$8>eXg;D?Fx(Ow)^fSmq^! zI)v8|-a>d6VI0CfghqrvA<$grj3?~fg^Ec{PA(4?^5-lK1Fs`l+nw3G0iJ9O;hDR_zJhv{DB=Y$eh>|C?~SW2^N> zv&zPbr^6(%fgjpuP|qWn!y)YaeT44GPuP8Ojc8wD1x~-ikNn&0c8qa({6W|9$pAw}=E!Q&0} z?HUzq{ujkLhByvcqfQKUjDh{QRH4KBieJ;X0mjGz)eZS0Te2NiXnhy~%l&>sW1OV1BsCcBXvptu z9@2WlakT-fC6hx4c!OcH@Plwwm;mjwf$-DDwQ{77pA|>vNj^K&VT|Tnhj8XG%e}+e zaZ;Ds&!ssy9&p|zC|rpR5eWRyVVhu!t+*4dqzPkhXzW(cofxg5IT6;;357)BZh`LY zuoo~En7+}iGtL+GKnDBb*J*%qG~Qk5?yadVwbix5`q_y?9j0i)MXYNZ_Q$`J7|R=Z z^Khb?9PnO+KT+vL1Nc@>H7kzojzS-! z6kDyj7X8#nFQYL!RnBL#_4-LlM}2L`htLD-q1E?LN9uFEeGR_Sin*n*`jl1*Yh%oC zV;a_T#dixz*PI5E5P9;s(g#C%SV` z_kY2k&xQI*p&k+<#hyY?$1GsyI(DbTMxt{CW>P9R&E<<)bdegW(oR^tkOmD?V4ZBR(efdVNQL`&*sseTv z*?xr8KZIt=rQdK9RyjcM)M3IU(M>OI38!pozq6|wNJD_@&?{7}GbN4wNr&i74Cu4t z;f+u~2iA_k6TtgOL%XS>A!k1i=|oY3YHDv;lW&#J0E7XmrFw;_*1nwnld0KR2*p4c43qW^S@G#Zd|_+_dO}kW=_pUC ztKwObL#b~`%OmZ~Fxh z}ohPUei1~&g!q>yB+!V>bn+ypQ4keHqW1bZO486l|T9U`0z zgO5pq<)K*6aSuFt;EH(9-+(Q?p=R>2sp*7qBTDOM#R*DkW3uazwH$MSFe@GooRhki zBjDs^*lUN^gTOb5sTmFib|Afc@ONd{AK+TZtDI)797hGc*isTn(FAI>FZmL!$=aL z2xK_u9ec+<>y0yj^Qqq;wGS(H_`rmB4a}86XT80I5qXsGZOA0dDEJlPUG!%-kf!3Q z_e)sDckZ?0M3(*9kX+zm%wQ_3A2VWNSHfzLRL4(L*N;o{V})fm zUfrd?e(p(qXOm$I&g3QM8S?_(wV;N5px90Em7s34t>F`O`6-zWN{N17wKm;YyNkwm zqL6Do`eNvzkY#PFFdO+o{tvXVSWiJ#i5O3|5p<8NRJA{^QnafKM9HHv1KxW7))xrt zy>+-(ptooJZ@vI-cgOpC-(0!A?L-0#7{PNEC+D@s2fPyiU!sjDA|a1SUXE4*wEZZ~ zz&ylhZlV>cvx{3 z&Pq@0I{t3hJ3n;nBH@~Fo{3-q{#l#f8-V|h<7gMnepXcaDjIY>yo*iN;%ir!HFDy4 z>9DN-_(db_ajga~O!JfO)iI=_wC{ocO`!IJe^27uvMwXW>zw_nDXOVEt%?)y*EPOo z@=mKC^S2yJ(EHTE5{z355#$*I%^KwR$|=fU#3z5i6A+K$8{k_Wo?0MLVaDj8dsN)T zlrbhw)`v{R*vUbbWw2l$;zQC6Y6hJDf&`=YZQ+O7MA&EpoW}vL9aqi%tKJcT8{Qp3 zRvhHx#TR^>nB@z5KMTW;yN?kMOYlP_abgEXWDVe;dU4{bA27hl-#(yq+*PkOpuh@z zqin|tnzKedp8kp_g5;{V`vV5&);6!Eh6qpBxy=TH|c&AcyWGL^m zv%;}UQRYlx5HwCn7v^70rx157)}iG87dEGzNyX%w@#8S|t1NktrVhnyak%R~DPu&L zgKXZDz5B5DgK(;FO0r>2?S;=H73PS2T(ll%T*oIfqt3#AnqJR}b0LevJf!pLy%eLS3voh8PMxash6lcj(k4z=wGF;M|q&{)k@9F7xsn;@A>X#At+Gd+12 z_V=^(oAUggus1IpgR@4OWX1M?_mmV}G{j_tM@TLitv{D!=K4YftWJ>}WWS%RhZe%q zgHf1cha4)T!fF|N&&X3c4!F?f67J6@Mb^yA_wJFO{dtmR7{OftNEBp<2pZ5$eNVhTK=J3#hG{8C@u-ZYX%K_P5x3ORtzWq5o7#>$6 z-=>3-Zv(X3T>}e@_~r}`C`ju0mIoV&?D(x!tPIU7-En|{Nk8O1j5X2mrpK(ka74+z zR>z{Gbjg9eLbB%bJl4k%C?lz#>xLGg@^$crSua7q2l(##6f!OZ()%MlK+^pqoxr8| zMmm7YVT-M`f!&U|dw7`RJ!`b<&5jHOwZ-yoTO%`)t=ZlrNQybAALs+8PY<&-toUG< z!5odANDr?9`kv>pySy1?x~Pr!tA)No+CDZd5obi|t-L$6mG(Y|Vui(UHNx z&q4P}Yv+kl>{Mm&Z&_pQW6H|xU8Qj@1{x(1{<3xvBfb}=XRCuntXR9QEY~hV6ID7) zsh)8#MoRa4ySG$2yaMG@9U(iJyaM%N*Hxpn_L2`g@dGC(?gRb6%Yc&+OE8{2=VoA= z=ua};-4)_NcUua!qD}6c&WO*1A=~qTC#aM%k2n^3E+p(YLCw*3n7+3i>$!Xz%-}lf~tavn3wycW$xOAE-d0=vXx19dkMkn#2 z^&wWQfyHL>cSvRID1XjHxj$72Ez_mP+rM8*Ilb6zET@_*q`l)%CCbD6BUG7hpU;R3 zD*p(`=2m9pu;L3L`w}Xn3igP@-g(d+04$jn$gn`ye|)rHJ}7Z~_rnDa)Osvx9qxwZ zkFF)V?FA2mx4%`&Kqm8qXZW(Ar8u1$8@~MwX;5aN`<*8g9Vz?_dueIDv~=ROQp)>| z&;vK|LlTYNGNu*GL>b!dDFwwnWqg6&_7hr!EXD{0)9}?F$}6z-eEqOH)3bG17&YEd z$!2X`0?*UwU%Dm~>k2F|Ii<;yHA|Lo=);I z8=fD}6%!7DDvN<~YMPpyF`g(x%eZ7rzjlS@%q8nj}Kq%{_R zufrz?=;V2KvlPb=Ru4J}tKS8iQNk)|5JNei3#u_IDUp`mzTDaevNz3yev&$=pMx|U zVABf!c^HpU>sdyECX-lmT+({;0t@>frDjTZ|@>3ROa8|A{^KW2la#l%KxEY zCCVfmR9pN02M&s0{iaB$w*JOnWy+A#vW9TkQpDa^{5-{#^B?1qpfCs1N zDR3X6ls~{T+G0(78{IF#eWIpcn}~70Y7g=9=YkoIZPpl9RB_ZaSVIzR!4y1eUEsT% zM)rd+F=%$|ux1L7?0`cof-hb1@GPPy1ZjUXPE8Dg-cjnl_i-93@dP_k*%BxFv0m1X zfj;nE0tY=O=-)^6y?oBpz){yWs#Ii0d38}a+w35^;+C@1?d}t@X-@+HDb@s$ciKv zodv6eKC%kps zQhskAOzJ&2CqwgXnwOXhQjq6|CRhjxnr`wt)Lc!x;()(wJ}{wt z1zJtdCwzYpAg!se_f0=5)(1)6Bp%+n=DRhuum}rz zv#_;_zW&AE0evwo$~=rRGlPvD((l0706qIe=7Prt_-Ty4g7Ka3NBa=Hnyz=raDV9| zxHAeyB99RA=o@55WxM!MMef~uv3GEzdvUGxZedb0>LAade&ye~<{;pYYmw`sehu@1 zFz6-hy@dYZgYM#J;bIl$cz`<(aMS$gVpU`wWx?$42F@?gS)Pf&aB~2fnmzfZ`GFan zNDku!RoHt}&g)LhceWv~6y!BH*b1H3{>;DRlK}9>)|AszH>y|UT#E}j!jR7;Gw@}B z+&E?^=*@)of0D){=!s!YaqN;dYiQ}VC9hYNf(AXNg5FryB*pK8s5N8h;U8tb?4iCTmA zf0DoGKFG&{5h|_(|;3B*c zv!t*>s39)GGA0Hz1bT`AJyo#D^;JYkrqV4-=7PIrU?=ki?jF?gRZ_d1$WqJ9ysF$}=4EGV~K|I2|?H^tfx3JZp4HzXHX)ioNEWG^0;+EC;o4 z!aDrN2(MZ{0nMa>HjYTFnceUR@i_Hgt&c$qG`Q!Sq<>xC3NKjL&mh|P`z7WP$lxVs z!z1(mYMnxB3G^T64r0dF?zVJ3R!UMv@PFS04{O@8q;uiW(vM*Up|o@i{1;4lZA)pz z!}j@qv<{OgX`~dHznXniTkN-qI{!*fGFDfX&IzdFTfXU@LEy>YHBw^1ke-@v_T4Yf z2K!1h(_ZajUw*?AHuE)QOK7~Zz{b@%=-M(SdS@!7x7Xyir@}N7pV)QZ?oT~5YyJWH zzhN`Q_=&iZ!XoS}?e>0zRZt%I)0v+68S&oUwwFL>L~jvVQ`*>MpEowFKr6<|XM^G= z8xB{00v!YdvVjzlQp>U(Ij$D#`;GWUadP(m=&kd^qJ_=py#&cRbOA6PwC*K&41Fi- z?y5p&y$arMNJrM|^<(XKKOS$;sh zNJcW&5d<8w8dh2r&pvqpvMup+21K$9WcgQ5Y8J!bXJ4dR7B)z=@NP`w-&^4k@=EXl ztm3c9K8|0N*QGO&ZUq9#_Nvh)%x+d(=2ye-n?m@;2hblA6l^4{y8>tO3PS(Sp$ z72m*!=R$0%7U!<|BL4ky+&;LQ4(c8ulsTeoX@I*Z%)L#cj0dy$FWiy)HR0nP#tFF= z;GTnPD#8SW%>8|es`ey7ZyEbXCFFIP2i7xjB4!0_Osj1=VJ>nq0kYL$>=R*MFyNv+ zqRm7rNUzS!*$?lg3Y>OU?zHwjk(QV&Xwf^%eB`4^Atc!~*uBZIuxOF~ha&peQDZP4 z2w(EJkiH)Iyn*l@=|KSuQ$k4%@#sI_%s1NyHT1__ zVtKlKa6>HaW|wE#QyXIBQRFR@v=KW!@B5tSffW{_k1>atj8^wl_>4|;B$TINq`T^( zH0>VjpN{&$#o;}CRs#-##|2on%ea9z1wgURr`bm^#3CncD7Hw6{o;5B#u6V}J+i@o zlYf>@D)j-B`g@;G~m>@+*VKHv^?x?iOYQ%4N>xm9Kz2h-8fe$85)#;V1AIidQ+SVAK7zg z?kTGm_c{Bk%GZGE^}^`p_HwM5T6UC|IyS|xwHjPCvyQ-8;1A`i;I|-k!76KkL(`N| z#u#f#9*m!BKcBD;UPvisA33J(RO*6y*;b6EX+)XPZg<%1d|s_RM?Ovd2f+1*ZkLC{ z>9c2XzXZ~Tnc$;Aw0|>#F3$wbbz?fsvq!ajJ}3pW4)53#;)dhY-Vd>m$m>22^i&X zJ24lBzYwe)Bz%jNzipAIZT{&?np!=)h)g_Dm^VE?t#nmWd1*fEf4ybB zT#nPmE@R$u>-3YQYWT@jM!V7=Z-w7`%<6ZB%G7Gtu!2RJJ)xp z$VLegx97`C?C4Vaw~``LgYyr$`AJQ618X54GVo=2GxF0*ceX4jeMg>w7I&>hp7TNr zu(G97JxfsTL!oV+3g9&r_bnR#)<@ImN5I{n!hW5$Es?MtmSyLU}|V<`F)Z;>A_hh>}_v^kK~~R z!vTd7-x7MhnHJ<^bZql@xT~yWCpYbTT3YM z@9x-w+mI8DoY!$KA{r}yNc&OOtHE6!Jx-!qI(?|CC;0C*c(qw6_wO*iwaDLI^3Yr& z5BOM7h4B?ZfiMN33%J>ia0Y>_YsAT?6CpL1X>JiPpma?sn2K`0M7eu$N`VpY1#C~a z7A#O_Q_tIK{q0F?r{Of(bFRhe2i!Z#_gSZaKkTzwTeg=&uO|bZWckDd&>j2FghSS3 zP;Qd`P`>fR?d5Y5?#we}C*=*y8&QgOSF;1v_kMHXD?U~ zsq3FkFhf6r)r~&*R)=pRg5|Qr@T=}l5484(`mtX%_(OY7pLVRkc#c3g?(N?>`!y!L zpoPYU&#Me+8W^0yf7s6AAA4!rrHjpqO82_KOW=!)Z_mZv z^id|_mu%y1S>6Dvcg^+Dkd&x|YK)G{*qKNV%~qsSbi^x4TqgKo^|~qT8Ju=CXm#yJ zmF_$nX5mJ^dC)>fZQe}mq9wSp1ZWBDVXH?$?!>jGIA-SSAve);FTuh+&Fq);djNRd z6`(Jj?sS3OG*%c43E89KGIh6?^J`4w7Li_?&$}WRSJ=;?!|C?w$yCl2-$Lv#=sDUw zF12^r%k6)M?KPU&h{fIBi;cu3i@Oe>4VDEA@b-4f$Czh3!rx*pjyf9ug1HFr7{r)V zk1L%ctll>WBW7e*YNMn%k}y>-F4JRl2Il7C6hJ(e)PuSHvZWDf-+KehP{Y_%!1IQW z1z+SjoOA|Sp^?p z%&R1A<|;{Jzf(|~EWqTsK!RLP3wGbY|5T&$G683v4}KH0r49|?pPDxVd#1-Fy)jcL zvmciXCEeZ$SgnB?tMoYS9QH=}Bd2grqZa@4@9vRjwczQvpD}-P6VHTS3AEe0mg>bd zlRC+@(Wk*&^Nw$RmbnqujsJmlV-MC7*9LMu2 z=&D9#c-T= zys)FBcS_ku7%{Jr7Z~FPX{<4#vp1GB7n-W2v6+NRXx1@|+i)0X;u*+N;2UpjrWx9H zE9g6|o26_9k`^YC#?o`0)N{>-Wnia#&zezMCS#1m%g%gIophSYs8drZ+S9g7R?Pah z+-EhC6p$o}UR$KZsQ!E~HQP#wzbAIKGDAx+fQu4?= zz}$1*cs6?20N-T~jp>8HS&Tv?MkL3NQCh{}Dc~cTl`Pizz_4oWHMMHU2(l6|_geI@ zKFu%vTN#S3DAzX0Vqf@+GA>G&A#K5)0Qym?5Q(u;hPwLS${@@w-*ceBT%NGhoW{9J z=hs@*&4waF0ke@c@x~k2YwPyREgzV-+Ip?oi1Am`LNpRNzf3%EkJReX6e;BR3dCRD zeHFBl0r+hQnWziN`DWohN0vie@dkXnV7C9<2Acg>yw`hlNz{d!A|^S;$zOLaf+h7V zP1Xjh->oQOdhBlNK12UR&?8h!76WTmnATWw=YcY0x`^P6L5r6X-qMahDoQKWQs7S2 z%$VN*u8v*mdtceS3fcBiaaSw2z%;1?FxT9~JLx{$?YiQ9(?_&X=3ikQ;X>Oo8&Tq* zBCMr3qH{)#Rx`pH8`tj?EVGfMnW?b1mF7yL8B7 zvUX$Hz4q@)fAkQ&m_aYOuz*GsK=XwP%N6hA&?q810apPVBYgnadh6`$!6&sFv+s)c zKFATH%#>?H%OxrXFdF;9y7R~E3~5Z}8Y}N23C$I6UZb{f?!s7{YcRluBg+#+clDH` zSk&$PJp9!yNh&#!R2yL z&ZI_a8-kbCW7yY+wE2pc_1#s3ef|=a(7!PUIT{;D*Ik@+#VZ|;hL?jF~uqWFrCw=FcXNNuO}I>~Kds|b1_6gxqk*JSSLlOz#Z6t01Xxn8Vd z+{~2sX1a%9%rqYyd~=2Xc`38KBc8qD{Xpu4W$yvP-g2wrBYowRar@`a9-}4ZS_ToT;dj*0l8^l#^H}Ni?rh#NhMqp+s`lI2n z0e#>JoJdbv1)peplblz)3uVbRd(K5G5bC}YFz27xKZn%p0B|S$t9_eRMpSQvCTG;!iAW6DtK2!$}yPtNm z+r!>;tV`iXJXGD#%RRBD$<&wr%tOQ8$GX`XjLTu-1+tw zaA==m1@E}wrhO@*7}zE{MCnFgH2eW`71EtJ@1eX&X9g#_oP#j$x=qk+dPPbxVqF?M zc1bhK3Jo&V(`HyIk#Lsb)Fln88^YzCpC40HKVR~u1eu|Vj-|W?wp<2h+26&sizE8atI0Xx>)b^$vQfH*_8=4%$bZ0pHnT=qq_fTHN(EzFi7Y317O22X6%awDh)Gm7?)s+!XLdFYP2vTdO zhoIqy_NF&Yp{qC-=7RL{ygRb%@)b&dC-gPSwWC}k%FRJ}Q9-36?5&n1<=C&o`U~E! zp>acYtSFy%VYQNGc$WZE1?ZCO0ph$_fWdg3oF>=?3z7hBxC*T_f^$<{aTi6PtKg#>^mye|E*iMZr!?dtKRFMd{FG)3iR)4 z)xU3kaO4I2=EjunU$yC9LiNv4{kz`Rzecq5eEzV-9p}jhi%-^vHi343QjgzKpCnIIs8Omu|B0K+ zZV#Vc7^qPYzK5@PG~g|uTTU*hT5@vDUj&rZCyiQPpIo}mm6g{9xu&guwgJ2HT8z1 z1e}vo<1c)$Xh>|(v?)`x*%I0U+N?nvjgzz;;l9DCDV(eD?WeYr)8msL?8C3HKi!Y_ zBd2a}<(EG6n6+Wd0@&fgZU8$M&yO*SmhzV3R!EJF=lOpaw*(e0d^U=5E6n(Cje7f8a#G*Ym9V+ZjBiq{UWJ~9 z&;Af2lUMCc;Z_NBP@MU2-@gmT-9;+9iJ zs<)yC(;s{j($>Z=O5jxcxG;U;m`yx?>Yc^v9Qmf*dk(L}ZOrSI^4A)^|IXq=ys@(< zSN`lWSX`#YADOU*oco_{!ml?j_;&w?@O4?yzP9z2p*S@Dr|=#7vXci|7XIw%rn9G* zI(T4dTRyh@fOB}k(6g~1AePlTxdqVLCtl)Rw;M4|SaZXl!tQAqZgftKFG7E&pr_Of zUG*M*G^Po6k&krYH2N4$qmMm_)$*6api`O9(Z`^eaC4-U5eO($IBkudtfck?g9%Qof?0A;ur5MkVki6uWag; zJvKG|HxmmUZ)#c8`lFMjkQSU-Shle8;|IQb%7w@G19`Wa7<~tKt=0nfZ%imj{#l8> zeHd=p^GiCHbS!PxWsl78+=Oe*3sdipz5N>Q{J{m_XzPLAaTNMS_6YAtf$kH}ZvG4O zIrznvYhP_@Eyu~jt*~cKkJn8@UtB2G4d(EzsJnSH>&yKw<1KSqX0%0S75I0_2XC71 zqFsyF%sEkY8mlb75c_Fx!}z&VV-w(kwm-r;3%3c5_OB-~J7KSyDaY(wjeE@DvtK~z zH*nW~di>)vXP)gpeB+)QJ67UXnQuJ42K~pkC?{Ss+!N;>c;-nC!6E}molI_RL& z;~$$AuthFa(xeLb{N=e{8q50ah#fok1MuYAz~=z)AYCTlo-nwbQF22B!kA;zI0Gea zdX8;}T>AXE_~Bc3-`W}ISa@bpnW((+`1P&pci(t?RqN`d%U|P}_Ah7F;_X^W)K5?I z?3QW2fZj|=S@yNBK)TM1|7>C_VBdl_=vLvj%=GvR&@v{+U-W9Gy_$aw3&+g(578^u z=h_iIdp&5>dG0sp5$%o35!-d{Yh$NPe>leCb=@cS?S$zU*YXiX@3*Jfrw@nLKyHkp zPl0p&hga`e?W6PL`0z~p@IT_awQF9#9yZXGI14(uD}I=K1^Qbqvwns0%NL-IptVLec#T3db#>I{+;J zXg{BbAKu)7w@H_8+M{`467*ZrdPU6@ka$bati+4nI~G^hZ(jb?{rtXH0NT#v_-f!p zUH4_^*zb?wO$$j5f4u3=SJ}Jr*U^`ik});tJ9)$NpQA5MLjA z8Q=PNb?hT5^(SNT!$DYt;<;B4;xASG;H3Vt*!K~qttg&*5oGM- zH{P{`RS3TWg?Y;x;VZDJjJ)W|8uqOg{ffX3Kt?^gTYp1C;MolKlk+n(f4@)&V5%Ni z)-FhU@sCeG`t4Vr*tYSj_^rHu3EjE9W7>s|ec9Bmzr@t}!4k z+gowX%4@G%b^Q%D{+_9F)9Meexf#E#HQ#fo{Q2trd!V zl+E$z0!`{!Fvr7u`R~=wOSH2X`5e;!P*U#9M|Jd;o!Y-g`#V3Y{Ubln{{0imfAEvl zjRMcfm2u^N@)wUP-}>>7>C5Po3!31+J=}H&{VzXqQyTuxx1Ol|GW?@Azx?9Q;cr_1 z{=p9g#e;9$G5UkXpm_51r}l0d4vG_7j-JUCJAws%8j@$=9B)x)jt zpZn-L3&UGG>etksYdiEG@7;FX`S`EGs|rQN(4pE{&!zGUv0T1xix6#AEZZQPtifbv zXGQJSkqxq?v)P2YL-)2c$clvAlWZynp$4-_yQ(6gd_+ag%FFHBWmiwMCA`$Ja6ZssDdIQQ;4#76zKznOjPH^ za=E_b{_1oz>vUV`4lCVS$jG&-#m?ULcGg4rtZkrqEa+Bcg>vv1m>wCTIQ*7_dMwx zo2r75UJpIdeNT6=eNU~IpyPF3ysab`{D62dSI6tU(mKA;7mv)U&$z!nA!}qux!9Xa=B-N?l-q`5se)zd$pJf;j^$BZ=oVZbJ({;Ixh-xNGI@eX zSaH^MFi$FgOCn{-A=^GE2V%*Tl~~I;)dT*uajsdBnK6{iSW)!A%2!uc zvmAJiJSIA88by1kD@Yo&8DH@m;+ntkJy-As^T|{6$t(07E0>I=goqCe(pBx~j};P8 zG;WcIlMs%BmCIb{aJ{&G&<&dUB|o`wAB*%$~uT1~no z;}*U%>riq)X5^zf3B4OkI(aJ>(D4n@IoxawcgE7z28xvCmb*j2mS}5xrP42O4h_X2ZIs-JZG=JsdKFToB1!a-P4-vqkfBT*qD)CP(i3%?S+`XUh0NR1 zu`&snb_T1NSDmoZHuHOuY0EC;Wjux<9mGI32KTV9n(t7O-MKv8yPU%F@*gVKR-v~9 zlE)07pMzh--_BYYuo-aM1vI-XCtEG`EScr0amWwlICH?3)<`nnP?1;*{>Ud%$$pL% z=Ne?PbqH~aH%zINBO)m)=2+6oaE5Y>db>lNyP}bBcW7UtJ zPwl3CRs4qn5@jmlxI(2f<@)td|$R|_De9~gba`H9B=Bwi( zpk!jDL_a9iR3m}94Ry7Z7zdMAOt0NgkBk7Zj_Eqq?-wAFF~v+G>EPy<=Jf+2^4y9Z z&_Ezz7r=Ct(SBJaYpbE`)KzZqr{33R{utS3r0HWx)V|KnYrn+VjZIC&8ITq7&;>J)&iA}a(O$Can+^C zHE~LZOd;JM15|fJ9-@k(0!2l}mXMNmZghi0G8e#T3gTZi;jV`)7qrvqSSH~}l}m{L zJ)j62vvog&)?KnM2UReyg)>svEz!5#d-lsdgBTRy{W4`^m8wY8T&f(@4X%EKRpmW| zh70TfFZcpk~O&!V{p>LRePw;-7uIgqo{+-Z13gOE|Y20F|` zFSl;>MQG)g*`V0TO2~dIWglwb_|7|SY6)dNhpDSak86Qr$Y;Nd>A}29VxJNxt2=MXdwJp`n_N3X5^wiH`m&{p@5eaJ{} zvb~x(+=nIYj4ErWEL3ehm#th5v!pmZIVCr++t`Q1(o$t>dE%E>dg)Sgn+$KJ??vW5 zR@JJQE_N4snycz}>tJzLs`QUP|7fM2(5G~iz1ZNLO;Y!G+(K*ZUe&H%f3%v`3P~s%2)(V%@Jwo7!-Hf zS6DM^nkFz`11zWYo1(tM4*8Hni308|^wXy&!Z*oBSGL4OIQltVI* zvoNsWA4Bok^k6xnTx;O^iVAj{85i`0>2-6Y&*A~OV_wi2cKsYM{B3fRLKb40DXVy` zgjPC3(+bEIN5|_^$pDd7CG~YjbbW+<^%0w!)+P1*?IY}~kJ#Mx{R|J@cgSW&m;}~y z`c&0;*aID8clo*)(V2 zv+c{>ug)t2l^m}jxS|Y%d4e`#Er!4ot}I+zlHu*A$Tpl=b=>1YCc11?kGR@X!QN5T zql_l7l%Py~?Iy@i7V~zRb+z@IHf*ZBa|>ZmW_f$%Vn&fJ3h8Qtw8%QS24kmDYh11t zHe1)oiS}}}u&S2CVS_A*!>U>mhgG#CzIj%B%dGevv*KH4#qTVQ*UiGOZWexZrTEEI zY5!yvy0Z_zA?Op3H?-f`uKGtS)K%rQ2*Jizl0SqkV#>;y%+^S+#DPI_*jlR!YxAlc zws^oG2dsR2NWthYP^6&=Xvp2crf9IWyDQp+e+@*WexF1;p{8DF{ap--NLNcRWMZKX ze+;(H&hDN)rl1=F%&Hwtt&Lp`Fgorl=X!~`k%3C?HCt@AV^+J3!QkDYa621r_Juoq z4RyE;p^R#)qr+=UY5v7#itY54w$t0$+=6dzb@!l)q0YNuS?y_In+QjO2y}*n5ypEv z8{0#>IMsmR81XWBMbnnv&OM#sy&}9vX?Ox833tIr*U}T} z2>13N-rdTh8u%@do_j<~XSk!K1Nog{97Vtfz3*Z9P?!MVclLBeP!9+-f*L5-(%GZ@ zZX(zcY3b@v@Vgo#@B^IJoNt*VJv~>~%8tg3o2$BdB1-QM4_i4*M%bEjg=}8iub}zB z=DAkc;CnNgpAx=8*g4wqcp;aAot~v&I$HV!YgMDMD@W0R>xY{YN<|ATP^99zzLhuVf!ka{SDHI!xm7$Oe1K@ zy4WyUrcH-~?=LHzA?_4err*LoRPD84iiPFKgQ1KjsCbEb5SyXyE|i0$4u(4-?ck+w zXSAoStEI6yP(<9Nu{sJgh8Oe=we)eM$O4j1(5Hor_t{x?dcWKi35C&y;#y_1QXyLS zSqv%t=(RFSQ1sv%Fcve|ZC!^O(*{+C$2+XU6k0j81-T}ffgM@@k7mK7g{&`x5*tIWFl-}yXBP$UzKM_A))Q-_JEv)brJL&@KtS15S4pK zAC@7kLPfxVq2%CD4NNGsN!aMY0Icrla%p21ZA(K`ogpw1RF&sWPt!9$1ZGnkKiU9M zKourMV7Q469g2b^)pph?8CwjPh;XlGVVYywz$~3iNUk7iisMX!5mFlaFbouZO@ATO zNFlC#Ggizm#yMPWd5jnGNHUfIE`1e={c^k1y(z{)CA6lxi*n3mc^hz$BS1NkgQ}ez zuuJ-Z&C?udB}L3RUTNCiST2KIcLPNNSXE6|oYdHb!6AwL-T;{yW9Gz$xi{zO-UbN) zK#OfM6Gv|l$U~Z7_F%;eHMU2)nxaiuJnofx#$fl{+t`JZd!EnK?_S;4CbW?T=P^~c zQ7C0|Ny+Vh9?PtHoUHcpIBSvAL#Zih*^sgZ@-W{bT^a!fvv9vUwk;P`XhXvMD*2C( z>(2_BWUrVn+r_D3V?qj8Wn+m^EEa_86kzYd!4JdAGHcS~DH|k^DjgO(5>th>j$%|5 z_6M3mqM`x;lLOAG$SS_VRfbr02r>^94NZno&a`N3S}3Xd#(otaRo~R9s0Gp$i3S&j ziI)qt>K0)W8Jt=wyX1v!%uO@4=x@vG1lpuo)NRvEheZtY1*$3!-3@+HVm5%EaF(5d z(8(oj9`(-ZrZoLjT~xSu2zdeB{c;y>Mb%ca5f1v${jCX78lhslbLK1juqO4}BQ6}M zCOM#^Pc7777fG*ZZy0M{JlL#3LlMOr7hk$+*BSi%f`vnuB95kQ&11f1{q5>*^FM%; z!Y&yD)qPK9>3c42d1W<$M^Z zgnD8tg;l9^ILfE&QEERgk>Kgg9L!M2dpxeNmQ?I?2>+o%Nu@%eh7b87QGJO%+$*Z; zYr)o4Tem}L*u;{#@<97eQDvU_QyI-qB}az6Er5S1cM2y$?Asn#2^p_ zBaIV0?nV^Xx@FX{8M0NXYYDSl!LgnoQY9hm1H@Az}OAMUq)He>sC@$g4^?*B;`H7^R==xe9)TQ=xbSCy~w&(27B? zXVW~qOz7Q|YI7ONE(7usfo1rI{h7C0RNK1@j8=h4m?mpQI+lb6hc=;I`msbjWnuG$ zsacX<-0Kzhi74al6Jh_M&CcD*lx!Efed>hZ0=+9gx~`yKy#JzggDT)^8U0U%LejAhJmY z?d)g{8x`!~N71gacjDYLmL@W0zW}k(pfvUR6mBWXDhqwrM6I?`1F|Y6t9XkMYa~|f z6lP>!sIxV^Uv}C?A(HyUIcX)z``TLCBm3n&c0o-~fOe$^Z-5*`L%f)k#}Z^w%Z}hu zi=uWh6PEqakAm<>0)Lk&sq!Unmz*(Zc zp}=gfPBw|Frxhu+spMr0sqNadsTdO^?h3evg1EK9TL>VSwk_anpSZI!ez^3bMg2lJya`p;bkx0S%3g(z4V0GUk*gvIYFt<+2Lvxw$?Hj}s1)dZG}I0Ib#s7F ze024#JsfLI1-E`a8JX3kxaMFV0GEY%r?a$>syds8 zXV=ucOd3SO;r77#+4&fgKA=#wgR8)PH3D9dB5!G|E*n>mCw=uU3sGJMGIttEMiG;U zaXptnL>(w8BGv|UYSj+4Jy}m?4Eqhu-7vx=<7!Ryw&&YeO50GQTyeWXJ@-UA8uy_M zEfjedSV>T6!(NVys5D=BYZi^T98(xVwVlZ;4O5f0oxl!A$pC?@!5AT{Oz?B@BF9*F z1hZM=FsGpCQR^PsM)~>Ib_0Mos^+8kpHoM{=(o22Dti-%%ZaCpldgcOBY1}-H2^ID zw}_Dzho;U~38G3u2aLX8@SQEE=IYAD2jndTG*xudZ;RnGo8$a+Wdej|kYiW)K zd-erP$E(rbJfux=lzFy;5$@jOQq_!p2*1bz{T18EQnpfQu!)wWvK(IAA=FTC4;cp9 zM!mmpMcJZYx`M!Mw1hEx*eb_y9y+cs1);~>l=Zcv7~Y7=9`qq36ZqCPR^o{zO z!9?DURiOj8k&Y`mP$tYNi@x7lR2$Y+IO~k=(4e$N$rPhER3x~e!K9qkAfj`$na<`c za~}xm7y2|HIvYE2-#sI0>*_ad+PvkCt#>vy1#ujRuKChp{qckaDp1ei9Zp3G(HZN! zymr}Dbqxu>R|Xj7e;LAME5tQorMOnqiF&b7Y{EOFTSP>BOmvBE@&t5o^#&O>UrF_z z$(-+VnM^kiatT9=`IzCoD+~`UPDCEhLbye63*eR*pL;#VDck6O$oN+qe}(Z^8vi=u zUvK;yjenEzKWzM)jW3PA&iJ<&AFtY}_O=>-oAGxTf2Z-AjL$(Ker?9zZTxoQcN#xp z{JV`$dCq!^;Yk0b#=pY&R~n!DW9Bb6K3~9P{95C$GX4$5=R29qUv2y~#^)QiOkZn! z-t}U|4!p?H$GqJWVuG;bDlBImqF-=uI%_uju;1x7j<|uv{vXOf{U!1-|H)qxFHmujiyu^bU$mhjU^{iP0C1u! zmgL@rWrUZXVxlrIn*7*#z^C=-h(W`zsu^kVYAR%J(SIZ4K4+)AGJGov*zn*Y)s?q!7^3n9Ya+|jWf;-)j?cT?T>hG3h%v%C|=jG4w^Kj!{{*I6^fb{ zg1pz%fTKzuc25mWoG%$^RSqkgNt+$d!w%~!q~Ji?P0UWijna5_RP4N0j~Bp+W`x^J zyxsT_Uw#k5`%L^k_y^#MFYo+ry_ckJJgK{|y!Xy~@#b9p}Qj8;-!I%sUF7Yt3Wu zDWji+&$Z@j@F}a0!RK1_SMa&kd=Eb5_zC!ga}qwe;xzne_;0{3uH(fuyO>s7+sjdN z0an9BXlV&ngk|CitbbPmpR2^xSOJI!#DO-6LJNkzGy>tEE{ISzl;+{o8U|FT#`)4b zebQYl%Sq<1t0tHa7T;G?`NbO@(L=F=Rv{bhAC1E9n4$buV#>X$f_%KdM;oG&!=-sz z3?U6i@U+^hx(q8sOuBmN=qbpR{lu}^`NhJ`03o3Z`M-XM4aGODwr`5_%Ud`QQ)|!>RM&w~gXkA#f?U z2jL!qdkpRgxM$#AgnJq8G~C;8XW=H{mL0}-)8GPdwQxJ(B5*@+BXCFH9)bG`+%dQp z;ZDH42KNTsyKvp?3(><0k2lWrTQTU0O4IkP1P@Jtrf7#WKspJn-WF#yQv`Q1c?Ze0 zg6fkA-b-OU*H>o?7&Xobrt3K8ke*J(G_YhGhiN5cvUu$&o7Y^Z##L=p+zT13i*dvP znc{TAcxXY1G-dk+XR8|=EEn|>^O!@bo-V_?9hj+Jb|PnI&4$;&*X4{}jdD1iplYDG z-o(9@*bWQmRtztqyl%ydD`+h09$Q4MjCWRElAge8h~^BP>B^)XRi+@qz(mGXgJc}{ zerVtq=tEW5a~j;lY&KV-%Mu;$2DVnM(rf)ik`E-e-@!vjUzuWmzKvvzqU zn<@-Osd#`dh%4BO!iBpIFRo+7{DcLg^pJ|1eJqckO5*qk1`e-F$^cJwr_f(+md!!q zXJFz01NWZHc$zeKH{^%mV&hNq%q`X2>B3XDjc7dKM`Ul!T}S1CZtwLHHRH|0dv_M)-t@zXyH)#m_)4!|^G50{id(1et8& zU;L5~?|v5F#DwGX!gE4gcNE{cGV#U7un+h=^jA1OuS~$!^)SBw2Y21K%0%5&$V0dm zj!$R-)&zv_Gx0kSmyci_G4Zummx*S?18{s+A$|biHWU9b;BEZ^^eZ?%Pgg@1!|&7A z!M*<}AwKtM+%I@sh&4~)dsj%C`g0+^coh2@^y}CERrl|$Ys*9x@;2zk^DIQOq|x90A%1EPbK?};=pW-;`3Uw>e}ugi(*G@=d^dZ) zbtl_h`ELpM|8rPU(dEcaDw``{zI;>Jb{cjrM*QkI`bK+?*pi|B72jfkzC5Dk&wYn5 z?-1r5^9*2~MtBjzujQeSBTTxt7oe9TOxW)tETEs$j+z+8-j%vK!Y2{F1>q|YJ_1~} zBJ6)2g50KK>SOSg^A%wG$B<43@!&md{{+(LHhHPqp8E#U==|l0;{?*^w))Bw-xc6n yx@KQGaStGkZksQi{n&{#I)8b}_I*gB+u$qDJ$)8wbbfp=HsT1<=(vA(pZ^Oi#9TfA literal 107036 zcmd?Sdwf$x`aeGBmYlX}o6>@%Es!P!+NMZp0V|-SNqd@-Ld(qsMJ+cCP^DgWmsLMY zN>N$BwOn+u)s>sdikB9s3rY#D1}3CMnnmbG33sqUW8mYgPS^Lx)pLDqFY-`{_~ zKYr!)WaiA}nP;AP=9y=nnRDp)14C{aL5K^`!bU?Hr|{#yYttv9?6$E#l)IAm|2DjW z`^V+~Tl!CxqiNUv{kY6eJ=5|(mHz+7G|G#Ab?aUCzfoJ}>eg?nEt@(k*~yrBPo>Oo z$<>9k^nj%5LVKm`n#)wzmZ9{9``^g3GtO--l`>(N>RiNgTK?4?Q9JPp8oq>=+INCnC+@lafv7ZI5kwfjI*@+YX z+^%kM)6zGVz2WYzeA3;$_Q~2Z;{I2+=o&5aiHrwrx(sO3qVV6-6xQQHdrT*-MOsBU zzyEfH?~1lf$kr1K*$CJK;J+uG1^^+Eh=_2bRO}~QvdnS!crDY4&&*Z$>A*Vu|Eth4 zt?hJvLDK(~4*j(6PwNVVtL6AX(Q{gx;Z9PR=>))>iQB}vswK)hF*o_l7VQ%r zJ$ky?b27klr_(;WrmXACB!!)B06gsDr=2^)OuK@m?{wTcuGX>6R=Z_geXWX(3J?DF zc5#H_X4l27V{)_Ijn-c8Js0^>i=W{?zR2FaRwlYif64vB4!e+&B5M;@dx@;&4YHQ- zGACrpTBg$fCqcfzn^G`}feZZIx{%Pb%+IrT`FTyOXStu}mPvQ}dF@>i*GbFKG8;k_ zy&L=*et&3dPt9BPc&hhng%?6wd!IU1b&)mAMcdbwxwgbu+h?99HS}mt7HAnC z;sfVV-W1}yIXOZYIl>HF;7fORG3Z;?n@2($)pFy8${9oaCH6ncrN~_33@>=gXM3v@ z(L7fXr$;H^RJv|IR;BQHkf|BhrjiL4JU>tZ3Iackz0!XQJmUz(oGEh*#jXqSDxWBa zKJd|&(>!~+c!rkyT8q}q8c*WsE$i+K?d|zGP2)AU`~~qth!b!6F@towqIcAmF#(>T zWk1qJ@$%E{?OCUd^7;}==T3j}SjyE{@5*CzK5X=}{E;qhZ36npo4b6K{$$g_&METx z(%D{d9p&1I00Gx3{lk`lmt0vV>(97?sq`l>RqB4gWXtay?$0RA_Qq{OeQQo9{pI`_ zwyaL@n;)WQ_agt3IS(U8V`2gZ=BMfr^LrkW z%e(pfG-=qIhe8`J4P0PLN!MwN3Z;b3x>Fbfm; zdrs$qKG*yi`jsep^i-ov+hUyn9imON9=`0Aj}-fvOhB;_Jzp;qEiuU#*jvOIkNO$m zF+ZbuG*s5RFZ6itW1+IkFN7Yy{M%#y^vcI6URKt!1uapW^?s~4EsB>IAdyAj{REAB zio_LZi-yZgqSnjg5ASiUXWcYBF_Xy$23pEpCzE2flep_;V#{x>^cVA$ew(ncY z20xoP#=XE#bPN5gZoPlSlJ)+TONjiXtJ1$ zPNdH5`szMLCZ*c57>k6C0MY%ri;#P}7^bDyH75N`OD`FtJ5w&+>CeYV&d~8_4|;aq zuwGZ9OKx->50FaHeW$-lSB0@I?&9Yb`voSy?M{D%&Qe?qJj{%2H^p`F^fs9!@@_^V zhL%uWx9Bz$?hC|mhXV#y_o=QxJkJJFbngaqEECennISfy>qH9M?tV95&@p&6gmnEK z?qa`=X|Q~qw%5&|wH#Z1+gd-*kC~D2scv#Y2Omh`PXVJL#LKADZSiv?6Em*V&w;8_ z0o_n8i(FpK&5`okP(r5RPEc6i<4V@J>v~*C%w*=KIX*g`sct%=Ii4TJTkz2F=G`MD zJ?d@qbBUwfB$F6u&lfBaycSYkob4`#)a19N^t$*NZl>3jl;1{qT`CV27x&aM;5f-| zqxjQQJhY7rcbvpZReol&#y!u^O`({Jdq`$}8*w+N{3DsQWstxg*9tyRzypT>V5)pS zov%lGcDKb!%iN4IR*d48SP3Tq*xE7fVbEGT}h|kQs&q@{T;egH&<{a zWV$|gTFhYa-%(ZR|LgTf z0t32D?&H0kYe%=geMSBguE>9F8(NVh%x;UHC7_Nu(zS$t*ZoPCPAK;Cb8FiuZJ;25 znL)Y_x>5pD6aV2R25`8z77|K$!;C4A<@77EED+4ps5}doC{C2LW}>vd>r5>q_p-H1 z!`$JwC16JR&(u;Js+6N1k9q=?^egq$I#fUWdwBzG>+t?bg>CP@8S}S?l;nYE?N9KGF0|Q=}Z1g`m_Hfy@M?DYZ6jDm3{$~jre(`Uo)c8 zf0DEL=RHvAe;4yFBjbdZj#Hc$dl6Lwfx{JV_-Gn*vyB*jknWk6Uw^H&i-VQ}y}E04 zd~F;0J7*5osFeRI+YR5Af|e(~r6WwoOH@aBX3zB3=~FBny~*o)CcjR{Z+*|$*Xiiy z`RJ2|j^>n^Jp-@NG^6haxme%xr`PbrukVR}9g-ld@9BDNm=79ah6Zah_If(HM$>S% z!heia8mn>560FqFIy9EzVx^-`P^*R@ z&$P`}#P1`)o`}xP7>MC^MGO;nG|eBG{2ytZk)8jM_Sc_CJN0jM|DD#@tF*Ezt*lp_ zQ)P5#toDl?)=P#BKb>@TZO^&~4tFh^H|$)c{~ePJmX6I|H6J>?(gfX{id6*V>3l51 z*yRge*?cXP%EHl*ph1hJ$AX?xoEG(o z_M5opADeZIL3q=+p#~#g=_y8#;vYrZM7&TI&6bY{Hj|3M+c*ID* z7O9coFZx+2PRf^VMB33%Bq&8PB~Ke6@=bu^2^Zxu@%Ql(FKv>DdA4`6b*JP!N3HXD zEz}+YM;Jqh3Fty>f3cqvcUmg36Ux*b4fhU?32hAu;nDR-wvXK@7Lqx-x#}7ne<%fIgtCtPSfImiUE|gfJO=v6Pln`!Iz) z{bDJ(^p-1I+TWGH!;-Z8-uF(xpxt6IhP3?^eokiyX?uha)16@(pnNPRh_{CO6oZaZ z5))2cXz>fBVmJX5up#CW<)M z0{A((=Jac&tIx4TD@!bX(E^)h=L=m4!VA{-r5B}J&dm4R(Q>#;WLF|h2x)^x(DAWl zj19c{Imx74rB;?9#Hr&xHpF#5Wr??4;n?ADFrW=5<(qXjKd~{Oc9)e8u|1R%;5&FW z@$@e1gmdhT%S+PJUd6bpJS&7vP3i1DIK*AhSv2DGL2HUi=l5yw%@h~;CP7xUzQ?3* zzD<=v-#SYFaQavmE3W9$B``(%d=|;?Ge|pq#gfh(X_0+4InY ze3;VaQ>jPoYI>?u zFS8`o4I2WQj;4#Pf}?5GZCd6mde+7pBEe@P7Ex?d>!4q}L$Eil5*)*1JuF=n+tqex zzyELf;~cxJQ$6%I+oSKPy;FbWM0b5&g2(7M(Y;}^sicXV=q^cthp0cpndR5%DzL*% ztJcf4>rrl=&NGshTQOA5vcZz-q?ROO8(FPCUR#!2p6qyk4QENSeYo7Q$|k!Wa4dzz z*t?bEE`5>QzQ!Q0x3IQPmp869$}Ve??U`ktI<2sNKUK$X3?Y_OLR?#1N&3eCw9kp8 zGqRzX$YXSji5Q{fyTx*{o!L%yFx!|WOCs0hB1{8$hG|T8#@UjqS?FjU^)&gMgD|O! zPIT8%&Z;~T9GY^blbOzYV(-aEzxuq4iE^;6*Fb1nOm?~_xjoU5es3d}`pL;|&KO_b ze&}R3Q^;b5tuQhe@8)o~%p$BUs~^ponf6HVqqnKG!P%og@wooLsWM2%9{RhI$==cY zF+3>eFJ>Gh@^4+6q_p-u$Lx+RrJ}pBl*rraq^oiJhLWMU=(b#XeHoEA)?qIpB{yT% zKS|pRw$Gq)J&a>wb|l{`Za4KOj?L-xlEz7n zg7Pz|Oe0jJ39lXh^}#My zJHwqMrAleg8&>2nH+9n$l_T=g8#YK=B&-0AF%=7?c8M{H(!Wxj0irn$>>7vE!{3M^~NVAN$4Yvh5>xniwa$ReRzPdMJOQ%cvMkGrh* zseP=fYjcoY%ro`YbzKbldDg{b(UBm`(OGm2wq)NIAY8V4rooo+tTkzeOMZO=F@1cI zFXVRWcfcCB@na>`#Wm`iXq`yV7pD99_=d!7yc93}eh)ljNbLygRXl8iZX0)6Z(?^4 zlWvDuGD^Q2D)ES z{+{99Dt5`6U61cO1KEk%2M5Bu^yoFuyThW|t{`Q*wPTqnFIdN%!zhb3v>dJRWOzgA z!|3^B_wKG(@-lou_EPO>l6|L#YvOmXO~TGPNwZ^FhCM*Ur>rT`7wz#)zaN>{Wb4vu z*{0+GBkGzyRz#N#T+;1GXtI^Q-p)1Y8<|2YxUAov)X429tdNn z*Cd9yB%#UfXNxizHq2e3wo-XGwrR<1lU%EfYcgZJZGKS@n_?PA-8Eijw0GWhizBTh zS<*H(-W8RA`Lk%P>(S@2KFg)hvN?__DebPs(zPWecq)nUCd1GLc@@JmR?qBA!`{(q^;f4z&!|8zT*|7Bw} zoj*uCkz49^Sy7(pIZb(6SpK>4(TP#gbrNHcq~Tpm!rj>8_mutuR)$NCuVeBlFLwt- z{`QepaB+cO$OWN(p_18a6}=)}mS&;T1se+3D=c!qzDJTHVb z-F#RqdLhh@EiGBa%x9X?iv6dTF6|PS-;iSej{BNOQ)(&oGd}kLnT8X#`S-OGGqB}` zT+%vmGj`X1s$C^k_Pl#Pm5wo?ve9TG#v;v?utKY8!$V`aQonYgV4EvhuBOI@Mrx8Z z$yl9>{lhY;X1Y>-pl_PQK3{REYSK)m%umK22s1h+9Q%#~t^TVoMsxeDV!u9&h%Zu{@1=O-)NtjC~f+NjAODs zzR3NoMY=)yTuE&K>|qWdWky8?Z2Q{aS8>G_&WM*QQGal0oI=!9IOg z9QlEpzBAl&=M}OWdz0qL(#;Y-#93`2iy&@~DJd3?wiC@R_)l8w@{GGQJd#?Ib)N7y%G5sdLj>Gv(4UO9n zuU~qS=4H@loK{(B{$^M#@4`}{^%&!3iwWMcp>o4u=Lbyi{=K8-=Ytk*Y$p7hpdcXw zXAE3`;RJZ$wH|&AeD;H|n)nib0?#kkoBiH=&_Yc5Bb1s9Nf+WS#aiKe8b)iSx;IwE zntQxB$)2n~KGJqVAt|b@VnS?kZJ9@zJQ*!>ClJ!~n4D4VXuo&Uy|YC|X80_o@^a*n zeHLo1-Jy)NMC~<>o1=`)pVfleSq%2YOdtuEC#U4MMKLnQD?N&)!l#kTdDvXNr=X>_ zEQYZyGRZE^Rz*vvUV|YOw0V@GYf_4k60MtbwJvPFD|IJd+tN_&e@mnF*#yy{Kf+{w zvWVJ-Oo+(5?UO3+BK`49oT+#~1#uhTkj#a}TH6{gjgY2!I4--q(yuQ$(alw)opr2! zB_Oi%$QjG=KwKh+GwP}B6>DAz@Hju-s>=%LdU!dJ-*T8SkMu@@cZRa7Cs)_D=>j5m zD~Vg3BI^>V&w$qZ%Bx$W`%%3weZ&y05$CvVb)~G=!5*}Uvv#hzg4yePC7@H=>h^K= zzxgoUWRpeJx3K?+$)?)2wXK|qjMFSXSzYfm_0*a+G@E3ZiBlp!%M6O)RuPy>w1fstvtHG?$$Cq~`BVf^_ru_?ng!`4&HHOngI`v(R6ckN^*&E@06yh4U2NVNvodJY+a3X(yBudUda)dVoC2M?YEDg}PO! zhkc&o+Pd#wQ&()&%KHZOj@z8cJtx+m>=sF!H{LN{$u~UI!gZbC7CRft+AfF|t^DHK z4D^U77lfnFzsIwH=iKl==~&P^8`w9VScttLfa3k-;Bd$A@e7FVoX8dSWag?{ste_-wIb3*qD$ z;D!s_s57~kG-v_j4U5l>`BC0>X4fKc0ldUM%a-bRv>D@4%LQ;*$C&E6wfa_9W3{eu zi&gOst4yB#xl+*paOua9ET;2@K6Z^snkDHoo#^*p`k2YN(i*84c5@_Xh$Q3*0gLdR zS1gaQLoVd`g96=w)n~oIkXfLe5Z+RRa8C{)7tjw2;`Qs|4qtDEzd=g!u=%m_HYG88 zc*pW}`vS$R_fUL}?%dMppB{?OjcX@eoL=8{a$R8yhjRa;_3xzAZ8P!udX*0eztTpgaR#Q{waLn;jhqQiC)QOdenwC$QuoQS>Aw0=AAJwHgs76HGnKU?BdPDXRf)Z9mq`!86UuA;Bt{by1;ePpc9_qn2X zeMV0MrhM(QgTIt!+$>-~b8@`d(gFI54YPH?dbB^snRM7;jZ=994snU*w2rhnTUGvW zT{iHC3r_7bx^|apx;C&$o*90v?j!7JIIRAZue1*1Ni<(LKM;JXpBOOKbxanIeSaoS zu88T~i%cP8>w)Czoa%w##-S3?vAM!e1?v-NON!6Ap<{$J26WZ*^RR0o!L-Q8S|ZNuh|)$WQDAFap#{9b4V{@KUd7-VK8Nppgx?>N zC}lD4NX*y|)PBcY?RRIY5aL3|aGt?=|BUj~znEz5gKy*QLC6*k+BIGE9Ot>!8QZc8 zdN;=(8`A;ZO2?zNH7Y^z9jb(su(^D%D=W#v<>q^gElloB9zHkSQ`^R14kbdvP}`&J zLaikdOnHkLN7FPRrZ)!`A@zmFh6`W?8sImkCCcBT`OMfSEUb~HMuMSGv}82@#;f^P z>igAv))>vtQS;GaFERcD^wzdIYBn^duVQvEjbFCJOH9_4Sw%yP@?+?$=(r@>1CwUqOtYC?zLMuu7Qm-b1>s4MMSONT^q; z^!3W3&U$5Wb@u9K?;^P1$YzV~N`Hdkj+LT2ds&Af>a`(OVG1(+A|vKDDsWtC(y~9AVgx`=g_awKFEQ3_kRy9di z5+mQLI9Jjq;@0MnbM&<1YH5DuJu&hu(mDG4eEJ zqgC>10y=Gx#K<#4Peb0@l@j>Ug`7(NZwcmhoG~>H)^hUdWI2(WD5hB<|q7M)!RZfP7@mQj&0XOw+Z<>=X1>*Tty z#&AP5ktYtot22qps2HNZqe4b$gd<0?!GqfuroW^6F*7D>4ZlR`)T^ZfeY7-oG7cjo zzXavJ4AWn2e~g2HUz^TpLSii&k7K>0`ma9{dFFaT8Ze%_09%nxWpVoK#O2bbS{crf@;f3d{IVn^nnR^uPT-9em9^|8iGRh#+x{@6<<-sqmDd+QL@iCUvJ zFYDY{<-wE}iPq3;f#uE|vc%f{q&%2KYcQCPaxvC`WAur|Jpa0{7_n&T)?-xHCYI~% zy+%>hqBM)l0rSo19OzUQgH7(OPir+qwZ z)$IH@+~z2>=6jf?jFKz|-*rmMb^TfU72$V0>@*)1nnqjMrWAU<9aAZjn9)|QDb-yr zvxsTb7#}mj&&4KtA6h-E<^NoaWg5!fTr(24(|FHA&S5P_o#hfzptobZWBnT8s873V zl2k5>F_GXG%GW-v1Ghh8_LOj4AH*1>bIJ^TBzSS~qK`y4a)ozFYuZ)Gp>i{}eMI>P z$DXhz^KYWI>v1M3H^o{e>$oMuO1zNAOllweX%JFljV&0)zpGT2U|pMRvV^@iGV`lw zJj3>`LQ0f2p8R*|DV|Hb%l-3+ax>F;?9fPj`7Qi@1p2WkWG&66QXTCDI z>NVJHM%*kvXVZF^!XMW57<0k7`AFsHN%PcvNoo7{++A+Q5NMyL7*3>Ak}j8q$>h2u z4ela!)BV3yF0o#OK))2|*^O7bJY`y*cL{orYH z(>eAEwtXlc8LAH|_`@Zjgj!~_YjMO`BlZ62o9{MOeTMz`>vt&ZPU;swL1{w0znii`0e4rQr=jxeJGK;|4jkjv&!6 zdnmVZD7SxrSL+B84Mz^;+J|z#9}v_!f<(jEp<1hL zoC0(J6oCF#hGYXQfGR*Wpcdc)Gyrx3ngJ&O9zZ8R22gwPb7jG90QN`=T*E6jG&AZx z3AZMvX2~qaj1|lRZjfE}uz5Y6!Qi6Mtx8tDuKa*i=bj~5>DU)&4AZ4tiIX!1bk~0g zJBeD7#BIMF>(*`9^8r!;ly*<+jgAe?i?c=;etLIWfW41Z7I5~McF$?8^hx?XpJ|HE zUO$J7H>u|zBopnK1Ve!|T^bBlgvMNx$_=F!hceXEF%`5d$)sheJWUBz_Ec9727`Tj zR?)lb#WKt6S(>b#)Sx6oGO6EH1YSePg7RPW?OR3n=Qhl#eM{M9Pg^|bc+>ZKH*vXE zrf9G!A*AFfQ4LpqJW37ext00{zdQB4r~i@A^T7Pp4Wl1z#{M&x+nL_ZWyebfPfEGd z$-W#TKM-QFle}zGlQzMd(!w@zjcL_vV}fItlWdPKkIt&K{Q|~6&aRc;48`L2k0JWZ zmmhF)z%UOOWG^qB^%=nD>>*y~BU}W)ydGWOjNPo6**+X?>!j;E%vgPSwR1IWx5=m* z>m_Ji>z&;~8sqE-i9VB)XZ5q4F=%N+h)SNee7BQ9OQTS_+si!nIdlwd>si2lz%Br3 zjknh~3-TWa?Z@I~omTis@F>oI7a`Y-dsSiWEV7+5XdPPgiIX+`)Vc})&#I}EVUneK z2}9a}hsufEx&@ew{o^aLXB(EVlbuoSH-|l-laBkt^%E;z9DAST?RTylH-F*JEJvY3DecGAFn?wb z=+C<^+6S>!2mXE8*B@Ll5bOBwGS6fZ@5 z!^71|+rv(qoHP{2Jr49B15}L&Q~#-Mh%V?Pn@)lxNhEubhvePiF*%8Oy2tdZiT84H zqDHv+(jhLlq&->APlQ)?*c1PV)OQZ!@0ftg)| zbL)>4;=~Qdoj=oJS7wwfjzgwo2*I-AY$C^KkOc@ozJZV#24Jz7TcE$yLPc_b{2X&bL0uT4fH-H4iicunHb%c)Xd6eJP;VRLaSs zE;HF6$j3rFB=JU%$x#N+^;gS`4%2d@V>w`>lHxjbF<~k(ow}%BIkZE6lRPzQR-sd$ z$sW+iO%c&(km7NQ%uEsF2Scu7{Dd>!Lg(;VBg)_C6ETk8_D93m0bnn3gK3CQQGW{t zMHVI0n!1eZ@>a;z<3ptOc!S8PTa=5(No!D89_`Lm4(#;e14Hh z*~obv_bf?v5L}L-YXdu~y`WkvUx*Yq8Juofl8fM>ye>jZ%J6@OYDM|IzAJUNsddj? zt^36}TCM|kGcD@Abuf6Zo9B@DOe`L8R$0+(1 z5&B<$4E=7_V+|GU3!nv_S1wcUW_}NJ!GoBGbu$R*q4@5EeU6ZU|C~8W+^4XnFm^!> zyK%>jt}m@A#`@-wxTQi0;)Yrwz;`x6+j*@o741YFz+Y7z zZ6g8tCBs?M!b*BrNCpXOZAhP;;El1b$Q0zaBWynLfMTrGbQGhSal%o-aTzq904e)|Vluj$z)g+t9$6a@qJMHvVnIQjtkYrorCfCaHl|v~Xt10_k z%gVEzg51+b^MB{6R-ZmrpEkR)odi5Op_s8M5xhHfOU2^K#dD|xQ9c?Xcryypr#EFg z z%*pMaU*O~$ZDzv=PTTmLlBySWY2?z7WtPzN@kP;u6oVGASd(}l61*<*wr?78#O>+M zm>tB(LrP*z0o;}m3eu{l%o4ZbO+Mqt@E^u){}!p5VHDe4p@~D-kfPRThc7`R4;$1r z#qEG!zA&ai-0@c*E&JM_fSY7YGTJU6rnns^eVOG(`#$VmZ;0IC8(lue{u<(wB5Qr= zL+a0ii;R7ck{s_%4&Q+sJqOMmbWiV3@Mobs7Z!HZAj zxIeh>D7Bl?K}E;l_mG#3OCc+$L(frpiP=W7ABNY4n3s69^4|sosXzFbV!}J_8fmU) zxpVxe=dHY_ynL2j0*1E+X-OhK?jk1hayB!Y>g>V2P9c!OC0D<^bYJz_rTxLX6fN}4 zN=1CD2-ub@w2rJJvFSU)-cHO@~y_4Nny6aln6+@Jkce{dXdYvok~ z_QU-_gG$R7W!*7aYm`FUOGA78!RwUAe90J}X~0=I_&+{^C8;bnqKr z96Svg`Jw(8=pLFjeeiES4dNQPwx2K8s%eu3|3ZBb0=08$!P`6l4|pFurhI-D@DYHH zQD+O~Y>Fow{3K$6x4~FFU*RV0n|MT_!^M43^E8f0_X=+ zFUQ^+v}8ycsk$Y;h0miFQf*rysJabQ<%24NRNF@TFb-7xZs0rL#vyusx?awvCMT`s zbX}=80`(q7y>&zN;-Sw+u3#jcJ$1Rxz6kK?a*|akkJRm2&KXmslNYrmCojg7)GH|` zI+pSBM6A@*HssqFf|F;G19;8~8=^I4PGJqb<5<{|i`zQsPQgx3RZ`0+4>zM#%RpgG zz(?!VpzU>PU;n+%ZU0uM0d>Y*t+V86orKwDwDUlVX&onj&Q+ONbx%>-X0B;kT>B z>V86D^F{fQuoHgImm+ipC+^>DhtA2q?tHEKKFC^oxl<$mM%i?1w=)tv7GX#4aq^#0 zeyxI>eDfy#{W26imHP1QrOvzXe7}a?S-nQETwSH0YXgDOS7Fv*^xQZz3jj5dHG z3reLb*`ViU#F9Zzsh1fyRmFazho0Nr<}4hdhqj&2r;!?cv`>?O;jK^iILD*jokLtG zd;1IL1lTnHg7tR2mmRwuB}KUhJ^sL#U7n*#SYp4aX0tCx8aG61@tb3@(mV|*V3G5* z&xo~#N>w;)s(IV@g>ww>{TcX>YSY#nWNrt?!xo zIzM)yuK}{#4A==c4mbt)2tZ|6@0-&V4oSc0Xx6+5M!c(K_0*@7K%UdJ6l&lF1wK`;G7R77?eUd|&|) z{!ks=&_Xg#T})0AjnNi_K~qh-)7%0a44tETXogg1lIUK3K1L-!{0(&fM?*NM|A6k} z@AvE#*t1=mn}o4v$E&f?g5hjRkL!Nc)3v!>NTcz)Q@qPHOWfuyoNUo_)qH)(?zW7} zt0(4s&+235d$zQcy=C4~XfxMS|3cU1#e(k>`n?3D&3sQukLy8N@_R3t_?<^*(8$f$ z5tHl^4?SnQ95!#st+DmEmjBF|x6)h>%VwDd>-EvHzx#5xSdor%irkMq2Wn1qKWWfG zFKk0?rRC)sKA?l$LHSQ@zQ+dWPLC-xZ~1NousvX|H`f5y{kJ(Owq0efVDBFX>pub{d`;)qRM~j_5-Woct$A9%vkd!uW`#f>}%th@6VcQ3{n#?6t466uB4v6nuRM9c^SRDF?7V&Fw~EXyBP9av>#x(=`v7aL`*L4;;lNDz7zM4xe zIsF}n%D`MxYj4jsfhc-$b zUcBF(c+MLR?hC)vC2BwP9Zjb`YAt$I+4D2><80r{=#>Uf+wt^Q?6%>LLVxHy=tuwP z7!_eYknAGNK*n6yZrbvxFbo`vj=vUrs9j~IE#K6bAQz_km4~xo^`-RTG-%70D{d2# zq9vEz=DbpJ>^&&C+*IG&LQ6&z*ncabK%k*>VrC7Es-jOiNxBL|L z2=TMx9j7kpO!1C=%MTrj-oj8Uygd5N7`0V)o<^4Xa5KmKJv>7Lvj~}FCuA(b+shFm z?FicJ2Y)^|#N)Uu>9ay^q`vd|j*7w1k6uLwh!Ty=jj%;fyXl z9DF{M(bBbwo=fj4TXPRFzv?+~52ZJ?>|o7`G%9Hs>0RJ7y<2fTIPfQBkI#;EL65#Z z2zUfQWkPIav8u>}#2~iiL0<44mz)@(Pt%1GCF zA8?YfLgytX_9qTz%2QU(ljVHLdf7{|M3k=#O<8Kd31>Jcg=R>Mc zjG?tzBhLymnc{dp{|W34>B)%pzL;0|hB=N(yRdT_-Z~I)mvVLm-IYE+$jl6R9rn+a zylsFwL4JCW`<=Flj1`|E<~1JdCi98;ZV$JM|3f6WHzGE14F|37yT#Wu9g91|IFAyW zm?;OX^UvR+@Ri|UxR3US?m?qHs+Yd=?hoj=k z)vI5sSzPj$v`Tq}PKUSgwx%5phw)8>ZK3(pZ(n;WY*h=en+KzG9_-+-&-yLC4>Lve zsU>2RMq$5_fN&)CDDen~5B}MwLzpyp(iev?e$efkj4_-6*a+AJcpsp@8|P&RKLLCP zPyjsA=s2*39Taf{0PZ>d(0N+LN>^+b+LH=~$Sb&M? z^WKcHP?~S96lCwf$BM2|{&EN;bEWMC|A!B_|wi;lq6C83_Gp)(m%Z^;MOk& zq7=NXa{762dg%QvBeQ+dW;)_YcppTNmkr>{K<*;&s{}y#T8(fgU=v^+paF1XLzJJq z%FloF@jt=OVu$rAKW`YY4DqvIh@UrspFPbtfuA}5D?cY+!_SYd^7D7fzw>j8@}K;C zRQVABM&)ebPjEKp8qSUYXEXbw^!%{{`p&!yl6sx06W}G=e*Yuf_Ct@b+wWVYwv@RD zT1t?`{^!8w4DdAzK>54?;j=@0egxsQd=?B(fzKNiVTjLJDxYJEb+2k0N*twjafr|7 z!?qzlw}+#Awt&y1#R5M6E&Q>P(hv(i$AQncgU?yu^J0&%OA9`K+8@^>fX{Ql=XUTp zPv!GXkvNslwjn-G8sc--HGDQl`8=cprg-GdZ@>faW4UGCAq`RfZV6wJ+)*lj>%;#k zxxb=m*Jy(K!cjWj>JY%+XTjg$L;Pj8AKJ`p4_u=SZVT`C9S8qT0VrQDAk0`5m0up= zwS3h;7YK5DMDr86;9A`}DSSn@<_+=n2iKlmeEu;s@*y`o#c3|--9RJVQ_`cIB}XxcR#eLwWmx&UYR+b3=LK_46m zQQbNje6s*l-HLE4K-H}XujQwx@-sgoX0fA4X6ylYa*KuS8dXNIa#^A))#i|ONJ<~Y z-C(*>&7@Kai{XD@1CVhsPel3%lzlz=d@+xL~&X5MAE7kPS zS=a;nuu_ehO;@VI&}Rz4bFAl}x>8XaAcv+I_FA)tR;o=vBB6OJ1j+=`5YEFT;_f%`TmaN>BvCCHvW4Q9R;GvA7tp90R_>?x8saQ1vi+jP*X zl_sCpzDBuf8_=qm3upmjd`e1bKen1eGt9 zeay`vui0+KS!^>n(+sYZ_8pQm^o`5i#C+2bUvBi|t9+RYz7TljC!W{7O0p zm5)WZT^U)Ph48mZYPkvFX3QOZ8@_Kq#~tC;!OOl#@He4u{9ccnCXt{w{5^hk5kG#{ z_xtdhJ@7StKOXo(wV$b+@VHM%?G(C(QhiT#6rEF)e@^hq1=tEW05}Es8bE4L9#8~W z0(b;~J1TbFY(bu>=w_LnDb8oDF{fkaEORbUbm{pRr$U^ z!(OcdFavRFThjY9%h4mcFVnYfZ024jS?nJe=s>1~+bPJu>0_Rub3aaDpAivi748`= zLQcW^=E)lS2Wh-KfYS&bUSKi|>_=%mffb6d3Q3=?s)Q6d4H+y@yH@&;1>?w-tU>JI-y^ zD28JrVVhIUmE_S)JyiOycC$351sK*FCWgGkSZ+_Nh5t`}Eke(fKk&WbB-elM$;Pb# zCsHT$=dN=|Yo!ao#~3~WWs#ft&N|#a#kYDVGKGd*O2J6)v(_Gb11~o5cJEaC)Y-iJ zcqH}}=9o5H{|^LD_fzC(*zhIrsPeeUhRlEm%E)8l(A z(L8De22lIdIeMe^Su3M3e|h`dymjY%v;^y63Yfw#eA^Y=jxA&gzVg+=Kl7S*B1U0- zPtEIQX|0dS0F{MTFix8Q2LRE%hEmC`!wcq~NsiBzQ!dJT>Pu)Woqn2(hnJ#3z}wZ? zn8)J=KE(>dN{jKNk@w+#K#}*-HbxRz+tb{v;o!hJ$b>EsszfwAe z;g*3FJeJROZURUFS+d(Y5%8jMN{-ub)I&l2>H%KsI)U)RE|Ti#+e>pT<8 zu^#%J9Z)vY(Q;-6=XR^lcgkS3z$x z8LBhy3-}hH?gBb4sA~u0x8l3r_@2m^S$uVUb7c>IA7eThGb{G6Q&p_{hww!9HBGC090H60%`?vrh-nGR2Z?ux1 zjC--1ClcHc;qbK{b{1<-t`*y8UD~hw*3{Yc&A1(4d_vJ0;trotbk|=0SEix(AL+RImE|ezFx(PC;4&pCc#Vq3}}e;X)N(z18T!SwIpeufhpS=P@;vwP0l1ltO2Ygf>}D zUfNfP8x3=fT<>SKyqpp$bn429@#Mt~ctePuP;he9G29G<*YWS5z!Lcj&So^~*$gi~ z0DVen`Q~;)JVW$6f{@w(Z-Xj2CTL}tRc6@wW;!wiU#Lml5D6}d@bZEI>}R$EHURd% zQ5gv?jqszxpQYo@-xTLlxaGx|=i?2-Nw@_ldm?%N^u**5c~sr{y!jq6Z>}dEPaUpU z{GM~QDx$G6*K+A87cstocy7rC<&EN}Fj}8!Ng%%t`30>?tdV*SnSx3)$`rhS=Tqm1 z=}(BC@DWpS-lJ%<*kc98XI&-uy|vDkcfyN$s4E&9t*@RlmpozLp}djA%f0;t&O^vy z3isl7x9_&Rc^+b-7+&%fIvHcVVlX`AL)~E{XPbxCcZ_DHZ9mj>sL@I(MC%3QQoqZB zS^c;ELg!&c92QqXQ16Y*U-{N-CFYquzj&RQ-gIcqMhN{5iK?LJAAB4Wf`TdpwYVi@~YQQ zr(yK(<1YO%Ij7`8Dvx)8DLt{qXHx6HMc~qZ04^5PO>v@*mGbggtNZfLUM~X1`}%3B zSU~Ni%N-TIKWtsS)iJu!dg9WDE|N2|C*}2Pdr)PJ_Tf3SE*8|cyt0+gvs^mmLSG&b zdJjKXWu&JY%nqEp<1Er5{{!D`JGgbt#s-XJ2WWW7)eJrna3K=3{#!qPhkhO#Frxq2 z{rS$hII*Fnc=;e?9r6s0|MgqiV+Y=SqjV2f>Bjh}bmOeB_p_h#axC6d#rHq1!F)ev z`V#{>+=R$Qtx$NflLubt|B&m@enn*WE3xdJZ$*11a=XG)oFCwOw^ww*am}-hX<>x4*%f5u=VPm7breW%h)JZ4`v_Dul48p8R``Rel) zAIU5AR2i#Bvtd#Njyyare=*j*=^>ImvuE1tRYo?XG+jBkHQ&h;9^7d334w8Oi=?7@ z@|_1aiaxgYv-_V(6+u@?_`Po_4JUoP%tIPx_I&kfB>4Ei=igBN(R@49pHU2a&RW%|~b@|an%c-H|mWul#O z-oO}%yrus!eA6V7Z>o;oC$NAH7a$vu4|vSPRnvU>9ypt`6}afCOx)L||2N#X{{-#_ zufhG_>J|S)y_#$4)wbf>fisTd#BD>fM$(@vZ%HgqoTYcDJu}c-(D**V5RO9htF|o# zU-{x?Gi2tXhkgxX zA6~MiPQrII^Q@i)O6m+p>DV(16#kX{fvhf{YN;b|9@zE_qeF4^?!WtJy&3aQBa4AIxt>< z0Ubq))N&kQ3yg)Sb-YyrWM_mrky(;m90c!OP^=KlRP1C*242q5)UdKn*K=kRJCIqN zQ#vA@+Ti3K7?}CJpFKdHKIilKo_~HXUWXgiZ~&P7xv zyhJ4he+`z`I{RmLNR~|45|}!Qfv2f+F=-i>+*rfX*O2;7oM0Mv0(Q>|?1=+*?Xj>q z1$Nm9oTv-d-nl0f!t>qfIBi$MhBh#f&f6h7oaz#%^`7;fVzj3z@6CB8_L`Ar1?++; zPw@NLQ%(4m?z=<-=%4byB6!Xi`<*A?84oA>YDOk#eXOCtwyeNlqZ3E^rV8+op35+J zK5c0DsUfZ8^M*C>aL?$&n?LGsXda8(m%+9^n5lHi;pbn?OVK}!H(ZX`VoBF^8)m5_ z-#^`?g+Qm2m3WT#rIiG}g$^m&yBp>2LlTZ*RWf~8?s|S1&*AzE5j{nX4D!ZC7%w=-;cLp~qpWgkGzk38>XY>&dukDK&(#@_aD&X7@U z8C3k!dEqqKAA%-kM!?en=^{MiR83giOeg9OIA`6(7}9LB(9h%aO!ECsCiMv?r(a@- zjZZ2rDo)awYyt7vK$=~ak!HK5W7B@rEiptEgC@IKj1d8G544KQbjFPRy899q7c&Xf z#WLY#KW2!G%a+MDGqexZq;So8gYh2Llx#IY!)=^CNf!|3qfA`}R(Vnla{`oOLiA*t zUdkcI3QE~LHDQf0`5q&3KV8h3Og2zVX-sx(RseW>wwvI8-8Bq0f+Taxp<7<%PUcy| z+wQ2Wq1lA{qHdGD**!RGu=MmGo{mF5AtK9<-|p*v#?6|V@Enpw-`>-mT1@@2y^j{7 z9><)8KB`Cme1b%MMSZp(SHk5WK8mm6Rlw#fXCml3)?YM2mf z950kU7ai+dlM4L?`NqZ+{;TFehBYZ^#awe}LS5X7;ya?hbPs}LPw@ZJ^@UrLJqV|@ zPY;m`KXo02?uAPF~0rZ!!IMLYS@8Hv+!^%27FIOkNX zo2j3_^AF8c)uh|bbU0WGug{PPhk9?bvl))0&}Js_c%viUDEaKV4fOIT^c96tNBl2t z%mL_~uh2Wt5l4A{cgdv_<+lOj&MvYkssO$>_QB8$cxdd}P_N+!zqYjxzl^ZYL92g8 zIN(U&RXB?ah*kbYa~9|5ZHjiajHyh|F!GLgnXoM2NPMdKo;%0dp^s|Q)+jT^+Lj!F z7eDN$Wi%k|x#Trh;MC*L&{nQS9bdE5#LvTuAv>VAV|mgDrN%$3qKXo$CYlaPWn! zk|^V9XxTCV8Kp~$3`0!Z-ysY1T+e0n(RuG(=&?|VYQFTw+qa^B zo=5+*qF*-R`XjDAkUL0@>mR>X_Vr!eK;Mnv2iM3dhrr9?rMAd2V0^ctQps0h3}uoQ zISCgQXKKT=?CF4H9pJ0-s>a{md|U1`d*q2=3uVGx-B=G*s5;VRXKrQSL1Glz-$|!h zSPxm9tl?AKF{!sXRQjeoyImpuZoYyd3tyzgQa#JUDckzXR!nD5s}HGbq~Qvc*q>@cH0?f#RH7CwbFflSEv4)gLf)pmHxn@rv~*)*n-#!9lahZRCS{2d(yhs@qoKlmVY zg`ZYcx*^N2g|=!1c5C+VsvYoU)Gn8$WV{K#@5$gul(ZG)%w@LS4Gm+JJ|Lz9-n9I& zU7@_%ELrf+rc%jANYKuWNu;&rt3`o)v^@5Rad{XtbgE{n3~Jcoe$>VlB=XU7 zXn(v*Ea_5ojOGkHNdP`qjP2q4E^$Q{>F5rI{iZw0%8unrPD2nu<~QGB!`qi zR|S1C8DoAHQV;Iu;;KD1JbQSK&Z?Ueoi#6Jn^p$jny?PG4YLlmIA6HECG*cn=l)tnG`8GS=~_g_Q95q_NxBke_6tEjw--)7a>O$~JZ zqngCTp92JSU7M_Nc0~=FHiB1FvI$$PcLNWg-~}|MY{XiDp2_D8a+ze6RPqT2LmnG5 z*fD$fM@PQWVB)*P1Yeqt--7=J~bq6822j3FDbEWbwxiJo=$ttt4W9L(|37;%g z3Gnv{Pvfdte_PNG|J{6+mGVsSpK^1sTVafooEZanN+vupGfDafO$BkM_seSDf~^a) zZTi4>!~7G-TS9}Z#&{BAQgy7o+7j?gcqcf<1zR${4?4!b0kevxf*JprGu1jOn|UQj z*Ph<7l3k`!-#==#pC$~9>C5*+FSVR8{?*BhiO)^p6|MAKYk>uZ;%rNV^`Gi!`{t!` z=o%%!3&ceg+!xfEyc^#X-BF1lYVc#2VVi9VNYTn(Im@K&w3_K|8uz8r|L1&|QH7_a|0TZRxPQVI)Bu(V#V4gRmM3w3gESqQ&fVMRFkRMmmf1Ba*HJZ9!UzRFC9DihBxWAQc~TB*^)-^%Js8cMZa7kP|)* zunF5OlWgEU{Zwb|NY1EhPKK44Oo0EYli!bIjgwnAKFSa(+2W1H`4;UNV;=!H53WDu zLd<*mta$6l>|D>TmB6~3DE&-N@K?lWXr%RPj8x`p&~@*0F1JTytx1px4|`=PQBF-( z|CdKkzhw`Ret7`rjI2|c^MU)Soz78ZIVRgF_kP@O>@wM)4Sfc*f_}53O-~fV6EphG ziTe_2BN8^jXH&n*V3+=38_^8Yz|0Q5qy3F2Uin%KESfNqmavIh=OF81?ANlBqKg;X zXh-9D-iSHg*0;|Q5F6h^yGARpLgsjy@$T-q>^^faNWc3~AJtE@=-T>AZDFe~c@ry0 zN3@Fcj*oOTki7dGR=gv?-A1mT)Xx>S0X9vX6 z_xj%i#HanuZb0%Bt)MA1U5L3+;Nr|2#8Mw%IvZRH8fts@a9RpDaISd z_zOJpsqy9!$ku9eKwJi!$hoUo=9g!os*mfG)eN%|*SDTz7%G$Ij7|0MmfEwHX9Yie zNzd%uXkvv4JqBG2FRyH{?rjeZtM!E$VnaY9Hm*`8yxRS?RaF5jr0d{G=3q7h3%JWG z4p;-?^gwHz9#InYF>hMmz)VitPGX_F<2BQ&Z&(|=bH}LRCv{?`p3rDQkt{8 zAto6{TMYCcgbsNf&1fbb*j8sA#C@KvFRWChnszh zTm42yh-|9`(LK`4!aB#oIIl|qy(;?s{ljlSlaY2RIN`(I&me0)=OS1bL@x~1h`Q&V zJwJz6y#AdxYR`9G0jr*?4o&L;jG>(HRxbl93BsTUa_}_Uo0bty(o11dyPU~(b#i-4 z;!{bh_o9BT^$4_)zjtnw;PB%7WPAd=2JE)NMr zXTSF93Ek&0uc22*@MXH4=v8G+dkpoftWuvd+$yUYiZ}-5&MAtxP4>v*_!g2?T?uca~e8tJpcNm1L(MK=&JwTGwEl z!PWdUcpT|Lq~AaE&_nN^IdkS2+&hq}kb)S|_a?zQk{~DoMhvz+nKL}`??C>3KrVb1 z_)vA@0s|{0!p)W6;O5%_+#r$-c*M6tnLSOy&HmnGJ3Kj{t;))sSExRME69tvIQ{18 zFxO>#3IC2P{EjFpSYcwfqK`B4yA?I3auPE>j3FPRu_4NeT=1m|eEGTe&(=SK=1ckd zb~U1AK=;|2>)E{mV?%F92e=ZP`4&9f*IN(u@#fnSZ_Wf?JkX0$z?)g1fj4{Jk~lLP zZJyZ;&b;>+G;0`PU8#|W{t@$QAC{sIt1{CYtN4SuUFbus+N64`(Oz?B=8%`ImD#Xw z>Vvk6cKy*3 z>HMmVi9Bq#+O)~hHpF&$i0Q0$9KcGL6YlAu9?|=-vYSRLNJS)-z9gp7G7lV8-KD5j z)i`3REMJ~yg~~1&Y1meBLVe&P?2!NLN1gE1+q(L*_JYvR_RXQ-zR=JPE;RRAXw2PM zt-+qSo9w+9;ke_&IPz^%Wl=lf?WyvCY#VU;=M_XuWtyy_#F=Sa7_ihGSs zf5RfLnBlwtJRIo5!$)n*J#8(CPbWRIw_|W07ye^_(sDhYuK*X;&&RryV0^sifc>1? z^z=mOYnjBeGd%ab6XaUanI`qrx*^Hdq-^?rNzY;Xo$mJ!Yo{tZv=~G7_-fqpDkHw4 zu{<6!CynN>fnxX`cwEb@vpnrIpeATfDSxGl2BHh_wvMmWy#~724SI~t8En;pr>UG= z&)-&Vqft}Of?;thI=BRP78r}&*C?eh_JW`1a*D+2P|&HU^94gV6)68}1J zJ%beY4CErDAf=dnL@Dqz2TGZrDX*O2xq67(1_Fp~ZT z+rjykLINw$#*fA;2Cmtv#< zC!{a3Qi+eEq#R!|zgVLB%I>0(vero@i<8Yl;<`m~G#`mBR=>cSi(HQ-%)yMDCSiY0 z7iz~S!U$RGjGz{bBEOjlg47ZmMPxNI5JSRKkF;ACLl~NgmZ;uI$7uC9APDiD;FpY5 zyoxgKe!;TItF|#hXF1AEK)D)<8N@~`v@2Yic1GoksRkX!@J8JZONZ;@j{DVzeO~XU zUb$nY)W%FN(YAum_G-d{^2`!`Emk`L@vH8MIO%|Q##=aHWcU5!|KdV@L*KF}UT1`> z<&aYJkWw`LG_OQ$T=*eGR|&Rc3wlCu5$xuWNYsG+W9ZN5G4kmv)}sw?cB>8!>M)0n z;EU{u_9Xb!jBcg*=~N#r-8?_pLCeqd(e!a#ok(2CW{X)Ews!FV*55-dnklpR&CqBH zh^x8}WV&3K*|F-sx-A!T%HP|VrMImvK$J8_@RlYcztmq&M*j|SW@DG?rG!>QXjt4$ zab4~Kk>?oZvzEzLPlUEYE$r8H&MVoi2^QkO@!1Qq<|4!dE-AGXh%<3 zU;p34g@4xh`o=u!`_8_;zaM2U%3f&w9mNDG-4Eywbg2$%4~>96PSWZkX@6!yDfMQ5 zZ_Ggs&6H_;UBXQCV`bMNOB?!8k6A*$2RfW%hanaWBivug-Xa^X=+G!&2{rasP^oPE zcU~{_WW5fRlSP!dQ0a@14o!$S0QcVi0&bIp`;_b;&dni7*0X>*mpE9G&>x{P#(?&J z)Apb&7nINwASElNJffy?gcB+rBh&ky2KlJlW`m@2Yzn@PI9yoB|dA!?) z^eeCamgaVWGWJ`xOSD^StpyBUCDdZ{YN8sYRyVChtH+|%|ABIMVT2hetxW{iB&_nN zE%yYr1CNlJq%~57^~LOqXiJ@!DEmaairHe_oJ}L@H+Z|pD{Gxrl4mpvWoy~nyUwxt z4c4`Q;Znj{z_86bi7&uu1}j_)RAEP{6eaBL$d`PVn?s(mmSnf0j5S`uP?ewJ3vO{t zD=9FN#i$7GE^lS^O;=cb80M=VFSmF#b9X??xW%i*nt&1RUVHOMP=vBiC(MTg9}w?_ zzY9)y)DH{{ZSl%YE#5f&Tb9U-Q5lTjAZ+{>zJf&slS*crzE=P~!!)uG^0SHX{E<#9`})+PKg z@Umb0Iq(p0aEmnsc>O*h#R`8?fpoMl&`a%m3p90uR-V+R-_Z51<9VlR97>ke#18OA zjP*)_AHLxGspKmv zZtY)Z|A!guW^4v6@Hy;Hn_|B69$kAN`=Ax_r6V}AiGbHKQ05~j6ElqlI1K-l*TUPm z5bSx%c4D2dvyV%DpP3@@8m$vv$$rJ!g>ps)WUWES{f;0Pyl8z1koyu|1mqC`lCu*B zdMoX}=&drTx1Jm5t!J!$)N`$mniwJSzv!+0F>GSbW7Z--L%mff$wIlF@)dsZLw_>A zOzJI--^i0Rv<%Wvjf0&=xWC_eKl0>y)~&b?ZFqa2=C2)~6WZnYFR?!!*e8rzv#k>L z&De|CfZEFkO8g^A{ExU-@Ba<%-)z?~@ck;u^Xb-GAkXJ|HlnQi;X602WSMcQi@m)Y zuurf~kYL}mVmx5a#TuLw>^-1#$Z@c+2e16Uq_|Oin2$$oSdkBj!~E?Rli^W?6Bha8 zRg$ehE+-6qm(d@@=!Ekx{W2sD>DkL9Yk&PNtG{uX)gP9g{(6$+7(|~q$&4HM1O489 z5F1AUaL?#Qf> z1VrOWX3QHXxAzCaWTBfGw+6pn#CJWo?!Ur}yT#4whvJKektzTa?a7h97r%I{m-gGx z$Iu(`pnSz<2K%z(?;Jm8LiU8a%Ikrzty-Lmv3kGwRxd`Ot+W?8IDww`^kVHLJx5B< zJ9@|VJx58;TYC+C&%>nWO}+ZQ=i$Wnjp?X@51UihVTOZO3#_-dXZl=B!kji0k|H5jaIBcq zCYv(HtB*6CnuEPzI$!+xy|=%89p@pWb7p85ZGvAStisni;vcTbVxiiaS6Gef7lA#6 zJ8=CZ@Q=bOT+asLi(bX`Od!wx3a+ODd+aacdOYwC`*vK92I7}j;#wcbTfPm~y1<_0 zTXEeV_{Z`JT=xay3tz%@cOb9mMO=3V_7uH65$U4pw2bSG&8|J8AqwG#I`RgX5!k?wS=hnljbyB6hrO|zxD7-dS6 z75Uh}X7?Oidtterq@_1rx-)&P%4nL7FOy6)s%cGArMso7Nlmv(cRE#4(-i5hMX76= zB;Ca*!csc$2}R}o%R3Iordcff2n&C zuBZG@xhLX!-0yOma6Rh(#61DmdRVTH$F zthYeR&m-+bszW-3^aav4NIxR=AZeiE5Qmh4G#zOU(o&>{k#-_c+@5D}J&yDV(&%!O zQ-*So=p1M+t`8!$;{HdZI^3I)(vbwDACOXz;*hjRa-`iz+mSXRg#hB&{#3Ub*I9m@ zTZQWke}r3!>omX8t-$qGfA5uN@U0GYYmnqfJ$PmkE4p_JG^Zf$2J|RdXi~B`6DA(4 zK>LSEJSc0Znk|Yux+38}m`#hc$uV*_`z?>KQ)Rqm+1e8o-pP9Qkwwcaf*RWTWq15+g5$<$O4Nt&fTOu)Qu4XV#Cg@K@!AIA0e3N1xS59)bJv5+vnq#skxQQlc+k)I9Y9rc+`J--9G zS4cDt^(Vw6pQHHA_Y|L_1mDs3TKJ1xTOW#%l9@!hQRJ19N#KOjew;tT!xo*{P;0gx zCtazg1Xh>_3#b0K>yO{}62nXeUgsc9M^YaX#ela9J~~+8wO*NU!pA}XI3Ru=pnFF6 z9vGV4!$>w(^$lKlK~nG`kRgTxyZ7J(CJPbMC*ckJ{dLzp`SaS8GV*XiSP1^7KB8Y| z0H3mnaQhKj<6G&>Loj54*-ZLB3-){KB%dnLs?er43VR#K3)6o5meo);Lgh?^-iBdI zjH=@TVu&b2cl;K3dP$opsM(8$^NondCYs4lh&s!Ow}<^F z+#F^cqSPxrWT#QG4stBfCKCCQIg2aJ0RrJ)INBYOsBi{#MIzzFcbmWVxepsy_$RA< za>=TFF?@2hw6|5@*mf2+6drh3htMS#Ay*Xho> zsotR9YrBNi5UEBwFC^VNR&e)T&SRj{N;;_K&V$JPExgGwjVb?2{oDL-Q3%=*r2cf{nzBJP`f8jUc!GrL^V?WZhbc#rdjm>;;u8##=Pgaut+yXpF| zq_y^w>%4nE#+tJ@)2+fa{g~!XIe!EG)^MU@xEua1Ee&j%+}P!MRN&+{#3XQa`sqxs z!5oFJ5~L@}Cx@?nrXz~I+ZJs*gOd#6KPppuY<>NpobWk}K^-sOk3RNktfLb2@Grx~ zV+_f|crsCq7`^hhh_09(`v0h33H=_XaU*a-uuXoSWuhzLn;5!Eq=(IJB~E38_u;{i zgHH+$7=9@G_vj%XFg&bxnWQU1)P6(!(qFp;I}BLsRXSMgnlr)?#|`lVzY;kI!wR6t zbwfPqci_p7rze2hqkinc2uI+%b)G8=ZLIg3@&9ee_BX@>eonaNdsI-%l6YCcc5jG- z%K38-jR=!n(1Kz~C+}fs=CKhau7c$|EDt$f@lIj5)>!)vi_J+EOlvLPmPPQT62*nu z8uAv~9?v7VLM|yg7AnX`C-u!2=uLPS#OnKoSd2PbyQUN|sZ-FKK^-f4{~$(<;L|wR z=(0jn_ZZmdnmZx?3fp`3z_Z<0y#2IW4@=zO+f6+;#7wEJ8`0KHu4wqa!~EYp9D2aP zFG_lzbFJA5=)S>l272V zr8mSCy+l{Xpb5qZCOjAR(%Is2SZSMuuu|&%WxYg?`Mrtw|3EJT>#~KVuyhg{0y1#J z(d?t>(Q*qbyo7mmE6zo4h*`b$;0qNWCd~unW!6x55PLddrQ{1T$Qx7EQcR_ny;B^Z zZD26RM<;w{VPYvTtRyTl!lY8dBO`F7uVwF&T6UlB;Rg%W%*s@^z`s&Oxp#zP2QV@# zlj+22N1|=`pH&lWo6)NK!B3p*e6X@`l*mV=N*rWrWWhD8o^(yvjS}4B*i3 zvh?@D_RNA+gI#963cWBFy;1g?o+v|4JfCS6{vhG!LeKaj*mTob_)7sp!7A2JyUMU; zOnv}$yz8Knt1afvN(a$d1eXX8o)Mt5KlHo|N?W8dcdU2(0iNS%RYki@N?`RF*9A}- zw827%(mrZa>>yl$(&{~xHT75Oasz3s}xY+56H?46LE*7tUO_YK&(5q+%#y{+*$4<%-k+<(+N7UM`T z=gRK0S8CS~uI?yh(`r{yU#0Yng=P6LP*44AW^6xh3zqM)Bs!^e#7(&mqvdBGba1SE!C|oP-7YZ13^`&&PRx z$ouOR?|Q5SkZ26)=OG$PZXQRb<9F&!4m;-PPX{Ng_w7J`E>^Ai<>a9j=(E!3Ji~MB zkQsd%=a-@N?;L7DuZE!Ks8>I2Qyk#ptGpp5rZNi{`b@&mYloN`bw^Yf(dR)2i@D^4 zqZz&+YS5RpMC($|($h}IzxC|yPrW)l`WDwH6Xigx0j6f4hs*hm-VvsyeSN%BvgQAE zWZ9Y7KeEj5EImXK&mQgl-4(P;8*C$S(J)^X+P4JlTX%?JkD@bw54E`oTu@T#>t((q1K%P)H=g6QEEwOZ^{+S4a)Ha)a!xn zzh7yF&$thv83T-&PzPbGewmwo6}lmLC_lb37&enMw~Xytgb^0sRvgUx*sH7f$Q!jg z?+WSK)33w3mRzY_K9b-x{V@-4Rvd7XZ)Ex{q-&qMpLXC+4-zdb%OE`?y2y;Eb8M=j zMJvU>x(&10b*~=hS{zmgP9HENTejkCnw3BoSqd% z_9Qkynvy}1N?TW!vBC?B=}_?IXQ=a!-iz=qsmfx6i+-780rD!!s_}m7UV2mA{qro* zO##+GjPXevll(;p`2v$Qe$!4?YNqeX_)> zI6su+5Q)>!3UHbpGieC4liq}%;AR)bGZl?LX_9n!i>qk)>y}^Tkk>6Y%OS%chujZ2 zq-c3!;p+o4pqwunkVF1=9;!^?>EDt>vm0_d){MZK!kM34fIfX<9wST*+z@ZT zvjD9F>8tIK(|;n5(!#%>9lF9r^3FA!x7`rkURD_ASK;nk?*h;+qW?)UjiK-)&il7J z-dMxl{;$JttYT8$EH#zM=MN!z=sx=^400W>D^^JB1& zoA}b+d?q2L0PDR#!Sa&>Jy@`cTCoA}i`co5^ju5n&2w0j2A@V|#{;83^~7cCftS_5 z%OUL7A+D_@jHw8w6UgT3V60-n^dc2(p=me4*#q-2Rl z-ztx%<2(9Zd+Zm{7m!)wN`5%}i`b3zr1mtuC;50&eg2(MJM-_lbI%!FAknkxsn7+4YpCKX*$WRxO@1E+ngX+J#M5Keby=6zk;uF;fdm<;r* zte7>~uzn}`85-B^a*mx`fEdkk%%%x3Od^L8fB9x#29rALlBQk3=nZ+9 z8yjJZYSJLivkmetm&A0o+WkMBhuN{EBs;K^-h^@$Pc?R zC*KE4SL=g3jnz^g87Q+S6wADcNSL0_q0xbHWNde(Q3YOls*j(=k~xS>Jzpcw$SL>Q>ha zUb*%KuL4Plq|!ztvpXlYFdbUiUg+HEg$RwNL$6^%>M~}v$&t7WZCXL5*EK6{h@gpp zcZ*04-wbuub;$8G{FIw?8RQ+e%;Ixt1Q|Dfg3gPB-Qa z{(E;s@`4ugHC9%mdccJmWn{Om*BFEd1>2zw2ORRcjM$L-z1pQ2NcVd+xN2}!U;4{`p2~;)!0HBeDt}&d>O@I1P-mDf#(bDb^q@rYCPbwc&z6rjeFm4{8zNOG7Tg9su)j-3xbM(iZA6}Xo#i=EKGB$Ps1f-8pCs1zL^v^$z# zl4`^$r~;m) zdR(u$YdcKJknubD=US2h*A@q0yk)#`nG@IPGQr2$5p5!dFDR+)7$eg(vXhyF`Ouk% zp77O3VLa<#{{R20`ww+I!476C2j2gB=V1QK_@(zJ@c)=}cZk^zk6ed3Oo&q-5&`=u z?s4AS`L%=Ed(9CgjbEGG%vfdndZh-@cB8!P-|9L{TuAaCftv!pv*k(mBCoutvV77N+wy|xR|G%g7+NYvpX2WR#=WPjSh^5Y}zi1%sEn`N3Sb~KZWt1yHt?5 zzp;S-mvZ$5qQ66qk8}k6HZOAqv&b2mMaWZ`$92Tw=zPU-J?5(J1+--y%`j7FhAAky zgjG!t#y1bWbLH_kc_Y!9dMrW6yrQMk?2iKC{R1u8erV^FcICVa8!git$?g~P(Rc=4 z0YWd;NbEO}*1>lI_+lLRWyaKw{3<1w-+Mm~e za^>Oeb2K3-=q=4I^i#^UAD@ZhYp)PQwIvDH{`m|ydFPdTVFkSK$`K2+uBMOv`j;3* z2F+o=&YinrAIeziX76CezjdiB`qz1tU}DC;4o??TuW*Ku7^e$L`XL;9X#ACj_(kqC zKGz+@OkyAG(TC!%DEK897c@s1SU$F=vCI%4|;dMj{jfd)!0r6@;d%Acw<%@uQ@>;+Xp4A6Yd_a7=S7Qw%CN>82a$aYj z+n~xZAh%z9)~Dx#r)bbQn9adz=`5^Wp}T={s4V7K7~-S`#0!B?{B|yYb#P8-7TG&9 z@iDvtC4U0{Y0$$D1Y@^t1YK@N`UdGL(s3jYQt`2m;>HLv1y0J8$1H%3k2tp?mLjP! zf~yM=B;g%xa8?}TU4o|Aj9Bz1!Xe=W{gN3Qg8mZN{HodCyWy(_t5tI+TM!U81>k)Q z=leeA-`&NK9~_V^vjF!>q#y9CM@mO3CX7J#pXN0kq0t$hDa3zt#afj(0n^zTL54ld zdmD5EHJ)z>uA>jmLo^!r`_VQ;AjcPgG}a#35RaX?s@d2>hn_~LHCVzwvCe68t8;>p z2oBBmOyW}RA2sVPN3GkF4J%eY0jqK(qiV-9H7|=@4#h|WjUD4SxtX|djc}*c(n*;G^$N=zHA>!ec+YuMWW5<}LyL z`un#ZkNy3NQz`6%FytemA+`^ipS>d+q5;Llz`8y>9#aDDT?;?Z#}1T4SRoprHkB1_u>@l`r8Tz~)>@KV4i@Iw7wfh|3v=PZk5%DK zR|_jFVa~)NW^9FJu3g=jQgHuVn{A#wCgUG5TWx#oJ9N)m!ktwMzh5{q_QFsd@@ z#-swh&1TQC<=MkBs%^!R&%`pU>E8Sk0{6kMj|61ej-Y}6*Z-}=q}Dzbwu9R_ER02hzn>( zI@UWHO>5@R^Am~=6z+#+-^rLVOL((u;ioFDT_zvYlxN=qkE4g6)%s9o%(*bW%p$bV zi5GlgmKE5qy3@06%Qkn$!=C3V&fFNG4ZHoHyC!E(2J~A2{U!fdx28kKthbClXDnP^ z_;|(^i!py=V^O{amSDi5>`jZoHq-fYp*~}S<(Bh%VLPr-{1y5IWK;YRN;u`ORekIn zg~(Lq&Mm0tD0FZr@5ef>T^T+`U_&g3Q}b7NkA2AYE%c0+7pgln>RFj_jWxPmHe;bC ztw5^tla`|VkKxB=Fv_h!xfT9DV3(bIMQlQ;oBZ#)+X_!uPCD1v&o3ID@vUk?f!Gwm zQ~V&paXN5Kc;1P0wGZEOaAgu7ajsPrqi6G7@Rd6~4bleLGR<>dRApZvj6B(`fiD8O zTLRpqI}d^zxaMnxdo9Z5q`p(hfSBz+Sh&Ee)Le+Xxkgn=P=Qu_)1TDM%HJQ>Oe^uFw-HG&3h7eHSRK99Kw*W*Ywq%0&I5^11B zNgkgVVXH)SJzW~?U(L7$WA=7v*uTY`ve=#S4xQ#yrvBW7!n~N;Vc)SU?--$%{?&o*yQ5AFtVpuk9&(czh+!DxSStNB_S#D2)lZ$#+uJ^$O@LaPZ$7W;8qF*yQ`(h2*GcmxstF)BHRpqs1#X zzhQ}jMWF+hQ;ywS>uCEMko7>#vR(Mr-1+Q~MTlY&5U=;pFP*O63u|CW@@@C6E7Z`; zrxv{EB^e_O=g?KNJ>qMAl&M!D|9o4g4K`Dz$$8{U*CTF!Pbqn9`ZI9wMGqwXZpN_0 zPJXcn=IJlO?=#w6{u%Vqaiwu{H>~ohWYS!KcFqcq_y_1N%Z6aIkkMY_**2LJdDJ65 z^d9+eHFv&^9@z!2I?$CsIf*FKfwE|fRPvj6k9Zffvmn1>KQ-M2Z5%PjKN{YRf*6`A zVd!uWL+WO)hQT=O!)e43-0Mm9oC3eNPp`ORMK-UNye19ylDrVskS?`c@0U+*M%z_@ zE+u2Wts7@9a?|uYk2oB0L}~1#c^Nv#-62xUau;CD>NzRtH<>#x;Atjog)aglgb%_) z6yWdQckIWB_Q>`wHRQ+P7bAazn^x$#|2u9x;KAT-B>b$MB%K>`CyfDvdRoEp6n%-t z0Aa6LzQI>z{r7@8B=v-@etaW`s3N@Y`I^5cG13 zum2s>=jp7AO6F@tI!XgbDq#x)*z!UCGgg z5ew`iGU_ZcR|F`uE=ZwDHN5Va@O2)fvFk1dHoH^`BfQl0l@uKg@_!ed3{iY}$fv#w z?mKvBeoORr2JrObR+Xc+GVy~QvR@o4X!ly3R%t2s1ZN!MnY z(*wWkdh|f8h0Z?=@Pd-$oCVLt<#>u!4QnEOifHTzPMk~UIEA)ld9%C|p_}-=tTrzy zr?zM?BEm<)>s-3oBdSj0>$%}pS^GyUeSN1r+4e?Wjx8^*%{>cJ43!!Dvh!3hR$Ta` zfSBw%g|_Ux2{tGCZw?am9Rpnc9h&#j84TN}3o;n>=&7C$*!kW`(9w`NX+7o6p$I5KjkWhH`l8?e~=E5kERb_@goiW|GT1;`$z|^+*>pSI!STkpoRq{Rzo89e#QC zRIm6KcckiDQ45>drh`ifeD$Q;$+wXiBjI~{IlhL=M3wNoLEGtXKdQyNN61r zH!`VrVQ)Vmt`59{9ES_3e+ZN7@f3*|SVq_N<&~DimX5-~kP}8X>nBxOWXlx6#CQ__`*>T`5yvPy;#dzncJ;%TdJ5+W&|OM7k0^m-4A6kufU^JOhSno^{1vZ9 zgb&li7AKSFbA5%?_*9-spprb|ke)3#$)&NsPP&c@kk_1T$lnj=THHScYCQ*iZ#Bmx zhc@29vtyVspSdMk1RneQeK&Afh4c*igw6@})lhR$#=Al9BGyn1UR{k{@i-^K^O)Kh=;} zJmLl)QFlQ61v7*yYa?==>iWBMj=TZ)f9m=Yv}fLmb>~aadG4b<=;gullt*0Vqt#mg zab)Bj3mNFC!NVo-i=OWlZ-;)LM_kxf`p54P{K0j#^0oMU9o92A{Q`wX$&w{_4Dpxq z)w>WOY_4CNK~^gU`LvjfyuxU!zOY9;6d0A-nl}a>GUXl9xwCB%31`~|r=4w!Ppd5` z_s%gH@PD%DY+KYr<=$K7mV=`;IoNebi-&bZ5H^D^z+@};ij^IhA{*pJv@tW6EamhP*_fW}`;_e1Izlnh-MVugF zz0371>C-g*vMsFoOK+ls#p+FfN4m1cpw8u9aPy!p%JqXQcv7D^Bp}KqKaNLHCygIf zsJCCQn{XB!^GFjIcC_eWg)?4~kZO_B4ZQ%Y1A2r8q66@zj5Q8(UO(XxtFS{6Yh0s)hj*%uLT~=hm1ZQkyOJWADshq??G#T%G`F}}Zw_>Bb* zUIs;wUakw@)On8sU%Eb;s0X|RH;pOl>%$SzkJSTDj^Wsc2#5?kJQc&soL{^rAmi-~ zgQ~f0U*cqvd3h?NKdR{$SQjY?Po;_qdbai`YT|g0`{s7P(9_@UpsbD95%}`q9^u4q z+Z{L1?nnNu-4746y8~w|9#J#UZt^?=f7^ZS)(^Bh_NI0RXKs_!Zh2q3TW@N2P+R+6 zsgG`zU>%=59y8xplLF#UFRbvOp~IMVS`^MiXf>HT|Bm+|Ucf#V@i-I*;oWIQGx)ws zma5|8q*A`=;l__`)>~_Shp+Sr77L{lzrtEJARa?$%`Nb4jJNON?dJiN;T-ffXs6-=o<9uikuZd!h??Abaz@q8ZfJdB<9UfSD zL0d4( zJ;kDov4OSjM}-i@5jWw>(}%l$*`{9~jBpkZA8b?~>k*gq`FXkzex8WNZP0@Wh;b6; zbka%sFpFR8h8+%Rc8tE@5f8(rIXH?3$8Vwm8o}X4P{P(9C2l~hGHKS38Drr!FUvXN^p_9lHNCu#6d16KMK@~L!|Tjr-t~k{wK+WHB_4A z2{hVH*3(ye0vd_>0%9|?2M`HET3?(3PIme)N~49ja}{#G3_bdkKAw@rGt^J@7EAG4 zNuJA+Xs1T1bqsbP%$?Rre(@QLvi4GiKn6l4D{Ag;hydVVDQ*8dE<3GDe` zkCA=}uE%#Ydc;`bD`_m`j0$L;Pb$G|AVFUX|CSyx!uxkb^jU!1-$^6gIN!}*P#s@% zUjzK4-ID`2rug4+xAx(T;HLG=C1{o+j$QFa=mwKdU2nsbBagx})sD=_a~3`n`}5rX|;=1^}G%kd7QO^ZqIVYj6#$M7OqqWI6JRR?)xqkubu0Wk%^wl3+&mnv` z;#I-FTo=_pIeQB7)FRKW-s|Gxz*l|snsOdrJ%qH&RaE!KZHiTouTb!z;N*(gJ>u?O z(u_{bNwPjx7%j-vy2ePJ%~)!0$gj0bC*N0h=@7qr@$#*fz3n(>c6u^p=W8tM7zPh)Ph%FKU*#AHX>Rk2cl1`eDQ5Uz-5GuDCY|t8;FYsT3!5P8)d3f{r@kQm zy)OO}I~s9PZ`>wfBX|}t664?S-h$N^RdE-7T`m649!VtWN9vOg{4^I6ADKHxAh)-t z3APc}#Xm_AT}W?javw~j6GQcrF5hs;Qph6lP?wi_V=Q#-&7BsM@b{kUVkN8#LQ>U; z)UFW1hw4ToD2z$tHMND)aC&rI+=x28r^n@c-P7#AIJ`ZLK39<6;V!`MKe-DK)t8eM ztZ2g>t*;7J{D8Yi^yPQ()jQ30$?eX&=>C5BG+VRVfE*VjI))Vv>fX_FtWRc$1YWoG zOoLY=eINW1?0}!-t9A9EBNcwbBJbS3VO6{>hl#8SR}ggqa6d#AHUjPA*&*3KdySZJ+s);aR{8Qj_V-`m5~FbPX-L_G?PaD(`uouTVuMK4psCd|sDZxsAlYN0eT5QZMK$)JNGOCD`I?&`-A@ph=6U~9k( zdR<(JQ%Y(f(@4BPZ6rRRb`~Gg-U+yQwiWAuz;)Oo8{tDQ)VXx|b#YN|4`P<S3K@ z10GGGIq$bIgBe2zBE<#73EdR8jMmKou?8_J2sYx)g$yr&P6?TcYVNcNkT=hTyuJ2iv3@^l_ z)uV|MWD#;cj5oNVArZU0Osf-T?;dFC$mKG4IUMeiPn9L>`Dp&9<^?17O1diSZEWj@ zIt^*6{0tqG39n@CYuCtraUN>t813l=BY(uXG-7@rm8nd}vYZP>GRZTXpBVE&DpOTmrO}WF7kOD;c@hhQMEumb0|U@3FLT z_h=`rfL;^yez+*;56Rj&cpQ(=M3QEc%z!n%JS{QwR!#(~sbiug_WyPq2IwyM@X$8x- zsn#R@jRW_@6vs&vgcafJ|NQ-3-Lv|>|Mg4CP4d() zZh|NLsOi|w`cZYc9(Dz6@L!XQ6ASO~B(J_BbjlU$HL>@%;iN(?7%k#woZ6Eo?2 zX-{v)d1bXq$A1CMR%kC68AK5zy{jE~r@}injVqy;3dOV6szeuO@2{I`R8x%;ZhmtE zbuh-OPKphObARL_z5q`g9p{qU2`++(^2&I%3mOm)ywSl<9(_$AkHWhf&bX2|ib$AC zUeMXwK<}EJnQAElAklP8Ljhv`5Dl3?nKHz(XBzh&F&zU}%lE0u!PCjkonD5~l$2X0 zxY*=D&MUmF0XjGl;Mv?quZ7EY!#_`gD-Iq%I$ew&(a`MCq|37eklj&dDd)#ulS98x z&V*qMD8~r!qjMzSYIDhw+nQZ&!b`CH-4>UVi8X;Hg0bRBCUm)?Bh<|YJ8sn!WDdH-q`JQbmrl9nKG=~b z{U*b2zr$}G-!Q3R7v&9ROK8K(CkNYTZu@8EdFku(?gS~GK+F;7+DW zvZL$V1Y4a8Z?Wg~9kVb|1&9yQS6Fv^CtGL?b7{xz^0M{Q_;BRd1>b{Iz5`mVYP9DS zH^m}^#-ww!k!=o$h2X(1G1oWDAhVG?&NQ;gAP&U%^0#hv9gNSZHG#zfL@4^_=XXNm5#w#*Sm-=U>2fEtI<*_ z@AFcOX+mI9wU@QM;4L$SREBo2p{i}8c;jg3^oG#WA3OB2#n25*EhXK+cR3?#WRFSz zjcg%9Pr2OpcwWqXivMT1CCqRC=$l{v8gU=Ptp}3mum63$RN{wHc}8|Lo*t0iOjq@P z(SHr*-`JPGmfOg{8qGb&+$QCW#{cISX#8On2V4|!?Q1z1qW937 z5aTZ`A=_SrfA_@th48?4H89H_E8+bqUtEO}9!x0?SeYHx!sE@t>h-{y?Fl#ipDpNB z#qQaHR`sqjyvE$&C{?A=?sE*k#6HifwuW!pf!&8Qoe!*2!K*zhjB+fv79txbIKtqI zpgc6?sSZZw5K1?gCbO^{$esBBA67Z2Gk2(JM_AQs-ZFhD>2Ao5H?sVoO6ArF%s5); z20r6dqBLb?Nh{Sn9R0%xlS{*Ef_0yV)!%%oyK=1u2fgu6O>AEp1lsy5nu5BNOXwRzOr)Awy;Xowuo(!+qB!Jy*(VO z7tX2N!A(?d9WIoIsazpDlvR7$nGn*0XRZ$|OWwJ;A*p&$M;X?W>|~1gs)DX1%O-D6 z+J>`4EpweOBiPFtl4{})U>2fp^eX7wavZ*?#5a28dY1If$qol>Qp4A(YQm~(+qp2w z4)c2MS|5D4yipofLuZq58A-S@a|t(;pSk{*wN(DoD#eA68fEos(D-Mrr<7f4Q%_Rv z*lekTcEu8%x{^tu2(XMHsq$Ccq;?VZ?%|1Z*LVzvl40jM!}I%hG&>2u@$j_&kiT}5 z&E416T<2A8GI9DPq|pMCLG-4>DE_9ExcRy`0oXSS`Q^3NEW8cAQ%Ua@mLm_#Brt~S zq6g!>S$KN`QC#(%)mG4_N)|tR{3q}b%@~OC!nUd^gVfh}WjOR!&BFNd;ewfCgasSI ztLH%jo@(BA_@gVBfk1gaCDWlRe^zPk7*d{b{mgAve)QqhSHdBs;rCeTS@f_ryfWM! zzEf30k{0MZ1n(<=E8)WW#h}%B>tf*1kJc<>y9Z&9k`;ajDnhL7iY2jOmEqeB*S>$8 zAXZj>>788hrFS~g93*qaBd7`W7(=!($&SuX%R;KdE9Y54wgov>u6p${_$Dk?;+xX4 z|H(J3;lW@DXo<;CGWG>;x#?c3u5z}(g}vZi2YHbR;SBSxoJK3xmiOTQ%(i*JE;Ef%E86=@H%OvczC?5kw#Y6h7p zS~aupj#W*+jMiebUgK$eoAMF1CiVU5P^Dg;$3t_rD0w_9d|4VC)wc0fjZ6aDxzX{T zMm*KFp;B&?V-CN3lE>b)=TC2Q#szN=ap|hD8jy_+IlmOP9=B&)3t5?aEjpUUu1?p2 zgG*v*oT|G_Q7e8>XI#t1uPq^_G#XoyDGu809WIO~5pB>|cRNi6ZYthQUvRJ{hVl*N zU%DI!{JiG*O6*4=?L=BO-hBOv<5!B@14)@dJCbS|bBH@Jc1}iY9Erbz{Q2xU;<1F9 zA=U6}-FbfPu$tl3aTyq!3`sS~+ld#66Wb*&9#V7PNGvtPTMlVclWM;6)@?Ii|HHa$ zNKYrE6Cuq`?brzDS5t}F+qJ3Y>r2+LY1&EBSob96*hw9ii2LBlTKFT*BiDGU-oAvl z#H&}_#N+*A!y570+b27;5lPkGd9${qTpIC8JbxFj*+~%$v<7AC!456P5N!n26mto- zKND5SfVlv5#0yd#Sv-}B_;^x155C=>1NHrXl)VdBROR+RzW40855jQKxQW0hii0|e znuf_R!1jWLX?04i2GPzSm6oUCWG9A;rCH}7qXjc*7F|@7i&lqAhFwqB?|0BVd86or zOhV}%7@YwG{-3o6w9`4i@ALd0o?-Uv%e&uqy=$#^z3UoB9^)P7>-q6}1E^X@hGHt7 zn+W)n0VZ`!?|2a=`!9_4;FF!x+9=oVetsDru;=%EVBJbKg8E=kOvPS29c{%@AE>Ig zOqeCUf8uZ7AFDqg`mCSNL>;4T&{qAoK73t7V|(O6hyxMLy-yb<<8 zcmU9nwrdw^r_)$&0*oePjm#9dZDJf@Ln5%jKT~_eR{wU0?x)sV=iAWQZG1gH0b`ez zv9na&tW+^Ia0&XO#q$%H-r*ABT-5sh4(i=_8?BxNVoMv)zwr)g`)~)@Y0iT_zQ$*C z6zj#i{xC9%!ySavac$~X+hEhwCZONI;E{eO*Dck~7O^-1@10HkUc%2C>35pgPVynT zAN`)~I?pD*0cw*jPs&i}>3;M#w$NL3X!Olf#3v&0=8BH^N+!|R`yf>hD+_T{BKn|` zrxjS!MpD8uw164C*S{Xl5b;vGm#*(`d8=C`hu>Q7ykb0CS0Jm-VB8ND`zcv+t`E_6 ze=Qwnzo{~es5vCj4r-pIn3`D5^oEP=gxG7s-|E)LPes<4_9J$WnLY;ZL|^OJdf64zz|0VxV`iEa2=)W2e8=-#%*62b{O!Wg; zD-|}4?M~ExozUE`NWD^2^WU+*(EE1HC`_Lb+uKC#t)n@2bdGYXm%*)m@JZ3vmr77o z?`8EX0k4AoG{5Cj&y}!q!Ka9N9GJ1SG{f^j@iJkB*lq^3yO!GRye^StidSx~_EW*I zx3W1(T+yc#MTsl=pG$tbqO-bT@Apm9bn8r5Ck%PrOH^1XaPGUN(GiRn+Y7org0Sn- zpjNyh`OTF<)LSLlT^)bU!v6EYCUO17>Wj=LO@#YI z1H=&|*opUgKS8@jA?Vp0NQ;?U)A0Y{Qj)I|gjh}v8TLTQBJ63lZN(EIi#*oNkX%G5 zynHJpT-|uv4w9xFJnk7R$;AJRt%^!^XTkyLPTc`+XZ!)lPDz}`p{`(du0l41{C>G( z5iC&1SMuylSk)T&pjVB;wbBH~>ZlO3L+>gs@wXRJ8t>5BP}k7Trld`cM_&$a?KuK{ zqQ0R;>v+*u7TeVFF=Aw<#p~l$`WJmWV~xEpZXM%(Rr+3bJg?=S8{p#3-tX<$x$n;n`uY&;W_2f+V{@+ebHHEs@-X zS=@7d771V8Z+r$4lz*@Ci}gQcE}uemisTD9iuIydM$(=xPtql>)nDB`@pB`f*hf{ z<9M=i&2Tb$Lo1uAbPvyqa^QXQiGMBuADg-}(PlZXoQ0a61&*i^@H!4y9Lnk1@Z%2GDOP^k`Hcf@Hk95jq}in-$yc-9NQbfA9sD#$(N8;^i+9 z?LUEvGiqpPV@ zTj=fCKkWT`Gx1JZ^QFQw*o_r>Hti>QV07Jw_iclJclD9=x4ihF&Suy=I$HdkS1Opr zXIJbW<>UoTVepX4=66E3N^3aYPmt81f!!8Qt031@ANB&eaWaeIk6npnmrc*ttIAX|1KzSbqSa=&yz$A3w%E9ruy^Cyu|+d-)*W z5$L$d!~8j{g)q~PozX2j`Hmw)-h7NJ>c3uNbwl0q&28~8Z?67xvL$o8R^4G{n>}!X-frAx37M4M!n^pQT9NLZz$sBqnN3recD&cF#0Ji z4$x0bGp&7Rqb27Q*po@yBn$oP@sk}|ahGHo;9{8}dH;!6@clz~1l~&v!L`%#~+6e_^!Or^PE@){OT0 zvk@6ZDtskgIaU+z7`=AB>Gx|scYV!gg-3_D0t423MsOF!I~4XtJ~Sif)nCFjmG_|5 z38U-rE+5h&s%zLg*qq>~GPQX6sts|gq7%v^HYGT)0z(@tG%FlL)q%U@kO~!LL1m$3 z+Oi?HmT`@Ih%M+VFYVz4U$vI&+H`)vR8pXgcLPF7)viT!3RiI0Bg*Xyy8b=h?qBC2bH?8JXt%g`wT>=su zt6~z$A*m(pG+lMhpQ>rm*x6a-Pn|e|t4aG@(ECE}To(QBvgj(F-No!=g#_gDYvhxF ziA|lE*nzXjv-})q)+om*^nNt5TayZRi2YB$uBmvhgLW!P)Ol0b{8I5){65}OZ*B7} zuNzaQv5klH@>CPy)q2+-6Cx@#1(d7p2rA8L?T9aJXASJkVZG96Gs(}Mh|Gc*Bu7@Z6GzBnH@k^xA^Cz~3`T}& zPbGO{tYhA7jQ*XLY4JpbbF&&+h?kIVbI4nEY@Fj{ctnO~=Yt8Eoj0g@Jz!Sok=H03 zB&EmO*iQP6%z%8nSyN8DsqO;tuvE|5gNTc5QrJPis(WEEm9~>u z=D~!QE{rLAzmw$gJej8$Hut8~k37Flwn;|M&X;A%R?5c9tm2(P zvNxp#;t@UnrnE2jEa{!}i`&jZF6_^bD1f#UR5-`EB|p7>Oa4jZDIj@S;xxjidd%>= ze8rU+PaYHPeRwkV{rsSIdNO56WWn=mf)yO_BJdPlVQ={o*{i9_F*Eho^LIcdl?vI= zl(?J&`Ji;YAJT=MJ8QpivB_Ve4eAM-LQi~&qi$D2{vCK`4xXuVrsPM}H~9h#tK>&c zZOMlT3t1<&zwwjMrAl)cVFxq^~Ya%n7; ztq#{%;cr1Nwo1E8rIPLp1X7s_lzfz{FISr2hljEEd`Uj^^goqsj^XrdPnVeaLm^qk zzQxEHvTruzOAyP;S(?qcF-Nb|6dHS4wr=#)JXRH+Vm9{N7Y1H><27jGhnPIKfvXE1gJh6}e!>8RxD+{|| zsfE3TnM!lE)NJe>U&uvsD z&o{f(LE5%So_Xu#K30P$K43XR`Z$BJcV`Jpt5htzU{`B8e^K^1Mjcz%3M^5a+JbDK zOi$xh`cC!STr*bCN{qtuB`F*JoY#h1K;7+jXyC-Vm|%ZW03)p5e7=o3fH{WD7>~c5%`@ldVfAMJ=G(tvBnO1Lk6u_ zy;D6|HBaRm%%`^5w(T)lg)v*TmM!^4)O2O%v{_@p9VgZS53E~qi2h$&8dY#|O(=ZR z?`d^FJM^{h9#kcrSaTLUfHW|EZqS^ES>D9y8J|Y0a4(l>+^j~@s<$9Jj8h5!vMJy( zHw_ZqG~_e8SEK5aM5ye|FTk?)}zZryx0E}@;-6&nJeU|$BxY*zE3iewj>Fri(q0n>mFxoay z3pW>~lm>|1e%w3)8*?V}v@>G7f`G`+$wQZ}&v-_j5A&6nJtJdVW2mHxHl|-J{NC%Ttz%k^XtuaON6j zA=V-he2_?Tow4Sec4-z-R&rldU3Mq&<+?h=DPZj+VkOLIgWlR?vjO`%7@PN=vK(6(d!d6xPr0FmN+w^)R|&+5b30;gPjp~0=duRHNesZ6_| zmls~S{qQ8gDoeR=o#~D!dYZSmxPB&u)}E^YJ?p&r=@X^|jS9*|#Zq|L{rc4#J;n zz&y!Qus##KoLcgBkPnDSgtn~p2CV;7O4->tWZ{(JJ)T3fr+=V-o9_pV^~+ONJG$`( z&!H3xjfJedL@VFoH=B}Tc6Llv6ndJg4IR_*{r7590p*lZVt2Wy8Dn_-uUP{*T3yOo z!lu4lRJB1iomB6{LnJqFLWHQX`KdZzo_b~cA<%qm39>1EwI&?8_OXY)^UbSMv_tBM z{fl@u0%z5@%g>ufWe~~@^$TPd+8esD_ov=aOC2tnfyv?wgk5+fi?FZRtqe-_1{{t8 z>0q4}$&($@9=D`2nAE0M_xh(E`tC`?58Sr^%Dl*8FP|F0RcbXvOaD|@8>ZkG< zT!||o2wKH!Z#8ve<)|x~4&IesLU`GiJGyEhHx+g~NzHn+dhMX8z=CK0x0o`iQLEdV zlF=jPdXN6tob+!!d;oK!eB9tlN-y-Z;c4w8dg_rT!mYwXK3;=t4Tw`6Go2M>IN}qJ{tv_a3|Q#E z!L2fC8=6|8(ACG*GSgB$TMov8b8qWIycFL5;lZc!rVs^{K=by(NK%FgiB{2cy+4Zt&ood+qGSso1>WYTzT0dn1G z66#;;mMKqTJx~;3AG<)~#GP8`S9_l?qE>?oB77`nh5e;@x|w^EtvnR1ZP zC2wlppd+mrvVAZ;HO0hLKFmnTMP=kB8lgoTAuyzP1cLb=tff_7EspRe%1nz9F2@KB z7~wy+?Zv8p*y6>15xH52ic>fD4w6rC&ANlERP$(UeA>f@axVCJIVcJ{^c3^3H@%5Cr?KZ^v48Hz9>%Uf z;ta#y@y&-Y>esEPH?0GvWVyX^$OT5>?P8o^-N?~F*br+DxzGpb zKi5d>1}BtVJAgcTQ9em@wOhiS?#RA+6*-+#uR0DWlPC0-__pL{cWpzpSc$M5qf7Pt z?ZB4&DxcIEZobu(-Ib-8!rzOLZyA}Vrw>>&4CY@tM_VcQk5(QOTY2buD+fADqK(26 zfHm#-QoZM@{hYECYiX)y0eGT+1ty$Wa0r_J#?iKyqV2s$w&d3{)Vo{6c8zFvFZzb; zNX?`7%{}l`zB1Wy1d`&~N^q%3;+=Y&-Lk=E)#Bdon?|XZAQZl7LMI>=LY!xGEiC9L zu&}&Z$IdK)yfWxL*FRwSC{oc=t#cq>w4&#rK5of9fWy|l+rTr3(@zxpzp;ksfzKq$ zxDT57&7k#;hL?TDSm@)MNydbP2Yzz2xxsRVi9rkh^fj1in9f15;Ab!mSa={%ON75C2mJK5yt>xo`ycF3dS9TVN9fE|oh zAi~i)?1Vd=_26;$H$Xdakxd>jvnyp1!;rVJg^nfS@zECAzu(yT7J8y# z?HJ$i%!X?IZg9ANTvX*pbT;Qnl2bh!4`Nrvu)>d`6nwEymt7a$4ZU65n(B+WYM zsJ^?X%0&-$JhOI7P73yV!`}0aw13%WCH%Ot7FA&_LS@vJTXIp=w8cN)Nq|GDr}J?4 z1%maC5zRyDmB(uT8=M)T&w4DMO$ZZVZ58hh5%mb`~`d7h;8XA!A^lbU4<$_yS#})p&CQc3O}O4;?xHnc~2qbySM*V$7+3hhuiv#m7hwvdWC?11&eM z(K+hFkau>=(|M4J%BnJ-xysfOXIue~Cr+5tUj@!MEDRl<(YLU{m!16q|@x~iJ zuetHYYkmGVe(=G##nd-e*fAUnx_qdK+L%}7Ko9GFbALzQmOKaI6o$NSe!vM2^r7yk zD}kpu`|<;d7;nyDlM6jN4>aXLR%#^LrS-o8_3hZCc`fWj%onV)FI#B`w*@=6GuEji zJGgUJ;!N1n=ofmP#NPOtw-gy0kb)gqlLAK5cE=UhWhn`U4cvzzwLGofcVPcmy_E8YnHKb}wZhSd7$^?#wYNcF6!CAspB+9B_*V=2&OF7((B zlWudh{Fy8K;UTZ>*c3||xXZJUDRwxgn76wsGl&}(dg5#Syf~(Iyz3r5yX$k76*do+ zi17Z?;pPo|M7TM-Yq2ui_5Oxf;NE()04+>ytU1m_x^ONpAg{_)Qg^)PSu48$6&z$$ z3~CN28QWdHiH3W86Jg_jp0}Hn$bwzO%eqSy>`r7jzdG+EqpRVKfF*KfM@cLb`iri~ z2Lh5+0oh%l%j5&>*Of=AyIFQZ{|mjr{l)H&yF*Np?l{x-BWYcdv?nu-cq+RqIz789 zKCA5nAx){sl%7CdrqjqoCa zUN?#&2cJJ;kJJQ&^uN&aad&h&*Bzf;e#F$pnQBdVk3PFgmwxdCjRm9NHZ=ZU?=bKq zQJ=9R->{SroY;pd>&lS5`kRZ=?UVLM`Lue|Lrcw+Az+7@5k5nvF5Nn4E!6M8Y6J<@ z{6yCKEmH+%={LTxeaT&FaFc`Z+Lh|Gkci15_zk2&!TZs$0=Ysa+F4jD63DtMbQI?; z4mYRAa5kSIydPs%8+!*9O^=6Y_h^u91?+-?_rZb1RVU#`DtIFXN006w zu)_Mdofo`sUdtT0svaagg%Lg_g7k|tOg!*Q=Rcc|_0A|fUEJ&*2Y!%WoPumm zUvbnndW#XR#`VXXjP3(?JZ+AF_9O*XCm|MV{()Roxm+W&6s_aAR!o z4i$FpjOM}9GT0gymq=6KAC?gBkfcCQ*kgH?EGlcH_ez&blcf{wrkSZ zx=P02sWjO7YkL`MPWr~&x1T$adh~Pijw#Q7mOAj~SC@xooJ<8w3%`Ib0K@oFH|<8w zkX^``htCI5n`3BnTT27WRAq9@d`!sb!mAxY;h{&FPP7t5$ApUHPWq+UHO47i&EuQ zs(uyi#gvT#i6^<|*huQ+f-*1+N+MmfPUc&9A{;#|!(J`@tS2_q=HF_P>PtPs^rU_mv zDvJo-T+!O@e{)d3;byuIy7Dc495jf1N!?BaQ&LNhwCk+ z(cZCydi+HnT@{dvgPHQVv+ZJNx^@p|SJ))&FPRwO^U@+APJ?STQ*Hb>9i?7IQATeE1abhe@oaB6!D( zW;}!as_2jy7L_^@sE?{)MXrG}?L44-4Mu*97FXEaFvVnE!r16#DzQ zz2vu$hI<5WN}tMY-~hoCC4AZ$VNHpA7du(HJDQ)`PIR&uAJ7iyCt9>UGt5MMhZ(6Y z|4d&S!2H8@kNF>Y!x#PR&GZI8Zm9cYc*EN!dIuvUmK+k{_;>hdFgpK?MF1xMbV~Qg z5iLWIKfBN#r+PJDFEb;cO%7_-@X9uoy%C;@Dg24Z;mEHdRj`?lah$97Q_FqOR4_q7 zZ8L!d)Qdk2O@(e)E*>8rOhg`3I=kcA7{}3WrNk(lF824fbdY!|@TK=1YrGg&@GPpm zGHN!K&XdF^w`()B!URl%&3YVhic)ac6D2Cgab$|)G9(!)n}T2fh{)O!`AG3SyOHff zE}mI3a^?lp=tPVXIOg0Uf*$OAMbvX6Y76<{PB;Xt+Q&{-v{NNhbv*TW!8P_~8Rl{d zc6Y}I{*cLFHc1oo>p3On=<^mE&)HAI;>T)i8O-EFNO-Uj!#DWOp(T|26}7ZM3BCJ^ zurpY|*$K|l_Eo6+c9711>L4SkuY&TRc{eN(``$Njcm0g|za#S?d3(c4X@GKYp{CIQ z)u}`-;Q>bXJno(d-=#=#4Nmo#4sjLO1?}^%8qu*T2M4&w@gK0UZE~>*4IO|Tqr?iE z-NEv!#FkzkB#0M5cXd>R`5B+qpz1E+!m-EOaEPb)s;G{aI=EMrl^k}ETVf(I;vE6yq3NofYMUR5<1wBRz!UYGhD?BL zvDlY8hdzSFL<8tDQ%$Y%vMD^G=!C=}d8M?BM*YZu)UI?yHmZS(jNm9Heg5&D+@ko( zrCqE#pz@9`HH%!rMGW}KJ4Gsc$|eOM`?BdIo;^}@V?OU3;4@{&Y6cwRvIVsymJe~l z+B1*_TpgWr)4(6VP2Wc5A)3jV15#w=_{_x!b8%jdD|Q!FcKx5v6aH9R6^$2B+lp&d|&R2|>|mOv_AUP~}F_Rc9*+8R4+ zi4v2Mo2VHQSO}9?=y|+`_P$R8aLq#fZ44P+(7zGZhb30jGfK3O?2+atw z!Piwk0dPc&>0~DErWrZw3cc}%P$x~dn&FUzvcVLLDln|XdnRYy*be`bjDA^Lh)rpm zz+ZqTRe_#+4W&MdWZ5idSdqtUP?%Q`noi zGCx-TwSP-AV6#twh`s>iHZJt+s(Gn%COj-@c8{UDOwdDp)&{+ zO8#41Pjb54P8{vG-13hX@DA1O{0|+8{22H^F+wCPn@2AMmi_SpBLo#G?8~$6Hpxfi zmr?ofviHpJ++gC|jPPjD;%thomZ*DBY4$rvDVM!p4wIC^>YjjYSgAn10BC*Rsiyl$ zCnpu5x1@$<)jyx9p72^@Co?q!yla$q%)RF49S6akr4D0nc+q^!cAr(_p2;=wYQU8^ z*3G~;p6|Gz+AV)Yx`(9R%idFiv@-eEm9hQi#vAKYr>MpJpF=9g8EACAJjB^09giZ1 z5@-n--e?^SEJ}tB&5k^t0c?QbviGb0`C^Zd2N`m7Sf`)+Y(qB5ILwPu_iE&49n`PG z)+XTpQI`VVZs=1v&u_UvvL(r!qiZO<<@c2?VY|O%Nh-SIqJ+JST){Uas2^aNxQrUh zqwD5n?<0fUt1EfKTviXS?|eVJYpkJrIY&&!W~`yK`d;>i4*MmemcC;AdVNUkHmFDC z|I6NGgLt<3?qxC^NMe@jHuW8UP)sSv^9m$Zo2Oue3_RbzTUm(KjaP<-BP7z(X zz@YDQhKXzQt?>W)*gco~t`nHKon{{K6HP=Dh~%v%3NG~StOg`*`Q~EiEF-@d@1%aV zpoa2x9+<&g_GW|YW#QbrL+QAB**kFUhD;Z5Rn6Xp0B%E^s40f z^BsPy&FZxC4|QnwgudeM*%AJ7M;Nf5xX`%fLQi+iSQ&W@QhP9HgvPkCDIzOk@hzym(-kKX%KDgu z2iN&mrKf#dSwUlP7OH;4XM0XPDiMnMwBTODUSC71XZE4v?gh->J7|Z%!Yg$+S@%+i zEufreco2SlgdcvHs$G<^rT}ji;6wWp%GAR)FfGGV_Mmdu@imN~WGI&k>Au)3n{Nuc zX%X4U8PpToS5G;Pict+r{)(wS;C5!$KYbnMx<%>H8Yg8DRb(-{PU1{3;+tek={&L_ z$3L%&H|x!Go!TK?T5;Wy`c?J$^`QkCb4YrJOVD0cL71GMv!yMgg{YtcxE% zxvFGwVNoXsKnTFP>4F(|z$;${&k8eA<{i1s}*mOY05`WMaRE zeQC!L$p8l(MCdYAfCM@V*5Ek8bqAzxHQf#^AM_I$-RBq7A4PU2MVq{PE62`RlQSpB zK)!B8k6Pxz8ihQM!&ZKO{VeErh}O#)qV{in0}nk$Jk?)}T~TPBvj(yB!N zkpa%FQhm-Z$O!+<9S;rf%cMKrb}OaJGLRcH?rWEt=dz@W{|CKI@i8s)|N7Is(LPH8 zLZlr3Wg{om#)b-o+0vFMiP8`%Y@#DpiX$VA9E=3ECD}P-oXJMjBSzU03%p}ukzds! z;X?%lqi~*4jQ_SmG2zr|WvH3O)ygBP#;5>o>=}G34N>X{1zJ=|4VCzIC?$q73hvw0 zN@|UBhMK9hO^c{i2cDPUoAOM4{1DZQ$*RA{QU`2WWk!5Aut_@SBlElwd>Zs|e7lHG zsw|aAar+)+h0lkh<4Kyn;-$KmZYL`4;5im`r$)z3`k=tPv3WJ7t##X|D#1C*ZZrq} z{p0uwzRHqgsf}nhK~4a6*oIhfU;mtyg@h8OQguJ4Zq1aPfJb&b>f!0_nFFU$A6TjE zepZ8wh1}`PNS^E7Dtq9BK5A@=Kfl!2*>9pwlN8zm$=iqc34A$KxC%&Y{Wud9q*RN~ z+~bpKwjN=od7O76ewooh`>Khv6d!?3Zb&vDxx@sh12$*K2AFtBcc{s6B)vXuh zlFW67q`#2~`Z4`{`r}M$hkEqh={EF~nISnZYiCnA=PIA{Rt8+3b%gU1a{PJY2&Y&( zJotj4(-=k#f)P3hK}Id2)iB70vs%aSZ)jtk|AenQ?T3<`KPkYk6^d`yX~#OrHnqRr z%KxPBo-*-?&|Oi@l6UL#EWHn{)2{Tz#ZCq7#Vwcd7m=ZdDAt61D%~|p1iKE@_qw^qcJ= zY^fgtuD!%Eqy0zU7X={JB_XfMvcw|qUOVpb=shL{G_z|Xq;0F2J*bk)vi;{NANSV5 zQpgH-ILX@yI#(vJP34wJvb%}{k!c87SC}|ph?sw<2AC0^5l0nJxo}~ElIt#Fr#U}& z$Euzs*;^fHk@PEjOkHXT_?8|zQ+=f=zF*bfb6Rs9i=^(clAR(R(V7*GcwnQC+c)sg zTFciyt(kaLoY~BSTNweX=cLGgj=dprOCd+q>24Rz*IKMtXE0wkW6Y!D)#PCedB-Ei zB12kOK-kQH?h=Xi9Txi@wtZKo@&qzo+=iCMzkrH?(i2#-43yCfYk*iog7~s8J18$S zZ#a^f5eT?F)k-?(uvrqcBNJQMW7#8iH$&}tktHY?tO*Of3J|8MLt33+|v6c?oErrZi$(CmON|Ib^XXZ2me0G zt3@)VnCmo;ECAq0^0z?E;3iKKwkiinU!b0%G0$!LJTvA*om<0E^^^qX$EeI1-yh(9 z)fkli7IGyl5(@9ymYL}>j=klCq@NS+M$H#pe?Tvn9*zA;qPY6d(@LkJpX-G#_AW+8 zcSj@dR3uMN)331W_a4W+ll!@z&ofQ9wxEUHde+Fe$8u9JAJhij53VL1Z5?mzjpjdx zT!Ffwam961X?)oG&43g*ljYR&pZ2Qn`WQRFG4;s$7RpR#ZShVEPxS}i#V%nkI2BWg z(MmW#N1gt$k+rSOVf0}ws7D@Gl@ph9xL$656Z;@8Bh;*b?qm)VZl*eMkV;@pw_Rf$ zY}_XorJ=C~EbQ601m)fw`S)21eB8|mkUez;M zVe7RU^9r7lUV@zLdDx2#d#9t`*cj;B*aO4fDahonHQbUH#M>j$O6XUS$kY@{+5}A- zYOvmW8?v*fh;Y2@y}e(wXq0^1%_S?kxjUd+1bo=}OM=0X0)q1-;4Q>gc9kTwq7!=!z7cQJN`*J{$ZYr4%ce_E>4A>^HxO!ch-2Z)vd2M4U}^ zmH{oJ)~HW9?W4vLQ~zmNv9)c%!UT4VQ~S`?K{$C9IxhME!y`Zkmp!|JYtj|><6FuxbNLKU^g>4Hj=#wq zf4-Do*%c5F1ATbLaTZ5vu_C0ZHBj6+?DB0C<|w3SkDiPdhD}jp<2~(?s-B@_!n>3V z_^6Fd#yltTzGIY^h3JK0mZuBvjw!f*nv{=oLdF0rU*dCPV7+1ysWf8;vd8VN|0}dN zo#|`uLKewDWN=$BO}~lPI`4yzb7=i|-ov|HW?ncJ;2t&z$JqGW3Rt%Ut(RPZ4NU?+)K)>OY?z#ine94w2DO&b79PR?H{K?+kOiFc5hn_fVF( zvh9;&(t^)gxbCGKYGkTkM-|fur!g|qjKZOv!cqw3Jghos9H2rqMXX~%qw}rZ3v8d z1(7ZqM#oN?3{4l+Pz^*4RZwPkCe1=!>!({)_Q>>tR@hGJl@913;jP1HzVT`6q=-n26K#S~<%?Wf3jCS(pdBt{ zZ;pC71#y`D@C{;wudOT~^Qg-|DuXyGM);>yx|>>B&3_Ns4sm?bNCzynBU=J$sOljZ z(Y(GaY7H=}I*mg+jjVD>{Qeg0MAbCJsJD%SW#JQ8Z$fmJyw`?k?w9kIynh)YEkPT8 zUGk>D{v>CEkjLw7#I{p!!b_3wt+%{n9Q1L0rGfTO5gBEJjV54gpd%?NI-{a}Qw7V2 zd)G;Az$ExUNTSLS?`zbfa@TXk)9^p8n28T82Mke*mgyN=Y)Fz}mPTiye`F?Xr=u!0 zJC_39xRY5{Fe6EIo)KohPxpb6j5Cs6!+Cid(`{wvC+*^;$QmKEX)0GlDq$IjEzP(( zVXdY-5PGgu&!$?9eT9jjR0uB`l|3{)w)F$ZO@*H1+C20qrIhJSD_Mf0xuv(mFLg@o zp(RoKS>ZWos8c<0wNc3aFa@K3cs;iWsd_R*PC+ST<@j!?5&)OCc`N-N2# zBenfzhV9bbl5PzfwKD`*=zu=Y4=pCi*sCrH6M`7Eb0>5_$Dsp~>sl`|fPJz!BeRi@ z$|&q8CJU?7&b*|Dt!OdUjsNk5iaU|JN;Hn@ZjPbZd8b7JTnH+s=tCynhG@_-KJ=Bv zd=4b6xjw%pE3GIVd)smbRj{DRy5xNj_9@~g8b0O#yL0>jO&QwQNpDzkEn0j-co7>% zzi$;iBp4yKh_YlH?+GdjvWM*18?Lg)yyA$|WvpGwrr1oMxaUf(JvG)7krSrA(M=J% zTY=rZm!TO|BCpddas0FTp+$ve?u<3M@)q&ThyCDSIODW32_IWNGsEW=nv|FN z>rBvvm!dLgNgDjThf$k_A~CJ$w2}btVbR{`kHr>#gta5sHZyDHGA90;ivhYh{EXX! z?K83@U2?S@c8P0NmBUuw%E_u(2R`chI#$ZqQ&)lkRHLTv!y_$+P zv@w%>46qXkAFkBjWuSRaOmhkr<0j(rR1X^8eD*NEqnZI0Ho_QIMhTIZPf zOOX4t4hgI;$bG6`2kD$i4=Wpsi05D%qJ^<14bYXk(qI>&8IQ$`8;`Plw4HwC`?N>3 zW&YmH8P+(Led9HrZ{q|nYYns?ggqxvhoCsWk97J8JmU9RG#G|rQeYDj2c~*nIUI4}b@!c{6}TpcA4C94vqqjD1g&AOUX14@D!Syo z_ZrRlCGV^KcP|YzzGR|1pEx76ugtQWB&{0gNv+Q17}IbvuFO)ohz~mOCd6%7Gx6Vt z)qxGHx!}jE^5ILU$wPWys_=ISwIj5z$oG8K8!FG}k_D{kl5>Q^jPQ|lmWYj)ygP;# zH_jA~{iA(N9r9yX)=;R3d5eZ-is#dZ z$}g}wwe2Zz;4NbAn>~ka;uAYS$u^G&XBO6`KNSU+kI#x2p%`Y;`cBq;=M##Tc6Ivu zynl$D0w28COWr#MZeX5K$SWeKk1M+gP#q^i{DDrtpT_Pv`*s1JQ|DZ$odetj4%0^{ z{MUdVr-z4MeR@P*YdLzwUdZ&Gv?AwjmoDthEMxCy#WWKYJXv(@d>H&B$mWpUwN5H^ zo`z(83H74jKa)gxI4-wp>S=~x5rp<#;i$Sk%YF|0*uc&#x~?&*`LZRDq*qV9QJlKKa!N{`3RobKR2g(HSoe#^Ix@`j1 z^X0`%>}@LZkZNP&{lpjOGjIl}Lsu>WFd3ku?ccB+~?k z4!bYx+g2)Uu?ka*!jTTiTcjGwLa-~pW8qS1xu5E(joc2kgSAChOLj4~1xv?QM;%xU zTo#74s3=5{Ys(MGA+6c0@IJViYzVp4^wb11y?59PN6TndAN7hOL(7kK>NDU4uz+jl znO&JJNurtuN%2`|n~^sQ z5#i$@HQ5n2FzmgfndFButWH`nyU{sV8|AZucY)`5o~t1a=Z8de#V9ORb`lR7r+ew& z@c4gINBktfhxdtiOZ?diUVSG%heavlPSMNv(!nUl!6m4vwm-_o3QPO7jZxqiQMR{6 zIOMSRt7h#K|5(`WrE1tl!F~RYs0h@uX^OVrQa>jy2K&`PpPxtPUSn^SPD{Nyzm~09 z>6;`xnZPnjrm##pK6CJ)--N*%1tt^tG-smgg)D_F&P6ji!J)84yP_aXlH?o;nMDp; zG%6l61y+>&PEPruk1%=I`*gE(cM0x!wCU-rr&>9-9yZgeE%RY4n$)u=G2ndeI zHlOwdI_`_YIVsg~xa2)H(#EQ0t>b?FTX3nii<-YP`i=0(k!Nnm`m{Hctu#&L7dT;0 z7pmYXC)Z6dMPrYqb&!-rlIb^As-GwWecC&=HDwFUZ*;}F3&?j_N$>g8 zYRb|Zk3tGydRnYeV?G82ktU468dYhkX*Gh^Gs0=>JXoSp6EajG`j!y(5EXpxl89V} zcm`Rca9*@_YSP2_vR3lcp!F&-OJ}UYvm3iYS8nX$Kv6VP=R~fH3=!$~0RI3ZUsBz^ zR$Av!2VCz!bq^*zYD|>usQaHAcb!Sk3vJ}`SpDDNcf!UKr>__!Oa72I0INc2+vn8U z?C36vpL(Wt6)H(Z?Tb#OMeR@6wb3++BbEYb$Sx5p?iuZ0C}I5~srLM4CX&Jy)I64akm*j~TjpWidTX{A@BvdG%_ zP9>mAFiQ2_R(sUFrZCmZ)ZWy|&Lr8zA3sLpVzW@|7dAGsf02z~YuyC?o-D2mQSaqr zAghdpZ&}QJ;{>JL*E%if38y|u){;~pc}eop?r8LAF6b(2M!j~%CT9cm#jZcg+6|~O z2EPhrBfkiqKv~$M-HTQIIryxw<)zS6ghQqXZhzjSY$?rL=wt>|y~+W0=DqBdpO+l2i)`P`Bl+jPKiAP+2eDtYhvv2^^AUgD?|I!eSVET>)4!mjIzlmf9B%s z@$hJ698pJQ?%`Xg*B4!^4r8^^NSUl1E<=*ERX?(WRnmCjJ@BGy^h^+PGia3$70_A9 zoJG9VMQ!-sBZnv7Nz9;9gvw^uk6H{=(kfAC5eiGDcd}dzq-rPTnS3p-k;0 z1{nPWVYKQ8-^3z{a*zdN3zav+_b^_|2lHX=&zTCkSxL;vv`l4719FZq1DYPy02{Y& zKqU#z2oF!|{^?ORegvbDk6uRj%th#xgw3cS9ni*1Jx^FT>leaeToG{?S9;FFFXWsA zS`|MIv&ge4!{5Nwm zOPm{Ki0w078y9uYT4XV!SJ>0_5KmO?H1<>J}!?f`_=n&-|O31N4%$Otx2#-UN3sH zTMa*BHM2hFb+axf);xzl0{UA4X)9>>j8AEJ%@S+5Eoynj-l#Xtv8cMOG{+oO-u#D) zlJ}VD{myqy2l;o-&@&yV1JUbEf!&^&@@;Ee9{pP0AE2YG3RT--0TqnmN?29&#YIGO z_%qwbqKY>&atu3eR&=D(wmpmw$=3<7TvgFGM-JAnwdCg8O{%jx%c_`oGc=-WaxH9f zu9+%v#G#j{5Hdv|+MaX8rOS)A=<97J?gaFc3#v^)&K%2+xjO#!Tq!aaaPez%<8nEl z=>Zn?Rhe1T0@}KTMWt0n_fHqqic#g~)#F~S(!@G@y+Yql`MG8$Ha0i3zA9g5rusB- zc{G+-)S6>Ls-V4ql?%FPKRv-}I}2V0y@9W=wyLAw`lS0<$I8qdJbz{%&+fU$XN-cL zC1C|L4Zormu+9>nzcS+hRkxZO3|aGJ2IfNcuXosgSruBv}6Kh9ijvh)8s zDS=EpReZV!=W+7Up~~|4HT+%-X$(F*P1#y5&k1`V=Gjy4Lr}#ehG20{tXaloN`w zJ=Pq|b>DteW;Ge`Yb~xztiIvoUA{Df)i;E1W31ITsAGBtlXZZg_!MCE193?3wi9B%AA|+X+T9|h=%O+XE_)C^Zerp{EzO<}fv4q+E%|$lMz{{5~!n!_I z=pRH)JH8ifkqux!WQhiRNWXzfL9sr}W3WQOo4(Dpm^?_*qJO>U-nKV4Fw^ctbizVQ zirID~#A98tvh~M2RyU8|zsMAw>#W-T=7!a%PLOLk9;wUM)c=%!Jo3jp=)1%_(xMl( zrXaUNigUc4b&k`oXsy~FpBHaN4yj!D^_#1T;_?@o=)X<;8~dAADbNPxiaqwtQM+&US#iNZw0(s*(NecX`fKZ43p2g5RkSRZ5Uoq|-s#SnFry8Yy1?6mVUvUPyi^w0{Vb<< z-tS9@l_u|jH$i~=Yj>7;bm=)n_j^p+S{PJW^PHg;P(N+L9@zEXh{BttZ*&K8 z4(*>Zxg3|1?j=6Df7y<@i53~Wm$&nha)piC^{Y447l-PZlFuh4V$sWZ09qM(7W;?XlRS?zH0hn<3dO zpq|`?7}_9ihw)9*k}gg)?hKt@oheEo@YMxBH+7s0=ebH1y#M;V3;U^N3Nz(w>v;Z6 z_~O6=!6A2Cjbt6~X=8F0BZpGrpv3V68*MQ}?lUpHHP+)j3FrZ=e|Cq(27UMTB1t7< z&%*IDZF?dQ;hy)cUs@#a_Yieu;^3 z5JWW@jE$L*>ba|y{8YkPm`QR--y?5{qmfA`Z|66-SlFt$?lf5TwCs)fJL`WnP8tG3ViGTFg=bu zmpIN@B>J^ZPQT7ckt|!SnSxdZ-%!K|AU7obkM?LfKhVj>Ru|Mnm%Bte*2|#hJ@TlT z;D|%sXQ06@sDCVGWw5-GoqPubbvWWVVpCq_5Q)Rm3nm zS9ZQa`$Bb6C+l!nkY%LjMJs$`D&a>YVUsmEl4+P5_KuvVoO?|TXQAoQ(~I(;8K3h%ZkRK`O#aJu3-&DtH25h8C|f?1#^N$2mdvXzjG zB<0$yOm$A7(@ziVEO;%HZ#&CY$|?rEr~3)hL(Nr_nmgIaH@oC}iQnGV$yUq+UA>41 z&S|dt7|K)j9IQI2o||g9$zx%0VQlPVYv&| zsC4LVWoJvxBfcKjeZqunm1S#P7Oh3Bqzt}b9JkXb{M9;s0z4NSY-O~C(WUvM3v!TC zl>w%|Z2iHvY3F|a5HhvI@PX~Iu(a>69?6uS{Unn;q0p~xTbp^uNu>_`nDAOXGUh;P z`2}%8N%KHmg{5qQ*CF^Kf{NpPHKkkBhAA02YOS|IdfdU zrWYPKsm4st$-lZH#={!RZ**~>@{gSyc*@7_SQdMc+xh_V-3o$<7WiZ>2Y)34#coSFGb7w8;CB$2~pHoY2p?L01#@WqM9O3Au3-cpb?j zzx`}8jXAR;yu_qF!=Q3xQ~g?6f4@OC+Hc@Ngj$qAQv*+Ph?5y!u(X~a#-_ZGL6|_k zGC7%a2P#Q&4#o1;*WFqU-dpf3(+NQ`)~!WVNUiixMwIG)pLR_KKKJ_q@Ew3}CBBvT zmf~BwCJ^^_B7R&ez1YeohoEXJ+sy?_gdiy-g3!rM=>qcX%kJ705R(x-;ja|Iz8cRx z@D6&2K1osi7`xw6jz!G-|IyQ9bdBR3u6VxN1vwWx7mDxl6_QV5)+4V-%lK)hY?cs9 z`q3TGqN0L;>fVczRS$I86=R*igo$kX+onLmiV3Tr*<*#(zH~@vtQ6k#y3dizg**gL zW4ApOk-TIh{v5{?smtik!UO&n7b`sByK$#~zj+MVSWsz=XLsJjheM(#Y3JEu*1qzQ z?-fS(--?d(1!$i?QYKY?i)^oo_lZBYunhPL-ZZ^AbvMYP*ULe@^BLVylwDlCBwSbp{()L)d5TqZHT54-s zTTk1hg2gIFY>8>b{tSvHY9-(QnR(y6-%slT**D_N) zALHa(&_(Yi_RlUE%Yf z#tjLPToG56_J1oW>)`5yy8@}Zw68I*mV8NgDRBkQS%Sa+i$Svpn!49P_lYDDEp|sK zBxT-vFKh3nmlCISmf#MI2E3G*ikA}K8oKb|B)pVJVU>6(5hrh$<-fSIxMRyeF>dLR z5&{DxYdn@1|3JwlZ&%Wixr0fG`KAE9lDH{;?|$t6{OFyWojsVL*TK4 zljK(iN%$GUcsku!f?LYs9}qYfm|hx=@5K9xo8tH3zSrC7+b*U>AHcV$g!}Vdz+F2J zH>{NmKHDX}PknSJ=Jvsdcg&*uSMasqOFQUJ_qPpHhx-QlXV30U#|`j`xk#^ zp(%UQ@xCIBiMV@lqPOp7`1T9yupNY98g3^lx>ABy7OPX<#us-4Ipt24mA;Qg!^`OF z-|gJDyBW8j&Ac;iKd;NzHTNFF__!CAczzDd&uwRlr!#wq9+Bu^jQi8Fw^9d1=lgEmqY?wBpn(p{MG^adjD$KUUM_YLS47sua2H_`oNyAyZM z4s18R`=i1ex{aog%nnj@IXIeQfKjg-?V+aey_>e`9^UE`bo(yQ6k0y_2^}W z4*Xqic)BWiA8zJK1;)wREYBNHfD${lzlFaAI~@4CcgOcI;&OJxKM;3N&}x>i9GFz# zK1T~)IV{HL+;;i($0a~3HWYU>@wm=}Tl<%qFsl~NLoYbCL-3<(_^$HG_bVPJUN!0B zS0`yNR!vfQ)zbb)_`8PZ@UG#q$ENfpAH=tsaZB*7VLZMEHNBasVGJn<Nr#HfsI zL$?6;*M_fpFz+14yyB!O;Xcj%bl>Oa#$Y~^W1gf3H^ci$>6*8J^UP!Pb*RAiWt?Pg zyZqf4eESLCiegiXf^WFi99xF>Aq59XcmpEit z(^F|#jcBX*BWSNft)|K6>5YM}?bom`!Nj)P>`3j6YV9+R(Thr=_UkzwH^tN*bd3As zs}G?B!;#7NwW7V~b;tBfwY5m|RN%I{KNWpma}~k*`G6}a{cdxZpH-cs&@^aMrfh$0 z_^pT14<ecYMwrx=Yhx4_fI*X!Ms?VGNqsHX4ulFLSX&rdnr70f#%e0cyFbNk9_dI zBXo!32R*Yu!6J-L;>c6GqB%0oXfNbsZ7w5j;<&gv89X8DrVA|l%e`v(ck}W;&udGi zm@~e4As%ud^c8yu`Y(HkYLKE?tLfB*M-tej!mheE|JZSZ$p~6Kh;O#RcfkeerL&

yl~x*@omG%(DNtN+#^FT^{D-k zusHEX)h)?;Ndj5YtMcJ|E`JEA=}o+uM$$$i=I`YOLl)hJNL-lY5_&VOyXO(pto~xa zc$MxcxaZ6N>du6ZpjpV%6EArWYOWgNYfNKHt8F(j+9l>2)pzY)y%(0qPz0gY` z3g5lQ^!@Jb1CJo)-II8Z40~}?9v>Nc2j22 z3pp1J;02ch7x2Q9WEvj2e)zyJz3@c0sj5_Ay0?bXKf+F*GB!qrzSTp0ecR=yA5S$2 zJ~T3PSC3kU_Re5IadtvwE!&e(#a3<}mx;!f^;a6{57HV7KlJ&M&ibdZ%FD9Jh-~hgw>kC1r=KOOGytgW zQ8FR9m-I+{&s-V0<3qygsndVLS=kkQ!%d-?zy)>q@P|C?wviXC}0LJHHRoX6RC#+;TN z!_Zb)e7tPtZ?Wt3!eQ(pviXNw27iBgc*glag%vM57n-!M`~dG!ywS%7TRt>q4D=;} zM&esBQ`m(Y+W&eNpeLGsjk84qZcw8WM3KsHyumXS(jN8}4AV?Fy)qr_*7WU9$T+hn zKJj#`$B6v}oVnH??rLqDgVx8ID&{;|BL&hFN#{X0(=}XWnwivz@~$)O@6I}t<(zaZ4dZILV?Iv)S?X)UPj#;`eZHaq zdJFnfbi)+Ot?PZ=Nhhr5(dPB%dK|N7Z7*Lks|W8fV6RWP@h=l8!8y3r_o6N;f4O6S zH$i@}FKtkhQr1^%T5)W9!s+2;yy(!?d8`7f5xfnR1|5u&!5?99f1Aav z2#YI2`5$!hQ5reRRdpnMt8Oqog8K+(KpI|iY}c_{Owj(ADml8#^r!MoyUG$?e$Wwj zQ8Q_M1<6DE%IvR-n$H7Vey%*}x96U|I4R|q_|C4!K{#$K$K9WaM2nS|x8n1w(|xJf z3B*lpYw$iz0n7cMH{X%W9cHLPUZbY7T);q|` z1QxG5_kQ&5J4A2Ne<(5CB1%sE=DF`)OikQ6aIE6@Xqj%b57FxnA0Kwi0Vb(&_2rya z^Dp)ZDm)2oj{e>|P|h)&i`Na{ZWp`+^~;YzTgSb#4!2}Erj}>5>@(dnkmbm99!9Ng z&bW)l)YOZ=zXLZy;kLZnQwz!)D(ayHa}cE&6BckSm`g(!0J*q#J=cPHbLfMSSS^^i zi};+&`Uq(A93oS+myB_wn-ZU&)p9NExS&s7jkA+P(@n43j{t*W&{?fPv_w-sYS9b?kP4N?hmAbBGsCaWi8r+#tsj;QRYx`Rr}y5LaSga+ z*|22Zzlt;nXg*jzJO^JO&^P>r*r04VaV_rG)L>?!*@@g@9unu`!^bCsTP7;p-$)}& zI_x~$a$VA%?%CiGFC6_#cUSyE)0{JN99HLxvksJHpVJgP=+G>Eu;tc_%$DiCR_DR8 zdC-x72E>`v934*2hoMtMlD_4yQV+q)a_;FCP+mPveC?sGR*%&=2QKh82f;k^D&@d? zDI@Eip5xGD{d(YIe3x?qqnbij;SA_S(oVX$cYtm^*?A6@X|_)=6iI*%6s7(Rwz#BnAUBU{gTrYl>PpYFDUt~o_1Nvk#zRV%*<5ASd+(L z_1ImqJt~pTE_rRXkl!zhR3WQBn70JizQ|TzkyIwPJ3S>jLt)1PsiL-AaWzz~uP6do zsmfVKaNB)OZ;sB+ZFpH4ONUOwRF=o`Spi$b7PBSH%x-1%tbzIEptO9sRNrW+sH;L+ z$CiNXHZbN7S{z&OA3lrI;|vlUpWSWESL_1VZm-?qw0B6$By)L9sl`~^h%ni0wFSL? z3o=q3Psl>qEC_E4c`PE%>i0K0H|Dx6zCeTQu94lQkVneoSkyLES5rQu_j$c84rW{! zYU~90TwdFz3CrhsDMf7Nam!IEug2LNvTc*a8L)V~9;*v5tU=jM1>qM56Az<>NmOjy z;=}#aE)))Z9ByB&*lCJAMX{$T_O*&VL$PNmc7|f#pxBaP&r$3f6&qcKms6zJoEle{*hNYk*Zpg&9lD)zwN0eVwnyYnPYn?Affmyng%$ zz?~oqtC%3inhC;d7UdYtO=0v{!)*=5>MBDxK=|{*{?#$D;5qO|Vue3HoLcw`qWtDj z`NGY{c<1xCM!AQjuokFt=}1xKRuzeY_ruBl9hZ?o7eBQ29ceC zwK7qPYNJ*YmM1N0-d&uo0@;Pm?B zNAql@uzIUAAd57Scs~UKXTkxDRRs~wPskx}yH`?h9*cjy-0JlPrG~9QoF*SX_v1F( z4H_oF+z6wGF(~dr#V&!p8paH>4kjS`omLlPwzhUMIV)PNA-e^QBGY_fz`Pv@`FvhK zIKO1K2Cb4y_Ou5bxl}je0W@cmJ33t;==Djh&LAa<4)AD> zs6W_cw^!m~iXyv=ibuKSRGx_sF)8Skh+>jE(4I>;RFDFCs^9&(Ym z8<0F0gVxQUH!*K&Q|bWG>7{^!MmVKwm8DPs!>CmTdzGW$fZ6+l$owh!z*H+6>X8n^ z#RY~1HUo|p+^V0ek6@m&A`l9IYIfPq6J=-f^pOM>yVrw3#)q6*UCS0LNxiXQVkr4g zYP7UU{${U_$gz>?D@mS^yNLH9ih`#Vlxg#O-IBxVw{Nkcrih@VNXt`GzawIpD-8Jy z@R$F|74BSkd@{LxGXKNFeR6I-AW(iew>?*?X;>|-P>PexrMY=a6!?(RF_qAqL$Tze zQGmYg3k4TCJ>kC=U&!SO`9u)+*u7gk3q?YU*Pc4IC=QI5rNB!CKE&pW_+MV2OWrKI zByU@6)yKl3Y%zFm5wkS6B9QbBXS-ve%ezJL`Xw*WYirA<`os`+EOY@yph^%F+Bjqv zR#iaO!fERz9FruGbfcX=gMfGh6-Oe&9ct&mkT-?Gni%eCh`OB#)iLCel#* z3i2_=2@OBD6;e}t#81>#(}UcIBa%=W;L@zKZ4yiTN)<%O2y&_=Uj8uGP#*lHz zRtOtTj|~-qBj}K6=E7!EWofmgzRXhAWNKJ1iO~y&-&9)PNOb{y&*xJA z2e?Z)IXM#jp`U7xaw@^$WJ)xLq2Qt`uuF_HhOLrB^pq5~%-zIVff{#1VnkC3w?E{e zM(5$N(;QOk4Ec7Q4h|)TRs|$qyRAM4<`cM;vNt1*QX0Adkq8NSy{Jx+UkttmAgr?& zF&!vLeA-dz(dC9KgEES!TotxjeM;;O z1!XjQI8FlhK>x>j!eysc_mWsS3I$22Gp{bkC5%wmAxM#`!qw#zQa92W7J(FncA_|3 zk#fh4=lEg%Z}oPla6lwK(4qb|hAg}tlnyo_9#pJ?1}BQzr=r7oxqphwV4#X4G{R-x)RNDLvnw zgqTdcqDXW~3RcTjyD49lO9+oHmD1VeNC^2=TnPvSF^Gp=68*4F+T@{0QLPh48ui)g z19MP*ez{HJD*|MQLOw#+s6c|L(l96AfNq^rNPM6vU~PwpM3cWdp9M&eQ)D^_xFpx0 z`{m^22e5(56ACWE`OVlkY78DVHeZ-IO%Trq_5^X9*-Q}U76XoA$Kd0}_6Mpc@sTl6 zeykBNL}_buTo_^n$TJ%uY@r3gZm<}{W&y~`%6R9G_-o}LmK&R}yhFM+D^FC@SRT${ zEUgW@>l=-%0joNDI0S1OKUg@ruL`j;-zb%Z0<5W_OlojhH_PD|v>(D&d(n8506+5A zHLl{`26JWDR$(=iSJtU%%{7uaAcySUD0pV4kJrhJB|gTonvJg!qw8Gb4A^9s%j&`K z3Ph5z2H6vU91_Xr4cQzKFEcx~hJ6h(Mia4WCH30s2w}{S*Hs{;<;JkPyforoTizHB zH?OS;yZ5^^>@k=h!1Thr3iBtJw_yGXbCp}erorf83Sr7&s$tf_*kL+gI$`#}9D+Fk z^E}L1m#ccrs2mJDJ*&zvRW4~GHi6$eOs9V7gZj%Y7M;Ts|h z%M%-zidrs&TP$0!UiJko%0fzzqzKUE4rj0kXK27RXm>eV2?xRnb(6QiPh0TV_H_lA zS;+pfhc+Te>ThbOtX*X>*ELkGvzQu~g^TePF5B}}5u6rRK$bTtVO$OsZbN3Tsk>~sR9&~qQoW|yQeH;K3oK}DM?M2>NwUeHw&?D_ z+puU|4*e;T7qrY=IQCS!i>gZ#!{t>RvzL)x13X+bA_l0w6lVM#<&HZn4h3P~bChI=)LL z6VlBQiHBf?(b@={0@<_#r0r^?lO$7VWpzb471NB>7~f_kPdE!@pmgTahK5g1_sQjA zcss#a?4MBAT9v(sa>FE9K8hw`P@e!xXXn)jh|M;|$6FkS@4W3Mu9uoO_Y-KOrdhzd zmrVPX*l3|e+Qf7f{1Nd)&iY0{_mEialE)h4O;jwkVM~>|PypR9yO_49xi4Go(?z0( zSkPm+JWBIskyOzE2?8e*)O=vq0XcwK2Qr`-uTgoV<{ZI9Y3D45<_i!w+~|BnNX@+C zVV_Ic$K68V#lflU?rRa|O0qZO%5#mJyuzfXkKYG1h43cQmdlko+jv zl7cNNqehecca$NfQCjn(!Du=m0)=4~M3|pw zxK6NBDnF5=x++44^Q*|XRt7T7BR*>Yha6%a!jY?( zglHTqa}zoLw&AJ3;vkegW(p3?$Bj*Y<%(W(j5^5kGL`F&5Hy z%FgDzM*czwD+BERk4}zhnAa^xW$+2xLc34dQY43g(&!!F3%NFINkh9Jo9`)eM6xIj z)g4_7Wzu88VBxzxl-mbXB0!^xVtNAy*k*-H32+nC4Q2l=bwlzfyy+}-JQT;lk;M23 z@C3|UU(g>_eWoXkEsM?V(<_k+ByzZ|?M|C;a&nGeHd2y)*C>#miW8@8bh!!;ULIE% z3zts52@x3GKGKTiw99RwHCA+sjF*m3Hz=^FH>izAWT1#Kb)xXRal%LS5ora{Z(Puf z!_FTEMs%5xrlU|LHTqNxy+p8}7m$s#R=D8t8Y~uusEmLCcN7fxCZ_p>cmSs;81PLD zBYMcwfd_R#g&FDR(ooA;0sf2qT+sv37Q!(u#Ask38E?6{+ky)B0wL(vx0tXp%X7AeN4d@ zz&=zSof#9s`K2CkVmVA6u_;F3k*=H1!&YO{!5i5K!b+aj@_w4+!yqV(r;EgKFchxO zH!La?#bHL~YPI@2L;j)#iwsMb5PzmRj1v)QD^7-7g$!&wn)?F&BIO{4%Lsl0^yZ@W zy8Q-dw#E3N0~X_lW?PIOnr$)u#iRU7M)_|ZF8kJ+z8n#@h&q(RQ)iG_L__WMXNSZbra z9uA`wyQaJdtS}mkWfr5Uq25x4Km1T3f1QMKD$AO%YN{tEGuKxbD-~a5O|%btzO@aF zRZ2qD1(-Q2@TgpU5tNPArP7$BeLUI;SBs65TQjQMQloKAWnDEDjQ!TIyC$lj8nqy# z;bqm-gv%29eBoju<>0tEx_(Wyk$fjuUkZ=_nC-xkvvaxaDb9)62 zEefOa@(sTzSmJCRv~tlgaL9tbh5^ksm%q#HmI7U3iIu_IrFfUVZmBfO%qvZk)7kyX?;nCLSN*cIl+ z+gL?yT}?#|;%n=mQVttDoAl!=D(hfs8|%%;1BO-#tz+yhTYZ+0hmH%WENT{h3L+vn z{SA5f1&bChxw&v@X_*o1k<$I>^BT5m7tW(#_QM>4c^Kvh%n6tu!8`}^A21#Ng0rYF z3~Q^+F1Ha3E)hbZrqB|U=4I1tKnsJM6&xi9ljEmZCXLFcWT2gPj9)j_%CHFth!0 zC@EW-D}^@#_;Md3A`k0qks~&}|5G!BYcPr*qRy7e2FMrXdV&!}%gB5f&a1Y^C$e?X zET7OO6N00*jO}MsFY2JNp-}+TZcFDyv59!r(fxLGPSJmf2IjiDYW>{N@fZ-zKp|&^ zNA3u2va#1D<2Cp3#a3XNk8pgoolccisA1!JyMXJZ7gySKo{dsZt-iGrG z;z>|a7P^+&=hI8Iayy;S;g#-h+Lm@SG>VZ^jrBcICw zBdj{NED8mZR_ZGoZvzhNkcL;=g1`P?Oy`KS!>G0#7mb)U8YM&1aGn5dQ)zWW1>}1n ze1IW_sR;ST)uyNQ@5Hpk@?tzfR@PQF;@ic8J{N1;>E&u9QWJ{JqTKdHLPn%cYO!h@0u(me+r-%{gBF)cr4SHFmsNo`8a8!h9J9T^9XTbQE-3eEZMXukr5U3vuE*XLxZV zz}PSf|H1CF-|GJDeai~|{oylN?^iBe{_mH|KfdNW`S*Y8Yrjc8*{m~qAG7Nd9q9`q z3rmUeMV6j(bb&d_`m+c+WYEH*5M}MDvy<`|gpGetUu~z(ngdo2btm3U2=~9`mzF+d z>a^+CUN?h?O}|;QGp@gZzEGdw_i6DHWc%+5?zD*aSTedbOkq=DE1Fl4dl$Zw^}!rR zhk6+H9+;(YKL`5=OkV+G7hs=-DMbg1-w2&ixX)*}TpJ6`u z3S-~cdIc%PcfM?iM}zmWSrf|o0?c&G6JORd_S2i-hWW4lf@`Rx!V(O1-2d^<-+zSy z@tl^sN@#M$9DLPt*pFhYsDya!)#CuB*ykQaKZGH7FKjYjgIf!89&R!c+|)jUaFba8 zcRUPx47p$=IH`;@xXGaV@w-JNii4qhJxKS~Kyfg{%Tr)V;N}Ky>VszZ$q@XjU|QfN zgYGuwNBHhSocaqs3H@=H@*|NjHSYfxTgB|^f?qwlXo~xdxBfE$QqwGwZ9{;qrtv!)3yvuiKDje(p(Z`XaA8HxFk%w5`GtgQS5Qhi!HV Date: Thu, 26 Jun 2025 14:10:34 +0800 Subject: [PATCH 2/2] bsp: update nuvoton series project.uvprojx --- bsp/nuvoton/nk-980iot/project.uvopt | 2945 +++++++++++ bsp/nuvoton/nk-980iot/project.uvoptx | 2945 +++++++++++ bsp/nuvoton/nk-980iot/project.uvproj | 3236 +++++++++--- bsp/nuvoton/nk-980iot/project.uvprojx | 4596 ++++++++++++++++++ bsp/nuvoton/nk-n9h30/project.uvopt | 2849 +++++++++++ bsp/nuvoton/nk-n9h30/project.uvproj | 3070 +++++++++--- bsp/nuvoton/nk-rtu980/project.uvopt | 2937 +++++++++++ bsp/nuvoton/nk-rtu980/project.uvproj | 3094 +++++++++--- bsp/nuvoton/numaker-iot-m467/project.uvoptx | 3732 ++++++++++++++ bsp/nuvoton/numaker-iot-m467/project.uvprojx | 3855 ++++++++++++--- bsp/nuvoton/numaker-iot-m487/project.uvoptx | 3560 ++++++++++++++ bsp/nuvoton/numaker-iot-m487/project.uvprojx | 3949 ++++++++++++--- bsp/nuvoton/numaker-m032ki/project.uvoptx | 1900 ++++++++ bsp/nuvoton/numaker-m032ki/project.uvprojx | 2149 ++++++-- bsp/nuvoton/numaker-m2354/project.uvoptx | 3096 ++++++++++++ bsp/nuvoton/numaker-m2354/project.uvprojx | 3823 ++++++++++++--- bsp/nuvoton/numaker-m467hj/project.uvoptx | 3524 ++++++++++++++ bsp/nuvoton/numaker-m467hj/project.uvprojx | 3801 ++++++++++++--- bsp/nuvoton/numaker-m467hj/rtconfig.h | 2 +- bsp/nuvoton/numaker-pfm-m487/project.uvoptx | 3380 +++++++++++++ bsp/nuvoton/numaker-pfm-m487/project.uvprojx | 3799 ++++++++++++--- 21 files changed, 60238 insertions(+), 6004 deletions(-) create mode 100644 bsp/nuvoton/nk-980iot/project.uvopt create mode 100644 bsp/nuvoton/nk-980iot/project.uvoptx create mode 100644 bsp/nuvoton/nk-980iot/project.uvprojx create mode 100644 bsp/nuvoton/nk-n9h30/project.uvopt create mode 100644 bsp/nuvoton/nk-rtu980/project.uvopt create mode 100644 bsp/nuvoton/numaker-iot-m467/project.uvoptx create mode 100644 bsp/nuvoton/numaker-iot-m487/project.uvoptx create mode 100644 bsp/nuvoton/numaker-m032ki/project.uvoptx create mode 100644 bsp/nuvoton/numaker-m2354/project.uvoptx create mode 100644 bsp/nuvoton/numaker-m467hj/project.uvoptx create mode 100644 bsp/nuvoton/numaker-pfm-m487/project.uvoptx diff --git a/bsp/nuvoton/nk-980iot/project.uvopt b/bsp/nuvoton/nk-980iot/project.uvopt new file mode 100644 index 00000000000..730a5777d36 --- /dev/null +++ b/bsp/nuvoton/nk-980iot/project.uvopt @@ -0,0 +1,2945 @@ + + + + 1.0 + +

### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread + 0x4 + ARM-ADS + + 0 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 18 + + + + + + + + + + ..\libraries\nuc980\Script\NUC980xx61.ini + Segger\JLTAgdi.dll + + + + 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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + + + board + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + board\nu_pin_init.c + nu_pin_init.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\cputime\cputime.c + cputime.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\cputime\cputimer.c + cputimer.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\mtd\mtd_nand.c + mtd_nand.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 4 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_alarm.c + dev_alarm.c + 0 + 0 + + + 4 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 4 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 4 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 4 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 4 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 4 + 46 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 5 + 47 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 5 + 48 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 5 + 49 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_pwm.c + drv_pwm.c + 0 + 0 + + + 5 + 50 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_can.c + drv_can.c + 0 + 0 + + + 5 + 51 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 5 + 52 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 5 + 53 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_etimer.c + drv_etimer.c + 0 + 0 + + + 5 + 54 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_emac.c + drv_emac.c + 0 + 0 + + + 5 + 55 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 5 + 56 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 5 + 57 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 5 + 58 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 5 + 59 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 5 + 60 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + 5 + 61 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_etimer_capture.c + drv_etimer_capture.c + 0 + 0 + + + 5 + 62 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 5 + 63 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 5 + 64 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 5 + 65 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 5 + 66 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 5 + 67 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_adc.c + drv_adc.c + 0 + 0 + + + 5 + 68 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_systick.c + drv_systick.c + 0 + 0 + + + 5 + 69 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 5 + 70 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_sys.c + drv_sys.c + 0 + 0 + + + 5 + 71 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 6 + 72 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 6 + 73 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 6 + 74 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 6 + 75 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 6 + 76 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + dfs.c + 0 + 0 + + + 6 + 77 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 6 + 78 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 6 + 79 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 7 + 80 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 7 + 81 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 7 + 82 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 7 + 83 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 7 + 84 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 8 + 85 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 8 + 86 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 8 + 87 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 8 + 88 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 8 + 89 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 8 + 90 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 8 + 91 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 8 + 92 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 8 + 93 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 8 + 94 + 1 + 0 + 0 + 0 + ..\..\..\src\memheap.c + memheap.c + 0 + 0 + + + 8 + 95 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 8 + 96 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 8 + 97 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 8 + 98 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 8 + 99 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 8 + 100 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 8 + 101 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 9 + 102 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 9 + 103 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 9 + 104 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 9 + 105 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + 9 + 106 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 10 + 107 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\context_rvds.S + context_rvds.S + 0 + 0 + + + 10 + 108 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\cpuport.c + cpuport.c + 0 + 0 + + + 10 + 109 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\machine.c + machine.c + 0 + 0 + + + 10 + 110 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\mmu.c + mmu.c + 0 + 0 + + + 10 + 111 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\stack.c + stack.c + 0 + 0 + + + 10 + 112 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\start_rvds.S + start_rvds.S + 0 + 0 + + + 10 + 113 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\trap.c + trap.c + 0 + 0 + + + 10 + 114 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 10 + 115 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 11 + 116 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_can.c + nu_can.c + 0 + 0 + + + 11 + 117 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 11 + 118 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 11 + 119 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 11 + 120 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 11 + 121 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_cap.c + nu_cap.c + 0 + 0 + + + 11 + 122 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_spi.c + nu_spi.c + 0 + 0 + + + 11 + 123 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_emac.c + nu_emac.c + 0 + 0 + + + 11 + 124 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 11 + 125 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sys.c + nu_sys.c + 0 + 0 + + + 11 + 126 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 11 + 127 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_uart.c + nu_uart.c + 0 + 0 + + + 11 + 128 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_etimer.c + nu_etimer.c + 0 + 0 + + + 11 + 129 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 11 + 130 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 11 + 131 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_qspi.c + nu_qspi.c + 0 + 0 + + + 11 + 132 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 11 + 133 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 11 + 134 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 11 + 135 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_gpio.c + nu_gpio.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 12 + 136 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 12 + 137 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 12 + 138 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c + err.c + 0 + 0 + + + 12 + 139 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c + if_api.c + 0 + 0 + + + 12 + 140 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 12 + 141 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c + netdb.c + 0 + 0 + + + 12 + 142 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 12 + 143 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c + sockets.c + 0 + 0 + + + 12 + 144 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 12 + 145 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 12 + 146 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c + altcp.c + 0 + 0 + + + 12 + 147 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c + altcp_alloc.c + 0 + 0 + + + 12 + 148 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c + altcp_tcp.c + 0 + 0 + + + 12 + 149 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c + def.c + 0 + 0 + + + 12 + 150 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c + dns.c + 0 + 0 + + + 12 + 151 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 12 + 152 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c + init.c + 0 + 0 + + + 12 + 153 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c + ip.c + 0 + 0 + + + 12 + 154 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 12 + 155 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 12 + 156 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 12 + 157 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 12 + 158 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 12 + 159 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 12 + 160 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 12 + 161 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 12 + 162 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c + memp.c + 0 + 0 + + + 12 + 163 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c + netif.c + 0 + 0 + + + 12 + 164 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 12 + 165 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c + raw.c + 0 + 0 + + + 12 + 166 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c + stats.c + 0 + 0 + + + 12 + 167 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c + sys.c + 0 + 0 + + + 12 + 168 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c + tcp.c + 0 + 0 + + + 12 + 169 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 12 + 170 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 12 + 171 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 12 + 172 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c + udp.c + 0 + 0 + + + 12 + 173 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 12 + 174 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 12 + 175 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 12 + 176 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 13 + 177 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + 13 + 178 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + 13 + 179 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + 13 + 180 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 13 + 181 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 13 + 182 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 13 + 183 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + 13 + 184 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + 13 + 185 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + + + nu_pkgs_nau8822 + 0 + 0 + 0 + 0 + + 14 + 186 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c + acodec_nau8822.c + 0 + 0 + + + 14 + 187 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\audio_test.c + audio_test.c + 0 + 0 + + + + + nu_pkgs_spinand + 0 + 0 + 0 + 0 + + 15 + 188 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\SPINAND\spinand.c + spinand.c + 0 + 0 + + + 15 + 189 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\SPINAND\drv_spinand.c + drv_spinand.c + 0 + 0 + + + + + nuc980_usbhostlib + 0 + 0 + 0 + 0 + + 16 + 190 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + 16 + 191 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + 16 + 192 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + 16 + 193 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci.c + ehci.c + 0 + 0 + + + 16 + 194 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 16 + 195 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\support.c + support.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 17 + 196 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 17 + 197 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 18 + 198 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 18 + 199 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c + cdc_vcom.c + 0 + 0 + + + 18 + 200 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + 18 + 201 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + mstorage.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 19 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 19 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 19 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + 19 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + 19 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 19 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 20 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 20 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 20 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 20 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 20 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 20 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 20 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 21 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + 21 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 22 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\libadt\avl\avl.c + avl.c + 0 + 0 + + + + diff --git a/bsp/nuvoton/nk-980iot/project.uvoptx b/bsp/nuvoton/nk-980iot/project.uvoptx new file mode 100644 index 00000000000..f3c2426a2c9 --- /dev/null +++ b/bsp/nuvoton/nk-980iot/project.uvoptx @@ -0,0 +1,2945 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread + 0x4 + ARM-ADS + + 0 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 18 + + + + + + + + + + ..\libraries\nuc980\Script\NUC980xx61.ini + Segger\JLTAgdi.dll + + + + 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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + + + board + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + board\nu_pin_init.c + nu_pin_init.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\cputime\cputime.c + cputime.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\cputime\cputimer.c + cputimer.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\mtd\mtd_nand.c + mtd_nand.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 4 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_alarm.c + dev_alarm.c + 0 + 0 + + + 4 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 4 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 4 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 4 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 4 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 4 + 46 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 5 + 47 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 5 + 48 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_adc.c + drv_adc.c + 0 + 0 + + + 5 + 49 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_can.c + drv_can.c + 0 + 0 + + + 5 + 50 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 5 + 51 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_etimer.c + drv_etimer.c + 0 + 0 + + + 5 + 52 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 5 + 53 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 5 + 54 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_systick.c + drv_systick.c + 0 + 0 + + + 5 + 55 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 5 + 56 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 5 + 57 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 5 + 58 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 5 + 59 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 5 + 60 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_pwm.c + drv_pwm.c + 0 + 0 + + + 5 + 61 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 5 + 62 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_etimer_capture.c + drv_etimer_capture.c + 0 + 0 + + + 5 + 63 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 5 + 64 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_emac.c + drv_emac.c + 0 + 0 + + + 5 + 65 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + 5 + 66 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_sys.c + drv_sys.c + 0 + 0 + + + 5 + 67 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 5 + 68 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 5 + 69 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 5 + 70 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 5 + 71 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 6 + 72 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 6 + 73 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 6 + 74 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 6 + 75 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 6 + 76 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + dfs.c + 0 + 0 + + + 6 + 77 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 6 + 78 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 6 + 79 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 7 + 80 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 7 + 81 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 7 + 82 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 7 + 83 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + 7 + 84 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 8 + 85 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 8 + 86 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 8 + 87 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 8 + 88 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 8 + 89 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 8 + 90 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 8 + 91 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 8 + 92 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 8 + 93 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 8 + 94 + 1 + 0 + 0 + 0 + ..\..\..\src\memheap.c + memheap.c + 0 + 0 + + + 8 + 95 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 8 + 96 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 8 + 97 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 8 + 98 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 8 + 99 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 8 + 100 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 8 + 101 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 9 + 102 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 9 + 103 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 9 + 104 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 9 + 105 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + 9 + 106 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 10 + 107 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\context_rvds.S + context_rvds.S + 0 + 0 + + + 10 + 108 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\cpuport.c + cpuport.c + 0 + 0 + + + 10 + 109 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\machine.c + machine.c + 0 + 0 + + + 10 + 110 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\mmu.c + mmu.c + 0 + 0 + + + 10 + 111 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\stack.c + stack.c + 0 + 0 + + + 10 + 112 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\start_rvds.S + start_rvds.S + 0 + 0 + + + 10 + 113 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\trap.c + trap.c + 0 + 0 + + + 10 + 114 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 10 + 115 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 11 + 116 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_emac.c + nu_emac.c + 0 + 0 + + + 11 + 117 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 11 + 118 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 11 + 119 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_cap.c + nu_cap.c + 0 + 0 + + + 11 + 120 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 11 + 121 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 11 + 122 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 11 + 123 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 11 + 124 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_uart.c + nu_uart.c + 0 + 0 + + + 11 + 125 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 11 + 126 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_qspi.c + nu_qspi.c + 0 + 0 + + + 11 + 127 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_can.c + nu_can.c + 0 + 0 + + + 11 + 128 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 11 + 129 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 11 + 130 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 11 + 131 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_etimer.c + nu_etimer.c + 0 + 0 + + + 11 + 132 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 11 + 133 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_spi.c + nu_spi.c + 0 + 0 + + + 11 + 134 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 11 + 135 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sys.c + nu_sys.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 12 + 136 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 12 + 137 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 12 + 138 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c + err.c + 0 + 0 + + + 12 + 139 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c + if_api.c + 0 + 0 + + + 12 + 140 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 12 + 141 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c + netdb.c + 0 + 0 + + + 12 + 142 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 12 + 143 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c + sockets.c + 0 + 0 + + + 12 + 144 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 12 + 145 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 12 + 146 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c + altcp.c + 0 + 0 + + + 12 + 147 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c + altcp_alloc.c + 0 + 0 + + + 12 + 148 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c + altcp_tcp.c + 0 + 0 + + + 12 + 149 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c + def.c + 0 + 0 + + + 12 + 150 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c + dns.c + 0 + 0 + + + 12 + 151 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 12 + 152 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c + init.c + 0 + 0 + + + 12 + 153 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c + ip.c + 0 + 0 + + + 12 + 154 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 12 + 155 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 12 + 156 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 12 + 157 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 12 + 158 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 12 + 159 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 12 + 160 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 12 + 161 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 12 + 162 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c + memp.c + 0 + 0 + + + 12 + 163 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c + netif.c + 0 + 0 + + + 12 + 164 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 12 + 165 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c + raw.c + 0 + 0 + + + 12 + 166 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c + stats.c + 0 + 0 + + + 12 + 167 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c + sys.c + 0 + 0 + + + 12 + 168 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c + tcp.c + 0 + 0 + + + 12 + 169 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 12 + 170 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 12 + 171 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 12 + 172 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c + udp.c + 0 + 0 + + + 12 + 173 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 12 + 174 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 12 + 175 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 12 + 176 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 13 + 177 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 13 + 178 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + 13 + 179 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + 13 + 180 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + 13 + 181 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + 13 + 182 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 13 + 183 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 13 + 184 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + 13 + 185 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + + + nu_pkgs_nau8822 + 0 + 0 + 0 + 0 + + 14 + 186 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c + acodec_nau8822.c + 0 + 0 + + + 14 + 187 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\audio_test.c + audio_test.c + 0 + 0 + + + + + nu_pkgs_spinand + 0 + 0 + 0 + 0 + + 15 + 188 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\SPINAND\spinand.c + spinand.c + 0 + 0 + + + 15 + 189 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\SPINAND\drv_spinand.c + drv_spinand.c + 0 + 0 + + + + + nuc980_usbhostlib + 0 + 0 + 0 + 0 + + 16 + 190 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + 16 + 191 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + 16 + 192 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\support.c + support.c + 0 + 0 + + + 16 + 193 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + 16 + 194 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 16 + 195 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci.c + ehci.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 17 + 196 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 17 + 197 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 18 + 198 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 18 + 199 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + 18 + 200 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c + cdc_vcom.c + 0 + 0 + + + 18 + 201 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + mstorage.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 19 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 19 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + 19 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 19 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + 19 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 19 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 20 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 20 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 20 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 20 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 20 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 20 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 20 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 21 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + 21 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 22 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\libadt\avl\avl.c + avl.c + 0 + 0 + + + +
diff --git a/bsp/nuvoton/nk-980iot/project.uvproj b/bsp/nuvoton/nk-980iot/project.uvproj index 1feab8d4295..32ca527fec3 100644 --- a/bsp/nuvoton/nk-980iot/project.uvproj +++ b/bsp/nuvoton/nk-980iot/project.uvproj @@ -1,38 +1,42 @@ + 1.1 +
### uVision Project, (C) Keil Software
+ rtthread 0x4 ARM-ADS + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 Nuvoton_ARM9_Series Nuvoton IRAM(0x0-0x0) CLOCK(000000000) CPUTYPE(ARM926EJ-S) - - - + + + 0 - - - - - - - - - - - + + + + + + + + + + + 0 0 - - - + + + Atmel\SAM9260\ Atmel\SAM9260\ @@ -56,8 +60,8 @@ 0 0 - - + + 0 0 0 @@ -66,8 +70,8 @@ 0 0 - - + + 0 0 0 @@ -77,14 +81,14 @@ 1 0 fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" - + 0 0 0 0 0 - + 0 @@ -98,8 +102,8 @@ 0 0 3 - - + + 1 @@ -108,7 +112,7 @@ DARMATS9.DLL -p91SAM9260 SARM.DLL - + TARMATS9.DLL -p91SAM9260 @@ -147,17 +151,17 @@ 0 18 - - - - - + + + + + - - - - + + + + ..\libraries\nuc980\Script\NUC980xx61.ini Segger\JLTAgdi.dll @@ -174,10 +178,10 @@ 0 Segger\JLTAgdi.dll "" () - - - - + + + + 0 @@ -210,7 +214,7 @@ 0 0 ARM926EJ-S - + 0 0 0 @@ -220,6 +224,8 @@ 0 0 0 + 0 + 0 0 0 0 @@ -343,7 +349,7 @@ 0x0 - + 1 @@ -370,10 +376,10 @@ 0 0 - --c99 - __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND, __STDC_LIMIT_MACROS, RT_USING_ARMLIBC, RT_USING_LIBC - - ..\..\..\components\drivers\smp_call;..\..\..\components\legacy\usb\usbhost;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\dfs\dfs_v1\include;..\libraries\nuc980\Driver\Include;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\posix\io\epoll;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\utilities\libadt\uthash;..\..\..\components\net\sal\include;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\spi;..\..\..\components\utilities\utest;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\socket;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\drivers\hwcrypto;..\..\..\components\drivers\include;applications;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\drivers\include;..\..\..\components\net\netdev\include;..\libraries\nu_packages\TPC;..\..\..\libcpu\arm\arm926;..\..\..\components\utilities\libadt\ref;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\finsh;..\..\..\components\net\sal\impl;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\libc\posix\ipc;..\..\..\components\utilities\libadt\hashmap;.;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\libraries\nuc980\UsbHostLib\inc;board;..\libraries\nuc980\rtt_port;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\utilities\libadt\avl;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\libraries\nu_packages\Demo;..\..\..\components\legacy\usb\usbdevice;..\..\..\libcpu\arm\common;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\components\libc\compilers\common\include;..\..\..\components\legacy\include;..\..\..\components\drivers\phy;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\lwip\port;..\..\..\components\drivers\include;..\libraries\nu_packages\SPINAND;..\..\..\components\utilities\libadt\bitmap;..\..\..\include;..\..\..\components\drivers\include;..\libraries\nu_packages\AudioCodec;..\..\..\components\libc\compilers\common\extension + --c99 --diag_suppress=1,177,550 + __RTTHREAD__, __STDC_LIMIT_MACROS, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_ARMLIBC, RT_USING_LIBC + + ..\..\..\components\finsh;..\..\..\components\libc\compilers\common\include;..\..\..\components\net\sal\include\socket;..\..\..\components\utilities\libadt\avl;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension;..\..\..\components\legacy\include;..\..\..\components\libc\posix\io\poll;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\..\..\components\drivers\smp_call;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\include;packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\inc;..\..\..\components\libc\posix\ipc;..\..\..\components\drivers\hwcrypto;.;..\..\..\components\utilities\libadt\ref;..\..\..\components\utilities\libadt\uthash;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\net\sal\impl;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\epoll;applications;..\..\..\components\drivers\include;board;..\..\..\components\net\lwip\port;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\utilities\utest;..\..\..\components\drivers\spi;..\..\..\components\drivers\include;..\..\..\include;..\..\..\libcpu\arm\common;..\libraries\nu_packages\SPINAND;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\include;..\libraries\nu_packages\AudioCodec;..\..\..\components\drivers\include;..\..\..\components\net\netdev\include;..\..\..\components\legacy\usb\usbhost;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\net\sal\include;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\libraries\nu_packages\TPC;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\dfs\dfs_v1\filesystems\devfs;packages\nuvoton-arm926-lib-latest\NUC980\Driver\Include;..\..\..\libcpu\arm\arm926;..\..\..\components\legacy\usb\usbdevice;..\libraries\nu_packages\Demo;..\..\..\components\drivers\phy;..\libraries\nuc980\rtt_port;..\..\..\components\drivers\include;..\..\..\components\utilities\libadt\bitmap;..\..\..\components\drivers\include;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\utilities\libadt\hashmap;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\elmfat @@ -386,12 +392,12 @@ 0 0 0 - 0 + 4 - - - - + + + + @@ -403,13 +409,13 @@ 0 0x20000000 0x20800000 - + .\linking_scripts\nuc980.sct - - - - - + + + + + @@ -418,16 +424,14 @@ Applications - main.c + mnt.c 1 - applications\main.c + applications\mnt.c - - - mnt.c + main.c 1 - applications\mnt.c + applications\main.c @@ -439,8 +443,6 @@ 1 board\nu_pin_init.c - - board_dev.c 1 @@ -456,50 +458,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -515,640 +503,1900 @@ 1 ..\..\..\components\drivers\audio\dev_audio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_audio_pipe.c 1 ..\..\..\components\drivers\audio\dev_audio_pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_can.c 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - cputime.c 1 ..\..\..\components\drivers\cputime\cputime.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - cputimer.c 1 ..\..\..\components\drivers\cputime\cputimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - hw_hash.c 1 ..\..\..\components\drivers\hwcrypto\hw_hash.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - hw_rng.c 1 ..\..\..\components\drivers\hwcrypto\hw_rng.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - hw_symmetric.c 1 ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - hwcrypto.c 1 ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - adc.c 1 ..\..\..\components\drivers\misc\adc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - mtd_nand.c 1 ..\..\..\components\drivers\mtd\mtd_nand.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_alarm.c 1 ..\..\..\components\drivers\rtc\dev_alarm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + @@ -1160,177 +2408,129 @@ Drivers - drv_softi2c.c + drv_ebi.c 1 - ..\libraries\nuc980\rtt_port\drv_softi2c.c + ..\libraries\nuc980\rtt_port\drv_ebi.c - - - drv_sys.c + drv_spi.c 1 - ..\libraries\nuc980\rtt_port\drv_sys.c + ..\libraries\nuc980\rtt_port\drv_spi.c - - - drv_etimer_capture.c + drv_pwm.c 1 - ..\libraries\nuc980\rtt_port\drv_etimer_capture.c + ..\libraries\nuc980\rtt_port\drv_pwm.c - - - drv_usbhost.c + drv_can.c 1 - ..\libraries\nuc980\rtt_port\drv_usbhost.c + ..\libraries\nuc980\rtt_port\drv_can.c - - - drv_i2s.c + drv_i2c.c 1 - ..\libraries\nuc980\rtt_port\drv_i2s.c + ..\libraries\nuc980\rtt_port\drv_i2c.c - - - drv_crypto.c + drv_usbhost.c 1 - ..\libraries\nuc980\rtt_port\drv_crypto.c + ..\libraries\nuc980\rtt_port\drv_usbhost.c - - - drv_scuart.c + drv_etimer.c 1 - ..\libraries\nuc980\rtt_port\drv_scuart.c + ..\libraries\nuc980\rtt_port\drv_etimer.c - - drv_emac.c 1 ..\libraries\nuc980\rtt_port\drv_emac.c - - - drv_uart.c + drv_scuart.c 1 - ..\libraries\nuc980\rtt_port\drv_uart.c + ..\libraries\nuc980\rtt_port\drv_scuart.c - - - drv_systick.c + drv_uart.c 1 - ..\libraries\nuc980\rtt_port\drv_systick.c + ..\libraries\nuc980\rtt_port\drv_uart.c - - - drv_pdma.c + drv_common.c 1 - ..\libraries\nuc980\rtt_port\drv_pdma.c + ..\libraries\nuc980\rtt_port\drv_common.c - - - drv_adc.c + drv_i2s.c 1 - ..\libraries\nuc980\rtt_port\drv_adc.c + ..\libraries\nuc980\rtt_port\drv_i2s.c - - - drv_etimer.c + drv_qspi.c 1 - ..\libraries\nuc980\rtt_port\drv_etimer.c + ..\libraries\nuc980\rtt_port\drv_qspi.c - - - drv_common.c + drv_wdt.c 1 - ..\libraries\nuc980\rtt_port\drv_common.c + ..\libraries\nuc980\rtt_port\drv_wdt.c - - - drv_rtc.c + drv_etimer_capture.c 1 - ..\libraries\nuc980\rtt_port\drv_rtc.c + ..\libraries\nuc980\rtt_port\drv_etimer_capture.c - - - drv_wdt.c + drv_sdh.c 1 - ..\libraries\nuc980\rtt_port\drv_wdt.c + ..\libraries\nuc980\rtt_port\drv_sdh.c - - - drv_usbd.c + drv_softi2c.c 1 - ..\libraries\nuc980\rtt_port\drv_usbd.c + ..\libraries\nuc980\rtt_port\drv_softi2c.c - - - drv_can.c + drv_crypto.c 1 - ..\libraries\nuc980\rtt_port\drv_can.c + ..\libraries\nuc980\rtt_port\drv_crypto.c - - - drv_i2c.c + drv_rtc.c 1 - ..\libraries\nuc980\rtt_port\drv_i2c.c + ..\libraries\nuc980\rtt_port\drv_rtc.c - - - drv_sdh.c + drv_gpio.c 1 - ..\libraries\nuc980\rtt_port\drv_sdh.c + ..\libraries\nuc980\rtt_port\drv_gpio.c - - - drv_qspi.c + drv_adc.c 1 - ..\libraries\nuc980\rtt_port\drv_qspi.c + ..\libraries\nuc980\rtt_port\drv_adc.c - - - drv_ebi.c + drv_systick.c 1 - ..\libraries\nuc980\rtt_port\drv_ebi.c + ..\libraries\nuc980\rtt_port\drv_systick.c - - - drv_spi.c + drv_pdma.c 1 - ..\libraries\nuc980\rtt_port\drv_spi.c + ..\libraries\nuc980\rtt_port\drv_pdma.c - - - drv_gpio.c + drv_sys.c 1 - ..\libraries\nuc980\rtt_port\drv_gpio.c + ..\libraries\nuc980\rtt_port\drv_sys.c - - - drv_pwm.c + drv_usbd.c 1 - ..\libraries\nuc980\rtt_port\drv_pwm.c + ..\libraries\nuc980\rtt_port\drv_usbd.c @@ -1342,146 +2542,444 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + @@ -1493,37 +2991,29 @@ Finsh - msh_parse.c + msh.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\msh.c - - - msh_file.c + shell.c 1 - ..\..\..\components\finsh\msh_file.c + ..\..\..\components\finsh\shell.c - - cmd.c 1 ..\..\..\components\finsh\cmd.c - - - msh.c + msh_file.c 1 - ..\..\..\components\finsh\msh.c + ..\..\..\components\finsh\msh_file.c - - - shell.c + msh_parse.c 1 - ..\..\..\components\finsh\shell.c + ..\..\..\components\finsh\msh_parse.c @@ -1535,317 +3025,948 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - memheap.c 1 ..\..\..\src\memheap.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + @@ -1857,37 +3978,29 @@ klibc - rt_vsnprintf_tiny.c + kstring.c 1 - ..\..\..\src\klibc\rt_vsnprintf_tiny.c + ..\..\..\src\klibc\kstring.c - - - kerrno.c + kstdio.c 1 - ..\..\..\src\klibc\kerrno.c + ..\..\..\src\klibc\kstdio.c - - - rt_vsscanf.c + kerrno.c 1 - ..\..\..\src\klibc\rt_vsscanf.c + ..\..\..\src\klibc\kerrno.c - - - kstdio.c + rt_vsnprintf_tiny.c 1 - ..\..\..\src\klibc\kstdio.c + ..\..\..\src\klibc\rt_vsnprintf_tiny.c - - - kstring.c + rt_vsscanf.c 1 - ..\..\..\src\klibc\kstring.c + ..\..\..\src\klibc\rt_vsscanf.c @@ -1899,57 +4012,41 @@ 2 ..\..\..\libcpu\arm\arm926\context_rvds.S - - cpuport.c 1 ..\..\..\libcpu\arm\arm926\cpuport.c - - machine.c 1 ..\..\..\libcpu\arm\arm926\machine.c - - mmu.c 1 ..\..\..\libcpu\arm\arm926\mmu.c - - stack.c 1 ..\..\..\libcpu\arm\arm926\stack.c - - start_rvds.S 2 ..\..\..\libcpu\arm\arm926\start_rvds.S - - trap.c 1 ..\..\..\libcpu\arm\arm926\trap.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 @@ -1961,142 +4058,104 @@ Libraries - nu_sdh.c + nu_can.c 1 - ..\libraries\nuc980\Driver\Source\nu_sdh.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_can.c - - - nu_gpio.c + nu_sdh.c 1 - ..\libraries\nuc980\Driver\Source\nu_gpio.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sdh.c - - - nu_rtc.c + nu_ebi.c 1 - ..\libraries\nuc980\Driver\Source\nu_rtc.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_ebi.c - - - nu_usbd.c + nu_wdt.c 1 - ..\libraries\nuc980\Driver\Source\nu_usbd.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wdt.c - - - nu_sys.c + nu_i2c.c 1 - ..\libraries\nuc980\Driver\Source\nu_sys.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2c.c - - - nu_crypto.c + nu_cap.c 1 - ..\libraries\nuc980\Driver\Source\nu_crypto.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_cap.c - - - nu_ebi.c + nu_spi.c 1 - ..\libraries\nuc980\Driver\Source\nu_ebi.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_spi.c - - nu_emac.c 1 - ..\libraries\nuc980\Driver\Source\nu_emac.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_emac.c - - - nu_i2c.c + nu_pdma.c 1 - ..\libraries\nuc980\Driver\Source\nu_i2c.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_pdma.c - - - nu_wdt.c + nu_sys.c 1 - ..\libraries\nuc980\Driver\Source\nu_wdt.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sys.c - - - nu_wwdt.c + nu_rtc.c 1 - ..\libraries\nuc980\Driver\Source\nu_wwdt.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_rtc.c - - - nu_spi.c + nu_uart.c 1 - ..\libraries\nuc980\Driver\Source\nu_spi.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_uart.c - - nu_etimer.c 1 - ..\libraries\nuc980\Driver\Source\nu_etimer.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_etimer.c - - - nu_uart.c + nu_scuart.c 1 - ..\libraries\nuc980\Driver\Source\nu_uart.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_scuart.c - - - nu_scuart.c + nu_usbd.c 1 - ..\libraries\nuc980\Driver\Source\nu_scuart.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_usbd.c - - - nu_can.c + nu_qspi.c 1 - ..\libraries\nuc980\Driver\Source\nu_can.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_qspi.c - - - nu_qspi.c + nu_wwdt.c 1 - ..\libraries\nuc980\Driver\Source\nu_qspi.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wwdt.c - - - nu_cap.c + nu_i2s.c 1 - ..\libraries\nuc980\Driver\Source\nu_cap.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2s.c - - - nu_pdma.c + nu_crypto.c 1 - ..\libraries\nuc980\Driver\Source\nu_pdma.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_crypto.c - - - nu_i2s.c + nu_gpio.c 1 - ..\libraries\nuc980\Driver\Source\nu_i2s.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_gpio.c @@ -2108,281 +4167,201 @@ 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c - - api_msg.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c - - err.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c - - if_api.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c - - netbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c - - netdb.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c - - netifapi.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c - - sockets.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c - - tcpip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c - - ping.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c - - altcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c - - altcp_alloc.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c - - altcp_tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c - - def.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c - - dns.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c - - inet_chksum.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c - - init.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c - - ip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c - - autoip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c - - dhcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c - - etharp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c - - icmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c - - igmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c - - ip4.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c - - ip4_addr.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c - - ip4_frag.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c - - memp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c - - netif.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c - - pbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c - - raw.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c - - stats.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c - - sys.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c - - tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c - - tcp_in.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c - - tcp_out.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c - - timeouts.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c - - udp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c - - ethernet.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c - - lowpan6.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c - - ethernetif.c 1 ..\..\..\components\net\lwip\port\ethernetif.c - - sys_arch.c 1 @@ -2394,65 +4373,49 @@ nu_pkgs_demo - ccap_saver.c + usbd_cdc_vcom_echo.c 1 - ..\libraries\nu_packages\Demo\ccap_saver.c + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c - - - atdev_utils.c + ccap_demo.c 1 - ..\libraries\nu_packages\Demo\atdev_utils.c + ..\libraries\nu_packages\Demo\ccap_demo.c - - - ccap_demo.c + wormhole_demo.c 1 - ..\libraries\nu_packages\Demo\ccap_demo.c + ..\libraries\nu_packages\Demo\wormhole_demo.c - - - smp_demo.c + usbd_hid_dance_mouse.c 1 - ..\libraries\nu_packages\Demo\smp_demo.c + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c - - - hwsem_counter.c + ccap_saver.c 1 - ..\libraries\nu_packages\Demo\hwsem_counter.c + ..\libraries\nu_packages\Demo\ccap_saver.c - - - wormhole_demo.c + smp_demo.c 1 - ..\libraries\nu_packages\Demo\wormhole_demo.c + ..\libraries\nu_packages\Demo\smp_demo.c - - - usbd_hid_dance_mouse.c + hwsem_counter.c 1 - ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + ..\libraries\nu_packages\Demo\hwsem_counter.c - - slcd_show_tick.c 1 ..\libraries\nu_packages\Demo\slcd_show_tick.c - - - usbd_cdc_vcom_echo.c + atdev_utils.c 1 - ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + ..\libraries\nu_packages\Demo\atdev_utils.c @@ -2464,8 +4427,6 @@ 1 ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c - - audio_test.c 1 @@ -2477,16 +4438,14 @@ nu_pkgs_spinand - drv_spinand.c + spinand.c 1 - ..\libraries\nu_packages\SPINAND\drv_spinand.c + ..\libraries\nu_packages\SPINAND\spinand.c - - - spinand.c + drv_spinand.c 1 - ..\libraries\nu_packages\SPINAND\spinand.c + ..\libraries\nu_packages\SPINAND\drv_spinand.c @@ -2494,44 +4453,34 @@ nuc980_usbhostlib - ehci.c + mem_alloc.c 1 - ..\libraries\nuc980\UsbHostLib\src\ehci.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\mem_alloc.c - - ehci_iso.c 1 - ..\libraries\nuc980\UsbHostLib\src\ehci_iso.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci_iso.c - - usb_core.c 1 - ..\libraries\nuc980\UsbHostLib\src\usb_core.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\usb_core.c - - - ohci.c + ehci.c 1 - ..\libraries\nuc980\UsbHostLib\src\ohci.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci.c - - - mem_alloc.c + ohci.c 1 - ..\libraries\nuc980\UsbHostLib\src\mem_alloc.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ohci.c - - support.c 1 - ..\libraries\nuc980\UsbHostLib\src\support.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\support.c @@ -2543,8 +4492,6 @@ 1 ..\..\..\components\libc\posix\io\poll\poll.c - - select.c 1 @@ -2555,27 +4502,21 @@ rt_usbd + + usbdevice_core.c + 1 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + cdc_vcom.c 1 ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c - - usbdevice.c 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c - - - - usbdevice_core.c - 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c - - - mstorage.c 1 @@ -2591,40 +4532,30 @@ 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c - - - udisk.c + driver.c 1 - ..\..\..\components\legacy\usb\usbhost\class\udisk.c + ..\..\..\components\legacy\usb\usbhost\core\driver.c - - usbhost.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost.c - - - hub.c + mass.c 1 - ..\..\..\components\legacy\usb\usbhost\core\hub.c + ..\..\..\components\legacy\usb\usbhost\class\mass.c - - - driver.c + udisk.c 1 - ..\..\..\components\legacy\usb\usbhost\core\driver.c + ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - - mass.c + hub.c 1 - ..\..\..\components\legacy\usb\usbhost\class\mass.c + ..\..\..\components\legacy\usb\usbhost\core\hub.c @@ -2636,43 +4567,31 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_lwip.c 1 ..\..\..\components\net\sal\impl\af_inet_lwip.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -2684,16 +4603,14 @@ UTest - utest.c + TC_uassert.c 1 - ..\..\..\components\utilities\utest\utest.c + ..\..\..\components\utilities\utest\TC_uassert.c - - - TC_uassert.c + utest.c 1 - ..\..\..\components\utilities\utest\TC_uassert.c + ..\..\..\components\utilities\utest\utest.c @@ -2710,4 +4627,5 @@ +
diff --git a/bsp/nuvoton/nk-980iot/project.uvprojx b/bsp/nuvoton/nk-980iot/project.uvprojx new file mode 100644 index 00000000000..9aec0381166 --- /dev/null +++ b/bsp/nuvoton/nk-980iot/project.uvprojx @@ -0,0 +1,4596 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + rtthread + 0x4 + ARM-ADS + 5060960::V5.06 update 7 (build 960)::.\ARMCC + 0 + + + Nuvoton_ARM9_Series + Nuvoton + IRAM(0x0-0x0) CLOCK(000000000) CPUTYPE(ARM926EJ-S) + + + + 0 + + + + + + + + + + + + 0 + 0 + + + + Atmel\SAM9260\ + Atmel\SAM9260\ + + 0 + 0 + 0 + 0 + 1 + + .\build\keil4\ + rtthread + 1 + 0 + 0 + 1 + 1 + .\Listings\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 1 + 0 + fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARM.DLL + -cAT91SAM9 + DARMATS9.DLL + -p91SAM9260 + SARM.DLL + + TARMATS9.DLL + -p91SAM9260 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 0 + 1 + 4098 + + 0 + Segger\JLTAgdi.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 + ARM926EJ-S + + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x1 + + + 1 + 0x100000 + 0x8000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x1 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + __STDC_LIMIT_MACROS, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_LIBC, RT_USING_ARMLIBC + + ..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\dfs_net;..\libraries\nu_packages\Demo;..\..\..\components\utilities\libadt\uthash;..\..\..\components\net\netdev\include;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\drivers\audio;..\..\..\components\utilities\libadt\hashmap;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\libc\posix\io\epoll;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\drivers\include;.;..\..\..\libcpu\arm\arm926;..\..\..\components\libc\posix\ipc;..\..\..\components\dfs\dfs_v1\include;applications;..\..\..\components\net\lwip\lwip-2.1.2\src\include;packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\inc;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\net\sal\impl;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\libraries\nu_packages\SPINAND;..\libraries\nu_packages\TPC;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\components\utilities\libadt\bitmap;..\..\..\components\drivers\include;..\..\..\components\legacy\include;..\..\..\libcpu\arm\common;..\..\..\components\libc\compilers\common\extension;..\..\..\components\net\lwip\port;..\libraries\nuc980\rtt_port;..\..\..\components\libc\compilers\common\include;..\..\..\components\drivers\hwcrypto;..\..\..\components\utilities\libadt\avl;..\..\..\components\libc\compilers\common\extension\fcntl\octal;board;..\..\..\include;packages\nuvoton-arm926-lib-latest\NUC980\Driver\Include;..\..\..\components\drivers\include;..\..\..\components\utilities\utest;..\..\..\components\utilities\libadt\ref;..\..\..\components\drivers\include;..\..\..\components\finsh;..\..\..\components\drivers\smp_call;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\net\sal\include\socket;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\net\sal\include;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\drivers\include;..\..\..\components\drivers\spi;..\libraries\nu_packages\AudioCodec;..\..\..\components\drivers\include;..\..\..\components\drivers\phy;..\..\..\components\drivers\include + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + + + + + + + + + 0 + 0 + 0 + 0 + 1 + 0 + 0x20000000 + 0x20800000 + + .\linking_scripts\nuc980.sct + + + + + + + + + + + Applications + + + mnt.c + 1 + applications\mnt.c + + + main.c + 1 + applications\main.c + + + + + board + + + nu_pin_init.c + 1 + board\nu_pin_init.c + + + board_dev.c + 1 + board\board_dev.c + + + + + Compiler + + + syscall_mem.c + 1 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + + + syscalls.c + 1 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + + + cctype.c + 1 + ..\..\..\components\libc\compilers\common\cctype.c + + + cstdlib.c + 1 + ..\..\..\components\libc\compilers\common\cstdlib.c + + + cstring.c + 1 + ..\..\..\components\libc\compilers\common\cstring.c + + + ctime.c + 1 + ..\..\..\components\libc\compilers\common\ctime.c + + + cunistd.c + 1 + ..\..\..\components\libc\compilers\common\cunistd.c + + + cwchar.c + 1 + ..\..\..\components\libc\compilers\common\cwchar.c + + + + + DeviceDrivers + + + dev_audio.c + 1 + ..\..\..\components\drivers\audio\dev_audio.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_audio_pipe.c + 1 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_can.c + 1 + ..\..\..\components\drivers\can\dev_can.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + device.c + 1 + ..\..\..\components\drivers\core\device.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + cputime.c + 1 + ..\..\..\components\drivers\cputime\cputime.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + cputimer.c + 1 + ..\..\..\components\drivers\cputime\cputimer.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + hw_hash.c + 1 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + hw_rng.c + 1 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + hw_symmetric.c + 1 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + hwcrypto.c + 1 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + hwtimer.c + 1 + ..\..\..\components\drivers\hwtimer\hwtimer.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_i2c_bit_ops.c + 1 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_i2c_core.c + 1 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_i2c_dev.c + 1 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + completion_comm.c + 1 + ..\..\..\components\drivers\ipc\completion_comm.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + completion_up.c + 1 + ..\..\..\components\drivers\ipc\completion_up.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + condvar.c + 1 + ..\..\..\components\drivers\ipc\condvar.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dataqueue.c + 1 + ..\..\..\components\drivers\ipc\dataqueue.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + pipe.c + 1 + ..\..\..\components\drivers\ipc\pipe.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + ringblk_buf.c + 1 + ..\..\..\components\drivers\ipc\ringblk_buf.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + ringbuffer.c + 1 + ..\..\..\components\drivers\ipc\ringbuffer.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + waitqueue.c + 1 + ..\..\..\components\drivers\ipc\waitqueue.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + workqueue.c + 1 + ..\..\..\components\drivers\ipc\workqueue.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + adc.c + 1 + ..\..\..\components\drivers\misc\adc.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + rt_drv_pwm.c + 1 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + mtd_nand.c + 1 + ..\..\..\components\drivers\mtd\mtd_nand.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_pin.c + 1 + ..\..\..\components\drivers\pin\dev_pin.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_alarm.c + 1 + ..\..\..\components\drivers\rtc\dev_alarm.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_rtc.c + 1 + ..\..\..\components\drivers\rtc\dev_rtc.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_serial.c + 1 + ..\..\..\components\drivers\serial\dev_serial.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_qspi_core.c + 1 + ..\..\..\components\drivers\spi\dev_qspi_core.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_spi.c + 1 + ..\..\..\components\drivers\spi\dev_spi.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_spi_core.c + 1 + ..\..\..\components\drivers\spi\dev_spi_core.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + dev_watchdog.c + 1 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_IPC_SOURCE__ + + + + + + + + + + + Drivers + + + drv_usbd.c + 1 + ..\libraries\nuc980\rtt_port\drv_usbd.c + + + drv_adc.c + 1 + ..\libraries\nuc980\rtt_port\drv_adc.c + + + drv_can.c + 1 + ..\libraries\nuc980\rtt_port\drv_can.c + + + drv_uart.c + 1 + ..\libraries\nuc980\rtt_port\drv_uart.c + + + drv_etimer.c + 1 + ..\libraries\nuc980\rtt_port\drv_etimer.c + + + drv_i2s.c + 1 + ..\libraries\nuc980\rtt_port\drv_i2s.c + + + drv_qspi.c + 1 + ..\libraries\nuc980\rtt_port\drv_qspi.c + + + drv_systick.c + 1 + ..\libraries\nuc980\rtt_port\drv_systick.c + + + drv_usbhost.c + 1 + ..\libraries\nuc980\rtt_port\drv_usbhost.c + + + drv_common.c + 1 + ..\libraries\nuc980\rtt_port\drv_common.c + + + drv_gpio.c + 1 + ..\libraries\nuc980\rtt_port\drv_gpio.c + + + drv_sdh.c + 1 + ..\libraries\nuc980\rtt_port\drv_sdh.c + + + drv_softi2c.c + 1 + ..\libraries\nuc980\rtt_port\drv_softi2c.c + + + drv_pwm.c + 1 + ..\libraries\nuc980\rtt_port\drv_pwm.c + + + drv_pdma.c + 1 + ..\libraries\nuc980\rtt_port\drv_pdma.c + + + drv_etimer_capture.c + 1 + ..\libraries\nuc980\rtt_port\drv_etimer_capture.c + + + drv_crypto.c + 1 + ..\libraries\nuc980\rtt_port\drv_crypto.c + + + drv_emac.c + 1 + ..\libraries\nuc980\rtt_port\drv_emac.c + + + drv_wdt.c + 1 + ..\libraries\nuc980\rtt_port\drv_wdt.c + + + drv_sys.c + 1 + ..\libraries\nuc980\rtt_port\drv_sys.c + + + drv_i2c.c + 1 + ..\libraries\nuc980\rtt_port\drv_i2c.c + + + drv_spi.c + 1 + ..\libraries\nuc980\rtt_port\drv_spi.c + + + drv_ebi.c + 1 + ..\libraries\nuc980\rtt_port\drv_ebi.c + + + drv_scuart.c + 1 + ..\libraries\nuc980\rtt_port\drv_scuart.c + + + drv_rtc.c + 1 + ..\libraries\nuc980\rtt_port\drv_rtc.c + + + + + Filesystem + + + devfs.c + 1 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + dfs_elm.c + 1 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + ff.c + 1 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + ffunicode.c + 1 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + dfs.c + 1 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + dfs_file.c + 1 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + dfs_fs.c + 1 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + dfs_posix.c + 1 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + --c99 + + + + + + + + + + + + Finsh + + + msh_file.c + 1 + ..\..\..\components\finsh\msh_file.c + + + cmd.c + 1 + ..\..\..\components\finsh\cmd.c + + + msh.c + 1 + ..\..\..\components\finsh\msh.c + + + msh_parse.c + 1 + ..\..\..\components\finsh\msh_parse.c + + + shell.c + 1 + ..\..\..\components\finsh\shell.c + + + + + Kernel + + + clock.c + 1 + ..\..\..\src\clock.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + components.c + 1 + ..\..\..\src\components.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + cpu_up.c + 1 + ..\..\..\src\cpu_up.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + defunct.c + 1 + ..\..\..\src\defunct.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + idle.c + 1 + ..\..\..\src\idle.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + ipc.c + 1 + ..\..\..\src\ipc.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + irq.c + 1 + ..\..\..\src\irq.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + kservice.c + 1 + ..\..\..\src\kservice.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + mem.c + 1 + ..\..\..\src\mem.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + memheap.c + 1 + ..\..\..\src\memheap.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + mempool.c + 1 + ..\..\..\src\mempool.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + object.c + 1 + ..\..\..\src\object.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + scheduler_comm.c + 1 + ..\..\..\src\scheduler_comm.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + scheduler_up.c + 1 + ..\..\..\src\scheduler_up.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + signal.c + 1 + ..\..\..\src\signal.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + thread.c + 1 + ..\..\..\src\thread.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + timer.c + 1 + ..\..\..\src\timer.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + __RT_KERNEL_SOURCE__ + + + + + + + + + + + klibc + + + kstdio.c + 1 + ..\..\..\src\klibc\kstdio.c + + + kstring.c + 1 + ..\..\..\src\klibc\kstring.c + + + kerrno.c + 1 + ..\..\..\src\klibc\kerrno.c + + + rt_vsscanf.c + 1 + ..\..\..\src\klibc\rt_vsscanf.c + + + rt_vsnprintf_tiny.c + 1 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + + + + + libcpu + + + context_rvds.S + 2 + ..\..\..\libcpu\arm\arm926\context_rvds.S + + + cpuport.c + 1 + ..\..\..\libcpu\arm\arm926\cpuport.c + + + machine.c + 1 + ..\..\..\libcpu\arm\arm926\machine.c + + + mmu.c + 1 + ..\..\..\libcpu\arm\arm926\mmu.c + + + stack.c + 1 + ..\..\..\libcpu\arm\arm926\stack.c + + + start_rvds.S + 2 + ..\..\..\libcpu\arm\arm926\start_rvds.S + + + trap.c + 1 + ..\..\..\libcpu\arm\arm926\trap.c + + + div0.c + 1 + ..\..\..\libcpu\arm\common\div0.c + + + showmem.c + 1 + ..\..\..\libcpu\arm\common\showmem.c + + + + + Libraries + + + nu_emac.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_emac.c + + + nu_rtc.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_rtc.c + + + nu_wwdt.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wwdt.c + + + nu_cap.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_cap.c + + + nu_crypto.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_crypto.c + + + nu_scuart.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_scuart.c + + + nu_wdt.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wdt.c + + + nu_i2c.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2c.c + + + nu_uart.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_uart.c + + + nu_ebi.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_ebi.c + + + nu_qspi.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_qspi.c + + + nu_can.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_can.c + + + nu_gpio.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_gpio.c + + + nu_usbd.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_usbd.c + + + nu_sdh.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sdh.c + + + nu_etimer.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_etimer.c + + + nu_pdma.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_pdma.c + + + nu_spi.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_spi.c + + + nu_i2s.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2s.c + + + nu_sys.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sys.c + + + + + lwIP + + + api_lib.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c + + + api_msg.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c + + + err.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c + + + if_api.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c + + + netbuf.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c + + + netdb.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c + + + netifapi.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c + + + sockets.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c + + + tcpip.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c + + + ping.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c + + + altcp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c + + + altcp_alloc.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c + + + altcp_tcp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c + + + def.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c + + + dns.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c + + + inet_chksum.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c + + + init.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c + + + ip.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c + + + autoip.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c + + + dhcp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c + + + etharp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c + + + icmp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c + + + igmp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c + + + ip4.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c + + + ip4_addr.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c + + + ip4_frag.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c + + + memp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c + + + netif.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c + + + pbuf.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c + + + raw.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c + + + stats.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c + + + sys.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c + + + tcp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c + + + tcp_in.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c + + + tcp_out.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c + + + timeouts.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c + + + udp.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c + + + ethernet.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c + + + lowpan6.c + 1 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c + + + ethernetif.c + 1 + ..\..\..\components\net\lwip\port\ethernetif.c + + + sys_arch.c + 1 + ..\..\..\components\net\lwip\port\sys_arch.c + + + + + nu_pkgs_demo + + + usbd_hid_dance_mouse.c + 1 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + + + wormhole_demo.c + 1 + ..\libraries\nu_packages\Demo\wormhole_demo.c + + + hwsem_counter.c + 1 + ..\libraries\nu_packages\Demo\hwsem_counter.c + + + slcd_show_tick.c + 1 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + + + usbd_cdc_vcom_echo.c + 1 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + + + ccap_saver.c + 1 + ..\libraries\nu_packages\Demo\ccap_saver.c + + + smp_demo.c + 1 + ..\libraries\nu_packages\Demo\smp_demo.c + + + atdev_utils.c + 1 + ..\libraries\nu_packages\Demo\atdev_utils.c + + + ccap_demo.c + 1 + ..\libraries\nu_packages\Demo\ccap_demo.c + + + + + nu_pkgs_nau8822 + + + acodec_nau8822.c + 1 + ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c + + + audio_test.c + 1 + ..\libraries\nu_packages\AudioCodec\audio_test.c + + + + + nu_pkgs_spinand + + + spinand.c + 1 + ..\libraries\nu_packages\SPINAND\spinand.c + + + drv_spinand.c + 1 + ..\libraries\nu_packages\SPINAND\drv_spinand.c + + + + + nuc980_usbhostlib + + + ehci_iso.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci_iso.c + + + usb_core.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\usb_core.c + + + support.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\support.c + + + mem_alloc.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\mem_alloc.c + + + ohci.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ohci.c + + + ehci.c + 1 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci.c + + + + + POSIX + + + poll.c + 1 + ..\..\..\components\libc\posix\io\poll\poll.c + + + select.c + 1 + ..\..\..\components\libc\posix\io\poll\select.c + + + + + rt_usbd + + + usbdevice_core.c + 1 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + + + usbdevice.c + 1 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + + + cdc_vcom.c + 1 + ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c + + + mstorage.c + 1 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + + + + + rt_usbh + + + driver.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + + + mass.c + 1 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + + + usbhost_core.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + + + usbhost.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + + + udisk.c + 1 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + + + hub.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + + + + + SAL + + + netdev.c + 1 + ..\..\..\components\net\netdev\src\netdev.c + + + netdev_ipaddr.c + 1 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + + + dfs_net.c + 1 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + + + af_inet_lwip.c + 1 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + + + net_netdb.c + 1 + ..\..\..\components\net\sal\socket\net_netdb.c + + + net_sockets.c + 1 + ..\..\..\components\net\sal\socket\net_sockets.c + + + sal_socket.c + 1 + ..\..\..\components\net\sal\src\sal_socket.c + + + + + UTest + + + utest.c + 1 + ..\..\..\components\utilities\utest\utest.c + + + TC_uassert.c + 1 + ..\..\..\components\utilities\utest\TC_uassert.c + + + + + Utilities + + + avl.c + 1 + ..\..\..\components\utilities\libadt\avl\avl.c + + + + + + + + + + + + + +
diff --git a/bsp/nuvoton/nk-n9h30/project.uvopt b/bsp/nuvoton/nk-n9h30/project.uvopt new file mode 100644 index 00000000000..246d751843e --- /dev/null +++ b/bsp/nuvoton/nk-n9h30/project.uvopt @@ -0,0 +1,2849 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread + 0x4 + ARM-ADS + + 0 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 0 + + 0 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 18 + + + + + + + + + + ..\libraries\n9h30\Script\InitDDR2.ini + Segger\JLTAgdi.dll + + + + 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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + + + board + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + board\nu_pin_init.c + nu_pin_init.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_inputcapture.c + rt_inputcapture.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\mtd\mtd_nand.c + mtd_nand.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_alarm.c + dev_alarm.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 4 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 4 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + dev_spi_flash_sfud.c + 0 + 0 + + + 4 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud.c + sfud.c + 0 + 0 + + + 4 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + sfud_sfdp.c + 0 + 0 + + + 4 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\touch\dev_touch.c + dev_touch.c + 0 + 0 + + + 4 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 5 + 46 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 5 + 47 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 5 + 48 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 5 + 49 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 5 + 50 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_systick.c + drv_systick.c + 0 + 0 + + + 5 + 51 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 5 + 52 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 5 + 53 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_jpegcodec.c + drv_jpegcodec.c + 0 + 0 + + + 5 + 54 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 5 + 55 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 5 + 56 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_sys.c + drv_sys.c + 0 + 0 + + + 5 + 57 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_vpost.c + drv_vpost.c + 0 + 0 + + + 5 + 58 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_adc.c + drv_adc.c + 0 + 0 + + + 5 + 59 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_etimer_capture.c + drv_etimer_capture.c + 0 + 0 + + + 5 + 60 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_etimer.c + drv_etimer.c + 0 + 0 + + + 5 + 61 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 5 + 62 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_emac.c + drv_emac.c + 0 + 0 + + + 5 + 63 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_pwm.c + drv_pwm.c + 0 + 0 + + + 5 + 64 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + 5 + 65 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_timer.c + drv_timer.c + 0 + 0 + + + 5 + 66 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_ge2d.c + drv_ge2d.c + 0 + 0 + + + 5 + 67 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_can.c + drv_can.c + 0 + 0 + + + 5 + 68 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 5 + 69 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 5 + 70 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 5 + 71 + 1 + 0 + 0 + 0 + ..\libraries\n9h30\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + + + Fal + 0 + 0 + 0 + 0 + + 6 + 72 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_flash.c + fal_flash.c + 0 + 0 + + + 6 + 73 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c + fal_flash_sfud_port.c + 0 + 0 + + + 6 + 74 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal.c + fal.c + 0 + 0 + + + 6 + 75 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_rtt.c + fal_rtt.c + 0 + 0 + + + 6 + 76 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_partition.c + fal_partition.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 7 + 77 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 7 + 78 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 7 + 79 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 7 + 80 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 7 + 81 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + dfs.c + 0 + 0 + + + 7 + 82 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 7 + 83 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 7 + 84 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 8 + 85 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 8 + 86 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 8 + 87 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 8 + 88 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + 8 + 89 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 9 + 90 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 9 + 91 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 9 + 92 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 9 + 93 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 9 + 94 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 9 + 95 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 9 + 96 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 9 + 97 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 9 + 98 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 9 + 99 + 1 + 0 + 0 + 0 + ..\..\..\src\memheap.c + memheap.c + 0 + 0 + + + 9 + 100 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 9 + 101 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 9 + 102 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 9 + 103 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 9 + 104 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 9 + 105 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 9 + 106 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 10 + 107 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 10 + 108 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 10 + 109 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + 10 + 110 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 10 + 111 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 11 + 112 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\context_rvds.S + context_rvds.S + 0 + 0 + + + 11 + 113 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\cpuport.c + cpuport.c + 0 + 0 + + + 11 + 114 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\machine.c + machine.c + 0 + 0 + + + 11 + 115 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\mmu.c + mmu.c + 0 + 0 + + + 11 + 116 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\stack.c + stack.c + 0 + 0 + + + 11 + 117 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\start_rvds.S + start_rvds.S + 0 + 0 + + + 11 + 118 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\trap.c + trap.c + 0 + 0 + + + 11 + 119 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 11 + 120 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 12 + 121 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 12 + 122 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 12 + 123 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_spi.c + nu_spi.c + 0 + 0 + + + 12 + 124 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_timer.c + nu_timer.c + 0 + 0 + + + 12 + 125 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 12 + 126 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 12 + 127 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 12 + 128 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_fmi.c + nu_fmi.c + 0 + 0 + + + 12 + 129 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_cap.c + nu_cap.c + 0 + 0 + + + 12 + 130 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_sys.c + nu_sys.c + 0 + 0 + + + 12 + 131 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 12 + 132 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 12 + 133 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_lcd.c + nu_lcd.c + 0 + 0 + + + 12 + 134 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_uart.c + nu_uart.c + 0 + 0 + + + 12 + 135 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_can.c + nu_can.c + 0 + 0 + + + 12 + 136 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 12 + 137 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_emac.c + nu_emac.c + 0 + 0 + + + 12 + 138 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_pwm.c + nu_pwm.c + 0 + 0 + + + 12 + 139 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_etimer.c + nu_etimer.c + 0 + 0 + + + 12 + 140 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_gpio.c + nu_gpio.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 13 + 141 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 13 + 142 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 13 + 143 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\err.c + err.c + 0 + 0 + + + 13 + 144 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 13 + 145 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netdb.c + netdb.c + 0 + 0 + + + 13 + 146 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 13 + 147 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\sockets.c + sockets.c + 0 + 0 + + + 13 + 148 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 13 + 149 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 13 + 150 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\def.c + def.c + 0 + 0 + + + 13 + 151 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\dns.c + dns.c + 0 + 0 + + + 13 + 152 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 13 + 153 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\init.c + init.c + 0 + 0 + + + 13 + 154 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ip.c + ip.c + 0 + 0 + + + 13 + 155 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 13 + 156 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 13 + 157 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 13 + 158 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 13 + 159 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 13 + 160 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 13 + 161 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 13 + 162 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 13 + 163 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\memp.c + memp.c + 0 + 0 + + + 13 + 164 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\netif.c + netif.c + 0 + 0 + + + 13 + 165 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 13 + 166 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\raw.c + raw.c + 0 + 0 + + + 13 + 167 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\stats.c + stats.c + 0 + 0 + + + 13 + 168 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\sys.c + sys.c + 0 + 0 + + + 13 + 169 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp.c + tcp.c + 0 + 0 + + + 13 + 170 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 13 + 171 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 13 + 172 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 13 + 173 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\udp.c + udp.c + 0 + 0 + + + 13 + 174 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 13 + 175 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 13 + 176 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 13 + 177 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + n9h30_usbhostlib + 0 + 0 + 0 + 0 + + 14 + 178 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\ehci.c + ehci.c + 0 + 0 + + + 14 + 179 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 14 + 180 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + 14 + 181 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + 14 + 182 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + 14 + 183 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\support.c + support.c + 0 + 0 + + + + + nu_pkgs_adc_touch + 0 + 0 + 0 + 0 + + 15 + 184 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\ADC_TOUCH\touch_sw.c + touch_sw.c + 0 + 0 + + + 15 + 185 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\ADC_TOUCH\adc_touch.c + adc_touch.c + 0 + 0 + + + + + nu_pkgs_nau8822 + 0 + 0 + 0 + 0 + + 16 + 186 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\audio_test.c + audio_test.c + 0 + 0 + + + 16 + 187 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c + acodec_nau8822.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 17 + 188 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 17 + 189 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 18 + 190 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c + cdc_vcom.c + 0 + 0 + + + 18 + 191 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 18 + 192 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + mstorage.c + 0 + 0 + + + 18 + 193 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 19 + 194 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + 19 + 195 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 19 + 196 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 19 + 197 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + 19 + 198 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + 19 + 199 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 20 + 200 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 20 + 201 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 20 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 20 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 20 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 20 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 20 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 21 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + 21 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 22 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\libadt\avl\avl.c + avl.c + 0 + 0 + + + +
diff --git a/bsp/nuvoton/nk-n9h30/project.uvproj b/bsp/nuvoton/nk-n9h30/project.uvproj index 83f97db1c6c..edf97f9ebd8 100644 --- a/bsp/nuvoton/nk-n9h30/project.uvproj +++ b/bsp/nuvoton/nk-n9h30/project.uvproj @@ -1,7 +1,10 @@ + 1.1 +
### uVision Project, (C) Keil Software
+ rtthread @@ -14,26 +17,26 @@ Nuvoton_ARM9_Series Nuvoton IRAM(0x0-0x0) CLOCK(000000000) CPUTYPE(ARM926EJ-S) - - - + + + 0 - - - - - - - - - - - + + + + + + + + + + + 0 0 - - - + + + Atmel\SAM9260\ Atmel\SAM9260\ @@ -57,8 +60,8 @@ 0 0 - - + + 0 0 0 @@ -67,8 +70,8 @@ 0 0 - - + + 0 0 0 @@ -78,14 +81,14 @@ 1 0 fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" - + 0 0 0 0 0 - + 0 @@ -99,8 +102,8 @@ 0 0 3 - - + + 1 @@ -109,7 +112,7 @@ DARMATS9.DLL -p91SAM9260 SARM.DLL - + TARMATS9.DLL -p91SAM9260 @@ -148,17 +151,17 @@ 0 18 - - - - - + + + + + - - - - + + + + ..\libraries\n9h30\Script\InitDDR2.ini Segger\JLTAgdi.dll @@ -174,11 +177,11 @@ 0 Segger\JLTAgdi.dll - - - - - + + + + + 0 @@ -211,7 +214,7 @@ 0 0 ARM926EJ-S - + 0 0 0 @@ -221,6 +224,8 @@ 0 0 0 + 0 + 0 0 0 0 @@ -344,7 +349,7 @@ 0x0 - + 1 @@ -371,10 +376,10 @@ 0 0 - --c99 - RT_USING_LIBC, RT_USING_ARMLIBC, __RTTHREAD__, __STDC_LIMIT_MACROS, __CLK_TCK=RT_TICK_PER_SECOND - - ..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\netdev\include;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\net\sal\impl;..\..\..\components\drivers\include;..\..\..\components\fal\inc;..\libraries\nu_packages\NuUtils\inc;..\libraries\n9h30\Driver\Include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\..\..\components\libc\compilers\common\include;..\..\..\components\finsh;.;..\..\..\components\net\lwip\port;..\libraries\nu_packages\ADC_TOUCH;..\..\..\components\drivers\touch;..\libraries\nu_packages\TPC;..\..\..\components\libc\posix\io\epoll;..\..\..\components\legacy\usb\usbhost;..\..\..\components\net\sal\include;..\libraries\nu_packages\AudioCodec;..\..\..\components\utilities\libadt\hashmap;..\..\..\components\net\lwip\lwip-2.0.3\src\include;..\..\..\components\utilities\libadt\avl;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension;..\..\..\components\net\lwip\lwip-2.0.3\src\include\netif;..\libraries\n9h30\UsbHostLib\inc;..\..\..\components\legacy\include;..\..\..\libcpu\arm\common;..\..\..\components\utilities\libadt\ref;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\libc\posix\ipc;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\spi;..\..\..\components\utilities\libadt\bitmap;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\lwip\lwip-2.0.3\src\include\ipv4;..\..\..\components\utilities\libadt\uthash;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\libraries\n9h30\rtt_port;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\drivers\include;..\..\..\include;..\..\..\components\drivers\smp_call;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\net\sal\include\dfs_net;applications;..\..\..\components\net\sal\include\socket;..\..\..\libcpu\arm\arm926;..\..\..\components\drivers\include;..\..\..\components\utilities\utest;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\include;..\..\..\components\drivers\phy + --c99 --diag_suppress=1,177,550 + RT_USING_ARMLIBC, RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, __STDC_LIMIT_MACROS, __RTTHREAD__ + + ..\..\..\components\libc\compilers\common\extension\fcntl\octal;packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\inc;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\utilities\libadt\hashmap;..\..\..\components\drivers\smp_call;..\..\..\libcpu\arm\common;packages\nuvoton-arm926-lib-latest\N9H30\Driver\Include;.;..\libraries\nu_packages\ADC_TOUCH;..\..\..\components\drivers\audio;..\..\..\components\net\lwip\lwip-2.0.3\src\include\netif;board;..\..\..\components\drivers\touch;..\..\..\components\utilities\utest;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\drivers\include;applications;..\..\..\components\drivers\include;..\..\..\components\net\netdev\include;..\..\..\components\net\sal\include\dfs_net;..\libraries\nu_packages\TPC;..\libraries\nu_packages\AudioCodec;..\..\..\components\utilities\libadt\avl;..\..\..\components\drivers\include;..\..\..\components\net\lwip\lwip-2.0.3\src\include\ipv4;..\..\..\components\legacy\usb\usbhost;..\..\..\components\net\sal\impl;..\libraries\n9h30\rtt_port;..\..\..\components\utilities\libadt\uthash;..\..\..\components\drivers\spi;..\..\..\components\libc\compilers\common\include;..\..\..\components\drivers\include;..\..\..\components\finsh;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\include;..\..\..\components\fal\inc;..\..\..\components\drivers\include;..\..\..\include;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\utilities\libadt\ref;..\..\..\components\libc\posix\ipc;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\phy;..\..\..\libcpu\arm\arm926;..\..\..\components\net\lwip\port;..\..\..\components\drivers\include;..\..\..\components\net\sal\include;..\..\..\components\net\lwip\lwip-2.0.3\src\include;..\..\..\components\legacy\include;..\..\..\components\net\sal\include\socket;..\..\..\components\drivers\include;..\..\..\components\utilities\libadt\bitmap;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\elmfat @@ -387,12 +392,12 @@ 0 0 0 - 0 + 4 - - - - + + + + @@ -404,13 +409,13 @@ 0 0x20000000 0x20800000 - + .\linking_scripts\n9h30.sct - - - - - + + + + + @@ -423,8 +428,6 @@ 1 applications\main.c - - mnt.c 1 @@ -436,16 +439,14 @@ board - board_dev.c + nu_pin_init.c 1 - board\board_dev.c + board\nu_pin_init.c - - - nu_pin_init.c + board_dev.c 1 - board\nu_pin_init.c + board\board_dev.c @@ -457,50 +458,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -516,8 +503,47 @@ 1 ..\..\..\components\drivers\audio\dev_audio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -528,15 +554,52 @@ - - dev_audio_pipe.c 1 ..\..\..\components\drivers\audio\dev_audio_pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -547,15 +610,52 @@ - - dev_can.c 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -566,15 +666,52 @@ - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -585,15 +722,52 @@ - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -604,15 +778,52 @@ - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -623,15 +834,52 @@ - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -642,15 +890,52 @@ - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -661,15 +946,52 @@ - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -680,15 +1002,52 @@ - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -699,15 +1058,52 @@ - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -718,15 +1114,52 @@ - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -737,15 +1170,52 @@ - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -756,15 +1226,52 @@ - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -775,15 +1282,52 @@ - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -794,15 +1338,52 @@ - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -813,15 +1394,52 @@ - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -832,15 +1450,52 @@ - - adc.c 1 ..\..\..\components\drivers\misc\adc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -851,15 +1506,52 @@ - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -870,15 +1562,52 @@ - - rt_inputcapture.c 1 ..\..\..\components\drivers\misc\rt_inputcapture.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -889,15 +1618,52 @@ - - mtd_nand.c 1 ..\..\..\components\drivers\mtd\mtd_nand.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -908,15 +1674,52 @@ - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -927,15 +1730,52 @@ - - dev_alarm.c 1 ..\..\..\components\drivers\rtc\dev_alarm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -946,15 +1786,52 @@ - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -965,15 +1842,52 @@ - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -984,15 +1898,52 @@ - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1003,15 +1954,52 @@ - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1022,15 +2010,52 @@ - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1041,15 +2066,52 @@ - - dev_spi_flash_sfud.c 1 ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1060,15 +2122,52 @@ - - sfud.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1079,15 +2178,52 @@ - - sfud_sfdp.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1098,15 +2234,52 @@ - - dev_touch.c 1 ..\..\..\components\drivers\touch\dev_touch.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1117,15 +2290,52 @@ - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1142,235 +2352,216 @@ Drivers - drv_sys.c + drv_i2c.c 1 - ..\libraries\n9h30\rtt_port\drv_sys.c + ..\libraries\n9h30\rtt_port\drv_i2c.c - - - drv_vpost.c + drv_common.c 1 - ..\libraries\n9h30\rtt_port\drv_vpost.c + ..\libraries\n9h30\rtt_port\drv_common.c + + + drv_usbd.c + 1 + ..\libraries\n9h30\rtt_port\drv_usbd.c + + + drv_sdh.c + 1 + ..\libraries\n9h30\rtt_port\drv_sdh.c + + + drv_systick.c + 1 + ..\libraries\n9h30\rtt_port\drv_systick.c - - drv_usbhost.c 1 ..\libraries\n9h30\rtt_port\drv_usbhost.c - - - drv_crypto.c + drv_i2s.c 1 - ..\libraries\n9h30\rtt_port\drv_crypto.c + ..\libraries\n9h30\rtt_port\drv_i2s.c - - drv_jpegcodec.c 1 ..\libraries\n9h30\rtt_port\drv_jpegcodec.c - - - drv_timer.c + drv_crypto.c 1 - ..\libraries\n9h30\rtt_port\drv_timer.c + ..\libraries\n9h30\rtt_port\drv_crypto.c - - - drv_etimer.c + drv_gpio.c 1 - ..\libraries\n9h30\rtt_port\drv_etimer.c + ..\libraries\n9h30\rtt_port\drv_gpio.c - - - drv_adc.c + drv_sys.c 1 - ..\libraries\n9h30\rtt_port\drv_adc.c + ..\libraries\n9h30\rtt_port\drv_sys.c - - - drv_usbd.c + drv_vpost.c 1 - ..\libraries\n9h30\rtt_port\drv_usbd.c + ..\libraries\n9h30\rtt_port\drv_vpost.c - - - drv_systick.c + drv_adc.c 1 - ..\libraries\n9h30\rtt_port\drv_systick.c + ..\libraries\n9h30\rtt_port\drv_adc.c - - drv_etimer_capture.c 1 ..\libraries\n9h30\rtt_port\drv_etimer_capture.c - - - - drv_sdh.c - 1 - ..\libraries\n9h30\rtt_port\drv_sdh.c - - - - drv_gpio.c + drv_etimer.c 1 - ..\libraries\n9h30\rtt_port\drv_gpio.c + ..\libraries\n9h30\rtt_port\drv_etimer.c - - drv_scuart.c 1 ..\libraries\n9h30\rtt_port\drv_scuart.c - - - drv_i2c.c + drv_emac.c 1 - ..\libraries\n9h30\rtt_port\drv_i2c.c + ..\libraries\n9h30\rtt_port\drv_emac.c - - drv_pwm.c 1 ..\libraries\n9h30\rtt_port\drv_pwm.c - - - - drv_can.c - 1 - ..\libraries\n9h30\rtt_port\drv_can.c - - - drv_wdt.c 1 ..\libraries\n9h30\rtt_port\drv_wdt.c - - - drv_softi2c.c + drv_timer.c 1 - ..\libraries\n9h30\rtt_port\drv_softi2c.c + ..\libraries\n9h30\rtt_port\drv_timer.c - - drv_ge2d.c 1 ..\libraries\n9h30\rtt_port\drv_ge2d.c - - - drv_rtc.c + drv_can.c 1 - ..\libraries\n9h30\rtt_port\drv_rtc.c + ..\libraries\n9h30\rtt_port\drv_can.c - - - drv_i2s.c + drv_uart.c 1 - ..\libraries\n9h30\rtt_port\drv_i2s.c + ..\libraries\n9h30\rtt_port\drv_uart.c - - - drv_common.c + drv_rtc.c 1 - ..\libraries\n9h30\rtt_port\drv_common.c + ..\libraries\n9h30\rtt_port\drv_rtc.c + + + drv_softi2c.c + 1 + ..\libraries\n9h30\rtt_port\drv_softi2c.c - - drv_qspi.c 1 ..\libraries\n9h30\rtt_port\drv_qspi.c + + + Fal - drv_uart.c + fal_flash.c 1 - ..\libraries\n9h30\rtt_port\drv_uart.c + ..\..\..\components\fal\src\fal_flash.c - - - drv_emac.c + fal_flash_sfud_port.c 1 - ..\libraries\n9h30\rtt_port\drv_emac.c + ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c - - - - Fal - fal.c 1 ..\..\..\components\fal\src\fal.c - - - fal_flash.c + fal_rtt.c 1 - ..\..\..\components\fal\src\fal_flash.c + ..\..\..\components\fal\src\fal_rtt.c - - fal_partition.c 1 ..\..\..\components\fal\src\fal_partition.c + + + Filesystem - fal_rtt.c - 1 - ..\..\..\components\fal\src\fal_rtt.c - - - - - fal_flash_sfud_port.c - 1 - ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c - - - - - Filesystem - - - devfs.c + devfs.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1381,15 +2572,52 @@ - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1400,15 +2628,52 @@ - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1419,15 +2684,52 @@ - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1438,15 +2740,52 @@ - - dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1457,15 +2796,52 @@ - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1476,15 +2852,52 @@ - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1495,15 +2908,52 @@ - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1520,37 +2970,29 @@ Finsh - msh_parse.c + shell.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\shell.c - - msh_file.c 1 ..\..\..\components\finsh\msh_file.c - - - shell.c + msh.c 1 - ..\..\..\components\finsh\shell.c + ..\..\..\components\finsh\msh.c - - - cmd.c + msh_parse.c 1 - ..\..\..\components\finsh\cmd.c + ..\..\..\components\finsh\msh_parse.c - - - msh.c + cmd.c 1 - ..\..\..\components\finsh\msh.c + ..\..\..\components\finsh\cmd.c @@ -1562,8 +3004,47 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1574,15 +3055,52 @@ - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1593,15 +3111,52 @@ - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1612,15 +3167,52 @@ - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1631,15 +3223,52 @@ - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1650,15 +3279,52 @@ - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1669,15 +3335,52 @@ - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1688,15 +3391,52 @@ - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1707,15 +3447,52 @@ - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1726,15 +3503,52 @@ - - memheap.c 1 ..\..\..\src\memheap.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1745,15 +3559,52 @@ - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1764,15 +3615,52 @@ - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1783,15 +3671,52 @@ - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1802,15 +3727,52 @@ - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1821,15 +3783,52 @@ - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1840,15 +3839,52 @@ - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1859,15 +3895,52 @@ - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1884,37 +3957,29 @@ klibc - rt_vsscanf.c + kerrno.c 1 - ..\..\..\src\klibc\rt_vsscanf.c + ..\..\..\src\klibc\kerrno.c - - - kstring.c + kstdio.c 1 - ..\..\..\src\klibc\kstring.c + ..\..\..\src\klibc\kstdio.c - - rt_vsnprintf_tiny.c 1 ..\..\..\src\klibc\rt_vsnprintf_tiny.c - - - kerrno.c + kstring.c 1 - ..\..\..\src\klibc\kerrno.c + ..\..\..\src\klibc\kstring.c - - - kstdio.c + rt_vsscanf.c 1 - ..\..\..\src\klibc\kstdio.c + ..\..\..\src\klibc\rt_vsscanf.c @@ -1926,57 +3991,41 @@ 2 ..\..\..\libcpu\arm\arm926\context_rvds.S - - cpuport.c 1 ..\..\..\libcpu\arm\arm926\cpuport.c - - machine.c 1 ..\..\..\libcpu\arm\arm926\machine.c - - mmu.c 1 ..\..\..\libcpu\arm\arm926\mmu.c - - stack.c 1 ..\..\..\libcpu\arm\arm926\stack.c - - start_rvds.S 2 ..\..\..\libcpu\arm\arm926\start_rvds.S - - trap.c 1 ..\..\..\libcpu\arm\arm926\trap.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 @@ -1986,144 +4035,106 @@ Libraries - - - nu_emac.c - 1 - ..\libraries\n9h30\Driver\Source\nu_emac.c - - nu_wwdt.c 1 - ..\libraries\n9h30\Driver\Source\nu_wwdt.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_wwdt.c - - nu_usbd.c 1 - ..\libraries\n9h30\Driver\Source\nu_usbd.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_usbd.c - - - nu_pwm.c + nu_spi.c 1 - ..\libraries\n9h30\Driver\Source\nu_pwm.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_spi.c - - - nu_gpio.c + nu_timer.c 1 - ..\libraries\n9h30\Driver\Source\nu_gpio.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_timer.c - - nu_i2s.c 1 - ..\libraries\n9h30\Driver\Source\nu_i2s.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_i2s.c - - - nu_scuart.c + nu_rtc.c 1 - ..\libraries\n9h30\Driver\Source\nu_scuart.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_rtc.c - - - nu_lcd.c + nu_wdt.c 1 - ..\libraries\n9h30\Driver\Source\nu_lcd.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_wdt.c - - - nu_crypto.c + nu_fmi.c 1 - ..\libraries\n9h30\Driver\Source\nu_crypto.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_fmi.c - - - nu_rtc.c + nu_cap.c 1 - ..\libraries\n9h30\Driver\Source\nu_rtc.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_cap.c - - - nu_wdt.c + nu_sys.c 1 - ..\libraries\n9h30\Driver\Source\nu_wdt.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_sys.c - - nu_sdh.c 1 - ..\libraries\n9h30\Driver\Source\nu_sdh.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_sdh.c - - - nu_spi.c + nu_scuart.c 1 - ..\libraries\n9h30\Driver\Source\nu_spi.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_scuart.c - - - nu_timer.c + nu_lcd.c 1 - ..\libraries\n9h30\Driver\Source\nu_timer.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_lcd.c - - - nu_etimer.c + nu_uart.c 1 - ..\libraries\n9h30\Driver\Source\nu_etimer.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_uart.c - - - nu_cap.c + nu_can.c 1 - ..\libraries\n9h30\Driver\Source\nu_cap.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_can.c - - - nu_sys.c + nu_crypto.c 1 - ..\libraries\n9h30\Driver\Source\nu_sys.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_crypto.c - - - nu_can.c + nu_emac.c 1 - ..\libraries\n9h30\Driver\Source\nu_can.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_emac.c - - - nu_uart.c + nu_pwm.c 1 - ..\libraries\n9h30\Driver\Source\nu_uart.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_pwm.c - - - nu_fmi.c + nu_etimer.c 1 - ..\libraries\n9h30\Driver\Source\nu_fmi.c + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_etimer.c + + + nu_gpio.c + 1 + packages\nuvoton-arm926-lib-latest\N9H30\Driver\Source\nu_gpio.c @@ -2135,253 +4146,181 @@ 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_lib.c - - api_msg.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_msg.c - - err.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\err.c - - netbuf.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netbuf.c - - netdb.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netdb.c - - netifapi.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netifapi.c - - sockets.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\sockets.c - - tcpip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\tcpip.c - - ping.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\apps\ping\ping.c - - def.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\def.c - - dns.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\dns.c - - inet_chksum.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\inet_chksum.c - - init.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\init.c - - ip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ip.c - - autoip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\autoip.c - - dhcp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\dhcp.c - - etharp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\etharp.c - - icmp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\icmp.c - - igmp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\igmp.c - - ip4.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4.c - - ip4_addr.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_addr.c - - ip4_frag.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_frag.c - - memp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\memp.c - - netif.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\netif.c - - pbuf.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\pbuf.c - - raw.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\raw.c - - stats.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\stats.c - - sys.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\sys.c - - tcp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp.c - - tcp_in.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_in.c - - tcp_out.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_out.c - - timeouts.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\timeouts.c - - udp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\udp.c - - ethernet.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\ethernet.c - - lowpan6.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\lowpan6.c - - ethernetif.c 1 ..\..\..\components\net\lwip\port\ethernetif.c - - sys_arch.c 1 @@ -2391,46 +4330,36 @@ n9h30_usbhostlib - - - ohci.c - 1 - ..\libraries\n9h30\UsbHostLib\src\ohci.c - - ehci.c 1 - ..\libraries\n9h30\UsbHostLib\src\ehci.c + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\ehci.c - - - support.c + ohci.c 1 - ..\libraries\n9h30\UsbHostLib\src\support.c + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\ohci.c - - ehci_iso.c 1 - ..\libraries\n9h30\UsbHostLib\src\ehci_iso.c + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\ehci_iso.c - - usb_core.c 1 - ..\libraries\n9h30\UsbHostLib\src\usb_core.c + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\usb_core.c - - mem_alloc.c 1 - ..\libraries\n9h30\UsbHostLib\src\mem_alloc.c + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\mem_alloc.c + + + support.c + 1 + packages\nuvoton-arm926-lib-latest\N9H30\UsbHostLib\src\support.c @@ -2442,8 +4371,6 @@ 1 ..\libraries\nu_packages\ADC_TOUCH\touch_sw.c - - adc_touch.c 1 @@ -2455,16 +4382,14 @@ nu_pkgs_nau8822 - acodec_nau8822.c + audio_test.c 1 - ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c + ..\libraries\nu_packages\AudioCodec\audio_test.c - - - audio_test.c + acodec_nau8822.c 1 - ..\libraries\nu_packages\AudioCodec\audio_test.c + ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c @@ -2476,8 +4401,6 @@ 1 ..\..\..\components\libc\posix\io\poll\poll.c - - select.c 1 @@ -2489,30 +4412,24 @@ rt_usbd - usbdevice.c + cdc_vcom.c 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c - - - mstorage.c + usbdevice_core.c 1 - ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c - - - cdc_vcom.c + mstorage.c 1 - ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c - - - usbdevice_core.c + usbdevice.c 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c @@ -2520,44 +4437,34 @@ rt_usbh - usbhost_core.c + hub.c 1 - ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + ..\..\..\components\legacy\usb\usbhost\core\hub.c - - - driver.c + udisk.c 1 - ..\..\..\components\legacy\usb\usbhost\core\driver.c + ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - - hub.c + driver.c 1 - ..\..\..\components\legacy\usb\usbhost\core\hub.c + ..\..\..\components\legacy\usb\usbhost\core\driver.c - - - udisk.c + mass.c 1 - ..\..\..\components\legacy\usb\usbhost\class\udisk.c + ..\..\..\components\legacy\usb\usbhost\class\mass.c - - usbhost.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost.c - - - mass.c + usbhost_core.c 1 - ..\..\..\components\legacy\usb\usbhost\class\mass.c + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c @@ -2569,43 +4476,31 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_lwip.c 1 ..\..\..\components\net\sal\impl\af_inet_lwip.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -2617,16 +4512,14 @@ UTest - TC_uassert.c + utest.c 1 - ..\..\..\components\utilities\utest\TC_uassert.c + ..\..\..\components\utilities\utest\utest.c - - - utest.c + TC_uassert.c 1 - ..\..\..\components\utilities\utest\utest.c + ..\..\..\components\utilities\utest\TC_uassert.c @@ -2643,4 +4536,5 @@ +
diff --git a/bsp/nuvoton/nk-rtu980/project.uvopt b/bsp/nuvoton/nk-rtu980/project.uvopt new file mode 100644 index 00000000000..05e93fcc1f1 --- /dev/null +++ b/bsp/nuvoton/nk-rtu980/project.uvopt @@ -0,0 +1,2937 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread + 0x4 + ARM-ADS + + 0 + + 0 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\keil4\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 0 + + 0 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 18 + + + + + + + + + + ..\libraries\nuc980\Script\NUC980xx61.ini + Segger\JLTAgdi.dll + + + + 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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + + + board + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + board\nu_pin_init.c + nu_pin_init.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\cputime\cputime.c + cputime.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\cputime\cputimer.c + cputimer.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_soft_rtc.c + dev_soft_rtc.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 4 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 4 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 4 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + dev_spi_flash_sfud.c + 0 + 0 + + + 4 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud.c + sfud.c + 0 + 0 + + + 4 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + sfud_sfdp.c + 0 + 0 + + + 4 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 5 + 46 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 5 + 47 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_etimer_capture.c + drv_etimer_capture.c + 0 + 0 + + + 5 + 48 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 5 + 49 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 5 + 50 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 5 + 51 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 5 + 52 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 5 + 53 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_sys.c + drv_sys.c + 0 + 0 + + + 5 + 54 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 5 + 55 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_adc.c + drv_adc.c + 0 + 0 + + + 5 + 56 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_pwm.c + drv_pwm.c + 0 + 0 + + + 5 + 57 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_emac.c + drv_emac.c + 0 + 0 + + + 5 + 58 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 5 + 59 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 5 + 60 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 5 + 61 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + 5 + 62 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 5 + 63 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 5 + 64 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 5 + 65 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_can.c + drv_can.c + 0 + 0 + + + 5 + 66 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 5 + 67 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_systick.c + drv_systick.c + 0 + 0 + + + 5 + 68 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_etimer.c + drv_etimer.c + 0 + 0 + + + 5 + 69 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 5 + 70 + 1 + 0 + 0 + 0 + ..\libraries\nuc980\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + + + Fal + 0 + 0 + 0 + 0 + + 6 + 71 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_rtt.c + fal_rtt.c + 0 + 0 + + + 6 + 72 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_partition.c + fal_partition.c + 0 + 0 + + + 6 + 73 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_flash.c + fal_flash.c + 0 + 0 + + + 6 + 74 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal.c + fal.c + 0 + 0 + + + 6 + 75 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c + fal_flash_sfud_port.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 7 + 76 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 7 + 77 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 7 + 78 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 7 + 79 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 7 + 80 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + dfs.c + 0 + 0 + + + 7 + 81 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 7 + 82 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 7 + 83 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 8 + 84 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 8 + 85 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 8 + 86 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 8 + 87 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 8 + 88 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 9 + 89 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 9 + 90 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 9 + 91 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 9 + 92 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 9 + 93 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 9 + 94 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 9 + 95 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 9 + 96 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 9 + 97 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 9 + 98 + 1 + 0 + 0 + 0 + ..\..\..\src\memheap.c + memheap.c + 0 + 0 + + + 9 + 99 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 9 + 100 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 9 + 101 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 9 + 102 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 9 + 103 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 9 + 104 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 9 + 105 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 10 + 106 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + 10 + 107 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + 10 + 108 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 10 + 109 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 10 + 110 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 11 + 111 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\context_rvds.S + context_rvds.S + 0 + 0 + + + 11 + 112 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\cpuport.c + cpuport.c + 0 + 0 + + + 11 + 113 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\machine.c + machine.c + 0 + 0 + + + 11 + 114 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\mmu.c + mmu.c + 0 + 0 + + + 11 + 115 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\stack.c + stack.c + 0 + 0 + + + 11 + 116 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\start_rvds.S + start_rvds.S + 0 + 0 + + + 11 + 117 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\arm926\trap.c + trap.c + 0 + 0 + + + 11 + 118 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 11 + 119 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 12 + 120 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_qspi.c + nu_qspi.c + 0 + 0 + + + 12 + 121 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 12 + 122 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_emac.c + nu_emac.c + 0 + 0 + + + 12 + 123 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_uart.c + nu_uart.c + 0 + 0 + + + 12 + 124 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sys.c + nu_sys.c + 0 + 0 + + + 12 + 125 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 12 + 126 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_can.c + nu_can.c + 0 + 0 + + + 12 + 127 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 12 + 128 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_etimer.c + nu_etimer.c + 0 + 0 + + + 12 + 129 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 12 + 130 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_cap.c + nu_cap.c + 0 + 0 + + + 12 + 131 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 12 + 132 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 12 + 133 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_spi.c + nu_spi.c + 0 + 0 + + + 12 + 134 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 12 + 135 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 12 + 136 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 12 + 137 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 12 + 138 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 12 + 139 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wdt.c + nu_wdt.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 13 + 140 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 13 + 141 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 13 + 142 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c + err.c + 0 + 0 + + + 13 + 143 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c + if_api.c + 0 + 0 + + + 13 + 144 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 13 + 145 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c + netdb.c + 0 + 0 + + + 13 + 146 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 13 + 147 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c + sockets.c + 0 + 0 + + + 13 + 148 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 13 + 149 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 13 + 150 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c + altcp.c + 0 + 0 + + + 13 + 151 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c + altcp_alloc.c + 0 + 0 + + + 13 + 152 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c + altcp_tcp.c + 0 + 0 + + + 13 + 153 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c + def.c + 0 + 0 + + + 13 + 154 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c + dns.c + 0 + 0 + + + 13 + 155 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 13 + 156 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c + init.c + 0 + 0 + + + 13 + 157 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c + ip.c + 0 + 0 + + + 13 + 158 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 13 + 159 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 13 + 160 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 13 + 161 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 13 + 162 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 13 + 163 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 13 + 164 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 13 + 165 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 13 + 166 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c + memp.c + 0 + 0 + + + 13 + 167 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c + netif.c + 0 + 0 + + + 13 + 168 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 13 + 169 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c + raw.c + 0 + 0 + + + 13 + 170 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c + stats.c + 0 + 0 + + + 13 + 171 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c + sys.c + 0 + 0 + + + 13 + 172 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c + tcp.c + 0 + 0 + + + 13 + 173 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 13 + 174 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 13 + 175 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 13 + 176 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c + udp.c + 0 + 0 + + + 13 + 177 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 13 + 178 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 13 + 179 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 13 + 180 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 14 + 181 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + 14 + 182 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 14 + 183 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + 14 + 184 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + 14 + 185 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 14 + 186 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 14 + 187 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + 14 + 188 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + 14 + 189 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + + + nuc980_usbhostlib + 0 + 0 + 0 + 0 + + 15 + 190 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + 15 + 191 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + 15 + 192 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\support.c + support.c + 0 + 0 + + + 15 + 193 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci.c + ehci.c + 0 + 0 + + + 15 + 194 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 15 + 195 + 1 + 0 + 0 + 0 + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 16 + 196 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 16 + 197 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 17 + 198 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c + cdc_vcom.c + 0 + 0 + + + 17 + 199 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + mstorage.c + 0 + 0 + + + 17 + 200 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + 17 + 201 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 18 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 18 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + 18 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 18 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + 18 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 18 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 19 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 19 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 19 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 19 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 19 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 19 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 19 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 20 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + 20 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 21 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\libadt\avl\avl.c + avl.c + 0 + 0 + + + +
diff --git a/bsp/nuvoton/nk-rtu980/project.uvproj b/bsp/nuvoton/nk-rtu980/project.uvproj index 4ec34e5ee51..c0b81bb7536 100644 --- a/bsp/nuvoton/nk-rtu980/project.uvproj +++ b/bsp/nuvoton/nk-rtu980/project.uvproj @@ -1,7 +1,10 @@ + 1.1 +
### uVision Project, (C) Keil Software
+ rtthread @@ -14,26 +17,26 @@ Nuvoton_ARM9_Series Nuvoton IRAM(0x0-0x0) CLOCK(000000000) CPUTYPE(ARM926EJ-S) - - - + + + 0 - - - - - - - - - - - + + + + + + + + + + + 0 0 - - - + + + Atmel\SAM9260\ Atmel\SAM9260\ @@ -57,8 +60,8 @@ 0 0 - - + + 0 0 0 @@ -67,8 +70,8 @@ 0 0 - - + + 0 0 0 @@ -78,14 +81,14 @@ 1 0 fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" - + 0 0 0 0 0 - + 0 @@ -99,8 +102,8 @@ 0 0 3 - - + + 1 @@ -109,7 +112,7 @@ DARMATS9.DLL -p91SAM9260 SARM.DLL - + TARMATS9.DLL -p91SAM9260 @@ -148,17 +151,17 @@ 0 18 - - - - - + + + + + - - - - + + + + ..\libraries\nuc980\Script\NUC980xx61.ini Segger\JLTAgdi.dll @@ -174,11 +177,11 @@ 0 Segger\JLTAgdi.dll - - - - - + + + + + 0 @@ -211,7 +214,7 @@ 0 0 ARM926EJ-S - + 0 0 0 @@ -221,6 +224,8 @@ 0 0 0 + 0 + 0 0 0 0 @@ -344,7 +349,7 @@ 0x0 - + 1 @@ -372,9 +377,9 @@ 0 --c99 - __STDC_LIMIT_MACROS, __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__, RT_USING_ARMLIBC, RT_USING_LIBC - - ..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\drivers\include;..\..\..\components\net\sal\impl;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\include;..\..\..\components\legacy\include;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\utilities\libadt\hashmap;..\..\..\components\libc\posix\ipc;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\net\sal\include;..\..\..\components\utilities\libadt\ref;..\..\..\components\drivers\hwcrypto;.;..\libraries\nuc980\Driver\Include;..\..\..\components\net\sal\include\socket\sys_socket;board;..\..\..\components\libc\posix\io\poll;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\include;..\libraries\nu_packages\Demo;..\libraries\nuc980\UsbHostLib\inc;..\..\..\components\drivers\include;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\libcpu\arm\arm926;..\..\..\components\libc\posix\io\epoll;..\..\..\components\utilities\utest;..\..\..\components\utilities\libadt\uthash;..\..\..\components\libc\compilers\common\extension;..\..\..\components\legacy\usb\usbhost;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\libraries\nuc980\rtt_port;..\..\..\components\drivers\spi;..\..\..\components\net\netdev\include;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\drivers\smp_call;..\libraries\nu_packages\TPC;..\..\..\components\finsh;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\libc\compilers\common\include;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\..\..\components\net\lwip\port;..\..\..\components\utilities\libadt\bitmap;..\..\..\libcpu\arm\common;..\..\..\components\fal\inc;..\..\..\components\utilities\libadt\avl;..\..\..\components\net\sal\include\socket;applications;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\drivers\include;..\..\..\components\drivers\phy + RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__, RT_USING_ARMLIBC, __STDC_LIMIT_MACROS + + ..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\libc\compilers\common\extension;..\..\..\components\net\lwip\port;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\legacy\include;..\..\..\libcpu\arm\arm926;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\drivers\include;.;..\..\..\components\drivers\include;..\..\..\components\fal\inc;..\libraries\nu_packages\Demo;..\..\..\components\drivers\hwcrypto;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\libraries\nu_packages\TPC;packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\inc;..\..\..\components\net\sal\include;..\..\..\components\libc\posix\ipc;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\include;applications;..\..\..\components\net\netdev\include;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\libraries\nuc980\rtt_port;..\..\..\components\drivers\include;..\..\..\components\utilities\libadt\uthash;..\..\..\libcpu\arm\common;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\socket;..\..\..\include;..\..\..\components\finsh;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\utilities\libadt\ref;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\spi\sfud\inc;packages\nuvoton-arm926-lib-latest\NUC980\Driver\Include;..\..\..\components\utilities\libadt\hashmap;..\..\..\components\drivers\include;..\..\..\components\drivers\smp_call;..\..\..\components\utilities\libadt\avl;..\..\..\components\drivers\phy;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\drivers\spi;..\..\..\components\libc\posix\io\epoll;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\utilities\libadt\bitmap;..\..\..\components\net\sal\impl;..\..\..\components\libc\compilers\common\include;..\..\..\components\utilities\utest;..\..\..\components\dfs\dfs_v1\filesystems\elmfat @@ -387,12 +392,12 @@ 0 0 0 - 0 + 4 - - - - + + + + @@ -404,13 +409,13 @@ 0 0x20000000 0x20800000 - + .\linking_scripts\nuc980.sct - - - - - + + + + + @@ -419,16 +424,14 @@ Applications - mnt.c + main.c 1 - applications\mnt.c + applications\main.c - - - main.c + mnt.c 1 - applications\main.c + applications\mnt.c @@ -436,16 +439,14 @@ board - board_dev.c + nu_pin_init.c 1 - board\board_dev.c + board\nu_pin_init.c - - - nu_pin_init.c + board_dev.c 1 - board\nu_pin_init.c + board\board_dev.c @@ -457,50 +458,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -516,8 +503,47 @@ 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -528,15 +554,52 @@ - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -547,15 +610,52 @@ - - cputime.c 1 ..\..\..\components\drivers\cputime\cputime.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -566,15 +666,52 @@ - - cputimer.c 1 ..\..\..\components\drivers\cputime\cputimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -585,15 +722,52 @@ - - hw_hash.c 1 ..\..\..\components\drivers\hwcrypto\hw_hash.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -604,15 +778,52 @@ - - hw_rng.c 1 ..\..\..\components\drivers\hwcrypto\hw_rng.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -623,15 +834,52 @@ - - hw_symmetric.c 1 ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -642,15 +890,52 @@ - - hwcrypto.c 1 ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -661,15 +946,52 @@ - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -680,15 +1002,52 @@ - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -699,15 +1058,52 @@ - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -718,15 +1114,52 @@ - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -737,15 +1170,52 @@ - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -756,15 +1226,52 @@ - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -775,15 +1282,52 @@ - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -794,15 +1338,52 @@ - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -813,15 +1394,52 @@ - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -832,15 +1450,52 @@ - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -851,15 +1506,52 @@ - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -870,15 +1562,52 @@ - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -889,15 +1618,52 @@ - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -908,15 +1674,52 @@ - - adc.c 1 ..\..\..\components\drivers\misc\adc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -927,15 +1730,52 @@ - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -946,15 +1786,52 @@ - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -965,15 +1842,52 @@ - - dev_soft_rtc.c 1 ..\..\..\components\drivers\rtc\dev_soft_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -984,15 +1898,52 @@ - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1003,15 +1954,52 @@ - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1022,15 +2010,52 @@ - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1041,15 +2066,52 @@ - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1060,15 +2122,52 @@ - - dev_spi_flash_sfud.c 1 ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1079,15 +2178,52 @@ - - sfud.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1098,15 +2234,52 @@ - - sfud_sfdp.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1117,15 +2290,52 @@ - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ @@ -1141,218 +2351,162 @@ Drivers + + drv_sdh.c + 1 + ..\libraries\nuc980\rtt_port\drv_sdh.c + drv_etimer_capture.c 1 ..\libraries\nuc980\rtt_port\drv_etimer_capture.c - - - drv_spi.c + drv_rtc.c 1 - ..\libraries\nuc980\rtt_port\drv_spi.c + ..\libraries\nuc980\rtt_port\drv_rtc.c - - - drv_pwm.c + drv_usbhost.c 1 - ..\libraries\nuc980\rtt_port\drv_pwm.c + ..\libraries\nuc980\rtt_port\drv_usbhost.c - - - drv_sys.c + drv_pdma.c 1 - ..\libraries\nuc980\rtt_port\drv_sys.c + ..\libraries\nuc980\rtt_port\drv_pdma.c + + + drv_uart.c + 1 + ..\libraries\nuc980\rtt_port\drv_uart.c - - drv_common.c 1 ..\libraries\nuc980\rtt_port\drv_common.c - - - drv_scuart.c + drv_sys.c 1 - ..\libraries\nuc980\rtt_port\drv_scuart.c + ..\libraries\nuc980\rtt_port\drv_sys.c - - - drv_qspi.c + drv_softi2c.c 1 - ..\libraries\nuc980\rtt_port\drv_qspi.c + ..\libraries\nuc980\rtt_port\drv_softi2c.c - - - drv_usbhost.c + drv_adc.c 1 - ..\libraries\nuc980\rtt_port\drv_usbhost.c + ..\libraries\nuc980\rtt_port\drv_adc.c - - - drv_i2s.c + drv_pwm.c 1 - ..\libraries\nuc980\rtt_port\drv_i2s.c + ..\libraries\nuc980\rtt_port\drv_pwm.c - - - drv_gpio.c + drv_emac.c 1 - ..\libraries\nuc980\rtt_port\drv_gpio.c + ..\libraries\nuc980\rtt_port\drv_emac.c - - - drv_softi2c.c + drv_scuart.c 1 - ..\libraries\nuc980\rtt_port\drv_softi2c.c + ..\libraries\nuc980\rtt_port\drv_scuart.c + + + drv_usbd.c + 1 + ..\libraries\nuc980\rtt_port\drv_usbd.c + + + drv_spi.c + 1 + ..\libraries\nuc980\rtt_port\drv_spi.c - - drv_wdt.c 1 ..\libraries\nuc980\rtt_port\drv_wdt.c - - drv_ebi.c 1 ..\libraries\nuc980\rtt_port\drv_ebi.c - - drv_crypto.c 1 ..\libraries\nuc980\rtt_port\drv_crypto.c - - - - drv_pdma.c - 1 - ..\libraries\nuc980\rtt_port\drv_pdma.c - - - - drv_systick.c + drv_qspi.c 1 - ..\libraries\nuc980\rtt_port\drv_systick.c + ..\libraries\nuc980\rtt_port\drv_qspi.c - - - drv_usbd.c + drv_can.c 1 - ..\libraries\nuc980\rtt_port\drv_usbd.c + ..\libraries\nuc980\rtt_port\drv_can.c - - - drv_sdh.c + drv_gpio.c 1 - ..\libraries\nuc980\rtt_port\drv_sdh.c + ..\libraries\nuc980\rtt_port\drv_gpio.c - - - drv_emac.c + drv_systick.c 1 - ..\libraries\nuc980\rtt_port\drv_emac.c + ..\libraries\nuc980\rtt_port\drv_systick.c - - drv_etimer.c 1 ..\libraries\nuc980\rtt_port\drv_etimer.c - - - drv_i2c.c + drv_i2s.c 1 - ..\libraries\nuc980\rtt_port\drv_i2c.c + ..\libraries\nuc980\rtt_port\drv_i2s.c - - - drv_rtc.c + drv_i2c.c 1 - ..\libraries\nuc980\rtt_port\drv_rtc.c + ..\libraries\nuc980\rtt_port\drv_i2c.c + + + Fal - drv_can.c + fal_rtt.c 1 - ..\libraries\nuc980\rtt_port\drv_can.c + ..\..\..\components\fal\src\fal_rtt.c - - - drv_uart.c + fal_partition.c 1 - ..\libraries\nuc980\rtt_port\drv_uart.c + ..\..\..\components\fal\src\fal_partition.c - - - drv_adc.c + fal_flash.c 1 - ..\libraries\nuc980\rtt_port\drv_adc.c + ..\..\..\components\fal\src\fal_flash.c - - - - Fal - - fal_rtt.c + fal.c 1 - ..\..\..\components\fal\src\fal_rtt.c + ..\..\..\components\fal\src\fal.c - - fal_flash_sfud_port.c 1 ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c - - - fal.c - 1 - ..\..\..\components\fal\src\fal.c - - - - - fal_partition.c - 1 - ..\..\..\components\fal\src\fal_partition.c - - - - - fal_flash.c - 1 - ..\..\..\components\fal\src\fal_flash.c - - Filesystem @@ -1362,8 +2516,47 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1374,15 +2567,52 @@ - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1393,15 +2623,52 @@ - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1412,15 +2679,52 @@ - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1431,15 +2735,52 @@ - - dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1450,15 +2791,52 @@ - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1469,15 +2847,52 @@ - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1488,15 +2903,52 @@ - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 @@ -1517,29 +2969,21 @@ 1 ..\..\..\components\finsh\msh_file.c - - + + cmd.c + 1 + ..\..\..\components\finsh\cmd.c + msh.c 1 ..\..\..\components\finsh\msh.c - - shell.c 1 ..\..\..\components\finsh\shell.c - - - - cmd.c - 1 - ..\..\..\components\finsh\cmd.c - - - msh_parse.c 1 @@ -1555,8 +2999,47 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1567,15 +3050,52 @@ - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1586,15 +3106,52 @@ - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1605,15 +3162,52 @@ - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1624,15 +3218,52 @@ - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1643,15 +3274,52 @@ - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1662,15 +3330,52 @@ - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1681,15 +3386,52 @@ - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1700,15 +3442,52 @@ - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1719,15 +3498,52 @@ - - memheap.c 1 ..\..\..\src\memheap.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1738,15 +3554,52 @@ - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1757,15 +3610,52 @@ - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1776,15 +3666,52 @@ - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1795,15 +3722,52 @@ - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1814,15 +3778,52 @@ - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1833,15 +3834,52 @@ - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1852,15 +3890,52 @@ - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ @@ -1877,37 +3952,29 @@ klibc - kerrno.c + rt_vsnprintf_tiny.c 1 - ..\..\..\src\klibc\kerrno.c + ..\..\..\src\klibc\rt_vsnprintf_tiny.c - - - kstdio.c + rt_vsscanf.c 1 - ..\..\..\src\klibc\kstdio.c + ..\..\..\src\klibc\rt_vsscanf.c - - kstring.c 1 ..\..\..\src\klibc\kstring.c - - - rt_vsnprintf_tiny.c + kerrno.c 1 - ..\..\..\src\klibc\rt_vsnprintf_tiny.c + ..\..\..\src\klibc\kerrno.c - - - rt_vsscanf.c + kstdio.c 1 - ..\..\..\src\klibc\rt_vsscanf.c + ..\..\..\src\klibc\kstdio.c @@ -1919,57 +3986,41 @@ 2 ..\..\..\libcpu\arm\arm926\context_rvds.S - - cpuport.c 1 ..\..\..\libcpu\arm\arm926\cpuport.c - - machine.c 1 ..\..\..\libcpu\arm\arm926\machine.c - - mmu.c 1 ..\..\..\libcpu\arm\arm926\mmu.c - - stack.c 1 ..\..\..\libcpu\arm\arm926\stack.c - - start_rvds.S 2 ..\..\..\libcpu\arm\arm926\start_rvds.S - - trap.c 1 ..\..\..\libcpu\arm\arm926\trap.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 @@ -1981,142 +4032,104 @@ Libraries - nu_i2s.c + nu_qspi.c 1 - ..\libraries\nuc980\Driver\Source\nu_i2s.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_qspi.c - - - nu_qspi.c + nu_pdma.c 1 - ..\libraries\nuc980\Driver\Source\nu_qspi.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_pdma.c - - nu_emac.c 1 - ..\libraries\nuc980\Driver\Source\nu_emac.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_emac.c - - - nu_crypto.c + nu_uart.c 1 - ..\libraries\nuc980\Driver\Source\nu_crypto.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_uart.c - - - nu_can.c + nu_sys.c 1 - ..\libraries\nuc980\Driver\Source\nu_can.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sys.c - - - nu_usbd.c + nu_wwdt.c 1 - ..\libraries\nuc980\Driver\Source\nu_usbd.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wwdt.c - - - nu_rtc.c + nu_can.c 1 - ..\libraries\nuc980\Driver\Source\nu_rtc.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_can.c - - - nu_pdma.c + nu_i2s.c 1 - ..\libraries\nuc980\Driver\Source\nu_pdma.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2s.c - - - nu_cap.c + nu_etimer.c 1 - ..\libraries\nuc980\Driver\Source\nu_cap.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_etimer.c - - - nu_uart.c + nu_scuart.c 1 - ..\libraries\nuc980\Driver\Source\nu_uart.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_scuart.c - - - nu_sys.c + nu_cap.c 1 - ..\libraries\nuc980\Driver\Source\nu_sys.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_cap.c - - - nu_wwdt.c + nu_crypto.c 1 - ..\libraries\nuc980\Driver\Source\nu_wwdt.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_crypto.c - - - nu_ebi.c + nu_i2c.c 1 - ..\libraries\nuc980\Driver\Source\nu_ebi.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_i2c.c - - - nu_scuart.c + nu_spi.c 1 - ..\libraries\nuc980\Driver\Source\nu_scuart.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_spi.c - - - nu_i2c.c + nu_rtc.c 1 - ..\libraries\nuc980\Driver\Source\nu_i2c.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_rtc.c - - - nu_etimer.c + nu_ebi.c 1 - ..\libraries\nuc980\Driver\Source\nu_etimer.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_ebi.c - - nu_gpio.c 1 - ..\libraries\nuc980\Driver\Source\nu_gpio.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_gpio.c - - - nu_wdt.c + nu_usbd.c 1 - ..\libraries\nuc980\Driver\Source\nu_wdt.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_usbd.c - - - nu_spi.c + nu_sdh.c 1 - ..\libraries\nuc980\Driver\Source\nu_spi.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_sdh.c - - - nu_sdh.c + nu_wdt.c 1 - ..\libraries\nuc980\Driver\Source\nu_sdh.c + packages\nuvoton-arm926-lib-latest\NUC980\Driver\Source\nu_wdt.c @@ -2128,281 +4141,201 @@ 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c - - api_msg.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c - - err.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c - - if_api.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c - - netbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c - - netdb.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c - - netifapi.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c - - sockets.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c - - tcpip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c - - ping.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c - - altcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c - - altcp_alloc.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c - - altcp_tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c - - def.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c - - dns.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c - - inet_chksum.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c - - init.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c - - ip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c - - autoip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c - - dhcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c - - etharp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c - - icmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c - - igmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c - - ip4.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c - - ip4_addr.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c - - ip4_frag.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c - - memp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c - - netif.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c - - pbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c - - raw.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c - - stats.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c - - sys.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c - - tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c - - tcp_in.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c - - tcp_out.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c - - timeouts.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c - - udp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c - - ethernet.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c - - lowpan6.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c - - ethernetif.c 1 ..\..\..\components\net\lwip\port\ethernetif.c - - sys_arch.c 1 @@ -2414,65 +4347,49 @@ nu_pkgs_demo - hwsem_counter.c + ccap_demo.c 1 - ..\libraries\nu_packages\Demo\hwsem_counter.c + ..\libraries\nu_packages\Demo\ccap_demo.c - - - wormhole_demo.c + usbd_hid_dance_mouse.c 1 - ..\libraries\nu_packages\Demo\wormhole_demo.c + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c - - - atdev_utils.c + wormhole_demo.c 1 - ..\libraries\nu_packages\Demo\atdev_utils.c + ..\libraries\nu_packages\Demo\wormhole_demo.c - - - slcd_show_tick.c + hwsem_counter.c 1 - ..\libraries\nu_packages\Demo\slcd_show_tick.c + ..\libraries\nu_packages\Demo\hwsem_counter.c - - ccap_saver.c 1 ..\libraries\nu_packages\Demo\ccap_saver.c - - - ccap_demo.c + smp_demo.c 1 - ..\libraries\nu_packages\Demo\ccap_demo.c + ..\libraries\nu_packages\Demo\smp_demo.c - - - smp_demo.c + usbd_cdc_vcom_echo.c 1 - ..\libraries\nu_packages\Demo\smp_demo.c + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c - - - usbd_hid_dance_mouse.c + slcd_show_tick.c 1 - ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + ..\libraries\nu_packages\Demo\slcd_show_tick.c - - - usbd_cdc_vcom_echo.c + atdev_utils.c 1 - ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + ..\libraries\nu_packages\Demo\atdev_utils.c @@ -2482,42 +4399,32 @@ ehci_iso.c 1 - ..\libraries\nuc980\UsbHostLib\src\ehci_iso.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci_iso.c - - - ohci.c + mem_alloc.c 1 - ..\libraries\nuc980\UsbHostLib\src\ohci.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\mem_alloc.c - - support.c 1 - ..\libraries\nuc980\UsbHostLib\src\support.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\support.c - - - usb_core.c + ehci.c 1 - ..\libraries\nuc980\UsbHostLib\src\usb_core.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ehci.c - - - mem_alloc.c + ohci.c 1 - ..\libraries\nuc980\UsbHostLib\src\mem_alloc.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\ohci.c - - - ehci.c + usb_core.c 1 - ..\libraries\nuc980\UsbHostLib\src\ehci.c + packages\nuvoton-arm926-lib-latest\NUC980\UsbHostLib\src\usb_core.c @@ -2529,8 +4436,6 @@ 1 ..\..\..\components\libc\posix\io\poll\poll.c - - select.c 1 @@ -2541,27 +4446,21 @@ rt_usbd + + cdc_vcom.c + 1 + ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c + mstorage.c 1 ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c - - usbdevice.c 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c - - - - cdc_vcom.c - 1 - ..\..\..\components\legacy\usb\usbdevice\class\cdc_vcom.c - - - usbdevice_core.c 1 @@ -2573,44 +4472,34 @@ rt_usbh - driver.c + udisk.c 1 - ..\..\..\components\legacy\usb\usbhost\core\driver.c + ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - - usbhost.c + mass.c 1 - ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + ..\..\..\components\legacy\usb\usbhost\class\mass.c - - usbhost_core.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c - - - udisk.c + hub.c 1 - ..\..\..\components\legacy\usb\usbhost\class\udisk.c + ..\..\..\components\legacy\usb\usbhost\core\hub.c - - - hub.c + driver.c 1 - ..\..\..\components\legacy\usb\usbhost\core\hub.c + ..\..\..\components\legacy\usb\usbhost\core\driver.c - - - mass.c + usbhost.c 1 - ..\..\..\components\legacy\usb\usbhost\class\mass.c + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c @@ -2622,43 +4511,31 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_lwip.c 1 ..\..\..\components\net\sal\impl\af_inet_lwip.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -2674,8 +4551,6 @@ 1 ..\..\..\components\utilities\utest\utest.c - - TC_uassert.c 1 @@ -2696,4 +4571,5 @@ +
diff --git a/bsp/nuvoton/numaker-iot-m467/project.uvoptx b/bsp/nuvoton/numaker-iot-m467/project.uvoptx new file mode 100644 index 00000000000..687323ec13c --- /dev/null +++ b/bsp/nuvoton/numaker-iot-m467/project.uvoptx @@ -0,0 +1,3732 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread-m460 + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\keil5\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 6 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + + + + + + + + + + + BIN\UL2CM3.DLL + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC40000 -FN1 -FF0M460_AP_1M -FS00 -FL0100000 -FP0($$Device:M467HJHAE$Flash\M460_AP_1M.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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + + + AT + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_utils.c + at_utils.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\at_socket\at_socket.c + at_socket.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_cli.c + at_cli.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_client.c + at_client.c + 0 + 0 + + + + + at_device + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + packages\at_device-latest\samples\at_sample_esp8266.c + at_sample_esp8266.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + packages\at_device-latest\class\esp8266\at_device_esp8266.c + at_device_esp8266.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + packages\at_device-latest\class\esp8266\at_socket_esp8266.c + at_socket_esp8266.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + packages\at_device-latest\src\at_device.c + at_device.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 4 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 4 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 5 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk.c + blk.c + 0 + 0 + + + 5 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dev.c + blk_dev.c + 0 + 0 + + + 5 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dfs.c + blk_dfs.c + 0 + 0 + + + 5 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_partition.c + blk_partition.c + 0 + 0 + + + 5 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\dfs.c + dfs.c + 0 + 0 + + + 5 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\efi.c + efi.c + 0 + 0 + + + 5 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 5 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 5 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_crc.c + hw_crc.c + 0 + 0 + + + 5 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 5 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 5 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 5 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 5 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 5 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 5 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 5 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 5 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 5 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 5 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 5 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 5 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 5 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 5 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 5 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 5 + 46 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 5 + 47 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 5 + 48 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_inputcapture.c + rt_inputcapture.c + 0 + 0 + + + 5 + 49 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 5 + 50 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 5 + 51 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_block.c + dev_block.c + 0 + 0 + + + 5 + 52 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmc.c + dev_mmc.c + 0 + 0 + + + 5 + 53 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + dev_mmcsd_core.c + 0 + 0 + + + 5 + 54 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sd.c + dev_sd.c + 0 + 0 + + + 5 + 55 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sdio.c + dev_sdio.c + 0 + 0 + + + 5 + 56 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v2\sensor.c + sensor.c + 0 + 0 + + + 5 + 57 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v2\sensor_cmd.c + sensor_cmd.c + 0 + 0 + + + 5 + 58 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 5 + 59 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 5 + 60 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 5 + 61 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 5 + 62 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + dev_spi_flash_sfud.c + 0 + 0 + + + 5 + 63 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud.c + sfud.c + 0 + 0 + + + 5 + 64 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + sfud_sfdp.c + 0 + 0 + + + 5 + 65 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 6 + 66 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_bpwm.c + drv_bpwm.c + 0 + 0 + + + 6 + 67 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_bpwm_capture.c + drv_bpwm_capture.c + 0 + 0 + + + 6 + 68 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_canfd.c + drv_canfd.c + 0 + 0 + + + 6 + 69 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ccap.c + drv_ccap.c + 0 + 0 + + + 6 + 70 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 6 + 71 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_crc.c + drv_crc.c + 0 + 0 + + + 6 + 72 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 6 + 73 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_dac.c + drv_dac.c + 0 + 0 + + + 6 + 74 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_eadc.c + drv_eadc.c + 0 + 0 + + + 6 + 75 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 6 + 76 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ecap.c + drv_ecap.c + 0 + 0 + + + 6 + 77 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_epwm.c + drv_epwm.c + 0 + 0 + + + 6 + 78 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_epwm_capture.c + drv_epwm_capture.c + 0 + 0 + + + 6 + 79 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_eqei.c + drv_eqei.c + 0 + 0 + + + 6 + 80 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_fmc.c + drv_fmc.c + 0 + 0 + + + 6 + 81 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 6 + 82 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_hsotg.c + drv_hsotg.c + 0 + 0 + + + 6 + 83 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_hsusbd.c + drv_hsusbd.c + 0 + 0 + + + 6 + 84 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 6 + 85 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 6 + 86 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 6 + 87 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 6 + 88 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 6 + 89 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 6 + 90 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 6 + 91 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_sdio.c + drv_sdio.c + 0 + 0 + + + 6 + 92 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 6 + 93 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 6 + 94 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_spii2s.c + drv_spii2s.c + 0 + 0 + + + 6 + 95 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_timer.c + drv_timer.c + 0 + 0 + + + 6 + 96 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_tpwm.c + drv_tpwm.c + 0 + 0 + + + 6 + 97 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_trng.c + drv_trng.c + 0 + 0 + + + 6 + 98 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 6 + 99 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ui2c.c + drv_ui2c.c + 0 + 0 + + + 6 + 100 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 6 + 101 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 6 + 102 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_uspi.c + drv_uspi.c + 0 + 0 + + + 6 + 103 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_uuart.c + drv_uuart.c + 0 + 0 + + + 6 + 104 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + 6 + 105 + 1 + 0 + 0 + 0 + board\NuPinConfig\nutool_pincfg.c + nutool_pincfg.c + 0 + 0 + + + 6 + 106 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + 6 + 107 + 1 + 0 + 0 + 0 + board\nutool_modclkcfg.c + nutool_modclkcfg.c + 0 + 0 + + + 6 + 108 + 2 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\ARM\startup_m460.s + startup_m460.s + 0 + 0 + + + 6 + 109 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\system_m460.c + system_m460.c + 0 + 0 + + + 6 + 110 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\drv_emac.c + drv_emac.c + 0 + 0 + + + 6 + 111 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\mii.c + mii.c + 0 + 0 + + + 6 + 112 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\synopGMAC_Dev.c + synopGMAC_Dev.c + 0 + 0 + + + 6 + 113 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\synopGMAC_network_interface.c + synopGMAC_network_interface.c + 0 + 0 + + + 6 + 114 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\synopGMAC_plat.c + synopGMAC_plat.c + 0 + 0 + + + + + Fal + 0 + 0 + 0 + 0 + + 7 + 115 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_partition.c + fal_partition.c + 0 + 0 + + + 7 + 116 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_rtt.c + fal_rtt.c + 0 + 0 + + + 7 + 117 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal.c + fal.c + 0 + 0 + + + 7 + 118 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_flash.c + fal_flash.c + 0 + 0 + + + 7 + 119 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c + fal_flash_sfud_port.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 8 + 120 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 8 + 121 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 8 + 122 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 8 + 123 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 8 + 124 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + src_dfs.c + 0 + 0 + + + 8 + 125 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 8 + 126 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 8 + 127 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 9 + 128 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 9 + 129 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 9 + 130 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + 9 + 131 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 9 + 132 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 10 + 133 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 10 + 134 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 10 + 135 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 10 + 136 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 10 + 137 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 10 + 138 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 10 + 139 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 10 + 140 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 10 + 141 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 10 + 142 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 10 + 143 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 10 + 144 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 10 + 145 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 10 + 146 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 10 + 147 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 10 + 148 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 11 + 149 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 11 + 150 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + 11 + 151 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 11 + 152 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_std.c + rt_vsnprintf_std.c + 0 + 0 + + + 11 + 153 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + + + Legacy + 0 + 0 + 0 + 0 + + 12 + 154 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\ipc\workqueue_legacy.c + workqueue_legacy.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 13 + 155 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\atomic_arm.c + atomic_arm.c + 0 + 0 + + + 13 + 156 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 13 + 157 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + 13 + 158 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + context_rvds.S + 0 + 0 + + + 13 + 159 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\cpuport.c + cpuport.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 14 + 160 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer_pwm.c + nu_timer_pwm.c + 0 + 0 + + + 14 + 161 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 14 + 162 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sc.c + nu_sc.c + 0 + 0 + + + 14 + 163 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_trng.c + nu_trng.c + 0 + 0 + + + 14 + 164 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hsusbd.c + nu_hsusbd.c + 0 + 0 + + + 14 + 165 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eqei.c + nu_eqei.c + 0 + 0 + + + 14 + 166 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer.c + nu_timer.c + 0 + 0 + + + 14 + 167 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 14 + 168 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ccap.c + nu_ccap.c + 0 + 0 + + + 14 + 169 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 14 + 170 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_keystore.c + nu_keystore.c + 0 + 0 + + + 14 + 171 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bpwm.c + nu_bpwm.c + 0 + 0 + + + 14 + 172 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 14 + 173 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crc.c + nu_crc.c + 0 + 0 + + + 14 + 174 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_qspi.c + nu_qspi.c + 0 + 0 + + + 14 + 175 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_uart.c + nu_uart.c + 0 + 0 + + + 14 + 176 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_fmc.c + nu_fmc.c + 0 + 0 + + + 14 + 177 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_kpi.c + nu_kpi.c + 0 + 0 + + + 14 + 178 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_dac.c + nu_dac.c + 0 + 0 + + + 14 + 179 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spi.c + nu_spi.c + 0 + 0 + + + 14 + 180 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_acmp.c + nu_acmp.c + 0 + 0 + + + 14 + 181 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eadc.c + nu_eadc.c + 0 + 0 + + + 14 + 182 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bmc.c + nu_bmc.c + 0 + 0 + + + 14 + 183 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spim.c + nu_spim.c + 0 + 0 + + + 14 + 184 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 14 + 185 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_uart.c + nu_usci_uart.c + 0 + 0 + + + 14 + 186 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 14 + 187 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_clk.c + nu_clk.c + 0 + 0 + + + 14 + 188 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hbi.c + nu_hbi.c + 0 + 0 + + + 14 + 189 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sys.c + nu_sys.c + 0 + 0 + + + 14 + 190 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 14 + 191 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_i2c.c + nu_usci_i2c.c + 0 + 0 + + + 14 + 192 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 14 + 193 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 14 + 194 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 14 + 195 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_epwm.c + nu_epwm.c + 0 + 0 + + + 14 + 196 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_canfd.c + nu_canfd.c + 0 + 0 + + + 14 + 197 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_spi.c + nu_usci_spi.c + 0 + 0 + + + 14 + 198 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rng.c + nu_rng.c + 0 + 0 + + + 14 + 199 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ecap.c + nu_ecap.c + 0 + 0 + + + 14 + 200 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 14 + 201 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usbd.c + nu_usbd.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 15 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 15 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 15 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c + err.c + 0 + 0 + + + 15 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c + if_api.c + 0 + 0 + + + 15 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 15 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c + netdb.c + 0 + 0 + + + 15 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 15 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c + sockets.c + 0 + 0 + + + 15 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 15 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 15 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c + altcp.c + 0 + 0 + + + 15 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c + altcp_alloc.c + 0 + 0 + + + 15 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c + altcp_tcp.c + 0 + 0 + + + 15 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c + def.c + 0 + 0 + + + 15 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c + dns.c + 0 + 0 + + + 15 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 15 + 218 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c + init.c + 0 + 0 + + + 15 + 219 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c + ip.c + 0 + 0 + + + 15 + 220 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 15 + 221 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 15 + 222 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 15 + 223 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 15 + 224 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 15 + 225 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 15 + 226 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 15 + 227 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 15 + 228 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c + memp.c + 0 + 0 + + + 15 + 229 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c + netif.c + 0 + 0 + + + 15 + 230 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 15 + 231 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c + raw.c + 0 + 0 + + + 15 + 232 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c + stats.c + 0 + 0 + + + 15 + 233 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c + sys.c + 0 + 0 + + + 15 + 234 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c + tcp.c + 0 + 0 + + + 15 + 235 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 15 + 236 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 15 + 237 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 15 + 238 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c + udp.c + 0 + 0 + + + 15 + 239 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 15 + 240 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 15 + 241 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 15 + 242 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + m460_usbhostlib + 0 + 0 + 0 + 0 + + 16 + 243 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + 16 + 244 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 16 + 245 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + 16 + 246 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci.c + ehci.c + 0 + 0 + + + 16 + 247 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 17 + 248 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + 17 + 249 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + 17 + 250 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 17 + 251 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + 17 + 252 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + 17 + 253 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 17 + 254 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 17 + 255 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + 17 + 256 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + + + nu_pkgs_nct7717u + 0 + 0 + 0 + 0 + + 18 + 257 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\NCT7717U\sensor_nct7717u.c + sensor_nct7717u.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 19 + 258 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 19 + 259 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 20 + 260 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 20 + 261 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + 20 + 262 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + mstorage.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 21 + 263 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 21 + 264 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 21 + 265 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 21 + 266 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + 21 + 267 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + 21 + 268 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 22 + 269 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 22 + 270 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 22 + 271 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 22 + 272 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_at.c + af_inet_at.c + 0 + 0 + + + 22 + 273 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 22 + 274 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 22 + 275 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 22 + 276 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 23 + 277 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + 23 + 278 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 24 + 279 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\ulog\backend\console_be.c + console_be.c + 0 + 0 + + + 24 + 280 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\ulog\ulog.c + ulog.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/bsp/nuvoton/numaker-iot-m467/project.uvprojx b/bsp/nuvoton/numaker-iot-m467/project.uvprojx index 45981fdaafd..194029c15be 100644 --- a/bsp/nuvoton/numaker-iot-m467/project.uvprojx +++ b/bsp/nuvoton/numaker-iot-m467/project.uvprojx @@ -1,43 +1,47 @@ + 2.1 +
### uVision Project, (C) Keil Software
+ rtthread-m460 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 M467HJHAE Nuvoton - Nuvoton.NuMicro_DFP.1.3.13 - https://github.com/OpenNuvoton/cmsis-packs/raw/master/ + Nuvoton.NuMicro_DFP.1.3.25 + https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x80000) IROM(0x00000000,0x100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) - - + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M460_AP_1M -FS00 -FL0100000 -FP0($$Device:M467HJHAE$Flash\M460_AP_1M.FLM)) 0 $$Device:M467HJHAE$Device\M460\Include\m460.h - - - - - - - - - + + + + + + + + + $$Device:M467HJHAE$SVD\Nuvoton\M460.svd 0 0 - - - - - + + + + + 0 0 @@ -59,8 +63,8 @@ 0 0 - - + + 0 0 0 @@ -69,8 +73,8 @@ 0 0 - - + + 0 0 0 @@ -80,14 +84,14 @@ 1 0 fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" - + 0 0 0 0 0 - + 0 @@ -101,8 +105,8 @@ 0 0 3 - - + + 1 @@ -111,7 +115,7 @@ DCM.DLL -pCM4 SARMCM3.DLL - + TCM.DLL -pCM4 @@ -135,11 +139,11 @@ 1 BIN\UL2CM3.DLL - - - - - + + + + + 0 @@ -172,7 +176,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -182,6 +186,8 @@ 0 2 0 + 0 + 0 0 0 8 @@ -305,7 +311,7 @@ 0x0 - + 1 @@ -325,17 +331,17 @@ 0 0 1 - 1 + 3 1 1 0 0 0 - --c99 --diag_suppress=66,1296,186 - RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_ARMLIBC, __RTTHREAD__, __STDC_LIMIT_MACROS - - ..\libraries\m460\CMSIS\Include;..\..\..\components\drivers\include;..\..\..\components\drivers\spi;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\phy;..\..\..\components\drivers\include;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\components\legacy\dfs;..\libraries\nu_packages\NCT7717U;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\include;..\..\..\libcpu\arm\common;..\..\..\components\net\lwip\port;..\..\..\components\net\at\include;..\libraries\m460\Device\Nuvoton\m460\Include;..\..\..\components\libc\posix\ipc;..\..\..\components\libc\compilers\common\include;board\NuPinConfig;..\libraries\m460\rtt_port\emac;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\..\..\components\drivers\include;applications;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\legacy;..\libraries\m460\StdDriver\inc;..\..\..\components\net\sal\include;..\libraries\nu_packages\Demo;..\..\..\components\fal\inc;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\net\netdev\include;..\..\..\components\net\sal\include\socket;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\utilities\utest;.;..\..\..\components\dfs\dfs_v1\include;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\net\sal\impl;..\..\..\components\libc\posix\io\epoll;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\..\..\components\utilities\ulog;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\drivers\smp_call;..\..\..\include;..\..\..\components\drivers\hwcrypto;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\libraries\nu_packages\TPC;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\drivers\include;..\libraries\m460\rtt_port;..\..\..\components\finsh;..\libraries\m460\USBHostLib\inc;..\..\..\components\libc\posix\io\poll;..\..\..\components\legacy\usb\usbhost;..\..\..\components\libc\compilers\common\extension;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\legacy\include;..\..\..\components\net\at\at_socket;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\include + --c99 --diag_suppress=66,1296,186 --diag_suppress=1,177,550 --gnu + __STDC_LIMIT_MACROS, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_ARMLIBC, __RTTHREAD__, RT_USING_LIBC + + ..\..\..\components\drivers\audio;..\..\..\components\net\sal\impl;..\..\..\components\drivers\smp_call;..\..\..\components\libc\compilers\common\extension;..\..\..\components\drivers\include;packages\nuvoton-cmsis-latest\m460_m2354\Include;..\..\..\components\drivers\phy;..\..\..\components\finsh;..\libraries\nu_packages\Demo;..\..\..\components\drivers\include;..\..\..\components\drivers\spi;.;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\include;..\..\..\components\fal\inc;board;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\libraries\nu_packages\TPC;packages\at_device-latest\inc;..\..\..\components\net\lwip\port;..\libraries\nu_packages\NCT7717U;..\..\..\components\net\sal\include\socket;..\..\..\components\net\sal\include;..\..\..\components\drivers\spi\sfud\inc;..\libraries\m460\rtt_port;..\..\..\components\net\netdev\include;..\..\..\components\net\at\at_socket;..\..\..\components\utilities\utest;..\..\..\components\drivers\include;packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Include;..\..\..\components\drivers\hwcrypto;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\libc\posix\io\epoll;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\..\..\components\libc\posix\ipc;board\NuPinConfig;..\..\..\components\legacy\usb\usbhost\class;..\..\..\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\net\at\include;..\..\..\components\drivers\include;..\..\..\libcpu\arm\common;..\..\..\components\legacy\include;..\..\..\components\libc\compilers\common\include;..\..\..\components\utilities\ulog;applications;..\..\..\components\legacy\dfs;..\..\..\components\drivers\include;..\libraries\m460\rtt_port\emac;..\..\..\components\drivers\include;..\..\..\components\drivers\include;packages\nuvoton-series-latest\M460\USBHostLib\inc;packages\at_device-latest\class\esp8266;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\legacy;packages\nuvoton-series-latest\M460\StdDriver\inc;..\..\..\components\legacy\usb\usbhost;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include @@ -348,12 +354,12 @@ 0 0 0 - 0 + 4 - - - - + + + + @@ -365,13 +371,13 @@ 0 0x00000000 0x20000000 - + .\linking_scripts\m460_flash.sct - - - - - + + + + + @@ -384,8 +390,6 @@ 1 applications\main.c - - mnt.c 1 @@ -401,26 +405,45 @@ 1 ..\..\..\components\net\at\src\at_utils.c - - - at_client.c + at_socket.c 1 - ..\..\..\components\net\at\src\at_client.c + ..\..\..\components\net\at\at_socket\at_socket.c - - at_cli.c 1 ..\..\..\components\net\at\src\at_cli.c + + at_client.c + 1 + ..\..\..\components\net\at\src\at_client.c + + + + at_device - at_socket.c + at_sample_esp8266.c 1 - ..\..\..\components\net\at\at_socket\at_socket.c + packages\at_device-latest\samples\at_sample_esp8266.c + + + at_device_esp8266.c + 1 + packages\at_device-latest\class\esp8266\at_device_esp8266.c + + + at_socket_esp8266.c + 1 + packages\at_device-latest\class\esp8266\at_socket_esp8266.c + + + at_device.c + 1 + packages\at_device-latest\src\at_device.c @@ -432,50 +455,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -491,887 +500,2628 @@ 1 ..\..\..\components\drivers\audio\dev_audio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_audio_pipe.c 1 ..\..\..\components\drivers\audio\dev_audio_pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk.c 1 ..\..\..\components\drivers\block\blk.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dev.c 1 ..\..\..\components\drivers\block\blk_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dfs.c 1 ..\..\..\components\drivers\block\blk_dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_partition.c 1 ..\..\..\components\drivers\block\blk_partition.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dfs.c 1 ..\..\..\components\drivers\block\partitions\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - efi.c 1 ..\..\..\components\drivers\block\partitions\efi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_can.c 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_crc.c 1 ..\..\..\components\drivers\hwcrypto\hw_crc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_hash.c 1 ..\..\..\components\drivers\hwcrypto\hw_hash.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_rng.c 1 ..\..\..\components\drivers\hwcrypto\hw_rng.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_symmetric.c 1 ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwcrypto.c 1 ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - rt_inputcapture.c 1 ..\..\..\components\drivers\misc\rt_inputcapture.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_block.c 1 ..\..\..\components\drivers\sdio\dev_block.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmc.c 1 ..\..\..\components\drivers\sdio\dev_mmc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmcsd_core.c 1 ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sd.c 1 ..\..\..\components\drivers\sdio\dev_sd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sdio.c 1 ..\..\..\components\drivers\sdio\dev_sdio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sensor.c 1 ..\..\..\components\drivers\sensor\v2\sensor.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sensor_cmd.c 1 ..\..\..\components\drivers\sensor\v2\sensor_cmd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_flash_sfud.c 1 ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud_sfdp.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + @@ -1381,343 +3131,247 @@ Drivers - - - startup_m460.s - 2 - ..\libraries\m460\Device\Nuvoton\m460\Source\ARM\startup_m460.s - - - - - system_m460.c - 1 - ..\libraries\m460\Device\Nuvoton\m460\Source\system_m460.c - - drv_bpwm.c 1 ..\libraries\m460\rtt_port\drv_bpwm.c - - drv_bpwm_capture.c 1 ..\libraries\m460\rtt_port\drv_bpwm_capture.c - - drv_canfd.c 1 ..\libraries\m460\rtt_port\drv_canfd.c - - drv_ccap.c 1 ..\libraries\m460\rtt_port\drv_ccap.c - - drv_common.c 1 ..\libraries\m460\rtt_port\drv_common.c - - drv_crc.c 1 ..\libraries\m460\rtt_port\drv_crc.c - - drv_crypto.c 1 ..\libraries\m460\rtt_port\drv_crypto.c - - drv_dac.c 1 ..\libraries\m460\rtt_port\drv_dac.c - - drv_eadc.c 1 ..\libraries\m460\rtt_port\drv_eadc.c - - drv_ebi.c 1 ..\libraries\m460\rtt_port\drv_ebi.c - - drv_ecap.c 1 ..\libraries\m460\rtt_port\drv_ecap.c - - drv_epwm.c 1 ..\libraries\m460\rtt_port\drv_epwm.c - - drv_epwm_capture.c 1 ..\libraries\m460\rtt_port\drv_epwm_capture.c - - drv_eqei.c 1 ..\libraries\m460\rtt_port\drv_eqei.c - - drv_fmc.c 1 ..\libraries\m460\rtt_port\drv_fmc.c - - drv_gpio.c 1 ..\libraries\m460\rtt_port\drv_gpio.c - - drv_hsotg.c 1 ..\libraries\m460\rtt_port\drv_hsotg.c - - drv_hsusbd.c 1 ..\libraries\m460\rtt_port\drv_hsusbd.c - - drv_i2c.c 1 ..\libraries\m460\rtt_port\drv_i2c.c - - drv_i2s.c 1 ..\libraries\m460\rtt_port\drv_i2s.c - - drv_pdma.c 1 ..\libraries\m460\rtt_port\drv_pdma.c - - drv_qspi.c 1 ..\libraries\m460\rtt_port\drv_qspi.c - - drv_rtc.c 1 ..\libraries\m460\rtt_port\drv_rtc.c - - drv_scuart.c 1 ..\libraries\m460\rtt_port\drv_scuart.c - - drv_sdh.c 1 ..\libraries\m460\rtt_port\drv_sdh.c - - drv_sdio.c 1 ..\libraries\m460\rtt_port\drv_sdio.c - - drv_softi2c.c 1 ..\libraries\m460\rtt_port\drv_softi2c.c - - drv_spi.c 1 ..\libraries\m460\rtt_port\drv_spi.c - - drv_spii2s.c 1 ..\libraries\m460\rtt_port\drv_spii2s.c - - drv_timer.c 1 ..\libraries\m460\rtt_port\drv_timer.c - - drv_tpwm.c 1 ..\libraries\m460\rtt_port\drv_tpwm.c - - drv_trng.c 1 ..\libraries\m460\rtt_port\drv_trng.c - - drv_uart.c 1 ..\libraries\m460\rtt_port\drv_uart.c - - drv_ui2c.c 1 ..\libraries\m460\rtt_port\drv_ui2c.c - - drv_usbd.c 1 ..\libraries\m460\rtt_port\drv_usbd.c - - drv_usbhost.c 1 ..\libraries\m460\rtt_port\drv_usbhost.c - - drv_uspi.c 1 ..\libraries\m460\rtt_port\drv_uspi.c - - drv_uuart.c 1 ..\libraries\m460\rtt_port\drv_uuart.c - - drv_wdt.c 1 ..\libraries\m460\rtt_port\drv_wdt.c - - nutool_pincfg.c 1 board\NuPinConfig\nutool_pincfg.c - - board_dev.c 1 board\board_dev.c - - nutool_modclkcfg.c 1 board\nutool_modclkcfg.c - - + + startup_m460.s + 2 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\ARM\startup_m460.s + + + system_m460.c + 1 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\system_m460.c + drv_emac.c 1 ..\libraries\m460\rtt_port\emac\drv_emac.c - - mii.c 1 ..\libraries\m460\rtt_port\emac\mii.c - - synopGMAC_Dev.c 1 ..\libraries\m460\rtt_port\emac\synopGMAC_Dev.c - - synopGMAC_network_interface.c 1 ..\libraries\m460\rtt_port\emac\synopGMAC_network_interface.c - - synopGMAC_plat.c 1 @@ -1728,34 +3382,26 @@ Fal + + fal_partition.c + 1 + ..\..\..\components\fal\src\fal_partition.c + fal_rtt.c 1 ..\..\..\components\fal\src\fal_rtt.c - - - fal_flash.c + fal.c 1 - ..\..\..\components\fal\src\fal_flash.c + ..\..\..\components\fal\src\fal.c - - - fal_partition.c + fal_flash.c 1 - ..\..\..\components\fal\src\fal_partition.c + ..\..\..\components\fal\src\fal_flash.c - - - - fal.c - 1 - ..\..\..\components\fal\src\fal.c - - - fal_flash_sfud_port.c 1 @@ -1771,146 +3417,444 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - src_dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + @@ -1926,29 +3870,21 @@ 1 ..\..\..\components\finsh\msh.c - - msh_file.c 1 ..\..\..\components\finsh\msh_file.c - - msh_parse.c 1 ..\..\..\components\finsh\msh_parse.c - - cmd.c 1 ..\..\..\components\finsh\cmd.c - - shell.c 1 @@ -1964,298 +3900,892 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + @@ -2271,34 +4801,26 @@ 1 ..\..\..\src\klibc\kstdio.c - - - - kerrno.c - 1 - ..\..\..\src\klibc\kerrno.c - - - rt_vsscanf.c 1 ..\..\..\src\klibc\rt_vsscanf.c - - - kstring.c + kerrno.c 1 - ..\..\..\src\klibc\kstring.c + ..\..\..\src\klibc\kerrno.c - - rt_vsnprintf_std.c 1 ..\..\..\src\klibc\rt_vsnprintf_std.c + + kstring.c + 1 + ..\..\..\src\klibc\kstring.c + @@ -2319,29 +4841,21 @@ 1 ..\..\..\libcpu\arm\common\atomic_arm.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 ..\..\..\libcpu\arm\common\showmem.c - - context_rvds.S 2 ..\..\..\libcpu\arm\cortex-m4\context_rvds.S - - cpuport.c 1 @@ -2353,296 +4867,214 @@ Libraries - nu_crc.c + nu_timer_pwm.c 1 - ..\libraries\m460\StdDriver\src\nu_crc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer_pwm.c - - - nu_i2c.c + nu_crypto.c 1 - ..\libraries\m460\StdDriver\src\nu_i2c.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crypto.c - - - nu_acmp.c + nu_sc.c 1 - ..\libraries\m460\StdDriver\src\nu_acmp.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sc.c - - - nu_rtc.c + nu_trng.c 1 - ..\libraries\m460\StdDriver\src\nu_rtc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_trng.c - - - nu_clk.c + nu_hsusbd.c 1 - ..\libraries\m460\StdDriver\src\nu_clk.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hsusbd.c - - - nu_wdt.c + nu_eqei.c 1 - ..\libraries\m460\StdDriver\src\nu_wdt.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eqei.c - - - nu_hsusbd.c + nu_timer.c 1 - ..\libraries\m460\StdDriver\src\nu_hsusbd.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer.c - - - nu_bmc.c + nu_scuart.c 1 - ..\libraries\m460\StdDriver\src\nu_bmc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_scuart.c - - - nu_i2s.c + nu_ccap.c 1 - ..\libraries\m460\StdDriver\src\nu_i2s.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ccap.c - - - nu_ecap.c + nu_wwdt.c 1 - ..\libraries\m460\StdDriver\src\nu_ecap.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wwdt.c - - - nu_spi.c + nu_keystore.c 1 - ..\libraries\m460\StdDriver\src\nu_spi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_keystore.c - - - nu_usci_i2c.c + nu_bpwm.c 1 - ..\libraries\m460\StdDriver\src\nu_usci_i2c.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bpwm.c - - - nu_keystore.c + nu_i2s.c 1 - ..\libraries\m460\StdDriver\src\nu_keystore.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2s.c - - - nu_crypto.c + nu_crc.c 1 - ..\libraries\m460\StdDriver\src\nu_crypto.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crc.c - - - nu_eadc.c + nu_qspi.c 1 - ..\libraries\m460\StdDriver\src\nu_eadc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_qspi.c - - - nu_kpi.c + nu_uart.c 1 - ..\libraries\m460\StdDriver\src\nu_kpi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_uart.c - - - nu_canfd.c + nu_fmc.c 1 - ..\libraries\m460\StdDriver\src\nu_canfd.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_fmc.c - - - nu_scuart.c + nu_kpi.c 1 - ..\libraries\m460\StdDriver\src\nu_scuart.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_kpi.c - - nu_dac.c 1 - ..\libraries\m460\StdDriver\src\nu_dac.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_dac.c - - - nu_timer.c + nu_spi.c 1 - ..\libraries\m460\StdDriver\src\nu_timer.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spi.c - - - nu_uart.c + nu_acmp.c 1 - ..\libraries\m460\StdDriver\src\nu_uart.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_acmp.c - - - nu_timer_pwm.c + nu_eadc.c 1 - ..\libraries\m460\StdDriver\src\nu_timer_pwm.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eadc.c - - - nu_fmc.c + nu_bmc.c 1 - ..\libraries\m460\StdDriver\src\nu_fmc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bmc.c - - - nu_usbd.c + nu_spim.c 1 - ..\libraries\m460\StdDriver\src\nu_usbd.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spim.c - - - nu_wwdt.c + nu_ebi.c 1 - ..\libraries\m460\StdDriver\src\nu_wwdt.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ebi.c - - - nu_qspi.c + nu_usci_uart.c 1 - ..\libraries\m460\StdDriver\src\nu_qspi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_uart.c - - - nu_ebi.c + nu_i2c.c 1 - ..\libraries\m460\StdDriver\src\nu_ebi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2c.c - - - nu_epwm.c + nu_clk.c 1 - ..\libraries\m460\StdDriver\src\nu_epwm.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_clk.c - - - nu_pdma.c + nu_hbi.c 1 - ..\libraries\m460\StdDriver\src\nu_pdma.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hbi.c - - - nu_ccap.c + nu_sys.c 1 - ..\libraries\m460\StdDriver\src\nu_ccap.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sys.c - - - nu_usci_uart.c + nu_sdh.c 1 - ..\libraries\m460\StdDriver\src\nu_usci_uart.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sdh.c - - - nu_spim.c + nu_usci_i2c.c 1 - ..\libraries\m460\StdDriver\src\nu_spim.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_i2c.c - - - nu_sys.c + nu_rtc.c 1 - ..\libraries\m460\StdDriver\src\nu_sys.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rtc.c - - - nu_trng.c + nu_wdt.c 1 - ..\libraries\m460\StdDriver\src\nu_trng.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wdt.c - - - nu_hbi.c + nu_pdma.c 1 - ..\libraries\m460\StdDriver\src\nu_hbi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_pdma.c - - - nu_usci_spi.c + nu_epwm.c 1 - ..\libraries\m460\StdDriver\src\nu_usci_spi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_epwm.c - - - nu_sc.c + nu_canfd.c 1 - ..\libraries\m460\StdDriver\src\nu_sc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_canfd.c - - - nu_eqei.c + nu_usci_spi.c 1 - ..\libraries\m460\StdDriver\src\nu_eqei.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_spi.c - - nu_rng.c 1 - ..\libraries\m460\StdDriver\src\nu_rng.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rng.c - - - nu_sdh.c + nu_ecap.c 1 - ..\libraries\m460\StdDriver\src\nu_sdh.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ecap.c - - nu_gpio.c 1 - ..\libraries\m460\StdDriver\src\nu_gpio.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_gpio.c - - - nu_bpwm.c + nu_usbd.c 1 - ..\libraries\m460\StdDriver\src\nu_bpwm.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usbd.c @@ -2654,281 +5086,201 @@ 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c - - api_msg.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c - - err.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c - - if_api.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c - - netbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c - - netdb.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c - - netifapi.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c - - sockets.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c - - tcpip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c - - ping.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c - - altcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c - - altcp_alloc.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c - - altcp_tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c - - def.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c - - dns.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c - - inet_chksum.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c - - init.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c - - ip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c - - autoip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c - - dhcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c - - etharp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c - - icmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c - - igmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c - - ip4.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c - - ip4_addr.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c - - ip4_frag.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c - - memp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c - - netif.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c - - pbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c - - raw.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c - - stats.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c - - sys.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c - - tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c - - tcp_in.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c - - tcp_out.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c - - timeouts.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c - - udp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c - - ethernet.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c - - lowpan6.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c - - ethernetif.c 1 ..\..\..\components\net\lwip\port\ethernetif.c - - sys_arch.c 1 @@ -2940,37 +5292,29 @@ m460_usbhostlib - usb_core.c + mem_alloc.c 1 - ..\libraries\m460\USBHostLib\src\usb_core.c + packages\nuvoton-series-latest\M460\USBHostLib\src\mem_alloc.c - - - ehci.c + ohci.c 1 - ..\libraries\m460\USBHostLib\src\ehci.c + packages\nuvoton-series-latest\M460\USBHostLib\src\ohci.c - - ehci_iso.c 1 - ..\libraries\m460\USBHostLib\src\ehci_iso.c + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci_iso.c - - - mem_alloc.c + ehci.c 1 - ..\libraries\m460\USBHostLib\src\mem_alloc.c + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci.c - - - ohci.c + usb_core.c 1 - ..\libraries\m460\USBHostLib\src\ohci.c + packages\nuvoton-series-latest\M460\USBHostLib\src\usb_core.c @@ -2978,65 +5322,49 @@ nu_pkgs_demo - smp_demo.c + slcd_show_tick.c 1 - ..\libraries\nu_packages\Demo\smp_demo.c + ..\libraries\nu_packages\Demo\slcd_show_tick.c - - - usbd_hid_dance_mouse.c + usbd_cdc_vcom_echo.c 1 - ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c - - - wormhole_demo.c + smp_demo.c 1 - ..\libraries\nu_packages\Demo\wormhole_demo.c + ..\libraries\nu_packages\Demo\smp_demo.c - - - atdev_utils.c + wormhole_demo.c 1 - ..\libraries\nu_packages\Demo\atdev_utils.c + ..\libraries\nu_packages\Demo\wormhole_demo.c - - ccap_demo.c 1 ..\libraries\nu_packages\Demo\ccap_demo.c - - - usbd_cdc_vcom_echo.c + usbd_hid_dance_mouse.c 1 - ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c - - ccap_saver.c 1 ..\libraries\nu_packages\Demo\ccap_saver.c - - - hwsem_counter.c + atdev_utils.c 1 - ..\libraries\nu_packages\Demo\hwsem_counter.c + ..\libraries\nu_packages\Demo\atdev_utils.c - - - slcd_show_tick.c + hwsem_counter.c 1 - ..\libraries\nu_packages\Demo\slcd_show_tick.c + ..\libraries\nu_packages\Demo\hwsem_counter.c @@ -3058,8 +5386,6 @@ 1 ..\..\..\components\libc\posix\io\poll\poll.c - - select.c 1 @@ -3069,66 +5395,52 @@ rt_usbd - - - mstorage.c - 1 - ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c - - usbdevice_core.c 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c - - usbdevice.c 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + + mstorage.c + 1 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + rt_usbh - hub.c + driver.c 1 - ..\..\..\components\legacy\usb\usbhost\core\hub.c + ..\..\..\components\legacy\usb\usbhost\core\driver.c - - - usbhost_core.c + udisk.c 1 - ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - - driver.c + usbhost_core.c 1 - ..\..\..\components\legacy\usb\usbhost\core\driver.c + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c - - - udisk.c + hub.c 1 - ..\..\..\components\legacy\usb\usbhost\class\udisk.c + ..\..\..\components\legacy\usb\usbhost\core\hub.c - - usbhost.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost.c - - mass.c 1 @@ -3144,50 +5456,36 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_at.c 1 ..\..\..\components\net\sal\impl\af_inet_at.c - - af_inet_lwip.c 1 ..\..\..\components\net\sal\impl\af_inet_lwip.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -3203,8 +5501,6 @@ 1 ..\..\..\components\utilities\utest\TC_uassert.c - - utest.c 1 @@ -3220,8 +5516,6 @@ 1 ..\..\..\components\utilities\ulog\backend\console_be.c - - ulog.c 1 @@ -3229,19 +5523,24 @@ + + ::CMSIS + + - + - - + + - + - + +
diff --git a/bsp/nuvoton/numaker-iot-m487/project.uvoptx b/bsp/nuvoton/numaker-iot-m487/project.uvoptx new file mode 100644 index 00000000000..1512157524b --- /dev/null +++ b/bsp/nuvoton/numaker-iot-m487/project.uvoptx @@ -0,0 +1,3560 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread-m480 + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\keil5\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 6 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + + + + + + + + + + + BIN\UL2CM3.DLL + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC14000 -FN1 -FF0M481_AP_512 -FS00 -FL080000 -FP0($$Device:M487JIDAE$Flash\M481_AP_512.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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + + + AT + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_client.c + at_client.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_utils.c + at_utils.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\at_socket\at_socket.c + at_socket.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_cli.c + at_cli.c + 0 + 0 + + + + + at_device + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + packages\at_device-latest\src\at_device.c + at_device.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + packages\at_device-latest\samples\at_sample_esp8266.c + at_sample_esp8266.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + packages\at_device-latest\class\esp8266\at_socket_esp8266.c + at_socket_esp8266.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + packages\at_device-latest\class\esp8266\at_device_esp8266.c + at_device_esp8266.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 4 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 4 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 5 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk.c + blk.c + 0 + 0 + + + 5 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dev.c + blk_dev.c + 0 + 0 + + + 5 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dfs.c + blk_dfs.c + 0 + 0 + + + 5 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_partition.c + blk_partition.c + 0 + 0 + + + 5 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\dfs.c + dfs.c + 0 + 0 + + + 5 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\efi.c + efi.c + 0 + 0 + + + 5 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 5 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 5 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_crc.c + hw_crc.c + 0 + 0 + + + 5 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 5 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 5 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 5 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 5 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 5 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 5 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 5 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 5 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 5 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 5 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 5 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 5 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 5 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 5 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 5 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 5 + 46 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 5 + 47 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 5 + 48 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 5 + 49 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 5 + 50 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\lptimer.c + lptimer.c + 0 + 0 + + + 5 + 51 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\pm.c + pm.c + 0 + 0 + + + 5 + 52 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 5 + 53 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_block.c + dev_block.c + 0 + 0 + + + 5 + 54 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmc.c + dev_mmc.c + 0 + 0 + + + 5 + 55 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + dev_mmcsd_core.c + 0 + 0 + + + 5 + 56 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sd.c + dev_sd.c + 0 + 0 + + + 5 + 57 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sdio.c + dev_sdio.c + 0 + 0 + + + 5 + 58 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v1\sensor.c + sensor.c + 0 + 0 + + + 5 + 59 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v1\sensor_cmd.c + sensor_cmd.c + 0 + 0 + + + 5 + 60 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 5 + 61 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 5 + 62 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 5 + 63 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 5 + 64 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + dev_spi_flash_sfud.c + 0 + 0 + + + 5 + 65 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud.c + sfud.c + 0 + 0 + + + 5 + 66 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + sfud_sfdp.c + 0 + 0 + + + 5 + 67 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 6 + 68 + 1 + 0 + 0 + 0 + board\NuClockConfig\nutool_modclkcfg.c + nutool_modclkcfg.c + 0 + 0 + + + 6 + 69 + 1 + 0 + 0 + 0 + board\NuPinConfig\nutool_pincfg.c + nutool_pincfg.c + 0 + 0 + + + 6 + 70 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + 6 + 71 + 2 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\ARM\startup_M480.s + startup_M480.s + 0 + 0 + + + 6 + 72 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\system_M480.c + system_M480.c + 0 + 0 + + + 6 + 73 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_bpwm.c + drv_bpwm.c + 0 + 0 + + + 6 + 74 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_bpwm_capture.c + drv_bpwm_capture.c + 0 + 0 + + + 6 + 75 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_can.c + drv_can.c + 0 + 0 + + + 6 + 76 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_clk.c + drv_clk.c + 0 + 0 + + + 6 + 77 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 6 + 78 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_crc.c + drv_crc.c + 0 + 0 + + + 6 + 79 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 6 + 80 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_eadc.c + drv_eadc.c + 0 + 0 + + + 6 + 81 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 6 + 82 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_ecap.c + drv_ecap.c + 0 + 0 + + + 6 + 83 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_emac.c + drv_emac.c + 0 + 0 + + + 6 + 84 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_epwm.c + drv_epwm.c + 0 + 0 + + + 6 + 85 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_epwm_capture.c + drv_epwm_capture.c + 0 + 0 + + + 6 + 86 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_fmc.c + drv_fmc.c + 0 + 0 + + + 6 + 87 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 6 + 88 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_hsotg.c + drv_hsotg.c + 0 + 0 + + + 6 + 89 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_hsusbd.c + drv_hsusbd.c + 0 + 0 + + + 6 + 90 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 6 + 91 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 6 + 92 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 6 + 93 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_qei.c + drv_qei.c + 0 + 0 + + + 6 + 94 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 6 + 95 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 6 + 96 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 6 + 97 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 6 + 98 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_sdio.c + drv_sdio.c + 0 + 0 + + + 6 + 99 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 6 + 100 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 6 + 101 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_spii2s.c + drv_spii2s.c + 0 + 0 + + + 6 + 102 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_timer.c + drv_timer.c + 0 + 0 + + + 6 + 103 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_timer_capture.c + drv_timer_capture.c + 0 + 0 + + + 6 + 104 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_tpwm.c + drv_tpwm.c + 0 + 0 + + + 6 + 105 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_trng.c + drv_trng.c + 0 + 0 + + + 6 + 106 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 6 + 107 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_ui2c.c + drv_ui2c.c + 0 + 0 + + + 6 + 108 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 6 + 109 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 6 + 110 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_uspi.c + drv_uspi.c + 0 + 0 + + + 6 + 111 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_uuart.c + drv_uuart.c + 0 + 0 + + + 6 + 112 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + + + Fal + 0 + 0 + 0 + 0 + + 7 + 113 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_partition.c + fal_partition.c + 0 + 0 + + + 7 + 114 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal.c + fal.c + 0 + 0 + + + 7 + 115 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_rtt.c + fal_rtt.c + 0 + 0 + + + 7 + 116 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_flash.c + fal_flash.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 8 + 117 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 8 + 118 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 8 + 119 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 8 + 120 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 8 + 121 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + src_dfs.c + 0 + 0 + + + 8 + 122 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 8 + 123 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 8 + 124 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 9 + 125 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 9 + 126 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 9 + 127 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 9 + 128 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 9 + 129 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 10 + 130 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 10 + 131 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 10 + 132 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 10 + 133 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 10 + 134 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 10 + 135 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 10 + 136 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 10 + 137 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 10 + 138 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 10 + 139 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 10 + 140 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 10 + 141 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 10 + 142 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 10 + 143 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 10 + 144 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 10 + 145 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 11 + 146 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 11 + 147 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + 11 + 148 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 11 + 149 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 11 + 150 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 12 + 151 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\atomic_arm.c + atomic_arm.c + 0 + 0 + + + 12 + 152 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 12 + 153 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + 12 + 154 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + context_rvds.S + 0 + 0 + + + 12 + 155 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\cpuport.c + cpuport.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 13 + 156 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer_pwm.c + nu_timer_pwm.c + 0 + 0 + + + 13 + 157 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crc.c + nu_crc.c + 0 + 0 + + + 13 + 158 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 13 + 159 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 13 + 160 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_i2c.c + nu_usci_i2c.c + 0 + 0 + + + 13 + 161 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 13 + 162 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 13 + 163 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spi.c + nu_spi.c + 0 + 0 + + + 13 + 164 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 13 + 165 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_fmc.c + nu_fmc.c + 0 + 0 + + + 13 + 166 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_uart.c + nu_usci_uart.c + 0 + 0 + + + 13 + 167 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_emac.c + nu_emac.c + 0 + 0 + + + 13 + 168 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_acmp.c + nu_acmp.c + 0 + 0 + + + 13 + 169 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qei.c + nu_qei.c + 0 + 0 + + + 13 + 170 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_uart.c + nu_uart.c + 0 + 0 + + + 13 + 171 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_clk.c + nu_clk.c + 0 + 0 + + + 13 + 172 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sys.c + nu_sys.c + 0 + 0 + + + 13 + 173 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_can.c + nu_can.c + 0 + 0 + + + 13 + 174 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ecap.c + nu_ecap.c + 0 + 0 + + + 13 + 175 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sc.c + nu_sc.c + 0 + 0 + + + 13 + 176 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_epwm.c + nu_epwm.c + 0 + 0 + + + 13 + 177 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_trng.c + nu_trng.c + 0 + 0 + + + 13 + 178 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_eadc.c + nu_eadc.c + 0 + 0 + + + 13 + 179 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qspi.c + nu_qspi.c + 0 + 0 + + + 13 + 180 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 13 + 181 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 13 + 182 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer.c + nu_timer.c + 0 + 0 + + + 13 + 183 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 13 + 184 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 13 + 185 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_hsusbd.c + nu_hsusbd.c + 0 + 0 + + + 13 + 186 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spim.c + nu_spim.c + 0 + 0 + + + 13 + 187 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_bpwm.c + nu_bpwm.c + 0 + 0 + + + 13 + 188 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 13 + 189 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_spi.c + nu_usci_spi.c + 0 + 0 + + + 13 + 190 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ccap.c + nu_ccap.c + 0 + 0 + + + 13 + 191 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 13 + 192 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 13 + 193 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_dac.c + nu_dac.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 14 + 194 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 14 + 195 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 14 + 196 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\err.c + err.c + 0 + 0 + + + 14 + 197 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 14 + 198 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netdb.c + netdb.c + 0 + 0 + + + 14 + 199 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 14 + 200 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\sockets.c + sockets.c + 0 + 0 + + + 14 + 201 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 14 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 14 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\def.c + def.c + 0 + 0 + + + 14 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\dns.c + dns.c + 0 + 0 + + + 14 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 14 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\init.c + init.c + 0 + 0 + + + 14 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ip.c + ip.c + 0 + 0 + + + 14 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 14 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 14 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 14 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 14 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 14 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 14 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 14 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 14 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\memp.c + memp.c + 0 + 0 + + + 14 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\netif.c + netif.c + 0 + 0 + + + 14 + 218 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 14 + 219 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\raw.c + raw.c + 0 + 0 + + + 14 + 220 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\stats.c + stats.c + 0 + 0 + + + 14 + 221 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\sys.c + sys.c + 0 + 0 + + + 14 + 222 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp.c + tcp.c + 0 + 0 + + + 14 + 223 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 14 + 224 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 14 + 225 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 14 + 226 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\udp.c + udp.c + 0 + 0 + + + 14 + 227 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 14 + 228 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 14 + 229 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 14 + 230 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + m480_usbhostlib + 0 + 0 + 0 + 0 + + 15 + 231 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + 15 + 232 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + 15 + 233 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci.c + ehci.c + 0 + 0 + + + 15 + 234 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + 15 + 235 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\ohci.c + ohci.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 16 + 236 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + 16 + 237 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + 16 + 238 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 16 + 239 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + 16 + 240 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + 16 + 241 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + 16 + 242 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 16 + 243 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 16 + 244 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + + + nu_pkgs_nau88l25 + 0 + 0 + 0 + 0 + + 17 + 245 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\acodec_nau88l25.c + acodec_nau88l25.c + 0 + 0 + + + 17 + 246 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\audio_test.c + audio_test.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 18 + 247 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 18 + 248 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 19 + 249 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + 19 + 250 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\hid.c + hid.c + 0 + 0 + + + 19 + 251 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 20 + 252 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 20 + 253 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + 20 + 254 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + 20 + 255 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 20 + 256 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 20 + 257 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 21 + 258 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 21 + 259 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 21 + 260 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 21 + 261 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_at.c + af_inet_at.c + 0 + 0 + + + 21 + 262 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 21 + 263 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 21 + 264 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 21 + 265 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 22 + 266 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + 22 + 267 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/bsp/nuvoton/numaker-iot-m487/project.uvprojx b/bsp/nuvoton/numaker-iot-m487/project.uvprojx index 08a7e0754ae..6ac30b4f4ee 100644 --- a/bsp/nuvoton/numaker-iot-m487/project.uvprojx +++ b/bsp/nuvoton/numaker-iot-m487/project.uvprojx @@ -1,42 +1,46 @@ + 2.1 +
### uVision Project, (C) Keil Software
+ rtthread-m480 0x4 ARM-ADS + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 M487JIDAE Nuvoton - Nuvoton.NuMicro_DFP.1.3.13 - https://github.com/OpenNuvoton/cmsis-packs/raw/master/ + Nuvoton.NuMicro_DFP.1.3.25 + https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x28000) IROM(0x00000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) - - + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M481_AP_512 -FS00 -FL080000 -FP0($$Device:M487JIDAE$Flash\M481_AP_512.FLM)) 0 $$Device:M487JIDAE$Device\M480\Include\M480.h - - - - - - - - - + + + + + + + + + $$Device:M487JIDAE$SVD\Nuvoton\M481_v1.svd 0 0 - - - - - + + + + + 0 0 @@ -58,8 +62,8 @@ 0 0 - - + + 0 0 0 @@ -68,8 +72,8 @@ 0 0 - - + + 0 0 0 @@ -79,14 +83,14 @@ 1 0 fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" - + 0 0 0 0 0 - + 0 @@ -100,19 +104,19 @@ 0 0 3 - - + + 1 SARMCM3.DLL - + DARMCM1.DLL - + SARMCM3.DLL - + TARMCM1.DLL - + @@ -135,10 +139,10 @@ 1 BIN\UL2CM3.DLL "" () - - - - + + + + 0 @@ -171,7 +175,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -181,6 +185,8 @@ 0 2 0 + 0 + 0 0 0 8 @@ -304,7 +310,7 @@ 0x0 - + 1 @@ -324,17 +330,17 @@ 0 0 1 - 1 + 3 1 1 0 0 0 - --c99 - __RTTHREAD__, __STDC_LIMIT_MACROS, RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_ARMLIBC - - ..\..\..\components\drivers\include;board\NuPinConfig;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\drivers\include;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\net\lwip\lwip-2.0.3\src\include\netif;..\..\..\components\libc\posix\io\epoll;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\include;..\..\..\components\net\at\include;..\..\..\components\net\sal\include\socket;..\libraries\m480\rtt_port;..\..\..\components\drivers\spi;..\..\..\components\legacy\usb\usbhost;..\..\..\libcpu\arm\cortex-m4;..\libraries\nu_packages\Demo;..\..\..\components\drivers\include;..\libraries\m480\StdDriver\inc;..\..\..\components\legacy\include;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\net\sal\include\socket\sys_socket;..\libraries\m480\CMSIS\Include;..\..\..\components\drivers\audio;..\..\..\components\drivers\hwcrypto;..\..\..\components\drivers\include;..\..\..\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\fal\inc;..\libraries\m480\Device\Nuvoton\M480\Include;..\..\..\components\net\lwip\lwip-2.0.3\src\include;..\..\..\components\libc\compilers\common\extension;..\..\..\components\net\at\at_socket;..\..\..\components\libc\posix\io\eventfd;applications;..\..\..\libcpu\arm\common;..\..\..\components\drivers\phy;..\..\..\components\drivers\smp_call;..\..\..\components\net\lwip\port;..\libraries\m480\USBHostLib\inc;..\..\..\components\net\netdev\include;..\..\..\components\net\lwip\lwip-2.0.3\src\include\ipv4;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\include;..\..\..\components\utilities\utest;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\libraries\nu_packages\AudioCodec;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\dfs_net;..\libraries\nu_packages\TPC;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;.;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\libc\posix\ipc;..\..\..\components\net\sal\impl;board;board\NuClockConfig;..\..\..\components\net\sal\include;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\include;..\..\..\components\finsh;..\..\..\components\drivers\include + --c99 --gnu --diag_suppress=1,177,550 + __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__, __STDC_LIMIT_MACROS, RT_USING_ARMLIBC, RT_USING_LIBC + + packages\nuvoton-cmsis-latest\m031_m480_ma35\Include;..\..\..\components\net\lwip\lwip-2.0.3\src\include\ipv4;packages\nuvoton-series-latest\M480\USBHostLib\inc;..\..\..\components\net\at\include;board;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\finsh;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\net\sal\include\dfs_net;..\..\..\libcpu\arm\cortex-m4;packages\at_device-latest\class\esp8266;..\..\..\components\drivers\audio;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\smp_call;..\..\..\components\drivers\spi;..\..\..\components\drivers\phy;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\net\at\at_socket;applications;..\..\..\components\drivers\include;board\NuClockConfig;..\..\..\components\legacy\usb\usbhost;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\utilities\utest;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\libraries\m480\rtt_port;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\libc\posix\io\eventfd;packages\at_device-latest\inc;..\..\..\components\net\lwip\lwip-2.0.3\src\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\legacy\include;..\..\..\components\net\sal\include;board\NuPinConfig;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\net\lwip\lwip-2.0.3\src\include\netif;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\libraries\nu_packages\AudioCodec;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\lwip\port;..\..\..\components\drivers\include;..\..\..\components\net\sal\impl;..\..\..\libcpu\arm\common;..\..\..\components\drivers\hwcrypto;..\..\..\components\net\netdev\include;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\epoll;packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Include;..\libraries\nu_packages\Demo;..\..\..\components\libc\compilers\common\include;..\..\..\components\libc\posix\ipc;..\..\..\components\drivers\spi\sfud\inc;.;..\..\..\components\drivers\include;..\libraries\nu_packages\TPC;..\..\..\components\legacy\usb\usbdevice;packages\nuvoton-series-latest\M480\StdDriver\inc;..\..\..\components\net\sal\include\socket;..\..\..\include;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\fal\inc @@ -347,12 +353,12 @@ 0 0 0 - 0 + 4 - - - - + + + + @@ -364,13 +370,13 @@ 0 0x00000000 0x20000000 - + .\linking_scripts\m480_flash.sct - - - - - + + + + + @@ -383,8 +389,6 @@ 1 applications\main.c - - mnt.c 1 @@ -396,30 +400,49 @@ AT - at_cli.c + at_client.c 1 - ..\..\..\components\net\at\src\at_cli.c + ..\..\..\components\net\at\src\at_client.c - - at_utils.c 1 ..\..\..\components\net\at\src\at_utils.c - - - at_client.c + at_socket.c 1 - ..\..\..\components\net\at\src\at_client.c + ..\..\..\components\net\at\at_socket\at_socket.c + + + at_cli.c + 1 + ..\..\..\components\net\at\src\at_cli.c + + + at_device - at_socket.c + at_device.c 1 - ..\..\..\components\net\at\at_socket\at_socket.c + packages\at_device-latest\src\at_device.c + + + at_sample_esp8266.c + 1 + packages\at_device-latest\samples\at_sample_esp8266.c + + + at_socket_esp8266.c + 1 + packages\at_device-latest\class\esp8266\at_socket_esp8266.c + + + at_device_esp8266.c + 1 + packages\at_device-latest\class\esp8266\at_device_esp8266.c @@ -431,50 +454,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -490,925 +499,2740 @@ 1 ..\..\..\components\drivers\audio\dev_audio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_audio_pipe.c 1 ..\..\..\components\drivers\audio\dev_audio_pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk.c 1 ..\..\..\components\drivers\block\blk.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dev.c 1 ..\..\..\components\drivers\block\blk_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dfs.c 1 ..\..\..\components\drivers\block\blk_dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_partition.c 1 ..\..\..\components\drivers\block\blk_partition.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dfs.c 1 ..\..\..\components\drivers\block\partitions\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - efi.c 1 ..\..\..\components\drivers\block\partitions\efi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_can.c 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_crc.c 1 ..\..\..\components\drivers\hwcrypto\hw_crc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_hash.c 1 ..\..\..\components\drivers\hwcrypto\hw_hash.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_rng.c 1 ..\..\..\components\drivers\hwcrypto\hw_rng.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_symmetric.c 1 ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwcrypto.c 1 ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - adc.c 1 ..\..\..\components\drivers\misc\adc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - lptimer.c 1 ..\..\..\components\drivers\pm\lptimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - pm.c 1 ..\..\..\components\drivers\pm\pm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_block.c 1 ..\..\..\components\drivers\sdio\dev_block.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmc.c 1 ..\..\..\components\drivers\sdio\dev_mmc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmcsd_core.c 1 ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sd.c 1 ..\..\..\components\drivers\sdio\dev_sd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sdio.c 1 ..\..\..\components\drivers\sdio\dev_sdio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sensor.c 1 ..\..\..\components\drivers\sensor\v1\sensor.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sensor_cmd.c 1 ..\..\..\components\drivers\sensor\v1\sensor_cmd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_flash_sfud.c 1 ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud_sfdp.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + @@ -1418,315 +3242,227 @@ Drivers - - - startup_M480.s - 2 - ..\libraries\m480\Device\Nuvoton\M480\Source\ARM\startup_M480.s - - - - - system_M480.c - 1 - ..\libraries\m480\Device\Nuvoton\M480\Source\system_M480.c - - nutool_modclkcfg.c 1 board\NuClockConfig\nutool_modclkcfg.c - - nutool_pincfg.c 1 board\NuPinConfig\nutool_pincfg.c - - board_dev.c 1 board\board_dev.c - - + + startup_M480.s + 2 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\ARM\startup_M480.s + + + system_M480.c + 1 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\system_M480.c + drv_bpwm.c 1 ..\libraries\m480\rtt_port\drv_bpwm.c - - drv_bpwm_capture.c 1 ..\libraries\m480\rtt_port\drv_bpwm_capture.c - - drv_can.c 1 ..\libraries\m480\rtt_port\drv_can.c - - drv_clk.c 1 ..\libraries\m480\rtt_port\drv_clk.c - - drv_common.c 1 ..\libraries\m480\rtt_port\drv_common.c - - drv_crc.c 1 ..\libraries\m480\rtt_port\drv_crc.c - - drv_crypto.c 1 ..\libraries\m480\rtt_port\drv_crypto.c - - drv_eadc.c 1 ..\libraries\m480\rtt_port\drv_eadc.c - - drv_ebi.c 1 ..\libraries\m480\rtt_port\drv_ebi.c - - drv_ecap.c 1 ..\libraries\m480\rtt_port\drv_ecap.c - - drv_emac.c 1 ..\libraries\m480\rtt_port\drv_emac.c - - drv_epwm.c 1 ..\libraries\m480\rtt_port\drv_epwm.c - - drv_epwm_capture.c 1 ..\libraries\m480\rtt_port\drv_epwm_capture.c - - drv_fmc.c 1 ..\libraries\m480\rtt_port\drv_fmc.c - - drv_gpio.c 1 ..\libraries\m480\rtt_port\drv_gpio.c - - drv_hsotg.c 1 ..\libraries\m480\rtt_port\drv_hsotg.c - - drv_hsusbd.c 1 ..\libraries\m480\rtt_port\drv_hsusbd.c - - drv_i2c.c 1 ..\libraries\m480\rtt_port\drv_i2c.c - - drv_i2s.c 1 ..\libraries\m480\rtt_port\drv_i2s.c - - drv_pdma.c 1 ..\libraries\m480\rtt_port\drv_pdma.c - - drv_qei.c 1 ..\libraries\m480\rtt_port\drv_qei.c - - drv_qspi.c 1 ..\libraries\m480\rtt_port\drv_qspi.c - - drv_rtc.c 1 ..\libraries\m480\rtt_port\drv_rtc.c - - drv_scuart.c 1 ..\libraries\m480\rtt_port\drv_scuart.c - - drv_sdh.c 1 ..\libraries\m480\rtt_port\drv_sdh.c - - drv_sdio.c 1 ..\libraries\m480\rtt_port\drv_sdio.c - - drv_softi2c.c 1 ..\libraries\m480\rtt_port\drv_softi2c.c - - drv_spi.c 1 ..\libraries\m480\rtt_port\drv_spi.c - - drv_spii2s.c 1 ..\libraries\m480\rtt_port\drv_spii2s.c - - drv_timer.c 1 ..\libraries\m480\rtt_port\drv_timer.c - - drv_timer_capture.c 1 ..\libraries\m480\rtt_port\drv_timer_capture.c - - drv_tpwm.c 1 ..\libraries\m480\rtt_port\drv_tpwm.c - - drv_trng.c 1 ..\libraries\m480\rtt_port\drv_trng.c - - drv_uart.c 1 ..\libraries\m480\rtt_port\drv_uart.c - - drv_ui2c.c 1 ..\libraries\m480\rtt_port\drv_ui2c.c - - drv_usbd.c 1 ..\libraries\m480\rtt_port\drv_usbd.c - - drv_usbhost.c 1 ..\libraries\m480\rtt_port\drv_usbhost.c - - drv_uspi.c 1 ..\libraries\m480\rtt_port\drv_uspi.c - - drv_uuart.c 1 ..\libraries\m480\rtt_port\drv_uuart.c - - drv_wdt.c 1 @@ -1738,30 +3474,24 @@ Fal - fal_rtt.c + fal_partition.c 1 - ..\..\..\components\fal\src\fal_rtt.c + ..\..\..\components\fal\src\fal_partition.c - - - fal_flash.c + fal.c 1 - ..\..\..\components\fal\src\fal_flash.c + ..\..\..\components\fal\src\fal.c - - - fal.c + fal_rtt.c 1 - ..\..\..\components\fal\src\fal.c + ..\..\..\components\fal\src\fal_rtt.c - - - fal_partition.c + fal_flash.c 1 - ..\..\..\components\fal\src\fal_partition.c + ..\..\..\components\fal\src\fal_flash.c @@ -1773,146 +3503,444 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - src_dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + @@ -1924,37 +3952,29 @@ Finsh - msh_parse.c + msh.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\msh.c - - - msh_file.c + cmd.c 1 - ..\..\..\components\finsh\msh_file.c + ..\..\..\components\finsh\cmd.c - - shell.c 1 ..\..\..\components\finsh\shell.c - - - cmd.c + msh_file.c 1 - ..\..\..\components\finsh\cmd.c + ..\..\..\components\finsh\msh_file.c - - - msh.c + msh_parse.c 1 - ..\..\..\components\finsh\msh.c + ..\..\..\components\finsh\msh_parse.c @@ -1966,298 +3986,892 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + @@ -2269,37 +4883,29 @@ klibc - kstring.c + kstdio.c 1 - ..\..\..\src\klibc\kstring.c + ..\..\..\src\klibc\kstdio.c - - - rt_vsnprintf_tiny.c + rt_vsscanf.c 1 - ..\..\..\src\klibc\rt_vsnprintf_tiny.c + ..\..\..\src\klibc\rt_vsscanf.c - - kerrno.c 1 ..\..\..\src\klibc\kerrno.c - - - rt_vsscanf.c + kstring.c 1 - ..\..\..\src\klibc\rt_vsscanf.c + ..\..\..\src\klibc\kstring.c - - - kstdio.c + rt_vsnprintf_tiny.c 1 - ..\..\..\src\klibc\kstdio.c + ..\..\..\src\klibc\rt_vsnprintf_tiny.c @@ -2311,29 +4917,21 @@ 1 ..\..\..\libcpu\arm\common\atomic_arm.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 ..\..\..\libcpu\arm\common\showmem.c - - context_rvds.S 2 ..\..\..\libcpu\arm\cortex-m4\context_rvds.S - - cpuport.c 1 @@ -2345,268 +4943,194 @@ Libraries - nu_wwdt.c + nu_timer_pwm.c 1 - ..\libraries\m480\StdDriver\src\nu_wwdt.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer_pwm.c - - - nu_qspi.c + nu_crc.c 1 - ..\libraries\m480\StdDriver\src\nu_qspi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crc.c - - - nu_eadc.c + nu_crypto.c 1 - ..\libraries\m480\StdDriver\src\nu_eadc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crypto.c - - - nu_sc.c + nu_sdh.c 1 - ..\libraries\m480\StdDriver\src\nu_sc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sdh.c - - - nu_spim.c + nu_usci_i2c.c 1 - ..\libraries\m480\StdDriver\src\nu_spim.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_i2c.c - - - nu_ebi.c + nu_gpio.c 1 - ..\libraries\m480\StdDriver\src\nu_ebi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_gpio.c - - - nu_fmc.c + nu_scuart.c 1 - ..\libraries\m480\StdDriver\src\nu_fmc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_scuart.c - - - nu_hsusbd.c + nu_spi.c 1 - ..\libraries\m480\StdDriver\src\nu_hsusbd.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spi.c - - - nu_can.c + nu_wwdt.c 1 - ..\libraries\m480\StdDriver\src\nu_can.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wwdt.c - - - nu_timer_pwm.c + nu_fmc.c 1 - ..\libraries\m480\StdDriver\src\nu_timer_pwm.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_fmc.c - - - nu_ccap.c + nu_usci_uart.c 1 - ..\libraries\m480\StdDriver\src\nu_ccap.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_uart.c - - - nu_ecap.c + nu_emac.c 1 - ..\libraries\m480\StdDriver\src\nu_ecap.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_emac.c - - - nu_sys.c + nu_acmp.c 1 - ..\libraries\m480\StdDriver\src\nu_sys.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_acmp.c - - - nu_epwm.c + nu_qei.c 1 - ..\libraries\m480\StdDriver\src\nu_epwm.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qei.c - - - nu_rtc.c + nu_uart.c 1 - ..\libraries\m480\StdDriver\src\nu_rtc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_uart.c - - - nu_scuart.c + nu_clk.c 1 - ..\libraries\m480\StdDriver\src\nu_scuart.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_clk.c - - - nu_usbd.c + nu_sys.c 1 - ..\libraries\m480\StdDriver\src\nu_usbd.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sys.c - - - nu_acmp.c + nu_can.c 1 - ..\libraries\m480\StdDriver\src\nu_acmp.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_can.c - - - nu_gpio.c + nu_ecap.c 1 - ..\libraries\m480\StdDriver\src\nu_gpio.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ecap.c - - - nu_usci_spi.c + nu_sc.c 1 - ..\libraries\m480\StdDriver\src\nu_usci_spi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sc.c - - - nu_timer.c + nu_epwm.c 1 - ..\libraries\m480\StdDriver\src\nu_timer.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_epwm.c - - - nu_sdh.c + nu_trng.c 1 - ..\libraries\m480\StdDriver\src\nu_sdh.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_trng.c - - - nu_trng.c + nu_eadc.c 1 - ..\libraries\m480\StdDriver\src\nu_trng.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_eadc.c - - - nu_bpwm.c + nu_qspi.c 1 - ..\libraries\m480\StdDriver\src\nu_bpwm.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qspi.c - - - nu_crc.c + nu_i2s.c 1 - ..\libraries\m480\StdDriver\src\nu_crc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2s.c - - - nu_dac.c + nu_pdma.c 1 - ..\libraries\m480\StdDriver\src\nu_dac.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_pdma.c - - - nu_crypto.c + nu_timer.c 1 - ..\libraries\m480\StdDriver\src\nu_crypto.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer.c - - - nu_wdt.c + nu_ebi.c 1 - ..\libraries\m480\StdDriver\src\nu_wdt.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ebi.c - - - nu_i2s.c + nu_usbd.c 1 - ..\libraries\m480\StdDriver\src\nu_i2s.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usbd.c - - - nu_i2c.c + nu_hsusbd.c 1 - ..\libraries\m480\StdDriver\src\nu_i2c.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_hsusbd.c - - - nu_qei.c + nu_spim.c 1 - ..\libraries\m480\StdDriver\src\nu_qei.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spim.c - - - nu_pdma.c + nu_bpwm.c 1 - ..\libraries\m480\StdDriver\src\nu_pdma.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_bpwm.c - - - nu_uart.c + nu_rtc.c 1 - ..\libraries\m480\StdDriver\src\nu_uart.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_rtc.c - - - nu_spi.c + nu_usci_spi.c 1 - ..\libraries\m480\StdDriver\src\nu_spi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_spi.c - - - nu_usci_uart.c + nu_ccap.c 1 - ..\libraries\m480\StdDriver\src\nu_usci_uart.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ccap.c - - - nu_clk.c + nu_i2c.c 1 - ..\libraries\m480\StdDriver\src\nu_clk.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2c.c - - - nu_emac.c + nu_wdt.c 1 - ..\libraries\m480\StdDriver\src\nu_emac.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wdt.c - - - nu_usci_i2c.c + nu_dac.c 1 - ..\libraries\m480\StdDriver\src\nu_usci_i2c.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_dac.c @@ -2618,253 +5142,181 @@ 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_lib.c - - api_msg.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_msg.c - - err.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\err.c - - netbuf.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netbuf.c - - netdb.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netdb.c - - netifapi.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netifapi.c - - sockets.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\sockets.c - - tcpip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\tcpip.c - - ping.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\apps\ping\ping.c - - def.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\def.c - - dns.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\dns.c - - inet_chksum.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\inet_chksum.c - - init.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\init.c - - ip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ip.c - - autoip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\autoip.c - - dhcp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\dhcp.c - - etharp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\etharp.c - - icmp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\icmp.c - - igmp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\igmp.c - - ip4.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4.c - - ip4_addr.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_addr.c - - ip4_frag.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_frag.c - - memp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\memp.c - - netif.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\netif.c - - pbuf.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\pbuf.c - - raw.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\raw.c - - stats.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\stats.c - - sys.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\sys.c - - tcp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp.c - - tcp_in.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_in.c - - tcp_out.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_out.c - - timeouts.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\timeouts.c - - udp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\udp.c - - ethernet.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\ethernet.c - - lowpan6.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\lowpan6.c - - ethernetif.c 1 ..\..\..\components\net\lwip\port\ethernetif.c - - sys_arch.c 1 @@ -2878,35 +5330,27 @@ mem_alloc.c 1 - ..\libraries\m480\USBHostLib\src\mem_alloc.c + packages\nuvoton-series-latest\M480\USBHostLib\src\mem_alloc.c - - - - ohci.c - 1 - ..\libraries\m480\USBHostLib\src\ohci.c - - - ehci_iso.c 1 - ..\libraries\m480\USBHostLib\src\ehci_iso.c + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci_iso.c - - ehci.c 1 - ..\libraries\m480\USBHostLib\src\ehci.c + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci.c - - usb_core.c 1 - ..\libraries\m480\USBHostLib\src\usb_core.c + packages\nuvoton-series-latest\M480\USBHostLib\src\usb_core.c + + + ohci.c + 1 + packages\nuvoton-series-latest\M480\USBHostLib\src\ohci.c @@ -2914,65 +5358,49 @@ nu_pkgs_demo - hwsem_counter.c + ccap_demo.c 1 - ..\libraries\nu_packages\Demo\hwsem_counter.c + ..\libraries\nu_packages\Demo\ccap_demo.c - - - wormhole_demo.c + atdev_utils.c 1 - ..\libraries\nu_packages\Demo\wormhole_demo.c + ..\libraries\nu_packages\Demo\atdev_utils.c - - - smp_demo.c + usbd_hid_dance_mouse.c 1 - ..\libraries\nu_packages\Demo\smp_demo.c + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c - - - ccap_saver.c + wormhole_demo.c 1 - ..\libraries\nu_packages\Demo\ccap_saver.c + ..\libraries\nu_packages\Demo\wormhole_demo.c - - slcd_show_tick.c 1 ..\libraries\nu_packages\Demo\slcd_show_tick.c - - - atdev_utils.c + hwsem_counter.c 1 - ..\libraries\nu_packages\Demo\atdev_utils.c + ..\libraries\nu_packages\Demo\hwsem_counter.c - - - ccap_demo.c + smp_demo.c 1 - ..\libraries\nu_packages\Demo\ccap_demo.c + ..\libraries\nu_packages\Demo\smp_demo.c - - - usbd_cdc_vcom_echo.c + ccap_saver.c 1 - ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + ..\libraries\nu_packages\Demo\ccap_saver.c - - - usbd_hid_dance_mouse.c + usbd_cdc_vcom_echo.c 1 - ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c @@ -2980,16 +5408,14 @@ nu_pkgs_nau88l25 - audio_test.c + acodec_nau88l25.c 1 - ..\libraries\nu_packages\AudioCodec\audio_test.c + ..\libraries\nu_packages\AudioCodec\acodec_nau88l25.c - - - acodec_nau88l25.c + audio_test.c 1 - ..\libraries\nu_packages\AudioCodec\acodec_nau88l25.c + ..\libraries\nu_packages\AudioCodec\audio_test.c @@ -3001,8 +5427,6 @@ 1 ..\..\..\components\libc\posix\io\poll\poll.c - - select.c 1 @@ -3014,70 +5438,56 @@ rt_usbd - usbdevice_core.c + usbdevice.c 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c - - hid.c 1 ..\..\..\components\legacy\usb\usbdevice\class\hid.c - - - usbdevice.c + usbdevice_core.c 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c rt_usbh + + driver.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + + + mass.c + 1 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + hub.c 1 ..\..\..\components\legacy\usb\usbhost\core\hub.c - - udisk.c 1 ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - usbhost_core.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c - - - - mass.c - 1 - ..\..\..\components\legacy\usb\usbhost\class\mass.c - - - usbhost.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost.c - - - driver.c - 1 - ..\..\..\components\legacy\usb\usbhost\core\driver.c - - SAL @@ -3087,50 +5497,36 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_at.c 1 ..\..\..\components\net\sal\impl\af_inet_at.c - - af_inet_lwip.c 1 ..\..\..\components\net\sal\impl\af_inet_lwip.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -3142,32 +5538,35 @@ UTest - TC_uassert.c + utest.c 1 - ..\..\..\components\utilities\utest\TC_uassert.c + ..\..\..\components\utilities\utest\utest.c - - - utest.c + TC_uassert.c 1 - ..\..\..\components\utilities\utest\utest.c + ..\..\..\components\utilities\utest\TC_uassert.c + + ::CMSIS + + - + - - + + - + - + +
diff --git a/bsp/nuvoton/numaker-m032ki/project.uvoptx b/bsp/nuvoton/numaker-m032ki/project.uvoptx new file mode 100644 index 00000000000..850f005e80c --- /dev/null +++ b/bsp/nuvoton/numaker-m032ki/project.uvoptx @@ -0,0 +1,1900 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread-m031 + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\keil5\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 6 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + + + + + + + + + + + BIN\UL2CM3.DLL + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FCC000 -FN1 -FF0M031_AP_512 -FS00 -FL080000 -FP0($$Device:M032KIAAE$Flash\M031_AP_512.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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + + + board + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + board\NuClockConfig\nutool_modclkcfg.c + nutool_modclkcfg.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + board\NuPinConfig\nutool_pincfg.c + nutool_pincfg.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\lptimer.c + lptimer.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\pm.c + pm.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 5 + 33 + 2 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\Device\Nuvoton\M031\Source\ARM\startup_M031Series.s + startup_M031Series.s + 0 + 0 + + + 5 + 34 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\Device\Nuvoton\M031\Source\system_M031Series.c + system_M031Series.c + 0 + 0 + + + 5 + 35 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_adc.c + drv_adc.c + 0 + 0 + + + 5 + 36 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_bpwm.c + drv_bpwm.c + 0 + 0 + + + 5 + 37 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_bpwm_capture.c + drv_bpwm_capture.c + 0 + 0 + + + 5 + 38 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_clk.c + drv_clk.c + 0 + 0 + + + 5 + 39 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 5 + 40 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_crc.c + drv_crc.c + 0 + 0 + + + 5 + 41 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 5 + 42 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 5 + 43 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_fmc.c + drv_fmc.c + 0 + 0 + + + 5 + 44 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 5 + 45 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 5 + 46 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 5 + 47 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_pwm.c + drv_pwm.c + 0 + 0 + + + 5 + 48 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_pwm_capture.c + drv_pwm_capture.c + 0 + 0 + + + 5 + 49 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 5 + 50 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 5 + 51 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 5 + 52 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 5 + 53 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_spii2s.c + drv_spii2s.c + 0 + 0 + + + 5 + 54 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_timer.c + drv_timer.c + 0 + 0 + + + 5 + 55 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_timer_capture.c + drv_timer_capture.c + 0 + 0 + + + 5 + 56 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 5 + 57 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_ui2c.c + drv_ui2c.c + 0 + 0 + + + 5 + 58 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 5 + 59 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_uspi.c + drv_uspi.c + 0 + 0 + + + 5 + 60 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_uuart.c + drv_uuart.c + 0 + 0 + + + 5 + 61 + 1 + 0 + 0 + 0 + ..\libraries\m031\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 6 + 62 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 6 + 63 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + dfs.c + 0 + 0 + + + 6 + 64 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 6 + 65 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 6 + 66 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 7 + 67 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + 7 + 68 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 7 + 69 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 7 + 70 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 7 + 71 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 8 + 72 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 8 + 73 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 8 + 74 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 8 + 75 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 8 + 76 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 8 + 77 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 8 + 78 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 8 + 79 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 8 + 80 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 8 + 81 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 8 + 82 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 8 + 83 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 8 + 84 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 8 + 85 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 8 + 86 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 9 + 87 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 9 + 88 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + 9 + 89 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 9 + 90 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + 9 + 91 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 10 + 92 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 10 + 93 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + 10 + 94 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m0\context_rvds.S + context_rvds.S + 0 + 0 + + + 10 + 95 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m0\cpuport.c + cpuport.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 11 + 96 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_fmc.c + nu_fmc.c + 0 + 0 + + + 11 + 97 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 11 + 98 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_bpwm.c + nu_bpwm.c + 0 + 0 + + + 11 + 99 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 11 + 100 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_uart.c + nu_uart.c + 0 + 0 + + + 11 + 101 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_clk.c + nu_clk.c + 0 + 0 + + + 11 + 102 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_sys.c + nu_sys.c + 0 + 0 + + + 11 + 103 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_pwm.c + nu_pwm.c + 0 + 0 + + + 11 + 104 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 11 + 105 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 11 + 106 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 11 + 107 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_adc.c + nu_adc.c + 0 + 0 + + + 11 + 108 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 11 + 109 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_spi.c + nu_spi.c + 0 + 0 + + + 11 + 110 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 11 + 111 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_timer.c + nu_timer.c + 0 + 0 + + + 11 + 112 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usci_spi.c + nu_usci_spi.c + 0 + 0 + + + 11 + 113 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_qspi.c + nu_qspi.c + 0 + 0 + + + 11 + 114 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_crc.c + nu_crc.c + 0 + 0 + + + 11 + 115 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usci_uart.c + nu_usci_uart.c + 0 + 0 + + + 11 + 116 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 11 + 117 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_acmp.c + nu_acmp.c + 0 + 0 + + + 11 + 118 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usci_i2c.c + nu_usci_i2c.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 12 + 119 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + 12 + 120 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 12 + 121 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + 12 + 122 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + 12 + 123 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + 12 + 124 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + 12 + 125 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 12 + 126 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 12 + 127 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 13 + 128 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 13 + 129 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\hid.c + hid.c + 0 + 0 + + + 13 + 130 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 14 + 131 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + 14 + 132 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + + + utestcases + 0 + 0 + 0 + 0 + + 15 + 133 + 1 + 0 + 0 + 0 + ..\..\..\examples\utest\testcases\kernel\mem_tc.c + mem_tc.c + 0 + 0 + + + 15 + 134 + 1 + 0 + 0 + 0 + ..\..\..\examples\utest\testcases\utest\pass_tc.c + pass_tc.c + 0 + 0 + + + +
diff --git a/bsp/nuvoton/numaker-m032ki/project.uvprojx b/bsp/nuvoton/numaker-m032ki/project.uvprojx index cbaf917a90a..24c12cd0607 100644 --- a/bsp/nuvoton/numaker-m032ki/project.uvprojx +++ b/bsp/nuvoton/numaker-m032ki/project.uvprojx @@ -1,44 +1,47 @@ + 2.1 +
### uVision Project, (C) Keil Software
+ rtthread-m031 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC - 5060750::V5.06 update 6 (build 750)::ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 M032KIAAE Nuvoton - Nuvoton.NuMicro_DFP.1.3.10 - http://www.nuvoton.com/hq/enu/Documents/KEILSoftwarePack + Nuvoton.NuMicro_DFP.1.3.25 + https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x18000) IROM(0x00000000,0x80000) CPUTYPE("Cortex-M0") CLOCK(12000000) - - + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M031_AP_512 -FS00 -FL080000 -FP0($$Device:M032KIAAE$Flash\M031_AP_512.FLM)) 0 $$Device:M032KIAAE$Device\M031\Include\M031Series.h - - - - - - - - - + + + + + + + + + $$Device:M032KIAAE$SVD\Nuvoton\M031AE_v1.svd 0 0 - - - - - + + + + + 0 0 @@ -60,8 +63,8 @@ 0 0 - - + + 0 0 0 @@ -70,8 +73,8 @@ 0 0 - - + + 0 0 0 @@ -88,7 +91,7 @@ 0 1 - + 0 @@ -102,8 +105,8 @@ 0 0 3 - - + + 1 @@ -135,12 +138,12 @@ 4103 1 - NULink\Nu_Link.dll + BIN\UL2CM3.DLL "" () - - - - + + + + 0 @@ -173,7 +176,7 @@ 0 0 "Cortex-M0" - + 0 0 0 @@ -183,6 +186,8 @@ 0 0 0 + 0 + 0 0 0 8 @@ -306,11 +311,11 @@ 0x0 - + 1 - 1 + 2 0 0 1 @@ -325,18 +330,18 @@ 1 0 0 - 5 + 3 3 - 0 - 0 + 1 + 1 0 1 0 - - __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__, __STDC_LIMIT_MACROS, RT_USING_LIBC, RT_USING_ARMLIBC - - ..\..\..\components\libc\posix\io\poll;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\libc\compilers\common\include;..\..\..\examples\utest\testcases\drivers\ipc;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\libraries\nu_packages\TPC;..\..\..\examples\utest\testcases\lwp;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\examples\utest\testcases\kernel;..\..\..\examples\utest\testcases\utest;..\..\..\components\utilities\utest;..\libraries\nu_packages\Demo;..\..\..\components\drivers\smp_call;.;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\phy;..\..\..\libcpu\arm\cortex-m0;..\..\..\examples\utest\testcases\smp_call;..\libraries\m031\Device\Nuvoton\M031\Include;..\libraries\m031\CMSIS\Include;..\..\..\examples\utest\testcases\kernel\smp;..\..\..\examples\utest\testcases\mm;board\NuClockConfig;board;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension;..\..\..\components\libc\posix\ipc;..\..\..\libcpu\arm\common;..\..\..\components\finsh;..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;..\..\..\examples\utest\testcases\tmpfs;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\libc\compilers\common\extension\fcntl\octal;applications;..\libraries\m031\StdDriver\inc;..\..\..\include;..\libraries\m031\rtt_port;board\NuPinConfig + + __CLK_TCK=RT_TICK_PER_SECOND, __STDC_LIMIT_MACROS, __RTTHREAD__, RT_USING_LIBC, RT_USING_ARMLIBC + + ..\..\..\components\dfs\dfs_v1\include;..\..\..\examples\utest\testcases\drivers\ipc;..\..\..\components\drivers\include;..\..\..\components\drivers\include;applications;..\..\..\examples\utest\testcases\kernel;..\..\..\components\drivers\include;..\..\..\components\finsh;..\libraries\nu_packages\NuUtils\inc;..\..\..\examples\utest\testcases\lwp;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\libc\compilers\common\include;..\..\..\components\drivers\include;..\..\..\examples\utest\testcases\mm;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\devfs;.;packages\nuvoton-series-latest\M031\StdDriver\inc;..\..\..\components\libc\posix\io\eventfd;packages\nuvoton-cmsis-latest\m031_m480_ma35\Include;..\..\..\components\drivers\include;..\..\..\components\utilities\utest;..\..\..\components\drivers\include;..\libraries\nu_packages\TPC;..\..\..\components\libc\compilers\common\extension;..\..\..\examples\utest\testcases\utest;..\..\..\libcpu\arm\cortex-m0;..\..\..\examples\utest\testcases\kernel\smp;..\..\..\examples\utest\testcases\smp_call;..\..\..\components\drivers\phy;board\NuClockConfig;..\libraries\m031\rtt_port;..\..\..\components\libc\posix\io\poll;..\..\..\libcpu\arm\common;..\..\..\components\legacy\usb\usbdevice;packages\nuvoton-series-latest\M031\Device\Nuvoton\M031\Include;..\..\..\include;..\..\..\components\libc\posix\ipc;..\..\..\examples\utest\testcases\tmpfs;board\NuPinConfig;..\libraries\nu_packages\Demo;board;..\..\..\components\drivers\smp_call;..\..\..\components\drivers\include @@ -349,12 +354,12 @@ 1 0 0 - 0 + 4 - - - - + + + + @@ -366,13 +371,13 @@ 0 0x00000000 0x20000000 - + .\linking_scripts\m031_flash.sct - - - - - + + + + + @@ -381,16 +386,14 @@ Applications - main.c + mnt.c 1 - applications\main.c + applications\mnt.c - - - mnt.c + main.c 1 - applications\mnt.c + applications\main.c @@ -402,19 +405,15 @@ 1 board\NuClockConfig\nutool_modclkcfg.c - - - board_dev.c + nutool_pincfg.c 1 - board\board_dev.c + board\NuPinConfig\nutool_pincfg.c - - - nutool_pincfg.c + board_dev.c 1 - board\NuPinConfig\nutool_pincfg.c + board\board_dev.c @@ -426,50 +425,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -485,355 +470,1060 @@ 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - adc.c 1 ..\..\..\components\drivers\misc\adc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - lptimer.c 1 ..\..\..\components\drivers\pm\lptimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - pm.c 1 ..\..\..\components\drivers\pm\pm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_IPC_SOURCE__ - + @@ -847,199 +1537,143 @@ startup_M031Series.s 2 - ..\libraries\m031\Device\Nuvoton\M031\Source\ARM\startup_M031Series.s + packages\nuvoton-series-latest\M031\Device\Nuvoton\M031\Source\ARM\startup_M031Series.s - - system_M031Series.c 1 - ..\libraries\m031\Device\Nuvoton\M031\Source\system_M031Series.c + packages\nuvoton-series-latest\M031\Device\Nuvoton\M031\Source\system_M031Series.c - - drv_adc.c 1 ..\libraries\m031\rtt_port\drv_adc.c - - drv_bpwm.c 1 ..\libraries\m031\rtt_port\drv_bpwm.c - - drv_bpwm_capture.c 1 ..\libraries\m031\rtt_port\drv_bpwm_capture.c - - drv_clk.c 1 ..\libraries\m031\rtt_port\drv_clk.c - - drv_common.c 1 ..\libraries\m031\rtt_port\drv_common.c - - drv_crc.c 1 ..\libraries\m031\rtt_port\drv_crc.c - - drv_crypto.c 1 ..\libraries\m031\rtt_port\drv_crypto.c - - drv_ebi.c 1 ..\libraries\m031\rtt_port\drv_ebi.c - - drv_fmc.c 1 ..\libraries\m031\rtt_port\drv_fmc.c - - drv_gpio.c 1 ..\libraries\m031\rtt_port\drv_gpio.c - - drv_i2c.c 1 ..\libraries\m031\rtt_port\drv_i2c.c - - drv_pdma.c 1 ..\libraries\m031\rtt_port\drv_pdma.c - - drv_pwm.c 1 ..\libraries\m031\rtt_port\drv_pwm.c - - drv_pwm_capture.c 1 ..\libraries\m031\rtt_port\drv_pwm_capture.c - - drv_qspi.c 1 ..\libraries\m031\rtt_port\drv_qspi.c - - drv_rtc.c 1 ..\libraries\m031\rtt_port\drv_rtc.c - - drv_softi2c.c 1 ..\libraries\m031\rtt_port\drv_softi2c.c - - drv_spi.c 1 ..\libraries\m031\rtt_port\drv_spi.c - - drv_spii2s.c 1 ..\libraries\m031\rtt_port\drv_spii2s.c - - drv_timer.c 1 ..\libraries\m031\rtt_port\drv_timer.c - - drv_timer_capture.c 1 ..\libraries\m031\rtt_port\drv_timer_capture.c - - drv_uart.c 1 ..\libraries\m031\rtt_port\drv_uart.c - - drv_ui2c.c 1 ..\libraries\m031\rtt_port\drv_ui2c.c - - drv_usbd.c 1 ..\libraries\m031\rtt_port\drv_usbd.c - - drv_uspi.c 1 ..\libraries\m031\rtt_port\drv_uspi.c - - drv_uuart.c 1 ..\libraries\m031\rtt_port\drv_uuart.c - - drv_wdt.c 1 @@ -1055,89 +1689,276 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + @@ -1149,37 +1970,29 @@ Finsh - msh_file.c + msh_parse.c 1 - ..\..\..\components\finsh\msh_file.c + ..\..\..\components\finsh\msh_parse.c - - - cmd.c + msh.c 1 - ..\..\..\components\finsh\cmd.c + ..\..\..\components\finsh\msh.c - - - msh_parse.c + msh_file.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\msh_file.c - - - shell.c + cmd.c 1 - ..\..\..\components\finsh\shell.c + ..\..\..\components\finsh\cmd.c - - - msh.c + shell.c 1 - ..\..\..\components\finsh\msh.c + ..\..\..\components\finsh\shell.c @@ -1191,279 +2004,836 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + @@ -1475,37 +2845,29 @@ klibc - kstring.c + kerrno.c 1 - ..\..\..\src\klibc\kstring.c + ..\..\..\src\klibc\kerrno.c + + + rt_vsnprintf_tiny.c + 1 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c - - kstdio.c 1 ..\..\..\src\klibc\kstdio.c - - rt_vsscanf.c 1 ..\..\..\src\klibc\rt_vsscanf.c - - - kerrno.c - 1 - ..\..\..\src\klibc\kerrno.c - - - - - rt_vsnprintf_tiny.c + kstring.c 1 - ..\..\..\src\klibc\rt_vsnprintf_tiny.c + ..\..\..\src\klibc\kstring.c @@ -1517,22 +2879,16 @@ 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 ..\..\..\libcpu\arm\common\showmem.c - - context_rvds.S 2 ..\..\..\libcpu\arm\cortex-m0\context_rvds.S - - cpuport.c 1 @@ -1544,163 +2900,119 @@ Libraries - nu_pwm.c + nu_fmc.c 1 - ..\libraries\m031\StdDriver\src\nu_pwm.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_fmc.c - - - nu_pdma.c + nu_wdt.c 1 - ..\libraries\m031\StdDriver\src\nu_pdma.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_wdt.c - - - nu_qspi.c + nu_bpwm.c 1 - ..\libraries\m031\StdDriver\src\nu_qspi.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_bpwm.c - - - nu_i2c.c + nu_rtc.c 1 - ..\libraries\m031\StdDriver\src\nu_i2c.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_rtc.c - - nu_uart.c 1 - ..\libraries\m031\StdDriver\src\nu_uart.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_uart.c - - - nu_adc.c + nu_clk.c 1 - ..\libraries\m031\StdDriver\src\nu_adc.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_clk.c - - - nu_wwdt.c + nu_sys.c 1 - ..\libraries\m031\StdDriver\src\nu_wwdt.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_sys.c - - - nu_rtc.c + nu_pwm.c 1 - ..\libraries\m031\StdDriver\src\nu_rtc.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_pwm.c - - nu_usbd.c 1 - ..\libraries\m031\StdDriver\src\nu_usbd.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usbd.c - - - nu_usci_uart.c + nu_gpio.c 1 - ..\libraries\m031\StdDriver\src\nu_usci_uart.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_gpio.c - - - nu_gpio.c + nu_wwdt.c 1 - ..\libraries\m031\StdDriver\src\nu_gpio.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_wwdt.c - - - nu_ebi.c + nu_adc.c 1 - ..\libraries\m031\StdDriver\src\nu_ebi.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_adc.c - - - nu_usci_i2c.c + nu_pdma.c 1 - ..\libraries\m031\StdDriver\src\nu_usci_i2c.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_pdma.c - - - nu_bpwm.c + nu_spi.c 1 - ..\libraries\m031\StdDriver\src\nu_bpwm.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_spi.c - - - nu_sys.c + nu_i2c.c 1 - ..\libraries\m031\StdDriver\src\nu_sys.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_i2c.c - - - nu_wdt.c + nu_timer.c 1 - ..\libraries\m031\StdDriver\src\nu_wdt.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_timer.c - - - nu_crc.c + nu_usci_spi.c 1 - ..\libraries\m031\StdDriver\src\nu_crc.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usci_spi.c - - - nu_usci_spi.c + nu_qspi.c 1 - ..\libraries\m031\StdDriver\src\nu_usci_spi.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_qspi.c - - - nu_acmp.c + nu_crc.c 1 - ..\libraries\m031\StdDriver\src\nu_acmp.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_crc.c - - - nu_clk.c + nu_usci_uart.c 1 - ..\libraries\m031\StdDriver\src\nu_clk.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usci_uart.c - - - nu_timer.c + nu_ebi.c 1 - ..\libraries\m031\StdDriver\src\nu_timer.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_ebi.c - - - nu_spi.c + nu_acmp.c 1 - ..\libraries\m031\StdDriver\src\nu_spi.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_acmp.c - - - nu_fmc.c + nu_usci_i2c.c 1 - ..\libraries\m031\StdDriver\src\nu_fmc.c + packages\nuvoton-series-latest\M031\StdDriver\src\nu_usci_i2c.c @@ -1708,65 +3020,49 @@ nu_pkgs_demo - smp_demo.c + hwsem_counter.c 1 - ..\libraries\nu_packages\Demo\smp_demo.c + ..\libraries\nu_packages\Demo\hwsem_counter.c + + + ccap_saver.c + 1 + ..\libraries\nu_packages\Demo\ccap_saver.c - - atdev_utils.c 1 ..\libraries\nu_packages\Demo\atdev_utils.c - - - wormhole_demo.c + usbd_cdc_vcom_echo.c 1 - ..\libraries\nu_packages\Demo\wormhole_demo.c + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c - - slcd_show_tick.c 1 ..\libraries\nu_packages\Demo\slcd_show_tick.c - - ccap_demo.c 1 ..\libraries\nu_packages\Demo\ccap_demo.c - - - ccap_saver.c - 1 - ..\libraries\nu_packages\Demo\ccap_saver.c - - - - - hwsem_counter.c + usbd_hid_dance_mouse.c 1 - ..\libraries\nu_packages\Demo\hwsem_counter.c + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c - - - usbd_cdc_vcom_echo.c + smp_demo.c 1 - ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + ..\libraries\nu_packages\Demo\smp_demo.c - - - usbd_hid_dance_mouse.c + wormhole_demo.c 1 - ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + ..\libraries\nu_packages\Demo\wormhole_demo.c @@ -1778,15 +3074,11 @@ 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c - - hid.c 1 ..\..\..\components\legacy\usb\usbdevice\class\hid.c - - usbdevice.c 1 @@ -1798,16 +3090,14 @@ UTest - utest.c + TC_uassert.c 1 - ..\..\..\components\utilities\utest\utest.c + ..\..\..\components\utilities\utest\TC_uassert.c - - - TC_uassert.c + utest.c 1 - ..\..\..\components\utilities\utest\TC_uassert.c + ..\..\..\components\utilities\utest\utest.c @@ -1819,8 +3109,6 @@ 1 ..\..\..\examples\utest\testcases\kernel\mem_tc.c - - pass_tc.c 1 @@ -1831,9 +3119,20 @@ + - - - + + + + + + + + project + 1 + + + +
diff --git a/bsp/nuvoton/numaker-m2354/project.uvoptx b/bsp/nuvoton/numaker-m2354/project.uvoptx new file mode 100644 index 00000000000..1780fbee3ca --- /dev/null +++ b/bsp/nuvoton/numaker-m2354/project.uvoptx @@ -0,0 +1,3096 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread-m2354 + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\keil5\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 6 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 13 + + + + + + + + + + + BIN\UL2V8M.DLL + + + + 0 + UL2V8M + UL2V8M(-S0 -C0 -P0 -FD20000000 -FC4000 -FN2 -FF0M2354_AP_1M -FS00 -FL0100000 -FF1M2354_NS -FS110000000 -FL1100000 -FP0($$Device:M2354KJFAE$Flash\M2354_AP_1M.FLM) -FP1($$Device:M2354KJFAE$Flash\M2354_NS.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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + + + AT + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_cli.c + at_cli.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_utils.c + at_utils.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\at_socket\at_socket.c + at_socket.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\net\at\src\at_client.c + at_client.c + 0 + 0 + + + + + at_device + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + packages\at_device-latest\src\at_device.c + at_device.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + packages\at_device-latest\samples\at_sample_esp8266.c + at_sample_esp8266.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + packages\at_device-latest\class\esp8266\at_socket_esp8266.c + at_socket_esp8266.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + packages\at_device-latest\class\esp8266\at_device_esp8266.c + at_device_esp8266.c + 0 + 0 + + + + + board + 0 + 0 + 0 + 0 + + 4 + 11 + 1 + 0 + 0 + 0 + board\NuPinConfig\nutool_pincfg.c + nutool_pincfg.c + 0 + 0 + + + 4 + 12 + 1 + 0 + 0 + 0 + board\NuClockConfig\nutool_modclkcfg.c + nutool_modclkcfg.c + 0 + 0 + + + 4 + 13 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 5 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 5 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 6 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk.c + blk.c + 0 + 0 + + + 6 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dev.c + blk_dev.c + 0 + 0 + + + 6 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dfs.c + blk_dfs.c + 0 + 0 + + + 6 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_partition.c + blk_partition.c + 0 + 0 + + + 6 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\dfs.c + dfs.c + 0 + 0 + + + 6 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\efi.c + efi.c + 0 + 0 + + + 6 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 6 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 6 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_crc.c + hw_crc.c + 0 + 0 + + + 6 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 6 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 6 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 6 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 6 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 6 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 6 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 6 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 6 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 6 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 6 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 6 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 6 + 46 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 6 + 47 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 6 + 48 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 6 + 49 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 6 + 50 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 6 + 51 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 6 + 52 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 6 + 53 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\lptimer.c + lptimer.c + 0 + 0 + + + 6 + 54 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\pm.c + pm.c + 0 + 0 + + + 6 + 55 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 6 + 56 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_block.c + dev_block.c + 0 + 0 + + + 6 + 57 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmc.c + dev_mmc.c + 0 + 0 + + + 6 + 58 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + dev_mmcsd_core.c + 0 + 0 + + + 6 + 59 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sd.c + dev_sd.c + 0 + 0 + + + 6 + 60 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sdio.c + dev_sdio.c + 0 + 0 + + + 6 + 61 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v1\sensor.c + sensor.c + 0 + 0 + + + 6 + 62 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v1\sensor_cmd.c + sensor_cmd.c + 0 + 0 + + + 6 + 63 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 6 + 64 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 6 + 65 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 6 + 66 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 6 + 67 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + dev_spi_flash_sfud.c + 0 + 0 + + + 6 + 68 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud.c + sfud.c + 0 + 0 + + + 6 + 69 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + sfud_sfdp.c + 0 + 0 + + + 6 + 70 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 7 + 71 + 2 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\Device\Nuvoton\M2354\Source\ARM\startup_M2354.s + startup_M2354.s + 0 + 0 + + + 7 + 72 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\Device\Nuvoton\M2354\Source\system_M2354.c + system_M2354.c + 0 + 0 + + + 7 + 73 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_bpwm.c + drv_bpwm.c + 0 + 0 + + + 7 + 74 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_bpwm_capture.c + drv_bpwm_capture.c + 0 + 0 + + + 7 + 75 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_can.c + drv_can.c + 0 + 0 + + + 7 + 76 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_clk.c + drv_clk.c + 0 + 0 + + + 7 + 77 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 7 + 78 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_crc.c + drv_crc.c + 0 + 0 + + + 7 + 79 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 7 + 80 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_eadc.c + drv_eadc.c + 0 + 0 + + + 7 + 81 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 7 + 82 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_ecap.c + drv_ecap.c + 0 + 0 + + + 7 + 83 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_epwm.c + drv_epwm.c + 0 + 0 + + + 7 + 84 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_epwm_capture.c + drv_epwm_capture.c + 0 + 0 + + + 7 + 85 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_fmc.c + drv_fmc.c + 0 + 0 + + + 7 + 86 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 7 + 87 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 7 + 88 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 7 + 89 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_otg.c + drv_otg.c + 0 + 0 + + + 7 + 90 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 7 + 91 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_qei.c + drv_qei.c + 0 + 0 + + + 7 + 92 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 7 + 93 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 7 + 94 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 7 + 95 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 7 + 96 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_sdio.c + drv_sdio.c + 0 + 0 + + + 7 + 97 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_slcd.c + drv_slcd.c + 0 + 0 + + + 7 + 98 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 7 + 99 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 7 + 100 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_spii2s.c + drv_spii2s.c + 0 + 0 + + + 7 + 101 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_timer.c + drv_timer.c + 0 + 0 + + + 7 + 102 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_timer_capture.c + drv_timer_capture.c + 0 + 0 + + + 7 + 103 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_tpwm.c + drv_tpwm.c + 0 + 0 + + + 7 + 104 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_trng.c + drv_trng.c + 0 + 0 + + + 7 + 105 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 7 + 106 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_ui2c.c + drv_ui2c.c + 0 + 0 + + + 7 + 107 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 7 + 108 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 7 + 109 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_uspi.c + drv_uspi.c + 0 + 0 + + + 7 + 110 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_uuart.c + drv_uuart.c + 0 + 0 + + + 7 + 111 + 1 + 0 + 0 + 0 + ..\libraries\m2354\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + + + Fal + 0 + 0 + 0 + 0 + + 8 + 112 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_partition.c + fal_partition.c + 0 + 0 + + + 8 + 113 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_flash.c + fal_flash.c + 0 + 0 + + + 8 + 114 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal.c + fal.c + 0 + 0 + + + 8 + 115 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_rtt.c + fal_rtt.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 9 + 116 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 9 + 117 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 9 + 118 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 9 + 119 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 9 + 120 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + src_dfs.c + 0 + 0 + + + 9 + 121 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 9 + 122 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 9 + 123 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 10 + 124 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + 10 + 125 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 10 + 126 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 10 + 127 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 10 + 128 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 11 + 129 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 11 + 130 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 11 + 131 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 11 + 132 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 11 + 133 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 11 + 134 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 11 + 135 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 11 + 136 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 11 + 137 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 11 + 138 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 11 + 139 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 11 + 140 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 11 + 141 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 11 + 142 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 11 + 143 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 11 + 144 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 12 + 145 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 12 + 146 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + 12 + 147 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 12 + 148 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 12 + 149 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 13 + 150 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\atomic_arm.c + atomic_arm.c + 0 + 0 + + + 13 + 151 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 13 + 152 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + 13 + 153 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m23\context_rvds.S + context_rvds.S + 0 + 0 + + + 13 + 154 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m23\cpuport.c + cpuport.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 14 + 155 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 14 + 156 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_epwm.c + nu_epwm.c + 0 + 0 + + + 14 + 157 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_uart.c + nu_uart.c + 0 + 0 + + + 14 + 158 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 14 + 159 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 14 + 160 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_acmp.c + nu_acmp.c + 0 + 0 + + + 14 + 161 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ecap.c + nu_ecap.c + 0 + 0 + + + 14 + 162 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_rng.c + nu_rng.c + 0 + 0 + + + 14 + 163 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_timer_pwm.c + nu_timer_pwm.c + 0 + 0 + + + 14 + 164 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_can.c + nu_can.c + 0 + 0 + + + 14 + 165 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ewwdt.c + nu_ewwdt.c + 0 + 0 + + + 14 + 166 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_dac.c + nu_dac.c + 0 + 0 + + + 14 + 167 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_tamper.c + nu_tamper.c + 0 + 0 + + + 14 + 168 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_timer.c + nu_timer.c + 0 + 0 + + + 14 + 169 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_qspi.c + nu_qspi.c + 0 + 0 + + + 14 + 170 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 14 + 171 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 14 + 172 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_bpwm.c + nu_bpwm.c + 0 + 0 + + + 14 + 173 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_lcd.c + nu_lcd.c + 0 + 0 + + + 14 + 174 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 14 + 175 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_clk.c + nu_clk.c + 0 + 0 + + + 14 + 176 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_fvc.c + nu_fvc.c + 0 + 0 + + + 14 + 177 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_trng.c + nu_trng.c + 0 + 0 + + + 14 + 178 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_dpm.c + nu_dpm.c + 0 + 0 + + + 14 + 179 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_qei.c + nu_qei.c + 0 + 0 + + + 14 + 180 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 14 + 181 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usci_i2c.c + nu_usci_i2c.c + 0 + 0 + + + 14 + 182 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ewdt.c + nu_ewdt.c + 0 + 0 + + + 14 + 183 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 14 + 184 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_keystore.c + nu_keystore.c + 0 + 0 + + + 14 + 185 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_sys.c + nu_sys.c + 0 + 0 + + + 14 + 186 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 14 + 187 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_crc.c + nu_crc.c + 0 + 0 + + + 14 + 188 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 14 + 189 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_sc.c + nu_sc.c + 0 + 0 + + + 14 + 190 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 14 + 191 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usci_spi.c + nu_usci_spi.c + 0 + 0 + + + 14 + 192 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_eadc.c + nu_eadc.c + 0 + 0 + + + 14 + 193 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usci_uart.c + nu_usci_uart.c + 0 + 0 + + + 14 + 194 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_fmc.c + nu_fmc.c + 0 + 0 + + + 14 + 195 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_spi.c + nu_spi.c + 0 + 0 + + + 14 + 196 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_i2s.c + nu_i2s.c + 0 + 0 + + + + + m2354_usbhostlib + 0 + 0 + 0 + 0 + + 15 + 197 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\USBHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 15 + 198 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\USBHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + 15 + 199 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M2354\USBHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 16 + 200 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 16 + 201 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 16 + 202 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + 16 + 203 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 16 + 204 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + 16 + 205 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + 16 + 206 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + 16 + 207 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + 16 + 208 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + + + nu_pkgs_slcd + 0 + 0 + 0 + 0 + + 17 + 209 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\SLCD\slcd_rhe6616tp01.c + slcd_rhe6616tp01.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 18 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 18 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 19 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 19 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + 19 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\hid.c + hid.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 20 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 20 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 20 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 20 + 218 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + 20 + 219 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + 20 + 220 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 21 + 221 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 21 + 222 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 21 + 223 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 21 + 224 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_at.c + af_inet_at.c + 0 + 0 + + + 21 + 225 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 21 + 226 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 21 + 227 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 22 + 228 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + 22 + 229 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + +
diff --git a/bsp/nuvoton/numaker-m2354/project.uvprojx b/bsp/nuvoton/numaker-m2354/project.uvprojx index 4df80a8e2dd..fc79bd4fbfc 100644 --- a/bsp/nuvoton/numaker-m2354/project.uvprojx +++ b/bsp/nuvoton/numaker-m2354/project.uvprojx @@ -1,43 +1,46 @@ + 2.1 +
### uVision Project, (C) Keil Software
+ rtthread-m2354 0x4 ARM-ADS - 6100001::V6.10.1::.\ARMCLANG + 6220000::V6.22::ARMCLANG 1 M2354KJFAE Nuvoton - Nuvoton.NuMicro_DFP.1.3.10 - http://www.nuvoton.com/hq/enu/Documents/KEILSoftwarePack + Nuvoton.NuMicro_DFP.1.3.25 + https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x40000) IROM(0x00000000,0x100000) CPUTYPE("Cortex-M23") TZ CLOCK(12000000) ESEL ELITTLE - - + + UL2V8M(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M2354_AP_1M -FS00 -FL0100000 -FP0($$Device:M2354KJFAE$Flash\M2354_AP_1M.FLM)) 0 $$Device:M2354KJFAE$Device\M2354\Include\M2354.h - - - - - - - - - + + + + + + + + + $$Device:M2354KJFAE$SVD\Nuvoton\M2354.svd 0 0 - - - - - + + + + + 0 0 @@ -59,8 +62,8 @@ 0 0 - - + + 0 0 0 @@ -69,8 +72,8 @@ 0 0 - - + + 0 0 0 @@ -87,7 +90,7 @@ 0 1 - + 0 @@ -101,15 +104,15 @@ 0 0 3 - - + + 1 - - - - + + + + SARMV8M.DLL -MPU TCM.DLL @@ -136,10 +139,10 @@ 1 BIN\UL2V8M.DLL "" () - - - - + + + + 0 @@ -172,7 +175,7 @@ 0 0 "Cortex-M23" - + 0 0 0 @@ -182,6 +185,8 @@ 0 0 0 + 0 + 0 0 0 8 @@ -305,7 +310,7 @@ 0x0 - + 1 @@ -332,10 +337,10 @@ 1 0 - - RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_ARMLIBC, __STDC_LIMIT_MACROS, __RTTHREAD__ - - board\NuPinConfig;..\..\..\components\drivers\include;..\libraries\m2354\CMSIS\Include;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\include;.;..\..\..\components\finsh;..\..\..\components\drivers\spi;..\..\..\include;applications;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\smp_call;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\legacy\usb\usbhost;..\libraries\nu_packages\Demo;..\..\..\components\libc\compilers\common\extension;..\..\..\components\drivers\include;..\..\..\components\utilities\utest;..\..\..\components\net\sal\impl;..\libraries\m2354\StdDriver\inc;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board\NuClockConfig;..\..\..\components\drivers\sdio\sdhci\include;..\libraries\m2354\USBHostLib\inc;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\drivers\phy;..\libraries\m2354\rtt_port;..\..\..\libcpu\arm\common;..\..\..\components\libc\posix\ipc;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\legacy\usb\usbhost\core;board;..\..\..\components\fal\inc;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\net\sal\include;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\compilers\common\include;..\..\..\components\net\sal\include\socket;..\..\..\components\drivers\include;..\..\..\components\net\at\at_socket;..\..\..\components\drivers\include;..\libraries\m2354\Device\Nuvoton\M2354\Include;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\drivers\spi\sfud\inc;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\net\netdev\include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\legacy\include;..\..\..\components\drivers\include;..\..\..\components\drivers\hwcrypto;..\..\..\libcpu\arm\cortex-m23;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbdevice;..\libraries\nu_packages\SLCD;..\libraries\nu_packages\TPC;..\..\..\components\net\at\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include + + __STDC_LIMIT_MACROS, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_ARMLIBC, __RTTHREAD__, RT_USING_LIBC + + ..\..\..\components\finsh;board;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\..\..\components\drivers\phy;.;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\drivers\include;..\libraries\nu_packages\SLCD;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\utilities\utest;..\..\..\components\net\sal\include\socket;..\..\..\components\libc\posix\ipc;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\spi;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\drivers\include;..\..\..\include;..\..\..\components\net\sal\include;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\hwcrypto;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\libcpu\arm\cortex-m23;..\..\..\components\fal\inc;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\include;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\legacy\include;..\libraries\nu_packages\TPC;board\NuClockConfig;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\include;packages\nuvoton-series-latest\M2354\USBHostLib\inc;..\..\..\components\drivers\include;board\NuPinConfig;..\..\..\components\drivers\smp_call;..\libraries\m2354\rtt_port;packages\nuvoton-series-latest\M2354\Device\Nuvoton\M2354\Include;..\..\..\components\legacy\usb\usbhost;..\..\..\components\net\sal\impl;..\libraries\nu_packages\Demo;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;packages\nuvoton-cmsis-latest\m460_m2354\Include;..\..\..\components\drivers\include;..\..\..\components\net\at\at_socket;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\libcpu\arm\common;applications;..\..\..\components\net\at\include;packages\at_device-latest\inc;..\..\..\components\libc\compilers\common\extension;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\net\netdev\include;packages\at_device-latest\class\esp8266;..\..\..\components\libc\compilers\common\extension\fcntl\octal;packages\nuvoton-series-latest\M2354\StdDriver\inc;..\libraries\nu_packages\NuUtils\inc @@ -348,12 +353,12 @@ 1 0 0 - 0 + 4 - - - - + + + + @@ -365,13 +370,13 @@ 0 0x00000000 0x20000000 - + .\linking_scripts\m2354_flash.sct - - - - - + + + + + @@ -380,47 +385,64 @@ Applications - mnt.c + main.c 1 - applications\mnt.c + applications\main.c - - - main.c + mnt.c 1 - applications\main.c + applications\mnt.c AT + + at_cli.c + 1 + ..\..\..\components\net\at\src\at_cli.c + at_utils.c 1 ..\..\..\components\net\at\src\at_utils.c - - + + at_socket.c + 1 + ..\..\..\components\net\at\at_socket\at_socket.c + at_client.c 1 ..\..\..\components\net\at\src\at_client.c + + + at_device - at_cli.c + at_device.c 1 - ..\..\..\components\net\at\src\at_cli.c + packages\at_device-latest\src\at_device.c - - - at_socket.c + at_sample_esp8266.c 1 - ..\..\..\components\net\at\at_socket\at_socket.c + packages\at_device-latest\samples\at_sample_esp8266.c + + + at_socket_esp8266.c + 1 + packages\at_device-latest\class\esp8266\at_socket_esp8266.c + + + at_device_esp8266.c + 1 + packages\at_device-latest\class\esp8266\at_device_esp8266.c @@ -428,19 +450,15 @@ board - nutool_modclkcfg.c + nutool_pincfg.c 1 - board\NuClockConfig\nutool_modclkcfg.c + board\NuPinConfig\nutool_pincfg.c - - - nutool_pincfg.c + nutool_modclkcfg.c 1 - board\NuPinConfig\nutool_pincfg.c + board\NuClockConfig\nutool_modclkcfg.c - - board_dev.c 1 @@ -456,50 +474,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -515,925 +519,2740 @@ 1 ..\..\..\components\drivers\audio\dev_audio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_audio_pipe.c 1 ..\..\..\components\drivers\audio\dev_audio_pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - blk.c 1 ..\..\..\components\drivers\block\blk.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - blk_dev.c 1 ..\..\..\components\drivers\block\blk_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - blk_dfs.c 1 ..\..\..\components\drivers\block\blk_dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - blk_partition.c 1 ..\..\..\components\drivers\block\blk_partition.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dfs.c 1 ..\..\..\components\drivers\block\partitions\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - efi.c 1 ..\..\..\components\drivers\block\partitions\efi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_can.c 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - hw_crc.c 1 ..\..\..\components\drivers\hwcrypto\hw_crc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - hw_hash.c 1 ..\..\..\components\drivers\hwcrypto\hw_hash.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - hw_rng.c 1 ..\..\..\components\drivers\hwcrypto\hw_rng.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - hw_symmetric.c 1 ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - hwcrypto.c 1 ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - adc.c 1 ..\..\..\components\drivers\misc\adc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - lptimer.c 1 ..\..\..\components\drivers\pm\lptimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - pm.c 1 ..\..\..\components\drivers\pm\pm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_block.c 1 ..\..\..\components\drivers\sdio\dev_block.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_mmc.c 1 ..\..\..\components\drivers\sdio\dev_mmc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_mmcsd_core.c 1 ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_sd.c 1 ..\..\..\components\drivers\sdio\dev_sd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_sdio.c 1 ..\..\..\components\drivers\sdio\dev_sdio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - sensor.c 1 ..\..\..\components\drivers\sensor\v1\sensor.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - sensor_cmd.c 1 ..\..\..\components\drivers\sensor\v1\sensor_cmd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_spi_flash_sfud.c 1 ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - sfud.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - sfud_sfdp.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 __RT_IPC_SOURCE__ - + @@ -1447,283 +3266,203 @@ startup_M2354.s 2 - ..\libraries\m2354\Device\Nuvoton\M2354\Source\ARM\startup_M2354.s + packages\nuvoton-series-latest\M2354\Device\Nuvoton\M2354\Source\ARM\startup_M2354.s - - system_M2354.c 1 - ..\libraries\m2354\Device\Nuvoton\M2354\Source\system_M2354.c + packages\nuvoton-series-latest\M2354\Device\Nuvoton\M2354\Source\system_M2354.c - - drv_bpwm.c 1 ..\libraries\m2354\rtt_port\drv_bpwm.c - - drv_bpwm_capture.c 1 ..\libraries\m2354\rtt_port\drv_bpwm_capture.c - - drv_can.c 1 ..\libraries\m2354\rtt_port\drv_can.c - - drv_clk.c 1 ..\libraries\m2354\rtt_port\drv_clk.c - - drv_common.c 1 ..\libraries\m2354\rtt_port\drv_common.c - - drv_crc.c 1 ..\libraries\m2354\rtt_port\drv_crc.c - - drv_crypto.c 1 ..\libraries\m2354\rtt_port\drv_crypto.c - - drv_eadc.c 1 ..\libraries\m2354\rtt_port\drv_eadc.c - - drv_ebi.c 1 ..\libraries\m2354\rtt_port\drv_ebi.c - - drv_ecap.c 1 ..\libraries\m2354\rtt_port\drv_ecap.c - - drv_epwm.c 1 ..\libraries\m2354\rtt_port\drv_epwm.c - - drv_epwm_capture.c 1 ..\libraries\m2354\rtt_port\drv_epwm_capture.c - - drv_fmc.c 1 ..\libraries\m2354\rtt_port\drv_fmc.c - - drv_gpio.c 1 ..\libraries\m2354\rtt_port\drv_gpio.c - - drv_i2c.c 1 ..\libraries\m2354\rtt_port\drv_i2c.c - - drv_i2s.c 1 ..\libraries\m2354\rtt_port\drv_i2s.c - - drv_otg.c 1 ..\libraries\m2354\rtt_port\drv_otg.c - - drv_pdma.c 1 ..\libraries\m2354\rtt_port\drv_pdma.c - - drv_qei.c 1 ..\libraries\m2354\rtt_port\drv_qei.c - - drv_qspi.c 1 ..\libraries\m2354\rtt_port\drv_qspi.c - - drv_rtc.c 1 ..\libraries\m2354\rtt_port\drv_rtc.c - - drv_scuart.c 1 ..\libraries\m2354\rtt_port\drv_scuart.c - - drv_sdh.c 1 ..\libraries\m2354\rtt_port\drv_sdh.c - - drv_sdio.c 1 ..\libraries\m2354\rtt_port\drv_sdio.c - - drv_slcd.c 1 ..\libraries\m2354\rtt_port\drv_slcd.c - - drv_softi2c.c 1 ..\libraries\m2354\rtt_port\drv_softi2c.c - - drv_spi.c 1 ..\libraries\m2354\rtt_port\drv_spi.c - - drv_spii2s.c 1 ..\libraries\m2354\rtt_port\drv_spii2s.c - - drv_timer.c 1 ..\libraries\m2354\rtt_port\drv_timer.c - - drv_timer_capture.c 1 ..\libraries\m2354\rtt_port\drv_timer_capture.c - - drv_tpwm.c 1 ..\libraries\m2354\rtt_port\drv_tpwm.c - - drv_trng.c 1 ..\libraries\m2354\rtt_port\drv_trng.c - - drv_uart.c 1 ..\libraries\m2354\rtt_port\drv_uart.c - - drv_ui2c.c 1 ..\libraries\m2354\rtt_port\drv_ui2c.c - - drv_usbd.c 1 ..\libraries\m2354\rtt_port\drv_usbd.c - - drv_usbhost.c 1 ..\libraries\m2354\rtt_port\drv_usbhost.c - - drv_uspi.c 1 ..\libraries\m2354\rtt_port\drv_uspi.c - - drv_uuart.c 1 ..\libraries\m2354\rtt_port\drv_uuart.c - - drv_wdt.c 1 @@ -1739,26 +3478,20 @@ 1 ..\..\..\components\fal\src\fal_partition.c - - fal_flash.c 1 ..\..\..\components\fal\src\fal_flash.c - - - fal_rtt.c + fal.c 1 - ..\..\..\components\fal\src\fal_rtt.c + ..\..\..\components\fal\src\fal.c - - - fal.c + fal_rtt.c 1 - ..\..\..\components\fal\src\fal.c + ..\..\..\components\fal\src\fal_rtt.c @@ -1770,146 +3503,444 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + - - src_dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 -std=c99 - + @@ -1921,33 +3952,25 @@ Finsh - cmd.c + msh_parse.c 1 - ..\..\..\components\finsh\cmd.c + ..\..\..\components\finsh\msh_parse.c - - - msh_parse.c + cmd.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\cmd.c - - msh_file.c 1 ..\..\..\components\finsh\msh_file.c - - msh.c 1 ..\..\..\components\finsh\msh.c - - shell.c 1 @@ -1963,298 +3986,892 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + @@ -2270,33 +4887,25 @@ 1 ..\..\..\src\klibc\kstring.c - - - rt_vsscanf.c + rt_vsnprintf_tiny.c 1 - ..\..\..\src\klibc\rt_vsscanf.c + ..\..\..\src\klibc\rt_vsnprintf_tiny.c - - - kerrno.c + kstdio.c 1 - ..\..\..\src\klibc\kerrno.c + ..\..\..\src\klibc\kstdio.c - - - rt_vsnprintf_tiny.c + kerrno.c 1 - ..\..\..\src\klibc\rt_vsnprintf_tiny.c + ..\..\..\src\klibc\kerrno.c - - - kstdio.c + rt_vsscanf.c 1 - ..\..\..\src\klibc\kstdio.c + ..\..\..\src\klibc\rt_vsscanf.c @@ -2308,29 +4917,21 @@ 1 ..\..\..\libcpu\arm\common\atomic_arm.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 ..\..\..\libcpu\arm\common\showmem.c - - context_rvds.S 2 ..\..\..\libcpu\arm\cortex-m23\context_rvds.S - - cpuport.c 1 @@ -2344,294 +4945,212 @@ nu_ebi.c 1 - ..\libraries\m2354\StdDriver\src\nu_ebi.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ebi.c - - - nu_dpm.c + nu_epwm.c 1 - ..\libraries\m2354\StdDriver\src\nu_dpm.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_epwm.c - - - nu_tamper.c + nu_uart.c 1 - ..\libraries\m2354\StdDriver\src\nu_tamper.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_uart.c - - - nu_ewwdt.c + nu_i2c.c 1 - ..\libraries\m2354\StdDriver\src\nu_ewwdt.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_i2c.c - - - nu_ewdt.c + nu_pdma.c 1 - ..\libraries\m2354\StdDriver\src\nu_ewdt.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_pdma.c - - - nu_crypto.c + nu_acmp.c 1 - ..\libraries\m2354\StdDriver\src\nu_crypto.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_acmp.c - - - nu_usci_uart.c + nu_ecap.c 1 - ..\libraries\m2354\StdDriver\src\nu_usci_uart.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ecap.c - - - nu_sc.c + nu_rng.c 1 - ..\libraries\m2354\StdDriver\src\nu_sc.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_rng.c - - - nu_acmp.c + nu_timer_pwm.c 1 - ..\libraries\m2354\StdDriver\src\nu_acmp.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_timer_pwm.c - - - nu_sys.c + nu_can.c 1 - ..\libraries\m2354\StdDriver\src\nu_sys.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_can.c - - - nu_usbd.c + nu_ewwdt.c 1 - ..\libraries\m2354\StdDriver\src\nu_usbd.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ewwdt.c - - - nu_can.c + nu_dac.c 1 - ..\libraries\m2354\StdDriver\src\nu_can.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_dac.c - - - nu_epwm.c + nu_tamper.c 1 - ..\libraries\m2354\StdDriver\src\nu_epwm.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_tamper.c - - - nu_ecap.c + nu_timer.c 1 - ..\libraries\m2354\StdDriver\src\nu_ecap.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_timer.c - - - nu_eadc.c + nu_qspi.c 1 - ..\libraries\m2354\StdDriver\src\nu_eadc.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_qspi.c - - - nu_lcd.c + nu_gpio.c 1 - ..\libraries\m2354\StdDriver\src\nu_lcd.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_gpio.c - - - nu_i2c.c + nu_sdh.c 1 - ..\libraries\m2354\StdDriver\src\nu_i2c.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_sdh.c - - - nu_sdh.c + nu_bpwm.c 1 - ..\libraries\m2354\StdDriver\src\nu_sdh.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_bpwm.c - - - nu_dac.c + nu_lcd.c 1 - ..\libraries\m2354\StdDriver\src\nu_dac.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_lcd.c - - nu_scuart.c 1 - ..\libraries\m2354\StdDriver\src\nu_scuart.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_scuart.c - - - nu_bpwm.c + nu_clk.c 1 - ..\libraries\m2354\StdDriver\src\nu_bpwm.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_clk.c - - nu_fvc.c 1 - ..\libraries\m2354\StdDriver\src\nu_fvc.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_fvc.c - - - nu_timer_pwm.c + nu_trng.c 1 - ..\libraries\m2354\StdDriver\src\nu_timer_pwm.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_trng.c - - - nu_clk.c + nu_dpm.c 1 - ..\libraries\m2354\StdDriver\src\nu_clk.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_dpm.c - - - nu_keystore.c + nu_qei.c 1 - ..\libraries\m2354\StdDriver\src\nu_keystore.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_qei.c - - - nu_fmc.c + nu_crypto.c 1 - ..\libraries\m2354\StdDriver\src\nu_fmc.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_crypto.c - - - nu_pdma.c + nu_usci_i2c.c 1 - ..\libraries\m2354\StdDriver\src\nu_pdma.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usci_i2c.c - - - nu_wwdt.c + nu_ewdt.c 1 - ..\libraries\m2354\StdDriver\src\nu_wwdt.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_ewdt.c - - - nu_gpio.c + nu_usbd.c 1 - ..\libraries\m2354\StdDriver\src\nu_gpio.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usbd.c - - - nu_usci_spi.c + nu_keystore.c 1 - ..\libraries\m2354\StdDriver\src\nu_usci_spi.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_keystore.c - - - nu_qspi.c + nu_sys.c 1 - ..\libraries\m2354\StdDriver\src\nu_qspi.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_sys.c - - - nu_spi.c + nu_wwdt.c 1 - ..\libraries\m2354\StdDriver\src\nu_spi.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_wwdt.c - - - nu_usci_i2c.c + nu_crc.c 1 - ..\libraries\m2354\StdDriver\src\nu_usci_i2c.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_crc.c - - - nu_trng.c + nu_wdt.c 1 - ..\libraries\m2354\StdDriver\src\nu_trng.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_wdt.c - - - nu_qei.c + nu_sc.c 1 - ..\libraries\m2354\StdDriver\src\nu_qei.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_sc.c - - - nu_crc.c + nu_rtc.c 1 - ..\libraries\m2354\StdDriver\src\nu_crc.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_rtc.c - - - nu_rng.c + nu_usci_spi.c 1 - ..\libraries\m2354\StdDriver\src\nu_rng.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usci_spi.c - - - nu_rtc.c + nu_eadc.c 1 - ..\libraries\m2354\StdDriver\src\nu_rtc.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_eadc.c - - - nu_timer.c + nu_usci_uart.c 1 - ..\libraries\m2354\StdDriver\src\nu_timer.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_usci_uart.c - - - nu_uart.c + nu_fmc.c 1 - ..\libraries\m2354\StdDriver\src\nu_uart.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_fmc.c - - - nu_i2s.c + nu_spi.c 1 - ..\libraries\m2354\StdDriver\src\nu_i2s.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_spi.c - - - nu_wdt.c + nu_i2s.c 1 - ..\libraries\m2354\StdDriver\src\nu_wdt.c + packages\nuvoton-series-latest\M2354\StdDriver\src\nu_i2s.c @@ -2639,23 +5158,19 @@ m2354_usbhostlib - usb_core.c + ohci.c 1 - ..\libraries\m2354\USBHostLib\src\usb_core.c + packages\nuvoton-series-latest\M2354\USBHostLib\src\ohci.c - - - mem_alloc.c + usb_core.c 1 - ..\libraries\m2354\USBHostLib\src\mem_alloc.c + packages\nuvoton-series-latest\M2354\USBHostLib\src\usb_core.c - - - ohci.c + mem_alloc.c 1 - ..\libraries\m2354\USBHostLib\src\ohci.c + packages\nuvoton-series-latest\M2354\USBHostLib\src\mem_alloc.c @@ -2667,63 +5182,47 @@ 1 ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c - - - hwsem_counter.c + smp_demo.c 1 - ..\libraries\nu_packages\Demo\hwsem_counter.c + ..\libraries\nu_packages\Demo\smp_demo.c - - - smp_demo.c + wormhole_demo.c 1 - ..\libraries\nu_packages\Demo\smp_demo.c + ..\libraries\nu_packages\Demo\wormhole_demo.c - - - atdev_utils.c + ccap_saver.c 1 - ..\libraries\nu_packages\Demo\atdev_utils.c + ..\libraries\nu_packages\Demo\ccap_saver.c + + + hwsem_counter.c + 1 + ..\libraries\nu_packages\Demo\hwsem_counter.c - - usbd_cdc_vcom_echo.c 1 ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c - - - wormhole_demo.c + atdev_utils.c 1 - ..\libraries\nu_packages\Demo\wormhole_demo.c + ..\libraries\nu_packages\Demo\atdev_utils.c - - ccap_demo.c 1 ..\libraries\nu_packages\Demo\ccap_demo.c - - slcd_show_tick.c 1 ..\libraries\nu_packages\Demo\slcd_show_tick.c - - - ccap_saver.c - 1 - ..\libraries\nu_packages\Demo\ccap_saver.c - - nu_pkgs_slcd @@ -2743,8 +5242,6 @@ 1 ..\..\..\components\libc\posix\io\poll\poll.c - - select.c 1 @@ -2756,23 +5253,19 @@ rt_usbd - hid.c + usbdevice_core.c 1 - ..\..\..\components\legacy\usb\usbdevice\class\hid.c + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c - - usbdevice.c 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c - - - usbdevice_core.c + hid.c 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + ..\..\..\components\legacy\usb\usbdevice\class\hid.c @@ -2784,40 +5277,30 @@ 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c - - - - mass.c - 1 - ..\..\..\components\legacy\usb\usbhost\class\mass.c - - - - usbhost.c + driver.c 1 - ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + ..\..\..\components\legacy\usb\usbhost\core\driver.c - - udisk.c 1 ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - hub.c 1 ..\..\..\components\legacy\usb\usbhost\core\hub.c - - - driver.c + mass.c 1 - ..\..\..\components\legacy\usb\usbhost\core\driver.c + ..\..\..\components\legacy\usb\usbhost\class\mass.c + + + usbhost.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c @@ -2829,43 +5312,31 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_at.c 1 ..\..\..\components\net\sal\impl\af_inet_at.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -2881,8 +5352,6 @@ 1 ..\..\..\components\utilities\utest\TC_uassert.c - - utest.c 1 @@ -2893,9 +5362,11 @@ + - - - + + + +
diff --git a/bsp/nuvoton/numaker-m467hj/project.uvoptx b/bsp/nuvoton/numaker-m467hj/project.uvoptx new file mode 100644 index 00000000000..3cdcc758655 --- /dev/null +++ b/bsp/nuvoton/numaker-m467hj/project.uvoptx @@ -0,0 +1,3524 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread-m460 + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\keil5\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + + + + + + + + + + + BIN\UL2CM3.DLL + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC40000 -FN1 -FF0M460_AP_1M -FS00 -FL0100000 -FP0($$Device:M467HJHAE$Flash\M460_AP_1M.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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk.c + blk.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dev.c + blk_dev.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dfs.c + blk_dfs.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_partition.c + blk_partition.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\dfs.c + dfs.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\efi.c + efi.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_crc.c + hw_crc.c + 0 + 0 + + + 3 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 3 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 3 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 3 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 3 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 3 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 3 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 3 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 3 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 3 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 3 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 3 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 3 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 3 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 3 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 3 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 3 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 3 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 3 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_inputcapture.c + rt_inputcapture.c + 0 + 0 + + + 3 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 3 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 3 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_block.c + dev_block.c + 0 + 0 + + + 3 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmc.c + dev_mmc.c + 0 + 0 + + + 3 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + dev_mmcsd_core.c + 0 + 0 + + + 3 + 46 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sd.c + dev_sd.c + 0 + 0 + + + 3 + 47 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sdio.c + dev_sdio.c + 0 + 0 + + + 3 + 48 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v2\sensor.c + sensor.c + 0 + 0 + + + 3 + 49 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sensor\v2\sensor_cmd.c + sensor_cmd.c + 0 + 0 + + + 3 + 50 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 3 + 51 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 3 + 52 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 3 + 53 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 3 + 54 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + dev_spi_flash_sfud.c + 0 + 0 + + + 3 + 55 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud.c + sfud.c + 0 + 0 + + + 3 + 56 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + sfud_sfdp.c + 0 + 0 + + + 3 + 57 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 4 + 58 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_bpwm.c + drv_bpwm.c + 0 + 0 + + + 4 + 59 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_bpwm_capture.c + drv_bpwm_capture.c + 0 + 0 + + + 4 + 60 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_canfd.c + drv_canfd.c + 0 + 0 + + + 4 + 61 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ccap.c + drv_ccap.c + 0 + 0 + + + 4 + 62 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 4 + 63 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_crc.c + drv_crc.c + 0 + 0 + + + 4 + 64 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 4 + 65 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_dac.c + drv_dac.c + 0 + 0 + + + 4 + 66 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_eadc.c + drv_eadc.c + 0 + 0 + + + 4 + 67 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 4 + 68 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ecap.c + drv_ecap.c + 0 + 0 + + + 4 + 69 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_epwm.c + drv_epwm.c + 0 + 0 + + + 4 + 70 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_epwm_capture.c + drv_epwm_capture.c + 0 + 0 + + + 4 + 71 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_eqei.c + drv_eqei.c + 0 + 0 + + + 4 + 72 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_fmc.c + drv_fmc.c + 0 + 0 + + + 4 + 73 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 4 + 74 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_hsotg.c + drv_hsotg.c + 0 + 0 + + + 4 + 75 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_hsusbd.c + drv_hsusbd.c + 0 + 0 + + + 4 + 76 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 4 + 77 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 4 + 78 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 4 + 79 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 4 + 80 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 4 + 81 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 4 + 82 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 4 + 83 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_sdio.c + drv_sdio.c + 0 + 0 + + + 4 + 84 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 4 + 85 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 4 + 86 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_spii2s.c + drv_spii2s.c + 0 + 0 + + + 4 + 87 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_timer.c + drv_timer.c + 0 + 0 + + + 4 + 88 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_tpwm.c + drv_tpwm.c + 0 + 0 + + + 4 + 89 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_trng.c + drv_trng.c + 0 + 0 + + + 4 + 90 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 4 + 91 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_ui2c.c + drv_ui2c.c + 0 + 0 + + + 4 + 92 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 4 + 93 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 4 + 94 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_uspi.c + drv_uspi.c + 0 + 0 + + + 4 + 95 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_uuart.c + drv_uuart.c + 0 + 0 + + + 4 + 96 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + 4 + 97 + 1 + 0 + 0 + 0 + board\NuPinConfig\nutool_pincfg.c + nutool_pincfg.c + 0 + 0 + + + 4 + 98 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + 4 + 99 + 1 + 0 + 0 + 0 + board\nutool_modclkcfg.c + nutool_modclkcfg.c + 0 + 0 + + + 4 + 100 + 2 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\ARM\startup_m460.s + startup_m460.s + 0 + 0 + + + 4 + 101 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\system_m460.c + system_m460.c + 0 + 0 + + + 4 + 102 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\drv_emac.c + drv_emac.c + 0 + 0 + + + 4 + 103 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\mii.c + mii.c + 0 + 0 + + + 4 + 104 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\synopGMAC_Dev.c + synopGMAC_Dev.c + 0 + 0 + + + 4 + 105 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\synopGMAC_network_interface.c + synopGMAC_network_interface.c + 0 + 0 + + + 4 + 106 + 1 + 0 + 0 + 0 + ..\libraries\m460\rtt_port\emac\synopGMAC_plat.c + synopGMAC_plat.c + 0 + 0 + + + + + Fal + 0 + 0 + 0 + 0 + + 5 + 107 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_partition.c + fal_partition.c + 0 + 0 + + + 5 + 108 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal.c + fal.c + 0 + 0 + + + 5 + 109 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_rtt.c + fal_rtt.c + 0 + 0 + + + 5 + 110 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_flash.c + fal_flash.c + 0 + 0 + + + 5 + 111 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c + fal_flash_sfud_port.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 6 + 112 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 6 + 113 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 6 + 114 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 6 + 115 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 6 + 116 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + src_dfs.c + 0 + 0 + + + 6 + 117 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 6 + 118 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 6 + 119 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 7 + 120 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + 7 + 121 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 7 + 122 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 7 + 123 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 7 + 124 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 8 + 125 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 8 + 126 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 8 + 127 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 8 + 128 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 8 + 129 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 8 + 130 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 8 + 131 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 8 + 132 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 8 + 133 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 8 + 134 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 8 + 135 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 8 + 136 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 8 + 137 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 8 + 138 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 8 + 139 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 8 + 140 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 9 + 141 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 9 + 142 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + 9 + 143 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + 9 + 144 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_std.c + rt_vsnprintf_std.c + 0 + 0 + + + 9 + 145 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + + + Legacy + 0 + 0 + 0 + 0 + + 10 + 146 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\ipc\workqueue_legacy.c + workqueue_legacy.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 11 + 147 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\atomic_arm.c + atomic_arm.c + 0 + 0 + + + 11 + 148 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 11 + 149 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + 11 + 150 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + context_rvds.S + 0 + 0 + + + 11 + 151 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\cpuport.c + cpuport.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 12 + 152 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spim.c + nu_spim.c + 0 + 0 + + + 12 + 153 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_uart.c + nu_usci_uart.c + 0 + 0 + + + 12 + 154 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_kpi.c + nu_kpi.c + 0 + 0 + + + 12 + 155 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bpwm.c + nu_bpwm.c + 0 + 0 + + + 12 + 156 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_clk.c + nu_clk.c + 0 + 0 + + + 12 + 157 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rng.c + nu_rng.c + 0 + 0 + + + 12 + 158 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 12 + 159 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eqei.c + nu_eqei.c + 0 + 0 + + + 12 + 160 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bmc.c + nu_bmc.c + 0 + 0 + + + 12 + 161 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 12 + 162 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spi.c + nu_spi.c + 0 + 0 + + + 12 + 163 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer.c + nu_timer.c + 0 + 0 + + + 12 + 164 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_spi.c + nu_usci_spi.c + 0 + 0 + + + 12 + 165 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_acmp.c + nu_acmp.c + 0 + 0 + + + 12 + 166 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hsusbd.c + nu_hsusbd.c + 0 + 0 + + + 12 + 167 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 12 + 168 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer_pwm.c + nu_timer_pwm.c + 0 + 0 + + + 12 + 169 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_fmc.c + nu_fmc.c + 0 + 0 + + + 12 + 170 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_uart.c + nu_uart.c + 0 + 0 + + + 12 + 171 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hbi.c + nu_hbi.c + 0 + 0 + + + 12 + 172 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ccap.c + nu_ccap.c + 0 + 0 + + + 12 + 173 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sc.c + nu_sc.c + 0 + 0 + + + 12 + 174 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_keystore.c + nu_keystore.c + 0 + 0 + + + 12 + 175 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 12 + 176 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_canfd.c + nu_canfd.c + 0 + 0 + + + 12 + 177 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_i2c.c + nu_usci_i2c.c + 0 + 0 + + + 12 + 178 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_trng.c + nu_trng.c + 0 + 0 + + + 12 + 179 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 12 + 180 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eadc.c + nu_eadc.c + 0 + 0 + + + 12 + 181 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 12 + 182 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_epwm.c + nu_epwm.c + 0 + 0 + + + 12 + 183 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 12 + 184 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 12 + 185 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 12 + 186 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ecap.c + nu_ecap.c + 0 + 0 + + + 12 + 187 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 12 + 188 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 12 + 189 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crc.c + nu_crc.c + 0 + 0 + + + 12 + 190 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_dac.c + nu_dac.c + 0 + 0 + + + 12 + 191 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sys.c + nu_sys.c + 0 + 0 + + + 12 + 192 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 12 + 193 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\StdDriver\src\nu_qspi.c + nu_qspi.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 13 + 194 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 13 + 195 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 13 + 196 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c + err.c + 0 + 0 + + + 13 + 197 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c + if_api.c + 0 + 0 + + + 13 + 198 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 13 + 199 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c + netdb.c + 0 + 0 + + + 13 + 200 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 13 + 201 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c + sockets.c + 0 + 0 + + + 13 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 13 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 13 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c + altcp.c + 0 + 0 + + + 13 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c + altcp_alloc.c + 0 + 0 + + + 13 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c + altcp_tcp.c + 0 + 0 + + + 13 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c + def.c + 0 + 0 + + + 13 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c + dns.c + 0 + 0 + + + 13 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 13 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c + init.c + 0 + 0 + + + 13 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c + ip.c + 0 + 0 + + + 13 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 13 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 13 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 13 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 13 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 13 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 13 + 218 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 13 + 219 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 13 + 220 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c + memp.c + 0 + 0 + + + 13 + 221 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c + netif.c + 0 + 0 + + + 13 + 222 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 13 + 223 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c + raw.c + 0 + 0 + + + 13 + 224 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c + stats.c + 0 + 0 + + + 13 + 225 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c + sys.c + 0 + 0 + + + 13 + 226 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c + tcp.c + 0 + 0 + + + 13 + 227 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 13 + 228 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 13 + 229 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 13 + 230 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c + udp.c + 0 + 0 + + + 13 + 231 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 13 + 232 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 13 + 233 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 13 + 234 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + m460_usbhostlib + 0 + 0 + 0 + 0 + + 14 + 235 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + 14 + 236 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + 14 + 237 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci.c + ehci.c + 0 + 0 + + + 14 + 238 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 14 + 239 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M460\USBHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + + + nu_pkgs_nau8822 + 0 + 0 + 0 + 0 + + 15 + 240 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c + acodec_nau8822.c + 0 + 0 + + + 15 + 241 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\audio_test.c + audio_test.c + 0 + 0 + + + + + nu_pkgs_nct7717u + 0 + 0 + 0 + 0 + + 16 + 242 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\NCT7717U\sensor_nct7717u.c + sensor_nct7717u.c + 0 + 0 + + + + + POSIX + 0 + 0 + 0 + 0 + + 17 + 243 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\poll.c + poll.c + 0 + 0 + + + 17 + 244 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\posix\io\poll\select.c + select.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 18 + 245 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c + mstorage.c + 0 + 0 + + + 18 + 246 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 18 + 247 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 19 + 248 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 19 + 249 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 19 + 250 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + 19 + 251 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + 19 + 252 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 19 + 253 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 20 + 254 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 20 + 255 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 20 + 256 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 20 + 257 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 20 + 258 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 20 + 259 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 20 + 260 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 21 + 261 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + 21 + 262 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 22 + 263 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\ulog\ulog.c + ulog.c + 0 + 0 + + + 22 + 264 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\ulog\backend\console_be.c + console_be.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/bsp/nuvoton/numaker-m467hj/project.uvprojx b/bsp/nuvoton/numaker-m467hj/project.uvprojx index 967f4aa2764..c02697c63a7 100644 --- a/bsp/nuvoton/numaker-m467hj/project.uvprojx +++ b/bsp/nuvoton/numaker-m467hj/project.uvprojx @@ -1,43 +1,46 @@ + 2.1 +
### uVision Project, (C) Keil Software
+ rtthread-m460 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 M467HJHAE Nuvoton - Nuvoton.NuMicro_DFP.1.3.13 - https://github.com/OpenNuvoton/cmsis-packs/raw/master/ + Nuvoton.NuMicro_DFP.1.3.25 + https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x80000) IROM(0x00000000,0x100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) - - + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M460_AP_1M -FS00 -FL0100000 -FP0($$Device:M467HJHAE$Flash\M460_AP_1M.FLM)) 0 $$Device:M467HJHAE$Device\M460\Include\m460.h - - - - - - - - - + + + + + + + + + $$Device:M467HJHAE$SVD\Nuvoton\M460.svd 0 0 - - - - - + + + + + 0 0 @@ -59,8 +62,8 @@ 0 0 - - + + 0 0 0 @@ -69,8 +72,8 @@ 0 0 - - + + 0 0 0 @@ -80,14 +83,14 @@ 1 0 fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" - + 0 0 0 0 0 - + 0 @@ -101,8 +104,8 @@ 0 0 3 - - + + 1 @@ -111,7 +114,7 @@ DCM.DLL -pCM4 SARMCM3.DLL - + TCM.DLL -pCM4 @@ -135,11 +138,11 @@ 1 BIN\UL2CM3.DLL - - - - - + + + + + 0 @@ -172,7 +175,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -182,6 +185,8 @@ 0 2 0 + 0 + 0 0 0 8 @@ -305,7 +310,7 @@ 0x0 - + 1 @@ -332,10 +337,10 @@ 0 0 - --c99 --diag_suppress=66,1296,186 - __RTTHREAD__, RT_USING_ARMLIBC, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_LIBC, __STDC_LIMIT_MACROS - - ..\libraries\nu_packages\NCT7717U;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\drivers\include;..\..\..\components\net\sal\impl;..\libraries\m460\rtt_port;..\..\..\components\drivers\hwcrypto;..\..\..\components\libc\compilers\common\include;..\..\..\components\finsh;..\..\..\components\legacy\include;..\..\..\components\drivers\include;board\NuPinConfig;..\libraries\m460\USBHostLib\inc;..\..\..\components\net\sal\include\socket;..\libraries\m460\rtt_port\emac;..\..\..\components\utilities\ulog;..\..\..\components\drivers\include;.;..\..\..\components\drivers\include;..\..\..\components\drivers\spi\sfud\inc;..\..\..\include;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\netdev\include;..\..\..\components\libc\compilers\common\extension;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\drivers\include;..\..\..\components\drivers\smp_call;..\..\..\components\drivers\include;..\libraries\nu_packages\TPC;..\..\..\components\legacy\usb\usbhost;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\drivers\include;..\..\..\components\libc\posix\ipc;..\..\..\components\legacy;..\..\..\components\net\lwip\port;..\..\..\components\drivers\sdio\sdhci\include;board;..\..\..\components\fal\inc;..\libraries\nu_packages\AudioCodec;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\drivers\audio;..\libraries\m460\CMSIS\Include;applications;..\..\..\components\legacy\dfs;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\..\..\components\drivers\include;..\libraries\m460\Device\Nuvoton\m460\Include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\spi;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\phy;..\libraries\m460\StdDriver\inc;..\..\..\libcpu\arm\common;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\net\sal\include;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\utilities\utest;..\..\..\components\drivers\include;..\..\..\components\drivers\include + --c99 --diag_suppress=66,1296,186 --gnu --diag_suppress=1,177,550 + RT_USING_ARMLIBC, __STDC_LIMIT_MACROS, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_LIBC + + board;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\legacy\dfs;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\net\netdev\include;..\..\..\components\drivers\spi;..\..\..\components\drivers\smp_call;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\finsh;..\..\..\components\drivers\include;..\..\..\components\drivers\include;packages\nuvoton-series-latest\M460\USBHostLib\inc;packages\nuvoton-cmsis-latest\m460_m2354\Include;..\..\..\components\net\sal\include;..\libraries\m460\rtt_port\emac;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\..\..\libcpu\arm\common;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\legacy\usb\usbhost;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\libc\posix\ipc;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\legacy\include;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\sal\impl;..\..\..\components\dfs\dfs_v1\filesystems\devfs;board\NuPinConfig;..\..\..\components\utilities\utest;..\..\..\include;..\..\..\components\libc\compilers\common\extension;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\libraries\nu_packages\TPC;packages\nuvoton-series-latest\M460\StdDriver\inc;..\libraries\m460\rtt_port;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Include;..\..\..\components\net\lwip\port;..\..\..\components\utilities\ulog;..\..\..\components\libc\compilers\common\include;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\poll;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\net\lwip\lwip-2.1.2\src\include\netif;..\..\..\components\drivers\phy;..\..\..\components\drivers\include;..\..\..\components\legacy;applications;..\..\..\components\fal\inc;..\..\..\components\net\lwip\lwip-2.1.2\src\include;..\libraries\nu_packages\AudioCodec;..\..\..\components\net\sal\include\socket;..\..\..\components\drivers\include;..\libraries\nu_packages\NCT7717U;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\drivers\include;.;..\..\..\components\drivers\hwcrypto @@ -348,12 +353,12 @@ 0 0 0 - 0 + 4 - - - - + + + + @@ -365,13 +370,13 @@ 0 0x00000000 0x20000000 - + .\linking_scripts\m460_flash.sct - - - - - + + + + + @@ -384,8 +389,6 @@ 1 applications\mnt.c - - main.c 1 @@ -401,50 +404,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -460,887 +449,2628 @@ 1 ..\..\..\components\drivers\audio\dev_audio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_audio_pipe.c 1 ..\..\..\components\drivers\audio\dev_audio_pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk.c 1 ..\..\..\components\drivers\block\blk.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dev.c 1 ..\..\..\components\drivers\block\blk_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dfs.c 1 ..\..\..\components\drivers\block\blk_dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_partition.c 1 ..\..\..\components\drivers\block\blk_partition.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dfs.c 1 ..\..\..\components\drivers\block\partitions\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - efi.c 1 ..\..\..\components\drivers\block\partitions\efi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_can.c 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_crc.c 1 ..\..\..\components\drivers\hwcrypto\hw_crc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_hash.c 1 ..\..\..\components\drivers\hwcrypto\hw_hash.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_rng.c 1 ..\..\..\components\drivers\hwcrypto\hw_rng.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_symmetric.c 1 ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwcrypto.c 1 ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - rt_inputcapture.c 1 ..\..\..\components\drivers\misc\rt_inputcapture.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_block.c 1 ..\..\..\components\drivers\sdio\dev_block.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmc.c 1 ..\..\..\components\drivers\sdio\dev_mmc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmcsd_core.c 1 ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sd.c 1 ..\..\..\components\drivers\sdio\dev_sd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sdio.c 1 ..\..\..\components\drivers\sdio\dev_sdio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sensor.c 1 ..\..\..\components\drivers\sensor\v2\sensor.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sensor_cmd.c 1 ..\..\..\components\drivers\sensor\v2\sensor_cmd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_flash_sfud.c 1 ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud_sfdp.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + @@ -1350,343 +3080,247 @@ Drivers - - - startup_m460.s - 2 - ..\libraries\m460\Device\Nuvoton\m460\Source\ARM\startup_m460.s - - - - - system_m460.c - 1 - ..\libraries\m460\Device\Nuvoton\m460\Source\system_m460.c - - drv_bpwm.c 1 ..\libraries\m460\rtt_port\drv_bpwm.c - - drv_bpwm_capture.c 1 ..\libraries\m460\rtt_port\drv_bpwm_capture.c - - drv_canfd.c 1 ..\libraries\m460\rtt_port\drv_canfd.c - - drv_ccap.c 1 ..\libraries\m460\rtt_port\drv_ccap.c - - drv_common.c 1 ..\libraries\m460\rtt_port\drv_common.c - - drv_crc.c 1 ..\libraries\m460\rtt_port\drv_crc.c - - drv_crypto.c 1 ..\libraries\m460\rtt_port\drv_crypto.c - - drv_dac.c 1 ..\libraries\m460\rtt_port\drv_dac.c - - drv_eadc.c 1 ..\libraries\m460\rtt_port\drv_eadc.c - - drv_ebi.c 1 ..\libraries\m460\rtt_port\drv_ebi.c - - drv_ecap.c 1 ..\libraries\m460\rtt_port\drv_ecap.c - - drv_epwm.c 1 ..\libraries\m460\rtt_port\drv_epwm.c - - drv_epwm_capture.c 1 ..\libraries\m460\rtt_port\drv_epwm_capture.c - - drv_eqei.c 1 ..\libraries\m460\rtt_port\drv_eqei.c - - drv_fmc.c 1 ..\libraries\m460\rtt_port\drv_fmc.c - - drv_gpio.c 1 ..\libraries\m460\rtt_port\drv_gpio.c - - drv_hsotg.c 1 ..\libraries\m460\rtt_port\drv_hsotg.c - - drv_hsusbd.c 1 ..\libraries\m460\rtt_port\drv_hsusbd.c - - drv_i2c.c 1 ..\libraries\m460\rtt_port\drv_i2c.c - - drv_i2s.c 1 ..\libraries\m460\rtt_port\drv_i2s.c - - drv_pdma.c 1 ..\libraries\m460\rtt_port\drv_pdma.c - - drv_qspi.c 1 ..\libraries\m460\rtt_port\drv_qspi.c - - drv_rtc.c 1 ..\libraries\m460\rtt_port\drv_rtc.c - - drv_scuart.c 1 ..\libraries\m460\rtt_port\drv_scuart.c - - drv_sdh.c 1 ..\libraries\m460\rtt_port\drv_sdh.c - - drv_sdio.c 1 ..\libraries\m460\rtt_port\drv_sdio.c - - drv_softi2c.c 1 ..\libraries\m460\rtt_port\drv_softi2c.c - - drv_spi.c 1 ..\libraries\m460\rtt_port\drv_spi.c - - drv_spii2s.c 1 ..\libraries\m460\rtt_port\drv_spii2s.c - - drv_timer.c 1 ..\libraries\m460\rtt_port\drv_timer.c - - drv_tpwm.c 1 ..\libraries\m460\rtt_port\drv_tpwm.c - - drv_trng.c 1 ..\libraries\m460\rtt_port\drv_trng.c - - drv_uart.c 1 ..\libraries\m460\rtt_port\drv_uart.c - - drv_ui2c.c 1 ..\libraries\m460\rtt_port\drv_ui2c.c - - drv_usbd.c 1 ..\libraries\m460\rtt_port\drv_usbd.c - - drv_usbhost.c 1 ..\libraries\m460\rtt_port\drv_usbhost.c - - drv_uspi.c 1 ..\libraries\m460\rtt_port\drv_uspi.c - - drv_uuart.c 1 ..\libraries\m460\rtt_port\drv_uuart.c - - drv_wdt.c 1 ..\libraries\m460\rtt_port\drv_wdt.c - - nutool_pincfg.c 1 board\NuPinConfig\nutool_pincfg.c - - board_dev.c 1 board\board_dev.c - - nutool_modclkcfg.c 1 board\nutool_modclkcfg.c - - + + startup_m460.s + 2 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\ARM\startup_m460.s + + + system_m460.c + 1 + packages\nuvoton-series-latest\M460\Device\Nuvoton\m460\Source\system_m460.c + drv_emac.c 1 ..\libraries\m460\rtt_port\emac\drv_emac.c - - mii.c 1 ..\libraries\m460\rtt_port\emac\mii.c - - synopGMAC_Dev.c 1 ..\libraries\m460\rtt_port\emac\synopGMAC_Dev.c - - synopGMAC_network_interface.c 1 ..\libraries\m460\rtt_port\emac\synopGMAC_network_interface.c - - synopGMAC_plat.c 1 @@ -1697,38 +3331,30 @@ Fal + + fal_partition.c + 1 + ..\..\..\components\fal\src\fal_partition.c + fal.c 1 ..\..\..\components\fal\src\fal.c - - - fal_flash_sfud_port.c + fal_rtt.c 1 - ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c + ..\..\..\components\fal\src\fal_rtt.c - - fal_flash.c 1 ..\..\..\components\fal\src\fal_flash.c - - - - fal_partition.c - 1 - ..\..\..\components\fal\src\fal_partition.c - - - - fal_rtt.c + fal_flash_sfud_port.c 1 - ..\..\..\components\fal\src\fal_rtt.c + ..\..\..\components\fal\samples\porting\fal_flash_sfud_port.c @@ -1740,146 +3366,444 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - src_dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + @@ -1891,37 +3815,29 @@ Finsh - cmd.c + msh_parse.c 1 - ..\..\..\components\finsh\cmd.c + ..\..\..\components\finsh\msh_parse.c - - shell.c 1 ..\..\..\components\finsh\shell.c - - - msh_parse.c + msh_file.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\msh_file.c - - - msh.c + cmd.c 1 - ..\..\..\components\finsh\msh.c + ..\..\..\components\finsh\cmd.c - - - msh_file.c + msh.c 1 - ..\..\..\components\finsh\msh_file.c + ..\..\..\components\finsh\msh.c @@ -1933,298 +3849,892 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + @@ -2236,33 +4746,25 @@ klibc - rt_vsscanf.c + kstring.c 1 - ..\..\..\src\klibc\rt_vsscanf.c + ..\..\..\src\klibc\kstring.c - - - kstring.c + kerrno.c 1 - ..\..\..\src\klibc\kstring.c + ..\..\..\src\klibc\kerrno.c - - - rt_vsnprintf_std.c + rt_vsscanf.c 1 - ..\..\..\src\klibc\rt_vsnprintf_std.c + ..\..\..\src\klibc\rt_vsscanf.c - - - kerrno.c + rt_vsnprintf_std.c 1 - ..\..\..\src\klibc\kerrno.c + ..\..\..\src\klibc\rt_vsnprintf_std.c - - kstdio.c 1 @@ -2288,29 +4790,21 @@ 1 ..\..\..\libcpu\arm\common\atomic_arm.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 ..\..\..\libcpu\arm\common\showmem.c - - context_rvds.S 2 ..\..\..\libcpu\arm\cortex-m4\context_rvds.S - - cpuport.c 1 @@ -2322,296 +4816,214 @@ Libraries - nu_crc.c + nu_spim.c 1 - ..\libraries\m460\StdDriver\src\nu_crc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spim.c - - - nu_sdh.c + nu_usci_uart.c 1 - ..\libraries\m460\StdDriver\src\nu_sdh.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_uart.c - - - nu_spi.c + nu_kpi.c 1 - ..\libraries\m460\StdDriver\src\nu_spi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_kpi.c - - - nu_acmp.c + nu_bpwm.c 1 - ..\libraries\m460\StdDriver\src\nu_acmp.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bpwm.c - - - nu_usci_i2c.c + nu_clk.c 1 - ..\libraries\m460\StdDriver\src\nu_usci_i2c.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_clk.c - - - nu_wdt.c + nu_rng.c 1 - ..\libraries\m460\StdDriver\src\nu_wdt.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rng.c - - - nu_canfd.c + nu_wwdt.c 1 - ..\libraries\m460\StdDriver\src\nu_canfd.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wwdt.c - - - nu_i2c.c + nu_eqei.c 1 - ..\libraries\m460\StdDriver\src\nu_i2c.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eqei.c - - - nu_keystore.c + nu_bmc.c 1 - ..\libraries\m460\StdDriver\src\nu_keystore.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_bmc.c - - - nu_epwm.c + nu_ebi.c 1 - ..\libraries\m460\StdDriver\src\nu_epwm.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ebi.c - - - nu_usci_spi.c + nu_spi.c 1 - ..\libraries\m460\StdDriver\src\nu_usci_spi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_spi.c - - - nu_usci_uart.c + nu_timer.c 1 - ..\libraries\m460\StdDriver\src\nu_usci_uart.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer.c - - - nu_rtc.c + nu_usci_spi.c 1 - ..\libraries\m460\StdDriver\src\nu_rtc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_spi.c - - - nu_bpwm.c + nu_acmp.c 1 - ..\libraries\m460\StdDriver\src\nu_bpwm.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_acmp.c - - - nu_dac.c + nu_hsusbd.c 1 - ..\libraries\m460\StdDriver\src\nu_dac.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hsusbd.c - - - nu_spim.c + nu_crypto.c 1 - ..\libraries\m460\StdDriver\src\nu_spim.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crypto.c - - nu_timer_pwm.c 1 - ..\libraries\m460\StdDriver\src\nu_timer_pwm.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_timer_pwm.c - - - nu_ebi.c + nu_fmc.c 1 - ..\libraries\m460\StdDriver\src\nu_ebi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_fmc.c - - - nu_ccap.c + nu_uart.c 1 - ..\libraries\m460\StdDriver\src\nu_ccap.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_uart.c - - - nu_kpi.c + nu_hbi.c 1 - ..\libraries\m460\StdDriver\src\nu_kpi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_hbi.c - - - nu_qspi.c + nu_ccap.c 1 - ..\libraries\m460\StdDriver\src\nu_qspi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ccap.c - - - nu_pdma.c + nu_sc.c 1 - ..\libraries\m460\StdDriver\src\nu_pdma.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sc.c - - - nu_wwdt.c + nu_keystore.c 1 - ..\libraries\m460\StdDriver\src\nu_wwdt.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_keystore.c - - - nu_scuart.c + nu_gpio.c 1 - ..\libraries\m460\StdDriver\src\nu_scuart.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_gpio.c - - - nu_eadc.c + nu_canfd.c 1 - ..\libraries\m460\StdDriver\src\nu_eadc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_canfd.c - - - nu_sys.c + nu_usci_i2c.c 1 - ..\libraries\m460\StdDriver\src\nu_sys.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usci_i2c.c - - nu_trng.c 1 - ..\libraries\m460\StdDriver\src\nu_trng.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_trng.c - - - nu_gpio.c + nu_wdt.c 1 - ..\libraries\m460\StdDriver\src\nu_gpio.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_wdt.c - - - nu_crypto.c + nu_eadc.c 1 - ..\libraries\m460\StdDriver\src\nu_crypto.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_eadc.c - - - nu_clk.c + nu_sdh.c 1 - ..\libraries\m460\StdDriver\src\nu_clk.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sdh.c - - - nu_rng.c + nu_epwm.c 1 - ..\libraries\m460\StdDriver\src\nu_rng.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_epwm.c - - - nu_sc.c + nu_usbd.c 1 - ..\libraries\m460\StdDriver\src\nu_sc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_usbd.c - - - nu_eqei.c + nu_i2c.c 1 - ..\libraries\m460\StdDriver\src\nu_eqei.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2c.c - - - nu_timer.c + nu_pdma.c 1 - ..\libraries\m460\StdDriver\src\nu_timer.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_pdma.c - - - nu_bmc.c + nu_ecap.c 1 - ..\libraries\m460\StdDriver\src\nu_bmc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_ecap.c - - - nu_hsusbd.c + nu_rtc.c 1 - ..\libraries\m460\StdDriver\src\nu_hsusbd.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_rtc.c - - - nu_uart.c + nu_scuart.c 1 - ..\libraries\m460\StdDriver\src\nu_uart.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_scuart.c - - - nu_ecap.c + nu_crc.c 1 - ..\libraries\m460\StdDriver\src\nu_ecap.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_crc.c - - - nu_hbi.c + nu_dac.c 1 - ..\libraries\m460\StdDriver\src\nu_hbi.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_dac.c - - - nu_usbd.c + nu_sys.c 1 - ..\libraries\m460\StdDriver\src\nu_usbd.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_sys.c - - nu_i2s.c 1 - ..\libraries\m460\StdDriver\src\nu_i2s.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_i2s.c - - - nu_fmc.c + nu_qspi.c 1 - ..\libraries\m460\StdDriver\src\nu_fmc.c + packages\nuvoton-series-latest\M460\StdDriver\src\nu_qspi.c @@ -2623,281 +5035,201 @@ 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_lib.c - - api_msg.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\api_msg.c - - err.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\err.c - - if_api.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\if_api.c - - netbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netbuf.c - - netdb.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netdb.c - - netifapi.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\netifapi.c - - sockets.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\sockets.c - - tcpip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\api\tcpip.c - - ping.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\apps\ping\ping.c - - altcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp.c - - altcp_alloc.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_alloc.c - - altcp_tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\altcp_tcp.c - - def.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\def.c - - dns.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\dns.c - - inet_chksum.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\inet_chksum.c - - init.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\init.c - - ip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ip.c - - autoip.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\autoip.c - - dhcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\dhcp.c - - etharp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\etharp.c - - icmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\icmp.c - - igmp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\igmp.c - - ip4.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4.c - - ip4_addr.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_addr.c - - ip4_frag.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\ipv4\ip4_frag.c - - memp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\memp.c - - netif.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\netif.c - - pbuf.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\pbuf.c - - raw.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\raw.c - - stats.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\stats.c - - sys.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\sys.c - - tcp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp.c - - tcp_in.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_in.c - - tcp_out.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\tcp_out.c - - timeouts.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\timeouts.c - - udp.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\core\udp.c - - ethernet.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\ethernet.c - - lowpan6.c 1 ..\..\..\components\net\lwip\lwip-2.1.2\src\netif\lowpan6.c - - ethernetif.c 1 ..\..\..\components\net\lwip\port\ethernetif.c - - sys_arch.c 1 @@ -2909,37 +5241,29 @@ m460_usbhostlib - ohci.c + ehci_iso.c 1 - ..\libraries\m460\USBHostLib\src\ohci.c + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci_iso.c - - usb_core.c 1 - ..\libraries\m460\USBHostLib\src\usb_core.c + packages\nuvoton-series-latest\M460\USBHostLib\src\usb_core.c - - - ehci_iso.c + ehci.c 1 - ..\libraries\m460\USBHostLib\src\ehci_iso.c + packages\nuvoton-series-latest\M460\USBHostLib\src\ehci.c - - - ehci.c + ohci.c 1 - ..\libraries\m460\USBHostLib\src\ehci.c + packages\nuvoton-series-latest\M460\USBHostLib\src\ohci.c - - mem_alloc.c 1 - ..\libraries\m460\USBHostLib\src\mem_alloc.c + packages\nuvoton-series-latest\M460\USBHostLib\src\mem_alloc.c @@ -2951,8 +5275,6 @@ 1 ..\libraries\nu_packages\AudioCodec\acodec_nau8822.c - - audio_test.c 1 @@ -2978,8 +5300,6 @@ 1 ..\..\..\components\libc\posix\io\poll\poll.c - - select.c 1 @@ -2995,65 +5315,51 @@ 1 ..\..\..\components\legacy\usb\usbdevice\class\mstorage.c - - - usbdevice.c + usbdevice_core.c 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c - - - usbdevice_core.c + usbdevice.c 1 - ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c rt_usbh - - - mass.c - 1 - ..\..\..\components\legacy\usb\usbhost\class\mass.c - - - - - driver.c - 1 - ..\..\..\components\legacy\usb\usbhost\core\driver.c - - usbhost_core.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c - - udisk.c 1 ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - - usbhost.c + mass.c 1 - ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + ..\..\..\components\legacy\usb\usbhost\class\mass.c - - hub.c 1 ..\..\..\components\legacy\usb\usbhost\core\hub.c + + driver.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + + + usbhost.c + 1 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + @@ -3064,43 +5370,31 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_lwip.c 1 ..\..\..\components\net\sal\impl\af_inet_lwip.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -3112,16 +5406,14 @@ UTest - utest.c + TC_uassert.c 1 - ..\..\..\components\utilities\utest\utest.c + ..\..\..\components\utilities\utest\TC_uassert.c - - - TC_uassert.c + utest.c 1 - ..\..\..\components\utilities\utest\TC_uassert.c + ..\..\..\components\utilities\utest\utest.c @@ -3133,8 +5425,6 @@ 1 ..\..\..\components\utilities\ulog\ulog.c - - console_be.c 1 @@ -3142,19 +5432,24 @@ + + ::CMSIS + + - + - + - + - + +
diff --git a/bsp/nuvoton/numaker-m467hj/rtconfig.h b/bsp/nuvoton/numaker-m467hj/rtconfig.h index bfe98385cf9..99e2987a81c 100644 --- a/bsp/nuvoton/numaker-m467hj/rtconfig.h +++ b/bsp/nuvoton/numaker-m467hj/rtconfig.h @@ -684,7 +684,7 @@ /* Board extended module drivers */ -#define BOARD_USING_SENSON0_ID +#define BOARD_USING_SENSON0_ID /* end of Board extended module drivers */ /* Nuvoton Packages Config */ diff --git a/bsp/nuvoton/numaker-pfm-m487/project.uvoptx b/bsp/nuvoton/numaker-pfm-m487/project.uvoptx new file mode 100644 index 00000000000..4b9bd78d2d8 --- /dev/null +++ b/bsp/nuvoton/numaker-pfm-m487/project.uvoptx @@ -0,0 +1,3380 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + rtthread-m480 + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\keil5\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + + + + + + + + + + + BIN\UL2CM3.DLL + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC14000 -FN1 -FF0M481_AP_512 -FS00 -FL080000 -FP0($$Device:M487JIDAE$Flash\M481_AP_512.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 + 0 + 0 + + + + + + + + + + + + + Applications + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + applications\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + applications\mnt.c + mnt.c + 0 + 0 + + + + + Compiler + 0 + 0 + 0 + 0 + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscall_mem.c + syscall_mem.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\armlibc\syscalls.c + syscalls.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cctype.c + cctype.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstdlib.c + cstdlib.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cstring.c + cstring.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\ctime.c + ctime.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cunistd.c + cunistd.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\..\components\libc\compilers\common\cwchar.c + cwchar.c + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio.c + dev_audio.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\audio\dev_audio_pipe.c + dev_audio_pipe.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk.c + blk.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dev.c + blk_dev.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_dfs.c + blk_dfs.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\blk_partition.c + blk_partition.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\dfs.c + dfs.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\block\partitions\efi.c + efi.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\can\dev_can.c + dev_can.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\core\device.c + device.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_crc.c + hw_crc.c + 0 + 0 + + + 3 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_hash.c + hw_hash.c + 0 + 0 + + + 3 + 23 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_rng.c + hw_rng.c + 0 + 0 + + + 3 + 24 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + hw_symmetric.c + 0 + 0 + + + 3 + 25 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwcrypto\hwcrypto.c + hwcrypto.c + 0 + 0 + + + 3 + 26 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\hwtimer\hwtimer.c + hwtimer.c + 0 + 0 + + + 3 + 27 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + dev_i2c_bit_ops.c + 0 + 0 + + + 3 + 28 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_core.c + dev_i2c_core.c + 0 + 0 + + + 3 + 29 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\i2c\dev_i2c_dev.c + dev_i2c_dev.c + 0 + 0 + + + 3 + 30 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_comm.c + completion_comm.c + 0 + 0 + + + 3 + 31 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\completion_up.c + completion_up.c + 0 + 0 + + + 3 + 32 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\condvar.c + condvar.c + 0 + 0 + + + 3 + 33 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\dataqueue.c + dataqueue.c + 0 + 0 + + + 3 + 34 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\pipe.c + pipe.c + 0 + 0 + + + 3 + 35 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 3 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 3 + 37 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\waitqueue.c + waitqueue.c + 0 + 0 + + + 3 + 38 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\ipc\workqueue.c + workqueue.c + 0 + 0 + + + 3 + 39 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\adc.c + adc.c + 0 + 0 + + + 3 + 40 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\misc\rt_drv_pwm.c + rt_drv_pwm.c + 0 + 0 + + + 3 + 41 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pin\dev_pin.c + dev_pin.c + 0 + 0 + + + 3 + 42 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\lptimer.c + lptimer.c + 0 + 0 + + + 3 + 43 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\pm\pm.c + pm.c + 0 + 0 + + + 3 + 44 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\rtc\dev_rtc.c + dev_rtc.c + 0 + 0 + + + 3 + 45 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_block.c + dev_block.c + 0 + 0 + + + 3 + 46 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmc.c + dev_mmc.c + 0 + 0 + + + 3 + 47 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + dev_mmcsd_core.c + 0 + 0 + + + 3 + 48 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sd.c + dev_sd.c + 0 + 0 + + + 3 + 49 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\sdio\dev_sdio.c + dev_sdio.c + 0 + 0 + + + 3 + 50 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\serial\dev_serial.c + dev_serial.c + 0 + 0 + + + 3 + 51 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_qspi_core.c + dev_qspi_core.c + 0 + 0 + + + 3 + 52 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi.c + dev_spi.c + 0 + 0 + + + 3 + 53 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_core.c + dev_spi_core.c + 0 + 0 + + + 3 + 54 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + dev_spi_flash_sfud.c + 0 + 0 + + + 3 + 55 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud.c + sfud.c + 0 + 0 + + + 3 + 56 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + sfud_sfdp.c + 0 + 0 + + + 3 + 57 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\dev_watchdog.c + dev_watchdog.c + 0 + 0 + + + + + Drivers + 0 + 0 + 0 + 0 + + 4 + 58 + 1 + 0 + 0 + 0 + board\NuClockConfig\nutool_modclkcfg.c + nutool_modclkcfg.c + 0 + 0 + + + 4 + 59 + 1 + 0 + 0 + 0 + board\NuPinConfig\nutool_pincfg.c + nutool_pincfg.c + 0 + 0 + + + 4 + 60 + 1 + 0 + 0 + 0 + board\board_dev.c + board_dev.c + 0 + 0 + + + 4 + 61 + 2 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\ARM\startup_M480.s + startup_M480.s + 0 + 0 + + + 4 + 62 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\system_M480.c + system_M480.c + 0 + 0 + + + 4 + 63 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_bpwm.c + drv_bpwm.c + 0 + 0 + + + 4 + 64 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_bpwm_capture.c + drv_bpwm_capture.c + 0 + 0 + + + 4 + 65 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_can.c + drv_can.c + 0 + 0 + + + 4 + 66 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_clk.c + drv_clk.c + 0 + 0 + + + 4 + 67 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_common.c + drv_common.c + 0 + 0 + + + 4 + 68 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_crc.c + drv_crc.c + 0 + 0 + + + 4 + 69 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_crypto.c + drv_crypto.c + 0 + 0 + + + 4 + 70 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_eadc.c + drv_eadc.c + 0 + 0 + + + 4 + 71 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_ebi.c + drv_ebi.c + 0 + 0 + + + 4 + 72 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_ecap.c + drv_ecap.c + 0 + 0 + + + 4 + 73 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_emac.c + drv_emac.c + 0 + 0 + + + 4 + 74 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_epwm.c + drv_epwm.c + 0 + 0 + + + 4 + 75 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_epwm_capture.c + drv_epwm_capture.c + 0 + 0 + + + 4 + 76 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_fmc.c + drv_fmc.c + 0 + 0 + + + 4 + 77 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_gpio.c + drv_gpio.c + 0 + 0 + + + 4 + 78 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_hsotg.c + drv_hsotg.c + 0 + 0 + + + 4 + 79 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_hsusbd.c + drv_hsusbd.c + 0 + 0 + + + 4 + 80 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_i2c.c + drv_i2c.c + 0 + 0 + + + 4 + 81 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_i2s.c + drv_i2s.c + 0 + 0 + + + 4 + 82 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_pdma.c + drv_pdma.c + 0 + 0 + + + 4 + 83 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_qei.c + drv_qei.c + 0 + 0 + + + 4 + 84 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_qspi.c + drv_qspi.c + 0 + 0 + + + 4 + 85 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_rtc.c + drv_rtc.c + 0 + 0 + + + 4 + 86 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_scuart.c + drv_scuart.c + 0 + 0 + + + 4 + 87 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_sdh.c + drv_sdh.c + 0 + 0 + + + 4 + 88 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_sdio.c + drv_sdio.c + 0 + 0 + + + 4 + 89 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_softi2c.c + drv_softi2c.c + 0 + 0 + + + 4 + 90 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_spi.c + drv_spi.c + 0 + 0 + + + 4 + 91 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_spii2s.c + drv_spii2s.c + 0 + 0 + + + 4 + 92 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_timer.c + drv_timer.c + 0 + 0 + + + 4 + 93 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_timer_capture.c + drv_timer_capture.c + 0 + 0 + + + 4 + 94 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_tpwm.c + drv_tpwm.c + 0 + 0 + + + 4 + 95 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_trng.c + drv_trng.c + 0 + 0 + + + 4 + 96 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_uart.c + drv_uart.c + 0 + 0 + + + 4 + 97 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_ui2c.c + drv_ui2c.c + 0 + 0 + + + 4 + 98 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_usbd.c + drv_usbd.c + 0 + 0 + + + 4 + 99 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_usbhost.c + drv_usbhost.c + 0 + 0 + + + 4 + 100 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_uspi.c + drv_uspi.c + 0 + 0 + + + 4 + 101 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_uuart.c + drv_uuart.c + 0 + 0 + + + 4 + 102 + 1 + 0 + 0 + 0 + ..\libraries\m480\rtt_port\drv_wdt.c + drv_wdt.c + 0 + 0 + + + + + Fal + 0 + 0 + 0 + 0 + + 5 + 103 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_partition.c + fal_partition.c + 0 + 0 + + + 5 + 104 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_rtt.c + fal_rtt.c + 0 + 0 + + + 5 + 105 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal_flash.c + fal_flash.c + 0 + 0 + + + 5 + 106 + 1 + 0 + 0 + 0 + ..\..\..\components\fal\src\fal.c + fal.c + 0 + 0 + + + + + Filesystem + 0 + 0 + 0 + 0 + + 6 + 107 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + devfs.c + 0 + 0 + + + 6 + 108 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + dfs_elm.c + 0 + 0 + + + 6 + 109 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + ff.c + 0 + 0 + + + 6 + 110 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + ffunicode.c + 0 + 0 + + + 6 + 111 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs.c + src_dfs.c + 0 + 0 + + + 6 + 112 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + dfs_file.c + 0 + 0 + + + 6 + 113 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + dfs_fs.c + 0 + 0 + + + 6 + 114 + 1 + 0 + 0 + 0 + ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + dfs_posix.c + 0 + 0 + + + + + Finsh + 0 + 0 + 0 + 0 + + 7 + 115 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 7 + 116 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_parse.c + msh_parse.c + 0 + 0 + + + 7 + 117 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 7 + 118 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 7 + 119 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + + + Kernel + 0 + 0 + 0 + 0 + + 8 + 120 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + + + 8 + 121 + 1 + 0 + 0 + 0 + ..\..\..\src\components.c + components.c + 0 + 0 + + + 8 + 122 + 1 + 0 + 0 + 0 + ..\..\..\src\cpu_up.c + cpu_up.c + 0 + 0 + + + 8 + 123 + 1 + 0 + 0 + 0 + ..\..\..\src\defunct.c + defunct.c + 0 + 0 + + + 8 + 124 + 1 + 0 + 0 + 0 + ..\..\..\src\idle.c + idle.c + 0 + 0 + + + 8 + 125 + 1 + 0 + 0 + 0 + ..\..\..\src\ipc.c + ipc.c + 0 + 0 + + + 8 + 126 + 1 + 0 + 0 + 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 8 + 127 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 8 + 128 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 8 + 129 + 1 + 0 + 0 + 0 + ..\..\..\src\mempool.c + mempool.c + 0 + 0 + + + 8 + 130 + 1 + 0 + 0 + 0 + ..\..\..\src\object.c + object.c + 0 + 0 + + + 8 + 131 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_comm.c + scheduler_comm.c + 0 + 0 + + + 8 + 132 + 1 + 0 + 0 + 0 + ..\..\..\src\scheduler_up.c + scheduler_up.c + 0 + 0 + + + 8 + 133 + 1 + 0 + 0 + 0 + ..\..\..\src\signal.c + signal.c + 0 + 0 + + + 8 + 134 + 1 + 0 + 0 + 0 + ..\..\..\src\thread.c + thread.c + 0 + 0 + + + 8 + 135 + 1 + 0 + 0 + 0 + ..\..\..\src\timer.c + timer.c + 0 + 0 + + + + + klibc + 0 + 0 + 0 + 0 + + 9 + 136 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c + 0 + 0 + + + 9 + 137 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstdio.c + kstdio.c + 0 + 0 + + + 9 + 138 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c + 0 + 0 + + + 9 + 139 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kstring.c + kstring.c + 0 + 0 + + + 9 + 140 + 1 + 0 + 0 + 0 + ..\..\..\src\klibc\kerrno.c + kerrno.c + 0 + 0 + + + + + libcpu + 0 + 0 + 0 + 0 + + 10 + 141 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\atomic_arm.c + atomic_arm.c + 0 + 0 + + + 10 + 142 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 10 + 143 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + 10 + 144 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + context_rvds.S + 0 + 0 + + + 10 + 145 + 1 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\cpuport.c + cpuport.c + 0 + 0 + + + + + Libraries + 0 + 0 + 0 + 0 + + 11 + 146 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_can.c + nu_can.c + 0 + 0 + + + 11 + 147 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qei.c + nu_qei.c + 0 + 0 + + + 11 + 148 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_uart.c + nu_uart.c + 0 + 0 + + + 11 + 149 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_epwm.c + nu_epwm.c + 0 + 0 + + + 11 + 150 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ccap.c + nu_ccap.c + 0 + 0 + + + 11 + 151 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer_pwm.c + nu_timer_pwm.c + 0 + 0 + + + 11 + 152 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_gpio.c + nu_gpio.c + 0 + 0 + + + 11 + 153 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_emac.c + nu_emac.c + 0 + 0 + + + 11 + 154 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_trng.c + nu_trng.c + 0 + 0 + + + 11 + 155 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wwdt.c + nu_wwdt.c + 0 + 0 + + + 11 + 156 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_dac.c + nu_dac.c + 0 + 0 + + + 11 + 157 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_rtc.c + nu_rtc.c + 0 + 0 + + + 11 + 158 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crc.c + nu_crc.c + 0 + 0 + + + 11 + 159 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_uart.c + nu_usci_uart.c + 0 + 0 + + + 11 + 160 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_eadc.c + nu_eadc.c + 0 + 0 + + + 11 + 161 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_bpwm.c + nu_bpwm.c + 0 + 0 + + + 11 + 162 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_pdma.c + nu_pdma.c + 0 + 0 + + + 11 + 163 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ecap.c + nu_ecap.c + 0 + 0 + + + 11 + 164 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_spi.c + nu_usci_spi.c + 0 + 0 + + + 11 + 165 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sc.c + nu_sc.c + 0 + 0 + + + 11 + 166 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_clk.c + nu_clk.c + 0 + 0 + + + 11 + 167 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ebi.c + nu_ebi.c + 0 + 0 + + + 11 + 168 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2c.c + nu_i2c.c + 0 + 0 + + + 11 + 169 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sys.c + nu_sys.c + 0 + 0 + + + 11 + 170 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_hsusbd.c + nu_hsusbd.c + 0 + 0 + + + 11 + 171 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_i2c.c + nu_usci_i2c.c + 0 + 0 + + + 11 + 172 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wdt.c + nu_wdt.c + 0 + 0 + + + 11 + 173 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usbd.c + nu_usbd.c + 0 + 0 + + + 11 + 174 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer.c + nu_timer.c + 0 + 0 + + + 11 + 175 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_scuart.c + nu_scuart.c + 0 + 0 + + + 11 + 176 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2s.c + nu_i2s.c + 0 + 0 + + + 11 + 177 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_acmp.c + nu_acmp.c + 0 + 0 + + + 11 + 178 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sdh.c + nu_sdh.c + 0 + 0 + + + 11 + 179 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spi.c + nu_spi.c + 0 + 0 + + + 11 + 180 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crypto.c + nu_crypto.c + 0 + 0 + + + 11 + 181 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_fmc.c + nu_fmc.c + 0 + 0 + + + 11 + 182 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spim.c + nu_spim.c + 0 + 0 + + + 11 + 183 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qspi.c + nu_qspi.c + 0 + 0 + + + + + lwIP + 0 + 0 + 0 + 0 + + 12 + 184 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 12 + 185 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 12 + 186 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\err.c + err.c + 0 + 0 + + + 12 + 187 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 12 + 188 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netdb.c + netdb.c + 0 + 0 + + + 12 + 189 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 12 + 190 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\sockets.c + sockets.c + 0 + 0 + + + 12 + 191 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 12 + 192 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\apps\ping\ping.c + ping.c + 0 + 0 + + + 12 + 193 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\def.c + def.c + 0 + 0 + + + 12 + 194 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\dns.c + dns.c + 0 + 0 + + + 12 + 195 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 12 + 196 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\init.c + init.c + 0 + 0 + + + 12 + 197 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ip.c + ip.c + 0 + 0 + + + 12 + 198 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 12 + 199 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 12 + 200 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 12 + 201 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 12 + 202 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 12 + 203 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 12 + 204 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 12 + 205 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 12 + 206 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\memp.c + memp.c + 0 + 0 + + + 12 + 207 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\netif.c + netif.c + 0 + 0 + + + 12 + 208 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 12 + 209 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\raw.c + raw.c + 0 + 0 + + + 12 + 210 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\stats.c + stats.c + 0 + 0 + + + 12 + 211 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\sys.c + sys.c + 0 + 0 + + + 12 + 212 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp.c + tcp.c + 0 + 0 + + + 12 + 213 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 12 + 214 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 12 + 215 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 12 + 216 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\core\udp.c + udp.c + 0 + 0 + + + 12 + 217 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + 12 + 218 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\lowpan6.c + lowpan6.c + 0 + 0 + + + 12 + 219 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\ethernetif.c + ethernetif.c + 0 + 0 + + + 12 + 220 + 1 + 0 + 0 + 0 + ..\..\..\components\net\lwip\port\sys_arch.c + sys_arch.c + 0 + 0 + + + + + m480_usbhostlib + 0 + 0 + 0 + 0 + + 13 + 221 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\ohci.c + ohci.c + 0 + 0 + + + 13 + 222 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci.c + ehci.c + 0 + 0 + + + 13 + 223 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\usb_core.c + usb_core.c + 0 + 0 + + + 13 + 224 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\mem_alloc.c + mem_alloc.c + 0 + 0 + + + 13 + 225 + 1 + 0 + 0 + 0 + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci_iso.c + ehci_iso.c + 0 + 0 + + + + + nu_pkgs_demo + 0 + 0 + 0 + 0 + + 14 + 226 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\slcd_show_tick.c + slcd_show_tick.c + 0 + 0 + + + 14 + 227 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + usbd_hid_dance_mouse.c + 0 + 0 + + + 14 + 228 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\atdev_utils.c + atdev_utils.c + 0 + 0 + + + 14 + 229 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\wormhole_demo.c + wormhole_demo.c + 0 + 0 + + + 14 + 230 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + usbd_cdc_vcom_echo.c + 0 + 0 + + + 14 + 231 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_saver.c + ccap_saver.c + 0 + 0 + + + 14 + 232 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\smp_demo.c + smp_demo.c + 0 + 0 + + + 14 + 233 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\hwsem_counter.c + hwsem_counter.c + 0 + 0 + + + 14 + 234 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\Demo\ccap_demo.c + ccap_demo.c + 0 + 0 + + + + + nu_pkgs_nau88l25 + 0 + 0 + 0 + 0 + + 15 + 235 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\acodec_nau88l25.c + acodec_nau88l25.c + 0 + 0 + + + 15 + 236 + 1 + 0 + 0 + 0 + ..\libraries\nu_packages\AudioCodec\audio_test.c + audio_test.c + 0 + 0 + + + + + rt_usbd + 0 + 0 + 0 + 0 + + 16 + 237 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c + usbdevice_core.c + 0 + 0 + + + 16 + 238 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c + usbdevice.c + 0 + 0 + + + 16 + 239 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbdevice\class\hid.c + hid.c + 0 + 0 + + + + + rt_usbh + 0 + 0 + 0 + 0 + + 17 + 240 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + usbhost.c + 0 + 0 + + + 17 + 241 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\driver.c + driver.c + 0 + 0 + + + 17 + 242 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\hub.c + hub.c + 0 + 0 + + + 17 + 243 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c + usbhost_core.c + 0 + 0 + + + 17 + 244 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\udisk.c + udisk.c + 0 + 0 + + + 17 + 245 + 1 + 0 + 0 + 0 + ..\..\..\components\legacy\usb\usbhost\class\mass.c + mass.c + 0 + 0 + + + + + SAL + 0 + 0 + 0 + 0 + + 18 + 246 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev.c + netdev.c + 0 + 0 + + + 18 + 247 + 1 + 0 + 0 + 0 + ..\..\..\components\net\netdev\src\netdev_ipaddr.c + netdev_ipaddr.c + 0 + 0 + + + 18 + 248 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\dfs_net\dfs_net.c + dfs_net.c + 0 + 0 + + + 18 + 249 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\impl\af_inet_lwip.c + af_inet_lwip.c + 0 + 0 + + + 18 + 250 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_netdb.c + net_netdb.c + 0 + 0 + + + 18 + 251 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\socket\net_sockets.c + net_sockets.c + 0 + 0 + + + 18 + 252 + 1 + 0 + 0 + 0 + ..\..\..\components\net\sal\src\sal_socket.c + sal_socket.c + 0 + 0 + + + + + UTest + 0 + 0 + 0 + 0 + + 19 + 253 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\utest.c + utest.c + 0 + 0 + + + 19 + 254 + 1 + 0 + 0 + 0 + ..\..\..\components\utilities\utest\TC_uassert.c + TC_uassert.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/bsp/nuvoton/numaker-pfm-m487/project.uvprojx b/bsp/nuvoton/numaker-pfm-m487/project.uvprojx index 252efcae8de..2f4a6c85a3f 100644 --- a/bsp/nuvoton/numaker-pfm-m487/project.uvprojx +++ b/bsp/nuvoton/numaker-pfm-m487/project.uvprojx @@ -1,42 +1,46 @@ + 2.1 +
### uVision Project, (C) Keil Software
+ rtthread-m480 0x4 ARM-ADS + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 M487JIDAE Nuvoton - Nuvoton.NuMicro_DFP.1.3.13 - https://github.com/OpenNuvoton/cmsis-packs/raw/master/ + Nuvoton.NuMicro_DFP.1.3.25 + https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x28000) IROM(0x00000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) - - + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0M481_AP_512 -FS00 -FL080000 -FP0($$Device:M487JIDAE$Flash\M481_AP_512.FLM)) 0 $$Device:M487JIDAE$Device\M480\Include\M480.h - - - - - - - - - + + + + + + + + + $$Device:M487JIDAE$SVD\Nuvoton\M481_v1.svd 0 0 - - - - - + + + + + 0 0 @@ -58,8 +62,8 @@ 0 0 - - + + 0 0 0 @@ -68,8 +72,8 @@ 0 0 - - + + 0 0 0 @@ -79,14 +83,14 @@ 1 0 fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" - + 0 0 0 0 0 - + 0 @@ -100,19 +104,19 @@ 0 0 3 - - + + 1 SARMCM3.DLL - + DARMCM1.DLL - + SARMCM3.DLL - + TARMCM1.DLL - + @@ -135,10 +139,10 @@ 1 BIN\UL2CM3.DLL "" () - - - - + + + + 0 @@ -171,7 +175,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -181,6 +185,8 @@ 0 2 0 + 0 + 0 0 0 8 @@ -304,7 +310,7 @@ 0x0 - + 1 @@ -331,10 +337,10 @@ 0 0 - --c99 - __STDC_LIMIT_MACROS, RT_USING_LIBC, RT_USING_ARMLIBC, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND - - ..\..\..\components\net\lwip\port;board\NuClockConfig;..\..\..\components\drivers\audio;..\..\..\components\drivers\include;..\libraries\m480\Device\Nuvoton\M480\Include;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\drivers\spi;..\..\..\components\legacy\usb\usbhost;..\..\..\components\legacy\include;..\..\..\components\libc\posix\ipc;board;..\libraries\m480\StdDriver\inc;..\..\..\components\libc\compilers\common\extension;..\..\..\components\utilities\utest;..\libraries\nu_packages\Demo;..\..\..\components\legacy\usb\usbhost\core;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\include;..\libraries\nu_packages\AudioCodec;..\..\..\components\libc\posix\io\epoll;..\..\..\components\net\lwip\lwip-2.0.3\src\include\ipv4;..\..\..\components\libc\posix\io\eventfd;.;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\..\..\components\net\sal\include;..\..\..\components\drivers\phy;..\..\..\components\drivers\hwcrypto;..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;..\..\..\components\drivers\smp_call;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\include;..\libraries\m480\CMSIS\Include;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\drivers\include;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\finsh;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\libcpu\arm\common;..\..\..\components\net\lwip\lwip-2.0.3\src\include\netif;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\socket;..\libraries\m480\USBHostLib\inc;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\libraries\m480\rtt_port;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\net\sal\impl;..\..\..\components\drivers\include;..\..\..\components\net\netdev\include;..\..\..\components\net\lwip\lwip-2.0.3\src\include;..\..\..\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\fal\inc;applications;board\NuPinConfig;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\drivers\include;..\libraries\nu_packages\TPC;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\compilers\common\extension\fcntl\octal + --c99 --gnu --diag_suppress=1,177,550 + __CLK_TCK=RT_TICK_PER_SECOND, __STDC_LIMIT_MACROS, __RTTHREAD__, RT_USING_ARMLIBC, RT_USING_LIBC + + ..\libraries\nu_packages\TPC;..\..\..\components\utilities\utest;applications;..\..\..\components\drivers\include;..\..\..\components\dfs\dfs_v1\filesystems\elmfat;..\..\..\components\drivers\smp_call;..\..\..\components\drivers\include;..\..\..\components\drivers\spi\sfud\inc;..\..\..\components\net\lwip\lwip-2.0.3\src\include\netif;..\..\..\components\finsh;..\..\..\components\legacy\include;..\..\..\components\drivers\spi;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension\fcntl\octal;packages\nuvoton-series-latest\M480\USBHostLib\inc;..\..\..\include;..\..\..\components\libc\posix\io\epoll;..\..\..\components\net\netdev\include;..\..\..\components\drivers\audio;..\..\..\components\net\lwip\lwip-2.0.3\src\include\ipv4;board\NuPinConfig;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\libraries\nu_packages\NuUtils\inc;..\libraries\nu_packages\Demo;packages\nuvoton-series-latest\M480\StdDriver\inc;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\socket;..\..\..\components\drivers\include;..\..\..\components\net\sal\include\dfs_net;..\..\..\components\drivers\include;..\..\..\components\net\sal\include;..\..\..\components\libc\posix\io\poll;board;..\..\..\components\drivers\sdio\sdhci\include;..\..\..\components\net\lwip\lwip-2.0.3\src\include;..\..\..\components\drivers\include;packages\nuvoton-cmsis-latest\m031_m480_ma35\Include;board\NuClockConfig;..\..\..\components\dfs\dfs_v1\include;..\..\..\components\dfs\dfs_v1\filesystems\devfs;..\..\..\components\drivers\include;..\..\..\components\drivers\include;.;..\..\..\components\drivers\include;packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Include;..\..\..\libcpu\arm\common;..\libraries\nu_packages\AudioCodec;..\..\..\components\libc\posix\ipc;..\..\..\components\legacy\usb\usbhost\core;..\libraries\m480\rtt_port;..\..\..\components\libc\compilers\common\extension;..\..\..\components\drivers\phy;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbdevice;..\..\..\components\legacy\usb\usbhost\class;..\..\..\components\drivers\include;..\..\..\components\legacy\usb\usbhost\include;..\..\..\components\net\sal\impl;..\..\..\components\libc\compilers\common\include;..\..\..\components\net\sal\include\socket\sys_socket;..\..\..\components\legacy\usb\usbhost;..\..\..\components\net\lwip\port;..\..\..\components\fal\inc;..\..\..\components\drivers\hwcrypto;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include @@ -347,12 +353,12 @@ 0 0 0 - 0 + 4 - - - - + + + + @@ -364,13 +370,13 @@ 0 0x00000000 0x20000000 - + .\linking_scripts\m480_flash.sct - - - - - + + + + + @@ -383,8 +389,6 @@ 1 applications\main.c - - mnt.c 1 @@ -400,50 +404,36 @@ 1 ..\..\..\components\libc\compilers\armlibc\syscall_mem.c - - syscalls.c 1 ..\..\..\components\libc\compilers\armlibc\syscalls.c - - cctype.c 1 ..\..\..\components\libc\compilers\common\cctype.c - - cstdlib.c 1 ..\..\..\components\libc\compilers\common\cstdlib.c - - cstring.c 1 ..\..\..\components\libc\compilers\common\cstring.c - - ctime.c 1 ..\..\..\components\libc\compilers\common\ctime.c - - cunistd.c 1 ..\..\..\components\libc\compilers\common\cunistd.c - - cwchar.c 1 @@ -459,887 +449,2628 @@ 1 ..\..\..\components\drivers\audio\dev_audio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_audio_pipe.c 1 ..\..\..\components\drivers\audio\dev_audio_pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk.c 1 ..\..\..\components\drivers\block\blk.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dev.c 1 ..\..\..\components\drivers\block\blk_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_dfs.c 1 ..\..\..\components\drivers\block\blk_dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - blk_partition.c 1 ..\..\..\components\drivers\block\blk_partition.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dfs.c 1 ..\..\..\components\drivers\block\partitions\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - efi.c 1 ..\..\..\components\drivers\block\partitions\efi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_can.c 1 ..\..\..\components\drivers\can\dev_can.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - device.c 1 ..\..\..\components\drivers\core\device.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_crc.c 1 ..\..\..\components\drivers\hwcrypto\hw_crc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_hash.c 1 ..\..\..\components\drivers\hwcrypto\hw_hash.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_rng.c 1 ..\..\..\components\drivers\hwcrypto\hw_rng.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hw_symmetric.c 1 ..\..\..\components\drivers\hwcrypto\hw_symmetric.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwcrypto.c 1 ..\..\..\components\drivers\hwcrypto\hwcrypto.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - hwtimer.c 1 ..\..\..\components\drivers\hwtimer\hwtimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_bit_ops.c 1 ..\..\..\components\drivers\i2c\dev_i2c_bit_ops.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_core.c 1 ..\..\..\components\drivers\i2c\dev_i2c_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_i2c_dev.c 1 ..\..\..\components\drivers\i2c\dev_i2c_dev.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_comm.c 1 ..\..\..\components\drivers\ipc\completion_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - completion_up.c 1 ..\..\..\components\drivers\ipc\completion_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - condvar.c 1 ..\..\..\components\drivers\ipc\condvar.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dataqueue.c 1 ..\..\..\components\drivers\ipc\dataqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - pipe.c 1 ..\..\..\components\drivers\ipc\pipe.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringblk_buf.c 1 ..\..\..\components\drivers\ipc\ringblk_buf.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - ringbuffer.c 1 ..\..\..\components\drivers\ipc\ringbuffer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - waitqueue.c 1 ..\..\..\components\drivers\ipc\waitqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - workqueue.c 1 ..\..\..\components\drivers\ipc\workqueue.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - adc.c 1 ..\..\..\components\drivers\misc\adc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - rt_drv_pwm.c 1 ..\..\..\components\drivers\misc\rt_drv_pwm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_pin.c 1 ..\..\..\components\drivers\pin\dev_pin.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - lptimer.c 1 ..\..\..\components\drivers\pm\lptimer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - pm.c 1 ..\..\..\components\drivers\pm\pm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_rtc.c 1 ..\..\..\components\drivers\rtc\dev_rtc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_block.c 1 ..\..\..\components\drivers\sdio\dev_block.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmc.c 1 ..\..\..\components\drivers\sdio\dev_mmc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_mmcsd_core.c 1 ..\..\..\components\drivers\sdio\dev_mmcsd_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sd.c 1 ..\..\..\components\drivers\sdio\dev_sd.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_sdio.c 1 ..\..\..\components\drivers\sdio\dev_sdio.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_serial.c 1 ..\..\..\components\drivers\serial\dev_serial.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_qspi_core.c 1 ..\..\..\components\drivers\spi\dev_qspi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi.c 1 ..\..\..\components\drivers\spi\dev_spi.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_core.c 1 ..\..\..\components\drivers\spi\dev_spi_core.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_spi_flash_sfud.c 1 ..\..\..\components\drivers\spi\dev_spi_flash_sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - sfud_sfdp.c 1 ..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + - - dev_watchdog.c 1 ..\..\..\components\drivers\watchdog\dev_watchdog.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 __RT_IPC_SOURCE__ - + @@ -1349,315 +3080,227 @@ Drivers - - - startup_M480.s - 2 - ..\libraries\m480\Device\Nuvoton\M480\Source\ARM\startup_M480.s - - - - - system_M480.c - 1 - ..\libraries\m480\Device\Nuvoton\M480\Source\system_M480.c - - nutool_modclkcfg.c 1 board\NuClockConfig\nutool_modclkcfg.c - - nutool_pincfg.c 1 board\NuPinConfig\nutool_pincfg.c - - board_dev.c 1 board\board_dev.c - - + + startup_M480.s + 2 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\ARM\startup_M480.s + + + system_M480.c + 1 + packages\nuvoton-series-latest\M480\Device\Nuvoton\M480\Source\system_M480.c + drv_bpwm.c 1 ..\libraries\m480\rtt_port\drv_bpwm.c - - drv_bpwm_capture.c 1 ..\libraries\m480\rtt_port\drv_bpwm_capture.c - - drv_can.c 1 ..\libraries\m480\rtt_port\drv_can.c - - drv_clk.c 1 ..\libraries\m480\rtt_port\drv_clk.c - - drv_common.c 1 ..\libraries\m480\rtt_port\drv_common.c - - drv_crc.c 1 ..\libraries\m480\rtt_port\drv_crc.c - - drv_crypto.c 1 ..\libraries\m480\rtt_port\drv_crypto.c - - drv_eadc.c 1 ..\libraries\m480\rtt_port\drv_eadc.c - - drv_ebi.c 1 ..\libraries\m480\rtt_port\drv_ebi.c - - drv_ecap.c 1 ..\libraries\m480\rtt_port\drv_ecap.c - - drv_emac.c 1 ..\libraries\m480\rtt_port\drv_emac.c - - drv_epwm.c 1 ..\libraries\m480\rtt_port\drv_epwm.c - - drv_epwm_capture.c 1 ..\libraries\m480\rtt_port\drv_epwm_capture.c - - drv_fmc.c 1 ..\libraries\m480\rtt_port\drv_fmc.c - - drv_gpio.c 1 ..\libraries\m480\rtt_port\drv_gpio.c - - drv_hsotg.c 1 ..\libraries\m480\rtt_port\drv_hsotg.c - - drv_hsusbd.c 1 ..\libraries\m480\rtt_port\drv_hsusbd.c - - drv_i2c.c 1 ..\libraries\m480\rtt_port\drv_i2c.c - - drv_i2s.c 1 ..\libraries\m480\rtt_port\drv_i2s.c - - drv_pdma.c 1 ..\libraries\m480\rtt_port\drv_pdma.c - - drv_qei.c 1 ..\libraries\m480\rtt_port\drv_qei.c - - drv_qspi.c 1 ..\libraries\m480\rtt_port\drv_qspi.c - - drv_rtc.c 1 ..\libraries\m480\rtt_port\drv_rtc.c - - drv_scuart.c 1 ..\libraries\m480\rtt_port\drv_scuart.c - - drv_sdh.c 1 ..\libraries\m480\rtt_port\drv_sdh.c - - drv_sdio.c 1 ..\libraries\m480\rtt_port\drv_sdio.c - - drv_softi2c.c 1 ..\libraries\m480\rtt_port\drv_softi2c.c - - drv_spi.c 1 ..\libraries\m480\rtt_port\drv_spi.c - - drv_spii2s.c 1 ..\libraries\m480\rtt_port\drv_spii2s.c - - drv_timer.c 1 ..\libraries\m480\rtt_port\drv_timer.c - - drv_timer_capture.c 1 ..\libraries\m480\rtt_port\drv_timer_capture.c - - drv_tpwm.c 1 ..\libraries\m480\rtt_port\drv_tpwm.c - - drv_trng.c 1 ..\libraries\m480\rtt_port\drv_trng.c - - drv_uart.c 1 ..\libraries\m480\rtt_port\drv_uart.c - - drv_ui2c.c 1 ..\libraries\m480\rtt_port\drv_ui2c.c - - drv_usbd.c 1 ..\libraries\m480\rtt_port\drv_usbd.c - - drv_usbhost.c 1 ..\libraries\m480\rtt_port\drv_usbhost.c - - drv_uspi.c 1 ..\libraries\m480\rtt_port\drv_uspi.c - - drv_uuart.c 1 ..\libraries\m480\rtt_port\drv_uuart.c - - drv_wdt.c 1 @@ -1669,30 +3312,24 @@ Fal - fal.c + fal_partition.c 1 - ..\..\..\components\fal\src\fal.c + ..\..\..\components\fal\src\fal_partition.c - - fal_rtt.c 1 ..\..\..\components\fal\src\fal_rtt.c - - fal_flash.c 1 ..\..\..\components\fal\src\fal_flash.c - - - fal_partition.c + fal.c 1 - ..\..\..\components\fal\src\fal_partition.c + ..\..\..\components\fal\src\fal.c @@ -1704,146 +3341,444 @@ 1 ..\..\..\components\dfs\dfs_v1\filesystems\devfs\devfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_elm.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\dfs_elm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ff.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ff.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - ffunicode.c 1 ..\..\..\components\dfs\dfs_v1\filesystems\elmfat\ffunicode.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - src_dfs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_file.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_file.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_fs.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_fs.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + - - dfs_posix.c 1 ..\..\..\components\dfs\dfs_v1\src\dfs_posix.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 --c99 - + @@ -1859,33 +3794,25 @@ 1 ..\..\..\components\finsh\shell.c - - - msh_file.c + msh_parse.c 1 - ..\..\..\components\finsh\msh_file.c + ..\..\..\components\finsh\msh_parse.c - - - cmd.c + msh_file.c 1 - ..\..\..\components\finsh\cmd.c + ..\..\..\components\finsh\msh_file.c - - msh.c 1 ..\..\..\components\finsh\msh.c - - - msh_parse.c + cmd.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\cmd.c @@ -1897,298 +3824,892 @@ 1 ..\..\..\src\clock.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - components.c 1 ..\..\..\src\components.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - cpu_up.c 1 ..\..\..\src\cpu_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - defunct.c 1 ..\..\..\src\defunct.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - idle.c 1 ..\..\..\src\idle.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - ipc.c 1 ..\..\..\src\ipc.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - irq.c 1 ..\..\..\src\irq.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - kservice.c 1 ..\..\..\src\kservice.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mem.c 1 ..\..\..\src\mem.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - mempool.c 1 ..\..\..\src\mempool.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - object.c 1 ..\..\..\src\object.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_comm.c 1 ..\..\..\src\scheduler_comm.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - scheduler_up.c 1 ..\..\..\src\scheduler_up.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - signal.c 1 ..\..\..\src\signal.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - thread.c 1 ..\..\..\src\thread.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + - - timer.c 1 ..\..\..\src\timer.c + + 2 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 __RT_KERNEL_SOURCE__ - + @@ -2198,40 +4719,32 @@ klibc - - - rt_vsnprintf_tiny.c - 1 - ..\..\..\src\klibc\rt_vsnprintf_tiny.c - - - - - kerrno.c - 1 - ..\..\..\src\klibc\kerrno.c - - rt_vsscanf.c 1 ..\..\..\src\klibc\rt_vsscanf.c - - kstdio.c 1 ..\..\..\src\klibc\kstdio.c - - + + rt_vsnprintf_tiny.c + 1 + ..\..\..\src\klibc\rt_vsnprintf_tiny.c + kstring.c 1 ..\..\..\src\klibc\kstring.c + + kerrno.c + 1 + ..\..\..\src\klibc\kerrno.c + @@ -2242,29 +4755,21 @@ 1 ..\..\..\libcpu\arm\common\atomic_arm.c - - div0.c 1 ..\..\..\libcpu\arm\common\div0.c - - showmem.c 1 ..\..\..\libcpu\arm\common\showmem.c - - context_rvds.S 2 ..\..\..\libcpu\arm\cortex-m4\context_rvds.S - - cpuport.c 1 @@ -2276,268 +4781,194 @@ Libraries - nu_emac.c + nu_can.c 1 - ..\libraries\m480\StdDriver\src\nu_emac.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_can.c - - - nu_i2s.c + nu_qei.c 1 - ..\libraries\m480\StdDriver\src\nu_i2s.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qei.c - - - nu_wdt.c + nu_uart.c 1 - ..\libraries\m480\StdDriver\src\nu_wdt.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_uart.c - - - nu_ebi.c + nu_epwm.c 1 - ..\libraries\m480\StdDriver\src\nu_ebi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_epwm.c - - - nu_usci_uart.c + nu_ccap.c 1 - ..\libraries\m480\StdDriver\src\nu_usci_uart.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ccap.c - - - nu_pdma.c + nu_timer_pwm.c 1 - ..\libraries\m480\StdDriver\src\nu_pdma.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer_pwm.c - - - nu_epwm.c + nu_gpio.c 1 - ..\libraries\m480\StdDriver\src\nu_epwm.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_gpio.c - - - nu_timer_pwm.c + nu_emac.c 1 - ..\libraries\m480\StdDriver\src\nu_timer_pwm.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_emac.c - - - nu_sc.c + nu_trng.c 1 - ..\libraries\m480\StdDriver\src\nu_sc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_trng.c - - - nu_usci_spi.c + nu_wwdt.c 1 - ..\libraries\m480\StdDriver\src\nu_usci_spi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wwdt.c - - - nu_acmp.c + nu_dac.c 1 - ..\libraries\m480\StdDriver\src\nu_acmp.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_dac.c - - - nu_qei.c + nu_rtc.c 1 - ..\libraries\m480\StdDriver\src\nu_qei.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_rtc.c - - - nu_crypto.c + nu_crc.c 1 - ..\libraries\m480\StdDriver\src\nu_crypto.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crc.c - - - nu_rtc.c + nu_usci_uart.c 1 - ..\libraries\m480\StdDriver\src\nu_rtc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_uart.c - - - nu_uart.c + nu_eadc.c 1 - ..\libraries\m480\StdDriver\src\nu_uart.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_eadc.c - - nu_bpwm.c 1 - ..\libraries\m480\StdDriver\src\nu_bpwm.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_bpwm.c - - - nu_qspi.c + nu_pdma.c 1 - ..\libraries\m480\StdDriver\src\nu_qspi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_pdma.c - - - nu_fmc.c + nu_ecap.c 1 - ..\libraries\m480\StdDriver\src\nu_fmc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ecap.c - - - nu_crc.c + nu_usci_spi.c 1 - ..\libraries\m480\StdDriver\src\nu_crc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_spi.c - - - nu_trng.c + nu_sc.c 1 - ..\libraries\m480\StdDriver\src\nu_trng.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sc.c - - - nu_hsusbd.c + nu_clk.c 1 - ..\libraries\m480\StdDriver\src\nu_hsusbd.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_clk.c - - - nu_sys.c + nu_ebi.c 1 - ..\libraries\m480\StdDriver\src\nu_sys.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_ebi.c - - - nu_scuart.c + nu_i2c.c 1 - ..\libraries\m480\StdDriver\src\nu_scuart.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2c.c - - - nu_ccap.c + nu_sys.c 1 - ..\libraries\m480\StdDriver\src\nu_ccap.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sys.c - - - nu_wwdt.c + nu_hsusbd.c 1 - ..\libraries\m480\StdDriver\src\nu_wwdt.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_hsusbd.c - - - nu_timer.c + nu_usci_i2c.c 1 - ..\libraries\m480\StdDriver\src\nu_timer.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usci_i2c.c - - - nu_can.c + nu_wdt.c 1 - ..\libraries\m480\StdDriver\src\nu_can.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_wdt.c - - - nu_sdh.c + nu_usbd.c 1 - ..\libraries\m480\StdDriver\src\nu_sdh.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_usbd.c - - - nu_gpio.c + nu_timer.c 1 - ..\libraries\m480\StdDriver\src\nu_gpio.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_timer.c - - - nu_spim.c + nu_scuart.c 1 - ..\libraries\m480\StdDriver\src\nu_spim.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_scuart.c - - - nu_i2c.c + nu_i2s.c 1 - ..\libraries\m480\StdDriver\src\nu_i2c.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_i2s.c - - - nu_eadc.c + nu_acmp.c 1 - ..\libraries\m480\StdDriver\src\nu_eadc.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_acmp.c - - - nu_usbd.c + nu_sdh.c 1 - ..\libraries\m480\StdDriver\src\nu_usbd.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_sdh.c - - - nu_usci_i2c.c + nu_spi.c 1 - ..\libraries\m480\StdDriver\src\nu_usci_i2c.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spi.c - - - nu_spi.c + nu_crypto.c 1 - ..\libraries\m480\StdDriver\src\nu_spi.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_crypto.c - - - nu_dac.c + nu_fmc.c 1 - ..\libraries\m480\StdDriver\src\nu_dac.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_fmc.c - - - nu_clk.c + nu_spim.c 1 - ..\libraries\m480\StdDriver\src\nu_clk.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_spim.c - - - nu_ecap.c + nu_qspi.c 1 - ..\libraries\m480\StdDriver\src\nu_ecap.c + packages\nuvoton-series-latest\M480\StdDriver\src\nu_qspi.c @@ -2549,253 +4980,181 @@ 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_lib.c - - api_msg.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\api_msg.c - - err.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\err.c - - netbuf.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netbuf.c - - netdb.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netdb.c - - netifapi.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\netifapi.c - - sockets.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\sockets.c - - tcpip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\api\tcpip.c - - ping.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\apps\ping\ping.c - - def.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\def.c - - dns.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\dns.c - - inet_chksum.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\inet_chksum.c - - init.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\init.c - - ip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ip.c - - autoip.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\autoip.c - - dhcp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\dhcp.c - - etharp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\etharp.c - - icmp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\icmp.c - - igmp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\igmp.c - - ip4.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4.c - - ip4_addr.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_addr.c - - ip4_frag.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\ipv4\ip4_frag.c - - memp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\memp.c - - netif.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\netif.c - - pbuf.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\pbuf.c - - raw.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\raw.c - - stats.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\stats.c - - sys.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\sys.c - - tcp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp.c - - tcp_in.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_in.c - - tcp_out.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\tcp_out.c - - timeouts.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\timeouts.c - - udp.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\core\udp.c - - ethernet.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\ethernet.c - - lowpan6.c 1 ..\..\..\components\net\lwip\lwip-2.0.3\src\netif\lowpan6.c - - ethernetif.c 1 ..\..\..\components\net\lwip\port\ethernetif.c - - sys_arch.c 1 @@ -2809,35 +5168,27 @@ ohci.c 1 - ..\libraries\m480\USBHostLib\src\ohci.c + packages\nuvoton-series-latest\M480\USBHostLib\src\ohci.c - - - ehci_iso.c + ehci.c 1 - ..\libraries\m480\USBHostLib\src\ehci_iso.c + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci.c - - usb_core.c 1 - ..\libraries\m480\USBHostLib\src\usb_core.c + packages\nuvoton-series-latest\M480\USBHostLib\src\usb_core.c - - mem_alloc.c 1 - ..\libraries\m480\USBHostLib\src\mem_alloc.c + packages\nuvoton-series-latest\M480\USBHostLib\src\mem_alloc.c - - - ehci.c + ehci_iso.c 1 - ..\libraries\m480\USBHostLib\src\ehci.c + packages\nuvoton-series-latest\M480\USBHostLib\src\ehci_iso.c @@ -2845,65 +5196,49 @@ nu_pkgs_demo - atdev_utils.c + slcd_show_tick.c 1 - ..\libraries\nu_packages\Demo\atdev_utils.c + ..\libraries\nu_packages\Demo\slcd_show_tick.c - - - smp_demo.c + usbd_hid_dance_mouse.c 1 - ..\libraries\nu_packages\Demo\smp_demo.c + ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c - - - usbd_hid_dance_mouse.c + atdev_utils.c 1 - ..\libraries\nu_packages\Demo\usbd_hid_dance_mouse.c + ..\libraries\nu_packages\Demo\atdev_utils.c - - - slcd_show_tick.c + wormhole_demo.c 1 - ..\libraries\nu_packages\Demo\slcd_show_tick.c + ..\libraries\nu_packages\Demo\wormhole_demo.c - - - hwsem_counter.c + usbd_cdc_vcom_echo.c 1 - ..\libraries\nu_packages\Demo\hwsem_counter.c + ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c - - ccap_saver.c 1 ..\libraries\nu_packages\Demo\ccap_saver.c - - - ccap_demo.c + smp_demo.c 1 - ..\libraries\nu_packages\Demo\ccap_demo.c + ..\libraries\nu_packages\Demo\smp_demo.c - - - wormhole_demo.c + hwsem_counter.c 1 - ..\libraries\nu_packages\Demo\wormhole_demo.c + ..\libraries\nu_packages\Demo\hwsem_counter.c - - - usbd_cdc_vcom_echo.c + ccap_demo.c 1 - ..\libraries\nu_packages\Demo\usbd_cdc_vcom_echo.c + ..\libraries\nu_packages\Demo\ccap_demo.c @@ -2911,16 +5246,14 @@ nu_pkgs_nau88l25 - audio_test.c + acodec_nau88l25.c 1 - ..\libraries\nu_packages\AudioCodec\audio_test.c + ..\libraries\nu_packages\AudioCodec\acodec_nau88l25.c - - - acodec_nau88l25.c + audio_test.c 1 - ..\libraries\nu_packages\AudioCodec\acodec_nau88l25.c + ..\libraries\nu_packages\AudioCodec\audio_test.c @@ -2932,15 +5265,11 @@ 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice_core.c - - usbdevice.c 1 ..\..\..\components\legacy\usb\usbdevice\core\usbdevice.c - - hid.c 1 @@ -2952,44 +5281,34 @@ rt_usbh - hub.c + usbhost.c 1 - ..\..\..\components\legacy\usb\usbhost\core\hub.c + ..\..\..\components\legacy\usb\usbhost\core\usbhost.c - - driver.c 1 ..\..\..\components\legacy\usb\usbhost\core\driver.c - - - mass.c + hub.c 1 - ..\..\..\components\legacy\usb\usbhost\class\mass.c + ..\..\..\components\legacy\usb\usbhost\core\hub.c - - usbhost_core.c 1 ..\..\..\components\legacy\usb\usbhost\core\usbhost_core.c - - - usbhost.c + udisk.c 1 - ..\..\..\components\legacy\usb\usbhost\core\usbhost.c + ..\..\..\components\legacy\usb\usbhost\class\udisk.c - - - udisk.c + mass.c 1 - ..\..\..\components\legacy\usb\usbhost\class\udisk.c + ..\..\..\components\legacy\usb\usbhost\class\mass.c @@ -3001,43 +5320,31 @@ 1 ..\..\..\components\net\netdev\src\netdev.c - - netdev_ipaddr.c 1 ..\..\..\components\net\netdev\src\netdev_ipaddr.c - - dfs_net.c 1 ..\..\..\components\net\sal\dfs_net\dfs_net.c - - af_inet_lwip.c 1 ..\..\..\components\net\sal\impl\af_inet_lwip.c - - net_netdb.c 1 ..\..\..\components\net\sal\socket\net_netdb.c - - net_sockets.c 1 ..\..\..\components\net\sal\socket\net_sockets.c - - sal_socket.c 1 @@ -3049,32 +5356,44 @@ UTest - TC_uassert.c + utest.c 1 - ..\..\..\components\utilities\utest\TC_uassert.c + ..\..\..\components\utilities\utest\utest.c - - - utest.c + TC_uassert.c 1 - ..\..\..\components\utilities\utest\utest.c + ..\..\..\components\utilities\utest\TC_uassert.c + + ::CMSIS + + - + - + - + - + + + + + + project + 1 + + + +